diff -Nru vulkan-1.0.65.2+dfsg1/.appveyor.yml vulkan-1.1.73+dfsg/.appveyor.yml --- vulkan-1.0.65.2+dfsg1/.appveyor.yml 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/.appveyor.yml 2018-03-14 09:08:48.000000000 +0000 @@ -2,11 +2,17 @@ # http://www.appveyor.com/docs/appveyor-yml # +# This version starts a separte job for each platform config +# in order to get around the AppVeyor limit of 60 mins per job. + # build version format version: "{build}" +# Free accounts have a max of 1, but ask anyway. +max_jobs: 4 + os: - - Visual Studio 2015 + - Visual Studio 2013 environment: PYTHON_PATH: "C:/Python35" @@ -21,9 +27,40 @@ only: - master -# This replaces "automatic building" that would be defined under build: -build_script: +before_build: - "SET PATH=C:\\Python35;C:\\Python35\\Scripts;%PATH%" - - update_external_sources.bat --all - - build_windows_targets.bat - + - echo. + - echo Starting build for %APPVEYOR_REPO_NAME% + - echo Update external sources + - if %PLATFORM% == Win32 (if %CONFIGURATION% == Debug (update_external_sources.bat --32 --debug)) + - if %PLATFORM% == Win32 (if %CONFIGURATION% == Release (update_external_sources.bat --32 --release)) + - if %PLATFORM% == x64 (if %CONFIGURATION% == Debug (update_external_sources.bat --64 --debug)) + - if %PLATFORM% == x64 (if %CONFIGURATION% == Release (update_external_sources.bat --64 --release)) + # Determine the appropriate CMake generator for the current version of Visual Studio + - echo Determining VS version + - python .\scripts\determine_vs_version.py > vsversion.tmp + - set /p VS_VERSION=< vsversion.tmp + - echo Detected Visual Studio Version as %VS_VERSION% + - del /Q /F vsversion.tmp + - if %PLATFORM% == Win32 (set GENERATOR="Visual Studio %VS_VERSION%") + - if %PLATFORM% == x64 (set GENERATOR="Visual Studio %VS_VERSION% Win64") + # Generate build files using CMake for the build step. + - echo Generating CMake files for %GENERATOR% + - cd %TOP_DIR% + - mkdir build + - cd build + - cmake -G %GENERATOR% .. + - echo Building platform=%PLATFORM% configuration=%CONFIGURATION% + +platform: + - Win32 + - x64 + +configuration: + - Release + - Debug + +build: + parallel: true # enable MSBuild parallel builds + project: build/VULKAN.sln # path to Visual Studio solution or project + verbosity: quiet # quiet|minimal|normal|detailed diff -Nru vulkan-1.0.65.2+dfsg1/BUILD.md vulkan-1.1.73+dfsg/BUILD.md --- vulkan-1.0.65.2+dfsg1/BUILD.md 2018-01-10 14:15:30.000000000 +0000 +++ vulkan-1.1.73+dfsg/BUILD.md 2018-04-27 11:24:19.000000000 +0000 @@ -1,114 +1,238 @@ # Build Instructions -This document contains the instructions for building this repository on Linux and Windows. -This repository does not contain a Vulkan-capable driver. -Before proceeding, it is strongly recommended that you obtain a Vulkan driver from your graphics hardware vendor -and install it. +Instructions for building this repository on Linux, Windows, Android, and MacOS. + +## Index + +1. [Contributing](#contributing-to-the-repository) +2. [Repository Set-Up](#repository-set-up) +3. [Windows Build](#building-on-windows) +4. [Linux Build](#building-on-linux) +5. [Android Build](#building-on-android) +6. [MacOS build](#building-on-macos) + +## Contributing to the Repository + +If you intend to contribute, the preferred work flow is for you to develop +your contribution in a fork of this repository in your GitHub account and +then submit a pull request. +Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file in this repository for more details. + +## Repository Set-Up -## Contributing +### Display Drivers -If you intend to contribute, the preferred work flow is for you to develop your contribution -in a fork of this repo in your GitHub account and then submit a pull request. -Please see the [CONTRIBUTING](CONTRIBUTING.md) file in this repository for more details. +This repository does not contain a Vulkan-capable driver. +Before proceeding, it is strongly recommended that you obtain a Vulkan driver from your +graphics hardware vendor and install it properly. -## Git the Bits +### Download the Repository To create your local git repository: -``` -git clone https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers -``` - -## Linux Build - -The build process uses CMake to generate makefiles for this project. -The build generates the loader, layers, and tests. - -This repo has been built and tested on the two most recent Ubuntu LTS versions. -It should be straightforward to use it on other Linux distros. - -These packages are needed to build this repository: -``` -sudo apt-get install git cmake build-essential bison libx11-xcb-dev libxkbcommon-dev libmirclient-dev libwayland-dev libxrandr-dev -``` - -Example debug build (Note that the update\_external\_sources script used below builds external tools into predefined locations. See **Loader and Validation Layer Dependencies** for more information and other options): -``` -cd Vulkan-LoaderAndValidationLayers # cd to the root of the cloned git repository -./update_external_sources.sh -cmake -H. -Bdbuild -DCMAKE_BUILD_TYPE=Debug -cd dbuild -make -``` - -If you have installed a Vulkan driver obtained from your graphics hardware vendor, the install process should -have configured the driver so that the Vulkan loader can find and load it. - -If you want to use the loader and layers that you have just built: -``` -export LD_LIBRARY_PATH=/dbuild/loader -export VK_LAYER_PATH=/dbuild/layers -``` + + git clone https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers + +## Building On Windows + +### Windows Build Requirements + +Windows 7+ with the following software packages: + +- Microsoft Visual Studio 2013 Update 4 Professional, VS2015 (any version), or VS2017 (any version). +- [CMake](http://www.cmake.org/download/) + - Tell the installer to "Add CMake to the system PATH" environment variable. +- [Python 3](https://www.python.org/downloads) + - Select to install the optional sub-package to add Python to the system PATH + environment variable. + - Ensure the `pip` module is installed (it should be by default) + - Python3.3 or later is necessary for the Windows py.exe launcher that is used to select python3 + rather than python2 if both are installed +- [Git](http://git-scm.com/download/win) + - Tell the installer to allow it to be used for "Developer Prompt" as well as "Git Bash". + - Tell the installer to treat line endings "as is" (i.e. both DOS and Unix-style line endings). + - Install both the 32-bit and 64-bit versions, as the 64-bit installer does not install the + 32-bit libraries and tools. +- Notes for using [Cygwin](https://www.cygwin.com) + - First, in a Cygwin shell: + - `./update_external_sources.sh --no-build` + - Then, in a Visual Studio Developer Command Prompt: + - Ensure python3.x and CMake in are in the path + - Run `update_external_sources.bat --no-sync` + - Run build_windows_targets.bat cmake + +### Windows Build - Microsoft Visual Studio + +1. Open a Developer Command Prompt for VS201x +2. Change directory to `Vulkan-LoaderAndValidationLayers` -- the root of the cloned git repository +3. Run `update_external_sources.bat` -- this will download and build external components +4. Create a `build` directory, change into that directory, and run cmake + +For example, for VS2017 (generators for other versions are [specified here](#cmake-visual-studio-generators)): + + cmake -G "Visual Studio 15 2017 Win64" .. + +This will create a Windows solution file named `VULKAN.sln` in the build directory. + +Launch Visual Studio and open the "VULKAN.sln" solution file in the build folder. +You may select "Debug" or "Release" from the Solution Configurations drop-down list. +Start a build by selecting the Build->Build Solution menu item. +This solution copies the loader it built to each program's build directory +to ensure that the program uses the loader built from this solution. + +#### The Update External Sources Batch File + +Employing [optional parameters](#update-external-sources-optional-parameters) +to the **update_external_sources.bat** script can streamline repository set-up. + +### Windows Tests and Demos + +After making any changes to the repository, you should perform some quick sanity tests, +including the run_all_tests Powershell script and the cube demo with validation enabled. + +To run the validation test script, open a Powershell Console, +change to the build/tests directory, and run: + +For Release builds: + + .\run_all_tests.ps1 + +For Debug builds: + + .\run_all_tests.ps1 -Debug + +This script will run the following tests: + +- `vk_loader_validation_tests`: + Vulkan loader handle wrapping, allocation callback, and loader/layer interface tests +- `vk_layer_validation_tests`: + Test Vulkan validation layers +- `vkvalidatelayerdoc`: + Tests that validation database is up-to-date and is synchronized with the validation source code + +To run the Cube demo with validation in a Debug build configuration: + +- In the MSVC solution explorer, right-click on the `cube` project and select + `Set As Startup Project` +- Right click on cube again, select properties->Debugging->Command Arguments, change to + `--validate`, and save +- From the main menu, select Debug->Start Debugging, or from the toolbar click + `Local Windows Debugger` + +Other demos that can be found in the build/demos directory are: + +- `vulkaninfo`: Report GPU properties +- `smoketest`: A "smoke" test using more complex Vulkan rendering + +### Windows Notes + +#### CMake Visual Studio Generators + +The above example used Visual Studio 2017, and specified its generator as "Visual Studio 15 2017 Win64". +The chosen generator should match your Visual Studio version. Appropriate Visual Studio generators include: + +| Build Platform | 64-bit Generator | 32-bit Generator | +|------------------------------|-------------------------------|-------------------------| +| Microsoft Visual Studio 2013 | "Visual Studio 12 2013 Win64" | "Visual Studio 12 2013" | +| Microsoft Visual Studio 2015 | "Visual Studio 14 2015 Win64" | "Visual Studio 14 2015" | +| Microsoft Visual Studio 2017 | "Visual Studio 15 2017 Win64" | "Visual Studio 15 2017" | + +#### The Vulkan Loader Library + +Vulkan programs must be able to find and use the vulkan-1.dll library. +While several of the test and demo projects in the Windows solution set this up automatically, doing so manually may be necessary for custom projects or solutions. +Make sure the library is either installed in the C:\Windows\System32 folder, or that the PATH environment variable includes the folder where the library resides. + +To run Vulkan programs you must tell the Vulkan Loader where to find the libraries. +This is described in a `LoaderAndLayerInterface` document in the `loader` folder in this repository. +This describes both how ICDs and layers should be properly packaged, and how developers can point to ICDs and layers within their builds. + +## Building On Linux + +### Linux Build Requirements + +This repository has been built and tested on the two most recent Ubuntu LTS versions. +Currently, the oldest supported version is Ubuntu 14.04, meaning that the minimum supported compiler versions are GCC 4.8.2 and Clang 3.4, although earlier versions may work. +It should be straightforward to adapt this repository to other Linux distributions. + +**Required Package List:** + + sudo apt-get install git cmake build-essential libx11-xcb-dev libxkbcommon-dev libmirclient-dev libwayland-dev libxrandr-dev + +### Linux Build + +Example debug build (Note that the update\_external\_sources script used below builds external tools into predefined locations. +See **Loader and Validation Layer Dependencies** for more information and other options): + +1. In a Linux terminal, `cd Vulkan-LoaderAndValidationLayers` -- the root of the + cloned git repository +2. Execute `./update_external_sources.sh` -- this will download and build external components +3. Create a `build` directory, change into that directory, and run cmake: + + mkdir build + cd build + cmake -DCMAKE_BUILD_TYPE=Debug .. + +4. Run `make -j8` to begin the build + +If your build system supports ccache, you can enable that via CMake option `-DUSE_CCACHE=On` + +#### The Update External Sources script + +Employing [optional parameters](#update-external-sources-optional-parameters) +to the **update_external_sources.sh** script can streamline repository set-up. + +#### Using the new loader and layers + + export LD_LIBRARY_PATH=/build/loader + export VK_LAYER_PATH=/build/layers + You can run the `vulkaninfo` application to see which driver, loader and layers are being used. -The `LoaderAndLayerInterface` document in the `loader` folder in this repository is a specification that -describes both how ICDs and layers should be properly -packaged, and how developers can point to ICDs and layers within their builds. +The `LoaderAndLayerInterface` document in the `loader` folder in this repository +is a specification that describes both how ICDs and layers should be properly packaged, +and how developers can point to ICDs and layers within their builds. ### WSI Support Build Options -By default, the Vulkan Loader and Validation Layers are built with support for all 4 Vulkan-defined WSI display systems, Xcb, Xlib, Wayland, and Mir. It is recommended to build these modules with support for these -display systems to maximize their usability across Linux platforms. -If it is necessary to build these modules without support for one of the display systems, the appropriate CMake option of the form BUILD_WSI_xxx_SUPPORT can be set to OFF. See the top-level CMakeLists.txt file for more info. + +By default, the Vulkan Loader and Validation Layers are built with support for all 4 Vulkan-defined WSI display servers: Xcb, Xlib, Wayland, and Mir. +It is recommended to build the repository components with support for these display servers to maximize their usability across Linux platforms. +If it is necessary to build these modules without support for one of the display servers, the appropriate CMake option of the form `BUILD_WSI_xxx_SUPPORT` can be set to `OFF`. +See the top-level CMakeLists.txt file for more info. ### Linux Install to System Directories -Installing the files resulting from your build to the systems directories is optional since -environment variables can usually be used instead to locate the binaries. +Installing the files resulting from your build to the systems directories is optional since environment variables can usually be used instead to locate the binaries. There are also risks with interfering with binaries installed by packages. -If you are certain that you would like to install your binaries to system directories, -you can proceed with these instructions. +If you are certain that you would like to install your binaries to system directories, you can proceed with these instructions. -Assuming that you've built the code as described above and the current directory is still `dbuild`, -you can execute: +Assuming that you've built the code as described above and the current directory is still `build`, you can execute: -``` -sudo make install -``` + sudo make install This command installs files to: -* `/usr/local/include/vulkan`: Vulkan include files -* `/usr/local/lib`: Vulkan loader and layers shared objects -* `/usr/local/bin`: vulkaninfo application -* `/usr/local/etc/vulkan/explicit_layer.d`: Layer JSON files +- `/usr/local/include/vulkan`: Vulkan include files +- `/usr/local/lib`: Vulkan loader and layers shared objects +- `/usr/local/bin`: vulkaninfo application +- `/usr/local/etc/vulkan/explicit_layer.d`: Layer JSON files You may need to run `ldconfig` in order to refresh the system loader search cache on some Linux systems. -The list of installed files appears in the build directory in a file named `install_manifest.txt`. -You can easily remove the installed files with: +You can further customize the installation location by setting additional CMake variables to override their defaults. +For example, if you would like to install to `/tmp/build` instead of `/usr/local`, on your CMake command line specify: + + -DCMAKE_INSTALL_PREFIX=/tmp/build + -DDEST_DIR=/tmp/build -``` -cat install_manifest.txt | sudo xargs rm -``` - -You can further customize the installation location by setting additional CMake variables -to override their defaults. -For example, if you would like to install to `/tmp/build` instead of `/usr/local`, specify: - -``` --DCMAKE_INSTALL_PREFIX=/tmp/build --DDEST_DIR=/tmp/build -``` - -on your CMake command line and run `make install` as before. -The install step places the files in `/tmp/build`. - -Using the `CMAKE_INSTALL_PREFIX` to customize the install location also modifies the -loader search paths to include searching for layers in the specified install location. -In this example, setting `CMAKE_INSTALL_PREFIX` to `/tmp/build` causes the loader to -search `/tmp/build/etc/vulkan/explicit_layer.d` and `/tmp/build/share/vulkan/explicit_layer.d` +Then run `make install` as before. The install step places the files in `/tmp/build`. + +Using the `CMAKE_INSTALL_PREFIX` to customize the install location also modifies +the loader search paths to include searching for layers in the specified install location. +In this example, setting `CMAKE_INSTALL_PREFIX` to `/tmp/build` causes the loader to search +`/tmp/build/etc/vulkan/explicit_layer.d` and `/tmp/build/share/vulkan/explicit_layer.d` for the layer JSON files. -The loader also searches the "standard" system locations of `/etc/vulkan/explicit_layer.d` -and `/usr/share/vulkan/explicit_layer.d` after searching the two locations under `/tmp/build`. +The loader also searches the "standard" system locations of `/etc/vulkan/explicit_layer.d` and +`/usr/share/vulkan/explicit_layer.d` after searching the two locations under `/tmp/build`. You can further customize the installation directories by using the CMake variables `CMAKE_INSTALL_SYSCONFDIR` to rename the `etc` directory and `CMAKE_INSTALL_DATADIR` @@ -117,308 +241,472 @@ See the CMake documentation for more details on using these variables to further customize your installation. -Also see the `LoaderAndLayerInterface` document in the `loader` folder in this repository for more -information about loader operation. +Also see the `LoaderAndLayerInterface` document in the `loader` folder in this +repository for more information about loader operation. -Note that some executables in this repository (e.g., `cube`) use the "rpath" linker directive -to load the Vulkan loader from the build directory, `dbuild` in this example. -This means that even after installing the loader to the system directories, these executables -still use the loader from the build directory. +Note that some executables in this repository (e.g., `cube`) use the "rpath" linker directive to +load the Vulkan loader from the build directory, `build` in this example. +This means that even after installing the loader to the system directories, these executables still +use the loader from the build directory. -### Linux 32-bit support +### Linux Uninstall -Usage of this repository's contents in 32-bit Linux environments is not officially supported. -However, since this repository is supported on 32-bit Windows, these modules should generally -work on 32-bit Linux. +To uninstall the files from the system directories, you can execute: -Here are some notes for building 32-bit targets on a 64-bit Ubuntu "reference" platform: + sudo make uninstall -If not already installed, install the following 32-bit development libraries: +### Linux Tests and Demos -`gcc-multilib g++-multilib libx11-dev:i386` +After making any changes to the repository, you should perform some quick sanity tests, including +the run_all_tests shell script and the cube demo with validation enabled. -This list may vary depending on your distro and which windowing systems you are building for. +To run the **validation test script**, in a terminal change to the build/tests directory and run: -Set up your environment for building 32-bit targets: + VK_LAYER_PATH=../layers ./run_all_tests.sh -``` -export ASFLAGS=--32 -export CFLAGS=-m32 -export CXXFLAGS=-m32 -export PKG_CONFIG_LIBDIR=/usr/lib/i386-linux-gnu -``` - -Again, your PKG_CONFIG configuration may be different, depending on your distro. - -If the libraries in the `external` directory have already been built -for 64-bit targets, -delete or "clean" this directory and rebuild it with -the above settings using the `update_external_sources` shell script. -This is required because the libraries in `external` must be built for -32-bit in order to be usable by the rest of the components in the repository. +This script will run the following tests: -Finally, rebuild the repository using `cmake` and `make`, as explained above. +- `vk_loader_validation_tests`: Tests Vulkan Loader handle wrapping +- `vk_layer_validation_tests`: Test Vulkan validation layers +- `vkvalidatelayerdoc`: Tests that validation database is in up-to-date and in synchronization with + the validation source code -## Validation Test +To run the **Cube demo** with validation, in a terminal change to the `build/demos` +directory and run: -The test executables can be found in the dbuild/tests directory. -Some of the tests that are available: -- vk\_layer\_validation\_tests: Test Vulkan layers. + VK_LAYER_PATH=../layers ./cube --validate -There are also a few shell and Python scripts that run test collections (eg, -`run_all_tests.sh`). +Other demos that can be found in the `build/demos` directory are: -## Linux Demos +- `vulkaninfo`: report GPU properties +- `smoketest`: A "smoke" test using more complex Vulkan rendering -Some demos that can be found in the dbuild/demos directory are: -- vulkaninfo: report GPU properties -- cube: a textured spinning cube -- smoke/smoke: A "smoke" test using a more complex Vulkan demo +You can select which WSI subsystem is used to build the demos using a CMake option +called DEMOS_WSI_SELECTION. +Supported options are XCB (default), XLIB, WAYLAND, and MIR. +Note that you must build using the corresponding BUILD_WSI_*_SUPPORT enabled at the +base repository level (all SUPPORT options are ON by default). +For instance, creating a build that will use Xlib to build the demos, +your CMake command line might look like: -You can select which WSI subsystem is used to build the demos using a cmake option called DEMOS_WSI_SELECTION. -Supported options are XCB (default), XLIB, WAYLAND, and MIR. Note that you must build using the corresponding BUILD_WSI_*_SUPPORT enabled at the base repo level (all SUPPORT options are ON by default). -For instance, creating a build that will use Xlib to build the demos, your cmake command line might look like: + cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DDEMOS_WSI_SELECTION=XLIB -cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DDEMOS_WSI_SELECTION=XLIB +### Linux Notes -## Windows System Requirements +#### Linux 32-bit support -Windows 7+ with additional required software packages: +Usage of this repository's contents in 32-bit Linux environments is not officially supported. +However, since this repository is supported on 32-bit Windows, +these modules should generally work on 32-bit Linux. -- Microsoft Visual Studio 2013 Professional. Note: it is possible that lesser/older versions may work, but that has not been tested. -- [CMake](http://www.cmake.org/download/). Notes: - - Tell the installer to "Add CMake to the system PATH" environment variable. -- [Python 3](https://www.python.org/downloads). Notes: - - Select to install the optional sub-package to add Python to the system PATH environment variable. - - Ensure the pip module is installed (it should be by default) - - Need python3.3 or later to get the Windows py.exe launcher that is used to get python3 rather than python2 if both are installed on Windows - - 32 bit python works -- [Git](http://git-scm.com/download/win). - - Note: If you use Cygwin, you can normally use Cygwin's "git.exe", and "update\_external\_sources.sh --no-build" does support Cygwin's git. However, in order to use the "update\_external\_sources.bat" script, you must have this version. - - Tell the installer to allow it to be used for "Developer Prompt" as well as "Git Bash". - - Tell the installer to treat line endings "as is" (i.e. both DOS and Unix-style line endings). - - Install each a 32-bit and a 64-bit version, as the 64-bit installer does not install the 32-bit libraries and tools. -- glslang is required for demos and tests. - - [You can download and configure it (in a peer directory) here](https://github.com/KhronosGroup/glslang/blob/master/README.md) - - A windows batch file has been included that will pull and build the correct version. Run it from Developer Command Prompt for VS2013 like so: - - update\_external\_sources.bat --build-glslang (Note: see **Loader and Validation Layer Dependencies** below for other options) - -## Windows Build - MSVC - -Before building on Windows, you may want to modify the customize section in loader/loader.rc to so as to -set the version numbers and build description for your build. Doing so will set the information displayed -for the Properties->Details tab of the loader vulkan-1.dll file that is built. - -Build all Windows targets after installing required software and cloning the Loader and Validation Layer repo as described above by completing the following steps in a "Developer Command Prompt for VS2013" window (Note that the update\_external\_sources script used below builds external tools into predefined locations. See **Loader and Validation Layer Dependencies** for more information and other options): -``` -cd Vulkan-LoaderAndValidationLayers # cd to the root of the cloned git repository -update_external_sources.bat -build_windows_targets.bat -``` +Here are some notes for building 32-bit targets on a 64-bit Ubuntu "reference" platform: -At this point, you can use Windows Explorer to launch Visual Studio by double-clicking on the "VULKAN.sln" file in the \build folder. Once Visual Studio comes up, you can select "Debug" or "Release" from a drop-down list. You can start a build with either the menu (Build->Build Solution), or a keyboard shortcut (Ctrl+Shift+B). As part of the build process, Python scripts will create additional Visual Studio files and projects, along with additional source files. All of these auto-generated files are under the "build" folder. +If not already installed, install the following 32-bit development libraries: -Vulkan programs must be able to find and use the vulkan-1.dll library. Make sure it is either installed in the C:\Windows\System32 folder, or the PATH environment variable includes the folder that it is located in. +`gcc-multilib g++-multilib libx11-dev:i386` -To run Vulkan programs you must tell the icd loader where to find the libraries. -This is described in a `LoaderAndLayerInterface` document in the `loader` folder in this repository. -This specification describes both how ICDs and layers should be properly -packaged, and how developers can point to ICDs and layers within their builds. +This list may vary depending on your distribution and which windowing systems you are building for. -### Using Cygwin Git +Set up your environment for building 32-bit targets: -If you are using Cygwin git instead of win32-native git, you can use the *sh* script to sync using Cygwin's git (but not also build), then use the *bat* script to build (but not also sync). + export ASFLAGS=--32 + export CFLAGS=-m32 + export CXXFLAGS=-m32 + export PKG_CONFIG_LIBDIR=/usr/lib/i386-linux-gnu + +Again, your PKG_CONFIG configuration may be different, depending on your distribution. + +If the libraries in the `external` directory have already been built for 64-bit targets, +delete or "clean" this directory and rebuild it with the above settings using the +`update_external_sources` shell script. +This is required because the libraries in `external` must be built for 32-bit in order +to be usable by the rest of the components in the repository. -In a cygwin shell do this: -``` -./update_external_sources.sh --no-build -``` +Finally, rebuild the repository using `cmake` and `make`, as explained above. -Then in a Visual Studio Developer Command Prompt shell do this: -``` -update_external_sources.bat --no-sync -``` +## Building On Android -## Android Build Install the required tools for Linux and Windows covered above, then add the following. -### Android Studio + +### Android Build Requirements + - Install [Android Studio 2.3](https://developer.android.com/studio/index.html) or later. -- From the "Welcome to Android Studio" splash screen, add the following components using Configure > SDK Manager: +- From the "Welcome to Android Studio" splash screen, add the following components using + Configure > SDK Manager: - SDK Platforms > Android 6.0 and newer - SDK Tools > Android SDK Build-Tools - SDK Tools > Android SDK Platform-Tools - SDK Tools > Android SDK Tools - - SDK Tools > Android NDK + - SDK Tools > NDK #### Add Android specifics to environment +For each of the below, you may need to specify a different build-tools version, as Android Studio will roll it forward fairly regularly. + On Linux: -``` -export ANDROID_SDK_HOME=$HOME/Android/sdk -export ANDROID_NDK_HOME=$HOME/Android/sdk/ndk-bundle -export PATH=$ANDROID_SDK_HOME:$PATH -export PATH=$ANDROID_NDK_HOME:$PATH -export PATH=$ANDROID_SDK_HOME/build-tools/23.0.3:$PATH -``` + + export ANDROID_SDK_HOME=$HOME/Android/sdk + export ANDROID_NDK_HOME=$HOME/Android/sdk/ndk-bundle + export PATH=$ANDROID_SDK_HOME:$PATH + export PATH=$ANDROID_NDK_HOME:$PATH + export PATH=$ANDROID_SDK_HOME/build-tools/23.0.3:$PATH + On Windows: -``` -set ANDROID_SDK_HOME=%LOCALAPPDATA%\Android\sdk -set ANDROID_NDK_HOME=%LOCALAPPDATA%\Android\sdk\ndk-bundle -set PATH=%LOCALAPPDATA%\Android\sdk\ndk-bundle;%PATH% -``` + + set ANDROID_SDK_HOME=%LOCALAPPDATA%\Android\sdk + set ANDROID_NDK_HOME=%LOCALAPPDATA%\Android\sdk\ndk-bundle + set PATH=%LOCALAPPDATA%\Android\sdk\ndk-bundle;%PATH% + On OSX: -``` -export ANDROID_SDK_HOME=$HOME/Library/Android/sdk -export ANDROID_NDK_HOME=$HOME/Library/Android/sdk/ndk-bundle -export PATH=$ANDROID_NDK_PATH:$PATH -export PATH=$ANDROID_SDK_HOME/build-tools/23.0.3:$PATH -``` -Note: If jarsigner is missing from your platform, you can find it in the Android Studio install. -### Additional OSX System Requirements -Tested on OSX version 10.12.4 - - Setup Homebrew and components -- Follow instructions on [brew.sh](http://brew.sh) to get homebrew installed. -``` -/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -``` + + export ANDROID_SDK_HOME=$HOME/Library/Android/sdk + export ANDROID_NDK_HOME=$HOME/Library/Android/sdk/ndk-bundle + export PATH=$ANDROID_NDK_PATH:$PATH + export PATH=$ANDROID_SDK_HOME/build-tools/23.0.3:$PATH + +Note: If `jarsigner` is missing from your platform, you can find it in the +Android Studio install or in your Java installation. +If you do not have Java, you can get it with something like the following: + + sudo apt-get install openjdk-8-jdk + +#### Additional OSX System Requirements + +Tested on OSX version 10.13.3 + +Setup Homebrew and components + +- Follow instructions on [brew.sh](http://brew.sh) to get Homebrew installed. + + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + - Ensure Homebrew is at the beginning of your PATH: -``` -export PATH=/usr/local/bin:$PATH -``` -- Add packages with the following (may need refinement) -``` -brew install cmake python python3 git -``` -### Build steps for Android - -There are two options for building the Android layers. One using the SPIRV tools -provided as part of the Android NDK or build using upstream sources. -To build with SPIRV tools from the NDK, remove the build-android/third_party directory created -by running update_external_sources_android.sh, (or never run update_external_sources_android.sh). -Use the following script to build everything in the repo for Android, including validation layers, tests, demos, and APK packaging: -This script does retrieve and use the upstream SPRIV tools. -``` -cd build-android -./build_all.sh -``` + + export PATH=/usr/local/bin:$PATH + +- Add packages with the following: + + brew install cmake python + +### Android Build + +There are two options for building the Android layers. +Either using the SPIRV tools provided as part of the Android NDK, or using upstream sources. +To build with SPIRV tools from the NDK, remove the build-android/third_party directory created by +running update_external_sources_android.sh, (or avoid running update_external_sources_android.sh). +Use the following script to build everything in the repository for Android, including validation +layers, tests, demos, and APK packaging: This script does retrieve and use the upstream SPRIV tools. + + cd build-android + ./build_all.sh + Resulting validation layer binaries will be in build-android/libs. Test and demo APKs can be installed on production devices with: -``` -./install_all.sh -s -``` + + ./install_all.sh [-s ] + Note that there are no equivalent scripts on Windows yet, that work needs to be completed. The following per platform commands can be used for layer only builds: + #### Linux and OSX + Follow the setup steps for Linux or OSX above, then from your terminal: -``` -cd build-android -./update_external_sources_android.sh -./android-generate.sh -ndk-build -j $(sysctl -n hw.ncpu) -``` + + cd build-android + ./update_external_sources_android.sh --no-build + ./android-generate.sh + ndk-build -j4 + #### Windows + Follow the setup steps for Windows above, then from Developer Command Prompt for VS2013: -``` -cd build-android -update_external_sources_android.bat -android-generate.bat -ndk-build -``` -#### Android tests + + cd build-android + update_external_sources_android.bat + android-generate.bat + ndk-build + +### Android Tests and Demos + +After making any changes to the repository you should perform some quick sanity tests, +including the layer validation tests and the cube and smoke demos with validation enabled. + +#### Run Layer Validation Tests + Use the following steps to build, install, and run the layer validation tests for Android: -``` -cd build-android -./build_all.sh -adb install -r bin/VulkanLayerValidationTests.apk -adb shell am start com.example.VulkanLayerValidationTests/android.app.NativeActivity -``` + + cd build-android + ./build_all.sh + adb install -r bin/VulkanLayerValidationTests.apk + adb shell am start com.example.VulkanLayerValidationTests/android.app.NativeActivity + Alternatively, you can use the test_APK script to install and run the layer validation tests: -``` -test_APK.sh -s -p -f -``` -#### Android demos + + test_APK.sh -s -p -f + +#### Run Cube and Smoke with Validation + Use the following steps to build, install, and run Cube and Smoke for Android: -``` -cd build-android -./build_all.sh -adb install -r ../demos/android/cube/bin/cube.apk -adb shell am start com.example.Cube/android.app.NativeActivity -``` -To build, install, and run Cube with validation layers, first build layers using steps above, then run: -``` -cd build-android -./build_all.sh -adb install -r ../demos/android/cube-with-layers/bin/cube-with-layers.apk -adb shell am start com.example.CubeWithLayers/android.app.NativeActivity -adb shell am start -a android.intent.action.MAIN -c android-intent.category.LAUNCH -n com.example.CubeWithLayers/android.app.NativeActivity --es args "--validate" -``` -vkjson_info for Android is built as an executable for devices with root access. - -To use, simply push it to the device and run it: -``` -./build_all.sh -adb push obj/local//vkjson_info /data/tmp/ -adb shell /data/tmp/vkjson_info -``` -The resulting json file will be found in: -``` -/sdcard/Android/.json -``` -To build, install, and run the Smoke demo for Android, run the following, and any -prompts that come back from the script: -``` -./update_external_sources.sh --glslang -cd demos/smoke/android -export ANDROID_SDK_HOME= -export ANDROID_NDK_HOME= -./build-and-install -adb shell am start -a android.intent.action.MAIN -c android-intent.category.LAUNCH -n com.example.Smoke/android.app.NativeActivity --es args "--validate" -``` + + cd build-android + ./build_all.sh + adb install -r ../demos/android/cube/bin/cube.apk + adb shell am start com.example.Cube/android.app.NativeActivity + +To build, install, and run Cube with validation layers, +first build layers using steps above, then run: + + cd build-android + ./build_all.sh + adb install -r ../demos/android/cube-with-layers/bin/cube-with-layers.apk + +##### Run without validation enabled + + adb shell am start com.example.CubeWithLayers/android.app.NativeActivity + +##### Run with validation enabled + + adb shell am start -a android.intent.action.MAIN -c android-intent.category.LAUNCH -n com.example.CubeWithLayers/android.app.NativeActivity --es args "--validate" + +To build, install, and run the Smoke demo for Android, run the following, and any prompts that come back from the script: + + ./update_external_sources.sh --glslang + cd demos/smoke/android + export ANDROID_SDK_HOME= + export ANDROID_NDK_HOME= + ./build-and-install + adb shell am start -a android.intent.action.MAIN -c android-intent.category.LAUNCH -n com.example.Smoke/android.app.NativeActivity --es args "--validate" + +## Building on MacOS + +### MacOS Build Requirements + +Tested on OSX version 10.12.6 + +Setup Homebrew and components + +- Follow instructions on [brew.sh](http://brew.sh) to get Homebrew installed. + + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + +- Ensure Homebrew is at the beginning of your PATH: + + export PATH=/usr/local/bin:$PATH + +- Add packages with the following (may need refinement) + + brew install cmake python python3 git + +### Clone the Repository + +Clone the Vulkan-LoaderAndValidationLayers repository: + + git clone https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers.git + +### Get the External Libraries + +Change to the cloned directory (`cd Vulkan-LoaderAndValidationLayers`) and run the script: + + ./update_external_sources.sh + +This script downloads and builds the `glslang` and `MoltenVK` repositories. + +### MacOS build + +#### CMake Generators + +This repository uses CMake to generate build or project files that are +then used to build the repository. +The CMake generators explicitly supported in this repository are: + +- Unix Makefiles +- Xcode + +#### Building with the Unix Makefiles Generator + +This generator is the default generator, so all that is needed for a debug +build is: + + mkdir build + cd build + cmake -DCMAKE_BUILD_TYPE=Debug .. + make + +To speed up the build on a multi-core machine, use the `-j` option for `make` +to specify the number of cores to use for the build. +For example: + + make -j4 + +You can now run the demo applications from the command line: + + open demos/cube.app + open demos/cubepp.app + open demos/smoketest.app + open demos/vulkaninfo.app + +Or you can locate them from `Finder` and launch them from there. + +##### The Install Target and RPATH + +The applications you just built are "bundled applications", but the executables +are using the `RPATH` mechanism to locate runtime dependencies that are still +in your build tree. + +To see this, run this command from your `build` directory: + + otool -l demos/cube.app/Contents/MacOS/cube + +and note that the `cube` executable contains loader commands: + +- `LC_LOAD_DYLIB` to load `libvulkan.1.dylib` via an `@rpath` +- `LC_RPATH` that contains an absolute path to the build location of the Vulkan loader + +This makes the bundled application "non-transportable", meaning that it won't run +unless the Vulkan loader is on that specific absolute path. +This is useful for debugging the loader or other components built in this repository, +but not if you want to move the application to another machine or remove your build tree. + +To address this problem, run: + + make install + +This step "cleans up" the `RPATH` to remove any external references +and performs other bundle fix-ups. +After running `make install`, re-run the `otool` command again and note: + +- `LC_LOAD_DYLIB` is now `@executable_path/../MacOS/libvulkan.1.dylib` +- `LC_RPATH` is no longer present + +The "bundle fix-up" operation also puts a copy of the Vulkan loader into the bundle, +making the bundle completely self-contained and self-referencing. + +Note that the "install" target has a very different meaning compared to the Linux +"make install" target. +The Linux "install" copies the targets to system directories. +In MacOS, "install" means fixing up application bundles. +In both cases, the "install" target operations clean up the `RPATH`. + +##### The Non-bundled vulkaninfo Application + +There is also a non-bundled version of the `vulkaninfo` application that you can +run from the command line: + + demos/vulkaninfo + +If you run this before you run "make install", vulkaninfo's RPATH is already set +to point to the Vulkan loader in the build tree, so it has no trouble finding it. +But the loader will not find the MoltenVK driver and you'll see a message about an +incompatible driver. To remedy this: + + VK_ICD_FILENAMES=../external/MoltenVK/Package/Latest/MoltenVK/macOS/MoltenVK_icd.json demos/vulkaninfo + +If you run `vulkaninfo` after doing a "make install", the `RPATH` in the `vulkaninfo` application +got removed and the OS needs extra help to locate the Vulkan loader: + + DYLD_LIBRARY_PATH=loader VK_ICD_FILENAMES=../external/MoltenVK/Package/Latest/MoltenVK/macOS/MoltenVK_icd.json demos/vulkaninfo + +#### Building with the Xcode Generator + +To create and open an Xcode project: + + mkdir build-xcode + cd build-xcode + cmake -GXcode .. + open VULKAN.xcodeproj + +Within Xcode, you can select Debug or Release builds in the project's Build Settings. +You can also select individual schemes for working with specific applications like `cube`. ## Ninja Builds - All Platforms -The [Qt Creator IDE](https://qt.io/download-open-source/#section-2) can open a root CMakeList.txt as a project directly, and it provides tools within Creator to configure and generate Vulkan SDK build files for one to many targets concurrently, resolving configuration issues as needed. Alternatively, when invoking CMake use the -G Codeblocks Ninja option to generate Ninja build files to be used as project files for QtCreator -- Follow the steps defined elsewhere for the OS using the update\_external\_sources script or as shown in **Loader and Validation Layer Dependencies** below -- Open, configure, and build the gslang and spirv-tools CMakeList.txt files -- Then do the same with the Vulkan-LoaderAndValidationLayers CMakeList.txt file. -- In order to debug with QtCreator, a [Microsoft WDK: eg WDK 10](http://go.microsoft.com/fwlink/p/?LinkId=526733) is required. Note that installing the WDK breaks the MSVC vcvarsall.bat build scripts provided by MSVC, requiring that the LIB, INCLUDE, and PATH env variables be set to the WDK paths by some other means +The [Qt Creator IDE](https://qt.io/download-open-source/#section-2) can open a root CMakeList.txt +as a project directly, and it provides tools within Creator to configure and generate Vulkan SDK +build files for one to many targets concurrently. +Alternatively, when invoking CMake, use the `-G "Codeblocks - Ninja"` option to generate Ninja build +files to be used as project files for QtCreator + +- Follow the steps defined elsewhere for the OS using the update\_external\_sources script or as + shown in **Loader and Validation Layer Dependencies** below +- Open, configure, and build the glslang CMakeList.txt files. Note that building the glslang + project will provide access to spirv-tools and spirv-headers +- Then do the same with the Vulkan-LoaderAndValidationLayers CMakeList.txt file +- In order to debug with QtCreator, a + [Microsoft WDK: eg WDK 10](http://go.microsoft.com/fwlink/p/?LinkId=526733) is required. + +Note that installing the WDK breaks the MSVC vcvarsall.bat build scripts provided by MSVC, +requiring that the LIB, INCLUDE, and PATHenv variables be set to the WDK paths by some other means + +## Update External Sources Optional Parameters + +This script will default to building 64-bit _and_ 32-bit versions of debug _and_ release +configurations, which can take a substantial amount of time. +However, it supports the following options to select a particular build configuration which can +reduce the time needed for repository set-up: + +| Command Line Option | Function | +|----------------------|----------------------------------------------| +| --32 | Build 32-bit targets only | +| --64 | Build 64-bit targets only | +| --release | Perform release builds only | +| --debug | Perform debug builds only | +| --no-build | Sync without building targets | +| --no-sync | Skip repository sync step | + +For example, to target a Windows 64-bit debug development configuration, invoke the batch file as follows: + +`update_external_sources.bat --64 --debug` + +Similarly, invoking the same configuration for Linux would be: + +`update_external_sources.sh --64 --debug` ## Loader and Validation Layer Dependencies -gslang and SPIRV-Tools repos are required to build and run Loader and Validation Layer components. They are not git sub-modules of Vulkan-LoaderAndValidationLayers but Vulkan-LoaderAndValidationLayers is linked to specific revisions of gslang and spirv-tools. These can be automatically cloned and built to predefined locations with the update\_external\_sources scripts. If a custom configuration is required, do the following steps: -1) clone the repos: +The glslang repository is required to build and run Loader and Validation Layer components. +It is not a git sub-module of Vulkan-LoaderAndValidationLayers but Vulkan-LoaderAndValidationLayers +is linked to a specific revision of glslang. +This can be automatically cloned and built to predefined locations with the +`update_external_sources` scripts. +If a custom configuration is required, do the following steps: - git clone https://github.com/KhronosGroup/glslang.git - git clone https://github.com/KhronosGroup/SPIRV-Tools.git +1) clone the repository: + `git clone https://github.com/KhronosGroup/glslang.git` -2) checkout the correct version of each tree based on the contents of the glslang\_revision and spirv-tools\_revision files at the root of the Vulkan-LoaderAndValidationLayers tree (do the same anytime that Vulkan-LoaderAndValidationLayers is updated from remote) +2) checkout the correct version of the tree based on the contents of the +glslang\_revision file at the root of the Vulkan-LoaderAndValidationLayers tree +(do the same anytime that Vulkan-LoaderAndValidationLayers is updated from remote) -_on windows_ + - On Windows - git checkout < [path to Vulkan-LoaderAndValidationLayers]\glslang_revision [in glslang repo] - git checkout < [path to Vulkan-LoaderAndValidationLayers]\spirv-tools_revision[in spriv-tools repo] + ```script + git checkout < [path to Vulkan-LoaderAndValidationLayers]\glslang_revision [in glslang repo] + ``` -*non windows* + - Non Windows - git checkout `cat [path to Vulkan-LoaderAndValidationLayers]\glslang_revision` [in glslang repo] - git checkout `cat [path to Vulkan-LoaderAndValidationLayers]\spirv-tools_revision` [in spriv-tools repo] + ```script + git checkout `cat [path to Vulkan-LoaderAndValidationLayers]\glslang_revision` [in glslang repo] + ``` -3) Configure the gslang and spirv-tools source trees with cmake and build them with your IDE of choice +3) Configure the glslang source tree with CMake and build it with your IDE of choice -4) Enable the CUSTOM\_GSLANG\_BIN\_PATH and CUSTOM\_SPIRV\_TOOLS\_BIN\_PATH options in the Vulkan-LoaderAndValidationLayers cmake configuration and point the GSLANG\_BINARY\_PATH and SPIRV\_TOOLS\_BINARY\_PATH variables to the correct location +4) Enable the `CUSTOM_GLSLANG_BIN_PATH` and `CUSTOM_SPIRV_TOOLS_BIN_PATH` options in the Vulkan-LoaderAndValidationLayers + CMake configuration and point the `GLSLANG_BINARY_PATH` and `SPIRV_TOOLS_BINARY_PATH` variables to the correct location -5) If building on Windows with MSVC, set DISABLE\_BUILDTGT\_DIR\_DECORATION to _On_. If building on Windows, but without MSVC set DISABLE\_BUILD\_PATH\_DECORATION to _On_ +5) If building on Windows with MSVC, set `DISABLE_BUILDTGT_DIR_DECORATION` to _On_. + If building on Windows, but without MSVC set `DISABLE_BUILD_PATH_DECORATION` to _On_ -## Optional software packages: +## Optional software packages -- [Cygwin for windows](https://www.cygwin.com/). Notes: - - Cygwin provides some Linux-like tools, which are valuable for obtaining the source code, and running CMake. - Especially valuable are the BASH shell and git packages. - - If you don't want to use Cygwin, there are other shells and environments that can be used. - You can also use a Git package that doesn't come from Cygwin. +- [Cygwin for windows](https://www.cygwin.com/) + - Cygwin provides some Linux-like tools, which can be valuable for working with the repository, + such as the BASH shell and git packages + - With appropriate adjustments, it is possible to use other shells and environments as well -- [Ninja on all platforms](https://github.com/ninja-build/ninja/releases). [The Ninja-build project](ninja-build.org). [Ninja Users Manual](ninja-build.org/manual.html) +- [Ninja on all platforms](https://github.com/ninja-build/ninja/releases) +- [The Ninja-build project](https://ninja-build.org) +- [Ninja Users Manual](https://ninja-build.org/manual.html) - [QtCreator as IDE for CMake builds on all platforms](https://qt.io/download-open-source/#section-2) diff -Nru vulkan-1.0.65.2+dfsg1/build_windows_targets.bat vulkan-1.1.73+dfsg/build_windows_targets.bat --- vulkan-1.0.65.2+dfsg1/build_windows_targets.bat 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/build_windows_targets.bat 2018-03-14 09:08:48.000000000 +0000 @@ -1,122 +1,170 @@ -echo off -REM -REM This Windows batch file builds this repository for the following targets: -REM 64/32-bit Release/Debug -REM It uses CMake to genererate the project files and then invokes msbuild -REM to build them. -REM The update_external_sources.bat batch file must be executed before running -REM this batch file -REM -REM Arguments: -REM None: Runs CMake and builds all 4 combinations -REM Argument contains: -REM cmake (case insensitive): Deletes build and build32 and runs just CMake on both -REM 32: Deletes build32, runs CMake and builds 32-bit versions -REM 64: Deletes build, runs CMake and builds 64-bit versions -REM Example: -REM build_windows_targets.bat 64 -REM deletes build, creates build, runs CMake and compiles 64-bit Debug and Release. - -set do_cmake=0 -set do_32=1 -set do_64=1 -if "%1"=="" goto no_args -set do_cmake=0 -set do_32=0 -set do_64=0 -for %%a in (%*) do ( - echo.%%a | %WINDIR%\system32\find.exe /I "cmake">Nul && (set do_cmake=1) - echo.%%a | %WINDIR%\system32\find.exe "32">Nul && (set do_32=1) - echo.%%a | %WINDIR%\system32\find.exe "64">Nul && (set do_64=1) -) -:no_args -if %do_cmake%==0 ( - if %do_32%==0 ( - if %do_64%==0 ( - echo No valid parameters specified. - exit /b 1 - ) - ) -) - -REM Determine the appropriate CMake strings for the current version of Visual Studio -echo Determining VS version -python .\scripts\determine_vs_version.py > vsversion.tmp -set /p VS_VERSION=< vsversion.tmp -echo Detected Visual Studio Version as %VS_VERSION% -del /Q /F vsversion.tmp - -if %do_cmake%==1 ( - rmdir /Q /S build - rmdir /Q /S build32 - mkdir build - pushd build - echo Generating 64-bit CMake files for Visual Studio %VS_VERSION% - cmake -G "Visual Studio %VS_VERSION% Win64" .. - popd - mkdir build32 - pushd build32 - echo Generating 32-bit CMake files for Visual Studio %VS_VERSION% - cmake -G "Visual Studio %VS_VERSION%" .. - popd -) - -REM ******************************************* -REM 64-bit build -REM ******************************************* -if %do_64%==1 ( - rmdir /Q /S build - mkdir build - pushd build - echo Generating 64-bit CMake files for Visual Studio %VS_VERSION% - cmake -G "Visual Studio %VS_VERSION% Win64" .. - echo Building 64-bit Debug - msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Debug /maxcpucount /verbosity:quiet - if errorlevel 1 ( - echo. - echo 64-bit Debug build failed! - popd - exit /b 1 - ) - - echo Building 64-bit Release - msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Release /maxcpucount /verbosity:quiet - if errorlevel 1 ( - echo. - echo 64-bit Release build failed! - popd - exit /b 1 - ) - popd -) - -REM ******************************************* -REM 32-bit build -REM ******************************************* - -if %do_32%==1 ( - rmdir /Q /S build32 - mkdir build32 - pushd build32 - echo Generating 32-bit CMake files for Visual Studio %VS_VERSION% - cmake -G "Visual Studio %VS_VERSION%" .. - echo Building 32-bit Debug - msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Debug /maxcpucount /verbosity:quiet - if errorlevel 1 ( - echo. - echo 32-bit Debug build failed! - popd - exit /b 1 - ) - - echo Building 32-bit Release - msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Release /maxcpucount /verbosity:quiet - if errorlevel 1 ( - echo. - echo 32-bit Release build failed! - popd - exit /b 1 - ) - popd -) -exit /b 0 +echo off +REM +REM This Windows batch file builds this repository for the following targets: +REM 64/32-bit Release/Debug +REM It uses CMake to genererate the project files and then invokes msbuild +REM to build them. +REM The update_external_sources.bat batch file must be executed before running +REM this batch file +REM +REM Arguments: +REM None: Runs CMake and builds all 4 combinations +REM Argument contains: +REM cmake (case insensitive): Deletes build and build32 and runs just CMake on both +REM 32: Deletes build32, runs CMake and builds 32-bit versions +REM 64: Deletes build, runs CMake and builds 64-bit versions +REM debug (case insensitive): Builds just the debug config of a 32 and/or 64-bit build +REM release (case insensitive): Builds just the release config of a 32 and/or 64-bit build +REM Notes: +REM cmake: When specified, generate the CMake build files only - don't compile +REM 32/64: Specifying neither or both builds both +REM debug/release: Specifying neither or both builds both +REM Examples: +REM build_windows_targets.bat 64 +REM -- deletes build, creates build, runs CMake and compiles 64-bit Debug and Release. +REM build_windows_targets.bat 64 debug +REM -- deletes build, creates build, runs CMake and compiles 64-bit Debug. + +set arg_cmake=0 +set arg_32=0 +set arg_64=0 +set arg_debug=0 +set arg_release=0 + +set do_cmake=0 +set do_32=0 +set do_64=0 +set do_debug=0 +set do_release=0 + +for %%a in (%*) do ( + echo.%%a | %WINDIR%\system32\find.exe /I "cmake">Nul && (set arg_cmake=1) + echo.%%a | %WINDIR%\system32\find.exe "32">Nul && (set arg_32=1) + echo.%%a | %WINDIR%\system32\find.exe "64">Nul && (set arg_64=1) + echo.%%a | %WINDIR%\system32\find.exe /I "debug">Nul && (set arg_debug=1) + echo.%%a | %WINDIR%\system32\find.exe /I "release">Nul && (set arg_release=1) +) + +if %arg_32%==1 ( + set do_32=1 +) +if %arg_64%==1 ( + set do_64=1 +) +if %arg_32%==0 ( + if %arg_64%==0 ( + set do_32=1 + set do_64=1 + ) +) + +if %arg_debug%==1 ( + set do_debug=1 +) +if %arg_release%==1 ( + set do_release=1 +) +if %arg_debug%==0 ( + if %arg_release%==0 ( + set do_debug=1 + set do_release=1 + ) +) + +if %arg_cmake%==1 ( + set do_cmake=1 + set do_32=0 + set do_64=0 + set do_debug=0 + set do_release=0 +) + +REM Determine the appropriate CMake strings for the current version of Visual Studio +echo Determining VS version +python .\scripts\determine_vs_version.py > vsversion.tmp +set /p VS_VERSION=< vsversion.tmp +echo Detected Visual Studio Version as %VS_VERSION% +del /Q /F vsversion.tmp + +if %do_cmake%==1 ( + rmdir /Q /S build + rmdir /Q /S build32 + mkdir build + pushd build + echo Generating 64-bit CMake files for Visual Studio %VS_VERSION% + cmake -G "Visual Studio %VS_VERSION% Win64" .. + popd + mkdir build32 + pushd build32 + echo Generating 32-bit CMake files for Visual Studio %VS_VERSION% + cmake -G "Visual Studio %VS_VERSION%" .. + popd +) + +REM ******************************************* +REM 64-bit build +REM ******************************************* +if %do_64%==1 ( + rmdir /Q /S build + mkdir build + pushd build + echo Generating 64-bit CMake files for Visual Studio %VS_VERSION% + cmake -G "Visual Studio %VS_VERSION% Win64" .. + if %do_debug% equ 1 ( + echo Building 64-bit Debug + msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Debug /maxcpucount /verbosity:quiet + if errorlevel 1 ( + echo. + echo 64-bit Debug build failed! + popd + exit /b 1 + ) + ) + + if %do_release%==1 ( + echo Building 64-bit Release + msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Release /maxcpucount /verbosity:quiet + if errorlevel 1 ( + echo. + echo 64-bit Release build failed! + popd + exit /b 1 + ) + ) + popd +) + +REM ******************************************* +REM 32-bit build +REM ******************************************* + +if %do_32%==1 ( + rmdir /Q /S build32 + mkdir build32 + pushd build32 + echo Generating 32-bit CMake files for Visual Studio %VS_VERSION% + cmake -G "Visual Studio %VS_VERSION%" .. + if %do_debug%==1 ( + echo Building 32-bit Debug + msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Debug /maxcpucount /verbosity:quiet + if errorlevel 1 ( + echo. + echo 32-bit Debug build failed! + popd + exit /b 1 + ) + ) + + if %do_release%==1 ( + echo Building 32-bit Release + msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Release /maxcpucount /verbosity:quiet + if errorlevel 1 ( + echo. + echo 32-bit Release build failed! + popd + exit /b 1 + ) + ) + popd +) +exit /b 0 diff -Nru vulkan-1.0.65.2+dfsg1/CMakeLists.txt vulkan-1.1.73+dfsg/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/CMakeLists.txt 2018-01-10 14:15:30.000000000 +0000 +++ vulkan-1.1.73+dfsg/CMakeLists.txt 2018-05-04 08:50:24.000000000 +0000 @@ -2,6 +2,10 @@ # refer to the root source directory of the project as ${VULKAN_SOURCE_DIR} and # to the root binary directory of the project as ${VULKAN_BINARY_DIR}. cmake_minimum_required(VERSION 2.8.11) + +# This must come before the project command. +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "Minimum OS X deployment version") + project (VULKAN) # set (CMAKE_VERBOSE_MAKEFILE 1) @@ -15,12 +19,35 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake") find_package(PythonInterp 3 REQUIRED) -if(CMAKE_SYSTEM_NAME STREQUAL "Linux") +option(USE_CCACHE "Use ccache" OFF) +if (USE_CCACHE) + find_program(CCACHE_FOUND ccache) + if(CCACHE_FOUND) + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) + endif(CCACHE_FOUND) +endif() + +if(APPLE) + # CMake versions 3 or later need CMAKE_MACOSX_RPATH defined. + # This avoids the CMP0042 policy message. + set(CMAKE_MACOSX_RPATH 1) + # The "install" target for MacOS fixes up bundles in place. + set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}) +endif() + +# Enable cmake folders +set_property(GLOBAL PROPERTY USE_FOLDERS ON) +set(LVL_TARGET_FOLDER lvl_cmake_targets) + +if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin") set(FALLBACK_CONFIG_DIRS "/etc/xdg" CACHE STRING "Search path to use when XDG_CONFIG_DIRS is unset or empty or the current process is SUID/SGID. Default is freedesktop compliant.") set(FALLBACK_DATA_DIRS "/usr/local/share:/usr/share" CACHE STRING "Search path to use when XDG_DATA_DIRS is unset or empty or the current process is SUID/SGID. Default is freedesktop compliant.") +endif() +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") include(FindPkgConfig) option(BUILD_WSI_XCB_SUPPORT "Build XCB WSI support" ON) option(BUILD_WSI_XLIB_SUPPORT "Build Xlib WSI support" ON) @@ -67,7 +94,11 @@ set(COMMON_COMPILE_FLAGS "${COMMON_COMPILE_FLAGS} -Wimplicit-fallthrough=0") endif() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 ${COMMON_COMPILE_FLAGS}") + if (APPLE) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_COMPILE_FLAGS}") + else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 ${COMMON_COMPILE_FLAGS}") + endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_COMPILE_FLAGS} -std=c++11 -fno-rtti") if (UNIX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") @@ -85,6 +116,10 @@ # Warn about potentially uninitialized variables add_compile_options("$<$:/w34701>") add_compile_options("$<$:/w34703>") + # Warn about different indirection types. + add_compile_options("$<$:/w34057>") + # Warn about signed/unsigned mismatch. + add_compile_options("$<$:/w34245>") endif() if(NOT WIN32) @@ -95,6 +130,7 @@ # is WIN32 option(DISABLE_BUILD_PATH_DECORATION "Disable the decoration of the gslang and SPIRV-Tools build path with MSVC build type info" OFF) option(DISABLE_BUILDTGT_DIR_DECORATION "Disable the decoration of the gslang and SPIRV-Tools build path with target info" OFF) + option(ENABLE_WIN10_ONECORE "Link the loader with OneCore umbrella libraries" OFF) # For Windows, since 32-bit and 64-bit items can co-exist, we build each in its own build directory. # 32-bit target data goes in build32, and 64-bit target data goes into build. So, include/link the @@ -118,7 +154,11 @@ option(BUILD_TESTS "Build tests" ON) option(BUILD_LAYERS "Build layers" ON) option(BUILD_DEMOS "Build demos" ON) -option(BUILD_VKJSON "Build vkjson" ON) +if (APPLE) + option(BUILD_VKJSON "Build vkjson" OFF) +else() + option(BUILD_VKJSON "Build vkjson" ON) +endif() option(BUILD_ICD "Build icd" ON) option(CUSTOM_GLSLANG_BIN_ROOT "Use the user defined GLSLANG_BINARY_ROOT" OFF) option(CUSTOM_SPIRV_TOOLS_BIN_ROOT "Use the user defined SPIRV_TOOLS*BINARY_ROOT paths" OFF) @@ -129,7 +169,7 @@ set(SPIRV_TOOLS_OPT_BINARY_ROOT "${CMAKE_BINARY_DIR}/../SPIRV-Tools/opt" CACHE STRING "User defined path to the SPIRV-Tools-opt binaries for this project") # Define a variable for a default root location to the gslang, SPIRV-Tools and other external sources and cache it to allow the user to customize it as needed -set(EXTERNAL_SOURCE_ROOT "${CMAKE_SOURCE_DIR}/external" CACHE STRING "Root path to external sources such as glslang and SPIRV-Tools") +set(EXTERNAL_SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/external" CACHE STRING "Root path to external sources such as glslang and SPIRV-Tools") if (WIN32) @@ -166,10 +206,10 @@ set (SPIRV_TOOLS_OPT_SEARCH_PATH "${SPIRV_TOOLS_OPT_BINARY_ROOT}/${BUILDTGT_DIR}/source/opt/${RELEASE_DECORATION}") set (SPIRV_TOOLS_OPT_DEBUG_SEARCH_PATH "${SPIRV_TOOLS_OPT_BINARY_ROOT}/${BUILDTGT_DIR}/source/opt/${DEBUG_DECORATION}") else() - set (SPIRV_TOOLS_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/spirv-tools/${BUILDTGT_DIR}/source/${RELEASE_DECORATION}") - set (SPIRV_TOOLS_DEBUG_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/spirv-tools/${BUILDTGT_DIR}/source/${DEBUG_DECORATION}") - set (SPIRV_TOOLS_OPT_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/spirv-tools/${BUILDTGT_DIR}/source/opt/${RELEASE_DECORATION}") - set (SPIRV_TOOLS_OPT_DEBUG_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/spirv-tools/${BUILDTGT_DIR}/source/opt/${DEBUG_DECORATION}") + set (SPIRV_TOOLS_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/glslang/${BUILDTGT_DIR}/External/spirv-tools/source/${RELEASE_DECORATION}") + set (SPIRV_TOOLS_DEBUG_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/glslang/${BUILDTGT_DIR}/External/spirv-tools/source/${DEBUG_DECORATION}") + set (SPIRV_TOOLS_OPT_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/glslang/${BUILDTGT_DIR}/External/spirv-tools/source/opt/${RELEASE_DECORATION}") + set (SPIRV_TOOLS_OPT_DEBUG_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/glslang/${BUILDTGT_DIR}/External/spirv-tools/source/opt/${DEBUG_DECORATION}") endif() else() # not WIN32 @@ -189,13 +229,13 @@ set (SPIRV_TOOLS_SEARCH_PATH "${SPIRV_TOOLS_BINARY_ROOT}/source" ) set (SPIRV_TOOLS_OPT_SEARCH_PATH "${SPIRV_TOOLS_OPT_BINARY_ROOT}/source/opt" ) else() - set (SPIRV_TOOLS_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/spirv-tools/${BUILDTGT_DIR}/source" "${CMAKE_SOURCE_DIR}/../x86_64/lib/spirv-tools" ) - set (SPIRV_TOOLS_OPT_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/spirv-tools/${BUILDTGT_DIR}/source/opt" "${CMAKE_SOURCE_DIR}/../x86_64/lib/spirv-tools" ) + set (SPIRV_TOOLS_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/glslang/${BUILDTGT_DIR}/External/spirv-tools/source" "${CMAKE_SOURCE_DIR}/../x86_64/lib/spirv-tools" ) + set (SPIRV_TOOLS_OPT_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/glslang/${BUILDTGT_DIR}/External/spirv-tools/source/opt" "${CMAKE_SOURCE_DIR}/../x86_64/lib/spirv-tools" ) endif() endif() find_program(GLSLANG_VALIDATOR NAMES glslangValidator - HINTS "${CMAKE_SOURCE_DIR}/external/glslang/${BUILDTGT_DIR}/install/bin" + HINTS "${EXTERNAL_SOURCE_ROOT}/glslang/${BUILDTGT_DIR}/install/bin" "${GLSLANG_BINARY_ROOT}/StandAlone" "${PROJECT_SOURCE_DIR}/external/${BINDATA_DIR}") @@ -203,11 +243,8 @@ "${CMAKE_SOURCE_DIR}/../glslang" DOC "Path to SPIRV/spirv.hpp") -find_path(SPIRV_TOOLS_INCLUDE_DIR spirv-tools/libspirv.h HINTS "${EXTERNAL_SOURCE_ROOT}/spirv-tools/include" - "${EXTERNAL_SOURCE_ROOT}/SPIRV-Tools/include" - "${CMAKE_SOURCE_DIR}/../spirv-tools/include" - "${CMAKE_SOURCE_DIR}/../SPIRV-Tools/include" - "${EXTERNAL_SOURCE_ROOT}/source/spirv-tools/external/include" +find_path(SPIRV_TOOLS_INCLUDE_DIR spirv-tools/libspirv.h HINTS "${EXTERNAL_SOURCE_ROOT}/glslang/External/spirv-tools/include" + "${CMAKE_SOURCE_DIR}/../glslang/External/spirv-tools/include" DOC "Path to spirv-tools/libspirv.h") find_library(GLSLANG_LIB NAMES glslang @@ -257,9 +294,9 @@ HINTS ${GLSLANG_DEBUG_SEARCH_PATH} ) find_library(SPIRV_REMAPPER_DLIB NAMES SPVRemapperd HINTS ${GLSLANG_DEBUG_SEARCH_PATH} ) - find_library(SPIRV_TOOLS_DLIB NAMES SPIRV-Tools + find_library(SPIRV_TOOLS_DLIB NAMES SPIRV-Toolsd HINTS ${SPIRV_TOOLS_DEBUG_SEARCH_PATH} ) - find_library(SPIRV_TOOLS_OPT_DLIB NAMES SPIRV-Tools-opt + find_library(SPIRV_TOOLS_OPT_DLIB NAMES SPIRV-Tools-optd HINTS ${SPIRV_TOOLS_OPT_DEBUG_SEARCH_PATH} ) set_target_properties(glslang PROPERTIES @@ -305,29 +342,49 @@ ) endmacro() +# Define macro used for generating header files containing commit IDs for external dependencies +macro(run_external_revision_generate source_dir symbol_name output) + add_custom_command(OUTPUT ${output} + # NOTE: If you modify this call to use --rev_file instead of --git_dir (to read the commit ID from a file instead of + # parsing from a Git repository), you probably also want to add the revision file to the list of DEPENDS on the + # subsequent line (to ensure that the script is re-run when the revision file is modified). + COMMAND ${PYTHON_CMD} ${SCRIPTS_DIR}/external_revision_generator.py --git_dir ${source_dir} -s ${symbol_name} -o ${output} + DEPENDS ${SCRIPTS_DIR}/external_revision_generator.py ${source_dir}/.git/HEAD ${source_dir}/.git/index + ) +endmacro() + # Custom target for generated vulkan helper file dependencies +set(generate_helper_files_DEPENDS) +if(BUILD_LAYERS) + LIST(APPEND generate_helper_files_DEPENDS spirv_tools_commit_id.h) +endif() add_custom_target(generate_helper_files DEPENDS vk_enum_string_helper.h - vk_struct_size_helper.h - vk_struct_size_helper.c vk_safe_struct.h vk_safe_struct.cpp vk_object_types.h vk_layer_dispatch_table.h vk_dispatch_table_helper.h vk_extension_helper.h + vk_typemap_helper.h + ${generate_helper_files_DEPENDS} ) +set_target_properties(generate_helper_files PROPERTIES FOLDER ${LVL_TARGET_FOLDER}) # Rules to build generated helper files run_vk_xml_generate(loader_extension_generator.py vk_layer_dispatch_table.h) run_vk_xml_generate(dispatch_table_helper_generator.py vk_dispatch_table_helper.h) run_vk_xml_generate(helper_file_generator.py vk_safe_struct.h) run_vk_xml_generate(helper_file_generator.py vk_safe_struct.cpp) -run_vk_xml_generate(helper_file_generator.py vk_struct_size_helper.h) -run_vk_xml_generate(helper_file_generator.py vk_struct_size_helper.c) run_vk_xml_generate(helper_file_generator.py vk_enum_string_helper.h) run_vk_xml_generate(helper_file_generator.py vk_object_types.h) run_vk_xml_generate(helper_file_generator.py vk_extension_helper.h) +run_vk_xml_generate(helper_file_generator.py vk_typemap_helper.h) +if(BUILD_LAYERS) + run_external_revision_generate(${EXTERNAL_SOURCE_ROOT}/glslang/External/spirv-tools SPIRV_TOOLS_COMMIT_ID spirv_tools_commit_id.h) +endif() + + if(NOT WIN32) include(GNUInstallDirs) @@ -358,6 +415,32 @@ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) endif() +# Layer Utils Library +# For Windows, we use a static lib because the Windows loader has a fairly restrictive loader search +# path that can't be easily modified to point it to the same directory that contains the layers. +set(VKLAYER_UTILS_VLF_SOURCES + layers/vk_layer_config.cpp + layers/vk_layer_extension_utils.cpp + layers/vk_layer_utils.cpp + layers/vk_format_utils.cpp + ) +if (WIN32) + add_library(VkLayer_utils STATIC ${VKLAYER_UTILS_VLF_SOURCES}) + target_compile_definitions(VkLayer_utils PUBLIC _CRT_SECURE_NO_WARNINGS) +else() + add_library(VkLayer_utils SHARED ${VKLAYER_UTILS_VLF_SOURCES}) + if(INSTALL_LVL_FILES) + install(TARGETS VkLayer_utils DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() +endif() +add_dependencies(VkLayer_utils generate_helper_files) +target_include_directories( + VkLayer_utils PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/loader + ${CMAKE_CURRENT_SOURCE_DIR}/include/vulkan + ${CMAKE_CURRENT_BINARY_DIR} + ) + add_definitions(-DAPI_NAME="${API_NAME}") # loader: Generic VULKAN ICD loader diff -Nru vulkan-1.0.65.2+dfsg1/common/android_util.cpp vulkan-1.1.73+dfsg/common/android_util.cpp --- vulkan-1.0.65.2+dfsg1/common/android_util.cpp 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/common/android_util.cpp 2018-03-14 09:08:48.000000000 +0000 @@ -19,6 +19,7 @@ #include "android_util.h" #include #include +#include #include #include #include diff -Nru vulkan-1.0.65.2+dfsg1/common/vulkan_wrapper.cpp vulkan-1.1.73+dfsg/common/vulkan_wrapper.cpp --- vulkan-1.0.65.2+dfsg1/common/vulkan_wrapper.cpp 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/common/vulkan_wrapper.cpp 2018-04-27 11:24:19.000000000 +0000 @@ -31,6 +31,8 @@ vkEnumeratePhysicalDevices = reinterpret_cast(dlsym(libvulkan, "vkEnumeratePhysicalDevices")); vkGetPhysicalDeviceFeatures = reinterpret_cast(dlsym(libvulkan, "vkGetPhysicalDeviceFeatures")); + vkGetPhysicalDeviceFeatures2 = + reinterpret_cast(dlsym(libvulkan, "vkGetPhysicalDeviceFeatures2")); vkGetPhysicalDeviceFormatProperties = reinterpret_cast(dlsym(libvulkan, "vkGetPhysicalDeviceFormatProperties")); vkGetPhysicalDeviceImageFormatProperties = reinterpret_cast( @@ -254,6 +256,7 @@ PFN_vkDestroyInstance vkDestroyInstance; PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices; PFN_vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFeatures; +PFN_vkGetPhysicalDeviceFeatures2 vkGetPhysicalDeviceFeatures2; PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties; PFN_vkGetPhysicalDeviceImageFormatProperties vkGetPhysicalDeviceImageFormatProperties; PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties; diff -Nru vulkan-1.0.65.2+dfsg1/common/vulkan_wrapper.h vulkan-1.1.73+dfsg/common/vulkan_wrapper.h --- vulkan-1.0.65.2+dfsg1/common/vulkan_wrapper.h 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/common/vulkan_wrapper.h 2018-04-27 11:24:19.000000000 +0000 @@ -34,6 +34,7 @@ extern PFN_vkDestroyInstance vkDestroyInstance; extern PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices; extern PFN_vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFeatures; +extern PFN_vkGetPhysicalDeviceFeatures2 vkGetPhysicalDeviceFeatures2; extern PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties; extern PFN_vkGetPhysicalDeviceImageFormatProperties vkGetPhysicalDeviceImageFormatProperties; extern PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties; diff -Nru vulkan-1.0.65.2+dfsg1/CONTRIBUTING.md vulkan-1.1.73+dfsg/CONTRIBUTING.md --- vulkan-1.0.65.2+dfsg1/CONTRIBUTING.md 2017-07-03 14:21:22.000000000 +0000 +++ vulkan-1.1.73+dfsg/CONTRIBUTING.md 2018-04-27 11:24:19.000000000 +0000 @@ -1,19 +1,10 @@ ## How to Contribute to Vulkan Source Repositories -### **The Repositories** - -The source code for various Vulkan components is distributed across several GitHub repositories. -The repositories sponsored by Khronos and LunarG are described here. -In general, the canonical Vulkan Loader and Validation Layers sources are in the Khronos repository, -while the LunarG repositories host sources for additional tools and sample programs. +### **The Repository** +The source code for The Vulkan-LoaderAndValidationLayer components is sponsored by Khronos and LunarG. * [Khronos Vulkan-LoaderAndValidationLayers](https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers) -* [LunarG VulkanTools](https://github.com/LunarG/VulkanTools) -* [LunarG VulkanSamples](https://github.com/LunarG/VulkanSamples) -As a convenience, the contents of the Vulkan-LoaderAndValidationLayers repository are downstreamed into the VulkanTools and VulkanSamples repositories via a branch named `trunk`. -This makes the VulkanTools and VulkanSamples easier to work with and avoids compatibility issues -that might arise with Vulkan-LoaderAndValidationLayers components if they were obtained from a separate repository. ### **The Vulkan Ecosystem Needs Your Help** @@ -21,9 +12,13 @@ While there are often active and organized development efforts underway to improve their coverage, there are always opportunities for anyone to help by contributing additional validation layer checks and tests for these validation checks. -If you desire to help in this area, please examine the -[issues list](https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues) -in this repository and look for any unassigned issues that are of interest to you. + +There are a couple of methods to identify areas of need: +* Examine the [issues list](https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues) +in this repository and look for issues that are of interest +* Alternatively, examine the [vk_validation_error_database.txt](layers/vk_validation_error_database.txt) file -- unimplemented validation checks are marked +with an 'N' in the 'check_implemented' column and each of these needs coverage in the validation layers. + Of course, if you have your own work in mind, please open an issue to describe it and assign it to yourself. Finally, please feel free to contact any of the developers that are actively contributing should you wish to coordinate further. @@ -32,11 +27,13 @@ Repository Issue labels: -* _Incomplete_: These issues refer to missing validation checks that users have encountered during application development that would have been directly useful, and are high priority. -* _Enhancement_: These issues refer to ideas for extending or improving the loader, demos, or validation layers. * _Bug_: These issues refer to invalid or broken functionality and are the highest priority. +* _Incomplete_: These issues refer to missing validation checks that users have encountered during application +development that would have been directly useful, and are high priority. +* _Enhancement_: These issues refer to ideas for extending or improving the loader, demos, or validation layers. -If you choose to work on an issue that is already assigned, simply coordinate with the current assignee. +It is the maintainers goal for all issues to be assigned within one business day of their submission. If you choose +to work on an issue that is assigned, simply coordinate with the current assignee. ### **How to Submit Fixes** @@ -45,21 +42,24 @@ * Use the existing GitHub forking and pull request process. This will involve [forking the repository](https://help.github.com/articles/fork-a-repo/), creating a branch with your commits, and then [submitting a pull request](https://help.github.com/articles/using-pull-requests/). +* Please read and adhere to the style and process [guidelines ](#coding-conventions-and-formatting) enumerated below. * Please base your fixes on the master branch. SDK branches are generally not updated except for critical fixes needed to repair an SDK release. -* Please include the GitHub Issue number near the beginning of the commit text if applicable. - * Example: "layers: GH123, Fix missing init" -* If your changes are restricted only to files from the Vulkan-LoaderAndValidationLayers repository, please direct your pull request to that repository, instead of VulkanTools or VulkanSamples. #### **Coding Conventions and Formatting** * Use the **[Google style guide](https://google.github.io/styleguide/cppguide.html)** for source code with the following exceptions: * The column limit is 132 (as opposed to the default value 80). The clang-format tool will handle this. See below. * The indent is 4 spaces instead of the default 2 spaces. Again, the clang-format tool will handle this. - * If you can justify a reason for violating a rule in the guidelines, then you are free to do so. Be prepared to defend your decision during code review. This should be used responsibly. An example of a bad reason is "I don't like that rule." An example of a good reason is "This violates the style guide, but it improves type safety." + * If you can justify a reason for violating a rule in the guidelines, then you are free to do so. Be prepared to defend your +decision during code review. This should be used responsibly. An example of a bad reason is "I don't like that rule." An example of +a good reason is "This violates the style guide, but it improves type safety." -* Run **clang-format** on your changes to maintain formatting - * There are `.clang-format files` throughout the repository to define clang-format settings +* Run **clang-format** on your changes to maintain consistent formatting + * There are `.clang-format files` present in the repository to define clang-format settings which are found and used automatically by clang-format. + * **clang-format** binaries are available from the LLVM orginization, here: https://clang.llvm.org/. Our CI system (Travis-CI) + currently uses clang-format version 5.0.0 to check that the lines of code you have changed are formatted properly. It is + recommended that you use the same version to format your code prior to submission. * A sample git workflow may look like: > # Make changes to the source. @@ -69,14 +69,20 @@ > $ git add -u . > $ git commit -* **Format your git commit messages** consistently with the repo - * Limit the subject line to 50 characters. Begin with a one-word component description followed by a colon (e.g. loader, layers, tests, etc.). - * Separate subject from body with a blank line. - * Wrap the body at 72 characters. - * Capitalize the subject line. - * Do not end the subject line with a period. - * Use the body to explain what and why vs. how. - * Use the imperative mood in the subject line. This just means to write it as a command (e.g. Fix the sprocket). +* **Commit Messages** + * Limit the subject line to 50 characters -- this allows the information to display correctly in git/Github logs + * Begin subject line with a one-word component description followed by a colon (e.g. loader, layers, tests, etc.) + * Separate subject from body with a blank line + * Wrap the body at 72 characters + * Capitalize the subject line + * Do not end the subject line with a period + * Use the body to explain what and why vs. how + * Use the imperative mode in the subject line. This just means to write it as a command (e.g. Fix the sprocket) + +Strive for commits that implement a single or related set of functionality, using as many commits as is necessary (more is better). +That said, please ensure that the repository compiles and passes tests without error for each commit in your pull request. Note +that to be accepted into the repository, the pull request must [pass all tests](#testing your changes) on all supported platforms +-- the automatic Github Travis and AppVeyor continuous integration features will assist in enforcing this requirement. #### **Testing Your Changes** * Run the existing tests in the repository before and after each if your commits to check for any regressions. @@ -96,15 +102,17 @@ > run_all_tests.sh -* On Windows, a quick sanity check can be run from inside Visual Studio -- just run the `vk_layer_validation_tests` project, or you can run `run_all_tests.ps1` from a PowerShell window +* On Windows, a quick sanity check can be run from inside Visual Studio -- just run the `vk_layer_validation_tests` project, +or you can run `run_all_tests.ps1` from a PowerShell window * Note that some tests may fail with known issues or driver-specific problems. - The idea here is that your changes shouldn't change the test results, unless that was the intent of your changes. + The idea here is that your changes should not change the test results, unless that was the intent of your changes. * Run tests that explicitly exercise your changes. * Feel free to subject your code changes to other tests as well! + #### **Special Considerations for Validation Layers** -If you are submitting a change that adds a new validation check, you should also construct a "negative" test function. +* **Validation Tests** If you are submitting a change that adds a new validation check, you should also construct a "negative" test function. The negative test function purposely violates the validation rule that the new validation check is looking for. The test should cause your new validation check to identify the violation and issue a validation error report. And finally, the test should check that the validation error report is generated and consider the test as "passing" @@ -112,11 +120,17 @@ This new test should be added to the validation layer test program in the `tests` directory and contributed at the same time as the new validation check itself, along with appropriate updates to `layers\vk_validation_error_database.txt`. There are many existing validation tests in this directory that can be used as a starting point. - +* **Validation Checks** The majority of validation checks are carried out by the Core Validation layer. In general, this layer +contains checks that require some amount of application state to carry out. In contrast, the parameter validation layer contains +checks that require (mostly) no state at all. Please inquire if you are unsure of the location for your contribution. The other +layers (threading, object_tracker, unique_objects) are more special-purpose and are mostly code-generated from the specification. +* **Validation Error/Warning Messages** Strive to give specific information describing the particulars of the failure, including +output all of the applicable Vulkan Objects and related values. Also, ensure that when messages can give suggestions about _how_ to +fix the problem, they should do so to better assist the user. ### **Contributor License Agreement (CLA)** -You'll be prompted with a one-time "click-through" CLA dialog as part of submitting your pull request +You will be prompted with a one-time "click-through" CLA dialog as part of submitting your pull request or other contribution to GitHub. ### **License and Copyrights** diff -Nru vulkan-1.0.65.2+dfsg1/debian/changelog vulkan-1.1.73+dfsg/debian/changelog --- vulkan-1.0.65.2+dfsg1/debian/changelog 2018-01-31 09:30:38.000000000 +0000 +++ vulkan-1.1.73+dfsg/debian/changelog 2018-05-04 12:13:49.000000000 +0000 @@ -1,8 +1,47 @@ -vulkan (1.0.65.2+dfsg1-1~gpu18.04.1) bionic; urgency=medium +vulkan (1.1.73+dfsg-1~gpu18.04.1) bionic; urgency=medium * Copied from debian - -- Rico Tzschichholz Wed, 31 Jan 2018 10:30:38 +0100 + -- Rico Tzschichholz Fri, 04 May 2018 14:13:49 +0200 + +vulkan (1.1.73+dfsg-1) unstable; urgency=medium + + * New upstream release. + * Move layers from libvulkan-dev to libvulkan1. (Closes: #891582) + * control: Add python3-distutils to build-depends. (Closes: #896796) + * Refresh patches. + + -- Timo Aaltonen Fri, 04 May 2018 13:18:00 +0300 + +vulkan (1.1.70+dfsg1-1) unstable; urgency=medium + + * New upstream release. + * fix-pkgconfig.diff: Fix wrong libdir in vulkan.pc. (LP: #1754288) + + -- Timo Aaltonen Mon, 12 Mar 2018 15:39:40 +0200 + +vulkan (1.0.68+dfsg1-1) unstable; urgency=medium + + [ Timo Aaltonen ] + * New upstream release. + * copyright: Updated. (Closes: #881014) + * patches: Refreshed. + * get-external.sh: Use upstream script to update glslang and spirv- + tools/headers. + * get-external.sh, use-known-sha.diff: Don't require git, grep the + spirv sha from known-good.json and use that. + * rules: Update glslang build. + * rules: Tell cmake where glslangValidator is. + * rules: Update clean target. + * control: Update VCS urls. + * control: Bump policy to 4.1.3, no changes. + + [ Andreas Boll ] + * debian/get-external.sh: Append external Git revision of glslang to + the commit message. + * Add man pages for vulkaninfo and vulkan-smoketest. + + -- Timo Aaltonen Thu, 08 Mar 2018 08:55:08 +0200 vulkan (1.0.65.2+dfsg1-1) unstable; urgency=medium diff -Nru vulkan-1.0.65.2+dfsg1/debian/control vulkan-1.1.73+dfsg/debian/control --- vulkan-1.0.65.2+dfsg1/debian/control 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/debian/control 2018-04-27 11:55:32.000000000 +0000 @@ -11,18 +11,21 @@ pkg-config, python3, python3-lxml, + python3-distutils, quilt, -Standards-Version: 3.9.8 +Standards-Version: 4.1.3 Section: libs Homepage: https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers -Vcs-Git: https://anonscm.debian.org/git/pkg-xorg/lib/vulkan.git -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-xorg/lib/vulkan.git +Vcs-Git: https://salsa.debian.org/xorg-team/vulkan/vulkan.git +Vcs-Browser: https://salsa.debian.org/xorg-team/vulkan/vulkan.git Package: libvulkan1 Architecture: linux-any Depends: ${shlibs:Depends}, ${misc:Depends} -Breaks: vulkan-loader -Replaces: vulkan-loader +Breaks: vulkan-loader, + libvulkan-dev (<< 1.1.70+dfsg1-2), +Replaces: vulkan-loader, + libvulkan-dev (<< 1.1.70+dfsg1-2), Multi-Arch: same Description: Vulkan loader library The Loader implements the main VK library. It handles layer management and diff -Nru vulkan-1.0.65.2+dfsg1/debian/copyright vulkan-1.1.73+dfsg/debian/copyright --- vulkan-1.0.65.2+dfsg1/debian/copyright 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/debian/copyright 2018-04-27 11:24:53.000000000 +0000 @@ -13,7 +13,7 @@ 2015-2016 The Khronos Group Inc 2005-2014 G-Truc Creation 2015-2016 LunarG, Inc -License: MIT +License: Apache-2.0 Files: loader/cJSON.* Copyright: 2009 Dave Gamble @@ -38,7 +38,7 @@ Files: debian/* Copyright: 2016 Timo Aaltonen -License: MIT +License: MIT or Apache-2.0 Files: debian/patches/install-vulkan-intel-header.diff Copyright: 2015 Intel Corporation @@ -63,3 +63,6 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +License: Apache-2.0 + On Debian systems, the full Apache-2.0 license text can be found at + /usr/share/common-licenses/Apache-2.0. diff -Nru vulkan-1.0.65.2+dfsg1/debian/get-external.sh vulkan-1.1.73+dfsg/debian/get-external.sh --- vulkan-1.0.65.2+dfsg1/debian/get-external.sh 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/debian/get-external.sh 2018-04-27 11:24:53.000000000 +0000 @@ -1,22 +1,27 @@ #!/bin/sh URL=https://github.com/KhronosGroup - GLSLANG_SHA=`cat external_revisions/glslang_revision` -SPIRV_HEADERS_SHA=`cat external_revisions/spirv-headers_revision` -SPIRV_TOOLS_SHA=`cat external_revisions/spirv-tools_revision` -# fetch tarballs -wget $URL/glslang/archive/$GLSLANG_SHA.tar.gz -O glslang.tar.gz -wget $URL/spirv-headers/archive/$SPIRV_HEADERS_SHA.tar.gz -O spirv-headers.tar.gz -wget $URL/spirv-tools/archive/$SPIRV_TOOLS_SHA.tar.gz -O spirv-tools.tar.gz +# clean old checkout +git rm -rf external/glslang + +# sync glslang and it's dependencies +./update_external_sources.sh --no-build + +# the first sha is for spirv-tools +grep "commit\" \:" external/glslang/known_good.json | head -1 | sed 's/.* \"//;s/\"//' \ + > external/glslang/External/spirv-tools/commit-sha +rm -rf external/glslang/.git* +rm -rf external/glslang/External/spirv-tools/.git* +rm -rf external/glslang/External/spirv-tools/external/spirv-headers/.git* -tar xf glslang.tar.gz -C external/glslang --strip 1 -tar xf spirv-tools.tar.gz -C external/spirv-tools --strip 1 -tar xf spirv-headers.tar.gz -C external/spirv-tools/external/spirv-headers --strip 1 +git add -f external/ +git commit -m "Refresh external/ -# clean -rm glslang.tar.gz spirv-tools.tar.gz spirv-headers.tar.gz +glslang: $GLSLANG_SHA +Vcs-Browser: $URL/glslang/commits/$GLSLANG_SHA +" -echo "Remember to run 'git add -f external/' and check that it looks sane" +echo "\nRemember to check if this commit looks sane!" diff -Nru vulkan-1.0.65.2+dfsg1/debian/libvulkan1.dirs vulkan-1.1.73+dfsg/debian/libvulkan1.dirs --- vulkan-1.0.65.2+dfsg1/debian/libvulkan1.dirs 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/debian/libvulkan1.dirs 2018-04-27 11:24:53.000000000 +0000 @@ -0,0 +1,2 @@ +etc/vulkan/explicit_layer.d +etc/vulkan/implicit_layer.d diff -Nru vulkan-1.0.65.2+dfsg1/debian/libvulkan1.install vulkan-1.1.73+dfsg/debian/libvulkan1.install --- vulkan-1.0.65.2+dfsg1/debian/libvulkan1.install 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/debian/libvulkan1.install 2018-04-27 11:24:53.000000000 +0000 @@ -1 +1,4 @@ usr/lib/*/lib*.so.* +usr/lib/*/libVkLayer*.so +usr/share/vulkan/explicit_layer.d +usr/share/vulkan/implicit_layer.d diff -Nru vulkan-1.0.65.2+dfsg1/debian/libvulkan-dev.dirs vulkan-1.1.73+dfsg/debian/libvulkan-dev.dirs --- vulkan-1.0.65.2+dfsg1/debian/libvulkan-dev.dirs 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/debian/libvulkan-dev.dirs 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -etc/vulkan/explicit_layer.d -etc/vulkan/implicit_layer.d diff -Nru vulkan-1.0.65.2+dfsg1/debian/libvulkan-dev.install vulkan-1.1.73+dfsg/debian/libvulkan-dev.install --- vulkan-1.0.65.2+dfsg1/debian/libvulkan-dev.install 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/debian/libvulkan-dev.install 2018-04-27 11:24:53.000000000 +0000 @@ -1,6 +1,3 @@ usr/include/vulkan usr/lib/*/libvulkan.so -usr/lib/*/libVkLayer*.so usr/lib/*/pkgconfig/vulkan.pc -usr/share/vulkan/explicit_layer.d -usr/share/vulkan/implicit_layer.d diff -Nru vulkan-1.0.65.2+dfsg1/debian/patches/demos-dont-build-cube.diff vulkan-1.1.73+dfsg/debian/patches/demos-dont-build-cube.diff --- vulkan-1.0.65.2+dfsg1/debian/patches/demos-dont-build-cube.diff 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/debian/patches/demos-dont-build-cube.diff 2018-04-27 11:49:54.000000000 +0000 @@ -10,24 +10,24 @@ --- a/demos/CMakeLists.txt +++ b/demos/CMakeLists.txt -@@ -118,8 +118,8 @@ target_link_libraries(${API_LOWERCASE}in - - if(NOT WIN32) +@@ -180,8 +180,8 @@ if(APPLE) + include(macOS/cube/cube.cmake) + elseif(NOT WIN32) if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR}) -- add_executable(cube cube.c ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv) +- add_executable(cube cube.c ${PROJECT_SOURCE_DIR}/demos/cube.vert ${PROJECT_SOURCE_DIR}/demos/cube.frag cube.vert.inc cube.frag.inc) - target_link_libraries(cube ${LIBRARIES}) -+# add_executable(cube cube.c ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv) ++# add_executable(cube cube.c ${PROJECT_SOURCE_DIR}/demos/cube.vert ${PROJECT_SOURCE_DIR}/demos/cube.frag cube.vert.inc cube.frag.inc) +# target_link_libraries(cube ${LIBRARIES}) endif() else() if (CMAKE_CL_64) -@@ -134,8 +134,8 @@ endif() - - if(NOT WIN32) +@@ -201,8 +201,8 @@ if(APPLE) + include(macOS/cubepp/cubepp.cmake) + elseif(NOT WIN32) if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR}) -- add_executable(cubepp cube.cpp ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv) +- add_executable(cubepp cube.cpp ${PROJECT_SOURCE_DIR}/demos/cube.vert ${PROJECT_SOURCE_DIR}/demos/cube.frag cube.vert.inc cube.frag.inc) - target_link_libraries(cubepp ${LIBRARIES}) -+# add_executable(cubepp cube.cpp ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv) ++# add_executable(cubepp cube.cpp ${PROJECT_SOURCE_DIR}/demos/cube.vert ${PROJECT_SOURCE_DIR}/demos/cube.frag cube.vert.inc cube.frag.inc) +# target_link_libraries(cubepp ${LIBRARIES}) endif() else() diff -Nru vulkan-1.0.65.2+dfsg1/debian/patches/fix-pkgconfig.diff vulkan-1.1.73+dfsg/debian/patches/fix-pkgconfig.diff --- vulkan-1.0.65.2+dfsg1/debian/patches/fix-pkgconfig.diff 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/debian/patches/fix-pkgconfig.diff 2018-04-27 11:24:53.000000000 +0000 @@ -0,0 +1,10 @@ +--- a/loader/vulkan.pc.in ++++ b/loader/vulkan.pc.in +@@ -1,6 +1,6 @@ + prefix=@CMAKE_INSTALL_PREFIX@ + exec_prefix=@CMAKE_INSTALL_PREFIX@ +-libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ ++libdir=@CMAKE_INSTALL_LIBDIR@ + includedir=${prefix}/include + + Name: @CMAKE_PROJECT_NAME@ diff -Nru vulkan-1.0.65.2+dfsg1/debian/patches/series vulkan-1.1.73+dfsg/debian/patches/series --- vulkan-1.0.65.2+dfsg1/debian/patches/series 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/debian/patches/series 2018-04-27 11:24:53.000000000 +0000 @@ -1,3 +1,5 @@ demos-dont-build-cube.diff use-mxgot-for-mips64.patch install-vulkan-intel-header.diff +use-known-sha.diff +fix-pkgconfig.diff diff -Nru vulkan-1.0.65.2+dfsg1/debian/patches/use-known-sha.diff vulkan-1.1.73+dfsg/debian/patches/use-known-sha.diff --- vulkan-1.0.65.2+dfsg1/debian/patches/use-known-sha.diff 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/debian/patches/use-known-sha.diff 2018-04-27 11:50:03.000000000 +0000 @@ -0,0 +1,13 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -348,8 +348,8 @@ macro(run_external_revision_generate sou + # NOTE: If you modify this call to use --rev_file instead of --git_dir (to read the commit ID from a file instead of + # parsing from a Git repository), you probably also want to add the revision file to the list of DEPENDS on the + # subsequent line (to ensure that the script is re-run when the revision file is modified). +- COMMAND ${PYTHON_CMD} ${SCRIPTS_DIR}/external_revision_generator.py --git_dir ${source_dir} -s ${symbol_name} -o ${output} +- DEPENDS ${SCRIPTS_DIR}/external_revision_generator.py ${source_dir}/.git/HEAD ${source_dir}/.git/index ++ COMMAND ${PYTHON_CMD} ${SCRIPTS_DIR}/external_revision_generator.py --rev_file ${source_dir}/commit-sha -s ${symbol_name} -o ${output} ++# DEPENDS ${SCRIPTS_DIR}/external_revision_generator.py ${source_dir}/.git/HEAD ${source_dir}/.git/index + ) + endmacro() + diff -Nru vulkan-1.0.65.2+dfsg1/debian/patches/use-mxgot-for-mips64.patch vulkan-1.1.73+dfsg/debian/patches/use-mxgot-for-mips64.patch --- vulkan-1.0.65.2+dfsg1/debian/patches/use-mxgot-for-mips64.patch 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/debian/patches/use-mxgot-for-mips64.patch 2018-04-27 11:49:58.000000000 +0000 @@ -3,8 +3,8 @@ --- a/layers/CMakeLists.txt +++ b/layers/CMakeLists.txt -@@ -167,6 +167,12 @@ if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL " - endif() +@@ -211,6 +211,12 @@ if (CMAKE_C_COMPILER_ID MATCHES "Clang") + COMPILE_FLAGS "-Wno-unused-const-variable") endif() +if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "mips64") diff -Nru vulkan-1.0.65.2+dfsg1/debian/README.source vulkan-1.1.73+dfsg/debian/README.source --- vulkan-1.0.65.2+dfsg1/debian/README.source 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/debian/README.source 2018-04-27 11:24:53.000000000 +0000 @@ -12,6 +12,5 @@ # git checkout -b d-u # git merge -s ours debian-unstable # debian/get-external.sh -# git add external/ ; git commit # dch # debian/rules gentarball diff -Nru vulkan-1.0.65.2+dfsg1/debian/rules vulkan-1.1.73+dfsg/debian/rules --- vulkan-1.0.65.2+dfsg1/debian/rules 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/debian/rules 2018-04-27 11:24:53.000000000 +0000 @@ -18,21 +18,20 @@ rm -rf __pycache__ \ scripts/__pycache__ \ external/glslang/build \ - external/spirv-tools/build + demos/smoke/HelpersDispatchTable.* -build_spirv: +build_glslang: mkdir -p external/glslang/build \ external/spirv-tools/build cd external/glslang/build && \ - (cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON ..; make $(MAKE_FLAGS); make install) - cd external/spirv-tools/build/ && \ (cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON ..; make $(MAKE_FLAGS)) -override_dh_auto_configure: build_spirv +override_dh_auto_configure: build_glslang dh_auto_configure -- \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) \ - -DSPIRV_TOOLS_INCLUDE_DIR=../external/spirv-tools/include \ + -DSPIRV_TOOLS_INCLUDE_DIR=../external/glslang/External/spirv-tools/include \ + -DGLSLANG_VALIDATOR=../external/glslang/build/StandAlone/glslangValidator \ -DBUILD_TESTS=OFF \ -DBUILD_VKJSON=OFF \ -DBUILD_WSI_MIR_SUPPORT=OFF diff -Nru vulkan-1.0.65.2+dfsg1/debian/vulkaninfo.1 vulkan-1.1.73+dfsg/debian/vulkaninfo.1 --- vulkan-1.0.65.2+dfsg1/debian/vulkaninfo.1 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/debian/vulkaninfo.1 2018-04-27 11:24:53.000000000 +0000 @@ -0,0 +1,14 @@ +.TH vulkaninfo 1 "2018-01-25" +.SH NAME +vulkaninfo \- show Vulkan information +.SH SYNOPSIS +.B vulkaninfo +.SH DESCRIPTION +The \fIvulkaninfo\fP program shows information about the supported Vulkan +capabilities. It lists not only device properties and features, but also +supported Vulkan layers and extensions. +.SH AUTHOR +vulkaninfo was originally written by LunarG, Inc. +.PP +This manual page was written by Andreas Boll , for +the Debian project (but may be used by others). diff -Nru vulkan-1.0.65.2+dfsg1/debian/vulkan-smoketest.1 vulkan-1.1.73+dfsg/debian/vulkan-smoketest.1 --- vulkan-1.0.65.2+dfsg1/debian/vulkan-smoketest.1 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/debian/vulkan-smoketest.1 2018-04-27 11:24:53.000000000 +0000 @@ -0,0 +1,66 @@ +.TH vulkan-smoketest 1 "2018-01-25" +.SH NAME +vulkan-smoketest \- a Vulkan demo application +.SH SYNOPSIS +.B vulkan-smoketest +.RI [ options ] +.SH DESCRIPTION +The \fIvulkan-smoketest\fP program demonstrates multi-thread command buffer +recording. It displays lots of moving and rotating 3D objects like teapots, +spheres and pyramids. +.SH OPTIONS +.TP +.B \-\-b +Disable vsync. +.TP +.B \-\-w \fIwidth\fP +Set initial width. The default width is 1280. +.TP +.B \-\-h \fIheight\fP +Set initial height. The default height is 1024. +.TP +\fB\-\-v\fP, \fB\-\-validate\fP +Enable validation. +.TP +.B \-\-vv +Enable verbose validation. +.TP +.B \-\-nt +Disable tick. +.TP +.B \-\-nr +Disable rendering. +.TP +.B \-\-np +Disable presentation. +.TP +.B \-\-flush +Flush buffers. +.TP +.B \-\-c \fImax_count\fP +Set max frame count. +.TP +.B \-s +Use single-thread mode. +.TP +.B \-p +Use push constants. +.SH INTERACTIVE CONTROL +The following keys may be pressed while vulkan-smoketest is running: +.TP +.B Up +Zoom in. +.TP +.B Down +Zoom out. +.TP +.B Space +Pause / Unpause. +.TP +.B Esc +Quit. +.SH AUTHOR +vulkan-smoketest was originally written by Google, Inc. +.PP +This manual page was written by Andreas Boll , for +the Debian project (but may be used by others). diff -Nru vulkan-1.0.65.2+dfsg1/debian/vulkan-utils.manpages vulkan-1.1.73+dfsg/debian/vulkan-utils.manpages --- vulkan-1.0.65.2+dfsg1/debian/vulkan-utils.manpages 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/debian/vulkan-utils.manpages 2018-04-27 11:24:53.000000000 +0000 @@ -0,0 +1,2 @@ +debian/vulkaninfo.1 +debian/vulkan-smoketest.1 diff -Nru vulkan-1.0.65.2+dfsg1/demos/android/include/cube.frag.inc vulkan-1.1.73+dfsg/demos/android/include/cube.frag.inc --- vulkan-1.0.65.2+dfsg1/demos/android/include/cube.frag.inc 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/android/include/cube.frag.inc 2018-03-14 09:08:48.000000000 +0000 @@ -0,0 +1,22 @@ + // Overload400-PrecQual.2000 12-Apr-2017 + 0x07230203,0x00010000,0x00080002,0x00000015,0x00000000,0x00020011,0x00000001,0x0006000b, + 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, + 0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000009,0x00000010,0x00030010, + 0x00000004,0x00000007,0x00030003,0x00000002,0x00000190,0x00090004,0x415f4c47,0x735f4252, + 0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00090004,0x415f4c47, + 0x735f4252,0x69646168,0x6c5f676e,0x75676e61,0x5f656761,0x70303234,0x006b6361,0x00040005, + 0x00000004,0x6e69616d,0x00000000,0x00050005,0x00000009,0x61724675,0x6c6f4367,0x0000726f, + 0x00030005,0x0000000d,0x00786574,0x00050005,0x00000010,0x63786574,0x64726f6f,0x00000000, + 0x00040047,0x00000009,0x0000001e,0x00000000,0x00040047,0x0000000d,0x00000022,0x00000000, + 0x00040047,0x0000000d,0x00000021,0x00000001,0x00040047,0x00000010,0x0000001e,0x00000000, + 0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020, + 0x00040017,0x00000007,0x00000006,0x00000004,0x00040020,0x00000008,0x00000003,0x00000007, + 0x0004003b,0x00000008,0x00000009,0x00000003,0x00090019,0x0000000a,0x00000006,0x00000001, + 0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,0x0000000b,0x0000000a, + 0x00040020,0x0000000c,0x00000000,0x0000000b,0x0004003b,0x0000000c,0x0000000d,0x00000000, + 0x00040020,0x0000000f,0x00000001,0x00000007,0x0004003b,0x0000000f,0x00000010,0x00000001, + 0x00040017,0x00000011,0x00000006,0x00000002,0x00050036,0x00000002,0x00000004,0x00000000, + 0x00000003,0x000200f8,0x00000005,0x0004003d,0x0000000b,0x0000000e,0x0000000d,0x0004003d, + 0x00000007,0x00000012,0x00000010,0x0007004f,0x00000011,0x00000013,0x00000012,0x00000012, + 0x00000000,0x00000001,0x00050057,0x00000007,0x00000014,0x0000000e,0x00000013,0x0003003e, + 0x00000009,0x00000014,0x000100fd,0x00010038 diff -Nru vulkan-1.0.65.2+dfsg1/demos/android/include/cube.vert.inc vulkan-1.1.73+dfsg/demos/android/include/cube.vert.inc --- vulkan-1.0.65.2+dfsg1/demos/android/include/cube.vert.inc 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/android/include/cube.vert.inc 2018-03-14 09:08:48.000000000 +0000 @@ -0,0 +1,45 @@ + // Overload400-PrecQual.2000 12-Apr-2017 + 0x07230203,0x00010000,0x00080002,0x00000029,0x00000000,0x00020011,0x00000001,0x0006000b, + 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, + 0x0008000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x00000009,0x00000015,0x0000001e, + 0x00030003,0x00000002,0x00000190,0x00090004,0x415f4c47,0x735f4252,0x72617065,0x5f657461, + 0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00090004,0x415f4c47,0x735f4252,0x69646168, + 0x6c5f676e,0x75676e61,0x5f656761,0x70303234,0x006b6361,0x00040005,0x00000004,0x6e69616d, + 0x00000000,0x00050005,0x00000009,0x63786574,0x64726f6f,0x00000000,0x00030005,0x0000000f, + 0x00667562,0x00040006,0x0000000f,0x00000000,0x0050564d,0x00060006,0x0000000f,0x00000001, + 0x69736f70,0x6e6f6974,0x00000000,0x00050006,0x0000000f,0x00000002,0x72747461,0x00000000, + 0x00040005,0x00000011,0x66756275,0x00000000,0x00060005,0x00000015,0x565f6c67,0x65747265, + 0x646e4978,0x00007865,0x00060005,0x0000001c,0x505f6c67,0x65567265,0x78657472,0x00000000, + 0x00060006,0x0000001c,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00070006,0x0000001c, + 0x00000001,0x505f6c67,0x746e696f,0x657a6953,0x00000000,0x00070006,0x0000001c,0x00000002, + 0x435f6c67,0x4470696c,0x61747369,0x0065636e,0x00030005,0x0000001e,0x00000000,0x00040047, + 0x00000009,0x0000001e,0x00000000,0x00040047,0x0000000d,0x00000006,0x00000010,0x00040047, + 0x0000000e,0x00000006,0x00000010,0x00040048,0x0000000f,0x00000000,0x00000005,0x00050048, + 0x0000000f,0x00000000,0x00000023,0x00000000,0x00050048,0x0000000f,0x00000000,0x00000007, + 0x00000010,0x00050048,0x0000000f,0x00000001,0x00000023,0x00000040,0x00050048,0x0000000f, + 0x00000002,0x00000023,0x00000280,0x00030047,0x0000000f,0x00000002,0x00040047,0x00000011, + 0x00000022,0x00000000,0x00040047,0x00000011,0x00000021,0x00000000,0x00040047,0x00000015, + 0x0000000b,0x0000002a,0x00050048,0x0000001c,0x00000000,0x0000000b,0x00000000,0x00050048, + 0x0000001c,0x00000001,0x0000000b,0x00000001,0x00050048,0x0000001c,0x00000002,0x0000000b, + 0x00000003,0x00030047,0x0000001c,0x00000002,0x00020013,0x00000002,0x00030021,0x00000003, + 0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000004, + 0x00040020,0x00000008,0x00000003,0x00000007,0x0004003b,0x00000008,0x00000009,0x00000003, + 0x00040018,0x0000000a,0x00000007,0x00000004,0x00040015,0x0000000b,0x00000020,0x00000000, + 0x0004002b,0x0000000b,0x0000000c,0x00000024,0x0004001c,0x0000000d,0x00000007,0x0000000c, + 0x0004001c,0x0000000e,0x00000007,0x0000000c,0x0005001e,0x0000000f,0x0000000a,0x0000000d, + 0x0000000e,0x00040020,0x00000010,0x00000002,0x0000000f,0x0004003b,0x00000010,0x00000011, + 0x00000002,0x00040015,0x00000012,0x00000020,0x00000001,0x0004002b,0x00000012,0x00000013, + 0x00000002,0x00040020,0x00000014,0x00000001,0x00000012,0x0004003b,0x00000014,0x00000015, + 0x00000001,0x00040020,0x00000017,0x00000002,0x00000007,0x0004002b,0x0000000b,0x0000001a, + 0x00000001,0x0004001c,0x0000001b,0x00000006,0x0000001a,0x0005001e,0x0000001c,0x00000007, + 0x00000006,0x0000001b,0x00040020,0x0000001d,0x00000003,0x0000001c,0x0004003b,0x0000001d, + 0x0000001e,0x00000003,0x0004002b,0x00000012,0x0000001f,0x00000000,0x00040020,0x00000020, + 0x00000002,0x0000000a,0x0004002b,0x00000012,0x00000023,0x00000001,0x00050036,0x00000002, + 0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003d,0x00000012,0x00000016, + 0x00000015,0x00060041,0x00000017,0x00000018,0x00000011,0x00000013,0x00000016,0x0004003d, + 0x00000007,0x00000019,0x00000018,0x0003003e,0x00000009,0x00000019,0x00050041,0x00000020, + 0x00000021,0x00000011,0x0000001f,0x0004003d,0x0000000a,0x00000022,0x00000021,0x0004003d, + 0x00000012,0x00000024,0x00000015,0x00060041,0x00000017,0x00000025,0x00000011,0x00000023, + 0x00000024,0x0004003d,0x00000007,0x00000026,0x00000025,0x00050091,0x00000007,0x00000027, + 0x00000022,0x00000026,0x00050041,0x00000008,0x00000028,0x0000001e,0x0000001f,0x0003003e, + 0x00000028,0x00000027,0x000100fd,0x00010038 diff -Nru vulkan-1.0.65.2+dfsg1/demos/android/jni/Android.mk vulkan-1.1.73+dfsg/demos/android/jni/Android.mk --- vulkan-1.0.65.2+dfsg1/demos/android/jni/Android.mk 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/android/jni/Android.mk 2018-04-27 11:24:19.000000000 +0000 @@ -25,7 +25,8 @@ LOCAL_C_INCLUDES += $(SRC_DIR)/include \ $(DEMO_DIR)/android/include \ $(SRC_DIR)/libs \ - $(SRC_DIR)/common + $(SRC_DIR)/common \ + $(SRC_DIR)/build-android/generated/include LOCAL_CFLAGS += -DVK_USE_PLATFORM_ANDROID_KHR --include=$(SRC_DIR)/common/vulkan_wrapper.h LOCAL_WHOLE_STATIC_LIBRARIES += android_native_app_glue LOCAL_LDLIBS := -llog -landroid diff -Nru vulkan-1.0.65.2+dfsg1/demos/android/jni/Application.mk vulkan-1.1.73+dfsg/demos/android/jni/Application.mk --- vulkan-1.0.65.2+dfsg1/demos/android/jni/Application.mk 2018-01-10 14:15:30.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/android/jni/Application.mk 2018-03-14 09:08:48.000000000 +0000 @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -APP_ABI := armeabi-v7a arm64-v8a x86 x86_64 mips mips64 +APP_ABI := armeabi-v7a arm64-v8a x86 x86_64 APP_PLATFORM := android-23 APP_STL := gnustl_static APP_MODULES := Cube diff -Nru vulkan-1.0.65.2+dfsg1/demos/CMakeLists.txt vulkan-1.1.73+dfsg/demos/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/demos/CMakeLists.txt 2018-01-10 14:19:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/CMakeLists.txt 2018-05-04 08:50:24.000000000 +0000 @@ -1,3 +1,8 @@ +set(DEMO_INCLUDE_DIRS + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/.. +) + if(CMAKE_SYSTEM_NAME STREQUAL "Windows") add_definitions(-DVK_USE_PLATFORM_WIN32_KHR -DWIN32_LEAN_AND_MEAN) set(DisplayServer Win32) @@ -8,6 +13,10 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /guard:cf") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /guard:cf") endif() + set(DEMO_INCLUDE_DIRS + "${PROJECT_SOURCE_DIR}/icd/common" + ${DEMO_INCLUDE_DIRS} + ) elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") add_definitions(-DVK_USE_PLATFORM_ANDROID_KHR) elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") @@ -19,21 +28,30 @@ if (NOT BUILD_WSI_XCB_SUPPORT) message( FATAL_ERROR "Selected XCB for demos build but not building Xcb support" ) endif() - include_directories(${XCB_INCLUDE_DIRS}) + set(DEMO_INCLUDE_DIRS + ${XCB_INCLUDE_DIRS} + ${DEMO_INCLUDE_DIRS} + ) link_libraries(${XCB_LIBRARIES}) add_definitions(-DVK_USE_PLATFORM_XCB_KHR) elseif(DEMOS_WSI_SELECTION STREQUAL "XLIB") if (NOT BUILD_WSI_XLIB_SUPPORT) message( FATAL_ERROR "Selected XLIB for demos build but not building Xlib support" ) endif() - include_directories(${X11_INCLUDE_DIR}) + set(DEMO_INCLUDE_DIRS + ${X11_INCLUDE_DIR} + ${DEMO_INCLUDE_DIRS} + ) link_libraries(${X11_LIBRARIES}) add_definitions(-DVK_USE_PLATFORM_XLIB_KHR) elseif(DEMOS_WSI_SELECTION STREQUAL "WAYLAND") if (NOT BUILD_WSI_WAYLAND_SUPPORT) message( FATAL_ERROR "Selected Wayland for demos build but not building Wayland support" ) endif() - include_directories(${WAYLAND_CLIENT_INCLUDE_DIR}) + set(DEMO_INCLUDE_DIRS + ${WAYLAND_CLIENT_INCLUDE_DIR} + ${DEMO_INCLUDE_DIRS} + ) link_libraries(${WAYLAND_CLIENT_LIBRARIES}) add_definitions(-DVK_USE_PLATFORM_WAYLAND_KHR) elseif(DEMOS_WSI_SELECTION STREQUAL "MIR") @@ -41,7 +59,10 @@ message( FATAL_ERROR "Selected MIR for demos build but not building Mir support" ) endif() add_definitions(-DVK_USE_PLATFORM_MIR_KHR) - include_directories(${MIR_INCLUDE_DIR}) + set(DEMO_INCLUDE_DIRS + ${MIR_INCLUDE_DIR} + ${DEMO_INCLUDE_DIRS} + ) # TODO - Add Mir support elseif(DEMOS_WSI_SELECTION STREQUAL "DISPLAY") add_definitions(-DVK_USE_PLATFORM_DISPLAY_KHR) @@ -51,6 +72,8 @@ include_directories ("${PROJECT_SOURCE_DIR}/icd/common") link_libraries(${API_LOWERCASE} m) +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + add_definitions(-DVK_USE_PLATFORM_MACOS_MVK) else() message(FATAL_ERROR "Unsupported Platform!") endif() @@ -58,7 +81,7 @@ file(GLOB TEXTURES "${PROJECT_SOURCE_DIR}/demos/*.ppm" ) -file(COPY ${TEXTURES} DESTINATION ${CMAKE_BINARY_DIR}/demos) +file(COPY ${TEXTURES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") @@ -88,44 +111,76 @@ endif() endforeach() - add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-vert.spv - COMMAND ${GLSLANG_VALIDATOR} -s -V -o ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${PROJECT_SOURCE_DIR}/demos/cube.vert - DEPENDS cube.vert ${GLSLANG_VALIDATOR} - ) - add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-frag.spv - COMMAND ${GLSLANG_VALIDATOR} -s -V -o ${CMAKE_BINARY_DIR}/demos/cube-frag.spv ${PROJECT_SOURCE_DIR}/demos/cube.frag - DEPENDS cube.frag ${GLSLANG_VALIDATOR} - ) file(COPY cube.vcxproj.user DESTINATION ${CMAKE_BINARY_DIR}/demos) file(COPY vulkaninfo.vcxproj.user DESTINATION ${CMAKE_BINARY_DIR}/demos) -else() - if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR}) - add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-vert.spv - COMMAND ${GLSLANG_VALIDATOR} -s -V -o cube-vert.spv ${PROJECT_SOURCE_DIR}/demos/cube.vert - DEPENDS cube.vert ${GLSLANG_VALIDATOR} - ) - add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-frag.spv - COMMAND ${GLSLANG_VALIDATOR} -s -V -o cube-frag.spv ${PROJECT_SOURCE_DIR}/demos/cube.frag - DEPENDS cube.frag ${GLSLANG_VALIDATOR} - ) - endif() endif() -if(WIN32) - include_directories ( - "${PROJECT_SOURCE_DIR}/icd/common" - ) +add_custom_command( + COMMENT "Compiling cube demo vertex shader" + OUTPUT cube.vert.inc + COMMAND ${GLSLANG_VALIDATOR} -V -x -o ${CMAKE_CURRENT_BINARY_DIR}/cube.vert.inc ${PROJECT_SOURCE_DIR}/demos/cube.vert + MAIN_DEPENDENCY ${PROJECT_SOURCE_DIR}/demos/cube.vert + DEPENDS ${PROJECT_SOURCE_DIR}/demos/cube.vert ${GLSLANG_VALIDATOR} +) +add_custom_command( + COMMENT "Compiling cube demo fragment shader" + OUTPUT cube.frag.inc + COMMAND ${GLSLANG_VALIDATOR} -V -x -o ${CMAKE_CURRENT_BINARY_DIR}/cube.frag.inc ${PROJECT_SOURCE_DIR}/demos/cube.frag + MAIN_DEPENDENCY ${PROJECT_SOURCE_DIR}/demos/cube.frag + DEPENDS ${PROJECT_SOURCE_DIR}/demos/cube.frag ${GLSLANG_VALIDATOR} +) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +if(WIN32) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES") endif() -add_executable(${API_LOWERCASE}info vulkaninfo.c) +# MacOS setup common to all demos +if(APPLE) + include(macOS/common.cmake) +endif() + +include_directories( + ${DEMO_INCLUDE_DIRS} + ) + +###################################################################################### +# vulkaninfo +if(WIN32) + add_executable(${API_LOWERCASE}info vulkaninfo.c vulkaninfo.rc) +else() + add_executable(${API_LOWERCASE}info vulkaninfo.c) +endif() target_link_libraries(${API_LOWERCASE}info ${LIBRARIES}) +if(APPLE) + set_target_properties(${API_LOWERCASE}info PROPERTIES + INSTALL_RPATH "@loader_path/../lib" + ) + install(TARGETS ${API_LOWERCASE}info DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +endif() -if(NOT WIN32) +# Create vulkaninfo application bundle for MacOS +if(APPLE) + include(macOS/vulkaninfo/vulkaninfo.cmake) +endif() + +if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + if(INSTALL_LVL_FILES) + install(TARGETS ${API_LOWERCASE}info DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() +endif() + +###################################################################################### +# cube + +if(APPLE) + include(macOS/cube/cube.cmake) +elseif(NOT WIN32) if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR}) - add_executable(cube cube.c ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv) + add_executable(cube cube.c ${PROJECT_SOURCE_DIR}/demos/cube.vert ${PROJECT_SOURCE_DIR}/demos/cube.frag cube.vert.inc cube.frag.inc) target_link_libraries(cube ${LIBRARIES}) endif() else() @@ -135,13 +190,18 @@ set (LIB_DIR "Win32") endif() - add_executable(cube WIN32 cube.c ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv) + add_executable(cube WIN32 cube.c ${PROJECT_SOURCE_DIR}/demos/cube.vert ${PROJECT_SOURCE_DIR}/demos/cube.frag cube.vert.inc cube.frag.inc) target_link_libraries(cube ${LIBRARIES}) endif() -if(NOT WIN32) +###################################################################################### +# cubepp + +if(APPLE) + include(macOS/cubepp/cubepp.cmake) +elseif(NOT WIN32) if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR}) - add_executable(cubepp cube.cpp ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv) + add_executable(cubepp cube.cpp ${PROJECT_SOURCE_DIR}/demos/cube.vert ${PROJECT_SOURCE_DIR}/demos/cube.frag cube.vert.inc cube.frag.inc) target_link_libraries(cubepp ${LIBRARIES}) endif() else() @@ -151,18 +211,16 @@ set (LIB_DIR "Win32") endif() - add_executable(cubepp WIN32 cube.cpp ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv) + add_executable(cubepp WIN32 cube.cpp ${PROJECT_SOURCE_DIR}/demos/cube.vert ${PROJECT_SOURCE_DIR}/demos/cube.frag cube.vert.inc cube.frag.inc) target_link_libraries(cubepp ${LIBRARIES}) endif() +###################################################################################### +# smoke + if ((${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})) - if ((DEMOS_WSI_SELECTION STREQUAL "XCB") OR (DEMOS_WSI_SELECTION STREQUAL "WAYLAND") OR WIN32 OR (CMAKE_SYSTEM_NAME STREQUAL "Android")) + if ((DEMOS_WSI_SELECTION STREQUAL "XCB") OR (DEMOS_WSI_SELECTION STREQUAL "WAYLAND") OR WIN32 OR + (CMAKE_SYSTEM_NAME STREQUAL "Android") OR (CMAKE_SYSTEM_NAME STREQUAL "Darwin")) add_subdirectory(smoke) endif() endif() - -if(UNIX) - if(INSTALL_LVL_FILES) - install(TARGETS ${API_LOWERCASE}info DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif() -endif() diff -Nru vulkan-1.0.65.2+dfsg1/demos/cube.c vulkan-1.1.73+dfsg/demos/cube.c --- vulkan-1.0.65.2+dfsg1/demos/cube.c 2018-01-10 14:15:30.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/cube.c 2018-04-27 11:24:19.000000000 +0000 @@ -56,6 +56,7 @@ #include #include "linmath.h" +#include "vk_enum_string_helper.h" #include "gettime.h" #include "inttypes.h" @@ -290,18 +291,6 @@ fflush(stdout); } -VKAPI_ATTR VkBool32 VKAPI_CALL BreakCallback(VkFlags msgFlags, VkDebugReportObjectTypeEXT objType, uint64_t srcObject, - size_t location, int32_t msgCode, const char *pLayerPrefix, const char *pMsg, - void *pUserData) { -#ifndef WIN32 - raise(SIGTRAP); -#else - DebugBreak(); -#endif - - return false; -} - typedef struct { VkImage image; VkCommandBuffer cmd; @@ -342,7 +331,7 @@ struct wl_keyboard *keyboard; #elif defined(VK_USE_PLATFORM_MIR_KHR) #elif defined(VK_USE_PLATFORM_ANDROID_KHR) - ANativeWindow *window; + struct ANativeWindow *window; #elif (defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_MACOS_MVK)) void *window; #endif @@ -350,6 +339,7 @@ bool prepared; bool use_staging_buffer; bool separate_present_queue; + bool is_minimized; bool VK_KHR_incremental_present_enabled; @@ -446,62 +436,111 @@ bool validate_checks_disabled; bool use_break; bool suppress_popups; - PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallback; - PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallback; - VkDebugReportCallbackEXT msg_callback; - PFN_vkDebugReportMessageEXT DebugReportMessage; + + PFN_vkCreateDebugUtilsMessengerEXT CreateDebugUtilsMessengerEXT; + PFN_vkDestroyDebugUtilsMessengerEXT DestroyDebugUtilsMessengerEXT; + PFN_vkSubmitDebugUtilsMessageEXT SubmitDebugUtilsMessageEXT; + PFN_vkCmdBeginDebugUtilsLabelEXT CmdBeginDebugUtilsLabelEXT; + PFN_vkCmdEndDebugUtilsLabelEXT CmdEndDebugUtilsLabelEXT; + PFN_vkCmdInsertDebugUtilsLabelEXT CmdInsertDebugUtilsLabelEXT; + PFN_vkSetDebugUtilsObjectNameEXT SetDebugUtilsObjectNameEXT; + VkDebugUtilsMessengerEXT dbg_messenger; uint32_t current_buffer; uint32_t queue_family_count; }; -VKAPI_ATTR VkBool32 VKAPI_CALL dbgFunc(VkFlags msgFlags, VkDebugReportObjectTypeEXT objType, uint64_t srcObject, size_t location, - int32_t msgCode, const char *pLayerPrefix, const char *pMsg, void *pUserData) { - // clang-format off - char *message = (char *)malloc(strlen(pMsg) + 100); - +VKAPI_ATTR VkBool32 VKAPI_CALL debug_messenger_callback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, + VkDebugUtilsMessageTypeFlagsEXT messageType, + const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData, + void *pUserData) { + char prefix[64] = ""; + char *message = (char *)malloc(strlen(pCallbackData->pMessage) + 5000); assert(message); + struct demo *demo = (struct demo *)pUserData; - if (msgFlags & VK_DEBUG_REPORT_INFORMATION_BIT_EXT) { - sprintf(message, "INFORMATION: [%s] Code %d : %s", pLayerPrefix, msgCode, pMsg); - validation_error = 1; - } else if (msgFlags & VK_DEBUG_REPORT_WARNING_BIT_EXT) { - sprintf(message, "WARNING: [%s] Code %d : %s", pLayerPrefix, msgCode, pMsg); - validation_error = 1; - } else if (msgFlags & VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT) { - sprintf(message, "PERFORMANCE WARNING: [%s] Code %d : %s", pLayerPrefix, msgCode, pMsg); - validation_error = 1; - } else if (msgFlags & VK_DEBUG_REPORT_ERROR_BIT_EXT) { - sprintf(message, "ERROR: [%s] Code %d : %s", pLayerPrefix, msgCode, pMsg); - validation_error = 1; - } else if (msgFlags & VK_DEBUG_REPORT_DEBUG_BIT_EXT) { - sprintf(message, "DEBUG: [%s] Code %d : %s", pLayerPrefix, msgCode, pMsg); - validation_error = 1; + if (demo->use_break) { +#ifndef WIN32 + raise(SIGTRAP); +#else + DebugBreak(); +#endif + } + + if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT) { + strcat(prefix, "VERBOSE : "); + } else if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT) { + strcat(prefix, "INFO : "); + } else if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) { + strcat(prefix, "WARNING : "); + } else if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) { + strcat(prefix, "ERROR : "); + } + + if (messageType & VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT) { + strcat(prefix, "GENERAL"); } else { - sprintf(message, "INFORMATION: [%s] Code %d : %s", pLayerPrefix, msgCode, pMsg); - validation_error = 1; + if (messageType & VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT) { + strcat(prefix, "VALIDATION"); + validation_error = 1; + } + if (messageType & VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT) { + if (messageType & VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT) { + strcat(prefix, "|"); + } + strcat(prefix, "PERFORMANCE"); + } + } + + sprintf(message, "%s - Message Id Number: %d | Message Id Name: %s\n\t%s\n", prefix, pCallbackData->messageIdNumber, + pCallbackData->pMessageIdName, pCallbackData->pMessage); + if (pCallbackData->objectCount > 0) { + char tmp_message[500]; + sprintf(tmp_message, "\n\tObjects - %d\n", pCallbackData->objectCount); + strcat(message, tmp_message); + for (uint32_t object = 0; object < pCallbackData->objectCount; ++object) { + if (NULL != pCallbackData->pObjects[object].pObjectName && strlen(pCallbackData->pObjects[object].pObjectName) > 0) { + sprintf(tmp_message, "\t\tObject[%d] - %s, Handle %p, Name \"%s\"\n", object, + string_VkObjectType(pCallbackData->pObjects[object].objectType), + (void *)(pCallbackData->pObjects[object].objectHandle), pCallbackData->pObjects[object].pObjectName); + } else { + sprintf(tmp_message, "\t\tObject[%d] - %s, Handle %p\n", object, + string_VkObjectType(pCallbackData->pObjects[object].objectType), + (void *)(pCallbackData->pObjects[object].objectHandle)); + } + strcat(message, tmp_message); + } + } + if (pCallbackData->cmdBufLabelCount > 0) { + char tmp_message[500]; + sprintf(tmp_message, "\n\tCommand Buffer Labels - %d\n", pCallbackData->cmdBufLabelCount); + strcat(message, tmp_message); + for (uint32_t cmd_buf_label = 0; cmd_buf_label < pCallbackData->cmdBufLabelCount; ++cmd_buf_label) { + sprintf(tmp_message, "\t\tLabel[%d] - %s { %f, %f, %f, %f}\n", cmd_buf_label, + pCallbackData->pCmdBufLabels[cmd_buf_label].pLabelName, pCallbackData->pCmdBufLabels[cmd_buf_label].color[0], + pCallbackData->pCmdBufLabels[cmd_buf_label].color[1], pCallbackData->pCmdBufLabels[cmd_buf_label].color[2], + pCallbackData->pCmdBufLabels[cmd_buf_label].color[3]); + strcat(message, tmp_message); + } } #ifdef _WIN32 in_callback = true; - struct demo *demo = (struct demo*) pUserData; if (!demo->suppress_popups) MessageBox(NULL, message, "Alert", MB_OK); in_callback = false; #elif defined(ANDROID) - if (msgFlags & VK_DEBUG_REPORT_INFORMATION_BIT_EXT) { + if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT) { __android_log_print(ANDROID_LOG_INFO, APP_SHORT_NAME, "%s", message); - } else if (msgFlags & VK_DEBUG_REPORT_WARNING_BIT_EXT) { + } else if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) { __android_log_print(ANDROID_LOG_WARN, APP_SHORT_NAME, "%s", message); - } else if (msgFlags & VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT) { - __android_log_print(ANDROID_LOG_WARN, APP_SHORT_NAME, "%s", message); - } else if (msgFlags & VK_DEBUG_REPORT_ERROR_BIT_EXT) { + } else if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) { __android_log_print(ANDROID_LOG_ERROR, APP_SHORT_NAME, "%s", message); - } else if (msgFlags & VK_DEBUG_REPORT_DEBUG_BIT_EXT) { - __android_log_print(ANDROID_LOG_DEBUG, APP_SHORT_NAME, "%s", message); + } else if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT) { + __android_log_print(ANDROID_LOG_VERBOSE, APP_SHORT_NAME, "%s", message); } else { __android_log_print(ANDROID_LOG_INFO, APP_SHORT_NAME, "%s", message); } @@ -515,15 +554,7 @@ free(message); - // clang-format on - - /* - * false indicates that layer should not bail-out of an - * API call that had validation failures. This may mean that the - * app dies inside the driver due to invalid parameter(s). - * That's what would happen without validation layers, so we'll - * keep that behavior here. - */ + // Don't bail out, but keep going. return false; } @@ -545,10 +576,7 @@ return false; } } -bool CanPresentEarlier(uint64_t earliest, - uint64_t actual, - uint64_t margin, - uint64_t rdur) { +bool CanPresentEarlier(uint64_t earliest, uint64_t actual, uint64_t margin, uint64_t rdur) { if (earliest < actual) { // Consider whether this present could have occured earlier. Make sure // that earliest time was at least 2msec earlier than actual time, and @@ -567,15 +595,12 @@ // Forward declaration: static void demo_resize(struct demo *demo); -static bool memory_type_from_properties(struct demo *demo, uint32_t typeBits, - VkFlags requirements_mask, - uint32_t *typeIndex) { +static bool memory_type_from_properties(struct demo *demo, uint32_t typeBits, VkFlags requirements_mask, uint32_t *typeIndex) { // Search memtypes to find first index with those properties for (uint32_t i = 0; i < VK_MAX_MEMORY_TYPES; i++) { if ((typeBits & 1) == 1) { // Type is available, does it match user properties? - if ((demo->memory_properties.memoryTypes[i].propertyFlags & - requirements_mask) == requirements_mask) { + if ((demo->memory_properties.memoryTypes[i].propertyFlags & requirements_mask) == requirements_mask) { *typeIndex = i; return true; } @@ -591,16 +616,13 @@ // This function could get called twice if the texture uses a staging buffer // In that case the second call should be ignored - if (demo->cmd == VK_NULL_HANDLE) - return; + if (demo->cmd == VK_NULL_HANDLE) return; err = vkEndCommandBuffer(demo->cmd); assert(!err); VkFence fence; - VkFenceCreateInfo fence_ci = {.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, - .pNext = NULL, - .flags = 0}; + VkFenceCreateInfo fence_ci = {.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, .pNext = NULL, .flags = 0}; err = vkCreateFence(demo->device, &fence_ci, NULL, &fence); assert(!err); @@ -626,67 +648,59 @@ demo->cmd = VK_NULL_HANDLE; } -static void demo_set_image_layout(struct demo *demo, VkImage image, - VkImageAspectFlags aspectMask, - VkImageLayout old_image_layout, - VkImageLayout new_image_layout, - VkAccessFlagBits srcAccessMask, - VkPipelineStageFlags src_stages, +static void demo_set_image_layout(struct demo *demo, VkImage image, VkImageAspectFlags aspectMask, VkImageLayout old_image_layout, + VkImageLayout new_image_layout, VkAccessFlagBits srcAccessMask, VkPipelineStageFlags src_stages, VkPipelineStageFlags dest_stages) { assert(demo->cmd); - VkImageMemoryBarrier image_memory_barrier = { - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, - .pNext = NULL, - .srcAccessMask = srcAccessMask, - .dstAccessMask = 0, - .oldLayout = old_image_layout, - .newLayout = new_image_layout, - .image = image, - .subresourceRange = {aspectMask, 0, 1, 0, 1}}; + VkImageMemoryBarrier image_memory_barrier = {.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + .pNext = NULL, + .srcAccessMask = srcAccessMask, + .dstAccessMask = 0, + .oldLayout = old_image_layout, + .newLayout = new_image_layout, + .image = image, + .subresourceRange = {aspectMask, 0, 1, 0, 1}}; switch (new_image_layout) { - case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL: - /* Make sure anything that was copying from this image has completed */ - image_memory_barrier.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; - break; - - case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL: - image_memory_barrier.dstAccessMask = - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; - break; - - case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL: - image_memory_barrier.dstAccessMask = - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; - break; - - case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL: - image_memory_barrier.dstAccessMask = - VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_INPUT_ATTACHMENT_READ_BIT; - break; - - case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL: - image_memory_barrier.dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT; - break; - - case VK_IMAGE_LAYOUT_PRESENT_SRC_KHR: - image_memory_barrier.dstAccessMask = VK_ACCESS_MEMORY_READ_BIT; - break; - - default: - image_memory_barrier.dstAccessMask = 0; - break; - } + case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL: + /* Make sure anything that was copying from this image has completed */ + image_memory_barrier.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; + break; + + case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL: + image_memory_barrier.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; + break; + + case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL: + image_memory_barrier.dstAccessMask = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; + break; + + case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL: + image_memory_barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_INPUT_ATTACHMENT_READ_BIT; + break; + + case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL: + image_memory_barrier.dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT; + break; + case VK_IMAGE_LAYOUT_PRESENT_SRC_KHR: + image_memory_barrier.dstAccessMask = VK_ACCESS_MEMORY_READ_BIT; + break; + + default: + image_memory_barrier.dstAccessMask = 0; + break; + } VkImageMemoryBarrier *pmemory_barrier = &image_memory_barrier; - vkCmdPipelineBarrier(demo->cmd, src_stages, dest_stages, 0, 0, NULL, 0, - NULL, 1, pmemory_barrier); + vkCmdPipelineBarrier(demo->cmd, src_stages, dest_stages, 0, 0, NULL, 0, NULL, 1, pmemory_barrier); } static void demo_draw_build_cmd(struct demo *demo, VkCommandBuffer cmd_buf) { + VkDebugUtilsLabelEXT label; + memset(&label, 0, sizeof(label)); const VkCommandBufferBeginInfo cmd_buf_info = { .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, .pNext = NULL, @@ -694,8 +708,8 @@ .pInheritanceInfo = NULL, }; const VkClearValue clear_values[2] = { - [0] = {.color.float32 = {0.2f, 0.2f, 0.2f, 0.2f}}, - [1] = {.depthStencil = {1.0f, 0}}, + [0] = {.color.float32 = {0.2f, 0.2f, 0.2f, 0.2f}}, + [1] = {.depthStencil = {1.0f, 0}}, }; const VkRenderPassBeginInfo rp_begin = { .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, @@ -712,13 +726,45 @@ VkResult U_ASSERT_ONLY err; err = vkBeginCommandBuffer(cmd_buf, &cmd_buf_info); + + if (demo->validate) { + // Set a name for the command buffer + VkDebugUtilsObjectNameInfoEXT cmd_buf_name = { + .sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT, + .pNext = NULL, + .objectType = VK_OBJECT_TYPE_COMMAND_BUFFER, + .objectHandle = (uint64_t)cmd_buf, + .pObjectName = "CubeDrawCommandBuf", + }; + demo->SetDebugUtilsObjectNameEXT(demo->device, &cmd_buf_name); + + label.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT; + label.pNext = NULL; + label.pLabelName = "DrawBegin"; + label.color[0] = 0.4f; + label.color[1] = 0.3f; + label.color[2] = 0.2f; + label.color[3] = 0.1f; + demo->CmdBeginDebugUtilsLabelEXT(cmd_buf, &label); + } + assert(!err); vkCmdBeginRenderPass(cmd_buf, &rp_begin, VK_SUBPASS_CONTENTS_INLINE); + + if (demo->validate) { + label.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT; + label.pNext = NULL; + label.pLabelName = "InsideRenderPass"; + label.color[0] = 8.4f; + label.color[1] = 7.3f; + label.color[2] = 6.2f; + label.color[3] = 7.1f; + demo->CmdBeginDebugUtilsLabelEXT(cmd_buf, &label); + } + vkCmdBindPipeline(cmd_buf, VK_PIPELINE_BIND_POINT_GRAPHICS, demo->pipeline); - vkCmdBindDescriptorSets(cmd_buf, VK_PIPELINE_BIND_POINT_GRAPHICS, - demo->pipeline_layout, 0, 1, - &demo->swapchain_image_resources[demo->current_buffer].descriptor_set, - 0, NULL); + vkCmdBindDescriptorSets(cmd_buf, VK_PIPELINE_BIND_POINT_GRAPHICS, demo->pipeline_layout, 0, 1, + &demo->swapchain_image_resources[demo->current_buffer].descriptor_set, 0, NULL); VkViewport viewport; memset(&viewport, 0, sizeof(viewport)); viewport.height = (float)demo->height; @@ -734,10 +780,29 @@ scissor.offset.x = 0; scissor.offset.y = 0; vkCmdSetScissor(cmd_buf, 0, 1, &scissor); + + if (demo->validate) { + label.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT; + label.pNext = NULL; + label.pLabelName = "ActualDraw"; + label.color[0] = -0.4f; + label.color[1] = -0.3f; + label.color[2] = -0.2f; + label.color[3] = -0.1f; + demo->CmdBeginDebugUtilsLabelEXT(cmd_buf, &label); + } + vkCmdDraw(cmd_buf, 12 * 3, 1, 0, 0); + if (demo->validate) { + demo->CmdEndDebugUtilsLabelEXT(cmd_buf); + } + // Note that ending the renderpass changes the image's layout from // COLOR_ATTACHMENT_OPTIMAL to PRESENT_SRC_KHR vkCmdEndRenderPass(cmd_buf); + if (demo->validate) { + demo->CmdEndDebugUtilsLabelEXT(cmd_buf); + } if (demo->separate_present_queue) { // We have to transfer ownership from the graphics queue family to the @@ -745,22 +810,22 @@ // to transfer from present queue family back to graphics queue family at // the start of the next frame because we don't care about the image's // contents at that point. - VkImageMemoryBarrier image_ownership_barrier = { - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, - .pNext = NULL, - .srcAccessMask = 0, - .dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, - .oldLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, - .newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, - .srcQueueFamilyIndex = demo->graphics_queue_family_index, - .dstQueueFamilyIndex = demo->present_queue_family_index, - .image = demo->swapchain_image_resources[demo->current_buffer].image, - .subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1}}; - - vkCmdPipelineBarrier(cmd_buf, - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0, - 0, NULL, 0, NULL, 1, &image_ownership_barrier); + VkImageMemoryBarrier image_ownership_barrier = {.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + .pNext = NULL, + .srcAccessMask = 0, + .dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, + .oldLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, + .newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, + .srcQueueFamilyIndex = demo->graphics_queue_family_index, + .dstQueueFamilyIndex = demo->present_queue_family_index, + .image = demo->swapchain_image_resources[demo->current_buffer].image, + .subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1}}; + + vkCmdPipelineBarrier(cmd_buf, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0, 0, + NULL, 0, NULL, 1, &image_ownership_barrier); + } + if (demo->validate) { + demo->CmdEndDebugUtilsLabelEXT(cmd_buf); } err = vkEndCommandBuffer(cmd_buf); assert(!err); @@ -775,26 +840,22 @@ .flags = VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT, .pInheritanceInfo = NULL, }; - err = vkBeginCommandBuffer(demo->swapchain_image_resources[i].graphics_to_present_cmd, - &cmd_buf_info); + err = vkBeginCommandBuffer(demo->swapchain_image_resources[i].graphics_to_present_cmd, &cmd_buf_info); assert(!err); - VkImageMemoryBarrier image_ownership_barrier = { - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, - .pNext = NULL, - .srcAccessMask = 0, - .dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, - .oldLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, - .newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, - .srcQueueFamilyIndex = demo->graphics_queue_family_index, - .dstQueueFamilyIndex = demo->present_queue_family_index, - .image = demo->swapchain_image_resources[i].image, - .subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1}}; - - vkCmdPipelineBarrier(demo->swapchain_image_resources[i].graphics_to_present_cmd, - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, 0, 0, - NULL, 0, NULL, 1, &image_ownership_barrier); + VkImageMemoryBarrier image_ownership_barrier = {.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + .pNext = NULL, + .srcAccessMask = 0, + .dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, + .oldLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, + .newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, + .srcQueueFamilyIndex = demo->graphics_queue_family_index, + .dstQueueFamilyIndex = demo->present_queue_family_index, + .image = demo->swapchain_image_resources[i].image, + .subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1}}; + + vkCmdPipelineBarrier(demo->swapchain_image_resources[i].graphics_to_present_cmd, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, + VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, 0, 0, NULL, 0, NULL, 1, &image_ownership_barrier); err = vkEndCommandBuffer(demo->swapchain_image_resources[i].graphics_to_present_cmd); assert(!err); } @@ -809,13 +870,11 @@ // Rotate around the Y axis mat4x4_dup(Model, demo->model_matrix); - mat4x4_rotate(demo->model_matrix, Model, 0.0f, 1.0f, 0.0f, - (float)degreesToRadians(demo->spin_angle)); + mat4x4_rotate(demo->model_matrix, Model, 0.0f, 1.0f, 0.0f, (float)degreesToRadians(demo->spin_angle)); mat4x4_mul(MVP, VP, demo->model_matrix); - err = vkMapMemory(demo->device, - demo->swapchain_image_resources[demo->current_buffer].uniform_memory, 0, - VK_WHOLE_SIZE, 0, (void **)&pData); + err = vkMapMemory(demo->device, demo->swapchain_image_resources[demo->current_buffer].uniform_memory, 0, VK_WHOLE_SIZE, 0, + (void **)&pData); assert(!err); memcpy(pData, (const void *)&MVP[0][0], matrixSize); @@ -827,27 +886,21 @@ // Look at what happened to previous presents, and make appropriate // adjustments in timing: VkResult U_ASSERT_ONLY err; - VkPastPresentationTimingGOOGLE* past = NULL; + VkPastPresentationTimingGOOGLE *past = NULL; uint32_t count = 0; - err = demo->fpGetPastPresentationTimingGOOGLE(demo->device, - demo->swapchain, - &count, - NULL); + err = demo->fpGetPastPresentationTimingGOOGLE(demo->device, demo->swapchain, &count, NULL); assert(!err); if (count) { - past = (VkPastPresentationTimingGOOGLE*) malloc(sizeof(VkPastPresentationTimingGOOGLE) * count); + past = (VkPastPresentationTimingGOOGLE *)malloc(sizeof(VkPastPresentationTimingGOOGLE) * count); assert(past); - err = demo->fpGetPastPresentationTimingGOOGLE(demo->device, - demo->swapchain, - &count, - past); + err = demo->fpGetPastPresentationTimingGOOGLE(demo->device, demo->swapchain, &count, past); assert(!err); bool early = false; bool late = false; bool calibrate_next = false; - for (uint32_t i = 0 ; i < count ; i++) { + for (uint32_t i = 0; i < count; i++) { if (!demo->syncd_with_actual_presents) { // This is the first time that we've received an // actualPresentTime for this swapchain. In order to not @@ -862,9 +915,7 @@ demo->last_early_id = 0; demo->syncd_with_actual_presents = true; break; - } else if (CanPresentEarlier(past[i].earliestPresentTime, - past[i].actualPresentTime, - past[i].presentMargin, + } else if (CanPresentEarlier(past[i].earliestPresentTime, past[i].actualPresentTime, past[i].presentMargin, demo->refresh_duration)) { // This image could have been presented earlier. We don't want // to decrease the target_IPD until we've seen early presents @@ -877,10 +928,8 @@ } else if (demo->last_early_id == 0) { // This is the first early present we've seen. // Calculate the presentID for two seconds from now. - uint64_t lastEarlyTime = - past[i].actualPresentTime + (2 * BILLION); - uint32_t howManyPresents = - (uint32_t)((lastEarlyTime - past[i].actualPresentTime) / demo->target_IPD); + uint64_t lastEarlyTime = past[i].actualPresentTime + (2 * BILLION); + uint32_t howManyPresents = (uint32_t)((lastEarlyTime - past[i].actualPresentTime) / demo->target_IPD); demo->last_early_id = past[i].presentID + howManyPresents; } else { // We are in the midst of a set of early images, @@ -888,17 +937,14 @@ } late = false; demo->last_late_id = 0; - } else if (ActualTimeLate(past[i].desiredPresentTime, - past[i].actualPresentTime, - demo->refresh_duration)) { + } else if (ActualTimeLate(past[i].desiredPresentTime, past[i].actualPresentTime, demo->refresh_duration)) { // This image was presented after its desired time. Since // there's a delay between calling vkQueuePresentKHR and when // we get the timing data, several presents may have been late. // Thus, we need to threat all of the outstanding presents as // being likely late, so that we only increase the target_IPD // once for all of those presents. - if ((demo->last_late_id == 0) || - (demo->last_late_id < past[i].presentID)) { + if ((demo->last_late_id == 0) || (demo->last_late_id < past[i].presentID)) { late = true; // Record the last suspected-late present: demo->last_late_id = demo->next_present_id - 1; @@ -932,8 +978,7 @@ // try to go faster. demo->refresh_duration_multiplier = 1; } - demo->target_IPD = - demo->refresh_duration * demo->refresh_duration_multiplier; + demo->target_IPD = demo->refresh_duration * demo->refresh_duration_multiplier; } if (late) { // Since we found a new instance of a late present, we want to @@ -942,15 +987,12 @@ // TODO(ianelliott): Try to calculate a better target_IPD based // on the most recently-seen present (this is overly-simplistic). demo->refresh_duration_multiplier++; - demo->target_IPD = - demo->refresh_duration * demo->refresh_duration_multiplier; + demo->target_IPD = demo->refresh_duration * demo->refresh_duration_multiplier; } if (calibrate_next) { - int64_t multiple = demo->next_present_id - past[count-1].presentID; - demo->prev_desired_present_time = - (past[count-1].actualPresentTime + - (multiple * demo->target_IPD)); + int64_t multiple = demo->next_present_id - past[count - 1].presentID; + demo->prev_desired_present_time = (past[count - 1].actualPresentTime + (multiple * demo->target_IPD)); } } } @@ -964,9 +1006,9 @@ do { // Get the index of the next available swapchain image: - err = demo->fpAcquireNextImageKHR(demo->device, demo->swapchain, UINT64_MAX, - demo->image_acquired_semaphores[demo->frame_index], - VK_NULL_HANDLE, &demo->current_buffer); + err = + demo->fpAcquireNextImageKHR(demo->device, demo->swapchain, UINT64_MAX, + demo->image_acquired_semaphores[demo->frame_index], VK_NULL_HANDLE, &demo->current_buffer); if (err == VK_ERROR_OUT_OF_DATE_KHR) { // demo->swapchain is out of date (e.g. the window was resized) and @@ -1011,8 +1053,7 @@ submit_info.pCommandBuffers = &demo->swapchain_image_resources[demo->current_buffer].cmd; submit_info.signalSemaphoreCount = 1; submit_info.pSignalSemaphores = &demo->draw_complete_semaphores[demo->frame_index]; - err = vkQueueSubmit(demo->graphics_queue, 1, &submit_info, - demo->fences[demo->frame_index]); + err = vkQueueSubmit(demo->graphics_queue, 1, &submit_info, demo->fences[demo->frame_index]); assert(!err); if (demo->separate_present_queue) { @@ -1024,8 +1065,7 @@ submit_info.waitSemaphoreCount = 1; submit_info.pWaitSemaphores = &demo->draw_complete_semaphores[demo->frame_index]; submit_info.commandBufferCount = 1; - submit_info.pCommandBuffers = - &demo->swapchain_image_resources[demo->current_buffer].graphics_to_present_cmd; + submit_info.pCommandBuffers = &demo->swapchain_image_resources[demo->current_buffer].graphics_to_present_cmd; submit_info.signalSemaphoreCount = 1; submit_info.pSignalSemaphores = &demo->image_ownership_semaphores[demo->frame_index]; err = vkQueueSubmit(demo->present_queue, 1, &submit_info, nullFence); @@ -1038,9 +1078,8 @@ .sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR, .pNext = NULL, .waitSemaphoreCount = 1, - .pWaitSemaphores = (demo->separate_present_queue) - ? &demo->image_ownership_semaphores[demo->frame_index] - : &demo->draw_complete_semaphores[demo->frame_index], + .pWaitSemaphores = (demo->separate_present_queue) ? &demo->image_ownership_semaphores[demo->frame_index] + : &demo->draw_complete_semaphores[demo->frame_index], .swapchainCount = 1, .pSwapchains = &demo->swapchain, .pImageIndices = &demo->current_buffer, @@ -1094,8 +1133,7 @@ ptime.desiredPresentTime = curtime + (demo->target_IPD >> 1); } } else { - ptime.desiredPresentTime = (demo->prev_desired_present_time + - demo->target_IPD); + ptime.desiredPresentTime = (demo->prev_desired_present_time + demo->target_IPD); } ptime.presentID = demo->next_present_id++; demo->prev_desired_present_time = ptime.desiredPresentTime; @@ -1133,19 +1171,15 @@ // Check the surface capabilities and formats VkSurfaceCapabilitiesKHR surfCapabilities; - err = demo->fpGetPhysicalDeviceSurfaceCapabilitiesKHR( - demo->gpu, demo->surface, &surfCapabilities); + err = demo->fpGetPhysicalDeviceSurfaceCapabilitiesKHR(demo->gpu, demo->surface, &surfCapabilities); assert(!err); uint32_t presentModeCount; - err = demo->fpGetPhysicalDeviceSurfacePresentModesKHR( - demo->gpu, demo->surface, &presentModeCount, NULL); + err = demo->fpGetPhysicalDeviceSurfacePresentModesKHR(demo->gpu, demo->surface, &presentModeCount, NULL); assert(!err); - VkPresentModeKHR *presentModes = - (VkPresentModeKHR *)malloc(presentModeCount * sizeof(VkPresentModeKHR)); + VkPresentModeKHR *presentModes = (VkPresentModeKHR *)malloc(presentModeCount * sizeof(VkPresentModeKHR)); assert(presentModes); - err = demo->fpGetPhysicalDeviceSurfacePresentModesKHR( - demo->gpu, demo->surface, &presentModeCount, presentModes); + err = demo->fpGetPhysicalDeviceSurfacePresentModesKHR(demo->gpu, demo->surface, &presentModeCount, presentModes); assert(!err); VkExtent2D swapchainExtent; @@ -1162,7 +1196,7 @@ } else if (swapchainExtent.width > surfCapabilities.maxImageExtent.width) { swapchainExtent.width = surfCapabilities.maxImageExtent.width; } - + if (swapchainExtent.height < surfCapabilities.minImageExtent.height) { swapchainExtent.height = surfCapabilities.minImageExtent.height; } else if (swapchainExtent.height > surfCapabilities.maxImageExtent.height) { @@ -1175,6 +1209,13 @@ demo->height = surfCapabilities.currentExtent.height; } + if (demo->width == 0 || demo->height == 0) { + demo->is_minimized = true; + return; + } else { + demo->is_minimized = false; + } + // The FIFO present mode is guaranteed by the spec to be supported // and to have no tearing. It's a great default present mode to use. VkPresentModeKHR swapchainPresentMode = VK_PRESENT_MODE_FIFO_KHR; @@ -1206,8 +1247,7 @@ // the application wants the late image to be immediately displayed, even // though that may mean some tearing. - if (demo->presentMode != swapchainPresentMode) { - + if (demo->presentMode != swapchainPresentMode) { for (size_t i = 0; i < presentModeCount; ++i) { if (presentModes[i] == demo->presentMode) { swapchainPresentMode = demo->presentMode; @@ -1228,15 +1268,13 @@ } // If maxImageCount is 0, we can ask for as many images as we want; // otherwise we're limited to maxImageCount - if ((surfCapabilities.maxImageCount > 0) && - (desiredNumOfSwapchainImages > surfCapabilities.maxImageCount)) { + if ((surfCapabilities.maxImageCount > 0) && (desiredNumOfSwapchainImages > surfCapabilities.maxImageCount)) { // Application must settle for fewer images than desired: desiredNumOfSwapchainImages = surfCapabilities.maxImageCount; } VkSurfaceTransformFlagsKHR preTransform; - if (surfCapabilities.supportedTransforms & - VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { + if (surfCapabilities.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { preTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; } else { preTransform = surfCapabilities.currentTransform; @@ -1266,7 +1304,8 @@ .imageColorSpace = demo->color_space, .imageExtent = { - .width = swapchainExtent.width, .height = swapchainExtent.height, + .width = swapchainExtent.width, + .height = swapchainExtent.height, }, .imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, .preTransform = preTransform, @@ -1280,8 +1319,7 @@ .clipped = true, }; uint32_t i; - err = demo->fpCreateSwapchainKHR(demo->device, &swapchain_ci, NULL, - &demo->swapchain); + err = demo->fpCreateSwapchainKHR(demo->device, &swapchain_ci, NULL, &demo->swapchain); assert(!err); // If we just re-created an existing swapchain, we should destroy the old @@ -1292,20 +1330,16 @@ demo->fpDestroySwapchainKHR(demo->device, oldSwapchain, NULL); } - err = demo->fpGetSwapchainImagesKHR(demo->device, demo->swapchain, - &demo->swapchainImageCount, NULL); + err = demo->fpGetSwapchainImagesKHR(demo->device, demo->swapchain, &demo->swapchainImageCount, NULL); assert(!err); - VkImage *swapchainImages = - (VkImage *)malloc(demo->swapchainImageCount * sizeof(VkImage)); + VkImage *swapchainImages = (VkImage *)malloc(demo->swapchainImageCount * sizeof(VkImage)); assert(swapchainImages); - err = demo->fpGetSwapchainImagesKHR(demo->device, demo->swapchain, - &demo->swapchainImageCount, - swapchainImages); + err = demo->fpGetSwapchainImagesKHR(demo->device, demo->swapchain, &demo->swapchainImageCount, swapchainImages); assert(!err); - demo->swapchain_image_resources = (SwapchainImageResources *)malloc(sizeof(SwapchainImageResources) * - demo->swapchainImageCount); + demo->swapchain_image_resources = + (SwapchainImageResources *)malloc(sizeof(SwapchainImageResources) * demo->swapchainImageCount); assert(demo->swapchain_image_resources); for (i = 0; i < demo->swapchainImageCount; i++) { @@ -1315,16 +1349,13 @@ .format = demo->format, .components = { - .r = VK_COMPONENT_SWIZZLE_R, - .g = VK_COMPONENT_SWIZZLE_G, - .b = VK_COMPONENT_SWIZZLE_B, - .a = VK_COMPONENT_SWIZZLE_A, + .r = VK_COMPONENT_SWIZZLE_R, + .g = VK_COMPONENT_SWIZZLE_G, + .b = VK_COMPONENT_SWIZZLE_B, + .a = VK_COMPONENT_SWIZZLE_A, }, - .subresourceRange = {.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, - .baseMipLevel = 0, - .levelCount = 1, - .baseArrayLayer = 0, - .layerCount = 1}, + .subresourceRange = + {.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, .baseMipLevel = 0, .levelCount = 1, .baseArrayLayer = 0, .layerCount = 1}, .viewType = VK_IMAGE_VIEW_TYPE_2D, .flags = 0, }; @@ -1333,16 +1364,13 @@ color_image_view.image = demo->swapchain_image_resources[i].image; - err = vkCreateImageView(demo->device, &color_image_view, NULL, - &demo->swapchain_image_resources[i].view); + err = vkCreateImageView(demo->device, &color_image_view, NULL, &demo->swapchain_image_resources[i].view); assert(!err); } if (demo->VK_GOOGLE_display_timing_enabled) { VkRefreshCycleDurationGOOGLE rc_dur; - err = demo->fpGetRefreshCycleDurationGOOGLE(demo->device, - demo->swapchain, - &rc_dur); + err = demo->fpGetRefreshCycleDurationGOOGLE(demo->device, demo->swapchain, &rc_dur); assert(!err); demo->refresh_duration = rc_dur.refreshDuration; @@ -1380,11 +1408,8 @@ .pNext = NULL, .image = VK_NULL_HANDLE, .format = depth_format, - .subresourceRange = {.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT, - .baseMipLevel = 0, - .levelCount = 1, - .baseArrayLayer = 0, - .layerCount = 1}, + .subresourceRange = + {.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT, .baseMipLevel = 0, .levelCount = 1, .baseArrayLayer = 0, .layerCount = 1}, .flags = 0, .viewType = VK_IMAGE_VIEW_TYPE_2D, }; @@ -1407,19 +1432,16 @@ demo->depth.mem_alloc.allocationSize = mem_reqs.size; demo->depth.mem_alloc.memoryTypeIndex = 0; - pass = memory_type_from_properties(demo, mem_reqs.memoryTypeBits, - VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, + pass = memory_type_from_properties(demo, mem_reqs.memoryTypeBits, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, &demo->depth.mem_alloc.memoryTypeIndex); assert(pass); /* allocate memory */ - err = vkAllocateMemory(demo->device, &demo->depth.mem_alloc, NULL, - &demo->depth.mem); + err = vkAllocateMemory(demo->device, &demo->depth.mem_alloc, NULL, &demo->depth.mem); assert(!err); /* bind memory */ - err = - vkBindImageMemory(demo->device, demo->depth.image, demo->depth.mem, 0); + err = vkBindImageMemory(demo->device, demo->depth.image, demo->depth.mem, 0); assert(!err); /* create image view */ @@ -1429,30 +1451,31 @@ } /* Load a ppm file into memory */ -bool loadTexture(const char *filename, uint8_t *rgba_data, - VkSubresourceLayout *layout, int32_t *width, int32_t *height) { - +bool loadTexture(const char *filename, uint8_t *rgba_data, VkSubresourceLayout *layout, int32_t *width, int32_t *height) { #if (defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_MACOS_MVK)) - filename =[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent: @(filename)].UTF8String; + filename = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@(filename)].UTF8String; #endif #ifdef __ANDROID__ #include char *cPtr; - cPtr = (char*)lunarg_ppm; - if ((unsigned char*)cPtr >= (lunarg_ppm + lunarg_ppm_len) || strncmp(cPtr, "P6\n", 3)) { + cPtr = (char *)lunarg_ppm; + if ((unsigned char *)cPtr >= (lunarg_ppm + lunarg_ppm_len) || strncmp(cPtr, "P6\n", 3)) { return false; } - while(strncmp(cPtr++, "\n", 1)); + while (strncmp(cPtr++, "\n", 1)) + ; sscanf(cPtr, "%u %u", width, height); if (rgba_data == NULL) { return true; } - while(strncmp(cPtr++, "\n", 1)); - if ((unsigned char*)cPtr >= (lunarg_ppm + lunarg_ppm_len) || strncmp(cPtr, "255\n", 4)) { + while (strncmp(cPtr++, "\n", 1)) + ; + if ((unsigned char *)cPtr >= (lunarg_ppm + lunarg_ppm_len) || strncmp(cPtr, "255\n", 4)) { return false; } - while(strncmp(cPtr++, "\n", 1)); + while (strncmp(cPtr++, "\n", 1)) + ; for (int y = 0; y < *height; y++) { uint8_t *rowPtr = rgba_data; @@ -1470,10 +1493,9 @@ FILE *fPtr = fopen(filename, "rb"); char header[256], *cPtr, *tmp; - if (!fPtr) - return false; + if (!fPtr) return false; - cPtr = fgets(header, 256, fPtr); // P6 + cPtr = fgets(header, 256, fPtr); // P6 if (cPtr == NULL || strncmp(header, "P6\n", 3)) { fclose(fPtr); return false; @@ -1492,7 +1514,7 @@ fclose(fPtr); return true; } - tmp = fgets(header, 256, fPtr); // Format + tmp = fgets(header, 256, fPtr); // Format (void)tmp; if (cPtr == NULL || strncmp(header, "255\n", 3)) { fclose(fPtr); @@ -1514,11 +1536,8 @@ #endif } -static void demo_prepare_texture_image(struct demo *demo, const char *filename, - struct texture_object *tex_obj, - VkImageTiling tiling, - VkImageUsageFlags usage, - VkFlags required_props) { +static void demo_prepare_texture_image(struct demo *demo, const char *filename, struct texture_object *tex_obj, + VkImageTiling tiling, VkImageUsageFlags usage, VkFlags required_props) { const VkFormat tex_format = VK_FORMAT_R8G8B8A8_UNORM; int32_t tex_width; int32_t tex_height; @@ -1549,8 +1568,7 @@ VkMemoryRequirements mem_reqs; - err = - vkCreateImage(demo->device, &image_create_info, NULL, &tex_obj->image); + err = vkCreateImage(demo->device, &image_create_info, NULL, &tex_obj->image); assert(!err); vkGetImageMemoryRequirements(demo->device, tex_obj->image, &mem_reqs); @@ -1560,14 +1578,11 @@ tex_obj->mem_alloc.allocationSize = mem_reqs.size; tex_obj->mem_alloc.memoryTypeIndex = 0; - pass = memory_type_from_properties(demo, mem_reqs.memoryTypeBits, - required_props, - &tex_obj->mem_alloc.memoryTypeIndex); + pass = memory_type_from_properties(demo, mem_reqs.memoryTypeBits, required_props, &tex_obj->mem_alloc.memoryTypeIndex); assert(pass); /* allocate memory */ - err = vkAllocateMemory(demo->device, &tex_obj->mem_alloc, NULL, - &(tex_obj->mem)); + err = vkAllocateMemory(demo->device, &tex_obj->mem_alloc, NULL, &(tex_obj->mem)); assert(!err); /* bind memory */ @@ -1583,11 +1598,9 @@ VkSubresourceLayout layout; void *data; - vkGetImageSubresourceLayout(demo->device, tex_obj->image, &subres, - &layout); + vkGetImageSubresourceLayout(demo->device, tex_obj->image, &subres, &layout); - err = vkMapMemory(demo->device, tex_obj->mem, 0, - tex_obj->mem_alloc.allocationSize, 0, &data); + err = vkMapMemory(demo->device, tex_obj->mem, 0, tex_obj->mem_alloc.allocationSize, 0, &data); assert(!err); if (!loadTexture(filename, data, &layout, &tex_width, &tex_height)) { @@ -1600,8 +1613,7 @@ tex_obj->imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; } -static void demo_destroy_texture_image(struct demo *demo, - struct texture_object *tex_objs) { +static void demo_destroy_texture_image(struct demo *demo, struct texture_object *tex_objs) { /* clean up staging resources */ vkFreeMemory(demo->device, tex_objs->mem, NULL); vkDestroyImage(demo->device, tex_objs->image, NULL); @@ -1617,52 +1629,34 @@ for (i = 0; i < DEMO_TEXTURE_COUNT; i++) { VkResult U_ASSERT_ONLY err; - if ((props.linearTilingFeatures & - VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) && - !demo->use_staging_buffer) { + if ((props.linearTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) && !demo->use_staging_buffer) { /* Device can texture using linear textures */ - demo_prepare_texture_image( - demo, tex_files[i], &demo->textures[i], VK_IMAGE_TILING_LINEAR, - VK_IMAGE_USAGE_SAMPLED_BIT, - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); + demo_prepare_texture_image(demo, tex_files[i], &demo->textures[i], VK_IMAGE_TILING_LINEAR, VK_IMAGE_USAGE_SAMPLED_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); // Nothing in the pipeline needs to be complete to start, and don't allow fragment // shader to run until layout transition completes - demo_set_image_layout(demo, demo->textures[i].image, VK_IMAGE_ASPECT_COLOR_BIT, - VK_IMAGE_LAYOUT_PREINITIALIZED, demo->textures[i].imageLayout, - VK_ACCESS_HOST_WRITE_BIT, VK_PIPELINE_STAGE_HOST_BIT, + demo_set_image_layout(demo, demo->textures[i].image, VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_PREINITIALIZED, + demo->textures[i].imageLayout, 0, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT); demo->staging_texture.image = 0; - } else if (props.optimalTilingFeatures & - VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) { + } else if (props.optimalTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) { /* Must use staging buffer to copy linear texture to optimized */ memset(&demo->staging_texture, 0, sizeof(demo->staging_texture)); - demo_prepare_texture_image( - demo, tex_files[i], &demo->staging_texture, VK_IMAGE_TILING_LINEAR, - VK_IMAGE_USAGE_TRANSFER_SRC_BIT, - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); - - demo_prepare_texture_image( - demo, tex_files[i], &demo->textures[i], VK_IMAGE_TILING_OPTIMAL, - (VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), - VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); - - demo_set_image_layout(demo, demo->staging_texture.image, - VK_IMAGE_ASPECT_COLOR_BIT, - VK_IMAGE_LAYOUT_PREINITIALIZED, - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, - VK_ACCESS_HOST_WRITE_BIT, - VK_PIPELINE_STAGE_HOST_BIT, + demo_prepare_texture_image(demo, tex_files[i], &demo->staging_texture, VK_IMAGE_TILING_LINEAR, + VK_IMAGE_USAGE_TRANSFER_SRC_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); + + demo_prepare_texture_image(demo, tex_files[i], &demo->textures[i], VK_IMAGE_TILING_OPTIMAL, + (VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), + VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + + demo_set_image_layout(demo, demo->staging_texture.image, VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_PREINITIALIZED, + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, 0, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT); - demo_set_image_layout(demo, demo->textures[i].image, - VK_IMAGE_ASPECT_COLOR_BIT, - VK_IMAGE_LAYOUT_PREINITIALIZED, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - 0, - VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, + demo_set_image_layout(demo, demo->textures[i].image, VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_PREINITIALIZED, + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 0, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT); VkImageCopy copy_region = { @@ -1670,20 +1664,13 @@ .srcOffset = {0, 0, 0}, .dstSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1}, .dstOffset = {0, 0, 0}, - .extent = {demo->staging_texture.tex_width, - demo->staging_texture.tex_height, 1}, + .extent = {demo->staging_texture.tex_width, demo->staging_texture.tex_height, 1}, }; - vkCmdCopyImage( - demo->cmd, demo->staging_texture.image, - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, demo->textures[i].image, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ©_region); - - demo_set_image_layout(demo, demo->textures[i].image, - VK_IMAGE_ASPECT_COLOR_BIT, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - demo->textures[i].imageLayout, - VK_ACCESS_TRANSFER_WRITE_BIT, - VK_PIPELINE_STAGE_TRANSFER_BIT, + vkCmdCopyImage(demo->cmd, demo->staging_texture.image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, demo->textures[i].image, + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ©_region); + + demo_set_image_layout(demo, demo->textures[i].image, VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, + demo->textures[i].imageLayout, VK_ACCESS_TRANSFER_WRITE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT); } else { @@ -1718,22 +1705,22 @@ .format = tex_format, .components = { - VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, - VK_COMPONENT_SWIZZLE_B, VK_COMPONENT_SWIZZLE_A, + VK_COMPONENT_SWIZZLE_R, + VK_COMPONENT_SWIZZLE_G, + VK_COMPONENT_SWIZZLE_B, + VK_COMPONENT_SWIZZLE_A, }, .subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1}, .flags = 0, }; /* create sampler */ - err = vkCreateSampler(demo->device, &sampler, NULL, - &demo->textures[i].sampler); + err = vkCreateSampler(demo->device, &sampler, NULL, &demo->textures[i].sampler); assert(!err); /* create image view */ view.image = demo->textures[i].image; - err = vkCreateImageView(demo->device, &view, NULL, - &demo->textures[i].view); + err = vkCreateImageView(demo->device, &view, NULL, &demo->textures[i].view); assert(!err); } } @@ -1770,32 +1757,25 @@ buf_info.size = sizeof(data); for (unsigned int i = 0; i < demo->swapchainImageCount; i++) { - err = - vkCreateBuffer(demo->device, &buf_info, NULL, - &demo->swapchain_image_resources[i].uniform_buffer); + err = vkCreateBuffer(demo->device, &buf_info, NULL, &demo->swapchain_image_resources[i].uniform_buffer); assert(!err); - vkGetBufferMemoryRequirements(demo->device, - demo->swapchain_image_resources[i].uniform_buffer, - &mem_reqs); + vkGetBufferMemoryRequirements(demo->device, demo->swapchain_image_resources[i].uniform_buffer, &mem_reqs); mem_alloc.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; mem_alloc.pNext = NULL; mem_alloc.allocationSize = mem_reqs.size; mem_alloc.memoryTypeIndex = 0; - pass = memory_type_from_properties( - demo, mem_reqs.memoryTypeBits, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, - &mem_alloc.memoryTypeIndex); + pass = memory_type_from_properties(demo, mem_reqs.memoryTypeBits, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, + &mem_alloc.memoryTypeIndex); assert(pass); - err = vkAllocateMemory(demo->device, &mem_alloc, NULL, - &demo->swapchain_image_resources[i].uniform_memory); + err = vkAllocateMemory(demo->device, &mem_alloc, NULL, &demo->swapchain_image_resources[i].uniform_memory); assert(!err); - err = vkMapMemory(demo->device, demo->swapchain_image_resources[i].uniform_memory, 0, - VK_WHOLE_SIZE, 0, (void **)&pData); + err = vkMapMemory(demo->device, demo->swapchain_image_resources[i].uniform_memory, 0, VK_WHOLE_SIZE, 0, (void **)&pData); assert(!err); memcpy(pData, &data, sizeof data); @@ -1803,29 +1783,29 @@ vkUnmapMemory(demo->device, demo->swapchain_image_resources[i].uniform_memory); err = vkBindBufferMemory(demo->device, demo->swapchain_image_resources[i].uniform_buffer, - demo->swapchain_image_resources[i].uniform_memory, 0); + demo->swapchain_image_resources[i].uniform_memory, 0); assert(!err); } } static void demo_prepare_descriptor_layout(struct demo *demo) { const VkDescriptorSetLayoutBinding layout_bindings[2] = { - [0] = - { - .binding = 0, - .descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, - .descriptorCount = 1, - .stageFlags = VK_SHADER_STAGE_VERTEX_BIT, - .pImmutableSamplers = NULL, - }, - [1] = - { - .binding = 1, - .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, - .descriptorCount = DEMO_TEXTURE_COUNT, - .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT, - .pImmutableSamplers = NULL, - }, + [0] = + { + .binding = 0, + .descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, + .descriptorCount = 1, + .stageFlags = VK_SHADER_STAGE_VERTEX_BIT, + .pImmutableSamplers = NULL, + }, + [1] = + { + .binding = 1, + .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, + .descriptorCount = DEMO_TEXTURE_COUNT, + .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT, + .pImmutableSamplers = NULL, + }, }; const VkDescriptorSetLayoutCreateInfo descriptor_layout = { .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO, @@ -1835,8 +1815,7 @@ }; VkResult U_ASSERT_ONLY err; - err = vkCreateDescriptorSetLayout(demo->device, &descriptor_layout, NULL, - &demo->desc_layout); + err = vkCreateDescriptorSetLayout(demo->device, &descriptor_layout, NULL, &demo->desc_layout); assert(!err); const VkPipelineLayoutCreateInfo pPipelineLayoutCreateInfo = { @@ -1846,8 +1825,7 @@ .pSetLayouts = &demo->desc_layout, }; - err = vkCreatePipelineLayout(demo->device, &pPipelineLayoutCreateInfo, NULL, - &demo->pipeline_layout); + err = vkCreatePipelineLayout(demo->device, &pPipelineLayoutCreateInfo, NULL, &demo->pipeline_layout); assert(!err); } @@ -1861,35 +1839,34 @@ // LAYOUT_PRESENT_SRC_KHR to be ready to present. This is all done as part of // the renderpass, no barriers are necessary. const VkAttachmentDescription attachments[2] = { - [0] = - { - .format = demo->format, - .flags = 0, - .samples = VK_SAMPLE_COUNT_1_BIT, - .loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR, - .storeOp = VK_ATTACHMENT_STORE_OP_STORE, - .stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE, - .stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE, - .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED, - .finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, - }, - [1] = - { - .format = demo->depth.format, - .flags = 0, - .samples = VK_SAMPLE_COUNT_1_BIT, - .loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR, - .storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE, - .stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE, - .stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE, - .initialLayout = - VK_IMAGE_LAYOUT_UNDEFINED, - .finalLayout = - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - }, + [0] = + { + .format = demo->format, + .flags = 0, + .samples = VK_SAMPLE_COUNT_1_BIT, + .loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR, + .storeOp = VK_ATTACHMENT_STORE_OP_STORE, + .stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE, + .stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE, + .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED, + .finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, + }, + [1] = + { + .format = demo->depth.format, + .flags = 0, + .samples = VK_SAMPLE_COUNT_1_BIT, + .loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR, + .storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE, + .stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE, + .stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE, + .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED, + .finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + }, }; const VkAttachmentReference color_reference = { - .attachment = 0, .layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + .attachment = 0, + .layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, }; const VkAttachmentReference depth_reference = { .attachment = 1, @@ -1924,109 +1901,35 @@ assert(!err); } -//TODO: Merge shader reading -#ifndef __ANDROID__ -static VkShaderModule -demo_prepare_shader_module(struct demo *demo, const void *code, size_t size) { +static VkShaderModule demo_prepare_shader_module(struct demo *demo, const uint32_t *code, size_t size) { VkShaderModule module; VkShaderModuleCreateInfo moduleCreateInfo; VkResult U_ASSERT_ONLY err; moduleCreateInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; moduleCreateInfo.pNext = NULL; - + moduleCreateInfo.flags = 0; moduleCreateInfo.codeSize = size; moduleCreateInfo.pCode = code; - moduleCreateInfo.flags = 0; + err = vkCreateShaderModule(demo->device, &moduleCreateInfo, NULL, &module); assert(!err); return module; } -char *demo_read_spv(const char *filename, size_t *psize) { - long int size; - size_t U_ASSERT_ONLY retval; - void *shader_code; - -#if (defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_MACOS_MVK)) - filename =[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent: @(filename)].UTF8String; -#endif - - FILE *fp = fopen(filename, "rb"); - if (!fp) - return NULL; - - fseek(fp, 0L, SEEK_END); - size = ftell(fp); - - fseek(fp, 0L, SEEK_SET); - - shader_code = malloc(size); - retval = fread(shader_code, size, 1, fp); - assert(retval == 1); - - *psize = size; - - fclose(fp); - return shader_code; -} -#endif - -static VkShaderModule demo_prepare_vs(struct demo *demo) { -#ifdef __ANDROID__ - VkShaderModuleCreateInfo sh_info = {}; - sh_info.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; - -#include "cube.vert.h" - sh_info.codeSize = sizeof(cube_vert); - sh_info.pCode = cube_vert; - VkResult U_ASSERT_ONLY err = vkCreateShaderModule(demo->device, &sh_info, NULL, &demo->vert_shader_module); - assert(!err); -#else - void *vertShaderCode; - size_t size; - - vertShaderCode = demo_read_spv("cube-vert.spv", &size); - if (!vertShaderCode) { - ERR_EXIT("Failed to load cube-vert.spv", "Load Shader Failure"); - } - - demo->vert_shader_module = - demo_prepare_shader_module(demo, vertShaderCode, size); - - free(vertShaderCode); -#endif - - return demo->vert_shader_module; +static void demo_prepare_vs(struct demo *demo) { + const uint32_t vs_code[] = { +#include "cube.vert.inc" + }; + demo->vert_shader_module = demo_prepare_shader_module(demo, vs_code, sizeof(vs_code)); } -static VkShaderModule demo_prepare_fs(struct demo *demo) { -#ifdef __ANDROID__ - VkShaderModuleCreateInfo sh_info = {}; - sh_info.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; - -#include "cube.frag.h" - sh_info.codeSize = sizeof(cube_frag); - sh_info.pCode = cube_frag; - VkResult U_ASSERT_ONLY err = vkCreateShaderModule(demo->device, &sh_info, NULL, &demo->frag_shader_module); - assert(!err); -#else - void *fragShaderCode; - size_t size; - - fragShaderCode = demo_read_spv("cube-frag.spv", &size); - if (!fragShaderCode) { - ERR_EXIT("Failed to load cube-frag.spv", "Load Shader Failure"); - } - - demo->frag_shader_module = - demo_prepare_shader_module(demo, fragShaderCode, size); - - free(fragShaderCode); -#endif - - return demo->frag_shader_module; +static void demo_prepare_fs(struct demo *demo) { + const uint32_t fs_code[] = { +#include "cube.frag.inc" + }; + demo->frag_shader_module = demo_prepare_shader_module(demo, fs_code, sizeof(fs_code)); } static void demo_prepare_pipeline(struct demo *demo) { @@ -2081,11 +1984,9 @@ memset(&vp, 0, sizeof(vp)); vp.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO; vp.viewportCount = 1; - dynamicStateEnables[dynamicState.dynamicStateCount++] = - VK_DYNAMIC_STATE_VIEWPORT; + dynamicStateEnables[dynamicState.dynamicStateCount++] = VK_DYNAMIC_STATE_VIEWPORT; vp.scissorCount = 1; - dynamicStateEnables[dynamicState.dynamicStateCount++] = - VK_DYNAMIC_STATE_SCISSOR; + dynamicStateEnables[dynamicState.dynamicStateCount++] = VK_DYNAMIC_STATE_SCISSOR; memset(&ds, 0, sizeof(ds)); ds.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO; @@ -2104,26 +2005,27 @@ ms.pSampleMask = NULL; ms.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT; + demo_prepare_vs(demo); + demo_prepare_fs(demo); + // Two stages: vs and fs - pipeline.stageCount = 2; VkPipelineShaderStageCreateInfo shaderStages[2]; memset(&shaderStages, 0, 2 * sizeof(VkPipelineShaderStageCreateInfo)); shaderStages[0].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; shaderStages[0].stage = VK_SHADER_STAGE_VERTEX_BIT; - shaderStages[0].module = demo_prepare_vs(demo); + shaderStages[0].module = demo->vert_shader_module; shaderStages[0].pName = "main"; shaderStages[1].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; shaderStages[1].stage = VK_SHADER_STAGE_FRAGMENT_BIT; - shaderStages[1].module = demo_prepare_fs(demo); + shaderStages[1].module = demo->frag_shader_module; shaderStages[1].pName = "main"; memset(&pipelineCache, 0, sizeof(pipelineCache)); pipelineCache.sType = VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO; - err = vkCreatePipelineCache(demo->device, &pipelineCache, NULL, - &demo->pipelineCache); + err = vkCreatePipelineCache(demo->device, &pipelineCache, NULL, &demo->pipelineCache); assert(!err); pipeline.pVertexInputState = &vi; @@ -2133,14 +2035,14 @@ pipeline.pMultisampleState = &ms; pipeline.pViewportState = &vp; pipeline.pDepthStencilState = &ds; + pipeline.stageCount = ARRAY_SIZE(shaderStages); pipeline.pStages = shaderStages; pipeline.renderPass = demo->render_pass; pipeline.pDynamicState = &dynamicState; pipeline.renderPass = demo->render_pass; - err = vkCreateGraphicsPipelines(demo->device, demo->pipelineCache, 1, - &pipeline, NULL, &demo->pipeline); + err = vkCreateGraphicsPipelines(demo->device, demo->pipelineCache, 1, &pipeline, NULL, &demo->pipeline); assert(!err); vkDestroyShaderModule(demo->device, demo->frag_shader_module, NULL); @@ -2149,16 +2051,16 @@ static void demo_prepare_descriptor_pool(struct demo *demo) { const VkDescriptorPoolSize type_counts[2] = { - [0] = - { - .type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, - .descriptorCount = demo->swapchainImageCount, - }, - [1] = - { - .type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, - .descriptorCount = demo->swapchainImageCount * DEMO_TEXTURE_COUNT, - }, + [0] = + { + .type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, + .descriptorCount = demo->swapchainImageCount, + }, + [1] = + { + .type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, + .descriptorCount = demo->swapchainImageCount * DEMO_TEXTURE_COUNT, + }, }; const VkDescriptorPoolCreateInfo descriptor_pool = { .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, @@ -2169,8 +2071,7 @@ }; VkResult U_ASSERT_ONLY err; - err = vkCreateDescriptorPool(demo->device, &descriptor_pool, NULL, - &demo->desc_pool); + err = vkCreateDescriptorPool(demo->device, &descriptor_pool, NULL, &demo->desc_pool); assert(!err); } @@ -2179,12 +2080,11 @@ VkWriteDescriptorSet writes[2]; VkResult U_ASSERT_ONLY err; - VkDescriptorSetAllocateInfo alloc_info = { - .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, - .pNext = NULL, - .descriptorPool = demo->desc_pool, - .descriptorSetCount = 1, - .pSetLayouts = &demo->desc_layout}; + VkDescriptorSetAllocateInfo alloc_info = {.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, + .pNext = NULL, + .descriptorPool = demo->desc_pool, + .descriptorSetCount = 1, + .pSetLayouts = &demo->desc_layout}; VkDescriptorBufferInfo buffer_info; buffer_info.offset = 0; @@ -2239,24 +2139,23 @@ for (i = 0; i < demo->swapchainImageCount; i++) { attachments[0] = demo->swapchain_image_resources[i].view; - err = vkCreateFramebuffer(demo->device, &fb_info, NULL, - &demo->swapchain_image_resources[i].framebuffer); + err = vkCreateFramebuffer(demo->device, &fb_info, NULL, &demo->swapchain_image_resources[i].framebuffer); assert(!err); } } static void demo_prepare(struct demo *demo) { VkResult U_ASSERT_ONLY err; - - const VkCommandPoolCreateInfo cmd_pool_info = { - .sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, - .pNext = NULL, - .queueFamilyIndex = demo->graphics_queue_family_index, - .flags = 0, - }; - err = vkCreateCommandPool(demo->device, &cmd_pool_info, NULL, - &demo->cmd_pool); - assert(!err); + if (demo->cmd_pool == VK_NULL_HANDLE) { + const VkCommandPoolCreateInfo cmd_pool_info = { + .sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, + .pNext = NULL, + .queueFamilyIndex = demo->graphics_queue_family_index, + .flags = 0, + }; + err = vkCreateCommandPool(demo->device, &cmd_pool_info, NULL, &demo->cmd_pool); + assert(!err); + } const VkCommandBufferAllocateInfo cmd = { .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, @@ -2277,6 +2176,12 @@ assert(!err); demo_prepare_buffers(demo); + + if (demo->is_minimized) { + demo->prepared = false; + return; + } + demo_prepare_depth(demo); demo_prepare_textures(demo); demo_prepare_cube_data_buffers(demo); @@ -2286,8 +2191,7 @@ demo_prepare_pipeline(demo); for (uint32_t i = 0; i < demo->swapchainImageCount; i++) { - err = - vkAllocateCommandBuffers(demo->device, &cmd, &demo->swapchain_image_resources[i].cmd); + err = vkAllocateCommandBuffers(demo->device, &cmd, &demo->swapchain_image_resources[i].cmd); assert(!err); } @@ -2298,8 +2202,7 @@ .queueFamilyIndex = demo->present_queue_family_index, .flags = 0, }; - err = vkCreateCommandPool(demo->device, &present_cmd_pool_info, NULL, - &demo->present_cmd_pool); + err = vkCreateCommandPool(demo->device, &present_cmd_pool_info, NULL, &demo->present_cmd_pool); assert(!err); const VkCommandBufferAllocateInfo present_cmd_info = { .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, @@ -2309,8 +2212,8 @@ .commandBufferCount = 1, }; for (uint32_t i = 0; i < demo->swapchainImageCount; i++) { - err = vkAllocateCommandBuffers( - demo->device, &present_cmd_info, &demo->swapchain_image_resources[i].graphics_to_present_cmd); + err = vkAllocateCommandBuffers(demo->device, &present_cmd_info, + &demo->swapchain_image_resources[i].graphics_to_present_cmd); assert(!err); demo_build_image_ownership_cmd(demo, i); } @@ -2356,47 +2259,49 @@ } } - for (i = 0; i < demo->swapchainImageCount; i++) { - vkDestroyFramebuffer(demo->device, demo->swapchain_image_resources[i].framebuffer, NULL); - } - vkDestroyDescriptorPool(demo->device, demo->desc_pool, NULL); - - vkDestroyPipeline(demo->device, demo->pipeline, NULL); - vkDestroyPipelineCache(demo->device, demo->pipelineCache, NULL); - vkDestroyRenderPass(demo->device, demo->render_pass, NULL); - vkDestroyPipelineLayout(demo->device, demo->pipeline_layout, NULL); - vkDestroyDescriptorSetLayout(demo->device, demo->desc_layout, NULL); - - for (i = 0; i < DEMO_TEXTURE_COUNT; i++) { - vkDestroyImageView(demo->device, demo->textures[i].view, NULL); - vkDestroyImage(demo->device, demo->textures[i].image, NULL); - vkFreeMemory(demo->device, demo->textures[i].mem, NULL); - vkDestroySampler(demo->device, demo->textures[i].sampler, NULL); - } - demo->fpDestroySwapchainKHR(demo->device, demo->swapchain, NULL); - - vkDestroyImageView(demo->device, demo->depth.view, NULL); - vkDestroyImage(demo->device, demo->depth.image, NULL); - vkFreeMemory(demo->device, demo->depth.mem, NULL); - - for (i = 0; i < demo->swapchainImageCount; i++) { - vkDestroyImageView(demo->device, demo->swapchain_image_resources[i].view, NULL); - vkFreeCommandBuffers(demo->device, demo->cmd_pool, 1, - &demo->swapchain_image_resources[i].cmd); - vkDestroyBuffer(demo->device, demo->swapchain_image_resources[i].uniform_buffer, NULL); - vkFreeMemory(demo->device, demo->swapchain_image_resources[i].uniform_memory, NULL); - } - free(demo->swapchain_image_resources); - free(demo->queue_props); - vkDestroyCommandPool(demo->device, demo->cmd_pool, NULL); + // If the window is currently minimized, demo_resize has already done some cleanup for us. + if (!demo->is_minimized) { + for (i = 0; i < demo->swapchainImageCount; i++) { + vkDestroyFramebuffer(demo->device, demo->swapchain_image_resources[i].framebuffer, NULL); + } + vkDestroyDescriptorPool(demo->device, demo->desc_pool, NULL); + + vkDestroyPipeline(demo->device, demo->pipeline, NULL); + vkDestroyPipelineCache(demo->device, demo->pipelineCache, NULL); + vkDestroyRenderPass(demo->device, demo->render_pass, NULL); + vkDestroyPipelineLayout(demo->device, demo->pipeline_layout, NULL); + vkDestroyDescriptorSetLayout(demo->device, demo->desc_layout, NULL); + + for (i = 0; i < DEMO_TEXTURE_COUNT; i++) { + vkDestroyImageView(demo->device, demo->textures[i].view, NULL); + vkDestroyImage(demo->device, demo->textures[i].image, NULL); + vkFreeMemory(demo->device, demo->textures[i].mem, NULL); + vkDestroySampler(demo->device, demo->textures[i].sampler, NULL); + } + demo->fpDestroySwapchainKHR(demo->device, demo->swapchain, NULL); + + vkDestroyImageView(demo->device, demo->depth.view, NULL); + vkDestroyImage(demo->device, demo->depth.image, NULL); + vkFreeMemory(demo->device, demo->depth.mem, NULL); + + for (i = 0; i < demo->swapchainImageCount; i++) { + vkDestroyImageView(demo->device, demo->swapchain_image_resources[i].view, NULL); + vkFreeCommandBuffers(demo->device, demo->cmd_pool, 1, &demo->swapchain_image_resources[i].cmd); + vkDestroyBuffer(demo->device, demo->swapchain_image_resources[i].uniform_buffer, NULL); + vkFreeMemory(demo->device, demo->swapchain_image_resources[i].uniform_memory, NULL); + } + free(demo->swapchain_image_resources); + free(demo->queue_props); + vkDestroyCommandPool(demo->device, demo->cmd_pool, NULL); - if (demo->separate_present_queue) { - vkDestroyCommandPool(demo->device, demo->present_cmd_pool, NULL); + if (demo->separate_present_queue) { + vkDestroyCommandPool(demo->device, demo->present_cmd_pool, NULL); + } } vkDeviceWaitIdle(demo->device); vkDestroyDevice(demo->device, NULL); if (demo->validate) { - demo->DestroyDebugReportCallback(demo->inst, demo->msg_callback, NULL); + demo->DestroyDebugUtilsMessengerEXT(demo->inst, demo->dbg_messenger, NULL); } vkDestroySurfaceKHR(demo->inst, demo->surface, NULL); @@ -2428,6 +2333,9 @@ // Don't react to resize until after first initialization. if (!demo->prepared) { + if (demo->is_minimized) { + demo_prepare(demo); + } return; } // In order to properly resize the window, we must re-create the swapchain @@ -2461,12 +2369,12 @@ for (i = 0; i < demo->swapchainImageCount; i++) { vkDestroyImageView(demo->device, demo->swapchain_image_resources[i].view, NULL); - vkFreeCommandBuffers(demo->device, demo->cmd_pool, 1, - &demo->swapchain_image_resources[i].cmd); + vkFreeCommandBuffers(demo->device, demo->cmd_pool, 1, &demo->swapchain_image_resources[i].cmd); vkDestroyBuffer(demo->device, demo->swapchain_image_resources[i].uniform_buffer, NULL); vkFreeMemory(demo->device, demo->swapchain_image_resources[i].uniform_memory, NULL); } vkDestroyCommandPool(demo->device, demo->cmd_pool, NULL); + demo->cmd_pool = VK_NULL_HANDLE; if (demo->separate_present_queue) { vkDestroyCommandPool(demo->device, demo->present_cmd_pool, NULL); } @@ -2482,8 +2390,7 @@ #if defined(VK_USE_PLATFORM_WIN32_KHR) static void demo_run(struct demo *demo) { - if (!demo->prepared) - return; + if (!demo->prepared) return; demo_draw(demo); demo->curFrame++; @@ -2495,32 +2402,32 @@ // MS-Windows event handling function: LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { - case WM_CLOSE: - PostQuitMessage(validation_error); - break; - case WM_PAINT: - // The validation callback calls MessageBox which can generate paint - // events - don't make more Vulkan calls if we got here from the - // callback - if (!in_callback) { - demo_run(&demo); - } - break; - case WM_GETMINMAXINFO: // set window's minimum size - ((MINMAXINFO*)lParam)->ptMinTrackSize = demo.minsize; - return 0; - case WM_SIZE: - // Resize the application to the new window size, except when - // it was minimized. Vulkan doesn't support images or swapchains - // with width=0 and height=0. - if (wParam != SIZE_MINIMIZED) { - demo.width = lParam & 0xffff; - demo.height = (lParam & 0xffff0000) >> 16; - demo_resize(&demo); - } - break; - default: - break; + case WM_CLOSE: + PostQuitMessage(validation_error); + break; + case WM_PAINT: + // The validation callback calls MessageBox which can generate paint + // events - don't make more Vulkan calls if we got here from the + // callback + if (!in_callback) { + demo_run(&demo); + } + break; + case WM_GETMINMAXINFO: // set window's minimum size + ((MINMAXINFO *)lParam)->ptMinTrackSize = demo.minsize; + return 0; + case WM_SIZE: + // Resize the application to the new window size, except when + // it was minimized. Vulkan doesn't support images or swapchains + // with width=0 and height=0. + if (wParam != SIZE_MINIMIZED) { + demo.width = lParam & 0xffff; + demo.height = (lParam & 0xffff0000) >> 16; + demo_resize(&demo); + } + break; + default: + break; } return (DefWindowProc(hWnd, uMsg, wParam, lParam)); } @@ -2534,7 +2441,7 @@ win_class.lpfnWndProc = WndProc; win_class.cbClsExtra = 0; win_class.cbWndExtra = 0; - win_class.hInstance = demo->connection; // hInstance + win_class.hInstance = demo->connection; // hInstance win_class.hIcon = LoadIcon(NULL, IDI_APPLICATION); win_class.hCursor = LoadCursor(NULL, IDC_ARROW); win_class.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); @@ -2552,17 +2459,17 @@ RECT wr = {0, 0, demo->width, demo->height}; AdjustWindowRect(&wr, WS_OVERLAPPEDWINDOW, FALSE); demo->window = CreateWindowEx(0, - demo->name, // class name - demo->name, // app name - WS_OVERLAPPEDWINDOW | // window style + demo->name, // class name + demo->name, // app name + WS_OVERLAPPEDWINDOW | // window style WS_VISIBLE | WS_SYSMENU, - 100, 100, // x/y coords - wr.right - wr.left, // width - wr.bottom - wr.top, // height - NULL, // handle to parent - NULL, // handle to menu - demo->connection, // hInstance - NULL); // no extra parameters + 100, 100, // x/y coords + wr.right - wr.left, // width + wr.bottom - wr.top, // height + NULL, // handle to parent + NULL, // handle to menu + demo->connection, // hInstance + NULL); // no extra parameters if (!demo->window) { // It didn't work, so try to give a useful error: printf("Cannot create a window in which to draw!\n"); @@ -2571,81 +2478,77 @@ } // Window client area size must be at least 1 pixel high, to prevent crash. demo->minsize.x = GetSystemMetrics(SM_CXMINTRACK); - demo->minsize.y = GetSystemMetrics(SM_CYMINTRACK)+1; + demo->minsize.y = GetSystemMetrics(SM_CYMINTRACK) + 1; } #elif defined(VK_USE_PLATFORM_XLIB_KHR) static void demo_create_xlib_window(struct demo *demo) { + const char *display_envar = getenv("DISPLAY"); + if (display_envar == NULL || display_envar[0] == '\0') { + printf("Environment variable DISPLAY requires a valid value.\nExiting ...\n"); + fflush(stdout); + exit(1); + } XInitThreads(); demo->display = XOpenDisplay(NULL); long visualMask = VisualScreenMask; int numberOfVisuals; - XVisualInfo vInfoTemplate={}; + XVisualInfo vInfoTemplate = {}; vInfoTemplate.screen = DefaultScreen(demo->display); - XVisualInfo *visualInfo = XGetVisualInfo(demo->display, visualMask, - &vInfoTemplate, &numberOfVisuals); + XVisualInfo *visualInfo = XGetVisualInfo(demo->display, visualMask, &vInfoTemplate, &numberOfVisuals); - Colormap colormap = XCreateColormap( - demo->display, RootWindow(demo->display, vInfoTemplate.screen), - visualInfo->visual, AllocNone); + Colormap colormap = + XCreateColormap(demo->display, RootWindow(demo->display, vInfoTemplate.screen), visualInfo->visual, AllocNone); - XSetWindowAttributes windowAttributes={}; + XSetWindowAttributes windowAttributes = {}; windowAttributes.colormap = colormap; windowAttributes.background_pixel = 0xFFFFFFFF; windowAttributes.border_pixel = 0; - windowAttributes.event_mask = - KeyPressMask | KeyReleaseMask | StructureNotifyMask | ExposureMask; + windowAttributes.event_mask = KeyPressMask | KeyReleaseMask | StructureNotifyMask | ExposureMask; - demo->xlib_window = XCreateWindow( - demo->display, RootWindow(demo->display, vInfoTemplate.screen), 0, 0, - demo->width, demo->height, 0, visualInfo->depth, InputOutput, - visualInfo->visual, - CWBackPixel | CWBorderPixel | CWEventMask | CWColormap, &windowAttributes); + demo->xlib_window = XCreateWindow(demo->display, RootWindow(demo->display, vInfoTemplate.screen), 0, 0, demo->width, + demo->height, 0, visualInfo->depth, InputOutput, visualInfo->visual, + CWBackPixel | CWBorderPixel | CWEventMask | CWColormap, &windowAttributes); XSelectInput(demo->display, demo->xlib_window, ExposureMask | KeyPressMask); XMapWindow(demo->display, demo->xlib_window); XFlush(demo->display); - demo->xlib_wm_delete_window = - XInternAtom(demo->display, "WM_DELETE_WINDOW", False); + demo->xlib_wm_delete_window = XInternAtom(demo->display, "WM_DELETE_WINDOW", False); } static void demo_handle_xlib_event(struct demo *demo, const XEvent *event) { - switch(event->type) { - case ClientMessage: - if ((Atom)event->xclient.data.l[0] == demo->xlib_wm_delete_window) - demo->quit = true; - break; - case KeyPress: - switch (event->xkey.keycode) { - case 0x9: // Escape - demo->quit = true; - break; - case 0x71: // left arrow key - demo->spin_angle -= demo->spin_increment; - break; - case 0x72: // right arrow key - demo->spin_angle += demo->spin_increment; + switch (event->type) { + case ClientMessage: + if ((Atom)event->xclient.data.l[0] == demo->xlib_wm_delete_window) demo->quit = true; + break; + case KeyPress: + switch (event->xkey.keycode) { + case 0x9: // Escape + demo->quit = true; + break; + case 0x71: // left arrow key + demo->spin_angle -= demo->spin_increment; + break; + case 0x72: // right arrow key + demo->spin_angle += demo->spin_increment; + break; + case 0x41: // space bar + demo->pause = !demo->pause; + break; + } + break; + case ConfigureNotify: + if ((demo->width != event->xconfigure.width) || (demo->height != event->xconfigure.height)) { + demo->width = event->xconfigure.width; + demo->height = event->xconfigure.height; + demo_resize(demo); + } break; - case 0x41: // space bar - demo->pause = !demo->pause; + default: break; - } - break; - case ConfigureNotify: - if ((demo->width != event->xconfigure.width) || - (demo->height != event->xconfigure.height)) { - demo->width = event->xconfigure.width; - demo->height = event->xconfigure.height; - demo_resize(demo); - } - break; - default: - break; } - } static void demo_run_xlib(struct demo *demo) { - while (!demo->quit) { XEvent event; @@ -2660,54 +2563,49 @@ demo_draw(demo); demo->curFrame++; - if (demo->frameCount != INT32_MAX && demo->curFrame == demo->frameCount) - demo->quit = true; + if (demo->frameCount != INT32_MAX && demo->curFrame == demo->frameCount) demo->quit = true; } } #elif defined(VK_USE_PLATFORM_XCB_KHR) -static void demo_handle_xcb_event(struct demo *demo, - const xcb_generic_event_t *event) { +static void demo_handle_xcb_event(struct demo *demo, const xcb_generic_event_t *event) { uint8_t event_code = event->response_type & 0x7f; switch (event_code) { - case XCB_EXPOSE: - // TODO: Resize window - break; - case XCB_CLIENT_MESSAGE: - if ((*(xcb_client_message_event_t *)event).data.data32[0] == - (*demo->atom_wm_delete_window).atom) { - demo->quit = true; - } - break; - case XCB_KEY_RELEASE: { - const xcb_key_release_event_t *key = - (const xcb_key_release_event_t *)event; - - switch (key->detail) { - case 0x9: // Escape - demo->quit = true; + case XCB_EXPOSE: + // TODO: Resize window break; - case 0x71: // left arrow key - demo->spin_angle -= demo->spin_increment; - break; - case 0x72: // right arrow key - demo->spin_angle += demo->spin_increment; - break; - case 0x41: // space bar - demo->pause = !demo->pause; + case XCB_CLIENT_MESSAGE: + if ((*(xcb_client_message_event_t *)event).data.data32[0] == (*demo->atom_wm_delete_window).atom) { + demo->quit = true; + } + break; + case XCB_KEY_RELEASE: { + const xcb_key_release_event_t *key = (const xcb_key_release_event_t *)event; + + switch (key->detail) { + case 0x9: // Escape + demo->quit = true; + break; + case 0x71: // left arrow key + demo->spin_angle -= demo->spin_increment; + break; + case 0x72: // right arrow key + demo->spin_angle += demo->spin_increment; + break; + case 0x41: // space bar + demo->pause = !demo->pause; + break; + } + } break; + case XCB_CONFIGURE_NOTIFY: { + const xcb_configure_notify_event_t *cfg = (const xcb_configure_notify_event_t *)event; + if ((demo->width != cfg->width) || (demo->height != cfg->height)) { + demo->width = cfg->width; + demo->height = cfg->height; + demo_resize(demo); + } + } break; + default: break; - } - } break; - case XCB_CONFIGURE_NOTIFY: { - const xcb_configure_notify_event_t *cfg = - (const xcb_configure_notify_event_t *)event; - if ((demo->width != cfg->width) || (demo->height != cfg->height)) { - demo->width = cfg->width; - demo->height = cfg->height; - demo_resize(demo); - } - } break; - default: - break; } } @@ -2719,8 +2617,7 @@ if (demo->pause) { event = xcb_wait_for_event(demo->connection); - } - else { + } else { event = xcb_poll_for_event(demo->connection); } while (event) { @@ -2731,8 +2628,7 @@ demo_draw(demo); demo->curFrame++; - if (demo->frameCount != INT32_MAX && demo->curFrame == demo->frameCount) - demo->quit = true; + if (demo->frameCount != INT32_MAX && demo->curFrame == demo->frameCount) demo->quit = true; } } @@ -2743,27 +2639,19 @@ value_mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK; value_list[0] = demo->screen->black_pixel; - value_list[1] = XCB_EVENT_MASK_KEY_RELEASE | XCB_EVENT_MASK_EXPOSURE | - XCB_EVENT_MASK_STRUCTURE_NOTIFY; + value_list[1] = XCB_EVENT_MASK_KEY_RELEASE | XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY; - xcb_create_window(demo->connection, XCB_COPY_FROM_PARENT, demo->xcb_window, - demo->screen->root, 0, 0, demo->width, demo->height, 0, - XCB_WINDOW_CLASS_INPUT_OUTPUT, demo->screen->root_visual, - value_mask, value_list); + xcb_create_window(demo->connection, XCB_COPY_FROM_PARENT, demo->xcb_window, demo->screen->root, 0, 0, demo->width, demo->height, + 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, demo->screen->root_visual, value_mask, value_list); /* Magic code that will send notification when window is destroyed */ - xcb_intern_atom_cookie_t cookie = - xcb_intern_atom(demo->connection, 1, 12, "WM_PROTOCOLS"); - xcb_intern_atom_reply_t *reply = - xcb_intern_atom_reply(demo->connection, cookie, 0); - - xcb_intern_atom_cookie_t cookie2 = - xcb_intern_atom(demo->connection, 0, 16, "WM_DELETE_WINDOW"); - demo->atom_wm_delete_window = - xcb_intern_atom_reply(demo->connection, cookie2, 0); + xcb_intern_atom_cookie_t cookie = xcb_intern_atom(demo->connection, 1, 12, "WM_PROTOCOLS"); + xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(demo->connection, cookie, 0); + + xcb_intern_atom_cookie_t cookie2 = xcb_intern_atom(demo->connection, 0, 16, "WM_DELETE_WINDOW"); + demo->atom_wm_delete_window = xcb_intern_atom_reply(demo->connection, cookie2, 0); - xcb_change_property(demo->connection, XCB_PROP_MODE_REPLACE, demo->xcb_window, - (*reply).atom, 4, 32, 1, + xcb_change_property(demo->connection, XCB_PROP_MODE_REPLACE, demo->xcb_window, (*reply).atom, 4, 32, 1, &(*demo->atom_wm_delete_window).atom); free(reply); @@ -2772,8 +2660,7 @@ // Force the x/y coordinates to 100,100 results are identical in consecutive // runs const uint32_t coords[] = {100, 100}; - xcb_configure_window(demo->connection, demo->xcb_window, - XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, coords); + xcb_configure_window(demo->connection, demo->xcb_window, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, coords); } // VK_USE_PLATFORM_XCB_KHR #elif defined(VK_USE_PLATFORM_WAYLAND_KHR) @@ -2790,22 +2677,16 @@ } } -static void handle_ping(void *data UNUSED, - struct wl_shell_surface *shell_surface, - uint32_t serial) { +static void handle_ping(void *data UNUSED, struct wl_shell_surface *shell_surface, uint32_t serial) { wl_shell_surface_pong(shell_surface, serial); } -static void handle_configure(void *data UNUSED, - struct wl_shell_surface *shell_surface UNUSED, - uint32_t edges UNUSED, int32_t width UNUSED, - int32_t height UNUSED) {} +static void handle_configure(void *data UNUSED, struct wl_shell_surface *shell_surface UNUSED, uint32_t edges UNUSED, + int32_t width UNUSED, int32_t height UNUSED) {} -static void handle_popup_done(void *data UNUSED, - struct wl_shell_surface *shell_surface UNUSED) {} +static void handle_popup_done(void *data UNUSED, struct wl_shell_surface *shell_surface UNUSED) {} -static const struct wl_shell_surface_listener shell_surface_listener = { - handle_ping, handle_configure, handle_popup_done}; +static const struct wl_shell_surface_listener shell_surface_listener = {handle_ping, handle_configure, handle_popup_done}; static void demo_create_window(struct demo *demo) { demo->window = wl_compositor_create_surface(demo->compositor); @@ -2821,19 +2702,25 @@ fflush(stdout); exit(1); } - wl_shell_surface_add_listener(demo->shell_surface, &shell_surface_listener, - demo); + wl_shell_surface_add_listener(demo->shell_surface, &shell_surface_listener, demo); wl_shell_surface_set_toplevel(demo->shell_surface); wl_shell_surface_set_title(demo->shell_surface, APP_SHORT_NAME); } #elif defined(VK_USE_PLATFORM_ANDROID_KHR) static void demo_run(struct demo *demo) { - if (!demo->prepared) - return; + if (!demo->prepared) return; demo_draw(demo); demo->curFrame++; } +#elif defined(VK_USE_PLATFORM_MACOS_MVK) +static void demo_run(struct demo *demo) { + demo_draw(demo); + demo->curFrame++; + if (demo->frameCount != INT32_MAX && demo->curFrame == demo->frameCount) { + demo->quit = TRUE; + } +} #elif defined(VK_USE_PLATFORM_MIR_KHR) #elif defined(VK_USE_PLATFORM_DISPLAY_KHR) static VkResult demo_create_display_surface(struct demo *demo) { @@ -2902,8 +2789,7 @@ VkDisplayKHR *supported_displays; // Disqualify planes that are bound to a different display - if ((plane_props[plane_index].currentDisplay != VK_NULL_HANDLE) && - (plane_props[plane_index].currentDisplay != display)) { + if ((plane_props[plane_index].currentDisplay != VK_NULL_HANDLE) && (plane_props[plane_index].currentDisplay != display)) { continue; } @@ -2945,8 +2831,8 @@ VkDisplayPlaneCapabilitiesKHR planeCaps; vkGetDisplayPlaneCapabilitiesKHR(demo->gpu, mode_props.displayMode, plane_index, &planeCaps); // Find a supported alpha mode - VkDisplayPlaneAlphaFlagBitsKHR alphaMode = VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR; - VkDisplayPlaneAlphaFlagBitsKHR alphaModes[4] = { + VkCompositeAlphaFlagBitsKHR alphaMode = VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR; + VkCompositeAlphaFlagBitsKHR alphaModes[4] = { VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR, VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR, VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR, @@ -2975,8 +2861,7 @@ return vkCreateDisplayPlaneSurfaceKHR(demo->inst, &create_info, NULL, &demo->surface); } -static void demo_run_display(struct demo *demo) -{ +static void demo_run_display(struct demo *demo) { while (!demo->quit) { demo_draw(demo); demo->curFrame++; @@ -2992,9 +2877,7 @@ * Return 1 (true) if all layer names specified in check_names * can be found in given layer properties. */ -static VkBool32 demo_check_layers(uint32_t check_count, char **check_names, - uint32_t layer_count, - VkLayerProperties *layers) { +static VkBool32 demo_check_layers(uint32_t check_count, char **check_names, uint32_t layer_count, VkLayerProperties *layers) { for (uint32_t i = 0; i < check_count; i++) { VkBool32 found = 0; for (uint32_t j = 0; j < layer_count; j++) { @@ -3019,37 +2902,29 @@ char **instance_validation_layers = NULL; demo->enabled_extension_count = 0; demo->enabled_layer_count = 0; + demo->is_minimized = false; + demo->cmd_pool = VK_NULL_HANDLE; - char *instance_validation_layers_alt1[] = { - "VK_LAYER_LUNARG_standard_validation" - }; + char *instance_validation_layers_alt1[] = {"VK_LAYER_LUNARG_standard_validation"}; - char *instance_validation_layers_alt2[] = { - "VK_LAYER_GOOGLE_threading", "VK_LAYER_LUNARG_parameter_validation", - "VK_LAYER_LUNARG_object_tracker", "VK_LAYER_LUNARG_core_validation", - "VK_LAYER_GOOGLE_unique_objects" - }; + char *instance_validation_layers_alt2[] = {"VK_LAYER_GOOGLE_threading", "VK_LAYER_LUNARG_parameter_validation", + "VK_LAYER_LUNARG_object_tracker", "VK_LAYER_LUNARG_core_validation", + "VK_LAYER_GOOGLE_unique_objects"}; /* Look for validation layers */ VkBool32 validation_found = 0; if (demo->validate) { - err = vkEnumerateInstanceLayerProperties(&instance_layer_count, NULL); assert(!err); instance_validation_layers = instance_validation_layers_alt1; if (instance_layer_count > 0) { - VkLayerProperties *instance_layers = - malloc(sizeof (VkLayerProperties) * instance_layer_count); - err = vkEnumerateInstanceLayerProperties(&instance_layer_count, - instance_layers); + VkLayerProperties *instance_layers = malloc(sizeof(VkLayerProperties) * instance_layer_count); + err = vkEnumerateInstanceLayerProperties(&instance_layer_count, instance_layers); assert(!err); - - validation_found = demo_check_layers( - ARRAY_SIZE(instance_validation_layers_alt1), - instance_validation_layers, instance_layer_count, - instance_layers); + validation_found = demo_check_layers(ARRAY_SIZE(instance_validation_layers_alt1), instance_validation_layers, + instance_layer_count, instance_layers); if (validation_found) { demo->enabled_layer_count = ARRAY_SIZE(instance_validation_layers_alt1); demo->enabled_layers[0] = "VK_LAYER_LUNARG_standard_validation"; @@ -3058,12 +2933,9 @@ // use alternative set of validation layers instance_validation_layers = instance_validation_layers_alt2; demo->enabled_layer_count = ARRAY_SIZE(instance_validation_layers_alt2); - validation_found = demo_check_layers( - ARRAY_SIZE(instance_validation_layers_alt2), - instance_validation_layers, instance_layer_count, - instance_layers); - validation_layer_count = - ARRAY_SIZE(instance_validation_layers_alt2); + validation_found = demo_check_layers(ARRAY_SIZE(instance_validation_layers_alt2), instance_validation_layers, + instance_layer_count, instance_layers); + validation_layer_count = ARRAY_SIZE(instance_validation_layers_alt2); for (uint32_t i = 0; i < validation_layer_count; i++) { demo->enabled_layers[i] = instance_validation_layers[i]; } @@ -3072,11 +2944,10 @@ } if (!validation_found) { - ERR_EXIT("vkEnumerateInstanceLayerProperties failed to find " - "required validation layer.\n\n" - "Please look at the Getting Started guide for additional " - "information.\n", - "vkCreateInstance Failure"); + ERR_EXIT( + "vkEnumerateInstanceLayerProperties failed to find required validation layer.\n\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); } } @@ -3085,65 +2956,48 @@ VkBool32 platformSurfaceExtFound = 0; memset(demo->extension_names, 0, sizeof(demo->extension_names)); - err = vkEnumerateInstanceExtensionProperties( - NULL, &instance_extension_count, NULL); + err = vkEnumerateInstanceExtensionProperties(NULL, &instance_extension_count, NULL); assert(!err); if (instance_extension_count > 0) { - VkExtensionProperties *instance_extensions = - malloc(sizeof(VkExtensionProperties) * instance_extension_count); - err = vkEnumerateInstanceExtensionProperties( - NULL, &instance_extension_count, instance_extensions); + VkExtensionProperties *instance_extensions = malloc(sizeof(VkExtensionProperties) * instance_extension_count); + err = vkEnumerateInstanceExtensionProperties(NULL, &instance_extension_count, instance_extensions); assert(!err); for (uint32_t i = 0; i < instance_extension_count; i++) { - if (!strcmp(VK_KHR_SURFACE_EXTENSION_NAME, - instance_extensions[i].extensionName)) { + if (!strcmp(VK_KHR_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { surfaceExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = - VK_KHR_SURFACE_EXTENSION_NAME; + demo->extension_names[demo->enabled_extension_count++] = VK_KHR_SURFACE_EXTENSION_NAME; } #if defined(VK_USE_PLATFORM_WIN32_KHR) - if (!strcmp(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, - instance_extensions[i].extensionName)) { + if (!strcmp(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { platformSurfaceExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = - VK_KHR_WIN32_SURFACE_EXTENSION_NAME; + demo->extension_names[demo->enabled_extension_count++] = VK_KHR_WIN32_SURFACE_EXTENSION_NAME; } #elif defined(VK_USE_PLATFORM_XLIB_KHR) - if (!strcmp(VK_KHR_XLIB_SURFACE_EXTENSION_NAME, - instance_extensions[i].extensionName)) { + if (!strcmp(VK_KHR_XLIB_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { platformSurfaceExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = - VK_KHR_XLIB_SURFACE_EXTENSION_NAME; + demo->extension_names[demo->enabled_extension_count++] = VK_KHR_XLIB_SURFACE_EXTENSION_NAME; } #elif defined(VK_USE_PLATFORM_XCB_KHR) - if (!strcmp(VK_KHR_XCB_SURFACE_EXTENSION_NAME, - instance_extensions[i].extensionName)) { + if (!strcmp(VK_KHR_XCB_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { platformSurfaceExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = - VK_KHR_XCB_SURFACE_EXTENSION_NAME; + demo->extension_names[demo->enabled_extension_count++] = VK_KHR_XCB_SURFACE_EXTENSION_NAME; } #elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - if (!strcmp(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, - instance_extensions[i].extensionName)) { + if (!strcmp(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { platformSurfaceExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = - VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME; + demo->extension_names[demo->enabled_extension_count++] = VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME; } #elif defined(VK_USE_PLATFORM_MIR_KHR) #elif defined(VK_USE_PLATFORM_DISPLAY_KHR) - if (!strcmp(VK_KHR_DISPLAY_EXTENSION_NAME, - instance_extensions[i].extensionName)) { + if (!strcmp(VK_KHR_DISPLAY_EXTENSION_NAME, instance_extensions[i].extensionName)) { platformSurfaceExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = - VK_KHR_DISPLAY_EXTENSION_NAME; + demo->extension_names[demo->enabled_extension_count++] = VK_KHR_DISPLAY_EXTENSION_NAME; } #elif defined(VK_USE_PLATFORM_ANDROID_KHR) - if (!strcmp(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, - instance_extensions[i].extensionName)) { + if (!strcmp(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { platformSurfaceExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = - VK_KHR_ANDROID_SURFACE_EXTENSION_NAME; + demo->extension_names[demo->enabled_extension_count++] = VK_KHR_ANDROID_SURFACE_EXTENSION_NAME; } #elif defined(VK_USE_PLATFORM_IOS_MVK) if (!strcmp(VK_MVK_IOS_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { @@ -3156,11 +3010,14 @@ demo->extension_names[demo->enabled_extension_count++] = VK_MVK_MACOS_SURFACE_EXTENSION_NAME; } #endif - if (!strcmp(VK_EXT_DEBUG_REPORT_EXTENSION_NAME, - instance_extensions[i].extensionName)) { + if (!strcmp(VK_EXT_DEBUG_REPORT_EXTENSION_NAME, instance_extensions[i].extensionName)) { if (demo->validate) { - demo->extension_names[demo->enabled_extension_count++] = - VK_EXT_DEBUG_REPORT_EXTENSION_NAME; + demo->extension_names[demo->enabled_extension_count++] = VK_EXT_DEBUG_REPORT_EXTENSION_NAME; + } + } + if (!strcmp(VK_EXT_DEBUG_UTILS_EXTENSION_NAME, instance_extensions[i].extensionName)) { + if (demo->validate) { + demo->extension_names[demo->enabled_extension_count++] = VK_EXT_DEBUG_UTILS_EXTENSION_NAME; } } assert(demo->enabled_extension_count < 64); @@ -3170,77 +3027,61 @@ } if (!surfaceExtFound) { - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find " - "the " VK_KHR_SURFACE_EXTENSION_NAME - " extension.\n\nDo you have a compatible " - "Vulkan installable client driver (ICD) installed?\nPlease " - "look at the Getting Started guide for additional " - "information.\n", + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", "vkCreateInstance Failure"); } if (!platformSurfaceExtFound) { #if defined(VK_USE_PLATFORM_WIN32_KHR) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find " - "the " VK_KHR_WIN32_SURFACE_EXTENSION_NAME - " extension.\n\nDo you have a compatible " - "Vulkan installable client driver (ICD) installed?\nPlease " - "look at the Getting Started guide for additional " - "information.\n", + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_WIN32_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", "vkCreateInstance Failure"); #elif defined(VK_USE_PLATFORM_IOS_MVK) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " - VK_MVK_IOS_SURFACE_EXTENSION_NAME" extension.\n\nDo you have a compatible " - "Vulkan installable client driver (ICD) installed?\nPlease " - "look at the Getting Started guide for additional " - "information.\n", + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_MVK_IOS_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", "vkCreateInstance Failure"); #elif defined(VK_USE_PLATFORM_MACOS_MVK) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " - VK_MVK_MACOS_SURFACE_EXTENSION_NAME" extension.\n\nDo you have a compatible " - "Vulkan installable client driver (ICD) installed?\nPlease " - "look at the Getting Started guide for additional " - "information.\n", + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_MVK_MACOS_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", "vkCreateInstance Failure"); #elif defined(VK_USE_PLATFORM_XCB_KHR) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find " - "the " VK_KHR_XCB_SURFACE_EXTENSION_NAME - " extension.\n\nDo you have a compatible " - "Vulkan installable client driver (ICD) installed?\nPlease " - "look at the Getting Started guide for additional " - "information.\n", + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_XCB_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", "vkCreateInstance Failure"); #elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find " - "the " VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME - " extension.\n\nDo you have a compatible " - "Vulkan installable client driver (ICD) installed?\nPlease " - "look at the Getting Started guide for additional " - "information.\n", + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", "vkCreateInstance Failure"); #elif defined(VK_USE_PLATFORM_MIR_KHR) #elif defined(VK_USE_PLATFORM_DISPLAY_KHR) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find " - "the " VK_KHR_DISPLAY_EXTENSION_NAME - " extension.\n\nDo you have a compatible " - "Vulkan installable client driver (ICD) installed?\nPlease " - "look at the Getting Started guide for additional " - "information.\n", + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_DISPLAY_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", "vkCreateInstance Failure"); #elif defined(VK_USE_PLATFORM_ANDROID_KHR) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find " - "the " VK_KHR_ANDROID_SURFACE_EXTENSION_NAME - " extension.\n\nDo you have a compatible " - "Vulkan installable client driver (ICD) installed?\nPlease " - "look at the Getting Started guide for additional " - "information.\n", + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_ANDROID_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", "vkCreateInstance Failure"); #elif defined(VK_USE_PLATFORM_XLIB_KHR) - ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find " - "the " VK_KHR_XLIB_SURFACE_EXTENSION_NAME - " extension.\n\nDo you have a compatible " - "Vulkan installable client driver (ICD) installed?\nPlease " - "look at the Getting Started guide for additional " - "information.\n", + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_XLIB_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", "vkCreateInstance Failure"); #endif } @@ -3268,48 +3109,46 @@ * After the instance is created, we use the instance-based * function to register the final callback. */ - VkDebugReportCallbackCreateInfoEXT dbgCreateInfoTemp; - VkValidationFlagsEXT val_flags; + VkDebugUtilsMessengerCreateInfoEXT dbg_messenger_create_info; if (demo->validate) { - dbgCreateInfoTemp.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT; - dbgCreateInfoTemp.pNext = NULL; - dbgCreateInfoTemp.pfnCallback = demo->use_break ? BreakCallback : dbgFunc; - dbgCreateInfoTemp.pUserData = demo; - dbgCreateInfoTemp.flags = - VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT; - if (demo->validate_checks_disabled) { - val_flags.sType = VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT; - val_flags.pNext = NULL; - val_flags.disabledValidationCheckCount = 1; - VkValidationCheckEXT disabled_check = VK_VALIDATION_CHECK_ALL_EXT; - val_flags.pDisabledValidationChecks = &disabled_check; - dbgCreateInfoTemp.pNext = (void*)&val_flags; - } - inst_info.pNext = &dbgCreateInfoTemp; + // VK_EXT_debug_utils style + dbg_messenger_create_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT; + dbg_messenger_create_info.pNext = NULL; + dbg_messenger_create_info.flags = 0; + dbg_messenger_create_info.messageSeverity = + VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT; + dbg_messenger_create_info.messageType = VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT | + VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT | + VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT; + dbg_messenger_create_info.pfnUserCallback = debug_messenger_callback; + dbg_messenger_create_info.pUserData = demo; + inst_info.pNext = &dbg_messenger_create_info; } uint32_t gpu_count; err = vkCreateInstance(&inst_info, NULL, &demo->inst); if (err == VK_ERROR_INCOMPATIBLE_DRIVER) { - ERR_EXIT("Cannot find a compatible Vulkan installable client driver " - "(ICD).\n\nPlease look at the Getting Started guide for " - "additional information.\n", - "vkCreateInstance Failure"); + ERR_EXIT( + "Cannot find a compatible Vulkan installable client driver (ICD).\n\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); } else if (err == VK_ERROR_EXTENSION_NOT_PRESENT) { - ERR_EXIT("Cannot find a specified extension library" - ".\nMake sure your layers path is set appropriately.\n", - "vkCreateInstance Failure"); + ERR_EXIT( + "Cannot find a specified extension library.\n" + "Make sure your layers path is set appropriately.\n", + "vkCreateInstance Failure"); } else if (err) { - ERR_EXIT("vkCreateInstance failed.\n\nDo you have a compatible Vulkan " - "installable client driver (ICD) installed?\nPlease look at " - "the Getting Started guide for additional information.\n", - "vkCreateInstance Failure"); + ERR_EXIT( + "vkCreateInstance failed.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); } /* Make initial call to query gpu_count, then second call for gpu info*/ err = vkEnumeratePhysicalDevices(demo->inst, &gpu_count, NULL); - assert(!err && gpu_count > 0); + assert(!err); if (gpu_count > 0) { VkPhysicalDevice *physical_devices = malloc(sizeof(VkPhysicalDevice) * gpu_count); @@ -3319,11 +3158,11 @@ demo->gpu = physical_devices[0]; free(physical_devices); } else { - ERR_EXIT("vkEnumeratePhysicalDevices reported zero accessible devices.\n\n" - "Do you have a compatible Vulkan installable client driver (ICD) " - "installed?\nPlease look at the Getting Started guide for " - "additional information.\n", - "vkEnumeratePhysicalDevices Failure"); + ERR_EXIT( + "vkEnumeratePhysicalDevices reported zero accessible devices.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkEnumeratePhysicalDevices Failure"); } /* Look for device extensions */ @@ -3332,23 +3171,18 @@ demo->enabled_extension_count = 0; memset(demo->extension_names, 0, sizeof(demo->extension_names)); - err = vkEnumerateDeviceExtensionProperties(demo->gpu, NULL, - &device_extension_count, NULL); + err = vkEnumerateDeviceExtensionProperties(demo->gpu, NULL, &device_extension_count, NULL); assert(!err); if (device_extension_count > 0) { - VkExtensionProperties *device_extensions = - malloc(sizeof(VkExtensionProperties) * device_extension_count); - err = vkEnumerateDeviceExtensionProperties( - demo->gpu, NULL, &device_extension_count, device_extensions); + VkExtensionProperties *device_extensions = malloc(sizeof(VkExtensionProperties) * device_extension_count); + err = vkEnumerateDeviceExtensionProperties(demo->gpu, NULL, &device_extension_count, device_extensions); assert(!err); for (uint32_t i = 0; i < device_extension_count; i++) { - if (!strcmp(VK_KHR_SWAPCHAIN_EXTENSION_NAME, - device_extensions[i].extensionName)) { + if (!strcmp(VK_KHR_SWAPCHAIN_EXTENSION_NAME, device_extensions[i].extensionName)) { swapchainExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = - VK_KHR_SWAPCHAIN_EXTENSION_NAME; + demo->extension_names[demo->enabled_extension_count++] = VK_KHR_SWAPCHAIN_EXTENSION_NAME; } assert(demo->enabled_extension_count < 64); } @@ -3360,10 +3194,8 @@ // enumerated. demo->VK_KHR_incremental_present_enabled = false; for (uint32_t i = 0; i < device_extension_count; i++) { - if (!strcmp(VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME, - device_extensions[i].extensionName)) { - demo->extension_names[demo->enabled_extension_count++] = - VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME; + if (!strcmp(VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME, device_extensions[i].extensionName)) { + demo->extension_names[demo->enabled_extension_count++] = VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME; demo->VK_KHR_incremental_present_enabled = true; DbgMsg("VK_KHR_incremental_present extension enabled\n"); } @@ -3381,10 +3213,8 @@ // enumerated. demo->VK_GOOGLE_display_timing_enabled = false; for (uint32_t i = 0; i < device_extension_count; i++) { - if (!strcmp(VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME, - device_extensions[i].extensionName)) { - demo->extension_names[demo->enabled_extension_count++] = - VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME; + if (!strcmp(VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME, device_extensions[i].extensionName)) { + demo->extension_names[demo->enabled_extension_count++] = VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME; demo->VK_GOOGLE_display_timing_enabled = true; DbgMsg("VK_GOOGLE_display_timing extension enabled\n"); } @@ -3399,75 +3229,56 @@ } if (!swapchainExtFound) { - ERR_EXIT("vkEnumerateDeviceExtensionProperties failed to find " - "the " VK_KHR_SWAPCHAIN_EXTENSION_NAME - " extension.\n\nDo you have a compatible " - "Vulkan installable client driver (ICD) installed?\nPlease " - "look at the Getting Started guide for additional " - "information.\n", + ERR_EXIT("vkEnumerateDeviceExtensionProperties failed to find the " VK_KHR_SWAPCHAIN_EXTENSION_NAME + " extension.\n\nDo you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", "vkCreateInstance Failure"); } if (demo->validate) { - demo->CreateDebugReportCallback = - (PFN_vkCreateDebugReportCallbackEXT)vkGetInstanceProcAddr( - demo->inst, "vkCreateDebugReportCallbackEXT"); - demo->DestroyDebugReportCallback = - (PFN_vkDestroyDebugReportCallbackEXT)vkGetInstanceProcAddr( - demo->inst, "vkDestroyDebugReportCallbackEXT"); - if (!demo->CreateDebugReportCallback) { - ERR_EXIT( - "GetProcAddr: Unable to find vkCreateDebugReportCallbackEXT\n", - "vkGetProcAddr Failure"); - } - if (!demo->DestroyDebugReportCallback) { - ERR_EXIT( - "GetProcAddr: Unable to find vkDestroyDebugReportCallbackEXT\n", - "vkGetProcAddr Failure"); + // Setup VK_EXT_debug_utils function pointers always (we use them for + // debug labels and names). + demo->CreateDebugUtilsMessengerEXT = + (PFN_vkCreateDebugUtilsMessengerEXT)vkGetInstanceProcAddr(demo->inst, "vkCreateDebugUtilsMessengerEXT"); + demo->DestroyDebugUtilsMessengerEXT = + (PFN_vkDestroyDebugUtilsMessengerEXT)vkGetInstanceProcAddr(demo->inst, "vkDestroyDebugUtilsMessengerEXT"); + demo->SubmitDebugUtilsMessageEXT = + (PFN_vkSubmitDebugUtilsMessageEXT)vkGetInstanceProcAddr(demo->inst, "vkSubmitDebugUtilsMessageEXT"); + demo->CmdBeginDebugUtilsLabelEXT = + (PFN_vkCmdBeginDebugUtilsLabelEXT)vkGetInstanceProcAddr(demo->inst, "vkCmdBeginDebugUtilsLabelEXT"); + demo->CmdEndDebugUtilsLabelEXT = + (PFN_vkCmdEndDebugUtilsLabelEXT)vkGetInstanceProcAddr(demo->inst, "vkCmdEndDebugUtilsLabelEXT"); + demo->CmdInsertDebugUtilsLabelEXT = + (PFN_vkCmdInsertDebugUtilsLabelEXT)vkGetInstanceProcAddr(demo->inst, "vkCmdInsertDebugUtilsLabelEXT"); + demo->SetDebugUtilsObjectNameEXT = + (PFN_vkSetDebugUtilsObjectNameEXT)vkGetInstanceProcAddr(demo->inst, "vkSetDebugUtilsObjectNameEXT"); + if (NULL == demo->CreateDebugUtilsMessengerEXT || NULL == demo->DestroyDebugUtilsMessengerEXT || + NULL == demo->SubmitDebugUtilsMessageEXT || NULL == demo->CmdBeginDebugUtilsLabelEXT || + NULL == demo->CmdEndDebugUtilsLabelEXT || NULL == demo->CmdInsertDebugUtilsLabelEXT || + NULL == demo->SetDebugUtilsObjectNameEXT) { + ERR_EXIT("GetProcAddr: Failed to init VK_EXT_debug_utils\n", "GetProcAddr: Failure"); } - demo->DebugReportMessage = - (PFN_vkDebugReportMessageEXT)vkGetInstanceProcAddr( - demo->inst, "vkDebugReportMessageEXT"); - if (!demo->DebugReportMessage) { - ERR_EXIT("GetProcAddr: Unable to find vkDebugReportMessageEXT\n", - "vkGetProcAddr Failure"); - } - - VkDebugReportCallbackCreateInfoEXT dbgCreateInfo; - PFN_vkDebugReportCallbackEXT callback; - callback = demo->use_break ? BreakCallback : dbgFunc; - dbgCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT; - dbgCreateInfo.pNext = NULL; - dbgCreateInfo.pfnCallback = callback; - dbgCreateInfo.pUserData = demo; - dbgCreateInfo.flags = - VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT; - err = demo->CreateDebugReportCallback(demo->inst, &dbgCreateInfo, NULL, - &demo->msg_callback); + + err = demo->CreateDebugUtilsMessengerEXT(demo->inst, &dbg_messenger_create_info, NULL, &demo->dbg_messenger); switch (err) { - case VK_SUCCESS: - break; - case VK_ERROR_OUT_OF_HOST_MEMORY: - ERR_EXIT("CreateDebugReportCallback: out of host memory\n", - "CreateDebugReportCallback Failure"); - break; - default: - ERR_EXIT("CreateDebugReportCallback: unknown failure\n", - "CreateDebugReportCallback Failure"); - break; + case VK_SUCCESS: + break; + case VK_ERROR_OUT_OF_HOST_MEMORY: + ERR_EXIT("CreateDebugUtilsMessengerEXT: out of host memory\n", "CreateDebugUtilsMessengerEXT Failure"); + break; + default: + ERR_EXIT("CreateDebugUtilsMessengerEXT: unknown failure\n", "CreateDebugUtilsMessengerEXT Failure"); + break; } } vkGetPhysicalDeviceProperties(demo->gpu, &demo->gpu_props); /* Call with NULL data to get count */ - vkGetPhysicalDeviceQueueFamilyProperties(demo->gpu, - &demo->queue_family_count, NULL); + vkGetPhysicalDeviceQueueFamilyProperties(demo->gpu, &demo->queue_family_count, NULL); assert(demo->queue_family_count >= 1); - demo->queue_props = (VkQueueFamilyProperties *)malloc( - demo->queue_family_count * sizeof(VkQueueFamilyProperties)); - vkGetPhysicalDeviceQueueFamilyProperties( - demo->gpu, &demo->queue_family_count, demo->queue_props); + demo->queue_props = (VkQueueFamilyProperties *)malloc(demo->queue_family_count * sizeof(VkQueueFamilyProperties)); + vkGetPhysicalDeviceQueueFamilyProperties(demo->gpu, &demo->queue_family_count, demo->queue_props); // Query fine-grained feature support for this device. // If app has specific feature requirements it should check supported @@ -3502,8 +3313,7 @@ .ppEnabledLayerNames = NULL, .enabledExtensionCount = demo->enabled_extension_count, .ppEnabledExtensionNames = (const char *const *)demo->extension_names, - .pEnabledFeatures = - NULL, // If specific features are required, pass them in here + .pEnabledFeatures = NULL, // If specific features are required, pass them in here }; if (demo->separate_present_queue) { queues[1].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO; @@ -3530,8 +3340,7 @@ createInfo.hinstance = demo->connection; createInfo.hwnd = demo->window; - err = - vkCreateWin32SurfaceKHR(demo->inst, &createInfo, NULL, &demo->surface); + err = vkCreateWin32SurfaceKHR(demo->inst, &createInfo, NULL, &demo->surface); #elif defined(VK_USE_PLATFORM_WAYLAND_KHR) VkWaylandSurfaceCreateInfoKHR createInfo; createInfo.sType = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR; @@ -3540,15 +3349,14 @@ createInfo.display = demo->display; createInfo.surface = demo->window; - err = vkCreateWaylandSurfaceKHR(demo->inst, &createInfo, NULL, - &demo->surface); + err = vkCreateWaylandSurfaceKHR(demo->inst, &createInfo, NULL, &demo->surface); #elif defined(VK_USE_PLATFORM_MIR_KHR) #elif defined(VK_USE_PLATFORM_ANDROID_KHR) VkAndroidSurfaceCreateInfoKHR createInfo; createInfo.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR; createInfo.pNext = NULL; createInfo.flags = 0; - createInfo.window = (ANativeWindow*)(demo->window); + createInfo.window = (struct ANativeWindow *)(demo->window); err = vkCreateAndroidSurfaceKHR(demo->inst, &createInfo, NULL, &demo->surface); #elif defined(VK_USE_PLATFORM_XLIB_KHR) @@ -3559,8 +3367,7 @@ createInfo.dpy = demo->display; createInfo.window = demo->xlib_window; - err = vkCreateXlibSurfaceKHR(demo->inst, &createInfo, NULL, - &demo->surface); + err = vkCreateXlibSurfaceKHR(demo->inst, &createInfo, NULL, &demo->surface); #elif defined(VK_USE_PLATFORM_XCB_KHR) VkXcbSurfaceCreateInfoKHR createInfo; createInfo.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR; @@ -3592,11 +3399,9 @@ assert(!err); // Iterate over each queue to learn whether it supports presenting: - VkBool32 *supportsPresent = - (VkBool32 *)malloc(demo->queue_family_count * sizeof(VkBool32)); + VkBool32 *supportsPresent = (VkBool32 *)malloc(demo->queue_family_count * sizeof(VkBool32)); for (uint32_t i = 0; i < demo->queue_family_count; i++) { - demo->fpGetPhysicalDeviceSurfaceSupportKHR(demo->gpu, i, demo->surface, - &supportsPresent[i]); + demo->fpGetPhysicalDeviceSurfaceSupportKHR(demo->gpu, i, demo->surface, &supportsPresent[i]); } // Search for a graphics and a present queue in the array of queue @@ -3629,16 +3434,13 @@ } // Generate error if could not find both a graphics and a present queue - if (graphicsQueueFamilyIndex == UINT32_MAX || - presentQueueFamilyIndex == UINT32_MAX) { - ERR_EXIT("Could not find both graphics and present queues\n", - "Swapchain Initialization Failure"); + if (graphicsQueueFamilyIndex == UINT32_MAX || presentQueueFamilyIndex == UINT32_MAX) { + ERR_EXIT("Could not find both graphics and present queues\n", "Swapchain Initialization Failure"); } demo->graphics_queue_family_index = graphicsQueueFamilyIndex; demo->present_queue_family_index = presentQueueFamilyIndex; - demo->separate_present_queue = - (demo->graphics_queue_family_index != demo->present_queue_family_index); + demo->separate_present_queue = (demo->graphics_queue_family_index != demo->present_queue_family_index); free(supportsPresent); demo_create_device(demo); @@ -3653,25 +3455,20 @@ GET_DEVICE_PROC_ADDR(demo->device, GetPastPresentationTimingGOOGLE); } - vkGetDeviceQueue(demo->device, demo->graphics_queue_family_index, 0, - &demo->graphics_queue); + vkGetDeviceQueue(demo->device, demo->graphics_queue_family_index, 0, &demo->graphics_queue); if (!demo->separate_present_queue) { demo->present_queue = demo->graphics_queue; } else { - vkGetDeviceQueue(demo->device, demo->present_queue_family_index, 0, - &demo->present_queue); + vkGetDeviceQueue(demo->device, demo->present_queue_family_index, 0, &demo->present_queue); } // Get the list of VkFormat's that are supported: uint32_t formatCount; - err = demo->fpGetPhysicalDeviceSurfaceFormatsKHR(demo->gpu, demo->surface, - &formatCount, NULL); + err = demo->fpGetPhysicalDeviceSurfaceFormatsKHR(demo->gpu, demo->surface, &formatCount, NULL); assert(!err); - VkSurfaceFormatKHR *surfFormats = - (VkSurfaceFormatKHR *)malloc(formatCount * sizeof(VkSurfaceFormatKHR)); - err = demo->fpGetPhysicalDeviceSurfaceFormatsKHR(demo->gpu, demo->surface, - &formatCount, surfFormats); + VkSurfaceFormatKHR *surfFormats = (VkSurfaceFormatKHR *)malloc(formatCount * sizeof(VkSurfaceFormatKHR)); + err = demo->fpGetPhysicalDeviceSurfaceFormatsKHR(demo->gpu, demo->surface, &formatCount, surfFormats); assert(!err); // If the format list includes just one entry of VK_FORMAT_UNDEFINED, // the surface has no preferred format. Otherwise, at least one @@ -3698,25 +3495,19 @@ // Create fences that we can use to throttle if we get too far // ahead of the image presents VkFenceCreateInfo fence_ci = { - .sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, - .pNext = NULL, - .flags = VK_FENCE_CREATE_SIGNALED_BIT - }; + .sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, .pNext = NULL, .flags = VK_FENCE_CREATE_SIGNALED_BIT}; for (uint32_t i = 0; i < FRAME_LAG; i++) { err = vkCreateFence(demo->device, &fence_ci, NULL, &demo->fences[i]); assert(!err); - err = vkCreateSemaphore(demo->device, &semaphoreCreateInfo, NULL, - &demo->image_acquired_semaphores[i]); + err = vkCreateSemaphore(demo->device, &semaphoreCreateInfo, NULL, &demo->image_acquired_semaphores[i]); assert(!err); - err = vkCreateSemaphore(demo->device, &semaphoreCreateInfo, NULL, - &demo->draw_complete_semaphores[i]); + err = vkCreateSemaphore(demo->device, &semaphoreCreateInfo, NULL, &demo->draw_complete_semaphores[i]); assert(!err); if (demo->separate_present_queue) { - err = vkCreateSemaphore(demo->device, &semaphoreCreateInfo, NULL, - &demo->image_ownership_semaphores[i]); + err = vkCreateSemaphore(demo->device, &semaphoreCreateInfo, NULL, &demo->image_ownership_semaphores[i]); assert(!err); } } @@ -3820,12 +3611,9 @@ } } -static void registry_handle_global_remove(void *data UNUSED, - struct wl_registry *registry UNUSED, - uint32_t name UNUSED) {} +static void registry_handle_global_remove(void *data UNUSED, struct wl_registry *registry UNUSED, uint32_t name UNUSED) {} -static const struct wl_registry_listener registry_listener = { - registry_handle_global, registry_handle_global_remove}; +static const struct wl_registry_listener registry_listener = {registry_handle_global, registry_handle_global_remove}; #elif defined(VK_USE_PLATFORM_MIR_KHR) #endif @@ -3835,26 +3623,30 @@ xcb_screen_iterator_t iter; int scr; + const char *display_envar = getenv("DISPLAY"); + if (display_envar == NULL || display_envar[0] == '\0') { + printf("Environment variable DISPLAY requires a valid value.\nExiting ...\n"); + fflush(stdout); + exit(1); + } + demo->connection = xcb_connect(NULL, &scr); if (xcb_connection_has_error(demo->connection) > 0) { - printf("Cannot find a compatible Vulkan installable client driver " - "(ICD).\nExiting ...\n"); + printf("Cannot find a compatible Vulkan installable client driver (ICD).\nExiting ...\n"); fflush(stdout); exit(1); } setup = xcb_get_setup(demo->connection); iter = xcb_setup_roots_iterator(setup); - while (scr-- > 0) - xcb_screen_next(&iter); + while (scr-- > 0) xcb_screen_next(&iter); demo->screen = iter.data; #elif defined(VK_USE_PLATFORM_WAYLAND_KHR) demo->display = wl_display_connect(NULL); if (demo->display == NULL) { - printf("Cannot find a compatible Vulkan installable client driver " - "(ICD).\nExiting ...\n"); + printf("Cannot find a compatible Vulkan installable client driver (ICD).\nExiting ...\n"); fflush(stdout); exit(1); } @@ -3880,9 +3672,8 @@ demo->use_staging_buffer = true; continue; } - if ((strcmp(argv[i], "--present_mode") == 0) && - (i < argc - 1)) { - demo->presentMode = atoi(argv[i+1]); + if ((strcmp(argv[i], "--present_mode") == 0) && (i < argc - 1)) { + demo->presentMode = atoi(argv[i + 1]); i++; continue; } @@ -3903,9 +3694,8 @@ fprintf(stderr, "--xlib is deprecated and no longer does anything"); continue; } - if (strcmp(argv[i], "--c") == 0 && demo->frameCount == INT32_MAX && - i < argc - 1 && sscanf(argv[i + 1], "%d", &demo->frameCount) == 1 && - demo->frameCount >= 0) { + if (strcmp(argv[i], "--c") == 0 && demo->frameCount == INT32_MAX && i < argc - 1 && + sscanf(argv[i + 1], "%d", &demo->frameCount) == 1 && demo->frameCount >= 0) { i++; continue; } @@ -3926,16 +3716,13 @@ ERR_EXIT("Usage: cube [--validate]\n", "Usage"); #else fprintf(stderr, - "Usage:\n %s [--use_staging] [--validate] [--validate-checks-disabled]\n" - " [--break] [--c ] [--suppress_popups]\n" - " [--incremental_present] [--display_timing]\n" - " [--present_mode {0,1,2,3}]\n" - "\n" - "Options for --present_mode:\n" - " %d: VK_PRESENT_MODE_IMMEDIATE_KHR\n" - " %d: VK_PRESENT_MODE_MAILBOX_KHR\n" - " %d: VK_PRESENT_MODE_FIFO_KHR (default)\n" - " %d: VK_PRESENT_MODE_FIFO_RELAXED_KHR\n", + "Usage:\n %s\t[--use_staging] [--validate] [--validate-checks-disabled] [--break]\n" + "\t[--c ] [--suppress_popups] [--incremental_present] [--display_timing]\n" + "\t[--present_mode ]\n" + "\t \tVK_PRESENT_MODE_IMMEDIATE_KHR = %d\n" + "\t\t\t\tVK_PRESENT_MODE_MAILBOX_KHR = %d\n" + "\t\t\t\tVK_PRESENT_MODE_FIFO_KHR = %d\n" + "\t\t\t\tVK_PRESENT_MODE_FIFO_RELAXED_KHR = %d\n", APP_SHORT_NAME, VK_PRESENT_MODE_IMMEDIATE_KHR, VK_PRESENT_MODE_MAILBOX_KHR, VK_PRESENT_MODE_FIFO_KHR, VK_PRESENT_MODE_FIFO_RELAXED_KHR); fflush(stderr); @@ -3954,22 +3741,20 @@ demo->spin_increment = 0.2f; demo->pause = false; - mat4x4_perspective(demo->projection_matrix, (float)degreesToRadians(45.0f), - 1.0f, 0.1f, 100.0f); + mat4x4_perspective(demo->projection_matrix, (float)degreesToRadians(45.0f), 1.0f, 0.1f, 100.0f); mat4x4_look_at(demo->view_matrix, eye, origin, up); mat4x4_identity(demo->model_matrix); - demo->projection_matrix[1][1]*=-1; //Flip projection matrix from GL to Vulkan orientation. + demo->projection_matrix[1][1] *= -1; // Flip projection matrix from GL to Vulkan orientation. } #if defined(VK_USE_PLATFORM_WIN32_KHR) // Include header required for parsing the command line options. #include -int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCmdLine, - int nCmdShow) { - MSG msg; // message - bool done; // flag saying when app is complete +int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCmdLine, int nCmdShow) { + MSG msg; // message + bool done; // flag saying when app is complete int argc; char **argv; @@ -3998,8 +3783,7 @@ argv[iii] = (char *)malloc(sizeof(char) * (wideCharLen + 1)); if (argv[iii] != NULL) { - wcstombs_s(&numConverted, argv[iii], wideCharLen + 1, - commandLineArgs[iii], wideCharLen + 1); + wcstombs_s(&numConverted, argv[iii], wideCharLen + 1, commandLineArgs[iii], wideCharLen + 1); } } } @@ -4026,14 +3810,14 @@ demo_prepare(&demo); - done = false; // initialize loop condition variable + done = false; // initialize loop condition variable // main message loop while (!done) { PeekMessage(&msg, NULL, 0, 0, PM_REMOVE); - if (msg.message == WM_QUIT) // check for a quit message + if (msg.message == WM_QUIT) // check for a quit message { - done = true; // if found, quit app + done = true; // if found, quit app } else { /* Translate and dispatch to event queue*/ TranslateMessage(&msg); @@ -4048,25 +3832,15 @@ } #elif defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_MACOS_MVK) -static void demo_main(struct demo *demo, void* view) { - const char* argv[] = { "CubeSample" }; - int argc = sizeof(argv) / sizeof(char*); +static void demo_main(struct demo *demo, void *view, int argc, const char *argv[]) { - demo_init(demo, argc, (char**)argv); + demo_init(demo, argc, (char **)argv); demo->window = view; demo_init_vk_swapchain(demo); demo_prepare(demo); demo->spin_angle = 0.4f; } -static void demo_update_and_draw(struct demo *demo) { - // Wait for work to finish before updating MVP. - vkDeviceWaitIdle(demo->device); - demo_update_data_buffer(demo); - - demo_draw(demo); -} - #elif defined(VK_USE_PLATFORM_ANDROID_KHR) #include #include @@ -4076,12 +3850,10 @@ static bool active = false; struct demo demo; -static int32_t processInput(struct android_app* app, AInputEvent* event) { - return 0; -} +static int32_t processInput(struct android_app *app, AInputEvent *event) { return 0; } -static void processCommand(struct android_app* app, int32_t cmd) { - switch(cmd) { +static void processCommand(struct android_app *app, int32_t cmd) { + switch (cmd) { case APP_CMD_INIT_WINDOW: { if (app->window) { // We're getting a new window. If the app is starting up, we @@ -4102,21 +3874,19 @@ // Use the following key to send arguments, i.e. // --es args "--validate" const char key[] = "args"; - char* appTag = (char*) APP_SHORT_NAME; + char *appTag = (char *)APP_SHORT_NAME; int argc = 0; - char** argv = get_args(app, key, appTag, &argc); + char **argv = get_args(app, key, appTag, &argc); __android_log_print(ANDROID_LOG_INFO, appTag, "argc = %i", argc); - for (int i = 0; i < argc; i++) - __android_log_print(ANDROID_LOG_INFO, appTag, "argv[%i] = %s", i, argv[i]); + for (int i = 0; i < argc; i++) __android_log_print(ANDROID_LOG_INFO, appTag, "argv[%i] = %s", i, argv[i]); demo_init(&demo, argc, argv); // Free the argv malloc'd by get_args - for (int i = 0; i < argc; i++) - free(argv[i]); + for (int i = 0; i < argc; i++) free(argv[i]); - demo.window = (void*)app->window; + demo.window = (void *)app->window; demo_init_vk_swapchain(&demo); demo_prepare(&demo); initialized = true; @@ -4134,12 +3904,10 @@ } } -void android_main(struct android_app *app) -{ +void android_main(struct android_app *app) { #ifdef ANDROID int vulkanSupport = InitVulkan(); - if (vulkanSupport == 0) - return; + if (vulkanSupport == 0) return; #endif demo.prepared = false; @@ -4147,10 +3915,10 @@ app->onAppCmd = processCommand; app->onInputEvent = processInput; - while(1) { + while (1) { int events; - struct android_poll_source* source; - while (ALooper_pollAll(active ? 0 : -1, NULL, &events, (void**)&source) >= 0) { + struct android_poll_source *source; + while (ALooper_pollAll(active ? 0 : -1, NULL, &events, (void **)&source) >= 0) { if (source) { source->process(app, source); } @@ -4164,7 +3932,6 @@ demo_run(&demo); } } - } #else int main(int argc, char **argv) { diff -Nru vulkan-1.0.65.2+dfsg1/demos/cube.cpp vulkan-1.1.73+dfsg/demos/cube.cpp --- vulkan-1.0.65.2+dfsg1/demos/cube.cpp 2018-01-10 14:15:30.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/cube.cpp 2018-04-27 11:24:19.000000000 +0000 @@ -1,22 +1,22 @@ /* -* 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. -* -* Author: Jeremy Hayes -*/ + * 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. + * + * Author: Jeremy Hayes + */ #if defined(VK_USE_PLATFORM_XLIB_KHR) || defined(VK_USE_PLATFORM_XCB_KHR) #include @@ -25,6 +25,7 @@ #endif #include +#include #include #include #include @@ -231,14 +232,14 @@ void prepare_descriptor_pool(); void prepare_descriptor_set(); void prepare_framebuffers(); + vk::ShaderModule prepare_shader_module(const uint32_t *, size_t); + vk::ShaderModule prepare_vs(); vk::ShaderModule prepare_fs(); void prepare_pipeline(); void prepare_render_pass(); - vk::ShaderModule prepare_shader_module(const void *, size_t); void prepare_texture_image(const char *, texture_object *, vk::ImageTiling, vk::ImageUsageFlags, vk::MemoryPropertyFlags); void prepare_textures(); - vk::ShaderModule prepare_vs(); - char *read_spv(const char *, size_t *); + void resize(); void set_image_layout(vk::Image, vk::ImageAspectFlags, vk::ImageLayout, vk::ImageLayout, vk::AccessFlags, vk::PipelineStageFlags, vk::PipelineStageFlags); @@ -260,6 +261,8 @@ #elif defined(VK_USE_PLATFORM_WAYLAND_KHR) void run(); void create_window(); +#elif defined(VK_USE_PLATFORM_MACOS_MVK) + void run(); #elif defined(VK_USE_PLATFORM_MIR_KHR) #elif defined(VK_USE_PLATFORM_DISPLAY_KHR) vk::Result create_display_surface(); @@ -291,6 +294,8 @@ wl_pointer *pointer; wl_keyboard *keyboard; #elif defined(VK_USE_PLATFORM_MIR_KHR) +#elif (defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_MACOS_MVK)) + void *window; #endif vk::SurfaceKHR surface; @@ -551,2065 +556,2091 @@ current_buffer{0}, queue_family_count{0} { #if defined(VK_USE_PLATFORM_WIN32_KHR) - memset(name, '\0', APP_NAME_STR_LEN); + memset(name, '\0', APP_NAME_STR_LEN); #endif - memset(projection_matrix, 0, sizeof(projection_matrix)); - memset(view_matrix, 0, sizeof(view_matrix)); - memset(model_matrix, 0, sizeof(model_matrix)); - } - - void Demo::build_image_ownership_cmd(uint32_t const &i) { - auto const cmd_buf_info = vk::CommandBufferBeginInfo().setFlags(vk::CommandBufferUsageFlagBits::eSimultaneousUse); - auto result = swapchain_image_resources[i].graphics_to_present_cmd.begin(&cmd_buf_info); - VERIFY(result == vk::Result::eSuccess); - - auto const image_ownership_barrier = - vk::ImageMemoryBarrier() - .setSrcAccessMask(vk::AccessFlags()) - .setDstAccessMask(vk::AccessFlagBits::eColorAttachmentWrite) - .setOldLayout(vk::ImageLayout::ePresentSrcKHR) - .setNewLayout(vk::ImageLayout::ePresentSrcKHR) - .setSrcQueueFamilyIndex(graphics_queue_family_index) - .setDstQueueFamilyIndex(present_queue_family_index) - .setImage(swapchain_image_resources[i].image) - .setSubresourceRange(vk::ImageSubresourceRange(vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1)); + memset(projection_matrix, 0, sizeof(projection_matrix)); + memset(view_matrix, 0, sizeof(view_matrix)); + memset(model_matrix, 0, sizeof(model_matrix)); +} - swapchain_image_resources[i].graphics_to_present_cmd.pipelineBarrier( - vk::PipelineStageFlagBits::eColorAttachmentOutput, vk::PipelineStageFlagBits::eColorAttachmentOutput, - vk::DependencyFlagBits(), 0, nullptr, 0, nullptr, 1, &image_ownership_barrier); +void Demo::build_image_ownership_cmd(uint32_t const &i) { + auto const cmd_buf_info = vk::CommandBufferBeginInfo().setFlags(vk::CommandBufferUsageFlagBits::eSimultaneousUse); + auto result = swapchain_image_resources[i].graphics_to_present_cmd.begin(&cmd_buf_info); + VERIFY(result == vk::Result::eSuccess); + + auto const image_ownership_barrier = + vk::ImageMemoryBarrier() + .setSrcAccessMask(vk::AccessFlags()) + .setDstAccessMask(vk::AccessFlagBits::eColorAttachmentWrite) + .setOldLayout(vk::ImageLayout::ePresentSrcKHR) + .setNewLayout(vk::ImageLayout::ePresentSrcKHR) + .setSrcQueueFamilyIndex(graphics_queue_family_index) + .setDstQueueFamilyIndex(present_queue_family_index) + .setImage(swapchain_image_resources[i].image) + .setSubresourceRange(vk::ImageSubresourceRange(vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1)); + + swapchain_image_resources[i].graphics_to_present_cmd.pipelineBarrier( + vk::PipelineStageFlagBits::eColorAttachmentOutput, vk::PipelineStageFlagBits::eColorAttachmentOutput, + vk::DependencyFlagBits(), 0, nullptr, 0, nullptr, 1, &image_ownership_barrier); - result = swapchain_image_resources[i].graphics_to_present_cmd.end(); - VERIFY(result == vk::Result::eSuccess); - } + result = swapchain_image_resources[i].graphics_to_present_cmd.end(); + VERIFY(result == vk::Result::eSuccess); +} - vk::Bool32 Demo::check_layers(uint32_t check_count, char const *const *const check_names, uint32_t layer_count, - vk::LayerProperties *layers) { - for (uint32_t i = 0; i < check_count; i++) { - vk::Bool32 found = VK_FALSE; - for (uint32_t j = 0; j < layer_count; j++) { - if (!strcmp(check_names[i], layers[j].layerName)) { - found = VK_TRUE; - break; - } - } - if (!found) { - fprintf(stderr, "Cannot find layer: %s\n", check_names[i]); - return 0; - } - } - return VK_TRUE; - } - - void Demo::cleanup() { - prepared = false; - device.waitIdle(); - - // Wait for fences from present operations - for (uint32_t i = 0; i < FRAME_LAG; i++) { - device.waitForFences(1, &fences[i], VK_TRUE, UINT64_MAX); - device.destroyFence(fences[i], nullptr); - device.destroySemaphore(image_acquired_semaphores[i], nullptr); - device.destroySemaphore(draw_complete_semaphores[i], nullptr); - if (separate_present_queue) { - device.destroySemaphore(image_ownership_semaphores[i], nullptr); +vk::Bool32 Demo::check_layers(uint32_t check_count, char const *const *const check_names, uint32_t layer_count, + vk::LayerProperties *layers) { + for (uint32_t i = 0; i < check_count; i++) { + vk::Bool32 found = VK_FALSE; + for (uint32_t j = 0; j < layer_count; j++) { + if (!strcmp(check_names[i], layers[j].layerName)) { + found = VK_TRUE; + break; } } - - for (uint32_t i = 0; i < swapchainImageCount; i++) { - device.destroyFramebuffer(swapchain_image_resources[i].framebuffer, nullptr); - } - device.destroyDescriptorPool(desc_pool, nullptr); - - device.destroyPipeline(pipeline, nullptr); - device.destroyPipelineCache(pipelineCache, nullptr); - device.destroyRenderPass(render_pass, nullptr); - device.destroyPipelineLayout(pipeline_layout, nullptr); - device.destroyDescriptorSetLayout(desc_layout, nullptr); - - for (uint32_t i = 0; i < texture_count; i++) { - device.destroyImageView(textures[i].view, nullptr); - device.destroyImage(textures[i].image, nullptr); - device.freeMemory(textures[i].mem, nullptr); - device.destroySampler(textures[i].sampler, nullptr); - } - device.destroySwapchainKHR(swapchain, nullptr); - - device.destroyImageView(depth.view, nullptr); - device.destroyImage(depth.image, nullptr); - device.freeMemory(depth.mem, nullptr); - - for (uint32_t i = 0; i < swapchainImageCount; i++) { - device.destroyImageView(swapchain_image_resources[i].view, nullptr); - device.freeCommandBuffers(cmd_pool, 1, &swapchain_image_resources[i].cmd); - device.destroyBuffer(swapchain_image_resources[i].uniform_buffer, nullptr); - device.freeMemory(swapchain_image_resources[i].uniform_memory, nullptr); + if (!found) { + fprintf(stderr, "Cannot find layer: %s\n", check_names[i]); + return 0; } + } + return VK_TRUE; +} - device.destroyCommandPool(cmd_pool, nullptr); - +void Demo::cleanup() { + prepared = false; + device.waitIdle(); + + // Wait for fences from present operations + for (uint32_t i = 0; i < FRAME_LAG; i++) { + device.waitForFences(1, &fences[i], VK_TRUE, UINT64_MAX); + device.destroyFence(fences[i], nullptr); + device.destroySemaphore(image_acquired_semaphores[i], nullptr); + device.destroySemaphore(draw_complete_semaphores[i], nullptr); if (separate_present_queue) { - device.destroyCommandPool(present_cmd_pool, nullptr); + device.destroySemaphore(image_ownership_semaphores[i], nullptr); } - device.waitIdle(); - device.destroy(nullptr); - inst.destroySurfaceKHR(surface, nullptr); - -#if defined(VK_USE_PLATFORM_XLIB_KHR) - XDestroyWindow(display, xlib_window); - XCloseDisplay(display); -#elif defined(VK_USE_PLATFORM_XCB_KHR) - xcb_destroy_window(connection, xcb_window); - xcb_disconnect(connection); - free(atom_wm_delete_window); -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - wl_keyboard_destroy(keyboard); - wl_pointer_destroy(pointer); - wl_seat_destroy(seat); - wl_shell_surface_destroy(shell_surface); - wl_surface_destroy(window); - wl_shell_destroy(shell); - wl_compositor_destroy(compositor); - wl_registry_destroy(registry); - wl_display_disconnect(display); -#elif defined(VK_USE_PLATFORM_MIR_KHR) -#endif + } - inst.destroy(nullptr); + for (uint32_t i = 0; i < swapchainImageCount; i++) { + device.destroyFramebuffer(swapchain_image_resources[i].framebuffer, nullptr); } + device.destroyDescriptorPool(desc_pool, nullptr); - void Demo::create_device() { - float const priorities[1] = {0.0}; + device.destroyPipeline(pipeline, nullptr); + device.destroyPipelineCache(pipelineCache, nullptr); + device.destroyRenderPass(render_pass, nullptr); + device.destroyPipelineLayout(pipeline_layout, nullptr); + device.destroyDescriptorSetLayout(desc_layout, nullptr); - vk::DeviceQueueCreateInfo queues[2]; - queues[0].setQueueFamilyIndex(graphics_queue_family_index); - queues[0].setQueueCount(1); - queues[0].setPQueuePriorities(priorities); - - auto deviceInfo = vk::DeviceCreateInfo() - .setQueueCreateInfoCount(1) - .setPQueueCreateInfos(queues) - .setEnabledLayerCount(0) - .setPpEnabledLayerNames(nullptr) - .setEnabledExtensionCount(enabled_extension_count) - .setPpEnabledExtensionNames((const char *const *)extension_names) - .setPEnabledFeatures(nullptr); + for (uint32_t i = 0; i < texture_count; i++) { + device.destroyImageView(textures[i].view, nullptr); + device.destroyImage(textures[i].image, nullptr); + device.freeMemory(textures[i].mem, nullptr); + device.destroySampler(textures[i].sampler, nullptr); + } + device.destroySwapchainKHR(swapchain, nullptr); - if (separate_present_queue) { - queues[1].setQueueFamilyIndex(present_queue_family_index); - queues[1].setQueueCount(1); - queues[1].setPQueuePriorities(priorities); - deviceInfo.setQueueCreateInfoCount(2); - } + device.destroyImageView(depth.view, nullptr); + device.destroyImage(depth.image, nullptr); + device.freeMemory(depth.mem, nullptr); - auto result = gpu.createDevice(&deviceInfo, nullptr, &device); - VERIFY(result == vk::Result::eSuccess); + for (uint32_t i = 0; i < swapchainImageCount; i++) { + device.destroyImageView(swapchain_image_resources[i].view, nullptr); + device.freeCommandBuffers(cmd_pool, 1, &swapchain_image_resources[i].cmd); + device.destroyBuffer(swapchain_image_resources[i].uniform_buffer, nullptr); + device.freeMemory(swapchain_image_resources[i].uniform_memory, nullptr); } - void Demo::destroy_texture_image(texture_object *tex_objs) { - // clean up staging resources - device.freeMemory(tex_objs->mem, nullptr); - device.destroyImage(tex_objs->image, nullptr); - } + device.destroyCommandPool(cmd_pool, nullptr); - void Demo::draw() { - // Ensure no more than FRAME_LAG renderings are outstanding - device.waitForFences(1, &fences[frame_index], VK_TRUE, UINT64_MAX); - device.resetFences(1, &fences[frame_index]); + if (separate_present_queue) { + device.destroyCommandPool(present_cmd_pool, nullptr); + } + device.waitIdle(); + device.destroy(nullptr); + inst.destroySurfaceKHR(surface, nullptr); - vk::Result result; - do { - result = device.acquireNextImageKHR(swapchain, UINT64_MAX, image_acquired_semaphores[frame_index], - vk::Fence(), ¤t_buffer); - if (result == vk::Result::eErrorOutOfDateKHR) { - // demo->swapchain is out of date (e.g. the window was resized) and - // must be recreated: - resize(); - } else if (result == vk::Result::eSuboptimalKHR) { - // swapchain is not as optimal as it could be, but the platform's - // presentation engine will still present the image correctly. - break; - } else { - VERIFY(result == vk::Result::eSuccess); - } - } while (result != vk::Result::eSuccess); +#if defined(VK_USE_PLATFORM_XLIB_KHR) + XDestroyWindow(display, xlib_window); + XCloseDisplay(display); +#elif defined(VK_USE_PLATFORM_XCB_KHR) + xcb_destroy_window(connection, xcb_window); + xcb_disconnect(connection); + free(atom_wm_delete_window); +#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) + wl_keyboard_destroy(keyboard); + wl_pointer_destroy(pointer); + wl_seat_destroy(seat); + wl_shell_surface_destroy(shell_surface); + wl_surface_destroy(window); + wl_shell_destroy(shell); + wl_compositor_destroy(compositor); + wl_registry_destroy(registry); + wl_display_disconnect(display); +#elif defined(VK_USE_PLATFORM_MIR_KHR) +#endif - update_data_buffer(); + inst.destroy(nullptr); +} - // Wait for the image acquired semaphore to be signaled to ensure - // that the image won't be rendered to until the presentation - // engine has fully released ownership to the application, and it is - // okay to render to the image. - vk::PipelineStageFlags const pipe_stage_flags = vk::PipelineStageFlagBits::eColorAttachmentOutput; - auto const submit_info = vk::SubmitInfo() - .setPWaitDstStageMask(&pipe_stage_flags) - .setWaitSemaphoreCount(1) - .setPWaitSemaphores(&image_acquired_semaphores[frame_index]) - .setCommandBufferCount(1) - .setPCommandBuffers(&swapchain_image_resources[current_buffer].cmd) - .setSignalSemaphoreCount(1) - .setPSignalSemaphores(&draw_complete_semaphores[frame_index]); +void Demo::create_device() { + float const priorities[1] = {0.0}; - result = graphics_queue.submit(1, &submit_info, fences[frame_index]); - VERIFY(result == vk::Result::eSuccess); + vk::DeviceQueueCreateInfo queues[2]; + queues[0].setQueueFamilyIndex(graphics_queue_family_index); + queues[0].setQueueCount(1); + queues[0].setPQueuePriorities(priorities); + + auto deviceInfo = vk::DeviceCreateInfo() + .setQueueCreateInfoCount(1) + .setPQueueCreateInfos(queues) + .setEnabledLayerCount(0) + .setPpEnabledLayerNames(nullptr) + .setEnabledExtensionCount(enabled_extension_count) + .setPpEnabledExtensionNames((const char *const *)extension_names) + .setPEnabledFeatures(nullptr); + + if (separate_present_queue) { + queues[1].setQueueFamilyIndex(present_queue_family_index); + queues[1].setQueueCount(1); + queues[1].setPQueuePriorities(priorities); + deviceInfo.setQueueCreateInfoCount(2); + } - if (separate_present_queue) { - // If we are using separate queues, change image ownership to the - // present queue before presenting, waiting for the draw complete - // semaphore and signalling the ownership released semaphore when - // finished - auto const present_submit_info = vk::SubmitInfo() - .setPWaitDstStageMask(&pipe_stage_flags) - .setWaitSemaphoreCount(1) - .setPWaitSemaphores(&draw_complete_semaphores[frame_index]) - .setCommandBufferCount(1) - .setPCommandBuffers(&swapchain_image_resources[current_buffer].graphics_to_present_cmd) - .setSignalSemaphoreCount(1) - .setPSignalSemaphores(&image_ownership_semaphores[frame_index]); + auto result = gpu.createDevice(&deviceInfo, nullptr, &device); + VERIFY(result == vk::Result::eSuccess); +} - result = present_queue.submit(1, &present_submit_info, vk::Fence()); - VERIFY(result == vk::Result::eSuccess); - } +void Demo::destroy_texture_image(texture_object *tex_objs) { + // clean up staging resources + device.freeMemory(tex_objs->mem, nullptr); + device.destroyImage(tex_objs->image, nullptr); +} - // If we are using separate queues we have to wait for image ownership, - // otherwise wait for draw complete - auto const presentInfo = vk::PresentInfoKHR() - .setWaitSemaphoreCount(1) - .setPWaitSemaphores(separate_present_queue ? &image_ownership_semaphores[frame_index] - : &draw_complete_semaphores[frame_index]) - .setSwapchainCount(1) - .setPSwapchains(&swapchain) - .setPImageIndices(¤t_buffer); - - result = present_queue.presentKHR(&presentInfo); - frame_index += 1; - frame_index %= FRAME_LAG; +void Demo::draw() { + // Ensure no more than FRAME_LAG renderings are outstanding + device.waitForFences(1, &fences[frame_index], VK_TRUE, UINT64_MAX); + device.resetFences(1, &fences[frame_index]); + + vk::Result result; + do { + result = + device.acquireNextImageKHR(swapchain, UINT64_MAX, image_acquired_semaphores[frame_index], vk::Fence(), ¤t_buffer); if (result == vk::Result::eErrorOutOfDateKHR) { - // swapchain is out of date (e.g. the window was resized) and + // demo->swapchain is out of date (e.g. the window was resized) and // must be recreated: resize(); } else if (result == vk::Result::eSuboptimalKHR) { // swapchain is not as optimal as it could be, but the platform's // presentation engine will still present the image correctly. + break; } else { VERIFY(result == vk::Result::eSuccess); } - } - - void Demo::draw_build_cmd(vk::CommandBuffer commandBuffer) { - auto const commandInfo = vk::CommandBufferBeginInfo().setFlags(vk::CommandBufferUsageFlagBits::eSimultaneousUse); - - vk::ClearValue const clearValues[2] = {vk::ClearColorValue(std::array({{0.2f, 0.2f, 0.2f, 0.2f}})), - vk::ClearDepthStencilValue(1.0f, 0u)}; - - auto const passInfo = vk::RenderPassBeginInfo() - .setRenderPass(render_pass) - .setFramebuffer(swapchain_image_resources[current_buffer].framebuffer) - .setRenderArea(vk::Rect2D(vk::Offset2D(0, 0), vk::Extent2D((uint32_t)width, (uint32_t)height))) - .setClearValueCount(2) - .setPClearValues(clearValues); - - auto result = commandBuffer.begin(&commandInfo); - VERIFY(result == vk::Result::eSuccess); - - commandBuffer.beginRenderPass(&passInfo, vk::SubpassContents::eInline); - commandBuffer.bindPipeline(vk::PipelineBindPoint::eGraphics, pipeline); - commandBuffer.bindDescriptorSets(vk::PipelineBindPoint::eGraphics, pipeline_layout, 0, 1, &swapchain_image_resources[current_buffer].descriptor_set, 0, nullptr); - - auto const viewport = - vk::Viewport().setWidth((float)width).setHeight((float)height).setMinDepth((float)0.0f).setMaxDepth((float)1.0f); - commandBuffer.setViewport(0, 1, &viewport); - - vk::Rect2D const scissor(vk::Offset2D(0, 0), vk::Extent2D(width, height)); - commandBuffer.setScissor(0, 1, &scissor); - commandBuffer.draw(12 * 3, 1, 0, 0); - // Note that ending the renderpass changes the image's layout from - // COLOR_ATTACHMENT_OPTIMAL to PRESENT_SRC_KHR - commandBuffer.endRenderPass(); - - if (separate_present_queue) { - // We have to transfer ownership from the graphics queue family to - // the - // present queue family to be able to present. Note that we don't - // have - // to transfer from present queue family back to graphics queue - // family at - // the start of the next frame because we don't care about the - // image's - // contents at that point. - auto const image_ownership_barrier = - vk::ImageMemoryBarrier() - .setSrcAccessMask(vk::AccessFlags()) - .setDstAccessMask(vk::AccessFlagBits::eColorAttachmentWrite) - .setOldLayout(vk::ImageLayout::ePresentSrcKHR) - .setNewLayout(vk::ImageLayout::ePresentSrcKHR) - .setSrcQueueFamilyIndex(graphics_queue_family_index) - .setDstQueueFamilyIndex(present_queue_family_index) - .setImage(swapchain_image_resources[current_buffer].image) - .setSubresourceRange(vk::ImageSubresourceRange(vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1)); + } while (result != vk::Result::eSuccess); - commandBuffer.pipelineBarrier(vk::PipelineStageFlagBits::eColorAttachmentOutput, - vk::PipelineStageFlagBits::eBottomOfPipe, vk::DependencyFlagBits(), 0, nullptr, 0, - nullptr, 1, &image_ownership_barrier); - } + update_data_buffer(); - result = commandBuffer.end(); + // Wait for the image acquired semaphore to be signaled to ensure + // that the image won't be rendered to until the presentation + // engine has fully released ownership to the application, and it is + // okay to render to the image. + vk::PipelineStageFlags const pipe_stage_flags = vk::PipelineStageFlagBits::eColorAttachmentOutput; + auto const submit_info = vk::SubmitInfo() + .setPWaitDstStageMask(&pipe_stage_flags) + .setWaitSemaphoreCount(1) + .setPWaitSemaphores(&image_acquired_semaphores[frame_index]) + .setCommandBufferCount(1) + .setPCommandBuffers(&swapchain_image_resources[current_buffer].cmd) + .setSignalSemaphoreCount(1) + .setPSignalSemaphores(&draw_complete_semaphores[frame_index]); + + result = graphics_queue.submit(1, &submit_info, fences[frame_index]); + VERIFY(result == vk::Result::eSuccess); + + if (separate_present_queue) { + // If we are using separate queues, change image ownership to the + // present queue before presenting, waiting for the draw complete + // semaphore and signalling the ownership released semaphore when + // finished + auto const present_submit_info = vk::SubmitInfo() + .setPWaitDstStageMask(&pipe_stage_flags) + .setWaitSemaphoreCount(1) + .setPWaitSemaphores(&draw_complete_semaphores[frame_index]) + .setCommandBufferCount(1) + .setPCommandBuffers(&swapchain_image_resources[current_buffer].graphics_to_present_cmd) + .setSignalSemaphoreCount(1) + .setPSignalSemaphores(&image_ownership_semaphores[frame_index]); + + result = present_queue.submit(1, &present_submit_info, vk::Fence()); VERIFY(result == vk::Result::eSuccess); } - void Demo::flush_init_cmd() { - // TODO: hmm. - // This function could get called twice if the texture uses a staging - // buffer - // In that case the second call should be ignored - if (!cmd) { - return; - } - - auto result = cmd.end(); + // If we are using separate queues we have to wait for image ownership, + // otherwise wait for draw complete + auto const presentInfo = vk::PresentInfoKHR() + .setWaitSemaphoreCount(1) + .setPWaitSemaphores(separate_present_queue ? &image_ownership_semaphores[frame_index] + : &draw_complete_semaphores[frame_index]) + .setSwapchainCount(1) + .setPSwapchains(&swapchain) + .setPImageIndices(¤t_buffer); + + result = present_queue.presentKHR(&presentInfo); + frame_index += 1; + frame_index %= FRAME_LAG; + if (result == vk::Result::eErrorOutOfDateKHR) { + // swapchain is out of date (e.g. the window was resized) and + // must be recreated: + resize(); + } else if (result == vk::Result::eSuboptimalKHR) { + // swapchain is not as optimal as it could be, but the platform's + // presentation engine will still present the image correctly. + } else { VERIFY(result == vk::Result::eSuccess); + } +} - auto const fenceInfo = vk::FenceCreateInfo(); - vk::Fence fence; - result = device.createFence(&fenceInfo, nullptr, &fence); - VERIFY(result == vk::Result::eSuccess); +void Demo::draw_build_cmd(vk::CommandBuffer commandBuffer) { + auto const commandInfo = vk::CommandBufferBeginInfo().setFlags(vk::CommandBufferUsageFlagBits::eSimultaneousUse); - vk::CommandBuffer const commandBuffers[] = {cmd}; - auto const submitInfo = vk::SubmitInfo().setCommandBufferCount(1).setPCommandBuffers(commandBuffers); + vk::ClearValue const clearValues[2] = {vk::ClearColorValue(std::array({{0.2f, 0.2f, 0.2f, 0.2f}})), + vk::ClearDepthStencilValue(1.0f, 0u)}; - result = graphics_queue.submit(1, &submitInfo, fence); - VERIFY(result == vk::Result::eSuccess); + auto const passInfo = vk::RenderPassBeginInfo() + .setRenderPass(render_pass) + .setFramebuffer(swapchain_image_resources[current_buffer].framebuffer) + .setRenderArea(vk::Rect2D(vk::Offset2D(0, 0), vk::Extent2D((uint32_t)width, (uint32_t)height))) + .setClearValueCount(2) + .setPClearValues(clearValues); + + auto result = commandBuffer.begin(&commandInfo); + VERIFY(result == vk::Result::eSuccess); + + commandBuffer.beginRenderPass(&passInfo, vk::SubpassContents::eInline); + commandBuffer.bindPipeline(vk::PipelineBindPoint::eGraphics, pipeline); + commandBuffer.bindDescriptorSets(vk::PipelineBindPoint::eGraphics, pipeline_layout, 0, 1, + &swapchain_image_resources[current_buffer].descriptor_set, 0, nullptr); + + auto const viewport = + vk::Viewport().setWidth((float)width).setHeight((float)height).setMinDepth((float)0.0f).setMaxDepth((float)1.0f); + commandBuffer.setViewport(0, 1, &viewport); + + vk::Rect2D const scissor(vk::Offset2D(0, 0), vk::Extent2D(width, height)); + commandBuffer.setScissor(0, 1, &scissor); + commandBuffer.draw(12 * 3, 1, 0, 0); + // Note that ending the renderpass changes the image's layout from + // COLOR_ATTACHMENT_OPTIMAL to PRESENT_SRC_KHR + commandBuffer.endRenderPass(); + + if (separate_present_queue) { + // We have to transfer ownership from the graphics queue family to + // the + // present queue family to be able to present. Note that we don't + // have + // to transfer from present queue family back to graphics queue + // family at + // the start of the next frame because we don't care about the + // image's + // contents at that point. + auto const image_ownership_barrier = + vk::ImageMemoryBarrier() + .setSrcAccessMask(vk::AccessFlags()) + .setDstAccessMask(vk::AccessFlagBits::eColorAttachmentWrite) + .setOldLayout(vk::ImageLayout::ePresentSrcKHR) + .setNewLayout(vk::ImageLayout::ePresentSrcKHR) + .setSrcQueueFamilyIndex(graphics_queue_family_index) + .setDstQueueFamilyIndex(present_queue_family_index) + .setImage(swapchain_image_resources[current_buffer].image) + .setSubresourceRange(vk::ImageSubresourceRange(vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1)); - result = device.waitForFences(1, &fence, VK_TRUE, UINT64_MAX); - VERIFY(result == vk::Result::eSuccess); + commandBuffer.pipelineBarrier(vk::PipelineStageFlagBits::eColorAttachmentOutput, vk::PipelineStageFlagBits::eBottomOfPipe, + vk::DependencyFlagBits(), 0, nullptr, 0, nullptr, 1, &image_ownership_barrier); + } - device.freeCommandBuffers(cmd_pool, 1, commandBuffers); - device.destroyFence(fence, nullptr); + result = commandBuffer.end(); + VERIFY(result == vk::Result::eSuccess); +} - cmd = vk::CommandBuffer(); +void Demo::flush_init_cmd() { + // TODO: hmm. + // This function could get called twice if the texture uses a staging + // buffer + // In that case the second call should be ignored + if (!cmd) { + return; } - void Demo::init(int argc, char **argv) { - vec3 eye = {0.0f, 3.0f, 5.0f}; - vec3 origin = {0, 0, 0}; - vec3 up = {0.0f, 1.0f, 0.0}; + auto result = cmd.end(); + VERIFY(result == vk::Result::eSuccess); - presentMode = vk::PresentModeKHR::eFifo; - frameCount = UINT32_MAX; - use_xlib = false; - - for (int i = 1; i < argc; i++) { - if (strcmp(argv[i], "--use_staging") == 0) { - use_staging_buffer = true; - continue; - } - if ((strcmp(argv[i], "--present_mode") == 0) && (i < argc - 1)) { - presentMode = (vk::PresentModeKHR)atoi(argv[i + 1]); - i++; - continue; - } - if (strcmp(argv[i], "--break") == 0) { - use_break = true; - continue; - } - if (strcmp(argv[i], "--validate") == 0) { - validate = true; - continue; - } - if (strcmp(argv[i], "--xlib") == 0) { - fprintf(stderr, "--xlib is deprecated and no longer does anything"); - continue; - } - if (strcmp(argv[i], "--c") == 0 && frameCount == UINT32_MAX && i < argc - 1 && - sscanf(argv[i + 1], "%d", &frameCount) == 1) { - i++; - continue; - } - if (strcmp(argv[i], "--suppress_popups") == 0) { - suppress_popups = true; - continue; - } + auto const fenceInfo = vk::FenceCreateInfo(); + vk::Fence fence; + result = device.createFence(&fenceInfo, nullptr, &fence); + VERIFY(result == vk::Result::eSuccess); - fprintf(stderr, - "Usage:\n %s [--use_staging] [--validate] [--break] [--c ] \n" - " [--suppress_popups] [--present_mode {0,1,2,3}]\n" - "\n" - "Options for --present_mode:\n" - " %d: VK_PRESENT_MODE_IMMEDIATE_KHR\n" - " %d: VK_PRESENT_MODE_MAILBOX_KHR\n" - " %d: VK_PRESENT_MODE_FIFO_KHR (default)\n" - " %d: VK_PRESENT_MODE_FIFO_RELAXED_KHR\n", - APP_SHORT_NAME, VK_PRESENT_MODE_IMMEDIATE_KHR, VK_PRESENT_MODE_MAILBOX_KHR, VK_PRESENT_MODE_FIFO_KHR, - VK_PRESENT_MODE_FIFO_RELAXED_KHR); - fflush(stderr); - exit(1); - } + vk::CommandBuffer const commandBuffers[] = {cmd}; + auto const submitInfo = vk::SubmitInfo().setCommandBufferCount(1).setPCommandBuffers(commandBuffers); - if (!use_xlib) { - init_connection(); - } + result = graphics_queue.submit(1, &submitInfo, fence); + VERIFY(result == vk::Result::eSuccess); - init_vk(); + result = device.waitForFences(1, &fence, VK_TRUE, UINT64_MAX); + VERIFY(result == vk::Result::eSuccess); - width = 500; - height = 500; + device.freeCommandBuffers(cmd_pool, 1, commandBuffers); + device.destroyFence(fence, nullptr); - spin_angle = 4.0f; - spin_increment = 0.2f; - pause = false; + cmd = vk::CommandBuffer(); +} - mat4x4_perspective(projection_matrix, (float)degreesToRadians(45.0f), 1.0f, 0.1f, 100.0f); - mat4x4_look_at(view_matrix, eye, origin, up); - mat4x4_identity(model_matrix); +void Demo::init(int argc, char **argv) { + vec3 eye = {0.0f, 3.0f, 5.0f}; + vec3 origin = {0, 0, 0}; + vec3 up = {0.0f, 1.0f, 0.0}; + + presentMode = vk::PresentModeKHR::eFifo; + frameCount = UINT32_MAX; + use_xlib = false; + + for (int i = 1; i < argc; i++) { + if (strcmp(argv[i], "--use_staging") == 0) { + use_staging_buffer = true; + continue; + } + if ((strcmp(argv[i], "--present_mode") == 0) && (i < argc - 1)) { + presentMode = (vk::PresentModeKHR)atoi(argv[i + 1]); + i++; + continue; + } + if (strcmp(argv[i], "--break") == 0) { + use_break = true; + continue; + } + if (strcmp(argv[i], "--validate") == 0) { + validate = true; + continue; + } + if (strcmp(argv[i], "--xlib") == 0) { + fprintf(stderr, "--xlib is deprecated and no longer does anything"); + continue; + } + if (strcmp(argv[i], "--c") == 0 && frameCount == UINT32_MAX && i < argc - 1 && + sscanf(argv[i + 1], "%" SCNu32, &frameCount) == 1) { + i++; + continue; + } + if (strcmp(argv[i], "--suppress_popups") == 0) { + suppress_popups = true; + continue; + } + + fprintf(stderr, + "Usage:\n %s [--use_staging] [--validate] [--break] [--c ] \n" + " [--suppress_popups] [--present_mode {0,1,2,3}]\n" + "\n" + "Options for --present_mode:\n" + " %d: VK_PRESENT_MODE_IMMEDIATE_KHR\n" + " %d: VK_PRESENT_MODE_MAILBOX_KHR\n" + " %d: VK_PRESENT_MODE_FIFO_KHR (default)\n" + " %d: VK_PRESENT_MODE_FIFO_RELAXED_KHR\n", + APP_SHORT_NAME, VK_PRESENT_MODE_IMMEDIATE_KHR, VK_PRESENT_MODE_MAILBOX_KHR, VK_PRESENT_MODE_FIFO_KHR, + VK_PRESENT_MODE_FIFO_RELAXED_KHR); + fflush(stderr); + exit(1); + } + + if (!use_xlib) { + init_connection(); + } + + init_vk(); + + width = 500; + height = 500; + + spin_angle = 4.0f; + spin_increment = 0.2f; + pause = false; + + mat4x4_perspective(projection_matrix, (float)degreesToRadians(45.0f), 1.0f, 0.1f, 100.0f); + mat4x4_look_at(view_matrix, eye, origin, up); + mat4x4_identity(model_matrix); - projection_matrix[1][1] *= -1; // Flip projection matrix from GL to Vulkan orientation. - } + projection_matrix[1][1] *= -1; // Flip projection matrix from GL to Vulkan orientation. +} - void Demo::init_connection() { +void Demo::init_connection() { #if defined(VK_USE_PLATFORM_XCB_KHR) - const xcb_setup_t *setup; - xcb_screen_iterator_t iter; - int scr; - - connection = xcb_connect(nullptr, &scr); - if (xcb_connection_has_error(connection) > 0) { - printf( - "Cannot find a compatible Vulkan installable client driver " - "(ICD).\nExiting ...\n"); - fflush(stdout); - exit(1); - } - - setup = xcb_get_setup(connection); - iter = xcb_setup_roots_iterator(setup); - while (scr-- > 0) xcb_screen_next(&iter); + const xcb_setup_t *setup; + xcb_screen_iterator_t iter; + int scr; + + const char *display_envar = getenv("DISPLAY"); + if (display_envar == nullptr || display_envar[0] == '\0') { + printf("Environment variable DISPLAY requires a valid value.\nExiting ...\n"); + fflush(stdout); + exit(1); + } + + connection = xcb_connect(nullptr, &scr); + if (xcb_connection_has_error(connection) > 0) { + printf( + "Cannot find a compatible Vulkan installable client driver " + "(ICD).\nExiting ...\n"); + fflush(stdout); + exit(1); + } + + setup = xcb_get_setup(connection); + iter = xcb_setup_roots_iterator(setup); + while (scr-- > 0) xcb_screen_next(&iter); - screen = iter.data; + screen = iter.data; #elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - display = wl_display_connect(nullptr); + display = wl_display_connect(nullptr); - if (display == nullptr) { - printf( - "Cannot find a compatible Vulkan installable client driver " - "(ICD).\nExiting ...\n"); - fflush(stdout); - exit(1); - } + if (display == nullptr) { + printf("Cannot find a compatible Vulkan installable client driver (ICD).\nExiting ...\n"); + fflush(stdout); + exit(1); + } - registry = wl_display_get_registry(display); - wl_registry_add_listener(registry, ®istry_listener, this); - wl_display_dispatch(display); + registry = wl_display_get_registry(display); + wl_registry_add_listener(registry, ®istry_listener, this); + wl_display_dispatch(display); #elif defined(VK_USE_PLATFORM_MIR_KHR) #endif - } - - void Demo::init_vk() { - uint32_t instance_extension_count = 0; - uint32_t instance_layer_count = 0; - uint32_t validation_layer_count = 0; - char const *const *instance_validation_layers = nullptr; - enabled_extension_count = 0; - enabled_layer_count = 0; - - char const *const instance_validation_layers_alt1[] = {"VK_LAYER_LUNARG_standard_validation"}; - - char const *const instance_validation_layers_alt2[] = { - "VK_LAYER_GOOGLE_threading", "VK_LAYER_LUNARG_parameter_validation", "VK_LAYER_LUNARG_object_tracker", - "VK_LAYER_LUNARG_core_validation", "VK_LAYER_GOOGLE_unique_objects"}; - - // Look for validation layers - vk::Bool32 validation_found = VK_FALSE; - if (validate) { - auto result = vk::enumerateInstanceLayerProperties(&instance_layer_count, nullptr); - VERIFY(result == vk::Result::eSuccess); - - instance_validation_layers = instance_validation_layers_alt1; - if (instance_layer_count > 0) { - std::unique_ptr instance_layers(new vk::LayerProperties[instance_layer_count]); - result = vk::enumerateInstanceLayerProperties(&instance_layer_count, instance_layers.get()); - VERIFY(result == vk::Result::eSuccess); +} - validation_found = check_layers(ARRAY_SIZE(instance_validation_layers_alt1), instance_validation_layers, +void Demo::init_vk() { + uint32_t instance_extension_count = 0; + uint32_t instance_layer_count = 0; + uint32_t validation_layer_count = 0; + char const *const *instance_validation_layers = nullptr; + enabled_extension_count = 0; + enabled_layer_count = 0; + + char const *const instance_validation_layers_alt1[] = {"VK_LAYER_LUNARG_standard_validation"}; + + char const *const instance_validation_layers_alt2[] = {"VK_LAYER_GOOGLE_threading", "VK_LAYER_LUNARG_parameter_validation", + "VK_LAYER_LUNARG_object_tracker", "VK_LAYER_LUNARG_core_validation", + "VK_LAYER_GOOGLE_unique_objects"}; + + // Look for validation layers + vk::Bool32 validation_found = VK_FALSE; + if (validate) { + auto result = vk::enumerateInstanceLayerProperties(&instance_layer_count, nullptr); + VERIFY(result == vk::Result::eSuccess); + + instance_validation_layers = instance_validation_layers_alt1; + if (instance_layer_count > 0) { + std::unique_ptr instance_layers(new vk::LayerProperties[instance_layer_count]); + result = vk::enumerateInstanceLayerProperties(&instance_layer_count, instance_layers.get()); + VERIFY(result == vk::Result::eSuccess); + + validation_found = check_layers(ARRAY_SIZE(instance_validation_layers_alt1), instance_validation_layers, + instance_layer_count, instance_layers.get()); + if (validation_found) { + enabled_layer_count = ARRAY_SIZE(instance_validation_layers_alt1); + enabled_layers[0] = "VK_LAYER_LUNARG_standard_validation"; + validation_layer_count = 1; + } else { + // use alternative set of validation layers + instance_validation_layers = instance_validation_layers_alt2; + enabled_layer_count = ARRAY_SIZE(instance_validation_layers_alt2); + validation_found = check_layers(ARRAY_SIZE(instance_validation_layers_alt2), instance_validation_layers, instance_layer_count, instance_layers.get()); - if (validation_found) { - enabled_layer_count = ARRAY_SIZE(instance_validation_layers_alt1); - enabled_layers[0] = "VK_LAYER_LUNARG_standard_validation"; - validation_layer_count = 1; - } else { - // use alternative set of validation layers - instance_validation_layers = instance_validation_layers_alt2; - enabled_layer_count = ARRAY_SIZE(instance_validation_layers_alt2); - validation_found = check_layers(ARRAY_SIZE(instance_validation_layers_alt2), instance_validation_layers, - instance_layer_count, instance_layers.get()); - validation_layer_count = ARRAY_SIZE(instance_validation_layers_alt2); - for (uint32_t i = 0; i < validation_layer_count; i++) { - enabled_layers[i] = instance_validation_layers[i]; - } + validation_layer_count = ARRAY_SIZE(instance_validation_layers_alt2); + for (uint32_t i = 0; i < validation_layer_count; i++) { + enabled_layers[i] = instance_validation_layers[i]; } } - - if (!validation_found) { - ERR_EXIT( - "vkEnumerateInstanceLayerProperties failed to find " - "required validation layer.\n\n" - "Please look at the Getting Started guide for " - "additional information.\n", - "vkCreateInstance Failure"); - } } - /* Look for instance extensions */ - vk::Bool32 surfaceExtFound = VK_FALSE; - vk::Bool32 platformSurfaceExtFound = VK_FALSE; - memset(extension_names, 0, sizeof(extension_names)); - - auto result = vk::enumerateInstanceExtensionProperties(nullptr, &instance_extension_count, nullptr); - VERIFY(result == vk::Result::eSuccess); - - if (instance_extension_count > 0) { - std::unique_ptr instance_extensions(new vk::ExtensionProperties[instance_extension_count]); - result = vk::enumerateInstanceExtensionProperties(nullptr, &instance_extension_count, instance_extensions.get()); - VERIFY(result == vk::Result::eSuccess); + if (!validation_found) { + ERR_EXIT( + "vkEnumerateInstanceLayerProperties failed to find required validation layer.\n\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } + } - for (uint32_t i = 0; i < instance_extension_count; i++) { - if (!strcmp(VK_KHR_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { - surfaceExtFound = 1; - extension_names[enabled_extension_count++] = VK_KHR_SURFACE_EXTENSION_NAME; - } + /* Look for instance extensions */ + vk::Bool32 surfaceExtFound = VK_FALSE; + vk::Bool32 platformSurfaceExtFound = VK_FALSE; + memset(extension_names, 0, sizeof(extension_names)); + + auto result = vk::enumerateInstanceExtensionProperties(nullptr, &instance_extension_count, nullptr); + VERIFY(result == vk::Result::eSuccess); + + if (instance_extension_count > 0) { + std::unique_ptr instance_extensions(new vk::ExtensionProperties[instance_extension_count]); + result = vk::enumerateInstanceExtensionProperties(nullptr, &instance_extension_count, instance_extensions.get()); + VERIFY(result == vk::Result::eSuccess); + + for (uint32_t i = 0; i < instance_extension_count; i++) { + if (!strcmp(VK_KHR_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { + surfaceExtFound = 1; + extension_names[enabled_extension_count++] = VK_KHR_SURFACE_EXTENSION_NAME; + } #if defined(VK_USE_PLATFORM_WIN32_KHR) - if (!strcmp(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { - platformSurfaceExtFound = 1; - extension_names[enabled_extension_count++] = VK_KHR_WIN32_SURFACE_EXTENSION_NAME; - } + if (!strcmp(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { + platformSurfaceExtFound = 1; + extension_names[enabled_extension_count++] = VK_KHR_WIN32_SURFACE_EXTENSION_NAME; + } #elif defined(VK_USE_PLATFORM_XLIB_KHR) - if (!strcmp(VK_KHR_XLIB_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { - platformSurfaceExtFound = 1; - extension_names[enabled_extension_count++] = VK_KHR_XLIB_SURFACE_EXTENSION_NAME; - } + if (!strcmp(VK_KHR_XLIB_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { + platformSurfaceExtFound = 1; + extension_names[enabled_extension_count++] = VK_KHR_XLIB_SURFACE_EXTENSION_NAME; + } #elif defined(VK_USE_PLATFORM_XCB_KHR) - if (!strcmp(VK_KHR_XCB_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { - platformSurfaceExtFound = 1; - extension_names[enabled_extension_count++] = VK_KHR_XCB_SURFACE_EXTENSION_NAME; - } + if (!strcmp(VK_KHR_XCB_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { + platformSurfaceExtFound = 1; + extension_names[enabled_extension_count++] = VK_KHR_XCB_SURFACE_EXTENSION_NAME; + } #elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - if (!strcmp(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { - platformSurfaceExtFound = 1; - extension_names[enabled_extension_count++] = VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME; - } + if (!strcmp(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { + platformSurfaceExtFound = 1; + extension_names[enabled_extension_count++] = VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME; + } #elif defined(VK_USE_PLATFORM_MIR_KHR) #elif defined(VK_USE_PLATFORM_DISPLAY_KHR) - if (!strcmp(VK_KHR_DISPLAY_EXTENSION_NAME, instance_extensions[i].extensionName)) { - platformSurfaceExtFound = 1; - extension_names[enabled_extension_count++] = VK_KHR_DISPLAY_EXTENSION_NAME; - } + if (!strcmp(VK_KHR_DISPLAY_EXTENSION_NAME, instance_extensions[i].extensionName)) { + platformSurfaceExtFound = 1; + extension_names[enabled_extension_count++] = VK_KHR_DISPLAY_EXTENSION_NAME; + } +#elif defined(VK_USE_PLATFORM_IOS_MVK) + if (!strcmp(VK_MVK_IOS_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { + platformSurfaceExtFound = 1; + extension_names[enabled_extension_count++] = VK_MVK_IOS_SURFACE_EXTENSION_NAME; + } +#elif defined(VK_USE_PLATFORM_MACOS_MVK) + if (!strcmp(VK_MVK_MACOS_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { + platformSurfaceExtFound = 1; + extension_names[enabled_extension_count++] = VK_MVK_MACOS_SURFACE_EXTENSION_NAME; + } #endif - assert(enabled_extension_count < 64); - } + assert(enabled_extension_count < 64); } + } - if (!surfaceExtFound) { - ERR_EXIT( - "vkEnumerateInstanceExtensionProperties failed to find " - "the " VK_KHR_SURFACE_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client " - "driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional " - "information.\n", - "vkCreateInstance Failure"); - } + if (!surfaceExtFound) { + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } - if (!platformSurfaceExtFound) { + if (!platformSurfaceExtFound) { #if defined(VK_USE_PLATFORM_WIN32_KHR) - ERR_EXIT( - "vkEnumerateInstanceExtensionProperties failed to find " - "the " VK_KHR_WIN32_SURFACE_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client " - "driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional " - "information.\n", - "vkCreateInstance Failure"); + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_WIN32_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); #elif defined(VK_USE_PLATFORM_XCB_KHR) - ERR_EXIT( - "vkEnumerateInstanceExtensionProperties failed to find " - "the " VK_KHR_XCB_SURFACE_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client " - "driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional " - "information.\n", - "vkCreateInstance Failure"); + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_XCB_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); #elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - ERR_EXIT( - "vkEnumerateInstanceExtensionProperties failed to find " - "the " VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client " - "driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional " - "information.\n", - "vkCreateInstance Failure"); + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); #elif defined(VK_USE_PLATFORM_MIR_KHR) #elif defined(VK_USE_PLATFORM_XLIB_KHR) - ERR_EXIT( - "vkEnumerateInstanceExtensionProperties failed to find " - "the " VK_KHR_XLIB_SURFACE_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client " - "driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional " - "information.\n", - "vkCreateInstance Failure"); + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_XLIB_SURFACE_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); #elif defined(VK_USE_PLATFORM_DISPLAY_KHR) - ERR_EXIT( - "vkEnumerateInstanceExtensionProperties failed to find " - "the " VK_KHR_DISPLAY_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client " - "driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional " - "information.\n", - "vkCreateInstance Failure"); + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_DISPLAY_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); +#elif defined(VK_USE_PLATFORM_IOS_MVK) + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_MVK_IOS_SURFACE_EXTENSION_NAME + " extension.\n\nDo you have a compatible " + "Vulkan installable client driver (ICD) installed?\nPlease " + "look at the Getting Started guide for additional " + "information.\n", + "vkCreateInstance Failure"); +#elif defined(VK_USE_PLATFORM_MACOS_MVK) + ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_MVK_MACOS_SURFACE_EXTENSION_NAME + " extension.\n\nDo you have a compatible " + "Vulkan installable client driver (ICD) installed?\nPlease " + "look at the Getting Started guide for additional " + "information.\n", + "vkCreateInstance Failure"); #endif - } - auto const app = vk::ApplicationInfo() - .setPApplicationName(APP_SHORT_NAME) - .setApplicationVersion(0) - .setPEngineName(APP_SHORT_NAME) - .setEngineVersion(0) - .setApiVersion(VK_API_VERSION_1_0); - auto const inst_info = vk::InstanceCreateInfo() - .setPApplicationInfo(&app) - .setEnabledLayerCount(enabled_layer_count) - .setPpEnabledLayerNames(instance_validation_layers) - .setEnabledExtensionCount(enabled_extension_count) - .setPpEnabledExtensionNames(extension_names); + } + auto const app = vk::ApplicationInfo() + .setPApplicationName(APP_SHORT_NAME) + .setApplicationVersion(0) + .setPEngineName(APP_SHORT_NAME) + .setEngineVersion(0) + .setApiVersion(VK_API_VERSION_1_0); + auto const inst_info = vk::InstanceCreateInfo() + .setPApplicationInfo(&app) + .setEnabledLayerCount(enabled_layer_count) + .setPpEnabledLayerNames(instance_validation_layers) + .setEnabledExtensionCount(enabled_extension_count) + .setPpEnabledExtensionNames(extension_names); + + result = vk::createInstance(&inst_info, nullptr, &inst); + if (result == vk::Result::eErrorIncompatibleDriver) { + ERR_EXIT( + "Cannot find a compatible Vulkan installable client driver (ICD).\n\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } else if (result == vk::Result::eErrorExtensionNotPresent) { + ERR_EXIT( + "Cannot find a specified extension library.\n" + "Make sure your layers path is set appropriately.\n", + "vkCreateInstance Failure"); + } else if (result != vk::Result::eSuccess) { + ERR_EXIT( + "vkCreateInstance failed.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } + + /* Make initial call to query gpu_count, then second call for gpu info*/ + uint32_t gpu_count; + result = inst.enumeratePhysicalDevices(&gpu_count, nullptr); + VERIFY(result == vk::Result::eSuccess); + + if (gpu_count > 0) { + std::unique_ptr physical_devices(new vk::PhysicalDevice[gpu_count]); + result = inst.enumeratePhysicalDevices(&gpu_count, physical_devices.get()); + VERIFY(result == vk::Result::eSuccess); + /* For cube demo we just grab the first physical device */ + gpu = physical_devices[0]; + } else { + ERR_EXIT( + "vkEnumeratePhysicalDevices reported zero accessible devices.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkEnumeratePhysicalDevices Failure"); + } - result = vk::createInstance(&inst_info, nullptr, &inst); - if (result == vk::Result::eErrorIncompatibleDriver) { - ERR_EXIT( - "Cannot find a compatible Vulkan installable client " - "driver (ICD).\n\n" - "Please look at the Getting Started guide for additional " - "information.\n", - "vkCreateInstance Failure"); - } else if (result == vk::Result::eErrorExtensionNotPresent) { - ERR_EXIT( - "Cannot find a specified extension library.\n" - "Make sure your layers path is set appropriately.\n", - "vkCreateInstance Failure"); - } else if (result != vk::Result::eSuccess) { - ERR_EXIT( - "vkCreateInstance failed.\n\n" - "Do you have a compatible Vulkan installable client " - "driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional " - "information.\n", - "vkCreateInstance Failure"); - } + /* Look for device extensions */ + uint32_t device_extension_count = 0; + vk::Bool32 swapchainExtFound = VK_FALSE; + enabled_extension_count = 0; + memset(extension_names, 0, sizeof(extension_names)); - /* Make initial call to query gpu_count, then second call for gpu info*/ - uint32_t gpu_count; - result = inst.enumeratePhysicalDevices(&gpu_count, nullptr); - VERIFY(result == vk::Result::eSuccess); - assert(gpu_count > 0); - - if (gpu_count > 0) { - std::unique_ptr physical_devices(new vk::PhysicalDevice[gpu_count]); - result = inst.enumeratePhysicalDevices(&gpu_count, physical_devices.get()); - VERIFY(result == vk::Result::eSuccess); - /* For cube demo we just grab the first physical device */ - gpu = physical_devices[0]; - } else { - ERR_EXIT( - "vkEnumeratePhysicalDevices reported zero accessible " - "devices.\n\n" - "Do you have a compatible Vulkan installable client " - "driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional " - "information.\n", - "vkEnumeratePhysicalDevices Failure"); - } - - /* Look for device extensions */ - uint32_t device_extension_count = 0; - vk::Bool32 swapchainExtFound = VK_FALSE; - enabled_extension_count = 0; - memset(extension_names, 0, sizeof(extension_names)); - - result = gpu.enumerateDeviceExtensionProperties(nullptr, &device_extension_count, nullptr); - VERIFY(result == vk::Result::eSuccess); - - if (device_extension_count > 0) { - std::unique_ptr device_extensions(new vk::ExtensionProperties[device_extension_count]); - result = gpu.enumerateDeviceExtensionProperties(nullptr, &device_extension_count, device_extensions.get()); - VERIFY(result == vk::Result::eSuccess); + result = gpu.enumerateDeviceExtensionProperties(nullptr, &device_extension_count, nullptr); + VERIFY(result == vk::Result::eSuccess); - for (uint32_t i = 0; i < device_extension_count; i++) { - if (!strcmp(VK_KHR_SWAPCHAIN_EXTENSION_NAME, device_extensions[i].extensionName)) { - swapchainExtFound = 1; - extension_names[enabled_extension_count++] = VK_KHR_SWAPCHAIN_EXTENSION_NAME; - } - assert(enabled_extension_count < 64); + if (device_extension_count > 0) { + std::unique_ptr device_extensions(new vk::ExtensionProperties[device_extension_count]); + result = gpu.enumerateDeviceExtensionProperties(nullptr, &device_extension_count, device_extensions.get()); + VERIFY(result == vk::Result::eSuccess); + + for (uint32_t i = 0; i < device_extension_count; i++) { + if (!strcmp(VK_KHR_SWAPCHAIN_EXTENSION_NAME, device_extensions[i].extensionName)) { + swapchainExtFound = 1; + extension_names[enabled_extension_count++] = VK_KHR_SWAPCHAIN_EXTENSION_NAME; } + assert(enabled_extension_count < 64); } + } - if (!swapchainExtFound) { - ERR_EXIT( - "vkEnumerateDeviceExtensionProperties failed to find " - "the " VK_KHR_SWAPCHAIN_EXTENSION_NAME - " extension.\n\n" - "Do you have a compatible Vulkan installable client " - "driver (ICD) installed?\n" - "Please look at the Getting Started guide for additional " - "information.\n", - "vkCreateInstance Failure"); - } + if (!swapchainExtFound) { + ERR_EXIT("vkEnumerateDeviceExtensionProperties failed to find the " VK_KHR_SWAPCHAIN_EXTENSION_NAME + " extension.\n\n" + "Do you have a compatible Vulkan installable client driver (ICD) installed?\n" + "Please look at the Getting Started guide for additional information.\n", + "vkCreateInstance Failure"); + } - gpu.getProperties(&gpu_props); + gpu.getProperties(&gpu_props); - /* Call with nullptr data to get count */ - gpu.getQueueFamilyProperties(&queue_family_count, nullptr); - assert(queue_family_count >= 1); + /* Call with nullptr data to get count */ + gpu.getQueueFamilyProperties(&queue_family_count, nullptr); + assert(queue_family_count >= 1); - queue_props.reset(new vk::QueueFamilyProperties[queue_family_count]); - gpu.getQueueFamilyProperties(&queue_family_count, queue_props.get()); + queue_props.reset(new vk::QueueFamilyProperties[queue_family_count]); + gpu.getQueueFamilyProperties(&queue_family_count, queue_props.get()); - // Query fine-grained feature support for this device. - // If app has specific feature requirements it should check supported - // features based on this query - vk::PhysicalDeviceFeatures physDevFeatures; - gpu.getFeatures(&physDevFeatures); - } + // Query fine-grained feature support for this device. + // If app has specific feature requirements it should check supported + // features based on this query + vk::PhysicalDeviceFeatures physDevFeatures; + gpu.getFeatures(&physDevFeatures); +} - void Demo::init_vk_swapchain() { - // Create a WSI surface for the window: +void Demo::init_vk_swapchain() { +// Create a WSI surface for the window: #if defined(VK_USE_PLATFORM_WIN32_KHR) - { - auto const createInfo = vk::Win32SurfaceCreateInfoKHR().setHinstance(connection).setHwnd(window); + { + auto const createInfo = vk::Win32SurfaceCreateInfoKHR().setHinstance(connection).setHwnd(window); - auto result = inst.createWin32SurfaceKHR(&createInfo, nullptr, &surface); - VERIFY(result == vk::Result::eSuccess); - } + auto result = inst.createWin32SurfaceKHR(&createInfo, nullptr, &surface); + VERIFY(result == vk::Result::eSuccess); + } #elif defined(VK_USE_PLATFORM_WAYLAND_KHR) - { - auto const createInfo = vk::WaylandSurfaceCreateInfoKHR().setDisplay(display).setSurface(window); + { + auto const createInfo = vk::WaylandSurfaceCreateInfoKHR().setDisplay(display).setSurface(window); - auto result = inst.createWaylandSurfaceKHR(&createInfo, nullptr, &surface); - VERIFY(result == vk::Result::eSuccess); - } + auto result = inst.createWaylandSurfaceKHR(&createInfo, nullptr, &surface); + VERIFY(result == vk::Result::eSuccess); + } #elif defined(VK_USE_PLATFORM_MIR_KHR) #elif defined(VK_USE_PLATFORM_XLIB_KHR) - { - auto const createInfo = vk::XlibSurfaceCreateInfoKHR().setDpy(display).setWindow(xlib_window); + { + auto const createInfo = vk::XlibSurfaceCreateInfoKHR().setDpy(display).setWindow(xlib_window); - auto result = inst.createXlibSurfaceKHR(&createInfo, nullptr, &surface); - VERIFY(result == vk::Result::eSuccess); - } + auto result = inst.createXlibSurfaceKHR(&createInfo, nullptr, &surface); + VERIFY(result == vk::Result::eSuccess); + } #elif defined(VK_USE_PLATFORM_XCB_KHR) - { - auto const createInfo = vk::XcbSurfaceCreateInfoKHR().setConnection(connection).setWindow(xcb_window); + { + auto const createInfo = vk::XcbSurfaceCreateInfoKHR().setConnection(connection).setWindow(xcb_window); - auto result = inst.createXcbSurfaceKHR(&createInfo, nullptr, &surface); - VERIFY(result == vk::Result::eSuccess); - } -#elif defined(VK_USE_PLATFORM_DISPLAY_KHR) - { - auto result = create_display_surface(); - VERIFY(result == vk::Result::eSuccess); - } -#endif - // Iterate over each queue to learn whether it supports presenting: - std::unique_ptr supportsPresent(new vk::Bool32[queue_family_count]); - for (uint32_t i = 0; i < queue_family_count; i++) { - gpu.getSurfaceSupportKHR(i, surface, &supportsPresent[i]); - } + auto result = inst.createXcbSurfaceKHR(&createInfo, nullptr, &surface); + VERIFY(result == vk::Result::eSuccess); + } +#elif defined(VK_USE_PLATFORM_IOS_MVK) + { + auto const createInfo = vk::IOSSurfaceCreateInfoMVK().setPView(nullptr); - uint32_t graphicsQueueFamilyIndex = UINT32_MAX; - uint32_t presentQueueFamilyIndex = UINT32_MAX; - for (uint32_t i = 0; i < queue_family_count; i++) { - if (queue_props[i].queueFlags & vk::QueueFlagBits::eGraphics) { - if (graphicsQueueFamilyIndex == UINT32_MAX) { - graphicsQueueFamilyIndex = i; - } + auto result = inst.createIOSSurfaceMVK(&createInfo, nullptr, &surface); + VERIFY(result == vk::Result::eSuccess); + } +#elif defined(VK_USE_PLATFORM_MACOS_MVK) + { + auto const createInfo = vk::MacOSSurfaceCreateInfoMVK().setPView(window); - if (supportsPresent[i] == VK_TRUE) { - graphicsQueueFamilyIndex = i; - presentQueueFamilyIndex = i; - break; - } + auto result = inst.createMacOSSurfaceMVK(&createInfo, nullptr, &surface); + VERIFY(result == vk::Result::eSuccess); + } +#elif defined(VK_USE_PLATFORM_DISPLAY_KHR) + { + auto result = create_display_surface(); + VERIFY(result == vk::Result::eSuccess); + } +#endif + // Iterate over each queue to learn whether it supports presenting: + std::unique_ptr supportsPresent(new vk::Bool32[queue_family_count]); + for (uint32_t i = 0; i < queue_family_count; i++) { + gpu.getSurfaceSupportKHR(i, surface, &supportsPresent[i]); + } + + uint32_t graphicsQueueFamilyIndex = UINT32_MAX; + uint32_t presentQueueFamilyIndex = UINT32_MAX; + for (uint32_t i = 0; i < queue_family_count; i++) { + if (queue_props[i].queueFlags & vk::QueueFlagBits::eGraphics) { + if (graphicsQueueFamilyIndex == UINT32_MAX) { + graphicsQueueFamilyIndex = i; + } + + if (supportsPresent[i] == VK_TRUE) { + graphicsQueueFamilyIndex = i; + presentQueueFamilyIndex = i; + break; } } + } - if (presentQueueFamilyIndex == UINT32_MAX) { - // If didn't find a queue that supports both graphics and present, - // then - // find a separate present queue. - for (uint32_t i = 0; i < queue_family_count; ++i) { - if (supportsPresent[i] == VK_TRUE) { - presentQueueFamilyIndex = i; - break; - } + if (presentQueueFamilyIndex == UINT32_MAX) { + // If didn't find a queue that supports both graphics and present, + // then + // find a separate present queue. + for (uint32_t i = 0; i < queue_family_count; ++i) { + if (supportsPresent[i] == VK_TRUE) { + presentQueueFamilyIndex = i; + break; } } + } - // Generate error if could not find both a graphics and a present queue - if (graphicsQueueFamilyIndex == UINT32_MAX || presentQueueFamilyIndex == UINT32_MAX) { - ERR_EXIT("Could not find both graphics and present queues\n", "Swapchain Initialization Failure"); - } + // Generate error if could not find both a graphics and a present queue + if (graphicsQueueFamilyIndex == UINT32_MAX || presentQueueFamilyIndex == UINT32_MAX) { + ERR_EXIT("Could not find both graphics and present queues\n", "Swapchain Initialization Failure"); + } - graphics_queue_family_index = graphicsQueueFamilyIndex; - present_queue_family_index = presentQueueFamilyIndex; - separate_present_queue = (graphics_queue_family_index != present_queue_family_index); + graphics_queue_family_index = graphicsQueueFamilyIndex; + present_queue_family_index = presentQueueFamilyIndex; + separate_present_queue = (graphics_queue_family_index != present_queue_family_index); - create_device(); + create_device(); - device.getQueue(graphics_queue_family_index, 0, &graphics_queue); - if (!separate_present_queue) { - present_queue = graphics_queue; - } else { - device.getQueue(present_queue_family_index, 0, &present_queue); - } + device.getQueue(graphics_queue_family_index, 0, &graphics_queue); + if (!separate_present_queue) { + present_queue = graphics_queue; + } else { + device.getQueue(present_queue_family_index, 0, &present_queue); + } + + // Get the list of VkFormat's that are supported: + uint32_t formatCount; + auto result = gpu.getSurfaceFormatsKHR(surface, &formatCount, nullptr); + VERIFY(result == vk::Result::eSuccess); + + std::unique_ptr surfFormats(new vk::SurfaceFormatKHR[formatCount]); + result = gpu.getSurfaceFormatsKHR(surface, &formatCount, surfFormats.get()); + VERIFY(result == vk::Result::eSuccess); + + // If the format list includes just one entry of VK_FORMAT_UNDEFINED, + // the surface has no preferred format. Otherwise, at least one + // supported format will be returned. + if (formatCount == 1 && surfFormats[0].format == vk::Format::eUndefined) { + format = vk::Format::eB8G8R8A8Unorm; + } else { + assert(formatCount >= 1); + format = surfFormats[0].format; + } + color_space = surfFormats[0].colorSpace; + + quit = false; + curFrame = 0; - // Get the list of VkFormat's that are supported: - uint32_t formatCount; - auto result = gpu.getSurfaceFormatsKHR(surface, &formatCount, nullptr); + // Create semaphores to synchronize acquiring presentable buffers before + // rendering and waiting for drawing to be complete before presenting + auto const semaphoreCreateInfo = vk::SemaphoreCreateInfo(); + + // Create fences that we can use to throttle if we get too far + // ahead of the image presents + auto const fence_ci = vk::FenceCreateInfo().setFlags(vk::FenceCreateFlagBits::eSignaled); + for (uint32_t i = 0; i < FRAME_LAG; i++) { + result = device.createFence(&fence_ci, nullptr, &fences[i]); VERIFY(result == vk::Result::eSuccess); - std::unique_ptr surfFormats(new vk::SurfaceFormatKHR[formatCount]); - result = gpu.getSurfaceFormatsKHR(surface, &formatCount, surfFormats.get()); + result = device.createSemaphore(&semaphoreCreateInfo, nullptr, &image_acquired_semaphores[i]); VERIFY(result == vk::Result::eSuccess); - // If the format list includes just one entry of VK_FORMAT_UNDEFINED, - // the surface has no preferred format. Otherwise, at least one - // supported format will be returned. - if (formatCount == 1 && surfFormats[0].format == vk::Format::eUndefined) { - format = vk::Format::eB8G8R8A8Unorm; - } else { - assert(formatCount >= 1); - format = surfFormats[0].format; + result = device.createSemaphore(&semaphoreCreateInfo, nullptr, &draw_complete_semaphores[i]); + VERIFY(result == vk::Result::eSuccess); + + if (separate_present_queue) { + result = device.createSemaphore(&semaphoreCreateInfo, nullptr, &image_ownership_semaphores[i]); + VERIFY(result == vk::Result::eSuccess); } - color_space = surfFormats[0].colorSpace; + } + frame_index = 0; - quit = false; - curFrame = 0; + // Get Memory information and properties + gpu.getMemoryProperties(&memory_properties); +} - // Create semaphores to synchronize acquiring presentable buffers before - // rendering and waiting for drawing to be complete before presenting - auto const semaphoreCreateInfo = vk::SemaphoreCreateInfo(); - - // Create fences that we can use to throttle if we get too far - // ahead of the image presents - auto const fence_ci = vk::FenceCreateInfo().setFlags(vk::FenceCreateFlagBits::eSignaled); - for (uint32_t i = 0; i < FRAME_LAG; i++) { - result = device.createFence(&fence_ci, nullptr, &fences[i]); - VERIFY(result == vk::Result::eSuccess); +void Demo::prepare() { + auto const cmd_pool_info = vk::CommandPoolCreateInfo().setQueueFamilyIndex(graphics_queue_family_index); + auto result = device.createCommandPool(&cmd_pool_info, nullptr, &cmd_pool); + VERIFY(result == vk::Result::eSuccess); - result = device.createSemaphore(&semaphoreCreateInfo, nullptr, &image_acquired_semaphores[i]); - VERIFY(result == vk::Result::eSuccess); + auto const cmd = vk::CommandBufferAllocateInfo() + .setCommandPool(cmd_pool) + .setLevel(vk::CommandBufferLevel::ePrimary) + .setCommandBufferCount(1); - result = device.createSemaphore(&semaphoreCreateInfo, nullptr, &draw_complete_semaphores[i]); - VERIFY(result == vk::Result::eSuccess); + result = device.allocateCommandBuffers(&cmd, &this->cmd); + VERIFY(result == vk::Result::eSuccess); - if (separate_present_queue) { - result = device.createSemaphore(&semaphoreCreateInfo, nullptr, &image_ownership_semaphores[i]); - VERIFY(result == vk::Result::eSuccess); - } - } - frame_index = 0; + auto const cmd_buf_info = vk::CommandBufferBeginInfo().setPInheritanceInfo(nullptr); - // Get Memory information and properties - gpu.getMemoryProperties(&memory_properties); - } + result = this->cmd.begin(&cmd_buf_info); + VERIFY(result == vk::Result::eSuccess); - void Demo::prepare() { - auto const cmd_pool_info = vk::CommandPoolCreateInfo().setQueueFamilyIndex(graphics_queue_family_index); - auto result = device.createCommandPool(&cmd_pool_info, nullptr, &cmd_pool); - VERIFY(result == vk::Result::eSuccess); + prepare_buffers(); + prepare_depth(); + prepare_textures(); + prepare_cube_data_buffers(); - auto const cmd = vk::CommandBufferAllocateInfo() - .setCommandPool(cmd_pool) - .setLevel(vk::CommandBufferLevel::ePrimary) - .setCommandBufferCount(1); + prepare_descriptor_layout(); + prepare_render_pass(); + prepare_pipeline(); - result = device.allocateCommandBuffers(&cmd, &this->cmd); + for (uint32_t i = 0; i < swapchainImageCount; ++i) { + result = device.allocateCommandBuffers(&cmd, &swapchain_image_resources[i].cmd); VERIFY(result == vk::Result::eSuccess); + } - auto const cmd_buf_info = vk::CommandBufferBeginInfo().setPInheritanceInfo(nullptr); + if (separate_present_queue) { + auto const present_cmd_pool_info = vk::CommandPoolCreateInfo().setQueueFamilyIndex(present_queue_family_index); - result = this->cmd.begin(&cmd_buf_info); + result = device.createCommandPool(&present_cmd_pool_info, nullptr, &present_cmd_pool); VERIFY(result == vk::Result::eSuccess); - prepare_buffers(); - prepare_depth(); - prepare_textures(); - prepare_cube_data_buffers(); + auto const present_cmd = vk::CommandBufferAllocateInfo() + .setCommandPool(present_cmd_pool) + .setLevel(vk::CommandBufferLevel::ePrimary) + .setCommandBufferCount(1); - prepare_descriptor_layout(); - prepare_render_pass(); - prepare_pipeline(); - - for (uint32_t i = 0; i < swapchainImageCount; ++i) { - result = device.allocateCommandBuffers(&cmd, &swapchain_image_resources[i].cmd); + for (uint32_t i = 0; i < swapchainImageCount; i++) { + result = device.allocateCommandBuffers(&present_cmd, &swapchain_image_resources[i].graphics_to_present_cmd); VERIFY(result == vk::Result::eSuccess); + + build_image_ownership_cmd(i); } + } - if (separate_present_queue) { - auto const present_cmd_pool_info = vk::CommandPoolCreateInfo().setQueueFamilyIndex(present_queue_family_index); + prepare_descriptor_pool(); + prepare_descriptor_set(); - result = device.createCommandPool(&present_cmd_pool_info, nullptr, &present_cmd_pool); - VERIFY(result == vk::Result::eSuccess); + prepare_framebuffers(); - auto const present_cmd = vk::CommandBufferAllocateInfo() - .setCommandPool(present_cmd_pool) - .setLevel(vk::CommandBufferLevel::ePrimary) - .setCommandBufferCount(1); + for (uint32_t i = 0; i < swapchainImageCount; ++i) { + current_buffer = i; + draw_build_cmd(swapchain_image_resources[i].cmd); + } - for (uint32_t i = 0; i < swapchainImageCount; i++) { - result = device.allocateCommandBuffers(&present_cmd, &swapchain_image_resources[i].graphics_to_present_cmd); - VERIFY(result == vk::Result::eSuccess); + /* + * Prepare functions above may generate pipeline commands + * that need to be flushed before beginning the render loop. + */ + flush_init_cmd(); + if (staging_texture.image) { + destroy_texture_image(&staging_texture); + } - build_image_ownership_cmd(i); - } - } - - prepare_descriptor_pool(); - prepare_descriptor_set(); + current_buffer = 0; + prepared = true; +} - prepare_framebuffers(); +void Demo::prepare_buffers() { + vk::SwapchainKHR oldSwapchain = swapchain; - for (uint32_t i = 0; i < swapchainImageCount; ++i) { - current_buffer = i; - draw_build_cmd(swapchain_image_resources[i].cmd); - } - - /* - * Prepare functions above may generate pipeline commands - * that need to be flushed before beginning the render loop. - */ - flush_init_cmd(); - if (staging_texture.image) { - destroy_texture_image(&staging_texture); + // Check the surface capabilities and formats + vk::SurfaceCapabilitiesKHR surfCapabilities; + auto result = gpu.getSurfaceCapabilitiesKHR(surface, &surfCapabilities); + VERIFY(result == vk::Result::eSuccess); + + uint32_t presentModeCount; + result = gpu.getSurfacePresentModesKHR(surface, &presentModeCount, nullptr); + VERIFY(result == vk::Result::eSuccess); + + std::unique_ptr presentModes(new vk::PresentModeKHR[presentModeCount]); + result = gpu.getSurfacePresentModesKHR(surface, &presentModeCount, presentModes.get()); + VERIFY(result == vk::Result::eSuccess); + + vk::Extent2D swapchainExtent; + // width and height are either both -1, or both not -1. + if (surfCapabilities.currentExtent.width == (uint32_t)-1) { + // If the surface size is undefined, the size is set to + // the size of the images requested. + swapchainExtent.width = width; + swapchainExtent.height = height; + } else { + // If the surface size is defined, the swap chain size must match + swapchainExtent = surfCapabilities.currentExtent; + width = surfCapabilities.currentExtent.width; + height = surfCapabilities.currentExtent.height; + } + + // The FIFO present mode is guaranteed by the spec to be supported + // and to have no tearing. It's a great default present mode to use. + vk::PresentModeKHR swapchainPresentMode = vk::PresentModeKHR::eFifo; + + // There are times when you may wish to use another present mode. The + // following code shows how to select them, and the comments provide some + // reasons you may wish to use them. + // + // It should be noted that Vulkan 1.0 doesn't provide a method for + // synchronizing rendering with the presentation engine's display. There + // is a method provided for throttling rendering with the display, but + // there are some presentation engines for which this method will not work. + // If an application doesn't throttle its rendering, and if it renders much + // faster than the refresh rate of the display, this can waste power on + // mobile devices. That is because power is being spent rendering images + // that may never be seen. + + // VK_PRESENT_MODE_IMMEDIATE_KHR is for applications that don't care + // about + // tearing, or have some way of synchronizing their rendering with the + // display. + // VK_PRESENT_MODE_MAILBOX_KHR may be useful for applications that + // generally render a new presentable image every refresh cycle, but are + // occasionally early. In this case, the application wants the new + // image + // to be displayed instead of the previously-queued-for-presentation + // image + // that has not yet been displayed. + // VK_PRESENT_MODE_FIFO_RELAXED_KHR is for applications that generally + // render a new presentable image every refresh cycle, but are + // occasionally + // late. In this case (perhaps because of stuttering/latency concerns), + // the application wants the late image to be immediately displayed, + // even + // though that may mean some tearing. + + if (presentMode != swapchainPresentMode) { + for (size_t i = 0; i < presentModeCount; ++i) { + if (presentModes[i] == presentMode) { + swapchainPresentMode = presentMode; + break; + } } - - current_buffer = 0; - prepared = true; } - void Demo::prepare_buffers() { - vk::SwapchainKHR oldSwapchain = swapchain; + if (swapchainPresentMode != presentMode) { + ERR_EXIT("Present mode specified is not supported\n", "Present mode unsupported"); + } - // Check the surface capabilities and formats - vk::SurfaceCapabilitiesKHR surfCapabilities; - auto result = gpu.getSurfaceCapabilitiesKHR(surface, &surfCapabilities); - VERIFY(result == vk::Result::eSuccess); + // Determine the number of VkImages to use in the swap chain. + // Application desires to acquire 3 images at a time for triple + // buffering + uint32_t desiredNumOfSwapchainImages = 3; + if (desiredNumOfSwapchainImages < surfCapabilities.minImageCount) { + desiredNumOfSwapchainImages = surfCapabilities.minImageCount; + } - uint32_t presentModeCount; - result = gpu.getSurfacePresentModesKHR(surface, &presentModeCount, nullptr); - VERIFY(result == vk::Result::eSuccess); + // If maxImageCount is 0, we can ask for as many images as we want, + // otherwise + // we're limited to maxImageCount + if ((surfCapabilities.maxImageCount > 0) && (desiredNumOfSwapchainImages > surfCapabilities.maxImageCount)) { + // Application must settle for fewer images than desired: + desiredNumOfSwapchainImages = surfCapabilities.maxImageCount; + } - std::unique_ptr presentModes(new vk::PresentModeKHR[presentModeCount]); - result = gpu.getSurfacePresentModesKHR(surface, &presentModeCount, presentModes.get()); - VERIFY(result == vk::Result::eSuccess); + vk::SurfaceTransformFlagBitsKHR preTransform; + if (surfCapabilities.supportedTransforms & vk::SurfaceTransformFlagBitsKHR::eIdentity) { + preTransform = vk::SurfaceTransformFlagBitsKHR::eIdentity; + } else { + preTransform = surfCapabilities.currentTransform; + } - vk::Extent2D swapchainExtent; - // width and height are either both -1, or both not -1. - if (surfCapabilities.currentExtent.width == (uint32_t)-1) { - // If the surface size is undefined, the size is set to - // the size of the images requested. - swapchainExtent.width = width; - swapchainExtent.height = height; - } else { - // If the surface size is defined, the swap chain size must match - swapchainExtent = surfCapabilities.currentExtent; - width = surfCapabilities.currentExtent.width; - height = surfCapabilities.currentExtent.height; - } - - // The FIFO present mode is guaranteed by the spec to be supported - // and to have no tearing. It's a great default present mode to use. - vk::PresentModeKHR swapchainPresentMode = vk::PresentModeKHR::eFifo; - - // There are times when you may wish to use another present mode. The - // following code shows how to select them, and the comments provide some - // reasons you may wish to use them. - // - // It should be noted that Vulkan 1.0 doesn't provide a method for - // synchronizing rendering with the presentation engine's display. There - // is a method provided for throttling rendering with the display, but - // there are some presentation engines for which this method will not work. - // If an application doesn't throttle its rendering, and if it renders much - // faster than the refresh rate of the display, this can waste power on - // mobile devices. That is because power is being spent rendering images - // that may never be seen. - - // VK_PRESENT_MODE_IMMEDIATE_KHR is for applications that don't care - // about - // tearing, or have some way of synchronizing their rendering with the - // display. - // VK_PRESENT_MODE_MAILBOX_KHR may be useful for applications that - // generally render a new presentable image every refresh cycle, but are - // occasionally early. In this case, the application wants the new - // image - // to be displayed instead of the previously-queued-for-presentation - // image - // that has not yet been displayed. - // VK_PRESENT_MODE_FIFO_RELAXED_KHR is for applications that generally - // render a new presentable image every refresh cycle, but are - // occasionally - // late. In this case (perhaps because of stuttering/latency concerns), - // the application wants the late image to be immediately displayed, - // even - // though that may mean some tearing. - - if (presentMode != swapchainPresentMode) { - for (size_t i = 0; i < presentModeCount; ++i) { - if (presentModes[i] == presentMode) { - swapchainPresentMode = presentMode; - break; - } - } + // Find a supported composite alpha mode - one of these is guaranteed to be set + vk::CompositeAlphaFlagBitsKHR compositeAlpha = vk::CompositeAlphaFlagBitsKHR::eOpaque; + vk::CompositeAlphaFlagBitsKHR compositeAlphaFlags[4] = { + vk::CompositeAlphaFlagBitsKHR::eOpaque, + vk::CompositeAlphaFlagBitsKHR::ePreMultiplied, + vk::CompositeAlphaFlagBitsKHR::ePostMultiplied, + vk::CompositeAlphaFlagBitsKHR::eInherit, + }; + for (uint32_t i = 0; i < ARRAY_SIZE(compositeAlphaFlags); i++) { + if (surfCapabilities.supportedCompositeAlpha & compositeAlphaFlags[i]) { + compositeAlpha = compositeAlphaFlags[i]; + break; } + } - if (swapchainPresentMode != presentMode) { - ERR_EXIT("Present mode specified is not supported\n", "Present mode unsupported"); - } + auto const swapchain_ci = vk::SwapchainCreateInfoKHR() + .setSurface(surface) + .setMinImageCount(desiredNumOfSwapchainImages) + .setImageFormat(format) + .setImageColorSpace(color_space) + .setImageExtent({swapchainExtent.width, swapchainExtent.height}) + .setImageArrayLayers(1) + .setImageUsage(vk::ImageUsageFlagBits::eColorAttachment) + .setImageSharingMode(vk::SharingMode::eExclusive) + .setQueueFamilyIndexCount(0) + .setPQueueFamilyIndices(nullptr) + .setPreTransform(preTransform) + .setCompositeAlpha(compositeAlpha) + .setPresentMode(swapchainPresentMode) + .setClipped(true) + .setOldSwapchain(oldSwapchain); + + result = device.createSwapchainKHR(&swapchain_ci, nullptr, &swapchain); + VERIFY(result == vk::Result::eSuccess); + + // If we just re-created an existing swapchain, we should destroy the + // old + // swapchain at this point. + // Note: destroying the swapchain also cleans up all its associated + // presentable images once the platform is done with them. + if (oldSwapchain) { + device.destroySwapchainKHR(oldSwapchain, nullptr); + } + + result = device.getSwapchainImagesKHR(swapchain, &swapchainImageCount, nullptr); + VERIFY(result == vk::Result::eSuccess); + + std::unique_ptr swapchainImages(new vk::Image[swapchainImageCount]); + result = device.getSwapchainImagesKHR(swapchain, &swapchainImageCount, swapchainImages.get()); + VERIFY(result == vk::Result::eSuccess); + + swapchain_image_resources.reset(new SwapchainImageResources[swapchainImageCount]); + + for (uint32_t i = 0; i < swapchainImageCount; ++i) { + auto color_image_view = vk::ImageViewCreateInfo() + .setViewType(vk::ImageViewType::e2D) + .setFormat(format) + .setSubresourceRange(vk::ImageSubresourceRange(vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1)); - // Determine the number of VkImages to use in the swap chain. - // Application desires to acquire 3 images at a time for triple - // buffering - uint32_t desiredNumOfSwapchainImages = 3; - if (desiredNumOfSwapchainImages < surfCapabilities.minImageCount) { - desiredNumOfSwapchainImages = surfCapabilities.minImageCount; - } + swapchain_image_resources[i].image = swapchainImages[i]; - // If maxImageCount is 0, we can ask for as many images as we want, - // otherwise - // we're limited to maxImageCount - if ((surfCapabilities.maxImageCount > 0) && (desiredNumOfSwapchainImages > surfCapabilities.maxImageCount)) { - // Application must settle for fewer images than desired: - desiredNumOfSwapchainImages = surfCapabilities.maxImageCount; - } + color_image_view.image = swapchain_image_resources[i].image; - vk::SurfaceTransformFlagBitsKHR preTransform; - if (surfCapabilities.supportedTransforms & vk::SurfaceTransformFlagBitsKHR::eIdentity) { - preTransform = vk::SurfaceTransformFlagBitsKHR::eIdentity; - } else { - preTransform = surfCapabilities.currentTransform; - } + result = device.createImageView(&color_image_view, nullptr, &swapchain_image_resources[i].view); + VERIFY(result == vk::Result::eSuccess); + } +} - // Find a supported composite alpha mode - one of these is guaranteed to be set - vk::CompositeAlphaFlagBitsKHR compositeAlpha = vk::CompositeAlphaFlagBitsKHR::eOpaque; - vk::CompositeAlphaFlagBitsKHR compositeAlphaFlags[4] = { - vk::CompositeAlphaFlagBitsKHR::eOpaque, - vk::CompositeAlphaFlagBitsKHR::ePreMultiplied, - vk::CompositeAlphaFlagBitsKHR::ePostMultiplied, - vk::CompositeAlphaFlagBitsKHR::eInherit, - }; - for (uint32_t i = 0; i < ARRAY_SIZE(compositeAlphaFlags); i++) { - if (surfCapabilities.supportedCompositeAlpha & compositeAlphaFlags[i]) { - compositeAlpha = compositeAlphaFlags[i]; - break; - } - } +void Demo::prepare_cube_data_buffers() { + mat4x4 VP; + mat4x4_mul(VP, projection_matrix, view_matrix); + + mat4x4 MVP; + mat4x4_mul(MVP, VP, model_matrix); + + vktexcube_vs_uniform data; + memcpy(data.mvp, MVP, sizeof(MVP)); + // dumpMatrix("MVP", MVP) + + for (int32_t i = 0; i < 12 * 3; i++) { + data.position[i][0] = g_vertex_buffer_data[i * 3]; + data.position[i][1] = g_vertex_buffer_data[i * 3 + 1]; + data.position[i][2] = g_vertex_buffer_data[i * 3 + 2]; + data.position[i][3] = 1.0f; + data.attr[i][0] = g_uv_buffer_data[2 * i]; + data.attr[i][1] = g_uv_buffer_data[2 * i + 1]; + data.attr[i][2] = 0; + data.attr[i][3] = 0; + } - auto const swapchain_ci = vk::SwapchainCreateInfoKHR() - .setSurface(surface) - .setMinImageCount(desiredNumOfSwapchainImages) - .setImageFormat(format) - .setImageColorSpace(color_space) - .setImageExtent({swapchainExtent.width, swapchainExtent.height}) - .setImageArrayLayers(1) - .setImageUsage(vk::ImageUsageFlagBits::eColorAttachment) - .setImageSharingMode(vk::SharingMode::eExclusive) - .setQueueFamilyIndexCount(0) - .setPQueueFamilyIndices(nullptr) - .setPreTransform(preTransform) - .setCompositeAlpha(compositeAlpha) - .setPresentMode(swapchainPresentMode) - .setClipped(true) - .setOldSwapchain(oldSwapchain); + auto const buf_info = vk::BufferCreateInfo().setSize(sizeof(data)).setUsage(vk::BufferUsageFlagBits::eUniformBuffer); - result = device.createSwapchainKHR(&swapchain_ci, nullptr, &swapchain); + for (unsigned int i = 0; i < swapchainImageCount; i++) { + auto result = device.createBuffer(&buf_info, nullptr, &swapchain_image_resources[i].uniform_buffer); VERIFY(result == vk::Result::eSuccess); - // If we just re-created an existing swapchain, we should destroy the - // old - // swapchain at this point. - // Note: destroying the swapchain also cleans up all its associated - // presentable images once the platform is done with them. - if (oldSwapchain) { - device.destroySwapchainKHR(oldSwapchain, nullptr); - } + vk::MemoryRequirements mem_reqs; + device.getBufferMemoryRequirements(swapchain_image_resources[i].uniform_buffer, &mem_reqs); - result = device.getSwapchainImagesKHR(swapchain, &swapchainImageCount, nullptr); - VERIFY(result == vk::Result::eSuccess); + auto mem_alloc = vk::MemoryAllocateInfo().setAllocationSize(mem_reqs.size).setMemoryTypeIndex(0); - std::unique_ptr swapchainImages(new vk::Image[swapchainImageCount]); - result = device.getSwapchainImagesKHR(swapchain, &swapchainImageCount, swapchainImages.get()); - VERIFY(result == vk::Result::eSuccess); + bool const pass = memory_type_from_properties( + mem_reqs.memoryTypeBits, vk::MemoryPropertyFlagBits::eHostVisible | vk::MemoryPropertyFlagBits::eHostCoherent, + &mem_alloc.memoryTypeIndex); + VERIFY(pass); - swapchain_image_resources.reset(new SwapchainImageResources[swapchainImageCount]); + result = device.allocateMemory(&mem_alloc, nullptr, &swapchain_image_resources[i].uniform_memory); + VERIFY(result == vk::Result::eSuccess); - for (uint32_t i = 0; i < swapchainImageCount; ++i) { - auto color_image_view = - vk::ImageViewCreateInfo() - .setViewType(vk::ImageViewType::e2D) - .setFormat(format) - .setSubresourceRange(vk::ImageSubresourceRange(vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1)); + auto pData = device.mapMemory(swapchain_image_resources[i].uniform_memory, 0, VK_WHOLE_SIZE, vk::MemoryMapFlags()); + VERIFY(pData.result == vk::Result::eSuccess); - swapchain_image_resources[i].image = swapchainImages[i]; + memcpy(pData.value, &data, sizeof data); - color_image_view.image = swapchain_image_resources[i].image; + device.unmapMemory(swapchain_image_resources[i].uniform_memory); - result = device.createImageView(&color_image_view, nullptr, &swapchain_image_resources[i].view); - VERIFY(result == vk::Result::eSuccess); - } + result = + device.bindBufferMemory(swapchain_image_resources[i].uniform_buffer, swapchain_image_resources[i].uniform_memory, 0); + VERIFY(result == vk::Result::eSuccess); } +} - void Demo::prepare_cube_data_buffers() { - mat4x4 VP; - mat4x4_mul(VP, projection_matrix, view_matrix); - - mat4x4 MVP; - mat4x4_mul(MVP, VP, model_matrix); - - vktexcube_vs_uniform data; - memcpy(data.mvp, MVP, sizeof(MVP)); - // dumpMatrix("MVP", MVP) - - for (int32_t i = 0; i < 12 * 3; i++) { - data.position[i][0] = g_vertex_buffer_data[i * 3]; - data.position[i][1] = g_vertex_buffer_data[i * 3 + 1]; - data.position[i][2] = g_vertex_buffer_data[i * 3 + 2]; - data.position[i][3] = 1.0f; - data.attr[i][0] = g_uv_buffer_data[2 * i]; - data.attr[i][1] = g_uv_buffer_data[2 * i + 1]; - data.attr[i][2] = 0; - data.attr[i][3] = 0; - } - - auto const buf_info = vk::BufferCreateInfo().setSize(sizeof(data)).setUsage(vk::BufferUsageFlagBits::eUniformBuffer); - - for (unsigned int i = 0; i < swapchainImageCount; i++) { - auto result = device.createBuffer(&buf_info, nullptr, &swapchain_image_resources[i].uniform_buffer); - VERIFY(result == vk::Result::eSuccess); +void Demo::prepare_depth() { + depth.format = vk::Format::eD16Unorm; - vk::MemoryRequirements mem_reqs; - device.getBufferMemoryRequirements(swapchain_image_resources[i].uniform_buffer, &mem_reqs); + auto const image = vk::ImageCreateInfo() + .setImageType(vk::ImageType::e2D) + .setFormat(depth.format) + .setExtent({(uint32_t)width, (uint32_t)height, 1}) + .setMipLevels(1) + .setArrayLayers(1) + .setSamples(vk::SampleCountFlagBits::e1) + .setTiling(vk::ImageTiling::eOptimal) + .setUsage(vk::ImageUsageFlagBits::eDepthStencilAttachment) + .setSharingMode(vk::SharingMode::eExclusive) + .setQueueFamilyIndexCount(0) + .setPQueueFamilyIndices(nullptr) + .setInitialLayout(vk::ImageLayout::eUndefined); + + auto result = device.createImage(&image, nullptr, &depth.image); + VERIFY(result == vk::Result::eSuccess); + + vk::MemoryRequirements mem_reqs; + device.getImageMemoryRequirements(depth.image, &mem_reqs); + + depth.mem_alloc.setAllocationSize(mem_reqs.size); + depth.mem_alloc.setMemoryTypeIndex(0); + + auto const pass = memory_type_from_properties(mem_reqs.memoryTypeBits, vk::MemoryPropertyFlagBits::eDeviceLocal, + &depth.mem_alloc.memoryTypeIndex); + VERIFY(pass); + + result = device.allocateMemory(&depth.mem_alloc, nullptr, &depth.mem); + VERIFY(result == vk::Result::eSuccess); + + result = device.bindImageMemory(depth.image, depth.mem, 0); + VERIFY(result == vk::Result::eSuccess); + + auto const view = vk::ImageViewCreateInfo() + .setImage(depth.image) + .setViewType(vk::ImageViewType::e2D) + .setFormat(depth.format) + .setSubresourceRange(vk::ImageSubresourceRange(vk::ImageAspectFlagBits::eDepth, 0, 1, 0, 1)); + result = device.createImageView(&view, nullptr, &depth.view); + VERIFY(result == vk::Result::eSuccess); +} - auto mem_alloc = vk::MemoryAllocateInfo().setAllocationSize(mem_reqs.size).setMemoryTypeIndex(0); +void Demo::prepare_descriptor_layout() { + vk::DescriptorSetLayoutBinding const layout_bindings[2] = {vk::DescriptorSetLayoutBinding() + .setBinding(0) + .setDescriptorType(vk::DescriptorType::eUniformBuffer) + .setDescriptorCount(1) + .setStageFlags(vk::ShaderStageFlagBits::eVertex) + .setPImmutableSamplers(nullptr), + vk::DescriptorSetLayoutBinding() + .setBinding(1) + .setDescriptorType(vk::DescriptorType::eCombinedImageSampler) + .setDescriptorCount(texture_count) + .setStageFlags(vk::ShaderStageFlagBits::eFragment) + .setPImmutableSamplers(nullptr)}; + + auto const descriptor_layout = vk::DescriptorSetLayoutCreateInfo().setBindingCount(2).setPBindings(layout_bindings); - bool const pass = memory_type_from_properties( - mem_reqs.memoryTypeBits, vk::MemoryPropertyFlagBits::eHostVisible | vk::MemoryPropertyFlagBits::eHostCoherent, - &mem_alloc.memoryTypeIndex); - VERIFY(pass); + auto result = device.createDescriptorSetLayout(&descriptor_layout, nullptr, &desc_layout); + VERIFY(result == vk::Result::eSuccess); - result = device.allocateMemory(&mem_alloc, nullptr, &swapchain_image_resources[i].uniform_memory); - VERIFY(result == vk::Result::eSuccess); + auto const pPipelineLayoutCreateInfo = vk::PipelineLayoutCreateInfo().setSetLayoutCount(1).setPSetLayouts(&desc_layout); - auto pData = device.mapMemory(swapchain_image_resources[i].uniform_memory, 0, VK_WHOLE_SIZE, vk::MemoryMapFlags()); - VERIFY(pData.result == vk::Result::eSuccess); + result = device.createPipelineLayout(&pPipelineLayoutCreateInfo, nullptr, &pipeline_layout); + VERIFY(result == vk::Result::eSuccess); +} - memcpy(pData.value, &data, sizeof data); +void Demo::prepare_descriptor_pool() { + vk::DescriptorPoolSize const poolSizes[2] = { + vk::DescriptorPoolSize().setType(vk::DescriptorType::eUniformBuffer).setDescriptorCount(swapchainImageCount), + vk::DescriptorPoolSize() + .setType(vk::DescriptorType::eCombinedImageSampler) + .setDescriptorCount(swapchainImageCount * texture_count)}; - device.unmapMemory(swapchain_image_resources[i].uniform_memory); + auto const descriptor_pool = + vk::DescriptorPoolCreateInfo().setMaxSets(swapchainImageCount).setPoolSizeCount(2).setPPoolSizes(poolSizes); - result = device.bindBufferMemory(swapchain_image_resources[i].uniform_buffer, swapchain_image_resources[i].uniform_memory, 0); - VERIFY(result == vk::Result::eSuccess); - } - } + auto result = device.createDescriptorPool(&descriptor_pool, nullptr, &desc_pool); + VERIFY(result == vk::Result::eSuccess); +} - void Demo::prepare_depth() { - depth.format = vk::Format::eD16Unorm; +void Demo::prepare_descriptor_set() { + auto const alloc_info = + vk::DescriptorSetAllocateInfo().setDescriptorPool(desc_pool).setDescriptorSetCount(1).setPSetLayouts(&desc_layout); - auto const image = vk::ImageCreateInfo() - .setImageType(vk::ImageType::e2D) - .setFormat(depth.format) - .setExtent({(uint32_t)width, (uint32_t)height, 1}) - .setMipLevels(1) - .setArrayLayers(1) - .setSamples(vk::SampleCountFlagBits::e1) - .setTiling(vk::ImageTiling::eOptimal) - .setUsage(vk::ImageUsageFlagBits::eDepthStencilAttachment) - .setSharingMode(vk::SharingMode::eExclusive) - .setQueueFamilyIndexCount(0) - .setPQueueFamilyIndices(nullptr) - .setInitialLayout(vk::ImageLayout::eUndefined); + auto buffer_info = vk::DescriptorBufferInfo().setOffset(0).setRange(sizeof(struct vktexcube_vs_uniform)); - auto result = device.createImage(&image, nullptr, &depth.image); - VERIFY(result == vk::Result::eSuccess); + vk::DescriptorImageInfo tex_descs[texture_count]; + for (uint32_t i = 0; i < texture_count; i++) { + tex_descs[i].setSampler(textures[i].sampler); + tex_descs[i].setImageView(textures[i].view); + tex_descs[i].setImageLayout(vk::ImageLayout::eGeneral); + } - vk::MemoryRequirements mem_reqs; - device.getImageMemoryRequirements(depth.image, &mem_reqs); + vk::WriteDescriptorSet writes[2]; - depth.mem_alloc.setAllocationSize(mem_reqs.size); - depth.mem_alloc.setMemoryTypeIndex(0); + writes[0].setDescriptorCount(1); + writes[0].setDescriptorType(vk::DescriptorType::eUniformBuffer); + writes[0].setPBufferInfo(&buffer_info); - auto const pass = memory_type_from_properties(mem_reqs.memoryTypeBits, vk::MemoryPropertyFlagBits::eDeviceLocal, - &depth.mem_alloc.memoryTypeIndex); - VERIFY(pass); + writes[1].setDstBinding(1); + writes[1].setDescriptorCount(texture_count); + writes[1].setDescriptorType(vk::DescriptorType::eCombinedImageSampler); + writes[1].setPImageInfo(tex_descs); - result = device.allocateMemory(&depth.mem_alloc, nullptr, &depth.mem); + for (unsigned int i = 0; i < swapchainImageCount; i++) { + auto result = device.allocateDescriptorSets(&alloc_info, &swapchain_image_resources[i].descriptor_set); VERIFY(result == vk::Result::eSuccess); - result = device.bindImageMemory(depth.image, depth.mem, 0); - VERIFY(result == vk::Result::eSuccess); + buffer_info.setBuffer(swapchain_image_resources[i].uniform_buffer); + writes[0].setDstSet(swapchain_image_resources[i].descriptor_set); + writes[1].setDstSet(swapchain_image_resources[i].descriptor_set); + device.updateDescriptorSets(2, writes, 0, nullptr); + } +} - auto const view = vk::ImageViewCreateInfo() - .setImage(depth.image) - .setViewType(vk::ImageViewType::e2D) - .setFormat(depth.format) - .setSubresourceRange(vk::ImageSubresourceRange(vk::ImageAspectFlagBits::eDepth, 0, 1, 0, 1)); - result = device.createImageView(&view, nullptr, &depth.view); +void Demo::prepare_framebuffers() { + vk::ImageView attachments[2]; + attachments[1] = depth.view; + + auto const fb_info = vk::FramebufferCreateInfo() + .setRenderPass(render_pass) + .setAttachmentCount(2) + .setPAttachments(attachments) + .setWidth((uint32_t)width) + .setHeight((uint32_t)height) + .setLayers(1); + + for (uint32_t i = 0; i < swapchainImageCount; i++) { + attachments[0] = swapchain_image_resources[i].view; + auto const result = device.createFramebuffer(&fb_info, nullptr, &swapchain_image_resources[i].framebuffer); VERIFY(result == vk::Result::eSuccess); } +} - void Demo::prepare_descriptor_layout() { - vk::DescriptorSetLayoutBinding const layout_bindings[2] = {vk::DescriptorSetLayoutBinding() - .setBinding(0) - .setDescriptorType(vk::DescriptorType::eUniformBuffer) - .setDescriptorCount(1) - .setStageFlags(vk::ShaderStageFlagBits::eVertex) - .setPImmutableSamplers(nullptr), - vk::DescriptorSetLayoutBinding() - .setBinding(1) - .setDescriptorType(vk::DescriptorType::eCombinedImageSampler) - .setDescriptorCount(texture_count) - .setStageFlags(vk::ShaderStageFlagBits::eFragment) - .setPImmutableSamplers(nullptr)}; - - auto const descriptor_layout = vk::DescriptorSetLayoutCreateInfo().setBindingCount(2).setPBindings(layout_bindings); - - auto result = device.createDescriptorSetLayout(&descriptor_layout, nullptr, &desc_layout); - VERIFY(result == vk::Result::eSuccess); +vk::ShaderModule Demo::prepare_fs() { + const uint32_t fragShaderCode[] = { +#include "cube.frag.inc" + }; - auto const pPipelineLayoutCreateInfo = vk::PipelineLayoutCreateInfo().setSetLayoutCount(1).setPSetLayouts(&desc_layout); + frag_shader_module = prepare_shader_module(fragShaderCode, sizeof(fragShaderCode)); - result = device.createPipelineLayout(&pPipelineLayoutCreateInfo, nullptr, &pipeline_layout); - VERIFY(result == vk::Result::eSuccess); - } + return frag_shader_module; +} - void Demo::prepare_descriptor_pool() { - vk::DescriptorPoolSize const poolSizes[2] = { - vk::DescriptorPoolSize().setType(vk::DescriptorType::eUniformBuffer).setDescriptorCount(swapchainImageCount), - vk::DescriptorPoolSize().setType(vk::DescriptorType::eCombinedImageSampler).setDescriptorCount(swapchainImageCount * texture_count)}; +void Demo::prepare_pipeline() { + vk::PipelineCacheCreateInfo const pipelineCacheInfo; + auto result = device.createPipelineCache(&pipelineCacheInfo, nullptr, &pipelineCache); + VERIFY(result == vk::Result::eSuccess); + + vk::PipelineShaderStageCreateInfo const shaderStageInfo[2] = { + vk::PipelineShaderStageCreateInfo().setStage(vk::ShaderStageFlagBits::eVertex).setModule(prepare_vs()).setPName("main"), + vk::PipelineShaderStageCreateInfo().setStage(vk::ShaderStageFlagBits::eFragment).setModule(prepare_fs()).setPName("main")}; + + vk::PipelineVertexInputStateCreateInfo const vertexInputInfo; + + auto const inputAssemblyInfo = vk::PipelineInputAssemblyStateCreateInfo().setTopology(vk::PrimitiveTopology::eTriangleList); + + // TODO: Where are pViewports and pScissors set? + auto const viewportInfo = vk::PipelineViewportStateCreateInfo().setViewportCount(1).setScissorCount(1); + + auto const rasterizationInfo = vk::PipelineRasterizationStateCreateInfo() + .setDepthClampEnable(VK_FALSE) + .setRasterizerDiscardEnable(VK_FALSE) + .setPolygonMode(vk::PolygonMode::eFill) + .setCullMode(vk::CullModeFlagBits::eBack) + .setFrontFace(vk::FrontFace::eCounterClockwise) + .setDepthBiasEnable(VK_FALSE) + .setLineWidth(1.0f); + + auto const multisampleInfo = vk::PipelineMultisampleStateCreateInfo(); + + auto const stencilOp = + vk::StencilOpState().setFailOp(vk::StencilOp::eKeep).setPassOp(vk::StencilOp::eKeep).setCompareOp(vk::CompareOp::eAlways); + + auto const depthStencilInfo = vk::PipelineDepthStencilStateCreateInfo() + .setDepthTestEnable(VK_TRUE) + .setDepthWriteEnable(VK_TRUE) + .setDepthCompareOp(vk::CompareOp::eLessOrEqual) + .setDepthBoundsTestEnable(VK_FALSE) + .setStencilTestEnable(VK_FALSE) + .setFront(stencilOp) + .setBack(stencilOp); + + vk::PipelineColorBlendAttachmentState const colorBlendAttachments[1] = { + vk::PipelineColorBlendAttachmentState().setColorWriteMask(vk::ColorComponentFlagBits::eR | vk::ColorComponentFlagBits::eG | + vk::ColorComponentFlagBits::eB | vk::ColorComponentFlagBits::eA)}; + + auto const colorBlendInfo = + vk::PipelineColorBlendStateCreateInfo().setAttachmentCount(1).setPAttachments(colorBlendAttachments); + + vk::DynamicState const dynamicStates[2] = {vk::DynamicState::eViewport, vk::DynamicState::eScissor}; + + auto const dynamicStateInfo = vk::PipelineDynamicStateCreateInfo().setPDynamicStates(dynamicStates).setDynamicStateCount(2); + + auto const pipeline = vk::GraphicsPipelineCreateInfo() + .setStageCount(2) + .setPStages(shaderStageInfo) + .setPVertexInputState(&vertexInputInfo) + .setPInputAssemblyState(&inputAssemblyInfo) + .setPViewportState(&viewportInfo) + .setPRasterizationState(&rasterizationInfo) + .setPMultisampleState(&multisampleInfo) + .setPDepthStencilState(&depthStencilInfo) + .setPColorBlendState(&colorBlendInfo) + .setPDynamicState(&dynamicStateInfo) + .setLayout(pipeline_layout) + .setRenderPass(render_pass); - auto const descriptor_pool = vk::DescriptorPoolCreateInfo().setMaxSets(swapchainImageCount).setPoolSizeCount(2).setPPoolSizes(poolSizes); + result = device.createGraphicsPipelines(pipelineCache, 1, &pipeline, nullptr, &this->pipeline); + VERIFY(result == vk::Result::eSuccess); - auto result = device.createDescriptorPool(&descriptor_pool, nullptr, &desc_pool); - VERIFY(result == vk::Result::eSuccess); - } + device.destroyShaderModule(frag_shader_module, nullptr); + device.destroyShaderModule(vert_shader_module, nullptr); +} - void Demo::prepare_descriptor_set() { - auto const alloc_info = - vk::DescriptorSetAllocateInfo().setDescriptorPool(desc_pool).setDescriptorSetCount(1).setPSetLayouts(&desc_layout); +void Demo::prepare_render_pass() { + // The initial layout for the color and depth attachments will be LAYOUT_UNDEFINED + // because at the start of the renderpass, we don't care about their contents. + // At the start of the subpass, the color attachment's layout will be transitioned + // to LAYOUT_COLOR_ATTACHMENT_OPTIMAL and the depth stencil attachment's layout + // will be transitioned to LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL. At the end of + // the renderpass, the color attachment's layout will be transitioned to + // LAYOUT_PRESENT_SRC_KHR to be ready to present. This is all done as part of + // the renderpass, no barriers are necessary. + const vk::AttachmentDescription attachments[2] = {vk::AttachmentDescription() + .setFormat(format) + .setSamples(vk::SampleCountFlagBits::e1) + .setLoadOp(vk::AttachmentLoadOp::eClear) + .setStoreOp(vk::AttachmentStoreOp::eStore) + .setStencilLoadOp(vk::AttachmentLoadOp::eDontCare) + .setStencilStoreOp(vk::AttachmentStoreOp::eDontCare) + .setInitialLayout(vk::ImageLayout::eUndefined) + .setFinalLayout(vk::ImageLayout::ePresentSrcKHR), + vk::AttachmentDescription() + .setFormat(depth.format) + .setSamples(vk::SampleCountFlagBits::e1) + .setLoadOp(vk::AttachmentLoadOp::eClear) + .setStoreOp(vk::AttachmentStoreOp::eDontCare) + .setStencilLoadOp(vk::AttachmentLoadOp::eDontCare) + .setStencilStoreOp(vk::AttachmentStoreOp::eDontCare) + .setInitialLayout(vk::ImageLayout::eUndefined) + .setFinalLayout(vk::ImageLayout::eDepthStencilAttachmentOptimal)}; + + auto const color_reference = vk::AttachmentReference().setAttachment(0).setLayout(vk::ImageLayout::eColorAttachmentOptimal); + + auto const depth_reference = + vk::AttachmentReference().setAttachment(1).setLayout(vk::ImageLayout::eDepthStencilAttachmentOptimal); + + auto const subpass = vk::SubpassDescription() + .setPipelineBindPoint(vk::PipelineBindPoint::eGraphics) + .setInputAttachmentCount(0) + .setPInputAttachments(nullptr) + .setColorAttachmentCount(1) + .setPColorAttachments(&color_reference) + .setPResolveAttachments(nullptr) + .setPDepthStencilAttachment(&depth_reference) + .setPreserveAttachmentCount(0) + .setPPreserveAttachments(nullptr); + + auto const rp_info = vk::RenderPassCreateInfo() + .setAttachmentCount(2) + .setPAttachments(attachments) + .setSubpassCount(1) + .setPSubpasses(&subpass) + .setDependencyCount(0) + .setPDependencies(nullptr); - auto buffer_info = vk::DescriptorBufferInfo().setOffset(0).setRange(sizeof(struct vktexcube_vs_uniform)); + auto result = device.createRenderPass(&rp_info, nullptr, &render_pass); + VERIFY(result == vk::Result::eSuccess); +} - vk::DescriptorImageInfo tex_descs[texture_count]; - for (uint32_t i = 0; i < texture_count; i++) { - tex_descs[i].setSampler(textures[i].sampler); - tex_descs[i].setImageView(textures[i].view); - tex_descs[i].setImageLayout(vk::ImageLayout::eGeneral); - } +vk::ShaderModule Demo::prepare_shader_module(const uint32_t *code, size_t size) { + const auto moduleCreateInfo = vk::ShaderModuleCreateInfo().setCodeSize(size).setPCode(code); - vk::WriteDescriptorSet writes[2]; + vk::ShaderModule module; + auto result = device.createShaderModule(&moduleCreateInfo, nullptr, &module); + VERIFY(result == vk::Result::eSuccess); - writes[0].setDescriptorCount(1); - writes[0].setDescriptorType(vk::DescriptorType::eUniformBuffer); - writes[0].setPBufferInfo(&buffer_info); + return module; +} - writes[1].setDstBinding(1); - writes[1].setDescriptorCount(texture_count); - writes[1].setDescriptorType(vk::DescriptorType::eCombinedImageSampler); - writes[1].setPImageInfo(tex_descs); +void Demo::prepare_texture_image(const char *filename, texture_object *tex_obj, vk::ImageTiling tiling, vk::ImageUsageFlags usage, + vk::MemoryPropertyFlags required_props) { + int32_t tex_width; + int32_t tex_height; + if (!loadTexture(filename, nullptr, nullptr, &tex_width, &tex_height)) { + ERR_EXIT("Failed to load textures", "Load Texture Failure"); + } + + tex_obj->tex_width = tex_width; + tex_obj->tex_height = tex_height; + + auto const image_create_info = vk::ImageCreateInfo() + .setImageType(vk::ImageType::e2D) + .setFormat(vk::Format::eR8G8B8A8Unorm) + .setExtent({(uint32_t)tex_width, (uint32_t)tex_height, 1}) + .setMipLevels(1) + .setArrayLayers(1) + .setSamples(vk::SampleCountFlagBits::e1) + .setTiling(tiling) + .setUsage(usage) + .setSharingMode(vk::SharingMode::eExclusive) + .setQueueFamilyIndexCount(0) + .setPQueueFamilyIndices(nullptr) + .setInitialLayout(vk::ImageLayout::ePreinitialized); + + auto result = device.createImage(&image_create_info, nullptr, &tex_obj->image); + VERIFY(result == vk::Result::eSuccess); + + vk::MemoryRequirements mem_reqs; + device.getImageMemoryRequirements(tex_obj->image, &mem_reqs); + + tex_obj->mem_alloc.setAllocationSize(mem_reqs.size); + tex_obj->mem_alloc.setMemoryTypeIndex(0); + + auto pass = memory_type_from_properties(mem_reqs.memoryTypeBits, required_props, &tex_obj->mem_alloc.memoryTypeIndex); + VERIFY(pass == true); + + result = device.allocateMemory(&tex_obj->mem_alloc, nullptr, &(tex_obj->mem)); + VERIFY(result == vk::Result::eSuccess); + + result = device.bindImageMemory(tex_obj->image, tex_obj->mem, 0); + VERIFY(result == vk::Result::eSuccess); + + if (required_props & vk::MemoryPropertyFlagBits::eHostVisible) { + auto const subres = vk::ImageSubresource().setAspectMask(vk::ImageAspectFlagBits::eColor).setMipLevel(0).setArrayLayer(0); + vk::SubresourceLayout layout; + device.getImageSubresourceLayout(tex_obj->image, &subres, &layout); - for (unsigned int i = 0; i < swapchainImageCount; i++) { - auto result = device.allocateDescriptorSets(&alloc_info, &swapchain_image_resources[i].descriptor_set); - VERIFY(result == vk::Result::eSuccess); + auto data = device.mapMemory(tex_obj->mem, 0, tex_obj->mem_alloc.allocationSize); + VERIFY(data.result == vk::Result::eSuccess); - buffer_info.setBuffer(swapchain_image_resources[i].uniform_buffer); - writes[0].setDstSet(swapchain_image_resources[i].descriptor_set); - writes[1].setDstSet(swapchain_image_resources[i].descriptor_set); - device.updateDescriptorSets(2, writes, 0, nullptr); + if (!loadTexture(filename, (uint8_t *)data.value, &layout, &tex_width, &tex_height)) { + fprintf(stderr, "Error loading texture: %s\n", filename); } + + device.unmapMemory(tex_obj->mem); } - void Demo::prepare_framebuffers() { - vk::ImageView attachments[2]; - attachments[1] = depth.view; - - auto const fb_info = vk::FramebufferCreateInfo() - .setRenderPass(render_pass) - .setAttachmentCount(2) - .setPAttachments(attachments) - .setWidth((uint32_t)width) - .setHeight((uint32_t)height) - .setLayers(1); + tex_obj->imageLayout = vk::ImageLayout::eShaderReadOnlyOptimal; +} - for (uint32_t i = 0; i < swapchainImageCount; i++) { - attachments[0] = swapchain_image_resources[i].view; - auto const result = device.createFramebuffer(&fb_info, nullptr, &swapchain_image_resources[i].framebuffer); - VERIFY(result == vk::Result::eSuccess); +void Demo::prepare_textures() { + vk::Format const tex_format = vk::Format::eR8G8B8A8Unorm; + vk::FormatProperties props; + gpu.getFormatProperties(tex_format, &props); + + for (uint32_t i = 0; i < texture_count; i++) { + if ((props.linearTilingFeatures & vk::FormatFeatureFlagBits::eSampledImage) && !use_staging_buffer) { + /* Device can texture using linear textures */ + prepare_texture_image(tex_files[i], &textures[i], vk::ImageTiling::eLinear, vk::ImageUsageFlagBits::eSampled, + vk::MemoryPropertyFlagBits::eHostVisible | vk::MemoryPropertyFlagBits::eHostCoherent); + // Nothing in the pipeline needs to be complete to start, and don't allow fragment + // shader to run until layout transition completes + set_image_layout(textures[i].image, vk::ImageAspectFlagBits::eColor, vk::ImageLayout::ePreinitialized, + textures[i].imageLayout, vk::AccessFlagBits(), vk::PipelineStageFlagBits::eTopOfPipe, + vk::PipelineStageFlagBits::eFragmentShader); + staging_texture.image = vk::Image(); + } else if (props.optimalTilingFeatures & vk::FormatFeatureFlagBits::eSampledImage) { + /* Must use staging buffer to copy linear texture to optimized */ + + prepare_texture_image(tex_files[i], &staging_texture, vk::ImageTiling::eLinear, vk::ImageUsageFlagBits::eTransferSrc, + vk::MemoryPropertyFlagBits::eHostVisible | vk::MemoryPropertyFlagBits::eHostCoherent); + + prepare_texture_image(tex_files[i], &textures[i], vk::ImageTiling::eOptimal, + vk::ImageUsageFlagBits::eTransferDst | vk::ImageUsageFlagBits::eSampled, + vk::MemoryPropertyFlagBits::eDeviceLocal); + + set_image_layout(staging_texture.image, vk::ImageAspectFlagBits::eColor, vk::ImageLayout::ePreinitialized, + vk::ImageLayout::eTransferSrcOptimal, vk::AccessFlagBits(), vk::PipelineStageFlagBits::eTopOfPipe, + vk::PipelineStageFlagBits::eTransfer); + + set_image_layout(textures[i].image, vk::ImageAspectFlagBits::eColor, vk::ImageLayout::ePreinitialized, + vk::ImageLayout::eTransferDstOptimal, vk::AccessFlagBits(), vk::PipelineStageFlagBits::eTopOfPipe, + vk::PipelineStageFlagBits::eTransfer); + + auto const subresource = vk::ImageSubresourceLayers() + .setAspectMask(vk::ImageAspectFlagBits::eColor) + .setMipLevel(0) + .setBaseArrayLayer(0) + .setLayerCount(1); + + auto const copy_region = vk::ImageCopy() + .setSrcSubresource(subresource) + .setSrcOffset({0, 0, 0}) + .setDstSubresource(subresource) + .setDstOffset({0, 0, 0}) + .setExtent({(uint32_t)staging_texture.tex_width, (uint32_t)staging_texture.tex_height, 1}); + + cmd.copyImage(staging_texture.image, vk::ImageLayout::eTransferSrcOptimal, textures[i].image, + vk::ImageLayout::eTransferDstOptimal, 1, ©_region); + + set_image_layout(textures[i].image, vk::ImageAspectFlagBits::eColor, vk::ImageLayout::eTransferDstOptimal, + textures[i].imageLayout, vk::AccessFlagBits::eTransferWrite, vk::PipelineStageFlagBits::eTransfer, + vk::PipelineStageFlagBits::eFragmentShader); + } else { + assert(!"No support for R8G8B8A8_UNORM as texture image format"); } - } - vk::ShaderModule Demo::prepare_fs() { - size_t size = 0; - void *fragShaderCode = read_spv("cube-frag.spv", &size); - if (!fragShaderCode) { - ERR_EXIT("Failed to load cube-frag.spv", "Load Shader Failure"); - } - - frag_shader_module = prepare_shader_module(fragShaderCode, size); - - free(fragShaderCode); - - return frag_shader_module; - } - - void Demo::prepare_pipeline() { - vk::PipelineCacheCreateInfo const pipelineCacheInfo; - auto result = device.createPipelineCache(&pipelineCacheInfo, nullptr, &pipelineCache); - VERIFY(result == vk::Result::eSuccess); - - vk::PipelineShaderStageCreateInfo const shaderStageInfo[2] = { - vk::PipelineShaderStageCreateInfo().setStage(vk::ShaderStageFlagBits::eVertex).setModule(prepare_vs()).setPName("main"), - vk::PipelineShaderStageCreateInfo() - .setStage(vk::ShaderStageFlagBits::eFragment) - .setModule(prepare_fs()) - .setPName("main")}; - - vk::PipelineVertexInputStateCreateInfo const vertexInputInfo; - - auto const inputAssemblyInfo = vk::PipelineInputAssemblyStateCreateInfo().setTopology(vk::PrimitiveTopology::eTriangleList); - - // TODO: Where are pViewports and pScissors set? - auto const viewportInfo = vk::PipelineViewportStateCreateInfo().setViewportCount(1).setScissorCount(1); - - auto const rasterizationInfo = vk::PipelineRasterizationStateCreateInfo() - .setDepthClampEnable(VK_FALSE) - .setRasterizerDiscardEnable(VK_FALSE) - .setPolygonMode(vk::PolygonMode::eFill) - .setCullMode(vk::CullModeFlagBits::eBack) - .setFrontFace(vk::FrontFace::eCounterClockwise) - .setDepthBiasEnable(VK_FALSE) - .setLineWidth(1.0f); - - auto const multisampleInfo = vk::PipelineMultisampleStateCreateInfo(); - - auto const stencilOp = vk::StencilOpState() - .setFailOp(vk::StencilOp::eKeep) - .setPassOp(vk::StencilOp::eKeep) - .setCompareOp(vk::CompareOp::eAlways); - - auto const depthStencilInfo = vk::PipelineDepthStencilStateCreateInfo() - .setDepthTestEnable(VK_TRUE) - .setDepthWriteEnable(VK_TRUE) - .setDepthCompareOp(vk::CompareOp::eLessOrEqual) - .setDepthBoundsTestEnable(VK_FALSE) - .setStencilTestEnable(VK_FALSE) - .setFront(stencilOp) - .setBack(stencilOp); - - vk::PipelineColorBlendAttachmentState const colorBlendAttachments[1] = { - vk::PipelineColorBlendAttachmentState().setColorWriteMask( - vk::ColorComponentFlagBits::eR | vk::ColorComponentFlagBits::eG | vk::ColorComponentFlagBits::eB | - vk::ColorComponentFlagBits::eA)}; - - auto const colorBlendInfo = - vk::PipelineColorBlendStateCreateInfo().setAttachmentCount(1).setPAttachments(colorBlendAttachments); - - vk::DynamicState const dynamicStates[2] = {vk::DynamicState::eViewport, vk::DynamicState::eScissor}; - - auto const dynamicStateInfo = vk::PipelineDynamicStateCreateInfo().setPDynamicStates(dynamicStates).setDynamicStateCount(2); - - auto const pipeline = vk::GraphicsPipelineCreateInfo() - .setStageCount(2) - .setPStages(shaderStageInfo) - .setPVertexInputState(&vertexInputInfo) - .setPInputAssemblyState(&inputAssemblyInfo) - .setPViewportState(&viewportInfo) - .setPRasterizationState(&rasterizationInfo) - .setPMultisampleState(&multisampleInfo) - .setPDepthStencilState(&depthStencilInfo) - .setPColorBlendState(&colorBlendInfo) - .setPDynamicState(&dynamicStateInfo) - .setLayout(pipeline_layout) - .setRenderPass(render_pass); - - result = device.createGraphicsPipelines(pipelineCache, 1, &pipeline, nullptr, &this->pipeline); - VERIFY(result == vk::Result::eSuccess); - - device.destroyShaderModule(frag_shader_module, nullptr); - device.destroyShaderModule(vert_shader_module, nullptr); - } - - void Demo::prepare_render_pass() { - // The initial layout for the color and depth attachments will be LAYOUT_UNDEFINED - // because at the start of the renderpass, we don't care about their contents. - // At the start of the subpass, the color attachment's layout will be transitioned - // to LAYOUT_COLOR_ATTACHMENT_OPTIMAL and the depth stencil attachment's layout - // will be transitioned to LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL. At the end of - // the renderpass, the color attachment's layout will be transitioned to - // LAYOUT_PRESENT_SRC_KHR to be ready to present. This is all done as part of - // the renderpass, no barriers are necessary. - const vk::AttachmentDescription attachments[2] = {vk::AttachmentDescription() - .setFormat(format) - .setSamples(vk::SampleCountFlagBits::e1) - .setLoadOp(vk::AttachmentLoadOp::eClear) - .setStoreOp(vk::AttachmentStoreOp::eStore) - .setStencilLoadOp(vk::AttachmentLoadOp::eDontCare) - .setStencilStoreOp(vk::AttachmentStoreOp::eDontCare) - .setInitialLayout(vk::ImageLayout::eUndefined) - .setFinalLayout(vk::ImageLayout::ePresentSrcKHR), - vk::AttachmentDescription() - .setFormat(depth.format) - .setSamples(vk::SampleCountFlagBits::e1) - .setLoadOp(vk::AttachmentLoadOp::eClear) - .setStoreOp(vk::AttachmentStoreOp::eDontCare) - .setStencilLoadOp(vk::AttachmentLoadOp::eDontCare) - .setStencilStoreOp(vk::AttachmentStoreOp::eDontCare) - .setInitialLayout(vk::ImageLayout::eUndefined) - .setFinalLayout(vk::ImageLayout::eDepthStencilAttachmentOptimal)}; - - auto const color_reference = vk::AttachmentReference().setAttachment(0).setLayout(vk::ImageLayout::eColorAttachmentOptimal); - - auto const depth_reference = - vk::AttachmentReference().setAttachment(1).setLayout(vk::ImageLayout::eDepthStencilAttachmentOptimal); - - auto const subpass = vk::SubpassDescription() - .setPipelineBindPoint(vk::PipelineBindPoint::eGraphics) - .setInputAttachmentCount(0) - .setPInputAttachments(nullptr) - .setColorAttachmentCount(1) - .setPColorAttachments(&color_reference) - .setPResolveAttachments(nullptr) - .setPDepthStencilAttachment(&depth_reference) - .setPreserveAttachmentCount(0) - .setPPreserveAttachments(nullptr); - - auto const rp_info = vk::RenderPassCreateInfo() - .setAttachmentCount(2) - .setPAttachments(attachments) - .setSubpassCount(1) - .setPSubpasses(&subpass) - .setDependencyCount(0) - .setPDependencies(nullptr); - - auto result = device.createRenderPass(&rp_info, nullptr, &render_pass); - VERIFY(result == vk::Result::eSuccess); - } - - vk::ShaderModule Demo::prepare_shader_module(const void *code, size_t size) { - auto const moduleCreateInfo = vk::ShaderModuleCreateInfo().setCodeSize(size).setPCode((uint32_t const *)code); - - vk::ShaderModule module; - auto result = device.createShaderModule(&moduleCreateInfo, nullptr, &module); - VERIFY(result == vk::Result::eSuccess); - - return module; - } - - void Demo::prepare_texture_image(const char *filename, texture_object *tex_obj, vk::ImageTiling tiling, - vk::ImageUsageFlags usage, vk::MemoryPropertyFlags required_props) { - int32_t tex_width; - int32_t tex_height; - if (!loadTexture(filename, nullptr, nullptr, &tex_width, &tex_height)) { - ERR_EXIT("Failed to load textures", "Load Texture Failure"); - } - - tex_obj->tex_width = tex_width; - tex_obj->tex_height = tex_height; - - auto const image_create_info = vk::ImageCreateInfo() - .setImageType(vk::ImageType::e2D) - .setFormat(vk::Format::eR8G8B8A8Unorm) - .setExtent({(uint32_t)tex_width, (uint32_t)tex_height, 1}) - .setMipLevels(1) - .setArrayLayers(1) - .setSamples(vk::SampleCountFlagBits::e1) - .setTiling(tiling) - .setUsage(usage) - .setSharingMode(vk::SharingMode::eExclusive) - .setQueueFamilyIndexCount(0) - .setPQueueFamilyIndices(nullptr) - .setInitialLayout(vk::ImageLayout::ePreinitialized); + auto const samplerInfo = vk::SamplerCreateInfo() + .setMagFilter(vk::Filter::eNearest) + .setMinFilter(vk::Filter::eNearest) + .setMipmapMode(vk::SamplerMipmapMode::eNearest) + .setAddressModeU(vk::SamplerAddressMode::eClampToEdge) + .setAddressModeV(vk::SamplerAddressMode::eClampToEdge) + .setAddressModeW(vk::SamplerAddressMode::eClampToEdge) + .setMipLodBias(0.0f) + .setAnisotropyEnable(VK_FALSE) + .setMaxAnisotropy(1) + .setCompareEnable(VK_FALSE) + .setCompareOp(vk::CompareOp::eNever) + .setMinLod(0.0f) + .setMaxLod(0.0f) + .setBorderColor(vk::BorderColor::eFloatOpaqueWhite) + .setUnnormalizedCoordinates(VK_FALSE); + + auto result = device.createSampler(&samplerInfo, nullptr, &textures[i].sampler); + VERIFY(result == vk::Result::eSuccess); + + auto const viewInfo = vk::ImageViewCreateInfo() + .setImage(textures[i].image) + .setViewType(vk::ImageViewType::e2D) + .setFormat(tex_format) + .setSubresourceRange(vk::ImageSubresourceRange(vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1)); - auto result = device.createImage(&image_create_info, nullptr, &tex_obj->image); + result = device.createImageView(&viewInfo, nullptr, &textures[i].view); VERIFY(result == vk::Result::eSuccess); + } +} - vk::MemoryRequirements mem_reqs; - device.getImageMemoryRequirements(tex_obj->image, &mem_reqs); +vk::ShaderModule Demo::prepare_vs() { + const uint32_t vertShaderCode[] = { +#include "cube.vert.inc" + }; - tex_obj->mem_alloc.setAllocationSize(mem_reqs.size); - tex_obj->mem_alloc.setMemoryTypeIndex(0); + vert_shader_module = prepare_shader_module(vertShaderCode, sizeof(vertShaderCode)); - auto pass = memory_type_from_properties(mem_reqs.memoryTypeBits, required_props, &tex_obj->mem_alloc.memoryTypeIndex); - VERIFY(pass == true); + return vert_shader_module; +} - result = device.allocateMemory(&tex_obj->mem_alloc, nullptr, &(tex_obj->mem)); - VERIFY(result == vk::Result::eSuccess); +void Demo::resize() { + uint32_t i; - result = device.bindImageMemory(tex_obj->image, tex_obj->mem, 0); - VERIFY(result == vk::Result::eSuccess); + // Don't react to resize until after first initialization. + if (!prepared) { + return; + } - if (required_props & vk::MemoryPropertyFlagBits::eHostVisible) { - auto const subres = - vk::ImageSubresource().setAspectMask(vk::ImageAspectFlagBits::eColor).setMipLevel(0).setArrayLayer(0); - vk::SubresourceLayout layout; - device.getImageSubresourceLayout(tex_obj->image, &subres, &layout); + // In order to properly resize the window, we must re-create the + // swapchain + // AND redo the command buffers, etc. + // + // First, perform part of the cleanup() function: + prepared = false; + auto result = device.waitIdle(); + VERIFY(result == vk::Result::eSuccess); - auto data = device.mapMemory(tex_obj->mem, 0, tex_obj->mem_alloc.allocationSize); - VERIFY(data.result == vk::Result::eSuccess); + for (i = 0; i < swapchainImageCount; i++) { + device.destroyFramebuffer(swapchain_image_resources[i].framebuffer, nullptr); + } - if (!loadTexture(filename, (uint8_t *)data.value, &layout, &tex_width, &tex_height)) { - fprintf(stderr, "Error loading texture: %s\n", filename); - } + device.destroyDescriptorPool(desc_pool, nullptr); - device.unmapMemory(tex_obj->mem); - } + device.destroyPipeline(pipeline, nullptr); + device.destroyPipelineCache(pipelineCache, nullptr); + device.destroyRenderPass(render_pass, nullptr); + device.destroyPipelineLayout(pipeline_layout, nullptr); + device.destroyDescriptorSetLayout(desc_layout, nullptr); - tex_obj->imageLayout = vk::ImageLayout::eShaderReadOnlyOptimal; + for (i = 0; i < texture_count; i++) { + device.destroyImageView(textures[i].view, nullptr); + device.destroyImage(textures[i].image, nullptr); + device.freeMemory(textures[i].mem, nullptr); + device.destroySampler(textures[i].sampler, nullptr); } - void Demo::prepare_textures() { - vk::Format const tex_format = vk::Format::eR8G8B8A8Unorm; - vk::FormatProperties props; - gpu.getFormatProperties(tex_format, &props); + device.destroyImageView(depth.view, nullptr); + device.destroyImage(depth.image, nullptr); + device.freeMemory(depth.mem, nullptr); - for (uint32_t i = 0; i < texture_count; i++) { - if ((props.linearTilingFeatures & vk::FormatFeatureFlagBits::eSampledImage) && !use_staging_buffer) { - /* Device can texture using linear textures */ - prepare_texture_image(tex_files[i], &textures[i], vk::ImageTiling::eLinear, vk::ImageUsageFlagBits::eSampled, - vk::MemoryPropertyFlagBits::eHostVisible | vk::MemoryPropertyFlagBits::eHostCoherent); - // Nothing in the pipeline needs to be complete to start, and don't allow fragment - // shader to run until layout transition completes - set_image_layout(textures[i].image, vk::ImageAspectFlagBits::eColor, vk::ImageLayout::ePreinitialized, - textures[i].imageLayout, vk::AccessFlagBits::eHostWrite, vk::PipelineStageFlagBits::eTopOfPipe, - vk::PipelineStageFlagBits::eFragmentShader); - staging_texture.image = vk::Image(); - } else if (props.optimalTilingFeatures & vk::FormatFeatureFlagBits::eSampledImage) { - /* Must use staging buffer to copy linear texture to optimized */ - - prepare_texture_image(tex_files[i], &staging_texture, vk::ImageTiling::eLinear, - vk::ImageUsageFlagBits::eTransferSrc, - vk::MemoryPropertyFlagBits::eHostVisible | vk::MemoryPropertyFlagBits::eHostCoherent); + for (i = 0; i < swapchainImageCount; i++) { + device.destroyImageView(swapchain_image_resources[i].view, nullptr); + device.freeCommandBuffers(cmd_pool, 1, &swapchain_image_resources[i].cmd); + device.destroyBuffer(swapchain_image_resources[i].uniform_buffer, nullptr); + device.freeMemory(swapchain_image_resources[i].uniform_memory, nullptr); + } - prepare_texture_image(tex_files[i], &textures[i], vk::ImageTiling::eOptimal, - vk::ImageUsageFlagBits::eTransferDst | vk::ImageUsageFlagBits::eSampled, - vk::MemoryPropertyFlagBits::eDeviceLocal); + device.destroyCommandPool(cmd_pool, nullptr); + if (separate_present_queue) { + device.destroyCommandPool(present_cmd_pool, nullptr); + } - set_image_layout(staging_texture.image, vk::ImageAspectFlagBits::eColor, vk::ImageLayout::ePreinitialized, - vk::ImageLayout::eTransferSrcOptimal, vk::AccessFlagBits::eHostWrite, - vk::PipelineStageFlagBits::eTopOfPipe, vk::PipelineStageFlagBits::eTransfer); + // Second, re-perform the prepare() function, which will re-create the + // swapchain. + prepare(); +} - set_image_layout(textures[i].image, vk::ImageAspectFlagBits::eColor, vk::ImageLayout::ePreinitialized, - vk::ImageLayout::eTransferDstOptimal, vk::AccessFlagBits::eHostWrite, - vk::PipelineStageFlagBits::eTopOfPipe, vk::PipelineStageFlagBits::eTransfer); +void Demo::set_image_layout(vk::Image image, vk::ImageAspectFlags aspectMask, vk::ImageLayout oldLayout, vk::ImageLayout newLayout, + vk::AccessFlags srcAccessMask, vk::PipelineStageFlags src_stages, vk::PipelineStageFlags dest_stages) { + assert(cmd); + + auto DstAccessMask = [](vk::ImageLayout const &layout) { + vk::AccessFlags flags; + + switch (layout) { + case vk::ImageLayout::eTransferDstOptimal: + // Make sure anything that was copying from this image has + // completed + flags = vk::AccessFlagBits::eTransferWrite; + break; + case vk::ImageLayout::eColorAttachmentOptimal: + flags = vk::AccessFlagBits::eColorAttachmentWrite; + break; + case vk::ImageLayout::eDepthStencilAttachmentOptimal: + flags = vk::AccessFlagBits::eDepthStencilAttachmentWrite; + break; + case vk::ImageLayout::eShaderReadOnlyOptimal: + // Make sure any Copy or CPU writes to image are flushed + flags = vk::AccessFlagBits::eShaderRead | vk::AccessFlagBits::eInputAttachmentRead; + break; + case vk::ImageLayout::eTransferSrcOptimal: + flags = vk::AccessFlagBits::eTransferRead; + break; + case vk::ImageLayout::ePresentSrcKHR: + flags = vk::AccessFlagBits::eMemoryRead; + break; + default: + break; + } - auto const subresource = vk::ImageSubresourceLayers() - .setAspectMask(vk::ImageAspectFlagBits::eColor) - .setMipLevel(0) - .setBaseArrayLayer(0) - .setLayerCount(1); + return flags; + }; - auto const copy_region = - vk::ImageCopy() - .setSrcSubresource(subresource) - .setSrcOffset({0, 0, 0}) - .setDstSubresource(subresource) - .setDstOffset({0, 0, 0}) - .setExtent({(uint32_t)staging_texture.tex_width, (uint32_t)staging_texture.tex_height, 1}); + auto const barrier = vk::ImageMemoryBarrier() + .setSrcAccessMask(srcAccessMask) + .setDstAccessMask(DstAccessMask(newLayout)) + .setOldLayout(oldLayout) + .setNewLayout(newLayout) + .setSrcQueueFamilyIndex(0) + .setDstQueueFamilyIndex(0) + .setImage(image) + .setSubresourceRange(vk::ImageSubresourceRange(aspectMask, 0, 1, 0, 1)); - cmd.copyImage(staging_texture.image, vk::ImageLayout::eTransferSrcOptimal, textures[i].image, - vk::ImageLayout::eTransferDstOptimal, 1, ©_region); + cmd.pipelineBarrier(src_stages, dest_stages, vk::DependencyFlagBits(), 0, nullptr, 0, nullptr, 1, &barrier); +} - set_image_layout(textures[i].image, vk::ImageAspectFlagBits::eColor, vk::ImageLayout::eTransferDstOptimal, - textures[i].imageLayout, vk::AccessFlagBits::eTransferWrite, vk::PipelineStageFlagBits::eTransfer, - vk::PipelineStageFlagBits::eFragmentShader); - } else { - assert(!"No support for R8G8B8A8_UNORM as texture image format"); - } +void Demo::update_data_buffer() { + mat4x4 VP; + mat4x4_mul(VP, projection_matrix, view_matrix); - auto const samplerInfo = vk::SamplerCreateInfo() - .setMagFilter(vk::Filter::eNearest) - .setMinFilter(vk::Filter::eNearest) - .setMipmapMode(vk::SamplerMipmapMode::eNearest) - .setAddressModeU(vk::SamplerAddressMode::eClampToEdge) - .setAddressModeV(vk::SamplerAddressMode::eClampToEdge) - .setAddressModeW(vk::SamplerAddressMode::eClampToEdge) - .setMipLodBias(0.0f) - .setAnisotropyEnable(VK_FALSE) - .setMaxAnisotropy(1) - .setCompareEnable(VK_FALSE) - .setCompareOp(vk::CompareOp::eNever) - .setMinLod(0.0f) - .setMaxLod(0.0f) - .setBorderColor(vk::BorderColor::eFloatOpaqueWhite) - .setUnnormalizedCoordinates(VK_FALSE); + // Rotate around the Y axis + mat4x4 Model; + mat4x4_dup(Model, model_matrix); + mat4x4_rotate(model_matrix, Model, 0.0f, 1.0f, 0.0f, (float)degreesToRadians(spin_angle)); - auto result = device.createSampler(&samplerInfo, nullptr, &textures[i].sampler); - VERIFY(result == vk::Result::eSuccess); + mat4x4 MVP; + mat4x4_mul(MVP, VP, model_matrix); - auto const viewInfo = vk::ImageViewCreateInfo() - .setImage(textures[i].image) - .setViewType(vk::ImageViewType::e2D) - .setFormat(tex_format) - .setSubresourceRange(vk::ImageSubresourceRange(vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1)); + auto data = device.mapMemory(swapchain_image_resources[current_buffer].uniform_memory, 0, VK_WHOLE_SIZE, vk::MemoryMapFlags()); + VERIFY(data.result == vk::Result::eSuccess); - result = device.createImageView(&viewInfo, nullptr, &textures[i].view); - VERIFY(result == vk::Result::eSuccess); - } - } + memcpy(data.value, (const void *)&MVP[0][0], sizeof(MVP)); - vk::ShaderModule Demo::prepare_vs() { - size_t size = 0; - void *vertShaderCode = read_spv("cube-vert.spv", &size); - if (!vertShaderCode) { - ERR_EXIT("Failed to load cube-vert.spv", "Load Shader Failure"); - } + device.unmapMemory(swapchain_image_resources[current_buffer].uniform_memory); +} - vert_shader_module = prepare_shader_module(vertShaderCode, size); +bool Demo::loadTexture(const char *filename, uint8_t *rgba_data, vk::SubresourceLayout *layout, int32_t *width, int32_t *height) { +#if (defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_MACOS_MVK)) + filename = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@(filename)].UTF8String; +#endif - free(vertShaderCode); + FILE *fPtr = fopen(filename, "rb"); + if (!fPtr) { + return false; + } - return vert_shader_module; + char header[256]; + char *cPtr = fgets(header, 256, fPtr); // P6 + if (cPtr == nullptr || strncmp(header, "P6\n", 3)) { + fclose(fPtr); + return false; } - char *Demo::read_spv(const char *filename, size_t *psize) { - FILE *fp = fopen(filename, "rb"); - if (!fp) { - return nullptr; + do { + cPtr = fgets(header, 256, fPtr); + if (cPtr == nullptr) { + fclose(fPtr); + return false; } + } while (!strncmp(header, "#", 1)); - fseek(fp, 0L, SEEK_END); - long int size = ftell(fp); - - fseek(fp, 0L, SEEK_SET); - - void *shader_code = malloc(size); - size_t retval = fread(shader_code, size, 1, fp); - VERIFY(retval == 1); - - *psize = size; - - fclose(fp); - - return (char *)shader_code; + sscanf(header, "%" SCNd32 " %" SCNd32, width, height); + if (rgba_data == nullptr) { + fclose(fPtr); + return true; } - void Demo::resize() { - uint32_t i; - - // Don't react to resize until after first initialization. - if (!prepared) { - return; - } + char *result = fgets(header, 256, fPtr); // Format + VERIFY(result != nullptr); + if (cPtr == nullptr || strncmp(header, "255\n", 3)) { + fclose(fPtr); + return false; + } - // In order to properly resize the window, we must re-create the - // swapchain - // AND redo the command buffers, etc. - // - // First, perform part of the cleanup() function: - prepared = false; - auto result = device.waitIdle(); - VERIFY(result == vk::Result::eSuccess); + for (int y = 0; y < *height; y++) { + uint8_t *rowPtr = rgba_data; - for (i = 0; i < swapchainImageCount; i++) { - device.destroyFramebuffer(swapchain_image_resources[i].framebuffer, nullptr); + for (int x = 0; x < *width; x++) { + size_t s = fread(rowPtr, 3, 1, fPtr); + (void)s; + rowPtr[3] = 255; /* Alpha of 1 */ + rowPtr += 4; } - device.destroyDescriptorPool(desc_pool, nullptr); + rgba_data += layout->rowPitch; + } - device.destroyPipeline(pipeline, nullptr); - device.destroyPipelineCache(pipelineCache, nullptr); - device.destroyRenderPass(render_pass, nullptr); - device.destroyPipelineLayout(pipeline_layout, nullptr); - device.destroyDescriptorSetLayout(desc_layout, nullptr); + fclose(fPtr); + return true; +} - for (i = 0; i < texture_count; i++) { - device.destroyImageView(textures[i].view, nullptr); - device.destroyImage(textures[i].image, nullptr); - device.freeMemory(textures[i].mem, nullptr); - device.destroySampler(textures[i].sampler, nullptr); +bool Demo::memory_type_from_properties(uint32_t typeBits, vk::MemoryPropertyFlags requirements_mask, uint32_t *typeIndex) { + // Search memtypes to find first index with those properties + for (uint32_t i = 0; i < VK_MAX_MEMORY_TYPES; i++) { + if ((typeBits & 1) == 1) { + // Type is available, does it match user properties? + if ((memory_properties.memoryTypes[i].propertyFlags & requirements_mask) == requirements_mask) { + *typeIndex = i; + return true; + } } + typeBits >>= 1; + } - device.destroyImageView(depth.view, nullptr); - device.destroyImage(depth.image, nullptr); - device.freeMemory(depth.mem, nullptr); + // No memory types matched, return failure + return false; +} - for (i = 0; i < swapchainImageCount; i++) { - device.destroyImageView(swapchain_image_resources[i].view, nullptr); - device.freeCommandBuffers(cmd_pool, 1, &swapchain_image_resources[i].cmd); - device.destroyBuffer(swapchain_image_resources[i].uniform_buffer, nullptr); - device.freeMemory(swapchain_image_resources[i].uniform_memory, nullptr); - } +#if defined(VK_USE_PLATFORM_WIN32_KHR) +void Demo::run() { + if (!prepared) { + return; + } - device.destroyCommandPool(cmd_pool, nullptr); - if (separate_present_queue) { - device.destroyCommandPool(present_cmd_pool, nullptr); - } + draw(); + curFrame++; - // Second, re-perform the prepare() function, which will re-create the - // swapchain. - prepare(); + if (frameCount != INT_MAX && curFrame == frameCount) { + PostQuitMessage(validation_error); } +} - void Demo::set_image_layout(vk::Image image, vk::ImageAspectFlags aspectMask, vk::ImageLayout oldLayout, - vk::ImageLayout newLayout, vk::AccessFlags srcAccessMask, vk::PipelineStageFlags src_stages, - vk::PipelineStageFlags dest_stages) { - assert(cmd); +void Demo::create_window() { + WNDCLASSEX win_class; - auto DstAccessMask = [](vk::ImageLayout const &layout) { - vk::AccessFlags flags; + // Initialize the window class structure: + win_class.cbSize = sizeof(WNDCLASSEX); + win_class.style = CS_HREDRAW | CS_VREDRAW; + win_class.lpfnWndProc = WndProc; + win_class.cbClsExtra = 0; + win_class.cbWndExtra = 0; + win_class.hInstance = connection; // hInstance + win_class.hIcon = LoadIcon(nullptr, IDI_APPLICATION); + win_class.hCursor = LoadCursor(nullptr, IDC_ARROW); + win_class.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); + win_class.lpszMenuName = nullptr; + win_class.lpszClassName = name; + win_class.hIconSm = LoadIcon(nullptr, IDI_WINLOGO); + + // Register window class: + if (!RegisterClassEx(&win_class)) { + // It didn't work, so try to give a useful error: + printf("Unexpected error trying to start the application!\n"); + fflush(stdout); + exit(1); + } + + // Create window with the registered class: + RECT wr = {0, 0, static_cast(width), static_cast(height)}; + AdjustWindowRect(&wr, WS_OVERLAPPEDWINDOW, FALSE); + window = CreateWindowEx(0, + name, // class name + name, // app name + WS_OVERLAPPEDWINDOW | // window style + WS_VISIBLE | WS_SYSMENU, + 100, 100, // x/y coords + wr.right - wr.left, // width + wr.bottom - wr.top, // height + nullptr, // handle to parent + nullptr, // handle to menu + connection, // hInstance + nullptr); // no extra parameters + + if (!window) { + // It didn't work, so try to give a useful error: + printf("Cannot create a window in which to draw!\n"); + fflush(stdout); + exit(1); + } + + // Window client area size must be at least 1 pixel high, to prevent + // crash. + minsize.x = GetSystemMetrics(SM_CXMINTRACK); + minsize.y = GetSystemMetrics(SM_CYMINTRACK) + 1; +} +#elif defined(VK_USE_PLATFORM_XLIB_KHR) - switch (layout) { - case vk::ImageLayout::eTransferDstOptimal: - // Make sure anything that was copying from this image has - // completed - flags = vk::AccessFlagBits::eTransferWrite; - break; - case vk::ImageLayout::eColorAttachmentOptimal: - flags = vk::AccessFlagBits::eColorAttachmentWrite; - break; - case vk::ImageLayout::eDepthStencilAttachmentOptimal: - flags = vk::AccessFlagBits::eDepthStencilAttachmentWrite; - break; - case vk::ImageLayout::eShaderReadOnlyOptimal: - // Make sure any Copy or CPU writes to image are flushed - flags = vk::AccessFlagBits::eShaderRead | vk::AccessFlagBits::eInputAttachmentRead; +void Demo::create_xlib_window() { + const char *display_envar = getenv("DISPLAY"); + if (display_envar == nullptr || display_envar[0] == '\0') { + printf("Environment variable DISPLAY requires a valid value.\nExiting ...\n"); + fflush(stdout); + exit(1); + } + + XInitThreads(); + display = XOpenDisplay(nullptr); + long visualMask = VisualScreenMask; + int numberOfVisuals; + XVisualInfo vInfoTemplate = {}; + vInfoTemplate.screen = DefaultScreen(display); + XVisualInfo *visualInfo = XGetVisualInfo(display, visualMask, &vInfoTemplate, &numberOfVisuals); + + Colormap colormap = XCreateColormap(display, RootWindow(display, vInfoTemplate.screen), visualInfo->visual, AllocNone); + + XSetWindowAttributes windowAttributes = {}; + windowAttributes.colormap = colormap; + windowAttributes.background_pixel = 0xFFFFFFFF; + windowAttributes.border_pixel = 0; + windowAttributes.event_mask = KeyPressMask | KeyReleaseMask | StructureNotifyMask | ExposureMask; + + xlib_window = + XCreateWindow(display, RootWindow(display, vInfoTemplate.screen), 0, 0, width, height, 0, visualInfo->depth, InputOutput, + visualInfo->visual, CWBackPixel | CWBorderPixel | CWEventMask | CWColormap, &windowAttributes); + + XSelectInput(display, xlib_window, ExposureMask | KeyPressMask); + XMapWindow(display, xlib_window); + XFlush(display); + xlib_wm_delete_window = XInternAtom(display, "WM_DELETE_WINDOW", False); +} + +void Demo::handle_xlib_event(const XEvent *event) { + switch (event->type) { + case ClientMessage: + if ((Atom)event->xclient.data.l[0] == xlib_wm_delete_window) { + quit = true; + } + break; + case KeyPress: + switch (event->xkey.keycode) { + case 0x9: // Escape + quit = true; break; - case vk::ImageLayout::eTransferSrcOptimal: - flags = vk::AccessFlagBits::eTransferRead; + case 0x71: // left arrow key + spin_angle -= spin_increment; break; - case vk::ImageLayout::ePresentSrcKHR: - flags = vk::AccessFlagBits::eMemoryRead; + case 0x72: // right arrow key + spin_angle += spin_increment; break; - default: + case 0x41: // space bar + pause = !pause; break; } - - return flags; - }; - - auto const barrier = vk::ImageMemoryBarrier() - .setSrcAccessMask(srcAccessMask) - .setDstAccessMask(DstAccessMask(newLayout)) - .setOldLayout(oldLayout) - .setNewLayout(newLayout) - .setSrcQueueFamilyIndex(0) - .setDstQueueFamilyIndex(0) - .setImage(image) - .setSubresourceRange(vk::ImageSubresourceRange(aspectMask, 0, 1, 0, 1)); - - cmd.pipelineBarrier(src_stages, dest_stages, vk::DependencyFlagBits(), 0, nullptr, 0, nullptr, 1, &barrier); - } - - void Demo::update_data_buffer() { - mat4x4 VP; - mat4x4_mul(VP, projection_matrix, view_matrix); - - // Rotate around the Y axis - mat4x4 Model; - mat4x4_dup(Model, model_matrix); - mat4x4_rotate(model_matrix, Model, 0.0f, 1.0f, 0.0f, (float)degreesToRadians(spin_angle)); - - mat4x4 MVP; - mat4x4_mul(MVP, VP, model_matrix); - - auto data = device.mapMemory(swapchain_image_resources[current_buffer].uniform_memory, 0, VK_WHOLE_SIZE, vk::MemoryMapFlags()); - VERIFY(data.result == vk::Result::eSuccess); - - memcpy(data.value, (const void *)&MVP[0][0], sizeof(MVP)); - - device.unmapMemory(swapchain_image_resources[current_buffer].uniform_memory); + break; + case ConfigureNotify: + if (((int32_t)width != event->xconfigure.width) || ((int32_t)height != event->xconfigure.height)) { + width = event->xconfigure.width; + height = event->xconfigure.height; + resize(); + } + break; + default: + break; } +} - bool Demo::loadTexture(const char *filename, uint8_t *rgba_data, vk::SubresourceLayout *layout, int32_t *width, - int32_t *height) { - FILE *fPtr = fopen(filename, "rb"); - if (!fPtr) { - return false; - } - - char header[256]; - char *cPtr = fgets(header, 256, fPtr); // P6 - if (cPtr == nullptr || strncmp(header, "P6\n", 3)) { - fclose(fPtr); - return false; +void Demo::run_xlib() { + while (!quit) { + XEvent event; + + if (pause) { + XNextEvent(display, &event); + handle_xlib_event(&event); + } + while (XPending(display) > 0) { + XNextEvent(display, &event); + handle_xlib_event(&event); } - do { - cPtr = fgets(header, 256, fPtr); - if (cPtr == nullptr) { - fclose(fPtr); - return false; - } - } while (!strncmp(header, "#", 1)); - - sscanf(header, "%u %u", width, height); - if (rgba_data == nullptr) { - fclose(fPtr); - return true; - } + draw(); + curFrame++; - char *result = fgets(header, 256, fPtr); // Format - VERIFY(result != nullptr); - if (cPtr == nullptr || strncmp(header, "255\n", 3)) { - fclose(fPtr); - return false; + if (frameCount != UINT32_MAX && curFrame == frameCount) { + quit = true; } + } +} +#elif defined(VK_USE_PLATFORM_XCB_KHR) - for (int y = 0; y < *height; y++) { - uint8_t *rowPtr = rgba_data; - - for (int x = 0; x < *width; x++) { - size_t s = fread(rowPtr, 3, 1, fPtr); - (void)s; - rowPtr[3] = 255; /* Alpha of 1 */ - rowPtr += 4; +void Demo::handle_xcb_event(const xcb_generic_event_t *event) { + uint8_t event_code = event->response_type & 0x7f; + switch (event_code) { + case XCB_EXPOSE: + // TODO: Resize window + break; + case XCB_CLIENT_MESSAGE: + if ((*(xcb_client_message_event_t *)event).data.data32[0] == (*atom_wm_delete_window).atom) { + quit = true; } + break; + case XCB_KEY_RELEASE: { + const xcb_key_release_event_t *key = (const xcb_key_release_event_t *)event; - rgba_data += layout->rowPitch; - } - - fclose(fPtr); - return true; + switch (key->detail) { + case 0x9: // Escape + quit = true; + break; + case 0x71: // left arrow key + spin_angle -= spin_increment; + break; + case 0x72: // right arrow key + spin_angle += spin_increment; + break; + case 0x41: // space bar + pause = !pause; + break; + } + } break; + case XCB_CONFIGURE_NOTIFY: { + const xcb_configure_notify_event_t *cfg = (const xcb_configure_notify_event_t *)event; + if ((width != cfg->width) || (height != cfg->height)) { + width = cfg->width; + height = cfg->height; + resize(); + } + } break; + default: + break; } +} - bool Demo::memory_type_from_properties(uint32_t typeBits, vk::MemoryPropertyFlags requirements_mask, uint32_t *typeIndex) { - // Search memtypes to find first index with those properties - for (uint32_t i = 0; i < VK_MAX_MEMORY_TYPES; i++) { - if ((typeBits & 1) == 1) { - // Type is available, does it match user properties? - if ((memory_properties.memoryTypes[i].propertyFlags & requirements_mask) == requirements_mask) { - *typeIndex = i; - return true; - } - } - typeBits >>= 1; - } +void Demo::run_xcb() { + xcb_flush(connection); - // No memory types matched, return failure - return false; - } + while (!quit) { + xcb_generic_event_t *event; -#if defined(VK_USE_PLATFORM_WIN32_KHR) - void Demo::run() { - if (!prepared) { - return; + if (pause) { + event = xcb_wait_for_event(connection); + } else { + event = xcb_poll_for_event(connection); + } + while (event) { + handle_xcb_event(event); + free(event); + event = xcb_poll_for_event(connection); } draw(); curFrame++; - - if (frameCount != INT_MAX && curFrame == frameCount) { - PostQuitMessage(validation_error); + if (frameCount != UINT32_MAX && curFrame == frameCount) { + quit = true; } } +} - void Demo::create_window() { - WNDCLASSEX win_class; +void Demo::create_xcb_window() { + uint32_t value_mask, value_list[32]; - // Initialize the window class structure: - win_class.cbSize = sizeof(WNDCLASSEX); - win_class.style = CS_HREDRAW | CS_VREDRAW; - win_class.lpfnWndProc = WndProc; - win_class.cbClsExtra = 0; - win_class.cbWndExtra = 0; - win_class.hInstance = connection; // hInstance - win_class.hIcon = LoadIcon(nullptr, IDI_APPLICATION); - win_class.hCursor = LoadCursor(nullptr, IDC_ARROW); - win_class.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); - win_class.lpszMenuName = nullptr; - win_class.lpszClassName = name; - win_class.hIconSm = LoadIcon(nullptr, IDI_WINLOGO); - - // Register window class: - if (!RegisterClassEx(&win_class)) { - // It didn't work, so try to give a useful error: - printf("Unexpected error trying to start the application!\n"); - fflush(stdout); - exit(1); - } - - // Create window with the registered class: - RECT wr = {0, 0, static_cast(width), static_cast(height)}; - AdjustWindowRect(&wr, WS_OVERLAPPEDWINDOW, FALSE); - window = CreateWindowEx(0, - name, // class name - name, // app name - WS_OVERLAPPEDWINDOW | // window style - WS_VISIBLE | WS_SYSMENU, - 100, 100, // x/y coords - wr.right - wr.left, // width - wr.bottom - wr.top, // height - nullptr, // handle to parent - nullptr, // handle to menu - connection, // hInstance - nullptr); // no extra parameters - - if (!window) { - // It didn't work, so try to give a useful error: - printf("Cannot create a window in which to draw!\n"); - fflush(stdout); - exit(1); - } - - // Window client area size must be at least 1 pixel high, to prevent - // crash. - minsize.x = GetSystemMetrics(SM_CXMINTRACK); - minsize.y = GetSystemMetrics(SM_CYMINTRACK) + 1; - } -#elif defined(VK_USE_PLATFORM_XLIB_KHR) + xcb_window = xcb_generate_id(connection); - void Demo::create_xlib_window() { - XInitThreads(); - display = XOpenDisplay(nullptr); - long visualMask = VisualScreenMask; - int numberOfVisuals; - XVisualInfo vInfoTemplate = {}; - vInfoTemplate.screen = DefaultScreen(display); - XVisualInfo *visualInfo = XGetVisualInfo(display, visualMask, &vInfoTemplate, &numberOfVisuals); - - Colormap colormap = XCreateColormap(display, RootWindow(display, vInfoTemplate.screen), visualInfo->visual, AllocNone); - - XSetWindowAttributes windowAttributes = {}; - windowAttributes.colormap = colormap; - windowAttributes.background_pixel = 0xFFFFFFFF; - windowAttributes.border_pixel = 0; - windowAttributes.event_mask = KeyPressMask | KeyReleaseMask | StructureNotifyMask | ExposureMask; - - xlib_window = XCreateWindow(display, RootWindow(display, vInfoTemplate.screen), 0, 0, width, height, 0, visualInfo->depth, - InputOutput, visualInfo->visual, CWBackPixel | CWBorderPixel | CWEventMask | CWColormap, - &windowAttributes); - - XSelectInput(display, xlib_window, ExposureMask | KeyPressMask); - XMapWindow(display, xlib_window); - XFlush(display); - xlib_wm_delete_window = XInternAtom(display, "WM_DELETE_WINDOW", False); - } - - void Demo::handle_xlib_event(const XEvent *event) { - switch (event->type) { - case ClientMessage: - if ((Atom)event->xclient.data.l[0] == xlib_wm_delete_window) { - quit = true; - } - break; - case KeyPress: - switch (event->xkey.keycode) { - case 0x9: // Escape - quit = true; - break; - case 0x71: // left arrow key - spin_angle -= spin_increment; - break; - case 0x72: // right arrow key - spin_angle += spin_increment; - break; - case 0x41: // space bar - pause = !pause; - break; - } - break; - case ConfigureNotify: - if (((int32_t)width != event->xconfigure.width) || ((int32_t)height != event->xconfigure.height)) { - width = event->xconfigure.width; - height = event->xconfigure.height; - resize(); - } - break; - default: - break; - } - } + value_mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK; + value_list[0] = screen->black_pixel; + value_list[1] = XCB_EVENT_MASK_KEY_RELEASE | XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY; - void Demo::run_xlib() { - while (!quit) { - XEvent event; - - if (pause) { - XNextEvent(display, &event); - handle_xlib_event(&event); - } - while (XPending(display) > 0) { - XNextEvent(display, &event); - handle_xlib_event(&event); - } + xcb_create_window(connection, XCB_COPY_FROM_PARENT, xcb_window, screen->root, 0, 0, width, height, 0, + XCB_WINDOW_CLASS_INPUT_OUTPUT, screen->root_visual, value_mask, value_list); - draw(); - curFrame++; + /* Magic code that will send notification when window is destroyed */ + xcb_intern_atom_cookie_t cookie = xcb_intern_atom(connection, 1, 12, "WM_PROTOCOLS"); + xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(connection, cookie, 0); - if (frameCount != UINT32_MAX && curFrame == frameCount) { - quit = true; - } - } - } -#elif defined(VK_USE_PLATFORM_XCB_KHR) + xcb_intern_atom_cookie_t cookie2 = xcb_intern_atom(connection, 0, 16, "WM_DELETE_WINDOW"); + atom_wm_delete_window = xcb_intern_atom_reply(connection, cookie2, 0); - void Demo::handle_xcb_event(const xcb_generic_event_t *event) { - uint8_t event_code = event->response_type & 0x7f; - switch (event_code) { - case XCB_EXPOSE: - // TODO: Resize window - break; - case XCB_CLIENT_MESSAGE: - if ((*(xcb_client_message_event_t *)event).data.data32[0] == (*atom_wm_delete_window).atom) { - quit = true; - } - break; - case XCB_KEY_RELEASE: { - const xcb_key_release_event_t *key = (const xcb_key_release_event_t *)event; - - switch (key->detail) { - case 0x9: // Escape - quit = true; - break; - case 0x71: // left arrow key - spin_angle -= spin_increment; - break; - case 0x72: // right arrow key - spin_angle += spin_increment; - break; - case 0x41: // space bar - pause = !pause; - break; - } - } break; - case XCB_CONFIGURE_NOTIFY: { - const xcb_configure_notify_event_t *cfg = (const xcb_configure_notify_event_t *)event; - if ((width != cfg->width) || (height != cfg->height)) { - width = cfg->width; - height = cfg->height; - resize(); - } - } break; - default: - break; - } - } + xcb_change_property(connection, XCB_PROP_MODE_REPLACE, xcb_window, (*reply).atom, 4, 32, 1, &(*atom_wm_delete_window).atom); - void Demo::run_xcb() { - xcb_flush(connection); + free(reply); - while (!quit) { - xcb_generic_event_t *event; + xcb_map_window(connection, xcb_window); - if (pause) { - event = xcb_wait_for_event(connection); - } else { - event = xcb_poll_for_event(connection); - } - while (event) { - handle_xcb_event(event); - free(event); - event = xcb_poll_for_event(connection); - } + // Force the x/y coordinates to 100,100 results are identical in + // consecutive + // runs + const uint32_t coords[] = {100, 100}; + xcb_configure_window(connection, xcb_window, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, coords); +} +#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) +void Demo::run() { + while (!quit) { + if (pause) { + wl_display_dispatch(display); + } else { + wl_display_dispatch_pending(display); + update_data_buffer(); draw(); curFrame++; if (frameCount != UINT32_MAX && curFrame == frameCount) { @@ -2617,223 +2648,183 @@ } } } +} - void Demo::create_xcb_window() { - uint32_t value_mask, value_list[32]; +void Demo::create_window() { + window = wl_compositor_create_surface(compositor); + if (!window) { + printf("Can not create wayland_surface from compositor!\n"); + fflush(stdout); + exit(1); + } + + shell_surface = wl_shell_get_shell_surface(shell, window); + if (!shell_surface) { + printf("Can not get shell_surface from wayland_surface!\n"); + fflush(stdout); + exit(1); + } + + wl_shell_surface_add_listener(shell_surface, &shell_surface_listener, this); + wl_shell_surface_set_toplevel(shell_surface); + wl_shell_surface_set_title(shell_surface, APP_SHORT_NAME); +} +#elif defined(VK_USE_PLATFORM_MACOS_MVK) +void Demo::run() { + draw(); + curFrame++; + if (frameCount != UINT32_MAX && curFrame == frameCount) { + quit = true; + } +} +#elif defined(VK_USE_PLATFORM_MIR_KHR) +#elif defined(VK_USE_PLATFORM_DISPLAY_KHR) - xcb_window = xcb_generate_id(connection); +vk::Result Demo::create_display_surface() { + vk::Result result; + uint32_t display_count; + uint32_t mode_count; + uint32_t plane_count; + vk::DisplayPropertiesKHR display_props; + vk::DisplayKHR display; + vk::DisplayModePropertiesKHR mode_props; + vk::DisplayPlanePropertiesKHR *plane_props; + vk::Bool32 found_plane = VK_FALSE; + uint32_t plane_index; + vk::Extent2D image_extent; - value_mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK; - value_list[0] = screen->black_pixel; - value_list[1] = XCB_EVENT_MASK_KEY_RELEASE | XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY; + // Get the first display + result = gpu.getDisplayPropertiesKHR(&display_count, nullptr); + VERIFY(result == vk::Result::eSuccess); - xcb_create_window(connection, XCB_COPY_FROM_PARENT, xcb_window, screen->root, 0, 0, width, height, 0, - XCB_WINDOW_CLASS_INPUT_OUTPUT, screen->root_visual, value_mask, value_list); + if (display_count == 0) { + printf("Cannot find any display!\n"); + fflush(stdout); + exit(1); + } - /* Magic code that will send notification when window is destroyed */ - xcb_intern_atom_cookie_t cookie = xcb_intern_atom(connection, 1, 12, "WM_PROTOCOLS"); - xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(connection, cookie, 0); + display_count = 1; + result = gpu.getDisplayPropertiesKHR(&display_count, &display_props); + VERIFY((result == vk::Result::eSuccess) || (result == vk::Result::eIncomplete)); - xcb_intern_atom_cookie_t cookie2 = xcb_intern_atom(connection, 0, 16, "WM_DELETE_WINDOW"); - atom_wm_delete_window = xcb_intern_atom_reply(connection, cookie2, 0); + display = display_props.display; - xcb_change_property(connection, XCB_PROP_MODE_REPLACE, xcb_window, (*reply).atom, 4, 32, 1, &(*atom_wm_delete_window).atom); + // Get the first mode of the display + result = gpu.getDisplayModePropertiesKHR(display, &mode_count, nullptr); + VERIFY(result == vk::Result::eSuccess); - free(reply); + if (mode_count == 0) { + printf("Cannot find any mode for the display!\n"); + fflush(stdout); + exit(1); + } - xcb_map_window(connection, xcb_window); + mode_count = 1; + result = gpu.getDisplayModePropertiesKHR(display, &mode_count, &mode_props); + VERIFY((result == vk::Result::eSuccess) || (result == vk::Result::eIncomplete)); - // Force the x/y coordinates to 100,100 results are identical in - // consecutive - // runs - const uint32_t coords[] = {100, 100}; - xcb_configure_window(connection, xcb_window, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, coords); - } -#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) + // Get the list of planes + result = gpu.getDisplayPlanePropertiesKHR(&plane_count, nullptr); + VERIFY(result == vk::Result::eSuccess); - void Demo::run() { - while (!quit) { - if (pause) { - wl_display_dispatch(display); - } else { - wl_display_dispatch_pending(display); - update_data_buffer(); - draw(); - curFrame++; - if (frameCount != UINT32_MAX && curFrame == frameCount) { - quit = true; - } - } - } + if (plane_count == 0) { + printf("Cannot find any plane!\n"); + fflush(stdout); + exit(1); } - void Demo::create_window() { - window = wl_compositor_create_surface(compositor); - if (!window) { - printf("Can not create wayland_surface from compositor!\n"); - fflush(stdout); - exit(1); - } - - shell_surface = wl_shell_get_shell_surface(shell, window); - if (!shell_surface) { - printf("Can not get shell_surface from wayland_surface!\n"); - fflush(stdout); - exit(1); - } - - wl_shell_surface_add_listener(shell_surface, &shell_surface_listener, this); - wl_shell_surface_set_toplevel(shell_surface); - wl_shell_surface_set_title(shell_surface, APP_SHORT_NAME); - } -#elif defined(VK_USE_PLATFORM_MIR_KHR) -#elif defined(VK_USE_PLATFORM_DISPLAY_KHR) + plane_props = (vk::DisplayPlanePropertiesKHR *)malloc(sizeof(vk::DisplayPlanePropertiesKHR) * plane_count); + VERIFY(plane_props != nullptr); - vk::Result Demo::create_display_surface() { - vk::Result result; - uint32_t display_count; - uint32_t mode_count; - uint32_t plane_count; - vk::DisplayPropertiesKHR display_props; - vk::DisplayKHR display; - vk::DisplayModePropertiesKHR mode_props; - vk::DisplayPlanePropertiesKHR *plane_props; - vk::Bool32 found_plane = VK_FALSE; - uint32_t plane_index; - vk::Extent2D image_extent; + result = gpu.getDisplayPlanePropertiesKHR(&plane_count, plane_props); + VERIFY(result == vk::Result::eSuccess); - // Get the first display - result = gpu.getDisplayPropertiesKHR(&display_count, nullptr); - VERIFY(result == vk::Result::eSuccess); + // Find a plane compatible with the display + for (plane_index = 0; plane_index < plane_count; plane_index++) { + uint32_t supported_count; + vk::DisplayKHR *supported_displays; - if (display_count == 0) { - printf("Cannot find any display!\n"); - fflush(stdout); - exit(1); + // Disqualify planes that are bound to a different display + if (plane_props[plane_index].currentDisplay && (plane_props[plane_index].currentDisplay != display)) { + continue; } - display_count = 1; - result = gpu.getDisplayPropertiesKHR(&display_count, &display_props); - VERIFY((result == vk::Result::eSuccess) || (result == vk::Result::eIncomplete)); - - display = display_props.display; - - // Get the first mode of the display - result = gpu.getDisplayModePropertiesKHR(display, &mode_count, nullptr); + result = gpu.getDisplayPlaneSupportedDisplaysKHR(plane_index, &supported_count, nullptr); VERIFY(result == vk::Result::eSuccess); - if (mode_count == 0) { - printf("Cannot find any mode for the display!\n"); - fflush(stdout); - exit(1); + if (supported_count == 0) { + continue; } - mode_count = 1; - result = gpu.getDisplayModePropertiesKHR(display, &mode_count, &mode_props); - VERIFY((result == vk::Result::eSuccess) || (result == vk::Result::eIncomplete)); + supported_displays = (vk::DisplayKHR *)malloc(sizeof(vk::DisplayKHR) * supported_count); + VERIFY(supported_displays != nullptr); - // Get the list of planes - result = gpu.getDisplayPlanePropertiesKHR(&plane_count, nullptr); + result = gpu.getDisplayPlaneSupportedDisplaysKHR(plane_index, &supported_count, supported_displays); VERIFY(result == vk::Result::eSuccess); - if (plane_count == 0) { - printf("Cannot find any plane!\n"); - fflush(stdout); - exit(1); - } - - plane_props = (vk::DisplayPlanePropertiesKHR *)malloc(sizeof(vk::DisplayPlanePropertiesKHR) * plane_count); - VERIFY(plane_props != nullptr); - - result = gpu.getDisplayPlanePropertiesKHR(&plane_count, plane_props); - VERIFY(result == vk::Result::eSuccess); - - // Find a plane compatible with the display - for (plane_index = 0; plane_index < plane_count; plane_index++) { - uint32_t supported_count; - vk::DisplayKHR *supported_displays; - - // Disqualify planes that are bound to a different display - if (plane_props[plane_index].currentDisplay && (plane_props[plane_index].currentDisplay != display)) { - continue; - } - - result = gpu.getDisplayPlaneSupportedDisplaysKHR(plane_index, &supported_count, nullptr); - VERIFY(result == vk::Result::eSuccess); - - if (supported_count == 0) { - continue; - } - - supported_displays = (vk::DisplayKHR *)malloc(sizeof(vk::DisplayKHR) * supported_count); - VERIFY(supported_displays != nullptr); - - result = gpu.getDisplayPlaneSupportedDisplaysKHR(plane_index, &supported_count, supported_displays); - VERIFY(result == vk::Result::eSuccess); - - for (uint32_t i = 0; i < supported_count; i++) { - if (supported_displays[i] == display) { - found_plane = VK_TRUE; - break; - } + for (uint32_t i = 0; i < supported_count; i++) { + if (supported_displays[i] == display) { + found_plane = VK_TRUE; + break; } + } - free(supported_displays); + free(supported_displays); - if (found_plane) { - break; - } + if (found_plane) { + break; } + } - if (!found_plane) { - printf("Cannot find a plane compatible with the display!\n"); - fflush(stdout); - exit(1); - } - - free(plane_props); - - vk::DisplayPlaneCapabilitiesKHR planeCaps; - gpu.getDisplayPlaneCapabilitiesKHR(mode_props.displayMode, plane_index, &planeCaps); - // Find a supported alpha mode - vk::DisplayPlaneAlphaFlagBitsKHR alphaMode = vk::DisplayPlaneAlphaFlagBitsKHR::eOpaque; - vk::DisplayPlaneAlphaFlagBitsKHR alphaModes[4] = { - vk::DisplayPlaneAlphaFlagBitsKHR::eOpaque, - vk::DisplayPlaneAlphaFlagBitsKHR::eGlobal, - vk::DisplayPlaneAlphaFlagBitsKHR::ePerPixel, - vk::DisplayPlaneAlphaFlagBitsKHR::ePerPixelPremultiplied, - }; - for (uint32_t i = 0; i < sizeof(alphaModes); i++) { - if (planeCaps.supportedAlpha & alphaModes[i]) { - alphaMode = alphaModes[i]; - break; - } + if (!found_plane) { + printf("Cannot find a plane compatible with the display!\n"); + fflush(stdout); + exit(1); + } + + free(plane_props); + + vk::DisplayPlaneCapabilitiesKHR planeCaps; + gpu.getDisplayPlaneCapabilitiesKHR(mode_props.displayMode, plane_index, &planeCaps); + // Find a supported alpha mode + vk::DisplayPlaneAlphaFlagBitsKHR alphaMode = vk::DisplayPlaneAlphaFlagBitsKHR::eOpaque; + vk::DisplayPlaneAlphaFlagBitsKHR alphaModes[4] = { + vk::DisplayPlaneAlphaFlagBitsKHR::eOpaque, + vk::DisplayPlaneAlphaFlagBitsKHR::eGlobal, + vk::DisplayPlaneAlphaFlagBitsKHR::ePerPixel, + vk::DisplayPlaneAlphaFlagBitsKHR::ePerPixelPremultiplied, + }; + for (uint32_t i = 0; i < sizeof(alphaModes); i++) { + if (planeCaps.supportedAlpha & alphaModes[i]) { + alphaMode = alphaModes[i]; + break; } + } - image_extent.setWidth(mode_props.parameters.visibleRegion.width); - image_extent.setHeight(mode_props.parameters.visibleRegion.height); + image_extent.setWidth(mode_props.parameters.visibleRegion.width); + image_extent.setHeight(mode_props.parameters.visibleRegion.height); - auto const createInfo = vk::DisplaySurfaceCreateInfoKHR() - .setDisplayMode(mode_props.displayMode) - .setPlaneIndex(plane_index) - .setPlaneStackIndex(plane_props[plane_index].currentStackIndex) - .setGlobalAlpha(1.0f) - .setAlphaMode(alphaMode) - .setImageExtent(image_extent); + auto const createInfo = vk::DisplaySurfaceCreateInfoKHR() + .setDisplayMode(mode_props.displayMode) + .setPlaneIndex(plane_index) + .setPlaneStackIndex(plane_props[plane_index].currentStackIndex) + .setGlobalAlpha(1.0f) + .setAlphaMode(alphaMode) + .setImageExtent(image_extent); - return inst.createDisplayPlaneSurfaceKHR(&createInfo, nullptr, &surface); - } + return inst.createDisplayPlaneSurfaceKHR(&createInfo, nullptr, &surface); +} - void Demo::run_display() { - while (!quit) { - draw(); - curFrame++; +void Demo::run_display() { + while (!quit) { + draw(); + curFrame++; - if (frameCount != INT32_MAX && curFrame == frameCount) { - quit = true; - } + if (frameCount != INT32_MAX && curFrame == frameCount) { + quit = true; } } +} #endif #if _WIN32 @@ -2988,6 +2979,18 @@ return validation_error; } +#elif defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_MACOS_MVK) + +// Global function invoked from NS or UI views and controllers to create demo +static void demo_main(struct Demo &demo, void *view, int argc, const char *argv[]) { + + demo.init(argc, (char **)argv); + demo.window = view; + demo.init_vk_swapchain(); + demo.prepare(); + demo.spin_angle = 0.4f; +} + #else #error "Platform not supported" #endif diff -Nru vulkan-1.0.65.2+dfsg1/demos/cube.frag vulkan-1.1.73+dfsg/demos/cube.frag --- vulkan-1.0.65.2+dfsg1/demos/cube.frag 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/cube.frag 2018-04-27 11:24:19.000000000 +0000 @@ -24,7 +24,15 @@ layout (binding = 1) uniform sampler2D tex; layout (location = 0) in vec4 texcoord; +layout (location = 1) in vec3 frag_pos; layout (location = 0) out vec4 uFragColor; + +const vec3 lightDir= vec3(0.424, 0.566, 0.707); + void main() { - uFragColor = texture(tex, texcoord.xy); + vec3 dX = dFdx(frag_pos); + vec3 dY = dFdy(frag_pos); + vec3 normal = normalize(cross(dX,dY)); + float light = max(0.0, dot(lightDir, normal)); + uFragColor = light * texture(tex, texcoord.xy); } diff -Nru vulkan-1.0.65.2+dfsg1/demos/cube.vert vulkan-1.1.73+dfsg/demos/cube.vert --- vulkan-1.0.65.2+dfsg1/demos/cube.vert 2017-07-03 14:21:22.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/cube.vert 2018-04-27 11:24:19.000000000 +0000 @@ -28,9 +28,11 @@ } ubuf; layout (location = 0) out vec4 texcoord; +layout (location = 1) out vec3 frag_pos; void main() { texcoord = ubuf.attr[gl_VertexIndex]; gl_Position = ubuf.MVP * ubuf.position[gl_VertexIndex]; + frag_pos = gl_Position.xyz; } diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/common.cmake vulkan-1.1.73+dfsg/demos/macOS/common.cmake --- vulkan-1.0.65.2+dfsg1/demos/macOS/common.cmake 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/common.cmake 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,39 @@ +# Set up common settings for building all demos on Apple platforms. + +# Source for the MoltenVK ICD library and JSON file +set(MOLTENVK_DIR "${PROJECT_SOURCE_DIR}/external/MoltenVK") + +# MoltenVK JSON File + +# Modify the ICD JSON file to adjust the library path. +# The ICD JSON file goes in the Resources/vulkan/icd.d directory, so adjust the +# library_path to the relative path to the Frameworks directory in the bundle.. +# The regex does: substitute ':"' with: +# ': "../../../Frameworks/' +add_custom_target(MoltenVK_icd-staging-json ALL + COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/staging-json + COMMAND sed -e "/\"library_path\":/s$:[[:space:]]*\"[[:space:]]*[\\.\\/]*$: \"..\\/..\\/..\\/Frameworks\\/$" + ${MOLTENVK_DIR}/MoltenVK/icd/MoltenVK_icd.json > + ${CMAKE_CURRENT_BINARY_DIR}/staging-json/MoltenVK_icd.json + VERBATIM + DEPENDS "${MOLTENVK_DIR}/MoltenVK/icd/MoltenVK_icd.json" +) +set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/staging-json/MoltenVK_icd.json PROPERTIES + GENERATED TRUE +) + +find_library(COCOA NAMES Cocoa) + +# Locate Interface Builder Tool, needed to build things like Storyboards outside of Xcode. +if (NOT ${CMAKE_GENERATOR} MATCHES "^Xcode.*") + # Make sure we can find the 'ibtool' program. If we can NOT find it we + # skip generation of this project + find_program(IBTOOL ibtool HINTS "/usr/bin" "${OSX_DEVELOPER_ROOT}/usr/bin") + if (${IBTOOL} STREQUAL "IBTOOL-NOTFOUND") + message(SEND_ERROR + "ibtool can not be found and is needed to compile the .xib files. " + "It should have been installed with the Apple developer tools. " + "The default system paths were searched in addition to ${OSX_DEVELOPER_ROOT}/usr/bin." + ) + endif() +endif() diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/cube/AppDelegate.h vulkan-1.1.73+dfsg/demos/macOS/cube/AppDelegate.h --- vulkan-1.0.65.2+dfsg1/demos/macOS/cube/AppDelegate.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/cube/AppDelegate.h 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,23 @@ +/* + * AppDelegate.h + * + * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@interface AppDelegate : NSObject + +@end diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/cube/AppDelegate.m vulkan-1.1.73+dfsg/demos/macOS/cube/AppDelegate.m --- vulkan-1.0.65.2+dfsg1/demos/macOS/cube/AppDelegate.m 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/cube/AppDelegate.m 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,39 @@ +/* + * AppDelegate.m + * + * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + // Insert code here to initialize your application +} + +- (void)applicationWillTerminate:(NSNotification *)aNotification { + // Insert code here to tear down your application +} + +- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender { + return YES; +} + +@end diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/cube/cube.cmake vulkan-1.1.73+dfsg/demos/macOS/cube/cube.cmake --- vulkan-1.0.65.2+dfsg1/demos/macOS/cube/cube.cmake 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/cube/cube.cmake 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,98 @@ +# Cube Application Bundle + +set(cube_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/main.m + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/AppDelegate.m + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/DemoViewController.m +) +set(cube_HDRS + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/AppDelegate.h + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/DemoViewController.h +) +set(cube_RESOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/lunarg.ppm + ${CMAKE_CURRENT_BINARY_DIR}/staging-json/MoltenVK_icd.json + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/Resources/LunarGIcon.icns +) + +# Have Xcode handle the Storyboard +if(${CMAKE_GENERATOR} MATCHES "^Xcode.*") + set(cube_RESOURCES ${cube_RESOURCES} + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/Resources/Main.storyboard + ) +endif() + +add_executable(cube MACOSX_BUNDLE + ${cube_SRCS} + ${cube_HDRS} + ${cube_RESOURCES} + cube.vert.inc cube.frag.inc +) + +# Handle the Storyboard ourselves +if(NOT ${CMAKE_GENERATOR} MATCHES "^Xcode.*") + # Compile the storyboard file with the ibtool. + add_custom_command(TARGET cube POST_BUILD + COMMAND ${IBTOOL} --errors --warnings --notices --output-format human-readable-text + --compile ${CMAKE_CURRENT_BINARY_DIR}/cube.app/Contents/Resources/Main.storyboardc + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/Resources/Main.storyboard + COMMENT "Compiling storyboard" + ) +endif() + +add_dependencies(cube MoltenVK_icd-staging-json) + +# Include demo source code dir because the MacOS cube's Objective-C source includes +# the "original" cube application C source code. +# Also include the MoltenVK helper files. +target_include_directories(cube PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${MOLTENVK_DIR}/MoltenVK/include +) + +target_link_libraries(cube ${LIBRARIES} "-framework Cocoa -framework QuartzCore") + +set_target_properties(cube PROPERTIES + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cube/Info.plist +) + +# The RESOURCE target property cannot be used in conjunction with the MACOSX_PACKAGE_LOCATION +# property. We need fine-grained control over the Resource directory, so we have to specify +# the destination of all the resource files on a per-destination-directory basis. +# If all the files went into the top-level Resource directory, then we could simply set +# the RESOURCE property to a list of all the resource files. +set_source_files_properties(${cube_RESOURCES} PROPERTIES + MACOSX_PACKAGE_LOCATION "Resources" +) +set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/staging-json/MoltenVK_icd.json" PROPERTIES + MACOSX_PACKAGE_LOCATION "Resources/vulkan/icd.d" +) + +# Copy the MoltenVK lib into the bundle. +if(${CMAKE_GENERATOR} MATCHES "^Xcode.*") + add_custom_command(TARGET cube POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/MoltenVK/MacOS/libMoltenVK.dylib" + ${CMAKE_CURRENT_BINARY_DIR}/$/cube.app/Contents/Frameworks/libMoltenVK.dylib + DEPENDS vulkan + ) +else() + add_custom_command(TARGET cube POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/MoltenVK/MacOS/libMoltenVK.dylib" + ${CMAKE_CURRENT_BINARY_DIR}/cube.app/Contents/Frameworks/libMoltenVK.dylib + DEPENDS vulkan + ) +endif() + +# Fix up the library search path in the executable to find (loader) libraries in the bundle. +install(CODE " + include(BundleUtilities) + fixup_bundle(${CMAKE_INSTALL_PREFIX}/demos/cube.app \"\" \"\") + " COMPONENT Runtime +) + +# Not sure this is needed. When activated, it makes a symlink from +# libvulkan.dylib to libvulkan.1.dylib (which in turn symlinks to libvulkan.1.0.xx.dylib.) +# install(FILES +# "${CMAKE_BINARY_DIR}/loader/libvulkan.dylib" +# DESTINATION "demos/cube.app/Contents/MacOS" +# COMPONENT Runtime) diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/cube/DemoViewController.h vulkan-1.1.73+dfsg/demos/macOS/cube/DemoViewController.h --- vulkan-1.0.65.2+dfsg1/demos/macOS/cube/DemoViewController.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/cube/DemoViewController.h 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * DemoViewController.h + * + * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#pragma mark - +#pragma mark DemoViewController + +/** The main view controller for the demo storyboard. */ +@interface DemoViewController : NSViewController +@end + +#pragma mark - +#pragma mark DemoView + +/** The Metal-compatibile view for the demo Storyboard. */ +@interface DemoView : NSView +@end diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/cube/DemoViewController.m vulkan-1.1.73+dfsg/demos/macOS/cube/DemoViewController.m --- vulkan-1.0.65.2+dfsg1/demos/macOS/cube/DemoViewController.m 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/cube/DemoViewController.m 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,118 @@ +/* + * DemoViewController.m + * + * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "DemoViewController.h" +#import + +#include + +#include "cube.c" + +#pragma mark - +#pragma mark DemoViewController + +@implementation DemoViewController { + CVDisplayLinkRef _displayLink; + struct demo demo; + NSTimer* _timer; +} + +- (void)dealloc { + demo_cleanup(&demo); + CVDisplayLinkRelease(_displayLink); + [super dealloc]; +} + +/** Since this is a single-view app, initialize Vulkan during view loading. */ +- (void)viewDidLoad { + [super viewDidLoad]; + + self.view.wantsLayer = YES; // Back the view with a layer created by the makeBackingLayer method. + + // Convert incoming args to "C" argc/argv strings + NSArray *args = [[NSProcessInfo processInfo] arguments]; + const char** argv = (const char**) alloca(sizeof(char*) * args.count); + for(unsigned int i = 0; i < args.count; i++) { + NSString *s = args[i]; + argv[i] = s.UTF8String; + } + + demo_main(&demo, self.view, args.count, argv); + + // Monitor the rendering loop for a quit condition + _timer = [NSTimer scheduledTimerWithTimeInterval: 0.2 + target: self + selector: @selector(onTick:) + userInfo: self + repeats: YES]; + + // Start the rendering loop + CVDisplayLinkCreateWithActiveCGDisplays(&_displayLink); + CVDisplayLinkSetOutputCallback(_displayLink, &DisplayLinkCallback, &demo); + CVDisplayLinkStart(_displayLink); + +} + +// Close the window if the demo is in a Quit state +-(void)onTick:(NSTimer*)timer { + if (demo.quit) { + [[[self view] window] close]; + } +} + +#pragma mark Display loop callback function + +/** Rendering loop callback function for use with a CVDisplayLink. */ +static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* now, + const CVTimeStamp* outputTime, + CVOptionFlags flagsIn, CVOptionFlags* flagsOut, void* target) { + struct demo* demo = (struct demo*)target; + demo_run(demo); + if (demo->quit) { + CVDisplayLinkStop(displayLink); + CVDisplayLinkRelease(displayLink); + } + return kCVReturnSuccess; +} + +@end + +#pragma mark - +#pragma mark DemoView + +@implementation DemoView + +/** Indicates that the view wants to draw using the backing layer instead of using drawRect:. */ +- (BOOL)wantsUpdateLayer { + return YES; +} + +/** Returns a Metal-compatible layer. */ ++ (Class)layerClass { + return [CAMetalLayer class]; +} + +/** If the wantsLayer property is set to YES, this method will be invoked to return a layer instance. */ +- (CALayer*)makeBackingLayer { + CALayer* layer = [self.class.layerClass layer]; + CGSize viewScale = [self convertSizeToBacking:CGSizeMake(1.0, 1.0)]; + layer.contentsScale = MIN(viewScale.width, viewScale.height); + return layer; +} + +@end diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/cube/Info.plist vulkan-1.1.73+dfsg/demos/macOS/cube/Info.plist --- vulkan-1.0.65.2+dfsg1/demos/macOS/cube/Info.plist 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/cube/Info.plist 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${MACOSX_BUNDLE_EXECUTABLE_NAME} + CFBundleGetInfoString + Cube + CFBundleIconFile + LunarGIcon.icns + CFBundleIdentifier + com.lunarg.cube + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + 1.0 + CFBundleName + Cube + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + CSResourcesFileMapped + + NSHumanReadableCopyright + Copyright (c) 2018 The Khronos Group Inc. LunarG Inc. All rights reserved. + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + + \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/cube/main.m vulkan-1.1.73+dfsg/demos/macOS/cube/main.m --- vulkan-1.0.65.2+dfsg1/demos/macOS/cube/main.m 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/cube/main.m 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,21 @@ +/* + * main.m + * + * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +int main(int argc, const char* argv[]) { return NSApplicationMain(argc, argv); } Binary files /tmp/tmp8LVRSV/k7IHu5fWhy/vulkan-1.0.65.2+dfsg1/demos/macOS/cube/Resources/LunarGIcon.icns and /tmp/tmp8LVRSV/BBiKMQpAzm/vulkan-1.1.73+dfsg/demos/macOS/cube/Resources/LunarGIcon.icns differ diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/cube/Resources/Main.storyboard vulkan-1.1.73+dfsg/demos/macOS/cube/Resources/Main.storyboard --- vulkan-1.0.65.2+dfsg1/demos/macOS/cube/Resources/Main.storyboard 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/cube/Resources/Main.storyboard 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/cubepp/AppDelegate.h vulkan-1.1.73+dfsg/demos/macOS/cubepp/AppDelegate.h --- vulkan-1.0.65.2+dfsg1/demos/macOS/cubepp/AppDelegate.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/cubepp/AppDelegate.h 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,23 @@ +/* + * AppDelegate.h + * + * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@interface AppDelegate : NSObject + +@end diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/cubepp/AppDelegate.mm vulkan-1.1.73+dfsg/demos/macOS/cubepp/AppDelegate.mm --- vulkan-1.0.65.2+dfsg1/demos/macOS/cubepp/AppDelegate.mm 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/cubepp/AppDelegate.mm 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,39 @@ +/* + * AppDelegate.m + * + * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + // Insert code here to initialize your application +} + +- (void)applicationWillTerminate:(NSNotification *)aNotification { + // Insert code here to tear down your application +} + +- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender { + return YES; +} + +@end diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/cubepp/cubepp.cmake vulkan-1.1.73+dfsg/demos/macOS/cubepp/cubepp.cmake --- vulkan-1.0.65.2+dfsg1/demos/macOS/cubepp/cubepp.cmake 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/cubepp/cubepp.cmake 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,104 @@ +# Cube Application Bundle + +set(cubepp_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/main.mm + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/AppDelegate.mm + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/DemoViewController.mm +) +set(cubepp_HDRS + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/AppDelegate.h + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/DemoViewController.h +) +set(cubepp_RESOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/lunarg.ppm + ${CMAKE_CURRENT_BINARY_DIR}/staging-json/MoltenVK_icd.json + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/Resources/LunarGIcon.icns +) + +# Have Xcode handle the Storyboard +if(${CMAKE_GENERATOR} MATCHES "^Xcode.*") + set(cubepp_RESOURCES ${cubepp_RESOURCES} + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/Resources/Main.storyboard + ) +endif() + +add_executable(cubepp MACOSX_BUNDLE + ${cubepp_SRCS} + ${cubepp_HDRS} + ${cubepp_RESOURCES} + cube.vert.inc cube.frag.inc +) + +# Handle the Storyboard ourselves +if(NOT ${CMAKE_GENERATOR} MATCHES "^Xcode.*") + # Compile the storyboard file with the ibtool. + add_custom_command(TARGET cubepp POST_BUILD + COMMAND ${IBTOOL} --errors --warnings --notices --output-format human-readable-text + --compile ${CMAKE_CURRENT_BINARY_DIR}/cubepp.app/Contents/Resources/Main.storyboardc + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/Resources/Main.storyboard + COMMENT "Compiling storyboard" + ) +endif() + +add_dependencies(cubepp MoltenVK_icd-staging-json) + +# Include demo source code dir because the MacOS cubepp's Objective-C source includes +# the "original" cubepp application C++ source code. +# Also include the MoltenVK helper files. +target_include_directories(cubepp PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${MOLTENVK_DIR}/MoltenVK/include +) + +target_link_libraries(cubepp ${LIBRARIES} "-framework Cocoa -framework QuartzCore") + +set_target_properties(cubepp PROPERTIES + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/macOS/cubepp/Info.plist +) + +# The RESOURCE target property cannot be used in conjunction with the MACOSX_PACKAGE_LOCATION +# property. We need fine-grained control over the Resource directory, so we have to specify +# the destination of all the resource files on a per-destination-directory basis. +# If all the files went into the top-level Resource directory, then we could simply set +# the RESOURCE property to a list of all the resource files. +set_source_files_properties(${cubepp_RESOURCES} PROPERTIES + MACOSX_PACKAGE_LOCATION "Resources" +) +set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/staging-json/MoltenVK_icd.json" PROPERTIES + MACOSX_PACKAGE_LOCATION "Resources/vulkan/icd.d" +) + +# Direct the MoltenVK library to the right place. +install(FILES "${MOLTENVK_DIR}/MoltenVK/MacOS/libMoltenVK.dylib" + DESTINATION "demos/cubepp.app/Contents/Frameworks" + COMPONENT Runtime +) + +# Copy the MoltenVK lib into the bundle. +if(${CMAKE_GENERATOR} MATCHES "^Xcode.*") + add_custom_command(TARGET cubepp POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/MoltenVK/MacOS/libMoltenVK.dylib" + ${CMAKE_CURRENT_BINARY_DIR}/$/cubepp.app/Contents/Frameworks/libMoltenVK.dylib + DEPENDS vulkan + ) +else() + add_custom_command(TARGET cubepp POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/MoltenVK/MacOS/libMoltenVK.dylib" + ${CMAKE_CURRENT_BINARY_DIR}/cubepp.app/Contents/Frameworks/libMoltenVK.dylib + DEPENDS vulkan + ) +endif() + +# Fix up the library search path in the executable to find (loader) libraries in the bundle. +install(CODE " + include(BundleUtilities) + fixup_bundle(${CMAKE_INSTALL_PREFIX}/demos/cubepp.app \"\" \"\") + " COMPONENT Runtime +) + +# Not sure this is needed. When activated, it makes a symlink from +# libvulkan.dylib to libvulkan.1.dylib (which in turn symlinks to libvulkan.1.0.xx.dylib.) +# install(FILES +# "${CMAKE_BINARY_DIR}/loader/libvulkan.dylib" +# DESTINATION "demos/cubepp.app/Contents/MacOS" +# COMPONENT Runtime) diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/cubepp/DemoViewController.h vulkan-1.1.73+dfsg/demos/macOS/cubepp/DemoViewController.h --- vulkan-1.0.65.2+dfsg1/demos/macOS/cubepp/DemoViewController.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/cubepp/DemoViewController.h 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * DemoViewController.h + * + * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#pragma mark - +#pragma mark DemoViewController + +/** The main view controller for the demo storyboard. */ +@interface DemoViewController : NSViewController +@end + +#pragma mark - +#pragma mark DemoView + +/** The Metal-compatibile view for the demo Storyboard. */ +@interface DemoView : NSView +@end diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/cubepp/DemoViewController.mm vulkan-1.1.73+dfsg/demos/macOS/cubepp/DemoViewController.mm --- vulkan-1.0.65.2+dfsg1/demos/macOS/cubepp/DemoViewController.mm 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/cubepp/DemoViewController.mm 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,117 @@ +/* + * DemoViewController.m + * + * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "DemoViewController.h" +#import + +#include + +#include "cube.cpp" + +#pragma mark - +#pragma mark DemoViewController + +@implementation DemoViewController { + CVDisplayLinkRef _displayLink; + struct Demo demo; + NSTimer* _timer; +} + +- (void)dealloc { + demo.cleanup(); + CVDisplayLinkRelease(_displayLink); + [super dealloc]; +} + +/** Since this is a single-view app, initialize Vulkan during view loading. */ +- (void)viewDidLoad { + [super viewDidLoad]; + + self.view.wantsLayer = YES; // Back the view with a layer created by the makeBackingLayer method. + + // Convert incoming args to "C" argc/argv strings + NSArray *args = [[NSProcessInfo processInfo] arguments]; + const char** argv = (const char**) alloca(sizeof(char*) * args.count); + for(unsigned int i = 0; i < args.count; i++) { + NSString *s = args[i]; + argv[i] = s.UTF8String; + } + + demo_main(demo, self.view, args.count, argv); + + // Monitor the rendering loop for a quit condition + _timer = [NSTimer scheduledTimerWithTimeInterval: 0.2 + target: self + selector: @selector(onTick:) + userInfo: self + repeats: YES]; + + // Start the rendering loop + CVDisplayLinkCreateWithActiveCGDisplays(&_displayLink); + CVDisplayLinkSetOutputCallback(_displayLink, &DisplayLinkCallback, &demo); + CVDisplayLinkStart(_displayLink); +} + +// Close the window if the demo is in a Quit state +-(void)onTick:(NSTimer*)timer { + if (demo.quit) { + [[[self view] window] close]; + } +} + +#pragma mark Display loop callback function + +/** Rendering loop callback function for use with a CVDisplayLink. */ +static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* now, + const CVTimeStamp* outputTime, + CVOptionFlags flagsIn, CVOptionFlags* flagsOut, void* target) { + struct Demo* demo = (struct Demo*)target; + demo->run(); + if (demo->quit) { + CVDisplayLinkStop(displayLink); + CVDisplayLinkRelease(displayLink); + } + return kCVReturnSuccess; +} + +@end + +#pragma mark - +#pragma mark DemoView + +@implementation DemoView + +/** Indicates that the view wants to draw using the backing layer instead of using drawRect:. */ +- (BOOL)wantsUpdateLayer { + return YES; +} + +/** Returns a Metal-compatible layer. */ ++ (Class)layerClass { + return [CAMetalLayer class]; +} + +/** If the wantsLayer property is set to YES, this method will be invoked to return a layer instance. */ +- (CALayer*)makeBackingLayer { + CALayer* layer = [self.class.layerClass layer]; + CGSize viewScale = [self convertSizeToBacking:CGSizeMake(1.0, 1.0)]; + layer.contentsScale = MIN(viewScale.width, viewScale.height); + return layer; +} + +@end diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/cubepp/Info.plist vulkan-1.1.73+dfsg/demos/macOS/cubepp/Info.plist --- vulkan-1.0.65.2+dfsg1/demos/macOS/cubepp/Info.plist 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/cubepp/Info.plist 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${MACOSX_BUNDLE_EXECUTABLE_NAME} + CFBundleGetInfoString + Cubepp + CFBundleIconFile + LunarGIcon.icns + CFBundleIdentifier + com.lunarg.cubepp + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + 1.0 + CFBundleName + Cubepp + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + CSResourcesFileMapped + + NSHumanReadableCopyright + Copyright (c) 2018 The Khronos Group Inc. LunarG Inc. All rights reserved. + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + + \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/cubepp/main.mm vulkan-1.1.73+dfsg/demos/macOS/cubepp/main.mm --- vulkan-1.0.65.2+dfsg1/demos/macOS/cubepp/main.mm 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/cubepp/main.mm 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,21 @@ +/* + * main.m + * + * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +int main(int argc, const char* argv[]) { return NSApplicationMain(argc, argv); } Binary files /tmp/tmp8LVRSV/k7IHu5fWhy/vulkan-1.0.65.2+dfsg1/demos/macOS/cubepp/Resources/LunarGIcon.icns and /tmp/tmp8LVRSV/BBiKMQpAzm/vulkan-1.1.73+dfsg/demos/macOS/cubepp/Resources/LunarGIcon.icns differ diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/cubepp/Resources/Main.storyboard vulkan-1.1.73+dfsg/demos/macOS/cubepp/Resources/Main.storyboard --- vulkan-1.0.65.2+dfsg1/demos/macOS/cubepp/Resources/Main.storyboard 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/cubepp/Resources/Main.storyboard 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Binary files /tmp/tmp8LVRSV/k7IHu5fWhy/vulkan-1.0.65.2+dfsg1/demos/macOS/vulkaninfo/Resources/LunarGIcon.icns and /tmp/tmp8LVRSV/BBiKMQpAzm/vulkan-1.1.73+dfsg/demos/macOS/vulkaninfo/Resources/LunarGIcon.icns differ diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/vulkaninfo/vulkaninfo.cmake vulkan-1.1.73+dfsg/demos/macOS/vulkaninfo/vulkaninfo.cmake --- vulkan-1.0.65.2+dfsg1/demos/macOS/vulkaninfo/vulkaninfo.cmake 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/vulkaninfo/vulkaninfo.cmake 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,53 @@ +# Vulkaninfo Application Bundle + +# We already have a "vulkaninfo" target, so create a new target with a different name +# and use the OUTPUT_NAME property to rename the target to the desired name. +# The standalone binary is called "vulkaninfo" and the bundle is called "vulkaninfo.app". +# Note that the executable is a script that launches Terminal to see the output. +add_executable(vulkaninfo-bundle MACOSX_BUNDLE + vulkaninfo.c + ${CMAKE_CURRENT_BINARY_DIR}/staging-json/MoltenVK_icd.json + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/vulkaninfo/vulkaninfo.sh + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/vulkaninfo/Resources/LunarGIcon.icns +) +set_target_properties(vulkaninfo-bundle PROPERTIES + OUTPUT_NAME vulkaninfo + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/macOS/vulkaninfo/Info.plist +) +target_link_libraries(vulkaninfo-bundle ${LIBRARIES}) +add_dependencies(vulkaninfo-bundle MoltenVK_icd-staging-json) +set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/macOS/vulkaninfo/vulkaninfo.sh PROPERTIES + MACOSX_PACKAGE_LOCATION "MacOS" +) +set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/macOS/vulkaninfo/Resources/LunarGIcon.icns PROPERTIES + MACOSX_PACKAGE_LOCATION "Resources" +) +# Direct the MoltenVK library to the right place. +install(FILES "${MOLTENVK_DIR}/MoltenVK/MacOS/libMoltenVK.dylib" + DESTINATION "demos/vulkaninfo.app/Contents/Frameworks" + COMPONENT Runtime +) +# Xcode projects need some extra help with what would be install steps. +if(${CMAKE_GENERATOR} MATCHES "^Xcode.*") + add_custom_command(TARGET vulkaninfo-bundle POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/MoltenVK/MacOS/libMoltenVK.dylib" + ${CMAKE_CURRENT_BINARY_DIR}/$/vulkaninfo.app/Contents/Frameworks/libMoltenVK.dylib + DEPENDS vulkan + ) +else() + add_custom_command(TARGET vulkaninfo-bundle POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/MoltenVK/MacOS/libMoltenVK.dylib" + ${CMAKE_CURRENT_BINARY_DIR}/vulkaninfo.app/Contents/Frameworks/libMoltenVK.dylib + DEPENDS vulkan + ) +endif() + +# Fix up the library search path in the executable to find (loader) libraries in the bundle. +# When fixup_bundle() is passed a bundle in the first argument, it looks at the Info.plist file +# to determine the BundleExecutable. In this case, the executable is a script, which can't be fixed up. +# Instead pass it the explicit name of the executable. +install(CODE " + include(BundleUtilities) + fixup_bundle(${CMAKE_INSTALL_PREFIX}/demos/vulkaninfo.app/Contents/MacOS/vulkaninfo \"\" \"\") + " COMPONENT Runtime +) diff -Nru vulkan-1.0.65.2+dfsg1/demos/macOS/vulkaninfo/vulkaninfo.sh vulkan-1.1.73+dfsg/demos/macOS/vulkaninfo/vulkaninfo.sh --- vulkan-1.0.65.2+dfsg1/demos/macOS/vulkaninfo/vulkaninfo.sh 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/macOS/vulkaninfo/vulkaninfo.sh 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/bash +BASEDIR=`dirname $0` +open /Applications/Utilities/Terminal.app $BASEDIR/vulkaninfo diff -Nru vulkan-1.0.65.2+dfsg1/demos/smoke/CMakeLists.txt vulkan-1.1.73+dfsg/demos/smoke/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/demos/smoke/CMakeLists.txt 2018-01-03 09:21:40.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/smoke/CMakeLists.txt 2018-04-27 11:24:19.000000000 +0000 @@ -52,7 +52,12 @@ set(libraries PRIVATE ${CMAKE_THREAD_LIBS_INIT}) if(TARGET vulkan) - list(APPEND definitions PRIVATE -DUNINSTALLED_LOADER="$") + if(APPLE) + # For macOS, the "uninstalled" location is in the bundle + list(APPEND definitions PRIVATE -DUNINSTALLED_LOADER="./libvulkan.1.dylib") + else() + list(APPEND definitions PRIVATE -DUNINSTALLED_LOADER="$") + endif() endif() if(WIN32) @@ -60,7 +65,7 @@ list(APPEND definitions PRIVATE -DWIN32_LEAN_AND_MEAN) list(APPEND sources ShellWin32.cpp ShellWin32.h) -else() +elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") list(APPEND libraries PRIVATE -ldl -lrt) if(BUILD_WSI_XCB_SUPPORT AND DEMOS_WSI_SELECTION STREQUAL "XCB") @@ -78,15 +83,99 @@ list(APPEND includes PRIVATE ${WAYLAND_CLIENT_INCLUDE_DIR}) list(APPEND libraries PRIVATE ${WAYLAND_CLIENT_LIBRARIES}) endif() +elseif(APPLE) + set(LIBRARIES) + list(APPEND sources + macOS/AppDelegate.h macOS/AppDelegate.m + macOS/DemoViewController.h macOS/DemoViewController.mm + macOS/main.m macOS/ShellMVK.cpp macOS/ShellMVK.h + ) + list(APPEND includes + ${CMAKE_CURRENT_SOURCE_DIR} + ${MOLTENVK_DIR}/MoltenVK/include) + list(APPEND libraries + "-framework Cocoa -framework QuartzCore") + set(smoketest_RESOURCES + ${CMAKE_BINARY_DIR}/demos/staging-json/MoltenVK_icd.json + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/Resources/LunarGIcon.icns + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/Resources/Main.storyboard + ) + set_source_files_properties(${CMAKE_BINARY_DIR}/demos/staging-json/MoltenVK_icd.json PROPERTIES + GENERATED TRUE + ) + # Have Xcode handle the Storyboard + if(${CMAKE_GENERATOR} MATCHES "^Xcode.*") + list(APPEND sources + macOS/Resources/Main.storyboard + ) + endif() endif() -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/demos) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/..) -add_executable(smoketest ${sources}) +add_executable(smoketest MACOSX_BUNDLE ${sources} ${smoketest_RESOURCES}) target_compile_definitions(smoketest ${definitions}) target_include_directories(smoketest ${includes}) target_link_libraries(smoketest ${libraries}) +if(APPLE) + # Handle the Storyboard ourselves + if(NOT ${CMAKE_GENERATOR} MATCHES "^Xcode.*") + # Compile the storyboard file with the ibtool. + add_custom_command(TARGET smoketest POST_BUILD + COMMAND ${IBTOOL} --errors --warnings --notices --output-format human-readable-text + --compile ${CMAKE_CURRENT_BINARY_DIR}/../smoketest.app/Contents/Resources/Main.storyboardc + ${CMAKE_CURRENT_SOURCE_DIR}/macOS/Resources/Main.storyboard + COMMENT "Compiling storyboard" + ) + endif() + + add_dependencies(smoketest MoltenVK_icd-staging-json) + + set_target_properties(smoketest PROPERTIES + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/macOS/Info.plist + ) + set_source_files_properties(${smoketest_RESOURCES} PROPERTIES + MACOSX_PACKAGE_LOCATION "Resources" + ) + set_source_files_properties("${CMAKE_BINARY_DIR}/demos/staging-json/MoltenVK_icd.json" PROPERTIES + MACOSX_PACKAGE_LOCATION "Resources/vulkan/icd.d" + ) + + # Direct the MoltenVK library to the right place. + install(FILES "${MOLTENVK_DIR}/MoltenVK/MacOS/libMoltenVK.dylib" + DESTINATION "demos/smoketest.app/Contents/Frameworks" + COMPONENT Runtime + ) + + # Xcode projects need some extra help with what would be install steps. + # Vulkan lib needs to be copied manually since smoke does not link it. + if(${CMAKE_GENERATOR} MATCHES "^Xcode.*") + add_custom_command(TARGET smoketest POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "$" + ${CMAKE_CURRENT_BINARY_DIR}/../$/smoketest.app/Contents/MacOS/libvulkan.1.dylib + COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/MoltenVK/MacOS/libMoltenVK.dylib" + ${CMAKE_CURRENT_BINARY_DIR}/../$/smoketest.app/Contents/Frameworks/libMoltenVK.dylib + DEPENDS vulkan + ) + else() + add_custom_command(TARGET smoketest POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "$" + ${CMAKE_CURRENT_BINARY_DIR}/../smoketest.app/Contents/MacOS/libvulkan.1.dylib + COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/MoltenVK/MacOS/libMoltenVK.dylib" + ${CMAKE_CURRENT_BINARY_DIR}/../smoketest.app/Contents/Frameworks/libMoltenVK.dylib + DEPENDS vulkan + ) + endif() + + # Fix up the library search path in the executable to find (loader) libraries in the bundle. + install(CODE " + include(BundleUtilities) + fixup_bundle(${CMAKE_INSTALL_PREFIX}/demos/smoketest.app \"\" \"\") + " COMPONENT Runtime + ) +endif() + if(UNIX) if(INSTALL_LVL_FILES) install(TARGETS smoketest DESTINATION ${CMAKE_INSTALL_BINDIR}) diff -Nru vulkan-1.0.65.2+dfsg1/demos/smoke/Game.cpp vulkan-1.1.73+dfsg/demos/smoke/Game.cpp --- vulkan-1.0.65.2+dfsg1/demos/smoke/Game.cpp 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/smoke/Game.cpp 2018-03-14 09:08:48.000000000 +0000 @@ -1,18 +1,18 @@ /* -* Copyright (C) 2016 Google, 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 (C) 2016 Google, 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. + */ #include diff -Nru vulkan-1.0.65.2+dfsg1/demos/smoke/generate-dispatch-table.py vulkan-1.1.73+dfsg/demos/smoke/generate-dispatch-table.py --- vulkan-1.0.65.2+dfsg1/demos/smoke/generate-dispatch-table.py 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/smoke/generate-dispatch-table.py 2018-04-27 11:24:19.000000000 +0000 @@ -295,6 +295,14 @@ Command(name='DebugReportMessageEXT', dispatch='VkInstance'), ]) +vk_mvk_ios_surface = Extension(name='VK_MVK_ios_surface', version=1, guard='VK_USE_PLATFORM_IOS_MVK', commands=[ + Command(name='CreateIOSSurfaceMVK', dispatch='VkInstance'), +]) + +vk_mvk_macos_surface = Extension(name='VK_MVK_macos_surface', version=1, guard='VK_USE_PLATFORM_MACOS_MVK', commands=[ + Command(name='CreateMacOSSurfaceMVK', dispatch='VkInstance'), +]) + extensions = [ vk_core, vk_khr_surface, @@ -308,6 +316,8 @@ vk_khr_android_surface, vk_khr_win32_surface, vk_ext_debug_report, + vk_mvk_ios_surface, + vk_mvk_macos_surface, ] def generate_header(guard): diff -Nru vulkan-1.0.65.2+dfsg1/demos/smoke/macOS/AppDelegate.h vulkan-1.1.73+dfsg/demos/smoke/macOS/AppDelegate.h --- vulkan-1.0.65.2+dfsg1/demos/smoke/macOS/AppDelegate.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/smoke/macOS/AppDelegate.h 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,23 @@ +/* + * AppDelegate.h + * + * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@interface AppDelegate : NSObject + +@end diff -Nru vulkan-1.0.65.2+dfsg1/demos/smoke/macOS/AppDelegate.m vulkan-1.1.73+dfsg/demos/smoke/macOS/AppDelegate.m --- vulkan-1.0.65.2+dfsg1/demos/smoke/macOS/AppDelegate.m 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/smoke/macOS/AppDelegate.m 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,39 @@ +/* + * AppDelegate.m + * + * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + // Insert code here to initialize your application +} + +- (void)applicationWillTerminate:(NSNotification *)aNotification { + // Insert code here to tear down your application +} + +- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender { + return YES; +} + +@end diff -Nru vulkan-1.0.65.2+dfsg1/demos/smoke/macOS/DemoViewController.h vulkan-1.1.73+dfsg/demos/smoke/macOS/DemoViewController.h --- vulkan-1.0.65.2+dfsg1/demos/smoke/macOS/DemoViewController.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/smoke/macOS/DemoViewController.h 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * DemoViewController.h + * + * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#pragma mark - +#pragma mark DemoViewController + +/** The main view controller for the demo storyboard. */ +@interface DemoViewController : NSViewController +@end + +#pragma mark - +#pragma mark DemoView + +/** The Metal-compatibile view for the demo Storyboard. */ +@interface DemoView : NSView +@end diff -Nru vulkan-1.0.65.2+dfsg1/demos/smoke/macOS/DemoViewController.mm vulkan-1.1.73+dfsg/demos/smoke/macOS/DemoViewController.mm --- vulkan-1.0.65.2+dfsg1/demos/smoke/macOS/DemoViewController.mm 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/smoke/macOS/DemoViewController.mm 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,126 @@ +/* + * DemoViewController.mm + * + * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "DemoViewController.h" +#import + +#include "ShellMVK.h" +#include "Smoke.h" + +#pragma mark - +#pragma mark DemoViewController + +@implementation DemoViewController { + CVDisplayLinkRef _displayLink; + ShellMVK* _shell; + Game* _game; +} + +- (void)dealloc { + delete _shell; + delete _game; + CVDisplayLinkRelease(_displayLink); + [super dealloc]; +} + +/** Since this is a single-view app, initialize Vulkan during view loading. */ +- (void)viewDidLoad { + [super viewDidLoad]; + + self.view.wantsLayer = YES; // Back the view with a layer created by the makeBackingLayer method. + + std::vector args; + // args.push_back("-p"); // Uncomment to use push constants + // args.push_back("-s"); // Uncomment to use a single thread + _game = new Smoke(args); + + _shell = new ShellMVK(*_game); + _shell->run(self.view); + + CVDisplayLinkCreateWithActiveCGDisplays(&_displayLink); + CVDisplayLinkSetOutputCallback(_displayLink, &DisplayLinkCallback, _shell); + CVDisplayLinkStart(_displayLink); +} + +#pragma mark Display loop callback function + +/** Rendering loop callback function for use with a CVDisplayLink. */ +static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* now, const CVTimeStamp* outputTime, + CVOptionFlags flagsIn, CVOptionFlags* flagsOut, void* target) { + ((ShellMVK*)target)->update_and_draw(); + return kCVReturnSuccess; +} + +- (void)viewDidAppear { + self.view.window.initialFirstResponder = self.view; +} + +// Delegated from the view as first responder. +- (void)keyDown:(NSEvent*)theEvent { + Game::Key key; + switch (theEvent.keyCode) { + case 53: + key = Game::KEY_ESC; + break; + case 126: + key = Game::KEY_UP; + break; + case 125: + key = Game::KEY_DOWN; + break; + case 49: + key = Game::KEY_SPACE; + break; + default: + key = Game::KEY_UNKNOWN; + break; + } + + _game->on_key(key); +} + +@end + +#pragma mark - +#pragma mark DemoView + +@implementation DemoView + +/** Indicates that the view wants to draw using the backing layer instead of using drawRect:. */ +- (BOOL)wantsUpdateLayer { + return YES; +} + +/** Returns a Metal-compatible layer. */ ++ (Class)layerClass { + return [CAMetalLayer class]; +} + +/** If the wantsLayer property is set to YES, this method will be invoked to return a layer instance. */ +- (CALayer*)makeBackingLayer { + CALayer* layer = [self.class.layerClass layer]; + CGSize viewScale = [self convertSizeToBacking:CGSizeMake(1.0, 1.0)]; + layer.contentsScale = MIN(viewScale.width, viewScale.height); + return layer; +} + +- (BOOL)acceptsFirstResponder { + return YES; +} + +@end diff -Nru vulkan-1.0.65.2+dfsg1/demos/smoke/macOS/main.m vulkan-1.1.73+dfsg/demos/smoke/macOS/main.m --- vulkan-1.0.65.2+dfsg1/demos/smoke/macOS/main.m 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/smoke/macOS/main.m 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,21 @@ +/* + * main.m + * + * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +int main(int argc, const char* argv[]) { return NSApplicationMain(argc, argv); } Binary files /tmp/tmp8LVRSV/k7IHu5fWhy/vulkan-1.0.65.2+dfsg1/demos/smoke/macOS/Resources/LunarGIcon.icns and /tmp/tmp8LVRSV/BBiKMQpAzm/vulkan-1.1.73+dfsg/demos/smoke/macOS/Resources/LunarGIcon.icns differ diff -Nru vulkan-1.0.65.2+dfsg1/demos/smoke/macOS/Resources/Main.storyboard vulkan-1.1.73+dfsg/demos/smoke/macOS/Resources/Main.storyboard --- vulkan-1.0.65.2+dfsg1/demos/smoke/macOS/Resources/Main.storyboard 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/smoke/macOS/Resources/Main.storyboard 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru vulkan-1.0.65.2+dfsg1/demos/smoke/macOS/ShellMVK.cpp vulkan-1.1.73+dfsg/demos/smoke/macOS/ShellMVK.cpp --- vulkan-1.0.65.2+dfsg1/demos/smoke/macOS/ShellMVK.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/smoke/macOS/ShellMVK.cpp 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,155 @@ +/* + * Copyright (C) 2016-2018 The Brenwill Workshop Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "ShellMVK.h" +#include +#include +#include +#include +#include +#include "Helpers.h" +#include "Game.h" + +PosixTimer::PosixTimer() { + _tsBase = mach_absolute_time(); + mach_timebase_info_data_t timebase; + mach_timebase_info(&timebase); + _tsPeriod = (double)timebase.numer / (double)timebase.denom; +} + +double PosixTimer::get() { return (double)(mach_absolute_time() - _tsBase) * _tsPeriod / 1e9; } + +ShellMVK::ShellMVK(Game& game) : Shell(game) { + _timer = PosixTimer(); + _current_time = _timer.get(); + _profile_start_time = _current_time; + _profile_present_count = 0; + +#ifdef VK_USE_PLATFORM_IOS_MVK + instance_extensions_.push_back(VK_MVK_IOS_SURFACE_EXTENSION_NAME); +#endif +#ifdef VK_USE_PLATFORM_MACOS_MVK + instance_extensions_.push_back(VK_MVK_MACOS_SURFACE_EXTENSION_NAME); +#endif + + init_vk(); +} + +ShellMVK::~ShellMVK() { + destroy_context(); + cleanup_vk(); +} + +PFN_vkGetInstanceProcAddr ShellMVK::load_vk() { + const char filename[] = "libvulkan.1.dylib"; + void* handle = NULL; + void* symbol = NULL; + +#ifdef UNINSTALLED_LOADER + // Try to load the loader from the defined location. + handle = dlopen(UNINSTALLED_LOADER, RTLD_LAZY); +#endif + // If still no loader, try in the bundle executable directory. + if (!handle) { + unsigned int bufferSize = 512; + std::vector buffer(bufferSize + 1); + if (_NSGetExecutablePath(&buffer[0], &bufferSize)) { + buffer.resize(bufferSize); + _NSGetExecutablePath(&buffer[0], &bufferSize); + } + std::string s = &buffer[0]; + size_t i = s.rfind("smoketest"); + s.replace(i, std::string::npos, filename); + handle = dlopen(s.c_str(), RTLD_LAZY); + } + // If still no luck, try the default system libs with the default lib name. + if (!handle) handle = dlopen(filename, RTLD_LAZY); + + if (handle) symbol = dlsym(handle, "vkGetInstanceProcAddr"); + + if (!handle || !symbol) { + std::stringstream ss; + ss << "failed to load " << dlerror(); + + if (handle) dlclose(handle); + + throw std::runtime_error(ss.str()); + } + + return reinterpret_cast(symbol); +} + +bool ShellMVK::can_present(VkPhysicalDevice phy, uint32_t queue_family) { return true; } + +VkSurfaceKHR ShellMVK::create_surface(VkInstance instance) { + VkSurfaceKHR surface; + + VkResult err; +#ifdef VK_USE_PLATFORM_IOS_MVK + VkIOSSurfaceCreateInfoMVK surface_info; + surface_info.sType = VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK; + surface_info.pNext = NULL; + surface_info.flags = 0; + surface_info.pView = _view; + err = vk::CreateIOSSurfaceMVK(instance, &surface_info, NULL, &surface); +#endif +#ifdef VK_USE_PLATFORM_MACOS_MVK + VkMacOSSurfaceCreateInfoMVK surface_info; + surface_info.sType = VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK; + surface_info.pNext = NULL; + surface_info.flags = 0; + surface_info.pView = _view; + err = vk::CreateMacOSSurfaceMVK(instance, &surface_info, NULL, &surface); +#endif + assert(!err); + + return surface; +} + +void ShellMVK::update_and_draw() { + acquire_back_buffer(); + + double t = _timer.get(); + add_game_time(static_cast(t - _current_time)); + + present_back_buffer(); + + _current_time = t; + + _profile_present_count++; + if (_current_time - _profile_start_time >= 5.0) { + const double fps = _profile_present_count / (_current_time - _profile_start_time); + std::stringstream ss; + ss << _profile_present_count << " presents in " << _current_time - _profile_start_time << " seconds " + << "(FPS: " << fps << ")"; + log(LOG_INFO, ss.str().c_str()); + + _profile_start_time = _current_time; + _profile_present_count = 0; + } +} + +void ShellMVK::run(void* view) { + _view = view; // not retained + create_context(); + resize_swapchain(settings_.initial_width, settings_.initial_height); +} diff -Nru vulkan-1.0.65.2+dfsg1/demos/smoke/macOS/ShellMVK.h vulkan-1.1.73+dfsg/demos/smoke/macOS/ShellMVK.h --- vulkan-1.0.65.2+dfsg1/demos/smoke/macOS/ShellMVK.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/smoke/macOS/ShellMVK.h 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2016-2018 The Brenwill Workshop Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef SHELL_MVK_H +#define SHELL_MVK_H + +#include +#include "Shell.h" +#include + +class PosixTimer { + public: + double get(); + PosixTimer(); + + protected: + uint64_t _tsBase; + double _tsPeriod; +}; + +class ShellMVK : public Shell { + public: + ShellMVK(Game& game); + ~ShellMVK(); + + void run(void* view); + void update_and_draw(); + + void run() { run(nullptr); }; + void quit() {} + + protected: + void* _view; + PosixTimer _timer; + double _current_time; + double _profile_start_time; + int _profile_present_count; + + PFN_vkGetInstanceProcAddr load_vk(); + bool can_present(VkPhysicalDevice phy, uint32_t queue_family); + + VkSurfaceKHR create_surface(VkInstance instance); +}; + +#endif // SHELL_MVK_H diff -Nru vulkan-1.0.65.2+dfsg1/demos/smoke/Main.cpp vulkan-1.1.73+dfsg/demos/smoke/Main.cpp --- vulkan-1.0.65.2+dfsg1/demos/smoke/Main.cpp 2018-01-03 09:21:40.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/smoke/Main.cpp 2018-04-27 11:24:19.000000000 +0000 @@ -25,10 +25,12 @@ Game *create_game(const std::vector &args) { return new Smoke(args); } #endif +#if !defined(VK_USE_PLATFORM_MACOS_MVK) Game *create_game(int argc, char **argv) { std::vector args(argv, argv + argc); return new Smoke(args); } +#endif } // namespace diff -Nru vulkan-1.0.65.2+dfsg1/demos/smoke/Meshes.cpp vulkan-1.1.73+dfsg/demos/smoke/Meshes.cpp --- vulkan-1.0.65.2+dfsg1/demos/smoke/Meshes.cpp 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/smoke/Meshes.cpp 2018-03-14 09:08:48.000000000 +0000 @@ -173,42 +173,102 @@ const std::vector> icosahedron_vertices = { // position normal {{ - -l1, -l2, 0.0f, -l1, -l2, 0.0f, - }}, - {{ - l1, -l2, 0.0f, l1, -l2, 0.0f, - }}, - {{ - l1, l2, 0.0f, l1, l2, 0.0f, - }}, - {{ - -l1, l2, 0.0f, -l1, l2, 0.0f, - }}, - - {{ - -l2, 0.0f, -l1, -l2, 0.0f, -l1, - }}, - {{ - l2, 0.0f, -l1, l2, 0.0f, -l1, - }}, - {{ - l2, 0.0f, l1, l2, 0.0f, l1, - }}, - {{ - -l2, 0.0f, l1, -l2, 0.0f, l1, - }}, - - {{ - 0.0f, -l1, -l2, 0.0f, -l1, -l2, - }}, - {{ - 0.0f, l1, -l2, 0.0f, l1, -l2, - }}, - {{ - 0.0f, l1, l2, 0.0f, l1, l2, - }}, - {{ - 0.0f, -l1, l2, 0.0f, -l1, l2, + -l1, + -l2, + 0.0f, + -l1, + -l2, + 0.0f, + }}, + {{ + l1, + -l2, + 0.0f, + l1, + -l2, + 0.0f, + }}, + {{ + l1, + l2, + 0.0f, + l1, + l2, + 0.0f, + }}, + {{ + -l1, + l2, + 0.0f, + -l1, + l2, + 0.0f, + }}, + + {{ + -l2, + 0.0f, + -l1, + -l2, + 0.0f, + -l1, + }}, + {{ + l2, + 0.0f, + -l1, + l2, + 0.0f, + -l1, + }}, + {{ + l2, + 0.0f, + l1, + l2, + 0.0f, + l1, + }}, + {{ + -l2, + 0.0f, + l1, + -l2, + 0.0f, + l1, + }}, + + {{ + 0.0f, + -l1, + -l2, + 0.0f, + -l1, + -l2, + }}, + {{ + 0.0f, + l1, + -l2, + 0.0f, + l1, + -l2, + }}, + {{ + 0.0f, + l1, + l2, + 0.0f, + l1, + l2, + }}, + {{ + 0.0f, + -l1, + l2, + 0.0f, + -l1, + l2, }}, }; const std::vector> icosahedron_faces = { @@ -280,7 +340,9 @@ const Mesh::Position &pos_a = mesh_.positions_[a]; const Mesh::Position &pos_b = mesh_.positions_[b]; Mesh::Position pos_mid = { - (pos_a.x + pos_b.x) / 2.0f, (pos_a.y + pos_b.y) / 2.0f, (pos_a.z + pos_b.z) / 2.0f, + (pos_a.x + pos_b.x) / 2.0f, + (pos_a.y + pos_b.y) / 2.0f, + (pos_a.z + pos_b.z) / 2.0f, }; float scale = radius_ / std::sqrt(pos_mid.x * pos_mid.x + pos_mid.y * pos_mid.y + pos_mid.z * pos_mid.z); pos_mid.x *= scale; @@ -320,12 +382,15 @@ for (int i = 0; i < position_count; i += 3) { mesh.positions_.emplace_back(Mesh::Position{ - (teapot_positions[i + 0] + translate.x) * scale, (teapot_positions[i + 1] + translate.y) * scale, + (teapot_positions[i + 0] + translate.x) * scale, + (teapot_positions[i + 1] + translate.y) * scale, (teapot_positions[i + 2] + translate.z) * scale, }); mesh.normals_.emplace_back(Mesh::Normal{ - teapot_normals[i + 0], teapot_normals[i + 1], teapot_normals[i + 2], + teapot_normals[i + 0], + teapot_normals[i + 1], + teapot_normals[i + 2], }); } @@ -336,10 +401,14 @@ void get_transform(const float *positions, int position_count, Mesh::Position &translate, float &scale) { float min[3] = { - positions[0], positions[1], positions[2], + positions[0], + positions[1], + positions[2], }; float max[3] = { - positions[0], positions[1], positions[2], + positions[0], + positions[1], + positions[2], }; for (int i = 3; i < position_count; i += 3) { for (int j = 0; j < 3; j++) { @@ -353,7 +422,9 @@ translate.z = -(min[2] + max[2]) / 2.0f; float extents[3] = { - max[0] + translate.x, max[1] + translate.y, max[2] + translate.z, + max[0] + translate.x, + max[1] + translate.y, + max[2] + translate.z, }; float max_extent = extents[0]; diff -Nru vulkan-1.0.65.2+dfsg1/demos/smoke/ShellWin32.cpp vulkan-1.1.73+dfsg/demos/smoke/ShellWin32.cpp --- vulkan-1.0.65.2+dfsg1/demos/smoke/ShellWin32.cpp 2017-07-03 07:19:24.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/smoke/ShellWin32.cpp 2018-03-14 09:08:48.000000000 +0000 @@ -84,7 +84,7 @@ win_rect.right - win_rect.left, win_rect.bottom - win_rect.top, nullptr, nullptr, hinstance_, nullptr); SetForegroundWindow(hwnd_); - SetWindowLongPtr(hwnd_, GWLP_USERDATA, (LONG_PTR) this); + SetWindowLongPtr(hwnd_, GWLP_USERDATA, (LONG_PTR)this); } PFN_vkGetInstanceProcAddr ShellWin32::load_vk() { diff -Nru vulkan-1.0.65.2+dfsg1/demos/smoke/Simulation.cpp vulkan-1.1.73+dfsg/demos/smoke/Simulation.cpp --- vulkan-1.0.65.2+dfsg1/demos/smoke/Simulation.cpp 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/smoke/Simulation.cpp 2018-03-14 09:08:48.000000000 +0000 @@ -26,8 +26,16 @@ public: MeshPicker() : pattern_({{ - Meshes::MESH_PYRAMID, Meshes::MESH_ICOSPHERE, Meshes::MESH_TEAPOT, Meshes::MESH_PYRAMID, Meshes::MESH_ICOSPHERE, - Meshes::MESH_PYRAMID, Meshes::MESH_PYRAMID, Meshes::MESH_PYRAMID, Meshes::MESH_PYRAMID, Meshes::MESH_PYRAMID, + Meshes::MESH_PYRAMID, + Meshes::MESH_ICOSPHERE, + Meshes::MESH_TEAPOT, + Meshes::MESH_PYRAMID, + Meshes::MESH_ICOSPHERE, + Meshes::MESH_PYRAMID, + Meshes::MESH_PYRAMID, + Meshes::MESH_PYRAMID, + Meshes::MESH_PYRAMID, + Meshes::MESH_PYRAMID, }}), cur_(-1) {} @@ -249,7 +257,10 @@ float scale = mesh.scale(type); objects_.emplace_back(Object{ - type, glm::vec3(0.5f + 0.5f * (float)i / object_count), color.pick(), Animation(random_dev_(), scale), + type, + glm::vec3(0.5f + 0.5f * (float)i / object_count), + color.pick(), + Animation(random_dev_(), scale), Path(random_dev_()), }); } diff -Nru vulkan-1.0.65.2+dfsg1/demos/vulkaninfo.c vulkan-1.1.73+dfsg/demos/vulkaninfo.c --- vulkan-1.0.65.2+dfsg1/demos/vulkaninfo.c 2018-01-10 14:15:30.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/vulkaninfo.c 2018-04-27 11:24:19.000000000 +0000 @@ -20,6 +20,7 @@ * Author: Mark Lobodzinski * Author: Rene Lindsay * Author: Jeremy Kniager + * Author: Shannon McPherson */ #ifdef __GNUC__ @@ -52,12 +53,12 @@ #include -#define ERR(err) printf("%s:%d: failed with %s\n", __FILE__, __LINE__, VkResultString(err)); +#define ERR(err) fprintf(stderr, "%s:%d: failed with %s\n", __FILE__, __LINE__, VkResultString(err)); #ifdef _WIN32 #define snprintf _snprintf -#define strdup _strdup +#define strdup _strdup // Returns nonzero if the console is used only for this process. Will return // zero if another process (such as cmd.exe) is also attached. @@ -79,6 +80,7 @@ do { \ ERR(err); \ fflush(stdout); \ + fflush(stderr); \ WAIT_FOR_CONSOLE_DESTROY; \ exit(-1); \ } while (0) @@ -94,20 +96,19 @@ #define MAX_QUEUE_TYPES 5 #define APP_SHORT_NAME "vulkaninfo" +static bool html_output = false; +static bool human_readable_output = true; +static bool json_output = false; +static uint32_t selected_gpu = 0; + struct VkStructureHeader { VkStructureType sType; void *pNext; }; -struct AppGpu; - -struct AppDev { - struct AppGpu *gpu; /* point back to the GPU */ - - VkDevice obj; - - VkFormatProperties format_props[VK_FORMAT_RANGE_SIZE]; - VkFormatProperties2KHR format_props2[VK_FORMAT_RANGE_SIZE]; +struct pNextChainBuildingBlockInfo { + VkStructureType sType; + uint32_t mem_size; }; struct LayerExtensionList { @@ -184,8 +185,6 @@ uint32_t device_extension_count; VkExtensionProperties *device_extensions; - - struct AppDev dev; }; static VKAPI_ATTR VkBool32 VKAPI_CALL DbgCallback(VkFlags msgFlags, VkDebugReportObjectTypeEXT objType, uint64_t srcObject, @@ -472,24 +471,48 @@ #endif static bool CheckExtensionEnabled(const char *extension_to_check, const char **extension_list, uint32_t extension_count) { - for (uint32_t i = 0; i < extension_count; i++) { - if (!strcmp(extension_to_check, extension_list[i])) return true; + for (uint32_t i = 0; i < extension_count; ++i) { + if (!strcmp(extension_to_check, extension_list[i])) { + return true; + } + } + return false; +} + +static bool CheckPhysicalDeviceExtensionIncluded(const char *extension_to_check, VkExtensionProperties *extension_list, + uint32_t extension_count) { + for (uint32_t i = 0; i < extension_count; ++i) { + if (!strcmp(extension_to_check, extension_list[i].extensionName)) { + return true; + } } return false; } -static void AppDevInitFormats(struct AppDev *dev) { - VkFormat f; - for (f = 0; f < VK_FORMAT_RANGE_SIZE; f++) { - const VkFormat fmt = f; - vkGetPhysicalDeviceFormatProperties(dev->gpu->obj, fmt, &dev->format_props[f]); - - if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, dev->gpu->inst->inst_extensions, - dev->gpu->inst->inst_extensions_count)) { - dev->format_props2[f].sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR; - dev->format_props2[f].pNext = NULL; - dev->gpu->inst->vkGetPhysicalDeviceFormatProperties2KHR(dev->gpu->obj, fmt, &dev->format_props2[f]); +static void buildpNextChain(struct VkStructureHeader *first, const struct pNextChainBuildingBlockInfo *chain_info, + uint32_t chain_info_len) { + struct VkStructureHeader *place = first; + + for (uint32_t i = 0; i < chain_info_len; i++) { + place->pNext = malloc(chain_info[i].mem_size); + if (!place->pNext) { + ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); } + place = place->pNext; + place->sType = chain_info[i].sType; + } + + place->pNext = NULL; +} + +static void freepNextChain(struct VkStructureHeader *first) { + struct VkStructureHeader *place = first; + struct VkStructureHeader *next = NULL; + + while (place) { + next = place->pNext; + free(place); + place = next; } } @@ -522,43 +545,6 @@ *extension_properties = ext_ptr; } -static void AppDevInit(struct AppDev *dev, struct AppGpu *gpu) { - VkDeviceCreateInfo info = { - .sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, - .pNext = NULL, - .flags = 0, - .queueCreateInfoCount = 0, - .pQueueCreateInfos = NULL, - .enabledLayerCount = 0, - .ppEnabledLayerNames = NULL, - .enabledExtensionCount = 0, - .ppEnabledExtensionNames = NULL, - }; - VkResult U_ASSERT_ONLY err; - - // Device extensions - AppGetPhysicalDeviceLayerExtensions(gpu, NULL, &gpu->device_extension_count, &gpu->device_extensions); - - fflush(stdout); - - /* request all queues */ - info.queueCreateInfoCount = gpu->queue_count; - info.pQueueCreateInfos = gpu->queue_reqs; - - info.enabledLayerCount = 0; - info.ppEnabledLayerNames = NULL; - info.enabledExtensionCount = 0; - info.ppEnabledExtensionNames = NULL; - dev->gpu = gpu; - err = vkCreateDevice(gpu->obj, &info, NULL, &dev->obj); - if (err) ERR_EXIT(err); -} - -static void AppDevDestroy(struct AppDev *dev) { - vkDeviceWaitIdle(dev->obj); - vkDestroyDevice(dev->obj, NULL); -} - static void AppGetGlobalLayerExtensions(char *layer_name, uint32_t *extension_count, VkExtensionProperties **extension_properties) { VkResult err; uint32_t ext_count = 0; @@ -615,7 +601,7 @@ inst->global_layer_count = count; inst->global_layers = global_layers; - for (uint32_t i = 0; i < inst->global_layer_count; i++) { + for (uint32_t i = 0; i < inst->global_layer_count; ++i) { VkLayerProperties *src_info = &global_layer_properties[i]; struct LayerExtensionList *dst_info = &inst->global_layers[i]; memcpy(&dst_info->layer_properties, src_info, sizeof(VkLayerProperties)); @@ -633,16 +619,139 @@ AppGetGlobalLayerExtensions(NULL, &inst->global_extension_count, &inst->global_extensions); } +// Prints opening code for html output file +void PrintHtmlHeader(FILE *out) { + fprintf(out, "\n"); + fprintf(out, "\n"); + fprintf(out, "\t\n"); + fprintf(out, "\t\tVulkan Info\n"); + fprintf(out, "\t\t\n"); + fprintf(out, "\t\n"); + fprintf(out, "\t\n"); + fprintf(out, "\t\t\n"); + fprintf(out, "\t\t
\n"); +} + +// Prints closing code for html output file +void PrintHtmlFooter(FILE *out) { + fprintf(out, "\t\t
\n"); + fprintf(out, "\t\n"); + fprintf(out, ""); +} + +// Prints opening code for json output file +void PrintJsonHeader(const int vulkan_major, const int vulkan_minor, const int vulkan_patch) { + printf("{\n"); + printf("\t\"$schema\": \"https://schema.khronos.org/vulkan/devsim_1_0_0.json#\",\n"); + printf("\t\"comments\": {\n"); + printf("\t\t\"desc\": \"JSON configuration file describing GPU %u. Generated using the VulkanInfo program.\",\n", selected_gpu); + printf("\t\t\"vulkanApiVersion\": \"%d.%d.%d\"\n", vulkan_major, vulkan_minor, vulkan_patch); + printf("\t}"); +} + +// Checks if current argument specifies json output, interprets/updates gpu selection +void CheckForJsonOption(const char *arg) { + if (strncmp("--json", arg, 6) == 0 || strcmp(arg, "-j") == 0) { + if (strlen(arg) > 7 && strncmp("--json=", arg, 7) == 0) { + selected_gpu = strtol(arg + 7, NULL, 10); + } + human_readable_output = false; + json_output = true; + } +} + +// static void AppCreateInstance(struct AppInstance *inst, int argc, ...) { static void AppCreateInstance(struct AppInstance *inst) { AppGetInstanceExtensions(inst); -//---Build a list of extensions to load--- + //---Build a list of extensions to load--- - const char *info_instance_extensions[] = {VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, - VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME, - VK_KHR_SURFACE_EXTENSION_NAME, + const char *info_instance_extensions[] = {VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME, + VK_KHR_DISPLAY_EXTENSION_NAME, + VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME, VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME, + VK_KHR_SURFACE_EXTENSION_NAME, + VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME, #ifdef VK_USE_PLATFORM_WIN32_KHR VK_KHR_WIN32_SURFACE_EXTENSION_NAME #elif VK_USE_PLATFORM_XCB_KHR @@ -655,12 +764,12 @@ VK_KHR_ANDROID_SURFACE_EXTENSION_NAME #endif }; - uint32_t info_instance_extensions_count = ARRAY_SIZE(info_instance_extensions); + const uint32_t info_instance_extensions_count = ARRAY_SIZE(info_instance_extensions); inst->inst_extensions = malloc(sizeof(char *) * ARRAY_SIZE(info_instance_extensions)); inst->inst_extensions_count = 0; - for (uint32_t k = 0; (k < info_instance_extensions_count); k++) { - for (uint32_t j = 0; (j < inst->global_extension_count); j++) { + for (uint32_t k = 0; (k < info_instance_extensions_count); ++k) { + for (uint32_t j = 0; (j < inst->global_extension_count); ++j) { const char *found_name = inst->global_extensions[j].extensionName; if (!strcmp(info_instance_extensions[k], found_name)) { inst->inst_extensions[inst->inst_extensions_count++] = info_instance_extensions[k]; @@ -699,7 +808,7 @@ VkResult U_ASSERT_ONLY err; err = vkCreateInstance(&inst_info, NULL, &inst->instance); if (err == VK_ERROR_INCOMPATIBLE_DRIVER) { - printf("Cannot create Vulkan instance.\n"); + fprintf(stderr, "Cannot create Vulkan instance.\n"); ERR_EXIT(err); } else if (err) { ERR_EXIT(err); @@ -733,11 +842,11 @@ static void AppDestroyInstance(struct AppInstance *inst) { free(inst->global_extensions); - for (uint32_t i = 0; i < inst->global_layer_count; i++) { + for (uint32_t i = 0; i < inst->global_layer_count; ++i) { free(inst->global_layers[i].extension_properties); } free(inst->global_layers); - free((char**)inst->inst_extensions); + free((char **)inst->inst_extensions); vkDestroyInstance(inst->instance, NULL); } @@ -754,8 +863,22 @@ if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions, gpu->inst->inst_extensions_count)) { + struct pNextChainBuildingBlockInfo chain_info[] = { + {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT, + .mem_size = sizeof(VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT)}, + {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES_KHR, + .mem_size = sizeof(VkPhysicalDevicePointClippingPropertiesKHR)}, + {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR, + .mem_size = sizeof(VkPhysicalDevicePushDescriptorPropertiesKHR)}, + {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT, + .mem_size = sizeof(VkPhysicalDeviceDiscardRectanglePropertiesEXT)}, + {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHR, + .mem_size = sizeof(VkPhysicalDeviceMultiviewPropertiesKHR)}}; + + uint32_t chain_info_len = ARRAY_SIZE(chain_info); + gpu->props2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; - gpu->props2.pNext = NULL; + buildpNextChain((struct VkStructureHeader *)&gpu->props2, chain_info, chain_info_len); inst->vkGetPhysicalDeviceProperties2KHR(gpu->obj, &gpu->props2); } @@ -765,16 +888,20 @@ gpu->queue_props = malloc(sizeof(gpu->queue_props[0]) * gpu->queue_count); - if (!gpu->queue_props) ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); + if (!gpu->queue_props) { + ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); + } vkGetPhysicalDeviceQueueFamilyProperties(gpu->obj, &gpu->queue_count, gpu->queue_props); if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions, gpu->inst->inst_extensions_count)) { gpu->queue_props2 = malloc(sizeof(gpu->queue_props2[0]) * gpu->queue_count); - if (!gpu->queue_props2) ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); + if (!gpu->queue_props2) { + ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); + } - for (i = 0; i < gpu->queue_count; i++) { + for (i = 0; i < gpu->queue_count; ++i) { gpu->queue_props2[i].sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR; gpu->queue_props2[i].pNext = NULL; } @@ -784,17 +911,40 @@ /* set up queue requests */ gpu->queue_reqs = malloc(sizeof(*gpu->queue_reqs) * gpu->queue_count); - if (!gpu->queue_reqs) ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); - for (i = 0; i < gpu->queue_count; i++) { - float *queue_priorities = malloc(gpu->queue_props[i].queueCount * sizeof(float)); - if (!queue_priorities) ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); - memset(queue_priorities, 0, gpu->queue_props[i].queueCount * sizeof(float)); + if (!gpu->queue_reqs) { + ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); + } + for (i = 0; i < gpu->queue_count; ++i) { + float *queue_priorities = NULL; + if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions, + gpu->inst->inst_extensions_count)) { + queue_priorities = malloc(gpu->queue_props2[i].queueFamilyProperties.queueCount * sizeof(float)); + } else { + queue_priorities = malloc(gpu->queue_props[i].queueCount * sizeof(float)); + } + if (!queue_priorities) { + ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); + } + + if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions, + gpu->inst->inst_extensions_count)) { + memset(queue_priorities, 0, gpu->queue_props2[i].queueFamilyProperties.queueCount * sizeof(float)); + } else { + memset(queue_priorities, 0, gpu->queue_props[i].queueCount * sizeof(float)); + } gpu->queue_reqs[i].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO; gpu->queue_reqs[i].pNext = NULL; gpu->queue_reqs[i].flags = 0; gpu->queue_reqs[i].queueFamilyIndex = i; - gpu->queue_reqs[i].queueCount = gpu->queue_props[i].queueCount; + + if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions, + gpu->inst->inst_extensions_count)) { + gpu->queue_reqs[i].queueCount = gpu->queue_props2[i].queueFamilyProperties.queueCount; + } else { + gpu->queue_reqs[i].queueCount = gpu->queue_props[i].queueCount; + } + gpu->queue_reqs[i].pQueuePriorities = queue_priorities; } @@ -809,21 +959,38 @@ inst->vkGetPhysicalDeviceMemoryProperties2KHR(gpu->obj, &gpu->memory_props2); + struct pNextChainBuildingBlockInfo chain_info[] = { + {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR, + .mem_size = sizeof(VkPhysicalDevice16BitStorageFeaturesKHR)}, + {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR, + .mem_size = sizeof(VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR)}, + {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR, + .mem_size = sizeof(VkPhysicalDeviceVariablePointerFeaturesKHR)}, + {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT, + .mem_size = sizeof(VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT)}, + {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR, + .mem_size = sizeof(VkPhysicalDeviceMultiviewFeaturesKHR)}}; + + uint32_t chain_info_len = ARRAY_SIZE(chain_info); + gpu->features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR; - gpu->features2.pNext = NULL; + buildpNextChain((struct VkStructureHeader *)&gpu->features2, chain_info, chain_info_len); inst->vkGetPhysicalDeviceFeatures2KHR(gpu->obj, &gpu->features2); } - AppDevInit(&gpu->dev, gpu); - AppDevInitFormats(&gpu->dev); + AppGetPhysicalDeviceLayerExtensions(gpu, NULL, &gpu->device_extension_count, &gpu->device_extensions); } static void AppGpuDestroy(struct AppGpu *gpu) { - AppDevDestroy(&gpu->dev); free(gpu->device_extensions); - for (uint32_t i = 0; i < gpu->queue_count; i++) { + if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions, + gpu->inst->inst_extensions_count)) { + freepNextChain(gpu->features2.pNext); + } + + for (uint32_t i = 0; i < gpu->queue_count; ++i) { free((void *)gpu->queue_reqs[i].pQueuePriorities); } free(gpu->queue_reqs); @@ -832,6 +999,8 @@ if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions, gpu->inst->inst_extensions_count)) { free(gpu->queue_props2); + + freepNextChain(gpu->props2.pNext); } } @@ -869,8 +1038,7 @@ // Register window class: if (!RegisterClassEx(&win_class)) { // It didn't work, so try to give a useful error: - printf("Failed to register the window class!\n"); - fflush(stdout); + fprintf(stderr, "Failed to register the window class!\n"); exit(1); } // Create window with the registered class: @@ -890,8 +1058,7 @@ NULL); // no extra parameters if (!inst->h_wnd) { // It didn't work, so try to give a useful error: - printf("Failed to create a window!\n"); - fflush(stdout); + fprintf(stderr, "Failed to create a window!\n"); exit(1); } } @@ -995,8 +1162,7 @@ inst->xlib_display = XOpenDisplay(NULL); if (inst->xlib_display == NULL) { - printf("XLib failed to connect to the X server.\nExiting ...\n"); - fflush(stdout); + fprintf(stderr, "XLib failed to connect to the X server.\nExiting ...\n"); exit(1); } @@ -1034,8 +1200,8 @@ #if defined(VK_USE_PLATFORM_XCB_KHR) || \ defined(VK_USE_PLATFORM_XLIB_KHR) || \ defined(VK_USE_PLATFORM_WIN32_KHR) -static int AppDumpSurfaceFormats(struct AppInstance *inst, struct AppGpu *gpu){ - // Get the list of VkFormat's that are supported: +static int AppDumpSurfaceFormats(struct AppInstance *inst, struct AppGpu *gpu, FILE *out) { + // Get the list of VkFormat's that are supported VkResult U_ASSERT_ONLY err; uint32_t format_count = 0; err = inst->vkGetPhysicalDeviceSurfaceFormatsKHR(gpu->obj, inst->surface, &format_count, NULL); @@ -1046,18 +1212,37 @@ ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); err = inst->vkGetPhysicalDeviceSurfaceFormatsKHR(gpu->obj, inst->surface, &format_count, surf_formats); assert(!err); - printf("Formats:\t\tcount = %d\n", format_count); - for (uint32_t i = 0; i < format_count; i++) { - printf("\t%s\n", VkFormatString(surf_formats[i].format)); + if (html_output) { + fprintf(out, "\t\t\t\t
Formats: count =
%d
", format_count); + if (format_count > 0) { + fprintf(out, "\n"); + } else { + fprintf(out, "
\n"); + } + } else if (human_readable_output) { + printf("Formats:\t\tcount = %d\n", format_count); + } + for (uint32_t i = 0; i < format_count; ++i) { + if (html_output) { + fprintf(out, "\t\t\t\t\t
%s
\n", + VkFormatString(surf_formats[i].format)); + } else if (human_readable_output) { + printf("\t%s\n", VkFormatString(surf_formats[i].format)); + } + } + if (format_count > 0 && html_output) { + fprintf(out, "\t\t\t\t\n"); } - fflush(stdout); + fflush(out); + fflush(stdout); free(surf_formats); + return format_count; } -static int AppDumpSurfacePresentModes(struct AppInstance *inst, struct AppGpu *gpu) { +static int AppDumpSurfacePresentModes(struct AppInstance *inst, struct AppGpu *gpu, FILE *out) { // Get the list of VkPresentMode's that are supported: VkResult U_ASSERT_ONLY err; uint32_t present_mode_count = 0; @@ -1069,75 +1254,213 @@ ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); err = inst->vkGetPhysicalDeviceSurfacePresentModesKHR(gpu->obj, inst->surface, &present_mode_count, surf_present_modes); assert(!err); - printf("Present Modes:\t\tcount = %d\n", present_mode_count); - for (uint32_t i = 0; i < present_mode_count; i++) { - printf("\t%s\n", VkPresentModeString(surf_present_modes[i])); + if (html_output) { + fprintf(out, "\t\t\t\t
Present Modes: count =
%d
", present_mode_count); + if (present_mode_count > 0) { + fprintf(out, "\n"); + } else { + fprintf(out, "
"); + } + } else if (human_readable_output) { + printf("Present Modes:\t\tcount = %d\n", present_mode_count); + } + for (uint32_t i = 0; i < present_mode_count; ++i) { + if (html_output) { + fprintf(out, "\t\t\t\t\t
%s
\n", + VkPresentModeString(surf_present_modes[i])); + } else if (human_readable_output) { + printf("\t%s\n", VkPresentModeString(surf_present_modes[i])); + } + } + if (present_mode_count > 0 && html_output) { + fprintf(out, "\t\t\t\t\n"); } - printf("\n"); - fflush(stdout); + fflush(out); + fflush(stdout); free(surf_present_modes); + return present_mode_count; } -static void AppDumpSurfaceCapabilities(struct AppInstance *inst, struct AppGpu *gpu) { +static void AppDumpSurfaceCapabilities(struct AppInstance *inst, struct AppGpu *gpu, FILE *out) { if (CheckExtensionEnabled(VK_KHR_SURFACE_EXTENSION_NAME, gpu->inst->inst_extensions, gpu->inst->inst_extensions_count)) { - inst->vkGetPhysicalDeviceSurfaceCapabilitiesKHR(gpu->obj, inst->surface, &inst->surface_capabilities); - printf("\nVkSurfaceCapabilitiesKHR:\n"); - printf("=========================\n\n"); - printf("\tminImageCount = %u\n", inst->surface_capabilities.minImageCount); - printf("\tmaxImageCount = %u\n", inst->surface_capabilities.maxImageCount); - printf("\tcurrentExtent:\n"); - printf("\t\twidth = %u\n", inst->surface_capabilities.currentExtent.width); - printf("\t\theight = %u\n", inst->surface_capabilities.currentExtent.height); - printf("\tminImageExtent:\n"); - printf("\t\twidth = %u\n", inst->surface_capabilities.minImageExtent.width); - printf("\t\theight = %u\n", inst->surface_capabilities.minImageExtent.height); - printf("\tmaxImageExtent:\n"); - printf("\t\twidth = %u\n", inst->surface_capabilities.maxImageExtent.width); - printf("\t\theight = %u\n", inst->surface_capabilities.maxImageExtent.height); - printf("\tmaxImageArrayLayers = %u\n", inst->surface_capabilities.maxImageArrayLayers); - printf("\tsupportedTransform:\n"); - if (inst->surface_capabilities.supportedTransforms == 0) { printf("\t\tNone\n"); } - if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_INHERIT_BIT_KHR\n"); } - printf("\tcurrentTransform:\n"); - if (inst->surface_capabilities.currentTransform == 0) { printf("\t\tNone\n"); } - if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR\n"); } - else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR\n"); } - else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR\n"); } - else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR\n"); } - else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR\n"); } - else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR\n"); } - else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR\n"); } - else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR\n"); } - else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_INHERIT_BIT_KHR\n"); } - printf("\tsupportedCompositeAlpha:\n"); - if (inst->surface_capabilities.supportedCompositeAlpha == 0) { printf("\t\tNone\n"); } - if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_INHERIT_BIT_KHR\n"); } - printf("\tsupportedUsageFlags:\n"); - if (inst->surface_capabilities.supportedUsageFlags == 0) { printf("\t\tNone\n"); } - if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_SRC_BIT\n"); } - if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_DST_BIT\n"); } - if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) { printf("\t\tVK_IMAGE_USAGE_SAMPLED_BIT\n"); } - if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_STORAGE_BIT) { printf("\t\tVK_IMAGE_USAGE_STORAGE_BIT\n"); } - if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT\n"); } - if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT\n"); } - if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT\n"); } - if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT\n"); } + if (html_output) { + fprintf(out, "\t\t\t\t
VkSurfaceCapabilitiesKHR\n"); + fprintf(out, "\t\t\t\t\t
minImageCount =
%u
\n", inst->surface_capabilities.minImageCount); + fprintf(out, "\t\t\t\t\t
maxImageCount =
%u
\n", inst->surface_capabilities.maxImageCount); + fprintf(out, "\t\t\t\t\t
currentExtent\n"); + fprintf(out, "\t\t\t\t\t\t
width =
%u
\n", inst->surface_capabilities.currentExtent.width); + fprintf(out, "\t\t\t\t\t\t
height =
%u
\n", inst->surface_capabilities.currentExtent.height); + fprintf(out, "\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t
minImageExtent\n"); + fprintf(out, "\t\t\t\t\t\t
width =
%u
\n", inst->surface_capabilities.minImageExtent.width); + fprintf(out, "\t\t\t\t\t\t
height =
%u
\n", inst->surface_capabilities.minImageExtent.height); + fprintf(out, "\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t
maxImageExtent\n"); + fprintf(out, "\t\t\t\t\t\t
width =
%u
\n", inst->surface_capabilities.maxImageExtent.width); + fprintf(out, "\t\t\t\t\t\t
height =
%u
\n", inst->surface_capabilities.maxImageExtent.height); + fprintf(out, "\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t
maxImageArrayLayers =
%u
\n", inst->surface_capabilities.maxImageArrayLayers); + fprintf(out, "\t\t\t\t\t
supportedTransform\n"); + if (inst->surface_capabilities.supportedTransforms == 0) { + fprintf(out, "\t\t\t\t\t\t
None
\n"); + } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR
\n"); + } + fprintf(out, "\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t
currentTransform\n"); + if (inst->surface_capabilities.currentTransform == 0) { + fprintf(out, "\t\t\t\t\t\t
None
\n"); + } + if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR
\n"); + } else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR
\n"); + } else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR
\n"); + } else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR
\n"); + } else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR
\n"); + } else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR) { + fprintf(out, "\t\t\t\t\t
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR
\n"); + } else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR
\n"); + } else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR
\n"); + } else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR
\n"); + } + fprintf(out, "\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t
supportedCompositeAlpha\n"); + if (inst->surface_capabilities.supportedCompositeAlpha == 0) { + fprintf(out, "\t\t\t\t\t\t
None
\n"); + } + if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR
\n"); + } + fprintf(out, "\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t
supportedUsageFlags\n"); + if (inst->surface_capabilities.supportedUsageFlags == 0) { + fprintf(out, "\t\t\t\t\t\t
None
\n"); + } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { + fprintf(out, "\t\t\t\t\t\t
VK_IMAGE_USAGE_TRANSFER_SRC_BIT
\n"); + } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { + fprintf(out, "\t\t\t\t\t\t
VK_IMAGE_USAGE_TRANSFER_DST_BIT
\n"); + } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) { + fprintf(out, "\t\t\t\t\t\t
VK_IMAGE_USAGE_SAMPLED_BIT
\n"); + } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_STORAGE_BIT) { + fprintf(out, "\t\t\t\t\t\t
VK_IMAGE_USAGE_STORAGE_BIT
\n"); + } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { + fprintf(out, "\t\t\t\t\t\t
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
\n"); + } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { + fprintf(out, "\t\t\t\t\t\t
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
\n"); + } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) { + fprintf(out, "\t\t\t\t\t\t
VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
\n"); + } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { + fprintf(out, "\t\t\t\t\t\t
VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
\n"); + } + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\nVkSurfaceCapabilitiesKHR:\n"); + printf("=========================\n"); + printf("\tminImageCount = %u\n", inst->surface_capabilities.minImageCount); + printf("\tmaxImageCount = %u\n", inst->surface_capabilities.maxImageCount); + printf("\tcurrentExtent:\n"); + printf("\t\twidth = %u\n", inst->surface_capabilities.currentExtent.width); + printf("\t\theight = %u\n", inst->surface_capabilities.currentExtent.height); + printf("\tminImageExtent:\n"); + printf("\t\twidth = %u\n", inst->surface_capabilities.minImageExtent.width); + printf("\t\theight = %u\n", inst->surface_capabilities.minImageExtent.height); + printf("\tmaxImageExtent:\n"); + printf("\t\twidth = %u\n", inst->surface_capabilities.maxImageExtent.width); + printf("\t\theight = %u\n", inst->surface_capabilities.maxImageExtent.height); + printf("\tmaxImageArrayLayers = %u\n", inst->surface_capabilities.maxImageArrayLayers); + printf("\tsupportedTransform:\n"); + if (inst->surface_capabilities.supportedTransforms == 0) { printf("\t\tNone\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_INHERIT_BIT_KHR\n"); } + printf("\tcurrentTransform:\n"); + if (inst->surface_capabilities.currentTransform == 0) { printf("\t\tNone\n"); } + if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR\n"); } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR\n"); } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR\n"); } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR\n"); } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR\n"); } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR\n"); } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR\n"); } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR\n"); } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_INHERIT_BIT_KHR\n"); } + printf("\tsupportedCompositeAlpha:\n"); + if (inst->surface_capabilities.supportedCompositeAlpha == 0) { printf("\t\tNone\n"); } + if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_INHERIT_BIT_KHR\n"); } + printf("\tsupportedUsageFlags:\n"); + if (inst->surface_capabilities.supportedUsageFlags == 0) { printf("\t\tNone\n"); } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_SRC_BIT\n"); } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_DST_BIT\n"); } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) { printf("\t\tVK_IMAGE_USAGE_SAMPLED_BIT\n"); } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_STORAGE_BIT) { printf("\t\tVK_IMAGE_USAGE_STORAGE_BIT\n"); } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT\n"); } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT\n"); } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT\n"); } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT\n"); } + } // Get additional surface capability information from vkGetPhysicalDeviceSurfaceCapabilities2EXT if (CheckExtensionEnabled(VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME, gpu->inst->inst_extensions, gpu->inst->inst_extensions_count)) { @@ -1147,11 +1470,28 @@ inst->vkGetPhysicalDeviceSurfaceCapabilities2EXT(gpu->obj, inst->surface, &inst->surface_capabilities2_ext); - printf("\nVkSurfaceCapabilities2EXT:\n"); - printf("==========================\n\n"); - printf("\tsupportedSurfaceCounters:\n"); - if (inst->surface_capabilities2_ext.supportedSurfaceCounters == 0) { printf("\t\tNone\n"); } - if (inst->surface_capabilities2_ext.supportedSurfaceCounters & VK_SURFACE_COUNTER_VBLANK_EXT) { printf("\t\tVK_SURFACE_COUNTER_VBLANK_EXT\n"); } + if (html_output) { + fprintf(out, "\t\t\t\t\t
VkSurfaceCapabilities2EXT\n"); + fprintf(out, "\t\t\t\t\t\t
supportedSurfaceCounters\n"); + if (inst->surface_capabilities2_ext.supportedSurfaceCounters == 0) { + fprintf(out, "\t\t\t\t\t\t\t
None
\n"); + } + if (inst->surface_capabilities2_ext.supportedSurfaceCounters & VK_SURFACE_COUNTER_VBLANK_EXT) { + fprintf(out, "\t\t\t\t\t\t\t
VK_SURFACE_COUNTER_VBLANK_EXT
\n"); + } + fprintf(out, "\t\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\nVkSurfaceCapabilities2EXT:\n"); + printf("==========================\n"); + printf("\tsupportedSurfaceCounters:\n"); + if (inst->surface_capabilities2_ext.supportedSurfaceCounters == 0) { + printf("\t\tNone\n"); + } + if (inst->surface_capabilities2_ext.supportedSurfaceCounters & VK_SURFACE_COUNTER_VBLANK_EXT) { + printf("\t\tVK_SURFACE_COUNTER_VBLANK_EXT\n"); + } + } } // Get additional surface capability information from vkGetPhysicalDeviceSurfaceCapabilities2KHR @@ -1177,81 +1517,177 @@ while (place) { struct VkStructureHeader* work = (struct VkStructureHeader*) place; if (work->sType == VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR) { - printf("\nVkSharedPresentSurfaceCapabilitiesKHR:\n"); - printf("========================================\n"); VkSharedPresentSurfaceCapabilitiesKHR* shared_surface_capabilities = (VkSharedPresentSurfaceCapabilitiesKHR*)place; - printf("\tsharedPresentSupportedUsageFlags:\n"); - if (shared_surface_capabilities->sharedPresentSupportedUsageFlags == 0) { printf("\t\tNone\n"); } - if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_SRC_BIT\n"); } - if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_DST_BIT\n"); } - if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) { printf("\t\tVK_IMAGE_USAGE_SAMPLED_BIT\n"); } - if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_STORAGE_BIT) { printf("\t\tVK_IMAGE_USAGE_STORAGE_BIT\n"); } - if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT\n"); } - if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT\n"); } - if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT\n"); } - if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT\n"); } + if (html_output) { + fprintf(out, "\t\t\t\t\t
VkSharedPresentSurfaceCapabilitiesKHR\n"); + fprintf(out, "\t\t\t\t\t\t
sharedPresentSupportedUsageFlags\n"); + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags == 0) { + fprintf(out, "\t\t\t\t\t\t\t
None
\n"); + } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { + fprintf(out, "\t\t\t\t\t\t\t
VK_IMAGE_USAGE_TRANSFER_SRC_BIT
\n"); + } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { + fprintf(out, "\t\t\t\t\t\t\t
VK_IMAGE_USAGE_TRANSFER_DST_BIT
\n"); + } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) { + fprintf(out, "\t\t\t\t\t\t\t
VK_IMAGE_USAGE_SAMPLED_BIT
\n"); + } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_STORAGE_BIT) { + fprintf(out, "\t\t\t\t\t\t\t
VK_IMAGE_USAGE_STORAGE_BIT
\n"); + } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { + fprintf(out, "\t\t\t\t\t\t\t
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
\n"); + } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { + fprintf(out, "\t\t\t\t\t\t\t
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
\n"); + } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) { + fprintf(out, "\t\t\t\t\t\t\t
VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
\n"); + } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { + fprintf(out, "\t\t\t\t\t\t\t
VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
\n"); + } + fprintf(out, "\t\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\nVkSharedPresentSurfaceCapabilitiesKHR:\n"); + printf("========================================\n"); + printf("\tsharedPresentSupportedUsageFlags:\n"); + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags == 0) { printf("\t\tNone\n"); } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_SRC_BIT\n"); } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_DST_BIT\n"); } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) { printf("\t\tVK_IMAGE_USAGE_SAMPLED_BIT\n"); } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_STORAGE_BIT) { printf("\t\tVK_IMAGE_USAGE_STORAGE_BIT\n"); } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT\n"); } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT\n"); } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT\n"); } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT\n"); } + } } - place = work->pNext; } } + if (html_output) { + fprintf(out, "\t\t\t\t
\n"); + } } } #endif -static void AppDevDumpFormatProps(const struct AppDev *dev, VkFormat fmt) -{ - const VkFormatProperties *props = &dev->format_props[fmt]; +static void AppDevDumpFormatProps(const struct AppGpu *gpu, VkFormat fmt, bool *first_in_list, FILE *out) { + VkFormatProperties props; + vkGetPhysicalDeviceFormatProperties(gpu->obj, fmt, &props); struct { const char *name; VkFlags flags; } features[3]; features[0].name = "linearTiling FormatFeatureFlags"; - features[0].flags = props->linearTilingFeatures; + features[0].flags = props.linearTilingFeatures; features[1].name = "optimalTiling FormatFeatureFlags"; - features[1].flags = props->optimalTilingFeatures; + features[1].flags = props.optimalTilingFeatures; features[2].name = "bufferFeatures FormatFeatureFlags"; - features[2].flags = props->bufferFeatures; + features[2].flags = props.bufferFeatures; - printf("\nFORMAT_%s:", VkFormatString(fmt)); - for (uint32_t i = 0; i < ARRAY_SIZE(features); i++) { - printf("\n\t%s:", features[i].name); - if (features[i].flags == 0) { - printf("\n\t\tNone"); + if (html_output) { + fprintf(out, "\t\t\t\t\t\t
FORMAT_%s
\n", VkFormatString(fmt)); + } else if (human_readable_output) { + printf("\nFORMAT_%s:", VkFormatString(fmt)); + } + for (uint32_t i = 0; i < ARRAY_SIZE(features); ++i) { + if (html_output) { + fprintf(out, "\t\t\t\t\t\t\t
%s\n", features[i].name); + if (features[i].flags == 0) { + fprintf(out, "\t\t\t\t\t\t\t\t
None
\n"); + } else { + fprintf(out, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", + ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT
\n" : ""), //0x0001 + ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT
\n" : ""), //0x0002 + ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
\n" : ""), //0x0004 + ((features[i].flags & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT
\n" : ""), //0x0008 + ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT
\n" : ""), //0x0010 + ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT
\n" : ""), //0x0020 + ((features[i].flags & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT
\n" : ""), //0x0040 + ((features[i].flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
\n" : ""), //0x0080 + ((features[i].flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT
\n" : ""), //0x0100 + ((features[i].flags & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
\n" : ""), //0x0200 + ((features[i].flags & VK_FORMAT_FEATURE_BLIT_SRC_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_BLIT_SRC_BIT
\n" : ""), //0x0400 + ((features[i].flags & VK_FORMAT_FEATURE_BLIT_DST_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_BLIT_DST_BIT
\n" : ""), //0x0800 + ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
\n" : ""), //0x1000 + ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG
\n" : ""), //0x2000 + ((features[i].flags & VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR
\n" : ""), //0x4000 + ((features[i].flags & VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR
\n" : "")); //0x8000 + } + fprintf(out, "\t\t\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\n\t%s:", features[i].name); + if (features[i].flags == 0) { + printf("\n\t\tNone"); + } else { + printf("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", + ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) ? "\n\t\tVK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT" : ""), //0x0001 + ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_IMAGE_BIT" : ""), //0x0002 + ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT) ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT" : ""), //0x0004 + ((features[i].flags & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) ? "\n\t\tVK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT" : ""), //0x0008 + ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT) ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT" : ""), //0x0010 + ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT) ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT" : ""), //0x0020 + ((features[i].flags & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) ? "\n\t\tVK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" : ""), //0x0040 + ((features[i].flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) ? "\n\t\tVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT" : ""), //0x0080 + ((features[i].flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) ? "\n\t\tVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT" : ""), //0x0100 + ((features[i].flags & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) ? "\n\t\tVK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT" : ""), //0x0200 + ((features[i].flags & VK_FORMAT_FEATURE_BLIT_SRC_BIT) ? "\n\t\tVK_FORMAT_FEATURE_BLIT_SRC_BIT" : ""), //0x0400 + ((features[i].flags & VK_FORMAT_FEATURE_BLIT_DST_BIT) ? "\n\t\tVK_FORMAT_FEATURE_BLIT_DST_BIT" : ""), //0x0800 + ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT) ? "\n\t\tVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT" : ""), //0x1000 + ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG) ? "\n\t\tVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG" : ""), //0x2000 + ((features[i].flags & VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR) ? "\n\t\tVK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR" : ""), //0x4000 + ((features[i].flags & VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR) ? "\n\t\tVK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR" : "")); //0x8000 + } + } + } + if (html_output) { + fprintf(out, "\t\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\n"); + } + if (json_output && (props.linearTilingFeatures || props.optimalTilingFeatures || props.bufferFeatures)) { + if (!(*first_in_list)) { + printf(","); } else { - printf("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", - ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) ? "\n\t\tVK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT" : ""), //0x0001 - ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_IMAGE_BIT" : ""), //0x0002 - ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT) ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT" : ""), //0x0004 - ((features[i].flags & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) ? "\n\t\tVK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT" : ""), //0x0008 - ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT) ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT" : ""), //0x0010 - ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT) ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT" : ""), //0x0020 - ((features[i].flags & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) ? "\n\t\tVK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" : ""), //0x0040 - ((features[i].flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) ? "\n\t\tVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT" : ""), //0x0080 - ((features[i].flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) ? "\n\t\tVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT" : ""), //0x0100 - ((features[i].flags & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) ? "\n\t\tVK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT" : ""), //0x0200 - ((features[i].flags & VK_FORMAT_FEATURE_BLIT_SRC_BIT) ? "\n\t\tVK_FORMAT_FEATURE_BLIT_SRC_BIT" : ""), //0x0400 - ((features[i].flags & VK_FORMAT_FEATURE_BLIT_DST_BIT) ? "\n\t\tVK_FORMAT_FEATURE_BLIT_DST_BIT" : ""), //0x0800 - ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT) ? "\n\t\tVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT" : ""), //0x1000 - ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG) ? "\n\t\tVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG" : ""), //0x2000 - ((features[i].flags & VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR) ? "\n\t\tVK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR" : ""), //0x4000 - ((features[i].flags & VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR) ? "\n\t\tVK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR" : "")); //0x8000 - } - } - printf("\n"); -} - -static void -AppDevDump(const struct AppDev *dev) -{ - printf("Format Properties:\n"); - printf("=================="); - VkFormat fmt; + *first_in_list = false; + } + printf("\n"); + printf("\t\t{\n"); + printf("\t\t\t\"formatID\": %d,\n", fmt); + printf("\t\t\t\"linearTilingFeatures\": %u,\n", props.linearTilingFeatures); + printf("\t\t\t\"optimalTilingFeatures\": %u,\n", props.optimalTilingFeatures); + printf("\t\t\t\"bufferFeatures\": %u\n", props.bufferFeatures); + printf("\t\t}"); + } +} + +static void AppDevDump(const struct AppGpu *gpu, FILE *out) { + if (html_output) { + fprintf(out, "\t\t\t\t\t
Format Properties\n"); + } else if (human_readable_output) { + printf("Format Properties:\n"); + printf("=================="); + } + if (json_output) { + printf(",\n"); + printf("\t\"ArrayOfVkFormatProperties\": ["); + } - for (fmt = 0; fmt < VK_FORMAT_RANGE_SIZE; fmt++) { - AppDevDumpFormatProps(dev, fmt); + bool first_in_list = true; // Used for commas in json output + for (VkFormat fmt = 0; fmt < VK_FORMAT_RANGE_SIZE; ++fmt) { + AppDevDumpFormatProps(gpu, fmt, &first_in_list, out); + } + if (html_output) { + fprintf(out, "\t\t\t\t\t
\n"); + } + if (json_output) { + printf("\n\t]"); } } @@ -1261,273 +1697,974 @@ #define PRINTF_SIZE_T_SPECIFIER "%zu" #endif -static void AppGpuDumpFeatures(const struct AppGpu *gpu) -{ - const VkPhysicalDeviceFeatures *features = &gpu->features; - - printf("VkPhysicalDeviceFeatures:\n"); - printf("=========================\n"); - - printf("\trobustBufferAccess = %u\n", features->robustBufferAccess ); - printf("\tfullDrawIndexUint32 = %u\n", features->fullDrawIndexUint32 ); - printf("\timageCubeArray = %u\n", features->imageCubeArray ); - printf("\tindependentBlend = %u\n", features->independentBlend ); - printf("\tgeometryShader = %u\n", features->geometryShader ); - printf("\ttessellationShader = %u\n", features->tessellationShader ); - printf("\tsampleRateShading = %u\n", features->sampleRateShading ); - printf("\tdualSrcBlend = %u\n", features->dualSrcBlend ); - printf("\tlogicOp = %u\n", features->logicOp ); - printf("\tmultiDrawIndirect = %u\n", features->multiDrawIndirect ); - printf("\tdrawIndirectFirstInstance = %u\n", features->drawIndirectFirstInstance ); - printf("\tdepthClamp = %u\n", features->depthClamp ); - printf("\tdepthBiasClamp = %u\n", features->depthBiasClamp ); - printf("\tfillModeNonSolid = %u\n", features->fillModeNonSolid ); - printf("\tdepthBounds = %u\n", features->depthBounds ); - printf("\twideLines = %u\n", features->wideLines ); - printf("\tlargePoints = %u\n", features->largePoints ); - printf("\talphaToOne = %u\n", features->alphaToOne ); - printf("\tmultiViewport = %u\n", features->multiViewport ); - printf("\tsamplerAnisotropy = %u\n", features->samplerAnisotropy ); - printf("\ttextureCompressionETC2 = %u\n", features->textureCompressionETC2 ); - printf("\ttextureCompressionASTC_LDR = %u\n", features->textureCompressionASTC_LDR ); - printf("\ttextureCompressionBC = %u\n", features->textureCompressionBC ); - printf("\tocclusionQueryPrecise = %u\n", features->occlusionQueryPrecise ); - printf("\tpipelineStatisticsQuery = %u\n", features->pipelineStatisticsQuery ); - printf("\tvertexPipelineStoresAndAtomics = %u\n", features->vertexPipelineStoresAndAtomics ); - printf("\tfragmentStoresAndAtomics = %u\n", features->fragmentStoresAndAtomics ); - printf("\tshaderTessellationAndGeometryPointSize = %u\n", features->shaderTessellationAndGeometryPointSize ); - printf("\tshaderImageGatherExtended = %u\n", features->shaderImageGatherExtended ); - printf("\tshaderStorageImageExtendedFormats = %u\n", features->shaderStorageImageExtendedFormats ); - printf("\tshaderStorageImageMultisample = %u\n", features->shaderStorageImageMultisample ); - printf("\tshaderStorageImageReadWithoutFormat = %u\n", features->shaderStorageImageReadWithoutFormat ); - printf("\tshaderStorageImageWriteWithoutFormat = %u\n", features->shaderStorageImageWriteWithoutFormat ); - printf("\tshaderUniformBufferArrayDynamicIndexing = %u\n", features->shaderUniformBufferArrayDynamicIndexing); - printf("\tshaderSampledImageArrayDynamicIndexing = %u\n", features->shaderSampledImageArrayDynamicIndexing ); - printf("\tshaderStorageBufferArrayDynamicIndexing = %u\n", features->shaderStorageBufferArrayDynamicIndexing); - printf("\tshaderStorageImageArrayDynamicIndexing = %u\n", features->shaderStorageImageArrayDynamicIndexing ); - printf("\tshaderClipDistance = %u\n", features->shaderClipDistance ); - printf("\tshaderCullDistance = %u\n", features->shaderCullDistance ); - printf("\tshaderFloat64 = %u\n", features->shaderFloat64 ); - printf("\tshaderInt64 = %u\n", features->shaderInt64 ); - printf("\tshaderInt16 = %u\n", features->shaderInt16 ); - printf("\tshaderResourceResidency = %u\n", features->shaderResourceResidency ); - printf("\tshaderResourceMinLod = %u\n", features->shaderResourceMinLod ); - printf("\tsparseBinding = %u\n", features->sparseBinding ); - printf("\tsparseResidencyBuffer = %u\n", features->sparseResidencyBuffer ); - printf("\tsparseResidencyImage2D = %u\n", features->sparseResidencyImage2D ); - printf("\tsparseResidencyImage3D = %u\n", features->sparseResidencyImage3D ); - printf("\tsparseResidency2Samples = %u\n", features->sparseResidency2Samples ); - printf("\tsparseResidency4Samples = %u\n", features->sparseResidency4Samples ); - printf("\tsparseResidency8Samples = %u\n", features->sparseResidency8Samples ); - printf("\tsparseResidency16Samples = %u\n", features->sparseResidency16Samples ); - printf("\tsparseResidencyAliased = %u\n", features->sparseResidencyAliased ); - printf("\tvariableMultisampleRate = %u\n", features->variableMultisampleRate ); - printf("\tinheritedQueries = %u\n", features->inheritedQueries ); -} - -static void AppDumpSparseProps(const VkPhysicalDeviceSparseProperties *sparse_props) -{ - - printf("\tVkPhysicalDeviceSparseProperties:\n"); - printf("\t---------------------------------\n"); - - printf("\t\tresidencyStandard2DBlockShape = %u\n", sparse_props->residencyStandard2DBlockShape ); - printf("\t\tresidencyStandard2DMultisampleBlockShape = %u\n", sparse_props->residencyStandard2DMultisampleBlockShape); - printf("\t\tresidencyStandard3DBlockShape = %u\n", sparse_props->residencyStandard3DBlockShape ); - printf("\t\tresidencyAlignedMipSize = %u\n", sparse_props->residencyAlignedMipSize ); - printf("\t\tresidencyNonResidentStrict = %u\n", sparse_props->residencyNonResidentStrict ); -} - -static void AppDumpLimits(const VkPhysicalDeviceLimits *limits) -{ - printf("\tVkPhysicalDeviceLimits:\n"); - printf("\t-----------------------\n"); - printf("\t\tmaxImageDimension1D = %u\n", limits->maxImageDimension1D ); - printf("\t\tmaxImageDimension2D = %u\n", limits->maxImageDimension2D ); - printf("\t\tmaxImageDimension3D = %u\n", limits->maxImageDimension3D ); - printf("\t\tmaxImageDimensionCube = %u\n", limits->maxImageDimensionCube ); - printf("\t\tmaxImageArrayLayers = %u\n", limits->maxImageArrayLayers ); - printf("\t\tmaxTexelBufferElements = 0x%" PRIxLEAST32 "\n", limits->maxTexelBufferElements ); - printf("\t\tmaxUniformBufferRange = 0x%" PRIxLEAST32 "\n", limits->maxUniformBufferRange ); - printf("\t\tmaxStorageBufferRange = 0x%" PRIxLEAST32 "\n", limits->maxStorageBufferRange ); - printf("\t\tmaxPushConstantsSize = %u\n", limits->maxPushConstantsSize ); - printf("\t\tmaxMemoryAllocationCount = %u\n", limits->maxMemoryAllocationCount ); - printf("\t\tmaxSamplerAllocationCount = %u\n", limits->maxSamplerAllocationCount ); - printf("\t\tbufferImageGranularity = 0x%" PRIxLEAST64 "\n", limits->bufferImageGranularity ); - printf("\t\tsparseAddressSpaceSize = 0x%" PRIxLEAST64 "\n", limits->sparseAddressSpaceSize ); - printf("\t\tmaxBoundDescriptorSets = %u\n", limits->maxBoundDescriptorSets ); - printf("\t\tmaxPerStageDescriptorSamplers = %u\n", limits->maxPerStageDescriptorSamplers ); - printf("\t\tmaxPerStageDescriptorUniformBuffers = %u\n", limits->maxPerStageDescriptorUniformBuffers ); - printf("\t\tmaxPerStageDescriptorStorageBuffers = %u\n", limits->maxPerStageDescriptorStorageBuffers ); - printf("\t\tmaxPerStageDescriptorSampledImages = %u\n", limits->maxPerStageDescriptorSampledImages ); - printf("\t\tmaxPerStageDescriptorStorageImages = %u\n", limits->maxPerStageDescriptorStorageImages ); - printf("\t\tmaxPerStageDescriptorInputAttachments = %u\n", limits->maxPerStageDescriptorInputAttachments ); - printf("\t\tmaxPerStageResources = %u\n", limits->maxPerStageResources ); - printf("\t\tmaxDescriptorSetSamplers = %u\n", limits->maxDescriptorSetSamplers ); - printf("\t\tmaxDescriptorSetUniformBuffers = %u\n", limits->maxDescriptorSetUniformBuffers ); - printf("\t\tmaxDescriptorSetUniformBuffersDynamic = %u\n", limits->maxDescriptorSetUniformBuffersDynamic ); - printf("\t\tmaxDescriptorSetStorageBuffers = %u\n", limits->maxDescriptorSetStorageBuffers ); - printf("\t\tmaxDescriptorSetStorageBuffersDynamic = %u\n", limits->maxDescriptorSetStorageBuffersDynamic ); - printf("\t\tmaxDescriptorSetSampledImages = %u\n", limits->maxDescriptorSetSampledImages ); - printf("\t\tmaxDescriptorSetStorageImages = %u\n", limits->maxDescriptorSetStorageImages ); - printf("\t\tmaxDescriptorSetInputAttachments = %u\n", limits->maxDescriptorSetInputAttachments ); - printf("\t\tmaxVertexInputAttributes = %u\n", limits->maxVertexInputAttributes ); - printf("\t\tmaxVertexInputBindings = %u\n", limits->maxVertexInputBindings ); - printf("\t\tmaxVertexInputAttributeOffset = 0x%" PRIxLEAST32 "\n", limits->maxVertexInputAttributeOffset ); - printf("\t\tmaxVertexInputBindingStride = 0x%" PRIxLEAST32 "\n", limits->maxVertexInputBindingStride ); - printf("\t\tmaxVertexOutputComponents = %u\n", limits->maxVertexOutputComponents ); - printf("\t\tmaxTessellationGenerationLevel = %u\n", limits->maxTessellationGenerationLevel ); - printf("\t\tmaxTessellationPatchSize = %u\n", limits->maxTessellationPatchSize ); - printf("\t\tmaxTessellationControlPerVertexInputComponents = %u\n", limits->maxTessellationControlPerVertexInputComponents ); - printf("\t\tmaxTessellationControlPerVertexOutputComponents = %u\n", limits->maxTessellationControlPerVertexOutputComponents); - printf("\t\tmaxTessellationControlPerPatchOutputComponents = %u\n", limits->maxTessellationControlPerPatchOutputComponents ); - printf("\t\tmaxTessellationControlTotalOutputComponents = %u\n", limits->maxTessellationControlTotalOutputComponents ); - printf("\t\tmaxTessellationEvaluationInputComponents = %u\n", limits->maxTessellationEvaluationInputComponents ); - printf("\t\tmaxTessellationEvaluationOutputComponents = %u\n", limits->maxTessellationEvaluationOutputComponents ); - printf("\t\tmaxGeometryShaderInvocations = %u\n", limits->maxGeometryShaderInvocations ); - printf("\t\tmaxGeometryInputComponents = %u\n", limits->maxGeometryInputComponents ); - printf("\t\tmaxGeometryOutputComponents = %u\n", limits->maxGeometryOutputComponents ); - printf("\t\tmaxGeometryOutputVertices = %u\n", limits->maxGeometryOutputVertices ); - printf("\t\tmaxGeometryTotalOutputComponents = %u\n", limits->maxGeometryTotalOutputComponents ); - printf("\t\tmaxFragmentInputComponents = %u\n", limits->maxFragmentInputComponents ); - printf("\t\tmaxFragmentOutputAttachments = %u\n", limits->maxFragmentOutputAttachments ); - printf("\t\tmaxFragmentDualSrcAttachments = %u\n", limits->maxFragmentDualSrcAttachments ); - printf("\t\tmaxFragmentCombinedOutputResources = %u\n", limits->maxFragmentCombinedOutputResources ); - printf("\t\tmaxComputeSharedMemorySize = 0x%" PRIxLEAST32 "\n", limits->maxComputeSharedMemorySize ); - printf("\t\tmaxComputeWorkGroupCount[0] = %u\n", limits->maxComputeWorkGroupCount[0] ); - printf("\t\tmaxComputeWorkGroupCount[1] = %u\n", limits->maxComputeWorkGroupCount[1] ); - printf("\t\tmaxComputeWorkGroupCount[2] = %u\n", limits->maxComputeWorkGroupCount[2] ); - printf("\t\tmaxComputeWorkGroupInvocations = %u\n", limits->maxComputeWorkGroupInvocations ); - printf("\t\tmaxComputeWorkGroupSize[0] = %u\n", limits->maxComputeWorkGroupSize[0] ); - printf("\t\tmaxComputeWorkGroupSize[1] = %u\n", limits->maxComputeWorkGroupSize[1] ); - printf("\t\tmaxComputeWorkGroupSize[2] = %u\n", limits->maxComputeWorkGroupSize[2] ); - printf("\t\tsubPixelPrecisionBits = %u\n", limits->subPixelPrecisionBits ); - printf("\t\tsubTexelPrecisionBits = %u\n", limits->subTexelPrecisionBits ); - printf("\t\tmipmapPrecisionBits = %u\n", limits->mipmapPrecisionBits ); - printf("\t\tmaxDrawIndexedIndexValue = %u\n", limits->maxDrawIndexedIndexValue ); - printf("\t\tmaxDrawIndirectCount = %u\n", limits->maxDrawIndirectCount ); - printf("\t\tmaxSamplerLodBias = %f\n", limits->maxSamplerLodBias ); - printf("\t\tmaxSamplerAnisotropy = %f\n", limits->maxSamplerAnisotropy ); - printf("\t\tmaxViewports = %u\n", limits->maxViewports ); - printf("\t\tmaxViewportDimensions[0] = %u\n", limits->maxViewportDimensions[0] ); - printf("\t\tmaxViewportDimensions[1] = %u\n", limits->maxViewportDimensions[1] ); - printf("\t\tviewportBoundsRange[0] =%13f\n", limits->viewportBoundsRange[0] ); - printf("\t\tviewportBoundsRange[1] =%13f\n", limits->viewportBoundsRange[1] ); - printf("\t\tviewportSubPixelBits = %u\n", limits->viewportSubPixelBits ); - printf("\t\tminMemoryMapAlignment = " PRINTF_SIZE_T_SPECIFIER "\n", limits->minMemoryMapAlignment ); - printf("\t\tminTexelBufferOffsetAlignment = 0x%" PRIxLEAST64 "\n", limits->minTexelBufferOffsetAlignment ); - printf("\t\tminUniformBufferOffsetAlignment = 0x%" PRIxLEAST64 "\n", limits->minUniformBufferOffsetAlignment ); - printf("\t\tminStorageBufferOffsetAlignment = 0x%" PRIxLEAST64 "\n", limits->minStorageBufferOffsetAlignment ); - printf("\t\tminTexelOffset =%3d\n", limits->minTexelOffset ); - printf("\t\tmaxTexelOffset =%3d\n", limits->maxTexelOffset ); - printf("\t\tminTexelGatherOffset =%3d\n", limits->minTexelGatherOffset ); - printf("\t\tmaxTexelGatherOffset =%3d\n", limits->maxTexelGatherOffset ); - printf("\t\tminInterpolationOffset =%9f\n", limits->minInterpolationOffset ); - printf("\t\tmaxInterpolationOffset =%9f\n", limits->maxInterpolationOffset ); - printf("\t\tsubPixelInterpolationOffsetBits = %u\n", limits->subPixelInterpolationOffsetBits ); - printf("\t\tmaxFramebufferWidth = %u\n", limits->maxFramebufferWidth ); - printf("\t\tmaxFramebufferHeight = %u\n", limits->maxFramebufferHeight ); - printf("\t\tmaxFramebufferLayers = %u\n", limits->maxFramebufferLayers ); - printf("\t\tframebufferColorSampleCounts = %u\n", limits->framebufferColorSampleCounts ); - printf("\t\tframebufferDepthSampleCounts = %u\n", limits->framebufferDepthSampleCounts ); - printf("\t\tframebufferStencilSampleCounts = %u\n", limits->framebufferStencilSampleCounts ); - printf("\t\tframebufferNoAttachmentsSampleCounts = %u\n", limits->framebufferNoAttachmentsSampleCounts ); - printf("\t\tmaxColorAttachments = %u\n", limits->maxColorAttachments ); - printf("\t\tsampledImageColorSampleCounts = %u\n", limits->sampledImageColorSampleCounts ); - printf("\t\tsampledImageDepthSampleCounts = %u\n", limits->sampledImageDepthSampleCounts ); - printf("\t\tsampledImageStencilSampleCounts = %u\n", limits->sampledImageStencilSampleCounts ); - printf("\t\tsampledImageIntegerSampleCounts = %u\n", limits->sampledImageIntegerSampleCounts ); - printf("\t\tstorageImageSampleCounts = %u\n", limits->storageImageSampleCounts ); - printf("\t\tmaxSampleMaskWords = %u\n", limits->maxSampleMaskWords ); - printf("\t\ttimestampComputeAndGraphics = %u\n", limits->timestampComputeAndGraphics ); - printf("\t\ttimestampPeriod = %f\n", limits->timestampPeriod ); - printf("\t\tmaxClipDistances = %u\n", limits->maxClipDistances ); - printf("\t\tmaxCullDistances = %u\n", limits->maxCullDistances ); - printf("\t\tmaxCombinedClipAndCullDistances = %u\n", limits->maxCombinedClipAndCullDistances ); - printf("\t\tdiscreteQueuePriorities = %u\n", limits->discreteQueuePriorities ); - printf("\t\tpointSizeRange[0] = %f\n", limits->pointSizeRange[0] ); - printf("\t\tpointSizeRange[1] = %f\n", limits->pointSizeRange[1] ); - printf("\t\tlineWidthRange[0] = %f\n", limits->lineWidthRange[0] ); - printf("\t\tlineWidthRange[1] = %f\n", limits->lineWidthRange[1] ); - printf("\t\tpointSizeGranularity = %f\n", limits->pointSizeGranularity ); - printf("\t\tlineWidthGranularity = %f\n", limits->lineWidthGranularity ); - printf("\t\tstrictLines = %u\n", limits->strictLines ); - printf("\t\tstandardSampleLocations = %u\n", limits->standardSampleLocations ); - printf("\t\toptimalBufferCopyOffsetAlignment = 0x%" PRIxLEAST64 "\n", limits->optimalBufferCopyOffsetAlignment ); - printf("\t\toptimalBufferCopyRowPitchAlignment = 0x%" PRIxLEAST64 "\n", limits->optimalBufferCopyRowPitchAlignment ); - printf("\t\tnonCoherentAtomSize = 0x%" PRIxLEAST64 "\n", limits->nonCoherentAtomSize ); -} - -static void AppGpuDumpProps(const struct AppGpu *gpu) -{ - const VkPhysicalDeviceProperties *props = &gpu->props; - const uint32_t apiVersion=props->apiVersion; +static void AppGpuDumpFeatures(const struct AppGpu *gpu, FILE *out) { + VkPhysicalDeviceFeatures features; + + if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions, + gpu->inst->inst_extensions_count)) { + const VkPhysicalDeviceFeatures *features2_const = &gpu->features2.features; + features = *features2_const; + } else { + const VkPhysicalDeviceFeatures *features_const = &gpu->features; + features = *features_const; + } + + if (html_output) { + fprintf(out, "\t\t\t\t\t
VkPhysicalDeviceFeatures\n"); + fprintf(out, "\t\t\t\t\t\t
alphaToOne =
%u
\n", features.alphaToOne ); + fprintf(out, "\t\t\t\t\t\t
depthBiasClamp =
%u
\n", features.depthBiasClamp ); + fprintf(out, "\t\t\t\t\t\t
depthBounds =
%u
\n", features.depthBounds ); + fprintf(out, "\t\t\t\t\t\t
depthClamp =
%u
\n", features.depthClamp ); + fprintf(out, "\t\t\t\t\t\t
drawIndirectFirstInstance =
%u
\n", features.drawIndirectFirstInstance ); + fprintf(out, "\t\t\t\t\t\t
dualSrcBlend =
%u
\n", features.dualSrcBlend ); + fprintf(out, "\t\t\t\t\t\t
fillModeNonSolid =
%u
\n", features.fillModeNonSolid ); + fprintf(out, "\t\t\t\t\t\t
fragmentStoresAndAtomics =
%u
\n", features.fragmentStoresAndAtomics ); + fprintf(out, "\t\t\t\t\t\t
fullDrawIndexUint32 =
%u
\n", features.fullDrawIndexUint32 ); + fprintf(out, "\t\t\t\t\t\t
geometryShader =
%u
\n", features.geometryShader ); + fprintf(out, "\t\t\t\t\t\t
imageCubeArray =
%u
\n", features.imageCubeArray ); + fprintf(out, "\t\t\t\t\t\t
independentBlend =
%u
\n", features.independentBlend ); + fprintf(out, "\t\t\t\t\t\t
inheritedQueries =
%u
\n", features.inheritedQueries ); + fprintf(out, "\t\t\t\t\t\t
largePoints =
%u
\n", features.largePoints ); + fprintf(out, "\t\t\t\t\t\t
logicOp =
%u
\n", features.logicOp ); + fprintf(out, "\t\t\t\t\t\t
multiDrawIndirect =
%u
\n", features.multiDrawIndirect ); + fprintf(out, "\t\t\t\t\t\t
multiViewport =
%u
\n", features.multiViewport ); + fprintf(out, "\t\t\t\t\t\t
occlusionQueryPrecise =
%u
\n", features.occlusionQueryPrecise ); + fprintf(out, "\t\t\t\t\t\t
pipelineStatisticsQuery =
%u
\n", features.pipelineStatisticsQuery ); + fprintf(out, "\t\t\t\t\t\t
robustBufferAccess =
%u
\n", features.robustBufferAccess ); + fprintf(out, "\t\t\t\t\t\t
samplerAnisotropy =
%u
\n", features.samplerAnisotropy ); + fprintf(out, "\t\t\t\t\t\t
sampleRateShading =
%u
\n", features.sampleRateShading ); + fprintf(out, "\t\t\t\t\t\t
shaderClipDistance =
%u
\n", features.shaderClipDistance ); + fprintf(out, "\t\t\t\t\t\t
shaderCullDistance =
%u
\n", features.shaderCullDistance ); + fprintf(out, "\t\t\t\t\t\t
shaderFloat64 =
%u
\n", features.shaderFloat64 ); + fprintf(out, "\t\t\t\t\t\t
shaderImageGatherExtended =
%u
\n", features.shaderImageGatherExtended ); + fprintf(out, "\t\t\t\t\t\t
shaderInt16 =
%u
\n", features.shaderInt16 ); + fprintf(out, "\t\t\t\t\t\t
shaderInt64 =
%u
\n", features.shaderInt64 ); + fprintf(out, "\t\t\t\t\t\t
shaderResourceMinLod =
%u
\n", features.shaderResourceMinLod ); + fprintf(out, "\t\t\t\t\t\t
shaderResourceResidency =
%u
\n", features.shaderResourceResidency ); + fprintf(out, "\t\t\t\t\t\t
shaderSampledImageArrayDynamicIndexing =
%u
\n", features.shaderSampledImageArrayDynamicIndexing ); + fprintf(out, "\t\t\t\t\t\t
shaderStorageBufferArrayDynamicIndexing =
%u
\n", features.shaderStorageBufferArrayDynamicIndexing); + fprintf(out, "\t\t\t\t\t\t
shaderStorageImageArrayDynamicIndexing =
%u
\n", features.shaderStorageImageArrayDynamicIndexing ); + fprintf(out, "\t\t\t\t\t\t
shaderStorageImageExtendedFormats =
%u
\n", features.shaderStorageImageExtendedFormats ); + fprintf(out, "\t\t\t\t\t\t
shaderStorageImageMultisample =
%u
\n", features.shaderStorageImageMultisample ); + fprintf(out, "\t\t\t\t\t\t
shaderStorageImageReadWithoutFormat =
%u
\n", features.shaderStorageImageReadWithoutFormat ); + fprintf(out, "\t\t\t\t\t\t
shaderStorageImageWriteWithoutFormat =
%u
\n", features.shaderStorageImageWriteWithoutFormat ); + fprintf(out, "\t\t\t\t\t\t
shaderTessellationAndGeometryPointSize =
%u
\n", features.shaderTessellationAndGeometryPointSize ); + fprintf(out, "\t\t\t\t\t\t
shaderUniformBufferArrayDynamicIndexing =
%u
\n", features.shaderUniformBufferArrayDynamicIndexing); + fprintf(out, "\t\t\t\t\t\t
sparseBinding =
%u
\n", features.sparseBinding ); + fprintf(out, "\t\t\t\t\t\t
sparseResidency2Samples =
%u
\n", features.sparseResidency2Samples ); + fprintf(out, "\t\t\t\t\t\t
sparseResidency4Samples =
%u
\n", features.sparseResidency4Samples ); + fprintf(out, "\t\t\t\t\t\t
sparseResidency8Samples =
%u
\n", features.sparseResidency8Samples ); + fprintf(out, "\t\t\t\t\t\t
sparseResidency16Samples =
%u
\n", features.sparseResidency16Samples ); + fprintf(out, "\t\t\t\t\t\t
sparseResidencyAliased =
%u
\n", features.sparseResidencyAliased ); + fprintf(out, "\t\t\t\t\t\t
sparseResidencyBuffer =
%u
\n", features.sparseResidencyBuffer ); + fprintf(out, "\t\t\t\t\t\t
sparseResidencyImage2D =
%u
\n", features.sparseResidencyImage2D ); + fprintf(out, "\t\t\t\t\t\t
sparseResidencyImage3D =
%u
\n", features.sparseResidencyImage3D ); + fprintf(out, "\t\t\t\t\t\t
tessellationShader =
%u
\n", features.tessellationShader ); + fprintf(out, "\t\t\t\t\t\t
textureCompressionASTC_LDR =
%u
\n", features.textureCompressionASTC_LDR ); + fprintf(out, "\t\t\t\t\t\t
textureCompressionBC =
%u
\n", features.textureCompressionBC ); + fprintf(out, "\t\t\t\t\t\t
textureCompressionETC2 =
%u
\n", features.textureCompressionETC2 ); + fprintf(out, "\t\t\t\t\t\t
variableMultisampleRate =
%u
\n", features.variableMultisampleRate ); + fprintf(out, "\t\t\t\t\t\t
vertexPipelineStoresAndAtomics =
%u
\n", features.vertexPipelineStoresAndAtomics ); + fprintf(out, "\t\t\t\t\t\t
wideLines =
%u
\n", features.wideLines ); + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("VkPhysicalDeviceFeatures:\n"); + printf("=========================\n"); + printf("\talphaToOne = %u\n", features.alphaToOne ); + printf("\tdepthBiasClamp = %u\n", features.depthBiasClamp ); + printf("\tdepthBounds = %u\n", features.depthBounds ); + printf("\tdepthClamp = %u\n", features.depthClamp ); + printf("\tdrawIndirectFirstInstance = %u\n", features.drawIndirectFirstInstance ); + printf("\tdualSrcBlend = %u\n", features.dualSrcBlend ); + printf("\tfillModeNonSolid = %u\n", features.fillModeNonSolid ); + printf("\tfragmentStoresAndAtomics = %u\n", features.fragmentStoresAndAtomics ); + printf("\tfullDrawIndexUint32 = %u\n", features.fullDrawIndexUint32 ); + printf("\tgeometryShader = %u\n", features.geometryShader ); + printf("\timageCubeArray = %u\n", features.imageCubeArray ); + printf("\tindependentBlend = %u\n", features.independentBlend ); + printf("\tinheritedQueries = %u\n", features.inheritedQueries ); + printf("\tlargePoints = %u\n", features.largePoints ); + printf("\tlogicOp = %u\n", features.logicOp ); + printf("\tmultiDrawIndirect = %u\n", features.multiDrawIndirect ); + printf("\tmultiViewport = %u\n", features.multiViewport ); + printf("\tocclusionQueryPrecise = %u\n", features.occlusionQueryPrecise ); + printf("\tpipelineStatisticsQuery = %u\n", features.pipelineStatisticsQuery ); + printf("\trobustBufferAccess = %u\n", features.robustBufferAccess ); + printf("\tsamplerAnisotropy = %u\n", features.samplerAnisotropy ); + printf("\tsampleRateShading = %u\n", features.sampleRateShading ); + printf("\tshaderClipDistance = %u\n", features.shaderClipDistance ); + printf("\tshaderCullDistance = %u\n", features.shaderCullDistance ); + printf("\tshaderFloat64 = %u\n", features.shaderFloat64 ); + printf("\tshaderImageGatherExtended = %u\n", features.shaderImageGatherExtended ); + printf("\tshaderInt16 = %u\n", features.shaderInt16 ); + printf("\tshaderInt64 = %u\n", features.shaderInt64 ); + printf("\tshaderSampledImageArrayDynamicIndexing = %u\n", features.shaderSampledImageArrayDynamicIndexing ); + printf("\tshaderStorageBufferArrayDynamicIndexing = %u\n", features.shaderStorageBufferArrayDynamicIndexing); + printf("\tshaderStorageImageArrayDynamicIndexing = %u\n", features.shaderStorageImageArrayDynamicIndexing ); + printf("\tshaderStorageImageExtendedFormats = %u\n", features.shaderStorageImageExtendedFormats ); + printf("\tshaderStorageImageMultisample = %u\n", features.shaderStorageImageMultisample ); + printf("\tshaderStorageImageReadWithoutFormat = %u\n", features.shaderStorageImageReadWithoutFormat ); + printf("\tshaderStorageImageWriteWithoutFormat = %u\n", features.shaderStorageImageWriteWithoutFormat ); + printf("\tshaderTessellationAndGeometryPointSize = %u\n", features.shaderTessellationAndGeometryPointSize ); + printf("\tshaderUniformBufferArrayDynamicIndexing = %u\n", features.shaderUniformBufferArrayDynamicIndexing); + printf("\tsparseBinding = %u\n", features.sparseBinding ); + printf("\tsparseResidency2Samples = %u\n", features.sparseResidency2Samples ); + printf("\tsparseResidency4Samples = %u\n", features.sparseResidency4Samples ); + printf("\tsparseResidency8Samples = %u\n", features.sparseResidency8Samples ); + printf("\tsparseResidency16Samples = %u\n", features.sparseResidency16Samples ); + printf("\tsparseResidencyAliased = %u\n", features.sparseResidencyAliased ); + printf("\tsparseResidencyBuffer = %u\n", features.sparseResidencyBuffer ); + printf("\tsparseResidencyImage2D = %u\n", features.sparseResidencyImage2D ); + printf("\tsparseResidencyImage3D = %u\n", features.sparseResidencyImage3D ); + printf("\tshaderResourceMinLod = %u\n", features.shaderResourceMinLod ); + printf("\tshaderResourceResidency = %u\n", features.shaderResourceResidency ); + printf("\ttessellationShader = %u\n", features.tessellationShader ); + printf("\ttextureCompressionASTC_LDR = %u\n", features.textureCompressionASTC_LDR ); + printf("\ttextureCompressionBC = %u\n", features.textureCompressionBC ); + printf("\ttextureCompressionETC2 = %u\n", features.textureCompressionETC2 ); + printf("\tvariableMultisampleRate = %u\n", features.variableMultisampleRate ); + printf("\tvertexPipelineStoresAndAtomics = %u\n", features.vertexPipelineStoresAndAtomics ); + printf("\twideLines = %u\n", features.wideLines ); + } + if (json_output) { + printf(",\n"); + printf("\t\"VkPhysicalDeviceFeatures\": {\n"); + printf("\t\t\"alphaToOne\": %u,\n", features.alphaToOne); + printf("\t\t\"depthBiasClamp\": %u,\n", features.depthBiasClamp); + printf("\t\t\"depthBounds\": %u,\n", features.depthBounds); + printf("\t\t\"depthClamp\": %u,\n", features.depthClamp); + printf("\t\t\"drawIndirectFirstInstance\": %u,\n", features.drawIndirectFirstInstance); + printf("\t\t\"dualSrcBlend\": %u,\n", features.dualSrcBlend); + printf("\t\t\"fillModeNonSolid\": %u,\n", features.fillModeNonSolid); + printf("\t\t\"fragmentStoresAndAtomics\": %u,\n", features.fragmentStoresAndAtomics); + printf("\t\t\"fullDrawIndexUint32\": %u,\n", features.fullDrawIndexUint32); + printf("\t\t\"geometryShader\": %u,\n", features.geometryShader); + printf("\t\t\"imageCubeArray\": %u,\n", features.imageCubeArray); + printf("\t\t\"independentBlend\": %u,\n", features.independentBlend); + printf("\t\t\"inheritedQueries\": %u,\n", features.inheritedQueries); + printf("\t\t\"largePoints\": %u,\n", features.largePoints); + printf("\t\t\"logicOp\": %u,\n", features.logicOp); + printf("\t\t\"multiDrawIndirect\": %u,\n", features.multiDrawIndirect); + printf("\t\t\"multiViewport\": %u,\n", features.multiViewport); + printf("\t\t\"occlusionQueryPrecise\": %u,\n", features.occlusionQueryPrecise); + printf("\t\t\"pipelineStatisticsQuery\": %u,\n", features.pipelineStatisticsQuery); + printf("\t\t\"robustBufferAccess\": %u,\n", features.robustBufferAccess); + printf("\t\t\"samplerAnisotropy\": %u,\n", features.samplerAnisotropy); + printf("\t\t\"sampleRateShading\": %u,\n", features.sampleRateShading); + printf("\t\t\"shaderClipDistance\": %u,\n", features.shaderClipDistance); + printf("\t\t\"shaderCullDistance\": %u,\n", features.shaderCullDistance); + printf("\t\t\"shaderFloat64\": %u,\n", features.shaderFloat64); + printf("\t\t\"shaderImageGatherExtended\": %u,\n", features.shaderImageGatherExtended); + printf("\t\t\"shaderInt16\": %u,\n", features.shaderInt16); + printf("\t\t\"shaderInt64\": %u,\n", features.shaderInt64); + printf("\t\t\"shaderResourceMinLod\": %u,\n", features.shaderResourceMinLod); + printf("\t\t\"shaderResourceResidency\": %u,\n", features.shaderResourceResidency); + printf("\t\t\"shaderSampledImageArrayDynamicIndexing\": %u,\n", features.shaderSampledImageArrayDynamicIndexing); + printf("\t\t\"shaderStorageBufferArrayDynamicIndexing\": %u,\n", features.shaderStorageBufferArrayDynamicIndexing); + printf("\t\t\"shaderStorageImageArrayDynamicIndexing\": %u,\n", features.shaderStorageImageArrayDynamicIndexing); + printf("\t\t\"shaderStorageImageExtendedFormats\": %u,\n", features.shaderStorageImageExtendedFormats); + printf("\t\t\"shaderStorageImageMultisample\": %u,\n", features.shaderStorageImageMultisample); + printf("\t\t\"shaderStorageImageReadWithoutFormat\": %u,\n", features.shaderStorageImageReadWithoutFormat); + printf("\t\t\"shaderStorageImageWriteWithoutFormat\": %u,\n", features.shaderStorageImageWriteWithoutFormat); + printf("\t\t\"shaderTessellationAndGeometryPointSize\": %u,\n", features.shaderTessellationAndGeometryPointSize); + printf("\t\t\"shaderUniformBufferArrayDynamicIndexing\": %u,\n", features.shaderUniformBufferArrayDynamicIndexing); + printf("\t\t\"sparseBinding\": %u,\n", features.sparseBinding); + printf("\t\t\"sparseResidency2Samples\": %u,\n", features.sparseResidency2Samples); + printf("\t\t\"sparseResidency4Samples\": %u,\n", features.sparseResidency4Samples); + printf("\t\t\"sparseResidency8Samples\": %u,\n", features.sparseResidency8Samples); + printf("\t\t\"sparseResidency16Samples\": %u,\n", features.sparseResidency16Samples); + printf("\t\t\"sparseResidencyAliased\": %u,\n", features.sparseResidencyAliased); + printf("\t\t\"sparseResidencyBuffer\": %u,\n", features.sparseResidencyBuffer); + printf("\t\t\"sparseResidencyImage2D\": %u,\n", features.sparseResidencyImage2D); + printf("\t\t\"sparseResidencyImage3D\": %u,\n", features.sparseResidencyImage3D); + printf("\t\t\"tessellationShader\": %u,\n", features.tessellationShader); + printf("\t\t\"textureCompressionASTC_LDR\": %u,\n", features.textureCompressionASTC_LDR); + printf("\t\t\"textureCompressionBC\": %u,\n", features.textureCompressionBC); + printf("\t\t\"textureCompressionETC2\": %u,\n", features.textureCompressionETC2); + printf("\t\t\"variableMultisampleRate\": %u,\n", features.variableMultisampleRate); + printf("\t\t\"vertexPipelineStoresAndAtomics\": %u,\n", features.vertexPipelineStoresAndAtomics); + printf("\t\t\"wideLines\": %u\n", features.wideLines); + printf("\t}"); + } + + if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions, + gpu->inst->inst_extensions_count)) { + void *place = gpu->features2.pNext; + while (place) { + struct VkStructureHeader *structure = (struct VkStructureHeader*) place; + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR && CheckPhysicalDeviceExtensionIncluded(VK_KHR_16BIT_STORAGE_EXTENSION_NAME, gpu->device_extensions, gpu->device_extension_count)) { + VkPhysicalDevice16BitStorageFeaturesKHR *b16_store_features = (VkPhysicalDevice16BitStorageFeaturesKHR*)structure; + if (html_output) { + fprintf(out, "\n\t\t\t\t\t
VkPhysicalDevice16BitStorageFeatures\n"); + fprintf(out, "\t\t\t\t\t\t
storageBuffer16BitAccess =
%u
\n", b16_store_features->storageBuffer16BitAccess ); + fprintf(out, "\t\t\t\t\t\t
uniformAndStorageBuffer16BitAccess =
%u
\n", b16_store_features->uniformAndStorageBuffer16BitAccess); + fprintf(out, "\t\t\t\t\t\t
storagePushConstant16 =
%u
\n", b16_store_features->storagePushConstant16 ); + fprintf(out, "\t\t\t\t\t\t
storageInputOutput16 =
%u
\n", b16_store_features->storageInputOutput16 ); + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\nVkPhysicalDevice16BitStorageFeatures:\n"); + printf("=====================================\n"); + printf("\tstorageBuffer16BitAccess = %u\n", b16_store_features->storageBuffer16BitAccess ); + printf("\tuniformAndStorageBuffer16BitAccess = %u\n", b16_store_features->uniformAndStorageBuffer16BitAccess); + printf("\tstoragePushConstant16 = %u\n", b16_store_features->storagePushConstant16 ); + printf("\tstorageInputOutput16 = %u\n", b16_store_features->storageInputOutput16 ); + } + } else if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR && CheckPhysicalDeviceExtensionIncluded(VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME, gpu->device_extensions, gpu->device_extension_count)) { + VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR *sampler_ycbcr_features = (VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR*)structure; + if (html_output) { + fprintf(out, "\n\t\t\t\t\t
VkPhysicalDeviceSamplerYcbcrConversionFeatures\n"); + fprintf(out, "\t\t\t\t\t\t
samplerYcbcrConversion =
%u
\n", sampler_ycbcr_features->samplerYcbcrConversion); + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\nVkPhysicalDeviceSamplerYcbcrConversionFeatures:\n"); + printf("===============================================\n"); + printf("\tsamplerYcbcrConversion = %u\n", sampler_ycbcr_features->samplerYcbcrConversion); + } + } else if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR && CheckPhysicalDeviceExtensionIncluded(VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME, gpu->device_extensions, gpu->device_extension_count)) { + VkPhysicalDeviceVariablePointerFeaturesKHR *var_pointer_features = (VkPhysicalDeviceVariablePointerFeaturesKHR*)structure; + if (html_output) { + fprintf(out, "\n\t\t\t\t\t
VkPhysicalDeviceVariablePointerFeatures\n"); + fprintf(out, "\t\t\t\t\t\t
variablePointersStorageBuffer =
%u
\n", var_pointer_features->variablePointersStorageBuffer); + fprintf(out, "\t\t\t\t\t\t
variablePointers =
%u
\n", var_pointer_features->variablePointers ); + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\nVkPhysicalDeviceVariablePointerFeatures:\n"); + printf("========================================\n"); + printf("\tvariablePointersStorageBuffer = %u\n", var_pointer_features->variablePointersStorageBuffer); + printf("\tvariablePointers = %u\n", var_pointer_features->variablePointers ); + } + } else if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT && CheckPhysicalDeviceExtensionIncluded(VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME, gpu->device_extensions, gpu->device_extension_count)) { + VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *blend_op_adv_features = (VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT*)structure; + if (html_output) { + fprintf(out, "\n\t\t\t\t\t
VkPhysicalDeviceBlendOperationAdvancedFeatures\n"); + fprintf(out, "\t\t\t\t\t\t
advancedBlendCoherentOperations =
%u
\n", blend_op_adv_features->advancedBlendCoherentOperations); + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\nVkPhysicalDeviceBlendOperationAdvancedFeatures:\n"); + printf("===============================================\n"); + printf("\tadvancedBlendCoherentOperations = %u\n", blend_op_adv_features->advancedBlendCoherentOperations); + } + } else if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR && CheckPhysicalDeviceExtensionIncluded(VK_KHR_MULTIVIEW_EXTENSION_NAME, gpu->device_extensions, gpu->device_extension_count)) { + VkPhysicalDeviceMultiviewFeaturesKHR *multiview_features = (VkPhysicalDeviceMultiviewFeaturesKHR*)structure; + if (html_output) { + fprintf(out, "\n\t\t\t\t\t
VkPhysicalDeviceMultiviewFeatures\n"); + fprintf(out, "\t\t\t\t\t\t
multiview =
%u
\n", multiview_features->multiview ); + fprintf(out, "\t\t\t\t\t\t
multiviewGeometryShader =
%u
\n", multiview_features->multiviewGeometryShader ); + fprintf(out, "\t\t\t\t\t\t
multiviewTessellationShader =
%u
\n", multiview_features->multiviewTessellationShader); + fprintf(out, "\t\t\t\t\t
\n"); + } + else if (human_readable_output) { + printf("\nVkPhysicalDeviceMultiviewFeatures:\n"); + printf("==================================\n"); + printf("\tmultiview = %u\n", multiview_features->multiview ); + printf("\tmultiviewGeometryShader = %u\n", multiview_features->multiviewGeometryShader ); + printf("\tmultiviewTessellationShader = %u\n", multiview_features->multiviewTessellationShader); + } + } + place = structure->pNext; + } + } +} + +static void AppDumpSparseProps(const VkPhysicalDeviceSparseProperties *sparse_props, FILE *out) { + if (html_output) { + fprintf(out, "\t\t\t\t\t
VkPhysicalDeviceSparseProperties\n"); + fprintf(out, "\t\t\t\t\t\t
residencyStandard2DBlockShape =
%u
\n", sparse_props->residencyStandard2DBlockShape ); + fprintf(out, "\t\t\t\t\t\t
residencyStandard2DMultisampleBlockShape =
%u
\n", sparse_props->residencyStandard2DMultisampleBlockShape); + fprintf(out, "\t\t\t\t\t\t
residencyStandard3DBlockShape =
%u
\n", sparse_props->residencyStandard3DBlockShape ); + fprintf(out, "\t\t\t\t\t\t
residencyAlignedMipSize =
%u
\n", sparse_props->residencyAlignedMipSize ); + fprintf(out, "\t\t\t\t\t\t
residencyNonResidentStrict =
%u
\n", sparse_props->residencyNonResidentStrict ); + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\tVkPhysicalDeviceSparseProperties:\n"); + printf("\t---------------------------------\n"); + printf("\t\tresidencyStandard2DBlockShape = %u\n", sparse_props->residencyStandard2DBlockShape ); + printf("\t\tresidencyStandard2DMultisampleBlockShape = %u\n", sparse_props->residencyStandard2DMultisampleBlockShape); + printf("\t\tresidencyStandard3DBlockShape = %u\n", sparse_props->residencyStandard3DBlockShape ); + printf("\t\tresidencyAlignedMipSize = %u\n", sparse_props->residencyAlignedMipSize ); + printf("\t\tresidencyNonResidentStrict = %u\n", sparse_props->residencyNonResidentStrict ); + } + if (json_output) { + printf(",\n"); + printf("\t\t\"sparseProperties\": {\n"); + printf("\t\t\t\"residencyAlignedMipSize\": %u,\n", sparse_props->residencyAlignedMipSize); + printf("\t\t\t\"residencyNonResidentStrict\": %u,\n", sparse_props->residencyNonResidentStrict); + printf("\t\t\t\"residencyStandard2DBlockShape\": %u,\n", sparse_props->residencyStandard2DBlockShape); + printf("\t\t\t\"residencyStandard2DMultisampleBlockShape\": %u,\n", sparse_props->residencyStandard2DMultisampleBlockShape); + printf("\t\t\t\"residencyStandard3DBlockShape\": %u\n", sparse_props->residencyStandard3DBlockShape); + printf("\t\t}"); + } +} + +static void AppDumpLimits(const VkPhysicalDeviceLimits *limits, FILE *out) { + if (html_output) { + fprintf(out, "\t\t\t\t\t
VkPhysicalDeviceLimits\n"); + fprintf(out, "\t\t\t\t\t\t
maxImageDimension1D =
%u
\n", limits->maxImageDimension1D ); + fprintf(out, "\t\t\t\t\t\t
maxImageDimension2D =
%u
\n", limits->maxImageDimension2D ); + fprintf(out, "\t\t\t\t\t\t
maxImageDimension3D =
%u
\n", limits->maxImageDimension3D ); + fprintf(out, "\t\t\t\t\t\t
maxImageDimensionCube =
%u
\n", limits->maxImageDimensionCube ); + fprintf(out, "\t\t\t\t\t\t
maxImageArrayLayers =
%u
\n", limits->maxImageArrayLayers ); + fprintf(out, "\t\t\t\t\t\t
maxTexelBufferElements =
0x%" PRIxLEAST32 "
\n", limits->maxTexelBufferElements ); + fprintf(out, "\t\t\t\t\t\t
maxUniformBufferRange =
0x%" PRIxLEAST32 "
\n", limits->maxUniformBufferRange ); + fprintf(out, "\t\t\t\t\t\t
maxStorageBufferRange =
0x%" PRIxLEAST32 "
\n", limits->maxStorageBufferRange ); + fprintf(out, "\t\t\t\t\t\t
maxPushConstantsSize =
%u
\n", limits->maxPushConstantsSize ); + fprintf(out, "\t\t\t\t\t\t
maxMemoryAllocationCount =
%u
\n", limits->maxMemoryAllocationCount ); + fprintf(out, "\t\t\t\t\t\t
maxSamplerAllocationCount =
%u
\n", limits->maxSamplerAllocationCount ); + fprintf(out, "\t\t\t\t\t\t
bufferImageGranularity =
0x%" PRIxLEAST64 "
\n", limits->bufferImageGranularity ); + fprintf(out, "\t\t\t\t\t\t
sparseAddressSpaceSize =
0x%" PRIxLEAST64 "
\n", limits->sparseAddressSpaceSize ); + fprintf(out, "\t\t\t\t\t\t
maxBoundDescriptorSets =
%u
\n", limits->maxBoundDescriptorSets ); + fprintf(out, "\t\t\t\t\t\t
maxPerStageDescriptorSamplers =
%u
\n", limits->maxPerStageDescriptorSamplers ); + fprintf(out, "\t\t\t\t\t\t
maxPerStageDescriptorUniformBuffers =
%u
\n", limits->maxPerStageDescriptorUniformBuffers ); + fprintf(out, "\t\t\t\t\t\t
maxPerStageDescriptorStorageBuffers =
%u
\n", limits->maxPerStageDescriptorStorageBuffers ); + fprintf(out, "\t\t\t\t\t\t
maxPerStageDescriptorSampledImages =
%u
\n", limits->maxPerStageDescriptorSampledImages ); + fprintf(out, "\t\t\t\t\t\t
maxPerStageDescriptorStorageImages =
%u
\n", limits->maxPerStageDescriptorStorageImages ); + fprintf(out, "\t\t\t\t\t\t
maxPerStageDescriptorInputAttachments =
%u
\n", limits->maxPerStageDescriptorInputAttachments ); + fprintf(out, "\t\t\t\t\t\t
maxPerStageResources =
%u
\n", limits->maxPerStageResources ); + fprintf(out, "\t\t\t\t\t\t
maxDescriptorSetSamplers =
%u
\n", limits->maxDescriptorSetSamplers ); + fprintf(out, "\t\t\t\t\t\t
maxDescriptorSetUniformBuffers =
%u
\n", limits->maxDescriptorSetUniformBuffers ); + fprintf(out, "\t\t\t\t\t\t
maxDescriptorSetUniformBuffersDynamic =
%u
\n", limits->maxDescriptorSetUniformBuffersDynamic ); + fprintf(out, "\t\t\t\t\t\t
maxDescriptorSetStorageBuffers =
%u
\n", limits->maxDescriptorSetStorageBuffers ); + fprintf(out, "\t\t\t\t\t\t
maxDescriptorSetStorageBuffersDynamic =
%u
\n", limits->maxDescriptorSetStorageBuffersDynamic ); + fprintf(out, "\t\t\t\t\t\t
maxDescriptorSetSampledImages =
%u
\n", limits->maxDescriptorSetSampledImages ); + fprintf(out, "\t\t\t\t\t\t
maxDescriptorSetStorageImages =
%u
\n", limits->maxDescriptorSetStorageImages ); + fprintf(out, "\t\t\t\t\t\t
maxDescriptorSetInputAttachments =
%u
\n", limits->maxDescriptorSetInputAttachments ); + fprintf(out, "\t\t\t\t\t\t
maxVertexInputAttributes =
%u
\n", limits->maxVertexInputAttributes ); + fprintf(out, "\t\t\t\t\t\t
maxVertexInputBindings =
%u
\n", limits->maxVertexInputBindings ); + fprintf(out, "\t\t\t\t\t\t
maxVertexInputAttributeOffset =
0x%" PRIxLEAST32 "
\n", limits->maxVertexInputAttributeOffset ); + fprintf(out, "\t\t\t\t\t\t
maxVertexInputBindingStride =
0x%" PRIxLEAST32 "
\n", limits->maxVertexInputBindingStride ); + fprintf(out, "\t\t\t\t\t\t
maxVertexOutputComponents =
%u
\n", limits->maxVertexOutputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxTessellationGenerationLevel =
%u
\n", limits->maxTessellationGenerationLevel ); + fprintf(out, "\t\t\t\t\t\t
maxTessellationPatchSize =
%u
\n", limits->maxTessellationPatchSize ); + fprintf(out, "\t\t\t\t\t\t
maxTessellationControlPerVertexInputComponents =
%u
\n", limits->maxTessellationControlPerVertexInputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxTessellationControlPerVertexOutputComponents =
%u
\n", limits->maxTessellationControlPerVertexOutputComponents); + fprintf(out, "\t\t\t\t\t\t
maxTessellationControlPerPatchOutputComponents =
%u
\n", limits->maxTessellationControlPerPatchOutputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxTessellationControlTotalOutputComponents =
%u
\n", limits->maxTessellationControlTotalOutputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxTessellationEvaluationInputComponents =
%u
\n", limits->maxTessellationEvaluationInputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxTessellationEvaluationOutputComponents =
%u
\n", limits->maxTessellationEvaluationOutputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxGeometryShaderInvocations =
%u
\n", limits->maxGeometryShaderInvocations ); + fprintf(out, "\t\t\t\t\t\t
maxGeometryInputComponents =
%u
\n", limits->maxGeometryInputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxGeometryOutputComponents =
%u
\n", limits->maxGeometryOutputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxGeometryOutputVertices =
%u
\n", limits->maxGeometryOutputVertices ); + fprintf(out, "\t\t\t\t\t\t
maxGeometryTotalOutputComponents =
%u
\n", limits->maxGeometryTotalOutputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxFragmentInputComponents =
%u
\n", limits->maxFragmentInputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxFragmentOutputAttachments =
%u
\n", limits->maxFragmentOutputAttachments ); + fprintf(out, "\t\t\t\t\t\t
maxFragmentDualSrcAttachments =
%u
\n", limits->maxFragmentDualSrcAttachments ); + fprintf(out, "\t\t\t\t\t\t
maxFragmentCombinedOutputResources =
%u
\n", limits->maxFragmentCombinedOutputResources ); + fprintf(out, "\t\t\t\t\t\t
maxComputeSharedMemorySize =
0x%" PRIxLEAST32 "
\n", limits->maxComputeSharedMemorySize ); + fprintf(out, "\t\t\t\t\t\t
maxComputeWorkGroupCount[0] =
%u
\n", limits->maxComputeWorkGroupCount[0] ); + fprintf(out, "\t\t\t\t\t\t
maxComputeWorkGroupCount[1] =
%u
\n", limits->maxComputeWorkGroupCount[1] ); + fprintf(out, "\t\t\t\t\t\t
maxComputeWorkGroupCount[2] =
%u
\n", limits->maxComputeWorkGroupCount[2] ); + fprintf(out, "\t\t\t\t\t\t
maxComputeWorkGroupInvocations =
%u
\n", limits->maxComputeWorkGroupInvocations ); + fprintf(out, "\t\t\t\t\t\t
maxComputeWorkGroupSize[0] =
%u
\n", limits->maxComputeWorkGroupSize[0] ); + fprintf(out, "\t\t\t\t\t\t
maxComputeWorkGroupSize[1] =
%u
\n", limits->maxComputeWorkGroupSize[1] ); + fprintf(out, "\t\t\t\t\t\t
maxComputeWorkGroupSize[2] =
%u
\n", limits->maxComputeWorkGroupSize[2] ); + fprintf(out, "\t\t\t\t\t\t
subPixelPrecisionBits =
%u
\n", limits->subPixelPrecisionBits ); + fprintf(out, "\t\t\t\t\t\t
subTexelPrecisionBits =
%u
\n", limits->subTexelPrecisionBits ); + fprintf(out, "\t\t\t\t\t\t
mipmapPrecisionBits =
%u
\n", limits->mipmapPrecisionBits ); + fprintf(out, "\t\t\t\t\t\t
maxDrawIndexedIndexValue =
%u
\n", limits->maxDrawIndexedIndexValue ); + fprintf(out, "\t\t\t\t\t\t
maxDrawIndirectCount =
%u
\n", limits->maxDrawIndirectCount ); + fprintf(out, "\t\t\t\t\t\t
maxSamplerLodBias =
%f
\n", limits->maxSamplerLodBias ); + fprintf(out, "\t\t\t\t\t\t
maxSamplerAnisotropy =
%f
\n", limits->maxSamplerAnisotropy ); + fprintf(out, "\t\t\t\t\t\t
maxViewports =
%u
\n", limits->maxViewports ); + fprintf(out, "\t\t\t\t\t\t
maxViewportDimensions[0] =
%u
\n", limits->maxViewportDimensions[0] ); + fprintf(out, "\t\t\t\t\t\t
maxViewportDimensions[1] =
%u
\n", limits->maxViewportDimensions[1] ); + fprintf(out, "\t\t\t\t\t\t
viewportBoundsRange[0] =
%13f
\n", limits->viewportBoundsRange[0] ); + fprintf(out, "\t\t\t\t\t\t
viewportBoundsRange[1] =
%13f
\n", limits->viewportBoundsRange[1] ); + fprintf(out, "\t\t\t\t\t\t
viewportSubPixelBits =
%u
\n", limits->viewportSubPixelBits ); + fprintf(out, "\t\t\t\t\t\t
minMemoryMapAlignment =
" PRINTF_SIZE_T_SPECIFIER "
\n", limits->minMemoryMapAlignment ); + fprintf(out, "\t\t\t\t\t\t
minTexelBufferOffsetAlignment =
0x%" PRIxLEAST64 "
\n", limits->minTexelBufferOffsetAlignment ); + fprintf(out, "\t\t\t\t\t\t
minUniformBufferOffsetAlignment =
0x%" PRIxLEAST64 "
\n", limits->minUniformBufferOffsetAlignment ); + fprintf(out, "\t\t\t\t\t\t
minStorageBufferOffsetAlignment =
0x%" PRIxLEAST64 "
\n", limits->minStorageBufferOffsetAlignment ); + fprintf(out, "\t\t\t\t\t\t
minTexelOffset =
%3d
\n", limits->minTexelOffset ); + fprintf(out, "\t\t\t\t\t\t
maxTexelOffset =
%3d
\n", limits->maxTexelOffset ); + fprintf(out, "\t\t\t\t\t\t
minTexelGatherOffset =
%3d
\n", limits->minTexelGatherOffset ); + fprintf(out, "\t\t\t\t\t\t
maxTexelGatherOffset =
%3d
\n", limits->maxTexelGatherOffset ); + fprintf(out, "\t\t\t\t\t\t
minInterpolationOffset =
%9f
\n", limits->minInterpolationOffset ); + fprintf(out, "\t\t\t\t\t\t
maxInterpolationOffset =
%9f
\n", limits->maxInterpolationOffset ); + fprintf(out, "\t\t\t\t\t\t
subPixelInterpolationOffsetBits =
%u
\n", limits->subPixelInterpolationOffsetBits ); + fprintf(out, "\t\t\t\t\t\t
maxFramebufferWidth =
%u
\n", limits->maxFramebufferWidth ); + fprintf(out, "\t\t\t\t\t\t
maxFramebufferHeight =
%u
\n", limits->maxFramebufferHeight ); + fprintf(out, "\t\t\t\t\t\t
maxFramebufferLayers =
%u
\n", limits->maxFramebufferLayers ); + fprintf(out, "\t\t\t\t\t\t
framebufferColorSampleCounts =
%u
\n", limits->framebufferColorSampleCounts ); + fprintf(out, "\t\t\t\t\t\t
framebufferDepthSampleCounts =
%u
\n", limits->framebufferDepthSampleCounts ); + fprintf(out, "\t\t\t\t\t\t
framebufferStencilSampleCounts =
%u
\n", limits->framebufferStencilSampleCounts ); + fprintf(out, "\t\t\t\t\t\t
framebufferNoAttachmentsSampleCounts =
%u
\n", limits->framebufferNoAttachmentsSampleCounts ); + fprintf(out, "\t\t\t\t\t\t
maxColorAttachments =
%u
\n", limits->maxColorAttachments ); + fprintf(out, "\t\t\t\t\t\t
sampledImageColorSampleCounts =
%u
\n", limits->sampledImageColorSampleCounts ); + fprintf(out, "\t\t\t\t\t\t
sampledImageDepthSampleCounts =
%u
\n", limits->sampledImageDepthSampleCounts ); + fprintf(out, "\t\t\t\t\t\t
sampledImageStencilSampleCounts =
%u
\n", limits->sampledImageStencilSampleCounts ); + fprintf(out, "\t\t\t\t\t\t
sampledImageIntegerSampleCounts =
%u
\n", limits->sampledImageIntegerSampleCounts ); + fprintf(out, "\t\t\t\t\t\t
storageImageSampleCounts =
%u
\n", limits->storageImageSampleCounts ); + fprintf(out, "\t\t\t\t\t\t
maxSampleMaskWords =
%u
\n", limits->maxSampleMaskWords ); + fprintf(out, "\t\t\t\t\t\t
timestampComputeAndGraphics =
%u
\n", limits->timestampComputeAndGraphics ); + fprintf(out, "\t\t\t\t\t\t
timestampPeriod =
%f
\n", limits->timestampPeriod ); + fprintf(out, "\t\t\t\t\t\t
maxClipDistances =
%u
\n", limits->maxClipDistances ); + fprintf(out, "\t\t\t\t\t\t
maxCullDistances =
%u
\n", limits->maxCullDistances ); + fprintf(out, "\t\t\t\t\t\t
maxCombinedClipAndCullDistances =
%u
\n", limits->maxCombinedClipAndCullDistances ); + fprintf(out, "\t\t\t\t\t\t
discreteQueuePriorities =
%u
\n", limits->discreteQueuePriorities ); + fprintf(out, "\t\t\t\t\t\t
pointSizeRange[0] =
%f
\n", limits->pointSizeRange[0] ); + fprintf(out, "\t\t\t\t\t\t
pointSizeRange[1] =
%f
\n", limits->pointSizeRange[1] ); + fprintf(out, "\t\t\t\t\t\t
lineWidthRange[0] =
%f
\n", limits->lineWidthRange[0] ); + fprintf(out, "\t\t\t\t\t\t
lineWidthRange[1] =
%f
\n", limits->lineWidthRange[1] ); + fprintf(out, "\t\t\t\t\t\t
pointSizeGranularity =
%f
\n", limits->pointSizeGranularity ); + fprintf(out, "\t\t\t\t\t\t
lineWidthGranularity =
%f
\n", limits->lineWidthGranularity ); + fprintf(out, "\t\t\t\t\t\t
strictLines =
%u
\n", limits->strictLines ); + fprintf(out, "\t\t\t\t\t\t
standardSampleLocations =
%u
\n", limits->standardSampleLocations ); + fprintf(out, "\t\t\t\t\t\t
optimalBufferCopyOffsetAlignment =
0x%" PRIxLEAST64 "
\n", limits->optimalBufferCopyOffsetAlignment ); + fprintf(out, "\t\t\t\t\t\t
optimalBufferCopyRowPitchAlignment =
0x%" PRIxLEAST64 "
\n", limits->optimalBufferCopyRowPitchAlignment ); + fprintf(out, "\t\t\t\t\t\t
nonCoherentAtomSize =
0x%" PRIxLEAST64 "
\n", limits->nonCoherentAtomSize ); + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\tVkPhysicalDeviceLimits:\n"); + printf("\t-----------------------\n"); + printf("\t\tmaxImageDimension1D = %u\n", limits->maxImageDimension1D ); + printf("\t\tmaxImageDimension2D = %u\n", limits->maxImageDimension2D ); + printf("\t\tmaxImageDimension3D = %u\n", limits->maxImageDimension3D ); + printf("\t\tmaxImageDimensionCube = %u\n", limits->maxImageDimensionCube ); + printf("\t\tmaxImageArrayLayers = %u\n", limits->maxImageArrayLayers ); + printf("\t\tmaxTexelBufferElements = 0x%" PRIxLEAST32 "\n", limits->maxTexelBufferElements ); + printf("\t\tmaxUniformBufferRange = 0x%" PRIxLEAST32 "\n", limits->maxUniformBufferRange ); + printf("\t\tmaxStorageBufferRange = 0x%" PRIxLEAST32 "\n", limits->maxStorageBufferRange ); + printf("\t\tmaxPushConstantsSize = %u\n", limits->maxPushConstantsSize ); + printf("\t\tmaxMemoryAllocationCount = %u\n", limits->maxMemoryAllocationCount ); + printf("\t\tmaxSamplerAllocationCount = %u\n", limits->maxSamplerAllocationCount ); + printf("\t\tbufferImageGranularity = 0x%" PRIxLEAST64 "\n", limits->bufferImageGranularity ); + printf("\t\tsparseAddressSpaceSize = 0x%" PRIxLEAST64 "\n", limits->sparseAddressSpaceSize ); + printf("\t\tmaxBoundDescriptorSets = %u\n", limits->maxBoundDescriptorSets ); + printf("\t\tmaxPerStageDescriptorSamplers = %u\n", limits->maxPerStageDescriptorSamplers ); + printf("\t\tmaxPerStageDescriptorUniformBuffers = %u\n", limits->maxPerStageDescriptorUniformBuffers ); + printf("\t\tmaxPerStageDescriptorStorageBuffers = %u\n", limits->maxPerStageDescriptorStorageBuffers ); + printf("\t\tmaxPerStageDescriptorSampledImages = %u\n", limits->maxPerStageDescriptorSampledImages ); + printf("\t\tmaxPerStageDescriptorStorageImages = %u\n", limits->maxPerStageDescriptorStorageImages ); + printf("\t\tmaxPerStageDescriptorInputAttachments = %u\n", limits->maxPerStageDescriptorInputAttachments ); + printf("\t\tmaxPerStageResources = %u\n", limits->maxPerStageResources ); + printf("\t\tmaxDescriptorSetSamplers = %u\n", limits->maxDescriptorSetSamplers ); + printf("\t\tmaxDescriptorSetUniformBuffers = %u\n", limits->maxDescriptorSetUniformBuffers ); + printf("\t\tmaxDescriptorSetUniformBuffersDynamic = %u\n", limits->maxDescriptorSetUniformBuffersDynamic ); + printf("\t\tmaxDescriptorSetStorageBuffers = %u\n", limits->maxDescriptorSetStorageBuffers ); + printf("\t\tmaxDescriptorSetStorageBuffersDynamic = %u\n", limits->maxDescriptorSetStorageBuffersDynamic ); + printf("\t\tmaxDescriptorSetSampledImages = %u\n", limits->maxDescriptorSetSampledImages ); + printf("\t\tmaxDescriptorSetStorageImages = %u\n", limits->maxDescriptorSetStorageImages ); + printf("\t\tmaxDescriptorSetInputAttachments = %u\n", limits->maxDescriptorSetInputAttachments ); + printf("\t\tmaxVertexInputAttributes = %u\n", limits->maxVertexInputAttributes ); + printf("\t\tmaxVertexInputBindings = %u\n", limits->maxVertexInputBindings ); + printf("\t\tmaxVertexInputAttributeOffset = 0x%" PRIxLEAST32 "\n", limits->maxVertexInputAttributeOffset ); + printf("\t\tmaxVertexInputBindingStride = 0x%" PRIxLEAST32 "\n", limits->maxVertexInputBindingStride ); + printf("\t\tmaxVertexOutputComponents = %u\n", limits->maxVertexOutputComponents ); + printf("\t\tmaxTessellationGenerationLevel = %u\n", limits->maxTessellationGenerationLevel ); + printf("\t\tmaxTessellationPatchSize = %u\n", limits->maxTessellationPatchSize ); + printf("\t\tmaxTessellationControlPerVertexInputComponents = %u\n", limits->maxTessellationControlPerVertexInputComponents ); + printf("\t\tmaxTessellationControlPerVertexOutputComponents = %u\n", limits->maxTessellationControlPerVertexOutputComponents); + printf("\t\tmaxTessellationControlPerPatchOutputComponents = %u\n", limits->maxTessellationControlPerPatchOutputComponents ); + printf("\t\tmaxTessellationControlTotalOutputComponents = %u\n", limits->maxTessellationControlTotalOutputComponents ); + printf("\t\tmaxTessellationEvaluationInputComponents = %u\n", limits->maxTessellationEvaluationInputComponents ); + printf("\t\tmaxTessellationEvaluationOutputComponents = %u\n", limits->maxTessellationEvaluationOutputComponents ); + printf("\t\tmaxGeometryShaderInvocations = %u\n", limits->maxGeometryShaderInvocations ); + printf("\t\tmaxGeometryInputComponents = %u\n", limits->maxGeometryInputComponents ); + printf("\t\tmaxGeometryOutputComponents = %u\n", limits->maxGeometryOutputComponents ); + printf("\t\tmaxGeometryOutputVertices = %u\n", limits->maxGeometryOutputVertices ); + printf("\t\tmaxGeometryTotalOutputComponents = %u\n", limits->maxGeometryTotalOutputComponents ); + printf("\t\tmaxFragmentInputComponents = %u\n", limits->maxFragmentInputComponents ); + printf("\t\tmaxFragmentOutputAttachments = %u\n", limits->maxFragmentOutputAttachments ); + printf("\t\tmaxFragmentDualSrcAttachments = %u\n", limits->maxFragmentDualSrcAttachments ); + printf("\t\tmaxFragmentCombinedOutputResources = %u\n", limits->maxFragmentCombinedOutputResources ); + printf("\t\tmaxComputeSharedMemorySize = 0x%" PRIxLEAST32 "\n", limits->maxComputeSharedMemorySize ); + printf("\t\tmaxComputeWorkGroupCount[0] = %u\n", limits->maxComputeWorkGroupCount[0] ); + printf("\t\tmaxComputeWorkGroupCount[1] = %u\n", limits->maxComputeWorkGroupCount[1] ); + printf("\t\tmaxComputeWorkGroupCount[2] = %u\n", limits->maxComputeWorkGroupCount[2] ); + printf("\t\tmaxComputeWorkGroupInvocations = %u\n", limits->maxComputeWorkGroupInvocations ); + printf("\t\tmaxComputeWorkGroupSize[0] = %u\n", limits->maxComputeWorkGroupSize[0] ); + printf("\t\tmaxComputeWorkGroupSize[1] = %u\n", limits->maxComputeWorkGroupSize[1] ); + printf("\t\tmaxComputeWorkGroupSize[2] = %u\n", limits->maxComputeWorkGroupSize[2] ); + printf("\t\tsubPixelPrecisionBits = %u\n", limits->subPixelPrecisionBits ); + printf("\t\tsubTexelPrecisionBits = %u\n", limits->subTexelPrecisionBits ); + printf("\t\tmipmapPrecisionBits = %u\n", limits->mipmapPrecisionBits ); + printf("\t\tmaxDrawIndexedIndexValue = %u\n", limits->maxDrawIndexedIndexValue ); + printf("\t\tmaxDrawIndirectCount = %u\n", limits->maxDrawIndirectCount ); + printf("\t\tmaxSamplerLodBias = %f\n", limits->maxSamplerLodBias ); + printf("\t\tmaxSamplerAnisotropy = %f\n", limits->maxSamplerAnisotropy ); + printf("\t\tmaxViewports = %u\n", limits->maxViewports ); + printf("\t\tmaxViewportDimensions[0] = %u\n", limits->maxViewportDimensions[0] ); + printf("\t\tmaxViewportDimensions[1] = %u\n", limits->maxViewportDimensions[1] ); + printf("\t\tviewportBoundsRange[0] =%13f\n", limits->viewportBoundsRange[0] ); + printf("\t\tviewportBoundsRange[1] =%13f\n", limits->viewportBoundsRange[1] ); + printf("\t\tviewportSubPixelBits = %u\n", limits->viewportSubPixelBits ); + printf("\t\tminMemoryMapAlignment = " PRINTF_SIZE_T_SPECIFIER "\n", limits->minMemoryMapAlignment ); + printf("\t\tminTexelBufferOffsetAlignment = 0x%" PRIxLEAST64 "\n", limits->minTexelBufferOffsetAlignment ); + printf("\t\tminUniformBufferOffsetAlignment = 0x%" PRIxLEAST64 "\n", limits->minUniformBufferOffsetAlignment ); + printf("\t\tminStorageBufferOffsetAlignment = 0x%" PRIxLEAST64 "\n", limits->minStorageBufferOffsetAlignment ); + printf("\t\tminTexelOffset =%3d\n", limits->minTexelOffset ); + printf("\t\tmaxTexelOffset =%3d\n", limits->maxTexelOffset ); + printf("\t\tminTexelGatherOffset =%3d\n", limits->minTexelGatherOffset ); + printf("\t\tmaxTexelGatherOffset =%3d\n", limits->maxTexelGatherOffset ); + printf("\t\tminInterpolationOffset =%9f\n", limits->minInterpolationOffset ); + printf("\t\tmaxInterpolationOffset =%9f\n", limits->maxInterpolationOffset ); + printf("\t\tsubPixelInterpolationOffsetBits = %u\n", limits->subPixelInterpolationOffsetBits ); + printf("\t\tmaxFramebufferWidth = %u\n", limits->maxFramebufferWidth ); + printf("\t\tmaxFramebufferHeight = %u\n", limits->maxFramebufferHeight ); + printf("\t\tmaxFramebufferLayers = %u\n", limits->maxFramebufferLayers ); + printf("\t\tframebufferColorSampleCounts = %u\n", limits->framebufferColorSampleCounts ); + printf("\t\tframebufferDepthSampleCounts = %u\n", limits->framebufferDepthSampleCounts ); + printf("\t\tframebufferStencilSampleCounts = %u\n", limits->framebufferStencilSampleCounts ); + printf("\t\tframebufferNoAttachmentsSampleCounts = %u\n", limits->framebufferNoAttachmentsSampleCounts ); + printf("\t\tmaxColorAttachments = %u\n", limits->maxColorAttachments ); + printf("\t\tsampledImageColorSampleCounts = %u\n", limits->sampledImageColorSampleCounts ); + printf("\t\tsampledImageDepthSampleCounts = %u\n", limits->sampledImageDepthSampleCounts ); + printf("\t\tsampledImageStencilSampleCounts = %u\n", limits->sampledImageStencilSampleCounts ); + printf("\t\tsampledImageIntegerSampleCounts = %u\n", limits->sampledImageIntegerSampleCounts ); + printf("\t\tstorageImageSampleCounts = %u\n", limits->storageImageSampleCounts ); + printf("\t\tmaxSampleMaskWords = %u\n", limits->maxSampleMaskWords ); + printf("\t\ttimestampComputeAndGraphics = %u\n", limits->timestampComputeAndGraphics ); + printf("\t\ttimestampPeriod = %f\n", limits->timestampPeriod ); + printf("\t\tmaxClipDistances = %u\n", limits->maxClipDistances ); + printf("\t\tmaxCullDistances = %u\n", limits->maxCullDistances ); + printf("\t\tmaxCombinedClipAndCullDistances = %u\n", limits->maxCombinedClipAndCullDistances ); + printf("\t\tdiscreteQueuePriorities = %u\n", limits->discreteQueuePriorities ); + printf("\t\tpointSizeRange[0] = %f\n", limits->pointSizeRange[0] ); + printf("\t\tpointSizeRange[1] = %f\n", limits->pointSizeRange[1] ); + printf("\t\tlineWidthRange[0] = %f\n", limits->lineWidthRange[0] ); + printf("\t\tlineWidthRange[1] = %f\n", limits->lineWidthRange[1] ); + printf("\t\tpointSizeGranularity = %f\n", limits->pointSizeGranularity ); + printf("\t\tlineWidthGranularity = %f\n", limits->lineWidthGranularity ); + printf("\t\tstrictLines = %u\n", limits->strictLines ); + printf("\t\tstandardSampleLocations = %u\n", limits->standardSampleLocations ); + printf("\t\toptimalBufferCopyOffsetAlignment = 0x%" PRIxLEAST64 "\n", limits->optimalBufferCopyOffsetAlignment ); + printf("\t\toptimalBufferCopyRowPitchAlignment = 0x%" PRIxLEAST64 "\n", limits->optimalBufferCopyRowPitchAlignment ); + printf("\t\tnonCoherentAtomSize = 0x%" PRIxLEAST64 "\n", limits->nonCoherentAtomSize ); + } + if (json_output) { + printf(",\n"); + printf("\t\t\"limits\": {\n"); + printf("\t\t\t\"bufferImageGranularity\": %llu,\n", (unsigned long long)limits->bufferImageGranularity); + printf("\t\t\t\"discreteQueuePriorities\": %u,\n", limits->discreteQueuePriorities); + printf("\t\t\t\"framebufferColorSampleCounts\": %u,\n", limits->framebufferColorSampleCounts); + printf("\t\t\t\"framebufferDepthSampleCounts\": %u,\n", limits->framebufferDepthSampleCounts); + printf("\t\t\t\"framebufferNoAttachmentsSampleCounts\": %u,\n", limits->framebufferNoAttachmentsSampleCounts); + printf("\t\t\t\"framebufferStencilSampleCounts\": %u,\n", limits->framebufferStencilSampleCounts); + printf("\t\t\t\"lineWidthGranularity\": %g,\n", limits->lineWidthGranularity); + printf("\t\t\t\"lineWidthRange\": [\n"); + printf("\t\t\t\t%g,\n", limits->lineWidthRange[0]); + printf("\t\t\t\t%g\n", limits->lineWidthRange[1]); + printf("\t\t\t],\n"); + printf("\t\t\t\"maxBoundDescriptorSets\": %u,\n", limits->maxBoundDescriptorSets); + printf("\t\t\t\"maxClipDistances\": %u,\n", limits->maxClipDistances); + printf("\t\t\t\"maxColorAttachments\": %u,\n", limits->maxColorAttachments); + printf("\t\t\t\"maxCombinedClipAndCullDistances\": %u,\n", limits->maxCombinedClipAndCullDistances); + printf("\t\t\t\"maxComputeSharedMemorySize\": %u,\n", limits->maxComputeSharedMemorySize); + printf("\t\t\t\"maxComputeWorkGroupCount\": [\n"); + printf("\t\t\t\t%u,\n", limits->maxComputeWorkGroupCount[0]); + printf("\t\t\t\t%u,\n", limits->maxComputeWorkGroupCount[1]); + printf("\t\t\t\t%u\n", limits->maxComputeWorkGroupCount[2]); + printf("\t\t\t],\n"); + printf("\t\t\t\"maxComputeWorkGroupInvocations\": %u,\n", limits->maxComputeWorkGroupInvocations); + printf("\t\t\t\"maxComputeWorkGroupSize\": [\n"); + printf("\t\t\t\t%u,\n", limits->maxComputeWorkGroupSize[0]); + printf("\t\t\t\t%u,\n", limits->maxComputeWorkGroupSize[1]); + printf("\t\t\t\t%u\n", limits->maxComputeWorkGroupSize[2]); + printf("\t\t\t],\n"); + printf("\t\t\t\"maxCullDistances\": %u,\n", limits->maxCullDistances); + printf("\t\t\t\"maxDescriptorSetInputAttachments\": %u,\n", limits->maxDescriptorSetInputAttachments); + printf("\t\t\t\"maxDescriptorSetSampledImages\": %u,\n", limits->maxDescriptorSetSampledImages); + printf("\t\t\t\"maxDescriptorSetSamplers\": %u,\n", limits->maxDescriptorSetSamplers); + printf("\t\t\t\"maxDescriptorSetStorageBuffers\": %u,\n", limits->maxDescriptorSetStorageBuffers); + printf("\t\t\t\"maxDescriptorSetStorageBuffersDynamic\": %u,\n", limits->maxDescriptorSetStorageBuffersDynamic); + printf("\t\t\t\"maxDescriptorSetStorageImages\": %u,\n", limits->maxDescriptorSetStorageImages); + printf("\t\t\t\"maxDescriptorSetUniformBuffers\": %u,\n", limits->maxDescriptorSetUniformBuffers); + printf("\t\t\t\"maxDescriptorSetUniformBuffersDynamic\": %u,\n", limits->maxDescriptorSetUniformBuffersDynamic); + printf("\t\t\t\"maxDrawIndexedIndexValue\": %u,\n", limits->maxDrawIndexedIndexValue); + printf("\t\t\t\"maxDrawIndirectCount\": %u,\n", limits->maxDrawIndirectCount); + printf("\t\t\t\"maxFragmentCombinedOutputResources\": %u,\n", limits->maxFragmentCombinedOutputResources); + printf("\t\t\t\"maxFragmentDualSrcAttachments\": %u,\n", limits->maxFragmentDualSrcAttachments); + printf("\t\t\t\"maxFragmentInputComponents\": %u,\n", limits->maxFragmentInputComponents); + printf("\t\t\t\"maxFragmentOutputAttachments\": %u,\n", limits->maxFragmentOutputAttachments); + printf("\t\t\t\"maxFramebufferHeight\": %u,\n", limits->maxFramebufferHeight); + printf("\t\t\t\"maxFramebufferLayers\": %u,\n", limits->maxFramebufferLayers); + printf("\t\t\t\"maxFramebufferWidth\": %u,\n", limits->maxFramebufferWidth); + printf("\t\t\t\"maxGeometryInputComponents\": %u,\n", limits->maxGeometryInputComponents); + printf("\t\t\t\"maxGeometryOutputComponents\": %u,\n", limits->maxGeometryOutputComponents); + printf("\t\t\t\"maxGeometryOutputVertices\": %u,\n", limits->maxGeometryOutputVertices); + printf("\t\t\t\"maxGeometryShaderInvocations\": %u,\n", limits->maxGeometryShaderInvocations); + printf("\t\t\t\"maxGeometryTotalOutputComponents\": %u,\n", limits->maxGeometryTotalOutputComponents); + printf("\t\t\t\"maxImageArrayLayers\": %u,\n", limits->maxImageArrayLayers); + printf("\t\t\t\"maxImageDimension1D\": %u,\n", limits->maxImageDimension1D); + printf("\t\t\t\"maxImageDimension2D\": %u,\n", limits->maxImageDimension2D); + printf("\t\t\t\"maxImageDimension3D\": %u,\n", limits->maxImageDimension3D); + printf("\t\t\t\"maxImageDimensionCube\": %u,\n", limits->maxImageDimensionCube); + printf("\t\t\t\"maxInterpolationOffset\": %g,\n", limits->maxInterpolationOffset); + printf("\t\t\t\"maxMemoryAllocationCount\": %u,\n", limits->maxMemoryAllocationCount); + printf("\t\t\t\"maxPerStageDescriptorInputAttachments\": %u,\n", limits->maxPerStageDescriptorInputAttachments); + printf("\t\t\t\"maxPerStageDescriptorSampledImages\": %u,\n", limits->maxPerStageDescriptorSampledImages); + printf("\t\t\t\"maxPerStageDescriptorSamplers\": %u,\n", limits->maxPerStageDescriptorSamplers); + printf("\t\t\t\"maxPerStageDescriptorStorageBuffers\": %u,\n", limits->maxPerStageDescriptorStorageBuffers); + printf("\t\t\t\"maxPerStageDescriptorStorageImages\": %u,\n", limits->maxPerStageDescriptorStorageImages); + printf("\t\t\t\"maxPerStageDescriptorUniformBuffers\": %u,\n", limits->maxPerStageDescriptorUniformBuffers); + printf("\t\t\t\"maxPerStageResources\": %u,\n", limits->maxPerStageResources); + printf("\t\t\t\"maxPushConstantsSize\": %u,\n", limits->maxPushConstantsSize); + printf("\t\t\t\"maxSampleMaskWords\": %u,\n", limits->maxSampleMaskWords); + printf("\t\t\t\"maxSamplerAllocationCount\": %u,\n", limits->maxSamplerAllocationCount); + printf("\t\t\t\"maxSamplerAnisotropy\": %g,\n", limits->maxSamplerAnisotropy); + printf("\t\t\t\"maxSamplerLodBias\": %g,\n", limits->maxSamplerLodBias); + printf("\t\t\t\"maxStorageBufferRange\": %u,\n", limits->maxStorageBufferRange); + printf("\t\t\t\"maxTessellationControlPerPatchOutputComponents\": %u,\n", limits->maxTessellationControlPerPatchOutputComponents); + printf("\t\t\t\"maxTessellationControlPerVertexInputComponents\": %u,\n", limits->maxTessellationControlPerVertexInputComponents); + printf("\t\t\t\"maxTessellationControlPerVertexOutputComponents\": %u,\n", limits->maxTessellationControlPerVertexOutputComponents); + printf("\t\t\t\"maxTessellationControlTotalOutputComponents\": %u,\n", limits->maxTessellationControlTotalOutputComponents); + printf("\t\t\t\"maxTessellationEvaluationInputComponents\": %u,\n", limits->maxTessellationEvaluationInputComponents); + printf("\t\t\t\"maxTessellationEvaluationOutputComponents\": %u,\n", limits->maxTessellationEvaluationOutputComponents); + printf("\t\t\t\"maxTessellationGenerationLevel\": %u,\n", limits->maxTessellationGenerationLevel); + printf("\t\t\t\"maxTessellationPatchSize\": %u,\n", limits->maxTessellationPatchSize); + printf("\t\t\t\"maxTexelBufferElements\": %u,\n", limits->maxTexelBufferElements); + printf("\t\t\t\"maxTexelGatherOffset\": %u,\n", limits->maxTexelGatherOffset); + printf("\t\t\t\"maxTexelOffset\": %u,\n", limits->maxTexelOffset); + printf("\t\t\t\"maxUniformBufferRange\": %u,\n", limits->maxUniformBufferRange); + printf("\t\t\t\"maxVertexInputAttributeOffset\": %u,\n", limits->maxVertexInputAttributeOffset); + printf("\t\t\t\"maxVertexInputAttributes\": %u,\n", limits->maxVertexInputAttributes); + printf("\t\t\t\"maxVertexInputBindings\": %u,\n", limits->maxVertexInputBindings); + printf("\t\t\t\"maxVertexInputBindingStride\": %u,\n", limits->maxVertexInputBindingStride); + printf("\t\t\t\"maxVertexOutputComponents\": %u,\n", limits->maxVertexOutputComponents); + printf("\t\t\t\"maxViewportDimensions\": [\n"); + printf("\t\t\t\t%u,\n", limits->maxViewportDimensions[0]); + printf("\t\t\t\t%u\n", limits->maxViewportDimensions[1]); + printf("\t\t\t],\n"); + printf("\t\t\t\"maxViewports\": %u,\n", limits->maxViewports); + printf("\t\t\t\"minInterpolationOffset\": %g,\n", limits->minInterpolationOffset); + printf("\t\t\t\"minMemoryMapAlignment\": " PRINTF_SIZE_T_SPECIFIER ",\n", limits->minMemoryMapAlignment); + printf("\t\t\t\"minStorageBufferOffsetAlignment\": %llu,\n", (unsigned long long)limits->minStorageBufferOffsetAlignment); + printf("\t\t\t\"minTexelBufferOffsetAlignment\": %llu,\n", (unsigned long long)limits->minTexelBufferOffsetAlignment); + printf("\t\t\t\"minTexelGatherOffset\": %d,\n", limits->minTexelGatherOffset); + printf("\t\t\t\"minTexelOffset\": %d,\n", limits->minTexelOffset); + printf("\t\t\t\"minUniformBufferOffsetAlignment\": %llu,\n", (unsigned long long)limits->minUniformBufferOffsetAlignment); + printf("\t\t\t\"mipmapPrecisionBits\": %u,\n", limits->mipmapPrecisionBits); + printf("\t\t\t\"nonCoherentAtomSize\": %llu,\n", (unsigned long long)limits->nonCoherentAtomSize); + printf("\t\t\t\"optimalBufferCopyOffsetAlignment\": %llu,\n", (unsigned long long)limits->optimalBufferCopyOffsetAlignment); + printf("\t\t\t\"optimalBufferCopyRowPitchAlignment\": %llu,\n", (unsigned long long)limits->optimalBufferCopyRowPitchAlignment); + printf("\t\t\t\"pointSizeGranularity\": %g,\n", limits->pointSizeGranularity); + printf("\t\t\t\"pointSizeRange\": [\n"); + printf("\t\t\t\t%g,\n", limits->pointSizeRange[0]); + printf("\t\t\t\t%g\n", limits->pointSizeRange[1]); + printf("\t\t\t],\n"); + printf("\t\t\t\"sampledImageColorSampleCounts\": %u,\n", limits->sampledImageColorSampleCounts); + printf("\t\t\t\"sampledImageDepthSampleCounts\": %u,\n", limits->sampledImageDepthSampleCounts); + printf("\t\t\t\"sampledImageIntegerSampleCounts\": %u,\n", limits->sampledImageIntegerSampleCounts); + printf("\t\t\t\"sampledImageStencilSampleCounts\": %u,\n", limits->sampledImageStencilSampleCounts); + printf("\t\t\t\"sparseAddressSpaceSize\": %llu,\n", (unsigned long long)limits->sparseAddressSpaceSize); + printf("\t\t\t\"standardSampleLocations\": %u,\n", limits->standardSampleLocations); + printf("\t\t\t\"storageImageSampleCounts\": %u,\n", limits->storageImageSampleCounts); + printf("\t\t\t\"strictLines\": %u,\n", limits->strictLines); + printf("\t\t\t\"subPixelInterpolationOffsetBits\": %u,\n", limits->subPixelInterpolationOffsetBits); + printf("\t\t\t\"subPixelPrecisionBits\": %u,\n", limits->subPixelPrecisionBits); + printf("\t\t\t\"subTexelPrecisionBits\": %u,\n", limits->subTexelPrecisionBits); + printf("\t\t\t\"timestampComputeAndGraphics\": %u,\n", limits->timestampComputeAndGraphics); + printf("\t\t\t\"timestampPeriod\": %g,\n", limits->timestampPeriod); + printf("\t\t\t\"viewportBoundsRange\": [\n"); + printf("\t\t\t\t%g,\n", limits->viewportBoundsRange[0]); + printf("\t\t\t\t%g\n", limits->viewportBoundsRange[1]); + printf("\t\t\t],\n"); + printf("\t\t\t\"viewportSubPixelBits\": %u\n", limits->viewportSubPixelBits); + printf("\t\t}"); + } +} + +static void AppGpuDumpProps(const struct AppGpu *gpu, FILE *out) { + VkPhysicalDeviceProperties props; + + if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions, + gpu->inst->inst_extensions_count)) { + const VkPhysicalDeviceProperties *props2_const = &gpu->props2.properties; + props = *props2_const; + } else { + const VkPhysicalDeviceProperties *props_const = &gpu->props; + props = *props_const; + } + const uint32_t apiVersion = props.apiVersion; const uint32_t major = VK_VERSION_MAJOR(apiVersion); const uint32_t minor = VK_VERSION_MINOR(apiVersion); const uint32_t patch = VK_VERSION_PATCH(apiVersion); - printf("VkPhysicalDeviceProperties:\n"); - printf("===========================\n"); - printf("\tapiVersion = 0x%" PRIxLEAST32 " (%d.%d.%d)\n", apiVersion, major, minor, patch); - printf("\tdriverVersion = %u (0x%" PRIxLEAST32 ")\n",props->driverVersion, props->driverVersion); - printf("\tvendorID = 0x%04x\n", props->vendorID); - printf("\tdeviceID = 0x%04x\n", props->deviceID); - printf("\tdeviceType = %s\n", VkPhysicalDeviceTypeString(props->deviceType)); - printf("\tdeviceName = %s\n", props->deviceName); + if (html_output) { + fprintf(out, "\t\t\t\t\t
VkPhysicalDeviceProperties\n"); + fprintf(out, "\t\t\t\t\t\t
apiVersion =
0x%" PRIxLEAST32 "
(
%d.%d.%d
)
\n", apiVersion, major, minor, patch); + fprintf(out, "\t\t\t\t\t\t
driverVersion =
%u
(
0x%" PRIxLEAST32 "
)
\n", props.driverVersion, props.driverVersion); + fprintf(out, "\t\t\t\t\t\t
vendorID =
0x%04x
\n", props.vendorID); + fprintf(out, "\t\t\t\t\t\t
deviceID =
0x%04x
\n", props.deviceID); + fprintf(out, "\t\t\t\t\t\t
deviceType = %s
\n", VkPhysicalDeviceTypeString(props.deviceType)); + fprintf(out, "\t\t\t\t\t\t
deviceName = %s
\n", props.deviceName); + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("VkPhysicalDeviceProperties:\n"); + printf("===========================\n"); + printf("\tapiVersion = 0x%" PRIxLEAST32 " (%d.%d.%d)\n", apiVersion, major, minor, patch); + printf("\tdriverVersion = %u (0x%" PRIxLEAST32 ")\n", props.driverVersion, props.driverVersion); + printf("\tvendorID = 0x%04x\n", props.vendorID); + printf("\tdeviceID = 0x%04x\n", props.deviceID); + printf("\tdeviceType = %s\n", VkPhysicalDeviceTypeString(props.deviceType)); + printf("\tdeviceName = %s\n", props.deviceName); + } + if (json_output) { + printf(",\n"); + printf("\t\"VkPhysicalDeviceProperties\": {\n"); + printf("\t\t\"apiVersion\": %u,\n", apiVersion); + printf("\t\t\"deviceID\": %u,\n", props.deviceID); + printf("\t\t\"deviceName\": \"%s\",\n", props.deviceName); + printf("\t\t\"deviceType\": %u,\n", props.deviceType); + printf("\t\t\"driverVersion\": %u", props.driverVersion); + } + + if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions, gpu->inst->inst_extensions_count)) { + AppDumpLimits(&gpu->props2.properties.limits, out); + } else { + AppDumpLimits(&gpu->props.limits, out); + } + + // Dump pipeline cache UUIDs to json + if (json_output) { + printf(",\n"); + printf("\t\t\"pipelineCacheUUID\": ["); + for (uint32_t i = 0; i < VK_UUID_SIZE; ++i) { + if (i > 0) { + printf(","); + } + printf("\n"); + printf("\t\t\t%u", props.pipelineCacheUUID[i]); + } + printf("\n"); + printf("\t\t]"); + } - AppDumpLimits(&gpu->props.limits); - AppDumpSparseProps(&gpu->props.sparseProperties); + if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions, gpu->inst->inst_extensions_count)) { + AppDumpSparseProps(&gpu->props2.properties.sparseProperties, out); + } else { + AppDumpSparseProps(&gpu->props.sparseProperties, out); + } + if (json_output) { + printf(",\n"); + printf("\t\t\"vendorID\": %u\n", props.vendorID); + printf("\t}"); + } + + if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions, + gpu->inst->inst_extensions_count)) { + void *place = gpu->props2.pNext; + while (place) { + struct VkStructureHeader *structure = (struct VkStructureHeader*) place; + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT && CheckPhysicalDeviceExtensionIncluded(VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME, gpu->device_extensions, gpu->device_extension_count)) { + VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *blend_op_adv_props = (VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT*)structure; + if (html_output) { + fprintf(out, "\n\t\t\t\t\t
VkPhysicalDeviceBlendOperationAdvancedProperties\n"); + fprintf(out, "\t\t\t\t\t\t
advancedBlendMaxColorAttachments =
%u
\n", blend_op_adv_props->advancedBlendMaxColorAttachments ); + fprintf(out, "\t\t\t\t\t\t
advancedBlendIndependentBlend =
%u
\n", blend_op_adv_props->advancedBlendIndependentBlend ); + fprintf(out, "\t\t\t\t\t\t
advancedBlendNonPremultipliedSrcColor =
%u
\n", blend_op_adv_props->advancedBlendNonPremultipliedSrcColor); + fprintf(out, "\t\t\t\t\t\t
advancedBlendNonPremultipliedDstColor =
%u
\n", blend_op_adv_props->advancedBlendNonPremultipliedDstColor); + fprintf(out, "\t\t\t\t\t\t
advancedBlendCorrelatedOverlap =
%u
\n", blend_op_adv_props->advancedBlendCorrelatedOverlap ); + fprintf(out, "\t\t\t\t\t\t
advancedBlendAllOperations =
%u
\n", blend_op_adv_props->advancedBlendAllOperations ); + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\nVkPhysicalDeviceBlendOperationAdvancedProperties:\n"); + printf("=================================================\n"); + printf("\tadvancedBlendMaxColorAttachments = %u\n", blend_op_adv_props->advancedBlendMaxColorAttachments ); + printf("\tadvancedBlendIndependentBlend = %u\n", blend_op_adv_props->advancedBlendIndependentBlend ); + printf("\tadvancedBlendNonPremultipliedSrcColor = %u\n", blend_op_adv_props->advancedBlendNonPremultipliedSrcColor); + printf("\tadvancedBlendNonPremultipliedDstColor = %u\n", blend_op_adv_props->advancedBlendNonPremultipliedDstColor); + printf("\tadvancedBlendCorrelatedOverlap = %u\n", blend_op_adv_props->advancedBlendCorrelatedOverlap ); + printf("\tadvancedBlendAllOperations = %u\n", blend_op_adv_props->advancedBlendAllOperations ); + } + } else if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES_KHR && CheckPhysicalDeviceExtensionIncluded(VK_KHR_MAINTENANCE2_EXTENSION_NAME, gpu->device_extensions, gpu->device_extension_count)) { + VkPhysicalDevicePointClippingPropertiesKHR *pt_clip_props = (VkPhysicalDevicePointClippingPropertiesKHR*)structure; + if (html_output) { + fprintf(out, "\n\t\t\t\t\t
VkPhysicalDevicePointClippingProperties\n"); + fprintf(out, "\t\t\t\t\t\t
pointClippingBehavior =
%u
\n", pt_clip_props->pointClippingBehavior); + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\nVkPhysicalDevicePointClippingProperties:\n"); + printf("========================================\n"); + printf("\tpointClippingBehavior = %u\n", pt_clip_props->pointClippingBehavior); + } + } else if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR && CheckPhysicalDeviceExtensionIncluded(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME, gpu->device_extensions, gpu->device_extension_count)) { + VkPhysicalDevicePushDescriptorPropertiesKHR *push_desc_props = (VkPhysicalDevicePushDescriptorPropertiesKHR*)structure; + if (html_output) { + fprintf(out, "\n\t\t\t\t\t
VkPhysicalDevicePushDescriptorProperties\n"); + fprintf(out, "\t\t\t\t\t\t
maxPushDescriptors =
%u
\n", push_desc_props->maxPushDescriptors); + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\nVkPhysicalDevicePushDescriptorProperties:\n"); + printf("=========================================\n"); + printf("\tmaxPushDescriptors = %u\n", push_desc_props->maxPushDescriptors); + } + } else if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT && CheckPhysicalDeviceExtensionIncluded(VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME, gpu->device_extensions, gpu->device_extension_count)) { + VkPhysicalDeviceDiscardRectanglePropertiesEXT *discard_rect_props = (VkPhysicalDeviceDiscardRectanglePropertiesEXT*)structure; + if (html_output) { + fprintf(out, "\n\t\t\t\t\t
VkPhysicalDeviceDiscardRectangleProperties\n"); + fprintf(out, "\t\t\t\t\t\t
maxDiscardRectangles =
%u
\n", discard_rect_props->maxDiscardRectangles); + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\nVkPhysicalDeviceDiscardRectangleProperties:\n"); + printf("=========================================\n"); + printf("\tmaxDiscardRectangles = %u\n", discard_rect_props->maxDiscardRectangles); + } + } else if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHR && CheckPhysicalDeviceExtensionIncluded(VK_KHR_MULTIVIEW_EXTENSION_NAME, gpu->device_extensions, gpu->device_extension_count)) { + VkPhysicalDeviceMultiviewPropertiesKHR *multiview_props = (VkPhysicalDeviceMultiviewPropertiesKHR*)structure; + if (html_output) { + fprintf(out, "\n\t\t\t\t\t
VkPhysicalDeviceMultiviewProperties\n"); + fprintf(out, "\t\t\t\t\t\t
maxMultiviewInstanceIndex =
%u
\n", multiview_props->maxMultiviewInstanceIndex); + fprintf(out, "\t\t\t\t\t\t
maxMultiviewViewCount =
%u
\n", multiview_props->maxMultiviewViewCount ); + fprintf(out, "\t\t\t\t\t
\n"); + } + else if (human_readable_output) { + printf("\nVkPhysicalDeviceMultiviewProperties:\n"); + printf("=========================================\n"); + printf("\tmaxMultiviewInstanceIndex = %u\n", multiview_props->maxMultiviewInstanceIndex); + printf("\tmaxMultiviewViewCount = %u\n", multiview_props->maxMultiviewViewCount ); + } + } + place = structure->pNext; + } + } + + fflush(out); fflush(stdout); } -// clang-format on static void AppDumpExtensions(const char *indent, const char *layer_name, const uint32_t extension_count, - const VkExtensionProperties *extension_properties) { - uint32_t i; + const VkExtensionProperties *extension_properties, FILE *out) { + if (html_output) { + fprintf(out, "\t\t\t%s
", indent); + } if (layer_name && (strlen(layer_name) > 0)) { - printf("%s%s Extensions", indent, layer_name); + if (html_output) { + fprintf(out, "%s Extensions", layer_name); + } else if (human_readable_output) { + printf("%s%s Extensions", indent, layer_name); + } } else { - printf("%sExtensions", indent); + if (html_output) { + fprintf(out, "Extensions"); + } else if (human_readable_output) { + printf("%sExtensions", indent); + } + } + if (html_output) { + fprintf(out, "\tcount =
%d
", extension_count); + if (extension_count > 0) { + fprintf(out, "\n"); + } + } else if (human_readable_output) { + printf("\tcount = %d\n", extension_count); } - printf("\tcount = %d\n", extension_count); - for (i = 0; i < extension_count; i++) { - VkExtensionProperties const *ext_prop = &extension_properties[i]; - printf("%s\t", indent); - printf("%-36s: extension revision %2d\n", ext_prop->extensionName, ext_prop->specVersion); + const bool is_device_type = strcmp(layer_name, "Device") == 0; + if (is_device_type && json_output) { + printf(",\n"); + printf("\t\"ArrayOfVkExtensionProperties\": ["); } + + for (uint32_t i = 0; i < extension_count; ++i) { + VkExtensionProperties const *ext_prop = &extension_properties[i]; + if (html_output) { + fprintf(out, "\t\t\t\t%s
", indent); + fprintf(out, "
%s
: extension revision
%d
", ext_prop->extensionName, + ext_prop->specVersion); + fprintf(out, "
\n"); + } else if (human_readable_output) { + printf("%s\t", indent); + printf("%-36s: extension revision %2d\n", ext_prop->extensionName, ext_prop->specVersion); + } + if (is_device_type && json_output) { + if (i > 0) { + printf(","); + } + printf("\n"); + printf("\t\t{\n"); + printf("\t\t\t\"extensionName\": \"%s\",\n", ext_prop->extensionName); + printf("\t\t\t\"specVersion\": %u\n", ext_prop->specVersion); + printf("\t\t}"); + } + } + if (html_output) { + if (extension_count > 0) { + fprintf(out, "\t\t\t%s
\n", indent); + } else { + fprintf(out, "\n"); + } + } + if (is_device_type && json_output) { + if (extension_count > 0) { + printf("\n\t"); + } + printf("]"); + } + + fflush(out); fflush(stdout); } -static void AppGpuDumpQueueProps(const struct AppGpu *gpu, uint32_t id) { - const VkQueueFamilyProperties *props = &gpu->queue_props[id]; +static void AppGpuDumpQueueProps(const struct AppGpu *gpu, uint32_t id, FILE *out) { + VkQueueFamilyProperties props; + + if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions, + gpu->inst->inst_extensions_count)) { + const VkQueueFamilyProperties *props2_const = &gpu->queue_props2[id].queueFamilyProperties; + props = *props2_const; + } else { + const VkQueueFamilyProperties *props_const = &gpu->queue_props[id]; + props = *props_const; + } + + if (html_output) { + fprintf(out, "\t\t\t\t\t
VkQueueFamilyProperties[
%d
]
\n", id); + fprintf(out, "\t\t\t\t\t\t
queueFlags = "); + } else if (human_readable_output) { + printf("VkQueueFamilyProperties[%d]:\n", id); + printf("===========================\n"); + printf("\tqueueFlags = "); + } + if (html_output || human_readable_output) { + char *sep = ""; // separator character + if (props.queueFlags & VK_QUEUE_GRAPHICS_BIT) { + fprintf(out, "GRAPHICS"); + sep = " | "; + } + if (props.queueFlags & VK_QUEUE_COMPUTE_BIT) { + fprintf(out, "%sCOMPUTE", sep); + sep = " | "; + } + if (props.queueFlags & VK_QUEUE_TRANSFER_BIT) { + fprintf(out, "%sTRANSFER", sep); + sep = " | "; + } + if (props.queueFlags & VK_QUEUE_SPARSE_BINDING_BIT) { + fprintf(out, "%sSPARSE", sep); + } + } + + if (html_output) { + fprintf(out, "
\n"); + fprintf(out, "\t\t\t\t\t\t
queueCount =
%u
\n", props.queueCount); + fprintf(out, "\t\t\t\t\t\t
timestampValidBits =
%u
\n", props.timestampValidBits); + fprintf(out, "\t\t\t\t\t\t
minImageTransferGranularity = (
%d
,
%d
,
%d
)
\n", + props.minImageTransferGranularity.width, props.minImageTransferGranularity.height, props.minImageTransferGranularity.depth); + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\n"); + printf("\tqueueCount = %u\n", props.queueCount); + printf("\ttimestampValidBits = %u\n", props.timestampValidBits); + printf("\tminImageTransferGranularity = (%d, %d, %d)\n", props.minImageTransferGranularity.width, + props.minImageTransferGranularity.height, props.minImageTransferGranularity.depth); + } + if (json_output) { + printf("\t\t{\n"); + printf("\t\t\t\"minImageTransferGranularity\": {\n"); + printf("\t\t\t\t\"depth\": %u,\n", props.minImageTransferGranularity.depth); + printf("\t\t\t\t\"height\": %u,\n", props.minImageTransferGranularity.height); + printf("\t\t\t\t\"width\": %u\n", props.minImageTransferGranularity.width); + printf("\t\t\t},\n"); + printf("\t\t\t\"queueCount\": %u,\n", props.queueCount); + printf("\t\t\t\"queueFlags\": %u,\n", props.queueFlags); + printf("\t\t\t\"timestampValidBits\": %u\n", props.timestampValidBits); + printf("\t\t}"); + } - printf("VkQueueFamilyProperties[%d]:\n", id); - printf("===========================\n"); - char *sep = ""; // separator character - printf("\tqueueFlags = "); - if (props->queueFlags & VK_QUEUE_GRAPHICS_BIT) { - printf("GRAPHICS"); - sep = " | "; - } - if (props->queueFlags & VK_QUEUE_COMPUTE_BIT) { - printf("%sCOMPUTE", sep); - sep = " | "; - } - if (props->queueFlags & VK_QUEUE_TRANSFER_BIT) { - printf("%sTRANSFER", sep); - sep = " | "; - } - if (props->queueFlags & VK_QUEUE_SPARSE_BINDING_BIT) { - printf("%sSPARSE", sep); - } - printf("\n"); - - printf("\tqueueCount = %u\n", props->queueCount); - printf("\ttimestampValidBits = %u\n", props->timestampValidBits); - printf("\tminImageTransferGranularity = (%d, %d, %d)\n", props->minImageTransferGranularity.width, - props->minImageTransferGranularity.height, props->minImageTransferGranularity.depth); + fflush(out); fflush(stdout); } @@ -1554,70 +2691,378 @@ return strndup(buf, kBufferSize); } -static void AppGpuDumpMemoryProps(const struct AppGpu *gpu) { - const VkPhysicalDeviceMemoryProperties *props = &gpu->memory_props; +static void AppGpuDumpMemoryProps(const struct AppGpu *gpu, FILE *out) { + VkPhysicalDeviceMemoryProperties props; + + if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions, + gpu->inst->inst_extensions_count)) { + const VkPhysicalDeviceMemoryProperties *props2_const = &gpu->memory_props2.memoryProperties; + props = *props2_const; + } else { + const VkPhysicalDeviceMemoryProperties *props_const = &gpu->memory_props; + props = *props_const; + } - printf("VkPhysicalDeviceMemoryProperties:\n"); - printf("=================================\n"); - printf("\tmemoryTypeCount = %u\n", props->memoryTypeCount); - for (uint32_t i = 0; i < props->memoryTypeCount; i++) { - printf("\tmemoryTypes[%u] :\n", i); - printf("\t\theapIndex = %u\n", props->memoryTypes[i].heapIndex); - printf("\t\tpropertyFlags = 0x%" PRIxLEAST32 ":\n", props->memoryTypes[i].propertyFlags); - - // Print each named flag, if it is set. - VkFlags flags = props->memoryTypes[i].propertyFlags; -#define PRINT_FLAG(FLAG) \ - if (flags & FLAG) printf("\t\t\t" #FLAG "\n"); - PRINT_FLAG(VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) - PRINT_FLAG(VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) - PRINT_FLAG(VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) - PRINT_FLAG(VK_MEMORY_PROPERTY_HOST_CACHED_BIT) - PRINT_FLAG(VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) -#undef PRINT_FLAG - } - printf("\n"); - printf("\tmemoryHeapCount = %u\n", props->memoryHeapCount); - for (uint32_t i = 0; i < props->memoryHeapCount; i++) { - printf("\tmemoryHeaps[%u] :\n", i); - const VkDeviceSize memSize = props->memoryHeaps[i].size; + if (html_output) { + fprintf(out, "\t\t\t\t\t
VkPhysicalDeviceMemoryProperties\n"); + fprintf(out, "\t\t\t\t\t\t
memoryHeapCount =
%u
", props.memoryHeapCount); + if (props.memoryHeapCount > 0) { + fprintf(out, "\n"); + } + } else if (human_readable_output) { + printf("VkPhysicalDeviceMemoryProperties:\n"); + printf("=================================\n"); + printf("\tmemoryHeapCount = %u\n", props.memoryHeapCount); + } + if (json_output) { + printf(",\n"); + printf("\t\"VkPhysicalDeviceMemoryProperties\": {\n"); + printf("\t\t\"memoryHeaps\": ["); + } + for (uint32_t i = 0; i < props.memoryHeapCount; ++i) { + const VkDeviceSize memSize = props.memoryHeaps[i].size; char *mem_size_human_readable = HumanReadable((const size_t)memSize); - printf("\t\tsize = " PRINTF_SIZE_T_SPECIFIER " (0x%" PRIxLEAST64 ") (%s)\n", (size_t)memSize, memSize, - mem_size_human_readable); + + if (html_output) { + fprintf(out, "\t\t\t\t\t\t\t
memoryHeaps[
%u
]
\n", i); + fprintf(out, "\t\t\t\t\t\t\t\t
size =
" PRINTF_SIZE_T_SPECIFIER "
(
0x%" PRIxLEAST64 "
) (
%s
)
\n", + (size_t)memSize, memSize, mem_size_human_readable); + } else if (human_readable_output) { + printf("\tmemoryHeaps[%u] :\n", i); + printf("\t\tsize = " PRINTF_SIZE_T_SPECIFIER " (0x%" PRIxLEAST64 ") (%s)\n", (size_t)memSize, memSize, + mem_size_human_readable); + } free(mem_size_human_readable); - VkMemoryHeapFlags heap_flags = props->memoryHeaps[i].flags; - printf("\t\tflags:\n\t\t\t"); - printf((heap_flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) ? "VK_MEMORY_HEAP_DEVICE_LOCAL_BIT\n" : "None\n"); + const VkMemoryHeapFlags heap_flags = props.memoryHeaps[i].flags; + if (html_output) { + fprintf(out, "\t\t\t\t\t\t\t\t
flags\n"); + fprintf(out, "\t\t\t\t\t\t\t\t\t
"); + fprintf(out, (heap_flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) ? "
VK_MEMORY_HEAP_DEVICE_LOCAL_BIT
" : "None"); + fprintf(out, "
\n"); + fprintf(out, "\t\t\t\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\t\tflags:\n\t\t\t"); + printf((heap_flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) ? "VK_MEMORY_HEAP_DEVICE_LOCAL_BIT\n" : "None\n"); + } + if (json_output) { + if (i > 0) { + printf(","); + } + printf("\n"); + printf("\t\t\t{\n"); + printf("\t\t\t\t\"flags\": %u,\n", heap_flags); + printf("\t\t\t\t\"size\": " PRINTF_SIZE_T_SPECIFIER "\n", (size_t)memSize); + printf("\t\t\t}"); + } + } + if (html_output) { + if (props.memoryHeapCount > 0) { + fprintf(out, "\t\t\t\t\t\t"); + } + fprintf(out, "
\n"); + } + if (json_output) { + if (props.memoryHeapCount > 0) { + printf("\n\t\t"); + } + printf("]"); + } + + if (html_output) { + fprintf(out, "\t\t\t\t\t\t
memoryTypeCount =
%u
", props.memoryTypeCount); + if (props.memoryTypeCount > 0) { + fprintf(out, "\n"); + } + } else if (human_readable_output) { + printf("\tmemoryTypeCount = %u\n", props.memoryTypeCount); } + if (json_output) { + printf(",\n"); + printf("\t\t\"memoryTypes\": ["); + } + for (uint32_t i = 0; i < props.memoryTypeCount; ++i) { + if (html_output) { + fprintf(out, "\t\t\t\t\t\t\t
memoryTypes[
%u
]
\n", i); + fprintf(out, "\t\t\t\t\t\t\t\t
heapIndex =
%u
\n", props.memoryTypes[i].heapIndex); + fprintf(out, "\t\t\t\t\t\t\t\t
propertyFlags =
0x%" PRIxLEAST32 "
", props.memoryTypes[i].propertyFlags); + if (props.memoryTypes[i].propertyFlags == 0) { + fprintf(out, "
\n"); + } else { + fprintf(out, "\n"); + } + } else if (human_readable_output) { + printf("\tmemoryTypes[%u] :\n", i); + printf("\t\theapIndex = %u\n", props.memoryTypes[i].heapIndex); + printf("\t\tpropertyFlags = 0x%" PRIxLEAST32 ":\n", props.memoryTypes[i].propertyFlags); + } + if (json_output) { + if (i > 0) { + printf(","); + } + printf("\n"); + printf("\t\t\t{\n"); + printf("\t\t\t\t\"heapIndex\": %u,\n", props.memoryTypes[i].heapIndex); + printf("\t\t\t\t\"propertyFlags\": %u\n", props.memoryTypes[i].propertyFlags); + printf("\t\t\t}"); + } + + // Print each named flag to html or std output if it is set + const VkFlags flags = props.memoryTypes[i].propertyFlags; + if (html_output) { + if (flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) fprintf(out, "\t\t\t\t\t\t\t\t\t
VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT
\n"); + if (flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) fprintf(out, "\t\t\t\t\t\t\t\t\t
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT
\n"); + if (flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) fprintf(out, "\t\t\t\t\t\t\t\t\t
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT
\n"); + if (flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) fprintf(out, "\t\t\t\t\t\t\t\t\t
VK_MEMORY_PROPERTY_HOST_CACHED_BIT
\n"); + if (flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) fprintf(out, "\t\t\t\t\t\t\t\t\t
VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT
\n"); + if (props.memoryTypes[i].propertyFlags > 0) fprintf(out, "\t\t\t\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t\t\t
\n"); + } else if (human_readable_output) { + if (flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) printf("\t\t\tVK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT\n"); + if (flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) printf("\t\t\tVK_MEMORY_PROPERTY_HOST_VISIBLE_BIT\n"); + if (flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) printf("\t\t\tVK_MEMORY_PROPERTY_HOST_COHERENT_BIT\n"); + if (flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) printf("\t\t\tVK_MEMORY_PROPERTY_HOST_CACHED_BIT\n"); + if (flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) printf("\t\t\tVK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT\n"); + } + } + if (html_output) { + if (props.memoryTypeCount > 0) { + fprintf(out, "\t\t\t\t\t\t"); + } + fprintf(out, "
\n"); + fprintf(out, "\t\t\t\t\t\n"); + } + if (json_output) { + if (props.memoryTypeCount > 0) { + printf("\n\t\t"); + } + printf("]\n"); + printf("\t}"); + } + + fflush(out); fflush(stdout); } +// clang-format on -static void AppGpuDump(const struct AppGpu *gpu) { - uint32_t i; +static void AppGpuDump(const struct AppGpu *gpu, FILE *out) { + if (html_output) { + fprintf(out, "\t\t\t
Device Properties and Extensions\n"); + fprintf(out, "\t\t\t\t
GPU%u\n", gpu->id); + } else if (human_readable_output) { + printf("\nDevice Properties and Extensions :\n"); + printf("==================================\n"); + printf("GPU%u\n", gpu->id); + } + + AppGpuDumpProps(gpu, out); + if (html_output) { + AppDumpExtensions("\t\t", "Device", gpu->device_extension_count, gpu->device_extensions, out); + } else if (human_readable_output) { + printf("\n"); + AppDumpExtensions("", "Device", gpu->device_extension_count, gpu->device_extensions, out); + printf("\n"); + } + + if (json_output) { + printf(",\n"); + printf("\t\"ArrayOfVkQueueFamilyProperties\": ["); + } + for (uint32_t i = 0; i < gpu->queue_count; ++i) { + if (json_output) { + if (i > 0) { + printf(","); + } + printf("\n"); + } + AppGpuDumpQueueProps(gpu, i, out); + if (human_readable_output) { + printf("\n"); + } + } + if (json_output) { + if (gpu->queue_count > 0) { + printf("\n\t"); + } + printf("]"); + } + + AppGpuDumpMemoryProps(gpu, out); + if (human_readable_output) { + printf("\n"); + } - printf("\nDevice Properties and Extensions :\n"); - printf("==================================\n"); - printf("GPU%u\n", gpu->id); - AppGpuDumpProps(gpu); - printf("\n"); - AppDumpExtensions("", "Device", gpu->device_extension_count, gpu->device_extensions); - printf("\n"); - for (i = 0; i < gpu->queue_count; i++) { - AppGpuDumpQueueProps(gpu, i); + AppGpuDumpFeatures(gpu, out); + if (human_readable_output) { printf("\n"); } - AppGpuDumpMemoryProps(gpu); - printf("\n"); - AppGpuDumpFeatures(gpu); - printf("\n"); - AppDevDump(&gpu->dev); + + AppDevDump(gpu, out); + if (html_output) { + fprintf(out, "\t\t\t\t
\n"); + fprintf(out, "\t\t\t
\n"); + } +} + +static void AppGroupDump(const VkPhysicalDeviceGroupProperties *group, const uint32_t id, const struct AppInstance *inst, + FILE *out) { + if (html_output) { + fprintf(out, "\t\t\t\t
Device Group Properties (Group %u)\n", id); + fprintf(out, "\t\t\t\t\t
physicalDeviceCount =
%u
\n", + group->physicalDeviceCount); + } else if (human_readable_output) { + printf("\tDevice Group Properties (Group %u) :\n", id); + printf("\t\tphysicalDeviceCount = %u\n", group->physicalDeviceCount); + } + + // Keep a record of all physical device properties to give the user clearer information as output. + VkPhysicalDeviceProperties *props = malloc(sizeof(props[0]) * group->physicalDeviceCount); + if (!props) { + ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); + } + for (uint32_t i = 0; i < group->physicalDeviceCount; ++i) { + vkGetPhysicalDeviceProperties(group->physicalDevices[i], &props[i]); + } + + // Output information to the user. + for (uint32_t i = 0; i < group->physicalDeviceCount; ++i) { + if (html_output) { + fprintf(out, "\t\t\t\t\t\t
%s (ID:
%d
)
\n", + props[i].deviceName, i); + } else if (human_readable_output) { + printf("\n\t\t\t%s (ID: %d)\n", props[i].deviceName, i); + } + } + + if (html_output) { + fprintf(out, "\t\t\t\t\t
\n"); + } + + if (html_output) { + fprintf(out, "\t\t\t\t\t
subsetAllocation =
%u
\n", + group->subsetAllocation); + } else if (human_readable_output) { + printf("\n\t\tsubsetAllocation = %u\n", group->subsetAllocation); + } + + if (html_output) { + fprintf(out, "\t\t\t\t
\n"); + } + + // Build create info for logical device made from all physical devices in this group. + const char *extensions_list[] = {VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_SWAPCHAIN_EXTENSION_NAME, + VK_KHR_DEVICE_GROUP_EXTENSION_NAME}; + + VkDeviceGroupDeviceCreateInfoKHR dg_ci = {.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHR, + .pNext = NULL, + .physicalDeviceCount = group->physicalDeviceCount, + .pPhysicalDevices = group->physicalDevices}; + + VkDeviceQueueCreateInfo q_ci = { + .sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, .pNext = NULL, .queueFamilyIndex = 0, .queueCount = 1}; + + VkDeviceCreateInfo device_ci = {.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, + .pNext = &dg_ci, + .queueCreateInfoCount = 1, + .pQueueCreateInfos = &q_ci, + .enabledExtensionCount = ARRAY_SIZE(extensions_list), + .ppEnabledExtensionNames = extensions_list}; + + VkDevice logical_device = VK_NULL_HANDLE; + + VkResult err = vkCreateDevice(group->physicalDevices[0], &device_ci, NULL, &logical_device); + + if (!err) { + if (html_output) { + fprintf(out, "\t\t\t\t
Device Group Present Capabilities (Group %d)\n", id); + } else if (human_readable_output) { + printf("\n\tDevice Group Present Capabilities (Group %d) :\n", id); + } + + VkDeviceGroupPresentCapabilitiesKHR group_capabilities = {.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR, + .pNext = NULL}; + + // If the KHR_device_group extension is present, write the capabilities of the logical device into a struct for later output + // to user. + PFN_vkGetDeviceGroupPresentCapabilitiesKHR vkGetDeviceGroupPresentCapabilitiesKHR = + (PFN_vkGetDeviceGroupPresentCapabilitiesKHR)vkGetInstanceProcAddr(inst->instance, + "vkGetDeviceGroupPresentCapabilitiesKHR"); + vkGetDeviceGroupPresentCapabilitiesKHR(logical_device, &group_capabilities); + + for (uint32_t i = 0; i < group->physicalDeviceCount; i++) { + if (html_output) { + fprintf(out, "\t\t\t\t\t
%s (ID:
%d
)
\n", + props[i].deviceName, i); + fprintf(out, "\t\t\t\t\t
Can present images from the following devices:\n"); + if (group_capabilities.presentMask[i] != 0) { + for (uint32_t j = 0; j < group->physicalDeviceCount; ++j) { + uint32_t mask = 1 << j; + if (group_capabilities.presentMask[i] & mask) { + fprintf(out, "\t\t\t\t\t\t
%s (ID:
%d
)
\n", + props[j].deviceName, j); + } + } + } else { + fprintf(out, "\t\t\t\t\t\t
None
\n"); + } + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\n\t\t%s (ID: %d)\n", props[i].deviceName, i); + printf("\t\tCan present images from the following devices:\n"); + if (group_capabilities.presentMask[i] != 0) { + for (uint32_t j = 0; j < group->physicalDeviceCount; ++j) { + uint32_t mask = 1 << j; + if (group_capabilities.presentMask[i] & mask) { + printf("\t\t\t%s (ID: %d)\n", props[j].deviceName, j); + } + } + } else { + printf("\t\t\tNone\n"); + } + printf("\n"); + } + } + + if (html_output) { + fprintf(out, "\t\t\t\t\t
Present modes\n"); + if (group_capabilities.modes & VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR) + fprintf(out, "\t\t\t\t\t\t
VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR
\n"); + if (group_capabilities.modes & VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR) + fprintf(out, "\t\t\t\t\t\t
VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR
\n"); + if (group_capabilities.modes & VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR) + fprintf(out, "\t\t\t\t\t\t
VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR
\n"); + if (group_capabilities.modes & VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR) + fprintf( + out, + "\t\t\t\t\t\t
VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR
\n"); + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\t\tPresent modes:\n"); + if (group_capabilities.modes & VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR) + printf("\t\t\tVK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR\n"); + if (group_capabilities.modes & VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR) + printf("\t\t\tVK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR\n"); + if (group_capabilities.modes & VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR) + printf("\t\t\tVK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR\n"); + if (group_capabilities.modes & VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR) + printf("\t\t\tVK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR\n"); + } + + if (html_output) { + fprintf(out, "\t\t\t\t
\n"); + } + } + + // Clean up after ourselves. + free(props); + vkDestroyDevice(logical_device, NULL); } #ifdef _WIN32 // Enlarges the console window to have a large scrollback size. static void ConsoleEnlarge() { - HANDLE console_handle = GetStdHandle(STD_OUTPUT_HANDLE); + const HANDLE console_handle = GetStdHandle(STD_OUTPUT_HANDLE); // make the console window bigger CONSOLE_SCREEN_BUFFER_INFO csbi; @@ -1640,50 +3085,113 @@ #endif int main(int argc, char **argv) { - uint32_t vulkan_major, vulkan_minor, vulkan_patch; - struct AppGpu *gpus; - VkPhysicalDevice *objs; uint32_t gpu_count; VkResult err; struct AppInstance inst; + FILE *out = stdout; #ifdef _WIN32 if (ConsoleIsExclusive()) ConsoleEnlarge(); #endif + PFN_vkEnumerateInstanceVersion enumerate_instance_version = + (PFN_vkEnumerateInstanceVersion)vkGetInstanceProcAddr(NULL, "vkEnumerateInstanceVersion"); - vulkan_major = VK_VERSION_MAJOR(VK_API_VERSION_1_0); - vulkan_minor = VK_VERSION_MINOR(VK_API_VERSION_1_0); - vulkan_patch = VK_VERSION_PATCH(VK_HEADER_VERSION); - - printf("===========\n"); - printf("VULKAN INFO\n"); - printf("===========\n\n"); - printf("Vulkan API Version: %d.%d.%d\n\n", vulkan_major, vulkan_minor, vulkan_patch); + uint32_t instance_version = VK_API_VERSION_1_0; - AppCreateInstance(&inst); + if (enumerate_instance_version != NULL) { + enumerate_instance_version(&instance_version); + } + + const uint32_t vulkan_major = VK_VERSION_MAJOR(instance_version); + const uint32_t vulkan_minor = VK_VERSION_MINOR(instance_version); + const uint32_t vulkan_patch = VK_VERSION_PATCH(VK_HEADER_VERSION); + + for (int i = 1; i < argc; i++) { + if (strcmp(argv[i], "--html") == 0) { + out = fopen("vulkaninfo.html", "w"); + human_readable_output = false; + html_output = true; + continue; + } + CheckForJsonOption(argv[i]); + } - printf("\nInstance Extensions:\n"); - printf("====================\n"); - AppDumpExtensions("", "Instance", inst.global_extension_count, inst.global_extensions); + if (html_output) { + PrintHtmlHeader(out); + fprintf(out, "\t\t\t
"); + } else if (human_readable_output) { + printf("===========\n"); + printf("VULKAN INFO\n"); + printf("===========\n\n"); + } + if (html_output || human_readable_output) { + fprintf(out, "Vulkan Instance Version: "); + } + if (html_output) { + fprintf(out, "
%d.%d.%d
\n", vulkan_major, vulkan_minor, vulkan_patch); + fprintf(out, "\t\t\t
\n"); + } else if (human_readable_output) { + printf("%d.%d.%d\n\n", vulkan_major, vulkan_minor, vulkan_patch); + } + + AppCreateInstance(&inst); err = vkEnumeratePhysicalDevices(inst.instance, &gpu_count, NULL); - if (err) ERR_EXIT(err); - objs = malloc(sizeof(objs[0]) * gpu_count); - if (!objs) ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); + if (err) { + ERR_EXIT(err); + } + + VkPhysicalDevice *objs = malloc(sizeof(objs[0]) * gpu_count); + if (!objs) { + ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); + } + err = vkEnumeratePhysicalDevices(inst.instance, &gpu_count, objs); - if (err) ERR_EXIT(err); + if (err) { + ERR_EXIT(err); + } + + struct AppGpu *gpus = malloc(sizeof(gpus[0]) * gpu_count); + if (!gpus) { + ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); + } - gpus = malloc(sizeof(gpus[0]) * gpu_count); - if (!gpus) ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); - for (uint32_t i = 0; i < gpu_count; i++) { + for (uint32_t i = 0; i < gpu_count; ++i) { AppGpuInit(&gpus[i], &inst, i, objs[i]); - printf("\n\n"); + if (human_readable_output) { + printf("\n\n"); + } + } + + // If json output, confirm the desired gpu exists + if (json_output) { + if (selected_gpu >= gpu_count) { + selected_gpu = 0; + } + PrintJsonHeader(vulkan_major, vulkan_minor, vulkan_patch); } + if (human_readable_output) { + printf("Instance Extensions:\n"); + printf("====================\n"); + } + AppDumpExtensions("", "Instance", inst.global_extension_count, inst.global_extensions, out); + //---Layer-Device-Extensions--- - printf("Layers: count = %d\n", inst.global_layer_count); - printf("=======\n"); - for (uint32_t i = 0; i < inst.global_layer_count; i++) { + if (html_output) { + fprintf(out, "\t\t\t
Layers: count =
%d
", inst.global_layer_count); + if (inst.global_layer_count > 0) { + fprintf(out, "\n"); + } + } else if (human_readable_output) { + printf("Layers: count = %d\n", inst.global_layer_count); + printf("=======\n"); + } + if (json_output && (inst.global_layer_count > 0)) { + printf(",\n"); + printf("\t\"ArrayOfVkLayerProperties\": ["); + } + for (uint32_t i = 0; i < inst.global_layer_count; ++i) { uint32_t layer_major, layer_minor, layer_patch; char spec_version[64], layer_version[64]; VkLayerProperties const *layer_prop = &inst.global_layers[i].layer_properties; @@ -1691,104 +3199,267 @@ ExtractVersion(layer_prop->specVersion, &layer_major, &layer_minor, &layer_patch); snprintf(spec_version, sizeof(spec_version), "%d.%d.%d", layer_major, layer_minor, layer_patch); snprintf(layer_version, sizeof(layer_version), "%d", layer_prop->implementationVersion); - printf("%s (%s) Vulkan version %s, layer version %s\n", layer_prop->layerName, (char *)layer_prop->description, - spec_version, layer_version); - AppDumpExtensions("\t", "Layer", inst.global_layers[i].extension_count, inst.global_layers[i].extension_properties); + if (html_output) { + fprintf(out, "\t\t\t\t
"); + fprintf(out, "
%s
(%s) Vulkan version
%s
, ", layer_prop->layerName, + (char *)layer_prop->description, spec_version); + fprintf(out, "layer version
%s
\n", layer_version); + AppDumpExtensions("\t\t", "Layer", inst.global_layers[i].extension_count, inst.global_layers[i].extension_properties, + out); + } else if (human_readable_output) { + printf("%s (%s) Vulkan version %s, layer version %s\n", layer_prop->layerName, (char *)layer_prop->description, + spec_version, layer_version); + AppDumpExtensions("\t", "Layer", inst.global_layers[i].extension_count, inst.global_layers[i].extension_properties, + out); + } + if (json_output) { + if (i > 0) { + printf(","); + } + printf("\n"); + printf("\t\t{\n"); + printf("\t\t\t\"layerName\": \"%s\",\n", layer_prop->layerName); + printf("\t\t\t\"specVersion\": %u,\n", layer_prop->specVersion); + printf("\t\t\t\"implementationVersion\": %u,\n", layer_prop->implementationVersion); + printf("\t\t\t\"description\": \"%s\"\n", layer_prop->description); + printf("\t\t}"); + } + + if (html_output) { + fprintf(out, "\t\t\t\t\t
Devices count =
%d
\n", gpu_count); + } else if (human_readable_output) { + printf("\tDevices \tcount = %d\n", gpu_count); + } char *layer_name = inst.global_layers[i].layer_properties.layerName; - printf("\tDevices \tcount = %d\n", gpu_count); - for (uint32_t j = 0; j < gpu_count; j++) { - printf("\t\tGPU id : %u (%s)\n", j, gpus[j].props.deviceName); + + for (uint32_t j = 0; j < gpu_count; ++j) { + if (html_output) { + fprintf(out, "\t\t\t\t\t\t
"); + fprintf(out, "GPU id:
%u
(%s)
\n", j, gpus[j].props.deviceName); + } else if (human_readable_output) { + printf("\t\tGPU id : %u (%s)\n", j, gpus[j].props.deviceName); + } uint32_t count = 0; VkExtensionProperties *props; AppGetPhysicalDeviceLayerExtensions(&gpus[j], layer_name, &count, &props); - AppDumpExtensions("\t\t", "Layer-Device", count, props); + if (html_output) { + AppDumpExtensions("\t\t\t", "Layer-Device", count, props, out); + fprintf(out, "\t\t\t\t\t
\n"); + } else if (human_readable_output) { + AppDumpExtensions("\t\t", "Layer-Device", count, props, out); + } free(props); } - printf("\n"); + + if (html_output) { + fprintf(out, "\t\t\t\t
\n"); + } else if (human_readable_output) { + printf("\n"); + } + } + + if (html_output) { + fprintf(out, "\t\t\t
\n"); } + if (json_output && (inst.global_layer_count > 0)) { + printf("\n\t]"); + } + + fflush(out); fflush(stdout); //----------------------------- - printf("Presentable Surfaces:\n"); - printf("=====================\n"); + if (html_output) { + fprintf(out, "\t\t\t
Presentable Surfaces"); + if (gpu_count > 0) { + fprintf(out, "\n"); + } else { + fprintf(out, "
\n"); + } + } else if (human_readable_output) { + printf("Presentable Surfaces:\n"); + printf("=====================\n"); + } inst.width = 256; inst.height = 256; int format_count = 0; int present_mode_count = 0; #if defined(VK_USE_PLATFORM_XCB_KHR) || defined(VK_USE_PLATFORM_XLIB_KHR) - if (getenv("DISPLAY") == NULL) { - printf("'DISPLAY' environment variable not set... Exiting!\n"); - fflush(stdout); - exit(1); + bool has_display = true; + const char *display_var = getenv("DISPLAY"); + if (display_var == NULL || strlen(display_var) == 0) { + fprintf(stderr, "'DISPLAY' environment variable not set... skipping surface info\n"); + fflush(stderr); + has_display = false; } #endif + //--WIN32-- #ifdef VK_USE_PLATFORM_WIN32_KHR if (CheckExtensionEnabled(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, inst.inst_extensions, inst.inst_extensions_count)) { AppCreateWin32Window(&inst); - for (uint32_t i = 0; i < gpu_count; i++) { + for (uint32_t i = 0; i < gpu_count; ++i) { AppCreateWin32Surface(&inst); - printf("GPU id : %u (%s)\n", i, gpus[i].props.deviceName); - printf("Surface type : %s\n", VK_KHR_WIN32_SURFACE_EXTENSION_NAME); - format_count += AppDumpSurfaceFormats(&inst, &gpus[i]); - present_mode_count += AppDumpSurfacePresentModes(&inst, &gpus[i]); - AppDumpSurfaceCapabilities(&inst, &gpus[i]); + if (html_output) { + fprintf(out, "\t\t\t\t
GPU id :
%u
(%s)
\n", i, + gpus[i].props.deviceName); + fprintf(out, "\t\t\t\t
Surface type :
%s
\n", + VK_KHR_WIN32_SURFACE_EXTENSION_NAME); + } else if (human_readable_output) { + printf("GPU id : %u (%s)\n", i, gpus[i].props.deviceName); + printf("Surface type : %s\n", VK_KHR_WIN32_SURFACE_EXTENSION_NAME); + } + format_count += AppDumpSurfaceFormats(&inst, &gpus[i], out); + present_mode_count += AppDumpSurfacePresentModes(&inst, &gpus[i], out); + AppDumpSurfaceCapabilities(&inst, &gpus[i], out); AppDestroySurface(&inst); } AppDestroyWin32Window(&inst); } //--XCB-- #elif VK_USE_PLATFORM_XCB_KHR - if (CheckExtensionEnabled(VK_KHR_XCB_SURFACE_EXTENSION_NAME, inst.inst_extensions, inst.inst_extensions_count)) { + if (has_display && CheckExtensionEnabled(VK_KHR_XCB_SURFACE_EXTENSION_NAME, inst.inst_extensions, inst.inst_extensions_count)) { AppCreateXcbWindow(&inst); - for (uint32_t i = 0; i < gpu_count; i++) { + for (uint32_t i = 0; i < gpu_count; ++i) { AppCreateXcbSurface(&inst); - printf("GPU id : %u (%s)\n", i, gpus[i].props.deviceName); - printf("Surface type : %s\n", VK_KHR_XCB_SURFACE_EXTENSION_NAME); - format_count += AppDumpSurfaceFormats(&inst, &gpus[i]); - present_mode_count += AppDumpSurfacePresentModes(&inst, &gpus[i]); - AppDumpSurfaceCapabilities(&inst, &gpus[i]); + if (html_output) { + fprintf(out, "\t\t\t\t
GPU id :
%u
(%s)
\n", i, + gpus[i].props.deviceName); + fprintf(out, "\t\t\t\t
Surface type :
%s
\n", + VK_KHR_XCB_SURFACE_EXTENSION_NAME); + } else if (human_readable_output) { + printf("GPU id : %u (%s)\n", i, gpus[i].props.deviceName); + printf("Surface type : %s\n", VK_KHR_XCB_SURFACE_EXTENSION_NAME); + } + format_count += AppDumpSurfaceFormats(&inst, &gpus[i], out); + present_mode_count += AppDumpSurfacePresentModes(&inst, &gpus[i], out); + AppDumpSurfaceCapabilities(&inst, &gpus[i], out); AppDestroySurface(&inst); } AppDestroyXcbWindow(&inst); } //--XLIB-- #elif VK_USE_PLATFORM_XLIB_KHR - if (CheckExtensionEnabled(VK_KHR_XLIB_SURFACE_EXTENSION_NAME, inst.inst_extensions, inst.inst_extensions_count)) { + if (has_display && + CheckExtensionEnabled(VK_KHR_XLIB_SURFACE_EXTENSION_NAME, inst.inst_extensions, inst.inst_extensions_count)) { AppCreateXlibWindow(&inst); - for (uint32_t i = 0; i < gpu_count; i++) { + for (uint32_t i = 0; i < gpu_count; ++i) { AppCreateXlibSurface(&inst); - printf("GPU id : %u (%s)\n", i, gpus[i].props.deviceName); - printf("Surface type : %s\n", VK_KHR_XLIB_SURFACE_EXTENSION_NAME); - format_count += AppDumpSurfaceFormats(&inst, &gpus[i]); - present_mode_count += AppDumpSurfacePresentModes(&inst, &gpus[i]); - AppDumpSurfaceCapabilities(&inst, &gpus[i]); + if (html_output) { + fprintf(out, "\t\t\t\t
GPU id :
%u
(%s)
\n", i, + gpus[i].props.deviceName); + fprintf(out, "\t\t\t\t
Surface type :
%s
\n", + VK_KHR_XLIB_SURFACE_EXTENSION_NAME); + } else if (human_readable_output) { + printf("GPU id : %u (%s)\n", i, gpus[i].props.deviceName); + printf("Surface type : %s\n", VK_KHR_XLIB_SURFACE_EXTENSION_NAME); + } + format_count += AppDumpSurfaceFormats(&inst, &gpus[i], out); + present_mode_count += AppDumpSurfacePresentModes(&inst, &gpus[i], out); + AppDumpSurfaceCapabilities(&inst, &gpus[i], out); AppDestroySurface(&inst); } AppDestroyXlibWindow(&inst); } #endif + // TODO: Android / Wayland / MIR - if (!format_count && !present_mode_count) printf("None found\n"); + if (!format_count && !present_mode_count) { + if (html_output) { + fprintf(out, "\t\t\t\t
None found
\n"); + } else if (human_readable_output) { + printf("None found\n"); + } + } + + if (html_output) { + fprintf(out, "\t\t\t\n"); + } else if (human_readable_output) { + printf("\n"); + } //--------- - for (uint32_t i = 0; i < gpu_count; i++) { - AppGpuDump(&gpus[i]); - printf("\n\n"); + if (CheckExtensionEnabled(VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME, inst.inst_extensions, inst.inst_extensions_count)) { + PFN_vkEnumeratePhysicalDeviceGroupsKHR vkEnumeratePhysicalDeviceGroupsKHR = + (PFN_vkEnumeratePhysicalDeviceGroupsKHR)vkGetInstanceProcAddr(inst.instance, "vkEnumeratePhysicalDeviceGroupsKHR"); + + uint32_t group_count; + err = vkEnumeratePhysicalDeviceGroupsKHR(inst.instance, &group_count, NULL); + if (err) { + ERR_EXIT(err); + } + + VkPhysicalDeviceGroupProperties *groups = malloc(sizeof(groups[0]) * group_count); + if (!groups) { + ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); + } + + err = vkEnumeratePhysicalDeviceGroupsKHR(inst.instance, &group_count, groups); + if (err) { + ERR_EXIT(err); + } + + if (html_output) { + fprintf(out, "\t\t\t
Groups\n"); + } else if (human_readable_output) { + printf("\nGroups :\n"); + printf("========\n"); + } + + for (uint32_t i = 0; i < group_count; ++i) { + AppGroupDump(&groups[i], i, &inst, out); + if (human_readable_output) { + printf("\n\n"); + } + } + + if (html_output) { + fprintf(out, "\t\t\t
\n"); + } + + free(groups); } - for (uint32_t i = 0; i < gpu_count; i++) AppGpuDestroy(&gpus[i]); + for (uint32_t i = 0; i < gpu_count; ++i) { + if (json_output && selected_gpu != i) { + // Toggle json_output to allow html output without json output + json_output = false; + AppGpuDump(&gpus[i], out); + json_output = true; + } else { + AppGpuDump(&gpus[i], out); + } + if (human_readable_output) { + printf("\n\n"); + } + } + + for (uint32_t i = 0; i < gpu_count; ++i) { + AppGpuDestroy(&gpus[i]); + } free(gpus); free(objs); AppDestroyInstance(&inst); + if (html_output) { + PrintHtmlFooter(out); + fflush(out); + fclose(out); + } + if (json_output) { + printf("\n}\n"); + } + fflush(stdout); + #ifdef _WIN32 - if (ConsoleIsExclusive()) Sleep(INFINITE); + if (ConsoleIsExclusive() && human_readable_output) { + Sleep(INFINITE); + } #endif return 0; diff -Nru vulkan-1.0.65.2+dfsg1/demos/vulkaninfo.rc vulkan-1.1.73+dfsg/demos/vulkaninfo.rc --- vulkan-1.0.65.2+dfsg1/demos/vulkaninfo.rc 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/demos/vulkaninfo.rc 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,98 @@ +// +// Copyright (c) 2018 The Khronos Group Inc. +// Copyright (c) 2018 Valve Corporation +// Copyright (c) 2018 LunarG, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Author: Lenny Komow +// + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +// Start customize section +// Edit this section for your build +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// + +#define VERSION_MAJOR 1 +#define VERSION_MINOR 0 +#define VERSION_PATCH 1111 +#define VERSION_BUILDNO 2222 + +#define VERSION_BUILD_DESCRIPTION "Dev Build" + +// All builds except release builds should set this to 0. +// Release builds should set this to 1. +#define VERSION_IS_RELEASEBUILD 0 + + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +// End of customize section +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// + +#include "winres.h" + +#define VER_FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_BUILDNO + +#define STRINGIZE2(s) #s +#define STRINGIZE(s) STRINGIZE2(s) + +#if VERSION_IS_RELEASEBUILD==1 + #define VER_FILE_DESCRIPTION_STR "Vulkan Info" + #define VER_FILE_VERSION_STR STRINGIZE(VERSION_MAJOR) \ + "." STRINGIZE(VERSION_MINOR) \ + "." STRINGIZE(VERSION_PATCH) \ + "." STRINGIZE(VERSION_BUILDNO) +#else + #define VER_FILE_DESCRIPTION_STR "Vulkan Info - " VERSION_BUILD_DESCRIPTION + #define VER_FILE_VERSION_STR STRINGIZE(VERSION_MAJOR) \ + "." STRINGIZE(VERSION_MINOR) \ + "." STRINGIZE(VERSION_PATCH) \ + "." STRINGIZE(VERSION_BUILDNO) \ + "." VERSION_BUILD_DESCRIPTION +#endif + + +VS_VERSION_INFO VERSIONINFO + FILEVERSION VER_FILE_VERSION + PRODUCTVERSION VER_FILE_VERSION + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + + FILEOS 0x00000L + FILETYPE VFT_DLL + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "04090000" + BEGIN + VALUE "FileDescription", VER_FILE_DESCRIPTION_STR + VALUE "FileVersion", VER_FILE_VERSION_STR + VALUE "LegalCopyright", "Copyright (C) 2015-2018" + VALUE "ProductName", "Vulkan Runtime" + VALUE "ProductVersion", VER_FILE_VERSION_STR + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 0000 + END +END diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/.appveyor.yml vulkan-1.1.73+dfsg/external/glslang/.appveyor.yml --- vulkan-1.0.65.2+dfsg1/external/glslang/.appveyor.yml 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/.appveyor.yml 2018-04-27 11:46:26.000000000 +0000 @@ -7,7 +7,7 @@ os: Visual Studio 2013 platform: - - Any CPU + - x64 configuration: - Debug @@ -17,6 +17,13 @@ only: - master +# Travis advances the master-tot tag to current top of the tree after +# each push into the master branch, because it relies on that tag to +# upload build artifacts to the master-tot release. This will cause +# double testing for each push on Appveyor: one for the push, one for +# the tag advance. Disable testing tags. +skip_tags: true + clone_depth: 5 matrix: @@ -39,3 +46,45 @@ test_script: - ctest -C %CONFIGURATION% --output-on-failure - cd ../Test && bash runtests + - cd ../build + +after_test: + # For debug build, the generated dll has a postfix "d" in its name. + - ps: >- + If ($env:configuration -Match "Debug") { + $env:SUFFIX="d" + } Else { + $env:SUFFIX="" + } + - cd install + # Zip all glslang artifacts for uploading and deploying + - 7z a glslang-master-windows-"%PLATFORM%"-"%CONFIGURATION%".zip + bin\glslangValidator.exe + include\glslang\* + include\SPIRV\* + lib\glslang%SUFFIX%.lib + lib\HLSL%SUFFIX%.lib + lib\OGLCompiler%SUFFIX%.lib + lib\OSDependent%SUFFIX%.lib + lib\SPIRV%SUFFIX%.lib + lib\SPVRemapper%SUFFIX%.lib + lib\SPIRV-Tools%SUFFIX%.lib + lib\SPIRV-Tools-opt%SUFFIX%.lib + +artifacts: + - path: build\install\*.zip + name: artifacts-zip + +deploy: + - provider: GitHub + auth_token: + secure: YglcSYdl0TylEa59H4K6lylBEDr586NAt2EMgZquSo+iuPrwgZQuJLPCoihSm9y6 + release: master-tot + description: "Continuous build of the latest master branch by Appveyor and Travis CI" + artifact: artifacts-zip + draft: false + prerelease: false + force_update: true + on: + branch: master + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/CMakeLists.txt 2018-04-27 11:46:26.000000000 +0000 @@ -9,6 +9,14 @@ # Adhere to GNU filesystem layout conventions include(GNUInstallDirs) +option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF) + +set(LIB_TYPE STATIC) + +if(BUILD_SHARED_LIBS) + set(LIB_TYPE SHARED) +endif() + option(SKIP_GLSLANG_INSTALL "Skip installation" ${SKIP_GLSLANG_INSTALL}) if(NOT ${SKIP_GLSLANG_INSTALL}) set(ENABLE_GLSLANG_INSTALL ON) @@ -94,9 +102,12 @@ if(ENABLE_OPT) message(STATUS "optimizer enabled") - add_definitions(-DENABLE_OPT) -elseif(ENABLE_HLSL) - message(STATUS "spirv-tools not linked - illegal SPIRV may be generated for HLSL") + add_definitions(-DENABLE_OPT=1) +else() + if(ENABLE_HLSL) + message(STATUS "spirv-tools not linked - illegal SPIRV may be generated for HLSL") + endif() + add_definitions(-DENABLE_OPT=0) endif() add_subdirectory(glslang) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/Android.mk vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/Android.mk --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/Android.mk 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/Android.mk 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,315 @@ +LOCAL_PATH := $(call my-dir) +SPVTOOLS_OUT_PATH=$(if $(call host-path-is-absolute,$(TARGET_OUT)),$(TARGET_OUT),$(abspath $(TARGET_OUT))) +SPVHEADERS_LOCAL_PATH := $(LOCAL_PATH)/external/spirv-headers + +SPVTOOLS_SRC_FILES := \ + source/assembly_grammar.cpp \ + source/binary.cpp \ + source/diagnostic.cpp \ + source/disassemble.cpp \ + source/ext_inst.cpp \ + source/enum_string_mapping.cpp \ + source/extensions.cpp \ + source/id_descriptor.cpp \ + source/libspirv.cpp \ + source/name_mapper.cpp \ + source/opcode.cpp \ + source/operand.cpp \ + source/parsed_operand.cpp \ + source/print.cpp \ + source/software_version.cpp \ + source/spirv_endian.cpp \ + source/spirv_target_env.cpp \ + source/spirv_validator_options.cpp \ + source/table.cpp \ + source/text.cpp \ + source/text_handler.cpp \ + source/util/bit_stream.cpp \ + source/util/parse_number.cpp \ + source/util/string_utils.cpp \ + source/util/timer.cpp \ + source/val/basic_block.cpp \ + source/val/construct.cpp \ + source/val/function.cpp \ + source/val/instruction.cpp \ + source/val/validation_state.cpp \ + source/validate.cpp \ + source/validate_adjacency.cpp \ + source/validate_arithmetics.cpp \ + source/validate_atomics.cpp \ + source/validate_barriers.cpp \ + source/validate_bitwise.cpp \ + source/validate_builtins.cpp \ + source/validate_capability.cpp \ + source/validate_cfg.cpp \ + source/validate_composites.cpp \ + source/validate_conversion.cpp \ + source/validate_datarules.cpp \ + source/validate_decorations.cpp \ + source/validate_derivatives.cpp \ + source/validate_ext_inst.cpp \ + source/validate_id.cpp \ + source/validate_image.cpp \ + source/validate_instruction.cpp \ + source/validate_layout.cpp \ + source/validate_literals.cpp \ + source/validate_logicals.cpp \ + source/validate_primitives.cpp \ + source/validate_type_unique.cpp + +SPVTOOLS_OPT_SRC_FILES := \ + source/opt/aggressive_dead_code_elim_pass.cpp \ + source/opt/basic_block.cpp \ + source/opt/block_merge_pass.cpp \ + source/opt/build_module.cpp \ + source/opt/cfg.cpp \ + source/opt/cfg_cleanup_pass.cpp \ + source/opt/ccp_pass.cpp \ + source/opt/common_uniform_elim_pass.cpp \ + source/opt/compact_ids_pass.cpp \ + source/opt/composite.cpp \ + source/opt/const_folding_rules.cpp \ + source/opt/constants.cpp \ + source/opt/copy_prop_arrays.cpp \ + source/opt/dead_branch_elim_pass.cpp \ + source/opt/dead_insert_elim_pass.cpp \ + source/opt/dead_variable_elimination.cpp \ + source/opt/decoration_manager.cpp \ + source/opt/def_use_manager.cpp \ + source/opt/dominator_analysis.cpp \ + source/opt/dominator_tree.cpp \ + source/opt/eliminate_dead_constant_pass.cpp \ + source/opt/eliminate_dead_functions_pass.cpp \ + source/opt/feature_manager.cpp \ + source/opt/flatten_decoration_pass.cpp \ + source/opt/fold.cpp \ + source/opt/folding_rules.cpp \ + source/opt/fold_spec_constant_op_and_composite_pass.cpp \ + source/opt/freeze_spec_constant_value_pass.cpp \ + source/opt/function.cpp \ + source/opt/if_conversion.cpp \ + source/opt/inline_pass.cpp \ + source/opt/inline_exhaustive_pass.cpp \ + source/opt/inline_opaque_pass.cpp \ + source/opt/insert_extract_elim.cpp \ + source/opt/instruction.cpp \ + source/opt/instruction_list.cpp \ + source/opt/ir_context.cpp \ + source/opt/ir_loader.cpp \ + source/opt/licm_pass.cpp \ + source/opt/local_access_chain_convert_pass.cpp \ + source/opt/local_redundancy_elimination.cpp \ + source/opt/local_single_block_elim_pass.cpp \ + source/opt/local_single_store_elim_pass.cpp \ + source/opt/local_ssa_elim_pass.cpp \ + source/opt/loop_descriptor.cpp \ + source/opt/loop_peeling.cpp \ + source/opt/loop_unroller.cpp \ + source/opt/loop_unswitch_pass.cpp \ + source/opt/loop_utils.cpp \ + source/opt/mem_pass.cpp \ + source/opt/merge_return_pass.cpp \ + source/opt/module.cpp \ + source/opt/optimizer.cpp \ + source/opt/pass.cpp \ + source/opt/pass_manager.cpp \ + source/opt/private_to_local_pass.cpp \ + source/opt/propagator.cpp \ + source/opt/redundancy_elimination.cpp \ + source/opt/remove_duplicates_pass.cpp \ + source/opt/replace_invalid_opc.cpp \ + source/opt/scalar_analysis.cpp \ + source/opt/scalar_analysis_simplification.cpp \ + source/opt/scalar_replacement_pass.cpp \ + source/opt/set_spec_constant_default_value_pass.cpp \ + source/opt/simplification_pass.cpp \ + source/opt/ssa_rewrite_pass.cpp \ + source/opt/strength_reduction_pass.cpp \ + source/opt/strip_debug_info_pass.cpp \ + source/opt/strip_reflect_info_pass.cpp \ + source/opt/type_manager.cpp \ + source/opt/types.cpp \ + source/opt/unify_const_pass.cpp \ + source/opt/value_number_table.cpp \ + source/opt/workaround1209.cpp + +# Locations of grammar files. +# +# TODO(dneto): Build a single set of tables that embeds versioning differences on +# a per-item basis. That must happen before SPIR-V 1.4, etc. +# https://github.com/KhronosGroup/SPIRV-Tools/issues/1195 +SPV_CORE10_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.0/spirv.core.grammar.json +SPV_CORE11_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.1/spirv.core.grammar.json +SPV_CORE12_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.2/spirv.core.grammar.json +SPV_COREUNIFIED1_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/unified1/spirv.core.grammar.json +SPV_CORELATEST_GRAMMAR=$(SPV_COREUNIFIED1_GRAMMAR) +SPV_GLSL_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.2/extinst.glsl.std.450.grammar.json +SPV_OPENCL_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.2/extinst.opencl.std.100.grammar.json +# TODO(dneto): I expect the DebugInfo grammar file to eventually migrate to SPIRV-Headers +SPV_DEBUGINFO_GRAMMAR=$(LOCAL_PATH)/source/extinst.debuginfo.grammar.json + +define gen_spvtools_grammar_tables +$(call generate-file-dir,$(1)/core.insts-1.0.inc) +$(1)/core.insts-1.0.inc $(1)/operand.kinds-1.0.inc $(1)/glsl.std.450.insts.inc $(1)/opencl.std.insts.inc: \ + $(LOCAL_PATH)/utils/generate_grammar_tables.py \ + $(SPV_CORE10_GRAMMAR) \ + $(SPV_GLSL_GRAMMAR) \ + $(SPV_OPENCL_GRAMMAR) \ + $(SPV_DEBUGINFO_GRAMMAR) + @$(HOST_PYTHON) $(LOCAL_PATH)/utils/generate_grammar_tables.py \ + --spirv-core-grammar=$(SPV_CORE10_GRAMMAR) \ + --extinst-glsl-grammar=$(SPV_GLSL_GRAMMAR) \ + --extinst-opencl-grammar=$(SPV_OPENCL_GRAMMAR) \ + --extinst-debuginfo-grammar=$(SPV_DEBUGINFO_GRAMMAR) \ + --core-insts-output=$(1)/core.insts-1.0.inc \ + --glsl-insts-output=$(1)/glsl.std.450.insts.inc \ + --opencl-insts-output=$(1)/opencl.std.insts.inc \ + --operand-kinds-output=$(1)/operand.kinds-1.0.inc + @echo "[$(TARGET_ARCH_ABI)] Grammar v1.0 : instructions & operands <= grammar JSON files" +$(1)/core.insts-1.1.inc $(1)/operand.kinds-1.1.inc: \ + $(LOCAL_PATH)/utils/generate_grammar_tables.py \ + $(SPV_CORE11_GRAMMAR) \ + $(SPV_DEBUGINFO_GRAMMAR) + @$(HOST_PYTHON) $(LOCAL_PATH)/utils/generate_grammar_tables.py \ + --spirv-core-grammar=$(SPV_CORE11_GRAMMAR) \ + --extinst-debuginfo-grammar=$(SPV_DEBUGINFO_GRAMMAR) \ + --core-insts-output=$(1)/core.insts-1.1.inc \ + --operand-kinds-output=$(1)/operand.kinds-1.1.inc + @echo "[$(TARGET_ARCH_ABI)] Grammar v1.1 : instructions & operands <= grammar JSON files" +$(1)/core.insts-1.2.inc $(1)/operand.kinds-1.2.inc: \ + $(LOCAL_PATH)/utils/generate_grammar_tables.py \ + $(SPV_CORE12_GRAMMAR) \ + $(SPV_DEBUGINFO_GRAMMAR) + @$(HOST_PYTHON) $(LOCAL_PATH)/utils/generate_grammar_tables.py \ + --spirv-core-grammar=$(SPV_CORE12_GRAMMAR) \ + --extinst-debuginfo-grammar=$(SPV_DEBUGINFO_GRAMMAR) \ + --core-insts-output=$(1)/core.insts-1.2.inc \ + --operand-kinds-output=$(1)/operand.kinds-1.2.inc + @echo "[$(TARGET_ARCH_ABI)] Grammar v1.2 : instructions & operands <= grammar JSON files" +$(1)/core.insts-unified1.inc $(1)/operand.kinds-unified1.inc: \ + $(LOCAL_PATH)/utils/generate_grammar_tables.py \ + $(SPV_COREUNIFIED1_GRAMMAR) \ + $(SPV_DEBUGINFO_GRAMMAR) + @$(HOST_PYTHON) $(LOCAL_PATH)/utils/generate_grammar_tables.py \ + --spirv-core-grammar=$(SPV_COREUNIFIED1_GRAMMAR) \ + --extinst-debuginfo-grammar=$(SPV_DEBUGINFO_GRAMMAR) \ + --core-insts-output=$(1)/core.insts-unified1.inc \ + --operand-kinds-output=$(1)/operand.kinds-unified1.inc + @echo "[$(TARGET_ARCH_ABI)] Grammar v1.3 (from unified1) : instructions & operands <= grammar JSON files" +$(LOCAL_PATH)/source/opcode.cpp: $(1)/core.insts-1.0.inc $(1)/core.insts-1.1.inc $(1)/core.insts-1.2.inc $(1)/core.insts-unified1.inc +$(LOCAL_PATH)/source/operand.cpp: $(1)/operand.kinds-1.0.inc $(1)/operand.kinds-1.1.inc $(1)/operand.kinds-1.2.inc $(1)/operand.kinds-unified1.inc +$(LOCAL_PATH)/source/ext_inst.cpp: \ + $(1)/glsl.std.450.insts.inc \ + $(1)/opencl.std.insts.inc \ + $(1)/debuginfo.insts.inc \ + $(1)/spv-amd-gcn-shader.insts.inc \ + $(1)/spv-amd-shader-ballot.insts.inc \ + $(1)/spv-amd-shader-explicit-vertex-parameter.insts.inc \ + $(1)/spv-amd-shader-trinary-minmax.insts.inc +endef +$(eval $(call gen_spvtools_grammar_tables,$(SPVTOOLS_OUT_PATH))) + + +define gen_spvtools_lang_headers +# Generate language-specific headers. So far we only generate C headers +# $1 is the output directory. +# $2 is the base name of the header file, e.g. "DebugInfo". +# $3 is the grammar file containing token definitions. +$(call generate-file-dir,$(1)/$(2).h) +$(1)/$(2).h : \ + $(LOCAL_PATH)/utils/generate_language_headers.py \ + $(3) + @$(HOST_PYTHON) $(LOCAL_PATH)/utils/generate_language_headers.py \ + --extinst-name=$(2) \ + --extinst-grammar=$(3) \ + --extinst-output-base=$(1)/$(2) + @echo "[$(TARGET_ARCH_ABI)] Generate language specific header for $(2): headers <= grammar" +$(LOCAL_PATH)/source/ext_inst.cpp: $(1)/$(2).h +endef +# We generate language-specific headers for DebugInfo +$(eval $(call gen_spvtools_lang_headers,$(SPVTOOLS_OUT_PATH),DebugInfo,$(SPV_DEBUGINFO_GRAMMAR))) + + +define gen_spvtools_vendor_tables +$(call generate-file-dir,$(1)/$(2).insts.inc) +$(1)/$(2).insts.inc : \ + $(LOCAL_PATH)/utils/generate_grammar_tables.py \ + $(LOCAL_PATH)/source/extinst.$(2).grammar.json + @$(HOST_PYTHON) $(LOCAL_PATH)/utils/generate_grammar_tables.py \ + --extinst-vendor-grammar=$(LOCAL_PATH)/source/extinst.$(2).grammar.json \ + --vendor-insts-output=$(1)/$(2).insts.inc + @echo "[$(TARGET_ARCH_ABI)] Vendor extended instruction set: $(2) tables <= grammar" +$(LOCAL_PATH)/source/ext_inst.cpp: $(1)/$(2).insts.inc +endef +# Vendor extended instruction sets, with grammars from SPIRV-Tools source tree. +SPV_NONSTANDARD_EXTINST_GRAMMARS=$(foreach F,$(wildcard $(LOCAL_PATH)/source/extinst.*.grammar.json),$(patsubst extinst.%.grammar.json,%,$(notdir $F))) +$(foreach E,$(SPV_NONSTANDARD_EXTINST_GRAMMARS),$(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),$E))) + +define gen_spvtools_enum_string_mapping +$(call generate-file-dir,$(1)/extension_enum.inc.inc) +$(1)/extension_enum.inc $(1)/enum_string_mapping.inc: \ + $(LOCAL_PATH)/utils/generate_grammar_tables.py \ + $(SPV_CORELATEST_GRAMMAR) + @$(HOST_PYTHON) $(LOCAL_PATH)/utils/generate_grammar_tables.py \ + --spirv-core-grammar=$(SPV_CORELATEST_GRAMMAR) \ + --extinst-debuginfo-grammar=$(SPV_DEBUGINFO_GRAMMAR) \ + --extension-enum-output=$(1)/extension_enum.inc \ + --enum-string-mapping-output=$(1)/enum_string_mapping.inc + @echo "[$(TARGET_ARCH_ABI)] Generate enum<->string mapping <= grammar JSON files" +# Generated header extension_enum.inc is transitively included by table.h, which is +# used pervasively. Capture the pervasive dependency. +$(foreach F,$(SPVTOOLS_SRC_FILES) $(SPVTOOLS_OPT_SRC_FILES),$(LOCAL_PATH)/$F ) \ + : $(1)/extension_enum.inc +$(LOCAL_PATH)/source/enum_string_mapping.cpp: $(1)/enum_string_mapping.inc +endef +$(eval $(call gen_spvtools_enum_string_mapping,$(SPVTOOLS_OUT_PATH))) + +define gen_spvtools_build_version_inc +$(call generate-file-dir,$(1)/dummy_filename) +$(1)/build-version.inc: \ + $(LOCAL_PATH)/utils/update_build_version.py \ + $(LOCAL_PATH)/CHANGES + @$(HOST_PYTHON) $(LOCAL_PATH)/utils/update_build_version.py \ + $(LOCAL_PATH) $(1)/build-version.inc + @echo "[$(TARGET_ARCH_ABI)] Generate : build-version.inc <= CHANGES" +$(LOCAL_PATH)/source/software_version.cpp: $(1)/build-version.inc +endef +$(eval $(call gen_spvtools_build_version_inc,$(SPVTOOLS_OUT_PATH))) + +define gen_spvtools_generators_inc +$(call generate-file-dir,$(1)/dummy_filename) +$(1)/generators.inc: \ + $(LOCAL_PATH)/utils/generate_registry_tables.py \ + $(SPVHEADERS_LOCAL_PATH)/include/spirv/spir-v.xml + @$(HOST_PYTHON) $(LOCAL_PATH)/utils/generate_registry_tables.py \ + --xml=$(SPVHEADERS_LOCAL_PATH)/include/spirv/spir-v.xml \ + --generator-output=$(1)/generators.inc + @echo "[$(TARGET_ARCH_ABI)] Generate : generators.inc <= spir-v.xml" +$(LOCAL_PATH)/source/opcode.cpp: $(1)/generators.inc +endef +$(eval $(call gen_spvtools_generators_inc,$(SPVTOOLS_OUT_PATH))) + +include $(CLEAR_VARS) +LOCAL_MODULE := SPIRV-Tools +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/include \ + $(LOCAL_PATH)/source \ + $(LOCAL_PATH)/external/spirv-headers/include \ + $(SPVTOOLS_OUT_PATH) +LOCAL_EXPORT_C_INCLUDES := \ + $(LOCAL_PATH)/include +LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti -Werror +LOCAL_SRC_FILES:= $(SPVTOOLS_SRC_FILES) +include $(BUILD_STATIC_LIBRARY) + +include $(CLEAR_VARS) +LOCAL_MODULE := SPIRV-Tools-opt +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/include \ + $(LOCAL_PATH)/source \ + $(LOCAL_PATH)/external/spirv-headers/include \ + $(SPVTOOLS_OUT_PATH) +LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti -Werror +LOCAL_STATIC_LIBRARIES:=SPIRV-Tools +LOCAL_SRC_FILES:= $(SPVTOOLS_OPT_SRC_FILES) +include $(BUILD_STATIC_LIBRARY) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/android_test/Android.mk vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/android_test/Android.mk --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/android_test/Android.mk 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/android_test/Android.mk 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,12 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_CPP_EXTENSION := .cc .cpp .cxx +LOCAL_SRC_FILES:=test.cpp +LOCAL_MODULE:=spirvtools_test +LOCAL_LDLIBS:=-landroid +LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti -Werror +LOCAL_STATIC_LIBRARIES=SPIRV-Tools SPIRV-Tools-opt +include $(BUILD_SHARED_LIBRARY) + +include $(LOCAL_PATH)/../Android.mk diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/android_test/jni/Application.mk vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/android_test/jni/Application.mk --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/android_test/jni/Application.mk 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/android_test/jni/Application.mk 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,5 @@ +APP_ABI := all +APP_BUILD_SCRIPT := Android.mk +APP_STL := gnustl_static +APP_PLATFORM := android-9 +NDK_TOOLCHAIN_VERSION := 4.9 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/android_test/test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/android_test/test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/android_test/test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/android_test/test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,22 @@ +// Copyright (c) 2017 Google 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. + +#include +#include "spirv-tools/libspirv.hpp" +#include "spirv-tools/optimizer.hpp" + +void android_main(struct android_app* /*state*/) { + spvtools::SpirvTools tools(SPV_ENV_UNIVERSAL_1_2); + spvtools::Optimizer optimizer(SPV_ENV_UNIVERSAL_1_2); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/.appveyor.yml vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/.appveyor.yml --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/.appveyor.yml 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/.appveyor.yml 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,89 @@ +# Windows Build Configuration for AppVeyor +# http://www.appveyor.com/docs/appveyor-yml + +# version format +version: "{build}" + +# The most recent compiler gives the most interesting new results. +# Put it first so we get its feedback first. +os: + - Visual Studio 2017 + - Visual Studio 2013 + +platform: + - x64 + +configuration: + - Debug + - Release + +branches: + only: + - master + +# Travis advances the master-tot tag to current top of the tree after +# each push into the master branch, because it relies on that tag to +# upload build artifacts to the master-tot release. This will cause +# double testing for each push on Appveyor: one for the push, one for +# the tag advance. Disable testing tags. +skip_tags: true + +clone_depth: 1 + +matrix: + fast_finish: true # Show final status immediately if a test fails. + exclude: + - os: Visual Studio 2013 + configuration: Debug + +# scripts that run after cloning repository +install: + # Install ninja + - set NINJA_URL="https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip" + - appveyor DownloadFile %NINJA_URL% -FileName ninja.zip + - 7z x ninja.zip -oC:\ninja > nul + - set PATH=C:\ninja;%PATH% + +before_build: + - git clone --depth=1 https://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers + - git clone --depth=1 https://github.com/google/googletest.git external/googletest + - git clone --depth=1 https://github.com/google/effcee.git external/effcee + - git clone --depth=1 https://github.com/google/re2.git external/re2 + # Set path and environment variables for the current Visual Studio version + - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2013" (call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64) + - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" (call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64) + +build: + parallel: true # enable MSBuild parallel builds + verbosity: minimal + +build_script: + - mkdir build && cd build + - cmake -GNinja -DSPIRV_BUILD_COMPRESSION=ON -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_INSTALL_PREFIX=install -DRE2_BUILD_TESTING=OFF .. + - ninja install + +test_script: + - ctest -C %CONFIGURATION% --output-on-failure --timeout 300 + +after_test: + # Zip build artifacts for uploading and deploying + - cd install + - 7z a SPIRV-Tools-master-windows-"%PLATFORM%"-"%CONFIGURATION%".zip *\* + +artifacts: + - path: build\install\*.zip + name: artifacts-zip + +deploy: + - provider: GitHub + auth_token: + secure: TMfcScKzzFIm1YgeV/PwCRXFDCw8Xm0wY2Vb2FU6WKlbzb5eUITTpr6I5vHPnAxS + release: master-tot + description: "Continuous build of the latest master branch by Appveyor and Travis CI" + artifact: artifacts-zip + draft: false + prerelease: false + force_update: true + on: + branch: master + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/CHANGES vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/CHANGES --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/CHANGES 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/CHANGES 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,483 @@ +Revision history for SPIRV-Tools + +v2018.3-dev 2018-04-06 + - General: + - Support SPV_EXT_descriptor_indexing + - Support SPV_GOOGLE_decorate_string + - Support SPV_GOOGLE_hlsl_functionality1 + - Support SPV_NV_shader_subgroup_partitioned + - Use "unified1" grammar from SPIRV-Headers + - Simplify support for new extensions. Assembler, disassembler, and simple validation + support is automatic if new tokens are introduced with appropriate extension + attributes in the "unified1" SPIR-V core grammar. + - Disassembler: Emit more digits on floating point, to reliably reproduce all + significand bits. (Use std::max_digits10 instead of std::digits10) + - Optimizer: + - Add --strip-reflect + - Add --time-report + - Merge-return now works with structured control flow. + - New (faster) SSA rewriter to convert local loads and stores to SSA IDs and phis. + Can replace load/store elimination passes. + - Fix instruction folding case: insertion that feeds and extract, when the extract + remains. + - Copy propagate arrays, in simple cases. + - Better handling of OpImageTexelPointer + - Add loop peeling internal utility. + - Initial utilities for scalar evolution. + - Validator: + - Check Vulkan built-in variables + - Check Vulkan-specific atomic result type rule. + - Relax control barrier check for SPIR-V 1.3. Fixes #1427 + - Check OpPhi. + - Stop checking sizes derived from spec-constants. + - Re-enable checks for OpUConvert. + - Fixes: + #898: Linker properly removes FuncParamAttr from imported symbols. + #924, #1174: Fix handling of decoration groups in optimizer, linker. + #1404: Don't optimize away the compute compute workgroup size constant. + #1407: Remove a bad assertion + #1456: Fix bug in SSA rewriter related to variables updated in loops. + +v2018.2 2018-03-07 + - General: + - Support SPIR-V 1.3 and Vulkan 1.1. + - Default target environment is now SPIR-V 1.3. For command-line tools, + use the --target-env option to override the default. Examples: + # Generate a SPIR-V 1.0 binary instead of SPIR-V 1.3 + spirv-as --target-env spv1.0 a.spvasm -o a.spv + spirv-as --target-env vulkan1.0 a.spvasm -o a.spv + # Validate as Vulkan 1.0 + spirv-val --target-env vulkan1.0 a.spv + - Support SPV_GOOGLE_decorate_string and SPV_GOOGLE_hlsl_functionality1 + - Fixes: + - Fix Android.mk build. Compilation was failing due to missing definitions of + SpvCapabilityFloat16ImageAMD and other enumerated values. + - Optimizer: Avoid generating duplicate names when merging types. + - #1375: Validator: SPV_AMD_gpu_shaer_half_float implicitly allows declaration + of the 16-bit floating point type. + - #1376: Optimizer: Avoid folding half-precision float. + +v2018.1 2018-03-02 + - General: + - Support Visual Studio 2013 again. (Continue support for VS 2015 and VS 2017.) + - Support building SPIRV-Tools as a shared library. + - Improve the HLSL legalization optimization recipe. #1311 + - Optimizer: + - General speedups. + - Remove generic dead code elimination functionality from transforms: + --eliminate-local-single-block + --eliminate-local-single-store + --eliminate-local-multi-store + To recover the previous behaviour, a recipe using those transforms should now + also invoke the --eliminate-dead-code-aggressive transform. + - Improve folding, including coverage for floating point, OpSelect, and arithmetic + with non-trivial constant operands. + - Add loop-invariant code motion pass. + - Add loop-unrolling pass, for honouring unroll hits. + - Add loop-unswitch pass. + - Add instruction simplification pass. + - Aggressive dead code elimination: Understands capability hierarchy when finding + instructions it can eliminate (combinators). (PR #1268) + - CCP can now fold floating point arithmetic. #1311 + - Validator: + - Validate barrier instructions. + - Check Vulkan-specific rules for atomics. + - Check Vulkan prohibition of Location or Component decorations on BuiltIn variables. + - Linker: + - Add --verify-ids option + - Add option to allow a resulting module to be partially linked. + - Handle OpModuleProcessed (instructions in SPIR-V layout section 7c) + - Fixes: + - #1265: Optimizer: Fix use-after free bug in if-conversion. (Fix object lifecycle bug + in type manager.) + - #1282: Fix new warnings found by GCC 8.0.1. + - #1285: Optimizer: Fix random failures during inlining. (Dangling references in DefUseManager) + - #1295: Optimizer: Fix incorrect handling of Phi nodes in CCP. + - #1300: Fix CCP: avoid bad CCP transitions and unsettled values. + - #1304: Avoid static-duration variables of class type (with constructors). + - #1323: Fix folding of an insert composite feeding a composite extract. + - #1339: Fix CCP: Handle OpConstantNull boolean values as conditions. + - #1341: DCEInst: Keep atomic instructions (and some others with side effects). + - #1354: Don't fold integer division. + - #1357: Support OpConstantNull in folding. + - #1361: CCP: Fix handling of non-constant module-scope values + +v2018.0 2018-02-02 + - General + - VisualStudio 2013 is no longer supported. VisualStudio 2015 is supported. + - Use "include/unified1" directory from SPIRV-Headers. Requires recent SPIRV-Headers source. + - Disassembler: spirv-dis adds --color option to force color disassembly. + - Optimizer: + - Add pass to eliminate dead insertions. + - Aggressive dead code elimination now removes OpSwitch constructs. + - Block merging occurs in more cases. + - Add driver workaround transform: replace OpUnreachable with harmless branch to merge. + - Improve instruction folding framework. + - Add loop analysis. + - Add scalar replacement of aggregates to size-optimization recipe. + - Add pass to replace instructions invalid for a shader stage, with a harmless value. + This changes the semantics of the program! Not for general use! + - Rearragne and add passes to performance-optimization recipe, to produce better results. + - Validator: + - Validate OpenCL extended instructions. + - Shaders can't perform atomics on floats. + - Validate memory semantics values in atomics. + - Validate instruction-adjacency constraints, e.g. OpPhi predecessors, merge instructions + immediately precede branches. + - Fixes: + - PR 1198: Optimizer: Fix CCP in presence of matrix constants. + - #1199: Optimizer: Fix CCP: don't propagate spec constants. + - #1203: Optimizer: Fix common uniform elim bug introduced by refactoring. + - #1210: Optimizer: Aggressive dead code elimination: Fix 'break' identification. + - #1212: Optimizer: Aggressive dead code elimination: Was skipping too many instructions. + - #1214: Optimizer: Aggressive dead code elimination: Fix infinite loop. + - #1228: Optimizer: Fix CCP: Handling of varying Phi nodes; was resulting in infinite loop. + - #1245: Optimizer: Dead branch elimination: Avoid a null pointer dereference. + - #1250: Optimizer: Dead branch elimination: Avoid spuriously reporting a change. + +v2017.3 2018-01-12 + - General: + - Support DebugInfo extended instruction set, targeted at OpenCL environments. + See the SPIR-V Registry. + - Generate a SPIRV-Tools.pc file for pkg-config. + - Optimizer: + - Progress for legalization of code generated from HLSL (issue #1118): + - Add --legalize-hlsl option to run transforms used to transform intermediate + code generated by HLSL to SPIR-V for Vulkan compilers. Those compilers + normally run these transforms automatically. This option is used for developing + those transforms. + - Add Private-to-Function variable conversion for modules with logical + addressing. + - Add --ccp: SSA Conditional Constant Propagation (CCP) + - Add --print-all to show disassembly for each optimization pass. + - Internal: Add loop descriptors and post-order tree iterator. + - Generalized dead branch elimination + - Aggressive dead code elimination (ADCE) now removes dead functions and + module-scope variables. + - Vector extract/insert elimination now optimizes through some cases of + VectorShuffle, and GLSL.std.450 Mix extended instruction. + - Validator: + - Add validation for GLSL.std.450 extended instruction set. + - Check out of bounds composite accesses, where that's statically computable. + Fixes #1112. + - Check upper bits of literal numbers that aren't a multiple of 32-bits wide. + - More validation of primitive instructions + - Add optional "relaxed" checking logical addressing mode to permit some + cases of pointer-to-pointer. Contributes to HLSL legalization (issue #1118). + - Fixes: + #1100: Validator: Image operand Sample can be used with OpImageSparseFetch, + OpImageSparseRead. + #1108: Remove duplicates transform was incorrectly removing non-duplicate + decorations. + #1111: Optimizer's type manager could reference deleted memory. + #1112: Fix decoration equality check, e.g. it is now symmetric. + #1129: Validator now disallows Dim=SupbassData for OpImageSparseRead. + #1143: Fix CCP: Was generating incorrect code for loops. + #1153: Fix CCP crash. + #1154: Optimizer's internal instruction-to-block mappings were sometimes + inconsistent. + #1159: Fix CCP infinite loop. + #1168: Fix dead branch elimination intermittently generating incorrect code. + Fixes https://github.com/KhronosGroup/glslang/issues/1205 + #1186: Fix validation of PackDouble2x32 and UnpackDouble2x32 + +v2017.2 2017-12-15 + - General: + - Support OpenCL 1.2, 2.0 target environments, including embedded profiles + - Add CONTRIBUTING.md + - Fix exit status code for spirv-link + - Disassember: Enable emitting ANSI colour codes to a string + - Library avoids polluting global namespace. The libraries can export C and C++ + symbols starting with "spv", or in a C++ namespace. Add a test for this. + - Linux release builds include debug information, for easier profiling + - Build bots no longer test VisualStudio 2013 + - Testing dependency RE2 requires VisualStudio 2015 or later + - Build bots check code formatting + - Optimizer: + - Add --skip-validation to spirv-opt + - Add dominance tree analysis + - Add generic value propagation engine + - Add global redundancy elimination within a function + - Add scalar replacement of function-scope variables of composite type + - Aggressive dead code elimination: Remove empty loops + - Killing an instruction notifies the IRContext + - IRContext::KillInst deletes the instruction + - Move CFG analysis to IRContext + - Add constant manager + - Fix: Don't consider derivative instructions as combinators. + - Fix: Don't delete an instruction twice in local dead-code-elimination + - Fix: Don't consider derivative instructions as combinators. + - Validator: + - Finish checking of image instructions (Section 3.32.10) + - Check sparse image instructions + - Check OpTypeImage, OpTypeSampleImage + - Check composite instructions (Section 3.32.12) + - Check atomic instructions (Section 3.32.18) + - Check OpEmitStreamVertex, OpEndStreamPrimitive instructions + - Re-enable validation of OpCopyObject + - OpKill, image ImplicitLod and QueryLod instructions can only be used in Fragment + shaders. + - Fixes for image instruction validation: + - Lod image operand only usable with ExplicitLod and OpImageFetch + - ExplicitLod Lod image operand must be float scalar + - OpImageFectch Lod image operand must be int scalar + - OpImageGather component operand must be 32-bits (integer scalar) + - OpImageQuerySizeLod Lod must be integer scalar + - Fixes: + #622: Remove names and decorations when inlining + #989: Aggressive dead code elim: Don't optimize away live breaks from a loop + #991: Fix validation of SPV_AMD_shader_ballot + #1004: Use after free of an instruction, in remove-duplicates transform + #1007: OpImageRead not required to return 4-component vector + #1009: OpImageRead can return scalar int/float types + #1011: OpImageWrite should allow scalar int/float texel types + #1012: Fix validat Dref type check + #1017: Load-store elimination considers variable initializations + #1034: Fix Windows debug build: operator< should be a weak ordering + #1083: Inlining: Set parent (function) for each inlined basic block. + #1075: Aggressive dead code elimination: Was leaving dangling references to + removed blocks. + +v2017.1 2017-11-23 + - Update README with details on the public_spirv_tools_dev@khronos.org mailing list. + - General: + - Automatically deploy built artifacts to GitHub Releases + - Add a Linker (module combiner). Under development. + - Add Android.mk for Android NDK builds. + - Add the 'effcee' library as an optional dependency for use in tests. + Eventually it will be a required dependency, once downstream projects have + a chance to adjust. Requires 're2' library. + - Avoid static-duration variables of class type (with constructors). + - Hack around bugs in gcc-4.8.1 template handling + - Faster opcode lookup + - Validator: + - Recognize extensions listed on SPIR-V registry, + through #25 SPV_AMD_shader_fragment_mask + - Validator issues an info message when it sees an unrecognized extension. + - Type check basic arithmetic operations + - Type check carry/extended arithmetic operations + - Type check vector arithmetic operations + - Type check Relational and Logical instructions + - Type check Bit instructions + - Check type uniqueness rules + - Check conversion instructions + - Check image instructions + - Check derivative instructions + - Check OpVectorShuffle + - Check OpBranchConditional + - OpModuleProcessed is only allowed after debug names section and before annotations + section. + - Checks the right kind of return is called for each function (void or non-void). + - Add option to relax type check when storing structs (--relax-store-struct) + - Optimizer: + - Refactoring internal representation of the module, including: + - IRContext: owns a module and manages analyses + - Instructions are owned by intrusive lists, and have unique IDs + - BasicBlock owns its instruction list. + - DefUseManager: change representation of uses, for faster processing + on large modules. + - Add high level recipes: -O, -Os, and -Oconfig + Recipes for -O and -Os are under development. + - Add eliminate-dead-function transform + - Add strength reduction transform: For now, convert multiply by power of 2 + to a bit shift. + - Add CFG cleanup transform + - Add removal of dead module-scope variables + - Add merge-return transform for modules without structured control flow + - Add redundancy elimination within a basic block (local value numbering) + - Extract-insert elimination: + - Recognize the case where the first instruction in the sequence is an + OpCompositeConstruct or OpConstantComposite + - Handle some cases of nested structs + - Dead branch elimination now can eliminate entire selection constructs + when all arms are dead. + - Compressing codec: + - Updated algorithm to 1.01, 1.02, 1.03 + - Not built by default. Use -DSPIRV_BUILD_COMPRESSION=ON to build. + - Codec can be parameterized by a customized model. + - Fixes: + #728: Fix decoration of inlined functions + #798: spirv-as should fail when given unrecognized long option + #800: Inliner: Fix inlining function into header of multi-block loop + #824: Eliminate-local-multi-store: Fix a crash + #826: Elimiante-local-multi-store: Fix a crash + #827: Fix crash when compact-ids transform runs before another transform. + #834: Add Cmake option to build the compressing codec. Off by default. + #911: Fix classification of Line and NoLine instructions + +v2017.0 2017-09-01 + - Update README to describe that assembler, disassembler, and binary parser support + are based on grammar files from the SPIRV-Headers repository. + +v2016.7 2017-09-01 + - Add SPIR-V 1.2 + - OpenCL 2.2 support is now based on SPIR-V 1.2 + - Support AMD extensions in assembler, disassembler: + SPV_AMD_gcn_shader + SPV_AMD_shader_ballot + SPV_AMD_shader_explicit_vertex_parameter + SPV_AMD_shader_trinary_minmax + SPV_AMD_gpu_shader_half_float + SPV_AMD_texture_gather_bias_lod + SPV_AMD_gpu_shader_int16 + - Optimizer: Add support for: + - Inline all function calls in entry points. + - Flatten decoration groups. Fixes #602 + - Id compaction (minimize Id bound). Fixes #624 + - Eliminate redundant composite insert followed by extract + - Simplify access chains to local variables + - Eliminate local variables with a single store, if possible + - Eliminate local variables with a several stores, if possible + - Eliminate loads and stores in same block to local variables + - Eliminate redundant insert/extract to composite values + - Aggressive dead instruction elimination + - Eliminate dead branches + - Merge blocks when the second can only be preceded by the first + - Eliminate ommon uniform loads + - Assembler: Add option to preserve numeric ids. Fixes #625 + - Add build target spirv-tools-vimsyntax to generate spvasm.vim, a SPIR-V + assembly syntax file for Vim. + - Version string: Allow overriding of wall clock timestamp with contents + of environment variable SOURCE_DATE_EPOCH. + - Validator implements relaxed rules for SPV_KHR_16bit_storage. + - CMake installation rules use GNUInstallDirs. For example, libraries + will be installed into a lib64 directory if that's the norm for the + current system. + - Fixes: + #500: Parameterize validator limit checks + #508: Support compilation under CYGWIN + #517: Fix validation when continue (or case) contstruct is also the head of a + nested control construct. + #551: If a merge block is reachable, it must be *strictly* dominated by its + header. + #548: Validator: Error when the reserved OpImageSparseSampleProj* opcodes + are used. + #611: spvtools::Optimizer was failing to save the module to the output + binary vector when all passes succeded without changes. + #629: The inline-entry-points-all optimization could generate invalidly + structured code when the inlined function had early returns. + #697: Optimizer's Instruction::ForEachInId method was skipping semantics-id + and scope-id. + #755: Inliner: Fix inlining of callee with single Return appearing before + the end of the function. + #776: Fix dead branch elimination in presence of complex but dead control + flow. + #781: SPV_KHR_variable_pointers allows duplicate pointer types + #782: Inliner: Fix remapping of non-label forward references in callee + #787: Inliner: Fix remapping of inlined entry block when called from + single block loop. + #790: Inliner: Fix remapping of inlined entry block when callee has + multiple returns. + +v2016.6 2016-12-13 + - Published the C++ interface for assembling, disassembling, validation, and + optimization. + - Support SPV_KHR_shader_draw_parameters in assembler, disassembler, parser. + - Validator: + - Add validator API accepting raw binary words + - Increased coverage: + - Checks "Data rules" in Universal Validation Rules, section 2.16.1 + - WIP: Universal Limits. + - The minimum mandated upper bounds are checked. + - TODO: Parameterize the validator to allow larger limits accepted by + a more than minimally capable implementation. + - OpSampledImage checks + - OpConstantComposite checks + - Id bound check + - Disasssembler: + - Generates friendly GLSL-based names for more builtin variables + - Generates friendly names for numeric OpConstant values + - Vendor tool info extracted from SPIR-V XML registry file. + - Fixes issues: + #429: Validator: Allow OpTypeForwardPointer and OpTypeStruct to reference + undefined IDs + #482: Validator: OpVariable initializer can be an ID of a module-scope variable + +v2016.5 2016-09-16 + - Support SPV_KHR_shader_ballot in assembler, disassembler, parser. + - Disassembler: Generate friendly names for built-in variables. + - Partial fixes: + #359: Add Emacs helper for automatically diassembling/assembling a SPIR-V + binary on file load/save. + - Fixes: + #414: Validator: Allow OpUndef for composite constants + #415: Validator: Phi can use its own value in some cases. + +v2016.4 2016-09-01 + - Relicensed under Apache 2.0 + - Add optimization passes (in API and spirv-opt command) + - Fold spec constants defined with OpSpecConstantOp and + OpSpecConstantComposite to normal constants with fixed value(s). + - Fixes issues: + #318: Relicensed under Apache 2.0 + +v2016.3 2016-08-24 + - Add target environment enums for OpenCL 2.1, OpenCL 2.2, + OpenGL 4.0, OpenGL 4.1, OpenGL 4.2, OpenGL 4.3, OpenGL 4.5. + - Add spirv-cfg, an experimental tool to dump the control flow graph + as a GraphiViz "dot" graph + - Add optimization pass: Eliminate dead constants. + - Add spirv-lesspipe.sh filter utility + - Fixes issues: + #288: Check def-use dominance rules for OpPhi (variable,parent) operands + #339: Allow OpUndef in types-constants-global-vars section, as required + by SPIR-V 1.0 Rev7, 1.1 Rev 3. + #340: Avoid race on mkdir during build + #365: Relax PointSize, ClipDistance, CullDistance capability check in all + environments not just Vulkan 1.0. + +v2016.2 2016-08-05 + - Validator is incomplete + - Checks ID use block is dominated by definition block + - Add optimization passes (in API and spirv-opt command) + - Strip debug info instructions + - Freeze spec constant to their default values + - Allow INotEqual as operation for OpSpecConstantOp + - Fixes bugs: + #270: validator: crash when continue construct is unreachable + #279: validator: infinite loop when analyzing some degenerate control + flow graphs + #286: validator: don't incorrectly generate def-use error for + (variable,parent) parameters to OpPhi + #290: disassembler: never generate bare % for an identifier + #295: validator: def-use dominance check should ignore unreachable uses + #276: validator: allow unreachable continue constructs + #297: validator: allow an unreachable block to branch to a reachable + merge block + +v2016.1 2016-07-19 + - Fix https://github.com/KhronosGroup/SPIRV-Tools/issues/261 + Turn off ClipDistance and CullDistance capability checks for Vulkan. + - The disassembler can emit friendly names based on debug info (OpName + instructions), and will infer somewhat friendly names for most types. + This is turned on by default for the spirv-dis command line tool. + - Updated to support SPIR-V 1.1 rev 2 + - Input StorageClass, Sampled1D capability, and SampledBuffer capability + do not require Shader capability anymore. + +v2016.0 2016-07-04 + + - Adds v. versioning, with "-dev" indicating + work in progress. The intent is to more easly report + and summarize functionality when SPIRV-Tools is incorporated + in downstream projects. + + - Summary of functionality (See the README.md for more): + - Supports SPIR-V 1.1 Rev 1 + - Supports SPIR-V 1.0 Rev 5 + - Supports GLSL std450 extended instructions 1.0 Rev 3 + - Supports OpenCL extended instructions 1.0 Rev 2 + - Assembler, disassembler are complete + - Supports floating point widths of 16, 32, 64 bits + - Supports integer widths up to 64 bits + - Validator is incomplete + - Checks capability requirements in most cases + - Checks module layout constraints + - Checks ID use-definition ordering constraints, + ignoring control flow + - Checks some control flow graph rules + - Optimizer is introduced, with few available transforms. + - Supported on Linux, OSX, Android, Windows + + - Fixes bugs: + - #143: OpenCL pow and pown arguments diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/.clang-format vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/.clang-format --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/.clang-format 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/.clang-format 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,5 @@ +--- +Language: Cpp +BasedOnStyle: Google +DerivePointerAlignment: false +... diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/cmake/SPIRV-Tools.pc.in vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/cmake/SPIRV-Tools.pc.in --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/cmake/SPIRV-Tools.pc.in 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/cmake/SPIRV-Tools.pc.in 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,12 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ + +Name: SPIRV-Tools +Description: Tools for SPIR-V +Version: @CURRENT_VERSION@ +URL: https://github.com/KhronosGroup/SPIRV-Tools + +Libs: -L${libdir} @SPIRV_LIBRARIES@ +Cflags: -I${includedir} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/cmake/SPIRV-Tools-shared.pc.in vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/cmake/SPIRV-Tools-shared.pc.in --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/cmake/SPIRV-Tools-shared.pc.in 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/cmake/SPIRV-Tools-shared.pc.in 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,12 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ + +Name: SPIRV-Tools +Description: Tools for SPIR-V +Version: @CURRENT_VERSION@ +URL: https://github.com/KhronosGroup/SPIRV-Tools + +Libs: -L${libdir} @SPIRV_SHARED_LIBRARIES@ +Cflags: -I${includedir} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/cmake/write_pkg_config.cmake vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/cmake/write_pkg_config.cmake --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/cmake/write_pkg_config.cmake 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/cmake/write_pkg_config.cmake 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,31 @@ +# Copyright (c) 2017 Pierre Moreau +# +# 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. + +# First, retrieve the current version from CHANGES +file(STRINGS ${CHANGES_FILE} CHANGES_CONTENT) +string( +REGEX + MATCH "v[0-9]+(.[0-9]+)?(-dev)? [0-9]+-[0-9]+-[0-9]+" + FIRST_VERSION_LINE + ${CHANGES_CONTENT}) +string( +REGEX + REPLACE "^v([^ ]+) .+$" "\\1" + CURRENT_VERSION + "${FIRST_VERSION_LINE}") +# If this is a development version, replace "-dev" by ".0" as pkg-config nor +# CMake support "-dev" in the version. +# If it's not a "-dev" version then ensure it ends with ".1" +string(REGEX REPLACE "-dev.1" ".0" CURRENT_VERSION "${CURRENT_VERSION}.1") +configure_file(${TEMPLATE_FILE} ${OUT_FILE} @ONLY) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,268 @@ +# Copyright (c) 2015-2016 The Khronos Group Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +cmake_minimum_required(VERSION 2.8.12) +if (POLICY CMP0048) + cmake_policy(SET CMP0048 NEW) +endif() +if (POLICY CMP0054) + # Avoid dereferencing variables or interpret keywords that have been + # quoted or bracketed. + # https://cmake.org/cmake/help/v3.1/policy/CMP0054.html + cmake_policy(SET CMP0054 NEW) +endif() +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +project(spirv-tools) +enable_testing() +set(SPIRV_TOOLS "SPIRV-Tools") + +include(GNUInstallDirs) + +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + add_definitions(-DSPIRV_LINUX) + set(SPIRV_TIMER_ENABLED ON) +elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") + add_definitions(-DSPIRV_WINDOWS) +elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") + add_definitions(-DSPIRV_WINDOWS) +elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") + add_definitions(-DSPIRV_MAC) +elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Android") + add_definitions(-DSPIRV_ANDROID) + set(SPIRV_TIMER_ENABLED ON) +elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD") + add_definitions(-DSPIRV_FREEBSD) +else() + message(FATAL_ERROR "Your platform '${CMAKE_SYSTEM_NAME}' is not supported!") +endif() + +if (${SPIRV_TIMER_ENABLED}) + add_definitions(-DSPIRV_TIMER_ENABLED) +endif() + +if ("${CMAKE_BUILD_TYPE}" STREQUAL "") + message(STATUS "No build type selected, default to Debug") + set(CMAKE_BUILD_TYPE "Debug") +endif() + +option(SKIP_SPIRV_TOOLS_INSTALL "Skip installation" ${SKIP_SPIRV_TOOLS_INSTALL}) +if(NOT ${SKIP_SPIRV_TOOLS_INSTALL}) + set(ENABLE_SPIRV_TOOLS_INSTALL ON) +endif() + +option(SPIRV_BUILD_COMPRESSION "Build SPIR-V compressing codec" OFF) + +option(SPIRV_WERROR "Enable error on warning" ON) +if(("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")) + set(COMPILER_IS_LIKE_GNU TRUE) +endif() +if(${COMPILER_IS_LIKE_GNU}) + set(SPIRV_WARNINGS -Wall -Wextra -Wnon-virtual-dtor -Wno-missing-field-initializers) + + option(SPIRV_WARN_EVERYTHING "Enable -Weverything" ${SPIRV_WARN_EVERYTHING}) + if(${SPIRV_WARN_EVERYTHING}) + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set(SPIRV_WARNINGS ${SPIRV_WARNINGS} + -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded) + elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + set(SPIRV_WARNINGS ${SPIRV_WARNINGS} -Wpedantic -pedantic-errors) + else() + message(STATUS "Unknown compiler ${CMAKE_CXX_COMPILER_ID}, " + "so SPIRV_WARN_EVERYTHING has no effect") + endif() + endif() + + if(${SPIRV_WERROR}) + set(SPIRV_WARNINGS ${SPIRV_WARNINGS} -Werror) + endif() +elseif(MSVC) + set(SPIRV_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS /wd4800) + + if(${SPIRV_WERROR}) + set(SPIRV_WARNINGS ${SPIRV_WARNINGS} /WX) + endif() +endif() + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/source) + +option(SPIRV_COLOR_TERMINAL "Enable color terminal output" ON) +if(${SPIRV_COLOR_TERMINAL}) + add_definitions(-DSPIRV_COLOR_TERMINAL) +endif() + +option(SPIRV_LOG_DEBUG "Enable excessive debug output" OFF) +if(${SPIRV_LOG_DEBUG}) + add_definitions(-DSPIRV_LOG_DEBUG) +endif() + +if (DEFINED SPIRV_TOOLS_EXTRA_DEFINITIONS) + add_definitions(${SPIRV_TOOLS_EXTRA_DEFINITIONS}) +endif() + +function(spvtools_default_compile_options TARGET) + target_compile_options(${TARGET} PRIVATE ${SPIRV_WARNINGS}) + + if (${COMPILER_IS_LIKE_GNU}) + target_compile_options(${TARGET} PRIVATE + -std=c++11 -fno-exceptions -fno-rtti) + target_compile_options(${TARGET} PRIVATE + -Wall -Wextra -Wno-long-long -Wshadow -Wundef -Wconversion + -Wno-sign-conversion) + # For good call stacks in profiles, keep the frame pointers. + if(NOT "${SPIRV_PERF}" STREQUAL "") + target_compile_options(${TARGET} PRIVATE -fno-omit-frame-pointer) + endif() + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set(SPIRV_USE_SANITIZER "" CACHE STRING + "Use the clang sanitizer [address|memory|thread|...]") + if(NOT "${SPIRV_USE_SANITIZER}" STREQUAL "") + target_compile_options(${TARGET} PRIVATE + -fsanitize=${SPIRV_USE_SANITIZER}) + endif() + else() + target_compile_options(${TARGET} PRIVATE + -Wno-missing-field-initializers) + endif() + endif() + + if (MSVC) + # Specify /EHs for exception handling. This makes using SPIRV-Tools as + # dependencies in other projects easier. + target_compile_options(${TARGET} PRIVATE /EHs) + endif() + + # For MinGW cross compile, statically link to the C++ runtime. + # But it still depends on MSVCRT.dll. + if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") + if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") + set_target_properties(${TARGET} PROPERTIES + LINK_FLAGS -static -static-libgcc -static-libstdc++) + endif() + endif() +endfunction() + +if(NOT COMMAND find_host_package) + macro(find_host_package) + find_package(${ARGN}) + endmacro() +endif() +if(NOT COMMAND find_host_program) + macro(find_host_program) + find_program(${ARGN}) + endmacro() +endif() + +find_host_package(PythonInterp) + +if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + macro(spvtools_check_symbol_exports TARGET) + add_test(NAME spirv-tools-symbol-exports-${TARGET} + COMMAND ${PYTHON_EXECUTABLE} + ${spirv-tools_SOURCE_DIR}/utils/check_symbol_exports.py "$") + endmacro() +else() + macro(spvtools_check_symbol_exports TARGET) + message("Skipping symbol exports test for ${TARGET}") + endmacro() +endif() + +# Defaults to OFF if the user didn't set it. +option(SPIRV_SKIP_EXECUTABLES + "Skip building the executable and tests along with the library" + ${SPIRV_SKIP_EXECUTABLES}) +option(SPIRV_SKIP_TESTS + "Skip building tests along with the library" ${SPIRV_SKIP_TESTS}) +if ("${SPIRV_SKIP_EXECUTABLES}") + set(SPIRV_SKIP_TESTS ON) +endif() + +# Defaults to ON. The checks can be time consuming. +# Turn off if they take too long. +option(SPIRV_CHECK_CONTEXT "In a debug build, check if the IR context is in a valid state." ON) +if (${SPIRV_CHECK_CONTEXT}) + add_definitions(-DSPIRV_CHECK_CONTEXT) +endif() + +add_subdirectory(external) + +if (TARGET effcee) + add_definitions(-DSPIRV_EFFCEE) +endif() + +add_subdirectory(source) +add_subdirectory(tools) + +add_subdirectory(test) +add_subdirectory(examples) + +if(ENABLE_SPIRV_TOOLS_INSTALL) + install( + FILES + ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/libspirv.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/libspirv.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/optimizer.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/linker.hpp + DESTINATION + ${CMAKE_INSTALL_INCLUDEDIR}/spirv-tools/) +endif(ENABLE_SPIRV_TOOLS_INSTALL) + +if (NOT "${SPIRV_SKIP_TESTS}") + add_test(NAME spirv-tools-copyrights + COMMAND ${PYTHON_EXECUTABLE} utils/check_copyright.py + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +endif() + +set(SPIRV_LIBRARIES "-lSPIRV-Tools -lSPIRV-Tools-link -lSPIRV-Tools-opt") +set(SPIRV_SHARED_LIBRARIES "-lSPIRV-Tools-shared") +if(SPIRV_BUILD_COMPRESSION) + set(SPIRV_LIBRARIES "${SPIRV_LIBRARIES} -lSPIRV-Tools-comp") +endif(SPIRV_BUILD_COMPRESSION) + +# Build pkg-config file +# Use a first-class target so it's regenerated when relevant files are updated. +add_custom_target(spirv-tools-pkg-config ALL + COMMAND ${CMAKE_COMMAND} + -DCHANGES_FILE=${CMAKE_CURRENT_SOURCE_DIR}/CHANGES + -DTEMPLATE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/SPIRV-Tools.pc.in + -DOUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools.pc + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} + -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR} + -DSPIRV_LIBRARIES=${SPIRV_LIBRARIES} + -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake + DEPENDS "CHANGES" "cmake/SPIRV-Tools.pc.in" "cmake/write_pkg_config.cmake") +add_custom_target(spirv-tools-shared-pkg-config ALL + COMMAND ${CMAKE_COMMAND} + -DCHANGES_FILE=${CMAKE_CURRENT_SOURCE_DIR}/CHANGES + -DTEMPLATE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/SPIRV-Tools-shared.pc.in + -DOUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools-shared.pc + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} + -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR} + -DSPIRV_SHARED_LIBRARIES=${SPIRV_SHARED_LIBRARIES} + -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake + DEPENDS "CHANGES" "cmake/SPIRV-Tools-shared.pc.in" "cmake/write_pkg_config.cmake") + +# Install pkg-config file +if (ENABLE_SPIRV_TOOLS_INSTALL) + install( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools.pc + ${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools-shared.pc + DESTINATION + ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +endif() diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/commit-sha vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/commit-sha --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/commit-sha 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/commit-sha 2018-04-27 11:46:36.000000000 +0000 @@ -0,0 +1 @@ +26a698c34788bb69123a1f3789970a16cf4d9641 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/CONTRIBUTING.md vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/CONTRIBUTING.md --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/CONTRIBUTING.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/CONTRIBUTING.md 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,189 @@ +# Contributing to SPIR-V Tools + +## For users: Reporting bugs and requesting features + +We organize known future work in GitHub projects. See [Tracking SPIRV-Tools work +with GitHub +projects](https://github.com/KhronosGroup/SPIRV-Tools/blob/master/projects.md) +for more. + +To report a new bug or request a new feature, please file a GitHub issue. Please +ensure the bug has not already been reported by searching +[issues](https://github.com/KhronosGroup/SPIRV-Tools/issues) and +[projects](https://github.com/KhronosGroup/SPIRV-Tools/projects). If the bug has +not already been reported open a new one +[here](https://github.com/KhronosGroup/SPIRV-Tools/issues/new). + +When opening a new issue for a bug, make sure you provide the following: + +* A clear and descriptive title. + * We want a title that will make it easy for people to remember what the + issue is about. Simply using "Segfault in spirv-opt" is not helpful + because there could be (but hopefully aren't) multiple bugs with + segmentation faults with different causes. +* A test case that exposes the bug, with the steps and commands to reproduce + it. + * The easier it is for a developer to reproduce the problem, the quicker a + fix can be found and verified. It will also make it easier for someone + to possibly realize the bug is related to another issue. + +For feature requests, we use +[issues](https://github.com/KhronosGroup/SPIRV-Tools/issues) as well. Please +create a new issue, as with bugs. In the issue provide + +* A description of the problem that needs to be solved. +* Examples that demonstrate the problem. + +## For developers: Contributing a patch + +Before we can use your code, you must sign the [Khronos Open Source Contributor +License Agreement](https://cla-assistant.io/KhronosGroup/SPIRV-Tools) (CLA), +which you can do online. The CLA is necessary mainly because you own the +copyright to your changes, even after your contribution becomes part of our +codebase, so we need your permission to use and distribute your code. We also +need to be sure of various other things -- for instance that you'll tell us if +you know that your code infringes on other people's patents. You don't have to +sign the CLA until after you've submitted your code for review and a member has +approved it, but you must do it before we can put your code into our codebase. + +See +[README.md](https://github.com/KhronosGroup/SPIRV-Tools/blob/master/README.md) +for instruction on how to get, build, and test the source. Once you have made +your changes: + +* Ensure the code follows the [Google C++ Style + Guide](https://google.github.io/styleguide/cppguide.html). Running + `clang-format -style=file -i [modified-files]` can help. +* Create a pull request (PR) with your patch. +* Make sure the PR description clearly identified the problem, explains the + solution, and references the issue if applicable. +* If your patch completely fixes bug 1234, the commit message should say + `Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/1234` + When you do this, the issue will be closed automatically when the commit + goes into master. Also, this helps us update the [CHANGES](CHANGES) file. +* Watch the continuous builds to make sure they pass. +* Request a code review. + +The reviewer can either approve your PR or request changes. If changes are +requested: + +* Please add new commits to your branch, instead of amending your commit. + Adding new commits makes it easier for the reviewer to see what has changed + since the last review. +* Once you are ready for another round of reviews, add a comment at the + bottom, such as "Ready for review" or "Please take a look" (or "PTAL"). This + explicit handoff is useful when responding with multiple small commits. + +After the PR has been reviewed it is the job of the reviewer to merge the PR. +Instructions for this are given below. + +## For maintainers: Reviewing a PR + +The formal code reviews are done on GitHub. Reviewers are to look for all of the +usual things: + +* Coding style follows the [Google C++ Style + Guide](https://google.github.io/styleguide/cppguide.html) +* Identify potential functional problems. +* Identify code duplication. +* Ensure the unit tests have enough coverage. + +When looking for functional problems, there are some common problems reviewers +should pay particular attention to: + +* Does the code work for both Shader (Vulkan and OpenGL) and Kernel (OpenCL) + scenarios? The respective SPIR-V dialects are slightly different. +* Changes are made to a container while iterating through it. You have to be + careful that iterators are not invalidated or that elements are not skipped. +* C++11 and VS2013. We generally assume that we have a C++11 compliant + compiler. However, on Windows, we still support Visual Studio 2013, which is + not fully C++11 compliant. See + [here](https://msdn.microsoft.com/en-us/library/hh567368.aspx). In + particular, note that it does not provide default move-constructors or + move-assignments for classes. In general, r-value references do not work the + way you might assume they do. +* For SPIR-V transforms: The module is changed, but the analyses are not + updated. For example, a new instruction is added, but the def-use manager is + not updated. Later on, it is possible that the def-use manager will be used, + and give wrong results. + +## For maintainers: Merging a PR + +We intend to maintain a linear history on the GitHub master branch, and the +build and its tests should pass at each commit in that history. A linear +always-working history is easier to understand and to bisect in case we want to +find which commit introduced a bug. + +### Initial merge setup + +The following steps should be done exactly once (when you are about to merge a +PR for the first time): + +* It is assumed that upstream points to + [git@github.com](mailto:git@github.com):KhronosGroup/SPIRV-Tools.git or + https://github.com/KhronosGroup/SPIRV-Tools.git. + +* Find out the local name for the main github repo in your git configuration. + For example, in this configuration, it is labeled `upstream`. + + ``` + git remote -v + [ ... ] + upstream https://github.com/KhronosGroup/SPIRV-Tools.git (fetch) + upstream https://github.com/KhronosGroup/SPIRV-Tools.git (push) + ``` + +* Make sure that the `upstream` remote is set to fetch from the `refs/pull` + namespace: + + ``` + git config --get-all remote.upstream.fetch + +refs/heads/*:refs/remotes/upstream/* + +refs/pull/*/head:refs/remotes/upstream/pr/* + ``` + +* If the line `+refs/pull/*/head:refs/remotes/upstream/pr/*` is not present in + your configuration, you can add it with the command: + + ``` + git config --local --add remote.upstream.fetch '+refs/pull/*/head:refs/remotes/upstream/pr/*' + ``` + +### Merge workflow + +The following steps should be done for every PR that you intend to merge: + +* Make sure your local copy of the master branch is up to date: + + ``` + git checkout master + git pull + ``` + +* Fetch all pull requests refs: + + ``` + git fetch upstream + ``` + +* Checkout the particular pull request you are going to review: + + ``` + git checkout pr/1048 + ``` + +* Rebase the PR on top of the master branch. If there are conflicts, send it + back to the author and ask them to rebase. During the interactive rebase be + sure to squash all of the commits down to a single commit. + + ``` + git rebase -i master + ``` + +* **Build and test the PR.** + +* If all of the tests pass, push the commit `git push upstream HEAD:master` + +* Close the PR and add a comment saying it was push using the commit that you + just pushed. See https://github.com/KhronosGroup/SPIRV-Tools/pull/935 as an + example. diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/examples/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/examples/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/examples/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/examples/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,35 @@ +# Copyright (c) 2016 Google 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. + +# Add a SPIR-V Tools example. Signature: +# add_spvtools_example( +# TARGET target_name +# SRCS src_file1.cpp src_file2.cpp +# LIBS lib_target1 lib_target2 +# ) +function(add_spvtools_example) + if (NOT ${SPIRV_SKIP_EXECUTABLES}) + set(one_value_args TARGET) + set(multi_value_args SRCS LIBS) + cmake_parse_arguments( + ARG "" "${one_value_args}" "${multi_value_args}" ${ARGN}) + + add_executable(${ARG_TARGET} ${ARG_SRCS}) + spvtools_default_compile_options(${ARG_TARGET}) + target_link_libraries(${ARG_TARGET} PRIVATE ${ARG_LIBS}) + set_property(TARGET ${ARG_TARGET} PROPERTY FOLDER "SPIRV-Tools examples") + endif() +endfunction() + +add_subdirectory(cpp-interface) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/examples/cpp-interface/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/examples/cpp-interface/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/examples/cpp-interface/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/examples/cpp-interface/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,19 @@ +# Copyright (c) 2016 Google 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. + +add_spvtools_example( + TARGET spirv-tools-cpp-example + SRCS main.cpp + LIBS SPIRV-Tools-opt +) \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/examples/cpp-interface/main.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/examples/cpp-interface/main.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/examples/cpp-interface/main.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/examples/cpp-interface/main.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This program demonstrates basic SPIR-V module processing using +// SPIRV-Tools C++ API: +// * Assembling +// * Validating +// * Optimizing +// * Disassembling + +#include +#include +#include + +#include "spirv-tools/libspirv.hpp" +#include "spirv-tools/optimizer.hpp" + +int main() { + const std::string source = + " OpCapability Shader " + " OpMemoryModel Logical GLSL450 " + " OpSource GLSL 450 " + " OpDecorate %spec SpecId 1 " + " %int = OpTypeInt 32 1 " + " %spec = OpSpecConstant %int 0 " + "%const = OpConstant %int 42"; + + spvtools::SpirvTools core(SPV_ENV_VULKAN_1_0); + spvtools::Optimizer opt(SPV_ENV_VULKAN_1_0); + + auto print_msg_to_stderr = [](spv_message_level_t, const char*, + const spv_position_t&, const char* m) { + std::cerr << "error: " << m << std::endl; + }; + core.SetMessageConsumer(print_msg_to_stderr); + opt.SetMessageConsumer(print_msg_to_stderr); + + std::vector spirv; + if (!core.Assemble(source, &spirv)) return 1; + if (!core.Validate(spirv)) return 1; + + opt.RegisterPass(spvtools::CreateSetSpecConstantDefaultValuePass({{1, "42"}})) + .RegisterPass(spvtools::CreateFreezeSpecConstantValuePass()) + .RegisterPass(spvtools::CreateUnifyConstantPass()) + .RegisterPass(spvtools::CreateStripDebugInfoPass()); + if (!opt.Run(spirv.data(), spirv.size(), &spirv)) return 1; + + std::string disassembly; + if (!core.Disassemble(spirv, &disassembly)) return 1; + std::cout << disassembly << "\n"; + + return 0; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,122 @@ +# Copyright (c) 2015-2016 The Khronos Group Inc. +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +if (DEFINED SPIRV-Headers_SOURCE_DIR) + # This allows flexible position of the SPIRV-Headers repo. + set(SPIRV_HEADER_DIR ${SPIRV-Headers_SOURCE_DIR}) +else() + if (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/SPIRV-Headers) + set(SPIRV_HEADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SPIRV-Headers) + else() + set(SPIRV_HEADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/spirv-headers) + endif() +endif() + +if (IS_DIRECTORY ${SPIRV_HEADER_DIR}) + set(SPIRV_HEADER_INCLUDE_DIR ${SPIRV_HEADER_DIR}/include PARENT_SCOPE) +else() + message(FATAL_ERROR + "SPIRV-Headers was not found - please checkout a copy under external/.") +endif() + +if (NOT ${SPIRV_SKIP_TESTS}) + # Find gmock if we can. If it's not already configured, then try finding + # it in external/googletest. + if (TARGET gmock) + message(STATUS "Google Mock already configured") + else() + set(GMOCK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest/googlemock) + if(EXISTS ${GMOCK_DIR}) + if(MSVC) + # Our tests use ::testing::Combine. Work around a compiler + # detection problem in googletest, where that template is + # accidentally disabled for VS 2017. + # See https://github.com/google/googletest/issues/1352 + add_definitions(-DGTEST_HAS_COMBINE=1) + endif() + if(WIN32) + option(gtest_force_shared_crt + "Use shared (DLL) run-time lib even when Google Test is built as static lib." + ON) + endif() + add_subdirectory(${GMOCK_DIR} EXCLUDE_FROM_ALL) + endif() + endif() + if (TARGET gmock) + set(GTEST_TARGETS + gtest + gtest_main + gmock + gmock_main + ) + foreach(target ${GTEST_TARGETS}) + set_property(TARGET ${target} PROPERTY FOLDER GoogleTest) + endforeach() + endif() + + set(SPIRV_ENABLE_EFFCEE ON) + if (MSVC) + if (MSVC_VERSION LESS 1900) + message(STATUS "SPIRV-Tools: Need Visual Studio 2015 or later for Effcee and RE2") + set(SPIRV_ENABLE_EFFCEE OFF) + endif() + endif() + + if (SPIRV_ENABLE_EFFCEE) + # Find Effcee and RE2, for testing. + # Optional for now, but eventually we'll make this required. + + # First find RE2, since Effcee depends on it. + # If already configured, then use that. Otherwise, prefer to find it under 're2' + # in this directory. + if (NOT TARGET re2) + # If we are configuring RE2, then turn off its testing. It takes a long time and + # does not add much value for us. If an enclosing project configured RE2, then it + # has already chosen whether to enable RE2 tesitng. + set(RE2_BUILD_TESTING OFF CACHE STRING "Run RE2 Tests") + if (NOT RE2_SOURCE_DIR) + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/re2) + set(RE2_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/re2" CACHE STRING "RE2 source dir" ) + endif() + endif() + endif() + + if (NOT TARGET effcee) + # Expect to find effcee in this directory. + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/effcee) + # If we're configuring RE2 (via Effcee), then turn off RE2 testing. + if (NOT TARGET re2) + set(RE2_BUILD_TESTING OFF) + endif() + if (MSVC) + # SPIRV-Tools uses the shared CRT with MSVC. Tell Effcee to do the same. + set(EFFCEE_ENABLE_SHARED_CRT ON) + endif() + add_subdirectory(effcee) + set_property(TARGET effcee PROPERTY FOLDER Effcee) + # Turn off warnings for effcee and re2 + set_property(TARGET effcee APPEND PROPERTY COMPILE_OPTIONS -w) + set_property(TARGET re2 APPEND PROPERTY COMPILE_OPTIONS -w) + endif() + endif() + # TODO(dneto): Eventually, require this. + endif() + if (TARGET effcee) + message(STATUS "SPIRV-Tools: Effcee is configured") + else() + message(STATUS "SPIRV-Tools: Effcee is not configured. Skipping Effcee-based tests.") + endif() + +endif() diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/CMakeLists.txt 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,51 @@ +# Copyright (c) 2015-2016 The Khronos Group Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and/or associated documentation files (the +# "Materials"), to deal in the Materials without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Materials, and to +# permit persons to whom the Materials are furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Materials. +# +# MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS +# KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS +# SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT +# https://www.khronos.org/registry/ +# +# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + +# +# The SPIR-V headers from the SPIR-V Registry +# https://www.khronos.org/registry/spir-v/ +# +cmake_minimum_required(VERSION 2.8) +project(SPIRV-Headers) + +# There are two ways to use this project. +# +# Using this source tree directly from a CMake-based project: +# 1. Add an add_subdirectory directive to include this sub directory. +# 2. Use ${SPIRV-Headers_SOURCE_DIR}/include} in a target_include_directories +# command. +# +# Installing the headers first, then using them with an implicit include +# directory. To install the headers: +# 1. mkdir build ; cd build +# 2. cmake .. +# 3. cmake --build . install-headers + +file(GLOB_RECURSE FILES include/spirv/*) +add_custom_target(install-headers + COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv ${CMAKE_INSTALL_PREFIX}/include/spirv) + +add_subdirectory(example) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/example/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/example/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/example/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/example/CMakeLists.txt 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,9 @@ +add_library(SPIRV-Headers-example + ${CMAKE_CURRENT_SOURCE_DIR}/example.cpp) +target_include_directories(SPIRV-Headers-example + PRIVATE ${SPIRV-Headers_SOURCE_DIR}/include) + +add_library(SPIRV-Headers-example-1.1 + ${CMAKE_CURRENT_SOURCE_DIR}/example-1.1.cpp) +target_include_directories(SPIRV-Headers-example-1.1 + PRIVATE ${SPIRV-Headers_SOURCE_DIR}/include) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/example/example-1.1.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/example/example-1.1.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/example/example-1.1.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/example/example-1.1.cpp 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,42 @@ +// Copyright (c) 2016 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and/or associated documentation files (the +// "Materials"), to deal in the Materials without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Materials, and to +// permit persons to whom the Materials are furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS +// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS +// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT +// https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + +// Use the SPIR-V 1.1 core instruction set, but with 1.0 versions +// of the GLSL and OpenCL extended instruction sets. +#include +#include +#include + +namespace { + +const GLSLstd450 kSin = GLSLstd450Sin; +const OpenCLLIB::Entrypoints kNative_cos = OpenCLLIB::Native_cos; +const spv::Op kNop = spv::OpNop; + +// This instruction is new in SPIR-V 1.1. +const spv::Op kNamedBarrierInit = spv::OpNamedBarrierInitialize; + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/example/example.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/example/example.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/example/example.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/example/example.cpp 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,37 @@ +// Copyright (c) 2016 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and/or associated documentation files (the +// "Materials"), to deal in the Materials without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Materials, and to +// permit persons to whom the Materials are furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS +// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS +// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT +// https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + +#include +#include +#include + +namespace { + +const GLSLstd450 kSin = GLSLstd450Sin; +const OpenCLLIB::Entrypoints kNative_cos = OpenCLLIB::Native_cos; +const spv::Op kNop = spv::OpNop; + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/extinst.glsl.std.450.grammar.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/extinst.glsl.std.450.grammar.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/extinst.glsl.std.450.grammar.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/extinst.glsl.std.450.grammar.json 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,642 @@ +{ + "copyright" : [ + "Copyright (c) 2014-2016 The Khronos Group Inc.", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and/or associated documentation files (the \"Materials\"),", + "to deal in the Materials without restriction, including without limitation", + "the rights to use, copy, modify, merge, publish, distribute, sublicense,", + "and/or sell copies of the Materials, and to permit persons to whom the", + "Materials are furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Materials.", + "", + "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", + "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", + "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", + "", + "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", + "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", + "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", + "IN THE MATERIALS." + ], + "version" : 100, + "revision" : 2, + "instructions" : [ + { + "opname" : "Round", + "opcode" : 1, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "RoundEven", + "opcode" : 2, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Trunc", + "opcode" : 3, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "FAbs", + "opcode" : 4, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "SAbs", + "opcode" : 5, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "FSign", + "opcode" : 6, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "SSign", + "opcode" : 7, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Floor", + "opcode" : 8, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Ceil", + "opcode" : 9, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Fract", + "opcode" : 10, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Radians", + "opcode" : 11, + "operands" : [ + { "kind" : "IdRef", "name" : "'degrees'" } + ] + }, + { + "opname" : "Degrees", + "opcode" : 12, + "operands" : [ + { "kind" : "IdRef", "name" : "'radians'" } + ] + }, + { + "opname" : "Sin", + "opcode" : 13, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Cos", + "opcode" : 14, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Tan", + "opcode" : 15, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Asin", + "opcode" : 16, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Acos", + "opcode" : 17, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Atan", + "opcode" : 18, + "operands" : [ + { "kind" : "IdRef", "name" : "'y_over_x'" } + ] + }, + { + "opname" : "Sinh", + "opcode" : 19, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Cosh", + "opcode" : 20, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Tanh", + "opcode" : 21, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Asinh", + "opcode" : 22, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Acosh", + "opcode" : 23, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Atanh", + "opcode" : 24, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Atan2", + "opcode" : 25, + "operands" : [ + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Pow", + "opcode" : 26, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "Exp", + "opcode" : 27, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Log", + "opcode" : 28, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Exp2", + "opcode" : 29, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Log2", + "opcode" : 30, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Sqrt", + "opcode" : 31, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "InverseSqrt", + "opcode" : 32, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Determinant", + "opcode" : 33, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "MatrixInverse", + "opcode" : 34, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Modf", + "opcode" : 35, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'i'" } + ] + }, + { + "opname" : "ModfStruct", + "opcode" : 36, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "FMin", + "opcode" : 37, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "UMin", + "opcode" : 38, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "SMin", + "opcode" : 39, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "FMax", + "opcode" : 40, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "UMax", + "opcode" : 41, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "SMax", + "opcode" : 42, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "FClamp", + "opcode" : 43, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minVal'" }, + { "kind" : "IdRef", "name" : "'maxVal'" } + ] + }, + { + "opname" : "UClamp", + "opcode" : 44, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minVal'" }, + { "kind" : "IdRef", "name" : "'maxVal'" } + ] + }, + { + "opname" : "SClamp", + "opcode" : 45, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minVal'" }, + { "kind" : "IdRef", "name" : "'maxVal'" } + ] + }, + { + "opname" : "FMix", + "opcode" : 46, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'a'" } + ] + }, + { + "opname" : "IMix", + "opcode" : 47, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'a'" } + ] + }, + { + "opname" : "Step", + "opcode" : 48, + "operands" : [ + { "kind" : "IdRef", "name" : "'edge'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "SmoothStep", + "opcode" : 49, + "operands" : [ + { "kind" : "IdRef", "name" : "'edge0'" }, + { "kind" : "IdRef", "name" : "'edge1'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Fma", + "opcode" : 50, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "Frexp", + "opcode" : 51, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'exp'" } + ] + }, + { + "opname" : "FrexpStruct", + "opcode" : 52, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Ldexp", + "opcode" : 53, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'exp'" } + ] + }, + { + "opname" : "PackSnorm4x8", + "opcode" : 54, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackUnorm4x8", + "opcode" : 55, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackSnorm2x16", + "opcode" : 56, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackUnorm2x16", + "opcode" : 57, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackHalf2x16", + "opcode" : 58, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackDouble2x32", + "opcode" : 59, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ], + "capabilities" : [ "Float64" ] + }, + { + "opname" : "UnpackSnorm2x16", + "opcode" : 60, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "UnpackUnorm2x16", + "opcode" : 61, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "UnpackHalf2x16", + "opcode" : 62, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "UnpackSnorm4x8", + "opcode" : 63, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "UnpackUnorm4x8", + "opcode" : 64, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "UnpackDouble2x32", + "opcode" : 65, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ], + "capabilities" : [ "Float64" ] + }, + { + "opname" : "Length", + "opcode" : 66, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Distance", + "opcode" : 67, + "operands" : [ + { "kind" : "IdRef", "name" : "'p0'" }, + { "kind" : "IdRef", "name" : "'p1'" } + ] + }, + { + "opname" : "Cross", + "opcode" : 68, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "Normalize", + "opcode" : 69, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "FaceForward", + "opcode" : 70, + "operands" : [ + { "kind" : "IdRef", "name" : "'N'" }, + { "kind" : "IdRef", "name" : "'I'" }, + { "kind" : "IdRef", "name" : "'Nref'" } + ] + }, + { + "opname" : "Reflect", + "opcode" : 71, + "operands" : [ + { "kind" : "IdRef", "name" : "'I'" }, + { "kind" : "IdRef", "name" : "'N'" } + ] + }, + { + "opname" : "Refract", + "opcode" : 72, + "operands" : [ + { "kind" : "IdRef", "name" : "'I'" }, + { "kind" : "IdRef", "name" : "'N'" }, + { "kind" : "IdRef", "name" : "'eta'" } + ] + }, + { + "opname" : "FindILsb", + "opcode" : 73, + "operands" : [ + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "FindSMsb", + "opcode" : 74, + "operands" : [ + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "FindUMsb", + "opcode" : 75, + "operands" : [ + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "InterpolateAtCentroid", + "opcode" : 76, + "operands" : [ + { "kind" : "IdRef", "name" : "'interpolant'" } + ], + "capabilities" : [ "InterpolationFunction" ] + }, + { + "opname" : "InterpolateAtSample", + "opcode" : 77, + "operands" : [ + { "kind" : "IdRef", "name" : "'interpolant'" }, + { "kind" : "IdRef", "name" : "'sample'" } + ], + "capabilities" : [ "InterpolationFunction" ] + }, + { + "opname" : "InterpolateAtOffset", + "opcode" : 78, + "operands" : [ + { "kind" : "IdRef", "name" : "'interpolant'" }, + { "kind" : "IdRef", "name" : "'offset'" } + ], + "capabilities" : [ "InterpolationFunction" ] + }, + { + "opname" : "NMin", + "opcode" : 79, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "NMax", + "opcode" : 80, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "NClamp", + "opcode" : 81, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minVal'" }, + { "kind" : "IdRef", "name" : "'maxVal'" } + ] + } + ] +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/extinst.opencl.std.100.grammar.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/extinst.opencl.std.100.grammar.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/extinst.opencl.std.100.grammar.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/extinst.opencl.std.100.grammar.json 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1279 @@ +{ + "copyright" : [ + "Copyright (c) 2014-2016 The Khronos Group Inc.", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and/or associated documentation files (the \"Materials\"),", + "to deal in the Materials without restriction, including without limitation", + "the rights to use, copy, modify, merge, publish, distribute, sublicense,", + "and/or sell copies of the Materials, and to permit persons to whom the", + "Materials are furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Materials.", + "", + "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", + "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", + "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", + "", + "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", + "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", + "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", + "IN THE MATERIALS." + ], + "version" : 100, + "revision" : 2, + "instructions" : [ + { + "opname" : "acos", + "opcode" : 0, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "acosh", + "opcode" : 1, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "acospi", + "opcode" : 2, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "asin", + "opcode" : 3, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "asinh", + "opcode" : 4, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "asinpi", + "opcode" : 5, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atan", + "opcode" : 6, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atan2", + "opcode" : 7, + "operands" : [ + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atanh", + "opcode" : 8, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atanpi", + "opcode" : 9, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atan2pi", + "opcode" : 10, + "operands" : [ + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "cbrt", + "opcode" : 11, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "ceil", + "opcode" : 12, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "copysign", + "opcode" : 13, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "cos", + "opcode" : 14, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "cosh", + "opcode" : 15, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "cospi", + "opcode" : 16, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "erfc", + "opcode" : 17, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "erf", + "opcode" : 18, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "exp", + "opcode" : 19, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "exp2", + "opcode" : 20, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "exp10", + "opcode" : 21, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "expm1", + "opcode" : 22, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "fabs", + "opcode" : 23, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "fdim", + "opcode" : 24, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "floor", + "opcode" : 25, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "fma", + "opcode" : 26, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "fmax", + "opcode" : 27, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "fmin", + "opcode" : 28, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "fmod", + "opcode" : 29, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "fract", + "opcode" : 30, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'ptr'" } + ] + }, + { + "opname" : "frexp", + "opcode" : 31, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'exp'" } + ] + }, + { + "opname" : "hypot", + "opcode" : 32, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "ilogb", + "opcode" : 33, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "ldexp", + "opcode" : 34, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'k'" } + ] + }, + { + "opname" : "lgamma", + "opcode" : 35, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "lgamma_r", + "opcode" : 36, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'signp'" } + ] + }, + { + "opname" : "log", + "opcode" : 37, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "log2", + "opcode" : 38, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "log10", + "opcode" : 39, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "log1p", + "opcode" : 40, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "logb", + "opcode" : 41, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "mad", + "opcode" : 42, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "maxmag", + "opcode" : 43, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "minmag", + "opcode" : 44, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "modf", + "opcode" : 45, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'iptr'" } + ] + }, + { + "opname" : "nan", + "opcode" : 46, + "operands" : [ + { "kind" : "IdRef", "name" : "'nancode'" } + ] + }, + { + "opname" : "nextafter", + "opcode" : 47, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "pow", + "opcode" : 48, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y" } + ] + }, + { + "opname" : "pown", + "opcode" : 49, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "powr", + "opcode" : 50, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "remainder", + "opcode" : 51, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "remquo", + "opcode" : 52, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'quo'" } + ] + }, + { + "opname" : "rint", + "opcode" : 53, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "rootn", + "opcode" : 54, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "round", + "opcode" : 55, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "rsqrt", + "opcode" : 56, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sin", + "opcode" : 57, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sincos", + "opcode" : 58, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'cosval'" } + ] + }, + { + "opname" : "sinh", + "opcode" : 59, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sinpi", + "opcode" : 60, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sqrt", + "opcode" : 61, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "tan", + "opcode" : 62, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "tanh", + "opcode" : 63, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "tanpi", + "opcode" : 64, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "tgamma", + "opcode" : 65, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "trunc", + "opcode" : 66, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_cos", + "opcode" : 67, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_divide", + "opcode" : 68, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "half_exp", + "opcode" : 69, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_exp2", + "opcode" : 70, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_exp10", + "opcode" : 71, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_log", + "opcode" : 72, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_log2", + "opcode" : 73, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_log10", + "opcode" : 74, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_powr", + "opcode" : 75, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "half_recip", + "opcode" : 76, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_rsqrt", + "opcode" : 77, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_sin", + "opcode" : 78, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_sqrt", + "opcode" : 79, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_tan", + "opcode" : 80, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_cos", + "opcode" : 81, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_divide", + "opcode" : 82, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "native_exp", + "opcode" : 83, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_exp2", + "opcode" : 84, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_exp10", + "opcode" : 85, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_log", + "opcode" : 86, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_log2", + "opcode" : 87, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_log10", + "opcode" : 88, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_powr", + "opcode" : 89, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "native_recip", + "opcode" : 90, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_rsqrt", + "opcode" : 91, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_sin", + "opcode" : 92, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_sqrt", + "opcode" : 93, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_tan", + "opcode" : 94, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "s_abs", + "opcode" : 141, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "s_abs_diff", + "opcode" : 142, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_add_sat", + "opcode" : 143, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_add_sat", + "opcode" : 144, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_hadd", + "opcode" : 145, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_hadd", + "opcode" : 146, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_rhadd", + "opcode" : 147, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_rhadd", + "opcode" : 148, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_clamp", + "opcode" : 149, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minval'" }, + { "kind" : "IdRef", "name" : "'maxval'" } + ] + }, + { + "opname" : "u_clamp", + "opcode" : 150, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minval'" }, + { "kind" : "IdRef", "name" : "'maxval'" } + ] + }, + { + "opname" : "clz", + "opcode" : 151, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "ctz", + "opcode" : 152, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "s_mad_hi", + "opcode" : 153, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "u_mad_sat", + "opcode" : 154, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ] + }, + { + "opname" : "s_mad_sat", + "opcode" : 155, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ] + }, + { + "opname" : "s_max", + "opcode" : 156, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_max", + "opcode" : 157, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_min", + "opcode" : 158, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_min", + "opcode" : 159, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_mul_hi", + "opcode" : 160, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "rotate", + "opcode" : 161, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" }, + { "kind" : "IdRef", "name" : "'i'" } + ] + }, + { + "opname" : "s_sub_sat", + "opcode" : 162, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_sub_sat", + "opcode" : 163, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_upsample", + "opcode" : 164, + "operands" : [ + { "kind" : "IdRef", "name" : "'hi'" }, + { "kind" : "IdRef", "name" : "'lo'" } + ] + }, + { + "opname" : "s_upsample", + "opcode" : 165, + "operands" : [ + { "kind" : "IdRef", "name" : "'hi'" }, + { "kind" : "IdRef", "name" : "'lo'" } + ] + }, + { + "opname" : "popcount", + "opcode" : 166, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "s_mad24", + "opcode" : 167, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ] + }, + { + "opname" : "u_mad24", + "opcode" : 168, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ] + }, + { + "opname" : "s_mul24", + "opcode" : 169, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_mul24", + "opcode" : 170, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_abs", + "opcode" : 201, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "u_abs_diff", + "opcode" : 202, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_mul_hi", + "opcode" : 203, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_mad_hi", + "opcode" : 204, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "fclamp", + "opcode" : 95, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minval'" }, + { "kind" : "IdRef", "name" : "'maxval'" } + ] + }, + { + "opname" : "degrees", + "opcode" :96, + "operands" : [ + { "kind" : "IdRef", "name" : "'radians'" } + ] + }, + { + "opname" : "fmax_common", + "opcode" : 97, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "fmin_common", + "opcode" : 98, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "mix", + "opcode" : 99, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'a'" } + ] + }, + { + "opname" : "radians", + "opcode" : 100, + "operands" : [ + { "kind" : "IdRef", "name" : "'degrees'" } + ] + }, + { + "opname" : "step", + "opcode" : 101, + "operands" : [ + { "kind" : "IdRef", "name" : "'edge'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "smoothstep", + "opcode" : 102, + "operands" : [ + { "kind" : "IdRef", "name" : "'edge0'" }, + { "kind" : "IdRef", "name" : "'edge1'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sign", + "opcode" : 103, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "cross", + "opcode" : 104, + "operands" : [ + { "kind" : "IdRef", "name" : "'p0'" }, + { "kind" : "IdRef", "name" : "'p1'" } + ] + }, + { + "opname" : "distance", + "opcode" : 105, + "operands" : [ + { "kind" : "IdRef", "name" : "'p0'" }, + { "kind" : "IdRef", "name" : "'p1'" } + ] + }, + { + "opname" : "length", + "opcode" : 106, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "normalize", + "opcode" : 107, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "fast_distance", + "opcode" : 108, + "operands" : [ + { "kind" : "IdRef", "name" : "'p0'" }, + { "kind" : "IdRef", "name" : "'p1'" } + ] + }, + { + "opname" : "fast_length", + "opcode" : 109, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "fast_normalize", + "opcode" : 110, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "bitselect", + "opcode" : 186, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "select", + "opcode" : 187, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "vloadn", + "opcode" : 171, + "operands" : [ + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "LiteralInteger", "name" : "'n'" } + ] + }, + { + "opname" : "vstoren", + "opcode" : 172, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vload_half", + "opcode" : 173, + "operands" : [ + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vload_halfn", + "opcode" : 174, + "operands" : [ + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "LiteralInteger", "name" : "'n'" } + ] + }, + { + "opname" : "vstore_half", + "opcode" : 175, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vstore_half_r", + "opcode" : 176, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "FPRoundingMode", "name" : "'mode'" } + ] + }, + { + "opname" : "vstore_halfn", + "opcode" : 177, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vstore_halfn_r", + "opcode" : 178, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "FPRoundingMode", "name" : "'mode'" } + ] + }, + { + "opname" : "vloada_halfn", + "opcode" : 179, + "operands" : [ + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "LiteralInteger", "name" : "'n'" } + ] + }, + { + "opname" : "vstorea_halfn", + "opcode" : 180, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vstorea_halfn_r", + "opcode" : 181, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "FPRoundingMode", "name" : "'mode'" } + ] + }, + { + "opname" : "shuffle", + "opcode" : 182, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'shuffle mask'" } + ] + }, + { + "opname" : "shuffle2", + "opcode" : 183, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'shuffle mask'" } + ] + }, + { + "opname" : "printf", + "opcode" : 184, + "operands" : [ + { "kind" : "IdRef", "name" : "'format'" }, + { "kind" : "IdRef", "name" : "'additional arguments'", "quantifier" : "*" } + ] + }, + { + "opname" : "prefetch", + "opcode" : 185, + "operands" : [ + { "kind" : "IdRef", "name" : "'ptr'" }, + { "kind" : "IdRef", "name" : "'num elements'" } + ] + } + ] +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/GLSL.std.450.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/GLSL.std.450.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/GLSL.std.450.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/GLSL.std.450.h 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,131 @@ +/* +** Copyright (c) 2014-2016 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +#ifndef GLSLstd450_H +#define GLSLstd450_H + +static const int GLSLstd450Version = 100; +static const int GLSLstd450Revision = 3; + +enum GLSLstd450 { + GLSLstd450Bad = 0, // Don't use + + GLSLstd450Round = 1, + GLSLstd450RoundEven = 2, + GLSLstd450Trunc = 3, + GLSLstd450FAbs = 4, + GLSLstd450SAbs = 5, + GLSLstd450FSign = 6, + GLSLstd450SSign = 7, + GLSLstd450Floor = 8, + GLSLstd450Ceil = 9, + GLSLstd450Fract = 10, + + GLSLstd450Radians = 11, + GLSLstd450Degrees = 12, + GLSLstd450Sin = 13, + GLSLstd450Cos = 14, + GLSLstd450Tan = 15, + GLSLstd450Asin = 16, + GLSLstd450Acos = 17, + GLSLstd450Atan = 18, + GLSLstd450Sinh = 19, + GLSLstd450Cosh = 20, + GLSLstd450Tanh = 21, + GLSLstd450Asinh = 22, + GLSLstd450Acosh = 23, + GLSLstd450Atanh = 24, + GLSLstd450Atan2 = 25, + + GLSLstd450Pow = 26, + GLSLstd450Exp = 27, + GLSLstd450Log = 28, + GLSLstd450Exp2 = 29, + GLSLstd450Log2 = 30, + GLSLstd450Sqrt = 31, + GLSLstd450InverseSqrt = 32, + + GLSLstd450Determinant = 33, + GLSLstd450MatrixInverse = 34, + + GLSLstd450Modf = 35, // second operand needs an OpVariable to write to + GLSLstd450ModfStruct = 36, // no OpVariable operand + GLSLstd450FMin = 37, + GLSLstd450UMin = 38, + GLSLstd450SMin = 39, + GLSLstd450FMax = 40, + GLSLstd450UMax = 41, + GLSLstd450SMax = 42, + GLSLstd450FClamp = 43, + GLSLstd450UClamp = 44, + GLSLstd450SClamp = 45, + GLSLstd450FMix = 46, + GLSLstd450IMix = 47, // Reserved + GLSLstd450Step = 48, + GLSLstd450SmoothStep = 49, + + GLSLstd450Fma = 50, + GLSLstd450Frexp = 51, // second operand needs an OpVariable to write to + GLSLstd450FrexpStruct = 52, // no OpVariable operand + GLSLstd450Ldexp = 53, + + GLSLstd450PackSnorm4x8 = 54, + GLSLstd450PackUnorm4x8 = 55, + GLSLstd450PackSnorm2x16 = 56, + GLSLstd450PackUnorm2x16 = 57, + GLSLstd450PackHalf2x16 = 58, + GLSLstd450PackDouble2x32 = 59, + GLSLstd450UnpackSnorm2x16 = 60, + GLSLstd450UnpackUnorm2x16 = 61, + GLSLstd450UnpackHalf2x16 = 62, + GLSLstd450UnpackSnorm4x8 = 63, + GLSLstd450UnpackUnorm4x8 = 64, + GLSLstd450UnpackDouble2x32 = 65, + + GLSLstd450Length = 66, + GLSLstd450Distance = 67, + GLSLstd450Cross = 68, + GLSLstd450Normalize = 69, + GLSLstd450FaceForward = 70, + GLSLstd450Reflect = 71, + GLSLstd450Refract = 72, + + GLSLstd450FindILsb = 73, + GLSLstd450FindSMsb = 74, + GLSLstd450FindUMsb = 75, + + GLSLstd450InterpolateAtCentroid = 76, + GLSLstd450InterpolateAtSample = 77, + GLSLstd450InterpolateAtOffset = 78, + + GLSLstd450NMin = 79, + GLSLstd450NMax = 80, + GLSLstd450NClamp = 81, + + GLSLstd450Count +}; + +#endif // #ifndef GLSLstd450_H diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/OpenCL.std.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/OpenCL.std.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/OpenCL.std.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/OpenCL.std.h 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,210 @@ +/* +** Copyright (c) 2015-2017 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +namespace OpenCLLIB { + +enum Entrypoints { + + // Section 2.1: Math extended instructions + Acos = 0, + Acosh = 1, + Acospi = 2, + Asin = 3, + Asinh = 4, + Asinpi = 5, + Atan = 6, + Atan2 = 7, + Atanh = 8, + Atanpi = 9, + Atan2pi = 10, + Cbrt = 11, + Ceil = 12, + Copysign = 13, + Cos = 14, + Cosh = 15, + Cospi = 16, + Erfc = 17, + Erf = 18, + Exp = 19, + Exp2 = 20, + Exp10 = 21, + Expm1 = 22, + Fabs = 23, + Fdim = 24, + Floor = 25, + Fma = 26, + Fmax = 27, + Fmin = 28, + Fmod = 29, + Fract = 30, + Frexp = 31, + Hypot = 32, + Ilogb = 33, + Ldexp = 34, + Lgamma = 35, + Lgamma_r = 36, + Log = 37, + Log2 = 38, + Log10 = 39, + Log1p = 40, + Logb = 41, + Mad = 42, + Maxmag = 43, + Minmag = 44, + Modf = 45, + Nan = 46, + Nextafter = 47, + Pow = 48, + Pown = 49, + Powr = 50, + Remainder = 51, + Remquo = 52, + Rint = 53, + Rootn = 54, + Round = 55, + Rsqrt = 56, + Sin = 57, + Sincos = 58, + Sinh = 59, + Sinpi = 60, + Sqrt = 61, + Tan = 62, + Tanh = 63, + Tanpi = 64, + Tgamma = 65, + Trunc = 66, + Half_cos = 67, + Half_divide = 68, + Half_exp = 69, + Half_exp2 = 70, + Half_exp10 = 71, + Half_log = 72, + Half_log2 = 73, + Half_log10 = 74, + Half_powr = 75, + Half_recip = 76, + Half_rsqrt = 77, + Half_sin = 78, + Half_sqrt = 79, + Half_tan = 80, + Native_cos = 81, + Native_divide = 82, + Native_exp = 83, + Native_exp2 = 84, + Native_exp10 = 85, + Native_log = 86, + Native_log2 = 87, + Native_log10 = 88, + Native_powr = 89, + Native_recip = 90, + Native_rsqrt = 91, + Native_sin = 92, + Native_sqrt = 93, + Native_tan = 94, + + // Section 2.2: Integer instructions + SAbs = 141, + SAbs_diff = 142, + SAdd_sat = 143, + UAdd_sat = 144, + SHadd = 145, + UHadd = 146, + SRhadd = 147, + URhadd = 148, + SClamp = 149, + UClamp = 150, + Clz = 151, + Ctz = 152, + SMad_hi = 153, + UMad_sat = 154, + SMad_sat = 155, + SMax = 156, + UMax = 157, + SMin = 158, + UMin = 159, + SMul_hi = 160, + Rotate = 161, + SSub_sat = 162, + USub_sat = 163, + U_Upsample = 164, + S_Upsample = 165, + Popcount = 166, + SMad24 = 167, + UMad24 = 168, + SMul24 = 169, + UMul24 = 170, + UAbs = 201, + UAbs_diff = 202, + UMul_hi = 203, + UMad_hi = 204, + + // Section 2.3: Common instructions + FClamp = 95, + Degrees = 96, + FMax_common = 97, + FMin_common = 98, + Mix = 99, + Radians = 100, + Step = 101, + Smoothstep = 102, + Sign = 103, + + // Section 2.4: Geometric instructions + Cross = 104, + Distance = 105, + Length = 106, + Normalize = 107, + Fast_distance = 108, + Fast_length = 109, + Fast_normalize = 110, + + // Section 2.5: Relational instructions + Bitselect = 186, + Select = 187, + + // Section 2.6: Vector Data Load and Store instructions + Vloadn = 171, + Vstoren = 172, + Vload_half = 173, + Vload_halfn = 174, + Vstore_half = 175, + Vstore_half_r = 176, + Vstore_halfn = 177, + Vstore_halfn_r = 178, + Vloada_halfn = 179, + Vstorea_halfn = 180, + Vstorea_halfn_r = 181, + + // Section 2.7: Miscellaneous Vector instructions + Shuffle = 182, + Shuffle2 = 183, + + // Section 2.8: Misc instructions + Printf = 184, + Prefetch = 185, +}; + +} // end namespace OpenCLLIB diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.core.grammar.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.core.grammar.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.core.grammar.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.core.grammar.json 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,5775 @@ +{ + "copyright" : [ + "Copyright (c) 2014-2016 The Khronos Group Inc.", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and/or associated documentation files (the \"Materials\"),", + "to deal in the Materials without restriction, including without limitation", + "the rights to use, copy, modify, merge, publish, distribute, sublicense,", + "and/or sell copies of the Materials, and to permit persons to whom the", + "Materials are furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Materials.", + "", + "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", + "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", + "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", + "", + "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", + "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", + "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", + "IN THE MATERIALS." + ], + "magic_number" : "0x07230203", + "major_version" : 1, + "minor_version" : 0, + "revision" : 12, + "instructions" : [ + { + "opname" : "OpNop", + "opcode" : 0 + }, + { + "opname" : "OpUndef", + "opcode" : 1, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpSourceContinued", + "opcode" : 2, + "operands" : [ + { "kind" : "LiteralString", "name" : "'Continued Source'" } + ] + }, + { + "opname" : "OpSource", + "opcode" : 3, + "operands" : [ + { "kind" : "SourceLanguage" }, + { "kind" : "LiteralInteger", "name" : "'Version'" }, + { "kind" : "IdRef", "quantifier" : "?", "name" : "'File'" }, + { "kind" : "LiteralString", "quantifier" : "?", "name" : "'Source'" } + ] + }, + { + "opname" : "OpSourceExtension", + "opcode" : 4, + "operands" : [ + { "kind" : "LiteralString", "name" : "'Extension'" } + ] + }, + { + "opname" : "OpName", + "opcode" : 5, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "LiteralString", "name" : "'Name'" } + ] + }, + { + "opname" : "OpMemberName", + "opcode" : 6, + "operands" : [ + { "kind" : "IdRef", "name" : "'Type'" }, + { "kind" : "LiteralInteger", "name" : "'Member'" }, + { "kind" : "LiteralString", "name" : "'Name'" } + ] + }, + { + "opname" : "OpString", + "opcode" : 7, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralString", "name" : "'String'" } + ] + }, + { + "opname" : "OpLine", + "opcode" : 8, + "operands" : [ + { "kind" : "IdRef", "name" : "'File'" }, + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "LiteralInteger", "name" : "'Column'" } + ] + }, + { + "opname" : "OpExtension", + "opcode" : 10, + "operands" : [ + { "kind" : "LiteralString", "name" : "'Name'" } + ] + }, + { + "opname" : "OpExtInstImport", + "opcode" : 11, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralString", "name" : "'Name'" } + ] + }, + { + "opname" : "OpExtInst", + "opcode" : 12, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Set'" }, + { "kind" : "LiteralExtInstInteger", "name" : "'Instruction'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Operand 1', +\n'Operand 2', +\n..." } + ] + }, + { + "opname" : "OpMemoryModel", + "opcode" : 14, + "operands" : [ + { "kind" : "AddressingModel" }, + { "kind" : "MemoryModel" } + ] + }, + { + "opname" : "OpEntryPoint", + "opcode" : 15, + "operands" : [ + { "kind" : "ExecutionModel" }, + { "kind" : "IdRef", "name" : "'Entry Point'" }, + { "kind" : "LiteralString", "name" : "'Name'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Interface'" } + ] + }, + { + "opname" : "OpExecutionMode", + "opcode" : 16, + "operands" : [ + { "kind" : "IdRef", "name" : "'Entry Point'" }, + { "kind" : "ExecutionMode", "name" : "'Mode'" } + ] + }, + { + "opname" : "OpCapability", + "opcode" : 17, + "operands" : [ + { "kind" : "Capability", "name" : "'Capability'" } + ] + }, + { + "opname" : "OpTypeVoid", + "opcode" : 19, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpTypeBool", + "opcode" : 20, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpTypeInt", + "opcode" : 21, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralInteger", "name" : "'Width'" }, + { "kind" : "LiteralInteger", "name" : "'Signedness'" } + ] + }, + { + "opname" : "OpTypeFloat", + "opcode" : 22, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralInteger", "name" : "'Width'" } + ] + }, + { + "opname" : "OpTypeVector", + "opcode" : 23, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Component Type'" }, + { "kind" : "LiteralInteger", "name" : "'Component Count'" } + ] + }, + { + "opname" : "OpTypeMatrix", + "opcode" : 24, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Column Type'" }, + { "kind" : "LiteralInteger", "name" : "'Column Count'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpTypeImage", + "opcode" : 25, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Type'" }, + { "kind" : "Dim" }, + { "kind" : "LiteralInteger", "name" : "'Depth'" }, + { "kind" : "LiteralInteger", "name" : "'Arrayed'" }, + { "kind" : "LiteralInteger", "name" : "'MS'" }, + { "kind" : "LiteralInteger", "name" : "'Sampled'" }, + { "kind" : "ImageFormat" }, + { "kind" : "AccessQualifier", "quantifier" : "?" } + ] + }, + { + "opname" : "OpTypeSampler", + "opcode" : 26, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpTypeSampledImage", + "opcode" : 27, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image Type'" } + ] + }, + { + "opname" : "OpTypeArray", + "opcode" : 28, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Element Type'" }, + { "kind" : "IdRef", "name" : "'Length'" } + ] + }, + { + "opname" : "OpTypeRuntimeArray", + "opcode" : 29, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Element Type'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpTypeStruct", + "opcode" : 30, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Member 0 type', +\n'member 1 type', +\n..." } + ] + }, + { + "opname" : "OpTypeOpaque", + "opcode" : 31, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralString", "name" : "The name of the opaque type." } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpTypePointer", + "opcode" : 32, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "StorageClass" }, + { "kind" : "IdRef", "name" : "'Type'" } + ] + }, + { + "opname" : "OpTypeFunction", + "opcode" : 33, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Return Type'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Parameter 0 Type', +\n'Parameter 1 Type', +\n..." } + ] + }, + { + "opname" : "OpTypeEvent", + "opcode" : 34, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpTypeDeviceEvent", + "opcode" : 35, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpTypeReserveId", + "opcode" : 36, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpTypeQueue", + "opcode" : 37, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpTypePipe", + "opcode" : 38, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "AccessQualifier", "name" : "'Qualifier'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpTypeForwardPointer", + "opcode" : 39, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer Type'" }, + { "kind" : "StorageClass" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpConstantTrue", + "opcode" : 41, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpConstantFalse", + "opcode" : 42, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpConstant", + "opcode" : 43, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } + ] + }, + { + "opname" : "OpConstantComposite", + "opcode" : 44, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } + ] + }, + { + "opname" : "OpConstantSampler", + "opcode" : 45, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "SamplerAddressingMode" }, + { "kind" : "LiteralInteger", "name" : "'Param'" }, + { "kind" : "SamplerFilterMode" } + ], + "capabilities" : [ "LiteralSampler" ] + }, + { + "opname" : "OpConstantNull", + "opcode" : 46, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpSpecConstantTrue", + "opcode" : 48, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpSpecConstantFalse", + "opcode" : 49, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpSpecConstant", + "opcode" : 50, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } + ] + }, + { + "opname" : "OpSpecConstantComposite", + "opcode" : 51, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } + ] + }, + { + "opname" : "OpSpecConstantOp", + "opcode" : 52, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "LiteralSpecConstantOpInteger", "name" : "'Opcode'" } + ] + }, + { + "opname" : "OpFunction", + "opcode" : 54, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "FunctionControl" }, + { "kind" : "IdRef", "name" : "'Function Type'" } + ] + }, + { + "opname" : "OpFunctionParameter", + "opcode" : 55, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpFunctionEnd", + "opcode" : 56 + }, + { + "opname" : "OpFunctionCall", + "opcode" : 57, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Function'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Argument 0', +\n'Argument 1', +\n..." } + ] + }, + { + "opname" : "OpVariable", + "opcode" : 59, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "StorageClass" }, + { "kind" : "IdRef", "quantifier" : "?", "name" : "'Initializer'" } + ] + }, + { + "opname" : "OpImageTexelPointer", + "opcode" : 60, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Sample'" } + ] + }, + { + "opname" : "OpLoad", + "opcode" : 61, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "MemoryAccess", "quantifier" : "?" } + ] + }, + { + "opname" : "OpStore", + "opcode" : 62, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Object'" }, + { "kind" : "MemoryAccess", "quantifier" : "?" } + ] + }, + { + "opname" : "OpCopyMemory", + "opcode" : 63, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "MemoryAccess", "quantifier" : "?" } + ] + }, + { + "opname" : "OpCopyMemorySized", + "opcode" : 64, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "IdRef", "name" : "'Size'" }, + { "kind" : "MemoryAccess", "quantifier" : "?" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpAccessChain", + "opcode" : 65, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpInBoundsAccessChain", + "opcode" : 66, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpPtrAccessChain", + "opcode" : 67, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Element'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ], + "capabilities" : [ + "Addresses", + "VariablePointers", + "VariablePointersStorageBuffer" + ] + }, + { + "opname" : "OpArrayLength", + "opcode" : 68, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Structure'" }, + { "kind" : "LiteralInteger", "name" : "'Array member'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpGenericPtrMemSemantics", + "opcode" : 69, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpInBoundsPtrAccessChain", + "opcode" : 70, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Element'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpDecorate", + "opcode" : 71, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "Decoration" } + ] + }, + { + "opname" : "OpMemberDecorate", + "opcode" : 72, + "operands" : [ + { "kind" : "IdRef", "name" : "'Structure Type'" }, + { "kind" : "LiteralInteger", "name" : "'Member'" }, + { "kind" : "Decoration" } + ] + }, + { + "opname" : "OpDecorationGroup", + "opcode" : 73, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpGroupDecorate", + "opcode" : 74, + "operands" : [ + { "kind" : "IdRef", "name" : "'Decoration Group'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Targets'" } + ] + }, + { + "opname" : "OpGroupMemberDecorate", + "opcode" : 75, + "operands" : [ + { "kind" : "IdRef", "name" : "'Decoration Group'" }, + { "kind" : "PairIdRefLiteralInteger", "quantifier" : "*", "name" : "'Targets'" } + ] + }, + { + "opname" : "OpVectorExtractDynamic", + "opcode" : 77, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" }, + { "kind" : "IdRef", "name" : "'Index'" } + ] + }, + { + "opname" : "OpVectorInsertDynamic", + "opcode" : 78, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" }, + { "kind" : "IdRef", "name" : "'Component'" }, + { "kind" : "IdRef", "name" : "'Index'" } + ] + }, + { + "opname" : "OpVectorShuffle", + "opcode" : 79, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector 1'" }, + { "kind" : "IdRef", "name" : "'Vector 2'" }, + { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Components'" } + ] + }, + { + "opname" : "OpCompositeConstruct", + "opcode" : 80, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } + ] + }, + { + "opname" : "OpCompositeExtract", + "opcode" : 81, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Composite'" }, + { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpCompositeInsert", + "opcode" : 82, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Object'" }, + { "kind" : "IdRef", "name" : "'Composite'" }, + { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpCopyObject", + "opcode" : 83, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpTranspose", + "opcode" : 84, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Matrix'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpSampledImage", + "opcode" : 86, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Sampler'" } + ] + }, + { + "opname" : "OpImageSampleImplicitLod", + "opcode" : 87, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleExplicitLod", + "opcode" : 88, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands" } + ] + }, + { + "opname" : "OpImageSampleDrefImplicitLod", + "opcode" : 89, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleDrefExplicitLod", + "opcode" : 90, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleProjImplicitLod", + "opcode" : 91, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleProjExplicitLod", + "opcode" : 92, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleProjDrefImplicitLod", + "opcode" : 93, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleProjDrefExplicitLod", + "opcode" : 94, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageFetch", + "opcode" : 95, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ] + }, + { + "opname" : "OpImageGather", + "opcode" : 96, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Component'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageDrefGather", + "opcode" : 97, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageRead", + "opcode" : 98, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ] + }, + { + "opname" : "OpImageWrite", + "opcode" : 99, + "operands" : [ + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Texel'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ] + }, + { + "opname" : "OpImage", + "opcode" : 100, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" } + ] + }, + { + "opname" : "OpImageQueryFormat", + "opcode" : 101, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpImageQueryOrder", + "opcode" : 102, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpImageQuerySizeLod", + "opcode" : 103, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Level of Detail'" } + ], + "capabilities" : [ "Kernel", "ImageQuery" ] + }, + { + "opname" : "OpImageQuerySize", + "opcode" : 104, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel", "ImageQuery" ] + }, + { + "opname" : "OpImageQueryLod", + "opcode" : 105, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" } + ], + "capabilities" : [ "ImageQuery" ] + }, + { + "opname" : "OpImageQueryLevels", + "opcode" : 106, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel", "ImageQuery" ] + }, + { + "opname" : "OpImageQuerySamples", + "opcode" : 107, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel", "ImageQuery" ] + }, + { + "opname" : "OpConvertFToU", + "opcode" : 109, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Float Value'" } + ] + }, + { + "opname" : "OpConvertFToS", + "opcode" : 110, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Float Value'" } + ] + }, + { + "opname" : "OpConvertSToF", + "opcode" : 111, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Signed Value'" } + ] + }, + { + "opname" : "OpConvertUToF", + "opcode" : 112, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Unsigned Value'" } + ] + }, + { + "opname" : "OpUConvert", + "opcode" : 113, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Unsigned Value'" } + ] + }, + { + "opname" : "OpSConvert", + "opcode" : 114, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Signed Value'" } + ] + }, + { + "opname" : "OpFConvert", + "opcode" : 115, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Float Value'" } + ] + }, + { + "opname" : "OpQuantizeToF16", + "opcode" : 116, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpConvertPtrToU", + "opcode" : 117, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpSatConvertSToU", + "opcode" : 118, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Signed Value'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpSatConvertUToS", + "opcode" : 119, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Unsigned Value'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpConvertUToPtr", + "opcode" : 120, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Integer Value'" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpPtrCastToGeneric", + "opcode" : 121, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGenericCastToPtr", + "opcode" : 122, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGenericCastToPtrExplicit", + "opcode" : 123, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "StorageClass", "name" : "'Storage'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpBitcast", + "opcode" : 124, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpSNegate", + "opcode" : 126, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpFNegate", + "opcode" : 127, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpIAdd", + "opcode" : 128, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFAdd", + "opcode" : 129, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpISub", + "opcode" : 130, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFSub", + "opcode" : 131, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpIMul", + "opcode" : 132, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFMul", + "opcode" : 133, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUDiv", + "opcode" : 134, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSDiv", + "opcode" : 135, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFDiv", + "opcode" : 136, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUMod", + "opcode" : 137, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSRem", + "opcode" : 138, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSMod", + "opcode" : 139, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFRem", + "opcode" : 140, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFMod", + "opcode" : 141, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpVectorTimesScalar", + "opcode" : 142, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" }, + { "kind" : "IdRef", "name" : "'Scalar'" } + ] + }, + { + "opname" : "OpMatrixTimesScalar", + "opcode" : 143, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Matrix'" }, + { "kind" : "IdRef", "name" : "'Scalar'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpVectorTimesMatrix", + "opcode" : 144, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" }, + { "kind" : "IdRef", "name" : "'Matrix'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpMatrixTimesVector", + "opcode" : 145, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Matrix'" }, + { "kind" : "IdRef", "name" : "'Vector'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpMatrixTimesMatrix", + "opcode" : 146, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'LeftMatrix'" }, + { "kind" : "IdRef", "name" : "'RightMatrix'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpOuterProduct", + "opcode" : 147, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector 1'" }, + { "kind" : "IdRef", "name" : "'Vector 2'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpDot", + "opcode" : 148, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector 1'" }, + { "kind" : "IdRef", "name" : "'Vector 2'" } + ] + }, + { + "opname" : "OpIAddCarry", + "opcode" : 149, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpISubBorrow", + "opcode" : 150, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUMulExtended", + "opcode" : 151, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSMulExtended", + "opcode" : 152, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpAny", + "opcode" : 154, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" } + ] + }, + { + "opname" : "OpAll", + "opcode" : 155, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" } + ] + }, + { + "opname" : "OpIsNan", + "opcode" : 156, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "OpIsInf", + "opcode" : 157, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "OpIsFinite", + "opcode" : 158, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpIsNormal", + "opcode" : 159, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpSignBitSet", + "opcode" : 160, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpLessOrGreater", + "opcode" : 161, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpOrdered", + "opcode" : 162, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpUnordered", + "opcode" : 163, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpLogicalEqual", + "opcode" : 164, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpLogicalNotEqual", + "opcode" : 165, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpLogicalOr", + "opcode" : 166, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpLogicalAnd", + "opcode" : 167, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpLogicalNot", + "opcode" : 168, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpSelect", + "opcode" : 169, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Condition'" }, + { "kind" : "IdRef", "name" : "'Object 1'" }, + { "kind" : "IdRef", "name" : "'Object 2'" } + ] + }, + { + "opname" : "OpIEqual", + "opcode" : 170, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpINotEqual", + "opcode" : 171, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUGreaterThan", + "opcode" : 172, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSGreaterThan", + "opcode" : 173, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUGreaterThanEqual", + "opcode" : 174, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSGreaterThanEqual", + "opcode" : 175, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpULessThan", + "opcode" : 176, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSLessThan", + "opcode" : 177, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpULessThanEqual", + "opcode" : 178, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSLessThanEqual", + "opcode" : 179, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdEqual", + "opcode" : 180, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordEqual", + "opcode" : 181, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdNotEqual", + "opcode" : 182, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordNotEqual", + "opcode" : 183, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdLessThan", + "opcode" : 184, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordLessThan", + "opcode" : 185, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdGreaterThan", + "opcode" : 186, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordGreaterThan", + "opcode" : 187, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdLessThanEqual", + "opcode" : 188, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordLessThanEqual", + "opcode" : 189, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdGreaterThanEqual", + "opcode" : 190, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordGreaterThanEqual", + "opcode" : 191, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpShiftRightLogical", + "opcode" : 194, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Shift'" } + ] + }, + { + "opname" : "OpShiftRightArithmetic", + "opcode" : 195, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Shift'" } + ] + }, + { + "opname" : "OpShiftLeftLogical", + "opcode" : 196, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Shift'" } + ] + }, + { + "opname" : "OpBitwiseOr", + "opcode" : 197, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpBitwiseXor", + "opcode" : 198, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpBitwiseAnd", + "opcode" : 199, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpNot", + "opcode" : 200, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpBitFieldInsert", + "opcode" : 201, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Insert'" }, + { "kind" : "IdRef", "name" : "'Offset'" }, + { "kind" : "IdRef", "name" : "'Count'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpBitFieldSExtract", + "opcode" : 202, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Offset'" }, + { "kind" : "IdRef", "name" : "'Count'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpBitFieldUExtract", + "opcode" : 203, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Offset'" }, + { "kind" : "IdRef", "name" : "'Count'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpBitReverse", + "opcode" : 204, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpBitCount", + "opcode" : 205, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" } + ] + }, + { + "opname" : "OpDPdx", + "opcode" : 207, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpDPdy", + "opcode" : 208, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpFwidth", + "opcode" : 209, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpDPdxFine", + "opcode" : 210, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpDPdyFine", + "opcode" : 211, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpFwidthFine", + "opcode" : 212, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpDPdxCoarse", + "opcode" : 213, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpDPdyCoarse", + "opcode" : 214, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpFwidthCoarse", + "opcode" : 215, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpEmitVertex", + "opcode" : 218, + "capabilities" : [ "Geometry" ] + }, + { + "opname" : "OpEndPrimitive", + "opcode" : 219, + "capabilities" : [ "Geometry" ] + }, + { + "opname" : "OpEmitStreamVertex", + "opcode" : 220, + "operands" : [ + { "kind" : "IdRef", "name" : "'Stream'" } + ], + "capabilities" : [ "GeometryStreams" ] + }, + { + "opname" : "OpEndStreamPrimitive", + "opcode" : 221, + "operands" : [ + { "kind" : "IdRef", "name" : "'Stream'" } + ], + "capabilities" : [ "GeometryStreams" ] + }, + { + "opname" : "OpControlBarrier", + "opcode" : 224, + "operands" : [ + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdScope", "name" : "'Memory'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpMemoryBarrier", + "opcode" : 225, + "operands" : [ + { "kind" : "IdScope", "name" : "'Memory'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpAtomicLoad", + "opcode" : 227, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpAtomicStore", + "opcode" : 228, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicExchange", + "opcode" : 229, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicCompareExchange", + "opcode" : 230, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, + { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Comparator'" } + ] + }, + { + "opname" : "OpAtomicCompareExchangeWeak", + "opcode" : 231, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, + { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Comparator'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpAtomicIIncrement", + "opcode" : 232, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpAtomicIDecrement", + "opcode" : 233, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpAtomicIAdd", + "opcode" : 234, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicISub", + "opcode" : 235, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicSMin", + "opcode" : 236, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicUMin", + "opcode" : 237, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicSMax", + "opcode" : 238, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicUMax", + "opcode" : 239, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicAnd", + "opcode" : 240, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicOr", + "opcode" : 241, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicXor", + "opcode" : 242, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpPhi", + "opcode" : 245, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "PairIdRefIdRef", "quantifier" : "*", "name" : "'Variable, Parent, ...'" } + ] + }, + { + "opname" : "OpLoopMerge", + "opcode" : 246, + "operands" : [ + { "kind" : "IdRef", "name" : "'Merge Block'" }, + { "kind" : "IdRef", "name" : "'Continue Target'" }, + { "kind" : "LoopControl" } + ] + }, + { + "opname" : "OpSelectionMerge", + "opcode" : 247, + "operands" : [ + { "kind" : "IdRef", "name" : "'Merge Block'" }, + { "kind" : "SelectionControl" } + ] + }, + { + "opname" : "OpLabel", + "opcode" : 248, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpBranch", + "opcode" : 249, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target Label'" } + ] + }, + { + "opname" : "OpBranchConditional", + "opcode" : 250, + "operands" : [ + { "kind" : "IdRef", "name" : "'Condition'" }, + { "kind" : "IdRef", "name" : "'True Label'" }, + { "kind" : "IdRef", "name" : "'False Label'" }, + { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Branch weights'" } + ] + }, + { + "opname" : "OpSwitch", + "opcode" : 251, + "operands" : [ + { "kind" : "IdRef", "name" : "'Selector'" }, + { "kind" : "IdRef", "name" : "'Default'" }, + { "kind" : "PairLiteralIntegerIdRef", "quantifier" : "*", "name" : "'Target'" } + ] + }, + { + "opname" : "OpKill", + "opcode" : 252, + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpReturn", + "opcode" : 253 + }, + { + "opname" : "OpReturnValue", + "opcode" : 254, + "operands" : [ + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpUnreachable", + "opcode" : 255 + }, + { + "opname" : "OpLifetimeStart", + "opcode" : 256, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "LiteralInteger", "name" : "'Size'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpLifetimeStop", + "opcode" : 257, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "LiteralInteger", "name" : "'Size'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGroupAsyncCopy", + "opcode" : 259, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Destination'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "IdRef", "name" : "'Num Elements'" }, + { "kind" : "IdRef", "name" : "'Stride'" }, + { "kind" : "IdRef", "name" : "'Event'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGroupWaitEvents", + "opcode" : 260, + "operands" : [ + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Num Events'" }, + { "kind" : "IdRef", "name" : "'Events List'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGroupAll", + "opcode" : 261, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupAny", + "opcode" : 262, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupBroadcast", + "opcode" : 263, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'LocalId'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupIAdd", + "opcode" : 264, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFAdd", + "opcode" : 265, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFMin", + "opcode" : 266, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupUMin", + "opcode" : 267, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupSMin", + "opcode" : 268, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFMax", + "opcode" : 269, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupUMax", + "opcode" : 270, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupSMax", + "opcode" : 271, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpReadPipe", + "opcode" : 274, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpWritePipe", + "opcode" : 275, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpReservedReadPipe", + "opcode" : 276, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Index'" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpReservedWritePipe", + "opcode" : 277, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Index'" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpReserveReadPipePackets", + "opcode" : 278, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Num Packets'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpReserveWritePipePackets", + "opcode" : 279, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Num Packets'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpCommitReadPipe", + "opcode" : 280, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpCommitWritePipe", + "opcode" : 281, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpIsValidReserveId", + "opcode" : 282, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGetNumPipePackets", + "opcode" : 283, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGetMaxPipePackets", + "opcode" : 284, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGroupReserveReadPipePackets", + "opcode" : 285, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Num Packets'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGroupReserveWritePipePackets", + "opcode" : 286, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Num Packets'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGroupCommitReadPipe", + "opcode" : 287, + "operands" : [ + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGroupCommitWritePipe", + "opcode" : 288, + "operands" : [ + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpEnqueueMarker", + "opcode" : 291, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Queue'" }, + { "kind" : "IdRef", "name" : "'Num Events'" }, + { "kind" : "IdRef", "name" : "'Wait Events'" }, + { "kind" : "IdRef", "name" : "'Ret Event'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpEnqueueKernel", + "opcode" : 292, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Queue'" }, + { "kind" : "IdRef", "name" : "'Flags'" }, + { "kind" : "IdRef", "name" : "'ND Range'" }, + { "kind" : "IdRef", "name" : "'Num Events'" }, + { "kind" : "IdRef", "name" : "'Wait Events'" }, + { "kind" : "IdRef", "name" : "'Ret Event'" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Local Size'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetKernelNDrangeSubGroupCount", + "opcode" : 293, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'ND Range'" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetKernelNDrangeMaxSubGroupSize", + "opcode" : 294, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'ND Range'" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetKernelWorkGroupSize", + "opcode" : 295, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetKernelPreferredWorkGroupSizeMultiple", + "opcode" : 296, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpRetainEvent", + "opcode" : 297, + "operands" : [ + { "kind" : "IdRef", "name" : "'Event'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpReleaseEvent", + "opcode" : 298, + "operands" : [ + { "kind" : "IdRef", "name" : "'Event'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpCreateUserEvent", + "opcode" : 299, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpIsValidEvent", + "opcode" : 300, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Event'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpSetUserEventStatus", + "opcode" : 301, + "operands" : [ + { "kind" : "IdRef", "name" : "'Event'" }, + { "kind" : "IdRef", "name" : "'Status'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpCaptureEventProfilingInfo", + "opcode" : 302, + "operands" : [ + { "kind" : "IdRef", "name" : "'Event'" }, + { "kind" : "IdRef", "name" : "'Profiling Info'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetDefaultQueue", + "opcode" : 303, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpBuildNDRange", + "opcode" : 304, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'GlobalWorkSize'" }, + { "kind" : "IdRef", "name" : "'LocalWorkSize'" }, + { "kind" : "IdRef", "name" : "'GlobalWorkOffset'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpImageSparseSampleImplicitLod", + "opcode" : 305, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleExplicitLod", + "opcode" : 306, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleDrefImplicitLod", + "opcode" : 307, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleDrefExplicitLod", + "opcode" : 308, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleProjImplicitLod", + "opcode" : 309, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleProjExplicitLod", + "opcode" : 310, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleProjDrefImplicitLod", + "opcode" : 311, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleProjDrefExplicitLod", + "opcode" : 312, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseFetch", + "opcode" : 313, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseGather", + "opcode" : 314, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Component'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseDrefGather", + "opcode" : 315, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseTexelsResident", + "opcode" : 316, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Resident Code'" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpNoLine", + "opcode" : 317 + }, + { + "opname" : "OpAtomicFlagTestAndSet", + "opcode" : 318, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpAtomicFlagClear", + "opcode" : 319, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpImageSparseRead", + "opcode" : 320, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpDecorateId", + "opcode" : 332, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "Decoration" } + ], + "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ] + }, + { + "opname" : "OpSubgroupBallotKHR", + "opcode" : 4421, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "opname" : "OpSubgroupFirstInvocationKHR", + "opcode" : 4422, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "opname" : "OpSubgroupAllKHR", + "opcode" : 4428, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "SubgroupVoteKHR" ] + }, + { + "opname" : "OpSubgroupAnyKHR", + "opcode" : 4429, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "SubgroupVoteKHR" ] + }, + { + "opname" : "OpSubgroupAllEqualKHR", + "opcode" : 4430, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "SubgroupVoteKHR" ] + }, + { + "opname" : "OpSubgroupReadInvocationKHR", + "opcode" : 4432, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Index'" } + ], + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "opname" : "OpGroupIAddNonUniformAMD", + "opcode" : 5000, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFAddNonUniformAMD", + "opcode" : 5001, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFMinNonUniformAMD", + "opcode" : 5002, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupUMinNonUniformAMD", + "opcode" : 5003, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupSMinNonUniformAMD", + "opcode" : 5004, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFMaxNonUniformAMD", + "opcode" : 5005, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupUMaxNonUniformAMD", + "opcode" : 5006, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupSMaxNonUniformAMD", + "opcode" : 5007, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpFragmentMaskFetchAMD", + "opcode" : 5011, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" } + ], + "capabilities" : [ "FragmentMaskAMD" ] + }, + { + "opname" : "OpFragmentFetchAMD", + "opcode" : 5012, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Fragment Index'" } + ], + "capabilities" : [ "FragmentMaskAMD" ] + }, + { + "opname" : "OpSubgroupShuffleINTEL", + "opcode" : 5571, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Data'" }, + { "kind" : "IdRef", "name" : "'InvocationId'" } + ], + "capabilities" : [ "SubgroupShuffleINTEL" ] + }, + { + "opname" : "OpSubgroupShuffleDownINTEL", + "opcode" : 5572, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Current'" }, + { "kind" : "IdRef", "name" : "'Next'" }, + { "kind" : "IdRef", "name" : "'Delta'" } + ], + "capabilities" : [ "SubgroupShuffleINTEL" ] + }, + { + "opname" : "OpSubgroupShuffleUpINTEL", + "opcode" : 5573, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Previous'" }, + { "kind" : "IdRef", "name" : "'Current'" }, + { "kind" : "IdRef", "name" : "'Delta'" } + ], + "capabilities" : [ "SubgroupShuffleINTEL" ] + }, + { + "opname" : "OpSubgroupShuffleXorINTEL", + "opcode" : 5574, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Data'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "SubgroupShuffleINTEL" ] + }, + { + "opname" : "OpSubgroupBlockReadINTEL", + "opcode" : 5575, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Ptr'" } + ], + "capabilities" : [ "SubgroupBufferBlockIOINTEL" ] + }, + { + "opname" : "OpSubgroupBlockWriteINTEL", + "opcode" : 5576, + "operands" : [ + { "kind" : "IdRef", "name" : "'Ptr'" }, + { "kind" : "IdRef", "name" : "'Data'" } + ], + "capabilities" : [ "SubgroupBufferBlockIOINTEL" ] + }, + { + "opname" : "OpSubgroupImageBlockReadINTEL", + "opcode" : 5577, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" } + ], + "capabilities" : [ "SubgroupImageBlockIOINTEL" ] + }, + { + "opname" : "OpSubgroupImageBlockWriteINTEL", + "opcode" : 5578, + "operands" : [ + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Data'" } + ], + "capabilities" : [ "SubgroupImageBlockIOINTEL" ] + }, + { + "opname" : "OpDecorateStringGOOGLE", + "opcode" : 5632, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "Decoration" } + ], + "extensions" : [ "SPV_GOOGLE_decorate_string" ] + }, + { + "opname" : "OpMemberDecorateStringGOOGLE", + "opcode" : 5633, + "operands" : [ + { "kind" : "IdRef", "name" : "'Struct Type'" }, + { "kind" : "LiteralInteger", "name" : "'Member'" }, + { "kind" : "Decoration" } + ], + "extensions" : [ "SPV_GOOGLE_decorate_string" ] + } + ], + "operand_kinds" : [ + { + "category" : "BitEnum", + "kind" : "ImageOperands", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Bias", + "value" : "0x0001", + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "Lod", + "value" : "0x0002", + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "Grad", + "value" : "0x0004", + "parameters" : [ + { "kind" : "IdRef" }, + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "ConstOffset", + "value" : "0x0008", + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "Offset", + "value" : "0x0010", + "capabilities" : [ "ImageGatherExtended" ], + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "ConstOffsets", + "value" : "0x0020", + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "Sample", + "value" : "0x0040", + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "MinLod", + "value" : "0x0080", + "capabilities" : [ "MinLod" ], + "parameters" : [ + { "kind" : "IdRef" } + ] + } + ] + }, + { + "category" : "BitEnum", + "kind" : "FPFastMathMode", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "NotNaN", + "value" : "0x0001", + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NotInf", + "value" : "0x0002", + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NSZ", + "value" : "0x0004", + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "AllowRecip", + "value" : "0x0008", + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Fast", + "value" : "0x0010", + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "BitEnum", + "kind" : "SelectionControl", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Flatten", + "value" : "0x0001" + }, + { + "enumerant" : "DontFlatten", + "value" : "0x0002" + } + ] + }, + { + "category" : "BitEnum", + "kind" : "LoopControl", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Unroll", + "value" : "0x0001" + }, + { + "enumerant" : "DontUnroll", + "value" : "0x0002" + } + ] + }, + { + "category" : "BitEnum", + "kind" : "FunctionControl", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Inline", + "value" : "0x0001" + }, + { + "enumerant" : "DontInline", + "value" : "0x0002" + }, + { + "enumerant" : "Pure", + "value" : "0x0004" + }, + { + "enumerant" : "Const", + "value" : "0x0008" + } + ] + }, + { + "category" : "BitEnum", + "kind" : "MemorySemantics", + "enumerants" : [ + { + "enumerant" : "Relaxed", + "value" : "0x0000" + }, + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Acquire", + "value" : "0x0002" + }, + { + "enumerant" : "Release", + "value" : "0x0004" + }, + { + "enumerant" : "AcquireRelease", + "value" : "0x0008" + }, + { + "enumerant" : "SequentiallyConsistent", + "value" : "0x0010" + }, + { + "enumerant" : "UniformMemory", + "value" : "0x0040", + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SubgroupMemory", + "value" : "0x0080" + }, + { + "enumerant" : "WorkgroupMemory", + "value" : "0x0100" + }, + { + "enumerant" : "CrossWorkgroupMemory", + "value" : "0x0200" + }, + { + "enumerant" : "AtomicCounterMemory", + "value" : "0x0400", + "capabilities" : [ "AtomicStorage" ] + }, + { + "enumerant" : "ImageMemory", + "value" : "0x0800" + } + ] + }, + { + "category" : "BitEnum", + "kind" : "MemoryAccess", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Volatile", + "value" : "0x0001" + }, + { + "enumerant" : "Aligned", + "value" : "0x0002", + "parameters" : [ + { "kind" : "LiteralInteger" } + ] + }, + { + "enumerant" : "Nontemporal", + "value" : "0x0004" + } + ] + }, + { + "category" : "BitEnum", + "kind" : "KernelProfilingInfo", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "CmdExecTime", + "value" : "0x0001", + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "SourceLanguage", + "enumerants" : [ + { + "enumerant" : "Unknown", + "value" : 0 + }, + { + "enumerant" : "ESSL", + "value" : 1 + }, + { + "enumerant" : "GLSL", + "value" : 2 + }, + { + "enumerant" : "OpenCL_C", + "value" : 3 + }, + { + "enumerant" : "OpenCL_CPP", + "value" : 4 + }, + { + "enumerant" : "HLSL", + "value" : 5 + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ExecutionModel", + "enumerants" : [ + { + "enumerant" : "Vertex", + "value" : 0, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "TessellationControl", + "value" : 1, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "TessellationEvaluation", + "value" : 2, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "Geometry", + "value" : 3, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "Fragment", + "value" : 4, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GLCompute", + "value" : 5, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Kernel", + "value" : 6, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "AddressingModel", + "enumerants" : [ + { + "enumerant" : "Logical", + "value" : 0 + }, + { + "enumerant" : "Physical32", + "value" : 1, + "capabilities" : [ "Addresses" ] + }, + { + "enumerant" : "Physical64", + "value" : 2, + "capabilities" : [ "Addresses" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "MemoryModel", + "enumerants" : [ + { + "enumerant" : "Simple", + "value" : 0, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GLSL450", + "value" : 1, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "OpenCL", + "value" : 2, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ExecutionMode", + "enumerants" : [ + { + "enumerant" : "Invocations", + "value" : 0, + "capabilities" : [ "Geometry" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Number of <>'" } + ] + }, + { + "enumerant" : "SpacingEqual", + "value" : 1, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "SpacingFractionalEven", + "value" : 2, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "SpacingFractionalOdd", + "value" : 3, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "VertexOrderCw", + "value" : 4, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "VertexOrderCcw", + "value" : 5, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "PixelCenterInteger", + "value" : 6, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "OriginUpperLeft", + "value" : 7, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "OriginLowerLeft", + "value" : 8, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "EarlyFragmentTests", + "value" : 9, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "PointMode", + "value" : 10, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "Xfb", + "value" : 11, + "capabilities" : [ "TransformFeedback" ] + }, + { + "enumerant" : "DepthReplacing", + "value" : 12, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "DepthGreater", + "value" : 14, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "DepthLess", + "value" : 15, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "DepthUnchanged", + "value" : 16, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "LocalSize", + "value" : 17, + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'x size'" }, + { "kind" : "LiteralInteger", "name" : "'y size'" }, + { "kind" : "LiteralInteger", "name" : "'z size'" } + ] + }, + { + "enumerant" : "LocalSizeHint", + "value" : 18, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'x size'" }, + { "kind" : "LiteralInteger", "name" : "'y size'" }, + { "kind" : "LiteralInteger", "name" : "'z size'" } + ] + }, + { + "enumerant" : "InputPoints", + "value" : 19, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "InputLines", + "value" : 20, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "InputLinesAdjacency", + "value" : 21, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "Triangles", + "value" : 22, + "capabilities" : [ "Geometry", "Tessellation" ] + }, + { + "enumerant" : "InputTrianglesAdjacency", + "value" : 23, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "Quads", + "value" : 24, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "Isolines", + "value" : 25, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "OutputVertices", + "value" : 26, + "capabilities" : [ "Geometry", "Tessellation" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Vertex count'" } + ] + }, + { + "enumerant" : "OutputPoints", + "value" : 27, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "OutputLineStrip", + "value" : 28, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "OutputTriangleStrip", + "value" : 29, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "VecTypeHint", + "value" : 30, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Vector type'" } + ] + }, + { + "enumerant" : "ContractionOff", + "value" : 31, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "PostDepthCoverage", + "value" : 4446, + "capabilities" : [ "SampleMaskPostDepthCoverage" ] + }, + { + "enumerant" : "StencilRefReplacingEXT", + "value" : 5027, + "capabilities" : [ "StencilExportEXT" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "StorageClass", + "enumerants" : [ + { + "enumerant" : "UniformConstant", + "value" : 0 + }, + { + "enumerant" : "Input", + "value" : 1 + }, + { + "enumerant" : "Uniform", + "value" : 2, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Output", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Workgroup", + "value" : 4 + }, + { + "enumerant" : "CrossWorkgroup", + "value" : 5 + }, + { + "enumerant" : "Private", + "value" : 6, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Function", + "value" : 7 + }, + { + "enumerant" : "Generic", + "value" : 8, + "capabilities" : [ "GenericPointer" ] + }, + { + "enumerant" : "PushConstant", + "value" : 9, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "AtomicCounter", + "value" : 10, + "capabilities" : [ "AtomicStorage" ] + }, + { + "enumerant" : "Image", + "value" : 11 + }, + { + "enumerant" : "StorageBuffer", + "value" : 12, + "extensions" : [ + "SPV_KHR_storage_buffer_storage_class", + "SPV_KHR_variable_pointers" + ], + "capabilities" : [ "Shader" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "Dim", + "enumerants" : [ + { + "enumerant" : "1D", + "value" : 0, + "capabilities" : [ "Sampled1D" ] + }, + { + "enumerant" : "2D", + "value" : 1 + }, + { + "enumerant" : "3D", + "value" : 2 + }, + { + "enumerant" : "Cube", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rect", + "value" : 4, + "capabilities" : [ "SampledRect" ] + }, + { + "enumerant" : "Buffer", + "value" : 5, + "capabilities" : [ "SampledBuffer" ] + }, + { + "enumerant" : "SubpassData", + "value" : 6, + "capabilities" : [ "InputAttachment" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "SamplerAddressingMode", + "enumerants" : [ + { + "enumerant" : "None", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ClampToEdge", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Clamp", + "value" : 2, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Repeat", + "value" : 3, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RepeatMirrored", + "value" : 4, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "SamplerFilterMode", + "enumerants" : [ + { + "enumerant" : "Nearest", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Linear", + "value" : 1, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ImageFormat", + "enumerants" : [ + { + "enumerant" : "Unknown", + "value" : 0 + }, + { + "enumerant" : "Rgba32f", + "value" : 1, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba16f", + "value" : 2, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "R32f", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba8", + "value" : 4, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba8Snorm", + "value" : 5, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rg32f", + "value" : 6, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16f", + "value" : 7, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R11fG11fB10f", + "value" : 8, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16f", + "value" : 9, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgba16", + "value" : 10, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgb10A2", + "value" : 11, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16", + "value" : 12, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg8", + "value" : 13, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16", + "value" : 14, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R8", + "value" : 15, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgba16Snorm", + "value" : 16, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16Snorm", + "value" : 17, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg8Snorm", + "value" : 18, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16Snorm", + "value" : 19, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R8Snorm", + "value" : 20, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgba32i", + "value" : 21, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba16i", + "value" : 22, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba8i", + "value" : 23, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "R32i", + "value" : 24, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rg32i", + "value" : 25, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16i", + "value" : 26, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg8i", + "value" : 27, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16i", + "value" : 28, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R8i", + "value" : 29, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgba32ui", + "value" : 30, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba16ui", + "value" : 31, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba8ui", + "value" : 32, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "R32ui", + "value" : 33, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgb10a2ui", + "value" : 34, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg32ui", + "value" : 35, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16ui", + "value" : 36, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg8ui", + "value" : 37, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16ui", + "value" : 38, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R8ui", + "value" : 39, + "capabilities" : [ "StorageImageExtendedFormats" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ImageChannelOrder", + "enumerants" : [ + { + "enumerant" : "R", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "A", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RG", + "value" : 2, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RA", + "value" : 3, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RGB", + "value" : 4, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RGBA", + "value" : 5, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "BGRA", + "value" : 6, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ARGB", + "value" : 7, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Intensity", + "value" : 8, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Luminance", + "value" : 9, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Rx", + "value" : 10, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RGx", + "value" : 11, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RGBx", + "value" : 12, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Depth", + "value" : 13, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "DepthStencil", + "value" : 14, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "sRGB", + "value" : 15, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "sRGBx", + "value" : 16, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "sRGBA", + "value" : 17, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "sBGRA", + "value" : 18, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ABGR", + "value" : 19, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ImageChannelDataType", + "enumerants" : [ + { + "enumerant" : "SnormInt8", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SnormInt16", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt8", + "value" : 2, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt16", + "value" : 3, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormShort565", + "value" : 4, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormShort555", + "value" : 5, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt101010", + "value" : 6, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SignedInt8", + "value" : 7, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SignedInt16", + "value" : 8, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SignedInt32", + "value" : 9, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnsignedInt8", + "value" : 10, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnsignedInt16", + "value" : 11, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnsignedInt32", + "value" : 12, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "HalfFloat", + "value" : 13, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Float", + "value" : 14, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt24", + "value" : 15, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt101010_2", + "value" : 16, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "FPRoundingMode", + "enumerants" : [ + { + "enumerant" : "RTE", + "value" : 0, + "capabilities" : [ + "Kernel", + "StorageUniformBufferBlock16", + "StorageUniform16", + "StoragePushConstant16", + "StorageInputOutput16" + ] + }, + { + "enumerant" : "RTZ", + "value" : 1, + "capabilities" : [ + "Kernel", + "StorageUniformBufferBlock16", + "StorageUniform16", + "StoragePushConstant16", + "StorageInputOutput16" + ] + }, + { + "enumerant" : "RTP", + "value" : 2, + "capabilities" : [ + "Kernel", + "StorageUniformBufferBlock16", + "StorageUniform16", + "StoragePushConstant16", + "StorageInputOutput16" + ] + }, + { + "enumerant" : "RTN", + "value" : 3, + "capabilities" : [ + "Kernel", + "StorageUniformBufferBlock16", + "StorageUniform16", + "StoragePushConstant16", + "StorageInputOutput16" + ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "LinkageType", + "enumerants" : [ + { + "enumerant" : "Export", + "value" : 0, + "capabilities" : [ "Linkage" ] + }, + { + "enumerant" : "Import", + "value" : 1, + "capabilities" : [ "Linkage" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "AccessQualifier", + "enumerants" : [ + { + "enumerant" : "ReadOnly", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "WriteOnly", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ReadWrite", + "value" : 2, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "FunctionParameterAttribute", + "enumerants" : [ + { + "enumerant" : "Zext", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Sext", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ByVal", + "value" : 2, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Sret", + "value" : 3, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NoAlias", + "value" : 4, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NoCapture", + "value" : 5, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NoWrite", + "value" : 6, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NoReadWrite", + "value" : 7, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "Decoration", + "enumerants" : [ + { + "enumerant" : "RelaxedPrecision", + "value" : 0, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SpecId", + "value" : 1, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Specialization Constant ID'" } + ] + }, + { + "enumerant" : "Block", + "value" : 2, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "BufferBlock", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "RowMajor", + "value" : 4, + "capabilities" : [ "Matrix" ] + }, + { + "enumerant" : "ColMajor", + "value" : 5, + "capabilities" : [ "Matrix" ] + }, + { + "enumerant" : "ArrayStride", + "value" : 6, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Array Stride'" } + ] + }, + { + "enumerant" : "MatrixStride", + "value" : 7, + "capabilities" : [ "Matrix" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Matrix Stride'" } + ] + }, + { + "enumerant" : "GLSLShared", + "value" : 8, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GLSLPacked", + "value" : 9, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "CPacked", + "value" : 10, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "BuiltIn", + "value" : 11, + "parameters" : [ + { "kind" : "BuiltIn" } + ] + }, + { + "enumerant" : "NoPerspective", + "value" : 13, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Flat", + "value" : 14, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Patch", + "value" : 15, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "Centroid", + "value" : 16, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Sample", + "value" : 17, + "capabilities" : [ "SampleRateShading" ] + }, + { + "enumerant" : "Invariant", + "value" : 18, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Restrict", + "value" : 19 + }, + { + "enumerant" : "Aliased", + "value" : 20 + }, + { + "enumerant" : "Volatile", + "value" : 21 + }, + { + "enumerant" : "Constant", + "value" : 22, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Coherent", + "value" : 23 + }, + { + "enumerant" : "NonWritable", + "value" : 24 + }, + { + "enumerant" : "NonReadable", + "value" : 25 + }, + { + "enumerant" : "Uniform", + "value" : 26, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SaturatedConversion", + "value" : 28, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Stream", + "value" : 29, + "capabilities" : [ "GeometryStreams" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Stream Number'" } + ] + }, + { + "enumerant" : "Location", + "value" : 30, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Location'" } + ] + }, + { + "enumerant" : "Component", + "value" : 31, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Component'" } + ] + }, + { + "enumerant" : "Index", + "value" : 32, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Index'" } + ] + }, + { + "enumerant" : "Binding", + "value" : 33, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Binding Point'" } + ] + }, + { + "enumerant" : "DescriptorSet", + "value" : 34, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Descriptor Set'" } + ] + }, + { + "enumerant" : "Offset", + "value" : 35, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Byte Offset'" } + ] + }, + { + "enumerant" : "XfbBuffer", + "value" : 36, + "capabilities" : [ "TransformFeedback" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'XFB Buffer Number'" } + ] + }, + { + "enumerant" : "XfbStride", + "value" : 37, + "capabilities" : [ "TransformFeedback" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'XFB Stride'" } + ] + }, + { + "enumerant" : "FuncParamAttr", + "value" : 38, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "FunctionParameterAttribute", "name" : "'Function Parameter Attribute'" } + ] + }, + { + "enumerant" : "FPRoundingMode", + "value" : 39, + "capabilities" : [ + "Kernel", + "StorageUniformBufferBlock16", + "StorageUniform16", + "StoragePushConstant16", + "StorageInputOutput16" + ], + "parameters" : [ + { "kind" : "FPRoundingMode", "name" : "'Floating-Point Rounding Mode'" } + ] + }, + { + "enumerant" : "FPFastMathMode", + "value" : 40, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "FPFastMathMode", "name" : "'Fast-Math Mode'" } + ] + }, + { + "enumerant" : "LinkageAttributes", + "value" : 41, + "capabilities" : [ "Linkage" ], + "parameters" : [ + { "kind" : "LiteralString", "name" : "'Name'" }, + { "kind" : "LinkageType", "name" : "'Linkage Type'" } + ] + }, + { + "enumerant" : "NoContraction", + "value" : 42, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "InputAttachmentIndex", + "value" : 43, + "capabilities" : [ "InputAttachment" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Attachment Index'" } + ] + }, + { + "enumerant" : "Alignment", + "value" : 44, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Alignment'" } + ] + }, + { + "enumerant" : "ExplicitInterpAMD", + "value" : 4999 + }, + { + "enumerant" : "OverrideCoverageNV", + "value" : 5248, + "capabilities" : [ "SampleMaskOverrideCoverageNV" ] + }, + { + "enumerant" : "PassthroughNV", + "value" : 5250, + "capabilities" : [ "GeometryShaderPassthroughNV" ] + }, + { + "enumerant" : "ViewportRelativeNV", + "value" : 5252, + "capabilities" : [ "ShaderViewportMaskNV" ] + }, + { + "enumerant" : "SecondaryViewportRelativeNV", + "value" : 5256, + "capabilities" : [ "ShaderStereoViewNV" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Offset'" } + ] + }, + { + "enumerant" : "HlslCounterBufferGOOGLE", + "value" : 5634, + "parameters" : [ + { "kind" : "IdRef", "name" : "'Counter Buffer'" } + ], + "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ] + }, + { + "enumerant" : "HlslSemanticGOOGLE", + "value" : 5635, + "parameters" : [ + { "kind" : "LiteralString", "name" : "'Semantic'" } + ], + "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "BuiltIn", + "enumerants" : [ + { + "enumerant" : "Position", + "value" : 0, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "PointSize", + "value" : 1, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ClipDistance", + "value" : 3, + "capabilities" : [ "ClipDistance" ] + }, + { + "enumerant" : "CullDistance", + "value" : 4, + "capabilities" : [ "CullDistance" ] + }, + { + "enumerant" : "VertexId", + "value" : 5, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "InstanceId", + "value" : 6, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "PrimitiveId", + "value" : 7, + "capabilities" : [ "Geometry", "Tessellation" ] + }, + { + "enumerant" : "InvocationId", + "value" : 8, + "capabilities" : [ "Geometry", "Tessellation" ] + }, + { + "enumerant" : "Layer", + "value" : 9, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "ViewportIndex", + "value" : 10, + "capabilities" : [ "MultiViewport" ] + }, + { + "enumerant" : "TessLevelOuter", + "value" : 11, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "TessLevelInner", + "value" : 12, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "TessCoord", + "value" : 13, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "PatchVertices", + "value" : 14, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "FragCoord", + "value" : 15, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "PointCoord", + "value" : 16, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "FrontFacing", + "value" : 17, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SampleId", + "value" : 18, + "capabilities" : [ "SampleRateShading" ] + }, + { + "enumerant" : "SamplePosition", + "value" : 19, + "capabilities" : [ "SampleRateShading" ] + }, + { + "enumerant" : "SampleMask", + "value" : 20, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "FragDepth", + "value" : 22, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "HelperInvocation", + "value" : 23, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "NumWorkgroups", + "value" : 24 + }, + { + "enumerant" : "WorkgroupSize", + "value" : 25 + }, + { + "enumerant" : "WorkgroupId", + "value" : 26 + }, + { + "enumerant" : "LocalInvocationId", + "value" : 27 + }, + { + "enumerant" : "GlobalInvocationId", + "value" : 28 + }, + { + "enumerant" : "LocalInvocationIndex", + "value" : 29 + }, + { + "enumerant" : "WorkDim", + "value" : 30, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "GlobalSize", + "value" : 31, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "EnqueuedWorkgroupSize", + "value" : 32, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "GlobalOffset", + "value" : 33, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "GlobalLinearId", + "value" : 34, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SubgroupSize", + "value" : 36, + "capabilities" : [ "Kernel", "SubgroupBallotKHR" ] + }, + { + "enumerant" : "SubgroupMaxSize", + "value" : 37, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NumSubgroups", + "value" : 38, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NumEnqueuedSubgroups", + "value" : 39, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SubgroupId", + "value" : 40, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SubgroupLocalInvocationId", + "value" : 41, + "capabilities" : [ "Kernel", "SubgroupBallotKHR" ] + }, + { + "enumerant" : "VertexIndex", + "value" : 42, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "InstanceIndex", + "value" : 43, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SubgroupEqMaskKHR", + "value" : 4416, + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "enumerant" : "SubgroupGeMaskKHR", + "value" : 4417, + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "enumerant" : "SubgroupGtMaskKHR", + "value" : 4418, + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "enumerant" : "SubgroupLeMaskKHR", + "value" : 4419, + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "enumerant" : "SubgroupLtMaskKHR", + "value" : 4420, + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "enumerant" : "BaseVertex", + "value" : 4424, + "capabilities" : [ "DrawParameters" ] + }, + { + "enumerant" : "BaseInstance", + "value" : 4425, + "capabilities" : [ "DrawParameters" ] + }, + { + "enumerant" : "DrawIndex", + "value" : 4426, + "capabilities" : [ "DrawParameters" ] + }, + { + "enumerant" : "DeviceIndex", + "value" : 4438, + "capabilities" : [ "DeviceGroup" ] + }, + { + "enumerant" : "ViewIndex", + "value" : 4440, + "capabilities" : [ "MultiView" ] + }, + { + "enumerant" : "BaryCoordNoPerspAMD", + "value" : 4992 + }, + { + "enumerant" : "BaryCoordNoPerspCentroidAMD", + "value" : 4993 + }, + { + "enumerant" : "BaryCoordNoPerspSampleAMD", + "value" : 4994 + }, + { + "enumerant" : "BaryCoordSmoothAMD", + "value" : 4995 + }, + { + "enumerant" : "BaryCoordSmoothCentroidAMD", + "value" : 4996 + }, + { + "enumerant" : "BaryCoordSmoothSampleAMD", + "value" : 4997 + }, + { + "enumerant" : "BaryCoordPullModelAMD", + "value" : 4998 + }, + { + "enumerant" : "FragStencilRefEXT", + "value" : 5014, + "capabilities" : [ "StencilExportEXT" ] + }, + { + "enumerant" : "ViewportMaskNV", + "value" : 5253, + "capabilities" : [ "ShaderViewportMaskNV" ] + }, + { + "enumerant" : "SecondaryPositionNV", + "value" : 5257, + "capabilities" : [ "ShaderStereoViewNV" ] + }, + { + "enumerant" : "SecondaryViewportMaskNV", + "value" : 5258, + "capabilities" : [ "ShaderStereoViewNV" ] + }, + { + "enumerant" : "PositionPerViewNV", + "value" : 5261, + "capabilities" : [ "PerViewAttributesNV" ] + }, + { + "enumerant" : "ViewportMaskPerViewNV", + "value" : 5262, + "capabilities" : [ "PerViewAttributesNV" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "Scope", + "enumerants" : [ + { + "enumerant" : "CrossDevice", + "value" : 0 + }, + { + "enumerant" : "Device", + "value" : 1 + }, + { + "enumerant" : "Workgroup", + "value" : 2 + }, + { + "enumerant" : "Subgroup", + "value" : 3 + }, + { + "enumerant" : "Invocation", + "value" : 4 + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "GroupOperation", + "enumerants" : [ + { + "enumerant" : "Reduce", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "InclusiveScan", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ExclusiveScan", + "value" : 2, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "KernelEnqueueFlags", + "enumerants" : [ + { + "enumerant" : "NoWait", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "WaitKernel", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "WaitWorkGroup", + "value" : 2, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "Capability", + "enumerants" : [ + { + "enumerant" : "Matrix", + "value" : 0 + }, + { + "enumerant" : "Shader", + "value" : 1, + "capabilities" : [ "Matrix" ] + }, + { + "enumerant" : "Geometry", + "value" : 2, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Tessellation", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Addresses", + "value" : 4 + }, + { + "enumerant" : "Linkage", + "value" : 5 + }, + { + "enumerant" : "Kernel", + "value" : 6 + }, + { + "enumerant" : "Vector16", + "value" : 7, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Float16Buffer", + "value" : 8, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Float16", + "value" : 9 + }, + { + "enumerant" : "Float64", + "value" : 10 + }, + { + "enumerant" : "Int64", + "value" : 11 + }, + { + "enumerant" : "Int64Atomics", + "value" : 12, + "capabilities" : [ "Int64" ] + }, + { + "enumerant" : "ImageBasic", + "value" : 13, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ImageReadWrite", + "value" : 14, + "capabilities" : [ "ImageBasic" ] + }, + { + "enumerant" : "ImageMipmap", + "value" : 15, + "capabilities" : [ "ImageBasic" ] + }, + { + "enumerant" : "Pipes", + "value" : 17, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Groups", + "value" : 18 + }, + { + "enumerant" : "DeviceEnqueue", + "value" : 19, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "LiteralSampler", + "value" : 20, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "AtomicStorage", + "value" : 21, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Int16", + "value" : 22 + }, + { + "enumerant" : "TessellationPointSize", + "value" : 23, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "GeometryPointSize", + "value" : 24, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "ImageGatherExtended", + "value" : 25, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageImageMultisample", + "value" : 27, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "UniformBufferArrayDynamicIndexing", + "value" : 28, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SampledImageArrayDynamicIndexing", + "value" : 29, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageBufferArrayDynamicIndexing", + "value" : 30, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageImageArrayDynamicIndexing", + "value" : 31, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ClipDistance", + "value" : 32, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "CullDistance", + "value" : 33, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ImageCubeArray", + "value" : 34, + "capabilities" : [ "SampledCubeArray" ] + }, + { + "enumerant" : "SampleRateShading", + "value" : 35, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ImageRect", + "value" : 36, + "capabilities" : [ "SampledRect" ] + }, + { + "enumerant" : "SampledRect", + "value" : 37, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GenericPointer", + "value" : 38, + "capabilities" : [ "Addresses" ] + }, + { + "enumerant" : "Int8", + "value" : 39, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "InputAttachment", + "value" : 40, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SparseResidency", + "value" : 41, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "MinLod", + "value" : 42, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Sampled1D", + "value" : 43 + }, + { + "enumerant" : "Image1D", + "value" : 44, + "capabilities" : [ "Sampled1D" ] + }, + { + "enumerant" : "SampledCubeArray", + "value" : 45, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SampledBuffer", + "value" : 46 + }, + { + "enumerant" : "ImageBuffer", + "value" : 47, + "capabilities" : [ "SampledBuffer" ] + }, + { + "enumerant" : "ImageMSArray", + "value" : 48, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageImageExtendedFormats", + "value" : 49, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ImageQuery", + "value" : 50, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "DerivativeControl", + "value" : 51, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "InterpolationFunction", + "value" : 52, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "TransformFeedback", + "value" : 53, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GeometryStreams", + "value" : 54, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "StorageImageReadWithoutFormat", + "value" : 55, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageImageWriteWithoutFormat", + "value" : 56, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "MultiViewport", + "value" : 57, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "SubgroupBallotKHR", + "value" : 4423, + "extensions" : [ "SPV_KHR_shader_ballot" ] + }, + { + "enumerant" : "DrawParameters", + "value" : 4427, + "extensions" : [ "SPV_KHR_shader_draw_parameters" ] + }, + { + "enumerant" : "SubgroupVoteKHR", + "value" : 4431, + "extensions" : [ "SPV_KHR_subgroup_vote" ] + }, + { + "enumerant" : "StorageBuffer16BitAccess", + "value" : 4433, + "extensions" : [ "SPV_KHR_16bit_storage" ] + }, + { + "enumerant" : "StorageUniformBufferBlock16", + "value" : 4433, + "extensions" : [ "SPV_KHR_16bit_storage" ] + }, + { + "enumerant" : "UniformAndStorageBuffer16BitAccess", + "value" : 4434, + "capabilities" : [ + "StorageBuffer16BitAccess", + "StorageUniformBufferBlock16" + ], + "extensions" : [ "SPV_KHR_16bit_storage" ] + }, + { + "enumerant" : "StorageUniform16", + "value" : 4434, + "capabilities" : [ + "StorageBuffer16BitAccess", + "StorageUniformBufferBlock16" + ], + "extensions" : [ "SPV_KHR_16bit_storage" ] + }, + { + "enumerant" : "StoragePushConstant16", + "value" : 4435, + "extensions" : [ "SPV_KHR_16bit_storage" ] + }, + { + "enumerant" : "StorageInputOutput16", + "value" : 4436, + "extensions" : [ "SPV_KHR_16bit_storage" ] + }, + { + "enumerant" : "DeviceGroup", + "value" : 4437, + "extensions" : [ "SPV_KHR_device_group" ] + }, + { + "enumerant" : "MultiView", + "value" : 4439, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_KHR_multiview" ] + }, + { + "enumerant" : "VariablePointersStorageBuffer", + "value" : 4441, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_KHR_variable_pointers" ] + }, + { + "enumerant" : "VariablePointers", + "value" : 4442, + "capabilities" : [ "VariablePointersStorageBuffer" ], + "extensions" : [ "SPV_KHR_variable_pointers" ] + }, + { + "enumerant": "AtomicStorageOps", + "value": 4445, + "extensions": [ "SPV_KHR_shader_atomic_counter_ops" ] + }, + { + "enumerant" : "SampleMaskPostDepthCoverage", + "value" : 4447, + "extensions" : [ "SPV_KHR_post_depth_coverage" ] + }, + { + "enumerant" : "ImageGatherBiasLodAMD", + "value" : 5009, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_AMD_texture_gather_bias_lod" ] + }, + { + "enumerant" : "FragmentMaskAMD", + "value" : 5010, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_AMD_shader_fragment_mask" ] + }, + { + "enumerant" : "StencilExportEXT", + "value" : 5013, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_EXT_shader_stencil_export" ] + }, + { + "enumerant" : "ImageReadWriteLodAMD", + "value" : 5015, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_AMD_shader_image_load_store_lod" ] + }, + { + "enumerant" : "SampleMaskOverrideCoverageNV", + "value" : 5249, + "capabilities" : [ "SampleRateShading" ], + "extensions" : [ "SPV_NV_sample_mask_override_coverage" ] + }, + { + "enumerant" : "GeometryShaderPassthroughNV", + "value" : 5251, + "capabilities" : [ "Geometry" ], + "extensions" : [ "SPV_NV_geometry_shader_passthrough" ] + }, + { + "enumerant" : "ShaderViewportIndexLayerEXT", + "value" : 5254, + "capabilities" : [ "MultiViewport" ], + "extensions" : [ "SPV_EXT_shader_viewport_index_layer" ] + }, + { + "enumerant" : "ShaderViewportIndexLayerNV", + "value" : 5254, + "capabilities" : [ "MultiViewport" ], + "extensions" : [ "SPV_NV_viewport_array2" ] + }, + { + "enumerant" : "ShaderViewportMaskNV", + "value" : 5255, + "capabilities" : [ "ShaderViewportIndexLayerNV" ], + "extensions" : [ "SPV_NV_viewport_array2" ] + }, + { + "enumerant" : "ShaderStereoViewNV", + "value" : 5259, + "capabilities" : [ "ShaderViewportMaskNV" ], + "extensions" : [ "SPV_NV_stereo_view_rendering" ] + }, + { + "enumerant" : "PerViewAttributesNV", + "value" : 5260, + "capabilities" : [ "MultiView" ], + "extensions" : [ "SPV_NVX_multiview_per_view_attributes" ] + }, + { + "enumerant" : "SubgroupShuffleINTEL", + "value" : 5568, + "extensions" : [ "SPV_INTEL_subgroups" ] + }, + { + "enumerant" : "SubgroupBufferBlockIOINTEL", + "value" : 5569, + "extensions" : [ "SPV_INTEL_subgroups" ] + }, + { + "enumerant" : "SubgroupImageBlockIOINTEL", + "value" : 5570, + "extensions" : [ "SPV_INTEL_subgroups" ] + } + ] + }, + { + "category" : "Id", + "kind" : "IdResultType", + "doc" : "Reference to an representing the result's type of the enclosing instruction" + }, + { + "category" : "Id", + "kind" : "IdResult", + "doc" : "Definition of an representing the result of the enclosing instruction" + }, + { + "category" : "Id", + "kind" : "IdMemorySemantics", + "doc" : "Reference to an representing a 32-bit integer that is a mask from the MemorySemantics operand kind" + }, + { + "category" : "Id", + "kind" : "IdScope", + "doc" : "Reference to an representing a 32-bit integer that is a mask from the Scope operand kind" + }, + { + "category" : "Id", + "kind" : "IdRef", + "doc" : "Reference to an " + }, + { + "category" : "Literal", + "kind" : "LiteralInteger", + "doc" : "An integer consuming one or more words" + }, + { + "category" : "Literal", + "kind" : "LiteralString", + "doc" : "A null-terminated stream of characters consuming an integral number of words" + }, + { + "category" : "Literal", + "kind" : "LiteralContextDependentNumber", + "doc" : "A literal number whose size and format are determined by a previous operand in the enclosing instruction" + }, + { + "category" : "Literal", + "kind" : "LiteralExtInstInteger", + "doc" : "A 32-bit unsigned integer indicating which instruction to use and determining the layout of following operands (for OpExtInst)" + }, + { + "category" : "Literal", + "kind" : "LiteralSpecConstantOpInteger", + "doc" : "An opcode indicating the operation to be performed and determining the layout of following operands (for OpSpecConstantOp)" + }, + { + "category" : "Composite", + "kind" : "PairLiteralIntegerIdRef", + "bases" : [ "LiteralInteger", "IdRef" ] + }, + { + "category" : "Composite", + "kind" : "PairIdRefLiteralInteger", + "bases" : [ "IdRef", "LiteralInteger" ] + }, + { + "category" : "Composite", + "kind" : "PairIdRefIdRef", + "bases" : [ "IdRef", "IdRef" ] + } + ] +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.h 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,993 @@ +/* +** Copyright (c) 2014-2018 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +/* +** This header is automatically generated by the same tool that creates +** the Binary Section of the SPIR-V specification. +*/ + +/* +** Enumeration tokens for SPIR-V, in various styles: +** C, C++, C++11, JSON, Lua, Python +** +** - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +** - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +** - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +** - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +** - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +** +** Some tokens act like mask values, which can be OR'd together, +** while others are mutually exclusive. The mask-like ones have +** "Mask" in their name, and a parallel enum that has the shift +** amount (1 << x) for each corresponding enumerant. +*/ + +#ifndef spirv_H +#define spirv_H + +typedef unsigned int SpvId; + +#define SPV_VERSION 0x10000 +#define SPV_REVISION 12 + +static const unsigned int SpvMagicNumber = 0x07230203; +static const unsigned int SpvVersion = 0x00010000; +static const unsigned int SpvRevision = 12; +static const unsigned int SpvOpCodeMask = 0xffff; +static const unsigned int SpvWordCountShift = 16; + +typedef enum SpvSourceLanguage_ { + SpvSourceLanguageUnknown = 0, + SpvSourceLanguageESSL = 1, + SpvSourceLanguageGLSL = 2, + SpvSourceLanguageOpenCL_C = 3, + SpvSourceLanguageOpenCL_CPP = 4, + SpvSourceLanguageHLSL = 5, + SpvSourceLanguageMax = 0x7fffffff, +} SpvSourceLanguage; + +typedef enum SpvExecutionModel_ { + SpvExecutionModelVertex = 0, + SpvExecutionModelTessellationControl = 1, + SpvExecutionModelTessellationEvaluation = 2, + SpvExecutionModelGeometry = 3, + SpvExecutionModelFragment = 4, + SpvExecutionModelGLCompute = 5, + SpvExecutionModelKernel = 6, + SpvExecutionModelMax = 0x7fffffff, +} SpvExecutionModel; + +typedef enum SpvAddressingModel_ { + SpvAddressingModelLogical = 0, + SpvAddressingModelPhysical32 = 1, + SpvAddressingModelPhysical64 = 2, + SpvAddressingModelMax = 0x7fffffff, +} SpvAddressingModel; + +typedef enum SpvMemoryModel_ { + SpvMemoryModelSimple = 0, + SpvMemoryModelGLSL450 = 1, + SpvMemoryModelOpenCL = 2, + SpvMemoryModelMax = 0x7fffffff, +} SpvMemoryModel; + +typedef enum SpvExecutionMode_ { + SpvExecutionModeInvocations = 0, + SpvExecutionModeSpacingEqual = 1, + SpvExecutionModeSpacingFractionalEven = 2, + SpvExecutionModeSpacingFractionalOdd = 3, + SpvExecutionModeVertexOrderCw = 4, + SpvExecutionModeVertexOrderCcw = 5, + SpvExecutionModePixelCenterInteger = 6, + SpvExecutionModeOriginUpperLeft = 7, + SpvExecutionModeOriginLowerLeft = 8, + SpvExecutionModeEarlyFragmentTests = 9, + SpvExecutionModePointMode = 10, + SpvExecutionModeXfb = 11, + SpvExecutionModeDepthReplacing = 12, + SpvExecutionModeDepthGreater = 14, + SpvExecutionModeDepthLess = 15, + SpvExecutionModeDepthUnchanged = 16, + SpvExecutionModeLocalSize = 17, + SpvExecutionModeLocalSizeHint = 18, + SpvExecutionModeInputPoints = 19, + SpvExecutionModeInputLines = 20, + SpvExecutionModeInputLinesAdjacency = 21, + SpvExecutionModeTriangles = 22, + SpvExecutionModeInputTrianglesAdjacency = 23, + SpvExecutionModeQuads = 24, + SpvExecutionModeIsolines = 25, + SpvExecutionModeOutputVertices = 26, + SpvExecutionModeOutputPoints = 27, + SpvExecutionModeOutputLineStrip = 28, + SpvExecutionModeOutputTriangleStrip = 29, + SpvExecutionModeVecTypeHint = 30, + SpvExecutionModeContractionOff = 31, + SpvExecutionModePostDepthCoverage = 4446, + SpvExecutionModeStencilRefReplacingEXT = 5027, + SpvExecutionModeMax = 0x7fffffff, +} SpvExecutionMode; + +typedef enum SpvStorageClass_ { + SpvStorageClassUniformConstant = 0, + SpvStorageClassInput = 1, + SpvStorageClassUniform = 2, + SpvStorageClassOutput = 3, + SpvStorageClassWorkgroup = 4, + SpvStorageClassCrossWorkgroup = 5, + SpvStorageClassPrivate = 6, + SpvStorageClassFunction = 7, + SpvStorageClassGeneric = 8, + SpvStorageClassPushConstant = 9, + SpvStorageClassAtomicCounter = 10, + SpvStorageClassImage = 11, + SpvStorageClassStorageBuffer = 12, + SpvStorageClassMax = 0x7fffffff, +} SpvStorageClass; + +typedef enum SpvDim_ { + SpvDim1D = 0, + SpvDim2D = 1, + SpvDim3D = 2, + SpvDimCube = 3, + SpvDimRect = 4, + SpvDimBuffer = 5, + SpvDimSubpassData = 6, + SpvDimMax = 0x7fffffff, +} SpvDim; + +typedef enum SpvSamplerAddressingMode_ { + SpvSamplerAddressingModeNone = 0, + SpvSamplerAddressingModeClampToEdge = 1, + SpvSamplerAddressingModeClamp = 2, + SpvSamplerAddressingModeRepeat = 3, + SpvSamplerAddressingModeRepeatMirrored = 4, + SpvSamplerAddressingModeMax = 0x7fffffff, +} SpvSamplerAddressingMode; + +typedef enum SpvSamplerFilterMode_ { + SpvSamplerFilterModeNearest = 0, + SpvSamplerFilterModeLinear = 1, + SpvSamplerFilterModeMax = 0x7fffffff, +} SpvSamplerFilterMode; + +typedef enum SpvImageFormat_ { + SpvImageFormatUnknown = 0, + SpvImageFormatRgba32f = 1, + SpvImageFormatRgba16f = 2, + SpvImageFormatR32f = 3, + SpvImageFormatRgba8 = 4, + SpvImageFormatRgba8Snorm = 5, + SpvImageFormatRg32f = 6, + SpvImageFormatRg16f = 7, + SpvImageFormatR11fG11fB10f = 8, + SpvImageFormatR16f = 9, + SpvImageFormatRgba16 = 10, + SpvImageFormatRgb10A2 = 11, + SpvImageFormatRg16 = 12, + SpvImageFormatRg8 = 13, + SpvImageFormatR16 = 14, + SpvImageFormatR8 = 15, + SpvImageFormatRgba16Snorm = 16, + SpvImageFormatRg16Snorm = 17, + SpvImageFormatRg8Snorm = 18, + SpvImageFormatR16Snorm = 19, + SpvImageFormatR8Snorm = 20, + SpvImageFormatRgba32i = 21, + SpvImageFormatRgba16i = 22, + SpvImageFormatRgba8i = 23, + SpvImageFormatR32i = 24, + SpvImageFormatRg32i = 25, + SpvImageFormatRg16i = 26, + SpvImageFormatRg8i = 27, + SpvImageFormatR16i = 28, + SpvImageFormatR8i = 29, + SpvImageFormatRgba32ui = 30, + SpvImageFormatRgba16ui = 31, + SpvImageFormatRgba8ui = 32, + SpvImageFormatR32ui = 33, + SpvImageFormatRgb10a2ui = 34, + SpvImageFormatRg32ui = 35, + SpvImageFormatRg16ui = 36, + SpvImageFormatRg8ui = 37, + SpvImageFormatR16ui = 38, + SpvImageFormatR8ui = 39, + SpvImageFormatMax = 0x7fffffff, +} SpvImageFormat; + +typedef enum SpvImageChannelOrder_ { + SpvImageChannelOrderR = 0, + SpvImageChannelOrderA = 1, + SpvImageChannelOrderRG = 2, + SpvImageChannelOrderRA = 3, + SpvImageChannelOrderRGB = 4, + SpvImageChannelOrderRGBA = 5, + SpvImageChannelOrderBGRA = 6, + SpvImageChannelOrderARGB = 7, + SpvImageChannelOrderIntensity = 8, + SpvImageChannelOrderLuminance = 9, + SpvImageChannelOrderRx = 10, + SpvImageChannelOrderRGx = 11, + SpvImageChannelOrderRGBx = 12, + SpvImageChannelOrderDepth = 13, + SpvImageChannelOrderDepthStencil = 14, + SpvImageChannelOrdersRGB = 15, + SpvImageChannelOrdersRGBx = 16, + SpvImageChannelOrdersRGBA = 17, + SpvImageChannelOrdersBGRA = 18, + SpvImageChannelOrderABGR = 19, + SpvImageChannelOrderMax = 0x7fffffff, +} SpvImageChannelOrder; + +typedef enum SpvImageChannelDataType_ { + SpvImageChannelDataTypeSnormInt8 = 0, + SpvImageChannelDataTypeSnormInt16 = 1, + SpvImageChannelDataTypeUnormInt8 = 2, + SpvImageChannelDataTypeUnormInt16 = 3, + SpvImageChannelDataTypeUnormShort565 = 4, + SpvImageChannelDataTypeUnormShort555 = 5, + SpvImageChannelDataTypeUnormInt101010 = 6, + SpvImageChannelDataTypeSignedInt8 = 7, + SpvImageChannelDataTypeSignedInt16 = 8, + SpvImageChannelDataTypeSignedInt32 = 9, + SpvImageChannelDataTypeUnsignedInt8 = 10, + SpvImageChannelDataTypeUnsignedInt16 = 11, + SpvImageChannelDataTypeUnsignedInt32 = 12, + SpvImageChannelDataTypeHalfFloat = 13, + SpvImageChannelDataTypeFloat = 14, + SpvImageChannelDataTypeUnormInt24 = 15, + SpvImageChannelDataTypeUnormInt101010_2 = 16, + SpvImageChannelDataTypeMax = 0x7fffffff, +} SpvImageChannelDataType; + +typedef enum SpvImageOperandsShift_ { + SpvImageOperandsBiasShift = 0, + SpvImageOperandsLodShift = 1, + SpvImageOperandsGradShift = 2, + SpvImageOperandsConstOffsetShift = 3, + SpvImageOperandsOffsetShift = 4, + SpvImageOperandsConstOffsetsShift = 5, + SpvImageOperandsSampleShift = 6, + SpvImageOperandsMinLodShift = 7, + SpvImageOperandsMax = 0x7fffffff, +} SpvImageOperandsShift; + +typedef enum SpvImageOperandsMask_ { + SpvImageOperandsMaskNone = 0, + SpvImageOperandsBiasMask = 0x00000001, + SpvImageOperandsLodMask = 0x00000002, + SpvImageOperandsGradMask = 0x00000004, + SpvImageOperandsConstOffsetMask = 0x00000008, + SpvImageOperandsOffsetMask = 0x00000010, + SpvImageOperandsConstOffsetsMask = 0x00000020, + SpvImageOperandsSampleMask = 0x00000040, + SpvImageOperandsMinLodMask = 0x00000080, +} SpvImageOperandsMask; + +typedef enum SpvFPFastMathModeShift_ { + SpvFPFastMathModeNotNaNShift = 0, + SpvFPFastMathModeNotInfShift = 1, + SpvFPFastMathModeNSZShift = 2, + SpvFPFastMathModeAllowRecipShift = 3, + SpvFPFastMathModeFastShift = 4, + SpvFPFastMathModeMax = 0x7fffffff, +} SpvFPFastMathModeShift; + +typedef enum SpvFPFastMathModeMask_ { + SpvFPFastMathModeMaskNone = 0, + SpvFPFastMathModeNotNaNMask = 0x00000001, + SpvFPFastMathModeNotInfMask = 0x00000002, + SpvFPFastMathModeNSZMask = 0x00000004, + SpvFPFastMathModeAllowRecipMask = 0x00000008, + SpvFPFastMathModeFastMask = 0x00000010, +} SpvFPFastMathModeMask; + +typedef enum SpvFPRoundingMode_ { + SpvFPRoundingModeRTE = 0, + SpvFPRoundingModeRTZ = 1, + SpvFPRoundingModeRTP = 2, + SpvFPRoundingModeRTN = 3, + SpvFPRoundingModeMax = 0x7fffffff, +} SpvFPRoundingMode; + +typedef enum SpvLinkageType_ { + SpvLinkageTypeExport = 0, + SpvLinkageTypeImport = 1, + SpvLinkageTypeMax = 0x7fffffff, +} SpvLinkageType; + +typedef enum SpvAccessQualifier_ { + SpvAccessQualifierReadOnly = 0, + SpvAccessQualifierWriteOnly = 1, + SpvAccessQualifierReadWrite = 2, + SpvAccessQualifierMax = 0x7fffffff, +} SpvAccessQualifier; + +typedef enum SpvFunctionParameterAttribute_ { + SpvFunctionParameterAttributeZext = 0, + SpvFunctionParameterAttributeSext = 1, + SpvFunctionParameterAttributeByVal = 2, + SpvFunctionParameterAttributeSret = 3, + SpvFunctionParameterAttributeNoAlias = 4, + SpvFunctionParameterAttributeNoCapture = 5, + SpvFunctionParameterAttributeNoWrite = 6, + SpvFunctionParameterAttributeNoReadWrite = 7, + SpvFunctionParameterAttributeMax = 0x7fffffff, +} SpvFunctionParameterAttribute; + +typedef enum SpvDecoration_ { + SpvDecorationRelaxedPrecision = 0, + SpvDecorationSpecId = 1, + SpvDecorationBlock = 2, + SpvDecorationBufferBlock = 3, + SpvDecorationRowMajor = 4, + SpvDecorationColMajor = 5, + SpvDecorationArrayStride = 6, + SpvDecorationMatrixStride = 7, + SpvDecorationGLSLShared = 8, + SpvDecorationGLSLPacked = 9, + SpvDecorationCPacked = 10, + SpvDecorationBuiltIn = 11, + SpvDecorationNoPerspective = 13, + SpvDecorationFlat = 14, + SpvDecorationPatch = 15, + SpvDecorationCentroid = 16, + SpvDecorationSample = 17, + SpvDecorationInvariant = 18, + SpvDecorationRestrict = 19, + SpvDecorationAliased = 20, + SpvDecorationVolatile = 21, + SpvDecorationConstant = 22, + SpvDecorationCoherent = 23, + SpvDecorationNonWritable = 24, + SpvDecorationNonReadable = 25, + SpvDecorationUniform = 26, + SpvDecorationSaturatedConversion = 28, + SpvDecorationStream = 29, + SpvDecorationLocation = 30, + SpvDecorationComponent = 31, + SpvDecorationIndex = 32, + SpvDecorationBinding = 33, + SpvDecorationDescriptorSet = 34, + SpvDecorationOffset = 35, + SpvDecorationXfbBuffer = 36, + SpvDecorationXfbStride = 37, + SpvDecorationFuncParamAttr = 38, + SpvDecorationFPRoundingMode = 39, + SpvDecorationFPFastMathMode = 40, + SpvDecorationLinkageAttributes = 41, + SpvDecorationNoContraction = 42, + SpvDecorationInputAttachmentIndex = 43, + SpvDecorationAlignment = 44, + SpvDecorationExplicitInterpAMD = 4999, + SpvDecorationOverrideCoverageNV = 5248, + SpvDecorationPassthroughNV = 5250, + SpvDecorationViewportRelativeNV = 5252, + SpvDecorationSecondaryViewportRelativeNV = 5256, + SpvDecorationHlslCounterBufferGOOGLE = 5634, + SpvDecorationHlslSemanticGOOGLE = 5635, + SpvDecorationMax = 0x7fffffff, +} SpvDecoration; + +typedef enum SpvBuiltIn_ { + SpvBuiltInPosition = 0, + SpvBuiltInPointSize = 1, + SpvBuiltInClipDistance = 3, + SpvBuiltInCullDistance = 4, + SpvBuiltInVertexId = 5, + SpvBuiltInInstanceId = 6, + SpvBuiltInPrimitiveId = 7, + SpvBuiltInInvocationId = 8, + SpvBuiltInLayer = 9, + SpvBuiltInViewportIndex = 10, + SpvBuiltInTessLevelOuter = 11, + SpvBuiltInTessLevelInner = 12, + SpvBuiltInTessCoord = 13, + SpvBuiltInPatchVertices = 14, + SpvBuiltInFragCoord = 15, + SpvBuiltInPointCoord = 16, + SpvBuiltInFrontFacing = 17, + SpvBuiltInSampleId = 18, + SpvBuiltInSamplePosition = 19, + SpvBuiltInSampleMask = 20, + SpvBuiltInFragDepth = 22, + SpvBuiltInHelperInvocation = 23, + SpvBuiltInNumWorkgroups = 24, + SpvBuiltInWorkgroupSize = 25, + SpvBuiltInWorkgroupId = 26, + SpvBuiltInLocalInvocationId = 27, + SpvBuiltInGlobalInvocationId = 28, + SpvBuiltInLocalInvocationIndex = 29, + SpvBuiltInWorkDim = 30, + SpvBuiltInGlobalSize = 31, + SpvBuiltInEnqueuedWorkgroupSize = 32, + SpvBuiltInGlobalOffset = 33, + SpvBuiltInGlobalLinearId = 34, + SpvBuiltInSubgroupSize = 36, + SpvBuiltInSubgroupMaxSize = 37, + SpvBuiltInNumSubgroups = 38, + SpvBuiltInNumEnqueuedSubgroups = 39, + SpvBuiltInSubgroupId = 40, + SpvBuiltInSubgroupLocalInvocationId = 41, + SpvBuiltInVertexIndex = 42, + SpvBuiltInInstanceIndex = 43, + SpvBuiltInSubgroupEqMaskKHR = 4416, + SpvBuiltInSubgroupGeMaskKHR = 4417, + SpvBuiltInSubgroupGtMaskKHR = 4418, + SpvBuiltInSubgroupLeMaskKHR = 4419, + SpvBuiltInSubgroupLtMaskKHR = 4420, + SpvBuiltInBaseVertex = 4424, + SpvBuiltInBaseInstance = 4425, + SpvBuiltInDrawIndex = 4426, + SpvBuiltInDeviceIndex = 4438, + SpvBuiltInViewIndex = 4440, + SpvBuiltInBaryCoordNoPerspAMD = 4992, + SpvBuiltInBaryCoordNoPerspCentroidAMD = 4993, + SpvBuiltInBaryCoordNoPerspSampleAMD = 4994, + SpvBuiltInBaryCoordSmoothAMD = 4995, + SpvBuiltInBaryCoordSmoothCentroidAMD = 4996, + SpvBuiltInBaryCoordSmoothSampleAMD = 4997, + SpvBuiltInBaryCoordPullModelAMD = 4998, + SpvBuiltInFragStencilRefEXT = 5014, + SpvBuiltInViewportMaskNV = 5253, + SpvBuiltInSecondaryPositionNV = 5257, + SpvBuiltInSecondaryViewportMaskNV = 5258, + SpvBuiltInPositionPerViewNV = 5261, + SpvBuiltInViewportMaskPerViewNV = 5262, + SpvBuiltInMax = 0x7fffffff, +} SpvBuiltIn; + +typedef enum SpvSelectionControlShift_ { + SpvSelectionControlFlattenShift = 0, + SpvSelectionControlDontFlattenShift = 1, + SpvSelectionControlMax = 0x7fffffff, +} SpvSelectionControlShift; + +typedef enum SpvSelectionControlMask_ { + SpvSelectionControlMaskNone = 0, + SpvSelectionControlFlattenMask = 0x00000001, + SpvSelectionControlDontFlattenMask = 0x00000002, +} SpvSelectionControlMask; + +typedef enum SpvLoopControlShift_ { + SpvLoopControlUnrollShift = 0, + SpvLoopControlDontUnrollShift = 1, + SpvLoopControlMax = 0x7fffffff, +} SpvLoopControlShift; + +typedef enum SpvLoopControlMask_ { + SpvLoopControlMaskNone = 0, + SpvLoopControlUnrollMask = 0x00000001, + SpvLoopControlDontUnrollMask = 0x00000002, +} SpvLoopControlMask; + +typedef enum SpvFunctionControlShift_ { + SpvFunctionControlInlineShift = 0, + SpvFunctionControlDontInlineShift = 1, + SpvFunctionControlPureShift = 2, + SpvFunctionControlConstShift = 3, + SpvFunctionControlMax = 0x7fffffff, +} SpvFunctionControlShift; + +typedef enum SpvFunctionControlMask_ { + SpvFunctionControlMaskNone = 0, + SpvFunctionControlInlineMask = 0x00000001, + SpvFunctionControlDontInlineMask = 0x00000002, + SpvFunctionControlPureMask = 0x00000004, + SpvFunctionControlConstMask = 0x00000008, +} SpvFunctionControlMask; + +typedef enum SpvMemorySemanticsShift_ { + SpvMemorySemanticsAcquireShift = 1, + SpvMemorySemanticsReleaseShift = 2, + SpvMemorySemanticsAcquireReleaseShift = 3, + SpvMemorySemanticsSequentiallyConsistentShift = 4, + SpvMemorySemanticsUniformMemoryShift = 6, + SpvMemorySemanticsSubgroupMemoryShift = 7, + SpvMemorySemanticsWorkgroupMemoryShift = 8, + SpvMemorySemanticsCrossWorkgroupMemoryShift = 9, + SpvMemorySemanticsAtomicCounterMemoryShift = 10, + SpvMemorySemanticsImageMemoryShift = 11, + SpvMemorySemanticsMax = 0x7fffffff, +} SpvMemorySemanticsShift; + +typedef enum SpvMemorySemanticsMask_ { + SpvMemorySemanticsMaskNone = 0, + SpvMemorySemanticsAcquireMask = 0x00000002, + SpvMemorySemanticsReleaseMask = 0x00000004, + SpvMemorySemanticsAcquireReleaseMask = 0x00000008, + SpvMemorySemanticsSequentiallyConsistentMask = 0x00000010, + SpvMemorySemanticsUniformMemoryMask = 0x00000040, + SpvMemorySemanticsSubgroupMemoryMask = 0x00000080, + SpvMemorySemanticsWorkgroupMemoryMask = 0x00000100, + SpvMemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, + SpvMemorySemanticsAtomicCounterMemoryMask = 0x00000400, + SpvMemorySemanticsImageMemoryMask = 0x00000800, +} SpvMemorySemanticsMask; + +typedef enum SpvMemoryAccessShift_ { + SpvMemoryAccessVolatileShift = 0, + SpvMemoryAccessAlignedShift = 1, + SpvMemoryAccessNontemporalShift = 2, + SpvMemoryAccessMax = 0x7fffffff, +} SpvMemoryAccessShift; + +typedef enum SpvMemoryAccessMask_ { + SpvMemoryAccessMaskNone = 0, + SpvMemoryAccessVolatileMask = 0x00000001, + SpvMemoryAccessAlignedMask = 0x00000002, + SpvMemoryAccessNontemporalMask = 0x00000004, +} SpvMemoryAccessMask; + +typedef enum SpvScope_ { + SpvScopeCrossDevice = 0, + SpvScopeDevice = 1, + SpvScopeWorkgroup = 2, + SpvScopeSubgroup = 3, + SpvScopeInvocation = 4, + SpvScopeMax = 0x7fffffff, +} SpvScope; + +typedef enum SpvGroupOperation_ { + SpvGroupOperationReduce = 0, + SpvGroupOperationInclusiveScan = 1, + SpvGroupOperationExclusiveScan = 2, + SpvGroupOperationMax = 0x7fffffff, +} SpvGroupOperation; + +typedef enum SpvKernelEnqueueFlags_ { + SpvKernelEnqueueFlagsNoWait = 0, + SpvKernelEnqueueFlagsWaitKernel = 1, + SpvKernelEnqueueFlagsWaitWorkGroup = 2, + SpvKernelEnqueueFlagsMax = 0x7fffffff, +} SpvKernelEnqueueFlags; + +typedef enum SpvKernelProfilingInfoShift_ { + SpvKernelProfilingInfoCmdExecTimeShift = 0, + SpvKernelProfilingInfoMax = 0x7fffffff, +} SpvKernelProfilingInfoShift; + +typedef enum SpvKernelProfilingInfoMask_ { + SpvKernelProfilingInfoMaskNone = 0, + SpvKernelProfilingInfoCmdExecTimeMask = 0x00000001, +} SpvKernelProfilingInfoMask; + +typedef enum SpvCapability_ { + SpvCapabilityMatrix = 0, + SpvCapabilityShader = 1, + SpvCapabilityGeometry = 2, + SpvCapabilityTessellation = 3, + SpvCapabilityAddresses = 4, + SpvCapabilityLinkage = 5, + SpvCapabilityKernel = 6, + SpvCapabilityVector16 = 7, + SpvCapabilityFloat16Buffer = 8, + SpvCapabilityFloat16 = 9, + SpvCapabilityFloat64 = 10, + SpvCapabilityInt64 = 11, + SpvCapabilityInt64Atomics = 12, + SpvCapabilityImageBasic = 13, + SpvCapabilityImageReadWrite = 14, + SpvCapabilityImageMipmap = 15, + SpvCapabilityPipes = 17, + SpvCapabilityGroups = 18, + SpvCapabilityDeviceEnqueue = 19, + SpvCapabilityLiteralSampler = 20, + SpvCapabilityAtomicStorage = 21, + SpvCapabilityInt16 = 22, + SpvCapabilityTessellationPointSize = 23, + SpvCapabilityGeometryPointSize = 24, + SpvCapabilityImageGatherExtended = 25, + SpvCapabilityStorageImageMultisample = 27, + SpvCapabilityUniformBufferArrayDynamicIndexing = 28, + SpvCapabilitySampledImageArrayDynamicIndexing = 29, + SpvCapabilityStorageBufferArrayDynamicIndexing = 30, + SpvCapabilityStorageImageArrayDynamicIndexing = 31, + SpvCapabilityClipDistance = 32, + SpvCapabilityCullDistance = 33, + SpvCapabilityImageCubeArray = 34, + SpvCapabilitySampleRateShading = 35, + SpvCapabilityImageRect = 36, + SpvCapabilitySampledRect = 37, + SpvCapabilityGenericPointer = 38, + SpvCapabilityInt8 = 39, + SpvCapabilityInputAttachment = 40, + SpvCapabilitySparseResidency = 41, + SpvCapabilityMinLod = 42, + SpvCapabilitySampled1D = 43, + SpvCapabilityImage1D = 44, + SpvCapabilitySampledCubeArray = 45, + SpvCapabilitySampledBuffer = 46, + SpvCapabilityImageBuffer = 47, + SpvCapabilityImageMSArray = 48, + SpvCapabilityStorageImageExtendedFormats = 49, + SpvCapabilityImageQuery = 50, + SpvCapabilityDerivativeControl = 51, + SpvCapabilityInterpolationFunction = 52, + SpvCapabilityTransformFeedback = 53, + SpvCapabilityGeometryStreams = 54, + SpvCapabilityStorageImageReadWithoutFormat = 55, + SpvCapabilityStorageImageWriteWithoutFormat = 56, + SpvCapabilityMultiViewport = 57, + SpvCapabilitySubgroupBallotKHR = 4423, + SpvCapabilityDrawParameters = 4427, + SpvCapabilitySubgroupVoteKHR = 4431, + SpvCapabilityStorageBuffer16BitAccess = 4433, + SpvCapabilityStorageUniformBufferBlock16 = 4433, + SpvCapabilityStorageUniform16 = 4434, + SpvCapabilityUniformAndStorageBuffer16BitAccess = 4434, + SpvCapabilityStoragePushConstant16 = 4435, + SpvCapabilityStorageInputOutput16 = 4436, + SpvCapabilityDeviceGroup = 4437, + SpvCapabilityMultiView = 4439, + SpvCapabilityVariablePointersStorageBuffer = 4441, + SpvCapabilityVariablePointers = 4442, + SpvCapabilityAtomicStorageOps = 4445, + SpvCapabilitySampleMaskPostDepthCoverage = 4447, + SpvCapabilityImageGatherBiasLodAMD = 5009, + SpvCapabilityFragmentMaskAMD = 5010, + SpvCapabilityStencilExportEXT = 5013, + SpvCapabilityImageReadWriteLodAMD = 5015, + SpvCapabilitySampleMaskOverrideCoverageNV = 5249, + SpvCapabilityGeometryShaderPassthroughNV = 5251, + SpvCapabilityShaderViewportIndexLayerEXT = 5254, + SpvCapabilityShaderViewportIndexLayerNV = 5254, + SpvCapabilityShaderViewportMaskNV = 5255, + SpvCapabilityShaderStereoViewNV = 5259, + SpvCapabilityPerViewAttributesNV = 5260, + SpvCapabilitySubgroupShuffleINTEL = 5568, + SpvCapabilitySubgroupBufferBlockIOINTEL = 5569, + SpvCapabilitySubgroupImageBlockIOINTEL = 5570, + SpvCapabilityMax = 0x7fffffff, +} SpvCapability; + +typedef enum SpvOp_ { + SpvOpNop = 0, + SpvOpUndef = 1, + SpvOpSourceContinued = 2, + SpvOpSource = 3, + SpvOpSourceExtension = 4, + SpvOpName = 5, + SpvOpMemberName = 6, + SpvOpString = 7, + SpvOpLine = 8, + SpvOpExtension = 10, + SpvOpExtInstImport = 11, + SpvOpExtInst = 12, + SpvOpMemoryModel = 14, + SpvOpEntryPoint = 15, + SpvOpExecutionMode = 16, + SpvOpCapability = 17, + SpvOpTypeVoid = 19, + SpvOpTypeBool = 20, + SpvOpTypeInt = 21, + SpvOpTypeFloat = 22, + SpvOpTypeVector = 23, + SpvOpTypeMatrix = 24, + SpvOpTypeImage = 25, + SpvOpTypeSampler = 26, + SpvOpTypeSampledImage = 27, + SpvOpTypeArray = 28, + SpvOpTypeRuntimeArray = 29, + SpvOpTypeStruct = 30, + SpvOpTypeOpaque = 31, + SpvOpTypePointer = 32, + SpvOpTypeFunction = 33, + SpvOpTypeEvent = 34, + SpvOpTypeDeviceEvent = 35, + SpvOpTypeReserveId = 36, + SpvOpTypeQueue = 37, + SpvOpTypePipe = 38, + SpvOpTypeForwardPointer = 39, + SpvOpConstantTrue = 41, + SpvOpConstantFalse = 42, + SpvOpConstant = 43, + SpvOpConstantComposite = 44, + SpvOpConstantSampler = 45, + SpvOpConstantNull = 46, + SpvOpSpecConstantTrue = 48, + SpvOpSpecConstantFalse = 49, + SpvOpSpecConstant = 50, + SpvOpSpecConstantComposite = 51, + SpvOpSpecConstantOp = 52, + SpvOpFunction = 54, + SpvOpFunctionParameter = 55, + SpvOpFunctionEnd = 56, + SpvOpFunctionCall = 57, + SpvOpVariable = 59, + SpvOpImageTexelPointer = 60, + SpvOpLoad = 61, + SpvOpStore = 62, + SpvOpCopyMemory = 63, + SpvOpCopyMemorySized = 64, + SpvOpAccessChain = 65, + SpvOpInBoundsAccessChain = 66, + SpvOpPtrAccessChain = 67, + SpvOpArrayLength = 68, + SpvOpGenericPtrMemSemantics = 69, + SpvOpInBoundsPtrAccessChain = 70, + SpvOpDecorate = 71, + SpvOpMemberDecorate = 72, + SpvOpDecorationGroup = 73, + SpvOpGroupDecorate = 74, + SpvOpGroupMemberDecorate = 75, + SpvOpVectorExtractDynamic = 77, + SpvOpVectorInsertDynamic = 78, + SpvOpVectorShuffle = 79, + SpvOpCompositeConstruct = 80, + SpvOpCompositeExtract = 81, + SpvOpCompositeInsert = 82, + SpvOpCopyObject = 83, + SpvOpTranspose = 84, + SpvOpSampledImage = 86, + SpvOpImageSampleImplicitLod = 87, + SpvOpImageSampleExplicitLod = 88, + SpvOpImageSampleDrefImplicitLod = 89, + SpvOpImageSampleDrefExplicitLod = 90, + SpvOpImageSampleProjImplicitLod = 91, + SpvOpImageSampleProjExplicitLod = 92, + SpvOpImageSampleProjDrefImplicitLod = 93, + SpvOpImageSampleProjDrefExplicitLod = 94, + SpvOpImageFetch = 95, + SpvOpImageGather = 96, + SpvOpImageDrefGather = 97, + SpvOpImageRead = 98, + SpvOpImageWrite = 99, + SpvOpImage = 100, + SpvOpImageQueryFormat = 101, + SpvOpImageQueryOrder = 102, + SpvOpImageQuerySizeLod = 103, + SpvOpImageQuerySize = 104, + SpvOpImageQueryLod = 105, + SpvOpImageQueryLevels = 106, + SpvOpImageQuerySamples = 107, + SpvOpConvertFToU = 109, + SpvOpConvertFToS = 110, + SpvOpConvertSToF = 111, + SpvOpConvertUToF = 112, + SpvOpUConvert = 113, + SpvOpSConvert = 114, + SpvOpFConvert = 115, + SpvOpQuantizeToF16 = 116, + SpvOpConvertPtrToU = 117, + SpvOpSatConvertSToU = 118, + SpvOpSatConvertUToS = 119, + SpvOpConvertUToPtr = 120, + SpvOpPtrCastToGeneric = 121, + SpvOpGenericCastToPtr = 122, + SpvOpGenericCastToPtrExplicit = 123, + SpvOpBitcast = 124, + SpvOpSNegate = 126, + SpvOpFNegate = 127, + SpvOpIAdd = 128, + SpvOpFAdd = 129, + SpvOpISub = 130, + SpvOpFSub = 131, + SpvOpIMul = 132, + SpvOpFMul = 133, + SpvOpUDiv = 134, + SpvOpSDiv = 135, + SpvOpFDiv = 136, + SpvOpUMod = 137, + SpvOpSRem = 138, + SpvOpSMod = 139, + SpvOpFRem = 140, + SpvOpFMod = 141, + SpvOpVectorTimesScalar = 142, + SpvOpMatrixTimesScalar = 143, + SpvOpVectorTimesMatrix = 144, + SpvOpMatrixTimesVector = 145, + SpvOpMatrixTimesMatrix = 146, + SpvOpOuterProduct = 147, + SpvOpDot = 148, + SpvOpIAddCarry = 149, + SpvOpISubBorrow = 150, + SpvOpUMulExtended = 151, + SpvOpSMulExtended = 152, + SpvOpAny = 154, + SpvOpAll = 155, + SpvOpIsNan = 156, + SpvOpIsInf = 157, + SpvOpIsFinite = 158, + SpvOpIsNormal = 159, + SpvOpSignBitSet = 160, + SpvOpLessOrGreater = 161, + SpvOpOrdered = 162, + SpvOpUnordered = 163, + SpvOpLogicalEqual = 164, + SpvOpLogicalNotEqual = 165, + SpvOpLogicalOr = 166, + SpvOpLogicalAnd = 167, + SpvOpLogicalNot = 168, + SpvOpSelect = 169, + SpvOpIEqual = 170, + SpvOpINotEqual = 171, + SpvOpUGreaterThan = 172, + SpvOpSGreaterThan = 173, + SpvOpUGreaterThanEqual = 174, + SpvOpSGreaterThanEqual = 175, + SpvOpULessThan = 176, + SpvOpSLessThan = 177, + SpvOpULessThanEqual = 178, + SpvOpSLessThanEqual = 179, + SpvOpFOrdEqual = 180, + SpvOpFUnordEqual = 181, + SpvOpFOrdNotEqual = 182, + SpvOpFUnordNotEqual = 183, + SpvOpFOrdLessThan = 184, + SpvOpFUnordLessThan = 185, + SpvOpFOrdGreaterThan = 186, + SpvOpFUnordGreaterThan = 187, + SpvOpFOrdLessThanEqual = 188, + SpvOpFUnordLessThanEqual = 189, + SpvOpFOrdGreaterThanEqual = 190, + SpvOpFUnordGreaterThanEqual = 191, + SpvOpShiftRightLogical = 194, + SpvOpShiftRightArithmetic = 195, + SpvOpShiftLeftLogical = 196, + SpvOpBitwiseOr = 197, + SpvOpBitwiseXor = 198, + SpvOpBitwiseAnd = 199, + SpvOpNot = 200, + SpvOpBitFieldInsert = 201, + SpvOpBitFieldSExtract = 202, + SpvOpBitFieldUExtract = 203, + SpvOpBitReverse = 204, + SpvOpBitCount = 205, + SpvOpDPdx = 207, + SpvOpDPdy = 208, + SpvOpFwidth = 209, + SpvOpDPdxFine = 210, + SpvOpDPdyFine = 211, + SpvOpFwidthFine = 212, + SpvOpDPdxCoarse = 213, + SpvOpDPdyCoarse = 214, + SpvOpFwidthCoarse = 215, + SpvOpEmitVertex = 218, + SpvOpEndPrimitive = 219, + SpvOpEmitStreamVertex = 220, + SpvOpEndStreamPrimitive = 221, + SpvOpControlBarrier = 224, + SpvOpMemoryBarrier = 225, + SpvOpAtomicLoad = 227, + SpvOpAtomicStore = 228, + SpvOpAtomicExchange = 229, + SpvOpAtomicCompareExchange = 230, + SpvOpAtomicCompareExchangeWeak = 231, + SpvOpAtomicIIncrement = 232, + SpvOpAtomicIDecrement = 233, + SpvOpAtomicIAdd = 234, + SpvOpAtomicISub = 235, + SpvOpAtomicSMin = 236, + SpvOpAtomicUMin = 237, + SpvOpAtomicSMax = 238, + SpvOpAtomicUMax = 239, + SpvOpAtomicAnd = 240, + SpvOpAtomicOr = 241, + SpvOpAtomicXor = 242, + SpvOpPhi = 245, + SpvOpLoopMerge = 246, + SpvOpSelectionMerge = 247, + SpvOpLabel = 248, + SpvOpBranch = 249, + SpvOpBranchConditional = 250, + SpvOpSwitch = 251, + SpvOpKill = 252, + SpvOpReturn = 253, + SpvOpReturnValue = 254, + SpvOpUnreachable = 255, + SpvOpLifetimeStart = 256, + SpvOpLifetimeStop = 257, + SpvOpGroupAsyncCopy = 259, + SpvOpGroupWaitEvents = 260, + SpvOpGroupAll = 261, + SpvOpGroupAny = 262, + SpvOpGroupBroadcast = 263, + SpvOpGroupIAdd = 264, + SpvOpGroupFAdd = 265, + SpvOpGroupFMin = 266, + SpvOpGroupUMin = 267, + SpvOpGroupSMin = 268, + SpvOpGroupFMax = 269, + SpvOpGroupUMax = 270, + SpvOpGroupSMax = 271, + SpvOpReadPipe = 274, + SpvOpWritePipe = 275, + SpvOpReservedReadPipe = 276, + SpvOpReservedWritePipe = 277, + SpvOpReserveReadPipePackets = 278, + SpvOpReserveWritePipePackets = 279, + SpvOpCommitReadPipe = 280, + SpvOpCommitWritePipe = 281, + SpvOpIsValidReserveId = 282, + SpvOpGetNumPipePackets = 283, + SpvOpGetMaxPipePackets = 284, + SpvOpGroupReserveReadPipePackets = 285, + SpvOpGroupReserveWritePipePackets = 286, + SpvOpGroupCommitReadPipe = 287, + SpvOpGroupCommitWritePipe = 288, + SpvOpEnqueueMarker = 291, + SpvOpEnqueueKernel = 292, + SpvOpGetKernelNDrangeSubGroupCount = 293, + SpvOpGetKernelNDrangeMaxSubGroupSize = 294, + SpvOpGetKernelWorkGroupSize = 295, + SpvOpGetKernelPreferredWorkGroupSizeMultiple = 296, + SpvOpRetainEvent = 297, + SpvOpReleaseEvent = 298, + SpvOpCreateUserEvent = 299, + SpvOpIsValidEvent = 300, + SpvOpSetUserEventStatus = 301, + SpvOpCaptureEventProfilingInfo = 302, + SpvOpGetDefaultQueue = 303, + SpvOpBuildNDRange = 304, + SpvOpImageSparseSampleImplicitLod = 305, + SpvOpImageSparseSampleExplicitLod = 306, + SpvOpImageSparseSampleDrefImplicitLod = 307, + SpvOpImageSparseSampleDrefExplicitLod = 308, + SpvOpImageSparseSampleProjImplicitLod = 309, + SpvOpImageSparseSampleProjExplicitLod = 310, + SpvOpImageSparseSampleProjDrefImplicitLod = 311, + SpvOpImageSparseSampleProjDrefExplicitLod = 312, + SpvOpImageSparseFetch = 313, + SpvOpImageSparseGather = 314, + SpvOpImageSparseDrefGather = 315, + SpvOpImageSparseTexelsResident = 316, + SpvOpNoLine = 317, + SpvOpAtomicFlagTestAndSet = 318, + SpvOpAtomicFlagClear = 319, + SpvOpImageSparseRead = 320, + SpvOpDecorateId = 332, + SpvOpSubgroupBallotKHR = 4421, + SpvOpSubgroupFirstInvocationKHR = 4422, + SpvOpSubgroupAllKHR = 4428, + SpvOpSubgroupAnyKHR = 4429, + SpvOpSubgroupAllEqualKHR = 4430, + SpvOpSubgroupReadInvocationKHR = 4432, + SpvOpGroupIAddNonUniformAMD = 5000, + SpvOpGroupFAddNonUniformAMD = 5001, + SpvOpGroupFMinNonUniformAMD = 5002, + SpvOpGroupUMinNonUniformAMD = 5003, + SpvOpGroupSMinNonUniformAMD = 5004, + SpvOpGroupFMaxNonUniformAMD = 5005, + SpvOpGroupUMaxNonUniformAMD = 5006, + SpvOpGroupSMaxNonUniformAMD = 5007, + SpvOpFragmentMaskFetchAMD = 5011, + SpvOpFragmentFetchAMD = 5012, + SpvOpSubgroupShuffleINTEL = 5571, + SpvOpSubgroupShuffleDownINTEL = 5572, + SpvOpSubgroupShuffleUpINTEL = 5573, + SpvOpSubgroupShuffleXorINTEL = 5574, + SpvOpSubgroupBlockReadINTEL = 5575, + SpvOpSubgroupBlockWriteINTEL = 5576, + SpvOpSubgroupImageBlockReadINTEL = 5577, + SpvOpSubgroupImageBlockWriteINTEL = 5578, + SpvOpDecorateStringGOOGLE = 5632, + SpvOpMemberDecorateStringGOOGLE = 5633, + SpvOpMax = 0x7fffffff, +} SpvOp; + +#endif // #ifndef spirv_H + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.hpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.hpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.hpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.hpp 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1002 @@ +// Copyright (c) 2014-2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// This header is automatically generated by the same tool that creates +// the Binary Section of the SPIR-V specification. + +// Enumeration tokens for SPIR-V, in various styles: +// C, C++, C++11, JSON, Lua, Python +// +// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// +// Some tokens act like mask values, which can be OR'd together, +// while others are mutually exclusive. The mask-like ones have +// "Mask" in their name, and a parallel enum that has the shift +// amount (1 << x) for each corresponding enumerant. + +#ifndef spirv_HPP +#define spirv_HPP + +namespace spv { + +typedef unsigned int Id; + +#define SPV_VERSION 0x10000 +#define SPV_REVISION 12 + +static const unsigned int MagicNumber = 0x07230203; +static const unsigned int Version = 0x00010000; +static const unsigned int Revision = 12; +static const unsigned int OpCodeMask = 0xffff; +static const unsigned int WordCountShift = 16; + +enum SourceLanguage { + SourceLanguageUnknown = 0, + SourceLanguageESSL = 1, + SourceLanguageGLSL = 2, + SourceLanguageOpenCL_C = 3, + SourceLanguageOpenCL_CPP = 4, + SourceLanguageHLSL = 5, + SourceLanguageMax = 0x7fffffff, +}; + +enum ExecutionModel { + ExecutionModelVertex = 0, + ExecutionModelTessellationControl = 1, + ExecutionModelTessellationEvaluation = 2, + ExecutionModelGeometry = 3, + ExecutionModelFragment = 4, + ExecutionModelGLCompute = 5, + ExecutionModelKernel = 6, + ExecutionModelMax = 0x7fffffff, +}; + +enum AddressingModel { + AddressingModelLogical = 0, + AddressingModelPhysical32 = 1, + AddressingModelPhysical64 = 2, + AddressingModelMax = 0x7fffffff, +}; + +enum MemoryModel { + MemoryModelSimple = 0, + MemoryModelGLSL450 = 1, + MemoryModelOpenCL = 2, + MemoryModelMax = 0x7fffffff, +}; + +enum ExecutionMode { + ExecutionModeInvocations = 0, + ExecutionModeSpacingEqual = 1, + ExecutionModeSpacingFractionalEven = 2, + ExecutionModeSpacingFractionalOdd = 3, + ExecutionModeVertexOrderCw = 4, + ExecutionModeVertexOrderCcw = 5, + ExecutionModePixelCenterInteger = 6, + ExecutionModeOriginUpperLeft = 7, + ExecutionModeOriginLowerLeft = 8, + ExecutionModeEarlyFragmentTests = 9, + ExecutionModePointMode = 10, + ExecutionModeXfb = 11, + ExecutionModeDepthReplacing = 12, + ExecutionModeDepthGreater = 14, + ExecutionModeDepthLess = 15, + ExecutionModeDepthUnchanged = 16, + ExecutionModeLocalSize = 17, + ExecutionModeLocalSizeHint = 18, + ExecutionModeInputPoints = 19, + ExecutionModeInputLines = 20, + ExecutionModeInputLinesAdjacency = 21, + ExecutionModeTriangles = 22, + ExecutionModeInputTrianglesAdjacency = 23, + ExecutionModeQuads = 24, + ExecutionModeIsolines = 25, + ExecutionModeOutputVertices = 26, + ExecutionModeOutputPoints = 27, + ExecutionModeOutputLineStrip = 28, + ExecutionModeOutputTriangleStrip = 29, + ExecutionModeVecTypeHint = 30, + ExecutionModeContractionOff = 31, + ExecutionModePostDepthCoverage = 4446, + ExecutionModeStencilRefReplacingEXT = 5027, + ExecutionModeMax = 0x7fffffff, +}; + +enum StorageClass { + StorageClassUniformConstant = 0, + StorageClassInput = 1, + StorageClassUniform = 2, + StorageClassOutput = 3, + StorageClassWorkgroup = 4, + StorageClassCrossWorkgroup = 5, + StorageClassPrivate = 6, + StorageClassFunction = 7, + StorageClassGeneric = 8, + StorageClassPushConstant = 9, + StorageClassAtomicCounter = 10, + StorageClassImage = 11, + StorageClassStorageBuffer = 12, + StorageClassMax = 0x7fffffff, +}; + +enum Dim { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + DimCube = 3, + DimRect = 4, + DimBuffer = 5, + DimSubpassData = 6, + DimMax = 0x7fffffff, +}; + +enum SamplerAddressingMode { + SamplerAddressingModeNone = 0, + SamplerAddressingModeClampToEdge = 1, + SamplerAddressingModeClamp = 2, + SamplerAddressingModeRepeat = 3, + SamplerAddressingModeRepeatMirrored = 4, + SamplerAddressingModeMax = 0x7fffffff, +}; + +enum SamplerFilterMode { + SamplerFilterModeNearest = 0, + SamplerFilterModeLinear = 1, + SamplerFilterModeMax = 0x7fffffff, +}; + +enum ImageFormat { + ImageFormatUnknown = 0, + ImageFormatRgba32f = 1, + ImageFormatRgba16f = 2, + ImageFormatR32f = 3, + ImageFormatRgba8 = 4, + ImageFormatRgba8Snorm = 5, + ImageFormatRg32f = 6, + ImageFormatRg16f = 7, + ImageFormatR11fG11fB10f = 8, + ImageFormatR16f = 9, + ImageFormatRgba16 = 10, + ImageFormatRgb10A2 = 11, + ImageFormatRg16 = 12, + ImageFormatRg8 = 13, + ImageFormatR16 = 14, + ImageFormatR8 = 15, + ImageFormatRgba16Snorm = 16, + ImageFormatRg16Snorm = 17, + ImageFormatRg8Snorm = 18, + ImageFormatR16Snorm = 19, + ImageFormatR8Snorm = 20, + ImageFormatRgba32i = 21, + ImageFormatRgba16i = 22, + ImageFormatRgba8i = 23, + ImageFormatR32i = 24, + ImageFormatRg32i = 25, + ImageFormatRg16i = 26, + ImageFormatRg8i = 27, + ImageFormatR16i = 28, + ImageFormatR8i = 29, + ImageFormatRgba32ui = 30, + ImageFormatRgba16ui = 31, + ImageFormatRgba8ui = 32, + ImageFormatR32ui = 33, + ImageFormatRgb10a2ui = 34, + ImageFormatRg32ui = 35, + ImageFormatRg16ui = 36, + ImageFormatRg8ui = 37, + ImageFormatR16ui = 38, + ImageFormatR8ui = 39, + ImageFormatMax = 0x7fffffff, +}; + +enum ImageChannelOrder { + ImageChannelOrderR = 0, + ImageChannelOrderA = 1, + ImageChannelOrderRG = 2, + ImageChannelOrderRA = 3, + ImageChannelOrderRGB = 4, + ImageChannelOrderRGBA = 5, + ImageChannelOrderBGRA = 6, + ImageChannelOrderARGB = 7, + ImageChannelOrderIntensity = 8, + ImageChannelOrderLuminance = 9, + ImageChannelOrderRx = 10, + ImageChannelOrderRGx = 11, + ImageChannelOrderRGBx = 12, + ImageChannelOrderDepth = 13, + ImageChannelOrderDepthStencil = 14, + ImageChannelOrdersRGB = 15, + ImageChannelOrdersRGBx = 16, + ImageChannelOrdersRGBA = 17, + ImageChannelOrdersBGRA = 18, + ImageChannelOrderABGR = 19, + ImageChannelOrderMax = 0x7fffffff, +}; + +enum ImageChannelDataType { + ImageChannelDataTypeSnormInt8 = 0, + ImageChannelDataTypeSnormInt16 = 1, + ImageChannelDataTypeUnormInt8 = 2, + ImageChannelDataTypeUnormInt16 = 3, + ImageChannelDataTypeUnormShort565 = 4, + ImageChannelDataTypeUnormShort555 = 5, + ImageChannelDataTypeUnormInt101010 = 6, + ImageChannelDataTypeSignedInt8 = 7, + ImageChannelDataTypeSignedInt16 = 8, + ImageChannelDataTypeSignedInt32 = 9, + ImageChannelDataTypeUnsignedInt8 = 10, + ImageChannelDataTypeUnsignedInt16 = 11, + ImageChannelDataTypeUnsignedInt32 = 12, + ImageChannelDataTypeHalfFloat = 13, + ImageChannelDataTypeFloat = 14, + ImageChannelDataTypeUnormInt24 = 15, + ImageChannelDataTypeUnormInt101010_2 = 16, + ImageChannelDataTypeMax = 0x7fffffff, +}; + +enum ImageOperandsShift { + ImageOperandsBiasShift = 0, + ImageOperandsLodShift = 1, + ImageOperandsGradShift = 2, + ImageOperandsConstOffsetShift = 3, + ImageOperandsOffsetShift = 4, + ImageOperandsConstOffsetsShift = 5, + ImageOperandsSampleShift = 6, + ImageOperandsMinLodShift = 7, + ImageOperandsMax = 0x7fffffff, +}; + +enum ImageOperandsMask { + ImageOperandsMaskNone = 0, + ImageOperandsBiasMask = 0x00000001, + ImageOperandsLodMask = 0x00000002, + ImageOperandsGradMask = 0x00000004, + ImageOperandsConstOffsetMask = 0x00000008, + ImageOperandsOffsetMask = 0x00000010, + ImageOperandsConstOffsetsMask = 0x00000020, + ImageOperandsSampleMask = 0x00000040, + ImageOperandsMinLodMask = 0x00000080, +}; + +enum FPFastMathModeShift { + FPFastMathModeNotNaNShift = 0, + FPFastMathModeNotInfShift = 1, + FPFastMathModeNSZShift = 2, + FPFastMathModeAllowRecipShift = 3, + FPFastMathModeFastShift = 4, + FPFastMathModeMax = 0x7fffffff, +}; + +enum FPFastMathModeMask { + FPFastMathModeMaskNone = 0, + FPFastMathModeNotNaNMask = 0x00000001, + FPFastMathModeNotInfMask = 0x00000002, + FPFastMathModeNSZMask = 0x00000004, + FPFastMathModeAllowRecipMask = 0x00000008, + FPFastMathModeFastMask = 0x00000010, +}; + +enum FPRoundingMode { + FPRoundingModeRTE = 0, + FPRoundingModeRTZ = 1, + FPRoundingModeRTP = 2, + FPRoundingModeRTN = 3, + FPRoundingModeMax = 0x7fffffff, +}; + +enum LinkageType { + LinkageTypeExport = 0, + LinkageTypeImport = 1, + LinkageTypeMax = 0x7fffffff, +}; + +enum AccessQualifier { + AccessQualifierReadOnly = 0, + AccessQualifierWriteOnly = 1, + AccessQualifierReadWrite = 2, + AccessQualifierMax = 0x7fffffff, +}; + +enum FunctionParameterAttribute { + FunctionParameterAttributeZext = 0, + FunctionParameterAttributeSext = 1, + FunctionParameterAttributeByVal = 2, + FunctionParameterAttributeSret = 3, + FunctionParameterAttributeNoAlias = 4, + FunctionParameterAttributeNoCapture = 5, + FunctionParameterAttributeNoWrite = 6, + FunctionParameterAttributeNoReadWrite = 7, + FunctionParameterAttributeMax = 0x7fffffff, +}; + +enum Decoration { + DecorationRelaxedPrecision = 0, + DecorationSpecId = 1, + DecorationBlock = 2, + DecorationBufferBlock = 3, + DecorationRowMajor = 4, + DecorationColMajor = 5, + DecorationArrayStride = 6, + DecorationMatrixStride = 7, + DecorationGLSLShared = 8, + DecorationGLSLPacked = 9, + DecorationCPacked = 10, + DecorationBuiltIn = 11, + DecorationNoPerspective = 13, + DecorationFlat = 14, + DecorationPatch = 15, + DecorationCentroid = 16, + DecorationSample = 17, + DecorationInvariant = 18, + DecorationRestrict = 19, + DecorationAliased = 20, + DecorationVolatile = 21, + DecorationConstant = 22, + DecorationCoherent = 23, + DecorationNonWritable = 24, + DecorationNonReadable = 25, + DecorationUniform = 26, + DecorationSaturatedConversion = 28, + DecorationStream = 29, + DecorationLocation = 30, + DecorationComponent = 31, + DecorationIndex = 32, + DecorationBinding = 33, + DecorationDescriptorSet = 34, + DecorationOffset = 35, + DecorationXfbBuffer = 36, + DecorationXfbStride = 37, + DecorationFuncParamAttr = 38, + DecorationFPRoundingMode = 39, + DecorationFPFastMathMode = 40, + DecorationLinkageAttributes = 41, + DecorationNoContraction = 42, + DecorationInputAttachmentIndex = 43, + DecorationAlignment = 44, + DecorationExplicitInterpAMD = 4999, + DecorationOverrideCoverageNV = 5248, + DecorationPassthroughNV = 5250, + DecorationViewportRelativeNV = 5252, + DecorationSecondaryViewportRelativeNV = 5256, + DecorationHlslCounterBufferGOOGLE = 5634, + DecorationHlslSemanticGOOGLE = 5635, + DecorationMax = 0x7fffffff, +}; + +enum BuiltIn { + BuiltInPosition = 0, + BuiltInPointSize = 1, + BuiltInClipDistance = 3, + BuiltInCullDistance = 4, + BuiltInVertexId = 5, + BuiltInInstanceId = 6, + BuiltInPrimitiveId = 7, + BuiltInInvocationId = 8, + BuiltInLayer = 9, + BuiltInViewportIndex = 10, + BuiltInTessLevelOuter = 11, + BuiltInTessLevelInner = 12, + BuiltInTessCoord = 13, + BuiltInPatchVertices = 14, + BuiltInFragCoord = 15, + BuiltInPointCoord = 16, + BuiltInFrontFacing = 17, + BuiltInSampleId = 18, + BuiltInSamplePosition = 19, + BuiltInSampleMask = 20, + BuiltInFragDepth = 22, + BuiltInHelperInvocation = 23, + BuiltInNumWorkgroups = 24, + BuiltInWorkgroupSize = 25, + BuiltInWorkgroupId = 26, + BuiltInLocalInvocationId = 27, + BuiltInGlobalInvocationId = 28, + BuiltInLocalInvocationIndex = 29, + BuiltInWorkDim = 30, + BuiltInGlobalSize = 31, + BuiltInEnqueuedWorkgroupSize = 32, + BuiltInGlobalOffset = 33, + BuiltInGlobalLinearId = 34, + BuiltInSubgroupSize = 36, + BuiltInSubgroupMaxSize = 37, + BuiltInNumSubgroups = 38, + BuiltInNumEnqueuedSubgroups = 39, + BuiltInSubgroupId = 40, + BuiltInSubgroupLocalInvocationId = 41, + BuiltInVertexIndex = 42, + BuiltInInstanceIndex = 43, + BuiltInSubgroupEqMaskKHR = 4416, + BuiltInSubgroupGeMaskKHR = 4417, + BuiltInSubgroupGtMaskKHR = 4418, + BuiltInSubgroupLeMaskKHR = 4419, + BuiltInSubgroupLtMaskKHR = 4420, + BuiltInBaseVertex = 4424, + BuiltInBaseInstance = 4425, + BuiltInDrawIndex = 4426, + BuiltInDeviceIndex = 4438, + BuiltInViewIndex = 4440, + BuiltInBaryCoordNoPerspAMD = 4992, + BuiltInBaryCoordNoPerspCentroidAMD = 4993, + BuiltInBaryCoordNoPerspSampleAMD = 4994, + BuiltInBaryCoordSmoothAMD = 4995, + BuiltInBaryCoordSmoothCentroidAMD = 4996, + BuiltInBaryCoordSmoothSampleAMD = 4997, + BuiltInBaryCoordPullModelAMD = 4998, + BuiltInFragStencilRefEXT = 5014, + BuiltInViewportMaskNV = 5253, + BuiltInSecondaryPositionNV = 5257, + BuiltInSecondaryViewportMaskNV = 5258, + BuiltInPositionPerViewNV = 5261, + BuiltInViewportMaskPerViewNV = 5262, + BuiltInMax = 0x7fffffff, +}; + +enum SelectionControlShift { + SelectionControlFlattenShift = 0, + SelectionControlDontFlattenShift = 1, + SelectionControlMax = 0x7fffffff, +}; + +enum SelectionControlMask { + SelectionControlMaskNone = 0, + SelectionControlFlattenMask = 0x00000001, + SelectionControlDontFlattenMask = 0x00000002, +}; + +enum LoopControlShift { + LoopControlUnrollShift = 0, + LoopControlDontUnrollShift = 1, + LoopControlMax = 0x7fffffff, +}; + +enum LoopControlMask { + LoopControlMaskNone = 0, + LoopControlUnrollMask = 0x00000001, + LoopControlDontUnrollMask = 0x00000002, +}; + +enum FunctionControlShift { + FunctionControlInlineShift = 0, + FunctionControlDontInlineShift = 1, + FunctionControlPureShift = 2, + FunctionControlConstShift = 3, + FunctionControlMax = 0x7fffffff, +}; + +enum FunctionControlMask { + FunctionControlMaskNone = 0, + FunctionControlInlineMask = 0x00000001, + FunctionControlDontInlineMask = 0x00000002, + FunctionControlPureMask = 0x00000004, + FunctionControlConstMask = 0x00000008, +}; + +enum MemorySemanticsShift { + MemorySemanticsAcquireShift = 1, + MemorySemanticsReleaseShift = 2, + MemorySemanticsAcquireReleaseShift = 3, + MemorySemanticsSequentiallyConsistentShift = 4, + MemorySemanticsUniformMemoryShift = 6, + MemorySemanticsSubgroupMemoryShift = 7, + MemorySemanticsWorkgroupMemoryShift = 8, + MemorySemanticsCrossWorkgroupMemoryShift = 9, + MemorySemanticsAtomicCounterMemoryShift = 10, + MemorySemanticsImageMemoryShift = 11, + MemorySemanticsMax = 0x7fffffff, +}; + +enum MemorySemanticsMask { + MemorySemanticsMaskNone = 0, + MemorySemanticsAcquireMask = 0x00000002, + MemorySemanticsReleaseMask = 0x00000004, + MemorySemanticsAcquireReleaseMask = 0x00000008, + MemorySemanticsSequentiallyConsistentMask = 0x00000010, + MemorySemanticsUniformMemoryMask = 0x00000040, + MemorySemanticsSubgroupMemoryMask = 0x00000080, + MemorySemanticsWorkgroupMemoryMask = 0x00000100, + MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, + MemorySemanticsAtomicCounterMemoryMask = 0x00000400, + MemorySemanticsImageMemoryMask = 0x00000800, +}; + +enum MemoryAccessShift { + MemoryAccessVolatileShift = 0, + MemoryAccessAlignedShift = 1, + MemoryAccessNontemporalShift = 2, + MemoryAccessMax = 0x7fffffff, +}; + +enum MemoryAccessMask { + MemoryAccessMaskNone = 0, + MemoryAccessVolatileMask = 0x00000001, + MemoryAccessAlignedMask = 0x00000002, + MemoryAccessNontemporalMask = 0x00000004, +}; + +enum Scope { + ScopeCrossDevice = 0, + ScopeDevice = 1, + ScopeWorkgroup = 2, + ScopeSubgroup = 3, + ScopeInvocation = 4, + ScopeMax = 0x7fffffff, +}; + +enum GroupOperation { + GroupOperationReduce = 0, + GroupOperationInclusiveScan = 1, + GroupOperationExclusiveScan = 2, + GroupOperationMax = 0x7fffffff, +}; + +enum KernelEnqueueFlags { + KernelEnqueueFlagsNoWait = 0, + KernelEnqueueFlagsWaitKernel = 1, + KernelEnqueueFlagsWaitWorkGroup = 2, + KernelEnqueueFlagsMax = 0x7fffffff, +}; + +enum KernelProfilingInfoShift { + KernelProfilingInfoCmdExecTimeShift = 0, + KernelProfilingInfoMax = 0x7fffffff, +}; + +enum KernelProfilingInfoMask { + KernelProfilingInfoMaskNone = 0, + KernelProfilingInfoCmdExecTimeMask = 0x00000001, +}; + +enum Capability { + CapabilityMatrix = 0, + CapabilityShader = 1, + CapabilityGeometry = 2, + CapabilityTessellation = 3, + CapabilityAddresses = 4, + CapabilityLinkage = 5, + CapabilityKernel = 6, + CapabilityVector16 = 7, + CapabilityFloat16Buffer = 8, + CapabilityFloat16 = 9, + CapabilityFloat64 = 10, + CapabilityInt64 = 11, + CapabilityInt64Atomics = 12, + CapabilityImageBasic = 13, + CapabilityImageReadWrite = 14, + CapabilityImageMipmap = 15, + CapabilityPipes = 17, + CapabilityGroups = 18, + CapabilityDeviceEnqueue = 19, + CapabilityLiteralSampler = 20, + CapabilityAtomicStorage = 21, + CapabilityInt16 = 22, + CapabilityTessellationPointSize = 23, + CapabilityGeometryPointSize = 24, + CapabilityImageGatherExtended = 25, + CapabilityStorageImageMultisample = 27, + CapabilityUniformBufferArrayDynamicIndexing = 28, + CapabilitySampledImageArrayDynamicIndexing = 29, + CapabilityStorageBufferArrayDynamicIndexing = 30, + CapabilityStorageImageArrayDynamicIndexing = 31, + CapabilityClipDistance = 32, + CapabilityCullDistance = 33, + CapabilityImageCubeArray = 34, + CapabilitySampleRateShading = 35, + CapabilityImageRect = 36, + CapabilitySampledRect = 37, + CapabilityGenericPointer = 38, + CapabilityInt8 = 39, + CapabilityInputAttachment = 40, + CapabilitySparseResidency = 41, + CapabilityMinLod = 42, + CapabilitySampled1D = 43, + CapabilityImage1D = 44, + CapabilitySampledCubeArray = 45, + CapabilitySampledBuffer = 46, + CapabilityImageBuffer = 47, + CapabilityImageMSArray = 48, + CapabilityStorageImageExtendedFormats = 49, + CapabilityImageQuery = 50, + CapabilityDerivativeControl = 51, + CapabilityInterpolationFunction = 52, + CapabilityTransformFeedback = 53, + CapabilityGeometryStreams = 54, + CapabilityStorageImageReadWithoutFormat = 55, + CapabilityStorageImageWriteWithoutFormat = 56, + CapabilityMultiViewport = 57, + CapabilitySubgroupBallotKHR = 4423, + CapabilityDrawParameters = 4427, + CapabilitySubgroupVoteKHR = 4431, + CapabilityStorageBuffer16BitAccess = 4433, + CapabilityStorageUniformBufferBlock16 = 4433, + CapabilityStorageUniform16 = 4434, + CapabilityUniformAndStorageBuffer16BitAccess = 4434, + CapabilityStoragePushConstant16 = 4435, + CapabilityStorageInputOutput16 = 4436, + CapabilityDeviceGroup = 4437, + CapabilityMultiView = 4439, + CapabilityVariablePointersStorageBuffer = 4441, + CapabilityVariablePointers = 4442, + CapabilityAtomicStorageOps = 4445, + CapabilitySampleMaskPostDepthCoverage = 4447, + CapabilityImageGatherBiasLodAMD = 5009, + CapabilityFragmentMaskAMD = 5010, + CapabilityStencilExportEXT = 5013, + CapabilityImageReadWriteLodAMD = 5015, + CapabilitySampleMaskOverrideCoverageNV = 5249, + CapabilityGeometryShaderPassthroughNV = 5251, + CapabilityShaderViewportIndexLayerEXT = 5254, + CapabilityShaderViewportIndexLayerNV = 5254, + CapabilityShaderViewportMaskNV = 5255, + CapabilityShaderStereoViewNV = 5259, + CapabilityPerViewAttributesNV = 5260, + CapabilitySubgroupShuffleINTEL = 5568, + CapabilitySubgroupBufferBlockIOINTEL = 5569, + CapabilitySubgroupImageBlockIOINTEL = 5570, + CapabilityMax = 0x7fffffff, +}; + +enum Op { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpDecorateId = 332, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpSubgroupReadInvocationKHR = 4432, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateStringGOOGLE = 5633, + OpMax = 0x7fffffff, +}; + +// Overload operator| for mask bit combining + +inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } + +} // end namespace spv + +#endif // #ifndef spirv_HPP + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.hpp11 vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.hpp11 --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.hpp11 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.hpp11 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1002 @@ +// Copyright (c) 2014-2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// This header is automatically generated by the same tool that creates +// the Binary Section of the SPIR-V specification. + +// Enumeration tokens for SPIR-V, in various styles: +// C, C++, C++11, JSON, Lua, Python +// +// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// +// Some tokens act like mask values, which can be OR'd together, +// while others are mutually exclusive. The mask-like ones have +// "Mask" in their name, and a parallel enum that has the shift +// amount (1 << x) for each corresponding enumerant. + +#ifndef spirv_HPP +#define spirv_HPP + +namespace spv { + +typedef unsigned int Id; + +#define SPV_VERSION 0x10000 +#define SPV_REVISION 12 + +static const unsigned int MagicNumber = 0x07230203; +static const unsigned int Version = 0x00010000; +static const unsigned int Revision = 12; +static const unsigned int OpCodeMask = 0xffff; +static const unsigned int WordCountShift = 16; + +enum class SourceLanguage : unsigned { + Unknown = 0, + ESSL = 1, + GLSL = 2, + OpenCL_C = 3, + OpenCL_CPP = 4, + HLSL = 5, + Max = 0x7fffffff, +}; + +enum class ExecutionModel : unsigned { + Vertex = 0, + TessellationControl = 1, + TessellationEvaluation = 2, + Geometry = 3, + Fragment = 4, + GLCompute = 5, + Kernel = 6, + Max = 0x7fffffff, +}; + +enum class AddressingModel : unsigned { + Logical = 0, + Physical32 = 1, + Physical64 = 2, + Max = 0x7fffffff, +}; + +enum class MemoryModel : unsigned { + Simple = 0, + GLSL450 = 1, + OpenCL = 2, + Max = 0x7fffffff, +}; + +enum class ExecutionMode : unsigned { + Invocations = 0, + SpacingEqual = 1, + SpacingFractionalEven = 2, + SpacingFractionalOdd = 3, + VertexOrderCw = 4, + VertexOrderCcw = 5, + PixelCenterInteger = 6, + OriginUpperLeft = 7, + OriginLowerLeft = 8, + EarlyFragmentTests = 9, + PointMode = 10, + Xfb = 11, + DepthReplacing = 12, + DepthGreater = 14, + DepthLess = 15, + DepthUnchanged = 16, + LocalSize = 17, + LocalSizeHint = 18, + InputPoints = 19, + InputLines = 20, + InputLinesAdjacency = 21, + Triangles = 22, + InputTrianglesAdjacency = 23, + Quads = 24, + Isolines = 25, + OutputVertices = 26, + OutputPoints = 27, + OutputLineStrip = 28, + OutputTriangleStrip = 29, + VecTypeHint = 30, + ContractionOff = 31, + PostDepthCoverage = 4446, + StencilRefReplacingEXT = 5027, + Max = 0x7fffffff, +}; + +enum class StorageClass : unsigned { + UniformConstant = 0, + Input = 1, + Uniform = 2, + Output = 3, + Workgroup = 4, + CrossWorkgroup = 5, + Private = 6, + Function = 7, + Generic = 8, + PushConstant = 9, + AtomicCounter = 10, + Image = 11, + StorageBuffer = 12, + Max = 0x7fffffff, +}; + +enum class Dim : unsigned { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + Cube = 3, + Rect = 4, + Buffer = 5, + SubpassData = 6, + Max = 0x7fffffff, +}; + +enum class SamplerAddressingMode : unsigned { + None = 0, + ClampToEdge = 1, + Clamp = 2, + Repeat = 3, + RepeatMirrored = 4, + Max = 0x7fffffff, +}; + +enum class SamplerFilterMode : unsigned { + Nearest = 0, + Linear = 1, + Max = 0x7fffffff, +}; + +enum class ImageFormat : unsigned { + Unknown = 0, + Rgba32f = 1, + Rgba16f = 2, + R32f = 3, + Rgba8 = 4, + Rgba8Snorm = 5, + Rg32f = 6, + Rg16f = 7, + R11fG11fB10f = 8, + R16f = 9, + Rgba16 = 10, + Rgb10A2 = 11, + Rg16 = 12, + Rg8 = 13, + R16 = 14, + R8 = 15, + Rgba16Snorm = 16, + Rg16Snorm = 17, + Rg8Snorm = 18, + R16Snorm = 19, + R8Snorm = 20, + Rgba32i = 21, + Rgba16i = 22, + Rgba8i = 23, + R32i = 24, + Rg32i = 25, + Rg16i = 26, + Rg8i = 27, + R16i = 28, + R8i = 29, + Rgba32ui = 30, + Rgba16ui = 31, + Rgba8ui = 32, + R32ui = 33, + Rgb10a2ui = 34, + Rg32ui = 35, + Rg16ui = 36, + Rg8ui = 37, + R16ui = 38, + R8ui = 39, + Max = 0x7fffffff, +}; + +enum class ImageChannelOrder : unsigned { + R = 0, + A = 1, + RG = 2, + RA = 3, + RGB = 4, + RGBA = 5, + BGRA = 6, + ARGB = 7, + Intensity = 8, + Luminance = 9, + Rx = 10, + RGx = 11, + RGBx = 12, + Depth = 13, + DepthStencil = 14, + sRGB = 15, + sRGBx = 16, + sRGBA = 17, + sBGRA = 18, + ABGR = 19, + Max = 0x7fffffff, +}; + +enum class ImageChannelDataType : unsigned { + SnormInt8 = 0, + SnormInt16 = 1, + UnormInt8 = 2, + UnormInt16 = 3, + UnormShort565 = 4, + UnormShort555 = 5, + UnormInt101010 = 6, + SignedInt8 = 7, + SignedInt16 = 8, + SignedInt32 = 9, + UnsignedInt8 = 10, + UnsignedInt16 = 11, + UnsignedInt32 = 12, + HalfFloat = 13, + Float = 14, + UnormInt24 = 15, + UnormInt101010_2 = 16, + Max = 0x7fffffff, +}; + +enum class ImageOperandsShift : unsigned { + Bias = 0, + Lod = 1, + Grad = 2, + ConstOffset = 3, + Offset = 4, + ConstOffsets = 5, + Sample = 6, + MinLod = 7, + Max = 0x7fffffff, +}; + +enum class ImageOperandsMask : unsigned { + MaskNone = 0, + Bias = 0x00000001, + Lod = 0x00000002, + Grad = 0x00000004, + ConstOffset = 0x00000008, + Offset = 0x00000010, + ConstOffsets = 0x00000020, + Sample = 0x00000040, + MinLod = 0x00000080, +}; + +enum class FPFastMathModeShift : unsigned { + NotNaN = 0, + NotInf = 1, + NSZ = 2, + AllowRecip = 3, + Fast = 4, + Max = 0x7fffffff, +}; + +enum class FPFastMathModeMask : unsigned { + MaskNone = 0, + NotNaN = 0x00000001, + NotInf = 0x00000002, + NSZ = 0x00000004, + AllowRecip = 0x00000008, + Fast = 0x00000010, +}; + +enum class FPRoundingMode : unsigned { + RTE = 0, + RTZ = 1, + RTP = 2, + RTN = 3, + Max = 0x7fffffff, +}; + +enum class LinkageType : unsigned { + Export = 0, + Import = 1, + Max = 0x7fffffff, +}; + +enum class AccessQualifier : unsigned { + ReadOnly = 0, + WriteOnly = 1, + ReadWrite = 2, + Max = 0x7fffffff, +}; + +enum class FunctionParameterAttribute : unsigned { + Zext = 0, + Sext = 1, + ByVal = 2, + Sret = 3, + NoAlias = 4, + NoCapture = 5, + NoWrite = 6, + NoReadWrite = 7, + Max = 0x7fffffff, +}; + +enum class Decoration : unsigned { + RelaxedPrecision = 0, + SpecId = 1, + Block = 2, + BufferBlock = 3, + RowMajor = 4, + ColMajor = 5, + ArrayStride = 6, + MatrixStride = 7, + GLSLShared = 8, + GLSLPacked = 9, + CPacked = 10, + BuiltIn = 11, + NoPerspective = 13, + Flat = 14, + Patch = 15, + Centroid = 16, + Sample = 17, + Invariant = 18, + Restrict = 19, + Aliased = 20, + Volatile = 21, + Constant = 22, + Coherent = 23, + NonWritable = 24, + NonReadable = 25, + Uniform = 26, + SaturatedConversion = 28, + Stream = 29, + Location = 30, + Component = 31, + Index = 32, + Binding = 33, + DescriptorSet = 34, + Offset = 35, + XfbBuffer = 36, + XfbStride = 37, + FuncParamAttr = 38, + FPRoundingMode = 39, + FPFastMathMode = 40, + LinkageAttributes = 41, + NoContraction = 42, + InputAttachmentIndex = 43, + Alignment = 44, + ExplicitInterpAMD = 4999, + OverrideCoverageNV = 5248, + PassthroughNV = 5250, + ViewportRelativeNV = 5252, + SecondaryViewportRelativeNV = 5256, + HlslCounterBufferGOOGLE = 5634, + HlslSemanticGOOGLE = 5635, + Max = 0x7fffffff, +}; + +enum class BuiltIn : unsigned { + Position = 0, + PointSize = 1, + ClipDistance = 3, + CullDistance = 4, + VertexId = 5, + InstanceId = 6, + PrimitiveId = 7, + InvocationId = 8, + Layer = 9, + ViewportIndex = 10, + TessLevelOuter = 11, + TessLevelInner = 12, + TessCoord = 13, + PatchVertices = 14, + FragCoord = 15, + PointCoord = 16, + FrontFacing = 17, + SampleId = 18, + SamplePosition = 19, + SampleMask = 20, + FragDepth = 22, + HelperInvocation = 23, + NumWorkgroups = 24, + WorkgroupSize = 25, + WorkgroupId = 26, + LocalInvocationId = 27, + GlobalInvocationId = 28, + LocalInvocationIndex = 29, + WorkDim = 30, + GlobalSize = 31, + EnqueuedWorkgroupSize = 32, + GlobalOffset = 33, + GlobalLinearId = 34, + SubgroupSize = 36, + SubgroupMaxSize = 37, + NumSubgroups = 38, + NumEnqueuedSubgroups = 39, + SubgroupId = 40, + SubgroupLocalInvocationId = 41, + VertexIndex = 42, + InstanceIndex = 43, + SubgroupEqMaskKHR = 4416, + SubgroupGeMaskKHR = 4417, + SubgroupGtMaskKHR = 4418, + SubgroupLeMaskKHR = 4419, + SubgroupLtMaskKHR = 4420, + BaseVertex = 4424, + BaseInstance = 4425, + DrawIndex = 4426, + DeviceIndex = 4438, + ViewIndex = 4440, + BaryCoordNoPerspAMD = 4992, + BaryCoordNoPerspCentroidAMD = 4993, + BaryCoordNoPerspSampleAMD = 4994, + BaryCoordSmoothAMD = 4995, + BaryCoordSmoothCentroidAMD = 4996, + BaryCoordSmoothSampleAMD = 4997, + BaryCoordPullModelAMD = 4998, + FragStencilRefEXT = 5014, + ViewportMaskNV = 5253, + SecondaryPositionNV = 5257, + SecondaryViewportMaskNV = 5258, + PositionPerViewNV = 5261, + ViewportMaskPerViewNV = 5262, + Max = 0x7fffffff, +}; + +enum class SelectionControlShift : unsigned { + Flatten = 0, + DontFlatten = 1, + Max = 0x7fffffff, +}; + +enum class SelectionControlMask : unsigned { + MaskNone = 0, + Flatten = 0x00000001, + DontFlatten = 0x00000002, +}; + +enum class LoopControlShift : unsigned { + Unroll = 0, + DontUnroll = 1, + Max = 0x7fffffff, +}; + +enum class LoopControlMask : unsigned { + MaskNone = 0, + Unroll = 0x00000001, + DontUnroll = 0x00000002, +}; + +enum class FunctionControlShift : unsigned { + Inline = 0, + DontInline = 1, + Pure = 2, + Const = 3, + Max = 0x7fffffff, +}; + +enum class FunctionControlMask : unsigned { + MaskNone = 0, + Inline = 0x00000001, + DontInline = 0x00000002, + Pure = 0x00000004, + Const = 0x00000008, +}; + +enum class MemorySemanticsShift : unsigned { + Acquire = 1, + Release = 2, + AcquireRelease = 3, + SequentiallyConsistent = 4, + UniformMemory = 6, + SubgroupMemory = 7, + WorkgroupMemory = 8, + CrossWorkgroupMemory = 9, + AtomicCounterMemory = 10, + ImageMemory = 11, + Max = 0x7fffffff, +}; + +enum class MemorySemanticsMask : unsigned { + MaskNone = 0, + Acquire = 0x00000002, + Release = 0x00000004, + AcquireRelease = 0x00000008, + SequentiallyConsistent = 0x00000010, + UniformMemory = 0x00000040, + SubgroupMemory = 0x00000080, + WorkgroupMemory = 0x00000100, + CrossWorkgroupMemory = 0x00000200, + AtomicCounterMemory = 0x00000400, + ImageMemory = 0x00000800, +}; + +enum class MemoryAccessShift : unsigned { + Volatile = 0, + Aligned = 1, + Nontemporal = 2, + Max = 0x7fffffff, +}; + +enum class MemoryAccessMask : unsigned { + MaskNone = 0, + Volatile = 0x00000001, + Aligned = 0x00000002, + Nontemporal = 0x00000004, +}; + +enum class Scope : unsigned { + CrossDevice = 0, + Device = 1, + Workgroup = 2, + Subgroup = 3, + Invocation = 4, + Max = 0x7fffffff, +}; + +enum class GroupOperation : unsigned { + Reduce = 0, + InclusiveScan = 1, + ExclusiveScan = 2, + Max = 0x7fffffff, +}; + +enum class KernelEnqueueFlags : unsigned { + NoWait = 0, + WaitKernel = 1, + WaitWorkGroup = 2, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoShift : unsigned { + CmdExecTime = 0, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoMask : unsigned { + MaskNone = 0, + CmdExecTime = 0x00000001, +}; + +enum class Capability : unsigned { + Matrix = 0, + Shader = 1, + Geometry = 2, + Tessellation = 3, + Addresses = 4, + Linkage = 5, + Kernel = 6, + Vector16 = 7, + Float16Buffer = 8, + Float16 = 9, + Float64 = 10, + Int64 = 11, + Int64Atomics = 12, + ImageBasic = 13, + ImageReadWrite = 14, + ImageMipmap = 15, + Pipes = 17, + Groups = 18, + DeviceEnqueue = 19, + LiteralSampler = 20, + AtomicStorage = 21, + Int16 = 22, + TessellationPointSize = 23, + GeometryPointSize = 24, + ImageGatherExtended = 25, + StorageImageMultisample = 27, + UniformBufferArrayDynamicIndexing = 28, + SampledImageArrayDynamicIndexing = 29, + StorageBufferArrayDynamicIndexing = 30, + StorageImageArrayDynamicIndexing = 31, + ClipDistance = 32, + CullDistance = 33, + ImageCubeArray = 34, + SampleRateShading = 35, + ImageRect = 36, + SampledRect = 37, + GenericPointer = 38, + Int8 = 39, + InputAttachment = 40, + SparseResidency = 41, + MinLod = 42, + Sampled1D = 43, + Image1D = 44, + SampledCubeArray = 45, + SampledBuffer = 46, + ImageBuffer = 47, + ImageMSArray = 48, + StorageImageExtendedFormats = 49, + ImageQuery = 50, + DerivativeControl = 51, + InterpolationFunction = 52, + TransformFeedback = 53, + GeometryStreams = 54, + StorageImageReadWithoutFormat = 55, + StorageImageWriteWithoutFormat = 56, + MultiViewport = 57, + SubgroupBallotKHR = 4423, + DrawParameters = 4427, + SubgroupVoteKHR = 4431, + StorageBuffer16BitAccess = 4433, + StorageUniformBufferBlock16 = 4433, + StorageUniform16 = 4434, + UniformAndStorageBuffer16BitAccess = 4434, + StoragePushConstant16 = 4435, + StorageInputOutput16 = 4436, + DeviceGroup = 4437, + MultiView = 4439, + VariablePointersStorageBuffer = 4441, + VariablePointers = 4442, + AtomicStorageOps = 4445, + SampleMaskPostDepthCoverage = 4447, + ImageGatherBiasLodAMD = 5009, + FragmentMaskAMD = 5010, + StencilExportEXT = 5013, + ImageReadWriteLodAMD = 5015, + SampleMaskOverrideCoverageNV = 5249, + GeometryShaderPassthroughNV = 5251, + ShaderViewportIndexLayerEXT = 5254, + ShaderViewportIndexLayerNV = 5254, + ShaderViewportMaskNV = 5255, + ShaderStereoViewNV = 5259, + PerViewAttributesNV = 5260, + SubgroupShuffleINTEL = 5568, + SubgroupBufferBlockIOINTEL = 5569, + SubgroupImageBlockIOINTEL = 5570, + Max = 0x7fffffff, +}; + +enum class Op : unsigned { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpDecorateId = 332, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpSubgroupReadInvocationKHR = 4432, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateStringGOOGLE = 5633, + Max = 0x7fffffff, +}; + +// Overload operator| for mask bit combining + +inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } + +} // end namespace spv + +#endif // #ifndef spirv_HPP + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.json 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1020 @@ +{ + "spv": + { + "meta": + { + "Comment": + [ + [ + "Copyright (c) 2014-2018 The Khronos Group Inc.", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and/or associated documentation files (the \"Materials\"),", + "to deal in the Materials without restriction, including without limitation", + "the rights to use, copy, modify, merge, publish, distribute, sublicense,", + "and/or sell copies of the Materials, and to permit persons to whom the", + "Materials are furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Materials.", + "", + "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", + "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", + "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", + "", + "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", + "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", + "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", + "IN THE MATERIALS." + ], + [ + "This header is automatically generated by the same tool that creates", + "the Binary Section of the SPIR-V specification." + ], + [ + "Enumeration tokens for SPIR-V, in various styles:", + " C, C++, C++11, JSON, Lua, Python", + "", + "- C will have tokens with a \"Spv\" prefix, e.g.: SpvSourceLanguageGLSL", + "- C++ will have tokens in the \"spv\" name space, e.g.: spv::SourceLanguageGLSL", + "- C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL", + "- Lua will use tables, e.g.: spv.SourceLanguage.GLSL", + "- Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']", + "", + "Some tokens act like mask values, which can be OR'd together,", + "while others are mutually exclusive. The mask-like ones have", + "\"Mask\" in their name, and a parallel enum that has the shift", + "amount (1 << x) for each corresponding enumerant." + ] + ], + "MagicNumber": 119734787, + "Version": 65536, + "Revision": 12, + "OpCodeMask": 65535, + "WordCountShift": 16 + }, + "enum": + [ + { + "Name": "SourceLanguage", + "Type": "Value", + "Values": + { + "Unknown": 0, + "ESSL": 1, + "GLSL": 2, + "OpenCL_C": 3, + "OpenCL_CPP": 4, + "HLSL": 5 + } + }, + { + "Name": "ExecutionModel", + "Type": "Value", + "Values": + { + "Vertex": 0, + "TessellationControl": 1, + "TessellationEvaluation": 2, + "Geometry": 3, + "Fragment": 4, + "GLCompute": 5, + "Kernel": 6 + } + }, + { + "Name": "AddressingModel", + "Type": "Value", + "Values": + { + "Logical": 0, + "Physical32": 1, + "Physical64": 2 + } + }, + { + "Name": "MemoryModel", + "Type": "Value", + "Values": + { + "Simple": 0, + "GLSL450": 1, + "OpenCL": 2 + } + }, + { + "Name": "ExecutionMode", + "Type": "Value", + "Values": + { + "Invocations": 0, + "SpacingEqual": 1, + "SpacingFractionalEven": 2, + "SpacingFractionalOdd": 3, + "VertexOrderCw": 4, + "VertexOrderCcw": 5, + "PixelCenterInteger": 6, + "OriginUpperLeft": 7, + "OriginLowerLeft": 8, + "EarlyFragmentTests": 9, + "PointMode": 10, + "Xfb": 11, + "DepthReplacing": 12, + "DepthGreater": 14, + "DepthLess": 15, + "DepthUnchanged": 16, + "LocalSize": 17, + "LocalSizeHint": 18, + "InputPoints": 19, + "InputLines": 20, + "InputLinesAdjacency": 21, + "Triangles": 22, + "InputTrianglesAdjacency": 23, + "Quads": 24, + "Isolines": 25, + "OutputVertices": 26, + "OutputPoints": 27, + "OutputLineStrip": 28, + "OutputTriangleStrip": 29, + "VecTypeHint": 30, + "ContractionOff": 31, + "PostDepthCoverage": 4446, + "StencilRefReplacingEXT": 5027 + } + }, + { + "Name": "StorageClass", + "Type": "Value", + "Values": + { + "UniformConstant": 0, + "Input": 1, + "Uniform": 2, + "Output": 3, + "Workgroup": 4, + "CrossWorkgroup": 5, + "Private": 6, + "Function": 7, + "Generic": 8, + "PushConstant": 9, + "AtomicCounter": 10, + "Image": 11, + "StorageBuffer": 12 + } + }, + { + "Name": "Dim", + "Type": "Value", + "Values": + { + "Dim1D": 0, + "Dim2D": 1, + "Dim3D": 2, + "Cube": 3, + "Rect": 4, + "Buffer": 5, + "SubpassData": 6 + } + }, + { + "Name": "SamplerAddressingMode", + "Type": "Value", + "Values": + { + "None": 0, + "ClampToEdge": 1, + "Clamp": 2, + "Repeat": 3, + "RepeatMirrored": 4 + } + }, + { + "Name": "SamplerFilterMode", + "Type": "Value", + "Values": + { + "Nearest": 0, + "Linear": 1 + } + }, + { + "Name": "ImageFormat", + "Type": "Value", + "Values": + { + "Unknown": 0, + "Rgba32f": 1, + "Rgba16f": 2, + "R32f": 3, + "Rgba8": 4, + "Rgba8Snorm": 5, + "Rg32f": 6, + "Rg16f": 7, + "R11fG11fB10f": 8, + "R16f": 9, + "Rgba16": 10, + "Rgb10A2": 11, + "Rg16": 12, + "Rg8": 13, + "R16": 14, + "R8": 15, + "Rgba16Snorm": 16, + "Rg16Snorm": 17, + "Rg8Snorm": 18, + "R16Snorm": 19, + "R8Snorm": 20, + "Rgba32i": 21, + "Rgba16i": 22, + "Rgba8i": 23, + "R32i": 24, + "Rg32i": 25, + "Rg16i": 26, + "Rg8i": 27, + "R16i": 28, + "R8i": 29, + "Rgba32ui": 30, + "Rgba16ui": 31, + "Rgba8ui": 32, + "R32ui": 33, + "Rgb10a2ui": 34, + "Rg32ui": 35, + "Rg16ui": 36, + "Rg8ui": 37, + "R16ui": 38, + "R8ui": 39 + } + }, + { + "Name": "ImageChannelOrder", + "Type": "Value", + "Values": + { + "R": 0, + "A": 1, + "RG": 2, + "RA": 3, + "RGB": 4, + "RGBA": 5, + "BGRA": 6, + "ARGB": 7, + "Intensity": 8, + "Luminance": 9, + "Rx": 10, + "RGx": 11, + "RGBx": 12, + "Depth": 13, + "DepthStencil": 14, + "sRGB": 15, + "sRGBx": 16, + "sRGBA": 17, + "sBGRA": 18, + "ABGR": 19 + } + }, + { + "Name": "ImageChannelDataType", + "Type": "Value", + "Values": + { + "SnormInt8": 0, + "SnormInt16": 1, + "UnormInt8": 2, + "UnormInt16": 3, + "UnormShort565": 4, + "UnormShort555": 5, + "UnormInt101010": 6, + "SignedInt8": 7, + "SignedInt16": 8, + "SignedInt32": 9, + "UnsignedInt8": 10, + "UnsignedInt16": 11, + "UnsignedInt32": 12, + "HalfFloat": 13, + "Float": 14, + "UnormInt24": 15, + "UnormInt101010_2": 16 + } + }, + { + "Name": "ImageOperands", + "Type": "Bit", + "Values": + { + "Bias": 0, + "Lod": 1, + "Grad": 2, + "ConstOffset": 3, + "Offset": 4, + "ConstOffsets": 5, + "Sample": 6, + "MinLod": 7 + } + }, + { + "Name": "FPFastMathMode", + "Type": "Bit", + "Values": + { + "NotNaN": 0, + "NotInf": 1, + "NSZ": 2, + "AllowRecip": 3, + "Fast": 4 + } + }, + { + "Name": "FPRoundingMode", + "Type": "Value", + "Values": + { + "RTE": 0, + "RTZ": 1, + "RTP": 2, + "RTN": 3 + } + }, + { + "Name": "LinkageType", + "Type": "Value", + "Values": + { + "Export": 0, + "Import": 1 + } + }, + { + "Name": "AccessQualifier", + "Type": "Value", + "Values": + { + "ReadOnly": 0, + "WriteOnly": 1, + "ReadWrite": 2 + } + }, + { + "Name": "FunctionParameterAttribute", + "Type": "Value", + "Values": + { + "Zext": 0, + "Sext": 1, + "ByVal": 2, + "Sret": 3, + "NoAlias": 4, + "NoCapture": 5, + "NoWrite": 6, + "NoReadWrite": 7 + } + }, + { + "Name": "Decoration", + "Type": "Value", + "Values": + { + "RelaxedPrecision": 0, + "SpecId": 1, + "Block": 2, + "BufferBlock": 3, + "RowMajor": 4, + "ColMajor": 5, + "ArrayStride": 6, + "MatrixStride": 7, + "GLSLShared": 8, + "GLSLPacked": 9, + "CPacked": 10, + "BuiltIn": 11, + "NoPerspective": 13, + "Flat": 14, + "Patch": 15, + "Centroid": 16, + "Sample": 17, + "Invariant": 18, + "Restrict": 19, + "Aliased": 20, + "Volatile": 21, + "Constant": 22, + "Coherent": 23, + "NonWritable": 24, + "NonReadable": 25, + "Uniform": 26, + "SaturatedConversion": 28, + "Stream": 29, + "Location": 30, + "Component": 31, + "Index": 32, + "Binding": 33, + "DescriptorSet": 34, + "Offset": 35, + "XfbBuffer": 36, + "XfbStride": 37, + "FuncParamAttr": 38, + "FPRoundingMode": 39, + "FPFastMathMode": 40, + "LinkageAttributes": 41, + "NoContraction": 42, + "InputAttachmentIndex": 43, + "Alignment": 44, + "ExplicitInterpAMD": 4999, + "OverrideCoverageNV": 5248, + "PassthroughNV": 5250, + "ViewportRelativeNV": 5252, + "SecondaryViewportRelativeNV": 5256, + "HlslCounterBufferGOOGLE": 5634, + "HlslSemanticGOOGLE": 5635 + } + }, + { + "Name": "BuiltIn", + "Type": "Value", + "Values": + { + "Position": 0, + "PointSize": 1, + "ClipDistance": 3, + "CullDistance": 4, + "VertexId": 5, + "InstanceId": 6, + "PrimitiveId": 7, + "InvocationId": 8, + "Layer": 9, + "ViewportIndex": 10, + "TessLevelOuter": 11, + "TessLevelInner": 12, + "TessCoord": 13, + "PatchVertices": 14, + "FragCoord": 15, + "PointCoord": 16, + "FrontFacing": 17, + "SampleId": 18, + "SamplePosition": 19, + "SampleMask": 20, + "FragDepth": 22, + "HelperInvocation": 23, + "NumWorkgroups": 24, + "WorkgroupSize": 25, + "WorkgroupId": 26, + "LocalInvocationId": 27, + "GlobalInvocationId": 28, + "LocalInvocationIndex": 29, + "WorkDim": 30, + "GlobalSize": 31, + "EnqueuedWorkgroupSize": 32, + "GlobalOffset": 33, + "GlobalLinearId": 34, + "SubgroupSize": 36, + "SubgroupMaxSize": 37, + "NumSubgroups": 38, + "NumEnqueuedSubgroups": 39, + "SubgroupId": 40, + "SubgroupLocalInvocationId": 41, + "VertexIndex": 42, + "InstanceIndex": 43, + "SubgroupEqMaskKHR": 4416, + "SubgroupGeMaskKHR": 4417, + "SubgroupGtMaskKHR": 4418, + "SubgroupLeMaskKHR": 4419, + "SubgroupLtMaskKHR": 4420, + "BaseVertex": 4424, + "BaseInstance": 4425, + "DrawIndex": 4426, + "DeviceIndex": 4438, + "ViewIndex": 4440, + "BaryCoordNoPerspAMD": 4992, + "BaryCoordNoPerspCentroidAMD": 4993, + "BaryCoordNoPerspSampleAMD": 4994, + "BaryCoordSmoothAMD": 4995, + "BaryCoordSmoothCentroidAMD": 4996, + "BaryCoordSmoothSampleAMD": 4997, + "BaryCoordPullModelAMD": 4998, + "FragStencilRefEXT": 5014, + "ViewportMaskNV": 5253, + "SecondaryPositionNV": 5257, + "SecondaryViewportMaskNV": 5258, + "PositionPerViewNV": 5261, + "ViewportMaskPerViewNV": 5262 + } + }, + { + "Name": "SelectionControl", + "Type": "Bit", + "Values": + { + "Flatten": 0, + "DontFlatten": 1 + } + }, + { + "Name": "LoopControl", + "Type": "Bit", + "Values": + { + "Unroll": 0, + "DontUnroll": 1 + } + }, + { + "Name": "FunctionControl", + "Type": "Bit", + "Values": + { + "Inline": 0, + "DontInline": 1, + "Pure": 2, + "Const": 3 + } + }, + { + "Name": "MemorySemantics", + "Type": "Bit", + "Values": + { + "Acquire": 1, + "Release": 2, + "AcquireRelease": 3, + "SequentiallyConsistent": 4, + "UniformMemory": 6, + "SubgroupMemory": 7, + "WorkgroupMemory": 8, + "CrossWorkgroupMemory": 9, + "AtomicCounterMemory": 10, + "ImageMemory": 11 + } + }, + { + "Name": "MemoryAccess", + "Type": "Bit", + "Values": + { + "Volatile": 0, + "Aligned": 1, + "Nontemporal": 2 + } + }, + { + "Name": "Scope", + "Type": "Value", + "Values": + { + "CrossDevice": 0, + "Device": 1, + "Workgroup": 2, + "Subgroup": 3, + "Invocation": 4 + } + }, + { + "Name": "GroupOperation", + "Type": "Value", + "Values": + { + "Reduce": 0, + "InclusiveScan": 1, + "ExclusiveScan": 2 + } + }, + { + "Name": "KernelEnqueueFlags", + "Type": "Value", + "Values": + { + "NoWait": 0, + "WaitKernel": 1, + "WaitWorkGroup": 2 + } + }, + { + "Name": "KernelProfilingInfo", + "Type": "Bit", + "Values": + { + "CmdExecTime": 0 + } + }, + { + "Name": "Capability", + "Type": "Value", + "Values": + { + "Matrix": 0, + "Shader": 1, + "Geometry": 2, + "Tessellation": 3, + "Addresses": 4, + "Linkage": 5, + "Kernel": 6, + "Vector16": 7, + "Float16Buffer": 8, + "Float16": 9, + "Float64": 10, + "Int64": 11, + "Int64Atomics": 12, + "ImageBasic": 13, + "ImageReadWrite": 14, + "ImageMipmap": 15, + "Pipes": 17, + "Groups": 18, + "DeviceEnqueue": 19, + "LiteralSampler": 20, + "AtomicStorage": 21, + "Int16": 22, + "TessellationPointSize": 23, + "GeometryPointSize": 24, + "ImageGatherExtended": 25, + "StorageImageMultisample": 27, + "UniformBufferArrayDynamicIndexing": 28, + "SampledImageArrayDynamicIndexing": 29, + "StorageBufferArrayDynamicIndexing": 30, + "StorageImageArrayDynamicIndexing": 31, + "ClipDistance": 32, + "CullDistance": 33, + "ImageCubeArray": 34, + "SampleRateShading": 35, + "ImageRect": 36, + "SampledRect": 37, + "GenericPointer": 38, + "Int8": 39, + "InputAttachment": 40, + "SparseResidency": 41, + "MinLod": 42, + "Sampled1D": 43, + "Image1D": 44, + "SampledCubeArray": 45, + "SampledBuffer": 46, + "ImageBuffer": 47, + "ImageMSArray": 48, + "StorageImageExtendedFormats": 49, + "ImageQuery": 50, + "DerivativeControl": 51, + "InterpolationFunction": 52, + "TransformFeedback": 53, + "GeometryStreams": 54, + "StorageImageReadWithoutFormat": 55, + "StorageImageWriteWithoutFormat": 56, + "MultiViewport": 57, + "SubgroupBallotKHR": 4423, + "DrawParameters": 4427, + "SubgroupVoteKHR": 4431, + "StorageBuffer16BitAccess": 4433, + "StorageUniformBufferBlock16": 4433, + "StorageUniform16": 4434, + "UniformAndStorageBuffer16BitAccess": 4434, + "StoragePushConstant16": 4435, + "StorageInputOutput16": 4436, + "DeviceGroup": 4437, + "MultiView": 4439, + "VariablePointersStorageBuffer": 4441, + "VariablePointers": 4442, + "AtomicStorageOps": 4445, + "SampleMaskPostDepthCoverage": 4447, + "ImageGatherBiasLodAMD": 5009, + "FragmentMaskAMD": 5010, + "StencilExportEXT": 5013, + "ImageReadWriteLodAMD": 5015, + "SampleMaskOverrideCoverageNV": 5249, + "GeometryShaderPassthroughNV": 5251, + "ShaderViewportIndexLayerEXT": 5254, + "ShaderViewportIndexLayerNV": 5254, + "ShaderViewportMaskNV": 5255, + "ShaderStereoViewNV": 5259, + "PerViewAttributesNV": 5260, + "SubgroupShuffleINTEL": 5568, + "SubgroupBufferBlockIOINTEL": 5569, + "SubgroupImageBlockIOINTEL": 5570 + } + }, + { + "Name": "Op", + "Type": "Value", + "Values": + { + "OpNop": 0, + "OpUndef": 1, + "OpSourceContinued": 2, + "OpSource": 3, + "OpSourceExtension": 4, + "OpName": 5, + "OpMemberName": 6, + "OpString": 7, + "OpLine": 8, + "OpExtension": 10, + "OpExtInstImport": 11, + "OpExtInst": 12, + "OpMemoryModel": 14, + "OpEntryPoint": 15, + "OpExecutionMode": 16, + "OpCapability": 17, + "OpTypeVoid": 19, + "OpTypeBool": 20, + "OpTypeInt": 21, + "OpTypeFloat": 22, + "OpTypeVector": 23, + "OpTypeMatrix": 24, + "OpTypeImage": 25, + "OpTypeSampler": 26, + "OpTypeSampledImage": 27, + "OpTypeArray": 28, + "OpTypeRuntimeArray": 29, + "OpTypeStruct": 30, + "OpTypeOpaque": 31, + "OpTypePointer": 32, + "OpTypeFunction": 33, + "OpTypeEvent": 34, + "OpTypeDeviceEvent": 35, + "OpTypeReserveId": 36, + "OpTypeQueue": 37, + "OpTypePipe": 38, + "OpTypeForwardPointer": 39, + "OpConstantTrue": 41, + "OpConstantFalse": 42, + "OpConstant": 43, + "OpConstantComposite": 44, + "OpConstantSampler": 45, + "OpConstantNull": 46, + "OpSpecConstantTrue": 48, + "OpSpecConstantFalse": 49, + "OpSpecConstant": 50, + "OpSpecConstantComposite": 51, + "OpSpecConstantOp": 52, + "OpFunction": 54, + "OpFunctionParameter": 55, + "OpFunctionEnd": 56, + "OpFunctionCall": 57, + "OpVariable": 59, + "OpImageTexelPointer": 60, + "OpLoad": 61, + "OpStore": 62, + "OpCopyMemory": 63, + "OpCopyMemorySized": 64, + "OpAccessChain": 65, + "OpInBoundsAccessChain": 66, + "OpPtrAccessChain": 67, + "OpArrayLength": 68, + "OpGenericPtrMemSemantics": 69, + "OpInBoundsPtrAccessChain": 70, + "OpDecorate": 71, + "OpMemberDecorate": 72, + "OpDecorationGroup": 73, + "OpGroupDecorate": 74, + "OpGroupMemberDecorate": 75, + "OpVectorExtractDynamic": 77, + "OpVectorInsertDynamic": 78, + "OpVectorShuffle": 79, + "OpCompositeConstruct": 80, + "OpCompositeExtract": 81, + "OpCompositeInsert": 82, + "OpCopyObject": 83, + "OpTranspose": 84, + "OpSampledImage": 86, + "OpImageSampleImplicitLod": 87, + "OpImageSampleExplicitLod": 88, + "OpImageSampleDrefImplicitLod": 89, + "OpImageSampleDrefExplicitLod": 90, + "OpImageSampleProjImplicitLod": 91, + "OpImageSampleProjExplicitLod": 92, + "OpImageSampleProjDrefImplicitLod": 93, + "OpImageSampleProjDrefExplicitLod": 94, + "OpImageFetch": 95, + "OpImageGather": 96, + "OpImageDrefGather": 97, + "OpImageRead": 98, + "OpImageWrite": 99, + "OpImage": 100, + "OpImageQueryFormat": 101, + "OpImageQueryOrder": 102, + "OpImageQuerySizeLod": 103, + "OpImageQuerySize": 104, + "OpImageQueryLod": 105, + "OpImageQueryLevels": 106, + "OpImageQuerySamples": 107, + "OpConvertFToU": 109, + "OpConvertFToS": 110, + "OpConvertSToF": 111, + "OpConvertUToF": 112, + "OpUConvert": 113, + "OpSConvert": 114, + "OpFConvert": 115, + "OpQuantizeToF16": 116, + "OpConvertPtrToU": 117, + "OpSatConvertSToU": 118, + "OpSatConvertUToS": 119, + "OpConvertUToPtr": 120, + "OpPtrCastToGeneric": 121, + "OpGenericCastToPtr": 122, + "OpGenericCastToPtrExplicit": 123, + "OpBitcast": 124, + "OpSNegate": 126, + "OpFNegate": 127, + "OpIAdd": 128, + "OpFAdd": 129, + "OpISub": 130, + "OpFSub": 131, + "OpIMul": 132, + "OpFMul": 133, + "OpUDiv": 134, + "OpSDiv": 135, + "OpFDiv": 136, + "OpUMod": 137, + "OpSRem": 138, + "OpSMod": 139, + "OpFRem": 140, + "OpFMod": 141, + "OpVectorTimesScalar": 142, + "OpMatrixTimesScalar": 143, + "OpVectorTimesMatrix": 144, + "OpMatrixTimesVector": 145, + "OpMatrixTimesMatrix": 146, + "OpOuterProduct": 147, + "OpDot": 148, + "OpIAddCarry": 149, + "OpISubBorrow": 150, + "OpUMulExtended": 151, + "OpSMulExtended": 152, + "OpAny": 154, + "OpAll": 155, + "OpIsNan": 156, + "OpIsInf": 157, + "OpIsFinite": 158, + "OpIsNormal": 159, + "OpSignBitSet": 160, + "OpLessOrGreater": 161, + "OpOrdered": 162, + "OpUnordered": 163, + "OpLogicalEqual": 164, + "OpLogicalNotEqual": 165, + "OpLogicalOr": 166, + "OpLogicalAnd": 167, + "OpLogicalNot": 168, + "OpSelect": 169, + "OpIEqual": 170, + "OpINotEqual": 171, + "OpUGreaterThan": 172, + "OpSGreaterThan": 173, + "OpUGreaterThanEqual": 174, + "OpSGreaterThanEqual": 175, + "OpULessThan": 176, + "OpSLessThan": 177, + "OpULessThanEqual": 178, + "OpSLessThanEqual": 179, + "OpFOrdEqual": 180, + "OpFUnordEqual": 181, + "OpFOrdNotEqual": 182, + "OpFUnordNotEqual": 183, + "OpFOrdLessThan": 184, + "OpFUnordLessThan": 185, + "OpFOrdGreaterThan": 186, + "OpFUnordGreaterThan": 187, + "OpFOrdLessThanEqual": 188, + "OpFUnordLessThanEqual": 189, + "OpFOrdGreaterThanEqual": 190, + "OpFUnordGreaterThanEqual": 191, + "OpShiftRightLogical": 194, + "OpShiftRightArithmetic": 195, + "OpShiftLeftLogical": 196, + "OpBitwiseOr": 197, + "OpBitwiseXor": 198, + "OpBitwiseAnd": 199, + "OpNot": 200, + "OpBitFieldInsert": 201, + "OpBitFieldSExtract": 202, + "OpBitFieldUExtract": 203, + "OpBitReverse": 204, + "OpBitCount": 205, + "OpDPdx": 207, + "OpDPdy": 208, + "OpFwidth": 209, + "OpDPdxFine": 210, + "OpDPdyFine": 211, + "OpFwidthFine": 212, + "OpDPdxCoarse": 213, + "OpDPdyCoarse": 214, + "OpFwidthCoarse": 215, + "OpEmitVertex": 218, + "OpEndPrimitive": 219, + "OpEmitStreamVertex": 220, + "OpEndStreamPrimitive": 221, + "OpControlBarrier": 224, + "OpMemoryBarrier": 225, + "OpAtomicLoad": 227, + "OpAtomicStore": 228, + "OpAtomicExchange": 229, + "OpAtomicCompareExchange": 230, + "OpAtomicCompareExchangeWeak": 231, + "OpAtomicIIncrement": 232, + "OpAtomicIDecrement": 233, + "OpAtomicIAdd": 234, + "OpAtomicISub": 235, + "OpAtomicSMin": 236, + "OpAtomicUMin": 237, + "OpAtomicSMax": 238, + "OpAtomicUMax": 239, + "OpAtomicAnd": 240, + "OpAtomicOr": 241, + "OpAtomicXor": 242, + "OpPhi": 245, + "OpLoopMerge": 246, + "OpSelectionMerge": 247, + "OpLabel": 248, + "OpBranch": 249, + "OpBranchConditional": 250, + "OpSwitch": 251, + "OpKill": 252, + "OpReturn": 253, + "OpReturnValue": 254, + "OpUnreachable": 255, + "OpLifetimeStart": 256, + "OpLifetimeStop": 257, + "OpGroupAsyncCopy": 259, + "OpGroupWaitEvents": 260, + "OpGroupAll": 261, + "OpGroupAny": 262, + "OpGroupBroadcast": 263, + "OpGroupIAdd": 264, + "OpGroupFAdd": 265, + "OpGroupFMin": 266, + "OpGroupUMin": 267, + "OpGroupSMin": 268, + "OpGroupFMax": 269, + "OpGroupUMax": 270, + "OpGroupSMax": 271, + "OpReadPipe": 274, + "OpWritePipe": 275, + "OpReservedReadPipe": 276, + "OpReservedWritePipe": 277, + "OpReserveReadPipePackets": 278, + "OpReserveWritePipePackets": 279, + "OpCommitReadPipe": 280, + "OpCommitWritePipe": 281, + "OpIsValidReserveId": 282, + "OpGetNumPipePackets": 283, + "OpGetMaxPipePackets": 284, + "OpGroupReserveReadPipePackets": 285, + "OpGroupReserveWritePipePackets": 286, + "OpGroupCommitReadPipe": 287, + "OpGroupCommitWritePipe": 288, + "OpEnqueueMarker": 291, + "OpEnqueueKernel": 292, + "OpGetKernelNDrangeSubGroupCount": 293, + "OpGetKernelNDrangeMaxSubGroupSize": 294, + "OpGetKernelWorkGroupSize": 295, + "OpGetKernelPreferredWorkGroupSizeMultiple": 296, + "OpRetainEvent": 297, + "OpReleaseEvent": 298, + "OpCreateUserEvent": 299, + "OpIsValidEvent": 300, + "OpSetUserEventStatus": 301, + "OpCaptureEventProfilingInfo": 302, + "OpGetDefaultQueue": 303, + "OpBuildNDRange": 304, + "OpImageSparseSampleImplicitLod": 305, + "OpImageSparseSampleExplicitLod": 306, + "OpImageSparseSampleDrefImplicitLod": 307, + "OpImageSparseSampleDrefExplicitLod": 308, + "OpImageSparseSampleProjImplicitLod": 309, + "OpImageSparseSampleProjExplicitLod": 310, + "OpImageSparseSampleProjDrefImplicitLod": 311, + "OpImageSparseSampleProjDrefExplicitLod": 312, + "OpImageSparseFetch": 313, + "OpImageSparseGather": 314, + "OpImageSparseDrefGather": 315, + "OpImageSparseTexelsResident": 316, + "OpNoLine": 317, + "OpAtomicFlagTestAndSet": 318, + "OpAtomicFlagClear": 319, + "OpImageSparseRead": 320, + "OpDecorateId": 332, + "OpSubgroupBallotKHR": 4421, + "OpSubgroupFirstInvocationKHR": 4422, + "OpSubgroupAllKHR": 4428, + "OpSubgroupAnyKHR": 4429, + "OpSubgroupAllEqualKHR": 4430, + "OpSubgroupReadInvocationKHR": 4432, + "OpGroupIAddNonUniformAMD": 5000, + "OpGroupFAddNonUniformAMD": 5001, + "OpGroupFMinNonUniformAMD": 5002, + "OpGroupUMinNonUniformAMD": 5003, + "OpGroupSMinNonUniformAMD": 5004, + "OpGroupFMaxNonUniformAMD": 5005, + "OpGroupUMaxNonUniformAMD": 5006, + "OpGroupSMaxNonUniformAMD": 5007, + "OpFragmentMaskFetchAMD": 5011, + "OpFragmentFetchAMD": 5012, + "OpSubgroupShuffleINTEL": 5571, + "OpSubgroupShuffleDownINTEL": 5572, + "OpSubgroupShuffleUpINTEL": 5573, + "OpSubgroupShuffleXorINTEL": 5574, + "OpSubgroupBlockReadINTEL": 5575, + "OpSubgroupBlockWriteINTEL": 5576, + "OpSubgroupImageBlockReadINTEL": 5577, + "OpSubgroupImageBlockWriteINTEL": 5578, + "OpDecorateStringGOOGLE": 5632, + "OpMemberDecorateStringGOOGLE": 5633 + } + } + ] + } +} + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.lua vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.lua --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.lua 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.lua 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,949 @@ +-- Copyright (c) 2014-2018 The Khronos Group Inc. +-- +-- Permission is hereby granted, free of charge, to any person obtaining a copy +-- of this software and/or associated documentation files (the "Materials"), +-- to deal in the Materials without restriction, including without limitation +-- the rights to use, copy, modify, merge, publish, distribute, sublicense, +-- and/or sell copies of the Materials, and to permit persons to whom the +-- Materials are furnished to do so, subject to the following conditions: +-- +-- The above copyright notice and this permission notice shall be included in +-- all copies or substantial portions of the Materials. +-- +-- MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +-- STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +-- HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +-- +-- THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +-- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +-- FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +-- IN THE MATERIALS. + +-- This header is automatically generated by the same tool that creates +-- the Binary Section of the SPIR-V specification. + +-- Enumeration tokens for SPIR-V, in various styles: +-- C, C++, C++11, JSON, Lua, Python +-- +-- - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +-- - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +-- - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +-- - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +-- - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +-- +-- Some tokens act like mask values, which can be OR'd together, +-- while others are mutually exclusive. The mask-like ones have +-- "Mask" in their name, and a parallel enum that has the shift +-- amount (1 << x) for each corresponding enumerant. + +spv = { + MagicNumber = 0x07230203, + Version = 0x00010000, + Revision = 12, + OpCodeMask = 0xffff, + WordCountShift = 16, + + SourceLanguage = { + Unknown = 0, + ESSL = 1, + GLSL = 2, + OpenCL_C = 3, + OpenCL_CPP = 4, + HLSL = 5, + }, + + ExecutionModel = { + Vertex = 0, + TessellationControl = 1, + TessellationEvaluation = 2, + Geometry = 3, + Fragment = 4, + GLCompute = 5, + Kernel = 6, + }, + + AddressingModel = { + Logical = 0, + Physical32 = 1, + Physical64 = 2, + }, + + MemoryModel = { + Simple = 0, + GLSL450 = 1, + OpenCL = 2, + }, + + ExecutionMode = { + Invocations = 0, + SpacingEqual = 1, + SpacingFractionalEven = 2, + SpacingFractionalOdd = 3, + VertexOrderCw = 4, + VertexOrderCcw = 5, + PixelCenterInteger = 6, + OriginUpperLeft = 7, + OriginLowerLeft = 8, + EarlyFragmentTests = 9, + PointMode = 10, + Xfb = 11, + DepthReplacing = 12, + DepthGreater = 14, + DepthLess = 15, + DepthUnchanged = 16, + LocalSize = 17, + LocalSizeHint = 18, + InputPoints = 19, + InputLines = 20, + InputLinesAdjacency = 21, + Triangles = 22, + InputTrianglesAdjacency = 23, + Quads = 24, + Isolines = 25, + OutputVertices = 26, + OutputPoints = 27, + OutputLineStrip = 28, + OutputTriangleStrip = 29, + VecTypeHint = 30, + ContractionOff = 31, + PostDepthCoverage = 4446, + StencilRefReplacingEXT = 5027, + }, + + StorageClass = { + UniformConstant = 0, + Input = 1, + Uniform = 2, + Output = 3, + Workgroup = 4, + CrossWorkgroup = 5, + Private = 6, + Function = 7, + Generic = 8, + PushConstant = 9, + AtomicCounter = 10, + Image = 11, + StorageBuffer = 12, + }, + + Dim = { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + Cube = 3, + Rect = 4, + Buffer = 5, + SubpassData = 6, + }, + + SamplerAddressingMode = { + None = 0, + ClampToEdge = 1, + Clamp = 2, + Repeat = 3, + RepeatMirrored = 4, + }, + + SamplerFilterMode = { + Nearest = 0, + Linear = 1, + }, + + ImageFormat = { + Unknown = 0, + Rgba32f = 1, + Rgba16f = 2, + R32f = 3, + Rgba8 = 4, + Rgba8Snorm = 5, + Rg32f = 6, + Rg16f = 7, + R11fG11fB10f = 8, + R16f = 9, + Rgba16 = 10, + Rgb10A2 = 11, + Rg16 = 12, + Rg8 = 13, + R16 = 14, + R8 = 15, + Rgba16Snorm = 16, + Rg16Snorm = 17, + Rg8Snorm = 18, + R16Snorm = 19, + R8Snorm = 20, + Rgba32i = 21, + Rgba16i = 22, + Rgba8i = 23, + R32i = 24, + Rg32i = 25, + Rg16i = 26, + Rg8i = 27, + R16i = 28, + R8i = 29, + Rgba32ui = 30, + Rgba16ui = 31, + Rgba8ui = 32, + R32ui = 33, + Rgb10a2ui = 34, + Rg32ui = 35, + Rg16ui = 36, + Rg8ui = 37, + R16ui = 38, + R8ui = 39, + }, + + ImageChannelOrder = { + R = 0, + A = 1, + RG = 2, + RA = 3, + RGB = 4, + RGBA = 5, + BGRA = 6, + ARGB = 7, + Intensity = 8, + Luminance = 9, + Rx = 10, + RGx = 11, + RGBx = 12, + Depth = 13, + DepthStencil = 14, + sRGB = 15, + sRGBx = 16, + sRGBA = 17, + sBGRA = 18, + ABGR = 19, + }, + + ImageChannelDataType = { + SnormInt8 = 0, + SnormInt16 = 1, + UnormInt8 = 2, + UnormInt16 = 3, + UnormShort565 = 4, + UnormShort555 = 5, + UnormInt101010 = 6, + SignedInt8 = 7, + SignedInt16 = 8, + SignedInt32 = 9, + UnsignedInt8 = 10, + UnsignedInt16 = 11, + UnsignedInt32 = 12, + HalfFloat = 13, + Float = 14, + UnormInt24 = 15, + UnormInt101010_2 = 16, + }, + + ImageOperandsShift = { + Bias = 0, + Lod = 1, + Grad = 2, + ConstOffset = 3, + Offset = 4, + ConstOffsets = 5, + Sample = 6, + MinLod = 7, + }, + + ImageOperandsMask = { + MaskNone = 0, + Bias = 0x00000001, + Lod = 0x00000002, + Grad = 0x00000004, + ConstOffset = 0x00000008, + Offset = 0x00000010, + ConstOffsets = 0x00000020, + Sample = 0x00000040, + MinLod = 0x00000080, + }, + + FPFastMathModeShift = { + NotNaN = 0, + NotInf = 1, + NSZ = 2, + AllowRecip = 3, + Fast = 4, + }, + + FPFastMathModeMask = { + MaskNone = 0, + NotNaN = 0x00000001, + NotInf = 0x00000002, + NSZ = 0x00000004, + AllowRecip = 0x00000008, + Fast = 0x00000010, + }, + + FPRoundingMode = { + RTE = 0, + RTZ = 1, + RTP = 2, + RTN = 3, + }, + + LinkageType = { + Export = 0, + Import = 1, + }, + + AccessQualifier = { + ReadOnly = 0, + WriteOnly = 1, + ReadWrite = 2, + }, + + FunctionParameterAttribute = { + Zext = 0, + Sext = 1, + ByVal = 2, + Sret = 3, + NoAlias = 4, + NoCapture = 5, + NoWrite = 6, + NoReadWrite = 7, + }, + + Decoration = { + RelaxedPrecision = 0, + SpecId = 1, + Block = 2, + BufferBlock = 3, + RowMajor = 4, + ColMajor = 5, + ArrayStride = 6, + MatrixStride = 7, + GLSLShared = 8, + GLSLPacked = 9, + CPacked = 10, + BuiltIn = 11, + NoPerspective = 13, + Flat = 14, + Patch = 15, + Centroid = 16, + Sample = 17, + Invariant = 18, + Restrict = 19, + Aliased = 20, + Volatile = 21, + Constant = 22, + Coherent = 23, + NonWritable = 24, + NonReadable = 25, + Uniform = 26, + SaturatedConversion = 28, + Stream = 29, + Location = 30, + Component = 31, + Index = 32, + Binding = 33, + DescriptorSet = 34, + Offset = 35, + XfbBuffer = 36, + XfbStride = 37, + FuncParamAttr = 38, + FPRoundingMode = 39, + FPFastMathMode = 40, + LinkageAttributes = 41, + NoContraction = 42, + InputAttachmentIndex = 43, + Alignment = 44, + ExplicitInterpAMD = 4999, + OverrideCoverageNV = 5248, + PassthroughNV = 5250, + ViewportRelativeNV = 5252, + SecondaryViewportRelativeNV = 5256, + HlslCounterBufferGOOGLE = 5634, + HlslSemanticGOOGLE = 5635, + }, + + BuiltIn = { + Position = 0, + PointSize = 1, + ClipDistance = 3, + CullDistance = 4, + VertexId = 5, + InstanceId = 6, + PrimitiveId = 7, + InvocationId = 8, + Layer = 9, + ViewportIndex = 10, + TessLevelOuter = 11, + TessLevelInner = 12, + TessCoord = 13, + PatchVertices = 14, + FragCoord = 15, + PointCoord = 16, + FrontFacing = 17, + SampleId = 18, + SamplePosition = 19, + SampleMask = 20, + FragDepth = 22, + HelperInvocation = 23, + NumWorkgroups = 24, + WorkgroupSize = 25, + WorkgroupId = 26, + LocalInvocationId = 27, + GlobalInvocationId = 28, + LocalInvocationIndex = 29, + WorkDim = 30, + GlobalSize = 31, + EnqueuedWorkgroupSize = 32, + GlobalOffset = 33, + GlobalLinearId = 34, + SubgroupSize = 36, + SubgroupMaxSize = 37, + NumSubgroups = 38, + NumEnqueuedSubgroups = 39, + SubgroupId = 40, + SubgroupLocalInvocationId = 41, + VertexIndex = 42, + InstanceIndex = 43, + SubgroupEqMaskKHR = 4416, + SubgroupGeMaskKHR = 4417, + SubgroupGtMaskKHR = 4418, + SubgroupLeMaskKHR = 4419, + SubgroupLtMaskKHR = 4420, + BaseVertex = 4424, + BaseInstance = 4425, + DrawIndex = 4426, + DeviceIndex = 4438, + ViewIndex = 4440, + BaryCoordNoPerspAMD = 4992, + BaryCoordNoPerspCentroidAMD = 4993, + BaryCoordNoPerspSampleAMD = 4994, + BaryCoordSmoothAMD = 4995, + BaryCoordSmoothCentroidAMD = 4996, + BaryCoordSmoothSampleAMD = 4997, + BaryCoordPullModelAMD = 4998, + FragStencilRefEXT = 5014, + ViewportMaskNV = 5253, + SecondaryPositionNV = 5257, + SecondaryViewportMaskNV = 5258, + PositionPerViewNV = 5261, + ViewportMaskPerViewNV = 5262, + }, + + SelectionControlShift = { + Flatten = 0, + DontFlatten = 1, + }, + + SelectionControlMask = { + MaskNone = 0, + Flatten = 0x00000001, + DontFlatten = 0x00000002, + }, + + LoopControlShift = { + Unroll = 0, + DontUnroll = 1, + }, + + LoopControlMask = { + MaskNone = 0, + Unroll = 0x00000001, + DontUnroll = 0x00000002, + }, + + FunctionControlShift = { + Inline = 0, + DontInline = 1, + Pure = 2, + Const = 3, + }, + + FunctionControlMask = { + MaskNone = 0, + Inline = 0x00000001, + DontInline = 0x00000002, + Pure = 0x00000004, + Const = 0x00000008, + }, + + MemorySemanticsShift = { + Acquire = 1, + Release = 2, + AcquireRelease = 3, + SequentiallyConsistent = 4, + UniformMemory = 6, + SubgroupMemory = 7, + WorkgroupMemory = 8, + CrossWorkgroupMemory = 9, + AtomicCounterMemory = 10, + ImageMemory = 11, + }, + + MemorySemanticsMask = { + MaskNone = 0, + Acquire = 0x00000002, + Release = 0x00000004, + AcquireRelease = 0x00000008, + SequentiallyConsistent = 0x00000010, + UniformMemory = 0x00000040, + SubgroupMemory = 0x00000080, + WorkgroupMemory = 0x00000100, + CrossWorkgroupMemory = 0x00000200, + AtomicCounterMemory = 0x00000400, + ImageMemory = 0x00000800, + }, + + MemoryAccessShift = { + Volatile = 0, + Aligned = 1, + Nontemporal = 2, + }, + + MemoryAccessMask = { + MaskNone = 0, + Volatile = 0x00000001, + Aligned = 0x00000002, + Nontemporal = 0x00000004, + }, + + Scope = { + CrossDevice = 0, + Device = 1, + Workgroup = 2, + Subgroup = 3, + Invocation = 4, + }, + + GroupOperation = { + Reduce = 0, + InclusiveScan = 1, + ExclusiveScan = 2, + }, + + KernelEnqueueFlags = { + NoWait = 0, + WaitKernel = 1, + WaitWorkGroup = 2, + }, + + KernelProfilingInfoShift = { + CmdExecTime = 0, + }, + + KernelProfilingInfoMask = { + MaskNone = 0, + CmdExecTime = 0x00000001, + }, + + Capability = { + Matrix = 0, + Shader = 1, + Geometry = 2, + Tessellation = 3, + Addresses = 4, + Linkage = 5, + Kernel = 6, + Vector16 = 7, + Float16Buffer = 8, + Float16 = 9, + Float64 = 10, + Int64 = 11, + Int64Atomics = 12, + ImageBasic = 13, + ImageReadWrite = 14, + ImageMipmap = 15, + Pipes = 17, + Groups = 18, + DeviceEnqueue = 19, + LiteralSampler = 20, + AtomicStorage = 21, + Int16 = 22, + TessellationPointSize = 23, + GeometryPointSize = 24, + ImageGatherExtended = 25, + StorageImageMultisample = 27, + UniformBufferArrayDynamicIndexing = 28, + SampledImageArrayDynamicIndexing = 29, + StorageBufferArrayDynamicIndexing = 30, + StorageImageArrayDynamicIndexing = 31, + ClipDistance = 32, + CullDistance = 33, + ImageCubeArray = 34, + SampleRateShading = 35, + ImageRect = 36, + SampledRect = 37, + GenericPointer = 38, + Int8 = 39, + InputAttachment = 40, + SparseResidency = 41, + MinLod = 42, + Sampled1D = 43, + Image1D = 44, + SampledCubeArray = 45, + SampledBuffer = 46, + ImageBuffer = 47, + ImageMSArray = 48, + StorageImageExtendedFormats = 49, + ImageQuery = 50, + DerivativeControl = 51, + InterpolationFunction = 52, + TransformFeedback = 53, + GeometryStreams = 54, + StorageImageReadWithoutFormat = 55, + StorageImageWriteWithoutFormat = 56, + MultiViewport = 57, + SubgroupBallotKHR = 4423, + DrawParameters = 4427, + SubgroupVoteKHR = 4431, + StorageBuffer16BitAccess = 4433, + StorageUniformBufferBlock16 = 4433, + StorageUniform16 = 4434, + UniformAndStorageBuffer16BitAccess = 4434, + StoragePushConstant16 = 4435, + StorageInputOutput16 = 4436, + DeviceGroup = 4437, + MultiView = 4439, + VariablePointersStorageBuffer = 4441, + VariablePointers = 4442, + AtomicStorageOps = 4445, + SampleMaskPostDepthCoverage = 4447, + ImageGatherBiasLodAMD = 5009, + FragmentMaskAMD = 5010, + StencilExportEXT = 5013, + ImageReadWriteLodAMD = 5015, + SampleMaskOverrideCoverageNV = 5249, + GeometryShaderPassthroughNV = 5251, + ShaderViewportIndexLayerEXT = 5254, + ShaderViewportIndexLayerNV = 5254, + ShaderViewportMaskNV = 5255, + ShaderStereoViewNV = 5259, + PerViewAttributesNV = 5260, + SubgroupShuffleINTEL = 5568, + SubgroupBufferBlockIOINTEL = 5569, + SubgroupImageBlockIOINTEL = 5570, + }, + + Op = { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpDecorateId = 332, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpSubgroupReadInvocationKHR = 4432, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateStringGOOGLE = 5633, + }, + +} + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.py vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.py --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.py 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.py 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,949 @@ +# Copyright (c) 2014-2018 The Khronos Group Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and/or associated documentation files (the "Materials"), +# to deal in the Materials without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Materials, and to permit persons to whom the +# Materials are furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Materials. +# +# MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +# STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +# HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +# +# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +# IN THE MATERIALS. + +# This header is automatically generated by the same tool that creates +# the Binary Section of the SPIR-V specification. + +# Enumeration tokens for SPIR-V, in various styles: +# C, C++, C++11, JSON, Lua, Python +# +# - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +# - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +# - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +# - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +# - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +# +# Some tokens act like mask values, which can be OR'd together, +# while others are mutually exclusive. The mask-like ones have +# "Mask" in their name, and a parallel enum that has the shift +# amount (1 << x) for each corresponding enumerant. + +spv = { + 'MagicNumber' : 0x07230203, + 'Version' : 0x00010000, + 'Revision' : 12, + 'OpCodeMask' : 0xffff, + 'WordCountShift' : 16, + + 'SourceLanguage' : { + 'Unknown' : 0, + 'ESSL' : 1, + 'GLSL' : 2, + 'OpenCL_C' : 3, + 'OpenCL_CPP' : 4, + 'HLSL' : 5, + }, + + 'ExecutionModel' : { + 'Vertex' : 0, + 'TessellationControl' : 1, + 'TessellationEvaluation' : 2, + 'Geometry' : 3, + 'Fragment' : 4, + 'GLCompute' : 5, + 'Kernel' : 6, + }, + + 'AddressingModel' : { + 'Logical' : 0, + 'Physical32' : 1, + 'Physical64' : 2, + }, + + 'MemoryModel' : { + 'Simple' : 0, + 'GLSL450' : 1, + 'OpenCL' : 2, + }, + + 'ExecutionMode' : { + 'Invocations' : 0, + 'SpacingEqual' : 1, + 'SpacingFractionalEven' : 2, + 'SpacingFractionalOdd' : 3, + 'VertexOrderCw' : 4, + 'VertexOrderCcw' : 5, + 'PixelCenterInteger' : 6, + 'OriginUpperLeft' : 7, + 'OriginLowerLeft' : 8, + 'EarlyFragmentTests' : 9, + 'PointMode' : 10, + 'Xfb' : 11, + 'DepthReplacing' : 12, + 'DepthGreater' : 14, + 'DepthLess' : 15, + 'DepthUnchanged' : 16, + 'LocalSize' : 17, + 'LocalSizeHint' : 18, + 'InputPoints' : 19, + 'InputLines' : 20, + 'InputLinesAdjacency' : 21, + 'Triangles' : 22, + 'InputTrianglesAdjacency' : 23, + 'Quads' : 24, + 'Isolines' : 25, + 'OutputVertices' : 26, + 'OutputPoints' : 27, + 'OutputLineStrip' : 28, + 'OutputTriangleStrip' : 29, + 'VecTypeHint' : 30, + 'ContractionOff' : 31, + 'PostDepthCoverage' : 4446, + 'StencilRefReplacingEXT' : 5027, + }, + + 'StorageClass' : { + 'UniformConstant' : 0, + 'Input' : 1, + 'Uniform' : 2, + 'Output' : 3, + 'Workgroup' : 4, + 'CrossWorkgroup' : 5, + 'Private' : 6, + 'Function' : 7, + 'Generic' : 8, + 'PushConstant' : 9, + 'AtomicCounter' : 10, + 'Image' : 11, + 'StorageBuffer' : 12, + }, + + 'Dim' : { + 'Dim1D' : 0, + 'Dim2D' : 1, + 'Dim3D' : 2, + 'Cube' : 3, + 'Rect' : 4, + 'Buffer' : 5, + 'SubpassData' : 6, + }, + + 'SamplerAddressingMode' : { + 'None' : 0, + 'ClampToEdge' : 1, + 'Clamp' : 2, + 'Repeat' : 3, + 'RepeatMirrored' : 4, + }, + + 'SamplerFilterMode' : { + 'Nearest' : 0, + 'Linear' : 1, + }, + + 'ImageFormat' : { + 'Unknown' : 0, + 'Rgba32f' : 1, + 'Rgba16f' : 2, + 'R32f' : 3, + 'Rgba8' : 4, + 'Rgba8Snorm' : 5, + 'Rg32f' : 6, + 'Rg16f' : 7, + 'R11fG11fB10f' : 8, + 'R16f' : 9, + 'Rgba16' : 10, + 'Rgb10A2' : 11, + 'Rg16' : 12, + 'Rg8' : 13, + 'R16' : 14, + 'R8' : 15, + 'Rgba16Snorm' : 16, + 'Rg16Snorm' : 17, + 'Rg8Snorm' : 18, + 'R16Snorm' : 19, + 'R8Snorm' : 20, + 'Rgba32i' : 21, + 'Rgba16i' : 22, + 'Rgba8i' : 23, + 'R32i' : 24, + 'Rg32i' : 25, + 'Rg16i' : 26, + 'Rg8i' : 27, + 'R16i' : 28, + 'R8i' : 29, + 'Rgba32ui' : 30, + 'Rgba16ui' : 31, + 'Rgba8ui' : 32, + 'R32ui' : 33, + 'Rgb10a2ui' : 34, + 'Rg32ui' : 35, + 'Rg16ui' : 36, + 'Rg8ui' : 37, + 'R16ui' : 38, + 'R8ui' : 39, + }, + + 'ImageChannelOrder' : { + 'R' : 0, + 'A' : 1, + 'RG' : 2, + 'RA' : 3, + 'RGB' : 4, + 'RGBA' : 5, + 'BGRA' : 6, + 'ARGB' : 7, + 'Intensity' : 8, + 'Luminance' : 9, + 'Rx' : 10, + 'RGx' : 11, + 'RGBx' : 12, + 'Depth' : 13, + 'DepthStencil' : 14, + 'sRGB' : 15, + 'sRGBx' : 16, + 'sRGBA' : 17, + 'sBGRA' : 18, + 'ABGR' : 19, + }, + + 'ImageChannelDataType' : { + 'SnormInt8' : 0, + 'SnormInt16' : 1, + 'UnormInt8' : 2, + 'UnormInt16' : 3, + 'UnormShort565' : 4, + 'UnormShort555' : 5, + 'UnormInt101010' : 6, + 'SignedInt8' : 7, + 'SignedInt16' : 8, + 'SignedInt32' : 9, + 'UnsignedInt8' : 10, + 'UnsignedInt16' : 11, + 'UnsignedInt32' : 12, + 'HalfFloat' : 13, + 'Float' : 14, + 'UnormInt24' : 15, + 'UnormInt101010_2' : 16, + }, + + 'ImageOperandsShift' : { + 'Bias' : 0, + 'Lod' : 1, + 'Grad' : 2, + 'ConstOffset' : 3, + 'Offset' : 4, + 'ConstOffsets' : 5, + 'Sample' : 6, + 'MinLod' : 7, + }, + + 'ImageOperandsMask' : { + 'MaskNone' : 0, + 'Bias' : 0x00000001, + 'Lod' : 0x00000002, + 'Grad' : 0x00000004, + 'ConstOffset' : 0x00000008, + 'Offset' : 0x00000010, + 'ConstOffsets' : 0x00000020, + 'Sample' : 0x00000040, + 'MinLod' : 0x00000080, + }, + + 'FPFastMathModeShift' : { + 'NotNaN' : 0, + 'NotInf' : 1, + 'NSZ' : 2, + 'AllowRecip' : 3, + 'Fast' : 4, + }, + + 'FPFastMathModeMask' : { + 'MaskNone' : 0, + 'NotNaN' : 0x00000001, + 'NotInf' : 0x00000002, + 'NSZ' : 0x00000004, + 'AllowRecip' : 0x00000008, + 'Fast' : 0x00000010, + }, + + 'FPRoundingMode' : { + 'RTE' : 0, + 'RTZ' : 1, + 'RTP' : 2, + 'RTN' : 3, + }, + + 'LinkageType' : { + 'Export' : 0, + 'Import' : 1, + }, + + 'AccessQualifier' : { + 'ReadOnly' : 0, + 'WriteOnly' : 1, + 'ReadWrite' : 2, + }, + + 'FunctionParameterAttribute' : { + 'Zext' : 0, + 'Sext' : 1, + 'ByVal' : 2, + 'Sret' : 3, + 'NoAlias' : 4, + 'NoCapture' : 5, + 'NoWrite' : 6, + 'NoReadWrite' : 7, + }, + + 'Decoration' : { + 'RelaxedPrecision' : 0, + 'SpecId' : 1, + 'Block' : 2, + 'BufferBlock' : 3, + 'RowMajor' : 4, + 'ColMajor' : 5, + 'ArrayStride' : 6, + 'MatrixStride' : 7, + 'GLSLShared' : 8, + 'GLSLPacked' : 9, + 'CPacked' : 10, + 'BuiltIn' : 11, + 'NoPerspective' : 13, + 'Flat' : 14, + 'Patch' : 15, + 'Centroid' : 16, + 'Sample' : 17, + 'Invariant' : 18, + 'Restrict' : 19, + 'Aliased' : 20, + 'Volatile' : 21, + 'Constant' : 22, + 'Coherent' : 23, + 'NonWritable' : 24, + 'NonReadable' : 25, + 'Uniform' : 26, + 'SaturatedConversion' : 28, + 'Stream' : 29, + 'Location' : 30, + 'Component' : 31, + 'Index' : 32, + 'Binding' : 33, + 'DescriptorSet' : 34, + 'Offset' : 35, + 'XfbBuffer' : 36, + 'XfbStride' : 37, + 'FuncParamAttr' : 38, + 'FPRoundingMode' : 39, + 'FPFastMathMode' : 40, + 'LinkageAttributes' : 41, + 'NoContraction' : 42, + 'InputAttachmentIndex' : 43, + 'Alignment' : 44, + 'ExplicitInterpAMD' : 4999, + 'OverrideCoverageNV' : 5248, + 'PassthroughNV' : 5250, + 'ViewportRelativeNV' : 5252, + 'SecondaryViewportRelativeNV' : 5256, + 'HlslCounterBufferGOOGLE' : 5634, + 'HlslSemanticGOOGLE' : 5635, + }, + + 'BuiltIn' : { + 'Position' : 0, + 'PointSize' : 1, + 'ClipDistance' : 3, + 'CullDistance' : 4, + 'VertexId' : 5, + 'InstanceId' : 6, + 'PrimitiveId' : 7, + 'InvocationId' : 8, + 'Layer' : 9, + 'ViewportIndex' : 10, + 'TessLevelOuter' : 11, + 'TessLevelInner' : 12, + 'TessCoord' : 13, + 'PatchVertices' : 14, + 'FragCoord' : 15, + 'PointCoord' : 16, + 'FrontFacing' : 17, + 'SampleId' : 18, + 'SamplePosition' : 19, + 'SampleMask' : 20, + 'FragDepth' : 22, + 'HelperInvocation' : 23, + 'NumWorkgroups' : 24, + 'WorkgroupSize' : 25, + 'WorkgroupId' : 26, + 'LocalInvocationId' : 27, + 'GlobalInvocationId' : 28, + 'LocalInvocationIndex' : 29, + 'WorkDim' : 30, + 'GlobalSize' : 31, + 'EnqueuedWorkgroupSize' : 32, + 'GlobalOffset' : 33, + 'GlobalLinearId' : 34, + 'SubgroupSize' : 36, + 'SubgroupMaxSize' : 37, + 'NumSubgroups' : 38, + 'NumEnqueuedSubgroups' : 39, + 'SubgroupId' : 40, + 'SubgroupLocalInvocationId' : 41, + 'VertexIndex' : 42, + 'InstanceIndex' : 43, + 'SubgroupEqMaskKHR' : 4416, + 'SubgroupGeMaskKHR' : 4417, + 'SubgroupGtMaskKHR' : 4418, + 'SubgroupLeMaskKHR' : 4419, + 'SubgroupLtMaskKHR' : 4420, + 'BaseVertex' : 4424, + 'BaseInstance' : 4425, + 'DrawIndex' : 4426, + 'DeviceIndex' : 4438, + 'ViewIndex' : 4440, + 'BaryCoordNoPerspAMD' : 4992, + 'BaryCoordNoPerspCentroidAMD' : 4993, + 'BaryCoordNoPerspSampleAMD' : 4994, + 'BaryCoordSmoothAMD' : 4995, + 'BaryCoordSmoothCentroidAMD' : 4996, + 'BaryCoordSmoothSampleAMD' : 4997, + 'BaryCoordPullModelAMD' : 4998, + 'FragStencilRefEXT' : 5014, + 'ViewportMaskNV' : 5253, + 'SecondaryPositionNV' : 5257, + 'SecondaryViewportMaskNV' : 5258, + 'PositionPerViewNV' : 5261, + 'ViewportMaskPerViewNV' : 5262, + }, + + 'SelectionControlShift' : { + 'Flatten' : 0, + 'DontFlatten' : 1, + }, + + 'SelectionControlMask' : { + 'MaskNone' : 0, + 'Flatten' : 0x00000001, + 'DontFlatten' : 0x00000002, + }, + + 'LoopControlShift' : { + 'Unroll' : 0, + 'DontUnroll' : 1, + }, + + 'LoopControlMask' : { + 'MaskNone' : 0, + 'Unroll' : 0x00000001, + 'DontUnroll' : 0x00000002, + }, + + 'FunctionControlShift' : { + 'Inline' : 0, + 'DontInline' : 1, + 'Pure' : 2, + 'Const' : 3, + }, + + 'FunctionControlMask' : { + 'MaskNone' : 0, + 'Inline' : 0x00000001, + 'DontInline' : 0x00000002, + 'Pure' : 0x00000004, + 'Const' : 0x00000008, + }, + + 'MemorySemanticsShift' : { + 'Acquire' : 1, + 'Release' : 2, + 'AcquireRelease' : 3, + 'SequentiallyConsistent' : 4, + 'UniformMemory' : 6, + 'SubgroupMemory' : 7, + 'WorkgroupMemory' : 8, + 'CrossWorkgroupMemory' : 9, + 'AtomicCounterMemory' : 10, + 'ImageMemory' : 11, + }, + + 'MemorySemanticsMask' : { + 'MaskNone' : 0, + 'Acquire' : 0x00000002, + 'Release' : 0x00000004, + 'AcquireRelease' : 0x00000008, + 'SequentiallyConsistent' : 0x00000010, + 'UniformMemory' : 0x00000040, + 'SubgroupMemory' : 0x00000080, + 'WorkgroupMemory' : 0x00000100, + 'CrossWorkgroupMemory' : 0x00000200, + 'AtomicCounterMemory' : 0x00000400, + 'ImageMemory' : 0x00000800, + }, + + 'MemoryAccessShift' : { + 'Volatile' : 0, + 'Aligned' : 1, + 'Nontemporal' : 2, + }, + + 'MemoryAccessMask' : { + 'MaskNone' : 0, + 'Volatile' : 0x00000001, + 'Aligned' : 0x00000002, + 'Nontemporal' : 0x00000004, + }, + + 'Scope' : { + 'CrossDevice' : 0, + 'Device' : 1, + 'Workgroup' : 2, + 'Subgroup' : 3, + 'Invocation' : 4, + }, + + 'GroupOperation' : { + 'Reduce' : 0, + 'InclusiveScan' : 1, + 'ExclusiveScan' : 2, + }, + + 'KernelEnqueueFlags' : { + 'NoWait' : 0, + 'WaitKernel' : 1, + 'WaitWorkGroup' : 2, + }, + + 'KernelProfilingInfoShift' : { + 'CmdExecTime' : 0, + }, + + 'KernelProfilingInfoMask' : { + 'MaskNone' : 0, + 'CmdExecTime' : 0x00000001, + }, + + 'Capability' : { + 'Matrix' : 0, + 'Shader' : 1, + 'Geometry' : 2, + 'Tessellation' : 3, + 'Addresses' : 4, + 'Linkage' : 5, + 'Kernel' : 6, + 'Vector16' : 7, + 'Float16Buffer' : 8, + 'Float16' : 9, + 'Float64' : 10, + 'Int64' : 11, + 'Int64Atomics' : 12, + 'ImageBasic' : 13, + 'ImageReadWrite' : 14, + 'ImageMipmap' : 15, + 'Pipes' : 17, + 'Groups' : 18, + 'DeviceEnqueue' : 19, + 'LiteralSampler' : 20, + 'AtomicStorage' : 21, + 'Int16' : 22, + 'TessellationPointSize' : 23, + 'GeometryPointSize' : 24, + 'ImageGatherExtended' : 25, + 'StorageImageMultisample' : 27, + 'UniformBufferArrayDynamicIndexing' : 28, + 'SampledImageArrayDynamicIndexing' : 29, + 'StorageBufferArrayDynamicIndexing' : 30, + 'StorageImageArrayDynamicIndexing' : 31, + 'ClipDistance' : 32, + 'CullDistance' : 33, + 'ImageCubeArray' : 34, + 'SampleRateShading' : 35, + 'ImageRect' : 36, + 'SampledRect' : 37, + 'GenericPointer' : 38, + 'Int8' : 39, + 'InputAttachment' : 40, + 'SparseResidency' : 41, + 'MinLod' : 42, + 'Sampled1D' : 43, + 'Image1D' : 44, + 'SampledCubeArray' : 45, + 'SampledBuffer' : 46, + 'ImageBuffer' : 47, + 'ImageMSArray' : 48, + 'StorageImageExtendedFormats' : 49, + 'ImageQuery' : 50, + 'DerivativeControl' : 51, + 'InterpolationFunction' : 52, + 'TransformFeedback' : 53, + 'GeometryStreams' : 54, + 'StorageImageReadWithoutFormat' : 55, + 'StorageImageWriteWithoutFormat' : 56, + 'MultiViewport' : 57, + 'SubgroupBallotKHR' : 4423, + 'DrawParameters' : 4427, + 'SubgroupVoteKHR' : 4431, + 'StorageBuffer16BitAccess' : 4433, + 'StorageUniformBufferBlock16' : 4433, + 'StorageUniform16' : 4434, + 'UniformAndStorageBuffer16BitAccess' : 4434, + 'StoragePushConstant16' : 4435, + 'StorageInputOutput16' : 4436, + 'DeviceGroup' : 4437, + 'MultiView' : 4439, + 'VariablePointersStorageBuffer' : 4441, + 'VariablePointers' : 4442, + 'AtomicStorageOps' : 4445, + 'SampleMaskPostDepthCoverage' : 4447, + 'ImageGatherBiasLodAMD' : 5009, + 'FragmentMaskAMD' : 5010, + 'StencilExportEXT' : 5013, + 'ImageReadWriteLodAMD' : 5015, + 'SampleMaskOverrideCoverageNV' : 5249, + 'GeometryShaderPassthroughNV' : 5251, + 'ShaderViewportIndexLayerEXT' : 5254, + 'ShaderViewportIndexLayerNV' : 5254, + 'ShaderViewportMaskNV' : 5255, + 'ShaderStereoViewNV' : 5259, + 'PerViewAttributesNV' : 5260, + 'SubgroupShuffleINTEL' : 5568, + 'SubgroupBufferBlockIOINTEL' : 5569, + 'SubgroupImageBlockIOINTEL' : 5570, + }, + + 'Op' : { + 'OpNop' : 0, + 'OpUndef' : 1, + 'OpSourceContinued' : 2, + 'OpSource' : 3, + 'OpSourceExtension' : 4, + 'OpName' : 5, + 'OpMemberName' : 6, + 'OpString' : 7, + 'OpLine' : 8, + 'OpExtension' : 10, + 'OpExtInstImport' : 11, + 'OpExtInst' : 12, + 'OpMemoryModel' : 14, + 'OpEntryPoint' : 15, + 'OpExecutionMode' : 16, + 'OpCapability' : 17, + 'OpTypeVoid' : 19, + 'OpTypeBool' : 20, + 'OpTypeInt' : 21, + 'OpTypeFloat' : 22, + 'OpTypeVector' : 23, + 'OpTypeMatrix' : 24, + 'OpTypeImage' : 25, + 'OpTypeSampler' : 26, + 'OpTypeSampledImage' : 27, + 'OpTypeArray' : 28, + 'OpTypeRuntimeArray' : 29, + 'OpTypeStruct' : 30, + 'OpTypeOpaque' : 31, + 'OpTypePointer' : 32, + 'OpTypeFunction' : 33, + 'OpTypeEvent' : 34, + 'OpTypeDeviceEvent' : 35, + 'OpTypeReserveId' : 36, + 'OpTypeQueue' : 37, + 'OpTypePipe' : 38, + 'OpTypeForwardPointer' : 39, + 'OpConstantTrue' : 41, + 'OpConstantFalse' : 42, + 'OpConstant' : 43, + 'OpConstantComposite' : 44, + 'OpConstantSampler' : 45, + 'OpConstantNull' : 46, + 'OpSpecConstantTrue' : 48, + 'OpSpecConstantFalse' : 49, + 'OpSpecConstant' : 50, + 'OpSpecConstantComposite' : 51, + 'OpSpecConstantOp' : 52, + 'OpFunction' : 54, + 'OpFunctionParameter' : 55, + 'OpFunctionEnd' : 56, + 'OpFunctionCall' : 57, + 'OpVariable' : 59, + 'OpImageTexelPointer' : 60, + 'OpLoad' : 61, + 'OpStore' : 62, + 'OpCopyMemory' : 63, + 'OpCopyMemorySized' : 64, + 'OpAccessChain' : 65, + 'OpInBoundsAccessChain' : 66, + 'OpPtrAccessChain' : 67, + 'OpArrayLength' : 68, + 'OpGenericPtrMemSemantics' : 69, + 'OpInBoundsPtrAccessChain' : 70, + 'OpDecorate' : 71, + 'OpMemberDecorate' : 72, + 'OpDecorationGroup' : 73, + 'OpGroupDecorate' : 74, + 'OpGroupMemberDecorate' : 75, + 'OpVectorExtractDynamic' : 77, + 'OpVectorInsertDynamic' : 78, + 'OpVectorShuffle' : 79, + 'OpCompositeConstruct' : 80, + 'OpCompositeExtract' : 81, + 'OpCompositeInsert' : 82, + 'OpCopyObject' : 83, + 'OpTranspose' : 84, + 'OpSampledImage' : 86, + 'OpImageSampleImplicitLod' : 87, + 'OpImageSampleExplicitLod' : 88, + 'OpImageSampleDrefImplicitLod' : 89, + 'OpImageSampleDrefExplicitLod' : 90, + 'OpImageSampleProjImplicitLod' : 91, + 'OpImageSampleProjExplicitLod' : 92, + 'OpImageSampleProjDrefImplicitLod' : 93, + 'OpImageSampleProjDrefExplicitLod' : 94, + 'OpImageFetch' : 95, + 'OpImageGather' : 96, + 'OpImageDrefGather' : 97, + 'OpImageRead' : 98, + 'OpImageWrite' : 99, + 'OpImage' : 100, + 'OpImageQueryFormat' : 101, + 'OpImageQueryOrder' : 102, + 'OpImageQuerySizeLod' : 103, + 'OpImageQuerySize' : 104, + 'OpImageQueryLod' : 105, + 'OpImageQueryLevels' : 106, + 'OpImageQuerySamples' : 107, + 'OpConvertFToU' : 109, + 'OpConvertFToS' : 110, + 'OpConvertSToF' : 111, + 'OpConvertUToF' : 112, + 'OpUConvert' : 113, + 'OpSConvert' : 114, + 'OpFConvert' : 115, + 'OpQuantizeToF16' : 116, + 'OpConvertPtrToU' : 117, + 'OpSatConvertSToU' : 118, + 'OpSatConvertUToS' : 119, + 'OpConvertUToPtr' : 120, + 'OpPtrCastToGeneric' : 121, + 'OpGenericCastToPtr' : 122, + 'OpGenericCastToPtrExplicit' : 123, + 'OpBitcast' : 124, + 'OpSNegate' : 126, + 'OpFNegate' : 127, + 'OpIAdd' : 128, + 'OpFAdd' : 129, + 'OpISub' : 130, + 'OpFSub' : 131, + 'OpIMul' : 132, + 'OpFMul' : 133, + 'OpUDiv' : 134, + 'OpSDiv' : 135, + 'OpFDiv' : 136, + 'OpUMod' : 137, + 'OpSRem' : 138, + 'OpSMod' : 139, + 'OpFRem' : 140, + 'OpFMod' : 141, + 'OpVectorTimesScalar' : 142, + 'OpMatrixTimesScalar' : 143, + 'OpVectorTimesMatrix' : 144, + 'OpMatrixTimesVector' : 145, + 'OpMatrixTimesMatrix' : 146, + 'OpOuterProduct' : 147, + 'OpDot' : 148, + 'OpIAddCarry' : 149, + 'OpISubBorrow' : 150, + 'OpUMulExtended' : 151, + 'OpSMulExtended' : 152, + 'OpAny' : 154, + 'OpAll' : 155, + 'OpIsNan' : 156, + 'OpIsInf' : 157, + 'OpIsFinite' : 158, + 'OpIsNormal' : 159, + 'OpSignBitSet' : 160, + 'OpLessOrGreater' : 161, + 'OpOrdered' : 162, + 'OpUnordered' : 163, + 'OpLogicalEqual' : 164, + 'OpLogicalNotEqual' : 165, + 'OpLogicalOr' : 166, + 'OpLogicalAnd' : 167, + 'OpLogicalNot' : 168, + 'OpSelect' : 169, + 'OpIEqual' : 170, + 'OpINotEqual' : 171, + 'OpUGreaterThan' : 172, + 'OpSGreaterThan' : 173, + 'OpUGreaterThanEqual' : 174, + 'OpSGreaterThanEqual' : 175, + 'OpULessThan' : 176, + 'OpSLessThan' : 177, + 'OpULessThanEqual' : 178, + 'OpSLessThanEqual' : 179, + 'OpFOrdEqual' : 180, + 'OpFUnordEqual' : 181, + 'OpFOrdNotEqual' : 182, + 'OpFUnordNotEqual' : 183, + 'OpFOrdLessThan' : 184, + 'OpFUnordLessThan' : 185, + 'OpFOrdGreaterThan' : 186, + 'OpFUnordGreaterThan' : 187, + 'OpFOrdLessThanEqual' : 188, + 'OpFUnordLessThanEqual' : 189, + 'OpFOrdGreaterThanEqual' : 190, + 'OpFUnordGreaterThanEqual' : 191, + 'OpShiftRightLogical' : 194, + 'OpShiftRightArithmetic' : 195, + 'OpShiftLeftLogical' : 196, + 'OpBitwiseOr' : 197, + 'OpBitwiseXor' : 198, + 'OpBitwiseAnd' : 199, + 'OpNot' : 200, + 'OpBitFieldInsert' : 201, + 'OpBitFieldSExtract' : 202, + 'OpBitFieldUExtract' : 203, + 'OpBitReverse' : 204, + 'OpBitCount' : 205, + 'OpDPdx' : 207, + 'OpDPdy' : 208, + 'OpFwidth' : 209, + 'OpDPdxFine' : 210, + 'OpDPdyFine' : 211, + 'OpFwidthFine' : 212, + 'OpDPdxCoarse' : 213, + 'OpDPdyCoarse' : 214, + 'OpFwidthCoarse' : 215, + 'OpEmitVertex' : 218, + 'OpEndPrimitive' : 219, + 'OpEmitStreamVertex' : 220, + 'OpEndStreamPrimitive' : 221, + 'OpControlBarrier' : 224, + 'OpMemoryBarrier' : 225, + 'OpAtomicLoad' : 227, + 'OpAtomicStore' : 228, + 'OpAtomicExchange' : 229, + 'OpAtomicCompareExchange' : 230, + 'OpAtomicCompareExchangeWeak' : 231, + 'OpAtomicIIncrement' : 232, + 'OpAtomicIDecrement' : 233, + 'OpAtomicIAdd' : 234, + 'OpAtomicISub' : 235, + 'OpAtomicSMin' : 236, + 'OpAtomicUMin' : 237, + 'OpAtomicSMax' : 238, + 'OpAtomicUMax' : 239, + 'OpAtomicAnd' : 240, + 'OpAtomicOr' : 241, + 'OpAtomicXor' : 242, + 'OpPhi' : 245, + 'OpLoopMerge' : 246, + 'OpSelectionMerge' : 247, + 'OpLabel' : 248, + 'OpBranch' : 249, + 'OpBranchConditional' : 250, + 'OpSwitch' : 251, + 'OpKill' : 252, + 'OpReturn' : 253, + 'OpReturnValue' : 254, + 'OpUnreachable' : 255, + 'OpLifetimeStart' : 256, + 'OpLifetimeStop' : 257, + 'OpGroupAsyncCopy' : 259, + 'OpGroupWaitEvents' : 260, + 'OpGroupAll' : 261, + 'OpGroupAny' : 262, + 'OpGroupBroadcast' : 263, + 'OpGroupIAdd' : 264, + 'OpGroupFAdd' : 265, + 'OpGroupFMin' : 266, + 'OpGroupUMin' : 267, + 'OpGroupSMin' : 268, + 'OpGroupFMax' : 269, + 'OpGroupUMax' : 270, + 'OpGroupSMax' : 271, + 'OpReadPipe' : 274, + 'OpWritePipe' : 275, + 'OpReservedReadPipe' : 276, + 'OpReservedWritePipe' : 277, + 'OpReserveReadPipePackets' : 278, + 'OpReserveWritePipePackets' : 279, + 'OpCommitReadPipe' : 280, + 'OpCommitWritePipe' : 281, + 'OpIsValidReserveId' : 282, + 'OpGetNumPipePackets' : 283, + 'OpGetMaxPipePackets' : 284, + 'OpGroupReserveReadPipePackets' : 285, + 'OpGroupReserveWritePipePackets' : 286, + 'OpGroupCommitReadPipe' : 287, + 'OpGroupCommitWritePipe' : 288, + 'OpEnqueueMarker' : 291, + 'OpEnqueueKernel' : 292, + 'OpGetKernelNDrangeSubGroupCount' : 293, + 'OpGetKernelNDrangeMaxSubGroupSize' : 294, + 'OpGetKernelWorkGroupSize' : 295, + 'OpGetKernelPreferredWorkGroupSizeMultiple' : 296, + 'OpRetainEvent' : 297, + 'OpReleaseEvent' : 298, + 'OpCreateUserEvent' : 299, + 'OpIsValidEvent' : 300, + 'OpSetUserEventStatus' : 301, + 'OpCaptureEventProfilingInfo' : 302, + 'OpGetDefaultQueue' : 303, + 'OpBuildNDRange' : 304, + 'OpImageSparseSampleImplicitLod' : 305, + 'OpImageSparseSampleExplicitLod' : 306, + 'OpImageSparseSampleDrefImplicitLod' : 307, + 'OpImageSparseSampleDrefExplicitLod' : 308, + 'OpImageSparseSampleProjImplicitLod' : 309, + 'OpImageSparseSampleProjExplicitLod' : 310, + 'OpImageSparseSampleProjDrefImplicitLod' : 311, + 'OpImageSparseSampleProjDrefExplicitLod' : 312, + 'OpImageSparseFetch' : 313, + 'OpImageSparseGather' : 314, + 'OpImageSparseDrefGather' : 315, + 'OpImageSparseTexelsResident' : 316, + 'OpNoLine' : 317, + 'OpAtomicFlagTestAndSet' : 318, + 'OpAtomicFlagClear' : 319, + 'OpImageSparseRead' : 320, + 'OpDecorateId' : 332, + 'OpSubgroupBallotKHR' : 4421, + 'OpSubgroupFirstInvocationKHR' : 4422, + 'OpSubgroupAllKHR' : 4428, + 'OpSubgroupAnyKHR' : 4429, + 'OpSubgroupAllEqualKHR' : 4430, + 'OpSubgroupReadInvocationKHR' : 4432, + 'OpGroupIAddNonUniformAMD' : 5000, + 'OpGroupFAddNonUniformAMD' : 5001, + 'OpGroupFMinNonUniformAMD' : 5002, + 'OpGroupUMinNonUniformAMD' : 5003, + 'OpGroupSMinNonUniformAMD' : 5004, + 'OpGroupFMaxNonUniformAMD' : 5005, + 'OpGroupUMaxNonUniformAMD' : 5006, + 'OpGroupSMaxNonUniformAMD' : 5007, + 'OpFragmentMaskFetchAMD' : 5011, + 'OpFragmentFetchAMD' : 5012, + 'OpSubgroupShuffleINTEL' : 5571, + 'OpSubgroupShuffleDownINTEL' : 5572, + 'OpSubgroupShuffleUpINTEL' : 5573, + 'OpSubgroupShuffleXorINTEL' : 5574, + 'OpSubgroupBlockReadINTEL' : 5575, + 'OpSubgroupBlockWriteINTEL' : 5576, + 'OpSubgroupImageBlockReadINTEL' : 5577, + 'OpSubgroupImageBlockWriteINTEL' : 5578, + 'OpDecorateStringGOOGLE' : 5632, + 'OpMemberDecorateStringGOOGLE' : 5633, + }, + +} + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/extinst.glsl.std.450.grammar.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/extinst.glsl.std.450.grammar.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/extinst.glsl.std.450.grammar.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/extinst.glsl.std.450.grammar.json 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,642 @@ +{ + "copyright" : [ + "Copyright (c) 2014-2016 The Khronos Group Inc.", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and/or associated documentation files (the \"Materials\"),", + "to deal in the Materials without restriction, including without limitation", + "the rights to use, copy, modify, merge, publish, distribute, sublicense,", + "and/or sell copies of the Materials, and to permit persons to whom the", + "Materials are furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Materials.", + "", + "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", + "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", + "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", + "", + "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", + "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", + "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", + "IN THE MATERIALS." + ], + "version" : 100, + "revision" : 2, + "instructions" : [ + { + "opname" : "Round", + "opcode" : 1, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "RoundEven", + "opcode" : 2, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Trunc", + "opcode" : 3, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "FAbs", + "opcode" : 4, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "SAbs", + "opcode" : 5, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "FSign", + "opcode" : 6, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "SSign", + "opcode" : 7, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Floor", + "opcode" : 8, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Ceil", + "opcode" : 9, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Fract", + "opcode" : 10, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Radians", + "opcode" : 11, + "operands" : [ + { "kind" : "IdRef", "name" : "'degrees'" } + ] + }, + { + "opname" : "Degrees", + "opcode" : 12, + "operands" : [ + { "kind" : "IdRef", "name" : "'radians'" } + ] + }, + { + "opname" : "Sin", + "opcode" : 13, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Cos", + "opcode" : 14, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Tan", + "opcode" : 15, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Asin", + "opcode" : 16, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Acos", + "opcode" : 17, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Atan", + "opcode" : 18, + "operands" : [ + { "kind" : "IdRef", "name" : "'y_over_x'" } + ] + }, + { + "opname" : "Sinh", + "opcode" : 19, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Cosh", + "opcode" : 20, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Tanh", + "opcode" : 21, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Asinh", + "opcode" : 22, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Acosh", + "opcode" : 23, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Atanh", + "opcode" : 24, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Atan2", + "opcode" : 25, + "operands" : [ + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Pow", + "opcode" : 26, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "Exp", + "opcode" : 27, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Log", + "opcode" : 28, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Exp2", + "opcode" : 29, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Log2", + "opcode" : 30, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Sqrt", + "opcode" : 31, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "InverseSqrt", + "opcode" : 32, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Determinant", + "opcode" : 33, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "MatrixInverse", + "opcode" : 34, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Modf", + "opcode" : 35, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'i'" } + ] + }, + { + "opname" : "ModfStruct", + "opcode" : 36, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "FMin", + "opcode" : 37, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "UMin", + "opcode" : 38, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "SMin", + "opcode" : 39, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "FMax", + "opcode" : 40, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "UMax", + "opcode" : 41, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "SMax", + "opcode" : 42, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "FClamp", + "opcode" : 43, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minVal'" }, + { "kind" : "IdRef", "name" : "'maxVal'" } + ] + }, + { + "opname" : "UClamp", + "opcode" : 44, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minVal'" }, + { "kind" : "IdRef", "name" : "'maxVal'" } + ] + }, + { + "opname" : "SClamp", + "opcode" : 45, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minVal'" }, + { "kind" : "IdRef", "name" : "'maxVal'" } + ] + }, + { + "opname" : "FMix", + "opcode" : 46, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'a'" } + ] + }, + { + "opname" : "IMix", + "opcode" : 47, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'a'" } + ] + }, + { + "opname" : "Step", + "opcode" : 48, + "operands" : [ + { "kind" : "IdRef", "name" : "'edge'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "SmoothStep", + "opcode" : 49, + "operands" : [ + { "kind" : "IdRef", "name" : "'edge0'" }, + { "kind" : "IdRef", "name" : "'edge1'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Fma", + "opcode" : 50, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "Frexp", + "opcode" : 51, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'exp'" } + ] + }, + { + "opname" : "FrexpStruct", + "opcode" : 52, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Ldexp", + "opcode" : 53, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'exp'" } + ] + }, + { + "opname" : "PackSnorm4x8", + "opcode" : 54, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackUnorm4x8", + "opcode" : 55, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackSnorm2x16", + "opcode" : 56, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackUnorm2x16", + "opcode" : 57, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackHalf2x16", + "opcode" : 58, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackDouble2x32", + "opcode" : 59, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ], + "capabilities" : [ "Float64" ] + }, + { + "opname" : "UnpackSnorm2x16", + "opcode" : 60, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "UnpackUnorm2x16", + "opcode" : 61, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "UnpackHalf2x16", + "opcode" : 62, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "UnpackSnorm4x8", + "opcode" : 63, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "UnpackUnorm4x8", + "opcode" : 64, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "UnpackDouble2x32", + "opcode" : 65, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ], + "capabilities" : [ "Float64" ] + }, + { + "opname" : "Length", + "opcode" : 66, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Distance", + "opcode" : 67, + "operands" : [ + { "kind" : "IdRef", "name" : "'p0'" }, + { "kind" : "IdRef", "name" : "'p1'" } + ] + }, + { + "opname" : "Cross", + "opcode" : 68, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "Normalize", + "opcode" : 69, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "FaceForward", + "opcode" : 70, + "operands" : [ + { "kind" : "IdRef", "name" : "'N'" }, + { "kind" : "IdRef", "name" : "'I'" }, + { "kind" : "IdRef", "name" : "'Nref'" } + ] + }, + { + "opname" : "Reflect", + "opcode" : 71, + "operands" : [ + { "kind" : "IdRef", "name" : "'I'" }, + { "kind" : "IdRef", "name" : "'N'" } + ] + }, + { + "opname" : "Refract", + "opcode" : 72, + "operands" : [ + { "kind" : "IdRef", "name" : "'I'" }, + { "kind" : "IdRef", "name" : "'N'" }, + { "kind" : "IdRef", "name" : "'eta'" } + ] + }, + { + "opname" : "FindILsb", + "opcode" : 73, + "operands" : [ + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "FindSMsb", + "opcode" : 74, + "operands" : [ + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "FindUMsb", + "opcode" : 75, + "operands" : [ + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "InterpolateAtCentroid", + "opcode" : 76, + "operands" : [ + { "kind" : "IdRef", "name" : "'interpolant'" } + ], + "capabilities" : [ "InterpolationFunction" ] + }, + { + "opname" : "InterpolateAtSample", + "opcode" : 77, + "operands" : [ + { "kind" : "IdRef", "name" : "'interpolant'" }, + { "kind" : "IdRef", "name" : "'sample'" } + ], + "capabilities" : [ "InterpolationFunction" ] + }, + { + "opname" : "InterpolateAtOffset", + "opcode" : 78, + "operands" : [ + { "kind" : "IdRef", "name" : "'interpolant'" }, + { "kind" : "IdRef", "name" : "'offset'" } + ], + "capabilities" : [ "InterpolationFunction" ] + }, + { + "opname" : "NMin", + "opcode" : 79, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "NMax", + "opcode" : 80, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "NClamp", + "opcode" : 81, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minVal'" }, + { "kind" : "IdRef", "name" : "'maxVal'" } + ] + } + ] +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/extinst.opencl.std.100.grammar.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/extinst.opencl.std.100.grammar.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/extinst.opencl.std.100.grammar.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/extinst.opencl.std.100.grammar.json 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1279 @@ +{ + "copyright" : [ + "Copyright (c) 2014-2016 The Khronos Group Inc.", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and/or associated documentation files (the \"Materials\"),", + "to deal in the Materials without restriction, including without limitation", + "the rights to use, copy, modify, merge, publish, distribute, sublicense,", + "and/or sell copies of the Materials, and to permit persons to whom the", + "Materials are furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Materials.", + "", + "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", + "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", + "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", + "", + "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", + "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", + "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", + "IN THE MATERIALS." + ], + "version" : 100, + "revision" : 2, + "instructions" : [ + { + "opname" : "acos", + "opcode" : 0, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "acosh", + "opcode" : 1, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "acospi", + "opcode" : 2, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "asin", + "opcode" : 3, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "asinh", + "opcode" : 4, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "asinpi", + "opcode" : 5, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atan", + "opcode" : 6, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atan2", + "opcode" : 7, + "operands" : [ + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atanh", + "opcode" : 8, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atanpi", + "opcode" : 9, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atan2pi", + "opcode" : 10, + "operands" : [ + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "cbrt", + "opcode" : 11, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "ceil", + "opcode" : 12, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "copysign", + "opcode" : 13, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "cos", + "opcode" : 14, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "cosh", + "opcode" : 15, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "cospi", + "opcode" : 16, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "erfc", + "opcode" : 17, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "erf", + "opcode" : 18, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "exp", + "opcode" : 19, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "exp2", + "opcode" : 20, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "exp10", + "opcode" : 21, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "expm1", + "opcode" : 22, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "fabs", + "opcode" : 23, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "fdim", + "opcode" : 24, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "floor", + "opcode" : 25, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "fma", + "opcode" : 26, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "fmax", + "opcode" : 27, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "fmin", + "opcode" : 28, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "fmod", + "opcode" : 29, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "fract", + "opcode" : 30, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'ptr'" } + ] + }, + { + "opname" : "frexp", + "opcode" : 31, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'exp'" } + ] + }, + { + "opname" : "hypot", + "opcode" : 32, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "ilogb", + "opcode" : 33, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "ldexp", + "opcode" : 34, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'k'" } + ] + }, + { + "opname" : "lgamma", + "opcode" : 35, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "lgamma_r", + "opcode" : 36, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'signp'" } + ] + }, + { + "opname" : "log", + "opcode" : 37, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "log2", + "opcode" : 38, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "log10", + "opcode" : 39, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "log1p", + "opcode" : 40, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "logb", + "opcode" : 41, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "mad", + "opcode" : 42, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "maxmag", + "opcode" : 43, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "minmag", + "opcode" : 44, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "modf", + "opcode" : 45, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'iptr'" } + ] + }, + { + "opname" : "nan", + "opcode" : 46, + "operands" : [ + { "kind" : "IdRef", "name" : "'nancode'" } + ] + }, + { + "opname" : "nextafter", + "opcode" : 47, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "pow", + "opcode" : 48, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y" } + ] + }, + { + "opname" : "pown", + "opcode" : 49, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "powr", + "opcode" : 50, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "remainder", + "opcode" : 51, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "remquo", + "opcode" : 52, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'quo'" } + ] + }, + { + "opname" : "rint", + "opcode" : 53, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "rootn", + "opcode" : 54, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "round", + "opcode" : 55, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "rsqrt", + "opcode" : 56, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sin", + "opcode" : 57, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sincos", + "opcode" : 58, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'cosval'" } + ] + }, + { + "opname" : "sinh", + "opcode" : 59, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sinpi", + "opcode" : 60, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sqrt", + "opcode" : 61, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "tan", + "opcode" : 62, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "tanh", + "opcode" : 63, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "tanpi", + "opcode" : 64, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "tgamma", + "opcode" : 65, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "trunc", + "opcode" : 66, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_cos", + "opcode" : 67, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_divide", + "opcode" : 68, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "half_exp", + "opcode" : 69, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_exp2", + "opcode" : 70, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_exp10", + "opcode" : 71, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_log", + "opcode" : 72, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_log2", + "opcode" : 73, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_log10", + "opcode" : 74, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_powr", + "opcode" : 75, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "half_recip", + "opcode" : 76, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_rsqrt", + "opcode" : 77, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_sin", + "opcode" : 78, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_sqrt", + "opcode" : 79, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_tan", + "opcode" : 80, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_cos", + "opcode" : 81, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_divide", + "opcode" : 82, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "native_exp", + "opcode" : 83, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_exp2", + "opcode" : 84, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_exp10", + "opcode" : 85, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_log", + "opcode" : 86, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_log2", + "opcode" : 87, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_log10", + "opcode" : 88, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_powr", + "opcode" : 89, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "native_recip", + "opcode" : 90, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_rsqrt", + "opcode" : 91, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_sin", + "opcode" : 92, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_sqrt", + "opcode" : 93, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_tan", + "opcode" : 94, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "s_abs", + "opcode" : 141, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "s_abs_diff", + "opcode" : 142, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_add_sat", + "opcode" : 143, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_add_sat", + "opcode" : 144, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_hadd", + "opcode" : 145, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_hadd", + "opcode" : 146, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_rhadd", + "opcode" : 147, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_rhadd", + "opcode" : 148, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_clamp", + "opcode" : 149, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minval'" }, + { "kind" : "IdRef", "name" : "'maxval'" } + ] + }, + { + "opname" : "u_clamp", + "opcode" : 150, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minval'" }, + { "kind" : "IdRef", "name" : "'maxval'" } + ] + }, + { + "opname" : "clz", + "opcode" : 151, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "ctz", + "opcode" : 152, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "s_mad_hi", + "opcode" : 153, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "u_mad_sat", + "opcode" : 154, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ] + }, + { + "opname" : "s_mad_sat", + "opcode" : 155, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ] + }, + { + "opname" : "s_max", + "opcode" : 156, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_max", + "opcode" : 157, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_min", + "opcode" : 158, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_min", + "opcode" : 159, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_mul_hi", + "opcode" : 160, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "rotate", + "opcode" : 161, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" }, + { "kind" : "IdRef", "name" : "'i'" } + ] + }, + { + "opname" : "s_sub_sat", + "opcode" : 162, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_sub_sat", + "opcode" : 163, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_upsample", + "opcode" : 164, + "operands" : [ + { "kind" : "IdRef", "name" : "'hi'" }, + { "kind" : "IdRef", "name" : "'lo'" } + ] + }, + { + "opname" : "s_upsample", + "opcode" : 165, + "operands" : [ + { "kind" : "IdRef", "name" : "'hi'" }, + { "kind" : "IdRef", "name" : "'lo'" } + ] + }, + { + "opname" : "popcount", + "opcode" : 166, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "s_mad24", + "opcode" : 167, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ] + }, + { + "opname" : "u_mad24", + "opcode" : 168, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ] + }, + { + "opname" : "s_mul24", + "opcode" : 169, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_mul24", + "opcode" : 170, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_abs", + "opcode" : 201, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "u_abs_diff", + "opcode" : 202, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_mul_hi", + "opcode" : 203, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_mad_hi", + "opcode" : 204, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "fclamp", + "opcode" : 95, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minval'" }, + { "kind" : "IdRef", "name" : "'maxval'" } + ] + }, + { + "opname" : "degrees", + "opcode" :96, + "operands" : [ + { "kind" : "IdRef", "name" : "'radians'" } + ] + }, + { + "opname" : "fmax_common", + "opcode" : 97, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "fmin_common", + "opcode" : 98, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "mix", + "opcode" : 99, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'a'" } + ] + }, + { + "opname" : "radians", + "opcode" : 100, + "operands" : [ + { "kind" : "IdRef", "name" : "'degrees'" } + ] + }, + { + "opname" : "step", + "opcode" : 101, + "operands" : [ + { "kind" : "IdRef", "name" : "'edge'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "smoothstep", + "opcode" : 102, + "operands" : [ + { "kind" : "IdRef", "name" : "'edge0'" }, + { "kind" : "IdRef", "name" : "'edge1'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sign", + "opcode" : 103, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "cross", + "opcode" : 104, + "operands" : [ + { "kind" : "IdRef", "name" : "'p0'" }, + { "kind" : "IdRef", "name" : "'p1'" } + ] + }, + { + "opname" : "distance", + "opcode" : 105, + "operands" : [ + { "kind" : "IdRef", "name" : "'p0'" }, + { "kind" : "IdRef", "name" : "'p1'" } + ] + }, + { + "opname" : "length", + "opcode" : 106, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "normalize", + "opcode" : 107, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "fast_distance", + "opcode" : 108, + "operands" : [ + { "kind" : "IdRef", "name" : "'p0'" }, + { "kind" : "IdRef", "name" : "'p1'" } + ] + }, + { + "opname" : "fast_length", + "opcode" : 109, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "fast_normalize", + "opcode" : 110, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "bitselect", + "opcode" : 186, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "select", + "opcode" : 187, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "vloadn", + "opcode" : 171, + "operands" : [ + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "LiteralInteger", "name" : "'n'" } + ] + }, + { + "opname" : "vstoren", + "opcode" : 172, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vload_half", + "opcode" : 173, + "operands" : [ + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vload_halfn", + "opcode" : 174, + "operands" : [ + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "LiteralInteger", "name" : "'n'" } + ] + }, + { + "opname" : "vstore_half", + "opcode" : 175, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vstore_half_r", + "opcode" : 176, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "FPRoundingMode", "name" : "'mode'" } + ] + }, + { + "opname" : "vstore_halfn", + "opcode" : 177, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vstore_halfn_r", + "opcode" : 178, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "FPRoundingMode", "name" : "'mode'" } + ] + }, + { + "opname" : "vloada_halfn", + "opcode" : 179, + "operands" : [ + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "LiteralInteger", "name" : "'n'" } + ] + }, + { + "opname" : "vstorea_halfn", + "opcode" : 180, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vstorea_halfn_r", + "opcode" : 181, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "FPRoundingMode", "name" : "'mode'" } + ] + }, + { + "opname" : "shuffle", + "opcode" : 182, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'shuffle mask'" } + ] + }, + { + "opname" : "shuffle2", + "opcode" : 183, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'shuffle mask'" } + ] + }, + { + "opname" : "printf", + "opcode" : 184, + "operands" : [ + { "kind" : "IdRef", "name" : "'format'" }, + { "kind" : "IdRef", "name" : "'additional arguments'", "quantifier" : "*" } + ] + }, + { + "opname" : "prefetch", + "opcode" : 185, + "operands" : [ + { "kind" : "IdRef", "name" : "'ptr'" }, + { "kind" : "IdRef", "name" : "'num elements'" } + ] + } + ] +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/GLSL.std.450.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/GLSL.std.450.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/GLSL.std.450.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/GLSL.std.450.h 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,131 @@ +/* +** Copyright (c) 2014-2016 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +#ifndef GLSLstd450_H +#define GLSLstd450_H + +static const int GLSLstd450Version = 100; +static const int GLSLstd450Revision = 3; + +enum GLSLstd450 { + GLSLstd450Bad = 0, // Don't use + + GLSLstd450Round = 1, + GLSLstd450RoundEven = 2, + GLSLstd450Trunc = 3, + GLSLstd450FAbs = 4, + GLSLstd450SAbs = 5, + GLSLstd450FSign = 6, + GLSLstd450SSign = 7, + GLSLstd450Floor = 8, + GLSLstd450Ceil = 9, + GLSLstd450Fract = 10, + + GLSLstd450Radians = 11, + GLSLstd450Degrees = 12, + GLSLstd450Sin = 13, + GLSLstd450Cos = 14, + GLSLstd450Tan = 15, + GLSLstd450Asin = 16, + GLSLstd450Acos = 17, + GLSLstd450Atan = 18, + GLSLstd450Sinh = 19, + GLSLstd450Cosh = 20, + GLSLstd450Tanh = 21, + GLSLstd450Asinh = 22, + GLSLstd450Acosh = 23, + GLSLstd450Atanh = 24, + GLSLstd450Atan2 = 25, + + GLSLstd450Pow = 26, + GLSLstd450Exp = 27, + GLSLstd450Log = 28, + GLSLstd450Exp2 = 29, + GLSLstd450Log2 = 30, + GLSLstd450Sqrt = 31, + GLSLstd450InverseSqrt = 32, + + GLSLstd450Determinant = 33, + GLSLstd450MatrixInverse = 34, + + GLSLstd450Modf = 35, // second operand needs an OpVariable to write to + GLSLstd450ModfStruct = 36, // no OpVariable operand + GLSLstd450FMin = 37, + GLSLstd450UMin = 38, + GLSLstd450SMin = 39, + GLSLstd450FMax = 40, + GLSLstd450UMax = 41, + GLSLstd450SMax = 42, + GLSLstd450FClamp = 43, + GLSLstd450UClamp = 44, + GLSLstd450SClamp = 45, + GLSLstd450FMix = 46, + GLSLstd450IMix = 47, // Reserved + GLSLstd450Step = 48, + GLSLstd450SmoothStep = 49, + + GLSLstd450Fma = 50, + GLSLstd450Frexp = 51, // second operand needs an OpVariable to write to + GLSLstd450FrexpStruct = 52, // no OpVariable operand + GLSLstd450Ldexp = 53, + + GLSLstd450PackSnorm4x8 = 54, + GLSLstd450PackUnorm4x8 = 55, + GLSLstd450PackSnorm2x16 = 56, + GLSLstd450PackUnorm2x16 = 57, + GLSLstd450PackHalf2x16 = 58, + GLSLstd450PackDouble2x32 = 59, + GLSLstd450UnpackSnorm2x16 = 60, + GLSLstd450UnpackUnorm2x16 = 61, + GLSLstd450UnpackHalf2x16 = 62, + GLSLstd450UnpackSnorm4x8 = 63, + GLSLstd450UnpackUnorm4x8 = 64, + GLSLstd450UnpackDouble2x32 = 65, + + GLSLstd450Length = 66, + GLSLstd450Distance = 67, + GLSLstd450Cross = 68, + GLSLstd450Normalize = 69, + GLSLstd450FaceForward = 70, + GLSLstd450Reflect = 71, + GLSLstd450Refract = 72, + + GLSLstd450FindILsb = 73, + GLSLstd450FindSMsb = 74, + GLSLstd450FindUMsb = 75, + + GLSLstd450InterpolateAtCentroid = 76, + GLSLstd450InterpolateAtSample = 77, + GLSLstd450InterpolateAtOffset = 78, + + GLSLstd450NMin = 79, + GLSLstd450NMax = 80, + GLSLstd450NClamp = 81, + + GLSLstd450Count +}; + +#endif // #ifndef GLSLstd450_H diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/OpenCL.std.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/OpenCL.std.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/OpenCL.std.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/OpenCL.std.h 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,210 @@ +/* +** Copyright (c) 2015-2017 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +namespace OpenCLLIB { + +enum Entrypoints { + + // Section 2.1: Math extended instructions + Acos = 0, + Acosh = 1, + Acospi = 2, + Asin = 3, + Asinh = 4, + Asinpi = 5, + Atan = 6, + Atan2 = 7, + Atanh = 8, + Atanpi = 9, + Atan2pi = 10, + Cbrt = 11, + Ceil = 12, + Copysign = 13, + Cos = 14, + Cosh = 15, + Cospi = 16, + Erfc = 17, + Erf = 18, + Exp = 19, + Exp2 = 20, + Exp10 = 21, + Expm1 = 22, + Fabs = 23, + Fdim = 24, + Floor = 25, + Fma = 26, + Fmax = 27, + Fmin = 28, + Fmod = 29, + Fract = 30, + Frexp = 31, + Hypot = 32, + Ilogb = 33, + Ldexp = 34, + Lgamma = 35, + Lgamma_r = 36, + Log = 37, + Log2 = 38, + Log10 = 39, + Log1p = 40, + Logb = 41, + Mad = 42, + Maxmag = 43, + Minmag = 44, + Modf = 45, + Nan = 46, + Nextafter = 47, + Pow = 48, + Pown = 49, + Powr = 50, + Remainder = 51, + Remquo = 52, + Rint = 53, + Rootn = 54, + Round = 55, + Rsqrt = 56, + Sin = 57, + Sincos = 58, + Sinh = 59, + Sinpi = 60, + Sqrt = 61, + Tan = 62, + Tanh = 63, + Tanpi = 64, + Tgamma = 65, + Trunc = 66, + Half_cos = 67, + Half_divide = 68, + Half_exp = 69, + Half_exp2 = 70, + Half_exp10 = 71, + Half_log = 72, + Half_log2 = 73, + Half_log10 = 74, + Half_powr = 75, + Half_recip = 76, + Half_rsqrt = 77, + Half_sin = 78, + Half_sqrt = 79, + Half_tan = 80, + Native_cos = 81, + Native_divide = 82, + Native_exp = 83, + Native_exp2 = 84, + Native_exp10 = 85, + Native_log = 86, + Native_log2 = 87, + Native_log10 = 88, + Native_powr = 89, + Native_recip = 90, + Native_rsqrt = 91, + Native_sin = 92, + Native_sqrt = 93, + Native_tan = 94, + + // Section 2.2: Integer instructions + SAbs = 141, + SAbs_diff = 142, + SAdd_sat = 143, + UAdd_sat = 144, + SHadd = 145, + UHadd = 146, + SRhadd = 147, + URhadd = 148, + SClamp = 149, + UClamp = 150, + Clz = 151, + Ctz = 152, + SMad_hi = 153, + UMad_sat = 154, + SMad_sat = 155, + SMax = 156, + UMax = 157, + SMin = 158, + UMin = 159, + SMul_hi = 160, + Rotate = 161, + SSub_sat = 162, + USub_sat = 163, + U_Upsample = 164, + S_Upsample = 165, + Popcount = 166, + SMad24 = 167, + UMad24 = 168, + SMul24 = 169, + UMul24 = 170, + UAbs = 201, + UAbs_diff = 202, + UMul_hi = 203, + UMad_hi = 204, + + // Section 2.3: Common instructions + FClamp = 95, + Degrees = 96, + FMax_common = 97, + FMin_common = 98, + Mix = 99, + Radians = 100, + Step = 101, + Smoothstep = 102, + Sign = 103, + + // Section 2.4: Geometric instructions + Cross = 104, + Distance = 105, + Length = 106, + Normalize = 107, + Fast_distance = 108, + Fast_length = 109, + Fast_normalize = 110, + + // Section 2.5: Relational instructions + Bitselect = 186, + Select = 187, + + // Section 2.6: Vector Data Load and Store instructions + Vloadn = 171, + Vstoren = 172, + Vload_half = 173, + Vload_halfn = 174, + Vstore_half = 175, + Vstore_half_r = 176, + Vstore_halfn = 177, + Vstore_halfn_r = 178, + Vloada_halfn = 179, + Vstorea_halfn = 180, + Vstorea_halfn_r = 181, + + // Section 2.7: Miscellaneous Vector instructions + Shuffle = 182, + Shuffle2 = 183, + + // Section 2.8: Misc instructions + Printf = 184, + Prefetch = 185, +}; + +} // end namespace OpenCLLIB diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.core.grammar.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.core.grammar.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.core.grammar.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.core.grammar.json 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,5938 @@ +{ + "copyright" : [ + "Copyright (c) 2014-2016 The Khronos Group Inc.", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and/or associated documentation files (the \"Materials\"),", + "to deal in the Materials without restriction, including without limitation", + "the rights to use, copy, modify, merge, publish, distribute, sublicense,", + "and/or sell copies of the Materials, and to permit persons to whom the", + "Materials are furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Materials.", + "", + "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", + "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", + "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", + "", + "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", + "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", + "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", + "IN THE MATERIALS." + ], + "magic_number" : "0x07230203", + "major_version" : 1, + "minor_version" : 1, + "revision" : 8, + "instructions" : [ + { + "opname" : "OpNop", + "opcode" : 0 + }, + { + "opname" : "OpUndef", + "opcode" : 1, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpSourceContinued", + "opcode" : 2, + "operands" : [ + { "kind" : "LiteralString", "name" : "'Continued Source'" } + ] + }, + { + "opname" : "OpSource", + "opcode" : 3, + "operands" : [ + { "kind" : "SourceLanguage" }, + { "kind" : "LiteralInteger", "name" : "'Version'" }, + { "kind" : "IdRef", "quantifier" : "?", "name" : "'File'" }, + { "kind" : "LiteralString", "quantifier" : "?", "name" : "'Source'" } + ] + }, + { + "opname" : "OpSourceExtension", + "opcode" : 4, + "operands" : [ + { "kind" : "LiteralString", "name" : "'Extension'" } + ] + }, + { + "opname" : "OpName", + "opcode" : 5, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "LiteralString", "name" : "'Name'" } + ] + }, + { + "opname" : "OpMemberName", + "opcode" : 6, + "operands" : [ + { "kind" : "IdRef", "name" : "'Type'" }, + { "kind" : "LiteralInteger", "name" : "'Member'" }, + { "kind" : "LiteralString", "name" : "'Name'" } + ] + }, + { + "opname" : "OpString", + "opcode" : 7, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralString", "name" : "'String'" } + ] + }, + { + "opname" : "OpLine", + "opcode" : 8, + "operands" : [ + { "kind" : "IdRef", "name" : "'File'" }, + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "LiteralInteger", "name" : "'Column'" } + ] + }, + { + "opname" : "OpExtension", + "opcode" : 10, + "operands" : [ + { "kind" : "LiteralString", "name" : "'Name'" } + ] + }, + { + "opname" : "OpExtInstImport", + "opcode" : 11, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralString", "name" : "'Name'" } + ] + }, + { + "opname" : "OpExtInst", + "opcode" : 12, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Set'" }, + { "kind" : "LiteralExtInstInteger", "name" : "'Instruction'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Operand 1', +\n'Operand 2', +\n..." } + ] + }, + { + "opname" : "OpMemoryModel", + "opcode" : 14, + "operands" : [ + { "kind" : "AddressingModel" }, + { "kind" : "MemoryModel" } + ] + }, + { + "opname" : "OpEntryPoint", + "opcode" : 15, + "operands" : [ + { "kind" : "ExecutionModel" }, + { "kind" : "IdRef", "name" : "'Entry Point'" }, + { "kind" : "LiteralString", "name" : "'Name'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Interface'" } + ] + }, + { + "opname" : "OpExecutionMode", + "opcode" : 16, + "operands" : [ + { "kind" : "IdRef", "name" : "'Entry Point'" }, + { "kind" : "ExecutionMode", "name" : "'Mode'" } + ] + }, + { + "opname" : "OpCapability", + "opcode" : 17, + "operands" : [ + { "kind" : "Capability", "name" : "'Capability'" } + ] + }, + { + "opname" : "OpTypeVoid", + "opcode" : 19, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpTypeBool", + "opcode" : 20, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpTypeInt", + "opcode" : 21, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralInteger", "name" : "'Width'" }, + { "kind" : "LiteralInteger", "name" : "'Signedness'" } + ] + }, + { + "opname" : "OpTypeFloat", + "opcode" : 22, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralInteger", "name" : "'Width'" } + ] + }, + { + "opname" : "OpTypeVector", + "opcode" : 23, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Component Type'" }, + { "kind" : "LiteralInteger", "name" : "'Component Count'" } + ] + }, + { + "opname" : "OpTypeMatrix", + "opcode" : 24, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Column Type'" }, + { "kind" : "LiteralInteger", "name" : "'Column Count'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpTypeImage", + "opcode" : 25, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Type'" }, + { "kind" : "Dim" }, + { "kind" : "LiteralInteger", "name" : "'Depth'" }, + { "kind" : "LiteralInteger", "name" : "'Arrayed'" }, + { "kind" : "LiteralInteger", "name" : "'MS'" }, + { "kind" : "LiteralInteger", "name" : "'Sampled'" }, + { "kind" : "ImageFormat" }, + { "kind" : "AccessQualifier", "quantifier" : "?" } + ] + }, + { + "opname" : "OpTypeSampler", + "opcode" : 26, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpTypeSampledImage", + "opcode" : 27, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image Type'" } + ] + }, + { + "opname" : "OpTypeArray", + "opcode" : 28, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Element Type'" }, + { "kind" : "IdRef", "name" : "'Length'" } + ] + }, + { + "opname" : "OpTypeRuntimeArray", + "opcode" : 29, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Element Type'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpTypeStruct", + "opcode" : 30, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Member 0 type', +\n'member 1 type', +\n..." } + ] + }, + { + "opname" : "OpTypeOpaque", + "opcode" : 31, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralString", "name" : "The name of the opaque type." } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpTypePointer", + "opcode" : 32, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "StorageClass" }, + { "kind" : "IdRef", "name" : "'Type'" } + ] + }, + { + "opname" : "OpTypeFunction", + "opcode" : 33, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Return Type'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Parameter 0 Type', +\n'Parameter 1 Type', +\n..." } + ] + }, + { + "opname" : "OpTypeEvent", + "opcode" : 34, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpTypeDeviceEvent", + "opcode" : 35, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpTypeReserveId", + "opcode" : 36, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpTypeQueue", + "opcode" : 37, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpTypePipe", + "opcode" : 38, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "AccessQualifier", "name" : "'Qualifier'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpTypeForwardPointer", + "opcode" : 39, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer Type'" }, + { "kind" : "StorageClass" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpConstantTrue", + "opcode" : 41, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpConstantFalse", + "opcode" : 42, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpConstant", + "opcode" : 43, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } + ] + }, + { + "opname" : "OpConstantComposite", + "opcode" : 44, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } + ] + }, + { + "opname" : "OpConstantSampler", + "opcode" : 45, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "SamplerAddressingMode" }, + { "kind" : "LiteralInteger", "name" : "'Param'" }, + { "kind" : "SamplerFilterMode" } + ], + "capabilities" : [ "LiteralSampler" ] + }, + { + "opname" : "OpConstantNull", + "opcode" : 46, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpSpecConstantTrue", + "opcode" : 48, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpSpecConstantFalse", + "opcode" : 49, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpSpecConstant", + "opcode" : 50, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } + ] + }, + { + "opname" : "OpSpecConstantComposite", + "opcode" : 51, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } + ] + }, + { + "opname" : "OpSpecConstantOp", + "opcode" : 52, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "LiteralSpecConstantOpInteger", "name" : "'Opcode'" } + ] + }, + { + "opname" : "OpFunction", + "opcode" : 54, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "FunctionControl" }, + { "kind" : "IdRef", "name" : "'Function Type'" } + ] + }, + { + "opname" : "OpFunctionParameter", + "opcode" : 55, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpFunctionEnd", + "opcode" : 56 + }, + { + "opname" : "OpFunctionCall", + "opcode" : 57, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Function'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Argument 0', +\n'Argument 1', +\n..." } + ] + }, + { + "opname" : "OpVariable", + "opcode" : 59, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "StorageClass" }, + { "kind" : "IdRef", "quantifier" : "?", "name" : "'Initializer'" } + ] + }, + { + "opname" : "OpImageTexelPointer", + "opcode" : 60, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Sample'" } + ] + }, + { + "opname" : "OpLoad", + "opcode" : 61, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "MemoryAccess", "quantifier" : "?" } + ] + }, + { + "opname" : "OpStore", + "opcode" : 62, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Object'" }, + { "kind" : "MemoryAccess", "quantifier" : "?" } + ] + }, + { + "opname" : "OpCopyMemory", + "opcode" : 63, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "MemoryAccess", "quantifier" : "?" } + ] + }, + { + "opname" : "OpCopyMemorySized", + "opcode" : 64, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "IdRef", "name" : "'Size'" }, + { "kind" : "MemoryAccess", "quantifier" : "?" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpAccessChain", + "opcode" : 65, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpInBoundsAccessChain", + "opcode" : 66, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpPtrAccessChain", + "opcode" : 67, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Element'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ], + "capabilities" : [ + "Addresses", + "VariablePointers", + "VariablePointersStorageBuffer" + ] + }, + { + "opname" : "OpArrayLength", + "opcode" : 68, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Structure'" }, + { "kind" : "LiteralInteger", "name" : "'Array member'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpGenericPtrMemSemantics", + "opcode" : 69, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpInBoundsPtrAccessChain", + "opcode" : 70, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Element'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpDecorate", + "opcode" : 71, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "Decoration" } + ] + }, + { + "opname" : "OpMemberDecorate", + "opcode" : 72, + "operands" : [ + { "kind" : "IdRef", "name" : "'Structure Type'" }, + { "kind" : "LiteralInteger", "name" : "'Member'" }, + { "kind" : "Decoration" } + ] + }, + { + "opname" : "OpDecorationGroup", + "opcode" : 73, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpGroupDecorate", + "opcode" : 74, + "operands" : [ + { "kind" : "IdRef", "name" : "'Decoration Group'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Targets'" } + ] + }, + { + "opname" : "OpGroupMemberDecorate", + "opcode" : 75, + "operands" : [ + { "kind" : "IdRef", "name" : "'Decoration Group'" }, + { "kind" : "PairIdRefLiteralInteger", "quantifier" : "*", "name" : "'Targets'" } + ] + }, + { + "opname" : "OpVectorExtractDynamic", + "opcode" : 77, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" }, + { "kind" : "IdRef", "name" : "'Index'" } + ] + }, + { + "opname" : "OpVectorInsertDynamic", + "opcode" : 78, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" }, + { "kind" : "IdRef", "name" : "'Component'" }, + { "kind" : "IdRef", "name" : "'Index'" } + ] + }, + { + "opname" : "OpVectorShuffle", + "opcode" : 79, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector 1'" }, + { "kind" : "IdRef", "name" : "'Vector 2'" }, + { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Components'" } + ] + }, + { + "opname" : "OpCompositeConstruct", + "opcode" : 80, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } + ] + }, + { + "opname" : "OpCompositeExtract", + "opcode" : 81, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Composite'" }, + { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpCompositeInsert", + "opcode" : 82, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Object'" }, + { "kind" : "IdRef", "name" : "'Composite'" }, + { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpCopyObject", + "opcode" : 83, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpTranspose", + "opcode" : 84, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Matrix'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpSampledImage", + "opcode" : 86, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Sampler'" } + ] + }, + { + "opname" : "OpImageSampleImplicitLod", + "opcode" : 87, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleExplicitLod", + "opcode" : 88, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands" } + ] + }, + { + "opname" : "OpImageSampleDrefImplicitLod", + "opcode" : 89, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleDrefExplicitLod", + "opcode" : 90, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleProjImplicitLod", + "opcode" : 91, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleProjExplicitLod", + "opcode" : 92, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleProjDrefImplicitLod", + "opcode" : 93, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleProjDrefExplicitLod", + "opcode" : 94, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageFetch", + "opcode" : 95, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ] + }, + { + "opname" : "OpImageGather", + "opcode" : 96, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Component'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageDrefGather", + "opcode" : 97, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageRead", + "opcode" : 98, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ] + }, + { + "opname" : "OpImageWrite", + "opcode" : 99, + "operands" : [ + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Texel'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ] + }, + { + "opname" : "OpImage", + "opcode" : 100, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" } + ] + }, + { + "opname" : "OpImageQueryFormat", + "opcode" : 101, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpImageQueryOrder", + "opcode" : 102, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpImageQuerySizeLod", + "opcode" : 103, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Level of Detail'" } + ], + "capabilities" : [ "Kernel", "ImageQuery" ] + }, + { + "opname" : "OpImageQuerySize", + "opcode" : 104, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel", "ImageQuery" ] + }, + { + "opname" : "OpImageQueryLod", + "opcode" : 105, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" } + ], + "capabilities" : [ "ImageQuery" ] + }, + { + "opname" : "OpImageQueryLevels", + "opcode" : 106, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel", "ImageQuery" ] + }, + { + "opname" : "OpImageQuerySamples", + "opcode" : 107, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel", "ImageQuery" ] + }, + { + "opname" : "OpConvertFToU", + "opcode" : 109, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Float Value'" } + ] + }, + { + "opname" : "OpConvertFToS", + "opcode" : 110, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Float Value'" } + ] + }, + { + "opname" : "OpConvertSToF", + "opcode" : 111, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Signed Value'" } + ] + }, + { + "opname" : "OpConvertUToF", + "opcode" : 112, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Unsigned Value'" } + ] + }, + { + "opname" : "OpUConvert", + "opcode" : 113, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Unsigned Value'" } + ] + }, + { + "opname" : "OpSConvert", + "opcode" : 114, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Signed Value'" } + ] + }, + { + "opname" : "OpFConvert", + "opcode" : 115, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Float Value'" } + ] + }, + { + "opname" : "OpQuantizeToF16", + "opcode" : 116, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpConvertPtrToU", + "opcode" : 117, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpSatConvertSToU", + "opcode" : 118, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Signed Value'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpSatConvertUToS", + "opcode" : 119, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Unsigned Value'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpConvertUToPtr", + "opcode" : 120, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Integer Value'" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpPtrCastToGeneric", + "opcode" : 121, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGenericCastToPtr", + "opcode" : 122, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGenericCastToPtrExplicit", + "opcode" : 123, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "StorageClass", "name" : "'Storage'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpBitcast", + "opcode" : 124, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpSNegate", + "opcode" : 126, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpFNegate", + "opcode" : 127, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpIAdd", + "opcode" : 128, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFAdd", + "opcode" : 129, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpISub", + "opcode" : 130, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFSub", + "opcode" : 131, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpIMul", + "opcode" : 132, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFMul", + "opcode" : 133, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUDiv", + "opcode" : 134, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSDiv", + "opcode" : 135, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFDiv", + "opcode" : 136, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUMod", + "opcode" : 137, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSRem", + "opcode" : 138, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSMod", + "opcode" : 139, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFRem", + "opcode" : 140, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFMod", + "opcode" : 141, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpVectorTimesScalar", + "opcode" : 142, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" }, + { "kind" : "IdRef", "name" : "'Scalar'" } + ] + }, + { + "opname" : "OpMatrixTimesScalar", + "opcode" : 143, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Matrix'" }, + { "kind" : "IdRef", "name" : "'Scalar'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpVectorTimesMatrix", + "opcode" : 144, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" }, + { "kind" : "IdRef", "name" : "'Matrix'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpMatrixTimesVector", + "opcode" : 145, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Matrix'" }, + { "kind" : "IdRef", "name" : "'Vector'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpMatrixTimesMatrix", + "opcode" : 146, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'LeftMatrix'" }, + { "kind" : "IdRef", "name" : "'RightMatrix'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpOuterProduct", + "opcode" : 147, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector 1'" }, + { "kind" : "IdRef", "name" : "'Vector 2'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpDot", + "opcode" : 148, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector 1'" }, + { "kind" : "IdRef", "name" : "'Vector 2'" } + ] + }, + { + "opname" : "OpIAddCarry", + "opcode" : 149, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpISubBorrow", + "opcode" : 150, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUMulExtended", + "opcode" : 151, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSMulExtended", + "opcode" : 152, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpAny", + "opcode" : 154, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" } + ] + }, + { + "opname" : "OpAll", + "opcode" : 155, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" } + ] + }, + { + "opname" : "OpIsNan", + "opcode" : 156, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "OpIsInf", + "opcode" : 157, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "OpIsFinite", + "opcode" : 158, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpIsNormal", + "opcode" : 159, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpSignBitSet", + "opcode" : 160, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpLessOrGreater", + "opcode" : 161, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpOrdered", + "opcode" : 162, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpUnordered", + "opcode" : 163, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpLogicalEqual", + "opcode" : 164, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpLogicalNotEqual", + "opcode" : 165, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpLogicalOr", + "opcode" : 166, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpLogicalAnd", + "opcode" : 167, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpLogicalNot", + "opcode" : 168, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpSelect", + "opcode" : 169, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Condition'" }, + { "kind" : "IdRef", "name" : "'Object 1'" }, + { "kind" : "IdRef", "name" : "'Object 2'" } + ] + }, + { + "opname" : "OpIEqual", + "opcode" : 170, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpINotEqual", + "opcode" : 171, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUGreaterThan", + "opcode" : 172, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSGreaterThan", + "opcode" : 173, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUGreaterThanEqual", + "opcode" : 174, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSGreaterThanEqual", + "opcode" : 175, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpULessThan", + "opcode" : 176, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSLessThan", + "opcode" : 177, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpULessThanEqual", + "opcode" : 178, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSLessThanEqual", + "opcode" : 179, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdEqual", + "opcode" : 180, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordEqual", + "opcode" : 181, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdNotEqual", + "opcode" : 182, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordNotEqual", + "opcode" : 183, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdLessThan", + "opcode" : 184, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordLessThan", + "opcode" : 185, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdGreaterThan", + "opcode" : 186, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordGreaterThan", + "opcode" : 187, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdLessThanEqual", + "opcode" : 188, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordLessThanEqual", + "opcode" : 189, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdGreaterThanEqual", + "opcode" : 190, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordGreaterThanEqual", + "opcode" : 191, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpShiftRightLogical", + "opcode" : 194, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Shift'" } + ] + }, + { + "opname" : "OpShiftRightArithmetic", + "opcode" : 195, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Shift'" } + ] + }, + { + "opname" : "OpShiftLeftLogical", + "opcode" : 196, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Shift'" } + ] + }, + { + "opname" : "OpBitwiseOr", + "opcode" : 197, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpBitwiseXor", + "opcode" : 198, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpBitwiseAnd", + "opcode" : 199, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpNot", + "opcode" : 200, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpBitFieldInsert", + "opcode" : 201, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Insert'" }, + { "kind" : "IdRef", "name" : "'Offset'" }, + { "kind" : "IdRef", "name" : "'Count'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpBitFieldSExtract", + "opcode" : 202, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Offset'" }, + { "kind" : "IdRef", "name" : "'Count'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpBitFieldUExtract", + "opcode" : 203, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Offset'" }, + { "kind" : "IdRef", "name" : "'Count'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpBitReverse", + "opcode" : 204, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpBitCount", + "opcode" : 205, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" } + ] + }, + { + "opname" : "OpDPdx", + "opcode" : 207, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpDPdy", + "opcode" : 208, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpFwidth", + "opcode" : 209, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpDPdxFine", + "opcode" : 210, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpDPdyFine", + "opcode" : 211, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpFwidthFine", + "opcode" : 212, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpDPdxCoarse", + "opcode" : 213, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpDPdyCoarse", + "opcode" : 214, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpFwidthCoarse", + "opcode" : 215, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpEmitVertex", + "opcode" : 218, + "capabilities" : [ "Geometry" ] + }, + { + "opname" : "OpEndPrimitive", + "opcode" : 219, + "capabilities" : [ "Geometry" ] + }, + { + "opname" : "OpEmitStreamVertex", + "opcode" : 220, + "operands" : [ + { "kind" : "IdRef", "name" : "'Stream'" } + ], + "capabilities" : [ "GeometryStreams" ] + }, + { + "opname" : "OpEndStreamPrimitive", + "opcode" : 221, + "operands" : [ + { "kind" : "IdRef", "name" : "'Stream'" } + ], + "capabilities" : [ "GeometryStreams" ] + }, + { + "opname" : "OpControlBarrier", + "opcode" : 224, + "operands" : [ + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdScope", "name" : "'Memory'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpMemoryBarrier", + "opcode" : 225, + "operands" : [ + { "kind" : "IdScope", "name" : "'Memory'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpAtomicLoad", + "opcode" : 227, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpAtomicStore", + "opcode" : 228, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicExchange", + "opcode" : 229, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicCompareExchange", + "opcode" : 230, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, + { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Comparator'" } + ] + }, + { + "opname" : "OpAtomicCompareExchangeWeak", + "opcode" : 231, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, + { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Comparator'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpAtomicIIncrement", + "opcode" : 232, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpAtomicIDecrement", + "opcode" : 233, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpAtomicIAdd", + "opcode" : 234, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicISub", + "opcode" : 235, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicSMin", + "opcode" : 236, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicUMin", + "opcode" : 237, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicSMax", + "opcode" : 238, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicUMax", + "opcode" : 239, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicAnd", + "opcode" : 240, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicOr", + "opcode" : 241, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicXor", + "opcode" : 242, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpPhi", + "opcode" : 245, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "PairIdRefIdRef", "quantifier" : "*", "name" : "'Variable, Parent, ...'" } + ] + }, + { + "opname" : "OpLoopMerge", + "opcode" : 246, + "operands" : [ + { "kind" : "IdRef", "name" : "'Merge Block'" }, + { "kind" : "IdRef", "name" : "'Continue Target'" }, + { "kind" : "LoopControl" } + ] + }, + { + "opname" : "OpSelectionMerge", + "opcode" : 247, + "operands" : [ + { "kind" : "IdRef", "name" : "'Merge Block'" }, + { "kind" : "SelectionControl" } + ] + }, + { + "opname" : "OpLabel", + "opcode" : 248, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpBranch", + "opcode" : 249, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target Label'" } + ] + }, + { + "opname" : "OpBranchConditional", + "opcode" : 250, + "operands" : [ + { "kind" : "IdRef", "name" : "'Condition'" }, + { "kind" : "IdRef", "name" : "'True Label'" }, + { "kind" : "IdRef", "name" : "'False Label'" }, + { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Branch weights'" } + ] + }, + { + "opname" : "OpSwitch", + "opcode" : 251, + "operands" : [ + { "kind" : "IdRef", "name" : "'Selector'" }, + { "kind" : "IdRef", "name" : "'Default'" }, + { "kind" : "PairLiteralIntegerIdRef", "quantifier" : "*", "name" : "'Target'" } + ] + }, + { + "opname" : "OpKill", + "opcode" : 252, + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpReturn", + "opcode" : 253 + }, + { + "opname" : "OpReturnValue", + "opcode" : 254, + "operands" : [ + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpUnreachable", + "opcode" : 255 + }, + { + "opname" : "OpLifetimeStart", + "opcode" : 256, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "LiteralInteger", "name" : "'Size'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpLifetimeStop", + "opcode" : 257, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "LiteralInteger", "name" : "'Size'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGroupAsyncCopy", + "opcode" : 259, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Destination'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "IdRef", "name" : "'Num Elements'" }, + { "kind" : "IdRef", "name" : "'Stride'" }, + { "kind" : "IdRef", "name" : "'Event'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGroupWaitEvents", + "opcode" : 260, + "operands" : [ + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Num Events'" }, + { "kind" : "IdRef", "name" : "'Events List'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGroupAll", + "opcode" : 261, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupAny", + "opcode" : 262, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupBroadcast", + "opcode" : 263, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'LocalId'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupIAdd", + "opcode" : 264, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFAdd", + "opcode" : 265, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFMin", + "opcode" : 266, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupUMin", + "opcode" : 267, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupSMin", + "opcode" : 268, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFMax", + "opcode" : 269, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupUMax", + "opcode" : 270, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupSMax", + "opcode" : 271, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpReadPipe", + "opcode" : 274, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpWritePipe", + "opcode" : 275, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpReservedReadPipe", + "opcode" : 276, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Index'" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpReservedWritePipe", + "opcode" : 277, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Index'" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpReserveReadPipePackets", + "opcode" : 278, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Num Packets'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpReserveWritePipePackets", + "opcode" : 279, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Num Packets'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpCommitReadPipe", + "opcode" : 280, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpCommitWritePipe", + "opcode" : 281, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpIsValidReserveId", + "opcode" : 282, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGetNumPipePackets", + "opcode" : 283, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGetMaxPipePackets", + "opcode" : 284, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGroupReserveReadPipePackets", + "opcode" : 285, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Num Packets'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGroupReserveWritePipePackets", + "opcode" : 286, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Num Packets'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGroupCommitReadPipe", + "opcode" : 287, + "operands" : [ + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGroupCommitWritePipe", + "opcode" : 288, + "operands" : [ + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpEnqueueMarker", + "opcode" : 291, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Queue'" }, + { "kind" : "IdRef", "name" : "'Num Events'" }, + { "kind" : "IdRef", "name" : "'Wait Events'" }, + { "kind" : "IdRef", "name" : "'Ret Event'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpEnqueueKernel", + "opcode" : 292, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Queue'" }, + { "kind" : "IdRef", "name" : "'Flags'" }, + { "kind" : "IdRef", "name" : "'ND Range'" }, + { "kind" : "IdRef", "name" : "'Num Events'" }, + { "kind" : "IdRef", "name" : "'Wait Events'" }, + { "kind" : "IdRef", "name" : "'Ret Event'" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Local Size'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetKernelNDrangeSubGroupCount", + "opcode" : 293, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'ND Range'" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetKernelNDrangeMaxSubGroupSize", + "opcode" : 294, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'ND Range'" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetKernelWorkGroupSize", + "opcode" : 295, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetKernelPreferredWorkGroupSizeMultiple", + "opcode" : 296, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpRetainEvent", + "opcode" : 297, + "operands" : [ + { "kind" : "IdRef", "name" : "'Event'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpReleaseEvent", + "opcode" : 298, + "operands" : [ + { "kind" : "IdRef", "name" : "'Event'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpCreateUserEvent", + "opcode" : 299, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpIsValidEvent", + "opcode" : 300, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Event'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpSetUserEventStatus", + "opcode" : 301, + "operands" : [ + { "kind" : "IdRef", "name" : "'Event'" }, + { "kind" : "IdRef", "name" : "'Status'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpCaptureEventProfilingInfo", + "opcode" : 302, + "operands" : [ + { "kind" : "IdRef", "name" : "'Event'" }, + { "kind" : "IdRef", "name" : "'Profiling Info'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetDefaultQueue", + "opcode" : 303, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpBuildNDRange", + "opcode" : 304, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'GlobalWorkSize'" }, + { "kind" : "IdRef", "name" : "'LocalWorkSize'" }, + { "kind" : "IdRef", "name" : "'GlobalWorkOffset'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpImageSparseSampleImplicitLod", + "opcode" : 305, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleExplicitLod", + "opcode" : 306, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleDrefImplicitLod", + "opcode" : 307, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleDrefExplicitLod", + "opcode" : 308, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleProjImplicitLod", + "opcode" : 309, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleProjExplicitLod", + "opcode" : 310, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleProjDrefImplicitLod", + "opcode" : 311, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleProjDrefExplicitLod", + "opcode" : 312, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseFetch", + "opcode" : 313, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseGather", + "opcode" : 314, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Component'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseDrefGather", + "opcode" : 315, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseTexelsResident", + "opcode" : 316, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Resident Code'" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpNoLine", + "opcode" : 317 + }, + { + "opname" : "OpAtomicFlagTestAndSet", + "opcode" : 318, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpAtomicFlagClear", + "opcode" : 319, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpImageSparseRead", + "opcode" : 320, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpSizeOf", + "opcode" : 321, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpTypePipeStorage", + "opcode" : 322, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "PipeStorage" ] + }, + { + "opname" : "OpConstantPipeStorage", + "opcode" : 323, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "LiteralInteger", "name" : "'Packet Size'" }, + { "kind" : "LiteralInteger", "name" : "'Packet Alignment'" }, + { "kind" : "LiteralInteger", "name" : "'Capacity'" } + ], + "capabilities" : [ "PipeStorage" ] + }, + { + "opname" : "OpCreatePipeFromPipeStorage", + "opcode" : 324, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe Storage'" } + ], + "capabilities" : [ "PipeStorage" ] + }, + { + "opname" : "OpGetKernelLocalSizeForSubgroupCount", + "opcode" : 325, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Subgroup Count'" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "SubgroupDispatch" ] + }, + { + "opname" : "OpGetKernelMaxNumSubgroups", + "opcode" : 326, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "SubgroupDispatch" ] + }, + { + "opname" : "OpTypeNamedBarrier", + "opcode" : 327, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "NamedBarrier" ] + }, + { + "opname" : "OpNamedBarrierInitialize", + "opcode" : 328, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Subgroup Count'" } + ], + "capabilities" : [ "NamedBarrier" ] + }, + { + "opname" : "OpMemoryNamedBarrier", + "opcode" : 329, + "operands" : [ + { "kind" : "IdRef", "name" : "'Named Barrier'" }, + { "kind" : "IdScope", "name" : "'Memory'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ], + "capabilities" : [ "NamedBarrier" ] + }, + { + "opname" : "OpModuleProcessed", + "opcode" : 330, + "operands" : [ + { "kind" : "LiteralString", "name" : "'Process'" } + ] + }, + { + "opname" : "OpDecorateId", + "opcode" : 332, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "Decoration" } + ], + "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ] + }, + { + "opname" : "OpSubgroupBallotKHR", + "opcode" : 4421, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "opname" : "OpSubgroupFirstInvocationKHR", + "opcode" : 4422, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "opname" : "OpSubgroupAllKHR", + "opcode" : 4428, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "SubgroupVoteKHR" ] + }, + { + "opname" : "OpSubgroupAnyKHR", + "opcode" : 4429, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "SubgroupVoteKHR" ] + }, + { + "opname" : "OpSubgroupAllEqualKHR", + "opcode" : 4430, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "SubgroupVoteKHR" ] + }, + { + "opname" : "OpSubgroupReadInvocationKHR", + "opcode" : 4432, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Index'" } + ], + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "opname" : "OpGroupIAddNonUniformAMD", + "opcode" : 5000, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFAddNonUniformAMD", + "opcode" : 5001, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFMinNonUniformAMD", + "opcode" : 5002, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupUMinNonUniformAMD", + "opcode" : 5003, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupSMinNonUniformAMD", + "opcode" : 5004, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFMaxNonUniformAMD", + "opcode" : 5005, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupUMaxNonUniformAMD", + "opcode" : 5006, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupSMaxNonUniformAMD", + "opcode" : 5007, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpFragmentMaskFetchAMD", + "opcode" : 5011, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" } + ], + "capabilities" : [ "FragmentMaskAMD" ] + }, + { + "opname" : "OpFragmentFetchAMD", + "opcode" : 5012, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Fragment Index'" } + ], + "capabilities" : [ "FragmentMaskAMD" ] + }, + { + "opname" : "OpSubgroupShuffleINTEL", + "opcode" : 5571, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Data'" }, + { "kind" : "IdRef", "name" : "'InvocationId'" } + ], + "capabilities" : [ "SubgroupShuffleINTEL" ] + }, + { + "opname" : "OpSubgroupShuffleDownINTEL", + "opcode" : 5572, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Current'" }, + { "kind" : "IdRef", "name" : "'Next'" }, + { "kind" : "IdRef", "name" : "'Delta'" } + ], + "capabilities" : [ "SubgroupShuffleINTEL" ] + }, + { + "opname" : "OpSubgroupShuffleUpINTEL", + "opcode" : 5573, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Previous'" }, + { "kind" : "IdRef", "name" : "'Current'" }, + { "kind" : "IdRef", "name" : "'Delta'" } + ], + "capabilities" : [ "SubgroupShuffleINTEL" ] + }, + { + "opname" : "OpSubgroupShuffleXorINTEL", + "opcode" : 5574, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Data'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "SubgroupShuffleINTEL" ] + }, + { + "opname" : "OpSubgroupBlockReadINTEL", + "opcode" : 5575, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Ptr'" } + ], + "capabilities" : [ "SubgroupBufferBlockIOINTEL" ] + }, + { + "opname" : "OpSubgroupBlockWriteINTEL", + "opcode" : 5576, + "operands" : [ + { "kind" : "IdRef", "name" : "'Ptr'" }, + { "kind" : "IdRef", "name" : "'Data'" } + ], + "capabilities" : [ "SubgroupBufferBlockIOINTEL" ] + }, + { + "opname" : "OpSubgroupImageBlockReadINTEL", + "opcode" : 5577, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" } + ], + "capabilities" : [ "SubgroupImageBlockIOINTEL" ] + }, + { + "opname" : "OpSubgroupImageBlockWriteINTEL", + "opcode" : 5578, + "operands" : [ + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Data'" } + ], + "capabilities" : [ "SubgroupImageBlockIOINTEL" ] + }, + { + "opname" : "OpDecorateStringGOOGLE", + "opcode" : 5632, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "Decoration" } + ], + "extensions" : [ "SPV_GOOGLE_decorate_string" ] + }, + { + "opname" : "OpMemberDecorateStringGOOGLE", + "opcode" : 5633, + "operands" : [ + { "kind" : "IdRef", "name" : "'Struct Type'" }, + { "kind" : "LiteralInteger", "name" : "'Member'" }, + { "kind" : "Decoration" } + ], + "extensions" : [ "SPV_GOOGLE_decorate_string" ] + } + ], + "operand_kinds" : [ + { + "category" : "BitEnum", + "kind" : "ImageOperands", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Bias", + "value" : "0x0001", + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "Lod", + "value" : "0x0002", + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "Grad", + "value" : "0x0004", + "parameters" : [ + { "kind" : "IdRef" }, + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "ConstOffset", + "value" : "0x0008", + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "Offset", + "value" : "0x0010", + "capabilities" : [ "ImageGatherExtended" ], + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "ConstOffsets", + "value" : "0x0020", + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "Sample", + "value" : "0x0040", + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "MinLod", + "value" : "0x0080", + "capabilities" : [ "MinLod" ], + "parameters" : [ + { "kind" : "IdRef" } + ] + } + ] + }, + { + "category" : "BitEnum", + "kind" : "FPFastMathMode", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "NotNaN", + "value" : "0x0001", + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NotInf", + "value" : "0x0002", + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NSZ", + "value" : "0x0004", + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "AllowRecip", + "value" : "0x0008", + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Fast", + "value" : "0x0010", + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "BitEnum", + "kind" : "SelectionControl", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Flatten", + "value" : "0x0001" + }, + { + "enumerant" : "DontFlatten", + "value" : "0x0002" + } + ] + }, + { + "category" : "BitEnum", + "kind" : "LoopControl", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Unroll", + "value" : "0x0001" + }, + { + "enumerant" : "DontUnroll", + "value" : "0x0002" + }, + { + "enumerant" : "DependencyInfinite", + "value" : "0x0004" + }, + { + "enumerant" : "DependencyLength", + "value" : "0x0008", + "parameters" : [ + { "kind" : "LiteralInteger" } + ] + + } + ] + }, + { + "category" : "BitEnum", + "kind" : "FunctionControl", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Inline", + "value" : "0x0001" + }, + { + "enumerant" : "DontInline", + "value" : "0x0002" + }, + { + "enumerant" : "Pure", + "value" : "0x0004" + }, + { + "enumerant" : "Const", + "value" : "0x0008" + } + ] + }, + { + "category" : "BitEnum", + "kind" : "MemorySemantics", + "enumerants" : [ + { + "enumerant" : "Relaxed", + "value" : "0x0000" + }, + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Acquire", + "value" : "0x0002" + }, + { + "enumerant" : "Release", + "value" : "0x0004" + }, + { + "enumerant" : "AcquireRelease", + "value" : "0x0008" + }, + { + "enumerant" : "SequentiallyConsistent", + "value" : "0x0010" + }, + { + "enumerant" : "UniformMemory", + "value" : "0x0040", + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SubgroupMemory", + "value" : "0x0080" + }, + { + "enumerant" : "WorkgroupMemory", + "value" : "0x0100" + }, + { + "enumerant" : "CrossWorkgroupMemory", + "value" : "0x0200" + }, + { + "enumerant" : "AtomicCounterMemory", + "value" : "0x0400", + "capabilities" : [ "AtomicStorage" ] + }, + { + "enumerant" : "ImageMemory", + "value" : "0x0800" + } + ] + }, + { + "category" : "BitEnum", + "kind" : "MemoryAccess", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Volatile", + "value" : "0x0001" + }, + { + "enumerant" : "Aligned", + "value" : "0x0002", + "parameters" : [ + { "kind" : "LiteralInteger" } + ] + }, + { + "enumerant" : "Nontemporal", + "value" : "0x0004" + } + ] + }, + { + "category" : "BitEnum", + "kind" : "KernelProfilingInfo", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "CmdExecTime", + "value" : "0x0001", + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "SourceLanguage", + "enumerants" : [ + { + "enumerant" : "Unknown", + "value" : 0 + }, + { + "enumerant" : "ESSL", + "value" : 1 + }, + { + "enumerant" : "GLSL", + "value" : 2 + }, + { + "enumerant" : "OpenCL_C", + "value" : 3 + }, + { + "enumerant" : "OpenCL_CPP", + "value" : 4 + }, + { + "enumerant" : "HLSL", + "value" : 5 + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ExecutionModel", + "enumerants" : [ + { + "enumerant" : "Vertex", + "value" : 0, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "TessellationControl", + "value" : 1, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "TessellationEvaluation", + "value" : 2, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "Geometry", + "value" : 3, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "Fragment", + "value" : 4, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GLCompute", + "value" : 5, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Kernel", + "value" : 6, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "AddressingModel", + "enumerants" : [ + { + "enumerant" : "Logical", + "value" : 0 + }, + { + "enumerant" : "Physical32", + "value" : 1, + "capabilities" : [ "Addresses" ] + }, + { + "enumerant" : "Physical64", + "value" : 2, + "capabilities" : [ "Addresses" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "MemoryModel", + "enumerants" : [ + { + "enumerant" : "Simple", + "value" : 0, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GLSL450", + "value" : 1, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "OpenCL", + "value" : 2, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ExecutionMode", + "enumerants" : [ + { + "enumerant" : "Invocations", + "value" : 0, + "capabilities" : [ "Geometry" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Number of <>'" } + ] + }, + { + "enumerant" : "SpacingEqual", + "value" : 1, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "SpacingFractionalEven", + "value" : 2, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "SpacingFractionalOdd", + "value" : 3, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "VertexOrderCw", + "value" : 4, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "VertexOrderCcw", + "value" : 5, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "PixelCenterInteger", + "value" : 6, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "OriginUpperLeft", + "value" : 7, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "OriginLowerLeft", + "value" : 8, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "EarlyFragmentTests", + "value" : 9, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "PointMode", + "value" : 10, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "Xfb", + "value" : 11, + "capabilities" : [ "TransformFeedback" ] + }, + { + "enumerant" : "DepthReplacing", + "value" : 12, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "DepthGreater", + "value" : 14, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "DepthLess", + "value" : 15, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "DepthUnchanged", + "value" : 16, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "LocalSize", + "value" : 17, + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'x size'" }, + { "kind" : "LiteralInteger", "name" : "'y size'" }, + { "kind" : "LiteralInteger", "name" : "'z size'" } + ] + }, + { + "enumerant" : "LocalSizeHint", + "value" : 18, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'x size'" }, + { "kind" : "LiteralInteger", "name" : "'y size'" }, + { "kind" : "LiteralInteger", "name" : "'z size'" } + ] + }, + { + "enumerant" : "InputPoints", + "value" : 19, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "InputLines", + "value" : 20, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "InputLinesAdjacency", + "value" : 21, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "Triangles", + "value" : 22, + "capabilities" : [ "Geometry", "Tessellation" ] + }, + { + "enumerant" : "InputTrianglesAdjacency", + "value" : 23, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "Quads", + "value" : 24, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "Isolines", + "value" : 25, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "OutputVertices", + "value" : 26, + "capabilities" : [ "Geometry", "Tessellation" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Vertex count'" } + ] + }, + { + "enumerant" : "OutputPoints", + "value" : 27, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "OutputLineStrip", + "value" : 28, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "OutputTriangleStrip", + "value" : 29, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "VecTypeHint", + "value" : 30, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Vector type'" } + ] + }, + { + "enumerant" : "ContractionOff", + "value" : 31, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Initializer", + "value" : 33, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Finalizer", + "value" : 34, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SubgroupSize", + "value" : 35, + "capabilities" : [ "SubgroupDispatch" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Subgroup Size'" } + ] + }, + { + "enumerant" : "SubgroupsPerWorkgroup", + "value" : 36, + "capabilities" : [ "SubgroupDispatch" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Subgroups Per Workgroup'" } + ] + }, + { + "enumerant" : "PostDepthCoverage", + "value" : 4446, + "capabilities" : [ "SampleMaskPostDepthCoverage" ] + }, + { + "enumerant" : "StencilRefReplacingEXT", + "value" : 5027, + "capabilities" : [ "StencilExportEXT" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "StorageClass", + "enumerants" : [ + { + "enumerant" : "UniformConstant", + "value" : 0 + }, + { + "enumerant" : "Input", + "value" : 1 + }, + { + "enumerant" : "Uniform", + "value" : 2, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Output", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Workgroup", + "value" : 4 + }, + { + "enumerant" : "CrossWorkgroup", + "value" : 5 + }, + { + "enumerant" : "Private", + "value" : 6, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Function", + "value" : 7 + }, + { + "enumerant" : "Generic", + "value" : 8, + "capabilities" : [ "GenericPointer" ] + }, + { + "enumerant" : "PushConstant", + "value" : 9, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "AtomicCounter", + "value" : 10, + "capabilities" : [ "AtomicStorage" ] + }, + { + "enumerant" : "Image", + "value" : 11 + }, + { + "enumerant" : "StorageBuffer", + "value" : 12, + "extensions" : [ + "SPV_KHR_storage_buffer_storage_class", + "SPV_KHR_variable_pointers" + ], + "capabilities" : [ "Shader" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "Dim", + "enumerants" : [ + { + "enumerant" : "1D", + "value" : 0, + "capabilities" : [ "Sampled1D" ] + }, + { + "enumerant" : "2D", + "value" : 1 + }, + { + "enumerant" : "3D", + "value" : 2 + }, + { + "enumerant" : "Cube", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rect", + "value" : 4, + "capabilities" : [ "SampledRect" ] + }, + { + "enumerant" : "Buffer", + "value" : 5, + "capabilities" : [ "SampledBuffer" ] + }, + { + "enumerant" : "SubpassData", + "value" : 6, + "capabilities" : [ "InputAttachment" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "SamplerAddressingMode", + "enumerants" : [ + { + "enumerant" : "None", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ClampToEdge", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Clamp", + "value" : 2, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Repeat", + "value" : 3, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RepeatMirrored", + "value" : 4, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "SamplerFilterMode", + "enumerants" : [ + { + "enumerant" : "Nearest", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Linear", + "value" : 1, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ImageFormat", + "enumerants" : [ + { + "enumerant" : "Unknown", + "value" : 0 + }, + { + "enumerant" : "Rgba32f", + "value" : 1, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba16f", + "value" : 2, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "R32f", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba8", + "value" : 4, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba8Snorm", + "value" : 5, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rg32f", + "value" : 6, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16f", + "value" : 7, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R11fG11fB10f", + "value" : 8, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16f", + "value" : 9, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgba16", + "value" : 10, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgb10A2", + "value" : 11, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16", + "value" : 12, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg8", + "value" : 13, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16", + "value" : 14, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R8", + "value" : 15, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgba16Snorm", + "value" : 16, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16Snorm", + "value" : 17, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg8Snorm", + "value" : 18, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16Snorm", + "value" : 19, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R8Snorm", + "value" : 20, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgba32i", + "value" : 21, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba16i", + "value" : 22, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba8i", + "value" : 23, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "R32i", + "value" : 24, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rg32i", + "value" : 25, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16i", + "value" : 26, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg8i", + "value" : 27, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16i", + "value" : 28, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R8i", + "value" : 29, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgba32ui", + "value" : 30, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba16ui", + "value" : 31, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba8ui", + "value" : 32, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "R32ui", + "value" : 33, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgb10a2ui", + "value" : 34, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg32ui", + "value" : 35, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16ui", + "value" : 36, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg8ui", + "value" : 37, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16ui", + "value" : 38, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R8ui", + "value" : 39, + "capabilities" : [ "StorageImageExtendedFormats" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ImageChannelOrder", + "enumerants" : [ + { + "enumerant" : "R", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "A", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RG", + "value" : 2, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RA", + "value" : 3, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RGB", + "value" : 4, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RGBA", + "value" : 5, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "BGRA", + "value" : 6, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ARGB", + "value" : 7, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Intensity", + "value" : 8, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Luminance", + "value" : 9, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Rx", + "value" : 10, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RGx", + "value" : 11, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RGBx", + "value" : 12, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Depth", + "value" : 13, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "DepthStencil", + "value" : 14, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "sRGB", + "value" : 15, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "sRGBx", + "value" : 16, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "sRGBA", + "value" : 17, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "sBGRA", + "value" : 18, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ABGR", + "value" : 19, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ImageChannelDataType", + "enumerants" : [ + { + "enumerant" : "SnormInt8", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SnormInt16", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt8", + "value" : 2, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt16", + "value" : 3, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormShort565", + "value" : 4, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormShort555", + "value" : 5, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt101010", + "value" : 6, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SignedInt8", + "value" : 7, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SignedInt16", + "value" : 8, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SignedInt32", + "value" : 9, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnsignedInt8", + "value" : 10, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnsignedInt16", + "value" : 11, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnsignedInt32", + "value" : 12, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "HalfFloat", + "value" : 13, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Float", + "value" : 14, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt24", + "value" : 15, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt101010_2", + "value" : 16, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "FPRoundingMode", + "enumerants" : [ + { + "enumerant" : "RTE", + "value" : 0, + "capabilities" : [ + "Kernel", + "StorageUniformBufferBlock16", + "StorageUniform16", + "StoragePushConstant16", + "StorageInputOutput16" + ] + }, + { + "enumerant" : "RTZ", + "value" : 1, + "capabilities" : [ + "Kernel", + "StorageUniformBufferBlock16", + "StorageUniform16", + "StoragePushConstant16", + "StorageInputOutput16" + ] + }, + { + "enumerant" : "RTP", + "value" : 2, + "capabilities" : [ + "Kernel", + "StorageUniformBufferBlock16", + "StorageUniform16", + "StoragePushConstant16", + "StorageInputOutput16" + ] + }, + { + "enumerant" : "RTN", + "value" : 3, + "capabilities" : [ + "Kernel", + "StorageUniformBufferBlock16", + "StorageUniform16", + "StoragePushConstant16", + "StorageInputOutput16" + ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "LinkageType", + "enumerants" : [ + { + "enumerant" : "Export", + "value" : 0, + "capabilities" : [ "Linkage" ] + }, + { + "enumerant" : "Import", + "value" : 1, + "capabilities" : [ "Linkage" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "AccessQualifier", + "enumerants" : [ + { + "enumerant" : "ReadOnly", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "WriteOnly", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ReadWrite", + "value" : 2, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "FunctionParameterAttribute", + "enumerants" : [ + { + "enumerant" : "Zext", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Sext", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ByVal", + "value" : 2, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Sret", + "value" : 3, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NoAlias", + "value" : 4, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NoCapture", + "value" : 5, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NoWrite", + "value" : 6, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NoReadWrite", + "value" : 7, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "Decoration", + "enumerants" : [ + { + "enumerant" : "RelaxedPrecision", + "value" : 0, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SpecId", + "value" : 1, + "capabilities" : [ "Shader", "Kernel" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Specialization Constant ID'" } + ] + }, + { + "enumerant" : "Block", + "value" : 2, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "BufferBlock", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "RowMajor", + "value" : 4, + "capabilities" : [ "Matrix" ] + }, + { + "enumerant" : "ColMajor", + "value" : 5, + "capabilities" : [ "Matrix" ] + }, + { + "enumerant" : "ArrayStride", + "value" : 6, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Array Stride'" } + ] + }, + { + "enumerant" : "MatrixStride", + "value" : 7, + "capabilities" : [ "Matrix" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Matrix Stride'" } + ] + }, + { + "enumerant" : "GLSLShared", + "value" : 8, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GLSLPacked", + "value" : 9, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "CPacked", + "value" : 10, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "BuiltIn", + "value" : 11, + "parameters" : [ + { "kind" : "BuiltIn" } + ] + }, + { + "enumerant" : "NoPerspective", + "value" : 13, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Flat", + "value" : 14, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Patch", + "value" : 15, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "Centroid", + "value" : 16, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Sample", + "value" : 17, + "capabilities" : [ "SampleRateShading" ] + }, + { + "enumerant" : "Invariant", + "value" : 18, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Restrict", + "value" : 19 + }, + { + "enumerant" : "Aliased", + "value" : 20 + }, + { + "enumerant" : "Volatile", + "value" : 21 + }, + { + "enumerant" : "Constant", + "value" : 22, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Coherent", + "value" : 23 + }, + { + "enumerant" : "NonWritable", + "value" : 24 + }, + { + "enumerant" : "NonReadable", + "value" : 25 + }, + { + "enumerant" : "Uniform", + "value" : 26, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SaturatedConversion", + "value" : 28, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Stream", + "value" : 29, + "capabilities" : [ "GeometryStreams" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Stream Number'" } + ] + }, + { + "enumerant" : "Location", + "value" : 30, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Location'" } + ] + }, + { + "enumerant" : "Component", + "value" : 31, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Component'" } + ] + }, + { + "enumerant" : "Index", + "value" : 32, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Index'" } + ] + }, + { + "enumerant" : "Binding", + "value" : 33, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Binding Point'" } + ] + }, + { + "enumerant" : "DescriptorSet", + "value" : 34, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Descriptor Set'" } + ] + }, + { + "enumerant" : "Offset", + "value" : 35, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Byte Offset'" } + ] + }, + { + "enumerant" : "XfbBuffer", + "value" : 36, + "capabilities" : [ "TransformFeedback" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'XFB Buffer Number'" } + ] + }, + { + "enumerant" : "XfbStride", + "value" : 37, + "capabilities" : [ "TransformFeedback" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'XFB Stride'" } + ] + }, + { + "enumerant" : "FuncParamAttr", + "value" : 38, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "FunctionParameterAttribute", "name" : "'Function Parameter Attribute'" } + ] + }, + { + "enumerant" : "FPRoundingMode", + "value" : 39, + "capabilities" : [ + "Kernel", + "StorageUniformBufferBlock16", + "StorageUniform16", + "StoragePushConstant16", + "StorageInputOutput16" + ], + "parameters" : [ + { "kind" : "FPRoundingMode", "name" : "'Floating-Point Rounding Mode'" } + ] + }, + { + "enumerant" : "FPFastMathMode", + "value" : 40, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "FPFastMathMode", "name" : "'Fast-Math Mode'" } + ] + }, + { + "enumerant" : "LinkageAttributes", + "value" : 41, + "capabilities" : [ "Linkage" ], + "parameters" : [ + { "kind" : "LiteralString", "name" : "'Name'" }, + { "kind" : "LinkageType", "name" : "'Linkage Type'" } + ] + }, + { + "enumerant" : "NoContraction", + "value" : 42, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "InputAttachmentIndex", + "value" : 43, + "capabilities" : [ "InputAttachment" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Attachment Index'" } + ] + }, + { + "enumerant" : "Alignment", + "value" : 44, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Alignment'" } + ] + }, + { + "enumerant" : "MaxByteOffset", + "value" : 45, + "capabilities" : [ "Addresses" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Max Byte Offset'" } + ] + }, + { + "enumerant" : "ExplicitInterpAMD", + "value" : 4999 + }, + { + "enumerant" : "OverrideCoverageNV", + "value" : 5248, + "capabilities" : [ "SampleMaskOverrideCoverageNV" ] + }, + { + "enumerant" : "PassthroughNV", + "value" : 5250, + "capabilities" : [ "GeometryShaderPassthroughNV" ] + }, + { + "enumerant" : "ViewportRelativeNV", + "value" : 5252, + "capabilities" : [ "ShaderViewportMaskNV" ] + }, + { + "enumerant" : "SecondaryViewportRelativeNV", + "value" : 5256, + "capabilities" : [ "ShaderStereoViewNV" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Offset'" } + ] + }, + { + "enumerant" : "HlslCounterBufferGOOGLE", + "value" : 5634, + "parameters" : [ + { "kind" : "IdRef", "name" : "'Counter Buffer'" } + ], + "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ] + }, + { + "enumerant" : "HlslSemanticGOOGLE", + "value" : 5635, + "parameters" : [ + { "kind" : "LiteralString", "name" : "'Semantic'" } + ], + "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "BuiltIn", + "enumerants" : [ + { + "enumerant" : "Position", + "value" : 0, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "PointSize", + "value" : 1, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ClipDistance", + "value" : 3, + "capabilities" : [ "ClipDistance" ] + }, + { + "enumerant" : "CullDistance", + "value" : 4, + "capabilities" : [ "CullDistance" ] + }, + { + "enumerant" : "VertexId", + "value" : 5, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "InstanceId", + "value" : 6, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "PrimitiveId", + "value" : 7, + "capabilities" : [ "Geometry", "Tessellation" ] + }, + { + "enumerant" : "InvocationId", + "value" : 8, + "capabilities" : [ "Geometry", "Tessellation" ] + }, + { + "enumerant" : "Layer", + "value" : 9, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "ViewportIndex", + "value" : 10, + "capabilities" : [ "MultiViewport" ] + }, + { + "enumerant" : "TessLevelOuter", + "value" : 11, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "TessLevelInner", + "value" : 12, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "TessCoord", + "value" : 13, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "PatchVertices", + "value" : 14, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "FragCoord", + "value" : 15, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "PointCoord", + "value" : 16, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "FrontFacing", + "value" : 17, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SampleId", + "value" : 18, + "capabilities" : [ "SampleRateShading" ] + }, + { + "enumerant" : "SamplePosition", + "value" : 19, + "capabilities" : [ "SampleRateShading" ] + }, + { + "enumerant" : "SampleMask", + "value" : 20, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "FragDepth", + "value" : 22, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "HelperInvocation", + "value" : 23, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "NumWorkgroups", + "value" : 24 + }, + { + "enumerant" : "WorkgroupSize", + "value" : 25 + }, + { + "enumerant" : "WorkgroupId", + "value" : 26 + }, + { + "enumerant" : "LocalInvocationId", + "value" : 27 + }, + { + "enumerant" : "GlobalInvocationId", + "value" : 28 + }, + { + "enumerant" : "LocalInvocationIndex", + "value" : 29 + }, + { + "enumerant" : "WorkDim", + "value" : 30, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "GlobalSize", + "value" : 31, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "EnqueuedWorkgroupSize", + "value" : 32, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "GlobalOffset", + "value" : 33, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "GlobalLinearId", + "value" : 34, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SubgroupSize", + "value" : 36, + "capabilities" : [ "Kernel", "SubgroupBallotKHR" ] + }, + { + "enumerant" : "SubgroupMaxSize", + "value" : 37, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NumSubgroups", + "value" : 38, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NumEnqueuedSubgroups", + "value" : 39, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SubgroupId", + "value" : 40, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SubgroupLocalInvocationId", + "value" : 41, + "capabilities" : [ "Kernel", "SubgroupBallotKHR" ] + }, + { + "enumerant" : "VertexIndex", + "value" : 42, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "InstanceIndex", + "value" : 43, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SubgroupEqMaskKHR", + "value" : 4416, + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "enumerant" : "SubgroupGeMaskKHR", + "value" : 4417, + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "enumerant" : "SubgroupGtMaskKHR", + "value" : 4418, + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "enumerant" : "SubgroupLeMaskKHR", + "value" : 4419, + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "enumerant" : "SubgroupLtMaskKHR", + "value" : 4420, + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "enumerant" : "BaseVertex", + "value" : 4424, + "capabilities" : [ "DrawParameters" ] + }, + { + "enumerant" : "BaseInstance", + "value" : 4425, + "capabilities" : [ "DrawParameters" ] + }, + { + "enumerant" : "DrawIndex", + "value" : 4426, + "capabilities" : [ "DrawParameters" ] + }, + { + "enumerant" : "DeviceIndex", + "value" : 4438, + "capabilities" : [ "DeviceGroup" ] + }, + { + "enumerant" : "ViewIndex", + "value" : 4440, + "capabilities" : [ "MultiView" ] + }, + { + "enumerant" : "BaryCoordNoPerspAMD", + "value" : 4992 + }, + { + "enumerant" : "BaryCoordNoPerspCentroidAMD", + "value" : 4993 + }, + { + "enumerant" : "BaryCoordNoPerspSampleAMD", + "value" : 4994 + }, + { + "enumerant" : "BaryCoordSmoothAMD", + "value" : 4995 + }, + { + "enumerant" : "BaryCoordSmoothCentroidAMD", + "value" : 4996 + }, + { + "enumerant" : "BaryCoordSmoothSampleAMD", + "value" : 4997 + }, + { + "enumerant" : "BaryCoordPullModelAMD", + "value" : 4998 + }, + { + "enumerant" : "FragStencilRefEXT", + "value" : 5014, + "capabilities" : [ "StencilExportEXT" ] + }, + { + "enumerant" : "ViewportMaskNV", + "value" : 5253, + "capabilities" : [ "ShaderViewportMaskNV" ] + }, + { + "enumerant" : "SecondaryPositionNV", + "value" : 5257, + "capabilities" : [ "ShaderStereoViewNV" ] + }, + { + "enumerant" : "SecondaryViewportMaskNV", + "value" : 5258, + "capabilities" : [ "ShaderStereoViewNV" ] + }, + { + "enumerant" : "PositionPerViewNV", + "value" : 5261, + "capabilities" : [ "PerViewAttributesNV" ] + }, + { + "enumerant" : "ViewportMaskPerViewNV", + "value" : 5262, + "capabilities" : [ "PerViewAttributesNV" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "Scope", + "enumerants" : [ + { + "enumerant" : "CrossDevice", + "value" : 0 + }, + { + "enumerant" : "Device", + "value" : 1 + }, + { + "enumerant" : "Workgroup", + "value" : 2 + }, + { + "enumerant" : "Subgroup", + "value" : 3 + }, + { + "enumerant" : "Invocation", + "value" : 4 + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "GroupOperation", + "enumerants" : [ + { + "enumerant" : "Reduce", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "InclusiveScan", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ExclusiveScan", + "value" : 2, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "KernelEnqueueFlags", + "enumerants" : [ + { + "enumerant" : "NoWait", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "WaitKernel", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "WaitWorkGroup", + "value" : 2, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "Capability", + "enumerants" : [ + { + "enumerant" : "Matrix", + "value" : 0 + }, + { + "enumerant" : "Shader", + "value" : 1, + "capabilities" : [ "Matrix" ] + }, + { + "enumerant" : "Geometry", + "value" : 2, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Tessellation", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Addresses", + "value" : 4 + }, + { + "enumerant" : "Linkage", + "value" : 5 + }, + { + "enumerant" : "Kernel", + "value" : 6 + }, + { + "enumerant" : "Vector16", + "value" : 7, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Float16Buffer", + "value" : 8, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Float16", + "value" : 9 + }, + { + "enumerant" : "Float64", + "value" : 10 + }, + { + "enumerant" : "Int64", + "value" : 11 + }, + { + "enumerant" : "Int64Atomics", + "value" : 12, + "capabilities" : [ "Int64" ] + }, + { + "enumerant" : "ImageBasic", + "value" : 13, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ImageReadWrite", + "value" : 14, + "capabilities" : [ "ImageBasic" ] + }, + { + "enumerant" : "ImageMipmap", + "value" : 15, + "capabilities" : [ "ImageBasic" ] + }, + { + "enumerant" : "Pipes", + "value" : 17, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Groups", + "value" : 18 + }, + { + "enumerant" : "DeviceEnqueue", + "value" : 19, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "LiteralSampler", + "value" : 20, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "AtomicStorage", + "value" : 21, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Int16", + "value" : 22 + }, + { + "enumerant" : "TessellationPointSize", + "value" : 23, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "GeometryPointSize", + "value" : 24, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "ImageGatherExtended", + "value" : 25, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageImageMultisample", + "value" : 27, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "UniformBufferArrayDynamicIndexing", + "value" : 28, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SampledImageArrayDynamicIndexing", + "value" : 29, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageBufferArrayDynamicIndexing", + "value" : 30, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageImageArrayDynamicIndexing", + "value" : 31, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ClipDistance", + "value" : 32, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "CullDistance", + "value" : 33, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ImageCubeArray", + "value" : 34, + "capabilities" : [ "SampledCubeArray" ] + }, + { + "enumerant" : "SampleRateShading", + "value" : 35, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ImageRect", + "value" : 36, + "capabilities" : [ "SampledRect" ] + }, + { + "enumerant" : "SampledRect", + "value" : 37, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GenericPointer", + "value" : 38, + "capabilities" : [ "Addresses" ] + }, + { + "enumerant" : "Int8", + "value" : 39, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "InputAttachment", + "value" : 40, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SparseResidency", + "value" : 41, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "MinLod", + "value" : 42, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Sampled1D", + "value" : 43 + }, + { + "enumerant" : "Image1D", + "value" : 44, + "capabilities" : [ "Sampled1D" ] + }, + { + "enumerant" : "SampledCubeArray", + "value" : 45, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SampledBuffer", + "value" : 46 + }, + { + "enumerant" : "ImageBuffer", + "value" : 47, + "capabilities" : [ "SampledBuffer" ] + }, + { + "enumerant" : "ImageMSArray", + "value" : 48, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageImageExtendedFormats", + "value" : 49, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ImageQuery", + "value" : 50, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "DerivativeControl", + "value" : 51, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "InterpolationFunction", + "value" : 52, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "TransformFeedback", + "value" : 53, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GeometryStreams", + "value" : 54, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "StorageImageReadWithoutFormat", + "value" : 55, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageImageWriteWithoutFormat", + "value" : 56, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "MultiViewport", + "value" : 57, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "SubgroupDispatch", + "value" : 58, + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "enumerant" : "NamedBarrier", + "value" : 59, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "PipeStorage", + "value" : 60, + "capabilities" : [ "Pipes" ] + }, + { + "enumerant" : "SubgroupBallotKHR", + "value" : 4423, + "extensions" : [ "SPV_KHR_shader_ballot" ] + }, + { + "enumerant" : "DrawParameters", + "value" : 4427, + "extensions" : [ "SPV_KHR_shader_draw_parameters" ] + }, + { + "enumerant" : "SubgroupVoteKHR", + "value" : 4431, + "extensions" : [ "SPV_KHR_subgroup_vote" ] + }, + { + "enumerant" : "StorageBuffer16BitAccess", + "value" : 4433, + "extensions" : [ "SPV_KHR_16bit_storage" ] + }, + { + "enumerant" : "StorageUniformBufferBlock16", + "value" : 4433, + "extensions" : [ "SPV_KHR_16bit_storage" ] + }, + { + "enumerant" : "UniformAndStorageBuffer16BitAccess", + "value" : 4434, + "capabilities" : [ + "StorageBuffer16BitAccess", + "StorageUniformBufferBlock16" + ], + "extensions" : [ "SPV_KHR_16bit_storage" ] + }, + { + "enumerant" : "StorageUniform16", + "value" : 4434, + "capabilities" : [ + "StorageBuffer16BitAccess", + "StorageUniformBufferBlock16" + ], + "extensions" : [ "SPV_KHR_16bit_storage" ] + }, + { + "enumerant" : "StoragePushConstant16", + "value" : 4435, + "extensions" : [ "SPV_KHR_16bit_storage" ] + }, + { + "enumerant" : "StorageInputOutput16", + "value" : 4436, + "extensions" : [ "SPV_KHR_16bit_storage" ] + }, + { + "enumerant" : "DeviceGroup", + "value" : 4437, + "extensions" : [ "SPV_KHR_device_group" ] + }, + { + "enumerant" : "MultiView", + "value" : 4439, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_KHR_multiview" ] + }, + { + "enumerant" : "VariablePointersStorageBuffer", + "value" : 4441, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_KHR_variable_pointers" ] + }, + { + "enumerant" : "VariablePointers", + "value" : 4442, + "capabilities" : [ "VariablePointersStorageBuffer" ], + "extensions" : [ "SPV_KHR_variable_pointers" ] + }, + { + "enumerant": "AtomicStorageOps", + "value": 4445, + "extensions": [ "SPV_KHR_shader_atomic_counter_ops" ] + }, + { + "enumerant" : "SampleMaskPostDepthCoverage", + "value" : 4447, + "extensions" : [ "SPV_KHR_post_depth_coverage" ] + }, + { + "enumerant" : "ImageGatherBiasLodAMD", + "value" : 5009, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_AMD_texture_gather_bias_lod" ] + }, + { + "enumerant" : "FragmentMaskAMD", + "value" : 5010, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_AMD_shader_fragment_mask" ] + }, + { + "enumerant" : "StencilExportEXT", + "value" : 5013, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_EXT_shader_stencil_export" ] + }, + { + "enumerant" : "ImageReadWriteLodAMD", + "value" : 5015, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_AMD_shader_image_load_store_lod" ] + }, + { + "enumerant" : "SampleMaskOverrideCoverageNV", + "value" : 5249, + "capabilities" : [ "SampleRateShading" ], + "extensions" : [ "SPV_NV_sample_mask_override_coverage" ] + }, + { + "enumerant" : "GeometryShaderPassthroughNV", + "value" : 5251, + "capabilities" : [ "Geometry" ], + "extensions" : [ "SPV_NV_geometry_shader_passthrough" ] + }, + { + "enumerant" : "ShaderViewportIndexLayerEXT", + "value" : 5254, + "capabilities" : [ "MultiViewport" ], + "extensions" : [ "SPV_EXT_shader_viewport_index_layer" ] + }, + { + "enumerant" : "ShaderViewportIndexLayerNV", + "value" : 5254, + "capabilities" : [ "MultiViewport" ], + "extensions" : [ "SPV_NV_viewport_array2" ] + }, + { + "enumerant" : "ShaderViewportMaskNV", + "value" : 5255, + "capabilities" : [ "ShaderViewportIndexLayerNV" ], + "extensions" : [ "SPV_NV_viewport_array2" ] + }, + { + "enumerant" : "ShaderStereoViewNV", + "value" : 5259, + "capabilities" : [ "ShaderViewportMaskNV" ], + "extensions" : [ "SPV_NV_stereo_view_rendering" ] + }, + { + "enumerant" : "PerViewAttributesNV", + "value" : 5260, + "capabilities" : [ "MultiView" ], + "extensions" : [ "SPV_NVX_multiview_per_view_attributes" ] + }, + { + "enumerant" : "SubgroupShuffleINTEL", + "value" : 5568, + "extensions" : [ "SPV_INTEL_subgroups" ] + }, + { + "enumerant" : "SubgroupBufferBlockIOINTEL", + "value" : 5569, + "extensions" : [ "SPV_INTEL_subgroups" ] + }, + { + "enumerant" : "SubgroupImageBlockIOINTEL", + "value" : 5570, + "extensions" : [ "SPV_INTEL_subgroups" ] + } + ] + }, + { + "category" : "Id", + "kind" : "IdResultType", + "doc" : "Reference to an representing the result's type of the enclosing instruction" + }, + { + "category" : "Id", + "kind" : "IdResult", + "doc" : "Definition of an representing the result of the enclosing instruction" + }, + { + "category" : "Id", + "kind" : "IdMemorySemantics", + "doc" : "Reference to an representing a 32-bit integer that is a mask from the MemorySemantics operand kind" + }, + { + "category" : "Id", + "kind" : "IdScope", + "doc" : "Reference to an representing a 32-bit integer that is a mask from the Scope operand kind" + }, + { + "category" : "Id", + "kind" : "IdRef", + "doc" : "Reference to an " + }, + { + "category" : "Literal", + "kind" : "LiteralInteger", + "doc" : "An integer consuming one or more words" + }, + { + "category" : "Literal", + "kind" : "LiteralString", + "doc" : "A null-terminated stream of characters consuming an integral number of words" + }, + { + "category" : "Literal", + "kind" : "LiteralContextDependentNumber", + "doc" : "A literal number whose size and format are determined by a previous operand in the enclosing instruction" + }, + { + "category" : "Literal", + "kind" : "LiteralExtInstInteger", + "doc" : "A 32-bit unsigned integer indicating which instruction to use and determining the layout of following operands (for OpExtInst)" + }, + { + "category" : "Literal", + "kind" : "LiteralSpecConstantOpInteger", + "doc" : "An opcode indicating the operation to be performed and determining the layout of following operands (for OpSpecConstantOp)" + }, + { + "category" : "Composite", + "kind" : "PairLiteralIntegerIdRef", + "bases" : [ "LiteralInteger", "IdRef" ] + }, + { + "category" : "Composite", + "kind" : "PairIdRefLiteralInteger", + "bases" : [ "IdRef", "LiteralInteger" ] + }, + { + "category" : "Composite", + "kind" : "PairIdRefIdRef", + "bases" : [ "IdRef", "IdRef" ] + } + ] +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.h 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1015 @@ +/* +** Copyright (c) 2014-2018 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +/* +** This header is automatically generated by the same tool that creates +** the Binary Section of the SPIR-V specification. +*/ + +/* +** Enumeration tokens for SPIR-V, in various styles: +** C, C++, C++11, JSON, Lua, Python +** +** - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +** - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +** - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +** - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +** - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +** +** Some tokens act like mask values, which can be OR'd together, +** while others are mutually exclusive. The mask-like ones have +** "Mask" in their name, and a parallel enum that has the shift +** amount (1 << x) for each corresponding enumerant. +*/ + +#ifndef spirv_H +#define spirv_H + +typedef unsigned int SpvId; + +#define SPV_VERSION 0x10100 +#define SPV_REVISION 8 + +static const unsigned int SpvMagicNumber = 0x07230203; +static const unsigned int SpvVersion = 0x00010100; +static const unsigned int SpvRevision = 8; +static const unsigned int SpvOpCodeMask = 0xffff; +static const unsigned int SpvWordCountShift = 16; + +typedef enum SpvSourceLanguage_ { + SpvSourceLanguageUnknown = 0, + SpvSourceLanguageESSL = 1, + SpvSourceLanguageGLSL = 2, + SpvSourceLanguageOpenCL_C = 3, + SpvSourceLanguageOpenCL_CPP = 4, + SpvSourceLanguageHLSL = 5, + SpvSourceLanguageMax = 0x7fffffff, +} SpvSourceLanguage; + +typedef enum SpvExecutionModel_ { + SpvExecutionModelVertex = 0, + SpvExecutionModelTessellationControl = 1, + SpvExecutionModelTessellationEvaluation = 2, + SpvExecutionModelGeometry = 3, + SpvExecutionModelFragment = 4, + SpvExecutionModelGLCompute = 5, + SpvExecutionModelKernel = 6, + SpvExecutionModelMax = 0x7fffffff, +} SpvExecutionModel; + +typedef enum SpvAddressingModel_ { + SpvAddressingModelLogical = 0, + SpvAddressingModelPhysical32 = 1, + SpvAddressingModelPhysical64 = 2, + SpvAddressingModelMax = 0x7fffffff, +} SpvAddressingModel; + +typedef enum SpvMemoryModel_ { + SpvMemoryModelSimple = 0, + SpvMemoryModelGLSL450 = 1, + SpvMemoryModelOpenCL = 2, + SpvMemoryModelMax = 0x7fffffff, +} SpvMemoryModel; + +typedef enum SpvExecutionMode_ { + SpvExecutionModeInvocations = 0, + SpvExecutionModeSpacingEqual = 1, + SpvExecutionModeSpacingFractionalEven = 2, + SpvExecutionModeSpacingFractionalOdd = 3, + SpvExecutionModeVertexOrderCw = 4, + SpvExecutionModeVertexOrderCcw = 5, + SpvExecutionModePixelCenterInteger = 6, + SpvExecutionModeOriginUpperLeft = 7, + SpvExecutionModeOriginLowerLeft = 8, + SpvExecutionModeEarlyFragmentTests = 9, + SpvExecutionModePointMode = 10, + SpvExecutionModeXfb = 11, + SpvExecutionModeDepthReplacing = 12, + SpvExecutionModeDepthGreater = 14, + SpvExecutionModeDepthLess = 15, + SpvExecutionModeDepthUnchanged = 16, + SpvExecutionModeLocalSize = 17, + SpvExecutionModeLocalSizeHint = 18, + SpvExecutionModeInputPoints = 19, + SpvExecutionModeInputLines = 20, + SpvExecutionModeInputLinesAdjacency = 21, + SpvExecutionModeTriangles = 22, + SpvExecutionModeInputTrianglesAdjacency = 23, + SpvExecutionModeQuads = 24, + SpvExecutionModeIsolines = 25, + SpvExecutionModeOutputVertices = 26, + SpvExecutionModeOutputPoints = 27, + SpvExecutionModeOutputLineStrip = 28, + SpvExecutionModeOutputTriangleStrip = 29, + SpvExecutionModeVecTypeHint = 30, + SpvExecutionModeContractionOff = 31, + SpvExecutionModeInitializer = 33, + SpvExecutionModeFinalizer = 34, + SpvExecutionModeSubgroupSize = 35, + SpvExecutionModeSubgroupsPerWorkgroup = 36, + SpvExecutionModePostDepthCoverage = 4446, + SpvExecutionModeStencilRefReplacingEXT = 5027, + SpvExecutionModeMax = 0x7fffffff, +} SpvExecutionMode; + +typedef enum SpvStorageClass_ { + SpvStorageClassUniformConstant = 0, + SpvStorageClassInput = 1, + SpvStorageClassUniform = 2, + SpvStorageClassOutput = 3, + SpvStorageClassWorkgroup = 4, + SpvStorageClassCrossWorkgroup = 5, + SpvStorageClassPrivate = 6, + SpvStorageClassFunction = 7, + SpvStorageClassGeneric = 8, + SpvStorageClassPushConstant = 9, + SpvStorageClassAtomicCounter = 10, + SpvStorageClassImage = 11, + SpvStorageClassStorageBuffer = 12, + SpvStorageClassMax = 0x7fffffff, +} SpvStorageClass; + +typedef enum SpvDim_ { + SpvDim1D = 0, + SpvDim2D = 1, + SpvDim3D = 2, + SpvDimCube = 3, + SpvDimRect = 4, + SpvDimBuffer = 5, + SpvDimSubpassData = 6, + SpvDimMax = 0x7fffffff, +} SpvDim; + +typedef enum SpvSamplerAddressingMode_ { + SpvSamplerAddressingModeNone = 0, + SpvSamplerAddressingModeClampToEdge = 1, + SpvSamplerAddressingModeClamp = 2, + SpvSamplerAddressingModeRepeat = 3, + SpvSamplerAddressingModeRepeatMirrored = 4, + SpvSamplerAddressingModeMax = 0x7fffffff, +} SpvSamplerAddressingMode; + +typedef enum SpvSamplerFilterMode_ { + SpvSamplerFilterModeNearest = 0, + SpvSamplerFilterModeLinear = 1, + SpvSamplerFilterModeMax = 0x7fffffff, +} SpvSamplerFilterMode; + +typedef enum SpvImageFormat_ { + SpvImageFormatUnknown = 0, + SpvImageFormatRgba32f = 1, + SpvImageFormatRgba16f = 2, + SpvImageFormatR32f = 3, + SpvImageFormatRgba8 = 4, + SpvImageFormatRgba8Snorm = 5, + SpvImageFormatRg32f = 6, + SpvImageFormatRg16f = 7, + SpvImageFormatR11fG11fB10f = 8, + SpvImageFormatR16f = 9, + SpvImageFormatRgba16 = 10, + SpvImageFormatRgb10A2 = 11, + SpvImageFormatRg16 = 12, + SpvImageFormatRg8 = 13, + SpvImageFormatR16 = 14, + SpvImageFormatR8 = 15, + SpvImageFormatRgba16Snorm = 16, + SpvImageFormatRg16Snorm = 17, + SpvImageFormatRg8Snorm = 18, + SpvImageFormatR16Snorm = 19, + SpvImageFormatR8Snorm = 20, + SpvImageFormatRgba32i = 21, + SpvImageFormatRgba16i = 22, + SpvImageFormatRgba8i = 23, + SpvImageFormatR32i = 24, + SpvImageFormatRg32i = 25, + SpvImageFormatRg16i = 26, + SpvImageFormatRg8i = 27, + SpvImageFormatR16i = 28, + SpvImageFormatR8i = 29, + SpvImageFormatRgba32ui = 30, + SpvImageFormatRgba16ui = 31, + SpvImageFormatRgba8ui = 32, + SpvImageFormatR32ui = 33, + SpvImageFormatRgb10a2ui = 34, + SpvImageFormatRg32ui = 35, + SpvImageFormatRg16ui = 36, + SpvImageFormatRg8ui = 37, + SpvImageFormatR16ui = 38, + SpvImageFormatR8ui = 39, + SpvImageFormatMax = 0x7fffffff, +} SpvImageFormat; + +typedef enum SpvImageChannelOrder_ { + SpvImageChannelOrderR = 0, + SpvImageChannelOrderA = 1, + SpvImageChannelOrderRG = 2, + SpvImageChannelOrderRA = 3, + SpvImageChannelOrderRGB = 4, + SpvImageChannelOrderRGBA = 5, + SpvImageChannelOrderBGRA = 6, + SpvImageChannelOrderARGB = 7, + SpvImageChannelOrderIntensity = 8, + SpvImageChannelOrderLuminance = 9, + SpvImageChannelOrderRx = 10, + SpvImageChannelOrderRGx = 11, + SpvImageChannelOrderRGBx = 12, + SpvImageChannelOrderDepth = 13, + SpvImageChannelOrderDepthStencil = 14, + SpvImageChannelOrdersRGB = 15, + SpvImageChannelOrdersRGBx = 16, + SpvImageChannelOrdersRGBA = 17, + SpvImageChannelOrdersBGRA = 18, + SpvImageChannelOrderABGR = 19, + SpvImageChannelOrderMax = 0x7fffffff, +} SpvImageChannelOrder; + +typedef enum SpvImageChannelDataType_ { + SpvImageChannelDataTypeSnormInt8 = 0, + SpvImageChannelDataTypeSnormInt16 = 1, + SpvImageChannelDataTypeUnormInt8 = 2, + SpvImageChannelDataTypeUnormInt16 = 3, + SpvImageChannelDataTypeUnormShort565 = 4, + SpvImageChannelDataTypeUnormShort555 = 5, + SpvImageChannelDataTypeUnormInt101010 = 6, + SpvImageChannelDataTypeSignedInt8 = 7, + SpvImageChannelDataTypeSignedInt16 = 8, + SpvImageChannelDataTypeSignedInt32 = 9, + SpvImageChannelDataTypeUnsignedInt8 = 10, + SpvImageChannelDataTypeUnsignedInt16 = 11, + SpvImageChannelDataTypeUnsignedInt32 = 12, + SpvImageChannelDataTypeHalfFloat = 13, + SpvImageChannelDataTypeFloat = 14, + SpvImageChannelDataTypeUnormInt24 = 15, + SpvImageChannelDataTypeUnormInt101010_2 = 16, + SpvImageChannelDataTypeMax = 0x7fffffff, +} SpvImageChannelDataType; + +typedef enum SpvImageOperandsShift_ { + SpvImageOperandsBiasShift = 0, + SpvImageOperandsLodShift = 1, + SpvImageOperandsGradShift = 2, + SpvImageOperandsConstOffsetShift = 3, + SpvImageOperandsOffsetShift = 4, + SpvImageOperandsConstOffsetsShift = 5, + SpvImageOperandsSampleShift = 6, + SpvImageOperandsMinLodShift = 7, + SpvImageOperandsMax = 0x7fffffff, +} SpvImageOperandsShift; + +typedef enum SpvImageOperandsMask_ { + SpvImageOperandsMaskNone = 0, + SpvImageOperandsBiasMask = 0x00000001, + SpvImageOperandsLodMask = 0x00000002, + SpvImageOperandsGradMask = 0x00000004, + SpvImageOperandsConstOffsetMask = 0x00000008, + SpvImageOperandsOffsetMask = 0x00000010, + SpvImageOperandsConstOffsetsMask = 0x00000020, + SpvImageOperandsSampleMask = 0x00000040, + SpvImageOperandsMinLodMask = 0x00000080, +} SpvImageOperandsMask; + +typedef enum SpvFPFastMathModeShift_ { + SpvFPFastMathModeNotNaNShift = 0, + SpvFPFastMathModeNotInfShift = 1, + SpvFPFastMathModeNSZShift = 2, + SpvFPFastMathModeAllowRecipShift = 3, + SpvFPFastMathModeFastShift = 4, + SpvFPFastMathModeMax = 0x7fffffff, +} SpvFPFastMathModeShift; + +typedef enum SpvFPFastMathModeMask_ { + SpvFPFastMathModeMaskNone = 0, + SpvFPFastMathModeNotNaNMask = 0x00000001, + SpvFPFastMathModeNotInfMask = 0x00000002, + SpvFPFastMathModeNSZMask = 0x00000004, + SpvFPFastMathModeAllowRecipMask = 0x00000008, + SpvFPFastMathModeFastMask = 0x00000010, +} SpvFPFastMathModeMask; + +typedef enum SpvFPRoundingMode_ { + SpvFPRoundingModeRTE = 0, + SpvFPRoundingModeRTZ = 1, + SpvFPRoundingModeRTP = 2, + SpvFPRoundingModeRTN = 3, + SpvFPRoundingModeMax = 0x7fffffff, +} SpvFPRoundingMode; + +typedef enum SpvLinkageType_ { + SpvLinkageTypeExport = 0, + SpvLinkageTypeImport = 1, + SpvLinkageTypeMax = 0x7fffffff, +} SpvLinkageType; + +typedef enum SpvAccessQualifier_ { + SpvAccessQualifierReadOnly = 0, + SpvAccessQualifierWriteOnly = 1, + SpvAccessQualifierReadWrite = 2, + SpvAccessQualifierMax = 0x7fffffff, +} SpvAccessQualifier; + +typedef enum SpvFunctionParameterAttribute_ { + SpvFunctionParameterAttributeZext = 0, + SpvFunctionParameterAttributeSext = 1, + SpvFunctionParameterAttributeByVal = 2, + SpvFunctionParameterAttributeSret = 3, + SpvFunctionParameterAttributeNoAlias = 4, + SpvFunctionParameterAttributeNoCapture = 5, + SpvFunctionParameterAttributeNoWrite = 6, + SpvFunctionParameterAttributeNoReadWrite = 7, + SpvFunctionParameterAttributeMax = 0x7fffffff, +} SpvFunctionParameterAttribute; + +typedef enum SpvDecoration_ { + SpvDecorationRelaxedPrecision = 0, + SpvDecorationSpecId = 1, + SpvDecorationBlock = 2, + SpvDecorationBufferBlock = 3, + SpvDecorationRowMajor = 4, + SpvDecorationColMajor = 5, + SpvDecorationArrayStride = 6, + SpvDecorationMatrixStride = 7, + SpvDecorationGLSLShared = 8, + SpvDecorationGLSLPacked = 9, + SpvDecorationCPacked = 10, + SpvDecorationBuiltIn = 11, + SpvDecorationNoPerspective = 13, + SpvDecorationFlat = 14, + SpvDecorationPatch = 15, + SpvDecorationCentroid = 16, + SpvDecorationSample = 17, + SpvDecorationInvariant = 18, + SpvDecorationRestrict = 19, + SpvDecorationAliased = 20, + SpvDecorationVolatile = 21, + SpvDecorationConstant = 22, + SpvDecorationCoherent = 23, + SpvDecorationNonWritable = 24, + SpvDecorationNonReadable = 25, + SpvDecorationUniform = 26, + SpvDecorationSaturatedConversion = 28, + SpvDecorationStream = 29, + SpvDecorationLocation = 30, + SpvDecorationComponent = 31, + SpvDecorationIndex = 32, + SpvDecorationBinding = 33, + SpvDecorationDescriptorSet = 34, + SpvDecorationOffset = 35, + SpvDecorationXfbBuffer = 36, + SpvDecorationXfbStride = 37, + SpvDecorationFuncParamAttr = 38, + SpvDecorationFPRoundingMode = 39, + SpvDecorationFPFastMathMode = 40, + SpvDecorationLinkageAttributes = 41, + SpvDecorationNoContraction = 42, + SpvDecorationInputAttachmentIndex = 43, + SpvDecorationAlignment = 44, + SpvDecorationMaxByteOffset = 45, + SpvDecorationExplicitInterpAMD = 4999, + SpvDecorationOverrideCoverageNV = 5248, + SpvDecorationPassthroughNV = 5250, + SpvDecorationViewportRelativeNV = 5252, + SpvDecorationSecondaryViewportRelativeNV = 5256, + SpvDecorationHlslCounterBufferGOOGLE = 5634, + SpvDecorationHlslSemanticGOOGLE = 5635, + SpvDecorationMax = 0x7fffffff, +} SpvDecoration; + +typedef enum SpvBuiltIn_ { + SpvBuiltInPosition = 0, + SpvBuiltInPointSize = 1, + SpvBuiltInClipDistance = 3, + SpvBuiltInCullDistance = 4, + SpvBuiltInVertexId = 5, + SpvBuiltInInstanceId = 6, + SpvBuiltInPrimitiveId = 7, + SpvBuiltInInvocationId = 8, + SpvBuiltInLayer = 9, + SpvBuiltInViewportIndex = 10, + SpvBuiltInTessLevelOuter = 11, + SpvBuiltInTessLevelInner = 12, + SpvBuiltInTessCoord = 13, + SpvBuiltInPatchVertices = 14, + SpvBuiltInFragCoord = 15, + SpvBuiltInPointCoord = 16, + SpvBuiltInFrontFacing = 17, + SpvBuiltInSampleId = 18, + SpvBuiltInSamplePosition = 19, + SpvBuiltInSampleMask = 20, + SpvBuiltInFragDepth = 22, + SpvBuiltInHelperInvocation = 23, + SpvBuiltInNumWorkgroups = 24, + SpvBuiltInWorkgroupSize = 25, + SpvBuiltInWorkgroupId = 26, + SpvBuiltInLocalInvocationId = 27, + SpvBuiltInGlobalInvocationId = 28, + SpvBuiltInLocalInvocationIndex = 29, + SpvBuiltInWorkDim = 30, + SpvBuiltInGlobalSize = 31, + SpvBuiltInEnqueuedWorkgroupSize = 32, + SpvBuiltInGlobalOffset = 33, + SpvBuiltInGlobalLinearId = 34, + SpvBuiltInSubgroupSize = 36, + SpvBuiltInSubgroupMaxSize = 37, + SpvBuiltInNumSubgroups = 38, + SpvBuiltInNumEnqueuedSubgroups = 39, + SpvBuiltInSubgroupId = 40, + SpvBuiltInSubgroupLocalInvocationId = 41, + SpvBuiltInVertexIndex = 42, + SpvBuiltInInstanceIndex = 43, + SpvBuiltInSubgroupEqMaskKHR = 4416, + SpvBuiltInSubgroupGeMaskKHR = 4417, + SpvBuiltInSubgroupGtMaskKHR = 4418, + SpvBuiltInSubgroupLeMaskKHR = 4419, + SpvBuiltInSubgroupLtMaskKHR = 4420, + SpvBuiltInBaseVertex = 4424, + SpvBuiltInBaseInstance = 4425, + SpvBuiltInDrawIndex = 4426, + SpvBuiltInDeviceIndex = 4438, + SpvBuiltInViewIndex = 4440, + SpvBuiltInBaryCoordNoPerspAMD = 4992, + SpvBuiltInBaryCoordNoPerspCentroidAMD = 4993, + SpvBuiltInBaryCoordNoPerspSampleAMD = 4994, + SpvBuiltInBaryCoordSmoothAMD = 4995, + SpvBuiltInBaryCoordSmoothCentroidAMD = 4996, + SpvBuiltInBaryCoordSmoothSampleAMD = 4997, + SpvBuiltInBaryCoordPullModelAMD = 4998, + SpvBuiltInFragStencilRefEXT = 5014, + SpvBuiltInViewportMaskNV = 5253, + SpvBuiltInSecondaryPositionNV = 5257, + SpvBuiltInSecondaryViewportMaskNV = 5258, + SpvBuiltInPositionPerViewNV = 5261, + SpvBuiltInViewportMaskPerViewNV = 5262, + SpvBuiltInMax = 0x7fffffff, +} SpvBuiltIn; + +typedef enum SpvSelectionControlShift_ { + SpvSelectionControlFlattenShift = 0, + SpvSelectionControlDontFlattenShift = 1, + SpvSelectionControlMax = 0x7fffffff, +} SpvSelectionControlShift; + +typedef enum SpvSelectionControlMask_ { + SpvSelectionControlMaskNone = 0, + SpvSelectionControlFlattenMask = 0x00000001, + SpvSelectionControlDontFlattenMask = 0x00000002, +} SpvSelectionControlMask; + +typedef enum SpvLoopControlShift_ { + SpvLoopControlUnrollShift = 0, + SpvLoopControlDontUnrollShift = 1, + SpvLoopControlDependencyInfiniteShift = 2, + SpvLoopControlDependencyLengthShift = 3, + SpvLoopControlMax = 0x7fffffff, +} SpvLoopControlShift; + +typedef enum SpvLoopControlMask_ { + SpvLoopControlMaskNone = 0, + SpvLoopControlUnrollMask = 0x00000001, + SpvLoopControlDontUnrollMask = 0x00000002, + SpvLoopControlDependencyInfiniteMask = 0x00000004, + SpvLoopControlDependencyLengthMask = 0x00000008, +} SpvLoopControlMask; + +typedef enum SpvFunctionControlShift_ { + SpvFunctionControlInlineShift = 0, + SpvFunctionControlDontInlineShift = 1, + SpvFunctionControlPureShift = 2, + SpvFunctionControlConstShift = 3, + SpvFunctionControlMax = 0x7fffffff, +} SpvFunctionControlShift; + +typedef enum SpvFunctionControlMask_ { + SpvFunctionControlMaskNone = 0, + SpvFunctionControlInlineMask = 0x00000001, + SpvFunctionControlDontInlineMask = 0x00000002, + SpvFunctionControlPureMask = 0x00000004, + SpvFunctionControlConstMask = 0x00000008, +} SpvFunctionControlMask; + +typedef enum SpvMemorySemanticsShift_ { + SpvMemorySemanticsAcquireShift = 1, + SpvMemorySemanticsReleaseShift = 2, + SpvMemorySemanticsAcquireReleaseShift = 3, + SpvMemorySemanticsSequentiallyConsistentShift = 4, + SpvMemorySemanticsUniformMemoryShift = 6, + SpvMemorySemanticsSubgroupMemoryShift = 7, + SpvMemorySemanticsWorkgroupMemoryShift = 8, + SpvMemorySemanticsCrossWorkgroupMemoryShift = 9, + SpvMemorySemanticsAtomicCounterMemoryShift = 10, + SpvMemorySemanticsImageMemoryShift = 11, + SpvMemorySemanticsMax = 0x7fffffff, +} SpvMemorySemanticsShift; + +typedef enum SpvMemorySemanticsMask_ { + SpvMemorySemanticsMaskNone = 0, + SpvMemorySemanticsAcquireMask = 0x00000002, + SpvMemorySemanticsReleaseMask = 0x00000004, + SpvMemorySemanticsAcquireReleaseMask = 0x00000008, + SpvMemorySemanticsSequentiallyConsistentMask = 0x00000010, + SpvMemorySemanticsUniformMemoryMask = 0x00000040, + SpvMemorySemanticsSubgroupMemoryMask = 0x00000080, + SpvMemorySemanticsWorkgroupMemoryMask = 0x00000100, + SpvMemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, + SpvMemorySemanticsAtomicCounterMemoryMask = 0x00000400, + SpvMemorySemanticsImageMemoryMask = 0x00000800, +} SpvMemorySemanticsMask; + +typedef enum SpvMemoryAccessShift_ { + SpvMemoryAccessVolatileShift = 0, + SpvMemoryAccessAlignedShift = 1, + SpvMemoryAccessNontemporalShift = 2, + SpvMemoryAccessMax = 0x7fffffff, +} SpvMemoryAccessShift; + +typedef enum SpvMemoryAccessMask_ { + SpvMemoryAccessMaskNone = 0, + SpvMemoryAccessVolatileMask = 0x00000001, + SpvMemoryAccessAlignedMask = 0x00000002, + SpvMemoryAccessNontemporalMask = 0x00000004, +} SpvMemoryAccessMask; + +typedef enum SpvScope_ { + SpvScopeCrossDevice = 0, + SpvScopeDevice = 1, + SpvScopeWorkgroup = 2, + SpvScopeSubgroup = 3, + SpvScopeInvocation = 4, + SpvScopeMax = 0x7fffffff, +} SpvScope; + +typedef enum SpvGroupOperation_ { + SpvGroupOperationReduce = 0, + SpvGroupOperationInclusiveScan = 1, + SpvGroupOperationExclusiveScan = 2, + SpvGroupOperationMax = 0x7fffffff, +} SpvGroupOperation; + +typedef enum SpvKernelEnqueueFlags_ { + SpvKernelEnqueueFlagsNoWait = 0, + SpvKernelEnqueueFlagsWaitKernel = 1, + SpvKernelEnqueueFlagsWaitWorkGroup = 2, + SpvKernelEnqueueFlagsMax = 0x7fffffff, +} SpvKernelEnqueueFlags; + +typedef enum SpvKernelProfilingInfoShift_ { + SpvKernelProfilingInfoCmdExecTimeShift = 0, + SpvKernelProfilingInfoMax = 0x7fffffff, +} SpvKernelProfilingInfoShift; + +typedef enum SpvKernelProfilingInfoMask_ { + SpvKernelProfilingInfoMaskNone = 0, + SpvKernelProfilingInfoCmdExecTimeMask = 0x00000001, +} SpvKernelProfilingInfoMask; + +typedef enum SpvCapability_ { + SpvCapabilityMatrix = 0, + SpvCapabilityShader = 1, + SpvCapabilityGeometry = 2, + SpvCapabilityTessellation = 3, + SpvCapabilityAddresses = 4, + SpvCapabilityLinkage = 5, + SpvCapabilityKernel = 6, + SpvCapabilityVector16 = 7, + SpvCapabilityFloat16Buffer = 8, + SpvCapabilityFloat16 = 9, + SpvCapabilityFloat64 = 10, + SpvCapabilityInt64 = 11, + SpvCapabilityInt64Atomics = 12, + SpvCapabilityImageBasic = 13, + SpvCapabilityImageReadWrite = 14, + SpvCapabilityImageMipmap = 15, + SpvCapabilityPipes = 17, + SpvCapabilityGroups = 18, + SpvCapabilityDeviceEnqueue = 19, + SpvCapabilityLiteralSampler = 20, + SpvCapabilityAtomicStorage = 21, + SpvCapabilityInt16 = 22, + SpvCapabilityTessellationPointSize = 23, + SpvCapabilityGeometryPointSize = 24, + SpvCapabilityImageGatherExtended = 25, + SpvCapabilityStorageImageMultisample = 27, + SpvCapabilityUniformBufferArrayDynamicIndexing = 28, + SpvCapabilitySampledImageArrayDynamicIndexing = 29, + SpvCapabilityStorageBufferArrayDynamicIndexing = 30, + SpvCapabilityStorageImageArrayDynamicIndexing = 31, + SpvCapabilityClipDistance = 32, + SpvCapabilityCullDistance = 33, + SpvCapabilityImageCubeArray = 34, + SpvCapabilitySampleRateShading = 35, + SpvCapabilityImageRect = 36, + SpvCapabilitySampledRect = 37, + SpvCapabilityGenericPointer = 38, + SpvCapabilityInt8 = 39, + SpvCapabilityInputAttachment = 40, + SpvCapabilitySparseResidency = 41, + SpvCapabilityMinLod = 42, + SpvCapabilitySampled1D = 43, + SpvCapabilityImage1D = 44, + SpvCapabilitySampledCubeArray = 45, + SpvCapabilitySampledBuffer = 46, + SpvCapabilityImageBuffer = 47, + SpvCapabilityImageMSArray = 48, + SpvCapabilityStorageImageExtendedFormats = 49, + SpvCapabilityImageQuery = 50, + SpvCapabilityDerivativeControl = 51, + SpvCapabilityInterpolationFunction = 52, + SpvCapabilityTransformFeedback = 53, + SpvCapabilityGeometryStreams = 54, + SpvCapabilityStorageImageReadWithoutFormat = 55, + SpvCapabilityStorageImageWriteWithoutFormat = 56, + SpvCapabilityMultiViewport = 57, + SpvCapabilitySubgroupDispatch = 58, + SpvCapabilityNamedBarrier = 59, + SpvCapabilityPipeStorage = 60, + SpvCapabilitySubgroupBallotKHR = 4423, + SpvCapabilityDrawParameters = 4427, + SpvCapabilitySubgroupVoteKHR = 4431, + SpvCapabilityStorageBuffer16BitAccess = 4433, + SpvCapabilityStorageUniformBufferBlock16 = 4433, + SpvCapabilityStorageUniform16 = 4434, + SpvCapabilityUniformAndStorageBuffer16BitAccess = 4434, + SpvCapabilityStoragePushConstant16 = 4435, + SpvCapabilityStorageInputOutput16 = 4436, + SpvCapabilityDeviceGroup = 4437, + SpvCapabilityMultiView = 4439, + SpvCapabilityVariablePointersStorageBuffer = 4441, + SpvCapabilityVariablePointers = 4442, + SpvCapabilityAtomicStorageOps = 4445, + SpvCapabilitySampleMaskPostDepthCoverage = 4447, + SpvCapabilityImageGatherBiasLodAMD = 5009, + SpvCapabilityFragmentMaskAMD = 5010, + SpvCapabilityStencilExportEXT = 5013, + SpvCapabilityImageReadWriteLodAMD = 5015, + SpvCapabilitySampleMaskOverrideCoverageNV = 5249, + SpvCapabilityGeometryShaderPassthroughNV = 5251, + SpvCapabilityShaderViewportIndexLayerEXT = 5254, + SpvCapabilityShaderViewportIndexLayerNV = 5254, + SpvCapabilityShaderViewportMaskNV = 5255, + SpvCapabilityShaderStereoViewNV = 5259, + SpvCapabilityPerViewAttributesNV = 5260, + SpvCapabilitySubgroupShuffleINTEL = 5568, + SpvCapabilitySubgroupBufferBlockIOINTEL = 5569, + SpvCapabilitySubgroupImageBlockIOINTEL = 5570, + SpvCapabilityMax = 0x7fffffff, +} SpvCapability; + +typedef enum SpvOp_ { + SpvOpNop = 0, + SpvOpUndef = 1, + SpvOpSourceContinued = 2, + SpvOpSource = 3, + SpvOpSourceExtension = 4, + SpvOpName = 5, + SpvOpMemberName = 6, + SpvOpString = 7, + SpvOpLine = 8, + SpvOpExtension = 10, + SpvOpExtInstImport = 11, + SpvOpExtInst = 12, + SpvOpMemoryModel = 14, + SpvOpEntryPoint = 15, + SpvOpExecutionMode = 16, + SpvOpCapability = 17, + SpvOpTypeVoid = 19, + SpvOpTypeBool = 20, + SpvOpTypeInt = 21, + SpvOpTypeFloat = 22, + SpvOpTypeVector = 23, + SpvOpTypeMatrix = 24, + SpvOpTypeImage = 25, + SpvOpTypeSampler = 26, + SpvOpTypeSampledImage = 27, + SpvOpTypeArray = 28, + SpvOpTypeRuntimeArray = 29, + SpvOpTypeStruct = 30, + SpvOpTypeOpaque = 31, + SpvOpTypePointer = 32, + SpvOpTypeFunction = 33, + SpvOpTypeEvent = 34, + SpvOpTypeDeviceEvent = 35, + SpvOpTypeReserveId = 36, + SpvOpTypeQueue = 37, + SpvOpTypePipe = 38, + SpvOpTypeForwardPointer = 39, + SpvOpConstantTrue = 41, + SpvOpConstantFalse = 42, + SpvOpConstant = 43, + SpvOpConstantComposite = 44, + SpvOpConstantSampler = 45, + SpvOpConstantNull = 46, + SpvOpSpecConstantTrue = 48, + SpvOpSpecConstantFalse = 49, + SpvOpSpecConstant = 50, + SpvOpSpecConstantComposite = 51, + SpvOpSpecConstantOp = 52, + SpvOpFunction = 54, + SpvOpFunctionParameter = 55, + SpvOpFunctionEnd = 56, + SpvOpFunctionCall = 57, + SpvOpVariable = 59, + SpvOpImageTexelPointer = 60, + SpvOpLoad = 61, + SpvOpStore = 62, + SpvOpCopyMemory = 63, + SpvOpCopyMemorySized = 64, + SpvOpAccessChain = 65, + SpvOpInBoundsAccessChain = 66, + SpvOpPtrAccessChain = 67, + SpvOpArrayLength = 68, + SpvOpGenericPtrMemSemantics = 69, + SpvOpInBoundsPtrAccessChain = 70, + SpvOpDecorate = 71, + SpvOpMemberDecorate = 72, + SpvOpDecorationGroup = 73, + SpvOpGroupDecorate = 74, + SpvOpGroupMemberDecorate = 75, + SpvOpVectorExtractDynamic = 77, + SpvOpVectorInsertDynamic = 78, + SpvOpVectorShuffle = 79, + SpvOpCompositeConstruct = 80, + SpvOpCompositeExtract = 81, + SpvOpCompositeInsert = 82, + SpvOpCopyObject = 83, + SpvOpTranspose = 84, + SpvOpSampledImage = 86, + SpvOpImageSampleImplicitLod = 87, + SpvOpImageSampleExplicitLod = 88, + SpvOpImageSampleDrefImplicitLod = 89, + SpvOpImageSampleDrefExplicitLod = 90, + SpvOpImageSampleProjImplicitLod = 91, + SpvOpImageSampleProjExplicitLod = 92, + SpvOpImageSampleProjDrefImplicitLod = 93, + SpvOpImageSampleProjDrefExplicitLod = 94, + SpvOpImageFetch = 95, + SpvOpImageGather = 96, + SpvOpImageDrefGather = 97, + SpvOpImageRead = 98, + SpvOpImageWrite = 99, + SpvOpImage = 100, + SpvOpImageQueryFormat = 101, + SpvOpImageQueryOrder = 102, + SpvOpImageQuerySizeLod = 103, + SpvOpImageQuerySize = 104, + SpvOpImageQueryLod = 105, + SpvOpImageQueryLevels = 106, + SpvOpImageQuerySamples = 107, + SpvOpConvertFToU = 109, + SpvOpConvertFToS = 110, + SpvOpConvertSToF = 111, + SpvOpConvertUToF = 112, + SpvOpUConvert = 113, + SpvOpSConvert = 114, + SpvOpFConvert = 115, + SpvOpQuantizeToF16 = 116, + SpvOpConvertPtrToU = 117, + SpvOpSatConvertSToU = 118, + SpvOpSatConvertUToS = 119, + SpvOpConvertUToPtr = 120, + SpvOpPtrCastToGeneric = 121, + SpvOpGenericCastToPtr = 122, + SpvOpGenericCastToPtrExplicit = 123, + SpvOpBitcast = 124, + SpvOpSNegate = 126, + SpvOpFNegate = 127, + SpvOpIAdd = 128, + SpvOpFAdd = 129, + SpvOpISub = 130, + SpvOpFSub = 131, + SpvOpIMul = 132, + SpvOpFMul = 133, + SpvOpUDiv = 134, + SpvOpSDiv = 135, + SpvOpFDiv = 136, + SpvOpUMod = 137, + SpvOpSRem = 138, + SpvOpSMod = 139, + SpvOpFRem = 140, + SpvOpFMod = 141, + SpvOpVectorTimesScalar = 142, + SpvOpMatrixTimesScalar = 143, + SpvOpVectorTimesMatrix = 144, + SpvOpMatrixTimesVector = 145, + SpvOpMatrixTimesMatrix = 146, + SpvOpOuterProduct = 147, + SpvOpDot = 148, + SpvOpIAddCarry = 149, + SpvOpISubBorrow = 150, + SpvOpUMulExtended = 151, + SpvOpSMulExtended = 152, + SpvOpAny = 154, + SpvOpAll = 155, + SpvOpIsNan = 156, + SpvOpIsInf = 157, + SpvOpIsFinite = 158, + SpvOpIsNormal = 159, + SpvOpSignBitSet = 160, + SpvOpLessOrGreater = 161, + SpvOpOrdered = 162, + SpvOpUnordered = 163, + SpvOpLogicalEqual = 164, + SpvOpLogicalNotEqual = 165, + SpvOpLogicalOr = 166, + SpvOpLogicalAnd = 167, + SpvOpLogicalNot = 168, + SpvOpSelect = 169, + SpvOpIEqual = 170, + SpvOpINotEqual = 171, + SpvOpUGreaterThan = 172, + SpvOpSGreaterThan = 173, + SpvOpUGreaterThanEqual = 174, + SpvOpSGreaterThanEqual = 175, + SpvOpULessThan = 176, + SpvOpSLessThan = 177, + SpvOpULessThanEqual = 178, + SpvOpSLessThanEqual = 179, + SpvOpFOrdEqual = 180, + SpvOpFUnordEqual = 181, + SpvOpFOrdNotEqual = 182, + SpvOpFUnordNotEqual = 183, + SpvOpFOrdLessThan = 184, + SpvOpFUnordLessThan = 185, + SpvOpFOrdGreaterThan = 186, + SpvOpFUnordGreaterThan = 187, + SpvOpFOrdLessThanEqual = 188, + SpvOpFUnordLessThanEqual = 189, + SpvOpFOrdGreaterThanEqual = 190, + SpvOpFUnordGreaterThanEqual = 191, + SpvOpShiftRightLogical = 194, + SpvOpShiftRightArithmetic = 195, + SpvOpShiftLeftLogical = 196, + SpvOpBitwiseOr = 197, + SpvOpBitwiseXor = 198, + SpvOpBitwiseAnd = 199, + SpvOpNot = 200, + SpvOpBitFieldInsert = 201, + SpvOpBitFieldSExtract = 202, + SpvOpBitFieldUExtract = 203, + SpvOpBitReverse = 204, + SpvOpBitCount = 205, + SpvOpDPdx = 207, + SpvOpDPdy = 208, + SpvOpFwidth = 209, + SpvOpDPdxFine = 210, + SpvOpDPdyFine = 211, + SpvOpFwidthFine = 212, + SpvOpDPdxCoarse = 213, + SpvOpDPdyCoarse = 214, + SpvOpFwidthCoarse = 215, + SpvOpEmitVertex = 218, + SpvOpEndPrimitive = 219, + SpvOpEmitStreamVertex = 220, + SpvOpEndStreamPrimitive = 221, + SpvOpControlBarrier = 224, + SpvOpMemoryBarrier = 225, + SpvOpAtomicLoad = 227, + SpvOpAtomicStore = 228, + SpvOpAtomicExchange = 229, + SpvOpAtomicCompareExchange = 230, + SpvOpAtomicCompareExchangeWeak = 231, + SpvOpAtomicIIncrement = 232, + SpvOpAtomicIDecrement = 233, + SpvOpAtomicIAdd = 234, + SpvOpAtomicISub = 235, + SpvOpAtomicSMin = 236, + SpvOpAtomicUMin = 237, + SpvOpAtomicSMax = 238, + SpvOpAtomicUMax = 239, + SpvOpAtomicAnd = 240, + SpvOpAtomicOr = 241, + SpvOpAtomicXor = 242, + SpvOpPhi = 245, + SpvOpLoopMerge = 246, + SpvOpSelectionMerge = 247, + SpvOpLabel = 248, + SpvOpBranch = 249, + SpvOpBranchConditional = 250, + SpvOpSwitch = 251, + SpvOpKill = 252, + SpvOpReturn = 253, + SpvOpReturnValue = 254, + SpvOpUnreachable = 255, + SpvOpLifetimeStart = 256, + SpvOpLifetimeStop = 257, + SpvOpGroupAsyncCopy = 259, + SpvOpGroupWaitEvents = 260, + SpvOpGroupAll = 261, + SpvOpGroupAny = 262, + SpvOpGroupBroadcast = 263, + SpvOpGroupIAdd = 264, + SpvOpGroupFAdd = 265, + SpvOpGroupFMin = 266, + SpvOpGroupUMin = 267, + SpvOpGroupSMin = 268, + SpvOpGroupFMax = 269, + SpvOpGroupUMax = 270, + SpvOpGroupSMax = 271, + SpvOpReadPipe = 274, + SpvOpWritePipe = 275, + SpvOpReservedReadPipe = 276, + SpvOpReservedWritePipe = 277, + SpvOpReserveReadPipePackets = 278, + SpvOpReserveWritePipePackets = 279, + SpvOpCommitReadPipe = 280, + SpvOpCommitWritePipe = 281, + SpvOpIsValidReserveId = 282, + SpvOpGetNumPipePackets = 283, + SpvOpGetMaxPipePackets = 284, + SpvOpGroupReserveReadPipePackets = 285, + SpvOpGroupReserveWritePipePackets = 286, + SpvOpGroupCommitReadPipe = 287, + SpvOpGroupCommitWritePipe = 288, + SpvOpEnqueueMarker = 291, + SpvOpEnqueueKernel = 292, + SpvOpGetKernelNDrangeSubGroupCount = 293, + SpvOpGetKernelNDrangeMaxSubGroupSize = 294, + SpvOpGetKernelWorkGroupSize = 295, + SpvOpGetKernelPreferredWorkGroupSizeMultiple = 296, + SpvOpRetainEvent = 297, + SpvOpReleaseEvent = 298, + SpvOpCreateUserEvent = 299, + SpvOpIsValidEvent = 300, + SpvOpSetUserEventStatus = 301, + SpvOpCaptureEventProfilingInfo = 302, + SpvOpGetDefaultQueue = 303, + SpvOpBuildNDRange = 304, + SpvOpImageSparseSampleImplicitLod = 305, + SpvOpImageSparseSampleExplicitLod = 306, + SpvOpImageSparseSampleDrefImplicitLod = 307, + SpvOpImageSparseSampleDrefExplicitLod = 308, + SpvOpImageSparseSampleProjImplicitLod = 309, + SpvOpImageSparseSampleProjExplicitLod = 310, + SpvOpImageSparseSampleProjDrefImplicitLod = 311, + SpvOpImageSparseSampleProjDrefExplicitLod = 312, + SpvOpImageSparseFetch = 313, + SpvOpImageSparseGather = 314, + SpvOpImageSparseDrefGather = 315, + SpvOpImageSparseTexelsResident = 316, + SpvOpNoLine = 317, + SpvOpAtomicFlagTestAndSet = 318, + SpvOpAtomicFlagClear = 319, + SpvOpImageSparseRead = 320, + SpvOpSizeOf = 321, + SpvOpTypePipeStorage = 322, + SpvOpConstantPipeStorage = 323, + SpvOpCreatePipeFromPipeStorage = 324, + SpvOpGetKernelLocalSizeForSubgroupCount = 325, + SpvOpGetKernelMaxNumSubgroups = 326, + SpvOpTypeNamedBarrier = 327, + SpvOpNamedBarrierInitialize = 328, + SpvOpMemoryNamedBarrier = 329, + SpvOpModuleProcessed = 330, + SpvOpDecorateId = 332, + SpvOpSubgroupBallotKHR = 4421, + SpvOpSubgroupFirstInvocationKHR = 4422, + SpvOpSubgroupAllKHR = 4428, + SpvOpSubgroupAnyKHR = 4429, + SpvOpSubgroupAllEqualKHR = 4430, + SpvOpSubgroupReadInvocationKHR = 4432, + SpvOpGroupIAddNonUniformAMD = 5000, + SpvOpGroupFAddNonUniformAMD = 5001, + SpvOpGroupFMinNonUniformAMD = 5002, + SpvOpGroupUMinNonUniformAMD = 5003, + SpvOpGroupSMinNonUniformAMD = 5004, + SpvOpGroupFMaxNonUniformAMD = 5005, + SpvOpGroupUMaxNonUniformAMD = 5006, + SpvOpGroupSMaxNonUniformAMD = 5007, + SpvOpFragmentMaskFetchAMD = 5011, + SpvOpFragmentFetchAMD = 5012, + SpvOpSubgroupShuffleINTEL = 5571, + SpvOpSubgroupShuffleDownINTEL = 5572, + SpvOpSubgroupShuffleUpINTEL = 5573, + SpvOpSubgroupShuffleXorINTEL = 5574, + SpvOpSubgroupBlockReadINTEL = 5575, + SpvOpSubgroupBlockWriteINTEL = 5576, + SpvOpSubgroupImageBlockReadINTEL = 5577, + SpvOpSubgroupImageBlockWriteINTEL = 5578, + SpvOpDecorateStringGOOGLE = 5632, + SpvOpMemberDecorateStringGOOGLE = 5633, + SpvOpMax = 0x7fffffff, +} SpvOp; + +#endif // #ifndef spirv_H + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.hpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.hpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.hpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.hpp 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1024 @@ +// Copyright (c) 2014-2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// This header is automatically generated by the same tool that creates +// the Binary Section of the SPIR-V specification. + +// Enumeration tokens for SPIR-V, in various styles: +// C, C++, C++11, JSON, Lua, Python +// +// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// +// Some tokens act like mask values, which can be OR'd together, +// while others are mutually exclusive. The mask-like ones have +// "Mask" in their name, and a parallel enum that has the shift +// amount (1 << x) for each corresponding enumerant. + +#ifndef spirv_HPP +#define spirv_HPP + +namespace spv { + +typedef unsigned int Id; + +#define SPV_VERSION 0x10100 +#define SPV_REVISION 8 + +static const unsigned int MagicNumber = 0x07230203; +static const unsigned int Version = 0x00010100; +static const unsigned int Revision = 8; +static const unsigned int OpCodeMask = 0xffff; +static const unsigned int WordCountShift = 16; + +enum SourceLanguage { + SourceLanguageUnknown = 0, + SourceLanguageESSL = 1, + SourceLanguageGLSL = 2, + SourceLanguageOpenCL_C = 3, + SourceLanguageOpenCL_CPP = 4, + SourceLanguageHLSL = 5, + SourceLanguageMax = 0x7fffffff, +}; + +enum ExecutionModel { + ExecutionModelVertex = 0, + ExecutionModelTessellationControl = 1, + ExecutionModelTessellationEvaluation = 2, + ExecutionModelGeometry = 3, + ExecutionModelFragment = 4, + ExecutionModelGLCompute = 5, + ExecutionModelKernel = 6, + ExecutionModelMax = 0x7fffffff, +}; + +enum AddressingModel { + AddressingModelLogical = 0, + AddressingModelPhysical32 = 1, + AddressingModelPhysical64 = 2, + AddressingModelMax = 0x7fffffff, +}; + +enum MemoryModel { + MemoryModelSimple = 0, + MemoryModelGLSL450 = 1, + MemoryModelOpenCL = 2, + MemoryModelMax = 0x7fffffff, +}; + +enum ExecutionMode { + ExecutionModeInvocations = 0, + ExecutionModeSpacingEqual = 1, + ExecutionModeSpacingFractionalEven = 2, + ExecutionModeSpacingFractionalOdd = 3, + ExecutionModeVertexOrderCw = 4, + ExecutionModeVertexOrderCcw = 5, + ExecutionModePixelCenterInteger = 6, + ExecutionModeOriginUpperLeft = 7, + ExecutionModeOriginLowerLeft = 8, + ExecutionModeEarlyFragmentTests = 9, + ExecutionModePointMode = 10, + ExecutionModeXfb = 11, + ExecutionModeDepthReplacing = 12, + ExecutionModeDepthGreater = 14, + ExecutionModeDepthLess = 15, + ExecutionModeDepthUnchanged = 16, + ExecutionModeLocalSize = 17, + ExecutionModeLocalSizeHint = 18, + ExecutionModeInputPoints = 19, + ExecutionModeInputLines = 20, + ExecutionModeInputLinesAdjacency = 21, + ExecutionModeTriangles = 22, + ExecutionModeInputTrianglesAdjacency = 23, + ExecutionModeQuads = 24, + ExecutionModeIsolines = 25, + ExecutionModeOutputVertices = 26, + ExecutionModeOutputPoints = 27, + ExecutionModeOutputLineStrip = 28, + ExecutionModeOutputTriangleStrip = 29, + ExecutionModeVecTypeHint = 30, + ExecutionModeContractionOff = 31, + ExecutionModeInitializer = 33, + ExecutionModeFinalizer = 34, + ExecutionModeSubgroupSize = 35, + ExecutionModeSubgroupsPerWorkgroup = 36, + ExecutionModePostDepthCoverage = 4446, + ExecutionModeStencilRefReplacingEXT = 5027, + ExecutionModeMax = 0x7fffffff, +}; + +enum StorageClass { + StorageClassUniformConstant = 0, + StorageClassInput = 1, + StorageClassUniform = 2, + StorageClassOutput = 3, + StorageClassWorkgroup = 4, + StorageClassCrossWorkgroup = 5, + StorageClassPrivate = 6, + StorageClassFunction = 7, + StorageClassGeneric = 8, + StorageClassPushConstant = 9, + StorageClassAtomicCounter = 10, + StorageClassImage = 11, + StorageClassStorageBuffer = 12, + StorageClassMax = 0x7fffffff, +}; + +enum Dim { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + DimCube = 3, + DimRect = 4, + DimBuffer = 5, + DimSubpassData = 6, + DimMax = 0x7fffffff, +}; + +enum SamplerAddressingMode { + SamplerAddressingModeNone = 0, + SamplerAddressingModeClampToEdge = 1, + SamplerAddressingModeClamp = 2, + SamplerAddressingModeRepeat = 3, + SamplerAddressingModeRepeatMirrored = 4, + SamplerAddressingModeMax = 0x7fffffff, +}; + +enum SamplerFilterMode { + SamplerFilterModeNearest = 0, + SamplerFilterModeLinear = 1, + SamplerFilterModeMax = 0x7fffffff, +}; + +enum ImageFormat { + ImageFormatUnknown = 0, + ImageFormatRgba32f = 1, + ImageFormatRgba16f = 2, + ImageFormatR32f = 3, + ImageFormatRgba8 = 4, + ImageFormatRgba8Snorm = 5, + ImageFormatRg32f = 6, + ImageFormatRg16f = 7, + ImageFormatR11fG11fB10f = 8, + ImageFormatR16f = 9, + ImageFormatRgba16 = 10, + ImageFormatRgb10A2 = 11, + ImageFormatRg16 = 12, + ImageFormatRg8 = 13, + ImageFormatR16 = 14, + ImageFormatR8 = 15, + ImageFormatRgba16Snorm = 16, + ImageFormatRg16Snorm = 17, + ImageFormatRg8Snorm = 18, + ImageFormatR16Snorm = 19, + ImageFormatR8Snorm = 20, + ImageFormatRgba32i = 21, + ImageFormatRgba16i = 22, + ImageFormatRgba8i = 23, + ImageFormatR32i = 24, + ImageFormatRg32i = 25, + ImageFormatRg16i = 26, + ImageFormatRg8i = 27, + ImageFormatR16i = 28, + ImageFormatR8i = 29, + ImageFormatRgba32ui = 30, + ImageFormatRgba16ui = 31, + ImageFormatRgba8ui = 32, + ImageFormatR32ui = 33, + ImageFormatRgb10a2ui = 34, + ImageFormatRg32ui = 35, + ImageFormatRg16ui = 36, + ImageFormatRg8ui = 37, + ImageFormatR16ui = 38, + ImageFormatR8ui = 39, + ImageFormatMax = 0x7fffffff, +}; + +enum ImageChannelOrder { + ImageChannelOrderR = 0, + ImageChannelOrderA = 1, + ImageChannelOrderRG = 2, + ImageChannelOrderRA = 3, + ImageChannelOrderRGB = 4, + ImageChannelOrderRGBA = 5, + ImageChannelOrderBGRA = 6, + ImageChannelOrderARGB = 7, + ImageChannelOrderIntensity = 8, + ImageChannelOrderLuminance = 9, + ImageChannelOrderRx = 10, + ImageChannelOrderRGx = 11, + ImageChannelOrderRGBx = 12, + ImageChannelOrderDepth = 13, + ImageChannelOrderDepthStencil = 14, + ImageChannelOrdersRGB = 15, + ImageChannelOrdersRGBx = 16, + ImageChannelOrdersRGBA = 17, + ImageChannelOrdersBGRA = 18, + ImageChannelOrderABGR = 19, + ImageChannelOrderMax = 0x7fffffff, +}; + +enum ImageChannelDataType { + ImageChannelDataTypeSnormInt8 = 0, + ImageChannelDataTypeSnormInt16 = 1, + ImageChannelDataTypeUnormInt8 = 2, + ImageChannelDataTypeUnormInt16 = 3, + ImageChannelDataTypeUnormShort565 = 4, + ImageChannelDataTypeUnormShort555 = 5, + ImageChannelDataTypeUnormInt101010 = 6, + ImageChannelDataTypeSignedInt8 = 7, + ImageChannelDataTypeSignedInt16 = 8, + ImageChannelDataTypeSignedInt32 = 9, + ImageChannelDataTypeUnsignedInt8 = 10, + ImageChannelDataTypeUnsignedInt16 = 11, + ImageChannelDataTypeUnsignedInt32 = 12, + ImageChannelDataTypeHalfFloat = 13, + ImageChannelDataTypeFloat = 14, + ImageChannelDataTypeUnormInt24 = 15, + ImageChannelDataTypeUnormInt101010_2 = 16, + ImageChannelDataTypeMax = 0x7fffffff, +}; + +enum ImageOperandsShift { + ImageOperandsBiasShift = 0, + ImageOperandsLodShift = 1, + ImageOperandsGradShift = 2, + ImageOperandsConstOffsetShift = 3, + ImageOperandsOffsetShift = 4, + ImageOperandsConstOffsetsShift = 5, + ImageOperandsSampleShift = 6, + ImageOperandsMinLodShift = 7, + ImageOperandsMax = 0x7fffffff, +}; + +enum ImageOperandsMask { + ImageOperandsMaskNone = 0, + ImageOperandsBiasMask = 0x00000001, + ImageOperandsLodMask = 0x00000002, + ImageOperandsGradMask = 0x00000004, + ImageOperandsConstOffsetMask = 0x00000008, + ImageOperandsOffsetMask = 0x00000010, + ImageOperandsConstOffsetsMask = 0x00000020, + ImageOperandsSampleMask = 0x00000040, + ImageOperandsMinLodMask = 0x00000080, +}; + +enum FPFastMathModeShift { + FPFastMathModeNotNaNShift = 0, + FPFastMathModeNotInfShift = 1, + FPFastMathModeNSZShift = 2, + FPFastMathModeAllowRecipShift = 3, + FPFastMathModeFastShift = 4, + FPFastMathModeMax = 0x7fffffff, +}; + +enum FPFastMathModeMask { + FPFastMathModeMaskNone = 0, + FPFastMathModeNotNaNMask = 0x00000001, + FPFastMathModeNotInfMask = 0x00000002, + FPFastMathModeNSZMask = 0x00000004, + FPFastMathModeAllowRecipMask = 0x00000008, + FPFastMathModeFastMask = 0x00000010, +}; + +enum FPRoundingMode { + FPRoundingModeRTE = 0, + FPRoundingModeRTZ = 1, + FPRoundingModeRTP = 2, + FPRoundingModeRTN = 3, + FPRoundingModeMax = 0x7fffffff, +}; + +enum LinkageType { + LinkageTypeExport = 0, + LinkageTypeImport = 1, + LinkageTypeMax = 0x7fffffff, +}; + +enum AccessQualifier { + AccessQualifierReadOnly = 0, + AccessQualifierWriteOnly = 1, + AccessQualifierReadWrite = 2, + AccessQualifierMax = 0x7fffffff, +}; + +enum FunctionParameterAttribute { + FunctionParameterAttributeZext = 0, + FunctionParameterAttributeSext = 1, + FunctionParameterAttributeByVal = 2, + FunctionParameterAttributeSret = 3, + FunctionParameterAttributeNoAlias = 4, + FunctionParameterAttributeNoCapture = 5, + FunctionParameterAttributeNoWrite = 6, + FunctionParameterAttributeNoReadWrite = 7, + FunctionParameterAttributeMax = 0x7fffffff, +}; + +enum Decoration { + DecorationRelaxedPrecision = 0, + DecorationSpecId = 1, + DecorationBlock = 2, + DecorationBufferBlock = 3, + DecorationRowMajor = 4, + DecorationColMajor = 5, + DecorationArrayStride = 6, + DecorationMatrixStride = 7, + DecorationGLSLShared = 8, + DecorationGLSLPacked = 9, + DecorationCPacked = 10, + DecorationBuiltIn = 11, + DecorationNoPerspective = 13, + DecorationFlat = 14, + DecorationPatch = 15, + DecorationCentroid = 16, + DecorationSample = 17, + DecorationInvariant = 18, + DecorationRestrict = 19, + DecorationAliased = 20, + DecorationVolatile = 21, + DecorationConstant = 22, + DecorationCoherent = 23, + DecorationNonWritable = 24, + DecorationNonReadable = 25, + DecorationUniform = 26, + DecorationSaturatedConversion = 28, + DecorationStream = 29, + DecorationLocation = 30, + DecorationComponent = 31, + DecorationIndex = 32, + DecorationBinding = 33, + DecorationDescriptorSet = 34, + DecorationOffset = 35, + DecorationXfbBuffer = 36, + DecorationXfbStride = 37, + DecorationFuncParamAttr = 38, + DecorationFPRoundingMode = 39, + DecorationFPFastMathMode = 40, + DecorationLinkageAttributes = 41, + DecorationNoContraction = 42, + DecorationInputAttachmentIndex = 43, + DecorationAlignment = 44, + DecorationMaxByteOffset = 45, + DecorationExplicitInterpAMD = 4999, + DecorationOverrideCoverageNV = 5248, + DecorationPassthroughNV = 5250, + DecorationViewportRelativeNV = 5252, + DecorationSecondaryViewportRelativeNV = 5256, + DecorationHlslCounterBufferGOOGLE = 5634, + DecorationHlslSemanticGOOGLE = 5635, + DecorationMax = 0x7fffffff, +}; + +enum BuiltIn { + BuiltInPosition = 0, + BuiltInPointSize = 1, + BuiltInClipDistance = 3, + BuiltInCullDistance = 4, + BuiltInVertexId = 5, + BuiltInInstanceId = 6, + BuiltInPrimitiveId = 7, + BuiltInInvocationId = 8, + BuiltInLayer = 9, + BuiltInViewportIndex = 10, + BuiltInTessLevelOuter = 11, + BuiltInTessLevelInner = 12, + BuiltInTessCoord = 13, + BuiltInPatchVertices = 14, + BuiltInFragCoord = 15, + BuiltInPointCoord = 16, + BuiltInFrontFacing = 17, + BuiltInSampleId = 18, + BuiltInSamplePosition = 19, + BuiltInSampleMask = 20, + BuiltInFragDepth = 22, + BuiltInHelperInvocation = 23, + BuiltInNumWorkgroups = 24, + BuiltInWorkgroupSize = 25, + BuiltInWorkgroupId = 26, + BuiltInLocalInvocationId = 27, + BuiltInGlobalInvocationId = 28, + BuiltInLocalInvocationIndex = 29, + BuiltInWorkDim = 30, + BuiltInGlobalSize = 31, + BuiltInEnqueuedWorkgroupSize = 32, + BuiltInGlobalOffset = 33, + BuiltInGlobalLinearId = 34, + BuiltInSubgroupSize = 36, + BuiltInSubgroupMaxSize = 37, + BuiltInNumSubgroups = 38, + BuiltInNumEnqueuedSubgroups = 39, + BuiltInSubgroupId = 40, + BuiltInSubgroupLocalInvocationId = 41, + BuiltInVertexIndex = 42, + BuiltInInstanceIndex = 43, + BuiltInSubgroupEqMaskKHR = 4416, + BuiltInSubgroupGeMaskKHR = 4417, + BuiltInSubgroupGtMaskKHR = 4418, + BuiltInSubgroupLeMaskKHR = 4419, + BuiltInSubgroupLtMaskKHR = 4420, + BuiltInBaseVertex = 4424, + BuiltInBaseInstance = 4425, + BuiltInDrawIndex = 4426, + BuiltInDeviceIndex = 4438, + BuiltInViewIndex = 4440, + BuiltInBaryCoordNoPerspAMD = 4992, + BuiltInBaryCoordNoPerspCentroidAMD = 4993, + BuiltInBaryCoordNoPerspSampleAMD = 4994, + BuiltInBaryCoordSmoothAMD = 4995, + BuiltInBaryCoordSmoothCentroidAMD = 4996, + BuiltInBaryCoordSmoothSampleAMD = 4997, + BuiltInBaryCoordPullModelAMD = 4998, + BuiltInFragStencilRefEXT = 5014, + BuiltInViewportMaskNV = 5253, + BuiltInSecondaryPositionNV = 5257, + BuiltInSecondaryViewportMaskNV = 5258, + BuiltInPositionPerViewNV = 5261, + BuiltInViewportMaskPerViewNV = 5262, + BuiltInMax = 0x7fffffff, +}; + +enum SelectionControlShift { + SelectionControlFlattenShift = 0, + SelectionControlDontFlattenShift = 1, + SelectionControlMax = 0x7fffffff, +}; + +enum SelectionControlMask { + SelectionControlMaskNone = 0, + SelectionControlFlattenMask = 0x00000001, + SelectionControlDontFlattenMask = 0x00000002, +}; + +enum LoopControlShift { + LoopControlUnrollShift = 0, + LoopControlDontUnrollShift = 1, + LoopControlDependencyInfiniteShift = 2, + LoopControlDependencyLengthShift = 3, + LoopControlMax = 0x7fffffff, +}; + +enum LoopControlMask { + LoopControlMaskNone = 0, + LoopControlUnrollMask = 0x00000001, + LoopControlDontUnrollMask = 0x00000002, + LoopControlDependencyInfiniteMask = 0x00000004, + LoopControlDependencyLengthMask = 0x00000008, +}; + +enum FunctionControlShift { + FunctionControlInlineShift = 0, + FunctionControlDontInlineShift = 1, + FunctionControlPureShift = 2, + FunctionControlConstShift = 3, + FunctionControlMax = 0x7fffffff, +}; + +enum FunctionControlMask { + FunctionControlMaskNone = 0, + FunctionControlInlineMask = 0x00000001, + FunctionControlDontInlineMask = 0x00000002, + FunctionControlPureMask = 0x00000004, + FunctionControlConstMask = 0x00000008, +}; + +enum MemorySemanticsShift { + MemorySemanticsAcquireShift = 1, + MemorySemanticsReleaseShift = 2, + MemorySemanticsAcquireReleaseShift = 3, + MemorySemanticsSequentiallyConsistentShift = 4, + MemorySemanticsUniformMemoryShift = 6, + MemorySemanticsSubgroupMemoryShift = 7, + MemorySemanticsWorkgroupMemoryShift = 8, + MemorySemanticsCrossWorkgroupMemoryShift = 9, + MemorySemanticsAtomicCounterMemoryShift = 10, + MemorySemanticsImageMemoryShift = 11, + MemorySemanticsMax = 0x7fffffff, +}; + +enum MemorySemanticsMask { + MemorySemanticsMaskNone = 0, + MemorySemanticsAcquireMask = 0x00000002, + MemorySemanticsReleaseMask = 0x00000004, + MemorySemanticsAcquireReleaseMask = 0x00000008, + MemorySemanticsSequentiallyConsistentMask = 0x00000010, + MemorySemanticsUniformMemoryMask = 0x00000040, + MemorySemanticsSubgroupMemoryMask = 0x00000080, + MemorySemanticsWorkgroupMemoryMask = 0x00000100, + MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, + MemorySemanticsAtomicCounterMemoryMask = 0x00000400, + MemorySemanticsImageMemoryMask = 0x00000800, +}; + +enum MemoryAccessShift { + MemoryAccessVolatileShift = 0, + MemoryAccessAlignedShift = 1, + MemoryAccessNontemporalShift = 2, + MemoryAccessMax = 0x7fffffff, +}; + +enum MemoryAccessMask { + MemoryAccessMaskNone = 0, + MemoryAccessVolatileMask = 0x00000001, + MemoryAccessAlignedMask = 0x00000002, + MemoryAccessNontemporalMask = 0x00000004, +}; + +enum Scope { + ScopeCrossDevice = 0, + ScopeDevice = 1, + ScopeWorkgroup = 2, + ScopeSubgroup = 3, + ScopeInvocation = 4, + ScopeMax = 0x7fffffff, +}; + +enum GroupOperation { + GroupOperationReduce = 0, + GroupOperationInclusiveScan = 1, + GroupOperationExclusiveScan = 2, + GroupOperationMax = 0x7fffffff, +}; + +enum KernelEnqueueFlags { + KernelEnqueueFlagsNoWait = 0, + KernelEnqueueFlagsWaitKernel = 1, + KernelEnqueueFlagsWaitWorkGroup = 2, + KernelEnqueueFlagsMax = 0x7fffffff, +}; + +enum KernelProfilingInfoShift { + KernelProfilingInfoCmdExecTimeShift = 0, + KernelProfilingInfoMax = 0x7fffffff, +}; + +enum KernelProfilingInfoMask { + KernelProfilingInfoMaskNone = 0, + KernelProfilingInfoCmdExecTimeMask = 0x00000001, +}; + +enum Capability { + CapabilityMatrix = 0, + CapabilityShader = 1, + CapabilityGeometry = 2, + CapabilityTessellation = 3, + CapabilityAddresses = 4, + CapabilityLinkage = 5, + CapabilityKernel = 6, + CapabilityVector16 = 7, + CapabilityFloat16Buffer = 8, + CapabilityFloat16 = 9, + CapabilityFloat64 = 10, + CapabilityInt64 = 11, + CapabilityInt64Atomics = 12, + CapabilityImageBasic = 13, + CapabilityImageReadWrite = 14, + CapabilityImageMipmap = 15, + CapabilityPipes = 17, + CapabilityGroups = 18, + CapabilityDeviceEnqueue = 19, + CapabilityLiteralSampler = 20, + CapabilityAtomicStorage = 21, + CapabilityInt16 = 22, + CapabilityTessellationPointSize = 23, + CapabilityGeometryPointSize = 24, + CapabilityImageGatherExtended = 25, + CapabilityStorageImageMultisample = 27, + CapabilityUniformBufferArrayDynamicIndexing = 28, + CapabilitySampledImageArrayDynamicIndexing = 29, + CapabilityStorageBufferArrayDynamicIndexing = 30, + CapabilityStorageImageArrayDynamicIndexing = 31, + CapabilityClipDistance = 32, + CapabilityCullDistance = 33, + CapabilityImageCubeArray = 34, + CapabilitySampleRateShading = 35, + CapabilityImageRect = 36, + CapabilitySampledRect = 37, + CapabilityGenericPointer = 38, + CapabilityInt8 = 39, + CapabilityInputAttachment = 40, + CapabilitySparseResidency = 41, + CapabilityMinLod = 42, + CapabilitySampled1D = 43, + CapabilityImage1D = 44, + CapabilitySampledCubeArray = 45, + CapabilitySampledBuffer = 46, + CapabilityImageBuffer = 47, + CapabilityImageMSArray = 48, + CapabilityStorageImageExtendedFormats = 49, + CapabilityImageQuery = 50, + CapabilityDerivativeControl = 51, + CapabilityInterpolationFunction = 52, + CapabilityTransformFeedback = 53, + CapabilityGeometryStreams = 54, + CapabilityStorageImageReadWithoutFormat = 55, + CapabilityStorageImageWriteWithoutFormat = 56, + CapabilityMultiViewport = 57, + CapabilitySubgroupDispatch = 58, + CapabilityNamedBarrier = 59, + CapabilityPipeStorage = 60, + CapabilitySubgroupBallotKHR = 4423, + CapabilityDrawParameters = 4427, + CapabilitySubgroupVoteKHR = 4431, + CapabilityStorageBuffer16BitAccess = 4433, + CapabilityStorageUniformBufferBlock16 = 4433, + CapabilityStorageUniform16 = 4434, + CapabilityUniformAndStorageBuffer16BitAccess = 4434, + CapabilityStoragePushConstant16 = 4435, + CapabilityStorageInputOutput16 = 4436, + CapabilityDeviceGroup = 4437, + CapabilityMultiView = 4439, + CapabilityVariablePointersStorageBuffer = 4441, + CapabilityVariablePointers = 4442, + CapabilityAtomicStorageOps = 4445, + CapabilitySampleMaskPostDepthCoverage = 4447, + CapabilityImageGatherBiasLodAMD = 5009, + CapabilityFragmentMaskAMD = 5010, + CapabilityStencilExportEXT = 5013, + CapabilityImageReadWriteLodAMD = 5015, + CapabilitySampleMaskOverrideCoverageNV = 5249, + CapabilityGeometryShaderPassthroughNV = 5251, + CapabilityShaderViewportIndexLayerEXT = 5254, + CapabilityShaderViewportIndexLayerNV = 5254, + CapabilityShaderViewportMaskNV = 5255, + CapabilityShaderStereoViewNV = 5259, + CapabilityPerViewAttributesNV = 5260, + CapabilitySubgroupShuffleINTEL = 5568, + CapabilitySubgroupBufferBlockIOINTEL = 5569, + CapabilitySubgroupImageBlockIOINTEL = 5570, + CapabilityMax = 0x7fffffff, +}; + +enum Op { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpDecorateId = 332, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpSubgroupReadInvocationKHR = 4432, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateStringGOOGLE = 5633, + OpMax = 0x7fffffff, +}; + +// Overload operator| for mask bit combining + +inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } + +} // end namespace spv + +#endif // #ifndef spirv_HPP + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.hpp11 vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.hpp11 --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.hpp11 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.hpp11 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1024 @@ +// Copyright (c) 2014-2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// This header is automatically generated by the same tool that creates +// the Binary Section of the SPIR-V specification. + +// Enumeration tokens for SPIR-V, in various styles: +// C, C++, C++11, JSON, Lua, Python +// +// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// +// Some tokens act like mask values, which can be OR'd together, +// while others are mutually exclusive. The mask-like ones have +// "Mask" in their name, and a parallel enum that has the shift +// amount (1 << x) for each corresponding enumerant. + +#ifndef spirv_HPP +#define spirv_HPP + +namespace spv { + +typedef unsigned int Id; + +#define SPV_VERSION 0x10100 +#define SPV_REVISION 8 + +static const unsigned int MagicNumber = 0x07230203; +static const unsigned int Version = 0x00010100; +static const unsigned int Revision = 8; +static const unsigned int OpCodeMask = 0xffff; +static const unsigned int WordCountShift = 16; + +enum class SourceLanguage : unsigned { + Unknown = 0, + ESSL = 1, + GLSL = 2, + OpenCL_C = 3, + OpenCL_CPP = 4, + HLSL = 5, + Max = 0x7fffffff, +}; + +enum class ExecutionModel : unsigned { + Vertex = 0, + TessellationControl = 1, + TessellationEvaluation = 2, + Geometry = 3, + Fragment = 4, + GLCompute = 5, + Kernel = 6, + Max = 0x7fffffff, +}; + +enum class AddressingModel : unsigned { + Logical = 0, + Physical32 = 1, + Physical64 = 2, + Max = 0x7fffffff, +}; + +enum class MemoryModel : unsigned { + Simple = 0, + GLSL450 = 1, + OpenCL = 2, + Max = 0x7fffffff, +}; + +enum class ExecutionMode : unsigned { + Invocations = 0, + SpacingEqual = 1, + SpacingFractionalEven = 2, + SpacingFractionalOdd = 3, + VertexOrderCw = 4, + VertexOrderCcw = 5, + PixelCenterInteger = 6, + OriginUpperLeft = 7, + OriginLowerLeft = 8, + EarlyFragmentTests = 9, + PointMode = 10, + Xfb = 11, + DepthReplacing = 12, + DepthGreater = 14, + DepthLess = 15, + DepthUnchanged = 16, + LocalSize = 17, + LocalSizeHint = 18, + InputPoints = 19, + InputLines = 20, + InputLinesAdjacency = 21, + Triangles = 22, + InputTrianglesAdjacency = 23, + Quads = 24, + Isolines = 25, + OutputVertices = 26, + OutputPoints = 27, + OutputLineStrip = 28, + OutputTriangleStrip = 29, + VecTypeHint = 30, + ContractionOff = 31, + Initializer = 33, + Finalizer = 34, + SubgroupSize = 35, + SubgroupsPerWorkgroup = 36, + PostDepthCoverage = 4446, + StencilRefReplacingEXT = 5027, + Max = 0x7fffffff, +}; + +enum class StorageClass : unsigned { + UniformConstant = 0, + Input = 1, + Uniform = 2, + Output = 3, + Workgroup = 4, + CrossWorkgroup = 5, + Private = 6, + Function = 7, + Generic = 8, + PushConstant = 9, + AtomicCounter = 10, + Image = 11, + StorageBuffer = 12, + Max = 0x7fffffff, +}; + +enum class Dim : unsigned { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + Cube = 3, + Rect = 4, + Buffer = 5, + SubpassData = 6, + Max = 0x7fffffff, +}; + +enum class SamplerAddressingMode : unsigned { + None = 0, + ClampToEdge = 1, + Clamp = 2, + Repeat = 3, + RepeatMirrored = 4, + Max = 0x7fffffff, +}; + +enum class SamplerFilterMode : unsigned { + Nearest = 0, + Linear = 1, + Max = 0x7fffffff, +}; + +enum class ImageFormat : unsigned { + Unknown = 0, + Rgba32f = 1, + Rgba16f = 2, + R32f = 3, + Rgba8 = 4, + Rgba8Snorm = 5, + Rg32f = 6, + Rg16f = 7, + R11fG11fB10f = 8, + R16f = 9, + Rgba16 = 10, + Rgb10A2 = 11, + Rg16 = 12, + Rg8 = 13, + R16 = 14, + R8 = 15, + Rgba16Snorm = 16, + Rg16Snorm = 17, + Rg8Snorm = 18, + R16Snorm = 19, + R8Snorm = 20, + Rgba32i = 21, + Rgba16i = 22, + Rgba8i = 23, + R32i = 24, + Rg32i = 25, + Rg16i = 26, + Rg8i = 27, + R16i = 28, + R8i = 29, + Rgba32ui = 30, + Rgba16ui = 31, + Rgba8ui = 32, + R32ui = 33, + Rgb10a2ui = 34, + Rg32ui = 35, + Rg16ui = 36, + Rg8ui = 37, + R16ui = 38, + R8ui = 39, + Max = 0x7fffffff, +}; + +enum class ImageChannelOrder : unsigned { + R = 0, + A = 1, + RG = 2, + RA = 3, + RGB = 4, + RGBA = 5, + BGRA = 6, + ARGB = 7, + Intensity = 8, + Luminance = 9, + Rx = 10, + RGx = 11, + RGBx = 12, + Depth = 13, + DepthStencil = 14, + sRGB = 15, + sRGBx = 16, + sRGBA = 17, + sBGRA = 18, + ABGR = 19, + Max = 0x7fffffff, +}; + +enum class ImageChannelDataType : unsigned { + SnormInt8 = 0, + SnormInt16 = 1, + UnormInt8 = 2, + UnormInt16 = 3, + UnormShort565 = 4, + UnormShort555 = 5, + UnormInt101010 = 6, + SignedInt8 = 7, + SignedInt16 = 8, + SignedInt32 = 9, + UnsignedInt8 = 10, + UnsignedInt16 = 11, + UnsignedInt32 = 12, + HalfFloat = 13, + Float = 14, + UnormInt24 = 15, + UnormInt101010_2 = 16, + Max = 0x7fffffff, +}; + +enum class ImageOperandsShift : unsigned { + Bias = 0, + Lod = 1, + Grad = 2, + ConstOffset = 3, + Offset = 4, + ConstOffsets = 5, + Sample = 6, + MinLod = 7, + Max = 0x7fffffff, +}; + +enum class ImageOperandsMask : unsigned { + MaskNone = 0, + Bias = 0x00000001, + Lod = 0x00000002, + Grad = 0x00000004, + ConstOffset = 0x00000008, + Offset = 0x00000010, + ConstOffsets = 0x00000020, + Sample = 0x00000040, + MinLod = 0x00000080, +}; + +enum class FPFastMathModeShift : unsigned { + NotNaN = 0, + NotInf = 1, + NSZ = 2, + AllowRecip = 3, + Fast = 4, + Max = 0x7fffffff, +}; + +enum class FPFastMathModeMask : unsigned { + MaskNone = 0, + NotNaN = 0x00000001, + NotInf = 0x00000002, + NSZ = 0x00000004, + AllowRecip = 0x00000008, + Fast = 0x00000010, +}; + +enum class FPRoundingMode : unsigned { + RTE = 0, + RTZ = 1, + RTP = 2, + RTN = 3, + Max = 0x7fffffff, +}; + +enum class LinkageType : unsigned { + Export = 0, + Import = 1, + Max = 0x7fffffff, +}; + +enum class AccessQualifier : unsigned { + ReadOnly = 0, + WriteOnly = 1, + ReadWrite = 2, + Max = 0x7fffffff, +}; + +enum class FunctionParameterAttribute : unsigned { + Zext = 0, + Sext = 1, + ByVal = 2, + Sret = 3, + NoAlias = 4, + NoCapture = 5, + NoWrite = 6, + NoReadWrite = 7, + Max = 0x7fffffff, +}; + +enum class Decoration : unsigned { + RelaxedPrecision = 0, + SpecId = 1, + Block = 2, + BufferBlock = 3, + RowMajor = 4, + ColMajor = 5, + ArrayStride = 6, + MatrixStride = 7, + GLSLShared = 8, + GLSLPacked = 9, + CPacked = 10, + BuiltIn = 11, + NoPerspective = 13, + Flat = 14, + Patch = 15, + Centroid = 16, + Sample = 17, + Invariant = 18, + Restrict = 19, + Aliased = 20, + Volatile = 21, + Constant = 22, + Coherent = 23, + NonWritable = 24, + NonReadable = 25, + Uniform = 26, + SaturatedConversion = 28, + Stream = 29, + Location = 30, + Component = 31, + Index = 32, + Binding = 33, + DescriptorSet = 34, + Offset = 35, + XfbBuffer = 36, + XfbStride = 37, + FuncParamAttr = 38, + FPRoundingMode = 39, + FPFastMathMode = 40, + LinkageAttributes = 41, + NoContraction = 42, + InputAttachmentIndex = 43, + Alignment = 44, + MaxByteOffset = 45, + ExplicitInterpAMD = 4999, + OverrideCoverageNV = 5248, + PassthroughNV = 5250, + ViewportRelativeNV = 5252, + SecondaryViewportRelativeNV = 5256, + HlslCounterBufferGOOGLE = 5634, + HlslSemanticGOOGLE = 5635, + Max = 0x7fffffff, +}; + +enum class BuiltIn : unsigned { + Position = 0, + PointSize = 1, + ClipDistance = 3, + CullDistance = 4, + VertexId = 5, + InstanceId = 6, + PrimitiveId = 7, + InvocationId = 8, + Layer = 9, + ViewportIndex = 10, + TessLevelOuter = 11, + TessLevelInner = 12, + TessCoord = 13, + PatchVertices = 14, + FragCoord = 15, + PointCoord = 16, + FrontFacing = 17, + SampleId = 18, + SamplePosition = 19, + SampleMask = 20, + FragDepth = 22, + HelperInvocation = 23, + NumWorkgroups = 24, + WorkgroupSize = 25, + WorkgroupId = 26, + LocalInvocationId = 27, + GlobalInvocationId = 28, + LocalInvocationIndex = 29, + WorkDim = 30, + GlobalSize = 31, + EnqueuedWorkgroupSize = 32, + GlobalOffset = 33, + GlobalLinearId = 34, + SubgroupSize = 36, + SubgroupMaxSize = 37, + NumSubgroups = 38, + NumEnqueuedSubgroups = 39, + SubgroupId = 40, + SubgroupLocalInvocationId = 41, + VertexIndex = 42, + InstanceIndex = 43, + SubgroupEqMaskKHR = 4416, + SubgroupGeMaskKHR = 4417, + SubgroupGtMaskKHR = 4418, + SubgroupLeMaskKHR = 4419, + SubgroupLtMaskKHR = 4420, + BaseVertex = 4424, + BaseInstance = 4425, + DrawIndex = 4426, + DeviceIndex = 4438, + ViewIndex = 4440, + BaryCoordNoPerspAMD = 4992, + BaryCoordNoPerspCentroidAMD = 4993, + BaryCoordNoPerspSampleAMD = 4994, + BaryCoordSmoothAMD = 4995, + BaryCoordSmoothCentroidAMD = 4996, + BaryCoordSmoothSampleAMD = 4997, + BaryCoordPullModelAMD = 4998, + FragStencilRefEXT = 5014, + ViewportMaskNV = 5253, + SecondaryPositionNV = 5257, + SecondaryViewportMaskNV = 5258, + PositionPerViewNV = 5261, + ViewportMaskPerViewNV = 5262, + Max = 0x7fffffff, +}; + +enum class SelectionControlShift : unsigned { + Flatten = 0, + DontFlatten = 1, + Max = 0x7fffffff, +}; + +enum class SelectionControlMask : unsigned { + MaskNone = 0, + Flatten = 0x00000001, + DontFlatten = 0x00000002, +}; + +enum class LoopControlShift : unsigned { + Unroll = 0, + DontUnroll = 1, + DependencyInfinite = 2, + DependencyLength = 3, + Max = 0x7fffffff, +}; + +enum class LoopControlMask : unsigned { + MaskNone = 0, + Unroll = 0x00000001, + DontUnroll = 0x00000002, + DependencyInfinite = 0x00000004, + DependencyLength = 0x00000008, +}; + +enum class FunctionControlShift : unsigned { + Inline = 0, + DontInline = 1, + Pure = 2, + Const = 3, + Max = 0x7fffffff, +}; + +enum class FunctionControlMask : unsigned { + MaskNone = 0, + Inline = 0x00000001, + DontInline = 0x00000002, + Pure = 0x00000004, + Const = 0x00000008, +}; + +enum class MemorySemanticsShift : unsigned { + Acquire = 1, + Release = 2, + AcquireRelease = 3, + SequentiallyConsistent = 4, + UniformMemory = 6, + SubgroupMemory = 7, + WorkgroupMemory = 8, + CrossWorkgroupMemory = 9, + AtomicCounterMemory = 10, + ImageMemory = 11, + Max = 0x7fffffff, +}; + +enum class MemorySemanticsMask : unsigned { + MaskNone = 0, + Acquire = 0x00000002, + Release = 0x00000004, + AcquireRelease = 0x00000008, + SequentiallyConsistent = 0x00000010, + UniformMemory = 0x00000040, + SubgroupMemory = 0x00000080, + WorkgroupMemory = 0x00000100, + CrossWorkgroupMemory = 0x00000200, + AtomicCounterMemory = 0x00000400, + ImageMemory = 0x00000800, +}; + +enum class MemoryAccessShift : unsigned { + Volatile = 0, + Aligned = 1, + Nontemporal = 2, + Max = 0x7fffffff, +}; + +enum class MemoryAccessMask : unsigned { + MaskNone = 0, + Volatile = 0x00000001, + Aligned = 0x00000002, + Nontemporal = 0x00000004, +}; + +enum class Scope : unsigned { + CrossDevice = 0, + Device = 1, + Workgroup = 2, + Subgroup = 3, + Invocation = 4, + Max = 0x7fffffff, +}; + +enum class GroupOperation : unsigned { + Reduce = 0, + InclusiveScan = 1, + ExclusiveScan = 2, + Max = 0x7fffffff, +}; + +enum class KernelEnqueueFlags : unsigned { + NoWait = 0, + WaitKernel = 1, + WaitWorkGroup = 2, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoShift : unsigned { + CmdExecTime = 0, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoMask : unsigned { + MaskNone = 0, + CmdExecTime = 0x00000001, +}; + +enum class Capability : unsigned { + Matrix = 0, + Shader = 1, + Geometry = 2, + Tessellation = 3, + Addresses = 4, + Linkage = 5, + Kernel = 6, + Vector16 = 7, + Float16Buffer = 8, + Float16 = 9, + Float64 = 10, + Int64 = 11, + Int64Atomics = 12, + ImageBasic = 13, + ImageReadWrite = 14, + ImageMipmap = 15, + Pipes = 17, + Groups = 18, + DeviceEnqueue = 19, + LiteralSampler = 20, + AtomicStorage = 21, + Int16 = 22, + TessellationPointSize = 23, + GeometryPointSize = 24, + ImageGatherExtended = 25, + StorageImageMultisample = 27, + UniformBufferArrayDynamicIndexing = 28, + SampledImageArrayDynamicIndexing = 29, + StorageBufferArrayDynamicIndexing = 30, + StorageImageArrayDynamicIndexing = 31, + ClipDistance = 32, + CullDistance = 33, + ImageCubeArray = 34, + SampleRateShading = 35, + ImageRect = 36, + SampledRect = 37, + GenericPointer = 38, + Int8 = 39, + InputAttachment = 40, + SparseResidency = 41, + MinLod = 42, + Sampled1D = 43, + Image1D = 44, + SampledCubeArray = 45, + SampledBuffer = 46, + ImageBuffer = 47, + ImageMSArray = 48, + StorageImageExtendedFormats = 49, + ImageQuery = 50, + DerivativeControl = 51, + InterpolationFunction = 52, + TransformFeedback = 53, + GeometryStreams = 54, + StorageImageReadWithoutFormat = 55, + StorageImageWriteWithoutFormat = 56, + MultiViewport = 57, + SubgroupDispatch = 58, + NamedBarrier = 59, + PipeStorage = 60, + SubgroupBallotKHR = 4423, + DrawParameters = 4427, + SubgroupVoteKHR = 4431, + StorageBuffer16BitAccess = 4433, + StorageUniformBufferBlock16 = 4433, + StorageUniform16 = 4434, + UniformAndStorageBuffer16BitAccess = 4434, + StoragePushConstant16 = 4435, + StorageInputOutput16 = 4436, + DeviceGroup = 4437, + MultiView = 4439, + VariablePointersStorageBuffer = 4441, + VariablePointers = 4442, + AtomicStorageOps = 4445, + SampleMaskPostDepthCoverage = 4447, + ImageGatherBiasLodAMD = 5009, + FragmentMaskAMD = 5010, + StencilExportEXT = 5013, + ImageReadWriteLodAMD = 5015, + SampleMaskOverrideCoverageNV = 5249, + GeometryShaderPassthroughNV = 5251, + ShaderViewportIndexLayerEXT = 5254, + ShaderViewportIndexLayerNV = 5254, + ShaderViewportMaskNV = 5255, + ShaderStereoViewNV = 5259, + PerViewAttributesNV = 5260, + SubgroupShuffleINTEL = 5568, + SubgroupBufferBlockIOINTEL = 5569, + SubgroupImageBlockIOINTEL = 5570, + Max = 0x7fffffff, +}; + +enum class Op : unsigned { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpDecorateId = 332, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpSubgroupReadInvocationKHR = 4432, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateStringGOOGLE = 5633, + Max = 0x7fffffff, +}; + +// Overload operator| for mask bit combining + +inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } + +} // end namespace spv + +#endif // #ifndef spirv_HPP + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.json 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1040 @@ +{ + "spv": + { + "meta": + { + "Comment": + [ + [ + "Copyright (c) 2014-2018 The Khronos Group Inc.", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and/or associated documentation files (the \"Materials\"),", + "to deal in the Materials without restriction, including without limitation", + "the rights to use, copy, modify, merge, publish, distribute, sublicense,", + "and/or sell copies of the Materials, and to permit persons to whom the", + "Materials are furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Materials.", + "", + "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", + "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", + "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", + "", + "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", + "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", + "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", + "IN THE MATERIALS." + ], + [ + "This header is automatically generated by the same tool that creates", + "the Binary Section of the SPIR-V specification." + ], + [ + "Enumeration tokens for SPIR-V, in various styles:", + " C, C++, C++11, JSON, Lua, Python", + "", + "- C will have tokens with a \"Spv\" prefix, e.g.: SpvSourceLanguageGLSL", + "- C++ will have tokens in the \"spv\" name space, e.g.: spv::SourceLanguageGLSL", + "- C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL", + "- Lua will use tables, e.g.: spv.SourceLanguage.GLSL", + "- Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']", + "", + "Some tokens act like mask values, which can be OR'd together,", + "while others are mutually exclusive. The mask-like ones have", + "\"Mask\" in their name, and a parallel enum that has the shift", + "amount (1 << x) for each corresponding enumerant." + ] + ], + "MagicNumber": 119734787, + "Version": 65792, + "Revision": 8, + "OpCodeMask": 65535, + "WordCountShift": 16 + }, + "enum": + [ + { + "Name": "SourceLanguage", + "Type": "Value", + "Values": + { + "Unknown": 0, + "ESSL": 1, + "GLSL": 2, + "OpenCL_C": 3, + "OpenCL_CPP": 4, + "HLSL": 5 + } + }, + { + "Name": "ExecutionModel", + "Type": "Value", + "Values": + { + "Vertex": 0, + "TessellationControl": 1, + "TessellationEvaluation": 2, + "Geometry": 3, + "Fragment": 4, + "GLCompute": 5, + "Kernel": 6 + } + }, + { + "Name": "AddressingModel", + "Type": "Value", + "Values": + { + "Logical": 0, + "Physical32": 1, + "Physical64": 2 + } + }, + { + "Name": "MemoryModel", + "Type": "Value", + "Values": + { + "Simple": 0, + "GLSL450": 1, + "OpenCL": 2 + } + }, + { + "Name": "ExecutionMode", + "Type": "Value", + "Values": + { + "Invocations": 0, + "SpacingEqual": 1, + "SpacingFractionalEven": 2, + "SpacingFractionalOdd": 3, + "VertexOrderCw": 4, + "VertexOrderCcw": 5, + "PixelCenterInteger": 6, + "OriginUpperLeft": 7, + "OriginLowerLeft": 8, + "EarlyFragmentTests": 9, + "PointMode": 10, + "Xfb": 11, + "DepthReplacing": 12, + "DepthGreater": 14, + "DepthLess": 15, + "DepthUnchanged": 16, + "LocalSize": 17, + "LocalSizeHint": 18, + "InputPoints": 19, + "InputLines": 20, + "InputLinesAdjacency": 21, + "Triangles": 22, + "InputTrianglesAdjacency": 23, + "Quads": 24, + "Isolines": 25, + "OutputVertices": 26, + "OutputPoints": 27, + "OutputLineStrip": 28, + "OutputTriangleStrip": 29, + "VecTypeHint": 30, + "ContractionOff": 31, + "Initializer": 33, + "Finalizer": 34, + "SubgroupSize": 35, + "SubgroupsPerWorkgroup": 36, + "PostDepthCoverage": 4446, + "StencilRefReplacingEXT": 5027 + } + }, + { + "Name": "StorageClass", + "Type": "Value", + "Values": + { + "UniformConstant": 0, + "Input": 1, + "Uniform": 2, + "Output": 3, + "Workgroup": 4, + "CrossWorkgroup": 5, + "Private": 6, + "Function": 7, + "Generic": 8, + "PushConstant": 9, + "AtomicCounter": 10, + "Image": 11, + "StorageBuffer": 12 + } + }, + { + "Name": "Dim", + "Type": "Value", + "Values": + { + "Dim1D": 0, + "Dim2D": 1, + "Dim3D": 2, + "Cube": 3, + "Rect": 4, + "Buffer": 5, + "SubpassData": 6 + } + }, + { + "Name": "SamplerAddressingMode", + "Type": "Value", + "Values": + { + "None": 0, + "ClampToEdge": 1, + "Clamp": 2, + "Repeat": 3, + "RepeatMirrored": 4 + } + }, + { + "Name": "SamplerFilterMode", + "Type": "Value", + "Values": + { + "Nearest": 0, + "Linear": 1 + } + }, + { + "Name": "ImageFormat", + "Type": "Value", + "Values": + { + "Unknown": 0, + "Rgba32f": 1, + "Rgba16f": 2, + "R32f": 3, + "Rgba8": 4, + "Rgba8Snorm": 5, + "Rg32f": 6, + "Rg16f": 7, + "R11fG11fB10f": 8, + "R16f": 9, + "Rgba16": 10, + "Rgb10A2": 11, + "Rg16": 12, + "Rg8": 13, + "R16": 14, + "R8": 15, + "Rgba16Snorm": 16, + "Rg16Snorm": 17, + "Rg8Snorm": 18, + "R16Snorm": 19, + "R8Snorm": 20, + "Rgba32i": 21, + "Rgba16i": 22, + "Rgba8i": 23, + "R32i": 24, + "Rg32i": 25, + "Rg16i": 26, + "Rg8i": 27, + "R16i": 28, + "R8i": 29, + "Rgba32ui": 30, + "Rgba16ui": 31, + "Rgba8ui": 32, + "R32ui": 33, + "Rgb10a2ui": 34, + "Rg32ui": 35, + "Rg16ui": 36, + "Rg8ui": 37, + "R16ui": 38, + "R8ui": 39 + } + }, + { + "Name": "ImageChannelOrder", + "Type": "Value", + "Values": + { + "R": 0, + "A": 1, + "RG": 2, + "RA": 3, + "RGB": 4, + "RGBA": 5, + "BGRA": 6, + "ARGB": 7, + "Intensity": 8, + "Luminance": 9, + "Rx": 10, + "RGx": 11, + "RGBx": 12, + "Depth": 13, + "DepthStencil": 14, + "sRGB": 15, + "sRGBx": 16, + "sRGBA": 17, + "sBGRA": 18, + "ABGR": 19 + } + }, + { + "Name": "ImageChannelDataType", + "Type": "Value", + "Values": + { + "SnormInt8": 0, + "SnormInt16": 1, + "UnormInt8": 2, + "UnormInt16": 3, + "UnormShort565": 4, + "UnormShort555": 5, + "UnormInt101010": 6, + "SignedInt8": 7, + "SignedInt16": 8, + "SignedInt32": 9, + "UnsignedInt8": 10, + "UnsignedInt16": 11, + "UnsignedInt32": 12, + "HalfFloat": 13, + "Float": 14, + "UnormInt24": 15, + "UnormInt101010_2": 16 + } + }, + { + "Name": "ImageOperands", + "Type": "Bit", + "Values": + { + "Bias": 0, + "Lod": 1, + "Grad": 2, + "ConstOffset": 3, + "Offset": 4, + "ConstOffsets": 5, + "Sample": 6, + "MinLod": 7 + } + }, + { + "Name": "FPFastMathMode", + "Type": "Bit", + "Values": + { + "NotNaN": 0, + "NotInf": 1, + "NSZ": 2, + "AllowRecip": 3, + "Fast": 4 + } + }, + { + "Name": "FPRoundingMode", + "Type": "Value", + "Values": + { + "RTE": 0, + "RTZ": 1, + "RTP": 2, + "RTN": 3 + } + }, + { + "Name": "LinkageType", + "Type": "Value", + "Values": + { + "Export": 0, + "Import": 1 + } + }, + { + "Name": "AccessQualifier", + "Type": "Value", + "Values": + { + "ReadOnly": 0, + "WriteOnly": 1, + "ReadWrite": 2 + } + }, + { + "Name": "FunctionParameterAttribute", + "Type": "Value", + "Values": + { + "Zext": 0, + "Sext": 1, + "ByVal": 2, + "Sret": 3, + "NoAlias": 4, + "NoCapture": 5, + "NoWrite": 6, + "NoReadWrite": 7 + } + }, + { + "Name": "Decoration", + "Type": "Value", + "Values": + { + "RelaxedPrecision": 0, + "SpecId": 1, + "Block": 2, + "BufferBlock": 3, + "RowMajor": 4, + "ColMajor": 5, + "ArrayStride": 6, + "MatrixStride": 7, + "GLSLShared": 8, + "GLSLPacked": 9, + "CPacked": 10, + "BuiltIn": 11, + "NoPerspective": 13, + "Flat": 14, + "Patch": 15, + "Centroid": 16, + "Sample": 17, + "Invariant": 18, + "Restrict": 19, + "Aliased": 20, + "Volatile": 21, + "Constant": 22, + "Coherent": 23, + "NonWritable": 24, + "NonReadable": 25, + "Uniform": 26, + "SaturatedConversion": 28, + "Stream": 29, + "Location": 30, + "Component": 31, + "Index": 32, + "Binding": 33, + "DescriptorSet": 34, + "Offset": 35, + "XfbBuffer": 36, + "XfbStride": 37, + "FuncParamAttr": 38, + "FPRoundingMode": 39, + "FPFastMathMode": 40, + "LinkageAttributes": 41, + "NoContraction": 42, + "InputAttachmentIndex": 43, + "Alignment": 44, + "MaxByteOffset": 45, + "ExplicitInterpAMD": 4999, + "OverrideCoverageNV": 5248, + "PassthroughNV": 5250, + "ViewportRelativeNV": 5252, + "SecondaryViewportRelativeNV": 5256, + "HlslCounterBufferGOOGLE": 5634, + "HlslSemanticGOOGLE": 5635 + } + }, + { + "Name": "BuiltIn", + "Type": "Value", + "Values": + { + "Position": 0, + "PointSize": 1, + "ClipDistance": 3, + "CullDistance": 4, + "VertexId": 5, + "InstanceId": 6, + "PrimitiveId": 7, + "InvocationId": 8, + "Layer": 9, + "ViewportIndex": 10, + "TessLevelOuter": 11, + "TessLevelInner": 12, + "TessCoord": 13, + "PatchVertices": 14, + "FragCoord": 15, + "PointCoord": 16, + "FrontFacing": 17, + "SampleId": 18, + "SamplePosition": 19, + "SampleMask": 20, + "FragDepth": 22, + "HelperInvocation": 23, + "NumWorkgroups": 24, + "WorkgroupSize": 25, + "WorkgroupId": 26, + "LocalInvocationId": 27, + "GlobalInvocationId": 28, + "LocalInvocationIndex": 29, + "WorkDim": 30, + "GlobalSize": 31, + "EnqueuedWorkgroupSize": 32, + "GlobalOffset": 33, + "GlobalLinearId": 34, + "SubgroupSize": 36, + "SubgroupMaxSize": 37, + "NumSubgroups": 38, + "NumEnqueuedSubgroups": 39, + "SubgroupId": 40, + "SubgroupLocalInvocationId": 41, + "VertexIndex": 42, + "InstanceIndex": 43, + "SubgroupEqMaskKHR": 4416, + "SubgroupGeMaskKHR": 4417, + "SubgroupGtMaskKHR": 4418, + "SubgroupLeMaskKHR": 4419, + "SubgroupLtMaskKHR": 4420, + "BaseVertex": 4424, + "BaseInstance": 4425, + "DrawIndex": 4426, + "DeviceIndex": 4438, + "ViewIndex": 4440, + "BaryCoordNoPerspAMD": 4992, + "BaryCoordNoPerspCentroidAMD": 4993, + "BaryCoordNoPerspSampleAMD": 4994, + "BaryCoordSmoothAMD": 4995, + "BaryCoordSmoothCentroidAMD": 4996, + "BaryCoordSmoothSampleAMD": 4997, + "BaryCoordPullModelAMD": 4998, + "FragStencilRefEXT": 5014, + "ViewportMaskNV": 5253, + "SecondaryPositionNV": 5257, + "SecondaryViewportMaskNV": 5258, + "PositionPerViewNV": 5261, + "ViewportMaskPerViewNV": 5262 + } + }, + { + "Name": "SelectionControl", + "Type": "Bit", + "Values": + { + "Flatten": 0, + "DontFlatten": 1 + } + }, + { + "Name": "LoopControl", + "Type": "Bit", + "Values": + { + "Unroll": 0, + "DontUnroll": 1, + "DependencyInfinite": 2, + "DependencyLength": 3 + } + }, + { + "Name": "FunctionControl", + "Type": "Bit", + "Values": + { + "Inline": 0, + "DontInline": 1, + "Pure": 2, + "Const": 3 + } + }, + { + "Name": "MemorySemantics", + "Type": "Bit", + "Values": + { + "Acquire": 1, + "Release": 2, + "AcquireRelease": 3, + "SequentiallyConsistent": 4, + "UniformMemory": 6, + "SubgroupMemory": 7, + "WorkgroupMemory": 8, + "CrossWorkgroupMemory": 9, + "AtomicCounterMemory": 10, + "ImageMemory": 11 + } + }, + { + "Name": "MemoryAccess", + "Type": "Bit", + "Values": + { + "Volatile": 0, + "Aligned": 1, + "Nontemporal": 2 + } + }, + { + "Name": "Scope", + "Type": "Value", + "Values": + { + "CrossDevice": 0, + "Device": 1, + "Workgroup": 2, + "Subgroup": 3, + "Invocation": 4 + } + }, + { + "Name": "GroupOperation", + "Type": "Value", + "Values": + { + "Reduce": 0, + "InclusiveScan": 1, + "ExclusiveScan": 2 + } + }, + { + "Name": "KernelEnqueueFlags", + "Type": "Value", + "Values": + { + "NoWait": 0, + "WaitKernel": 1, + "WaitWorkGroup": 2 + } + }, + { + "Name": "KernelProfilingInfo", + "Type": "Bit", + "Values": + { + "CmdExecTime": 0 + } + }, + { + "Name": "Capability", + "Type": "Value", + "Values": + { + "Matrix": 0, + "Shader": 1, + "Geometry": 2, + "Tessellation": 3, + "Addresses": 4, + "Linkage": 5, + "Kernel": 6, + "Vector16": 7, + "Float16Buffer": 8, + "Float16": 9, + "Float64": 10, + "Int64": 11, + "Int64Atomics": 12, + "ImageBasic": 13, + "ImageReadWrite": 14, + "ImageMipmap": 15, + "Pipes": 17, + "Groups": 18, + "DeviceEnqueue": 19, + "LiteralSampler": 20, + "AtomicStorage": 21, + "Int16": 22, + "TessellationPointSize": 23, + "GeometryPointSize": 24, + "ImageGatherExtended": 25, + "StorageImageMultisample": 27, + "UniformBufferArrayDynamicIndexing": 28, + "SampledImageArrayDynamicIndexing": 29, + "StorageBufferArrayDynamicIndexing": 30, + "StorageImageArrayDynamicIndexing": 31, + "ClipDistance": 32, + "CullDistance": 33, + "ImageCubeArray": 34, + "SampleRateShading": 35, + "ImageRect": 36, + "SampledRect": 37, + "GenericPointer": 38, + "Int8": 39, + "InputAttachment": 40, + "SparseResidency": 41, + "MinLod": 42, + "Sampled1D": 43, + "Image1D": 44, + "SampledCubeArray": 45, + "SampledBuffer": 46, + "ImageBuffer": 47, + "ImageMSArray": 48, + "StorageImageExtendedFormats": 49, + "ImageQuery": 50, + "DerivativeControl": 51, + "InterpolationFunction": 52, + "TransformFeedback": 53, + "GeometryStreams": 54, + "StorageImageReadWithoutFormat": 55, + "StorageImageWriteWithoutFormat": 56, + "MultiViewport": 57, + "SubgroupDispatch": 58, + "NamedBarrier": 59, + "PipeStorage": 60, + "SubgroupBallotKHR": 4423, + "DrawParameters": 4427, + "SubgroupVoteKHR": 4431, + "StorageBuffer16BitAccess": 4433, + "StorageUniformBufferBlock16": 4433, + "StorageUniform16": 4434, + "UniformAndStorageBuffer16BitAccess": 4434, + "StoragePushConstant16": 4435, + "StorageInputOutput16": 4436, + "DeviceGroup": 4437, + "MultiView": 4439, + "VariablePointersStorageBuffer": 4441, + "VariablePointers": 4442, + "AtomicStorageOps": 4445, + "SampleMaskPostDepthCoverage": 4447, + "ImageGatherBiasLodAMD": 5009, + "FragmentMaskAMD": 5010, + "StencilExportEXT": 5013, + "ImageReadWriteLodAMD": 5015, + "SampleMaskOverrideCoverageNV": 5249, + "GeometryShaderPassthroughNV": 5251, + "ShaderViewportIndexLayerEXT": 5254, + "ShaderViewportIndexLayerNV": 5254, + "ShaderViewportMaskNV": 5255, + "ShaderStereoViewNV": 5259, + "PerViewAttributesNV": 5260, + "SubgroupShuffleINTEL": 5568, + "SubgroupBufferBlockIOINTEL": 5569, + "SubgroupImageBlockIOINTEL": 5570 + } + }, + { + "Name": "Op", + "Type": "Value", + "Values": + { + "OpNop": 0, + "OpUndef": 1, + "OpSourceContinued": 2, + "OpSource": 3, + "OpSourceExtension": 4, + "OpName": 5, + "OpMemberName": 6, + "OpString": 7, + "OpLine": 8, + "OpExtension": 10, + "OpExtInstImport": 11, + "OpExtInst": 12, + "OpMemoryModel": 14, + "OpEntryPoint": 15, + "OpExecutionMode": 16, + "OpCapability": 17, + "OpTypeVoid": 19, + "OpTypeBool": 20, + "OpTypeInt": 21, + "OpTypeFloat": 22, + "OpTypeVector": 23, + "OpTypeMatrix": 24, + "OpTypeImage": 25, + "OpTypeSampler": 26, + "OpTypeSampledImage": 27, + "OpTypeArray": 28, + "OpTypeRuntimeArray": 29, + "OpTypeStruct": 30, + "OpTypeOpaque": 31, + "OpTypePointer": 32, + "OpTypeFunction": 33, + "OpTypeEvent": 34, + "OpTypeDeviceEvent": 35, + "OpTypeReserveId": 36, + "OpTypeQueue": 37, + "OpTypePipe": 38, + "OpTypeForwardPointer": 39, + "OpConstantTrue": 41, + "OpConstantFalse": 42, + "OpConstant": 43, + "OpConstantComposite": 44, + "OpConstantSampler": 45, + "OpConstantNull": 46, + "OpSpecConstantTrue": 48, + "OpSpecConstantFalse": 49, + "OpSpecConstant": 50, + "OpSpecConstantComposite": 51, + "OpSpecConstantOp": 52, + "OpFunction": 54, + "OpFunctionParameter": 55, + "OpFunctionEnd": 56, + "OpFunctionCall": 57, + "OpVariable": 59, + "OpImageTexelPointer": 60, + "OpLoad": 61, + "OpStore": 62, + "OpCopyMemory": 63, + "OpCopyMemorySized": 64, + "OpAccessChain": 65, + "OpInBoundsAccessChain": 66, + "OpPtrAccessChain": 67, + "OpArrayLength": 68, + "OpGenericPtrMemSemantics": 69, + "OpInBoundsPtrAccessChain": 70, + "OpDecorate": 71, + "OpMemberDecorate": 72, + "OpDecorationGroup": 73, + "OpGroupDecorate": 74, + "OpGroupMemberDecorate": 75, + "OpVectorExtractDynamic": 77, + "OpVectorInsertDynamic": 78, + "OpVectorShuffle": 79, + "OpCompositeConstruct": 80, + "OpCompositeExtract": 81, + "OpCompositeInsert": 82, + "OpCopyObject": 83, + "OpTranspose": 84, + "OpSampledImage": 86, + "OpImageSampleImplicitLod": 87, + "OpImageSampleExplicitLod": 88, + "OpImageSampleDrefImplicitLod": 89, + "OpImageSampleDrefExplicitLod": 90, + "OpImageSampleProjImplicitLod": 91, + "OpImageSampleProjExplicitLod": 92, + "OpImageSampleProjDrefImplicitLod": 93, + "OpImageSampleProjDrefExplicitLod": 94, + "OpImageFetch": 95, + "OpImageGather": 96, + "OpImageDrefGather": 97, + "OpImageRead": 98, + "OpImageWrite": 99, + "OpImage": 100, + "OpImageQueryFormat": 101, + "OpImageQueryOrder": 102, + "OpImageQuerySizeLod": 103, + "OpImageQuerySize": 104, + "OpImageQueryLod": 105, + "OpImageQueryLevels": 106, + "OpImageQuerySamples": 107, + "OpConvertFToU": 109, + "OpConvertFToS": 110, + "OpConvertSToF": 111, + "OpConvertUToF": 112, + "OpUConvert": 113, + "OpSConvert": 114, + "OpFConvert": 115, + "OpQuantizeToF16": 116, + "OpConvertPtrToU": 117, + "OpSatConvertSToU": 118, + "OpSatConvertUToS": 119, + "OpConvertUToPtr": 120, + "OpPtrCastToGeneric": 121, + "OpGenericCastToPtr": 122, + "OpGenericCastToPtrExplicit": 123, + "OpBitcast": 124, + "OpSNegate": 126, + "OpFNegate": 127, + "OpIAdd": 128, + "OpFAdd": 129, + "OpISub": 130, + "OpFSub": 131, + "OpIMul": 132, + "OpFMul": 133, + "OpUDiv": 134, + "OpSDiv": 135, + "OpFDiv": 136, + "OpUMod": 137, + "OpSRem": 138, + "OpSMod": 139, + "OpFRem": 140, + "OpFMod": 141, + "OpVectorTimesScalar": 142, + "OpMatrixTimesScalar": 143, + "OpVectorTimesMatrix": 144, + "OpMatrixTimesVector": 145, + "OpMatrixTimesMatrix": 146, + "OpOuterProduct": 147, + "OpDot": 148, + "OpIAddCarry": 149, + "OpISubBorrow": 150, + "OpUMulExtended": 151, + "OpSMulExtended": 152, + "OpAny": 154, + "OpAll": 155, + "OpIsNan": 156, + "OpIsInf": 157, + "OpIsFinite": 158, + "OpIsNormal": 159, + "OpSignBitSet": 160, + "OpLessOrGreater": 161, + "OpOrdered": 162, + "OpUnordered": 163, + "OpLogicalEqual": 164, + "OpLogicalNotEqual": 165, + "OpLogicalOr": 166, + "OpLogicalAnd": 167, + "OpLogicalNot": 168, + "OpSelect": 169, + "OpIEqual": 170, + "OpINotEqual": 171, + "OpUGreaterThan": 172, + "OpSGreaterThan": 173, + "OpUGreaterThanEqual": 174, + "OpSGreaterThanEqual": 175, + "OpULessThan": 176, + "OpSLessThan": 177, + "OpULessThanEqual": 178, + "OpSLessThanEqual": 179, + "OpFOrdEqual": 180, + "OpFUnordEqual": 181, + "OpFOrdNotEqual": 182, + "OpFUnordNotEqual": 183, + "OpFOrdLessThan": 184, + "OpFUnordLessThan": 185, + "OpFOrdGreaterThan": 186, + "OpFUnordGreaterThan": 187, + "OpFOrdLessThanEqual": 188, + "OpFUnordLessThanEqual": 189, + "OpFOrdGreaterThanEqual": 190, + "OpFUnordGreaterThanEqual": 191, + "OpShiftRightLogical": 194, + "OpShiftRightArithmetic": 195, + "OpShiftLeftLogical": 196, + "OpBitwiseOr": 197, + "OpBitwiseXor": 198, + "OpBitwiseAnd": 199, + "OpNot": 200, + "OpBitFieldInsert": 201, + "OpBitFieldSExtract": 202, + "OpBitFieldUExtract": 203, + "OpBitReverse": 204, + "OpBitCount": 205, + "OpDPdx": 207, + "OpDPdy": 208, + "OpFwidth": 209, + "OpDPdxFine": 210, + "OpDPdyFine": 211, + "OpFwidthFine": 212, + "OpDPdxCoarse": 213, + "OpDPdyCoarse": 214, + "OpFwidthCoarse": 215, + "OpEmitVertex": 218, + "OpEndPrimitive": 219, + "OpEmitStreamVertex": 220, + "OpEndStreamPrimitive": 221, + "OpControlBarrier": 224, + "OpMemoryBarrier": 225, + "OpAtomicLoad": 227, + "OpAtomicStore": 228, + "OpAtomicExchange": 229, + "OpAtomicCompareExchange": 230, + "OpAtomicCompareExchangeWeak": 231, + "OpAtomicIIncrement": 232, + "OpAtomicIDecrement": 233, + "OpAtomicIAdd": 234, + "OpAtomicISub": 235, + "OpAtomicSMin": 236, + "OpAtomicUMin": 237, + "OpAtomicSMax": 238, + "OpAtomicUMax": 239, + "OpAtomicAnd": 240, + "OpAtomicOr": 241, + "OpAtomicXor": 242, + "OpPhi": 245, + "OpLoopMerge": 246, + "OpSelectionMerge": 247, + "OpLabel": 248, + "OpBranch": 249, + "OpBranchConditional": 250, + "OpSwitch": 251, + "OpKill": 252, + "OpReturn": 253, + "OpReturnValue": 254, + "OpUnreachable": 255, + "OpLifetimeStart": 256, + "OpLifetimeStop": 257, + "OpGroupAsyncCopy": 259, + "OpGroupWaitEvents": 260, + "OpGroupAll": 261, + "OpGroupAny": 262, + "OpGroupBroadcast": 263, + "OpGroupIAdd": 264, + "OpGroupFAdd": 265, + "OpGroupFMin": 266, + "OpGroupUMin": 267, + "OpGroupSMin": 268, + "OpGroupFMax": 269, + "OpGroupUMax": 270, + "OpGroupSMax": 271, + "OpReadPipe": 274, + "OpWritePipe": 275, + "OpReservedReadPipe": 276, + "OpReservedWritePipe": 277, + "OpReserveReadPipePackets": 278, + "OpReserveWritePipePackets": 279, + "OpCommitReadPipe": 280, + "OpCommitWritePipe": 281, + "OpIsValidReserveId": 282, + "OpGetNumPipePackets": 283, + "OpGetMaxPipePackets": 284, + "OpGroupReserveReadPipePackets": 285, + "OpGroupReserveWritePipePackets": 286, + "OpGroupCommitReadPipe": 287, + "OpGroupCommitWritePipe": 288, + "OpEnqueueMarker": 291, + "OpEnqueueKernel": 292, + "OpGetKernelNDrangeSubGroupCount": 293, + "OpGetKernelNDrangeMaxSubGroupSize": 294, + "OpGetKernelWorkGroupSize": 295, + "OpGetKernelPreferredWorkGroupSizeMultiple": 296, + "OpRetainEvent": 297, + "OpReleaseEvent": 298, + "OpCreateUserEvent": 299, + "OpIsValidEvent": 300, + "OpSetUserEventStatus": 301, + "OpCaptureEventProfilingInfo": 302, + "OpGetDefaultQueue": 303, + "OpBuildNDRange": 304, + "OpImageSparseSampleImplicitLod": 305, + "OpImageSparseSampleExplicitLod": 306, + "OpImageSparseSampleDrefImplicitLod": 307, + "OpImageSparseSampleDrefExplicitLod": 308, + "OpImageSparseSampleProjImplicitLod": 309, + "OpImageSparseSampleProjExplicitLod": 310, + "OpImageSparseSampleProjDrefImplicitLod": 311, + "OpImageSparseSampleProjDrefExplicitLod": 312, + "OpImageSparseFetch": 313, + "OpImageSparseGather": 314, + "OpImageSparseDrefGather": 315, + "OpImageSparseTexelsResident": 316, + "OpNoLine": 317, + "OpAtomicFlagTestAndSet": 318, + "OpAtomicFlagClear": 319, + "OpImageSparseRead": 320, + "OpSizeOf": 321, + "OpTypePipeStorage": 322, + "OpConstantPipeStorage": 323, + "OpCreatePipeFromPipeStorage": 324, + "OpGetKernelLocalSizeForSubgroupCount": 325, + "OpGetKernelMaxNumSubgroups": 326, + "OpTypeNamedBarrier": 327, + "OpNamedBarrierInitialize": 328, + "OpMemoryNamedBarrier": 329, + "OpModuleProcessed": 330, + "OpDecorateId": 332, + "OpSubgroupBallotKHR": 4421, + "OpSubgroupFirstInvocationKHR": 4422, + "OpSubgroupAllKHR": 4428, + "OpSubgroupAnyKHR": 4429, + "OpSubgroupAllEqualKHR": 4430, + "OpSubgroupReadInvocationKHR": 4432, + "OpGroupIAddNonUniformAMD": 5000, + "OpGroupFAddNonUniformAMD": 5001, + "OpGroupFMinNonUniformAMD": 5002, + "OpGroupUMinNonUniformAMD": 5003, + "OpGroupSMinNonUniformAMD": 5004, + "OpGroupFMaxNonUniformAMD": 5005, + "OpGroupUMaxNonUniformAMD": 5006, + "OpGroupSMaxNonUniformAMD": 5007, + "OpFragmentMaskFetchAMD": 5011, + "OpFragmentFetchAMD": 5012, + "OpSubgroupShuffleINTEL": 5571, + "OpSubgroupShuffleDownINTEL": 5572, + "OpSubgroupShuffleUpINTEL": 5573, + "OpSubgroupShuffleXorINTEL": 5574, + "OpSubgroupBlockReadINTEL": 5575, + "OpSubgroupBlockWriteINTEL": 5576, + "OpSubgroupImageBlockReadINTEL": 5577, + "OpSubgroupImageBlockWriteINTEL": 5578, + "OpDecorateStringGOOGLE": 5632, + "OpMemberDecorateStringGOOGLE": 5633 + } + } + ] + } +} + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.lua vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.lua --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.lua 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.lua 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,971 @@ +-- Copyright (c) 2014-2018 The Khronos Group Inc. +-- +-- Permission is hereby granted, free of charge, to any person obtaining a copy +-- of this software and/or associated documentation files (the "Materials"), +-- to deal in the Materials without restriction, including without limitation +-- the rights to use, copy, modify, merge, publish, distribute, sublicense, +-- and/or sell copies of the Materials, and to permit persons to whom the +-- Materials are furnished to do so, subject to the following conditions: +-- +-- The above copyright notice and this permission notice shall be included in +-- all copies or substantial portions of the Materials. +-- +-- MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +-- STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +-- HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +-- +-- THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +-- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +-- FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +-- IN THE MATERIALS. + +-- This header is automatically generated by the same tool that creates +-- the Binary Section of the SPIR-V specification. + +-- Enumeration tokens for SPIR-V, in various styles: +-- C, C++, C++11, JSON, Lua, Python +-- +-- - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +-- - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +-- - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +-- - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +-- - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +-- +-- Some tokens act like mask values, which can be OR'd together, +-- while others are mutually exclusive. The mask-like ones have +-- "Mask" in their name, and a parallel enum that has the shift +-- amount (1 << x) for each corresponding enumerant. + +spv = { + MagicNumber = 0x07230203, + Version = 0x00010100, + Revision = 8, + OpCodeMask = 0xffff, + WordCountShift = 16, + + SourceLanguage = { + Unknown = 0, + ESSL = 1, + GLSL = 2, + OpenCL_C = 3, + OpenCL_CPP = 4, + HLSL = 5, + }, + + ExecutionModel = { + Vertex = 0, + TessellationControl = 1, + TessellationEvaluation = 2, + Geometry = 3, + Fragment = 4, + GLCompute = 5, + Kernel = 6, + }, + + AddressingModel = { + Logical = 0, + Physical32 = 1, + Physical64 = 2, + }, + + MemoryModel = { + Simple = 0, + GLSL450 = 1, + OpenCL = 2, + }, + + ExecutionMode = { + Invocations = 0, + SpacingEqual = 1, + SpacingFractionalEven = 2, + SpacingFractionalOdd = 3, + VertexOrderCw = 4, + VertexOrderCcw = 5, + PixelCenterInteger = 6, + OriginUpperLeft = 7, + OriginLowerLeft = 8, + EarlyFragmentTests = 9, + PointMode = 10, + Xfb = 11, + DepthReplacing = 12, + DepthGreater = 14, + DepthLess = 15, + DepthUnchanged = 16, + LocalSize = 17, + LocalSizeHint = 18, + InputPoints = 19, + InputLines = 20, + InputLinesAdjacency = 21, + Triangles = 22, + InputTrianglesAdjacency = 23, + Quads = 24, + Isolines = 25, + OutputVertices = 26, + OutputPoints = 27, + OutputLineStrip = 28, + OutputTriangleStrip = 29, + VecTypeHint = 30, + ContractionOff = 31, + Initializer = 33, + Finalizer = 34, + SubgroupSize = 35, + SubgroupsPerWorkgroup = 36, + PostDepthCoverage = 4446, + StencilRefReplacingEXT = 5027, + }, + + StorageClass = { + UniformConstant = 0, + Input = 1, + Uniform = 2, + Output = 3, + Workgroup = 4, + CrossWorkgroup = 5, + Private = 6, + Function = 7, + Generic = 8, + PushConstant = 9, + AtomicCounter = 10, + Image = 11, + StorageBuffer = 12, + }, + + Dim = { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + Cube = 3, + Rect = 4, + Buffer = 5, + SubpassData = 6, + }, + + SamplerAddressingMode = { + None = 0, + ClampToEdge = 1, + Clamp = 2, + Repeat = 3, + RepeatMirrored = 4, + }, + + SamplerFilterMode = { + Nearest = 0, + Linear = 1, + }, + + ImageFormat = { + Unknown = 0, + Rgba32f = 1, + Rgba16f = 2, + R32f = 3, + Rgba8 = 4, + Rgba8Snorm = 5, + Rg32f = 6, + Rg16f = 7, + R11fG11fB10f = 8, + R16f = 9, + Rgba16 = 10, + Rgb10A2 = 11, + Rg16 = 12, + Rg8 = 13, + R16 = 14, + R8 = 15, + Rgba16Snorm = 16, + Rg16Snorm = 17, + Rg8Snorm = 18, + R16Snorm = 19, + R8Snorm = 20, + Rgba32i = 21, + Rgba16i = 22, + Rgba8i = 23, + R32i = 24, + Rg32i = 25, + Rg16i = 26, + Rg8i = 27, + R16i = 28, + R8i = 29, + Rgba32ui = 30, + Rgba16ui = 31, + Rgba8ui = 32, + R32ui = 33, + Rgb10a2ui = 34, + Rg32ui = 35, + Rg16ui = 36, + Rg8ui = 37, + R16ui = 38, + R8ui = 39, + }, + + ImageChannelOrder = { + R = 0, + A = 1, + RG = 2, + RA = 3, + RGB = 4, + RGBA = 5, + BGRA = 6, + ARGB = 7, + Intensity = 8, + Luminance = 9, + Rx = 10, + RGx = 11, + RGBx = 12, + Depth = 13, + DepthStencil = 14, + sRGB = 15, + sRGBx = 16, + sRGBA = 17, + sBGRA = 18, + ABGR = 19, + }, + + ImageChannelDataType = { + SnormInt8 = 0, + SnormInt16 = 1, + UnormInt8 = 2, + UnormInt16 = 3, + UnormShort565 = 4, + UnormShort555 = 5, + UnormInt101010 = 6, + SignedInt8 = 7, + SignedInt16 = 8, + SignedInt32 = 9, + UnsignedInt8 = 10, + UnsignedInt16 = 11, + UnsignedInt32 = 12, + HalfFloat = 13, + Float = 14, + UnormInt24 = 15, + UnormInt101010_2 = 16, + }, + + ImageOperandsShift = { + Bias = 0, + Lod = 1, + Grad = 2, + ConstOffset = 3, + Offset = 4, + ConstOffsets = 5, + Sample = 6, + MinLod = 7, + }, + + ImageOperandsMask = { + MaskNone = 0, + Bias = 0x00000001, + Lod = 0x00000002, + Grad = 0x00000004, + ConstOffset = 0x00000008, + Offset = 0x00000010, + ConstOffsets = 0x00000020, + Sample = 0x00000040, + MinLod = 0x00000080, + }, + + FPFastMathModeShift = { + NotNaN = 0, + NotInf = 1, + NSZ = 2, + AllowRecip = 3, + Fast = 4, + }, + + FPFastMathModeMask = { + MaskNone = 0, + NotNaN = 0x00000001, + NotInf = 0x00000002, + NSZ = 0x00000004, + AllowRecip = 0x00000008, + Fast = 0x00000010, + }, + + FPRoundingMode = { + RTE = 0, + RTZ = 1, + RTP = 2, + RTN = 3, + }, + + LinkageType = { + Export = 0, + Import = 1, + }, + + AccessQualifier = { + ReadOnly = 0, + WriteOnly = 1, + ReadWrite = 2, + }, + + FunctionParameterAttribute = { + Zext = 0, + Sext = 1, + ByVal = 2, + Sret = 3, + NoAlias = 4, + NoCapture = 5, + NoWrite = 6, + NoReadWrite = 7, + }, + + Decoration = { + RelaxedPrecision = 0, + SpecId = 1, + Block = 2, + BufferBlock = 3, + RowMajor = 4, + ColMajor = 5, + ArrayStride = 6, + MatrixStride = 7, + GLSLShared = 8, + GLSLPacked = 9, + CPacked = 10, + BuiltIn = 11, + NoPerspective = 13, + Flat = 14, + Patch = 15, + Centroid = 16, + Sample = 17, + Invariant = 18, + Restrict = 19, + Aliased = 20, + Volatile = 21, + Constant = 22, + Coherent = 23, + NonWritable = 24, + NonReadable = 25, + Uniform = 26, + SaturatedConversion = 28, + Stream = 29, + Location = 30, + Component = 31, + Index = 32, + Binding = 33, + DescriptorSet = 34, + Offset = 35, + XfbBuffer = 36, + XfbStride = 37, + FuncParamAttr = 38, + FPRoundingMode = 39, + FPFastMathMode = 40, + LinkageAttributes = 41, + NoContraction = 42, + InputAttachmentIndex = 43, + Alignment = 44, + MaxByteOffset = 45, + ExplicitInterpAMD = 4999, + OverrideCoverageNV = 5248, + PassthroughNV = 5250, + ViewportRelativeNV = 5252, + SecondaryViewportRelativeNV = 5256, + HlslCounterBufferGOOGLE = 5634, + HlslSemanticGOOGLE = 5635, + }, + + BuiltIn = { + Position = 0, + PointSize = 1, + ClipDistance = 3, + CullDistance = 4, + VertexId = 5, + InstanceId = 6, + PrimitiveId = 7, + InvocationId = 8, + Layer = 9, + ViewportIndex = 10, + TessLevelOuter = 11, + TessLevelInner = 12, + TessCoord = 13, + PatchVertices = 14, + FragCoord = 15, + PointCoord = 16, + FrontFacing = 17, + SampleId = 18, + SamplePosition = 19, + SampleMask = 20, + FragDepth = 22, + HelperInvocation = 23, + NumWorkgroups = 24, + WorkgroupSize = 25, + WorkgroupId = 26, + LocalInvocationId = 27, + GlobalInvocationId = 28, + LocalInvocationIndex = 29, + WorkDim = 30, + GlobalSize = 31, + EnqueuedWorkgroupSize = 32, + GlobalOffset = 33, + GlobalLinearId = 34, + SubgroupSize = 36, + SubgroupMaxSize = 37, + NumSubgroups = 38, + NumEnqueuedSubgroups = 39, + SubgroupId = 40, + SubgroupLocalInvocationId = 41, + VertexIndex = 42, + InstanceIndex = 43, + SubgroupEqMaskKHR = 4416, + SubgroupGeMaskKHR = 4417, + SubgroupGtMaskKHR = 4418, + SubgroupLeMaskKHR = 4419, + SubgroupLtMaskKHR = 4420, + BaseVertex = 4424, + BaseInstance = 4425, + DrawIndex = 4426, + DeviceIndex = 4438, + ViewIndex = 4440, + BaryCoordNoPerspAMD = 4992, + BaryCoordNoPerspCentroidAMD = 4993, + BaryCoordNoPerspSampleAMD = 4994, + BaryCoordSmoothAMD = 4995, + BaryCoordSmoothCentroidAMD = 4996, + BaryCoordSmoothSampleAMD = 4997, + BaryCoordPullModelAMD = 4998, + FragStencilRefEXT = 5014, + ViewportMaskNV = 5253, + SecondaryPositionNV = 5257, + SecondaryViewportMaskNV = 5258, + PositionPerViewNV = 5261, + ViewportMaskPerViewNV = 5262, + }, + + SelectionControlShift = { + Flatten = 0, + DontFlatten = 1, + }, + + SelectionControlMask = { + MaskNone = 0, + Flatten = 0x00000001, + DontFlatten = 0x00000002, + }, + + LoopControlShift = { + Unroll = 0, + DontUnroll = 1, + DependencyInfinite = 2, + DependencyLength = 3, + }, + + LoopControlMask = { + MaskNone = 0, + Unroll = 0x00000001, + DontUnroll = 0x00000002, + DependencyInfinite = 0x00000004, + DependencyLength = 0x00000008, + }, + + FunctionControlShift = { + Inline = 0, + DontInline = 1, + Pure = 2, + Const = 3, + }, + + FunctionControlMask = { + MaskNone = 0, + Inline = 0x00000001, + DontInline = 0x00000002, + Pure = 0x00000004, + Const = 0x00000008, + }, + + MemorySemanticsShift = { + Acquire = 1, + Release = 2, + AcquireRelease = 3, + SequentiallyConsistent = 4, + UniformMemory = 6, + SubgroupMemory = 7, + WorkgroupMemory = 8, + CrossWorkgroupMemory = 9, + AtomicCounterMemory = 10, + ImageMemory = 11, + }, + + MemorySemanticsMask = { + MaskNone = 0, + Acquire = 0x00000002, + Release = 0x00000004, + AcquireRelease = 0x00000008, + SequentiallyConsistent = 0x00000010, + UniformMemory = 0x00000040, + SubgroupMemory = 0x00000080, + WorkgroupMemory = 0x00000100, + CrossWorkgroupMemory = 0x00000200, + AtomicCounterMemory = 0x00000400, + ImageMemory = 0x00000800, + }, + + MemoryAccessShift = { + Volatile = 0, + Aligned = 1, + Nontemporal = 2, + }, + + MemoryAccessMask = { + MaskNone = 0, + Volatile = 0x00000001, + Aligned = 0x00000002, + Nontemporal = 0x00000004, + }, + + Scope = { + CrossDevice = 0, + Device = 1, + Workgroup = 2, + Subgroup = 3, + Invocation = 4, + }, + + GroupOperation = { + Reduce = 0, + InclusiveScan = 1, + ExclusiveScan = 2, + }, + + KernelEnqueueFlags = { + NoWait = 0, + WaitKernel = 1, + WaitWorkGroup = 2, + }, + + KernelProfilingInfoShift = { + CmdExecTime = 0, + }, + + KernelProfilingInfoMask = { + MaskNone = 0, + CmdExecTime = 0x00000001, + }, + + Capability = { + Matrix = 0, + Shader = 1, + Geometry = 2, + Tessellation = 3, + Addresses = 4, + Linkage = 5, + Kernel = 6, + Vector16 = 7, + Float16Buffer = 8, + Float16 = 9, + Float64 = 10, + Int64 = 11, + Int64Atomics = 12, + ImageBasic = 13, + ImageReadWrite = 14, + ImageMipmap = 15, + Pipes = 17, + Groups = 18, + DeviceEnqueue = 19, + LiteralSampler = 20, + AtomicStorage = 21, + Int16 = 22, + TessellationPointSize = 23, + GeometryPointSize = 24, + ImageGatherExtended = 25, + StorageImageMultisample = 27, + UniformBufferArrayDynamicIndexing = 28, + SampledImageArrayDynamicIndexing = 29, + StorageBufferArrayDynamicIndexing = 30, + StorageImageArrayDynamicIndexing = 31, + ClipDistance = 32, + CullDistance = 33, + ImageCubeArray = 34, + SampleRateShading = 35, + ImageRect = 36, + SampledRect = 37, + GenericPointer = 38, + Int8 = 39, + InputAttachment = 40, + SparseResidency = 41, + MinLod = 42, + Sampled1D = 43, + Image1D = 44, + SampledCubeArray = 45, + SampledBuffer = 46, + ImageBuffer = 47, + ImageMSArray = 48, + StorageImageExtendedFormats = 49, + ImageQuery = 50, + DerivativeControl = 51, + InterpolationFunction = 52, + TransformFeedback = 53, + GeometryStreams = 54, + StorageImageReadWithoutFormat = 55, + StorageImageWriteWithoutFormat = 56, + MultiViewport = 57, + SubgroupDispatch = 58, + NamedBarrier = 59, + PipeStorage = 60, + SubgroupBallotKHR = 4423, + DrawParameters = 4427, + SubgroupVoteKHR = 4431, + StorageBuffer16BitAccess = 4433, + StorageUniformBufferBlock16 = 4433, + StorageUniform16 = 4434, + UniformAndStorageBuffer16BitAccess = 4434, + StoragePushConstant16 = 4435, + StorageInputOutput16 = 4436, + DeviceGroup = 4437, + MultiView = 4439, + VariablePointersStorageBuffer = 4441, + VariablePointers = 4442, + AtomicStorageOps = 4445, + SampleMaskPostDepthCoverage = 4447, + ImageGatherBiasLodAMD = 5009, + FragmentMaskAMD = 5010, + StencilExportEXT = 5013, + ImageReadWriteLodAMD = 5015, + SampleMaskOverrideCoverageNV = 5249, + GeometryShaderPassthroughNV = 5251, + ShaderViewportIndexLayerEXT = 5254, + ShaderViewportIndexLayerNV = 5254, + ShaderViewportMaskNV = 5255, + ShaderStereoViewNV = 5259, + PerViewAttributesNV = 5260, + SubgroupShuffleINTEL = 5568, + SubgroupBufferBlockIOINTEL = 5569, + SubgroupImageBlockIOINTEL = 5570, + }, + + Op = { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpDecorateId = 332, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpSubgroupReadInvocationKHR = 4432, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateStringGOOGLE = 5633, + }, + +} + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.py vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.py --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.py 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.py 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,971 @@ +# Copyright (c) 2014-2018 The Khronos Group Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and/or associated documentation files (the "Materials"), +# to deal in the Materials without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Materials, and to permit persons to whom the +# Materials are furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Materials. +# +# MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +# STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +# HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +# +# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +# IN THE MATERIALS. + +# This header is automatically generated by the same tool that creates +# the Binary Section of the SPIR-V specification. + +# Enumeration tokens for SPIR-V, in various styles: +# C, C++, C++11, JSON, Lua, Python +# +# - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +# - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +# - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +# - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +# - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +# +# Some tokens act like mask values, which can be OR'd together, +# while others are mutually exclusive. The mask-like ones have +# "Mask" in their name, and a parallel enum that has the shift +# amount (1 << x) for each corresponding enumerant. + +spv = { + 'MagicNumber' : 0x07230203, + 'Version' : 0x00010100, + 'Revision' : 8, + 'OpCodeMask' : 0xffff, + 'WordCountShift' : 16, + + 'SourceLanguage' : { + 'Unknown' : 0, + 'ESSL' : 1, + 'GLSL' : 2, + 'OpenCL_C' : 3, + 'OpenCL_CPP' : 4, + 'HLSL' : 5, + }, + + 'ExecutionModel' : { + 'Vertex' : 0, + 'TessellationControl' : 1, + 'TessellationEvaluation' : 2, + 'Geometry' : 3, + 'Fragment' : 4, + 'GLCompute' : 5, + 'Kernel' : 6, + }, + + 'AddressingModel' : { + 'Logical' : 0, + 'Physical32' : 1, + 'Physical64' : 2, + }, + + 'MemoryModel' : { + 'Simple' : 0, + 'GLSL450' : 1, + 'OpenCL' : 2, + }, + + 'ExecutionMode' : { + 'Invocations' : 0, + 'SpacingEqual' : 1, + 'SpacingFractionalEven' : 2, + 'SpacingFractionalOdd' : 3, + 'VertexOrderCw' : 4, + 'VertexOrderCcw' : 5, + 'PixelCenterInteger' : 6, + 'OriginUpperLeft' : 7, + 'OriginLowerLeft' : 8, + 'EarlyFragmentTests' : 9, + 'PointMode' : 10, + 'Xfb' : 11, + 'DepthReplacing' : 12, + 'DepthGreater' : 14, + 'DepthLess' : 15, + 'DepthUnchanged' : 16, + 'LocalSize' : 17, + 'LocalSizeHint' : 18, + 'InputPoints' : 19, + 'InputLines' : 20, + 'InputLinesAdjacency' : 21, + 'Triangles' : 22, + 'InputTrianglesAdjacency' : 23, + 'Quads' : 24, + 'Isolines' : 25, + 'OutputVertices' : 26, + 'OutputPoints' : 27, + 'OutputLineStrip' : 28, + 'OutputTriangleStrip' : 29, + 'VecTypeHint' : 30, + 'ContractionOff' : 31, + 'Initializer' : 33, + 'Finalizer' : 34, + 'SubgroupSize' : 35, + 'SubgroupsPerWorkgroup' : 36, + 'PostDepthCoverage' : 4446, + 'StencilRefReplacingEXT' : 5027, + }, + + 'StorageClass' : { + 'UniformConstant' : 0, + 'Input' : 1, + 'Uniform' : 2, + 'Output' : 3, + 'Workgroup' : 4, + 'CrossWorkgroup' : 5, + 'Private' : 6, + 'Function' : 7, + 'Generic' : 8, + 'PushConstant' : 9, + 'AtomicCounter' : 10, + 'Image' : 11, + 'StorageBuffer' : 12, + }, + + 'Dim' : { + 'Dim1D' : 0, + 'Dim2D' : 1, + 'Dim3D' : 2, + 'Cube' : 3, + 'Rect' : 4, + 'Buffer' : 5, + 'SubpassData' : 6, + }, + + 'SamplerAddressingMode' : { + 'None' : 0, + 'ClampToEdge' : 1, + 'Clamp' : 2, + 'Repeat' : 3, + 'RepeatMirrored' : 4, + }, + + 'SamplerFilterMode' : { + 'Nearest' : 0, + 'Linear' : 1, + }, + + 'ImageFormat' : { + 'Unknown' : 0, + 'Rgba32f' : 1, + 'Rgba16f' : 2, + 'R32f' : 3, + 'Rgba8' : 4, + 'Rgba8Snorm' : 5, + 'Rg32f' : 6, + 'Rg16f' : 7, + 'R11fG11fB10f' : 8, + 'R16f' : 9, + 'Rgba16' : 10, + 'Rgb10A2' : 11, + 'Rg16' : 12, + 'Rg8' : 13, + 'R16' : 14, + 'R8' : 15, + 'Rgba16Snorm' : 16, + 'Rg16Snorm' : 17, + 'Rg8Snorm' : 18, + 'R16Snorm' : 19, + 'R8Snorm' : 20, + 'Rgba32i' : 21, + 'Rgba16i' : 22, + 'Rgba8i' : 23, + 'R32i' : 24, + 'Rg32i' : 25, + 'Rg16i' : 26, + 'Rg8i' : 27, + 'R16i' : 28, + 'R8i' : 29, + 'Rgba32ui' : 30, + 'Rgba16ui' : 31, + 'Rgba8ui' : 32, + 'R32ui' : 33, + 'Rgb10a2ui' : 34, + 'Rg32ui' : 35, + 'Rg16ui' : 36, + 'Rg8ui' : 37, + 'R16ui' : 38, + 'R8ui' : 39, + }, + + 'ImageChannelOrder' : { + 'R' : 0, + 'A' : 1, + 'RG' : 2, + 'RA' : 3, + 'RGB' : 4, + 'RGBA' : 5, + 'BGRA' : 6, + 'ARGB' : 7, + 'Intensity' : 8, + 'Luminance' : 9, + 'Rx' : 10, + 'RGx' : 11, + 'RGBx' : 12, + 'Depth' : 13, + 'DepthStencil' : 14, + 'sRGB' : 15, + 'sRGBx' : 16, + 'sRGBA' : 17, + 'sBGRA' : 18, + 'ABGR' : 19, + }, + + 'ImageChannelDataType' : { + 'SnormInt8' : 0, + 'SnormInt16' : 1, + 'UnormInt8' : 2, + 'UnormInt16' : 3, + 'UnormShort565' : 4, + 'UnormShort555' : 5, + 'UnormInt101010' : 6, + 'SignedInt8' : 7, + 'SignedInt16' : 8, + 'SignedInt32' : 9, + 'UnsignedInt8' : 10, + 'UnsignedInt16' : 11, + 'UnsignedInt32' : 12, + 'HalfFloat' : 13, + 'Float' : 14, + 'UnormInt24' : 15, + 'UnormInt101010_2' : 16, + }, + + 'ImageOperandsShift' : { + 'Bias' : 0, + 'Lod' : 1, + 'Grad' : 2, + 'ConstOffset' : 3, + 'Offset' : 4, + 'ConstOffsets' : 5, + 'Sample' : 6, + 'MinLod' : 7, + }, + + 'ImageOperandsMask' : { + 'MaskNone' : 0, + 'Bias' : 0x00000001, + 'Lod' : 0x00000002, + 'Grad' : 0x00000004, + 'ConstOffset' : 0x00000008, + 'Offset' : 0x00000010, + 'ConstOffsets' : 0x00000020, + 'Sample' : 0x00000040, + 'MinLod' : 0x00000080, + }, + + 'FPFastMathModeShift' : { + 'NotNaN' : 0, + 'NotInf' : 1, + 'NSZ' : 2, + 'AllowRecip' : 3, + 'Fast' : 4, + }, + + 'FPFastMathModeMask' : { + 'MaskNone' : 0, + 'NotNaN' : 0x00000001, + 'NotInf' : 0x00000002, + 'NSZ' : 0x00000004, + 'AllowRecip' : 0x00000008, + 'Fast' : 0x00000010, + }, + + 'FPRoundingMode' : { + 'RTE' : 0, + 'RTZ' : 1, + 'RTP' : 2, + 'RTN' : 3, + }, + + 'LinkageType' : { + 'Export' : 0, + 'Import' : 1, + }, + + 'AccessQualifier' : { + 'ReadOnly' : 0, + 'WriteOnly' : 1, + 'ReadWrite' : 2, + }, + + 'FunctionParameterAttribute' : { + 'Zext' : 0, + 'Sext' : 1, + 'ByVal' : 2, + 'Sret' : 3, + 'NoAlias' : 4, + 'NoCapture' : 5, + 'NoWrite' : 6, + 'NoReadWrite' : 7, + }, + + 'Decoration' : { + 'RelaxedPrecision' : 0, + 'SpecId' : 1, + 'Block' : 2, + 'BufferBlock' : 3, + 'RowMajor' : 4, + 'ColMajor' : 5, + 'ArrayStride' : 6, + 'MatrixStride' : 7, + 'GLSLShared' : 8, + 'GLSLPacked' : 9, + 'CPacked' : 10, + 'BuiltIn' : 11, + 'NoPerspective' : 13, + 'Flat' : 14, + 'Patch' : 15, + 'Centroid' : 16, + 'Sample' : 17, + 'Invariant' : 18, + 'Restrict' : 19, + 'Aliased' : 20, + 'Volatile' : 21, + 'Constant' : 22, + 'Coherent' : 23, + 'NonWritable' : 24, + 'NonReadable' : 25, + 'Uniform' : 26, + 'SaturatedConversion' : 28, + 'Stream' : 29, + 'Location' : 30, + 'Component' : 31, + 'Index' : 32, + 'Binding' : 33, + 'DescriptorSet' : 34, + 'Offset' : 35, + 'XfbBuffer' : 36, + 'XfbStride' : 37, + 'FuncParamAttr' : 38, + 'FPRoundingMode' : 39, + 'FPFastMathMode' : 40, + 'LinkageAttributes' : 41, + 'NoContraction' : 42, + 'InputAttachmentIndex' : 43, + 'Alignment' : 44, + 'MaxByteOffset' : 45, + 'ExplicitInterpAMD' : 4999, + 'OverrideCoverageNV' : 5248, + 'PassthroughNV' : 5250, + 'ViewportRelativeNV' : 5252, + 'SecondaryViewportRelativeNV' : 5256, + 'HlslCounterBufferGOOGLE' : 5634, + 'HlslSemanticGOOGLE' : 5635, + }, + + 'BuiltIn' : { + 'Position' : 0, + 'PointSize' : 1, + 'ClipDistance' : 3, + 'CullDistance' : 4, + 'VertexId' : 5, + 'InstanceId' : 6, + 'PrimitiveId' : 7, + 'InvocationId' : 8, + 'Layer' : 9, + 'ViewportIndex' : 10, + 'TessLevelOuter' : 11, + 'TessLevelInner' : 12, + 'TessCoord' : 13, + 'PatchVertices' : 14, + 'FragCoord' : 15, + 'PointCoord' : 16, + 'FrontFacing' : 17, + 'SampleId' : 18, + 'SamplePosition' : 19, + 'SampleMask' : 20, + 'FragDepth' : 22, + 'HelperInvocation' : 23, + 'NumWorkgroups' : 24, + 'WorkgroupSize' : 25, + 'WorkgroupId' : 26, + 'LocalInvocationId' : 27, + 'GlobalInvocationId' : 28, + 'LocalInvocationIndex' : 29, + 'WorkDim' : 30, + 'GlobalSize' : 31, + 'EnqueuedWorkgroupSize' : 32, + 'GlobalOffset' : 33, + 'GlobalLinearId' : 34, + 'SubgroupSize' : 36, + 'SubgroupMaxSize' : 37, + 'NumSubgroups' : 38, + 'NumEnqueuedSubgroups' : 39, + 'SubgroupId' : 40, + 'SubgroupLocalInvocationId' : 41, + 'VertexIndex' : 42, + 'InstanceIndex' : 43, + 'SubgroupEqMaskKHR' : 4416, + 'SubgroupGeMaskKHR' : 4417, + 'SubgroupGtMaskKHR' : 4418, + 'SubgroupLeMaskKHR' : 4419, + 'SubgroupLtMaskKHR' : 4420, + 'BaseVertex' : 4424, + 'BaseInstance' : 4425, + 'DrawIndex' : 4426, + 'DeviceIndex' : 4438, + 'ViewIndex' : 4440, + 'BaryCoordNoPerspAMD' : 4992, + 'BaryCoordNoPerspCentroidAMD' : 4993, + 'BaryCoordNoPerspSampleAMD' : 4994, + 'BaryCoordSmoothAMD' : 4995, + 'BaryCoordSmoothCentroidAMD' : 4996, + 'BaryCoordSmoothSampleAMD' : 4997, + 'BaryCoordPullModelAMD' : 4998, + 'FragStencilRefEXT' : 5014, + 'ViewportMaskNV' : 5253, + 'SecondaryPositionNV' : 5257, + 'SecondaryViewportMaskNV' : 5258, + 'PositionPerViewNV' : 5261, + 'ViewportMaskPerViewNV' : 5262, + }, + + 'SelectionControlShift' : { + 'Flatten' : 0, + 'DontFlatten' : 1, + }, + + 'SelectionControlMask' : { + 'MaskNone' : 0, + 'Flatten' : 0x00000001, + 'DontFlatten' : 0x00000002, + }, + + 'LoopControlShift' : { + 'Unroll' : 0, + 'DontUnroll' : 1, + 'DependencyInfinite' : 2, + 'DependencyLength' : 3, + }, + + 'LoopControlMask' : { + 'MaskNone' : 0, + 'Unroll' : 0x00000001, + 'DontUnroll' : 0x00000002, + 'DependencyInfinite' : 0x00000004, + 'DependencyLength' : 0x00000008, + }, + + 'FunctionControlShift' : { + 'Inline' : 0, + 'DontInline' : 1, + 'Pure' : 2, + 'Const' : 3, + }, + + 'FunctionControlMask' : { + 'MaskNone' : 0, + 'Inline' : 0x00000001, + 'DontInline' : 0x00000002, + 'Pure' : 0x00000004, + 'Const' : 0x00000008, + }, + + 'MemorySemanticsShift' : { + 'Acquire' : 1, + 'Release' : 2, + 'AcquireRelease' : 3, + 'SequentiallyConsistent' : 4, + 'UniformMemory' : 6, + 'SubgroupMemory' : 7, + 'WorkgroupMemory' : 8, + 'CrossWorkgroupMemory' : 9, + 'AtomicCounterMemory' : 10, + 'ImageMemory' : 11, + }, + + 'MemorySemanticsMask' : { + 'MaskNone' : 0, + 'Acquire' : 0x00000002, + 'Release' : 0x00000004, + 'AcquireRelease' : 0x00000008, + 'SequentiallyConsistent' : 0x00000010, + 'UniformMemory' : 0x00000040, + 'SubgroupMemory' : 0x00000080, + 'WorkgroupMemory' : 0x00000100, + 'CrossWorkgroupMemory' : 0x00000200, + 'AtomicCounterMemory' : 0x00000400, + 'ImageMemory' : 0x00000800, + }, + + 'MemoryAccessShift' : { + 'Volatile' : 0, + 'Aligned' : 1, + 'Nontemporal' : 2, + }, + + 'MemoryAccessMask' : { + 'MaskNone' : 0, + 'Volatile' : 0x00000001, + 'Aligned' : 0x00000002, + 'Nontemporal' : 0x00000004, + }, + + 'Scope' : { + 'CrossDevice' : 0, + 'Device' : 1, + 'Workgroup' : 2, + 'Subgroup' : 3, + 'Invocation' : 4, + }, + + 'GroupOperation' : { + 'Reduce' : 0, + 'InclusiveScan' : 1, + 'ExclusiveScan' : 2, + }, + + 'KernelEnqueueFlags' : { + 'NoWait' : 0, + 'WaitKernel' : 1, + 'WaitWorkGroup' : 2, + }, + + 'KernelProfilingInfoShift' : { + 'CmdExecTime' : 0, + }, + + 'KernelProfilingInfoMask' : { + 'MaskNone' : 0, + 'CmdExecTime' : 0x00000001, + }, + + 'Capability' : { + 'Matrix' : 0, + 'Shader' : 1, + 'Geometry' : 2, + 'Tessellation' : 3, + 'Addresses' : 4, + 'Linkage' : 5, + 'Kernel' : 6, + 'Vector16' : 7, + 'Float16Buffer' : 8, + 'Float16' : 9, + 'Float64' : 10, + 'Int64' : 11, + 'Int64Atomics' : 12, + 'ImageBasic' : 13, + 'ImageReadWrite' : 14, + 'ImageMipmap' : 15, + 'Pipes' : 17, + 'Groups' : 18, + 'DeviceEnqueue' : 19, + 'LiteralSampler' : 20, + 'AtomicStorage' : 21, + 'Int16' : 22, + 'TessellationPointSize' : 23, + 'GeometryPointSize' : 24, + 'ImageGatherExtended' : 25, + 'StorageImageMultisample' : 27, + 'UniformBufferArrayDynamicIndexing' : 28, + 'SampledImageArrayDynamicIndexing' : 29, + 'StorageBufferArrayDynamicIndexing' : 30, + 'StorageImageArrayDynamicIndexing' : 31, + 'ClipDistance' : 32, + 'CullDistance' : 33, + 'ImageCubeArray' : 34, + 'SampleRateShading' : 35, + 'ImageRect' : 36, + 'SampledRect' : 37, + 'GenericPointer' : 38, + 'Int8' : 39, + 'InputAttachment' : 40, + 'SparseResidency' : 41, + 'MinLod' : 42, + 'Sampled1D' : 43, + 'Image1D' : 44, + 'SampledCubeArray' : 45, + 'SampledBuffer' : 46, + 'ImageBuffer' : 47, + 'ImageMSArray' : 48, + 'StorageImageExtendedFormats' : 49, + 'ImageQuery' : 50, + 'DerivativeControl' : 51, + 'InterpolationFunction' : 52, + 'TransformFeedback' : 53, + 'GeometryStreams' : 54, + 'StorageImageReadWithoutFormat' : 55, + 'StorageImageWriteWithoutFormat' : 56, + 'MultiViewport' : 57, + 'SubgroupDispatch' : 58, + 'NamedBarrier' : 59, + 'PipeStorage' : 60, + 'SubgroupBallotKHR' : 4423, + 'DrawParameters' : 4427, + 'SubgroupVoteKHR' : 4431, + 'StorageBuffer16BitAccess' : 4433, + 'StorageUniformBufferBlock16' : 4433, + 'StorageUniform16' : 4434, + 'UniformAndStorageBuffer16BitAccess' : 4434, + 'StoragePushConstant16' : 4435, + 'StorageInputOutput16' : 4436, + 'DeviceGroup' : 4437, + 'MultiView' : 4439, + 'VariablePointersStorageBuffer' : 4441, + 'VariablePointers' : 4442, + 'AtomicStorageOps' : 4445, + 'SampleMaskPostDepthCoverage' : 4447, + 'ImageGatherBiasLodAMD' : 5009, + 'FragmentMaskAMD' : 5010, + 'StencilExportEXT' : 5013, + 'ImageReadWriteLodAMD' : 5015, + 'SampleMaskOverrideCoverageNV' : 5249, + 'GeometryShaderPassthroughNV' : 5251, + 'ShaderViewportIndexLayerEXT' : 5254, + 'ShaderViewportIndexLayerNV' : 5254, + 'ShaderViewportMaskNV' : 5255, + 'ShaderStereoViewNV' : 5259, + 'PerViewAttributesNV' : 5260, + 'SubgroupShuffleINTEL' : 5568, + 'SubgroupBufferBlockIOINTEL' : 5569, + 'SubgroupImageBlockIOINTEL' : 5570, + }, + + 'Op' : { + 'OpNop' : 0, + 'OpUndef' : 1, + 'OpSourceContinued' : 2, + 'OpSource' : 3, + 'OpSourceExtension' : 4, + 'OpName' : 5, + 'OpMemberName' : 6, + 'OpString' : 7, + 'OpLine' : 8, + 'OpExtension' : 10, + 'OpExtInstImport' : 11, + 'OpExtInst' : 12, + 'OpMemoryModel' : 14, + 'OpEntryPoint' : 15, + 'OpExecutionMode' : 16, + 'OpCapability' : 17, + 'OpTypeVoid' : 19, + 'OpTypeBool' : 20, + 'OpTypeInt' : 21, + 'OpTypeFloat' : 22, + 'OpTypeVector' : 23, + 'OpTypeMatrix' : 24, + 'OpTypeImage' : 25, + 'OpTypeSampler' : 26, + 'OpTypeSampledImage' : 27, + 'OpTypeArray' : 28, + 'OpTypeRuntimeArray' : 29, + 'OpTypeStruct' : 30, + 'OpTypeOpaque' : 31, + 'OpTypePointer' : 32, + 'OpTypeFunction' : 33, + 'OpTypeEvent' : 34, + 'OpTypeDeviceEvent' : 35, + 'OpTypeReserveId' : 36, + 'OpTypeQueue' : 37, + 'OpTypePipe' : 38, + 'OpTypeForwardPointer' : 39, + 'OpConstantTrue' : 41, + 'OpConstantFalse' : 42, + 'OpConstant' : 43, + 'OpConstantComposite' : 44, + 'OpConstantSampler' : 45, + 'OpConstantNull' : 46, + 'OpSpecConstantTrue' : 48, + 'OpSpecConstantFalse' : 49, + 'OpSpecConstant' : 50, + 'OpSpecConstantComposite' : 51, + 'OpSpecConstantOp' : 52, + 'OpFunction' : 54, + 'OpFunctionParameter' : 55, + 'OpFunctionEnd' : 56, + 'OpFunctionCall' : 57, + 'OpVariable' : 59, + 'OpImageTexelPointer' : 60, + 'OpLoad' : 61, + 'OpStore' : 62, + 'OpCopyMemory' : 63, + 'OpCopyMemorySized' : 64, + 'OpAccessChain' : 65, + 'OpInBoundsAccessChain' : 66, + 'OpPtrAccessChain' : 67, + 'OpArrayLength' : 68, + 'OpGenericPtrMemSemantics' : 69, + 'OpInBoundsPtrAccessChain' : 70, + 'OpDecorate' : 71, + 'OpMemberDecorate' : 72, + 'OpDecorationGroup' : 73, + 'OpGroupDecorate' : 74, + 'OpGroupMemberDecorate' : 75, + 'OpVectorExtractDynamic' : 77, + 'OpVectorInsertDynamic' : 78, + 'OpVectorShuffle' : 79, + 'OpCompositeConstruct' : 80, + 'OpCompositeExtract' : 81, + 'OpCompositeInsert' : 82, + 'OpCopyObject' : 83, + 'OpTranspose' : 84, + 'OpSampledImage' : 86, + 'OpImageSampleImplicitLod' : 87, + 'OpImageSampleExplicitLod' : 88, + 'OpImageSampleDrefImplicitLod' : 89, + 'OpImageSampleDrefExplicitLod' : 90, + 'OpImageSampleProjImplicitLod' : 91, + 'OpImageSampleProjExplicitLod' : 92, + 'OpImageSampleProjDrefImplicitLod' : 93, + 'OpImageSampleProjDrefExplicitLod' : 94, + 'OpImageFetch' : 95, + 'OpImageGather' : 96, + 'OpImageDrefGather' : 97, + 'OpImageRead' : 98, + 'OpImageWrite' : 99, + 'OpImage' : 100, + 'OpImageQueryFormat' : 101, + 'OpImageQueryOrder' : 102, + 'OpImageQuerySizeLod' : 103, + 'OpImageQuerySize' : 104, + 'OpImageQueryLod' : 105, + 'OpImageQueryLevels' : 106, + 'OpImageQuerySamples' : 107, + 'OpConvertFToU' : 109, + 'OpConvertFToS' : 110, + 'OpConvertSToF' : 111, + 'OpConvertUToF' : 112, + 'OpUConvert' : 113, + 'OpSConvert' : 114, + 'OpFConvert' : 115, + 'OpQuantizeToF16' : 116, + 'OpConvertPtrToU' : 117, + 'OpSatConvertSToU' : 118, + 'OpSatConvertUToS' : 119, + 'OpConvertUToPtr' : 120, + 'OpPtrCastToGeneric' : 121, + 'OpGenericCastToPtr' : 122, + 'OpGenericCastToPtrExplicit' : 123, + 'OpBitcast' : 124, + 'OpSNegate' : 126, + 'OpFNegate' : 127, + 'OpIAdd' : 128, + 'OpFAdd' : 129, + 'OpISub' : 130, + 'OpFSub' : 131, + 'OpIMul' : 132, + 'OpFMul' : 133, + 'OpUDiv' : 134, + 'OpSDiv' : 135, + 'OpFDiv' : 136, + 'OpUMod' : 137, + 'OpSRem' : 138, + 'OpSMod' : 139, + 'OpFRem' : 140, + 'OpFMod' : 141, + 'OpVectorTimesScalar' : 142, + 'OpMatrixTimesScalar' : 143, + 'OpVectorTimesMatrix' : 144, + 'OpMatrixTimesVector' : 145, + 'OpMatrixTimesMatrix' : 146, + 'OpOuterProduct' : 147, + 'OpDot' : 148, + 'OpIAddCarry' : 149, + 'OpISubBorrow' : 150, + 'OpUMulExtended' : 151, + 'OpSMulExtended' : 152, + 'OpAny' : 154, + 'OpAll' : 155, + 'OpIsNan' : 156, + 'OpIsInf' : 157, + 'OpIsFinite' : 158, + 'OpIsNormal' : 159, + 'OpSignBitSet' : 160, + 'OpLessOrGreater' : 161, + 'OpOrdered' : 162, + 'OpUnordered' : 163, + 'OpLogicalEqual' : 164, + 'OpLogicalNotEqual' : 165, + 'OpLogicalOr' : 166, + 'OpLogicalAnd' : 167, + 'OpLogicalNot' : 168, + 'OpSelect' : 169, + 'OpIEqual' : 170, + 'OpINotEqual' : 171, + 'OpUGreaterThan' : 172, + 'OpSGreaterThan' : 173, + 'OpUGreaterThanEqual' : 174, + 'OpSGreaterThanEqual' : 175, + 'OpULessThan' : 176, + 'OpSLessThan' : 177, + 'OpULessThanEqual' : 178, + 'OpSLessThanEqual' : 179, + 'OpFOrdEqual' : 180, + 'OpFUnordEqual' : 181, + 'OpFOrdNotEqual' : 182, + 'OpFUnordNotEqual' : 183, + 'OpFOrdLessThan' : 184, + 'OpFUnordLessThan' : 185, + 'OpFOrdGreaterThan' : 186, + 'OpFUnordGreaterThan' : 187, + 'OpFOrdLessThanEqual' : 188, + 'OpFUnordLessThanEqual' : 189, + 'OpFOrdGreaterThanEqual' : 190, + 'OpFUnordGreaterThanEqual' : 191, + 'OpShiftRightLogical' : 194, + 'OpShiftRightArithmetic' : 195, + 'OpShiftLeftLogical' : 196, + 'OpBitwiseOr' : 197, + 'OpBitwiseXor' : 198, + 'OpBitwiseAnd' : 199, + 'OpNot' : 200, + 'OpBitFieldInsert' : 201, + 'OpBitFieldSExtract' : 202, + 'OpBitFieldUExtract' : 203, + 'OpBitReverse' : 204, + 'OpBitCount' : 205, + 'OpDPdx' : 207, + 'OpDPdy' : 208, + 'OpFwidth' : 209, + 'OpDPdxFine' : 210, + 'OpDPdyFine' : 211, + 'OpFwidthFine' : 212, + 'OpDPdxCoarse' : 213, + 'OpDPdyCoarse' : 214, + 'OpFwidthCoarse' : 215, + 'OpEmitVertex' : 218, + 'OpEndPrimitive' : 219, + 'OpEmitStreamVertex' : 220, + 'OpEndStreamPrimitive' : 221, + 'OpControlBarrier' : 224, + 'OpMemoryBarrier' : 225, + 'OpAtomicLoad' : 227, + 'OpAtomicStore' : 228, + 'OpAtomicExchange' : 229, + 'OpAtomicCompareExchange' : 230, + 'OpAtomicCompareExchangeWeak' : 231, + 'OpAtomicIIncrement' : 232, + 'OpAtomicIDecrement' : 233, + 'OpAtomicIAdd' : 234, + 'OpAtomicISub' : 235, + 'OpAtomicSMin' : 236, + 'OpAtomicUMin' : 237, + 'OpAtomicSMax' : 238, + 'OpAtomicUMax' : 239, + 'OpAtomicAnd' : 240, + 'OpAtomicOr' : 241, + 'OpAtomicXor' : 242, + 'OpPhi' : 245, + 'OpLoopMerge' : 246, + 'OpSelectionMerge' : 247, + 'OpLabel' : 248, + 'OpBranch' : 249, + 'OpBranchConditional' : 250, + 'OpSwitch' : 251, + 'OpKill' : 252, + 'OpReturn' : 253, + 'OpReturnValue' : 254, + 'OpUnreachable' : 255, + 'OpLifetimeStart' : 256, + 'OpLifetimeStop' : 257, + 'OpGroupAsyncCopy' : 259, + 'OpGroupWaitEvents' : 260, + 'OpGroupAll' : 261, + 'OpGroupAny' : 262, + 'OpGroupBroadcast' : 263, + 'OpGroupIAdd' : 264, + 'OpGroupFAdd' : 265, + 'OpGroupFMin' : 266, + 'OpGroupUMin' : 267, + 'OpGroupSMin' : 268, + 'OpGroupFMax' : 269, + 'OpGroupUMax' : 270, + 'OpGroupSMax' : 271, + 'OpReadPipe' : 274, + 'OpWritePipe' : 275, + 'OpReservedReadPipe' : 276, + 'OpReservedWritePipe' : 277, + 'OpReserveReadPipePackets' : 278, + 'OpReserveWritePipePackets' : 279, + 'OpCommitReadPipe' : 280, + 'OpCommitWritePipe' : 281, + 'OpIsValidReserveId' : 282, + 'OpGetNumPipePackets' : 283, + 'OpGetMaxPipePackets' : 284, + 'OpGroupReserveReadPipePackets' : 285, + 'OpGroupReserveWritePipePackets' : 286, + 'OpGroupCommitReadPipe' : 287, + 'OpGroupCommitWritePipe' : 288, + 'OpEnqueueMarker' : 291, + 'OpEnqueueKernel' : 292, + 'OpGetKernelNDrangeSubGroupCount' : 293, + 'OpGetKernelNDrangeMaxSubGroupSize' : 294, + 'OpGetKernelWorkGroupSize' : 295, + 'OpGetKernelPreferredWorkGroupSizeMultiple' : 296, + 'OpRetainEvent' : 297, + 'OpReleaseEvent' : 298, + 'OpCreateUserEvent' : 299, + 'OpIsValidEvent' : 300, + 'OpSetUserEventStatus' : 301, + 'OpCaptureEventProfilingInfo' : 302, + 'OpGetDefaultQueue' : 303, + 'OpBuildNDRange' : 304, + 'OpImageSparseSampleImplicitLod' : 305, + 'OpImageSparseSampleExplicitLod' : 306, + 'OpImageSparseSampleDrefImplicitLod' : 307, + 'OpImageSparseSampleDrefExplicitLod' : 308, + 'OpImageSparseSampleProjImplicitLod' : 309, + 'OpImageSparseSampleProjExplicitLod' : 310, + 'OpImageSparseSampleProjDrefImplicitLod' : 311, + 'OpImageSparseSampleProjDrefExplicitLod' : 312, + 'OpImageSparseFetch' : 313, + 'OpImageSparseGather' : 314, + 'OpImageSparseDrefGather' : 315, + 'OpImageSparseTexelsResident' : 316, + 'OpNoLine' : 317, + 'OpAtomicFlagTestAndSet' : 318, + 'OpAtomicFlagClear' : 319, + 'OpImageSparseRead' : 320, + 'OpSizeOf' : 321, + 'OpTypePipeStorage' : 322, + 'OpConstantPipeStorage' : 323, + 'OpCreatePipeFromPipeStorage' : 324, + 'OpGetKernelLocalSizeForSubgroupCount' : 325, + 'OpGetKernelMaxNumSubgroups' : 326, + 'OpTypeNamedBarrier' : 327, + 'OpNamedBarrierInitialize' : 328, + 'OpMemoryNamedBarrier' : 329, + 'OpModuleProcessed' : 330, + 'OpDecorateId' : 332, + 'OpSubgroupBallotKHR' : 4421, + 'OpSubgroupFirstInvocationKHR' : 4422, + 'OpSubgroupAllKHR' : 4428, + 'OpSubgroupAnyKHR' : 4429, + 'OpSubgroupAllEqualKHR' : 4430, + 'OpSubgroupReadInvocationKHR' : 4432, + 'OpGroupIAddNonUniformAMD' : 5000, + 'OpGroupFAddNonUniformAMD' : 5001, + 'OpGroupFMinNonUniformAMD' : 5002, + 'OpGroupUMinNonUniformAMD' : 5003, + 'OpGroupSMinNonUniformAMD' : 5004, + 'OpGroupFMaxNonUniformAMD' : 5005, + 'OpGroupUMaxNonUniformAMD' : 5006, + 'OpGroupSMaxNonUniformAMD' : 5007, + 'OpFragmentMaskFetchAMD' : 5011, + 'OpFragmentFetchAMD' : 5012, + 'OpSubgroupShuffleINTEL' : 5571, + 'OpSubgroupShuffleDownINTEL' : 5572, + 'OpSubgroupShuffleUpINTEL' : 5573, + 'OpSubgroupShuffleXorINTEL' : 5574, + 'OpSubgroupBlockReadINTEL' : 5575, + 'OpSubgroupBlockWriteINTEL' : 5576, + 'OpSubgroupImageBlockReadINTEL' : 5577, + 'OpSubgroupImageBlockWriteINTEL' : 5578, + 'OpDecorateStringGOOGLE' : 5632, + 'OpMemberDecorateStringGOOGLE' : 5633, + }, + +} + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/extinst.glsl.std.450.grammar.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/extinst.glsl.std.450.grammar.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/extinst.glsl.std.450.grammar.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/extinst.glsl.std.450.grammar.json 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,642 @@ +{ + "copyright" : [ + "Copyright (c) 2014-2016 The Khronos Group Inc.", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and/or associated documentation files (the \"Materials\"),", + "to deal in the Materials without restriction, including without limitation", + "the rights to use, copy, modify, merge, publish, distribute, sublicense,", + "and/or sell copies of the Materials, and to permit persons to whom the", + "Materials are furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Materials.", + "", + "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", + "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", + "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", + "", + "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", + "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", + "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", + "IN THE MATERIALS." + ], + "version" : 100, + "revision" : 2, + "instructions" : [ + { + "opname" : "Round", + "opcode" : 1, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "RoundEven", + "opcode" : 2, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Trunc", + "opcode" : 3, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "FAbs", + "opcode" : 4, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "SAbs", + "opcode" : 5, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "FSign", + "opcode" : 6, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "SSign", + "opcode" : 7, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Floor", + "opcode" : 8, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Ceil", + "opcode" : 9, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Fract", + "opcode" : 10, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Radians", + "opcode" : 11, + "operands" : [ + { "kind" : "IdRef", "name" : "'degrees'" } + ] + }, + { + "opname" : "Degrees", + "opcode" : 12, + "operands" : [ + { "kind" : "IdRef", "name" : "'radians'" } + ] + }, + { + "opname" : "Sin", + "opcode" : 13, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Cos", + "opcode" : 14, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Tan", + "opcode" : 15, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Asin", + "opcode" : 16, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Acos", + "opcode" : 17, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Atan", + "opcode" : 18, + "operands" : [ + { "kind" : "IdRef", "name" : "'y_over_x'" } + ] + }, + { + "opname" : "Sinh", + "opcode" : 19, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Cosh", + "opcode" : 20, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Tanh", + "opcode" : 21, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Asinh", + "opcode" : 22, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Acosh", + "opcode" : 23, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Atanh", + "opcode" : 24, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Atan2", + "opcode" : 25, + "operands" : [ + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Pow", + "opcode" : 26, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "Exp", + "opcode" : 27, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Log", + "opcode" : 28, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Exp2", + "opcode" : 29, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Log2", + "opcode" : 30, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Sqrt", + "opcode" : 31, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "InverseSqrt", + "opcode" : 32, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Determinant", + "opcode" : 33, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "MatrixInverse", + "opcode" : 34, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Modf", + "opcode" : 35, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'i'" } + ] + }, + { + "opname" : "ModfStruct", + "opcode" : 36, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "FMin", + "opcode" : 37, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "UMin", + "opcode" : 38, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "SMin", + "opcode" : 39, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "FMax", + "opcode" : 40, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "UMax", + "opcode" : 41, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "SMax", + "opcode" : 42, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "FClamp", + "opcode" : 43, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minVal'" }, + { "kind" : "IdRef", "name" : "'maxVal'" } + ] + }, + { + "opname" : "UClamp", + "opcode" : 44, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minVal'" }, + { "kind" : "IdRef", "name" : "'maxVal'" } + ] + }, + { + "opname" : "SClamp", + "opcode" : 45, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minVal'" }, + { "kind" : "IdRef", "name" : "'maxVal'" } + ] + }, + { + "opname" : "FMix", + "opcode" : 46, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'a'" } + ] + }, + { + "opname" : "IMix", + "opcode" : 47, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'a'" } + ] + }, + { + "opname" : "Step", + "opcode" : 48, + "operands" : [ + { "kind" : "IdRef", "name" : "'edge'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "SmoothStep", + "opcode" : 49, + "operands" : [ + { "kind" : "IdRef", "name" : "'edge0'" }, + { "kind" : "IdRef", "name" : "'edge1'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Fma", + "opcode" : 50, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "Frexp", + "opcode" : 51, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'exp'" } + ] + }, + { + "opname" : "FrexpStruct", + "opcode" : 52, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Ldexp", + "opcode" : 53, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'exp'" } + ] + }, + { + "opname" : "PackSnorm4x8", + "opcode" : 54, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackUnorm4x8", + "opcode" : 55, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackSnorm2x16", + "opcode" : 56, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackUnorm2x16", + "opcode" : 57, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackHalf2x16", + "opcode" : 58, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackDouble2x32", + "opcode" : 59, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ], + "capabilities" : [ "Float64" ] + }, + { + "opname" : "UnpackSnorm2x16", + "opcode" : 60, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "UnpackUnorm2x16", + "opcode" : 61, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "UnpackHalf2x16", + "opcode" : 62, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "UnpackSnorm4x8", + "opcode" : 63, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "UnpackUnorm4x8", + "opcode" : 64, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "UnpackDouble2x32", + "opcode" : 65, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ], + "capabilities" : [ "Float64" ] + }, + { + "opname" : "Length", + "opcode" : 66, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Distance", + "opcode" : 67, + "operands" : [ + { "kind" : "IdRef", "name" : "'p0'" }, + { "kind" : "IdRef", "name" : "'p1'" } + ] + }, + { + "opname" : "Cross", + "opcode" : 68, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "Normalize", + "opcode" : 69, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "FaceForward", + "opcode" : 70, + "operands" : [ + { "kind" : "IdRef", "name" : "'N'" }, + { "kind" : "IdRef", "name" : "'I'" }, + { "kind" : "IdRef", "name" : "'Nref'" } + ] + }, + { + "opname" : "Reflect", + "opcode" : 71, + "operands" : [ + { "kind" : "IdRef", "name" : "'I'" }, + { "kind" : "IdRef", "name" : "'N'" } + ] + }, + { + "opname" : "Refract", + "opcode" : 72, + "operands" : [ + { "kind" : "IdRef", "name" : "'I'" }, + { "kind" : "IdRef", "name" : "'N'" }, + { "kind" : "IdRef", "name" : "'eta'" } + ] + }, + { + "opname" : "FindILsb", + "opcode" : 73, + "operands" : [ + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "FindSMsb", + "opcode" : 74, + "operands" : [ + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "FindUMsb", + "opcode" : 75, + "operands" : [ + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "InterpolateAtCentroid", + "opcode" : 76, + "operands" : [ + { "kind" : "IdRef", "name" : "'interpolant'" } + ], + "capabilities" : [ "InterpolationFunction" ] + }, + { + "opname" : "InterpolateAtSample", + "opcode" : 77, + "operands" : [ + { "kind" : "IdRef", "name" : "'interpolant'" }, + { "kind" : "IdRef", "name" : "'sample'" } + ], + "capabilities" : [ "InterpolationFunction" ] + }, + { + "opname" : "InterpolateAtOffset", + "opcode" : 78, + "operands" : [ + { "kind" : "IdRef", "name" : "'interpolant'" }, + { "kind" : "IdRef", "name" : "'offset'" } + ], + "capabilities" : [ "InterpolationFunction" ] + }, + { + "opname" : "NMin", + "opcode" : 79, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "NMax", + "opcode" : 80, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "NClamp", + "opcode" : 81, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minVal'" }, + { "kind" : "IdRef", "name" : "'maxVal'" } + ] + } + ] +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/extinst.opencl.std.100.grammar.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/extinst.opencl.std.100.grammar.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/extinst.opencl.std.100.grammar.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/extinst.opencl.std.100.grammar.json 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1279 @@ +{ + "copyright" : [ + "Copyright (c) 2014-2016 The Khronos Group Inc.", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and/or associated documentation files (the \"Materials\"),", + "to deal in the Materials without restriction, including without limitation", + "the rights to use, copy, modify, merge, publish, distribute, sublicense,", + "and/or sell copies of the Materials, and to permit persons to whom the", + "Materials are furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Materials.", + "", + "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", + "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", + "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", + "", + "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", + "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", + "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", + "IN THE MATERIALS." + ], + "version" : 100, + "revision" : 2, + "instructions" : [ + { + "opname" : "acos", + "opcode" : 0, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "acosh", + "opcode" : 1, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "acospi", + "opcode" : 2, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "asin", + "opcode" : 3, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "asinh", + "opcode" : 4, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "asinpi", + "opcode" : 5, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atan", + "opcode" : 6, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atan2", + "opcode" : 7, + "operands" : [ + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atanh", + "opcode" : 8, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atanpi", + "opcode" : 9, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atan2pi", + "opcode" : 10, + "operands" : [ + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "cbrt", + "opcode" : 11, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "ceil", + "opcode" : 12, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "copysign", + "opcode" : 13, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "cos", + "opcode" : 14, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "cosh", + "opcode" : 15, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "cospi", + "opcode" : 16, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "erfc", + "opcode" : 17, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "erf", + "opcode" : 18, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "exp", + "opcode" : 19, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "exp2", + "opcode" : 20, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "exp10", + "opcode" : 21, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "expm1", + "opcode" : 22, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "fabs", + "opcode" : 23, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "fdim", + "opcode" : 24, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "floor", + "opcode" : 25, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "fma", + "opcode" : 26, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "fmax", + "opcode" : 27, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "fmin", + "opcode" : 28, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "fmod", + "opcode" : 29, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "fract", + "opcode" : 30, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'ptr'" } + ] + }, + { + "opname" : "frexp", + "opcode" : 31, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'exp'" } + ] + }, + { + "opname" : "hypot", + "opcode" : 32, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "ilogb", + "opcode" : 33, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "ldexp", + "opcode" : 34, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'k'" } + ] + }, + { + "opname" : "lgamma", + "opcode" : 35, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "lgamma_r", + "opcode" : 36, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'signp'" } + ] + }, + { + "opname" : "log", + "opcode" : 37, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "log2", + "opcode" : 38, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "log10", + "opcode" : 39, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "log1p", + "opcode" : 40, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "logb", + "opcode" : 41, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "mad", + "opcode" : 42, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "maxmag", + "opcode" : 43, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "minmag", + "opcode" : 44, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "modf", + "opcode" : 45, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'iptr'" } + ] + }, + { + "opname" : "nan", + "opcode" : 46, + "operands" : [ + { "kind" : "IdRef", "name" : "'nancode'" } + ] + }, + { + "opname" : "nextafter", + "opcode" : 47, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "pow", + "opcode" : 48, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y" } + ] + }, + { + "opname" : "pown", + "opcode" : 49, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "powr", + "opcode" : 50, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "remainder", + "opcode" : 51, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "remquo", + "opcode" : 52, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'quo'" } + ] + }, + { + "opname" : "rint", + "opcode" : 53, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "rootn", + "opcode" : 54, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "round", + "opcode" : 55, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "rsqrt", + "opcode" : 56, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sin", + "opcode" : 57, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sincos", + "opcode" : 58, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'cosval'" } + ] + }, + { + "opname" : "sinh", + "opcode" : 59, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sinpi", + "opcode" : 60, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sqrt", + "opcode" : 61, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "tan", + "opcode" : 62, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "tanh", + "opcode" : 63, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "tanpi", + "opcode" : 64, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "tgamma", + "opcode" : 65, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "trunc", + "opcode" : 66, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_cos", + "opcode" : 67, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_divide", + "opcode" : 68, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "half_exp", + "opcode" : 69, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_exp2", + "opcode" : 70, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_exp10", + "opcode" : 71, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_log", + "opcode" : 72, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_log2", + "opcode" : 73, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_log10", + "opcode" : 74, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_powr", + "opcode" : 75, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "half_recip", + "opcode" : 76, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_rsqrt", + "opcode" : 77, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_sin", + "opcode" : 78, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_sqrt", + "opcode" : 79, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_tan", + "opcode" : 80, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_cos", + "opcode" : 81, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_divide", + "opcode" : 82, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "native_exp", + "opcode" : 83, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_exp2", + "opcode" : 84, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_exp10", + "opcode" : 85, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_log", + "opcode" : 86, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_log2", + "opcode" : 87, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_log10", + "opcode" : 88, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_powr", + "opcode" : 89, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "native_recip", + "opcode" : 90, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_rsqrt", + "opcode" : 91, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_sin", + "opcode" : 92, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_sqrt", + "opcode" : 93, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_tan", + "opcode" : 94, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "s_abs", + "opcode" : 141, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "s_abs_diff", + "opcode" : 142, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_add_sat", + "opcode" : 143, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_add_sat", + "opcode" : 144, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_hadd", + "opcode" : 145, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_hadd", + "opcode" : 146, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_rhadd", + "opcode" : 147, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_rhadd", + "opcode" : 148, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_clamp", + "opcode" : 149, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minval'" }, + { "kind" : "IdRef", "name" : "'maxval'" } + ] + }, + { + "opname" : "u_clamp", + "opcode" : 150, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minval'" }, + { "kind" : "IdRef", "name" : "'maxval'" } + ] + }, + { + "opname" : "clz", + "opcode" : 151, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "ctz", + "opcode" : 152, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "s_mad_hi", + "opcode" : 153, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "u_mad_sat", + "opcode" : 154, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ] + }, + { + "opname" : "s_mad_sat", + "opcode" : 155, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ] + }, + { + "opname" : "s_max", + "opcode" : 156, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_max", + "opcode" : 157, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_min", + "opcode" : 158, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_min", + "opcode" : 159, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_mul_hi", + "opcode" : 160, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "rotate", + "opcode" : 161, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" }, + { "kind" : "IdRef", "name" : "'i'" } + ] + }, + { + "opname" : "s_sub_sat", + "opcode" : 162, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_sub_sat", + "opcode" : 163, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_upsample", + "opcode" : 164, + "operands" : [ + { "kind" : "IdRef", "name" : "'hi'" }, + { "kind" : "IdRef", "name" : "'lo'" } + ] + }, + { + "opname" : "s_upsample", + "opcode" : 165, + "operands" : [ + { "kind" : "IdRef", "name" : "'hi'" }, + { "kind" : "IdRef", "name" : "'lo'" } + ] + }, + { + "opname" : "popcount", + "opcode" : 166, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "s_mad24", + "opcode" : 167, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ] + }, + { + "opname" : "u_mad24", + "opcode" : 168, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ] + }, + { + "opname" : "s_mul24", + "opcode" : 169, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_mul24", + "opcode" : 170, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_abs", + "opcode" : 201, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "u_abs_diff", + "opcode" : 202, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_mul_hi", + "opcode" : 203, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_mad_hi", + "opcode" : 204, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "fclamp", + "opcode" : 95, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minval'" }, + { "kind" : "IdRef", "name" : "'maxval'" } + ] + }, + { + "opname" : "degrees", + "opcode" :96, + "operands" : [ + { "kind" : "IdRef", "name" : "'radians'" } + ] + }, + { + "opname" : "fmax_common", + "opcode" : 97, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "fmin_common", + "opcode" : 98, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "mix", + "opcode" : 99, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'a'" } + ] + }, + { + "opname" : "radians", + "opcode" : 100, + "operands" : [ + { "kind" : "IdRef", "name" : "'degrees'" } + ] + }, + { + "opname" : "step", + "opcode" : 101, + "operands" : [ + { "kind" : "IdRef", "name" : "'edge'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "smoothstep", + "opcode" : 102, + "operands" : [ + { "kind" : "IdRef", "name" : "'edge0'" }, + { "kind" : "IdRef", "name" : "'edge1'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sign", + "opcode" : 103, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "cross", + "opcode" : 104, + "operands" : [ + { "kind" : "IdRef", "name" : "'p0'" }, + { "kind" : "IdRef", "name" : "'p1'" } + ] + }, + { + "opname" : "distance", + "opcode" : 105, + "operands" : [ + { "kind" : "IdRef", "name" : "'p0'" }, + { "kind" : "IdRef", "name" : "'p1'" } + ] + }, + { + "opname" : "length", + "opcode" : 106, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "normalize", + "opcode" : 107, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "fast_distance", + "opcode" : 108, + "operands" : [ + { "kind" : "IdRef", "name" : "'p0'" }, + { "kind" : "IdRef", "name" : "'p1'" } + ] + }, + { + "opname" : "fast_length", + "opcode" : 109, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "fast_normalize", + "opcode" : 110, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "bitselect", + "opcode" : 186, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "select", + "opcode" : 187, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "vloadn", + "opcode" : 171, + "operands" : [ + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "LiteralInteger", "name" : "'n'" } + ] + }, + { + "opname" : "vstoren", + "opcode" : 172, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vload_half", + "opcode" : 173, + "operands" : [ + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vload_halfn", + "opcode" : 174, + "operands" : [ + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "LiteralInteger", "name" : "'n'" } + ] + }, + { + "opname" : "vstore_half", + "opcode" : 175, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vstore_half_r", + "opcode" : 176, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "FPRoundingMode", "name" : "'mode'" } + ] + }, + { + "opname" : "vstore_halfn", + "opcode" : 177, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vstore_halfn_r", + "opcode" : 178, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "FPRoundingMode", "name" : "'mode'" } + ] + }, + { + "opname" : "vloada_halfn", + "opcode" : 179, + "operands" : [ + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "LiteralInteger", "name" : "'n'" } + ] + }, + { + "opname" : "vstorea_halfn", + "opcode" : 180, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vstorea_halfn_r", + "opcode" : 181, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "FPRoundingMode", "name" : "'mode'" } + ] + }, + { + "opname" : "shuffle", + "opcode" : 182, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'shuffle mask'" } + ] + }, + { + "opname" : "shuffle2", + "opcode" : 183, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'shuffle mask'" } + ] + }, + { + "opname" : "printf", + "opcode" : 184, + "operands" : [ + { "kind" : "IdRef", "name" : "'format'" }, + { "kind" : "IdRef", "name" : "'additional arguments'", "quantifier" : "*" } + ] + }, + { + "opname" : "prefetch", + "opcode" : 185, + "operands" : [ + { "kind" : "IdRef", "name" : "'ptr'" }, + { "kind" : "IdRef", "name" : "'num elements'" } + ] + } + ] +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/GLSL.std.450.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/GLSL.std.450.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/GLSL.std.450.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/GLSL.std.450.h 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,131 @@ +/* +** Copyright (c) 2014-2016 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +#ifndef GLSLstd450_H +#define GLSLstd450_H + +static const int GLSLstd450Version = 100; +static const int GLSLstd450Revision = 3; + +enum GLSLstd450 { + GLSLstd450Bad = 0, // Don't use + + GLSLstd450Round = 1, + GLSLstd450RoundEven = 2, + GLSLstd450Trunc = 3, + GLSLstd450FAbs = 4, + GLSLstd450SAbs = 5, + GLSLstd450FSign = 6, + GLSLstd450SSign = 7, + GLSLstd450Floor = 8, + GLSLstd450Ceil = 9, + GLSLstd450Fract = 10, + + GLSLstd450Radians = 11, + GLSLstd450Degrees = 12, + GLSLstd450Sin = 13, + GLSLstd450Cos = 14, + GLSLstd450Tan = 15, + GLSLstd450Asin = 16, + GLSLstd450Acos = 17, + GLSLstd450Atan = 18, + GLSLstd450Sinh = 19, + GLSLstd450Cosh = 20, + GLSLstd450Tanh = 21, + GLSLstd450Asinh = 22, + GLSLstd450Acosh = 23, + GLSLstd450Atanh = 24, + GLSLstd450Atan2 = 25, + + GLSLstd450Pow = 26, + GLSLstd450Exp = 27, + GLSLstd450Log = 28, + GLSLstd450Exp2 = 29, + GLSLstd450Log2 = 30, + GLSLstd450Sqrt = 31, + GLSLstd450InverseSqrt = 32, + + GLSLstd450Determinant = 33, + GLSLstd450MatrixInverse = 34, + + GLSLstd450Modf = 35, // second operand needs an OpVariable to write to + GLSLstd450ModfStruct = 36, // no OpVariable operand + GLSLstd450FMin = 37, + GLSLstd450UMin = 38, + GLSLstd450SMin = 39, + GLSLstd450FMax = 40, + GLSLstd450UMax = 41, + GLSLstd450SMax = 42, + GLSLstd450FClamp = 43, + GLSLstd450UClamp = 44, + GLSLstd450SClamp = 45, + GLSLstd450FMix = 46, + GLSLstd450IMix = 47, // Reserved + GLSLstd450Step = 48, + GLSLstd450SmoothStep = 49, + + GLSLstd450Fma = 50, + GLSLstd450Frexp = 51, // second operand needs an OpVariable to write to + GLSLstd450FrexpStruct = 52, // no OpVariable operand + GLSLstd450Ldexp = 53, + + GLSLstd450PackSnorm4x8 = 54, + GLSLstd450PackUnorm4x8 = 55, + GLSLstd450PackSnorm2x16 = 56, + GLSLstd450PackUnorm2x16 = 57, + GLSLstd450PackHalf2x16 = 58, + GLSLstd450PackDouble2x32 = 59, + GLSLstd450UnpackSnorm2x16 = 60, + GLSLstd450UnpackUnorm2x16 = 61, + GLSLstd450UnpackHalf2x16 = 62, + GLSLstd450UnpackSnorm4x8 = 63, + GLSLstd450UnpackUnorm4x8 = 64, + GLSLstd450UnpackDouble2x32 = 65, + + GLSLstd450Length = 66, + GLSLstd450Distance = 67, + GLSLstd450Cross = 68, + GLSLstd450Normalize = 69, + GLSLstd450FaceForward = 70, + GLSLstd450Reflect = 71, + GLSLstd450Refract = 72, + + GLSLstd450FindILsb = 73, + GLSLstd450FindSMsb = 74, + GLSLstd450FindUMsb = 75, + + GLSLstd450InterpolateAtCentroid = 76, + GLSLstd450InterpolateAtSample = 77, + GLSLstd450InterpolateAtOffset = 78, + + GLSLstd450NMin = 79, + GLSLstd450NMax = 80, + GLSLstd450NClamp = 81, + + GLSLstd450Count +}; + +#endif // #ifndef GLSLstd450_H diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/OpenCL.std.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/OpenCL.std.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/OpenCL.std.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/OpenCL.std.h 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,210 @@ +/* +** Copyright (c) 2015-2017 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +namespace OpenCLLIB { + +enum Entrypoints { + + // Section 2.1: Math extended instructions + Acos = 0, + Acosh = 1, + Acospi = 2, + Asin = 3, + Asinh = 4, + Asinpi = 5, + Atan = 6, + Atan2 = 7, + Atanh = 8, + Atanpi = 9, + Atan2pi = 10, + Cbrt = 11, + Ceil = 12, + Copysign = 13, + Cos = 14, + Cosh = 15, + Cospi = 16, + Erfc = 17, + Erf = 18, + Exp = 19, + Exp2 = 20, + Exp10 = 21, + Expm1 = 22, + Fabs = 23, + Fdim = 24, + Floor = 25, + Fma = 26, + Fmax = 27, + Fmin = 28, + Fmod = 29, + Fract = 30, + Frexp = 31, + Hypot = 32, + Ilogb = 33, + Ldexp = 34, + Lgamma = 35, + Lgamma_r = 36, + Log = 37, + Log2 = 38, + Log10 = 39, + Log1p = 40, + Logb = 41, + Mad = 42, + Maxmag = 43, + Minmag = 44, + Modf = 45, + Nan = 46, + Nextafter = 47, + Pow = 48, + Pown = 49, + Powr = 50, + Remainder = 51, + Remquo = 52, + Rint = 53, + Rootn = 54, + Round = 55, + Rsqrt = 56, + Sin = 57, + Sincos = 58, + Sinh = 59, + Sinpi = 60, + Sqrt = 61, + Tan = 62, + Tanh = 63, + Tanpi = 64, + Tgamma = 65, + Trunc = 66, + Half_cos = 67, + Half_divide = 68, + Half_exp = 69, + Half_exp2 = 70, + Half_exp10 = 71, + Half_log = 72, + Half_log2 = 73, + Half_log10 = 74, + Half_powr = 75, + Half_recip = 76, + Half_rsqrt = 77, + Half_sin = 78, + Half_sqrt = 79, + Half_tan = 80, + Native_cos = 81, + Native_divide = 82, + Native_exp = 83, + Native_exp2 = 84, + Native_exp10 = 85, + Native_log = 86, + Native_log2 = 87, + Native_log10 = 88, + Native_powr = 89, + Native_recip = 90, + Native_rsqrt = 91, + Native_sin = 92, + Native_sqrt = 93, + Native_tan = 94, + + // Section 2.2: Integer instructions + SAbs = 141, + SAbs_diff = 142, + SAdd_sat = 143, + UAdd_sat = 144, + SHadd = 145, + UHadd = 146, + SRhadd = 147, + URhadd = 148, + SClamp = 149, + UClamp = 150, + Clz = 151, + Ctz = 152, + SMad_hi = 153, + UMad_sat = 154, + SMad_sat = 155, + SMax = 156, + UMax = 157, + SMin = 158, + UMin = 159, + SMul_hi = 160, + Rotate = 161, + SSub_sat = 162, + USub_sat = 163, + U_Upsample = 164, + S_Upsample = 165, + Popcount = 166, + SMad24 = 167, + UMad24 = 168, + SMul24 = 169, + UMul24 = 170, + UAbs = 201, + UAbs_diff = 202, + UMul_hi = 203, + UMad_hi = 204, + + // Section 2.3: Common instructions + FClamp = 95, + Degrees = 96, + FMax_common = 97, + FMin_common = 98, + Mix = 99, + Radians = 100, + Step = 101, + Smoothstep = 102, + Sign = 103, + + // Section 2.4: Geometric instructions + Cross = 104, + Distance = 105, + Length = 106, + Normalize = 107, + Fast_distance = 108, + Fast_length = 109, + Fast_normalize = 110, + + // Section 2.5: Relational instructions + Bitselect = 186, + Select = 187, + + // Section 2.6: Vector Data Load and Store instructions + Vloadn = 171, + Vstoren = 172, + Vload_half = 173, + Vload_halfn = 174, + Vstore_half = 175, + Vstore_half_r = 176, + Vstore_halfn = 177, + Vstore_halfn_r = 178, + Vloada_halfn = 179, + Vstorea_halfn = 180, + Vstorea_halfn_r = 181, + + // Section 2.7: Miscellaneous Vector instructions + Shuffle = 182, + Shuffle2 = 183, + + // Section 2.8: Misc instructions + Printf = 184, + Prefetch = 185, +}; + +} // end namespace OpenCLLIB diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.core.grammar.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.core.grammar.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.core.grammar.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.core.grammar.json 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,5986 @@ +{ + "copyright" : [ + "Copyright (c) 2014-2016 The Khronos Group Inc.", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and/or associated documentation files (the \"Materials\"),", + "to deal in the Materials without restriction, including without limitation", + "the rights to use, copy, modify, merge, publish, distribute, sublicense,", + "and/or sell copies of the Materials, and to permit persons to whom the", + "Materials are furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Materials.", + "", + "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", + "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", + "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", + "", + "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", + "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", + "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", + "IN THE MATERIALS." + ], + "magic_number" : "0x07230203", + "major_version" : 1, + "minor_version" : 2, + "revision" : 2, + "instructions" : [ + { + "opname" : "OpNop", + "opcode" : 0 + }, + { + "opname" : "OpUndef", + "opcode" : 1, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpSourceContinued", + "opcode" : 2, + "operands" : [ + { "kind" : "LiteralString", "name" : "'Continued Source'" } + ] + }, + { + "opname" : "OpSource", + "opcode" : 3, + "operands" : [ + { "kind" : "SourceLanguage" }, + { "kind" : "LiteralInteger", "name" : "'Version'" }, + { "kind" : "IdRef", "quantifier" : "?", "name" : "'File'" }, + { "kind" : "LiteralString", "quantifier" : "?", "name" : "'Source'" } + ] + }, + { + "opname" : "OpSourceExtension", + "opcode" : 4, + "operands" : [ + { "kind" : "LiteralString", "name" : "'Extension'" } + ] + }, + { + "opname" : "OpName", + "opcode" : 5, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "LiteralString", "name" : "'Name'" } + ] + }, + { + "opname" : "OpMemberName", + "opcode" : 6, + "operands" : [ + { "kind" : "IdRef", "name" : "'Type'" }, + { "kind" : "LiteralInteger", "name" : "'Member'" }, + { "kind" : "LiteralString", "name" : "'Name'" } + ] + }, + { + "opname" : "OpString", + "opcode" : 7, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralString", "name" : "'String'" } + ] + }, + { + "opname" : "OpLine", + "opcode" : 8, + "operands" : [ + { "kind" : "IdRef", "name" : "'File'" }, + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "LiteralInteger", "name" : "'Column'" } + ] + }, + { + "opname" : "OpExtension", + "opcode" : 10, + "operands" : [ + { "kind" : "LiteralString", "name" : "'Name'" } + ] + }, + { + "opname" : "OpExtInstImport", + "opcode" : 11, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralString", "name" : "'Name'" } + ] + }, + { + "opname" : "OpExtInst", + "opcode" : 12, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Set'" }, + { "kind" : "LiteralExtInstInteger", "name" : "'Instruction'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Operand 1', +\n'Operand 2', +\n..." } + ] + }, + { + "opname" : "OpMemoryModel", + "opcode" : 14, + "operands" : [ + { "kind" : "AddressingModel" }, + { "kind" : "MemoryModel" } + ] + }, + { + "opname" : "OpEntryPoint", + "opcode" : 15, + "operands" : [ + { "kind" : "ExecutionModel" }, + { "kind" : "IdRef", "name" : "'Entry Point'" }, + { "kind" : "LiteralString", "name" : "'Name'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Interface'" } + ] + }, + { + "opname" : "OpExecutionMode", + "opcode" : 16, + "operands" : [ + { "kind" : "IdRef", "name" : "'Entry Point'" }, + { "kind" : "ExecutionMode", "name" : "'Mode'" } + ] + }, + { + "opname" : "OpCapability", + "opcode" : 17, + "operands" : [ + { "kind" : "Capability", "name" : "'Capability'" } + ] + }, + { + "opname" : "OpTypeVoid", + "opcode" : 19, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpTypeBool", + "opcode" : 20, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpTypeInt", + "opcode" : 21, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralInteger", "name" : "'Width'" }, + { "kind" : "LiteralInteger", "name" : "'Signedness'" } + ] + }, + { + "opname" : "OpTypeFloat", + "opcode" : 22, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralInteger", "name" : "'Width'" } + ] + }, + { + "opname" : "OpTypeVector", + "opcode" : 23, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Component Type'" }, + { "kind" : "LiteralInteger", "name" : "'Component Count'" } + ] + }, + { + "opname" : "OpTypeMatrix", + "opcode" : 24, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Column Type'" }, + { "kind" : "LiteralInteger", "name" : "'Column Count'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpTypeImage", + "opcode" : 25, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Type'" }, + { "kind" : "Dim" }, + { "kind" : "LiteralInteger", "name" : "'Depth'" }, + { "kind" : "LiteralInteger", "name" : "'Arrayed'" }, + { "kind" : "LiteralInteger", "name" : "'MS'" }, + { "kind" : "LiteralInteger", "name" : "'Sampled'" }, + { "kind" : "ImageFormat" }, + { "kind" : "AccessQualifier", "quantifier" : "?" } + ] + }, + { + "opname" : "OpTypeSampler", + "opcode" : 26, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpTypeSampledImage", + "opcode" : 27, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image Type'" } + ] + }, + { + "opname" : "OpTypeArray", + "opcode" : 28, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Element Type'" }, + { "kind" : "IdRef", "name" : "'Length'" } + ] + }, + { + "opname" : "OpTypeRuntimeArray", + "opcode" : 29, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Element Type'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpTypeStruct", + "opcode" : 30, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Member 0 type', +\n'member 1 type', +\n..." } + ] + }, + { + "opname" : "OpTypeOpaque", + "opcode" : 31, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralString", "name" : "The name of the opaque type." } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpTypePointer", + "opcode" : 32, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "StorageClass" }, + { "kind" : "IdRef", "name" : "'Type'" } + ] + }, + { + "opname" : "OpTypeFunction", + "opcode" : 33, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Return Type'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Parameter 0 Type', +\n'Parameter 1 Type', +\n..." } + ] + }, + { + "opname" : "OpTypeEvent", + "opcode" : 34, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpTypeDeviceEvent", + "opcode" : 35, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpTypeReserveId", + "opcode" : 36, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpTypeQueue", + "opcode" : 37, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpTypePipe", + "opcode" : 38, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "AccessQualifier", "name" : "'Qualifier'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpTypeForwardPointer", + "opcode" : 39, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer Type'" }, + { "kind" : "StorageClass" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpConstantTrue", + "opcode" : 41, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpConstantFalse", + "opcode" : 42, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpConstant", + "opcode" : 43, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } + ] + }, + { + "opname" : "OpConstantComposite", + "opcode" : 44, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } + ] + }, + { + "opname" : "OpConstantSampler", + "opcode" : 45, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "SamplerAddressingMode" }, + { "kind" : "LiteralInteger", "name" : "'Param'" }, + { "kind" : "SamplerFilterMode" } + ], + "capabilities" : [ "LiteralSampler" ] + }, + { + "opname" : "OpConstantNull", + "opcode" : 46, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpSpecConstantTrue", + "opcode" : 48, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpSpecConstantFalse", + "opcode" : 49, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpSpecConstant", + "opcode" : 50, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } + ] + }, + { + "opname" : "OpSpecConstantComposite", + "opcode" : 51, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } + ] + }, + { + "opname" : "OpSpecConstantOp", + "opcode" : 52, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "LiteralSpecConstantOpInteger", "name" : "'Opcode'" } + ] + }, + { + "opname" : "OpFunction", + "opcode" : 54, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "FunctionControl" }, + { "kind" : "IdRef", "name" : "'Function Type'" } + ] + }, + { + "opname" : "OpFunctionParameter", + "opcode" : 55, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpFunctionEnd", + "opcode" : 56 + }, + { + "opname" : "OpFunctionCall", + "opcode" : 57, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Function'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Argument 0', +\n'Argument 1', +\n..." } + ] + }, + { + "opname" : "OpVariable", + "opcode" : 59, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "StorageClass" }, + { "kind" : "IdRef", "quantifier" : "?", "name" : "'Initializer'" } + ] + }, + { + "opname" : "OpImageTexelPointer", + "opcode" : 60, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Sample'" } + ] + }, + { + "opname" : "OpLoad", + "opcode" : 61, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "MemoryAccess", "quantifier" : "?" } + ] + }, + { + "opname" : "OpStore", + "opcode" : 62, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Object'" }, + { "kind" : "MemoryAccess", "quantifier" : "?" } + ] + }, + { + "opname" : "OpCopyMemory", + "opcode" : 63, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "MemoryAccess", "quantifier" : "?" } + ] + }, + { + "opname" : "OpCopyMemorySized", + "opcode" : 64, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "IdRef", "name" : "'Size'" }, + { "kind" : "MemoryAccess", "quantifier" : "?" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpAccessChain", + "opcode" : 65, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpInBoundsAccessChain", + "opcode" : 66, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpPtrAccessChain", + "opcode" : 67, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Element'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ], + "capabilities" : [ + "Addresses", + "VariablePointers", + "VariablePointersStorageBuffer" + ] + }, + { + "opname" : "OpArrayLength", + "opcode" : 68, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Structure'" }, + { "kind" : "LiteralInteger", "name" : "'Array member'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpGenericPtrMemSemantics", + "opcode" : 69, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpInBoundsPtrAccessChain", + "opcode" : 70, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Element'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpDecorate", + "opcode" : 71, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "Decoration" } + ] + }, + { + "opname" : "OpMemberDecorate", + "opcode" : 72, + "operands" : [ + { "kind" : "IdRef", "name" : "'Structure Type'" }, + { "kind" : "LiteralInteger", "name" : "'Member'" }, + { "kind" : "Decoration" } + ] + }, + { + "opname" : "OpDecorationGroup", + "opcode" : 73, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpGroupDecorate", + "opcode" : 74, + "operands" : [ + { "kind" : "IdRef", "name" : "'Decoration Group'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Targets'" } + ] + }, + { + "opname" : "OpGroupMemberDecorate", + "opcode" : 75, + "operands" : [ + { "kind" : "IdRef", "name" : "'Decoration Group'" }, + { "kind" : "PairIdRefLiteralInteger", "quantifier" : "*", "name" : "'Targets'" } + ] + }, + { + "opname" : "OpVectorExtractDynamic", + "opcode" : 77, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" }, + { "kind" : "IdRef", "name" : "'Index'" } + ] + }, + { + "opname" : "OpVectorInsertDynamic", + "opcode" : 78, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" }, + { "kind" : "IdRef", "name" : "'Component'" }, + { "kind" : "IdRef", "name" : "'Index'" } + ] + }, + { + "opname" : "OpVectorShuffle", + "opcode" : 79, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector 1'" }, + { "kind" : "IdRef", "name" : "'Vector 2'" }, + { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Components'" } + ] + }, + { + "opname" : "OpCompositeConstruct", + "opcode" : 80, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } + ] + }, + { + "opname" : "OpCompositeExtract", + "opcode" : 81, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Composite'" }, + { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpCompositeInsert", + "opcode" : 82, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Object'" }, + { "kind" : "IdRef", "name" : "'Composite'" }, + { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpCopyObject", + "opcode" : 83, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpTranspose", + "opcode" : 84, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Matrix'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpSampledImage", + "opcode" : 86, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Sampler'" } + ] + }, + { + "opname" : "OpImageSampleImplicitLod", + "opcode" : 87, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleExplicitLod", + "opcode" : 88, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands" } + ] + }, + { + "opname" : "OpImageSampleDrefImplicitLod", + "opcode" : 89, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleDrefExplicitLod", + "opcode" : 90, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleProjImplicitLod", + "opcode" : 91, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleProjExplicitLod", + "opcode" : 92, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleProjDrefImplicitLod", + "opcode" : 93, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleProjDrefExplicitLod", + "opcode" : 94, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageFetch", + "opcode" : 95, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ] + }, + { + "opname" : "OpImageGather", + "opcode" : 96, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Component'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageDrefGather", + "opcode" : 97, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageRead", + "opcode" : 98, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ] + }, + { + "opname" : "OpImageWrite", + "opcode" : 99, + "operands" : [ + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Texel'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ] + }, + { + "opname" : "OpImage", + "opcode" : 100, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" } + ] + }, + { + "opname" : "OpImageQueryFormat", + "opcode" : 101, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpImageQueryOrder", + "opcode" : 102, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpImageQuerySizeLod", + "opcode" : 103, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Level of Detail'" } + ], + "capabilities" : [ "Kernel", "ImageQuery" ] + }, + { + "opname" : "OpImageQuerySize", + "opcode" : 104, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel", "ImageQuery" ] + }, + { + "opname" : "OpImageQueryLod", + "opcode" : 105, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" } + ], + "capabilities" : [ "ImageQuery" ] + }, + { + "opname" : "OpImageQueryLevels", + "opcode" : 106, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel", "ImageQuery" ] + }, + { + "opname" : "OpImageQuerySamples", + "opcode" : 107, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel", "ImageQuery" ] + }, + { + "opname" : "OpConvertFToU", + "opcode" : 109, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Float Value'" } + ] + }, + { + "opname" : "OpConvertFToS", + "opcode" : 110, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Float Value'" } + ] + }, + { + "opname" : "OpConvertSToF", + "opcode" : 111, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Signed Value'" } + ] + }, + { + "opname" : "OpConvertUToF", + "opcode" : 112, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Unsigned Value'" } + ] + }, + { + "opname" : "OpUConvert", + "opcode" : 113, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Unsigned Value'" } + ] + }, + { + "opname" : "OpSConvert", + "opcode" : 114, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Signed Value'" } + ] + }, + { + "opname" : "OpFConvert", + "opcode" : 115, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Float Value'" } + ] + }, + { + "opname" : "OpQuantizeToF16", + "opcode" : 116, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpConvertPtrToU", + "opcode" : 117, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpSatConvertSToU", + "opcode" : 118, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Signed Value'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpSatConvertUToS", + "opcode" : 119, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Unsigned Value'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpConvertUToPtr", + "opcode" : 120, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Integer Value'" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpPtrCastToGeneric", + "opcode" : 121, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGenericCastToPtr", + "opcode" : 122, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGenericCastToPtrExplicit", + "opcode" : 123, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "StorageClass", "name" : "'Storage'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpBitcast", + "opcode" : 124, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpSNegate", + "opcode" : 126, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpFNegate", + "opcode" : 127, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpIAdd", + "opcode" : 128, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFAdd", + "opcode" : 129, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpISub", + "opcode" : 130, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFSub", + "opcode" : 131, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpIMul", + "opcode" : 132, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFMul", + "opcode" : 133, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUDiv", + "opcode" : 134, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSDiv", + "opcode" : 135, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFDiv", + "opcode" : 136, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUMod", + "opcode" : 137, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSRem", + "opcode" : 138, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSMod", + "opcode" : 139, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFRem", + "opcode" : 140, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFMod", + "opcode" : 141, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpVectorTimesScalar", + "opcode" : 142, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" }, + { "kind" : "IdRef", "name" : "'Scalar'" } + ] + }, + { + "opname" : "OpMatrixTimesScalar", + "opcode" : 143, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Matrix'" }, + { "kind" : "IdRef", "name" : "'Scalar'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpVectorTimesMatrix", + "opcode" : 144, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" }, + { "kind" : "IdRef", "name" : "'Matrix'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpMatrixTimesVector", + "opcode" : 145, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Matrix'" }, + { "kind" : "IdRef", "name" : "'Vector'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpMatrixTimesMatrix", + "opcode" : 146, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'LeftMatrix'" }, + { "kind" : "IdRef", "name" : "'RightMatrix'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpOuterProduct", + "opcode" : 147, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector 1'" }, + { "kind" : "IdRef", "name" : "'Vector 2'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpDot", + "opcode" : 148, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector 1'" }, + { "kind" : "IdRef", "name" : "'Vector 2'" } + ] + }, + { + "opname" : "OpIAddCarry", + "opcode" : 149, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpISubBorrow", + "opcode" : 150, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUMulExtended", + "opcode" : 151, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSMulExtended", + "opcode" : 152, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpAny", + "opcode" : 154, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" } + ] + }, + { + "opname" : "OpAll", + "opcode" : 155, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" } + ] + }, + { + "opname" : "OpIsNan", + "opcode" : 156, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "OpIsInf", + "opcode" : 157, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "OpIsFinite", + "opcode" : 158, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpIsNormal", + "opcode" : 159, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpSignBitSet", + "opcode" : 160, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpLessOrGreater", + "opcode" : 161, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpOrdered", + "opcode" : 162, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpUnordered", + "opcode" : 163, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpLogicalEqual", + "opcode" : 164, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpLogicalNotEqual", + "opcode" : 165, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpLogicalOr", + "opcode" : 166, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpLogicalAnd", + "opcode" : 167, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpLogicalNot", + "opcode" : 168, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpSelect", + "opcode" : 169, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Condition'" }, + { "kind" : "IdRef", "name" : "'Object 1'" }, + { "kind" : "IdRef", "name" : "'Object 2'" } + ] + }, + { + "opname" : "OpIEqual", + "opcode" : 170, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpINotEqual", + "opcode" : 171, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUGreaterThan", + "opcode" : 172, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSGreaterThan", + "opcode" : 173, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUGreaterThanEqual", + "opcode" : 174, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSGreaterThanEqual", + "opcode" : 175, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpULessThan", + "opcode" : 176, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSLessThan", + "opcode" : 177, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpULessThanEqual", + "opcode" : 178, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSLessThanEqual", + "opcode" : 179, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdEqual", + "opcode" : 180, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordEqual", + "opcode" : 181, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdNotEqual", + "opcode" : 182, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordNotEqual", + "opcode" : 183, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdLessThan", + "opcode" : 184, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordLessThan", + "opcode" : 185, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdGreaterThan", + "opcode" : 186, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordGreaterThan", + "opcode" : 187, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdLessThanEqual", + "opcode" : 188, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordLessThanEqual", + "opcode" : 189, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdGreaterThanEqual", + "opcode" : 190, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordGreaterThanEqual", + "opcode" : 191, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpShiftRightLogical", + "opcode" : 194, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Shift'" } + ] + }, + { + "opname" : "OpShiftRightArithmetic", + "opcode" : 195, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Shift'" } + ] + }, + { + "opname" : "OpShiftLeftLogical", + "opcode" : 196, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Shift'" } + ] + }, + { + "opname" : "OpBitwiseOr", + "opcode" : 197, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpBitwiseXor", + "opcode" : 198, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpBitwiseAnd", + "opcode" : 199, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpNot", + "opcode" : 200, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpBitFieldInsert", + "opcode" : 201, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Insert'" }, + { "kind" : "IdRef", "name" : "'Offset'" }, + { "kind" : "IdRef", "name" : "'Count'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpBitFieldSExtract", + "opcode" : 202, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Offset'" }, + { "kind" : "IdRef", "name" : "'Count'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpBitFieldUExtract", + "opcode" : 203, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Offset'" }, + { "kind" : "IdRef", "name" : "'Count'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpBitReverse", + "opcode" : 204, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpBitCount", + "opcode" : 205, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" } + ] + }, + { + "opname" : "OpDPdx", + "opcode" : 207, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpDPdy", + "opcode" : 208, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpFwidth", + "opcode" : 209, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpDPdxFine", + "opcode" : 210, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpDPdyFine", + "opcode" : 211, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpFwidthFine", + "opcode" : 212, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpDPdxCoarse", + "opcode" : 213, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpDPdyCoarse", + "opcode" : 214, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpFwidthCoarse", + "opcode" : 215, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpEmitVertex", + "opcode" : 218, + "capabilities" : [ "Geometry" ] + }, + { + "opname" : "OpEndPrimitive", + "opcode" : 219, + "capabilities" : [ "Geometry" ] + }, + { + "opname" : "OpEmitStreamVertex", + "opcode" : 220, + "operands" : [ + { "kind" : "IdRef", "name" : "'Stream'" } + ], + "capabilities" : [ "GeometryStreams" ] + }, + { + "opname" : "OpEndStreamPrimitive", + "opcode" : 221, + "operands" : [ + { "kind" : "IdRef", "name" : "'Stream'" } + ], + "capabilities" : [ "GeometryStreams" ] + }, + { + "opname" : "OpControlBarrier", + "opcode" : 224, + "operands" : [ + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdScope", "name" : "'Memory'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpMemoryBarrier", + "opcode" : 225, + "operands" : [ + { "kind" : "IdScope", "name" : "'Memory'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpAtomicLoad", + "opcode" : 227, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpAtomicStore", + "opcode" : 228, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicExchange", + "opcode" : 229, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicCompareExchange", + "opcode" : 230, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, + { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Comparator'" } + ] + }, + { + "opname" : "OpAtomicCompareExchangeWeak", + "opcode" : 231, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, + { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Comparator'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpAtomicIIncrement", + "opcode" : 232, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpAtomicIDecrement", + "opcode" : 233, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpAtomicIAdd", + "opcode" : 234, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicISub", + "opcode" : 235, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicSMin", + "opcode" : 236, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicUMin", + "opcode" : 237, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicSMax", + "opcode" : 238, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicUMax", + "opcode" : 239, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicAnd", + "opcode" : 240, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicOr", + "opcode" : 241, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicXor", + "opcode" : 242, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpPhi", + "opcode" : 245, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "PairIdRefIdRef", "quantifier" : "*", "name" : "'Variable, Parent, ...'" } + ] + }, + { + "opname" : "OpLoopMerge", + "opcode" : 246, + "operands" : [ + { "kind" : "IdRef", "name" : "'Merge Block'" }, + { "kind" : "IdRef", "name" : "'Continue Target'" }, + { "kind" : "LoopControl" } + ] + }, + { + "opname" : "OpSelectionMerge", + "opcode" : 247, + "operands" : [ + { "kind" : "IdRef", "name" : "'Merge Block'" }, + { "kind" : "SelectionControl" } + ] + }, + { + "opname" : "OpLabel", + "opcode" : 248, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpBranch", + "opcode" : 249, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target Label'" } + ] + }, + { + "opname" : "OpBranchConditional", + "opcode" : 250, + "operands" : [ + { "kind" : "IdRef", "name" : "'Condition'" }, + { "kind" : "IdRef", "name" : "'True Label'" }, + { "kind" : "IdRef", "name" : "'False Label'" }, + { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Branch weights'" } + ] + }, + { + "opname" : "OpSwitch", + "opcode" : 251, + "operands" : [ + { "kind" : "IdRef", "name" : "'Selector'" }, + { "kind" : "IdRef", "name" : "'Default'" }, + { "kind" : "PairLiteralIntegerIdRef", "quantifier" : "*", "name" : "'Target'" } + ] + }, + { + "opname" : "OpKill", + "opcode" : 252, + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpReturn", + "opcode" : 253 + }, + { + "opname" : "OpReturnValue", + "opcode" : 254, + "operands" : [ + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpUnreachable", + "opcode" : 255 + }, + { + "opname" : "OpLifetimeStart", + "opcode" : 256, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "LiteralInteger", "name" : "'Size'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpLifetimeStop", + "opcode" : 257, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "LiteralInteger", "name" : "'Size'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGroupAsyncCopy", + "opcode" : 259, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Destination'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "IdRef", "name" : "'Num Elements'" }, + { "kind" : "IdRef", "name" : "'Stride'" }, + { "kind" : "IdRef", "name" : "'Event'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGroupWaitEvents", + "opcode" : 260, + "operands" : [ + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Num Events'" }, + { "kind" : "IdRef", "name" : "'Events List'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGroupAll", + "opcode" : 261, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupAny", + "opcode" : 262, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupBroadcast", + "opcode" : 263, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'LocalId'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupIAdd", + "opcode" : 264, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFAdd", + "opcode" : 265, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFMin", + "opcode" : 266, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupUMin", + "opcode" : 267, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupSMin", + "opcode" : 268, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFMax", + "opcode" : 269, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupUMax", + "opcode" : 270, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupSMax", + "opcode" : 271, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpReadPipe", + "opcode" : 274, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpWritePipe", + "opcode" : 275, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpReservedReadPipe", + "opcode" : 276, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Index'" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpReservedWritePipe", + "opcode" : 277, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Index'" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpReserveReadPipePackets", + "opcode" : 278, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Num Packets'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpReserveWritePipePackets", + "opcode" : 279, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Num Packets'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpCommitReadPipe", + "opcode" : 280, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpCommitWritePipe", + "opcode" : 281, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpIsValidReserveId", + "opcode" : 282, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGetNumPipePackets", + "opcode" : 283, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGetMaxPipePackets", + "opcode" : 284, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGroupReserveReadPipePackets", + "opcode" : 285, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Num Packets'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGroupReserveWritePipePackets", + "opcode" : 286, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Num Packets'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGroupCommitReadPipe", + "opcode" : 287, + "operands" : [ + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGroupCommitWritePipe", + "opcode" : 288, + "operands" : [ + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpEnqueueMarker", + "opcode" : 291, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Queue'" }, + { "kind" : "IdRef", "name" : "'Num Events'" }, + { "kind" : "IdRef", "name" : "'Wait Events'" }, + { "kind" : "IdRef", "name" : "'Ret Event'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpEnqueueKernel", + "opcode" : 292, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Queue'" }, + { "kind" : "IdRef", "name" : "'Flags'" }, + { "kind" : "IdRef", "name" : "'ND Range'" }, + { "kind" : "IdRef", "name" : "'Num Events'" }, + { "kind" : "IdRef", "name" : "'Wait Events'" }, + { "kind" : "IdRef", "name" : "'Ret Event'" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Local Size'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetKernelNDrangeSubGroupCount", + "opcode" : 293, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'ND Range'" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetKernelNDrangeMaxSubGroupSize", + "opcode" : 294, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'ND Range'" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetKernelWorkGroupSize", + "opcode" : 295, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetKernelPreferredWorkGroupSizeMultiple", + "opcode" : 296, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpRetainEvent", + "opcode" : 297, + "operands" : [ + { "kind" : "IdRef", "name" : "'Event'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpReleaseEvent", + "opcode" : 298, + "operands" : [ + { "kind" : "IdRef", "name" : "'Event'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpCreateUserEvent", + "opcode" : 299, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpIsValidEvent", + "opcode" : 300, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Event'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpSetUserEventStatus", + "opcode" : 301, + "operands" : [ + { "kind" : "IdRef", "name" : "'Event'" }, + { "kind" : "IdRef", "name" : "'Status'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpCaptureEventProfilingInfo", + "opcode" : 302, + "operands" : [ + { "kind" : "IdRef", "name" : "'Event'" }, + { "kind" : "IdRef", "name" : "'Profiling Info'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetDefaultQueue", + "opcode" : 303, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpBuildNDRange", + "opcode" : 304, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'GlobalWorkSize'" }, + { "kind" : "IdRef", "name" : "'LocalWorkSize'" }, + { "kind" : "IdRef", "name" : "'GlobalWorkOffset'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpImageSparseSampleImplicitLod", + "opcode" : 305, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleExplicitLod", + "opcode" : 306, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleDrefImplicitLod", + "opcode" : 307, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleDrefExplicitLod", + "opcode" : 308, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleProjImplicitLod", + "opcode" : 309, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleProjExplicitLod", + "opcode" : 310, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleProjDrefImplicitLod", + "opcode" : 311, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleProjDrefExplicitLod", + "opcode" : 312, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseFetch", + "opcode" : 313, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseGather", + "opcode" : 314, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Component'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseDrefGather", + "opcode" : 315, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseTexelsResident", + "opcode" : 316, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Resident Code'" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpNoLine", + "opcode" : 317 + }, + { + "opname" : "OpAtomicFlagTestAndSet", + "opcode" : 318, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpAtomicFlagClear", + "opcode" : 319, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpImageSparseRead", + "opcode" : 320, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpSizeOf", + "opcode" : 321, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpTypePipeStorage", + "opcode" : 322, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "PipeStorage" ] + }, + { + "opname" : "OpConstantPipeStorage", + "opcode" : 323, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "LiteralInteger", "name" : "'Packet Size'" }, + { "kind" : "LiteralInteger", "name" : "'Packet Alignment'" }, + { "kind" : "LiteralInteger", "name" : "'Capacity'" } + ], + "capabilities" : [ "PipeStorage" ] + }, + { + "opname" : "OpCreatePipeFromPipeStorage", + "opcode" : 324, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe Storage'" } + ], + "capabilities" : [ "PipeStorage" ] + }, + { + "opname" : "OpGetKernelLocalSizeForSubgroupCount", + "opcode" : 325, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Subgroup Count'" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "SubgroupDispatch" ] + }, + { + "opname" : "OpGetKernelMaxNumSubgroups", + "opcode" : 326, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "SubgroupDispatch" ] + }, + { + "opname" : "OpTypeNamedBarrier", + "opcode" : 327, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "NamedBarrier" ] + }, + { + "opname" : "OpNamedBarrierInitialize", + "opcode" : 328, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Subgroup Count'" } + ], + "capabilities" : [ "NamedBarrier" ] + }, + { + "opname" : "OpMemoryNamedBarrier", + "opcode" : 329, + "operands" : [ + { "kind" : "IdRef", "name" : "'Named Barrier'" }, + { "kind" : "IdScope", "name" : "'Memory'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ], + "capabilities" : [ "NamedBarrier" ] + }, + { + "opname" : "OpModuleProcessed", + "opcode" : 330, + "operands" : [ + { "kind" : "LiteralString", "name" : "'Process'" } + ] + }, + { + "opname" : "OpExecutionModeId", + "opcode" : 331, + "operands" : [ + { "kind" : "IdRef", "name" : "'Entry Point'" }, + { "kind" : "ExecutionMode", "name" : "'Mode'" } + ] + }, + { + "opname" : "OpDecorateId", + "opcode" : 332, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "Decoration" } + ] + }, + { + "opname" : "OpSubgroupBallotKHR", + "opcode" : 4421, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "opname" : "OpSubgroupFirstInvocationKHR", + "opcode" : 4422, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "opname" : "OpSubgroupAllKHR", + "opcode" : 4428, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "SubgroupVoteKHR" ] + }, + { + "opname" : "OpSubgroupAnyKHR", + "opcode" : 4429, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "SubgroupVoteKHR" ] + }, + { + "opname" : "OpSubgroupAllEqualKHR", + "opcode" : 4430, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "SubgroupVoteKHR" ] + }, + { + "opname" : "OpSubgroupReadInvocationKHR", + "opcode" : 4432, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Index'" } + ], + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "opname" : "OpGroupIAddNonUniformAMD", + "opcode" : 5000, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFAddNonUniformAMD", + "opcode" : 5001, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFMinNonUniformAMD", + "opcode" : 5002, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupUMinNonUniformAMD", + "opcode" : 5003, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupSMinNonUniformAMD", + "opcode" : 5004, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFMaxNonUniformAMD", + "opcode" : 5005, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupUMaxNonUniformAMD", + "opcode" : 5006, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupSMaxNonUniformAMD", + "opcode" : 5007, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpFragmentMaskFetchAMD", + "opcode" : 5011, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" } + ], + "capabilities" : [ "FragmentMaskAMD" ] + }, + { + "opname" : "OpFragmentFetchAMD", + "opcode" : 5012, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Fragment Index'" } + ], + "capabilities" : [ "FragmentMaskAMD" ] + }, + { + "opname" : "OpSubgroupShuffleINTEL", + "opcode" : 5571, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Data'" }, + { "kind" : "IdRef", "name" : "'InvocationId'" } + ], + "capabilities" : [ "SubgroupShuffleINTEL" ] + }, + { + "opname" : "OpSubgroupShuffleDownINTEL", + "opcode" : 5572, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Current'" }, + { "kind" : "IdRef", "name" : "'Next'" }, + { "kind" : "IdRef", "name" : "'Delta'" } + ], + "capabilities" : [ "SubgroupShuffleINTEL" ] + }, + { + "opname" : "OpSubgroupShuffleUpINTEL", + "opcode" : 5573, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Previous'" }, + { "kind" : "IdRef", "name" : "'Current'" }, + { "kind" : "IdRef", "name" : "'Delta'" } + ], + "capabilities" : [ "SubgroupShuffleINTEL" ] + }, + { + "opname" : "OpSubgroupShuffleXorINTEL", + "opcode" : 5574, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Data'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "SubgroupShuffleINTEL" ] + }, + { + "opname" : "OpSubgroupBlockReadINTEL", + "opcode" : 5575, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Ptr'" } + ], + "capabilities" : [ "SubgroupBufferBlockIOINTEL" ] + }, + { + "opname" : "OpSubgroupBlockWriteINTEL", + "opcode" : 5576, + "operands" : [ + { "kind" : "IdRef", "name" : "'Ptr'" }, + { "kind" : "IdRef", "name" : "'Data'" } + ], + "capabilities" : [ "SubgroupBufferBlockIOINTEL" ] + }, + { + "opname" : "OpSubgroupImageBlockReadINTEL", + "opcode" : 5577, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" } + ], + "capabilities" : [ "SubgroupImageBlockIOINTEL" ] + }, + { + "opname" : "OpSubgroupImageBlockWriteINTEL", + "opcode" : 5578, + "operands" : [ + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Data'" } + ], + "capabilities" : [ "SubgroupImageBlockIOINTEL" ] + }, + { + "opname" : "OpDecorateStringGOOGLE", + "opcode" : 5632, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "Decoration" } + ], + "extensions" : [ "SPV_GOOGLE_decorate_string" ] + }, + { + "opname" : "OpMemberDecorateStringGOOGLE", + "opcode" : 5633, + "operands" : [ + { "kind" : "IdRef", "name" : "'Struct Type'" }, + { "kind" : "LiteralInteger", "name" : "'Member'" }, + { "kind" : "Decoration" } + ], + "extensions" : [ "SPV_GOOGLE_decorate_string" ] + } + ], + "operand_kinds" : [ + { + "category" : "BitEnum", + "kind" : "ImageOperands", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Bias", + "value" : "0x0001", + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "Lod", + "value" : "0x0002", + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "Grad", + "value" : "0x0004", + "parameters" : [ + { "kind" : "IdRef" }, + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "ConstOffset", + "value" : "0x0008", + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "Offset", + "value" : "0x0010", + "capabilities" : [ "ImageGatherExtended" ], + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "ConstOffsets", + "value" : "0x0020", + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "Sample", + "value" : "0x0040", + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "MinLod", + "value" : "0x0080", + "capabilities" : [ "MinLod" ], + "parameters" : [ + { "kind" : "IdRef" } + ] + } + ] + }, + { + "category" : "BitEnum", + "kind" : "FPFastMathMode", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "NotNaN", + "value" : "0x0001", + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NotInf", + "value" : "0x0002", + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NSZ", + "value" : "0x0004", + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "AllowRecip", + "value" : "0x0008", + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Fast", + "value" : "0x0010", + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "BitEnum", + "kind" : "SelectionControl", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Flatten", + "value" : "0x0001" + }, + { + "enumerant" : "DontFlatten", + "value" : "0x0002" + } + ] + }, + { + "category" : "BitEnum", + "kind" : "LoopControl", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Unroll", + "value" : "0x0001" + }, + { + "enumerant" : "DontUnroll", + "value" : "0x0002" + }, + { + "enumerant" : "DependencyInfinite", + "value" : "0x0004" + }, + { + "enumerant" : "DependencyLength", + "value" : "0x0008", + "parameters" : [ + { "kind" : "LiteralInteger" } + ] + + } + ] + }, + { + "category" : "BitEnum", + "kind" : "FunctionControl", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Inline", + "value" : "0x0001" + }, + { + "enumerant" : "DontInline", + "value" : "0x0002" + }, + { + "enumerant" : "Pure", + "value" : "0x0004" + }, + { + "enumerant" : "Const", + "value" : "0x0008" + } + ] + }, + { + "category" : "BitEnum", + "kind" : "MemorySemantics", + "enumerants" : [ + { + "enumerant" : "Relaxed", + "value" : "0x0000" + }, + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Acquire", + "value" : "0x0002" + }, + { + "enumerant" : "Release", + "value" : "0x0004" + }, + { + "enumerant" : "AcquireRelease", + "value" : "0x0008" + }, + { + "enumerant" : "SequentiallyConsistent", + "value" : "0x0010" + }, + { + "enumerant" : "UniformMemory", + "value" : "0x0040", + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SubgroupMemory", + "value" : "0x0080" + }, + { + "enumerant" : "WorkgroupMemory", + "value" : "0x0100" + }, + { + "enumerant" : "CrossWorkgroupMemory", + "value" : "0x0200" + }, + { + "enumerant" : "AtomicCounterMemory", + "value" : "0x0400", + "capabilities" : [ "AtomicStorage" ] + }, + { + "enumerant" : "ImageMemory", + "value" : "0x0800" + } + ] + }, + { + "category" : "BitEnum", + "kind" : "MemoryAccess", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Volatile", + "value" : "0x0001" + }, + { + "enumerant" : "Aligned", + "value" : "0x0002", + "parameters" : [ + { "kind" : "LiteralInteger" } + ] + }, + { + "enumerant" : "Nontemporal", + "value" : "0x0004" + } + ] + }, + { + "category" : "BitEnum", + "kind" : "KernelProfilingInfo", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "CmdExecTime", + "value" : "0x0001", + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "SourceLanguage", + "enumerants" : [ + { + "enumerant" : "Unknown", + "value" : 0 + }, + { + "enumerant" : "ESSL", + "value" : 1 + }, + { + "enumerant" : "GLSL", + "value" : 2 + }, + { + "enumerant" : "OpenCL_C", + "value" : 3 + }, + { + "enumerant" : "OpenCL_CPP", + "value" : 4 + }, + { + "enumerant" : "HLSL", + "value" : 5 + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ExecutionModel", + "enumerants" : [ + { + "enumerant" : "Vertex", + "value" : 0, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "TessellationControl", + "value" : 1, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "TessellationEvaluation", + "value" : 2, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "Geometry", + "value" : 3, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "Fragment", + "value" : 4, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GLCompute", + "value" : 5, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Kernel", + "value" : 6, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "AddressingModel", + "enumerants" : [ + { + "enumerant" : "Logical", + "value" : 0 + }, + { + "enumerant" : "Physical32", + "value" : 1, + "capabilities" : [ "Addresses" ] + }, + { + "enumerant" : "Physical64", + "value" : 2, + "capabilities" : [ "Addresses" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "MemoryModel", + "enumerants" : [ + { + "enumerant" : "Simple", + "value" : 0, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GLSL450", + "value" : 1, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "OpenCL", + "value" : 2, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ExecutionMode", + "enumerants" : [ + { + "enumerant" : "Invocations", + "value" : 0, + "capabilities" : [ "Geometry" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Number of <>'" } + ] + }, + { + "enumerant" : "SpacingEqual", + "value" : 1, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "SpacingFractionalEven", + "value" : 2, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "SpacingFractionalOdd", + "value" : 3, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "VertexOrderCw", + "value" : 4, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "VertexOrderCcw", + "value" : 5, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "PixelCenterInteger", + "value" : 6, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "OriginUpperLeft", + "value" : 7, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "OriginLowerLeft", + "value" : 8, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "EarlyFragmentTests", + "value" : 9, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "PointMode", + "value" : 10, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "Xfb", + "value" : 11, + "capabilities" : [ "TransformFeedback" ] + }, + { + "enumerant" : "DepthReplacing", + "value" : 12, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "DepthGreater", + "value" : 14, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "DepthLess", + "value" : 15, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "DepthUnchanged", + "value" : 16, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "LocalSize", + "value" : 17, + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'x size'" }, + { "kind" : "LiteralInteger", "name" : "'y size'" }, + { "kind" : "LiteralInteger", "name" : "'z size'" } + ] + }, + { + "enumerant" : "LocalSizeHint", + "value" : 18, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'x size'" }, + { "kind" : "LiteralInteger", "name" : "'y size'" }, + { "kind" : "LiteralInteger", "name" : "'z size'" } + ] + }, + { + "enumerant" : "InputPoints", + "value" : 19, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "InputLines", + "value" : 20, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "InputLinesAdjacency", + "value" : 21, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "Triangles", + "value" : 22, + "capabilities" : [ "Geometry", "Tessellation" ] + }, + { + "enumerant" : "InputTrianglesAdjacency", + "value" : 23, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "Quads", + "value" : 24, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "Isolines", + "value" : 25, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "OutputVertices", + "value" : 26, + "capabilities" : [ "Geometry", "Tessellation" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Vertex count'" } + ] + }, + { + "enumerant" : "OutputPoints", + "value" : 27, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "OutputLineStrip", + "value" : 28, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "OutputTriangleStrip", + "value" : 29, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "VecTypeHint", + "value" : 30, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Vector type'" } + ] + }, + { + "enumerant" : "ContractionOff", + "value" : 31, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Initializer", + "value" : 33, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Finalizer", + "value" : 34, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SubgroupSize", + "value" : 35, + "capabilities" : [ "SubgroupDispatch" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Subgroup Size'" } + ] + }, + { + "enumerant" : "SubgroupsPerWorkgroup", + "value" : 36, + "capabilities" : [ "SubgroupDispatch" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Subgroups Per Workgroup'" } + ] + }, + { + "enumerant" : "SubgroupsPerWorkgroupId", + "value" : 37, + "capabilities" : [ "SubgroupDispatch" ], + "parameters" : [ + { "kind" : "IdRef", "name" : "'Subgroups Per Workgroup'" } + ] + }, + { + "enumerant" : "LocalSizeId", + "value" : 38, + "parameters" : [ + { "kind" : "IdRef", "name" : "'x size'" }, + { "kind" : "IdRef", "name" : "'y size'" }, + { "kind" : "IdRef", "name" : "'z size'" } + ] + }, + { + "enumerant" : "LocalSizeHintId", + "value" : 39, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "IdRef", "name" : "'Local Size Hint'" } + ] + }, + { + "enumerant" : "PostDepthCoverage", + "value" : 4446, + "capabilities" : [ "SampleMaskPostDepthCoverage" ] + }, + { + "enumerant" : "StencilRefReplacingEXT", + "value" : 5027, + "capabilities" : [ "StencilExportEXT" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "StorageClass", + "enumerants" : [ + { + "enumerant" : "UniformConstant", + "value" : 0 + }, + { + "enumerant" : "Input", + "value" : 1 + }, + { + "enumerant" : "Uniform", + "value" : 2, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Output", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Workgroup", + "value" : 4 + }, + { + "enumerant" : "CrossWorkgroup", + "value" : 5 + }, + { + "enumerant" : "Private", + "value" : 6, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Function", + "value" : 7 + }, + { + "enumerant" : "Generic", + "value" : 8, + "capabilities" : [ "GenericPointer" ] + }, + { + "enumerant" : "PushConstant", + "value" : 9, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "AtomicCounter", + "value" : 10, + "capabilities" : [ "AtomicStorage" ] + }, + { + "enumerant" : "Image", + "value" : 11 + }, + { + "enumerant" : "StorageBuffer", + "value" : 12, + "extensions" : [ + "SPV_KHR_storage_buffer_storage_class", + "SPV_KHR_variable_pointers" + ], + "capabilities" : [ "Shader" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "Dim", + "enumerants" : [ + { + "enumerant" : "1D", + "value" : 0, + "capabilities" : [ "Sampled1D" ] + }, + { + "enumerant" : "2D", + "value" : 1 + }, + { + "enumerant" : "3D", + "value" : 2 + }, + { + "enumerant" : "Cube", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rect", + "value" : 4, + "capabilities" : [ "SampledRect" ] + }, + { + "enumerant" : "Buffer", + "value" : 5, + "capabilities" : [ "SampledBuffer" ] + }, + { + "enumerant" : "SubpassData", + "value" : 6, + "capabilities" : [ "InputAttachment" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "SamplerAddressingMode", + "enumerants" : [ + { + "enumerant" : "None", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ClampToEdge", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Clamp", + "value" : 2, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Repeat", + "value" : 3, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RepeatMirrored", + "value" : 4, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "SamplerFilterMode", + "enumerants" : [ + { + "enumerant" : "Nearest", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Linear", + "value" : 1, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ImageFormat", + "enumerants" : [ + { + "enumerant" : "Unknown", + "value" : 0 + }, + { + "enumerant" : "Rgba32f", + "value" : 1, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba16f", + "value" : 2, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "R32f", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba8", + "value" : 4, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba8Snorm", + "value" : 5, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rg32f", + "value" : 6, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16f", + "value" : 7, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R11fG11fB10f", + "value" : 8, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16f", + "value" : 9, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgba16", + "value" : 10, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgb10A2", + "value" : 11, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16", + "value" : 12, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg8", + "value" : 13, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16", + "value" : 14, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R8", + "value" : 15, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgba16Snorm", + "value" : 16, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16Snorm", + "value" : 17, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg8Snorm", + "value" : 18, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16Snorm", + "value" : 19, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R8Snorm", + "value" : 20, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgba32i", + "value" : 21, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba16i", + "value" : 22, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba8i", + "value" : 23, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "R32i", + "value" : 24, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rg32i", + "value" : 25, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16i", + "value" : 26, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg8i", + "value" : 27, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16i", + "value" : 28, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R8i", + "value" : 29, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgba32ui", + "value" : 30, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba16ui", + "value" : 31, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba8ui", + "value" : 32, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "R32ui", + "value" : 33, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgb10a2ui", + "value" : 34, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg32ui", + "value" : 35, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16ui", + "value" : 36, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg8ui", + "value" : 37, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16ui", + "value" : 38, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R8ui", + "value" : 39, + "capabilities" : [ "StorageImageExtendedFormats" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ImageChannelOrder", + "enumerants" : [ + { + "enumerant" : "R", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "A", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RG", + "value" : 2, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RA", + "value" : 3, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RGB", + "value" : 4, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RGBA", + "value" : 5, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "BGRA", + "value" : 6, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ARGB", + "value" : 7, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Intensity", + "value" : 8, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Luminance", + "value" : 9, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Rx", + "value" : 10, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RGx", + "value" : 11, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RGBx", + "value" : 12, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Depth", + "value" : 13, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "DepthStencil", + "value" : 14, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "sRGB", + "value" : 15, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "sRGBx", + "value" : 16, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "sRGBA", + "value" : 17, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "sBGRA", + "value" : 18, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ABGR", + "value" : 19, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ImageChannelDataType", + "enumerants" : [ + { + "enumerant" : "SnormInt8", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SnormInt16", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt8", + "value" : 2, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt16", + "value" : 3, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormShort565", + "value" : 4, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormShort555", + "value" : 5, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt101010", + "value" : 6, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SignedInt8", + "value" : 7, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SignedInt16", + "value" : 8, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SignedInt32", + "value" : 9, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnsignedInt8", + "value" : 10, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnsignedInt16", + "value" : 11, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnsignedInt32", + "value" : 12, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "HalfFloat", + "value" : 13, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Float", + "value" : 14, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt24", + "value" : 15, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt101010_2", + "value" : 16, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "FPRoundingMode", + "enumerants" : [ + { + "enumerant" : "RTE", + "value" : 0, + "capabilities" : [ + "Kernel", + "StorageUniformBufferBlock16", + "StorageUniform16", + "StoragePushConstant16", + "StorageInputOutput16" + ] + }, + { + "enumerant" : "RTZ", + "value" : 1, + "capabilities" : [ + "Kernel", + "StorageUniformBufferBlock16", + "StorageUniform16", + "StoragePushConstant16", + "StorageInputOutput16" + ] + }, + { + "enumerant" : "RTP", + "value" : 2, + "capabilities" : [ + "Kernel", + "StorageUniformBufferBlock16", + "StorageUniform16", + "StoragePushConstant16", + "StorageInputOutput16" + ] + }, + { + "enumerant" : "RTN", + "value" : 3, + "capabilities" : [ + "Kernel", + "StorageUniformBufferBlock16", + "StorageUniform16", + "StoragePushConstant16", + "StorageInputOutput16" + ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "LinkageType", + "enumerants" : [ + { + "enumerant" : "Export", + "value" : 0, + "capabilities" : [ "Linkage" ] + }, + { + "enumerant" : "Import", + "value" : 1, + "capabilities" : [ "Linkage" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "AccessQualifier", + "enumerants" : [ + { + "enumerant" : "ReadOnly", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "WriteOnly", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ReadWrite", + "value" : 2, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "FunctionParameterAttribute", + "enumerants" : [ + { + "enumerant" : "Zext", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Sext", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ByVal", + "value" : 2, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Sret", + "value" : 3, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NoAlias", + "value" : 4, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NoCapture", + "value" : 5, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NoWrite", + "value" : 6, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NoReadWrite", + "value" : 7, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "Decoration", + "enumerants" : [ + { + "enumerant" : "RelaxedPrecision", + "value" : 0, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SpecId", + "value" : 1, + "capabilities" : [ "Shader", "Kernel" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Specialization Constant ID'" } + ] + }, + { + "enumerant" : "Block", + "value" : 2, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "BufferBlock", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "RowMajor", + "value" : 4, + "capabilities" : [ "Matrix" ] + }, + { + "enumerant" : "ColMajor", + "value" : 5, + "capabilities" : [ "Matrix" ] + }, + { + "enumerant" : "ArrayStride", + "value" : 6, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Array Stride'" } + ] + }, + { + "enumerant" : "MatrixStride", + "value" : 7, + "capabilities" : [ "Matrix" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Matrix Stride'" } + ] + }, + { + "enumerant" : "GLSLShared", + "value" : 8, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GLSLPacked", + "value" : 9, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "CPacked", + "value" : 10, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "BuiltIn", + "value" : 11, + "parameters" : [ + { "kind" : "BuiltIn" } + ] + }, + { + "enumerant" : "NoPerspective", + "value" : 13, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Flat", + "value" : 14, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Patch", + "value" : 15, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "Centroid", + "value" : 16, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Sample", + "value" : 17, + "capabilities" : [ "SampleRateShading" ] + }, + { + "enumerant" : "Invariant", + "value" : 18, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Restrict", + "value" : 19 + }, + { + "enumerant" : "Aliased", + "value" : 20 + }, + { + "enumerant" : "Volatile", + "value" : 21 + }, + { + "enumerant" : "Constant", + "value" : 22, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Coherent", + "value" : 23 + }, + { + "enumerant" : "NonWritable", + "value" : 24 + }, + { + "enumerant" : "NonReadable", + "value" : 25 + }, + { + "enumerant" : "Uniform", + "value" : 26, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SaturatedConversion", + "value" : 28, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Stream", + "value" : 29, + "capabilities" : [ "GeometryStreams" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Stream Number'" } + ] + }, + { + "enumerant" : "Location", + "value" : 30, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Location'" } + ] + }, + { + "enumerant" : "Component", + "value" : 31, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Component'" } + ] + }, + { + "enumerant" : "Index", + "value" : 32, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Index'" } + ] + }, + { + "enumerant" : "Binding", + "value" : 33, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Binding Point'" } + ] + }, + { + "enumerant" : "DescriptorSet", + "value" : 34, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Descriptor Set'" } + ] + }, + { + "enumerant" : "Offset", + "value" : 35, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Byte Offset'" } + ] + }, + { + "enumerant" : "XfbBuffer", + "value" : 36, + "capabilities" : [ "TransformFeedback" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'XFB Buffer Number'" } + ] + }, + { + "enumerant" : "XfbStride", + "value" : 37, + "capabilities" : [ "TransformFeedback" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'XFB Stride'" } + ] + }, + { + "enumerant" : "FuncParamAttr", + "value" : 38, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "FunctionParameterAttribute", "name" : "'Function Parameter Attribute'" } + ] + }, + { + "enumerant" : "FPRoundingMode", + "value" : 39, + "capabilities" : [ + "Kernel", + "StorageUniformBufferBlock16", + "StorageUniform16", + "StoragePushConstant16", + "StorageInputOutput16" + ], + "parameters" : [ + { "kind" : "FPRoundingMode", "name" : "'Floating-Point Rounding Mode'" } + ] + }, + { + "enumerant" : "FPFastMathMode", + "value" : 40, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "FPFastMathMode", "name" : "'Fast-Math Mode'" } + ] + }, + { + "enumerant" : "LinkageAttributes", + "value" : 41, + "capabilities" : [ "Linkage" ], + "parameters" : [ + { "kind" : "LiteralString", "name" : "'Name'" }, + { "kind" : "LinkageType", "name" : "'Linkage Type'" } + ] + }, + { + "enumerant" : "NoContraction", + "value" : 42, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "InputAttachmentIndex", + "value" : 43, + "capabilities" : [ "InputAttachment" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Attachment Index'" } + ] + }, + { + "enumerant" : "Alignment", + "value" : 44, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Alignment'" } + ] + }, + { + "enumerant" : "MaxByteOffset", + "value" : 45, + "capabilities" : [ "Addresses" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Max Byte Offset'" } + ] + }, + { + "enumerant" : "AlignmentId", + "value" : 46, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "IdRef", "name" : "'Alignment'" } + ] + }, + { + "enumerant" : "MaxByteOffsetId", + "value" : 47, + "capabilities" : [ "Addresses" ], + "parameters" : [ + { "kind" : "IdRef", "name" : "'Max Byte Offset'" } + ] + }, + { + "enumerant" : "ExplicitInterpAMD", + "value" : 4999 + }, + { + "enumerant" : "OverrideCoverageNV", + "value" : 5248, + "capabilities" : [ "SampleMaskOverrideCoverageNV" ] + }, + { + "enumerant" : "PassthroughNV", + "value" : 5250, + "capabilities" : [ "GeometryShaderPassthroughNV" ] + }, + { + "enumerant" : "ViewportRelativeNV", + "value" : 5252, + "capabilities" : [ "ShaderViewportMaskNV" ] + }, + { + "enumerant" : "SecondaryViewportRelativeNV", + "value" : 5256, + "capabilities" : [ "ShaderStereoViewNV" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Offset'" } + ] + }, + { + "enumerant" : "HlslCounterBufferGOOGLE", + "value" : 5634, + "parameters" : [ + { "kind" : "IdRef", "name" : "'Counter Buffer'" } + ], + "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ] + }, + { + "enumerant" : "HlslSemanticGOOGLE", + "value" : 5635, + "parameters" : [ + { "kind" : "LiteralString", "name" : "'Semantic'" } + ], + "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "BuiltIn", + "enumerants" : [ + { + "enumerant" : "Position", + "value" : 0, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "PointSize", + "value" : 1, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ClipDistance", + "value" : 3, + "capabilities" : [ "ClipDistance" ] + }, + { + "enumerant" : "CullDistance", + "value" : 4, + "capabilities" : [ "CullDistance" ] + }, + { + "enumerant" : "VertexId", + "value" : 5, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "InstanceId", + "value" : 6, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "PrimitiveId", + "value" : 7, + "capabilities" : [ "Geometry", "Tessellation" ] + }, + { + "enumerant" : "InvocationId", + "value" : 8, + "capabilities" : [ "Geometry", "Tessellation" ] + }, + { + "enumerant" : "Layer", + "value" : 9, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "ViewportIndex", + "value" : 10, + "capabilities" : [ "MultiViewport" ] + }, + { + "enumerant" : "TessLevelOuter", + "value" : 11, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "TessLevelInner", + "value" : 12, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "TessCoord", + "value" : 13, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "PatchVertices", + "value" : 14, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "FragCoord", + "value" : 15, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "PointCoord", + "value" : 16, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "FrontFacing", + "value" : 17, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SampleId", + "value" : 18, + "capabilities" : [ "SampleRateShading" ] + }, + { + "enumerant" : "SamplePosition", + "value" : 19, + "capabilities" : [ "SampleRateShading" ] + }, + { + "enumerant" : "SampleMask", + "value" : 20, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "FragDepth", + "value" : 22, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "HelperInvocation", + "value" : 23, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "NumWorkgroups", + "value" : 24 + }, + { + "enumerant" : "WorkgroupSize", + "value" : 25 + }, + { + "enumerant" : "WorkgroupId", + "value" : 26 + }, + { + "enumerant" : "LocalInvocationId", + "value" : 27 + }, + { + "enumerant" : "GlobalInvocationId", + "value" : 28 + }, + { + "enumerant" : "LocalInvocationIndex", + "value" : 29 + }, + { + "enumerant" : "WorkDim", + "value" : 30, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "GlobalSize", + "value" : 31, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "EnqueuedWorkgroupSize", + "value" : 32, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "GlobalOffset", + "value" : 33, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "GlobalLinearId", + "value" : 34, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SubgroupSize", + "value" : 36, + "capabilities" : [ "Kernel", "SubgroupBallotKHR" ] + }, + { + "enumerant" : "SubgroupMaxSize", + "value" : 37, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NumSubgroups", + "value" : 38, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NumEnqueuedSubgroups", + "value" : 39, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SubgroupId", + "value" : 40, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SubgroupLocalInvocationId", + "value" : 41, + "capabilities" : [ "Kernel", "SubgroupBallotKHR" ] + }, + { + "enumerant" : "VertexIndex", + "value" : 42, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "InstanceIndex", + "value" : 43, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SubgroupEqMaskKHR", + "value" : 4416, + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "enumerant" : "SubgroupGeMaskKHR", + "value" : 4417, + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "enumerant" : "SubgroupGtMaskKHR", + "value" : 4418, + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "enumerant" : "SubgroupLeMaskKHR", + "value" : 4419, + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "enumerant" : "SubgroupLtMaskKHR", + "value" : 4420, + "capabilities" : [ "SubgroupBallotKHR" ] + }, + { + "enumerant" : "BaseVertex", + "value" : 4424, + "capabilities" : [ "DrawParameters" ] + }, + { + "enumerant" : "BaseInstance", + "value" : 4425, + "capabilities" : [ "DrawParameters" ] + }, + { + "enumerant" : "DrawIndex", + "value" : 4426, + "capabilities" : [ "DrawParameters" ] + }, + { + "enumerant" : "DeviceIndex", + "value" : 4438, + "capabilities" : [ "DeviceGroup" ] + }, + { + "enumerant" : "ViewIndex", + "value" : 4440, + "capabilities" : [ "MultiView" ] + }, + { + "enumerant" : "BaryCoordNoPerspAMD", + "value" : 4992 + }, + { + "enumerant" : "BaryCoordNoPerspCentroidAMD", + "value" : 4993 + }, + { + "enumerant" : "BaryCoordNoPerspSampleAMD", + "value" : 4994 + }, + { + "enumerant" : "BaryCoordSmoothAMD", + "value" : 4995 + }, + { + "enumerant" : "BaryCoordSmoothCentroidAMD", + "value" : 4996 + }, + { + "enumerant" : "BaryCoordSmoothSampleAMD", + "value" : 4997 + }, + { + "enumerant" : "BaryCoordPullModelAMD", + "value" : 4998 + }, + { + "enumerant" : "FragStencilRefEXT", + "value" : 5014, + "capabilities" : [ "StencilExportEXT" ] + }, + { + "enumerant" : "ViewportMaskNV", + "value" : 5253, + "capabilities" : [ "ShaderViewportMaskNV" ] + }, + { + "enumerant" : "SecondaryPositionNV", + "value" : 5257, + "capabilities" : [ "ShaderStereoViewNV" ] + }, + { + "enumerant" : "SecondaryViewportMaskNV", + "value" : 5258, + "capabilities" : [ "ShaderStereoViewNV" ] + }, + { + "enumerant" : "PositionPerViewNV", + "value" : 5261, + "capabilities" : [ "PerViewAttributesNV" ] + }, + { + "enumerant" : "ViewportMaskPerViewNV", + "value" : 5262, + "capabilities" : [ "PerViewAttributesNV" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "Scope", + "enumerants" : [ + { + "enumerant" : "CrossDevice", + "value" : 0 + }, + { + "enumerant" : "Device", + "value" : 1 + }, + { + "enumerant" : "Workgroup", + "value" : 2 + }, + { + "enumerant" : "Subgroup", + "value" : 3 + }, + { + "enumerant" : "Invocation", + "value" : 4 + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "GroupOperation", + "enumerants" : [ + { + "enumerant" : "Reduce", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "InclusiveScan", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ExclusiveScan", + "value" : 2, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "KernelEnqueueFlags", + "enumerants" : [ + { + "enumerant" : "NoWait", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "WaitKernel", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "WaitWorkGroup", + "value" : 2, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "Capability", + "enumerants" : [ + { + "enumerant" : "Matrix", + "value" : 0 + }, + { + "enumerant" : "Shader", + "value" : 1, + "capabilities" : [ "Matrix" ] + }, + { + "enumerant" : "Geometry", + "value" : 2, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Tessellation", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Addresses", + "value" : 4 + }, + { + "enumerant" : "Linkage", + "value" : 5 + }, + { + "enumerant" : "Kernel", + "value" : 6 + }, + { + "enumerant" : "Vector16", + "value" : 7, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Float16Buffer", + "value" : 8, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Float16", + "value" : 9 + }, + { + "enumerant" : "Float64", + "value" : 10 + }, + { + "enumerant" : "Int64", + "value" : 11 + }, + { + "enumerant" : "Int64Atomics", + "value" : 12, + "capabilities" : [ "Int64" ] + }, + { + "enumerant" : "ImageBasic", + "value" : 13, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ImageReadWrite", + "value" : 14, + "capabilities" : [ "ImageBasic" ] + }, + { + "enumerant" : "ImageMipmap", + "value" : 15, + "capabilities" : [ "ImageBasic" ] + }, + { + "enumerant" : "Pipes", + "value" : 17, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Groups", + "value" : 18 + }, + { + "enumerant" : "DeviceEnqueue", + "value" : 19, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "LiteralSampler", + "value" : 20, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "AtomicStorage", + "value" : 21, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Int16", + "value" : 22 + }, + { + "enumerant" : "TessellationPointSize", + "value" : 23, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "GeometryPointSize", + "value" : 24, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "ImageGatherExtended", + "value" : 25, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageImageMultisample", + "value" : 27, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "UniformBufferArrayDynamicIndexing", + "value" : 28, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SampledImageArrayDynamicIndexing", + "value" : 29, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageBufferArrayDynamicIndexing", + "value" : 30, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageImageArrayDynamicIndexing", + "value" : 31, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ClipDistance", + "value" : 32, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "CullDistance", + "value" : 33, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ImageCubeArray", + "value" : 34, + "capabilities" : [ "SampledCubeArray" ] + }, + { + "enumerant" : "SampleRateShading", + "value" : 35, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ImageRect", + "value" : 36, + "capabilities" : [ "SampledRect" ] + }, + { + "enumerant" : "SampledRect", + "value" : 37, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GenericPointer", + "value" : 38, + "capabilities" : [ "Addresses" ] + }, + { + "enumerant" : "Int8", + "value" : 39, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "InputAttachment", + "value" : 40, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SparseResidency", + "value" : 41, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "MinLod", + "value" : 42, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Sampled1D", + "value" : 43 + }, + { + "enumerant" : "Image1D", + "value" : 44, + "capabilities" : [ "Sampled1D" ] + }, + { + "enumerant" : "SampledCubeArray", + "value" : 45, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SampledBuffer", + "value" : 46 + }, + { + "enumerant" : "ImageBuffer", + "value" : 47, + "capabilities" : [ "SampledBuffer" ] + }, + { + "enumerant" : "ImageMSArray", + "value" : 48, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageImageExtendedFormats", + "value" : 49, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ImageQuery", + "value" : 50, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "DerivativeControl", + "value" : 51, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "InterpolationFunction", + "value" : 52, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "TransformFeedback", + "value" : 53, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GeometryStreams", + "value" : 54, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "StorageImageReadWithoutFormat", + "value" : 55, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageImageWriteWithoutFormat", + "value" : 56, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "MultiViewport", + "value" : 57, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "SubgroupDispatch", + "value" : 58, + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "enumerant" : "NamedBarrier", + "value" : 59, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "PipeStorage", + "value" : 60, + "capabilities" : [ "Pipes" ] + }, + { + "enumerant" : "SubgroupBallotKHR", + "value" : 4423, + "extensions" : [ "SPV_KHR_shader_ballot" ] + }, + { + "enumerant" : "DrawParameters", + "value" : 4427, + "extensions" : [ "SPV_KHR_shader_draw_parameters" ] + }, + { + "enumerant" : "SubgroupVoteKHR", + "value" : 4431, + "extensions" : [ "SPV_KHR_subgroup_vote" ] + }, + { + "enumerant" : "StorageBuffer16BitAccess", + "value" : 4433, + "extensions" : [ "SPV_KHR_16bit_storage" ] + }, + { + "enumerant" : "StorageUniformBufferBlock16", + "value" : 4433, + "extensions" : [ "SPV_KHR_16bit_storage" ] + }, + { + "enumerant" : "UniformAndStorageBuffer16BitAccess", + "value" : 4434, + "capabilities" : [ + "StorageBuffer16BitAccess", + "StorageUniformBufferBlock16" + ], + "extensions" : [ "SPV_KHR_16bit_storage" ] + }, + { + "enumerant" : "StorageUniform16", + "value" : 4434, + "capabilities" : [ + "StorageBuffer16BitAccess", + "StorageUniformBufferBlock16" + ], + "extensions" : [ "SPV_KHR_16bit_storage" ] + }, + { + "enumerant" : "StoragePushConstant16", + "value" : 4435, + "extensions" : [ "SPV_KHR_16bit_storage" ] + }, + { + "enumerant" : "StorageInputOutput16", + "value" : 4436, + "extensions" : [ "SPV_KHR_16bit_storage" ] + }, + { + "enumerant" : "DeviceGroup", + "value" : 4437, + "extensions" : [ "SPV_KHR_device_group" ] + }, + { + "enumerant" : "MultiView", + "value" : 4439, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_KHR_multiview" ] + }, + { + "enumerant" : "VariablePointersStorageBuffer", + "value" : 4441, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_KHR_variable_pointers" ] + }, + { + "enumerant" : "VariablePointers", + "value" : 4442, + "capabilities" : [ "VariablePointersStorageBuffer" ], + "extensions" : [ "SPV_KHR_variable_pointers" ] + }, + { + "enumerant": "AtomicStorageOps", + "value": 4445, + "extensions": [ "SPV_KHR_shader_atomic_counter_ops" ] + }, + { + "enumerant" : "SampleMaskPostDepthCoverage", + "value" : 4447, + "extensions" : [ "SPV_KHR_post_depth_coverage" ] + }, + { + "enumerant" : "ImageGatherBiasLodAMD", + "value" : 5009, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_AMD_texture_gather_bias_lod" ] + }, + { + "enumerant" : "FragmentMaskAMD", + "value" : 5010, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_AMD_shader_fragment_mask" ] + }, + { + "enumerant" : "StencilExportEXT", + "value" : 5013, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_EXT_shader_stencil_export" ] + }, + { + "enumerant" : "ImageReadWriteLodAMD", + "value" : 5015, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_AMD_shader_image_load_store_lod" ] + }, + { + "enumerant" : "SampleMaskOverrideCoverageNV", + "value" : 5249, + "capabilities" : [ "SampleRateShading" ], + "extensions" : [ "SPV_NV_sample_mask_override_coverage" ] + }, + { + "enumerant" : "GeometryShaderPassthroughNV", + "value" : 5251, + "capabilities" : [ "Geometry" ], + "extensions" : [ "SPV_NV_geometry_shader_passthrough" ] + }, + { + "enumerant" : "ShaderViewportIndexLayerEXT", + "value" : 5254, + "capabilities" : [ "MultiViewport" ], + "extensions" : [ "SPV_EXT_shader_viewport_index_layer" ] + }, + { + "enumerant" : "ShaderViewportIndexLayerNV", + "value" : 5254, + "capabilities" : [ "MultiViewport" ], + "extensions" : [ "SPV_NV_viewport_array2" ] + }, + { + "enumerant" : "ShaderViewportMaskNV", + "value" : 5255, + "capabilities" : [ "ShaderViewportIndexLayerNV" ], + "extensions" : [ "SPV_NV_viewport_array2" ] + }, + { + "enumerant" : "ShaderStereoViewNV", + "value" : 5259, + "capabilities" : [ "ShaderViewportMaskNV" ], + "extensions" : [ "SPV_NV_stereo_view_rendering" ] + }, + { + "enumerant" : "PerViewAttributesNV", + "value" : 5260, + "capabilities" : [ "MultiView" ], + "extensions" : [ "SPV_NVX_multiview_per_view_attributes" ] + }, + { + "enumerant" : "SubgroupShuffleINTEL", + "value" : 5568, + "extensions" : [ "SPV_INTEL_subgroups" ] + }, + { + "enumerant" : "SubgroupBufferBlockIOINTEL", + "value" : 5569, + "extensions" : [ "SPV_INTEL_subgroups" ] + }, + { + "enumerant" : "SubgroupImageBlockIOINTEL", + "value" : 5570, + "extensions" : [ "SPV_INTEL_subgroups" ] + } + ] + }, + { + "category" : "Id", + "kind" : "IdResultType", + "doc" : "Reference to an representing the result's type of the enclosing instruction" + }, + { + "category" : "Id", + "kind" : "IdResult", + "doc" : "Definition of an representing the result of the enclosing instruction" + }, + { + "category" : "Id", + "kind" : "IdMemorySemantics", + "doc" : "Reference to an representing a 32-bit integer that is a mask from the MemorySemantics operand kind" + }, + { + "category" : "Id", + "kind" : "IdScope", + "doc" : "Reference to an representing a 32-bit integer that is a mask from the Scope operand kind" + }, + { + "category" : "Id", + "kind" : "IdRef", + "doc" : "Reference to an " + }, + { + "category" : "Literal", + "kind" : "LiteralInteger", + "doc" : "An integer consuming one or more words" + }, + { + "category" : "Literal", + "kind" : "LiteralString", + "doc" : "A null-terminated stream of characters consuming an integral number of words" + }, + { + "category" : "Literal", + "kind" : "LiteralContextDependentNumber", + "doc" : "A literal number whose size and format are determined by a previous operand in the enclosing instruction" + }, + { + "category" : "Literal", + "kind" : "LiteralExtInstInteger", + "doc" : "A 32-bit unsigned integer indicating which instruction to use and determining the layout of following operands (for OpExtInst)" + }, + { + "category" : "Literal", + "kind" : "LiteralSpecConstantOpInteger", + "doc" : "An opcode indicating the operation to be performed and determining the layout of following operands (for OpSpecConstantOp)" + }, + { + "category" : "Composite", + "kind" : "PairLiteralIntegerIdRef", + "bases" : [ "LiteralInteger", "IdRef" ] + }, + { + "category" : "Composite", + "kind" : "PairIdRefLiteralInteger", + "bases" : [ "IdRef", "LiteralInteger" ] + }, + { + "category" : "Composite", + "kind" : "PairIdRefIdRef", + "bases" : [ "IdRef", "IdRef" ] + } + ] +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.h 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1021 @@ +/* +** Copyright (c) 2014-2018 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +/* +** This header is automatically generated by the same tool that creates +** the Binary Section of the SPIR-V specification. +*/ + +/* +** Enumeration tokens for SPIR-V, in various styles: +** C, C++, C++11, JSON, Lua, Python +** +** - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +** - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +** - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +** - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +** - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +** +** Some tokens act like mask values, which can be OR'd together, +** while others are mutually exclusive. The mask-like ones have +** "Mask" in their name, and a parallel enum that has the shift +** amount (1 << x) for each corresponding enumerant. +*/ + +#ifndef spirv_H +#define spirv_H + +typedef unsigned int SpvId; + +#define SPV_VERSION 0x10200 +#define SPV_REVISION 2 + +static const unsigned int SpvMagicNumber = 0x07230203; +static const unsigned int SpvVersion = 0x00010200; +static const unsigned int SpvRevision = 2; +static const unsigned int SpvOpCodeMask = 0xffff; +static const unsigned int SpvWordCountShift = 16; + +typedef enum SpvSourceLanguage_ { + SpvSourceLanguageUnknown = 0, + SpvSourceLanguageESSL = 1, + SpvSourceLanguageGLSL = 2, + SpvSourceLanguageOpenCL_C = 3, + SpvSourceLanguageOpenCL_CPP = 4, + SpvSourceLanguageHLSL = 5, + SpvSourceLanguageMax = 0x7fffffff, +} SpvSourceLanguage; + +typedef enum SpvExecutionModel_ { + SpvExecutionModelVertex = 0, + SpvExecutionModelTessellationControl = 1, + SpvExecutionModelTessellationEvaluation = 2, + SpvExecutionModelGeometry = 3, + SpvExecutionModelFragment = 4, + SpvExecutionModelGLCompute = 5, + SpvExecutionModelKernel = 6, + SpvExecutionModelMax = 0x7fffffff, +} SpvExecutionModel; + +typedef enum SpvAddressingModel_ { + SpvAddressingModelLogical = 0, + SpvAddressingModelPhysical32 = 1, + SpvAddressingModelPhysical64 = 2, + SpvAddressingModelMax = 0x7fffffff, +} SpvAddressingModel; + +typedef enum SpvMemoryModel_ { + SpvMemoryModelSimple = 0, + SpvMemoryModelGLSL450 = 1, + SpvMemoryModelOpenCL = 2, + SpvMemoryModelMax = 0x7fffffff, +} SpvMemoryModel; + +typedef enum SpvExecutionMode_ { + SpvExecutionModeInvocations = 0, + SpvExecutionModeSpacingEqual = 1, + SpvExecutionModeSpacingFractionalEven = 2, + SpvExecutionModeSpacingFractionalOdd = 3, + SpvExecutionModeVertexOrderCw = 4, + SpvExecutionModeVertexOrderCcw = 5, + SpvExecutionModePixelCenterInteger = 6, + SpvExecutionModeOriginUpperLeft = 7, + SpvExecutionModeOriginLowerLeft = 8, + SpvExecutionModeEarlyFragmentTests = 9, + SpvExecutionModePointMode = 10, + SpvExecutionModeXfb = 11, + SpvExecutionModeDepthReplacing = 12, + SpvExecutionModeDepthGreater = 14, + SpvExecutionModeDepthLess = 15, + SpvExecutionModeDepthUnchanged = 16, + SpvExecutionModeLocalSize = 17, + SpvExecutionModeLocalSizeHint = 18, + SpvExecutionModeInputPoints = 19, + SpvExecutionModeInputLines = 20, + SpvExecutionModeInputLinesAdjacency = 21, + SpvExecutionModeTriangles = 22, + SpvExecutionModeInputTrianglesAdjacency = 23, + SpvExecutionModeQuads = 24, + SpvExecutionModeIsolines = 25, + SpvExecutionModeOutputVertices = 26, + SpvExecutionModeOutputPoints = 27, + SpvExecutionModeOutputLineStrip = 28, + SpvExecutionModeOutputTriangleStrip = 29, + SpvExecutionModeVecTypeHint = 30, + SpvExecutionModeContractionOff = 31, + SpvExecutionModeInitializer = 33, + SpvExecutionModeFinalizer = 34, + SpvExecutionModeSubgroupSize = 35, + SpvExecutionModeSubgroupsPerWorkgroup = 36, + SpvExecutionModeSubgroupsPerWorkgroupId = 37, + SpvExecutionModeLocalSizeId = 38, + SpvExecutionModeLocalSizeHintId = 39, + SpvExecutionModePostDepthCoverage = 4446, + SpvExecutionModeStencilRefReplacingEXT = 5027, + SpvExecutionModeMax = 0x7fffffff, +} SpvExecutionMode; + +typedef enum SpvStorageClass_ { + SpvStorageClassUniformConstant = 0, + SpvStorageClassInput = 1, + SpvStorageClassUniform = 2, + SpvStorageClassOutput = 3, + SpvStorageClassWorkgroup = 4, + SpvStorageClassCrossWorkgroup = 5, + SpvStorageClassPrivate = 6, + SpvStorageClassFunction = 7, + SpvStorageClassGeneric = 8, + SpvStorageClassPushConstant = 9, + SpvStorageClassAtomicCounter = 10, + SpvStorageClassImage = 11, + SpvStorageClassStorageBuffer = 12, + SpvStorageClassMax = 0x7fffffff, +} SpvStorageClass; + +typedef enum SpvDim_ { + SpvDim1D = 0, + SpvDim2D = 1, + SpvDim3D = 2, + SpvDimCube = 3, + SpvDimRect = 4, + SpvDimBuffer = 5, + SpvDimSubpassData = 6, + SpvDimMax = 0x7fffffff, +} SpvDim; + +typedef enum SpvSamplerAddressingMode_ { + SpvSamplerAddressingModeNone = 0, + SpvSamplerAddressingModeClampToEdge = 1, + SpvSamplerAddressingModeClamp = 2, + SpvSamplerAddressingModeRepeat = 3, + SpvSamplerAddressingModeRepeatMirrored = 4, + SpvSamplerAddressingModeMax = 0x7fffffff, +} SpvSamplerAddressingMode; + +typedef enum SpvSamplerFilterMode_ { + SpvSamplerFilterModeNearest = 0, + SpvSamplerFilterModeLinear = 1, + SpvSamplerFilterModeMax = 0x7fffffff, +} SpvSamplerFilterMode; + +typedef enum SpvImageFormat_ { + SpvImageFormatUnknown = 0, + SpvImageFormatRgba32f = 1, + SpvImageFormatRgba16f = 2, + SpvImageFormatR32f = 3, + SpvImageFormatRgba8 = 4, + SpvImageFormatRgba8Snorm = 5, + SpvImageFormatRg32f = 6, + SpvImageFormatRg16f = 7, + SpvImageFormatR11fG11fB10f = 8, + SpvImageFormatR16f = 9, + SpvImageFormatRgba16 = 10, + SpvImageFormatRgb10A2 = 11, + SpvImageFormatRg16 = 12, + SpvImageFormatRg8 = 13, + SpvImageFormatR16 = 14, + SpvImageFormatR8 = 15, + SpvImageFormatRgba16Snorm = 16, + SpvImageFormatRg16Snorm = 17, + SpvImageFormatRg8Snorm = 18, + SpvImageFormatR16Snorm = 19, + SpvImageFormatR8Snorm = 20, + SpvImageFormatRgba32i = 21, + SpvImageFormatRgba16i = 22, + SpvImageFormatRgba8i = 23, + SpvImageFormatR32i = 24, + SpvImageFormatRg32i = 25, + SpvImageFormatRg16i = 26, + SpvImageFormatRg8i = 27, + SpvImageFormatR16i = 28, + SpvImageFormatR8i = 29, + SpvImageFormatRgba32ui = 30, + SpvImageFormatRgba16ui = 31, + SpvImageFormatRgba8ui = 32, + SpvImageFormatR32ui = 33, + SpvImageFormatRgb10a2ui = 34, + SpvImageFormatRg32ui = 35, + SpvImageFormatRg16ui = 36, + SpvImageFormatRg8ui = 37, + SpvImageFormatR16ui = 38, + SpvImageFormatR8ui = 39, + SpvImageFormatMax = 0x7fffffff, +} SpvImageFormat; + +typedef enum SpvImageChannelOrder_ { + SpvImageChannelOrderR = 0, + SpvImageChannelOrderA = 1, + SpvImageChannelOrderRG = 2, + SpvImageChannelOrderRA = 3, + SpvImageChannelOrderRGB = 4, + SpvImageChannelOrderRGBA = 5, + SpvImageChannelOrderBGRA = 6, + SpvImageChannelOrderARGB = 7, + SpvImageChannelOrderIntensity = 8, + SpvImageChannelOrderLuminance = 9, + SpvImageChannelOrderRx = 10, + SpvImageChannelOrderRGx = 11, + SpvImageChannelOrderRGBx = 12, + SpvImageChannelOrderDepth = 13, + SpvImageChannelOrderDepthStencil = 14, + SpvImageChannelOrdersRGB = 15, + SpvImageChannelOrdersRGBx = 16, + SpvImageChannelOrdersRGBA = 17, + SpvImageChannelOrdersBGRA = 18, + SpvImageChannelOrderABGR = 19, + SpvImageChannelOrderMax = 0x7fffffff, +} SpvImageChannelOrder; + +typedef enum SpvImageChannelDataType_ { + SpvImageChannelDataTypeSnormInt8 = 0, + SpvImageChannelDataTypeSnormInt16 = 1, + SpvImageChannelDataTypeUnormInt8 = 2, + SpvImageChannelDataTypeUnormInt16 = 3, + SpvImageChannelDataTypeUnormShort565 = 4, + SpvImageChannelDataTypeUnormShort555 = 5, + SpvImageChannelDataTypeUnormInt101010 = 6, + SpvImageChannelDataTypeSignedInt8 = 7, + SpvImageChannelDataTypeSignedInt16 = 8, + SpvImageChannelDataTypeSignedInt32 = 9, + SpvImageChannelDataTypeUnsignedInt8 = 10, + SpvImageChannelDataTypeUnsignedInt16 = 11, + SpvImageChannelDataTypeUnsignedInt32 = 12, + SpvImageChannelDataTypeHalfFloat = 13, + SpvImageChannelDataTypeFloat = 14, + SpvImageChannelDataTypeUnormInt24 = 15, + SpvImageChannelDataTypeUnormInt101010_2 = 16, + SpvImageChannelDataTypeMax = 0x7fffffff, +} SpvImageChannelDataType; + +typedef enum SpvImageOperandsShift_ { + SpvImageOperandsBiasShift = 0, + SpvImageOperandsLodShift = 1, + SpvImageOperandsGradShift = 2, + SpvImageOperandsConstOffsetShift = 3, + SpvImageOperandsOffsetShift = 4, + SpvImageOperandsConstOffsetsShift = 5, + SpvImageOperandsSampleShift = 6, + SpvImageOperandsMinLodShift = 7, + SpvImageOperandsMax = 0x7fffffff, +} SpvImageOperandsShift; + +typedef enum SpvImageOperandsMask_ { + SpvImageOperandsMaskNone = 0, + SpvImageOperandsBiasMask = 0x00000001, + SpvImageOperandsLodMask = 0x00000002, + SpvImageOperandsGradMask = 0x00000004, + SpvImageOperandsConstOffsetMask = 0x00000008, + SpvImageOperandsOffsetMask = 0x00000010, + SpvImageOperandsConstOffsetsMask = 0x00000020, + SpvImageOperandsSampleMask = 0x00000040, + SpvImageOperandsMinLodMask = 0x00000080, +} SpvImageOperandsMask; + +typedef enum SpvFPFastMathModeShift_ { + SpvFPFastMathModeNotNaNShift = 0, + SpvFPFastMathModeNotInfShift = 1, + SpvFPFastMathModeNSZShift = 2, + SpvFPFastMathModeAllowRecipShift = 3, + SpvFPFastMathModeFastShift = 4, + SpvFPFastMathModeMax = 0x7fffffff, +} SpvFPFastMathModeShift; + +typedef enum SpvFPFastMathModeMask_ { + SpvFPFastMathModeMaskNone = 0, + SpvFPFastMathModeNotNaNMask = 0x00000001, + SpvFPFastMathModeNotInfMask = 0x00000002, + SpvFPFastMathModeNSZMask = 0x00000004, + SpvFPFastMathModeAllowRecipMask = 0x00000008, + SpvFPFastMathModeFastMask = 0x00000010, +} SpvFPFastMathModeMask; + +typedef enum SpvFPRoundingMode_ { + SpvFPRoundingModeRTE = 0, + SpvFPRoundingModeRTZ = 1, + SpvFPRoundingModeRTP = 2, + SpvFPRoundingModeRTN = 3, + SpvFPRoundingModeMax = 0x7fffffff, +} SpvFPRoundingMode; + +typedef enum SpvLinkageType_ { + SpvLinkageTypeExport = 0, + SpvLinkageTypeImport = 1, + SpvLinkageTypeMax = 0x7fffffff, +} SpvLinkageType; + +typedef enum SpvAccessQualifier_ { + SpvAccessQualifierReadOnly = 0, + SpvAccessQualifierWriteOnly = 1, + SpvAccessQualifierReadWrite = 2, + SpvAccessQualifierMax = 0x7fffffff, +} SpvAccessQualifier; + +typedef enum SpvFunctionParameterAttribute_ { + SpvFunctionParameterAttributeZext = 0, + SpvFunctionParameterAttributeSext = 1, + SpvFunctionParameterAttributeByVal = 2, + SpvFunctionParameterAttributeSret = 3, + SpvFunctionParameterAttributeNoAlias = 4, + SpvFunctionParameterAttributeNoCapture = 5, + SpvFunctionParameterAttributeNoWrite = 6, + SpvFunctionParameterAttributeNoReadWrite = 7, + SpvFunctionParameterAttributeMax = 0x7fffffff, +} SpvFunctionParameterAttribute; + +typedef enum SpvDecoration_ { + SpvDecorationRelaxedPrecision = 0, + SpvDecorationSpecId = 1, + SpvDecorationBlock = 2, + SpvDecorationBufferBlock = 3, + SpvDecorationRowMajor = 4, + SpvDecorationColMajor = 5, + SpvDecorationArrayStride = 6, + SpvDecorationMatrixStride = 7, + SpvDecorationGLSLShared = 8, + SpvDecorationGLSLPacked = 9, + SpvDecorationCPacked = 10, + SpvDecorationBuiltIn = 11, + SpvDecorationNoPerspective = 13, + SpvDecorationFlat = 14, + SpvDecorationPatch = 15, + SpvDecorationCentroid = 16, + SpvDecorationSample = 17, + SpvDecorationInvariant = 18, + SpvDecorationRestrict = 19, + SpvDecorationAliased = 20, + SpvDecorationVolatile = 21, + SpvDecorationConstant = 22, + SpvDecorationCoherent = 23, + SpvDecorationNonWritable = 24, + SpvDecorationNonReadable = 25, + SpvDecorationUniform = 26, + SpvDecorationSaturatedConversion = 28, + SpvDecorationStream = 29, + SpvDecorationLocation = 30, + SpvDecorationComponent = 31, + SpvDecorationIndex = 32, + SpvDecorationBinding = 33, + SpvDecorationDescriptorSet = 34, + SpvDecorationOffset = 35, + SpvDecorationXfbBuffer = 36, + SpvDecorationXfbStride = 37, + SpvDecorationFuncParamAttr = 38, + SpvDecorationFPRoundingMode = 39, + SpvDecorationFPFastMathMode = 40, + SpvDecorationLinkageAttributes = 41, + SpvDecorationNoContraction = 42, + SpvDecorationInputAttachmentIndex = 43, + SpvDecorationAlignment = 44, + SpvDecorationMaxByteOffset = 45, + SpvDecorationAlignmentId = 46, + SpvDecorationMaxByteOffsetId = 47, + SpvDecorationExplicitInterpAMD = 4999, + SpvDecorationOverrideCoverageNV = 5248, + SpvDecorationPassthroughNV = 5250, + SpvDecorationViewportRelativeNV = 5252, + SpvDecorationSecondaryViewportRelativeNV = 5256, + SpvDecorationHlslCounterBufferGOOGLE = 5634, + SpvDecorationHlslSemanticGOOGLE = 5635, + SpvDecorationMax = 0x7fffffff, +} SpvDecoration; + +typedef enum SpvBuiltIn_ { + SpvBuiltInPosition = 0, + SpvBuiltInPointSize = 1, + SpvBuiltInClipDistance = 3, + SpvBuiltInCullDistance = 4, + SpvBuiltInVertexId = 5, + SpvBuiltInInstanceId = 6, + SpvBuiltInPrimitiveId = 7, + SpvBuiltInInvocationId = 8, + SpvBuiltInLayer = 9, + SpvBuiltInViewportIndex = 10, + SpvBuiltInTessLevelOuter = 11, + SpvBuiltInTessLevelInner = 12, + SpvBuiltInTessCoord = 13, + SpvBuiltInPatchVertices = 14, + SpvBuiltInFragCoord = 15, + SpvBuiltInPointCoord = 16, + SpvBuiltInFrontFacing = 17, + SpvBuiltInSampleId = 18, + SpvBuiltInSamplePosition = 19, + SpvBuiltInSampleMask = 20, + SpvBuiltInFragDepth = 22, + SpvBuiltInHelperInvocation = 23, + SpvBuiltInNumWorkgroups = 24, + SpvBuiltInWorkgroupSize = 25, + SpvBuiltInWorkgroupId = 26, + SpvBuiltInLocalInvocationId = 27, + SpvBuiltInGlobalInvocationId = 28, + SpvBuiltInLocalInvocationIndex = 29, + SpvBuiltInWorkDim = 30, + SpvBuiltInGlobalSize = 31, + SpvBuiltInEnqueuedWorkgroupSize = 32, + SpvBuiltInGlobalOffset = 33, + SpvBuiltInGlobalLinearId = 34, + SpvBuiltInSubgroupSize = 36, + SpvBuiltInSubgroupMaxSize = 37, + SpvBuiltInNumSubgroups = 38, + SpvBuiltInNumEnqueuedSubgroups = 39, + SpvBuiltInSubgroupId = 40, + SpvBuiltInSubgroupLocalInvocationId = 41, + SpvBuiltInVertexIndex = 42, + SpvBuiltInInstanceIndex = 43, + SpvBuiltInSubgroupEqMaskKHR = 4416, + SpvBuiltInSubgroupGeMaskKHR = 4417, + SpvBuiltInSubgroupGtMaskKHR = 4418, + SpvBuiltInSubgroupLeMaskKHR = 4419, + SpvBuiltInSubgroupLtMaskKHR = 4420, + SpvBuiltInBaseVertex = 4424, + SpvBuiltInBaseInstance = 4425, + SpvBuiltInDrawIndex = 4426, + SpvBuiltInDeviceIndex = 4438, + SpvBuiltInViewIndex = 4440, + SpvBuiltInBaryCoordNoPerspAMD = 4992, + SpvBuiltInBaryCoordNoPerspCentroidAMD = 4993, + SpvBuiltInBaryCoordNoPerspSampleAMD = 4994, + SpvBuiltInBaryCoordSmoothAMD = 4995, + SpvBuiltInBaryCoordSmoothCentroidAMD = 4996, + SpvBuiltInBaryCoordSmoothSampleAMD = 4997, + SpvBuiltInBaryCoordPullModelAMD = 4998, + SpvBuiltInFragStencilRefEXT = 5014, + SpvBuiltInViewportMaskNV = 5253, + SpvBuiltInSecondaryPositionNV = 5257, + SpvBuiltInSecondaryViewportMaskNV = 5258, + SpvBuiltInPositionPerViewNV = 5261, + SpvBuiltInViewportMaskPerViewNV = 5262, + SpvBuiltInMax = 0x7fffffff, +} SpvBuiltIn; + +typedef enum SpvSelectionControlShift_ { + SpvSelectionControlFlattenShift = 0, + SpvSelectionControlDontFlattenShift = 1, + SpvSelectionControlMax = 0x7fffffff, +} SpvSelectionControlShift; + +typedef enum SpvSelectionControlMask_ { + SpvSelectionControlMaskNone = 0, + SpvSelectionControlFlattenMask = 0x00000001, + SpvSelectionControlDontFlattenMask = 0x00000002, +} SpvSelectionControlMask; + +typedef enum SpvLoopControlShift_ { + SpvLoopControlUnrollShift = 0, + SpvLoopControlDontUnrollShift = 1, + SpvLoopControlDependencyInfiniteShift = 2, + SpvLoopControlDependencyLengthShift = 3, + SpvLoopControlMax = 0x7fffffff, +} SpvLoopControlShift; + +typedef enum SpvLoopControlMask_ { + SpvLoopControlMaskNone = 0, + SpvLoopControlUnrollMask = 0x00000001, + SpvLoopControlDontUnrollMask = 0x00000002, + SpvLoopControlDependencyInfiniteMask = 0x00000004, + SpvLoopControlDependencyLengthMask = 0x00000008, +} SpvLoopControlMask; + +typedef enum SpvFunctionControlShift_ { + SpvFunctionControlInlineShift = 0, + SpvFunctionControlDontInlineShift = 1, + SpvFunctionControlPureShift = 2, + SpvFunctionControlConstShift = 3, + SpvFunctionControlMax = 0x7fffffff, +} SpvFunctionControlShift; + +typedef enum SpvFunctionControlMask_ { + SpvFunctionControlMaskNone = 0, + SpvFunctionControlInlineMask = 0x00000001, + SpvFunctionControlDontInlineMask = 0x00000002, + SpvFunctionControlPureMask = 0x00000004, + SpvFunctionControlConstMask = 0x00000008, +} SpvFunctionControlMask; + +typedef enum SpvMemorySemanticsShift_ { + SpvMemorySemanticsAcquireShift = 1, + SpvMemorySemanticsReleaseShift = 2, + SpvMemorySemanticsAcquireReleaseShift = 3, + SpvMemorySemanticsSequentiallyConsistentShift = 4, + SpvMemorySemanticsUniformMemoryShift = 6, + SpvMemorySemanticsSubgroupMemoryShift = 7, + SpvMemorySemanticsWorkgroupMemoryShift = 8, + SpvMemorySemanticsCrossWorkgroupMemoryShift = 9, + SpvMemorySemanticsAtomicCounterMemoryShift = 10, + SpvMemorySemanticsImageMemoryShift = 11, + SpvMemorySemanticsMax = 0x7fffffff, +} SpvMemorySemanticsShift; + +typedef enum SpvMemorySemanticsMask_ { + SpvMemorySemanticsMaskNone = 0, + SpvMemorySemanticsAcquireMask = 0x00000002, + SpvMemorySemanticsReleaseMask = 0x00000004, + SpvMemorySemanticsAcquireReleaseMask = 0x00000008, + SpvMemorySemanticsSequentiallyConsistentMask = 0x00000010, + SpvMemorySemanticsUniformMemoryMask = 0x00000040, + SpvMemorySemanticsSubgroupMemoryMask = 0x00000080, + SpvMemorySemanticsWorkgroupMemoryMask = 0x00000100, + SpvMemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, + SpvMemorySemanticsAtomicCounterMemoryMask = 0x00000400, + SpvMemorySemanticsImageMemoryMask = 0x00000800, +} SpvMemorySemanticsMask; + +typedef enum SpvMemoryAccessShift_ { + SpvMemoryAccessVolatileShift = 0, + SpvMemoryAccessAlignedShift = 1, + SpvMemoryAccessNontemporalShift = 2, + SpvMemoryAccessMax = 0x7fffffff, +} SpvMemoryAccessShift; + +typedef enum SpvMemoryAccessMask_ { + SpvMemoryAccessMaskNone = 0, + SpvMemoryAccessVolatileMask = 0x00000001, + SpvMemoryAccessAlignedMask = 0x00000002, + SpvMemoryAccessNontemporalMask = 0x00000004, +} SpvMemoryAccessMask; + +typedef enum SpvScope_ { + SpvScopeCrossDevice = 0, + SpvScopeDevice = 1, + SpvScopeWorkgroup = 2, + SpvScopeSubgroup = 3, + SpvScopeInvocation = 4, + SpvScopeMax = 0x7fffffff, +} SpvScope; + +typedef enum SpvGroupOperation_ { + SpvGroupOperationReduce = 0, + SpvGroupOperationInclusiveScan = 1, + SpvGroupOperationExclusiveScan = 2, + SpvGroupOperationMax = 0x7fffffff, +} SpvGroupOperation; + +typedef enum SpvKernelEnqueueFlags_ { + SpvKernelEnqueueFlagsNoWait = 0, + SpvKernelEnqueueFlagsWaitKernel = 1, + SpvKernelEnqueueFlagsWaitWorkGroup = 2, + SpvKernelEnqueueFlagsMax = 0x7fffffff, +} SpvKernelEnqueueFlags; + +typedef enum SpvKernelProfilingInfoShift_ { + SpvKernelProfilingInfoCmdExecTimeShift = 0, + SpvKernelProfilingInfoMax = 0x7fffffff, +} SpvKernelProfilingInfoShift; + +typedef enum SpvKernelProfilingInfoMask_ { + SpvKernelProfilingInfoMaskNone = 0, + SpvKernelProfilingInfoCmdExecTimeMask = 0x00000001, +} SpvKernelProfilingInfoMask; + +typedef enum SpvCapability_ { + SpvCapabilityMatrix = 0, + SpvCapabilityShader = 1, + SpvCapabilityGeometry = 2, + SpvCapabilityTessellation = 3, + SpvCapabilityAddresses = 4, + SpvCapabilityLinkage = 5, + SpvCapabilityKernel = 6, + SpvCapabilityVector16 = 7, + SpvCapabilityFloat16Buffer = 8, + SpvCapabilityFloat16 = 9, + SpvCapabilityFloat64 = 10, + SpvCapabilityInt64 = 11, + SpvCapabilityInt64Atomics = 12, + SpvCapabilityImageBasic = 13, + SpvCapabilityImageReadWrite = 14, + SpvCapabilityImageMipmap = 15, + SpvCapabilityPipes = 17, + SpvCapabilityGroups = 18, + SpvCapabilityDeviceEnqueue = 19, + SpvCapabilityLiteralSampler = 20, + SpvCapabilityAtomicStorage = 21, + SpvCapabilityInt16 = 22, + SpvCapabilityTessellationPointSize = 23, + SpvCapabilityGeometryPointSize = 24, + SpvCapabilityImageGatherExtended = 25, + SpvCapabilityStorageImageMultisample = 27, + SpvCapabilityUniformBufferArrayDynamicIndexing = 28, + SpvCapabilitySampledImageArrayDynamicIndexing = 29, + SpvCapabilityStorageBufferArrayDynamicIndexing = 30, + SpvCapabilityStorageImageArrayDynamicIndexing = 31, + SpvCapabilityClipDistance = 32, + SpvCapabilityCullDistance = 33, + SpvCapabilityImageCubeArray = 34, + SpvCapabilitySampleRateShading = 35, + SpvCapabilityImageRect = 36, + SpvCapabilitySampledRect = 37, + SpvCapabilityGenericPointer = 38, + SpvCapabilityInt8 = 39, + SpvCapabilityInputAttachment = 40, + SpvCapabilitySparseResidency = 41, + SpvCapabilityMinLod = 42, + SpvCapabilitySampled1D = 43, + SpvCapabilityImage1D = 44, + SpvCapabilitySampledCubeArray = 45, + SpvCapabilitySampledBuffer = 46, + SpvCapabilityImageBuffer = 47, + SpvCapabilityImageMSArray = 48, + SpvCapabilityStorageImageExtendedFormats = 49, + SpvCapabilityImageQuery = 50, + SpvCapabilityDerivativeControl = 51, + SpvCapabilityInterpolationFunction = 52, + SpvCapabilityTransformFeedback = 53, + SpvCapabilityGeometryStreams = 54, + SpvCapabilityStorageImageReadWithoutFormat = 55, + SpvCapabilityStorageImageWriteWithoutFormat = 56, + SpvCapabilityMultiViewport = 57, + SpvCapabilitySubgroupDispatch = 58, + SpvCapabilityNamedBarrier = 59, + SpvCapabilityPipeStorage = 60, + SpvCapabilitySubgroupBallotKHR = 4423, + SpvCapabilityDrawParameters = 4427, + SpvCapabilitySubgroupVoteKHR = 4431, + SpvCapabilityStorageBuffer16BitAccess = 4433, + SpvCapabilityStorageUniformBufferBlock16 = 4433, + SpvCapabilityStorageUniform16 = 4434, + SpvCapabilityUniformAndStorageBuffer16BitAccess = 4434, + SpvCapabilityStoragePushConstant16 = 4435, + SpvCapabilityStorageInputOutput16 = 4436, + SpvCapabilityDeviceGroup = 4437, + SpvCapabilityMultiView = 4439, + SpvCapabilityVariablePointersStorageBuffer = 4441, + SpvCapabilityVariablePointers = 4442, + SpvCapabilityAtomicStorageOps = 4445, + SpvCapabilitySampleMaskPostDepthCoverage = 4447, + SpvCapabilityImageGatherBiasLodAMD = 5009, + SpvCapabilityFragmentMaskAMD = 5010, + SpvCapabilityStencilExportEXT = 5013, + SpvCapabilityImageReadWriteLodAMD = 5015, + SpvCapabilitySampleMaskOverrideCoverageNV = 5249, + SpvCapabilityGeometryShaderPassthroughNV = 5251, + SpvCapabilityShaderViewportIndexLayerEXT = 5254, + SpvCapabilityShaderViewportIndexLayerNV = 5254, + SpvCapabilityShaderViewportMaskNV = 5255, + SpvCapabilityShaderStereoViewNV = 5259, + SpvCapabilityPerViewAttributesNV = 5260, + SpvCapabilitySubgroupShuffleINTEL = 5568, + SpvCapabilitySubgroupBufferBlockIOINTEL = 5569, + SpvCapabilitySubgroupImageBlockIOINTEL = 5570, + SpvCapabilityMax = 0x7fffffff, +} SpvCapability; + +typedef enum SpvOp_ { + SpvOpNop = 0, + SpvOpUndef = 1, + SpvOpSourceContinued = 2, + SpvOpSource = 3, + SpvOpSourceExtension = 4, + SpvOpName = 5, + SpvOpMemberName = 6, + SpvOpString = 7, + SpvOpLine = 8, + SpvOpExtension = 10, + SpvOpExtInstImport = 11, + SpvOpExtInst = 12, + SpvOpMemoryModel = 14, + SpvOpEntryPoint = 15, + SpvOpExecutionMode = 16, + SpvOpCapability = 17, + SpvOpTypeVoid = 19, + SpvOpTypeBool = 20, + SpvOpTypeInt = 21, + SpvOpTypeFloat = 22, + SpvOpTypeVector = 23, + SpvOpTypeMatrix = 24, + SpvOpTypeImage = 25, + SpvOpTypeSampler = 26, + SpvOpTypeSampledImage = 27, + SpvOpTypeArray = 28, + SpvOpTypeRuntimeArray = 29, + SpvOpTypeStruct = 30, + SpvOpTypeOpaque = 31, + SpvOpTypePointer = 32, + SpvOpTypeFunction = 33, + SpvOpTypeEvent = 34, + SpvOpTypeDeviceEvent = 35, + SpvOpTypeReserveId = 36, + SpvOpTypeQueue = 37, + SpvOpTypePipe = 38, + SpvOpTypeForwardPointer = 39, + SpvOpConstantTrue = 41, + SpvOpConstantFalse = 42, + SpvOpConstant = 43, + SpvOpConstantComposite = 44, + SpvOpConstantSampler = 45, + SpvOpConstantNull = 46, + SpvOpSpecConstantTrue = 48, + SpvOpSpecConstantFalse = 49, + SpvOpSpecConstant = 50, + SpvOpSpecConstantComposite = 51, + SpvOpSpecConstantOp = 52, + SpvOpFunction = 54, + SpvOpFunctionParameter = 55, + SpvOpFunctionEnd = 56, + SpvOpFunctionCall = 57, + SpvOpVariable = 59, + SpvOpImageTexelPointer = 60, + SpvOpLoad = 61, + SpvOpStore = 62, + SpvOpCopyMemory = 63, + SpvOpCopyMemorySized = 64, + SpvOpAccessChain = 65, + SpvOpInBoundsAccessChain = 66, + SpvOpPtrAccessChain = 67, + SpvOpArrayLength = 68, + SpvOpGenericPtrMemSemantics = 69, + SpvOpInBoundsPtrAccessChain = 70, + SpvOpDecorate = 71, + SpvOpMemberDecorate = 72, + SpvOpDecorationGroup = 73, + SpvOpGroupDecorate = 74, + SpvOpGroupMemberDecorate = 75, + SpvOpVectorExtractDynamic = 77, + SpvOpVectorInsertDynamic = 78, + SpvOpVectorShuffle = 79, + SpvOpCompositeConstruct = 80, + SpvOpCompositeExtract = 81, + SpvOpCompositeInsert = 82, + SpvOpCopyObject = 83, + SpvOpTranspose = 84, + SpvOpSampledImage = 86, + SpvOpImageSampleImplicitLod = 87, + SpvOpImageSampleExplicitLod = 88, + SpvOpImageSampleDrefImplicitLod = 89, + SpvOpImageSampleDrefExplicitLod = 90, + SpvOpImageSampleProjImplicitLod = 91, + SpvOpImageSampleProjExplicitLod = 92, + SpvOpImageSampleProjDrefImplicitLod = 93, + SpvOpImageSampleProjDrefExplicitLod = 94, + SpvOpImageFetch = 95, + SpvOpImageGather = 96, + SpvOpImageDrefGather = 97, + SpvOpImageRead = 98, + SpvOpImageWrite = 99, + SpvOpImage = 100, + SpvOpImageQueryFormat = 101, + SpvOpImageQueryOrder = 102, + SpvOpImageQuerySizeLod = 103, + SpvOpImageQuerySize = 104, + SpvOpImageQueryLod = 105, + SpvOpImageQueryLevels = 106, + SpvOpImageQuerySamples = 107, + SpvOpConvertFToU = 109, + SpvOpConvertFToS = 110, + SpvOpConvertSToF = 111, + SpvOpConvertUToF = 112, + SpvOpUConvert = 113, + SpvOpSConvert = 114, + SpvOpFConvert = 115, + SpvOpQuantizeToF16 = 116, + SpvOpConvertPtrToU = 117, + SpvOpSatConvertSToU = 118, + SpvOpSatConvertUToS = 119, + SpvOpConvertUToPtr = 120, + SpvOpPtrCastToGeneric = 121, + SpvOpGenericCastToPtr = 122, + SpvOpGenericCastToPtrExplicit = 123, + SpvOpBitcast = 124, + SpvOpSNegate = 126, + SpvOpFNegate = 127, + SpvOpIAdd = 128, + SpvOpFAdd = 129, + SpvOpISub = 130, + SpvOpFSub = 131, + SpvOpIMul = 132, + SpvOpFMul = 133, + SpvOpUDiv = 134, + SpvOpSDiv = 135, + SpvOpFDiv = 136, + SpvOpUMod = 137, + SpvOpSRem = 138, + SpvOpSMod = 139, + SpvOpFRem = 140, + SpvOpFMod = 141, + SpvOpVectorTimesScalar = 142, + SpvOpMatrixTimesScalar = 143, + SpvOpVectorTimesMatrix = 144, + SpvOpMatrixTimesVector = 145, + SpvOpMatrixTimesMatrix = 146, + SpvOpOuterProduct = 147, + SpvOpDot = 148, + SpvOpIAddCarry = 149, + SpvOpISubBorrow = 150, + SpvOpUMulExtended = 151, + SpvOpSMulExtended = 152, + SpvOpAny = 154, + SpvOpAll = 155, + SpvOpIsNan = 156, + SpvOpIsInf = 157, + SpvOpIsFinite = 158, + SpvOpIsNormal = 159, + SpvOpSignBitSet = 160, + SpvOpLessOrGreater = 161, + SpvOpOrdered = 162, + SpvOpUnordered = 163, + SpvOpLogicalEqual = 164, + SpvOpLogicalNotEqual = 165, + SpvOpLogicalOr = 166, + SpvOpLogicalAnd = 167, + SpvOpLogicalNot = 168, + SpvOpSelect = 169, + SpvOpIEqual = 170, + SpvOpINotEqual = 171, + SpvOpUGreaterThan = 172, + SpvOpSGreaterThan = 173, + SpvOpUGreaterThanEqual = 174, + SpvOpSGreaterThanEqual = 175, + SpvOpULessThan = 176, + SpvOpSLessThan = 177, + SpvOpULessThanEqual = 178, + SpvOpSLessThanEqual = 179, + SpvOpFOrdEqual = 180, + SpvOpFUnordEqual = 181, + SpvOpFOrdNotEqual = 182, + SpvOpFUnordNotEqual = 183, + SpvOpFOrdLessThan = 184, + SpvOpFUnordLessThan = 185, + SpvOpFOrdGreaterThan = 186, + SpvOpFUnordGreaterThan = 187, + SpvOpFOrdLessThanEqual = 188, + SpvOpFUnordLessThanEqual = 189, + SpvOpFOrdGreaterThanEqual = 190, + SpvOpFUnordGreaterThanEqual = 191, + SpvOpShiftRightLogical = 194, + SpvOpShiftRightArithmetic = 195, + SpvOpShiftLeftLogical = 196, + SpvOpBitwiseOr = 197, + SpvOpBitwiseXor = 198, + SpvOpBitwiseAnd = 199, + SpvOpNot = 200, + SpvOpBitFieldInsert = 201, + SpvOpBitFieldSExtract = 202, + SpvOpBitFieldUExtract = 203, + SpvOpBitReverse = 204, + SpvOpBitCount = 205, + SpvOpDPdx = 207, + SpvOpDPdy = 208, + SpvOpFwidth = 209, + SpvOpDPdxFine = 210, + SpvOpDPdyFine = 211, + SpvOpFwidthFine = 212, + SpvOpDPdxCoarse = 213, + SpvOpDPdyCoarse = 214, + SpvOpFwidthCoarse = 215, + SpvOpEmitVertex = 218, + SpvOpEndPrimitive = 219, + SpvOpEmitStreamVertex = 220, + SpvOpEndStreamPrimitive = 221, + SpvOpControlBarrier = 224, + SpvOpMemoryBarrier = 225, + SpvOpAtomicLoad = 227, + SpvOpAtomicStore = 228, + SpvOpAtomicExchange = 229, + SpvOpAtomicCompareExchange = 230, + SpvOpAtomicCompareExchangeWeak = 231, + SpvOpAtomicIIncrement = 232, + SpvOpAtomicIDecrement = 233, + SpvOpAtomicIAdd = 234, + SpvOpAtomicISub = 235, + SpvOpAtomicSMin = 236, + SpvOpAtomicUMin = 237, + SpvOpAtomicSMax = 238, + SpvOpAtomicUMax = 239, + SpvOpAtomicAnd = 240, + SpvOpAtomicOr = 241, + SpvOpAtomicXor = 242, + SpvOpPhi = 245, + SpvOpLoopMerge = 246, + SpvOpSelectionMerge = 247, + SpvOpLabel = 248, + SpvOpBranch = 249, + SpvOpBranchConditional = 250, + SpvOpSwitch = 251, + SpvOpKill = 252, + SpvOpReturn = 253, + SpvOpReturnValue = 254, + SpvOpUnreachable = 255, + SpvOpLifetimeStart = 256, + SpvOpLifetimeStop = 257, + SpvOpGroupAsyncCopy = 259, + SpvOpGroupWaitEvents = 260, + SpvOpGroupAll = 261, + SpvOpGroupAny = 262, + SpvOpGroupBroadcast = 263, + SpvOpGroupIAdd = 264, + SpvOpGroupFAdd = 265, + SpvOpGroupFMin = 266, + SpvOpGroupUMin = 267, + SpvOpGroupSMin = 268, + SpvOpGroupFMax = 269, + SpvOpGroupUMax = 270, + SpvOpGroupSMax = 271, + SpvOpReadPipe = 274, + SpvOpWritePipe = 275, + SpvOpReservedReadPipe = 276, + SpvOpReservedWritePipe = 277, + SpvOpReserveReadPipePackets = 278, + SpvOpReserveWritePipePackets = 279, + SpvOpCommitReadPipe = 280, + SpvOpCommitWritePipe = 281, + SpvOpIsValidReserveId = 282, + SpvOpGetNumPipePackets = 283, + SpvOpGetMaxPipePackets = 284, + SpvOpGroupReserveReadPipePackets = 285, + SpvOpGroupReserveWritePipePackets = 286, + SpvOpGroupCommitReadPipe = 287, + SpvOpGroupCommitWritePipe = 288, + SpvOpEnqueueMarker = 291, + SpvOpEnqueueKernel = 292, + SpvOpGetKernelNDrangeSubGroupCount = 293, + SpvOpGetKernelNDrangeMaxSubGroupSize = 294, + SpvOpGetKernelWorkGroupSize = 295, + SpvOpGetKernelPreferredWorkGroupSizeMultiple = 296, + SpvOpRetainEvent = 297, + SpvOpReleaseEvent = 298, + SpvOpCreateUserEvent = 299, + SpvOpIsValidEvent = 300, + SpvOpSetUserEventStatus = 301, + SpvOpCaptureEventProfilingInfo = 302, + SpvOpGetDefaultQueue = 303, + SpvOpBuildNDRange = 304, + SpvOpImageSparseSampleImplicitLod = 305, + SpvOpImageSparseSampleExplicitLod = 306, + SpvOpImageSparseSampleDrefImplicitLod = 307, + SpvOpImageSparseSampleDrefExplicitLod = 308, + SpvOpImageSparseSampleProjImplicitLod = 309, + SpvOpImageSparseSampleProjExplicitLod = 310, + SpvOpImageSparseSampleProjDrefImplicitLod = 311, + SpvOpImageSparseSampleProjDrefExplicitLod = 312, + SpvOpImageSparseFetch = 313, + SpvOpImageSparseGather = 314, + SpvOpImageSparseDrefGather = 315, + SpvOpImageSparseTexelsResident = 316, + SpvOpNoLine = 317, + SpvOpAtomicFlagTestAndSet = 318, + SpvOpAtomicFlagClear = 319, + SpvOpImageSparseRead = 320, + SpvOpSizeOf = 321, + SpvOpTypePipeStorage = 322, + SpvOpConstantPipeStorage = 323, + SpvOpCreatePipeFromPipeStorage = 324, + SpvOpGetKernelLocalSizeForSubgroupCount = 325, + SpvOpGetKernelMaxNumSubgroups = 326, + SpvOpTypeNamedBarrier = 327, + SpvOpNamedBarrierInitialize = 328, + SpvOpMemoryNamedBarrier = 329, + SpvOpModuleProcessed = 330, + SpvOpExecutionModeId = 331, + SpvOpDecorateId = 332, + SpvOpSubgroupBallotKHR = 4421, + SpvOpSubgroupFirstInvocationKHR = 4422, + SpvOpSubgroupAllKHR = 4428, + SpvOpSubgroupAnyKHR = 4429, + SpvOpSubgroupAllEqualKHR = 4430, + SpvOpSubgroupReadInvocationKHR = 4432, + SpvOpGroupIAddNonUniformAMD = 5000, + SpvOpGroupFAddNonUniformAMD = 5001, + SpvOpGroupFMinNonUniformAMD = 5002, + SpvOpGroupUMinNonUniformAMD = 5003, + SpvOpGroupSMinNonUniformAMD = 5004, + SpvOpGroupFMaxNonUniformAMD = 5005, + SpvOpGroupUMaxNonUniformAMD = 5006, + SpvOpGroupSMaxNonUniformAMD = 5007, + SpvOpFragmentMaskFetchAMD = 5011, + SpvOpFragmentFetchAMD = 5012, + SpvOpSubgroupShuffleINTEL = 5571, + SpvOpSubgroupShuffleDownINTEL = 5572, + SpvOpSubgroupShuffleUpINTEL = 5573, + SpvOpSubgroupShuffleXorINTEL = 5574, + SpvOpSubgroupBlockReadINTEL = 5575, + SpvOpSubgroupBlockWriteINTEL = 5576, + SpvOpSubgroupImageBlockReadINTEL = 5577, + SpvOpSubgroupImageBlockWriteINTEL = 5578, + SpvOpDecorateStringGOOGLE = 5632, + SpvOpMemberDecorateStringGOOGLE = 5633, + SpvOpMax = 0x7fffffff, +} SpvOp; + +#endif // #ifndef spirv_H + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.hpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.hpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.hpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.hpp 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1030 @@ +// Copyright (c) 2014-2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// This header is automatically generated by the same tool that creates +// the Binary Section of the SPIR-V specification. + +// Enumeration tokens for SPIR-V, in various styles: +// C, C++, C++11, JSON, Lua, Python +// +// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// +// Some tokens act like mask values, which can be OR'd together, +// while others are mutually exclusive. The mask-like ones have +// "Mask" in their name, and a parallel enum that has the shift +// amount (1 << x) for each corresponding enumerant. + +#ifndef spirv_HPP +#define spirv_HPP + +namespace spv { + +typedef unsigned int Id; + +#define SPV_VERSION 0x10200 +#define SPV_REVISION 2 + +static const unsigned int MagicNumber = 0x07230203; +static const unsigned int Version = 0x00010200; +static const unsigned int Revision = 2; +static const unsigned int OpCodeMask = 0xffff; +static const unsigned int WordCountShift = 16; + +enum SourceLanguage { + SourceLanguageUnknown = 0, + SourceLanguageESSL = 1, + SourceLanguageGLSL = 2, + SourceLanguageOpenCL_C = 3, + SourceLanguageOpenCL_CPP = 4, + SourceLanguageHLSL = 5, + SourceLanguageMax = 0x7fffffff, +}; + +enum ExecutionModel { + ExecutionModelVertex = 0, + ExecutionModelTessellationControl = 1, + ExecutionModelTessellationEvaluation = 2, + ExecutionModelGeometry = 3, + ExecutionModelFragment = 4, + ExecutionModelGLCompute = 5, + ExecutionModelKernel = 6, + ExecutionModelMax = 0x7fffffff, +}; + +enum AddressingModel { + AddressingModelLogical = 0, + AddressingModelPhysical32 = 1, + AddressingModelPhysical64 = 2, + AddressingModelMax = 0x7fffffff, +}; + +enum MemoryModel { + MemoryModelSimple = 0, + MemoryModelGLSL450 = 1, + MemoryModelOpenCL = 2, + MemoryModelMax = 0x7fffffff, +}; + +enum ExecutionMode { + ExecutionModeInvocations = 0, + ExecutionModeSpacingEqual = 1, + ExecutionModeSpacingFractionalEven = 2, + ExecutionModeSpacingFractionalOdd = 3, + ExecutionModeVertexOrderCw = 4, + ExecutionModeVertexOrderCcw = 5, + ExecutionModePixelCenterInteger = 6, + ExecutionModeOriginUpperLeft = 7, + ExecutionModeOriginLowerLeft = 8, + ExecutionModeEarlyFragmentTests = 9, + ExecutionModePointMode = 10, + ExecutionModeXfb = 11, + ExecutionModeDepthReplacing = 12, + ExecutionModeDepthGreater = 14, + ExecutionModeDepthLess = 15, + ExecutionModeDepthUnchanged = 16, + ExecutionModeLocalSize = 17, + ExecutionModeLocalSizeHint = 18, + ExecutionModeInputPoints = 19, + ExecutionModeInputLines = 20, + ExecutionModeInputLinesAdjacency = 21, + ExecutionModeTriangles = 22, + ExecutionModeInputTrianglesAdjacency = 23, + ExecutionModeQuads = 24, + ExecutionModeIsolines = 25, + ExecutionModeOutputVertices = 26, + ExecutionModeOutputPoints = 27, + ExecutionModeOutputLineStrip = 28, + ExecutionModeOutputTriangleStrip = 29, + ExecutionModeVecTypeHint = 30, + ExecutionModeContractionOff = 31, + ExecutionModeInitializer = 33, + ExecutionModeFinalizer = 34, + ExecutionModeSubgroupSize = 35, + ExecutionModeSubgroupsPerWorkgroup = 36, + ExecutionModeSubgroupsPerWorkgroupId = 37, + ExecutionModeLocalSizeId = 38, + ExecutionModeLocalSizeHintId = 39, + ExecutionModePostDepthCoverage = 4446, + ExecutionModeStencilRefReplacingEXT = 5027, + ExecutionModeMax = 0x7fffffff, +}; + +enum StorageClass { + StorageClassUniformConstant = 0, + StorageClassInput = 1, + StorageClassUniform = 2, + StorageClassOutput = 3, + StorageClassWorkgroup = 4, + StorageClassCrossWorkgroup = 5, + StorageClassPrivate = 6, + StorageClassFunction = 7, + StorageClassGeneric = 8, + StorageClassPushConstant = 9, + StorageClassAtomicCounter = 10, + StorageClassImage = 11, + StorageClassStorageBuffer = 12, + StorageClassMax = 0x7fffffff, +}; + +enum Dim { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + DimCube = 3, + DimRect = 4, + DimBuffer = 5, + DimSubpassData = 6, + DimMax = 0x7fffffff, +}; + +enum SamplerAddressingMode { + SamplerAddressingModeNone = 0, + SamplerAddressingModeClampToEdge = 1, + SamplerAddressingModeClamp = 2, + SamplerAddressingModeRepeat = 3, + SamplerAddressingModeRepeatMirrored = 4, + SamplerAddressingModeMax = 0x7fffffff, +}; + +enum SamplerFilterMode { + SamplerFilterModeNearest = 0, + SamplerFilterModeLinear = 1, + SamplerFilterModeMax = 0x7fffffff, +}; + +enum ImageFormat { + ImageFormatUnknown = 0, + ImageFormatRgba32f = 1, + ImageFormatRgba16f = 2, + ImageFormatR32f = 3, + ImageFormatRgba8 = 4, + ImageFormatRgba8Snorm = 5, + ImageFormatRg32f = 6, + ImageFormatRg16f = 7, + ImageFormatR11fG11fB10f = 8, + ImageFormatR16f = 9, + ImageFormatRgba16 = 10, + ImageFormatRgb10A2 = 11, + ImageFormatRg16 = 12, + ImageFormatRg8 = 13, + ImageFormatR16 = 14, + ImageFormatR8 = 15, + ImageFormatRgba16Snorm = 16, + ImageFormatRg16Snorm = 17, + ImageFormatRg8Snorm = 18, + ImageFormatR16Snorm = 19, + ImageFormatR8Snorm = 20, + ImageFormatRgba32i = 21, + ImageFormatRgba16i = 22, + ImageFormatRgba8i = 23, + ImageFormatR32i = 24, + ImageFormatRg32i = 25, + ImageFormatRg16i = 26, + ImageFormatRg8i = 27, + ImageFormatR16i = 28, + ImageFormatR8i = 29, + ImageFormatRgba32ui = 30, + ImageFormatRgba16ui = 31, + ImageFormatRgba8ui = 32, + ImageFormatR32ui = 33, + ImageFormatRgb10a2ui = 34, + ImageFormatRg32ui = 35, + ImageFormatRg16ui = 36, + ImageFormatRg8ui = 37, + ImageFormatR16ui = 38, + ImageFormatR8ui = 39, + ImageFormatMax = 0x7fffffff, +}; + +enum ImageChannelOrder { + ImageChannelOrderR = 0, + ImageChannelOrderA = 1, + ImageChannelOrderRG = 2, + ImageChannelOrderRA = 3, + ImageChannelOrderRGB = 4, + ImageChannelOrderRGBA = 5, + ImageChannelOrderBGRA = 6, + ImageChannelOrderARGB = 7, + ImageChannelOrderIntensity = 8, + ImageChannelOrderLuminance = 9, + ImageChannelOrderRx = 10, + ImageChannelOrderRGx = 11, + ImageChannelOrderRGBx = 12, + ImageChannelOrderDepth = 13, + ImageChannelOrderDepthStencil = 14, + ImageChannelOrdersRGB = 15, + ImageChannelOrdersRGBx = 16, + ImageChannelOrdersRGBA = 17, + ImageChannelOrdersBGRA = 18, + ImageChannelOrderABGR = 19, + ImageChannelOrderMax = 0x7fffffff, +}; + +enum ImageChannelDataType { + ImageChannelDataTypeSnormInt8 = 0, + ImageChannelDataTypeSnormInt16 = 1, + ImageChannelDataTypeUnormInt8 = 2, + ImageChannelDataTypeUnormInt16 = 3, + ImageChannelDataTypeUnormShort565 = 4, + ImageChannelDataTypeUnormShort555 = 5, + ImageChannelDataTypeUnormInt101010 = 6, + ImageChannelDataTypeSignedInt8 = 7, + ImageChannelDataTypeSignedInt16 = 8, + ImageChannelDataTypeSignedInt32 = 9, + ImageChannelDataTypeUnsignedInt8 = 10, + ImageChannelDataTypeUnsignedInt16 = 11, + ImageChannelDataTypeUnsignedInt32 = 12, + ImageChannelDataTypeHalfFloat = 13, + ImageChannelDataTypeFloat = 14, + ImageChannelDataTypeUnormInt24 = 15, + ImageChannelDataTypeUnormInt101010_2 = 16, + ImageChannelDataTypeMax = 0x7fffffff, +}; + +enum ImageOperandsShift { + ImageOperandsBiasShift = 0, + ImageOperandsLodShift = 1, + ImageOperandsGradShift = 2, + ImageOperandsConstOffsetShift = 3, + ImageOperandsOffsetShift = 4, + ImageOperandsConstOffsetsShift = 5, + ImageOperandsSampleShift = 6, + ImageOperandsMinLodShift = 7, + ImageOperandsMax = 0x7fffffff, +}; + +enum ImageOperandsMask { + ImageOperandsMaskNone = 0, + ImageOperandsBiasMask = 0x00000001, + ImageOperandsLodMask = 0x00000002, + ImageOperandsGradMask = 0x00000004, + ImageOperandsConstOffsetMask = 0x00000008, + ImageOperandsOffsetMask = 0x00000010, + ImageOperandsConstOffsetsMask = 0x00000020, + ImageOperandsSampleMask = 0x00000040, + ImageOperandsMinLodMask = 0x00000080, +}; + +enum FPFastMathModeShift { + FPFastMathModeNotNaNShift = 0, + FPFastMathModeNotInfShift = 1, + FPFastMathModeNSZShift = 2, + FPFastMathModeAllowRecipShift = 3, + FPFastMathModeFastShift = 4, + FPFastMathModeMax = 0x7fffffff, +}; + +enum FPFastMathModeMask { + FPFastMathModeMaskNone = 0, + FPFastMathModeNotNaNMask = 0x00000001, + FPFastMathModeNotInfMask = 0x00000002, + FPFastMathModeNSZMask = 0x00000004, + FPFastMathModeAllowRecipMask = 0x00000008, + FPFastMathModeFastMask = 0x00000010, +}; + +enum FPRoundingMode { + FPRoundingModeRTE = 0, + FPRoundingModeRTZ = 1, + FPRoundingModeRTP = 2, + FPRoundingModeRTN = 3, + FPRoundingModeMax = 0x7fffffff, +}; + +enum LinkageType { + LinkageTypeExport = 0, + LinkageTypeImport = 1, + LinkageTypeMax = 0x7fffffff, +}; + +enum AccessQualifier { + AccessQualifierReadOnly = 0, + AccessQualifierWriteOnly = 1, + AccessQualifierReadWrite = 2, + AccessQualifierMax = 0x7fffffff, +}; + +enum FunctionParameterAttribute { + FunctionParameterAttributeZext = 0, + FunctionParameterAttributeSext = 1, + FunctionParameterAttributeByVal = 2, + FunctionParameterAttributeSret = 3, + FunctionParameterAttributeNoAlias = 4, + FunctionParameterAttributeNoCapture = 5, + FunctionParameterAttributeNoWrite = 6, + FunctionParameterAttributeNoReadWrite = 7, + FunctionParameterAttributeMax = 0x7fffffff, +}; + +enum Decoration { + DecorationRelaxedPrecision = 0, + DecorationSpecId = 1, + DecorationBlock = 2, + DecorationBufferBlock = 3, + DecorationRowMajor = 4, + DecorationColMajor = 5, + DecorationArrayStride = 6, + DecorationMatrixStride = 7, + DecorationGLSLShared = 8, + DecorationGLSLPacked = 9, + DecorationCPacked = 10, + DecorationBuiltIn = 11, + DecorationNoPerspective = 13, + DecorationFlat = 14, + DecorationPatch = 15, + DecorationCentroid = 16, + DecorationSample = 17, + DecorationInvariant = 18, + DecorationRestrict = 19, + DecorationAliased = 20, + DecorationVolatile = 21, + DecorationConstant = 22, + DecorationCoherent = 23, + DecorationNonWritable = 24, + DecorationNonReadable = 25, + DecorationUniform = 26, + DecorationSaturatedConversion = 28, + DecorationStream = 29, + DecorationLocation = 30, + DecorationComponent = 31, + DecorationIndex = 32, + DecorationBinding = 33, + DecorationDescriptorSet = 34, + DecorationOffset = 35, + DecorationXfbBuffer = 36, + DecorationXfbStride = 37, + DecorationFuncParamAttr = 38, + DecorationFPRoundingMode = 39, + DecorationFPFastMathMode = 40, + DecorationLinkageAttributes = 41, + DecorationNoContraction = 42, + DecorationInputAttachmentIndex = 43, + DecorationAlignment = 44, + DecorationMaxByteOffset = 45, + DecorationAlignmentId = 46, + DecorationMaxByteOffsetId = 47, + DecorationExplicitInterpAMD = 4999, + DecorationOverrideCoverageNV = 5248, + DecorationPassthroughNV = 5250, + DecorationViewportRelativeNV = 5252, + DecorationSecondaryViewportRelativeNV = 5256, + DecorationHlslCounterBufferGOOGLE = 5634, + DecorationHlslSemanticGOOGLE = 5635, + DecorationMax = 0x7fffffff, +}; + +enum BuiltIn { + BuiltInPosition = 0, + BuiltInPointSize = 1, + BuiltInClipDistance = 3, + BuiltInCullDistance = 4, + BuiltInVertexId = 5, + BuiltInInstanceId = 6, + BuiltInPrimitiveId = 7, + BuiltInInvocationId = 8, + BuiltInLayer = 9, + BuiltInViewportIndex = 10, + BuiltInTessLevelOuter = 11, + BuiltInTessLevelInner = 12, + BuiltInTessCoord = 13, + BuiltInPatchVertices = 14, + BuiltInFragCoord = 15, + BuiltInPointCoord = 16, + BuiltInFrontFacing = 17, + BuiltInSampleId = 18, + BuiltInSamplePosition = 19, + BuiltInSampleMask = 20, + BuiltInFragDepth = 22, + BuiltInHelperInvocation = 23, + BuiltInNumWorkgroups = 24, + BuiltInWorkgroupSize = 25, + BuiltInWorkgroupId = 26, + BuiltInLocalInvocationId = 27, + BuiltInGlobalInvocationId = 28, + BuiltInLocalInvocationIndex = 29, + BuiltInWorkDim = 30, + BuiltInGlobalSize = 31, + BuiltInEnqueuedWorkgroupSize = 32, + BuiltInGlobalOffset = 33, + BuiltInGlobalLinearId = 34, + BuiltInSubgroupSize = 36, + BuiltInSubgroupMaxSize = 37, + BuiltInNumSubgroups = 38, + BuiltInNumEnqueuedSubgroups = 39, + BuiltInSubgroupId = 40, + BuiltInSubgroupLocalInvocationId = 41, + BuiltInVertexIndex = 42, + BuiltInInstanceIndex = 43, + BuiltInSubgroupEqMaskKHR = 4416, + BuiltInSubgroupGeMaskKHR = 4417, + BuiltInSubgroupGtMaskKHR = 4418, + BuiltInSubgroupLeMaskKHR = 4419, + BuiltInSubgroupLtMaskKHR = 4420, + BuiltInBaseVertex = 4424, + BuiltInBaseInstance = 4425, + BuiltInDrawIndex = 4426, + BuiltInDeviceIndex = 4438, + BuiltInViewIndex = 4440, + BuiltInBaryCoordNoPerspAMD = 4992, + BuiltInBaryCoordNoPerspCentroidAMD = 4993, + BuiltInBaryCoordNoPerspSampleAMD = 4994, + BuiltInBaryCoordSmoothAMD = 4995, + BuiltInBaryCoordSmoothCentroidAMD = 4996, + BuiltInBaryCoordSmoothSampleAMD = 4997, + BuiltInBaryCoordPullModelAMD = 4998, + BuiltInFragStencilRefEXT = 5014, + BuiltInViewportMaskNV = 5253, + BuiltInSecondaryPositionNV = 5257, + BuiltInSecondaryViewportMaskNV = 5258, + BuiltInPositionPerViewNV = 5261, + BuiltInViewportMaskPerViewNV = 5262, + BuiltInMax = 0x7fffffff, +}; + +enum SelectionControlShift { + SelectionControlFlattenShift = 0, + SelectionControlDontFlattenShift = 1, + SelectionControlMax = 0x7fffffff, +}; + +enum SelectionControlMask { + SelectionControlMaskNone = 0, + SelectionControlFlattenMask = 0x00000001, + SelectionControlDontFlattenMask = 0x00000002, +}; + +enum LoopControlShift { + LoopControlUnrollShift = 0, + LoopControlDontUnrollShift = 1, + LoopControlDependencyInfiniteShift = 2, + LoopControlDependencyLengthShift = 3, + LoopControlMax = 0x7fffffff, +}; + +enum LoopControlMask { + LoopControlMaskNone = 0, + LoopControlUnrollMask = 0x00000001, + LoopControlDontUnrollMask = 0x00000002, + LoopControlDependencyInfiniteMask = 0x00000004, + LoopControlDependencyLengthMask = 0x00000008, +}; + +enum FunctionControlShift { + FunctionControlInlineShift = 0, + FunctionControlDontInlineShift = 1, + FunctionControlPureShift = 2, + FunctionControlConstShift = 3, + FunctionControlMax = 0x7fffffff, +}; + +enum FunctionControlMask { + FunctionControlMaskNone = 0, + FunctionControlInlineMask = 0x00000001, + FunctionControlDontInlineMask = 0x00000002, + FunctionControlPureMask = 0x00000004, + FunctionControlConstMask = 0x00000008, +}; + +enum MemorySemanticsShift { + MemorySemanticsAcquireShift = 1, + MemorySemanticsReleaseShift = 2, + MemorySemanticsAcquireReleaseShift = 3, + MemorySemanticsSequentiallyConsistentShift = 4, + MemorySemanticsUniformMemoryShift = 6, + MemorySemanticsSubgroupMemoryShift = 7, + MemorySemanticsWorkgroupMemoryShift = 8, + MemorySemanticsCrossWorkgroupMemoryShift = 9, + MemorySemanticsAtomicCounterMemoryShift = 10, + MemorySemanticsImageMemoryShift = 11, + MemorySemanticsMax = 0x7fffffff, +}; + +enum MemorySemanticsMask { + MemorySemanticsMaskNone = 0, + MemorySemanticsAcquireMask = 0x00000002, + MemorySemanticsReleaseMask = 0x00000004, + MemorySemanticsAcquireReleaseMask = 0x00000008, + MemorySemanticsSequentiallyConsistentMask = 0x00000010, + MemorySemanticsUniformMemoryMask = 0x00000040, + MemorySemanticsSubgroupMemoryMask = 0x00000080, + MemorySemanticsWorkgroupMemoryMask = 0x00000100, + MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, + MemorySemanticsAtomicCounterMemoryMask = 0x00000400, + MemorySemanticsImageMemoryMask = 0x00000800, +}; + +enum MemoryAccessShift { + MemoryAccessVolatileShift = 0, + MemoryAccessAlignedShift = 1, + MemoryAccessNontemporalShift = 2, + MemoryAccessMax = 0x7fffffff, +}; + +enum MemoryAccessMask { + MemoryAccessMaskNone = 0, + MemoryAccessVolatileMask = 0x00000001, + MemoryAccessAlignedMask = 0x00000002, + MemoryAccessNontemporalMask = 0x00000004, +}; + +enum Scope { + ScopeCrossDevice = 0, + ScopeDevice = 1, + ScopeWorkgroup = 2, + ScopeSubgroup = 3, + ScopeInvocation = 4, + ScopeMax = 0x7fffffff, +}; + +enum GroupOperation { + GroupOperationReduce = 0, + GroupOperationInclusiveScan = 1, + GroupOperationExclusiveScan = 2, + GroupOperationMax = 0x7fffffff, +}; + +enum KernelEnqueueFlags { + KernelEnqueueFlagsNoWait = 0, + KernelEnqueueFlagsWaitKernel = 1, + KernelEnqueueFlagsWaitWorkGroup = 2, + KernelEnqueueFlagsMax = 0x7fffffff, +}; + +enum KernelProfilingInfoShift { + KernelProfilingInfoCmdExecTimeShift = 0, + KernelProfilingInfoMax = 0x7fffffff, +}; + +enum KernelProfilingInfoMask { + KernelProfilingInfoMaskNone = 0, + KernelProfilingInfoCmdExecTimeMask = 0x00000001, +}; + +enum Capability { + CapabilityMatrix = 0, + CapabilityShader = 1, + CapabilityGeometry = 2, + CapabilityTessellation = 3, + CapabilityAddresses = 4, + CapabilityLinkage = 5, + CapabilityKernel = 6, + CapabilityVector16 = 7, + CapabilityFloat16Buffer = 8, + CapabilityFloat16 = 9, + CapabilityFloat64 = 10, + CapabilityInt64 = 11, + CapabilityInt64Atomics = 12, + CapabilityImageBasic = 13, + CapabilityImageReadWrite = 14, + CapabilityImageMipmap = 15, + CapabilityPipes = 17, + CapabilityGroups = 18, + CapabilityDeviceEnqueue = 19, + CapabilityLiteralSampler = 20, + CapabilityAtomicStorage = 21, + CapabilityInt16 = 22, + CapabilityTessellationPointSize = 23, + CapabilityGeometryPointSize = 24, + CapabilityImageGatherExtended = 25, + CapabilityStorageImageMultisample = 27, + CapabilityUniformBufferArrayDynamicIndexing = 28, + CapabilitySampledImageArrayDynamicIndexing = 29, + CapabilityStorageBufferArrayDynamicIndexing = 30, + CapabilityStorageImageArrayDynamicIndexing = 31, + CapabilityClipDistance = 32, + CapabilityCullDistance = 33, + CapabilityImageCubeArray = 34, + CapabilitySampleRateShading = 35, + CapabilityImageRect = 36, + CapabilitySampledRect = 37, + CapabilityGenericPointer = 38, + CapabilityInt8 = 39, + CapabilityInputAttachment = 40, + CapabilitySparseResidency = 41, + CapabilityMinLod = 42, + CapabilitySampled1D = 43, + CapabilityImage1D = 44, + CapabilitySampledCubeArray = 45, + CapabilitySampledBuffer = 46, + CapabilityImageBuffer = 47, + CapabilityImageMSArray = 48, + CapabilityStorageImageExtendedFormats = 49, + CapabilityImageQuery = 50, + CapabilityDerivativeControl = 51, + CapabilityInterpolationFunction = 52, + CapabilityTransformFeedback = 53, + CapabilityGeometryStreams = 54, + CapabilityStorageImageReadWithoutFormat = 55, + CapabilityStorageImageWriteWithoutFormat = 56, + CapabilityMultiViewport = 57, + CapabilitySubgroupDispatch = 58, + CapabilityNamedBarrier = 59, + CapabilityPipeStorage = 60, + CapabilitySubgroupBallotKHR = 4423, + CapabilityDrawParameters = 4427, + CapabilitySubgroupVoteKHR = 4431, + CapabilityStorageBuffer16BitAccess = 4433, + CapabilityStorageUniformBufferBlock16 = 4433, + CapabilityStorageUniform16 = 4434, + CapabilityUniformAndStorageBuffer16BitAccess = 4434, + CapabilityStoragePushConstant16 = 4435, + CapabilityStorageInputOutput16 = 4436, + CapabilityDeviceGroup = 4437, + CapabilityMultiView = 4439, + CapabilityVariablePointersStorageBuffer = 4441, + CapabilityVariablePointers = 4442, + CapabilityAtomicStorageOps = 4445, + CapabilitySampleMaskPostDepthCoverage = 4447, + CapabilityImageGatherBiasLodAMD = 5009, + CapabilityFragmentMaskAMD = 5010, + CapabilityStencilExportEXT = 5013, + CapabilityImageReadWriteLodAMD = 5015, + CapabilitySampleMaskOverrideCoverageNV = 5249, + CapabilityGeometryShaderPassthroughNV = 5251, + CapabilityShaderViewportIndexLayerEXT = 5254, + CapabilityShaderViewportIndexLayerNV = 5254, + CapabilityShaderViewportMaskNV = 5255, + CapabilityShaderStereoViewNV = 5259, + CapabilityPerViewAttributesNV = 5260, + CapabilitySubgroupShuffleINTEL = 5568, + CapabilitySubgroupBufferBlockIOINTEL = 5569, + CapabilitySubgroupImageBlockIOINTEL = 5570, + CapabilityMax = 0x7fffffff, +}; + +enum Op { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpExecutionModeId = 331, + OpDecorateId = 332, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpSubgroupReadInvocationKHR = 4432, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateStringGOOGLE = 5633, + OpMax = 0x7fffffff, +}; + +// Overload operator| for mask bit combining + +inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } + +} // end namespace spv + +#endif // #ifndef spirv_HPP + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.hpp11 vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.hpp11 --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.hpp11 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.hpp11 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1030 @@ +// Copyright (c) 2014-2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// This header is automatically generated by the same tool that creates +// the Binary Section of the SPIR-V specification. + +// Enumeration tokens for SPIR-V, in various styles: +// C, C++, C++11, JSON, Lua, Python +// +// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// +// Some tokens act like mask values, which can be OR'd together, +// while others are mutually exclusive. The mask-like ones have +// "Mask" in their name, and a parallel enum that has the shift +// amount (1 << x) for each corresponding enumerant. + +#ifndef spirv_HPP +#define spirv_HPP + +namespace spv { + +typedef unsigned int Id; + +#define SPV_VERSION 0x10200 +#define SPV_REVISION 2 + +static const unsigned int MagicNumber = 0x07230203; +static const unsigned int Version = 0x00010200; +static const unsigned int Revision = 2; +static const unsigned int OpCodeMask = 0xffff; +static const unsigned int WordCountShift = 16; + +enum class SourceLanguage : unsigned { + Unknown = 0, + ESSL = 1, + GLSL = 2, + OpenCL_C = 3, + OpenCL_CPP = 4, + HLSL = 5, + Max = 0x7fffffff, +}; + +enum class ExecutionModel : unsigned { + Vertex = 0, + TessellationControl = 1, + TessellationEvaluation = 2, + Geometry = 3, + Fragment = 4, + GLCompute = 5, + Kernel = 6, + Max = 0x7fffffff, +}; + +enum class AddressingModel : unsigned { + Logical = 0, + Physical32 = 1, + Physical64 = 2, + Max = 0x7fffffff, +}; + +enum class MemoryModel : unsigned { + Simple = 0, + GLSL450 = 1, + OpenCL = 2, + Max = 0x7fffffff, +}; + +enum class ExecutionMode : unsigned { + Invocations = 0, + SpacingEqual = 1, + SpacingFractionalEven = 2, + SpacingFractionalOdd = 3, + VertexOrderCw = 4, + VertexOrderCcw = 5, + PixelCenterInteger = 6, + OriginUpperLeft = 7, + OriginLowerLeft = 8, + EarlyFragmentTests = 9, + PointMode = 10, + Xfb = 11, + DepthReplacing = 12, + DepthGreater = 14, + DepthLess = 15, + DepthUnchanged = 16, + LocalSize = 17, + LocalSizeHint = 18, + InputPoints = 19, + InputLines = 20, + InputLinesAdjacency = 21, + Triangles = 22, + InputTrianglesAdjacency = 23, + Quads = 24, + Isolines = 25, + OutputVertices = 26, + OutputPoints = 27, + OutputLineStrip = 28, + OutputTriangleStrip = 29, + VecTypeHint = 30, + ContractionOff = 31, + Initializer = 33, + Finalizer = 34, + SubgroupSize = 35, + SubgroupsPerWorkgroup = 36, + SubgroupsPerWorkgroupId = 37, + LocalSizeId = 38, + LocalSizeHintId = 39, + PostDepthCoverage = 4446, + StencilRefReplacingEXT = 5027, + Max = 0x7fffffff, +}; + +enum class StorageClass : unsigned { + UniformConstant = 0, + Input = 1, + Uniform = 2, + Output = 3, + Workgroup = 4, + CrossWorkgroup = 5, + Private = 6, + Function = 7, + Generic = 8, + PushConstant = 9, + AtomicCounter = 10, + Image = 11, + StorageBuffer = 12, + Max = 0x7fffffff, +}; + +enum class Dim : unsigned { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + Cube = 3, + Rect = 4, + Buffer = 5, + SubpassData = 6, + Max = 0x7fffffff, +}; + +enum class SamplerAddressingMode : unsigned { + None = 0, + ClampToEdge = 1, + Clamp = 2, + Repeat = 3, + RepeatMirrored = 4, + Max = 0x7fffffff, +}; + +enum class SamplerFilterMode : unsigned { + Nearest = 0, + Linear = 1, + Max = 0x7fffffff, +}; + +enum class ImageFormat : unsigned { + Unknown = 0, + Rgba32f = 1, + Rgba16f = 2, + R32f = 3, + Rgba8 = 4, + Rgba8Snorm = 5, + Rg32f = 6, + Rg16f = 7, + R11fG11fB10f = 8, + R16f = 9, + Rgba16 = 10, + Rgb10A2 = 11, + Rg16 = 12, + Rg8 = 13, + R16 = 14, + R8 = 15, + Rgba16Snorm = 16, + Rg16Snorm = 17, + Rg8Snorm = 18, + R16Snorm = 19, + R8Snorm = 20, + Rgba32i = 21, + Rgba16i = 22, + Rgba8i = 23, + R32i = 24, + Rg32i = 25, + Rg16i = 26, + Rg8i = 27, + R16i = 28, + R8i = 29, + Rgba32ui = 30, + Rgba16ui = 31, + Rgba8ui = 32, + R32ui = 33, + Rgb10a2ui = 34, + Rg32ui = 35, + Rg16ui = 36, + Rg8ui = 37, + R16ui = 38, + R8ui = 39, + Max = 0x7fffffff, +}; + +enum class ImageChannelOrder : unsigned { + R = 0, + A = 1, + RG = 2, + RA = 3, + RGB = 4, + RGBA = 5, + BGRA = 6, + ARGB = 7, + Intensity = 8, + Luminance = 9, + Rx = 10, + RGx = 11, + RGBx = 12, + Depth = 13, + DepthStencil = 14, + sRGB = 15, + sRGBx = 16, + sRGBA = 17, + sBGRA = 18, + ABGR = 19, + Max = 0x7fffffff, +}; + +enum class ImageChannelDataType : unsigned { + SnormInt8 = 0, + SnormInt16 = 1, + UnormInt8 = 2, + UnormInt16 = 3, + UnormShort565 = 4, + UnormShort555 = 5, + UnormInt101010 = 6, + SignedInt8 = 7, + SignedInt16 = 8, + SignedInt32 = 9, + UnsignedInt8 = 10, + UnsignedInt16 = 11, + UnsignedInt32 = 12, + HalfFloat = 13, + Float = 14, + UnormInt24 = 15, + UnormInt101010_2 = 16, + Max = 0x7fffffff, +}; + +enum class ImageOperandsShift : unsigned { + Bias = 0, + Lod = 1, + Grad = 2, + ConstOffset = 3, + Offset = 4, + ConstOffsets = 5, + Sample = 6, + MinLod = 7, + Max = 0x7fffffff, +}; + +enum class ImageOperandsMask : unsigned { + MaskNone = 0, + Bias = 0x00000001, + Lod = 0x00000002, + Grad = 0x00000004, + ConstOffset = 0x00000008, + Offset = 0x00000010, + ConstOffsets = 0x00000020, + Sample = 0x00000040, + MinLod = 0x00000080, +}; + +enum class FPFastMathModeShift : unsigned { + NotNaN = 0, + NotInf = 1, + NSZ = 2, + AllowRecip = 3, + Fast = 4, + Max = 0x7fffffff, +}; + +enum class FPFastMathModeMask : unsigned { + MaskNone = 0, + NotNaN = 0x00000001, + NotInf = 0x00000002, + NSZ = 0x00000004, + AllowRecip = 0x00000008, + Fast = 0x00000010, +}; + +enum class FPRoundingMode : unsigned { + RTE = 0, + RTZ = 1, + RTP = 2, + RTN = 3, + Max = 0x7fffffff, +}; + +enum class LinkageType : unsigned { + Export = 0, + Import = 1, + Max = 0x7fffffff, +}; + +enum class AccessQualifier : unsigned { + ReadOnly = 0, + WriteOnly = 1, + ReadWrite = 2, + Max = 0x7fffffff, +}; + +enum class FunctionParameterAttribute : unsigned { + Zext = 0, + Sext = 1, + ByVal = 2, + Sret = 3, + NoAlias = 4, + NoCapture = 5, + NoWrite = 6, + NoReadWrite = 7, + Max = 0x7fffffff, +}; + +enum class Decoration : unsigned { + RelaxedPrecision = 0, + SpecId = 1, + Block = 2, + BufferBlock = 3, + RowMajor = 4, + ColMajor = 5, + ArrayStride = 6, + MatrixStride = 7, + GLSLShared = 8, + GLSLPacked = 9, + CPacked = 10, + BuiltIn = 11, + NoPerspective = 13, + Flat = 14, + Patch = 15, + Centroid = 16, + Sample = 17, + Invariant = 18, + Restrict = 19, + Aliased = 20, + Volatile = 21, + Constant = 22, + Coherent = 23, + NonWritable = 24, + NonReadable = 25, + Uniform = 26, + SaturatedConversion = 28, + Stream = 29, + Location = 30, + Component = 31, + Index = 32, + Binding = 33, + DescriptorSet = 34, + Offset = 35, + XfbBuffer = 36, + XfbStride = 37, + FuncParamAttr = 38, + FPRoundingMode = 39, + FPFastMathMode = 40, + LinkageAttributes = 41, + NoContraction = 42, + InputAttachmentIndex = 43, + Alignment = 44, + MaxByteOffset = 45, + AlignmentId = 46, + MaxByteOffsetId = 47, + ExplicitInterpAMD = 4999, + OverrideCoverageNV = 5248, + PassthroughNV = 5250, + ViewportRelativeNV = 5252, + SecondaryViewportRelativeNV = 5256, + HlslCounterBufferGOOGLE = 5634, + HlslSemanticGOOGLE = 5635, + Max = 0x7fffffff, +}; + +enum class BuiltIn : unsigned { + Position = 0, + PointSize = 1, + ClipDistance = 3, + CullDistance = 4, + VertexId = 5, + InstanceId = 6, + PrimitiveId = 7, + InvocationId = 8, + Layer = 9, + ViewportIndex = 10, + TessLevelOuter = 11, + TessLevelInner = 12, + TessCoord = 13, + PatchVertices = 14, + FragCoord = 15, + PointCoord = 16, + FrontFacing = 17, + SampleId = 18, + SamplePosition = 19, + SampleMask = 20, + FragDepth = 22, + HelperInvocation = 23, + NumWorkgroups = 24, + WorkgroupSize = 25, + WorkgroupId = 26, + LocalInvocationId = 27, + GlobalInvocationId = 28, + LocalInvocationIndex = 29, + WorkDim = 30, + GlobalSize = 31, + EnqueuedWorkgroupSize = 32, + GlobalOffset = 33, + GlobalLinearId = 34, + SubgroupSize = 36, + SubgroupMaxSize = 37, + NumSubgroups = 38, + NumEnqueuedSubgroups = 39, + SubgroupId = 40, + SubgroupLocalInvocationId = 41, + VertexIndex = 42, + InstanceIndex = 43, + SubgroupEqMaskKHR = 4416, + SubgroupGeMaskKHR = 4417, + SubgroupGtMaskKHR = 4418, + SubgroupLeMaskKHR = 4419, + SubgroupLtMaskKHR = 4420, + BaseVertex = 4424, + BaseInstance = 4425, + DrawIndex = 4426, + DeviceIndex = 4438, + ViewIndex = 4440, + BaryCoordNoPerspAMD = 4992, + BaryCoordNoPerspCentroidAMD = 4993, + BaryCoordNoPerspSampleAMD = 4994, + BaryCoordSmoothAMD = 4995, + BaryCoordSmoothCentroidAMD = 4996, + BaryCoordSmoothSampleAMD = 4997, + BaryCoordPullModelAMD = 4998, + FragStencilRefEXT = 5014, + ViewportMaskNV = 5253, + SecondaryPositionNV = 5257, + SecondaryViewportMaskNV = 5258, + PositionPerViewNV = 5261, + ViewportMaskPerViewNV = 5262, + Max = 0x7fffffff, +}; + +enum class SelectionControlShift : unsigned { + Flatten = 0, + DontFlatten = 1, + Max = 0x7fffffff, +}; + +enum class SelectionControlMask : unsigned { + MaskNone = 0, + Flatten = 0x00000001, + DontFlatten = 0x00000002, +}; + +enum class LoopControlShift : unsigned { + Unroll = 0, + DontUnroll = 1, + DependencyInfinite = 2, + DependencyLength = 3, + Max = 0x7fffffff, +}; + +enum class LoopControlMask : unsigned { + MaskNone = 0, + Unroll = 0x00000001, + DontUnroll = 0x00000002, + DependencyInfinite = 0x00000004, + DependencyLength = 0x00000008, +}; + +enum class FunctionControlShift : unsigned { + Inline = 0, + DontInline = 1, + Pure = 2, + Const = 3, + Max = 0x7fffffff, +}; + +enum class FunctionControlMask : unsigned { + MaskNone = 0, + Inline = 0x00000001, + DontInline = 0x00000002, + Pure = 0x00000004, + Const = 0x00000008, +}; + +enum class MemorySemanticsShift : unsigned { + Acquire = 1, + Release = 2, + AcquireRelease = 3, + SequentiallyConsistent = 4, + UniformMemory = 6, + SubgroupMemory = 7, + WorkgroupMemory = 8, + CrossWorkgroupMemory = 9, + AtomicCounterMemory = 10, + ImageMemory = 11, + Max = 0x7fffffff, +}; + +enum class MemorySemanticsMask : unsigned { + MaskNone = 0, + Acquire = 0x00000002, + Release = 0x00000004, + AcquireRelease = 0x00000008, + SequentiallyConsistent = 0x00000010, + UniformMemory = 0x00000040, + SubgroupMemory = 0x00000080, + WorkgroupMemory = 0x00000100, + CrossWorkgroupMemory = 0x00000200, + AtomicCounterMemory = 0x00000400, + ImageMemory = 0x00000800, +}; + +enum class MemoryAccessShift : unsigned { + Volatile = 0, + Aligned = 1, + Nontemporal = 2, + Max = 0x7fffffff, +}; + +enum class MemoryAccessMask : unsigned { + MaskNone = 0, + Volatile = 0x00000001, + Aligned = 0x00000002, + Nontemporal = 0x00000004, +}; + +enum class Scope : unsigned { + CrossDevice = 0, + Device = 1, + Workgroup = 2, + Subgroup = 3, + Invocation = 4, + Max = 0x7fffffff, +}; + +enum class GroupOperation : unsigned { + Reduce = 0, + InclusiveScan = 1, + ExclusiveScan = 2, + Max = 0x7fffffff, +}; + +enum class KernelEnqueueFlags : unsigned { + NoWait = 0, + WaitKernel = 1, + WaitWorkGroup = 2, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoShift : unsigned { + CmdExecTime = 0, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoMask : unsigned { + MaskNone = 0, + CmdExecTime = 0x00000001, +}; + +enum class Capability : unsigned { + Matrix = 0, + Shader = 1, + Geometry = 2, + Tessellation = 3, + Addresses = 4, + Linkage = 5, + Kernel = 6, + Vector16 = 7, + Float16Buffer = 8, + Float16 = 9, + Float64 = 10, + Int64 = 11, + Int64Atomics = 12, + ImageBasic = 13, + ImageReadWrite = 14, + ImageMipmap = 15, + Pipes = 17, + Groups = 18, + DeviceEnqueue = 19, + LiteralSampler = 20, + AtomicStorage = 21, + Int16 = 22, + TessellationPointSize = 23, + GeometryPointSize = 24, + ImageGatherExtended = 25, + StorageImageMultisample = 27, + UniformBufferArrayDynamicIndexing = 28, + SampledImageArrayDynamicIndexing = 29, + StorageBufferArrayDynamicIndexing = 30, + StorageImageArrayDynamicIndexing = 31, + ClipDistance = 32, + CullDistance = 33, + ImageCubeArray = 34, + SampleRateShading = 35, + ImageRect = 36, + SampledRect = 37, + GenericPointer = 38, + Int8 = 39, + InputAttachment = 40, + SparseResidency = 41, + MinLod = 42, + Sampled1D = 43, + Image1D = 44, + SampledCubeArray = 45, + SampledBuffer = 46, + ImageBuffer = 47, + ImageMSArray = 48, + StorageImageExtendedFormats = 49, + ImageQuery = 50, + DerivativeControl = 51, + InterpolationFunction = 52, + TransformFeedback = 53, + GeometryStreams = 54, + StorageImageReadWithoutFormat = 55, + StorageImageWriteWithoutFormat = 56, + MultiViewport = 57, + SubgroupDispatch = 58, + NamedBarrier = 59, + PipeStorage = 60, + SubgroupBallotKHR = 4423, + DrawParameters = 4427, + SubgroupVoteKHR = 4431, + StorageBuffer16BitAccess = 4433, + StorageUniformBufferBlock16 = 4433, + StorageUniform16 = 4434, + UniformAndStorageBuffer16BitAccess = 4434, + StoragePushConstant16 = 4435, + StorageInputOutput16 = 4436, + DeviceGroup = 4437, + MultiView = 4439, + VariablePointersStorageBuffer = 4441, + VariablePointers = 4442, + AtomicStorageOps = 4445, + SampleMaskPostDepthCoverage = 4447, + ImageGatherBiasLodAMD = 5009, + FragmentMaskAMD = 5010, + StencilExportEXT = 5013, + ImageReadWriteLodAMD = 5015, + SampleMaskOverrideCoverageNV = 5249, + GeometryShaderPassthroughNV = 5251, + ShaderViewportIndexLayerEXT = 5254, + ShaderViewportIndexLayerNV = 5254, + ShaderViewportMaskNV = 5255, + ShaderStereoViewNV = 5259, + PerViewAttributesNV = 5260, + SubgroupShuffleINTEL = 5568, + SubgroupBufferBlockIOINTEL = 5569, + SubgroupImageBlockIOINTEL = 5570, + Max = 0x7fffffff, +}; + +enum class Op : unsigned { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpExecutionModeId = 331, + OpDecorateId = 332, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpSubgroupReadInvocationKHR = 4432, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateStringGOOGLE = 5633, + Max = 0x7fffffff, +}; + +// Overload operator| for mask bit combining + +inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } + +} // end namespace spv + +#endif // #ifndef spirv_HPP + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.json 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1046 @@ +{ + "spv": + { + "meta": + { + "Comment": + [ + [ + "Copyright (c) 2014-2018 The Khronos Group Inc.", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and/or associated documentation files (the \"Materials\"),", + "to deal in the Materials without restriction, including without limitation", + "the rights to use, copy, modify, merge, publish, distribute, sublicense,", + "and/or sell copies of the Materials, and to permit persons to whom the", + "Materials are furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Materials.", + "", + "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", + "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", + "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", + "", + "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", + "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", + "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", + "IN THE MATERIALS." + ], + [ + "This header is automatically generated by the same tool that creates", + "the Binary Section of the SPIR-V specification." + ], + [ + "Enumeration tokens for SPIR-V, in various styles:", + " C, C++, C++11, JSON, Lua, Python", + "", + "- C will have tokens with a \"Spv\" prefix, e.g.: SpvSourceLanguageGLSL", + "- C++ will have tokens in the \"spv\" name space, e.g.: spv::SourceLanguageGLSL", + "- C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL", + "- Lua will use tables, e.g.: spv.SourceLanguage.GLSL", + "- Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']", + "", + "Some tokens act like mask values, which can be OR'd together,", + "while others are mutually exclusive. The mask-like ones have", + "\"Mask\" in their name, and a parallel enum that has the shift", + "amount (1 << x) for each corresponding enumerant." + ] + ], + "MagicNumber": 119734787, + "Version": 66048, + "Revision": 2, + "OpCodeMask": 65535, + "WordCountShift": 16 + }, + "enum": + [ + { + "Name": "SourceLanguage", + "Type": "Value", + "Values": + { + "Unknown": 0, + "ESSL": 1, + "GLSL": 2, + "OpenCL_C": 3, + "OpenCL_CPP": 4, + "HLSL": 5 + } + }, + { + "Name": "ExecutionModel", + "Type": "Value", + "Values": + { + "Vertex": 0, + "TessellationControl": 1, + "TessellationEvaluation": 2, + "Geometry": 3, + "Fragment": 4, + "GLCompute": 5, + "Kernel": 6 + } + }, + { + "Name": "AddressingModel", + "Type": "Value", + "Values": + { + "Logical": 0, + "Physical32": 1, + "Physical64": 2 + } + }, + { + "Name": "MemoryModel", + "Type": "Value", + "Values": + { + "Simple": 0, + "GLSL450": 1, + "OpenCL": 2 + } + }, + { + "Name": "ExecutionMode", + "Type": "Value", + "Values": + { + "Invocations": 0, + "SpacingEqual": 1, + "SpacingFractionalEven": 2, + "SpacingFractionalOdd": 3, + "VertexOrderCw": 4, + "VertexOrderCcw": 5, + "PixelCenterInteger": 6, + "OriginUpperLeft": 7, + "OriginLowerLeft": 8, + "EarlyFragmentTests": 9, + "PointMode": 10, + "Xfb": 11, + "DepthReplacing": 12, + "DepthGreater": 14, + "DepthLess": 15, + "DepthUnchanged": 16, + "LocalSize": 17, + "LocalSizeHint": 18, + "InputPoints": 19, + "InputLines": 20, + "InputLinesAdjacency": 21, + "Triangles": 22, + "InputTrianglesAdjacency": 23, + "Quads": 24, + "Isolines": 25, + "OutputVertices": 26, + "OutputPoints": 27, + "OutputLineStrip": 28, + "OutputTriangleStrip": 29, + "VecTypeHint": 30, + "ContractionOff": 31, + "Initializer": 33, + "Finalizer": 34, + "SubgroupSize": 35, + "SubgroupsPerWorkgroup": 36, + "SubgroupsPerWorkgroupId": 37, + "LocalSizeId": 38, + "LocalSizeHintId": 39, + "PostDepthCoverage": 4446, + "StencilRefReplacingEXT": 5027 + } + }, + { + "Name": "StorageClass", + "Type": "Value", + "Values": + { + "UniformConstant": 0, + "Input": 1, + "Uniform": 2, + "Output": 3, + "Workgroup": 4, + "CrossWorkgroup": 5, + "Private": 6, + "Function": 7, + "Generic": 8, + "PushConstant": 9, + "AtomicCounter": 10, + "Image": 11, + "StorageBuffer": 12 + } + }, + { + "Name": "Dim", + "Type": "Value", + "Values": + { + "Dim1D": 0, + "Dim2D": 1, + "Dim3D": 2, + "Cube": 3, + "Rect": 4, + "Buffer": 5, + "SubpassData": 6 + } + }, + { + "Name": "SamplerAddressingMode", + "Type": "Value", + "Values": + { + "None": 0, + "ClampToEdge": 1, + "Clamp": 2, + "Repeat": 3, + "RepeatMirrored": 4 + } + }, + { + "Name": "SamplerFilterMode", + "Type": "Value", + "Values": + { + "Nearest": 0, + "Linear": 1 + } + }, + { + "Name": "ImageFormat", + "Type": "Value", + "Values": + { + "Unknown": 0, + "Rgba32f": 1, + "Rgba16f": 2, + "R32f": 3, + "Rgba8": 4, + "Rgba8Snorm": 5, + "Rg32f": 6, + "Rg16f": 7, + "R11fG11fB10f": 8, + "R16f": 9, + "Rgba16": 10, + "Rgb10A2": 11, + "Rg16": 12, + "Rg8": 13, + "R16": 14, + "R8": 15, + "Rgba16Snorm": 16, + "Rg16Snorm": 17, + "Rg8Snorm": 18, + "R16Snorm": 19, + "R8Snorm": 20, + "Rgba32i": 21, + "Rgba16i": 22, + "Rgba8i": 23, + "R32i": 24, + "Rg32i": 25, + "Rg16i": 26, + "Rg8i": 27, + "R16i": 28, + "R8i": 29, + "Rgba32ui": 30, + "Rgba16ui": 31, + "Rgba8ui": 32, + "R32ui": 33, + "Rgb10a2ui": 34, + "Rg32ui": 35, + "Rg16ui": 36, + "Rg8ui": 37, + "R16ui": 38, + "R8ui": 39 + } + }, + { + "Name": "ImageChannelOrder", + "Type": "Value", + "Values": + { + "R": 0, + "A": 1, + "RG": 2, + "RA": 3, + "RGB": 4, + "RGBA": 5, + "BGRA": 6, + "ARGB": 7, + "Intensity": 8, + "Luminance": 9, + "Rx": 10, + "RGx": 11, + "RGBx": 12, + "Depth": 13, + "DepthStencil": 14, + "sRGB": 15, + "sRGBx": 16, + "sRGBA": 17, + "sBGRA": 18, + "ABGR": 19 + } + }, + { + "Name": "ImageChannelDataType", + "Type": "Value", + "Values": + { + "SnormInt8": 0, + "SnormInt16": 1, + "UnormInt8": 2, + "UnormInt16": 3, + "UnormShort565": 4, + "UnormShort555": 5, + "UnormInt101010": 6, + "SignedInt8": 7, + "SignedInt16": 8, + "SignedInt32": 9, + "UnsignedInt8": 10, + "UnsignedInt16": 11, + "UnsignedInt32": 12, + "HalfFloat": 13, + "Float": 14, + "UnormInt24": 15, + "UnormInt101010_2": 16 + } + }, + { + "Name": "ImageOperands", + "Type": "Bit", + "Values": + { + "Bias": 0, + "Lod": 1, + "Grad": 2, + "ConstOffset": 3, + "Offset": 4, + "ConstOffsets": 5, + "Sample": 6, + "MinLod": 7 + } + }, + { + "Name": "FPFastMathMode", + "Type": "Bit", + "Values": + { + "NotNaN": 0, + "NotInf": 1, + "NSZ": 2, + "AllowRecip": 3, + "Fast": 4 + } + }, + { + "Name": "FPRoundingMode", + "Type": "Value", + "Values": + { + "RTE": 0, + "RTZ": 1, + "RTP": 2, + "RTN": 3 + } + }, + { + "Name": "LinkageType", + "Type": "Value", + "Values": + { + "Export": 0, + "Import": 1 + } + }, + { + "Name": "AccessQualifier", + "Type": "Value", + "Values": + { + "ReadOnly": 0, + "WriteOnly": 1, + "ReadWrite": 2 + } + }, + { + "Name": "FunctionParameterAttribute", + "Type": "Value", + "Values": + { + "Zext": 0, + "Sext": 1, + "ByVal": 2, + "Sret": 3, + "NoAlias": 4, + "NoCapture": 5, + "NoWrite": 6, + "NoReadWrite": 7 + } + }, + { + "Name": "Decoration", + "Type": "Value", + "Values": + { + "RelaxedPrecision": 0, + "SpecId": 1, + "Block": 2, + "BufferBlock": 3, + "RowMajor": 4, + "ColMajor": 5, + "ArrayStride": 6, + "MatrixStride": 7, + "GLSLShared": 8, + "GLSLPacked": 9, + "CPacked": 10, + "BuiltIn": 11, + "NoPerspective": 13, + "Flat": 14, + "Patch": 15, + "Centroid": 16, + "Sample": 17, + "Invariant": 18, + "Restrict": 19, + "Aliased": 20, + "Volatile": 21, + "Constant": 22, + "Coherent": 23, + "NonWritable": 24, + "NonReadable": 25, + "Uniform": 26, + "SaturatedConversion": 28, + "Stream": 29, + "Location": 30, + "Component": 31, + "Index": 32, + "Binding": 33, + "DescriptorSet": 34, + "Offset": 35, + "XfbBuffer": 36, + "XfbStride": 37, + "FuncParamAttr": 38, + "FPRoundingMode": 39, + "FPFastMathMode": 40, + "LinkageAttributes": 41, + "NoContraction": 42, + "InputAttachmentIndex": 43, + "Alignment": 44, + "MaxByteOffset": 45, + "AlignmentId": 46, + "MaxByteOffsetId": 47, + "ExplicitInterpAMD": 4999, + "OverrideCoverageNV": 5248, + "PassthroughNV": 5250, + "ViewportRelativeNV": 5252, + "SecondaryViewportRelativeNV": 5256, + "HlslCounterBufferGOOGLE": 5634, + "HlslSemanticGOOGLE": 5635 + } + }, + { + "Name": "BuiltIn", + "Type": "Value", + "Values": + { + "Position": 0, + "PointSize": 1, + "ClipDistance": 3, + "CullDistance": 4, + "VertexId": 5, + "InstanceId": 6, + "PrimitiveId": 7, + "InvocationId": 8, + "Layer": 9, + "ViewportIndex": 10, + "TessLevelOuter": 11, + "TessLevelInner": 12, + "TessCoord": 13, + "PatchVertices": 14, + "FragCoord": 15, + "PointCoord": 16, + "FrontFacing": 17, + "SampleId": 18, + "SamplePosition": 19, + "SampleMask": 20, + "FragDepth": 22, + "HelperInvocation": 23, + "NumWorkgroups": 24, + "WorkgroupSize": 25, + "WorkgroupId": 26, + "LocalInvocationId": 27, + "GlobalInvocationId": 28, + "LocalInvocationIndex": 29, + "WorkDim": 30, + "GlobalSize": 31, + "EnqueuedWorkgroupSize": 32, + "GlobalOffset": 33, + "GlobalLinearId": 34, + "SubgroupSize": 36, + "SubgroupMaxSize": 37, + "NumSubgroups": 38, + "NumEnqueuedSubgroups": 39, + "SubgroupId": 40, + "SubgroupLocalInvocationId": 41, + "VertexIndex": 42, + "InstanceIndex": 43, + "SubgroupEqMaskKHR": 4416, + "SubgroupGeMaskKHR": 4417, + "SubgroupGtMaskKHR": 4418, + "SubgroupLeMaskKHR": 4419, + "SubgroupLtMaskKHR": 4420, + "BaseVertex": 4424, + "BaseInstance": 4425, + "DrawIndex": 4426, + "DeviceIndex": 4438, + "ViewIndex": 4440, + "BaryCoordNoPerspAMD": 4992, + "BaryCoordNoPerspCentroidAMD": 4993, + "BaryCoordNoPerspSampleAMD": 4994, + "BaryCoordSmoothAMD": 4995, + "BaryCoordSmoothCentroidAMD": 4996, + "BaryCoordSmoothSampleAMD": 4997, + "BaryCoordPullModelAMD": 4998, + "FragStencilRefEXT": 5014, + "ViewportMaskNV": 5253, + "SecondaryPositionNV": 5257, + "SecondaryViewportMaskNV": 5258, + "PositionPerViewNV": 5261, + "ViewportMaskPerViewNV": 5262 + } + }, + { + "Name": "SelectionControl", + "Type": "Bit", + "Values": + { + "Flatten": 0, + "DontFlatten": 1 + } + }, + { + "Name": "LoopControl", + "Type": "Bit", + "Values": + { + "Unroll": 0, + "DontUnroll": 1, + "DependencyInfinite": 2, + "DependencyLength": 3 + } + }, + { + "Name": "FunctionControl", + "Type": "Bit", + "Values": + { + "Inline": 0, + "DontInline": 1, + "Pure": 2, + "Const": 3 + } + }, + { + "Name": "MemorySemantics", + "Type": "Bit", + "Values": + { + "Acquire": 1, + "Release": 2, + "AcquireRelease": 3, + "SequentiallyConsistent": 4, + "UniformMemory": 6, + "SubgroupMemory": 7, + "WorkgroupMemory": 8, + "CrossWorkgroupMemory": 9, + "AtomicCounterMemory": 10, + "ImageMemory": 11 + } + }, + { + "Name": "MemoryAccess", + "Type": "Bit", + "Values": + { + "Volatile": 0, + "Aligned": 1, + "Nontemporal": 2 + } + }, + { + "Name": "Scope", + "Type": "Value", + "Values": + { + "CrossDevice": 0, + "Device": 1, + "Workgroup": 2, + "Subgroup": 3, + "Invocation": 4 + } + }, + { + "Name": "GroupOperation", + "Type": "Value", + "Values": + { + "Reduce": 0, + "InclusiveScan": 1, + "ExclusiveScan": 2 + } + }, + { + "Name": "KernelEnqueueFlags", + "Type": "Value", + "Values": + { + "NoWait": 0, + "WaitKernel": 1, + "WaitWorkGroup": 2 + } + }, + { + "Name": "KernelProfilingInfo", + "Type": "Bit", + "Values": + { + "CmdExecTime": 0 + } + }, + { + "Name": "Capability", + "Type": "Value", + "Values": + { + "Matrix": 0, + "Shader": 1, + "Geometry": 2, + "Tessellation": 3, + "Addresses": 4, + "Linkage": 5, + "Kernel": 6, + "Vector16": 7, + "Float16Buffer": 8, + "Float16": 9, + "Float64": 10, + "Int64": 11, + "Int64Atomics": 12, + "ImageBasic": 13, + "ImageReadWrite": 14, + "ImageMipmap": 15, + "Pipes": 17, + "Groups": 18, + "DeviceEnqueue": 19, + "LiteralSampler": 20, + "AtomicStorage": 21, + "Int16": 22, + "TessellationPointSize": 23, + "GeometryPointSize": 24, + "ImageGatherExtended": 25, + "StorageImageMultisample": 27, + "UniformBufferArrayDynamicIndexing": 28, + "SampledImageArrayDynamicIndexing": 29, + "StorageBufferArrayDynamicIndexing": 30, + "StorageImageArrayDynamicIndexing": 31, + "ClipDistance": 32, + "CullDistance": 33, + "ImageCubeArray": 34, + "SampleRateShading": 35, + "ImageRect": 36, + "SampledRect": 37, + "GenericPointer": 38, + "Int8": 39, + "InputAttachment": 40, + "SparseResidency": 41, + "MinLod": 42, + "Sampled1D": 43, + "Image1D": 44, + "SampledCubeArray": 45, + "SampledBuffer": 46, + "ImageBuffer": 47, + "ImageMSArray": 48, + "StorageImageExtendedFormats": 49, + "ImageQuery": 50, + "DerivativeControl": 51, + "InterpolationFunction": 52, + "TransformFeedback": 53, + "GeometryStreams": 54, + "StorageImageReadWithoutFormat": 55, + "StorageImageWriteWithoutFormat": 56, + "MultiViewport": 57, + "SubgroupDispatch": 58, + "NamedBarrier": 59, + "PipeStorage": 60, + "SubgroupBallotKHR": 4423, + "DrawParameters": 4427, + "SubgroupVoteKHR": 4431, + "StorageBuffer16BitAccess": 4433, + "StorageUniformBufferBlock16": 4433, + "StorageUniform16": 4434, + "UniformAndStorageBuffer16BitAccess": 4434, + "StoragePushConstant16": 4435, + "StorageInputOutput16": 4436, + "DeviceGroup": 4437, + "MultiView": 4439, + "VariablePointersStorageBuffer": 4441, + "VariablePointers": 4442, + "AtomicStorageOps": 4445, + "SampleMaskPostDepthCoverage": 4447, + "ImageGatherBiasLodAMD": 5009, + "FragmentMaskAMD": 5010, + "StencilExportEXT": 5013, + "ImageReadWriteLodAMD": 5015, + "SampleMaskOverrideCoverageNV": 5249, + "GeometryShaderPassthroughNV": 5251, + "ShaderViewportIndexLayerEXT": 5254, + "ShaderViewportIndexLayerNV": 5254, + "ShaderViewportMaskNV": 5255, + "ShaderStereoViewNV": 5259, + "PerViewAttributesNV": 5260, + "SubgroupShuffleINTEL": 5568, + "SubgroupBufferBlockIOINTEL": 5569, + "SubgroupImageBlockIOINTEL": 5570 + } + }, + { + "Name": "Op", + "Type": "Value", + "Values": + { + "OpNop": 0, + "OpUndef": 1, + "OpSourceContinued": 2, + "OpSource": 3, + "OpSourceExtension": 4, + "OpName": 5, + "OpMemberName": 6, + "OpString": 7, + "OpLine": 8, + "OpExtension": 10, + "OpExtInstImport": 11, + "OpExtInst": 12, + "OpMemoryModel": 14, + "OpEntryPoint": 15, + "OpExecutionMode": 16, + "OpCapability": 17, + "OpTypeVoid": 19, + "OpTypeBool": 20, + "OpTypeInt": 21, + "OpTypeFloat": 22, + "OpTypeVector": 23, + "OpTypeMatrix": 24, + "OpTypeImage": 25, + "OpTypeSampler": 26, + "OpTypeSampledImage": 27, + "OpTypeArray": 28, + "OpTypeRuntimeArray": 29, + "OpTypeStruct": 30, + "OpTypeOpaque": 31, + "OpTypePointer": 32, + "OpTypeFunction": 33, + "OpTypeEvent": 34, + "OpTypeDeviceEvent": 35, + "OpTypeReserveId": 36, + "OpTypeQueue": 37, + "OpTypePipe": 38, + "OpTypeForwardPointer": 39, + "OpConstantTrue": 41, + "OpConstantFalse": 42, + "OpConstant": 43, + "OpConstantComposite": 44, + "OpConstantSampler": 45, + "OpConstantNull": 46, + "OpSpecConstantTrue": 48, + "OpSpecConstantFalse": 49, + "OpSpecConstant": 50, + "OpSpecConstantComposite": 51, + "OpSpecConstantOp": 52, + "OpFunction": 54, + "OpFunctionParameter": 55, + "OpFunctionEnd": 56, + "OpFunctionCall": 57, + "OpVariable": 59, + "OpImageTexelPointer": 60, + "OpLoad": 61, + "OpStore": 62, + "OpCopyMemory": 63, + "OpCopyMemorySized": 64, + "OpAccessChain": 65, + "OpInBoundsAccessChain": 66, + "OpPtrAccessChain": 67, + "OpArrayLength": 68, + "OpGenericPtrMemSemantics": 69, + "OpInBoundsPtrAccessChain": 70, + "OpDecorate": 71, + "OpMemberDecorate": 72, + "OpDecorationGroup": 73, + "OpGroupDecorate": 74, + "OpGroupMemberDecorate": 75, + "OpVectorExtractDynamic": 77, + "OpVectorInsertDynamic": 78, + "OpVectorShuffle": 79, + "OpCompositeConstruct": 80, + "OpCompositeExtract": 81, + "OpCompositeInsert": 82, + "OpCopyObject": 83, + "OpTranspose": 84, + "OpSampledImage": 86, + "OpImageSampleImplicitLod": 87, + "OpImageSampleExplicitLod": 88, + "OpImageSampleDrefImplicitLod": 89, + "OpImageSampleDrefExplicitLod": 90, + "OpImageSampleProjImplicitLod": 91, + "OpImageSampleProjExplicitLod": 92, + "OpImageSampleProjDrefImplicitLod": 93, + "OpImageSampleProjDrefExplicitLod": 94, + "OpImageFetch": 95, + "OpImageGather": 96, + "OpImageDrefGather": 97, + "OpImageRead": 98, + "OpImageWrite": 99, + "OpImage": 100, + "OpImageQueryFormat": 101, + "OpImageQueryOrder": 102, + "OpImageQuerySizeLod": 103, + "OpImageQuerySize": 104, + "OpImageQueryLod": 105, + "OpImageQueryLevels": 106, + "OpImageQuerySamples": 107, + "OpConvertFToU": 109, + "OpConvertFToS": 110, + "OpConvertSToF": 111, + "OpConvertUToF": 112, + "OpUConvert": 113, + "OpSConvert": 114, + "OpFConvert": 115, + "OpQuantizeToF16": 116, + "OpConvertPtrToU": 117, + "OpSatConvertSToU": 118, + "OpSatConvertUToS": 119, + "OpConvertUToPtr": 120, + "OpPtrCastToGeneric": 121, + "OpGenericCastToPtr": 122, + "OpGenericCastToPtrExplicit": 123, + "OpBitcast": 124, + "OpSNegate": 126, + "OpFNegate": 127, + "OpIAdd": 128, + "OpFAdd": 129, + "OpISub": 130, + "OpFSub": 131, + "OpIMul": 132, + "OpFMul": 133, + "OpUDiv": 134, + "OpSDiv": 135, + "OpFDiv": 136, + "OpUMod": 137, + "OpSRem": 138, + "OpSMod": 139, + "OpFRem": 140, + "OpFMod": 141, + "OpVectorTimesScalar": 142, + "OpMatrixTimesScalar": 143, + "OpVectorTimesMatrix": 144, + "OpMatrixTimesVector": 145, + "OpMatrixTimesMatrix": 146, + "OpOuterProduct": 147, + "OpDot": 148, + "OpIAddCarry": 149, + "OpISubBorrow": 150, + "OpUMulExtended": 151, + "OpSMulExtended": 152, + "OpAny": 154, + "OpAll": 155, + "OpIsNan": 156, + "OpIsInf": 157, + "OpIsFinite": 158, + "OpIsNormal": 159, + "OpSignBitSet": 160, + "OpLessOrGreater": 161, + "OpOrdered": 162, + "OpUnordered": 163, + "OpLogicalEqual": 164, + "OpLogicalNotEqual": 165, + "OpLogicalOr": 166, + "OpLogicalAnd": 167, + "OpLogicalNot": 168, + "OpSelect": 169, + "OpIEqual": 170, + "OpINotEqual": 171, + "OpUGreaterThan": 172, + "OpSGreaterThan": 173, + "OpUGreaterThanEqual": 174, + "OpSGreaterThanEqual": 175, + "OpULessThan": 176, + "OpSLessThan": 177, + "OpULessThanEqual": 178, + "OpSLessThanEqual": 179, + "OpFOrdEqual": 180, + "OpFUnordEqual": 181, + "OpFOrdNotEqual": 182, + "OpFUnordNotEqual": 183, + "OpFOrdLessThan": 184, + "OpFUnordLessThan": 185, + "OpFOrdGreaterThan": 186, + "OpFUnordGreaterThan": 187, + "OpFOrdLessThanEqual": 188, + "OpFUnordLessThanEqual": 189, + "OpFOrdGreaterThanEqual": 190, + "OpFUnordGreaterThanEqual": 191, + "OpShiftRightLogical": 194, + "OpShiftRightArithmetic": 195, + "OpShiftLeftLogical": 196, + "OpBitwiseOr": 197, + "OpBitwiseXor": 198, + "OpBitwiseAnd": 199, + "OpNot": 200, + "OpBitFieldInsert": 201, + "OpBitFieldSExtract": 202, + "OpBitFieldUExtract": 203, + "OpBitReverse": 204, + "OpBitCount": 205, + "OpDPdx": 207, + "OpDPdy": 208, + "OpFwidth": 209, + "OpDPdxFine": 210, + "OpDPdyFine": 211, + "OpFwidthFine": 212, + "OpDPdxCoarse": 213, + "OpDPdyCoarse": 214, + "OpFwidthCoarse": 215, + "OpEmitVertex": 218, + "OpEndPrimitive": 219, + "OpEmitStreamVertex": 220, + "OpEndStreamPrimitive": 221, + "OpControlBarrier": 224, + "OpMemoryBarrier": 225, + "OpAtomicLoad": 227, + "OpAtomicStore": 228, + "OpAtomicExchange": 229, + "OpAtomicCompareExchange": 230, + "OpAtomicCompareExchangeWeak": 231, + "OpAtomicIIncrement": 232, + "OpAtomicIDecrement": 233, + "OpAtomicIAdd": 234, + "OpAtomicISub": 235, + "OpAtomicSMin": 236, + "OpAtomicUMin": 237, + "OpAtomicSMax": 238, + "OpAtomicUMax": 239, + "OpAtomicAnd": 240, + "OpAtomicOr": 241, + "OpAtomicXor": 242, + "OpPhi": 245, + "OpLoopMerge": 246, + "OpSelectionMerge": 247, + "OpLabel": 248, + "OpBranch": 249, + "OpBranchConditional": 250, + "OpSwitch": 251, + "OpKill": 252, + "OpReturn": 253, + "OpReturnValue": 254, + "OpUnreachable": 255, + "OpLifetimeStart": 256, + "OpLifetimeStop": 257, + "OpGroupAsyncCopy": 259, + "OpGroupWaitEvents": 260, + "OpGroupAll": 261, + "OpGroupAny": 262, + "OpGroupBroadcast": 263, + "OpGroupIAdd": 264, + "OpGroupFAdd": 265, + "OpGroupFMin": 266, + "OpGroupUMin": 267, + "OpGroupSMin": 268, + "OpGroupFMax": 269, + "OpGroupUMax": 270, + "OpGroupSMax": 271, + "OpReadPipe": 274, + "OpWritePipe": 275, + "OpReservedReadPipe": 276, + "OpReservedWritePipe": 277, + "OpReserveReadPipePackets": 278, + "OpReserveWritePipePackets": 279, + "OpCommitReadPipe": 280, + "OpCommitWritePipe": 281, + "OpIsValidReserveId": 282, + "OpGetNumPipePackets": 283, + "OpGetMaxPipePackets": 284, + "OpGroupReserveReadPipePackets": 285, + "OpGroupReserveWritePipePackets": 286, + "OpGroupCommitReadPipe": 287, + "OpGroupCommitWritePipe": 288, + "OpEnqueueMarker": 291, + "OpEnqueueKernel": 292, + "OpGetKernelNDrangeSubGroupCount": 293, + "OpGetKernelNDrangeMaxSubGroupSize": 294, + "OpGetKernelWorkGroupSize": 295, + "OpGetKernelPreferredWorkGroupSizeMultiple": 296, + "OpRetainEvent": 297, + "OpReleaseEvent": 298, + "OpCreateUserEvent": 299, + "OpIsValidEvent": 300, + "OpSetUserEventStatus": 301, + "OpCaptureEventProfilingInfo": 302, + "OpGetDefaultQueue": 303, + "OpBuildNDRange": 304, + "OpImageSparseSampleImplicitLod": 305, + "OpImageSparseSampleExplicitLod": 306, + "OpImageSparseSampleDrefImplicitLod": 307, + "OpImageSparseSampleDrefExplicitLod": 308, + "OpImageSparseSampleProjImplicitLod": 309, + "OpImageSparseSampleProjExplicitLod": 310, + "OpImageSparseSampleProjDrefImplicitLod": 311, + "OpImageSparseSampleProjDrefExplicitLod": 312, + "OpImageSparseFetch": 313, + "OpImageSparseGather": 314, + "OpImageSparseDrefGather": 315, + "OpImageSparseTexelsResident": 316, + "OpNoLine": 317, + "OpAtomicFlagTestAndSet": 318, + "OpAtomicFlagClear": 319, + "OpImageSparseRead": 320, + "OpSizeOf": 321, + "OpTypePipeStorage": 322, + "OpConstantPipeStorage": 323, + "OpCreatePipeFromPipeStorage": 324, + "OpGetKernelLocalSizeForSubgroupCount": 325, + "OpGetKernelMaxNumSubgroups": 326, + "OpTypeNamedBarrier": 327, + "OpNamedBarrierInitialize": 328, + "OpMemoryNamedBarrier": 329, + "OpModuleProcessed": 330, + "OpExecutionModeId": 331, + "OpDecorateId": 332, + "OpSubgroupBallotKHR": 4421, + "OpSubgroupFirstInvocationKHR": 4422, + "OpSubgroupAllKHR": 4428, + "OpSubgroupAnyKHR": 4429, + "OpSubgroupAllEqualKHR": 4430, + "OpSubgroupReadInvocationKHR": 4432, + "OpGroupIAddNonUniformAMD": 5000, + "OpGroupFAddNonUniformAMD": 5001, + "OpGroupFMinNonUniformAMD": 5002, + "OpGroupUMinNonUniformAMD": 5003, + "OpGroupSMinNonUniformAMD": 5004, + "OpGroupFMaxNonUniformAMD": 5005, + "OpGroupUMaxNonUniformAMD": 5006, + "OpGroupSMaxNonUniformAMD": 5007, + "OpFragmentMaskFetchAMD": 5011, + "OpFragmentFetchAMD": 5012, + "OpSubgroupShuffleINTEL": 5571, + "OpSubgroupShuffleDownINTEL": 5572, + "OpSubgroupShuffleUpINTEL": 5573, + "OpSubgroupShuffleXorINTEL": 5574, + "OpSubgroupBlockReadINTEL": 5575, + "OpSubgroupBlockWriteINTEL": 5576, + "OpSubgroupImageBlockReadINTEL": 5577, + "OpSubgroupImageBlockWriteINTEL": 5578, + "OpDecorateStringGOOGLE": 5632, + "OpMemberDecorateStringGOOGLE": 5633 + } + } + ] + } +} + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.lua vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.lua --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.lua 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.lua 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,977 @@ +-- Copyright (c) 2014-2018 The Khronos Group Inc. +-- +-- Permission is hereby granted, free of charge, to any person obtaining a copy +-- of this software and/or associated documentation files (the "Materials"), +-- to deal in the Materials without restriction, including without limitation +-- the rights to use, copy, modify, merge, publish, distribute, sublicense, +-- and/or sell copies of the Materials, and to permit persons to whom the +-- Materials are furnished to do so, subject to the following conditions: +-- +-- The above copyright notice and this permission notice shall be included in +-- all copies or substantial portions of the Materials. +-- +-- MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +-- STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +-- HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +-- +-- THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +-- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +-- FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +-- IN THE MATERIALS. + +-- This header is automatically generated by the same tool that creates +-- the Binary Section of the SPIR-V specification. + +-- Enumeration tokens for SPIR-V, in various styles: +-- C, C++, C++11, JSON, Lua, Python +-- +-- - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +-- - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +-- - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +-- - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +-- - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +-- +-- Some tokens act like mask values, which can be OR'd together, +-- while others are mutually exclusive. The mask-like ones have +-- "Mask" in their name, and a parallel enum that has the shift +-- amount (1 << x) for each corresponding enumerant. + +spv = { + MagicNumber = 0x07230203, + Version = 0x00010200, + Revision = 2, + OpCodeMask = 0xffff, + WordCountShift = 16, + + SourceLanguage = { + Unknown = 0, + ESSL = 1, + GLSL = 2, + OpenCL_C = 3, + OpenCL_CPP = 4, + HLSL = 5, + }, + + ExecutionModel = { + Vertex = 0, + TessellationControl = 1, + TessellationEvaluation = 2, + Geometry = 3, + Fragment = 4, + GLCompute = 5, + Kernel = 6, + }, + + AddressingModel = { + Logical = 0, + Physical32 = 1, + Physical64 = 2, + }, + + MemoryModel = { + Simple = 0, + GLSL450 = 1, + OpenCL = 2, + }, + + ExecutionMode = { + Invocations = 0, + SpacingEqual = 1, + SpacingFractionalEven = 2, + SpacingFractionalOdd = 3, + VertexOrderCw = 4, + VertexOrderCcw = 5, + PixelCenterInteger = 6, + OriginUpperLeft = 7, + OriginLowerLeft = 8, + EarlyFragmentTests = 9, + PointMode = 10, + Xfb = 11, + DepthReplacing = 12, + DepthGreater = 14, + DepthLess = 15, + DepthUnchanged = 16, + LocalSize = 17, + LocalSizeHint = 18, + InputPoints = 19, + InputLines = 20, + InputLinesAdjacency = 21, + Triangles = 22, + InputTrianglesAdjacency = 23, + Quads = 24, + Isolines = 25, + OutputVertices = 26, + OutputPoints = 27, + OutputLineStrip = 28, + OutputTriangleStrip = 29, + VecTypeHint = 30, + ContractionOff = 31, + Initializer = 33, + Finalizer = 34, + SubgroupSize = 35, + SubgroupsPerWorkgroup = 36, + SubgroupsPerWorkgroupId = 37, + LocalSizeId = 38, + LocalSizeHintId = 39, + PostDepthCoverage = 4446, + StencilRefReplacingEXT = 5027, + }, + + StorageClass = { + UniformConstant = 0, + Input = 1, + Uniform = 2, + Output = 3, + Workgroup = 4, + CrossWorkgroup = 5, + Private = 6, + Function = 7, + Generic = 8, + PushConstant = 9, + AtomicCounter = 10, + Image = 11, + StorageBuffer = 12, + }, + + Dim = { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + Cube = 3, + Rect = 4, + Buffer = 5, + SubpassData = 6, + }, + + SamplerAddressingMode = { + None = 0, + ClampToEdge = 1, + Clamp = 2, + Repeat = 3, + RepeatMirrored = 4, + }, + + SamplerFilterMode = { + Nearest = 0, + Linear = 1, + }, + + ImageFormat = { + Unknown = 0, + Rgba32f = 1, + Rgba16f = 2, + R32f = 3, + Rgba8 = 4, + Rgba8Snorm = 5, + Rg32f = 6, + Rg16f = 7, + R11fG11fB10f = 8, + R16f = 9, + Rgba16 = 10, + Rgb10A2 = 11, + Rg16 = 12, + Rg8 = 13, + R16 = 14, + R8 = 15, + Rgba16Snorm = 16, + Rg16Snorm = 17, + Rg8Snorm = 18, + R16Snorm = 19, + R8Snorm = 20, + Rgba32i = 21, + Rgba16i = 22, + Rgba8i = 23, + R32i = 24, + Rg32i = 25, + Rg16i = 26, + Rg8i = 27, + R16i = 28, + R8i = 29, + Rgba32ui = 30, + Rgba16ui = 31, + Rgba8ui = 32, + R32ui = 33, + Rgb10a2ui = 34, + Rg32ui = 35, + Rg16ui = 36, + Rg8ui = 37, + R16ui = 38, + R8ui = 39, + }, + + ImageChannelOrder = { + R = 0, + A = 1, + RG = 2, + RA = 3, + RGB = 4, + RGBA = 5, + BGRA = 6, + ARGB = 7, + Intensity = 8, + Luminance = 9, + Rx = 10, + RGx = 11, + RGBx = 12, + Depth = 13, + DepthStencil = 14, + sRGB = 15, + sRGBx = 16, + sRGBA = 17, + sBGRA = 18, + ABGR = 19, + }, + + ImageChannelDataType = { + SnormInt8 = 0, + SnormInt16 = 1, + UnormInt8 = 2, + UnormInt16 = 3, + UnormShort565 = 4, + UnormShort555 = 5, + UnormInt101010 = 6, + SignedInt8 = 7, + SignedInt16 = 8, + SignedInt32 = 9, + UnsignedInt8 = 10, + UnsignedInt16 = 11, + UnsignedInt32 = 12, + HalfFloat = 13, + Float = 14, + UnormInt24 = 15, + UnormInt101010_2 = 16, + }, + + ImageOperandsShift = { + Bias = 0, + Lod = 1, + Grad = 2, + ConstOffset = 3, + Offset = 4, + ConstOffsets = 5, + Sample = 6, + MinLod = 7, + }, + + ImageOperandsMask = { + MaskNone = 0, + Bias = 0x00000001, + Lod = 0x00000002, + Grad = 0x00000004, + ConstOffset = 0x00000008, + Offset = 0x00000010, + ConstOffsets = 0x00000020, + Sample = 0x00000040, + MinLod = 0x00000080, + }, + + FPFastMathModeShift = { + NotNaN = 0, + NotInf = 1, + NSZ = 2, + AllowRecip = 3, + Fast = 4, + }, + + FPFastMathModeMask = { + MaskNone = 0, + NotNaN = 0x00000001, + NotInf = 0x00000002, + NSZ = 0x00000004, + AllowRecip = 0x00000008, + Fast = 0x00000010, + }, + + FPRoundingMode = { + RTE = 0, + RTZ = 1, + RTP = 2, + RTN = 3, + }, + + LinkageType = { + Export = 0, + Import = 1, + }, + + AccessQualifier = { + ReadOnly = 0, + WriteOnly = 1, + ReadWrite = 2, + }, + + FunctionParameterAttribute = { + Zext = 0, + Sext = 1, + ByVal = 2, + Sret = 3, + NoAlias = 4, + NoCapture = 5, + NoWrite = 6, + NoReadWrite = 7, + }, + + Decoration = { + RelaxedPrecision = 0, + SpecId = 1, + Block = 2, + BufferBlock = 3, + RowMajor = 4, + ColMajor = 5, + ArrayStride = 6, + MatrixStride = 7, + GLSLShared = 8, + GLSLPacked = 9, + CPacked = 10, + BuiltIn = 11, + NoPerspective = 13, + Flat = 14, + Patch = 15, + Centroid = 16, + Sample = 17, + Invariant = 18, + Restrict = 19, + Aliased = 20, + Volatile = 21, + Constant = 22, + Coherent = 23, + NonWritable = 24, + NonReadable = 25, + Uniform = 26, + SaturatedConversion = 28, + Stream = 29, + Location = 30, + Component = 31, + Index = 32, + Binding = 33, + DescriptorSet = 34, + Offset = 35, + XfbBuffer = 36, + XfbStride = 37, + FuncParamAttr = 38, + FPRoundingMode = 39, + FPFastMathMode = 40, + LinkageAttributes = 41, + NoContraction = 42, + InputAttachmentIndex = 43, + Alignment = 44, + MaxByteOffset = 45, + AlignmentId = 46, + MaxByteOffsetId = 47, + ExplicitInterpAMD = 4999, + OverrideCoverageNV = 5248, + PassthroughNV = 5250, + ViewportRelativeNV = 5252, + SecondaryViewportRelativeNV = 5256, + HlslCounterBufferGOOGLE = 5634, + HlslSemanticGOOGLE = 5635, + }, + + BuiltIn = { + Position = 0, + PointSize = 1, + ClipDistance = 3, + CullDistance = 4, + VertexId = 5, + InstanceId = 6, + PrimitiveId = 7, + InvocationId = 8, + Layer = 9, + ViewportIndex = 10, + TessLevelOuter = 11, + TessLevelInner = 12, + TessCoord = 13, + PatchVertices = 14, + FragCoord = 15, + PointCoord = 16, + FrontFacing = 17, + SampleId = 18, + SamplePosition = 19, + SampleMask = 20, + FragDepth = 22, + HelperInvocation = 23, + NumWorkgroups = 24, + WorkgroupSize = 25, + WorkgroupId = 26, + LocalInvocationId = 27, + GlobalInvocationId = 28, + LocalInvocationIndex = 29, + WorkDim = 30, + GlobalSize = 31, + EnqueuedWorkgroupSize = 32, + GlobalOffset = 33, + GlobalLinearId = 34, + SubgroupSize = 36, + SubgroupMaxSize = 37, + NumSubgroups = 38, + NumEnqueuedSubgroups = 39, + SubgroupId = 40, + SubgroupLocalInvocationId = 41, + VertexIndex = 42, + InstanceIndex = 43, + SubgroupEqMaskKHR = 4416, + SubgroupGeMaskKHR = 4417, + SubgroupGtMaskKHR = 4418, + SubgroupLeMaskKHR = 4419, + SubgroupLtMaskKHR = 4420, + BaseVertex = 4424, + BaseInstance = 4425, + DrawIndex = 4426, + DeviceIndex = 4438, + ViewIndex = 4440, + BaryCoordNoPerspAMD = 4992, + BaryCoordNoPerspCentroidAMD = 4993, + BaryCoordNoPerspSampleAMD = 4994, + BaryCoordSmoothAMD = 4995, + BaryCoordSmoothCentroidAMD = 4996, + BaryCoordSmoothSampleAMD = 4997, + BaryCoordPullModelAMD = 4998, + FragStencilRefEXT = 5014, + ViewportMaskNV = 5253, + SecondaryPositionNV = 5257, + SecondaryViewportMaskNV = 5258, + PositionPerViewNV = 5261, + ViewportMaskPerViewNV = 5262, + }, + + SelectionControlShift = { + Flatten = 0, + DontFlatten = 1, + }, + + SelectionControlMask = { + MaskNone = 0, + Flatten = 0x00000001, + DontFlatten = 0x00000002, + }, + + LoopControlShift = { + Unroll = 0, + DontUnroll = 1, + DependencyInfinite = 2, + DependencyLength = 3, + }, + + LoopControlMask = { + MaskNone = 0, + Unroll = 0x00000001, + DontUnroll = 0x00000002, + DependencyInfinite = 0x00000004, + DependencyLength = 0x00000008, + }, + + FunctionControlShift = { + Inline = 0, + DontInline = 1, + Pure = 2, + Const = 3, + }, + + FunctionControlMask = { + MaskNone = 0, + Inline = 0x00000001, + DontInline = 0x00000002, + Pure = 0x00000004, + Const = 0x00000008, + }, + + MemorySemanticsShift = { + Acquire = 1, + Release = 2, + AcquireRelease = 3, + SequentiallyConsistent = 4, + UniformMemory = 6, + SubgroupMemory = 7, + WorkgroupMemory = 8, + CrossWorkgroupMemory = 9, + AtomicCounterMemory = 10, + ImageMemory = 11, + }, + + MemorySemanticsMask = { + MaskNone = 0, + Acquire = 0x00000002, + Release = 0x00000004, + AcquireRelease = 0x00000008, + SequentiallyConsistent = 0x00000010, + UniformMemory = 0x00000040, + SubgroupMemory = 0x00000080, + WorkgroupMemory = 0x00000100, + CrossWorkgroupMemory = 0x00000200, + AtomicCounterMemory = 0x00000400, + ImageMemory = 0x00000800, + }, + + MemoryAccessShift = { + Volatile = 0, + Aligned = 1, + Nontemporal = 2, + }, + + MemoryAccessMask = { + MaskNone = 0, + Volatile = 0x00000001, + Aligned = 0x00000002, + Nontemporal = 0x00000004, + }, + + Scope = { + CrossDevice = 0, + Device = 1, + Workgroup = 2, + Subgroup = 3, + Invocation = 4, + }, + + GroupOperation = { + Reduce = 0, + InclusiveScan = 1, + ExclusiveScan = 2, + }, + + KernelEnqueueFlags = { + NoWait = 0, + WaitKernel = 1, + WaitWorkGroup = 2, + }, + + KernelProfilingInfoShift = { + CmdExecTime = 0, + }, + + KernelProfilingInfoMask = { + MaskNone = 0, + CmdExecTime = 0x00000001, + }, + + Capability = { + Matrix = 0, + Shader = 1, + Geometry = 2, + Tessellation = 3, + Addresses = 4, + Linkage = 5, + Kernel = 6, + Vector16 = 7, + Float16Buffer = 8, + Float16 = 9, + Float64 = 10, + Int64 = 11, + Int64Atomics = 12, + ImageBasic = 13, + ImageReadWrite = 14, + ImageMipmap = 15, + Pipes = 17, + Groups = 18, + DeviceEnqueue = 19, + LiteralSampler = 20, + AtomicStorage = 21, + Int16 = 22, + TessellationPointSize = 23, + GeometryPointSize = 24, + ImageGatherExtended = 25, + StorageImageMultisample = 27, + UniformBufferArrayDynamicIndexing = 28, + SampledImageArrayDynamicIndexing = 29, + StorageBufferArrayDynamicIndexing = 30, + StorageImageArrayDynamicIndexing = 31, + ClipDistance = 32, + CullDistance = 33, + ImageCubeArray = 34, + SampleRateShading = 35, + ImageRect = 36, + SampledRect = 37, + GenericPointer = 38, + Int8 = 39, + InputAttachment = 40, + SparseResidency = 41, + MinLod = 42, + Sampled1D = 43, + Image1D = 44, + SampledCubeArray = 45, + SampledBuffer = 46, + ImageBuffer = 47, + ImageMSArray = 48, + StorageImageExtendedFormats = 49, + ImageQuery = 50, + DerivativeControl = 51, + InterpolationFunction = 52, + TransformFeedback = 53, + GeometryStreams = 54, + StorageImageReadWithoutFormat = 55, + StorageImageWriteWithoutFormat = 56, + MultiViewport = 57, + SubgroupDispatch = 58, + NamedBarrier = 59, + PipeStorage = 60, + SubgroupBallotKHR = 4423, + DrawParameters = 4427, + SubgroupVoteKHR = 4431, + StorageBuffer16BitAccess = 4433, + StorageUniformBufferBlock16 = 4433, + StorageUniform16 = 4434, + UniformAndStorageBuffer16BitAccess = 4434, + StoragePushConstant16 = 4435, + StorageInputOutput16 = 4436, + DeviceGroup = 4437, + MultiView = 4439, + VariablePointersStorageBuffer = 4441, + VariablePointers = 4442, + AtomicStorageOps = 4445, + SampleMaskPostDepthCoverage = 4447, + ImageGatherBiasLodAMD = 5009, + FragmentMaskAMD = 5010, + StencilExportEXT = 5013, + ImageReadWriteLodAMD = 5015, + SampleMaskOverrideCoverageNV = 5249, + GeometryShaderPassthroughNV = 5251, + ShaderViewportIndexLayerEXT = 5254, + ShaderViewportIndexLayerNV = 5254, + ShaderViewportMaskNV = 5255, + ShaderStereoViewNV = 5259, + PerViewAttributesNV = 5260, + SubgroupShuffleINTEL = 5568, + SubgroupBufferBlockIOINTEL = 5569, + SubgroupImageBlockIOINTEL = 5570, + }, + + Op = { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpExecutionModeId = 331, + OpDecorateId = 332, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpSubgroupReadInvocationKHR = 4432, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateStringGOOGLE = 5633, + }, + +} + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.py vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.py --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.py 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.py 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,977 @@ +# Copyright (c) 2014-2018 The Khronos Group Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and/or associated documentation files (the "Materials"), +# to deal in the Materials without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Materials, and to permit persons to whom the +# Materials are furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Materials. +# +# MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +# STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +# HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +# +# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +# IN THE MATERIALS. + +# This header is automatically generated by the same tool that creates +# the Binary Section of the SPIR-V specification. + +# Enumeration tokens for SPIR-V, in various styles: +# C, C++, C++11, JSON, Lua, Python +# +# - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +# - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +# - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +# - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +# - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +# +# Some tokens act like mask values, which can be OR'd together, +# while others are mutually exclusive. The mask-like ones have +# "Mask" in their name, and a parallel enum that has the shift +# amount (1 << x) for each corresponding enumerant. + +spv = { + 'MagicNumber' : 0x07230203, + 'Version' : 0x00010200, + 'Revision' : 2, + 'OpCodeMask' : 0xffff, + 'WordCountShift' : 16, + + 'SourceLanguage' : { + 'Unknown' : 0, + 'ESSL' : 1, + 'GLSL' : 2, + 'OpenCL_C' : 3, + 'OpenCL_CPP' : 4, + 'HLSL' : 5, + }, + + 'ExecutionModel' : { + 'Vertex' : 0, + 'TessellationControl' : 1, + 'TessellationEvaluation' : 2, + 'Geometry' : 3, + 'Fragment' : 4, + 'GLCompute' : 5, + 'Kernel' : 6, + }, + + 'AddressingModel' : { + 'Logical' : 0, + 'Physical32' : 1, + 'Physical64' : 2, + }, + + 'MemoryModel' : { + 'Simple' : 0, + 'GLSL450' : 1, + 'OpenCL' : 2, + }, + + 'ExecutionMode' : { + 'Invocations' : 0, + 'SpacingEqual' : 1, + 'SpacingFractionalEven' : 2, + 'SpacingFractionalOdd' : 3, + 'VertexOrderCw' : 4, + 'VertexOrderCcw' : 5, + 'PixelCenterInteger' : 6, + 'OriginUpperLeft' : 7, + 'OriginLowerLeft' : 8, + 'EarlyFragmentTests' : 9, + 'PointMode' : 10, + 'Xfb' : 11, + 'DepthReplacing' : 12, + 'DepthGreater' : 14, + 'DepthLess' : 15, + 'DepthUnchanged' : 16, + 'LocalSize' : 17, + 'LocalSizeHint' : 18, + 'InputPoints' : 19, + 'InputLines' : 20, + 'InputLinesAdjacency' : 21, + 'Triangles' : 22, + 'InputTrianglesAdjacency' : 23, + 'Quads' : 24, + 'Isolines' : 25, + 'OutputVertices' : 26, + 'OutputPoints' : 27, + 'OutputLineStrip' : 28, + 'OutputTriangleStrip' : 29, + 'VecTypeHint' : 30, + 'ContractionOff' : 31, + 'Initializer' : 33, + 'Finalizer' : 34, + 'SubgroupSize' : 35, + 'SubgroupsPerWorkgroup' : 36, + 'SubgroupsPerWorkgroupId' : 37, + 'LocalSizeId' : 38, + 'LocalSizeHintId' : 39, + 'PostDepthCoverage' : 4446, + 'StencilRefReplacingEXT' : 5027, + }, + + 'StorageClass' : { + 'UniformConstant' : 0, + 'Input' : 1, + 'Uniform' : 2, + 'Output' : 3, + 'Workgroup' : 4, + 'CrossWorkgroup' : 5, + 'Private' : 6, + 'Function' : 7, + 'Generic' : 8, + 'PushConstant' : 9, + 'AtomicCounter' : 10, + 'Image' : 11, + 'StorageBuffer' : 12, + }, + + 'Dim' : { + 'Dim1D' : 0, + 'Dim2D' : 1, + 'Dim3D' : 2, + 'Cube' : 3, + 'Rect' : 4, + 'Buffer' : 5, + 'SubpassData' : 6, + }, + + 'SamplerAddressingMode' : { + 'None' : 0, + 'ClampToEdge' : 1, + 'Clamp' : 2, + 'Repeat' : 3, + 'RepeatMirrored' : 4, + }, + + 'SamplerFilterMode' : { + 'Nearest' : 0, + 'Linear' : 1, + }, + + 'ImageFormat' : { + 'Unknown' : 0, + 'Rgba32f' : 1, + 'Rgba16f' : 2, + 'R32f' : 3, + 'Rgba8' : 4, + 'Rgba8Snorm' : 5, + 'Rg32f' : 6, + 'Rg16f' : 7, + 'R11fG11fB10f' : 8, + 'R16f' : 9, + 'Rgba16' : 10, + 'Rgb10A2' : 11, + 'Rg16' : 12, + 'Rg8' : 13, + 'R16' : 14, + 'R8' : 15, + 'Rgba16Snorm' : 16, + 'Rg16Snorm' : 17, + 'Rg8Snorm' : 18, + 'R16Snorm' : 19, + 'R8Snorm' : 20, + 'Rgba32i' : 21, + 'Rgba16i' : 22, + 'Rgba8i' : 23, + 'R32i' : 24, + 'Rg32i' : 25, + 'Rg16i' : 26, + 'Rg8i' : 27, + 'R16i' : 28, + 'R8i' : 29, + 'Rgba32ui' : 30, + 'Rgba16ui' : 31, + 'Rgba8ui' : 32, + 'R32ui' : 33, + 'Rgb10a2ui' : 34, + 'Rg32ui' : 35, + 'Rg16ui' : 36, + 'Rg8ui' : 37, + 'R16ui' : 38, + 'R8ui' : 39, + }, + + 'ImageChannelOrder' : { + 'R' : 0, + 'A' : 1, + 'RG' : 2, + 'RA' : 3, + 'RGB' : 4, + 'RGBA' : 5, + 'BGRA' : 6, + 'ARGB' : 7, + 'Intensity' : 8, + 'Luminance' : 9, + 'Rx' : 10, + 'RGx' : 11, + 'RGBx' : 12, + 'Depth' : 13, + 'DepthStencil' : 14, + 'sRGB' : 15, + 'sRGBx' : 16, + 'sRGBA' : 17, + 'sBGRA' : 18, + 'ABGR' : 19, + }, + + 'ImageChannelDataType' : { + 'SnormInt8' : 0, + 'SnormInt16' : 1, + 'UnormInt8' : 2, + 'UnormInt16' : 3, + 'UnormShort565' : 4, + 'UnormShort555' : 5, + 'UnormInt101010' : 6, + 'SignedInt8' : 7, + 'SignedInt16' : 8, + 'SignedInt32' : 9, + 'UnsignedInt8' : 10, + 'UnsignedInt16' : 11, + 'UnsignedInt32' : 12, + 'HalfFloat' : 13, + 'Float' : 14, + 'UnormInt24' : 15, + 'UnormInt101010_2' : 16, + }, + + 'ImageOperandsShift' : { + 'Bias' : 0, + 'Lod' : 1, + 'Grad' : 2, + 'ConstOffset' : 3, + 'Offset' : 4, + 'ConstOffsets' : 5, + 'Sample' : 6, + 'MinLod' : 7, + }, + + 'ImageOperandsMask' : { + 'MaskNone' : 0, + 'Bias' : 0x00000001, + 'Lod' : 0x00000002, + 'Grad' : 0x00000004, + 'ConstOffset' : 0x00000008, + 'Offset' : 0x00000010, + 'ConstOffsets' : 0x00000020, + 'Sample' : 0x00000040, + 'MinLod' : 0x00000080, + }, + + 'FPFastMathModeShift' : { + 'NotNaN' : 0, + 'NotInf' : 1, + 'NSZ' : 2, + 'AllowRecip' : 3, + 'Fast' : 4, + }, + + 'FPFastMathModeMask' : { + 'MaskNone' : 0, + 'NotNaN' : 0x00000001, + 'NotInf' : 0x00000002, + 'NSZ' : 0x00000004, + 'AllowRecip' : 0x00000008, + 'Fast' : 0x00000010, + }, + + 'FPRoundingMode' : { + 'RTE' : 0, + 'RTZ' : 1, + 'RTP' : 2, + 'RTN' : 3, + }, + + 'LinkageType' : { + 'Export' : 0, + 'Import' : 1, + }, + + 'AccessQualifier' : { + 'ReadOnly' : 0, + 'WriteOnly' : 1, + 'ReadWrite' : 2, + }, + + 'FunctionParameterAttribute' : { + 'Zext' : 0, + 'Sext' : 1, + 'ByVal' : 2, + 'Sret' : 3, + 'NoAlias' : 4, + 'NoCapture' : 5, + 'NoWrite' : 6, + 'NoReadWrite' : 7, + }, + + 'Decoration' : { + 'RelaxedPrecision' : 0, + 'SpecId' : 1, + 'Block' : 2, + 'BufferBlock' : 3, + 'RowMajor' : 4, + 'ColMajor' : 5, + 'ArrayStride' : 6, + 'MatrixStride' : 7, + 'GLSLShared' : 8, + 'GLSLPacked' : 9, + 'CPacked' : 10, + 'BuiltIn' : 11, + 'NoPerspective' : 13, + 'Flat' : 14, + 'Patch' : 15, + 'Centroid' : 16, + 'Sample' : 17, + 'Invariant' : 18, + 'Restrict' : 19, + 'Aliased' : 20, + 'Volatile' : 21, + 'Constant' : 22, + 'Coherent' : 23, + 'NonWritable' : 24, + 'NonReadable' : 25, + 'Uniform' : 26, + 'SaturatedConversion' : 28, + 'Stream' : 29, + 'Location' : 30, + 'Component' : 31, + 'Index' : 32, + 'Binding' : 33, + 'DescriptorSet' : 34, + 'Offset' : 35, + 'XfbBuffer' : 36, + 'XfbStride' : 37, + 'FuncParamAttr' : 38, + 'FPRoundingMode' : 39, + 'FPFastMathMode' : 40, + 'LinkageAttributes' : 41, + 'NoContraction' : 42, + 'InputAttachmentIndex' : 43, + 'Alignment' : 44, + 'MaxByteOffset' : 45, + 'AlignmentId' : 46, + 'MaxByteOffsetId' : 47, + 'ExplicitInterpAMD' : 4999, + 'OverrideCoverageNV' : 5248, + 'PassthroughNV' : 5250, + 'ViewportRelativeNV' : 5252, + 'SecondaryViewportRelativeNV' : 5256, + 'HlslCounterBufferGOOGLE' : 5634, + 'HlslSemanticGOOGLE' : 5635, + }, + + 'BuiltIn' : { + 'Position' : 0, + 'PointSize' : 1, + 'ClipDistance' : 3, + 'CullDistance' : 4, + 'VertexId' : 5, + 'InstanceId' : 6, + 'PrimitiveId' : 7, + 'InvocationId' : 8, + 'Layer' : 9, + 'ViewportIndex' : 10, + 'TessLevelOuter' : 11, + 'TessLevelInner' : 12, + 'TessCoord' : 13, + 'PatchVertices' : 14, + 'FragCoord' : 15, + 'PointCoord' : 16, + 'FrontFacing' : 17, + 'SampleId' : 18, + 'SamplePosition' : 19, + 'SampleMask' : 20, + 'FragDepth' : 22, + 'HelperInvocation' : 23, + 'NumWorkgroups' : 24, + 'WorkgroupSize' : 25, + 'WorkgroupId' : 26, + 'LocalInvocationId' : 27, + 'GlobalInvocationId' : 28, + 'LocalInvocationIndex' : 29, + 'WorkDim' : 30, + 'GlobalSize' : 31, + 'EnqueuedWorkgroupSize' : 32, + 'GlobalOffset' : 33, + 'GlobalLinearId' : 34, + 'SubgroupSize' : 36, + 'SubgroupMaxSize' : 37, + 'NumSubgroups' : 38, + 'NumEnqueuedSubgroups' : 39, + 'SubgroupId' : 40, + 'SubgroupLocalInvocationId' : 41, + 'VertexIndex' : 42, + 'InstanceIndex' : 43, + 'SubgroupEqMaskKHR' : 4416, + 'SubgroupGeMaskKHR' : 4417, + 'SubgroupGtMaskKHR' : 4418, + 'SubgroupLeMaskKHR' : 4419, + 'SubgroupLtMaskKHR' : 4420, + 'BaseVertex' : 4424, + 'BaseInstance' : 4425, + 'DrawIndex' : 4426, + 'DeviceIndex' : 4438, + 'ViewIndex' : 4440, + 'BaryCoordNoPerspAMD' : 4992, + 'BaryCoordNoPerspCentroidAMD' : 4993, + 'BaryCoordNoPerspSampleAMD' : 4994, + 'BaryCoordSmoothAMD' : 4995, + 'BaryCoordSmoothCentroidAMD' : 4996, + 'BaryCoordSmoothSampleAMD' : 4997, + 'BaryCoordPullModelAMD' : 4998, + 'FragStencilRefEXT' : 5014, + 'ViewportMaskNV' : 5253, + 'SecondaryPositionNV' : 5257, + 'SecondaryViewportMaskNV' : 5258, + 'PositionPerViewNV' : 5261, + 'ViewportMaskPerViewNV' : 5262, + }, + + 'SelectionControlShift' : { + 'Flatten' : 0, + 'DontFlatten' : 1, + }, + + 'SelectionControlMask' : { + 'MaskNone' : 0, + 'Flatten' : 0x00000001, + 'DontFlatten' : 0x00000002, + }, + + 'LoopControlShift' : { + 'Unroll' : 0, + 'DontUnroll' : 1, + 'DependencyInfinite' : 2, + 'DependencyLength' : 3, + }, + + 'LoopControlMask' : { + 'MaskNone' : 0, + 'Unroll' : 0x00000001, + 'DontUnroll' : 0x00000002, + 'DependencyInfinite' : 0x00000004, + 'DependencyLength' : 0x00000008, + }, + + 'FunctionControlShift' : { + 'Inline' : 0, + 'DontInline' : 1, + 'Pure' : 2, + 'Const' : 3, + }, + + 'FunctionControlMask' : { + 'MaskNone' : 0, + 'Inline' : 0x00000001, + 'DontInline' : 0x00000002, + 'Pure' : 0x00000004, + 'Const' : 0x00000008, + }, + + 'MemorySemanticsShift' : { + 'Acquire' : 1, + 'Release' : 2, + 'AcquireRelease' : 3, + 'SequentiallyConsistent' : 4, + 'UniformMemory' : 6, + 'SubgroupMemory' : 7, + 'WorkgroupMemory' : 8, + 'CrossWorkgroupMemory' : 9, + 'AtomicCounterMemory' : 10, + 'ImageMemory' : 11, + }, + + 'MemorySemanticsMask' : { + 'MaskNone' : 0, + 'Acquire' : 0x00000002, + 'Release' : 0x00000004, + 'AcquireRelease' : 0x00000008, + 'SequentiallyConsistent' : 0x00000010, + 'UniformMemory' : 0x00000040, + 'SubgroupMemory' : 0x00000080, + 'WorkgroupMemory' : 0x00000100, + 'CrossWorkgroupMemory' : 0x00000200, + 'AtomicCounterMemory' : 0x00000400, + 'ImageMemory' : 0x00000800, + }, + + 'MemoryAccessShift' : { + 'Volatile' : 0, + 'Aligned' : 1, + 'Nontemporal' : 2, + }, + + 'MemoryAccessMask' : { + 'MaskNone' : 0, + 'Volatile' : 0x00000001, + 'Aligned' : 0x00000002, + 'Nontemporal' : 0x00000004, + }, + + 'Scope' : { + 'CrossDevice' : 0, + 'Device' : 1, + 'Workgroup' : 2, + 'Subgroup' : 3, + 'Invocation' : 4, + }, + + 'GroupOperation' : { + 'Reduce' : 0, + 'InclusiveScan' : 1, + 'ExclusiveScan' : 2, + }, + + 'KernelEnqueueFlags' : { + 'NoWait' : 0, + 'WaitKernel' : 1, + 'WaitWorkGroup' : 2, + }, + + 'KernelProfilingInfoShift' : { + 'CmdExecTime' : 0, + }, + + 'KernelProfilingInfoMask' : { + 'MaskNone' : 0, + 'CmdExecTime' : 0x00000001, + }, + + 'Capability' : { + 'Matrix' : 0, + 'Shader' : 1, + 'Geometry' : 2, + 'Tessellation' : 3, + 'Addresses' : 4, + 'Linkage' : 5, + 'Kernel' : 6, + 'Vector16' : 7, + 'Float16Buffer' : 8, + 'Float16' : 9, + 'Float64' : 10, + 'Int64' : 11, + 'Int64Atomics' : 12, + 'ImageBasic' : 13, + 'ImageReadWrite' : 14, + 'ImageMipmap' : 15, + 'Pipes' : 17, + 'Groups' : 18, + 'DeviceEnqueue' : 19, + 'LiteralSampler' : 20, + 'AtomicStorage' : 21, + 'Int16' : 22, + 'TessellationPointSize' : 23, + 'GeometryPointSize' : 24, + 'ImageGatherExtended' : 25, + 'StorageImageMultisample' : 27, + 'UniformBufferArrayDynamicIndexing' : 28, + 'SampledImageArrayDynamicIndexing' : 29, + 'StorageBufferArrayDynamicIndexing' : 30, + 'StorageImageArrayDynamicIndexing' : 31, + 'ClipDistance' : 32, + 'CullDistance' : 33, + 'ImageCubeArray' : 34, + 'SampleRateShading' : 35, + 'ImageRect' : 36, + 'SampledRect' : 37, + 'GenericPointer' : 38, + 'Int8' : 39, + 'InputAttachment' : 40, + 'SparseResidency' : 41, + 'MinLod' : 42, + 'Sampled1D' : 43, + 'Image1D' : 44, + 'SampledCubeArray' : 45, + 'SampledBuffer' : 46, + 'ImageBuffer' : 47, + 'ImageMSArray' : 48, + 'StorageImageExtendedFormats' : 49, + 'ImageQuery' : 50, + 'DerivativeControl' : 51, + 'InterpolationFunction' : 52, + 'TransformFeedback' : 53, + 'GeometryStreams' : 54, + 'StorageImageReadWithoutFormat' : 55, + 'StorageImageWriteWithoutFormat' : 56, + 'MultiViewport' : 57, + 'SubgroupDispatch' : 58, + 'NamedBarrier' : 59, + 'PipeStorage' : 60, + 'SubgroupBallotKHR' : 4423, + 'DrawParameters' : 4427, + 'SubgroupVoteKHR' : 4431, + 'StorageBuffer16BitAccess' : 4433, + 'StorageUniformBufferBlock16' : 4433, + 'StorageUniform16' : 4434, + 'UniformAndStorageBuffer16BitAccess' : 4434, + 'StoragePushConstant16' : 4435, + 'StorageInputOutput16' : 4436, + 'DeviceGroup' : 4437, + 'MultiView' : 4439, + 'VariablePointersStorageBuffer' : 4441, + 'VariablePointers' : 4442, + 'AtomicStorageOps' : 4445, + 'SampleMaskPostDepthCoverage' : 4447, + 'ImageGatherBiasLodAMD' : 5009, + 'FragmentMaskAMD' : 5010, + 'StencilExportEXT' : 5013, + 'ImageReadWriteLodAMD' : 5015, + 'SampleMaskOverrideCoverageNV' : 5249, + 'GeometryShaderPassthroughNV' : 5251, + 'ShaderViewportIndexLayerEXT' : 5254, + 'ShaderViewportIndexLayerNV' : 5254, + 'ShaderViewportMaskNV' : 5255, + 'ShaderStereoViewNV' : 5259, + 'PerViewAttributesNV' : 5260, + 'SubgroupShuffleINTEL' : 5568, + 'SubgroupBufferBlockIOINTEL' : 5569, + 'SubgroupImageBlockIOINTEL' : 5570, + }, + + 'Op' : { + 'OpNop' : 0, + 'OpUndef' : 1, + 'OpSourceContinued' : 2, + 'OpSource' : 3, + 'OpSourceExtension' : 4, + 'OpName' : 5, + 'OpMemberName' : 6, + 'OpString' : 7, + 'OpLine' : 8, + 'OpExtension' : 10, + 'OpExtInstImport' : 11, + 'OpExtInst' : 12, + 'OpMemoryModel' : 14, + 'OpEntryPoint' : 15, + 'OpExecutionMode' : 16, + 'OpCapability' : 17, + 'OpTypeVoid' : 19, + 'OpTypeBool' : 20, + 'OpTypeInt' : 21, + 'OpTypeFloat' : 22, + 'OpTypeVector' : 23, + 'OpTypeMatrix' : 24, + 'OpTypeImage' : 25, + 'OpTypeSampler' : 26, + 'OpTypeSampledImage' : 27, + 'OpTypeArray' : 28, + 'OpTypeRuntimeArray' : 29, + 'OpTypeStruct' : 30, + 'OpTypeOpaque' : 31, + 'OpTypePointer' : 32, + 'OpTypeFunction' : 33, + 'OpTypeEvent' : 34, + 'OpTypeDeviceEvent' : 35, + 'OpTypeReserveId' : 36, + 'OpTypeQueue' : 37, + 'OpTypePipe' : 38, + 'OpTypeForwardPointer' : 39, + 'OpConstantTrue' : 41, + 'OpConstantFalse' : 42, + 'OpConstant' : 43, + 'OpConstantComposite' : 44, + 'OpConstantSampler' : 45, + 'OpConstantNull' : 46, + 'OpSpecConstantTrue' : 48, + 'OpSpecConstantFalse' : 49, + 'OpSpecConstant' : 50, + 'OpSpecConstantComposite' : 51, + 'OpSpecConstantOp' : 52, + 'OpFunction' : 54, + 'OpFunctionParameter' : 55, + 'OpFunctionEnd' : 56, + 'OpFunctionCall' : 57, + 'OpVariable' : 59, + 'OpImageTexelPointer' : 60, + 'OpLoad' : 61, + 'OpStore' : 62, + 'OpCopyMemory' : 63, + 'OpCopyMemorySized' : 64, + 'OpAccessChain' : 65, + 'OpInBoundsAccessChain' : 66, + 'OpPtrAccessChain' : 67, + 'OpArrayLength' : 68, + 'OpGenericPtrMemSemantics' : 69, + 'OpInBoundsPtrAccessChain' : 70, + 'OpDecorate' : 71, + 'OpMemberDecorate' : 72, + 'OpDecorationGroup' : 73, + 'OpGroupDecorate' : 74, + 'OpGroupMemberDecorate' : 75, + 'OpVectorExtractDynamic' : 77, + 'OpVectorInsertDynamic' : 78, + 'OpVectorShuffle' : 79, + 'OpCompositeConstruct' : 80, + 'OpCompositeExtract' : 81, + 'OpCompositeInsert' : 82, + 'OpCopyObject' : 83, + 'OpTranspose' : 84, + 'OpSampledImage' : 86, + 'OpImageSampleImplicitLod' : 87, + 'OpImageSampleExplicitLod' : 88, + 'OpImageSampleDrefImplicitLod' : 89, + 'OpImageSampleDrefExplicitLod' : 90, + 'OpImageSampleProjImplicitLod' : 91, + 'OpImageSampleProjExplicitLod' : 92, + 'OpImageSampleProjDrefImplicitLod' : 93, + 'OpImageSampleProjDrefExplicitLod' : 94, + 'OpImageFetch' : 95, + 'OpImageGather' : 96, + 'OpImageDrefGather' : 97, + 'OpImageRead' : 98, + 'OpImageWrite' : 99, + 'OpImage' : 100, + 'OpImageQueryFormat' : 101, + 'OpImageQueryOrder' : 102, + 'OpImageQuerySizeLod' : 103, + 'OpImageQuerySize' : 104, + 'OpImageQueryLod' : 105, + 'OpImageQueryLevels' : 106, + 'OpImageQuerySamples' : 107, + 'OpConvertFToU' : 109, + 'OpConvertFToS' : 110, + 'OpConvertSToF' : 111, + 'OpConvertUToF' : 112, + 'OpUConvert' : 113, + 'OpSConvert' : 114, + 'OpFConvert' : 115, + 'OpQuantizeToF16' : 116, + 'OpConvertPtrToU' : 117, + 'OpSatConvertSToU' : 118, + 'OpSatConvertUToS' : 119, + 'OpConvertUToPtr' : 120, + 'OpPtrCastToGeneric' : 121, + 'OpGenericCastToPtr' : 122, + 'OpGenericCastToPtrExplicit' : 123, + 'OpBitcast' : 124, + 'OpSNegate' : 126, + 'OpFNegate' : 127, + 'OpIAdd' : 128, + 'OpFAdd' : 129, + 'OpISub' : 130, + 'OpFSub' : 131, + 'OpIMul' : 132, + 'OpFMul' : 133, + 'OpUDiv' : 134, + 'OpSDiv' : 135, + 'OpFDiv' : 136, + 'OpUMod' : 137, + 'OpSRem' : 138, + 'OpSMod' : 139, + 'OpFRem' : 140, + 'OpFMod' : 141, + 'OpVectorTimesScalar' : 142, + 'OpMatrixTimesScalar' : 143, + 'OpVectorTimesMatrix' : 144, + 'OpMatrixTimesVector' : 145, + 'OpMatrixTimesMatrix' : 146, + 'OpOuterProduct' : 147, + 'OpDot' : 148, + 'OpIAddCarry' : 149, + 'OpISubBorrow' : 150, + 'OpUMulExtended' : 151, + 'OpSMulExtended' : 152, + 'OpAny' : 154, + 'OpAll' : 155, + 'OpIsNan' : 156, + 'OpIsInf' : 157, + 'OpIsFinite' : 158, + 'OpIsNormal' : 159, + 'OpSignBitSet' : 160, + 'OpLessOrGreater' : 161, + 'OpOrdered' : 162, + 'OpUnordered' : 163, + 'OpLogicalEqual' : 164, + 'OpLogicalNotEqual' : 165, + 'OpLogicalOr' : 166, + 'OpLogicalAnd' : 167, + 'OpLogicalNot' : 168, + 'OpSelect' : 169, + 'OpIEqual' : 170, + 'OpINotEqual' : 171, + 'OpUGreaterThan' : 172, + 'OpSGreaterThan' : 173, + 'OpUGreaterThanEqual' : 174, + 'OpSGreaterThanEqual' : 175, + 'OpULessThan' : 176, + 'OpSLessThan' : 177, + 'OpULessThanEqual' : 178, + 'OpSLessThanEqual' : 179, + 'OpFOrdEqual' : 180, + 'OpFUnordEqual' : 181, + 'OpFOrdNotEqual' : 182, + 'OpFUnordNotEqual' : 183, + 'OpFOrdLessThan' : 184, + 'OpFUnordLessThan' : 185, + 'OpFOrdGreaterThan' : 186, + 'OpFUnordGreaterThan' : 187, + 'OpFOrdLessThanEqual' : 188, + 'OpFUnordLessThanEqual' : 189, + 'OpFOrdGreaterThanEqual' : 190, + 'OpFUnordGreaterThanEqual' : 191, + 'OpShiftRightLogical' : 194, + 'OpShiftRightArithmetic' : 195, + 'OpShiftLeftLogical' : 196, + 'OpBitwiseOr' : 197, + 'OpBitwiseXor' : 198, + 'OpBitwiseAnd' : 199, + 'OpNot' : 200, + 'OpBitFieldInsert' : 201, + 'OpBitFieldSExtract' : 202, + 'OpBitFieldUExtract' : 203, + 'OpBitReverse' : 204, + 'OpBitCount' : 205, + 'OpDPdx' : 207, + 'OpDPdy' : 208, + 'OpFwidth' : 209, + 'OpDPdxFine' : 210, + 'OpDPdyFine' : 211, + 'OpFwidthFine' : 212, + 'OpDPdxCoarse' : 213, + 'OpDPdyCoarse' : 214, + 'OpFwidthCoarse' : 215, + 'OpEmitVertex' : 218, + 'OpEndPrimitive' : 219, + 'OpEmitStreamVertex' : 220, + 'OpEndStreamPrimitive' : 221, + 'OpControlBarrier' : 224, + 'OpMemoryBarrier' : 225, + 'OpAtomicLoad' : 227, + 'OpAtomicStore' : 228, + 'OpAtomicExchange' : 229, + 'OpAtomicCompareExchange' : 230, + 'OpAtomicCompareExchangeWeak' : 231, + 'OpAtomicIIncrement' : 232, + 'OpAtomicIDecrement' : 233, + 'OpAtomicIAdd' : 234, + 'OpAtomicISub' : 235, + 'OpAtomicSMin' : 236, + 'OpAtomicUMin' : 237, + 'OpAtomicSMax' : 238, + 'OpAtomicUMax' : 239, + 'OpAtomicAnd' : 240, + 'OpAtomicOr' : 241, + 'OpAtomicXor' : 242, + 'OpPhi' : 245, + 'OpLoopMerge' : 246, + 'OpSelectionMerge' : 247, + 'OpLabel' : 248, + 'OpBranch' : 249, + 'OpBranchConditional' : 250, + 'OpSwitch' : 251, + 'OpKill' : 252, + 'OpReturn' : 253, + 'OpReturnValue' : 254, + 'OpUnreachable' : 255, + 'OpLifetimeStart' : 256, + 'OpLifetimeStop' : 257, + 'OpGroupAsyncCopy' : 259, + 'OpGroupWaitEvents' : 260, + 'OpGroupAll' : 261, + 'OpGroupAny' : 262, + 'OpGroupBroadcast' : 263, + 'OpGroupIAdd' : 264, + 'OpGroupFAdd' : 265, + 'OpGroupFMin' : 266, + 'OpGroupUMin' : 267, + 'OpGroupSMin' : 268, + 'OpGroupFMax' : 269, + 'OpGroupUMax' : 270, + 'OpGroupSMax' : 271, + 'OpReadPipe' : 274, + 'OpWritePipe' : 275, + 'OpReservedReadPipe' : 276, + 'OpReservedWritePipe' : 277, + 'OpReserveReadPipePackets' : 278, + 'OpReserveWritePipePackets' : 279, + 'OpCommitReadPipe' : 280, + 'OpCommitWritePipe' : 281, + 'OpIsValidReserveId' : 282, + 'OpGetNumPipePackets' : 283, + 'OpGetMaxPipePackets' : 284, + 'OpGroupReserveReadPipePackets' : 285, + 'OpGroupReserveWritePipePackets' : 286, + 'OpGroupCommitReadPipe' : 287, + 'OpGroupCommitWritePipe' : 288, + 'OpEnqueueMarker' : 291, + 'OpEnqueueKernel' : 292, + 'OpGetKernelNDrangeSubGroupCount' : 293, + 'OpGetKernelNDrangeMaxSubGroupSize' : 294, + 'OpGetKernelWorkGroupSize' : 295, + 'OpGetKernelPreferredWorkGroupSizeMultiple' : 296, + 'OpRetainEvent' : 297, + 'OpReleaseEvent' : 298, + 'OpCreateUserEvent' : 299, + 'OpIsValidEvent' : 300, + 'OpSetUserEventStatus' : 301, + 'OpCaptureEventProfilingInfo' : 302, + 'OpGetDefaultQueue' : 303, + 'OpBuildNDRange' : 304, + 'OpImageSparseSampleImplicitLod' : 305, + 'OpImageSparseSampleExplicitLod' : 306, + 'OpImageSparseSampleDrefImplicitLod' : 307, + 'OpImageSparseSampleDrefExplicitLod' : 308, + 'OpImageSparseSampleProjImplicitLod' : 309, + 'OpImageSparseSampleProjExplicitLod' : 310, + 'OpImageSparseSampleProjDrefImplicitLod' : 311, + 'OpImageSparseSampleProjDrefExplicitLod' : 312, + 'OpImageSparseFetch' : 313, + 'OpImageSparseGather' : 314, + 'OpImageSparseDrefGather' : 315, + 'OpImageSparseTexelsResident' : 316, + 'OpNoLine' : 317, + 'OpAtomicFlagTestAndSet' : 318, + 'OpAtomicFlagClear' : 319, + 'OpImageSparseRead' : 320, + 'OpSizeOf' : 321, + 'OpTypePipeStorage' : 322, + 'OpConstantPipeStorage' : 323, + 'OpCreatePipeFromPipeStorage' : 324, + 'OpGetKernelLocalSizeForSubgroupCount' : 325, + 'OpGetKernelMaxNumSubgroups' : 326, + 'OpTypeNamedBarrier' : 327, + 'OpNamedBarrierInitialize' : 328, + 'OpMemoryNamedBarrier' : 329, + 'OpModuleProcessed' : 330, + 'OpExecutionModeId' : 331, + 'OpDecorateId' : 332, + 'OpSubgroupBallotKHR' : 4421, + 'OpSubgroupFirstInvocationKHR' : 4422, + 'OpSubgroupAllKHR' : 4428, + 'OpSubgroupAnyKHR' : 4429, + 'OpSubgroupAllEqualKHR' : 4430, + 'OpSubgroupReadInvocationKHR' : 4432, + 'OpGroupIAddNonUniformAMD' : 5000, + 'OpGroupFAddNonUniformAMD' : 5001, + 'OpGroupFMinNonUniformAMD' : 5002, + 'OpGroupUMinNonUniformAMD' : 5003, + 'OpGroupSMinNonUniformAMD' : 5004, + 'OpGroupFMaxNonUniformAMD' : 5005, + 'OpGroupUMaxNonUniformAMD' : 5006, + 'OpGroupSMaxNonUniformAMD' : 5007, + 'OpFragmentMaskFetchAMD' : 5011, + 'OpFragmentFetchAMD' : 5012, + 'OpSubgroupShuffleINTEL' : 5571, + 'OpSubgroupShuffleDownINTEL' : 5572, + 'OpSubgroupShuffleUpINTEL' : 5573, + 'OpSubgroupShuffleXorINTEL' : 5574, + 'OpSubgroupBlockReadINTEL' : 5575, + 'OpSubgroupBlockWriteINTEL' : 5576, + 'OpSubgroupImageBlockReadINTEL' : 5577, + 'OpSubgroupImageBlockWriteINTEL' : 5578, + 'OpDecorateStringGOOGLE' : 5632, + 'OpMemberDecorateStringGOOGLE' : 5633, + }, + +} + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/spir-v.xml vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/spir-v.xml --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/spir-v.xml 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/spir-v.xml 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.glsl.std.450.grammar.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.glsl.std.450.grammar.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.glsl.std.450.grammar.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.glsl.std.450.grammar.json 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,642 @@ +{ + "copyright" : [ + "Copyright (c) 2014-2016 The Khronos Group Inc.", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and/or associated documentation files (the \"Materials\"),", + "to deal in the Materials without restriction, including without limitation", + "the rights to use, copy, modify, merge, publish, distribute, sublicense,", + "and/or sell copies of the Materials, and to permit persons to whom the", + "Materials are furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Materials.", + "", + "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", + "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", + "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", + "", + "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", + "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", + "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", + "IN THE MATERIALS." + ], + "version" : 100, + "revision" : 2, + "instructions" : [ + { + "opname" : "Round", + "opcode" : 1, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "RoundEven", + "opcode" : 2, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Trunc", + "opcode" : 3, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "FAbs", + "opcode" : 4, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "SAbs", + "opcode" : 5, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "FSign", + "opcode" : 6, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "SSign", + "opcode" : 7, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Floor", + "opcode" : 8, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Ceil", + "opcode" : 9, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Fract", + "opcode" : 10, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Radians", + "opcode" : 11, + "operands" : [ + { "kind" : "IdRef", "name" : "'degrees'" } + ] + }, + { + "opname" : "Degrees", + "opcode" : 12, + "operands" : [ + { "kind" : "IdRef", "name" : "'radians'" } + ] + }, + { + "opname" : "Sin", + "opcode" : 13, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Cos", + "opcode" : 14, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Tan", + "opcode" : 15, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Asin", + "opcode" : 16, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Acos", + "opcode" : 17, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Atan", + "opcode" : 18, + "operands" : [ + { "kind" : "IdRef", "name" : "'y_over_x'" } + ] + }, + { + "opname" : "Sinh", + "opcode" : 19, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Cosh", + "opcode" : 20, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Tanh", + "opcode" : 21, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Asinh", + "opcode" : 22, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Acosh", + "opcode" : 23, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Atanh", + "opcode" : 24, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Atan2", + "opcode" : 25, + "operands" : [ + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Pow", + "opcode" : 26, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "Exp", + "opcode" : 27, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Log", + "opcode" : 28, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Exp2", + "opcode" : 29, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Log2", + "opcode" : 30, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Sqrt", + "opcode" : 31, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "InverseSqrt", + "opcode" : 32, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Determinant", + "opcode" : 33, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "MatrixInverse", + "opcode" : 34, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Modf", + "opcode" : 35, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'i'" } + ] + }, + { + "opname" : "ModfStruct", + "opcode" : 36, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "FMin", + "opcode" : 37, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "UMin", + "opcode" : 38, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "SMin", + "opcode" : 39, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "FMax", + "opcode" : 40, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "UMax", + "opcode" : 41, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "SMax", + "opcode" : 42, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "FClamp", + "opcode" : 43, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minVal'" }, + { "kind" : "IdRef", "name" : "'maxVal'" } + ] + }, + { + "opname" : "UClamp", + "opcode" : 44, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minVal'" }, + { "kind" : "IdRef", "name" : "'maxVal'" } + ] + }, + { + "opname" : "SClamp", + "opcode" : 45, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minVal'" }, + { "kind" : "IdRef", "name" : "'maxVal'" } + ] + }, + { + "opname" : "FMix", + "opcode" : 46, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'a'" } + ] + }, + { + "opname" : "IMix", + "opcode" : 47, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'a'" } + ] + }, + { + "opname" : "Step", + "opcode" : 48, + "operands" : [ + { "kind" : "IdRef", "name" : "'edge'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "SmoothStep", + "opcode" : 49, + "operands" : [ + { "kind" : "IdRef", "name" : "'edge0'" }, + { "kind" : "IdRef", "name" : "'edge1'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Fma", + "opcode" : 50, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "Frexp", + "opcode" : 51, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'exp'" } + ] + }, + { + "opname" : "FrexpStruct", + "opcode" : 52, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Ldexp", + "opcode" : 53, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'exp'" } + ] + }, + { + "opname" : "PackSnorm4x8", + "opcode" : 54, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackUnorm4x8", + "opcode" : 55, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackSnorm2x16", + "opcode" : 56, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackUnorm2x16", + "opcode" : 57, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackHalf2x16", + "opcode" : 58, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "PackDouble2x32", + "opcode" : 59, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ], + "capabilities" : [ "Float64" ] + }, + { + "opname" : "UnpackSnorm2x16", + "opcode" : 60, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "UnpackUnorm2x16", + "opcode" : 61, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "UnpackHalf2x16", + "opcode" : 62, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ] + }, + { + "opname" : "UnpackSnorm4x8", + "opcode" : 63, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "UnpackUnorm4x8", + "opcode" : 64, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "UnpackDouble2x32", + "opcode" : 65, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" } + ], + "capabilities" : [ "Float64" ] + }, + { + "opname" : "Length", + "opcode" : 66, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "Distance", + "opcode" : 67, + "operands" : [ + { "kind" : "IdRef", "name" : "'p0'" }, + { "kind" : "IdRef", "name" : "'p1'" } + ] + }, + { + "opname" : "Cross", + "opcode" : 68, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "Normalize", + "opcode" : 69, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "FaceForward", + "opcode" : 70, + "operands" : [ + { "kind" : "IdRef", "name" : "'N'" }, + { "kind" : "IdRef", "name" : "'I'" }, + { "kind" : "IdRef", "name" : "'Nref'" } + ] + }, + { + "opname" : "Reflect", + "opcode" : 71, + "operands" : [ + { "kind" : "IdRef", "name" : "'I'" }, + { "kind" : "IdRef", "name" : "'N'" } + ] + }, + { + "opname" : "Refract", + "opcode" : 72, + "operands" : [ + { "kind" : "IdRef", "name" : "'I'" }, + { "kind" : "IdRef", "name" : "'N'" }, + { "kind" : "IdRef", "name" : "'eta'" } + ] + }, + { + "opname" : "FindILsb", + "opcode" : 73, + "operands" : [ + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "FindSMsb", + "opcode" : 74, + "operands" : [ + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "FindUMsb", + "opcode" : 75, + "operands" : [ + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "InterpolateAtCentroid", + "opcode" : 76, + "operands" : [ + { "kind" : "IdRef", "name" : "'interpolant'" } + ], + "capabilities" : [ "InterpolationFunction" ] + }, + { + "opname" : "InterpolateAtSample", + "opcode" : 77, + "operands" : [ + { "kind" : "IdRef", "name" : "'interpolant'" }, + { "kind" : "IdRef", "name" : "'sample'" } + ], + "capabilities" : [ "InterpolationFunction" ] + }, + { + "opname" : "InterpolateAtOffset", + "opcode" : 78, + "operands" : [ + { "kind" : "IdRef", "name" : "'interpolant'" }, + { "kind" : "IdRef", "name" : "'offset'" } + ], + "capabilities" : [ "InterpolationFunction" ] + }, + { + "opname" : "NMin", + "opcode" : 79, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "NMax", + "opcode" : 80, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "NClamp", + "opcode" : 81, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minVal'" }, + { "kind" : "IdRef", "name" : "'maxVal'" } + ] + } + ] +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.opencl.std.100.grammar.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.opencl.std.100.grammar.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.opencl.std.100.grammar.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.opencl.std.100.grammar.json 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1279 @@ +{ + "copyright" : [ + "Copyright (c) 2014-2016 The Khronos Group Inc.", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and/or associated documentation files (the \"Materials\"),", + "to deal in the Materials without restriction, including without limitation", + "the rights to use, copy, modify, merge, publish, distribute, sublicense,", + "and/or sell copies of the Materials, and to permit persons to whom the", + "Materials are furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Materials.", + "", + "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", + "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", + "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", + "", + "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", + "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", + "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", + "IN THE MATERIALS." + ], + "version" : 100, + "revision" : 2, + "instructions" : [ + { + "opname" : "acos", + "opcode" : 0, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "acosh", + "opcode" : 1, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "acospi", + "opcode" : 2, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "asin", + "opcode" : 3, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "asinh", + "opcode" : 4, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "asinpi", + "opcode" : 5, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atan", + "opcode" : 6, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atan2", + "opcode" : 7, + "operands" : [ + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atanh", + "opcode" : 8, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atanpi", + "opcode" : 9, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "atan2pi", + "opcode" : 10, + "operands" : [ + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "cbrt", + "opcode" : 11, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "ceil", + "opcode" : 12, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "copysign", + "opcode" : 13, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "cos", + "opcode" : 14, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "cosh", + "opcode" : 15, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "cospi", + "opcode" : 16, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "erfc", + "opcode" : 17, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "erf", + "opcode" : 18, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "exp", + "opcode" : 19, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "exp2", + "opcode" : 20, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "exp10", + "opcode" : 21, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "expm1", + "opcode" : 22, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "fabs", + "opcode" : 23, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "fdim", + "opcode" : 24, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "floor", + "opcode" : 25, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "fma", + "opcode" : 26, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "fmax", + "opcode" : 27, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "fmin", + "opcode" : 28, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "fmod", + "opcode" : 29, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "fract", + "opcode" : 30, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'ptr'" } + ] + }, + { + "opname" : "frexp", + "opcode" : 31, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'exp'" } + ] + }, + { + "opname" : "hypot", + "opcode" : 32, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "ilogb", + "opcode" : 33, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "ldexp", + "opcode" : 34, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'k'" } + ] + }, + { + "opname" : "lgamma", + "opcode" : 35, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "lgamma_r", + "opcode" : 36, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'signp'" } + ] + }, + { + "opname" : "log", + "opcode" : 37, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "log2", + "opcode" : 38, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "log10", + "opcode" : 39, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "log1p", + "opcode" : 40, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "logb", + "opcode" : 41, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "mad", + "opcode" : 42, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "maxmag", + "opcode" : 43, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "minmag", + "opcode" : 44, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "modf", + "opcode" : 45, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'iptr'" } + ] + }, + { + "opname" : "nan", + "opcode" : 46, + "operands" : [ + { "kind" : "IdRef", "name" : "'nancode'" } + ] + }, + { + "opname" : "nextafter", + "opcode" : 47, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "pow", + "opcode" : 48, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y" } + ] + }, + { + "opname" : "pown", + "opcode" : 49, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "powr", + "opcode" : 50, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "remainder", + "opcode" : 51, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "remquo", + "opcode" : 52, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'quo'" } + ] + }, + { + "opname" : "rint", + "opcode" : 53, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "rootn", + "opcode" : 54, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "round", + "opcode" : 55, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "rsqrt", + "opcode" : 56, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sin", + "opcode" : 57, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sincos", + "opcode" : 58, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'cosval'" } + ] + }, + { + "opname" : "sinh", + "opcode" : 59, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sinpi", + "opcode" : 60, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sqrt", + "opcode" : 61, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "tan", + "opcode" : 62, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "tanh", + "opcode" : 63, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "tanpi", + "opcode" : 64, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "tgamma", + "opcode" : 65, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "trunc", + "opcode" : 66, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_cos", + "opcode" : 67, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_divide", + "opcode" : 68, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "half_exp", + "opcode" : 69, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_exp2", + "opcode" : 70, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_exp10", + "opcode" : 71, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_log", + "opcode" : 72, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_log2", + "opcode" : 73, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_log10", + "opcode" : 74, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_powr", + "opcode" : 75, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "half_recip", + "opcode" : 76, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_rsqrt", + "opcode" : 77, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_sin", + "opcode" : 78, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_sqrt", + "opcode" : 79, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "half_tan", + "opcode" : 80, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_cos", + "opcode" : 81, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_divide", + "opcode" : 82, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "native_exp", + "opcode" : 83, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_exp2", + "opcode" : 84, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_exp10", + "opcode" : 85, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_log", + "opcode" : 86, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_log2", + "opcode" : 87, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_log10", + "opcode" : 88, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_powr", + "opcode" : 89, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "native_recip", + "opcode" : 90, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_rsqrt", + "opcode" : 91, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_sin", + "opcode" : 92, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_sqrt", + "opcode" : 93, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "native_tan", + "opcode" : 94, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "s_abs", + "opcode" : 141, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "s_abs_diff", + "opcode" : 142, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_add_sat", + "opcode" : 143, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_add_sat", + "opcode" : 144, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_hadd", + "opcode" : 145, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_hadd", + "opcode" : 146, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_rhadd", + "opcode" : 147, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_rhadd", + "opcode" : 148, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_clamp", + "opcode" : 149, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minval'" }, + { "kind" : "IdRef", "name" : "'maxval'" } + ] + }, + { + "opname" : "u_clamp", + "opcode" : 150, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minval'" }, + { "kind" : "IdRef", "name" : "'maxval'" } + ] + }, + { + "opname" : "clz", + "opcode" : 151, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "ctz", + "opcode" : 152, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "s_mad_hi", + "opcode" : 153, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "u_mad_sat", + "opcode" : 154, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ] + }, + { + "opname" : "s_mad_sat", + "opcode" : 155, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ] + }, + { + "opname" : "s_max", + "opcode" : 156, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_max", + "opcode" : 157, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_min", + "opcode" : 158, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_min", + "opcode" : 159, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "s_mul_hi", + "opcode" : 160, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "rotate", + "opcode" : 161, + "operands" : [ + { "kind" : "IdRef", "name" : "'v'" }, + { "kind" : "IdRef", "name" : "'i'" } + ] + }, + { + "opname" : "s_sub_sat", + "opcode" : 162, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_sub_sat", + "opcode" : 163, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_upsample", + "opcode" : 164, + "operands" : [ + { "kind" : "IdRef", "name" : "'hi'" }, + { "kind" : "IdRef", "name" : "'lo'" } + ] + }, + { + "opname" : "s_upsample", + "opcode" : 165, + "operands" : [ + { "kind" : "IdRef", "name" : "'hi'" }, + { "kind" : "IdRef", "name" : "'lo'" } + ] + }, + { + "opname" : "popcount", + "opcode" : 166, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "s_mad24", + "opcode" : 167, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ] + }, + { + "opname" : "u_mad24", + "opcode" : 168, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ] + }, + { + "opname" : "s_mul24", + "opcode" : 169, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_mul24", + "opcode" : 170, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_abs", + "opcode" : 201, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "u_abs_diff", + "opcode" : 202, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_mul_hi", + "opcode" : 203, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "u_mad_hi", + "opcode" : 204, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "fclamp", + "opcode" : 95, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'minval'" }, + { "kind" : "IdRef", "name" : "'maxval'" } + ] + }, + { + "opname" : "degrees", + "opcode" :96, + "operands" : [ + { "kind" : "IdRef", "name" : "'radians'" } + ] + }, + { + "opname" : "fmax_common", + "opcode" : 97, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "fmin_common", + "opcode" : 98, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ] + }, + { + "opname" : "mix", + "opcode" : 99, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'a'" } + ] + }, + { + "opname" : "radians", + "opcode" : 100, + "operands" : [ + { "kind" : "IdRef", "name" : "'degrees'" } + ] + }, + { + "opname" : "step", + "opcode" : 101, + "operands" : [ + { "kind" : "IdRef", "name" : "'edge'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "smoothstep", + "opcode" : 102, + "operands" : [ + { "kind" : "IdRef", "name" : "'edge0'" }, + { "kind" : "IdRef", "name" : "'edge1'" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "sign", + "opcode" : 103, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "cross", + "opcode" : 104, + "operands" : [ + { "kind" : "IdRef", "name" : "'p0'" }, + { "kind" : "IdRef", "name" : "'p1'" } + ] + }, + { + "opname" : "distance", + "opcode" : 105, + "operands" : [ + { "kind" : "IdRef", "name" : "'p0'" }, + { "kind" : "IdRef", "name" : "'p1'" } + ] + }, + { + "opname" : "length", + "opcode" : 106, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "normalize", + "opcode" : 107, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "fast_distance", + "opcode" : 108, + "operands" : [ + { "kind" : "IdRef", "name" : "'p0'" }, + { "kind" : "IdRef", "name" : "'p1'" } + ] + }, + { + "opname" : "fast_length", + "opcode" : 109, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "fast_normalize", + "opcode" : 110, + "operands" : [ + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "bitselect", + "opcode" : 186, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "select", + "opcode" : 187, + "operands" : [ + { "kind" : "IdRef", "name" : "'a'" }, + { "kind" : "IdRef", "name" : "'b'" }, + { "kind" : "IdRef", "name" : "'c'" } + ] + }, + { + "opname" : "vloadn", + "opcode" : 171, + "operands" : [ + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "LiteralInteger", "name" : "'n'" } + ] + }, + { + "opname" : "vstoren", + "opcode" : 172, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vload_half", + "opcode" : 173, + "operands" : [ + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vload_halfn", + "opcode" : 174, + "operands" : [ + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "LiteralInteger", "name" : "'n'" } + ] + }, + { + "opname" : "vstore_half", + "opcode" : 175, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vstore_half_r", + "opcode" : 176, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "FPRoundingMode", "name" : "'mode'" } + ] + }, + { + "opname" : "vstore_halfn", + "opcode" : 177, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vstore_halfn_r", + "opcode" : 178, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "FPRoundingMode", "name" : "'mode'" } + ] + }, + { + "opname" : "vloada_halfn", + "opcode" : 179, + "operands" : [ + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "LiteralInteger", "name" : "'n'" } + ] + }, + { + "opname" : "vstorea_halfn", + "opcode" : 180, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" } + ] + }, + { + "opname" : "vstorea_halfn_r", + "opcode" : 181, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" }, + { "kind" : "IdRef", "name" : "'p'" }, + { "kind" : "FPRoundingMode", "name" : "'mode'" } + ] + }, + { + "opname" : "shuffle", + "opcode" : 182, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'shuffle mask'" } + ] + }, + { + "opname" : "shuffle2", + "opcode" : 183, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'shuffle mask'" } + ] + }, + { + "opname" : "printf", + "opcode" : 184, + "operands" : [ + { "kind" : "IdRef", "name" : "'format'" }, + { "kind" : "IdRef", "name" : "'additional arguments'", "quantifier" : "*" } + ] + }, + { + "opname" : "prefetch", + "opcode" : 185, + "operands" : [ + { "kind" : "IdRef", "name" : "'ptr'" }, + { "kind" : "IdRef", "name" : "'num elements'" } + ] + } + ] +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/GLSL.std.450.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/GLSL.std.450.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/GLSL.std.450.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/GLSL.std.450.h 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,131 @@ +/* +** Copyright (c) 2014-2016 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +#ifndef GLSLstd450_H +#define GLSLstd450_H + +static const int GLSLstd450Version = 100; +static const int GLSLstd450Revision = 3; + +enum GLSLstd450 { + GLSLstd450Bad = 0, // Don't use + + GLSLstd450Round = 1, + GLSLstd450RoundEven = 2, + GLSLstd450Trunc = 3, + GLSLstd450FAbs = 4, + GLSLstd450SAbs = 5, + GLSLstd450FSign = 6, + GLSLstd450SSign = 7, + GLSLstd450Floor = 8, + GLSLstd450Ceil = 9, + GLSLstd450Fract = 10, + + GLSLstd450Radians = 11, + GLSLstd450Degrees = 12, + GLSLstd450Sin = 13, + GLSLstd450Cos = 14, + GLSLstd450Tan = 15, + GLSLstd450Asin = 16, + GLSLstd450Acos = 17, + GLSLstd450Atan = 18, + GLSLstd450Sinh = 19, + GLSLstd450Cosh = 20, + GLSLstd450Tanh = 21, + GLSLstd450Asinh = 22, + GLSLstd450Acosh = 23, + GLSLstd450Atanh = 24, + GLSLstd450Atan2 = 25, + + GLSLstd450Pow = 26, + GLSLstd450Exp = 27, + GLSLstd450Log = 28, + GLSLstd450Exp2 = 29, + GLSLstd450Log2 = 30, + GLSLstd450Sqrt = 31, + GLSLstd450InverseSqrt = 32, + + GLSLstd450Determinant = 33, + GLSLstd450MatrixInverse = 34, + + GLSLstd450Modf = 35, // second operand needs an OpVariable to write to + GLSLstd450ModfStruct = 36, // no OpVariable operand + GLSLstd450FMin = 37, + GLSLstd450UMin = 38, + GLSLstd450SMin = 39, + GLSLstd450FMax = 40, + GLSLstd450UMax = 41, + GLSLstd450SMax = 42, + GLSLstd450FClamp = 43, + GLSLstd450UClamp = 44, + GLSLstd450SClamp = 45, + GLSLstd450FMix = 46, + GLSLstd450IMix = 47, // Reserved + GLSLstd450Step = 48, + GLSLstd450SmoothStep = 49, + + GLSLstd450Fma = 50, + GLSLstd450Frexp = 51, // second operand needs an OpVariable to write to + GLSLstd450FrexpStruct = 52, // no OpVariable operand + GLSLstd450Ldexp = 53, + + GLSLstd450PackSnorm4x8 = 54, + GLSLstd450PackUnorm4x8 = 55, + GLSLstd450PackSnorm2x16 = 56, + GLSLstd450PackUnorm2x16 = 57, + GLSLstd450PackHalf2x16 = 58, + GLSLstd450PackDouble2x32 = 59, + GLSLstd450UnpackSnorm2x16 = 60, + GLSLstd450UnpackUnorm2x16 = 61, + GLSLstd450UnpackHalf2x16 = 62, + GLSLstd450UnpackSnorm4x8 = 63, + GLSLstd450UnpackUnorm4x8 = 64, + GLSLstd450UnpackDouble2x32 = 65, + + GLSLstd450Length = 66, + GLSLstd450Distance = 67, + GLSLstd450Cross = 68, + GLSLstd450Normalize = 69, + GLSLstd450FaceForward = 70, + GLSLstd450Reflect = 71, + GLSLstd450Refract = 72, + + GLSLstd450FindILsb = 73, + GLSLstd450FindSMsb = 74, + GLSLstd450FindUMsb = 75, + + GLSLstd450InterpolateAtCentroid = 76, + GLSLstd450InterpolateAtSample = 77, + GLSLstd450InterpolateAtOffset = 78, + + GLSLstd450NMin = 79, + GLSLstd450NMax = 80, + GLSLstd450NClamp = 81, + + GLSLstd450Count +}; + +#endif // #ifndef GLSLstd450_H diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/OpenCL.std.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/OpenCL.std.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/OpenCL.std.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/OpenCL.std.h 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,210 @@ +/* +** Copyright (c) 2015-2017 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +namespace OpenCLLIB { + +enum Entrypoints { + + // Section 2.1: Math extended instructions + Acos = 0, + Acosh = 1, + Acospi = 2, + Asin = 3, + Asinh = 4, + Asinpi = 5, + Atan = 6, + Atan2 = 7, + Atanh = 8, + Atanpi = 9, + Atan2pi = 10, + Cbrt = 11, + Ceil = 12, + Copysign = 13, + Cos = 14, + Cosh = 15, + Cospi = 16, + Erfc = 17, + Erf = 18, + Exp = 19, + Exp2 = 20, + Exp10 = 21, + Expm1 = 22, + Fabs = 23, + Fdim = 24, + Floor = 25, + Fma = 26, + Fmax = 27, + Fmin = 28, + Fmod = 29, + Fract = 30, + Frexp = 31, + Hypot = 32, + Ilogb = 33, + Ldexp = 34, + Lgamma = 35, + Lgamma_r = 36, + Log = 37, + Log2 = 38, + Log10 = 39, + Log1p = 40, + Logb = 41, + Mad = 42, + Maxmag = 43, + Minmag = 44, + Modf = 45, + Nan = 46, + Nextafter = 47, + Pow = 48, + Pown = 49, + Powr = 50, + Remainder = 51, + Remquo = 52, + Rint = 53, + Rootn = 54, + Round = 55, + Rsqrt = 56, + Sin = 57, + Sincos = 58, + Sinh = 59, + Sinpi = 60, + Sqrt = 61, + Tan = 62, + Tanh = 63, + Tanpi = 64, + Tgamma = 65, + Trunc = 66, + Half_cos = 67, + Half_divide = 68, + Half_exp = 69, + Half_exp2 = 70, + Half_exp10 = 71, + Half_log = 72, + Half_log2 = 73, + Half_log10 = 74, + Half_powr = 75, + Half_recip = 76, + Half_rsqrt = 77, + Half_sin = 78, + Half_sqrt = 79, + Half_tan = 80, + Native_cos = 81, + Native_divide = 82, + Native_exp = 83, + Native_exp2 = 84, + Native_exp10 = 85, + Native_log = 86, + Native_log2 = 87, + Native_log10 = 88, + Native_powr = 89, + Native_recip = 90, + Native_rsqrt = 91, + Native_sin = 92, + Native_sqrt = 93, + Native_tan = 94, + + // Section 2.2: Integer instructions + SAbs = 141, + SAbs_diff = 142, + SAdd_sat = 143, + UAdd_sat = 144, + SHadd = 145, + UHadd = 146, + SRhadd = 147, + URhadd = 148, + SClamp = 149, + UClamp = 150, + Clz = 151, + Ctz = 152, + SMad_hi = 153, + UMad_sat = 154, + SMad_sat = 155, + SMax = 156, + UMax = 157, + SMin = 158, + UMin = 159, + SMul_hi = 160, + Rotate = 161, + SSub_sat = 162, + USub_sat = 163, + U_Upsample = 164, + S_Upsample = 165, + Popcount = 166, + SMad24 = 167, + UMad24 = 168, + SMul24 = 169, + UMul24 = 170, + UAbs = 201, + UAbs_diff = 202, + UMul_hi = 203, + UMad_hi = 204, + + // Section 2.3: Common instructions + FClamp = 95, + Degrees = 96, + FMax_common = 97, + FMin_common = 98, + Mix = 99, + Radians = 100, + Step = 101, + Smoothstep = 102, + Sign = 103, + + // Section 2.4: Geometric instructions + Cross = 104, + Distance = 105, + Length = 106, + Normalize = 107, + Fast_distance = 108, + Fast_length = 109, + Fast_normalize = 110, + + // Section 2.5: Relational instructions + Bitselect = 186, + Select = 187, + + // Section 2.6: Vector Data Load and Store instructions + Vloadn = 171, + Vstoren = 172, + Vload_half = 173, + Vload_halfn = 174, + Vstore_half = 175, + Vstore_half_r = 176, + Vstore_halfn = 177, + Vstore_halfn_r = 178, + Vloada_halfn = 179, + Vstorea_halfn = 180, + Vstorea_halfn_r = 181, + + // Section 2.7: Miscellaneous Vector instructions + Shuffle = 182, + Shuffle2 = 183, + + // Section 2.8: Misc instructions + Printf = 184, + Prefetch = 185, +}; + +} // end namespace OpenCLLIB diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.core.grammar.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.core.grammar.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.core.grammar.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.core.grammar.json 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,6788 @@ +{ + "copyright" : [ + "Copyright (c) 2014-2016 The Khronos Group Inc.", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and/or associated documentation files (the \"Materials\"),", + "to deal in the Materials without restriction, including without limitation", + "the rights to use, copy, modify, merge, publish, distribute, sublicense,", + "and/or sell copies of the Materials, and to permit persons to whom the", + "Materials are furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Materials.", + "", + "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", + "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", + "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", + "", + "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", + "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", + "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", + "IN THE MATERIALS." + ], + "magic_number" : "0x07230203", + "major_version" : 1, + "minor_version" : 3, + "revision" : 1, + "instructions" : [ + { + "opname" : "OpNop", + "opcode" : 0 + }, + { + "opname" : "OpUndef", + "opcode" : 1, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpSourceContinued", + "opcode" : 2, + "operands" : [ + { "kind" : "LiteralString", "name" : "'Continued Source'" } + ] + }, + { + "opname" : "OpSource", + "opcode" : 3, + "operands" : [ + { "kind" : "SourceLanguage" }, + { "kind" : "LiteralInteger", "name" : "'Version'" }, + { "kind" : "IdRef", "quantifier" : "?", "name" : "'File'" }, + { "kind" : "LiteralString", "quantifier" : "?", "name" : "'Source'" } + ] + }, + { + "opname" : "OpSourceExtension", + "opcode" : 4, + "operands" : [ + { "kind" : "LiteralString", "name" : "'Extension'" } + ] + }, + { + "opname" : "OpName", + "opcode" : 5, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "LiteralString", "name" : "'Name'" } + ] + }, + { + "opname" : "OpMemberName", + "opcode" : 6, + "operands" : [ + { "kind" : "IdRef", "name" : "'Type'" }, + { "kind" : "LiteralInteger", "name" : "'Member'" }, + { "kind" : "LiteralString", "name" : "'Name'" } + ] + }, + { + "opname" : "OpString", + "opcode" : 7, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralString", "name" : "'String'" } + ] + }, + { + "opname" : "OpLine", + "opcode" : 8, + "operands" : [ + { "kind" : "IdRef", "name" : "'File'" }, + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "LiteralInteger", "name" : "'Column'" } + ] + }, + { + "opname" : "OpExtension", + "opcode" : 10, + "operands" : [ + { "kind" : "LiteralString", "name" : "'Name'" } + ] + }, + { + "opname" : "OpExtInstImport", + "opcode" : 11, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralString", "name" : "'Name'" } + ] + }, + { + "opname" : "OpExtInst", + "opcode" : 12, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Set'" }, + { "kind" : "LiteralExtInstInteger", "name" : "'Instruction'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Operand 1', +\n'Operand 2', +\n..." } + ] + }, + { + "opname" : "OpMemoryModel", + "opcode" : 14, + "operands" : [ + { "kind" : "AddressingModel" }, + { "kind" : "MemoryModel" } + ] + }, + { + "opname" : "OpEntryPoint", + "opcode" : 15, + "operands" : [ + { "kind" : "ExecutionModel" }, + { "kind" : "IdRef", "name" : "'Entry Point'" }, + { "kind" : "LiteralString", "name" : "'Name'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Interface'" } + ] + }, + { + "opname" : "OpExecutionMode", + "opcode" : 16, + "operands" : [ + { "kind" : "IdRef", "name" : "'Entry Point'" }, + { "kind" : "ExecutionMode", "name" : "'Mode'" } + ] + }, + { + "opname" : "OpCapability", + "opcode" : 17, + "operands" : [ + { "kind" : "Capability", "name" : "'Capability'" } + ] + }, + { + "opname" : "OpTypeVoid", + "opcode" : 19, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpTypeBool", + "opcode" : 20, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpTypeInt", + "opcode" : 21, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralInteger", "name" : "'Width'" }, + { "kind" : "LiteralInteger", "name" : "'Signedness'" } + ] + }, + { + "opname" : "OpTypeFloat", + "opcode" : 22, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralInteger", "name" : "'Width'" } + ] + }, + { + "opname" : "OpTypeVector", + "opcode" : 23, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Component Type'" }, + { "kind" : "LiteralInteger", "name" : "'Component Count'" } + ] + }, + { + "opname" : "OpTypeMatrix", + "opcode" : 24, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Column Type'" }, + { "kind" : "LiteralInteger", "name" : "'Column Count'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpTypeImage", + "opcode" : 25, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Type'" }, + { "kind" : "Dim" }, + { "kind" : "LiteralInteger", "name" : "'Depth'" }, + { "kind" : "LiteralInteger", "name" : "'Arrayed'" }, + { "kind" : "LiteralInteger", "name" : "'MS'" }, + { "kind" : "LiteralInteger", "name" : "'Sampled'" }, + { "kind" : "ImageFormat" }, + { "kind" : "AccessQualifier", "quantifier" : "?" } + ] + }, + { + "opname" : "OpTypeSampler", + "opcode" : 26, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpTypeSampledImage", + "opcode" : 27, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image Type'" } + ] + }, + { + "opname" : "OpTypeArray", + "opcode" : 28, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Element Type'" }, + { "kind" : "IdRef", "name" : "'Length'" } + ] + }, + { + "opname" : "OpTypeRuntimeArray", + "opcode" : 29, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Element Type'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpTypeStruct", + "opcode" : 30, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Member 0 type', +\n'member 1 type', +\n..." } + ] + }, + { + "opname" : "OpTypeOpaque", + "opcode" : 31, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralString", "name" : "The name of the opaque type." } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpTypePointer", + "opcode" : 32, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "StorageClass" }, + { "kind" : "IdRef", "name" : "'Type'" } + ] + }, + { + "opname" : "OpTypeFunction", + "opcode" : 33, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Return Type'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Parameter 0 Type', +\n'Parameter 1 Type', +\n..." } + ] + }, + { + "opname" : "OpTypeEvent", + "opcode" : 34, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpTypeDeviceEvent", + "opcode" : 35, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpTypeReserveId", + "opcode" : 36, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpTypeQueue", + "opcode" : 37, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpTypePipe", + "opcode" : 38, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "AccessQualifier", "name" : "'Qualifier'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpTypeForwardPointer", + "opcode" : 39, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer Type'" }, + { "kind" : "StorageClass" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpConstantTrue", + "opcode" : 41, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpConstantFalse", + "opcode" : 42, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpConstant", + "opcode" : 43, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } + ] + }, + { + "opname" : "OpConstantComposite", + "opcode" : 44, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } + ] + }, + { + "opname" : "OpConstantSampler", + "opcode" : 45, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "SamplerAddressingMode" }, + { "kind" : "LiteralInteger", "name" : "'Param'" }, + { "kind" : "SamplerFilterMode" } + ], + "capabilities" : [ "LiteralSampler" ] + }, + { + "opname" : "OpConstantNull", + "opcode" : 46, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpSpecConstantTrue", + "opcode" : 48, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpSpecConstantFalse", + "opcode" : 49, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpSpecConstant", + "opcode" : 50, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } + ] + }, + { + "opname" : "OpSpecConstantComposite", + "opcode" : 51, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } + ] + }, + { + "opname" : "OpSpecConstantOp", + "opcode" : 52, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "LiteralSpecConstantOpInteger", "name" : "'Opcode'" } + ] + }, + { + "opname" : "OpFunction", + "opcode" : 54, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "FunctionControl" }, + { "kind" : "IdRef", "name" : "'Function Type'" } + ] + }, + { + "opname" : "OpFunctionParameter", + "opcode" : 55, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpFunctionEnd", + "opcode" : 56 + }, + { + "opname" : "OpFunctionCall", + "opcode" : 57, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Function'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Argument 0', +\n'Argument 1', +\n..." } + ] + }, + { + "opname" : "OpVariable", + "opcode" : 59, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "StorageClass" }, + { "kind" : "IdRef", "quantifier" : "?", "name" : "'Initializer'" } + ] + }, + { + "opname" : "OpImageTexelPointer", + "opcode" : 60, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Sample'" } + ] + }, + { + "opname" : "OpLoad", + "opcode" : 61, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "MemoryAccess", "quantifier" : "?" } + ] + }, + { + "opname" : "OpStore", + "opcode" : 62, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Object'" }, + { "kind" : "MemoryAccess", "quantifier" : "?" } + ] + }, + { + "opname" : "OpCopyMemory", + "opcode" : 63, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "MemoryAccess", "quantifier" : "?" } + ] + }, + { + "opname" : "OpCopyMemorySized", + "opcode" : 64, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "IdRef", "name" : "'Size'" }, + { "kind" : "MemoryAccess", "quantifier" : "?" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpAccessChain", + "opcode" : 65, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpInBoundsAccessChain", + "opcode" : 66, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpPtrAccessChain", + "opcode" : 67, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Element'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ], + "capabilities" : [ + "Addresses", + "VariablePointers", + "VariablePointersStorageBuffer" + ] + }, + { + "opname" : "OpArrayLength", + "opcode" : 68, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Structure'" }, + { "kind" : "LiteralInteger", "name" : "'Array member'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpGenericPtrMemSemantics", + "opcode" : 69, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpInBoundsPtrAccessChain", + "opcode" : 70, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Element'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpDecorate", + "opcode" : 71, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "Decoration" } + ] + }, + { + "opname" : "OpMemberDecorate", + "opcode" : 72, + "operands" : [ + { "kind" : "IdRef", "name" : "'Structure Type'" }, + { "kind" : "LiteralInteger", "name" : "'Member'" }, + { "kind" : "Decoration" } + ] + }, + { + "opname" : "OpDecorationGroup", + "opcode" : 73, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpGroupDecorate", + "opcode" : 74, + "operands" : [ + { "kind" : "IdRef", "name" : "'Decoration Group'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Targets'" } + ] + }, + { + "opname" : "OpGroupMemberDecorate", + "opcode" : 75, + "operands" : [ + { "kind" : "IdRef", "name" : "'Decoration Group'" }, + { "kind" : "PairIdRefLiteralInteger", "quantifier" : "*", "name" : "'Targets'" } + ] + }, + { + "opname" : "OpVectorExtractDynamic", + "opcode" : 77, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" }, + { "kind" : "IdRef", "name" : "'Index'" } + ] + }, + { + "opname" : "OpVectorInsertDynamic", + "opcode" : 78, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" }, + { "kind" : "IdRef", "name" : "'Component'" }, + { "kind" : "IdRef", "name" : "'Index'" } + ] + }, + { + "opname" : "OpVectorShuffle", + "opcode" : 79, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector 1'" }, + { "kind" : "IdRef", "name" : "'Vector 2'" }, + { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Components'" } + ] + }, + { + "opname" : "OpCompositeConstruct", + "opcode" : 80, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } + ] + }, + { + "opname" : "OpCompositeExtract", + "opcode" : 81, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Composite'" }, + { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpCompositeInsert", + "opcode" : 82, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Object'" }, + { "kind" : "IdRef", "name" : "'Composite'" }, + { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpCopyObject", + "opcode" : 83, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpTranspose", + "opcode" : 84, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Matrix'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpSampledImage", + "opcode" : 86, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Sampler'" } + ] + }, + { + "opname" : "OpImageSampleImplicitLod", + "opcode" : 87, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleExplicitLod", + "opcode" : 88, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands" } + ] + }, + { + "opname" : "OpImageSampleDrefImplicitLod", + "opcode" : 89, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleDrefExplicitLod", + "opcode" : 90, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleProjImplicitLod", + "opcode" : 91, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleProjExplicitLod", + "opcode" : 92, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleProjDrefImplicitLod", + "opcode" : 93, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageSampleProjDrefExplicitLod", + "opcode" : 94, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageFetch", + "opcode" : 95, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ] + }, + { + "opname" : "OpImageGather", + "opcode" : 96, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Component'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageDrefGather", + "opcode" : 97, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpImageRead", + "opcode" : 98, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ] + }, + { + "opname" : "OpImageWrite", + "opcode" : 99, + "operands" : [ + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Texel'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ] + }, + { + "opname" : "OpImage", + "opcode" : 100, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" } + ] + }, + { + "opname" : "OpImageQueryFormat", + "opcode" : 101, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpImageQueryOrder", + "opcode" : 102, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpImageQuerySizeLod", + "opcode" : 103, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Level of Detail'" } + ], + "capabilities" : [ "Kernel", "ImageQuery" ] + }, + { + "opname" : "OpImageQuerySize", + "opcode" : 104, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel", "ImageQuery" ] + }, + { + "opname" : "OpImageQueryLod", + "opcode" : 105, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" } + ], + "capabilities" : [ "ImageQuery" ] + }, + { + "opname" : "OpImageQueryLevels", + "opcode" : 106, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel", "ImageQuery" ] + }, + { + "opname" : "OpImageQuerySamples", + "opcode" : 107, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" } + ], + "capabilities" : [ "Kernel", "ImageQuery" ] + }, + { + "opname" : "OpConvertFToU", + "opcode" : 109, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Float Value'" } + ] + }, + { + "opname" : "OpConvertFToS", + "opcode" : 110, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Float Value'" } + ] + }, + { + "opname" : "OpConvertSToF", + "opcode" : 111, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Signed Value'" } + ] + }, + { + "opname" : "OpConvertUToF", + "opcode" : 112, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Unsigned Value'" } + ] + }, + { + "opname" : "OpUConvert", + "opcode" : 113, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Unsigned Value'" } + ] + }, + { + "opname" : "OpSConvert", + "opcode" : 114, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Signed Value'" } + ] + }, + { + "opname" : "OpFConvert", + "opcode" : 115, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Float Value'" } + ] + }, + { + "opname" : "OpQuantizeToF16", + "opcode" : 116, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpConvertPtrToU", + "opcode" : 117, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpSatConvertSToU", + "opcode" : 118, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Signed Value'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpSatConvertUToS", + "opcode" : 119, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Unsigned Value'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpConvertUToPtr", + "opcode" : 120, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Integer Value'" } + ], + "capabilities" : [ "Addresses" ] + }, + { + "opname" : "OpPtrCastToGeneric", + "opcode" : 121, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGenericCastToPtr", + "opcode" : 122, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGenericCastToPtrExplicit", + "opcode" : 123, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "StorageClass", "name" : "'Storage'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpBitcast", + "opcode" : 124, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpSNegate", + "opcode" : 126, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpFNegate", + "opcode" : 127, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpIAdd", + "opcode" : 128, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFAdd", + "opcode" : 129, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpISub", + "opcode" : 130, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFSub", + "opcode" : 131, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpIMul", + "opcode" : 132, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFMul", + "opcode" : 133, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUDiv", + "opcode" : 134, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSDiv", + "opcode" : 135, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFDiv", + "opcode" : 136, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUMod", + "opcode" : 137, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSRem", + "opcode" : 138, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSMod", + "opcode" : 139, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFRem", + "opcode" : 140, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFMod", + "opcode" : 141, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpVectorTimesScalar", + "opcode" : 142, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" }, + { "kind" : "IdRef", "name" : "'Scalar'" } + ] + }, + { + "opname" : "OpMatrixTimesScalar", + "opcode" : 143, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Matrix'" }, + { "kind" : "IdRef", "name" : "'Scalar'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpVectorTimesMatrix", + "opcode" : 144, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" }, + { "kind" : "IdRef", "name" : "'Matrix'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpMatrixTimesVector", + "opcode" : 145, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Matrix'" }, + { "kind" : "IdRef", "name" : "'Vector'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpMatrixTimesMatrix", + "opcode" : 146, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'LeftMatrix'" }, + { "kind" : "IdRef", "name" : "'RightMatrix'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpOuterProduct", + "opcode" : 147, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector 1'" }, + { "kind" : "IdRef", "name" : "'Vector 2'" } + ], + "capabilities" : [ "Matrix" ] + }, + { + "opname" : "OpDot", + "opcode" : 148, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector 1'" }, + { "kind" : "IdRef", "name" : "'Vector 2'" } + ] + }, + { + "opname" : "OpIAddCarry", + "opcode" : 149, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpISubBorrow", + "opcode" : 150, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUMulExtended", + "opcode" : 151, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSMulExtended", + "opcode" : 152, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpAny", + "opcode" : 154, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" } + ] + }, + { + "opname" : "OpAll", + "opcode" : 155, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Vector'" } + ] + }, + { + "opname" : "OpIsNan", + "opcode" : 156, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "OpIsInf", + "opcode" : 157, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ] + }, + { + "opname" : "OpIsFinite", + "opcode" : 158, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpIsNormal", + "opcode" : 159, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpSignBitSet", + "opcode" : 160, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpLessOrGreater", + "opcode" : 161, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpOrdered", + "opcode" : 162, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpUnordered", + "opcode" : 163, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpLogicalEqual", + "opcode" : 164, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpLogicalNotEqual", + "opcode" : 165, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpLogicalOr", + "opcode" : 166, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpLogicalAnd", + "opcode" : 167, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpLogicalNot", + "opcode" : 168, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpSelect", + "opcode" : 169, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Condition'" }, + { "kind" : "IdRef", "name" : "'Object 1'" }, + { "kind" : "IdRef", "name" : "'Object 2'" } + ] + }, + { + "opname" : "OpIEqual", + "opcode" : 170, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpINotEqual", + "opcode" : 171, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUGreaterThan", + "opcode" : 172, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSGreaterThan", + "opcode" : 173, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpUGreaterThanEqual", + "opcode" : 174, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSGreaterThanEqual", + "opcode" : 175, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpULessThan", + "opcode" : 176, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSLessThan", + "opcode" : 177, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpULessThanEqual", + "opcode" : 178, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpSLessThanEqual", + "opcode" : 179, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdEqual", + "opcode" : 180, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordEqual", + "opcode" : 181, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdNotEqual", + "opcode" : 182, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordNotEqual", + "opcode" : 183, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdLessThan", + "opcode" : 184, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordLessThan", + "opcode" : 185, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdGreaterThan", + "opcode" : 186, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordGreaterThan", + "opcode" : 187, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdLessThanEqual", + "opcode" : 188, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordLessThanEqual", + "opcode" : 189, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFOrdGreaterThanEqual", + "opcode" : 190, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpFUnordGreaterThanEqual", + "opcode" : 191, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpShiftRightLogical", + "opcode" : 194, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Shift'" } + ] + }, + { + "opname" : "OpShiftRightArithmetic", + "opcode" : 195, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Shift'" } + ] + }, + { + "opname" : "OpShiftLeftLogical", + "opcode" : 196, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Shift'" } + ] + }, + { + "opname" : "OpBitwiseOr", + "opcode" : 197, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpBitwiseXor", + "opcode" : 198, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpBitwiseAnd", + "opcode" : 199, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand 1'" }, + { "kind" : "IdRef", "name" : "'Operand 2'" } + ] + }, + { + "opname" : "OpNot", + "opcode" : 200, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Operand'" } + ] + }, + { + "opname" : "OpBitFieldInsert", + "opcode" : 201, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Insert'" }, + { "kind" : "IdRef", "name" : "'Offset'" }, + { "kind" : "IdRef", "name" : "'Count'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpBitFieldSExtract", + "opcode" : 202, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Offset'" }, + { "kind" : "IdRef", "name" : "'Count'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpBitFieldUExtract", + "opcode" : 203, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Offset'" }, + { "kind" : "IdRef", "name" : "'Count'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpBitReverse", + "opcode" : 204, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpBitCount", + "opcode" : 205, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" } + ] + }, + { + "opname" : "OpDPdx", + "opcode" : 207, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpDPdy", + "opcode" : 208, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpFwidth", + "opcode" : 209, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpDPdxFine", + "opcode" : 210, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpDPdyFine", + "opcode" : 211, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpFwidthFine", + "opcode" : 212, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpDPdxCoarse", + "opcode" : 213, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpDPdyCoarse", + "opcode" : 214, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpFwidthCoarse", + "opcode" : 215, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'P'" } + ], + "capabilities" : [ "DerivativeControl" ] + }, + { + "opname" : "OpEmitVertex", + "opcode" : 218, + "capabilities" : [ "Geometry" ] + }, + { + "opname" : "OpEndPrimitive", + "opcode" : 219, + "capabilities" : [ "Geometry" ] + }, + { + "opname" : "OpEmitStreamVertex", + "opcode" : 220, + "operands" : [ + { "kind" : "IdRef", "name" : "'Stream'" } + ], + "capabilities" : [ "GeometryStreams" ] + }, + { + "opname" : "OpEndStreamPrimitive", + "opcode" : 221, + "operands" : [ + { "kind" : "IdRef", "name" : "'Stream'" } + ], + "capabilities" : [ "GeometryStreams" ] + }, + { + "opname" : "OpControlBarrier", + "opcode" : 224, + "operands" : [ + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdScope", "name" : "'Memory'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpMemoryBarrier", + "opcode" : 225, + "operands" : [ + { "kind" : "IdScope", "name" : "'Memory'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpAtomicLoad", + "opcode" : 227, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpAtomicStore", + "opcode" : 228, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicExchange", + "opcode" : 229, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicCompareExchange", + "opcode" : 230, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, + { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Comparator'" } + ] + }, + { + "opname" : "OpAtomicCompareExchangeWeak", + "opcode" : 231, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, + { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Comparator'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpAtomicIIncrement", + "opcode" : 232, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpAtomicIDecrement", + "opcode" : 233, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ] + }, + { + "opname" : "OpAtomicIAdd", + "opcode" : 234, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicISub", + "opcode" : 235, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicSMin", + "opcode" : 236, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicUMin", + "opcode" : 237, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicSMax", + "opcode" : 238, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicUMax", + "opcode" : 239, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicAnd", + "opcode" : 240, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicOr", + "opcode" : 241, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpAtomicXor", + "opcode" : 242, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpPhi", + "opcode" : 245, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "PairIdRefIdRef", "quantifier" : "*", "name" : "'Variable, Parent, ...'" } + ] + }, + { + "opname" : "OpLoopMerge", + "opcode" : 246, + "operands" : [ + { "kind" : "IdRef", "name" : "'Merge Block'" }, + { "kind" : "IdRef", "name" : "'Continue Target'" }, + { "kind" : "LoopControl" } + ] + }, + { + "opname" : "OpSelectionMerge", + "opcode" : 247, + "operands" : [ + { "kind" : "IdRef", "name" : "'Merge Block'" }, + { "kind" : "SelectionControl" } + ] + }, + { + "opname" : "OpLabel", + "opcode" : 248, + "operands" : [ + { "kind" : "IdResult" } + ] + }, + { + "opname" : "OpBranch", + "opcode" : 249, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target Label'" } + ] + }, + { + "opname" : "OpBranchConditional", + "opcode" : 250, + "operands" : [ + { "kind" : "IdRef", "name" : "'Condition'" }, + { "kind" : "IdRef", "name" : "'True Label'" }, + { "kind" : "IdRef", "name" : "'False Label'" }, + { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Branch weights'" } + ] + }, + { + "opname" : "OpSwitch", + "opcode" : 251, + "operands" : [ + { "kind" : "IdRef", "name" : "'Selector'" }, + { "kind" : "IdRef", "name" : "'Default'" }, + { "kind" : "PairLiteralIntegerIdRef", "quantifier" : "*", "name" : "'Target'" } + ] + }, + { + "opname" : "OpKill", + "opcode" : 252, + "capabilities" : [ "Shader" ] + }, + { + "opname" : "OpReturn", + "opcode" : 253 + }, + { + "opname" : "OpReturnValue", + "opcode" : 254, + "operands" : [ + { "kind" : "IdRef", "name" : "'Value'" } + ] + }, + { + "opname" : "OpUnreachable", + "opcode" : 255 + }, + { + "opname" : "OpLifetimeStart", + "opcode" : 256, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "LiteralInteger", "name" : "'Size'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpLifetimeStop", + "opcode" : 257, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "LiteralInteger", "name" : "'Size'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGroupAsyncCopy", + "opcode" : 259, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Destination'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "IdRef", "name" : "'Num Elements'" }, + { "kind" : "IdRef", "name" : "'Stride'" }, + { "kind" : "IdRef", "name" : "'Event'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGroupWaitEvents", + "opcode" : 260, + "operands" : [ + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Num Events'" }, + { "kind" : "IdRef", "name" : "'Events List'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpGroupAll", + "opcode" : 261, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupAny", + "opcode" : 262, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupBroadcast", + "opcode" : 263, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'LocalId'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupIAdd", + "opcode" : 264, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFAdd", + "opcode" : 265, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFMin", + "opcode" : 266, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupUMin", + "opcode" : 267, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupSMin", + "opcode" : 268, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupFMax", + "opcode" : 269, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupUMax", + "opcode" : 270, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpGroupSMax", + "opcode" : 271, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ] + }, + { + "opname" : "OpReadPipe", + "opcode" : 274, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpWritePipe", + "opcode" : 275, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpReservedReadPipe", + "opcode" : 276, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Index'" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpReservedWritePipe", + "opcode" : 277, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Index'" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpReserveReadPipePackets", + "opcode" : 278, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Num Packets'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpReserveWritePipePackets", + "opcode" : 279, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Num Packets'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpCommitReadPipe", + "opcode" : 280, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpCommitWritePipe", + "opcode" : 281, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpIsValidReserveId", + "opcode" : 282, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGetNumPipePackets", + "opcode" : 283, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGetMaxPipePackets", + "opcode" : 284, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGroupReserveReadPipePackets", + "opcode" : 285, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Num Packets'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGroupReserveWritePipePackets", + "opcode" : 286, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Num Packets'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGroupCommitReadPipe", + "opcode" : 287, + "operands" : [ + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpGroupCommitWritePipe", + "opcode" : 288, + "operands" : [ + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Pipe'" }, + { "kind" : "IdRef", "name" : "'Reserve Id'" }, + { "kind" : "IdRef", "name" : "'Packet Size'" }, + { "kind" : "IdRef", "name" : "'Packet Alignment'" } + ], + "capabilities" : [ "Pipes" ] + }, + { + "opname" : "OpEnqueueMarker", + "opcode" : 291, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Queue'" }, + { "kind" : "IdRef", "name" : "'Num Events'" }, + { "kind" : "IdRef", "name" : "'Wait Events'" }, + { "kind" : "IdRef", "name" : "'Ret Event'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpEnqueueKernel", + "opcode" : 292, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Queue'" }, + { "kind" : "IdRef", "name" : "'Flags'" }, + { "kind" : "IdRef", "name" : "'ND Range'" }, + { "kind" : "IdRef", "name" : "'Num Events'" }, + { "kind" : "IdRef", "name" : "'Wait Events'" }, + { "kind" : "IdRef", "name" : "'Ret Event'" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Local Size'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetKernelNDrangeSubGroupCount", + "opcode" : 293, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'ND Range'" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetKernelNDrangeMaxSubGroupSize", + "opcode" : 294, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'ND Range'" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetKernelWorkGroupSize", + "opcode" : 295, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetKernelPreferredWorkGroupSizeMultiple", + "opcode" : 296, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpRetainEvent", + "opcode" : 297, + "operands" : [ + { "kind" : "IdRef", "name" : "'Event'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpReleaseEvent", + "opcode" : 298, + "operands" : [ + { "kind" : "IdRef", "name" : "'Event'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpCreateUserEvent", + "opcode" : 299, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpIsValidEvent", + "opcode" : 300, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Event'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpSetUserEventStatus", + "opcode" : 301, + "operands" : [ + { "kind" : "IdRef", "name" : "'Event'" }, + { "kind" : "IdRef", "name" : "'Status'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpCaptureEventProfilingInfo", + "opcode" : 302, + "operands" : [ + { "kind" : "IdRef", "name" : "'Event'" }, + { "kind" : "IdRef", "name" : "'Profiling Info'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpGetDefaultQueue", + "opcode" : 303, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpBuildNDRange", + "opcode" : 304, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'GlobalWorkSize'" }, + { "kind" : "IdRef", "name" : "'LocalWorkSize'" }, + { "kind" : "IdRef", "name" : "'GlobalWorkOffset'" } + ], + "capabilities" : [ "DeviceEnqueue" ] + }, + { + "opname" : "OpImageSparseSampleImplicitLod", + "opcode" : 305, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleExplicitLod", + "opcode" : 306, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleDrefImplicitLod", + "opcode" : 307, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleDrefExplicitLod", + "opcode" : 308, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseSampleProjImplicitLod", + "opcode" : 309, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ], + "version" : "None" + }, + { + "opname" : "OpImageSparseSampleProjExplicitLod", + "opcode" : 310, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "SparseResidency" ], + "version" : "None" + }, + { + "opname" : "OpImageSparseSampleProjDrefImplicitLod", + "opcode" : 311, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ], + "version" : "None" + }, + { + "opname" : "OpImageSparseSampleProjDrefExplicitLod", + "opcode" : 312, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands" } + ], + "capabilities" : [ "SparseResidency" ], + "version" : "None" + }, + { + "opname" : "OpImageSparseFetch", + "opcode" : 313, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseGather", + "opcode" : 314, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Component'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseDrefGather", + "opcode" : 315, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'D~ref~'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpImageSparseTexelsResident", + "opcode" : 316, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Resident Code'" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpNoLine", + "opcode" : 317 + }, + { + "opname" : "OpAtomicFlagTestAndSet", + "opcode" : 318, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpAtomicFlagClear", + "opcode" : 319, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ], + "capabilities" : [ "Kernel" ] + }, + { + "opname" : "OpImageSparseRead", + "opcode" : 320, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "ImageOperands", "quantifier" : "?" } + ], + "capabilities" : [ "SparseResidency" ] + }, + { + "opname" : "OpSizeOf", + "opcode" : 321, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" } + ], + "capabilities" : [ "Addresses" ], + "version" : "1.1" + }, + { + "opname" : "OpTypePipeStorage", + "opcode" : 322, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "PipeStorage" ], + "version" : "1.1" + }, + { + "opname" : "OpConstantPipeStorage", + "opcode" : 323, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "LiteralInteger", "name" : "'Packet Size'" }, + { "kind" : "LiteralInteger", "name" : "'Packet Alignment'" }, + { "kind" : "LiteralInteger", "name" : "'Capacity'" } + ], + "capabilities" : [ "PipeStorage" ], + "version" : "1.1" + }, + { + "opname" : "OpCreatePipeFromPipeStorage", + "opcode" : 324, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pipe Storage'" } + ], + "capabilities" : [ "PipeStorage" ], + "version" : "1.1" + }, + { + "opname" : "OpGetKernelLocalSizeForSubgroupCount", + "opcode" : 325, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Subgroup Count'" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "SubgroupDispatch" ], + "version" : "1.1" + }, + { + "opname" : "OpGetKernelMaxNumSubgroups", + "opcode" : 326, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Invoke'" }, + { "kind" : "IdRef", "name" : "'Param'" }, + { "kind" : "IdRef", "name" : "'Param Size'" }, + { "kind" : "IdRef", "name" : "'Param Align'" } + ], + "capabilities" : [ "SubgroupDispatch" ], + "version" : "1.1" + }, + { + "opname" : "OpTypeNamedBarrier", + "opcode" : 327, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "NamedBarrier" ], + "version" : "1.1" + }, + { + "opname" : "OpNamedBarrierInitialize", + "opcode" : 328, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Subgroup Count'" } + ], + "capabilities" : [ "NamedBarrier" ], + "version" : "1.1" + }, + { + "opname" : "OpMemoryNamedBarrier", + "opcode" : 329, + "operands" : [ + { "kind" : "IdRef", "name" : "'Named Barrier'" }, + { "kind" : "IdScope", "name" : "'Memory'" }, + { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } + ], + "capabilities" : [ "NamedBarrier" ], + "version" : "1.1" + }, + { + "opname" : "OpModuleProcessed", + "opcode" : 330, + "operands" : [ + { "kind" : "LiteralString", "name" : "'Process'" } + ], + "version" : "1.1" + }, + { + "opname" : "OpExecutionModeId", + "opcode" : 331, + "operands" : [ + { "kind" : "IdRef", "name" : "'Entry Point'" }, + { "kind" : "ExecutionMode", "name" : "'Mode'" } + ], + "version" : "1.2" + }, + { + "opname" : "OpDecorateId", + "opcode" : 332, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "Decoration" } + ], + "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ], + "version" : "1.2" + }, + { + "opname" : "OpGroupNonUniformElect", + "opcode" : 333, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" } + ], + "capabilities" : [ "GroupNonUniform" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformAll", + "opcode" : 334, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "GroupNonUniformVote" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformAny", + "opcode" : 335, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "GroupNonUniformVote" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformAllEqual", + "opcode" : 336, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "GroupNonUniformVote" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformBroadcast", + "opcode" : 337, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Id'" } + ], + "capabilities" : [ "GroupNonUniformBallot" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformBroadcastFirst", + "opcode" : 338, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "GroupNonUniformBallot" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformBallot", + "opcode" : 339, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "GroupNonUniformBallot" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformInverseBallot", + "opcode" : 340, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "GroupNonUniformBallot" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformBallotBitExtract", + "opcode" : 341, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Index'" } + ], + "capabilities" : [ "GroupNonUniformBallot" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformBallotBitCount", + "opcode" : 342, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "GroupNonUniformBallot" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformBallotFindLSB", + "opcode" : 343, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "GroupNonUniformBallot" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformBallotFindMSB", + "opcode" : 344, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "GroupNonUniformBallot" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformShuffle", + "opcode" : 345, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Id'" } + ], + "capabilities" : [ "GroupNonUniformShuffle" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformShuffleXor", + "opcode" : 346, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Mask'" } + ], + "capabilities" : [ "GroupNonUniformShuffle" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformShuffleUp", + "opcode" : 347, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Delta'" } + ], + "capabilities" : [ "GroupNonUniformShuffleRelative" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformShuffleDown", + "opcode" : 348, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Delta'" } + ], + "capabilities" : [ "GroupNonUniformShuffleRelative" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformIAdd", + "opcode" : 349, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } + ], + "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformFAdd", + "opcode" : 350, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } + ], + "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformIMul", + "opcode" : 351, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } + ], + "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformFMul", + "opcode" : 352, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } + ], + "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformSMin", + "opcode" : 353, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } + ], + "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformUMin", + "opcode" : 354, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } + ], + "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformFMin", + "opcode" : 355, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } + ], + "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformSMax", + "opcode" : 356, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } + ], + "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformUMax", + "opcode" : 357, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } + ], + "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformFMax", + "opcode" : 358, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } + ], + "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformBitwiseAnd", + "opcode" : 359, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } + ], + "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformBitwiseOr", + "opcode" : 360, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } + ], + "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformBitwiseXor", + "opcode" : 361, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } + ], + "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformLogicalAnd", + "opcode" : 362, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } + ], + "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformLogicalOr", + "opcode" : 363, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } + ], + "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformLogicalXor", + "opcode" : 364, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" } + ], + "capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformQuadBroadcast", + "opcode" : 365, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Index'" } + ], + "capabilities" : [ "GroupNonUniformQuad" ], + "version" : "1.3" + }, + { + "opname" : "OpGroupNonUniformQuadSwap", + "opcode" : 366, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Direction'" } + ], + "capabilities" : [ "GroupNonUniformQuad" ], + "version" : "1.3" + }, + { + "opname" : "OpSubgroupBallotKHR", + "opcode" : 4421, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "SubgroupBallotKHR" ], + "extensions" : [ "SPV_KHR_shader_ballot" ], + "version" : "None" + }, + { + "opname" : "OpSubgroupFirstInvocationKHR", + "opcode" : 4422, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "SubgroupBallotKHR" ], + "extensions" : [ "SPV_KHR_shader_ballot" ], + "version" : "None" + }, + { + "opname" : "OpSubgroupAllKHR", + "opcode" : 4428, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "extensions" : [ + "SPV_KHR_subgroup_vote" + ], + "capabilities" : [ "SubgroupVoteKHR" ], + "version" : "None" + }, + { + "opname" : "OpSubgroupAnyKHR", + "opcode" : 4429, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "extensions" : [ + "SPV_KHR_subgroup_vote" + ], + "capabilities" : [ "SubgroupVoteKHR" ], + "version" : "None" + }, + { + "opname" : "OpSubgroupAllEqualKHR", + "opcode" : 4430, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "extensions" : [ + "SPV_KHR_subgroup_vote" + ], + "capabilities" : [ "SubgroupVoteKHR" ], + "version" : "None" + }, + { + "opname" : "OpSubgroupReadInvocationKHR", + "opcode" : 4432, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Index'" } + ], + "capabilities" : [ "SubgroupBallotKHR" ], + "extensions" : [ "SPV_KHR_shader_ballot" ], + "version" : "None" + }, + { + "opname" : "OpGroupIAddNonUniformAMD", + "opcode" : 5000, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ], + "extensions" : [ "SPV_AMD_shader_ballot" ], + "version" : "None" + }, + { + "opname" : "OpGroupFAddNonUniformAMD", + "opcode" : 5001, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ], + "extensions" : [ "SPV_AMD_shader_ballot" ], + "version" : "None" + }, + { + "opname" : "OpGroupFMinNonUniformAMD", + "opcode" : 5002, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ], + "extensions" : [ "SPV_AMD_shader_ballot" ], + "version" : "None" + }, + { + "opname" : "OpGroupUMinNonUniformAMD", + "opcode" : 5003, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ], + "extensions" : [ "SPV_AMD_shader_ballot" ], + "version" : "None" + }, + { + "opname" : "OpGroupSMinNonUniformAMD", + "opcode" : 5004, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ], + "extensions" : [ "SPV_AMD_shader_ballot" ], + "version" : "None" + }, + { + "opname" : "OpGroupFMaxNonUniformAMD", + "opcode" : 5005, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ], + "extensions" : [ "SPV_AMD_shader_ballot" ], + "version" : "None" + }, + { + "opname" : "OpGroupUMaxNonUniformAMD", + "opcode" : 5006, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ], + "extensions" : [ "SPV_AMD_shader_ballot" ], + "version" : "None" + }, + { + "opname" : "OpGroupSMaxNonUniformAMD", + "opcode" : 5007, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Execution'" }, + { "kind" : "GroupOperation", "name" : "'Operation'" }, + { "kind" : "IdRef", "name" : "'X'" } + ], + "capabilities" : [ "Groups" ], + "extensions" : [ "SPV_AMD_shader_ballot" ], + "version" : "None" + }, + { + "opname" : "OpFragmentMaskFetchAMD", + "opcode" : 5011, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" } + ], + "capabilities" : [ "FragmentMaskAMD" ], + "extensions" : [ "SPV_AMD_shader_fragment_mask" ], + "version" : "None" + }, + { + "opname" : "OpFragmentFetchAMD", + "opcode" : 5012, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Fragment Index'" } + ], + "capabilities" : [ "FragmentMaskAMD" ], + "extensions" : [ "SPV_AMD_shader_fragment_mask" ], + "version" : "None" + }, + { + "opname" : "OpSubgroupShuffleINTEL", + "opcode" : 5571, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Data'" }, + { "kind" : "IdRef", "name" : "'InvocationId'" } + ], + "capabilities" : [ "SubgroupShuffleINTEL" ], + "version" : "None" + }, + { + "opname" : "OpSubgroupShuffleDownINTEL", + "opcode" : 5572, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Current'" }, + { "kind" : "IdRef", "name" : "'Next'" }, + { "kind" : "IdRef", "name" : "'Delta'" } + ], + "capabilities" : [ "SubgroupShuffleINTEL" ], + "version" : "None" + }, + { + "opname" : "OpSubgroupShuffleUpINTEL", + "opcode" : 5573, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Previous'" }, + { "kind" : "IdRef", "name" : "'Current'" }, + { "kind" : "IdRef", "name" : "'Delta'" } + ], + "capabilities" : [ "SubgroupShuffleINTEL" ], + "version" : "None" + }, + { + "opname" : "OpSubgroupShuffleXorINTEL", + "opcode" : 5574, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Data'" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "SubgroupShuffleINTEL" ], + "version" : "None" + }, + { + "opname" : "OpSubgroupBlockReadINTEL", + "opcode" : 5575, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Ptr'" } + ], + "capabilities" : [ "SubgroupBufferBlockIOINTEL" ], + "version" : "None" + }, + { + "opname" : "OpSubgroupBlockWriteINTEL", + "opcode" : 5576, + "operands" : [ + { "kind" : "IdRef", "name" : "'Ptr'" }, + { "kind" : "IdRef", "name" : "'Data'" } + ], + "capabilities" : [ "SubgroupBufferBlockIOINTEL" ], + "version" : "None" + }, + { + "opname" : "OpSubgroupImageBlockReadINTEL", + "opcode" : 5577, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" } + ], + "capabilities" : [ "SubgroupImageBlockIOINTEL" ], + "version" : "None" + }, + { + "opname" : "OpSubgroupImageBlockWriteINTEL", + "opcode" : 5578, + "operands" : [ + { "kind" : "IdRef", "name" : "'Image'" }, + { "kind" : "IdRef", "name" : "'Coordinate'" }, + { "kind" : "IdRef", "name" : "'Data'" } + ], + "capabilities" : [ "SubgroupImageBlockIOINTEL" ], + "version" : "None" + }, + { + "opname" : "OpDecorateStringGOOGLE", + "opcode" : 5632, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "Decoration" } + ], + "extensions" : [ "SPV_GOOGLE_decorate_string" ], + "version" : "None" + }, + { + "opname" : "OpMemberDecorateStringGOOGLE", + "opcode" : 5633, + "operands" : [ + { "kind" : "IdRef", "name" : "'Struct Type'" }, + { "kind" : "LiteralInteger", "name" : "'Member'" }, + { "kind" : "Decoration" } + ], + "extensions" : [ "SPV_GOOGLE_decorate_string" ], + "version" : "None" + }, + { + "opname" : "OpGroupNonUniformPartitionNV", + "opcode" : 5296, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "GroupNonUniformPartitionedNV" ], + "extensions" : [ "SPV_NV_shader_subgroup_partitioned" ], + "version" : "None" + } + ], + "operand_kinds" : [ + { + "category" : "BitEnum", + "kind" : "ImageOperands", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Bias", + "value" : "0x0001", + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "Lod", + "value" : "0x0002", + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "Grad", + "value" : "0x0004", + "parameters" : [ + { "kind" : "IdRef" }, + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "ConstOffset", + "value" : "0x0008", + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "Offset", + "value" : "0x0010", + "capabilities" : [ "ImageGatherExtended" ], + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "ConstOffsets", + "value" : "0x0020", + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "Sample", + "value" : "0x0040", + "parameters" : [ + { "kind" : "IdRef" } + ] + }, + { + "enumerant" : "MinLod", + "value" : "0x0080", + "capabilities" : [ "MinLod" ], + "parameters" : [ + { "kind" : "IdRef" } + ] + } + ] + }, + { + "category" : "BitEnum", + "kind" : "FPFastMathMode", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "NotNaN", + "value" : "0x0001", + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NotInf", + "value" : "0x0002", + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NSZ", + "value" : "0x0004", + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "AllowRecip", + "value" : "0x0008", + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Fast", + "value" : "0x0010", + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "BitEnum", + "kind" : "SelectionControl", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Flatten", + "value" : "0x0001" + }, + { + "enumerant" : "DontFlatten", + "value" : "0x0002" + } + ] + }, + { + "category" : "BitEnum", + "kind" : "LoopControl", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Unroll", + "value" : "0x0001" + }, + { + "enumerant" : "DontUnroll", + "value" : "0x0002" + }, + { + "enumerant" : "DependencyInfinite", + "value" : "0x0004", + "version" : "1.1" + }, + { + "enumerant" : "DependencyLength", + "value" : "0x0008", + "parameters" : [ + { "kind" : "LiteralInteger" } + ], + "version" : "1.1" + } + ] + }, + { + "category" : "BitEnum", + "kind" : "FunctionControl", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Inline", + "value" : "0x0001" + }, + { + "enumerant" : "DontInline", + "value" : "0x0002" + }, + { + "enumerant" : "Pure", + "value" : "0x0004" + }, + { + "enumerant" : "Const", + "value" : "0x0008" + } + ] + }, + { + "category" : "BitEnum", + "kind" : "MemorySemantics", + "enumerants" : [ + { + "enumerant" : "Relaxed", + "value" : "0x0000" + }, + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Acquire", + "value" : "0x0002" + }, + { + "enumerant" : "Release", + "value" : "0x0004" + }, + { + "enumerant" : "AcquireRelease", + "value" : "0x0008" + }, + { + "enumerant" : "SequentiallyConsistent", + "value" : "0x0010" + }, + { + "enumerant" : "UniformMemory", + "value" : "0x0040", + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SubgroupMemory", + "value" : "0x0080" + }, + { + "enumerant" : "WorkgroupMemory", + "value" : "0x0100" + }, + { + "enumerant" : "CrossWorkgroupMemory", + "value" : "0x0200" + }, + { + "enumerant" : "AtomicCounterMemory", + "value" : "0x0400", + "capabilities" : [ "AtomicStorage" ] + }, + { + "enumerant" : "ImageMemory", + "value" : "0x0800" + } + ] + }, + { + "category" : "BitEnum", + "kind" : "MemoryAccess", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "Volatile", + "value" : "0x0001" + }, + { + "enumerant" : "Aligned", + "value" : "0x0002", + "parameters" : [ + { "kind" : "LiteralInteger" } + ] + }, + { + "enumerant" : "Nontemporal", + "value" : "0x0004" + } + ] + }, + { + "category" : "BitEnum", + "kind" : "KernelProfilingInfo", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "CmdExecTime", + "value" : "0x0001", + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "SourceLanguage", + "enumerants" : [ + { + "enumerant" : "Unknown", + "value" : 0 + }, + { + "enumerant" : "ESSL", + "value" : 1 + }, + { + "enumerant" : "GLSL", + "value" : 2 + }, + { + "enumerant" : "OpenCL_C", + "value" : 3 + }, + { + "enumerant" : "OpenCL_CPP", + "value" : 4 + }, + { + "enumerant" : "HLSL", + "value" : 5 + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ExecutionModel", + "enumerants" : [ + { + "enumerant" : "Vertex", + "value" : 0, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "TessellationControl", + "value" : 1, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "TessellationEvaluation", + "value" : 2, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "Geometry", + "value" : 3, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "Fragment", + "value" : 4, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GLCompute", + "value" : 5, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Kernel", + "value" : 6, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "AddressingModel", + "enumerants" : [ + { + "enumerant" : "Logical", + "value" : 0 + }, + { + "enumerant" : "Physical32", + "value" : 1, + "capabilities" : [ "Addresses" ] + }, + { + "enumerant" : "Physical64", + "value" : 2, + "capabilities" : [ "Addresses" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "MemoryModel", + "enumerants" : [ + { + "enumerant" : "Simple", + "value" : 0, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GLSL450", + "value" : 1, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "OpenCL", + "value" : 2, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ExecutionMode", + "enumerants" : [ + { + "enumerant" : "Invocations", + "value" : 0, + "capabilities" : [ "Geometry" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Number of <>'" } + ] + }, + { + "enumerant" : "SpacingEqual", + "value" : 1, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "SpacingFractionalEven", + "value" : 2, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "SpacingFractionalOdd", + "value" : 3, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "VertexOrderCw", + "value" : 4, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "VertexOrderCcw", + "value" : 5, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "PixelCenterInteger", + "value" : 6, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "OriginUpperLeft", + "value" : 7, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "OriginLowerLeft", + "value" : 8, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "EarlyFragmentTests", + "value" : 9, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "PointMode", + "value" : 10, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "Xfb", + "value" : 11, + "capabilities" : [ "TransformFeedback" ] + }, + { + "enumerant" : "DepthReplacing", + "value" : 12, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "DepthGreater", + "value" : 14, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "DepthLess", + "value" : 15, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "DepthUnchanged", + "value" : 16, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "LocalSize", + "value" : 17, + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'x size'" }, + { "kind" : "LiteralInteger", "name" : "'y size'" }, + { "kind" : "LiteralInteger", "name" : "'z size'" } + ] + }, + { + "enumerant" : "LocalSizeHint", + "value" : 18, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'x size'" }, + { "kind" : "LiteralInteger", "name" : "'y size'" }, + { "kind" : "LiteralInteger", "name" : "'z size'" } + ] + }, + { + "enumerant" : "InputPoints", + "value" : 19, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "InputLines", + "value" : 20, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "InputLinesAdjacency", + "value" : 21, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "Triangles", + "value" : 22, + "capabilities" : [ "Geometry", "Tessellation" ] + }, + { + "enumerant" : "InputTrianglesAdjacency", + "value" : 23, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "Quads", + "value" : 24, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "Isolines", + "value" : 25, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "OutputVertices", + "value" : 26, + "capabilities" : [ "Geometry", "Tessellation" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Vertex count'" } + ] + }, + { + "enumerant" : "OutputPoints", + "value" : 27, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "OutputLineStrip", + "value" : 28, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "OutputTriangleStrip", + "value" : 29, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "VecTypeHint", + "value" : 30, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Vector type'" } + ] + }, + { + "enumerant" : "ContractionOff", + "value" : 31, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Initializer", + "value" : 33, + "capabilities" : [ "Kernel" ], + "version" : "1.1" + }, + { + "enumerant" : "Finalizer", + "value" : 34, + "capabilities" : [ "Kernel" ], + "version" : "1.1" + }, + { + "enumerant" : "SubgroupSize", + "value" : 35, + "capabilities" : [ "SubgroupDispatch" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Subgroup Size'" } + ], + "version" : "1.1" + }, + { + "enumerant" : "SubgroupsPerWorkgroup", + "value" : 36, + "capabilities" : [ "SubgroupDispatch" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Subgroups Per Workgroup'" } + ], + "version" : "1.1" + }, + { + "enumerant" : "SubgroupsPerWorkgroupId", + "value" : 37, + "capabilities" : [ "SubgroupDispatch" ], + "parameters" : [ + { "kind" : "IdRef", "name" : "'Subgroups Per Workgroup'" } + ], + "version" : "1.2" + }, + { + "enumerant" : "LocalSizeId", + "value" : 38, + "parameters" : [ + { "kind" : "IdRef", "name" : "'x size'" }, + { "kind" : "IdRef", "name" : "'y size'" }, + { "kind" : "IdRef", "name" : "'z size'" } + ], + "version" : "1.2" + }, + { + "enumerant" : "LocalSizeHintId", + "value" : 39, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "IdRef", "name" : "'Local Size Hint'" } + ], + "version" : "1.2" + }, + { + "enumerant" : "PostDepthCoverage", + "value" : 4446, + "capabilities" : [ "SampleMaskPostDepthCoverage" ], + "extensions" : [ "SPV_KHR_post_depth_coverage" ], + "version" : "None" + }, + { + "enumerant" : "StencilRefReplacingEXT", + "value" : 5027, + "capabilities" : [ "StencilExportEXT" ], + "extensions" : [ "SPV_EXT_shader_stencil_export" ], + "version" : "None" + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "StorageClass", + "enumerants" : [ + { + "enumerant" : "UniformConstant", + "value" : 0 + }, + { + "enumerant" : "Input", + "value" : 1 + }, + { + "enumerant" : "Uniform", + "value" : 2, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Output", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Workgroup", + "value" : 4 + }, + { + "enumerant" : "CrossWorkgroup", + "value" : 5 + }, + { + "enumerant" : "Private", + "value" : 6, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Function", + "value" : 7 + }, + { + "enumerant" : "Generic", + "value" : 8, + "capabilities" : [ "GenericPointer" ] + }, + { + "enumerant" : "PushConstant", + "value" : 9, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "AtomicCounter", + "value" : 10, + "capabilities" : [ "AtomicStorage" ] + }, + { + "enumerant" : "Image", + "value" : 11 + }, + { + "enumerant" : "StorageBuffer", + "value" : 12, + "extensions" : [ + "SPV_KHR_storage_buffer_storage_class", + "SPV_KHR_variable_pointers" + ], + "capabilities" : [ "Shader" ], + "version" : "1.3" + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "Dim", + "enumerants" : [ + { + "enumerant" : "1D", + "value" : 0, + "capabilities" : [ "Sampled1D" ] + }, + { + "enumerant" : "2D", + "value" : 1 + }, + { + "enumerant" : "3D", + "value" : 2 + }, + { + "enumerant" : "Cube", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rect", + "value" : 4, + "capabilities" : [ "SampledRect" ] + }, + { + "enumerant" : "Buffer", + "value" : 5, + "capabilities" : [ "SampledBuffer" ] + }, + { + "enumerant" : "SubpassData", + "value" : 6, + "capabilities" : [ "InputAttachment" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "SamplerAddressingMode", + "enumerants" : [ + { + "enumerant" : "None", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ClampToEdge", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Clamp", + "value" : 2, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Repeat", + "value" : 3, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RepeatMirrored", + "value" : 4, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "SamplerFilterMode", + "enumerants" : [ + { + "enumerant" : "Nearest", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Linear", + "value" : 1, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ImageFormat", + "enumerants" : [ + { + "enumerant" : "Unknown", + "value" : 0 + }, + { + "enumerant" : "Rgba32f", + "value" : 1, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba16f", + "value" : 2, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "R32f", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba8", + "value" : 4, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba8Snorm", + "value" : 5, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rg32f", + "value" : 6, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16f", + "value" : 7, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R11fG11fB10f", + "value" : 8, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16f", + "value" : 9, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgba16", + "value" : 10, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgb10A2", + "value" : 11, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16", + "value" : 12, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg8", + "value" : 13, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16", + "value" : 14, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R8", + "value" : 15, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgba16Snorm", + "value" : 16, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16Snorm", + "value" : 17, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg8Snorm", + "value" : 18, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16Snorm", + "value" : 19, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R8Snorm", + "value" : 20, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgba32i", + "value" : 21, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba16i", + "value" : 22, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba8i", + "value" : 23, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "R32i", + "value" : 24, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rg32i", + "value" : 25, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16i", + "value" : 26, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg8i", + "value" : 27, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16i", + "value" : 28, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R8i", + "value" : 29, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rgba32ui", + "value" : 30, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba16ui", + "value" : 31, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgba8ui", + "value" : 32, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "R32ui", + "value" : 33, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Rgb10a2ui", + "value" : 34, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg32ui", + "value" : 35, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg16ui", + "value" : 36, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "Rg8ui", + "value" : 37, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R16ui", + "value" : 38, + "capabilities" : [ "StorageImageExtendedFormats" ] + }, + { + "enumerant" : "R8ui", + "value" : 39, + "capabilities" : [ "StorageImageExtendedFormats" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ImageChannelOrder", + "enumerants" : [ + { + "enumerant" : "R", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "A", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RG", + "value" : 2, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RA", + "value" : 3, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RGB", + "value" : 4, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RGBA", + "value" : 5, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "BGRA", + "value" : 6, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ARGB", + "value" : 7, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Intensity", + "value" : 8, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Luminance", + "value" : 9, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Rx", + "value" : 10, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RGx", + "value" : 11, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RGBx", + "value" : 12, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Depth", + "value" : 13, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "DepthStencil", + "value" : 14, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "sRGB", + "value" : 15, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "sRGBx", + "value" : 16, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "sRGBA", + "value" : 17, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "sBGRA", + "value" : 18, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ABGR", + "value" : 19, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "ImageChannelDataType", + "enumerants" : [ + { + "enumerant" : "SnormInt8", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SnormInt16", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt8", + "value" : 2, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt16", + "value" : 3, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormShort565", + "value" : 4, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormShort555", + "value" : 5, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt101010", + "value" : 6, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SignedInt8", + "value" : 7, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SignedInt16", + "value" : 8, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SignedInt32", + "value" : 9, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnsignedInt8", + "value" : 10, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnsignedInt16", + "value" : 11, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnsignedInt32", + "value" : 12, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "HalfFloat", + "value" : 13, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Float", + "value" : 14, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt24", + "value" : 15, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnormInt101010_2", + "value" : 16, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "FPRoundingMode", + "enumerants" : [ + { + "enumerant" : "RTE", + "value" : 0 + }, + { + "enumerant" : "RTZ", + "value" : 1 + }, + { + "enumerant" : "RTP", + "value" : 2 + }, + { + "enumerant" : "RTN", + "value" : 3 + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "LinkageType", + "enumerants" : [ + { + "enumerant" : "Export", + "value" : 0, + "capabilities" : [ "Linkage" ] + }, + { + "enumerant" : "Import", + "value" : 1, + "capabilities" : [ "Linkage" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "AccessQualifier", + "enumerants" : [ + { + "enumerant" : "ReadOnly", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "WriteOnly", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ReadWrite", + "value" : 2, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "FunctionParameterAttribute", + "enumerants" : [ + { + "enumerant" : "Zext", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Sext", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ByVal", + "value" : 2, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Sret", + "value" : 3, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NoAlias", + "value" : 4, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NoCapture", + "value" : 5, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NoWrite", + "value" : 6, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NoReadWrite", + "value" : 7, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "Decoration", + "enumerants" : [ + { + "enumerant" : "RelaxedPrecision", + "value" : 0, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SpecId", + "value" : 1, + "capabilities" : [ "Shader", "Kernel" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Specialization Constant ID'" } + ] + }, + { + "enumerant" : "Block", + "value" : 2, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "BufferBlock", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "RowMajor", + "value" : 4, + "capabilities" : [ "Matrix" ] + }, + { + "enumerant" : "ColMajor", + "value" : 5, + "capabilities" : [ "Matrix" ] + }, + { + "enumerant" : "ArrayStride", + "value" : 6, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Array Stride'" } + ] + }, + { + "enumerant" : "MatrixStride", + "value" : 7, + "capabilities" : [ "Matrix" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Matrix Stride'" } + ] + }, + { + "enumerant" : "GLSLShared", + "value" : 8, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GLSLPacked", + "value" : 9, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "CPacked", + "value" : 10, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "BuiltIn", + "value" : 11, + "parameters" : [ + { "kind" : "BuiltIn" } + ] + }, + { + "enumerant" : "NoPerspective", + "value" : 13, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Flat", + "value" : 14, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Patch", + "value" : 15, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "Centroid", + "value" : 16, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Sample", + "value" : 17, + "capabilities" : [ "SampleRateShading" ] + }, + { + "enumerant" : "Invariant", + "value" : 18, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Restrict", + "value" : 19 + }, + { + "enumerant" : "Aliased", + "value" : 20 + }, + { + "enumerant" : "Volatile", + "value" : 21 + }, + { + "enumerant" : "Constant", + "value" : 22, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Coherent", + "value" : 23 + }, + { + "enumerant" : "NonWritable", + "value" : 24 + }, + { + "enumerant" : "NonReadable", + "value" : 25 + }, + { + "enumerant" : "Uniform", + "value" : 26, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SaturatedConversion", + "value" : 28, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Stream", + "value" : 29, + "capabilities" : [ "GeometryStreams" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Stream Number'" } + ] + }, + { + "enumerant" : "Location", + "value" : 30, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Location'" } + ] + }, + { + "enumerant" : "Component", + "value" : 31, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Component'" } + ] + }, + { + "enumerant" : "Index", + "value" : 32, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Index'" } + ] + }, + { + "enumerant" : "Binding", + "value" : 33, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Binding Point'" } + ] + }, + { + "enumerant" : "DescriptorSet", + "value" : 34, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Descriptor Set'" } + ] + }, + { + "enumerant" : "Offset", + "value" : 35, + "capabilities" : [ "Shader" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Byte Offset'" } + ] + }, + { + "enumerant" : "XfbBuffer", + "value" : 36, + "capabilities" : [ "TransformFeedback" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'XFB Buffer Number'" } + ] + }, + { + "enumerant" : "XfbStride", + "value" : 37, + "capabilities" : [ "TransformFeedback" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'XFB Stride'" } + ] + }, + { + "enumerant" : "FuncParamAttr", + "value" : 38, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "FunctionParameterAttribute", "name" : "'Function Parameter Attribute'" } + ] + }, + { + "enumerant" : "FPRoundingMode", + "value" : 39, + "parameters" : [ + { "kind" : "FPRoundingMode", "name" : "'Floating-Point Rounding Mode'" } + ] + }, + { + "enumerant" : "FPFastMathMode", + "value" : 40, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "FPFastMathMode", "name" : "'Fast-Math Mode'" } + ] + }, + { + "enumerant" : "LinkageAttributes", + "value" : 41, + "capabilities" : [ "Linkage" ], + "parameters" : [ + { "kind" : "LiteralString", "name" : "'Name'" }, + { "kind" : "LinkageType", "name" : "'Linkage Type'" } + ] + }, + { + "enumerant" : "NoContraction", + "value" : 42, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "InputAttachmentIndex", + "value" : 43, + "capabilities" : [ "InputAttachment" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Attachment Index'" } + ] + }, + { + "enumerant" : "Alignment", + "value" : 44, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Alignment'" } + ] + }, + { + "enumerant" : "MaxByteOffset", + "value" : 45, + "capabilities" : [ "Addresses" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Max Byte Offset'" } + ], + "version" : "1.1" + }, + { + "enumerant" : "AlignmentId", + "value" : 46, + "capabilities" : [ "Kernel" ], + "parameters" : [ + { "kind" : "IdRef", "name" : "'Alignment'" } + ], + "version" : "1.2" + }, + { + "enumerant" : "MaxByteOffsetId", + "value" : 47, + "capabilities" : [ "Addresses" ], + "parameters" : [ + { "kind" : "IdRef", "name" : "'Max Byte Offset'" } + ], + "version" : "1.2" + }, + { + "enumerant" : "ExplicitInterpAMD", + "value" : 4999, + "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ], + "version" : "None" + }, + { + "enumerant" : "OverrideCoverageNV", + "value" : 5248, + "capabilities" : [ "SampleMaskOverrideCoverageNV" ], + "version" : "None" + }, + { + "enumerant" : "PassthroughNV", + "value" : 5250, + "capabilities" : [ "GeometryShaderPassthroughNV" ], + "version" : "None" + }, + { + "enumerant" : "ViewportRelativeNV", + "value" : 5252, + "capabilities" : [ "ShaderViewportMaskNV" ], + "version" : "None" + }, + { + "enumerant" : "SecondaryViewportRelativeNV", + "value" : 5256, + "capabilities" : [ "ShaderStereoViewNV" ], + "version" : "None", + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Offset'" } + ] + }, + { + "enumerant" : "NonUniformEXT", + "value" : 5300, + "capabilities" : [ "ShaderNonUniformEXT" ] + }, + { + "enumerant" : "HlslCounterBufferGOOGLE", + "value" : 5634, + "parameters" : [ + { "kind" : "IdRef", "name" : "'Counter Buffer'" } + ], + "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ], + "version" : "None" + }, + { + "enumerant" : "HlslSemanticGOOGLE", + "value" : 5635, + "parameters" : [ + { "kind" : "LiteralString", "name" : "'Semantic'" } + ], + "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ], + "version" : "None" + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "BuiltIn", + "enumerants" : [ + { + "enumerant" : "Position", + "value" : 0, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "PointSize", + "value" : 1, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ClipDistance", + "value" : 3, + "capabilities" : [ "ClipDistance" ] + }, + { + "enumerant" : "CullDistance", + "value" : 4, + "capabilities" : [ "CullDistance" ] + }, + { + "enumerant" : "VertexId", + "value" : 5, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "InstanceId", + "value" : 6, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "PrimitiveId", + "value" : 7, + "capabilities" : [ "Geometry", "Tessellation" ] + }, + { + "enumerant" : "InvocationId", + "value" : 8, + "capabilities" : [ "Geometry", "Tessellation" ] + }, + { + "enumerant" : "Layer", + "value" : 9, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "ViewportIndex", + "value" : 10, + "capabilities" : [ "MultiViewport" ] + }, + { + "enumerant" : "TessLevelOuter", + "value" : 11, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "TessLevelInner", + "value" : 12, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "TessCoord", + "value" : 13, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "PatchVertices", + "value" : 14, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "FragCoord", + "value" : 15, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "PointCoord", + "value" : 16, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "FrontFacing", + "value" : 17, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SampleId", + "value" : 18, + "capabilities" : [ "SampleRateShading" ] + }, + { + "enumerant" : "SamplePosition", + "value" : 19, + "capabilities" : [ "SampleRateShading" ] + }, + { + "enumerant" : "SampleMask", + "value" : 20, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "FragDepth", + "value" : 22, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "HelperInvocation", + "value" : 23, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "NumWorkgroups", + "value" : 24 + }, + { + "enumerant" : "WorkgroupSize", + "value" : 25 + }, + { + "enumerant" : "WorkgroupId", + "value" : 26 + }, + { + "enumerant" : "LocalInvocationId", + "value" : 27 + }, + { + "enumerant" : "GlobalInvocationId", + "value" : 28 + }, + { + "enumerant" : "LocalInvocationIndex", + "value" : 29 + }, + { + "enumerant" : "WorkDim", + "value" : 30, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "GlobalSize", + "value" : 31, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "EnqueuedWorkgroupSize", + "value" : 32, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "GlobalOffset", + "value" : 33, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "GlobalLinearId", + "value" : 34, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SubgroupSize", + "value" : 36, + "capabilities" : [ "Kernel", "GroupNonUniform", "SubgroupBallotKHR" ] + }, + { + "enumerant" : "SubgroupMaxSize", + "value" : 37, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "NumSubgroups", + "value" : 38, + "capabilities" : [ "Kernel", "GroupNonUniform" ] + }, + { + "enumerant" : "NumEnqueuedSubgroups", + "value" : 39, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "SubgroupId", + "value" : 40, + "capabilities" : [ "Kernel", "GroupNonUniform" ] + }, + { + "enumerant" : "SubgroupLocalInvocationId", + "value" : 41, + "capabilities" : [ "Kernel", "GroupNonUniform", "SubgroupBallotKHR" ] + }, + { + "enumerant" : "VertexIndex", + "value" : 42, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "InstanceIndex", + "value" : 43, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SubgroupEqMask", + "value" : 4416, + "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], + "version" : "1.3" + }, + { + "enumerant" : "SubgroupGeMask", + "value" : 4417, + "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], + "version" : "1.3" + }, + { + "enumerant" : "SubgroupGtMask", + "value" : 4418, + "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], + "version" : "1.3" + }, + { + "enumerant" : "SubgroupLeMask", + "value" : 4419, + "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], + "version" : "1.3" + }, + { + "enumerant" : "SubgroupLtMask", + "value" : 4420, + "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], + "version" : "1.3" + }, + { + "enumerant" : "SubgroupEqMaskKHR", + "value" : 4416, + "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], + "extensions" : [ "SPV_KHR_shader_ballot" ], + "version" : "1.3" + }, + { + "enumerant" : "SubgroupGeMaskKHR", + "value" : 4417, + "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], + "extensions" : [ "SPV_KHR_shader_ballot" ], + "version" : "1.3" + }, + { + "enumerant" : "SubgroupGtMaskKHR", + "value" : 4418, + "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], + "extensions" : [ "SPV_KHR_shader_ballot" ], + "version" : "1.3" + }, + { + "enumerant" : "SubgroupLeMaskKHR", + "value" : 4419, + "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], + "extensions" : [ "SPV_KHR_shader_ballot" ], + "version" : "1.3" + }, + { + "enumerant" : "SubgroupLtMaskKHR", + "value" : 4420, + "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], + "extensions" : [ "SPV_KHR_shader_ballot" ], + "version" : "1.3" + }, + { + "enumerant" : "BaseVertex", + "value" : 4424, + "capabilities" : [ "DrawParameters" ], + "extensions" : [ "SPV_KHR_shader_draw_parameters" ], + "version" : "1.3" + }, + { + "enumerant" : "BaseInstance", + "value" : 4425, + "capabilities" : [ "DrawParameters" ], + "extensions" : [ "SPV_KHR_shader_draw_parameters" ], + "version" : "1.3" + }, + { + "enumerant" : "DrawIndex", + "value" : 4426, + "capabilities" : [ "DrawParameters" ], + "extensions" : [ "SPV_KHR_shader_draw_parameters" ], + "version" : "1.3" + }, + { + "enumerant" : "DeviceIndex", + "value" : 4438, + "capabilities" : [ "DeviceGroup" ], + "extensions" : [ "SPV_KHR_device_group" ], + "version" : "1.3" + }, + { + "enumerant" : "ViewIndex", + "value" : 4440, + "capabilities" : [ "MultiView" ], + "extensions" : [ "SPV_KHR_multiview" ], + "version" : "1.3" + }, + { + "enumerant" : "BaryCoordNoPerspAMD", + "value" : 4992, + "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ], + "version" : "None" + }, + { + "enumerant" : "BaryCoordNoPerspCentroidAMD", + "value" : 4993, + "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ], + "version" : "None" + }, + { + "enumerant" : "BaryCoordNoPerspSampleAMD", + "value" : 4994, + "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ], + "version" : "None" + }, + { + "enumerant" : "BaryCoordSmoothAMD", + "value" : 4995, + "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ], + "version" : "None" + }, + { + "enumerant" : "BaryCoordSmoothCentroidAMD", + "value" : 4996, + "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ], + "version" : "None" + }, + { + "enumerant" : "BaryCoordSmoothSampleAMD", + "value" : 4997, + "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ], + "version" : "None" + }, + { + "enumerant" : "BaryCoordPullModelAMD", + "value" : 4998, + "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ], + "version" : "None" + }, + { + "enumerant" : "FragStencilRefEXT", + "value" : 5014, + "capabilities" : [ "StencilExportEXT" ], + "extensions" : [ "SPV_EXT_shader_stencil_export" ], + "version" : "None" + }, + { + "enumerant" : "ViewportMaskNV", + "value" : 5253, + "capabilities" : [ "ShaderViewportMaskNV" ], + "version" : "None" + }, + { + "enumerant" : "SecondaryPositionNV", + "value" : 5257, + "capabilities" : [ "ShaderStereoViewNV" ], + "version" : "None" + }, + { + "enumerant" : "SecondaryViewportMaskNV", + "value" : 5258, + "capabilities" : [ "ShaderStereoViewNV" ], + "version" : "None" + }, + { + "enumerant" : "PositionPerViewNV", + "value" : 5261, + "capabilities" : [ "PerViewAttributesNV" ], + "version" : "None" + }, + { + "enumerant" : "ViewportMaskPerViewNV", + "value" : 5262, + "capabilities" : [ "PerViewAttributesNV" ], + "version" : "None" + }, + { + "enumerant" : "FullyCoveredEXT", + "value" : 5264, + "capabilities" : [ "FragmentFullyCoveredEXT" ], + "extensions" : [ "SPV_EXT_fragment_fully_covered" ], + "version" : "None" + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "Scope", + "enumerants" : [ + { + "enumerant" : "CrossDevice", + "value" : 0 + }, + { + "enumerant" : "Device", + "value" : 1 + }, + { + "enumerant" : "Workgroup", + "value" : 2 + }, + { + "enumerant" : "Subgroup", + "value" : 3 + }, + { + "enumerant" : "Invocation", + "value" : 4 + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "GroupOperation", + "enumerants" : [ + { + "enumerant" : "Reduce", + "value" : 0, + "capabilities" : [ "Kernel", "GroupNonUniformArithmetic", "GroupNonUniformBallot" ] + }, + { + "enumerant" : "InclusiveScan", + "value" : 1, + "capabilities" : [ "Kernel", "GroupNonUniformArithmetic", "GroupNonUniformBallot" ] + }, + { + "enumerant" : "ExclusiveScan", + "value" : 2, + "capabilities" : [ "Kernel", "GroupNonUniformArithmetic", "GroupNonUniformBallot" ] + }, + { + "enumerant" : "ClusteredReduce", + "value" : 3, + "capabilities" : [ "GroupNonUniformClustered" ], + "version" : "1.3" + }, + { + "enumerant" : "PartitionedReduceNV", + "value" : 6, + "capabilities" : [ "GroupNonUniformPartitionedNV" ] + }, + { + "enumerant" : "PartitionedInclusiveScanNV", + "value" : 7, + "capabilities" : [ "GroupNonUniformPartitionedNV" ] + }, + { + "enumerant" : "PartitionedExclusiveScanNV", + "value" : 8, + "capabilities" : [ "GroupNonUniformPartitionedNV" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "KernelEnqueueFlags", + "enumerants" : [ + { + "enumerant" : "NoWait", + "value" : 0, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "WaitKernel", + "value" : 1, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "WaitWorkGroup", + "value" : 2, + "capabilities" : [ "Kernel" ] + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "Capability", + "enumerants" : [ + { + "enumerant" : "Matrix", + "value" : 0 + }, + { + "enumerant" : "Shader", + "value" : 1, + "capabilities" : [ "Matrix" ] + }, + { + "enumerant" : "Geometry", + "value" : 2, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Tessellation", + "value" : 3, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Addresses", + "value" : 4 + }, + { + "enumerant" : "Linkage", + "value" : 5 + }, + { + "enumerant" : "Kernel", + "value" : 6 + }, + { + "enumerant" : "Vector16", + "value" : 7, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Float16Buffer", + "value" : 8, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Float16", + "value" : 9 + }, + { + "enumerant" : "Float64", + "value" : 10 + }, + { + "enumerant" : "Int64", + "value" : 11 + }, + { + "enumerant" : "Int64Atomics", + "value" : 12, + "capabilities" : [ "Int64" ] + }, + { + "enumerant" : "ImageBasic", + "value" : 13, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "ImageReadWrite", + "value" : 14, + "capabilities" : [ "ImageBasic" ] + }, + { + "enumerant" : "ImageMipmap", + "value" : 15, + "capabilities" : [ "ImageBasic" ] + }, + { + "enumerant" : "Pipes", + "value" : 17, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "Groups", + "value" : 18 + }, + { + "enumerant" : "DeviceEnqueue", + "value" : 19, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "LiteralSampler", + "value" : 20, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "AtomicStorage", + "value" : 21, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Int16", + "value" : 22 + }, + { + "enumerant" : "TessellationPointSize", + "value" : 23, + "capabilities" : [ "Tessellation" ] + }, + { + "enumerant" : "GeometryPointSize", + "value" : 24, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "ImageGatherExtended", + "value" : 25, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageImageMultisample", + "value" : 27, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "UniformBufferArrayDynamicIndexing", + "value" : 28, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SampledImageArrayDynamicIndexing", + "value" : 29, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageBufferArrayDynamicIndexing", + "value" : 30, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageImageArrayDynamicIndexing", + "value" : 31, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ClipDistance", + "value" : 32, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "CullDistance", + "value" : 33, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ImageCubeArray", + "value" : 34, + "capabilities" : [ "SampledCubeArray" ] + }, + { + "enumerant" : "SampleRateShading", + "value" : 35, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ImageRect", + "value" : 36, + "capabilities" : [ "SampledRect" ] + }, + { + "enumerant" : "SampledRect", + "value" : 37, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GenericPointer", + "value" : 38, + "capabilities" : [ "Addresses" ] + }, + { + "enumerant" : "Int8", + "value" : 39, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "InputAttachment", + "value" : 40, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SparseResidency", + "value" : 41, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "MinLod", + "value" : 42, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "Sampled1D", + "value" : 43 + }, + { + "enumerant" : "Image1D", + "value" : 44, + "capabilities" : [ "Sampled1D" ] + }, + { + "enumerant" : "SampledCubeArray", + "value" : 45, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "SampledBuffer", + "value" : 46 + }, + { + "enumerant" : "ImageBuffer", + "value" : 47, + "capabilities" : [ "SampledBuffer" ] + }, + { + "enumerant" : "ImageMSArray", + "value" : 48, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageImageExtendedFormats", + "value" : 49, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "ImageQuery", + "value" : 50, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "DerivativeControl", + "value" : 51, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "InterpolationFunction", + "value" : 52, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "TransformFeedback", + "value" : 53, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "GeometryStreams", + "value" : 54, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "StorageImageReadWithoutFormat", + "value" : 55, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "StorageImageWriteWithoutFormat", + "value" : 56, + "capabilities" : [ "Shader" ] + }, + { + "enumerant" : "MultiViewport", + "value" : 57, + "capabilities" : [ "Geometry" ] + }, + { + "enumerant" : "SubgroupDispatch", + "value" : 58, + "capabilities" : [ "DeviceEnqueue" ], + "version" : "1.1" + }, + { + "enumerant" : "NamedBarrier", + "value" : 59, + "capabilities" : [ "Kernel" ], + "version" : "1.1" + }, + { + "enumerant" : "PipeStorage", + "value" : 60, + "capabilities" : [ "Pipes" ], + "version" : "1.1" + }, + { + "enumerant" : "GroupNonUniform", + "value" : 61, + "version" : "1.3" + }, + { + "enumerant" : "GroupNonUniformVote", + "value" : 62, + "capabilities" : [ "GroupNonUniform" ], + "version" : "1.3" + }, + { + "enumerant" : "GroupNonUniformArithmetic", + "value" : 63, + "capabilities" : [ "GroupNonUniform" ], + "version" : "1.3" + }, + { + "enumerant" : "GroupNonUniformBallot", + "value" : 64, + "capabilities" : [ "GroupNonUniform" ], + "version" : "1.3" + }, + { + "enumerant" : "GroupNonUniformShuffle", + "value" : 65, + "capabilities" : [ "GroupNonUniform" ], + "version" : "1.3" + }, + { + "enumerant" : "GroupNonUniformShuffleRelative", + "value" : 66, + "capabilities" : [ "GroupNonUniform" ], + "version" : "1.3" + }, + { + "enumerant" : "GroupNonUniformClustered", + "value" : 67, + "capabilities" : [ "GroupNonUniform" ], + "version" : "1.3" + }, + { + "enumerant" : "GroupNonUniformQuad", + "value" : 68, + "capabilities" : [ "GroupNonUniform" ], + "version" : "1.3" + }, + { + "enumerant" : "SubgroupBallotKHR", + "value" : 4423, + "extensions" : [ "SPV_KHR_shader_ballot" ], + "version" : "None" + }, + { + "enumerant" : "DrawParameters", + "value" : 4427, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_KHR_shader_draw_parameters" ], + "version" : "1.3" + }, + { + "enumerant" : "SubgroupVoteKHR", + "value" : 4431, + "extensions" : [ "SPV_KHR_subgroup_vote" ], + "version" : "None" + }, + { + "enumerant" : "StorageBuffer16BitAccess", + "value" : 4433, + "extensions" : [ "SPV_KHR_16bit_storage" ], + "version" : "1.3" + }, + { + "enumerant" : "StorageUniformBufferBlock16", + "value" : 4433, + "extensions" : [ "SPV_KHR_16bit_storage" ], + "version" : "1.3" + }, + { + "enumerant" : "UniformAndStorageBuffer16BitAccess", + "value" : 4434, + "capabilities" : [ + "StorageBuffer16BitAccess", + "StorageUniformBufferBlock16" + ], + "extensions" : [ "SPV_KHR_16bit_storage" ], + "version" : "1.3" + }, + { + "enumerant" : "StorageUniform16", + "value" : 4434, + "capabilities" : [ + "StorageBuffer16BitAccess", + "StorageUniformBufferBlock16" + ], + "extensions" : [ "SPV_KHR_16bit_storage" ], + "version" : "1.3" + }, + { + "enumerant" : "StoragePushConstant16", + "value" : 4435, + "extensions" : [ "SPV_KHR_16bit_storage" ], + "version" : "1.3" + }, + { + "enumerant" : "StorageInputOutput16", + "value" : 4436, + "extensions" : [ "SPV_KHR_16bit_storage" ], + "version" : "1.3" + }, + { + "enumerant" : "DeviceGroup", + "value" : 4437, + "extensions" : [ "SPV_KHR_device_group" ], + "version" : "1.3" + }, + { + "enumerant" : "MultiView", + "value" : 4439, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_KHR_multiview" ], + "version" : "1.3" + }, + { + "enumerant" : "VariablePointersStorageBuffer", + "value" : 4441, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_KHR_variable_pointers" ], + "version" : "1.3" + }, + { + "enumerant" : "VariablePointers", + "value" : 4442, + "capabilities" : [ "VariablePointersStorageBuffer" ], + "extensions" : [ "SPV_KHR_variable_pointers" ], + "version" : "1.3" + }, + { + "enumerant" : "AtomicStorageOps", + "value" : 4445, + "extensions" : [ "SPV_KHR_shader_atomic_counter_ops" ], + "version" : "None" + }, + { + "enumerant" : "SampleMaskPostDepthCoverage", + "value" : 4447, + "extensions" : [ "SPV_KHR_post_depth_coverage" ], + "version" : "None" + }, + { + "enumerant" : "Float16ImageAMD", + "value" : 5008, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_AMD_gpu_shader_half_float_fetch" ], + "version" : "None" + }, + { + "enumerant" : "ImageGatherBiasLodAMD", + "value" : 5009, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_AMD_texture_gather_bias_lod" ], + "version" : "None" + }, + { + "enumerant" : "FragmentMaskAMD", + "value" : 5010, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_AMD_shader_fragment_mask" ], + "version" : "None" + }, + { + "enumerant" : "StencilExportEXT", + "value" : 5013, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_EXT_shader_stencil_export" ], + "version" : "None" + }, + { + "enumerant" : "ImageReadWriteLodAMD", + "value" : 5015, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_AMD_shader_image_load_store_lod" ], + "version" : "None" + }, + { + "enumerant" : "SampleMaskOverrideCoverageNV", + "value" : 5249, + "capabilities" : [ "SampleRateShading" ], + "extensions" : [ "SPV_NV_sample_mask_override_coverage" ], + "version" : "None" + }, + { + "enumerant" : "GeometryShaderPassthroughNV", + "value" : 5251, + "capabilities" : [ "Geometry" ], + "extensions" : [ "SPV_NV_geometry_shader_passthrough" ], + "version" : "None" + }, + { + "enumerant" : "ShaderViewportIndexLayerEXT", + "value" : 5254, + "capabilities" : [ "MultiViewport" ], + "extensions" : [ "SPV_EXT_shader_viewport_index_layer" ], + "version" : "None" + }, + { + "enumerant" : "ShaderViewportIndexLayerNV", + "value" : 5254, + "capabilities" : [ "MultiViewport" ], + "extensions" : [ "SPV_NV_viewport_array2" ], + "version" : "None" + }, + { + "enumerant" : "ShaderViewportMaskNV", + "value" : 5255, + "capabilities" : [ "ShaderViewportIndexLayerNV" ], + "extensions" : [ "SPV_NV_viewport_array2" ], + "version" : "None" + }, + { + "enumerant" : "ShaderStereoViewNV", + "value" : 5259, + "capabilities" : [ "ShaderViewportMaskNV" ], + "extensions" : [ "SPV_NV_stereo_view_rendering" ], + "version" : "None" + }, + { + "enumerant" : "PerViewAttributesNV", + "value" : 5260, + "capabilities" : [ "MultiView" ], + "extensions" : [ "SPV_NVX_multiview_per_view_attributes" ], + "version" : "None" + }, + { + "enumerant" : "FragmentFullyCoveredEXT", + "value" : 5265, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_EXT_fragment_fully_covered" ], + "version" : "None" + }, + { + "enumerant" : "ShaderNonUniformEXT", + "value" : 5301, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_EXT_descriptor_indexing" ], + "version" : "None" + }, + { + "enumerant" : "RuntimeDescriptorArrayEXT", + "value" : 5302, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_EXT_descriptor_indexing" ], + "version" : "None" + }, + { + "enumerant" : "InputAttachmentArrayDynamicIndexingEXT", + "value" : 5303, + "capabilities" : [ "InputAttachment" ], + "extensions" : [ "SPV_EXT_descriptor_indexing" ], + "version" : "None" + }, + { + "enumerant" : "UniformTexelBufferArrayDynamicIndexingEXT", + "value" : 5304, + "capabilities" : [ "SampledBuffer" ], + "extensions" : [ "SPV_EXT_descriptor_indexing" ], + "version" : "None" + }, + { + "enumerant" : "StorageTexelBufferArrayDynamicIndexingEXT", + "value" : 5305, + "capabilities" : [ "ImageBuffer" ], + "extensions" : [ "SPV_EXT_descriptor_indexing" ], + "version" : "None" + }, + { + "enumerant" : "UniformBufferArrayNonUniformIndexingEXT", + "value" : 5306, + "capabilities" : [ "ShaderNonUniformEXT" ], + "extensions" : [ "SPV_EXT_descriptor_indexing" ], + "version" : "None" + }, + { + "enumerant" : "SampledImageArrayNonUniformIndexingEXT", + "value" : 5307, + "capabilities" : [ "ShaderNonUniformEXT" ], + "extensions" : [ "SPV_EXT_descriptor_indexing" ], + "version" : "None" + }, + { + "enumerant" : "StorageBufferArrayNonUniformIndexingEXT", + "value" : 5308, + "capabilities" : [ "ShaderNonUniformEXT" ], + "extensions" : [ "SPV_EXT_descriptor_indexing" ], + "version" : "None" + }, + { + "enumerant" : "StorageImageArrayNonUniformIndexingEXT", + "value" : 5309, + "capabilities" : [ "ShaderNonUniformEXT" ], + "extensions" : [ "SPV_EXT_descriptor_indexing" ], + "version" : "None" + }, + { + "enumerant" : "InputAttachmentArrayNonUniformIndexingEXT", + "value" : 5310, + "capabilities" : [ "InputAttachment", "ShaderNonUniformEXT" ], + "extensions" : [ "SPV_EXT_descriptor_indexing" ], + "version" : "None" + }, + { + "enumerant" : "UniformTexelBufferArrayNonUniformIndexingEXT", + "value" : 5311, + "capabilities" : [ "SampledBuffer", "ShaderNonUniformEXT" ], + "extensions" : [ "SPV_EXT_descriptor_indexing" ], + "version" : "None" + }, + { + "enumerant" : "StorageTexelBufferArrayNonUniformIndexingEXT", + "value" : 5312, + "capabilities" : [ "ImageBuffer", "ShaderNonUniformEXT" ], + "extensions" : [ "SPV_EXT_descriptor_indexing" ], + "version" : "None" + }, + { + "enumerant" : "SubgroupShuffleINTEL", + "value" : 5568, + "extensions" : [ "SPV_INTEL_subgroups" ], + "version" : "None" + }, + { + "enumerant" : "SubgroupBufferBlockIOINTEL", + "value" : 5569, + "extensions" : [ "SPV_INTEL_subgroups" ], + "version" : "None" + }, + { + "enumerant" : "SubgroupImageBlockIOINTEL", + "value" : 5570, + "extensions" : [ "SPV_INTEL_subgroups" ], + "version" : "None" + }, + { + "enumerant" : "GroupNonUniformPartitionedNV", + "value" : 5297, + "extensions" : [ "SPV_NV_shader_subgroup_partitioned" ], + "version" : "None" + } + ] + }, + { + "category" : "Id", + "kind" : "IdResultType", + "doc" : "Reference to an representing the result's type of the enclosing instruction" + }, + { + "category" : "Id", + "kind" : "IdResult", + "doc" : "Definition of an representing the result of the enclosing instruction" + }, + { + "category" : "Id", + "kind" : "IdMemorySemantics", + "doc" : "Reference to an representing a 32-bit integer that is a mask from the MemorySemantics operand kind" + }, + { + "category" : "Id", + "kind" : "IdScope", + "doc" : "Reference to an representing a 32-bit integer that is a mask from the Scope operand kind" + }, + { + "category" : "Id", + "kind" : "IdRef", + "doc" : "Reference to an " + }, + { + "category" : "Literal", + "kind" : "LiteralInteger", + "doc" : "An integer consuming one or more words" + }, + { + "category" : "Literal", + "kind" : "LiteralString", + "doc" : "A null-terminated stream of characters consuming an integral number of words" + }, + { + "category" : "Literal", + "kind" : "LiteralContextDependentNumber", + "doc" : "A literal number whose size and format are determined by a previous operand in the enclosing instruction" + }, + { + "category" : "Literal", + "kind" : "LiteralExtInstInteger", + "doc" : "A 32-bit unsigned integer indicating which instruction to use and determining the layout of following operands (for OpExtInst)" + }, + { + "category" : "Literal", + "kind" : "LiteralSpecConstantOpInteger", + "doc" : "An opcode indicating the operation to be performed and determining the layout of following operands (for OpSpecConstantOp)" + }, + { + "category" : "Composite", + "kind" : "PairLiteralIntegerIdRef", + "bases" : [ "LiteralInteger", "IdRef" ] + }, + { + "category" : "Composite", + "kind" : "PairIdRefLiteralInteger", + "bases" : [ "IdRef", "LiteralInteger" ] + }, + { + "category" : "Composite", + "kind" : "PairIdRefIdRef", + "bases" : [ "IdRef", "IdRef" ] + } + ] +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.h 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1090 @@ +/* +** Copyright (c) 2014-2018 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +/* +** This header is automatically generated by the same tool that creates +** the Binary Section of the SPIR-V specification. +*/ + +/* +** Enumeration tokens for SPIR-V, in various styles: +** C, C++, C++11, JSON, Lua, Python +** +** - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +** - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +** - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +** - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +** - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +** +** Some tokens act like mask values, which can be OR'd together, +** while others are mutually exclusive. The mask-like ones have +** "Mask" in their name, and a parallel enum that has the shift +** amount (1 << x) for each corresponding enumerant. +*/ + +#ifndef spirv_H +#define spirv_H + +typedef unsigned int SpvId; + +#define SPV_VERSION 0x10300 +#define SPV_REVISION 1 + +static const unsigned int SpvMagicNumber = 0x07230203; +static const unsigned int SpvVersion = 0x00010300; +static const unsigned int SpvRevision = 1; +static const unsigned int SpvOpCodeMask = 0xffff; +static const unsigned int SpvWordCountShift = 16; + +typedef enum SpvSourceLanguage_ { + SpvSourceLanguageUnknown = 0, + SpvSourceLanguageESSL = 1, + SpvSourceLanguageGLSL = 2, + SpvSourceLanguageOpenCL_C = 3, + SpvSourceLanguageOpenCL_CPP = 4, + SpvSourceLanguageHLSL = 5, + SpvSourceLanguageMax = 0x7fffffff, +} SpvSourceLanguage; + +typedef enum SpvExecutionModel_ { + SpvExecutionModelVertex = 0, + SpvExecutionModelTessellationControl = 1, + SpvExecutionModelTessellationEvaluation = 2, + SpvExecutionModelGeometry = 3, + SpvExecutionModelFragment = 4, + SpvExecutionModelGLCompute = 5, + SpvExecutionModelKernel = 6, + SpvExecutionModelMax = 0x7fffffff, +} SpvExecutionModel; + +typedef enum SpvAddressingModel_ { + SpvAddressingModelLogical = 0, + SpvAddressingModelPhysical32 = 1, + SpvAddressingModelPhysical64 = 2, + SpvAddressingModelMax = 0x7fffffff, +} SpvAddressingModel; + +typedef enum SpvMemoryModel_ { + SpvMemoryModelSimple = 0, + SpvMemoryModelGLSL450 = 1, + SpvMemoryModelOpenCL = 2, + SpvMemoryModelMax = 0x7fffffff, +} SpvMemoryModel; + +typedef enum SpvExecutionMode_ { + SpvExecutionModeInvocations = 0, + SpvExecutionModeSpacingEqual = 1, + SpvExecutionModeSpacingFractionalEven = 2, + SpvExecutionModeSpacingFractionalOdd = 3, + SpvExecutionModeVertexOrderCw = 4, + SpvExecutionModeVertexOrderCcw = 5, + SpvExecutionModePixelCenterInteger = 6, + SpvExecutionModeOriginUpperLeft = 7, + SpvExecutionModeOriginLowerLeft = 8, + SpvExecutionModeEarlyFragmentTests = 9, + SpvExecutionModePointMode = 10, + SpvExecutionModeXfb = 11, + SpvExecutionModeDepthReplacing = 12, + SpvExecutionModeDepthGreater = 14, + SpvExecutionModeDepthLess = 15, + SpvExecutionModeDepthUnchanged = 16, + SpvExecutionModeLocalSize = 17, + SpvExecutionModeLocalSizeHint = 18, + SpvExecutionModeInputPoints = 19, + SpvExecutionModeInputLines = 20, + SpvExecutionModeInputLinesAdjacency = 21, + SpvExecutionModeTriangles = 22, + SpvExecutionModeInputTrianglesAdjacency = 23, + SpvExecutionModeQuads = 24, + SpvExecutionModeIsolines = 25, + SpvExecutionModeOutputVertices = 26, + SpvExecutionModeOutputPoints = 27, + SpvExecutionModeOutputLineStrip = 28, + SpvExecutionModeOutputTriangleStrip = 29, + SpvExecutionModeVecTypeHint = 30, + SpvExecutionModeContractionOff = 31, + SpvExecutionModeInitializer = 33, + SpvExecutionModeFinalizer = 34, + SpvExecutionModeSubgroupSize = 35, + SpvExecutionModeSubgroupsPerWorkgroup = 36, + SpvExecutionModeSubgroupsPerWorkgroupId = 37, + SpvExecutionModeLocalSizeId = 38, + SpvExecutionModeLocalSizeHintId = 39, + SpvExecutionModePostDepthCoverage = 4446, + SpvExecutionModeStencilRefReplacingEXT = 5027, + SpvExecutionModeMax = 0x7fffffff, +} SpvExecutionMode; + +typedef enum SpvStorageClass_ { + SpvStorageClassUniformConstant = 0, + SpvStorageClassInput = 1, + SpvStorageClassUniform = 2, + SpvStorageClassOutput = 3, + SpvStorageClassWorkgroup = 4, + SpvStorageClassCrossWorkgroup = 5, + SpvStorageClassPrivate = 6, + SpvStorageClassFunction = 7, + SpvStorageClassGeneric = 8, + SpvStorageClassPushConstant = 9, + SpvStorageClassAtomicCounter = 10, + SpvStorageClassImage = 11, + SpvStorageClassStorageBuffer = 12, + SpvStorageClassMax = 0x7fffffff, +} SpvStorageClass; + +typedef enum SpvDim_ { + SpvDim1D = 0, + SpvDim2D = 1, + SpvDim3D = 2, + SpvDimCube = 3, + SpvDimRect = 4, + SpvDimBuffer = 5, + SpvDimSubpassData = 6, + SpvDimMax = 0x7fffffff, +} SpvDim; + +typedef enum SpvSamplerAddressingMode_ { + SpvSamplerAddressingModeNone = 0, + SpvSamplerAddressingModeClampToEdge = 1, + SpvSamplerAddressingModeClamp = 2, + SpvSamplerAddressingModeRepeat = 3, + SpvSamplerAddressingModeRepeatMirrored = 4, + SpvSamplerAddressingModeMax = 0x7fffffff, +} SpvSamplerAddressingMode; + +typedef enum SpvSamplerFilterMode_ { + SpvSamplerFilterModeNearest = 0, + SpvSamplerFilterModeLinear = 1, + SpvSamplerFilterModeMax = 0x7fffffff, +} SpvSamplerFilterMode; + +typedef enum SpvImageFormat_ { + SpvImageFormatUnknown = 0, + SpvImageFormatRgba32f = 1, + SpvImageFormatRgba16f = 2, + SpvImageFormatR32f = 3, + SpvImageFormatRgba8 = 4, + SpvImageFormatRgba8Snorm = 5, + SpvImageFormatRg32f = 6, + SpvImageFormatRg16f = 7, + SpvImageFormatR11fG11fB10f = 8, + SpvImageFormatR16f = 9, + SpvImageFormatRgba16 = 10, + SpvImageFormatRgb10A2 = 11, + SpvImageFormatRg16 = 12, + SpvImageFormatRg8 = 13, + SpvImageFormatR16 = 14, + SpvImageFormatR8 = 15, + SpvImageFormatRgba16Snorm = 16, + SpvImageFormatRg16Snorm = 17, + SpvImageFormatRg8Snorm = 18, + SpvImageFormatR16Snorm = 19, + SpvImageFormatR8Snorm = 20, + SpvImageFormatRgba32i = 21, + SpvImageFormatRgba16i = 22, + SpvImageFormatRgba8i = 23, + SpvImageFormatR32i = 24, + SpvImageFormatRg32i = 25, + SpvImageFormatRg16i = 26, + SpvImageFormatRg8i = 27, + SpvImageFormatR16i = 28, + SpvImageFormatR8i = 29, + SpvImageFormatRgba32ui = 30, + SpvImageFormatRgba16ui = 31, + SpvImageFormatRgba8ui = 32, + SpvImageFormatR32ui = 33, + SpvImageFormatRgb10a2ui = 34, + SpvImageFormatRg32ui = 35, + SpvImageFormatRg16ui = 36, + SpvImageFormatRg8ui = 37, + SpvImageFormatR16ui = 38, + SpvImageFormatR8ui = 39, + SpvImageFormatMax = 0x7fffffff, +} SpvImageFormat; + +typedef enum SpvImageChannelOrder_ { + SpvImageChannelOrderR = 0, + SpvImageChannelOrderA = 1, + SpvImageChannelOrderRG = 2, + SpvImageChannelOrderRA = 3, + SpvImageChannelOrderRGB = 4, + SpvImageChannelOrderRGBA = 5, + SpvImageChannelOrderBGRA = 6, + SpvImageChannelOrderARGB = 7, + SpvImageChannelOrderIntensity = 8, + SpvImageChannelOrderLuminance = 9, + SpvImageChannelOrderRx = 10, + SpvImageChannelOrderRGx = 11, + SpvImageChannelOrderRGBx = 12, + SpvImageChannelOrderDepth = 13, + SpvImageChannelOrderDepthStencil = 14, + SpvImageChannelOrdersRGB = 15, + SpvImageChannelOrdersRGBx = 16, + SpvImageChannelOrdersRGBA = 17, + SpvImageChannelOrdersBGRA = 18, + SpvImageChannelOrderABGR = 19, + SpvImageChannelOrderMax = 0x7fffffff, +} SpvImageChannelOrder; + +typedef enum SpvImageChannelDataType_ { + SpvImageChannelDataTypeSnormInt8 = 0, + SpvImageChannelDataTypeSnormInt16 = 1, + SpvImageChannelDataTypeUnormInt8 = 2, + SpvImageChannelDataTypeUnormInt16 = 3, + SpvImageChannelDataTypeUnormShort565 = 4, + SpvImageChannelDataTypeUnormShort555 = 5, + SpvImageChannelDataTypeUnormInt101010 = 6, + SpvImageChannelDataTypeSignedInt8 = 7, + SpvImageChannelDataTypeSignedInt16 = 8, + SpvImageChannelDataTypeSignedInt32 = 9, + SpvImageChannelDataTypeUnsignedInt8 = 10, + SpvImageChannelDataTypeUnsignedInt16 = 11, + SpvImageChannelDataTypeUnsignedInt32 = 12, + SpvImageChannelDataTypeHalfFloat = 13, + SpvImageChannelDataTypeFloat = 14, + SpvImageChannelDataTypeUnormInt24 = 15, + SpvImageChannelDataTypeUnormInt101010_2 = 16, + SpvImageChannelDataTypeMax = 0x7fffffff, +} SpvImageChannelDataType; + +typedef enum SpvImageOperandsShift_ { + SpvImageOperandsBiasShift = 0, + SpvImageOperandsLodShift = 1, + SpvImageOperandsGradShift = 2, + SpvImageOperandsConstOffsetShift = 3, + SpvImageOperandsOffsetShift = 4, + SpvImageOperandsConstOffsetsShift = 5, + SpvImageOperandsSampleShift = 6, + SpvImageOperandsMinLodShift = 7, + SpvImageOperandsMax = 0x7fffffff, +} SpvImageOperandsShift; + +typedef enum SpvImageOperandsMask_ { + SpvImageOperandsMaskNone = 0, + SpvImageOperandsBiasMask = 0x00000001, + SpvImageOperandsLodMask = 0x00000002, + SpvImageOperandsGradMask = 0x00000004, + SpvImageOperandsConstOffsetMask = 0x00000008, + SpvImageOperandsOffsetMask = 0x00000010, + SpvImageOperandsConstOffsetsMask = 0x00000020, + SpvImageOperandsSampleMask = 0x00000040, + SpvImageOperandsMinLodMask = 0x00000080, +} SpvImageOperandsMask; + +typedef enum SpvFPFastMathModeShift_ { + SpvFPFastMathModeNotNaNShift = 0, + SpvFPFastMathModeNotInfShift = 1, + SpvFPFastMathModeNSZShift = 2, + SpvFPFastMathModeAllowRecipShift = 3, + SpvFPFastMathModeFastShift = 4, + SpvFPFastMathModeMax = 0x7fffffff, +} SpvFPFastMathModeShift; + +typedef enum SpvFPFastMathModeMask_ { + SpvFPFastMathModeMaskNone = 0, + SpvFPFastMathModeNotNaNMask = 0x00000001, + SpvFPFastMathModeNotInfMask = 0x00000002, + SpvFPFastMathModeNSZMask = 0x00000004, + SpvFPFastMathModeAllowRecipMask = 0x00000008, + SpvFPFastMathModeFastMask = 0x00000010, +} SpvFPFastMathModeMask; + +typedef enum SpvFPRoundingMode_ { + SpvFPRoundingModeRTE = 0, + SpvFPRoundingModeRTZ = 1, + SpvFPRoundingModeRTP = 2, + SpvFPRoundingModeRTN = 3, + SpvFPRoundingModeMax = 0x7fffffff, +} SpvFPRoundingMode; + +typedef enum SpvLinkageType_ { + SpvLinkageTypeExport = 0, + SpvLinkageTypeImport = 1, + SpvLinkageTypeMax = 0x7fffffff, +} SpvLinkageType; + +typedef enum SpvAccessQualifier_ { + SpvAccessQualifierReadOnly = 0, + SpvAccessQualifierWriteOnly = 1, + SpvAccessQualifierReadWrite = 2, + SpvAccessQualifierMax = 0x7fffffff, +} SpvAccessQualifier; + +typedef enum SpvFunctionParameterAttribute_ { + SpvFunctionParameterAttributeZext = 0, + SpvFunctionParameterAttributeSext = 1, + SpvFunctionParameterAttributeByVal = 2, + SpvFunctionParameterAttributeSret = 3, + SpvFunctionParameterAttributeNoAlias = 4, + SpvFunctionParameterAttributeNoCapture = 5, + SpvFunctionParameterAttributeNoWrite = 6, + SpvFunctionParameterAttributeNoReadWrite = 7, + SpvFunctionParameterAttributeMax = 0x7fffffff, +} SpvFunctionParameterAttribute; + +typedef enum SpvDecoration_ { + SpvDecorationRelaxedPrecision = 0, + SpvDecorationSpecId = 1, + SpvDecorationBlock = 2, + SpvDecorationBufferBlock = 3, + SpvDecorationRowMajor = 4, + SpvDecorationColMajor = 5, + SpvDecorationArrayStride = 6, + SpvDecorationMatrixStride = 7, + SpvDecorationGLSLShared = 8, + SpvDecorationGLSLPacked = 9, + SpvDecorationCPacked = 10, + SpvDecorationBuiltIn = 11, + SpvDecorationNoPerspective = 13, + SpvDecorationFlat = 14, + SpvDecorationPatch = 15, + SpvDecorationCentroid = 16, + SpvDecorationSample = 17, + SpvDecorationInvariant = 18, + SpvDecorationRestrict = 19, + SpvDecorationAliased = 20, + SpvDecorationVolatile = 21, + SpvDecorationConstant = 22, + SpvDecorationCoherent = 23, + SpvDecorationNonWritable = 24, + SpvDecorationNonReadable = 25, + SpvDecorationUniform = 26, + SpvDecorationSaturatedConversion = 28, + SpvDecorationStream = 29, + SpvDecorationLocation = 30, + SpvDecorationComponent = 31, + SpvDecorationIndex = 32, + SpvDecorationBinding = 33, + SpvDecorationDescriptorSet = 34, + SpvDecorationOffset = 35, + SpvDecorationXfbBuffer = 36, + SpvDecorationXfbStride = 37, + SpvDecorationFuncParamAttr = 38, + SpvDecorationFPRoundingMode = 39, + SpvDecorationFPFastMathMode = 40, + SpvDecorationLinkageAttributes = 41, + SpvDecorationNoContraction = 42, + SpvDecorationInputAttachmentIndex = 43, + SpvDecorationAlignment = 44, + SpvDecorationMaxByteOffset = 45, + SpvDecorationAlignmentId = 46, + SpvDecorationMaxByteOffsetId = 47, + SpvDecorationExplicitInterpAMD = 4999, + SpvDecorationOverrideCoverageNV = 5248, + SpvDecorationPassthroughNV = 5250, + SpvDecorationViewportRelativeNV = 5252, + SpvDecorationSecondaryViewportRelativeNV = 5256, + SpvDecorationNonUniformEXT = 5300, + SpvDecorationHlslCounterBufferGOOGLE = 5634, + SpvDecorationHlslSemanticGOOGLE = 5635, + SpvDecorationMax = 0x7fffffff, +} SpvDecoration; + +typedef enum SpvBuiltIn_ { + SpvBuiltInPosition = 0, + SpvBuiltInPointSize = 1, + SpvBuiltInClipDistance = 3, + SpvBuiltInCullDistance = 4, + SpvBuiltInVertexId = 5, + SpvBuiltInInstanceId = 6, + SpvBuiltInPrimitiveId = 7, + SpvBuiltInInvocationId = 8, + SpvBuiltInLayer = 9, + SpvBuiltInViewportIndex = 10, + SpvBuiltInTessLevelOuter = 11, + SpvBuiltInTessLevelInner = 12, + SpvBuiltInTessCoord = 13, + SpvBuiltInPatchVertices = 14, + SpvBuiltInFragCoord = 15, + SpvBuiltInPointCoord = 16, + SpvBuiltInFrontFacing = 17, + SpvBuiltInSampleId = 18, + SpvBuiltInSamplePosition = 19, + SpvBuiltInSampleMask = 20, + SpvBuiltInFragDepth = 22, + SpvBuiltInHelperInvocation = 23, + SpvBuiltInNumWorkgroups = 24, + SpvBuiltInWorkgroupSize = 25, + SpvBuiltInWorkgroupId = 26, + SpvBuiltInLocalInvocationId = 27, + SpvBuiltInGlobalInvocationId = 28, + SpvBuiltInLocalInvocationIndex = 29, + SpvBuiltInWorkDim = 30, + SpvBuiltInGlobalSize = 31, + SpvBuiltInEnqueuedWorkgroupSize = 32, + SpvBuiltInGlobalOffset = 33, + SpvBuiltInGlobalLinearId = 34, + SpvBuiltInSubgroupSize = 36, + SpvBuiltInSubgroupMaxSize = 37, + SpvBuiltInNumSubgroups = 38, + SpvBuiltInNumEnqueuedSubgroups = 39, + SpvBuiltInSubgroupId = 40, + SpvBuiltInSubgroupLocalInvocationId = 41, + SpvBuiltInVertexIndex = 42, + SpvBuiltInInstanceIndex = 43, + SpvBuiltInSubgroupEqMask = 4416, + SpvBuiltInSubgroupEqMaskKHR = 4416, + SpvBuiltInSubgroupGeMask = 4417, + SpvBuiltInSubgroupGeMaskKHR = 4417, + SpvBuiltInSubgroupGtMask = 4418, + SpvBuiltInSubgroupGtMaskKHR = 4418, + SpvBuiltInSubgroupLeMask = 4419, + SpvBuiltInSubgroupLeMaskKHR = 4419, + SpvBuiltInSubgroupLtMask = 4420, + SpvBuiltInSubgroupLtMaskKHR = 4420, + SpvBuiltInBaseVertex = 4424, + SpvBuiltInBaseInstance = 4425, + SpvBuiltInDrawIndex = 4426, + SpvBuiltInDeviceIndex = 4438, + SpvBuiltInViewIndex = 4440, + SpvBuiltInBaryCoordNoPerspAMD = 4992, + SpvBuiltInBaryCoordNoPerspCentroidAMD = 4993, + SpvBuiltInBaryCoordNoPerspSampleAMD = 4994, + SpvBuiltInBaryCoordSmoothAMD = 4995, + SpvBuiltInBaryCoordSmoothCentroidAMD = 4996, + SpvBuiltInBaryCoordSmoothSampleAMD = 4997, + SpvBuiltInBaryCoordPullModelAMD = 4998, + SpvBuiltInFragStencilRefEXT = 5014, + SpvBuiltInViewportMaskNV = 5253, + SpvBuiltInSecondaryPositionNV = 5257, + SpvBuiltInSecondaryViewportMaskNV = 5258, + SpvBuiltInPositionPerViewNV = 5261, + SpvBuiltInViewportMaskPerViewNV = 5262, + SpvBuiltInFullyCoveredEXT = 5264, + SpvBuiltInMax = 0x7fffffff, +} SpvBuiltIn; + +typedef enum SpvSelectionControlShift_ { + SpvSelectionControlFlattenShift = 0, + SpvSelectionControlDontFlattenShift = 1, + SpvSelectionControlMax = 0x7fffffff, +} SpvSelectionControlShift; + +typedef enum SpvSelectionControlMask_ { + SpvSelectionControlMaskNone = 0, + SpvSelectionControlFlattenMask = 0x00000001, + SpvSelectionControlDontFlattenMask = 0x00000002, +} SpvSelectionControlMask; + +typedef enum SpvLoopControlShift_ { + SpvLoopControlUnrollShift = 0, + SpvLoopControlDontUnrollShift = 1, + SpvLoopControlDependencyInfiniteShift = 2, + SpvLoopControlDependencyLengthShift = 3, + SpvLoopControlMax = 0x7fffffff, +} SpvLoopControlShift; + +typedef enum SpvLoopControlMask_ { + SpvLoopControlMaskNone = 0, + SpvLoopControlUnrollMask = 0x00000001, + SpvLoopControlDontUnrollMask = 0x00000002, + SpvLoopControlDependencyInfiniteMask = 0x00000004, + SpvLoopControlDependencyLengthMask = 0x00000008, +} SpvLoopControlMask; + +typedef enum SpvFunctionControlShift_ { + SpvFunctionControlInlineShift = 0, + SpvFunctionControlDontInlineShift = 1, + SpvFunctionControlPureShift = 2, + SpvFunctionControlConstShift = 3, + SpvFunctionControlMax = 0x7fffffff, +} SpvFunctionControlShift; + +typedef enum SpvFunctionControlMask_ { + SpvFunctionControlMaskNone = 0, + SpvFunctionControlInlineMask = 0x00000001, + SpvFunctionControlDontInlineMask = 0x00000002, + SpvFunctionControlPureMask = 0x00000004, + SpvFunctionControlConstMask = 0x00000008, +} SpvFunctionControlMask; + +typedef enum SpvMemorySemanticsShift_ { + SpvMemorySemanticsAcquireShift = 1, + SpvMemorySemanticsReleaseShift = 2, + SpvMemorySemanticsAcquireReleaseShift = 3, + SpvMemorySemanticsSequentiallyConsistentShift = 4, + SpvMemorySemanticsUniformMemoryShift = 6, + SpvMemorySemanticsSubgroupMemoryShift = 7, + SpvMemorySemanticsWorkgroupMemoryShift = 8, + SpvMemorySemanticsCrossWorkgroupMemoryShift = 9, + SpvMemorySemanticsAtomicCounterMemoryShift = 10, + SpvMemorySemanticsImageMemoryShift = 11, + SpvMemorySemanticsMax = 0x7fffffff, +} SpvMemorySemanticsShift; + +typedef enum SpvMemorySemanticsMask_ { + SpvMemorySemanticsMaskNone = 0, + SpvMemorySemanticsAcquireMask = 0x00000002, + SpvMemorySemanticsReleaseMask = 0x00000004, + SpvMemorySemanticsAcquireReleaseMask = 0x00000008, + SpvMemorySemanticsSequentiallyConsistentMask = 0x00000010, + SpvMemorySemanticsUniformMemoryMask = 0x00000040, + SpvMemorySemanticsSubgroupMemoryMask = 0x00000080, + SpvMemorySemanticsWorkgroupMemoryMask = 0x00000100, + SpvMemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, + SpvMemorySemanticsAtomicCounterMemoryMask = 0x00000400, + SpvMemorySemanticsImageMemoryMask = 0x00000800, +} SpvMemorySemanticsMask; + +typedef enum SpvMemoryAccessShift_ { + SpvMemoryAccessVolatileShift = 0, + SpvMemoryAccessAlignedShift = 1, + SpvMemoryAccessNontemporalShift = 2, + SpvMemoryAccessMax = 0x7fffffff, +} SpvMemoryAccessShift; + +typedef enum SpvMemoryAccessMask_ { + SpvMemoryAccessMaskNone = 0, + SpvMemoryAccessVolatileMask = 0x00000001, + SpvMemoryAccessAlignedMask = 0x00000002, + SpvMemoryAccessNontemporalMask = 0x00000004, +} SpvMemoryAccessMask; + +typedef enum SpvScope_ { + SpvScopeCrossDevice = 0, + SpvScopeDevice = 1, + SpvScopeWorkgroup = 2, + SpvScopeSubgroup = 3, + SpvScopeInvocation = 4, + SpvScopeMax = 0x7fffffff, +} SpvScope; + +typedef enum SpvGroupOperation_ { + SpvGroupOperationReduce = 0, + SpvGroupOperationInclusiveScan = 1, + SpvGroupOperationExclusiveScan = 2, + SpvGroupOperationClusteredReduce = 3, + SpvGroupOperationPartitionedReduceNV = 6, + SpvGroupOperationPartitionedInclusiveScanNV = 7, + SpvGroupOperationPartitionedExclusiveScanNV = 8, + SpvGroupOperationMax = 0x7fffffff, +} SpvGroupOperation; + +typedef enum SpvKernelEnqueueFlags_ { + SpvKernelEnqueueFlagsNoWait = 0, + SpvKernelEnqueueFlagsWaitKernel = 1, + SpvKernelEnqueueFlagsWaitWorkGroup = 2, + SpvKernelEnqueueFlagsMax = 0x7fffffff, +} SpvKernelEnqueueFlags; + +typedef enum SpvKernelProfilingInfoShift_ { + SpvKernelProfilingInfoCmdExecTimeShift = 0, + SpvKernelProfilingInfoMax = 0x7fffffff, +} SpvKernelProfilingInfoShift; + +typedef enum SpvKernelProfilingInfoMask_ { + SpvKernelProfilingInfoMaskNone = 0, + SpvKernelProfilingInfoCmdExecTimeMask = 0x00000001, +} SpvKernelProfilingInfoMask; + +typedef enum SpvCapability_ { + SpvCapabilityMatrix = 0, + SpvCapabilityShader = 1, + SpvCapabilityGeometry = 2, + SpvCapabilityTessellation = 3, + SpvCapabilityAddresses = 4, + SpvCapabilityLinkage = 5, + SpvCapabilityKernel = 6, + SpvCapabilityVector16 = 7, + SpvCapabilityFloat16Buffer = 8, + SpvCapabilityFloat16 = 9, + SpvCapabilityFloat64 = 10, + SpvCapabilityInt64 = 11, + SpvCapabilityInt64Atomics = 12, + SpvCapabilityImageBasic = 13, + SpvCapabilityImageReadWrite = 14, + SpvCapabilityImageMipmap = 15, + SpvCapabilityPipes = 17, + SpvCapabilityGroups = 18, + SpvCapabilityDeviceEnqueue = 19, + SpvCapabilityLiteralSampler = 20, + SpvCapabilityAtomicStorage = 21, + SpvCapabilityInt16 = 22, + SpvCapabilityTessellationPointSize = 23, + SpvCapabilityGeometryPointSize = 24, + SpvCapabilityImageGatherExtended = 25, + SpvCapabilityStorageImageMultisample = 27, + SpvCapabilityUniformBufferArrayDynamicIndexing = 28, + SpvCapabilitySampledImageArrayDynamicIndexing = 29, + SpvCapabilityStorageBufferArrayDynamicIndexing = 30, + SpvCapabilityStorageImageArrayDynamicIndexing = 31, + SpvCapabilityClipDistance = 32, + SpvCapabilityCullDistance = 33, + SpvCapabilityImageCubeArray = 34, + SpvCapabilitySampleRateShading = 35, + SpvCapabilityImageRect = 36, + SpvCapabilitySampledRect = 37, + SpvCapabilityGenericPointer = 38, + SpvCapabilityInt8 = 39, + SpvCapabilityInputAttachment = 40, + SpvCapabilitySparseResidency = 41, + SpvCapabilityMinLod = 42, + SpvCapabilitySampled1D = 43, + SpvCapabilityImage1D = 44, + SpvCapabilitySampledCubeArray = 45, + SpvCapabilitySampledBuffer = 46, + SpvCapabilityImageBuffer = 47, + SpvCapabilityImageMSArray = 48, + SpvCapabilityStorageImageExtendedFormats = 49, + SpvCapabilityImageQuery = 50, + SpvCapabilityDerivativeControl = 51, + SpvCapabilityInterpolationFunction = 52, + SpvCapabilityTransformFeedback = 53, + SpvCapabilityGeometryStreams = 54, + SpvCapabilityStorageImageReadWithoutFormat = 55, + SpvCapabilityStorageImageWriteWithoutFormat = 56, + SpvCapabilityMultiViewport = 57, + SpvCapabilitySubgroupDispatch = 58, + SpvCapabilityNamedBarrier = 59, + SpvCapabilityPipeStorage = 60, + SpvCapabilityGroupNonUniform = 61, + SpvCapabilityGroupNonUniformVote = 62, + SpvCapabilityGroupNonUniformArithmetic = 63, + SpvCapabilityGroupNonUniformBallot = 64, + SpvCapabilityGroupNonUniformShuffle = 65, + SpvCapabilityGroupNonUniformShuffleRelative = 66, + SpvCapabilityGroupNonUniformClustered = 67, + SpvCapabilityGroupNonUniformQuad = 68, + SpvCapabilitySubgroupBallotKHR = 4423, + SpvCapabilityDrawParameters = 4427, + SpvCapabilitySubgroupVoteKHR = 4431, + SpvCapabilityStorageBuffer16BitAccess = 4433, + SpvCapabilityStorageUniformBufferBlock16 = 4433, + SpvCapabilityStorageUniform16 = 4434, + SpvCapabilityUniformAndStorageBuffer16BitAccess = 4434, + SpvCapabilityStoragePushConstant16 = 4435, + SpvCapabilityStorageInputOutput16 = 4436, + SpvCapabilityDeviceGroup = 4437, + SpvCapabilityMultiView = 4439, + SpvCapabilityVariablePointersStorageBuffer = 4441, + SpvCapabilityVariablePointers = 4442, + SpvCapabilityAtomicStorageOps = 4445, + SpvCapabilitySampleMaskPostDepthCoverage = 4447, + SpvCapabilityFloat16ImageAMD = 5008, + SpvCapabilityImageGatherBiasLodAMD = 5009, + SpvCapabilityFragmentMaskAMD = 5010, + SpvCapabilityStencilExportEXT = 5013, + SpvCapabilityImageReadWriteLodAMD = 5015, + SpvCapabilitySampleMaskOverrideCoverageNV = 5249, + SpvCapabilityGeometryShaderPassthroughNV = 5251, + SpvCapabilityShaderViewportIndexLayerEXT = 5254, + SpvCapabilityShaderViewportIndexLayerNV = 5254, + SpvCapabilityShaderViewportMaskNV = 5255, + SpvCapabilityShaderStereoViewNV = 5259, + SpvCapabilityPerViewAttributesNV = 5260, + SpvCapabilityFragmentFullyCoveredEXT = 5265, + SpvCapabilityGroupNonUniformPartitionedNV = 5297, + SpvCapabilityShaderNonUniformEXT = 5301, + SpvCapabilityRuntimeDescriptorArrayEXT = 5302, + SpvCapabilityInputAttachmentArrayDynamicIndexingEXT = 5303, + SpvCapabilityUniformTexelBufferArrayDynamicIndexingEXT = 5304, + SpvCapabilityStorageTexelBufferArrayDynamicIndexingEXT = 5305, + SpvCapabilityUniformBufferArrayNonUniformIndexingEXT = 5306, + SpvCapabilitySampledImageArrayNonUniformIndexingEXT = 5307, + SpvCapabilityStorageBufferArrayNonUniformIndexingEXT = 5308, + SpvCapabilityStorageImageArrayNonUniformIndexingEXT = 5309, + SpvCapabilityInputAttachmentArrayNonUniformIndexingEXT = 5310, + SpvCapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311, + SpvCapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312, + SpvCapabilitySubgroupShuffleINTEL = 5568, + SpvCapabilitySubgroupBufferBlockIOINTEL = 5569, + SpvCapabilitySubgroupImageBlockIOINTEL = 5570, + SpvCapabilityMax = 0x7fffffff, +} SpvCapability; + +typedef enum SpvOp_ { + SpvOpNop = 0, + SpvOpUndef = 1, + SpvOpSourceContinued = 2, + SpvOpSource = 3, + SpvOpSourceExtension = 4, + SpvOpName = 5, + SpvOpMemberName = 6, + SpvOpString = 7, + SpvOpLine = 8, + SpvOpExtension = 10, + SpvOpExtInstImport = 11, + SpvOpExtInst = 12, + SpvOpMemoryModel = 14, + SpvOpEntryPoint = 15, + SpvOpExecutionMode = 16, + SpvOpCapability = 17, + SpvOpTypeVoid = 19, + SpvOpTypeBool = 20, + SpvOpTypeInt = 21, + SpvOpTypeFloat = 22, + SpvOpTypeVector = 23, + SpvOpTypeMatrix = 24, + SpvOpTypeImage = 25, + SpvOpTypeSampler = 26, + SpvOpTypeSampledImage = 27, + SpvOpTypeArray = 28, + SpvOpTypeRuntimeArray = 29, + SpvOpTypeStruct = 30, + SpvOpTypeOpaque = 31, + SpvOpTypePointer = 32, + SpvOpTypeFunction = 33, + SpvOpTypeEvent = 34, + SpvOpTypeDeviceEvent = 35, + SpvOpTypeReserveId = 36, + SpvOpTypeQueue = 37, + SpvOpTypePipe = 38, + SpvOpTypeForwardPointer = 39, + SpvOpConstantTrue = 41, + SpvOpConstantFalse = 42, + SpvOpConstant = 43, + SpvOpConstantComposite = 44, + SpvOpConstantSampler = 45, + SpvOpConstantNull = 46, + SpvOpSpecConstantTrue = 48, + SpvOpSpecConstantFalse = 49, + SpvOpSpecConstant = 50, + SpvOpSpecConstantComposite = 51, + SpvOpSpecConstantOp = 52, + SpvOpFunction = 54, + SpvOpFunctionParameter = 55, + SpvOpFunctionEnd = 56, + SpvOpFunctionCall = 57, + SpvOpVariable = 59, + SpvOpImageTexelPointer = 60, + SpvOpLoad = 61, + SpvOpStore = 62, + SpvOpCopyMemory = 63, + SpvOpCopyMemorySized = 64, + SpvOpAccessChain = 65, + SpvOpInBoundsAccessChain = 66, + SpvOpPtrAccessChain = 67, + SpvOpArrayLength = 68, + SpvOpGenericPtrMemSemantics = 69, + SpvOpInBoundsPtrAccessChain = 70, + SpvOpDecorate = 71, + SpvOpMemberDecorate = 72, + SpvOpDecorationGroup = 73, + SpvOpGroupDecorate = 74, + SpvOpGroupMemberDecorate = 75, + SpvOpVectorExtractDynamic = 77, + SpvOpVectorInsertDynamic = 78, + SpvOpVectorShuffle = 79, + SpvOpCompositeConstruct = 80, + SpvOpCompositeExtract = 81, + SpvOpCompositeInsert = 82, + SpvOpCopyObject = 83, + SpvOpTranspose = 84, + SpvOpSampledImage = 86, + SpvOpImageSampleImplicitLod = 87, + SpvOpImageSampleExplicitLod = 88, + SpvOpImageSampleDrefImplicitLod = 89, + SpvOpImageSampleDrefExplicitLod = 90, + SpvOpImageSampleProjImplicitLod = 91, + SpvOpImageSampleProjExplicitLod = 92, + SpvOpImageSampleProjDrefImplicitLod = 93, + SpvOpImageSampleProjDrefExplicitLod = 94, + SpvOpImageFetch = 95, + SpvOpImageGather = 96, + SpvOpImageDrefGather = 97, + SpvOpImageRead = 98, + SpvOpImageWrite = 99, + SpvOpImage = 100, + SpvOpImageQueryFormat = 101, + SpvOpImageQueryOrder = 102, + SpvOpImageQuerySizeLod = 103, + SpvOpImageQuerySize = 104, + SpvOpImageQueryLod = 105, + SpvOpImageQueryLevels = 106, + SpvOpImageQuerySamples = 107, + SpvOpConvertFToU = 109, + SpvOpConvertFToS = 110, + SpvOpConvertSToF = 111, + SpvOpConvertUToF = 112, + SpvOpUConvert = 113, + SpvOpSConvert = 114, + SpvOpFConvert = 115, + SpvOpQuantizeToF16 = 116, + SpvOpConvertPtrToU = 117, + SpvOpSatConvertSToU = 118, + SpvOpSatConvertUToS = 119, + SpvOpConvertUToPtr = 120, + SpvOpPtrCastToGeneric = 121, + SpvOpGenericCastToPtr = 122, + SpvOpGenericCastToPtrExplicit = 123, + SpvOpBitcast = 124, + SpvOpSNegate = 126, + SpvOpFNegate = 127, + SpvOpIAdd = 128, + SpvOpFAdd = 129, + SpvOpISub = 130, + SpvOpFSub = 131, + SpvOpIMul = 132, + SpvOpFMul = 133, + SpvOpUDiv = 134, + SpvOpSDiv = 135, + SpvOpFDiv = 136, + SpvOpUMod = 137, + SpvOpSRem = 138, + SpvOpSMod = 139, + SpvOpFRem = 140, + SpvOpFMod = 141, + SpvOpVectorTimesScalar = 142, + SpvOpMatrixTimesScalar = 143, + SpvOpVectorTimesMatrix = 144, + SpvOpMatrixTimesVector = 145, + SpvOpMatrixTimesMatrix = 146, + SpvOpOuterProduct = 147, + SpvOpDot = 148, + SpvOpIAddCarry = 149, + SpvOpISubBorrow = 150, + SpvOpUMulExtended = 151, + SpvOpSMulExtended = 152, + SpvOpAny = 154, + SpvOpAll = 155, + SpvOpIsNan = 156, + SpvOpIsInf = 157, + SpvOpIsFinite = 158, + SpvOpIsNormal = 159, + SpvOpSignBitSet = 160, + SpvOpLessOrGreater = 161, + SpvOpOrdered = 162, + SpvOpUnordered = 163, + SpvOpLogicalEqual = 164, + SpvOpLogicalNotEqual = 165, + SpvOpLogicalOr = 166, + SpvOpLogicalAnd = 167, + SpvOpLogicalNot = 168, + SpvOpSelect = 169, + SpvOpIEqual = 170, + SpvOpINotEqual = 171, + SpvOpUGreaterThan = 172, + SpvOpSGreaterThan = 173, + SpvOpUGreaterThanEqual = 174, + SpvOpSGreaterThanEqual = 175, + SpvOpULessThan = 176, + SpvOpSLessThan = 177, + SpvOpULessThanEqual = 178, + SpvOpSLessThanEqual = 179, + SpvOpFOrdEqual = 180, + SpvOpFUnordEqual = 181, + SpvOpFOrdNotEqual = 182, + SpvOpFUnordNotEqual = 183, + SpvOpFOrdLessThan = 184, + SpvOpFUnordLessThan = 185, + SpvOpFOrdGreaterThan = 186, + SpvOpFUnordGreaterThan = 187, + SpvOpFOrdLessThanEqual = 188, + SpvOpFUnordLessThanEqual = 189, + SpvOpFOrdGreaterThanEqual = 190, + SpvOpFUnordGreaterThanEqual = 191, + SpvOpShiftRightLogical = 194, + SpvOpShiftRightArithmetic = 195, + SpvOpShiftLeftLogical = 196, + SpvOpBitwiseOr = 197, + SpvOpBitwiseXor = 198, + SpvOpBitwiseAnd = 199, + SpvOpNot = 200, + SpvOpBitFieldInsert = 201, + SpvOpBitFieldSExtract = 202, + SpvOpBitFieldUExtract = 203, + SpvOpBitReverse = 204, + SpvOpBitCount = 205, + SpvOpDPdx = 207, + SpvOpDPdy = 208, + SpvOpFwidth = 209, + SpvOpDPdxFine = 210, + SpvOpDPdyFine = 211, + SpvOpFwidthFine = 212, + SpvOpDPdxCoarse = 213, + SpvOpDPdyCoarse = 214, + SpvOpFwidthCoarse = 215, + SpvOpEmitVertex = 218, + SpvOpEndPrimitive = 219, + SpvOpEmitStreamVertex = 220, + SpvOpEndStreamPrimitive = 221, + SpvOpControlBarrier = 224, + SpvOpMemoryBarrier = 225, + SpvOpAtomicLoad = 227, + SpvOpAtomicStore = 228, + SpvOpAtomicExchange = 229, + SpvOpAtomicCompareExchange = 230, + SpvOpAtomicCompareExchangeWeak = 231, + SpvOpAtomicIIncrement = 232, + SpvOpAtomicIDecrement = 233, + SpvOpAtomicIAdd = 234, + SpvOpAtomicISub = 235, + SpvOpAtomicSMin = 236, + SpvOpAtomicUMin = 237, + SpvOpAtomicSMax = 238, + SpvOpAtomicUMax = 239, + SpvOpAtomicAnd = 240, + SpvOpAtomicOr = 241, + SpvOpAtomicXor = 242, + SpvOpPhi = 245, + SpvOpLoopMerge = 246, + SpvOpSelectionMerge = 247, + SpvOpLabel = 248, + SpvOpBranch = 249, + SpvOpBranchConditional = 250, + SpvOpSwitch = 251, + SpvOpKill = 252, + SpvOpReturn = 253, + SpvOpReturnValue = 254, + SpvOpUnreachable = 255, + SpvOpLifetimeStart = 256, + SpvOpLifetimeStop = 257, + SpvOpGroupAsyncCopy = 259, + SpvOpGroupWaitEvents = 260, + SpvOpGroupAll = 261, + SpvOpGroupAny = 262, + SpvOpGroupBroadcast = 263, + SpvOpGroupIAdd = 264, + SpvOpGroupFAdd = 265, + SpvOpGroupFMin = 266, + SpvOpGroupUMin = 267, + SpvOpGroupSMin = 268, + SpvOpGroupFMax = 269, + SpvOpGroupUMax = 270, + SpvOpGroupSMax = 271, + SpvOpReadPipe = 274, + SpvOpWritePipe = 275, + SpvOpReservedReadPipe = 276, + SpvOpReservedWritePipe = 277, + SpvOpReserveReadPipePackets = 278, + SpvOpReserveWritePipePackets = 279, + SpvOpCommitReadPipe = 280, + SpvOpCommitWritePipe = 281, + SpvOpIsValidReserveId = 282, + SpvOpGetNumPipePackets = 283, + SpvOpGetMaxPipePackets = 284, + SpvOpGroupReserveReadPipePackets = 285, + SpvOpGroupReserveWritePipePackets = 286, + SpvOpGroupCommitReadPipe = 287, + SpvOpGroupCommitWritePipe = 288, + SpvOpEnqueueMarker = 291, + SpvOpEnqueueKernel = 292, + SpvOpGetKernelNDrangeSubGroupCount = 293, + SpvOpGetKernelNDrangeMaxSubGroupSize = 294, + SpvOpGetKernelWorkGroupSize = 295, + SpvOpGetKernelPreferredWorkGroupSizeMultiple = 296, + SpvOpRetainEvent = 297, + SpvOpReleaseEvent = 298, + SpvOpCreateUserEvent = 299, + SpvOpIsValidEvent = 300, + SpvOpSetUserEventStatus = 301, + SpvOpCaptureEventProfilingInfo = 302, + SpvOpGetDefaultQueue = 303, + SpvOpBuildNDRange = 304, + SpvOpImageSparseSampleImplicitLod = 305, + SpvOpImageSparseSampleExplicitLod = 306, + SpvOpImageSparseSampleDrefImplicitLod = 307, + SpvOpImageSparseSampleDrefExplicitLod = 308, + SpvOpImageSparseSampleProjImplicitLod = 309, + SpvOpImageSparseSampleProjExplicitLod = 310, + SpvOpImageSparseSampleProjDrefImplicitLod = 311, + SpvOpImageSparseSampleProjDrefExplicitLod = 312, + SpvOpImageSparseFetch = 313, + SpvOpImageSparseGather = 314, + SpvOpImageSparseDrefGather = 315, + SpvOpImageSparseTexelsResident = 316, + SpvOpNoLine = 317, + SpvOpAtomicFlagTestAndSet = 318, + SpvOpAtomicFlagClear = 319, + SpvOpImageSparseRead = 320, + SpvOpSizeOf = 321, + SpvOpTypePipeStorage = 322, + SpvOpConstantPipeStorage = 323, + SpvOpCreatePipeFromPipeStorage = 324, + SpvOpGetKernelLocalSizeForSubgroupCount = 325, + SpvOpGetKernelMaxNumSubgroups = 326, + SpvOpTypeNamedBarrier = 327, + SpvOpNamedBarrierInitialize = 328, + SpvOpMemoryNamedBarrier = 329, + SpvOpModuleProcessed = 330, + SpvOpExecutionModeId = 331, + SpvOpDecorateId = 332, + SpvOpGroupNonUniformElect = 333, + SpvOpGroupNonUniformAll = 334, + SpvOpGroupNonUniformAny = 335, + SpvOpGroupNonUniformAllEqual = 336, + SpvOpGroupNonUniformBroadcast = 337, + SpvOpGroupNonUniformBroadcastFirst = 338, + SpvOpGroupNonUniformBallot = 339, + SpvOpGroupNonUniformInverseBallot = 340, + SpvOpGroupNonUniformBallotBitExtract = 341, + SpvOpGroupNonUniformBallotBitCount = 342, + SpvOpGroupNonUniformBallotFindLSB = 343, + SpvOpGroupNonUniformBallotFindMSB = 344, + SpvOpGroupNonUniformShuffle = 345, + SpvOpGroupNonUniformShuffleXor = 346, + SpvOpGroupNonUniformShuffleUp = 347, + SpvOpGroupNonUniformShuffleDown = 348, + SpvOpGroupNonUniformIAdd = 349, + SpvOpGroupNonUniformFAdd = 350, + SpvOpGroupNonUniformIMul = 351, + SpvOpGroupNonUniformFMul = 352, + SpvOpGroupNonUniformSMin = 353, + SpvOpGroupNonUniformUMin = 354, + SpvOpGroupNonUniformFMin = 355, + SpvOpGroupNonUniformSMax = 356, + SpvOpGroupNonUniformUMax = 357, + SpvOpGroupNonUniformFMax = 358, + SpvOpGroupNonUniformBitwiseAnd = 359, + SpvOpGroupNonUniformBitwiseOr = 360, + SpvOpGroupNonUniformBitwiseXor = 361, + SpvOpGroupNonUniformLogicalAnd = 362, + SpvOpGroupNonUniformLogicalOr = 363, + SpvOpGroupNonUniformLogicalXor = 364, + SpvOpGroupNonUniformQuadBroadcast = 365, + SpvOpGroupNonUniformQuadSwap = 366, + SpvOpSubgroupBallotKHR = 4421, + SpvOpSubgroupFirstInvocationKHR = 4422, + SpvOpSubgroupAllKHR = 4428, + SpvOpSubgroupAnyKHR = 4429, + SpvOpSubgroupAllEqualKHR = 4430, + SpvOpSubgroupReadInvocationKHR = 4432, + SpvOpGroupIAddNonUniformAMD = 5000, + SpvOpGroupFAddNonUniformAMD = 5001, + SpvOpGroupFMinNonUniformAMD = 5002, + SpvOpGroupUMinNonUniformAMD = 5003, + SpvOpGroupSMinNonUniformAMD = 5004, + SpvOpGroupFMaxNonUniformAMD = 5005, + SpvOpGroupUMaxNonUniformAMD = 5006, + SpvOpGroupSMaxNonUniformAMD = 5007, + SpvOpFragmentMaskFetchAMD = 5011, + SpvOpFragmentFetchAMD = 5012, + SpvOpGroupNonUniformPartitionNV = 5296, + SpvOpSubgroupShuffleINTEL = 5571, + SpvOpSubgroupShuffleDownINTEL = 5572, + SpvOpSubgroupShuffleUpINTEL = 5573, + SpvOpSubgroupShuffleXorINTEL = 5574, + SpvOpSubgroupBlockReadINTEL = 5575, + SpvOpSubgroupBlockWriteINTEL = 5576, + SpvOpSubgroupImageBlockReadINTEL = 5577, + SpvOpSubgroupImageBlockWriteINTEL = 5578, + SpvOpDecorateStringGOOGLE = 5632, + SpvOpMemberDecorateStringGOOGLE = 5633, + SpvOpMax = 0x7fffffff, +} SpvOp; + +#endif // #ifndef spirv_H + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1099 @@ +// Copyright (c) 2014-2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// This header is automatically generated by the same tool that creates +// the Binary Section of the SPIR-V specification. + +// Enumeration tokens for SPIR-V, in various styles: +// C, C++, C++11, JSON, Lua, Python +// +// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// +// Some tokens act like mask values, which can be OR'd together, +// while others are mutually exclusive. The mask-like ones have +// "Mask" in their name, and a parallel enum that has the shift +// amount (1 << x) for each corresponding enumerant. + +#ifndef spirv_HPP +#define spirv_HPP + +namespace spv { + +typedef unsigned int Id; + +#define SPV_VERSION 0x10300 +#define SPV_REVISION 1 + +static const unsigned int MagicNumber = 0x07230203; +static const unsigned int Version = 0x00010300; +static const unsigned int Revision = 1; +static const unsigned int OpCodeMask = 0xffff; +static const unsigned int WordCountShift = 16; + +enum SourceLanguage { + SourceLanguageUnknown = 0, + SourceLanguageESSL = 1, + SourceLanguageGLSL = 2, + SourceLanguageOpenCL_C = 3, + SourceLanguageOpenCL_CPP = 4, + SourceLanguageHLSL = 5, + SourceLanguageMax = 0x7fffffff, +}; + +enum ExecutionModel { + ExecutionModelVertex = 0, + ExecutionModelTessellationControl = 1, + ExecutionModelTessellationEvaluation = 2, + ExecutionModelGeometry = 3, + ExecutionModelFragment = 4, + ExecutionModelGLCompute = 5, + ExecutionModelKernel = 6, + ExecutionModelMax = 0x7fffffff, +}; + +enum AddressingModel { + AddressingModelLogical = 0, + AddressingModelPhysical32 = 1, + AddressingModelPhysical64 = 2, + AddressingModelMax = 0x7fffffff, +}; + +enum MemoryModel { + MemoryModelSimple = 0, + MemoryModelGLSL450 = 1, + MemoryModelOpenCL = 2, + MemoryModelMax = 0x7fffffff, +}; + +enum ExecutionMode { + ExecutionModeInvocations = 0, + ExecutionModeSpacingEqual = 1, + ExecutionModeSpacingFractionalEven = 2, + ExecutionModeSpacingFractionalOdd = 3, + ExecutionModeVertexOrderCw = 4, + ExecutionModeVertexOrderCcw = 5, + ExecutionModePixelCenterInteger = 6, + ExecutionModeOriginUpperLeft = 7, + ExecutionModeOriginLowerLeft = 8, + ExecutionModeEarlyFragmentTests = 9, + ExecutionModePointMode = 10, + ExecutionModeXfb = 11, + ExecutionModeDepthReplacing = 12, + ExecutionModeDepthGreater = 14, + ExecutionModeDepthLess = 15, + ExecutionModeDepthUnchanged = 16, + ExecutionModeLocalSize = 17, + ExecutionModeLocalSizeHint = 18, + ExecutionModeInputPoints = 19, + ExecutionModeInputLines = 20, + ExecutionModeInputLinesAdjacency = 21, + ExecutionModeTriangles = 22, + ExecutionModeInputTrianglesAdjacency = 23, + ExecutionModeQuads = 24, + ExecutionModeIsolines = 25, + ExecutionModeOutputVertices = 26, + ExecutionModeOutputPoints = 27, + ExecutionModeOutputLineStrip = 28, + ExecutionModeOutputTriangleStrip = 29, + ExecutionModeVecTypeHint = 30, + ExecutionModeContractionOff = 31, + ExecutionModeInitializer = 33, + ExecutionModeFinalizer = 34, + ExecutionModeSubgroupSize = 35, + ExecutionModeSubgroupsPerWorkgroup = 36, + ExecutionModeSubgroupsPerWorkgroupId = 37, + ExecutionModeLocalSizeId = 38, + ExecutionModeLocalSizeHintId = 39, + ExecutionModePostDepthCoverage = 4446, + ExecutionModeStencilRefReplacingEXT = 5027, + ExecutionModeMax = 0x7fffffff, +}; + +enum StorageClass { + StorageClassUniformConstant = 0, + StorageClassInput = 1, + StorageClassUniform = 2, + StorageClassOutput = 3, + StorageClassWorkgroup = 4, + StorageClassCrossWorkgroup = 5, + StorageClassPrivate = 6, + StorageClassFunction = 7, + StorageClassGeneric = 8, + StorageClassPushConstant = 9, + StorageClassAtomicCounter = 10, + StorageClassImage = 11, + StorageClassStorageBuffer = 12, + StorageClassMax = 0x7fffffff, +}; + +enum Dim { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + DimCube = 3, + DimRect = 4, + DimBuffer = 5, + DimSubpassData = 6, + DimMax = 0x7fffffff, +}; + +enum SamplerAddressingMode { + SamplerAddressingModeNone = 0, + SamplerAddressingModeClampToEdge = 1, + SamplerAddressingModeClamp = 2, + SamplerAddressingModeRepeat = 3, + SamplerAddressingModeRepeatMirrored = 4, + SamplerAddressingModeMax = 0x7fffffff, +}; + +enum SamplerFilterMode { + SamplerFilterModeNearest = 0, + SamplerFilterModeLinear = 1, + SamplerFilterModeMax = 0x7fffffff, +}; + +enum ImageFormat { + ImageFormatUnknown = 0, + ImageFormatRgba32f = 1, + ImageFormatRgba16f = 2, + ImageFormatR32f = 3, + ImageFormatRgba8 = 4, + ImageFormatRgba8Snorm = 5, + ImageFormatRg32f = 6, + ImageFormatRg16f = 7, + ImageFormatR11fG11fB10f = 8, + ImageFormatR16f = 9, + ImageFormatRgba16 = 10, + ImageFormatRgb10A2 = 11, + ImageFormatRg16 = 12, + ImageFormatRg8 = 13, + ImageFormatR16 = 14, + ImageFormatR8 = 15, + ImageFormatRgba16Snorm = 16, + ImageFormatRg16Snorm = 17, + ImageFormatRg8Snorm = 18, + ImageFormatR16Snorm = 19, + ImageFormatR8Snorm = 20, + ImageFormatRgba32i = 21, + ImageFormatRgba16i = 22, + ImageFormatRgba8i = 23, + ImageFormatR32i = 24, + ImageFormatRg32i = 25, + ImageFormatRg16i = 26, + ImageFormatRg8i = 27, + ImageFormatR16i = 28, + ImageFormatR8i = 29, + ImageFormatRgba32ui = 30, + ImageFormatRgba16ui = 31, + ImageFormatRgba8ui = 32, + ImageFormatR32ui = 33, + ImageFormatRgb10a2ui = 34, + ImageFormatRg32ui = 35, + ImageFormatRg16ui = 36, + ImageFormatRg8ui = 37, + ImageFormatR16ui = 38, + ImageFormatR8ui = 39, + ImageFormatMax = 0x7fffffff, +}; + +enum ImageChannelOrder { + ImageChannelOrderR = 0, + ImageChannelOrderA = 1, + ImageChannelOrderRG = 2, + ImageChannelOrderRA = 3, + ImageChannelOrderRGB = 4, + ImageChannelOrderRGBA = 5, + ImageChannelOrderBGRA = 6, + ImageChannelOrderARGB = 7, + ImageChannelOrderIntensity = 8, + ImageChannelOrderLuminance = 9, + ImageChannelOrderRx = 10, + ImageChannelOrderRGx = 11, + ImageChannelOrderRGBx = 12, + ImageChannelOrderDepth = 13, + ImageChannelOrderDepthStencil = 14, + ImageChannelOrdersRGB = 15, + ImageChannelOrdersRGBx = 16, + ImageChannelOrdersRGBA = 17, + ImageChannelOrdersBGRA = 18, + ImageChannelOrderABGR = 19, + ImageChannelOrderMax = 0x7fffffff, +}; + +enum ImageChannelDataType { + ImageChannelDataTypeSnormInt8 = 0, + ImageChannelDataTypeSnormInt16 = 1, + ImageChannelDataTypeUnormInt8 = 2, + ImageChannelDataTypeUnormInt16 = 3, + ImageChannelDataTypeUnormShort565 = 4, + ImageChannelDataTypeUnormShort555 = 5, + ImageChannelDataTypeUnormInt101010 = 6, + ImageChannelDataTypeSignedInt8 = 7, + ImageChannelDataTypeSignedInt16 = 8, + ImageChannelDataTypeSignedInt32 = 9, + ImageChannelDataTypeUnsignedInt8 = 10, + ImageChannelDataTypeUnsignedInt16 = 11, + ImageChannelDataTypeUnsignedInt32 = 12, + ImageChannelDataTypeHalfFloat = 13, + ImageChannelDataTypeFloat = 14, + ImageChannelDataTypeUnormInt24 = 15, + ImageChannelDataTypeUnormInt101010_2 = 16, + ImageChannelDataTypeMax = 0x7fffffff, +}; + +enum ImageOperandsShift { + ImageOperandsBiasShift = 0, + ImageOperandsLodShift = 1, + ImageOperandsGradShift = 2, + ImageOperandsConstOffsetShift = 3, + ImageOperandsOffsetShift = 4, + ImageOperandsConstOffsetsShift = 5, + ImageOperandsSampleShift = 6, + ImageOperandsMinLodShift = 7, + ImageOperandsMax = 0x7fffffff, +}; + +enum ImageOperandsMask { + ImageOperandsMaskNone = 0, + ImageOperandsBiasMask = 0x00000001, + ImageOperandsLodMask = 0x00000002, + ImageOperandsGradMask = 0x00000004, + ImageOperandsConstOffsetMask = 0x00000008, + ImageOperandsOffsetMask = 0x00000010, + ImageOperandsConstOffsetsMask = 0x00000020, + ImageOperandsSampleMask = 0x00000040, + ImageOperandsMinLodMask = 0x00000080, +}; + +enum FPFastMathModeShift { + FPFastMathModeNotNaNShift = 0, + FPFastMathModeNotInfShift = 1, + FPFastMathModeNSZShift = 2, + FPFastMathModeAllowRecipShift = 3, + FPFastMathModeFastShift = 4, + FPFastMathModeMax = 0x7fffffff, +}; + +enum FPFastMathModeMask { + FPFastMathModeMaskNone = 0, + FPFastMathModeNotNaNMask = 0x00000001, + FPFastMathModeNotInfMask = 0x00000002, + FPFastMathModeNSZMask = 0x00000004, + FPFastMathModeAllowRecipMask = 0x00000008, + FPFastMathModeFastMask = 0x00000010, +}; + +enum FPRoundingMode { + FPRoundingModeRTE = 0, + FPRoundingModeRTZ = 1, + FPRoundingModeRTP = 2, + FPRoundingModeRTN = 3, + FPRoundingModeMax = 0x7fffffff, +}; + +enum LinkageType { + LinkageTypeExport = 0, + LinkageTypeImport = 1, + LinkageTypeMax = 0x7fffffff, +}; + +enum AccessQualifier { + AccessQualifierReadOnly = 0, + AccessQualifierWriteOnly = 1, + AccessQualifierReadWrite = 2, + AccessQualifierMax = 0x7fffffff, +}; + +enum FunctionParameterAttribute { + FunctionParameterAttributeZext = 0, + FunctionParameterAttributeSext = 1, + FunctionParameterAttributeByVal = 2, + FunctionParameterAttributeSret = 3, + FunctionParameterAttributeNoAlias = 4, + FunctionParameterAttributeNoCapture = 5, + FunctionParameterAttributeNoWrite = 6, + FunctionParameterAttributeNoReadWrite = 7, + FunctionParameterAttributeMax = 0x7fffffff, +}; + +enum Decoration { + DecorationRelaxedPrecision = 0, + DecorationSpecId = 1, + DecorationBlock = 2, + DecorationBufferBlock = 3, + DecorationRowMajor = 4, + DecorationColMajor = 5, + DecorationArrayStride = 6, + DecorationMatrixStride = 7, + DecorationGLSLShared = 8, + DecorationGLSLPacked = 9, + DecorationCPacked = 10, + DecorationBuiltIn = 11, + DecorationNoPerspective = 13, + DecorationFlat = 14, + DecorationPatch = 15, + DecorationCentroid = 16, + DecorationSample = 17, + DecorationInvariant = 18, + DecorationRestrict = 19, + DecorationAliased = 20, + DecorationVolatile = 21, + DecorationConstant = 22, + DecorationCoherent = 23, + DecorationNonWritable = 24, + DecorationNonReadable = 25, + DecorationUniform = 26, + DecorationSaturatedConversion = 28, + DecorationStream = 29, + DecorationLocation = 30, + DecorationComponent = 31, + DecorationIndex = 32, + DecorationBinding = 33, + DecorationDescriptorSet = 34, + DecorationOffset = 35, + DecorationXfbBuffer = 36, + DecorationXfbStride = 37, + DecorationFuncParamAttr = 38, + DecorationFPRoundingMode = 39, + DecorationFPFastMathMode = 40, + DecorationLinkageAttributes = 41, + DecorationNoContraction = 42, + DecorationInputAttachmentIndex = 43, + DecorationAlignment = 44, + DecorationMaxByteOffset = 45, + DecorationAlignmentId = 46, + DecorationMaxByteOffsetId = 47, + DecorationExplicitInterpAMD = 4999, + DecorationOverrideCoverageNV = 5248, + DecorationPassthroughNV = 5250, + DecorationViewportRelativeNV = 5252, + DecorationSecondaryViewportRelativeNV = 5256, + DecorationNonUniformEXT = 5300, + DecorationHlslCounterBufferGOOGLE = 5634, + DecorationHlslSemanticGOOGLE = 5635, + DecorationMax = 0x7fffffff, +}; + +enum BuiltIn { + BuiltInPosition = 0, + BuiltInPointSize = 1, + BuiltInClipDistance = 3, + BuiltInCullDistance = 4, + BuiltInVertexId = 5, + BuiltInInstanceId = 6, + BuiltInPrimitiveId = 7, + BuiltInInvocationId = 8, + BuiltInLayer = 9, + BuiltInViewportIndex = 10, + BuiltInTessLevelOuter = 11, + BuiltInTessLevelInner = 12, + BuiltInTessCoord = 13, + BuiltInPatchVertices = 14, + BuiltInFragCoord = 15, + BuiltInPointCoord = 16, + BuiltInFrontFacing = 17, + BuiltInSampleId = 18, + BuiltInSamplePosition = 19, + BuiltInSampleMask = 20, + BuiltInFragDepth = 22, + BuiltInHelperInvocation = 23, + BuiltInNumWorkgroups = 24, + BuiltInWorkgroupSize = 25, + BuiltInWorkgroupId = 26, + BuiltInLocalInvocationId = 27, + BuiltInGlobalInvocationId = 28, + BuiltInLocalInvocationIndex = 29, + BuiltInWorkDim = 30, + BuiltInGlobalSize = 31, + BuiltInEnqueuedWorkgroupSize = 32, + BuiltInGlobalOffset = 33, + BuiltInGlobalLinearId = 34, + BuiltInSubgroupSize = 36, + BuiltInSubgroupMaxSize = 37, + BuiltInNumSubgroups = 38, + BuiltInNumEnqueuedSubgroups = 39, + BuiltInSubgroupId = 40, + BuiltInSubgroupLocalInvocationId = 41, + BuiltInVertexIndex = 42, + BuiltInInstanceIndex = 43, + BuiltInSubgroupEqMask = 4416, + BuiltInSubgroupEqMaskKHR = 4416, + BuiltInSubgroupGeMask = 4417, + BuiltInSubgroupGeMaskKHR = 4417, + BuiltInSubgroupGtMask = 4418, + BuiltInSubgroupGtMaskKHR = 4418, + BuiltInSubgroupLeMask = 4419, + BuiltInSubgroupLeMaskKHR = 4419, + BuiltInSubgroupLtMask = 4420, + BuiltInSubgroupLtMaskKHR = 4420, + BuiltInBaseVertex = 4424, + BuiltInBaseInstance = 4425, + BuiltInDrawIndex = 4426, + BuiltInDeviceIndex = 4438, + BuiltInViewIndex = 4440, + BuiltInBaryCoordNoPerspAMD = 4992, + BuiltInBaryCoordNoPerspCentroidAMD = 4993, + BuiltInBaryCoordNoPerspSampleAMD = 4994, + BuiltInBaryCoordSmoothAMD = 4995, + BuiltInBaryCoordSmoothCentroidAMD = 4996, + BuiltInBaryCoordSmoothSampleAMD = 4997, + BuiltInBaryCoordPullModelAMD = 4998, + BuiltInFragStencilRefEXT = 5014, + BuiltInViewportMaskNV = 5253, + BuiltInSecondaryPositionNV = 5257, + BuiltInSecondaryViewportMaskNV = 5258, + BuiltInPositionPerViewNV = 5261, + BuiltInViewportMaskPerViewNV = 5262, + BuiltInFullyCoveredEXT = 5264, + BuiltInMax = 0x7fffffff, +}; + +enum SelectionControlShift { + SelectionControlFlattenShift = 0, + SelectionControlDontFlattenShift = 1, + SelectionControlMax = 0x7fffffff, +}; + +enum SelectionControlMask { + SelectionControlMaskNone = 0, + SelectionControlFlattenMask = 0x00000001, + SelectionControlDontFlattenMask = 0x00000002, +}; + +enum LoopControlShift { + LoopControlUnrollShift = 0, + LoopControlDontUnrollShift = 1, + LoopControlDependencyInfiniteShift = 2, + LoopControlDependencyLengthShift = 3, + LoopControlMax = 0x7fffffff, +}; + +enum LoopControlMask { + LoopControlMaskNone = 0, + LoopControlUnrollMask = 0x00000001, + LoopControlDontUnrollMask = 0x00000002, + LoopControlDependencyInfiniteMask = 0x00000004, + LoopControlDependencyLengthMask = 0x00000008, +}; + +enum FunctionControlShift { + FunctionControlInlineShift = 0, + FunctionControlDontInlineShift = 1, + FunctionControlPureShift = 2, + FunctionControlConstShift = 3, + FunctionControlMax = 0x7fffffff, +}; + +enum FunctionControlMask { + FunctionControlMaskNone = 0, + FunctionControlInlineMask = 0x00000001, + FunctionControlDontInlineMask = 0x00000002, + FunctionControlPureMask = 0x00000004, + FunctionControlConstMask = 0x00000008, +}; + +enum MemorySemanticsShift { + MemorySemanticsAcquireShift = 1, + MemorySemanticsReleaseShift = 2, + MemorySemanticsAcquireReleaseShift = 3, + MemorySemanticsSequentiallyConsistentShift = 4, + MemorySemanticsUniformMemoryShift = 6, + MemorySemanticsSubgroupMemoryShift = 7, + MemorySemanticsWorkgroupMemoryShift = 8, + MemorySemanticsCrossWorkgroupMemoryShift = 9, + MemorySemanticsAtomicCounterMemoryShift = 10, + MemorySemanticsImageMemoryShift = 11, + MemorySemanticsMax = 0x7fffffff, +}; + +enum MemorySemanticsMask { + MemorySemanticsMaskNone = 0, + MemorySemanticsAcquireMask = 0x00000002, + MemorySemanticsReleaseMask = 0x00000004, + MemorySemanticsAcquireReleaseMask = 0x00000008, + MemorySemanticsSequentiallyConsistentMask = 0x00000010, + MemorySemanticsUniformMemoryMask = 0x00000040, + MemorySemanticsSubgroupMemoryMask = 0x00000080, + MemorySemanticsWorkgroupMemoryMask = 0x00000100, + MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, + MemorySemanticsAtomicCounterMemoryMask = 0x00000400, + MemorySemanticsImageMemoryMask = 0x00000800, +}; + +enum MemoryAccessShift { + MemoryAccessVolatileShift = 0, + MemoryAccessAlignedShift = 1, + MemoryAccessNontemporalShift = 2, + MemoryAccessMax = 0x7fffffff, +}; + +enum MemoryAccessMask { + MemoryAccessMaskNone = 0, + MemoryAccessVolatileMask = 0x00000001, + MemoryAccessAlignedMask = 0x00000002, + MemoryAccessNontemporalMask = 0x00000004, +}; + +enum Scope { + ScopeCrossDevice = 0, + ScopeDevice = 1, + ScopeWorkgroup = 2, + ScopeSubgroup = 3, + ScopeInvocation = 4, + ScopeMax = 0x7fffffff, +}; + +enum GroupOperation { + GroupOperationReduce = 0, + GroupOperationInclusiveScan = 1, + GroupOperationExclusiveScan = 2, + GroupOperationClusteredReduce = 3, + GroupOperationPartitionedReduceNV = 6, + GroupOperationPartitionedInclusiveScanNV = 7, + GroupOperationPartitionedExclusiveScanNV = 8, + GroupOperationMax = 0x7fffffff, +}; + +enum KernelEnqueueFlags { + KernelEnqueueFlagsNoWait = 0, + KernelEnqueueFlagsWaitKernel = 1, + KernelEnqueueFlagsWaitWorkGroup = 2, + KernelEnqueueFlagsMax = 0x7fffffff, +}; + +enum KernelProfilingInfoShift { + KernelProfilingInfoCmdExecTimeShift = 0, + KernelProfilingInfoMax = 0x7fffffff, +}; + +enum KernelProfilingInfoMask { + KernelProfilingInfoMaskNone = 0, + KernelProfilingInfoCmdExecTimeMask = 0x00000001, +}; + +enum Capability { + CapabilityMatrix = 0, + CapabilityShader = 1, + CapabilityGeometry = 2, + CapabilityTessellation = 3, + CapabilityAddresses = 4, + CapabilityLinkage = 5, + CapabilityKernel = 6, + CapabilityVector16 = 7, + CapabilityFloat16Buffer = 8, + CapabilityFloat16 = 9, + CapabilityFloat64 = 10, + CapabilityInt64 = 11, + CapabilityInt64Atomics = 12, + CapabilityImageBasic = 13, + CapabilityImageReadWrite = 14, + CapabilityImageMipmap = 15, + CapabilityPipes = 17, + CapabilityGroups = 18, + CapabilityDeviceEnqueue = 19, + CapabilityLiteralSampler = 20, + CapabilityAtomicStorage = 21, + CapabilityInt16 = 22, + CapabilityTessellationPointSize = 23, + CapabilityGeometryPointSize = 24, + CapabilityImageGatherExtended = 25, + CapabilityStorageImageMultisample = 27, + CapabilityUniformBufferArrayDynamicIndexing = 28, + CapabilitySampledImageArrayDynamicIndexing = 29, + CapabilityStorageBufferArrayDynamicIndexing = 30, + CapabilityStorageImageArrayDynamicIndexing = 31, + CapabilityClipDistance = 32, + CapabilityCullDistance = 33, + CapabilityImageCubeArray = 34, + CapabilitySampleRateShading = 35, + CapabilityImageRect = 36, + CapabilitySampledRect = 37, + CapabilityGenericPointer = 38, + CapabilityInt8 = 39, + CapabilityInputAttachment = 40, + CapabilitySparseResidency = 41, + CapabilityMinLod = 42, + CapabilitySampled1D = 43, + CapabilityImage1D = 44, + CapabilitySampledCubeArray = 45, + CapabilitySampledBuffer = 46, + CapabilityImageBuffer = 47, + CapabilityImageMSArray = 48, + CapabilityStorageImageExtendedFormats = 49, + CapabilityImageQuery = 50, + CapabilityDerivativeControl = 51, + CapabilityInterpolationFunction = 52, + CapabilityTransformFeedback = 53, + CapabilityGeometryStreams = 54, + CapabilityStorageImageReadWithoutFormat = 55, + CapabilityStorageImageWriteWithoutFormat = 56, + CapabilityMultiViewport = 57, + CapabilitySubgroupDispatch = 58, + CapabilityNamedBarrier = 59, + CapabilityPipeStorage = 60, + CapabilityGroupNonUniform = 61, + CapabilityGroupNonUniformVote = 62, + CapabilityGroupNonUniformArithmetic = 63, + CapabilityGroupNonUniformBallot = 64, + CapabilityGroupNonUniformShuffle = 65, + CapabilityGroupNonUniformShuffleRelative = 66, + CapabilityGroupNonUniformClustered = 67, + CapabilityGroupNonUniformQuad = 68, + CapabilitySubgroupBallotKHR = 4423, + CapabilityDrawParameters = 4427, + CapabilitySubgroupVoteKHR = 4431, + CapabilityStorageBuffer16BitAccess = 4433, + CapabilityStorageUniformBufferBlock16 = 4433, + CapabilityStorageUniform16 = 4434, + CapabilityUniformAndStorageBuffer16BitAccess = 4434, + CapabilityStoragePushConstant16 = 4435, + CapabilityStorageInputOutput16 = 4436, + CapabilityDeviceGroup = 4437, + CapabilityMultiView = 4439, + CapabilityVariablePointersStorageBuffer = 4441, + CapabilityVariablePointers = 4442, + CapabilityAtomicStorageOps = 4445, + CapabilitySampleMaskPostDepthCoverage = 4447, + CapabilityFloat16ImageAMD = 5008, + CapabilityImageGatherBiasLodAMD = 5009, + CapabilityFragmentMaskAMD = 5010, + CapabilityStencilExportEXT = 5013, + CapabilityImageReadWriteLodAMD = 5015, + CapabilitySampleMaskOverrideCoverageNV = 5249, + CapabilityGeometryShaderPassthroughNV = 5251, + CapabilityShaderViewportIndexLayerEXT = 5254, + CapabilityShaderViewportIndexLayerNV = 5254, + CapabilityShaderViewportMaskNV = 5255, + CapabilityShaderStereoViewNV = 5259, + CapabilityPerViewAttributesNV = 5260, + CapabilityFragmentFullyCoveredEXT = 5265, + CapabilityGroupNonUniformPartitionedNV = 5297, + CapabilityShaderNonUniformEXT = 5301, + CapabilityRuntimeDescriptorArrayEXT = 5302, + CapabilityInputAttachmentArrayDynamicIndexingEXT = 5303, + CapabilityUniformTexelBufferArrayDynamicIndexingEXT = 5304, + CapabilityStorageTexelBufferArrayDynamicIndexingEXT = 5305, + CapabilityUniformBufferArrayNonUniformIndexingEXT = 5306, + CapabilitySampledImageArrayNonUniformIndexingEXT = 5307, + CapabilityStorageBufferArrayNonUniformIndexingEXT = 5308, + CapabilityStorageImageArrayNonUniformIndexingEXT = 5309, + CapabilityInputAttachmentArrayNonUniformIndexingEXT = 5310, + CapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311, + CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312, + CapabilitySubgroupShuffleINTEL = 5568, + CapabilitySubgroupBufferBlockIOINTEL = 5569, + CapabilitySubgroupImageBlockIOINTEL = 5570, + CapabilityMax = 0x7fffffff, +}; + +enum Op { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpExecutionModeId = 331, + OpDecorateId = 332, + OpGroupNonUniformElect = 333, + OpGroupNonUniformAll = 334, + OpGroupNonUniformAny = 335, + OpGroupNonUniformAllEqual = 336, + OpGroupNonUniformBroadcast = 337, + OpGroupNonUniformBroadcastFirst = 338, + OpGroupNonUniformBallot = 339, + OpGroupNonUniformInverseBallot = 340, + OpGroupNonUniformBallotBitExtract = 341, + OpGroupNonUniformBallotBitCount = 342, + OpGroupNonUniformBallotFindLSB = 343, + OpGroupNonUniformBallotFindMSB = 344, + OpGroupNonUniformShuffle = 345, + OpGroupNonUniformShuffleXor = 346, + OpGroupNonUniformShuffleUp = 347, + OpGroupNonUniformShuffleDown = 348, + OpGroupNonUniformIAdd = 349, + OpGroupNonUniformFAdd = 350, + OpGroupNonUniformIMul = 351, + OpGroupNonUniformFMul = 352, + OpGroupNonUniformSMin = 353, + OpGroupNonUniformUMin = 354, + OpGroupNonUniformFMin = 355, + OpGroupNonUniformSMax = 356, + OpGroupNonUniformUMax = 357, + OpGroupNonUniformFMax = 358, + OpGroupNonUniformBitwiseAnd = 359, + OpGroupNonUniformBitwiseOr = 360, + OpGroupNonUniformBitwiseXor = 361, + OpGroupNonUniformLogicalAnd = 362, + OpGroupNonUniformLogicalOr = 363, + OpGroupNonUniformLogicalXor = 364, + OpGroupNonUniformQuadBroadcast = 365, + OpGroupNonUniformQuadSwap = 366, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpSubgroupReadInvocationKHR = 4432, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpGroupNonUniformPartitionNV = 5296, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateStringGOOGLE = 5633, + OpMax = 0x7fffffff, +}; + +// Overload operator| for mask bit combining + +inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } + +} // end namespace spv + +#endif // #ifndef spirv_HPP + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp11 vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp11 --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp11 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp11 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1099 @@ +// Copyright (c) 2014-2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// This header is automatically generated by the same tool that creates +// the Binary Section of the SPIR-V specification. + +// Enumeration tokens for SPIR-V, in various styles: +// C, C++, C++11, JSON, Lua, Python +// +// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// +// Some tokens act like mask values, which can be OR'd together, +// while others are mutually exclusive. The mask-like ones have +// "Mask" in their name, and a parallel enum that has the shift +// amount (1 << x) for each corresponding enumerant. + +#ifndef spirv_HPP +#define spirv_HPP + +namespace spv { + +typedef unsigned int Id; + +#define SPV_VERSION 0x10300 +#define SPV_REVISION 1 + +static const unsigned int MagicNumber = 0x07230203; +static const unsigned int Version = 0x00010300; +static const unsigned int Revision = 1; +static const unsigned int OpCodeMask = 0xffff; +static const unsigned int WordCountShift = 16; + +enum class SourceLanguage : unsigned { + Unknown = 0, + ESSL = 1, + GLSL = 2, + OpenCL_C = 3, + OpenCL_CPP = 4, + HLSL = 5, + Max = 0x7fffffff, +}; + +enum class ExecutionModel : unsigned { + Vertex = 0, + TessellationControl = 1, + TessellationEvaluation = 2, + Geometry = 3, + Fragment = 4, + GLCompute = 5, + Kernel = 6, + Max = 0x7fffffff, +}; + +enum class AddressingModel : unsigned { + Logical = 0, + Physical32 = 1, + Physical64 = 2, + Max = 0x7fffffff, +}; + +enum class MemoryModel : unsigned { + Simple = 0, + GLSL450 = 1, + OpenCL = 2, + Max = 0x7fffffff, +}; + +enum class ExecutionMode : unsigned { + Invocations = 0, + SpacingEqual = 1, + SpacingFractionalEven = 2, + SpacingFractionalOdd = 3, + VertexOrderCw = 4, + VertexOrderCcw = 5, + PixelCenterInteger = 6, + OriginUpperLeft = 7, + OriginLowerLeft = 8, + EarlyFragmentTests = 9, + PointMode = 10, + Xfb = 11, + DepthReplacing = 12, + DepthGreater = 14, + DepthLess = 15, + DepthUnchanged = 16, + LocalSize = 17, + LocalSizeHint = 18, + InputPoints = 19, + InputLines = 20, + InputLinesAdjacency = 21, + Triangles = 22, + InputTrianglesAdjacency = 23, + Quads = 24, + Isolines = 25, + OutputVertices = 26, + OutputPoints = 27, + OutputLineStrip = 28, + OutputTriangleStrip = 29, + VecTypeHint = 30, + ContractionOff = 31, + Initializer = 33, + Finalizer = 34, + SubgroupSize = 35, + SubgroupsPerWorkgroup = 36, + SubgroupsPerWorkgroupId = 37, + LocalSizeId = 38, + LocalSizeHintId = 39, + PostDepthCoverage = 4446, + StencilRefReplacingEXT = 5027, + Max = 0x7fffffff, +}; + +enum class StorageClass : unsigned { + UniformConstant = 0, + Input = 1, + Uniform = 2, + Output = 3, + Workgroup = 4, + CrossWorkgroup = 5, + Private = 6, + Function = 7, + Generic = 8, + PushConstant = 9, + AtomicCounter = 10, + Image = 11, + StorageBuffer = 12, + Max = 0x7fffffff, +}; + +enum class Dim : unsigned { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + Cube = 3, + Rect = 4, + Buffer = 5, + SubpassData = 6, + Max = 0x7fffffff, +}; + +enum class SamplerAddressingMode : unsigned { + None = 0, + ClampToEdge = 1, + Clamp = 2, + Repeat = 3, + RepeatMirrored = 4, + Max = 0x7fffffff, +}; + +enum class SamplerFilterMode : unsigned { + Nearest = 0, + Linear = 1, + Max = 0x7fffffff, +}; + +enum class ImageFormat : unsigned { + Unknown = 0, + Rgba32f = 1, + Rgba16f = 2, + R32f = 3, + Rgba8 = 4, + Rgba8Snorm = 5, + Rg32f = 6, + Rg16f = 7, + R11fG11fB10f = 8, + R16f = 9, + Rgba16 = 10, + Rgb10A2 = 11, + Rg16 = 12, + Rg8 = 13, + R16 = 14, + R8 = 15, + Rgba16Snorm = 16, + Rg16Snorm = 17, + Rg8Snorm = 18, + R16Snorm = 19, + R8Snorm = 20, + Rgba32i = 21, + Rgba16i = 22, + Rgba8i = 23, + R32i = 24, + Rg32i = 25, + Rg16i = 26, + Rg8i = 27, + R16i = 28, + R8i = 29, + Rgba32ui = 30, + Rgba16ui = 31, + Rgba8ui = 32, + R32ui = 33, + Rgb10a2ui = 34, + Rg32ui = 35, + Rg16ui = 36, + Rg8ui = 37, + R16ui = 38, + R8ui = 39, + Max = 0x7fffffff, +}; + +enum class ImageChannelOrder : unsigned { + R = 0, + A = 1, + RG = 2, + RA = 3, + RGB = 4, + RGBA = 5, + BGRA = 6, + ARGB = 7, + Intensity = 8, + Luminance = 9, + Rx = 10, + RGx = 11, + RGBx = 12, + Depth = 13, + DepthStencil = 14, + sRGB = 15, + sRGBx = 16, + sRGBA = 17, + sBGRA = 18, + ABGR = 19, + Max = 0x7fffffff, +}; + +enum class ImageChannelDataType : unsigned { + SnormInt8 = 0, + SnormInt16 = 1, + UnormInt8 = 2, + UnormInt16 = 3, + UnormShort565 = 4, + UnormShort555 = 5, + UnormInt101010 = 6, + SignedInt8 = 7, + SignedInt16 = 8, + SignedInt32 = 9, + UnsignedInt8 = 10, + UnsignedInt16 = 11, + UnsignedInt32 = 12, + HalfFloat = 13, + Float = 14, + UnormInt24 = 15, + UnormInt101010_2 = 16, + Max = 0x7fffffff, +}; + +enum class ImageOperandsShift : unsigned { + Bias = 0, + Lod = 1, + Grad = 2, + ConstOffset = 3, + Offset = 4, + ConstOffsets = 5, + Sample = 6, + MinLod = 7, + Max = 0x7fffffff, +}; + +enum class ImageOperandsMask : unsigned { + MaskNone = 0, + Bias = 0x00000001, + Lod = 0x00000002, + Grad = 0x00000004, + ConstOffset = 0x00000008, + Offset = 0x00000010, + ConstOffsets = 0x00000020, + Sample = 0x00000040, + MinLod = 0x00000080, +}; + +enum class FPFastMathModeShift : unsigned { + NotNaN = 0, + NotInf = 1, + NSZ = 2, + AllowRecip = 3, + Fast = 4, + Max = 0x7fffffff, +}; + +enum class FPFastMathModeMask : unsigned { + MaskNone = 0, + NotNaN = 0x00000001, + NotInf = 0x00000002, + NSZ = 0x00000004, + AllowRecip = 0x00000008, + Fast = 0x00000010, +}; + +enum class FPRoundingMode : unsigned { + RTE = 0, + RTZ = 1, + RTP = 2, + RTN = 3, + Max = 0x7fffffff, +}; + +enum class LinkageType : unsigned { + Export = 0, + Import = 1, + Max = 0x7fffffff, +}; + +enum class AccessQualifier : unsigned { + ReadOnly = 0, + WriteOnly = 1, + ReadWrite = 2, + Max = 0x7fffffff, +}; + +enum class FunctionParameterAttribute : unsigned { + Zext = 0, + Sext = 1, + ByVal = 2, + Sret = 3, + NoAlias = 4, + NoCapture = 5, + NoWrite = 6, + NoReadWrite = 7, + Max = 0x7fffffff, +}; + +enum class Decoration : unsigned { + RelaxedPrecision = 0, + SpecId = 1, + Block = 2, + BufferBlock = 3, + RowMajor = 4, + ColMajor = 5, + ArrayStride = 6, + MatrixStride = 7, + GLSLShared = 8, + GLSLPacked = 9, + CPacked = 10, + BuiltIn = 11, + NoPerspective = 13, + Flat = 14, + Patch = 15, + Centroid = 16, + Sample = 17, + Invariant = 18, + Restrict = 19, + Aliased = 20, + Volatile = 21, + Constant = 22, + Coherent = 23, + NonWritable = 24, + NonReadable = 25, + Uniform = 26, + SaturatedConversion = 28, + Stream = 29, + Location = 30, + Component = 31, + Index = 32, + Binding = 33, + DescriptorSet = 34, + Offset = 35, + XfbBuffer = 36, + XfbStride = 37, + FuncParamAttr = 38, + FPRoundingMode = 39, + FPFastMathMode = 40, + LinkageAttributes = 41, + NoContraction = 42, + InputAttachmentIndex = 43, + Alignment = 44, + MaxByteOffset = 45, + AlignmentId = 46, + MaxByteOffsetId = 47, + ExplicitInterpAMD = 4999, + OverrideCoverageNV = 5248, + PassthroughNV = 5250, + ViewportRelativeNV = 5252, + SecondaryViewportRelativeNV = 5256, + NonUniformEXT = 5300, + HlslCounterBufferGOOGLE = 5634, + HlslSemanticGOOGLE = 5635, + Max = 0x7fffffff, +}; + +enum class BuiltIn : unsigned { + Position = 0, + PointSize = 1, + ClipDistance = 3, + CullDistance = 4, + VertexId = 5, + InstanceId = 6, + PrimitiveId = 7, + InvocationId = 8, + Layer = 9, + ViewportIndex = 10, + TessLevelOuter = 11, + TessLevelInner = 12, + TessCoord = 13, + PatchVertices = 14, + FragCoord = 15, + PointCoord = 16, + FrontFacing = 17, + SampleId = 18, + SamplePosition = 19, + SampleMask = 20, + FragDepth = 22, + HelperInvocation = 23, + NumWorkgroups = 24, + WorkgroupSize = 25, + WorkgroupId = 26, + LocalInvocationId = 27, + GlobalInvocationId = 28, + LocalInvocationIndex = 29, + WorkDim = 30, + GlobalSize = 31, + EnqueuedWorkgroupSize = 32, + GlobalOffset = 33, + GlobalLinearId = 34, + SubgroupSize = 36, + SubgroupMaxSize = 37, + NumSubgroups = 38, + NumEnqueuedSubgroups = 39, + SubgroupId = 40, + SubgroupLocalInvocationId = 41, + VertexIndex = 42, + InstanceIndex = 43, + SubgroupEqMask = 4416, + SubgroupEqMaskKHR = 4416, + SubgroupGeMask = 4417, + SubgroupGeMaskKHR = 4417, + SubgroupGtMask = 4418, + SubgroupGtMaskKHR = 4418, + SubgroupLeMask = 4419, + SubgroupLeMaskKHR = 4419, + SubgroupLtMask = 4420, + SubgroupLtMaskKHR = 4420, + BaseVertex = 4424, + BaseInstance = 4425, + DrawIndex = 4426, + DeviceIndex = 4438, + ViewIndex = 4440, + BaryCoordNoPerspAMD = 4992, + BaryCoordNoPerspCentroidAMD = 4993, + BaryCoordNoPerspSampleAMD = 4994, + BaryCoordSmoothAMD = 4995, + BaryCoordSmoothCentroidAMD = 4996, + BaryCoordSmoothSampleAMD = 4997, + BaryCoordPullModelAMD = 4998, + FragStencilRefEXT = 5014, + ViewportMaskNV = 5253, + SecondaryPositionNV = 5257, + SecondaryViewportMaskNV = 5258, + PositionPerViewNV = 5261, + ViewportMaskPerViewNV = 5262, + FullyCoveredEXT = 5264, + Max = 0x7fffffff, +}; + +enum class SelectionControlShift : unsigned { + Flatten = 0, + DontFlatten = 1, + Max = 0x7fffffff, +}; + +enum class SelectionControlMask : unsigned { + MaskNone = 0, + Flatten = 0x00000001, + DontFlatten = 0x00000002, +}; + +enum class LoopControlShift : unsigned { + Unroll = 0, + DontUnroll = 1, + DependencyInfinite = 2, + DependencyLength = 3, + Max = 0x7fffffff, +}; + +enum class LoopControlMask : unsigned { + MaskNone = 0, + Unroll = 0x00000001, + DontUnroll = 0x00000002, + DependencyInfinite = 0x00000004, + DependencyLength = 0x00000008, +}; + +enum class FunctionControlShift : unsigned { + Inline = 0, + DontInline = 1, + Pure = 2, + Const = 3, + Max = 0x7fffffff, +}; + +enum class FunctionControlMask : unsigned { + MaskNone = 0, + Inline = 0x00000001, + DontInline = 0x00000002, + Pure = 0x00000004, + Const = 0x00000008, +}; + +enum class MemorySemanticsShift : unsigned { + Acquire = 1, + Release = 2, + AcquireRelease = 3, + SequentiallyConsistent = 4, + UniformMemory = 6, + SubgroupMemory = 7, + WorkgroupMemory = 8, + CrossWorkgroupMemory = 9, + AtomicCounterMemory = 10, + ImageMemory = 11, + Max = 0x7fffffff, +}; + +enum class MemorySemanticsMask : unsigned { + MaskNone = 0, + Acquire = 0x00000002, + Release = 0x00000004, + AcquireRelease = 0x00000008, + SequentiallyConsistent = 0x00000010, + UniformMemory = 0x00000040, + SubgroupMemory = 0x00000080, + WorkgroupMemory = 0x00000100, + CrossWorkgroupMemory = 0x00000200, + AtomicCounterMemory = 0x00000400, + ImageMemory = 0x00000800, +}; + +enum class MemoryAccessShift : unsigned { + Volatile = 0, + Aligned = 1, + Nontemporal = 2, + Max = 0x7fffffff, +}; + +enum class MemoryAccessMask : unsigned { + MaskNone = 0, + Volatile = 0x00000001, + Aligned = 0x00000002, + Nontemporal = 0x00000004, +}; + +enum class Scope : unsigned { + CrossDevice = 0, + Device = 1, + Workgroup = 2, + Subgroup = 3, + Invocation = 4, + Max = 0x7fffffff, +}; + +enum class GroupOperation : unsigned { + Reduce = 0, + InclusiveScan = 1, + ExclusiveScan = 2, + ClusteredReduce = 3, + PartitionedReduceNV = 6, + PartitionedInclusiveScanNV = 7, + PartitionedExclusiveScanNV = 8, + Max = 0x7fffffff, +}; + +enum class KernelEnqueueFlags : unsigned { + NoWait = 0, + WaitKernel = 1, + WaitWorkGroup = 2, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoShift : unsigned { + CmdExecTime = 0, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoMask : unsigned { + MaskNone = 0, + CmdExecTime = 0x00000001, +}; + +enum class Capability : unsigned { + Matrix = 0, + Shader = 1, + Geometry = 2, + Tessellation = 3, + Addresses = 4, + Linkage = 5, + Kernel = 6, + Vector16 = 7, + Float16Buffer = 8, + Float16 = 9, + Float64 = 10, + Int64 = 11, + Int64Atomics = 12, + ImageBasic = 13, + ImageReadWrite = 14, + ImageMipmap = 15, + Pipes = 17, + Groups = 18, + DeviceEnqueue = 19, + LiteralSampler = 20, + AtomicStorage = 21, + Int16 = 22, + TessellationPointSize = 23, + GeometryPointSize = 24, + ImageGatherExtended = 25, + StorageImageMultisample = 27, + UniformBufferArrayDynamicIndexing = 28, + SampledImageArrayDynamicIndexing = 29, + StorageBufferArrayDynamicIndexing = 30, + StorageImageArrayDynamicIndexing = 31, + ClipDistance = 32, + CullDistance = 33, + ImageCubeArray = 34, + SampleRateShading = 35, + ImageRect = 36, + SampledRect = 37, + GenericPointer = 38, + Int8 = 39, + InputAttachment = 40, + SparseResidency = 41, + MinLod = 42, + Sampled1D = 43, + Image1D = 44, + SampledCubeArray = 45, + SampledBuffer = 46, + ImageBuffer = 47, + ImageMSArray = 48, + StorageImageExtendedFormats = 49, + ImageQuery = 50, + DerivativeControl = 51, + InterpolationFunction = 52, + TransformFeedback = 53, + GeometryStreams = 54, + StorageImageReadWithoutFormat = 55, + StorageImageWriteWithoutFormat = 56, + MultiViewport = 57, + SubgroupDispatch = 58, + NamedBarrier = 59, + PipeStorage = 60, + GroupNonUniform = 61, + GroupNonUniformVote = 62, + GroupNonUniformArithmetic = 63, + GroupNonUniformBallot = 64, + GroupNonUniformShuffle = 65, + GroupNonUniformShuffleRelative = 66, + GroupNonUniformClustered = 67, + GroupNonUniformQuad = 68, + SubgroupBallotKHR = 4423, + DrawParameters = 4427, + SubgroupVoteKHR = 4431, + StorageBuffer16BitAccess = 4433, + StorageUniformBufferBlock16 = 4433, + StorageUniform16 = 4434, + UniformAndStorageBuffer16BitAccess = 4434, + StoragePushConstant16 = 4435, + StorageInputOutput16 = 4436, + DeviceGroup = 4437, + MultiView = 4439, + VariablePointersStorageBuffer = 4441, + VariablePointers = 4442, + AtomicStorageOps = 4445, + SampleMaskPostDepthCoverage = 4447, + Float16ImageAMD = 5008, + ImageGatherBiasLodAMD = 5009, + FragmentMaskAMD = 5010, + StencilExportEXT = 5013, + ImageReadWriteLodAMD = 5015, + SampleMaskOverrideCoverageNV = 5249, + GeometryShaderPassthroughNV = 5251, + ShaderViewportIndexLayerEXT = 5254, + ShaderViewportIndexLayerNV = 5254, + ShaderViewportMaskNV = 5255, + ShaderStereoViewNV = 5259, + PerViewAttributesNV = 5260, + FragmentFullyCoveredEXT = 5265, + GroupNonUniformPartitionedNV = 5297, + ShaderNonUniformEXT = 5301, + RuntimeDescriptorArrayEXT = 5302, + InputAttachmentArrayDynamicIndexingEXT = 5303, + UniformTexelBufferArrayDynamicIndexingEXT = 5304, + StorageTexelBufferArrayDynamicIndexingEXT = 5305, + UniformBufferArrayNonUniformIndexingEXT = 5306, + SampledImageArrayNonUniformIndexingEXT = 5307, + StorageBufferArrayNonUniformIndexingEXT = 5308, + StorageImageArrayNonUniformIndexingEXT = 5309, + InputAttachmentArrayNonUniformIndexingEXT = 5310, + UniformTexelBufferArrayNonUniformIndexingEXT = 5311, + StorageTexelBufferArrayNonUniformIndexingEXT = 5312, + SubgroupShuffleINTEL = 5568, + SubgroupBufferBlockIOINTEL = 5569, + SubgroupImageBlockIOINTEL = 5570, + Max = 0x7fffffff, +}; + +enum class Op : unsigned { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpExecutionModeId = 331, + OpDecorateId = 332, + OpGroupNonUniformElect = 333, + OpGroupNonUniformAll = 334, + OpGroupNonUniformAny = 335, + OpGroupNonUniformAllEqual = 336, + OpGroupNonUniformBroadcast = 337, + OpGroupNonUniformBroadcastFirst = 338, + OpGroupNonUniformBallot = 339, + OpGroupNonUniformInverseBallot = 340, + OpGroupNonUniformBallotBitExtract = 341, + OpGroupNonUniformBallotBitCount = 342, + OpGroupNonUniformBallotFindLSB = 343, + OpGroupNonUniformBallotFindMSB = 344, + OpGroupNonUniformShuffle = 345, + OpGroupNonUniformShuffleXor = 346, + OpGroupNonUniformShuffleUp = 347, + OpGroupNonUniformShuffleDown = 348, + OpGroupNonUniformIAdd = 349, + OpGroupNonUniformFAdd = 350, + OpGroupNonUniformIMul = 351, + OpGroupNonUniformFMul = 352, + OpGroupNonUniformSMin = 353, + OpGroupNonUniformUMin = 354, + OpGroupNonUniformFMin = 355, + OpGroupNonUniformSMax = 356, + OpGroupNonUniformUMax = 357, + OpGroupNonUniformFMax = 358, + OpGroupNonUniformBitwiseAnd = 359, + OpGroupNonUniformBitwiseOr = 360, + OpGroupNonUniformBitwiseXor = 361, + OpGroupNonUniformLogicalAnd = 362, + OpGroupNonUniformLogicalOr = 363, + OpGroupNonUniformLogicalXor = 364, + OpGroupNonUniformQuadBroadcast = 365, + OpGroupNonUniformQuadSwap = 366, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpSubgroupReadInvocationKHR = 4432, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpGroupNonUniformPartitionNV = 5296, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateStringGOOGLE = 5633, + Max = 0x7fffffff, +}; + +// Overload operator| for mask bit combining + +inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } + +} // end namespace spv + +#endif // #ifndef spirv_HPP + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.json 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1115 @@ +{ + "spv": + { + "meta": + { + "Comment": + [ + [ + "Copyright (c) 2014-2018 The Khronos Group Inc.", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and/or associated documentation files (the \"Materials\"),", + "to deal in the Materials without restriction, including without limitation", + "the rights to use, copy, modify, merge, publish, distribute, sublicense,", + "and/or sell copies of the Materials, and to permit persons to whom the", + "Materials are furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Materials.", + "", + "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", + "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", + "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", + "", + "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", + "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", + "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", + "IN THE MATERIALS." + ], + [ + "This header is automatically generated by the same tool that creates", + "the Binary Section of the SPIR-V specification." + ], + [ + "Enumeration tokens for SPIR-V, in various styles:", + " C, C++, C++11, JSON, Lua, Python", + "", + "- C will have tokens with a \"Spv\" prefix, e.g.: SpvSourceLanguageGLSL", + "- C++ will have tokens in the \"spv\" name space, e.g.: spv::SourceLanguageGLSL", + "- C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL", + "- Lua will use tables, e.g.: spv.SourceLanguage.GLSL", + "- Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']", + "", + "Some tokens act like mask values, which can be OR'd together,", + "while others are mutually exclusive. The mask-like ones have", + "\"Mask\" in their name, and a parallel enum that has the shift", + "amount (1 << x) for each corresponding enumerant." + ] + ], + "MagicNumber": 119734787, + "Version": 66304, + "Revision": 1, + "OpCodeMask": 65535, + "WordCountShift": 16 + }, + "enum": + [ + { + "Name": "SourceLanguage", + "Type": "Value", + "Values": + { + "Unknown": 0, + "ESSL": 1, + "GLSL": 2, + "OpenCL_C": 3, + "OpenCL_CPP": 4, + "HLSL": 5 + } + }, + { + "Name": "ExecutionModel", + "Type": "Value", + "Values": + { + "Vertex": 0, + "TessellationControl": 1, + "TessellationEvaluation": 2, + "Geometry": 3, + "Fragment": 4, + "GLCompute": 5, + "Kernel": 6 + } + }, + { + "Name": "AddressingModel", + "Type": "Value", + "Values": + { + "Logical": 0, + "Physical32": 1, + "Physical64": 2 + } + }, + { + "Name": "MemoryModel", + "Type": "Value", + "Values": + { + "Simple": 0, + "GLSL450": 1, + "OpenCL": 2 + } + }, + { + "Name": "ExecutionMode", + "Type": "Value", + "Values": + { + "Invocations": 0, + "SpacingEqual": 1, + "SpacingFractionalEven": 2, + "SpacingFractionalOdd": 3, + "VertexOrderCw": 4, + "VertexOrderCcw": 5, + "PixelCenterInteger": 6, + "OriginUpperLeft": 7, + "OriginLowerLeft": 8, + "EarlyFragmentTests": 9, + "PointMode": 10, + "Xfb": 11, + "DepthReplacing": 12, + "DepthGreater": 14, + "DepthLess": 15, + "DepthUnchanged": 16, + "LocalSize": 17, + "LocalSizeHint": 18, + "InputPoints": 19, + "InputLines": 20, + "InputLinesAdjacency": 21, + "Triangles": 22, + "InputTrianglesAdjacency": 23, + "Quads": 24, + "Isolines": 25, + "OutputVertices": 26, + "OutputPoints": 27, + "OutputLineStrip": 28, + "OutputTriangleStrip": 29, + "VecTypeHint": 30, + "ContractionOff": 31, + "Initializer": 33, + "Finalizer": 34, + "SubgroupSize": 35, + "SubgroupsPerWorkgroup": 36, + "SubgroupsPerWorkgroupId": 37, + "LocalSizeId": 38, + "LocalSizeHintId": 39, + "PostDepthCoverage": 4446, + "StencilRefReplacingEXT": 5027 + } + }, + { + "Name": "StorageClass", + "Type": "Value", + "Values": + { + "UniformConstant": 0, + "Input": 1, + "Uniform": 2, + "Output": 3, + "Workgroup": 4, + "CrossWorkgroup": 5, + "Private": 6, + "Function": 7, + "Generic": 8, + "PushConstant": 9, + "AtomicCounter": 10, + "Image": 11, + "StorageBuffer": 12 + } + }, + { + "Name": "Dim", + "Type": "Value", + "Values": + { + "Dim1D": 0, + "Dim2D": 1, + "Dim3D": 2, + "Cube": 3, + "Rect": 4, + "Buffer": 5, + "SubpassData": 6 + } + }, + { + "Name": "SamplerAddressingMode", + "Type": "Value", + "Values": + { + "None": 0, + "ClampToEdge": 1, + "Clamp": 2, + "Repeat": 3, + "RepeatMirrored": 4 + } + }, + { + "Name": "SamplerFilterMode", + "Type": "Value", + "Values": + { + "Nearest": 0, + "Linear": 1 + } + }, + { + "Name": "ImageFormat", + "Type": "Value", + "Values": + { + "Unknown": 0, + "Rgba32f": 1, + "Rgba16f": 2, + "R32f": 3, + "Rgba8": 4, + "Rgba8Snorm": 5, + "Rg32f": 6, + "Rg16f": 7, + "R11fG11fB10f": 8, + "R16f": 9, + "Rgba16": 10, + "Rgb10A2": 11, + "Rg16": 12, + "Rg8": 13, + "R16": 14, + "R8": 15, + "Rgba16Snorm": 16, + "Rg16Snorm": 17, + "Rg8Snorm": 18, + "R16Snorm": 19, + "R8Snorm": 20, + "Rgba32i": 21, + "Rgba16i": 22, + "Rgba8i": 23, + "R32i": 24, + "Rg32i": 25, + "Rg16i": 26, + "Rg8i": 27, + "R16i": 28, + "R8i": 29, + "Rgba32ui": 30, + "Rgba16ui": 31, + "Rgba8ui": 32, + "R32ui": 33, + "Rgb10a2ui": 34, + "Rg32ui": 35, + "Rg16ui": 36, + "Rg8ui": 37, + "R16ui": 38, + "R8ui": 39 + } + }, + { + "Name": "ImageChannelOrder", + "Type": "Value", + "Values": + { + "R": 0, + "A": 1, + "RG": 2, + "RA": 3, + "RGB": 4, + "RGBA": 5, + "BGRA": 6, + "ARGB": 7, + "Intensity": 8, + "Luminance": 9, + "Rx": 10, + "RGx": 11, + "RGBx": 12, + "Depth": 13, + "DepthStencil": 14, + "sRGB": 15, + "sRGBx": 16, + "sRGBA": 17, + "sBGRA": 18, + "ABGR": 19 + } + }, + { + "Name": "ImageChannelDataType", + "Type": "Value", + "Values": + { + "SnormInt8": 0, + "SnormInt16": 1, + "UnormInt8": 2, + "UnormInt16": 3, + "UnormShort565": 4, + "UnormShort555": 5, + "UnormInt101010": 6, + "SignedInt8": 7, + "SignedInt16": 8, + "SignedInt32": 9, + "UnsignedInt8": 10, + "UnsignedInt16": 11, + "UnsignedInt32": 12, + "HalfFloat": 13, + "Float": 14, + "UnormInt24": 15, + "UnormInt101010_2": 16 + } + }, + { + "Name": "ImageOperands", + "Type": "Bit", + "Values": + { + "Bias": 0, + "Lod": 1, + "Grad": 2, + "ConstOffset": 3, + "Offset": 4, + "ConstOffsets": 5, + "Sample": 6, + "MinLod": 7 + } + }, + { + "Name": "FPFastMathMode", + "Type": "Bit", + "Values": + { + "NotNaN": 0, + "NotInf": 1, + "NSZ": 2, + "AllowRecip": 3, + "Fast": 4 + } + }, + { + "Name": "FPRoundingMode", + "Type": "Value", + "Values": + { + "RTE": 0, + "RTZ": 1, + "RTP": 2, + "RTN": 3 + } + }, + { + "Name": "LinkageType", + "Type": "Value", + "Values": + { + "Export": 0, + "Import": 1 + } + }, + { + "Name": "AccessQualifier", + "Type": "Value", + "Values": + { + "ReadOnly": 0, + "WriteOnly": 1, + "ReadWrite": 2 + } + }, + { + "Name": "FunctionParameterAttribute", + "Type": "Value", + "Values": + { + "Zext": 0, + "Sext": 1, + "ByVal": 2, + "Sret": 3, + "NoAlias": 4, + "NoCapture": 5, + "NoWrite": 6, + "NoReadWrite": 7 + } + }, + { + "Name": "Decoration", + "Type": "Value", + "Values": + { + "RelaxedPrecision": 0, + "SpecId": 1, + "Block": 2, + "BufferBlock": 3, + "RowMajor": 4, + "ColMajor": 5, + "ArrayStride": 6, + "MatrixStride": 7, + "GLSLShared": 8, + "GLSLPacked": 9, + "CPacked": 10, + "BuiltIn": 11, + "NoPerspective": 13, + "Flat": 14, + "Patch": 15, + "Centroid": 16, + "Sample": 17, + "Invariant": 18, + "Restrict": 19, + "Aliased": 20, + "Volatile": 21, + "Constant": 22, + "Coherent": 23, + "NonWritable": 24, + "NonReadable": 25, + "Uniform": 26, + "SaturatedConversion": 28, + "Stream": 29, + "Location": 30, + "Component": 31, + "Index": 32, + "Binding": 33, + "DescriptorSet": 34, + "Offset": 35, + "XfbBuffer": 36, + "XfbStride": 37, + "FuncParamAttr": 38, + "FPRoundingMode": 39, + "FPFastMathMode": 40, + "LinkageAttributes": 41, + "NoContraction": 42, + "InputAttachmentIndex": 43, + "Alignment": 44, + "MaxByteOffset": 45, + "AlignmentId": 46, + "MaxByteOffsetId": 47, + "ExplicitInterpAMD": 4999, + "OverrideCoverageNV": 5248, + "PassthroughNV": 5250, + "ViewportRelativeNV": 5252, + "SecondaryViewportRelativeNV": 5256, + "NonUniformEXT": 5300, + "HlslCounterBufferGOOGLE": 5634, + "HlslSemanticGOOGLE": 5635 + } + }, + { + "Name": "BuiltIn", + "Type": "Value", + "Values": + { + "Position": 0, + "PointSize": 1, + "ClipDistance": 3, + "CullDistance": 4, + "VertexId": 5, + "InstanceId": 6, + "PrimitiveId": 7, + "InvocationId": 8, + "Layer": 9, + "ViewportIndex": 10, + "TessLevelOuter": 11, + "TessLevelInner": 12, + "TessCoord": 13, + "PatchVertices": 14, + "FragCoord": 15, + "PointCoord": 16, + "FrontFacing": 17, + "SampleId": 18, + "SamplePosition": 19, + "SampleMask": 20, + "FragDepth": 22, + "HelperInvocation": 23, + "NumWorkgroups": 24, + "WorkgroupSize": 25, + "WorkgroupId": 26, + "LocalInvocationId": 27, + "GlobalInvocationId": 28, + "LocalInvocationIndex": 29, + "WorkDim": 30, + "GlobalSize": 31, + "EnqueuedWorkgroupSize": 32, + "GlobalOffset": 33, + "GlobalLinearId": 34, + "SubgroupSize": 36, + "SubgroupMaxSize": 37, + "NumSubgroups": 38, + "NumEnqueuedSubgroups": 39, + "SubgroupId": 40, + "SubgroupLocalInvocationId": 41, + "VertexIndex": 42, + "InstanceIndex": 43, + "SubgroupEqMask": 4416, + "SubgroupEqMaskKHR": 4416, + "SubgroupGeMask": 4417, + "SubgroupGeMaskKHR": 4417, + "SubgroupGtMask": 4418, + "SubgroupGtMaskKHR": 4418, + "SubgroupLeMask": 4419, + "SubgroupLeMaskKHR": 4419, + "SubgroupLtMask": 4420, + "SubgroupLtMaskKHR": 4420, + "BaseVertex": 4424, + "BaseInstance": 4425, + "DrawIndex": 4426, + "DeviceIndex": 4438, + "ViewIndex": 4440, + "BaryCoordNoPerspAMD": 4992, + "BaryCoordNoPerspCentroidAMD": 4993, + "BaryCoordNoPerspSampleAMD": 4994, + "BaryCoordSmoothAMD": 4995, + "BaryCoordSmoothCentroidAMD": 4996, + "BaryCoordSmoothSampleAMD": 4997, + "BaryCoordPullModelAMD": 4998, + "FragStencilRefEXT": 5014, + "ViewportMaskNV": 5253, + "SecondaryPositionNV": 5257, + "SecondaryViewportMaskNV": 5258, + "PositionPerViewNV": 5261, + "ViewportMaskPerViewNV": 5262, + "FullyCoveredEXT": 5264 + } + }, + { + "Name": "SelectionControl", + "Type": "Bit", + "Values": + { + "Flatten": 0, + "DontFlatten": 1 + } + }, + { + "Name": "LoopControl", + "Type": "Bit", + "Values": + { + "Unroll": 0, + "DontUnroll": 1, + "DependencyInfinite": 2, + "DependencyLength": 3 + } + }, + { + "Name": "FunctionControl", + "Type": "Bit", + "Values": + { + "Inline": 0, + "DontInline": 1, + "Pure": 2, + "Const": 3 + } + }, + { + "Name": "MemorySemantics", + "Type": "Bit", + "Values": + { + "Acquire": 1, + "Release": 2, + "AcquireRelease": 3, + "SequentiallyConsistent": 4, + "UniformMemory": 6, + "SubgroupMemory": 7, + "WorkgroupMemory": 8, + "CrossWorkgroupMemory": 9, + "AtomicCounterMemory": 10, + "ImageMemory": 11 + } + }, + { + "Name": "MemoryAccess", + "Type": "Bit", + "Values": + { + "Volatile": 0, + "Aligned": 1, + "Nontemporal": 2 + } + }, + { + "Name": "Scope", + "Type": "Value", + "Values": + { + "CrossDevice": 0, + "Device": 1, + "Workgroup": 2, + "Subgroup": 3, + "Invocation": 4 + } + }, + { + "Name": "GroupOperation", + "Type": "Value", + "Values": + { + "Reduce": 0, + "InclusiveScan": 1, + "ExclusiveScan": 2, + "ClusteredReduce": 3, + "PartitionedReduceNV": 6, + "PartitionedInclusiveScanNV": 7, + "PartitionedExclusiveScanNV": 8 + } + }, + { + "Name": "KernelEnqueueFlags", + "Type": "Value", + "Values": + { + "NoWait": 0, + "WaitKernel": 1, + "WaitWorkGroup": 2 + } + }, + { + "Name": "KernelProfilingInfo", + "Type": "Bit", + "Values": + { + "CmdExecTime": 0 + } + }, + { + "Name": "Capability", + "Type": "Value", + "Values": + { + "Matrix": 0, + "Shader": 1, + "Geometry": 2, + "Tessellation": 3, + "Addresses": 4, + "Linkage": 5, + "Kernel": 6, + "Vector16": 7, + "Float16Buffer": 8, + "Float16": 9, + "Float64": 10, + "Int64": 11, + "Int64Atomics": 12, + "ImageBasic": 13, + "ImageReadWrite": 14, + "ImageMipmap": 15, + "Pipes": 17, + "Groups": 18, + "DeviceEnqueue": 19, + "LiteralSampler": 20, + "AtomicStorage": 21, + "Int16": 22, + "TessellationPointSize": 23, + "GeometryPointSize": 24, + "ImageGatherExtended": 25, + "StorageImageMultisample": 27, + "UniformBufferArrayDynamicIndexing": 28, + "SampledImageArrayDynamicIndexing": 29, + "StorageBufferArrayDynamicIndexing": 30, + "StorageImageArrayDynamicIndexing": 31, + "ClipDistance": 32, + "CullDistance": 33, + "ImageCubeArray": 34, + "SampleRateShading": 35, + "ImageRect": 36, + "SampledRect": 37, + "GenericPointer": 38, + "Int8": 39, + "InputAttachment": 40, + "SparseResidency": 41, + "MinLod": 42, + "Sampled1D": 43, + "Image1D": 44, + "SampledCubeArray": 45, + "SampledBuffer": 46, + "ImageBuffer": 47, + "ImageMSArray": 48, + "StorageImageExtendedFormats": 49, + "ImageQuery": 50, + "DerivativeControl": 51, + "InterpolationFunction": 52, + "TransformFeedback": 53, + "GeometryStreams": 54, + "StorageImageReadWithoutFormat": 55, + "StorageImageWriteWithoutFormat": 56, + "MultiViewport": 57, + "SubgroupDispatch": 58, + "NamedBarrier": 59, + "PipeStorage": 60, + "GroupNonUniform": 61, + "GroupNonUniformVote": 62, + "GroupNonUniformArithmetic": 63, + "GroupNonUniformBallot": 64, + "GroupNonUniformShuffle": 65, + "GroupNonUniformShuffleRelative": 66, + "GroupNonUniformClustered": 67, + "GroupNonUniformQuad": 68, + "SubgroupBallotKHR": 4423, + "DrawParameters": 4427, + "SubgroupVoteKHR": 4431, + "StorageBuffer16BitAccess": 4433, + "StorageUniformBufferBlock16": 4433, + "StorageUniform16": 4434, + "UniformAndStorageBuffer16BitAccess": 4434, + "StoragePushConstant16": 4435, + "StorageInputOutput16": 4436, + "DeviceGroup": 4437, + "MultiView": 4439, + "VariablePointersStorageBuffer": 4441, + "VariablePointers": 4442, + "AtomicStorageOps": 4445, + "SampleMaskPostDepthCoverage": 4447, + "Float16ImageAMD": 5008, + "ImageGatherBiasLodAMD": 5009, + "FragmentMaskAMD": 5010, + "StencilExportEXT": 5013, + "ImageReadWriteLodAMD": 5015, + "SampleMaskOverrideCoverageNV": 5249, + "GeometryShaderPassthroughNV": 5251, + "ShaderViewportIndexLayerEXT": 5254, + "ShaderViewportIndexLayerNV": 5254, + "ShaderViewportMaskNV": 5255, + "ShaderStereoViewNV": 5259, + "PerViewAttributesNV": 5260, + "FragmentFullyCoveredEXT": 5265, + "GroupNonUniformPartitionedNV": 5297, + "ShaderNonUniformEXT": 5301, + "RuntimeDescriptorArrayEXT": 5302, + "InputAttachmentArrayDynamicIndexingEXT": 5303, + "UniformTexelBufferArrayDynamicIndexingEXT": 5304, + "StorageTexelBufferArrayDynamicIndexingEXT": 5305, + "UniformBufferArrayNonUniformIndexingEXT": 5306, + "SampledImageArrayNonUniformIndexingEXT": 5307, + "StorageBufferArrayNonUniformIndexingEXT": 5308, + "StorageImageArrayNonUniformIndexingEXT": 5309, + "InputAttachmentArrayNonUniformIndexingEXT": 5310, + "UniformTexelBufferArrayNonUniformIndexingEXT": 5311, + "StorageTexelBufferArrayNonUniformIndexingEXT": 5312, + "SubgroupShuffleINTEL": 5568, + "SubgroupBufferBlockIOINTEL": 5569, + "SubgroupImageBlockIOINTEL": 5570 + } + }, + { + "Name": "Op", + "Type": "Value", + "Values": + { + "OpNop": 0, + "OpUndef": 1, + "OpSourceContinued": 2, + "OpSource": 3, + "OpSourceExtension": 4, + "OpName": 5, + "OpMemberName": 6, + "OpString": 7, + "OpLine": 8, + "OpExtension": 10, + "OpExtInstImport": 11, + "OpExtInst": 12, + "OpMemoryModel": 14, + "OpEntryPoint": 15, + "OpExecutionMode": 16, + "OpCapability": 17, + "OpTypeVoid": 19, + "OpTypeBool": 20, + "OpTypeInt": 21, + "OpTypeFloat": 22, + "OpTypeVector": 23, + "OpTypeMatrix": 24, + "OpTypeImage": 25, + "OpTypeSampler": 26, + "OpTypeSampledImage": 27, + "OpTypeArray": 28, + "OpTypeRuntimeArray": 29, + "OpTypeStruct": 30, + "OpTypeOpaque": 31, + "OpTypePointer": 32, + "OpTypeFunction": 33, + "OpTypeEvent": 34, + "OpTypeDeviceEvent": 35, + "OpTypeReserveId": 36, + "OpTypeQueue": 37, + "OpTypePipe": 38, + "OpTypeForwardPointer": 39, + "OpConstantTrue": 41, + "OpConstantFalse": 42, + "OpConstant": 43, + "OpConstantComposite": 44, + "OpConstantSampler": 45, + "OpConstantNull": 46, + "OpSpecConstantTrue": 48, + "OpSpecConstantFalse": 49, + "OpSpecConstant": 50, + "OpSpecConstantComposite": 51, + "OpSpecConstantOp": 52, + "OpFunction": 54, + "OpFunctionParameter": 55, + "OpFunctionEnd": 56, + "OpFunctionCall": 57, + "OpVariable": 59, + "OpImageTexelPointer": 60, + "OpLoad": 61, + "OpStore": 62, + "OpCopyMemory": 63, + "OpCopyMemorySized": 64, + "OpAccessChain": 65, + "OpInBoundsAccessChain": 66, + "OpPtrAccessChain": 67, + "OpArrayLength": 68, + "OpGenericPtrMemSemantics": 69, + "OpInBoundsPtrAccessChain": 70, + "OpDecorate": 71, + "OpMemberDecorate": 72, + "OpDecorationGroup": 73, + "OpGroupDecorate": 74, + "OpGroupMemberDecorate": 75, + "OpVectorExtractDynamic": 77, + "OpVectorInsertDynamic": 78, + "OpVectorShuffle": 79, + "OpCompositeConstruct": 80, + "OpCompositeExtract": 81, + "OpCompositeInsert": 82, + "OpCopyObject": 83, + "OpTranspose": 84, + "OpSampledImage": 86, + "OpImageSampleImplicitLod": 87, + "OpImageSampleExplicitLod": 88, + "OpImageSampleDrefImplicitLod": 89, + "OpImageSampleDrefExplicitLod": 90, + "OpImageSampleProjImplicitLod": 91, + "OpImageSampleProjExplicitLod": 92, + "OpImageSampleProjDrefImplicitLod": 93, + "OpImageSampleProjDrefExplicitLod": 94, + "OpImageFetch": 95, + "OpImageGather": 96, + "OpImageDrefGather": 97, + "OpImageRead": 98, + "OpImageWrite": 99, + "OpImage": 100, + "OpImageQueryFormat": 101, + "OpImageQueryOrder": 102, + "OpImageQuerySizeLod": 103, + "OpImageQuerySize": 104, + "OpImageQueryLod": 105, + "OpImageQueryLevels": 106, + "OpImageQuerySamples": 107, + "OpConvertFToU": 109, + "OpConvertFToS": 110, + "OpConvertSToF": 111, + "OpConvertUToF": 112, + "OpUConvert": 113, + "OpSConvert": 114, + "OpFConvert": 115, + "OpQuantizeToF16": 116, + "OpConvertPtrToU": 117, + "OpSatConvertSToU": 118, + "OpSatConvertUToS": 119, + "OpConvertUToPtr": 120, + "OpPtrCastToGeneric": 121, + "OpGenericCastToPtr": 122, + "OpGenericCastToPtrExplicit": 123, + "OpBitcast": 124, + "OpSNegate": 126, + "OpFNegate": 127, + "OpIAdd": 128, + "OpFAdd": 129, + "OpISub": 130, + "OpFSub": 131, + "OpIMul": 132, + "OpFMul": 133, + "OpUDiv": 134, + "OpSDiv": 135, + "OpFDiv": 136, + "OpUMod": 137, + "OpSRem": 138, + "OpSMod": 139, + "OpFRem": 140, + "OpFMod": 141, + "OpVectorTimesScalar": 142, + "OpMatrixTimesScalar": 143, + "OpVectorTimesMatrix": 144, + "OpMatrixTimesVector": 145, + "OpMatrixTimesMatrix": 146, + "OpOuterProduct": 147, + "OpDot": 148, + "OpIAddCarry": 149, + "OpISubBorrow": 150, + "OpUMulExtended": 151, + "OpSMulExtended": 152, + "OpAny": 154, + "OpAll": 155, + "OpIsNan": 156, + "OpIsInf": 157, + "OpIsFinite": 158, + "OpIsNormal": 159, + "OpSignBitSet": 160, + "OpLessOrGreater": 161, + "OpOrdered": 162, + "OpUnordered": 163, + "OpLogicalEqual": 164, + "OpLogicalNotEqual": 165, + "OpLogicalOr": 166, + "OpLogicalAnd": 167, + "OpLogicalNot": 168, + "OpSelect": 169, + "OpIEqual": 170, + "OpINotEqual": 171, + "OpUGreaterThan": 172, + "OpSGreaterThan": 173, + "OpUGreaterThanEqual": 174, + "OpSGreaterThanEqual": 175, + "OpULessThan": 176, + "OpSLessThan": 177, + "OpULessThanEqual": 178, + "OpSLessThanEqual": 179, + "OpFOrdEqual": 180, + "OpFUnordEqual": 181, + "OpFOrdNotEqual": 182, + "OpFUnordNotEqual": 183, + "OpFOrdLessThan": 184, + "OpFUnordLessThan": 185, + "OpFOrdGreaterThan": 186, + "OpFUnordGreaterThan": 187, + "OpFOrdLessThanEqual": 188, + "OpFUnordLessThanEqual": 189, + "OpFOrdGreaterThanEqual": 190, + "OpFUnordGreaterThanEqual": 191, + "OpShiftRightLogical": 194, + "OpShiftRightArithmetic": 195, + "OpShiftLeftLogical": 196, + "OpBitwiseOr": 197, + "OpBitwiseXor": 198, + "OpBitwiseAnd": 199, + "OpNot": 200, + "OpBitFieldInsert": 201, + "OpBitFieldSExtract": 202, + "OpBitFieldUExtract": 203, + "OpBitReverse": 204, + "OpBitCount": 205, + "OpDPdx": 207, + "OpDPdy": 208, + "OpFwidth": 209, + "OpDPdxFine": 210, + "OpDPdyFine": 211, + "OpFwidthFine": 212, + "OpDPdxCoarse": 213, + "OpDPdyCoarse": 214, + "OpFwidthCoarse": 215, + "OpEmitVertex": 218, + "OpEndPrimitive": 219, + "OpEmitStreamVertex": 220, + "OpEndStreamPrimitive": 221, + "OpControlBarrier": 224, + "OpMemoryBarrier": 225, + "OpAtomicLoad": 227, + "OpAtomicStore": 228, + "OpAtomicExchange": 229, + "OpAtomicCompareExchange": 230, + "OpAtomicCompareExchangeWeak": 231, + "OpAtomicIIncrement": 232, + "OpAtomicIDecrement": 233, + "OpAtomicIAdd": 234, + "OpAtomicISub": 235, + "OpAtomicSMin": 236, + "OpAtomicUMin": 237, + "OpAtomicSMax": 238, + "OpAtomicUMax": 239, + "OpAtomicAnd": 240, + "OpAtomicOr": 241, + "OpAtomicXor": 242, + "OpPhi": 245, + "OpLoopMerge": 246, + "OpSelectionMerge": 247, + "OpLabel": 248, + "OpBranch": 249, + "OpBranchConditional": 250, + "OpSwitch": 251, + "OpKill": 252, + "OpReturn": 253, + "OpReturnValue": 254, + "OpUnreachable": 255, + "OpLifetimeStart": 256, + "OpLifetimeStop": 257, + "OpGroupAsyncCopy": 259, + "OpGroupWaitEvents": 260, + "OpGroupAll": 261, + "OpGroupAny": 262, + "OpGroupBroadcast": 263, + "OpGroupIAdd": 264, + "OpGroupFAdd": 265, + "OpGroupFMin": 266, + "OpGroupUMin": 267, + "OpGroupSMin": 268, + "OpGroupFMax": 269, + "OpGroupUMax": 270, + "OpGroupSMax": 271, + "OpReadPipe": 274, + "OpWritePipe": 275, + "OpReservedReadPipe": 276, + "OpReservedWritePipe": 277, + "OpReserveReadPipePackets": 278, + "OpReserveWritePipePackets": 279, + "OpCommitReadPipe": 280, + "OpCommitWritePipe": 281, + "OpIsValidReserveId": 282, + "OpGetNumPipePackets": 283, + "OpGetMaxPipePackets": 284, + "OpGroupReserveReadPipePackets": 285, + "OpGroupReserveWritePipePackets": 286, + "OpGroupCommitReadPipe": 287, + "OpGroupCommitWritePipe": 288, + "OpEnqueueMarker": 291, + "OpEnqueueKernel": 292, + "OpGetKernelNDrangeSubGroupCount": 293, + "OpGetKernelNDrangeMaxSubGroupSize": 294, + "OpGetKernelWorkGroupSize": 295, + "OpGetKernelPreferredWorkGroupSizeMultiple": 296, + "OpRetainEvent": 297, + "OpReleaseEvent": 298, + "OpCreateUserEvent": 299, + "OpIsValidEvent": 300, + "OpSetUserEventStatus": 301, + "OpCaptureEventProfilingInfo": 302, + "OpGetDefaultQueue": 303, + "OpBuildNDRange": 304, + "OpImageSparseSampleImplicitLod": 305, + "OpImageSparseSampleExplicitLod": 306, + "OpImageSparseSampleDrefImplicitLod": 307, + "OpImageSparseSampleDrefExplicitLod": 308, + "OpImageSparseSampleProjImplicitLod": 309, + "OpImageSparseSampleProjExplicitLod": 310, + "OpImageSparseSampleProjDrefImplicitLod": 311, + "OpImageSparseSampleProjDrefExplicitLod": 312, + "OpImageSparseFetch": 313, + "OpImageSparseGather": 314, + "OpImageSparseDrefGather": 315, + "OpImageSparseTexelsResident": 316, + "OpNoLine": 317, + "OpAtomicFlagTestAndSet": 318, + "OpAtomicFlagClear": 319, + "OpImageSparseRead": 320, + "OpSizeOf": 321, + "OpTypePipeStorage": 322, + "OpConstantPipeStorage": 323, + "OpCreatePipeFromPipeStorage": 324, + "OpGetKernelLocalSizeForSubgroupCount": 325, + "OpGetKernelMaxNumSubgroups": 326, + "OpTypeNamedBarrier": 327, + "OpNamedBarrierInitialize": 328, + "OpMemoryNamedBarrier": 329, + "OpModuleProcessed": 330, + "OpExecutionModeId": 331, + "OpDecorateId": 332, + "OpGroupNonUniformElect": 333, + "OpGroupNonUniformAll": 334, + "OpGroupNonUniformAny": 335, + "OpGroupNonUniformAllEqual": 336, + "OpGroupNonUniformBroadcast": 337, + "OpGroupNonUniformBroadcastFirst": 338, + "OpGroupNonUniformBallot": 339, + "OpGroupNonUniformInverseBallot": 340, + "OpGroupNonUniformBallotBitExtract": 341, + "OpGroupNonUniformBallotBitCount": 342, + "OpGroupNonUniformBallotFindLSB": 343, + "OpGroupNonUniformBallotFindMSB": 344, + "OpGroupNonUniformShuffle": 345, + "OpGroupNonUniformShuffleXor": 346, + "OpGroupNonUniformShuffleUp": 347, + "OpGroupNonUniformShuffleDown": 348, + "OpGroupNonUniformIAdd": 349, + "OpGroupNonUniformFAdd": 350, + "OpGroupNonUniformIMul": 351, + "OpGroupNonUniformFMul": 352, + "OpGroupNonUniformSMin": 353, + "OpGroupNonUniformUMin": 354, + "OpGroupNonUniformFMin": 355, + "OpGroupNonUniformSMax": 356, + "OpGroupNonUniformUMax": 357, + "OpGroupNonUniformFMax": 358, + "OpGroupNonUniformBitwiseAnd": 359, + "OpGroupNonUniformBitwiseOr": 360, + "OpGroupNonUniformBitwiseXor": 361, + "OpGroupNonUniformLogicalAnd": 362, + "OpGroupNonUniformLogicalOr": 363, + "OpGroupNonUniformLogicalXor": 364, + "OpGroupNonUniformQuadBroadcast": 365, + "OpGroupNonUniformQuadSwap": 366, + "OpSubgroupBallotKHR": 4421, + "OpSubgroupFirstInvocationKHR": 4422, + "OpSubgroupAllKHR": 4428, + "OpSubgroupAnyKHR": 4429, + "OpSubgroupAllEqualKHR": 4430, + "OpSubgroupReadInvocationKHR": 4432, + "OpGroupIAddNonUniformAMD": 5000, + "OpGroupFAddNonUniformAMD": 5001, + "OpGroupFMinNonUniformAMD": 5002, + "OpGroupUMinNonUniformAMD": 5003, + "OpGroupSMinNonUniformAMD": 5004, + "OpGroupFMaxNonUniformAMD": 5005, + "OpGroupUMaxNonUniformAMD": 5006, + "OpGroupSMaxNonUniformAMD": 5007, + "OpFragmentMaskFetchAMD": 5011, + "OpFragmentFetchAMD": 5012, + "OpGroupNonUniformPartitionNV": 5296, + "OpSubgroupShuffleINTEL": 5571, + "OpSubgroupShuffleDownINTEL": 5572, + "OpSubgroupShuffleUpINTEL": 5573, + "OpSubgroupShuffleXorINTEL": 5574, + "OpSubgroupBlockReadINTEL": 5575, + "OpSubgroupBlockWriteINTEL": 5576, + "OpSubgroupImageBlockReadINTEL": 5577, + "OpSubgroupImageBlockWriteINTEL": 5578, + "OpDecorateStringGOOGLE": 5632, + "OpMemberDecorateStringGOOGLE": 5633 + } + } + ] + } +} + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.lua vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.lua --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.lua 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.lua 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1046 @@ +-- Copyright (c) 2014-2018 The Khronos Group Inc. +-- +-- Permission is hereby granted, free of charge, to any person obtaining a copy +-- of this software and/or associated documentation files (the "Materials"), +-- to deal in the Materials without restriction, including without limitation +-- the rights to use, copy, modify, merge, publish, distribute, sublicense, +-- and/or sell copies of the Materials, and to permit persons to whom the +-- Materials are furnished to do so, subject to the following conditions: +-- +-- The above copyright notice and this permission notice shall be included in +-- all copies or substantial portions of the Materials. +-- +-- MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +-- STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +-- HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +-- +-- THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +-- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +-- FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +-- IN THE MATERIALS. + +-- This header is automatically generated by the same tool that creates +-- the Binary Section of the SPIR-V specification. + +-- Enumeration tokens for SPIR-V, in various styles: +-- C, C++, C++11, JSON, Lua, Python +-- +-- - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +-- - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +-- - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +-- - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +-- - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +-- +-- Some tokens act like mask values, which can be OR'd together, +-- while others are mutually exclusive. The mask-like ones have +-- "Mask" in their name, and a parallel enum that has the shift +-- amount (1 << x) for each corresponding enumerant. + +spv = { + MagicNumber = 0x07230203, + Version = 0x00010300, + Revision = 1, + OpCodeMask = 0xffff, + WordCountShift = 16, + + SourceLanguage = { + Unknown = 0, + ESSL = 1, + GLSL = 2, + OpenCL_C = 3, + OpenCL_CPP = 4, + HLSL = 5, + }, + + ExecutionModel = { + Vertex = 0, + TessellationControl = 1, + TessellationEvaluation = 2, + Geometry = 3, + Fragment = 4, + GLCompute = 5, + Kernel = 6, + }, + + AddressingModel = { + Logical = 0, + Physical32 = 1, + Physical64 = 2, + }, + + MemoryModel = { + Simple = 0, + GLSL450 = 1, + OpenCL = 2, + }, + + ExecutionMode = { + Invocations = 0, + SpacingEqual = 1, + SpacingFractionalEven = 2, + SpacingFractionalOdd = 3, + VertexOrderCw = 4, + VertexOrderCcw = 5, + PixelCenterInteger = 6, + OriginUpperLeft = 7, + OriginLowerLeft = 8, + EarlyFragmentTests = 9, + PointMode = 10, + Xfb = 11, + DepthReplacing = 12, + DepthGreater = 14, + DepthLess = 15, + DepthUnchanged = 16, + LocalSize = 17, + LocalSizeHint = 18, + InputPoints = 19, + InputLines = 20, + InputLinesAdjacency = 21, + Triangles = 22, + InputTrianglesAdjacency = 23, + Quads = 24, + Isolines = 25, + OutputVertices = 26, + OutputPoints = 27, + OutputLineStrip = 28, + OutputTriangleStrip = 29, + VecTypeHint = 30, + ContractionOff = 31, + Initializer = 33, + Finalizer = 34, + SubgroupSize = 35, + SubgroupsPerWorkgroup = 36, + SubgroupsPerWorkgroupId = 37, + LocalSizeId = 38, + LocalSizeHintId = 39, + PostDepthCoverage = 4446, + StencilRefReplacingEXT = 5027, + }, + + StorageClass = { + UniformConstant = 0, + Input = 1, + Uniform = 2, + Output = 3, + Workgroup = 4, + CrossWorkgroup = 5, + Private = 6, + Function = 7, + Generic = 8, + PushConstant = 9, + AtomicCounter = 10, + Image = 11, + StorageBuffer = 12, + }, + + Dim = { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + Cube = 3, + Rect = 4, + Buffer = 5, + SubpassData = 6, + }, + + SamplerAddressingMode = { + None = 0, + ClampToEdge = 1, + Clamp = 2, + Repeat = 3, + RepeatMirrored = 4, + }, + + SamplerFilterMode = { + Nearest = 0, + Linear = 1, + }, + + ImageFormat = { + Unknown = 0, + Rgba32f = 1, + Rgba16f = 2, + R32f = 3, + Rgba8 = 4, + Rgba8Snorm = 5, + Rg32f = 6, + Rg16f = 7, + R11fG11fB10f = 8, + R16f = 9, + Rgba16 = 10, + Rgb10A2 = 11, + Rg16 = 12, + Rg8 = 13, + R16 = 14, + R8 = 15, + Rgba16Snorm = 16, + Rg16Snorm = 17, + Rg8Snorm = 18, + R16Snorm = 19, + R8Snorm = 20, + Rgba32i = 21, + Rgba16i = 22, + Rgba8i = 23, + R32i = 24, + Rg32i = 25, + Rg16i = 26, + Rg8i = 27, + R16i = 28, + R8i = 29, + Rgba32ui = 30, + Rgba16ui = 31, + Rgba8ui = 32, + R32ui = 33, + Rgb10a2ui = 34, + Rg32ui = 35, + Rg16ui = 36, + Rg8ui = 37, + R16ui = 38, + R8ui = 39, + }, + + ImageChannelOrder = { + R = 0, + A = 1, + RG = 2, + RA = 3, + RGB = 4, + RGBA = 5, + BGRA = 6, + ARGB = 7, + Intensity = 8, + Luminance = 9, + Rx = 10, + RGx = 11, + RGBx = 12, + Depth = 13, + DepthStencil = 14, + sRGB = 15, + sRGBx = 16, + sRGBA = 17, + sBGRA = 18, + ABGR = 19, + }, + + ImageChannelDataType = { + SnormInt8 = 0, + SnormInt16 = 1, + UnormInt8 = 2, + UnormInt16 = 3, + UnormShort565 = 4, + UnormShort555 = 5, + UnormInt101010 = 6, + SignedInt8 = 7, + SignedInt16 = 8, + SignedInt32 = 9, + UnsignedInt8 = 10, + UnsignedInt16 = 11, + UnsignedInt32 = 12, + HalfFloat = 13, + Float = 14, + UnormInt24 = 15, + UnormInt101010_2 = 16, + }, + + ImageOperandsShift = { + Bias = 0, + Lod = 1, + Grad = 2, + ConstOffset = 3, + Offset = 4, + ConstOffsets = 5, + Sample = 6, + MinLod = 7, + }, + + ImageOperandsMask = { + MaskNone = 0, + Bias = 0x00000001, + Lod = 0x00000002, + Grad = 0x00000004, + ConstOffset = 0x00000008, + Offset = 0x00000010, + ConstOffsets = 0x00000020, + Sample = 0x00000040, + MinLod = 0x00000080, + }, + + FPFastMathModeShift = { + NotNaN = 0, + NotInf = 1, + NSZ = 2, + AllowRecip = 3, + Fast = 4, + }, + + FPFastMathModeMask = { + MaskNone = 0, + NotNaN = 0x00000001, + NotInf = 0x00000002, + NSZ = 0x00000004, + AllowRecip = 0x00000008, + Fast = 0x00000010, + }, + + FPRoundingMode = { + RTE = 0, + RTZ = 1, + RTP = 2, + RTN = 3, + }, + + LinkageType = { + Export = 0, + Import = 1, + }, + + AccessQualifier = { + ReadOnly = 0, + WriteOnly = 1, + ReadWrite = 2, + }, + + FunctionParameterAttribute = { + Zext = 0, + Sext = 1, + ByVal = 2, + Sret = 3, + NoAlias = 4, + NoCapture = 5, + NoWrite = 6, + NoReadWrite = 7, + }, + + Decoration = { + RelaxedPrecision = 0, + SpecId = 1, + Block = 2, + BufferBlock = 3, + RowMajor = 4, + ColMajor = 5, + ArrayStride = 6, + MatrixStride = 7, + GLSLShared = 8, + GLSLPacked = 9, + CPacked = 10, + BuiltIn = 11, + NoPerspective = 13, + Flat = 14, + Patch = 15, + Centroid = 16, + Sample = 17, + Invariant = 18, + Restrict = 19, + Aliased = 20, + Volatile = 21, + Constant = 22, + Coherent = 23, + NonWritable = 24, + NonReadable = 25, + Uniform = 26, + SaturatedConversion = 28, + Stream = 29, + Location = 30, + Component = 31, + Index = 32, + Binding = 33, + DescriptorSet = 34, + Offset = 35, + XfbBuffer = 36, + XfbStride = 37, + FuncParamAttr = 38, + FPRoundingMode = 39, + FPFastMathMode = 40, + LinkageAttributes = 41, + NoContraction = 42, + InputAttachmentIndex = 43, + Alignment = 44, + MaxByteOffset = 45, + AlignmentId = 46, + MaxByteOffsetId = 47, + ExplicitInterpAMD = 4999, + OverrideCoverageNV = 5248, + PassthroughNV = 5250, + ViewportRelativeNV = 5252, + SecondaryViewportRelativeNV = 5256, + NonUniformEXT = 5300, + HlslCounterBufferGOOGLE = 5634, + HlslSemanticGOOGLE = 5635, + }, + + BuiltIn = { + Position = 0, + PointSize = 1, + ClipDistance = 3, + CullDistance = 4, + VertexId = 5, + InstanceId = 6, + PrimitiveId = 7, + InvocationId = 8, + Layer = 9, + ViewportIndex = 10, + TessLevelOuter = 11, + TessLevelInner = 12, + TessCoord = 13, + PatchVertices = 14, + FragCoord = 15, + PointCoord = 16, + FrontFacing = 17, + SampleId = 18, + SamplePosition = 19, + SampleMask = 20, + FragDepth = 22, + HelperInvocation = 23, + NumWorkgroups = 24, + WorkgroupSize = 25, + WorkgroupId = 26, + LocalInvocationId = 27, + GlobalInvocationId = 28, + LocalInvocationIndex = 29, + WorkDim = 30, + GlobalSize = 31, + EnqueuedWorkgroupSize = 32, + GlobalOffset = 33, + GlobalLinearId = 34, + SubgroupSize = 36, + SubgroupMaxSize = 37, + NumSubgroups = 38, + NumEnqueuedSubgroups = 39, + SubgroupId = 40, + SubgroupLocalInvocationId = 41, + VertexIndex = 42, + InstanceIndex = 43, + SubgroupEqMask = 4416, + SubgroupEqMaskKHR = 4416, + SubgroupGeMask = 4417, + SubgroupGeMaskKHR = 4417, + SubgroupGtMask = 4418, + SubgroupGtMaskKHR = 4418, + SubgroupLeMask = 4419, + SubgroupLeMaskKHR = 4419, + SubgroupLtMask = 4420, + SubgroupLtMaskKHR = 4420, + BaseVertex = 4424, + BaseInstance = 4425, + DrawIndex = 4426, + DeviceIndex = 4438, + ViewIndex = 4440, + BaryCoordNoPerspAMD = 4992, + BaryCoordNoPerspCentroidAMD = 4993, + BaryCoordNoPerspSampleAMD = 4994, + BaryCoordSmoothAMD = 4995, + BaryCoordSmoothCentroidAMD = 4996, + BaryCoordSmoothSampleAMD = 4997, + BaryCoordPullModelAMD = 4998, + FragStencilRefEXT = 5014, + ViewportMaskNV = 5253, + SecondaryPositionNV = 5257, + SecondaryViewportMaskNV = 5258, + PositionPerViewNV = 5261, + ViewportMaskPerViewNV = 5262, + FullyCoveredEXT = 5264, + }, + + SelectionControlShift = { + Flatten = 0, + DontFlatten = 1, + }, + + SelectionControlMask = { + MaskNone = 0, + Flatten = 0x00000001, + DontFlatten = 0x00000002, + }, + + LoopControlShift = { + Unroll = 0, + DontUnroll = 1, + DependencyInfinite = 2, + DependencyLength = 3, + }, + + LoopControlMask = { + MaskNone = 0, + Unroll = 0x00000001, + DontUnroll = 0x00000002, + DependencyInfinite = 0x00000004, + DependencyLength = 0x00000008, + }, + + FunctionControlShift = { + Inline = 0, + DontInline = 1, + Pure = 2, + Const = 3, + }, + + FunctionControlMask = { + MaskNone = 0, + Inline = 0x00000001, + DontInline = 0x00000002, + Pure = 0x00000004, + Const = 0x00000008, + }, + + MemorySemanticsShift = { + Acquire = 1, + Release = 2, + AcquireRelease = 3, + SequentiallyConsistent = 4, + UniformMemory = 6, + SubgroupMemory = 7, + WorkgroupMemory = 8, + CrossWorkgroupMemory = 9, + AtomicCounterMemory = 10, + ImageMemory = 11, + }, + + MemorySemanticsMask = { + MaskNone = 0, + Acquire = 0x00000002, + Release = 0x00000004, + AcquireRelease = 0x00000008, + SequentiallyConsistent = 0x00000010, + UniformMemory = 0x00000040, + SubgroupMemory = 0x00000080, + WorkgroupMemory = 0x00000100, + CrossWorkgroupMemory = 0x00000200, + AtomicCounterMemory = 0x00000400, + ImageMemory = 0x00000800, + }, + + MemoryAccessShift = { + Volatile = 0, + Aligned = 1, + Nontemporal = 2, + }, + + MemoryAccessMask = { + MaskNone = 0, + Volatile = 0x00000001, + Aligned = 0x00000002, + Nontemporal = 0x00000004, + }, + + Scope = { + CrossDevice = 0, + Device = 1, + Workgroup = 2, + Subgroup = 3, + Invocation = 4, + }, + + GroupOperation = { + Reduce = 0, + InclusiveScan = 1, + ExclusiveScan = 2, + ClusteredReduce = 3, + PartitionedReduceNV = 6, + PartitionedInclusiveScanNV = 7, + PartitionedExclusiveScanNV = 8, + }, + + KernelEnqueueFlags = { + NoWait = 0, + WaitKernel = 1, + WaitWorkGroup = 2, + }, + + KernelProfilingInfoShift = { + CmdExecTime = 0, + }, + + KernelProfilingInfoMask = { + MaskNone = 0, + CmdExecTime = 0x00000001, + }, + + Capability = { + Matrix = 0, + Shader = 1, + Geometry = 2, + Tessellation = 3, + Addresses = 4, + Linkage = 5, + Kernel = 6, + Vector16 = 7, + Float16Buffer = 8, + Float16 = 9, + Float64 = 10, + Int64 = 11, + Int64Atomics = 12, + ImageBasic = 13, + ImageReadWrite = 14, + ImageMipmap = 15, + Pipes = 17, + Groups = 18, + DeviceEnqueue = 19, + LiteralSampler = 20, + AtomicStorage = 21, + Int16 = 22, + TessellationPointSize = 23, + GeometryPointSize = 24, + ImageGatherExtended = 25, + StorageImageMultisample = 27, + UniformBufferArrayDynamicIndexing = 28, + SampledImageArrayDynamicIndexing = 29, + StorageBufferArrayDynamicIndexing = 30, + StorageImageArrayDynamicIndexing = 31, + ClipDistance = 32, + CullDistance = 33, + ImageCubeArray = 34, + SampleRateShading = 35, + ImageRect = 36, + SampledRect = 37, + GenericPointer = 38, + Int8 = 39, + InputAttachment = 40, + SparseResidency = 41, + MinLod = 42, + Sampled1D = 43, + Image1D = 44, + SampledCubeArray = 45, + SampledBuffer = 46, + ImageBuffer = 47, + ImageMSArray = 48, + StorageImageExtendedFormats = 49, + ImageQuery = 50, + DerivativeControl = 51, + InterpolationFunction = 52, + TransformFeedback = 53, + GeometryStreams = 54, + StorageImageReadWithoutFormat = 55, + StorageImageWriteWithoutFormat = 56, + MultiViewport = 57, + SubgroupDispatch = 58, + NamedBarrier = 59, + PipeStorage = 60, + GroupNonUniform = 61, + GroupNonUniformVote = 62, + GroupNonUniformArithmetic = 63, + GroupNonUniformBallot = 64, + GroupNonUniformShuffle = 65, + GroupNonUniformShuffleRelative = 66, + GroupNonUniformClustered = 67, + GroupNonUniformQuad = 68, + SubgroupBallotKHR = 4423, + DrawParameters = 4427, + SubgroupVoteKHR = 4431, + StorageBuffer16BitAccess = 4433, + StorageUniformBufferBlock16 = 4433, + StorageUniform16 = 4434, + UniformAndStorageBuffer16BitAccess = 4434, + StoragePushConstant16 = 4435, + StorageInputOutput16 = 4436, + DeviceGroup = 4437, + MultiView = 4439, + VariablePointersStorageBuffer = 4441, + VariablePointers = 4442, + AtomicStorageOps = 4445, + SampleMaskPostDepthCoverage = 4447, + Float16ImageAMD = 5008, + ImageGatherBiasLodAMD = 5009, + FragmentMaskAMD = 5010, + StencilExportEXT = 5013, + ImageReadWriteLodAMD = 5015, + SampleMaskOverrideCoverageNV = 5249, + GeometryShaderPassthroughNV = 5251, + ShaderViewportIndexLayerEXT = 5254, + ShaderViewportIndexLayerNV = 5254, + ShaderViewportMaskNV = 5255, + ShaderStereoViewNV = 5259, + PerViewAttributesNV = 5260, + FragmentFullyCoveredEXT = 5265, + GroupNonUniformPartitionedNV = 5297, + ShaderNonUniformEXT = 5301, + RuntimeDescriptorArrayEXT = 5302, + InputAttachmentArrayDynamicIndexingEXT = 5303, + UniformTexelBufferArrayDynamicIndexingEXT = 5304, + StorageTexelBufferArrayDynamicIndexingEXT = 5305, + UniformBufferArrayNonUniformIndexingEXT = 5306, + SampledImageArrayNonUniformIndexingEXT = 5307, + StorageBufferArrayNonUniformIndexingEXT = 5308, + StorageImageArrayNonUniformIndexingEXT = 5309, + InputAttachmentArrayNonUniformIndexingEXT = 5310, + UniformTexelBufferArrayNonUniformIndexingEXT = 5311, + StorageTexelBufferArrayNonUniformIndexingEXT = 5312, + SubgroupShuffleINTEL = 5568, + SubgroupBufferBlockIOINTEL = 5569, + SubgroupImageBlockIOINTEL = 5570, + }, + + Op = { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpExecutionModeId = 331, + OpDecorateId = 332, + OpGroupNonUniformElect = 333, + OpGroupNonUniformAll = 334, + OpGroupNonUniformAny = 335, + OpGroupNonUniformAllEqual = 336, + OpGroupNonUniformBroadcast = 337, + OpGroupNonUniformBroadcastFirst = 338, + OpGroupNonUniformBallot = 339, + OpGroupNonUniformInverseBallot = 340, + OpGroupNonUniformBallotBitExtract = 341, + OpGroupNonUniformBallotBitCount = 342, + OpGroupNonUniformBallotFindLSB = 343, + OpGroupNonUniformBallotFindMSB = 344, + OpGroupNonUniformShuffle = 345, + OpGroupNonUniformShuffleXor = 346, + OpGroupNonUniformShuffleUp = 347, + OpGroupNonUniformShuffleDown = 348, + OpGroupNonUniformIAdd = 349, + OpGroupNonUniformFAdd = 350, + OpGroupNonUniformIMul = 351, + OpGroupNonUniformFMul = 352, + OpGroupNonUniformSMin = 353, + OpGroupNonUniformUMin = 354, + OpGroupNonUniformFMin = 355, + OpGroupNonUniformSMax = 356, + OpGroupNonUniformUMax = 357, + OpGroupNonUniformFMax = 358, + OpGroupNonUniformBitwiseAnd = 359, + OpGroupNonUniformBitwiseOr = 360, + OpGroupNonUniformBitwiseXor = 361, + OpGroupNonUniformLogicalAnd = 362, + OpGroupNonUniformLogicalOr = 363, + OpGroupNonUniformLogicalXor = 364, + OpGroupNonUniformQuadBroadcast = 365, + OpGroupNonUniformQuadSwap = 366, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpSubgroupReadInvocationKHR = 4432, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpGroupNonUniformPartitionNV = 5296, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateStringGOOGLE = 5633, + }, + +} + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.py vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.py --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.py 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.py 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,1046 @@ +# Copyright (c) 2014-2018 The Khronos Group Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and/or associated documentation files (the "Materials"), +# to deal in the Materials without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Materials, and to permit persons to whom the +# Materials are furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Materials. +# +# MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +# STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +# HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +# +# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +# IN THE MATERIALS. + +# This header is automatically generated by the same tool that creates +# the Binary Section of the SPIR-V specification. + +# Enumeration tokens for SPIR-V, in various styles: +# C, C++, C++11, JSON, Lua, Python +# +# - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +# - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +# - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +# - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +# - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +# +# Some tokens act like mask values, which can be OR'd together, +# while others are mutually exclusive. The mask-like ones have +# "Mask" in their name, and a parallel enum that has the shift +# amount (1 << x) for each corresponding enumerant. + +spv = { + 'MagicNumber' : 0x07230203, + 'Version' : 0x00010300, + 'Revision' : 1, + 'OpCodeMask' : 0xffff, + 'WordCountShift' : 16, + + 'SourceLanguage' : { + 'Unknown' : 0, + 'ESSL' : 1, + 'GLSL' : 2, + 'OpenCL_C' : 3, + 'OpenCL_CPP' : 4, + 'HLSL' : 5, + }, + + 'ExecutionModel' : { + 'Vertex' : 0, + 'TessellationControl' : 1, + 'TessellationEvaluation' : 2, + 'Geometry' : 3, + 'Fragment' : 4, + 'GLCompute' : 5, + 'Kernel' : 6, + }, + + 'AddressingModel' : { + 'Logical' : 0, + 'Physical32' : 1, + 'Physical64' : 2, + }, + + 'MemoryModel' : { + 'Simple' : 0, + 'GLSL450' : 1, + 'OpenCL' : 2, + }, + + 'ExecutionMode' : { + 'Invocations' : 0, + 'SpacingEqual' : 1, + 'SpacingFractionalEven' : 2, + 'SpacingFractionalOdd' : 3, + 'VertexOrderCw' : 4, + 'VertexOrderCcw' : 5, + 'PixelCenterInteger' : 6, + 'OriginUpperLeft' : 7, + 'OriginLowerLeft' : 8, + 'EarlyFragmentTests' : 9, + 'PointMode' : 10, + 'Xfb' : 11, + 'DepthReplacing' : 12, + 'DepthGreater' : 14, + 'DepthLess' : 15, + 'DepthUnchanged' : 16, + 'LocalSize' : 17, + 'LocalSizeHint' : 18, + 'InputPoints' : 19, + 'InputLines' : 20, + 'InputLinesAdjacency' : 21, + 'Triangles' : 22, + 'InputTrianglesAdjacency' : 23, + 'Quads' : 24, + 'Isolines' : 25, + 'OutputVertices' : 26, + 'OutputPoints' : 27, + 'OutputLineStrip' : 28, + 'OutputTriangleStrip' : 29, + 'VecTypeHint' : 30, + 'ContractionOff' : 31, + 'Initializer' : 33, + 'Finalizer' : 34, + 'SubgroupSize' : 35, + 'SubgroupsPerWorkgroup' : 36, + 'SubgroupsPerWorkgroupId' : 37, + 'LocalSizeId' : 38, + 'LocalSizeHintId' : 39, + 'PostDepthCoverage' : 4446, + 'StencilRefReplacingEXT' : 5027, + }, + + 'StorageClass' : { + 'UniformConstant' : 0, + 'Input' : 1, + 'Uniform' : 2, + 'Output' : 3, + 'Workgroup' : 4, + 'CrossWorkgroup' : 5, + 'Private' : 6, + 'Function' : 7, + 'Generic' : 8, + 'PushConstant' : 9, + 'AtomicCounter' : 10, + 'Image' : 11, + 'StorageBuffer' : 12, + }, + + 'Dim' : { + 'Dim1D' : 0, + 'Dim2D' : 1, + 'Dim3D' : 2, + 'Cube' : 3, + 'Rect' : 4, + 'Buffer' : 5, + 'SubpassData' : 6, + }, + + 'SamplerAddressingMode' : { + 'None' : 0, + 'ClampToEdge' : 1, + 'Clamp' : 2, + 'Repeat' : 3, + 'RepeatMirrored' : 4, + }, + + 'SamplerFilterMode' : { + 'Nearest' : 0, + 'Linear' : 1, + }, + + 'ImageFormat' : { + 'Unknown' : 0, + 'Rgba32f' : 1, + 'Rgba16f' : 2, + 'R32f' : 3, + 'Rgba8' : 4, + 'Rgba8Snorm' : 5, + 'Rg32f' : 6, + 'Rg16f' : 7, + 'R11fG11fB10f' : 8, + 'R16f' : 9, + 'Rgba16' : 10, + 'Rgb10A2' : 11, + 'Rg16' : 12, + 'Rg8' : 13, + 'R16' : 14, + 'R8' : 15, + 'Rgba16Snorm' : 16, + 'Rg16Snorm' : 17, + 'Rg8Snorm' : 18, + 'R16Snorm' : 19, + 'R8Snorm' : 20, + 'Rgba32i' : 21, + 'Rgba16i' : 22, + 'Rgba8i' : 23, + 'R32i' : 24, + 'Rg32i' : 25, + 'Rg16i' : 26, + 'Rg8i' : 27, + 'R16i' : 28, + 'R8i' : 29, + 'Rgba32ui' : 30, + 'Rgba16ui' : 31, + 'Rgba8ui' : 32, + 'R32ui' : 33, + 'Rgb10a2ui' : 34, + 'Rg32ui' : 35, + 'Rg16ui' : 36, + 'Rg8ui' : 37, + 'R16ui' : 38, + 'R8ui' : 39, + }, + + 'ImageChannelOrder' : { + 'R' : 0, + 'A' : 1, + 'RG' : 2, + 'RA' : 3, + 'RGB' : 4, + 'RGBA' : 5, + 'BGRA' : 6, + 'ARGB' : 7, + 'Intensity' : 8, + 'Luminance' : 9, + 'Rx' : 10, + 'RGx' : 11, + 'RGBx' : 12, + 'Depth' : 13, + 'DepthStencil' : 14, + 'sRGB' : 15, + 'sRGBx' : 16, + 'sRGBA' : 17, + 'sBGRA' : 18, + 'ABGR' : 19, + }, + + 'ImageChannelDataType' : { + 'SnormInt8' : 0, + 'SnormInt16' : 1, + 'UnormInt8' : 2, + 'UnormInt16' : 3, + 'UnormShort565' : 4, + 'UnormShort555' : 5, + 'UnormInt101010' : 6, + 'SignedInt8' : 7, + 'SignedInt16' : 8, + 'SignedInt32' : 9, + 'UnsignedInt8' : 10, + 'UnsignedInt16' : 11, + 'UnsignedInt32' : 12, + 'HalfFloat' : 13, + 'Float' : 14, + 'UnormInt24' : 15, + 'UnormInt101010_2' : 16, + }, + + 'ImageOperandsShift' : { + 'Bias' : 0, + 'Lod' : 1, + 'Grad' : 2, + 'ConstOffset' : 3, + 'Offset' : 4, + 'ConstOffsets' : 5, + 'Sample' : 6, + 'MinLod' : 7, + }, + + 'ImageOperandsMask' : { + 'MaskNone' : 0, + 'Bias' : 0x00000001, + 'Lod' : 0x00000002, + 'Grad' : 0x00000004, + 'ConstOffset' : 0x00000008, + 'Offset' : 0x00000010, + 'ConstOffsets' : 0x00000020, + 'Sample' : 0x00000040, + 'MinLod' : 0x00000080, + }, + + 'FPFastMathModeShift' : { + 'NotNaN' : 0, + 'NotInf' : 1, + 'NSZ' : 2, + 'AllowRecip' : 3, + 'Fast' : 4, + }, + + 'FPFastMathModeMask' : { + 'MaskNone' : 0, + 'NotNaN' : 0x00000001, + 'NotInf' : 0x00000002, + 'NSZ' : 0x00000004, + 'AllowRecip' : 0x00000008, + 'Fast' : 0x00000010, + }, + + 'FPRoundingMode' : { + 'RTE' : 0, + 'RTZ' : 1, + 'RTP' : 2, + 'RTN' : 3, + }, + + 'LinkageType' : { + 'Export' : 0, + 'Import' : 1, + }, + + 'AccessQualifier' : { + 'ReadOnly' : 0, + 'WriteOnly' : 1, + 'ReadWrite' : 2, + }, + + 'FunctionParameterAttribute' : { + 'Zext' : 0, + 'Sext' : 1, + 'ByVal' : 2, + 'Sret' : 3, + 'NoAlias' : 4, + 'NoCapture' : 5, + 'NoWrite' : 6, + 'NoReadWrite' : 7, + }, + + 'Decoration' : { + 'RelaxedPrecision' : 0, + 'SpecId' : 1, + 'Block' : 2, + 'BufferBlock' : 3, + 'RowMajor' : 4, + 'ColMajor' : 5, + 'ArrayStride' : 6, + 'MatrixStride' : 7, + 'GLSLShared' : 8, + 'GLSLPacked' : 9, + 'CPacked' : 10, + 'BuiltIn' : 11, + 'NoPerspective' : 13, + 'Flat' : 14, + 'Patch' : 15, + 'Centroid' : 16, + 'Sample' : 17, + 'Invariant' : 18, + 'Restrict' : 19, + 'Aliased' : 20, + 'Volatile' : 21, + 'Constant' : 22, + 'Coherent' : 23, + 'NonWritable' : 24, + 'NonReadable' : 25, + 'Uniform' : 26, + 'SaturatedConversion' : 28, + 'Stream' : 29, + 'Location' : 30, + 'Component' : 31, + 'Index' : 32, + 'Binding' : 33, + 'DescriptorSet' : 34, + 'Offset' : 35, + 'XfbBuffer' : 36, + 'XfbStride' : 37, + 'FuncParamAttr' : 38, + 'FPRoundingMode' : 39, + 'FPFastMathMode' : 40, + 'LinkageAttributes' : 41, + 'NoContraction' : 42, + 'InputAttachmentIndex' : 43, + 'Alignment' : 44, + 'MaxByteOffset' : 45, + 'AlignmentId' : 46, + 'MaxByteOffsetId' : 47, + 'ExplicitInterpAMD' : 4999, + 'OverrideCoverageNV' : 5248, + 'PassthroughNV' : 5250, + 'ViewportRelativeNV' : 5252, + 'SecondaryViewportRelativeNV' : 5256, + 'NonUniformEXT' : 5300, + 'HlslCounterBufferGOOGLE' : 5634, + 'HlslSemanticGOOGLE' : 5635, + }, + + 'BuiltIn' : { + 'Position' : 0, + 'PointSize' : 1, + 'ClipDistance' : 3, + 'CullDistance' : 4, + 'VertexId' : 5, + 'InstanceId' : 6, + 'PrimitiveId' : 7, + 'InvocationId' : 8, + 'Layer' : 9, + 'ViewportIndex' : 10, + 'TessLevelOuter' : 11, + 'TessLevelInner' : 12, + 'TessCoord' : 13, + 'PatchVertices' : 14, + 'FragCoord' : 15, + 'PointCoord' : 16, + 'FrontFacing' : 17, + 'SampleId' : 18, + 'SamplePosition' : 19, + 'SampleMask' : 20, + 'FragDepth' : 22, + 'HelperInvocation' : 23, + 'NumWorkgroups' : 24, + 'WorkgroupSize' : 25, + 'WorkgroupId' : 26, + 'LocalInvocationId' : 27, + 'GlobalInvocationId' : 28, + 'LocalInvocationIndex' : 29, + 'WorkDim' : 30, + 'GlobalSize' : 31, + 'EnqueuedWorkgroupSize' : 32, + 'GlobalOffset' : 33, + 'GlobalLinearId' : 34, + 'SubgroupSize' : 36, + 'SubgroupMaxSize' : 37, + 'NumSubgroups' : 38, + 'NumEnqueuedSubgroups' : 39, + 'SubgroupId' : 40, + 'SubgroupLocalInvocationId' : 41, + 'VertexIndex' : 42, + 'InstanceIndex' : 43, + 'SubgroupEqMask' : 4416, + 'SubgroupEqMaskKHR' : 4416, + 'SubgroupGeMask' : 4417, + 'SubgroupGeMaskKHR' : 4417, + 'SubgroupGtMask' : 4418, + 'SubgroupGtMaskKHR' : 4418, + 'SubgroupLeMask' : 4419, + 'SubgroupLeMaskKHR' : 4419, + 'SubgroupLtMask' : 4420, + 'SubgroupLtMaskKHR' : 4420, + 'BaseVertex' : 4424, + 'BaseInstance' : 4425, + 'DrawIndex' : 4426, + 'DeviceIndex' : 4438, + 'ViewIndex' : 4440, + 'BaryCoordNoPerspAMD' : 4992, + 'BaryCoordNoPerspCentroidAMD' : 4993, + 'BaryCoordNoPerspSampleAMD' : 4994, + 'BaryCoordSmoothAMD' : 4995, + 'BaryCoordSmoothCentroidAMD' : 4996, + 'BaryCoordSmoothSampleAMD' : 4997, + 'BaryCoordPullModelAMD' : 4998, + 'FragStencilRefEXT' : 5014, + 'ViewportMaskNV' : 5253, + 'SecondaryPositionNV' : 5257, + 'SecondaryViewportMaskNV' : 5258, + 'PositionPerViewNV' : 5261, + 'ViewportMaskPerViewNV' : 5262, + 'FullyCoveredEXT' : 5264, + }, + + 'SelectionControlShift' : { + 'Flatten' : 0, + 'DontFlatten' : 1, + }, + + 'SelectionControlMask' : { + 'MaskNone' : 0, + 'Flatten' : 0x00000001, + 'DontFlatten' : 0x00000002, + }, + + 'LoopControlShift' : { + 'Unroll' : 0, + 'DontUnroll' : 1, + 'DependencyInfinite' : 2, + 'DependencyLength' : 3, + }, + + 'LoopControlMask' : { + 'MaskNone' : 0, + 'Unroll' : 0x00000001, + 'DontUnroll' : 0x00000002, + 'DependencyInfinite' : 0x00000004, + 'DependencyLength' : 0x00000008, + }, + + 'FunctionControlShift' : { + 'Inline' : 0, + 'DontInline' : 1, + 'Pure' : 2, + 'Const' : 3, + }, + + 'FunctionControlMask' : { + 'MaskNone' : 0, + 'Inline' : 0x00000001, + 'DontInline' : 0x00000002, + 'Pure' : 0x00000004, + 'Const' : 0x00000008, + }, + + 'MemorySemanticsShift' : { + 'Acquire' : 1, + 'Release' : 2, + 'AcquireRelease' : 3, + 'SequentiallyConsistent' : 4, + 'UniformMemory' : 6, + 'SubgroupMemory' : 7, + 'WorkgroupMemory' : 8, + 'CrossWorkgroupMemory' : 9, + 'AtomicCounterMemory' : 10, + 'ImageMemory' : 11, + }, + + 'MemorySemanticsMask' : { + 'MaskNone' : 0, + 'Acquire' : 0x00000002, + 'Release' : 0x00000004, + 'AcquireRelease' : 0x00000008, + 'SequentiallyConsistent' : 0x00000010, + 'UniformMemory' : 0x00000040, + 'SubgroupMemory' : 0x00000080, + 'WorkgroupMemory' : 0x00000100, + 'CrossWorkgroupMemory' : 0x00000200, + 'AtomicCounterMemory' : 0x00000400, + 'ImageMemory' : 0x00000800, + }, + + 'MemoryAccessShift' : { + 'Volatile' : 0, + 'Aligned' : 1, + 'Nontemporal' : 2, + }, + + 'MemoryAccessMask' : { + 'MaskNone' : 0, + 'Volatile' : 0x00000001, + 'Aligned' : 0x00000002, + 'Nontemporal' : 0x00000004, + }, + + 'Scope' : { + 'CrossDevice' : 0, + 'Device' : 1, + 'Workgroup' : 2, + 'Subgroup' : 3, + 'Invocation' : 4, + }, + + 'GroupOperation' : { + 'Reduce' : 0, + 'InclusiveScan' : 1, + 'ExclusiveScan' : 2, + 'ClusteredReduce' : 3, + 'PartitionedReduceNV' : 6, + 'PartitionedInclusiveScanNV' : 7, + 'PartitionedExclusiveScanNV' : 8, + }, + + 'KernelEnqueueFlags' : { + 'NoWait' : 0, + 'WaitKernel' : 1, + 'WaitWorkGroup' : 2, + }, + + 'KernelProfilingInfoShift' : { + 'CmdExecTime' : 0, + }, + + 'KernelProfilingInfoMask' : { + 'MaskNone' : 0, + 'CmdExecTime' : 0x00000001, + }, + + 'Capability' : { + 'Matrix' : 0, + 'Shader' : 1, + 'Geometry' : 2, + 'Tessellation' : 3, + 'Addresses' : 4, + 'Linkage' : 5, + 'Kernel' : 6, + 'Vector16' : 7, + 'Float16Buffer' : 8, + 'Float16' : 9, + 'Float64' : 10, + 'Int64' : 11, + 'Int64Atomics' : 12, + 'ImageBasic' : 13, + 'ImageReadWrite' : 14, + 'ImageMipmap' : 15, + 'Pipes' : 17, + 'Groups' : 18, + 'DeviceEnqueue' : 19, + 'LiteralSampler' : 20, + 'AtomicStorage' : 21, + 'Int16' : 22, + 'TessellationPointSize' : 23, + 'GeometryPointSize' : 24, + 'ImageGatherExtended' : 25, + 'StorageImageMultisample' : 27, + 'UniformBufferArrayDynamicIndexing' : 28, + 'SampledImageArrayDynamicIndexing' : 29, + 'StorageBufferArrayDynamicIndexing' : 30, + 'StorageImageArrayDynamicIndexing' : 31, + 'ClipDistance' : 32, + 'CullDistance' : 33, + 'ImageCubeArray' : 34, + 'SampleRateShading' : 35, + 'ImageRect' : 36, + 'SampledRect' : 37, + 'GenericPointer' : 38, + 'Int8' : 39, + 'InputAttachment' : 40, + 'SparseResidency' : 41, + 'MinLod' : 42, + 'Sampled1D' : 43, + 'Image1D' : 44, + 'SampledCubeArray' : 45, + 'SampledBuffer' : 46, + 'ImageBuffer' : 47, + 'ImageMSArray' : 48, + 'StorageImageExtendedFormats' : 49, + 'ImageQuery' : 50, + 'DerivativeControl' : 51, + 'InterpolationFunction' : 52, + 'TransformFeedback' : 53, + 'GeometryStreams' : 54, + 'StorageImageReadWithoutFormat' : 55, + 'StorageImageWriteWithoutFormat' : 56, + 'MultiViewport' : 57, + 'SubgroupDispatch' : 58, + 'NamedBarrier' : 59, + 'PipeStorage' : 60, + 'GroupNonUniform' : 61, + 'GroupNonUniformVote' : 62, + 'GroupNonUniformArithmetic' : 63, + 'GroupNonUniformBallot' : 64, + 'GroupNonUniformShuffle' : 65, + 'GroupNonUniformShuffleRelative' : 66, + 'GroupNonUniformClustered' : 67, + 'GroupNonUniformQuad' : 68, + 'SubgroupBallotKHR' : 4423, + 'DrawParameters' : 4427, + 'SubgroupVoteKHR' : 4431, + 'StorageBuffer16BitAccess' : 4433, + 'StorageUniformBufferBlock16' : 4433, + 'StorageUniform16' : 4434, + 'UniformAndStorageBuffer16BitAccess' : 4434, + 'StoragePushConstant16' : 4435, + 'StorageInputOutput16' : 4436, + 'DeviceGroup' : 4437, + 'MultiView' : 4439, + 'VariablePointersStorageBuffer' : 4441, + 'VariablePointers' : 4442, + 'AtomicStorageOps' : 4445, + 'SampleMaskPostDepthCoverage' : 4447, + 'Float16ImageAMD' : 5008, + 'ImageGatherBiasLodAMD' : 5009, + 'FragmentMaskAMD' : 5010, + 'StencilExportEXT' : 5013, + 'ImageReadWriteLodAMD' : 5015, + 'SampleMaskOverrideCoverageNV' : 5249, + 'GeometryShaderPassthroughNV' : 5251, + 'ShaderViewportIndexLayerEXT' : 5254, + 'ShaderViewportIndexLayerNV' : 5254, + 'ShaderViewportMaskNV' : 5255, + 'ShaderStereoViewNV' : 5259, + 'PerViewAttributesNV' : 5260, + 'FragmentFullyCoveredEXT' : 5265, + 'GroupNonUniformPartitionedNV' : 5297, + 'ShaderNonUniformEXT' : 5301, + 'RuntimeDescriptorArrayEXT' : 5302, + 'InputAttachmentArrayDynamicIndexingEXT' : 5303, + 'UniformTexelBufferArrayDynamicIndexingEXT' : 5304, + 'StorageTexelBufferArrayDynamicIndexingEXT' : 5305, + 'UniformBufferArrayNonUniformIndexingEXT' : 5306, + 'SampledImageArrayNonUniformIndexingEXT' : 5307, + 'StorageBufferArrayNonUniformIndexingEXT' : 5308, + 'StorageImageArrayNonUniformIndexingEXT' : 5309, + 'InputAttachmentArrayNonUniformIndexingEXT' : 5310, + 'UniformTexelBufferArrayNonUniformIndexingEXT' : 5311, + 'StorageTexelBufferArrayNonUniformIndexingEXT' : 5312, + 'SubgroupShuffleINTEL' : 5568, + 'SubgroupBufferBlockIOINTEL' : 5569, + 'SubgroupImageBlockIOINTEL' : 5570, + }, + + 'Op' : { + 'OpNop' : 0, + 'OpUndef' : 1, + 'OpSourceContinued' : 2, + 'OpSource' : 3, + 'OpSourceExtension' : 4, + 'OpName' : 5, + 'OpMemberName' : 6, + 'OpString' : 7, + 'OpLine' : 8, + 'OpExtension' : 10, + 'OpExtInstImport' : 11, + 'OpExtInst' : 12, + 'OpMemoryModel' : 14, + 'OpEntryPoint' : 15, + 'OpExecutionMode' : 16, + 'OpCapability' : 17, + 'OpTypeVoid' : 19, + 'OpTypeBool' : 20, + 'OpTypeInt' : 21, + 'OpTypeFloat' : 22, + 'OpTypeVector' : 23, + 'OpTypeMatrix' : 24, + 'OpTypeImage' : 25, + 'OpTypeSampler' : 26, + 'OpTypeSampledImage' : 27, + 'OpTypeArray' : 28, + 'OpTypeRuntimeArray' : 29, + 'OpTypeStruct' : 30, + 'OpTypeOpaque' : 31, + 'OpTypePointer' : 32, + 'OpTypeFunction' : 33, + 'OpTypeEvent' : 34, + 'OpTypeDeviceEvent' : 35, + 'OpTypeReserveId' : 36, + 'OpTypeQueue' : 37, + 'OpTypePipe' : 38, + 'OpTypeForwardPointer' : 39, + 'OpConstantTrue' : 41, + 'OpConstantFalse' : 42, + 'OpConstant' : 43, + 'OpConstantComposite' : 44, + 'OpConstantSampler' : 45, + 'OpConstantNull' : 46, + 'OpSpecConstantTrue' : 48, + 'OpSpecConstantFalse' : 49, + 'OpSpecConstant' : 50, + 'OpSpecConstantComposite' : 51, + 'OpSpecConstantOp' : 52, + 'OpFunction' : 54, + 'OpFunctionParameter' : 55, + 'OpFunctionEnd' : 56, + 'OpFunctionCall' : 57, + 'OpVariable' : 59, + 'OpImageTexelPointer' : 60, + 'OpLoad' : 61, + 'OpStore' : 62, + 'OpCopyMemory' : 63, + 'OpCopyMemorySized' : 64, + 'OpAccessChain' : 65, + 'OpInBoundsAccessChain' : 66, + 'OpPtrAccessChain' : 67, + 'OpArrayLength' : 68, + 'OpGenericPtrMemSemantics' : 69, + 'OpInBoundsPtrAccessChain' : 70, + 'OpDecorate' : 71, + 'OpMemberDecorate' : 72, + 'OpDecorationGroup' : 73, + 'OpGroupDecorate' : 74, + 'OpGroupMemberDecorate' : 75, + 'OpVectorExtractDynamic' : 77, + 'OpVectorInsertDynamic' : 78, + 'OpVectorShuffle' : 79, + 'OpCompositeConstruct' : 80, + 'OpCompositeExtract' : 81, + 'OpCompositeInsert' : 82, + 'OpCopyObject' : 83, + 'OpTranspose' : 84, + 'OpSampledImage' : 86, + 'OpImageSampleImplicitLod' : 87, + 'OpImageSampleExplicitLod' : 88, + 'OpImageSampleDrefImplicitLod' : 89, + 'OpImageSampleDrefExplicitLod' : 90, + 'OpImageSampleProjImplicitLod' : 91, + 'OpImageSampleProjExplicitLod' : 92, + 'OpImageSampleProjDrefImplicitLod' : 93, + 'OpImageSampleProjDrefExplicitLod' : 94, + 'OpImageFetch' : 95, + 'OpImageGather' : 96, + 'OpImageDrefGather' : 97, + 'OpImageRead' : 98, + 'OpImageWrite' : 99, + 'OpImage' : 100, + 'OpImageQueryFormat' : 101, + 'OpImageQueryOrder' : 102, + 'OpImageQuerySizeLod' : 103, + 'OpImageQuerySize' : 104, + 'OpImageQueryLod' : 105, + 'OpImageQueryLevels' : 106, + 'OpImageQuerySamples' : 107, + 'OpConvertFToU' : 109, + 'OpConvertFToS' : 110, + 'OpConvertSToF' : 111, + 'OpConvertUToF' : 112, + 'OpUConvert' : 113, + 'OpSConvert' : 114, + 'OpFConvert' : 115, + 'OpQuantizeToF16' : 116, + 'OpConvertPtrToU' : 117, + 'OpSatConvertSToU' : 118, + 'OpSatConvertUToS' : 119, + 'OpConvertUToPtr' : 120, + 'OpPtrCastToGeneric' : 121, + 'OpGenericCastToPtr' : 122, + 'OpGenericCastToPtrExplicit' : 123, + 'OpBitcast' : 124, + 'OpSNegate' : 126, + 'OpFNegate' : 127, + 'OpIAdd' : 128, + 'OpFAdd' : 129, + 'OpISub' : 130, + 'OpFSub' : 131, + 'OpIMul' : 132, + 'OpFMul' : 133, + 'OpUDiv' : 134, + 'OpSDiv' : 135, + 'OpFDiv' : 136, + 'OpUMod' : 137, + 'OpSRem' : 138, + 'OpSMod' : 139, + 'OpFRem' : 140, + 'OpFMod' : 141, + 'OpVectorTimesScalar' : 142, + 'OpMatrixTimesScalar' : 143, + 'OpVectorTimesMatrix' : 144, + 'OpMatrixTimesVector' : 145, + 'OpMatrixTimesMatrix' : 146, + 'OpOuterProduct' : 147, + 'OpDot' : 148, + 'OpIAddCarry' : 149, + 'OpISubBorrow' : 150, + 'OpUMulExtended' : 151, + 'OpSMulExtended' : 152, + 'OpAny' : 154, + 'OpAll' : 155, + 'OpIsNan' : 156, + 'OpIsInf' : 157, + 'OpIsFinite' : 158, + 'OpIsNormal' : 159, + 'OpSignBitSet' : 160, + 'OpLessOrGreater' : 161, + 'OpOrdered' : 162, + 'OpUnordered' : 163, + 'OpLogicalEqual' : 164, + 'OpLogicalNotEqual' : 165, + 'OpLogicalOr' : 166, + 'OpLogicalAnd' : 167, + 'OpLogicalNot' : 168, + 'OpSelect' : 169, + 'OpIEqual' : 170, + 'OpINotEqual' : 171, + 'OpUGreaterThan' : 172, + 'OpSGreaterThan' : 173, + 'OpUGreaterThanEqual' : 174, + 'OpSGreaterThanEqual' : 175, + 'OpULessThan' : 176, + 'OpSLessThan' : 177, + 'OpULessThanEqual' : 178, + 'OpSLessThanEqual' : 179, + 'OpFOrdEqual' : 180, + 'OpFUnordEqual' : 181, + 'OpFOrdNotEqual' : 182, + 'OpFUnordNotEqual' : 183, + 'OpFOrdLessThan' : 184, + 'OpFUnordLessThan' : 185, + 'OpFOrdGreaterThan' : 186, + 'OpFUnordGreaterThan' : 187, + 'OpFOrdLessThanEqual' : 188, + 'OpFUnordLessThanEqual' : 189, + 'OpFOrdGreaterThanEqual' : 190, + 'OpFUnordGreaterThanEqual' : 191, + 'OpShiftRightLogical' : 194, + 'OpShiftRightArithmetic' : 195, + 'OpShiftLeftLogical' : 196, + 'OpBitwiseOr' : 197, + 'OpBitwiseXor' : 198, + 'OpBitwiseAnd' : 199, + 'OpNot' : 200, + 'OpBitFieldInsert' : 201, + 'OpBitFieldSExtract' : 202, + 'OpBitFieldUExtract' : 203, + 'OpBitReverse' : 204, + 'OpBitCount' : 205, + 'OpDPdx' : 207, + 'OpDPdy' : 208, + 'OpFwidth' : 209, + 'OpDPdxFine' : 210, + 'OpDPdyFine' : 211, + 'OpFwidthFine' : 212, + 'OpDPdxCoarse' : 213, + 'OpDPdyCoarse' : 214, + 'OpFwidthCoarse' : 215, + 'OpEmitVertex' : 218, + 'OpEndPrimitive' : 219, + 'OpEmitStreamVertex' : 220, + 'OpEndStreamPrimitive' : 221, + 'OpControlBarrier' : 224, + 'OpMemoryBarrier' : 225, + 'OpAtomicLoad' : 227, + 'OpAtomicStore' : 228, + 'OpAtomicExchange' : 229, + 'OpAtomicCompareExchange' : 230, + 'OpAtomicCompareExchangeWeak' : 231, + 'OpAtomicIIncrement' : 232, + 'OpAtomicIDecrement' : 233, + 'OpAtomicIAdd' : 234, + 'OpAtomicISub' : 235, + 'OpAtomicSMin' : 236, + 'OpAtomicUMin' : 237, + 'OpAtomicSMax' : 238, + 'OpAtomicUMax' : 239, + 'OpAtomicAnd' : 240, + 'OpAtomicOr' : 241, + 'OpAtomicXor' : 242, + 'OpPhi' : 245, + 'OpLoopMerge' : 246, + 'OpSelectionMerge' : 247, + 'OpLabel' : 248, + 'OpBranch' : 249, + 'OpBranchConditional' : 250, + 'OpSwitch' : 251, + 'OpKill' : 252, + 'OpReturn' : 253, + 'OpReturnValue' : 254, + 'OpUnreachable' : 255, + 'OpLifetimeStart' : 256, + 'OpLifetimeStop' : 257, + 'OpGroupAsyncCopy' : 259, + 'OpGroupWaitEvents' : 260, + 'OpGroupAll' : 261, + 'OpGroupAny' : 262, + 'OpGroupBroadcast' : 263, + 'OpGroupIAdd' : 264, + 'OpGroupFAdd' : 265, + 'OpGroupFMin' : 266, + 'OpGroupUMin' : 267, + 'OpGroupSMin' : 268, + 'OpGroupFMax' : 269, + 'OpGroupUMax' : 270, + 'OpGroupSMax' : 271, + 'OpReadPipe' : 274, + 'OpWritePipe' : 275, + 'OpReservedReadPipe' : 276, + 'OpReservedWritePipe' : 277, + 'OpReserveReadPipePackets' : 278, + 'OpReserveWritePipePackets' : 279, + 'OpCommitReadPipe' : 280, + 'OpCommitWritePipe' : 281, + 'OpIsValidReserveId' : 282, + 'OpGetNumPipePackets' : 283, + 'OpGetMaxPipePackets' : 284, + 'OpGroupReserveReadPipePackets' : 285, + 'OpGroupReserveWritePipePackets' : 286, + 'OpGroupCommitReadPipe' : 287, + 'OpGroupCommitWritePipe' : 288, + 'OpEnqueueMarker' : 291, + 'OpEnqueueKernel' : 292, + 'OpGetKernelNDrangeSubGroupCount' : 293, + 'OpGetKernelNDrangeMaxSubGroupSize' : 294, + 'OpGetKernelWorkGroupSize' : 295, + 'OpGetKernelPreferredWorkGroupSizeMultiple' : 296, + 'OpRetainEvent' : 297, + 'OpReleaseEvent' : 298, + 'OpCreateUserEvent' : 299, + 'OpIsValidEvent' : 300, + 'OpSetUserEventStatus' : 301, + 'OpCaptureEventProfilingInfo' : 302, + 'OpGetDefaultQueue' : 303, + 'OpBuildNDRange' : 304, + 'OpImageSparseSampleImplicitLod' : 305, + 'OpImageSparseSampleExplicitLod' : 306, + 'OpImageSparseSampleDrefImplicitLod' : 307, + 'OpImageSparseSampleDrefExplicitLod' : 308, + 'OpImageSparseSampleProjImplicitLod' : 309, + 'OpImageSparseSampleProjExplicitLod' : 310, + 'OpImageSparseSampleProjDrefImplicitLod' : 311, + 'OpImageSparseSampleProjDrefExplicitLod' : 312, + 'OpImageSparseFetch' : 313, + 'OpImageSparseGather' : 314, + 'OpImageSparseDrefGather' : 315, + 'OpImageSparseTexelsResident' : 316, + 'OpNoLine' : 317, + 'OpAtomicFlagTestAndSet' : 318, + 'OpAtomicFlagClear' : 319, + 'OpImageSparseRead' : 320, + 'OpSizeOf' : 321, + 'OpTypePipeStorage' : 322, + 'OpConstantPipeStorage' : 323, + 'OpCreatePipeFromPipeStorage' : 324, + 'OpGetKernelLocalSizeForSubgroupCount' : 325, + 'OpGetKernelMaxNumSubgroups' : 326, + 'OpTypeNamedBarrier' : 327, + 'OpNamedBarrierInitialize' : 328, + 'OpMemoryNamedBarrier' : 329, + 'OpModuleProcessed' : 330, + 'OpExecutionModeId' : 331, + 'OpDecorateId' : 332, + 'OpGroupNonUniformElect' : 333, + 'OpGroupNonUniformAll' : 334, + 'OpGroupNonUniformAny' : 335, + 'OpGroupNonUniformAllEqual' : 336, + 'OpGroupNonUniformBroadcast' : 337, + 'OpGroupNonUniformBroadcastFirst' : 338, + 'OpGroupNonUniformBallot' : 339, + 'OpGroupNonUniformInverseBallot' : 340, + 'OpGroupNonUniformBallotBitExtract' : 341, + 'OpGroupNonUniformBallotBitCount' : 342, + 'OpGroupNonUniformBallotFindLSB' : 343, + 'OpGroupNonUniformBallotFindMSB' : 344, + 'OpGroupNonUniformShuffle' : 345, + 'OpGroupNonUniformShuffleXor' : 346, + 'OpGroupNonUniformShuffleUp' : 347, + 'OpGroupNonUniformShuffleDown' : 348, + 'OpGroupNonUniformIAdd' : 349, + 'OpGroupNonUniformFAdd' : 350, + 'OpGroupNonUniformIMul' : 351, + 'OpGroupNonUniformFMul' : 352, + 'OpGroupNonUniformSMin' : 353, + 'OpGroupNonUniformUMin' : 354, + 'OpGroupNonUniformFMin' : 355, + 'OpGroupNonUniformSMax' : 356, + 'OpGroupNonUniformUMax' : 357, + 'OpGroupNonUniformFMax' : 358, + 'OpGroupNonUniformBitwiseAnd' : 359, + 'OpGroupNonUniformBitwiseOr' : 360, + 'OpGroupNonUniformBitwiseXor' : 361, + 'OpGroupNonUniformLogicalAnd' : 362, + 'OpGroupNonUniformLogicalOr' : 363, + 'OpGroupNonUniformLogicalXor' : 364, + 'OpGroupNonUniformQuadBroadcast' : 365, + 'OpGroupNonUniformQuadSwap' : 366, + 'OpSubgroupBallotKHR' : 4421, + 'OpSubgroupFirstInvocationKHR' : 4422, + 'OpSubgroupAllKHR' : 4428, + 'OpSubgroupAnyKHR' : 4429, + 'OpSubgroupAllEqualKHR' : 4430, + 'OpSubgroupReadInvocationKHR' : 4432, + 'OpGroupIAddNonUniformAMD' : 5000, + 'OpGroupFAddNonUniformAMD' : 5001, + 'OpGroupFMinNonUniformAMD' : 5002, + 'OpGroupUMinNonUniformAMD' : 5003, + 'OpGroupSMinNonUniformAMD' : 5004, + 'OpGroupFMaxNonUniformAMD' : 5005, + 'OpGroupUMaxNonUniformAMD' : 5006, + 'OpGroupSMaxNonUniformAMD' : 5007, + 'OpFragmentMaskFetchAMD' : 5011, + 'OpFragmentFetchAMD' : 5012, + 'OpGroupNonUniformPartitionNV' : 5296, + 'OpSubgroupShuffleINTEL' : 5571, + 'OpSubgroupShuffleDownINTEL' : 5572, + 'OpSubgroupShuffleUpINTEL' : 5573, + 'OpSubgroupShuffleXorINTEL' : 5574, + 'OpSubgroupBlockReadINTEL' : 5575, + 'OpSubgroupBlockWriteINTEL' : 5576, + 'OpSubgroupImageBlockReadINTEL' : 5577, + 'OpSubgroupImageBlockWriteINTEL' : 5578, + 'OpDecorateStringGOOGLE' : 5632, + 'OpMemberDecorateStringGOOGLE' : 5633, + }, + +} + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/LICENSE vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/LICENSE --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/LICENSE 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,25 @@ +Copyright (c) 2015-2018 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and/or associated documentation files (the +"Materials"), to deal in the Materials without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Materials, and to +permit persons to whom the Materials are furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Materials. + +MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS +KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS +SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT + https://www.khronos.org/registry/ + +THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/README.md vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/README.md --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/README.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/README.md 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,127 @@ +# SPIR-V Headers + +This repository contains machine-readable files for the +[SPIR-V Registry](https://www.khronos.org/registry/spir-v/). +This includes: + +* Header files for various languages. +* JSON files describing the grammar for the SPIR-V core instruction set + and the extended instruction sets. +* The XML registry file. +* A tool to build the headers from the JSON grammar. + +Headers are provided in the [include](include) directory, with up-to-date +headers in the `unified1` subdirectory. Older headers are provided according to +their version. + +In contrast, the XML registry file has a linear history, so it is +not tied to SPIR-V specification versions. + +## How is this repository updated? + +When a new version or revision of the SPIR-V specification is published, +the SPIR-V Working Group will push new commits onto master, updating +the files under [include](include). + +The SPIR-V XML registry file is updated by Khronos whenever a new enum range is allocated. + +Pull requests can be made to +- request allocation of new enum ranges in the XML registry file +- reserve specific tokens in the JSON grammar + +## How to install the headers + +``` +mkdir build +cd build +cmake .. +# Linux +cmake --build . --target install-headers +# Windows +cmake --build . --config Debug --target install-headers +``` + +Then, for example, you will have `/usr/local/include/spirv/unified1/spirv.h` + +If you want to install them somewhere else, then use +`-DCMAKE_INSTALL_PREFIX=/other/path` on the first `cmake` command. + +## Using the headers without installing + +A CMake-based project can use the headers without installing, as follows: + +1. Add an `add_subdirectory` directive to include this source tree. +2. Use `${SPIRV-Headers_SOURCE_DIR}/include}` in a `target_include_directories` + directive. +3. In your C or C++ source code use `#include` directives that explicitly mention + the `spirv` path component. +``` +#include "spirv/unified1/GLSL.std.450.h" +#include "spirv/unified1/OpenCL.std.h" +#include "spirv/unified1/spirv.hpp" +``` + +See also the [example](example/) subdirectory. But since that example is +*inside* this repostory, it doesn't use and `add_subdirectory` directive. + +## Generating the headers from the JSON grammar + +This will generally be done by Khronos, for a change to the JSON grammar. +However, the project for the tool to do this is included in this repository, +and can be used to test a PR, or even to include the results in the PR. +This is not required though. + +The header-generation project is under the `tools/buildHeaders` directory. +Use CMake to build the project, in a `build` subdirectory (under `tools/buildHeaders`). +There is then a bash script at `bin/makeHeaders` that shows how to use the built +header-generator binary to generate the headers from the JSON grammar. +(Execute `bin/makeHeaders` from the `tools/buildHeaders` directory.) + +Notes: +- this generator is used in a broader context within Khronos to generate the specification, + and that influences the languages used, for legacy reasons +- the C++ structures built may similarly include more than strictly necessary, for the same reason + +## FAQ + +* *How are different versions published?* + + The multiple versions of the headers have been simplified into a + single `unified1` view. The JSON grammar has a "version" field saying + what version things first showed up in. + +* *How do you handle the evolution of extended instruction sets?* + + Extended instruction sets evolve asynchronously from the core spec. + Right now there is only a single version of both the GLSL and OpenCL + headers. So we don't yet have a problematic example to resolve. + +## License + +``` +Copyright (c) 2015-2018 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and/or associated documentation files (the +"Materials"), to deal in the Materials without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Materials, and to +permit persons to whom the Materials are furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Materials. + +MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS +KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS +SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT + https://www.khronos.org/registry/ + +THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +``` diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/bin/makeHeaders vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/bin/makeHeaders --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/bin/makeHeaders 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/bin/makeHeaders 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,5 @@ +#!/usr/bin/bash + +cd ../../include/spirv/unified1 +../../../tools/buildHeaders/build/install/bin/buildSpvHeaders -H spirv.core.grammar.json +dos2unix spirv.* diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/CMakeLists.txt 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 2.8) + +set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "prefix" FORCE) + +project(buildSpvHeaders) + +set(SOURCES + main.cpp + jsonToSpirv.cpp + header.cpp + jsoncpp/dist/jsoncpp.cpp) + +set(HEADERS + jsonToSpirv.h + header.h + jsoncpp/dist/json/json.h) + +if(CMAKE_COMPILER_IS_GNUCXX) + add_definitions(-std=c++11) +elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_definitions(-std=c++11) +endif() + +add_executable(buildSpvHeaders ${SOURCES} ${HEADERS}) + +install(TARGETS buildSpvHeaders RUNTIME DESTINATION bin) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/header.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/header.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/header.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/header.cpp 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,713 @@ +// Copyright (c) 2014-2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// +// Print headers for SPIR-V in several languages. +// +// To change the header information, change the C++-built database in doc.*. +// +// Then, use "spriv -h " - e.g, spriv.{h,hpp,lua,py,etc}: +// replace the auto-generated header, or "spirv -H" to generate all +// supported language headers to predefined names in the current directory. +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "jsoncpp/dist/json/json.h" + +#include "header.h" +#include "jsonToSpirv.h" + +// snprintf and _snprintf are not quite the same, but close enough +// for our use. +#ifdef _MSC_VER +#pragma warning(disable:4996) +#define snprintf _snprintf +#endif + +// This file converts SPIR-V definitions to an internal JSON +// representation, and then generates language specific +// data from that single internal form. + +// Initially, the internal form is created from C++ data, +// though this can be changed to a JSON master in time. + +namespace { + class TPrinter { + protected: + TPrinter(); + + static const int DocMagicNumber = 0x07230203; + static const int DocVersion = 0x00010300; + static const int DocRevision = 1; + #define DocRevisionString "1" + static const std::string DocCopyright; + static const std::string DocComment1; + static const std::string DocComment2; + + enum enumStyle_t { + enumNoMask, + enumCount, + enumShift, + enumMask, + enumHex, + }; + + static std::string styleStr(enumStyle_t s) { + return s == enumShift ? "Shift" : + s == enumMask ? "Mask" : ""; + } + + friend std::ostream& operator<<(std::ostream&, const TPrinter&); + + virtual void printAll(std::ostream&) const; + virtual void printComments(std::ostream&) const; + virtual void printPrologue(std::ostream&) const { } + virtual void printDefs(std::ostream&) const; + virtual void printEpilogue(std::ostream&) const { } + virtual void printMeta(std::ostream&) const; + virtual void printTypes(std::ostream&) const { } + + virtual std::string escapeComment(const std::string& s) const; + + // Default printComments() uses these comment strings + virtual std::string commentBeg() const { return ""; } + virtual std::string commentEnd(bool isLast) const { return ""; } + virtual std::string commentBOL() const { return ""; } + virtual std::string commentEOL(bool isLast) const { return ""; } + + typedef std::pair valpair_t; + + // for printing enum values + virtual std::string enumBeg(const std::string&, enumStyle_t) const { return ""; } + virtual std::string enumEnd(const std::string&, enumStyle_t, bool isLast = false) const { + return ""; + } + virtual std::string enumFmt(const std::string&, const valpair_t&, + enumStyle_t, bool isLast = false) const { + return ""; + } + virtual std::string maxEnumFmt(const std::string&, const valpair_t&, + enumStyle_t) const { + return ""; + } + + virtual std::string fmtConstInt(unsigned val, const std::string& name, + const char* fmt, bool isLast = false) const { + return ""; + } + + std::vector getSortedVals(const Json::Value&) const; + + virtual std::string indent(int count = 1) const { + return std::string(count * 4, ' '); // default indent level = 4 + } + + static std::string fmtNum(const char* fmt, unsigned val) { + char buff[16]; // ample for 8 hex digits + 0x + snprintf(buff, sizeof(buff), fmt, val); + buff[sizeof(buff)-1] = '\0'; // MSVC doesn't promise null termination + return buff; + } + + static std::string fmtStyleVal(unsigned v, enumStyle_t style); + + // If the enum value name would start with a sigit, prepend the enum name. + // E.g, "3D" -> "Dim3D". + static std::string prependIfDigit(const std::string& ename, const std::string& vname) { + return (std::isdigit(vname[0]) ? ename : std::string("")) + vname; + } + + void addComment(Json::Value& node, const std::string& str); + + Json::Value spvRoot; // JSON SPIR-V data + }; + + // Format value as mask or value + std::string TPrinter::fmtStyleVal(unsigned v, enumStyle_t style) + { + switch (style) { + case enumMask: + return fmtNum("0x%08x", 1< + TPrinter::getSortedVals(const Json::Value& p) const + { + std::vector values; + + for (auto e = p.begin(); e != p.end(); ++e) + values.push_back(valpair_t(e->asUInt(), e.name())); + + // Use a stable sort because we might have aliases, e.g. + // SubgropuBallot (might be in future core) vs. SubgroupBallotKHR. + std::stable_sort(values.begin(), values.end()); + + return values; + } + + // Escape comment characters if needed + std::string TPrinter::escapeComment(const std::string& s) const { return s; } + + // Format comments in language specific way + void TPrinter::printComments(std::ostream& out) const + { + const int commentCount = spvRoot["spv"]["meta"]["Comment"].size(); + int commentNum = 0; + + for (const auto& comment : spvRoot["spv"]["meta"]["Comment"]) { + out << commentBeg(); + + for (int line = 0; line < int(comment.size()); ++line) + out << commentBOL() << escapeComment(comment[line].asString()) << + commentEOL((line+1) == comment.size()) << std::endl; + + out << commentEnd(++commentNum == commentCount) << std::endl; + } + } + + // Format header metadata + void TPrinter::printMeta(std::ostream& out) const + { + const Json::Value& meta = spvRoot["spv"]["meta"]; + + const auto print = [&](const char* name, const char* fmt, bool isLast) { + out << fmtConstInt(meta[name].asUInt(), name, fmt, isLast); + }; + + print("MagicNumber", "0x%08lx", false); + print("Version", "0x%08lx", false); + print("Revision", "%d", false); + print("OpCodeMask", "0x%04x", false); + print("WordCountShift", "%d", true); + } + + // Format value definitions in language specific way + void TPrinter::printDefs(std::ostream& out) const + { + const Json::Value& enums = spvRoot["spv"]["enum"]; + + for (auto opClass = enums.begin(); opClass != enums.end(); ++opClass) { + const bool isMask = (*opClass)["Type"].asString() == "Bit"; + const auto opName = (*opClass)["Name"].asString(); + const auto opPrefix = opName == "Op" ? "" : opName; + + for (enumStyle_t style = (isMask ? enumShift : enumCount); + style <= (isMask ? enumMask : enumCount); style = enumStyle_t(int(style)+1)) { + + out << enumBeg(opName, style); + + if (style == enumMask) + out << enumFmt(opPrefix, valpair_t(0, "MaskNone"), enumNoMask); + + const auto sorted = getSortedVals((*opClass)["Values"]); + + std::string maxEnum = maxEnumFmt(opName, valpair_t(0x7FFFFFFF, "Max"), enumHex); + + bool printMax = (style != enumMask && maxEnum.size() > 0); + + for (const auto& v : sorted) + out << enumFmt(opPrefix, v, style, !printMax && v.first == sorted.back().first); + + if (printMax) + out << maxEnum; + + auto nextOpClass = opClass; + out << enumEnd(opName, style, ++nextOpClass == enums.end()); + } + } + } + + void TPrinter::printAll(std::ostream& out) const + { + printComments(out); + printPrologue(out); + printTypes(out); + printMeta(out); + printDefs(out); + printEpilogue(out); + } + + // Stream entire header to output + std::ostream& operator<<(std::ostream& out, const TPrinter &p) + { + p.printAll(out); + return out; + } + + // JSON printer. Rather than use the default printer, we supply our own so + // we can control the printing order within various containers. + class TPrinterJSON final : public TPrinter { + private: + void printPrologue(std::ostream& out) const override { out << "{\n" + indent() + "\"spv\":\n" + indent() + "{\n"; } + void printEpilogue(std::ostream& out) const override { out << indent() + "}\n}\n"; } + + std::string escapeComment(const std::string& s) const override { + std::string newStr; + for (auto c : s) { + if (c == '"') { + newStr += '\\'; + newStr += c; + } else { + newStr += c; + } + } + return newStr; + } + + std::string fmtConstInt(unsigned val, const std::string& name, + const char* fmt, bool isLast) const override { + return indent(3) + '"' + name + "\": " + fmtNum("%d", val) + (isLast ? "\n" : ",\n"); + } + + void printMeta(std::ostream& out) const override + { + out << indent(2) + "\"meta\":\n" + indent(2) + "{\n"; + printComments(out); + TPrinter::printMeta(out); + out << indent(2) + "},\n"; + } + + std::string commentBeg() const override { return indent(4) + "[\n"; } + std::string commentEnd(bool isLast) const override { return indent(4) + (isLast ? "]" : "],"); } + std::string commentBOL() const override { return indent(5) + '"'; } + std::string commentEOL(bool isLast) const override { return (isLast ? "\"" : "\","); } + + void printComments(std::ostream& out) const override + { + out << indent(3) + "\"Comment\":\n" + indent(3) + "[\n"; + TPrinter::printComments(out); + out << indent(3) + "],\n"; + } + + void printDefs(std::ostream& out) const override + { + out << indent(2) + "\"enum\":\n" + indent(2) + "[\n"; + TPrinter::printDefs(out); + out << indent(2) + "]\n"; + } + + void printAll(std::ostream& out) const override + { + printPrologue(out); + printMeta(out); + printDefs(out); + printEpilogue(out); + } + + std::string enumBeg(const std::string& s, enumStyle_t style) const override { + if (style == enumMask) + return ""; + return indent(3) + "{\n" + + indent(4) + "\"Name\": \"" + s + "\",\n" + + indent(4) + "\"Type\": " + (style == enumShift ? "\"Bit\"" : "\"Value\"") + ",\n" + + indent(4) + "\"Values\":\n" + + indent(4) + "{\n"; + } + + std::string enumEnd(const std::string& s, enumStyle_t style, bool isLast) const override { + if (style == enumMask) + return ""; + return indent(4) + "}\n" + + indent(3) + "}" + (isLast ? "" : ",") + "\n"; + } + + std::string enumFmt(const std::string& s, const valpair_t& v, + enumStyle_t style, bool isLast) const override { + if (style == enumMask || style == enumNoMask) + return ""; + return indent(5) + '"' + prependIfDigit(s, v.second) + "\": " + fmtNum("%d", v.first) + + (isLast ? "\n" : ",\n"); + } + }; + + // base for C and C++ + class TPrinterCBase : public TPrinter { + protected: + virtual void printPrologue(std::ostream& out) const override { + out << "#ifndef spirv_" << headerGuardSuffix() << std::endl + << "#define spirv_" << headerGuardSuffix() << std::endl + << std::endl; + } + + void printMeta(std::ostream& out) const override { + out << "#define SPV_VERSION 0x" << std::hex << DocVersion << std::dec << "\n"; + out << "#define SPV_REVISION " << DocRevision << "\n"; + out << "\n"; + + return TPrinter::printMeta(out); + } + + virtual void printEpilogue(std::ostream& out) const override { + out << "#endif // #ifndef spirv_" << headerGuardSuffix() << std::endl; + } + + virtual void printTypes(std::ostream& out) const override { + out << "typedef unsigned int " << pre() << "Id;\n\n"; + } + + virtual std::string fmtConstInt(unsigned val, const std::string& name, + const char* fmt, bool isLast) const override + { + return std::string("static const unsigned int ") + pre() + name + + " = " + fmtNum(fmt, val) + (isLast ? ";\n\n" : ";\n"); + } + + virtual std::string pre() const { return ""; } // C name prefix + virtual std::string headerGuardSuffix() const = 0; + }; + + // C printer + class TPrinterC final : public TPrinterCBase { + private: + std::string commentBeg() const override { return "/*\n"; } + std::string commentEnd(bool isLast) const override { return "*/\n"; } + std::string commentBOL() const override { return "** "; } + + std::string enumBeg(const std::string& s, enumStyle_t style) const override { + return std::string("typedef enum ") + pre() + s + styleStr(style) + "_ {\n"; + } + + std::string enumEnd(const std::string& s, enumStyle_t style, bool isLast) const override { + return "} " + pre() + s + styleStr(style) + ";\n\n"; + } + + std::string enumFmt(const std::string& s, const valpair_t& v, + enumStyle_t style, bool isLast) const override { + return indent() + pre() + s + v.second + styleStr(style) + " = " + fmtStyleVal(v.first, style) + ",\n"; + } + + std::string maxEnumFmt(const std::string& s, const valpair_t& v, + enumStyle_t style) const override { + return enumFmt(s, v, style, true); + } + + std::string pre() const override { return "Spv"; } // C name prefix + std::string headerGuardSuffix() const override { return "H"; } + }; + + // C++ printer + class TPrinterCPP : public TPrinterCBase { + private: + void printPrologue(std::ostream& out) const override { + TPrinterCBase::printPrologue(out); + out << "namespace spv {\n\n"; + } + + void printEpilogue(std::ostream& out) const override { + const Json::Value& enums = spvRoot["spv"]["enum"]; + + // Create overloaded operator| for mask types + out << "// Overload operator| for mask bit combining\n\n"; + + for (auto opClass = enums.begin(); opClass != enums.end(); ++opClass) { + const bool isMask = (*opClass)["Type"].asString() == "Bit"; + const auto opName = (*opClass)["Name"].asString(); + + if (isMask) { + const auto typeName = opName + styleStr(enumMask); + + out << "inline " + typeName + " operator|(" + typeName + " a, " + typeName + " b) { return " + + typeName + "(unsigned(a) | unsigned(b)); }\n"; + } + } + + out << "\n} // end namespace spv\n\n"; + TPrinterCBase::printEpilogue(out); + } + + std::string commentBOL() const override { return "// "; } + + + virtual std::string enumBeg(const std::string& s, enumStyle_t style) const override { + return std::string("enum ") + s + styleStr(style) + " {\n"; + } + + std::string enumEnd(const std::string& s, enumStyle_t style, bool isLast) const override { + return "};\n\n"; + } + + virtual std::string enumFmt(const std::string& s, const valpair_t& v, + enumStyle_t style, bool isLast) const override { + return indent() + s + v.second + styleStr(style) + " = " + fmtStyleVal(v.first, style) + ",\n"; + } + + virtual std::string maxEnumFmt(const std::string& s, const valpair_t& v, + enumStyle_t style) const override { + return enumFmt(s, v, style, true); + } + + // The C++ and C++11 headers define types with the same name. So they + // should use the same header guard. + std::string headerGuardSuffix() const override { return "HPP"; } + + std::string operators; + }; + + // C++11 printer (uses enum classes) + class TPrinterCPP11 final : public TPrinterCPP { + private: + std::string enumBeg(const std::string& s, enumStyle_t style) const override { + return std::string("enum class ") + s + styleStr(style) + " : unsigned {\n"; + } + + std::string enumFmt(const std::string& s, const valpair_t& v, + enumStyle_t style, bool isLast) const override { + return indent() + prependIfDigit(s, v.second) + " = " + fmtStyleVal(v.first, style) + ",\n"; + } + + std::string maxEnumFmt(const std::string& s, const valpair_t& v, + enumStyle_t style) const override { + return enumFmt(s, v, style, true); + } + + std::string headerGuardSuffix() const override { return "HPP"; } + }; + + // LUA printer + class TPrinterLua final : public TPrinter { + private: + void printPrologue(std::ostream& out) const override { out << "spv = {\n"; } + + void printEpilogue(std::ostream& out) const override { out << "}\n"; } + + std::string commentBOL() const override { return "-- "; } + + std::string enumBeg(const std::string& s, enumStyle_t style) const override { + return indent() + s + styleStr(style) + " = {\n"; + } + + std::string enumEnd(const std::string& s, enumStyle_t style, bool isLast) const override { + return indent() + "},\n\n"; + } + + std::string enumFmt(const std::string& s, const valpair_t& v, + enumStyle_t style, bool isLast) const override { + return indent(2) + prependIfDigit(s, v.second) + " = " + fmtStyleVal(v.first, style) + ",\n"; + } + + virtual std::string fmtConstInt(unsigned val, const std::string& name, + const char* fmt, bool isLast) const override + { + return indent() + name + " = " + fmtNum(fmt, val) + (isLast ? ",\n\n" : ",\n"); + } + }; + + // Python printer + class TPrinterPython final : public TPrinter { + private: + void printPrologue(std::ostream& out) const override { out << "spv = {\n"; } + + void printEpilogue(std::ostream& out) const override { out << "}\n"; } + + std::string commentBOL() const override { return "# "; } + + std::string enumBeg(const std::string& s, enumStyle_t style) const override { + return indent() + "'" + s + styleStr(style) + "'" + " : {\n"; + } + + std::string enumEnd(const std::string& s, enumStyle_t style, bool isLast) const override { + return indent() + "},\n\n"; + } + + std::string enumFmt(const std::string& s, const valpair_t& v, + enumStyle_t style, bool isLast) const override { + return indent(2) + "'" + prependIfDigit(s, v.second) + "'" + " : " + fmtStyleVal(v.first, style) + ",\n"; + } + + std::string fmtConstInt(unsigned val, const std::string& name, + const char* fmt, bool isLast) const override + { + return indent() + "'" + name + "'" + " : " + fmtNum(fmt, val) + (isLast ? ",\n\n" : ",\n"); + } + }; + +} // namespace + +namespace spv { + void PrintAllHeaders() + { + // TODO: Once MSVC 2012 is no longer a factor, use brace initializers here + std::vector> langInfo; + + langInfo.push_back(std::make_pair(ELangC, "spirv.h")); + langInfo.push_back(std::make_pair(ELangCPP, "spirv.hpp")); + langInfo.push_back(std::make_pair(ELangCPP11, "spirv.hpp11")); + langInfo.push_back(std::make_pair(ELangJSON, "spirv.json")); + langInfo.push_back(std::make_pair(ELangLua, "spirv.lua")); + langInfo.push_back(std::make_pair(ELangPython, "spirv.py")); + + for (const auto& lang : langInfo) { + std::ofstream out(lang.second, std::ios::out); + + if ((out.rdstate() & std::ifstream::failbit)) { + std::cerr << "Unable to open file: " << lang.second << std::endl; + } else { + PrintHeader(lang.first, out); + } + } + } + + // Print header for given language to given output stream + void PrintHeader(TLanguage lang, std::ostream& out) + { + typedef std::unique_ptr TPrinterPtr; + TPrinterPtr p; + + switch (lang) { + case ELangC: p = TPrinterPtr(new TPrinterC); break; + case ELangCPP: p = TPrinterPtr(new TPrinterCPP); break; + case ELangCPP11: p = TPrinterPtr(new TPrinterCPP11); break; + case ELangJSON: p = TPrinterPtr(new TPrinterJSON); break; + case ELangLua: p = TPrinterPtr(new TPrinterLua); break; + case ELangPython: p = TPrinterPtr(new TPrinterPython); break; + case ELangAll: PrintAllHeaders(); break; + default: + std::cerr << "Unknown language." << std::endl; + return; + } + + // Print the data in the requested format + if (p) + out << *p << std::endl; + + // object is auto-deleted + } + +} // namespace spv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/header.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/header.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/header.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/header.h 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,52 @@ +// Copyright (c) 2014-2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// +// Print headers for SPIR-V in several languages. +// + +#pragma once +#ifndef header +#define header + +#include + +namespace spv { + // Languages supported + enum TLanguage { + ELangC, // C + ELangCPP, // C++03 + ELangCPP11, // C++11 + ELangJSON, // JSON + ELangLua, // Lua + ELangPython, // Python + + ELangAll, // print headers in all languages to files + }; + + // Generate header for requested language + void PrintHeader(TLanguage, std::ostream&); +} // namespace spv + +#endif // header diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsoncpp/dist/json/json-forwards.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsoncpp/dist/json/json-forwards.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsoncpp/dist/json/json-forwards.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsoncpp/dist/json/json-forwards.h 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,255 @@ +/// Json-cpp amalgated forward header (http://jsoncpp.sourceforge.net/). +/// It is intended to be used with #include "json/json-forwards.h" +/// This header provides forward declaration for all JsonCpp types. + +// ////////////////////////////////////////////////////////////////////// +// Beginning of content of file: LICENSE +// ////////////////////////////////////////////////////////////////////// + +/* +The JsonCpp library's source code, including accompanying documentation, +tests and demonstration applications, are licensed under the following +conditions... + +The author (Baptiste Lepilleur) explicitly disclaims copyright in all +jurisdictions which recognize such a disclaimer. In such jurisdictions, +this software is released into the Public Domain. + +In jurisdictions which do not recognize Public Domain property (e.g. Germany as of +2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is +released under the terms of the MIT License (see below). + +In jurisdictions which recognize Public Domain property, the user of this +software may choose to accept it either as 1) Public Domain, 2) under the +conditions of the MIT License (see below), or 3) under the terms of dual +Public Domain/MIT License conditions described here, as they choose. + +The MIT License is about as close to Public Domain as a license can get, and is +described in clear, concise terms at: + + http://en.wikipedia.org/wiki/MIT_License + +The full text of the MIT License follows: + +======================================================================== +Copyright (c) 2007-2010 Baptiste Lepilleur + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +======================================================================== +(END LICENSE TEXT) + +The MIT license is compatible with both the GPL and commercial +software, affording one all of the rights of Public Domain with the +minor nuisance of being required to keep the above copyright notice +and license text in the source code. Note also that by accepting the +Public Domain "license" you can re-license your copy using whatever +license you like. + +*/ + +// ////////////////////////////////////////////////////////////////////// +// End of content of file: LICENSE +// ////////////////////////////////////////////////////////////////////// + + + + + +#ifndef JSON_FORWARD_AMALGATED_H_INCLUDED +# define JSON_FORWARD_AMALGATED_H_INCLUDED +/// If defined, indicates that the source file is amalgated +/// to prevent private header inclusion. +#define JSON_IS_AMALGAMATION + +// ////////////////////////////////////////////////////////////////////// +// Beginning of content of file: include/json/config.h +// ////////////////////////////////////////////////////////////////////// + +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef JSON_CONFIG_H_INCLUDED +#define JSON_CONFIG_H_INCLUDED + +/// If defined, indicates that json library is embedded in CppTL library. +//# define JSON_IN_CPPTL 1 + +/// If defined, indicates that json may leverage CppTL library +//# define JSON_USE_CPPTL 1 +/// If defined, indicates that cpptl vector based map should be used instead of +/// std::map +/// as Value container. +//# define JSON_USE_CPPTL_SMALLMAP 1 + +// If non-zero, the library uses exceptions to report bad input instead of C +// assertion macros. The default is to use exceptions. +#ifndef JSON_USE_EXCEPTION +#define JSON_USE_EXCEPTION 1 +#endif + +/// If defined, indicates that the source file is amalgated +/// to prevent private header inclusion. +/// Remarks: it is automatically defined in the generated amalgated header. +// #define JSON_IS_AMALGAMATION + +#ifdef JSON_IN_CPPTL +#include +#ifndef JSON_USE_CPPTL +#define JSON_USE_CPPTL 1 +#endif +#endif + +#ifdef JSON_IN_CPPTL +#define JSON_API CPPTL_API +#elif defined(JSON_DLL_BUILD) +#if defined(_MSC_VER) +#define JSON_API __declspec(dllexport) +#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING +#endif // if defined(_MSC_VER) +#elif defined(JSON_DLL) +#if defined(_MSC_VER) +#define JSON_API __declspec(dllimport) +#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING +#endif // if defined(_MSC_VER) +#endif // ifdef JSON_IN_CPPTL +#if !defined(JSON_API) +#define JSON_API +#endif + +// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for +// integer +// Storages, and 64 bits integer support is disabled. +// #define JSON_NO_INT64 1 + +#if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 +// Microsoft Visual Studio 6 only support conversion from __int64 to double +// (no conversion from unsigned __int64). +#define JSON_USE_INT64_DOUBLE_CONVERSION 1 +// Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255' +// characters in the debug information) +// All projects I've ever seen with VS6 were using this globally (not bothering +// with pragma push/pop). +#pragma warning(disable : 4786) +#endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6 + +#if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 +/// Indicates that the following function is deprecated. +#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) +#elif defined(__clang__) && defined(__has_feature) +#if __has_feature(attribute_deprecated_with_message) +#define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message))) +#endif +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) +#define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message))) +#elif defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) +#define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__)) +#endif + +#if !defined(JSONCPP_DEPRECATED) +#define JSONCPP_DEPRECATED(message) +#endif // if !defined(JSONCPP_DEPRECATED) + +namespace Json { +typedef int Int; +typedef unsigned int UInt; +#if defined(JSON_NO_INT64) +typedef int LargestInt; +typedef unsigned int LargestUInt; +#undef JSON_HAS_INT64 +#else // if defined(JSON_NO_INT64) +// For Microsoft Visual use specific types as long long is not supported +#if defined(_MSC_VER) // Microsoft Visual Studio +typedef __int64 Int64; +typedef unsigned __int64 UInt64; +#else // if defined(_MSC_VER) // Other platforms, use long long +typedef long long int Int64; +typedef unsigned long long int UInt64; +#endif // if defined(_MSC_VER) +typedef Int64 LargestInt; +typedef UInt64 LargestUInt; +#define JSON_HAS_INT64 +#endif // if defined(JSON_NO_INT64) +} // end namespace Json + +#endif // JSON_CONFIG_H_INCLUDED + +// ////////////////////////////////////////////////////////////////////// +// End of content of file: include/json/config.h +// ////////////////////////////////////////////////////////////////////// + + + + + + +// ////////////////////////////////////////////////////////////////////// +// Beginning of content of file: include/json/forwards.h +// ////////////////////////////////////////////////////////////////////// + +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef JSON_FORWARDS_H_INCLUDED +#define JSON_FORWARDS_H_INCLUDED + +#if !defined(JSON_IS_AMALGAMATION) +#include "config.h" +#endif // if !defined(JSON_IS_AMALGAMATION) + +namespace Json { + +// writer.h +class FastWriter; +class StyledWriter; + +// reader.h +class Reader; + +// features.h +class Features; + +// value.h +typedef unsigned int ArrayIndex; +class StaticString; +class Path; +class PathArgument; +class Value; +class ValueIteratorBase; +class ValueIterator; +class ValueConstIterator; + +} // namespace Json + +#endif // JSON_FORWARDS_H_INCLUDED + +// ////////////////////////////////////////////////////////////////////// +// End of content of file: include/json/forwards.h +// ////////////////////////////////////////////////////////////////////// + + + + + +#endif //ifndef JSON_FORWARD_AMALGATED_H_INCLUDED diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsoncpp/dist/json/json.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsoncpp/dist/json/json.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsoncpp/dist/json/json.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsoncpp/dist/json/json.h 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,2017 @@ +/// Json-cpp amalgated header (http://jsoncpp.sourceforge.net/). +/// It is intended to be used with #include "json/json.h" + +// ////////////////////////////////////////////////////////////////////// +// Beginning of content of file: LICENSE +// ////////////////////////////////////////////////////////////////////// + +/* +The JsonCpp library's source code, including accompanying documentation, +tests and demonstration applications, are licensed under the following +conditions... + +The author (Baptiste Lepilleur) explicitly disclaims copyright in all +jurisdictions which recognize such a disclaimer. In such jurisdictions, +this software is released into the Public Domain. + +In jurisdictions which do not recognize Public Domain property (e.g. Germany as of +2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is +released under the terms of the MIT License (see below). + +In jurisdictions which recognize Public Domain property, the user of this +software may choose to accept it either as 1) Public Domain, 2) under the +conditions of the MIT License (see below), or 3) under the terms of dual +Public Domain/MIT License conditions described here, as they choose. + +The MIT License is about as close to Public Domain as a license can get, and is +described in clear, concise terms at: + + http://en.wikipedia.org/wiki/MIT_License + +The full text of the MIT License follows: + +======================================================================== +Copyright (c) 2007-2010 Baptiste Lepilleur + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +======================================================================== +(END LICENSE TEXT) + +The MIT license is compatible with both the GPL and commercial +software, affording one all of the rights of Public Domain with the +minor nuisance of being required to keep the above copyright notice +and license text in the source code. Note also that by accepting the +Public Domain "license" you can re-license your copy using whatever +license you like. + +*/ + +// ////////////////////////////////////////////////////////////////////// +// End of content of file: LICENSE +// ////////////////////////////////////////////////////////////////////// + + + + + +#ifndef JSON_AMALGATED_H_INCLUDED +# define JSON_AMALGATED_H_INCLUDED +/// If defined, indicates that the source file is amalgated +/// to prevent private header inclusion. +#define JSON_IS_AMALGAMATION + +// ////////////////////////////////////////////////////////////////////// +// Beginning of content of file: include/json/version.h +// ////////////////////////////////////////////////////////////////////// + +// DO NOT EDIT. This file is generated by CMake from "version" +// and "version.h.in" files. +// Run CMake configure step to update it. +#ifndef JSON_VERSION_H_INCLUDED +# define JSON_VERSION_H_INCLUDED + +# define JSONCPP_VERSION_STRING "1.6.2" +# define JSONCPP_VERSION_MAJOR 1 +# define JSONCPP_VERSION_MINOR 6 +# define JSONCPP_VERSION_PATCH 2 +# define JSONCPP_VERSION_QUALIFIER +# define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8)) + +#endif // JSON_VERSION_H_INCLUDED + +// ////////////////////////////////////////////////////////////////////// +// End of content of file: include/json/version.h +// ////////////////////////////////////////////////////////////////////// + + + + + + +// ////////////////////////////////////////////////////////////////////// +// Beginning of content of file: include/json/config.h +// ////////////////////////////////////////////////////////////////////// + +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef JSON_CONFIG_H_INCLUDED +#define JSON_CONFIG_H_INCLUDED + +/// If defined, indicates that json library is embedded in CppTL library. +//# define JSON_IN_CPPTL 1 + +/// If defined, indicates that json may leverage CppTL library +//# define JSON_USE_CPPTL 1 +/// If defined, indicates that cpptl vector based map should be used instead of +/// std::map +/// as Value container. +//# define JSON_USE_CPPTL_SMALLMAP 1 + +// If non-zero, the library uses exceptions to report bad input instead of C +// assertion macros. The default is to use exceptions. +#ifndef JSON_USE_EXCEPTION +#define JSON_USE_EXCEPTION 1 +#endif + +/// If defined, indicates that the source file is amalgated +/// to prevent private header inclusion. +/// Remarks: it is automatically defined in the generated amalgated header. +// #define JSON_IS_AMALGAMATION + +#ifdef JSON_IN_CPPTL +#include +#ifndef JSON_USE_CPPTL +#define JSON_USE_CPPTL 1 +#endif +#endif + +#ifdef JSON_IN_CPPTL +#define JSON_API CPPTL_API +#elif defined(JSON_DLL_BUILD) +#if defined(_MSC_VER) +#define JSON_API __declspec(dllexport) +#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING +#endif // if defined(_MSC_VER) +#elif defined(JSON_DLL) +#if defined(_MSC_VER) +#define JSON_API __declspec(dllimport) +#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING +#endif // if defined(_MSC_VER) +#endif // ifdef JSON_IN_CPPTL +#if !defined(JSON_API) +#define JSON_API +#endif + +// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for +// integer +// Storages, and 64 bits integer support is disabled. +// #define JSON_NO_INT64 1 + +#if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 +// Microsoft Visual Studio 6 only support conversion from __int64 to double +// (no conversion from unsigned __int64). +#define JSON_USE_INT64_DOUBLE_CONVERSION 1 +// Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255' +// characters in the debug information) +// All projects I've ever seen with VS6 were using this globally (not bothering +// with pragma push/pop). +#pragma warning(disable : 4786) +#endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6 + +#if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 +/// Indicates that the following function is deprecated. +#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) +#elif defined(__clang__) && defined(__has_feature) +#if __has_feature(attribute_deprecated_with_message) +#define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message))) +#endif +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) +#define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message))) +#elif defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) +#define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__)) +#endif + +#if !defined(JSONCPP_DEPRECATED) +#define JSONCPP_DEPRECATED(message) +#endif // if !defined(JSONCPP_DEPRECATED) + +namespace Json { +typedef int Int; +typedef unsigned int UInt; +#if defined(JSON_NO_INT64) +typedef int LargestInt; +typedef unsigned int LargestUInt; +#undef JSON_HAS_INT64 +#else // if defined(JSON_NO_INT64) +// For Microsoft Visual use specific types as long long is not supported +#if defined(_MSC_VER) // Microsoft Visual Studio +typedef __int64 Int64; +typedef unsigned __int64 UInt64; +#else // if defined(_MSC_VER) // Other platforms, use long long +typedef long long int Int64; +typedef unsigned long long int UInt64; +#endif // if defined(_MSC_VER) +typedef Int64 LargestInt; +typedef UInt64 LargestUInt; +#define JSON_HAS_INT64 +#endif // if defined(JSON_NO_INT64) +} // end namespace Json + +#endif // JSON_CONFIG_H_INCLUDED + +// ////////////////////////////////////////////////////////////////////// +// End of content of file: include/json/config.h +// ////////////////////////////////////////////////////////////////////// + + + + + + +// ////////////////////////////////////////////////////////////////////// +// Beginning of content of file: include/json/forwards.h +// ////////////////////////////////////////////////////////////////////// + +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef JSON_FORWARDS_H_INCLUDED +#define JSON_FORWARDS_H_INCLUDED + +#if !defined(JSON_IS_AMALGAMATION) +#include "config.h" +#endif // if !defined(JSON_IS_AMALGAMATION) + +namespace Json { + +// writer.h +class FastWriter; +class StyledWriter; + +// reader.h +class Reader; + +// features.h +class Features; + +// value.h +typedef unsigned int ArrayIndex; +class StaticString; +class Path; +class PathArgument; +class Value; +class ValueIteratorBase; +class ValueIterator; +class ValueConstIterator; + +} // namespace Json + +#endif // JSON_FORWARDS_H_INCLUDED + +// ////////////////////////////////////////////////////////////////////// +// End of content of file: include/json/forwards.h +// ////////////////////////////////////////////////////////////////////// + + + + + + +// ////////////////////////////////////////////////////////////////////// +// Beginning of content of file: include/json/features.h +// ////////////////////////////////////////////////////////////////////// + +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef CPPTL_JSON_FEATURES_H_INCLUDED +#define CPPTL_JSON_FEATURES_H_INCLUDED + +#if !defined(JSON_IS_AMALGAMATION) +#include "forwards.h" +#endif // if !defined(JSON_IS_AMALGAMATION) + +namespace Json { + +/** \brief Configuration passed to reader and writer. + * This configuration object can be used to force the Reader or Writer + * to behave in a standard conforming way. + */ +class JSON_API Features { +public: + /** \brief A configuration that allows all features and assumes all strings + * are UTF-8. + * - C & C++ comments are allowed + * - Root object can be any JSON value + * - Assumes Value strings are encoded in UTF-8 + */ + static Features all(); + + /** \brief A configuration that is strictly compatible with the JSON + * specification. + * - Comments are forbidden. + * - Root object must be either an array or an object value. + * - Assumes Value strings are encoded in UTF-8 + */ + static Features strictMode(); + + /** \brief Initialize the configuration like JsonConfig::allFeatures; + */ + Features(); + + /// \c true if comments are allowed. Default: \c true. + bool allowComments_; + + /// \c true if root must be either an array or an object value. Default: \c + /// false. + bool strictRoot_; + + /// \c true if dropped null placeholders are allowed. Default: \c false. + bool allowDroppedNullPlaceholders_; + + /// \c true if numeric object key are allowed. Default: \c false. + bool allowNumericKeys_; +}; + +} // namespace Json + +#endif // CPPTL_JSON_FEATURES_H_INCLUDED + +// ////////////////////////////////////////////////////////////////////// +// End of content of file: include/json/features.h +// ////////////////////////////////////////////////////////////////////// + + + + + + +// ////////////////////////////////////////////////////////////////////// +// Beginning of content of file: include/json/value.h +// ////////////////////////////////////////////////////////////////////// + +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef CPPTL_JSON_H_INCLUDED +#define CPPTL_JSON_H_INCLUDED + +#if !defined(JSON_IS_AMALGAMATION) +#include "forwards.h" +#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include + +#ifndef JSON_USE_CPPTL_SMALLMAP +#include +#else +#include +#endif +#ifdef JSON_USE_CPPTL +#include +#endif + +// Disable warning C4251: : needs to have dll-interface to +// be used by... +#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) +#pragma warning(push) +#pragma warning(disable : 4251) +#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) + +/** \brief JSON (JavaScript Object Notation). + */ +namespace Json { + +/** Base class for all exceptions we throw. + * + * We use nothing but these internally. Of course, STL can throw others. + */ +class JSON_API Exception; +/** Exceptions which the user cannot easily avoid. + * + * E.g. out-of-memory (when we use malloc), stack-overflow, malicious input + * + * \remark derived from Json::Exception + */ +class JSON_API RuntimeError; +/** Exceptions thrown by JSON_ASSERT/JSON_FAIL macros. + * + * These are precondition-violations (user bugs) and internal errors (our bugs). + * + * \remark derived from Json::Exception + */ +class JSON_API LogicError; + +/// used internally +void throwRuntimeError(std::string const& msg); +/// used internally +void throwLogicError(std::string const& msg); + +/** \brief Type of the value held by a Value object. + */ +enum ValueType { + nullValue = 0, ///< 'null' value + intValue, ///< signed integer value + uintValue, ///< unsigned integer value + realValue, ///< double value + stringValue, ///< UTF-8 string value + booleanValue, ///< bool value + arrayValue, ///< array value (ordered list) + objectValue ///< object value (collection of name/value pairs). +}; + +enum CommentPlacement { + commentBefore = 0, ///< a comment placed on the line before a value + commentAfterOnSameLine, ///< a comment just after a value on the same line + commentAfter, ///< a comment on the line after a value (only make sense for + /// root value) + numberOfCommentPlacement +}; + +//# ifdef JSON_USE_CPPTL +// typedef CppTL::AnyEnumerator EnumMemberNames; +// typedef CppTL::AnyEnumerator EnumValues; +//# endif + +/** \brief Lightweight wrapper to tag static string. + * + * Value constructor and objectValue member assignement takes advantage of the + * StaticString and avoid the cost of string duplication when storing the + * string or the member name. + * + * Example of usage: + * \code + * Json::Value aValue( StaticString("some text") ); + * Json::Value object; + * static const StaticString code("code"); + * object[code] = 1234; + * \endcode + */ +class JSON_API StaticString { +public: + explicit StaticString(const char* czstring) : c_str_(czstring) {} + + operator const char*() const { return c_str_; } + + const char* c_str() const { return c_str_; } + +private: + const char* c_str_; +}; + +/** \brief Represents a JSON value. + * + * This class is a discriminated union wrapper that can represents a: + * - signed integer [range: Value::minInt - Value::maxInt] + * - unsigned integer (range: 0 - Value::maxUInt) + * - double + * - UTF-8 string + * - boolean + * - 'null' + * - an ordered list of Value + * - collection of name/value pairs (javascript object) + * + * The type of the held value is represented by a #ValueType and + * can be obtained using type(). + * + * Values of an #objectValue or #arrayValue can be accessed using operator[]() + * methods. + * Non-const methods will automatically create the a #nullValue element + * if it does not exist. + * The sequence of an #arrayValue will be automatically resized and initialized + * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue. + * + * The get() methods can be used to obtain default value in the case the + * required element does not exist. + * + * It is possible to iterate over the list of a #objectValue values using + * the getMemberNames() method. + * + * \note #Value string-length fit in size_t, but keys must be < 2^30. + * (The reason is an implementation detail.) A #CharReader will raise an + * exception if a bound is exceeded to avoid security holes in your app, + * but the Value API does *not* check bounds. That is the responsibility + * of the caller. + */ +class JSON_API Value { + friend class ValueIteratorBase; +public: + typedef std::vector Members; + typedef ValueIterator iterator; + typedef ValueConstIterator const_iterator; + typedef Json::UInt UInt; + typedef Json::Int Int; +#if defined(JSON_HAS_INT64) + typedef Json::UInt64 UInt64; + typedef Json::Int64 Int64; +#endif // defined(JSON_HAS_INT64) + typedef Json::LargestInt LargestInt; + typedef Json::LargestUInt LargestUInt; + typedef Json::ArrayIndex ArrayIndex; + + static const Value& null; ///< We regret this reference to a global instance; prefer the simpler Value(). + static const Value& nullRef; ///< just a kludge for binary-compatibility; same as null + /// Minimum signed integer value that can be stored in a Json::Value. + static const LargestInt minLargestInt; + /// Maximum signed integer value that can be stored in a Json::Value. + static const LargestInt maxLargestInt; + /// Maximum unsigned integer value that can be stored in a Json::Value. + static const LargestUInt maxLargestUInt; + + /// Minimum signed int value that can be stored in a Json::Value. + static const Int minInt; + /// Maximum signed int value that can be stored in a Json::Value. + static const Int maxInt; + /// Maximum unsigned int value that can be stored in a Json::Value. + static const UInt maxUInt; + +#if defined(JSON_HAS_INT64) + /// Minimum signed 64 bits int value that can be stored in a Json::Value. + static const Int64 minInt64; + /// Maximum signed 64 bits int value that can be stored in a Json::Value. + static const Int64 maxInt64; + /// Maximum unsigned 64 bits int value that can be stored in a Json::Value. + static const UInt64 maxUInt64; +#endif // defined(JSON_HAS_INT64) + +private: +#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + class CZString { + public: + enum DuplicationPolicy { + noDuplication = 0, + duplicate, + duplicateOnCopy + }; + CZString(ArrayIndex index); + CZString(char const* str, unsigned length, DuplicationPolicy allocate); + CZString(CZString const& other); + ~CZString(); + CZString& operator=(CZString other); + bool operator<(CZString const& other) const; + bool operator==(CZString const& other) const; + ArrayIndex index() const; + //const char* c_str() const; ///< \deprecated + char const* data() const; + unsigned length() const; + bool isStaticString() const; + + private: + void swap(CZString& other); + + struct StringStorage { + unsigned policy_: 2; + unsigned length_: 30; // 1GB max + }; + + char const* cstr_; // actually, a prefixed string, unless policy is noDup + union { + ArrayIndex index_; + StringStorage storage_; + }; + }; + +public: +#ifndef JSON_USE_CPPTL_SMALLMAP + typedef std::map ObjectValues; +#else + typedef CppTL::SmallMap ObjectValues; +#endif // ifndef JSON_USE_CPPTL_SMALLMAP +#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + +public: + /** \brief Create a default Value of the given type. + + This is a very useful constructor. + To create an empty array, pass arrayValue. + To create an empty object, pass objectValue. + Another Value can then be set to this one by assignment. +This is useful since clear() and resize() will not alter types. + + Examples: +\code +Json::Value null_value; // null +Json::Value arr_value(Json::arrayValue); // [] +Json::Value obj_value(Json::objectValue); // {} +\endcode + */ + Value(ValueType type = nullValue); + Value(Int value); + Value(UInt value); +#if defined(JSON_HAS_INT64) + Value(Int64 value); + Value(UInt64 value); +#endif // if defined(JSON_HAS_INT64) + Value(double value); + Value(const char* value); ///< Copy til first 0. (NULL causes to seg-fault.) + Value(const char* beginValue, const char* endValue); ///< Copy all, incl zeroes. + /** \brief Constructs a value from a static string. + + * Like other value string constructor but do not duplicate the string for + * internal storage. The given string must remain alive after the call to this + * constructor. + * \note This works only for null-terminated strings. (We cannot change the + * size of this class, so we have nowhere to store the length, + * which might be computed later for various operations.) + * + * Example of usage: + * \code + * static StaticString foo("some text"); + * Json::Value aValue(foo); + * \endcode + */ + Value(const StaticString& value); + Value(const std::string& value); ///< Copy data() til size(). Embedded zeroes too. +#ifdef JSON_USE_CPPTL + Value(const CppTL::ConstString& value); +#endif + Value(bool value); + /// Deep copy. + Value(const Value& other); + ~Value(); + + /// Deep copy, then swap(other). + /// \note Over-write existing comments. To preserve comments, use #swapPayload(). + Value& operator=(Value other); + /// Swap everything. + void swap(Value& other); + /// Swap values but leave comments and source offsets in place. + void swapPayload(Value& other); + + ValueType type() const; + + /// Compare payload only, not comments etc. + bool operator<(const Value& other) const; + bool operator<=(const Value& other) const; + bool operator>=(const Value& other) const; + bool operator>(const Value& other) const; + bool operator==(const Value& other) const; + bool operator!=(const Value& other) const; + int compare(const Value& other) const; + + const char* asCString() const; ///< Embedded zeroes could cause you trouble! + std::string asString() const; ///< Embedded zeroes are possible. + /** Get raw char* of string-value. + * \return false if !string. (Seg-fault if str or end are NULL.) + */ + bool getString( + char const** str, char const** end) const; +#ifdef JSON_USE_CPPTL + CppTL::ConstString asConstString() const; +#endif + Int asInt() const; + UInt asUInt() const; +#if defined(JSON_HAS_INT64) + Int64 asInt64() const; + UInt64 asUInt64() const; +#endif // if defined(JSON_HAS_INT64) + LargestInt asLargestInt() const; + LargestUInt asLargestUInt() const; + float asFloat() const; + double asDouble() const; + bool asBool() const; + + bool isNull() const; + bool isBool() const; + bool isInt() const; + bool isInt64() const; + bool isUInt() const; + bool isUInt64() const; + bool isIntegral() const; + bool isDouble() const; + bool isNumeric() const; + bool isString() const; + bool isArray() const; + bool isObject() const; + + bool isConvertibleTo(ValueType other) const; + + /// Number of values in array or object + ArrayIndex size() const; + + /// \brief Return true if empty array, empty object, or null; + /// otherwise, false. + bool empty() const; + + /// Return isNull() + bool operator!() const; + + /// Remove all object members and array elements. + /// \pre type() is arrayValue, objectValue, or nullValue + /// \post type() is unchanged + void clear(); + + /// Resize the array to size elements. + /// New elements are initialized to null. + /// May only be called on nullValue or arrayValue. + /// \pre type() is arrayValue or nullValue + /// \post type() is arrayValue + void resize(ArrayIndex size); + + /// Access an array element (zero based index ). + /// If the array contains less than index element, then null value are + /// inserted + /// in the array so that its size is index+1. + /// (You may need to say 'value[0u]' to get your compiler to distinguish + /// this from the operator[] which takes a string.) + Value& operator[](ArrayIndex index); + + /// Access an array element (zero based index ). + /// If the array contains less than index element, then null value are + /// inserted + /// in the array so that its size is index+1. + /// (You may need to say 'value[0u]' to get your compiler to distinguish + /// this from the operator[] which takes a string.) + Value& operator[](int index); + + /// Access an array element (zero based index ) + /// (You may need to say 'value[0u]' to get your compiler to distinguish + /// this from the operator[] which takes a string.) + const Value& operator[](ArrayIndex index) const; + + /// Access an array element (zero based index ) + /// (You may need to say 'value[0u]' to get your compiler to distinguish + /// this from the operator[] which takes a string.) + const Value& operator[](int index) const; + + /// If the array contains at least index+1 elements, returns the element + /// value, + /// otherwise returns defaultValue. + Value get(ArrayIndex index, const Value& defaultValue) const; + /// Return true if index < size(). + bool isValidIndex(ArrayIndex index) const; + /// \brief Append value to array at the end. + /// + /// Equivalent to jsonvalue[jsonvalue.size()] = value; + Value& append(const Value& value); + + /// Access an object value by name, create a null member if it does not exist. + /// \note Because of our implementation, keys are limited to 2^30 -1 chars. + /// Exceeding that will cause an exception. + Value& operator[](const char* key); + /// Access an object value by name, returns null if there is no member with + /// that name. + const Value& operator[](const char* key) const; + /// Access an object value by name, create a null member if it does not exist. + /// \param key may contain embedded nulls. + Value& operator[](const std::string& key); + /// Access an object value by name, returns null if there is no member with + /// that name. + /// \param key may contain embedded nulls. + const Value& operator[](const std::string& key) const; + /** \brief Access an object value by name, create a null member if it does not + exist. + + * If the object has no entry for that name, then the member name used to store + * the new entry is not duplicated. + * Example of use: + * \code + * Json::Value object; + * static const StaticString code("code"); + * object[code] = 1234; + * \endcode + */ + Value& operator[](const StaticString& key); +#ifdef JSON_USE_CPPTL + /// Access an object value by name, create a null member if it does not exist. + Value& operator[](const CppTL::ConstString& key); + /// Access an object value by name, returns null if there is no member with + /// that name. + const Value& operator[](const CppTL::ConstString& key) const; +#endif + /// Return the member named key if it exist, defaultValue otherwise. + /// \note deep copy + Value get(const char* key, const Value& defaultValue) const; + /// Return the member named key if it exist, defaultValue otherwise. + /// \note deep copy + /// \param key may contain embedded nulls. + Value get(const char* key, const char* end, const Value& defaultValue) const; + /// Return the member named key if it exist, defaultValue otherwise. + /// \note deep copy + /// \param key may contain embedded nulls. + Value get(const std::string& key, const Value& defaultValue) const; +#ifdef JSON_USE_CPPTL + /// Return the member named key if it exist, defaultValue otherwise. + /// \note deep copy + Value get(const CppTL::ConstString& key, const Value& defaultValue) const; +#endif + /// Most general and efficient version of isMember()const, get()const, + /// and operator[]const + /// \note As stated elsewhere, behavior is undefined if (end-key) >= 2^30 + Value const* find(char const* key, char const* end) const; + /// Most general and efficient version of object-mutators. + /// \note As stated elsewhere, behavior is undefined if (end-key) >= 2^30 + /// \return non-zero, but JSON_ASSERT if this is neither object nor nullValue. + Value const* demand(char const* key, char const* end); + /// \brief Remove and return the named member. + /// + /// Do nothing if it did not exist. + /// \return the removed Value, or null. + /// \pre type() is objectValue or nullValue + /// \post type() is unchanged + /// \deprecated + Value removeMember(const char* key); + /// Same as removeMember(const char*) + /// \param key may contain embedded nulls. + /// \deprecated + Value removeMember(const std::string& key); + /// Same as removeMember(const char* key, const char* end, Value* removed), + /// but 'key' is null-terminated. + bool removeMember(const char* key, Value* removed); + /** \brief Remove the named map member. + + Update 'removed' iff removed. + \param key may contain embedded nulls. + \return true iff removed (no exceptions) + */ + bool removeMember(std::string const& key, Value* removed); + /// Same as removeMember(std::string const& key, Value* removed) + bool removeMember(const char* key, const char* end, Value* removed); + /** \brief Remove the indexed array element. + + O(n) expensive operations. + Update 'removed' iff removed. + \return true iff removed (no exceptions) + */ + bool removeIndex(ArrayIndex i, Value* removed); + + /// Return true if the object has a member named key. + /// \note 'key' must be null-terminated. + bool isMember(const char* key) const; + /// Return true if the object has a member named key. + /// \param key may contain embedded nulls. + bool isMember(const std::string& key) const; + /// Same as isMember(std::string const& key)const + bool isMember(const char* key, const char* end) const; +#ifdef JSON_USE_CPPTL + /// Return true if the object has a member named key. + bool isMember(const CppTL::ConstString& key) const; +#endif + + /// \brief Return a list of the member names. + /// + /// If null, return an empty list. + /// \pre type() is objectValue or nullValue + /// \post if type() was nullValue, it remains nullValue + Members getMemberNames() const; + + //# ifdef JSON_USE_CPPTL + // EnumMemberNames enumMemberNames() const; + // EnumValues enumValues() const; + //# endif + + /// \deprecated Always pass len. + JSONCPP_DEPRECATED("Use setComment(std::string const&) instead.") + void setComment(const char* comment, CommentPlacement placement); + /// Comments must be //... or /* ... */ + void setComment(const char* comment, size_t len, CommentPlacement placement); + /// Comments must be //... or /* ... */ + void setComment(const std::string& comment, CommentPlacement placement); + bool hasComment(CommentPlacement placement) const; + /// Include delimiters and embedded newlines. + std::string getComment(CommentPlacement placement) const; + + std::string toStyledString() const; + + const_iterator begin() const; + const_iterator end() const; + + iterator begin(); + iterator end(); + + // Accessors for the [start, limit) range of bytes within the JSON text from + // which this value was parsed, if any. + void setOffsetStart(size_t start); + void setOffsetLimit(size_t limit); + size_t getOffsetStart() const; + size_t getOffsetLimit() const; + +private: + void initBasic(ValueType type, bool allocated = false); + + Value& resolveReference(const char* key); + Value& resolveReference(const char* key, const char* end); + + struct CommentInfo { + CommentInfo(); + ~CommentInfo(); + + void setComment(const char* text, size_t len); + + char* comment_; + }; + + // struct MemberNamesTransform + //{ + // typedef const char *result_type; + // const char *operator()( const CZString &name ) const + // { + // return name.c_str(); + // } + //}; + + union ValueHolder { + LargestInt int_; + LargestUInt uint_; + double real_; + bool bool_; + char* string_; // actually ptr to unsigned, followed by str, unless !allocated_ + ObjectValues* map_; + } value_; + ValueType type_ : 8; + unsigned int allocated_ : 1; // Notes: if declared as bool, bitfield is useless. + // If not allocated_, string_ must be null-terminated. + CommentInfo* comments_; + + // [start, limit) byte offsets in the source JSON text from which this Value + // was extracted. + size_t start_; + size_t limit_; +}; + +/** \brief Experimental and untested: represents an element of the "path" to + * access a node. + */ +class JSON_API PathArgument { +public: + friend class Path; + + PathArgument(); + PathArgument(ArrayIndex index); + PathArgument(const char* key); + PathArgument(const std::string& key); + +private: + enum Kind { + kindNone = 0, + kindIndex, + kindKey + }; + std::string key_; + ArrayIndex index_; + Kind kind_; +}; + +/** \brief Experimental and untested: represents a "path" to access a node. + * + * Syntax: + * - "." => root node + * - ".[n]" => elements at index 'n' of root node (an array value) + * - ".name" => member named 'name' of root node (an object value) + * - ".name1.name2.name3" + * - ".[0][1][2].name1[3]" + * - ".%" => member name is provided as parameter + * - ".[%]" => index is provied as parameter + */ +class JSON_API Path { +public: + Path(const std::string& path, + const PathArgument& a1 = PathArgument(), + const PathArgument& a2 = PathArgument(), + const PathArgument& a3 = PathArgument(), + const PathArgument& a4 = PathArgument(), + const PathArgument& a5 = PathArgument()); + + const Value& resolve(const Value& root) const; + Value resolve(const Value& root, const Value& defaultValue) const; + /// Creates the "path" to access the specified node and returns a reference on + /// the node. + Value& make(Value& root) const; + +private: + typedef std::vector InArgs; + typedef std::vector Args; + + void makePath(const std::string& path, const InArgs& in); + void addPathInArg(const std::string& path, + const InArgs& in, + InArgs::const_iterator& itInArg, + PathArgument::Kind kind); + void invalidPath(const std::string& path, int location); + + Args args_; +}; + +/** \brief base class for Value iterators. + * + */ +class JSON_API ValueIteratorBase { +public: + typedef std::bidirectional_iterator_tag iterator_category; + typedef unsigned int size_t; + typedef int difference_type; + typedef ValueIteratorBase SelfType; + + bool operator==(const SelfType& other) const { return isEqual(other); } + + bool operator!=(const SelfType& other) const { return !isEqual(other); } + + difference_type operator-(const SelfType& other) const { + return other.computeDistance(*this); + } + + /// Return either the index or the member name of the referenced value as a + /// Value. + Value key() const; + + /// Return the index of the referenced Value, or -1 if it is not an arrayValue. + UInt index() const; + + /// Return the member name of the referenced Value, or "" if it is not an + /// objectValue. + /// \note Avoid `c_str()` on result, as embedded zeroes are possible. + std::string name() const; + + /// Return the member name of the referenced Value. "" if it is not an + /// objectValue. + /// \deprecated This cannot be used for UTF-8 strings, since there can be embedded nulls. + JSONCPP_DEPRECATED("Use `key = name();` instead.") + char const* memberName() const; + /// Return the member name of the referenced Value, or NULL if it is not an + /// objectValue. + /// \note Better version than memberName(). Allows embedded nulls. + char const* memberName(char const** end) const; + +protected: + Value& deref() const; + + void increment(); + + void decrement(); + + difference_type computeDistance(const SelfType& other) const; + + bool isEqual(const SelfType& other) const; + + void copy(const SelfType& other); + +private: + Value::ObjectValues::iterator current_; + // Indicates that iterator is for a null value. + bool isNull_; + +public: + // For some reason, BORLAND needs these at the end, rather + // than earlier. No idea why. + ValueIteratorBase(); + explicit ValueIteratorBase(const Value::ObjectValues::iterator& current); +}; + +/** \brief const iterator for object and array value. + * + */ +class JSON_API ValueConstIterator : public ValueIteratorBase { + friend class Value; + +public: + typedef const Value value_type; + //typedef unsigned int size_t; + //typedef int difference_type; + typedef const Value& reference; + typedef const Value* pointer; + typedef ValueConstIterator SelfType; + + ValueConstIterator(); + +private: +/*! \internal Use by Value to create an iterator. + */ + explicit ValueConstIterator(const Value::ObjectValues::iterator& current); +public: + SelfType& operator=(const ValueIteratorBase& other); + + SelfType operator++(int) { + SelfType temp(*this); + ++*this; + return temp; + } + + SelfType operator--(int) { + SelfType temp(*this); + --*this; + return temp; + } + + SelfType& operator--() { + decrement(); + return *this; + } + + SelfType& operator++() { + increment(); + return *this; + } + + reference operator*() const { return deref(); } + + pointer operator->() const { return &deref(); } +}; + +/** \brief Iterator for object and array value. + */ +class JSON_API ValueIterator : public ValueIteratorBase { + friend class Value; + +public: + typedef Value value_type; + typedef unsigned int size_t; + typedef int difference_type; + typedef Value& reference; + typedef Value* pointer; + typedef ValueIterator SelfType; + + ValueIterator(); + ValueIterator(const ValueConstIterator& other); + ValueIterator(const ValueIterator& other); + +private: +/*! \internal Use by Value to create an iterator. + */ + explicit ValueIterator(const Value::ObjectValues::iterator& current); +public: + SelfType& operator=(const SelfType& other); + + SelfType operator++(int) { + SelfType temp(*this); + ++*this; + return temp; + } + + SelfType operator--(int) { + SelfType temp(*this); + --*this; + return temp; + } + + SelfType& operator--() { + decrement(); + return *this; + } + + SelfType& operator++() { + increment(); + return *this; + } + + reference operator*() const { return deref(); } + + pointer operator->() const { return &deref(); } +}; + +} // namespace Json + + +namespace std { +/// Specialize std::swap() for Json::Value. +template<> +inline void swap(Json::Value& a, Json::Value& b) { a.swap(b); } +} + + +#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) +#pragma warning(pop) +#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) + +#endif // CPPTL_JSON_H_INCLUDED + +// ////////////////////////////////////////////////////////////////////// +// End of content of file: include/json/value.h +// ////////////////////////////////////////////////////////////////////// + + + + + + +// ////////////////////////////////////////////////////////////////////// +// Beginning of content of file: include/json/reader.h +// ////////////////////////////////////////////////////////////////////// + +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef CPPTL_JSON_READER_H_INCLUDED +#define CPPTL_JSON_READER_H_INCLUDED + +#if !defined(JSON_IS_AMALGAMATION) +#include "features.h" +#include "value.h" +#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include +#include +#include + +// Disable warning C4251: : needs to have dll-interface to +// be used by... +#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) +#pragma warning(push) +#pragma warning(disable : 4251) +#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) + +namespace Json { + +/** \brief Unserialize a JSON document into a + *Value. + * + * \deprecated Use CharReader and CharReaderBuilder. + */ +class JSON_API Reader { +public: + typedef char Char; + typedef const Char* Location; + + /** \brief An error tagged with where in the JSON text it was encountered. + * + * The offsets give the [start, limit) range of bytes within the text. Note + * that this is bytes, not codepoints. + * + */ + struct StructuredError { + size_t offset_start; + size_t offset_limit; + std::string message; + }; + + /** \brief Constructs a Reader allowing all features + * for parsing. + */ + Reader(); + + /** \brief Constructs a Reader allowing the specified feature set + * for parsing. + */ + Reader(const Features& features); + + /** \brief Read a Value from a JSON + * document. + * \param document UTF-8 encoded string containing the document to read. + * \param root [out] Contains the root value of the document if it was + * successfully parsed. + * \param collectComments \c true to collect comment and allow writing them + * back during + * serialization, \c false to discard comments. + * This parameter is ignored if + * Features::allowComments_ + * is \c false. + * \return \c true if the document was successfully parsed, \c false if an + * error occurred. + */ + bool + parse(const std::string& document, Value& root, bool collectComments = true); + + /** \brief Read a Value from a JSON + document. + * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the + document to read. + * \param endDoc Pointer on the end of the UTF-8 encoded string of the + document to read. + * Must be >= beginDoc. + * \param root [out] Contains the root value of the document if it was + * successfully parsed. + * \param collectComments \c true to collect comment and allow writing them + back during + * serialization, \c false to discard comments. + * This parameter is ignored if + Features::allowComments_ + * is \c false. + * \return \c true if the document was successfully parsed, \c false if an + error occurred. + */ + bool parse(const char* beginDoc, + const char* endDoc, + Value& root, + bool collectComments = true); + + /// \brief Parse from input stream. + /// \see Json::operator>>(std::istream&, Json::Value&). + bool parse(std::istream& is, Value& root, bool collectComments = true); + + /** \brief Returns a user friendly string that list errors in the parsed + * document. + * \return Formatted error message with the list of errors with their location + * in + * the parsed document. An empty string is returned if no error + * occurred + * during parsing. + * \deprecated Use getFormattedErrorMessages() instead (typo fix). + */ + JSONCPP_DEPRECATED("Use getFormattedErrorMessages() instead.") + std::string getFormatedErrorMessages() const; + + /** \brief Returns a user friendly string that list errors in the parsed + * document. + * \return Formatted error message with the list of errors with their location + * in + * the parsed document. An empty string is returned if no error + * occurred + * during parsing. + */ + std::string getFormattedErrorMessages() const; + + /** \brief Returns a vector of structured erros encounted while parsing. + * \return A (possibly empty) vector of StructuredError objects. Currently + * only one error can be returned, but the caller should tolerate + * multiple + * errors. This can occur if the parser recovers from a non-fatal + * parse error and then encounters additional errors. + */ + std::vector getStructuredErrors() const; + + /** \brief Add a semantic error message. + * \param value JSON Value location associated with the error + * \param message The error message. + * \return \c true if the error was successfully added, \c false if the + * Value offset exceeds the document size. + */ + bool pushError(const Value& value, const std::string& message); + + /** \brief Add a semantic error message with extra context. + * \param value JSON Value location associated with the error + * \param message The error message. + * \param extra Additional JSON Value location to contextualize the error + * \return \c true if the error was successfully added, \c false if either + * Value offset exceeds the document size. + */ + bool pushError(const Value& value, const std::string& message, const Value& extra); + + /** \brief Return whether there are any errors. + * \return \c true if there are no errors to report \c false if + * errors have occurred. + */ + bool good() const; + +private: + enum TokenType { + tokenEndOfStream = 0, + tokenObjectBegin, + tokenObjectEnd, + tokenArrayBegin, + tokenArrayEnd, + tokenString, + tokenNumber, + tokenTrue, + tokenFalse, + tokenNull, + tokenArraySeparator, + tokenMemberSeparator, + tokenComment, + tokenError + }; + + class Token { + public: + TokenType type_; + Location start_; + Location end_; + }; + + class ErrorInfo { + public: + Token token_; + std::string message_; + Location extra_; + }; + + typedef std::deque Errors; + + bool readToken(Token& token); + void skipSpaces(); + bool match(Location pattern, int patternLength); + bool readComment(); + bool readCStyleComment(); + bool readCppStyleComment(); + bool readString(); + void readNumber(); + bool readValue(); + bool readObject(Token& token); + bool readArray(Token& token); + bool decodeNumber(Token& token); + bool decodeNumber(Token& token, Value& decoded); + bool decodeString(Token& token); + bool decodeString(Token& token, std::string& decoded); + bool decodeDouble(Token& token); + bool decodeDouble(Token& token, Value& decoded); + bool decodeUnicodeCodePoint(Token& token, + Location& current, + Location end, + unsigned int& unicode); + bool decodeUnicodeEscapeSequence(Token& token, + Location& current, + Location end, + unsigned int& unicode); + bool addError(const std::string& message, Token& token, Location extra = 0); + bool recoverFromError(TokenType skipUntilToken); + bool addErrorAndRecover(const std::string& message, + Token& token, + TokenType skipUntilToken); + void skipUntilSpace(); + Value& currentValue(); + Char getNextChar(); + void + getLocationLineAndColumn(Location location, int& line, int& column) const; + std::string getLocationLineAndColumn(Location location) const; + void addComment(Location begin, Location end, CommentPlacement placement); + void skipCommentTokens(Token& token); + + typedef std::stack Nodes; + Nodes nodes_; + Errors errors_; + std::string document_; + Location begin_; + Location end_; + Location current_; + Location lastValueEnd_; + Value* lastValue_; + std::string commentsBefore_; + Features features_; + bool collectComments_; +}; // Reader + +/** Interface for reading JSON from a char array. + */ +class JSON_API CharReader { +public: + virtual ~CharReader() {} + /** \brief Read a Value from a JSON + document. + * The document must be a UTF-8 encoded string containing the document to read. + * + * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the + document to read. + * \param endDoc Pointer on the end of the UTF-8 encoded string of the + document to read. + * Must be >= beginDoc. + * \param root [out] Contains the root value of the document if it was + * successfully parsed. + * \param errs [out] Formatted error messages (if not NULL) + * a user friendly string that lists errors in the parsed + * document. + * \return \c true if the document was successfully parsed, \c false if an + error occurred. + */ + virtual bool parse( + char const* beginDoc, char const* endDoc, + Value* root, std::string* errs) = 0; + + class Factory { + public: + virtual ~Factory() {} + /** \brief Allocate a CharReader via operator new(). + * \throw std::exception if something goes wrong (e.g. invalid settings) + */ + virtual CharReader* newCharReader() const = 0; + }; // Factory +}; // CharReader + +/** \brief Build a CharReader implementation. + +Usage: +\code + using namespace Json; + CharReaderBuilder builder; + builder["collectComments"] = false; + Value value; + std::string errs; + bool ok = parseFromStream(builder, std::cin, &value, &errs); +\endcode +*/ +class JSON_API CharReaderBuilder : public CharReader::Factory { +public: + // Note: We use a Json::Value so that we can add data-members to this class + // without a major version bump. + /** Configuration of this builder. + These are case-sensitive. + Available settings (case-sensitive): + - `"collectComments": false or true` + - true to collect comment and allow writing them + back during serialization, false to discard comments. + This parameter is ignored if allowComments is false. + - `"allowComments": false or true` + - true if comments are allowed. + - `"strictRoot": false or true` + - true if root must be either an array or an object value + - `"allowDroppedNullPlaceholders": false or true` + - true if dropped null placeholders are allowed. (See StreamWriterBuilder.) + - `"allowNumericKeys": false or true` + - true if numeric object keys are allowed. + - `"allowSingleQuotes": false or true` + - true if '' are allowed for strings (both keys and values) + - `"stackLimit": integer` + - Exceeding stackLimit (recursive depth of `readValue()`) will + cause an exception. + - This is a security issue (seg-faults caused by deeply nested JSON), + so the default is low. + - `"failIfExtra": false or true` + - If true, `parse()` returns false when extra non-whitespace trails + the JSON value in the input string. + - `"rejectDupKeys": false or true` + - If true, `parse()` returns false when a key is duplicated within an object. + + You can examine 'settings_` yourself + to see the defaults. You can also write and read them just like any + JSON Value. + \sa setDefaults() + */ + Json::Value settings_; + + CharReaderBuilder(); + virtual ~CharReaderBuilder(); + + virtual CharReader* newCharReader() const; + + /** \return true if 'settings' are legal and consistent; + * otherwise, indicate bad settings via 'invalid'. + */ + bool validate(Json::Value* invalid) const; + + /** A simple way to update a specific setting. + */ + Value& operator[](std::string key); + + /** Called by ctor, but you can use this to reset settings_. + * \pre 'settings' != NULL (but Json::null is fine) + * \remark Defaults: + * \snippet src/lib_json/json_reader.cpp CharReaderBuilderDefaults + */ + static void setDefaults(Json::Value* settings); + /** Same as old Features::strictMode(). + * \pre 'settings' != NULL (but Json::null is fine) + * \remark Defaults: + * \snippet src/lib_json/json_reader.cpp CharReaderBuilderStrictMode + */ + static void strictMode(Json::Value* settings); +}; + +/** Consume entire stream and use its begin/end. + * Someday we might have a real StreamReader, but for now this + * is convenient. + */ +bool JSON_API parseFromStream( + CharReader::Factory const&, + std::istream&, + Value* root, std::string* errs); + +/** \brief Read from 'sin' into 'root'. + + Always keep comments from the input JSON. + + This can be used to read a file into a particular sub-object. + For example: + \code + Json::Value root; + cin >> root["dir"]["file"]; + cout << root; + \endcode + Result: + \verbatim + { + "dir": { + "file": { + // The input stream JSON would be nested here. + } + } + } + \endverbatim + \throw std::exception on parse error. + \see Json::operator<<() +*/ +JSON_API std::istream& operator>>(std::istream&, Value&); + +} // namespace Json + +#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) +#pragma warning(pop) +#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) + +#endif // CPPTL_JSON_READER_H_INCLUDED + +// ////////////////////////////////////////////////////////////////////// +// End of content of file: include/json/reader.h +// ////////////////////////////////////////////////////////////////////// + + + + + + +// ////////////////////////////////////////////////////////////////////// +// Beginning of content of file: include/json/writer.h +// ////////////////////////////////////////////////////////////////////// + +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef JSON_WRITER_H_INCLUDED +#define JSON_WRITER_H_INCLUDED + +#if !defined(JSON_IS_AMALGAMATION) +#include "value.h" +#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include + +// Disable warning C4251: : needs to have dll-interface to +// be used by... +#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) +#pragma warning(push) +#pragma warning(disable : 4251) +#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) + +namespace Json { + +class Value; + +/** + +Usage: +\code + using namespace Json; + void writeToStdout(StreamWriter::Factory const& factory, Value const& value) { + std::unique_ptr const writer( + factory.newStreamWriter()); + writer->write(value, &std::cout); + std::cout << std::endl; // add lf and flush + } +\endcode +*/ +class JSON_API StreamWriter { +protected: + std::ostream* sout_; // not owned; will not delete +public: + StreamWriter(); + virtual ~StreamWriter(); + /** Write Value into document as configured in sub-class. + Do not take ownership of sout, but maintain a reference during function. + \pre sout != NULL + \return zero on success (For now, we always return zero, so check the stream instead.) + \throw std::exception possibly, depending on configuration + */ + virtual int write(Value const& root, std::ostream* sout) = 0; + + /** \brief A simple abstract factory. + */ + class JSON_API Factory { + public: + virtual ~Factory(); + /** \brief Allocate a CharReader via operator new(). + * \throw std::exception if something goes wrong (e.g. invalid settings) + */ + virtual StreamWriter* newStreamWriter() const = 0; + }; // Factory +}; // StreamWriter + +/** \brief Write into stringstream, then return string, for convenience. + * A StreamWriter will be created from the factory, used, and then deleted. + */ +std::string JSON_API writeString(StreamWriter::Factory const& factory, Value const& root); + + +/** \brief Build a StreamWriter implementation. + +Usage: +\code + using namespace Json; + Value value = ...; + StreamWriterBuilder builder; + builder["commentStyle"] = "None"; + builder["indentation"] = " "; // or whatever you like + std::unique_ptr writer( + builder.newStreamWriter()); + writer->write(value, &std::cout); + std::cout << std::endl; // add lf and flush +\endcode +*/ +class JSON_API StreamWriterBuilder : public StreamWriter::Factory { +public: + // Note: We use a Json::Value so that we can add data-members to this class + // without a major version bump. + /** Configuration of this builder. + Available settings (case-sensitive): + - "commentStyle": "None" or "All" + - "indentation": "" + - "enableYAMLCompatibility": false or true + - slightly change the whitespace around colons + - "dropNullPlaceholders": false or true + - Drop the "null" string from the writer's output for nullValues. + Strictly speaking, this is not valid JSON. But when the output is being + fed to a browser's Javascript, it makes for smaller output and the + browser can handle the output just fine. + + You can examine 'settings_` yourself + to see the defaults. You can also write and read them just like any + JSON Value. + \sa setDefaults() + */ + Json::Value settings_; + + StreamWriterBuilder(); + virtual ~StreamWriterBuilder(); + + /** + * \throw std::exception if something goes wrong (e.g. invalid settings) + */ + virtual StreamWriter* newStreamWriter() const; + + /** \return true if 'settings' are legal and consistent; + * otherwise, indicate bad settings via 'invalid'. + */ + bool validate(Json::Value* invalid) const; + /** A simple way to update a specific setting. + */ + Value& operator[](std::string key); + + /** Called by ctor, but you can use this to reset settings_. + * \pre 'settings' != NULL (but Json::null is fine) + * \remark Defaults: + * \snippet src/lib_json/json_writer.cpp StreamWriterBuilderDefaults + */ + static void setDefaults(Json::Value* settings); +}; + +/** \brief Abstract class for writers. + * \deprecated Use StreamWriter. (And really, this is an implementation detail.) + */ +class JSON_API Writer { +public: + virtual ~Writer(); + + virtual std::string write(const Value& root) = 0; +}; + +/** \brief Outputs a Value in JSON format + *without formatting (not human friendly). + * + * The JSON document is written in a single line. It is not intended for 'human' + *consumption, + * but may be usefull to support feature such as RPC where bandwith is limited. + * \sa Reader, Value + * \deprecated Use StreamWriterBuilder. + */ +class JSON_API FastWriter : public Writer { + +public: + FastWriter(); + virtual ~FastWriter() {} + + void enableYAMLCompatibility(); + + /** \brief Drop the "null" string from the writer's output for nullValues. + * Strictly speaking, this is not valid JSON. But when the output is being + * fed to a browser's Javascript, it makes for smaller output and the + * browser can handle the output just fine. + */ + void dropNullPlaceholders(); + + void omitEndingLineFeed(); + +public: // overridden from Writer + virtual std::string write(const Value& root); + +private: + void writeValue(const Value& value); + + std::string document_; + bool yamlCompatiblityEnabled_; + bool dropNullPlaceholders_; + bool omitEndingLineFeed_; +}; + +/** \brief Writes a Value in JSON format in a + *human friendly way. + * + * The rules for line break and indent are as follow: + * - Object value: + * - if empty then print {} without indent and line break + * - if not empty the print '{', line break & indent, print one value per + *line + * and then unindent and line break and print '}'. + * - Array value: + * - if empty then print [] without indent and line break + * - if the array contains no object value, empty array or some other value + *types, + * and all the values fit on one lines, then print the array on a single + *line. + * - otherwise, it the values do not fit on one line, or the array contains + * object or non empty array, then print one value per line. + * + * If the Value have comments then they are outputed according to their + *#CommentPlacement. + * + * \sa Reader, Value, Value::setComment() + * \deprecated Use StreamWriterBuilder. + */ +class JSON_API StyledWriter : public Writer { +public: + StyledWriter(); + virtual ~StyledWriter() {} + +public: // overridden from Writer + /** \brief Serialize a Value in JSON format. + * \param root Value to serialize. + * \return String containing the JSON document that represents the root value. + */ + virtual std::string write(const Value& root); + +private: + void writeValue(const Value& value); + void writeArrayValue(const Value& value); + bool isMultineArray(const Value& value); + void pushValue(const std::string& value); + void writeIndent(); + void writeWithIndent(const std::string& value); + void indent(); + void unindent(); + void writeCommentBeforeValue(const Value& root); + void writeCommentAfterValueOnSameLine(const Value& root); + bool hasCommentForValue(const Value& value); + static std::string normalizeEOL(const std::string& text); + + typedef std::vector ChildValues; + + ChildValues childValues_; + std::string document_; + std::string indentString_; + int rightMargin_; + int indentSize_; + bool addChildValues_; +}; + +/** \brief Writes a Value in JSON format in a + human friendly way, + to a stream rather than to a string. + * + * The rules for line break and indent are as follow: + * - Object value: + * - if empty then print {} without indent and line break + * - if not empty the print '{', line break & indent, print one value per + line + * and then unindent and line break and print '}'. + * - Array value: + * - if empty then print [] without indent and line break + * - if the array contains no object value, empty array or some other value + types, + * and all the values fit on one lines, then print the array on a single + line. + * - otherwise, it the values do not fit on one line, or the array contains + * object or non empty array, then print one value per line. + * + * If the Value have comments then they are outputed according to their + #CommentPlacement. + * + * \param indentation Each level will be indented by this amount extra. + * \sa Reader, Value, Value::setComment() + * \deprecated Use StreamWriterBuilder. + */ +class JSON_API StyledStreamWriter { +public: + StyledStreamWriter(std::string indentation = "\t"); + ~StyledStreamWriter() {} + +public: + /** \brief Serialize a Value in JSON format. + * \param out Stream to write to. (Can be ostringstream, e.g.) + * \param root Value to serialize. + * \note There is no point in deriving from Writer, since write() should not + * return a value. + */ + void write(std::ostream& out, const Value& root); + +private: + void writeValue(const Value& value); + void writeArrayValue(const Value& value); + bool isMultineArray(const Value& value); + void pushValue(const std::string& value); + void writeIndent(); + void writeWithIndent(const std::string& value); + void indent(); + void unindent(); + void writeCommentBeforeValue(const Value& root); + void writeCommentAfterValueOnSameLine(const Value& root); + bool hasCommentForValue(const Value& value); + static std::string normalizeEOL(const std::string& text); + + typedef std::vector ChildValues; + + ChildValues childValues_; + std::ostream* document_; + std::string indentString_; + int rightMargin_; + std::string indentation_; + bool addChildValues_ : 1; + bool indented_ : 1; +}; + +#if defined(JSON_HAS_INT64) +std::string JSON_API valueToString(Int value); +std::string JSON_API valueToString(UInt value); +#endif // if defined(JSON_HAS_INT64) +std::string JSON_API valueToString(LargestInt value); +std::string JSON_API valueToString(LargestUInt value); +std::string JSON_API valueToString(double value); +std::string JSON_API valueToString(bool value); +std::string JSON_API valueToQuotedString(const char* value); + +/// \brief Output using the StyledStreamWriter. +/// \see Json::operator>>() +JSON_API std::ostream& operator<<(std::ostream&, const Value& root); + +} // namespace Json + +#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) +#pragma warning(pop) +#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) + +#endif // JSON_WRITER_H_INCLUDED + +// ////////////////////////////////////////////////////////////////////// +// End of content of file: include/json/writer.h +// ////////////////////////////////////////////////////////////////////// + + + + + + +// ////////////////////////////////////////////////////////////////////// +// Beginning of content of file: include/json/assertions.h +// ////////////////////////////////////////////////////////////////////// + +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED +#define CPPTL_JSON_ASSERTIONS_H_INCLUDED + +#include +#include + +#if !defined(JSON_IS_AMALGAMATION) +#include "config.h" +#endif // if !defined(JSON_IS_AMALGAMATION) + +/** It should not be possible for a maliciously designed file to + * cause an abort() or seg-fault, so these macros are used only + * for pre-condition violations and internal logic errors. + */ +#if JSON_USE_EXCEPTION + +// @todo <= add detail about condition in exception +# define JSON_ASSERT(condition) \ + {if (!(condition)) {Json::throwLogicError( "assert json failed" );}} + +# define JSON_FAIL_MESSAGE(message) \ + { \ + std::ostringstream oss; oss << message; \ + Json::throwLogicError(oss.str()); \ + abort(); \ + } + +#else // JSON_USE_EXCEPTION + +# define JSON_ASSERT(condition) assert(condition) + +// The call to assert() will show the failure message in debug builds. In +// release builds we abort, for a core-dump or debugger. +# define JSON_FAIL_MESSAGE(message) \ + { \ + std::ostringstream oss; oss << message; \ + assert(false && oss.str().c_str()); \ + abort(); \ + } + + +#endif + +#define JSON_ASSERT_MESSAGE(condition, message) \ + if (!(condition)) { \ + JSON_FAIL_MESSAGE(message); \ + } + +#endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED + +// ////////////////////////////////////////////////////////////////////// +// End of content of file: include/json/assertions.h +// ////////////////////////////////////////////////////////////////////// + + + + + +#endif //ifndef JSON_AMALGATED_H_INCLUDED diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsoncpp/dist/jsoncpp.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsoncpp/dist/jsoncpp.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsoncpp/dist/jsoncpp.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsoncpp/dist/jsoncpp.cpp 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,5124 @@ +/// Json-cpp amalgated source (http://jsoncpp.sourceforge.net/). +/// It is intended to be used with #include "json/json.h" + +// ////////////////////////////////////////////////////////////////////// +// Beginning of content of file: LICENSE +// ////////////////////////////////////////////////////////////////////// + +/* +The JsonCpp library's source code, including accompanying documentation, +tests and demonstration applications, are licensed under the following +conditions... + +The author (Baptiste Lepilleur) explicitly disclaims copyright in all +jurisdictions which recognize such a disclaimer. In such jurisdictions, +this software is released into the Public Domain. + +In jurisdictions which do not recognize Public Domain property (e.g. Germany as of +2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is +released under the terms of the MIT License (see below). + +In jurisdictions which recognize Public Domain property, the user of this +software may choose to accept it either as 1) Public Domain, 2) under the +conditions of the MIT License (see below), or 3) under the terms of dual +Public Domain/MIT License conditions described here, as they choose. + +The MIT License is about as close to Public Domain as a license can get, and is +described in clear, concise terms at: + + http://en.wikipedia.org/wiki/MIT_License + +The full text of the MIT License follows: + +======================================================================== +Copyright (c) 2007-2010 Baptiste Lepilleur + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +======================================================================== +(END LICENSE TEXT) + +The MIT license is compatible with both the GPL and commercial +software, affording one all of the rights of Public Domain with the +minor nuisance of being required to keep the above copyright notice +and license text in the source code. Note also that by accepting the +Public Domain "license" you can re-license your copy using whatever +license you like. + +*/ + +// ////////////////////////////////////////////////////////////////////// +// End of content of file: LICENSE +// ////////////////////////////////////////////////////////////////////// + + + + + + +#include "json/json.h" + +#ifndef JSON_IS_AMALGAMATION +#error "Compile with -I PATH_TO_JSON_DIRECTORY" +#endif + + +// ////////////////////////////////////////////////////////////////////// +// Beginning of content of file: src/lib_json/json_tool.h +// ////////////////////////////////////////////////////////////////////// + +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED +#define LIB_JSONCPP_JSON_TOOL_H_INCLUDED + +/* This header provides common string manipulation support, such as UTF-8, + * portable conversion from/to string... + * + * It is an internal header that must not be exposed. + */ + +namespace Json { + +/// Converts a unicode code-point to UTF-8. +static inline std::string codePointToUTF8(unsigned int cp) { + std::string result; + + // based on description from http://en.wikipedia.org/wiki/UTF-8 + + if (cp <= 0x7f) { + result.resize(1); + result[0] = static_cast(cp); + } else if (cp <= 0x7FF) { + result.resize(2); + result[1] = static_cast(0x80 | (0x3f & cp)); + result[0] = static_cast(0xC0 | (0x1f & (cp >> 6))); + } else if (cp <= 0xFFFF) { + result.resize(3); + result[2] = static_cast(0x80 | (0x3f & cp)); + result[1] = 0x80 | static_cast((0x3f & (cp >> 6))); + result[0] = 0xE0 | static_cast((0xf & (cp >> 12))); + } else if (cp <= 0x10FFFF) { + result.resize(4); + result[3] = static_cast(0x80 | (0x3f & cp)); + result[2] = static_cast(0x80 | (0x3f & (cp >> 6))); + result[1] = static_cast(0x80 | (0x3f & (cp >> 12))); + result[0] = static_cast(0xF0 | (0x7 & (cp >> 18))); + } + + return result; +} + +/// Returns true if ch is a control character (in range [0,32[). +static inline bool isControlCharacter(char ch) { return ch > 0 && ch <= 0x1F; } + +enum { + /// Constant that specify the size of the buffer that must be passed to + /// uintToString. + uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1 +}; + +// Defines a char buffer for use with uintToString(). +typedef char UIntToStringBuffer[uintToStringBufferSize]; + +/** Converts an unsigned integer to string. + * @param value Unsigned interger to convert to string + * @param current Input/Output string buffer. + * Must have at least uintToStringBufferSize chars free. + */ +static inline void uintToString(LargestUInt value, char*& current) { + *--current = 0; + do { + *--current = char(value % 10) + '0'; + value /= 10; + } while (value != 0); +} + +/** Change ',' to '.' everywhere in buffer. + * + * We had a sophisticated way, but it did not work in WinCE. + * @see https://github.com/open-source-parsers/jsoncpp/pull/9 + */ +static inline void fixNumericLocale(char* begin, char* end) { + while (begin < end) { + if (*begin == ',') { + *begin = '.'; + } + ++begin; + } +} + +} // namespace Json { + +#endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED + +// ////////////////////////////////////////////////////////////////////// +// End of content of file: src/lib_json/json_tool.h +// ////////////////////////////////////////////////////////////////////// + + + + + + +// ////////////////////////////////////////////////////////////////////// +// Beginning of content of file: src/lib_json/json_reader.cpp +// ////////////////////////////////////////////////////////////////////// + +// Copyright 2007-2011 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include +#include "json_tool.h" +#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below +#define snprintf _snprintf +#endif + +#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0 +// Disable warning about strdup being deprecated. +#pragma warning(disable : 4996) +#endif + +static int const stackLimit_g = 1000; +static int stackDepth_g = 0; // see readValue() + +namespace Json { + +#if __cplusplus >= 201103L +typedef std::unique_ptr CharReaderPtr; +#else +typedef std::auto_ptr CharReaderPtr; +#endif + +// Implementation of class Features +// //////////////////////////////// + +Features::Features() + : allowComments_(true), strictRoot_(false), + allowDroppedNullPlaceholders_(false), allowNumericKeys_(false) {} + +Features Features::all() { return Features(); } + +Features Features::strictMode() { + Features features; + features.allowComments_ = false; + features.strictRoot_ = true; + features.allowDroppedNullPlaceholders_ = false; + features.allowNumericKeys_ = false; + return features; +} + +// Implementation of class Reader +// //////////////////////////////// + +static bool containsNewLine(Reader::Location begin, Reader::Location end) { + for (; begin < end; ++begin) + if (*begin == '\n' || *begin == '\r') + return true; + return false; +} + +// Class Reader +// ////////////////////////////////////////////////////////////////// + +Reader::Reader() + : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(), + lastValue_(), commentsBefore_(), features_(Features::all()), + collectComments_() {} + +Reader::Reader(const Features& features) + : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(), + lastValue_(), commentsBefore_(), features_(features), collectComments_() { +} + +bool +Reader::parse(const std::string& document, Value& root, bool collectComments) { + document_ = document; + const char* begin = document_.c_str(); + const char* end = begin + document_.length(); + return parse(begin, end, root, collectComments); +} + +bool Reader::parse(std::istream& sin, Value& root, bool collectComments) { + // std::istream_iterator begin(sin); + // std::istream_iterator end; + // Those would allow streamed input from a file, if parse() were a + // template function. + + // Since std::string is reference-counted, this at least does not + // create an extra copy. + std::string doc; + std::getline(sin, doc, (char)EOF); + return parse(doc, root, collectComments); +} + +bool Reader::parse(const char* beginDoc, + const char* endDoc, + Value& root, + bool collectComments) { + if (!features_.allowComments_) { + collectComments = false; + } + + begin_ = beginDoc; + end_ = endDoc; + collectComments_ = collectComments; + current_ = begin_; + lastValueEnd_ = 0; + lastValue_ = 0; + commentsBefore_ = ""; + errors_.clear(); + while (!nodes_.empty()) + nodes_.pop(); + nodes_.push(&root); + + stackDepth_g = 0; // Yes, this is bad coding, but options are limited. + bool successful = readValue(); + Token token; + skipCommentTokens(token); + if (collectComments_ && !commentsBefore_.empty()) + root.setComment(commentsBefore_, commentAfter); + if (features_.strictRoot_) { + if (!root.isArray() && !root.isObject()) { + // Set error location to start of doc, ideally should be first token found + // in doc + token.type_ = tokenError; + token.start_ = beginDoc; + token.end_ = endDoc; + addError( + "A valid JSON document must be either an array or an object value.", + token); + return false; + } + } + return successful; +} + +bool Reader::readValue() { + // This is a non-reentrant way to support a stackLimit. Terrible! + // But this deprecated class has a security problem: Bad input can + // cause a seg-fault. This seems like a fair, binary-compatible way + // to prevent the problem. + if (stackDepth_g >= stackLimit_g) throwRuntimeError("Exceeded stackLimit in readValue()."); + ++stackDepth_g; + + Token token; + skipCommentTokens(token); + bool successful = true; + + if (collectComments_ && !commentsBefore_.empty()) { + currentValue().setComment(commentsBefore_, commentBefore); + commentsBefore_ = ""; + } + + switch (token.type_) { + case tokenObjectBegin: + successful = readObject(token); + currentValue().setOffsetLimit(current_ - begin_); + break; + case tokenArrayBegin: + successful = readArray(token); + currentValue().setOffsetLimit(current_ - begin_); + break; + case tokenNumber: + successful = decodeNumber(token); + break; + case tokenString: + successful = decodeString(token); + break; + case tokenTrue: + { + Value v(true); + currentValue().swapPayload(v); + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + } + break; + case tokenFalse: + { + Value v(false); + currentValue().swapPayload(v); + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + } + break; + case tokenNull: + { + Value v; + currentValue().swapPayload(v); + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + } + break; + case tokenArraySeparator: + case tokenObjectEnd: + case tokenArrayEnd: + if (features_.allowDroppedNullPlaceholders_) { + // "Un-read" the current token and mark the current value as a null + // token. + current_--; + Value v; + currentValue().swapPayload(v); + currentValue().setOffsetStart(current_ - begin_ - 1); + currentValue().setOffsetLimit(current_ - begin_); + break; + } // Else, fall through... + default: + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + return addError("Syntax error: value, object or array expected.", token); + } + + if (collectComments_) { + lastValueEnd_ = current_; + lastValue_ = ¤tValue(); + } + + --stackDepth_g; + return successful; +} + +void Reader::skipCommentTokens(Token& token) { + if (features_.allowComments_) { + do { + readToken(token); + } while (token.type_ == tokenComment); + } else { + readToken(token); + } +} + +bool Reader::readToken(Token& token) { + skipSpaces(); + token.start_ = current_; + Char c = getNextChar(); + bool ok = true; + switch (c) { + case '{': + token.type_ = tokenObjectBegin; + break; + case '}': + token.type_ = tokenObjectEnd; + break; + case '[': + token.type_ = tokenArrayBegin; + break; + case ']': + token.type_ = tokenArrayEnd; + break; + case '"': + token.type_ = tokenString; + ok = readString(); + break; + case '/': + token.type_ = tokenComment; + ok = readComment(); + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '-': + token.type_ = tokenNumber; + readNumber(); + break; + case 't': + token.type_ = tokenTrue; + ok = match("rue", 3); + break; + case 'f': + token.type_ = tokenFalse; + ok = match("alse", 4); + break; + case 'n': + token.type_ = tokenNull; + ok = match("ull", 3); + break; + case ',': + token.type_ = tokenArraySeparator; + break; + case ':': + token.type_ = tokenMemberSeparator; + break; + case 0: + token.type_ = tokenEndOfStream; + break; + default: + ok = false; + break; + } + if (!ok) + token.type_ = tokenError; + token.end_ = current_; + return true; +} + +void Reader::skipSpaces() { + while (current_ != end_) { + Char c = *current_; + if (c == ' ' || c == '\t' || c == '\r' || c == '\n') + ++current_; + else + break; + } +} + +bool Reader::match(Location pattern, int patternLength) { + if (end_ - current_ < patternLength) + return false; + int index = patternLength; + while (index--) + if (current_[index] != pattern[index]) + return false; + current_ += patternLength; + return true; +} + +bool Reader::readComment() { + Location commentBegin = current_ - 1; + Char c = getNextChar(); + bool successful = false; + if (c == '*') + successful = readCStyleComment(); + else if (c == '/') + successful = readCppStyleComment(); + if (!successful) + return false; + + if (collectComments_) { + CommentPlacement placement = commentBefore; + if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) { + if (c != '*' || !containsNewLine(commentBegin, current_)) + placement = commentAfterOnSameLine; + } + + addComment(commentBegin, current_, placement); + } + return true; +} + +static std::string normalizeEOL(Reader::Location begin, Reader::Location end) { + std::string normalized; + normalized.reserve(end - begin); + Reader::Location current = begin; + while (current != end) { + char c = *current++; + if (c == '\r') { + if (current != end && *current == '\n') + // convert dos EOL + ++current; + // convert Mac EOL + normalized += '\n'; + } else { + normalized += c; + } + } + return normalized; +} + +void +Reader::addComment(Location begin, Location end, CommentPlacement placement) { + assert(collectComments_); + const std::string& normalized = normalizeEOL(begin, end); + if (placement == commentAfterOnSameLine) { + assert(lastValue_ != 0); + lastValue_->setComment(normalized, placement); + } else { + commentsBefore_ += normalized; + } +} + +bool Reader::readCStyleComment() { + while (current_ != end_) { + Char c = getNextChar(); + if (c == '*' && *current_ == '/') + break; + } + return getNextChar() == '/'; +} + +bool Reader::readCppStyleComment() { + while (current_ != end_) { + Char c = getNextChar(); + if (c == '\n') + break; + if (c == '\r') { + // Consume DOS EOL. It will be normalized in addComment. + if (current_ != end_ && *current_ == '\n') + getNextChar(); + // Break on Moc OS 9 EOL. + break; + } + } + return true; +} + +void Reader::readNumber() { + const char *p = current_; + char c = '0'; // stopgap for already consumed character + // integral part + while (c >= '0' && c <= '9') + c = (current_ = p) < end_ ? *p++ : 0; + // fractional part + if (c == '.') { + c = (current_ = p) < end_ ? *p++ : 0; + while (c >= '0' && c <= '9') + c = (current_ = p) < end_ ? *p++ : 0; + } + // exponential part + if (c == 'e' || c == 'E') { + c = (current_ = p) < end_ ? *p++ : 0; + if (c == '+' || c == '-') + c = (current_ = p) < end_ ? *p++ : 0; + while (c >= '0' && c <= '9') + c = (current_ = p) < end_ ? *p++ : 0; + } +} + +bool Reader::readString() { + Char c = 0; + while (current_ != end_) { + c = getNextChar(); + if (c == '\\') + getNextChar(); + else if (c == '"') + break; + } + return c == '"'; +} + +bool Reader::readObject(Token& tokenStart) { + Token tokenName; + std::string name; + Value init(objectValue); + currentValue().swapPayload(init); + currentValue().setOffsetStart(tokenStart.start_ - begin_); + while (readToken(tokenName)) { + bool initialTokenOk = true; + while (tokenName.type_ == tokenComment && initialTokenOk) + initialTokenOk = readToken(tokenName); + if (!initialTokenOk) + break; + if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object + return true; + name = ""; + if (tokenName.type_ == tokenString) { + if (!decodeString(tokenName, name)) + return recoverFromError(tokenObjectEnd); + } else if (tokenName.type_ == tokenNumber && features_.allowNumericKeys_) { + Value numberName; + if (!decodeNumber(tokenName, numberName)) + return recoverFromError(tokenObjectEnd); + name = numberName.asString(); + } else { + break; + } + + Token colon; + if (!readToken(colon) || colon.type_ != tokenMemberSeparator) { + return addErrorAndRecover( + "Missing ':' after object member name", colon, tokenObjectEnd); + } + Value& value = currentValue()[name]; + nodes_.push(&value); + bool ok = readValue(); + nodes_.pop(); + if (!ok) // error already set + return recoverFromError(tokenObjectEnd); + + Token comma; + if (!readToken(comma) || + (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator && + comma.type_ != tokenComment)) { + return addErrorAndRecover( + "Missing ',' or '}' in object declaration", comma, tokenObjectEnd); + } + bool finalizeTokenOk = true; + while (comma.type_ == tokenComment && finalizeTokenOk) + finalizeTokenOk = readToken(comma); + if (comma.type_ == tokenObjectEnd) + return true; + } + return addErrorAndRecover( + "Missing '}' or object member name", tokenName, tokenObjectEnd); +} + +bool Reader::readArray(Token& tokenStart) { + Value init(arrayValue); + currentValue().swapPayload(init); + currentValue().setOffsetStart(tokenStart.start_ - begin_); + skipSpaces(); + if (*current_ == ']') // empty array + { + Token endArray; + readToken(endArray); + return true; + } + int index = 0; + for (;;) { + Value& value = currentValue()[index++]; + nodes_.push(&value); + bool ok = readValue(); + nodes_.pop(); + if (!ok) // error already set + return recoverFromError(tokenArrayEnd); + + Token token; + // Accept Comment after last item in the array. + ok = readToken(token); + while (token.type_ == tokenComment && ok) { + ok = readToken(token); + } + bool badTokenType = + (token.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd); + if (!ok || badTokenType) { + return addErrorAndRecover( + "Missing ',' or ']' in array declaration", token, tokenArrayEnd); + } + if (token.type_ == tokenArrayEnd) + break; + } + return true; +} + +bool Reader::decodeNumber(Token& token) { + Value decoded; + if (!decodeNumber(token, decoded)) + return false; + currentValue().swapPayload(decoded); + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + return true; +} + +bool Reader::decodeNumber(Token& token, Value& decoded) { + // Attempts to parse the number as an integer. If the number is + // larger than the maximum supported value of an integer then + // we decode the number as a double. + Location current = token.start_; + bool isNegative = *current == '-'; + if (isNegative) + ++current; + // TODO: Help the compiler do the div and mod at compile time or get rid of them. + Value::LargestUInt maxIntegerValue = + isNegative ? Value::LargestUInt(-Value::minLargestInt) + : Value::maxLargestUInt; + Value::LargestUInt threshold = maxIntegerValue / 10; + Value::LargestUInt value = 0; + while (current < token.end_) { + Char c = *current++; + if (c < '0' || c > '9') + return decodeDouble(token, decoded); + Value::UInt digit(c - '0'); + if (value >= threshold) { + // We've hit or exceeded the max value divided by 10 (rounded down). If + // a) we've only just touched the limit, b) this is the last digit, and + // c) it's small enough to fit in that rounding delta, we're okay. + // Otherwise treat this number as a double to avoid overflow. + if (value > threshold || current != token.end_ || + digit > maxIntegerValue % 10) { + return decodeDouble(token, decoded); + } + } + value = value * 10 + digit; + } + if (isNegative) + decoded = -Value::LargestInt(value); + else if (value <= Value::LargestUInt(Value::maxInt)) + decoded = Value::LargestInt(value); + else + decoded = value; + return true; +} + +bool Reader::decodeDouble(Token& token) { + Value decoded; + if (!decodeDouble(token, decoded)) + return false; + currentValue().swapPayload(decoded); + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + return true; +} + +bool Reader::decodeDouble(Token& token, Value& decoded) { + double value = 0; + const int bufferSize = 32; + int count; + int length = int(token.end_ - token.start_); + + // Sanity check to avoid buffer overflow exploits. + if (length < 0) { + return addError("Unable to parse token length", token); + } + + // Avoid using a string constant for the format control string given to + // sscanf, as this can cause hard to debug crashes on OS X. See here for more + // info: + // + // http://developer.apple.com/library/mac/#DOCUMENTATION/DeveloperTools/gcc-4.0.1/gcc/Incompatibilities.html + char format[] = "%lf"; + + if (length <= bufferSize) { + Char buffer[bufferSize + 1]; + memcpy(buffer, token.start_, length); + buffer[length] = 0; + count = sscanf(buffer, format, &value); + } else { + std::string buffer(token.start_, token.end_); + count = sscanf(buffer.c_str(), format, &value); + } + + if (count != 1) + return addError("'" + std::string(token.start_, token.end_) + + "' is not a number.", + token); + decoded = value; + return true; +} + +bool Reader::decodeString(Token& token) { + std::string decoded_string; + if (!decodeString(token, decoded_string)) + return false; + Value decoded(decoded_string); + currentValue().swapPayload(decoded); + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + return true; +} + +bool Reader::decodeString(Token& token, std::string& decoded) { + decoded.reserve(token.end_ - token.start_ - 2); + Location current = token.start_ + 1; // skip '"' + Location end = token.end_ - 1; // do not include '"' + while (current != end) { + Char c = *current++; + if (c == '"') + break; + else if (c == '\\') { + if (current == end) + return addError("Empty escape sequence in string", token, current); + Char escape = *current++; + switch (escape) { + case '"': + decoded += '"'; + break; + case '/': + decoded += '/'; + break; + case '\\': + decoded += '\\'; + break; + case 'b': + decoded += '\b'; + break; + case 'f': + decoded += '\f'; + break; + case 'n': + decoded += '\n'; + break; + case 'r': + decoded += '\r'; + break; + case 't': + decoded += '\t'; + break; + case 'u': { + unsigned int unicode; + if (!decodeUnicodeCodePoint(token, current, end, unicode)) + return false; + decoded += codePointToUTF8(unicode); + } break; + default: + return addError("Bad escape sequence in string", token, current); + } + } else { + decoded += c; + } + } + return true; +} + +bool Reader::decodeUnicodeCodePoint(Token& token, + Location& current, + Location end, + unsigned int& unicode) { + + if (!decodeUnicodeEscapeSequence(token, current, end, unicode)) + return false; + if (unicode >= 0xD800 && unicode <= 0xDBFF) { + // surrogate pairs + if (end - current < 6) + return addError( + "additional six characters expected to parse unicode surrogate pair.", + token, + current); + unsigned int surrogatePair; + if (*(current++) == '\\' && *(current++) == 'u') { + if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) { + unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF); + } else + return false; + } else + return addError("expecting another \\u token to begin the second half of " + "a unicode surrogate pair", + token, + current); + } + return true; +} + +bool Reader::decodeUnicodeEscapeSequence(Token& token, + Location& current, + Location end, + unsigned int& unicode) { + if (end - current < 4) + return addError( + "Bad unicode escape sequence in string: four digits expected.", + token, + current); + unicode = 0; + for (int index = 0; index < 4; ++index) { + Char c = *current++; + unicode *= 16; + if (c >= '0' && c <= '9') + unicode += c - '0'; + else if (c >= 'a' && c <= 'f') + unicode += c - 'a' + 10; + else if (c >= 'A' && c <= 'F') + unicode += c - 'A' + 10; + else + return addError( + "Bad unicode escape sequence in string: hexadecimal digit expected.", + token, + current); + } + return true; +} + +bool +Reader::addError(const std::string& message, Token& token, Location extra) { + ErrorInfo info; + info.token_ = token; + info.message_ = message; + info.extra_ = extra; + errors_.push_back(info); + return false; +} + +bool Reader::recoverFromError(TokenType skipUntilToken) { + int errorCount = int(errors_.size()); + Token skip; + for (;;) { + if (!readToken(skip)) + errors_.resize(errorCount); // discard errors caused by recovery + if (skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream) + break; + } + errors_.resize(errorCount); + return false; +} + +bool Reader::addErrorAndRecover(const std::string& message, + Token& token, + TokenType skipUntilToken) { + addError(message, token); + return recoverFromError(skipUntilToken); +} + +Value& Reader::currentValue() { return *(nodes_.top()); } + +Reader::Char Reader::getNextChar() { + if (current_ == end_) + return 0; + return *current_++; +} + +void Reader::getLocationLineAndColumn(Location location, + int& line, + int& column) const { + Location current = begin_; + Location lastLineStart = current; + line = 0; + while (current < location && current != end_) { + Char c = *current++; + if (c == '\r') { + if (*current == '\n') + ++current; + lastLineStart = current; + ++line; + } else if (c == '\n') { + lastLineStart = current; + ++line; + } + } + // column & line start at 1 + column = int(location - lastLineStart) + 1; + ++line; +} + +std::string Reader::getLocationLineAndColumn(Location location) const { + int line, column; + getLocationLineAndColumn(location, line, column); + char buffer[18 + 16 + 16 + 1]; +#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) +#if defined(WINCE) + _snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column); +#else + sprintf_s(buffer, sizeof(buffer), "Line %d, Column %d", line, column); +#endif +#else + snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column); +#endif + return buffer; +} + +// Deprecated. Preserved for backward compatibility +std::string Reader::getFormatedErrorMessages() const { + return getFormattedErrorMessages(); +} + +std::string Reader::getFormattedErrorMessages() const { + std::string formattedMessage; + for (Errors::const_iterator itError = errors_.begin(); + itError != errors_.end(); + ++itError) { + const ErrorInfo& error = *itError; + formattedMessage += + "* " + getLocationLineAndColumn(error.token_.start_) + "\n"; + formattedMessage += " " + error.message_ + "\n"; + if (error.extra_) + formattedMessage += + "See " + getLocationLineAndColumn(error.extra_) + " for detail.\n"; + } + return formattedMessage; +} + +std::vector Reader::getStructuredErrors() const { + std::vector allErrors; + for (Errors::const_iterator itError = errors_.begin(); + itError != errors_.end(); + ++itError) { + const ErrorInfo& error = *itError; + Reader::StructuredError structured; + structured.offset_start = error.token_.start_ - begin_; + structured.offset_limit = error.token_.end_ - begin_; + structured.message = error.message_; + allErrors.push_back(structured); + } + return allErrors; +} + +bool Reader::pushError(const Value& value, const std::string& message) { + size_t length = end_ - begin_; + if(value.getOffsetStart() > length + || value.getOffsetLimit() > length) + return false; + Token token; + token.type_ = tokenError; + token.start_ = begin_ + value.getOffsetStart(); + token.end_ = end_ + value.getOffsetLimit(); + ErrorInfo info; + info.token_ = token; + info.message_ = message; + info.extra_ = 0; + errors_.push_back(info); + return true; +} + +bool Reader::pushError(const Value& value, const std::string& message, const Value& extra) { + size_t length = end_ - begin_; + if(value.getOffsetStart() > length + || value.getOffsetLimit() > length + || extra.getOffsetLimit() > length) + return false; + Token token; + token.type_ = tokenError; + token.start_ = begin_ + value.getOffsetStart(); + token.end_ = begin_ + value.getOffsetLimit(); + ErrorInfo info; + info.token_ = token; + info.message_ = message; + info.extra_ = begin_ + extra.getOffsetStart(); + errors_.push_back(info); + return true; +} + +bool Reader::good() const { + return !errors_.size(); +} + +// exact copy of Features +class OurFeatures { +public: + static OurFeatures all(); + OurFeatures(); + bool allowComments_; + bool strictRoot_; + bool allowDroppedNullPlaceholders_; + bool allowNumericKeys_; + bool allowSingleQuotes_; + bool failIfExtra_; + bool rejectDupKeys_; + int stackLimit_; +}; // OurFeatures + +// exact copy of Implementation of class Features +// //////////////////////////////// + +OurFeatures::OurFeatures() + : allowComments_(true), strictRoot_(false) + , allowDroppedNullPlaceholders_(false), allowNumericKeys_(false) + , allowSingleQuotes_(false) + , failIfExtra_(false) +{ +} + +OurFeatures OurFeatures::all() { return OurFeatures(); } + +// Implementation of class Reader +// //////////////////////////////// + +// exact copy of Reader, renamed to OurReader +class OurReader { +public: + typedef char Char; + typedef const Char* Location; + struct StructuredError { + size_t offset_start; + size_t offset_limit; + std::string message; + }; + + OurReader(OurFeatures const& features); + bool parse(const char* beginDoc, + const char* endDoc, + Value& root, + bool collectComments = true); + std::string getFormattedErrorMessages() const; + std::vector getStructuredErrors() const; + bool pushError(const Value& value, const std::string& message); + bool pushError(const Value& value, const std::string& message, const Value& extra); + bool good() const; + +private: + OurReader(OurReader const&); // no impl + void operator=(OurReader const&); // no impl + + enum TokenType { + tokenEndOfStream = 0, + tokenObjectBegin, + tokenObjectEnd, + tokenArrayBegin, + tokenArrayEnd, + tokenString, + tokenNumber, + tokenTrue, + tokenFalse, + tokenNull, + tokenArraySeparator, + tokenMemberSeparator, + tokenComment, + tokenError + }; + + class Token { + public: + TokenType type_; + Location start_; + Location end_; + }; + + class ErrorInfo { + public: + Token token_; + std::string message_; + Location extra_; + }; + + typedef std::deque Errors; + + bool readToken(Token& token); + void skipSpaces(); + bool match(Location pattern, int patternLength); + bool readComment(); + bool readCStyleComment(); + bool readCppStyleComment(); + bool readString(); + bool readStringSingleQuote(); + void readNumber(); + bool readValue(); + bool readObject(Token& token); + bool readArray(Token& token); + bool decodeNumber(Token& token); + bool decodeNumber(Token& token, Value& decoded); + bool decodeString(Token& token); + bool decodeString(Token& token, std::string& decoded); + bool decodeDouble(Token& token); + bool decodeDouble(Token& token, Value& decoded); + bool decodeUnicodeCodePoint(Token& token, + Location& current, + Location end, + unsigned int& unicode); + bool decodeUnicodeEscapeSequence(Token& token, + Location& current, + Location end, + unsigned int& unicode); + bool addError(const std::string& message, Token& token, Location extra = 0); + bool recoverFromError(TokenType skipUntilToken); + bool addErrorAndRecover(const std::string& message, + Token& token, + TokenType skipUntilToken); + void skipUntilSpace(); + Value& currentValue(); + Char getNextChar(); + void + getLocationLineAndColumn(Location location, int& line, int& column) const; + std::string getLocationLineAndColumn(Location location) const; + void addComment(Location begin, Location end, CommentPlacement placement); + void skipCommentTokens(Token& token); + + typedef std::stack Nodes; + Nodes nodes_; + Errors errors_; + std::string document_; + Location begin_; + Location end_; + Location current_; + Location lastValueEnd_; + Value* lastValue_; + std::string commentsBefore_; + int stackDepth_; + + OurFeatures const features_; + bool collectComments_; +}; // OurReader + +// complete copy of Read impl, for OurReader + +OurReader::OurReader(OurFeatures const& features) + : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(), + lastValue_(), commentsBefore_(), features_(features), collectComments_() { +} + +bool OurReader::parse(const char* beginDoc, + const char* endDoc, + Value& root, + bool collectComments) { + if (!features_.allowComments_) { + collectComments = false; + } + + begin_ = beginDoc; + end_ = endDoc; + collectComments_ = collectComments; + current_ = begin_; + lastValueEnd_ = 0; + lastValue_ = 0; + commentsBefore_ = ""; + errors_.clear(); + while (!nodes_.empty()) + nodes_.pop(); + nodes_.push(&root); + + stackDepth_ = 0; + bool successful = readValue(); + Token token; + skipCommentTokens(token); + if (features_.failIfExtra_) { + if (token.type_ != tokenError && token.type_ != tokenEndOfStream) { + addError("Extra non-whitespace after JSON value.", token); + return false; + } + } + if (collectComments_ && !commentsBefore_.empty()) + root.setComment(commentsBefore_, commentAfter); + if (features_.strictRoot_) { + if (!root.isArray() && !root.isObject()) { + // Set error location to start of doc, ideally should be first token found + // in doc + token.type_ = tokenError; + token.start_ = beginDoc; + token.end_ = endDoc; + addError( + "A valid JSON document must be either an array or an object value.", + token); + return false; + } + } + return successful; +} + +bool OurReader::readValue() { + if (stackDepth_ >= features_.stackLimit_) throwRuntimeError("Exceeded stackLimit in readValue()."); + ++stackDepth_; + Token token; + skipCommentTokens(token); + bool successful = true; + + if (collectComments_ && !commentsBefore_.empty()) { + currentValue().setComment(commentsBefore_, commentBefore); + commentsBefore_ = ""; + } + + switch (token.type_) { + case tokenObjectBegin: + successful = readObject(token); + currentValue().setOffsetLimit(current_ - begin_); + break; + case tokenArrayBegin: + successful = readArray(token); + currentValue().setOffsetLimit(current_ - begin_); + break; + case tokenNumber: + successful = decodeNumber(token); + break; + case tokenString: + successful = decodeString(token); + break; + case tokenTrue: + { + Value v(true); + currentValue().swapPayload(v); + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + } + break; + case tokenFalse: + { + Value v(false); + currentValue().swapPayload(v); + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + } + break; + case tokenNull: + { + Value v; + currentValue().swapPayload(v); + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + } + break; + case tokenArraySeparator: + case tokenObjectEnd: + case tokenArrayEnd: + if (features_.allowDroppedNullPlaceholders_) { + // "Un-read" the current token and mark the current value as a null + // token. + current_--; + Value v; + currentValue().swapPayload(v); + currentValue().setOffsetStart(current_ - begin_ - 1); + currentValue().setOffsetLimit(current_ - begin_); + break; + } // else, fall through ... + default: + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + return addError("Syntax error: value, object or array expected.", token); + } + + if (collectComments_) { + lastValueEnd_ = current_; + lastValue_ = ¤tValue(); + } + + --stackDepth_; + return successful; +} + +void OurReader::skipCommentTokens(Token& token) { + if (features_.allowComments_) { + do { + readToken(token); + } while (token.type_ == tokenComment); + } else { + readToken(token); + } +} + +bool OurReader::readToken(Token& token) { + skipSpaces(); + token.start_ = current_; + Char c = getNextChar(); + bool ok = true; + switch (c) { + case '{': + token.type_ = tokenObjectBegin; + break; + case '}': + token.type_ = tokenObjectEnd; + break; + case '[': + token.type_ = tokenArrayBegin; + break; + case ']': + token.type_ = tokenArrayEnd; + break; + case '"': + token.type_ = tokenString; + ok = readString(); + break; + case '\'': + if (features_.allowSingleQuotes_) { + token.type_ = tokenString; + ok = readStringSingleQuote(); + break; + } // else continue + case '/': + token.type_ = tokenComment; + ok = readComment(); + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '-': + token.type_ = tokenNumber; + readNumber(); + break; + case 't': + token.type_ = tokenTrue; + ok = match("rue", 3); + break; + case 'f': + token.type_ = tokenFalse; + ok = match("alse", 4); + break; + case 'n': + token.type_ = tokenNull; + ok = match("ull", 3); + break; + case ',': + token.type_ = tokenArraySeparator; + break; + case ':': + token.type_ = tokenMemberSeparator; + break; + case 0: + token.type_ = tokenEndOfStream; + break; + default: + ok = false; + break; + } + if (!ok) + token.type_ = tokenError; + token.end_ = current_; + return true; +} + +void OurReader::skipSpaces() { + while (current_ != end_) { + Char c = *current_; + if (c == ' ' || c == '\t' || c == '\r' || c == '\n') + ++current_; + else + break; + } +} + +bool OurReader::match(Location pattern, int patternLength) { + if (end_ - current_ < patternLength) + return false; + int index = patternLength; + while (index--) + if (current_[index] != pattern[index]) + return false; + current_ += patternLength; + return true; +} + +bool OurReader::readComment() { + Location commentBegin = current_ - 1; + Char c = getNextChar(); + bool successful = false; + if (c == '*') + successful = readCStyleComment(); + else if (c == '/') + successful = readCppStyleComment(); + if (!successful) + return false; + + if (collectComments_) { + CommentPlacement placement = commentBefore; + if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) { + if (c != '*' || !containsNewLine(commentBegin, current_)) + placement = commentAfterOnSameLine; + } + + addComment(commentBegin, current_, placement); + } + return true; +} + +void +OurReader::addComment(Location begin, Location end, CommentPlacement placement) { + assert(collectComments_); + const std::string& normalized = normalizeEOL(begin, end); + if (placement == commentAfterOnSameLine) { + assert(lastValue_ != 0); + lastValue_->setComment(normalized, placement); + } else { + commentsBefore_ += normalized; + } +} + +bool OurReader::readCStyleComment() { + while (current_ != end_) { + Char c = getNextChar(); + if (c == '*' && *current_ == '/') + break; + } + return getNextChar() == '/'; +} + +bool OurReader::readCppStyleComment() { + while (current_ != end_) { + Char c = getNextChar(); + if (c == '\n') + break; + if (c == '\r') { + // Consume DOS EOL. It will be normalized in addComment. + if (current_ != end_ && *current_ == '\n') + getNextChar(); + // Break on Moc OS 9 EOL. + break; + } + } + return true; +} + +void OurReader::readNumber() { + const char *p = current_; + char c = '0'; // stopgap for already consumed character + // integral part + while (c >= '0' && c <= '9') + c = (current_ = p) < end_ ? *p++ : 0; + // fractional part + if (c == '.') { + c = (current_ = p) < end_ ? *p++ : 0; + while (c >= '0' && c <= '9') + c = (current_ = p) < end_ ? *p++ : 0; + } + // exponential part + if (c == 'e' || c == 'E') { + c = (current_ = p) < end_ ? *p++ : 0; + if (c == '+' || c == '-') + c = (current_ = p) < end_ ? *p++ : 0; + while (c >= '0' && c <= '9') + c = (current_ = p) < end_ ? *p++ : 0; + } +} +bool OurReader::readString() { + Char c = 0; + while (current_ != end_) { + c = getNextChar(); + if (c == '\\') + getNextChar(); + else if (c == '"') + break; + } + return c == '"'; +} + + +bool OurReader::readStringSingleQuote() { + Char c = 0; + while (current_ != end_) { + c = getNextChar(); + if (c == '\\') + getNextChar(); + else if (c == '\'') + break; + } + return c == '\''; +} + +bool OurReader::readObject(Token& tokenStart) { + Token tokenName; + std::string name; + Value init(objectValue); + currentValue().swapPayload(init); + currentValue().setOffsetStart(tokenStart.start_ - begin_); + while (readToken(tokenName)) { + bool initialTokenOk = true; + while (tokenName.type_ == tokenComment && initialTokenOk) + initialTokenOk = readToken(tokenName); + if (!initialTokenOk) + break; + if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object + return true; + name = ""; + if (tokenName.type_ == tokenString) { + if (!decodeString(tokenName, name)) + return recoverFromError(tokenObjectEnd); + } else if (tokenName.type_ == tokenNumber && features_.allowNumericKeys_) { + Value numberName; + if (!decodeNumber(tokenName, numberName)) + return recoverFromError(tokenObjectEnd); + name = numberName.asString(); + } else { + break; + } + + Token colon; + if (!readToken(colon) || colon.type_ != tokenMemberSeparator) { + return addErrorAndRecover( + "Missing ':' after object member name", colon, tokenObjectEnd); + } + if (name.length() >= (1U<<30)) throwRuntimeError("keylength >= 2^30"); + if (features_.rejectDupKeys_ && currentValue().isMember(name)) { + std::string msg = "Duplicate key: '" + name + "'"; + return addErrorAndRecover( + msg, tokenName, tokenObjectEnd); + } + Value& value = currentValue()[name]; + nodes_.push(&value); + bool ok = readValue(); + nodes_.pop(); + if (!ok) // error already set + return recoverFromError(tokenObjectEnd); + + Token comma; + if (!readToken(comma) || + (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator && + comma.type_ != tokenComment)) { + return addErrorAndRecover( + "Missing ',' or '}' in object declaration", comma, tokenObjectEnd); + } + bool finalizeTokenOk = true; + while (comma.type_ == tokenComment && finalizeTokenOk) + finalizeTokenOk = readToken(comma); + if (comma.type_ == tokenObjectEnd) + return true; + } + return addErrorAndRecover( + "Missing '}' or object member name", tokenName, tokenObjectEnd); +} + +bool OurReader::readArray(Token& tokenStart) { + Value init(arrayValue); + currentValue().swapPayload(init); + currentValue().setOffsetStart(tokenStart.start_ - begin_); + skipSpaces(); + if (*current_ == ']') // empty array + { + Token endArray; + readToken(endArray); + return true; + } + int index = 0; + for (;;) { + Value& value = currentValue()[index++]; + nodes_.push(&value); + bool ok = readValue(); + nodes_.pop(); + if (!ok) // error already set + return recoverFromError(tokenArrayEnd); + + Token token; + // Accept Comment after last item in the array. + ok = readToken(token); + while (token.type_ == tokenComment && ok) { + ok = readToken(token); + } + bool badTokenType = + (token.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd); + if (!ok || badTokenType) { + return addErrorAndRecover( + "Missing ',' or ']' in array declaration", token, tokenArrayEnd); + } + if (token.type_ == tokenArrayEnd) + break; + } + return true; +} + +bool OurReader::decodeNumber(Token& token) { + Value decoded; + if (!decodeNumber(token, decoded)) + return false; + currentValue().swapPayload(decoded); + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + return true; +} + +bool OurReader::decodeNumber(Token& token, Value& decoded) { + // Attempts to parse the number as an integer. If the number is + // larger than the maximum supported value of an integer then + // we decode the number as a double. + Location current = token.start_; + bool isNegative = *current == '-'; + if (isNegative) + ++current; + // TODO: Help the compiler do the div and mod at compile time or get rid of them. + Value::LargestUInt maxIntegerValue = + isNegative ? Value::LargestUInt(-Value::minLargestInt) + : Value::maxLargestUInt; + Value::LargestUInt threshold = maxIntegerValue / 10; + Value::LargestUInt value = 0; + while (current < token.end_) { + Char c = *current++; + if (c < '0' || c > '9') + return decodeDouble(token, decoded); + Value::UInt digit(c - '0'); + if (value >= threshold) { + // We've hit or exceeded the max value divided by 10 (rounded down). If + // a) we've only just touched the limit, b) this is the last digit, and + // c) it's small enough to fit in that rounding delta, we're okay. + // Otherwise treat this number as a double to avoid overflow. + if (value > threshold || current != token.end_ || + digit > maxIntegerValue % 10) { + return decodeDouble(token, decoded); + } + } + value = value * 10 + digit; + } + if (isNegative) + decoded = -Value::LargestInt(value); + else if (value <= Value::LargestUInt(Value::maxInt)) + decoded = Value::LargestInt(value); + else + decoded = value; + return true; +} + +bool OurReader::decodeDouble(Token& token) { + Value decoded; + if (!decodeDouble(token, decoded)) + return false; + currentValue().swapPayload(decoded); + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + return true; +} + +bool OurReader::decodeDouble(Token& token, Value& decoded) { + double value = 0; + const int bufferSize = 32; + int count; + int length = int(token.end_ - token.start_); + + // Sanity check to avoid buffer overflow exploits. + if (length < 0) { + return addError("Unable to parse token length", token); + } + + // Avoid using a string constant for the format control string given to + // sscanf, as this can cause hard to debug crashes on OS X. See here for more + // info: + // + // http://developer.apple.com/library/mac/#DOCUMENTATION/DeveloperTools/gcc-4.0.1/gcc/Incompatibilities.html + char format[] = "%lf"; + + if (length <= bufferSize) { + Char buffer[bufferSize + 1]; + memcpy(buffer, token.start_, length); + buffer[length] = 0; + count = sscanf(buffer, format, &value); + } else { + std::string buffer(token.start_, token.end_); + count = sscanf(buffer.c_str(), format, &value); + } + + if (count != 1) + return addError("'" + std::string(token.start_, token.end_) + + "' is not a number.", + token); + decoded = value; + return true; +} + +bool OurReader::decodeString(Token& token) { + std::string decoded_string; + if (!decodeString(token, decoded_string)) + return false; + Value decoded(decoded_string); + currentValue().swapPayload(decoded); + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + return true; +} + +bool OurReader::decodeString(Token& token, std::string& decoded) { + decoded.reserve(token.end_ - token.start_ - 2); + Location current = token.start_ + 1; // skip '"' + Location end = token.end_ - 1; // do not include '"' + while (current != end) { + Char c = *current++; + if (c == '"') + break; + else if (c == '\\') { + if (current == end) + return addError("Empty escape sequence in string", token, current); + Char escape = *current++; + switch (escape) { + case '"': + decoded += '"'; + break; + case '/': + decoded += '/'; + break; + case '\\': + decoded += '\\'; + break; + case 'b': + decoded += '\b'; + break; + case 'f': + decoded += '\f'; + break; + case 'n': + decoded += '\n'; + break; + case 'r': + decoded += '\r'; + break; + case 't': + decoded += '\t'; + break; + case 'u': { + unsigned int unicode; + if (!decodeUnicodeCodePoint(token, current, end, unicode)) + return false; + decoded += codePointToUTF8(unicode); + } break; + default: + return addError("Bad escape sequence in string", token, current); + } + } else { + decoded += c; + } + } + return true; +} + +bool OurReader::decodeUnicodeCodePoint(Token& token, + Location& current, + Location end, + unsigned int& unicode) { + + if (!decodeUnicodeEscapeSequence(token, current, end, unicode)) + return false; + if (unicode >= 0xD800 && unicode <= 0xDBFF) { + // surrogate pairs + if (end - current < 6) + return addError( + "additional six characters expected to parse unicode surrogate pair.", + token, + current); + unsigned int surrogatePair; + if (*(current++) == '\\' && *(current++) == 'u') { + if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) { + unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF); + } else + return false; + } else + return addError("expecting another \\u token to begin the second half of " + "a unicode surrogate pair", + token, + current); + } + return true; +} + +bool OurReader::decodeUnicodeEscapeSequence(Token& token, + Location& current, + Location end, + unsigned int& unicode) { + if (end - current < 4) + return addError( + "Bad unicode escape sequence in string: four digits expected.", + token, + current); + unicode = 0; + for (int index = 0; index < 4; ++index) { + Char c = *current++; + unicode *= 16; + if (c >= '0' && c <= '9') + unicode += c - '0'; + else if (c >= 'a' && c <= 'f') + unicode += c - 'a' + 10; + else if (c >= 'A' && c <= 'F') + unicode += c - 'A' + 10; + else + return addError( + "Bad unicode escape sequence in string: hexadecimal digit expected.", + token, + current); + } + return true; +} + +bool +OurReader::addError(const std::string& message, Token& token, Location extra) { + ErrorInfo info; + info.token_ = token; + info.message_ = message; + info.extra_ = extra; + errors_.push_back(info); + return false; +} + +bool OurReader::recoverFromError(TokenType skipUntilToken) { + int errorCount = int(errors_.size()); + Token skip; + for (;;) { + if (!readToken(skip)) + errors_.resize(errorCount); // discard errors caused by recovery + if (skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream) + break; + } + errors_.resize(errorCount); + return false; +} + +bool OurReader::addErrorAndRecover(const std::string& message, + Token& token, + TokenType skipUntilToken) { + addError(message, token); + return recoverFromError(skipUntilToken); +} + +Value& OurReader::currentValue() { return *(nodes_.top()); } + +OurReader::Char OurReader::getNextChar() { + if (current_ == end_) + return 0; + return *current_++; +} + +void OurReader::getLocationLineAndColumn(Location location, + int& line, + int& column) const { + Location current = begin_; + Location lastLineStart = current; + line = 0; + while (current < location && current != end_) { + Char c = *current++; + if (c == '\r') { + if (*current == '\n') + ++current; + lastLineStart = current; + ++line; + } else if (c == '\n') { + lastLineStart = current; + ++line; + } + } + // column & line start at 1 + column = int(location - lastLineStart) + 1; + ++line; +} + +std::string OurReader::getLocationLineAndColumn(Location location) const { + int line, column; + getLocationLineAndColumn(location, line, column); + char buffer[18 + 16 + 16 + 1]; +#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) +#if defined(WINCE) + _snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column); +#else + sprintf_s(buffer, sizeof(buffer), "Line %d, Column %d", line, column); +#endif +#else + snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column); +#endif + return buffer; +} + +std::string OurReader::getFormattedErrorMessages() const { + std::string formattedMessage; + for (Errors::const_iterator itError = errors_.begin(); + itError != errors_.end(); + ++itError) { + const ErrorInfo& error = *itError; + formattedMessage += + "* " + getLocationLineAndColumn(error.token_.start_) + "\n"; + formattedMessage += " " + error.message_ + "\n"; + if (error.extra_) + formattedMessage += + "See " + getLocationLineAndColumn(error.extra_) + " for detail.\n"; + } + return formattedMessage; +} + +std::vector OurReader::getStructuredErrors() const { + std::vector allErrors; + for (Errors::const_iterator itError = errors_.begin(); + itError != errors_.end(); + ++itError) { + const ErrorInfo& error = *itError; + OurReader::StructuredError structured; + structured.offset_start = error.token_.start_ - begin_; + structured.offset_limit = error.token_.end_ - begin_; + structured.message = error.message_; + allErrors.push_back(structured); + } + return allErrors; +} + +bool OurReader::pushError(const Value& value, const std::string& message) { + size_t length = end_ - begin_; + if(value.getOffsetStart() > length + || value.getOffsetLimit() > length) + return false; + Token token; + token.type_ = tokenError; + token.start_ = begin_ + value.getOffsetStart(); + token.end_ = end_ + value.getOffsetLimit(); + ErrorInfo info; + info.token_ = token; + info.message_ = message; + info.extra_ = 0; + errors_.push_back(info); + return true; +} + +bool OurReader::pushError(const Value& value, const std::string& message, const Value& extra) { + size_t length = end_ - begin_; + if(value.getOffsetStart() > length + || value.getOffsetLimit() > length + || extra.getOffsetLimit() > length) + return false; + Token token; + token.type_ = tokenError; + token.start_ = begin_ + value.getOffsetStart(); + token.end_ = begin_ + value.getOffsetLimit(); + ErrorInfo info; + info.token_ = token; + info.message_ = message; + info.extra_ = begin_ + extra.getOffsetStart(); + errors_.push_back(info); + return true; +} + +bool OurReader::good() const { + return !errors_.size(); +} + + +class OurCharReader : public CharReader { + bool const collectComments_; + OurReader reader_; +public: + OurCharReader( + bool collectComments, + OurFeatures const& features) + : collectComments_(collectComments) + , reader_(features) + {} + virtual bool parse( + char const* beginDoc, char const* endDoc, + Value* root, std::string* errs) { + bool ok = reader_.parse(beginDoc, endDoc, *root, collectComments_); + if (errs) { + *errs = reader_.getFormattedErrorMessages(); + } + return ok; + } +}; + +CharReaderBuilder::CharReaderBuilder() +{ + setDefaults(&settings_); +} +CharReaderBuilder::~CharReaderBuilder() +{} +CharReader* CharReaderBuilder::newCharReader() const +{ + bool collectComments = settings_["collectComments"].asBool(); + OurFeatures features = OurFeatures::all(); + features.allowComments_ = settings_["allowComments"].asBool(); + features.strictRoot_ = settings_["strictRoot"].asBool(); + features.allowDroppedNullPlaceholders_ = settings_["allowDroppedNullPlaceholders"].asBool(); + features.allowNumericKeys_ = settings_["allowNumericKeys"].asBool(); + features.allowSingleQuotes_ = settings_["allowSingleQuotes"].asBool(); + features.stackLimit_ = settings_["stackLimit"].asInt(); + features.failIfExtra_ = settings_["failIfExtra"].asBool(); + features.rejectDupKeys_ = settings_["rejectDupKeys"].asBool(); + return new OurCharReader(collectComments, features); +} +static void getValidReaderKeys(std::set* valid_keys) +{ + valid_keys->clear(); + valid_keys->insert("collectComments"); + valid_keys->insert("allowComments"); + valid_keys->insert("strictRoot"); + valid_keys->insert("allowDroppedNullPlaceholders"); + valid_keys->insert("allowNumericKeys"); + valid_keys->insert("allowSingleQuotes"); + valid_keys->insert("stackLimit"); + valid_keys->insert("failIfExtra"); + valid_keys->insert("rejectDupKeys"); +} +bool CharReaderBuilder::validate(Json::Value* invalid) const +{ + Json::Value my_invalid; + if (!invalid) invalid = &my_invalid; // so we do not need to test for NULL + Json::Value& inv = *invalid; + std::set valid_keys; + getValidReaderKeys(&valid_keys); + Value::Members keys = settings_.getMemberNames(); + size_t n = keys.size(); + for (size_t i = 0; i < n; ++i) { + std::string const& key = keys[i]; + if (valid_keys.find(key) == valid_keys.end()) { + inv[key] = settings_[key]; + } + } + return 0u == inv.size(); +} +Value& CharReaderBuilder::operator[](std::string key) +{ + return settings_[key]; +} +// static +void CharReaderBuilder::strictMode(Json::Value* settings) +{ +//! [CharReaderBuilderStrictMode] + (*settings)["allowComments"] = false; + (*settings)["strictRoot"] = true; + (*settings)["allowDroppedNullPlaceholders"] = false; + (*settings)["allowNumericKeys"] = false; + (*settings)["allowSingleQuotes"] = false; + (*settings)["failIfExtra"] = true; + (*settings)["rejectDupKeys"] = true; +//! [CharReaderBuilderStrictMode] +} +// static +void CharReaderBuilder::setDefaults(Json::Value* settings) +{ +//! [CharReaderBuilderDefaults] + (*settings)["collectComments"] = true; + (*settings)["allowComments"] = true; + (*settings)["strictRoot"] = false; + (*settings)["allowDroppedNullPlaceholders"] = false; + (*settings)["allowNumericKeys"] = false; + (*settings)["allowSingleQuotes"] = false; + (*settings)["stackLimit"] = 1000; + (*settings)["failIfExtra"] = false; + (*settings)["rejectDupKeys"] = false; +//! [CharReaderBuilderDefaults] +} + +////////////////////////////////// +// global functions + +bool parseFromStream( + CharReader::Factory const& fact, std::istream& sin, + Value* root, std::string* errs) +{ + std::ostringstream ssin; + ssin << sin.rdbuf(); + std::string doc = ssin.str(); + char const* begin = doc.data(); + char const* end = begin + doc.size(); + // Note that we do not actually need a null-terminator. + CharReaderPtr const reader(fact.newCharReader()); + return reader->parse(begin, end, root, errs); +} + +std::istream& operator>>(std::istream& sin, Value& root) { + CharReaderBuilder b; + std::string errs; + bool ok = parseFromStream(b, sin, &root, &errs); + if (!ok) { + fprintf(stderr, + "Error from reader: %s", + errs.c_str()); + + throwRuntimeError("reader error"); + } + return sin; +} + +} // namespace Json + +// ////////////////////////////////////////////////////////////////////// +// End of content of file: src/lib_json/json_reader.cpp +// ////////////////////////////////////////////////////////////////////// + + + + + + +// ////////////////////////////////////////////////////////////////////// +// Beginning of content of file: src/lib_json/json_valueiterator.inl +// ////////////////////////////////////////////////////////////////////// + +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +// included by json_value.cpp + +namespace Json { + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class ValueIteratorBase +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +ValueIteratorBase::ValueIteratorBase() + : current_(), isNull_(true) { +} + +ValueIteratorBase::ValueIteratorBase( + const Value::ObjectValues::iterator& current) + : current_(current), isNull_(false) {} + +Value& ValueIteratorBase::deref() const { + return current_->second; +} + +void ValueIteratorBase::increment() { + ++current_; +} + +void ValueIteratorBase::decrement() { + --current_; +} + +ValueIteratorBase::difference_type +ValueIteratorBase::computeDistance(const SelfType& other) const { +#ifdef JSON_USE_CPPTL_SMALLMAP + return other.current_ - current_; +#else + // Iterator for null value are initialized using the default + // constructor, which initialize current_ to the default + // std::map::iterator. As begin() and end() are two instance + // of the default std::map::iterator, they can not be compared. + // To allow this, we handle this comparison specifically. + if (isNull_ && other.isNull_) { + return 0; + } + + // Usage of std::distance is not portable (does not compile with Sun Studio 12 + // RogueWave STL, + // which is the one used by default). + // Using a portable hand-made version for non random iterator instead: + // return difference_type( std::distance( current_, other.current_ ) ); + difference_type myDistance = 0; + for (Value::ObjectValues::iterator it = current_; it != other.current_; + ++it) { + ++myDistance; + } + return myDistance; +#endif +} + +bool ValueIteratorBase::isEqual(const SelfType& other) const { + if (isNull_) { + return other.isNull_; + } + return current_ == other.current_; +} + +void ValueIteratorBase::copy(const SelfType& other) { + current_ = other.current_; + isNull_ = other.isNull_; +} + +Value ValueIteratorBase::key() const { + const Value::CZString czstring = (*current_).first; + if (czstring.data()) { + if (czstring.isStaticString()) + return Value(StaticString(czstring.data())); + return Value(czstring.data(), czstring.data() + czstring.length()); + } + return Value(czstring.index()); +} + +UInt ValueIteratorBase::index() const { + const Value::CZString czstring = (*current_).first; + if (!czstring.data()) + return czstring.index(); + return Value::UInt(-1); +} + +std::string ValueIteratorBase::name() const { + char const* key; + char const* end; + key = memberName(&end); + if (!key) return std::string(); + return std::string(key, end); +} + +char const* ValueIteratorBase::memberName() const { + const char* name = (*current_).first.data(); + return name ? name : ""; +} + +char const* ValueIteratorBase::memberName(char const** end) const { + const char* name = (*current_).first.data(); + if (!name) { + *end = NULL; + return NULL; + } + *end = name + (*current_).first.length(); + return name; +} + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class ValueConstIterator +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +ValueConstIterator::ValueConstIterator() {} + +ValueConstIterator::ValueConstIterator( + const Value::ObjectValues::iterator& current) + : ValueIteratorBase(current) {} + +ValueConstIterator& ValueConstIterator:: +operator=(const ValueIteratorBase& other) { + copy(other); + return *this; +} + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class ValueIterator +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +ValueIterator::ValueIterator() {} + +ValueIterator::ValueIterator(const Value::ObjectValues::iterator& current) + : ValueIteratorBase(current) {} + +ValueIterator::ValueIterator(const ValueConstIterator& other) + : ValueIteratorBase(other) {} + +ValueIterator::ValueIterator(const ValueIterator& other) + : ValueIteratorBase(other) {} + +ValueIterator& ValueIterator::operator=(const SelfType& other) { + copy(other); + return *this; +} + +} // namespace Json + +// ////////////////////////////////////////////////////////////////////// +// End of content of file: src/lib_json/json_valueiterator.inl +// ////////////////////////////////////////////////////////////////////// + + + + + + +// ////////////////////////////////////////////////////////////////////// +// Beginning of content of file: src/lib_json/json_value.cpp +// ////////////////////////////////////////////////////////////////////// + +// Copyright 2011 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include +#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include +#include +#include +#ifdef JSON_USE_CPPTL +#include +#endif +#include // size_t +#include // min() + +#define JSON_ASSERT_UNREACHABLE assert(false) + +namespace Json { + +// This is a walkaround to avoid the static initialization of Value::null. +// kNull must be word-aligned to avoid crashing on ARM. We use an alignment of +// 8 (instead of 4) as a bit of future-proofing. +#if defined(__ARMEL__) +#define ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment))) +#else +#define ALIGNAS(byte_alignment) +#endif +static const unsigned char ALIGNAS(8) kNull[sizeof(Value)] = { 0 }; +const unsigned char& kNullRef = kNull[0]; +const Value& Value::null = reinterpret_cast(kNullRef); +const Value& Value::nullRef = null; + +const Int Value::minInt = Int(~(UInt(-1) / 2)); +const Int Value::maxInt = Int(UInt(-1) / 2); +const UInt Value::maxUInt = UInt(-1); +#if defined(JSON_HAS_INT64) +const Int64 Value::minInt64 = Int64(~(UInt64(-1) / 2)); +const Int64 Value::maxInt64 = Int64(UInt64(-1) / 2); +const UInt64 Value::maxUInt64 = UInt64(-1); +// The constant is hard-coded because some compiler have trouble +// converting Value::maxUInt64 to a double correctly (AIX/xlC). +// Assumes that UInt64 is a 64 bits integer. +static const double maxUInt64AsDouble = 18446744073709551615.0; +#endif // defined(JSON_HAS_INT64) +const LargestInt Value::minLargestInt = LargestInt(~(LargestUInt(-1) / 2)); +const LargestInt Value::maxLargestInt = LargestInt(LargestUInt(-1) / 2); +const LargestUInt Value::maxLargestUInt = LargestUInt(-1); + +#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) +template +static inline bool InRange(double d, T min, U max) { + return d >= min && d <= max; +} +#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) +static inline double integerToDouble(Json::UInt64 value) { + return static_cast(Int64(value / 2)) * 2.0 + Int64(value & 1); +} + +template static inline double integerToDouble(T value) { + return static_cast(value); +} + +template +static inline bool InRange(double d, T min, U max) { + return d >= integerToDouble(min) && d <= integerToDouble(max); +} +#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + +/** Duplicates the specified string value. + * @param value Pointer to the string to duplicate. Must be zero-terminated if + * length is "unknown". + * @param length Length of the value. if equals to unknown, then it will be + * computed using strlen(value). + * @return Pointer on the duplicate instance of string. + */ +static inline char* duplicateStringValue(const char* value, + size_t length) { + // Avoid an integer overflow in the call to malloc below by limiting length + // to a sane value. + if (length >= (size_t)Value::maxInt) + length = Value::maxInt - 1; + + char* newString = static_cast(malloc(length + 1)); + if (newString == NULL) { + throwRuntimeError( + "in Json::Value::duplicateStringValue(): " + "Failed to allocate string value buffer"); + } + memcpy(newString, value, length); + newString[length] = 0; + return newString; +} + +/* Record the length as a prefix. + */ +static inline char* duplicateAndPrefixStringValue( + const char* value, + unsigned int length) +{ + // Avoid an integer overflow in the call to malloc below by limiting length + // to a sane value. + JSON_ASSERT_MESSAGE(length <= (unsigned)Value::maxInt - sizeof(unsigned) - 1U, + "in Json::Value::duplicateAndPrefixStringValue(): " + "length too big for prefixing"); + unsigned actualLength = length + sizeof(unsigned) + 1U; + char* newString = static_cast(malloc(actualLength)); + if (newString == 0) { + throwRuntimeError( + "in Json::Value::duplicateAndPrefixStringValue(): " + "Failed to allocate string value buffer"); + } + *reinterpret_cast(newString) = length; + memcpy(newString + sizeof(unsigned), value, length); + newString[actualLength - 1U] = 0; // to avoid buffer over-run accidents by users later + return newString; +} +inline static void decodePrefixedString( + bool isPrefixed, char const* prefixed, + unsigned* length, char const** value) +{ + if (!isPrefixed) { + *length = strlen(prefixed); + *value = prefixed; + } else { + *length = *reinterpret_cast(prefixed); + *value = prefixed + sizeof(unsigned); + } +} +/** Free the string duplicated by duplicateStringValue()/duplicateAndPrefixStringValue(). + */ +static inline void releaseStringValue(char* value) { free(value); } + +} // namespace Json + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ValueInternals... +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +#if !defined(JSON_IS_AMALGAMATION) + +#include "json_valueiterator.inl" +#endif // if !defined(JSON_IS_AMALGAMATION) + +namespace Json { + +class JSON_API Exception : public std::exception { +public: + Exception(std::string const& msg); + virtual ~Exception() throw(); + virtual char const* what() const throw(); +protected: + std::string const msg_; +}; +class JSON_API RuntimeError : public Exception { +public: + RuntimeError(std::string const& msg); +}; +class JSON_API LogicError : public Exception { +public: + LogicError(std::string const& msg); +}; + +Exception::Exception(std::string const& msg) + : msg_(msg) +{} +Exception::~Exception() throw() +{} +char const* Exception::what() const throw() +{ + return msg_.c_str(); +} +RuntimeError::RuntimeError(std::string const& msg) + : Exception(msg) +{} +LogicError::LogicError(std::string const& msg) + : Exception(msg) +{} +void throwRuntimeError(std::string const& msg) +{ + throw RuntimeError(msg); +} +void throwLogicError(std::string const& msg) +{ + throw LogicError(msg); +} + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class Value::CommentInfo +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +Value::CommentInfo::CommentInfo() : comment_(0) {} + +Value::CommentInfo::~CommentInfo() { + if (comment_) + releaseStringValue(comment_); +} + +void Value::CommentInfo::setComment(const char* text, size_t len) { + if (comment_) { + releaseStringValue(comment_); + comment_ = 0; + } + JSON_ASSERT(text != 0); + JSON_ASSERT_MESSAGE( + text[0] == '\0' || text[0] == '/', + "in Json::Value::setComment(): Comments must start with /"); + // It seems that /**/ style comments are acceptable as well. + comment_ = duplicateStringValue(text, len); +} + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class Value::CZString +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +// Notes: policy_ indicates if the string was allocated when +// a string is stored. + +Value::CZString::CZString(ArrayIndex index) : cstr_(0), index_(index) {} + +Value::CZString::CZString(char const* str, unsigned length, DuplicationPolicy allocate) + : cstr_(str) +{ + // allocate != duplicate + storage_.policy_ = allocate; + storage_.length_ = length; +} + +Value::CZString::CZString(const CZString& other) + : cstr_(other.storage_.policy_ != noDuplication && other.cstr_ != 0 + ? duplicateStringValue(other.cstr_, other.storage_.length_) + : other.cstr_) +{ + storage_.policy_ = (other.cstr_ + ? (other.storage_.policy_ == noDuplication + ? noDuplication : duplicate) + : other.storage_.policy_); + storage_.length_ = other.storage_.length_; +} + +Value::CZString::~CZString() { + if (cstr_ && storage_.policy_ == duplicate) + releaseStringValue(const_cast(cstr_)); +} + +void Value::CZString::swap(CZString& other) { + std::swap(cstr_, other.cstr_); + std::swap(index_, other.index_); +} + +Value::CZString& Value::CZString::operator=(CZString other) { + swap(other); + return *this; +} + +bool Value::CZString::operator<(const CZString& other) const { + if (!cstr_) return index_ < other.index_; + //return strcmp(cstr_, other.cstr_) < 0; + // Assume both are strings. + unsigned this_len = this->storage_.length_; + unsigned other_len = other.storage_.length_; + unsigned min_len = std::min(this_len, other_len); + int comp = memcmp(this->cstr_, other.cstr_, min_len); + if (comp < 0) return true; + if (comp > 0) return false; + return (this_len < other_len); +} + +bool Value::CZString::operator==(const CZString& other) const { + if (!cstr_) return index_ == other.index_; + //return strcmp(cstr_, other.cstr_) == 0; + // Assume both are strings. + unsigned this_len = this->storage_.length_; + unsigned other_len = other.storage_.length_; + if (this_len != other_len) return false; + int comp = memcmp(this->cstr_, other.cstr_, this_len); + return comp == 0; +} + +ArrayIndex Value::CZString::index() const { return index_; } + +//const char* Value::CZString::c_str() const { return cstr_; } +const char* Value::CZString::data() const { return cstr_; } +unsigned Value::CZString::length() const { return storage_.length_; } +bool Value::CZString::isStaticString() const { return storage_.policy_ == noDuplication; } + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class Value::Value +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +/*! \internal Default constructor initialization must be equivalent to: + * memset( this, 0, sizeof(Value) ) + * This optimization is used in ValueInternalMap fast allocator. + */ +Value::Value(ValueType type) { + initBasic(type); + switch (type) { + case nullValue: + break; + case intValue: + case uintValue: + value_.int_ = 0; + break; + case realValue: + value_.real_ = 0.0; + break; + case stringValue: + value_.string_ = 0; + break; + case arrayValue: + case objectValue: + value_.map_ = new ObjectValues(); + break; + case booleanValue: + value_.bool_ = false; + break; + default: + JSON_ASSERT_UNREACHABLE; + } +} + +Value::Value(Int value) { + initBasic(intValue); + value_.int_ = value; +} + +Value::Value(UInt value) { + initBasic(uintValue); + value_.uint_ = value; +} +#if defined(JSON_HAS_INT64) +Value::Value(Int64 value) { + initBasic(intValue); + value_.int_ = value; +} +Value::Value(UInt64 value) { + initBasic(uintValue); + value_.uint_ = value; +} +#endif // defined(JSON_HAS_INT64) + +Value::Value(double value) { + initBasic(realValue); + value_.real_ = value; +} + +Value::Value(const char* value) { + initBasic(stringValue, true); + value_.string_ = duplicateAndPrefixStringValue(value, static_cast(strlen(value))); +} + +Value::Value(const char* beginValue, const char* endValue) { + initBasic(stringValue, true); + value_.string_ = + duplicateAndPrefixStringValue(beginValue, static_cast(endValue - beginValue)); +} + +Value::Value(const std::string& value) { + initBasic(stringValue, true); + value_.string_ = + duplicateAndPrefixStringValue(value.data(), static_cast(value.length())); +} + +Value::Value(const StaticString& value) { + initBasic(stringValue); + value_.string_ = const_cast(value.c_str()); +} + +#ifdef JSON_USE_CPPTL +Value::Value(const CppTL::ConstString& value) { + initBasic(stringValue, true); + value_.string_ = duplicateAndPrefixStringValue(value, static_cast(value.length())); +} +#endif + +Value::Value(bool value) { + initBasic(booleanValue); + value_.bool_ = value; +} + +Value::Value(Value const& other) + : type_(other.type_), allocated_(false) + , + comments_(0), start_(other.start_), limit_(other.limit_) +{ + switch (type_) { + case nullValue: + case intValue: + case uintValue: + case realValue: + case booleanValue: + value_ = other.value_; + break; + case stringValue: + if (other.value_.string_ && other.allocated_) { + unsigned len; + char const* str; + decodePrefixedString(other.allocated_, other.value_.string_, + &len, &str); + value_.string_ = duplicateAndPrefixStringValue(str, len); + allocated_ = true; + } else { + value_.string_ = other.value_.string_; + allocated_ = false; + } + break; + case arrayValue: + case objectValue: + value_.map_ = new ObjectValues(*other.value_.map_); + break; + default: + JSON_ASSERT_UNREACHABLE; + } + if (other.comments_) { + comments_ = new CommentInfo[numberOfCommentPlacement]; + for (int comment = 0; comment < numberOfCommentPlacement; ++comment) { + const CommentInfo& otherComment = other.comments_[comment]; + if (otherComment.comment_) + comments_[comment].setComment( + otherComment.comment_, strlen(otherComment.comment_)); + } + } +} + +Value::~Value() { + switch (type_) { + case nullValue: + case intValue: + case uintValue: + case realValue: + case booleanValue: + break; + case stringValue: + if (allocated_) + releaseStringValue(value_.string_); + break; + case arrayValue: + case objectValue: + delete value_.map_; + break; + default: + JSON_ASSERT_UNREACHABLE; + } + + if (comments_) + delete[] comments_; +} + +Value& Value::operator=(Value other) { + swap(other); + return *this; +} + +void Value::swapPayload(Value& other) { + ValueType temp = type_; + type_ = other.type_; + other.type_ = temp; + std::swap(value_, other.value_); + int temp2 = allocated_; + allocated_ = other.allocated_; + other.allocated_ = temp2; +} + +void Value::swap(Value& other) { + swapPayload(other); + std::swap(comments_, other.comments_); + std::swap(start_, other.start_); + std::swap(limit_, other.limit_); +} + +ValueType Value::type() const { return type_; } + +int Value::compare(const Value& other) const { + if (*this < other) + return -1; + if (*this > other) + return 1; + return 0; +} + +bool Value::operator<(const Value& other) const { + int typeDelta = type_ - other.type_; + if (typeDelta) + return typeDelta < 0 ? true : false; + switch (type_) { + case nullValue: + return false; + case intValue: + return value_.int_ < other.value_.int_; + case uintValue: + return value_.uint_ < other.value_.uint_; + case realValue: + return value_.real_ < other.value_.real_; + case booleanValue: + return value_.bool_ < other.value_.bool_; + case stringValue: + { + if ((value_.string_ == 0) || (other.value_.string_ == 0)) { + if (other.value_.string_) return true; + else return false; + } + unsigned this_len; + unsigned other_len; + char const* this_str; + char const* other_str; + decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str); + decodePrefixedString(other.allocated_, other.value_.string_, &other_len, &other_str); + unsigned min_len = std::min(this_len, other_len); + int comp = memcmp(this_str, other_str, min_len); + if (comp < 0) return true; + if (comp > 0) return false; + return (this_len < other_len); + } + case arrayValue: + case objectValue: { + int delta = int(value_.map_->size() - other.value_.map_->size()); + if (delta) + return delta < 0; + return (*value_.map_) < (*other.value_.map_); + } + default: + JSON_ASSERT_UNREACHABLE; + } + return false; // unreachable +} + +bool Value::operator<=(const Value& other) const { return !(other < *this); } + +bool Value::operator>=(const Value& other) const { return !(*this < other); } + +bool Value::operator>(const Value& other) const { return other < *this; } + +bool Value::operator==(const Value& other) const { + // if ( type_ != other.type_ ) + // GCC 2.95.3 says: + // attempt to take address of bit-field structure member `Json::Value::type_' + // Beats me, but a temp solves the problem. + int temp = other.type_; + if (type_ != temp) + return false; + switch (type_) { + case nullValue: + return true; + case intValue: + return value_.int_ == other.value_.int_; + case uintValue: + return value_.uint_ == other.value_.uint_; + case realValue: + return value_.real_ == other.value_.real_; + case booleanValue: + return value_.bool_ == other.value_.bool_; + case stringValue: + { + if ((value_.string_ == 0) || (other.value_.string_ == 0)) { + return (value_.string_ == other.value_.string_); + } + unsigned this_len; + unsigned other_len; + char const* this_str; + char const* other_str; + decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str); + decodePrefixedString(other.allocated_, other.value_.string_, &other_len, &other_str); + if (this_len != other_len) return false; + int comp = memcmp(this_str, other_str, this_len); + return comp == 0; + } + case arrayValue: + case objectValue: + return value_.map_->size() == other.value_.map_->size() && + (*value_.map_) == (*other.value_.map_); + default: + JSON_ASSERT_UNREACHABLE; + } + return false; // unreachable +} + +bool Value::operator!=(const Value& other) const { return !(*this == other); } + +const char* Value::asCString() const { + JSON_ASSERT_MESSAGE(type_ == stringValue, + "in Json::Value::asCString(): requires stringValue"); + if (value_.string_ == 0) return 0; + unsigned this_len; + char const* this_str; + decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str); + return this_str; +} + +bool Value::getString(char const** str, char const** end) const { + if (type_ != stringValue) return false; + if (value_.string_ == 0) return false; + unsigned length; + decodePrefixedString(this->allocated_, this->value_.string_, &length, str); + *end = *str + length; + return true; +} + +std::string Value::asString() const { + switch (type_) { + case nullValue: + return ""; + case stringValue: + { + if (value_.string_ == 0) return ""; + unsigned this_len; + char const* this_str; + decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str); + return std::string(this_str, this_len); + } + case booleanValue: + return value_.bool_ ? "true" : "false"; + case intValue: + return valueToString(value_.int_); + case uintValue: + return valueToString(value_.uint_); + case realValue: + return valueToString(value_.real_); + default: + JSON_FAIL_MESSAGE("Type is not convertible to string"); + } +} + +#ifdef JSON_USE_CPPTL +CppTL::ConstString Value::asConstString() const { + unsigned len; + char const* str; + decodePrefixedString(allocated_, value_.string_, + &len, &str); + return CppTL::ConstString(str, len); +} +#endif + +Value::Int Value::asInt() const { + switch (type_) { + case intValue: + JSON_ASSERT_MESSAGE(isInt(), "LargestInt out of Int range"); + return Int(value_.int_); + case uintValue: + JSON_ASSERT_MESSAGE(isInt(), "LargestUInt out of Int range"); + return Int(value_.uint_); + case realValue: + JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt, maxInt), + "double out of Int range"); + return Int(value_.real_); + case nullValue: + return 0; + case booleanValue: + return value_.bool_ ? 1 : 0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to Int."); +} + +Value::UInt Value::asUInt() const { + switch (type_) { + case intValue: + JSON_ASSERT_MESSAGE(isUInt(), "LargestInt out of UInt range"); + return UInt(value_.int_); + case uintValue: + JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range"); + return UInt(value_.uint_); + case realValue: + JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt), + "double out of UInt range"); + return UInt(value_.real_); + case nullValue: + return 0; + case booleanValue: + return value_.bool_ ? 1 : 0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to UInt."); +} + +#if defined(JSON_HAS_INT64) + +Value::Int64 Value::asInt64() const { + switch (type_) { + case intValue: + return Int64(value_.int_); + case uintValue: + JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range"); + return Int64(value_.uint_); + case realValue: + JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64), + "double out of Int64 range"); + return Int64(value_.real_); + case nullValue: + return 0; + case booleanValue: + return value_.bool_ ? 1 : 0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to Int64."); +} + +Value::UInt64 Value::asUInt64() const { + switch (type_) { + case intValue: + JSON_ASSERT_MESSAGE(isUInt64(), "LargestInt out of UInt64 range"); + return UInt64(value_.int_); + case uintValue: + return UInt64(value_.uint_); + case realValue: + JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt64), + "double out of UInt64 range"); + return UInt64(value_.real_); + case nullValue: + return 0; + case booleanValue: + return value_.bool_ ? 1 : 0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to UInt64."); +} +#endif // if defined(JSON_HAS_INT64) + +LargestInt Value::asLargestInt() const { +#if defined(JSON_NO_INT64) + return asInt(); +#else + return asInt64(); +#endif +} + +LargestUInt Value::asLargestUInt() const { +#if defined(JSON_NO_INT64) + return asUInt(); +#else + return asUInt64(); +#endif +} + +double Value::asDouble() const { + switch (type_) { + case intValue: + return static_cast(value_.int_); + case uintValue: +#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + return static_cast(value_.uint_); +#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + return integerToDouble(value_.uint_); +#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + case realValue: + return value_.real_; + case nullValue: + return 0.0; + case booleanValue: + return value_.bool_ ? 1.0 : 0.0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to double."); +} + +float Value::asFloat() const { + switch (type_) { + case intValue: + return static_cast(value_.int_); + case uintValue: +#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + return static_cast(value_.uint_); +#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + return integerToDouble(value_.uint_); +#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + case realValue: + return static_cast(value_.real_); + case nullValue: + return 0.0; + case booleanValue: + return value_.bool_ ? 1.0f : 0.0f; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to float."); +} + +bool Value::asBool() const { + switch (type_) { + case booleanValue: + return value_.bool_; + case nullValue: + return false; + case intValue: + return value_.int_ ? true : false; + case uintValue: + return value_.uint_ ? true : false; + case realValue: + return value_.real_ ? true : false; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to bool."); +} + +bool Value::isConvertibleTo(ValueType other) const { + switch (other) { + case nullValue: + return (isNumeric() && asDouble() == 0.0) || + (type_ == booleanValue && value_.bool_ == false) || + (type_ == stringValue && asString() == "") || + (type_ == arrayValue && value_.map_->size() == 0) || + (type_ == objectValue && value_.map_->size() == 0) || + type_ == nullValue; + case intValue: + return isInt() || + (type_ == realValue && InRange(value_.real_, minInt, maxInt)) || + type_ == booleanValue || type_ == nullValue; + case uintValue: + return isUInt() || + (type_ == realValue && InRange(value_.real_, 0, maxUInt)) || + type_ == booleanValue || type_ == nullValue; + case realValue: + return isNumeric() || type_ == booleanValue || type_ == nullValue; + case booleanValue: + return isNumeric() || type_ == booleanValue || type_ == nullValue; + case stringValue: + return isNumeric() || type_ == booleanValue || type_ == stringValue || + type_ == nullValue; + case arrayValue: + return type_ == arrayValue || type_ == nullValue; + case objectValue: + return type_ == objectValue || type_ == nullValue; + } + JSON_ASSERT_UNREACHABLE; + return false; +} + +/// Number of values in array or object +ArrayIndex Value::size() const { + switch (type_) { + case nullValue: + case intValue: + case uintValue: + case realValue: + case booleanValue: + case stringValue: + return 0; + case arrayValue: // size of the array is highest index + 1 + if (!value_.map_->empty()) { + ObjectValues::const_iterator itLast = value_.map_->end(); + --itLast; + return (*itLast).first.index() + 1; + } + return 0; + case objectValue: + return ArrayIndex(value_.map_->size()); + } + JSON_ASSERT_UNREACHABLE; + return 0; // unreachable; +} + +bool Value::empty() const { + if (isNull() || isArray() || isObject()) + return size() == 0u; + else + return false; +} + +bool Value::operator!() const { return isNull(); } + +void Value::clear() { + JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue || + type_ == objectValue, + "in Json::Value::clear(): requires complex value"); + start_ = 0; + limit_ = 0; + switch (type_) { + case arrayValue: + case objectValue: + value_.map_->clear(); + break; + default: + break; + } +} + +void Value::resize(ArrayIndex newSize) { + JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue, + "in Json::Value::resize(): requires arrayValue"); + if (type_ == nullValue) + *this = Value(arrayValue); + ArrayIndex oldSize = size(); + if (newSize == 0) + clear(); + else if (newSize > oldSize) + (*this)[newSize - 1]; + else { + for (ArrayIndex index = newSize; index < oldSize; ++index) { + value_.map_->erase(index); + } + assert(size() == newSize); + } +} + +Value& Value::operator[](ArrayIndex index) { + JSON_ASSERT_MESSAGE( + type_ == nullValue || type_ == arrayValue, + "in Json::Value::operator[](ArrayIndex): requires arrayValue"); + if (type_ == nullValue) + *this = Value(arrayValue); + CZString key(index); + ObjectValues::iterator it = value_.map_->lower_bound(key); + if (it != value_.map_->end() && (*it).first == key) + return (*it).second; + + ObjectValues::value_type defaultValue(key, nullRef); + it = value_.map_->insert(it, defaultValue); + return (*it).second; +} + +Value& Value::operator[](int index) { + JSON_ASSERT_MESSAGE( + index >= 0, + "in Json::Value::operator[](int index): index cannot be negative"); + return (*this)[ArrayIndex(index)]; +} + +const Value& Value::operator[](ArrayIndex index) const { + JSON_ASSERT_MESSAGE( + type_ == nullValue || type_ == arrayValue, + "in Json::Value::operator[](ArrayIndex)const: requires arrayValue"); + if (type_ == nullValue) + return nullRef; + CZString key(index); + ObjectValues::const_iterator it = value_.map_->find(key); + if (it == value_.map_->end()) + return nullRef; + return (*it).second; +} + +const Value& Value::operator[](int index) const { + JSON_ASSERT_MESSAGE( + index >= 0, + "in Json::Value::operator[](int index) const: index cannot be negative"); + return (*this)[ArrayIndex(index)]; +} + +void Value::initBasic(ValueType type, bool allocated) { + type_ = type; + allocated_ = allocated; + comments_ = 0; + start_ = 0; + limit_ = 0; +} + +// Access an object value by name, create a null member if it does not exist. +// @pre Type of '*this' is object or null. +// @param key is null-terminated. +Value& Value::resolveReference(const char* key) { + JSON_ASSERT_MESSAGE( + type_ == nullValue || type_ == objectValue, + "in Json::Value::resolveReference(): requires objectValue"); + if (type_ == nullValue) + *this = Value(objectValue); + CZString actualKey( + key, static_cast(strlen(key)), CZString::noDuplication); // NOTE! + ObjectValues::iterator it = value_.map_->lower_bound(actualKey); + if (it != value_.map_->end() && (*it).first == actualKey) + return (*it).second; + + ObjectValues::value_type defaultValue(actualKey, nullRef); + it = value_.map_->insert(it, defaultValue); + Value& value = (*it).second; + return value; +} + +// @param key is not null-terminated. +Value& Value::resolveReference(char const* key, char const* end) +{ + JSON_ASSERT_MESSAGE( + type_ == nullValue || type_ == objectValue, + "in Json::Value::resolveReference(key, end): requires objectValue"); + if (type_ == nullValue) + *this = Value(objectValue); + CZString actualKey( + key, static_cast(end-key), CZString::duplicateOnCopy); + ObjectValues::iterator it = value_.map_->lower_bound(actualKey); + if (it != value_.map_->end() && (*it).first == actualKey) + return (*it).second; + + ObjectValues::value_type defaultValue(actualKey, nullRef); + it = value_.map_->insert(it, defaultValue); + Value& value = (*it).second; + return value; +} + +Value Value::get(ArrayIndex index, const Value& defaultValue) const { + const Value* value = &((*this)[index]); + return value == &nullRef ? defaultValue : *value; +} + +bool Value::isValidIndex(ArrayIndex index) const { return index < size(); } + +Value const* Value::find(char const* key, char const* end) const +{ + JSON_ASSERT_MESSAGE( + type_ == nullValue || type_ == objectValue, + "in Json::Value::find(key, end, found): requires objectValue or nullValue"); + if (type_ == nullValue) return NULL; + CZString actualKey(key, static_cast(end-key), CZString::noDuplication); + ObjectValues::const_iterator it = value_.map_->find(actualKey); + if (it == value_.map_->end()) return NULL; + return &(*it).second; +} +const Value& Value::operator[](const char* key) const +{ + Value const* found = find(key, key + strlen(key)); + if (!found) return nullRef; + return *found; +} +Value const& Value::operator[](std::string const& key) const +{ + Value const* found = find(key.data(), key.data() + key.length()); + if (!found) return nullRef; + return *found; +} + +Value& Value::operator[](const char* key) { + return resolveReference(key, key + strlen(key)); +} + +Value& Value::operator[](const std::string& key) { + return resolveReference(key.data(), key.data() + key.length()); +} + +Value& Value::operator[](const StaticString& key) { + return resolveReference(key.c_str()); +} + +#ifdef JSON_USE_CPPTL +Value& Value::operator[](const CppTL::ConstString& key) { + return resolveReference(key.c_str(), key.end_c_str()); +} +Value const& Value::operator[](CppTL::ConstString const& key) const +{ + Value const* found = find(key.c_str(), key.end_c_str()); + if (!found) return nullRef; + return *found; +} +#endif + +Value& Value::append(const Value& value) { return (*this)[size()] = value; } + +Value Value::get(char const* key, char const* end, Value const& defaultValue) const +{ + Value const* found = find(key, end); + return !found ? defaultValue : *found; +} +Value Value::get(char const* key, Value const& defaultValue) const +{ + return get(key, key + strlen(key), defaultValue); +} +Value Value::get(std::string const& key, Value const& defaultValue) const +{ + return get(key.data(), key.data() + key.length(), defaultValue); +} + + +bool Value::removeMember(const char* key, const char* end, Value* removed) +{ + if (type_ != objectValue) { + return false; + } + CZString actualKey(key, static_cast(end-key), CZString::noDuplication); + ObjectValues::iterator it = value_.map_->find(actualKey); + if (it == value_.map_->end()) + return false; + *removed = it->second; + value_.map_->erase(it); + return true; +} +bool Value::removeMember(const char* key, Value* removed) +{ + return removeMember(key, key + strlen(key), removed); +} +bool Value::removeMember(std::string const& key, Value* removed) +{ + return removeMember(key.data(), key.data() + key.length(), removed); +} +Value Value::removeMember(const char* key) +{ + JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == objectValue, + "in Json::Value::removeMember(): requires objectValue"); + if (type_ == nullValue) + return nullRef; + + Value removed; // null + removeMember(key, key + strlen(key), &removed); + return removed; // still null if removeMember() did nothing +} +Value Value::removeMember(const std::string& key) +{ + return removeMember(key.c_str()); +} + +bool Value::removeIndex(ArrayIndex index, Value* removed) { + if (type_ != arrayValue) { + return false; + } + CZString key(index); + ObjectValues::iterator it = value_.map_->find(key); + if (it == value_.map_->end()) { + return false; + } + *removed = it->second; + ArrayIndex oldSize = size(); + // shift left all items left, into the place of the "removed" + for (ArrayIndex i = index; i < (oldSize - 1); ++i){ + CZString key(i); + (*value_.map_)[key] = (*this)[i + 1]; + } + // erase the last one ("leftover") + CZString keyLast(oldSize - 1); + ObjectValues::iterator itLast = value_.map_->find(keyLast); + value_.map_->erase(itLast); + return true; +} + +#ifdef JSON_USE_CPPTL +Value Value::get(const CppTL::ConstString& key, + const Value& defaultValue) const { + return get(key.c_str(), key.end_c_str(), defaultValue); +} +#endif + +bool Value::isMember(char const* key, char const* end) const +{ + Value const* value = find(key, end); + return NULL != value; +} +bool Value::isMember(char const* key) const +{ + return isMember(key, key + strlen(key)); +} +bool Value::isMember(std::string const& key) const +{ + return isMember(key.data(), key.data() + key.length()); +} + +#ifdef JSON_USE_CPPTL +bool Value::isMember(const CppTL::ConstString& key) const { + return isMember(key.c_str(), key.end_c_str()); +} +#endif + +Value::Members Value::getMemberNames() const { + JSON_ASSERT_MESSAGE( + type_ == nullValue || type_ == objectValue, + "in Json::Value::getMemberNames(), value must be objectValue"); + if (type_ == nullValue) + return Value::Members(); + Members members; + members.reserve(value_.map_->size()); + ObjectValues::const_iterator it = value_.map_->begin(); + ObjectValues::const_iterator itEnd = value_.map_->end(); + for (; it != itEnd; ++it) { + members.push_back(std::string((*it).first.data(), + (*it).first.length())); + } + return members; +} +// +//# ifdef JSON_USE_CPPTL +// EnumMemberNames +// Value::enumMemberNames() const +//{ +// if ( type_ == objectValue ) +// { +// return CppTL::Enum::any( CppTL::Enum::transform( +// CppTL::Enum::keys( *(value_.map_), CppTL::Type() ), +// MemberNamesTransform() ) ); +// } +// return EnumMemberNames(); +//} +// +// +// EnumValues +// Value::enumValues() const +//{ +// if ( type_ == objectValue || type_ == arrayValue ) +// return CppTL::Enum::anyValues( *(value_.map_), +// CppTL::Type() ); +// return EnumValues(); +//} +// +//# endif + +static bool IsIntegral(double d) { + double integral_part; + return modf(d, &integral_part) == 0.0; +} + +bool Value::isNull() const { return type_ == nullValue; } + +bool Value::isBool() const { return type_ == booleanValue; } + +bool Value::isInt() const { + switch (type_) { + case intValue: + return value_.int_ >= minInt && value_.int_ <= maxInt; + case uintValue: + return value_.uint_ <= UInt(maxInt); + case realValue: + return value_.real_ >= minInt && value_.real_ <= maxInt && + IsIntegral(value_.real_); + default: + break; + } + return false; +} + +bool Value::isUInt() const { + switch (type_) { + case intValue: + return value_.int_ >= 0 && LargestUInt(value_.int_) <= LargestUInt(maxUInt); + case uintValue: + return value_.uint_ <= maxUInt; + case realValue: + return value_.real_ >= 0 && value_.real_ <= maxUInt && + IsIntegral(value_.real_); + default: + break; + } + return false; +} + +bool Value::isInt64() const { +#if defined(JSON_HAS_INT64) + switch (type_) { + case intValue: + return true; + case uintValue: + return value_.uint_ <= UInt64(maxInt64); + case realValue: + // Note that maxInt64 (= 2^63 - 1) is not exactly representable as a + // double, so double(maxInt64) will be rounded up to 2^63. Therefore we + // require the value to be strictly less than the limit. + return value_.real_ >= double(minInt64) && + value_.real_ < double(maxInt64) && IsIntegral(value_.real_); + default: + break; + } +#endif // JSON_HAS_INT64 + return false; +} + +bool Value::isUInt64() const { +#if defined(JSON_HAS_INT64) + switch (type_) { + case intValue: + return value_.int_ >= 0; + case uintValue: + return true; + case realValue: + // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a + // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we + // require the value to be strictly less than the limit. + return value_.real_ >= 0 && value_.real_ < maxUInt64AsDouble && + IsIntegral(value_.real_); + default: + break; + } +#endif // JSON_HAS_INT64 + return false; +} + +bool Value::isIntegral() const { +#if defined(JSON_HAS_INT64) + return isInt64() || isUInt64(); +#else + return isInt() || isUInt(); +#endif +} + +bool Value::isDouble() const { return type_ == realValue || isIntegral(); } + +bool Value::isNumeric() const { return isIntegral() || isDouble(); } + +bool Value::isString() const { return type_ == stringValue; } + +bool Value::isArray() const { return type_ == arrayValue; } + +bool Value::isObject() const { return type_ == objectValue; } + +void Value::setComment(const char* comment, size_t len, CommentPlacement placement) { + if (!comments_) + comments_ = new CommentInfo[numberOfCommentPlacement]; + if ((len > 0) && (comment[len-1] == '\n')) { + // Always discard trailing newline, to aid indentation. + len -= 1; + } + comments_[placement].setComment(comment, len); +} + +void Value::setComment(const char* comment, CommentPlacement placement) { + setComment(comment, strlen(comment), placement); +} + +void Value::setComment(const std::string& comment, CommentPlacement placement) { + setComment(comment.c_str(), comment.length(), placement); +} + +bool Value::hasComment(CommentPlacement placement) const { + return comments_ != 0 && comments_[placement].comment_ != 0; +} + +std::string Value::getComment(CommentPlacement placement) const { + if (hasComment(placement)) + return comments_[placement].comment_; + return ""; +} + +void Value::setOffsetStart(size_t start) { start_ = start; } + +void Value::setOffsetLimit(size_t limit) { limit_ = limit; } + +size_t Value::getOffsetStart() const { return start_; } + +size_t Value::getOffsetLimit() const { return limit_; } + +std::string Value::toStyledString() const { + StyledWriter writer; + return writer.write(*this); +} + +Value::const_iterator Value::begin() const { + switch (type_) { + case arrayValue: + case objectValue: + if (value_.map_) + return const_iterator(value_.map_->begin()); + break; + default: + break; + } + return const_iterator(); +} + +Value::const_iterator Value::end() const { + switch (type_) { + case arrayValue: + case objectValue: + if (value_.map_) + return const_iterator(value_.map_->end()); + break; + default: + break; + } + return const_iterator(); +} + +Value::iterator Value::begin() { + switch (type_) { + case arrayValue: + case objectValue: + if (value_.map_) + return iterator(value_.map_->begin()); + break; + default: + break; + } + return iterator(); +} + +Value::iterator Value::end() { + switch (type_) { + case arrayValue: + case objectValue: + if (value_.map_) + return iterator(value_.map_->end()); + break; + default: + break; + } + return iterator(); +} + +// class PathArgument +// ////////////////////////////////////////////////////////////////// + +PathArgument::PathArgument() : key_(), index_(), kind_(kindNone) {} + +PathArgument::PathArgument(ArrayIndex index) + : key_(), index_(index), kind_(kindIndex) {} + +PathArgument::PathArgument(const char* key) + : key_(key), index_(), kind_(kindKey) {} + +PathArgument::PathArgument(const std::string& key) + : key_(key.c_str()), index_(), kind_(kindKey) {} + +// class Path +// ////////////////////////////////////////////////////////////////// + +Path::Path(const std::string& path, + const PathArgument& a1, + const PathArgument& a2, + const PathArgument& a3, + const PathArgument& a4, + const PathArgument& a5) { + InArgs in; + in.push_back(&a1); + in.push_back(&a2); + in.push_back(&a3); + in.push_back(&a4); + in.push_back(&a5); + makePath(path, in); +} + +void Path::makePath(const std::string& path, const InArgs& in) { + const char* current = path.c_str(); + const char* end = current + path.length(); + InArgs::const_iterator itInArg = in.begin(); + while (current != end) { + if (*current == '[') { + ++current; + if (*current == '%') + addPathInArg(path, in, itInArg, PathArgument::kindIndex); + else { + ArrayIndex index = 0; + for (; current != end && *current >= '0' && *current <= '9'; ++current) + index = index * 10 + ArrayIndex(*current - '0'); + args_.push_back(index); + } + if (current == end || *current++ != ']') + invalidPath(path, int(current - path.c_str())); + } else if (*current == '%') { + addPathInArg(path, in, itInArg, PathArgument::kindKey); + ++current; + } else if (*current == '.') { + ++current; + } else { + const char* beginName = current; + while (current != end && !strchr("[.", *current)) + ++current; + args_.push_back(std::string(beginName, current)); + } + } +} + +void Path::addPathInArg(const std::string& /*path*/, + const InArgs& in, + InArgs::const_iterator& itInArg, + PathArgument::Kind kind) { + if (itInArg == in.end()) { + // Error: missing argument %d + } else if ((*itInArg)->kind_ != kind) { + // Error: bad argument type + } else { + args_.push_back(**itInArg); + } +} + +void Path::invalidPath(const std::string& /*path*/, int /*location*/) { + // Error: invalid path. +} + +const Value& Path::resolve(const Value& root) const { + const Value* node = &root; + for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) { + const PathArgument& arg = *it; + if (arg.kind_ == PathArgument::kindIndex) { + if (!node->isArray() || !node->isValidIndex(arg.index_)) { + // Error: unable to resolve path (array value expected at position... + } + node = &((*node)[arg.index_]); + } else if (arg.kind_ == PathArgument::kindKey) { + if (!node->isObject()) { + // Error: unable to resolve path (object value expected at position...) + } + node = &((*node)[arg.key_]); + if (node == &Value::nullRef) { + // Error: unable to resolve path (object has no member named '' at + // position...) + } + } + } + return *node; +} + +Value Path::resolve(const Value& root, const Value& defaultValue) const { + const Value* node = &root; + for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) { + const PathArgument& arg = *it; + if (arg.kind_ == PathArgument::kindIndex) { + if (!node->isArray() || !node->isValidIndex(arg.index_)) + return defaultValue; + node = &((*node)[arg.index_]); + } else if (arg.kind_ == PathArgument::kindKey) { + if (!node->isObject()) + return defaultValue; + node = &((*node)[arg.key_]); + if (node == &Value::nullRef) + return defaultValue; + } + } + return *node; +} + +Value& Path::make(Value& root) const { + Value* node = &root; + for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) { + const PathArgument& arg = *it; + if (arg.kind_ == PathArgument::kindIndex) { + if (!node->isArray()) { + // Error: node is not an array at position ... + } + node = &((*node)[arg.index_]); + } else if (arg.kind_ == PathArgument::kindKey) { + if (!node->isObject()) { + // Error: node is not an object at position... + } + node = &((*node)[arg.key_]); + } + } + return *node; +} + +} // namespace Json + +// ////////////////////////////////////////////////////////////////////// +// End of content of file: src/lib_json/json_value.cpp +// ////////////////////////////////////////////////////////////////////// + + + + + + +// ////////////////////////////////////////////////////////////////////// +// Beginning of content of file: src/lib_json/json_writer.cpp +// ////////////////////////////////////////////////////////////////////// + +// Copyright 2011 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#if !defined(JSON_IS_AMALGAMATION) +#include +#include "json_tool.h" +#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(_MSC_VER) && _MSC_VER >= 1200 && _MSC_VER < 1800 // Between VC++ 6.0 and VC++ 11.0 +#include +#define isfinite _finite +#elif defined(__sun) && defined(__SVR4) //Solaris +#include +#define isfinite finite +#else +#include +#define isfinite std::isfinite +#endif + +#if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below +#define snprintf _snprintf +#elif defined(__ANDROID__) +#define snprintf snprintf +#elif __cplusplus >= 201103L +#define snprintf std::snprintf +#endif + +#if defined(__BORLANDC__) +#include +#define isfinite _finite +#define snprintf _snprintf +#endif + +#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0 +// Disable warning about strdup being deprecated. +#pragma warning(disable : 4996) +#endif + +namespace Json { + +#if __cplusplus >= 201103L +typedef std::unique_ptr StreamWriterPtr; +#else +typedef std::auto_ptr StreamWriterPtr; +#endif + +static bool containsControlCharacter(const char* str) { + while (*str) { + if (isControlCharacter(*(str++))) + return true; + } + return false; +} + +static bool containsControlCharacter0(const char* str, unsigned len) { + char const* end = str + len; + while (end != str) { + if (isControlCharacter(*str) || 0==*str) + return true; + ++str; + } + return false; +} + +std::string valueToString(LargestInt value) { + UIntToStringBuffer buffer; + char* current = buffer + sizeof(buffer); + bool isNegative = value < 0; + if (isNegative) + value = -value; + uintToString(LargestUInt(value), current); + if (isNegative) + *--current = '-'; + assert(current >= buffer); + return current; +} + +std::string valueToString(LargestUInt value) { + UIntToStringBuffer buffer; + char* current = buffer + sizeof(buffer); + uintToString(value, current); + assert(current >= buffer); + return current; +} + +#if defined(JSON_HAS_INT64) + +std::string valueToString(Int value) { + return valueToString(LargestInt(value)); +} + +std::string valueToString(UInt value) { + return valueToString(LargestUInt(value)); +} + +#endif // # if defined(JSON_HAS_INT64) + +std::string valueToString(double value) { + // Allocate a buffer that is more than large enough to store the 16 digits of + // precision requested below. + char buffer[32]; + int len = -1; + +// Print into the buffer. We need not request the alternative representation +// that always has a decimal point because JSON doesn't distingish the +// concepts of reals and integers. +#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with + // visual studio 2005 to + // avoid warning. +#if defined(WINCE) + len = _snprintf(buffer, sizeof(buffer), "%.17g", value); +#else + len = sprintf_s(buffer, sizeof(buffer), "%.17g", value); +#endif +#else + if (isfinite(value)) { + len = snprintf(buffer, sizeof(buffer), "%.17g", value); + } else { + // IEEE standard states that NaN values will not compare to themselves + if (value != value) { + len = snprintf(buffer, sizeof(buffer), "null"); + } else if (value < 0) { + len = snprintf(buffer, sizeof(buffer), "-1e+9999"); + } else { + len = snprintf(buffer, sizeof(buffer), "1e+9999"); + } + // For those, we do not need to call fixNumLoc, but it is fast. + } +#endif + assert(len >= 0); + fixNumericLocale(buffer, buffer + len); + return buffer; +} + +std::string valueToString(bool value) { return value ? "true" : "false"; } + +std::string valueToQuotedString(const char* value) { + if (value == NULL) + return ""; + // Not sure how to handle unicode... + if (strpbrk(value, "\"\\\b\f\n\r\t") == NULL && + !containsControlCharacter(value)) + return std::string("\"") + value + "\""; + // We have to walk value and escape any special characters. + // Appending to std::string is not efficient, but this should be rare. + // (Note: forward slashes are *not* rare, but I am not escaping them.) + std::string::size_type maxsize = + strlen(value) * 2 + 3; // allescaped+quotes+NULL + std::string result; + result.reserve(maxsize); // to avoid lots of mallocs + result += "\""; + for (const char* c = value; *c != 0; ++c) { + switch (*c) { + case '\"': + result += "\\\""; + break; + case '\\': + result += "\\\\"; + break; + case '\b': + result += "\\b"; + break; + case '\f': + result += "\\f"; + break; + case '\n': + result += "\\n"; + break; + case '\r': + result += "\\r"; + break; + case '\t': + result += "\\t"; + break; + // case '/': + // Even though \/ is considered a legal escape in JSON, a bare + // slash is also legal, so I see no reason to escape it. + // (I hope I am not misunderstanding something. + // blep notes: actually escaping \/ may be useful in javascript to avoid (*c); + result += oss.str(); + } else { + result += *c; + } + break; + } + } + result += "\""; + return result; +} + +// https://github.com/upcaste/upcaste/blob/master/src/upcore/src/cstring/strnpbrk.cpp +static char const* strnpbrk(char const* s, char const* accept, size_t n) { + assert((s || !n) && accept); + + char const* const end = s + n; + for (char const* cur = s; cur < end; ++cur) { + int const c = *cur; + for (char const* a = accept; *a; ++a) { + if (*a == c) { + return cur; + } + } + } + return NULL; +} +static std::string valueToQuotedStringN(const char* value, unsigned length) { + if (value == NULL) + return ""; + // Not sure how to handle unicode... + if (strnpbrk(value, "\"\\\b\f\n\r\t", length) == NULL && + !containsControlCharacter0(value, length)) + return std::string("\"") + value + "\""; + // We have to walk value and escape any special characters. + // Appending to std::string is not efficient, but this should be rare. + // (Note: forward slashes are *not* rare, but I am not escaping them.) + std::string::size_type maxsize = + length * 2 + 3; // allescaped+quotes+NULL + std::string result; + result.reserve(maxsize); // to avoid lots of mallocs + result += "\""; + char const* end = value + length; + for (const char* c = value; c != end; ++c) { + switch (*c) { + case '\"': + result += "\\\""; + break; + case '\\': + result += "\\\\"; + break; + case '\b': + result += "\\b"; + break; + case '\f': + result += "\\f"; + break; + case '\n': + result += "\\n"; + break; + case '\r': + result += "\\r"; + break; + case '\t': + result += "\\t"; + break; + // case '/': + // Even though \/ is considered a legal escape in JSON, a bare + // slash is also legal, so I see no reason to escape it. + // (I hope I am not misunderstanding something.) + // blep notes: actually escaping \/ may be useful in javascript to avoid (*c); + result += oss.str(); + } else { + result += *c; + } + break; + } + } + result += "\""; + return result; +} + +// Class Writer +// ////////////////////////////////////////////////////////////////// +Writer::~Writer() {} + +// Class FastWriter +// ////////////////////////////////////////////////////////////////// + +FastWriter::FastWriter() + : yamlCompatiblityEnabled_(false), dropNullPlaceholders_(false), + omitEndingLineFeed_(false) {} + +void FastWriter::enableYAMLCompatibility() { yamlCompatiblityEnabled_ = true; } + +void FastWriter::dropNullPlaceholders() { dropNullPlaceholders_ = true; } + +void FastWriter::omitEndingLineFeed() { omitEndingLineFeed_ = true; } + +std::string FastWriter::write(const Value& root) { + document_ = ""; + writeValue(root); + if (!omitEndingLineFeed_) + document_ += "\n"; + return document_; +} + +void FastWriter::writeValue(const Value& value) { + switch (value.type()) { + case nullValue: + if (!dropNullPlaceholders_) + document_ += "null"; + break; + case intValue: + document_ += valueToString(value.asLargestInt()); + break; + case uintValue: + document_ += valueToString(value.asLargestUInt()); + break; + case realValue: + document_ += valueToString(value.asDouble()); + break; + case stringValue: + { + // Is NULL possible for value.string_? + char const* str; + char const* end; + bool ok = value.getString(&str, &end); + if (ok) document_ += valueToQuotedStringN(str, static_cast(end-str)); + break; + } + case booleanValue: + document_ += valueToString(value.asBool()); + break; + case arrayValue: { + document_ += '['; + int size = value.size(); + for (int index = 0; index < size; ++index) { + if (index > 0) + document_ += ','; + writeValue(value[index]); + } + document_ += ']'; + } break; + case objectValue: { + Value::Members members(value.getMemberNames()); + document_ += '{'; + for (Value::Members::iterator it = members.begin(); it != members.end(); + ++it) { + const std::string& name = *it; + if (it != members.begin()) + document_ += ','; + document_ += valueToQuotedStringN(name.data(), name.length()); + document_ += yamlCompatiblityEnabled_ ? ": " : ":"; + writeValue(value[name]); + } + document_ += '}'; + } break; + } +} + +// Class StyledWriter +// ////////////////////////////////////////////////////////////////// + +StyledWriter::StyledWriter() + : rightMargin_(74), indentSize_(3), addChildValues_() {} + +std::string StyledWriter::write(const Value& root) { + document_ = ""; + addChildValues_ = false; + indentString_ = ""; + writeCommentBeforeValue(root); + writeValue(root); + writeCommentAfterValueOnSameLine(root); + document_ += "\n"; + return document_; +} + +void StyledWriter::writeValue(const Value& value) { + switch (value.type()) { + case nullValue: + pushValue("null"); + break; + case intValue: + pushValue(valueToString(value.asLargestInt())); + break; + case uintValue: + pushValue(valueToString(value.asLargestUInt())); + break; + case realValue: + pushValue(valueToString(value.asDouble())); + break; + case stringValue: + { + // Is NULL possible for value.string_? + char const* str; + char const* end; + bool ok = value.getString(&str, &end); + if (ok) pushValue(valueToQuotedStringN(str, static_cast(end-str))); + else pushValue(""); + break; + } + case booleanValue: + pushValue(valueToString(value.asBool())); + break; + case arrayValue: + writeArrayValue(value); + break; + case objectValue: { + Value::Members members(value.getMemberNames()); + if (members.empty()) + pushValue("{}"); + else { + writeWithIndent("{"); + indent(); + Value::Members::iterator it = members.begin(); + for (;;) { + const std::string& name = *it; + const Value& childValue = value[name]; + writeCommentBeforeValue(childValue); + writeWithIndent(valueToQuotedString(name.c_str())); + document_ += " : "; + writeValue(childValue); + if (++it == members.end()) { + writeCommentAfterValueOnSameLine(childValue); + break; + } + document_ += ','; + writeCommentAfterValueOnSameLine(childValue); + } + unindent(); + writeWithIndent("}"); + } + } break; + } +} + +void StyledWriter::writeArrayValue(const Value& value) { + unsigned size = value.size(); + if (size == 0) + pushValue("[]"); + else { + bool isArrayMultiLine = isMultineArray(value); + if (isArrayMultiLine) { + writeWithIndent("["); + indent(); + bool hasChildValue = !childValues_.empty(); + unsigned index = 0; + for (;;) { + const Value& childValue = value[index]; + writeCommentBeforeValue(childValue); + if (hasChildValue) + writeWithIndent(childValues_[index]); + else { + writeIndent(); + writeValue(childValue); + } + if (++index == size) { + writeCommentAfterValueOnSameLine(childValue); + break; + } + document_ += ','; + writeCommentAfterValueOnSameLine(childValue); + } + unindent(); + writeWithIndent("]"); + } else // output on a single line + { + assert(childValues_.size() == size); + document_ += "[ "; + for (unsigned index = 0; index < size; ++index) { + if (index > 0) + document_ += ", "; + document_ += childValues_[index]; + } + document_ += " ]"; + } + } +} + +bool StyledWriter::isMultineArray(const Value& value) { + int size = value.size(); + bool isMultiLine = size * 3 >= rightMargin_; + childValues_.clear(); + for (int index = 0; index < size && !isMultiLine; ++index) { + const Value& childValue = value[index]; + isMultiLine = + isMultiLine || ((childValue.isArray() || childValue.isObject()) && + childValue.size() > 0); + } + if (!isMultiLine) // check if line length > max line length + { + childValues_.reserve(size); + addChildValues_ = true; + int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]' + for (int index = 0; index < size; ++index) { + if (hasCommentForValue(value[index])) { + isMultiLine = true; + } + writeValue(value[index]); + lineLength += int(childValues_[index].length()); + } + addChildValues_ = false; + isMultiLine = isMultiLine || lineLength >= rightMargin_; + } + return isMultiLine; +} + +void StyledWriter::pushValue(const std::string& value) { + if (addChildValues_) + childValues_.push_back(value); + else + document_ += value; +} + +void StyledWriter::writeIndent() { + if (!document_.empty()) { + char last = document_[document_.length() - 1]; + if (last == ' ') // already indented + return; + if (last != '\n') // Comments may add new-line + document_ += '\n'; + } + document_ += indentString_; +} + +void StyledWriter::writeWithIndent(const std::string& value) { + writeIndent(); + document_ += value; +} + +void StyledWriter::indent() { indentString_ += std::string(indentSize_, ' '); } + +void StyledWriter::unindent() { + assert(int(indentString_.size()) >= indentSize_); + indentString_.resize(indentString_.size() - indentSize_); +} + +void StyledWriter::writeCommentBeforeValue(const Value& root) { + if (!root.hasComment(commentBefore)) + return; + + document_ += "\n"; + writeIndent(); + const std::string& comment = root.getComment(commentBefore); + std::string::const_iterator iter = comment.begin(); + while (iter != comment.end()) { + document_ += *iter; + if (*iter == '\n' && + (iter != comment.end() && *(iter + 1) == '/')) + writeIndent(); + ++iter; + } + + // Comments are stripped of trailing newlines, so add one here + document_ += "\n"; +} + +void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) { + if (root.hasComment(commentAfterOnSameLine)) + document_ += " " + root.getComment(commentAfterOnSameLine); + + if (root.hasComment(commentAfter)) { + document_ += "\n"; + document_ += root.getComment(commentAfter); + document_ += "\n"; + } +} + +bool StyledWriter::hasCommentForValue(const Value& value) { + return value.hasComment(commentBefore) || + value.hasComment(commentAfterOnSameLine) || + value.hasComment(commentAfter); +} + +// Class StyledStreamWriter +// ////////////////////////////////////////////////////////////////// + +StyledStreamWriter::StyledStreamWriter(std::string indentation) + : document_(NULL), rightMargin_(74), indentation_(indentation), + addChildValues_() {} + +void StyledStreamWriter::write(std::ostream& out, const Value& root) { + document_ = &out; + addChildValues_ = false; + indentString_ = ""; + indented_ = true; + writeCommentBeforeValue(root); + if (!indented_) writeIndent(); + indented_ = true; + writeValue(root); + writeCommentAfterValueOnSameLine(root); + *document_ << "\n"; + document_ = NULL; // Forget the stream, for safety. +} + +void StyledStreamWriter::writeValue(const Value& value) { + switch (value.type()) { + case nullValue: + pushValue("null"); + break; + case intValue: + pushValue(valueToString(value.asLargestInt())); + break; + case uintValue: + pushValue(valueToString(value.asLargestUInt())); + break; + case realValue: + pushValue(valueToString(value.asDouble())); + break; + case stringValue: + { + // Is NULL possible for value.string_? + char const* str; + char const* end; + bool ok = value.getString(&str, &end); + if (ok) pushValue(valueToQuotedStringN(str, static_cast(end-str))); + else pushValue(""); + break; + } + case booleanValue: + pushValue(valueToString(value.asBool())); + break; + case arrayValue: + writeArrayValue(value); + break; + case objectValue: { + Value::Members members(value.getMemberNames()); + if (members.empty()) + pushValue("{}"); + else { + writeWithIndent("{"); + indent(); + Value::Members::iterator it = members.begin(); + for (;;) { + const std::string& name = *it; + const Value& childValue = value[name]; + writeCommentBeforeValue(childValue); + writeWithIndent(valueToQuotedString(name.c_str())); + *document_ << " : "; + writeValue(childValue); + if (++it == members.end()) { + writeCommentAfterValueOnSameLine(childValue); + break; + } + *document_ << ","; + writeCommentAfterValueOnSameLine(childValue); + } + unindent(); + writeWithIndent("}"); + } + } break; + } +} + +void StyledStreamWriter::writeArrayValue(const Value& value) { + unsigned size = value.size(); + if (size == 0) + pushValue("[]"); + else { + bool isArrayMultiLine = isMultineArray(value); + if (isArrayMultiLine) { + writeWithIndent("["); + indent(); + bool hasChildValue = !childValues_.empty(); + unsigned index = 0; + for (;;) { + const Value& childValue = value[index]; + writeCommentBeforeValue(childValue); + if (hasChildValue) + writeWithIndent(childValues_[index]); + else { + if (!indented_) writeIndent(); + indented_ = true; + writeValue(childValue); + indented_ = false; + } + if (++index == size) { + writeCommentAfterValueOnSameLine(childValue); + break; + } + *document_ << ","; + writeCommentAfterValueOnSameLine(childValue); + } + unindent(); + writeWithIndent("]"); + } else // output on a single line + { + assert(childValues_.size() == size); + *document_ << "[ "; + for (unsigned index = 0; index < size; ++index) { + if (index > 0) + *document_ << ", "; + *document_ << childValues_[index]; + } + *document_ << " ]"; + } + } +} + +bool StyledStreamWriter::isMultineArray(const Value& value) { + int size = value.size(); + bool isMultiLine = size * 3 >= rightMargin_; + childValues_.clear(); + for (int index = 0; index < size && !isMultiLine; ++index) { + const Value& childValue = value[index]; + isMultiLine = + isMultiLine || ((childValue.isArray() || childValue.isObject()) && + childValue.size() > 0); + } + if (!isMultiLine) // check if line length > max line length + { + childValues_.reserve(size); + addChildValues_ = true; + int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]' + for (int index = 0; index < size; ++index) { + if (hasCommentForValue(value[index])) { + isMultiLine = true; + } + writeValue(value[index]); + lineLength += int(childValues_[index].length()); + } + addChildValues_ = false; + isMultiLine = isMultiLine || lineLength >= rightMargin_; + } + return isMultiLine; +} + +void StyledStreamWriter::pushValue(const std::string& value) { + if (addChildValues_) + childValues_.push_back(value); + else + *document_ << value; +} + +void StyledStreamWriter::writeIndent() { + // blep intended this to look at the so-far-written string + // to determine whether we are already indented, but + // with a stream we cannot do that. So we rely on some saved state. + // The caller checks indented_. + *document_ << '\n' << indentString_; +} + +void StyledStreamWriter::writeWithIndent(const std::string& value) { + if (!indented_) writeIndent(); + *document_ << value; + indented_ = false; +} + +void StyledStreamWriter::indent() { indentString_ += indentation_; } + +void StyledStreamWriter::unindent() { + assert(indentString_.size() >= indentation_.size()); + indentString_.resize(indentString_.size() - indentation_.size()); +} + +void StyledStreamWriter::writeCommentBeforeValue(const Value& root) { + if (!root.hasComment(commentBefore)) + return; + + if (!indented_) writeIndent(); + const std::string& comment = root.getComment(commentBefore); + std::string::const_iterator iter = comment.begin(); + while (iter != comment.end()) { + *document_ << *iter; + if (*iter == '\n' && + (iter != comment.end() && *(iter + 1) == '/')) + // writeIndent(); // would include newline + *document_ << indentString_; + ++iter; + } + indented_ = false; +} + +void StyledStreamWriter::writeCommentAfterValueOnSameLine(const Value& root) { + if (root.hasComment(commentAfterOnSameLine)) + *document_ << ' ' << root.getComment(commentAfterOnSameLine); + + if (root.hasComment(commentAfter)) { + writeIndent(); + *document_ << root.getComment(commentAfter); + } + indented_ = false; +} + +bool StyledStreamWriter::hasCommentForValue(const Value& value) { + return value.hasComment(commentBefore) || + value.hasComment(commentAfterOnSameLine) || + value.hasComment(commentAfter); +} + +////////////////////////// +// BuiltStyledStreamWriter + +/// Scoped enums are not available until C++11. +struct CommentStyle { + /// Decide whether to write comments. + enum Enum { + None, ///< Drop all comments. + Most, ///< Recover odd behavior of previous versions (not implemented yet). + All ///< Keep all comments. + }; +}; + +struct BuiltStyledStreamWriter : public StreamWriter +{ + BuiltStyledStreamWriter( + std::string const& indentation, + CommentStyle::Enum cs, + std::string const& colonSymbol, + std::string const& nullSymbol, + std::string const& endingLineFeedSymbol); + virtual int write(Value const& root, std::ostream* sout); +private: + void writeValue(Value const& value); + void writeArrayValue(Value const& value); + bool isMultineArray(Value const& value); + void pushValue(std::string const& value); + void writeIndent(); + void writeWithIndent(std::string const& value); + void indent(); + void unindent(); + void writeCommentBeforeValue(Value const& root); + void writeCommentAfterValueOnSameLine(Value const& root); + static bool hasCommentForValue(const Value& value); + + typedef std::vector ChildValues; + + ChildValues childValues_; + std::string indentString_; + int rightMargin_; + std::string indentation_; + CommentStyle::Enum cs_; + std::string colonSymbol_; + std::string nullSymbol_; + std::string endingLineFeedSymbol_; + bool addChildValues_ : 1; + bool indented_ : 1; +}; +BuiltStyledStreamWriter::BuiltStyledStreamWriter( + std::string const& indentation, + CommentStyle::Enum cs, + std::string const& colonSymbol, + std::string const& nullSymbol, + std::string const& endingLineFeedSymbol) + : rightMargin_(74) + , indentation_(indentation) + , cs_(cs) + , colonSymbol_(colonSymbol) + , nullSymbol_(nullSymbol) + , endingLineFeedSymbol_(endingLineFeedSymbol) + , addChildValues_(false) + , indented_(false) +{ +} +int BuiltStyledStreamWriter::write(Value const& root, std::ostream* sout) +{ + sout_ = sout; + addChildValues_ = false; + indented_ = true; + indentString_ = ""; + writeCommentBeforeValue(root); + if (!indented_) writeIndent(); + indented_ = true; + writeValue(root); + writeCommentAfterValueOnSameLine(root); + *sout_ << endingLineFeedSymbol_; + sout_ = NULL; + return 0; +} +void BuiltStyledStreamWriter::writeValue(Value const& value) { + switch (value.type()) { + case nullValue: + pushValue(nullSymbol_); + break; + case intValue: + pushValue(valueToString(value.asLargestInt())); + break; + case uintValue: + pushValue(valueToString(value.asLargestUInt())); + break; + case realValue: + pushValue(valueToString(value.asDouble())); + break; + case stringValue: + { + // Is NULL is possible for value.string_? + char const* str; + char const* end; + bool ok = value.getString(&str, &end); + if (ok) pushValue(valueToQuotedStringN(str, static_cast(end-str))); + else pushValue(""); + break; + } + case booleanValue: + pushValue(valueToString(value.asBool())); + break; + case arrayValue: + writeArrayValue(value); + break; + case objectValue: { + Value::Members members(value.getMemberNames()); + if (members.empty()) + pushValue("{}"); + else { + writeWithIndent("{"); + indent(); + Value::Members::iterator it = members.begin(); + for (;;) { + std::string const& name = *it; + Value const& childValue = value[name]; + writeCommentBeforeValue(childValue); + writeWithIndent(valueToQuotedStringN(name.data(), name.length())); + *sout_ << colonSymbol_; + writeValue(childValue); + if (++it == members.end()) { + writeCommentAfterValueOnSameLine(childValue); + break; + } + *sout_ << ","; + writeCommentAfterValueOnSameLine(childValue); + } + unindent(); + writeWithIndent("}"); + } + } break; + } +} + +void BuiltStyledStreamWriter::writeArrayValue(Value const& value) { + unsigned size = value.size(); + if (size == 0) + pushValue("[]"); + else { + bool isMultiLine = (cs_ == CommentStyle::All) || isMultineArray(value); + if (isMultiLine) { + writeWithIndent("["); + indent(); + bool hasChildValue = !childValues_.empty(); + unsigned index = 0; + for (;;) { + Value const& childValue = value[index]; + writeCommentBeforeValue(childValue); + if (hasChildValue) + writeWithIndent(childValues_[index]); + else { + if (!indented_) writeIndent(); + indented_ = true; + writeValue(childValue); + indented_ = false; + } + if (++index == size) { + writeCommentAfterValueOnSameLine(childValue); + break; + } + *sout_ << ","; + writeCommentAfterValueOnSameLine(childValue); + } + unindent(); + writeWithIndent("]"); + } else // output on a single line + { + assert(childValues_.size() == size); + *sout_ << "["; + if (!indentation_.empty()) *sout_ << " "; + for (unsigned index = 0; index < size; ++index) { + if (index > 0) + *sout_ << ", "; + *sout_ << childValues_[index]; + } + if (!indentation_.empty()) *sout_ << " "; + *sout_ << "]"; + } + } +} + +bool BuiltStyledStreamWriter::isMultineArray(Value const& value) { + int size = value.size(); + bool isMultiLine = size * 3 >= rightMargin_; + childValues_.clear(); + for (int index = 0; index < size && !isMultiLine; ++index) { + Value const& childValue = value[index]; + isMultiLine = + isMultiLine || ((childValue.isArray() || childValue.isObject()) && + childValue.size() > 0); + } + if (!isMultiLine) // check if line length > max line length + { + childValues_.reserve(size); + addChildValues_ = true; + int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]' + for (int index = 0; index < size; ++index) { + if (hasCommentForValue(value[index])) { + isMultiLine = true; + } + writeValue(value[index]); + lineLength += int(childValues_[index].length()); + } + addChildValues_ = false; + isMultiLine = isMultiLine || lineLength >= rightMargin_; + } + return isMultiLine; +} + +void BuiltStyledStreamWriter::pushValue(std::string const& value) { + if (addChildValues_) + childValues_.push_back(value); + else + *sout_ << value; +} + +void BuiltStyledStreamWriter::writeIndent() { + // blep intended this to look at the so-far-written string + // to determine whether we are already indented, but + // with a stream we cannot do that. So we rely on some saved state. + // The caller checks indented_. + + if (!indentation_.empty()) { + // In this case, drop newlines too. + *sout_ << '\n' << indentString_; + } +} + +void BuiltStyledStreamWriter::writeWithIndent(std::string const& value) { + if (!indented_) writeIndent(); + *sout_ << value; + indented_ = false; +} + +void BuiltStyledStreamWriter::indent() { indentString_ += indentation_; } + +void BuiltStyledStreamWriter::unindent() { + assert(indentString_.size() >= indentation_.size()); + indentString_.resize(indentString_.size() - indentation_.size()); +} + +void BuiltStyledStreamWriter::writeCommentBeforeValue(Value const& root) { + if (cs_ == CommentStyle::None) return; + if (!root.hasComment(commentBefore)) + return; + + if (!indented_) writeIndent(); + const std::string& comment = root.getComment(commentBefore); + std::string::const_iterator iter = comment.begin(); + while (iter != comment.end()) { + *sout_ << *iter; + if (*iter == '\n' && + (iter != comment.end() && *(iter + 1) == '/')) + // writeIndent(); // would write extra newline + *sout_ << indentString_; + ++iter; + } + indented_ = false; +} + +void BuiltStyledStreamWriter::writeCommentAfterValueOnSameLine(Value const& root) { + if (cs_ == CommentStyle::None) return; + if (root.hasComment(commentAfterOnSameLine)) + *sout_ << " " + root.getComment(commentAfterOnSameLine); + + if (root.hasComment(commentAfter)) { + writeIndent(); + *sout_ << root.getComment(commentAfter); + } +} + +// static +bool BuiltStyledStreamWriter::hasCommentForValue(const Value& value) { + return value.hasComment(commentBefore) || + value.hasComment(commentAfterOnSameLine) || + value.hasComment(commentAfter); +} + +/////////////// +// StreamWriter + +StreamWriter::StreamWriter() + : sout_(NULL) +{ +} +StreamWriter::~StreamWriter() +{ +} +StreamWriter::Factory::~Factory() +{} +StreamWriterBuilder::StreamWriterBuilder() +{ + setDefaults(&settings_); +} +StreamWriterBuilder::~StreamWriterBuilder() +{} +StreamWriter* StreamWriterBuilder::newStreamWriter() const +{ + std::string indentation = settings_["indentation"].asString(); + std::string cs_str = settings_["commentStyle"].asString(); + bool eyc = settings_["enableYAMLCompatibility"].asBool(); + bool dnp = settings_["dropNullPlaceholders"].asBool(); + CommentStyle::Enum cs = CommentStyle::All; + if (cs_str == "All") { + cs = CommentStyle::All; + } else if (cs_str == "None") { + cs = CommentStyle::None; + } else { + throwRuntimeError("commentStyle must be 'All' or 'None'"); + } + std::string colonSymbol = " : "; + if (eyc) { + colonSymbol = ": "; + } else if (indentation.empty()) { + colonSymbol = ":"; + } + std::string nullSymbol = "null"; + if (dnp) { + nullSymbol = ""; + } + std::string endingLineFeedSymbol = ""; + return new BuiltStyledStreamWriter( + indentation, cs, + colonSymbol, nullSymbol, endingLineFeedSymbol); +} +static void getValidWriterKeys(std::set* valid_keys) +{ + valid_keys->clear(); + valid_keys->insert("indentation"); + valid_keys->insert("commentStyle"); + valid_keys->insert("enableYAMLCompatibility"); + valid_keys->insert("dropNullPlaceholders"); +} +bool StreamWriterBuilder::validate(Json::Value* invalid) const +{ + Json::Value my_invalid; + if (!invalid) invalid = &my_invalid; // so we do not need to test for NULL + Json::Value& inv = *invalid; + std::set valid_keys; + getValidWriterKeys(&valid_keys); + Value::Members keys = settings_.getMemberNames(); + size_t n = keys.size(); + for (size_t i = 0; i < n; ++i) { + std::string const& key = keys[i]; + if (valid_keys.find(key) == valid_keys.end()) { + inv[key] = settings_[key]; + } + } + return 0u == inv.size(); +} +Value& StreamWriterBuilder::operator[](std::string key) +{ + return settings_[key]; +} +// static +void StreamWriterBuilder::setDefaults(Json::Value* settings) +{ + //! [StreamWriterBuilderDefaults] + (*settings)["commentStyle"] = "All"; + (*settings)["indentation"] = "\t"; + (*settings)["enableYAMLCompatibility"] = false; + (*settings)["dropNullPlaceholders"] = false; + //! [StreamWriterBuilderDefaults] +} + +std::string writeString(StreamWriter::Factory const& builder, Value const& root) { + std::ostringstream sout; + StreamWriterPtr const writer(builder.newStreamWriter()); + writer->write(root, &sout); + return sout.str(); +} + +std::ostream& operator<<(std::ostream& sout, Value const& root) { + StreamWriterBuilder builder; + StreamWriterPtr const writer(builder.newStreamWriter()); + writer->write(root, &sout); + return sout; +} + +} // namespace Json + +// ////////////////////////////////////////////////////////////////////// +// End of content of file: src/lib_json/json_writer.cpp +// ////////////////////////////////////////////////////////////////////// + + + + + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsonToSpirv.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsonToSpirv.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsonToSpirv.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsonToSpirv.cpp 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,437 @@ +// Copyright (c) 2014-2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +#include +#include +#include +#include +#include +#include +#include + +#include "jsoncpp/dist/json/json.h" + +#include "jsonToSpirv.h" + +namespace spv { + +// The set of objects that hold all the instruction/operand +// parameterization information. +InstructionValues InstructionDesc; + +// Note: There is no entry for OperandOpcode. Use InstructionDesc instead. +EnumDefinition OperandClassParams[OperandOpcode]; +EnumValues SourceLanguageParams; +EnumValues ExecutionModelParams; +EnumValues AddressingParams; +EnumValues MemoryParams; +EnumValues ExecutionModeParams; +EnumValues StorageParams; +EnumValues SamplerAddressingModeParams; +EnumValues SamplerFilterModeParams; +EnumValues ImageFormatParams; +EnumValues ImageChannelOrderParams; +EnumValues ImageChannelDataTypeParams; +EnumValues ImageOperandsParams; +EnumValues FPFastMathParams; +EnumValues FPRoundingModeParams; +EnumValues LinkageTypeParams; +EnumValues DecorationParams; +EnumValues BuiltInParams; +EnumValues DimensionalityParams; +EnumValues FuncParamAttrParams; +EnumValues AccessQualifierParams; +EnumValues GroupOperationParams; +EnumValues LoopControlParams; +EnumValues SelectionControlParams; +EnumValues FunctionControlParams; +EnumValues MemorySemanticsParams; +EnumValues MemoryAccessParams; +EnumValues ScopeParams; +EnumValues KernelEnqueueFlagsParams; +EnumValues KernelProfilingInfoParams; +EnumValues CapabilityParams; + +std::pair ReadFile(const std::string& path) +{ + std::ifstream fstream(path, std::ios::in); + if (fstream) { + std::string contents; + fstream.seekg(0, std::ios::end); + contents.reserve((unsigned int)fstream.tellg()); + fstream.seekg(0, std::ios::beg); + contents.assign((std::istreambuf_iterator(fstream)), + std::istreambuf_iterator()); + return std::make_pair(true, contents); + } + return std::make_pair(false, ""); +} + +struct ClassOptionality { + OperandClass type; + bool optional; +}; + +// Converts the |operandKind| and |quantifier| pair used to describe operands +// in the JSON grammar to OperandClass and optionality used in this repo. +ClassOptionality ToOperandClassAndOptionality(const std::string& operandKind, const std::string& quantifier) +{ + assert(quantifier.empty() || quantifier == "?" || quantifier == "*"); + + if (operandKind == "IdRef") { + if (quantifier.empty()) + return {OperandId, false}; + else if (quantifier == "?") + return {OperandId, true}; + else + return {OperandVariableIds, false}; + } else if (operandKind == "LiteralInteger") { + if (quantifier.empty()) + return {OperandLiteralNumber, false}; + if (quantifier == "?") + return {OperandOptionalLiteral, true}; + else + return {OperandVariableLiterals, false}; + } else if (operandKind == "LiteralString") { + if (quantifier.empty()) + return {OperandLiteralString, false}; + else if (quantifier == "?") + return {OperandLiteralString, true}; + else { + assert(0 && "this case should not exist"); + return {OperandNone, false}; + } + } else if (operandKind == "PairLiteralIntegerIdRef") { + // Used by OpSwitch in the grammar + return {OperandVariableLiteralId, false}; + } else if (operandKind == "PairIdRefLiteralInteger") { + // Used by OpGroupMemberDecorate in the grammar + return {OperandVariableIdLiteral, false}; + } else if (operandKind == "PairIdRefIdRef") { + // Used by OpPhi in the grammar + return {OperandVariableIds, false}; + } else { + OperandClass type = OperandNone; + if (operandKind == "IdMemorySemantics" || operandKind == "MemorySemantics") { + type = OperandMemorySemantics; + } else if (operandKind == "IdScope" || operandKind == "Scope") { + type = OperandScope; + } else if (operandKind == "LiteralExtInstInteger") { + type = OperandLiteralNumber; + } else if (operandKind == "LiteralSpecConstantOpInteger") { + type = OperandLiteralNumber; + } else if (operandKind == "LiteralContextDependentNumber") { + type = OperandVariableLiterals; + } else if (operandKind == "SourceLanguage") { + type = OperandSource; + } else if (operandKind == "ExecutionModel") { + type = OperandExecutionModel; + } else if (operandKind == "AddressingModel") { + type = OperandAddressing; + } else if (operandKind == "MemoryModel") { + type = OperandMemory; + } else if (operandKind == "ExecutionMode") { + type = OperandExecutionMode; + } else if (operandKind == "StorageClass") { + type = OperandStorage; + } else if (operandKind == "Dim") { + type = OperandDimensionality; + } else if (operandKind == "SamplerAddressingMode") { + type = OperandSamplerAddressingMode; + } else if (operandKind == "SamplerFilterMode") { + type = OperandSamplerFilterMode; + } else if (operandKind == "ImageFormat") { + type = OperandSamplerImageFormat; + } else if (operandKind == "ImageChannelOrder") { + type = OperandImageChannelOrder; + } else if (operandKind == "ImageChannelDataType") { + type = OperandImageChannelDataType; + } else if (operandKind == "FPRoundingMode") { + type = OperandFPRoundingMode; + } else if (operandKind == "LinkageType") { + type = OperandLinkageType; + } else if (operandKind == "AccessQualifier") { + type = OperandAccessQualifier; + } else if (operandKind == "FunctionParameterAttribute") { + type = OperandFuncParamAttr; + } else if (operandKind == "Decoration") { + type = OperandDecoration; + } else if (operandKind == "BuiltIn") { + type = OperandBuiltIn; + } else if (operandKind == "GroupOperation") { + type = OperandGroupOperation; + } else if (operandKind == "KernelEnqueueFlags") { + type = OperandKernelEnqueueFlags; + } else if (operandKind == "KernelProfilingInfo") { + type = OperandKernelProfilingInfo; + } else if (operandKind == "Capability") { + type = OperandCapability; + } else if (operandKind == "ImageOperands") { + type = OperandImageOperands; + } else if (operandKind == "FPFastMathMode") { + type = OperandFPFastMath; + } else if (operandKind == "SelectionControl") { + type = OperandSelect; + } else if (operandKind == "LoopControl") { + type = OperandLoop; + } else if (operandKind == "FunctionControl") { + type = OperandFunction; + } else if (operandKind == "MemoryAccess") { + type = OperandMemoryAccess; + } + + if (type == OperandNone) { + std::cerr << "Unhandled operand kind found: " << operandKind << std::endl; + exit(1); + } + return {type, !quantifier.empty()}; + } +} + +bool IsTypeOrResultId(const std::string& str, bool* isType, bool* isResult) +{ + if (str == "IdResultType") + return *isType = true; + if (str == "IdResult") + return *isResult = true; + return false; +} + +// Given a number string, returns the position of the only bits set in the number. +// So it requires the number is a power of two. +unsigned int NumberStringToBit(const std::string& str) +{ + char* parseEnd; + unsigned int value = (unsigned int)std::strtol(str.c_str(), &parseEnd, 16); + assert(!(value & (value - 1)) && "input number is not a power of 2"); + unsigned int bit = 0; + for (; value; value >>= 1) ++bit; + return bit; +} + +void jsonToSpirv(const std::string& jsonPath) +{ + // only do this once. + static bool initialized = false; + if (initialized) + return; + initialized = true; + + // Read the JSON grammar file. + bool fileReadOk = false; + std::string content; + std::tie(fileReadOk, content) = ReadFile(jsonPath); + if (!fileReadOk) { + std::cerr << "Failed to read JSON grammar file: " + << jsonPath << std::endl; + exit(1); + } + + // Decode the JSON grammar file. + Json::Reader reader; + Json::Value root; + if (!reader.parse(content, root)) { + std::cerr << "Failed to parse JSON grammar:\n" + << reader.getFormattedErrorMessages(); + exit(1); + } + + // Layouts for all instructions. + + // A lambda for returning capabilities from a JSON object as strings. + const auto getCaps = [](const Json::Value& object) { + EnumCaps result; + const auto& caps = object["capabilities"]; + if (!caps.empty()) { + assert(caps.isArray()); + for (const auto& cap : caps) { + result.emplace_back(cap.asString()); + } + } + return result; + }; + + // A lambda for returning extensions from a JSON object as strings. + const auto getExts = [](const Json::Value& object) { + Extensions result; + const auto& exts = object["extensions"]; + if (!exts.empty()) { + assert(exts.isArray()); + for (const auto& ext : exts) { + result.emplace_back(ext.asString()); + } + } + return result; + }; + + const Json::Value insts = root["instructions"]; + for (const auto& inst : insts) { + const unsigned int opcode = inst["opcode"].asUInt(); + const std::string name = inst["opname"].asString(); + EnumCaps caps = getCaps(inst); + std::string version = inst["version"].asString(); + Extensions exts = getExts(inst); + OperandParameters operands; + bool defResultId = false; + bool defTypeId = false; + for (const auto& operand : inst["operands"]) { + const std::string kind = operand["kind"].asString(); + const std::string quantifier = operand.get("quantifier", "").asString(); + const std::string doc = operand.get("name", "").asString(); + if (!IsTypeOrResultId(kind, &defTypeId, &defResultId)) { + const auto p = ToOperandClassAndOptionality(kind, quantifier); + operands.push(p.type, doc, p.optional); + } + } + InstructionDesc.emplace_back( + std::move(EnumValue(opcode, name, + std::move(caps), std::move(version), std::move(exts), + std::move(operands))), + defTypeId, defResultId); + } + + // Specific additional context-dependent operands + + // Populate dest with EnumValue objects constructed from source. + const auto populateEnumValues = [&getCaps,&getExts](EnumValues* dest, const Json::Value& source, bool bitEnum) { + // A lambda for determining the numeric value to be used for a given + // enumerant in JSON form, and whether that value is a 0 in a bitfield. + auto getValue = [&bitEnum](const Json::Value& enumerant) { + std::pair result{0u,false}; + if (!bitEnum) { + result.first = enumerant["value"].asUInt(); + } else { + const unsigned int bit = NumberStringToBit(enumerant["value"].asString()); + if (bit == 0) + result.second = true; + else + result.first = bit - 1; // This is the *shift* amount. + } + return result; + }; + + for (const auto& enumerant : source["enumerants"]) { + unsigned value; + bool skip_zero_in_bitfield; + std::tie(value, skip_zero_in_bitfield) = getValue(enumerant); + if (skip_zero_in_bitfield) + continue; + EnumCaps caps(getCaps(enumerant)); + std::string version = enumerant["version"].asString(); + Extensions exts(getExts(enumerant)); + OperandParameters params; + const Json::Value& paramsJson = enumerant["parameters"]; + if (!paramsJson.empty()) { // This enumerant has parameters. + assert(paramsJson.isArray()); + for (const auto& param : paramsJson) { + const std::string kind = param["kind"].asString(); + const std::string doc = param.get("name", "").asString(); + const auto p = ToOperandClassAndOptionality(kind, ""); // All parameters are required! + params.push(p.type, doc); + } + } + dest->emplace_back( + value, enumerant["enumerant"].asString(), + std::move(caps), std::move(version), std::move(exts), std::move(params)); + } + }; + + const auto establishOperandClass = [&populateEnumValues]( + const std::string& enumName, spv::OperandClass operandClass, + spv::EnumValues* enumValues, const Json::Value& operandEnum, const std::string& category) { + assert(category == "BitEnum" || category == "ValueEnum"); + bool bitEnum = (category == "BitEnum"); + populateEnumValues(enumValues, operandEnum, bitEnum); + OperandClassParams[operandClass].set(enumName, enumValues, bitEnum); + }; + + const Json::Value operandEnums = root["operand_kinds"]; + for (const auto& operandEnum : operandEnums) { + const std::string enumName = operandEnum["kind"].asString(); + const std::string category = operandEnum["category"].asString(); + if (enumName == "SourceLanguage") { + establishOperandClass(enumName, OperandSource, &SourceLanguageParams, operandEnum, category); + } else if (enumName == "Decoration") { + establishOperandClass(enumName, OperandDecoration, &DecorationParams, operandEnum, category); + } else if (enumName == "ExecutionMode") { + establishOperandClass(enumName, OperandExecutionMode, &ExecutionModeParams, operandEnum, category); + } else if (enumName == "Capability") { + establishOperandClass(enumName, OperandCapability, &CapabilityParams, operandEnum, category); + } else if (enumName == "AddressingModel") { + establishOperandClass(enumName, OperandAddressing, &AddressingParams, operandEnum, category); + } else if (enumName == "MemoryModel") { + establishOperandClass(enumName, OperandMemory, &MemoryParams, operandEnum, category); + } else if (enumName == "MemorySemantics") { + establishOperandClass(enumName, OperandMemorySemantics, &MemorySemanticsParams, operandEnum, category); + } else if (enumName == "ExecutionModel") { + establishOperandClass(enumName, OperandExecutionModel, &ExecutionModelParams, operandEnum, category); + } else if (enumName == "StorageClass") { + establishOperandClass(enumName, OperandStorage, &StorageParams, operandEnum, category); + } else if (enumName == "SamplerAddressingMode") { + establishOperandClass(enumName, OperandSamplerAddressingMode, &SamplerAddressingModeParams, operandEnum, category); + } else if (enumName == "SamplerFilterMode") { + establishOperandClass(enumName, OperandSamplerFilterMode, &SamplerFilterModeParams, operandEnum, category); + } else if (enumName == "ImageFormat") { + establishOperandClass(enumName, OperandSamplerImageFormat, &ImageFormatParams, operandEnum, category); + } else if (enumName == "ImageChannelOrder") { + establishOperandClass(enumName, OperandImageChannelOrder, &ImageChannelOrderParams, operandEnum, category); + } else if (enumName == "ImageChannelDataType") { + establishOperandClass(enumName, OperandImageChannelDataType, &ImageChannelDataTypeParams, operandEnum, category); + } else if (enumName == "ImageOperands") { + establishOperandClass(enumName, OperandImageOperands, &ImageOperandsParams, operandEnum, category); + } else if (enumName == "FPFastMathMode") { + establishOperandClass(enumName, OperandFPFastMath, &FPFastMathParams, operandEnum, category); + } else if (enumName == "FPRoundingMode") { + establishOperandClass(enumName, OperandFPRoundingMode, &FPRoundingModeParams, operandEnum, category); + } else if (enumName == "LinkageType") { + establishOperandClass(enumName, OperandLinkageType, &LinkageTypeParams, operandEnum, category); + } else if (enumName == "FunctionParameterAttribute") { + establishOperandClass(enumName, OperandFuncParamAttr, &FuncParamAttrParams, operandEnum, category); + } else if (enumName == "AccessQualifier") { + establishOperandClass(enumName, OperandAccessQualifier, &AccessQualifierParams, operandEnum, category); + } else if (enumName == "BuiltIn") { + establishOperandClass(enumName, OperandBuiltIn, &BuiltInParams, operandEnum, category); + } else if (enumName == "SelectionControl") { + establishOperandClass(enumName, OperandSelect, &SelectionControlParams, operandEnum, category); + } else if (enumName == "LoopControl") { + establishOperandClass(enumName, OperandLoop, &LoopControlParams, operandEnum, category); + } else if (enumName == "FunctionControl") { + establishOperandClass(enumName, OperandFunction, &FunctionControlParams, operandEnum, category); + } else if (enumName == "Dim") { + establishOperandClass(enumName, OperandDimensionality, &DimensionalityParams, operandEnum, category); + } else if (enumName == "MemoryAccess") { + establishOperandClass(enumName, OperandMemoryAccess, &MemoryAccessParams, operandEnum, category); + } else if (enumName == "Scope") { + establishOperandClass(enumName, OperandScope, &ScopeParams, operandEnum, category); + } else if (enumName == "GroupOperation") { + establishOperandClass(enumName, OperandGroupOperation, &GroupOperationParams, operandEnum, category); + } else if (enumName == "KernelEnqueueFlags") { + establishOperandClass(enumName, OperandKernelEnqueueFlags, &KernelEnqueueFlagsParams, operandEnum, category); + } else if (enumName == "KernelProfilingInfo") { + establishOperandClass(enumName, OperandKernelProfilingInfo, &KernelProfilingInfoParams, operandEnum, category); + } + } +} + +}; // end namespace spv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsonToSpirv.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsonToSpirv.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsonToSpirv.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsonToSpirv.h 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,259 @@ +// Copyright (c) 2014-2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +#pragma once +#ifndef JSON_TO_SPIRV +#define JSON_TO_SPIRV + +#include +#include +#include + +namespace spv { + + // Reads the file in the given |path|. Returns true and the contents of the +// file on success; otherwise, returns false and an empty string. +std::pair ReadFile(const std::string& path); + +// Fill in all the parameters +void jsonToSpirv(const std::string& jsonPath); + +// For parameterizing operands. +enum OperandClass { + OperandNone, + OperandId, + OperandVariableIds, + OperandOptionalLiteral, + OperandOptionalLiteralString, + OperandVariableLiterals, + OperandVariableIdLiteral, + OperandVariableLiteralId, + OperandLiteralNumber, + OperandLiteralString, + OperandSource, + OperandExecutionModel, + OperandAddressing, + OperandMemory, + OperandExecutionMode, + OperandStorage, + OperandDimensionality, + OperandSamplerAddressingMode, + OperandSamplerFilterMode, + OperandSamplerImageFormat, + OperandImageChannelOrder, + OperandImageChannelDataType, + OperandImageOperands, + OperandFPFastMath, + OperandFPRoundingMode, + OperandLinkageType, + OperandAccessQualifier, + OperandFuncParamAttr, + OperandDecoration, + OperandBuiltIn, + OperandSelect, + OperandLoop, + OperandFunction, + OperandMemorySemantics, + OperandMemoryAccess, + OperandScope, + OperandGroupOperation, + OperandKernelEnqueueFlags, + OperandKernelProfilingInfo, + OperandCapability, + + OperandOpcode, + + OperandCount +}; + +// Any specific enum can have a set of capabilities that allow it: +typedef std::vector EnumCaps; + +// A set of extensions. +typedef std::vector Extensions; + +// Parameterize a set of operands with their OperandClass(es) and descriptions. +class OperandParameters { +public: + OperandParameters() { } + void push(OperandClass oc, const std::string& d, bool opt = false) + { + opClass.push_back(oc); + desc.push_back(d); + optional.push_back(opt); + } + void setOptional(); + OperandClass getClass(int op) const { return opClass[op]; } + const char* getDesc(int op) const { return desc[op].c_str(); } + bool isOptional(int op) const { return optional[op]; } + int getNum() const { return (int)opClass.size(); } + +protected: + std::vector opClass; + std::vector desc; + std::vector optional; +}; + +// An ordered sequence of EValue. We'll preserve the order found in the +// JSON file. You can look up a value by enum or by name. If there are +// duplicate values, then take the first. We assume names are unique. +// The EValue must have an unsigned |value| field and a string |name| field. +template +class EnumValuesContainer { +public: + using ContainerType = std::vector; + using iterator = typename ContainerType::iterator; + using const_iterator = typename ContainerType::const_iterator; + + EnumValuesContainer() {} + + // Constructs an EValue in place as a new element at the end of the + // sequence. + template + void emplace_back(Args&&... args) { + values.emplace_back(std::forward(args)...); + } + + // Returns the first EValue in the sequence with the given value. + // More than one EValue might have the same value. + EValue& operator[](unsigned value) { + auto where = std::find_if(begin(), end(), [&value](const EValue& e) { + return value == e.value; + }); + assert((where != end()) && "Could not find enum in the enum list"); + return *where; + } + // Returns the EValue with the given name. We assume uniqueness + // by name. + EValue& at(std::string name) { + auto where = std::find_if(begin(), end(), [&name](const EValue& e) { + return name == e.name; + }); + assert((where != end()) && "Could not find name in the enum list"); + return *where; + } + + iterator begin() { return values.begin(); } + iterator end() { return values.end(); } + +private: + ContainerType values; +}; + +// A single enumerant value. Corresponds to a row in an enumeration table +// in the spec. +class EnumValue { +public: + EnumValue() : value(0), desc(nullptr) {} + EnumValue(unsigned int the_value, const std::string& the_name, EnumCaps&& the_caps, const std::string& the_version, + Extensions&& the_extensions, OperandParameters&& the_operands) : + value(the_value), name(the_name), capabilities(std::move(the_caps)), version(std::move(the_version)), + extensions(std::move(the_extensions)), operands(std::move(the_operands)), desc(nullptr) { } + + // For ValueEnum, the value from the JSON file. + // For BitEnum, the index of the bit position represented by this mask. + // (That is, what you shift 1 by to get the mask.) + unsigned value; + std::string name; + EnumCaps capabilities; + std::string version; + // A feature only be enabled by certain extensions. + // An empty list means the feature does not require an extension. + // Normally, only Capability enums are enabled by extension. In turn, + // other enums and instructions are enabled by those capabilities. + Extensions extensions; + OperandParameters operands; + const char* desc; +}; + +using EnumValues = EnumValuesContainer; + +// Parameterize a set of enumerants that form an enum +class EnumDefinition { +public: + EnumDefinition() : + desc(0), bitmask(false), enumValues(nullptr) { } + void set(const std::string& enumName, EnumValues* enumValuesArg, bool mask = false) + { + codeName = enumName; + bitmask = mask; + enumValues = enumValuesArg; + } + // Returns the first EnumValue in the sequence with the given value. + // More than one EnumValue might have the same value. Only valid + // if enumValues has been populated. + EnumValue& operator[](unsigned value) { + assert(enumValues != nullptr); + return (*enumValues)[value]; + } + // Returns the name of the first EnumValue with the given value. + // Assumes enumValues has been populated. + const char* getName(unsigned value) { + return (*this)[value].name.c_str(); + } + + using iterator = EnumValues::iterator; + iterator begin() { return enumValues->begin(); } + iterator end() { return enumValues->end(); } + + std::string codeName; // name to use when declaring headers for code + const char* desc; + bool bitmask; // true if these enumerants combine into a bitmask + EnumValues* enumValues; // parameters for each individual enumerant +}; + +// Parameterize an instruction's logical format, including its known set of operands, +// per OperandParameters above. +class InstructionValue : public EnumValue { +public: + InstructionValue(EnumValue&& e, bool has_type, bool has_result) + : EnumValue(std::move(e)), + opDesc("TBD"), + opClass(0), + typePresent(has_type), + resultPresent(has_result) {} + + bool hasResult() const { return resultPresent != 0; } + bool hasType() const { return typePresent != 0; } + + const char* opDesc; + int opClass; + +protected: + int typePresent : 1; + int resultPresent : 1; +}; + +using InstructionValues = EnumValuesContainer; + +// Parameterization info for all instructions. +extern InstructionValues InstructionDesc; + +// These hold definitions of the enumerants used for operands. +// This is indexed by OperandClass, but not including OperandOpcode. +extern EnumDefinition OperandClassParams[]; + +}; // end namespace spv + +#endif // JSON_TO_SPIRV diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/main.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/main.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/main.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/main.cpp 2018-04-27 11:46:33.000000000 +0000 @@ -0,0 +1,121 @@ +// Copyright (c) 2014-2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +//#include +#include +#include + +#include "jsonToSpirv.h" +#include "header.h" + +// Command-line options +enum TOptions { + EOptionNone = 0x000, + EOptionPrintHeader = 0x008, +}; + +std::string jsonPath; +int Options; +spv::TLanguage Language; + +void Usage() +{ + printf("Usage: spirv option [file]\n" + "\n" + " -h print header for given language to stdout, from one of:\n" + " C - C99 header\n" + " C++ - C++03 or greater header (also accepts C++03)\n" + " C++11 - C++11 or greater header\n" + " JSON - JSON format data\n" + " Lua - Lua module\n" + " Python - Python module (also accepts Py)\n" + " -H print header in all supported languages to files in current directory\n" + ); +} + +std::string tolower_s(std::string s) +{ + std::transform(s.begin(), s.end(), s.begin(), ::tolower); + return s; +} + +bool ProcessArguments(int argc, char* argv[]) +{ + argc--; + argv++; + for (; argc >= 1; argc--, argv++) { + if (argv[0][0] == '-') { + switch (argv[0][1]) { + case 'H': + Options |= EOptionPrintHeader; + Language = spv::ELangAll; + break; + case 'h': { + if (argc < 2) + return false; + + Options |= EOptionPrintHeader; + const std::string language(tolower_s(argv[1])); + + if (language == "c") { + Language = spv::ELangC; + } else if (language == "c++" || language == "c++03") { + Language = spv::ELangCPP; + } else if (language == "c++11") { + Language = spv::ELangCPP11; + } else if (language == "json") { + Language = spv::ELangJSON; + } else if (language == "lua") { + Language = spv::ELangLua; + } else if (language == "python" || language == "py") { + Language = spv::ELangPython; + } else + return false; + + return true; + } + default: + return false; + } + } else { + jsonPath = std::string(argv[0]); + } + } + + return true; +} + +int main(int argc, char* argv[]) +{ + if (argc < 2 || ! ProcessArguments(argc, argv)) { + Usage(); + return 1; + } + + spv::jsonToSpirv(jsonPath); + if (Options & EOptionPrintHeader) + spv::PrintHeader(Language, std::cout); + + return 0; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/include/spirv-tools/libspirv.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/include/spirv-tools/libspirv.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/include/spirv-tools/libspirv.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/include/spirv-tools/libspirv.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,586 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SPIRV_TOOLS_LIBSPIRV_H_ +#define SPIRV_TOOLS_LIBSPIRV_H_ + +#ifdef __cplusplus +extern "C" { +#else +#include +#endif + +#include +#include + +#if defined(SPIRV_TOOLS_SHAREDLIB) +#if defined(_WIN32) +#if defined(SPIRV_TOOLS_IMPLEMENTATION) +#define SPIRV_TOOLS_EXPORT __declspec(dllexport) +#else +#define SPIRV_TOOLS_EXPORT __declspec(dllimport) +#endif +#else +#if defined(SPIRV_TOOLS_IMPLEMENTATION) +#define SPIRV_TOOLS_EXPORT __attribute__((visibility("default"))) +#else +#define SPIRV_TOOLS_EXPORT +#endif +#endif +#else +#define SPIRV_TOOLS_EXPORT +#endif + +// Helpers + +#define SPV_BIT(shift) (1 << (shift)) + +#define SPV_FORCE_16_BIT_ENUM(name) _##name = 0x7fff +#define SPV_FORCE_32_BIT_ENUM(name) _##name = 0x7fffffff + +// Enumerations + +typedef enum spv_result_t { + SPV_SUCCESS = 0, + SPV_UNSUPPORTED = 1, + SPV_END_OF_STREAM = 2, + SPV_WARNING = 3, + SPV_FAILED_MATCH = 4, + SPV_REQUESTED_TERMINATION = 5, // Success, but signals early termination. + SPV_ERROR_INTERNAL = -1, + SPV_ERROR_OUT_OF_MEMORY = -2, + SPV_ERROR_INVALID_POINTER = -3, + SPV_ERROR_INVALID_BINARY = -4, + SPV_ERROR_INVALID_TEXT = -5, + SPV_ERROR_INVALID_TABLE = -6, + SPV_ERROR_INVALID_VALUE = -7, + SPV_ERROR_INVALID_DIAGNOSTIC = -8, + SPV_ERROR_INVALID_LOOKUP = -9, + SPV_ERROR_INVALID_ID = -10, + SPV_ERROR_INVALID_CFG = -11, + SPV_ERROR_INVALID_LAYOUT = -12, + SPV_ERROR_INVALID_CAPABILITY = -13, + SPV_ERROR_INVALID_DATA = -14, // Indicates data rules validation failure. + SPV_ERROR_MISSING_EXTENSION = -15, + SPV_ERROR_WRONG_VERSION = -16, // Indicates wrong SPIR-V version + SPV_FORCE_32_BIT_ENUM(spv_result_t) +} spv_result_t; + +// Severity levels of messages communicated to the consumer. +typedef enum spv_message_level_t { + SPV_MSG_FATAL, // Unrecoverable error due to environment. + // Will exit the program immediately. E.g., + // out of memory. + SPV_MSG_INTERNAL_ERROR, // Unrecoverable error due to SPIRV-Tools + // internals. + // Will exit the program immediately. E.g., + // unimplemented feature. + SPV_MSG_ERROR, // Normal error due to user input. + SPV_MSG_WARNING, // Warning information. + SPV_MSG_INFO, // General information. + SPV_MSG_DEBUG, // Debug information. +} spv_message_level_t; + +typedef enum spv_endianness_t { + SPV_ENDIANNESS_LITTLE, + SPV_ENDIANNESS_BIG, + SPV_FORCE_32_BIT_ENUM(spv_endianness_t) +} spv_endianness_t; + +// The kinds of operands that an instruction may have. +// +// Some operand types are "concrete". The binary parser uses a concrete +// operand type to describe an operand of a parsed instruction. +// +// The assembler uses all operand types. In addition to determining what +// kind of value an operand may be, non-concrete operand types capture the +// fact that an operand might be optional (may be absent, or present exactly +// once), or might occur zero or more times. +// +// Sometimes we also need to be able to express the fact that an operand +// is a member of an optional tuple of values. In that case the first member +// would be optional, and the subsequent members would be required. +typedef enum spv_operand_type_t { + // A sentinel value. + SPV_OPERAND_TYPE_NONE = 0, + + // Set 1: Operands that are IDs. + SPV_OPERAND_TYPE_ID, + SPV_OPERAND_TYPE_TYPE_ID, + SPV_OPERAND_TYPE_RESULT_ID, + SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, // SPIR-V Sec 3.25 + SPV_OPERAND_TYPE_SCOPE_ID, // SPIR-V Sec 3.27 + + // Set 2: Operands that are literal numbers. + SPV_OPERAND_TYPE_LITERAL_INTEGER, // Always unsigned 32-bits. + // The Instruction argument to OpExtInst. It's an unsigned 32-bit literal + // number indicating which instruction to use from an extended instruction + // set. + SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER, + // The Opcode argument to OpSpecConstantOp. It determines the operation + // to be performed on constant operands to compute a specialization constant + // result. + SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER, + // A literal number whose format and size are determined by a previous operand + // in the same instruction. It's a signed integer, an unsigned integer, or a + // floating point number. It also has a specified bit width. The width + // may be larger than 32, which would require such a typed literal value to + // occupy multiple SPIR-V words. + SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER, + + // Set 3: The literal string operand type. + SPV_OPERAND_TYPE_LITERAL_STRING, + + // Set 4: Operands that are a single word enumerated value. + SPV_OPERAND_TYPE_SOURCE_LANGUAGE, // SPIR-V Sec 3.2 + SPV_OPERAND_TYPE_EXECUTION_MODEL, // SPIR-V Sec 3.3 + SPV_OPERAND_TYPE_ADDRESSING_MODEL, // SPIR-V Sec 3.4 + SPV_OPERAND_TYPE_MEMORY_MODEL, // SPIR-V Sec 3.5 + SPV_OPERAND_TYPE_EXECUTION_MODE, // SPIR-V Sec 3.6 + SPV_OPERAND_TYPE_STORAGE_CLASS, // SPIR-V Sec 3.7 + SPV_OPERAND_TYPE_DIMENSIONALITY, // SPIR-V Sec 3.8 + SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE, // SPIR-V Sec 3.9 + SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE, // SPIR-V Sec 3.10 + SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT, // SPIR-V Sec 3.11 + SPV_OPERAND_TYPE_IMAGE_CHANNEL_ORDER, // SPIR-V Sec 3.12 + SPV_OPERAND_TYPE_IMAGE_CHANNEL_DATA_TYPE, // SPIR-V Sec 3.13 + SPV_OPERAND_TYPE_FP_ROUNDING_MODE, // SPIR-V Sec 3.16 + SPV_OPERAND_TYPE_LINKAGE_TYPE, // SPIR-V Sec 3.17 + SPV_OPERAND_TYPE_ACCESS_QUALIFIER, // SPIR-V Sec 3.18 + SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE, // SPIR-V Sec 3.19 + SPV_OPERAND_TYPE_DECORATION, // SPIR-V Sec 3.20 + SPV_OPERAND_TYPE_BUILT_IN, // SPIR-V Sec 3.21 + SPV_OPERAND_TYPE_GROUP_OPERATION, // SPIR-V Sec 3.28 + SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS, // SPIR-V Sec 3.29 + SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO, // SPIR-V Sec 3.30 + SPV_OPERAND_TYPE_CAPABILITY, // SPIR-V Sec 3.31 + + // Set 5: Operands that are a single word bitmask. + // Sometimes a set bit indicates the instruction requires still more operands. + SPV_OPERAND_TYPE_IMAGE, // SPIR-V Sec 3.14 + SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, // SPIR-V Sec 3.15 + SPV_OPERAND_TYPE_SELECTION_CONTROL, // SPIR-V Sec 3.22 + SPV_OPERAND_TYPE_LOOP_CONTROL, // SPIR-V Sec 3.23 + SPV_OPERAND_TYPE_FUNCTION_CONTROL, // SPIR-V Sec 3.24 + SPV_OPERAND_TYPE_MEMORY_ACCESS, // SPIR-V Sec 3.26 + +// The remaining operand types are only used internally by the assembler. +// There are two categories: +// Optional : expands to 0 or 1 operand, like ? in regular expressions. +// Variable : expands to 0, 1 or many operands or pairs of operands. +// This is similar to * in regular expressions. + +// Macros for defining bounds on optional and variable operand types. +// Any variable operand type is also optional. +#define FIRST_OPTIONAL(ENUM) ENUM, SPV_OPERAND_TYPE_FIRST_OPTIONAL_TYPE = ENUM +#define FIRST_VARIABLE(ENUM) ENUM, SPV_OPERAND_TYPE_FIRST_VARIABLE_TYPE = ENUM +#define LAST_VARIABLE(ENUM) \ + ENUM, SPV_OPERAND_TYPE_LAST_VARIABLE_TYPE = ENUM, \ + SPV_OPERAND_TYPE_LAST_OPTIONAL_TYPE = ENUM + + // An optional operand represents zero or one logical operands. + // In an instruction definition, this may only appear at the end of the + // operand types. + FIRST_OPTIONAL(SPV_OPERAND_TYPE_OPTIONAL_ID), + // An optional image operand type. + SPV_OPERAND_TYPE_OPTIONAL_IMAGE, + // An optional memory access type. + SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, + // An optional literal integer. + SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER, + // An optional literal number, which may be either integer or floating point. + SPV_OPERAND_TYPE_OPTIONAL_LITERAL_NUMBER, + // Like SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER, but optional, and integral. + SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER, + // An optional literal string. + SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING, + // An optional access qualifier + SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER, + // An optional context-independent value, or CIV. CIVs are tokens that we can + // assemble regardless of where they occur -- literals, IDs, immediate + // integers, etc. + SPV_OPERAND_TYPE_OPTIONAL_CIV, + + // A variable operand represents zero or more logical operands. + // In an instruction definition, this may only appear at the end of the + // operand types. + FIRST_VARIABLE(SPV_OPERAND_TYPE_VARIABLE_ID), + SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER, + // A sequence of zero or more pairs of (typed literal integer, Id). + // Expands to zero or more: + // (SPV_OPERAND_TYPE_TYPED_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID) + // where the literal number must always be an integer of some sort. + SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER_ID, + // A sequence of zero or more pairs of (Id, Literal integer) + LAST_VARIABLE(SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER), + + // The following are concrete enum types. + SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS, // DebugInfo Sec 3.2. A mask. + SPV_OPERAND_TYPE_DEBUG_BASE_TYPE_ATTRIBUTE_ENCODING, // DebugInfo Sec 3.3 + SPV_OPERAND_TYPE_DEBUG_COMPOSITE_TYPE, // DebugInfo Sec 3.4 + SPV_OPERAND_TYPE_DEBUG_TYPE_QUALIFIER, // DebugInfo Sec 3.5 + SPV_OPERAND_TYPE_DEBUG_OPERATION, // DebugInfo Sec 3.6 + + // This is a sentinel value, and does not represent an operand type. + // It should come last. + SPV_OPERAND_TYPE_NUM_OPERAND_TYPES, + + SPV_FORCE_32_BIT_ENUM(spv_operand_type_t) +} spv_operand_type_t; + +typedef enum spv_ext_inst_type_t { + SPV_EXT_INST_TYPE_NONE = 0, + SPV_EXT_INST_TYPE_GLSL_STD_450, + SPV_EXT_INST_TYPE_OPENCL_STD, + SPV_EXT_INST_TYPE_SPV_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER, + SPV_EXT_INST_TYPE_SPV_AMD_SHADER_TRINARY_MINMAX, + SPV_EXT_INST_TYPE_SPV_AMD_GCN_SHADER, + SPV_EXT_INST_TYPE_SPV_AMD_SHADER_BALLOT, + SPV_EXT_INST_TYPE_DEBUGINFO, + + SPV_FORCE_32_BIT_ENUM(spv_ext_inst_type_t) +} spv_ext_inst_type_t; + +// This determines at a high level the kind of a binary-encoded literal +// number, but not the bit width. +// In principle, these could probably be folded into new entries in +// spv_operand_type_t. But then we'd have some special case differences +// between the assembler and disassembler. +typedef enum spv_number_kind_t { + SPV_NUMBER_NONE = 0, // The default for value initialization. + SPV_NUMBER_UNSIGNED_INT, + SPV_NUMBER_SIGNED_INT, + SPV_NUMBER_FLOATING, +} spv_number_kind_t; + +typedef enum spv_text_to_binary_options_t { + SPV_TEXT_TO_BINARY_OPTION_NONE = SPV_BIT(0), + // Numeric IDs in the binary will have the same values as in the source. + // Non-numeric IDs are allocated by filling in the gaps, starting with 1 + // and going up. + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS = SPV_BIT(1), + SPV_FORCE_32_BIT_ENUM(spv_text_to_binary_options_t) +} spv_text_to_binary_options_t; + +typedef enum spv_binary_to_text_options_t { + SPV_BINARY_TO_TEXT_OPTION_NONE = SPV_BIT(0), + SPV_BINARY_TO_TEXT_OPTION_PRINT = SPV_BIT(1), + SPV_BINARY_TO_TEXT_OPTION_COLOR = SPV_BIT(2), + SPV_BINARY_TO_TEXT_OPTION_INDENT = SPV_BIT(3), + SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET = SPV_BIT(4), + // Do not output the module header as leading comments in the assembly. + SPV_BINARY_TO_TEXT_OPTION_NO_HEADER = SPV_BIT(5), + // Use friendly names where possible. The heuristic may expand over + // time, but will use common names for scalar types, and debug names from + // OpName instructions. + SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES = SPV_BIT(6), + SPV_FORCE_32_BIT_ENUM(spv_binary_to_text_options_t) +} spv_binary_to_text_options_t; + +// Structures + +// Information about an operand parsed from a binary SPIR-V module. +// Note that the values are not included. You still need access to the binary +// to extract the values. +typedef struct spv_parsed_operand_t { + // Location of the operand, in words from the start of the instruction. + uint16_t offset; + // Number of words occupied by this operand. + uint16_t num_words; + // The "concrete" operand type. See the definition of spv_operand_type_t + // for details. + spv_operand_type_t type; + // If type is a literal number type, then number_kind says whether it's + // a signed integer, an unsigned integer, or a floating point number. + spv_number_kind_t number_kind; + // The number of bits for a literal number type. + uint32_t number_bit_width; +} spv_parsed_operand_t; + +// An instruction parsed from a binary SPIR-V module. +typedef struct spv_parsed_instruction_t { + // An array of words for this instruction, in native endianness. + const uint32_t* words; + // The number of words in this instruction. + uint16_t num_words; + uint16_t opcode; + // The extended instruction type, if opcode is OpExtInst. Otherwise + // this is the "none" value. + spv_ext_inst_type_t ext_inst_type; + // The type id, or 0 if this instruction doesn't have one. + uint32_t type_id; + // The result id, or 0 if this instruction doesn't have one. + uint32_t result_id; + // The array of parsed operands. + const spv_parsed_operand_t* operands; + uint16_t num_operands; +} spv_parsed_instruction_t; + +typedef struct spv_const_binary_t { + const uint32_t* code; + const size_t wordCount; +} spv_const_binary_t; + +typedef struct spv_binary_t { + uint32_t* code; + size_t wordCount; +} spv_binary_t; + +typedef struct spv_text_t { + const char* str; + size_t length; +} spv_text_t; + +typedef struct spv_position_t { + size_t line; + size_t column; + size_t index; +} spv_position_t; + +typedef struct spv_diagnostic_t { + spv_position_t position; + char* error; + bool isTextSource; +} spv_diagnostic_t; + +// Opaque struct containing the context used to operate on a SPIR-V module. +// Its object is used by various translation API functions. +typedef struct spv_context_t spv_context_t; + +typedef struct spv_validator_options_t spv_validator_options_t; + +// Type Definitions + +typedef spv_const_binary_t* spv_const_binary; +typedef spv_binary_t* spv_binary; +typedef spv_text_t* spv_text; +typedef spv_position_t* spv_position; +typedef spv_diagnostic_t* spv_diagnostic; +typedef const spv_context_t* spv_const_context; +typedef spv_context_t* spv_context; +typedef spv_validator_options_t* spv_validator_options; +typedef const spv_validator_options_t* spv_const_validator_options; + +// Platform API + +// Returns the SPIRV-Tools software version as a null-terminated string. +// The contents of the underlying storage is valid for the remainder of +// the process. +SPIRV_TOOLS_EXPORT const char* spvSoftwareVersionString(void); +// Returns a null-terminated string containing the name of the project, +// the software version string, and commit details. +// The contents of the underlying storage is valid for the remainder of +// the process. +SPIRV_TOOLS_EXPORT const char* spvSoftwareVersionDetailsString(void); + +// Certain target environments impose additional restrictions on SPIR-V, so it's +// often necessary to specify which one applies. SPV_ENV_UNIVERSAL means +// environment-agnostic SPIR-V. +typedef enum { + SPV_ENV_UNIVERSAL_1_0, // SPIR-V 1.0 latest revision, no other restrictions. + SPV_ENV_VULKAN_1_0, // Vulkan 1.0 latest revision. + SPV_ENV_UNIVERSAL_1_1, // SPIR-V 1.1 latest revision, no other restrictions. + SPV_ENV_OPENCL_2_1, // OpenCL Full Profile 2.1 latest revision. + SPV_ENV_OPENCL_2_2, // OpenCL Full Profile 2.2 latest revision. + SPV_ENV_OPENGL_4_0, // OpenGL 4.0 plus GL_ARB_gl_spirv, latest revisions. + SPV_ENV_OPENGL_4_1, // OpenGL 4.1 plus GL_ARB_gl_spirv, latest revisions. + SPV_ENV_OPENGL_4_2, // OpenGL 4.2 plus GL_ARB_gl_spirv, latest revisions. + SPV_ENV_OPENGL_4_3, // OpenGL 4.3 plus GL_ARB_gl_spirv, latest revisions. + // There is no variant for OpenGL 4.4. + SPV_ENV_OPENGL_4_5, // OpenGL 4.5 plus GL_ARB_gl_spirv, latest revisions. + SPV_ENV_UNIVERSAL_1_2, // SPIR-V 1.2, latest revision, no other restrictions. + SPV_ENV_OPENCL_1_2, // OpenCL Full Profile 1.2 plus cl_khr_il_program, + // latest revision. + SPV_ENV_OPENCL_EMBEDDED_1_2, // OpenCL Embedded Profile 1.2 plus + // cl_khr_il_program, latest revision. + SPV_ENV_OPENCL_2_0, // OpenCL Full Profile 2.0 plus cl_khr_il_program, + // latest revision. + SPV_ENV_OPENCL_EMBEDDED_2_0, // OpenCL Embedded Profile 2.0 plus + // cl_khr_il_program, latest revision. + SPV_ENV_OPENCL_EMBEDDED_2_1, // OpenCL Embedded Profile 2.1 latest revision. + SPV_ENV_OPENCL_EMBEDDED_2_2, // OpenCL Embedded Profile 2.2 latest revision. + SPV_ENV_UNIVERSAL_1_3, // SPIR-V 1.3 latest revision, no other restrictions. + SPV_ENV_VULKAN_1_1, // Vulkan 1.0 latest revision. +} spv_target_env; + +// SPIR-V Validator can be parameterized with the following Universal Limits. +typedef enum { + spv_validator_limit_max_struct_members, + spv_validator_limit_max_struct_depth, + spv_validator_limit_max_local_variables, + spv_validator_limit_max_global_variables, + spv_validator_limit_max_switch_branches, + spv_validator_limit_max_function_args, + spv_validator_limit_max_control_flow_nesting_depth, + spv_validator_limit_max_access_chain_indexes, +} spv_validator_limit; + +// Returns a string describing the given SPIR-V target environment. +SPIRV_TOOLS_EXPORT const char* spvTargetEnvDescription(spv_target_env env); + +// Creates a context object. Returns null if env is invalid. +SPIRV_TOOLS_EXPORT spv_context spvContextCreate(spv_target_env env); + +// Destroys the given context object. +SPIRV_TOOLS_EXPORT void spvContextDestroy(spv_context context); + +// Creates a Validator options object with default options. Returns a valid +// options object. The object remains valid until it is passed into +// spvValidatorOptionsDestroy. +SPIRV_TOOLS_EXPORT spv_validator_options spvValidatorOptionsCreate(void); + +// Destroys the given Validator options object. +SPIRV_TOOLS_EXPORT void spvValidatorOptionsDestroy( + spv_validator_options options); + +// Records the maximum Universal Limit that is considered valid in the given +// Validator options object. argument must be a valid options object. +SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetUniversalLimit( + spv_validator_options options, spv_validator_limit limit_type, + uint32_t limit); + +// Record whether or not the validator should relax the rules on types for +// stores to structs. When relaxed, it will allow a type mismatch as long as +// the types are structs with the same layout. Two structs have the same layout +// if +// +// 1) the members of the structs are either the same type or are structs with +// same layout, and +// +// 2) the decorations that affect the memory layout are identical for both +// types. Other decorations are not relevant. +SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetRelaxStoreStruct( + spv_validator_options options, bool val); + +// Records whether or not the validator should relax the rules on pointer usage +// in logical addressing mode. +// +// When relaxed, it will allow the following usage cases of pointers: +// 1) OpVariable allocating an object whose type is a pointer type +// 2) OpReturnValue returning a pointer value +SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetRelaxLogicalPointer( + spv_validator_options options, bool val); + +// Encodes the given SPIR-V assembly text to its binary representation. The +// length parameter specifies the number of bytes for text. Encoded binary will +// be stored into *binary. Any error will be written into *diagnostic if +// diagnostic is non-null. The generated binary is independent of the context +// and may outlive it. +SPIRV_TOOLS_EXPORT spv_result_t spvTextToBinary(const spv_const_context context, + const char* text, + const size_t length, + spv_binary* binary, + spv_diagnostic* diagnostic); + +// Encodes the given SPIR-V assembly text to its binary representation. Same as +// spvTextToBinary but with options. The options parameter is a bit field of +// spv_text_to_binary_options_t. +SPIRV_TOOLS_EXPORT spv_result_t spvTextToBinaryWithOptions( + const spv_const_context context, const char* text, const size_t length, + const uint32_t options, spv_binary* binary, spv_diagnostic* diagnostic); + +// Frees an allocated text stream. This is a no-op if the text parameter +// is a null pointer. +SPIRV_TOOLS_EXPORT void spvTextDestroy(spv_text text); + +// Decodes the given SPIR-V binary representation to its assembly text. The +// word_count parameter specifies the number of words for binary. The options +// parameter is a bit field of spv_binary_to_text_options_t. Decoded text will +// be stored into *text. Any error will be written into *diagnostic if +// diagnostic is non-null. +SPIRV_TOOLS_EXPORT spv_result_t spvBinaryToText(const spv_const_context context, + const uint32_t* binary, + const size_t word_count, + const uint32_t options, + spv_text* text, + spv_diagnostic* diagnostic); + +// Frees a binary stream from memory. This is a no-op if binary is a null +// pointer. +SPIRV_TOOLS_EXPORT void spvBinaryDestroy(spv_binary binary); + +// Validates a SPIR-V binary for correctness. Any errors will be written into +// *diagnostic if diagnostic is non-null. +SPIRV_TOOLS_EXPORT spv_result_t spvValidate(const spv_const_context context, + const spv_const_binary binary, + spv_diagnostic* diagnostic); + +// Validates a SPIR-V binary for correctness. Uses the provided Validator +// options. Any errors will be written into *diagnostic if diagnostic is +// non-null. +SPIRV_TOOLS_EXPORT spv_result_t spvValidateWithOptions( + const spv_const_context context, const spv_const_validator_options options, + const spv_const_binary binary, spv_diagnostic* diagnostic); + +// Validates a raw SPIR-V binary for correctness. Any errors will be written +// into *diagnostic if diagnostic is non-null. +SPIRV_TOOLS_EXPORT spv_result_t +spvValidateBinary(const spv_const_context context, const uint32_t* words, + const size_t num_words, spv_diagnostic* diagnostic); + +// Creates a diagnostic object. The position parameter specifies the location in +// the text/binary stream. The message parameter, copied into the diagnostic +// object, contains the error message to display. +SPIRV_TOOLS_EXPORT spv_diagnostic +spvDiagnosticCreate(const spv_position position, const char* message); + +// Destroys a diagnostic object. This is a no-op if diagnostic is a null +// pointer. +SPIRV_TOOLS_EXPORT void spvDiagnosticDestroy(spv_diagnostic diagnostic); + +// Prints the diagnostic to stderr. +SPIRV_TOOLS_EXPORT spv_result_t +spvDiagnosticPrint(const spv_diagnostic diagnostic); + +// The binary parser interface. + +// A pointer to a function that accepts a parsed SPIR-V header. +// The integer arguments are the 32-bit words from the header, as specified +// in SPIR-V 1.0 Section 2.3 Table 1. +// The function should return SPV_SUCCESS if parsing should continue. +typedef spv_result_t (*spv_parsed_header_fn_t)( + void* user_data, spv_endianness_t endian, uint32_t magic, uint32_t version, + uint32_t generator, uint32_t id_bound, uint32_t reserved); + +// A pointer to a function that accepts a parsed SPIR-V instruction. +// The parsed_instruction value is transient: it may be overwritten +// or released immediately after the function has returned. That also +// applies to the words array member of the parsed instruction. The +// function should return SPV_SUCCESS if and only if parsing should +// continue. +typedef spv_result_t (*spv_parsed_instruction_fn_t)( + void* user_data, const spv_parsed_instruction_t* parsed_instruction); + +// Parses a SPIR-V binary, specified as counted sequence of 32-bit words. +// Parsing feedback is provided via two callbacks provided as function +// pointers. Each callback function pointer can be a null pointer, in +// which case it is never called. Otherwise, in a valid parse the +// parsed-header callback is called once, and then the parsed-instruction +// callback once for each instruction in the stream. The user_data parameter +// is supplied as context to the callbacks. Returns SPV_SUCCESS on successful +// parse where the callbacks always return SPV_SUCCESS. For an invalid parse, +// returns a status code other than SPV_SUCCESS, and if diagnostic is non-null +// also emits a diagnostic. If a callback returns anything other than +// SPV_SUCCESS, then that status code is returned, no further callbacks are +// issued, and no additional diagnostics are emitted. +SPIRV_TOOLS_EXPORT spv_result_t spvBinaryParse( + const spv_const_context context, void* user_data, const uint32_t* words, + const size_t num_words, spv_parsed_header_fn_t parse_header, + spv_parsed_instruction_fn_t parse_instruction, spv_diagnostic* diagnostic); + +#ifdef __cplusplus +} +#endif + +#endif // SPIRV_TOOLS_LIBSPIRV_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/include/spirv-tools/libspirv.hpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/include/spirv-tools/libspirv.hpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/include/spirv-tools/libspirv.hpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/include/spirv-tools/libspirv.hpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,174 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SPIRV_TOOLS_LIBSPIRV_HPP_ +#define SPIRV_TOOLS_LIBSPIRV_HPP_ + +#include +#include +#include +#include + +#include "spirv-tools/libspirv.h" + +namespace spvtools { + +// Message consumer. The C strings for source and message are only alive for the +// specific invocation. +using MessageConsumer = std::function; + +// C++ RAII wrapper around the C context object spv_context. +class Context { + public: + // Constructs a context targeting the given environment |env|. + // + // The constructed instance will have an empty message consumer, which just + // ignores all messages from the library. Use SetMessageConsumer() to supply + // one if messages are of concern. + explicit Context(spv_target_env env); + + // Enables move constructor/assignment operations. + Context(Context&& other); + Context& operator=(Context&& other); + + // Disables copy constructor/assignment operations. + Context(const Context&) = delete; + Context& operator=(const Context&) = delete; + + // Destructs this instance. + ~Context(); + + // Sets the message consumer to the given |consumer|. The |consumer| will be + // invoked once for each message communicated from the library. + void SetMessageConsumer(MessageConsumer consumer); + + // Returns the underlying spv_context. + spv_context& CContext(); + const spv_context& CContext() const; + + private: + spv_context context_; +}; + +// A RAII wrapper around a validator options object. +class ValidatorOptions { + public: + ValidatorOptions() : options_(spvValidatorOptionsCreate()) {} + ~ValidatorOptions() { spvValidatorOptionsDestroy(options_); } + // Allow implicit conversion to the underlying object. + operator spv_validator_options() const { return options_; } + + // Sets a limit. + void SetUniversalLimit(spv_validator_limit limit_type, uint32_t limit) { + spvValidatorOptionsSetUniversalLimit(options_, limit_type, limit); + } + + void SetRelaxStructStore(bool val) { + spvValidatorOptionsSetRelaxStoreStruct(options_, val); + } + + // Records whether or not the validator should relax the rules on pointer + // usage in logical addressing mode. + // + // When relaxed, it will allow the following usage cases of pointers: + // 1) OpVariable allocating an object whose type is a pointer type + // 2) OpReturnValue returning a pointer value + void SetRelaxLogicalPointer(bool val) { + spvValidatorOptionsSetRelaxLogicalPointer(options_, val); + } + + private: + spv_validator_options options_; +}; + +// C++ interface for SPIRV-Tools functionalities. It wraps the context +// (including target environment and the corresponding SPIR-V grammar) and +// provides methods for assembling, disassembling, and validating. +// +// Instances of this class provide basic thread-safety guarantee. +class SpirvTools { + public: + enum { + // Default assembling option used by assemble(): + kDefaultAssembleOption = SPV_TEXT_TO_BINARY_OPTION_NONE, + + // Default disassembling option used by Disassemble(): + // * Avoid prefix comments from decoding the SPIR-V module header, and + // * Use friendly names for variables. + kDefaultDisassembleOption = SPV_BINARY_TO_TEXT_OPTION_NO_HEADER | + SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES + }; + + // Constructs an instance targeting the given environment |env|. + // + // The constructed instance will have an empty message consumer, which just + // ignores all messages from the library. Use SetMessageConsumer() to supply + // one if messages are of concern. + explicit SpirvTools(spv_target_env env); + + // Disables copy/move constructor/assignment operations. + SpirvTools(const SpirvTools&) = delete; + SpirvTools(SpirvTools&&) = delete; + SpirvTools& operator=(const SpirvTools&) = delete; + SpirvTools& operator=(SpirvTools&&) = delete; + + // Destructs this instance. + ~SpirvTools(); + + // Sets the message consumer to the given |consumer|. The |consumer| will be + // invoked once for each message communicated from the library. + void SetMessageConsumer(MessageConsumer consumer); + + // Assembles the given assembly |text| and writes the result to |binary|. + // Returns true on successful assembling. |binary| will be kept untouched if + // assembling is unsuccessful. + bool Assemble(const std::string& text, std::vector* binary, + uint32_t options = kDefaultAssembleOption) const; + // |text_size| specifies the number of bytes in |text|. A terminating null + // character is not required to present in |text| as long as |text| is valid. + bool Assemble(const char* text, size_t text_size, + std::vector* binary, + uint32_t options = kDefaultAssembleOption) const; + + // Disassembles the given SPIR-V |binary| with the given |options| and writes + // the assembly to |text|. Returns ture on successful disassembling. |text| + // will be kept untouched if diassembling is unsuccessful. + bool Disassemble(const std::vector& binary, std::string* text, + uint32_t options = kDefaultDisassembleOption) const; + // |binary_size| specifies the number of words in |binary|. + bool Disassemble(const uint32_t* binary, size_t binary_size, + std::string* text, + uint32_t options = kDefaultDisassembleOption) const; + + // Validates the given SPIR-V |binary|. Returns true if no issues are found. + // Otherwise, returns false and communicates issues via the message consumer + // registered. + bool Validate(const std::vector& binary) const; + // |binary_size| specifies the number of words in |binary|. + bool Validate(const uint32_t* binary, size_t binary_size) const; + // Like the previous overload, but takes an options object. + bool Validate(const uint32_t* binary, size_t binary_size, + const ValidatorOptions& options) const; + + private: + struct Impl; // Opaque struct for holding the data fields used by this class. + std::unique_ptr impl_; // Unique pointer to implementation data. +}; + +} // namespace spvtools + +#endif // SPIRV_TOOLS_LIBSPIRV_HPP_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/include/spirv-tools/linker.hpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/include/spirv-tools/linker.hpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/include/spirv-tools/linker.hpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/include/spirv-tools/linker.hpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,97 @@ +// Copyright (c) 2017 Pierre Moreau +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SPIRV_TOOLS_LINKER_HPP_ +#define SPIRV_TOOLS_LINKER_HPP_ + +#include + +#include +#include + +#include "libspirv.hpp" + +namespace spvtools { + +class LinkerOptions { + public: + LinkerOptions() + : create_library_(false), + verify_ids_(false), + allow_partial_linkage_(false) {} + + // Returns whether a library or an executable should be produced by the + // linking phase. + // + // All exported symbols are kept when creating a library, whereas they will + // be removed when creating an executable. + // The returned value will be true if creating a library, and false if + // creating an executable. + bool GetCreateLibrary() const { return create_library_; } + + // Sets whether a library or an executable should be produced. + void SetCreateLibrary(bool create_library) { + create_library_ = create_library; + } + + // Returns whether to verify the uniqueness of the unique ids in the merged + // context. + bool GetVerifyIds() const { return verify_ids_; } + + // Sets whether to verify the uniqueness of the unique ids in the merged + // context. + void SetVerifyIds(bool verify_ids) { verify_ids_ = verify_ids; } + + // Returns whether to allow for imported symbols to have no corresponding + // exported symbols + bool GetAllowPartialLinkage() const { return allow_partial_linkage_; } + + // Sets whether to allow for imported symbols to have no corresponding + // exported symbols + void SetAllowPartialLinkage(bool allow_partial_linkage) { + allow_partial_linkage_ = allow_partial_linkage; + } + + private: + bool create_library_; + bool verify_ids_; + bool allow_partial_linkage_; +}; + +// Links one or more SPIR-V modules into a new SPIR-V module. That is, combine +// several SPIR-V modules into one, resolving link dependencies between them. +// +// At least one binary has to be provided in |binaries|. Those binaries do not +// have to be valid, but they should be at least parseable. +// The functions can fail due to the following: +// * The given context was not initialised using `spvContextCreate()`; +// * No input modules were given; +// * One or more of those modules were not parseable; +// * The input modules used different addressing or memory models; +// * The ID or global variable number limit were exceeded; +// * Some entry points were defined multiple times; +// * Some imported symbols did not have an exported counterpart; +// * Possibly other reasons. +spv_result_t Link(const Context& context, + const std::vector>& binaries, + std::vector* linked_binary, + const LinkerOptions& options = LinkerOptions()); +spv_result_t Link(const Context& context, const uint32_t* const* binaries, + const size_t* binary_sizes, size_t num_binaries, + std::vector* linked_binary, + const LinkerOptions& options = LinkerOptions()); + +} // namespace spvtools + +#endif // SPIRV_TOOLS_LINKER_HPP_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/include/spirv-tools/optimizer.hpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/include/spirv-tools/optimizer.hpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/include/spirv-tools/optimizer.hpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/include/spirv-tools/optimizer.hpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,557 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SPIRV_TOOLS_OPTIMIZER_HPP_ +#define SPIRV_TOOLS_OPTIMIZER_HPP_ + +#include +#include +#include +#include +#include + +#include "libspirv.hpp" + +namespace spvtools { + +// C++ interface for SPIR-V optimization functionalities. It wraps the context +// (including target environment and the corresponding SPIR-V grammar) and +// provides methods for registering optimization passes and optimizing. +// +// Instances of this class provides basic thread-safety guarantee. +class Optimizer { + public: + // The token for an optimization pass. It is returned via one of the + // Create*Pass() standalone functions at the end of this header file and + // consumed by the RegisterPass() method. Tokens are one-time objects that + // only support move; copying is not allowed. + struct PassToken { + struct Impl; // Opaque struct for holding inernal data. + + PassToken(std::unique_ptr); + + // Tokens can only be moved. Copying is disabled. + PassToken(const PassToken&) = delete; + PassToken(PassToken&&); + PassToken& operator=(const PassToken&) = delete; + PassToken& operator=(PassToken&&); + + ~PassToken(); + + std::unique_ptr impl_; // Unique pointer to internal data. + }; + + // Constructs an instance with the given target |env|, which is used to decode + // the binaries to be optimized later. + // + // The constructed instance will have an empty message consumer, which just + // ignores all messages from the library. Use SetMessageConsumer() to supply + // one if messages are of concern. + explicit Optimizer(spv_target_env env); + + // Disables copy/move constructor/assignment operations. + Optimizer(const Optimizer&) = delete; + Optimizer(Optimizer&&) = delete; + Optimizer& operator=(const Optimizer&) = delete; + Optimizer& operator=(Optimizer&&) = delete; + + // Destructs this instance. + ~Optimizer(); + + // Sets the message consumer to the given |consumer|. The |consumer| will be + // invoked once for each message communicated from the library. + void SetMessageConsumer(MessageConsumer consumer); + + // Registers the given |pass| to this optimizer. Passes will be run in the + // exact order of registration. The token passed in will be consumed by this + // method. + Optimizer& RegisterPass(PassToken&& pass); + + // Registers passes that attempt to improve performance of generated code. + // This sequence of passes is subject to constant review and will change + // from time to time. + Optimizer& RegisterPerformancePasses(); + + // Registers passes that attempt to improve the size of generated code. + // This sequence of passes is subject to constant review and will change + // from time to time. + Optimizer& RegisterSizePasses(); + + // Registers passes that attempt to legalize the generated code. + // + // Note: this recipe is specially for legalizing SPIR-V. It should be used + // by compilers after translating HLSL source code literally. It should + // *not* be used by general workloads for performance or size improvement. + // + // This sequence of passes is subject to constant review and will change + // from time to time. + Optimizer& RegisterLegalizationPasses(); + + // Optimizes the given SPIR-V module |original_binary| and writes the + // optimized binary into |optimized_binary|. + // Returns true on successful optimization, whether or not the module is + // modified. Returns false if errors occur when processing |original_binary| + // using any of the registered passes. In that case, no further passes are + // executed and the contents in |optimized_binary| may be invalid. + // + // It's allowed to alias |original_binary| to the start of |optimized_binary|. + bool Run(const uint32_t* original_binary, size_t original_binary_size, + std::vector* optimized_binary) const; + + // Returns a vector of strings with all the pass names added to this + // optimizer's pass manager. These strings are valid until the associated + // pass manager is destroyed. + std::vector GetPassNames() const; + + // Sets the option to print the disassembly before each pass and after the + // last pass. If |out| is null, then no output is generated. Otherwise, + // output is sent to the |out| output stream. + Optimizer& SetPrintAll(std::ostream* out); + + // Sets the option to print the resource utilization of each pass. If |out| + // is null, then no output is generated. Otherwise, output is sent to the + // |out| output stream. + Optimizer& SetTimeReport(std::ostream* out); + + private: + struct Impl; // Opaque struct for holding internal data. + std::unique_ptr impl_; // Unique pointer to internal data. +}; + +// Creates a null pass. +// A null pass does nothing to the SPIR-V module to be optimized. +Optimizer::PassToken CreateNullPass(); + +// Creates a strip-debug-info pass. +// A strip-debug-info pass removes all debug instructions (as documented in +// Section 3.32.2 of the SPIR-V spec) of the SPIR-V module to be optimized. +Optimizer::PassToken CreateStripDebugInfoPass(); + +// Creates a strip-reflect-info pass. +// A strip-reflect-info pass removes all reflections instructions. +// For now, this is limited to removing decorations defined in +// SPV_GOOGLE_hlsl_functionality1. The coverage may expand in +// the future. +Optimizer::PassToken CreateStripReflectInfoPass(); + +// Creates an eliminate-dead-functions pass. +// An eliminate-dead-functions pass will remove all functions that are not in +// the call trees rooted at entry points and exported functions. These +// functions are not needed because they will never be called. +Optimizer::PassToken CreateEliminateDeadFunctionsPass(); + +// Creates a set-spec-constant-default-value pass from a mapping from spec-ids +// to the default values in the form of string. +// A set-spec-constant-default-value pass sets the default values for the +// spec constants that have SpecId decorations (i.e., those defined by +// OpSpecConstant{|True|False} instructions). +Optimizer::PassToken CreateSetSpecConstantDefaultValuePass( + const std::unordered_map& id_value_map); + +// Creates a set-spec-constant-default-value pass from a mapping from spec-ids +// to the default values in the form of bit pattern. +// A set-spec-constant-default-value pass sets the default values for the +// spec constants that have SpecId decorations (i.e., those defined by +// OpSpecConstant{|True|False} instructions). +Optimizer::PassToken CreateSetSpecConstantDefaultValuePass( + const std::unordered_map>& id_value_map); + +// Creates a flatten-decoration pass. +// A flatten-decoration pass replaces grouped decorations with equivalent +// ungrouped decorations. That is, it replaces each OpDecorationGroup +// instruction and associated OpGroupDecorate and OpGroupMemberDecorate +// instructions with equivalent OpDecorate and OpMemberDecorate instructions. +// The pass does not attempt to preserve debug information for instructions +// it removes. +Optimizer::PassToken CreateFlattenDecorationPass(); + +// Creates a freeze-spec-constant-value pass. +// A freeze-spec-constant pass specializes the value of spec constants to +// their default values. This pass only processes the spec constants that have +// SpecId decorations (defined by OpSpecConstant, OpSpecConstantTrue, or +// OpSpecConstantFalse instructions) and replaces them with their normal +// counterparts (OpConstant, OpConstantTrue, or OpConstantFalse). The +// corresponding SpecId annotation instructions will also be removed. This +// pass does not fold the newly added normal constants and does not process +// other spec constants defined by OpSpecConstantComposite or +// OpSpecConstantOp. +Optimizer::PassToken CreateFreezeSpecConstantValuePass(); + +// Creates a fold-spec-constant-op-and-composite pass. +// A fold-spec-constant-op-and-composite pass folds spec constants defined by +// OpSpecConstantOp or OpSpecConstantComposite instruction, to normal Constants +// defined by OpConstantTrue, OpConstantFalse, OpConstant, OpConstantNull, or +// OpConstantComposite instructions. Note that spec constants defined with +// OpSpecConstant, OpSpecConstantTrue, or OpSpecConstantFalse instructions are +// not handled, as these instructions indicate their value are not determined +// and can be changed in future. A spec constant is foldable if all of its +// value(s) can be determined from the module. E.g., an integer spec constant +// defined with OpSpecConstantOp instruction can be folded if its value won't +// change later. This pass will replace the original OpSpecContantOp instruction +// with an OpConstant instruction. When folding composite spec constants, +// new instructions may be inserted to define the components of the composite +// constant first, then the original spec constants will be replaced by +// OpConstantComposite instructions. +// +// There are some operations not supported yet: +// OpSConvert, OpFConvert, OpQuantizeToF16 and +// all the operations under Kernel capability. +// TODO(qining): Add support for the operations listed above. +Optimizer::PassToken CreateFoldSpecConstantOpAndCompositePass(); + +// Creates a unify-constant pass. +// A unify-constant pass de-duplicates the constants. Constants with the exact +// same value and identical form will be unified and only one constant will +// be kept for each unique pair of type and value. +// There are several cases not handled by this pass: +// 1) Constants defined by OpConstantNull instructions (null constants) and +// constants defined by OpConstantFalse, OpConstant or OpConstantComposite +// with value 0 (zero-valued normal constants) are not considered equivalent. +// So null constants won't be used to replace zero-valued normal constants, +// vice versa. +// 2) Whenever there are decorations to the constant's result id id, the +// constant won't be handled, which means, it won't be used to replace any +// other constants, neither can other constants replace it. +// 3) NaN in float point format with different bit patterns are not unified. +Optimizer::PassToken CreateUnifyConstantPass(); + +// Creates a eliminate-dead-constant pass. +// A eliminate-dead-constant pass removes dead constants, including normal +// contants defined by OpConstant, OpConstantComposite, OpConstantTrue, or +// OpConstantFalse and spec constants defined by OpSpecConstant, +// OpSpecConstantComposite, OpSpecConstantTrue, OpSpecConstantFalse or +// OpSpecConstantOp. +Optimizer::PassToken CreateEliminateDeadConstantPass(); + +// Creates a strength-reduction pass. +// A strength-reduction pass will look for opportunities to replace an +// instruction with an equivalent and less expensive one. For example, +// multiplying by a power of 2 can be replaced by a bit shift. +Optimizer::PassToken CreateStrengthReductionPass(); + +// Creates a block merge pass. +// This pass searches for blocks with a single Branch to a block with no +// other predecessors and merges the blocks into a single block. Continue +// blocks and Merge blocks are not candidates for the second block. +// +// The pass is most useful after Dead Branch Elimination, which can leave +// such sequences of blocks. Merging them makes subsequent passes more +// effective, such as single block local store-load elimination. +// +// While this pass reduces the number of occurrences of this sequence, at +// this time it does not guarantee all such sequences are eliminated. +// +// Presence of phi instructions can inhibit this optimization. Handling +// these is left for future improvements. +Optimizer::PassToken CreateBlockMergePass(); + +// Creates an exhaustive inline pass. +// An exhaustive inline pass attempts to exhaustively inline all function +// calls in all functions in an entry point call tree. The intent is to enable, +// albeit through brute force, analysis and optimization across function +// calls by subsequent optimization passes. As the inlining is exhaustive, +// there is no attempt to optimize for size or runtime performance. Functions +// that are not in the call tree of an entry point are not changed. +Optimizer::PassToken CreateInlineExhaustivePass(); + +// Creates an opaque inline pass. +// An opaque inline pass inlines all function calls in all functions in all +// entry point call trees where the called function contains an opaque type +// in either its parameter types or return type. An opaque type is currently +// defined as Image, Sampler or SampledImage. The intent is to enable, albeit +// through brute force, analysis and optimization across these function calls +// by subsequent passes in order to remove the storing of opaque types which is +// not legal in Vulkan. Functions that are not in the call tree of an entry +// point are not changed. +Optimizer::PassToken CreateInlineOpaquePass(); + +// Creates a single-block local variable load/store elimination pass. +// For every entry point function, do single block memory optimization of +// function variables referenced only with non-access-chain loads and stores. +// For each targeted variable load, if previous store to that variable in the +// block, replace the load's result id with the value id of the store. +// If previous load within the block, replace the current load's result id +// with the previous load's result id. In either case, delete the current +// load. Finally, check if any remaining stores are useless, and delete store +// and variable if possible. +// +// The presence of access chain references and function calls can inhibit +// the above optimization. +// +// Only modules with relaxed logical addressing (see opt/instruction.h) are +// currently processed. +// +// This pass is most effective if preceeded by Inlining and +// LocalAccessChainConvert. This pass will reduce the work needed to be done +// by LocalSingleStoreElim and LocalMultiStoreElim. +// +// Only functions in the call tree of an entry point are processed. +Optimizer::PassToken CreateLocalSingleBlockLoadStoreElimPass(); + +// Create dead branch elimination pass. +// For each entry point function, this pass will look for SelectionMerge +// BranchConditionals with constant condition and convert to a Branch to +// the indicated label. It will delete resulting dead blocks. +// +// For all phi functions in merge block, replace all uses with the id +// corresponding to the living predecessor. +// +// Note that some branches and blocks may be left to avoid creating invalid +// control flow. Improving this is left to future work. +// +// This pass is most effective when preceeded by passes which eliminate +// local loads and stores, effectively propagating constant values where +// possible. +Optimizer::PassToken CreateDeadBranchElimPass(); + +// Creates an SSA local variable load/store elimination pass. +// For every entry point function, eliminate all loads and stores of function +// scope variables only referenced with non-access-chain loads and stores. +// Eliminate the variables as well. +// +// The presence of access chain references and function calls can inhibit +// the above optimization. +// +// Only shader modules with relaxed logical addressing (see opt/instruction.h) +// are currently processed. Currently modules with any extensions enabled are +// not processed. This is left for future work. +// +// This pass is most effective if preceeded by Inlining and +// LocalAccessChainConvert. LocalSingleStoreElim and LocalSingleBlockElim +// will reduce the work that this pass has to do. +Optimizer::PassToken CreateLocalMultiStoreElimPass(); + +// Creates a local access chain conversion pass. +// A local access chain conversion pass identifies all function scope +// variables which are accessed only with loads, stores and access chains +// with constant indices. It then converts all loads and stores of such +// variables into equivalent sequences of loads, stores, extracts and inserts. +// +// This pass only processes entry point functions. It currently only converts +// non-nested, non-ptr access chains. It does not process modules with +// non-32-bit integer types present. Optional memory access options on loads +// and stores are ignored as we are only processing function scope variables. +// +// This pass unifies access to these variables to a single mode and simplifies +// subsequent analysis and elimination of these variables along with their +// loads and stores allowing values to propagate to their points of use where +// possible. +Optimizer::PassToken CreateLocalAccessChainConvertPass(); + +// Creates a local single store elimination pass. +// For each entry point function, this pass eliminates loads and stores for +// function scope variable that are stored to only once, where possible. Only +// whole variable loads and stores are eliminated; access-chain references are +// not optimized. Replace all loads of such variables with the value that is +// stored and eliminate any resulting dead code. +// +// Currently, the presence of access chains and function calls can inhibit this +// pass, however the Inlining and LocalAccessChainConvert passes can make it +// more effective. In additional, many non-load/store memory operations are +// not supported and will prohibit optimization of a function. Support of +// these operations are future work. +// +// Only shader modules with relaxed logical addressing (see opt/instruction.h) +// are currently processed. +// +// This pass will reduce the work needed to be done by LocalSingleBlockElim +// and LocalMultiStoreElim and can improve the effectiveness of other passes +// such as DeadBranchElimination which depend on values for their analysis. +Optimizer::PassToken CreateLocalSingleStoreElimPass(); + +// Creates an insert/extract elimination pass. +// This pass processes each entry point function in the module, searching for +// extracts on a sequence of inserts. It further searches the sequence for an +// insert with indices identical to the extract. If such an insert can be +// found before hitting a conflicting insert, the extract's result id is +// replaced with the id of the values from the insert. +// +// Besides removing extracts this pass enables subsequent dead code elimination +// passes to delete the inserts. This pass performs best after access chains are +// converted to inserts and extracts and local loads and stores are eliminated. +Optimizer::PassToken CreateInsertExtractElimPass(); + +// Creates a dead insert elimination pass. +// This pass processes each entry point function in the module, searching for +// unreferenced inserts into composite types. These are most often unused +// stores to vector components. They are unused because they are never +// referenced, or because there is another insert to the same component between +// the insert and the reference. After removing the inserts, dead code +// elimination is attempted on the inserted values. +// +// This pass performs best after access chains are converted to inserts and +// extracts and local loads and stores are eliminated. While executing this +// pass can be advantageous on its own, it is also advantageous to execute +// this pass after CreateInsertExtractPass() as it will remove any unused +// inserts created by that pass. +Optimizer::PassToken CreateDeadInsertElimPass(); + +// Creates a pass to consolidate uniform references. +// For each entry point function in the module, first change all constant index +// access chain loads into equivalent composite extracts. Then consolidate +// identical uniform loads into one uniform load. Finally, consolidate +// identical uniform extracts into one uniform extract. This may require +// moving a load or extract to a point which dominates all uses. +// +// This pass requires a module to have structured control flow ie shader +// capability. It also requires logical addressing ie Addresses capability +// is not enabled. It also currently does not support any extensions. +// +// This pass currently only optimizes loads with a single index. +Optimizer::PassToken CreateCommonUniformElimPass(); + +// Create aggressive dead code elimination pass +// This pass eliminates unused code from the module. In addition, +// it detects and eliminates code which may have spurious uses but which do +// not contribute to the output of the function. The most common cause of +// such code sequences is summations in loops whose result is no longer used +// due to dead code elimination. This optimization has additional compile +// time cost over standard dead code elimination. +// +// This pass only processes entry point functions. It also only processes +// shaders with relaxed logical addressing (see opt/instruction.h). It +// currently will not process functions with function calls. Unreachable +// functions are deleted. +// +// This pass will be made more effective by first running passes that remove +// dead control flow and inlines function calls. +// +// This pass can be especially useful after running Local Access Chain +// Conversion, which tends to cause cycles of dead code to be left after +// Store/Load elimination passes are completed. These cycles cannot be +// eliminated with standard dead code elimination. +Optimizer::PassToken CreateAggressiveDCEPass(); + +// Creates a compact ids pass. +// The pass remaps result ids to a compact and gapless range starting from %1. +Optimizer::PassToken CreateCompactIdsPass(); + +// Creates a remove duplicate pass. +// This pass removes various duplicates: +// * duplicate capabilities; +// * duplicate extended instruction imports; +// * duplicate types; +// * duplicate decorations. +Optimizer::PassToken CreateRemoveDuplicatesPass(); + +// Creates a CFG cleanup pass. +// This pass removes cruft from the control flow graph of functions that are +// reachable from entry points and exported functions. It currently includes the +// following functionality: +// +// - Removal of unreachable basic blocks. +Optimizer::PassToken CreateCFGCleanupPass(); + +// Create dead variable elimination pass. +// This pass will delete module scope variables, along with their decorations, +// that are not referenced. +Optimizer::PassToken CreateDeadVariableEliminationPass(); + +// create merge return pass. +// changes functions that have multiple return statements so they have a single +// return statement. +// +// for structured control flow it is assumed that the only unreachable blocks in +// the function are trivial merge and continue blocks. +// +// a trivial merge block contains the label and an opunreachable instructions, +// nothing else. a trivial continue block contain a label and an opbranch to +// the header, nothing else. +// +// these conditions are guaranteed to be met after running dead-branch +// elimination. +Optimizer::PassToken CreateMergeReturnPass(); + +// Create value numbering pass. +// This pass will look for instructions in the same basic block that compute the +// same value, and remove the redundant ones. +Optimizer::PassToken CreateLocalRedundancyEliminationPass(); + +// Create LICM pass. +// This pass will look for invariant instructions inside loops and hoist them to +// the loops preheader. +Optimizer::PassToken CreateLoopInvariantCodeMotionPass(); + +// Creates a loop unswitch pass. +// This pass will look for loop independent branch conditions and move the +// condition out of the loop and version the loop based on the taken branch. +// Works best after LICM and local multi store elimination pass. +Optimizer::PassToken CreateLoopUnswitchPass(); + +// Create global value numbering pass. +// This pass will look for instructions where the same value is computed on all +// paths leading to the instruction. Those instructions are deleted. +Optimizer::PassToken CreateRedundancyEliminationPass(); + +// Create scalar replacement pass. +// This pass replaces composite function scope variables with variables for each +// element if those elements are accessed individually. +Optimizer::PassToken CreateScalarReplacementPass(); + +// Create a private to local pass. +// This pass looks for variables delcared in the private storage class that are +// used in only one function. Those variables are moved to the function storage +// class in the function that they are used. +Optimizer::PassToken CreatePrivateToLocalPass(); + +// Creates a conditional constant propagation (CCP) pass. +// This pass implements the SSA-CCP algorithm in +// +// Constant propagation with conditional branches, +// Wegman and Zadeck, ACM TOPLAS 13(2):181-210. +// +// Constant values in expressions and conditional jumps are folded and +// simplified. This may reduce code size by removing never executed jump targets +// and computations with constant operands. +Optimizer::PassToken CreateCCPPass(); + +// Creates a workaround driver bugs pass. This pass attempts to work around +// a known driver bug (issue #1209) by identifying the bad code sequences and +// rewriting them. +// +// Current workaround: Avoid OpUnreachable instructions in loops. +Optimizer::PassToken CreateWorkaround1209Pass(); + +// Creates a pass that converts if-then-else like assignments into OpSelect. +Optimizer::PassToken CreateIfConversionPass(); + +// Creates a pass that will replace instructions that are not valid for the +// current shader stage by constants. Has no effect on non-shader modules. +Optimizer::PassToken CreateReplaceInvalidOpcodePass(); + +// Creates a pass that simplifies instructions using the instruction folder. +Optimizer::PassToken CreateSimplificationPass(); + +// Create loop unroller pass. +// Creates a pass to unroll loops which have the "Unroll" loop control +// mask set. The loops must meet a specific criteria in order to be unrolled +// safely this criteria is checked before doing the unroll by the +// LoopUtils::CanPerformUnroll method. Any loop that does not meet the criteria +// won't be unrolled. See CanPerformUnroll LoopUtils.h for more information. +Optimizer::PassToken CreateLoopUnrollPass(bool fully_unroll, int factor = 0); + +// Create the SSA rewrite pass. +// This pass converts load/store operations on function local variables into +// operations on SSA IDs. This allows SSA optimizers to act on these variables. +// Only variables that are local to the function and of supported types are +// processed (see IsSSATargetVar for details). +Optimizer::PassToken CreateSSARewritePass(); + +// Create copy propagate arrays pass. +// This pass looks to copy propagate memory references for arrays. It looks +// for specific code patterns to recognize array copies. +Optimizer::PassToken CreateCopyPropagateArraysPass(); +} // namespace spvtools + +#endif // SPIRV_TOOLS_OPTIMIZER_HPP_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/LICENSE vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/LICENSE --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/LICENSE 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/projects.md vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/projects.md --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/projects.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/projects.md 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,82 @@ +# Tracking SPIRV-Tools work with GitHub projects + +We are experimenting with using the [GitHub Project +feature](https://help.github.com/articles/tracking-the-progress-of-your-work-with-projects/) +to track progress toward large goals. + +For more on GitHub Projects in general, see: +* [Introductory blog post](https://github.com/blog/2256-a-whole-new-github-universe-announcing-new-tools-forums-and-features) +* [Introductory video](https://www.youtube.com/watch?v=C6MGKHkNtxU) + +The current SPIRV-Tools project list can be found at +[https://github.com/KhronosGroup/SPIRV-Tools/projects](https://github.com/KhronosGroup/SPIRV-Tools/projects) + +## How we use a Project + +A GitHub Project is a set of work with an overall purpose, and +consists of a collection of *Cards*. +Each card is either a *Note* or a regular GitHub *Issue.* +A Note can be converted to an Issue. + +In our projects, a card represents work, i.e. a change that can +be applied to the repository. +The work could be a feature, a bug to be fixed, documentation to be +updated, etc. + +A project and its cards are used as a [Kanban +board](https://en.wikipedia.org/wiki/Kanban_board), where cards progress +through a workflow starting with ideas through to implementation and completion. + +In our usage, a *project manager* is someone who organizes the work. +They manage the creation and movement of cards +through the project workflow: +* They create cards to capture ideas, or to decompose large ideas into smaller + ones. +* They determine if the work for a card has been completed. +* Normally they are the person (or persons) who can approve and merge a pull + request into the `master` branch. + +Our projects organize cards into the following columns: +* `Ideas`: Work which could be done, captured either as Cards or Notes. + * A card in this column could be marked as a [PLACEHOLDER](#placeholders). +* `Ready to start`: Issues which represent work we'd like to do, and which + are not blocked by other work. + * The issue should be narrow enough that it can usually be addressed by a + single pull request. + * We want these to be Issues (not Notes) so that someone can claim the work + by updating the Issue with their intent to do the work. + Once an Issue is claimed, the project manager moves the corresponding card + from `Ready to start` to `In progress`. +* `In progress`: Issues which were in `Ready to start` but which have been + claimed by someone. +* `Done`: Issues which have been resolved, by completing their work. + * The changes have been applied to the repository, typically by being pushed + into the `master` branch. + * Other kinds of work could update repository settings, for example. +* `Rejected ideas`: Work which has been considered, but which we don't want + implemented. + * We keep rejected ideas so they are not proposed again. This serves + as a form of institutional memory. + * We should record why an idea is rejected. For this reason, a rejected + idea is likely to be an Issue which has been closed. + +## Prioritization + +We are considering prioritizing cards in the `Ideas` and `Ready to start` +columns so that things that should be considered first float up to the top. + +Experience will tell us if we stick to that rule, and if it proves helpful. + +## Placeholders + +A *placeholder* is a Note or Issue that represents a possibly large amount +of work that can be broadly defined but which may not have been broken down +into small implementable pieces of work. + +Use a placeholder to capture a big idea, but without doing the upfront work +to consider all the details of how it should be implemented. +Over time, break off pieces of the placeholder into implementable Issues. +Move those Issues into the `Ready to start` column when they become unblocked. + +We delete the placeholder when all its work has been decomposed into +implementable cards. diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/README.md vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/README.md --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/README.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/README.md 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,509 @@ +# SPIR-V Tools + +[![Build Status](https://travis-ci.org/KhronosGroup/SPIRV-Tools.svg?branch=master)](https://travis-ci.org/KhronosGroup/SPIRV-Tools) +[![Build status](https://ci.appveyor.com/api/projects/status/gpue87cesrx3pi0d/branch/master?svg=true)](https://ci.appveyor.com/project/Khronoswebmaster/spirv-tools/branch/master) + +## Overview + +The SPIR-V Tools project provides an API and commands for processing SPIR-V +modules. + +The project includes an assembler, binary module parser, disassembler, +validator, and optimizer for SPIR-V. Except for the optimizer, all are based +on a common static library. The library contains all of the implementation +details, and is used in the standalone tools whilst also enabling integration +into other code bases directly. The optimizer implementation resides in its +own library, which depends on the core library. + +The interfaces have stabilized: +We don't anticipate making a breaking change for existing features. + +SPIR-V is defined by the Khronos Group Inc. +See the [SPIR-V Registry][spirv-registry] for the SPIR-V specification, +headers, and XML registry. + +## Versioning SPIRV-Tools + +See [`CHANGES`](CHANGES) for a high level summary of recent changes, by version. + +SPIRV-Tools project version numbers are of the form `v`*year*`.`*index* and with +an optional `-dev` suffix to indicate work in progress. For exampe, the +following versions are ordered from oldest to newest: + +* `v2016.0` +* `v2016.1-dev` +* `v2016.1` +* `v2016.2-dev` +* `v2016.2` + +Use the `--version` option on each command line tool to see the software +version. An API call reports the software version as a C-style string. + +## Supported features + +### Assembler, binary parser, and disassembler + +* Support for SPIR-V 1.0, 1.1, 1.2, and 1.3 + * Based on SPIR-V syntax described by JSON grammar files in the + [SPIRV-Headers](spirv-headers) repository. +* Support for extended instruction sets: + * GLSL std450 version 1.0 Rev 3 + * OpenCL version 1.0 Rev 2 +* Assembler only does basic syntax checking. No cross validation of + IDs or types is performed, except to check literal arguments to + `OpConstant`, `OpSpecConstant`, and `OpSwitch`. + +See [`syntax.md`](syntax.md) for the assembly language syntax. + +### Validator + +The validator checks validation rules described by the SPIR-V specification. + +Khronos recommends that tools that create or transform SPIR-V modules use the +validator to ensure their outputs are valid, and that tools that consume SPIR-V +modules optionally use the validator to protect themselves from bad inputs. +This is especially encouraged for debug and development scenarios. + +The validator has one-sided error: it will only return an error when it has +implemented a rule check and the module violates that rule. + +The validator is incomplete. +See the [CHANGES](CHANGES) file for reports on completed work, and +the [Validator +sub-project](https://github.com/KhronosGroup/SPIRV-Tools/projects/1) for planned +and in-progress work. + +*Note*: The validator checks some Universal Limits, from section 2.17 of the SPIR-V spec. +The validator will fail on a module that exceeds those minimum upper bound limits. +It is [future work](https://github.com/KhronosGroup/SPIRV-Tools/projects/1#card-1052403) +to parameterize the validator to allow larger +limits accepted by a more than minimally capable SPIR-V consumer. + + +### Optimizer + +*Note:* The optimizer is still under development. + +Currently supported optimizations: +* General + * Strip debug info +* Specialization Constants + * Set spec constant default value + * Freeze spec constant + * Fold `OpSpecConstantOp` and `OpSpecConstantComposite` + * Unify constants + * Eliminate dead constant +* Code Reduction + * Inline all function calls exhaustively + * Convert local access chains to inserts/extracts + * Eliminate local load/store in single block + * Eliminate local load/store with single store + * Eliminate local load/store with multiple stores + * Eliminate local extract from insert + * Eliminate dead instructions (aggressive) + * Eliminate dead branches + * Merge single successor / single predecessor block pairs + * Eliminate common uniform loads + * Remove duplicates: Capabilities, extended instruction imports, types, and + decorations. + +For the latest list with detailed documentation, please refer to +[`include/spirv-tools/optimizer.hpp`](include/spirv-tools/optimizer.hpp). + +For suggestions on using the code reduction options, please refer to this [white paper](https://www.lunarg.com/shader-compiler-technologies/white-paper-spirv-opt/). + + +### Linker + +*Note:* The linker is still under development. + +Current features: +* Combine multiple SPIR-V binary modules together. +* Combine into a library (exports are retained) or an executable (no symbols + are exported). + +See the [CHANGES](CHANGES) file for reports on completed work, and the [General +sub-project](https://github.com/KhronosGroup/SPIRV-Tools/projects/2) for +planned and in-progress work. + +### Extras + +* [Utility filters](#utility-filters) +* Build target `spirv-tools-vimsyntax` generates file `spvasm.vim`. + Copy that file into your `$HOME/.vim/syntax` directory to get SPIR-V assembly syntax + highlighting in Vim. This build target is not built by default. + +## Contributing + +The SPIR-V Tools project is maintained by members of the The Khronos Group Inc., +and is hosted at https://github.com/KhronosGroup/SPIRV-Tools. + +Consider joining the `public_spirv_tools_dev@khronos.org` mailing list, via +[https://www.khronos.org/spir/spirv-tools-mailing-list/](https://www.khronos.org/spir/spirv-tools-mailing-list/). +The mailing list is used to discuss development plans for the SPIRV-Tools as an open source project. +Once discussion is resolved, +specific work is tracked via issues and sometimes in one of the +[projects][spirv-tools-projects]. + +(To provide feedback on the SPIR-V _specification_, file an issue on the +[SPIRV-Headers][spirv-headers] GitHub repository.) + +See [`projects.md`](projects.md) to see how we use the +[GitHub Project +feature](https://help.github.com/articles/tracking-the-progress-of-your-work-with-projects/) +to organize planned and in-progress work. + +Contributions via merge request are welcome. Changes should: +* Be provided under the [Apache 2.0](#license). +* You'll be prompted with a one-time "click-through" + [Khronos Open Source Contributor License Agreement][spirv-tools-cla] + (CLA) dialog as part of submitting your pull request or + other contribution to GitHub. +* Include tests to cover updated functionality. +* C++ code should follow the [Google C++ Style Guide][cpp-style-guide]. +* Code should be formatted with `clang-format`. Settings are defined by + the included [.clang-format](.clang-format) file. + +We intend to maintain a linear history on the GitHub `master` branch. + +### Source code organization + +* `example`: demo code of using SPIRV-Tools APIs +* `external/googletest`: Intended location for the + [googletest][googletest] sources, not provided +* `external/effcee`: Location of [Effcee][effcee] sources, if the `effcee` library + is not already configured by an enclosing project. +* `external/re2`: Location of [RE2][re2] sources, if the `effcee` library is not already + configured by an enclosing project. + (The Effcee project already requires RE2.) +* `include/`: API clients should add this directory to the include search path +* `external/spirv-headers`: Intended location for + [SPIR-V headers][spirv-headers], not provided +* `include/spirv-tools/libspirv.h`: C API public interface +* `source/`: API implementation +* `test/`: Tests, using the [googletest][googletest] framework +* `tools/`: Command line executables + +Example of getting sources, assuming SPIRV-Tools is configured as a standalone project: + + git clone https://github.com/KhronosGroup/SPIRV-Tools.git spirv-tools + git clone https://github.com/KhronosGroup/SPIRV-Headers.git spirv-tools/external/spirv-headers + git clone https://github.com/google/googletest.git spirv-tools/external/googletest + git clone https://github.com/google/effcee.git spirv-tools/external/effcee + git clone https://github.com/google/re2.git spirv-tools/external/re2 + +### Tests + +The project contains a number of tests, used to drive development +and ensure correctness. The tests are written using the +[googletest][googletest] framework. The `googletest` +source is not provided with this project. There are two ways to enable +tests: +* If SPIR-V Tools is configured as part of an enclosing project, then the + enclosing project should configure `googletest` before configuring SPIR-V Tools. +* If SPIR-V Tools is configured as a standalone project, then download the + `googletest` source into the `/external/googletest` directory before + configuring and building the project. + +*Note*: You must use a version of googletest that includes +[a fix][googletest-pull-612] for [googletest issue 610][googletest-issue-610]. +The fix is included on the googletest master branch any time after 2015-11-10. +In particular, googletest must be newer than version 1.7.0. + +### Optional dependency on Effcee + +Some tests depend on the [Effcee][effcee] library for stateful matching. +Effcee itself depends on [RE2][re2]. + +* If SPIRV-Tools is configured as part of a larger project that already uses + Effcee, then that project should include Effcee before SPIRV-Tools. +* Otherwise, SPIRV-Tools expects Effcee sources to appear in `external/effcee` + and RE2 sources to appear in `external/re2`. + +Currently Effcee is an optional dependency, but soon it will be required. + +## Build + +Instead of building manually, you can also download the binaries for your +platform directly from the [master-tot release][master-tot-release] on GitHub. +Those binaries are automatically uploaded by the buildbots after successful +testing and they always reflect the current top of the tree of the master +branch. + +The project uses [CMake][cmake] to generate platform-specific build +configurations. Assume that `` is the root directory of the checked +out code: + +```sh +cd +git clone https://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers +git clone https://github.com/google/googletest.git external/googletest # optional + +mkdir build && cd build +cmake [-G ] +``` + +Once the build files have been generated, build using your preferred +development environment. + +### CMake options + +The following CMake options are supported: + +* `SPIRV_COLOR_TERMINAL={ON|OFF}`, default `ON` - Enables color console output. +* `SPIRV_SKIP_TESTS={ON|OFF}`, default `OFF`- Build only the library and + the command line tools. This will prevent the tests from being built. +* `SPIRV_SKIP_EXECUTABLES={ON|OFF}`, default `OFF`- Build only the library, not + the command line tools and tests. +* `SPIRV_BUILD_COMPRESSION={ON|OFF}`, default `OFF`- Build SPIR-V compressing + codec. +* `SPIRV_USE_SANITIZER=`, default is no sanitizing - On UNIX + platforms with an appropriate version of `clang` this option enables the use + of the sanitizers documented [here][clang-sanitizers]. + This should only be used with a debug build. +* `SPIRV_WARN_EVERYTHING={ON|OFF}`, default `OFF` - On UNIX platforms enable + more strict warnings. The code might not compile with this option enabled. + For Clang, enables `-Weverything`. For GCC, enables `-Wpedantic`. + See [`CMakeLists.txt`](CMakeLists.txt) for details. +* `SPIRV_WERROR={ON|OFF}`, default `ON` - Forces a compilation error on any + warnings encountered by enabling the compiler-specific compiler front-end + option. + +Additionally, you can pass additional C preprocessor definitions to SPIRV-Tools +via setting `SPIRV_TOOLS_EXTRA_DEFINITIONS`. For example, by setting it to +`/D_ITERATOR_DEBUG_LEVEL=0` on Windows, you can disable checked iterators and +iterator debugging. + +## Library + +### Usage + +The internals of the library use C++11 features, and are exposed via both a C +and C++ API. + +In order to use the library from an application, the include path should point +to `/include`, which will enable the application to include the +header `/include/spirv-tools/libspirv.h{|pp}` then linking against +the static library in `/source/libSPIRV-Tools.a` or +`/source/SPIRV-Tools.lib`. +For optimization, the header file is +`/include/spirv-tools/optimizer.hpp`, and the static library is +`/source/libSPIRV-Tools-opt.a` or +`/source/SPIRV-Tools-opt.lib`. + +* `SPIRV-Tools` CMake target: Creates the static library: + * `/source/libSPIRV-Tools.a` on Linux and OS X. + * `/source/libSPIRV-Tools.lib` on Windows. +* `SPIRV-Tools-opt` CMake target: Creates the static library: + * `/source/libSPIRV-Tools-opt.a` on Linux and OS X. + * `/source/libSPIRV-Tools-opt.lib` on Windows. + +#### Entry points + +The interfaces are still under development, and are expected to change. + +There are five main entry points into the library in the C interface: + +* `spvTextToBinary`: An assembler, translating text to a binary SPIR-V module. +* `spvBinaryToText`: A disassembler, translating a binary SPIR-V module to + text. +* `spvBinaryParse`: The entry point to a binary parser API. It issues callbacks + for the header and each parsed instruction. The disassembler is implemented + as a client of `spvBinaryParse`. +* `spvValidate` implements the validator functionality. *Incomplete* +* `spvValidateBinary` implements the validator functionality. *Incomplete* + +The C++ interface is comprised of three classes, `SpirvTools`, `Optimizer` and +`Linker`, all in the `spvtools` namespace. +* `SpirvTools` provides `Assemble`, `Disassemble`, and `Validate` methods. +* `Optimizer` provides methods for registering and running optimization passes. +* `Linker` provides methods for combining together multiple binaries. + +## Command line tools + +Command line tools, which wrap the above library functions, are provided to +assemble or disassemble shader files. It's a convention to name SPIR-V +assembly and binary files with suffix `.spvasm` and `.spv`, respectively. + +### Assembler tool + +The assembler reads the assembly language text, and emits the binary form. + +The standalone assembler is the exectuable called `spirv-as`, and is located in +`/tools/spirv-as`. The functionality of the assembler is implemented +by the `spvTextToBinary` library function. + +* `spirv-as` - the standalone assembler + * `/tools/as` + +Use option `-h` to print help. + +### Disassembler tool + +The disassembler reads the binary form, and emits assembly language text. + +The standalone disassembler is the executable called `spirv-dis`, and is located in +`/tools/spirv-dis`. The functionality of the disassembler is implemented +by the `spvBinaryToText` library function. + +* `spirv-dis` - the standalone disassembler + * `/tools/dis` + +Use option `-h` to print help. + +The output includes syntax colouring when printing to the standard output stream, +on Linux, Windows, and OS X. + +### Linker tool + +The linker combines multiple SPIR-V binary modules together, resulting in a single +binary module as output. + +This is a work in progress. +The linker does not support OpenCL program linking options related to math +flags. (See section 5.6.5.2 in OpenCL 1.2) + +* `spirv-link` - the standalone linker + * `/tools/link` + +### Optimizer tool + +The optimizer processes a SPIR-V binary module, applying transformations +in the specified order. + +This is a work in progress, with initially only few available transformations. + +* `spirv-opt` - the standalone optimizer + * `/tools/opt` + +### Validator tool + +*Warning:* This functionality is under development, and is incomplete. + +The standalone validator is the executable called `spirv-val`, and is located in +`/tools/spirv-val`. The functionality of the validator is implemented +by the `spvValidate` library function. + +The validator operates on the binary form. + +* `spirv-val` - the standalone validator + * `/tools/val` + +### Control flow dumper tool + +The control flow dumper prints the control flow graph for a SPIR-V module as a +[GraphViz](http://www.graphviz.org/) graph. + +This is experimental. + +* `spirv-cfg` - the control flow graph dumper + * `/tools/cfg` + +### Utility filters + +* `spirv-lesspipe.sh` - Automatically disassembles `.spv` binary files for the + `less` program, on compatible systems. For example, set the `LESSOPEN` + environment variable as follows, assuming both `spirv-lesspipe.sh` and + `spirv-dis` are on your executable search path: + ``` + export LESSOPEN='| spirv-lesspipe.sh "%s"' + ``` + Then you page through a disassembled module as follows: + ``` + less foo.spv + ``` + * The `spirv-lesspipe.sh` script will pass through any extra arguments to + `spirv-dis`. So, for example, you can turn off colours and friendly ID + naming as follows: + ``` + export LESSOPEN='| spirv-lesspipe.sh "%s" --no-color --raw-id' + ``` + +* [vim-spirv](https://github.com/kbenzie/vim-spirv) - A vim plugin which + supports automatic disassembly of `.spv` files using the `:edit` command and + assembly using the `:write` command. The plugin also provides additional + features which include; syntax highlighting; highlighting of all ID's matching + the ID under the cursor; and highlighting errors where the `Instruction` + operand of `OpExtInst` is used without an appropriate `OpExtInstImport`. + +* `50spirv-tools.el` - Automatically disassembles '.spv' binary files when + loaded into the emacs text editor, and re-assembles them when saved, + provided any modifications to the file are valid. This functionality + must be explicitly requested by defining the symbol + SPIRV_TOOLS_INSTALL_EMACS_HELPERS as follows: + ``` + cmake -DSPIRV_TOOLS_INSTALL_EMACS_HELPERS=true ... + ``` + + In addition, this helper is only installed if the directory /etc/emacs/site-start.d + exists, which is typically true if emacs is installed on the system. + + Note that symbol IDs are not currently preserved through a load/edit/save operation. + This may change if the ability is added to spirv-as. + + +### Tests + +Tests are only built when googletest is found. Use `ctest` to run all the +tests. + +## Future Work + + +_See the [projects pages](https://github.com/KhronosGroup/SPIRV-Tools/projects) +for more information._ + +### Assembler and disassembler + +* The disassembler could emit helpful annotations in comments. For example: + * Use variable name information from debug instructions to annotate + key operations on variables. + * Show control flow information by annotating `OpLabel` instructions with + that basic block's predecessors. +* Error messages could be improved. + +### Validator + +This is a work in progress. + +### Linker + +* The linker could accept math transformations such as allowing MADs, or other + math flags passed at linking-time in OpenCL. +* Linkage attributes can not be applied through a group. +* Check decorations of linked functions attributes. +* Remove dead instructions, such as OpName targeting imported symbols. + +## Licence + +Full license terms are in [LICENSE](LICENSE) +``` +Copyright (c) 2015-2016 The Khronos Group Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` + +[spirv-tools-cla]: https://cla-assistant.io/KhronosGroup/SPIRV-Tools +[spirv-tools-projects]: https://github.com/KhronosGroup/SPIRV-Tools/projects +[spirv-tools-mailing-list]: https://www.khronos.org/spir/spirv-tools-mailing-list +[spirv-registry]: https://www.khronos.org/registry/spir-v/ +[spirv-headers]: https://github.com/KhronosGroup/SPIRV-Headers +[googletest]: https://github.com/google/googletest +[googletest-pull-612]: https://github.com/google/googletest/pull/612 +[googletest-issue-610]: https://github.com/google/googletest/issues/610 +[effcee]: https://github.com/google/effcee +[re2]: https://github.com/google/re2 +[CMake]: https://cmake.org/ +[cpp-style-guide]: https://google.github.io/styleguide/cppguide.html +[clang-sanitizers]: http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation +[master-tot-release]: https://github.com/KhronosGroup/SPIRV-Tools/releases/tag/master-tot diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/assembly_grammar.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/assembly_grammar.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/assembly_grammar.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/assembly_grammar.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,263 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "assembly_grammar.h" + +#include +#include +#include + +#include "ext_inst.h" +#include "opcode.h" +#include "operand.h" +#include "table.h" + +namespace { + +/// @brief Parses a mask expression string for the given operand type. +/// +/// A mask expression is a sequence of one or more terms separated by '|', +/// where each term a named enum value for the given type. No whitespace +/// is permitted. +/// +/// On success, the value is written to pValue. +/// +/// @param[in] operandTable operand lookup table +/// @param[in] type of the operand +/// @param[in] textValue word of text to be parsed +/// @param[out] pValue where the resulting value is written +/// +/// @return result code +spv_result_t spvTextParseMaskOperand(spv_target_env env, + const spv_operand_table operandTable, + const spv_operand_type_t type, + const char* textValue, uint32_t* pValue) { + if (textValue == nullptr) return SPV_ERROR_INVALID_TEXT; + size_t text_length = strlen(textValue); + if (text_length == 0) return SPV_ERROR_INVALID_TEXT; + const char* text_end = textValue + text_length; + + // We only support mask expressions in ASCII, so the separator value is a + // char. + const char separator = '|'; + + // Accumulate the result by interpreting one word at a time, scanning + // from left to right. + uint32_t value = 0; + const char* begin = textValue; // The left end of the current word. + const char* end = nullptr; // One character past the end of the current word. + do { + end = std::find(begin, text_end, separator); + + spv_operand_desc entry = nullptr; + if (spvOperandTableNameLookup(env, operandTable, type, begin, end - begin, + &entry)) { + return SPV_ERROR_INVALID_TEXT; + } + value |= entry->value; + + // Advance to the next word by skipping over the separator. + begin = end + 1; + } while (end != text_end); + + *pValue = value; + return SPV_SUCCESS; +} + +// Associates an opcode with its name. +struct SpecConstantOpcodeEntry { + SpvOp opcode; + const char* name; +}; + +// All the opcodes allowed as the operation for OpSpecConstantOp. +// The name does not have the usual "Op" prefix. For example opcode SpvOpIAdd +// is associated with the name "IAdd". +// +// clang-format off +#define CASE(NAME) { SpvOp##NAME, #NAME } +const SpecConstantOpcodeEntry kOpSpecConstantOpcodes[] = { + // Conversion + CASE(SConvert), + CASE(FConvert), + CASE(ConvertFToS), + CASE(ConvertSToF), + CASE(ConvertFToU), + CASE(ConvertUToF), + CASE(UConvert), + CASE(ConvertPtrToU), + CASE(ConvertUToPtr), + CASE(GenericCastToPtr), + CASE(PtrCastToGeneric), + CASE(Bitcast), + CASE(QuantizeToF16), + // Arithmetic + CASE(SNegate), + CASE(Not), + CASE(IAdd), + CASE(ISub), + CASE(IMul), + CASE(UDiv), + CASE(SDiv), + CASE(UMod), + CASE(SRem), + CASE(SMod), + CASE(ShiftRightLogical), + CASE(ShiftRightArithmetic), + CASE(ShiftLeftLogical), + CASE(BitwiseOr), + CASE(BitwiseAnd), + CASE(BitwiseXor), + CASE(FNegate), + CASE(FAdd), + CASE(FSub), + CASE(FMul), + CASE(FDiv), + CASE(FRem), + CASE(FMod), + // Composite + CASE(VectorShuffle), + CASE(CompositeExtract), + CASE(CompositeInsert), + // Logical + CASE(LogicalOr), + CASE(LogicalAnd), + CASE(LogicalNot), + CASE(LogicalEqual), + CASE(LogicalNotEqual), + CASE(Select), + // Comparison + CASE(IEqual), + CASE(INotEqual), + CASE(ULessThan), + CASE(SLessThan), + CASE(UGreaterThan), + CASE(SGreaterThan), + CASE(ULessThanEqual), + CASE(SLessThanEqual), + CASE(UGreaterThanEqual), + CASE(SGreaterThanEqual), + // Memory + CASE(AccessChain), + CASE(InBoundsAccessChain), + CASE(PtrAccessChain), + CASE(InBoundsPtrAccessChain), +}; + +// The 59 is determined by counting the opcodes listed in the spec. +static_assert(59 == sizeof(kOpSpecConstantOpcodes)/sizeof(kOpSpecConstantOpcodes[0]), + "OpSpecConstantOp opcode table is incomplete"); +#undef CASE +// clang-format on + +const size_t kNumOpSpecConstantOpcodes = + sizeof(kOpSpecConstantOpcodes) / sizeof(kOpSpecConstantOpcodes[0]); + +} // anonymous namespace + +namespace libspirv { + +bool AssemblyGrammar::isValid() const { + return operandTable_ && opcodeTable_ && extInstTable_; +} + +CapabilitySet AssemblyGrammar::filterCapsAgainstTargetEnv( + const SpvCapability* cap_array, uint32_t count) const { + CapabilitySet cap_set; + for (uint32_t i = 0; i < count; ++i) { + spv_operand_desc cap_desc = {}; + if (SPV_SUCCESS == lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, + static_cast(cap_array[i]), + &cap_desc)) { + // spvOperandTableValueLookup() filters capabilities internally + // according to the current target environment by itself. So we + // should be safe to add this capability if the lookup succeeds. + cap_set.Add(cap_array[i]); + } + } + return cap_set; +} + +spv_result_t AssemblyGrammar::lookupOpcode(const char* name, + spv_opcode_desc* desc) const { + return spvOpcodeTableNameLookup(target_env_, opcodeTable_, name, desc); +} + +spv_result_t AssemblyGrammar::lookupOpcode(SpvOp opcode, + spv_opcode_desc* desc) const { + return spvOpcodeTableValueLookup(target_env_, opcodeTable_, opcode, desc); +} + +spv_result_t AssemblyGrammar::lookupOperand(spv_operand_type_t type, + const char* name, size_t name_len, + spv_operand_desc* desc) const { + return spvOperandTableNameLookup(target_env_, operandTable_, type, name, + name_len, desc); +} + +spv_result_t AssemblyGrammar::lookupOperand(spv_operand_type_t type, + uint32_t operand, + spv_operand_desc* desc) const { + return spvOperandTableValueLookup(target_env_, operandTable_, type, operand, + desc); +} + +spv_result_t AssemblyGrammar::lookupSpecConstantOpcode(const char* name, + SpvOp* opcode) const { + const auto* last = kOpSpecConstantOpcodes + kNumOpSpecConstantOpcodes; + const auto* found = + std::find_if(kOpSpecConstantOpcodes, last, + [name](const SpecConstantOpcodeEntry& entry) { + return 0 == strcmp(name, entry.name); + }); + if (found == last) return SPV_ERROR_INVALID_LOOKUP; + *opcode = found->opcode; + return SPV_SUCCESS; +} + +spv_result_t AssemblyGrammar::lookupSpecConstantOpcode(SpvOp opcode) const { + const auto* last = kOpSpecConstantOpcodes + kNumOpSpecConstantOpcodes; + const auto* found = + std::find_if(kOpSpecConstantOpcodes, last, + [opcode](const SpecConstantOpcodeEntry& entry) { + return opcode == entry.opcode; + }); + if (found == last) return SPV_ERROR_INVALID_LOOKUP; + return SPV_SUCCESS; +} + +spv_result_t AssemblyGrammar::parseMaskOperand(const spv_operand_type_t type, + const char* textValue, + uint32_t* pValue) const { + return spvTextParseMaskOperand(target_env_, operandTable_, type, textValue, + pValue); +} +spv_result_t AssemblyGrammar::lookupExtInst(spv_ext_inst_type_t type, + const char* textValue, + spv_ext_inst_desc* extInst) const { + return spvExtInstTableNameLookup(extInstTable_, type, textValue, extInst); +} + +spv_result_t AssemblyGrammar::lookupExtInst(spv_ext_inst_type_t type, + uint32_t firstWord, + spv_ext_inst_desc* extInst) const { + return spvExtInstTableValueLookup(extInstTable_, type, firstWord, extInst); +} + +void AssemblyGrammar::pushOperandTypesForMask( + const spv_operand_type_t type, const uint32_t mask, + spv_operand_pattern_t* pattern) const { + spvPushOperandTypesForMask(target_env_, operandTable_, type, mask, pattern); +} +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/assembly_grammar.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/assembly_grammar.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/assembly_grammar.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/assembly_grammar.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,137 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_ASSEMBLY_GRAMMAR_H_ +#define LIBSPIRV_ASSEMBLY_GRAMMAR_H_ + +#include "enum_set.h" +#include "latest_version_spirv_header.h" +#include "operand.h" +#include "spirv-tools/libspirv.h" +#include "table.h" + +namespace libspirv { + +// Encapsulates the grammar to use for SPIR-V assembly. +// Contains methods to query for valid instructions and operands. +class AssemblyGrammar { + public: + explicit AssemblyGrammar(const spv_const_context context) + : target_env_(context->target_env), + operandTable_(context->operand_table), + opcodeTable_(context->opcode_table), + extInstTable_(context->ext_inst_table) {} + + // Returns true if the internal tables have been initialized with valid data. + bool isValid() const; + + // Returns the SPIR-V target environment. + spv_target_env target_env() const { return target_env_; } + + // Removes capabilities not available in the current target environment and + // returns the rest. + CapabilitySet filterCapsAgainstTargetEnv(const SpvCapability* cap_array, + uint32_t count) const; + + // Fills in the desc parameter with the information about the opcode + // of the given name. Returns SPV_SUCCESS if the opcode was found, and + // SPV_ERROR_INVALID_LOOKUP if the opcode does not exist. + spv_result_t lookupOpcode(const char* name, spv_opcode_desc* desc) const; + + // Fills in the desc parameter with the information about the opcode + // of the valid. Returns SPV_SUCCESS if the opcode was found, and + // SPV_ERROR_INVALID_LOOKUP if the opcode does not exist. + spv_result_t lookupOpcode(SpvOp opcode, spv_opcode_desc* desc) const; + + // Fills in the desc parameter with the information about the given + // operand. Returns SPV_SUCCESS if the operand was found, and + // SPV_ERROR_INVALID_LOOKUP otherwise. + spv_result_t lookupOperand(spv_operand_type_t type, const char* name, + size_t name_len, spv_operand_desc* desc) const; + + // Fills in the desc parameter with the information about the given + // operand. Returns SPV_SUCCESS if the operand was found, and + // SPV_ERROR_INVALID_LOOKUP otherwise. + spv_result_t lookupOperand(spv_operand_type_t type, uint32_t operand, + spv_operand_desc* desc) const; + + // Finds operand entry in the grammar table and returns its name. + // Returns "Unknown" if not found. + const char* lookupOperandName(spv_operand_type_t type, + uint32_t operand) const { + spv_operand_desc desc = nullptr; + if (lookupOperand(type, operand, &desc) != SPV_SUCCESS || !desc) { + return "Unknown"; + } + return desc->name; + } + + // Finds the opcode for the given OpSpecConstantOp opcode name. The name + // should not have the "Op" prefix. For example, "IAdd" corresponds to + // the integer add opcode for OpSpecConstantOp. On success, returns + // SPV_SUCCESS and sends the discovered operation code through the opcode + // parameter. On failure, returns SPV_ERROR_INVALID_LOOKUP. + spv_result_t lookupSpecConstantOpcode(const char* name, SpvOp* opcode) const; + + // Returns SPV_SUCCESS if the given opcode is valid as the opcode operand + // to OpSpecConstantOp. + spv_result_t lookupSpecConstantOpcode(SpvOp opcode) const; + + // Parses a mask expression string for the given operand type. + // + // A mask expression is a sequence of one or more terms separated by '|', + // where each term is a named enum value for a given type. No whitespace + // is permitted. + // + // On success, the value is written to pValue, and SPV_SUCCESS is returned. + // The operand type is defined by the type parameter, and the text to be + // parsed is defined by the textValue parameter. + spv_result_t parseMaskOperand(const spv_operand_type_t type, + const char* textValue, uint32_t* pValue) const; + + // Writes the extended operand with the given type and text to the *extInst + // parameter. + // Returns SPV_SUCCESS if the value could be found. + spv_result_t lookupExtInst(spv_ext_inst_type_t type, const char* textValue, + spv_ext_inst_desc* extInst) const; + + // Writes the extended operand with the given type and first encoded word + // to the *extInst parameter. + // Returns SPV_SUCCESS if the value could be found. + spv_result_t lookupExtInst(spv_ext_inst_type_t type, uint32_t firstWord, + spv_ext_inst_desc* extInst) const; + + // Inserts the operands expected after the given typed mask onto the end + // of the given pattern. + // + // Each set bit in the mask represents zero or more operand types that + // should be appended onto the pattern. Operands for a less significant + // bit must always match before operands for a more significant bit, so + // the operands for a less significant bit must appear closer to the end + // of the pattern stack. + // + // If a set bit is unknown, then we assume it has no operands. + void pushOperandTypesForMask(const spv_operand_type_t type, + const uint32_t mask, + spv_operand_pattern_t* pattern) const; + + private: + const spv_target_env target_env_; + const spv_operand_table operandTable_; + const spv_opcode_table opcodeTable_; + const spv_ext_inst_table extInstTable_; +}; +} // namespace libspirv + +#endif // LIBSPIRV_ASSEMBLY_GRAMMAR_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/binary.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/binary.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/binary.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/binary.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,789 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "binary.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "assembly_grammar.h" +#include "diagnostic.h" +#include "ext_inst.h" +#include "latest_version_spirv_header.h" +#include "opcode.h" +#include "operand.h" +#include "spirv_constant.h" +#include "spirv_endian.h" + +spv_result_t spvBinaryHeaderGet(const spv_const_binary binary, + const spv_endianness_t endian, + spv_header_t* pHeader) { + if (!binary->code) return SPV_ERROR_INVALID_BINARY; + if (binary->wordCount < SPV_INDEX_INSTRUCTION) + return SPV_ERROR_INVALID_BINARY; + if (!pHeader) return SPV_ERROR_INVALID_POINTER; + + // TODO: Validation checking? + pHeader->magic = spvFixWord(binary->code[SPV_INDEX_MAGIC_NUMBER], endian); + pHeader->version = spvFixWord(binary->code[SPV_INDEX_VERSION_NUMBER], endian); + pHeader->generator = + spvFixWord(binary->code[SPV_INDEX_GENERATOR_NUMBER], endian); + pHeader->bound = spvFixWord(binary->code[SPV_INDEX_BOUND], endian); + pHeader->schema = spvFixWord(binary->code[SPV_INDEX_SCHEMA], endian); + pHeader->instructions = &binary->code[SPV_INDEX_INSTRUCTION]; + + return SPV_SUCCESS; +} + +namespace { + +// A SPIR-V binary parser. A parser instance communicates detailed parse +// results via callbacks. +class Parser { + public: + // The user_data value is provided to the callbacks as context. + Parser(const spv_const_context context, void* user_data, + spv_parsed_header_fn_t parsed_header_fn, + spv_parsed_instruction_fn_t parsed_instruction_fn) + : grammar_(context), + consumer_(context->consumer), + user_data_(user_data), + parsed_header_fn_(parsed_header_fn), + parsed_instruction_fn_(parsed_instruction_fn) {} + + // Parses the specified binary SPIR-V module, issuing callbacks on a parsed + // header and for each parsed instruction. Returns SPV_SUCCESS on success. + // Otherwise returns an error code and issues a diagnostic. + spv_result_t parse(const uint32_t* words, size_t num_words, + spv_diagnostic* diagnostic); + + private: + // All remaining methods work on the current module parse state. + + // Like the parse method, but works on the current module parse state. + spv_result_t parseModule(); + + // Parses an instruction at the current position of the binary. Assumes + // the header has been parsed, the endian has been set, and the word index is + // still in range. Advances the parsing position past the instruction, and + // updates other parsing state for the current module. + // On success, returns SPV_SUCCESS and issues the parsed-instruction callback. + // On failure, returns an error code and issues a diagnostic. + spv_result_t parseInstruction(); + + // Parses an instruction operand with the given type, for an instruction + // starting at inst_offset words into the SPIR-V binary. + // If the SPIR-V binary is the same endianness as the host, then the + // endian_converted_inst_words parameter is ignored. Otherwise, this method + // appends the words for this operand, converted to host native endianness, + // to the end of endian_converted_inst_words. This method also updates the + // expected_operands parameter, and the scalar members of the inst parameter. + // On success, returns SPV_SUCCESS, advances past the operand, and pushes a + // new entry on to the operands vector. Otherwise returns an error code and + // issues a diagnostic. + spv_result_t parseOperand(size_t inst_offset, spv_parsed_instruction_t* inst, + const spv_operand_type_t type, + std::vector* endian_converted_inst_words, + std::vector* operands, + spv_operand_pattern_t* expected_operands); + + // Records the numeric type for an operand according to the type information + // associated with the given non-zero type Id. This can fail if the type Id + // is not a type Id, or if the type Id does not reference a scalar numeric + // type. On success, return SPV_SUCCESS and populates the num_words, + // number_kind, and number_bit_width fields of parsed_operand. + spv_result_t setNumericTypeInfoForType(spv_parsed_operand_t* parsed_operand, + uint32_t type_id); + + // Records the number type for an instruction at the given offset, if that + // instruction generates a type. For types that aren't scalar numbers, + // record something with number kind SPV_NUMBER_NONE. + void recordNumberType(size_t inst_offset, + const spv_parsed_instruction_t* inst); + + // Returns a diagnostic stream object initialized with current position in + // the input stream, and for the given error code. Any data written to the + // returned object will be propagated to the current parse's diagnostic + // object. + libspirv::DiagnosticStream diagnostic(spv_result_t error) { + return libspirv::DiagnosticStream({0, 0, _.word_index}, consumer_, error); + } + + // Returns a diagnostic stream object with the default parse error code. + libspirv::DiagnosticStream diagnostic() { + // The default failure for parsing is invalid binary. + return diagnostic(SPV_ERROR_INVALID_BINARY); + } + + // Issues a diagnostic describing an exhaustion of input condition when + // trying to decode an instruction operand, and returns + // SPV_ERROR_INVALID_BINARY. + spv_result_t exhaustedInputDiagnostic(size_t inst_offset, SpvOp opcode, + spv_operand_type_t type) { + return diagnostic() << "End of input reached while decoding Op" + << spvOpcodeString(opcode) << " starting at word " + << inst_offset + << ((_.word_index < _.num_words) ? ": truncated " + : ": missing ") + << spvOperandTypeStr(type) << " operand at word offset " + << _.word_index - inst_offset << "."; + } + + // Returns the endian-corrected word at the current position. + uint32_t peek() const { return peekAt(_.word_index); } + + // Returns the endian-corrected word at the given position. + uint32_t peekAt(size_t index) const { + assert(index < _.num_words); + return spvFixWord(_.words[index], _.endian); + } + + // Data members + + const libspirv::AssemblyGrammar grammar_; // SPIR-V syntax utility. + const spvtools::MessageConsumer& consumer_; // Message consumer callback. + void* const user_data_; // Context for the callbacks + const spv_parsed_header_fn_t parsed_header_fn_; // Parsed header callback + const spv_parsed_instruction_fn_t + parsed_instruction_fn_; // Parsed instruction callback + + // Describes the format of a typed literal number. + struct NumberType { + spv_number_kind_t type; + uint32_t bit_width; + }; + + // The state used to parse a single SPIR-V binary module. + struct State { + State(const uint32_t* words_arg, size_t num_words_arg, + spv_diagnostic* diagnostic_arg) + : words(words_arg), + num_words(num_words_arg), + diagnostic(diagnostic_arg), + word_index(0), + endian(), + requires_endian_conversion(false) { + // Temporary storage for parser state within a single instruction. + // Most instructions require fewer than 25 words or operands. + operands.reserve(25); + endian_converted_words.reserve(25); + expected_operands.reserve(25); + } + State() : State(0, 0, nullptr) {} + const uint32_t* words; // Words in the binary SPIR-V module. + size_t num_words; // Number of words in the module. + spv_diagnostic* diagnostic; // Where diagnostics go. + size_t word_index; // The current position in words. + spv_endianness_t endian; // The endianness of the binary. + // Is the SPIR-V binary in a different endiannes from the host native + // endianness? + bool requires_endian_conversion; + + // Maps a result ID to its type ID. By convention: + // - a result ID that is a type definition maps to itself. + // - a result ID without a type maps to 0. (E.g. for OpLabel) + std::unordered_map id_to_type_id; + // Maps a type ID to its number type description. + std::unordered_map type_id_to_number_type_info; + // Maps an ExtInstImport id to the extended instruction type. + std::unordered_map + import_id_to_ext_inst_type; + + // Used by parseOperand + std::vector operands; + std::vector endian_converted_words; + spv_operand_pattern_t expected_operands; + } _; +}; + +spv_result_t Parser::parse(const uint32_t* words, size_t num_words, + spv_diagnostic* diagnostic_arg) { + _ = State(words, num_words, diagnostic_arg); + + const spv_result_t result = parseModule(); + + // Clear the module state. The tables might be big. + _ = State(); + + return result; +} + +spv_result_t Parser::parseModule() { + if (!_.words) return diagnostic() << "Missing module."; + + if (_.num_words < SPV_INDEX_INSTRUCTION) + return diagnostic() << "Module has incomplete header: only " << _.num_words + << " words instead of " << SPV_INDEX_INSTRUCTION; + + // Check the magic number and detect the module's endianness. + spv_const_binary_t binary{_.words, _.num_words}; + if (spvBinaryEndianness(&binary, &_.endian)) { + return diagnostic() << "Invalid SPIR-V magic number '" << std::hex + << _.words[0] << "'."; + } + _.requires_endian_conversion = !spvIsHostEndian(_.endian); + + // Process the header. + spv_header_t header; + if (spvBinaryHeaderGet(&binary, _.endian, &header)) { + // It turns out there is no way to trigger this error since the only + // failure cases are already handled above, with better messages. + return diagnostic(SPV_ERROR_INTERNAL) + << "Internal error: unhandled header parse failure"; + } + if (parsed_header_fn_) { + if (auto error = parsed_header_fn_(user_data_, _.endian, header.magic, + header.version, header.generator, + header.bound, header.schema)) { + return error; + } + } + + // Process the instructions. + _.word_index = SPV_INDEX_INSTRUCTION; + while (_.word_index < _.num_words) + if (auto error = parseInstruction()) return error; + + // Running off the end should already have been reported earlier. + assert(_.word_index == _.num_words); + + return SPV_SUCCESS; +} + +spv_result_t Parser::parseInstruction() { + // The zero values for all members except for opcode are the + // correct initial values. + spv_parsed_instruction_t inst = {}; + + const uint32_t first_word = peek(); + + // If the module's endianness is different from the host native endianness, + // then converted_words contains the the endian-translated words in the + // instruction. + _.endian_converted_words.clear(); + _.endian_converted_words.push_back(first_word); + + // After a successful parse of the instruction, the inst.operands member + // will point to this vector's storage. + _.operands.clear(); + + assert(_.word_index < _.num_words); + // Decompose and check the first word. + uint16_t inst_word_count = 0; + spvOpcodeSplit(first_word, &inst_word_count, &inst.opcode); + if (inst_word_count < 1) { + return diagnostic() << "Invalid instruction word count: " + << inst_word_count; + } + spv_opcode_desc opcode_desc; + if (grammar_.lookupOpcode(static_cast(inst.opcode), &opcode_desc)) + return diagnostic() << "Invalid opcode: " << inst.opcode; + + // Advance past the opcode word. But remember the of the start + // of the instruction. + const size_t inst_offset = _.word_index; + _.word_index++; + + // Maintains the ordered list of expected operand types. + // For many instructions we only need the {numTypes, operandTypes} + // entries in opcode_desc. However, sometimes we need to modify + // the list as we parse the operands. This occurs when an operand + // has its own logical operands (such as the LocalSize operand for + // ExecutionMode), or for extended instructions that may have their + // own operands depending on the selected extended instruction. + _.expected_operands.clear(); + for (auto i = 0; i < opcode_desc->numTypes; i++) + _.expected_operands.push_back( + opcode_desc->operandTypes[opcode_desc->numTypes - i - 1]); + + while (_.word_index < inst_offset + inst_word_count) { + const uint16_t inst_word_index = uint16_t(_.word_index - inst_offset); + if (_.expected_operands.empty()) { + return diagnostic() << "Invalid instruction Op" << opcode_desc->name + << " starting at word " << inst_offset + << ": expected no more operands after " + << inst_word_index + << " words, but stated word count is " + << inst_word_count << "."; + } + + spv_operand_type_t type = + spvTakeFirstMatchableOperand(&_.expected_operands); + + if (auto error = + parseOperand(inst_offset, &inst, type, &_.endian_converted_words, + &_.operands, &_.expected_operands)) { + return error; + } + } + + if (!_.expected_operands.empty() && + !spvOperandIsOptional(_.expected_operands.back())) { + return diagnostic() << "End of input reached while decoding Op" + << opcode_desc->name << " starting at word " + << inst_offset << ": expected more operands after " + << inst_word_count << " words."; + } + + if ((inst_offset + inst_word_count) != _.word_index) { + return diagnostic() << "Invalid word count: Op" << opcode_desc->name + << " starting at word " << inst_offset + << " says it has " << inst_word_count + << " words, but found " << _.word_index - inst_offset + << " words instead."; + } + + // Check the computed length of the endian-converted words vector against + // the declared number of words in the instruction. If endian conversion + // is required, then they should match. If no endian conversion was + // performed, then the vector only contains the initial opcode/word-count + // word. + assert(!_.requires_endian_conversion || + (inst_word_count == _.endian_converted_words.size())); + assert(_.requires_endian_conversion || + (_.endian_converted_words.size() == 1)); + + recordNumberType(inst_offset, &inst); + + if (_.requires_endian_conversion) { + // We must wait until here to set this pointer, because the vector might + // have been be resized while we accumulated its elements. + inst.words = _.endian_converted_words.data(); + } else { + // If no conversion is required, then just point to the underlying binary. + // This saves time and space. + inst.words = _.words + inst_offset; + } + inst.num_words = inst_word_count; + + // We must wait until here to set this pointer, because the vector might + // have been be resized while we accumulated its elements. + inst.operands = _.operands.data(); + inst.num_operands = uint16_t(_.operands.size()); + + // Issue the callback. The callee should know that all the storage in inst + // is transient, and will disappear immediately afterward. + if (parsed_instruction_fn_) { + if (auto error = parsed_instruction_fn_(user_data_, &inst)) return error; + } + + return SPV_SUCCESS; +} + +spv_result_t Parser::parseOperand(size_t inst_offset, + spv_parsed_instruction_t* inst, + const spv_operand_type_t type, + std::vector* words, + std::vector* operands, + spv_operand_pattern_t* expected_operands) { + const SpvOp opcode = static_cast(inst->opcode); + // We'll fill in this result as we go along. + spv_parsed_operand_t parsed_operand; + parsed_operand.offset = uint16_t(_.word_index - inst_offset); + // Most operands occupy one word. This might be be adjusted later. + parsed_operand.num_words = 1; + // The type argument is the one used by the grammar to parse the instruction. + // But it can exposes internal parser details such as whether an operand is + // optional or actually represents a variable-length sequence of operands. + // The resulting type should be adjusted to avoid those internal details. + // In most cases, the resulting operand type is the same as the grammar type. + parsed_operand.type = type; + + // Assume non-numeric values. This will be updated for literal numbers. + parsed_operand.number_kind = SPV_NUMBER_NONE; + parsed_operand.number_bit_width = 0; + + if (_.word_index >= _.num_words) + return exhaustedInputDiagnostic(inst_offset, opcode, type); + + const uint32_t word = peek(); + + // Do the words in this operand have to be converted to native endianness? + // True for all but literal strings. + bool convert_operand_endianness = true; + + switch (type) { + case SPV_OPERAND_TYPE_TYPE_ID: + if (!word) + return diagnostic(SPV_ERROR_INVALID_ID) << "Error: Type Id is 0"; + inst->type_id = word; + break; + + case SPV_OPERAND_TYPE_RESULT_ID: + if (!word) + return diagnostic(SPV_ERROR_INVALID_ID) << "Error: Result Id is 0"; + inst->result_id = word; + // Save the result ID to type ID mapping. + // In the grammar, type ID always appears before result ID. + if (_.id_to_type_id.find(inst->result_id) != _.id_to_type_id.end()) + return diagnostic(SPV_ERROR_INVALID_ID) + << "Id " << inst->result_id << " is defined more than once"; + // Record it. + // A regular value maps to its type. Some instructions (e.g. OpLabel) + // have no type Id, and will map to 0. The result Id for a + // type-generating instruction (e.g. OpTypeInt) maps to itself. + _.id_to_type_id[inst->result_id] = + spvOpcodeGeneratesType(opcode) ? inst->result_id : inst->type_id; + break; + + case SPV_OPERAND_TYPE_ID: + case SPV_OPERAND_TYPE_OPTIONAL_ID: + if (!word) return diagnostic(SPV_ERROR_INVALID_ID) << "Id is 0"; + parsed_operand.type = SPV_OPERAND_TYPE_ID; + + if (opcode == SpvOpExtInst && parsed_operand.offset == 3) { + // The current word is the extended instruction set Id. + // Set the extended instruction set type for the current instruction. + auto ext_inst_type_iter = _.import_id_to_ext_inst_type.find(word); + if (ext_inst_type_iter == _.import_id_to_ext_inst_type.end()) { + return diagnostic(SPV_ERROR_INVALID_ID) + << "OpExtInst set Id " << word + << " does not reference an OpExtInstImport result Id"; + } + inst->ext_inst_type = ext_inst_type_iter->second; + } + break; + + case SPV_OPERAND_TYPE_SCOPE_ID: + case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: + // Check for trivially invalid values. The operand descriptions already + // have the word "ID" in them. + if (!word) return diagnostic() << spvOperandTypeStr(type) << " is 0"; + break; + + case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: { + assert(SpvOpExtInst == opcode); + assert(inst->ext_inst_type != SPV_EXT_INST_TYPE_NONE); + spv_ext_inst_desc ext_inst; + if (grammar_.lookupExtInst(inst->ext_inst_type, word, &ext_inst)) + return diagnostic() << "Invalid extended instruction number: " << word; + spvPushOperandTypes(ext_inst->operandTypes, expected_operands); + } break; + + case SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER: { + assert(SpvOpSpecConstantOp == opcode); + if (grammar_.lookupSpecConstantOpcode(SpvOp(word))) { + return diagnostic() + << "Invalid " << spvOperandTypeStr(type) << ": " << word; + } + spv_opcode_desc opcode_entry = nullptr; + if (grammar_.lookupOpcode(SpvOp(word), &opcode_entry)) { + return diagnostic(SPV_ERROR_INTERNAL) + << "OpSpecConstant opcode table out of sync"; + } + // OpSpecConstant opcodes must have a type and result. We've already + // processed them, so skip them when preparing to parse the other + // operants for the opcode. + assert(opcode_entry->hasType); + assert(opcode_entry->hasResult); + assert(opcode_entry->numTypes >= 2); + spvPushOperandTypes(opcode_entry->operandTypes + 2, expected_operands); + } break; + + case SPV_OPERAND_TYPE_LITERAL_INTEGER: + case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER: + // These are regular single-word literal integer operands. + // Post-parsing validation should check the range of the parsed value. + parsed_operand.type = SPV_OPERAND_TYPE_LITERAL_INTEGER; + // It turns out they are always unsigned integers! + parsed_operand.number_kind = SPV_NUMBER_UNSIGNED_INT; + parsed_operand.number_bit_width = 32; + break; + + case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: + case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER: + parsed_operand.type = SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER; + if (opcode == SpvOpSwitch) { + // The literal operands have the same type as the value + // referenced by the selector Id. + const uint32_t selector_id = peekAt(inst_offset + 1); + const auto type_id_iter = _.id_to_type_id.find(selector_id); + if (type_id_iter == _.id_to_type_id.end() || + type_id_iter->second == 0) { + return diagnostic() << "Invalid OpSwitch: selector id " << selector_id + << " has no type"; + } + uint32_t type_id = type_id_iter->second; + + if (selector_id == type_id) { + // Recall that by convention, a result ID that is a type definition + // maps to itself. + return diagnostic() << "Invalid OpSwitch: selector id " << selector_id + << " is a type, not a value"; + } + if (auto error = setNumericTypeInfoForType(&parsed_operand, type_id)) + return error; + if (parsed_operand.number_kind != SPV_NUMBER_UNSIGNED_INT && + parsed_operand.number_kind != SPV_NUMBER_SIGNED_INT) { + return diagnostic() << "Invalid OpSwitch: selector id " << selector_id + << " is not a scalar integer"; + } + } else { + assert(opcode == SpvOpConstant || opcode == SpvOpSpecConstant); + // The literal number type is determined by the type Id for the + // constant. + assert(inst->type_id); + if (auto error = + setNumericTypeInfoForType(&parsed_operand, inst->type_id)) + return error; + } + break; + + case SPV_OPERAND_TYPE_LITERAL_STRING: + case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING: { + convert_operand_endianness = false; + const char* string = + reinterpret_cast(_.words + _.word_index); + // Compute the length of the string, but make sure we don't run off the + // end of the input. + const size_t remaining_input_bytes = + sizeof(uint32_t) * (_.num_words - _.word_index); + const size_t string_num_content_bytes = + spv_strnlen_s(string, remaining_input_bytes); + // If there was no terminating null byte, then that's an end-of-input + // error. + if (string_num_content_bytes == remaining_input_bytes) + return exhaustedInputDiagnostic(inst_offset, opcode, type); + // Account for null in the word length, so add 1 for null, then add 3 to + // make sure we round up. The following is equivalent to: + // (string_num_content_bytes + 1 + 3) / 4 + const size_t string_num_words = string_num_content_bytes / 4 + 1; + // Make sure we can record the word count without overflow. + // + // This error can't currently be triggered because of validity + // checks elsewhere. + if (string_num_words > std::numeric_limits::max()) { + return diagnostic() << "Literal string is longer than " + << std::numeric_limits::max() + << " words: " << string_num_words << " words long"; + } + parsed_operand.num_words = uint16_t(string_num_words); + parsed_operand.type = SPV_OPERAND_TYPE_LITERAL_STRING; + + if (SpvOpExtInstImport == opcode) { + // Record the extended instruction type for the ID for this import. + // There is only one string literal argument to OpExtInstImport, + // so it's sufficient to guard this just on the opcode. + const spv_ext_inst_type_t ext_inst_type = + spvExtInstImportTypeGet(string); + if (SPV_EXT_INST_TYPE_NONE == ext_inst_type) { + return diagnostic() + << "Invalid extended instruction import '" << string << "'"; + } + // We must have parsed a valid result ID. It's a condition + // of the grammar, and we only accept non-zero result Ids. + assert(inst->result_id); + _.import_id_to_ext_inst_type[inst->result_id] = ext_inst_type; + } + } break; + + case SPV_OPERAND_TYPE_CAPABILITY: + case SPV_OPERAND_TYPE_SOURCE_LANGUAGE: + case SPV_OPERAND_TYPE_EXECUTION_MODEL: + case SPV_OPERAND_TYPE_ADDRESSING_MODEL: + case SPV_OPERAND_TYPE_MEMORY_MODEL: + case SPV_OPERAND_TYPE_EXECUTION_MODE: + case SPV_OPERAND_TYPE_STORAGE_CLASS: + case SPV_OPERAND_TYPE_DIMENSIONALITY: + case SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE: + case SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE: + case SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT: + case SPV_OPERAND_TYPE_FP_ROUNDING_MODE: + case SPV_OPERAND_TYPE_LINKAGE_TYPE: + case SPV_OPERAND_TYPE_ACCESS_QUALIFIER: + case SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER: + case SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE: + case SPV_OPERAND_TYPE_DECORATION: + case SPV_OPERAND_TYPE_BUILT_IN: + case SPV_OPERAND_TYPE_GROUP_OPERATION: + case SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS: + case SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO: + case SPV_OPERAND_TYPE_DEBUG_BASE_TYPE_ATTRIBUTE_ENCODING: + case SPV_OPERAND_TYPE_DEBUG_COMPOSITE_TYPE: + case SPV_OPERAND_TYPE_DEBUG_TYPE_QUALIFIER: + case SPV_OPERAND_TYPE_DEBUG_OPERATION: { + // A single word that is a plain enum value. + + // Map an optional operand type to its corresponding concrete type. + if (type == SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER) + parsed_operand.type = SPV_OPERAND_TYPE_ACCESS_QUALIFIER; + + spv_operand_desc entry; + if (grammar_.lookupOperand(type, word, &entry)) { + return diagnostic() + << "Invalid " << spvOperandTypeStr(parsed_operand.type) + << " operand: " << word; + } + // Prepare to accept operands to this operand, if needed. + spvPushOperandTypes(entry->operandTypes, expected_operands); + } break; + + case SPV_OPERAND_TYPE_FP_FAST_MATH_MODE: + case SPV_OPERAND_TYPE_FUNCTION_CONTROL: + case SPV_OPERAND_TYPE_LOOP_CONTROL: + case SPV_OPERAND_TYPE_IMAGE: + case SPV_OPERAND_TYPE_OPTIONAL_IMAGE: + case SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS: + case SPV_OPERAND_TYPE_SELECTION_CONTROL: + case SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS: { + // This operand is a mask. + + // Map an optional operand type to its corresponding concrete type. + if (type == SPV_OPERAND_TYPE_OPTIONAL_IMAGE) + parsed_operand.type = SPV_OPERAND_TYPE_IMAGE; + else if (type == SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS) + parsed_operand.type = SPV_OPERAND_TYPE_MEMORY_ACCESS; + + // Check validity of set mask bits. Also prepare for operands for those + // masks if they have any. To get operand order correct, scan from + // MSB to LSB since we can only prepend operands to a pattern. + // The only case in the grammar where you have more than one mask bit + // having an operand is for image operands. See SPIR-V 3.14 Image + // Operands. + uint32_t remaining_word = word; + for (uint32_t mask = (1u << 31); remaining_word; mask >>= 1) { + if (remaining_word & mask) { + spv_operand_desc entry; + if (grammar_.lookupOperand(type, mask, &entry)) { + return diagnostic() + << "Invalid " << spvOperandTypeStr(parsed_operand.type) + << " operand: " << word << " has invalid mask component " + << mask; + } + remaining_word ^= mask; + spvPushOperandTypes(entry->operandTypes, expected_operands); + } + } + if (word == 0) { + // An all-zeroes mask *might* also be valid. + spv_operand_desc entry; + if (SPV_SUCCESS == grammar_.lookupOperand(type, 0, &entry)) { + // Prepare for its operands, if any. + spvPushOperandTypes(entry->operandTypes, expected_operands); + } + } + } break; + default: + return diagnostic() << "Internal error: Unhandled operand type: " << type; + } + + assert(spvOperandIsConcrete(parsed_operand.type)); + + operands->push_back(parsed_operand); + + const size_t index_after_operand = _.word_index + parsed_operand.num_words; + + // Avoid buffer overrun for the cases where the operand has more than one + // word, and where it isn't a string. (Those other cases have already been + // handled earlier.) For example, this error can occur for a multi-word + // argument to OpConstant, or a multi-word case literal operand for OpSwitch. + if (_.num_words < index_after_operand) + return exhaustedInputDiagnostic(inst_offset, opcode, type); + + if (_.requires_endian_conversion) { + // Copy instruction words. Translate to native endianness as needed. + if (convert_operand_endianness) { + const spv_endianness_t endianness = _.endian; + std::transform(_.words + _.word_index, _.words + index_after_operand, + std::back_inserter(*words), + [endianness](const uint32_t raw_word) { + return spvFixWord(raw_word, endianness); + }); + } else { + words->insert(words->end(), _.words + _.word_index, + _.words + index_after_operand); + } + } + + // Advance past the operand. + _.word_index = index_after_operand; + + return SPV_SUCCESS; +} + +spv_result_t Parser::setNumericTypeInfoForType( + spv_parsed_operand_t* parsed_operand, uint32_t type_id) { + assert(type_id != 0); + auto type_info_iter = _.type_id_to_number_type_info.find(type_id); + if (type_info_iter == _.type_id_to_number_type_info.end()) { + return diagnostic() << "Type Id " << type_id << " is not a type"; + } + const NumberType& info = type_info_iter->second; + if (info.type == SPV_NUMBER_NONE) { + // This is a valid type, but for something other than a scalar number. + return diagnostic() << "Type Id " << type_id + << " is not a scalar numeric type"; + } + + parsed_operand->number_kind = info.type; + parsed_operand->number_bit_width = info.bit_width; + // Round up the word count. + parsed_operand->num_words = static_cast((info.bit_width + 31) / 32); + return SPV_SUCCESS; +} + +void Parser::recordNumberType(size_t inst_offset, + const spv_parsed_instruction_t* inst) { + const SpvOp opcode = static_cast(inst->opcode); + if (spvOpcodeGeneratesType(opcode)) { + NumberType info = {SPV_NUMBER_NONE, 0}; + if (SpvOpTypeInt == opcode) { + const bool is_signed = peekAt(inst_offset + 3) != 0; + info.type = is_signed ? SPV_NUMBER_SIGNED_INT : SPV_NUMBER_UNSIGNED_INT; + info.bit_width = peekAt(inst_offset + 2); + } else if (SpvOpTypeFloat == opcode) { + info.type = SPV_NUMBER_FLOATING; + info.bit_width = peekAt(inst_offset + 2); + } + // The *result* Id of a type generating instruction is the type Id. + _.type_id_to_number_type_info[inst->result_id] = info; + } +} + +} // anonymous namespace + +spv_result_t spvBinaryParse(const spv_const_context context, void* user_data, + const uint32_t* code, const size_t num_words, + spv_parsed_header_fn_t parsed_header, + spv_parsed_instruction_fn_t parsed_instruction, + spv_diagnostic* diagnostic) { + spv_context_t hijack_context = *context; + if (diagnostic) { + *diagnostic = nullptr; + libspirv::UseDiagnosticAsMessageConsumer(&hijack_context, diagnostic); + } + Parser parser(&hijack_context, user_data, parsed_header, parsed_instruction); + return parser.parse(code, num_words, diagnostic); +} + +// TODO(dneto): This probably belongs in text.cpp since that's the only place +// that a spv_binary_t value is created. +void spvBinaryDestroy(spv_binary binary) { + if (!binary) return; + delete[] binary->code; + delete binary; +} + +size_t spv_strnlen_s(const char* str, size_t strsz) { + if (!str) return 0; + for (size_t i = 0; i < strsz; i++) { + if (!str[i]) return i; + } + return strsz; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/binary.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/binary.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/binary.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/binary.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,36 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_BINARY_H_ +#define LIBSPIRV_BINARY_H_ + +#include "spirv-tools/libspirv.h" +#include "spirv_definition.h" + +// Functions + +// Grabs the header from the SPIR-V module given in the binary parameter. The +// endian parameter specifies the endianness of the binary module. On success, +// returns SPV_SUCCESS and writes the parsed header into *header. +spv_result_t spvBinaryHeaderGet(const spv_const_binary binary, + const spv_endianness_t endian, + spv_header_t* header); + +// Returns the number of non-null characters in str before the first null +// character, or strsz if there is no null character. Examines at most the +// first strsz characters in str. Returns 0 if str is nullptr. This is a +// replacement for C11's strnlen_s which might not exist in all environments. +size_t spv_strnlen_s(const char* str, size_t strsz); + +#endif // LIBSPIRV_BINARY_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/cfa.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/cfa.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/cfa.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/cfa.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,338 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SPVTOOLS_CFA_H_ +#define SPVTOOLS_CFA_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using std::find; +using std::function; +using std::get; +using std::pair; +using std::unordered_map; +using std::unordered_set; +using std::vector; + +namespace spvtools { + +// Control Flow Analysis of control flow graphs of basic block nodes |BB|. +template +class CFA { + using bb_ptr = BB*; + using cbb_ptr = const BB*; + using bb_iter = typename std::vector::const_iterator; + using get_blocks_func = std::function*(const BB*)>; + + struct block_info { + cbb_ptr block; ///< pointer to the block + bb_iter iter; ///< Iterator to the current child node being processed + }; + + /// Returns true if a block with @p id is found in the @p work_list vector + /// + /// @param[in] work_list Set of blocks visited in the the depth first + /// traversal + /// of the CFG + /// @param[in] id The ID of the block being checked + /// + /// @return true if the edge work_list.back().block->id() => id is a back-edge + static bool FindInWorkList(const std::vector& work_list, + uint32_t id); + + public: + /// @brief Depth first traversal starting from the \p entry BasicBlock + /// + /// This function performs a depth first traversal from the \p entry + /// BasicBlock and calls the pre/postorder functions when it needs to process + /// the node in pre order, post order. It also calls the backedge function + /// when a back edge is encountered. + /// + /// @param[in] entry The root BasicBlock of a CFG + /// @param[in] successor_func A function which will return a pointer to the + /// successor nodes + /// @param[in] preorder A function that will be called for every block in a + /// CFG following preorder traversal semantics + /// @param[in] postorder A function that will be called for every block in a + /// CFG following postorder traversal semantics + /// @param[in] backedge A function that will be called when a backedge is + /// encountered during a traversal + /// NOTE: The @p successor_func and predecessor_func each return a pointer to + /// a + /// collection such that iterators to that collection remain valid for the + /// lifetime of the algorithm. + static void DepthFirstTraversal( + const BB* entry, get_blocks_func successor_func, + std::function preorder, + std::function postorder, + std::function backedge); + + /// @brief Calculates dominator edges for a set of blocks + /// + /// Computes dominators using the algorithm of Cooper, Harvey, and Kennedy + /// "A Simple, Fast Dominance Algorithm", 2001. + /// + /// The algorithm assumes there is a unique root node (a node without + /// predecessors), and it is therefore at the end of the postorder vector. + /// + /// This function calculates the dominator edges for a set of blocks in the + /// CFG. + /// Uses the dominator algorithm by Cooper et al. + /// + /// @param[in] postorder A vector of blocks in post order traversal + /// order + /// in a CFG + /// @param[in] predecessor_func Function used to get the predecessor nodes of + /// a + /// block + /// + /// @return the dominator tree of the graph, as a vector of pairs of nodes. + /// The first node in the pair is a node in the graph. The second node in the + /// pair is its immediate dominator in the sense of Cooper et.al., where a + /// block + /// without predecessors (such as the root node) is its own immediate + /// dominator. + static vector> CalculateDominators( + const vector& postorder, get_blocks_func predecessor_func); + + // Computes a minimal set of root nodes required to traverse, in the forward + // direction, the CFG represented by the given vector of blocks, and successor + // and predecessor functions. When considering adding two nodes, each having + // predecessors, favour using the one that appears earlier on the input blocks + // list. + static std::vector TraversalRoots(const std::vector& blocks, + get_blocks_func succ_func, + get_blocks_func pred_func); + + static void ComputeAugmentedCFG( + std::vector& ordered_blocks, BB* pseudo_entry_block, + BB* pseudo_exit_block, + std::unordered_map>* augmented_successors_map, + std::unordered_map>* + augmented_predecessors_map, + get_blocks_func succ_func, get_blocks_func pred_func); +}; + +template +bool CFA::FindInWorkList(const vector& work_list, uint32_t id) { + for (const auto b : work_list) { + if (b.block->id() == id) return true; + } + return false; +} + +template +void CFA::DepthFirstTraversal(const BB* entry, + get_blocks_func successor_func, + function preorder, + function postorder, + function backedge) { + unordered_set processed; + + /// NOTE: work_list is the sequence of nodes from the root node to the node + /// being processed in the traversal + vector work_list; + work_list.reserve(10); + + work_list.push_back({entry, begin(*successor_func(entry))}); + preorder(entry); + processed.insert(entry->id()); + + while (!work_list.empty()) { + block_info& top = work_list.back(); + if (top.iter == end(*successor_func(top.block))) { + postorder(top.block); + work_list.pop_back(); + } else { + BB* child = *top.iter; + top.iter++; + if (FindInWorkList(work_list, child->id())) { + backedge(top.block, child); + } + if (processed.count(child->id()) == 0) { + preorder(child); + work_list.emplace_back( + block_info{child, begin(*successor_func(child))}); + processed.insert(child->id()); + } + } + } +} + +template +vector> CFA::CalculateDominators( + const vector& postorder, get_blocks_func predecessor_func) { + struct block_detail { + size_t dominator; ///< The index of blocks's dominator in post order array + size_t postorder_index; ///< The index of the block in the post order array + }; + const size_t undefined_dom = postorder.size(); + + unordered_map idoms; + for (size_t i = 0; i < postorder.size(); i++) { + idoms[postorder[i]] = {undefined_dom, i}; + } + idoms[postorder.back()].dominator = idoms[postorder.back()].postorder_index; + + bool changed = true; + while (changed) { + changed = false; + for (auto b = postorder.rbegin() + 1; b != postorder.rend(); ++b) { + const vector& predecessors = *predecessor_func(*b); + // Find the first processed/reachable predecessor that is reachable + // in the forward traversal. + auto res = find_if(begin(predecessors), end(predecessors), + [&idoms, undefined_dom](BB* pred) { + return idoms.count(pred) && + idoms[pred].dominator != undefined_dom; + }); + if (res == end(predecessors)) continue; + const BB* idom = *res; + size_t idom_idx = idoms[idom].postorder_index; + + // all other predecessors + for (const auto* p : predecessors) { + if (idom == p) continue; + // Only consider nodes reachable in the forward traversal. + // Otherwise the intersection doesn't make sense and will never + // terminate. + if (!idoms.count(p)) continue; + if (idoms[p].dominator != undefined_dom) { + size_t finger1 = idoms[p].postorder_index; + size_t finger2 = idom_idx; + while (finger1 != finger2) { + while (finger1 < finger2) { + finger1 = idoms[postorder[finger1]].dominator; + } + while (finger2 < finger1) { + finger2 = idoms[postorder[finger2]].dominator; + } + } + idom_idx = finger1; + } + } + if (idoms[*b].dominator != idom_idx) { + idoms[*b].dominator = idom_idx; + changed = true; + } + } + } + + vector> out; + for (auto idom : idoms) { + // NOTE: performing a const cast for convenient usage with + // UpdateImmediateDominators + out.push_back({const_cast(get<0>(idom)), + const_cast(postorder[get<1>(idom).dominator])}); + } + return out; +} + +template +std::vector CFA::TraversalRoots(const std::vector& blocks, + get_blocks_func succ_func, + get_blocks_func pred_func) { + // The set of nodes which have been visited from any of the roots so far. + std::unordered_set visited; + + auto mark_visited = [&visited](const BB* b) { visited.insert(b); }; + auto ignore_block = [](const BB*) {}; + auto ignore_blocks = [](const BB*, const BB*) {}; + + auto traverse_from_root = [&mark_visited, &succ_func, &ignore_block, + &ignore_blocks](const BB* entry) { + DepthFirstTraversal(entry, succ_func, mark_visited, ignore_block, + ignore_blocks); + }; + + std::vector result; + + // First collect nodes without predecessors. + for (auto block : blocks) { + if (pred_func(block)->empty()) { + assert(visited.count(block) == 0 && "Malformed graph!"); + result.push_back(block); + traverse_from_root(block); + } + } + + // Now collect other stranded nodes. These must be in unreachable cycles. + for (auto block : blocks) { + if (visited.count(block) == 0) { + result.push_back(block); + traverse_from_root(block); + } + } + + return result; +} + +template +void CFA::ComputeAugmentedCFG( + std::vector& ordered_blocks, BB* pseudo_entry_block, + BB* pseudo_exit_block, + std::unordered_map>* augmented_successors_map, + std::unordered_map>* augmented_predecessors_map, + get_blocks_func succ_func, get_blocks_func pred_func) { + // Compute the successors of the pseudo-entry block, and + // the predecessors of the pseudo exit block. + auto sources = TraversalRoots(ordered_blocks, succ_func, pred_func); + + // For the predecessor traversals, reverse the order of blocks. This + // will affect the post-dominance calculation as follows: + // - Suppose you have blocks A and B, with A appearing before B in + // the list of blocks. + // - Also, A branches only to B, and B branches only to A. + // - We want to compute A as dominating B, and B as post-dominating B. + // By using reversed blocks for predecessor traversal roots discovery, + // we'll add an edge from B to the pseudo-exit node, rather than from A. + // All this is needed to correctly process the dominance/post-dominance + // constraint when A is a loop header that points to itself as its + // own continue target, and B is the latch block for the loop. + std::vector reversed_blocks(ordered_blocks.rbegin(), + ordered_blocks.rend()); + auto sinks = TraversalRoots(reversed_blocks, pred_func, succ_func); + + // Wire up the pseudo entry block. + (*augmented_successors_map)[pseudo_entry_block] = sources; + for (auto block : sources) { + auto& augmented_preds = (*augmented_predecessors_map)[block]; + const auto preds = pred_func(block); + augmented_preds.reserve(1 + preds->size()); + augmented_preds.push_back(pseudo_entry_block); + augmented_preds.insert(augmented_preds.end(), preds->begin(), preds->end()); + } + + // Wire up the pseudo exit block. + (*augmented_predecessors_map)[pseudo_exit_block] = sinks; + for (auto block : sinks) { + auto& augmented_succ = (*augmented_successors_map)[block]; + const auto succ = succ_func(block); + augmented_succ.reserve(1 + succ->size()); + augmented_succ.push_back(pseudo_exit_block); + augmented_succ.insert(augmented_succ.end(), succ->begin(), succ->end()); + } +} + +} // namespace spvtools + +#endif // SPVTOOLS_CFA_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,362 @@ +# Copyright (c) 2015-2016 The Khronos Group Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set(GRAMMAR_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_grammar_tables.py") +set(VIMSYNTAX_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_vim_syntax.py") +set(XML_REGISTRY_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_registry_tables.py") +set(LANG_HEADER_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_language_headers.py") + +# For now, assume the DebugInfo grammar file is in the current directory. +# It might migrate to SPIRV-Headers. +set(DEBUGINFO_GRAMMAR_JSON_FILE "${CMAKE_CURRENT_SOURCE_DIR}/extinst.debuginfo.grammar.json") + +# macro() definitions are used in the following because we need to append .inc +# file paths into some global lists (*_CPP_DEPENDS). And those global lists are +# later used by set_source_files_properties() calls. +# function() definitions are not suitable because they create new scopes. +macro(spvtools_core_tables VERSION) + set(GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/spirv.core.grammar.json") + set(GRAMMAR_INSTS_INC_FILE "${spirv-tools_BINARY_DIR}/core.insts-${VERSION}.inc") + set(GRAMMAR_KINDS_INC_FILE "${spirv-tools_BINARY_DIR}/operand.kinds-${VERSION}.inc") + add_custom_command(OUTPUT ${GRAMMAR_INSTS_INC_FILE} ${GRAMMAR_KINDS_INC_FILE} + COMMAND ${PYTHON_EXECUTABLE} ${GRAMMAR_PROCESSING_SCRIPT} + --spirv-core-grammar=${GRAMMAR_JSON_FILE} + --extinst-debuginfo-grammar=${DEBUGINFO_GRAMMAR_JSON_FILE} + --core-insts-output=${GRAMMAR_INSTS_INC_FILE} + --operand-kinds-output=${GRAMMAR_KINDS_INC_FILE} + DEPENDS ${GRAMMAR_PROCESSING_SCRIPT} ${GRAMMAR_JSON_FILE} ${DEBUGINFO_GRAMMAR_JSON_FILE} + COMMENT "Generate info tables for SPIR-V v${VERSION} core instructions and operands.") + list(APPEND OPCODE_CPP_DEPENDS ${GRAMMAR_INSTS_INC_FILE}) + list(APPEND OPERAND_CPP_DEPENDS ${GRAMMAR_KINDS_INC_FILE}) +endmacro(spvtools_core_tables) + +macro(spvtools_enum_string_mapping VERSION) + set(GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/spirv.core.grammar.json") + set(GRAMMAR_EXTENSION_ENUM_INC_FILE "${spirv-tools_BINARY_DIR}/extension_enum.inc") + set(GRAMMAR_ENUM_STRING_MAPPING_INC_FILE "${spirv-tools_BINARY_DIR}/enum_string_mapping.inc") + add_custom_command(OUTPUT ${GRAMMAR_EXTENSION_ENUM_INC_FILE} + ${GRAMMAR_ENUM_STRING_MAPPING_INC_FILE} + COMMAND ${PYTHON_EXECUTABLE} ${GRAMMAR_PROCESSING_SCRIPT} + --spirv-core-grammar=${GRAMMAR_JSON_FILE} + --extinst-debuginfo-grammar=${DEBUGINFO_GRAMMAR_JSON_FILE} + --extension-enum-output=${GRAMMAR_EXTENSION_ENUM_INC_FILE} + --enum-string-mapping-output=${GRAMMAR_ENUM_STRING_MAPPING_INC_FILE} + DEPENDS ${GRAMMAR_PROCESSING_SCRIPT} ${GRAMMAR_JSON_FILE} ${DEBUGINFO_GRAMMAR_JSON_FILE} + COMMENT "Generate enum-string mapping for SPIR-V v${VERSION}.") + list(APPEND EXTENSION_H_DEPENDS ${GRAMMAR_EXTENSION_ENUM_INC_FILE}) + list(APPEND ENUM_STRING_MAPPING_CPP_DEPENDS ${GRAMMAR_ENUM_STRING_MAPPING_INC_FILE}) +endmacro(spvtools_enum_string_mapping) + +macro(spvtools_vimsyntax VERSION CLVERSION) + set(GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/spirv.core.grammar.json") + set(GLSL_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/extinst.glsl.std.450.grammar.json") + set(OPENCL_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/extinst.opencl.std.100.grammar.json") + set(VIMSYNTAX_FILE "${spirv-tools_BINARY_DIR}/spvasm.vim") + add_custom_command(OUTPUT ${VIMSYNTAX_FILE} + COMMAND ${PYTHON_EXECUTABLE} ${VIMSYNTAX_PROCESSING_SCRIPT} + --spirv-core-grammar=${GRAMMAR_JSON_FILE} + --extinst-debuginfo-grammar=${DEBUGINFO_GRAMMAR_JSON_FILE} + --extinst-glsl-grammar=${GLSL_GRAMMAR_JSON_FILE} + --extinst-opencl-grammar=${OPENCL_GRAMMAR_JSON_FILE} + >${VIMSYNTAX_FILE} + DEPENDS ${VIMSYNTAX_PROCESSING_SCRIPT} ${GRAMMAR_JSON_FILE} + ${GLSL_GRAMMAR_JSON_FILE} ${OPENCL_GRAMMAR_JSON_FILE} ${DEBUGINFO_GRAMMAR_JSON_FILE} + COMMENT "Generate spvasm.vim: Vim syntax file for SPIR-V assembly.") +endmacro(spvtools_vimsyntax) + +macro(spvtools_glsl_tables VERSION) + set(CORE_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/spirv.core.grammar.json") + set(GLSL_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/extinst.glsl.std.450.grammar.json") + set(GRAMMAR_INC_FILE "${spirv-tools_BINARY_DIR}/glsl.std.450.insts.inc") + add_custom_command(OUTPUT ${GRAMMAR_INC_FILE} + COMMAND ${PYTHON_EXECUTABLE} ${GRAMMAR_PROCESSING_SCRIPT} + --extinst-glsl-grammar=${GLSL_GRAMMAR_JSON_FILE} + --glsl-insts-output=${GRAMMAR_INC_FILE} + DEPENDS ${GRAMMAR_PROCESSING_SCRIPT} ${CORE_GRAMMAR_JSON_FILE} ${GLSL_GRAMMAR_JSON_FILE} + COMMENT "Generate info tables for GLSL extended instructions and operands v${VERSION}.") + list(APPEND EXTINST_CPP_DEPENDS ${GRAMMAR_INC_FILE}) +endmacro(spvtools_glsl_tables) + +macro(spvtools_opencl_tables VERSION) + set(CORE_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/spirv.core.grammar.json") + set(OPENCL_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/extinst.opencl.std.100.grammar.json") + set(GRAMMAR_INC_FILE "${spirv-tools_BINARY_DIR}/opencl.std.insts.inc") + add_custom_command(OUTPUT ${GRAMMAR_INC_FILE} + COMMAND ${PYTHON_EXECUTABLE} ${GRAMMAR_PROCESSING_SCRIPT} + --extinst-opencl-grammar=${OPENCL_GRAMMAR_JSON_FILE} + --opencl-insts-output=${GRAMMAR_INC_FILE} + DEPENDS ${GRAMMAR_PROCESSING_SCRIPT} ${CORE_GRAMMAR_JSON_FILE} ${OPENCL_GRAMMAR_JSON_FILE} + COMMENT "Generate info tables for OpenCL extended instructions and operands v${VERSION}.") + list(APPEND EXTINST_CPP_DEPENDS ${GRAMMAR_INC_FILE}) +endmacro(spvtools_opencl_tables) + +macro(spvtools_vendor_tables VENDOR_TABLE) + set(INSTS_FILE "${spirv-tools_BINARY_DIR}/${VENDOR_TABLE}.insts.inc") + set(GRAMMAR_FILE "${spirv-tools_SOURCE_DIR}/source/extinst.${VENDOR_TABLE}.grammar.json") + add_custom_command(OUTPUT ${INSTS_FILE} + COMMAND ${PYTHON_EXECUTABLE} ${GRAMMAR_PROCESSING_SCRIPT} + --extinst-vendor-grammar=${GRAMMAR_FILE} + --vendor-insts-output=${INSTS_FILE} + DEPENDS ${GRAMMAR_PROCESSING_SCRIPT} ${GRAMMAR_FILE} + COMMENT "Generate extended instruction tables for ${VENDOR_TABLE}.") + list(APPEND EXTINST_CPP_DEPENDS ${INSTS_FILE}) + add_custom_target(spirv-tools-${VENDOR_TABLE} DEPENDS ${INSTS_FILE}) + set_property(TARGET spirv-tools-${VENDOR_TABLE} PROPERTY FOLDER "SPIRV-Tools build") +endmacro(spvtools_vendor_tables) + +macro(spvtools_extinst_lang_headers NAME GRAMMAR_FILE) + set(OUTBASE ${spirv-tools_BINARY_DIR}/${NAME}) + set(OUT_H ${OUTBASE}.h) + add_custom_command(OUTPUT ${OUT_H} + COMMAND ${PYTHON_EXECUTABLE} ${LANG_HEADER_PROCESSING_SCRIPT} + --extinst-name=${NAME} + --extinst-grammar=${GRAMMAR_FILE} + --extinst-output-base=${OUTBASE} + DEPENDS ${LANG_HEADER_PROCESSING_SCRIPT} ${GRAMMAR_FILE} + COMMENT "Generate language specific header for ${NAME}.") + list(APPEND EXTINST_CPP_DEPENDS ${OUT_H}) + add_custom_target(spirv-tools-header-${NAME} DEPENDS ${OUT_H}) + set_property(TARGET spirv-tools-header-${NAME} PROPERTY FOLDER "SPIRV-Tools build") +endmacro(spvtools_extinst_lang_headers) + +spvtools_core_tables("unified1") +spvtools_enum_string_mapping("unified1") +spvtools_opencl_tables("unified1") +spvtools_glsl_tables("unified1") +spvtools_vendor_tables("spv-amd-shader-explicit-vertex-parameter") +spvtools_vendor_tables("spv-amd-shader-trinary-minmax") +spvtools_vendor_tables("spv-amd-gcn-shader") +spvtools_vendor_tables("spv-amd-shader-ballot") +spvtools_vendor_tables("debuginfo") +spvtools_extinst_lang_headers("DebugInfo" ${DEBUGINFO_GRAMMAR_JSON_FILE}) + +spvtools_vimsyntax("unified1" "1.0") +add_custom_target(spirv-tools-vimsyntax DEPENDS ${VIMSYNTAX_FILE}) +set_property(TARGET spirv-tools-vimsyntax PROPERTY FOLDER "SPIRV-Tools utilities") + +# Extract the list of known generators from the SPIR-V XML registry file. +set(GENERATOR_INC_FILE ${spirv-tools_BINARY_DIR}/generators.inc) +set(SPIRV_XML_REGISTRY_FILE ${SPIRV_HEADER_INCLUDE_DIR}/spirv/spir-v.xml) +add_custom_command(OUTPUT ${GENERATOR_INC_FILE} + COMMAND ${PYTHON_EXECUTABLE} ${XML_REGISTRY_PROCESSING_SCRIPT} + --xml=${SPIRV_XML_REGISTRY_FILE} + --generator-output=${GENERATOR_INC_FILE} + DEPENDS ${XML_REGISTRY_PROCESSING_SCRIPT} ${SPIRV_XML_REGISTRY_FILE} + COMMENT "Generate tables based on the SPIR-V XML registry.") +list(APPEND OPCODE_CPP_DEPENDS ${GENERATOR_INC_FILE}) + +# The following .cpp files include the above generated .inc files. +# Add those .inc files as their dependencies. +# +# Why using such an awkward way? +# * If we use add_custom_target() to define a target to generate all .inc files +# and let ${SPIRV_TOOLS} depend on it, then we need to run ninja twice every +# time the grammar is updated: the first time is for generating those .inc +# files, and the second time is for rebuilding .cpp files, when ninja finds +# out that .inc files are updated. +# * If we use add_custom_command() with PRE_BUILD, then the grammar processing +# script will always run no matter whether the grammar is updated. +# * add_dependencies() is used to add *target* dependencies to a target. +# * The following solution only generates .inc files when the script or the +# grammar files is updated, and in a single ninja run. +set_source_files_properties( + ${CMAKE_CURRENT_SOURCE_DIR}/opcode.cpp + PROPERTIES OBJECT_DEPENDS "${OPCODE_CPP_DEPENDS}") +set_source_files_properties( + ${CMAKE_CURRENT_SOURCE_DIR}/operand.cpp + PROPERTIES OBJECT_DEPENDS "${OPERAND_CPP_DEPENDS}") +set_source_files_properties( + ${CMAKE_CURRENT_SOURCE_DIR}/ext_inst.cpp + PROPERTIES OBJECT_DEPENDS "${EXTINST_CPP_DEPENDS}") +set_source_files_properties( + ${CMAKE_CURRENT_SOURCE_DIR}/enum_string_mapping.cpp + PROPERTIES OBJECT_DEPENDS "${ENUM_STRING_MAPPING_CPP_DEPENDS}") + +set_source_files_properties( + ${CMAKE_CURRENT_SOURCE_DIR}/extension.h + PROPERTIES HEADER_FILE_ONLY TRUE) +set_source_files_properties( + ${CMAKE_CURRENT_SOURCE_DIR}/extension.h + PROPERTIES OBJECT_DEPENDS "${EXTENSION_H_DEPENDS}") + +set(SPIRV_TOOLS_BUILD_VERSION_INC + ${spirv-tools_BINARY_DIR}/build-version.inc) +set(SPIRV_TOOLS_BUILD_VERSION_INC_GENERATOR + ${spirv-tools_SOURCE_DIR}/utils/update_build_version.py) +set(SPIRV_TOOLS_CHANGES_FILE + ${spirv-tools_SOURCE_DIR}/CHANGES) +add_custom_command(OUTPUT ${SPIRV_TOOLS_BUILD_VERSION_INC} + COMMAND ${PYTHON_EXECUTABLE} + ${SPIRV_TOOLS_BUILD_VERSION_INC_GENERATOR} + ${spirv-tools_SOURCE_DIR} ${SPIRV_TOOLS_BUILD_VERSION_INC} + DEPENDS ${SPIRV_TOOLS_BUILD_VERSION_INC_GENERATOR} + ${SPIRV_TOOLS_CHANGES_FILE} + COMMENT "Update build-version.inc in the SPIRV-Tools build directory (if necessary).") +# Convenience target for standalone generation of the build-version.inc file. +# This is not required for any dependence chain. +add_custom_target(spirv-tools-build-version + DEPENDS ${SPIRV_TOOLS_BUILD_VERSION_INC}) +set_property(TARGET spirv-tools-build-version PROPERTY FOLDER "SPIRV-Tools build") + +add_subdirectory(comp) +add_subdirectory(opt) +add_subdirectory(link) + +set(SPIRV_SOURCES + ${spirv-tools_SOURCE_DIR}/include/spirv-tools/libspirv.h + + ${CMAKE_CURRENT_SOURCE_DIR}/util/bitutils.h + ${CMAKE_CURRENT_SOURCE_DIR}/util/bit_stream.h + ${CMAKE_CURRENT_SOURCE_DIR}/util/hex_float.h + ${CMAKE_CURRENT_SOURCE_DIR}/util/parse_number.h + ${CMAKE_CURRENT_SOURCE_DIR}/util/string_utils.h + ${CMAKE_CURRENT_SOURCE_DIR}/util/timer.h + ${CMAKE_CURRENT_SOURCE_DIR}/assembly_grammar.h + ${CMAKE_CURRENT_SOURCE_DIR}/binary.h + ${CMAKE_CURRENT_SOURCE_DIR}/cfa.h + ${CMAKE_CURRENT_SOURCE_DIR}/diagnostic.h + ${CMAKE_CURRENT_SOURCE_DIR}/disassemble.h + ${CMAKE_CURRENT_SOURCE_DIR}/enum_set.h + ${CMAKE_CURRENT_SOURCE_DIR}/enum_string_mapping.h + ${CMAKE_CURRENT_SOURCE_DIR}/ext_inst.h + ${CMAKE_CURRENT_SOURCE_DIR}/extensions.h + ${CMAKE_CURRENT_SOURCE_DIR}/id_descriptor.h + ${CMAKE_CURRENT_SOURCE_DIR}/instruction.h + ${CMAKE_CURRENT_SOURCE_DIR}/latest_version_glsl_std_450_header.h + ${CMAKE_CURRENT_SOURCE_DIR}/latest_version_opencl_std_header.h + ${CMAKE_CURRENT_SOURCE_DIR}/latest_version_spirv_header.h + ${CMAKE_CURRENT_SOURCE_DIR}/macro.h + ${CMAKE_CURRENT_SOURCE_DIR}/name_mapper.h + ${CMAKE_CURRENT_SOURCE_DIR}/opcode.h + ${CMAKE_CURRENT_SOURCE_DIR}/operand.h + ${CMAKE_CURRENT_SOURCE_DIR}/parsed_operand.h + ${CMAKE_CURRENT_SOURCE_DIR}/print.h + ${CMAKE_CURRENT_SOURCE_DIR}/spirv_constant.h + ${CMAKE_CURRENT_SOURCE_DIR}/spirv_definition.h + ${CMAKE_CURRENT_SOURCE_DIR}/spirv_endian.h + ${CMAKE_CURRENT_SOURCE_DIR}/spirv_target_env.h + ${CMAKE_CURRENT_SOURCE_DIR}/spirv_validator_options.h + ${CMAKE_CURRENT_SOURCE_DIR}/table.h + ${CMAKE_CURRENT_SOURCE_DIR}/text.h + ${CMAKE_CURRENT_SOURCE_DIR}/text_handler.h + ${CMAKE_CURRENT_SOURCE_DIR}/validate.h + + ${CMAKE_CURRENT_SOURCE_DIR}/util/bit_stream.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/util/parse_number.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/util/string_utils.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/assembly_grammar.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/binary.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/diagnostic.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/disassemble.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/enum_string_mapping.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/ext_inst.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/extensions.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/id_descriptor.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/libspirv.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/message.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/name_mapper.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/opcode.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/operand.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/parsed_operand.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/print.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/software_version.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/spirv_endian.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/spirv_stats.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/spirv_target_env.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/spirv_validator_options.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/table.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/text.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/text_handler.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_adjacency.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_arithmetics.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_atomics.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_barriers.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_bitwise.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_builtins.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_capability.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_cfg.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_composites.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_conversion.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_datarules.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_decorations.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_derivatives.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_ext_inst.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_id.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_image.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_instruction.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_layout.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_literals.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_logicals.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_primitives.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/validate_type_unique.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/val/decoration.h + ${CMAKE_CURRENT_SOURCE_DIR}/val/basic_block.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/val/construct.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/val/function.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/val/instruction.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/val/validation_state.cpp) + +if (${SPIRV_TIMER_ENABLED}) + set(SPIRV_SOURCES + ${SPIRV_SOURCES} + ${CMAKE_CURRENT_SOURCE_DIR}/util/timer.cpp) +endif() + +# The software_version.cpp file includes build-version.inc. +# Rebuild the software_version.cpp object file if it is older than +# build-version.inc or whenever build-version.inc itself is out of +# date. In the latter case, rebuild build-version.inc first. +# CMake is not smart enough to detect this dependency automatically. +# Without this, the dependency detection system for #included files +# does not kick in on a clean build for the following reason: The +# build will fail early because it doesn't know how to build the +# missing source file build-version.inc. That occurs before the +# preprocessor is run on software_version.cpp to detect the +# #include dependency. +set_source_files_properties( + ${CMAKE_CURRENT_SOURCE_DIR}/software_version.cpp + PROPERTIES OBJECT_DEPENDS "${SPIRV_TOOLS_BUILD_VERSION_INC}") + +add_library(${SPIRV_TOOLS} ${SPIRV_SOURCES}) +spvtools_default_compile_options(${SPIRV_TOOLS}) +target_include_directories(${SPIRV_TOOLS} + PUBLIC ${spirv-tools_SOURCE_DIR}/include + PRIVATE ${spirv-tools_BINARY_DIR} + PRIVATE ${SPIRV_HEADER_INCLUDE_DIR} + ) +set_property(TARGET ${SPIRV_TOOLS} PROPERTY FOLDER "SPIRV-Tools libraries") +spvtools_check_symbol_exports(${SPIRV_TOOLS}) + +add_library(${SPIRV_TOOLS}-shared SHARED ${SPIRV_SOURCES}) +spvtools_default_compile_options(${SPIRV_TOOLS}-shared) +target_include_directories(${SPIRV_TOOLS}-shared + PUBLIC ${spirv-tools_SOURCE_DIR}/include + PRIVATE ${spirv-tools_BINARY_DIR} + PRIVATE ${SPIRV_HEADER_INCLUDE_DIR} + ) +set_target_properties(${SPIRV_TOOLS}-shared PROPERTIES CXX_VISIBILITY_PRESET hidden) +set_property(TARGET ${SPIRV_TOOLS}-shared PROPERTY FOLDER "SPIRV-Tools libraries") +spvtools_check_symbol_exports(${SPIRV_TOOLS}-shared) +target_compile_definitions(${SPIRV_TOOLS}-shared + PRIVATE SPIRV_TOOLS_IMPLEMENTATION + PUBLIC SPIRV_TOOLS_SHAREDLIB +) + +if(ENABLE_SPIRV_TOOLS_INSTALL) + install(TARGETS ${SPIRV_TOOLS} ${SPIRV_TOOLS}-shared + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif(ENABLE_SPIRV_TOOLS_INSTALL) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/comp/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/comp/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/comp/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/comp/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,38 @@ +# Copyright (c) 2017 Google 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. + +if(SPIRV_BUILD_COMPRESSION) + add_library(SPIRV-Tools-comp markv_codec.cpp) + + spvtools_default_compile_options(SPIRV-Tools-comp) + target_include_directories(SPIRV-Tools-comp + PUBLIC ${spirv-tools_SOURCE_DIR}/include + PUBLIC ${SPIRV_HEADER_INCLUDE_DIR} + PRIVATE ${spirv-tools_BINARY_DIR} + ) + + target_link_libraries(SPIRV-Tools-comp + PUBLIC ${SPIRV_TOOLS}) + + set_property(TARGET SPIRV-Tools-comp PROPERTY FOLDER "SPIRV-Tools libraries") + spvtools_check_symbol_exports(SPIRV-Tools-comp) + + if(ENABLE_SPIRV_TOOLS_INSTALL) + install(TARGETS SPIRV-Tools-comp + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif(ENABLE_SPIRV_TOOLS_INSTALL) + +endif(SPIRV_BUILD_COMPRESSION) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/comp/markv_codec.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/comp/markv_codec.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/comp/markv_codec.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/comp/markv_codec.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,2920 @@ +// Copyright (c) 2017 Google 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. + +// Contains +// - SPIR-V to MARK-V encoder +// - MARK-V to SPIR-V decoder +// +// MARK-V is a compression format for SPIR-V binaries. It strips away +// non-essential information (such as result ids which can be regenerated) and +// uses various bit reduction techiniques to reduce the size of the binary. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "latest_version_glsl_std_450_header.h" +#include "latest_version_opencl_std_header.h" +#include "latest_version_spirv_header.h" + +#include "binary.h" +#include "diagnostic.h" +#include "enum_string_mapping.h" +#include "ext_inst.h" +#include "extensions.h" +#include "id_descriptor.h" +#include "instruction.h" +#include "markv.h" +#include "markv_model.h" +#include "opcode.h" +#include "operand.h" +#include "spirv-tools/libspirv.h" +#include "spirv_endian.h" +#include "spirv_validator_options.h" +#include "util/bit_stream.h" +#include "util/huffman_codec.h" +#include "util/move_to_front.h" +#include "util/parse_number.h" +#include "val/instruction.h" +#include "val/validation_state.h" +#include "validate.h" + +using libspirv::DiagnosticStream; +using libspirv::IdDescriptorCollection; +using libspirv::Instruction; +using libspirv::ValidationState_t; +using spvutils::BitReaderWord64; +using spvutils::BitWriterWord64; +using spvutils::HuffmanCodec; +using MoveToFront = spvutils::MoveToFront; +using MultiMoveToFront = spvutils::MultiMoveToFront; + +namespace spvtools { + +namespace { + +const uint32_t kSpirvMagicNumber = SpvMagicNumber; +const uint32_t kMarkvMagicNumber = 0x07230303; + +// Handles for move-to-front sequences. Enums which end with "Begin" define +// handle spaces which start at that value and span 16 or 32 bit wide. +enum : uint64_t { + kMtfNone = 0, + // All ids. + kMtfAll, + // All forward declared ids. + kMtfForwardDeclared, + // All type ids except for generated by OpTypeFunction. + kMtfTypeNonFunction, + // All labels. + kMtfLabel, + // All ids created by instructions which had type_id. + kMtfObject, + // All types generated by OpTypeFloat, OpTypeInt, OpTypeBool. + kMtfTypeScalar, + // All composite types. + kMtfTypeComposite, + // Boolean type or any vector type of it. + kMtfTypeBoolScalarOrVector, + // All float types or any vector floats type. + kMtfTypeFloatScalarOrVector, + // All int types or any vector int type. + kMtfTypeIntScalarOrVector, + // All types declared as return types in OpTypeFunction. + kMtfTypeReturnedByFunction, + // All composite objects. + kMtfComposite, + // All bool objects or vectors of bools. + kMtfBoolScalarOrVector, + // All float objects or vectors of float. + kMtfFloatScalarOrVector, + // All int objects or vectors of int. + kMtfIntScalarOrVector, + // All pointer types which point to composited. + kMtfTypePointerToComposite, + // Used by EncodeMtfRankHuffman. + kMtfGenericNonZeroRank, + // Handle space for ids of specific type. + kMtfIdOfTypeBegin = 0x10000, + // Handle space for ids generated by specific opcode. + kMtfIdGeneratedByOpcode = 0x20000, + // Handle space for ids of objects with type generated by specific opcode. + kMtfIdWithTypeGeneratedByOpcodeBegin = 0x30000, + // All vectors of specific component type. + kMtfVectorOfComponentTypeBegin = 0x40000, + // All vector types of specific size. + kMtfTypeVectorOfSizeBegin = 0x50000, + // All pointer types to specific type. + kMtfPointerToTypeBegin = 0x60000, + // All function types which return specific type. + kMtfFunctionTypeWithReturnTypeBegin = 0x70000, + // All function objects which return specific type. + kMtfFunctionWithReturnTypeBegin = 0x80000, + // Short id descriptor space (max 16-bit). + kMtfShortIdDescriptorSpaceBegin = 0x90000, + // Long id descriptor space (32-bit). + kMtfLongIdDescriptorSpaceBegin = 0x100000000, +}; + +// Signals that the value is not in the coding scheme and a fallback method +// needs to be used. +const uint64_t kMarkvNoneOfTheAbove = MarkvModel::GetMarkvNoneOfTheAbove(); + +// Mtf ranks smaller than this are encoded with Huffman coding. +const uint32_t kMtfSmallestRankEncodedByValue = 10; + +// Signals that the mtf rank is too large to be encoded with Huffman. +const uint32_t kMtfRankEncodedByValueSignal = + std::numeric_limits::max(); + +const size_t kCommentNumWhitespaces = 2; + +const size_t kByteBreakAfterInstIfLessThanUntilNextByte = 8; + +const uint32_t kShortDescriptorNumBits = 8; + +// Custom hash function used to produce short descriptors. +uint32_t ShortHashU32Array(const std::vector& words) { + // The hash function is a sum of hashes of each word seeded by word index. + // Knuth's multiplicative hash is used to hash the words. + const uint32_t kKnuthMulHash = 2654435761; + uint32_t val = 0; + for (uint32_t i = 0; i < words.size(); ++i) { + val += (words[i] + i + 123) * kKnuthMulHash; + } + return 1 + val % ((1 << kShortDescriptorNumBits) - 1); +} + +// Returns a set of mtf rank codecs based on a plausible hand-coded +// distribution. +std::map>> +GetMtfHuffmanCodecs() { + std::map>> codecs; + + std::unique_ptr> codec; + + codec.reset(new HuffmanCodec(std::map({ + {0, 5}, + {1, 40}, + {2, 10}, + {3, 5}, + {4, 5}, + {5, 5}, + {6, 3}, + {7, 3}, + {8, 3}, + {9, 3}, + {kMtfRankEncodedByValueSignal, 10}, + }))); + codecs.emplace(kMtfAll, std::move(codec)); + + codec.reset(new HuffmanCodec(std::map({ + {1, 50}, + {2, 20}, + {3, 5}, + {4, 5}, + {5, 2}, + {6, 1}, + {7, 1}, + {8, 1}, + {9, 1}, + {kMtfRankEncodedByValueSignal, 10}, + }))); + codecs.emplace(kMtfGenericNonZeroRank, std::move(codec)); + + return codecs; +} + +// Returns true if the opcode has a fixed number of operands. May return a +// false negative. +bool OpcodeHasFixedNumberOfOperands(SpvOp opcode) { + switch (opcode) { + // TODO(atgoo@github.com) This is not a complete list. + case SpvOpNop: + case SpvOpName: + case SpvOpUndef: + case SpvOpSizeOf: + case SpvOpLine: + case SpvOpNoLine: + case SpvOpDecorationGroup: + case SpvOpExtension: + case SpvOpExtInstImport: + case SpvOpMemoryModel: + case SpvOpCapability: + case SpvOpTypeVoid: + case SpvOpTypeBool: + case SpvOpTypeInt: + case SpvOpTypeFloat: + case SpvOpTypeVector: + case SpvOpTypeMatrix: + case SpvOpTypeSampler: + case SpvOpTypeSampledImage: + case SpvOpTypeArray: + case SpvOpTypePointer: + case SpvOpConstantTrue: + case SpvOpConstantFalse: + case SpvOpLabel: + case SpvOpBranch: + case SpvOpFunction: + case SpvOpFunctionParameter: + case SpvOpFunctionEnd: + case SpvOpBitcast: + case SpvOpCopyObject: + case SpvOpTranspose: + case SpvOpSNegate: + case SpvOpFNegate: + case SpvOpIAdd: + case SpvOpFAdd: + case SpvOpISub: + case SpvOpFSub: + case SpvOpIMul: + case SpvOpFMul: + case SpvOpUDiv: + case SpvOpSDiv: + case SpvOpFDiv: + case SpvOpUMod: + case SpvOpSRem: + case SpvOpSMod: + case SpvOpFRem: + case SpvOpFMod: + case SpvOpVectorTimesScalar: + case SpvOpMatrixTimesScalar: + case SpvOpVectorTimesMatrix: + case SpvOpMatrixTimesVector: + case SpvOpMatrixTimesMatrix: + case SpvOpOuterProduct: + case SpvOpDot: + return true; + default: + break; + } + return false; +} + +size_t GetNumBitsToNextByte(size_t bit_pos) { return (8 - (bit_pos % 8)) % 8; } + +// Defines and returns current MARK-V version. +uint32_t GetMarkvVersion() { + const uint32_t kVersionMajor = 1; + const uint32_t kVersionMinor = 4; + return kVersionMinor | (kVersionMajor << 16); +} + +class MarkvLogger { + public: + MarkvLogger(MarkvLogConsumer log_consumer, MarkvDebugConsumer debug_consumer) + : log_consumer_(log_consumer), debug_consumer_(debug_consumer) {} + + void AppendText(const std::string& str) { + Append(str); + use_delimiter_ = false; + } + + void AppendTextNewLine(const std::string& str) { + Append(str); + Append("\n"); + use_delimiter_ = false; + } + + void AppendBitSequence(const std::string& str) { + if (debug_consumer_) instruction_bits_ << str; + if (use_delimiter_) Append("-"); + Append(str); + use_delimiter_ = true; + } + + void AppendWhitespaces(size_t num) { + Append(std::string(num, ' ')); + use_delimiter_ = false; + } + + void NewLine() { + Append("\n"); + use_delimiter_ = false; + } + + bool DebugInstruction(const spv_parsed_instruction_t& inst) { + bool result = true; + if (debug_consumer_) { + result = debug_consumer_( + std::vector(inst.words, inst.words + inst.num_words), + instruction_bits_.str(), instruction_comment_.str()); + instruction_bits_.str(std::string()); + instruction_comment_.str(std::string()); + } + return result; + } + + private: + MarkvLogger(const MarkvLogger&) = delete; + MarkvLogger(MarkvLogger&&) = delete; + MarkvLogger& operator=(const MarkvLogger&) = delete; + MarkvLogger& operator=(MarkvLogger&&) = delete; + + void Append(const std::string& str) { + if (log_consumer_) log_consumer_(str); + if (debug_consumer_) instruction_comment_ << str; + } + + MarkvLogConsumer log_consumer_; + MarkvDebugConsumer debug_consumer_; + + std::stringstream instruction_bits_; + std::stringstream instruction_comment_; + + // If true a delimiter will be appended before the next bit sequence. + // Used to generate outputs like: 1100-0 1110-1-1100-1-1111-0 110-0. + bool use_delimiter_ = false; +}; + +// Base class for MARK-V encoder and decoder. Contains common functionality +// such as: +// - Validator connection and validation state. +// - SPIR-V grammar and helper functions. +class MarkvCodecBase { + public: + virtual ~MarkvCodecBase() { spvValidatorOptionsDestroy(validator_options_); } + + MarkvCodecBase() = delete; + + protected: + struct MarkvHeader { + MarkvHeader() { + magic_number = kMarkvMagicNumber; + markv_version = GetMarkvVersion(); + markv_model = 0; + markv_length_in_bits = 0; + spirv_version = 0; + spirv_generator = 0; + } + + uint32_t magic_number; + uint32_t markv_version; + // Magic number to identify or verify MarkvModel used for encoding. + uint32_t markv_model; + uint32_t markv_length_in_bits; + uint32_t spirv_version; + uint32_t spirv_generator; + }; + + // |model| is owned by the caller, must be not null and valid during the + // lifetime of the codec. + explicit MarkvCodecBase(spv_const_context context, + spv_validator_options validator_options, + const MarkvModel* model) + : validator_options_(validator_options), + grammar_(context), + model_(model), + short_id_descriptors_(ShortHashU32Array), + mtf_huffman_codecs_(GetMtfHuffmanCodecs()), + context_(context), + vstate_(validator_options + ? new ValidationState_t(context, validator_options_) + : nullptr) {} + + // Validates a single instruction and updates validation state of the module. + // Does nothing and returns SPV_SUCCESS if validator was not created. + spv_result_t UpdateValidationState(const spv_parsed_instruction_t& inst) { + if (!vstate_) return SPV_SUCCESS; + + return ValidateInstructionAndUpdateValidationState(vstate_.get(), &inst); + } + + // Returns instruction which created |id| or nullptr if such instruction was + // not registered. + const Instruction* FindDef(uint32_t id) const { + const auto it = id_to_def_instruction_.find(id); + if (it == id_to_def_instruction_.end()) return nullptr; + return it->second; + } + + // Returns type id of vector type component. + uint32_t GetVectorComponentType(uint32_t vector_type_id) const { + const Instruction* type_inst = FindDef(vector_type_id); + assert(type_inst); + assert(type_inst->opcode() == SpvOpTypeVector); + + const uint32_t component_type = + type_inst->word(type_inst->operands()[1].offset); + return component_type; + } + + // Returns mtf handle for ids of given type. + uint64_t GetMtfIdOfType(uint32_t type_id) const { + return kMtfIdOfTypeBegin + type_id; + } + + // Returns mtf handle for ids generated by given opcode. + uint64_t GetMtfIdGeneratedByOpcode(SpvOp opcode) const { + return kMtfIdGeneratedByOpcode + opcode; + } + + // Returns mtf handle for ids of type generated by given opcode. + uint64_t GetMtfIdWithTypeGeneratedByOpcode(SpvOp opcode) const { + return kMtfIdWithTypeGeneratedByOpcodeBegin + opcode; + } + + // Returns mtf handle for vectors of specific component type. + uint64_t GetMtfVectorOfComponentType(uint32_t type_id) const { + return kMtfVectorOfComponentTypeBegin + type_id; + } + + // Returns mtf handle for vector type of specific size. + uint64_t GetMtfTypeVectorOfSize(uint32_t size) const { + return kMtfTypeVectorOfSizeBegin + size; + } + + // Returns mtf handle for pointers to specific size. + uint64_t GetMtfPointerToType(uint32_t type_id) const { + return kMtfPointerToTypeBegin + type_id; + } + + // Returns mtf handle for function types with given return type. + uint64_t GetMtfFunctionTypeWithReturnType(uint32_t type_id) const { + return kMtfFunctionTypeWithReturnTypeBegin + type_id; + } + + // Returns mtf handle for functions with given return type. + uint64_t GetMtfFunctionWithReturnType(uint32_t type_id) const { + return kMtfFunctionWithReturnTypeBegin + type_id; + } + + // Returns mtf handle for the given long id descriptor. + uint64_t GetMtfLongIdDescriptor(uint32_t descriptor) const { + return kMtfLongIdDescriptorSpaceBegin + descriptor; + } + + // Returns mtf handle for the given short id descriptor. + uint64_t GetMtfShortIdDescriptor(uint32_t descriptor) const { + return kMtfShortIdDescriptorSpaceBegin + descriptor; + } + + // Process data from the current instruction. This would update MTFs and + // other data containers. + void ProcessCurInstruction(); + + // Returns move-to-front handle to be used for the current operand slot. + // Mtf handle is chosen based on a set of rules defined by SPIR-V grammar. + uint64_t GetRuleBasedMtf(); + + // Returns words of the current instruction. Decoder has a different + // implementation and the array is valid only until the previously decoded + // word. + virtual const uint32_t* GetInstWords() const { return inst_.words; } + + // Returns the opcode of the previous instruction. + SpvOp GetPrevOpcode() const { + if (instructions_.empty()) return SpvOpNop; + + return instructions_.back()->opcode(); + } + + // Returns diagnostic stream, position index is set to instruction number. + DiagnosticStream Diag(spv_result_t error_code) const { + return DiagnosticStream({0, 0, instructions_.size()}, context_->consumer, + error_code); + } + + // Returns current id bound. + uint32_t GetIdBound() const { return id_bound_; } + + // Sets current id bound, expected to be no lower than the previous one. + void SetIdBound(uint32_t id_bound) { + assert(id_bound >= id_bound_); + id_bound_ = id_bound; + if (vstate_) vstate_->setIdBound(id_bound); + } + + // Returns Huffman codec for ranks of the mtf with given |handle|. + // Different mtfs can use different rank distributions. + // May return nullptr if the codec doesn't exist. + const spvutils::HuffmanCodec* GetMtfHuffmanCodec( + uint64_t handle) const { + const auto it = mtf_huffman_codecs_.find(handle); + if (it == mtf_huffman_codecs_.end()) return nullptr; + return it->second.get(); + } + + // Promotes id in all move-to-front sequences if ids can be shared by multiple + // sequences. + void PromoteIfNeeded(uint32_t id) { + if (!model_->AnyDescriptorHasCodingScheme() && + model_->id_fallback_strategy() == + MarkvModel::IdFallbackStrategy::kShortDescriptor) { + // Move-to-front sequences do not share ids. Nothing to do. + return; + } + multi_mtf_.Promote(id); + } + + spv_validator_options validator_options_ = nullptr; + const libspirv::AssemblyGrammar grammar_; + MarkvHeader header_; + + // MARK-V model, not owned. + const MarkvModel* model_ = nullptr; + + // Current instruction, current operand and current operand index. + spv_parsed_instruction_t inst_; + spv_parsed_operand_t operand_; + uint32_t operand_index_; + + // Maps a result ID to its type ID. By convention: + // - a result ID that is a type definition maps to itself. + // - a result ID without a type maps to 0. (E.g. for OpLabel) + std::unordered_map id_to_type_id_; + + // Container for all move-to-front sequences. + MultiMoveToFront multi_mtf_; + + // Id of the current function or zero if outside of function. + uint32_t cur_function_id_ = 0; + + // Return type of the current function. + uint32_t cur_function_return_type_ = 0; + + // Remaining function parameter types. This container is filled on OpFunction, + // and drained on OpFunctionParameter. + std::list remaining_function_parameter_types_; + + // List of ids local to the current function. + std::vector ids_local_to_cur_function_; + + // List of instructions in the order they are given in the module. + std::vector> instructions_; + + // Container/computer for long (32-bit) id descriptors. + IdDescriptorCollection long_id_descriptors_; + + // Container/computer for short id descriptors. + // Short descriptors are stored in uint32_t, but their actual bit width is + // defined with kShortDescriptorNumBits. + // It doesn't seem logical to have a different computer for short id + // descriptors, since one could actually map/truncate long descriptors. + // But as short descriptors have collisions, the efficiency of + // compression depends on the collision pattern, and short descriptors + // produced by function ShortHashU32Array have been empirically proven to + // produce better results. + IdDescriptorCollection short_id_descriptors_; + + // Huffman codecs for move-to-front ranks. The map key is mtf handle. Doesn't + // need to contain a different codec for every handle as most use one and the + // same. + std::map>> + mtf_huffman_codecs_; + + // If not nullptr, codec will log comments on the compression process. + std::unique_ptr logger_; + + private: + spv_const_context context_ = nullptr; + + std::unique_ptr vstate_; + + // Maps result id to the instruction which defined it. + std::unordered_map id_to_def_instruction_; + + uint32_t id_bound_ = 1; +}; + +// SPIR-V to MARK-V encoder. Exposes functions EncodeHeader and +// EncodeInstruction which can be used as callback by spvBinaryParse. +// Encoded binary is written to an internally maintained bitstream. +// After the last instruction is encoded, the resulting MARK-V binary can be +// acquired by calling GetMarkvBinary(). +// The encoder uses SPIR-V validator to keep internal state, therefore +// SPIR-V binary needs to be able to pass validator checks. +// CreateCommentsLogger() can be used to enable the encoder to write comments +// on how encoding was done, which can later be accessed with GetComments(). +class MarkvEncoder : public MarkvCodecBase { + public: + // |model| is owned by the caller, must be not null and valid during the + // lifetime of MarkvEncoder. + MarkvEncoder(spv_const_context context, const MarkvCodecOptions& options, + const MarkvModel* model) + : MarkvCodecBase(context, GetValidatorOptions(options), model), + options_(options) { + (void)options_; + } + + // Writes data from SPIR-V header to MARK-V header. + spv_result_t EncodeHeader(spv_endianness_t /* endian */, uint32_t /* magic */, + uint32_t version, uint32_t generator, + uint32_t id_bound, uint32_t /* schema */) { + SetIdBound(id_bound); + header_.spirv_version = version; + header_.spirv_generator = generator; + return SPV_SUCCESS; + } + + // Creates an internal logger which writes comments on the encoding process. + void CreateLogger(MarkvLogConsumer log_consumer, + MarkvDebugConsumer debug_consumer) { + logger_.reset(new MarkvLogger(log_consumer, debug_consumer)); + writer_.SetCallback( + [this](const std::string& str) { logger_->AppendBitSequence(str); }); + } + + // Encodes SPIR-V instruction to MARK-V and writes to bit stream. + // Operation can fail if the instruction fails to pass the validator or if + // the encoder stubmles on something unexpected. + spv_result_t EncodeInstruction(const spv_parsed_instruction_t& inst); + + // Concatenates MARK-V header and the bit stream with encoded instructions + // into a single buffer and returns it as spv_markv_binary. The returned + // value is owned by the caller and needs to be destroyed with + // spvMarkvBinaryDestroy(). + std::vector GetMarkvBinary() { + header_.markv_length_in_bits = + static_cast(sizeof(header_) * 8 + writer_.GetNumBits()); + header_.markv_model = + (model_->model_type() << 16) | model_->model_version(); + + const size_t num_bytes = sizeof(header_) + writer_.GetDataSizeBytes(); + std::vector markv(num_bytes); + + assert(writer_.GetData()); + std::memcpy(markv.data(), &header_, sizeof(header_)); + std::memcpy(markv.data() + sizeof(header_), writer_.GetData(), + writer_.GetDataSizeBytes()); + return markv; + } + + // Optionally adds disassembly to the comments. + // Disassembly should contain all instructions in the module separated by + // \n, and no header. + void SetDisassembly(std::string&& disassembly) { + disassembly_.reset(new std::stringstream(std::move(disassembly))); + } + + // Extracts the next instruction line from the disassembly and logs it. + void LogDisassemblyInstruction() { + if (logger_ && disassembly_) { + std::string line; + std::getline(*disassembly_, line, '\n'); + logger_->AppendTextNewLine(line); + } + } + + private: + // Creates and returns validator options. Returned value owned by the caller. + static spv_validator_options GetValidatorOptions( + const MarkvCodecOptions& options) { + return options.validate_spirv_binary ? spvValidatorOptionsCreate() + : nullptr; + } + + // Writes a single word to bit stream. operand_.type determines if the word is + // encoded and how. + spv_result_t EncodeNonIdWord(uint32_t word); + + // Writes both opcode and num_operands as a single code. + // Returns SPV_UNSUPPORTED iff no suitable codec was found. + spv_result_t EncodeOpcodeAndNumOperands(uint32_t opcode, + uint32_t num_operands); + + // Writes mtf rank to bit stream. |mtf| is used to determine the codec + // scheme. |fallback_method| is used if no codec defined for |mtf|. + spv_result_t EncodeMtfRankHuffman(uint32_t rank, uint64_t mtf, + uint64_t fallback_method); + + // Writes id using coding based on mtf associated with the id descriptor. + // Returns SPV_UNSUPPORTED iff fallback method needs to be used. + spv_result_t EncodeIdWithDescriptor(uint32_t id); + + // Writes id using coding based on the given |mtf|, which is expected to + // contain the given |id|. + spv_result_t EncodeExistingId(uint64_t mtf, uint32_t id); + + // Writes type id of the current instruction if can't be inferred. + spv_result_t EncodeTypeId(); + + // Writes result id of the current instruction if can't be inferred. + spv_result_t EncodeResultId(); + + // Writes ids which are neither type nor result ids. + spv_result_t EncodeRefId(uint32_t id); + + // Writes bits to the stream until the beginning of the next byte if the + // number of bits until the next byte is less than |byte_break_if_less_than|. + void AddByteBreak(size_t byte_break_if_less_than); + + // Encodes a literal number operand and writes it to the bit stream. + spv_result_t EncodeLiteralNumber(const spv_parsed_operand_t& operand); + + MarkvCodecOptions options_; + + // Bit stream where encoded instructions are written. + BitWriterWord64 writer_; + + // If not nullptr, disassembled instruction lines will be written to comments. + // Format: \n separated instruction lines, no header. + std::unique_ptr disassembly_; +}; + +// Decodes MARK-V buffers written by MarkvEncoder. +class MarkvDecoder : public MarkvCodecBase { + public: + // |model| is owned by the caller, must be not null and valid during the + // lifetime of MarkvEncoder. + MarkvDecoder(spv_const_context context, const std::vector& markv, + const MarkvCodecOptions& options, const MarkvModel* model) + : MarkvCodecBase(context, GetValidatorOptions(options), model), + options_(options), + reader_(markv) { + (void)options_; + SetIdBound(1); + parsed_operands_.reserve(25); + inst_words_.reserve(25); + } + + // Creates an internal logger which writes comments on the decoding process. + void CreateLogger(MarkvLogConsumer log_consumer, + MarkvDebugConsumer debug_consumer) { + logger_.reset(new MarkvLogger(log_consumer, debug_consumer)); + } + + // Decodes SPIR-V from MARK-V and stores the words in |spirv_binary|. + // Can be called only once. Fails if data of wrong format or ends prematurely, + // of if validation fails. + spv_result_t DecodeModule(std::vector* spirv_binary); + + private: + // Describes the format of a typed literal number. + struct NumberType { + spv_number_kind_t type; + uint32_t bit_width; + }; + + // Creates and returns validator options. Returned value owned by the caller. + static spv_validator_options GetValidatorOptions( + const MarkvCodecOptions& options) { + return options.validate_spirv_binary ? spvValidatorOptionsCreate() + : nullptr; + } + + // Reads a single bit from reader_. The read bit is stored in |bit|. + // Returns false iff reader_ fails. + bool ReadBit(bool* bit) { + uint64_t bits = 0; + const bool result = reader_.ReadBits(&bits, 1); + if (result) *bit = bits ? true : false; + return result; + }; + + // Returns ReadBit bound to the class object. + std::function GetReadBitCallback() { + return std::bind(&MarkvDecoder::ReadBit, this, std::placeholders::_1); + } + + // Reads a single non-id word from bit stream. operand_.type determines if + // the word needs to be decoded and how. + spv_result_t DecodeNonIdWord(uint32_t* word); + + // Reads and decodes both opcode and num_operands as a single code. + // Returns SPV_UNSUPPORTED iff no suitable codec was found. + spv_result_t DecodeOpcodeAndNumberOfOperands(uint32_t* opcode, + uint32_t* num_operands); + + // Reads mtf rank from bit stream. |mtf| is used to determine the codec + // scheme. |fallback_method| is used if no codec defined for |mtf|. + spv_result_t DecodeMtfRankHuffman(uint64_t mtf, uint32_t fallback_method, + uint32_t* rank); + + // Reads id using coding based on mtf associated with the id descriptor. + // Returns SPV_UNSUPPORTED iff fallback method needs to be used. + spv_result_t DecodeIdWithDescriptor(uint32_t* id); + + // Reads id using coding based on the given |mtf|, which is expected to + // contain the needed |id|. + spv_result_t DecodeExistingId(uint64_t mtf, uint32_t* id); + + // Reads type id of the current instruction if can't be inferred. + spv_result_t DecodeTypeId(); + + // Reads result id of the current instruction if can't be inferred. + spv_result_t DecodeResultId(); + + // Reads id which is neither type nor result id. + spv_result_t DecodeRefId(uint32_t* id); + + // Reads and discards bits until the beginning of the next byte if the + // number of bits until the next byte is less than |byte_break_if_less_than|. + bool ReadToByteBreak(size_t byte_break_if_less_than); + + // Returns instruction words decoded up to this point. + const uint32_t* GetInstWords() const override { return inst_words_.data(); } + + // Reads a literal number as it is described in |operand| from the bit stream, + // decodes and writes it to spirv_. + spv_result_t DecodeLiteralNumber(const spv_parsed_operand_t& operand); + + // Reads instruction from bit stream, decodes and validates it. + // Decoded instruction is valid until the next call of DecodeInstruction(). + spv_result_t DecodeInstruction(); + + // Read operand from the stream decodes and validates it. + spv_result_t DecodeOperand(size_t operand_offset, + const spv_operand_type_t type, + spv_operand_pattern_t* expected_operands); + + // Records the numeric type for an operand according to the type information + // associated with the given non-zero type Id. This can fail if the type Id + // is not a type Id, or if the type Id does not reference a scalar numeric + // type. On success, return SPV_SUCCESS and populates the num_words, + // number_kind, and number_bit_width fields of parsed_operand. + spv_result_t SetNumericTypeInfoForType(spv_parsed_operand_t* parsed_operand, + uint32_t type_id); + + // Records the number type for the current instruction, if it generates a + // type. For types that aren't scalar numbers, record something with number + // kind SPV_NUMBER_NONE. + void RecordNumberType(); + + MarkvCodecOptions options_; + + // Temporary sink where decoded SPIR-V words are written. Once it contains the + // entire module, the container is moved and returned. + std::vector spirv_; + + // Bit stream containing encoded data. + BitReaderWord64 reader_; + + // Temporary storage for operands of the currently parsed instruction. + // Valid until next DecodeInstruction call. + std::vector parsed_operands_; + + // Temporary storage for current instruction words. + // Valid until next DecodeInstruction call. + std::vector inst_words_; + + // Maps a type ID to its number type description. + std::unordered_map type_id_to_number_type_info_; + + // Maps an ExtInstImport id to the extended instruction type. + std::unordered_map import_id_to_ext_inst_type_; +}; + +void MarkvCodecBase::ProcessCurInstruction() { + instructions_.emplace_back(new Instruction(&inst_)); + + const SpvOp opcode = SpvOp(inst_.opcode); + + if (inst_.result_id) { + id_to_def_instruction_.emplace(inst_.result_id, instructions_.back().get()); + + // Collect ids local to the current function. + if (cur_function_id_) { + ids_local_to_cur_function_.push_back(inst_.result_id); + } + + // Starting new function. + if (opcode == SpvOpFunction) { + cur_function_id_ = inst_.result_id; + cur_function_return_type_ = inst_.type_id; + if (model_->id_fallback_strategy() == + MarkvModel::IdFallbackStrategy::kRuleBased) { + multi_mtf_.Insert(GetMtfFunctionWithReturnType(inst_.type_id), + inst_.result_id); + } + + // Store function parameter types in a queue, so that we know which types + // to expect in the following OpFunctionParameter instructions. + const Instruction* def_inst = FindDef(inst_.words[4]); + assert(def_inst); + assert(def_inst->opcode() == SpvOpTypeFunction); + for (uint32_t i = 3; i < def_inst->words().size(); ++i) { + remaining_function_parameter_types_.push_back(def_inst->word(i)); + } + } + } + + // Remove local ids from MTFs if function end. + if (opcode == SpvOpFunctionEnd) { + cur_function_id_ = 0; + for (uint32_t id : ids_local_to_cur_function_) multi_mtf_.RemoveFromAll(id); + ids_local_to_cur_function_.clear(); + assert(remaining_function_parameter_types_.empty()); + } + + if (!inst_.result_id) return; + + { + // Save the result ID to type ID mapping. + // In the grammar, type ID always appears before result ID. + // A regular value maps to its type. Some instructions (e.g. OpLabel) + // have no type Id, and will map to 0. The result Id for a + // type-generating instruction (e.g. OpTypeInt) maps to itself. + auto insertion_result = id_to_type_id_.emplace( + inst_.result_id, spvOpcodeGeneratesType(SpvOp(inst_.opcode)) + ? inst_.result_id + : inst_.type_id); + (void)insertion_result; + assert(insertion_result.second); + } + + // Add result_id to MTFs. + if (model_->id_fallback_strategy() == + MarkvModel::IdFallbackStrategy::kRuleBased) { + switch (opcode) { + case SpvOpTypeFloat: + case SpvOpTypeInt: + case SpvOpTypeBool: + case SpvOpTypeVector: + case SpvOpTypePointer: + case SpvOpExtInstImport: + case SpvOpTypeSampledImage: + case SpvOpTypeImage: + case SpvOpTypeSampler: + multi_mtf_.Insert(GetMtfIdGeneratedByOpcode(opcode), inst_.result_id); + break; + default: + break; + } + + if (spvOpcodeIsComposite(opcode)) { + multi_mtf_.Insert(kMtfTypeComposite, inst_.result_id); + } + + if (opcode == SpvOpLabel) { + multi_mtf_.InsertOrPromote(kMtfLabel, inst_.result_id); + } + + if (opcode == SpvOpTypeInt) { + multi_mtf_.Insert(kMtfTypeScalar, inst_.result_id); + multi_mtf_.Insert(kMtfTypeIntScalarOrVector, inst_.result_id); + } + + if (opcode == SpvOpTypeFloat) { + multi_mtf_.Insert(kMtfTypeScalar, inst_.result_id); + multi_mtf_.Insert(kMtfTypeFloatScalarOrVector, inst_.result_id); + } + + if (opcode == SpvOpTypeBool) { + multi_mtf_.Insert(kMtfTypeScalar, inst_.result_id); + multi_mtf_.Insert(kMtfTypeBoolScalarOrVector, inst_.result_id); + } + + if (opcode == SpvOpTypeVector) { + const uint32_t component_type_id = inst_.words[2]; + const uint32_t size = inst_.words[3]; + if (multi_mtf_.HasValue(GetMtfIdGeneratedByOpcode(SpvOpTypeFloat), + component_type_id)) { + multi_mtf_.Insert(kMtfTypeFloatScalarOrVector, inst_.result_id); + } else if (multi_mtf_.HasValue(GetMtfIdGeneratedByOpcode(SpvOpTypeInt), + component_type_id)) { + multi_mtf_.Insert(kMtfTypeIntScalarOrVector, inst_.result_id); + } else if (multi_mtf_.HasValue(GetMtfIdGeneratedByOpcode(SpvOpTypeBool), + component_type_id)) { + multi_mtf_.Insert(kMtfTypeBoolScalarOrVector, inst_.result_id); + } + multi_mtf_.Insert(GetMtfTypeVectorOfSize(size), inst_.result_id); + } + + if (inst_.opcode == SpvOpTypeFunction) { + const uint32_t return_type = inst_.words[2]; + multi_mtf_.Insert(kMtfTypeReturnedByFunction, return_type); + multi_mtf_.Insert(GetMtfFunctionTypeWithReturnType(return_type), + inst_.result_id); + } + + if (inst_.type_id) { + const Instruction* type_inst = FindDef(inst_.type_id); + assert(type_inst); + + multi_mtf_.Insert(kMtfObject, inst_.result_id); + + multi_mtf_.Insert(GetMtfIdOfType(inst_.type_id), inst_.result_id); + + if (multi_mtf_.HasValue(kMtfTypeFloatScalarOrVector, inst_.type_id)) { + multi_mtf_.Insert(kMtfFloatScalarOrVector, inst_.result_id); + } + + if (multi_mtf_.HasValue(kMtfTypeIntScalarOrVector, inst_.type_id)) + multi_mtf_.Insert(kMtfIntScalarOrVector, inst_.result_id); + + if (multi_mtf_.HasValue(kMtfTypeBoolScalarOrVector, inst_.type_id)) + multi_mtf_.Insert(kMtfBoolScalarOrVector, inst_.result_id); + + if (multi_mtf_.HasValue(kMtfTypeComposite, inst_.type_id)) + multi_mtf_.Insert(kMtfComposite, inst_.result_id); + + switch (type_inst->opcode()) { + case SpvOpTypeInt: + case SpvOpTypeBool: + case SpvOpTypePointer: + case SpvOpTypeVector: + case SpvOpTypeImage: + case SpvOpTypeSampledImage: + case SpvOpTypeSampler: + multi_mtf_.Insert( + GetMtfIdWithTypeGeneratedByOpcode(type_inst->opcode()), + inst_.result_id); + break; + default: + break; + } + + if (type_inst->opcode() == SpvOpTypeVector) { + const uint32_t component_type = type_inst->word(2); + multi_mtf_.Insert(GetMtfVectorOfComponentType(component_type), + inst_.result_id); + } + + if (type_inst->opcode() == SpvOpTypePointer) { + assert(type_inst->operands().size() > 2); + assert(type_inst->words().size() > type_inst->operands()[2].offset); + const uint32_t data_type = + type_inst->word(type_inst->operands()[2].offset); + multi_mtf_.Insert(GetMtfPointerToType(data_type), inst_.result_id); + + if (multi_mtf_.HasValue(kMtfTypeComposite, data_type)) + multi_mtf_.Insert(kMtfTypePointerToComposite, inst_.result_id); + } + } + + if (spvOpcodeGeneratesType(opcode)) { + if (opcode != SpvOpTypeFunction) { + multi_mtf_.Insert(kMtfTypeNonFunction, inst_.result_id); + } + } + } + + if (model_->AnyDescriptorHasCodingScheme()) { + const uint32_t long_descriptor = + long_id_descriptors_.ProcessInstruction(inst_); + if (model_->DescriptorHasCodingScheme(long_descriptor)) + multi_mtf_.Insert(GetMtfLongIdDescriptor(long_descriptor), + inst_.result_id); + } + + if (model_->id_fallback_strategy() == + MarkvModel::IdFallbackStrategy::kShortDescriptor) { + const uint32_t short_descriptor = + short_id_descriptors_.ProcessInstruction(inst_); + multi_mtf_.Insert(GetMtfShortIdDescriptor(short_descriptor), + inst_.result_id); + } +} + +uint64_t MarkvCodecBase::GetRuleBasedMtf() { + // This function is only called for id operands (but not result ids). + assert(spvIsIdType(operand_.type) || + operand_.type == SPV_OPERAND_TYPE_OPTIONAL_ID); + assert(operand_.type != SPV_OPERAND_TYPE_RESULT_ID); + + const SpvOp opcode = static_cast(inst_.opcode); + + // All operand slots which expect label id. + if ((inst_.opcode == SpvOpLoopMerge && operand_index_ <= 1) || + (inst_.opcode == SpvOpSelectionMerge && operand_index_ == 0) || + (inst_.opcode == SpvOpBranch && operand_index_ == 0) || + (inst_.opcode == SpvOpBranchConditional && + (operand_index_ == 1 || operand_index_ == 2)) || + (inst_.opcode == SpvOpPhi && operand_index_ >= 3 && + operand_index_ % 2 == 1) || + (inst_.opcode == SpvOpSwitch && operand_index_ > 0)) { + return kMtfLabel; + } + + switch (opcode) { + case SpvOpFAdd: + case SpvOpFSub: + case SpvOpFMul: + case SpvOpFDiv: + case SpvOpFRem: + case SpvOpFMod: + case SpvOpFNegate: { + if (operand_index_ == 0) return kMtfTypeFloatScalarOrVector; + return GetMtfIdOfType(inst_.type_id); + } + + case SpvOpISub: + case SpvOpIAdd: + case SpvOpIMul: + case SpvOpSDiv: + case SpvOpUDiv: + case SpvOpSMod: + case SpvOpUMod: + case SpvOpSRem: + case SpvOpSNegate: { + if (operand_index_ == 0) return kMtfTypeIntScalarOrVector; + + return kMtfIntScalarOrVector; + } + + // TODO(atgoo@github.com) Add OpConvertFToU and other opcodes. + + case SpvOpFOrdEqual: + case SpvOpFUnordEqual: + case SpvOpFOrdNotEqual: + case SpvOpFUnordNotEqual: + case SpvOpFOrdLessThan: + case SpvOpFUnordLessThan: + case SpvOpFOrdGreaterThan: + case SpvOpFUnordGreaterThan: + case SpvOpFOrdLessThanEqual: + case SpvOpFUnordLessThanEqual: + case SpvOpFOrdGreaterThanEqual: + case SpvOpFUnordGreaterThanEqual: { + if (operand_index_ == 0) return kMtfTypeBoolScalarOrVector; + if (operand_index_ == 2) return kMtfFloatScalarOrVector; + if (operand_index_ == 3) { + const uint32_t first_operand_id = GetInstWords()[3]; + const uint32_t first_operand_type = id_to_type_id_.at(first_operand_id); + return GetMtfIdOfType(first_operand_type); + } + break; + } + + case SpvOpVectorShuffle: { + if (operand_index_ == 0) { + assert(inst_.num_operands > 4); + return GetMtfTypeVectorOfSize(inst_.num_operands - 4); + } + + assert(inst_.type_id); + if (operand_index_ == 2 || operand_index_ == 3) + return GetMtfVectorOfComponentType( + GetVectorComponentType(inst_.type_id)); + break; + } + + case SpvOpVectorTimesScalar: { + if (operand_index_ == 0) { + // TODO(atgoo@github.com) Could be narrowed to vector of floats. + return GetMtfIdGeneratedByOpcode(SpvOpTypeVector); + } + + assert(inst_.type_id); + if (operand_index_ == 2) return GetMtfIdOfType(inst_.type_id); + if (operand_index_ == 3) + return GetMtfIdOfType(GetVectorComponentType(inst_.type_id)); + break; + } + + case SpvOpDot: { + if (operand_index_ == 0) return GetMtfIdGeneratedByOpcode(SpvOpTypeFloat); + + assert(inst_.type_id); + if (operand_index_ == 2) + return GetMtfVectorOfComponentType(inst_.type_id); + if (operand_index_ == 3) { + const uint32_t vector_id = GetInstWords()[3]; + const uint32_t vector_type = id_to_type_id_.at(vector_id); + return GetMtfIdOfType(vector_type); + } + break; + } + + case SpvOpTypeVector: { + if (operand_index_ == 1) { + return kMtfTypeScalar; + } + break; + } + + case SpvOpTypeMatrix: { + if (operand_index_ == 1) { + return GetMtfIdGeneratedByOpcode(SpvOpTypeVector); + } + break; + } + + case SpvOpTypePointer: { + if (operand_index_ == 2) { + return kMtfTypeNonFunction; + } + break; + } + + case SpvOpTypeStruct: { + if (operand_index_ >= 1) { + return kMtfTypeNonFunction; + } + break; + } + + case SpvOpTypeFunction: { + if (operand_index_ == 1) { + return kMtfTypeNonFunction; + } + + if (operand_index_ >= 2) { + return kMtfTypeNonFunction; + } + break; + } + + case SpvOpLoad: { + if (operand_index_ == 0) return kMtfTypeNonFunction; + + if (operand_index_ == 2) { + assert(inst_.type_id); + return GetMtfPointerToType(inst_.type_id); + } + break; + } + + case SpvOpStore: { + if (operand_index_ == 0) + return GetMtfIdWithTypeGeneratedByOpcode(SpvOpTypePointer); + if (operand_index_ == 1) { + const uint32_t pointer_id = GetInstWords()[1]; + const uint32_t pointer_type = id_to_type_id_.at(pointer_id); + const Instruction* pointer_inst = FindDef(pointer_type); + assert(pointer_inst); + assert(pointer_inst->opcode() == SpvOpTypePointer); + const uint32_t data_type = + pointer_inst->word(pointer_inst->operands()[2].offset); + return GetMtfIdOfType(data_type); + } + break; + } + + case SpvOpVariable: { + if (operand_index_ == 0) + return GetMtfIdGeneratedByOpcode(SpvOpTypePointer); + break; + } + + case SpvOpAccessChain: { + if (operand_index_ == 0) + return GetMtfIdGeneratedByOpcode(SpvOpTypePointer); + if (operand_index_ == 2) return kMtfTypePointerToComposite; + if (operand_index_ >= 3) + return GetMtfIdWithTypeGeneratedByOpcode(SpvOpTypeInt); + break; + } + + case SpvOpCompositeConstruct: { + if (operand_index_ == 0) return kMtfTypeComposite; + if (operand_index_ >= 2) { + const uint32_t composite_type = GetInstWords()[1]; + if (multi_mtf_.HasValue(kMtfTypeFloatScalarOrVector, composite_type)) + return kMtfFloatScalarOrVector; + if (multi_mtf_.HasValue(kMtfTypeIntScalarOrVector, composite_type)) + return kMtfIntScalarOrVector; + if (multi_mtf_.HasValue(kMtfTypeBoolScalarOrVector, composite_type)) + return kMtfBoolScalarOrVector; + } + break; + } + + case SpvOpCompositeExtract: { + if (operand_index_ == 2) return kMtfComposite; + break; + } + + case SpvOpConstantComposite: { + if (operand_index_ == 0) return kMtfTypeComposite; + if (operand_index_ >= 2) { + const Instruction* composite_type_inst = FindDef(inst_.type_id); + assert(composite_type_inst); + if (composite_type_inst->opcode() == SpvOpTypeVector) { + return GetMtfIdOfType(composite_type_inst->word(2)); + } + } + break; + } + + case SpvOpExtInst: { + if (operand_index_ == 2) + return GetMtfIdGeneratedByOpcode(SpvOpExtInstImport); + if (operand_index_ >= 4) { + const uint32_t return_type = GetInstWords()[1]; + const uint32_t ext_inst_type = inst_.ext_inst_type; + const uint32_t ext_inst_index = GetInstWords()[4]; + // TODO(atgoo@github.com) The list of extended instructions is + // incomplete. Only common instructions and low-hanging fruits listed. + if (ext_inst_type == SPV_EXT_INST_TYPE_GLSL_STD_450) { + switch (ext_inst_index) { + case GLSLstd450FAbs: + case GLSLstd450FClamp: + case GLSLstd450FMax: + case GLSLstd450FMin: + case GLSLstd450FMix: + case GLSLstd450Step: + case GLSLstd450SmoothStep: + case GLSLstd450Fma: + case GLSLstd450Pow: + case GLSLstd450Exp: + case GLSLstd450Exp2: + case GLSLstd450Log: + case GLSLstd450Log2: + case GLSLstd450Sqrt: + case GLSLstd450InverseSqrt: + case GLSLstd450Fract: + case GLSLstd450Floor: + case GLSLstd450Ceil: + case GLSLstd450Radians: + case GLSLstd450Degrees: + case GLSLstd450Sin: + case GLSLstd450Cos: + case GLSLstd450Tan: + case GLSLstd450Sinh: + case GLSLstd450Cosh: + case GLSLstd450Tanh: + case GLSLstd450Asin: + case GLSLstd450Acos: + case GLSLstd450Atan: + case GLSLstd450Atan2: + case GLSLstd450Asinh: + case GLSLstd450Acosh: + case GLSLstd450Atanh: + case GLSLstd450MatrixInverse: + case GLSLstd450Cross: + case GLSLstd450Normalize: + case GLSLstd450Reflect: + case GLSLstd450FaceForward: + return GetMtfIdOfType(return_type); + case GLSLstd450Length: + case GLSLstd450Distance: + case GLSLstd450Refract: + return kMtfFloatScalarOrVector; + default: + break; + } + } else if (ext_inst_type == SPV_EXT_INST_TYPE_OPENCL_STD) { + switch (ext_inst_index) { + case OpenCLLIB::Fabs: + case OpenCLLIB::FClamp: + case OpenCLLIB::Fmax: + case OpenCLLIB::Fmin: + case OpenCLLIB::Step: + case OpenCLLIB::Smoothstep: + case OpenCLLIB::Fma: + case OpenCLLIB::Pow: + case OpenCLLIB::Exp: + case OpenCLLIB::Exp2: + case OpenCLLIB::Log: + case OpenCLLIB::Log2: + case OpenCLLIB::Sqrt: + case OpenCLLIB::Rsqrt: + case OpenCLLIB::Fract: + case OpenCLLIB::Floor: + case OpenCLLIB::Ceil: + case OpenCLLIB::Radians: + case OpenCLLIB::Degrees: + case OpenCLLIB::Sin: + case OpenCLLIB::Cos: + case OpenCLLIB::Tan: + case OpenCLLIB::Sinh: + case OpenCLLIB::Cosh: + case OpenCLLIB::Tanh: + case OpenCLLIB::Asin: + case OpenCLLIB::Acos: + case OpenCLLIB::Atan: + case OpenCLLIB::Atan2: + case OpenCLLIB::Asinh: + case OpenCLLIB::Acosh: + case OpenCLLIB::Atanh: + case OpenCLLIB::Cross: + case OpenCLLIB::Normalize: + return GetMtfIdOfType(return_type); + case OpenCLLIB::Length: + case OpenCLLIB::Distance: + return kMtfFloatScalarOrVector; + default: + break; + } + } + } + break; + } + + case SpvOpFunction: { + if (operand_index_ == 0) return kMtfTypeReturnedByFunction; + + if (operand_index_ == 3) { + const uint32_t return_type = GetInstWords()[1]; + return GetMtfFunctionTypeWithReturnType(return_type); + } + break; + } + + case SpvOpFunctionCall: { + if (operand_index_ == 0) return kMtfTypeReturnedByFunction; + + if (operand_index_ == 2) { + const uint32_t return_type = GetInstWords()[1]; + return GetMtfFunctionWithReturnType(return_type); + } + + if (operand_index_ >= 3) { + const uint32_t function_id = GetInstWords()[3]; + const Instruction* function_inst = FindDef(function_id); + if (!function_inst) return kMtfObject; + + assert(function_inst->opcode() == SpvOpFunction); + + const uint32_t function_type_id = function_inst->word(4); + const Instruction* function_type_inst = FindDef(function_type_id); + assert(function_type_inst); + assert(function_type_inst->opcode() == SpvOpTypeFunction); + + const uint32_t argument_type = function_type_inst->word(operand_index_); + return GetMtfIdOfType(argument_type); + } + break; + } + + case SpvOpReturnValue: { + if (operand_index_ == 0) return GetMtfIdOfType(cur_function_return_type_); + break; + } + + case SpvOpBranchConditional: { + if (operand_index_ == 0) + return GetMtfIdWithTypeGeneratedByOpcode(SpvOpTypeBool); + break; + } + + case SpvOpSampledImage: { + if (operand_index_ == 0) + return GetMtfIdGeneratedByOpcode(SpvOpTypeSampledImage); + if (operand_index_ == 2) + return GetMtfIdWithTypeGeneratedByOpcode(SpvOpTypeImage); + if (operand_index_ == 3) + return GetMtfIdWithTypeGeneratedByOpcode(SpvOpTypeSampler); + break; + } + + case SpvOpImageSampleImplicitLod: { + if (operand_index_ == 0) + return GetMtfIdGeneratedByOpcode(SpvOpTypeVector); + if (operand_index_ == 2) + return GetMtfIdWithTypeGeneratedByOpcode(SpvOpTypeSampledImage); + if (operand_index_ == 3) + return GetMtfIdWithTypeGeneratedByOpcode(SpvOpTypeVector); + break; + } + + default: + break; + } + + return kMtfNone; +} + +spv_result_t MarkvEncoder::EncodeNonIdWord(uint32_t word) { + auto* codec = model_->GetNonIdWordHuffmanCodec(inst_.opcode, operand_index_); + + if (codec) { + uint64_t bits = 0; + size_t num_bits = 0; + if (codec->Encode(word, &bits, &num_bits)) { + // Encoding successful. + writer_.WriteBits(bits, num_bits); + return SPV_SUCCESS; + } else { + // Encoding failed, write kMarkvNoneOfTheAbove flag. + if (!codec->Encode(kMarkvNoneOfTheAbove, &bits, &num_bits)) + return Diag(SPV_ERROR_INTERNAL) + << "Non-id word Huffman table for " + << spvOpcodeString(SpvOp(inst_.opcode)) << " operand index " + << operand_index_ << " is missing kMarkvNoneOfTheAbove"; + writer_.WriteBits(bits, num_bits); + } + } + + // Fallback encoding. + const size_t chunk_length = + model_->GetOperandVariableWidthChunkLength(operand_.type); + if (chunk_length) { + writer_.WriteVariableWidthU32(word, chunk_length); + } else { + writer_.WriteUnencoded(word); + } + return SPV_SUCCESS; +} + +spv_result_t MarkvDecoder::DecodeNonIdWord(uint32_t* word) { + auto* codec = model_->GetNonIdWordHuffmanCodec(inst_.opcode, operand_index_); + + if (codec) { + uint64_t decoded_value = 0; + if (!codec->DecodeFromStream(GetReadBitCallback(), &decoded_value)) + return Diag(SPV_ERROR_INVALID_BINARY) + << "Failed to decode non-id word with Huffman"; + + if (decoded_value != kMarkvNoneOfTheAbove) { + // The word decoded successfully. + *word = uint32_t(decoded_value); + assert(*word == decoded_value); + return SPV_SUCCESS; + } + + // Received kMarkvNoneOfTheAbove signal, use fallback decoding. + } + + const size_t chunk_length = + model_->GetOperandVariableWidthChunkLength(operand_.type); + if (chunk_length) { + if (!reader_.ReadVariableWidthU32(word, chunk_length)) + return Diag(SPV_ERROR_INVALID_BINARY) + << "Failed to decode non-id word with varint"; + } else { + if (!reader_.ReadUnencoded(word)) + return Diag(SPV_ERROR_INVALID_BINARY) + << "Failed to read unencoded non-id word"; + } + return SPV_SUCCESS; +} + +spv_result_t MarkvEncoder::EncodeOpcodeAndNumOperands(uint32_t opcode, + uint32_t num_operands) { + uint64_t bits = 0; + size_t num_bits = 0; + + const uint32_t word = opcode | (num_operands << 16); + + // First try to use the Markov chain codec. + auto* codec = + model_->GetOpcodeAndNumOperandsMarkovHuffmanCodec(GetPrevOpcode()); + if (codec) { + if (codec->Encode(word, &bits, &num_bits)) { + // The word was successfully encoded into bits/num_bits. + writer_.WriteBits(bits, num_bits); + return SPV_SUCCESS; + } else { + // The word is not in the Huffman table. Write kMarkvNoneOfTheAbove + // and use fallback encoding. + if (!codec->Encode(kMarkvNoneOfTheAbove, &bits, &num_bits)) + return Diag(SPV_ERROR_INTERNAL) + << "opcode_and_num_operands Huffman table for " + << spvOpcodeString(GetPrevOpcode()) + << "is missing kMarkvNoneOfTheAbove"; + writer_.WriteBits(bits, num_bits); + } + } + + // Fallback to base-rate codec. + codec = model_->GetOpcodeAndNumOperandsMarkovHuffmanCodec(SpvOpNop); + assert(codec); + if (codec->Encode(word, &bits, &num_bits)) { + // The word was successfully encoded into bits/num_bits. + writer_.WriteBits(bits, num_bits); + return SPV_SUCCESS; + } else { + // The word is not in the Huffman table. Write kMarkvNoneOfTheAbove + // and return false. + if (!codec->Encode(kMarkvNoneOfTheAbove, &bits, &num_bits)) + return Diag(SPV_ERROR_INTERNAL) + << "Global opcode_and_num_operands Huffman table is missing " + << "kMarkvNoneOfTheAbove"; + writer_.WriteBits(bits, num_bits); + return SPV_UNSUPPORTED; + } +} + +spv_result_t MarkvDecoder::DecodeOpcodeAndNumberOfOperands( + uint32_t* opcode, uint32_t* num_operands) { + // First try to use the Markov chain codec. + auto* codec = + model_->GetOpcodeAndNumOperandsMarkovHuffmanCodec(GetPrevOpcode()); + if (codec) { + uint64_t decoded_value = 0; + if (!codec->DecodeFromStream(GetReadBitCallback(), &decoded_value)) + return Diag(SPV_ERROR_INTERNAL) + << "Failed to decode opcode_and_num_operands, previous opcode is " + << spvOpcodeString(GetPrevOpcode()); + + if (decoded_value != kMarkvNoneOfTheAbove) { + // The word was successfully decoded. + *opcode = uint32_t(decoded_value & 0xFFFF); + *num_operands = uint32_t(decoded_value >> 16); + return SPV_SUCCESS; + } + + // Received kMarkvNoneOfTheAbove signal, use fallback decoding. + } + + // Fallback to base-rate codec. + codec = model_->GetOpcodeAndNumOperandsMarkovHuffmanCodec(SpvOpNop); + assert(codec); + uint64_t decoded_value = 0; + if (!codec->DecodeFromStream(GetReadBitCallback(), &decoded_value)) + return Diag(SPV_ERROR_INTERNAL) + << "Failed to decode opcode_and_num_operands with global codec"; + + if (decoded_value == kMarkvNoneOfTheAbove) { + // Received kMarkvNoneOfTheAbove signal, fallback further. + return SPV_UNSUPPORTED; + } + + *opcode = uint32_t(decoded_value & 0xFFFF); + *num_operands = uint32_t(decoded_value >> 16); + return SPV_SUCCESS; +} + +spv_result_t MarkvEncoder::EncodeMtfRankHuffman(uint32_t rank, uint64_t mtf, + uint64_t fallback_method) { + const auto* codec = GetMtfHuffmanCodec(mtf); + if (!codec) { + assert(fallback_method != kMtfNone); + codec = GetMtfHuffmanCodec(fallback_method); + } + + if (!codec) return Diag(SPV_ERROR_INTERNAL) << "No codec to encode MTF rank"; + + uint64_t bits = 0; + size_t num_bits = 0; + if (rank < kMtfSmallestRankEncodedByValue) { + // Encode using Huffman coding. + if (!codec->Encode(rank, &bits, &num_bits)) + return Diag(SPV_ERROR_INTERNAL) + << "Failed to encode MTF rank with Huffman"; + + writer_.WriteBits(bits, num_bits); + } else { + // Encode by value. + if (!codec->Encode(kMtfRankEncodedByValueSignal, &bits, &num_bits)) + return Diag(SPV_ERROR_INTERNAL) + << "Failed to encode kMtfRankEncodedByValueSignal"; + + writer_.WriteBits(bits, num_bits); + writer_.WriteVariableWidthU32(rank - kMtfSmallestRankEncodedByValue, + model_->mtf_rank_chunk_length()); + } + return SPV_SUCCESS; +} + +spv_result_t MarkvDecoder::DecodeMtfRankHuffman(uint64_t mtf, + uint32_t fallback_method, + uint32_t* rank) { + const auto* codec = GetMtfHuffmanCodec(mtf); + if (!codec) { + assert(fallback_method != kMtfNone); + codec = GetMtfHuffmanCodec(fallback_method); + } + + if (!codec) return Diag(SPV_ERROR_INTERNAL) << "No codec to decode MTF rank"; + + uint32_t decoded_value = 0; + if (!codec->DecodeFromStream(GetReadBitCallback(), &decoded_value)) + return Diag(SPV_ERROR_INTERNAL) << "Failed to decode MTF rank with Huffman"; + + if (decoded_value == kMtfRankEncodedByValueSignal) { + // Decode by value. + if (!reader_.ReadVariableWidthU32(rank, model_->mtf_rank_chunk_length())) + return Diag(SPV_ERROR_INTERNAL) + << "Failed to decode MTF rank with varint"; + *rank += kMtfSmallestRankEncodedByValue; + } else { + // Decode using Huffman coding. + assert(decoded_value < kMtfSmallestRankEncodedByValue); + *rank = decoded_value; + } + return SPV_SUCCESS; +} + +spv_result_t MarkvEncoder::EncodeIdWithDescriptor(uint32_t id) { + // Get the descriptor for id. + const uint32_t long_descriptor = long_id_descriptors_.GetDescriptor(id); + auto* codec = + model_->GetIdDescriptorHuffmanCodec(inst_.opcode, operand_index_); + uint64_t bits = 0; + size_t num_bits = 0; + uint64_t mtf = kMtfNone; + if (long_descriptor && codec && + codec->Encode(long_descriptor, &bits, &num_bits)) { + // If the descriptor exists and is in the table, write the descriptor and + // proceed to encoding the rank. + writer_.WriteBits(bits, num_bits); + mtf = GetMtfLongIdDescriptor(long_descriptor); + } else { + if (codec) { + // The descriptor doesn't exist or we have no coding for it. Write + // kMarkvNoneOfTheAbove and go to fallback method. + if (!codec->Encode(kMarkvNoneOfTheAbove, &bits, &num_bits)) + return Diag(SPV_ERROR_INTERNAL) + << "Descriptor Huffman table for " + << spvOpcodeString(SpvOp(inst_.opcode)) << " operand index " + << operand_index_ << " is missing kMarkvNoneOfTheAbove"; + + writer_.WriteBits(bits, num_bits); + } + + if (model_->id_fallback_strategy() != + MarkvModel::IdFallbackStrategy::kShortDescriptor) { + return SPV_UNSUPPORTED; + } + + const uint32_t short_descriptor = short_id_descriptors_.GetDescriptor(id); + writer_.WriteBits(short_descriptor, kShortDescriptorNumBits); + + if (short_descriptor == 0) { + // Forward declared id. + return SPV_UNSUPPORTED; + } + + mtf = GetMtfShortIdDescriptor(short_descriptor); + } + + // Descriptor has been encoded. Now encode the rank of the id in the + // associated mtf sequence. + return EncodeExistingId(mtf, id); +} + +spv_result_t MarkvDecoder::DecodeIdWithDescriptor(uint32_t* id) { + auto* codec = + model_->GetIdDescriptorHuffmanCodec(inst_.opcode, operand_index_); + + uint64_t mtf = kMtfNone; + if (codec) { + uint64_t decoded_value = 0; + if (!codec->DecodeFromStream(GetReadBitCallback(), &decoded_value)) + return Diag(SPV_ERROR_INTERNAL) + << "Failed to decode descriptor with Huffman"; + + if (decoded_value != kMarkvNoneOfTheAbove) { + const uint32_t long_descriptor = uint32_t(decoded_value); + mtf = GetMtfLongIdDescriptor(long_descriptor); + } + } + + if (mtf == kMtfNone) { + if (model_->id_fallback_strategy() != + MarkvModel::IdFallbackStrategy::kShortDescriptor) { + return SPV_UNSUPPORTED; + } + + uint64_t decoded_value = 0; + if (!reader_.ReadBits(&decoded_value, kShortDescriptorNumBits)) + return Diag(SPV_ERROR_INTERNAL) << "Failed to read short descriptor"; + const uint32_t short_descriptor = uint32_t(decoded_value); + if (short_descriptor == 0) { + // Forward declared id. + return SPV_UNSUPPORTED; + } + mtf = GetMtfShortIdDescriptor(short_descriptor); + } + + return DecodeExistingId(mtf, id); +} + +spv_result_t MarkvEncoder::EncodeExistingId(uint64_t mtf, uint32_t id) { + assert(multi_mtf_.GetSize(mtf) > 0); + if (multi_mtf_.GetSize(mtf) == 1) { + // If the sequence has only one element no need to write rank, the decoder + // would make the same decision. + return SPV_SUCCESS; + } + + uint32_t rank = 0; + if (!multi_mtf_.RankFromValue(mtf, id, &rank)) + return Diag(SPV_ERROR_INTERNAL) << "Id is not in the MTF sequence"; + + return EncodeMtfRankHuffman(rank, mtf, kMtfGenericNonZeroRank); +} + +spv_result_t MarkvDecoder::DecodeExistingId(uint64_t mtf, uint32_t* id) { + assert(multi_mtf_.GetSize(mtf) > 0); + *id = 0; + + uint32_t rank = 0; + + if (multi_mtf_.GetSize(mtf) == 1) { + rank = 1; + } else { + const spv_result_t result = + DecodeMtfRankHuffman(mtf, kMtfGenericNonZeroRank, &rank); + if (result != SPV_SUCCESS) return result; + } + + assert(rank); + if (!multi_mtf_.ValueFromRank(mtf, rank, id)) + return Diag(SPV_ERROR_INTERNAL) << "MTF rank is out of bounds"; + + return SPV_SUCCESS; +} + +spv_result_t MarkvEncoder::EncodeRefId(uint32_t id) { + { + // Try to encode using id descriptor mtfs. + const spv_result_t result = EncodeIdWithDescriptor(id); + if (result != SPV_UNSUPPORTED) return result; + // If can't be done continue with other methods. + } + + const bool can_forward_declare = spvOperandCanBeForwardDeclaredFunction( + SpvOp(inst_.opcode))(operand_index_); + uint32_t rank = 0; + + if (model_->id_fallback_strategy() == + MarkvModel::IdFallbackStrategy::kRuleBased) { + // Encode using rule-based mtf. + uint64_t mtf = GetRuleBasedMtf(); + + if (mtf != kMtfNone && !can_forward_declare) { + assert(multi_mtf_.HasValue(kMtfAll, id)); + return EncodeExistingId(mtf, id); + } + + if (mtf == kMtfNone) mtf = kMtfAll; + + if (!multi_mtf_.RankFromValue(mtf, id, &rank)) { + // This is the first occurrence of a forward declared id. + multi_mtf_.Insert(kMtfAll, id); + multi_mtf_.Insert(kMtfForwardDeclared, id); + if (mtf != kMtfAll) multi_mtf_.Insert(mtf, id); + rank = 0; + } + + return EncodeMtfRankHuffman(rank, mtf, kMtfAll); + } else { + assert(can_forward_declare); + + if (!multi_mtf_.RankFromValue(kMtfForwardDeclared, id, &rank)) { + // This is the first occurrence of a forward declared id. + multi_mtf_.Insert(kMtfForwardDeclared, id); + rank = 0; + } + + writer_.WriteVariableWidthU32(rank, model_->mtf_rank_chunk_length()); + return SPV_SUCCESS; + } +} + +spv_result_t MarkvDecoder::DecodeRefId(uint32_t* id) { + { + const spv_result_t result = DecodeIdWithDescriptor(id); + if (result != SPV_UNSUPPORTED) return result; + } + + const bool can_forward_declare = spvOperandCanBeForwardDeclaredFunction( + SpvOp(inst_.opcode))(operand_index_); + uint32_t rank = 0; + *id = 0; + + if (model_->id_fallback_strategy() == + MarkvModel::IdFallbackStrategy::kRuleBased) { + uint64_t mtf = GetRuleBasedMtf(); + if (mtf != kMtfNone && !can_forward_declare) { + return DecodeExistingId(mtf, id); + } + + if (mtf == kMtfNone) mtf = kMtfAll; + { + const spv_result_t result = DecodeMtfRankHuffman(mtf, kMtfAll, &rank); + if (result != SPV_SUCCESS) return result; + } + + if (rank == 0) { + // This is the first occurrence of a forward declared id. + *id = GetIdBound(); + SetIdBound(*id + 1); + multi_mtf_.Insert(kMtfAll, *id); + multi_mtf_.Insert(kMtfForwardDeclared, *id); + if (mtf != kMtfAll) multi_mtf_.Insert(mtf, *id); + } else { + if (!multi_mtf_.ValueFromRank(mtf, rank, id)) + return Diag(SPV_ERROR_INTERNAL) << "MTF rank out of bounds"; + } + } else { + assert(can_forward_declare); + + if (!reader_.ReadVariableWidthU32(&rank, model_->mtf_rank_chunk_length())) + return Diag(SPV_ERROR_INTERNAL) + << "Failed to decode MTF rank with varint"; + + if (rank == 0) { + // This is the first occurrence of a forward declared id. + *id = GetIdBound(); + SetIdBound(*id + 1); + multi_mtf_.Insert(kMtfForwardDeclared, *id); + } else { + if (!multi_mtf_.ValueFromRank(kMtfForwardDeclared, rank, id)) + return Diag(SPV_ERROR_INTERNAL) << "MTF rank out of bounds"; + } + } + assert(*id); + return SPV_SUCCESS; +} + +spv_result_t MarkvEncoder::EncodeTypeId() { + if (inst_.opcode == SpvOpFunctionParameter) { + assert(!remaining_function_parameter_types_.empty()); + assert(inst_.type_id == remaining_function_parameter_types_.front()); + remaining_function_parameter_types_.pop_front(); + return SPV_SUCCESS; + } + + { + // Try to encode using id descriptor mtfs. + const spv_result_t result = EncodeIdWithDescriptor(inst_.type_id); + if (result != SPV_UNSUPPORTED) return result; + // If can't be done continue with other methods. + } + + assert(model_->id_fallback_strategy() == + MarkvModel::IdFallbackStrategy::kRuleBased); + + uint64_t mtf = GetRuleBasedMtf(); + assert(!spvOperandCanBeForwardDeclaredFunction(SpvOp(inst_.opcode))( + operand_index_)); + + if (mtf == kMtfNone) { + mtf = kMtfTypeNonFunction; + // Function types should have been handled by GetRuleBasedMtf. + assert(inst_.opcode != SpvOpFunction); + } + + return EncodeExistingId(mtf, inst_.type_id); +} + +spv_result_t MarkvDecoder::DecodeTypeId() { + if (inst_.opcode == SpvOpFunctionParameter) { + assert(!remaining_function_parameter_types_.empty()); + inst_.type_id = remaining_function_parameter_types_.front(); + remaining_function_parameter_types_.pop_front(); + return SPV_SUCCESS; + } + + { + const spv_result_t result = DecodeIdWithDescriptor(&inst_.type_id); + if (result != SPV_UNSUPPORTED) return result; + } + + assert(model_->id_fallback_strategy() == + MarkvModel::IdFallbackStrategy::kRuleBased); + + uint64_t mtf = GetRuleBasedMtf(); + assert(!spvOperandCanBeForwardDeclaredFunction(SpvOp(inst_.opcode))( + operand_index_)); + + if (mtf == kMtfNone) { + mtf = kMtfTypeNonFunction; + // Function types should have been handled by GetRuleBasedMtf. + assert(inst_.opcode != SpvOpFunction); + } + + return DecodeExistingId(mtf, &inst_.type_id); +} + +spv_result_t MarkvEncoder::EncodeResultId() { + uint32_t rank = 0; + + const uint64_t num_still_forward_declared = + multi_mtf_.GetSize(kMtfForwardDeclared); + + if (num_still_forward_declared) { + // We write the rank only if kMtfForwardDeclared is not empty. If it is + // empty the decoder knows that there are no forward declared ids to expect. + if (multi_mtf_.RankFromValue(kMtfForwardDeclared, inst_.result_id, &rank)) { + // This is a definition of a forward declared id. We can remove the id + // from kMtfForwardDeclared. + if (!multi_mtf_.Remove(kMtfForwardDeclared, inst_.result_id)) + return Diag(SPV_ERROR_INTERNAL) + << "Failed to remove id from kMtfForwardDeclared"; + writer_.WriteBits(1, 1); + writer_.WriteVariableWidthU32(rank, model_->mtf_rank_chunk_length()); + } else { + rank = 0; + writer_.WriteBits(0, 1); + } + } + + if (model_->id_fallback_strategy() == + MarkvModel::IdFallbackStrategy::kRuleBased) { + if (!rank) { + multi_mtf_.Insert(kMtfAll, inst_.result_id); + } + } + + return SPV_SUCCESS; +} + +spv_result_t MarkvDecoder::DecodeResultId() { + uint32_t rank = 0; + + const uint64_t num_still_forward_declared = + multi_mtf_.GetSize(kMtfForwardDeclared); + + if (num_still_forward_declared) { + // Some ids were forward declared. Check if this id is one of them. + uint64_t id_was_forward_declared; + if (!reader_.ReadBits(&id_was_forward_declared, 1)) + return Diag(SPV_ERROR_INVALID_BINARY) + << "Failed to read id_was_forward_declared flag"; + + if (id_was_forward_declared) { + if (!reader_.ReadVariableWidthU32(&rank, model_->mtf_rank_chunk_length())) + return Diag(SPV_ERROR_INVALID_BINARY) + << "Failed to read MTF rank of forward declared id"; + + if (rank) { + // The id was forward declared, recover it from kMtfForwardDeclared. + if (!multi_mtf_.ValueFromRank(kMtfForwardDeclared, rank, + &inst_.result_id)) + return Diag(SPV_ERROR_INTERNAL) + << "Forward declared MTF rank is out of bounds"; + + // We can now remove the id from kMtfForwardDeclared. + if (!multi_mtf_.Remove(kMtfForwardDeclared, inst_.result_id)) + return Diag(SPV_ERROR_INTERNAL) + << "Failed to remove id from kMtfForwardDeclared"; + } + } + } + + if (inst_.result_id == 0) { + // The id was not forward declared, issue a new id. + inst_.result_id = GetIdBound(); + SetIdBound(inst_.result_id + 1); + } + + if (model_->id_fallback_strategy() == + MarkvModel::IdFallbackStrategy::kRuleBased) { + if (!rank) { + multi_mtf_.Insert(kMtfAll, inst_.result_id); + } + } + + return SPV_SUCCESS; +} + +spv_result_t MarkvEncoder::EncodeLiteralNumber( + const spv_parsed_operand_t& operand) { + if (operand.number_bit_width <= 32) { + const uint32_t word = inst_.words[operand.offset]; + return EncodeNonIdWord(word); + } else { + assert(operand.number_bit_width <= 64); + const uint64_t word = uint64_t(inst_.words[operand.offset]) | + (uint64_t(inst_.words[operand.offset + 1]) << 32); + if (operand.number_kind == SPV_NUMBER_UNSIGNED_INT) { + writer_.WriteVariableWidthU64(word, model_->u64_chunk_length()); + } else if (operand.number_kind == SPV_NUMBER_SIGNED_INT) { + int64_t val = 0; + std::memcpy(&val, &word, 8); + writer_.WriteVariableWidthS64(val, model_->s64_chunk_length(), + model_->s64_block_exponent()); + } else if (operand.number_kind == SPV_NUMBER_FLOATING) { + writer_.WriteUnencoded(word); + } else { + return Diag(SPV_ERROR_INTERNAL) << "Unsupported bit length"; + } + } + return SPV_SUCCESS; +} + +spv_result_t MarkvDecoder::DecodeLiteralNumber( + const spv_parsed_operand_t& operand) { + if (operand.number_bit_width <= 32) { + uint32_t word = 0; + const spv_result_t result = DecodeNonIdWord(&word); + if (result != SPV_SUCCESS) return result; + inst_words_.push_back(word); + } else { + assert(operand.number_bit_width <= 64); + uint64_t word = 0; + if (operand.number_kind == SPV_NUMBER_UNSIGNED_INT) { + if (!reader_.ReadVariableWidthU64(&word, model_->u64_chunk_length())) + return Diag(SPV_ERROR_INVALID_BINARY) << "Failed to read literal U64"; + } else if (operand.number_kind == SPV_NUMBER_SIGNED_INT) { + int64_t val = 0; + if (!reader_.ReadVariableWidthS64(&val, model_->s64_chunk_length(), + model_->s64_block_exponent())) + return Diag(SPV_ERROR_INVALID_BINARY) << "Failed to read literal S64"; + std::memcpy(&word, &val, 8); + } else if (operand.number_kind == SPV_NUMBER_FLOATING) { + if (!reader_.ReadUnencoded(&word)) + return Diag(SPV_ERROR_INVALID_BINARY) << "Failed to read literal F64"; + } else { + return Diag(SPV_ERROR_INTERNAL) << "Unsupported bit length"; + } + inst_words_.push_back(static_cast(word)); + inst_words_.push_back(static_cast(word >> 32)); + } + return SPV_SUCCESS; +} + +void MarkvEncoder::AddByteBreak(size_t byte_break_if_less_than) { + const size_t num_bits_to_next_byte = + GetNumBitsToNextByte(writer_.GetNumBits()); + if (num_bits_to_next_byte == 0 || + num_bits_to_next_byte > byte_break_if_less_than) + return; + + if (logger_) { + logger_->AppendWhitespaces(kCommentNumWhitespaces); + logger_->AppendText(""); + } + + writer_.WriteBits(0, num_bits_to_next_byte); +} + +bool MarkvDecoder::ReadToByteBreak(size_t byte_break_if_less_than) { + const size_t num_bits_to_next_byte = + GetNumBitsToNextByte(reader_.GetNumReadBits()); + if (num_bits_to_next_byte == 0 || + num_bits_to_next_byte > byte_break_if_less_than) + return true; + + uint64_t bits = 0; + if (!reader_.ReadBits(&bits, num_bits_to_next_byte)) return false; + + assert(bits == 0); + if (bits != 0) return false; + + return true; +} + +spv_result_t MarkvEncoder::EncodeInstruction( + const spv_parsed_instruction_t& inst) { + SpvOp opcode = SpvOp(inst.opcode); + inst_ = inst; + + const spv_result_t validation_result = UpdateValidationState(inst); + if (validation_result != SPV_SUCCESS) return validation_result; + + LogDisassemblyInstruction(); + + const spv_result_t opcode_encodig_result = + EncodeOpcodeAndNumOperands(opcode, inst.num_operands); + if (opcode_encodig_result < 0) return opcode_encodig_result; + + if (opcode_encodig_result != SPV_SUCCESS) { + // Fallback encoding for opcode and num_operands. + writer_.WriteVariableWidthU32(opcode, model_->opcode_chunk_length()); + + if (!OpcodeHasFixedNumberOfOperands(opcode)) { + // If the opcode has a variable number of operands, encode the number of + // operands with the instruction. + + if (logger_) logger_->AppendWhitespaces(kCommentNumWhitespaces); + + writer_.WriteVariableWidthU16(inst.num_operands, + model_->num_operands_chunk_length()); + } + } + + // Write operands. + const uint32_t num_operands = inst_.num_operands; + for (operand_index_ = 0; operand_index_ < num_operands; ++operand_index_) { + operand_ = inst_.operands[operand_index_]; + + if (logger_) { + logger_->AppendWhitespaces(kCommentNumWhitespaces); + logger_->AppendText("<"); + logger_->AppendText(spvOperandTypeStr(operand_.type)); + logger_->AppendText(">"); + } + + switch (operand_.type) { + case SPV_OPERAND_TYPE_RESULT_ID: + case SPV_OPERAND_TYPE_TYPE_ID: + case SPV_OPERAND_TYPE_ID: + case SPV_OPERAND_TYPE_OPTIONAL_ID: + case SPV_OPERAND_TYPE_SCOPE_ID: + case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: { + const uint32_t id = inst_.words[operand_.offset]; + if (operand_.type == SPV_OPERAND_TYPE_TYPE_ID) { + const spv_result_t result = EncodeTypeId(); + if (result != SPV_SUCCESS) return result; + } else if (operand_.type == SPV_OPERAND_TYPE_RESULT_ID) { + const spv_result_t result = EncodeResultId(); + if (result != SPV_SUCCESS) return result; + } else { + const spv_result_t result = EncodeRefId(id); + if (result != SPV_SUCCESS) return result; + } + + PromoteIfNeeded(id); + break; + } + + case SPV_OPERAND_TYPE_LITERAL_INTEGER: { + const spv_result_t result = + EncodeNonIdWord(inst_.words[operand_.offset]); + if (result != SPV_SUCCESS) return result; + break; + } + + case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: { + const spv_result_t result = EncodeLiteralNumber(operand_); + if (result != SPV_SUCCESS) return result; + break; + } + + case SPV_OPERAND_TYPE_LITERAL_STRING: { + const char* src = + reinterpret_cast(&inst_.words[operand_.offset]); + + auto* codec = model_->GetLiteralStringHuffmanCodec(opcode); + if (codec) { + uint64_t bits = 0; + size_t num_bits = 0; + const std::string str = src; + if (codec->Encode(str, &bits, &num_bits)) { + writer_.WriteBits(bits, num_bits); + break; + } else { + bool result = + codec->Encode("kMarkvNoneOfTheAbove", &bits, &num_bits); + (void)result; + assert(result); + writer_.WriteBits(bits, num_bits); + } + } + + const size_t length = spv_strnlen_s(src, operand_.num_words * 4); + if (length == operand_.num_words * 4) + return Diag(SPV_ERROR_INVALID_BINARY) + << "Failed to find terminal character of literal string"; + for (size_t i = 0; i < length + 1; ++i) writer_.WriteUnencoded(src[i]); + break; + } + + default: { + for (int i = 0; i < operand_.num_words; ++i) { + const uint32_t word = inst_.words[operand_.offset + i]; + const spv_result_t result = EncodeNonIdWord(word); + if (result != SPV_SUCCESS) return result; + } + break; + } + } + } + + AddByteBreak(kByteBreakAfterInstIfLessThanUntilNextByte); + + if (logger_) { + logger_->NewLine(); + logger_->NewLine(); + if (!logger_->DebugInstruction(inst_)) return SPV_REQUESTED_TERMINATION; + } + + ProcessCurInstruction(); + + return SPV_SUCCESS; +} + +spv_result_t MarkvDecoder::DecodeModule(std::vector* spirv_binary) { + const bool header_read_success = + reader_.ReadUnencoded(&header_.magic_number) && + reader_.ReadUnencoded(&header_.markv_version) && + reader_.ReadUnencoded(&header_.markv_model) && + reader_.ReadUnencoded(&header_.markv_length_in_bits) && + reader_.ReadUnencoded(&header_.spirv_version) && + reader_.ReadUnencoded(&header_.spirv_generator); + + if (!header_read_success) + return Diag(SPV_ERROR_INVALID_BINARY) << "Unable to read MARK-V header"; + + if (header_.markv_length_in_bits == 0) + return Diag(SPV_ERROR_INVALID_BINARY) + << "Header markv_length_in_bits field is zero"; + + if (header_.magic_number != kMarkvMagicNumber) + return Diag(SPV_ERROR_INVALID_BINARY) + << "MARK-V binary has incorrect magic number"; + + // TODO(atgoo@github.com): Print version strings. + if (header_.markv_version != GetMarkvVersion()) + return Diag(SPV_ERROR_INVALID_BINARY) + << "MARK-V binary and the codec have different versions"; + + const uint32_t model_type = header_.markv_model >> 16; + const uint32_t model_version = header_.markv_model & 0xFFFF; + if (model_type != model_->model_type()) + return Diag(SPV_ERROR_INVALID_BINARY) + << "MARK-V binary and the codec use different MARK-V models"; + + if (model_version != model_->model_version()) + return Diag(SPV_ERROR_INVALID_BINARY) + << "MARK-V binary and the codec use different versions if the same " + << "MARK-V model"; + + spirv_.reserve(header_.markv_length_in_bits / 2); // Heuristic. + spirv_.resize(5, 0); + spirv_[0] = kSpirvMagicNumber; + spirv_[1] = header_.spirv_version; + spirv_[2] = header_.spirv_generator; + + if (logger_) { + reader_.SetCallback( + [this](const std::string& str) { logger_->AppendBitSequence(str); }); + } + + while (reader_.GetNumReadBits() < header_.markv_length_in_bits) { + inst_ = {}; + const spv_result_t decode_result = DecodeInstruction(); + if (decode_result != SPV_SUCCESS) return decode_result; + + const spv_result_t validation_result = UpdateValidationState(inst_); + if (validation_result != SPV_SUCCESS) return validation_result; + } + + if (reader_.GetNumReadBits() != header_.markv_length_in_bits || + !reader_.OnlyZeroesLeft()) { + return Diag(SPV_ERROR_INVALID_BINARY) + << "MARK-V binary has wrong stated bit length " + << reader_.GetNumReadBits() << " " << header_.markv_length_in_bits; + } + + // Decoding of the module is finished, validation state should have correct + // id bound. + spirv_[3] = GetIdBound(); + + *spirv_binary = std::move(spirv_); + return SPV_SUCCESS; +} + +// TODO(atgoo@github.com): The implementation borrows heavily from +// Parser::parseOperand. +// Consider coupling them together in some way once MARK-V codec is more mature. +// For now it's better to keep the code independent for experimentation +// purposes. +spv_result_t MarkvDecoder::DecodeOperand( + size_t operand_offset, const spv_operand_type_t type, + spv_operand_pattern_t* expected_operands) { + const SpvOp opcode = static_cast(inst_.opcode); + + memset(&operand_, 0, sizeof(operand_)); + + assert((operand_offset >> 16) == 0); + operand_.offset = static_cast(operand_offset); + operand_.type = type; + + // Set default values, may be updated later. + operand_.number_kind = SPV_NUMBER_NONE; + operand_.number_bit_width = 0; + + const size_t first_word_index = inst_words_.size(); + + switch (type) { + case SPV_OPERAND_TYPE_RESULT_ID: { + const spv_result_t result = DecodeResultId(); + if (result != SPV_SUCCESS) return result; + + inst_words_.push_back(inst_.result_id); + SetIdBound(std::max(GetIdBound(), inst_.result_id + 1)); + PromoteIfNeeded(inst_.result_id); + break; + } + + case SPV_OPERAND_TYPE_TYPE_ID: { + const spv_result_t result = DecodeTypeId(); + if (result != SPV_SUCCESS) return result; + + inst_words_.push_back(inst_.type_id); + SetIdBound(std::max(GetIdBound(), inst_.type_id + 1)); + PromoteIfNeeded(inst_.type_id); + break; + } + + case SPV_OPERAND_TYPE_ID: + case SPV_OPERAND_TYPE_OPTIONAL_ID: + case SPV_OPERAND_TYPE_SCOPE_ID: + case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: { + uint32_t id = 0; + const spv_result_t result = DecodeRefId(&id); + if (result != SPV_SUCCESS) return result; + + if (id == 0) return Diag(SPV_ERROR_INVALID_BINARY) << "Decoded id is 0"; + + if (type == SPV_OPERAND_TYPE_ID || type == SPV_OPERAND_TYPE_OPTIONAL_ID) { + operand_.type = SPV_OPERAND_TYPE_ID; + + if (opcode == SpvOpExtInst && operand_.offset == 3) { + // The current word is the extended instruction set id. + // Set the extended instruction set type for the current + // instruction. + auto ext_inst_type_iter = import_id_to_ext_inst_type_.find(id); + if (ext_inst_type_iter == import_id_to_ext_inst_type_.end()) { + return Diag(SPV_ERROR_INVALID_ID) + << "OpExtInst set id " << id + << " does not reference an OpExtInstImport result Id"; + } + inst_.ext_inst_type = ext_inst_type_iter->second; + } + } + + inst_words_.push_back(id); + SetIdBound(std::max(GetIdBound(), id + 1)); + PromoteIfNeeded(id); + break; + } + + case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: { + uint32_t word = 0; + const spv_result_t result = DecodeNonIdWord(&word); + if (result != SPV_SUCCESS) return result; + + inst_words_.push_back(word); + + assert(SpvOpExtInst == opcode); + assert(inst_.ext_inst_type != SPV_EXT_INST_TYPE_NONE); + spv_ext_inst_desc ext_inst; + if (grammar_.lookupExtInst(inst_.ext_inst_type, word, &ext_inst)) + return Diag(SPV_ERROR_INVALID_BINARY) + << "Invalid extended instruction number: " << word; + spvPushOperandTypes(ext_inst->operandTypes, expected_operands); + break; + } + + case SPV_OPERAND_TYPE_LITERAL_INTEGER: + case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER: { + // These are regular single-word literal integer operands. + // Post-parsing validation should check the range of the parsed value. + operand_.type = SPV_OPERAND_TYPE_LITERAL_INTEGER; + // It turns out they are always unsigned integers! + operand_.number_kind = SPV_NUMBER_UNSIGNED_INT; + operand_.number_bit_width = 32; + + uint32_t word = 0; + const spv_result_t result = DecodeNonIdWord(&word); + if (result != SPV_SUCCESS) return result; + + inst_words_.push_back(word); + break; + } + + case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: + case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER: { + operand_.type = SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER; + if (opcode == SpvOpSwitch) { + // The literal operands have the same type as the value + // referenced by the selector Id. + const uint32_t selector_id = inst_words_.at(1); + const auto type_id_iter = id_to_type_id_.find(selector_id); + if (type_id_iter == id_to_type_id_.end() || type_id_iter->second == 0) { + return Diag(SPV_ERROR_INVALID_BINARY) + << "Invalid OpSwitch: selector id " << selector_id + << " has no type"; + } + uint32_t type_id = type_id_iter->second; + + if (selector_id == type_id) { + // Recall that by convention, a result ID that is a type definition + // maps to itself. + return Diag(SPV_ERROR_INVALID_BINARY) + << "Invalid OpSwitch: selector id " << selector_id + << " is a type, not a value"; + } + if (auto error = SetNumericTypeInfoForType(&operand_, type_id)) + return error; + if (operand_.number_kind != SPV_NUMBER_UNSIGNED_INT && + operand_.number_kind != SPV_NUMBER_SIGNED_INT) { + return Diag(SPV_ERROR_INVALID_BINARY) + << "Invalid OpSwitch: selector id " << selector_id + << " is not a scalar integer"; + } + } else { + assert(opcode == SpvOpConstant || opcode == SpvOpSpecConstant); + // The literal number type is determined by the type Id for the + // constant. + assert(inst_.type_id); + if (auto error = SetNumericTypeInfoForType(&operand_, inst_.type_id)) + return error; + } + + if (auto error = DecodeLiteralNumber(operand_)) return error; + + break; + } + + case SPV_OPERAND_TYPE_LITERAL_STRING: + case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING: { + operand_.type = SPV_OPERAND_TYPE_LITERAL_STRING; + std::vector str; + auto* codec = model_->GetLiteralStringHuffmanCodec(inst_.opcode); + + if (codec) { + std::string decoded_string; + const bool huffman_result = + codec->DecodeFromStream(GetReadBitCallback(), &decoded_string); + assert(huffman_result); + if (!huffman_result) + return Diag(SPV_ERROR_INVALID_BINARY) + << "Failed to read literal string"; + + if (decoded_string != "kMarkvNoneOfTheAbove") { + std::copy(decoded_string.begin(), decoded_string.end(), + std::back_inserter(str)); + str.push_back('\0'); + } + } + + // The loop is expected to terminate once we encounter '\0' or exhaust + // the bit stream. + if (str.empty()) { + while (true) { + char ch = 0; + if (!reader_.ReadUnencoded(&ch)) + return Diag(SPV_ERROR_INVALID_BINARY) + << "Failed to read literal string"; + + str.push_back(ch); + + if (ch == '\0') break; + } + } + + while (str.size() % 4 != 0) str.push_back('\0'); + + inst_words_.resize(inst_words_.size() + str.size() / 4); + std::memcpy(&inst_words_[first_word_index], str.data(), str.size()); + + if (SpvOpExtInstImport == opcode) { + // Record the extended instruction type for the ID for this import. + // There is only one string literal argument to OpExtInstImport, + // so it's sufficient to guard this just on the opcode. + const spv_ext_inst_type_t ext_inst_type = + spvExtInstImportTypeGet(str.data()); + if (SPV_EXT_INST_TYPE_NONE == ext_inst_type) { + return Diag(SPV_ERROR_INVALID_BINARY) + << "Invalid extended instruction import '" << str.data() + << "'"; + } + // We must have parsed a valid result ID. It's a condition + // of the grammar, and we only accept non-zero result Ids. + assert(inst_.result_id); + const bool inserted = + import_id_to_ext_inst_type_.emplace(inst_.result_id, ext_inst_type) + .second; + (void)inserted; + assert(inserted); + } + break; + } + + case SPV_OPERAND_TYPE_CAPABILITY: + case SPV_OPERAND_TYPE_SOURCE_LANGUAGE: + case SPV_OPERAND_TYPE_EXECUTION_MODEL: + case SPV_OPERAND_TYPE_ADDRESSING_MODEL: + case SPV_OPERAND_TYPE_MEMORY_MODEL: + case SPV_OPERAND_TYPE_EXECUTION_MODE: + case SPV_OPERAND_TYPE_STORAGE_CLASS: + case SPV_OPERAND_TYPE_DIMENSIONALITY: + case SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE: + case SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE: + case SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT: + case SPV_OPERAND_TYPE_FP_ROUNDING_MODE: + case SPV_OPERAND_TYPE_LINKAGE_TYPE: + case SPV_OPERAND_TYPE_ACCESS_QUALIFIER: + case SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER: + case SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE: + case SPV_OPERAND_TYPE_DECORATION: + case SPV_OPERAND_TYPE_BUILT_IN: + case SPV_OPERAND_TYPE_GROUP_OPERATION: + case SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS: + case SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO: { + // A single word that is a plain enum value. + uint32_t word = 0; + const spv_result_t result = DecodeNonIdWord(&word); + if (result != SPV_SUCCESS) return result; + + inst_words_.push_back(word); + + // Map an optional operand type to its corresponding concrete type. + if (type == SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER) + operand_.type = SPV_OPERAND_TYPE_ACCESS_QUALIFIER; + + spv_operand_desc entry; + if (grammar_.lookupOperand(type, word, &entry)) { + return Diag(SPV_ERROR_INVALID_BINARY) + << "Invalid " << spvOperandTypeStr(operand_.type) + << " operand: " << word; + } + + // Prepare to accept operands to this operand, if needed. + spvPushOperandTypes(entry->operandTypes, expected_operands); + break; + } + + case SPV_OPERAND_TYPE_FP_FAST_MATH_MODE: + case SPV_OPERAND_TYPE_FUNCTION_CONTROL: + case SPV_OPERAND_TYPE_LOOP_CONTROL: + case SPV_OPERAND_TYPE_IMAGE: + case SPV_OPERAND_TYPE_OPTIONAL_IMAGE: + case SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS: + case SPV_OPERAND_TYPE_SELECTION_CONTROL: { + // This operand is a mask. + uint32_t word = 0; + const spv_result_t result = DecodeNonIdWord(&word); + if (result != SPV_SUCCESS) return result; + + inst_words_.push_back(word); + + // Map an optional operand type to its corresponding concrete type. + if (type == SPV_OPERAND_TYPE_OPTIONAL_IMAGE) + operand_.type = SPV_OPERAND_TYPE_IMAGE; + else if (type == SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS) + operand_.type = SPV_OPERAND_TYPE_MEMORY_ACCESS; + + // Check validity of set mask bits. Also prepare for operands for those + // masks if they have any. To get operand order correct, scan from + // MSB to LSB since we can only prepend operands to a pattern. + // The only case in the grammar where you have more than one mask bit + // having an operand is for image operands. See SPIR-V 3.14 Image + // Operands. + uint32_t remaining_word = word; + for (uint32_t mask = (1u << 31); remaining_word; mask >>= 1) { + if (remaining_word & mask) { + spv_operand_desc entry; + if (grammar_.lookupOperand(type, mask, &entry)) { + return Diag(SPV_ERROR_INVALID_BINARY) + << "Invalid " << spvOperandTypeStr(operand_.type) + << " operand: " << word << " has invalid mask component " + << mask; + } + remaining_word ^= mask; + spvPushOperandTypes(entry->operandTypes, expected_operands); + } + } + if (word == 0) { + // An all-zeroes mask *might* also be valid. + spv_operand_desc entry; + if (SPV_SUCCESS == grammar_.lookupOperand(type, 0, &entry)) { + // Prepare for its operands, if any. + spvPushOperandTypes(entry->operandTypes, expected_operands); + } + } + break; + } + default: + return Diag(SPV_ERROR_INVALID_BINARY) + << "Internal error: Unhandled operand type: " << type; + } + + operand_.num_words = uint16_t(inst_words_.size() - first_word_index); + + assert(spvOperandIsConcrete(operand_.type)); + + parsed_operands_.push_back(operand_); + + return SPV_SUCCESS; +} + +spv_result_t MarkvDecoder::DecodeInstruction() { + parsed_operands_.clear(); + inst_words_.clear(); + + // Opcode/num_words placeholder, the word will be filled in later. + inst_words_.push_back(0); + + bool num_operands_still_unknown = true; + { + uint32_t opcode = 0; + uint32_t num_operands = 0; + + const spv_result_t opcode_decoding_result = + DecodeOpcodeAndNumberOfOperands(&opcode, &num_operands); + if (opcode_decoding_result < 0) return opcode_decoding_result; + + if (opcode_decoding_result == SPV_SUCCESS) { + inst_.num_operands = static_cast(num_operands); + num_operands_still_unknown = false; + } else { + if (!reader_.ReadVariableWidthU32(&opcode, + model_->opcode_chunk_length())) { + return Diag(SPV_ERROR_INVALID_BINARY) + << "Failed to read opcode of instruction"; + } + } + + inst_.opcode = static_cast(opcode); + } + + const SpvOp opcode = static_cast(inst_.opcode); + + spv_opcode_desc opcode_desc; + if (grammar_.lookupOpcode(opcode, &opcode_desc) != SPV_SUCCESS) { + return Diag(SPV_ERROR_INVALID_BINARY) << "Invalid opcode"; + } + + spv_operand_pattern_t expected_operands; + expected_operands.reserve(opcode_desc->numTypes); + for (auto i = 0; i < opcode_desc->numTypes; i++) { + expected_operands.push_back( + opcode_desc->operandTypes[opcode_desc->numTypes - i - 1]); + } + + if (num_operands_still_unknown) { + if (!OpcodeHasFixedNumberOfOperands(opcode)) { + if (!reader_.ReadVariableWidthU16(&inst_.num_operands, + model_->num_operands_chunk_length())) + return Diag(SPV_ERROR_INVALID_BINARY) + << "Failed to read num_operands of instruction"; + } else { + inst_.num_operands = static_cast(expected_operands.size()); + } + } + + for (operand_index_ = 0; + operand_index_ < static_cast(inst_.num_operands); + ++operand_index_) { + assert(!expected_operands.empty()); + const spv_operand_type_t type = + spvTakeFirstMatchableOperand(&expected_operands); + + const size_t operand_offset = inst_words_.size(); + + const spv_result_t decode_result = + DecodeOperand(operand_offset, type, &expected_operands); + + if (decode_result != SPV_SUCCESS) return decode_result; + } + + assert(inst_.num_operands == parsed_operands_.size()); + + // Only valid while inst_words_ and parsed_operands_ remain unchanged (until + // next DecodeInstruction call). + inst_.words = inst_words_.data(); + inst_.operands = parsed_operands_.empty() ? nullptr : parsed_operands_.data(); + inst_.num_words = static_cast(inst_words_.size()); + inst_words_[0] = spvOpcodeMake(inst_.num_words, SpvOp(inst_.opcode)); + + std::copy(inst_words_.begin(), inst_words_.end(), std::back_inserter(spirv_)); + + assert(inst_.num_words == + std::accumulate( + parsed_operands_.begin(), parsed_operands_.end(), 1, + [](int num_words, const spv_parsed_operand_t& operand) { + return num_words += operand.num_words; + }) && + "num_words in instruction doesn't correspond to the sum of num_words" + "in the operands"); + + RecordNumberType(); + ProcessCurInstruction(); + + if (!ReadToByteBreak(kByteBreakAfterInstIfLessThanUntilNextByte)) + return Diag(SPV_ERROR_INVALID_BINARY) << "Failed to read to byte break"; + + if (logger_) { + logger_->NewLine(); + std::stringstream ss; + ss << spvOpcodeString(opcode) << " "; + for (size_t index = 1; index < inst_words_.size(); ++index) + ss << inst_words_[index] << " "; + logger_->AppendText(ss.str()); + logger_->NewLine(); + logger_->NewLine(); + if (!logger_->DebugInstruction(inst_)) return SPV_REQUESTED_TERMINATION; + } + + return SPV_SUCCESS; +} + +spv_result_t MarkvDecoder::SetNumericTypeInfoForType( + spv_parsed_operand_t* parsed_operand, uint32_t type_id) { + assert(type_id != 0); + auto type_info_iter = type_id_to_number_type_info_.find(type_id); + if (type_info_iter == type_id_to_number_type_info_.end()) { + return Diag(SPV_ERROR_INVALID_BINARY) + << "Type Id " << type_id << " is not a type"; + } + + const NumberType& info = type_info_iter->second; + if (info.type == SPV_NUMBER_NONE) { + // This is a valid type, but for something other than a scalar number. + return Diag(SPV_ERROR_INVALID_BINARY) + << "Type Id " << type_id << " is not a scalar numeric type"; + } + + parsed_operand->number_kind = info.type; + parsed_operand->number_bit_width = info.bit_width; + // Round up the word count. + parsed_operand->num_words = static_cast((info.bit_width + 31) / 32); + return SPV_SUCCESS; +} + +void MarkvDecoder::RecordNumberType() { + const SpvOp opcode = static_cast(inst_.opcode); + if (spvOpcodeGeneratesType(opcode)) { + NumberType info = {SPV_NUMBER_NONE, 0}; + if (SpvOpTypeInt == opcode) { + info.bit_width = inst_.words[inst_.operands[1].offset]; + info.type = inst_.words[inst_.operands[2].offset] + ? SPV_NUMBER_SIGNED_INT + : SPV_NUMBER_UNSIGNED_INT; + } else if (SpvOpTypeFloat == opcode) { + info.bit_width = inst_.words[inst_.operands[1].offset]; + info.type = SPV_NUMBER_FLOATING; + } + // The *result* Id of a type generating instruction is the type Id. + type_id_to_number_type_info_[inst_.result_id] = info; + } +} + +spv_result_t EncodeHeader(void* user_data, spv_endianness_t endian, + uint32_t magic, uint32_t version, uint32_t generator, + uint32_t id_bound, uint32_t schema) { + MarkvEncoder* encoder = reinterpret_cast(user_data); + return encoder->EncodeHeader(endian, magic, version, generator, id_bound, + schema); +} + +spv_result_t EncodeInstruction(void* user_data, + const spv_parsed_instruction_t* inst) { + MarkvEncoder* encoder = reinterpret_cast(user_data); + return encoder->EncodeInstruction(*inst); +} + +} // namespace + +spv_result_t SpirvToMarkv( + spv_const_context context, const std::vector& spirv, + const MarkvCodecOptions& options, const MarkvModel& markv_model, + MessageConsumer message_consumer, MarkvLogConsumer log_consumer, + MarkvDebugConsumer debug_consumer, std::vector* markv) { + spv_context_t hijack_context = *context; + libspirv::SetContextMessageConsumer(&hijack_context, message_consumer); + + spv_const_binary_t spirv_binary = {spirv.data(), spirv.size()}; + + spv_endianness_t endian; + spv_position_t position = {}; + if (spvBinaryEndianness(&spirv_binary, &endian)) { + return DiagnosticStream(position, hijack_context.consumer, + SPV_ERROR_INVALID_BINARY) + << "Invalid SPIR-V magic number."; + } + + spv_header_t header; + if (spvBinaryHeaderGet(&spirv_binary, endian, &header)) { + return DiagnosticStream(position, hijack_context.consumer, + SPV_ERROR_INVALID_BINARY) + << "Invalid SPIR-V header."; + } + + MarkvEncoder encoder(&hijack_context, options, &markv_model); + + if (log_consumer || debug_consumer) { + encoder.CreateLogger(log_consumer, debug_consumer); + + spv_text text = nullptr; + if (spvBinaryToText(&hijack_context, spirv.data(), spirv.size(), + SPV_BINARY_TO_TEXT_OPTION_NO_HEADER, &text, + nullptr) != SPV_SUCCESS) { + return DiagnosticStream(position, hijack_context.consumer, + SPV_ERROR_INVALID_BINARY) + << "Failed to disassemble SPIR-V binary."; + } + assert(text); + encoder.SetDisassembly(std::string(text->str, text->length)); + spvTextDestroy(text); + } + + if (spvBinaryParse(&hijack_context, &encoder, spirv.data(), spirv.size(), + EncodeHeader, EncodeInstruction, nullptr) != SPV_SUCCESS) { + return DiagnosticStream(position, hijack_context.consumer, + SPV_ERROR_INVALID_BINARY) + << "Unable to encode to MARK-V."; + } + + *markv = encoder.GetMarkvBinary(); + return SPV_SUCCESS; +} + +spv_result_t MarkvToSpirv( + spv_const_context context, const std::vector& markv, + const MarkvCodecOptions& options, const MarkvModel& markv_model, + MessageConsumer message_consumer, MarkvLogConsumer log_consumer, + MarkvDebugConsumer debug_consumer, std::vector* spirv) { + spv_position_t position = {}; + spv_context_t hijack_context = *context; + libspirv::SetContextMessageConsumer(&hijack_context, message_consumer); + + MarkvDecoder decoder(&hijack_context, markv, options, &markv_model); + + if (log_consumer || debug_consumer) + decoder.CreateLogger(log_consumer, debug_consumer); + + if (decoder.DecodeModule(spirv) != SPV_SUCCESS) { + return DiagnosticStream(position, hijack_context.consumer, + SPV_ERROR_INVALID_BINARY) + << "Unable to decode MARK-V."; + } + + assert(!spirv->empty()); + return SPV_SUCCESS; +} + +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/comp/markv.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/comp/markv.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/comp/markv.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/comp/markv.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,74 @@ +// Copyright (c) 2017 Google 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. + +// MARK-V is a compression format for SPIR-V binaries. It strips away +// non-essential information (such as result ids which can be regenerated) and +// uses various bit reduction techiniques to reduce the size of the binary and +// make it more similar to other compressed SPIR-V files to further improve +// compression of the dataset. + +#ifndef SPIRV_TOOLS_MARKV_HPP_ +#define SPIRV_TOOLS_MARKV_HPP_ + +#include +#include + +#include "markv_model.h" +#include "spirv-tools/libspirv.hpp" + +namespace spvtools { + +struct MarkvCodecOptions { + bool validate_spirv_binary = false; +}; + +// Debug callback. Called once per instruction. +// |words| is instruction SPIR-V words. +// |bits| is a textual representation of the MARK-V bit sequence used to encode +// the instruction (char '0' for 0, char '1' for 1). +// |comment| contains all logs generated while processing the instruction. +using MarkvDebugConsumer = + std::function& words, + const std::string& bits, const std::string& comment)>; + +// Logging callback. Called often (if decoder reads a single bit, the log +// consumer will receive 1 character string with that bit). +// This callback is more suitable for continous output than MarkvDebugConsumer, +// for example if the codec crashes it would allow to pinpoint on which operand +// or bit the crash happened. +// |snippet| could be any atomic fragment of text logged by the codec. It can +// contain a paragraph of text with newlines, or can be just one character. +using MarkvLogConsumer = std::function; + +// Encodes the given SPIR-V binary to MARK-V binary. +// |log_consumer| is optional (pass MarkvLogConsumer() to disable). +// |debug_consumer| is optional (pass MarkvDebugConsumer() to disable). +spv_result_t SpirvToMarkv( + spv_const_context context, const std::vector& spirv, + const MarkvCodecOptions& options, const MarkvModel& markv_model, + MessageConsumer message_consumer, MarkvLogConsumer log_consumer, + MarkvDebugConsumer debug_consumer, std::vector* markv); + +// Decodes a SPIR-V binary from the given MARK-V binary. +// |log_consumer| is optional (pass MarkvLogConsumer() to disable). +// |debug_consumer| is optional (pass MarkvDebugConsumer() to disable). +spv_result_t MarkvToSpirv( + spv_const_context context, const std::vector& markv, + const MarkvCodecOptions& options, const MarkvModel& markv_model, + MessageConsumer message_consumer, MarkvLogConsumer log_consumer, + MarkvDebugConsumer debug_consumer, std::vector* spirv); + +} // namespace spvtools + +#endif // SPIRV_TOOLS_MARKV_HPP_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/comp/markv_model.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/comp/markv_model.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/comp/markv_model.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/comp/markv_model.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,232 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_COMP_MARKV_MODEL_H_ +#define LIBSPIRV_COMP_MARKV_MODEL_H_ + +#include +#include +#include + +#include "latest_version_spirv_header.h" +#include "spirv-tools/libspirv.h" +#include "util/huffman_codec.h" + +namespace spvtools { + +// Base class for MARK-V models. +// The class contains encoding/decoding model with various constants and +// codecs used by the compression algorithm. +class MarkvModel { + public: + MarkvModel() + : operand_chunk_lengths_( + static_cast(SPV_OPERAND_TYPE_NUM_OPERAND_TYPES), 0) { + // Set default values. + operand_chunk_lengths_[SPV_OPERAND_TYPE_TYPE_ID] = 4; + operand_chunk_lengths_[SPV_OPERAND_TYPE_RESULT_ID] = 8; + operand_chunk_lengths_[SPV_OPERAND_TYPE_ID] = 8; + operand_chunk_lengths_[SPV_OPERAND_TYPE_SCOPE_ID] = 8; + operand_chunk_lengths_[SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID] = 8; + operand_chunk_lengths_[SPV_OPERAND_TYPE_LITERAL_INTEGER] = 6; + operand_chunk_lengths_[SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER] = 6; + operand_chunk_lengths_[SPV_OPERAND_TYPE_CAPABILITY] = 6; + operand_chunk_lengths_[SPV_OPERAND_TYPE_SOURCE_LANGUAGE] = 3; + operand_chunk_lengths_[SPV_OPERAND_TYPE_EXECUTION_MODEL] = 3; + operand_chunk_lengths_[SPV_OPERAND_TYPE_ADDRESSING_MODEL] = 2; + operand_chunk_lengths_[SPV_OPERAND_TYPE_MEMORY_MODEL] = 2; + operand_chunk_lengths_[SPV_OPERAND_TYPE_EXECUTION_MODE] = 6; + operand_chunk_lengths_[SPV_OPERAND_TYPE_STORAGE_CLASS] = 4; + operand_chunk_lengths_[SPV_OPERAND_TYPE_DIMENSIONALITY] = 3; + operand_chunk_lengths_[SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE] = 3; + operand_chunk_lengths_[SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE] = 2; + operand_chunk_lengths_[SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT] = 6; + operand_chunk_lengths_[SPV_OPERAND_TYPE_FP_ROUNDING_MODE] = 2; + operand_chunk_lengths_[SPV_OPERAND_TYPE_LINKAGE_TYPE] = 2; + operand_chunk_lengths_[SPV_OPERAND_TYPE_ACCESS_QUALIFIER] = 2; + operand_chunk_lengths_[SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER] = 2; + operand_chunk_lengths_[SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE] = 3; + operand_chunk_lengths_[SPV_OPERAND_TYPE_DECORATION] = 6; + operand_chunk_lengths_[SPV_OPERAND_TYPE_BUILT_IN] = 6; + operand_chunk_lengths_[SPV_OPERAND_TYPE_GROUP_OPERATION] = 2; + operand_chunk_lengths_[SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS] = 2; + operand_chunk_lengths_[SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO] = 2; + operand_chunk_lengths_[SPV_OPERAND_TYPE_FP_FAST_MATH_MODE] = 4; + operand_chunk_lengths_[SPV_OPERAND_TYPE_FUNCTION_CONTROL] = 4; + operand_chunk_lengths_[SPV_OPERAND_TYPE_LOOP_CONTROL] = 4; + operand_chunk_lengths_[SPV_OPERAND_TYPE_IMAGE] = 4; + operand_chunk_lengths_[SPV_OPERAND_TYPE_OPTIONAL_IMAGE] = 4; + operand_chunk_lengths_[SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS] = 4; + operand_chunk_lengths_[SPV_OPERAND_TYPE_SELECTION_CONTROL] = 4; + operand_chunk_lengths_[SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER] = 6; + operand_chunk_lengths_[SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER] = 6; + } + + uint32_t model_type() const { return model_type_; } + uint32_t model_version() const { return model_version_; } + + uint32_t opcode_chunk_length() const { return opcode_chunk_length_; } + uint32_t num_operands_chunk_length() const { + return num_operands_chunk_length_; + } + uint32_t mtf_rank_chunk_length() const { return mtf_rank_chunk_length_; } + + uint32_t u64_chunk_length() const { return u64_chunk_length_; } + uint32_t s64_chunk_length() const { return s64_chunk_length_; } + uint32_t s64_block_exponent() const { return s64_block_exponent_; } + + enum class IdFallbackStrategy { + kRuleBased = 0, + kShortDescriptor, + }; + + IdFallbackStrategy id_fallback_strategy() const { + return id_fallback_strategy_; + } + + // Returns a codec for common opcode_and_num_operands words for the given + // previous opcode. May return nullptr if the codec doesn't exist. + const spvutils::HuffmanCodec* + GetOpcodeAndNumOperandsMarkovHuffmanCodec(uint32_t prev_opcode) const { + if (prev_opcode == SpvOpNop) + return opcode_and_num_operands_huffman_codec_.get(); + + const auto it = + opcode_and_num_operands_markov_huffman_codecs_.find(prev_opcode); + if (it == opcode_and_num_operands_markov_huffman_codecs_.end()) + return nullptr; + return it->second.get(); + } + + // Returns a codec for common non-id words used for given operand slot. + // Operand slot is defined by the opcode and the operand index. + // May return nullptr if the codec doesn't exist. + const spvutils::HuffmanCodec* GetNonIdWordHuffmanCodec( + uint32_t opcode, uint32_t operand_index) const { + const auto it = non_id_word_huffman_codecs_.find( + std::pair(opcode, operand_index)); + if (it == non_id_word_huffman_codecs_.end()) return nullptr; + return it->second.get(); + } + + // Returns a codec for common id descriptos used for given operand slot. + // Operand slot is defined by the opcode and the operand index. + // May return nullptr if the codec doesn't exist. + const spvutils::HuffmanCodec* GetIdDescriptorHuffmanCodec( + uint32_t opcode, uint32_t operand_index) const { + const auto it = id_descriptor_huffman_codecs_.find( + std::pair(opcode, operand_index)); + if (it == id_descriptor_huffman_codecs_.end()) return nullptr; + return it->second.get(); + } + + // Returns a codec for common strings used by the given opcode. + // Operand slot is defined by the opcode and the operand index. + // May return nullptr if the codec doesn't exist. + const spvutils::HuffmanCodec* GetLiteralStringHuffmanCodec( + uint32_t opcode) const { + const auto it = literal_string_huffman_codecs_.find(opcode); + if (it == literal_string_huffman_codecs_.end()) return nullptr; + return it->second.get(); + } + + // Checks if |descriptor| has a coding scheme in any of + // id_descriptor_huffman_codecs_. + bool DescriptorHasCodingScheme(uint32_t descriptor) const { + return descriptors_with_coding_scheme_.count(descriptor); + } + + // Checks if any descriptor has a coding scheme. + bool AnyDescriptorHasCodingScheme() const { + return !descriptors_with_coding_scheme_.empty(); + } + + // Returns chunk length used for variable length encoding of spirv operand + // words. + uint32_t GetOperandVariableWidthChunkLength(spv_operand_type_t type) const { + return operand_chunk_lengths_.at(static_cast(type)); + } + + // Sets model type. + void SetModelType(uint32_t in_model_type) { model_type_ = in_model_type; } + + // Sets model version. + void SetModelVersion(uint32_t in_model_version) { + model_version_ = in_model_version; + } + + // Returns value used by Huffman codecs as a signal that a value is not in the + // coding table. + static uint64_t GetMarkvNoneOfTheAbove() { + // Magic number. + return 1111111111111111111; + } + + MarkvModel(const MarkvModel&) = delete; + const MarkvModel& operator=(const MarkvModel&) = delete; + + protected: + // Huffman codec for base-rate of opcode_and_num_operands. + std::unique_ptr> + opcode_and_num_operands_huffman_codec_; + + // Huffman codecs for opcode_and_num_operands. The map key is previous opcode. + std::map>> + opcode_and_num_operands_markov_huffman_codecs_; + + // Huffman codecs for non-id single-word operand values. + // The map key is pair . + std::map, + std::unique_ptr>> + non_id_word_huffman_codecs_; + + // Huffman codecs for id descriptors. The map key is pair + // . + std::map, + std::unique_ptr>> + id_descriptor_huffman_codecs_; + + // Set of all descriptors which have a coding scheme in any of + // id_descriptor_huffman_codecs_. + std::unordered_set descriptors_with_coding_scheme_; + + // Huffman codecs for literal strings. The map key is the opcode of the + // current instruction. This assumes, that there is no more than one literal + // string operand per instruction, but would still work even if this is not + // the case. Names and debug information strings are not collected. + std::map>> + literal_string_huffman_codecs_; + + // Chunk lengths used for variable width encoding of operands (index is + // spv_operand_type of the operand). + std::vector operand_chunk_lengths_; + + uint32_t opcode_chunk_length_ = 7; + uint32_t num_operands_chunk_length_ = 3; + uint32_t mtf_rank_chunk_length_ = 5; + + uint32_t u64_chunk_length_ = 8; + uint32_t s64_chunk_length_ = 8; + uint32_t s64_block_exponent_ = 10; + + IdFallbackStrategy id_fallback_strategy_ = + IdFallbackStrategy::kShortDescriptor; + + uint32_t model_type_ = 0; + uint32_t model_version_ = 0; +}; + +} // namespace spvtools + +#endif // LIBSPIRV_COMP_MARKV_MODEL_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/diagnostic.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/diagnostic.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/diagnostic.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/diagnostic.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,186 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "diagnostic.h" + +#include +#include +#include +#include + +#include "table.h" + +// Diagnostic API + +spv_diagnostic spvDiagnosticCreate(const spv_position position, + const char* message) { + spv_diagnostic diagnostic = new spv_diagnostic_t; + if (!diagnostic) return nullptr; + size_t length = strlen(message) + 1; + diagnostic->error = new char[length]; + if (!diagnostic->error) { + delete diagnostic; + return nullptr; + } + diagnostic->position = *position; + diagnostic->isTextSource = false; + memset(diagnostic->error, 0, length); + strncpy(diagnostic->error, message, length); + return diagnostic; +} + +void spvDiagnosticDestroy(spv_diagnostic diagnostic) { + if (!diagnostic) return; + delete[] diagnostic->error; + delete diagnostic; +} + +spv_result_t spvDiagnosticPrint(const spv_diagnostic diagnostic) { + if (!diagnostic) return SPV_ERROR_INVALID_DIAGNOSTIC; + + if (diagnostic->isTextSource) { + // NOTE: This is a text position + // NOTE: add 1 to the line as editors start at line 1, we are counting new + // line characters to start at line 0 + std::cerr << "error: " << diagnostic->position.line + 1 << ": " + << diagnostic->position.column + 1 << ": " << diagnostic->error + << "\n"; + return SPV_SUCCESS; + } else { + // NOTE: Assume this is a binary position + std::cerr << "error: " << diagnostic->position.index << ": " + << diagnostic->error << "\n"; + return SPV_SUCCESS; + } +} + +namespace libspirv { + +DiagnosticStream::DiagnosticStream(DiagnosticStream&& other) + : stream_(), + position_(other.position_), + consumer_(other.consumer_), + error_(other.error_) { + // Prevent the other object from emitting output during destruction. + other.error_ = SPV_FAILED_MATCH; + // Some platforms are missing support for std::ostringstream functionality, + // including: move constructor, swap method. Either would have been a + // better choice than copying the string. + stream_ << other.stream_.str(); +} + +DiagnosticStream::~DiagnosticStream() { + if (error_ != SPV_FAILED_MATCH && consumer_ != nullptr) { + auto level = SPV_MSG_ERROR; + switch (error_) { + case SPV_SUCCESS: + case SPV_REQUESTED_TERMINATION: // Essentially success. + level = SPV_MSG_INFO; + break; + case SPV_WARNING: + level = SPV_MSG_WARNING; + break; + case SPV_UNSUPPORTED: + case SPV_ERROR_INTERNAL: + case SPV_ERROR_INVALID_TABLE: + level = SPV_MSG_INTERNAL_ERROR; + break; + case SPV_ERROR_OUT_OF_MEMORY: + level = SPV_MSG_FATAL; + break; + default: + break; + } + consumer_(level, "input", position_, stream_.str().c_str()); + } +} + +void UseDiagnosticAsMessageConsumer(spv_context context, + spv_diagnostic* diagnostic) { + assert(diagnostic && *diagnostic == nullptr); + + auto create_diagnostic = [diagnostic](spv_message_level_t, const char*, + const spv_position_t& position, + const char* message) { + auto p = position; + spvDiagnosticDestroy(*diagnostic); // Avoid memory leak. + *diagnostic = spvDiagnosticCreate(&p, message); + }; + libspirv::SetContextMessageConsumer(context, std::move(create_diagnostic)); +} + +std::string spvResultToString(spv_result_t res) { + std::string out; + switch (res) { + case SPV_SUCCESS: + out = "SPV_SUCCESS"; + break; + case SPV_UNSUPPORTED: + out = "SPV_UNSUPPORTED"; + break; + case SPV_END_OF_STREAM: + out = "SPV_END_OF_STREAM"; + break; + case SPV_WARNING: + out = "SPV_WARNING"; + break; + case SPV_FAILED_MATCH: + out = "SPV_FAILED_MATCH"; + break; + case SPV_REQUESTED_TERMINATION: + out = "SPV_REQUESTED_TERMINATION"; + break; + case SPV_ERROR_INTERNAL: + out = "SPV_ERROR_INTERNAL"; + break; + case SPV_ERROR_OUT_OF_MEMORY: + out = "SPV_ERROR_OUT_OF_MEMORY"; + break; + case SPV_ERROR_INVALID_POINTER: + out = "SPV_ERROR_INVALID_POINTER"; + break; + case SPV_ERROR_INVALID_BINARY: + out = "SPV_ERROR_INVALID_BINARY"; + break; + case SPV_ERROR_INVALID_TEXT: + out = "SPV_ERROR_INVALID_TEXT"; + break; + case SPV_ERROR_INVALID_TABLE: + out = "SPV_ERROR_INVALID_TABLE"; + break; + case SPV_ERROR_INVALID_VALUE: + out = "SPV_ERROR_INVALID_VALUE"; + break; + case SPV_ERROR_INVALID_DIAGNOSTIC: + out = "SPV_ERROR_INVALID_DIAGNOSTIC"; + break; + case SPV_ERROR_INVALID_LOOKUP: + out = "SPV_ERROR_INVALID_LOOKUP"; + break; + case SPV_ERROR_INVALID_ID: + out = "SPV_ERROR_INVALID_ID"; + break; + case SPV_ERROR_INVALID_CFG: + out = "SPV_ERROR_INVALID_CFG"; + break; + case SPV_ERROR_INVALID_LAYOUT: + out = "SPV_ERROR_INVALID_LAYOUT"; + break; + default: + out = "Unknown Error"; + } + return out; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/diagnostic.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/diagnostic.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/diagnostic.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/diagnostic.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_DIAGNOSTIC_H_ +#define LIBSPIRV_DIAGNOSTIC_H_ + +#include +#include + +#include "spirv-tools/libspirv.hpp" + +namespace libspirv { + +// A DiagnosticStream remembers the current position of the input and an error +// code, and captures diagnostic messages via the left-shift operator. +// If the error code is not SPV_FAILED_MATCH, then captured messages are +// emitted during the destructor. +class DiagnosticStream { + public: + DiagnosticStream(spv_position_t position, + const spvtools::MessageConsumer& consumer, + spv_result_t error) + : position_(position), consumer_(consumer), error_(error) {} + + // Creates a DiagnosticStream from an expiring DiagnosticStream. + // The new object takes the contents of the other, and prevents the + // other from emitting anything during destruction. + DiagnosticStream(DiagnosticStream&& other); + + // Destroys a DiagnosticStream. + // If its status code is something other than SPV_FAILED_MATCH + // then emit the accumulated message to the consumer. + ~DiagnosticStream(); + + // Adds the given value to the diagnostic message to be written. + template + DiagnosticStream& operator<<(const T& val) { + stream_ << val; + return *this; + } + + // Conversion operator to spv_result, returning the error code. + operator spv_result_t() { return error_; } + + private: + std::ostringstream stream_; + spv_position_t position_; + spvtools::MessageConsumer consumer_; // Message consumer callback. + spv_result_t error_; +}; + +// Changes the MessageConsumer in |context| to one that updates |diagnostic| +// with the last message received. +// +// This function expects that |diagnostic| is not nullptr and its content is a +// nullptr. +void UseDiagnosticAsMessageConsumer(spv_context context, + spv_diagnostic* diagnostic); + +std::string spvResultToString(spv_result_t res); + +} // namespace libspirv + +#endif // LIBSPIRV_DIAGNOSTIC_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/disassemble.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/disassemble.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/disassemble.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/disassemble.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,476 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file contains a disassembler: It converts a SPIR-V binary +// to text. + +#include +#include +#include +#include +#include +#include + +#include "assembly_grammar.h" +#include "binary.h" +#include "diagnostic.h" +#include "disassemble.h" +#include "ext_inst.h" +#include "name_mapper.h" +#include "opcode.h" +#include "parsed_operand.h" +#include "print.h" +#include "spirv-tools/libspirv.h" +#include "spirv_constant.h" +#include "spirv_endian.h" +#include "util/hex_float.h" + +namespace { + +// A Disassembler instance converts a SPIR-V binary to its assembly +// representation. +class Disassembler { + public: + Disassembler(const libspirv::AssemblyGrammar& grammar, uint32_t options, + libspirv::NameMapper name_mapper) + : grammar_(grammar), + print_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_PRINT, options)), + color_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_COLOR, options)), + indent_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_INDENT, options) + ? kStandardIndent + : 0), + text_(), + out_(print_ ? out_stream() : out_stream(text_)), + stream_(out_.get()), + header_(!spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER, options)), + show_byte_offset_(spvIsInBitfield( + SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET, options)), + byte_offset_(0), + name_mapper_(std::move(name_mapper)) {} + + // Emits the assembly header for the module, and sets up internal state + // so subsequent callbacks can handle the cases where the entire module + // is either big-endian or little-endian. + spv_result_t HandleHeader(spv_endianness_t endian, uint32_t version, + uint32_t generator, uint32_t id_bound, + uint32_t schema); + // Emits the assembly text for the given instruction. + spv_result_t HandleInstruction(const spv_parsed_instruction_t& inst); + + // If not printing, populates text_result with the accumulated text. + // Returns SPV_SUCCESS on success. + spv_result_t SaveTextResult(spv_text* text_result) const; + + private: + enum { kStandardIndent = 15 }; + + using out_stream = libspirv::out_stream; + + // Emits an operand for the given instruction, where the instruction + // is at offset words from the start of the binary. + void EmitOperand(const spv_parsed_instruction_t& inst, + const uint16_t operand_index); + + // Emits a mask expression for the given mask word of the specified type. + void EmitMaskOperand(const spv_operand_type_t type, const uint32_t word); + + // Resets the output color, if color is turned on. + void ResetColor() { + if (color_) out_.get() << libspirv::clr::reset{print_}; + } + // Sets the output to grey, if color is turned on. + void SetGrey() { + if (color_) out_.get() << libspirv::clr::grey{print_}; + } + // Sets the output to blue, if color is turned on. + void SetBlue() { + if (color_) out_.get() << libspirv::clr::blue{print_}; + } + // Sets the output to yellow, if color is turned on. + void SetYellow() { + if (color_) out_.get() << libspirv::clr::yellow{print_}; + } + // Sets the output to red, if color is turned on. + void SetRed() { + if (color_) out_.get() << libspirv::clr::red{print_}; + } + // Sets the output to green, if color is turned on. + void SetGreen() { + if (color_) out_.get() << libspirv::clr::green{print_}; + } + + const libspirv::AssemblyGrammar& grammar_; + const bool print_; // Should we also print to the standard output stream? + const bool color_; // Should we print in colour? + const int indent_; // How much to indent. 0 means don't indent + spv_endianness_t endian_; // The detected endianness of the binary. + std::stringstream text_; // Captures the text, if not printing. + out_stream out_; // The Output stream. Either to text_ or standard output. + std::ostream& stream_; // The output std::stream. + const bool header_; // Should we output header as the leading comment? + const bool show_byte_offset_; // Should we print byte offset, in hex? + size_t byte_offset_; // The number of bytes processed so far. + libspirv::NameMapper name_mapper_; +}; + +spv_result_t Disassembler::HandleHeader(spv_endianness_t endian, + uint32_t version, uint32_t generator, + uint32_t id_bound, uint32_t schema) { + endian_ = endian; + + if (header_) { + SetGrey(); + const char* generator_tool = + spvGeneratorStr(SPV_GENERATOR_TOOL_PART(generator)); + stream_ << "; SPIR-V\n" + << "; Version: " << SPV_SPIRV_VERSION_MAJOR_PART(version) << "." + << SPV_SPIRV_VERSION_MINOR_PART(version) << "\n" + << "; Generator: " << generator_tool; + // For unknown tools, print the numeric tool value. + if (0 == strcmp("Unknown", generator_tool)) { + stream_ << "(" << SPV_GENERATOR_TOOL_PART(generator) << ")"; + } + // Print the miscellaneous part of the generator word on the same + // line as the tool name. + stream_ << "; " << SPV_GENERATOR_MISC_PART(generator) << "\n" + << "; Bound: " << id_bound << "\n" + << "; Schema: " << schema << "\n"; + ResetColor(); + } + + byte_offset_ = SPV_INDEX_INSTRUCTION * sizeof(uint32_t); + + return SPV_SUCCESS; +} + +spv_result_t Disassembler::HandleInstruction( + const spv_parsed_instruction_t& inst) { + if (inst.result_id) { + SetBlue(); + const std::string id_name = name_mapper_(inst.result_id); + if (indent_) + stream_ << std::setw(std::max(0, indent_ - 3 - int(id_name.size()))); + stream_ << "%" << id_name; + ResetColor(); + stream_ << " = "; + } else { + stream_ << std::string(indent_, ' '); + } + + stream_ << "Op" << spvOpcodeString(static_cast(inst.opcode)); + + for (uint16_t i = 0; i < inst.num_operands; i++) { + const spv_operand_type_t type = inst.operands[i].type; + assert(type != SPV_OPERAND_TYPE_NONE); + if (type == SPV_OPERAND_TYPE_RESULT_ID) continue; + stream_ << " "; + EmitOperand(inst, i); + } + + if (show_byte_offset_) { + SetGrey(); + auto saved_flags = stream_.flags(); + auto saved_fill = stream_.fill(); + stream_ << " ; 0x" << std::setw(8) << std::hex << std::setfill('0') + << byte_offset_; + stream_.flags(saved_flags); + stream_.fill(saved_fill); + ResetColor(); + } + + byte_offset_ += inst.num_words * sizeof(uint32_t); + + stream_ << "\n"; + return SPV_SUCCESS; +} + +void Disassembler::EmitOperand(const spv_parsed_instruction_t& inst, + const uint16_t operand_index) { + assert(operand_index < inst.num_operands); + const spv_parsed_operand_t& operand = inst.operands[operand_index]; + const uint32_t word = inst.words[operand.offset]; + switch (operand.type) { + case SPV_OPERAND_TYPE_RESULT_ID: + assert(false && " is not supposed to be handled here"); + SetBlue(); + stream_ << "%" << name_mapper_(word); + break; + case SPV_OPERAND_TYPE_ID: + case SPV_OPERAND_TYPE_TYPE_ID: + case SPV_OPERAND_TYPE_SCOPE_ID: + case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: + SetYellow(); + stream_ << "%" << name_mapper_(word); + break; + case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: { + spv_ext_inst_desc ext_inst; + if (grammar_.lookupExtInst(inst.ext_inst_type, word, &ext_inst)) + assert(false && "should have caught this earlier"); + SetRed(); + stream_ << ext_inst->name; + } break; + case SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER: { + spv_opcode_desc opcode_desc; + if (grammar_.lookupOpcode(SpvOp(word), &opcode_desc)) + assert(false && "should have caught this earlier"); + SetRed(); + stream_ << opcode_desc->name; + } break; + case SPV_OPERAND_TYPE_LITERAL_INTEGER: + case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: { + SetRed(); + libspirv::EmitNumericLiteral(&stream_, inst, operand); + ResetColor(); + } break; + case SPV_OPERAND_TYPE_LITERAL_STRING: { + stream_ << "\""; + SetGreen(); + // Strings are always little-endian, and null-terminated. + // Write out the characters, escaping as needed, and without copying + // the entire string. + auto c_str = reinterpret_cast(inst.words + operand.offset); + for (auto p = c_str; *p; ++p) { + if (*p == '"' || *p == '\\') stream_ << '\\'; + stream_ << *p; + } + ResetColor(); + stream_ << '"'; + } break; + case SPV_OPERAND_TYPE_CAPABILITY: + case SPV_OPERAND_TYPE_SOURCE_LANGUAGE: + case SPV_OPERAND_TYPE_EXECUTION_MODEL: + case SPV_OPERAND_TYPE_ADDRESSING_MODEL: + case SPV_OPERAND_TYPE_MEMORY_MODEL: + case SPV_OPERAND_TYPE_EXECUTION_MODE: + case SPV_OPERAND_TYPE_STORAGE_CLASS: + case SPV_OPERAND_TYPE_DIMENSIONALITY: + case SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE: + case SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE: + case SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT: + case SPV_OPERAND_TYPE_FP_ROUNDING_MODE: + case SPV_OPERAND_TYPE_LINKAGE_TYPE: + case SPV_OPERAND_TYPE_ACCESS_QUALIFIER: + case SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE: + case SPV_OPERAND_TYPE_DECORATION: + case SPV_OPERAND_TYPE_BUILT_IN: + case SPV_OPERAND_TYPE_GROUP_OPERATION: + case SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS: + case SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO: + case SPV_OPERAND_TYPE_DEBUG_BASE_TYPE_ATTRIBUTE_ENCODING: + case SPV_OPERAND_TYPE_DEBUG_COMPOSITE_TYPE: + case SPV_OPERAND_TYPE_DEBUG_TYPE_QUALIFIER: + case SPV_OPERAND_TYPE_DEBUG_OPERATION: { + spv_operand_desc entry; + if (grammar_.lookupOperand(operand.type, word, &entry)) + assert(false && "should have caught this earlier"); + stream_ << entry->name; + } break; + case SPV_OPERAND_TYPE_FP_FAST_MATH_MODE: + case SPV_OPERAND_TYPE_FUNCTION_CONTROL: + case SPV_OPERAND_TYPE_LOOP_CONTROL: + case SPV_OPERAND_TYPE_IMAGE: + case SPV_OPERAND_TYPE_MEMORY_ACCESS: + case SPV_OPERAND_TYPE_SELECTION_CONTROL: + case SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS: + EmitMaskOperand(operand.type, word); + break; + default: + assert(false && "unhandled or invalid case"); + } + ResetColor(); +} + +void Disassembler::EmitMaskOperand(const spv_operand_type_t type, + const uint32_t word) { + // Scan the mask from least significant bit to most significant bit. For each + // set bit, emit the name of that bit. Separate multiple names with '|'. + uint32_t remaining_word = word; + uint32_t mask; + int num_emitted = 0; + for (mask = 1; remaining_word; mask <<= 1) { + if (remaining_word & mask) { + remaining_word ^= mask; + spv_operand_desc entry; + if (grammar_.lookupOperand(type, mask, &entry)) + assert(false && "should have caught this earlier"); + if (num_emitted) stream_ << "|"; + stream_ << entry->name; + num_emitted++; + } + } + if (!num_emitted) { + // An operand value of 0 was provided, so represent it by the name + // of the 0 value. In many cases, that's "None". + spv_operand_desc entry; + if (SPV_SUCCESS == grammar_.lookupOperand(type, 0, &entry)) + stream_ << entry->name; + } +} + +spv_result_t Disassembler::SaveTextResult(spv_text* text_result) const { + if (!print_) { + size_t length = text_.str().size(); + char* str = new char[length + 1]; + if (!str) return SPV_ERROR_OUT_OF_MEMORY; + strncpy(str, text_.str().c_str(), length + 1); + spv_text text = new spv_text_t(); + if (!text) { + delete[] str; + return SPV_ERROR_OUT_OF_MEMORY; + } + text->str = str; + text->length = length; + *text_result = text; + } + return SPV_SUCCESS; +} + +spv_result_t DisassembleHeader(void* user_data, spv_endianness_t endian, + uint32_t /* magic */, uint32_t version, + uint32_t generator, uint32_t id_bound, + uint32_t schema) { + assert(user_data); + auto disassembler = static_cast(user_data); + return disassembler->HandleHeader(endian, version, generator, id_bound, + schema); +} + +spv_result_t DisassembleInstruction( + void* user_data, const spv_parsed_instruction_t* parsed_instruction) { + assert(user_data); + auto disassembler = static_cast(user_data); + return disassembler->HandleInstruction(*parsed_instruction); +} + +// Simple wrapper class to provide extra data necessary for targeted +// instruction disassembly. +class WrappedDisassembler { + public: + WrappedDisassembler(Disassembler* dis, const uint32_t* binary, size_t wc) + : disassembler_(dis), inst_binary_(binary), word_count_(wc) {} + + Disassembler* disassembler() { return disassembler_; } + const uint32_t* inst_binary() const { return inst_binary_; } + size_t word_count() const { return word_count_; } + + private: + Disassembler* disassembler_; + const uint32_t* inst_binary_; + const size_t word_count_; +}; + +spv_result_t DisassembleTargetHeader(void* user_data, spv_endianness_t endian, + uint32_t /* magic */, uint32_t version, + uint32_t generator, uint32_t id_bound, + uint32_t schema) { + assert(user_data); + auto wrapped = static_cast(user_data); + return wrapped->disassembler()->HandleHeader(endian, version, generator, + id_bound, schema); +} + +spv_result_t DisassembleTargetInstruction( + void* user_data, const spv_parsed_instruction_t* parsed_instruction) { + assert(user_data); + auto wrapped = static_cast(user_data); + // Check if this is the instruction we want to disassemble. + if (wrapped->word_count() == parsed_instruction->num_words && + std::equal(wrapped->inst_binary(), + wrapped->inst_binary() + wrapped->word_count(), + parsed_instruction->words)) { + // Found the target instruction. Disassemble it and signal that we should + // stop searching so we don't output the same instruction again. + if (auto error = + wrapped->disassembler()->HandleInstruction(*parsed_instruction)) + return error; + return SPV_REQUESTED_TERMINATION; + } + return SPV_SUCCESS; +} + +} // anonymous namespace + +spv_result_t spvBinaryToText(const spv_const_context context, + const uint32_t* code, const size_t wordCount, + const uint32_t options, spv_text* pText, + spv_diagnostic* pDiagnostic) { + spv_context_t hijack_context = *context; + if (pDiagnostic) { + *pDiagnostic = nullptr; + libspirv::UseDiagnosticAsMessageConsumer(&hijack_context, pDiagnostic); + } + + const libspirv::AssemblyGrammar grammar(&hijack_context); + if (!grammar.isValid()) return SPV_ERROR_INVALID_TABLE; + + // Generate friendly names for Ids if requested. + std::unique_ptr friendly_mapper; + libspirv::NameMapper name_mapper = libspirv::GetTrivialNameMapper(); + if (options & SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES) { + friendly_mapper.reset( + new libspirv::FriendlyNameMapper(&hijack_context, code, wordCount)); + name_mapper = friendly_mapper->GetNameMapper(); + } + + // Now disassemble! + Disassembler disassembler(grammar, options, name_mapper); + if (auto error = spvBinaryParse(&hijack_context, &disassembler, code, + wordCount, DisassembleHeader, + DisassembleInstruction, pDiagnostic)) { + return error; + } + + return disassembler.SaveTextResult(pText); +} + +std::string spvtools::spvInstructionBinaryToText(const spv_target_env env, + const uint32_t* instCode, + const size_t instWordCount, + const uint32_t* code, + const size_t wordCount, + const uint32_t options) { + spv_context context = spvContextCreate(env); + const libspirv::AssemblyGrammar grammar(context); + if (!grammar.isValid()) { + spvContextDestroy(context); + return ""; + } + + // Generate friendly names for Ids if requested. + std::unique_ptr friendly_mapper; + libspirv::NameMapper name_mapper = libspirv::GetTrivialNameMapper(); + if (options & SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES) { + friendly_mapper.reset( + new libspirv::FriendlyNameMapper(context, code, wordCount)); + name_mapper = friendly_mapper->GetNameMapper(); + } + + // Now disassemble! + Disassembler disassembler(grammar, options, name_mapper); + WrappedDisassembler wrapped(&disassembler, instCode, instWordCount); + spvBinaryParse(context, &wrapped, code, wordCount, DisassembleTargetHeader, + DisassembleTargetInstruction, nullptr); + + spv_text text = nullptr; + std::string output; + if (disassembler.SaveTextResult(&text) == SPV_SUCCESS) { + output.assign(text->str, text->str + text->length); + // Drop trailing newline characters. + while (!output.empty() && output.back() == '\n') output.pop_back(); + } + spvTextDestroy(text); + spvContextDestroy(context); + + return output; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/disassemble.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/disassemble.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/disassemble.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/disassemble.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,38 @@ +// Copyright (c) 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SPIRV_TOOLS_DISASSEMBLE_H_ +#define SPIRV_TOOLS_DISASSEMBLE_H_ + +#include + +#include "spirv-tools/libspirv.h" + +namespace spvtools { + +// Decodes the given SPIR-V instruction binary representation to its assembly +// text. The context is inferred from the provided module binary. The options +// parameter is a bit field of spv_binary_to_text_options_t. Decoded text will +// be stored into *text. Any error will be written into *diagnostic if +// diagnostic is non-null. +std::string spvInstructionBinaryToText(const spv_target_env env, + const uint32_t* inst_binary, + const size_t inst_word_count, + const uint32_t* binary, + const size_t word_count, + const uint32_t options); + +} // namespace spvtools + +#endif // SPIRV_TOOLS_DISASSEMBLE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/enum_set.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/enum_set.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/enum_set.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/enum_set.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,172 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_ENUM_SET_H +#define LIBSPIRV_ENUM_SET_H + +#include +#include +#include +#include +#include + +#include "latest_version_spirv_header.h" + +namespace libspirv { + +// A set of values of a 32-bit enum type. +// It is fast and compact for the common case, where enum values +// are at most 63. But it can represent enums with larger values, +// as may appear in extensions. +template +class EnumSet { + private: + // The ForEach method will call the functor on enum values in + // enum value order (lowest to highest). To make that easier, use + // an ordered set for the overflow values. + using OverflowSetType = std::set; + + public: + // Construct an empty set. + EnumSet() {} + // Construct an set with just the given enum value. + explicit EnumSet(EnumType c) { Add(c); } + // Construct an set from an initializer list of enum values. + EnumSet(std::initializer_list cs) { + for (auto c : cs) Add(c); + } + EnumSet(uint32_t count, const EnumType* ptr) { + for (uint32_t i = 0; i < count; ++i) Add(ptr[i]); + } + // Copy constructor. + EnumSet(const EnumSet& other) { *this = other; } + // Move constructor. The moved-from set is emptied. + EnumSet(EnumSet&& other) { + mask_ = other.mask_; + overflow_ = std::move(other.overflow_); + other.mask_ = 0; + other.overflow_.reset(nullptr); + } + // Assignment operator. + EnumSet& operator=(const EnumSet& other) { + if (&other != this) { + mask_ = other.mask_; + overflow_.reset(other.overflow_ ? new OverflowSetType(*other.overflow_) + : nullptr); + } + return *this; + } + + // Adds the given enum value to the set. This has no effect if the + // enum value is already in the set. + void Add(EnumType c) { AddWord(ToWord(c)); } + + // Returns true if this enum value is in the set. + bool Contains(EnumType c) const { return ContainsWord(ToWord(c)); } + + // Applies f to each enum in the set, in order from smallest enum + // value to largest. + void ForEach(std::function f) const { + for (uint32_t i = 0; i < 64; ++i) { + if (mask_ & AsMask(i)) f(static_cast(i)); + } + if (overflow_) { + for (uint32_t c : *overflow_) f(static_cast(c)); + } + } + + // Returns true if the set is empty. + bool IsEmpty() const { + if (mask_) return false; + if (overflow_ && !overflow_->empty()) return false; + return true; + } + + // Returns true if the set contains ANY of the elements of |in_set|, + // or if |in_set| is empty. + bool HasAnyOf(const EnumSet& in_set) const { + if (in_set.IsEmpty()) return true; + + if (mask_ & in_set.mask_) return true; + + if (!overflow_ || !in_set.overflow_) return false; + + for (uint32_t item : *in_set.overflow_) { + if (overflow_->find(item) != overflow_->end()) return true; + } + + return false; + } + + private: + // Adds the given enum value (as a 32-bit word) to the set. This has no + // effect if the enum value is already in the set. + void AddWord(uint32_t word) { + if (auto new_bits = AsMask(word)) { + mask_ |= new_bits; + } else { + Overflow().insert(word); + } + } + + // Returns true if the enum represented as a 32-bit word is in the set. + bool ContainsWord(uint32_t word) const { + // We shouldn't call Overflow() since this is a const method. + if (auto bits = AsMask(word)) { + return (mask_ & bits) != 0; + } else if (auto overflow = overflow_.get()) { + return overflow->find(word) != overflow->end(); + } + // The word is large, but the set doesn't have large members, so + // it doesn't have an overflow set. + return false; + } + + // Returns the enum value as a uint32_t. + uint32_t ToWord(EnumType value) const { + static_assert(sizeof(EnumType) <= sizeof(uint32_t), + "EnumType must statically castable to uint32_t"); + return static_cast(value); + } + + // Determines whether the given enum value can be represented + // as a bit in a uint64_t mask. If so, then returns that mask bit. + // Otherwise, returns 0. + uint64_t AsMask(uint32_t word) const { + if (word > 63) return 0; + return uint64_t(1) << word; + } + + // Ensures that overflow_set_ references a set. A new empty set is + // allocated if one doesn't exist yet. Returns overflow_set_. + OverflowSetType& Overflow() { + if (overflow_.get() == nullptr) { + overflow_.reset(new OverflowSetType); + } + return *overflow_; + } + + // Enums with values up to 63 are stored as bits in this mask. + uint64_t mask_ = 0; + // Enums with values larger than 63 are stored in this set. + // This set should normally be empty or very small. + std::unique_ptr overflow_ = {}; +}; + +// A set of SpvCapability, optimized for small capability values. +using CapabilitySet = EnumSet; + +} // namespace libspirv + +#endif // LIBSPIRV_ENUM_SET_H diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/enum_string_mapping.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/enum_string_mapping.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/enum_string_mapping.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/enum_string_mapping.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,29 @@ +// Copyright (c) 2017 Google 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. + +#include "enum_string_mapping.h" + +#include +#include +#include +#include +#include + +#include "extensions.h" + +namespace libspirv { + +#include "enum_string_mapping.inc" + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/enum_string_mapping.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/enum_string_mapping.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/enum_string_mapping.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/enum_string_mapping.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,36 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_ENUM_STRING_MAPPING_H_ +#define LIBSPIRV_ENUM_STRING_MAPPING_H_ + +#include + +#include "extensions.h" +#include "latest_version_spirv_header.h" + +namespace libspirv { + +// Finds Extension enum corresponding to |str|. Returns false if not found. +bool GetExtensionFromString(const char* str, Extension* extension); + +// Returns text string corresponding to |extension|. +const char* ExtensionToString(Extension extension); + +// Returns text string corresponding to |capability|. +const char* CapabilityToString(SpvCapability capability); + +} // namespace libspirv + +#endif // LIBSPIRV_ENUM_STRING_MAPPING_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/extensions.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/extensions.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/extensions.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/extensions.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,44 @@ +// Copyright (c) 2017 Google 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. + +#include "extensions.h" + +#include +#include +#include + +#include "enum_string_mapping.h" + +namespace libspirv { + +std::string GetExtensionString(const spv_parsed_instruction_t* inst) { + if (inst->opcode != SpvOpExtension) return "ERROR_not_op_extension"; + + assert(inst->num_operands == 1); + + const auto& operand = inst->operands[0]; + assert(operand.type == SPV_OPERAND_TYPE_LITERAL_STRING); + assert(inst->num_words > operand.offset); + + return reinterpret_cast(inst->words + operand.offset); +} + +std::string ExtensionSetToString(const ExtensionSet& extensions) { + std::stringstream ss; + extensions.ForEach( + [&ss](Extension ext) { ss << ExtensionToString(ext) << " "; }); + return ss.str(); +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/extensions.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/extensions.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/extensions.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/extensions.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,40 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_EXTENSIONS_H_ +#define LIBSPIRV_EXTENSIONS_H_ + +#include + +#include "enum_set.h" +#include "spirv-tools/libspirv.h" + +namespace libspirv { + +// The known SPIR-V extensions. +enum Extension { +#include "extension_enum.inc" +}; + +using ExtensionSet = EnumSet; + +// Returns literal string operand of OpExtension instruction. +std::string GetExtensionString(const spv_parsed_instruction_t* inst); + +// Returns text string listing |extensions| separated by whitespace. +std::string ExtensionSetToString(const ExtensionSet& extensions); + +} // namespace libspirv + +#endif // LIBSPIRV_EXTENSIONS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/ext_inst.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/ext_inst.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/ext_inst.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/ext_inst.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,161 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "ext_inst.h" + +#include +#include + +// DebugInfo extended instruction set. +// See https://www.khronos.org/registry/spir-v/specs/1.0/DebugInfo.html +// TODO(dneto): DebugInfo.h should probably move to SPIRV-Headers. +#include "DebugInfo.h" + +#include "latest_version_glsl_std_450_header.h" +#include "latest_version_opencl_std_header.h" +#include "macro.h" +#include "spirv_definition.h" + +#include "debuginfo.insts.inc" // defines opencl_entries +#include "glsl.std.450.insts.inc" // defines glsl_entries +#include "opencl.std.insts.inc" // defines opencl_entries + +#include "spv-amd-gcn-shader.insts.inc" +#include "spv-amd-shader-ballot.insts.inc" +#include "spv-amd-shader-explicit-vertex-parameter.insts.inc" +#include "spv-amd-shader-trinary-minmax.insts.inc" + +static const spv_ext_inst_group_t kGroups_1_0[] = { + {SPV_EXT_INST_TYPE_GLSL_STD_450, ARRAY_SIZE(glsl_entries), glsl_entries}, + {SPV_EXT_INST_TYPE_OPENCL_STD, ARRAY_SIZE(opencl_entries), opencl_entries}, + {SPV_EXT_INST_TYPE_SPV_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER, + ARRAY_SIZE(spv_amd_shader_explicit_vertex_parameter_entries), + spv_amd_shader_explicit_vertex_parameter_entries}, + {SPV_EXT_INST_TYPE_SPV_AMD_SHADER_TRINARY_MINMAX, + ARRAY_SIZE(spv_amd_shader_trinary_minmax_entries), + spv_amd_shader_trinary_minmax_entries}, + {SPV_EXT_INST_TYPE_SPV_AMD_GCN_SHADER, + ARRAY_SIZE(spv_amd_gcn_shader_entries), spv_amd_gcn_shader_entries}, + {SPV_EXT_INST_TYPE_SPV_AMD_SHADER_BALLOT, + ARRAY_SIZE(spv_amd_shader_ballot_entries), spv_amd_shader_ballot_entries}, + {SPV_EXT_INST_TYPE_DEBUGINFO, ARRAY_SIZE(debuginfo_entries), + debuginfo_entries}, +}; + +static const spv_ext_inst_table_t kTable_1_0 = {ARRAY_SIZE(kGroups_1_0), + kGroups_1_0}; + +spv_result_t spvExtInstTableGet(spv_ext_inst_table* pExtInstTable, + spv_target_env env) { + if (!pExtInstTable) return SPV_ERROR_INVALID_POINTER; + + switch (env) { + // The extended instruction sets are all version 1.0 so far. + case SPV_ENV_UNIVERSAL_1_0: + case SPV_ENV_VULKAN_1_0: + case SPV_ENV_UNIVERSAL_1_1: + case SPV_ENV_UNIVERSAL_1_2: + case SPV_ENV_OPENCL_1_2: + case SPV_ENV_OPENCL_EMBEDDED_1_2: + case SPV_ENV_OPENCL_2_0: + case SPV_ENV_OPENCL_EMBEDDED_2_0: + case SPV_ENV_OPENCL_2_1: + case SPV_ENV_OPENCL_EMBEDDED_2_1: + case SPV_ENV_OPENCL_2_2: + case SPV_ENV_OPENCL_EMBEDDED_2_2: + case SPV_ENV_OPENGL_4_0: + case SPV_ENV_OPENGL_4_1: + case SPV_ENV_OPENGL_4_2: + case SPV_ENV_OPENGL_4_3: + case SPV_ENV_OPENGL_4_5: + case SPV_ENV_UNIVERSAL_1_3: + case SPV_ENV_VULKAN_1_1: + *pExtInstTable = &kTable_1_0; + return SPV_SUCCESS; + default: + assert(0 && "Unknown spv_target_env in spvExtInstTableGet()"); + return SPV_ERROR_INVALID_TABLE; + } +} + +spv_ext_inst_type_t spvExtInstImportTypeGet(const char* name) { + // The names are specified by the respective extension instruction + // specifications. + if (!strcmp("GLSL.std.450", name)) { + return SPV_EXT_INST_TYPE_GLSL_STD_450; + } + if (!strcmp("OpenCL.std", name)) { + return SPV_EXT_INST_TYPE_OPENCL_STD; + } + if (!strcmp("SPV_AMD_shader_explicit_vertex_parameter", name)) { + return SPV_EXT_INST_TYPE_SPV_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER; + } + if (!strcmp("SPV_AMD_shader_trinary_minmax", name)) { + return SPV_EXT_INST_TYPE_SPV_AMD_SHADER_TRINARY_MINMAX; + } + if (!strcmp("SPV_AMD_gcn_shader", name)) { + return SPV_EXT_INST_TYPE_SPV_AMD_GCN_SHADER; + } + if (!strcmp("SPV_AMD_shader_ballot", name)) { + return SPV_EXT_INST_TYPE_SPV_AMD_SHADER_BALLOT; + } + if (!strcmp("DebugInfo", name)) { + return SPV_EXT_INST_TYPE_DEBUGINFO; + } + return SPV_EXT_INST_TYPE_NONE; +} + +spv_result_t spvExtInstTableNameLookup(const spv_ext_inst_table table, + const spv_ext_inst_type_t type, + const char* name, + spv_ext_inst_desc* pEntry) { + if (!table) return SPV_ERROR_INVALID_TABLE; + if (!pEntry) return SPV_ERROR_INVALID_POINTER; + + for (uint32_t groupIndex = 0; groupIndex < table->count; groupIndex++) { + const auto& group = table->groups[groupIndex]; + if (type != group.type) continue; + for (uint32_t index = 0; index < group.count; index++) { + const auto& entry = group.entries[index]; + if (!strcmp(name, entry.name)) { + *pEntry = &entry; + return SPV_SUCCESS; + } + } + } + + return SPV_ERROR_INVALID_LOOKUP; +} + +spv_result_t spvExtInstTableValueLookup(const spv_ext_inst_table table, + const spv_ext_inst_type_t type, + const uint32_t value, + spv_ext_inst_desc* pEntry) { + if (!table) return SPV_ERROR_INVALID_TABLE; + if (!pEntry) return SPV_ERROR_INVALID_POINTER; + + for (uint32_t groupIndex = 0; groupIndex < table->count; groupIndex++) { + const auto& group = table->groups[groupIndex]; + if (type != group.type) continue; + for (uint32_t index = 0; index < group.count; index++) { + const auto& entry = group.entries[index]; + if (value == entry.ext_inst) { + *pEntry = &entry; + return SPV_SUCCESS; + } + } + } + + return SPV_ERROR_INVALID_LOOKUP; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/extinst.debuginfo.grammar.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/extinst.debuginfo.grammar.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/extinst.debuginfo.grammar.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/extinst.debuginfo.grammar.json 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,568 @@ +{ + "copyright" : [ + "Copyright (c) 2017 The Khronos Group Inc.", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and/or associated documentation files (the \"Materials\"),", + "to deal in the Materials without restriction, including without limitation", + "the rights to use, copy, modify, merge, publish, distribute, sublicense,", + "and/or sell copies of the Materials, and to permit persons to whom the", + "Materials are furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Materials.", + "", + "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", + "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", + "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", + "", + "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", + "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", + "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", + "IN THE MATERIALS." + ], + "version" : 100, + "revision" : 1, + "instructions" : [ + { + "opname" : "DebugInfoNone", + "opcode" : 0 + }, + { + "opname" : "DebugCompilationUnit", + "opcode" : 1, + "operands" : [ + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "LiteralInteger", "name" : "'Version'" }, + { "kind" : "LiteralInteger", "name" : "'DWARF Version'" } + ] + }, + { + "opname" : "DebugTypeBasic", + "opcode" : 2, + "operands" : [ + { "kind" : "IdRef", "name" : "'Name'" }, + { "kind" : "IdRef", "name" : "'Size'" }, + { "kind" : "DebugBaseTypeAttributeEncoding", "name" : "'Encoding'" } + ] + }, + { + "opname" : "DebugTypePointer", + "opcode" : 3, + "operands" : [ + { "kind" : "IdRef", "name" : "'Base Type'" }, + { "kind" : "StorageClass", "name" : "'Storage Class'" }, + { "kind" : "DebugInfoFlags", "name" : "'Literal Flags'" } + ] + }, + { + "opname" : "DebugTypeQualifier", + "opcode" : 4, + "operands" : [ + { "kind" : "IdRef", "name" : "'Base Type'" }, + { "kind" : "DebugTypeQualifier", "name" : "'Type Qualifier'" } + ] + }, + { + "opname" : "DebugTypeArray", + "opcode" : 5, + "operands" : [ + { "kind" : "IdRef", "name" : "'Base Type'" }, + { "kind" : "IdRef", "name" : "'Component Counts'", "quantifier" : "*" } + ] + }, + { + "opname" : "DebugTypeVector", + "opcode" : 6, + "operands" : [ + { "kind" : "IdRef", "name" : "'Base Type'" }, + { "kind" : "LiteralInteger", "name" : "'Component Count'" } + ] + }, + { + "opname" : "DebugTypedef", + "opcode" : 7, + "operands" : [ + { "kind" : "IdRef", "name" : "'Name'" }, + { "kind" : "IdRef", "name" : "'Base Type'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "LiteralInteger", "name" : "'Column'" }, + { "kind" : "IdRef", "name" : "'Parent'" } + ] + }, + { + "opname" : "DebugTypeFunction", + "opcode" : 8, + "operands" : [ + { "kind" : "IdRef", "name" : "'Return Type'" }, + { "kind" : "IdRef", "name" : "'Paramter Types'", "quantifier" : "*" } + ] + }, + { + "opname" : "DebugTypeEnum", + "opcode" : 9, + "operands" : [ + { "kind" : "IdRef", "name" : "'Name'" }, + { "kind" : "IdRef", "name" : "'Underlying Type'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "LiteralInteger", "name" : "'Column'" }, + { "kind" : "IdRef", "name" : "'Parent'" }, + { "kind" : "IdRef", "name" : "'Size'" }, + { "kind" : "DebugInfoFlags", "name" : "'Flags'" }, + { "kind" : "PairIdRefIdRef", "name" : "'Value, Name, Value, Name, ...'", "quantifier" : "*" } + ] + }, + { + "opname" : "DebugTypeComposite", + "opcode" : 10, + "operands" : [ + { "kind" : "IdRef", "name" : "'Name'" }, + { "kind" : "DebugCompositeType", "name" : "'Tag'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "LiteralInteger", "name" : "'Column'" }, + { "kind" : "IdRef", "name" : "'Parent'" }, + { "kind" : "IdRef", "name" : "'Size'" }, + { "kind" : "DebugInfoFlags", "name" : "'Flags'" }, + { "kind" : "IdRef", "name" : "'Members'", "quantifier" : "*" } + ] + }, + { + "opname" : "DebugTypeMember", + "opcode" : 11, + "operands" : [ + { "kind" : "IdRef", "name" : "'Name'" }, + { "kind" : "IdRef", "name" : "'Type'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "LiteralInteger", "name" : "'Column'" }, + { "kind" : "IdRef", "name" : "'Parent'" }, + { "kind" : "IdRef", "name" : "'Offset'" }, + { "kind" : "IdRef", "name" : "'Size'" }, + { "kind" : "DebugInfoFlags", "name" : "'Flags'" }, + { "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" } + ] + }, + { + "opname" : "DebugTypeInheritance", + "opcode" : 12, + "operands" : [ + { "kind" : "IdRef", "name" : "'Child'" }, + { "kind" : "IdRef", "name" : "'Parent'" }, + { "kind" : "IdRef", "name" : "'Offset'" }, + { "kind" : "IdRef", "name" : "'Size'" }, + { "kind" : "DebugInfoFlags", "name" : "'Flags'" } + ] + }, + { + "opname" : "DebugTypePtrToMember", + "opcode" : 13, + "operands" : [ + { "kind" : "IdRef", "name" : "'Member Type'" }, + { "kind" : "IdRef", "name" : "'Parent'" } + ] + }, + { + "opname" : "DebugTypeTemplate", + "opcode" : 14, + "operands" : [ + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "IdRef", "name" : "'Parameters'", "quantifier" : "*" } + ] + }, + { + "opname" : "DebugTypeTemplateParameter", + "opcode" : 15, + "operands" : [ + { "kind" : "IdRef", "name" : "'Name'" }, + { "kind" : "IdRef", "name" : "'Actual Type'" }, + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "LiteralInteger", "name" : "'Column'" } + ] + }, + { + "opname" : "DebugTypeTemplateTemplateParameter", + "opcode" : 16, + "operands" : [ + { "kind" : "IdRef", "name" : "'Name'" }, + { "kind" : "IdRef", "name" : "'Template Name'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "LiteralInteger", "name" : "'Column'" } + ] + }, + { + "opname" : "DebugTypeTemplateParameterPack", + "opcode" : 17, + "operands" : [ + { "kind" : "IdRef", "name" : "'Name'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "LiteralInteger", "name" : "'Column'" }, + { "kind" : "IdRef", "name" : "'Template Parameters'", "quantifier" : "*" } + ] + }, + { + "opname" : "DebugGlobalVariable", + "opcode" : 18, + "operands" : [ + { "kind" : "IdRef", "name" : "'Name'" }, + { "kind" : "IdRef", "name" : "'Type'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "LiteralInteger", "name" : "'Column'" }, + { "kind" : "IdRef", "name" : "'Parent'" }, + { "kind" : "IdRef", "name" : "'Linkage Name'" }, + { "kind" : "IdRef", "name" : "'Variable'" }, + { "kind" : "DebugInfoFlags", "name" : "'Flags'" }, + { "kind" : "IdRef", "name" : "'Static Member Declaration'", "quantifier" : "?" } + ] + }, + { + "opname" : "DebugFunctionDeclaration", + "opcode" : 19, + "operands" : [ + { "kind" : "IdRef", "name" : "'Name'" }, + { "kind" : "IdRef", "name" : "'Type'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "LiteralInteger", "name" : "'Column'" }, + { "kind" : "IdRef", "name" : "'Parent'" }, + { "kind" : "IdRef", "name" : "'Linkage Name'" }, + { "kind" : "DebugInfoFlags", "name" : "'Flags'" } + ] + }, + { + "opname" : "DebugFunction", + "opcode" : 20, + "operands" : [ + { "kind" : "IdRef", "name" : "'Name'" }, + { "kind" : "IdRef", "name" : "'Type'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "LiteralInteger", "name" : "'Column'" }, + { "kind" : "IdRef", "name" : "'Parent'" }, + { "kind" : "IdRef", "name" : "'Linkage Name'" }, + { "kind" : "DebugInfoFlags", "name" : "'Flags'" }, + { "kind" : "LiteralInteger", "name" : "'Scope Line'" }, + { "kind" : "IdRef", "name" : "'Function'" }, + { "kind" : "IdRef", "name" : "'Declaration'", "quantifier" : "?" } + ] + }, + { + "opname" : "DebugLexicalBlock", + "opcode" : 21, + "operands" : [ + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "LiteralInteger", "name" : "'Column'" }, + { "kind" : "IdRef", "name" : "'Parent'" }, + { "kind" : "IdRef", "name" : "'Name'", "quantifier" : "?" } + ] + }, + { + "opname" : "DebugLexicalBlockDiscriminator", + "opcode" : 22, + "operands" : [ + { "kind" : "IdRef", "name" : "'Scope'" }, + { "kind" : "LiteralInteger", "name" : "'Discriminator'" }, + { "kind" : "IdRef", "name" : "'Parent'" } + ] + }, + { + "opname" : "DebugScope", + "opcode" : 23, + "operands" : [ + { "kind" : "IdRef", "name" : "'Scope'" }, + { "kind" : "IdRef", "name" : "'Inlined At'", "quantifier" : "?" } + ] + }, + { + "opname" : "DebugNoScope", + "opcode" : 24 + }, + { + "opname" : "DebugInlinedAt", + "opcode" : 25, + "operands" : [ + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "IdRef", "name" : "'Scope'" }, + { "kind" : "IdRef", "name" : "'Inlined'", "quantifier" : "?" } + ] + }, + { + "opname" : "DebugLocalVariable", + "opcode" : 26, + "operands" : [ + { "kind" : "IdRef", "name" : "'Name'" }, + { "kind" : "IdRef", "name" : "'Type'" }, + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "LiteralInteger", "name" : "'Column'" }, + { "kind" : "IdRef", "name" : "'Parent'" }, + { "kind" : "LiteralInteger", "name" : "'Arg Number'", "quantifier" : "?" } + ] + }, + { + "opname" : "DebugInlinedVariable", + "opcode" : 27, + "operands" : [ + { "kind" : "IdRef", "name" : "'Variable'" }, + { "kind" : "IdRef", "name" : "'Inlined'" } + ] + }, + { + "opname" : "DebugDeclare", + "opcode" : 28, + "operands" : [ + { "kind" : "IdRef", "name" : "'Local Variable'" }, + { "kind" : "IdRef", "name" : "'Variable'" }, + { "kind" : "IdRef", "name" : "'Expression'" } + ] + }, + { + "opname" : "DebugValue", + "opcode" : 29, + "operands" : [ + { "kind" : "IdRef", "name" : "'Value'" }, + { "kind" : "IdRef", "name" : "'Expression'" }, + { "kind" : "IdRef", "name" : "'Indexes'", "quantifier" : "*" } + ] + }, + { + "opname" : "DebugOperation", + "opcode" : 30, + "operands" : [ + { "kind" : "DebugOperation", "name" : "'OpCode'" }, + { "kind" : "LiteralInteger", "name" : "'Operands ...'", "quantifier" : "*" } + ] + }, + { + "opname" : "DebugExpression", + "opcode" : 31, + "operands" : [ + { "kind" : "IdRef", "name" : "'Operands ...'", "quantifier" : "*" } + ] + }, + { + "opname" : "DebugMacroDef", + "opcode" : 32, + "operands" : [ + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "IdRef", "name" : "'Name'" }, + { "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" } + ] + }, + { + "opname" : "DebugMacroUndef", + "opcode" : 33, + "operands" : [ + { "kind" : "IdRef", "name" : "'Source'" }, + { "kind" : "LiteralInteger", "name" : "'Line'" }, + { "kind" : "IdRef", "name" : "'Macro'" } + ] + } + ], + "operand_kinds" : [ + { + "category" : "BitEnum", + "kind" : "DebugInfoFlags", + "enumerants" : [ + { + "enumerant" : "FlagIsProtected", + "value" : "0x01" + }, + { + "enumerant" : "FlagIsPrivate", + "value" : "0x02" + }, + { + "enumerant" : "FlagIsPublic", + "value" : "0x03" + }, + { + "enumerant" : "FlagIsLocal", + "value" : "0x04" + }, + { + "enumerant" : "FlagIsDefinition", + "value" : "0x08" + }, + { + "enumerant" : "FlagFwdDecl", + "value" : "0x10" + }, + { + "enumerant" : "FlagArtificial", + "value" : "0x20" + }, + { + "enumerant" : "FlagExplicit", + "value" : "0x40" + }, + { + "enumerant" : "FlagPrototyped", + "value" : "0x80" + }, + { + "enumerant" : "FlagObjectPointer", + "value" : "0x100" + }, + { + "enumerant" : "FlagStaticMember", + "value" : "0x200" + }, + { + "enumerant" : "FlagIndirectVariable", + "value" : "0x400" + }, + { + "enumerant" : "FlagLValueReference", + "value" : "0x800" + }, + { + "enumerant" : "FlagRValueReference", + "value" : "0x1000" + }, + { + "enumerant" : "FlagIsOptimized", + "value" : "0x2000" + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "DebugBaseTypeAttributeEncoding", + "enumerants" : [ + { + "enumerant" : "Unspecified", + "value" : "0" + }, + { + "enumerant" : "Address", + "value" : "1" + }, + { + "enumerant" : "Boolean", + "value" : "2" + }, + { + "enumerant" : "Float", + "value" : "4" + }, + { + "enumerant" : "Signed", + "value" : "5" + }, + { + "enumerant" : "SignedChar", + "value" : "6" + }, + { + "enumerant" : "Unsigned", + "value" : "7" + }, + { + "enumerant" : "UnsignedChar", + "value" : "8" + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "DebugCompositeType", + "enumerants" : [ + { + "enumerant" : "Class", + "value" : "0" + }, + { + "enumerant" : "Structure", + "value" : "1" + }, + { + "enumerant" : "Union", + "value" : "2" + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "DebugTypeQualifier", + "enumerants" : [ + { + "enumerant" : "ConstType", + "value" : "0" + }, + { + "enumerant" : "VolatileType", + "value" : "1" + }, + { + "enumerant" : "RestrictType", + "value" : "2" + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "DebugOperation", + "enumerants" : [ + { + "enumerant" : "Deref", + "value" : "0" + }, + { + "enumerant" : "Plus", + "value" : "1" + }, + { + "enumerant" : "Minus", + "value" : "2" + }, + { + "enumerant" : "PlusUconst", + "value" : "3", + "parameters" : [ + { "kind" : "LiteralInteger" } + ] + }, + { + "enumerant" : "BitPiece", + "value" : "4", + "parameters" : [ + { "kind" : "LiteralInteger" }, + { "kind" : "LiteralInteger" } + ] + }, + { + "enumerant" : "Swap", + "value" : "5" + }, + { + "enumerant" : "Xderef", + "value" : "6" + }, + { + "enumerant" : "StackValue", + "value" : "7" + }, + { + "enumerant" : "Constu", + "value" : "8", + "parameters" : [ + { "kind" : "LiteralInteger" } + ] + } + ] + } + ] +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/ext_inst.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/ext_inst.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/ext_inst.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/ext_inst.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,40 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_EXT_INST_H_ +#define LIBSPIRV_EXT_INST_H_ + +#include "spirv-tools/libspirv.h" +#include "table.h" + +// Gets the type of the extended instruction set with the specified name. +spv_ext_inst_type_t spvExtInstImportTypeGet(const char* name); + +// Finds the named extented instruction of the given type in the given extended +// instruction table. On success, returns SPV_SUCCESS and writes a handle of +// the instruction entry into *entry. +spv_result_t spvExtInstTableNameLookup(const spv_ext_inst_table table, + const spv_ext_inst_type_t type, + const char* name, + spv_ext_inst_desc* entry); + +// Finds the extented instruction of the given type in the given extended +// instruction table by value. On success, returns SPV_SUCCESS and writes a +// handle of the instruction entry into *entry. +spv_result_t spvExtInstTableValueLookup(const spv_ext_inst_table table, + const spv_ext_inst_type_t type, + const uint32_t value, + spv_ext_inst_desc* pEntry); + +#endif // LIBSPIRV_EXT_INST_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/extinst.spv-amd-gcn-shader.grammar.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/extinst.spv-amd-gcn-shader.grammar.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/extinst.spv-amd-gcn-shader.grammar.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/extinst.spv-amd-gcn-shader.grammar.json 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,26 @@ +{ + "revision" : 2, + "instructions" : [ + { + "opname" : "CubeFaceIndexAMD", + "opcode" : 1, + "operands" : [ + { "kind" : "IdRef", "name" : "'P'" } + ], + "extensions" : [ "SPV_AMD_gcn_shader" ] + }, + { + "opname" : "CubeFaceCoordAMD", + "opcode" : 2, + "operands" : [ + { "kind" : "IdRef", "name" : "'P'" } + ], + "extensions" : [ "SPV_AMD_gcn_shader" ] + }, + { + "opname" : "TimeAMD", + "opcode" : 3, + "extensions" : [ "SPV_AMD_gcn_shader" ] + } + ] +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/extinst.spv-amd-shader-ballot.grammar.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/extinst.spv-amd-shader-ballot.grammar.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/extinst.spv-amd-shader-ballot.grammar.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/extinst.spv-amd-shader-ballot.grammar.json 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,41 @@ +{ + "revision" : 5, + "instructions" : [ + { + "opname" : "SwizzleInvocationsAMD", + "opcode" : 1, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'offset'" } + ], + "extensions" : [ "SPV_AMD_shader_ballot" ] + }, + { + "opname" : "SwizzleInvocationsMaskedAMD", + "opcode" : 2, + "operands" : [ + { "kind" : "IdRef", "name" : "'data'" }, + { "kind" : "IdRef", "name" : "'mask'" } + ], + "extensions" : [ "SPV_AMD_shader_ballot" ] + }, + { + "opname" : "WriteInvocationAMD", + "opcode" : 3, + "operands" : [ + { "kind" : "IdRef", "name" : "'inputValue'" }, + { "kind" : "IdRef", "name" : "'writeValue'" }, + { "kind" : "IdRef", "name" : "'invocationIndex'" } + ], + "extensions" : [ "SPV_AMD_shader_ballot" ] + }, + { + "opname" : "MbcntAMD", + "opcode" : 4, + "operands" : [ + { "kind" : "IdRef", "name" : "'mask'" } + ], + "extensions" : [ "SPV_AMD_shader_ballot" ] + } + ] +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,14 @@ +{ + "revision" : 4, + "instructions" : [ + { + "opname" : "InterpolateAtVertexAMD", + "opcode" : 1, + "operands" : [ + { "kind" : "IdRef", "name" : "'interpolant'" }, + { "kind" : "IdRef", "name" : "'vertexIdx'" } + ], + "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ] + } + ] +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/extinst.spv-amd-shader-trinary-minmax.grammar.json vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/extinst.spv-amd-shader-trinary-minmax.grammar.json --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/extinst.spv-amd-shader-trinary-minmax.grammar.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/extinst.spv-amd-shader-trinary-minmax.grammar.json 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,95 @@ +{ + "revision" : 4, + "instructions" : [ + { + "opname" : "FMin3AMD", + "opcode" : 1, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ], + "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] + }, + { + "opname" : "UMin3AMD", + "opcode" : 2, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ], + "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] + }, + { + "opname" : "SMin3AMD", + "opcode" : 3, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ], + "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] + }, + { + "opname" : "FMax3AMD", + "opcode" : 4, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ], + "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] + }, + { + "opname" : "UMax3AMD", + "opcode" : 5, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ], + "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] + }, + { + "opname" : "SMax3AMD", + "opcode" : 6, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ], + "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] + }, + { + "opname" : "FMid3AMD", + "opcode" : 7, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ], + "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] + }, + { + "opname" : "UMid3AMD", + "opcode" : 8, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ], + "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] + }, + { + "opname" : "SMid3AMD", + "opcode" : 9, + "operands" : [ + { "kind" : "IdRef", "name" : "'x'" }, + { "kind" : "IdRef", "name" : "'y'" }, + { "kind" : "IdRef", "name" : "'z'" } + ], + "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] + } + ] +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/id_descriptor.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/id_descriptor.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/id_descriptor.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/id_descriptor.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,79 @@ +// Copyright (c) 2017 Google 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. + +#include "id_descriptor.h" + +#include +#include + +#include "opcode.h" +#include "operand.h" + +namespace libspirv { + +namespace { + +// Hashes an array of words. Order of words is important. +uint32_t HashU32Array(const std::vector& words) { + // The hash function is a sum of hashes of each word seeded by word index. + // Knuth's multiplicative hash is used to hash the words. + const uint32_t kKnuthMulHash = 2654435761; + uint32_t val = 0; + for (uint32_t i = 0; i < words.size(); ++i) { + val += (words[i] + i + 123) * kKnuthMulHash; + } + return val; +} + +} // namespace + +uint32_t IdDescriptorCollection::ProcessInstruction( + const spv_parsed_instruction_t& inst) { + if (!inst.result_id) return 0; + + assert(words_.empty()); + words_.push_back(inst.words[0]); + + for (size_t operand_index = 0; operand_index < inst.num_operands; + ++operand_index) { + const auto& operand = inst.operands[operand_index]; + if (spvIsIdType(operand.type)) { + const uint32_t id = inst.words[operand.offset]; + const auto it = id_to_descriptor_.find(id); + // Forward declared ids are not hashed. + if (it != id_to_descriptor_.end()) { + words_.push_back(it->second); + } + } else { + for (size_t operand_word_index = 0; + operand_word_index < operand.num_words; ++operand_word_index) { + words_.push_back(inst.words[operand.offset + operand_word_index]); + } + } + } + + uint32_t descriptor = + custom_hash_func_ ? custom_hash_func_(words_) : HashU32Array(words_); + if (descriptor == 0) descriptor = 1; + assert(descriptor); + + words_.clear(); + + const auto result = id_to_descriptor_.emplace(inst.result_id, descriptor); + assert(result.second); + (void)result; + return descriptor; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/id_descriptor.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/id_descriptor.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/id_descriptor.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/id_descriptor.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_ID_DESCRIPTOR_H_ +#define LIBSPIRV_ID_DESCRIPTOR_H_ + +#include +#include + +#include "spirv-tools/libspirv.hpp" + +namespace libspirv { + +using CustomHashFunc = std::function&)>; + +// Computes and stores id descriptors. +// +// Descriptors are computed as hash of all words in the instruction where ids +// were substituted with previously computed descriptors. +class IdDescriptorCollection { + public: + explicit IdDescriptorCollection( + CustomHashFunc custom_hash_func = CustomHashFunc()) + : custom_hash_func_(custom_hash_func) { + words_.reserve(16); + } + + // Computes descriptor for the result id of the given instruction and + // registers it in id_to_descriptor_. Returns the computed descriptor. + // This function needs to be sequentially called for every instruction in the + // module. + uint32_t ProcessInstruction(const spv_parsed_instruction_t& inst); + + // Returns a previously computed descriptor id. + uint32_t GetDescriptor(uint32_t id) const { + const auto it = id_to_descriptor_.find(id); + if (it == id_to_descriptor_.end()) return 0; + return it->second; + } + + private: + std::unordered_map id_to_descriptor_; + + std::function&)> custom_hash_func_; + + // Scratch buffer used for hashing. Class member to optimize on allocation. + std::vector words_; +}; + +} // namespace libspirv + +#endif // LIBSPIRV_ID_DESCRIPTOR_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/instruction.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/instruction.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/instruction.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/instruction.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,49 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_INSTRUCTION_H_ +#define LIBSPIRV_INSTRUCTION_H_ + +#include +#include + +#include "latest_version_spirv_header.h" +#include "spirv-tools/libspirv.h" + +// Describes an instruction. +struct spv_instruction_t { + // Normally, both opcode and extInstType contain valid data. + // However, when the assembler parses ! as the first word in + // an instruction and opcode and extInstType are invalid. + SpvOp opcode; + spv_ext_inst_type_t extInstType; + + // The Id of the result type, if this instruction has one. Zero otherwise. + uint32_t resultTypeId; + + // The instruction, as a sequence of 32-bit words. + // For a regular instruction the opcode and word count are combined + // in words[0], as described in the SPIR-V spec. + // Otherwise, the first token was !, and that number appears + // in words[0]. Subsequent elements are the result of parsing + // tokens in the alternate parsing mode as described in syntax.md. + std::vector words; +}; + +// Appends a word to an instruction, without checking for overflow. +inline void spvInstructionAddWord(spv_instruction_t* inst, uint32_t value) { + inst->words.push_back(value); +} + +#endif // LIBSPIRV_INSTRUCTION_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/latest_version_glsl_std_450_header.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/latest_version_glsl_std_450_header.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/latest_version_glsl_std_450_header.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/latest_version_glsl_std_450_header.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,20 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_LATEST_VERSION_GLSL_STD_450_HEADER_H_ +#define LIBSPIRV_LATEST_VERSION_GLSL_STD_450_HEADER_H_ + +#include "spirv/unified1/GLSL.std.450.h" + +#endif // LIBSPIRV_LATEST_VERSION_GLSL_STD_450_HEADER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/latest_version_opencl_std_header.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/latest_version_opencl_std_header.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/latest_version_opencl_std_header.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/latest_version_opencl_std_header.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,20 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_LATEST_VERSION_OPENCL_STD_HEADER_H_ +#define LIBSPIRV_LATEST_VERSION_OPENCL_STD_HEADER_H_ + +#include "spirv/unified1/OpenCL.std.h" + +#endif // LIBSPIRV_LATEST_VERSION_OPENCL_STD_HEADER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/latest_version_spirv_header.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/latest_version_spirv_header.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/latest_version_spirv_header.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/latest_version_spirv_header.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,20 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_LATEST_VERSION_SPIRV_HEADER_H_ +#define LIBSPIRV_LATEST_VERSION_SPIRV_HEADER_H_ + +#include "spirv/unified1/spirv.h" + +#endif // LIBSPIRV_LATEST_VERSION_SPIRV_HEADER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/libspirv.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/libspirv.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/libspirv.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/libspirv.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,118 @@ +// Copyright (c) 2016 Google 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. + +#include "spirv-tools/libspirv.hpp" + +#include "table.h" + +namespace spvtools { + +Context::Context(spv_target_env env) : context_(spvContextCreate(env)) {} + +Context::Context(Context&& other) : context_(other.context_) { + other.context_ = nullptr; +} + +Context& Context::operator=(Context&& other) { + spvContextDestroy(context_); + context_ = other.context_; + other.context_ = nullptr; + + return *this; +} + +Context::~Context() { spvContextDestroy(context_); } + +void Context::SetMessageConsumer(MessageConsumer consumer) { + libspirv::SetContextMessageConsumer(context_, std::move(consumer)); +} + +spv_context& Context::CContext() { return context_; } + +const spv_context& Context::CContext() const { return context_; } + +// Structs for holding the data members for SpvTools. +struct SpirvTools::Impl { + explicit Impl(spv_target_env env) : context(spvContextCreate(env)) { + // The default consumer in spv_context_t is a null consumer, which provides + // equivalent functionality (from the user's perspective) as a real consumer + // does nothing. + } + ~Impl() { spvContextDestroy(context); } + + spv_context context; // C interface context object. +}; + +SpirvTools::SpirvTools(spv_target_env env) : impl_(new Impl(env)) {} + +SpirvTools::~SpirvTools() {} + +void SpirvTools::SetMessageConsumer(MessageConsumer consumer) { + libspirv::SetContextMessageConsumer(impl_->context, std::move(consumer)); +} + +bool SpirvTools::Assemble(const std::string& text, + std::vector* binary, + uint32_t options) const { + return Assemble(text.data(), text.size(), binary, options); +} + +bool SpirvTools::Assemble(const char* text, const size_t text_size, + std::vector* binary, + uint32_t options) const { + spv_binary spvbinary = nullptr; + spv_result_t status = spvTextToBinaryWithOptions( + impl_->context, text, text_size, options, &spvbinary, nullptr); + if (status == SPV_SUCCESS) { + binary->assign(spvbinary->code, spvbinary->code + spvbinary->wordCount); + } + spvBinaryDestroy(spvbinary); + return status == SPV_SUCCESS; +} + +bool SpirvTools::Disassemble(const std::vector& binary, + std::string* text, uint32_t options) const { + return Disassemble(binary.data(), binary.size(), text, options); +} + +bool SpirvTools::Disassemble(const uint32_t* binary, const size_t binary_size, + std::string* text, uint32_t options) const { + spv_text spvtext = nullptr; + spv_result_t status = spvBinaryToText(impl_->context, binary, binary_size, + options, &spvtext, nullptr); + if (status == SPV_SUCCESS) { + text->assign(spvtext->str, spvtext->str + spvtext->length); + } + spvTextDestroy(spvtext); + return status == SPV_SUCCESS; +} + +bool SpirvTools::Validate(const std::vector& binary) const { + return Validate(binary.data(), binary.size()); +} + +bool SpirvTools::Validate(const uint32_t* binary, + const size_t binary_size) const { + return spvValidateBinary(impl_->context, binary, binary_size, nullptr) == + SPV_SUCCESS; +} + +bool SpirvTools::Validate(const uint32_t* binary, const size_t binary_size, + const spvtools::ValidatorOptions& options) const { + spv_const_binary_t the_binary{binary, binary_size}; + return spvValidateWithOptions(impl_->context, options, &the_binary, + nullptr) == SPV_SUCCESS; +} + +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/link/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/link/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/link/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/link/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,36 @@ +# Copyright (c) 2017 Pierre Moreau + +# 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. +add_library(SPIRV-Tools-link + linker.cpp +) + +spvtools_default_compile_options(SPIRV-Tools-link) +target_include_directories(SPIRV-Tools-link + PUBLIC ${spirv-tools_SOURCE_DIR}/include + PUBLIC ${SPIRV_HEADER_INCLUDE_DIR} + PRIVATE ${spirv-tools_BINARY_DIR} +) +# We need the IR functionnalities from the optimizer +target_link_libraries(SPIRV-Tools-link + PUBLIC SPIRV-Tools-opt) + +set_property(TARGET SPIRV-Tools-link PROPERTY FOLDER "SPIRV-Tools libraries") +spvtools_check_symbol_exports(SPIRV-Tools-link) + +if(ENABLE_SPIRV_TOOLS_INSTALL) + install(TARGETS SPIRV-Tools-link + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif(ENABLE_SPIRV_TOOLS_INSTALL) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/link/linker.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/link/linker.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/link/linker.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/link/linker.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,786 @@ +// Copyright (c) 2017 Pierre Moreau +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "spirv-tools/linker.hpp" + +#include +#include + +#include +#include +#include +#include +#include + +#include "assembly_grammar.h" +#include "diagnostic.h" +#include "opt/build_module.h" +#include "opt/compact_ids_pass.h" +#include "opt/decoration_manager.h" +#include "opt/ir_loader.h" +#include "opt/make_unique.h" +#include "opt/pass_manager.h" +#include "opt/remove_duplicates_pass.h" +#include "spirv-tools/libspirv.hpp" +#include "spirv_target_env.h" + +namespace spvtools { + +using ir::Instruction; +using ir::IRContext; +using ir::Module; +using ir::Operand; +using opt::PassManager; +using opt::RemoveDuplicatesPass; +using opt::analysis::DecorationManager; +using opt::analysis::DefUseManager; + +// Stores various information about an imported or exported symbol. +struct LinkageSymbolInfo { + SpvId id; // ID of the symbol + SpvId type_id; // ID of the type of the symbol + std::string name; // unique name defining the symbol and used for matching + // imports and exports together + std::vector parameter_ids; // ID of the parameters of the symbol, if + // it is a function +}; +struct LinkageEntry { + LinkageSymbolInfo imported_symbol; + LinkageSymbolInfo exported_symbol; + + LinkageEntry(const LinkageSymbolInfo& import_info, + const LinkageSymbolInfo& export_info) + : imported_symbol(import_info), exported_symbol(export_info) {} +}; +using LinkageTable = std::vector; + +// Shifts the IDs used in each binary of |modules| so that they occupy a +// disjoint range from the other binaries, and compute the new ID bound which +// is returned in |max_id_bound|. +// +// Both |modules| and |max_id_bound| should not be null, and |modules| should +// not be empty either. Furthermore |modules| should not contain any null +// pointers. +static spv_result_t ShiftIdsInModules(const MessageConsumer& consumer, + std::vector* modules, + uint32_t* max_id_bound); + +// Generates the header for the linked module and returns it in |header|. +// +// |header| should not be null, |modules| should not be empty and pointers +// should be non-null. |max_id_bound| should be strictly greater than 0. +// +// TODO(pierremoreau): What to do when binaries use different versions of +// SPIR-V? For now, use the max of all versions found in +// the input modules. +static spv_result_t GenerateHeader(const MessageConsumer& consumer, + const std::vector& modules, + uint32_t max_id_bound, + ir::ModuleHeader* header); + +// Merge all the modules from |in_modules| into a single module owned by +// |linked_context|. +// +// |linked_context| should not be null. +static spv_result_t MergeModules(const MessageConsumer& consumer, + const std::vector& in_modules, + const libspirv::AssemblyGrammar& grammar, + IRContext* linked_context); + +// Compute all pairs of import and export and return it in |linkings_to_do|. +// +// |linkings_to_do should not be null. Built-in symbols will be ignored. +// +// TODO(pierremoreau): Linkage attributes applied by a group decoration are +// currently not handled. (You could have a group being +// applied to a single ID.) +// TODO(pierremoreau): What should be the proper behaviour with built-in +// symbols? +static spv_result_t GetImportExportPairs( + const MessageConsumer& consumer, const ir::IRContext& linked_context, + const DefUseManager& def_use_manager, + const DecorationManager& decoration_manager, bool allow_partial_linkage, + LinkageTable* linkings_to_do); + +// Checks that for each pair of import and export, the import and export have +// the same type as well as the same decorations. +// +// TODO(pierremoreau): Decorations on functions parameters are currently not +// checked. +static spv_result_t CheckImportExportCompatibility( + const MessageConsumer& consumer, const LinkageTable& linkings_to_do, + ir::IRContext* context); + +// Remove linkage specific instructions, such as prototypes of imported +// functions, declarations of imported variables, import (and export if +// necessary) linkage attribtes. +// +// |linked_context| and |decoration_manager| should not be null, and the +// 'RemoveDuplicatePass' should be run first. +// +// TODO(pierremoreau): Linkage attributes applied by a group decoration are +// currently not handled. (You could have a group being +// applied to a single ID.) +// TODO(pierremoreau): Run a pass for removing dead instructions, for example +// OpName for prototypes of imported funcions. +static spv_result_t RemoveLinkageSpecificInstructions( + const MessageConsumer& consumer, const LinkerOptions& options, + const LinkageTable& linkings_to_do, DecorationManager* decoration_manager, + ir::IRContext* linked_context); + +// Verify that the unique ids of each instruction in |linked_context| (i.e. the +// merged module) are truly unique. Does not check the validity of other ids +static spv_result_t VerifyIds(const MessageConsumer& consumer, + ir::IRContext* linked_context); + +spv_result_t Link(const Context& context, + const std::vector>& binaries, + std::vector* linked_binary, + const LinkerOptions& options) { + std::vector binary_ptrs; + binary_ptrs.reserve(binaries.size()); + std::vector binary_sizes; + binary_sizes.reserve(binaries.size()); + + for (const auto& binary : binaries) { + binary_ptrs.push_back(binary.data()); + binary_sizes.push_back(binary.size()); + } + + return Link(context, binary_ptrs.data(), binary_sizes.data(), binaries.size(), + linked_binary, options); +} + +spv_result_t Link(const Context& context, const uint32_t* const* binaries, + const size_t* binary_sizes, size_t num_binaries, + std::vector* linked_binary, + const LinkerOptions& options) { + spv_position_t position = {}; + const spv_context& c_context = context.CContext(); + const MessageConsumer& consumer = c_context->consumer; + + linked_binary->clear(); + if (num_binaries == 0u) + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_BINARY) + << "No modules were given."; + + std::vector> ir_contexts; + std::vector modules; + modules.reserve(num_binaries); + for (size_t i = 0u; i < num_binaries; ++i) { + const uint32_t schema = binaries[i][4u]; + if (schema != 0u) { + position.index = 4u; + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_BINARY) + << "Schema is non-zero for module " << i << "."; + } + + std::unique_ptr ir_context = BuildModule( + c_context->target_env, consumer, binaries[i], binary_sizes[i]); + if (ir_context == nullptr) + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_BINARY) + << "Failed to build a module out of " << ir_contexts.size() << "."; + modules.push_back(ir_context->module()); + ir_contexts.push_back(std::move(ir_context)); + } + + // Phase 1: Shift the IDs used in each binary so that they occupy a disjoint + // range from the other binaries, and compute the new ID bound. + uint32_t max_id_bound = 0u; + spv_result_t res = ShiftIdsInModules(consumer, &modules, &max_id_bound); + if (res != SPV_SUCCESS) return res; + + // Phase 2: Generate the header + ir::ModuleHeader header; + res = GenerateHeader(consumer, modules, max_id_bound, &header); + if (res != SPV_SUCCESS) return res; + IRContext linked_context(c_context->target_env, consumer); + linked_context.module()->SetHeader(header); + + // Phase 3: Merge all the binaries into a single one. + libspirv::AssemblyGrammar grammar(c_context); + res = MergeModules(consumer, modules, grammar, &linked_context); + if (res != SPV_SUCCESS) return res; + + if (options.GetVerifyIds()) { + res = VerifyIds(consumer, &linked_context); + if (res != SPV_SUCCESS) return res; + } + + // Phase 4: Find the import/export pairs + LinkageTable linkings_to_do; + res = GetImportExportPairs(consumer, linked_context, + *linked_context.get_def_use_mgr(), + *linked_context.get_decoration_mgr(), + options.GetAllowPartialLinkage(), &linkings_to_do); + if (res != SPV_SUCCESS) return res; + + // Phase 5: Ensure the import and export have the same types and decorations. + res = + CheckImportExportCompatibility(consumer, linkings_to_do, &linked_context); + if (res != SPV_SUCCESS) return res; + + // Phase 6: Remove duplicates + PassManager manager; + manager.SetMessageConsumer(consumer); + manager.AddPass(); + opt::Pass::Status pass_res = manager.Run(&linked_context); + if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA; + + // Phase 7: Rematch import variables/functions to export variables/functions + for (const auto& linking_entry : linkings_to_do) + linked_context.ReplaceAllUsesWith(linking_entry.imported_symbol.id, + linking_entry.exported_symbol.id); + + // Phase 8: Remove linkage specific instructions, such as import/export + // attributes, linkage capability, etc. if applicable + res = RemoveLinkageSpecificInstructions(consumer, options, linkings_to_do, + linked_context.get_decoration_mgr(), + &linked_context); + if (res != SPV_SUCCESS) return res; + + // Phase 9: Compact the IDs used in the module + manager.AddPass(); + pass_res = manager.Run(&linked_context); + if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA; + + // Phase 10: Output the module + linked_context.module()->ToBinary(linked_binary, true); + + return SPV_SUCCESS; +} + +static spv_result_t ShiftIdsInModules(const MessageConsumer& consumer, + std::vector* modules, + uint32_t* max_id_bound) { + spv_position_t position = {}; + + if (modules == nullptr) + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_DATA) + << "|modules| of ShiftIdsInModules should not be null."; + if (modules->empty()) + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_DATA) + << "|modules| of ShiftIdsInModules should not be empty."; + if (max_id_bound == nullptr) + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_DATA) + << "|max_id_bound| of ShiftIdsInModules should not be null."; + + uint32_t id_bound = modules->front()->IdBound() - 1u; + for (auto module_iter = modules->begin() + 1; module_iter != modules->end(); + ++module_iter) { + Module* module = *module_iter; + module->ForEachInst([&id_bound](Instruction* insn) { + insn->ForEachId([&id_bound](uint32_t* id) { *id += id_bound; }); + }); + id_bound += module->IdBound() - 1u; + if (id_bound > 0x3FFFFF) + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_ID) + << "The limit of IDs, 4194303, was exceeded:" + << " " << id_bound << " is the current ID bound."; + + // Invalidate the DefUseManager + module->context()->InvalidateAnalyses(ir::IRContext::kAnalysisDefUse); + } + ++id_bound; + if (id_bound > 0x3FFFFF) + return libspirv::DiagnosticStream(position, consumer, SPV_ERROR_INVALID_ID) + << "The limit of IDs, 4194303, was exceeded:" + << " " << id_bound << " is the current ID bound."; + + *max_id_bound = id_bound; + + return SPV_SUCCESS; +} + +static spv_result_t GenerateHeader(const MessageConsumer& consumer, + const std::vector& modules, + uint32_t max_id_bound, + ir::ModuleHeader* header) { + spv_position_t position = {}; + + if (modules.empty()) + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_DATA) + << "|modules| of GenerateHeader should not be empty."; + if (max_id_bound == 0u) + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_DATA) + << "|max_id_bound| of GenerateHeader should not be null."; + + uint32_t version = 0u; + for (const auto& module : modules) + version = std::max(version, module->version()); + + header->magic_number = SpvMagicNumber; + header->version = version; + header->generator = 17u; + header->bound = max_id_bound; + header->reserved = 0u; + + return SPV_SUCCESS; +} + +static spv_result_t MergeModules(const MessageConsumer& consumer, + const std::vector& input_modules, + const libspirv::AssemblyGrammar& grammar, + IRContext* linked_context) { + spv_position_t position = {}; + + if (linked_context == nullptr) + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_DATA) + << "|linked_module| of MergeModules should not be null."; + Module* linked_module = linked_context->module(); + + if (input_modules.empty()) return SPV_SUCCESS; + + for (const auto& module : input_modules) + for (const auto& inst : module->capabilities()) + linked_module->AddCapability( + std::unique_ptr(inst.Clone(linked_context))); + + for (const auto& module : input_modules) + for (const auto& inst : module->extensions()) + linked_module->AddExtension( + std::unique_ptr(inst.Clone(linked_context))); + + for (const auto& module : input_modules) + for (const auto& inst : module->ext_inst_imports()) + linked_module->AddExtInstImport( + std::unique_ptr(inst.Clone(linked_context))); + + do { + const Instruction* memory_model_inst = input_modules[0]->GetMemoryModel(); + if (memory_model_inst == nullptr) break; + + uint32_t addressing_model = memory_model_inst->GetSingleWordOperand(0u); + uint32_t memory_model = memory_model_inst->GetSingleWordOperand(1u); + for (const auto& module : input_modules) { + memory_model_inst = module->GetMemoryModel(); + if (memory_model_inst == nullptr) continue; + + if (addressing_model != memory_model_inst->GetSingleWordOperand(0u)) { + spv_operand_desc initial_desc = nullptr, current_desc = nullptr; + grammar.lookupOperand(SPV_OPERAND_TYPE_ADDRESSING_MODEL, + addressing_model, &initial_desc); + grammar.lookupOperand(SPV_OPERAND_TYPE_ADDRESSING_MODEL, + memory_model_inst->GetSingleWordOperand(0u), + ¤t_desc); + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INTERNAL) + << "Conflicting addressing models: " << initial_desc->name + << " vs " << current_desc->name << "."; + } + if (memory_model != memory_model_inst->GetSingleWordOperand(1u)) { + spv_operand_desc initial_desc = nullptr, current_desc = nullptr; + grammar.lookupOperand(SPV_OPERAND_TYPE_MEMORY_MODEL, memory_model, + &initial_desc); + grammar.lookupOperand(SPV_OPERAND_TYPE_MEMORY_MODEL, + memory_model_inst->GetSingleWordOperand(1u), + ¤t_desc); + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INTERNAL) + << "Conflicting memory models: " << initial_desc->name << " vs " + << current_desc->name << "."; + } + } + + if (memory_model_inst != nullptr) + linked_module->SetMemoryModel(std::unique_ptr( + memory_model_inst->Clone(linked_context))); + } while (false); + + std::vector> entry_points; + for (const auto& module : input_modules) + for (const auto& inst : module->entry_points()) { + const uint32_t model = inst.GetSingleWordInOperand(0); + const char* const name = + reinterpret_cast(inst.GetInOperand(2).words.data()); + const auto i = std::find_if( + entry_points.begin(), entry_points.end(), + [model, name](const std::pair& v) { + return v.first == model && strcmp(name, v.second) == 0; + }); + if (i != entry_points.end()) { + spv_operand_desc desc = nullptr; + grammar.lookupOperand(SPV_OPERAND_TYPE_EXECUTION_MODEL, model, &desc); + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INTERNAL) + << "The entry point \"" << name << "\", with execution model " + << desc->name << ", was already defined."; + } + linked_module->AddEntryPoint( + std::unique_ptr(inst.Clone(linked_context))); + entry_points.emplace_back(model, name); + } + + for (const auto& module : input_modules) + for (const auto& inst : module->execution_modes()) + linked_module->AddExecutionMode( + std::unique_ptr(inst.Clone(linked_context))); + + for (const auto& module : input_modules) + for (const auto& inst : module->debugs1()) + linked_module->AddDebug1Inst( + std::unique_ptr(inst.Clone(linked_context))); + + for (const auto& module : input_modules) + for (const auto& inst : module->debugs2()) + linked_module->AddDebug2Inst( + std::unique_ptr(inst.Clone(linked_context))); + + for (const auto& module : input_modules) + for (const auto& inst : module->debugs3()) + linked_module->AddDebug3Inst( + std::unique_ptr(inst.Clone(linked_context))); + + // If the generated module uses SPIR-V 1.1 or higher, add an + // OpModuleProcessed instruction about the linking step. + if (linked_module->version() >= 0x10100) { + const std::string processed_string("Linked by SPIR-V Tools Linker"); + const size_t words_nb = + processed_string.size() / 4u + (processed_string.size() % 4u != 0u); + std::vector processed_words(words_nb, 0u); + std::memcpy(processed_words.data(), processed_string.data(), words_nb * 4u); + linked_module->AddDebug3Inst(std::unique_ptr( + new Instruction(linked_context, SpvOpModuleProcessed, 0u, 0u, + {{SPV_OPERAND_TYPE_LITERAL_STRING, processed_words}}))); + } + + for (const auto& module : input_modules) + for (const auto& inst : module->annotations()) + linked_module->AddAnnotationInst( + std::unique_ptr(inst.Clone(linked_context))); + + // TODO(pierremoreau): Since the modules have not been validate, should we + // expect SpvStorageClassFunction variables outside + // functions? + uint32_t num_global_values = 0u; + for (const auto& module : input_modules) { + for (const auto& inst : module->types_values()) { + linked_module->AddType( + std::unique_ptr(inst.Clone(linked_context))); + num_global_values += inst.opcode() == SpvOpVariable; + } + } + if (num_global_values > 0xFFFF) + return libspirv::DiagnosticStream(position, consumer, SPV_ERROR_INTERNAL) + << "The limit of global values, 65535, was exceeded;" + << " " << num_global_values << " global values were found."; + + // Process functions and their basic blocks + for (const auto& module : input_modules) { + for (const auto& func : *module) { + std::unique_ptr cloned_func(func.Clone(linked_context)); + cloned_func->SetParent(linked_module); + linked_module->AddFunction(std::move(cloned_func)); + } + } + + return SPV_SUCCESS; +} + +static spv_result_t GetImportExportPairs( + const MessageConsumer& consumer, const ir::IRContext& linked_context, + const DefUseManager& def_use_manager, + const DecorationManager& decoration_manager, bool allow_partial_linkage, + LinkageTable* linkings_to_do) { + spv_position_t position = {}; + + if (linkings_to_do == nullptr) + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_DATA) + << "|linkings_to_do| of GetImportExportPairs should not be empty."; + + std::vector imports; + std::unordered_map> exports; + + // Figure out the imports and exports + for (const auto& decoration : linked_context.annotations()) { + if (decoration.opcode() != SpvOpDecorate || + decoration.GetSingleWordInOperand(1u) != SpvDecorationLinkageAttributes) + continue; + + const SpvId id = decoration.GetSingleWordInOperand(0u); + // Ignore if the targeted symbol is a built-in + bool is_built_in = false; + for (const auto& id_decoration : + decoration_manager.GetDecorationsFor(id, false)) { + if (id_decoration->GetSingleWordInOperand(1u) == SpvDecorationBuiltIn) { + is_built_in = true; + break; + } + } + if (is_built_in) { + continue; + } + + const uint32_t type = decoration.GetSingleWordInOperand(3u); + + LinkageSymbolInfo symbol_info; + symbol_info.name = + reinterpret_cast(decoration.GetInOperand(2u).words.data()); + symbol_info.id = id; + symbol_info.type_id = 0u; + + // Retrieve the type of the current symbol. This information will be used + // when checking that the imported and exported symbols have the same + // types. + const Instruction* def_inst = def_use_manager.GetDef(id); + if (def_inst == nullptr) + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_BINARY) + << "ID " << id << " is never defined:\n"; + + if (def_inst->opcode() == SpvOpVariable) { + symbol_info.type_id = def_inst->type_id(); + } else if (def_inst->opcode() == SpvOpFunction) { + symbol_info.type_id = def_inst->GetSingleWordInOperand(1u); + + // range-based for loop calls begin()/end(), but never cbegin()/cend(), + // which will not work here. + for (auto func_iter = linked_context.module()->cbegin(); + func_iter != linked_context.module()->cend(); ++func_iter) { + if (func_iter->result_id() != id) continue; + func_iter->ForEachParam([&symbol_info](const Instruction* inst) { + symbol_info.parameter_ids.push_back(inst->result_id()); + }); + } + } else { + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_BINARY) + << "Only global variables and functions can be decorated using" + << " LinkageAttributes; " << id << " is neither of them.\n"; + } + + if (type == SpvLinkageTypeImport) + imports.push_back(symbol_info); + else if (type == SpvLinkageTypeExport) + exports[symbol_info.name].push_back(symbol_info); + } + + // Find the import/export pairs + for (const auto& import : imports) { + std::vector possible_exports; + const auto& exp = exports.find(import.name); + if (exp != exports.end()) possible_exports = exp->second; + if (possible_exports.empty() && !allow_partial_linkage) + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_BINARY) + << "Unresolved external reference to \"" << import.name << "\"."; + else if (possible_exports.size() > 1u) + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_BINARY) + << "Too many external references, " << possible_exports.size() + << ", were found for \"" << import.name << "\"."; + + if (!possible_exports.empty()) + linkings_to_do->emplace_back(import, possible_exports.front()); + } + + return SPV_SUCCESS; +} + +static spv_result_t CheckImportExportCompatibility( + const MessageConsumer& consumer, const LinkageTable& linkings_to_do, + ir::IRContext* context) { + spv_position_t position = {}; + + // Ensure th import and export types are the same. + const DefUseManager& def_use_manager = *context->get_def_use_mgr(); + const DecorationManager& decoration_manager = *context->get_decoration_mgr(); + for (const auto& linking_entry : linkings_to_do) { + if (!RemoveDuplicatesPass::AreTypesEqual( + *def_use_manager.GetDef(linking_entry.imported_symbol.type_id), + *def_use_manager.GetDef(linking_entry.exported_symbol.type_id), + context)) + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_BINARY) + << "Type mismatch on symbol \"" + << linking_entry.imported_symbol.name + << "\" between imported variable/function %" + << linking_entry.imported_symbol.id + << " and exported variable/function %" + << linking_entry.exported_symbol.id << "."; + } + + // Ensure the import and export decorations are similar + for (const auto& linking_entry : linkings_to_do) { + if (!decoration_manager.HaveTheSameDecorations( + linking_entry.imported_symbol.id, linking_entry.exported_symbol.id)) + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_BINARY) + << "Decorations mismatch on symbol \"" + << linking_entry.imported_symbol.name + << "\" between imported variable/function %" + << linking_entry.imported_symbol.id + << " and exported variable/function %" + << linking_entry.exported_symbol.id << "."; + // TODO(pierremoreau): Decorations on function parameters should probably + // match, except for FuncParamAttr if I understand the + // spec correctly. + // TODO(pierremoreau): Decorations on the function return type should + // match, except for FuncParamAttr. + } + + return SPV_SUCCESS; +} + +static spv_result_t RemoveLinkageSpecificInstructions( + const MessageConsumer& consumer, const LinkerOptions& options, + const LinkageTable& linkings_to_do, DecorationManager* decoration_manager, + ir::IRContext* linked_context) { + spv_position_t position = {}; + + if (decoration_manager == nullptr) + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_DATA) + << "|decoration_manager| of RemoveLinkageSpecificInstructions " + "should not be empty."; + if (linked_context == nullptr) + return libspirv::DiagnosticStream(position, consumer, + SPV_ERROR_INVALID_DATA) + << "|linked_module| of RemoveLinkageSpecificInstructions should not " + "be empty."; + + // TODO(pierremoreau): Remove FuncParamAttr decorations of imported + // functions' return type. + + // Remove FuncParamAttr decorations of imported functions' parameters. + // From the SPIR-V specification, Sec. 2.13: + // When resolving imported functions, the Function Control and all Function + // Parameter Attributes are taken from the function definition, and not + // from the function declaration. + for (const auto& linking_entry : linkings_to_do) { + for (const auto parameter_id : + linking_entry.imported_symbol.parameter_ids) { + decoration_manager->RemoveDecorationsFrom( + parameter_id, [](const Instruction& inst) { + return (inst.opcode() == SpvOpDecorate || + inst.opcode() == SpvOpMemberDecorate) && + inst.GetSingleWordInOperand(1u) == + SpvDecorationFuncParamAttr; + }); + } + } + + // Remove prototypes of imported functions + for (const auto& linking_entry : linkings_to_do) { + for (auto func_iter = linked_context->module()->begin(); + func_iter != linked_context->module()->end();) { + if (func_iter->result_id() == linking_entry.imported_symbol.id) + func_iter = func_iter.Erase(); + else + ++func_iter; + } + } + + // Remove declarations of imported variables + for (const auto& linking_entry : linkings_to_do) { + auto next = linked_context->types_values_begin(); + for (auto inst = next; inst != linked_context->types_values_end(); + inst = next) { + ++next; + if (inst->result_id() == linking_entry.imported_symbol.id) { + linked_context->KillInst(&*inst); + } + } + } + + // If partial linkage is allowed, we need an efficient way to check whether + // an imported ID had a corresponding export symbol. As uses of the imported + // symbol have already been replaced by the exported symbol, use the exported + // symbol ID. + // TODO(pierremoreau): This will not work if the decoration is applied + // through a group, but the linker does not support that + // either. + std::unordered_set imports; + if (options.GetAllowPartialLinkage()) { + imports.reserve(linkings_to_do.size()); + for (const auto& linking_entry : linkings_to_do) + imports.emplace(linking_entry.exported_symbol.id); + } + + // Remove import linkage attributes + auto next = linked_context->annotation_begin(); + for (auto inst = next; inst != linked_context->annotation_end(); + inst = next) { + ++next; + // If this is an import annotation: + // * if we do not allow partial linkage, remove all import annotations; + // * otherwise, remove the annotation only if there was a corresponding + // export. + if (inst->opcode() == SpvOpDecorate && + inst->GetSingleWordOperand(1u) == SpvDecorationLinkageAttributes && + inst->GetSingleWordOperand(3u) == SpvLinkageTypeImport && + (!options.GetAllowPartialLinkage() || + imports.find(inst->GetSingleWordOperand(0u)) != imports.end())) { + linked_context->KillInst(&*inst); + } + } + + // Remove export linkage attributes if making an executable + if (!options.GetCreateLibrary()) { + next = linked_context->annotation_begin(); + for (auto inst = next; inst != linked_context->annotation_end(); + inst = next) { + ++next; + if (inst->opcode() == SpvOpDecorate && + inst->GetSingleWordOperand(1u) == SpvDecorationLinkageAttributes && + inst->GetSingleWordOperand(3u) == SpvLinkageTypeExport) { + linked_context->KillInst(&*inst); + } + } + } + + // Remove Linkage capability if making an executable and partial linkage is + // not allowed + if (!options.GetCreateLibrary() && !options.GetAllowPartialLinkage()) { + for (auto& inst : linked_context->capabilities()) + if (inst.GetSingleWordInOperand(0u) == SpvCapabilityLinkage) { + linked_context->KillInst(&inst); + // The RemoveDuplicatesPass did remove duplicated capabilities, so we + // now there aren’t more SpvCapabilityLinkage further down. + break; + } + } + + return SPV_SUCCESS; +} + +spv_result_t VerifyIds(const MessageConsumer& consumer, + ir::IRContext* linked_context) { + std::unordered_set ids; + bool ok = true; + linked_context->module()->ForEachInst( + [&ids, &ok](const ir::Instruction* inst) { + ok &= ids.insert(inst->unique_id()).second; + }); + + if (!ok) { + consumer(SPV_MSG_INTERNAL_ERROR, "", {}, "Non-unique id in merged module"); + return SPV_ERROR_INVALID_ID; + } + + return SPV_SUCCESS; +} + +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/macro.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/macro.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/macro.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/macro.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,25 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_MACRO_H_ +#define LIBSPIRV_MACRO_H_ + +// Evaluates to the number of elements of array A. +// +// If we could use constexpr, then we could make this a template function. +// If the source arrays were std::array, then we could have used +// std::array::size. +#define ARRAY_SIZE(A) (static_cast(sizeof(A) / sizeof(A[0]))) + +#endif // LIBSPIRV_MACRO_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/message.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/message.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/message.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/message.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,54 @@ +// Copyright (c) 2016 Google 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. + +#include "message.h" + +#include + +namespace spvtools { + +std::string StringifyMessage(spv_message_level_t level, const char* source, + const spv_position_t& position, + const char* message) { + const char* level_string = nullptr; + switch (level) { + case SPV_MSG_FATAL: + level_string = "fatal"; + break; + case SPV_MSG_INTERNAL_ERROR: + level_string = "internal error"; + break; + case SPV_MSG_ERROR: + level_string = "error"; + break; + case SPV_MSG_WARNING: + level_string = "warning"; + break; + case SPV_MSG_INFO: + level_string = "info"; + break; + case SPV_MSG_DEBUG: + level_string = "debug"; + break; + } + std::ostringstream oss; + oss << level_string << ": "; + if (source) oss << source << ":"; + oss << position.line << ":" << position.column << ":"; + oss << position.index << ": "; + if (message) oss << message; + return oss.str(); +} + +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/message.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/message.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/message.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/message.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,33 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SPIRV_TOOLS_MESSAGE_H_ +#define SPIRV_TOOLS_MESSAGE_H_ + +#include + +#include "spirv-tools/libspirv.h" + +namespace spvtools { + +// A helper function to compose and return a string from the message in the +// following format: +// ": :::: " +std::string StringifyMessage(spv_message_level_t level, const char* source, + const spv_position_t& position, + const char* message); + +} // namespace spvtools + +#endif // SPIRV_TOOLS_MESSAGE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/name_mapper.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/name_mapper.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/name_mapper.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/name_mapper.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,332 @@ +// Copyright (c) 2016 Google 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. + +#include "name_mapper.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "spirv-tools/libspirv.h" + +#include "latest_version_spirv_header.h" +#include "parsed_operand.h" + +namespace { + +// Converts a uint32_t to its string decimal representation. +std::string to_string(uint32_t id) { + // Use stringstream, since some versions of Android compilers lack + // std::to_string. + std::stringstream os; + os << id; + return os.str(); +} + +} // anonymous namespace + +namespace libspirv { + +NameMapper GetTrivialNameMapper() { return to_string; } + +FriendlyNameMapper::FriendlyNameMapper(const spv_const_context context, + const uint32_t* code, + const size_t wordCount) + : grammar_(libspirv::AssemblyGrammar(context)) { + spv_diagnostic diag = nullptr; + // We don't care if the parse fails. + spvBinaryParse(context, this, code, wordCount, nullptr, + ParseInstructionForwarder, &diag); + spvDiagnosticDestroy(diag); +} + +std::string FriendlyNameMapper::NameForId(uint32_t id) { + auto iter = name_for_id_.find(id); + if (iter == name_for_id_.end()) { + // It must have been an invalid module, so just return a trivial mapping. + // We don't care about uniqueness. + return to_string(id); + } else { + return iter->second; + } +} + +std::string FriendlyNameMapper::Sanitize(const std::string& suggested_name) { + if (suggested_name.empty()) return "_"; + // Otherwise, replace invalid characters by '_'. + std::string result; + std::string valid = + "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "_0123456789"; + std::transform(suggested_name.begin(), suggested_name.end(), + std::back_inserter(result), [&valid](const char c) { + return (std::string::npos == valid.find(c)) ? '_' : c; + }); + return result; +} + +void FriendlyNameMapper::SaveName(uint32_t id, + const std::string& suggested_name) { + if (name_for_id_.find(id) != name_for_id_.end()) return; + + const std::string sanitized_suggested_name = Sanitize(suggested_name); + std::string name = sanitized_suggested_name; + auto inserted = used_names_.insert(name); + if (!inserted.second) { + const std::string base_name = sanitized_suggested_name + "_"; + for (uint32_t index = 0; !inserted.second; ++index) { + name = base_name + to_string(index); + inserted = used_names_.insert(name); + } + } + name_for_id_[id] = name; +} + +void FriendlyNameMapper::SaveBuiltInName(uint32_t target_id, + uint32_t built_in) { +#define GLCASE(name) \ + case SpvBuiltIn##name: \ + SaveName(target_id, "gl_" #name); \ + return; +#define GLCASE2(name, suggested) \ + case SpvBuiltIn##name: \ + SaveName(target_id, "gl_" #suggested); \ + return; +#define CASE(name) \ + case SpvBuiltIn##name: \ + SaveName(target_id, #name); \ + return; + switch (built_in) { + GLCASE(Position) + GLCASE(PointSize) + GLCASE(ClipDistance) + GLCASE(CullDistance) + GLCASE2(VertexId, VertexID) + GLCASE2(InstanceId, InstanceID) + GLCASE2(PrimitiveId, PrimitiveID) + GLCASE2(InvocationId, InvocationID) + GLCASE(Layer) + GLCASE(ViewportIndex) + GLCASE(TessLevelOuter) + GLCASE(TessLevelInner) + GLCASE(TessCoord) + GLCASE(PatchVertices) + GLCASE(FragCoord) + GLCASE(PointCoord) + GLCASE(FrontFacing) + GLCASE2(SampleId, SampleID) + GLCASE(SamplePosition) + GLCASE(SampleMask) + GLCASE(FragDepth) + GLCASE(HelperInvocation) + GLCASE2(NumWorkgroups, NumWorkGroups) + GLCASE2(WorkgroupSize, WorkGroupSize) + GLCASE2(WorkgroupId, WorkGroupID) + GLCASE2(LocalInvocationId, LocalInvocationID) + GLCASE2(GlobalInvocationId, GlobalInvocationID) + GLCASE(LocalInvocationIndex) + CASE(WorkDim) + CASE(GlobalSize) + CASE(EnqueuedWorkgroupSize) + CASE(GlobalOffset) + CASE(GlobalLinearId) + CASE(SubgroupSize) + CASE(SubgroupMaxSize) + CASE(NumSubgroups) + CASE(NumEnqueuedSubgroups) + CASE(SubgroupId) + CASE(SubgroupLocalInvocationId) + GLCASE(VertexIndex) + GLCASE(InstanceIndex) + CASE(SubgroupEqMaskKHR) + CASE(SubgroupGeMaskKHR) + CASE(SubgroupGtMaskKHR) + CASE(SubgroupLeMaskKHR) + CASE(SubgroupLtMaskKHR) + default: + break; + } +#undef GLCASE +#undef GLCASE2 +#undef CASE +} + +spv_result_t FriendlyNameMapper::ParseInstruction( + const spv_parsed_instruction_t& inst) { + const auto result_id = inst.result_id; + switch (inst.opcode) { + case SpvOpName: + SaveName(inst.words[1], reinterpret_cast(inst.words + 2)); + break; + case SpvOpDecorate: + // Decorations come after OpName. So OpName will take precedence over + // decorations. + // + // In theory, we should also handle OpGroupDecorate. But that's unlikely + // to occur. + if (inst.words[2] == SpvDecorationBuiltIn) { + assert(inst.num_words > 3); + SaveBuiltInName(inst.words[1], inst.words[3]); + } + break; + case SpvOpTypeVoid: + SaveName(result_id, "void"); + break; + case SpvOpTypeBool: + SaveName(result_id, "bool"); + break; + case SpvOpTypeInt: { + std::string signedness; + std::string root; + const auto bit_width = inst.words[2]; + switch (bit_width) { + case 8: + root = "char"; + break; + case 16: + root = "short"; + break; + case 32: + root = "int"; + break; + case 64: + root = "long"; + break; + default: + root = to_string(bit_width); + signedness = "i"; + break; + } + if (0 == inst.words[3]) signedness = "u"; + SaveName(result_id, signedness + root); + } break; + case SpvOpTypeFloat: { + const auto bit_width = inst.words[2]; + switch (bit_width) { + case 16: + SaveName(result_id, "half"); + break; + case 32: + SaveName(result_id, "float"); + break; + case 64: + SaveName(result_id, "double"); + break; + default: + SaveName(result_id, std::string("fp") + to_string(bit_width)); + break; + } + } break; + case SpvOpTypeVector: + SaveName(result_id, std::string("v") + to_string(inst.words[3]) + + NameForId(inst.words[2])); + break; + case SpvOpTypeMatrix: + SaveName(result_id, std::string("mat") + to_string(inst.words[3]) + + NameForId(inst.words[2])); + break; + case SpvOpTypeArray: + SaveName(result_id, std::string("_arr_") + NameForId(inst.words[2]) + + "_" + NameForId(inst.words[3])); + break; + case SpvOpTypeRuntimeArray: + SaveName(result_id, + std::string("_runtimearr_") + NameForId(inst.words[2])); + break; + case SpvOpTypePointer: + SaveName(result_id, std::string("_ptr_") + + NameForEnumOperand(SPV_OPERAND_TYPE_STORAGE_CLASS, + inst.words[2]) + + "_" + NameForId(inst.words[3])); + break; + case SpvOpTypePipe: + SaveName(result_id, + std::string("Pipe") + + NameForEnumOperand(SPV_OPERAND_TYPE_ACCESS_QUALIFIER, + inst.words[2])); + break; + case SpvOpTypeEvent: + SaveName(result_id, "Event"); + break; + case SpvOpTypeDeviceEvent: + SaveName(result_id, "DeviceEvent"); + break; + case SpvOpTypeReserveId: + SaveName(result_id, "ReserveId"); + break; + case SpvOpTypeQueue: + SaveName(result_id, "Queue"); + break; + case SpvOpTypeOpaque: + SaveName(result_id, + std::string("Opaque_") + + Sanitize(reinterpret_cast(inst.words + 2))); + break; + case SpvOpTypePipeStorage: + SaveName(result_id, "PipeStorage"); + break; + case SpvOpTypeNamedBarrier: + SaveName(result_id, "NamedBarrier"); + break; + case SpvOpTypeStruct: + // Structs are mapped rather simplisitically. Just indicate that they + // are a struct and then give the raw Id number. + SaveName(result_id, std::string("_struct_") + to_string(result_id)); + break; + case SpvOpConstantTrue: + SaveName(result_id, "true"); + break; + case SpvOpConstantFalse: + SaveName(result_id, "false"); + break; + case SpvOpConstant: { + std::ostringstream value; + EmitNumericLiteral(&value, inst, inst.operands[2]); + auto value_str = value.str(); + // Use 'n' to signify negative. Other invalid characters will be mapped + // to underscore. + for (auto& c : value_str) + if (c == '-') c = 'n'; + SaveName(result_id, NameForId(inst.type_id) + "_" + value_str); + } break; + default: + // If this instruction otherwise defines an Id, then save a mapping for + // it. This is needed to ensure uniqueness in there is an OpName with + // string something like "1" that might collide with this result_id. + // We should only do this if a name hasn't already been registered by some + // previous forward reference. + if (result_id && name_for_id_.find(result_id) == name_for_id_.end()) + SaveName(result_id, to_string(result_id)); + break; + } + return SPV_SUCCESS; +} + +std::string FriendlyNameMapper::NameForEnumOperand(spv_operand_type_t type, + uint32_t word) { + spv_operand_desc desc = nullptr; + if (SPV_SUCCESS == grammar_.lookupOperand(type, word, &desc)) { + return desc->name; + } else { + // Invalid input. Just give something sane. + return std::string("StorageClass") + to_string(word); + } +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/name_mapper.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/name_mapper.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/name_mapper.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/name_mapper.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,122 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_NAME_MAPPER_H_ +#define LIBSPIRV_NAME_MAPPER_H_ + +#include +#include +#include +#include + +#include "assembly_grammar.h" +#include "spirv-tools/libspirv.h" + +namespace libspirv { + +// A NameMapper maps SPIR-V Id values to names. Each name is valid to use in +// SPIR-V assembly. The mapping is one-to-one, i.e. no two Ids map to the same +// name. +using NameMapper = std::function; + +// Returns a NameMapper which always maps an Id to its decimal representation. +NameMapper GetTrivialNameMapper(); + +// A FriendlyNameMapper parses a module upon construction. If the parse is +// successful, then the NameForId method maps an Id to a friendly name +// while also satisfying the constraints on a NameMapper. +// +// The mapping is friendly in the following sense: +// - If an Id has a debug name (via OpName), then that will be used when +// possible. +// - Well known scalar types map to friendly names. For example, +// OpTypeVoid should be %void. Scalar types map to their names in OpenCL +// when +// there is a correspondence, and otherwise as follows: +// - unsigned integer type of n bits map to "u" followed by n +// - signed integer type of n bits map to "i" followed by n +// - floating point type of n bits map to "fp" followed by n +// - Vector type names map to "v" followed by the number of components, +// followed by the friendly name for the base type. +// - Matrix type names map to "mat" followed by the number of columns, +// followed by the friendly name for the base vector type. +// - Pointer types map to "_ptr_", then the name of the storage class, then the +// name for the pointee type. +// - Exotic types like event, pipe, opaque, queue, reserve-id map to their own +// human readable names. +// - A struct type maps to "_struct_" followed by the raw Id number. That's +// pretty simplistic, but workable. +// - A built-in variable maps to its GLSL variable name. +// - Numeric literals in OpConstant map to a human-friendly name. +class FriendlyNameMapper { + public: + // Construct a friendly name mapper, and determine friendly names for each + // defined Id in the specified module. The module is specified by the code + // wordCount, and should be parseable in the specified context. + FriendlyNameMapper(const spv_const_context context, const uint32_t* code, + const size_t wordCount); + + // Returns a NameMapper which maps ids to the friendly names parsed from the + // module provided to the constructor. + NameMapper GetNameMapper() { + return [this](uint32_t id) { return this->NameForId(id); }; + } + + // Returns the friendly name for the given id. If the module parsed during + // construction is valid, then the mapping satisfies the rules for a + // NameMapper. + std::string NameForId(uint32_t id); + + private: + // Transforms the given string so that it is acceptable as an Id name in + // assembly language. Two distinct inputs can map to the same output. + std::string Sanitize(const std::string& suggested_name); + + // Records a name for the given id. If this id already has a name, then + // this is a no-op. If the id doesn't have a name, use the given + // suggested_name if it hasn't already been taken, and otherwise generate + // a new (unused) name based on the suggested name. + void SaveName(uint32_t id, const std::string& suggested_name); + + // Records a built-in variable name for target_id. If target_id already + // has a name then this is a no-op. + void SaveBuiltInName(uint32_t target_id, uint32_t built_in); + + // Collects information from the given parsed instruction to populate + // name_for_id_. Returns SPV_SUCCESS; + spv_result_t ParseInstruction(const spv_parsed_instruction_t& inst); + + // Forwards a parsed-instruction callback from the binary parser into the + // FriendlyNameMapper hidden inside the user_data parameter. + static spv_result_t ParseInstructionForwarder( + void* user_data, const spv_parsed_instruction_t* parsed_instruction) { + return reinterpret_cast(user_data)->ParseInstruction( + *parsed_instruction); + } + + // Returns the friendly name for an enumerant. + std::string NameForEnumOperand(spv_operand_type_t type, uint32_t word); + + // Maps an id to its friendly name. This will have an entry for each Id + // defined in the module. + std::unordered_map name_for_id_; + // The set of names that have a mapping in name_for_id_; + std::unordered_set used_names_; + // The assembly grammar for the current context. + const libspirv::AssemblyGrammar grammar_; +}; + +} // namespace libspirv + +#endif // _LIBSPIRV_NAME_MAPPER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opcode.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opcode.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opcode.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opcode.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,455 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "opcode.h" + +#include +#include + +#include +#include + +#include "instruction.h" +#include "macro.h" +#include "spirv-tools/libspirv.h" +#include "spirv_constant.h" +#include "spirv_endian.h" + +namespace { +struct OpcodeDescPtrLen { + const spv_opcode_desc_t* ptr; + uint32_t len; +}; + +#include "core.insts-unified1.inc" // defines kOpcodeTableEntries_1_3 + +static const spv_opcode_table_t kOpcodeTable = {ARRAY_SIZE(kOpcodeTableEntries), + kOpcodeTableEntries}; + +// Represents a vendor tool entry in the SPIR-V XML Regsitry. +struct VendorTool { + uint32_t value; + const char* vendor; + const char* tool; // Might be empty string. + const char* vendor_tool; // Combiantion of vendor and tool. +}; + +const VendorTool vendor_tools[] = { +#include "generators.inc" +}; + +} // anonymous namespace + +// TODO(dneto): Move this to another file. It doesn't belong with opcode +// processing. +const char* spvGeneratorStr(uint32_t generator) { + auto where = std::find_if( + std::begin(vendor_tools), std::end(vendor_tools), + [generator](const VendorTool& vt) { return generator == vt.value; }); + if (where != std::end(vendor_tools)) return where->vendor_tool; + return "Unknown"; +} + +uint32_t spvOpcodeMake(uint16_t wordCount, SpvOp opcode) { + return ((uint32_t)opcode) | (((uint32_t)wordCount) << 16); +} + +void spvOpcodeSplit(const uint32_t word, uint16_t* pWordCount, + uint16_t* pOpcode) { + if (pWordCount) { + *pWordCount = (uint16_t)((0xffff0000 & word) >> 16); + } + if (pOpcode) { + *pOpcode = 0x0000ffff & word; + } +} + +spv_result_t spvOpcodeTableGet(spv_opcode_table* pInstTable, spv_target_env) { + if (!pInstTable) return SPV_ERROR_INVALID_POINTER; + + // Descriptions of each opcode. Each entry describes the format of the + // instruction that follows a particular opcode. + + *pInstTable = &kOpcodeTable; + return SPV_SUCCESS; +} + +spv_result_t spvOpcodeTableNameLookup(spv_target_env env, + const spv_opcode_table table, + const char* name, + spv_opcode_desc* pEntry) { + if (!name || !pEntry) return SPV_ERROR_INVALID_POINTER; + if (!table) return SPV_ERROR_INVALID_TABLE; + + // TODO: This lookup of the Opcode table is suboptimal! Binary sort would be + // preferable but the table requires sorting on the Opcode name, but it's + // static const initialized and matches the order of the spec. + const size_t nameLength = strlen(name); + for (uint64_t opcodeIndex = 0; opcodeIndex < table->count; ++opcodeIndex) { + const spv_opcode_desc_t& entry = table->entries[opcodeIndex]; + // We considers the current opcode as available as long as + // 1. The target environment satisfies the minimal requirement of the + // opcode; or + // 2. There is at least one extension enabling this opcode. + // + // Note that the second rule assumes the extension enabling this instruction + // is indeed requested in the SPIR-V code; checking that should be + // validator's work. + if ((spvVersionForTargetEnv(env) >= entry.minVersion || + entry.numExtensions > 0u) && + nameLength == strlen(entry.name) && + !strncmp(name, entry.name, nameLength)) { + // NOTE: Found out Opcode! + *pEntry = &entry; + return SPV_SUCCESS; + } + } + + return SPV_ERROR_INVALID_LOOKUP; +} + +spv_result_t spvOpcodeTableValueLookup(spv_target_env env, + const spv_opcode_table table, + const SpvOp opcode, + spv_opcode_desc* pEntry) { + if (!table) return SPV_ERROR_INVALID_TABLE; + if (!pEntry) return SPV_ERROR_INVALID_POINTER; + + const auto beg = table->entries; + const auto end = table->entries + table->count; + + spv_opcode_desc_t needle = {"", opcode, 0, nullptr, 0, {}, + false, false, 0, nullptr, ~0u}; + + auto comp = [](const spv_opcode_desc_t& lhs, const spv_opcode_desc_t& rhs) { + return lhs.opcode < rhs.opcode; + }; + + // We need to loop here because there can exist multiple symbols for the same + // opcode value, and they can be introduced in different target environments, + // which means they can have different minimal version requirements. + // Assumes the underlying table is already sorted ascendingly according to + // opcode value. + for (auto it = std::lower_bound(beg, end, needle, comp); + it != end && it->opcode == opcode; ++it) { + // We considers the current opcode as available as long as + // 1. The target environment satisfies the minimal requirement of the + // opcode; or + // 2. There is at least one extension enabling this opcode. + // + // Note that the second rule assumes the extension enabling this instruction + // is indeed requested in the SPIR-V code; checking that should be + // validator's work. + if (spvVersionForTargetEnv(env) >= it->minVersion || + it->numExtensions > 0u) { + *pEntry = it; + return SPV_SUCCESS; + } + } + + return SPV_ERROR_INVALID_LOOKUP; +} + +void spvInstructionCopy(const uint32_t* words, const SpvOp opcode, + const uint16_t wordCount, const spv_endianness_t endian, + spv_instruction_t* pInst) { + pInst->opcode = opcode; + pInst->words.resize(wordCount); + for (uint16_t wordIndex = 0; wordIndex < wordCount; ++wordIndex) { + pInst->words[wordIndex] = spvFixWord(words[wordIndex], endian); + if (!wordIndex) { + uint16_t thisWordCount; + uint16_t thisOpcode; + spvOpcodeSplit(pInst->words[wordIndex], &thisWordCount, &thisOpcode); + assert(opcode == static_cast(thisOpcode) && + wordCount == thisWordCount && "Endianness failed!"); + } + } +} + +const char* spvOpcodeString(const SpvOp opcode) { + const auto beg = kOpcodeTableEntries; + const auto end = kOpcodeTableEntries + ARRAY_SIZE(kOpcodeTableEntries); + spv_opcode_desc_t needle = {"", opcode, 0, nullptr, 0, {}, + false, false, 0, nullptr, ~0u}; + auto comp = [](const spv_opcode_desc_t& lhs, const spv_opcode_desc_t& rhs) { + return lhs.opcode < rhs.opcode; + }; + auto it = std::lower_bound(beg, end, needle, comp); + if (it != end && it->opcode == opcode) { + return it->name; + } + + assert(0 && "Unreachable!"); + return "unknown"; +} + +int32_t spvOpcodeIsScalarType(const SpvOp opcode) { + switch (opcode) { + case SpvOpTypeInt: + case SpvOpTypeFloat: + case SpvOpTypeBool: + return true; + default: + return false; + } +} + +int32_t spvOpcodeIsSpecConstant(const SpvOp opcode) { + switch (opcode) { + case SpvOpSpecConstantTrue: + case SpvOpSpecConstantFalse: + case SpvOpSpecConstant: + case SpvOpSpecConstantComposite: + case SpvOpSpecConstantOp: + return true; + default: + return false; + } +} + +int32_t spvOpcodeIsConstant(const SpvOp opcode) { + switch (opcode) { + case SpvOpConstantTrue: + case SpvOpConstantFalse: + case SpvOpConstant: + case SpvOpConstantComposite: + case SpvOpConstantSampler: + case SpvOpConstantNull: + case SpvOpSpecConstantTrue: + case SpvOpSpecConstantFalse: + case SpvOpSpecConstant: + case SpvOpSpecConstantComposite: + case SpvOpSpecConstantOp: + return true; + default: + return false; + } +} + +bool spvOpcodeIsConstantOrUndef(const SpvOp opcode) { + return opcode == SpvOpUndef || spvOpcodeIsConstant(opcode); +} + +bool spvOpcodeIsScalarSpecConstant(const SpvOp opcode) { + switch (opcode) { + case SpvOpSpecConstantTrue: + case SpvOpSpecConstantFalse: + case SpvOpSpecConstant: + return true; + default: + return false; + } +} + +int32_t spvOpcodeIsComposite(const SpvOp opcode) { + switch (opcode) { + case SpvOpTypeVector: + case SpvOpTypeMatrix: + case SpvOpTypeArray: + case SpvOpTypeStruct: + return true; + default: + return false; + } +} + +bool spvOpcodeReturnsLogicalVariablePointer(const SpvOp opcode) { + switch (opcode) { + case SpvOpVariable: + case SpvOpAccessChain: + case SpvOpInBoundsAccessChain: + case SpvOpFunctionParameter: + case SpvOpImageTexelPointer: + case SpvOpCopyObject: + case SpvOpSelect: + case SpvOpPhi: + case SpvOpFunctionCall: + case SpvOpPtrAccessChain: + case SpvOpLoad: + case SpvOpConstantNull: + return true; + default: + return false; + } +} + +int32_t spvOpcodeReturnsLogicalPointer(const SpvOp opcode) { + switch (opcode) { + case SpvOpVariable: + case SpvOpAccessChain: + case SpvOpInBoundsAccessChain: + case SpvOpFunctionParameter: + case SpvOpImageTexelPointer: + case SpvOpCopyObject: + return true; + default: + return false; + } +} + +int32_t spvOpcodeGeneratesType(SpvOp op) { + switch (op) { + case SpvOpTypeVoid: + case SpvOpTypeBool: + case SpvOpTypeInt: + case SpvOpTypeFloat: + case SpvOpTypeVector: + case SpvOpTypeMatrix: + case SpvOpTypeImage: + case SpvOpTypeSampler: + case SpvOpTypeSampledImage: + case SpvOpTypeArray: + case SpvOpTypeRuntimeArray: + case SpvOpTypeStruct: + case SpvOpTypeOpaque: + case SpvOpTypePointer: + case SpvOpTypeFunction: + case SpvOpTypeEvent: + case SpvOpTypeDeviceEvent: + case SpvOpTypeReserveId: + case SpvOpTypeQueue: + case SpvOpTypePipe: + case SpvOpTypePipeStorage: + case SpvOpTypeNamedBarrier: + return true; + default: + // In particular, OpTypeForwardPointer does not generate a type, + // but declares a storage class for a pointer type generated + // by a different instruction. + break; + } + return 0; +} + +bool spvOpcodeIsDecoration(const SpvOp opcode) { + switch (opcode) { + case SpvOpDecorate: + case SpvOpDecorateId: + case SpvOpMemberDecorate: + case SpvOpGroupDecorate: + case SpvOpGroupMemberDecorate: + case SpvOpDecorateStringGOOGLE: + case SpvOpMemberDecorateStringGOOGLE: + return true; + default: + break; + } + return false; +} + +bool spvOpcodeIsLoad(const SpvOp opcode) { + switch (opcode) { + case SpvOpLoad: + case SpvOpImageSampleExplicitLod: + case SpvOpImageSampleImplicitLod: + case SpvOpImageSampleDrefImplicitLod: + case SpvOpImageSampleDrefExplicitLod: + case SpvOpImageSampleProjImplicitLod: + case SpvOpImageSampleProjExplicitLod: + case SpvOpImageSampleProjDrefImplicitLod: + case SpvOpImageSampleProjDrefExplicitLod: + case SpvOpImageFetch: + case SpvOpImageGather: + case SpvOpImageDrefGather: + case SpvOpImageRead: + case SpvOpImageSparseSampleImplicitLod: + case SpvOpImageSparseSampleExplicitLod: + case SpvOpImageSparseSampleDrefExplicitLod: + case SpvOpImageSparseSampleDrefImplicitLod: + case SpvOpImageSparseFetch: + case SpvOpImageSparseGather: + case SpvOpImageSparseDrefGather: + case SpvOpImageSparseRead: + return true; + default: + return false; + } +} + +bool spvOpcodeIsBranch(SpvOp opcode) { + switch (opcode) { + case SpvOpBranch: + case SpvOpBranchConditional: + case SpvOpSwitch: + return true; + default: + return false; + } +} + +bool spvOpcodeIsAtomicOp(const SpvOp opcode) { + switch (opcode) { + case SpvOpAtomicLoad: + case SpvOpAtomicStore: + case SpvOpAtomicExchange: + case SpvOpAtomicCompareExchange: + case SpvOpAtomicCompareExchangeWeak: + case SpvOpAtomicIIncrement: + case SpvOpAtomicIDecrement: + case SpvOpAtomicIAdd: + case SpvOpAtomicISub: + case SpvOpAtomicSMin: + case SpvOpAtomicUMin: + case SpvOpAtomicSMax: + case SpvOpAtomicUMax: + case SpvOpAtomicAnd: + case SpvOpAtomicOr: + case SpvOpAtomicXor: + case SpvOpAtomicFlagTestAndSet: + case SpvOpAtomicFlagClear: + return true; + default: + return false; + } +} + +bool spvOpcodeIsReturn(SpvOp opcode) { + switch (opcode) { + case SpvOpReturn: + case SpvOpReturnValue: + return true; + default: + return false; + } +} + +bool spvOpcodeIsReturnOrAbort(SpvOp opcode) { + return spvOpcodeIsReturn(opcode) || opcode == SpvOpKill || + opcode == SpvOpUnreachable; +} + +bool spvOpcodeIsBlockTerminator(SpvOp opcode) { + return spvOpcodeIsBranch(opcode) || spvOpcodeIsReturnOrAbort(opcode); +} + +bool spvOpcodeIsBaseOpaqueType(SpvOp opcode) { + switch (opcode) { + case SpvOpTypeImage: + case SpvOpTypeSampler: + case SpvOpTypeSampledImage: + case SpvOpTypeOpaque: + case SpvOpTypeEvent: + case SpvOpTypeDeviceEvent: + case SpvOpTypeReserveId: + case SpvOpTypeQueue: + case SpvOpTypePipe: + case SpvOpTypeForwardPointer: + case SpvOpTypePipeStorage: + case SpvOpTypeNamedBarrier: + return true; + default: + return false; + } +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opcode.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opcode.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opcode.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opcode.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,121 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPCODE_H_ +#define LIBSPIRV_OPCODE_H_ + +#include "instruction.h" +#include "latest_version_spirv_header.h" +#include "spirv-tools/libspirv.h" +#include "table.h" + +// Returns the name of a registered SPIR-V generator as a null-terminated +// string. If the generator is not known, then returns the string "Unknown". +// The generator parameter should be most significant 16-bits of the generator +// word in the SPIR-V module header. +// +// See the registry at https://www.khronos.org/registry/spir-v/api/spir-v.xml. +const char* spvGeneratorStr(uint32_t generator); + +// Combines word_count and opcode enumerant in single word. +uint32_t spvOpcodeMake(uint16_t word_count, SpvOp opcode); + +// Splits word into into two constituent parts: word_count and opcode. +void spvOpcodeSplit(const uint32_t word, uint16_t* word_count, + uint16_t* opcode); + +// Finds the named opcode in the given opcode table. On success, returns +// SPV_SUCCESS and writes a handle of the table entry into *entry. +spv_result_t spvOpcodeTableNameLookup(spv_target_env, + const spv_opcode_table table, + const char* name, spv_opcode_desc* entry); + +// Finds the opcode by enumerant in the given opcode table. On success, returns +// SPV_SUCCESS and writes a handle of the table entry into *entry. +spv_result_t spvOpcodeTableValueLookup(spv_target_env, + const spv_opcode_table table, + const SpvOp opcode, + spv_opcode_desc* entry); + +// Copies an instruction's word and fixes the endianness to host native. The +// source instruction's stream/opcode/endianness is in the words/opcode/endian +// parameter. The word_count parameter specifies the number of words to copy. +// Writes copied instruction into *inst. +void spvInstructionCopy(const uint32_t* words, const SpvOp opcode, + const uint16_t word_count, + const spv_endianness_t endian, spv_instruction_t* inst); + +// Gets the name of an instruction, without the "Op" prefix. +const char* spvOpcodeString(const SpvOp opcode); + +// Determine if the given opcode is a scalar type. Returns zero if false, +// non-zero otherwise. +int32_t spvOpcodeIsScalarType(const SpvOp opcode); + +// Determines if the given opcode is a specialization constant. Returns zero if +// false, non-zero otherwise. +int32_t spvOpcodeIsSpecConstant(const SpvOp opcode); + +// Determines if the given opcode is a constant. Returns zero if false, non-zero +// otherwise. +int32_t spvOpcodeIsConstant(const SpvOp opcode); + +// Returns true if the given opcode is a constant or undef. +bool spvOpcodeIsConstantOrUndef(const SpvOp opcode); + +// Returns true if the given opcode is a scalar specialization constant. +bool spvOpcodeIsScalarSpecConstant(const SpvOp opcode); + +// Determines if the given opcode is a composite type. Returns zero if false, +// non-zero otherwise. +int32_t spvOpcodeIsComposite(const SpvOp opcode); + +// Determines if the given opcode results in a pointer when using the logical +// addressing model. Returns zero if false, non-zero otherwise. +int32_t spvOpcodeReturnsLogicalPointer(const SpvOp opcode); + +// Returns whether the given opcode could result in a pointer or a variable +// pointer when using the logical addressing model. +bool spvOpcodeReturnsLogicalVariablePointer(const SpvOp opcode); + +// Determines if the given opcode generates a type. Returns zero if false, +// non-zero otherwise. +int32_t spvOpcodeGeneratesType(SpvOp opcode); + +// Returns true if the opcode adds a decoration to an id. +bool spvOpcodeIsDecoration(const SpvOp opcode); + +// Returns true if the opcode is a load from memory into a result id. This +// function only considers core instructions. +bool spvOpcodeIsLoad(const SpvOp opcode); + +// Returns true if the opcode is an atomic operation. +bool spvOpcodeIsAtomicOp(const SpvOp opcode); + +// Returns true if the given opcode is a branch instruction. +bool spvOpcodeIsBranch(SpvOp opcode); + +// Returns true if the given opcode is a return instruction. +bool spvOpcodeIsReturn(SpvOp opcode); + +// Returns true if the given opcode is a return instruction or it aborts +// execution. +bool spvOpcodeIsReturnOrAbort(SpvOp opcode); + +// Returns true if the given opcode is a basic block terminator. +bool spvOpcodeIsBlockTerminator(SpvOp opcode); + +// Returns true if the given opcode always defines an opaque type. +bool spvOpcodeIsBaseOpaqueType(SpvOp opcode); +#endif // LIBSPIRV_OPCODE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/operand.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/operand.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/operand.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/operand.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,469 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "operand.h" + +#include +#include +#include + +#include "macro.h" +#include "spirv_constant.h" + +// For now, assume unified1 contains up to SPIR-V 1.3 and no later +// SPIR-V version. +// TODO(dneto): Make one set of tables, but with version tags on a +// per-item basis. https://github.com/KhronosGroup/SPIRV-Tools/issues/1195 + +#include "operand.kinds-unified1.inc" + +static const spv_operand_table_t kOperandTable = { + ARRAY_SIZE(pygen_variable_OperandInfoTable), + pygen_variable_OperandInfoTable}; + +spv_result_t spvOperandTableGet(spv_operand_table* pOperandTable, + spv_target_env) { + if (!pOperandTable) return SPV_ERROR_INVALID_POINTER; + + *pOperandTable = &kOperandTable; + return SPV_SUCCESS; +} + +spv_result_t spvOperandTableNameLookup(spv_target_env env, + const spv_operand_table table, + const spv_operand_type_t type, + const char* name, + const size_t nameLength, + spv_operand_desc* pEntry) { + if (!table) return SPV_ERROR_INVALID_TABLE; + if (!name || !pEntry) return SPV_ERROR_INVALID_POINTER; + + for (uint64_t typeIndex = 0; typeIndex < table->count; ++typeIndex) { + const auto& group = table->types[typeIndex]; + if (type != group.type) continue; + for (uint64_t index = 0; index < group.count; ++index) { + const auto& entry = group.entries[index]; + // We considers the current operand as available as long as + // 1. The target environment satisfies the minimal requirement of the + // operand; or + // 2. There is at least one extension enabling this operand. + // + // Note that the second rule assumes the extension enabling this operand + // is indeed requested in the SPIR-V code; checking that should be + // validator's work. + if ((spvVersionForTargetEnv(env) >= entry.minVersion || + entry.numExtensions > 0u) && + nameLength == strlen(entry.name) && + !strncmp(entry.name, name, nameLength)) { + *pEntry = &entry; + return SPV_SUCCESS; + } + } + } + + return SPV_ERROR_INVALID_LOOKUP; +} + +spv_result_t spvOperandTableValueLookup(spv_target_env env, + const spv_operand_table table, + const spv_operand_type_t type, + const uint32_t value, + spv_operand_desc* pEntry) { + if (!table) return SPV_ERROR_INVALID_TABLE; + if (!pEntry) return SPV_ERROR_INVALID_POINTER; + + spv_operand_desc_t needle = {"", value, 0, nullptr, 0, nullptr, {}, ~0u}; + + auto comp = [](const spv_operand_desc_t& lhs, const spv_operand_desc_t& rhs) { + return lhs.value < rhs.value; + }; + + for (uint64_t typeIndex = 0; typeIndex < table->count; ++typeIndex) { + const auto& group = table->types[typeIndex]; + if (type != group.type) continue; + + const auto beg = group.entries; + const auto end = group.entries + group.count; + + // We need to loop here because there can exist multiple symbols for the + // same operand value, and they can be introduced in different target + // environments, which means they can have different minimal version + // requirements. For example, SubgroupEqMaskKHR can exist in any SPIR-V + // version as long as the SPV_KHR_shader_ballot extension is there; but + // starting from SPIR-V 1.3, SubgroupEqMask, which has the same numeric + // value as SubgroupEqMaskKHR, is available in core SPIR-V without extension + // requirements. + // Assumes the underlying table is already sorted ascendingly according to + // opcode value. + for (auto it = std::lower_bound(beg, end, needle, comp); + it != end && it->value == value; ++it) { + // We considers the current operand as available as long as + // 1. The target environment satisfies the minimal requirement of the + // operand; or + // 2. There is at least one extension enabling this operand. + // + // Note that the second rule assumes the extension enabling this operand + // is indeed requested in the SPIR-V code; checking that should be + // validator's work. + if (spvVersionForTargetEnv(env) >= it->minVersion || + it->numExtensions > 0u) { + *pEntry = it; + return SPV_SUCCESS; + } + } + } + + return SPV_ERROR_INVALID_LOOKUP; +} + +const char* spvOperandTypeStr(spv_operand_type_t type) { + switch (type) { + case SPV_OPERAND_TYPE_ID: + case SPV_OPERAND_TYPE_OPTIONAL_ID: + return "ID"; + case SPV_OPERAND_TYPE_TYPE_ID: + return "type ID"; + case SPV_OPERAND_TYPE_RESULT_ID: + return "result ID"; + case SPV_OPERAND_TYPE_LITERAL_INTEGER: + case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER: + case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_NUMBER: + return "literal number"; + case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER: + return "possibly multi-word literal integer"; + case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: + return "possibly multi-word literal number"; + case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: + return "extension instruction number"; + case SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER: + return "OpSpecConstantOp opcode"; + case SPV_OPERAND_TYPE_LITERAL_STRING: + case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING: + return "literal string"; + case SPV_OPERAND_TYPE_SOURCE_LANGUAGE: + return "source language"; + case SPV_OPERAND_TYPE_EXECUTION_MODEL: + return "execution model"; + case SPV_OPERAND_TYPE_ADDRESSING_MODEL: + return "addressing model"; + case SPV_OPERAND_TYPE_MEMORY_MODEL: + return "memory model"; + case SPV_OPERAND_TYPE_EXECUTION_MODE: + return "execution mode"; + case SPV_OPERAND_TYPE_STORAGE_CLASS: + return "storage class"; + case SPV_OPERAND_TYPE_DIMENSIONALITY: + return "dimensionality"; + case SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE: + return "sampler addressing mode"; + case SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE: + return "sampler filter mode"; + case SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT: + return "image format"; + case SPV_OPERAND_TYPE_FP_FAST_MATH_MODE: + return "floating-point fast math mode"; + case SPV_OPERAND_TYPE_FP_ROUNDING_MODE: + return "floating-point rounding mode"; + case SPV_OPERAND_TYPE_LINKAGE_TYPE: + return "linkage type"; + case SPV_OPERAND_TYPE_ACCESS_QUALIFIER: + case SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER: + return "access qualifier"; + case SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE: + return "function parameter attribute"; + case SPV_OPERAND_TYPE_DECORATION: + return "decoration"; + case SPV_OPERAND_TYPE_BUILT_IN: + return "built-in"; + case SPV_OPERAND_TYPE_SELECTION_CONTROL: + return "selection control"; + case SPV_OPERAND_TYPE_LOOP_CONTROL: + return "loop control"; + case SPV_OPERAND_TYPE_FUNCTION_CONTROL: + return "function control"; + case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: + return "memory semantics ID"; + case SPV_OPERAND_TYPE_MEMORY_ACCESS: + case SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS: + return "memory access"; + case SPV_OPERAND_TYPE_SCOPE_ID: + return "scope ID"; + case SPV_OPERAND_TYPE_GROUP_OPERATION: + return "group operation"; + case SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS: + return "kernel enqeue flags"; + case SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO: + return "kernel profiling info"; + case SPV_OPERAND_TYPE_CAPABILITY: + return "capability"; + case SPV_OPERAND_TYPE_IMAGE: + case SPV_OPERAND_TYPE_OPTIONAL_IMAGE: + return "image"; + case SPV_OPERAND_TYPE_OPTIONAL_CIV: + return "context-insensitive value"; + case SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS: + return "debug info flags"; + case SPV_OPERAND_TYPE_DEBUG_BASE_TYPE_ATTRIBUTE_ENCODING: + return "debug base type encoding"; + case SPV_OPERAND_TYPE_DEBUG_COMPOSITE_TYPE: + return "debug composite type"; + case SPV_OPERAND_TYPE_DEBUG_TYPE_QUALIFIER: + return "debug type qualifier"; + case SPV_OPERAND_TYPE_DEBUG_OPERATION: + return "debug operation"; + + // The next values are for values returned from an instruction, not actually + // an operand. So the specific strings don't matter. But let's add them + // for completeness and ease of testing. + case SPV_OPERAND_TYPE_IMAGE_CHANNEL_ORDER: + return "image channel order"; + case SPV_OPERAND_TYPE_IMAGE_CHANNEL_DATA_TYPE: + return "image channel data type"; + + case SPV_OPERAND_TYPE_NONE: + return "NONE"; + default: + assert(0 && "Unhandled operand type!"); + break; + } + return "unknown"; +} + +void spvPushOperandTypes(const spv_operand_type_t* types, + spv_operand_pattern_t* pattern) { + const spv_operand_type_t* endTypes; + for (endTypes = types; *endTypes != SPV_OPERAND_TYPE_NONE; ++endTypes) + ; + while (endTypes-- != types) { + pattern->push_back(*endTypes); + } +} + +void spvPushOperandTypesForMask(spv_target_env env, + const spv_operand_table operandTable, + const spv_operand_type_t type, + const uint32_t mask, + spv_operand_pattern_t* pattern) { + // Scan from highest bits to lowest bits because we will append in LIFO + // fashion, and we need the operands for lower order bits to be consumed first + for (uint32_t candidate_bit = (1u << 31u); candidate_bit; + candidate_bit >>= 1) { + if (candidate_bit & mask) { + spv_operand_desc entry = nullptr; + if (SPV_SUCCESS == spvOperandTableValueLookup(env, operandTable, type, + candidate_bit, &entry)) { + spvPushOperandTypes(entry->operandTypes, pattern); + } + } + } +} + +bool spvOperandIsConcrete(spv_operand_type_t type) { + if (spvIsIdType(type) || spvOperandIsConcreteMask(type)) { + return true; + } + switch (type) { + case SPV_OPERAND_TYPE_LITERAL_INTEGER: + case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: + case SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER: + case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: + case SPV_OPERAND_TYPE_LITERAL_STRING: + case SPV_OPERAND_TYPE_SOURCE_LANGUAGE: + case SPV_OPERAND_TYPE_EXECUTION_MODEL: + case SPV_OPERAND_TYPE_ADDRESSING_MODEL: + case SPV_OPERAND_TYPE_MEMORY_MODEL: + case SPV_OPERAND_TYPE_EXECUTION_MODE: + case SPV_OPERAND_TYPE_STORAGE_CLASS: + case SPV_OPERAND_TYPE_DIMENSIONALITY: + case SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE: + case SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE: + case SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT: + case SPV_OPERAND_TYPE_IMAGE_CHANNEL_ORDER: + case SPV_OPERAND_TYPE_IMAGE_CHANNEL_DATA_TYPE: + case SPV_OPERAND_TYPE_FP_ROUNDING_MODE: + case SPV_OPERAND_TYPE_LINKAGE_TYPE: + case SPV_OPERAND_TYPE_ACCESS_QUALIFIER: + case SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE: + case SPV_OPERAND_TYPE_DECORATION: + case SPV_OPERAND_TYPE_BUILT_IN: + case SPV_OPERAND_TYPE_GROUP_OPERATION: + case SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS: + case SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO: + case SPV_OPERAND_TYPE_CAPABILITY: + case SPV_OPERAND_TYPE_DEBUG_BASE_TYPE_ATTRIBUTE_ENCODING: + case SPV_OPERAND_TYPE_DEBUG_COMPOSITE_TYPE: + case SPV_OPERAND_TYPE_DEBUG_TYPE_QUALIFIER: + case SPV_OPERAND_TYPE_DEBUG_OPERATION: + return true; + default: + break; + } + return false; +} + +bool spvOperandIsConcreteMask(spv_operand_type_t type) { + switch (type) { + case SPV_OPERAND_TYPE_IMAGE: + case SPV_OPERAND_TYPE_FP_FAST_MATH_MODE: + case SPV_OPERAND_TYPE_SELECTION_CONTROL: + case SPV_OPERAND_TYPE_LOOP_CONTROL: + case SPV_OPERAND_TYPE_FUNCTION_CONTROL: + case SPV_OPERAND_TYPE_MEMORY_ACCESS: + case SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS: + return true; + default: + break; + } + return false; +} + +bool spvOperandIsOptional(spv_operand_type_t type) { + return SPV_OPERAND_TYPE_FIRST_OPTIONAL_TYPE <= type && + type <= SPV_OPERAND_TYPE_LAST_OPTIONAL_TYPE; +} + +bool spvOperandIsVariable(spv_operand_type_t type) { + return SPV_OPERAND_TYPE_FIRST_VARIABLE_TYPE <= type && + type <= SPV_OPERAND_TYPE_LAST_VARIABLE_TYPE; +} + +bool spvExpandOperandSequenceOnce(spv_operand_type_t type, + spv_operand_pattern_t* pattern) { + switch (type) { + case SPV_OPERAND_TYPE_VARIABLE_ID: + pattern->push_back(type); + pattern->push_back(SPV_OPERAND_TYPE_OPTIONAL_ID); + return true; + case SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER: + pattern->push_back(type); + pattern->push_back(SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER); + return true; + case SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER_ID: + // Represents Zero or more (Literal number, Id) pairs, + // where the literal number must be a scalar integer. + pattern->push_back(type); + pattern->push_back(SPV_OPERAND_TYPE_ID); + pattern->push_back(SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER); + return true; + case SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER: + // Represents Zero or more (Id, Literal number) pairs. + pattern->push_back(type); + pattern->push_back(SPV_OPERAND_TYPE_LITERAL_INTEGER); + pattern->push_back(SPV_OPERAND_TYPE_OPTIONAL_ID); + return true; + default: + break; + } + return false; +} + +spv_operand_type_t spvTakeFirstMatchableOperand( + spv_operand_pattern_t* pattern) { + assert(!pattern->empty()); + spv_operand_type_t result; + do { + result = pattern->back(); + pattern->pop_back(); + } while (spvExpandOperandSequenceOnce(result, pattern)); + return result; +} + +spv_operand_pattern_t spvAlternatePatternFollowingImmediate( + const spv_operand_pattern_t& pattern) { + auto it = + std::find(pattern.crbegin(), pattern.crend(), SPV_OPERAND_TYPE_RESULT_ID); + if (it != pattern.crend()) { + spv_operand_pattern_t alternatePattern(it - pattern.crbegin() + 2, + SPV_OPERAND_TYPE_OPTIONAL_CIV); + alternatePattern[1] = SPV_OPERAND_TYPE_RESULT_ID; + return alternatePattern; + } + + // No result-id found, so just expect CIVs. + return {SPV_OPERAND_TYPE_OPTIONAL_CIV}; +} + +bool spvIsIdType(spv_operand_type_t type) { + switch (type) { + case SPV_OPERAND_TYPE_ID: + case SPV_OPERAND_TYPE_TYPE_ID: + case SPV_OPERAND_TYPE_RESULT_ID: + case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: + case SPV_OPERAND_TYPE_SCOPE_ID: + return true; + default: + return false; + } +} + +std::function spvOperandCanBeForwardDeclaredFunction( + SpvOp opcode) { + std::function out; + switch (opcode) { + case SpvOpExecutionMode: + case SpvOpEntryPoint: + case SpvOpName: + case SpvOpMemberName: + case SpvOpSelectionMerge: + case SpvOpDecorate: + case SpvOpMemberDecorate: + case SpvOpDecorateId: + case SpvOpDecorateStringGOOGLE: + case SpvOpMemberDecorateStringGOOGLE: + case SpvOpTypeStruct: + case SpvOpBranch: + case SpvOpLoopMerge: + out = [](unsigned) { return true; }; + break; + case SpvOpGroupDecorate: + case SpvOpGroupMemberDecorate: + case SpvOpBranchConditional: + case SpvOpSwitch: + out = [](unsigned index) { return index != 0; }; + break; + + case SpvOpFunctionCall: + // The Function parameter. + out = [](unsigned index) { return index == 2; }; + break; + + case SpvOpPhi: + out = [](unsigned index) { return index > 1; }; + break; + + case SpvOpEnqueueKernel: + // The Invoke parameter. + out = [](unsigned index) { return index == 8; }; + break; + + case SpvOpGetKernelNDrangeSubGroupCount: + case SpvOpGetKernelNDrangeMaxSubGroupSize: + // The Invoke parameter. + out = [](unsigned index) { return index == 3; }; + break; + + case SpvOpGetKernelWorkGroupSize: + case SpvOpGetKernelPreferredWorkGroupSizeMultiple: + // The Invoke parameter. + out = [](unsigned index) { return index == 2; }; + break; + case SpvOpTypeForwardPointer: + out = [](unsigned index) { return index == 0; }; + break; + default: + out = [](unsigned) { return false; }; + break; + } + return out; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/operand.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/operand.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/operand.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/operand.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,141 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPERAND_H_ +#define LIBSPIRV_OPERAND_H_ + +#include +#include + +#include "spirv-tools/libspirv.h" +#include "table.h" + +// A sequence of operand types. +// +// A SPIR-V parser uses an operand pattern to describe what is expected +// next on the input. +// +// As we parse an instruction in text or binary form from left to right, +// we pop and push at the end of the pattern vector. Symbols later in the +// pattern vector are matched against the input before symbols earlier in the +// pattern vector are matched. + +// Using a vector in this way reduces memory traffic, which is good for +// performance. +using spv_operand_pattern_t = std::vector; + +// Finds the named operand in the table. The type parameter specifies the +// operand's group. A handle of the operand table entry for this operand will +// be written into *entry. +spv_result_t spvOperandTableNameLookup(spv_target_env, + const spv_operand_table table, + const spv_operand_type_t type, + const char* name, + const size_t name_length, + spv_operand_desc* entry); + +// Finds the operand with value in the table. The type parameter specifies the +// operand's group. A handle of the operand table entry for this operand will +// be written into *entry. +spv_result_t spvOperandTableValueLookup(spv_target_env, + const spv_operand_table table, + const spv_operand_type_t type, + const uint32_t value, + spv_operand_desc* entry); + +// Gets the name string of the non-variable operand type. +const char* spvOperandTypeStr(spv_operand_type_t type); + +// Returns true if the given type is concrete. +bool spvOperandIsConcrete(spv_operand_type_t type); + +// Returns true if the given type is concrete and also a mask. +bool spvOperandIsConcreteMask(spv_operand_type_t type); + +// Returns true if an operand of the given type is optional. +bool spvOperandIsOptional(spv_operand_type_t type); + +// Returns true if an operand type represents zero or more logical operands. +// +// Note that a single logical operand may still be a variable number of words. +// For example, a literal string may be many words, but is just one logical +// operand. +bool spvOperandIsVariable(spv_operand_type_t type); + +// Append a list of operand types to the end of the pattern vector. +// The types parameter specifies the source array of types, ending with +// SPV_OPERAND_TYPE_NONE. +void spvPushOperandTypes(const spv_operand_type_t* types, + spv_operand_pattern_t* pattern); + +// Appends the operands expected after the given typed mask onto the +// end of the given pattern. +// +// Each set bit in the mask represents zero or more operand types that should +// be appended onto the pattern. Operands for a less significant bit always +// appear after operands for a more significant bit. +// +// If a set bit is unknown, then we assume it has no operands. +void spvPushOperandTypesForMask(spv_target_env, + const spv_operand_table operand_table, + const spv_operand_type_t mask_type, + const uint32_t mask, + spv_operand_pattern_t* pattern); + +// Expands an operand type representing zero or more logical operands, +// exactly once. +// +// If the given type represents potentially several logical operands, +// then prepend the given pattern with the first expansion of the logical +// operands, followed by original type. Otherwise, don't modify the pattern. +// +// For example, the SPV_OPERAND_TYPE_VARIABLE_ID represents zero or more +// IDs. In that case we would prepend the pattern with SPV_OPERAND_TYPE_ID +// followed by SPV_OPERAND_TYPE_VARIABLE_ID again. +// +// This also applies to zero or more tuples of logical operands. In that case +// we prepend pattern with for the members of the tuple, followed by the +// original type argument. The pattern must encode the fact that if any part +// of the tuple is present, then all tuple members should be. So the first +// member of the tuple must be optional, and the remaining members +// non-optional. +// +// Returns true if we modified the pattern. +bool spvExpandOperandSequenceOnce(spv_operand_type_t type, + spv_operand_pattern_t* pattern); + +// Expands the first element in the pattern until it is a matchable operand +// type, then pops it off the front and returns it. The pattern must not be +// empty. +// +// A matchable operand type is anything other than a zero-or-more-items +// operand type. +spv_operand_type_t spvTakeFirstMatchableOperand(spv_operand_pattern_t* pattern); + +// Calculates the corresponding post-immediate alternate pattern, which allows +// a limited set of operand types. +spv_operand_pattern_t spvAlternatePatternFollowingImmediate( + const spv_operand_pattern_t& pattern); + +// Is the operand an ID? +bool spvIsIdType(spv_operand_type_t type); + +// Takes the opcode of an instruction and returns +// a function object that will return true if the index +// of the operand can be forward declared. This function will +// used in the SSA validation stage of the pipeline +std::function spvOperandCanBeForwardDeclaredFunction( + SpvOp opcode); + +#endif // LIBSPIRV_OPERAND_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,721 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "aggressive_dead_code_elim_pass.h" + +#include "cfa.h" +#include "iterator.h" +#include "latest_version_glsl_std_450_header.h" +#include "reflect.h" + +#include + +namespace spvtools { +namespace opt { + +namespace { + +const uint32_t kTypePointerStorageClassInIdx = 0; +const uint32_t kEntryPointFunctionIdInIdx = 1; +const uint32_t kSelectionMergeMergeBlockIdInIdx = 0; +const uint32_t kLoopMergeMergeBlockIdInIdx = 0; +const uint32_t kLoopMergeContinueBlockIdInIdx = 1; + +// Sorting functor to present annotation instructions in an easy-to-process +// order. The functor orders by opcode first and falls back on unique id +// ordering if both instructions have the same opcode. +// +// Desired priority: +// SpvOpGroupDecorate +// SpvOpGroupMemberDecorate +// SpvOpDecorate +// SpvOpMemberDecorate +// SpvOpDecorateId +// SpvOpDecorationGroup +struct DecorationLess { + bool operator()(const ir::Instruction* lhs, + const ir::Instruction* rhs) const { + assert(lhs && rhs); + SpvOp lhsOp = lhs->opcode(); + SpvOp rhsOp = rhs->opcode(); + if (lhsOp != rhsOp) { + // OpGroupDecorate and OpGroupMember decorate are highest priority to + // eliminate dead targets early and simplify subsequent checks. + if (lhsOp == SpvOpGroupDecorate && rhsOp != SpvOpGroupDecorate) + return true; + if (rhsOp == SpvOpGroupDecorate && lhsOp != SpvOpGroupDecorate) + return false; + if (lhsOp == SpvOpGroupMemberDecorate && + rhsOp != SpvOpGroupMemberDecorate) + return true; + if (rhsOp == SpvOpGroupMemberDecorate && + lhsOp != SpvOpGroupMemberDecorate) + return false; + if (lhsOp == SpvOpDecorate && rhsOp != SpvOpDecorate) return true; + if (rhsOp == SpvOpDecorate && lhsOp != SpvOpDecorate) return false; + if (lhsOp == SpvOpMemberDecorate && rhsOp != SpvOpMemberDecorate) + return true; + if (rhsOp == SpvOpMemberDecorate && lhsOp != SpvOpMemberDecorate) + return false; + if (lhsOp == SpvOpDecorateId && rhsOp != SpvOpDecorateId) return true; + if (rhsOp == SpvOpDecorateId && lhsOp != SpvOpDecorateId) return false; + // OpDecorationGroup is lowest priority to ensure use/def chains remain + // usable for instructions that target this group. + if (lhsOp == SpvOpDecorationGroup && rhsOp != SpvOpDecorationGroup) + return true; + if (rhsOp == SpvOpDecorationGroup && lhsOp != SpvOpDecorationGroup) + return false; + } + + // Fall back to maintain total ordering (compare unique ids). + return *lhs < *rhs; + } +}; + +} // namespace + +bool AggressiveDCEPass::IsVarOfStorage(uint32_t varId, uint32_t storageClass) { + if (varId == 0) return false; + const ir::Instruction* varInst = get_def_use_mgr()->GetDef(varId); + const SpvOp op = varInst->opcode(); + if (op != SpvOpVariable) return false; + const uint32_t varTypeId = varInst->type_id(); + const ir::Instruction* varTypeInst = get_def_use_mgr()->GetDef(varTypeId); + if (varTypeInst->opcode() != SpvOpTypePointer) return false; + return varTypeInst->GetSingleWordInOperand(kTypePointerStorageClassInIdx) == + storageClass; +} + +bool AggressiveDCEPass::IsLocalVar(uint32_t varId) { + return IsVarOfStorage(varId, SpvStorageClassFunction) || + (IsVarOfStorage(varId, SpvStorageClassPrivate) && private_like_local_); +} + +void AggressiveDCEPass::AddStores(uint32_t ptrId) { + get_def_use_mgr()->ForEachUser(ptrId, [this](ir::Instruction* user) { + switch (user->opcode()) { + case SpvOpAccessChain: + case SpvOpInBoundsAccessChain: + case SpvOpCopyObject: + this->AddStores(user->result_id()); + break; + case SpvOpLoad: + break; + // If default, assume it stores e.g. frexp, modf, function call + case SpvOpStore: + default: + AddToWorklist(user); + break; + } + }); +} + +bool AggressiveDCEPass::AllExtensionsSupported() const { + // If any extension not in whitelist, return false + for (auto& ei : get_module()->extensions()) { + const char* extName = + reinterpret_cast(&ei.GetInOperand(0).words[0]); + if (extensions_whitelist_.find(extName) == extensions_whitelist_.end()) + return false; + } + return true; +} + +bool AggressiveDCEPass::IsDead(ir::Instruction* inst) { + if (IsLive(inst)) return false; + if (inst->IsBranch() && !IsStructuredHeader(context()->get_instr_block(inst), + nullptr, nullptr, nullptr)) + return false; + return true; +} + +bool AggressiveDCEPass::IsTargetDead(ir::Instruction* inst) { + const uint32_t tId = inst->GetSingleWordInOperand(0); + ir::Instruction* tInst = get_def_use_mgr()->GetDef(tId); + if (ir::IsAnnotationInst(tInst->opcode())) { + // This must be a decoration group. We go through annotations in a specific + // order. So if this is not used by any group or group member decorates, it + // is dead. + assert(tInst->opcode() == SpvOpDecorationGroup); + bool dead = true; + get_def_use_mgr()->ForEachUser(tInst, [&dead](ir::Instruction* user) { + if (user->opcode() == SpvOpGroupDecorate || + user->opcode() == SpvOpGroupMemberDecorate) + dead = false; + }); + return dead; + } + return IsDead(tInst); +} + +void AggressiveDCEPass::ProcessLoad(uint32_t varId) { + // Only process locals + if (!IsLocalVar(varId)) return; + // Return if already processed + if (live_local_vars_.find(varId) != live_local_vars_.end()) return; + // Mark all stores to varId as live + AddStores(varId); + // Cache varId as processed + live_local_vars_.insert(varId); +} + +bool AggressiveDCEPass::IsStructuredHeader(ir::BasicBlock* bp, + ir::Instruction** mergeInst, + ir::Instruction** branchInst, + uint32_t* mergeBlockId) { + if (!bp) return false; + ir::Instruction* mi = bp->GetMergeInst(); + if (mi == nullptr) return false; + ir::Instruction* bri = &*bp->tail(); + if (branchInst != nullptr) *branchInst = bri; + if (mergeInst != nullptr) *mergeInst = mi; + if (mergeBlockId != nullptr) *mergeBlockId = mi->GetSingleWordInOperand(0); + return true; +} + +void AggressiveDCEPass::ComputeBlock2HeaderMaps( + std::list& structuredOrder) { + block2headerBranch_.clear(); + branch2merge_.clear(); + structured_order_index_.clear(); + std::stack currentHeaderBranch; + currentHeaderBranch.push(nullptr); + uint32_t currentMergeBlockId = 0; + uint32_t index = 0; + for (auto bi = structuredOrder.begin(); bi != structuredOrder.end(); + ++bi, ++index) { + structured_order_index_[*bi] = index; + // If this block is the merge block of the current control construct, + // we are leaving the current construct so we must update state + if ((*bi)->id() == currentMergeBlockId) { + currentHeaderBranch.pop(); + ir::Instruction* chb = currentHeaderBranch.top(); + if (chb != nullptr) + currentMergeBlockId = branch2merge_[chb]->GetSingleWordInOperand(0); + } + ir::Instruction* mergeInst; + ir::Instruction* branchInst; + uint32_t mergeBlockId; + bool is_header = + IsStructuredHeader(*bi, &mergeInst, &branchInst, &mergeBlockId); + // If this is a loop header, update state first so the block will map to + // the loop. + if (is_header && mergeInst->opcode() == SpvOpLoopMerge) { + currentHeaderBranch.push(branchInst); + branch2merge_[branchInst] = mergeInst; + currentMergeBlockId = mergeBlockId; + } + // Map the block to the current construct. + block2headerBranch_[*bi] = currentHeaderBranch.top(); + // If this is an if header, update state so following blocks map to the if. + if (is_header && mergeInst->opcode() == SpvOpSelectionMerge) { + currentHeaderBranch.push(branchInst); + branch2merge_[branchInst] = mergeInst; + currentMergeBlockId = mergeBlockId; + } + } +} + +void AggressiveDCEPass::AddBranch(uint32_t labelId, ir::BasicBlock* bp) { + std::unique_ptr newBranch(new ir::Instruction( + context(), SpvOpBranch, 0, 0, + {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {labelId}}})); + get_def_use_mgr()->AnalyzeInstDefUse(&*newBranch); + bp->AddInstruction(std::move(newBranch)); +} + +void AggressiveDCEPass::AddBreaksAndContinuesToWorklist( + ir::Instruction* loopMerge) { + ir::BasicBlock* header = context()->get_instr_block(loopMerge); + uint32_t headerIndex = structured_order_index_[header]; + const uint32_t mergeId = + loopMerge->GetSingleWordInOperand(kLoopMergeMergeBlockIdInIdx); + ir::BasicBlock* merge = context()->get_instr_block(mergeId); + uint32_t mergeIndex = structured_order_index_[merge]; + get_def_use_mgr()->ForEachUser( + mergeId, [headerIndex, mergeIndex, this](ir::Instruction* user) { + if (!user->IsBranch()) return; + ir::BasicBlock* block = context()->get_instr_block(user); + uint32_t index = structured_order_index_[block]; + if (headerIndex < index && index < mergeIndex) { + // This is a break from the loop. + AddToWorklist(user); + // Add branch's merge if there is one. + ir::Instruction* userMerge = branch2merge_[user]; + if (userMerge != nullptr) AddToWorklist(userMerge); + } + }); + const uint32_t contId = + loopMerge->GetSingleWordInOperand(kLoopMergeContinueBlockIdInIdx); + get_def_use_mgr()->ForEachUser(contId, [&contId, + this](ir::Instruction* user) { + SpvOp op = user->opcode(); + if (op == SpvOpBranchConditional || op == SpvOpSwitch) { + // A conditional branch or switch can only be a continue if it does not + // have a merge instruction or its merge block is not the continue block. + ir::Instruction* hdrMerge = branch2merge_[user]; + if (hdrMerge != nullptr && hdrMerge->opcode() == SpvOpSelectionMerge) { + uint32_t hdrMergeId = + hdrMerge->GetSingleWordInOperand(kSelectionMergeMergeBlockIdInIdx); + if (hdrMergeId == contId) return; + // Need to mark merge instruction too + AddToWorklist(hdrMerge); + } + } else if (op == SpvOpBranch) { + // An unconditional branch can only be a continue if it is not + // branching to its own merge block. + ir::BasicBlock* blk = context()->get_instr_block(user); + ir::Instruction* hdrBranch = block2headerBranch_[blk]; + if (hdrBranch == nullptr) return; + ir::Instruction* hdrMerge = branch2merge_[hdrBranch]; + if (hdrMerge->opcode() == SpvOpLoopMerge) return; + uint32_t hdrMergeId = + hdrMerge->GetSingleWordInOperand(kSelectionMergeMergeBlockIdInIdx); + if (contId == hdrMergeId) return; + } else { + return; + } + AddToWorklist(user); + }); +} + +bool AggressiveDCEPass::AggressiveDCE(ir::Function* func) { + // Mark function parameters as live. + AddToWorklist(&func->DefInst()); + func->ForEachParam( + [this](const ir::Instruction* param) { + AddToWorklist(const_cast(param)); + }, + false); + + // Compute map from block to controlling conditional branch + std::list structuredOrder; + cfg()->ComputeStructuredOrder(func, &*func->begin(), &structuredOrder); + ComputeBlock2HeaderMaps(structuredOrder); + bool modified = false; + // Add instructions with external side effects to worklist. Also add branches + // EXCEPT those immediately contained in an "if" selection construct or a loop + // or continue construct. + // TODO(greg-lunarg): Handle Frexp, Modf more optimally + call_in_func_ = false; + func_is_entry_point_ = false; + private_stores_.clear(); + // Stacks to keep track of when we are inside an if- or loop-construct. + // When immediately inside an if- or loop-construct, we do not initially + // mark branches live. All other branches must be marked live. + std::stack assume_branches_live; + std::stack currentMergeBlockId; + // Push sentinel values on stack for when outside of any control flow. + assume_branches_live.push(true); + currentMergeBlockId.push(0); + for (auto bi = structuredOrder.begin(); bi != structuredOrder.end(); ++bi) { + // If exiting if or loop, update stacks + if ((*bi)->id() == currentMergeBlockId.top()) { + assume_branches_live.pop(); + currentMergeBlockId.pop(); + } + for (auto ii = (*bi)->begin(); ii != (*bi)->end(); ++ii) { + SpvOp op = ii->opcode(); + switch (op) { + case SpvOpStore: { + uint32_t varId; + (void)GetPtr(&*ii, &varId); + // Mark stores as live if their variable is not function scope + // and is not private scope. Remember private stores for possible + // later inclusion + if (IsVarOfStorage(varId, SpvStorageClassPrivate)) + private_stores_.push_back(&*ii); + else if (!IsVarOfStorage(varId, SpvStorageClassFunction)) + AddToWorklist(&*ii); + } break; + case SpvOpLoopMerge: { + assume_branches_live.push(false); + currentMergeBlockId.push( + ii->GetSingleWordInOperand(kLoopMergeMergeBlockIdInIdx)); + } break; + case SpvOpSelectionMerge: { + assume_branches_live.push(false); + currentMergeBlockId.push( + ii->GetSingleWordInOperand(kSelectionMergeMergeBlockIdInIdx)); + } break; + case SpvOpSwitch: + case SpvOpBranch: + case SpvOpBranchConditional: { + if (assume_branches_live.top()) AddToWorklist(&*ii); + } break; + default: { + // Function calls, atomics, function params, function returns, etc. + // TODO(greg-lunarg): function calls live only if write to non-local + if (!context()->IsCombinatorInstruction(&*ii)) { + AddToWorklist(&*ii); + } + // Remember function calls + if (op == SpvOpFunctionCall) call_in_func_ = true; + } break; + } + } + } + // See if current function is an entry point + for (auto& ei : get_module()->entry_points()) { + if (ei.GetSingleWordInOperand(kEntryPointFunctionIdInIdx) == + func->result_id()) { + func_is_entry_point_ = true; + break; + } + } + // If the current function is an entry point and has no function calls, + // we can optimize private variables as locals + private_like_local_ = func_is_entry_point_ && !call_in_func_; + // If privates are not like local, add their stores to worklist + if (!private_like_local_) + for (auto& ps : private_stores_) AddToWorklist(ps); + // Perform closure on live instruction set. + while (!worklist_.empty()) { + ir::Instruction* liveInst = worklist_.front(); + // Add all operand instructions if not already live + liveInst->ForEachInId([&liveInst, this](const uint32_t* iid) { + ir::Instruction* inInst = get_def_use_mgr()->GetDef(*iid); + // Do not add label if an operand of a branch. This is not needed + // as part of live code discovery and can create false live code, + // for example, the branch to a header of a loop. + if (inInst->opcode() == SpvOpLabel && liveInst->IsBranch()) return; + AddToWorklist(inInst); + }); + if (liveInst->type_id() != 0) { + AddToWorklist(get_def_use_mgr()->GetDef(liveInst->type_id())); + } + // If in a structured if or loop construct, add the controlling + // conditional branch and its merge. Any containing control construct + // is marked live when the merge and branch are processed out of the + // worklist. + ir::BasicBlock* blk = context()->get_instr_block(liveInst); + ir::Instruction* branchInst = block2headerBranch_[blk]; + if (branchInst != nullptr) { + AddToWorklist(branchInst); + ir::Instruction* mergeInst = branch2merge_[branchInst]; + AddToWorklist(mergeInst); + // If in a loop, mark all its break and continue instructions live + if (mergeInst->opcode() == SpvOpLoopMerge) + AddBreaksAndContinuesToWorklist(mergeInst); + } + // If local load, add all variable's stores if variable not already live + if (liveInst->opcode() == SpvOpLoad) { + uint32_t varId; + (void)GetPtr(liveInst, &varId); + if (varId != 0) { + ProcessLoad(varId); + } + } + // If function call, treat as if it loads from all pointer arguments + else if (liveInst->opcode() == SpvOpFunctionCall) { + liveInst->ForEachInId([this](const uint32_t* iid) { + // Skip non-ptr args + if (!IsPtr(*iid)) return; + uint32_t varId; + (void)GetPtr(*iid, &varId); + ProcessLoad(varId); + }); + } + // If function parameter, treat as if it's result id is loaded from + else if (liveInst->opcode() == SpvOpFunctionParameter) { + ProcessLoad(liveInst->result_id()); + } + // We treat an OpImageTexelPointer as a load of the pointer, and + // that value is manipulated to get the result. + else if (liveInst->opcode() == SpvOpImageTexelPointer) { + uint32_t varId; + (void)GetPtr(liveInst, &varId); + if (varId != 0) { + ProcessLoad(varId); + } + } + worklist_.pop(); + } + + // Kill dead instructions and remember dead blocks + for (auto bi = structuredOrder.begin(); bi != structuredOrder.end();) { + uint32_t mergeBlockId = 0; + (*bi)->ForEachInst([this, &modified, &mergeBlockId](ir::Instruction* inst) { + if (!IsDead(inst)) return; + if (inst->opcode() == SpvOpLabel) return; + // If dead instruction is selection merge, remember merge block + // for new branch at end of block + if (inst->opcode() == SpvOpSelectionMerge || + inst->opcode() == SpvOpLoopMerge) + mergeBlockId = inst->GetSingleWordInOperand(0); + to_kill_.push_back(inst); + modified = true; + }); + // If a structured if or loop was deleted, add a branch to its merge + // block, and traverse to the merge block and continue processing there. + // We know the block still exists because the label is not deleted. + if (mergeBlockId != 0) { + AddBranch(mergeBlockId, *bi); + for (++bi; (*bi)->id() != mergeBlockId; ++bi) { + } + } else { + ++bi; + } + } + + return modified; +} + +void AggressiveDCEPass::Initialize(ir::IRContext* c) { + InitializeProcessing(c); + + // Clear collections + worklist_ = std::queue{}; + live_insts_.clear(); + live_local_vars_.clear(); + + // Initialize extensions whitelist + InitExtensions(); +} + +void AggressiveDCEPass::InitializeModuleScopeLiveInstructions() { + // Keep all execution modes. + for (auto& exec : get_module()->execution_modes()) { + AddToWorklist(&exec); + } + // Keep all entry points. + for (auto& entry : get_module()->entry_points()) { + AddToWorklist(&entry); + } + // Keep workgroup size. + for (auto& anno : get_module()->annotations()) { + if (anno.opcode() == SpvOpDecorate) { + if (anno.GetSingleWordInOperand(1u) == SpvDecorationBuiltIn && + anno.GetSingleWordInOperand(2u) == SpvBuiltInWorkgroupSize) { + AddToWorklist(&anno); + } + } + } +} + +Pass::Status AggressiveDCEPass::ProcessImpl() { + // Current functionality assumes shader capability + // TODO(greg-lunarg): Handle additional capabilities + if (!context()->get_feature_mgr()->HasCapability(SpvCapabilityShader)) + return Status::SuccessWithoutChange; + // Current functionality assumes relaxed logical addressing (see + // instruction.h) + // TODO(greg-lunarg): Handle non-logical addressing + if (context()->get_feature_mgr()->HasCapability(SpvCapabilityAddresses)) + return Status::SuccessWithoutChange; + // If any extensions in the module are not explicitly supported, + // return unmodified. + if (!AllExtensionsSupported()) return Status::SuccessWithoutChange; + + // Eliminate Dead functions. + bool modified = EliminateDeadFunctions(); + + InitializeModuleScopeLiveInstructions(); + + // Process all entry point functions. + ProcessFunction pfn = [this](ir::Function* fp) { return AggressiveDCE(fp); }; + modified |= ProcessEntryPointCallTree(pfn, get_module()); + + // Process module-level instructions. Now that all live instructions have + // been marked, it is safe to remove dead global values. + modified |= ProcessGlobalValues(); + + // Kill all dead instructions. + for (auto inst : to_kill_) { + context()->KillInst(inst); + } + + // Cleanup all CFG including all unreachable blocks. + ProcessFunction cleanup = [this](ir::Function* f) { return CFGCleanup(f); }; + modified |= ProcessEntryPointCallTree(cleanup, get_module()); + + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +bool AggressiveDCEPass::EliminateDeadFunctions() { + // Identify live functions first. Those that are not live + // are dead. ADCE is disabled for non-shaders so we do not check for exported + // functions here. + std::unordered_set live_function_set; + ProcessFunction mark_live = [&live_function_set](ir::Function* fp) { + live_function_set.insert(fp); + return false; + }; + ProcessEntryPointCallTree(mark_live, get_module()); + + bool modified = false; + for (auto funcIter = get_module()->begin(); + funcIter != get_module()->end();) { + if (live_function_set.count(&*funcIter) == 0) { + modified = true; + EliminateFunction(&*funcIter); + funcIter = funcIter.Erase(); + } else { + ++funcIter; + } + } + + return modified; +} + +void AggressiveDCEPass::EliminateFunction(ir::Function* func) { + // Remove all of the instruction in the function body + func->ForEachInst( + [this](ir::Instruction* inst) { context()->KillInst(inst); }, true); +} + +bool AggressiveDCEPass::ProcessGlobalValues() { + // Remove debug and annotation statements referencing dead instructions. + // This must be done before killing the instructions, otherwise there are + // dead objects in the def/use database. + bool modified = false; + ir::Instruction* instruction = &*get_module()->debug2_begin(); + while (instruction) { + if (instruction->opcode() != SpvOpName) { + instruction = instruction->NextNode(); + continue; + } + + if (IsTargetDead(instruction)) { + instruction = context()->KillInst(instruction); + modified = true; + } else { + instruction = instruction->NextNode(); + } + } + + // This code removes all unnecessary decorations safely (see #1174). It also + // does so in a more efficient manner than deleting them only as the targets + // are deleted. + std::vector annotations; + for (auto& inst : get_module()->annotations()) annotations.push_back(&inst); + std::sort(annotations.begin(), annotations.end(), DecorationLess()); + for (auto annotation : annotations) { + switch (annotation->opcode()) { + case SpvOpDecorate: + case SpvOpMemberDecorate: + case SpvOpDecorateId: + if (IsTargetDead(annotation)) context()->KillInst(annotation); + break; + case SpvOpGroupDecorate: { + // Go through the targets of this group decorate. Remove each dead + // target. If all targets are dead, remove this decoration. + bool dead = true; + for (uint32_t i = 1; i < annotation->NumOperands();) { + ir::Instruction* opInst = + get_def_use_mgr()->GetDef(annotation->GetSingleWordOperand(i)); + if (IsDead(opInst)) { + // Don't increment |i|. + annotation->RemoveOperand(i); + } else { + i++; + dead = false; + } + } + if (dead) context()->KillInst(annotation); + break; + } + case SpvOpGroupMemberDecorate: { + // Go through the targets of this group member decorate. Remove each + // dead target (and member index). If all targets are dead, remove this + // decoration. + bool dead = true; + for (uint32_t i = 1; i < annotation->NumOperands();) { + ir::Instruction* opInst = + get_def_use_mgr()->GetDef(annotation->GetSingleWordOperand(i)); + if (IsDead(opInst)) { + // Don't increment |i|. + annotation->RemoveOperand(i + 1); + annotation->RemoveOperand(i); + } else { + i += 2; + dead = false; + } + } + if (dead) context()->KillInst(annotation); + break; + } + case SpvOpDecorationGroup: + // By the time we hit decoration groups we've checked everything that + // can target them. So if they have no uses they must be dead. + if (get_def_use_mgr()->NumUsers(annotation) == 0) + context()->KillInst(annotation); + break; + default: + assert(false); + break; + } + } + + // Since ADCE is disabled for non-shaders, we don't check for export linkage + // attributes here. + for (auto& val : get_module()->types_values()) { + if (IsDead(&val)) { + to_kill_.push_back(&val); + } + } + + return modified; +} + +AggressiveDCEPass::AggressiveDCEPass() {} + +Pass::Status AggressiveDCEPass::Process(ir::IRContext* c) { + Initialize(c); + return ProcessImpl(); +} + +void AggressiveDCEPass::InitExtensions() { + extensions_whitelist_.clear(); + extensions_whitelist_.insert({ + "SPV_AMD_shader_explicit_vertex_parameter", + "SPV_AMD_shader_trinary_minmax", + "SPV_AMD_gcn_shader", + "SPV_KHR_shader_ballot", + "SPV_AMD_shader_ballot", + "SPV_AMD_gpu_shader_half_float", + "SPV_KHR_shader_draw_parameters", + "SPV_KHR_subgroup_vote", + "SPV_KHR_16bit_storage", + "SPV_KHR_device_group", + "SPV_KHR_multiview", + "SPV_NVX_multiview_per_view_attributes", + "SPV_NV_viewport_array2", + "SPV_NV_stereo_view_rendering", + "SPV_NV_sample_mask_override_coverage", + "SPV_NV_geometry_shader_passthrough", + "SPV_AMD_texture_gather_bias_lod", + "SPV_KHR_storage_buffer_storage_class", + // SPV_KHR_variable_pointers + // Currently do not support extended pointer expressions + "SPV_AMD_gpu_shader_int16", + "SPV_KHR_post_depth_coverage", + "SPV_KHR_shader_atomic_counter_ops", + "SPV_EXT_shader_stencil_export", + "SPV_EXT_shader_viewport_index_layer", + "SPV_AMD_shader_image_load_store_lod", + "SPV_AMD_shader_fragment_mask", + "SPV_EXT_fragment_fully_covered", + "SPV_AMD_gpu_shader_half_float_fetch", + "SPV_GOOGLE_decorate_string", + "SPV_GOOGLE_hlsl_functionality1", + "SPV_NV_shader_subgroup_partitioned", + "SPV_EXT_descriptor_indexing", + }); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/aggressive_dead_code_elim_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/aggressive_dead_code_elim_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/aggressive_dead_code_elim_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/aggressive_dead_code_elim_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,187 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#ifndef LIBSPIRV_OPT_AGGRESSIVE_DCE_PASS_H_ +#define LIBSPIRV_OPT_AGGRESSIVE_DCE_PASS_H_ + +#include +#include +#include +#include +#include +#include + +#include "basic_block.h" +#include "def_use_manager.h" +#include "mem_pass.h" +#include "module.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class AggressiveDCEPass : public MemPass { + using cbb_ptr = const ir::BasicBlock*; + + public: + using GetBlocksFunction = + std::function*(const ir::BasicBlock*)>; + + AggressiveDCEPass(); + const char* name() const override { return "eliminate-dead-code-aggressive"; } + Status Process(ir::IRContext* c) override; + + ir::IRContext::Analysis GetPreservedAnalyses() override { + return ir::IRContext::kAnalysisDefUse; + } + + private: + // Return true if |varId| is a variable of |storageClass|. |varId| must either + // be 0 or the result of an instruction. + bool IsVarOfStorage(uint32_t varId, uint32_t storageClass); + + // Return true if |varId| is variable of function storage class or is + // private variable and privates can be optimized like locals (see + // privates_like_local_). + bool IsLocalVar(uint32_t varId); + + // Return true if |inst| is marked live. + bool IsLive(const ir::Instruction* inst) const { + return live_insts_.find(inst) != live_insts_.end(); + } + + // Returns true if |inst| is dead. + bool IsDead(ir::Instruction* inst); + + // Adds entry points, execution modes and workgroup size decorations to the + // worklist for processing with the first function. + void InitializeModuleScopeLiveInstructions(); + + // Add |inst| to worklist_ and live_insts_. + void AddToWorklist(ir::Instruction* inst) { + if (live_insts_.insert(inst).second) worklist_.push(inst); + } + + // Add all store instruction which use |ptrId|, directly or indirectly, + // to the live instruction worklist. + void AddStores(uint32_t ptrId); + + // Initialize extensions whitelist + void InitExtensions(); + + // Return true if all extensions in this module are supported by this pass. + bool AllExtensionsSupported() const; + + // Returns true if the target of |inst| is dead. An instruction is dead if + // its result id is used in decoration or debug instructions only. |inst| is + // assumed to be OpName, OpMemberName or an annotation instruction. + bool IsTargetDead(ir::Instruction* inst); + + // If |varId| is local, mark all stores of varId as live. + void ProcessLoad(uint32_t varId); + + // If |bp| is structured header block, returns true and sets |mergeInst| to + // the merge instruction, |branchInst| to the branch and |mergeBlockId| to the + // merge block if they are not nullptr. Any of |mergeInst|, |branchInst| or + // |mergeBlockId| may be a null pointer. Returns false if |bp| is a null + // pointer. + bool IsStructuredHeader(ir::BasicBlock* bp, ir::Instruction** mergeInst, + ir::Instruction** branchInst, uint32_t* mergeBlockId); + + // Initialize block2headerBranch_ and branch2merge_ using |structuredOrder| + // to order blocks. + void ComputeBlock2HeaderMaps(std::list& structuredOrder); + + // Add branch to |labelId| to end of block |bp|. + void AddBranch(uint32_t labelId, ir::BasicBlock* bp); + + // Add all break and continue branches in the loop associated with + // |mergeInst| to worklist if not already live + void AddBreaksAndContinuesToWorklist(ir::Instruction* mergeInst); + + // Eliminates dead debug2 and annotation instructions. Marks dead globals for + // removal (e.g. types, constants and variables). + bool ProcessGlobalValues(); + + // Erases functions that are unreachable from the entry points of the module. + bool EliminateDeadFunctions(); + + // Removes |func| from the module and deletes all its instructions. + void EliminateFunction(ir::Function* func); + + // For function |func|, mark all Stores to non-function-scope variables + // and block terminating instructions as live. Recursively mark the values + // they use. When complete, mark any non-live instructions to be deleted. + // Returns true if the function has been modified. + // + // Note: This function does not delete useless control structures. All + // existing control structures will remain. This can leave not-insignificant + // sequences of ultimately useless code. + // TODO(): Remove useless control constructs. + bool AggressiveDCE(ir::Function* func); + + void Initialize(ir::IRContext* c); + Pass::Status ProcessImpl(); + + // True if current function has a call instruction contained in it + bool call_in_func_; + + // True if current function is an entry point + bool func_is_entry_point_; + + // True if current function is entry point and has no function calls. + bool private_like_local_; + + // Live Instruction Worklist. An instruction is added to this list + // if it might have a side effect, either directly or indirectly. + // If we don't know, then add it to this list. Instructions are + // removed from this list as the algorithm traces side effects, + // building up the live instructions set |live_insts_|. + std::queue worklist_; + + // Map from block to the branch instruction in the header of the most + // immediate controlling structured if or loop. A loop header block points + // to its own branch instruction. An if-selection block points to the branch + // of an enclosing construct's header, if one exists. + std::unordered_map block2headerBranch_; + + // Maps basic block to their index in the structured order traversal. + std::unordered_map structured_order_index_; + + // Map from branch to its associated merge instruction, if any + std::unordered_map branch2merge_; + + // Store instructions to variables of private storage + std::vector private_stores_; + + // Live Instructions + std::unordered_set live_insts_; + + // Live Local Variables + std::unordered_set live_local_vars_; + + // List of instructions to delete. Deletion is delayed until debug and + // annotation instructions are processed. + std::vector to_kill_; + + // Extensions supported by this pass. + std::unordered_set extensions_whitelist_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_AGGRESSIVE_DCE_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/basic_block.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/basic_block.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/basic_block.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/basic_block.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,228 @@ +// Copyright (c) 2016 Google 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. + +#include "basic_block.h" +#include "function.h" +#include "ir_context.h" +#include "module.h" +#include "reflect.h" + +#include "make_unique.h" + +#include + +namespace spvtools { +namespace ir { + +namespace { + +const uint32_t kLoopMergeContinueBlockIdInIdx = 1; +const uint32_t kLoopMergeMergeBlockIdInIdx = 0; +const uint32_t kSelectionMergeMergeBlockIdInIdx = 0; + +} // namespace + +BasicBlock* BasicBlock::Clone(IRContext* context) const { + BasicBlock* clone = new BasicBlock( + std::unique_ptr(GetLabelInst()->Clone(context))); + for (const auto& inst : insts_) + // Use the incoming context + clone->AddInstruction(std::unique_ptr(inst.Clone(context))); + return clone; +} + +const Instruction* BasicBlock::GetMergeInst() const { + const Instruction* result = nullptr; + // If it exists, the merge instruction immediately precedes the + // terminator. + auto iter = ctail(); + if (iter != cbegin()) { + --iter; + const auto opcode = iter->opcode(); + if (opcode == SpvOpLoopMerge || opcode == SpvOpSelectionMerge) { + result = &*iter; + } + } + return result; +} + +Instruction* BasicBlock::GetMergeInst() { + Instruction* result = nullptr; + // If it exists, the merge instruction immediately precedes the + // terminator. + auto iter = tail(); + if (iter != begin()) { + --iter; + const auto opcode = iter->opcode(); + if (opcode == SpvOpLoopMerge || opcode == SpvOpSelectionMerge) { + result = &*iter; + } + } + return result; +} + +const Instruction* BasicBlock::GetLoopMergeInst() const { + if (auto* merge = GetMergeInst()) { + if (merge->opcode() == SpvOpLoopMerge) { + return merge; + } + } + return nullptr; +} + +Instruction* BasicBlock::GetLoopMergeInst() { + if (auto* merge = GetMergeInst()) { + if (merge->opcode() == SpvOpLoopMerge) { + return merge; + } + } + return nullptr; +} + +void BasicBlock::KillAllInsts(bool killLabel) { + ForEachInst([killLabel](ir::Instruction* ip) { + if (killLabel || ip->opcode() != SpvOpLabel) { + ip->context()->KillInst(ip); + } + }); +} + +void BasicBlock::ForEachSuccessorLabel( + const std::function& f) const { + const auto br = &insts_.back(); + switch (br->opcode()) { + case SpvOpBranch: { + f(br->GetOperand(0).words[0]); + } break; + case SpvOpBranchConditional: + case SpvOpSwitch: { + bool is_first = true; + br->ForEachInId([&is_first, &f](const uint32_t* idp) { + if (!is_first) f(*idp); + is_first = false; + }); + } break; + default: + break; + } +} + +void BasicBlock::ForEachSuccessorLabel( + const std::function& f) { + auto br = &insts_.back(); + switch (br->opcode()) { + case SpvOpBranch: { + uint32_t tmp_id = br->GetOperand(0).words[0]; + f(&tmp_id); + if (tmp_id != br->GetOperand(0).words[0]) br->SetOperand(0, {tmp_id}); + } break; + case SpvOpBranchConditional: + case SpvOpSwitch: { + bool is_first = true; + br->ForEachInId([&is_first, &f](uint32_t* idp) { + if (!is_first) f(idp); + is_first = false; + }); + } break; + default: + break; + } +} + +bool BasicBlock::IsSuccessor(const ir::BasicBlock* block) const { + uint32_t succId = block->id(); + bool isSuccessor = false; + ForEachSuccessorLabel([&isSuccessor, succId](const uint32_t label) { + if (label == succId) isSuccessor = true; + }); + return isSuccessor; +} + +void BasicBlock::ForMergeAndContinueLabel( + const std::function& f) { + auto ii = insts_.end(); + --ii; + if (ii == insts_.begin()) return; + --ii; + if (ii->opcode() == SpvOpSelectionMerge || ii->opcode() == SpvOpLoopMerge) { + ii->ForEachInId([&f](const uint32_t* idp) { f(*idp); }); + } +} + +uint32_t BasicBlock::MergeBlockIdIfAny() const { + auto merge_ii = cend(); + --merge_ii; + uint32_t mbid = 0; + if (merge_ii != cbegin()) { + --merge_ii; + if (merge_ii->opcode() == SpvOpLoopMerge) { + mbid = merge_ii->GetSingleWordInOperand(kLoopMergeMergeBlockIdInIdx); + } else if (merge_ii->opcode() == SpvOpSelectionMerge) { + mbid = merge_ii->GetSingleWordInOperand(kSelectionMergeMergeBlockIdInIdx); + } + } + + return mbid; +} + +uint32_t BasicBlock::ContinueBlockIdIfAny() const { + auto merge_ii = cend(); + --merge_ii; + uint32_t cbid = 0; + if (merge_ii != cbegin()) { + --merge_ii; + if (merge_ii->opcode() == SpvOpLoopMerge) { + cbid = merge_ii->GetSingleWordInOperand(kLoopMergeContinueBlockIdInIdx); + } + } + return cbid; +} + +std::ostream& operator<<(std::ostream& str, const BasicBlock& block) { + str << block.PrettyPrint(); + return str; +} + +std::string BasicBlock::PrettyPrint(uint32_t options) const { + std::ostringstream str; + ForEachInst([&str, options](const ir::Instruction* inst) { + str << inst->PrettyPrint(options); + if (!IsTerminatorInst(inst->opcode())) { + str << std::endl; + } + }); + return str.str(); +} + +BasicBlock* BasicBlock::SplitBasicBlock(IRContext* context, uint32_t label_id, + iterator iter) { + assert(!insts_.empty()); + + BasicBlock* new_block = new BasicBlock(MakeUnique( + context, SpvOpLabel, 0, label_id, std::initializer_list{})); + + new_block->insts_.Splice(new_block->end(), &insts_, iter, end()); + new_block->SetParent(GetParent()); + + if (context->AreAnalysesValid(ir::IRContext::kAnalysisInstrToBlockMapping)) { + new_block->ForEachInst([new_block, context](ir::Instruction* inst) { + context->set_instr_block(inst, new_block); + }); + } + + return new_block; +} + +} // namespace ir +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/basic_block.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/basic_block.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/basic_block.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/basic_block.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,300 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file defines the language constructs for representing a SPIR-V +// module in memory. + +#ifndef LIBSPIRV_OPT_BASIC_BLOCK_H_ +#define LIBSPIRV_OPT_BASIC_BLOCK_H_ + +#include +#include +#include +#include +#include + +#include "instruction.h" +#include "instruction_list.h" +#include "iterator.h" + +namespace spvtools { +namespace ir { + +class Function; +class IRContext; + +// A SPIR-V basic block. +class BasicBlock { + public: + using iterator = InstructionList::iterator; + using const_iterator = InstructionList::const_iterator; + + // Creates a basic block with the given starting |label|. + inline explicit BasicBlock(std::unique_ptr label); + + explicit BasicBlock(const BasicBlock& bb) = delete; + + // Creates a clone of the basic block in the given |context| + // + // The parent function will default to null and needs to be explicitly set by + // the user. + BasicBlock* Clone(IRContext*) const; + + // Sets the enclosing function for this basic block. + void SetParent(Function* function) { function_ = function; } + + // Return the enclosing function + inline Function* GetParent() const { return function_; } + + // Appends an instruction to this basic block. + inline void AddInstruction(std::unique_ptr i); + + // Appends all of block's instructions (except label) to this block + inline void AddInstructions(BasicBlock* bp); + + // The label starting this basic block. + Instruction* GetLabelInst() { return label_.get(); } + const Instruction* GetLabelInst() const { return label_.get(); } + + // Returns the merge instruction in this basic block, if it exists. + // Otherwise return null. May be used whenever tail() can be used. + const Instruction* GetMergeInst() const; + Instruction* GetMergeInst(); + + // Returns the OpLoopMerge instruciton in this basic block, if it exists. + // Otherwise return null. May be used whenever tail() can be used. + const Instruction* GetLoopMergeInst() const; + Instruction* GetLoopMergeInst(); + + // Returns the id of the label at the top of this block + inline uint32_t id() const { return label_->result_id(); } + + iterator begin() { return insts_.begin(); } + iterator end() { return insts_.end(); } + const_iterator begin() const { return insts_.cbegin(); } + const_iterator end() const { return insts_.cend(); } + const_iterator cbegin() const { return insts_.cbegin(); } + const_iterator cend() const { return insts_.cend(); } + + // Returns an iterator pointing to the last instruction. This may only + // be used if this block has an instruction other than the OpLabel + // that defines it. + iterator tail() { + assert(!insts_.empty()); + return --end(); + } + + // Returns a const iterator, but othewrise similar to tail(). + const_iterator ctail() const { + assert(!insts_.empty()); + return --insts_.cend(); + } + + // Returns true if the basic block has at least one successor. + inline bool hasSuccessor() const { return ctail()->IsBranch(); } + + // Runs the given function |f| on each instruction in this basic block, and + // optionally on the debug line instructions that might precede them. + inline void ForEachInst(const std::function& f, + bool run_on_debug_line_insts = false); + inline void ForEachInst(const std::function& f, + bool run_on_debug_line_insts = false) const; + + // Runs the given function |f| on each instruction in this basic block, and + // optionally on the debug line instructions that might precede them. If |f| + // returns false, iteration is terminated and this function returns false. + inline bool WhileEachInst(const std::function& f, + bool run_on_debug_line_insts = false); + inline bool WhileEachInst(const std::function& f, + bool run_on_debug_line_insts = false) const; + + // Runs the given function |f| on each Phi instruction in this basic block, + // and optionally on the debug line instructions that might precede them. + inline void ForEachPhiInst(const std::function& f, + bool run_on_debug_line_insts = false); + + // Runs the given function |f| on each Phi instruction in this basic block, + // and optionally on the debug line instructions that might precede them. If + // |f| returns false, iteration is terminated and this function return false. + inline bool WhileEachPhiInst(const std::function& f, + bool run_on_debug_line_insts = false); + + // Runs the given function |f| on each label id of each successor block + void ForEachSuccessorLabel( + const std::function& f) const; + + // Runs the given function |f| on each label id of each successor block. + // Modifying the pointed value will change the branch taken by the basic + // block. It is the caller responsibility to update or invalidate the CFG. + void ForEachSuccessorLabel(const std::function& f); + + // Returns true if |block| is a direct successor of |this|. + bool IsSuccessor(const ir::BasicBlock* block) const; + + // Runs the given function |f| on the merge and continue label, if any + void ForMergeAndContinueLabel(const std::function& f); + + // Returns true if this basic block has any Phi instructions. + bool HasPhiInstructions() { + return !WhileEachPhiInst([](ir::Instruction*) { return false; }); + } + + // Return true if this block is a loop header block. + bool IsLoopHeader() const { return GetLoopMergeInst() != nullptr; } + + // Returns the ID of the merge block declared by a merge instruction in this + // block, if any. If none, returns zero. + uint32_t MergeBlockIdIfAny() const; + + // Returns the ID of the continue block declared by a merge instruction in + // this block, if any. If none, returns zero. + uint32_t ContinueBlockIdIfAny() const; + + // Returns the terminator instruction. Assumes the terminator exists. + Instruction* terminator() { return &*tail(); } + const Instruction* terminator() const { return &*ctail(); } + + // Returns true if this basic block exits this function and returns to its + // caller. + bool IsReturn() const { return ctail()->IsReturn(); } + + // Returns true if this basic block exits this function or aborts execution. + bool IsReturnOrAbort() const { return ctail()->IsReturnOrAbort(); } + + // Kill all instructions in this block. Whether or not to kill the label is + // indicated by |killLabel|. + void KillAllInsts(bool killLabel); + + // Splits this basic block into two. Returns a new basic block with label + // |labelId| containing the instructions from |iter| onwards. Instructions + // prior to |iter| remain in this basic block. + BasicBlock* SplitBasicBlock(IRContext* context, uint32_t label_id, + iterator iter); + + // Pretty-prints this basic block into a std::string by printing every + // instruction in it. + // + // |options| are the disassembly options. SPV_BINARY_TO_TEXT_OPTION_NO_HEADER + // is always added to |options|. + std::string PrettyPrint(uint32_t options = 0u) const; + + private: + // The enclosing function. + Function* function_; + // The label starting this basic block. + std::unique_ptr label_; + // Instructions inside this basic block, but not the OpLabel. + InstructionList insts_; +}; + +// Pretty-prints |block| to |str|. Returns |str|. +std::ostream& operator<<(std::ostream& str, const BasicBlock& block); + +inline BasicBlock::BasicBlock(std::unique_ptr label) + : function_(nullptr), label_(std::move(label)) {} + +inline void BasicBlock::AddInstruction(std::unique_ptr i) { + insts_.push_back(std::move(i)); +} + +inline void BasicBlock::AddInstructions(BasicBlock* bp) { + auto bEnd = end(); + (void)bEnd.MoveBefore(&bp->insts_); +} + +inline bool BasicBlock::WhileEachInst( + const std::function& f, bool run_on_debug_line_insts) { + if (label_) { + if (!label_->WhileEachInst(f, run_on_debug_line_insts)) return false; + } + if (insts_.empty()) { + return true; + } + + Instruction* inst = &insts_.front(); + while (inst != nullptr) { + Instruction* next_instruction = inst->NextNode(); + if (!inst->WhileEachInst(f, run_on_debug_line_insts)) return false; + inst = next_instruction; + } + return true; +} + +inline bool BasicBlock::WhileEachInst( + const std::function& f, + bool run_on_debug_line_insts) const { + if (label_) { + if (!static_cast(label_.get()) + ->WhileEachInst(f, run_on_debug_line_insts)) + return false; + } + for (const auto& inst : insts_) { + if (!static_cast(&inst)->WhileEachInst( + f, run_on_debug_line_insts)) + return false; + } + return true; +} + +inline void BasicBlock::ForEachInst(const std::function& f, + bool run_on_debug_line_insts) { + WhileEachInst( + [&f](Instruction* inst) { + f(inst); + return true; + }, + run_on_debug_line_insts); +} + +inline void BasicBlock::ForEachInst( + const std::function& f, + bool run_on_debug_line_insts) const { + WhileEachInst( + [&f](const Instruction* inst) { + f(inst); + return true; + }, + run_on_debug_line_insts); +} + +inline bool BasicBlock::WhileEachPhiInst( + const std::function& f, bool run_on_debug_line_insts) { + if (insts_.empty()) { + return true; + } + + Instruction* inst = &insts_.front(); + while (inst != nullptr) { + Instruction* next_instruction = inst->NextNode(); + if (inst->opcode() != SpvOpPhi) break; + if (!inst->WhileEachInst(f, run_on_debug_line_insts)) return false; + inst = next_instruction; + } + return true; +} + +inline void BasicBlock::ForEachPhiInst( + const std::function& f, bool run_on_debug_line_insts) { + WhileEachPhiInst( + [&f](Instruction* inst) { + f(inst); + return true; + }, + run_on_debug_line_insts); +} + +} // namespace ir +} // namespace spvtools + +#endif // LIBSPIRV_OPT_BASIC_BLOCK_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/block_merge_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/block_merge_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/block_merge_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/block_merge_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,157 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "block_merge_pass.h" + +#include "ir_context.h" +#include "iterator.h" + +namespace spvtools { +namespace opt { + +void BlockMergePass::KillInstAndName(ir::Instruction* inst) { + std::vector to_kill; + get_def_use_mgr()->ForEachUser(inst, [&to_kill](ir::Instruction* user) { + if (user->opcode() == SpvOpName) { + to_kill.push_back(user); + } + }); + for (auto i : to_kill) { + context()->KillInst(i); + } + context()->KillInst(inst); +} + +bool BlockMergePass::MergeBlocks(ir::Function* func) { + bool modified = false; + for (auto bi = func->begin(); bi != func->end();) { + // Find block with single successor which has no other predecessors. + auto ii = bi->end(); + --ii; + ir::Instruction* br = &*ii; + if (br->opcode() != SpvOpBranch) { + ++bi; + continue; + } + + const uint32_t lab_id = br->GetSingleWordInOperand(0); + if (cfg()->preds(lab_id).size() != 1) { + ++bi; + continue; + } + + bool pred_is_header = IsHeader(&*bi); + bool succ_is_header = IsHeader(lab_id); + if (pred_is_header && succ_is_header) { + // Cannot merge two headers together. + ++bi; + continue; + } + + bool pred_is_merge = IsMerge(&*bi); + bool succ_is_merge = IsMerge(lab_id); + if (pred_is_merge && succ_is_merge) { + // Cannot merge two merges together. + ++bi; + continue; + } + + ir::Instruction* merge_inst = bi->GetMergeInst(); + if (pred_is_header && lab_id != merge_inst->GetSingleWordInOperand(0u)) { + // If this is a header block and the successor is not its merge, we must + // be careful about which blocks we are willing to merge together. + // OpLoopMerge must be followed by a conditional or unconditional branch. + // The merge must be a loop merge because a selection merge cannot be + // followed by an unconditional branch. + ir::BasicBlock* succ_block = context()->get_instr_block(lab_id); + SpvOp succ_term_op = succ_block->terminator()->opcode(); + assert(merge_inst->opcode() == SpvOpLoopMerge); + if (succ_term_op != SpvOpBranch && + succ_term_op != SpvOpBranchConditional) { + ++bi; + continue; + } + } + + // Merge blocks. + context()->KillInst(br); + auto sbi = bi; + for (; sbi != func->end(); ++sbi) + if (sbi->id() == lab_id) break; + // If bi is sbi's only predecessor, it dominates sbi and thus + // sbi must follow bi in func's ordering. + assert(sbi != func->end()); + bi->AddInstructions(&*sbi); + if (merge_inst) { + if (pred_is_header && lab_id == merge_inst->GetSingleWordInOperand(0u)) { + // Merging the header and merge blocks, so remove the structured control + // flow declaration. + context()->KillInst(merge_inst); + } else { + // Move the merge instruction to just before the terminator. + merge_inst->InsertBefore(bi->terminator()); + } + } + context()->ReplaceAllUsesWith(lab_id, bi->id()); + KillInstAndName(sbi->GetLabelInst()); + (void)sbi.Erase(); + // Reprocess block. + modified = true; + } + return modified; +} + +bool BlockMergePass::IsHeader(ir::BasicBlock* block) { + return block->GetMergeInst() != nullptr; +} + +bool BlockMergePass::IsHeader(uint32_t id) { + return IsHeader(context()->get_instr_block(get_def_use_mgr()->GetDef(id))); +} + +bool BlockMergePass::IsMerge(uint32_t id) { + return !get_def_use_mgr()->WhileEachUse(id, [](ir::Instruction* user, + uint32_t index) { + SpvOp op = user->opcode(); + if ((op == SpvOpLoopMerge || op == SpvOpSelectionMerge) && index == 0u) { + return false; + } + return true; + }); +} + +bool BlockMergePass::IsMerge(ir::BasicBlock* block) { + return IsMerge(block->id()); +} + +void BlockMergePass::Initialize(ir::IRContext* c) { InitializeProcessing(c); } + +Pass::Status BlockMergePass::ProcessImpl() { + // Process all entry point functions. + ProcessFunction pfn = [this](ir::Function* fp) { return MergeBlocks(fp); }; + bool modified = ProcessEntryPointCallTree(pfn, get_module()); + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +BlockMergePass::BlockMergePass() {} + +Pass::Status BlockMergePass::Process(ir::IRContext* c) { + Initialize(c); + return ProcessImpl(); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/block_merge_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/block_merge_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/block_merge_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/block_merge_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#ifndef LIBSPIRV_OPT_BLOCK_MERGE_PASS_H_ +#define LIBSPIRV_OPT_BLOCK_MERGE_PASS_H_ + +#include +#include +#include +#include +#include +#include + +#include "basic_block.h" +#include "def_use_manager.h" +#include "ir_context.h" +#include "module.h" +#include "pass.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class BlockMergePass : public Pass { + public: + BlockMergePass(); + const char* name() const override { return "merge-blocks"; } + Status Process(ir::IRContext*) override; + + private: + // Kill any OpName instruction referencing |inst|, then kill |inst|. + void KillInstAndName(ir::Instruction* inst); + + // Search |func| for blocks which have a single Branch to a block + // with no other predecessors. Merge these blocks into a single block. + bool MergeBlocks(ir::Function* func); + + // Returns true if |block| (or |id|) contains a merge instruction. + bool IsHeader(ir::BasicBlock* block); + bool IsHeader(uint32_t id); + + // Returns true if |block| (or |id|) is the merge target of a merge + // instruction. + bool IsMerge(ir::BasicBlock* block); + bool IsMerge(uint32_t id); + + void Initialize(ir::IRContext* c); + Pass::Status ProcessImpl(); +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_BLOCK_MERGE_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/build_module.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/build_module.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/build_module.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/build_module.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright (c) 2016 Google 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. + +#include "build_module.h" + +#include "ir_context.h" +#include "ir_loader.h" +#include "make_unique.h" +#include "table.h" + +namespace spvtools { + +namespace { + +// Sets the module header for IrLoader. Meets the interface requirement of +// spvBinaryParse(). +spv_result_t SetSpvHeader(void* builder, spv_endianness_t, uint32_t magic, + uint32_t version, uint32_t generator, + uint32_t id_bound, uint32_t reserved) { + reinterpret_cast(builder)->SetModuleHeader( + magic, version, generator, id_bound, reserved); + return SPV_SUCCESS; +} + +// Processes a parsed instruction for IrLoader. Meets the interface requirement +// of spvBinaryParse(). +spv_result_t SetSpvInst(void* builder, const spv_parsed_instruction_t* inst) { + if (reinterpret_cast(builder)->AddInstruction(inst)) { + return SPV_SUCCESS; + } + return SPV_ERROR_INVALID_BINARY; +} + +} // namespace + +std::unique_ptr BuildModule(spv_target_env env, + MessageConsumer consumer, + const uint32_t* binary, + const size_t size) { + auto context = spvContextCreate(env); + libspirv::SetContextMessageConsumer(context, consumer); + + auto irContext = MakeUnique(env, consumer); + ir::IrLoader loader(consumer, irContext->module()); + + spv_result_t status = spvBinaryParse(context, &loader, binary, size, + SetSpvHeader, SetSpvInst, nullptr); + loader.EndModule(); + + spvContextDestroy(context); + + return status == SPV_SUCCESS ? std::move(irContext) : nullptr; +} + +std::unique_ptr BuildModule(spv_target_env env, + MessageConsumer consumer, + const std::string& text, + uint32_t assemble_options) { + SpirvTools t(env); + t.SetMessageConsumer(consumer); + std::vector binary; + if (!t.Assemble(text, &binary, assemble_options)) return nullptr; + return BuildModule(env, consumer, binary.data(), binary.size()); +} + +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/build_module.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/build_module.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/build_module.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/build_module.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,45 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SPIRV_TOOLS_OPT_BUILD_MODULE_H_ +#define SPIRV_TOOLS_OPT_BUILD_MODULE_H_ + +#include +#include + +#include "ir_context.h" +#include "module.h" +#include "spirv-tools/libspirv.hpp" + +namespace spvtools { + +// Builds an ir::Module returns the owning ir::IRContext from the given SPIR-V +// |binary|. |size| specifies number of words in |binary|. The |binary| will be +// decoded according to the given target |env|. Returns nullptr if errors occur +// and sends the errors to |consumer|. +std::unique_ptr BuildModule(spv_target_env env, + MessageConsumer consumer, + const uint32_t* binary, size_t size); + +// Builds an ir::Module and returns the owning ir::IRContext from the given +// SPIR-V assembly |text|. The |text| will be encoded according to the given +// target |env|. Returns nullptr if errors occur and sends the errors to +// |consumer|. +std::unique_ptr BuildModule( + spv_target_env env, MessageConsumer consumer, const std::string& text, + uint32_t assemble_options = SpirvTools::kDefaultAssembleOption); + +} // namespace spvtools + +#endif // SPIRV_TOOLS_OPT_BUILD_MODULE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/ccp_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/ccp_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/ccp_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/ccp_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,330 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file implements conditional constant propagation as described in +// +// Constant propagation with conditional branches, +// Wegman and Zadeck, ACM TOPLAS 13(2):181-210. +#include "ccp_pass.h" +#include "fold.h" +#include "function.h" +#include "module.h" +#include "propagator.h" + +#include + +namespace spvtools { +namespace opt { + +namespace { + +// This SSA id is never defined nor referenced in the IR. It is a special ID +// which represents varying values. When an ID is found to have a varying +// value, its entry in the |values_| table maps to kVaryingSSAId. +const uint32_t kVaryingSSAId = std::numeric_limits::max(); + +} // namespace + +bool CCPPass::IsVaryingValue(uint32_t id) const { return id == kVaryingSSAId; } + +SSAPropagator::PropStatus CCPPass::MarkInstructionVarying( + ir::Instruction* instr) { + assert(instr->result_id() != 0 && + "Instructions with no result cannot be marked varying."); + values_[instr->result_id()] = kVaryingSSAId; + return SSAPropagator::kVarying; +} + +SSAPropagator::PropStatus CCPPass::VisitPhi(ir::Instruction* phi) { + uint32_t meet_val_id = 0; + + // Implement the lattice meet operation. The result of this Phi instruction is + // interesting only if the meet operation over arguments coming through + // executable edges yields the same constant value. + for (uint32_t i = 2; i < phi->NumOperands(); i += 2) { + if (!propagator_->IsPhiArgExecutable(phi, i)) { + // Ignore arguments coming through non-executable edges. + continue; + } + uint32_t phi_arg_id = phi->GetSingleWordOperand(i); + auto it = values_.find(phi_arg_id); + if (it != values_.end()) { + // We found an argument with a constant value. Apply the meet operation + // with the previous arguments. + if (it->second == kVaryingSSAId) { + // The "constant" value is actually a placeholder for varying. Return + // varying for this phi. + return MarkInstructionVarying(phi); + } else if (meet_val_id == 0) { + // This is the first argument we find. Initialize the result to its + // constant value id. + meet_val_id = it->second; + } else if (it->second == meet_val_id) { + // The argument is the same constant value already computed. Continue + // looking. + continue; + } else { + // We either found a varying value, or another constant value different + // from the previous computed meet value. This Phi will never be + // constant. + return MarkInstructionVarying(phi); + } + } else { + // The incoming value has no recorded value and is therefore not + // interesting. A not interesting value joined with any other value is the + // other value. + continue; + } + } + + // If there are no incoming executable edges, the meet ID will still be 0. In + // that case, return not interesting to evaluate the Phi node again. + if (meet_val_id == 0) { + return SSAPropagator::kNotInteresting; + } + + // All the operands have the same constant value represented by |meet_val_id|. + // Set the Phi's result to that value and declare it interesting. + values_[phi->result_id()] = meet_val_id; + return SSAPropagator::kInteresting; +} + +SSAPropagator::PropStatus CCPPass::VisitAssignment(ir::Instruction* instr) { + assert(instr->result_id() != 0 && + "Expecting an instruction that produces a result"); + + // If this is a copy operation, and the RHS is a known constant, assign its + // value to the LHS. + if (instr->opcode() == SpvOpCopyObject) { + uint32_t rhs_id = instr->GetSingleWordInOperand(0); + auto it = values_.find(rhs_id); + if (it != values_.end()) { + if (IsVaryingValue(it->second)) { + return MarkInstructionVarying(instr); + } else { + values_[instr->result_id()] = it->second; + return SSAPropagator::kInteresting; + } + } + return SSAPropagator::kNotInteresting; + } + + // Instructions with a RHS that cannot produce a constant are always varying. + if (!instr->IsFoldable()) { + return MarkInstructionVarying(instr); + } + + // See if the RHS of the assignment folds into a constant value. + auto map_func = [this](uint32_t id) { + auto it = values_.find(id); + if (it == values_.end() || IsVaryingValue(it->second)) { + return id; + } + return it->second; + }; + ir::Instruction* folded_inst = + opt::FoldInstructionToConstant(instr, map_func); + if (folded_inst != nullptr) { + // We do not want to change the body of the function by adding new + // instructions. When folding we can only generate new constants. + assert(folded_inst->IsConstant() && "CCP is only interested in constant."); + values_[instr->result_id()] = folded_inst->result_id(); + return SSAPropagator::kInteresting; + } + + // Conservatively mark this instruction as varying if any input id is varying. + if (!instr->WhileEachInId([this](uint32_t* op_id) { + auto iter = values_.find(*op_id); + if (iter != values_.end() && IsVaryingValue(iter->second)) return false; + return true; + })) { + return MarkInstructionVarying(instr); + } + + // If not, see if there is a least one unknown operand to the instruction. If + // so, we might be able to fold it later. + if (!instr->WhileEachInId([this](uint32_t* op_id) { + auto it = values_.find(*op_id); + if (it == values_.end()) return false; + return true; + })) { + return SSAPropagator::kNotInteresting; + } + + // Otherwise, we will never be able to fold this instruction, so mark it + // varying. + return MarkInstructionVarying(instr); +} + +SSAPropagator::PropStatus CCPPass::VisitBranch(ir::Instruction* instr, + ir::BasicBlock** dest_bb) const { + assert(instr->IsBranch() && "Expected a branch instruction."); + + *dest_bb = nullptr; + uint32_t dest_label = 0; + if (instr->opcode() == SpvOpBranch) { + // An unconditional jump always goes to its unique destination. + dest_label = instr->GetSingleWordInOperand(0); + } else if (instr->opcode() == SpvOpBranchConditional) { + // For a conditional branch, determine whether the predicate selector has a + // known value in |values_|. If it does, set the destination block + // according to the selector's boolean value. + uint32_t pred_id = instr->GetSingleWordOperand(0); + auto it = values_.find(pred_id); + if (it == values_.end() || IsVaryingValue(it->second)) { + // The predicate has an unknown value, either branch could be taken. + return SSAPropagator::kVarying; + } + + // Get the constant value for the predicate selector from the value table. + // Use it to decide which branch will be taken. + uint32_t pred_val_id = it->second; + const analysis::Constant* c = const_mgr_->FindDeclaredConstant(pred_val_id); + assert(c && "Expected to find a constant declaration for a known value."); + // Undef values should have returned as varying above. + assert(c->AsBoolConstant() || c->AsNullConstant()); + if (c->AsNullConstant()) { + dest_label = instr->GetSingleWordOperand(2u); + } else { + const analysis::BoolConstant* val = c->AsBoolConstant(); + dest_label = val->value() ? instr->GetSingleWordOperand(1) + : instr->GetSingleWordOperand(2); + } + } else { + // For an OpSwitch, extract the value taken by the switch selector and check + // which of the target literals it matches. The branch associated with that + // literal is the taken branch. + assert(instr->opcode() == SpvOpSwitch); + if (instr->GetOperand(0).words.size() != 1) { + // If the selector is wider than 32-bits, return varying. TODO(dnovillo): + // Add support for wider constants. + return SSAPropagator::kVarying; + } + uint32_t select_id = instr->GetSingleWordOperand(0); + auto it = values_.find(select_id); + if (it == values_.end() || IsVaryingValue(it->second)) { + // The selector has an unknown value, any of the branches could be taken. + return SSAPropagator::kVarying; + } + + // Get the constant value for the selector from the value table. Use it to + // decide which branch will be taken. + uint32_t select_val_id = it->second; + const analysis::Constant* c = + const_mgr_->FindDeclaredConstant(select_val_id); + assert(c && "Expected to find a constant declaration for a known value."); + // TODO: support 64-bit integer switches. + uint32_t constant_cond = 0; + if (const analysis::IntConstant* val = c->AsIntConstant()) { + constant_cond = val->words()[0]; + } else { + // Undef values should have returned varying above. + assert(c->AsNullConstant()); + constant_cond = 0; + } + + // Start assuming that the selector will take the default value; + dest_label = instr->GetSingleWordOperand(1); + for (uint32_t i = 2; i < instr->NumOperands(); i += 2) { + if (constant_cond == instr->GetSingleWordOperand(i)) { + dest_label = instr->GetSingleWordOperand(i + 1); + break; + } + } + } + + assert(dest_label && "Destination label should be set at this point."); + *dest_bb = context()->cfg()->block(dest_label); + return SSAPropagator::kInteresting; +} + +SSAPropagator::PropStatus CCPPass::VisitInstruction(ir::Instruction* instr, + ir::BasicBlock** dest_bb) { + *dest_bb = nullptr; + if (instr->opcode() == SpvOpPhi) { + return VisitPhi(instr); + } else if (instr->IsBranch()) { + return VisitBranch(instr, dest_bb); + } else if (instr->result_id()) { + return VisitAssignment(instr); + } + return SSAPropagator::kVarying; +} + +bool CCPPass::ReplaceValues() { + bool retval = false; + for (const auto& it : values_) { + uint32_t id = it.first; + uint32_t cst_id = it.second; + if (!IsVaryingValue(cst_id) && id != cst_id) { + retval |= context()->ReplaceAllUsesWith(id, cst_id); + } + } + return retval; +} + +bool CCPPass::PropagateConstants(ir::Function* fp) { + // Mark function parameters as varying. + fp->ForEachParam([this](const ir::Instruction* inst) { + values_[inst->result_id()] = kVaryingSSAId; + }); + + const auto visit_fn = [this](ir::Instruction* instr, + ir::BasicBlock** dest_bb) { + return VisitInstruction(instr, dest_bb); + }; + + propagator_ = + std::unique_ptr(new SSAPropagator(context(), visit_fn)); + + if (propagator_->Run(fp)) { + return ReplaceValues(); + } + + return false; +} + +void CCPPass::Initialize(ir::IRContext* c) { + InitializeProcessing(c); + + const_mgr_ = context()->get_constant_mgr(); + + // Populate the constant table with values from constant declarations in the + // module. The values of each OpConstant declaration is the identity + // assignment (i.e., each constant is its own value). + for (const auto& inst : get_module()->types_values()) { + // Record compile time constant ids. Treat all other global values as + // varying. + if (inst.IsConstant()) { + values_[inst.result_id()] = inst.result_id(); + } else { + values_[inst.result_id()] = kVaryingSSAId; + } + } +} + +Pass::Status CCPPass::Process(ir::IRContext* c) { + Initialize(c); + + // Process all entry point functions. + ProcessFunction pfn = [this](ir::Function* fp) { + return PropagateConstants(fp); + }; + bool modified = ProcessReachableCallTree(pfn, context()); + return modified ? Pass::Status::SuccessWithChange + : Pass::Status::SuccessWithoutChange; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/ccp_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/ccp_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/ccp_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/ccp_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,100 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_CCP_PASS_H_ +#define LIBSPIRV_OPT_CCP_PASS_H_ + +#include "constants.h" +#include "function.h" +#include "ir_context.h" +#include "mem_pass.h" +#include "module.h" +#include "propagator.h" + +namespace spvtools { +namespace opt { + +class CCPPass : public MemPass { + public: + CCPPass() = default; + const char* name() const override { return "ccp"; } + Status Process(ir::IRContext* c) override; + + private: + // Initializes the pass. + void Initialize(ir::IRContext* c); + + // Runs constant propagation on the given function |fp|. Returns true if any + // constants were propagated and the IR modified. + bool PropagateConstants(ir::Function* fp); + + // Visits a single instruction |instr|. If the instruction is a conditional + // branch that always jumps to the same basic block, it sets the destination + // block in |dest_bb|. + SSAPropagator::PropStatus VisitInstruction(ir::Instruction* instr, + ir::BasicBlock** dest_bb); + + // Visits an OpPhi instruction |phi|. This applies the meet operator for the + // CCP lattice. Essentially, if all the operands in |phi| have the same + // constant value C, the result for |phi| gets assigned the value C. + SSAPropagator::PropStatus VisitPhi(ir::Instruction* phi); + + // Visits an SSA assignment instruction |instr|. If the RHS of |instr| folds + // into a constant value C, then the LHS of |instr| is assigned the value C in + // |values_|. + SSAPropagator::PropStatus VisitAssignment(ir::Instruction* instr); + + // Visits a branch instruction |instr|. If the branch is conditional + // (OpBranchConditional or OpSwitch), and the value of its selector is known, + // |dest_bb| will be set to the corresponding destination block. Unconditional + // branches always set |dest_bb| to the single destination block. + SSAPropagator::PropStatus VisitBranch(ir::Instruction* instr, + ir::BasicBlock** dest_bb) const; + + // Replaces all operands used in |fp| with the corresponding constant values + // in |values_|. Returns true if any operands were replaced, and false + // otherwise. + bool ReplaceValues(); + + // Marks |instr| as varying by registering a varying value for its result + // into the |values_| table. Returns SSAPropagator::kVarying. + SSAPropagator::PropStatus MarkInstructionVarying(ir::Instruction* instr); + + // Returns true if |id| is the special SSA id that corresponds to a varying + // value. + bool IsVaryingValue(uint32_t id) const; + + // Constant manager for the parent IR context. Used to record new constants + // generated during propagation. + analysis::ConstantManager* const_mgr_; + + // Constant value table. Each entry in this map + // represents the compile-time constant value for |id| as declared by + // |const_decl_id|. Each |const_decl_id| in this table is an OpConstant + // declaration for the current module. + // + // Additionally, this table keeps track of SSA IDs with varying values. If an + // SSA ID is found to have a varying value, it will have an entry in this + // table that maps to the special SSA id kVaryingSSAId. These values are + // never replaced in the IR, they are used by CCP during propagation. + std::unordered_map values_; + + // Propagator engine used. + std::unique_ptr propagator_; +}; + +} // namespace opt +} // namespace spvtools + +#endif diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/cfg_cleanup_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/cfg_cleanup_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/cfg_cleanup_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/cfg_cleanup_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,43 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file implements a pass to cleanup the CFG to remove superfluous +// constructs (e.g., unreachable basic blocks, empty control flow structures, +// etc) + +#include +#include + +#include "cfg_cleanup_pass.h" + +#include "function.h" +#include "module.h" + +namespace spvtools { +namespace opt { + +void CFGCleanupPass::Initialize(ir::IRContext* c) { InitializeProcessing(c); } + +Pass::Status CFGCleanupPass::Process(ir::IRContext* c) { + Initialize(c); + + // Process all entry point functions. + ProcessFunction pfn = [this](ir::Function* fp) { return CFGCleanup(fp); }; + bool modified = ProcessReachableCallTree(pfn, context()); + return modified ? Pass::Status::SuccessWithChange + : Pass::Status::SuccessWithoutChange; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/cfg_cleanup_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/cfg_cleanup_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/cfg_cleanup_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/cfg_cleanup_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,43 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_CFG_CLEANUP_PASS_H_ +#define LIBSPIRV_OPT_CFG_CLEANUP_PASS_H_ + +#include "function.h" +#include "mem_pass.h" +#include "module.h" + +namespace spvtools { +namespace opt { + +class CFGCleanupPass : public MemPass { + public: + CFGCleanupPass() = default; + const char* name() const override { return "cfg-cleanup"; } + Status Process(ir::IRContext* c) override; + + ir::IRContext::Analysis GetPreservedAnalyses() override { + return ir::IRContext::kAnalysisDefUse; + } + + private: + // Initialize the pass. + void Initialize(ir::IRContext* c); +}; + +} // namespace opt +} // namespace spvtools + +#endif diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/cfg.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/cfg.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/cfg.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/cfg.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,310 @@ +// Copyright (c) 2017 Google 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. + +#include "cfg.h" +#include "cfa.h" +#include "ir_builder.h" +#include "ir_context.h" +#include "module.h" + +namespace spvtools { +namespace ir { + +namespace { + +// Universal Limit of ResultID + 1 +const int kInvalidId = 0x400000; + +} // namespace + +CFG::CFG(ir::Module* module) + : module_(module), + pseudo_entry_block_(std::unique_ptr( + new ir::Instruction(module->context(), SpvOpLabel, 0, 0, {}))), + pseudo_exit_block_(std::unique_ptr(new ir::Instruction( + module->context(), SpvOpLabel, 0, kInvalidId, {}))) { + for (auto& fn : *module) { + for (auto& blk : fn) { + RegisterBlock(&blk); + } + } +} + +void CFG::AddEdges(ir::BasicBlock* blk) { + uint32_t blk_id = blk->id(); + // Force the creation of an entry, not all basic block have predecessors + // (such as the entry blocks and some unreachables). + label2preds_[blk_id]; + const auto* const_blk = blk; + const_blk->ForEachSuccessorLabel( + [blk_id, this](const uint32_t succ_id) { AddEdge(blk_id, succ_id); }); +} + +void CFG::RemoveNonExistingEdges(uint32_t blk_id) { + std::vector updated_pred_list; + for (uint32_t id : preds(blk_id)) { + const ir::BasicBlock* pred_blk = block(id); + bool has_branch = false; + pred_blk->ForEachSuccessorLabel([&has_branch, blk_id](uint32_t succ) { + if (succ == blk_id) { + has_branch = true; + } + }); + if (has_branch) updated_pred_list.push_back(id); + } + + label2preds_.at(blk_id) = std::move(updated_pred_list); +} + +void CFG::ComputeStructuredOrder(ir::Function* func, ir::BasicBlock* root, + std::list* order) { + assert(module_->context()->get_feature_mgr()->HasCapability( + SpvCapabilityShader) && + "This only works on structured control flow"); + + // Compute structured successors and do DFS. + ComputeStructuredSuccessors(func); + auto ignore_block = [](cbb_ptr) {}; + auto ignore_edge = [](cbb_ptr, cbb_ptr) {}; + auto get_structured_successors = [this](const ir::BasicBlock* b) { + return &(block2structured_succs_[b]); + }; + + // TODO(greg-lunarg): Get rid of const_cast by making moving const + // out of the cfa.h prototypes and into the invoking code. + auto post_order = [&](cbb_ptr b) { + order->push_front(const_cast(b)); + }; + spvtools::CFA::DepthFirstTraversal( + root, get_structured_successors, ignore_block, post_order, ignore_edge); +} + +void CFG::ForEachBlockInReversePostOrder( + BasicBlock* bb, const std::function& f) { + std::vector po; + std::unordered_set seen; + ComputePostOrderTraversal(bb, &po, &seen); + + for (auto current_bb = po.rbegin(); current_bb != po.rend(); ++current_bb) { + if (!IsPseudoExitBlock(*current_bb) && !IsPseudoEntryBlock(*current_bb)) { + f(*current_bb); + } + } +} + +void CFG::ComputeStructuredSuccessors(ir::Function* func) { + block2structured_succs_.clear(); + for (auto& blk : *func) { + // If no predecessors in function, make successor to pseudo entry. + if (label2preds_[blk.id()].size() == 0) + block2structured_succs_[&pseudo_entry_block_].push_back(&blk); + + // If header, make merge block first successor and continue block second + // successor if there is one. + uint32_t mbid = blk.MergeBlockIdIfAny(); + if (mbid != 0) { + block2structured_succs_[&blk].push_back(block(mbid)); + uint32_t cbid = blk.ContinueBlockIdIfAny(); + if (cbid != 0) { + block2structured_succs_[&blk].push_back(block(cbid)); + } + } + + // Add true successors. + const auto& const_blk = blk; + const_blk.ForEachSuccessorLabel([&blk, this](const uint32_t sbid) { + block2structured_succs_[&blk].push_back(block(sbid)); + }); + } +} + +void CFG::ComputePostOrderTraversal(BasicBlock* bb, vector* order, + unordered_set* seen) { + seen->insert(bb); + static_cast(bb)->ForEachSuccessorLabel( + [&order, &seen, this](const uint32_t sbid) { + BasicBlock* succ_bb = id2block_[sbid]; + if (!seen->count(succ_bb)) { + ComputePostOrderTraversal(succ_bb, order, seen); + } + }); + order->push_back(bb); +} + +BasicBlock* CFG::SplitLoopHeader(ir::BasicBlock* bb) { + assert(bb->GetLoopMergeInst() && "Expecting bb to be the header of a loop."); + + Function* fn = bb->GetParent(); + IRContext* context = fn->context(); + + // Find the insertion point for the new bb. + Function::iterator header_it = std::find_if( + fn->begin(), fn->end(), + [bb](BasicBlock& block_in_func) { return &block_in_func == bb; }); + assert(header_it != fn->end()); + + const std::vector& pred = preds(bb->id()); + // Find the back edge + ir::BasicBlock* latch_block = nullptr; + Function::iterator latch_block_iter = header_it; + while (++latch_block_iter != fn->end()) { + // If blocks are in the proper order, then the only branch that appears + // after the header is the latch. + if (std::find(pred.begin(), pred.end(), latch_block_iter->id()) != + pred.end()) { + break; + } + } + assert(latch_block_iter != fn->end() && "Could not find the latch."); + latch_block = &*latch_block_iter; + + RemoveSuccessorEdges(bb); + + // Create the new header bb basic bb. + // Leave the phi instructions behind. + auto iter = bb->begin(); + while (iter->opcode() == SpvOpPhi) { + ++iter; + } + + std::unique_ptr newBlock( + bb->SplitBasicBlock(context, context->TakeNextId(), iter)); + + // Insert the new bb in the correct position + auto insert_pos = header_it; + ++insert_pos; + ir::BasicBlock* new_header = &*insert_pos.InsertBefore(std::move(newBlock)); + new_header->SetParent(fn); + uint32_t new_header_id = new_header->id(); + context->AnalyzeDefUse(new_header->GetLabelInst()); + + // Update cfg + RegisterBlock(new_header); + + // Update bb mappings. + context->set_instr_block(new_header->GetLabelInst(), new_header); + new_header->ForEachInst([new_header, context](ir::Instruction* inst) { + context->set_instr_block(inst, new_header); + }); + + // Adjust the OpPhi instructions as needed. + bb->ForEachPhiInst([latch_block, bb, new_header, context](Instruction* phi) { + std::vector preheader_phi_ops; + std::vector header_phi_ops; + + // Identify where the original inputs to original OpPhi belong: header or + // preheader. + for (uint32_t i = 0; i < phi->NumInOperands(); i += 2) { + uint32_t def_id = phi->GetSingleWordInOperand(i); + uint32_t branch_id = phi->GetSingleWordInOperand(i + 1); + if (branch_id == latch_block->id()) { + header_phi_ops.push_back({SPV_OPERAND_TYPE_ID, {def_id}}); + header_phi_ops.push_back({SPV_OPERAND_TYPE_ID, {branch_id}}); + } else { + preheader_phi_ops.push_back(def_id); + preheader_phi_ops.push_back(branch_id); + } + } + + // Create a phi instruction if and only if the preheader_phi_ops has more + // than one pair. + if (preheader_phi_ops.size() > 2) { + opt::InstructionBuilder builder( + context, &*bb->begin(), + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping); + + ir::Instruction* new_phi = + builder.AddPhi(phi->type_id(), preheader_phi_ops); + + // Add the OpPhi to the header bb. + header_phi_ops.push_back({SPV_OPERAND_TYPE_ID, {new_phi->result_id()}}); + header_phi_ops.push_back({SPV_OPERAND_TYPE_ID, {bb->id()}}); + } else { + // An OpPhi with a single entry is just a copy. In this case use the same + // instruction in the new header. + header_phi_ops.push_back({SPV_OPERAND_TYPE_ID, {preheader_phi_ops[0]}}); + header_phi_ops.push_back({SPV_OPERAND_TYPE_ID, {bb->id()}}); + } + + phi->RemoveFromList(); + std::unique_ptr phi_owner(phi); + phi->SetInOperands(std::move(header_phi_ops)); + new_header->begin()->InsertBefore(std::move(phi_owner)); + context->set_instr_block(phi, new_header); + context->AnalyzeUses(phi); + }); + + // Add a branch to the new header. + opt::InstructionBuilder branch_builder( + context, bb, + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping); + bb->AddInstruction(MakeUnique( + context, SpvOpBranch, 0, 0, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {new_header->id()}}})); + context->AnalyzeUses(bb->terminator()); + context->set_instr_block(bb->terminator(), bb); + label2preds_[new_header->id()].push_back(bb->id()); + + // Update the latch to branch to the new header. + latch_block->ForEachSuccessorLabel([bb, new_header_id](uint32_t* id) { + if (*id == bb->id()) { + *id = new_header_id; + } + }); + ir::Instruction* latch_branch = latch_block->terminator(); + context->AnalyzeUses(latch_branch); + label2preds_[new_header->id()].push_back(latch_block->id()); + + auto& block_preds = label2preds_[bb->id()]; + auto latch_pos = + std::find(block_preds.begin(), block_preds.end(), latch_block->id()); + assert(latch_pos != block_preds.end() && "The cfg was invalid."); + block_preds.erase(latch_pos); + + // Update the loop descriptors + if (context->AreAnalysesValid(ir::IRContext::kAnalysisLoopAnalysis)) { + LoopDescriptor* loop_desc = context->GetLoopDescriptor(bb->GetParent()); + Loop* loop = (*loop_desc)[bb->id()]; + + loop->AddBasicBlock(new_header_id); + loop->SetHeaderBlock(new_header); + loop_desc->SetBasicBlockToLoop(new_header_id, loop); + + loop->RemoveBasicBlock(bb->id()); + loop->SetPreHeaderBlock(bb); + + Loop* parent_loop = loop->GetParent(); + if (parent_loop != nullptr) { + parent_loop->AddBasicBlock(bb->id()); + loop_desc->SetBasicBlockToLoop(bb->id(), parent_loop); + } else { + loop_desc->SetBasicBlockToLoop(bb->id(), nullptr); + } + } + return new_header; +} + +unordered_set CFG::FindReachableBlocks(BasicBlock* start) { + std::unordered_set reachable_blocks; + ForEachBlockInReversePostOrder(start, [&reachable_blocks](BasicBlock* bb) { + reachable_blocks.insert(bb); + }); + return reachable_blocks; +} + +} // namespace ir +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/cfg.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/cfg.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/cfg.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/cfg.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,175 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_CFG_H_ +#define LIBSPIRV_OPT_CFG_H_ + +#include "basic_block.h" + +#include +#include +#include +#include + +namespace spvtools { +namespace ir { + +class CFG { + public: + CFG(ir::Module* module); + + // Return the module described by this CFG. + ir::Module* get_module() const { return module_; } + + // Return the list of predecesors for basic block with label |blkid|. + // TODO(dnovillo): Move this to ir::BasicBlock. + const std::vector& preds(uint32_t blk_id) const { + assert(label2preds_.count(blk_id)); + return label2preds_.at(blk_id); + } + + // Return a pointer to the basic block instance corresponding to the label + // |blk_id|. + ir::BasicBlock* block(uint32_t blk_id) const { return id2block_.at(blk_id); } + + // Return the pseudo entry and exit blocks. + const ir::BasicBlock* pseudo_entry_block() const { + return &pseudo_entry_block_; + } + ir::BasicBlock* pseudo_entry_block() { return &pseudo_entry_block_; } + + const ir::BasicBlock* pseudo_exit_block() const { + return &pseudo_exit_block_; + } + ir::BasicBlock* pseudo_exit_block() { return &pseudo_exit_block_; } + + // Return true if |block_ptr| is the pseudo-entry block. + bool IsPseudoEntryBlock(ir::BasicBlock* block_ptr) const { + return block_ptr == &pseudo_entry_block_; + } + + // Return true if |block_ptr| is the pseudo-exit block. + bool IsPseudoExitBlock(ir::BasicBlock* block_ptr) const { + return block_ptr == &pseudo_exit_block_; + } + + // Compute structured block order into |order| for |func| starting at |root|. + // This order has the property that dominators come before all blocks they + // dominate and merge blocks come after all blocks that are in the control + // constructs of their header. + void ComputeStructuredOrder(ir::Function* func, ir::BasicBlock* root, + std::list* order); + + // Applies |f| to the basic block in reverse post order starting with |bb|. + // Note that basic blocks that cannot be reached from |bb| node will not be + // processed. + void ForEachBlockInReversePostOrder( + BasicBlock* bb, const std::function& f); + + // Registers |blk| as a basic block in the cfg, this also updates the + // predecessor lists of each successor of |blk|. + void RegisterBlock(ir::BasicBlock* blk) { + uint32_t blk_id = blk->id(); + id2block_[blk_id] = blk; + AddEdges(blk); + } + + // Removes from the CFG any mapping for the basic block id |blk_id|. + void ForgetBlock(const ir::BasicBlock* blk) { + id2block_.erase(blk->id()); + label2preds_.erase(blk->id()); + RemoveSuccessorEdges(blk); + } + + void RemoveEdge(uint32_t pred_blk_id, uint32_t succ_blk_id) { + auto pred_it = label2preds_.find(succ_blk_id); + if (pred_it == label2preds_.end()) return; + auto& preds_list = pred_it->second; + auto it = std::find(preds_list.begin(), preds_list.end(), pred_blk_id); + if (it != preds_list.end()) preds_list.erase(it); + } + + // Registers |blk| to all of its successors. + void AddEdges(ir::BasicBlock* blk); + + // Registers the basic block id |pred_blk_id| as being a predecessor of the + // basic block id |succ_blk_id|. + void AddEdge(uint32_t pred_blk_id, uint32_t succ_blk_id) { + label2preds_[succ_blk_id].push_back(pred_blk_id); + } + + // Removes any edges that no longer exist from the predecessor mapping for + // the basic block id |blk_id|. + void RemoveNonExistingEdges(uint32_t blk_id); + + // Remove all edges that leave |bb|. + void RemoveSuccessorEdges(const ir::BasicBlock* bb) { + bb->ForEachSuccessorLabel( + [bb, this](uint32_t succ_id) { RemoveEdge(bb->id(), succ_id); }); + } + + // Divides |block| into two basic blocks. The first block will have the same + // id as |block| and will become a preheader for the loop. The other block + // is a new block that will be the new loop header. + // + // Returns a pointer to the new loop header. + BasicBlock* SplitLoopHeader(ir::BasicBlock* bb); + + std::unordered_set FindReachableBlocks(BasicBlock* start); + + private: + using cbb_ptr = const ir::BasicBlock*; + + // Compute structured successors for function |func|. A block's structured + // successors are the blocks it branches to together with its declared merge + // block and continue block if it has them. When order matters, the merge + // block and continue block always appear first. This assures correct depth + // first search in the presence of early returns and kills. If the successor + // vector contain duplicates of the merge or continue blocks, they are safely + // ignored by DFS. + void ComputeStructuredSuccessors(ir::Function* func); + + // Computes the post-order traversal of the cfg starting at |bb| skipping + // nodes in |seen|. The order of the traversal is appended to |order|, and + // all nodes in the traversal are added to |seen|. + void ComputePostOrderTraversal(BasicBlock* bb, + std::vector* order, + std::unordered_set* seen); + + // Module for this CFG. + ir::Module* module_; + + // Map from block to its structured successor blocks. See + // ComputeStructuredSuccessors() for definition. + std::unordered_map> + block2structured_succs_; + + // Extra block whose successors are all blocks with no predecessors + // in function. + ir::BasicBlock pseudo_entry_block_; + + // Augmented CFG Exit Block. + ir::BasicBlock pseudo_exit_block_; + + // Map from block's label id to its predecessor blocks ids + std::unordered_map> label2preds_; + + // Map from block's label id to block. + std::unordered_map id2block_; +}; + +} // namespace ir +} // namespace spvtools + +#endif // LIBSPIRV_OPT_CFG_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,191 @@ +# Copyright (c) 2016 Google 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. +add_library(SPIRV-Tools-opt + aggressive_dead_code_elim_pass.h + basic_block.h + block_merge_pass.h + build_module.h + ccp_pass.h + cfg_cleanup_pass.h + cfg.h + common_uniform_elim_pass.h + compact_ids_pass.h + composite.h + const_folding_rules.h + constants.h + copy_prop_arrays.h + dead_branch_elim_pass.h + dead_insert_elim_pass.h + dead_variable_elimination.h + decoration_manager.h + def_use_manager.h + dominator_analysis.h + dominator_tree.h + eliminate_dead_constant_pass.h + eliminate_dead_functions_pass.h + feature_manager.h + flatten_decoration_pass.h + fold.h + folding_rules.h + fold_spec_constant_op_and_composite_pass.h + freeze_spec_constant_value_pass.h + function.h + if_conversion.h + inline_exhaustive_pass.h + inline_opaque_pass.h + inline_pass.h + insert_extract_elim.h + instruction.h + instruction_list.h + ir_builder.h + ir_context.h + ir_loader.h + licm_pass.h + local_access_chain_convert_pass.h + local_redundancy_elimination.h + local_single_block_elim_pass.h + local_single_store_elim_pass.h + local_ssa_elim_pass.h + log.h + loop_descriptor.h + loop_peeling.h + loop_unroller.h + loop_utils.h + loop_unswitch_pass.h + make_unique.h + mem_pass.h + merge_return_pass.h + module.h + null_pass.h + passes.h + pass.h + pass_manager.h + private_to_local_pass.h + propagator.h + redundancy_elimination.h + reflect.h + remove_duplicates_pass.h + replace_invalid_opc.h + scalar_analysis.h + scalar_analysis_nodes.h + scalar_replacement_pass.h + set_spec_constant_default_value_pass.h + simplification_pass.h + ssa_rewrite_pass.h + strength_reduction_pass.h + strip_debug_info_pass.h + strip_reflect_info_pass.h + tree_iterator.h + type_manager.h + types.h + unify_const_pass.h + value_number_table.h + workaround1209.h + + aggressive_dead_code_elim_pass.cpp + basic_block.cpp + block_merge_pass.cpp + build_module.cpp + ccp_pass.cpp + cfg_cleanup_pass.cpp + cfg.cpp + common_uniform_elim_pass.cpp + compact_ids_pass.cpp + composite.cpp + const_folding_rules.cpp + constants.cpp + copy_prop_arrays.cpp + dead_branch_elim_pass.cpp + dead_insert_elim_pass.cpp + dead_variable_elimination.cpp + decoration_manager.cpp + def_use_manager.cpp + dominator_analysis.cpp + dominator_tree.cpp + eliminate_dead_constant_pass.cpp + eliminate_dead_functions_pass.cpp + feature_manager.cpp + flatten_decoration_pass.cpp + fold.cpp + folding_rules.cpp + fold_spec_constant_op_and_composite_pass.cpp + freeze_spec_constant_value_pass.cpp + function.cpp + if_conversion.cpp + inline_exhaustive_pass.cpp + inline_opaque_pass.cpp + inline_pass.cpp + insert_extract_elim.cpp + instruction.cpp + instruction_list.cpp + ir_context.cpp + ir_loader.cpp + licm_pass.cpp + local_access_chain_convert_pass.cpp + local_redundancy_elimination.cpp + local_single_block_elim_pass.cpp + local_single_store_elim_pass.cpp + local_ssa_elim_pass.cpp + loop_descriptor.cpp + loop_peeling.cpp + loop_utils.cpp + loop_unroller.cpp + loop_unswitch_pass.cpp + mem_pass.cpp + merge_return_pass.cpp + module.cpp + optimizer.cpp + pass.cpp + pass_manager.cpp + private_to_local_pass.cpp + propagator.cpp + redundancy_elimination.cpp + remove_duplicates_pass.cpp + replace_invalid_opc.cpp + scalar_analysis.cpp + scalar_analysis_simplification.cpp + scalar_replacement_pass.cpp + set_spec_constant_default_value_pass.cpp + simplification_pass.cpp + ssa_rewrite_pass.cpp + strength_reduction_pass.cpp + strip_debug_info_pass.cpp + strip_reflect_info_pass.cpp + type_manager.cpp + types.cpp + unify_const_pass.cpp + value_number_table.cpp + workaround1209.cpp +) + +spvtools_default_compile_options(SPIRV-Tools-opt) +target_include_directories(SPIRV-Tools-opt + PUBLIC ${spirv-tools_SOURCE_DIR}/include + PUBLIC ${SPIRV_HEADER_INCLUDE_DIR} + PRIVATE ${spirv-tools_BINARY_DIR} +) +# We need the assembling and disassembling functionalities in the main library. +target_link_libraries(SPIRV-Tools-opt + PUBLIC ${SPIRV_TOOLS}) + +set_property(TARGET SPIRV-Tools-opt PROPERTY FOLDER "SPIRV-Tools libraries") +spvtools_check_symbol_exports(SPIRV-Tools-opt) + +if(ENABLE_SPIRV_TOOLS_INSTALL) + install(TARGETS SPIRV-Tools-opt + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif(ENABLE_SPIRV_TOOLS_INSTALL) + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/common_uniform_elim_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/common_uniform_elim_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/common_uniform_elim_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/common_uniform_elim_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,581 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "common_uniform_elim_pass.h" +#include "cfa.h" +#include "ir_context.h" + +namespace spvtools { +namespace opt { + +namespace { + +const uint32_t kAccessChainPtrIdInIdx = 0; +const uint32_t kTypePointerStorageClassInIdx = 0; +const uint32_t kTypePointerTypeIdInIdx = 1; +const uint32_t kConstantValueInIdx = 0; +const uint32_t kExtractCompositeIdInIdx = 0; +const uint32_t kExtractIdx0InIdx = 1; +const uint32_t kStorePtrIdInIdx = 0; +const uint32_t kLoadPtrIdInIdx = 0; +const uint32_t kCopyObjectOperandInIdx = 0; +const uint32_t kTypeIntWidthInIdx = 0; + +} // anonymous namespace + +bool CommonUniformElimPass::IsNonPtrAccessChain(const SpvOp opcode) const { + return opcode == SpvOpAccessChain || opcode == SpvOpInBoundsAccessChain; +} + +bool CommonUniformElimPass::IsSamplerOrImageType( + const ir::Instruction* typeInst) const { + switch (typeInst->opcode()) { + case SpvOpTypeSampler: + case SpvOpTypeImage: + case SpvOpTypeSampledImage: + return true; + default: + break; + } + if (typeInst->opcode() != SpvOpTypeStruct) return false; + // Return true if any member is a sampler or image + return !typeInst->WhileEachInId([this](const uint32_t* tid) { + const ir::Instruction* compTypeInst = get_def_use_mgr()->GetDef(*tid); + if (IsSamplerOrImageType(compTypeInst)) { + return false; + } + return true; + }); +} + +bool CommonUniformElimPass::IsSamplerOrImageVar(uint32_t varId) const { + const ir::Instruction* varInst = get_def_use_mgr()->GetDef(varId); + assert(varInst->opcode() == SpvOpVariable); + const uint32_t varTypeId = varInst->type_id(); + const ir::Instruction* varTypeInst = get_def_use_mgr()->GetDef(varTypeId); + const uint32_t varPteTypeId = + varTypeInst->GetSingleWordInOperand(kTypePointerTypeIdInIdx); + ir::Instruction* varPteTypeInst = get_def_use_mgr()->GetDef(varPteTypeId); + return IsSamplerOrImageType(varPteTypeInst); +} + +ir::Instruction* CommonUniformElimPass::GetPtr(ir::Instruction* ip, + uint32_t* objId) { + const SpvOp op = ip->opcode(); + assert(op == SpvOpStore || op == SpvOpLoad); + *objId = ip->GetSingleWordInOperand(op == SpvOpStore ? kStorePtrIdInIdx + : kLoadPtrIdInIdx); + ir::Instruction* ptrInst = get_def_use_mgr()->GetDef(*objId); + while (ptrInst->opcode() == SpvOpCopyObject) { + *objId = ptrInst->GetSingleWordInOperand(kCopyObjectOperandInIdx); + ptrInst = get_def_use_mgr()->GetDef(*objId); + } + ir::Instruction* objInst = ptrInst; + while (objInst->opcode() != SpvOpVariable && + objInst->opcode() != SpvOpFunctionParameter) { + if (IsNonPtrAccessChain(objInst->opcode())) { + *objId = objInst->GetSingleWordInOperand(kAccessChainPtrIdInIdx); + } else { + assert(objInst->opcode() == SpvOpCopyObject); + *objId = objInst->GetSingleWordInOperand(kCopyObjectOperandInIdx); + } + objInst = get_def_use_mgr()->GetDef(*objId); + } + return ptrInst; +} + +bool CommonUniformElimPass::IsVolatileStruct(uint32_t type_id) { + assert(get_def_use_mgr()->GetDef(type_id)->opcode() == SpvOpTypeStruct); + return !get_decoration_mgr()->WhileEachDecoration( + type_id, SpvDecorationVolatile, + [](const ir::Instruction&) { return false; }); +} + +bool CommonUniformElimPass::IsAccessChainToVolatileStructType( + const ir::Instruction& AccessChainInst) { + assert(AccessChainInst.opcode() == SpvOpAccessChain); + + uint32_t ptr_id = AccessChainInst.GetSingleWordInOperand(0); + const ir::Instruction* ptr_inst = get_def_use_mgr()->GetDef(ptr_id); + uint32_t pointee_type_id = GetPointeeTypeId(ptr_inst); + const uint32_t num_operands = AccessChainInst.NumOperands(); + + // walk the type tree: + for (uint32_t idx = 3; idx < num_operands; ++idx) { + ir::Instruction* pointee_type = get_def_use_mgr()->GetDef(pointee_type_id); + + switch (pointee_type->opcode()) { + case SpvOpTypeMatrix: + case SpvOpTypeVector: + case SpvOpTypeArray: + case SpvOpTypeRuntimeArray: + pointee_type_id = pointee_type->GetSingleWordOperand(1); + break; + case SpvOpTypeStruct: + // check for volatile decorations: + if (IsVolatileStruct(pointee_type_id)) return true; + + if (idx < num_operands - 1) { + const uint32_t index_id = AccessChainInst.GetSingleWordOperand(idx); + const ir::Instruction* index_inst = + get_def_use_mgr()->GetDef(index_id); + uint32_t index_value = index_inst->GetSingleWordOperand( + 2); // TODO: replace with GetUintValueFromConstant() + pointee_type_id = pointee_type->GetSingleWordInOperand(index_value); + } + break; + default: + assert(false && "Unhandled pointee type."); + } + } + return false; +} + +bool CommonUniformElimPass::IsVolatileLoad(const ir::Instruction& loadInst) { + assert(loadInst.opcode() == SpvOpLoad); + // Check if this Load instruction has Volatile Memory Access flag + if (loadInst.NumOperands() == 4) { + uint32_t memory_access_mask = loadInst.GetSingleWordOperand(3); + if (memory_access_mask & SpvMemoryAccessVolatileMask) return true; + } + // If we load a struct directly (result type is struct), + // check if the struct is decorated volatile + uint32_t type_id = loadInst.type_id(); + if (get_def_use_mgr()->GetDef(type_id)->opcode() == SpvOpTypeStruct) + return IsVolatileStruct(type_id); + else + return false; +} + +bool CommonUniformElimPass::IsUniformVar(uint32_t varId) { + const ir::Instruction* varInst = + get_def_use_mgr()->id_to_defs().find(varId)->second; + if (varInst->opcode() != SpvOpVariable) return false; + const uint32_t varTypeId = varInst->type_id(); + const ir::Instruction* varTypeInst = + get_def_use_mgr()->id_to_defs().find(varTypeId)->second; + return varTypeInst->GetSingleWordInOperand(kTypePointerStorageClassInIdx) == + SpvStorageClassUniform || + varTypeInst->GetSingleWordInOperand(kTypePointerStorageClassInIdx) == + SpvStorageClassUniformConstant; +} + +bool CommonUniformElimPass::HasUnsupportedDecorates(uint32_t id) const { + return !get_def_use_mgr()->WhileEachUser(id, [this](ir::Instruction* user) { + if (IsNonTypeDecorate(user->opcode())) return false; + return true; + }); +} + +bool CommonUniformElimPass::HasOnlyNamesAndDecorates(uint32_t id) const { + return get_def_use_mgr()->WhileEachUser(id, [this](ir::Instruction* user) { + SpvOp op = user->opcode(); + if (op != SpvOpName && !IsNonTypeDecorate(op)) return false; + return true; + }); +} + +void CommonUniformElimPass::DeleteIfUseless(ir::Instruction* inst) { + const uint32_t resId = inst->result_id(); + assert(resId != 0); + if (HasOnlyNamesAndDecorates(resId)) { + context()->KillInst(inst); + } +} + +ir::Instruction* CommonUniformElimPass::ReplaceAndDeleteLoad( + ir::Instruction* loadInst, uint32_t replId, ir::Instruction* ptrInst) { + const uint32_t loadId = loadInst->result_id(); + context()->KillNamesAndDecorates(loadId); + (void)context()->ReplaceAllUsesWith(loadId, replId); + // remove load instruction + ir::Instruction* next_instruction = context()->KillInst(loadInst); + // if access chain, see if it can be removed as well + if (IsNonPtrAccessChain(ptrInst->opcode())) DeleteIfUseless(ptrInst); + return next_instruction; +} + +void CommonUniformElimPass::GenACLoadRepl( + const ir::Instruction* ptrInst, + std::vector>* newInsts, + uint32_t* resultId) { + // Build and append Load + const uint32_t ldResultId = TakeNextId(); + const uint32_t varId = + ptrInst->GetSingleWordInOperand(kAccessChainPtrIdInIdx); + const ir::Instruction* varInst = get_def_use_mgr()->GetDef(varId); + assert(varInst->opcode() == SpvOpVariable); + const uint32_t varPteTypeId = GetPointeeTypeId(varInst); + std::vector load_in_operands; + load_in_operands.push_back( + ir::Operand(spv_operand_type_t::SPV_OPERAND_TYPE_ID, + std::initializer_list{varId})); + std::unique_ptr newLoad(new ir::Instruction( + context(), SpvOpLoad, varPteTypeId, ldResultId, load_in_operands)); + get_def_use_mgr()->AnalyzeInstDefUse(&*newLoad); + newInsts->emplace_back(std::move(newLoad)); + + // Build and append Extract + const uint32_t extResultId = TakeNextId(); + const uint32_t ptrPteTypeId = GetPointeeTypeId(ptrInst); + std::vector ext_in_opnds; + ext_in_opnds.push_back( + ir::Operand(spv_operand_type_t::SPV_OPERAND_TYPE_ID, + std::initializer_list{ldResultId})); + uint32_t iidIdx = 0; + ptrInst->ForEachInId([&iidIdx, &ext_in_opnds, this](const uint32_t* iid) { + if (iidIdx > 0) { + const ir::Instruction* cInst = get_def_use_mgr()->GetDef(*iid); + uint32_t val = cInst->GetSingleWordInOperand(kConstantValueInIdx); + ext_in_opnds.push_back( + ir::Operand(spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, + std::initializer_list{val})); + } + ++iidIdx; + }); + std::unique_ptr newExt( + new ir::Instruction(context(), SpvOpCompositeExtract, ptrPteTypeId, + extResultId, ext_in_opnds)); + get_def_use_mgr()->AnalyzeInstDefUse(&*newExt); + newInsts->emplace_back(std::move(newExt)); + *resultId = extResultId; +} + +bool CommonUniformElimPass::IsConstantIndexAccessChain(ir::Instruction* acp) { + uint32_t inIdx = 0; + return acp->WhileEachInId([&inIdx, this](uint32_t* tid) { + if (inIdx > 0) { + ir::Instruction* opInst = get_def_use_mgr()->GetDef(*tid); + if (opInst->opcode() != SpvOpConstant) return false; + } + ++inIdx; + return true; + }); +} + +bool CommonUniformElimPass::UniformAccessChainConvert(ir::Function* func) { + bool modified = false; + for (auto bi = func->begin(); bi != func->end(); ++bi) { + for (ir::Instruction* inst = &*bi->begin(); inst; inst = inst->NextNode()) { + if (inst->opcode() != SpvOpLoad) continue; + uint32_t varId; + ir::Instruction* ptrInst = GetPtr(inst, &varId); + if (!IsNonPtrAccessChain(ptrInst->opcode())) continue; + // Do not convert nested access chains + if (ptrInst->GetSingleWordInOperand(kAccessChainPtrIdInIdx) != varId) + continue; + if (!IsUniformVar(varId)) continue; + if (!IsConstantIndexAccessChain(ptrInst)) continue; + if (HasUnsupportedDecorates(inst->result_id())) continue; + if (HasUnsupportedDecorates(ptrInst->result_id())) continue; + if (IsVolatileLoad(*inst)) continue; + if (IsAccessChainToVolatileStructType(*ptrInst)) continue; + std::vector> newInsts; + uint32_t replId; + GenACLoadRepl(ptrInst, &newInsts, &replId); + inst = ReplaceAndDeleteLoad(inst, replId, ptrInst); + inst = inst->InsertBefore(std::move(newInsts)); + modified = true; + }; + } + return modified; +} + +void CommonUniformElimPass::ComputeStructuredSuccessors(ir::Function* func) { + block2structured_succs_.clear(); + for (auto& blk : *func) { + // If header, make merge block first successor. + uint32_t mbid = blk.MergeBlockIdIfAny(); + if (mbid != 0) { + block2structured_succs_[&blk].push_back(cfg()->block(mbid)); + uint32_t cbid = blk.ContinueBlockIdIfAny(); + if (cbid != 0) { + block2structured_succs_[&blk].push_back(cfg()->block(mbid)); + } + } + // add true successors + const auto& const_blk = blk; + const_blk.ForEachSuccessorLabel([&blk, this](const uint32_t sbid) { + block2structured_succs_[&blk].push_back(cfg()->block(sbid)); + }); + } +} + +void CommonUniformElimPass::ComputeStructuredOrder( + ir::Function* func, std::list* order) { + // Compute structured successors and do DFS + ComputeStructuredSuccessors(func); + auto ignore_block = [](cbb_ptr) {}; + auto ignore_edge = [](cbb_ptr, cbb_ptr) {}; + auto get_structured_successors = [this](const ir::BasicBlock* block) { + return &(block2structured_succs_[block]); + }; + // TODO(greg-lunarg): Get rid of const_cast by making moving const + // out of the cfa.h prototypes and into the invoking code. + auto post_order = [&](cbb_ptr b) { + order->push_front(const_cast(b)); + }; + + order->clear(); + spvtools::CFA::DepthFirstTraversal( + &*func->begin(), get_structured_successors, ignore_block, post_order, + ignore_edge); +} + +bool CommonUniformElimPass::CommonUniformLoadElimination(ir::Function* func) { + // Process all blocks in structured order. This is just one way (the + // simplest?) to keep track of the most recent block outside of control + // flow, used to copy common instructions, guaranteed to dominate all + // following load sites. + std::list structuredOrder; + ComputeStructuredOrder(func, &structuredOrder); + uniform2load_id_.clear(); + bool modified = false; + // Find insertion point in first block to copy non-dominating loads. + auto insertItr = func->begin()->begin(); + while (insertItr->opcode() == SpvOpVariable || + insertItr->opcode() == SpvOpNop) + ++insertItr; + uint32_t mergeBlockId = 0; + for (auto bi = structuredOrder.begin(); bi != structuredOrder.end(); ++bi) { + ir::BasicBlock* bp = *bi; + // Check if we are exiting outermost control construct. If so, remember + // new load insertion point. Trying to keep register pressure down. + if (mergeBlockId == bp->id()) { + mergeBlockId = 0; + insertItr = bp->begin(); + } + for (ir::Instruction* inst = &*bp->begin(); inst; inst = inst->NextNode()) { + if (inst->opcode() != SpvOpLoad) continue; + uint32_t varId; + ir::Instruction* ptrInst = GetPtr(inst, &varId); + if (ptrInst->opcode() != SpvOpVariable) continue; + if (!IsUniformVar(varId)) continue; + if (IsSamplerOrImageVar(varId)) continue; + if (HasUnsupportedDecorates(inst->result_id())) continue; + if (IsVolatileLoad(*inst)) continue; + uint32_t replId; + const auto uItr = uniform2load_id_.find(varId); + if (uItr != uniform2load_id_.end()) { + replId = uItr->second; + } else { + if (mergeBlockId == 0) { + // Load is in dominating block; just remember it + uniform2load_id_[varId] = inst->result_id(); + continue; + } else { + // Copy load into most recent dominating block and remember it + replId = TakeNextId(); + std::unique_ptr newLoad(new ir::Instruction( + context(), SpvOpLoad, inst->type_id(), replId, + {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {varId}}})); + get_def_use_mgr()->AnalyzeInstDefUse(&*newLoad); + insertItr = insertItr.InsertBefore(std::move(newLoad)); + ++insertItr; + uniform2load_id_[varId] = replId; + } + } + inst = ReplaceAndDeleteLoad(inst, replId, ptrInst); + modified = true; + } + // If we are outside of any control construct and entering one, remember + // the id of the merge block + if (mergeBlockId == 0) { + mergeBlockId = bp->MergeBlockIdIfAny(); + } + } + return modified; +} + +bool CommonUniformElimPass::CommonUniformLoadElimBlock(ir::Function* func) { + bool modified = false; + for (auto& blk : *func) { + uniform2load_id_.clear(); + for (ir::Instruction* inst = &*blk.begin(); inst; inst = inst->NextNode()) { + if (inst->opcode() != SpvOpLoad) continue; + uint32_t varId; + ir::Instruction* ptrInst = GetPtr(inst, &varId); + if (ptrInst->opcode() != SpvOpVariable) continue; + if (!IsUniformVar(varId)) continue; + if (!IsSamplerOrImageVar(varId)) continue; + if (HasUnsupportedDecorates(inst->result_id())) continue; + if (IsVolatileLoad(*inst)) continue; + uint32_t replId; + const auto uItr = uniform2load_id_.find(varId); + if (uItr != uniform2load_id_.end()) { + replId = uItr->second; + } else { + uniform2load_id_[varId] = inst->result_id(); + continue; + } + inst = ReplaceAndDeleteLoad(inst, replId, ptrInst); + modified = true; + } + } + return modified; +} + +bool CommonUniformElimPass::CommonExtractElimination(ir::Function* func) { + // Find all composite ids with duplicate extracts. + for (auto bi = func->begin(); bi != func->end(); ++bi) { + for (auto ii = bi->begin(); ii != bi->end(); ++ii) { + if (ii->opcode() != SpvOpCompositeExtract) continue; + // TODO(greg-lunarg): Support multiple indices + if (ii->NumInOperands() > 2) continue; + if (HasUnsupportedDecorates(ii->result_id())) continue; + uint32_t compId = ii->GetSingleWordInOperand(kExtractCompositeIdInIdx); + uint32_t idx = ii->GetSingleWordInOperand(kExtractIdx0InIdx); + comp2idx2inst_[compId][idx].push_back(&*ii); + } + } + // For all defs of ids with duplicate extracts, insert new extracts + // after def, and replace and delete old extracts + bool modified = false; + for (auto bi = func->begin(); bi != func->end(); ++bi) { + for (auto ii = bi->begin(); ii != bi->end(); ++ii) { + const auto cItr = comp2idx2inst_.find(ii->result_id()); + if (cItr == comp2idx2inst_.end()) continue; + for (auto idxItr : cItr->second) { + if (idxItr.second.size() < 2) continue; + uint32_t replId = TakeNextId(); + std::unique_ptr newExtract( + idxItr.second.front()->Clone(context())); + newExtract->SetResultId(replId); + get_def_use_mgr()->AnalyzeInstDefUse(&*newExtract); + ++ii; + ii = ii.InsertBefore(std::move(newExtract)); + for (auto instItr : idxItr.second) { + uint32_t resId = instItr->result_id(); + context()->KillNamesAndDecorates(resId); + (void)context()->ReplaceAllUsesWith(resId, replId); + context()->KillInst(instItr); + } + modified = true; + } + } + } + return modified; +} + +bool CommonUniformElimPass::EliminateCommonUniform(ir::Function* func) { + bool modified = false; + modified |= UniformAccessChainConvert(func); + modified |= CommonUniformLoadElimination(func); + modified |= CommonExtractElimination(func); + + modified |= CommonUniformLoadElimBlock(func); + return modified; +} + +void CommonUniformElimPass::Initialize(ir::IRContext* c) { + InitializeProcessing(c); + + // Clear collections. + comp2idx2inst_.clear(); + + // Initialize extension whitelist + InitExtensions(); +} + +bool CommonUniformElimPass::AllExtensionsSupported() const { + // If any extension not in whitelist, return false + for (auto& ei : get_module()->extensions()) { + const char* extName = + reinterpret_cast(&ei.GetInOperand(0).words[0]); + if (extensions_whitelist_.find(extName) == extensions_whitelist_.end()) + return false; + } + return true; +} + +Pass::Status CommonUniformElimPass::ProcessImpl() { + // Assumes all control flow structured. + // TODO(greg-lunarg): Do SSA rewrite for non-structured control flow + if (!context()->get_feature_mgr()->HasCapability(SpvCapabilityShader)) + return Status::SuccessWithoutChange; + // Assumes logical addressing only + // TODO(greg-lunarg): Add support for physical addressing + if (context()->get_feature_mgr()->HasCapability(SpvCapabilityAddresses)) + return Status::SuccessWithoutChange; + // Do not process if any disallowed extensions are enabled + if (!AllExtensionsSupported()) return Status::SuccessWithoutChange; + // Do not process if module contains OpGroupDecorate. Additional + // support required in KillNamesAndDecorates(). + // TODO(greg-lunarg): Add support for OpGroupDecorate + for (auto& ai : get_module()->annotations()) + if (ai.opcode() == SpvOpGroupDecorate) return Status::SuccessWithoutChange; + // If non-32-bit integer type in module, terminate processing + // TODO(): Handle non-32-bit integer constants in access chains + for (const ir::Instruction& inst : get_module()->types_values()) + if (inst.opcode() == SpvOpTypeInt && + inst.GetSingleWordInOperand(kTypeIntWidthInIdx) != 32) + return Status::SuccessWithoutChange; + // Process entry point functions + ProcessFunction pfn = [this](ir::Function* fp) { + return EliminateCommonUniform(fp); + }; + bool modified = ProcessEntryPointCallTree(pfn, get_module()); + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +CommonUniformElimPass::CommonUniformElimPass() {} + +Pass::Status CommonUniformElimPass::Process(ir::IRContext* c) { + Initialize(c); + return ProcessImpl(); +} + +void CommonUniformElimPass::InitExtensions() { + extensions_whitelist_.clear(); + extensions_whitelist_.insert({ + "SPV_AMD_shader_explicit_vertex_parameter", + "SPV_AMD_shader_trinary_minmax", + "SPV_AMD_gcn_shader", + "SPV_KHR_shader_ballot", + "SPV_AMD_shader_ballot", + "SPV_AMD_gpu_shader_half_float", + "SPV_KHR_shader_draw_parameters", + "SPV_KHR_subgroup_vote", + "SPV_KHR_16bit_storage", + "SPV_KHR_device_group", + "SPV_KHR_multiview", + "SPV_NVX_multiview_per_view_attributes", + "SPV_NV_viewport_array2", + "SPV_NV_stereo_view_rendering", + "SPV_NV_sample_mask_override_coverage", + "SPV_NV_geometry_shader_passthrough", + "SPV_AMD_texture_gather_bias_lod", + "SPV_KHR_storage_buffer_storage_class", + // SPV_KHR_variable_pointers + // Currently do not support extended pointer expressions + "SPV_AMD_gpu_shader_int16", + "SPV_KHR_post_depth_coverage", + "SPV_KHR_shader_atomic_counter_ops", + "SPV_EXT_shader_stencil_export", + "SPV_EXT_shader_viewport_index_layer", + "SPV_AMD_shader_image_load_store_lod", + "SPV_AMD_shader_fragment_mask", + "SPV_EXT_fragment_fully_covered", + "SPV_AMD_gpu_shader_half_float_fetch", + "SPV_GOOGLE_decorate_string", + "SPV_GOOGLE_hlsl_functionality1", + "SPV_NV_shader_subgroup_partitioned", + "SPV_EXT_descriptor_indexing", + }); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/common_uniform_elim_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/common_uniform_elim_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/common_uniform_elim_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/common_uniform_elim_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,197 @@ +// Copyright (c) 2016 The Khronos Group Inc. +// Copyright (c) 2016 Valve Corporation +// Copyright (c) 2016 LunarG Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_COMMON_UNIFORM_ELIM_PASS_H_ +#define LIBSPIRV_OPT_COMMON_UNIFORM_ELIM_PASS_H_ + +#include +#include +#include +#include +#include +#include + +#include "basic_block.h" +#include "decoration_manager.h" +#include "def_use_manager.h" +#include "ir_context.h" +#include "module.h" +#include "pass.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class CommonUniformElimPass : public Pass { + using cbb_ptr = const ir::BasicBlock*; + + public: + using GetBlocksFunction = + std::function*(const ir::BasicBlock*)>; + + CommonUniformElimPass(); + const char* name() const override { return "eliminate-common-uniform"; } + Status Process(ir::IRContext*) override; + + private: + // Returns true if |opcode| is a non-ptr access chain op + bool IsNonPtrAccessChain(const SpvOp opcode) const; + + // Returns true if |typeInst| is a sampler or image type or a struct + // containing one, recursively. + bool IsSamplerOrImageType(const ir::Instruction* typeInst) const; + + // Returns true if |varId| is a variable containing a sampler or image. + bool IsSamplerOrImageVar(uint32_t varId) const; + + // Given a load or store pointed at by |ip|, return the top-most + // non-CopyObj in its pointer operand. Also return the base pointer + // in |objId|. + ir::Instruction* GetPtr(ir::Instruction* ip, uint32_t* objId); + + // Return true if variable is uniform + bool IsUniformVar(uint32_t varId); + + // Given the type id for a struct type, checks if the struct type + // or any struct member is volatile decorated + bool IsVolatileStruct(uint32_t type_id); + + // Given an OpAccessChain instruction, return true + // if the accessed variable belongs to a volatile + // decorated object or member of a struct type + bool IsAccessChainToVolatileStructType( + const ir::Instruction& AccessChainInst); + + // Given an OpLoad instruction, return true if + // OpLoad has a Volatile Memory Access flag or if + // the resulting type is a volatile decorated struct + bool IsVolatileLoad(const ir::Instruction& loadInst); + + // Return true if any uses of |id| are decorate ops. + bool HasUnsupportedDecorates(uint32_t id) const; + + // Return true if all uses of |id| are only name or decorate ops. + bool HasOnlyNamesAndDecorates(uint32_t id) const; + + // Delete inst if it has no uses. Assumes inst has a resultId. + void DeleteIfUseless(ir::Instruction* inst); + + // Replace all instances of load's id with replId and delete load + // and its access chain, if any + ir::Instruction* ReplaceAndDeleteLoad(ir::Instruction* loadInst, + uint32_t replId, + ir::Instruction* ptrInst); + + // For the (constant index) access chain ptrInst, create an + // equivalent load and extract + void GenACLoadRepl(const ir::Instruction* ptrInst, + std::vector>* newInsts, + uint32_t* resultId); + + // Return true if all indices are constant + bool IsConstantIndexAccessChain(ir::Instruction* acp); + + // Convert all uniform access chain loads into load/extract. + bool UniformAccessChainConvert(ir::Function* func); + + // Compute structured successors for function |func|. + // A block's structured successors are the blocks it branches to + // together with its declared merge block if it has one. + // When order matters, the merge block always appears first. + // This assures correct depth first search in the presence of early + // returns and kills. If the successor vector contain duplicates + // if the merge block, they are safely ignored by DFS. + // + // TODO(dnovillo): This pass computes structured successors slightly different + // than the implementation in class Pass. Can this be re-factored? + void ComputeStructuredSuccessors(ir::Function* func); + + // Compute structured block order for |func| into |structuredOrder|. This + // order has the property that dominators come before all blocks they + // dominate and merge blocks come after all blocks that are in the control + // constructs of their header. + // + // TODO(dnovillo): This pass computes structured order slightly different + // than the implementation in class Pass. Can this be re-factored? + void ComputeStructuredOrder(ir::Function* func, + std::list* order); + + // Eliminate loads of uniform variables which have previously been loaded. + // If first load is in control flow, move it to first block of function. + // Most effective if preceded by UniformAccessChainRemoval(). + bool CommonUniformLoadElimination(ir::Function* func); + + // Eliminate loads of uniform sampler and image variables which have + // previously + // been loaded in the same block for types whose loads cannot cross blocks. + bool CommonUniformLoadElimBlock(ir::Function* func); + + // Eliminate duplicated extracts of same id. Extract may be moved to same + // block as the id definition. This is primarily intended for extracts + // from uniform loads. Most effective if preceded by + // CommonUniformLoadElimination(). + bool CommonExtractElimination(ir::Function* func); + + // For function |func|, first change all uniform constant index + // access chain loads into equivalent composite extracts. Then consolidate + // identical uniform loads into one uniform load. Finally, consolidate + // identical uniform extracts into one uniform extract. This may require + // moving a load or extract to a point which dominates all uses. + // Return true if func is modified. + // + // This pass requires the function to have structured control flow ie shader + // capability. It also requires logical addressing ie Addresses capability + // is not enabled. It also currently does not support any extensions. + // + // This function currently only optimizes loads with a single index. + bool EliminateCommonUniform(ir::Function* func); + + // Initialize extensions whitelist + void InitExtensions(); + + // Return true if all extensions in this module are allowed by this pass. + bool AllExtensionsSupported() const; + + // Return true if |op| is a decorate for non-type instruction + inline bool IsNonTypeDecorate(uint32_t op) const { + return (op == SpvOpDecorate || op == SpvOpDecorateId); + } + + void Initialize(ir::IRContext* c); + Pass::Status ProcessImpl(); + + // Map from uniform variable id to its common load id + std::unordered_map uniform2load_id_; + + // Map of extract composite ids to map of indices to insts + // TODO(greg-lunarg): Consider std::vector. + std::unordered_map>> + comp2idx2inst_; + + // Extensions supported by this pass. + std::unordered_set extensions_whitelist_; + + // Map from block to its structured successor blocks. See + // ComputeStructuredSuccessors() for definition. + std::unordered_map> + block2structured_succs_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_SSAMEM_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/compact_ids_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/compact_ids_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/compact_ids_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/compact_ids_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,74 @@ +// Copyright (c) 2017 Google 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. + +#include "compact_ids_pass.h" +#include "ir_context.h" + +#include +#include + +namespace spvtools { +namespace opt { + +using ir::Instruction; +using ir::Operand; + +Pass::Status CompactIdsPass::Process(ir::IRContext* c) { + InitializeProcessing(c); + + bool modified = false; + std::unordered_map result_id_mapping; + + c->module()->ForEachInst( + [&result_id_mapping, &modified](Instruction* inst) { + auto operand = inst->begin(); + while (operand != inst->end()) { + const auto type = operand->type; + if (spvIsIdType(type)) { + assert(operand->words.size() == 1); + uint32_t& id = operand->words[0]; + auto it = result_id_mapping.find(id); + if (it == result_id_mapping.end()) { + const uint32_t new_id = + static_cast(result_id_mapping.size()) + 1; + const auto insertion_result = + result_id_mapping.emplace(id, new_id); + it = insertion_result.first; + assert(insertion_result.second); + } + if (id != it->second) { + modified = true; + id = it->second; + // Update data cached in the instruction object. + if (type == SPV_OPERAND_TYPE_RESULT_ID) { + inst->SetResultId(id); + } else if (type == SPV_OPERAND_TYPE_TYPE_ID) { + inst->SetResultType(id); + } + } + } + ++operand; + } + }, + true); + + if (modified) + c->module()->SetIdBound( + static_cast(result_id_mapping.size() + 1)); + + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/compact_ids_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/compact_ids_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/compact_ids_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/compact_ids_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,35 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_COMPACT_IDS_PASS_H_ +#define LIBSPIRV_OPT_COMPACT_IDS_PASS_H_ + +#include "ir_context.h" +#include "module.h" +#include "pass.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class CompactIdsPass : public Pass { + public: + const char* name() const override { return "compact-ids"; } + Status Process(ir::IRContext*) override; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_COMPACT_IDS_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/composite.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/composite.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/composite.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/composite.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,52 @@ +// Copyright (c) 2018 The Khronos Group Inc. +// Copyright (c) 2018 Valve Corporation +// Copyright (c) 2018 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. + +#include "composite.h" + +#include "ir_context.h" +#include "iterator.h" +#include "spirv/1.2/GLSL.std.450.h" + +#include + +namespace spvtools { +namespace opt { + +bool ExtInsMatch(const std::vector& extIndices, + const ir::Instruction* insInst, const uint32_t extOffset) { + uint32_t numIndices = static_cast(extIndices.size()) - extOffset; + if (numIndices != insInst->NumInOperands() - 2) return false; + for (uint32_t i = 0; i < numIndices; ++i) + if (extIndices[i + extOffset] != insInst->GetSingleWordInOperand(i + 2)) + return false; + return true; +} + +bool ExtInsConflict(const std::vector& extIndices, + const ir::Instruction* insInst, const uint32_t extOffset) { + if (extIndices.size() - extOffset == insInst->NumInOperands() - 2) + return false; + uint32_t extNumIndices = static_cast(extIndices.size()) - extOffset; + uint32_t insNumIndices = insInst->NumInOperands() - 2; + uint32_t numIndices = std::min(extNumIndices, insNumIndices); + for (uint32_t i = 0; i < numIndices; ++i) + if (extIndices[i + extOffset] != insInst->GetSingleWordInOperand(i + 2)) + return false; + return true; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/composite.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/composite.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/composite.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/composite.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,50 @@ +// Copyright (c) 2018 The Khronos Group Inc. +// Copyright (c) 2018 Valve Corporation +// Copyright (c) 2018 LunarG Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_UTIL_COMPOSITE_PASS_H_ +#define LIBSPIRV_UTIL_COMPOSITE_PASS_H_ + +#include +#include +#include +#include +#include + +#include "basic_block.h" +#include "def_use_manager.h" +#include "ir_context.h" +#include "module.h" + +namespace spvtools { +namespace opt { + +// Return true if the extract indices in |extIndices| starting at |extOffset| +// match indices of insert |insInst|. +bool ExtInsMatch(const std::vector& extIndices, + const ir::Instruction* insInst, const uint32_t extOffset); + +// Return true if indices in |extIndices| starting at |extOffset| and +// indices of insert |insInst| conflict, specifically, if the insert +// changes bits specified by the extract, but changes either more bits +// or less bits than the extract specifies, meaning the exact value being +// inserted cannot be used to replace the extract. +bool ExtInsConflict(const std::vector& extIndices, + const ir::Instruction* insInst, const uint32_t extOffset); + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_UTIL_COMPOSITE_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/constants.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/constants.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/constants.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/constants.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,311 @@ +// Copyright (c) 2017 Google 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. + +#include "constants.h" +#include "ir_context.h" + +#include +#include + +namespace spvtools { +namespace opt { +namespace analysis { + +float Constant::GetFloat() const { + assert(type()->AsFloat() != nullptr && type()->AsFloat()->width() == 32); + + if (const FloatConstant* fc = AsFloatConstant()) { + return fc->GetFloatValue(); + } else { + assert(AsNullConstant() && "Must be a floating point constant."); + return 0.0f; + } +} + +double Constant::GetDouble() const { + assert(type()->AsFloat() != nullptr && type()->AsFloat()->width() == 64); + + if (const FloatConstant* fc = AsFloatConstant()) { + return fc->GetDoubleValue(); + } else { + assert(AsNullConstant() && "Must be a floating point constant."); + return 0.0; + } +} + +uint32_t Constant::GetU32() const { + assert(type()->AsInteger() != nullptr); + assert(type()->AsInteger()->width() == 32); + + if (const IntConstant* ic = AsIntConstant()) { + return ic->GetU32BitValue(); + } else { + assert(AsNullConstant() && "Must be an integer constant."); + return 0u; + } +} + +uint64_t Constant::GetU64() const { + assert(type()->AsInteger() != nullptr); + assert(type()->AsInteger()->width() == 64); + + if (const IntConstant* ic = AsIntConstant()) { + return ic->GetU64BitValue(); + } else { + assert(AsNullConstant() && "Must be an integer constant."); + return 0u; + } +} + +int32_t Constant::GetS32() const { + assert(type()->AsInteger() != nullptr); + assert(type()->AsInteger()->width() == 32); + + if (const IntConstant* ic = AsIntConstant()) { + return ic->GetS32BitValue(); + } else { + assert(AsNullConstant() && "Must be an integer constant."); + return 0; + } +} + +int64_t Constant::GetS64() const { + assert(type()->AsInteger() != nullptr); + assert(type()->AsInteger()->width() == 64); + + if (const IntConstant* ic = AsIntConstant()) { + return ic->GetS64BitValue(); + } else { + assert(AsNullConstant() && "Must be an integer constant."); + return 0; + } +} + +ConstantManager::ConstantManager(ir::IRContext* ctx) : ctx_(ctx) { + // Populate the constant table with values from constant declarations in the + // module. The values of each OpConstant declaration is the identity + // assignment (i.e., each constant is its own value). + for (const auto& inst : ctx_->module()->GetConstants()) { + MapInst(inst); + } +} + +Type* ConstantManager::GetType(const ir::Instruction* inst) const { + return context()->get_type_mgr()->GetType(inst->type_id()); +} + +std::vector ConstantManager::GetOperandConstants( + ir::Instruction* inst) const { + std::vector constants; + for (uint32_t i = 0; i < inst->NumInOperands(); i++) { + const ir::Operand* operand = &inst->GetInOperand(i); + if (operand->type != SPV_OPERAND_TYPE_ID) { + constants.push_back(nullptr); + } else { + uint32_t id = operand->words[0]; + const analysis::Constant* constant = FindDeclaredConstant(id); + constants.push_back(constant); + } + } + return constants; +} + +std::vector ConstantManager::GetConstantsFromIds( + const std::vector& ids) const { + std::vector constants; + for (uint32_t id : ids) { + if (const Constant* c = FindDeclaredConstant(id)) { + constants.push_back(c); + } else { + return {}; + } + } + return constants; +} + +ir::Instruction* ConstantManager::BuildInstructionAndAddToModule( + const Constant* new_const, ir::Module::inst_iterator* pos, + uint32_t type_id) { + uint32_t new_id = context()->TakeNextId(); + auto new_inst = CreateInstruction(new_id, new_const, type_id); + if (!new_inst) { + return nullptr; + } + auto* new_inst_ptr = new_inst.get(); + *pos = pos->InsertBefore(std::move(new_inst)); + ++(*pos); + context()->get_def_use_mgr()->AnalyzeInstDefUse(new_inst_ptr); + MapConstantToInst(new_const, new_inst_ptr); + return new_inst_ptr; +} + +ir::Instruction* ConstantManager::GetDefiningInstruction( + const Constant* c, ir::Module::inst_iterator* pos) { + uint32_t decl_id = FindDeclaredConstant(c); + if (decl_id == 0) { + auto iter = context()->types_values_end(); + if (pos == nullptr) pos = &iter; + return BuildInstructionAndAddToModule(c, pos); + } else { + auto def = context()->get_def_use_mgr()->GetDef(decl_id); + assert(def != nullptr); + return def; + } +} + +const Constant* ConstantManager::CreateConstant( + const Type* type, const std::vector& literal_words_or_ids) const { + if (literal_words_or_ids.size() == 0) { + // Constant declared with OpConstantNull + return new NullConstant(type); + } else if (auto* bt = type->AsBool()) { + assert(literal_words_or_ids.size() == 1 && + "Bool constant should be declared with one operand"); + return new BoolConstant(bt, literal_words_or_ids.front()); + } else if (auto* it = type->AsInteger()) { + return new IntConstant(it, literal_words_or_ids); + } else if (auto* ft = type->AsFloat()) { + return new FloatConstant(ft, literal_words_or_ids); + } else if (auto* vt = type->AsVector()) { + auto components = GetConstantsFromIds(literal_words_or_ids); + if (components.empty()) return nullptr; + // All components of VectorConstant must be of type Bool, Integer or Float. + if (!std::all_of(components.begin(), components.end(), + [](const Constant* c) { + if (c->type()->AsBool() || c->type()->AsInteger() || + c->type()->AsFloat()) { + return true; + } else { + return false; + } + })) + return nullptr; + // All components of VectorConstant must be in the same type. + const auto* component_type = components.front()->type(); + if (!std::all_of(components.begin(), components.end(), + [&component_type](const Constant* c) { + if (c->type() == component_type) return true; + return false; + })) + return nullptr; + return new VectorConstant(vt, components); + } else if (auto* mt = type->AsMatrix()) { + auto components = GetConstantsFromIds(literal_words_or_ids); + if (components.empty()) return nullptr; + return new MatrixConstant(mt, components); + } else if (auto* st = type->AsStruct()) { + auto components = GetConstantsFromIds(literal_words_or_ids); + if (components.empty()) return nullptr; + return new StructConstant(st, components); + } else if (auto* at = type->AsArray()) { + auto components = GetConstantsFromIds(literal_words_or_ids); + if (components.empty()) return nullptr; + return new ArrayConstant(at, components); + } else { + return nullptr; + } +} + +const Constant* ConstantManager::GetConstantFromInst(ir::Instruction* inst) { + std::vector literal_words_or_ids; + + // Collect the constant defining literals or component ids. + for (uint32_t i = 0; i < inst->NumInOperands(); i++) { + literal_words_or_ids.insert(literal_words_or_ids.end(), + inst->GetInOperand(i).words.begin(), + inst->GetInOperand(i).words.end()); + } + + switch (inst->opcode()) { + // OpConstant{True|False} have the value embedded in the opcode. So they + // are not handled by the for-loop above. Here we add the value explicitly. + case SpvOp::SpvOpConstantTrue: + literal_words_or_ids.push_back(true); + break; + case SpvOp::SpvOpConstantFalse: + literal_words_or_ids.push_back(false); + break; + case SpvOp::SpvOpConstantNull: + case SpvOp::SpvOpConstant: + case SpvOp::SpvOpConstantComposite: + case SpvOp::SpvOpSpecConstantComposite: + break; + default: + return nullptr; + } + + return GetConstant(GetType(inst), literal_words_or_ids); +} + +std::unique_ptr ConstantManager::CreateInstruction( + uint32_t id, const Constant* c, uint32_t type_id) const { + uint32_t type = + (type_id == 0) ? context()->get_type_mgr()->GetId(c->type()) : type_id; + if (c->AsNullConstant()) { + return MakeUnique(context(), SpvOp::SpvOpConstantNull, + type, id, + std::initializer_list{}); + } else if (const BoolConstant* bc = c->AsBoolConstant()) { + return MakeUnique( + context(), + bc->value() ? SpvOp::SpvOpConstantTrue : SpvOp::SpvOpConstantFalse, + type, id, std::initializer_list{}); + } else if (const IntConstant* ic = c->AsIntConstant()) { + return MakeUnique( + context(), SpvOp::SpvOpConstant, type, id, + std::initializer_list{ir::Operand( + spv_operand_type_t::SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER, + ic->words())}); + } else if (const FloatConstant* fc = c->AsFloatConstant()) { + return MakeUnique( + context(), SpvOp::SpvOpConstant, type, id, + std::initializer_list{ir::Operand( + spv_operand_type_t::SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER, + fc->words())}); + } else if (const CompositeConstant* cc = c->AsCompositeConstant()) { + return CreateCompositeInstruction(id, cc, type_id); + } else { + return nullptr; + } +} + +std::unique_ptr ConstantManager::CreateCompositeInstruction( + uint32_t result_id, const CompositeConstant* cc, uint32_t type_id) const { + std::vector operands; + for (const Constant* component_const : cc->GetComponents()) { + uint32_t id = FindDeclaredConstant(component_const); + if (id == 0) { + // Cannot get the id of the component constant, while all components + // should have been added to the module prior to the composite constant. + // Cannot create OpConstantComposite instruction in this case. + return nullptr; + } + operands.emplace_back(spv_operand_type_t::SPV_OPERAND_TYPE_ID, + std::initializer_list{id}); + } + uint32_t type = + (type_id == 0) ? context()->get_type_mgr()->GetId(cc->type()) : type_id; + return MakeUnique(context(), SpvOp::SpvOpConstantComposite, + type, result_id, std::move(operands)); +} + +const Constant* ConstantManager::GetConstant( + const Type* type, const std::vector& literal_words_or_ids) { + auto cst = CreateConstant(type, literal_words_or_ids); + return cst ? RegisterConstant(cst) : nullptr; +} + +} // namespace analysis +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/constants.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/constants.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/constants.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/constants.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,646 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_CONSTANTS_H_ +#define LIBSPIRV_OPT_CONSTANTS_H_ + +#include +#include +#include +#include +#include +#include + +#include "make_unique.h" +#include "module.h" +#include "type_manager.h" +#include "types.h" +#include "util/hex_float.h" + +namespace spvtools { +namespace opt { +namespace analysis { + +// Class hierarchy to represent the normal constants defined through +// OpConstantTrue, OpConstantFalse, OpConstant, OpConstantNull and +// OpConstantComposite instructions. +// TODO(qining): Add class for constants defined with OpConstantSampler. +class Constant; +class ScalarConstant; +class IntConstant; +class FloatConstant; +class BoolConstant; +class CompositeConstant; +class StructConstant; +class VectorConstant; +class MatrixConstant; +class ArrayConstant; +class NullConstant; + +// Abstract class for a SPIR-V constant. It has a bunch of As methods, +// which is used as a way to probe the actual +class Constant { + public: + Constant() = delete; + virtual ~Constant() {} + + // Make a deep copy of this constant. + virtual std::unique_ptr Copy() const = 0; + + // reflections + virtual ScalarConstant* AsScalarConstant() { return nullptr; } + virtual IntConstant* AsIntConstant() { return nullptr; } + virtual FloatConstant* AsFloatConstant() { return nullptr; } + virtual BoolConstant* AsBoolConstant() { return nullptr; } + virtual CompositeConstant* AsCompositeConstant() { return nullptr; } + virtual StructConstant* AsStructConstant() { return nullptr; } + virtual VectorConstant* AsVectorConstant() { return nullptr; } + virtual MatrixConstant* AsMatrixConstant() { return nullptr; } + virtual ArrayConstant* AsArrayConstant() { return nullptr; } + virtual NullConstant* AsNullConstant() { return nullptr; } + + virtual const ScalarConstant* AsScalarConstant() const { return nullptr; } + virtual const IntConstant* AsIntConstant() const { return nullptr; } + virtual const FloatConstant* AsFloatConstant() const { return nullptr; } + virtual const BoolConstant* AsBoolConstant() const { return nullptr; } + virtual const CompositeConstant* AsCompositeConstant() const { + return nullptr; + } + virtual const StructConstant* AsStructConstant() const { return nullptr; } + virtual const VectorConstant* AsVectorConstant() const { return nullptr; } + virtual const MatrixConstant* AsMatrixConstant() const { return nullptr; } + virtual const ArrayConstant* AsArrayConstant() const { return nullptr; } + virtual const NullConstant* AsNullConstant() const { return nullptr; } + + // Returns the float representation of the constant. Must be a 32 bit + // Float type. + float GetFloat() const; + + // Returns the double representation of the constant. Must be a 64 bit + // Float type. + double GetDouble() const; + + // Returns uint32_t representation of the constant. Must be a 32 bit + // Integer type. + uint32_t GetU32() const; + + // Returns uint64_t representation of the constant. Must be a 64 bit + // Integer type. + uint64_t GetU64() const; + + // Returns int32_t representation of the constant. Must be a 32 bit + // Integer type. + int32_t GetS32() const; + + // Returns int64_t representation of the constant. Must be a 64 bit + // Integer type. + int64_t GetS64() const; + + const Type* type() const { return type_; } + + protected: + Constant(const Type* ty) : type_(ty) {} + + // The type of this constant. + const Type* type_; +}; + +// Abstract class for scalar type constants. +class ScalarConstant : public Constant { + public: + ScalarConstant() = delete; + ScalarConstant* AsScalarConstant() override { return this; } + const ScalarConstant* AsScalarConstant() const override { return this; } + + // Returns a const reference of the value of this constant in 32-bit words. + virtual const std::vector& words() const { return words_; } + + // Returns true if the value is zero. + bool IsZero() const { + bool is_zero = true; + for (uint32_t v : words()) { + if (v != 0) { + is_zero = false; + break; + } + } + return is_zero; + } + + protected: + ScalarConstant(const Type* ty, const std::vector& w) + : Constant(ty), words_(w) {} + ScalarConstant(const Type* ty, std::vector&& w) + : Constant(ty), words_(std::move(w)) {} + std::vector words_; +}; + +// Integer type constant. +class IntConstant : public ScalarConstant { + public: + IntConstant(const Integer* ty, const std::vector& w) + : ScalarConstant(ty, w) {} + IntConstant(const Integer* ty, std::vector&& w) + : ScalarConstant(ty, std::move(w)) {} + + IntConstant* AsIntConstant() override { return this; } + const IntConstant* AsIntConstant() const override { return this; } + + int32_t GetS32BitValue() const { + // Relies on signed values smaller than 32-bit being sign extended. See + // section 2.2.1 of the SPIR-V spec. + assert(words().size() == 1); + return words()[0]; + } + + uint32_t GetU32BitValue() const { + // Relies on unsigned values smaller than 32-bit being zero extended. See + // section 2.2.1 of the SPIR-V spec. + assert(words().size() == 1); + return words()[0]; + } + + int64_t GetS64BitValue() const { + // Relies on unsigned values smaller than 64-bit being sign extended. See + // section 2.2.1 of the SPIR-V spec. + assert(words().size() == 2); + return static_cast(words()[1]) << 32 | + static_cast(words()[0]); + } + + uint64_t GetU64BitValue() const { + // Relies on unsigned values smaller than 64-bit being zero extended. See + // section 2.2.1 of the SPIR-V spec. + assert(words().size() == 2); + return static_cast(words()[1]) << 32 | + static_cast(words()[0]); + } + + // Make a copy of this IntConstant instance. + std::unique_ptr CopyIntConstant() const { + return MakeUnique(type_->AsInteger(), words_); + } + std::unique_ptr Copy() const override { + return std::unique_ptr(CopyIntConstant().release()); + } +}; + +// Float type constant. +class FloatConstant : public ScalarConstant { + public: + FloatConstant(const Float* ty, const std::vector& w) + : ScalarConstant(ty, w) {} + FloatConstant(const Float* ty, std::vector&& w) + : ScalarConstant(ty, std::move(w)) {} + + FloatConstant* AsFloatConstant() override { return this; } + const FloatConstant* AsFloatConstant() const override { return this; } + + // Make a copy of this FloatConstant instance. + std::unique_ptr CopyFloatConstant() const { + return MakeUnique(type_->AsFloat(), words_); + } + std::unique_ptr Copy() const override { + return std::unique_ptr(CopyFloatConstant().release()); + } + + // Returns the float value of |this|. The type of |this| must be |Float| with + // width of 32. + float GetFloatValue() const { + assert(type()->AsFloat()->width() == 32 && + "Not a 32-bit floating point value."); + spvutils::FloatProxy a(words()[0]); + return a.getAsFloat(); + } + + // Returns the double value of |this|. The type of |this| must be |Float| + // with width of 64. + double GetDoubleValue() const { + assert(type()->AsFloat()->width() == 64 && + "Not a 32-bit floating point value."); + uint64_t combined_words = words()[1]; + combined_words = combined_words << 32; + combined_words |= words()[0]; + spvutils::FloatProxy a(combined_words); + return a.getAsFloat(); + } +}; + +// Bool type constant. +class BoolConstant : public ScalarConstant { + public: + BoolConstant(const Bool* ty, bool v) + : ScalarConstant(ty, {static_cast(v)}), value_(v) {} + + BoolConstant* AsBoolConstant() override { return this; } + const BoolConstant* AsBoolConstant() const override { return this; } + + // Make a copy of this BoolConstant instance. + std::unique_ptr CopyBoolConstant() const { + return MakeUnique(type_->AsBool(), value_); + } + std::unique_ptr Copy() const override { + return std::unique_ptr(CopyBoolConstant().release()); + } + + bool value() const { return value_; } + + private: + bool value_; +}; + +// Abstract class for composite constants. +class CompositeConstant : public Constant { + public: + CompositeConstant() = delete; + CompositeConstant* AsCompositeConstant() override { return this; } + const CompositeConstant* AsCompositeConstant() const override { return this; } + + // Returns a const reference of the components held in this composite + // constant. + virtual const std::vector& GetComponents() const { + return components_; + } + + protected: + CompositeConstant(const Type* ty) : Constant(ty), components_() {} + CompositeConstant(const Type* ty, + const std::vector& components) + : Constant(ty), components_(components) {} + CompositeConstant(const Type* ty, std::vector&& components) + : Constant(ty), components_(std::move(components)) {} + std::vector components_; +}; + +// Struct type constant. +class StructConstant : public CompositeConstant { + public: + StructConstant(const Struct* ty) : CompositeConstant(ty) {} + StructConstant(const Struct* ty, + const std::vector& components) + : CompositeConstant(ty, components) {} + StructConstant(const Struct* ty, std::vector&& components) + : CompositeConstant(ty, std::move(components)) {} + + StructConstant* AsStructConstant() override { return this; } + const StructConstant* AsStructConstant() const override { return this; } + + // Make a copy of this StructConstant instance. + std::unique_ptr CopyStructConstant() const { + return MakeUnique(type_->AsStruct(), components_); + } + std::unique_ptr Copy() const override { + return std::unique_ptr(CopyStructConstant().release()); + } +}; + +// Vector type constant. +class VectorConstant : public CompositeConstant { + public: + VectorConstant(const Vector* ty) + : CompositeConstant(ty), component_type_(ty->element_type()) {} + VectorConstant(const Vector* ty, + const std::vector& components) + : CompositeConstant(ty, components), + component_type_(ty->element_type()) {} + VectorConstant(const Vector* ty, std::vector&& components) + : CompositeConstant(ty, std::move(components)), + component_type_(ty->element_type()) {} + + VectorConstant* AsVectorConstant() override { return this; } + const VectorConstant* AsVectorConstant() const override { return this; } + + // Make a copy of this VectorConstant instance. + std::unique_ptr CopyVectorConstant() const { + auto another = MakeUnique(type_->AsVector()); + another->components_.insert(another->components_.end(), components_.begin(), + components_.end()); + return another; + } + std::unique_ptr Copy() const override { + return std::unique_ptr(CopyVectorConstant().release()); + } + + const Type* component_type() const { return component_type_; } + + private: + const Type* component_type_; +}; + +// Matrix type constant. +class MatrixConstant : public CompositeConstant { + public: + MatrixConstant(const Matrix* ty) + : CompositeConstant(ty), component_type_(ty->element_type()) {} + MatrixConstant(const Matrix* ty, + const std::vector& components) + : CompositeConstant(ty, components), + component_type_(ty->element_type()) {} + MatrixConstant(const Vector* ty, std::vector&& components) + : CompositeConstant(ty, std::move(components)), + component_type_(ty->element_type()) {} + + MatrixConstant* AsMatrixConstant() override { return this; } + const MatrixConstant* AsMatrixConstant() const override { return this; } + + // Make a copy of this MatrixConstant instance. + std::unique_ptr CopyMatrixConstant() const { + auto another = MakeUnique(type_->AsMatrix()); + another->components_.insert(another->components_.end(), components_.begin(), + components_.end()); + return another; + } + std::unique_ptr Copy() const override { + return std::unique_ptr(CopyMatrixConstant().release()); + } + + const Type* component_type() { return component_type_; } + + private: + const Type* component_type_; +}; + +// Array type constant. +class ArrayConstant : public CompositeConstant { + public: + ArrayConstant(const Array* ty) : CompositeConstant(ty) {} + ArrayConstant(const Array* ty, const std::vector& components) + : CompositeConstant(ty, components) {} + ArrayConstant(const Array* ty, std::vector&& components) + : CompositeConstant(ty, std::move(components)) {} + + ArrayConstant* AsArrayConstant() override { return this; } + const ArrayConstant* AsArrayConstant() const override { return this; } + + // Make a copy of this ArrayConstant instance. + std::unique_ptr CopyArrayConstant() const { + return MakeUnique(type_->AsArray(), components_); + } + std::unique_ptr Copy() const override { + return std::unique_ptr(CopyArrayConstant().release()); + } +}; + +// Null type constant. +class NullConstant : public Constant { + public: + NullConstant(const Type* ty) : Constant(ty) {} + NullConstant* AsNullConstant() override { return this; } + const NullConstant* AsNullConstant() const override { return this; } + + // Make a copy of this NullConstant instance. + std::unique_ptr CopyNullConstant() const { + return MakeUnique(type_); + } + std::unique_ptr Copy() const override { + return std::unique_ptr(CopyNullConstant().release()); + } +}; + +class IRContext; + +// Hash function for Constant instances. Use the structure of the constant as +// the key. +struct ConstantHash { + void add_pointer(std::u32string* h, const void* p) const { + uint64_t ptr_val = reinterpret_cast(p); + h->push_back(static_cast(ptr_val >> 32)); + h->push_back(static_cast(ptr_val)); + } + + size_t operator()(const Constant* const_val) const { + std::u32string h; + add_pointer(&h, const_val->type()); + if (const auto scalar = const_val->AsScalarConstant()) { + for (const auto& w : scalar->words()) { + h.push_back(w); + } + } else if (const auto composite = const_val->AsCompositeConstant()) { + for (const auto& c : composite->GetComponents()) { + add_pointer(&h, c); + } + } else if (const_val->AsNullConstant()) { + h.push_back(0); + } else { + assert( + false && + "Tried to compute the hash value of an invalid Constant instance."); + } + + return std::hash()(h); + } +}; + +// Equality comparison structure for two constants. +struct ConstantEqual { + bool operator()(const Constant* c1, const Constant* c2) const { + if (c1->type() != c2->type()) { + return false; + } + + if (const auto& s1 = c1->AsScalarConstant()) { + const auto& s2 = c2->AsScalarConstant(); + return s2 && s1->words() == s2->words(); + } else if (const auto& composite1 = c1->AsCompositeConstant()) { + const auto& composite2 = c2->AsCompositeConstant(); + return composite2 && + composite1->GetComponents() == composite2->GetComponents(); + } else if (c1->AsNullConstant()) + return c2->AsNullConstant() != nullptr; + else + assert(false && "Tried to compare two invalid Constant instances."); + return false; + } +}; + +// This class represents a pool of constants. +class ConstantManager { + public: + ConstantManager(ir::IRContext* ctx); + + ir::IRContext* context() const { return ctx_; } + + // Gets or creates a unique Constant instance of type |type| and a vector of + // constant defining words |words|. If a Constant instance existed already in + // the constant pool, it returns a pointer to it. Otherwise, it creates one + // using CreateConstant. If a new Constant instance cannot be created, it + // returns nullptr. + const Constant* GetConstant( + const Type* type, const std::vector& literal_words_or_ids); + + // Gets or creates a Constant instance to hold the constant value of the given + // instruction. It returns a pointer to a Constant instance or nullptr if it + // could not create the constant. + const Constant* GetConstantFromInst(ir::Instruction* inst); + + // Gets or creates a constant defining instruction for the given Constant |c|. + // If |c| had already been defined, it returns a pointer to the existing + // declaration. Otherwise, it calls BuildInstructionAndAddToModule. If the + // optional |pos| is given, it will insert any newly created instructions at + // the given instruction iterator position. Otherwise, it inserts the new + // instruction at the end of the current module's types section. + ir::Instruction* GetDefiningInstruction( + const Constant* c, ir::Module::inst_iterator* pos = nullptr); + + // Creates a constant defining instruction for the given Constant instance + // and inserts the instruction at the position specified by the given + // instruction iterator. Returns a pointer to the created instruction if + // succeeded, otherwise returns a null pointer. The instruction iterator + // points to the same instruction before and after the insertion. This is the + // only method that actually manages id creation/assignment and instruction + // creation/insertion for a new Constant instance. + // + // |type_id| is an optional argument for disambiguating equivalent types. If + // |type_id| is specified, it is used as the type of the constant. Otherwise + // the type of the constant is derived by getting an id from the type manager + // for |c|. + ir::Instruction* BuildInstructionAndAddToModule( + const Constant* c, ir::Module::inst_iterator* pos, uint32_t type_id = 0); + + // A helper function to get the result type of the given instruction. Returns + // nullptr if the instruction does not have a type id (type id is 0). + Type* GetType(const ir::Instruction* inst) const; + + // A helper function to get the collected normal constant with the given id. + // Returns the pointer to the Constant instance in case it is found. + // Otherwise, it returns a null pointer. + const Constant* FindDeclaredConstant(uint32_t id) const { + auto iter = id_to_const_val_.find(id); + return (iter != id_to_const_val_.end()) ? iter->second : nullptr; + } + + // A helper function to get the id of a collected constant with the pointer + // to the Constant instance. Returns 0 in case the constant is not found. + uint32_t FindDeclaredConstant(const Constant* c) const { + auto iter = const_val_to_id_.find(c); + return (iter != const_val_to_id_.end()) ? iter->second : 0; + } + + // Returns the canonical constant that has the same structure and value as the + // given Constant |cst|. If none is found, it returns nullptr. + const Constant* FindConstant(const Constant* c) const { + auto it = const_pool_.find(c); + return (it != const_pool_.end()) ? *it : nullptr; + } + + // Registers a new constant |cst| in the constant pool. If the constant + // existed already, it returns a pointer to the previously existing Constant + // in the pool. Otherwise, it returns |cst|. + const Constant* RegisterConstant(const Constant* cst) { + auto ret = const_pool_.insert(cst); + return *ret.first; + } + + // A helper function to get a vector of Constant instances with the specified + // ids. If it can not find the Constant instance for any one of the ids, + // it returns an empty vector. + std::vector GetConstantsFromIds( + const std::vector& ids) const; + + // Returns a vector of constants representing each in operand. If an operand + // is not constant its entry is nullptr. + std::vector GetOperandConstants(ir::Instruction* inst) const; + + // Records a mapping between |inst| and the constant value generated by it. + // It returns true if a new Constant was successfully mapped, false if |inst| + // generates no constant values. + bool MapInst(ir::Instruction* inst) { + if (auto cst = GetConstantFromInst(inst)) { + MapConstantToInst(cst, inst); + return true; + } + return false; + } + + void RemoveId(uint32_t id) { + auto it = id_to_const_val_.find(id); + if (it != id_to_const_val_.end()) { + const_val_to_id_.erase(it->second); + id_to_const_val_.erase(it); + } + } + + // Records a new mapping between |inst| and |const_value|. This updates the + // two mappings |id_to_const_val_| and |const_val_to_id_|. + void MapConstantToInst(const Constant* const_value, ir::Instruction* inst) { + const_val_to_id_[const_value] = inst->result_id(); + id_to_const_val_[inst->result_id()] = const_value; + } + + private: + // Creates a Constant instance with the given type and a vector of constant + // defining words. Returns a unique pointer to the created Constant instance + // if the Constant instance can be created successfully. To create scalar + // type constants, the vector should contain the constant value in 32 bit + // words and the given type must be of type Bool, Integer or Float. To create + // composite type constants, the vector should contain the component ids, and + // those component ids should have been recorded before as Normal Constants. + // And the given type must be of type Struct, Vector or Array. When creating + // VectorType Constant instance, the components must be scalars of the same + // type, either Bool, Integer or Float. If any of the rules above failed, the + // creation will fail and nullptr will be returned. If the vector is empty, + // a NullConstant instance will be created with the given type. + const Constant* CreateConstant( + const Type* type, + const std::vector& literal_words_or_ids) const; + + // Creates an instruction with the given result id to declare a constant + // represented by the given Constant instance. Returns an unique pointer to + // the created instruction if the instruction can be created successfully. + // Otherwise, returns a null pointer. + // + // |type_id| is an optional argument for disambiguating equivalent types. If + // |type_id| is specified, it is used as the type of the constant. Otherwise + // the type of the constant is derived by getting an id from the type manager + // for |c|. + std::unique_ptr CreateInstruction( + uint32_t result_id, const Constant* c, uint32_t type_id = 0) const; + + // Creates an OpConstantComposite instruction with the given result id and + // the CompositeConst instance which represents a composite constant. Returns + // an unique pointer to the created instruction if succeeded. Otherwise + // returns a null pointer. + // + // |type_id| is an optional argument for disambiguating equivalent types. If + // |type_id| is specified, it is used as the type of the constant. Otherwise + // the type of the constant is derived by getting an id from the type manager + // for |c|. + std::unique_ptr CreateCompositeInstruction( + uint32_t result_id, const CompositeConstant* cc, + uint32_t type_id = 0) const; + + // IR context that owns this constant manager. + ir::IRContext* ctx_; + + // A mapping from the result ids of Normal Constants to their + // Constant instances. All Normal Constants in the module, either + // existing ones before optimization or the newly generated ones, should have + // their Constant instance stored and their result id registered in this map. + std::unordered_map id_to_const_val_; + + // A mapping from the Constant instance of Normal Constants to their + // result id in the module. This is a mirror map of |id_to_const_val_|. All + // Normal Constants that defining instructions in the module should have + // their Constant and their result id registered here. + std::unordered_map const_val_to_id_; + + // The constant pool. All created constants are registered here. + std::unordered_set const_pool_; +}; + +} // namespace analysis +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_CONSTANTS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/const_folding_rules.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/const_folding_rules.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/const_folding_rules.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/const_folding_rules.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,488 @@ +// Copyright (c) 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "const_folding_rules.h" + +namespace spvtools { +namespace opt { + +namespace { +const uint32_t kExtractCompositeIdInIdx = 0; + +// Folds an OpcompositeExtract where input is a composite constant. +ConstantFoldingRule FoldExtractWithConstants() { + return [](ir::Instruction* inst, + const std::vector& constants) + -> const analysis::Constant* { + const analysis::Constant* c = constants[kExtractCompositeIdInIdx]; + if (c == nullptr) { + return nullptr; + } + + for (uint32_t i = 1; i < inst->NumInOperands(); ++i) { + uint32_t element_index = inst->GetSingleWordInOperand(i); + if (c->AsNullConstant()) { + // Return Null for the return type. + ir::IRContext* context = inst->context(); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + analysis::TypeManager* type_mgr = context->get_type_mgr(); + return const_mgr->GetConstant(type_mgr->GetType(inst->type_id()), {}); + } + + auto cc = c->AsCompositeConstant(); + assert(cc != nullptr); + auto components = cc->GetComponents(); + c = components[element_index]; + } + return c; + }; +} + +ConstantFoldingRule FoldVectorShuffleWithConstants() { + return [](ir::Instruction* inst, + const std::vector& constants) + -> const analysis::Constant* { + assert(inst->opcode() == SpvOpVectorShuffle); + const analysis::Constant* c1 = constants[0]; + const analysis::Constant* c2 = constants[1]; + if (c1 == nullptr || c2 == nullptr) { + return nullptr; + } + + ir::IRContext* context = inst->context(); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + const analysis::Type* element_type = c1->type()->AsVector()->element_type(); + + std::vector c1_components; + if (const analysis::VectorConstant* vec_const = c1->AsVectorConstant()) { + c1_components = vec_const->GetComponents(); + } else { + assert(c1->AsNullConstant()); + const analysis::Constant* element = + const_mgr->GetConstant(element_type, {}); + c1_components.resize(c1->type()->AsVector()->element_count(), element); + } + std::vector c2_components; + if (const analysis::VectorConstant* vec_const = c2->AsVectorConstant()) { + c2_components = vec_const->GetComponents(); + } else { + assert(c2->AsNullConstant()); + const analysis::Constant* element = + const_mgr->GetConstant(element_type, {}); + c2_components.resize(c2->type()->AsVector()->element_count(), element); + } + + std::vector ids; + for (uint32_t i = 2; i < inst->NumInOperands(); ++i) { + uint32_t index = inst->GetSingleWordInOperand(i); + if (index < c1_components.size()) { + ir::Instruction* member_inst = + const_mgr->GetDefiningInstruction(c1_components[index]); + ids.push_back(member_inst->result_id()); + } else { + ir::Instruction* member_inst = const_mgr->GetDefiningInstruction( + c2_components[index - c1_components.size()]); + ids.push_back(member_inst->result_id()); + } + } + + analysis::TypeManager* type_mgr = context->get_type_mgr(); + return const_mgr->GetConstant(type_mgr->GetType(inst->type_id()), ids); + }; +} // namespace + +ConstantFoldingRule FoldCompositeWithConstants() { + // Folds an OpCompositeConstruct where all of the inputs are constants to a + // constant. A new constant is created if necessary. + return [](ir::Instruction* inst, + const std::vector& constants) + -> const analysis::Constant* { + ir::IRContext* context = inst->context(); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + analysis::TypeManager* type_mgr = context->get_type_mgr(); + const analysis::Type* new_type = type_mgr->GetType(inst->type_id()); + + std::vector ids; + for (const analysis::Constant* element_const : constants) { + if (element_const == nullptr) { + return nullptr; + } + uint32_t element_id = const_mgr->FindDeclaredConstant(element_const); + if (element_id == 0) { + return nullptr; + } + ids.push_back(element_id); + } + return const_mgr->GetConstant(new_type, ids); + }; +} + +// The interface for a function that returns the result of applying a scalar +// floating-point binary operation on |a| and |b|. The type of the return value +// will be |type|. The input constants must also be of type |type|. +using UnaryScalarFoldingRule = std::function; + +// The interface for a function that returns the result of applying a scalar +// floating-point binary operation on |a| and |b|. The type of the return value +// will be |type|. The input constants must also be of type |type|. +using BinaryScalarFoldingRule = std::function; + +// Returns an std::vector containing the elements of |constant|. The type of +// |constant| must be |Vector|. +std::vector GetVectorComponents( + const analysis::Constant* constant, analysis::ConstantManager* const_mgr) { + std::vector components; + const analysis::VectorConstant* a = constant->AsVectorConstant(); + const analysis::Vector* vector_type = constant->type()->AsVector(); + assert(vector_type != nullptr); + if (a != nullptr) { + for (uint32_t i = 0; i < vector_type->element_count(); ++i) { + components.push_back(a->GetComponents()[i]); + } + } else { + const analysis::Type* element_type = vector_type->element_type(); + const analysis::Constant* element_null_const = + const_mgr->GetConstant(element_type, {}); + for (uint32_t i = 0; i < vector_type->element_count(); ++i) { + components.push_back(element_null_const); + } + } + return components; +} + +// Returns a |ConstantFoldingRule| that folds unary floating point scalar ops +// using |scalar_rule| and unary float point vectors ops by applying +// |scalar_rule| to the elements of the vector. The |ConstantFoldingRule| +// that is returned assumes that |constants| contains 1 entry. If they are +// not |nullptr|, then their type is either |Float| or |Integer| or a |Vector| +// whose element type is |Float| or |Integer|. +ConstantFoldingRule FoldFPUnaryOp(UnaryScalarFoldingRule scalar_rule) { + return [scalar_rule](ir::Instruction* inst, + const std::vector& constants) + -> const analysis::Constant* { + ir::IRContext* context = inst->context(); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + analysis::TypeManager* type_mgr = context->get_type_mgr(); + const analysis::Type* result_type = type_mgr->GetType(inst->type_id()); + const analysis::Vector* vector_type = result_type->AsVector(); + + if (!inst->IsFloatingPointFoldingAllowed()) { + return nullptr; + } + + if (constants[0] == nullptr) { + return nullptr; + } + + if (vector_type != nullptr) { + std::vector a_components; + std::vector results_components; + + a_components = GetVectorComponents(constants[0], const_mgr); + + // Fold each component of the vector. + for (uint32_t i = 0; i < a_components.size(); ++i) { + results_components.push_back(scalar_rule(vector_type->element_type(), + a_components[i], const_mgr)); + if (results_components[i] == nullptr) { + return nullptr; + } + } + + // Build the constant object and return it. + std::vector ids; + for (const analysis::Constant* member : results_components) { + ids.push_back(const_mgr->GetDefiningInstruction(member)->result_id()); + } + return const_mgr->GetConstant(vector_type, ids); + } else { + return scalar_rule(result_type, constants[0], const_mgr); + } + }; +} + +// Returns a |ConstantFoldingRule| that folds floating point scalars using +// |scalar_rule| and vectors of floating point by applying |scalar_rule| to the +// elements of the vector. The |ConstantFoldingRule| that is returned assumes +// that |constants| contains 2 entries. If they are not |nullptr|, then their +// type is either |Float| or a |Vector| whose element type is |Float|. +ConstantFoldingRule FoldFPBinaryOp(BinaryScalarFoldingRule scalar_rule) { + return [scalar_rule](ir::Instruction* inst, + const std::vector& constants) + -> const analysis::Constant* { + ir::IRContext* context = inst->context(); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + analysis::TypeManager* type_mgr = context->get_type_mgr(); + const analysis::Type* result_type = type_mgr->GetType(inst->type_id()); + const analysis::Vector* vector_type = result_type->AsVector(); + + if (!inst->IsFloatingPointFoldingAllowed()) { + return nullptr; + } + + if (constants[0] == nullptr || constants[1] == nullptr) { + return nullptr; + } + + if (vector_type != nullptr) { + std::vector a_components; + std::vector b_components; + std::vector results_components; + + a_components = GetVectorComponents(constants[0], const_mgr); + b_components = GetVectorComponents(constants[1], const_mgr); + + // Fold each component of the vector. + for (uint32_t i = 0; i < a_components.size(); ++i) { + results_components.push_back(scalar_rule(vector_type->element_type(), + a_components[i], + b_components[i], const_mgr)); + if (results_components[i] == nullptr) { + return nullptr; + } + } + + // Build the constant object and return it. + std::vector ids; + for (const analysis::Constant* member : results_components) { + ids.push_back(const_mgr->GetDefiningInstruction(member)->result_id()); + } + return const_mgr->GetConstant(vector_type, ids); + } else { + return scalar_rule(result_type, constants[0], constants[1], const_mgr); + } + }; +} + +// This macro defines a |UnaryScalarFoldingRule| that performs float to +// integer conversion. +// TODO(greg-lunarg): Support for 64-bit integer types. +UnaryScalarFoldingRule FoldFToIOp() { + return [](const analysis::Type* result_type, const analysis::Constant* a, + analysis::ConstantManager* const_mgr) -> const analysis::Constant* { + assert(result_type != nullptr && a != nullptr); + const analysis::Integer* integer_type = result_type->AsInteger(); + const analysis::Float* float_type = a->type()->AsFloat(); + assert(float_type != nullptr); + assert(integer_type != nullptr); + if (integer_type->width() != 32) return nullptr; + if (float_type->width() == 32) { + float fa = a->GetFloat(); + uint32_t result = integer_type->IsSigned() + ? static_cast(static_cast(fa)) + : static_cast(fa); + std::vector words = {result}; + return const_mgr->GetConstant(result_type, words); + } else if (float_type->width() == 64) { + double fa = a->GetDouble(); + uint32_t result = integer_type->IsSigned() + ? static_cast(static_cast(fa)) + : static_cast(fa); + std::vector words = {result}; + return const_mgr->GetConstant(result_type, words); + } + return nullptr; + }; +} + +// This macro defines a |UnaryScalarFoldingRule| that performs integer to +// float conversion. +// TODO(greg-lunarg): Support for 64-bit integer types. +UnaryScalarFoldingRule FoldIToFOp() { + return [](const analysis::Type* result_type, const analysis::Constant* a, + analysis::ConstantManager* const_mgr) -> const analysis::Constant* { + assert(result_type != nullptr && a != nullptr); + const analysis::Integer* integer_type = a->type()->AsInteger(); + const analysis::Float* float_type = result_type->AsFloat(); + assert(float_type != nullptr); + assert(integer_type != nullptr); + if (integer_type->width() != 32) return nullptr; + uint32_t ua = a->GetU32(); + if (float_type->width() == 32) { + float result_val = integer_type->IsSigned() + ? static_cast(static_cast(ua)) + : static_cast(ua); + spvutils::FloatProxy result(result_val); + std::vector words = {result.data()}; + return const_mgr->GetConstant(result_type, words); + } else if (float_type->width() == 64) { + double result_val = integer_type->IsSigned() + ? static_cast(static_cast(ua)) + : static_cast(ua); + spvutils::FloatProxy result(result_val); + std::vector words = result.GetWords(); + return const_mgr->GetConstant(result_type, words); + } + return nullptr; + }; +} + +// This macro defines a |BinaryScalarFoldingRule| that applies |op|. The +// operator |op| must work for both float and double, and use syntax "f1 op f2". +#define FOLD_FPARITH_OP(op) \ + [](const analysis::Type* result_type, const analysis::Constant* a, \ + const analysis::Constant* b, \ + analysis::ConstantManager* const_mgr) -> const analysis::Constant* { \ + assert(result_type != nullptr && a != nullptr && b != nullptr); \ + assert(result_type == a->type() && result_type == b->type()); \ + const analysis::Float* float_type = result_type->AsFloat(); \ + assert(float_type != nullptr); \ + if (float_type->width() == 32) { \ + float fa = a->GetFloat(); \ + float fb = b->GetFloat(); \ + spvutils::FloatProxy result(fa op fb); \ + std::vector words = result.GetWords(); \ + return const_mgr->GetConstant(result_type, words); \ + } else if (float_type->width() == 64) { \ + double fa = a->GetDouble(); \ + double fb = b->GetDouble(); \ + spvutils::FloatProxy result(fa op fb); \ + std::vector words = result.GetWords(); \ + return const_mgr->GetConstant(result_type, words); \ + } \ + return nullptr; \ + } + +// Define the folding rule for conversion between floating point and integer +ConstantFoldingRule FoldFToI() { return FoldFPUnaryOp(FoldFToIOp()); } +ConstantFoldingRule FoldIToF() { return FoldFPUnaryOp(FoldIToFOp()); } + +// Define the folding rules for subtraction, addition, multiplication, and +// division for floating point values. +ConstantFoldingRule FoldFSub() { return FoldFPBinaryOp(FOLD_FPARITH_OP(-)); } +ConstantFoldingRule FoldFAdd() { return FoldFPBinaryOp(FOLD_FPARITH_OP(+)); } +ConstantFoldingRule FoldFMul() { return FoldFPBinaryOp(FOLD_FPARITH_OP(*)); } +ConstantFoldingRule FoldFDiv() { return FoldFPBinaryOp(FOLD_FPARITH_OP(/)); } + +bool CompareFloatingPoint(bool op_result, bool op_unordered, + bool need_ordered) { + if (need_ordered) { + // operands are ordered and Operand 1 is |op| Operand 2 + return !op_unordered && op_result; + } else { + // operands are unordered or Operand 1 is |op| Operand 2 + return op_unordered || op_result; + } +} + +// This macro defines a |BinaryScalarFoldingRule| that applies |op|. The +// operator |op| must work for both float and double, and use syntax "f1 op f2". +#define FOLD_FPCMP_OP(op, ord) \ + [](const analysis::Type* result_type, const analysis::Constant* a, \ + const analysis::Constant* b, \ + analysis::ConstantManager* const_mgr) -> const analysis::Constant* { \ + assert(result_type != nullptr && a != nullptr && b != nullptr); \ + assert(result_type->AsBool()); \ + assert(a->type() == b->type()); \ + const analysis::Float* float_type = a->type()->AsFloat(); \ + assert(float_type != nullptr); \ + if (float_type->width() == 32) { \ + float fa = a->GetFloat(); \ + float fb = b->GetFloat(); \ + bool result = CompareFloatingPoint( \ + fa op fb, std::isnan(fa) || std::isnan(fb), ord); \ + std::vector words = {uint32_t(result)}; \ + return const_mgr->GetConstant(result_type, words); \ + } else if (float_type->width() == 64) { \ + double fa = a->GetDouble(); \ + double fb = b->GetDouble(); \ + bool result = CompareFloatingPoint( \ + fa op fb, std::isnan(fa) || std::isnan(fb), ord); \ + std::vector words = {uint32_t(result)}; \ + return const_mgr->GetConstant(result_type, words); \ + } \ + return nullptr; \ + } + +// Define the folding rules for ordered and unordered comparison for floating +// point values. +ConstantFoldingRule FoldFOrdEqual() { + return FoldFPBinaryOp(FOLD_FPCMP_OP(==, true)); +} +ConstantFoldingRule FoldFUnordEqual() { + return FoldFPBinaryOp(FOLD_FPCMP_OP(==, false)); +} +ConstantFoldingRule FoldFOrdNotEqual() { + return FoldFPBinaryOp(FOLD_FPCMP_OP(!=, true)); +} +ConstantFoldingRule FoldFUnordNotEqual() { + return FoldFPBinaryOp(FOLD_FPCMP_OP(!=, false)); +} +ConstantFoldingRule FoldFOrdLessThan() { + return FoldFPBinaryOp(FOLD_FPCMP_OP(<, true)); +} +ConstantFoldingRule FoldFUnordLessThan() { + return FoldFPBinaryOp(FOLD_FPCMP_OP(<, false)); +} +ConstantFoldingRule FoldFOrdGreaterThan() { + return FoldFPBinaryOp(FOLD_FPCMP_OP(>, true)); +} +ConstantFoldingRule FoldFUnordGreaterThan() { + return FoldFPBinaryOp(FOLD_FPCMP_OP(>, false)); +} +ConstantFoldingRule FoldFOrdLessThanEqual() { + return FoldFPBinaryOp(FOLD_FPCMP_OP(<=, true)); +} +ConstantFoldingRule FoldFUnordLessThanEqual() { + return FoldFPBinaryOp(FOLD_FPCMP_OP(<=, false)); +} +ConstantFoldingRule FoldFOrdGreaterThanEqual() { + return FoldFPBinaryOp(FOLD_FPCMP_OP(>=, true)); +} +ConstantFoldingRule FoldFUnordGreaterThanEqual() { + return FoldFPBinaryOp(FOLD_FPCMP_OP(>=, false)); +} +} // namespace + +spvtools::opt::ConstantFoldingRules::ConstantFoldingRules() { + // Add all folding rules to the list for the opcodes to which they apply. + // Note that the order in which rules are added to the list matters. If a rule + // applies to the instruction, the rest of the rules will not be attempted. + // Take that into consideration. + + rules_[SpvOpCompositeConstruct].push_back(FoldCompositeWithConstants()); + + rules_[SpvOpCompositeExtract].push_back(FoldExtractWithConstants()); + + rules_[SpvOpConvertFToS].push_back(FoldFToI()); + rules_[SpvOpConvertFToU].push_back(FoldFToI()); + rules_[SpvOpConvertSToF].push_back(FoldIToF()); + rules_[SpvOpConvertUToF].push_back(FoldIToF()); + + rules_[SpvOpFAdd].push_back(FoldFAdd()); + rules_[SpvOpFDiv].push_back(FoldFDiv()); + rules_[SpvOpFMul].push_back(FoldFMul()); + rules_[SpvOpFSub].push_back(FoldFSub()); + + rules_[SpvOpFOrdEqual].push_back(FoldFOrdEqual()); + rules_[SpvOpFUnordEqual].push_back(FoldFUnordEqual()); + rules_[SpvOpFOrdNotEqual].push_back(FoldFOrdNotEqual()); + rules_[SpvOpFUnordNotEqual].push_back(FoldFUnordNotEqual()); + rules_[SpvOpFOrdLessThan].push_back(FoldFOrdLessThan()); + rules_[SpvOpFUnordLessThan].push_back(FoldFUnordLessThan()); + rules_[SpvOpFOrdGreaterThan].push_back(FoldFOrdGreaterThan()); + rules_[SpvOpFUnordGreaterThan].push_back(FoldFUnordGreaterThan()); + rules_[SpvOpFOrdLessThanEqual].push_back(FoldFOrdLessThanEqual()); + rules_[SpvOpFUnordLessThanEqual].push_back(FoldFUnordLessThanEqual()); + rules_[SpvOpFOrdGreaterThanEqual].push_back(FoldFOrdGreaterThanEqual()); + rules_[SpvOpFUnordGreaterThanEqual].push_back(FoldFUnordGreaterThanEqual()); + + rules_[SpvOpVectorShuffle].push_back(FoldVectorShuffleWithConstants()); +} +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/const_folding_rules.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/const_folding_rules.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/const_folding_rules.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/const_folding_rules.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,84 @@ +// Copyright (c) 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_CONST_FOLDING_RULES_H_ +#define LIBSPIRV_OPT_CONST_FOLDING_RULES_H_ + +#include + +#include "constants.h" +#include "def_use_manager.h" +#include "folding_rules.h" +#include "ir_builder.h" +#include "ir_context.h" +#include "latest_version_spirv_header.h" + +namespace spvtools { +namespace opt { + +// Constant Folding Rules: +// +// The folding mechanism is built around the concept of a |ConstantFoldingRule|. +// A constant folding rule is a function that implements a method of simplifying +// an instruction to a constant. +// +// The inputs to a folding rule are: +// |inst| - the instruction to be simplified. +// |constants| - if an in-operands is an id of a constant, then the +// corresponding value in |constants| contains that +// constant value. Otherwise, the corresponding entry in +// |constants| is |nullptr|. +// +// A constant folding rule returns a pointer to an Constant if |inst| can be +// simplified using this rule. Otherwise, it returns |nullptr|. +// +// See const_folding_rules.cpp for examples on how to write a constant folding +// rule. +// +// Be sure to add new constant folding rules to the table of constant folding +// rules in the constructor for ConstantFoldingRules. The new rule should be +// added to the list for every opcode that it applies to. Note that earlier +// rules in the list are given priority. That is, if an earlier rule is able to +// fold an instruction, the later rules will not be attempted. + +using ConstantFoldingRule = std::function& constants)>; + +class ConstantFoldingRules { + public: + ConstantFoldingRules(); + + // Returns true if there is at least 1 folding rule for |opcode|. + bool HasFoldingRule(SpvOp opcode) const { return rules_.count(opcode); } + + // Returns an vector of constant folding rules for |opcode|. + const std::vector& GetRulesForOpcode( + SpvOp opcode) const { + auto it = rules_.find(opcode); + if (it != rules_.end()) { + return it->second; + } + return empty_vector_; + } + + private: + std::unordered_map> rules_; + std::vector empty_vector_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_CONST_FOLDING_RULES_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/copy_prop_arrays.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/copy_prop_arrays.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/copy_prop_arrays.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/copy_prop_arrays.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,848 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "copy_prop_arrays.h" +#include "ir_builder.h" + +namespace { +const uint32_t kLoadPointerInOperand = 0; +const uint32_t kStorePointerInOperand = 0; +const uint32_t kStoreObjectInOperand = 1; +const uint32_t kCompositeExtractObjectInOperand = 0; +} // namespace + +namespace spvtools { +namespace opt { + +Pass::Status CopyPropagateArrays::Process(ir::IRContext* ctx) { + InitializeProcessing(ctx); + + bool modified = false; + for (ir::Function& function : *get_module()) { + ir::BasicBlock* entry_bb = &*function.begin(); + + for (auto var_inst = entry_bb->begin(); var_inst->opcode() == SpvOpVariable; + ++var_inst) { + if (!IsPointerToArrayType(var_inst->type_id())) { + continue; + } + + // Find the only store to the entire memory location, if it exists. + ir::Instruction* store_inst = FindStoreInstruction(&*var_inst); + + if (!store_inst) { + continue; + } + + std::unique_ptr source_object = + FindSourceObjectIfPossible(&*var_inst, store_inst); + + if (source_object != nullptr) { + if (CanUpdateUses(&*var_inst, source_object->GetPointerTypeId())) { + modified = true; + PropagateObject(&*var_inst, source_object.get(), store_inst); + } + } + } + } + return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange); +} + +std::unique_ptr +CopyPropagateArrays::FindSourceObjectIfPossible(ir::Instruction* var_inst, + ir::Instruction* store_inst) { + assert(var_inst->opcode() == SpvOpVariable && "Expecting a variable."); + + // Check that the variable is a composite object where |store_inst| + // dominates all of its loads. + if (!store_inst) { + return nullptr; + } + + // Look at the loads to ensure they are dominated by the store. + if (!HasValidReferencesOnly(var_inst, store_inst)) { + return nullptr; + } + + // If so, look at the store to see if it is the copy of an object. + std::unique_ptr source = GetSourceObjectIfAny( + store_inst->GetSingleWordInOperand(kStoreObjectInOperand)); + + if (!source) { + return nullptr; + } + + // Ensure that |source| does not change between the point at which it is + // loaded, and the position in which |var_inst| is loaded. + // + // For now we will go with the easy to implement approach, and check that the + // entire variable (not just the specific component) is never written to. + + if (!HasNoStores(source->GetVariable())) { + return nullptr; + } + return source; +} + +ir::Instruction* CopyPropagateArrays::FindStoreInstruction( + const ir::Instruction* var_inst) const { + ir::Instruction* store_inst = nullptr; + get_def_use_mgr()->WhileEachUser( + var_inst, [&store_inst, var_inst](ir::Instruction* use) { + if (use->opcode() == SpvOpStore && + use->GetSingleWordInOperand(kStorePointerInOperand) == + var_inst->result_id()) { + if (store_inst == nullptr) { + store_inst = use; + } else { + store_inst = nullptr; + return false; + } + } + return true; + }); + return store_inst; +} + +void CopyPropagateArrays::PropagateObject(ir::Instruction* var_inst, + MemoryObject* source, + ir::Instruction* insertion_point) { + assert(var_inst->opcode() == SpvOpVariable && + "This function propagates variables."); + + ir::Instruction* new_access_chain = + BuildNewAccessChain(insertion_point, source); + context()->KillNamesAndDecorates(var_inst); + UpdateUses(var_inst, new_access_chain); +} + +ir::Instruction* CopyPropagateArrays::BuildNewAccessChain( + ir::Instruction* insertion_point, + CopyPropagateArrays::MemoryObject* source) const { + InstructionBuilder builder(context(), insertion_point, + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping); + + if (source->AccessChain().size() == 0) { + return source->GetVariable(); + } + + return builder.AddAccessChain(source->GetPointerTypeId(), + source->GetVariable()->result_id(), + source->AccessChain()); +} + +bool CopyPropagateArrays::HasNoStores(ir::Instruction* ptr_inst) { + return get_def_use_mgr()->WhileEachUser( + ptr_inst, [this](ir::Instruction* use) { + if (use->opcode() == SpvOpLoad) { + return true; + } else if (use->opcode() == SpvOpAccessChain) { + return HasNoStores(use); + } else if (use->IsDecoration() || use->opcode() == SpvOpName) { + return true; + } else if (use->opcode() == SpvOpStore) { + return false; + } else if (use->opcode() == SpvOpImageTexelPointer) { + return true; + } + // Some other instruction. Be conservative. + return false; + }); +} + +bool CopyPropagateArrays::HasValidReferencesOnly(ir::Instruction* ptr_inst, + ir::Instruction* store_inst) { + ir::BasicBlock* store_block = context()->get_instr_block(store_inst); + opt::DominatorAnalysis* dominator_analysis = + context()->GetDominatorAnalysis(store_block->GetParent(), *cfg()); + + return get_def_use_mgr()->WhileEachUser( + ptr_inst, + [this, store_inst, dominator_analysis, ptr_inst](ir::Instruction* use) { + if (use->opcode() == SpvOpLoad || + use->opcode() == SpvOpImageTexelPointer) { + // TODO: If there are many load in the same BB as |store_inst| the + // time to do the multiple traverses can add up. Consider collecting + // those loads and doing a single traversal. + return dominator_analysis->Dominates(store_inst, use); + } else if (use->opcode() == SpvOpAccessChain) { + return HasValidReferencesOnly(use, store_inst); + } else if (use->IsDecoration() || use->opcode() == SpvOpName) { + return true; + } else if (use->opcode() == SpvOpStore) { + // If we are storing to part of the object it is not an candidate. + return ptr_inst->opcode() == SpvOpVariable && + store_inst->GetSingleWordInOperand(kStorePointerInOperand) == + ptr_inst->result_id(); + } + // Some other instruction. Be conservative. + return false; + }); +} + +std::unique_ptr +CopyPropagateArrays::GetSourceObjectIfAny(uint32_t result) { + ir::Instruction* result_inst = context()->get_def_use_mgr()->GetDef(result); + + switch (result_inst->opcode()) { + case SpvOpLoad: + return BuildMemoryObjectFromLoad(result_inst); + case SpvOpCompositeExtract: + return BuildMemoryObjectFromExtract(result_inst); + case SpvOpCompositeConstruct: + return BuildMemoryObjectFromCompositeConstruct(result_inst); + case SpvOpCopyObject: + return GetSourceObjectIfAny(result_inst->GetSingleWordInOperand(0)); + case SpvOpCompositeInsert: + return BuildMemoryObjectFromInsert(result_inst); + default: + return nullptr; + } +} + +std::unique_ptr +CopyPropagateArrays::BuildMemoryObjectFromLoad(ir::Instruction* load_inst) { + std::vector components_in_reverse; + analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); + + ir::Instruction* current_inst = def_use_mgr->GetDef( + load_inst->GetSingleWordInOperand(kLoadPointerInOperand)); + + // Build the access chain for the memory object by collecting the indices used + // in the OpAccessChain instructions. If we find a variable index, then + // return |nullptr| because we cannot know for sure which memory location is + // used. + // + // It is built in reverse order because the different |OpAccessChain| + // instructions are visited in reverse order from which they are applied. + while (current_inst->opcode() == SpvOpAccessChain) { + for (uint32_t i = current_inst->NumInOperands() - 1; i >= 1; --i) { + uint32_t element_index_id = current_inst->GetSingleWordInOperand(i); + components_in_reverse.push_back(element_index_id); + } + current_inst = def_use_mgr->GetDef(current_inst->GetSingleWordInOperand(0)); + } + + // If the address in the load is not constructed from an |OpVariable| + // instruction followed by a series of |OpAccessChain| instructions, then + // return |nullptr| because we cannot identify the owner or access chain + // exactly. + if (current_inst->opcode() != SpvOpVariable) { + return nullptr; + } + + // Build the memory object. Use |rbegin| and |rend| to put the access chain + // back in the correct order. + return std::unique_ptr( + new MemoryObject(current_inst, components_in_reverse.rbegin(), + components_in_reverse.rend())); +} + +std::unique_ptr +CopyPropagateArrays::BuildMemoryObjectFromExtract( + ir::Instruction* extract_inst) { + assert(extract_inst->opcode() == SpvOpCompositeExtract && + "Expecting an OpCompositeExtract instruction."); + analysis::ConstantManager* const_mgr = context()->get_constant_mgr(); + + std::unique_ptr result = GetSourceObjectIfAny( + extract_inst->GetSingleWordInOperand(kCompositeExtractObjectInOperand)); + + if (result) { + analysis::Integer int_type(32, false); + const analysis::Type* uint32_type = + context()->get_type_mgr()->GetRegisteredType(&int_type); + + std::vector components; + // Convert the indices in the extract instruction to a series of ids that + // can be used by the |OpAccessChain| instruction. + for (uint32_t i = 1; i < extract_inst->NumInOperands(); ++i) { + uint32_t index = extract_inst->GetSingleWordInOperand(1); + const analysis::Constant* index_const = + const_mgr->GetConstant(uint32_type, {index}); + components.push_back( + const_mgr->GetDefiningInstruction(index_const)->result_id()); + } + result->GetMember(components); + return result; + } + return nullptr; +} + +std::unique_ptr +CopyPropagateArrays::BuildMemoryObjectFromCompositeConstruct( + ir::Instruction* conststruct_inst) { + assert(conststruct_inst->opcode() == SpvOpCompositeConstruct && + "Expecting an OpCompositeConstruct instruction."); + + // If every operand in the instruction are part of the same memory object, and + // are being combined in the same order, then the result is the same as the + // parent. + + std::unique_ptr memory_object = + GetSourceObjectIfAny(conststruct_inst->GetSingleWordInOperand(0)); + + if (!memory_object) { + return nullptr; + } + + if (!memory_object->IsMember()) { + return nullptr; + } + + analysis::ConstantManager* const_mgr = context()->get_constant_mgr(); + const analysis::Constant* last_access = + const_mgr->FindDeclaredConstant(memory_object->AccessChain().back()); + if (!last_access || + (!last_access->AsIntConstant() && !last_access->AsNullConstant())) { + return nullptr; + } + + if (last_access->GetU32() != 0) { + return nullptr; + } + + memory_object->GetParent(); + + if (memory_object->GetNumberOfMembers() != + conststruct_inst->NumInOperands()) { + return nullptr; + } + + for (uint32_t i = 1; i < conststruct_inst->NumInOperands(); ++i) { + std::unique_ptr member_object = + GetSourceObjectIfAny(conststruct_inst->GetSingleWordInOperand(i)); + + if (!member_object->IsMember()) { + return nullptr; + } + + if (!memory_object->Contains(member_object.get())) { + return nullptr; + } + + last_access = + const_mgr->FindDeclaredConstant(member_object->AccessChain().back()); + if (!last_access || !last_access->AsIntConstant()) { + return nullptr; + } + + if (last_access->GetU32() != i) { + return nullptr; + } + } + return memory_object; +} + +std::unique_ptr +CopyPropagateArrays::BuildMemoryObjectFromInsert(ir::Instruction* insert_inst) { + assert(insert_inst->opcode() == SpvOpCompositeInsert && + "Expecting an OpCompositeInsert instruction."); + + analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + analysis::ConstantManager* const_mgr = context()->get_constant_mgr(); + const analysis::Type* result_type = type_mgr->GetType(insert_inst->type_id()); + + uint32_t number_of_elements = 0; + if (const analysis::Struct* struct_type = result_type->AsStruct()) { + number_of_elements = + static_cast(struct_type->element_types().size()); + } else if (const analysis::Array* array_type = result_type->AsArray()) { + const analysis::Constant* length_const = + const_mgr->FindDeclaredConstant(array_type->LengthId()); + assert(length_const->AsIntConstant()); + number_of_elements = length_const->AsIntConstant()->GetU32(); + } else if (const analysis::Vector* vector_type = result_type->AsVector()) { + number_of_elements = vector_type->element_count(); + } else if (const analysis::Matrix* matrix_type = result_type->AsMatrix()) { + number_of_elements = matrix_type->element_count(); + } + + if (number_of_elements == 0) { + return nullptr; + } + + if (insert_inst->NumInOperands() != 3) { + return nullptr; + } + + if (insert_inst->GetSingleWordInOperand(2) != number_of_elements - 1) { + return nullptr; + } + + std::unique_ptr memory_object = + GetSourceObjectIfAny(insert_inst->GetSingleWordInOperand(0)); + + if (!memory_object) { + return nullptr; + } + + if (!memory_object->IsMember()) { + return nullptr; + } + + const analysis::Constant* last_access = + const_mgr->FindDeclaredConstant(memory_object->AccessChain().back()); + if (!last_access || !last_access->AsIntConstant()) { + return nullptr; + } + + if (last_access->GetU32() != number_of_elements - 1) { + return nullptr; + } + + memory_object->GetParent(); + + ir::Instruction* current_insert = + def_use_mgr->GetDef(insert_inst->GetSingleWordInOperand(1)); + for (uint32_t i = number_of_elements - 1; i > 0; --i) { + if (current_insert->opcode() != SpvOpCompositeInsert) { + return nullptr; + } + + if (current_insert->NumInOperands() != 3) { + return nullptr; + } + + if (current_insert->GetSingleWordInOperand(2) != i - 1) { + return nullptr; + } + + std::unique_ptr current_memory_object = + GetSourceObjectIfAny(current_insert->GetSingleWordInOperand(0)); + + if (!current_memory_object) { + return nullptr; + } + + if (!current_memory_object->IsMember()) { + return nullptr; + } + + if (memory_object->AccessChain().size() + 1 != + current_memory_object->AccessChain().size()) { + return nullptr; + } + + if (!memory_object->Contains(current_memory_object.get())) { + return nullptr; + } + + const analysis::Constant* current_last_access = + const_mgr->FindDeclaredConstant( + current_memory_object->AccessChain().back()); + if (!current_last_access || !current_last_access->AsIntConstant()) { + return nullptr; + } + + if (current_last_access->GetU32() != i - 1) { + return nullptr; + } + current_insert = + def_use_mgr->GetDef(current_insert->GetSingleWordInOperand(1)); + } + + return memory_object; +} + +bool CopyPropagateArrays::IsPointerToArrayType(uint32_t type_id) { + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + analysis::Pointer* pointer_type = type_mgr->GetType(type_id)->AsPointer(); + if (pointer_type) { + return pointer_type->pointee_type()->kind() == analysis::Type::kArray || + pointer_type->pointee_type()->kind() == analysis::Type::kImage; + } + return false; +} + +bool CopyPropagateArrays::CanUpdateUses(ir::Instruction* original_ptr_inst, + uint32_t type_id) { + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + analysis::ConstantManager* const_mgr = context()->get_constant_mgr(); + analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); + + analysis::Type* type = type_mgr->GetType(type_id); + if (type->AsRuntimeArray()) { + return false; + } + + if (!type->AsStruct() && !type->AsArray() && !type->AsPointer()) { + // If the type is not an aggregate, then the desired type must be the + // same as the current type. No work to do, and we can do that. + return true; + } + + return def_use_mgr->WhileEachUse( + original_ptr_inst, + [this, type_mgr, const_mgr, type](ir::Instruction* use, uint32_t) { + switch (use->opcode()) { + case SpvOpLoad: { + analysis::Pointer* pointer_type = type->AsPointer(); + uint32_t new_type_id = + type_mgr->GetId(pointer_type->pointee_type()); + + if (new_type_id != use->type_id()) { + return CanUpdateUses(use, new_type_id); + } + return true; + } + case SpvOpAccessChain: { + analysis::Pointer* pointer_type = type->AsPointer(); + const analysis::Type* pointee_type = pointer_type->pointee_type(); + + std::vector access_chain; + for (uint32_t i = 1; i < use->NumInOperands(); ++i) { + const analysis::Constant* index_const = + const_mgr->FindDeclaredConstant( + use->GetSingleWordInOperand(i)); + if (index_const) { + access_chain.push_back(index_const->AsIntConstant()->GetU32()); + } else { + // Variable index means the type is a type where every element + // is the same type. Use element 0 to get the type. + access_chain.push_back(0); + } + } + + const analysis::Type* new_pointee_type = + type_mgr->GetMemberType(pointee_type, access_chain); + opt::analysis::Pointer pointerTy(new_pointee_type, + pointer_type->storage_class()); + uint32_t new_pointer_type_id = + context()->get_type_mgr()->GetTypeInstruction(&pointerTy); + + if (new_pointer_type_id != use->type_id()) { + return CanUpdateUses(use, new_pointer_type_id); + } + return true; + } + case SpvOpCompositeExtract: { + std::vector access_chain; + for (uint32_t i = 1; i < use->NumInOperands(); ++i) { + access_chain.push_back(use->GetSingleWordInOperand(i)); + } + + const analysis::Type* new_type = + type_mgr->GetMemberType(type, access_chain); + uint32_t new_type_id = type_mgr->GetTypeInstruction(new_type); + + if (new_type_id != use->type_id()) { + return CanUpdateUses(use, new_type_id); + } + return true; + } + case SpvOpStore: + // Can't handle changing the type of a store. There are too many + // other things that might need to change as well. Not worth the + // effort. Punting for now. + + // TODO (s-perron): This can be handled by expanding the store into + // a series of extracts, composite constructs, and a store. + return true; + case SpvOpImageTexelPointer: + case SpvOpName: + return true; + default: + return use->IsDecoration(); + } + }); +} +void CopyPropagateArrays::UpdateUses(ir::Instruction* original_ptr_inst, + ir::Instruction* new_ptr_inst) { + // TODO (s-perron): Keep the def-use manager up to date. Not done now because + // it can cause problems for the |ForEachUse| traversals. Can be use by + // keeping a list of instructions that need updating, and then updating them + // in |PropagateObject|. + + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + analysis::ConstantManager* const_mgr = context()->get_constant_mgr(); + analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); + + std::vector > uses; + def_use_mgr->ForEachUse(original_ptr_inst, + [&uses](ir::Instruction* use, uint32_t index) { + uses.push_back({use, index}); + }); + + for (auto pair : uses) { + ir::Instruction* use = pair.first; + uint32_t index = pair.second; + analysis::Pointer* pointer_type = nullptr; + switch (use->opcode()) { + case SpvOpLoad: { + // Replace the actual use. + context()->ForgetUses(use); + use->SetOperand(index, {new_ptr_inst->result_id()}); + + // Update the type. + pointer_type = type_mgr->GetType(new_ptr_inst->type_id())->AsPointer(); + uint32_t new_type_id = type_mgr->GetId(pointer_type->pointee_type()); + if (new_type_id != use->type_id()) { + use->SetResultType(new_type_id); + context()->AnalyzeUses(use); + UpdateUses(use, use); + } else { + context()->AnalyzeUses(use); + } + } break; + case SpvOpAccessChain: { + // Update the actual use. + context()->ForgetUses(use); + use->SetOperand(index, {new_ptr_inst->result_id()}); + + // Update the result type. + pointer_type = type_mgr->GetType(new_ptr_inst->type_id())->AsPointer(); + const analysis::Type* pointee_type = pointer_type->pointee_type(); + + // Convert the ids on the OpAccessChain to indices that can be used to + // get the specific member. + std::vector access_chain; + for (uint32_t i = 1; i < use->NumInOperands(); ++i) { + const analysis::Constant* index_const = + const_mgr->FindDeclaredConstant(use->GetSingleWordInOperand(i)); + if (index_const) { + access_chain.push_back(index_const->AsIntConstant()->GetU32()); + } else { + // Variable index means the type is an type where every element + // is the same type. Use element 0 to get the type. + access_chain.push_back(0); + } + } + const analysis::Type* new_pointee_type = + type_mgr->GetMemberType(pointee_type, access_chain); + + // Now build a pointer to the type of the member. + opt::analysis::Pointer new_pointer_type(new_pointee_type, + pointer_type->storage_class()); + uint32_t new_pointer_type_id = + context()->get_type_mgr()->GetTypeInstruction(&new_pointer_type); + + if (new_pointer_type_id != use->type_id()) { + use->SetResultType(new_pointer_type_id); + context()->AnalyzeUses(use); + UpdateUses(use, use); + } else { + context()->AnalyzeUses(use); + } + } break; + case SpvOpCompositeExtract: { + // Update the actual use. + context()->ForgetUses(use); + use->SetOperand(index, {new_ptr_inst->result_id()}); + + std::vector access_chain; + for (uint32_t i = 1; i < use->NumInOperands(); ++i) { + access_chain.push_back(use->GetSingleWordInOperand(i)); + } + + const analysis::Type* type = type_mgr->GetType(new_ptr_inst->type_id()); + const analysis::Type* new_type = + type_mgr->GetMemberType(type, access_chain); + uint32_t new_type_id = type_mgr->GetTypeInstruction(new_type); + + if (new_type_id != use->type_id()) { + use->SetResultType(new_type_id); + context()->AnalyzeUses(use); + UpdateUses(use, use); + } else { + context()->AnalyzeUses(use); + } + } break; + case SpvOpStore: + // If the use is the pointer, then it is the single store to that + // variable. We do not want to replace it. Instead, it will become + // dead after all of the loads are removed, and ADCE will get rid of it. + // + // If the use is the object being stored, we will create a copy of the + // object turning it into the correct type. The copy is done by + // decomposing the object into the base type, which must be the same, + // and then rebuilding them. + if (index == 1) { + ir::Instruction* target_pointer = def_use_mgr->GetDef( + use->GetSingleWordInOperand(kStorePointerInOperand)); + pointer_type = + type_mgr->GetType(target_pointer->type_id())->AsPointer(); + uint32_t copy = + GenerateCopy(original_ptr_inst, + type_mgr->GetId(pointer_type->pointee_type()), use); + + context()->ForgetUses(use); + use->SetInOperand(index, {copy}); + context()->AnalyzeUses(use); + } + break; + case SpvOpImageTexelPointer: + // We treat an OpImageTexelPointer as a load. The result type should + // always have the Image storage class, and should not need to be + // updated. + + // Replace the actual use. + context()->ForgetUses(use); + use->SetOperand(index, {new_ptr_inst->result_id()}); + context()->AnalyzeUses(use); + break; + default: + assert(false && "Don't know how to rewrite instruction"); + break; + } + } +} + +uint32_t CopyPropagateArrays::GenerateCopy( + ir::Instruction* object_inst, uint32_t new_type_id, + ir::Instruction* insertion_position) { + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + analysis::ConstantManager* const_mgr = context()->get_constant_mgr(); + + uint32_t original_type_id = object_inst->type_id(); + if (original_type_id == new_type_id) { + return object_inst->result_id(); + } + + opt::InstructionBuilder ir_builder( + context(), insertion_position, + ir::IRContext::kAnalysisInstrToBlockMapping | + ir::IRContext::kAnalysisDefUse); + + analysis::Type* original_type = type_mgr->GetType(original_type_id); + analysis::Type* new_type = type_mgr->GetType(new_type_id); + + if (const analysis::Array* original_array_type = original_type->AsArray()) { + uint32_t original_element_type_id = + type_mgr->GetId(original_array_type->element_type()); + + analysis::Array* new_array_type = new_type->AsArray(); + assert(new_array_type != nullptr && "Can't copy an array to a non-array."); + uint32_t new_element_type_id = + type_mgr->GetId(new_array_type->element_type()); + + std::vector element_ids; + const analysis::Constant* length_const = + const_mgr->FindDeclaredConstant(original_array_type->LengthId()); + assert(length_const->AsIntConstant()); + uint32_t array_length = length_const->AsIntConstant()->GetU32(); + for (uint32_t i = 0; i < array_length; i++) { + ir::Instruction* extract = ir_builder.AddCompositeExtract( + original_element_type_id, object_inst->result_id(), {i}); + element_ids.push_back( + GenerateCopy(extract, new_element_type_id, insertion_position)); + } + + return ir_builder.AddCompositeConstruct(new_type_id, element_ids) + ->result_id(); + } else if (const analysis::Struct* original_struct_type = + original_type->AsStruct()) { + analysis::Struct* new_struct_type = new_type->AsStruct(); + + const std::vector& original_types = + original_struct_type->element_types(); + const std::vector& new_types = + new_struct_type->element_types(); + std::vector element_ids; + for (uint32_t i = 0; i < original_types.size(); i++) { + ir::Instruction* extract = ir_builder.AddCompositeExtract( + type_mgr->GetId(original_types[i]), object_inst->result_id(), {i}); + element_ids.push_back(GenerateCopy(extract, type_mgr->GetId(new_types[i]), + insertion_position)); + } + return ir_builder.AddCompositeConstruct(new_type_id, element_ids) + ->result_id(); + } else { + // If we do not have an aggregate type, then we have a problem. Either we + // found multiple instances of the same type, or we are copying to an + // incompatible type. Either way the code is illegal. + assert(false && + "Don't know how to copy this type. Code is likely illegal."); + } + return 0; +} + +void CopyPropagateArrays::MemoryObject::GetMember( + const std::vector& access_chain) { + access_chain_.insert(access_chain_.end(), access_chain.begin(), + access_chain.end()); +} + +uint32_t CopyPropagateArrays::MemoryObject::GetNumberOfMembers() { + ir::IRContext* context = variable_inst_->context(); + analysis::TypeManager* type_mgr = context->get_type_mgr(); + + const analysis::Type* type = type_mgr->GetType(variable_inst_->type_id()); + type = type->AsPointer()->pointee_type(); + + std::vector access_indices = GetAccessIds(); + type = type_mgr->GetMemberType(type, access_indices); + + if (const analysis::Struct* struct_type = type->AsStruct()) { + return static_cast(struct_type->element_types().size()); + } else if (const analysis::Array* array_type = type->AsArray()) { + const analysis::Constant* length_const = + context->get_constant_mgr()->FindDeclaredConstant( + array_type->LengthId()); + assert(length_const->AsIntConstant()); + return length_const->AsIntConstant()->GetU32(); + } else if (const analysis::Vector* vector_type = type->AsVector()) { + return vector_type->element_count(); + } else if (const analysis::Matrix* matrix_type = type->AsMatrix()) { + return matrix_type->element_count(); + } else { + return 0; + } +} + +template +CopyPropagateArrays::MemoryObject::MemoryObject(ir::Instruction* var_inst, + iterator begin, iterator end) + : variable_inst_(var_inst), access_chain_(begin, end) {} + +std::vector CopyPropagateArrays::MemoryObject::GetAccessIds() const { + analysis::ConstantManager* const_mgr = + variable_inst_->context()->get_constant_mgr(); + + std::vector access_indices; + for (uint32_t id : AccessChain()) { + const analysis::Constant* element_index_const = + const_mgr->FindDeclaredConstant(id); + if (!element_index_const) { + access_indices.push_back(0); + } else { + assert(element_index_const->AsIntConstant()); + access_indices.push_back(element_index_const->AsIntConstant()->GetU32()); + } + } + return access_indices; +} + +bool CopyPropagateArrays::MemoryObject::Contains( + CopyPropagateArrays::MemoryObject* other) { + if (this->GetVariable() != other->GetVariable()) { + return false; + } + + if (AccessChain().size() > other->AccessChain().size()) { + return false; + } + + for (uint32_t i = 0; i < AccessChain().size(); i++) { + if (AccessChain()[i] != other->AccessChain()[i]) { + return false; + } + } + return true; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/copy_prop_arrays.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/copy_prop_arrays.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/copy_prop_arrays.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/copy_prop_arrays.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,231 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_COPY_PROP_H_ +#define LIBSPIRV_OPT_COPY_PROP_H_ + +#include "mem_pass.h" + +namespace spvtools { +namespace opt { + +// This pass implements a simple array copy propagation. It does not do a full +// array data flow. It looks for simple cases that meet the following +// conditions: +// +// 1) The source must never be stored to. +// 2) The target must be stored to exactly once. +// 3) The store to the target must be a store to the entire array, and be a +// copy of the entire source. +// 4) All loads of the target must be dominated by the store. +// +// The hard part is keeping all of the types correct. We do not want to +// have to do too large a search to update everything, which may not be +// possible, do we give up if we see any instruction that might be hard to +// update. + +class CopyPropagateArrays : public MemPass { + public: + const char* name() const override { return "copy-propagate-arrays"; } + Status Process(ir::IRContext*) override; + + ir::IRContext::Analysis GetPreservedAnalyses() override { + return ir::IRContext::kAnalysisDefUse | ir::IRContext::kAnalysisCFG | + ir::IRContext::kAnalysisInstrToBlockMapping | + ir::IRContext::kAnalysisLoopAnalysis | + ir::IRContext::kAnalysisDecorations | + ir::IRContext::kAnalysisDominatorAnalysis | + ir::IRContext::kAnalysisNameMap; + } + + private: + // The class used to identify a particular memory object. This memory object + // will be owned by a particular variable, meaning that the memory is part of + // that variable. It could be the entire variable or a member of the + // variable. + class MemoryObject { + public: + // Construction a memory object that is owned by |var_inst|. The iterator + // |begin| and |end| traverse a container of integers that identify which + // member of |var_inst| this memory object will represent. These integers + // are interpreted the same way they would be in an |OpAccessChain| + // instruction. + template + MemoryObject(ir::Instruction* var_inst, iterator begin, iterator end); + + // Change |this| to now point to the member identified by |access_chain| + // (starting from the current member). The elements in |access_chain| are + // interpreted the same as the indices in the |OpAccessChain| + // instruction. + void GetMember(const std::vector& access_chain); + + // Change |this| to now represent the first enclosing object to which it + // belongs. (Remove the last element off the access_chain). It is invalid + // to call this function if |this| does not represent a member of its owner. + void GetParent() { + assert(IsMember()); + access_chain_.pop_back(); + } + + // Returns true if |this| represents a member of its owner, and not the + // entire variable. + bool IsMember() const { return !access_chain_.empty(); } + + // Returns the number of members in the object represented by |this|. If + // |this| does not represent a composite type, the return value will be 0. + uint32_t GetNumberOfMembers(); + + // Returns the owning variable that the memory object is contained in. + ir::Instruction* GetVariable() const { return variable_inst_; } + + // Returns a vector of integers that can be used to access the specific + // member that |this| represents starting from the owning variable. These + // values are to be interpreted the same way the indices are in an + // |OpAccessChain| instruction. + const std::vector& AccessChain() const { return access_chain_; } + + // Returns the type id of the pointer type that can be used to point to this + // memory object. + uint32_t GetPointerTypeId() const { + analysis::TypeManager* type_mgr = + GetVariable()->context()->get_type_mgr(); + const analysis::Pointer* pointer_type = + type_mgr->GetType(GetVariable()->type_id())->AsPointer(); + const analysis::Type* var_type = pointer_type->pointee_type(); + const analysis::Type* member_type = + type_mgr->GetMemberType(var_type, GetAccessIds()); + uint32_t member_type_id = type_mgr->GetId(member_type); + assert(member_type != 0); + uint32_t member_pointer_type_id = type_mgr->FindPointerToType( + member_type_id, pointer_type->storage_class()); + return member_pointer_type_id; + } + + // Returns the storage class of the memory object. + SpvStorageClass GetStorageClass() const { + analysis::TypeManager* type_mgr = + GetVariable()->context()->get_type_mgr(); + const analysis::Pointer* pointer_type = + type_mgr->GetType(GetVariable()->type_id())->AsPointer(); + return pointer_type->storage_class(); + } + + // Returns true if |other| represents memory that is contains inside of the + // memory represented by |this|. + bool Contains(MemoryObject* other); + + private: + // The variable that owns this memory object. + ir::Instruction* variable_inst_; + + // The access chain to reach the particular member the memory object + // represents. It should be interpreted the same way the indices in an + // |OpAccessChain| are interpreted. + std::vector access_chain_; + std::vector GetAccessIds() const; + }; + + // Returns the memory object being stored to |var_inst| in the store + // instruction |store_inst|, if one exists, that can be used in place of + // |var_inst| in all of the loads of |var_inst|. This code is conservative + // and only identifies very simple cases. If no such memory object can be + // found, the return value is |nullptr|. + std::unique_ptr FindSourceObjectIfPossible( + ir::Instruction* var_inst, ir::Instruction* store_inst); + + // Replaces all loads of |var_inst| with a load from |source| instead. + // |insertion_pos| is a position where it is possible to construct the + // address of |source| and also dominates all of the loads of |var_inst|. + void PropagateObject(ir::Instruction* var_inst, MemoryObject* source, + ir::Instruction* insertion_pos); + + // Returns true if all of the references to |ptr_inst| can be rewritten and + // are dominated by |store_inst|. + bool HasValidReferencesOnly(ir::Instruction* ptr_inst, + ir::Instruction* store_inst); + + // Returns a memory object that at one time was equivalent to the value in + // |result|. If no such memory object exists, the return value is |nullptr|. + std::unique_ptr GetSourceObjectIfAny(uint32_t result); + + // Returns the memory object that is loaded by |load_inst|. If a memory + // object cannot be identified, the return value is |nullptr|. The opcode of + // |load_inst| must be |OpLoad|. + std::unique_ptr BuildMemoryObjectFromLoad( + ir::Instruction* load_inst); + + // Returns the memory object that at some point was equivalent to the result + // of |extract_inst|. If a memory object cannot be identified, the return + // value is |nullptr|. The opcode of |extract_inst| must be + // |OpCompositeExtract|. + std::unique_ptr BuildMemoryObjectFromExtract( + ir::Instruction* extract_inst); + + // Returns the memory object that at some point was equivalent to the result + // of |construct_inst|. If a memory object cannot be identified, the return + // value is |nullptr|. The opcode of |constuct_inst| must be + // |OpCompositeConstruct|. + std::unique_ptr BuildMemoryObjectFromCompositeConstruct( + ir::Instruction* conststruct_inst); + + // Returns the memory object that at some point was equivalent to the result + // of |insert_inst|. If a memory object cannot be identified, the return + // value is |nullptr\. The opcode of |insert_inst| must be + // |OpCompositeInsert|. This function looks for a series of + // |OpCompositeInsert| instructions that insert the elements one at a time in + // order from beginning to end. + std::unique_ptr BuildMemoryObjectFromInsert( + ir::Instruction* insert_inst); + + // Return true if |type_id| is a pointer type whose pointee type is an array. + bool IsPointerToArrayType(uint32_t type_id); + + // Returns true of there are not stores using |ptr_inst| or something derived + // from it. + bool HasNoStores(ir::Instruction* ptr_inst); + + // Creates an |OpAccessChain| instruction whose result is a pointer the memory + // represented by |source|. The new instruction will be placed before + // |insertion_point|. |insertion_point| must be part of a function. Returns + // the new instruction. + ir::Instruction* BuildNewAccessChain(ir::Instruction* insertion_point, + MemoryObject* source) const; + + // Rewrites all uses of |original_ptr| to use |new_pointer_inst| updating + // types of other instructions as needed. This function should not be called + // if |CanUpdateUses(original_ptr_inst, new_pointer_inst->type_id())| returns + // false. + void UpdateUses(ir::Instruction* original_ptr_inst, + ir::Instruction* new_pointer_inst); + + // Return true if |UpdateUses| is able to change all of the uses of + // |original_ptr_inst| to |type_id| and still have valid code. + bool CanUpdateUses(ir::Instruction* original_ptr_inst, uint32_t type_id); + + // Returns the id whose value is the same as |object_to_copy| except its type + // is |new_type_id|. Any instructions need to generate this value will be + // inserted before |insertion_position|. + uint32_t GenerateCopy(ir::Instruction* object_to_copy, uint32_t new_type_id, + ir::Instruction* insertion_position); + + // Returns a store to |var_inst| that writes to the entire variable, and is + // the only store that does so. Note it does not look through OpAccessChain + // instruction, so partial stores are not considered. + ir::Instruction* FindStoreInstruction(const ir::Instruction* var_inst) const; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_COPY_PROP_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dead_branch_elim_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dead_branch_elim_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dead_branch_elim_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dead_branch_elim_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,394 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 2017 LunarG Inc. +// Copyright (c) 2018 Google 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. + +#include "dead_branch_elim_pass.h" + +#include "cfa.h" +#include "ir_context.h" +#include "iterator.h" +#include "make_unique.h" + +namespace spvtools { +namespace opt { + +namespace { + +const uint32_t kBranchCondTrueLabIdInIdx = 1; +const uint32_t kBranchCondFalseLabIdInIdx = 2; + +} // anonymous namespace + +bool DeadBranchElimPass::GetConstCondition(uint32_t condId, bool* condVal) { + bool condIsConst; + ir::Instruction* cInst = get_def_use_mgr()->GetDef(condId); + switch (cInst->opcode()) { + case SpvOpConstantFalse: { + *condVal = false; + condIsConst = true; + } break; + case SpvOpConstantTrue: { + *condVal = true; + condIsConst = true; + } break; + case SpvOpLogicalNot: { + bool negVal; + condIsConst = + GetConstCondition(cInst->GetSingleWordInOperand(0), &negVal); + if (condIsConst) *condVal = !negVal; + } break; + default: { condIsConst = false; } break; + } + return condIsConst; +} + +bool DeadBranchElimPass::GetConstInteger(uint32_t selId, uint32_t* selVal) { + ir::Instruction* sInst = get_def_use_mgr()->GetDef(selId); + uint32_t typeId = sInst->type_id(); + ir::Instruction* typeInst = get_def_use_mgr()->GetDef(typeId); + if (!typeInst || (typeInst->opcode() != SpvOpTypeInt)) return false; + // TODO(greg-lunarg): Support non-32 bit ints + if (typeInst->GetSingleWordInOperand(0) != 32) return false; + if (sInst->opcode() == SpvOpConstant) { + *selVal = sInst->GetSingleWordInOperand(0); + return true; + } else if (sInst->opcode() == SpvOpConstantNull) { + *selVal = 0; + return true; + } + return false; +} + +void DeadBranchElimPass::AddBranch(uint32_t labelId, ir::BasicBlock* bp) { + assert(get_def_use_mgr()->GetDef(labelId) != nullptr); + std::unique_ptr newBranch(new ir::Instruction( + context(), SpvOpBranch, 0, 0, + {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {labelId}}})); + get_def_use_mgr()->AnalyzeInstDefUse(&*newBranch); + bp->AddInstruction(std::move(newBranch)); +} + +ir::BasicBlock* DeadBranchElimPass::GetParentBlock(uint32_t id) { + return context()->get_instr_block(get_def_use_mgr()->GetDef(id)); +} + +bool DeadBranchElimPass::MarkLiveBlocks( + ir::Function* func, std::unordered_set* live_blocks) { + std::unordered_set continues; + std::vector stack; + stack.push_back(&*func->begin()); + bool modified = false; + while (!stack.empty()) { + ir::BasicBlock* block = stack.back(); + stack.pop_back(); + + // Live blocks doubles as visited set. + if (!live_blocks->insert(block).second) continue; + + uint32_t cont_id = block->ContinueBlockIdIfAny(); + if (cont_id != 0) continues.insert(GetParentBlock(cont_id)); + + ir::Instruction* terminator = block->terminator(); + uint32_t live_lab_id = 0; + // Check if the terminator has a single valid successor. + if (terminator->opcode() == SpvOpBranchConditional) { + bool condVal; + if (GetConstCondition(terminator->GetSingleWordInOperand(0u), &condVal)) { + live_lab_id = terminator->GetSingleWordInOperand( + condVal ? kBranchCondTrueLabIdInIdx : kBranchCondFalseLabIdInIdx); + } + } else if (terminator->opcode() == SpvOpSwitch) { + uint32_t sel_val; + if (GetConstInteger(terminator->GetSingleWordInOperand(0u), &sel_val)) { + // Search switch operands for selector value, set live_lab_id to + // corresponding label, use default if not found. + uint32_t icnt = 0; + uint32_t case_val; + terminator->WhileEachInOperand( + [&icnt, &case_val, &sel_val, &live_lab_id](const uint32_t* idp) { + if (icnt == 1) { + // Start with default label. + live_lab_id = *idp; + } else if (icnt > 1) { + if (icnt % 2 == 0) { + case_val = *idp; + } else { + if (case_val == sel_val) { + live_lab_id = *idp; + return false; + } + } + } + ++icnt; + return true; + }); + } + } + + // Don't simplify branches of continue blocks. A path from the continue to + // the header is required. + // TODO(alan-baker): They can be simplified iff there remains a path to the + // backedge. Structured control flow should guarantee one path hits the + // backedge, but I've removed the requirement for structured control flow + // from this pass. + bool simplify = live_lab_id != 0 && !continues.count(block); + + if (simplify) { + modified = true; + // Replace with unconditional branch. + // Remove the merge instruction if it is a selection merge. + AddBranch(live_lab_id, block); + context()->KillInst(terminator); + ir::Instruction* mergeInst = block->GetMergeInst(); + if (mergeInst && mergeInst->opcode() == SpvOpSelectionMerge) { + context()->KillInst(mergeInst); + } + stack.push_back(GetParentBlock(live_lab_id)); + } else { + // All successors are live. + const auto* const_block = block; + const_block->ForEachSuccessorLabel([&stack, this](const uint32_t label) { + stack.push_back(GetParentBlock(label)); + }); + } + } + + return modified; +} + +void DeadBranchElimPass::MarkUnreachableStructuredTargets( + const std::unordered_set& live_blocks, + std::unordered_set* unreachable_merges, + std::unordered_map* + unreachable_continues) { + for (auto block : live_blocks) { + if (auto merge_id = block->MergeBlockIdIfAny()) { + ir::BasicBlock* merge_block = GetParentBlock(merge_id); + if (!live_blocks.count(merge_block)) { + unreachable_merges->insert(merge_block); + } + if (auto cont_id = block->ContinueBlockIdIfAny()) { + ir::BasicBlock* cont_block = GetParentBlock(cont_id); + if (!live_blocks.count(cont_block)) { + (*unreachable_continues)[cont_block] = block; + } + } + } + } +} + +bool DeadBranchElimPass::FixPhiNodesInLiveBlocks( + ir::Function* func, const std::unordered_set& live_blocks, + const std::unordered_map& + unreachable_continues) { + bool modified = false; + for (auto& block : *func) { + if (live_blocks.count(&block)) { + for (auto iter = block.begin(); iter != block.end();) { + if (iter->opcode() != SpvOpPhi) { + break; + } + + bool changed = false; + bool backedge_added = false; + ir::Instruction* inst = &*iter; + std::vector operands; + // Build a complete set of operands (not just input operands). Start + // with type and result id operands. + operands.push_back(inst->GetOperand(0u)); + operands.push_back(inst->GetOperand(1u)); + // Iterate through the incoming labels and determine which to keep + // and/or modify. If there in an unreachable continue block, there will + // be an edge from that block to the header. We need to keep it to + // maintain the structured control flow. If the header has more that 2 + // incoming edges, then the OpPhi must have an entry for that edge. + // However, if there is only one other incoming edge, the OpPhi can be + // eliminated. + for (uint32_t i = 1; i < inst->NumInOperands(); i += 2) { + ir::BasicBlock* inc = GetParentBlock(inst->GetSingleWordInOperand(i)); + auto cont_iter = unreachable_continues.find(inc); + if (cont_iter != unreachable_continues.end() && + cont_iter->second == &block && inst->NumInOperands() > 4) { + if (get_def_use_mgr() + ->GetDef(inst->GetSingleWordInOperand(i - 1)) + ->opcode() == SpvOpUndef) { + // Already undef incoming value, no change necessary. + operands.push_back(inst->GetInOperand(i - 1)); + operands.push_back(inst->GetInOperand(i)); + backedge_added = true; + } else { + // Replace incoming value with undef if this phi exists in the + // loop header. Otherwise, this edge is not live since the + // unreachable continue block will be replaced with an + // unconditional branch to the header only. + operands.emplace_back( + SPV_OPERAND_TYPE_ID, + std::initializer_list{Type2Undef(inst->type_id())}); + operands.push_back(inst->GetInOperand(i)); + changed = true; + backedge_added = true; + } + } else if (live_blocks.count(inc) && inc->IsSuccessor(&block)) { + // Keep live incoming edge. + operands.push_back(inst->GetInOperand(i - 1)); + operands.push_back(inst->GetInOperand(i)); + } else { + // Remove incoming edge. + changed = true; + } + } + + if (changed) { + modified = true; + uint32_t continue_id = block.ContinueBlockIdIfAny(); + if (!backedge_added && continue_id != 0 && + unreachable_continues.count(GetParentBlock(continue_id)) && + operands.size() > 4) { + // Changed the backedge to branch from the continue block instead + // of a successor of the continue block. Add an entry to the phi to + // provide an undef for the continue block. Since the successor of + // the continue must also be unreachable (dominated by the continue + // block), any entry for the original backedge has been removed + // from the phi operands. + operands.emplace_back( + SPV_OPERAND_TYPE_ID, + std::initializer_list{Type2Undef(inst->type_id())}); + operands.emplace_back(SPV_OPERAND_TYPE_ID, + std::initializer_list{continue_id}); + } + + // Either replace the phi with a single value or rebuild the phi out + // of |operands|. + // + // We always have type and result id operands. So this phi has a + // single source if there are two more operands beyond those. + if (operands.size() == 4) { + // First input data operands is at index 2. + uint32_t replId = operands[2u].words[0]; + context()->ReplaceAllUsesWith(inst->result_id(), replId); + iter = context()->KillInst(&*inst); + } else { + // We've rewritten the operands, so first instruct the def/use + // manager to forget uses in the phi before we replace them. After + // replacing operands update the def/use manager by re-analyzing + // the used ids in this phi. + get_def_use_mgr()->EraseUseRecordsOfOperandIds(inst); + inst->ReplaceOperands(operands); + get_def_use_mgr()->AnalyzeInstUse(inst); + ++iter; + } + } else { + ++iter; + } + } + } + } + + return modified; +} + +bool DeadBranchElimPass::EraseDeadBlocks( + ir::Function* func, const std::unordered_set& live_blocks, + const std::unordered_set& unreachable_merges, + const std::unordered_map& + unreachable_continues) { + bool modified = false; + for (auto ebi = func->begin(); ebi != func->end();) { + if (unreachable_merges.count(&*ebi)) { + if (ebi->begin() != ebi->tail() || + ebi->terminator()->opcode() != SpvOpUnreachable) { + // Make unreachable, but leave the label. + KillAllInsts(&*ebi, false); + // Add unreachable terminator. + ebi->AddInstruction( + MakeUnique(context(), SpvOpUnreachable, 0, 0, + std::initializer_list{})); + modified = true; + } + ++ebi; + } else if (unreachable_continues.count(&*ebi)) { + uint32_t cont_id = unreachable_continues.find(&*ebi)->second->id(); + if (ebi->begin() != ebi->tail() || + ebi->terminator()->opcode() != SpvOpBranch || + ebi->terminator()->GetSingleWordInOperand(0u) != cont_id) { + // Make unreachable, but leave the label. + KillAllInsts(&*ebi, false); + // Add unconditional branch to header. + assert(unreachable_continues.count(&*ebi)); + ebi->AddInstruction( + MakeUnique(context(), SpvOpBranch, 0, 0, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {cont_id}}})); + get_def_use_mgr()->AnalyzeInstUse(&*ebi->tail()); + modified = true; + } + ++ebi; + } else if (!live_blocks.count(&*ebi)) { + // Kill this block. + KillAllInsts(&*ebi); + ebi = ebi.Erase(); + modified = true; + } else { + ++ebi; + } + } + + return modified; +} + +bool DeadBranchElimPass::EliminateDeadBranches(ir::Function* func) { + bool modified = false; + std::unordered_set live_blocks; + modified |= MarkLiveBlocks(func, &live_blocks); + + std::unordered_set unreachable_merges; + std::unordered_map unreachable_continues; + MarkUnreachableStructuredTargets(live_blocks, &unreachable_merges, + &unreachable_continues); + modified |= FixPhiNodesInLiveBlocks(func, live_blocks, unreachable_continues); + modified |= EraseDeadBlocks(func, live_blocks, unreachable_merges, + unreachable_continues); + + return modified; +} + +void DeadBranchElimPass::Initialize(ir::IRContext* c) { + InitializeProcessing(c); +} + +Pass::Status DeadBranchElimPass::ProcessImpl() { + // Do not process if module contains OpGroupDecorate. Additional + // support required in KillNamesAndDecorates(). + // TODO(greg-lunarg): Add support for OpGroupDecorate + for (auto& ai : get_module()->annotations()) + if (ai.opcode() == SpvOpGroupDecorate) return Status::SuccessWithoutChange; + // Process all entry point functions + ProcessFunction pfn = [this](ir::Function* fp) { + return EliminateDeadBranches(fp); + }; + bool modified = ProcessReachableCallTree(pfn, context()); + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +DeadBranchElimPass::DeadBranchElimPass() {} + +Pass::Status DeadBranchElimPass::Process(ir::IRContext* module) { + Initialize(module); + return ProcessImpl(); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dead_branch_elim_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dead_branch_elim_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dead_branch_elim_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dead_branch_elim_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,138 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#ifndef LIBSPIRV_OPT_DEAD_BRANCH_ELIM_PASS_H_ +#define LIBSPIRV_OPT_DEAD_BRANCH_ELIM_PASS_H_ + +#include +#include +#include +#include +#include +#include + +#include "basic_block.h" +#include "def_use_manager.h" +#include "mem_pass.h" +#include "module.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class DeadBranchElimPass : public MemPass { + using cbb_ptr = const ir::BasicBlock*; + + public: + DeadBranchElimPass(); + const char* name() const override { return "eliminate-dead-branches"; } + Status Process(ir::IRContext* context) override; + + ir::IRContext::Analysis GetPreservedAnalyses() override { + return ir::IRContext::kAnalysisDefUse; + } + + private: + // If |condId| is boolean constant, return conditional value in |condVal| and + // return true, otherwise return false. + bool GetConstCondition(uint32_t condId, bool* condVal); + + // If |valId| is a 32-bit integer constant, return value via |value| and + // return true, otherwise return false. + bool GetConstInteger(uint32_t valId, uint32_t* value); + + // Add branch to |labelId| to end of block |bp|. + void AddBranch(uint32_t labelId, ir::BasicBlock* bp); + + // For function |func|, look for BranchConditionals with constant condition + // and convert to a Branch to the indicated label. Delete resulting dead + // blocks. Note some such branches and blocks may be left to avoid creating + // invalid control flow. + // TODO(greg-lunarg): Remove remaining constant conditional branches and dead + // blocks. + bool EliminateDeadBranches(ir::Function* func); + + // Returns the basic block containing |id|. + // Note: this pass only requires correct instruction block mappings for the + // input. This pass does not preserve the block mapping, so it is not kept + // up-to-date during processing. + ir::BasicBlock* GetParentBlock(uint32_t id); + + // Marks live blocks reachable from the entry of |func|. Simplifies constant + // branches and switches as it proceeds, to limit the number of live blocks. + // It is careful not to eliminate backedges even if they are dead, but the + // header is live. Likewise, unreachable merge blocks named in live merge + // instruction must be retained (though they may be clobbered). + bool MarkLiveBlocks(ir::Function* func, + std::unordered_set* live_blocks); + + // Checks for unreachable merge and continue blocks with live headers; those + // blocks must be retained. Continues are tracked separately so that a live + // phi can be updated to take an undef value from any of its predecessors + // that are unreachable continues. + // + // |unreachable_continues| maps the id of an unreachable continue target to + // the header block that declares it. + void MarkUnreachableStructuredTargets( + const std::unordered_set& live_blocks, + std::unordered_set* unreachable_merges, + std::unordered_map* + unreachable_continues); + + // Fix phis in reachable blocks so that only live (or unremovable) incoming + // edges are present. If the block now only has a single live incoming edge, + // remove the phi and replace its uses with its data input. If the single + // remaining incoming edge is from the phi itself, the the phi is in an + // unreachable single block loop. Either the block is dead and will be + // removed, or it's reachable from an unreachable continue target. In the + // latter case that continue target block will be collapsed into a block that + // only branches back to its header and we'll eliminate the block with the + // phi. + // + // |unreachable_continues| maps continue targets that cannot be reached to + // merge instruction that declares them. + bool FixPhiNodesInLiveBlocks( + ir::Function* func, + const std::unordered_set& live_blocks, + const std::unordered_map& + unreachable_continues); + + // Erases dead blocks. Any block captured in |unreachable_merges| or + // |unreachable_continues| is a dead block that is required to remain due to + // a live merge instruction in the corresponding header. These blocks will + // have their instructions clobbered and will become a label and terminator. + // Unreachable merge blocks are terminated by OpUnreachable, while + // unreachable continue blocks are terminated by an unconditional branch to + // the header. Otherwise, blocks are dead if not explicitly captured in + // |live_blocks| and are totally removed. + // + // |unreachable_continues| maps continue targets that cannot be reached to + // corresponding header block that declares them. + bool EraseDeadBlocks( + ir::Function* func, + const std::unordered_set& live_blocks, + const std::unordered_set& unreachable_merges, + const std::unordered_map& + unreachable_continues); + + void Initialize(ir::IRContext* c); + Pass::Status ProcessImpl(); +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_DEAD_BRANCH_ELIM_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dead_insert_elim_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dead_insert_elim_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dead_insert_elim_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dead_insert_elim_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,279 @@ +// Copyright (c) 2018 The Khronos Group Inc. +// Copyright (c) 2018 Valve Corporation +// Copyright (c) 2018 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. + +#include "dead_insert_elim_pass.h" + +#include "composite.h" +#include "ir_context.h" +#include "iterator.h" +#include "spirv/1.2/GLSL.std.450.h" + +#include + +namespace spvtools { +namespace opt { + +namespace { + +const uint32_t kTypeVectorCountInIdx = 1; +const uint32_t kTypeMatrixCountInIdx = 1; +const uint32_t kTypeArrayLengthIdInIdx = 1; +const uint32_t kTypeIntWidthInIdx = 0; +const uint32_t kConstantValueInIdx = 0; +const uint32_t kInsertObjectIdInIdx = 0; +const uint32_t kInsertCompositeIdInIdx = 1; + +} // anonymous namespace + +uint32_t DeadInsertElimPass::NumComponents(ir::Instruction* typeInst) { + switch (typeInst->opcode()) { + case SpvOpTypeVector: { + return typeInst->GetSingleWordInOperand(kTypeVectorCountInIdx); + } break; + case SpvOpTypeMatrix: { + return typeInst->GetSingleWordInOperand(kTypeMatrixCountInIdx); + } break; + case SpvOpTypeArray: { + uint32_t lenId = + typeInst->GetSingleWordInOperand(kTypeArrayLengthIdInIdx); + ir::Instruction* lenInst = get_def_use_mgr()->GetDef(lenId); + if (lenInst->opcode() != SpvOpConstant) return 0; + uint32_t lenTypeId = lenInst->type_id(); + ir::Instruction* lenTypeInst = get_def_use_mgr()->GetDef(lenTypeId); + // TODO(greg-lunarg): Support non-32-bit array length + if (lenTypeInst->GetSingleWordInOperand(kTypeIntWidthInIdx) != 32) + return 0; + return lenInst->GetSingleWordInOperand(kConstantValueInIdx); + } break; + case SpvOpTypeStruct: { + return typeInst->NumInOperands(); + } break; + default: { return 0; } break; + } +} + +void DeadInsertElimPass::MarkInsertChain(ir::Instruction* insertChain, + std::vector* pExtIndices, + uint32_t extOffset) { + // Not currently optimizing array inserts. + ir::Instruction* typeInst = get_def_use_mgr()->GetDef(insertChain->type_id()); + if (typeInst->opcode() == SpvOpTypeArray) return; + // Insert chains are only composed of inserts and phis + if (insertChain->opcode() != SpvOpCompositeInsert && + insertChain->opcode() != SpvOpPhi) + return; + // If extract indices are empty, mark all subcomponents if type + // is constant length. + if (pExtIndices == nullptr) { + uint32_t cnum = NumComponents(typeInst); + if (cnum > 0) { + std::vector extIndices; + for (uint32_t i = 0; i < cnum; i++) { + extIndices.clear(); + extIndices.push_back(i); + MarkInsertChain(insertChain, &extIndices, 0); + } + return; + } + } + ir::Instruction* insInst = insertChain; + while (insInst->opcode() == SpvOpCompositeInsert) { + // If no extract indices, mark insert and inserted object (which might + // also be an insert chain) and continue up the chain though the input + // composite. + // + // Note: We mark inserted objects in this function (rather than in + // EliminateDeadInsertsOnePass) because in some cases, we can do it + // more accurately here. + if (pExtIndices == nullptr) { + liveInserts_.insert(insInst->result_id()); + uint32_t objId = insInst->GetSingleWordInOperand(kInsertObjectIdInIdx); + MarkInsertChain(get_def_use_mgr()->GetDef(objId), nullptr, 0); + } + // If extract indices match insert, we are done. Mark insert and + // inserted object. + else if (ExtInsMatch(*pExtIndices, insInst, extOffset)) { + liveInserts_.insert(insInst->result_id()); + uint32_t objId = insInst->GetSingleWordInOperand(kInsertObjectIdInIdx); + MarkInsertChain(get_def_use_mgr()->GetDef(objId), nullptr, 0); + break; + } + // If non-matching intersection, mark insert + else if (ExtInsConflict(*pExtIndices, insInst, extOffset)) { + liveInserts_.insert(insInst->result_id()); + // If more extract indices than insert, we are done. Use remaining + // extract indices to mark inserted object. + uint32_t numInsertIndices = insInst->NumInOperands() - 2; + if (pExtIndices->size() - extOffset > numInsertIndices) { + uint32_t objId = insInst->GetSingleWordInOperand(kInsertObjectIdInIdx); + MarkInsertChain(get_def_use_mgr()->GetDef(objId), pExtIndices, + extOffset + numInsertIndices); + break; + } + // If fewer extract indices than insert, also mark inserted object and + // continue up chain. + else { + uint32_t objId = insInst->GetSingleWordInOperand(kInsertObjectIdInIdx); + MarkInsertChain(get_def_use_mgr()->GetDef(objId), nullptr, 0); + } + } + // Get next insert in chain + const uint32_t compId = + insInst->GetSingleWordInOperand(kInsertCompositeIdInIdx); + insInst = get_def_use_mgr()->GetDef(compId); + } + // If insert chain ended with phi, do recursive call on each operand + if (insInst->opcode() != SpvOpPhi) return; + // Mark phi visited to prevent potential infinite loop. If phi is already + // visited, return to avoid infinite loop. + auto iter = visitedPhis_.find(insInst->result_id()); + if (iter == visitedPhis_.end()) { + iter = visitedPhis_.emplace(insInst->result_id(), true).first; + } else if (iter->second) { + return; + } else { + iter->second = true; + } + + // Phis may have duplicate inputs values for different edges, prune incoming + // ids lists before recursing. + std::vector ids; + for (uint32_t i = 0; i < insInst->NumInOperands(); i += 2) { + ids.push_back(insInst->GetSingleWordInOperand(i)); + } + std::sort(ids.begin(), ids.end()); + auto new_end = std::unique(ids.begin(), ids.end()); + for (auto id_iter = ids.begin(); id_iter != new_end; ++id_iter) { + ir::Instruction* pi = get_def_use_mgr()->GetDef(*id_iter); + MarkInsertChain(pi, pExtIndices, extOffset); + } + + // Unmark phi when done visiting. + iter->second = false; +} + +bool DeadInsertElimPass::EliminateDeadInserts(ir::Function* func) { + bool modified = false; + bool lastmodified = true; + // Each pass can delete dead instructions, thus potentially revealing + // new dead insertions ie insertions with no uses. + while (lastmodified) { + lastmodified = EliminateDeadInsertsOnePass(func); + modified |= lastmodified; + } + return modified; +} + +bool DeadInsertElimPass::EliminateDeadInsertsOnePass(ir::Function* func) { + bool modified = false; + liveInserts_.clear(); + visitedPhis_.clear(); + // Mark all live inserts + for (auto bi = func->begin(); bi != func->end(); ++bi) { + for (auto ii = bi->begin(); ii != bi->end(); ++ii) { + // Only process Inserts and composite Phis + SpvOp op = ii->opcode(); + ir::Instruction* typeInst = get_def_use_mgr()->GetDef(ii->type_id()); + if (op != SpvOpCompositeInsert && + (op != SpvOpPhi || !spvOpcodeIsComposite(typeInst->opcode()))) + continue; + // The marking algorithm can be expensive for large arrays and the + // efficacy of eliminating dead inserts into arrays is questionable. + // Skip optimizing array inserts for now. Just mark them live. + // TODO(greg-lunarg): Eliminate dead array inserts + if (op == SpvOpCompositeInsert) { + if (typeInst->opcode() == SpvOpTypeArray) { + liveInserts_.insert(ii->result_id()); + continue; + } + } + const uint32_t id = ii->result_id(); + get_def_use_mgr()->ForEachUser(id, [&ii, this](ir::Instruction* user) { + switch (user->opcode()) { + case SpvOpCompositeInsert: + case SpvOpPhi: + // Use by insert or phi does not initiate marking + break; + case SpvOpCompositeExtract: { + // Capture extract indices + std::vector extIndices; + uint32_t icnt = 0; + user->ForEachInOperand([&icnt, &extIndices](const uint32_t* idp) { + if (icnt > 0) extIndices.push_back(*idp); + ++icnt; + }); + // Mark all inserts in chain that intersect with extract + MarkInsertChain(&*ii, &extIndices, 0); + } break; + default: { + // Mark inserts in chain for all components + MarkInsertChain(&*ii, nullptr, 0); + } break; + } + }); + } + } + // Find and disconnect dead inserts + std::vector dead_instructions; + for (auto bi = func->begin(); bi != func->end(); ++bi) { + for (auto ii = bi->begin(); ii != bi->end(); ++ii) { + if (ii->opcode() != SpvOpCompositeInsert) continue; + const uint32_t id = ii->result_id(); + if (liveInserts_.find(id) != liveInserts_.end()) continue; + const uint32_t replId = + ii->GetSingleWordInOperand(kInsertCompositeIdInIdx); + (void)context()->ReplaceAllUsesWith(id, replId); + dead_instructions.push_back(&*ii); + modified = true; + } + } + // DCE dead inserts + while (!dead_instructions.empty()) { + ir::Instruction* inst = dead_instructions.back(); + dead_instructions.pop_back(); + DCEInst(inst, [&dead_instructions](ir::Instruction* other_inst) { + auto i = std::find(dead_instructions.begin(), dead_instructions.end(), + other_inst); + if (i != dead_instructions.end()) { + dead_instructions.erase(i); + } + }); + } + return modified; +} + +void DeadInsertElimPass::Initialize(ir::IRContext* c) { + InitializeProcessing(c); +} + +Pass::Status DeadInsertElimPass::ProcessImpl() { + // Process all entry point functions. + ProcessFunction pfn = [this](ir::Function* fp) { + return EliminateDeadInserts(fp); + }; + bool modified = ProcessEntryPointCallTree(pfn, get_module()); + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +DeadInsertElimPass::DeadInsertElimPass() {} + +Pass::Status DeadInsertElimPass::Process(ir::IRContext* c) { + Initialize(c); + return ProcessImpl(); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dead_insert_elim_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dead_insert_elim_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dead_insert_elim_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dead_insert_elim_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,82 @@ +// Copyright (c) 2018 The Khronos Group Inc. +// Copyright (c) 2018 Valve Corporation +// Copyright (c) 2018 LunarG Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_DEAD_INSERT_ELIM_PASS_H_ +#define LIBSPIRV_OPT_DEAD_INSERT_ELIM_PASS_H_ + +#include +#include +#include +#include +#include + +#include "basic_block.h" +#include "def_use_manager.h" +#include "ir_context.h" +#include "mem_pass.h" +#include "module.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class DeadInsertElimPass : public MemPass { + public: + DeadInsertElimPass(); + const char* name() const override { return "eliminate-dead-inserts"; } + Status Process(ir::IRContext*) override; + + private: + // Return the number of subcomponents in the composite type |typeId|. + // Return 0 if not a composite type or number of components is not a + // 32-bit constant. + uint32_t NumComponents(ir::Instruction* typeInst); + + // Mark all inserts in instruction chain ending at |insertChain| with + // indices that intersect with extract indices |extIndices| starting with + // index at |extOffset|. Chains are composed solely of Inserts and Phis. + // Mark all inserts in chain if |extIndices| is nullptr. + void MarkInsertChain(ir::Instruction* insertChain, + std::vector* extIndices, uint32_t extOffset); + + // Perform EliminateDeadInsertsOnePass(|func|) until no modification is + // made. Return true if modified. + bool EliminateDeadInserts(ir::Function* func); + + // DCE all dead struct, matrix and vector inserts in |func|. An insert is + // dead if the value it inserts is never used. Replace any reference to the + // insert with its original composite. Return true if modified. Dead inserts + // in dependence cycles are not currently eliminated. Dead inserts into + // arrays are not currently eliminated. + bool EliminateDeadInsertsOnePass(ir::Function* func); + + // Return true if all extensions in this module are allowed by this pass. + bool AllExtensionsSupported() const; + + void Initialize(ir::IRContext* c); + Pass::Status ProcessImpl(); + + // Live inserts + std::unordered_set liveInserts_; + + // Visited phis as insert chain is traversed; used to avoid infinite loop + std::unordered_map visitedPhis_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_DEAD_INSERT_ELIM_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dead_variable_elimination.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dead_variable_elimination.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dead_variable_elimination.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dead_variable_elimination.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,114 @@ +// Copyright (c) 2017 Google 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. + +#include "dead_variable_elimination.h" + +#include "ir_context.h" +#include "reflect.h" + +namespace spvtools { +namespace opt { + +// This optimization removes global variables that are not needed because they +// are definitely not accessed. +Pass::Status DeadVariableElimination::Process(ir::IRContext* c) { + // The algorithm will compute the reference count for every global variable. + // Anything with a reference count of 0 will then be deleted. For variables + // that might have references that are not explicit in this context, we use + // the + // value kMustKeep as the reference count. + InitializeProcessing(c); + + std::vector ids_to_remove; + + // Get the reference count for all of the global OpVariable instructions. + for (auto& inst : context()->types_values()) { + if (inst.opcode() != SpvOp::SpvOpVariable) { + continue; + } + + size_t count = 0; + uint32_t result_id = inst.result_id(); + + // Check the linkage. If it is exported, it could be reference somewhere + // else, so we must keep the variable around. + get_decoration_mgr()->ForEachDecoration( + result_id, SpvDecorationLinkageAttributes, + [&count](const ir::Instruction& linkage_instruction) { + uint32_t last_operand = linkage_instruction.NumOperands() - 1; + if (linkage_instruction.GetSingleWordOperand(last_operand) == + SpvLinkageTypeExport) { + count = kMustKeep; + } + }); + + if (count != kMustKeep) { + // If we don't have to keep the instruction for other reasons, then look + // at the uses and count the number of real references. + count = 0; + get_def_use_mgr()->ForEachUser( + result_id, [&count](ir::Instruction* user) { + if (!ir::IsAnnotationInst(user->opcode()) && + user->opcode() != SpvOpName) { + ++count; + } + }); + } + reference_count_[result_id] = count; + if (count == 0) { + ids_to_remove.push_back(result_id); + } + } + + // Remove all of the variables that have a reference count of 0. + bool modified = false; + if (!ids_to_remove.empty()) { + modified = true; + for (auto result_id : ids_to_remove) { + DeleteVariable(result_id); + } + } + return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange); +} + +void DeadVariableElimination::DeleteVariable(uint32_t result_id) { + ir::Instruction* inst = get_def_use_mgr()->GetDef(result_id); + assert(inst->opcode() == SpvOpVariable && + "Should not be trying to delete anything other than an OpVariable."); + + // Look for an initializer that references another variable. We need to know + // if that variable can be deleted after the reference is removed. + if (inst->NumOperands() == 4) { + ir::Instruction* initializer = + get_def_use_mgr()->GetDef(inst->GetSingleWordOperand(3)); + + // TODO: Handle OpSpecConstantOP which might be defined in terms of other + // variables. Will probably require a unified dead code pass that does all + // instruction types. (Issue 906) + if (initializer->opcode() == SpvOpVariable) { + uint32_t initializer_id = initializer->result_id(); + size_t& count = reference_count_[initializer_id]; + if (count != kMustKeep) { + --count; + } + + if (count == 0) { + DeleteVariable(initializer_id); + } + } + } + context()->KillDef(result_id); +} +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dead_variable_elimination.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dead_variable_elimination.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dead_variable_elimination.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dead_variable_elimination.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,55 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SPIRV_TOOLS_DEAD_VARIABLE_ELIMINATION_H +#define SPIRV_TOOLS_DEAD_VARIABLE_ELIMINATION_H + +#include +#include + +#include "decoration_manager.h" +#include "mem_pass.h" + +namespace spvtools { +namespace opt { + +class DeadVariableElimination : public MemPass { + public: + const char* name() const override { return "dead-variable-elimination"; } + Status Process(ir::IRContext* c) override; + + ir::IRContext::Analysis GetPreservedAnalyses() override { + return ir::IRContext::kAnalysisDefUse; + } + + private: + // Deletes the OpVariable instruction who result id is |result_id|. + void DeleteVariable(uint32_t result_id); + + // Keeps track of the number of references of an id. Once that value is 0, it + // is safe to remove the corresponding instruction. + // + // Note that the special value kMustKeep is used to indicate that the + // instruction cannot be deleted for reasons other that is being explicitly + // referenced. + std::unordered_map reference_count_; + + // Special value used to indicate that an id cannot be safely deleted. + enum { kMustKeep = INT_MAX }; +}; + +} // namespace opt +} // namespace spvtools + +#endif // SPIRV_TOOLS_DEAD_VARIABLE_ELIMINATION_H diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/decoration_manager.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/decoration_manager.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/decoration_manager.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/decoration_manager.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,437 @@ +// Copyright (c) 2017 Pierre Moreau +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "decoration_manager.h" + +#include +#include +#include + +#include "ir_context.h" + +namespace spvtools { +namespace opt { +namespace analysis { + +void DecorationManager::RemoveDecorationsFrom( + uint32_t id, std::function pred) { + const auto ids_iter = id_to_decoration_insts_.find(id); + if (ids_iter == id_to_decoration_insts_.end()) return; + + TargetData& decorations_info = ids_iter->second; + auto context = module_->context(); + std::vector insts_to_kill; + const bool is_group = !decorations_info.decorate_insts.empty(); + + // Schedule all direct decorations for removal if instructed as such by + // |pred|. + for (ir::Instruction* inst : decorations_info.direct_decorations) + if (pred(*inst)) insts_to_kill.push_back(inst); + + // For all groups being directly applied to |id|, remove |id| (and the + // literal if |inst| is an OpGroupMemberDecorate) from the instruction + // applying the group. + std::unordered_set indirect_decorations_to_remove; + for (ir::Instruction* inst : decorations_info.indirect_decorations) { + assert(inst->opcode() == SpvOpGroupDecorate || + inst->opcode() == SpvOpGroupMemberDecorate); + + std::vector group_decorations_to_keep; + const uint32_t group_id = inst->GetSingleWordInOperand(0u); + const auto group_iter = id_to_decoration_insts_.find(group_id); + assert(group_iter != id_to_decoration_insts_.end() && + "Unknown decoration group"); + const auto& group_decorations = group_iter->second.direct_decorations; + for (ir::Instruction* decoration : group_decorations) { + if (!pred(*decoration)) group_decorations_to_keep.push_back(decoration); + } + + // If all decorations should be kept, move to the next group + if (group_decorations_to_keep.size() == group_decorations.size()) continue; + + // Otherwise, remove |id| from the targets of |group_id| + const uint32_t stride = inst->opcode() == SpvOpGroupDecorate ? 1u : 2u; + bool was_modified = false; + for (uint32_t i = 1u; i < inst->NumInOperands();) { + if (inst->GetSingleWordInOperand(i) != id) { + i += stride; + continue; + } + + const uint32_t last_operand_index = inst->NumInOperands() - stride; + if (i < last_operand_index) + inst->GetInOperand(i) = inst->GetInOperand(last_operand_index); + // Remove the associated literal, if it exists. + if (stride == 2u) { + if (i < last_operand_index) + inst->GetInOperand(i + 1u) = + inst->GetInOperand(last_operand_index + 1u); + inst->RemoveInOperand(last_operand_index + 1u); + } + inst->RemoveInOperand(last_operand_index); + was_modified = true; + } + + // If the instruction has no targets left, remove the instruction + // altogether. + if (inst->NumInOperands() == 1u) { + indirect_decorations_to_remove.emplace(inst); + insts_to_kill.push_back(inst); + } else if (was_modified) { + context->ForgetUses(inst); + indirect_decorations_to_remove.emplace(inst); + context->AnalyzeUses(inst); + } + + // If only some of the decorations should be kept, clone them and apply + // them directly to |id|. + if (!group_decorations_to_keep.empty()) { + for (ir::Instruction* decoration : group_decorations_to_keep) { + // simply clone decoration and change |group_id| to |id| + std::unique_ptr new_inst( + decoration->Clone(module_->context())); + new_inst->SetInOperand(0, {id}); + module_->AddAnnotationInst(std::move(new_inst)); + auto decoration_iter = --module_->annotation_end(); + context->AnalyzeUses(&*decoration_iter); + } + } + } + + auto& indirect_decorations = decorations_info.indirect_decorations; + indirect_decorations.erase( + std::remove_if( + indirect_decorations.begin(), indirect_decorations.end(), + [&indirect_decorations_to_remove](const ir::Instruction* inst) { + return indirect_decorations_to_remove.count(inst); + }), + indirect_decorations.end()); + + for (ir::Instruction* inst : insts_to_kill) context->KillInst(inst); + insts_to_kill.clear(); + + // Schedule all instructions applying the group for removal if this group no + // longer applies decorations, either directly or indirectly. + if (is_group && decorations_info.direct_decorations.empty() && + decorations_info.indirect_decorations.empty()) { + for (ir::Instruction* inst : decorations_info.decorate_insts) + insts_to_kill.push_back(inst); + } + for (ir::Instruction* inst : insts_to_kill) context->KillInst(inst); + + if (decorations_info.direct_decorations.empty() && + decorations_info.indirect_decorations.empty() && + decorations_info.decorate_insts.empty()) { + id_to_decoration_insts_.erase(ids_iter); + + // Remove the OpDecorationGroup defining this group. + if (is_group) context->KillInst(context->get_def_use_mgr()->GetDef(id)); + } +} + +std::vector DecorationManager::GetDecorationsFor( + uint32_t id, bool include_linkage) { + return InternalGetDecorationsFor(id, include_linkage); +} + +std::vector DecorationManager::GetDecorationsFor( + uint32_t id, bool include_linkage) const { + return const_cast(this) + ->InternalGetDecorationsFor(id, include_linkage); +} + +bool DecorationManager::HaveTheSameDecorations(uint32_t id1, + uint32_t id2) const { + using InstructionList = std::vector; + using DecorationSet = std::set; + + const InstructionList decorations_for1 = GetDecorationsFor(id1, false); + const InstructionList decorations_for2 = GetDecorationsFor(id2, false); + + // This function splits the decoration instructions into different sets, + // based on their opcode; only OpDecorate, OpDecorateId, + // OpDecorateStringGOOGLE, and OpMemberDecorate are considered, the other + // opcodes are ignored. + const auto fillDecorationSets = + [](const InstructionList& decoration_list, DecorationSet* decorate_set, + DecorationSet* decorate_id_set, DecorationSet* decorate_string_set, + DecorationSet* member_decorate_set) { + for (const ir::Instruction* inst : decoration_list) { + std::u32string decoration_payload; + // Ignore the opcode and the target as we do not want them to be + // compared. + for (uint32_t i = 1u; i < inst->NumInOperands(); ++i) { + for (uint32_t word : inst->GetInOperand(i).words) { + decoration_payload.push_back(word); + } + } + + switch (inst->opcode()) { + case SpvOpDecorate: + decorate_set->emplace(std::move(decoration_payload)); + break; + case SpvOpMemberDecorate: + member_decorate_set->emplace(std::move(decoration_payload)); + break; + case SpvOpDecorateId: + decorate_id_set->emplace(std::move(decoration_payload)); + break; + case SpvOpDecorateStringGOOGLE: + decorate_string_set->emplace(std::move(decoration_payload)); + break; + default: + break; + } + } + }; + + DecorationSet decorate_set_for1; + DecorationSet decorate_id_set_for1; + DecorationSet decorate_string_set_for1; + DecorationSet member_decorate_set_for1; + fillDecorationSets(decorations_for1, &decorate_set_for1, + &decorate_id_set_for1, &decorate_string_set_for1, + &member_decorate_set_for1); + + DecorationSet decorate_set_for2; + DecorationSet decorate_id_set_for2; + DecorationSet decorate_string_set_for2; + DecorationSet member_decorate_set_for2; + fillDecorationSets(decorations_for2, &decorate_set_for2, + &decorate_id_set_for2, &decorate_string_set_for2, + &member_decorate_set_for2); + + const bool result = decorate_set_for1 == decorate_set_for2 && + decorate_id_set_for1 == decorate_id_set_for2 && + member_decorate_set_for1 == member_decorate_set_for2 && + // Compare string sets last in case the strings are long. + decorate_string_set_for1 == decorate_string_set_for2; + return result; +} + +// TODO(pierremoreau): If OpDecorateId is referencing an OpConstant, one could +// check that the constants are the same rather than just +// looking at the constant ID. +bool DecorationManager::AreDecorationsTheSame(const ir::Instruction* inst1, + const ir::Instruction* inst2, + bool ignore_target) const { + switch (inst1->opcode()) { + case SpvOpDecorate: + case SpvOpMemberDecorate: + case SpvOpDecorateId: + case SpvOpDecorateStringGOOGLE: + break; + default: + return false; + } + + if (inst1->opcode() != inst2->opcode() || + inst1->NumInOperands() != inst2->NumInOperands()) + return false; + + for (uint32_t i = ignore_target ? 1u : 0u; i < inst1->NumInOperands(); ++i) + if (inst1->GetInOperand(i) != inst2->GetInOperand(i)) return false; + + return true; +} + +void DecorationManager::AnalyzeDecorations() { + if (!module_) return; + + // For each group and instruction, collect all their decoration instructions. + for (ir::Instruction& inst : module_->annotations()) { + AddDecoration(&inst); + } +} +void DecorationManager::AddDecoration(ir::Instruction* inst) { + switch (inst->opcode()) { + case SpvOpDecorate: + case SpvOpDecorateId: + case SpvOpDecorateStringGOOGLE: + case SpvOpMemberDecorate: { + const auto target_id = inst->GetSingleWordInOperand(0u); + id_to_decoration_insts_[target_id].direct_decorations.push_back(inst); + break; + } + case SpvOpGroupDecorate: + case SpvOpGroupMemberDecorate: { + const uint32_t start = inst->opcode() == SpvOpGroupDecorate ? 1u : 2u; + const uint32_t stride = start; + for (uint32_t i = start; i < inst->NumInOperands(); i += stride) { + const auto target_id = inst->GetSingleWordInOperand(i); + TargetData& target_data = id_to_decoration_insts_[target_id]; + target_data.indirect_decorations.push_back(inst); + } + const auto target_id = inst->GetSingleWordInOperand(0u); + id_to_decoration_insts_[target_id].decorate_insts.push_back(inst); + break; + } + default: + break; + } +} + +template +std::vector DecorationManager::InternalGetDecorationsFor( + uint32_t id, bool include_linkage) { + std::vector decorations; + + const auto ids_iter = id_to_decoration_insts_.find(id); + // |id| has no decorations + if (ids_iter == id_to_decoration_insts_.end()) return decorations; + + const TargetData& target_data = ids_iter->second; + + const auto process_direct_decorations = + [include_linkage, + &decorations](const std::vector& direct_decorations) { + for (ir::Instruction* inst : direct_decorations) { + const bool is_linkage = inst->opcode() == SpvOpDecorate && + inst->GetSingleWordInOperand(1u) == + SpvDecorationLinkageAttributes; + if (include_linkage || !is_linkage) decorations.push_back(inst); + } + }; + + // Process |id|'s decorations. + process_direct_decorations(ids_iter->second.direct_decorations); + + // Process the decorations of all groups applied to |id|. + for (const ir::Instruction* inst : target_data.indirect_decorations) { + const uint32_t group_id = inst->GetSingleWordInOperand(0u); + const auto group_iter = id_to_decoration_insts_.find(group_id); + assert(group_iter != id_to_decoration_insts_.end() && "Unknown group ID"); + process_direct_decorations(group_iter->second.direct_decorations); + } + + return decorations; +} + +bool DecorationManager::WhileEachDecoration( + uint32_t id, uint32_t decoration, + std::function f) { + for (const ir::Instruction* inst : GetDecorationsFor(id, true)) { + switch (inst->opcode()) { + case SpvOpMemberDecorate: + if (inst->GetSingleWordInOperand(2) == decoration) { + if (!f(*inst)) return false; + } + break; + case SpvOpDecorate: + case SpvOpDecorateId: + case SpvOpDecorateStringGOOGLE: + if (inst->GetSingleWordInOperand(1) == decoration) { + if (!f(*inst)) return false; + } + break; + default: + assert(false && "Unexpected decoration instruction"); + } + } + return true; +} + +void DecorationManager::ForEachDecoration( + uint32_t id, uint32_t decoration, + std::function f) { + WhileEachDecoration(id, decoration, [&f](const ir::Instruction& inst) { + f(inst); + return true; + }); +} + +void DecorationManager::CloneDecorations(uint32_t from, uint32_t to) { + const auto decoration_list = id_to_decoration_insts_.find(from); + if (decoration_list == id_to_decoration_insts_.end()) return; + auto context = module_->context(); + for (ir::Instruction* inst : decoration_list->second.direct_decorations) { + // simply clone decoration and change |target-id| to |to| + std::unique_ptr new_inst(inst->Clone(module_->context())); + new_inst->SetInOperand(0, {to}); + module_->AddAnnotationInst(std::move(new_inst)); + auto decoration_iter = --module_->annotation_end(); + context->AnalyzeUses(&*decoration_iter); + } + // We need to copy the list of instructions as ForgetUses and AnalyzeUses are + // going to modify it. + std::vector indirect_decorations = + decoration_list->second.indirect_decorations; + for (ir::Instruction* inst : indirect_decorations) { + switch (inst->opcode()) { + case SpvOpGroupDecorate: + context->ForgetUses(inst); + // add |to| to list of decorated id's + inst->AddOperand( + ir::Operand(spv_operand_type_t::SPV_OPERAND_TYPE_ID, {to})); + context->AnalyzeUses(inst); + break; + case SpvOpGroupMemberDecorate: { + context->ForgetUses(inst); + // for each (id == from), add (to, literal) as operands + const uint32_t num_operands = inst->NumOperands(); + for (uint32_t i = 1; i < num_operands; i += 2) { + ir::Operand op = inst->GetOperand(i); + if (op.words[0] == from) { // add new pair of operands: (to, literal) + inst->AddOperand( + ir::Operand(spv_operand_type_t::SPV_OPERAND_TYPE_ID, {to})); + op = inst->GetOperand(i + 1); + inst->AddOperand(std::move(op)); + } + } + context->AnalyzeUses(inst); + break; + } + default: + assert(false && "Unexpected decoration instruction"); + } + } +} + +void DecorationManager::RemoveDecoration(ir::Instruction* inst) { + const auto remove_from_container = [inst](std::vector& v) { + v.erase(std::remove(v.begin(), v.end(), inst), v.end()); + }; + + switch (inst->opcode()) { + case SpvOpDecorate: + case SpvOpDecorateId: + case SpvOpDecorateStringGOOGLE: + case SpvOpMemberDecorate: { + const auto target_id = inst->GetSingleWordInOperand(0u); + auto const iter = id_to_decoration_insts_.find(target_id); + if (iter == id_to_decoration_insts_.end()) return; + remove_from_container(iter->second.direct_decorations); + } break; + case SpvOpGroupDecorate: + case SpvOpGroupMemberDecorate: { + const uint32_t stride = inst->opcode() == SpvOpGroupDecorate ? 1u : 2u; + for (uint32_t i = 1u; i < inst->NumInOperands(); i += stride) { + const auto target_id = inst->GetSingleWordInOperand(i); + auto const iter = id_to_decoration_insts_.find(target_id); + if (iter == id_to_decoration_insts_.end()) continue; + remove_from_container(iter->second.indirect_decorations); + } + const auto group_id = inst->GetSingleWordInOperand(0u); + auto const iter = id_to_decoration_insts_.find(group_id); + if (iter == id_to_decoration_insts_.end()) return; + remove_from_container(iter->second.decorate_insts); + } break; + default: + break; + } +} + +} // namespace analysis +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/decoration_manager.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/decoration_manager.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/decoration_manager.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/decoration_manager.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,137 @@ +// Copyright (c) 2017 Pierre Moreau +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_DECORATION_MANAGER_H_ +#define LIBSPIRV_OPT_DECORATION_MANAGER_H_ + +#include +#include +#include +#include + +#include "instruction.h" +#include "module.h" + +namespace spvtools { +namespace opt { +namespace analysis { + +// A class for analyzing and managing decorations in an ir::Module. +class DecorationManager { + public: + // Constructs a decoration manager from the given |module| + explicit DecorationManager(ir::Module* module) : module_(module) { + AnalyzeDecorations(); + } + DecorationManager() = delete; + + // Removes all decorations from |id| (either directly or indirectly) for + // which |pred| returns true. + // If |id| is a group ID, OpGroupDecorate and OpGroupMemberDecorate will be + // removed if they have no targets left, and OpDecorationGroup will be + // removed if the group is not applied to anyone and contains no decorations. + void RemoveDecorationsFrom(uint32_t id, + std::function pred = + [](const ir::Instruction&) { return true; }); + + // Removes all decorations from the result id of |inst|. + // + // NOTE: This is only meant to be called from ir_context, as only metadata + // will be removed, and no actual instruction. + void RemoveDecoration(ir::Instruction* inst); + + // Returns a vector of all decorations affecting |id|. If a group is applied + // to |id|, the decorations of that group are returned rather than the group + // decoration instruction. If |include_linkage| is not set, linkage + // decorations won't be returned. + std::vector GetDecorationsFor(uint32_t id, + bool include_linkage); + std::vector GetDecorationsFor( + uint32_t id, bool include_linkage) const; + // Returns whether two IDs have the same decorations. Two SpvOpGroupDecorate + // instructions that apply the same decorations but to different IDs, still + // count as being the same. + bool HaveTheSameDecorations(uint32_t id1, uint32_t id2) const; + // Returns whether the two decorations instructions are the same and are + // applying the same decorations; unless |ignore_target| is false, the targets + // to which they are applied to does not matter, except for the member part. + // + // This is only valid for OpDecorate, OpMemberDecorate and OpDecorateId; it + // will return false for other opcodes. + bool AreDecorationsTheSame(const ir::Instruction* inst1, + const ir::Instruction* inst2, + bool ignore_target) const; + + // |f| is run on each decoration instruction for |id| with decoration + // |decoration|. Processed are all decorations which target |id| either + // directly or indirectly by Decoration Groups. + void ForEachDecoration(uint32_t id, uint32_t decoration, + std::function f); + + // |f| is run on each decoration instruction for |id| with decoration + // |decoration|. Processes all decoration which target |id| either directly or + // indirectly through decoration groups. If |f| returns false, iteration is + // terminated and this function returns false. + bool WhileEachDecoration(uint32_t id, uint32_t decoration, + std::function f); + + // Clone all decorations from one id |from|. + // The cloned decorations are assigned to the given id |to| and are + // added to the module. The purpose is to decorate cloned instructions. + // This function does not check if the id |to| is already decorated. + void CloneDecorations(uint32_t from, uint32_t to); + + // Informs the decoration manager of a new decoration that it needs to track. + void AddDecoration(ir::Instruction* inst); + + private: + // Analyzes the defs and uses in the given |module| and populates data + // structures in this class. Does nothing if |module| is nullptr. + void AnalyzeDecorations(); + + template + std::vector InternalGetDecorationsFor(uint32_t id, bool include_linkage); + + // Tracks decoration information of an ID. + struct TargetData { + std::vector direct_decorations; // All decorate + // instructions applied + // to the tracked ID. + std::vector indirect_decorations; // All instructions + // applying a group to + // the tracked ID. + std::vector decorate_insts; // All decorate instructions + // applying the decorations + // of the tracked ID to + // targets. + // It is empty if the + // tracked ID is not a + // group. + }; + + // Mapping from ids to the instructions applying a decoration to those ids. + // In other words, for each id you get all decoration instructions + // referencing that id, be it directly (SpvOpDecorate, SpvOpMemberDecorate + // and SpvOpDecorateId), or indirectly (SpvOpGroupDecorate, + // SpvOpMemberGroupDecorate). + std::unordered_map id_to_decoration_insts_; + // The enclosing module. + ir::Module* module_; +}; + +} // namespace analysis +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_DECORATION_MANAGER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/def_use_manager.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/def_use_manager.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/def_use_manager.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/def_use_manager.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,293 @@ +// Copyright (c) 2016 Google 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. + +#include "def_use_manager.h" + +#include + +#include "log.h" +#include "reflect.h" + +namespace spvtools { +namespace opt { +namespace analysis { + +void DefUseManager::AnalyzeInstDef(ir::Instruction* inst) { + const uint32_t def_id = inst->result_id(); + if (def_id != 0) { + auto iter = id_to_def_.find(def_id); + if (iter != id_to_def_.end()) { + // Clear the original instruction that defining the same result id of the + // new instruction. + ClearInst(iter->second); + } + id_to_def_[def_id] = inst; + } else { + ClearInst(inst); + } +} + +void DefUseManager::AnalyzeInstUse(ir::Instruction* inst) { + // Create entry for the given instruction. Note that the instruction may + // not have any in-operands. In such cases, we still need a entry for those + // instructions so this manager knows it has seen the instruction later. + auto* used_ids = &inst_to_used_ids_[inst]; + if (used_ids->size()) { + EraseUseRecordsOfOperandIds(inst); + used_ids = &inst_to_used_ids_[inst]; + } + used_ids->clear(); // It might have existed before. + + for (uint32_t i = 0; i < inst->NumOperands(); ++i) { + switch (inst->GetOperand(i).type) { + // For any id type but result id type + case SPV_OPERAND_TYPE_ID: + case SPV_OPERAND_TYPE_TYPE_ID: + case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: + case SPV_OPERAND_TYPE_SCOPE_ID: { + uint32_t use_id = inst->GetSingleWordOperand(i); + ir::Instruction* def = GetDef(use_id); + assert(def && "Definition is not registered."); + id_to_users_.insert(UserEntry(def, inst)); + used_ids->push_back(use_id); + } break; + default: + break; + } + } +} + +void DefUseManager::AnalyzeInstDefUse(ir::Instruction* inst) { + AnalyzeInstDef(inst); + AnalyzeInstUse(inst); +} + +void DefUseManager::UpdateDefUse(ir::Instruction* inst) { + const uint32_t def_id = inst->result_id(); + if (def_id != 0) { + auto iter = id_to_def_.find(def_id); + if (iter == id_to_def_.end()) { + AnalyzeInstDef(inst); + } + } + AnalyzeInstUse(inst); +} + +ir::Instruction* DefUseManager::GetDef(uint32_t id) { + auto iter = id_to_def_.find(id); + if (iter == id_to_def_.end()) return nullptr; + return iter->second; +} + +const ir::Instruction* DefUseManager::GetDef(uint32_t id) const { + const auto iter = id_to_def_.find(id); + if (iter == id_to_def_.end()) return nullptr; + return iter->second; +} + +DefUseManager::IdToUsersMap::const_iterator DefUseManager::UsersBegin( + const ir::Instruction* def) const { + return id_to_users_.lower_bound( + UserEntry(const_cast(def), nullptr)); +} + +bool DefUseManager::UsersNotEnd(const IdToUsersMap::const_iterator& iter, + const IdToUsersMap::const_iterator& cached_end, + const ir::Instruction* inst) const { + return (iter != cached_end && iter->first == inst); +} + +bool DefUseManager::UsersNotEnd(const IdToUsersMap::const_iterator& iter, + const ir::Instruction* inst) const { + return UsersNotEnd(iter, id_to_users_.end(), inst); +} + +bool DefUseManager::WhileEachUser( + const ir::Instruction* def, + const std::function& f) const { + // Ensure that |def| has been registered. + assert(def && (!def->HasResultId() || def == GetDef(def->result_id())) && + "Definition is not registered."); + if (!def->HasResultId()) return true; + + auto end = id_to_users_.end(); + for (auto iter = UsersBegin(def); UsersNotEnd(iter, end, def); ++iter) { + if (!f(iter->second)) return false; + } + return true; +} + +bool DefUseManager::WhileEachUser( + uint32_t id, const std::function& f) const { + return WhileEachUser(GetDef(id), f); +} + +void DefUseManager::ForEachUser( + const ir::Instruction* def, + const std::function& f) const { + WhileEachUser(def, [&f](ir::Instruction* user) { + f(user); + return true; + }); +} + +void DefUseManager::ForEachUser( + uint32_t id, const std::function& f) const { + ForEachUser(GetDef(id), f); +} + +bool DefUseManager::WhileEachUse( + const ir::Instruction* def, + const std::function& f) const { + // Ensure that |def| has been registered. + assert(def && (!def->HasResultId() || def == GetDef(def->result_id())) && + "Definition is not registered."); + if (!def->HasResultId()) return true; + + auto end = id_to_users_.end(); + for (auto iter = UsersBegin(def); UsersNotEnd(iter, end, def); ++iter) { + ir::Instruction* user = iter->second; + for (uint32_t idx = 0; idx != user->NumOperands(); ++idx) { + const ir::Operand& op = user->GetOperand(idx); + if (op.type != SPV_OPERAND_TYPE_RESULT_ID && spvIsIdType(op.type)) { + if (def->result_id() == op.words[0]) { + if (!f(user, idx)) return false; + } + } + } + } + return true; +} + +bool DefUseManager::WhileEachUse( + uint32_t id, + const std::function& f) const { + return WhileEachUse(GetDef(id), f); +} + +void DefUseManager::ForEachUse( + const ir::Instruction* def, + const std::function& f) const { + WhileEachUse(def, [&f](ir::Instruction* user, uint32_t index) { + f(user, index); + return true; + }); +} + +void DefUseManager::ForEachUse( + uint32_t id, + const std::function& f) const { + ForEachUse(GetDef(id), f); +} + +uint32_t DefUseManager::NumUsers(const ir::Instruction* def) const { + uint32_t count = 0; + ForEachUser(def, [&count](ir::Instruction*) { ++count; }); + return count; +} + +uint32_t DefUseManager::NumUsers(uint32_t id) const { + return NumUsers(GetDef(id)); +} + +uint32_t DefUseManager::NumUses(const ir::Instruction* def) const { + uint32_t count = 0; + ForEachUse(def, [&count](ir::Instruction*, uint32_t) { ++count; }); + return count; +} + +uint32_t DefUseManager::NumUses(uint32_t id) const { + return NumUses(GetDef(id)); +} + +std::vector DefUseManager::GetAnnotations(uint32_t id) const { + std::vector annos; + const ir::Instruction* def = GetDef(id); + if (!def) return annos; + + ForEachUser(def, [&annos](ir::Instruction* user) { + if (ir::IsAnnotationInst(user->opcode())) { + annos.push_back(user); + } + }); + return annos; +} + +void DefUseManager::AnalyzeDefUse(ir::Module* module) { + if (!module) return; + // Analyze all the defs before any uses to catch forward references. + module->ForEachInst( + std::bind(&DefUseManager::AnalyzeInstDef, this, std::placeholders::_1)); + module->ForEachInst( + std::bind(&DefUseManager::AnalyzeInstUse, this, std::placeholders::_1)); +} + +void DefUseManager::ClearInst(ir::Instruction* inst) { + auto iter = inst_to_used_ids_.find(inst); + if (iter != inst_to_used_ids_.end()) { + EraseUseRecordsOfOperandIds(inst); + if (inst->result_id() != 0) { + // Remove all uses of this inst. + auto users_begin = UsersBegin(inst); + auto end = id_to_users_.end(); + auto new_end = users_begin; + for (; UsersNotEnd(new_end, end, inst); ++new_end) { + } + id_to_users_.erase(users_begin, new_end); + id_to_def_.erase(inst->result_id()); + } + } +} + +void DefUseManager::EraseUseRecordsOfOperandIds(const ir::Instruction* inst) { + // Go through all ids used by this instruction, remove this instruction's + // uses of them. + auto iter = inst_to_used_ids_.find(inst); + if (iter != inst_to_used_ids_.end()) { + for (auto use_id : iter->second) { + id_to_users_.erase( + UserEntry(GetDef(use_id), const_cast(inst))); + } + inst_to_used_ids_.erase(inst); + } +} + +bool operator==(const DefUseManager& lhs, const DefUseManager& rhs) { + if (lhs.id_to_def_ != rhs.id_to_def_) { + return false; + } + + if (lhs.id_to_users_ != rhs.id_to_users_) { + for (auto p : lhs.id_to_users_) { + if (rhs.id_to_users_.count(p) == 0) { + return false; + } + } + for (auto p : rhs.id_to_users_) { + if (lhs.id_to_users_.count(p) == 0) { + return false; + } + } + return false; + } + + if (lhs.inst_to_used_ids_ != lhs.inst_to_used_ids_) { + return false; + } + return true; +} + +} // namespace analysis +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/def_use_manager.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/def_use_manager.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/def_use_manager.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/def_use_manager.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,255 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_DEF_USE_MANAGER_H_ +#define LIBSPIRV_OPT_DEF_USE_MANAGER_H_ + +#include +#include +#include +#include + +#include "instruction.h" +#include "module.h" +#include "spirv-tools/libspirv.hpp" + +namespace spvtools { +namespace opt { +namespace analysis { + +// Class for representing a use of id. Note that: +// * Result type id is a use. +// * Ids referenced in OpSectionMerge & OpLoopMerge are considered as use. +// * Ids referenced in OpPhi's in operands are considered as use. +struct Use { + ir::Instruction* inst; // Instruction using the id. + uint32_t operand_index; // logical operand index of the id use. This can be + // the index of result type id. +}; + +inline bool operator==(const Use& lhs, const Use& rhs) { + return lhs.inst == rhs.inst && lhs.operand_index == rhs.operand_index; +} + +inline bool operator!=(const Use& lhs, const Use& rhs) { return !(lhs == rhs); } + +inline bool operator<(const Use& lhs, const Use& rhs) { + if (lhs.inst < rhs.inst) return true; + if (lhs.inst > rhs.inst) return false; + return lhs.operand_index < rhs.operand_index; +} + +// Definition and user pair. +// +// The first element of the pair is the definition. +// The second element of the pair is the user. +// +// Definition should never be null. User can be null, however, such an entry +// should be used only for searching (e.g. all users of a particular definition) +// and never stored in a container. +using UserEntry = std::pair; + +// Orders UserEntry for use in associative containers (i.e. less than ordering). +// +// The definition of an UserEntry is treated as the major key and the users as +// the minor key so that all the users of a particular definition are +// consecutive in a container. +// +// A null user always compares less than a real user. This is done to provide +// easy values to search for the beginning of the users of a particular +// definition (i.e. using {def, nullptr}). +struct UserEntryLess { + bool operator()(const UserEntry& lhs, const UserEntry& rhs) const { + // If lhs.first and rhs.first are both null, fall through to checking the + // second entries. + if (!lhs.first && rhs.first) return true; + if (lhs.first && !rhs.first) return false; + + // If neither definition is null, then compare unique ids. + if (lhs.first && rhs.first) { + if (lhs.first->unique_id() < rhs.first->unique_id()) return true; + if (rhs.first->unique_id() < lhs.first->unique_id()) return false; + } + + // Return false on equality. + if (!lhs.second && !rhs.second) return false; + if (!lhs.second) return true; + if (!rhs.second) return false; + + // If neither user is null then compare unique ids. + return lhs.second->unique_id() < rhs.second->unique_id(); + } +}; + +// A class for analyzing and managing defs and uses in an ir::Module. +class DefUseManager { + public: + using IdToDefMap = std::unordered_map; + using IdToUsersMap = std::set; + + // Constructs a def-use manager from the given |module|. All internal messages + // will be communicated to the outside via the given message |consumer|. This + // instance only keeps a reference to the |consumer|, so the |consumer| should + // outlive this instance. + DefUseManager(ir::Module* module) { AnalyzeDefUse(module); } + + DefUseManager(const DefUseManager&) = delete; + DefUseManager(DefUseManager&&) = delete; + DefUseManager& operator=(const DefUseManager&) = delete; + DefUseManager& operator=(DefUseManager&&) = delete; + + // Analyzes the defs in the given |inst|. + void AnalyzeInstDef(ir::Instruction* inst); + + // Analyzes the uses in the given |inst|. + // + // All operands of |inst| must be analyzed as defs. + void AnalyzeInstUse(ir::Instruction* inst); + + // Analyzes the defs and uses in the given |inst|. + void AnalyzeInstDefUse(ir::Instruction* inst); + + // Returns the def instruction for the given |id|. If there is no instruction + // defining |id|, returns nullptr. + ir::Instruction* GetDef(uint32_t id); + const ir::Instruction* GetDef(uint32_t id) const; + + // Runs the given function |f| on each unique user instruction of |def| (or + // |id|). + // + // If one instruction uses |def| in multiple operands, that instruction will + // only be visited once. + // + // |def| (or |id|) must be registered as a definition. + void ForEachUser(const ir::Instruction* def, + const std::function& f) const; + void ForEachUser(uint32_t id, + const std::function& f) const; + + // Runs the given function |f| on each unique user instruction of |def| (or + // |id|). If |f| returns false, iteration is terminated and this function + // returns false. + // + // If one instruction uses |def| in multiple operands, that instruction will + // be only be visited once. + // + // |def| (or |id|) must be registered as a definition. + bool WhileEachUser(const ir::Instruction* def, + const std::function& f) const; + bool WhileEachUser(uint32_t id, + const std::function& f) const; + + // Runs the given function |f| on each unique use of |def| (or + // |id|). + // + // If one instruction uses |def| in multiple operands, each operand will be + // visited separately. + // + // |def| (or |id|) must be registered as a definition. + void ForEachUse(const ir::Instruction* def, + const std::function& f) const; + void ForEachUse(uint32_t id, + const std::function& f) const; + + // Runs the given function |f| on each unique use of |def| (or + // |id|). If |f| returns false, iteration is terminated and this function + // returns false. + // + // If one instruction uses |def| in multiple operands, each operand will be + // visited separately. + // + // |def| (or |id|) must be registered as a definition. + bool WhileEachUse(const ir::Instruction* def, + const std::function& f) const; + bool WhileEachUse(uint32_t id, + const std::function& f) const; + + // Returns the number of users of |def| (or |id|). + uint32_t NumUsers(const ir::Instruction* def) const; + uint32_t NumUsers(uint32_t id) const; + + // Returns the number of uses of |def| (or |id|). + uint32_t NumUses(const ir::Instruction* def) const; + uint32_t NumUses(uint32_t id) const; + + // Returns the annotation instrunctions which are a direct use of the given + // |id|. This means when the decorations are applied through decoration + // group(s), this function will just return the OpGroupDecorate + // instrcution(s) which refer to the given id as an operand. The OpDecorate + // instructions which decorate the decoration group will not be returned. + std::vector GetAnnotations(uint32_t id) const; + + // Returns the map from ids to their def instructions. + const IdToDefMap& id_to_defs() const { return id_to_def_; } + // Returns the map from instructions to their users. + const IdToUsersMap& id_to_users() const { return id_to_users_; } + + // Clear the internal def-use record of the given instruction |inst|. This + // method will update the use information of the operand ids of |inst|. The + // record: |inst| uses an |id|, will be removed from the use records of |id|. + // If |inst| defines an result id, the use record of this result id will also + // be removed. Does nothing if |inst| was not analyzed before. + void ClearInst(ir::Instruction* inst); + + // Erases the records that a given instruction uses its operand ids. + void EraseUseRecordsOfOperandIds(const ir::Instruction* inst); + + friend bool operator==(const DefUseManager&, const DefUseManager&); + friend bool operator!=(const DefUseManager& lhs, const DefUseManager& rhs) { + return !(lhs == rhs); + } + + // If |inst| has not already been analysed, then analyses its defintion and + // uses. + void UpdateDefUse(ir::Instruction* inst); + + private: + using InstToUsedIdsMap = + std::unordered_map>; + + // Returns the first location that {|def|, nullptr} could be inserted into the + // users map without violating ordering. + IdToUsersMap::const_iterator UsersBegin(const ir::Instruction* def) const; + + // Returns true if |iter| has not reached the end of |def|'s users. + // + // In the first version |iter| is compared against the end of the map for + // validity before other checks. In the second version, |iter| is compared + // against |cached_end| for validity before other checks. This allows caching + // the map's end which is a performance improvement on some platforms. + bool UsersNotEnd(const IdToUsersMap::const_iterator& iter, + const ir::Instruction* def) const; + bool UsersNotEnd(const IdToUsersMap::const_iterator& iter, + const IdToUsersMap::const_iterator& cached_end, + const ir::Instruction* def) const; + + // Analyzes the defs and uses in the given |module| and populates data + // structures in this class. Does nothing if |module| is nullptr. + void AnalyzeDefUse(ir::Module* module); + + IdToDefMap id_to_def_; // Mapping from ids to their definitions + IdToUsersMap id_to_users_; // Mapping from ids to their users + // Mapping from instructions to the ids used in the instruction. + InstToUsedIdsMap inst_to_used_ids_; +}; + +} // namespace analysis +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_DEF_USE_MANAGER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dominator_analysis.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dominator_analysis.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dominator_analysis.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dominator_analysis.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,73 @@ +// Copyright (c) 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "dominator_analysis.h" + +#include + +#include "ir_context.h" + +namespace spvtools { +namespace opt { + +ir::BasicBlock* DominatorAnalysisBase::CommonDominator( + ir::BasicBlock* b1, ir::BasicBlock* b2) const { + if (!b1 || !b2) return nullptr; + + std::unordered_set seen; + ir::BasicBlock* block = b1; + while (block && seen.insert(block).second) { + block = ImmediateDominator(block); + } + + block = b2; + while (block && !seen.count(block)) { + block = ImmediateDominator(block); + } + + return block; +} + +bool DominatorAnalysisBase::Dominates(ir::Instruction* a, + ir::Instruction* b) const { + if (!a || !b) { + return false; + } + + if (a == b) { + return true; + } + + ir::BasicBlock* bb_a = a->context()->get_instr_block(a); + ir::BasicBlock* bb_b = b->context()->get_instr_block(b); + + if (bb_a != bb_b) { + return tree_.Dominates(bb_a, bb_b); + } + + for (ir::Instruction& inst : *bb_a) { + if (&inst == a) { + return true; + } else if (&inst == b) { + return false; + } + } + assert(false && + "We did not find the load or store in the block they are " + "supposed to be in."); + return false; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dominator_analysis.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dominator_analysis.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dominator_analysis.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dominator_analysis.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,140 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_DOMINATOR_ANALYSIS_PASS_H_ +#define LIBSPIRV_OPT_DOMINATOR_ANALYSIS_PASS_H_ + +#include +#include + +#include "dominator_tree.h" +#include "module.h" + +namespace spvtools { +namespace opt { + +// Interface to perform dominator or postdominator analysis on a given function. +class DominatorAnalysisBase { + public: + explicit DominatorAnalysisBase(bool is_post_dom) : tree_(is_post_dom) {} + + // Calculates the dominator (or postdominator) tree for given function |f|. + inline void InitializeTree(const ir::Function* f, const ir::CFG& cfg) { + tree_.InitializeTree(f, cfg); + } + + // Returns true if BasicBlock |a| dominates BasicBlock |b|. + inline bool Dominates(const ir::BasicBlock* a, + const ir::BasicBlock* b) const { + if (!a || !b) return false; + return Dominates(a->id(), b->id()); + } + + // Returns true if BasicBlock |a| dominates BasicBlock |b|. Same as above only + // using the BasicBlock IDs. + inline bool Dominates(uint32_t a, uint32_t b) const { + return tree_.Dominates(a, b); + } + + // Returns true if instruction |a| dominates instruction |b|. + bool Dominates(ir::Instruction* a, ir::Instruction* b) const; + + // Returns true if BasicBlock |a| strictly dominates BasicBlock |b|. + inline bool StrictlyDominates(const ir::BasicBlock* a, + const ir::BasicBlock* b) const { + if (!a || !b) return false; + return StrictlyDominates(a->id(), b->id()); + } + + // Returns true if BasicBlock |a| strictly dominates BasicBlock |b|. Same as + // above only using the BasicBlock IDs. + inline bool StrictlyDominates(uint32_t a, uint32_t b) const { + return tree_.StrictlyDominates(a, b); + } + + // Returns the immediate dominator of |node| or returns nullptr if it is has + // no dominator. + inline ir::BasicBlock* ImmediateDominator(const ir::BasicBlock* node) const { + if (!node) return nullptr; + return tree_.ImmediateDominator(node); + } + + // Returns the immediate dominator of |node_id| or returns nullptr if it is + // has no dominator. Same as above but operates on IDs. + inline ir::BasicBlock* ImmediateDominator(uint32_t node_id) const { + return tree_.ImmediateDominator(node_id); + } + + // Returns true if |node| is reachable from the entry. + inline bool IsReachable(const ir::BasicBlock* node) const { + if (!node) return false; + return tree_.ReachableFromRoots(node->id()); + } + + // Returns true if |node_id| is reachable from the entry. + inline bool IsReachable(uint32_t node_id) const { + return tree_.ReachableFromRoots(node_id); + } + + // Dump the tree structure into the given |out| stream in the dot format. + inline void DumpAsDot(std::ostream& out) const { tree_.DumpTreeAsDot(out); } + + // Returns true if this is a postdomiator tree. + inline bool IsPostDominator() const { return tree_.IsPostDominator(); } + + // Returns the tree itself for manual operations, such as traversing the + // roots. + // For normal dominance relationships the methods above should be used. + inline DominatorTree& GetDomTree() { return tree_; } + inline const DominatorTree& GetDomTree() const { return tree_; } + + // Force the dominator tree to be removed + inline void ClearTree() { tree_.ClearTree(); } + + // Applies the std::function |func| to dominator tree nodes in dominator + // order. + void Visit(std::function func) { + tree_.Visit(func); + } + + // Applies the std::function |func| to dominator tree nodes in dominator + // order. + void Visit(std::function func) const { + tree_.Visit(func); + } + + // Returns the most immediate basic block that dominates both |b1| and |b2|. + // If there is no such basic block, nullptr is returned. + ir::BasicBlock* CommonDominator(ir::BasicBlock* b1, ir::BasicBlock* b2) const; + + protected: + DominatorTree tree_; +}; + +// Derived class for normal dominator analysis. +class DominatorAnalysis : public DominatorAnalysisBase { + public: + DominatorAnalysis() : DominatorAnalysisBase(false) {} +}; + +// Derived class for postdominator analysis. +class PostDominatorAnalysis : public DominatorAnalysisBase { + public: + PostDominatorAnalysis() : DominatorAnalysisBase(true) {} +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_DOMINATOR_ANALYSIS_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dominator_tree.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dominator_tree.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dominator_tree.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dominator_tree.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,399 @@ +// Copyright (c) 2017 Google 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. + +#include +#include +#include + +#include "cfa.h" +#include "dominator_tree.h" + +using namespace spvtools; +using namespace spvtools::opt; + +// Calculates the dominator or postdominator tree for a given function. +// 1 - Compute the successors and predecessors for each BasicBlock. We add a +// dummy node for the start node or for postdominators the exit. This node will +// point to all entry or all exit nodes. +// 2 - Using the CFA::DepthFirstTraversal get a depth first postordered list of +// all BasicBlocks. Using the successors (or for postdominator, predecessors) +// calculated in step 1 to traverse the tree. +// 3 - Pass the list calculated in step 2 to the CFA::CalculateDominators using +// the predecessors list (or for postdominator, successors). This will give us a +// vector of BB pairs. Each BB and its immediate dominator. +// 4 - Using the list from 3 use those edges to build a tree of +// DominatorTreeNodes. Each node containing a link to the parent dominator and +// children which are dominated. +// 5 - Using the tree from 4, perform a depth first traversal to calculate the +// preorder and postorder index of each node. We use these indexes to compare +// nodes against each other for domination checks. + +namespace { + +// Wrapper around CFA::DepthFirstTraversal to provide an interface to perform +// depth first search on generic BasicBlock types. Will call post and pre order +// user defined functions during traversal +// +// BBType - BasicBlock type. Will either be ir::BasicBlock or DominatorTreeNode +// SuccessorLambda - Lamdba matching the signature of 'const +// std::vector*(const BBType *A)'. Will return a vector of the nodes +// succeding BasicBlock A. +// PostLambda - Lamdba matching the signature of 'void (const BBType*)' will be +// called on each node traversed AFTER their children. +// PreLambda - Lamdba matching the signature of 'void (const BBType*)' will be +// called on each node traversed BEFORE their children. +template +static void DepthFirstSearch(const BBType* bb, SuccessorLambda successors, + PreLambda pre, PostLambda post) { + // Ignore backedge operation. + auto nop_backedge = [](const BBType*, const BBType*) {}; + CFA::DepthFirstTraversal(bb, successors, pre, post, nop_backedge); +} + +// Wrapper around CFA::DepthFirstTraversal to provide an interface to perform +// depth first search on generic BasicBlock types. This overload is for only +// performing user defined post order. +// +// BBType - BasicBlock type. Will either be ir::BasicBlock or DominatorTreeNode +// SuccessorLambda - Lamdba matching the signature of 'const +// std::vector*(const BBType *A)'. Will return a vector of the nodes +// succeding BasicBlock A. +// PostLambda - Lamdba matching the signature of 'void (const BBType*)' will be +// called on each node traversed after their children. +template +static void DepthFirstSearchPostOrder(const BBType* bb, + SuccessorLambda successors, + PostLambda post) { + // Ignore preorder operation. + auto nop_preorder = [](const BBType*) {}; + DepthFirstSearch(bb, successors, nop_preorder, post); +} + +// Small type trait to get the function class type. +template +struct GetFunctionClass { + using FunctionType = ir::Function; +}; + +// Helper class to compute predecessors and successors for each Basic Block in a +// function. Through GetPredFunctor and GetSuccessorFunctor it provides an +// interface to get the successor and predecessor lists for each basic +// block. This is required by the DepthFirstTraversal and ComputeDominator +// functions which take as parameter an std::function returning the successors +// and predecessors respectively. +// +// When computing the post-dominator tree, all edges are inverted. So successors +// returned by this class will be predecessors in the original CFG. +template +class BasicBlockSuccessorHelper { + // This should eventually become const ir::BasicBlock. + using BasicBlock = BBType; + using Function = typename GetFunctionClass::FunctionType; + + using BasicBlockListTy = std::vector; + using BasicBlockMapTy = std::map; + + public: + // For compliance with the dominance tree computation, entry nodes are + // connected to a single dummy node. + BasicBlockSuccessorHelper(Function& func, const BasicBlock* dummy_start_node, + bool post); + + // CFA::CalculateDominators requires std::vector. + using GetBlocksFunction = + std::function*(const BasicBlock*)>; + + // Returns the list of predecessor functions. + GetBlocksFunction GetPredFunctor() { + return [this](const BasicBlock* bb) { + BasicBlockListTy* v = &this->predecessors_[bb]; + return v; + }; + } + + // Returns a vector of the list of successor nodes from a given node. + GetBlocksFunction GetSuccessorFunctor() { + return [this](const BasicBlock* bb) { + BasicBlockListTy* v = &this->successors_[bb]; + return v; + }; + } + + private: + bool invert_graph_; + BasicBlockMapTy successors_; + BasicBlockMapTy predecessors_; + + // Build the successors and predecessors map for each basic blocks |f|. + // If |invert_graph_| is true, all edges are reversed (successors becomes + // predecessors and vice versa). + // For convenience, the start of the graph is |dummy_start_node|. + // The dominator tree construction requires a unique entry node, which cannot + // be guaranteed for the postdominator graph. The |dummy_start_node| BB is + // here to gather all entry nodes. + void CreateSuccessorMap(Function& f, const BasicBlock* dummy_start_node); +}; + +template +BasicBlockSuccessorHelper::BasicBlockSuccessorHelper( + Function& func, const BasicBlock* dummy_start_node, bool invert) + : invert_graph_(invert) { + CreateSuccessorMap(func, dummy_start_node); +} + +template +void BasicBlockSuccessorHelper::CreateSuccessorMap( + Function& f, const BasicBlock* dummy_start_node) { + std::map id_to_BB_map; + auto GetSuccessorBasicBlock = [&f, &id_to_BB_map](uint32_t successor_id) { + BasicBlock*& Succ = id_to_BB_map[successor_id]; + if (!Succ) { + for (BasicBlock& BBIt : f) { + if (successor_id == BBIt.id()) { + Succ = &BBIt; + break; + } + } + } + return Succ; + }; + + if (invert_graph_) { + // For the post dominator tree, we see the inverted graph. + // successors_ in the inverted graph are the predecessors in the CFG. + // The tree construction requires 1 entry point, so we add a dummy node + // that is connected to all function exiting basic blocks. + // An exiting basic block is a block with an OpKill, OpUnreachable, + // OpReturn or OpReturnValue as terminator instruction. + for (BasicBlock& bb : f) { + if (bb.hasSuccessor()) { + BasicBlockListTy& pred_list = predecessors_[&bb]; + const auto& const_bb = bb; + const_bb.ForEachSuccessorLabel( + [this, &pred_list, &bb, + &GetSuccessorBasicBlock](const uint32_t successor_id) { + BasicBlock* succ = GetSuccessorBasicBlock(successor_id); + // Inverted graph: our successors in the CFG + // are our predecessors in the inverted graph. + this->successors_[succ].push_back(&bb); + pred_list.push_back(succ); + }); + } else { + successors_[dummy_start_node].push_back(&bb); + predecessors_[&bb].push_back(const_cast(dummy_start_node)); + } + } + } else { + successors_[dummy_start_node].push_back(f.entry().get()); + predecessors_[f.entry().get()].push_back( + const_cast(dummy_start_node)); + for (BasicBlock& bb : f) { + BasicBlockListTy& succ_list = successors_[&bb]; + + const auto& const_bb = bb; + const_bb.ForEachSuccessorLabel([&](const uint32_t successor_id) { + BasicBlock* succ = GetSuccessorBasicBlock(successor_id); + succ_list.push_back(succ); + predecessors_[succ].push_back(&bb); + }); + } + } +} + +} // namespace + +namespace spvtools { +namespace opt { + +bool DominatorTree::StrictlyDominates(uint32_t a, uint32_t b) const { + if (a == b) return false; + return Dominates(a, b); +} + +bool DominatorTree::StrictlyDominates(const ir::BasicBlock* a, + const ir::BasicBlock* b) const { + return DominatorTree::StrictlyDominates(a->id(), b->id()); +} + +bool DominatorTree::StrictlyDominates(const DominatorTreeNode* a, + const DominatorTreeNode* b) const { + if (a == b) return false; + return Dominates(a, b); +} + +bool DominatorTree::Dominates(uint32_t a, uint32_t b) const { + // Check that both of the inputs are actual nodes. + const DominatorTreeNode* a_node = GetTreeNode(a); + const DominatorTreeNode* b_node = GetTreeNode(b); + if (!a_node || !b_node) return false; + + return Dominates(a_node, b_node); +} + +bool DominatorTree::Dominates(const DominatorTreeNode* a, + const DominatorTreeNode* b) const { + // Node A dominates node B if they are the same. + if (a == b) return true; + + return a->dfs_num_pre_ < b->dfs_num_pre_ && + a->dfs_num_post_ > b->dfs_num_post_; +} + +bool DominatorTree::Dominates(const ir::BasicBlock* A, + const ir::BasicBlock* B) const { + return Dominates(A->id(), B->id()); +} + +ir::BasicBlock* DominatorTree::ImmediateDominator( + const ir::BasicBlock* A) const { + return ImmediateDominator(A->id()); +} + +ir::BasicBlock* DominatorTree::ImmediateDominator(uint32_t a) const { + // Check that A is a valid node in the tree. + auto a_itr = nodes_.find(a); + if (a_itr == nodes_.end()) return nullptr; + + const DominatorTreeNode* node = &a_itr->second; + + if (node->parent_ == nullptr) { + return nullptr; + } + + return node->parent_->bb_; +} + +DominatorTreeNode* DominatorTree::GetOrInsertNode(ir::BasicBlock* bb) { + DominatorTreeNode* dtn = nullptr; + + std::map::iterator node_iter = + nodes_.find(bb->id()); + if (node_iter == nodes_.end()) { + dtn = &nodes_.emplace(std::make_pair(bb->id(), DominatorTreeNode{bb})) + .first->second; + } else + dtn = &node_iter->second; + + return dtn; +} + +void DominatorTree::GetDominatorEdges( + const ir::Function* f, const ir::BasicBlock* dummy_start_node, + std::vector>* edges) { + // Each time the depth first traversal calls the postorder callback + // std::function we push that node into the postorder vector to create our + // postorder list. + std::vector postorder; + auto postorder_function = [&](const ir::BasicBlock* b) { + postorder.push_back(b); + }; + + // CFA::CalculateDominators requires std::vector + // BB are derived from F, so we need to const cast it at some point + // no modification is made on F. + BasicBlockSuccessorHelper helper{ + *const_cast(f), dummy_start_node, postdominator_}; + + // The successor function tells DepthFirstTraversal how to move to successive + // nodes by providing an interface to get a list of successor nodes from any + // given node. + auto successor_functor = helper.GetSuccessorFunctor(); + + // The predecessor functor does the same as the successor functor + // but for all nodes preceding a given node. + auto predecessor_functor = helper.GetPredFunctor(); + + // If we're building a post dominator tree we traverse the tree in reverse + // using the predecessor function in place of the successor function and vice + // versa. + DepthFirstSearchPostOrder(dummy_start_node, successor_functor, + postorder_function); + *edges = + CFA::CalculateDominators(postorder, predecessor_functor); +} + +void DominatorTree::InitializeTree(const ir::Function* f, const ir::CFG& cfg) { + ClearTree(); + + // Skip over empty functions. + if (f->cbegin() == f->cend()) { + return; + } + + const ir::BasicBlock* dummy_start_node = + postdominator_ ? cfg.pseudo_exit_block() : cfg.pseudo_entry_block(); + + // Get the immediate dominator for each node. + std::vector> edges; + GetDominatorEdges(f, dummy_start_node, &edges); + + // Transform the vector into the tree structure which we can use to + // efficiently query dominance. + for (auto edge : edges) { + DominatorTreeNode* first = GetOrInsertNode(edge.first); + + if (edge.first == edge.second) { + if (std::find(roots_.begin(), roots_.end(), first) == roots_.end()) + roots_.push_back(first); + continue; + } + + DominatorTreeNode* second = GetOrInsertNode(edge.second); + + first->parent_ = second; + second->children_.push_back(first); + } + ResetDFNumbering(); +} + +void DominatorTree::ResetDFNumbering() { + int index = 0; + auto preFunc = [&index](const DominatorTreeNode* node) { + const_cast(node)->dfs_num_pre_ = ++index; + }; + + auto postFunc = [&index](const DominatorTreeNode* node) { + const_cast(node)->dfs_num_post_ = ++index; + }; + + auto getSucc = [](const DominatorTreeNode* node) { return &node->children_; }; + + for (auto root : roots_) DepthFirstSearch(root, getSucc, preFunc, postFunc); +} + +void DominatorTree::DumpTreeAsDot(std::ostream& out_stream) const { + out_stream << "digraph {\n"; + Visit([&out_stream](const DominatorTreeNode* node) { + // Print the node. + if (node->bb_) { + out_stream << node->bb_->id() << "[label=\"" << node->bb_->id() + << "\"];\n"; + } + + // Print the arrow from the parent to this node. Entry nodes will not have + // parents so draw them as children from the dummy node. + if (node->parent_) { + out_stream << node->parent_->bb_->id() << " -> " << node->bb_->id() + << ";\n"; + } + + // Return true to continue the traversal. + return true; + }); + out_stream << "}\n"; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dominator_tree.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dominator_tree.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/dominator_tree.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/dominator_tree.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,306 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_DOMINATOR_ANALYSIS_TREE_H_ +#define LIBSPIRV_OPT_DOMINATOR_ANALYSIS_TREE_H_ + +#include +#include +#include +#include +#include + +#include "cfg.h" +#include "module.h" +#include "tree_iterator.h" + +namespace spvtools { +namespace opt { +// This helper struct forms the nodes in the tree, with each node containing its +// children. It also contains two values, for the pre and post indexes in the +// tree which are used to compare two nodes. +struct DominatorTreeNode { + explicit DominatorTreeNode(ir::BasicBlock* bb) + : bb_(bb), + parent_(nullptr), + children_({}), + dfs_num_pre_(-1), + dfs_num_post_(-1) {} + + using iterator = std::vector::iterator; + using const_iterator = std::vector::const_iterator; + + // depth first preorder iterator. + using df_iterator = TreeDFIterator; + using const_df_iterator = TreeDFIterator; + // depth first postorder iterator. + using post_iterator = PostOrderTreeDFIterator; + using const_post_iterator = PostOrderTreeDFIterator; + + iterator begin() { return children_.begin(); } + iterator end() { return children_.end(); } + const_iterator begin() const { return cbegin(); } + const_iterator end() const { return cend(); } + const_iterator cbegin() const { return children_.begin(); } + const_iterator cend() const { return children_.end(); } + + // Depth first preorder iterator using this node as root. + df_iterator df_begin() { return df_iterator(this); } + df_iterator df_end() { return df_iterator(); } + const_df_iterator df_begin() const { return df_cbegin(); } + const_df_iterator df_end() const { return df_cend(); } + const_df_iterator df_cbegin() const { return const_df_iterator(this); } + const_df_iterator df_cend() const { return const_df_iterator(); } + + // Depth first postorder iterator using this node as root. + post_iterator post_begin() { return post_iterator::begin(this); } + post_iterator post_end() { return post_iterator::end(nullptr); } + const_post_iterator post_begin() const { return post_cbegin(); } + const_post_iterator post_end() const { return post_cend(); } + const_post_iterator post_cbegin() const { + return const_post_iterator::begin(this); + } + const_post_iterator post_cend() const { + return const_post_iterator::end(nullptr); + } + + inline uint32_t id() const { return bb_->id(); } + + ir::BasicBlock* bb_; + DominatorTreeNode* parent_; + std::vector children_; + + // These indexes are used to compare two given nodes. A node is a child or + // grandchild of another node if its preorder index is greater than the + // first nodes preorder index AND if its postorder index is less than the + // first nodes postorder index. + int dfs_num_pre_; + int dfs_num_post_; +}; + +// A class representing a tree of BasicBlocks in a given function, where each +// node is dominated by its parent. +class DominatorTree { + public: + // Map OpLabel ids to dominator tree nodes + using DominatorTreeNodeMap = std::map; + using iterator = TreeDFIterator; + using const_iterator = TreeDFIterator; + using post_iterator = PostOrderTreeDFIterator; + using const_post_iterator = PostOrderTreeDFIterator; + + // List of DominatorTreeNode to define the list of roots + using DominatorTreeNodeList = std::vector; + using roots_iterator = DominatorTreeNodeList::iterator; + using roots_const_iterator = DominatorTreeNodeList::const_iterator; + + DominatorTree() : postdominator_(false) {} + explicit DominatorTree(bool post) : postdominator_(post) {} + + // Depth first iterators. + // Traverse the dominator tree in a depth first pre-order. + // The pseudo-block is ignored. + iterator begin() { return ++iterator(GetRoot()); } + iterator end() { return iterator(); } + const_iterator begin() const { return cbegin(); } + const_iterator end() const { return cend(); } + const_iterator cbegin() const { return ++const_iterator(GetRoot()); } + const_iterator cend() const { return const_iterator(); } + + // Traverse the dominator tree in a depth first post-order. + // The pseudo-block is ignored. + post_iterator post_begin() { return post_iterator::begin(GetRoot()); } + post_iterator post_end() { return post_iterator::end(GetRoot()); } + const_post_iterator post_begin() const { return post_cbegin(); } + const_post_iterator post_end() const { return post_cend(); } + const_post_iterator post_cbegin() const { + return const_post_iterator::begin(GetRoot()); + } + const_post_iterator post_cend() const { + return const_post_iterator::end(GetRoot()); + } + + roots_iterator roots_begin() { return roots_.begin(); } + roots_iterator roots_end() { return roots_.end(); } + roots_const_iterator roots_begin() const { return roots_cbegin(); } + roots_const_iterator roots_end() const { return roots_cend(); } + roots_const_iterator roots_cbegin() const { return roots_.begin(); } + roots_const_iterator roots_cend() const { return roots_.end(); } + + // Get the unique root of the tree. + // It is guaranteed to work on a dominator tree. + // post-dominator might have a list. + DominatorTreeNode* GetRoot() { + assert(roots_.size() == 1); + return *roots_.begin(); + } + + const DominatorTreeNode* GetRoot() const { + assert(roots_.size() == 1); + return *roots_.begin(); + } + + const DominatorTreeNodeList& Roots() const { return roots_; } + + // Dumps the tree in the graphvis dot format into the |out_stream|. + void DumpTreeAsDot(std::ostream& out_stream) const; + + // Build the (post-)dominator tree for the function |f| + // Any existing data will be overwritten + void InitializeTree(const ir::Function* f, const ir::CFG& cfg); + + // Check if the basic block |a| dominates the basic block |b|. + bool Dominates(const ir::BasicBlock* a, const ir::BasicBlock* b) const; + + // Check if the basic block id |a| dominates the basic block id |b|. + bool Dominates(uint32_t a, uint32_t b) const; + + // Check if the dominator tree node |a| dominates the dominator tree node |b|. + bool Dominates(const DominatorTreeNode* a, const DominatorTreeNode* b) const; + + // Check if the basic block |a| strictly dominates the basic block |b|. + bool StrictlyDominates(const ir::BasicBlock* a, + const ir::BasicBlock* b) const; + + // Check if the basic block id |a| strictly dominates the basic block id |b|. + bool StrictlyDominates(uint32_t a, uint32_t b) const; + + // Check if the dominator tree node |a| strictly dominates the dominator tree + // node |b|. + bool StrictlyDominates(const DominatorTreeNode* a, + const DominatorTreeNode* b) const; + + // Returns the immediate dominator of basic block |a|. + ir::BasicBlock* ImmediateDominator(const ir::BasicBlock* A) const; + + // Returns the immediate dominator of basic block id |a|. + ir::BasicBlock* ImmediateDominator(uint32_t a) const; + + // Returns true if the basic block |a| is reachable by this tree. A node would + // be unreachable if it cannot be reached by traversal from the start node or + // for a postdominator tree, cannot be reached from the exit nodes. + inline bool ReachableFromRoots(const ir::BasicBlock* a) const { + if (!a) return false; + return ReachableFromRoots(a->id()); + } + + // Returns true if the basic block id |a| is reachable by this tree. + bool ReachableFromRoots(uint32_t a) const { + return GetTreeNode(a) != nullptr; + } + + // Returns true if this tree is a post dominator tree. + bool IsPostDominator() const { return postdominator_; } + + // Clean up the tree. + void ClearTree() { + nodes_.clear(); + roots_.clear(); + } + + // Applies the std::function |func| to all nodes in the dominator tree. + // Tree nodes are visited in a depth first pre-order. + bool Visit(std::function func) { + for (auto n : *this) { + if (!func(&n)) return false; + } + return true; + } + + // Applies the std::function |func| to all nodes in the dominator tree. + // Tree nodes are visited in a depth first pre-order. + bool Visit(std::function func) const { + for (auto n : *this) { + if (!func(&n)) return false; + } + return true; + } + + // Applies the std::function |func| to all nodes in the dominator tree from + // |node| downwards. The boolean return from |func| is used to determine + // whether or not the children should also be traversed. Tree nodes are + // visited in a depth first pre-order. + void VisitChildrenIf(std::function func, + iterator node) { + if (func(&*node)) { + for (auto n : *node) { + VisitChildrenIf(func, n->df_begin()); + } + } + } + + // Returns the DominatorTreeNode associated with the basic block |bb|. + // If the |bb| is unknown to the dominator tree, it returns null. + inline DominatorTreeNode* GetTreeNode(ir::BasicBlock* bb) { + return GetTreeNode(bb->id()); + } + // Returns the DominatorTreeNode associated with the basic block |bb|. + // If the |bb| is unknown to the dominator tree, it returns null. + inline const DominatorTreeNode* GetTreeNode(ir::BasicBlock* bb) const { + return GetTreeNode(bb->id()); + } + + // Returns the DominatorTreeNode associated with the basic block id |id|. + // If the id |id| is unknown to the dominator tree, it returns null. + inline DominatorTreeNode* GetTreeNode(uint32_t id) { + DominatorTreeNodeMap::iterator node_iter = nodes_.find(id); + if (node_iter == nodes_.end()) { + return nullptr; + } + return &node_iter->second; + } + // Returns the DominatorTreeNode associated with the basic block id |id|. + // If the id |id| is unknown to the dominator tree, it returns null. + inline const DominatorTreeNode* GetTreeNode(uint32_t id) const { + DominatorTreeNodeMap::const_iterator node_iter = nodes_.find(id); + if (node_iter == nodes_.end()) { + return nullptr; + } + return &node_iter->second; + } + + // Adds the basic block |bb| to the tree structure if it doesn't already + // exist. + DominatorTreeNode* GetOrInsertNode(ir::BasicBlock* bb); + + // Recomputes the DF numbering of the tree. + void ResetDFNumbering(); + + private: + // Wrapper function which gets the list of pairs of each BasicBlocks to its + // immediately dominating BasicBlock and stores the result in the the edges + // parameter. + // + // The |edges| vector will contain the dominator tree as pairs of nodes. + // The first node in the pair is a node in the graph. The second node in the + // pair is its immediate dominator. + // The root of the tree has themself as immediate dominator. + void GetDominatorEdges( + const ir::Function* f, const ir::BasicBlock* dummy_start_node, + std::vector>* edges); + + // The roots of the tree. + std::vector roots_; + + // Pairs each basic block id to the tree node containing that basic block. + DominatorTreeNodeMap nodes_; + + // True if this is a post dominator tree. + bool postdominator_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_DOMINATOR_ANALYSIS_TREE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/eliminate_dead_constant_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/eliminate_dead_constant_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/eliminate_dead_constant_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/eliminate_dead_constant_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,103 @@ +// Copyright (c) 2016 Google 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. + +#include "eliminate_dead_constant_pass.h" + +#include +#include +#include + +#include "def_use_manager.h" +#include "ir_context.h" +#include "log.h" +#include "reflect.h" + +namespace spvtools { +namespace opt { + +Pass::Status EliminateDeadConstantPass::Process(ir::IRContext* irContext) { + std::unordered_set working_list; + // Traverse all the instructions to get the initial set of dead constants as + // working list and count number of real uses for constants. Uses in + // annotation instructions do not count. + std::unordered_map use_counts; + std::vector constants = irContext->GetConstants(); + for (auto* c : constants) { + uint32_t const_id = c->result_id(); + size_t count = 0; + irContext->get_def_use_mgr()->ForEachUse( + const_id, [&count](ir::Instruction* user, uint32_t index) { + (void)index; + SpvOp op = user->opcode(); + if (!(ir::IsAnnotationInst(op) || ir::IsDebug1Inst(op) || + ir::IsDebug2Inst(op) || ir::IsDebug3Inst(op))) { + ++count; + } + }); + use_counts[c] = count; + if (!count) { + working_list.insert(c); + } + } + + // Start from the constants with 0 uses, back trace through the def-use chain + // to find all dead constants. + std::unordered_set dead_consts; + while (!working_list.empty()) { + ir::Instruction* inst = *working_list.begin(); + // Back propagate if the instruction contains IDs in its operands. + switch (inst->opcode()) { + case SpvOp::SpvOpConstantComposite: + case SpvOp::SpvOpSpecConstantComposite: + case SpvOp::SpvOpSpecConstantOp: + for (uint32_t i = 0; i < inst->NumInOperands(); i++) { + // SpecConstantOp instruction contains 'opcode' as its operand. Need + // to exclude such operands when decreasing uses. + if (inst->GetInOperand(i).type != SPV_OPERAND_TYPE_ID) { + continue; + } + uint32_t operand_id = inst->GetSingleWordInOperand(i); + ir::Instruction* def_inst = + irContext->get_def_use_mgr()->GetDef(operand_id); + // If the use_count does not have any count for the def_inst, + // def_inst must not be a constant, and should be ignored here. + if (!use_counts.count(def_inst)) { + continue; + } + // The number of uses should never be less then 0, so it can not be + // less than 1 before it decreases. + SPIRV_ASSERT(consumer(), use_counts[def_inst] > 0); + --use_counts[def_inst]; + if (!use_counts[def_inst]) { + working_list.insert(def_inst); + } + } + break; + default: + break; + } + dead_consts.insert(inst); + working_list.erase(inst); + } + + // Turn all dead instructions and uses of them to nop + for (auto* dc : dead_consts) { + irContext->KillDef(dc->result_id()); + } + return dead_consts.empty() ? Status::SuccessWithoutChange + : Status::SuccessWithChange; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/eliminate_dead_constant_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/eliminate_dead_constant_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/eliminate_dead_constant_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/eliminate_dead_constant_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,35 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_ELIMINATE_DEAD_CONSTANT_PASS_H_ +#define LIBSPIRV_OPT_ELIMINATE_DEAD_CONSTANT_PASS_H_ + +#include "ir_context.h" +#include "module.h" +#include "pass.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class EliminateDeadConstantPass : public Pass { + public: + const char* name() const override { return "eliminate-dead-const"; } + Status Process(ir::IRContext*) override; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_ELIMINATE_DEAD_CONSTANT_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/eliminate_dead_functions_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/eliminate_dead_functions_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/eliminate_dead_functions_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/eliminate_dead_functions_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,57 @@ +// Copyright (c) 2017 Google 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. + +#include "eliminate_dead_functions_pass.h" +#include "ir_context.h" + +#include + +namespace spvtools { +namespace opt { + +Pass::Status EliminateDeadFunctionsPass::Process(ir::IRContext* c) { + InitializeProcessing(c); + + // Identify live functions first. Those that are not live + // are dead. + std::unordered_set live_function_set; + ProcessFunction mark_live = [&live_function_set](ir::Function* fp) { + live_function_set.insert(fp); + return false; + }; + ProcessReachableCallTree(mark_live, context()); + + bool modified = false; + for (auto funcIter = get_module()->begin(); + funcIter != get_module()->end();) { + if (live_function_set.count(&*funcIter) == 0) { + modified = true; + EliminateFunction(&*funcIter); + funcIter = funcIter.Erase(); + } else { + ++funcIter; + } + } + + return modified ? Pass::Status::SuccessWithChange + : Pass::Status::SuccessWithoutChange; +} + +void EliminateDeadFunctionsPass::EliminateFunction(ir::Function* func) { + // Remove all of the instruction in the function body + func->ForEachInst( + [this](ir::Instruction* inst) { context()->KillInst(inst); }, true); +} +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/eliminate_dead_functions_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/eliminate_dead_functions_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/eliminate_dead_functions_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/eliminate_dead_functions_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,43 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_ELIMINATE_DEAD_FUNCTIONS_PASS_H_ +#define LIBSPIRV_OPT_ELIMINATE_DEAD_FUNCTIONS_PASS_H_ + +#include "def_use_manager.h" +#include "function.h" +#include "mem_pass.h" +#include "module.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class EliminateDeadFunctionsPass : public MemPass { + public: + const char* name() const override { return "eliminate-dead-functions"; } + Status Process(ir::IRContext* c) override; + + ir::IRContext::Analysis GetPreservedAnalyses() override { + return ir::IRContext::kAnalysisDefUse; + } + + private: + void EliminateFunction(ir::Function* func); +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_ELIMINATE_DEAD_FUNCTIONS_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/feature_manager.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/feature_manager.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/feature_manager.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/feature_manager.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2017 Google 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. + +#include "feature_manager.h" +#include +#include + +#include "enum_string_mapping.h" + +namespace spvtools { +namespace opt { + +void FeatureManager::Analyze(ir::Module* module) { + AddExtensions(module); + AddCapabilities(module); + AddExtInstImportIds(module); +} + +void FeatureManager::AddExtensions(ir::Module* module) { + for (auto ext : module->extensions()) { + const std::string name = + reinterpret_cast(ext.GetInOperand(0u).words.data()); + libspirv::Extension extension; + if (libspirv::GetExtensionFromString(name.c_str(), &extension)) { + extensions_.Add(extension); + } + } +} + +void FeatureManager::AddCapability(SpvCapability cap) { + if (capabilities_.Contains(cap)) return; + + capabilities_.Add(cap); + + spv_operand_desc desc = {}; + if (SPV_SUCCESS == + grammar_.lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, cap, &desc)) { + libspirv::CapabilitySet(desc->numCapabilities, desc->capabilities) + .ForEach([this](SpvCapability c) { AddCapability(c); }); + } +} + +void FeatureManager::AddCapabilities(ir::Module* module) { + for (ir::Instruction& inst : module->capabilities()) { + AddCapability(static_cast(inst.GetSingleWordInOperand(0))); + } +} + +void FeatureManager::AddExtInstImportIds(ir::Module* module) { + extinst_importid_GLSLstd450_ = module->GetExtInstImportId("GLSL.std.450"); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/feature_manager.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/feature_manager.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/feature_manager.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/feature_manager.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,83 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_FEATURE_MANAGER_H_ +#define LIBSPIRV_OPT_FEATURE_MANAGER_H_ + +#include "assembly_grammar.h" +#include "extensions.h" +#include "module.h" + +namespace spvtools { +namespace opt { + +// Tracks features enabled by a module. The IRContext has a FeatureManager. +class FeatureManager { + public: + explicit FeatureManager(const libspirv::AssemblyGrammar& grammar) + : grammar_(grammar) {} + + // Returns true if |ext| is an enabled extension in the module. + bool HasExtension(libspirv::Extension ext) const { + return extensions_.Contains(ext); + } + + // Returns true if |cap| is an enabled capability in the module. + bool HasCapability(SpvCapability cap) const { + return capabilities_.Contains(cap); + } + + // Analyzes |module| and records enabled extensions and capabilities. + void Analyze(ir::Module* module); + + libspirv::CapabilitySet* GetCapabilities() { return &capabilities_; } + const libspirv::CapabilitySet* GetCapabilities() const { + return &capabilities_; + } + + uint32_t GetExtInstImportId_GLSLstd450() const { + return extinst_importid_GLSLstd450_; + } + + private: + // Analyzes |module| and records enabled extensions. + void AddExtensions(ir::Module* module); + + // Adds the given |capability| and all implied capabilities into the current + // FeatureManager. + void AddCapability(SpvCapability capability); + + // Analyzes |module| and records enabled capabilities. + void AddCapabilities(ir::Module* module); + + // Analyzes |module| and records imported external instruction sets. + void AddExtInstImportIds(ir::Module* module); + + // Auxiliary object for querying SPIR-V grammar facts. + const libspirv::AssemblyGrammar& grammar_; + + // The enabled extensions. + libspirv::ExtensionSet extensions_; + + // The enabled capabilities. + libspirv::CapabilitySet capabilities_; + + // Common external instruction import ids, cached for performance. + uint32_t extinst_importid_GLSLstd450_ = 0; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_FEATURE_MANAGER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/flatten_decoration_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/flatten_decoration_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/flatten_decoration_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/flatten_decoration_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,167 @@ +// Copyright (c) 2017 Google 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. + +#include "flatten_decoration_pass.h" +#include "ir_context.h" + +#include +#include +#include +#include + +namespace spvtools { +namespace opt { + +using ir::Instruction; +using ir::Operand; + +using Words = std::vector; +using OrderedUsesMap = std::unordered_map; + +Pass::Status FlattenDecorationPass::Process(ir::IRContext* c) { + InitializeProcessing(c); + + bool modified = false; + + // The target Id of OpDecorationGroup instructions. + // We have to track this separately from its uses, in case it + // has no uses. + std::unordered_set group_ids; + // Maps a decoration group Id to its GroupDecorate targets, in order + // of appearance. + OrderedUsesMap normal_uses; + // Maps a decoration group Id to its GroupMemberDecorate targets and + // their indices, in of appearance. + OrderedUsesMap member_uses; + + auto annotations = context()->annotations(); + + // On the first pass, record each OpDecorationGroup with its ordered uses. + // Rely on unordered_map::operator[] to create its entries on first access. + for (const auto& inst : annotations) { + switch (inst.opcode()) { + case SpvOp::SpvOpDecorationGroup: + group_ids.insert(inst.result_id()); + break; + case SpvOp::SpvOpGroupDecorate: { + Words& words = normal_uses[inst.GetSingleWordInOperand(0)]; + for (uint32_t i = 1; i < inst.NumInOperandWords(); i++) { + words.push_back(inst.GetSingleWordInOperand(i)); + } + } break; + case SpvOp::SpvOpGroupMemberDecorate: { + Words& words = member_uses[inst.GetSingleWordInOperand(0)]; + for (uint32_t i = 1; i < inst.NumInOperandWords(); i++) { + words.push_back(inst.GetSingleWordInOperand(i)); + } + } break; + default: + break; + } + } + + // On the second pass, replace OpDecorationGroup and its uses with + // equivalent normal and struct member uses. + auto inst_iter = annotations.begin(); + // We have to re-evaluate the end pointer + while (inst_iter != context()->annotations().end()) { + // Should we replace this instruction? + bool replace = false; + switch (inst_iter->opcode()) { + case SpvOp::SpvOpDecorationGroup: + case SpvOp::SpvOpGroupDecorate: + case SpvOp::SpvOpGroupMemberDecorate: + replace = true; + break; + case SpvOp::SpvOpDecorate: { + // If this decoration targets a group, then replace it + // by sets of normal and member decorations. + const uint32_t group = inst_iter->GetSingleWordOperand(0); + const auto normal_uses_iter = normal_uses.find(group); + if (normal_uses_iter != normal_uses.end()) { + for (auto target : normal_uses[group]) { + std::unique_ptr new_inst(inst_iter->Clone(context())); + new_inst->SetInOperand(0, Words{target}); + inst_iter = inst_iter.InsertBefore(std::move(new_inst)); + ++inst_iter; + replace = true; + } + } + const auto member_uses_iter = member_uses.find(group); + if (member_uses_iter != member_uses.end()) { + const Words& member_id_pairs = (*member_uses_iter).second; + // The collection is a sequence of pairs. + assert((member_id_pairs.size() % 2) == 0); + for (size_t i = 0; i < member_id_pairs.size(); i += 2) { + // Make an OpMemberDecorate instruction for each (target, member) + // pair. + const uint32_t target = member_id_pairs[i]; + const uint32_t member = member_id_pairs[i + 1]; + std::vector operands; + operands.push_back(Operand(SPV_OPERAND_TYPE_ID, {target})); + operands.push_back( + Operand(SPV_OPERAND_TYPE_LITERAL_INTEGER, {member})); + auto decoration_operands_iter = inst_iter->begin(); + decoration_operands_iter++; // Skip the group target. + operands.insert(operands.end(), decoration_operands_iter, + inst_iter->end()); + std::unique_ptr new_inst(new Instruction( + context(), SpvOp::SpvOpMemberDecorate, 0, 0, operands)); + inst_iter = inst_iter.InsertBefore(std::move(new_inst)); + ++inst_iter; + replace = true; + } + } + // If this is an OpDecorate targeting the OpDecorationGroup itself, + // remove it even if that decoration group itself is not the target of + // any OpGroupDecorate or OpGroupMemberDecorate. + if (!replace && group_ids.count(group)) { + replace = true; + } + } break; + default: + break; + } + if (replace) { + inst_iter = inst_iter.Erase(); + modified = true; + } else { + // Handle the case of decorations unrelated to decoration groups. + ++inst_iter; + } + } + + // Remove OpName instructions which reference the removed group decorations. + // An OpDecorationGroup instruction might not have been used by an + // OpGroupDecorate or OpGroupMemberDecorate instruction. + if (!group_ids.empty()) { + for (auto debug_inst_iter = context()->debug2_begin(); + debug_inst_iter != context()->debug2_end();) { + if (debug_inst_iter->opcode() == SpvOp::SpvOpName) { + const uint32_t target = debug_inst_iter->GetSingleWordOperand(0); + if (group_ids.count(target)) { + debug_inst_iter = debug_inst_iter.Erase(); + modified = true; + } else { + ++debug_inst_iter; + } + } + } + } + + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/flatten_decoration_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/flatten_decoration_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/flatten_decoration_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/flatten_decoration_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,35 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_FLATTEN_DECORATION_PASS_H_ +#define LIBSPIRV_OPT_FLATTEN_DECORATION_PASS_H_ + +#include "ir_context.h" +#include "module.h" +#include "pass.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class FlattenDecorationPass : public Pass { + public: + const char* name() const override { return "flatten-decoration"; } + Status Process(ir::IRContext*) override; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_FLATTEN_DECORATION_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/fold.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/fold.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/fold.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/fold.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,683 @@ +// Copyright (c) 2017 Google 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. + +#include "fold.h" + +#include +#include +#include + +#include "const_folding_rules.h" +#include "def_use_manager.h" +#include "folding_rules.h" +#include "ir_builder.h" +#include "ir_context.h" + +namespace spvtools { +namespace opt { + +namespace { + +#ifndef INT32_MIN +#define INT32_MIN (-2147483648) +#endif + +#ifndef INT32_MAX +#define INT32_MAX 2147483647 +#endif + +#ifndef UINT32_MAX +#define UINT32_MAX 0xffffffff /* 4294967295U */ +#endif + +// Returns the single-word result from performing the given unary operation on +// the operand value which is passed in as a 32-bit word. +uint32_t UnaryOperate(SpvOp opcode, uint32_t operand) { + switch (opcode) { + // Arthimetics + case SpvOp::SpvOpSNegate: + return -static_cast(operand); + case SpvOp::SpvOpNot: + return ~operand; + case SpvOp::SpvOpLogicalNot: + return !static_cast(operand); + default: + assert(false && + "Unsupported unary operation for OpSpecConstantOp instruction"); + return 0u; + } +} + +// Returns the single-word result from performing the given binary operation on +// the operand values which are passed in as two 32-bit word. +uint32_t BinaryOperate(SpvOp opcode, uint32_t a, uint32_t b) { + switch (opcode) { + // Arthimetics + case SpvOp::SpvOpIAdd: + return a + b; + case SpvOp::SpvOpISub: + return a - b; + case SpvOp::SpvOpIMul: + return a * b; + case SpvOp::SpvOpUDiv: + assert(b != 0); + return a / b; + case SpvOp::SpvOpSDiv: + assert(b != 0u); + return (static_cast(a)) / (static_cast(b)); + case SpvOp::SpvOpSRem: { + // The sign of non-zero result comes from the first operand: a. This is + // guaranteed by C++11 rules for integer division operator. The division + // result is rounded toward zero, so the result of '%' has the sign of + // the first operand. + assert(b != 0u); + return static_cast(a) % static_cast(b); + } + case SpvOp::SpvOpSMod: { + // The sign of non-zero result comes from the second operand: b + assert(b != 0u); + int32_t rem = BinaryOperate(SpvOp::SpvOpSRem, a, b); + int32_t b_prim = static_cast(b); + return (rem + b_prim) % b_prim; + } + case SpvOp::SpvOpUMod: + assert(b != 0u); + return (a % b); + + // Shifting + case SpvOp::SpvOpShiftRightLogical: { + return a >> b; + } + case SpvOp::SpvOpShiftRightArithmetic: + return (static_cast(a)) >> b; + case SpvOp::SpvOpShiftLeftLogical: + return a << b; + + // Bitwise operations + case SpvOp::SpvOpBitwiseOr: + return a | b; + case SpvOp::SpvOpBitwiseAnd: + return a & b; + case SpvOp::SpvOpBitwiseXor: + return a ^ b; + + // Logical + case SpvOp::SpvOpLogicalEqual: + return (static_cast(a)) == (static_cast(b)); + case SpvOp::SpvOpLogicalNotEqual: + return (static_cast(a)) != (static_cast(b)); + case SpvOp::SpvOpLogicalOr: + return (static_cast(a)) || (static_cast(b)); + case SpvOp::SpvOpLogicalAnd: + return (static_cast(a)) && (static_cast(b)); + + // Comparison + case SpvOp::SpvOpIEqual: + return a == b; + case SpvOp::SpvOpINotEqual: + return a != b; + case SpvOp::SpvOpULessThan: + return a < b; + case SpvOp::SpvOpSLessThan: + return (static_cast(a)) < (static_cast(b)); + case SpvOp::SpvOpUGreaterThan: + return a > b; + case SpvOp::SpvOpSGreaterThan: + return (static_cast(a)) > (static_cast(b)); + case SpvOp::SpvOpULessThanEqual: + return a <= b; + case SpvOp::SpvOpSLessThanEqual: + return (static_cast(a)) <= (static_cast(b)); + case SpvOp::SpvOpUGreaterThanEqual: + return a >= b; + case SpvOp::SpvOpSGreaterThanEqual: + return (static_cast(a)) >= (static_cast(b)); + default: + assert(false && + "Unsupported binary operation for OpSpecConstantOp instruction"); + return 0u; + } +} + +// Returns the single-word result from performing the given ternary operation +// on the operand values which are passed in as three 32-bit word. +uint32_t TernaryOperate(SpvOp opcode, uint32_t a, uint32_t b, uint32_t c) { + switch (opcode) { + case SpvOp::SpvOpSelect: + return (static_cast(a)) ? b : c; + default: + assert(false && + "Unsupported ternary operation for OpSpecConstantOp instruction"); + return 0u; + } +} + +// Returns the single-word result from performing the given operation on the +// operand words. This only works with 32-bit operations and uses boolean +// convention that 0u is false, and anything else is boolean true. +// TODO(qining): Support operands other than 32-bit wide. +uint32_t OperateWords(SpvOp opcode, + const std::vector& operand_words) { + switch (operand_words.size()) { + case 1: + return UnaryOperate(opcode, operand_words.front()); + case 2: + return BinaryOperate(opcode, operand_words.front(), operand_words.back()); + case 3: + return TernaryOperate(opcode, operand_words[0], operand_words[1], + operand_words[2]); + default: + assert(false && "Invalid number of operands"); + return 0; + } +} + +bool FoldInstructionInternal(ir::Instruction* inst) { + ir::IRContext* context = inst->context(); + auto identity_map = [](uint32_t id) { return id; }; + ir::Instruction* folded_inst = FoldInstructionToConstant(inst, identity_map); + if (folded_inst != nullptr) { + inst->SetOpcode(SpvOpCopyObject); + inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {folded_inst->result_id()}}}); + return true; + } + + SpvOp opcode = inst->opcode(); + analysis::ConstantManager* const_manager = context->get_constant_mgr(); + + std::vector constants = + const_manager->GetOperandConstants(inst); + + static FoldingRules* rules = new FoldingRules(); + for (FoldingRule rule : rules->GetRulesForOpcode(opcode)) { + if (rule(inst, constants)) { + return true; + } + } + return false; +} + +} // namespace + +const ConstantFoldingRules& GetConstantFoldingRules() { + static ConstantFoldingRules* rules = new ConstantFoldingRules(); + return *rules; +} + +// Returns the result of performing an operation on scalar constant operands. +// This function extracts the operand values as 32 bit words and returns the +// result in 32 bit word. Scalar constants with longer than 32-bit width are +// not accepted in this function. +uint32_t FoldScalars(SpvOp opcode, + const std::vector& operands) { + assert(IsFoldableOpcode(opcode) && + "Unhandled instruction opcode in FoldScalars"); + std::vector operand_values_in_raw_words; + for (const auto& operand : operands) { + if (const analysis::ScalarConstant* scalar = operand->AsScalarConstant()) { + const auto& scalar_words = scalar->words(); + assert(scalar_words.size() == 1 && + "Scalar constants with longer than 32-bit width are not allowed " + "in FoldScalars()"); + operand_values_in_raw_words.push_back(scalar_words.front()); + } else if (operand->AsNullConstant()) { + operand_values_in_raw_words.push_back(0u); + } else { + assert(false && + "FoldScalars() only accepts ScalarConst or NullConst type of " + "constant"); + } + } + return OperateWords(opcode, operand_values_in_raw_words); +} + +// Returns true if |inst| is a binary operation that takes two integers as +// parameters and folds to a constant that can be represented as an unsigned +// 32-bit value when the ids have been replaced by |id_map|. If |inst| can be +// folded, the resulting value is returned in |*result|. Valid result types for +// the instruction are any integer (signed or unsigned) with 32-bits or less, or +// a boolean value. +bool FoldBinaryIntegerOpToConstant(ir::Instruction* inst, + std::function id_map, + uint32_t* result) { + SpvOp opcode = inst->opcode(); + ir::IRContext* context = inst->context(); + analysis::ConstantManager* const_manger = context->get_constant_mgr(); + + uint32_t ids[2]; + const analysis::IntConstant* constants[2]; + for (uint32_t i = 0; i < 2; i++) { + const ir::Operand* operand = &inst->GetInOperand(i); + if (operand->type != SPV_OPERAND_TYPE_ID) { + return false; + } + ids[i] = id_map(operand->words[0]); + const analysis::Constant* constant = + const_manger->FindDeclaredConstant(ids[i]); + constants[i] = (constant != nullptr ? constant->AsIntConstant() : nullptr); + } + + switch (opcode) { + // Arthimetics + case SpvOp::SpvOpIMul: + for (uint32_t i = 0; i < 2; i++) { + if (constants[i] != nullptr && constants[i]->IsZero()) { + *result = 0; + return true; + } + } + break; + case SpvOp::SpvOpUDiv: + case SpvOp::SpvOpSDiv: + case SpvOp::SpvOpSRem: + case SpvOp::SpvOpSMod: + case SpvOp::SpvOpUMod: + // This changes undefined behaviour (ie divide by 0) into a 0. + for (uint32_t i = 0; i < 2; i++) { + if (constants[i] != nullptr && constants[i]->IsZero()) { + *result = 0; + return true; + } + } + break; + + // Shifting + case SpvOp::SpvOpShiftRightLogical: + case SpvOp::SpvOpShiftLeftLogical: + if (constants[1] != nullptr) { + // When shifting by a value larger than the size of the result, the + // result is undefined. We are setting the undefined behaviour to a + // result of 0. + uint32_t shift_amount = constants[1]->GetU32BitValue(); + if (shift_amount >= 32) { + *result = 0; + return true; + } + } + break; + + // Bitwise operations + case SpvOp::SpvOpBitwiseOr: + for (uint32_t i = 0; i < 2; i++) { + if (constants[i] != nullptr) { + // TODO: Change the mask against a value based on the bit width of the + // instruction result type. This way we can handle say 16-bit values + // as well. + uint32_t mask = constants[i]->GetU32BitValue(); + if (mask == 0xFFFFFFFF) { + *result = 0xFFFFFFFF; + return true; + } + } + } + break; + case SpvOp::SpvOpBitwiseAnd: + for (uint32_t i = 0; i < 2; i++) { + if (constants[i] != nullptr) { + if (constants[i]->IsZero()) { + *result = 0; + return true; + } + } + } + break; + + // Comparison + case SpvOp::SpvOpULessThan: + if (constants[0] != nullptr && + constants[0]->GetU32BitValue() == UINT32_MAX) { + *result = false; + return true; + } + if (constants[1] != nullptr && constants[1]->GetU32BitValue() == 0) { + *result = false; + return true; + } + break; + case SpvOp::SpvOpSLessThan: + if (constants[0] != nullptr && + constants[0]->GetS32BitValue() == INT32_MAX) { + *result = false; + return true; + } + if (constants[1] != nullptr && + constants[1]->GetS32BitValue() == INT32_MIN) { + *result = false; + return true; + } + break; + case SpvOp::SpvOpUGreaterThan: + if (constants[0] != nullptr && constants[0]->IsZero()) { + *result = false; + return true; + } + if (constants[1] != nullptr && + constants[1]->GetU32BitValue() == UINT32_MAX) { + *result = false; + return true; + } + break; + case SpvOp::SpvOpSGreaterThan: + if (constants[0] != nullptr && + constants[0]->GetS32BitValue() == INT32_MIN) { + *result = false; + return true; + } + if (constants[1] != nullptr && + constants[1]->GetS32BitValue() == INT32_MAX) { + *result = false; + return true; + } + break; + case SpvOp::SpvOpULessThanEqual: + if (constants[0] != nullptr && constants[0]->IsZero()) { + *result = true; + return true; + } + if (constants[1] != nullptr && + constants[1]->GetU32BitValue() == UINT32_MAX) { + *result = true; + return true; + } + break; + case SpvOp::SpvOpSLessThanEqual: + if (constants[0] != nullptr && + constants[0]->GetS32BitValue() == INT32_MIN) { + *result = true; + return true; + } + if (constants[1] != nullptr && + constants[1]->GetS32BitValue() == INT32_MAX) { + *result = true; + return true; + } + break; + case SpvOp::SpvOpUGreaterThanEqual: + if (constants[0] != nullptr && + constants[0]->GetU32BitValue() == UINT32_MAX) { + *result = true; + return true; + } + if (constants[1] != nullptr && constants[1]->GetU32BitValue() == 0) { + *result = true; + return true; + } + break; + case SpvOp::SpvOpSGreaterThanEqual: + if (constants[0] != nullptr && + constants[0]->GetS32BitValue() == INT32_MAX) { + *result = true; + return true; + } + if (constants[1] != nullptr && + constants[1]->GetS32BitValue() == INT32_MIN) { + *result = true; + return true; + } + break; + default: + break; + } + return false; +} + +// Returns true if |inst| is a binary operation on two boolean values, and folds +// to a constant boolean value when the ids have been replaced using |id_map|. +// If |inst| can be folded, the result value is returned in |*result|. +bool FoldBinaryBooleanOpToConstant(ir::Instruction* inst, + std::function id_map, + uint32_t* result) { + SpvOp opcode = inst->opcode(); + ir::IRContext* context = inst->context(); + analysis::ConstantManager* const_manger = context->get_constant_mgr(); + + uint32_t ids[2]; + const analysis::BoolConstant* constants[2]; + for (uint32_t i = 0; i < 2; i++) { + const ir::Operand* operand = &inst->GetInOperand(i); + if (operand->type != SPV_OPERAND_TYPE_ID) { + return false; + } + ids[i] = id_map(operand->words[0]); + const analysis::Constant* constant = + const_manger->FindDeclaredConstant(ids[i]); + constants[i] = (constant != nullptr ? constant->AsBoolConstant() : nullptr); + } + + switch (opcode) { + // Logical + case SpvOp::SpvOpLogicalOr: + for (uint32_t i = 0; i < 2; i++) { + if (constants[i] != nullptr) { + if (constants[i]->value()) { + *result = true; + return true; + } + } + } + break; + case SpvOp::SpvOpLogicalAnd: + for (uint32_t i = 0; i < 2; i++) { + if (constants[i] != nullptr) { + if (!constants[i]->value()) { + *result = false; + return true; + } + } + } + break; + + default: + break; + } + return false; +} + +// Returns true if |inst| can be folded to an constant when the ids have been +// substituted using id_map. If it can, the value is returned in |result|. If +// not, |result| is unchanged. It is assumed that not all operands are +// constant. Those cases are handled by |FoldScalar|. +bool FoldIntegerOpToConstant(ir::Instruction* inst, + std::function id_map, + uint32_t* result) { + assert(IsFoldableOpcode(inst->opcode()) && + "Unhandled instruction opcode in FoldScalars"); + switch (inst->NumInOperands()) { + case 2: + return FoldBinaryIntegerOpToConstant(inst, id_map, result) || + FoldBinaryBooleanOpToConstant(inst, id_map, result); + default: + return false; + } +} + +std::vector FoldVectors( + SpvOp opcode, uint32_t num_dims, + const std::vector& operands) { + assert(IsFoldableOpcode(opcode) && + "Unhandled instruction opcode in FoldVectors"); + std::vector result; + for (uint32_t d = 0; d < num_dims; d++) { + std::vector operand_values_for_one_dimension; + for (const auto& operand : operands) { + if (const analysis::VectorConstant* vector_operand = + operand->AsVectorConstant()) { + // Extract the raw value of the scalar component constants + // in 32-bit words here. The reason of not using FoldScalars() here + // is that we do not create temporary null constants as components + // when the vector operand is a NullConstant because Constant creation + // may need extra checks for the validity and that is not manageed in + // here. + if (const analysis::ScalarConstant* scalar_component = + vector_operand->GetComponents().at(d)->AsScalarConstant()) { + const auto& scalar_words = scalar_component->words(); + assert( + scalar_words.size() == 1 && + "Vector components with longer than 32-bit width are not allowed " + "in FoldVectors()"); + operand_values_for_one_dimension.push_back(scalar_words.front()); + } else if (operand->AsNullConstant()) { + operand_values_for_one_dimension.push_back(0u); + } else { + assert(false && + "VectorConst should only has ScalarConst or NullConst as " + "components"); + } + } else if (operand->AsNullConstant()) { + operand_values_for_one_dimension.push_back(0u); + } else { + assert(false && + "FoldVectors() only accepts VectorConst or NullConst type of " + "constant"); + } + } + result.push_back(OperateWords(opcode, operand_values_for_one_dimension)); + } + return result; +} + +bool IsFoldableOpcode(SpvOp opcode) { + // NOTE: Extend to more opcodes as new cases are handled in the folder + // functions. + switch (opcode) { + case SpvOp::SpvOpBitwiseAnd: + case SpvOp::SpvOpBitwiseOr: + case SpvOp::SpvOpBitwiseXor: + case SpvOp::SpvOpIAdd: + case SpvOp::SpvOpIEqual: + case SpvOp::SpvOpIMul: + case SpvOp::SpvOpINotEqual: + case SpvOp::SpvOpISub: + case SpvOp::SpvOpLogicalAnd: + case SpvOp::SpvOpLogicalEqual: + case SpvOp::SpvOpLogicalNot: + case SpvOp::SpvOpLogicalNotEqual: + case SpvOp::SpvOpLogicalOr: + case SpvOp::SpvOpNot: + case SpvOp::SpvOpSDiv: + case SpvOp::SpvOpSelect: + case SpvOp::SpvOpSGreaterThan: + case SpvOp::SpvOpSGreaterThanEqual: + case SpvOp::SpvOpShiftLeftLogical: + case SpvOp::SpvOpShiftRightArithmetic: + case SpvOp::SpvOpShiftRightLogical: + case SpvOp::SpvOpSLessThan: + case SpvOp::SpvOpSLessThanEqual: + case SpvOp::SpvOpSMod: + case SpvOp::SpvOpSNegate: + case SpvOp::SpvOpSRem: + case SpvOp::SpvOpUDiv: + case SpvOp::SpvOpUGreaterThan: + case SpvOp::SpvOpUGreaterThanEqual: + case SpvOp::SpvOpULessThan: + case SpvOp::SpvOpULessThanEqual: + case SpvOp::SpvOpUMod: + return true; + default: + return false; + } +} + +bool IsFoldableConstant(const analysis::Constant* cst) { + // Currently supported constants are 32-bit values or null constants. + if (const analysis::ScalarConstant* scalar = cst->AsScalarConstant()) + return scalar->words().size() == 1; + else + return cst->AsNullConstant() != nullptr; +} + +ir::Instruction* FoldInstructionToConstant( + ir::Instruction* inst, std::function id_map) { + ir::IRContext* context = inst->context(); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + + if (!inst->IsFoldableByFoldScalar() && + !GetConstantFoldingRules().HasFoldingRule(inst->opcode())) { + return nullptr; + } + // Collect the values of the constant parameters. + std::vector constants; + bool missing_constants = false; + inst->ForEachInId([&constants, &missing_constants, const_mgr, + &id_map](uint32_t* op_id) { + uint32_t id = id_map(*op_id); + const analysis::Constant* const_op = const_mgr->FindDeclaredConstant(id); + if (!const_op) { + constants.push_back(nullptr); + missing_constants = true; + } else { + constants.push_back(const_op); + } + }); + + if (GetConstantFoldingRules().HasFoldingRule(inst->opcode())) { + const analysis::Constant* folded_const = nullptr; + for (auto rule : + GetConstantFoldingRules().GetRulesForOpcode(inst->opcode())) { + folded_const = rule(inst, constants); + if (folded_const != nullptr) { + ir::Instruction* const_inst = + const_mgr->GetDefiningInstruction(folded_const); + // May be a new instruction that needs to be analysed. + context->UpdateDefUse(const_inst); + return const_inst; + } + } + } + + uint32_t result_val = 0; + bool successful = false; + // If all parameters are constant, fold the instruction to a constant. + if (!missing_constants && inst->IsFoldableByFoldScalar()) { + result_val = FoldScalars(inst->opcode(), constants); + successful = true; + } + + if (!successful && inst->IsFoldableByFoldScalar()) { + successful = FoldIntegerOpToConstant(inst, id_map, &result_val); + } + + if (successful) { + const analysis::Constant* result_const = + const_mgr->GetConstant(const_mgr->GetType(inst), {result_val}); + return const_mgr->GetDefiningInstruction(result_const); + } + return nullptr; +} + +bool IsFoldableType(ir::Instruction* type_inst) { + // Support 32-bit integers. + if (type_inst->opcode() == SpvOpTypeInt) { + return type_inst->GetSingleWordInOperand(0) == 32; + } + // Support booleans. + if (type_inst->opcode() == SpvOpTypeBool) { + return true; + } + // Nothing else yet. + return false; +} + +bool FoldInstruction(ir::Instruction* inst) { + bool modified = false; + ir::Instruction* folded_inst(inst); + while (folded_inst->opcode() != SpvOpCopyObject && + FoldInstructionInternal(&*folded_inst)) { + modified = true; + } + return modified; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/fold.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/fold.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/fold.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/fold.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,98 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_UTIL_FOLD_H_ +#define LIBSPIRV_UTIL_FOLD_H_ + +#include +#include + +#include "const_folding_rules.h" +#include "constants.h" +#include "def_use_manager.h" + +namespace spvtools { +namespace opt { + +// Returns a reference to the ConstnatFoldingRules instance. +const ConstantFoldingRules& GetConstantFoldingRules(); + +// Returns the result of folding a scalar instruction with the given |opcode| +// and |operands|. Each entry in |operands| is a pointer to an +// analysis::Constant instance, which should've been created with the constant +// manager (See IRContext::get_constant_mgr). +// +// It is an error to call this function with an opcode that does not pass the +// IsFoldableOpcode test. If any error occurs during folding, the folder will +// faill with a call to assert. +uint32_t FoldScalars(SpvOp opcode, + const std::vector& operands); + +// Returns the result of performing an operation with the given |opcode| over +// constant vectors with |num_dims| dimensions. Each entry in |operands| is a +// pointer to an analysis::Constant instance, which should've been created with +// the constant manager (See IRContext::get_constant_mgr). +// +// This function iterates through the given vector type constant operands and +// calculates the result for each element of the result vector to return. +// Vectors with longer than 32-bit scalar components are not accepted in this +// function. +// +// It is an error to call this function with an opcode that does not pass the +// IsFoldableOpcode test. If any error occurs during folding, the folder will +// faill with a call to assert. +std::vector FoldVectors( + SpvOp opcode, uint32_t num_dims, + const std::vector& operands); + +// Returns true if |opcode| represents an operation handled by FoldScalars or +// FoldVectors. +bool IsFoldableOpcode(SpvOp opcode); + +// Returns true if |cst| is supported by FoldScalars and FoldVectors. +bool IsFoldableConstant(const analysis::Constant* cst); + +// Returns true if |FoldInstructionToConstant| could fold an instruction whose +// result type is |type_inst|. +bool IsFoldableType(ir::Instruction* type_inst); + +// Tries to fold |inst| to a single constant, when the input ids to |inst| have +// been substituted using |id_map|. Returns a pointer to the OpConstant* +// instruction if successful. If necessary, a new constant instruction is +// created and placed in the global values section. +// +// |id_map| is a function that takes one result id and returns another. It can +// be used for things like CCP where it is known that some ids contain a +// constant, but the instruction itself has not been updated yet. This can map +// those ids to the appropriate constants. +ir::Instruction* FoldInstructionToConstant( + ir::Instruction* inst, std::function id_map); + +// Returns true if |inst| can be folded into a simpler instruction. +// If |inst| can be simplified, |inst| is overwritten with the simplified +// instruction reusing the same result id. +// +// If |inst| is simplified, it is possible that the resulting code in invalid +// because the instruction is in a bad location. Callers of this function have +// to handle the following cases: +// +// 1) An OpPhi becomes and OpCopyObject - If there are OpPhi instruction after +// |inst| in a basic block then this is invalid. The caller must fix this +// up. +bool FoldInstruction(ir::Instruction* inst); + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_UTIL_FOLD_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/folding_rules.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/folding_rules.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/folding_rules.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/folding_rules.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1882 @@ +// Copyright (c) 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "folding_rules.h" +#include "latest_version_glsl_std_450_header.h" + +namespace spvtools { +namespace opt { + +namespace { +const uint32_t kExtractCompositeIdInIdx = 0; +const uint32_t kInsertObjectIdInIdx = 0; +const uint32_t kInsertCompositeIdInIdx = 1; +const uint32_t kExtInstSetIdInIdx = 0; +const uint32_t kExtInstInstructionInIdx = 1; +const uint32_t kFMixXIdInIdx = 2; +const uint32_t kFMixYIdInIdx = 3; + +// Returns the element width of |type|. +uint32_t ElementWidth(const analysis::Type* type) { + if (const analysis::Vector* vec_type = type->AsVector()) { + return ElementWidth(vec_type->element_type()); + } else if (const analysis::Float* float_type = type->AsFloat()) { + return float_type->width(); + } else { + assert(type->AsInteger()); + return type->AsInteger()->width(); + } +} + +// Returns true if |type| is Float or a vector of Float. +bool HasFloatingPoint(const analysis::Type* type) { + if (type->AsFloat()) { + return true; + } else if (const analysis::Vector* vec_type = type->AsVector()) { + return vec_type->element_type()->AsFloat() != nullptr; + } + + return false; +} + +// Returns false if |val| is NaN, infinite or subnormal. +template +bool IsValidResult(T val) { + int classified = std::fpclassify(val); + switch (classified) { + case FP_NAN: + case FP_INFINITE: + case FP_SUBNORMAL: + return false; + default: + return true; + } +} + +const analysis::Constant* ConstInput( + const std::vector& constants) { + return constants[0] ? constants[0] : constants[1]; +} + +ir::Instruction* NonConstInput(ir::IRContext* context, + const analysis::Constant* c, + ir::Instruction* inst) { + uint32_t in_op = c ? 1u : 0u; + return context->get_def_use_mgr()->GetDef( + inst->GetSingleWordInOperand(in_op)); +} + +// Returns the negation of |c|. |c| must be a 32 or 64 bit floating point +// constant. +uint32_t NegateFloatingPointConstant(analysis::ConstantManager* const_mgr, + const analysis::Constant* c) { + assert(c); + assert(c->type()->AsFloat()); + uint32_t width = c->type()->AsFloat()->width(); + assert(width == 32 || width == 64); + std::vector words; + if (width == 64) { + spvutils::FloatProxy result(c->GetDouble() * -1.0); + words = result.GetWords(); + } else { + spvutils::FloatProxy result(c->GetFloat() * -1.0f); + words = result.GetWords(); + } + + const analysis::Constant* negated_const = + const_mgr->GetConstant(c->type(), std::move(words)); + return const_mgr->GetDefiningInstruction(negated_const)->result_id(); +} + +std::vector ExtractInts(uint64_t val) { + std::vector words; + words.push_back(static_cast(val)); + words.push_back(static_cast(val >> 32)); + return words; +} + +// Negates the integer constant |c|. Returns the id of the defining instruction. +uint32_t NegateIntegerConstant(analysis::ConstantManager* const_mgr, + const analysis::Constant* c) { + assert(c); + assert(c->type()->AsInteger()); + uint32_t width = c->type()->AsInteger()->width(); + assert(width == 32 || width == 64); + std::vector words; + if (width == 64) { + uint64_t uval = static_cast(0 - c->GetU64()); + words = ExtractInts(uval); + } else { + words.push_back(static_cast(0 - c->GetU32())); + } + + const analysis::Constant* negated_const = + const_mgr->GetConstant(c->type(), std::move(words)); + return const_mgr->GetDefiningInstruction(negated_const)->result_id(); +} + +// Negates the vector constant |c|. Returns the id of the defining instruction. +uint32_t NegateVectorConstant(analysis::ConstantManager* const_mgr, + const analysis::Constant* c) { + assert(const_mgr && c); + assert(c->type()->AsVector()); + if (c->AsNullConstant()) { + // 0.0 vs -0.0 shouldn't matter. + return const_mgr->GetDefiningInstruction(c)->result_id(); + } else { + const analysis::Type* component_type = + c->AsVectorConstant()->component_type(); + std::vector words; + for (auto& comp : c->AsVectorConstant()->GetComponents()) { + if (component_type->AsFloat()) { + words.push_back(NegateFloatingPointConstant(const_mgr, comp)); + } else { + assert(component_type->AsInteger()); + words.push_back(NegateIntegerConstant(const_mgr, comp)); + } + } + + const analysis::Constant* negated_const = + const_mgr->GetConstant(c->type(), std::move(words)); + return const_mgr->GetDefiningInstruction(negated_const)->result_id(); + } +} + +// Negates |c|. Returns the id of the defining instruction. +uint32_t NegateConstant(analysis::ConstantManager* const_mgr, + const analysis::Constant* c) { + if (c->type()->AsVector()) { + return NegateVectorConstant(const_mgr, c); + } else if (c->type()->AsFloat()) { + return NegateFloatingPointConstant(const_mgr, c); + } else { + assert(c->type()->AsInteger()); + return NegateIntegerConstant(const_mgr, c); + } +} + +// Takes the reciprocal of |c|. |c|'s type must be Float or a vector of Float. +// Returns 0 if the reciprocal is NaN, infinite or subnormal. +uint32_t Reciprocal(analysis::ConstantManager* const_mgr, + const analysis::Constant* c) { + assert(const_mgr && c); + assert(c->type()->AsFloat()); + + uint32_t width = c->type()->AsFloat()->width(); + assert(width == 32 || width == 64); + std::vector words; + if (width == 64) { + spvutils::FloatProxy result(1.0 / c->GetDouble()); + if (!IsValidResult(result.getAsFloat())) return 0; + words = result.GetWords(); + } else { + spvutils::FloatProxy result(1.0f / c->GetFloat()); + if (!IsValidResult(result.getAsFloat())) return 0; + words = result.GetWords(); + } + + const analysis::Constant* negated_const = + const_mgr->GetConstant(c->type(), std::move(words)); + return const_mgr->GetDefiningInstruction(negated_const)->result_id(); +} + +// Replaces fdiv where second operand is constant with fmul. +FoldingRule ReciprocalFDiv() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFDiv); + ir::IRContext* context = inst->context(); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + const analysis::Type* type = + context->get_type_mgr()->GetType(inst->type_id()); + if (!inst->IsFloatingPointFoldingAllowed()) return false; + + uint32_t width = ElementWidth(type); + if (width != 32 && width != 64) return false; + + if (constants[1] != nullptr) { + uint32_t id = 0; + if (const analysis::VectorConstant* vector_const = + constants[1]->AsVectorConstant()) { + std::vector neg_ids; + for (auto& comp : vector_const->GetComponents()) { + id = Reciprocal(const_mgr, comp); + if (id == 0) return false; + neg_ids.push_back(id); + } + const analysis::Constant* negated_const = + const_mgr->GetConstant(constants[1]->type(), std::move(neg_ids)); + id = const_mgr->GetDefiningInstruction(negated_const)->result_id(); + } else if (constants[1]->AsFloatConstant()) { + id = Reciprocal(const_mgr, constants[1]); + if (id == 0) return false; + } else { + // Don't fold a null constant. + return false; + } + inst->SetOpcode(SpvOpFMul); + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {inst->GetSingleWordInOperand(0u)}}, + {SPV_OPERAND_TYPE_ID, {id}}}); + return true; + } + + return false; + }; +} + +// Elides consecutive negate instructions. +FoldingRule MergeNegateArithmetic() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFNegate || inst->opcode() == SpvOpSNegate); + (void)constants; + ir::IRContext* context = inst->context(); + const analysis::Type* type = + context->get_type_mgr()->GetType(inst->type_id()); + if (HasFloatingPoint(type) && !inst->IsFloatingPointFoldingAllowed()) + return false; + + ir::Instruction* op_inst = + context->get_def_use_mgr()->GetDef(inst->GetSingleWordInOperand(0u)); + if (HasFloatingPoint(type) && !op_inst->IsFloatingPointFoldingAllowed()) + return false; + + if (op_inst->opcode() == inst->opcode()) { + // Elide negates. + inst->SetOpcode(SpvOpCopyObject); + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {op_inst->GetSingleWordInOperand(0u)}}}); + return true; + } + + return false; + }; +} + +// Merges negate into a mul or div operation if that operation contains a +// constant operand. +// Cases: +// -(x * 2) = x * -2 +// -(2 * x) = x * -2 +// -(x / 2) = x / -2 +// -(2 / x) = -2 / x +FoldingRule MergeNegateMulDivArithmetic() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFNegate || inst->opcode() == SpvOpSNegate); + (void)constants; + ir::IRContext* context = inst->context(); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + const analysis::Type* type = + context->get_type_mgr()->GetType(inst->type_id()); + if (HasFloatingPoint(type) && !inst->IsFloatingPointFoldingAllowed()) + return false; + + ir::Instruction* op_inst = + context->get_def_use_mgr()->GetDef(inst->GetSingleWordInOperand(0u)); + if (HasFloatingPoint(type) && !op_inst->IsFloatingPointFoldingAllowed()) + return false; + + uint32_t width = ElementWidth(type); + if (width != 32 && width != 64) return false; + + SpvOp opcode = op_inst->opcode(); + if (opcode == SpvOpFMul || opcode == SpvOpFDiv || opcode == SpvOpIMul || + opcode == SpvOpSDiv || opcode == SpvOpUDiv) { + std::vector op_constants = + const_mgr->GetOperandConstants(op_inst); + // Merge negate into mul or div if one operand is constant. + if (op_constants[0] || op_constants[1]) { + bool zero_is_variable = op_constants[0] == nullptr; + const analysis::Constant* c = ConstInput(op_constants); + uint32_t neg_id = NegateConstant(const_mgr, c); + uint32_t non_const_id = zero_is_variable + ? op_inst->GetSingleWordInOperand(0u) + : op_inst->GetSingleWordInOperand(1u); + // Change this instruction to a mul/div. + inst->SetOpcode(op_inst->opcode()); + if (opcode == SpvOpFDiv || opcode == SpvOpUDiv || opcode == SpvOpSDiv) { + uint32_t op0 = zero_is_variable ? non_const_id : neg_id; + uint32_t op1 = zero_is_variable ? neg_id : non_const_id; + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {op0}}, {SPV_OPERAND_TYPE_ID, {op1}}}); + } else { + inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {non_const_id}}, + {SPV_OPERAND_TYPE_ID, {neg_id}}}); + } + return true; + } + } + + return false; + }; +} + +// Merges negate into a add or sub operation if that operation contains a +// constant operand. +// Cases: +// -(x + 2) = -2 - x +// -(2 + x) = -2 - x +// -(x - 2) = 2 - x +// -(2 - x) = x - 2 +FoldingRule MergeNegateAddSubArithmetic() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFNegate || inst->opcode() == SpvOpSNegate); + (void)constants; + ir::IRContext* context = inst->context(); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + const analysis::Type* type = + context->get_type_mgr()->GetType(inst->type_id()); + if (HasFloatingPoint(type) && !inst->IsFloatingPointFoldingAllowed()) + return false; + + ir::Instruction* op_inst = + context->get_def_use_mgr()->GetDef(inst->GetSingleWordInOperand(0u)); + if (HasFloatingPoint(type) && !op_inst->IsFloatingPointFoldingAllowed()) + return false; + + uint32_t width = ElementWidth(type); + if (width != 32 && width != 64) return false; + + if (op_inst->opcode() == SpvOpFAdd || op_inst->opcode() == SpvOpFSub || + op_inst->opcode() == SpvOpIAdd || op_inst->opcode() == SpvOpISub) { + std::vector op_constants = + const_mgr->GetOperandConstants(op_inst); + if (op_constants[0] || op_constants[1]) { + bool zero_is_variable = op_constants[0] == nullptr; + bool is_add = (op_inst->opcode() == SpvOpFAdd) || + (op_inst->opcode() == SpvOpIAdd); + bool swap_operands = !is_add || zero_is_variable; + bool negate_const = is_add; + const analysis::Constant* c = ConstInput(op_constants); + uint32_t const_id = 0; + if (negate_const) { + const_id = NegateConstant(const_mgr, c); + } else { + const_id = zero_is_variable ? op_inst->GetSingleWordInOperand(1u) + : op_inst->GetSingleWordInOperand(0u); + } + + // Swap operands if necessary and make the instruction a subtraction. + uint32_t op0 = + zero_is_variable ? op_inst->GetSingleWordInOperand(0u) : const_id; + uint32_t op1 = + zero_is_variable ? const_id : op_inst->GetSingleWordInOperand(1u); + if (swap_operands) std::swap(op0, op1); + inst->SetOpcode(HasFloatingPoint(type) ? SpvOpFSub : SpvOpISub); + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {op0}}, {SPV_OPERAND_TYPE_ID, {op1}}}); + return true; + } + } + + return false; + }; +} + +// Returns true if |c| has a zero element. +bool HasZero(const analysis::Constant* c) { + if (c->AsNullConstant()) { + return true; + } + if (const analysis::VectorConstant* vec_const = c->AsVectorConstant()) { + for (auto& comp : vec_const->GetComponents()) + if (HasZero(comp)) return true; + } else { + assert(c->AsScalarConstant()); + return c->AsScalarConstant()->IsZero(); + } + + return false; +} + +// Performs |input1| |opcode| |input2| and returns the merged constant result +// id. Returns 0 if the result is not a valid value. The input types must be +// Float. +uint32_t PerformFloatingPointOperation(analysis::ConstantManager* const_mgr, + SpvOp opcode, + const analysis::Constant* input1, + const analysis::Constant* input2) { + const analysis::Type* type = input1->type(); + assert(type->AsFloat()); + uint32_t width = type->AsFloat()->width(); + assert(width == 32 || width == 64); + std::vector words; +#define FOLD_OP(op) \ + if (width == 64) { \ + spvutils::FloatProxy val = \ + input1->GetDouble() op input2->GetDouble(); \ + double dval = val.getAsFloat(); \ + if (!IsValidResult(dval)) return 0; \ + words = val.GetWords(); \ + } else { \ + spvutils::FloatProxy val = \ + input1->GetFloat() op input2->GetFloat(); \ + float fval = val.getAsFloat(); \ + if (!IsValidResult(fval)) return 0; \ + words = val.GetWords(); \ + } + switch (opcode) { + case SpvOpFMul: + FOLD_OP(*); + break; + case SpvOpFDiv: + if (HasZero(input2)) return 0; + FOLD_OP(/); + break; + case SpvOpFAdd: + FOLD_OP(+); + break; + case SpvOpFSub: + FOLD_OP(-); + break; + default: + assert(false && "Unexpected operation"); + break; + } +#undef FOLD_OP + const analysis::Constant* merged_const = const_mgr->GetConstant(type, words); + return const_mgr->GetDefiningInstruction(merged_const)->result_id(); +} + +// Performs |input1| |opcode| |input2| and returns the merged constant result +// id. Returns 0 if the result is not a valid value. The input types must be +// Integers. +uint32_t PerformIntegerOperation(analysis::ConstantManager* const_mgr, + SpvOp opcode, const analysis::Constant* input1, + const analysis::Constant* input2) { + assert(input1->type()->AsInteger()); + const analysis::Integer* type = input1->type()->AsInteger(); + uint32_t width = type->AsInteger()->width(); + assert(width == 32 || width == 64); + std::vector words; +#define FOLD_OP(op) \ + if (width == 64) { \ + if (type->IsSigned()) { \ + int64_t val = input1->GetS64() op input2->GetS64(); \ + words = ExtractInts(static_cast(val)); \ + } else { \ + uint64_t val = input1->GetU64() op input2->GetU64(); \ + words = ExtractInts(val); \ + } \ + } else { \ + if (type->IsSigned()) { \ + int32_t val = input1->GetS32() op input2->GetS32(); \ + words.push_back(static_cast(val)); \ + } else { \ + uint32_t val = input1->GetU32() op input2->GetU32(); \ + words.push_back(val); \ + } \ + } + switch (opcode) { + case SpvOpIMul: + FOLD_OP(*); + break; + case SpvOpSDiv: + case SpvOpUDiv: + assert(false && "Should not merge integer division"); + break; + case SpvOpIAdd: + FOLD_OP(+); + break; + case SpvOpISub: + FOLD_OP(-); + break; + default: + assert(false && "Unexpected operation"); + break; + } +#undef FOLD_OP + const analysis::Constant* merged_const = const_mgr->GetConstant(type, words); + return const_mgr->GetDefiningInstruction(merged_const)->result_id(); +} + +// Performs |input1| |opcode| |input2| and returns the merged constant result +// id. Returns 0 if the result is not a valid value. The input types must be +// Integers, Floats or Vectors of such. +uint32_t PerformOperation(analysis::ConstantManager* const_mgr, SpvOp opcode, + const analysis::Constant* input1, + const analysis::Constant* input2) { + assert(input1 && input2); + assert(input1->type() == input2->type()); + const analysis::Type* type = input1->type(); + std::vector words; + if (const analysis::Vector* vector_type = type->AsVector()) { + const analysis::Type* ele_type = vector_type->element_type(); + for (uint32_t i = 0; i != vector_type->element_count(); ++i) { + uint32_t id = 0; + + const analysis::Constant* input1_comp = nullptr; + if (const analysis::VectorConstant* input1_vector = + input1->AsVectorConstant()) { + input1_comp = input1_vector->GetComponents()[i]; + } else { + assert(input1->AsNullConstant()); + input1_comp = const_mgr->GetConstant(ele_type, {}); + } + + const analysis::Constant* input2_comp = nullptr; + if (const analysis::VectorConstant* input2_vector = + input2->AsVectorConstant()) { + input2_comp = input2_vector->GetComponents()[i]; + } else { + assert(input2->AsNullConstant()); + input2_comp = const_mgr->GetConstant(ele_type, {}); + } + + if (ele_type->AsFloat()) { + id = PerformFloatingPointOperation(const_mgr, opcode, input1_comp, + input2_comp); + } else { + assert(ele_type->AsInteger()); + id = PerformIntegerOperation(const_mgr, opcode, input1_comp, + input2_comp); + } + if (id == 0) return 0; + words.push_back(id); + } + const analysis::Constant* merged_const = + const_mgr->GetConstant(type, words); + return const_mgr->GetDefiningInstruction(merged_const)->result_id(); + } else if (type->AsFloat()) { + return PerformFloatingPointOperation(const_mgr, opcode, input1, input2); + } else { + assert(type->AsInteger()); + return PerformIntegerOperation(const_mgr, opcode, input1, input2); + } +} + +// Merges consecutive multiplies where each contains one constant operand. +// Cases: +// 2 * (x * 2) = x * 4 +// 2 * (2 * x) = x * 4 +// (x * 2) * 2 = x * 4 +// (2 * x) * 2 = x * 4 +FoldingRule MergeMulMulArithmetic() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFMul || inst->opcode() == SpvOpIMul); + ir::IRContext* context = inst->context(); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + const analysis::Type* type = + context->get_type_mgr()->GetType(inst->type_id()); + if (HasFloatingPoint(type) && !inst->IsFloatingPointFoldingAllowed()) + return false; + + uint32_t width = ElementWidth(type); + if (width != 32 && width != 64) return false; + + // Determine the constant input and the variable input in |inst|. + const analysis::Constant* const_input1 = ConstInput(constants); + if (!const_input1) return false; + ir::Instruction* other_inst = NonConstInput(context, constants[0], inst); + if (HasFloatingPoint(type) && !other_inst->IsFloatingPointFoldingAllowed()) + return false; + + if (other_inst->opcode() == inst->opcode()) { + std::vector other_constants = + const_mgr->GetOperandConstants(other_inst); + const analysis::Constant* const_input2 = ConstInput(other_constants); + if (!const_input2) return false; + + bool other_first_is_variable = other_constants[0] == nullptr; + uint32_t merged_id = PerformOperation(const_mgr, inst->opcode(), + const_input1, const_input2); + if (merged_id == 0) return false; + + uint32_t non_const_id = other_first_is_variable + ? other_inst->GetSingleWordInOperand(0u) + : other_inst->GetSingleWordInOperand(1u); + inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {non_const_id}}, + {SPV_OPERAND_TYPE_ID, {merged_id}}}); + return true; + } + + return false; + }; +} + +// Merges divides into subsequent multiplies if each instruction contains one +// constant operand. Does not support integer operations. +// Cases: +// 2 * (x / 2) = x * 1 +// 2 * (2 / x) = 4 / x +// (x / 2) * 2 = x * 1 +// (2 / x) * 2 = 4 / x +FoldingRule MergeMulDivArithmetic() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFMul); + ir::IRContext* context = inst->context(); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + const analysis::Type* type = + context->get_type_mgr()->GetType(inst->type_id()); + if (!inst->IsFloatingPointFoldingAllowed()) return false; + + uint32_t width = ElementWidth(type); + if (width != 32 && width != 64) return false; + + const analysis::Constant* const_input1 = ConstInput(constants); + if (!const_input1) return false; + ir::Instruction* other_inst = NonConstInput(context, constants[0], inst); + if (!other_inst->IsFloatingPointFoldingAllowed()) return false; + + if (other_inst->opcode() == SpvOpFDiv) { + std::vector other_constants = + const_mgr->GetOperandConstants(other_inst); + const analysis::Constant* const_input2 = ConstInput(other_constants); + if (!const_input2 || HasZero(const_input2)) return false; + + bool other_first_is_variable = other_constants[0] == nullptr; + // If the variable value is the second operand of the divide, multiply + // the constants together. Otherwise divide the constants. + uint32_t merged_id = PerformOperation( + const_mgr, + other_first_is_variable ? other_inst->opcode() : inst->opcode(), + const_input1, const_input2); + if (merged_id == 0) return false; + + uint32_t non_const_id = other_first_is_variable + ? other_inst->GetSingleWordInOperand(0u) + : other_inst->GetSingleWordInOperand(1u); + + // If the variable value is on the second operand of the div, then this + // operation is a div. Otherwise it should be a multiply. + inst->SetOpcode(other_first_is_variable ? inst->opcode() + : other_inst->opcode()); + if (other_first_is_variable) { + inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {non_const_id}}, + {SPV_OPERAND_TYPE_ID, {merged_id}}}); + } else { + inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {merged_id}}, + {SPV_OPERAND_TYPE_ID, {non_const_id}}}); + } + return true; + } + + return false; + }; +} + +// Merges multiply of constant and negation. +// Cases: +// (-x) * 2 = x * -2 +// 2 * (-x) = x * -2 +FoldingRule MergeMulNegateArithmetic() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFMul || inst->opcode() == SpvOpIMul); + ir::IRContext* context = inst->context(); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + const analysis::Type* type = + context->get_type_mgr()->GetType(inst->type_id()); + bool uses_float = HasFloatingPoint(type); + if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false; + + uint32_t width = ElementWidth(type); + if (width != 32 && width != 64) return false; + + const analysis::Constant* const_input1 = ConstInput(constants); + if (!const_input1) return false; + ir::Instruction* other_inst = NonConstInput(context, constants[0], inst); + if (uses_float && !other_inst->IsFloatingPointFoldingAllowed()) + return false; + + if (other_inst->opcode() == SpvOpFNegate || + other_inst->opcode() == SpvOpSNegate) { + uint32_t neg_id = NegateConstant(const_mgr, const_input1); + + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {other_inst->GetSingleWordInOperand(0u)}}, + {SPV_OPERAND_TYPE_ID, {neg_id}}}); + return true; + } + + return false; + }; +} + +// Merges consecutive divides if each instruction contains one constant operand. +// Does not support integer division. +// Cases: +// 2 / (x / 2) = 4 / x +// 4 / (2 / x) = 2 * x +// (4 / x) / 2 = 2 / x +// (x / 2) / 2 = x / 4 +FoldingRule MergeDivDivArithmetic() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFDiv); + ir::IRContext* context = inst->context(); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + const analysis::Type* type = + context->get_type_mgr()->GetType(inst->type_id()); + if (!inst->IsFloatingPointFoldingAllowed()) return false; + + uint32_t width = ElementWidth(type); + if (width != 32 && width != 64) return false; + + const analysis::Constant* const_input1 = ConstInput(constants); + if (!const_input1 || HasZero(const_input1)) return false; + ir::Instruction* other_inst = NonConstInput(context, constants[0], inst); + if (!other_inst->IsFloatingPointFoldingAllowed()) return false; + + bool first_is_variable = constants[0] == nullptr; + if (other_inst->opcode() == inst->opcode()) { + std::vector other_constants = + const_mgr->GetOperandConstants(other_inst); + const analysis::Constant* const_input2 = ConstInput(other_constants); + if (!const_input2 || HasZero(const_input2)) return false; + + bool other_first_is_variable = other_constants[0] == nullptr; + + SpvOp merge_op = inst->opcode(); + if (other_first_is_variable) { + // Constants magnify. + merge_op = SpvOpFMul; + } + + // This is an x / (*) case. Swap the inputs. Doesn't harm multiply + // because it is commutative. + if (first_is_variable) std::swap(const_input1, const_input2); + uint32_t merged_id = + PerformOperation(const_mgr, merge_op, const_input1, const_input2); + if (merged_id == 0) return false; + + uint32_t non_const_id = other_first_is_variable + ? other_inst->GetSingleWordInOperand(0u) + : other_inst->GetSingleWordInOperand(1u); + + SpvOp op = inst->opcode(); + if (!first_is_variable && !other_first_is_variable) { + // Effectively div of 1/x, so change to multiply. + op = SpvOpFMul; + } + + uint32_t op1 = merged_id; + uint32_t op2 = non_const_id; + if (first_is_variable && other_first_is_variable) std::swap(op1, op2); + inst->SetOpcode(op); + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {op1}}, {SPV_OPERAND_TYPE_ID, {op2}}}); + return true; + } + + return false; + }; +} + +// Fold multiplies succeeded by divides where each instruction contains a +// constant operand. Does not support integer divide. +// Cases: +// 4 / (x * 2) = 2 / x +// 4 / (2 * x) = 2 / x +// (x * 4) / 2 = x * 2 +// (4 * x) / 2 = x * 2 +FoldingRule MergeDivMulArithmetic() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFDiv); + ir::IRContext* context = inst->context(); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + const analysis::Type* type = + context->get_type_mgr()->GetType(inst->type_id()); + if (!inst->IsFloatingPointFoldingAllowed()) return false; + + uint32_t width = ElementWidth(type); + if (width != 32 && width != 64) return false; + + const analysis::Constant* const_input1 = ConstInput(constants); + if (!const_input1 || HasZero(const_input1)) return false; + ir::Instruction* other_inst = NonConstInput(context, constants[0], inst); + if (!other_inst->IsFloatingPointFoldingAllowed()) return false; + + bool first_is_variable = constants[0] == nullptr; + if (other_inst->opcode() == SpvOpFMul) { + std::vector other_constants = + const_mgr->GetOperandConstants(other_inst); + const analysis::Constant* const_input2 = ConstInput(other_constants); + if (!const_input2) return false; + + bool other_first_is_variable = other_constants[0] == nullptr; + + // This is an x / (*) case. Swap the inputs. + if (first_is_variable) std::swap(const_input1, const_input2); + uint32_t merged_id = PerformOperation(const_mgr, inst->opcode(), + const_input1, const_input2); + if (merged_id == 0) return false; + + uint32_t non_const_id = other_first_is_variable + ? other_inst->GetSingleWordInOperand(0u) + : other_inst->GetSingleWordInOperand(1u); + + uint32_t op1 = merged_id; + uint32_t op2 = non_const_id; + if (first_is_variable) std::swap(op1, op2); + + // Convert to multiply + if (first_is_variable) inst->SetOpcode(other_inst->opcode()); + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {op1}}, {SPV_OPERAND_TYPE_ID, {op2}}}); + return true; + } + + return false; + }; +} + +// Fold divides of a constant and a negation. +// Cases: +// (-x) / 2 = x / -2 +// 2 / (-x) = 2 / -x +FoldingRule MergeDivNegateArithmetic() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFDiv || inst->opcode() == SpvOpSDiv || + inst->opcode() == SpvOpUDiv); + ir::IRContext* context = inst->context(); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + const analysis::Type* type = + context->get_type_mgr()->GetType(inst->type_id()); + bool uses_float = HasFloatingPoint(type); + if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false; + + uint32_t width = ElementWidth(type); + if (width != 32 && width != 64) return false; + + const analysis::Constant* const_input1 = ConstInput(constants); + if (!const_input1) return false; + ir::Instruction* other_inst = NonConstInput(context, constants[0], inst); + if (uses_float && !other_inst->IsFloatingPointFoldingAllowed()) + return false; + + bool first_is_variable = constants[0] == nullptr; + if (other_inst->opcode() == SpvOpFNegate || + other_inst->opcode() == SpvOpSNegate) { + uint32_t neg_id = NegateConstant(const_mgr, const_input1); + + if (first_is_variable) { + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {other_inst->GetSingleWordInOperand(0u)}}, + {SPV_OPERAND_TYPE_ID, {neg_id}}}); + } else { + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {neg_id}}, + {SPV_OPERAND_TYPE_ID, {other_inst->GetSingleWordInOperand(0u)}}}); + } + return true; + } + + return false; + }; +} + +// Folds addition of a constant and a negation. +// Cases: +// (-x) + 2 = 2 - x +// 2 + (-x) = 2 - x +FoldingRule MergeAddNegateArithmetic() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFAdd || inst->opcode() == SpvOpIAdd); + ir::IRContext* context = inst->context(); + const analysis::Type* type = + context->get_type_mgr()->GetType(inst->type_id()); + bool uses_float = HasFloatingPoint(type); + if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false; + + const analysis::Constant* const_input1 = ConstInput(constants); + if (!const_input1) return false; + ir::Instruction* other_inst = NonConstInput(context, constants[0], inst); + if (uses_float && !other_inst->IsFloatingPointFoldingAllowed()) + return false; + + if (other_inst->opcode() == SpvOpSNegate || + other_inst->opcode() == SpvOpFNegate) { + inst->SetOpcode(HasFloatingPoint(type) ? SpvOpFSub : SpvOpISub); + uint32_t const_id = constants[0] ? inst->GetSingleWordInOperand(0u) + : inst->GetSingleWordInOperand(1u); + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {const_id}}, + {SPV_OPERAND_TYPE_ID, {other_inst->GetSingleWordInOperand(0u)}}}); + return true; + } + return false; + }; +} + +// Folds subtraction of a constant and a negation. +// Cases: +// (-x) - 2 = -2 - x +// 2 - (-x) = x + 2 +FoldingRule MergeSubNegateArithmetic() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFSub || inst->opcode() == SpvOpISub); + ir::IRContext* context = inst->context(); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + const analysis::Type* type = + context->get_type_mgr()->GetType(inst->type_id()); + bool uses_float = HasFloatingPoint(type); + if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false; + + uint32_t width = ElementWidth(type); + if (width != 32 && width != 64) return false; + + const analysis::Constant* const_input1 = ConstInput(constants); + if (!const_input1) return false; + ir::Instruction* other_inst = NonConstInput(context, constants[0], inst); + if (uses_float && !other_inst->IsFloatingPointFoldingAllowed()) + return false; + + if (other_inst->opcode() == SpvOpSNegate || + other_inst->opcode() == SpvOpFNegate) { + uint32_t op1 = 0; + uint32_t op2 = 0; + SpvOp opcode = inst->opcode(); + if (constants[0] != nullptr) { + op1 = other_inst->GetSingleWordInOperand(0u); + op2 = inst->GetSingleWordInOperand(0u); + opcode = HasFloatingPoint(type) ? SpvOpFAdd : SpvOpIAdd; + } else { + op1 = NegateConstant(const_mgr, const_input1); + op2 = other_inst->GetSingleWordInOperand(0u); + } + + inst->SetOpcode(opcode); + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {op1}}, {SPV_OPERAND_TYPE_ID, {op2}}}); + return true; + } + return false; + }; +} + +// Folds addition of an addition where each operation has a constant operand. +// Cases: +// (x + 2) + 2 = x + 4 +// (2 + x) + 2 = x + 4 +// 2 + (x + 2) = x + 4 +// 2 + (2 + x) = x + 4 +FoldingRule MergeAddAddArithmetic() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFAdd || inst->opcode() == SpvOpIAdd); + ir::IRContext* context = inst->context(); + const analysis::Type* type = + context->get_type_mgr()->GetType(inst->type_id()); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + bool uses_float = HasFloatingPoint(type); + if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false; + + uint32_t width = ElementWidth(type); + if (width != 32 && width != 64) return false; + + const analysis::Constant* const_input1 = ConstInput(constants); + if (!const_input1) return false; + ir::Instruction* other_inst = NonConstInput(context, constants[0], inst); + if (uses_float && !other_inst->IsFloatingPointFoldingAllowed()) + return false; + + if (other_inst->opcode() == SpvOpFAdd || + other_inst->opcode() == SpvOpIAdd) { + std::vector other_constants = + const_mgr->GetOperandConstants(other_inst); + const analysis::Constant* const_input2 = ConstInput(other_constants); + if (!const_input2) return false; + + ir::Instruction* non_const_input = + NonConstInput(context, other_constants[0], other_inst); + uint32_t merged_id = PerformOperation(const_mgr, inst->opcode(), + const_input1, const_input2); + if (merged_id == 0) return false; + + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {non_const_input->result_id()}}, + {SPV_OPERAND_TYPE_ID, {merged_id}}}); + return true; + } + return false; + }; +} + +// Folds addition of a subtraction where each operation has a constant operand. +// Cases: +// (x - 2) + 2 = x + 0 +// (2 - x) + 2 = 4 - x +// 2 + (x - 2) = x + 0 +// 2 + (2 - x) = 4 - x +FoldingRule MergeAddSubArithmetic() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFAdd || inst->opcode() == SpvOpIAdd); + ir::IRContext* context = inst->context(); + const analysis::Type* type = + context->get_type_mgr()->GetType(inst->type_id()); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + bool uses_float = HasFloatingPoint(type); + if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false; + + uint32_t width = ElementWidth(type); + if (width != 32 && width != 64) return false; + + const analysis::Constant* const_input1 = ConstInput(constants); + if (!const_input1) return false; + ir::Instruction* other_inst = NonConstInput(context, constants[0], inst); + if (uses_float && !other_inst->IsFloatingPointFoldingAllowed()) + return false; + + if (other_inst->opcode() == SpvOpFSub || + other_inst->opcode() == SpvOpISub) { + std::vector other_constants = + const_mgr->GetOperandConstants(other_inst); + const analysis::Constant* const_input2 = ConstInput(other_constants); + if (!const_input2) return false; + + bool first_is_variable = other_constants[0] == nullptr; + SpvOp op = inst->opcode(); + uint32_t op1 = 0; + uint32_t op2 = 0; + if (first_is_variable) { + // Subtract constants. Non-constant operand is first. + op1 = other_inst->GetSingleWordInOperand(0u); + op2 = PerformOperation(const_mgr, other_inst->opcode(), const_input1, + const_input2); + } else { + // Add constants. Constant operand is first. Change the opcode. + op1 = PerformOperation(const_mgr, inst->opcode(), const_input1, + const_input2); + op2 = other_inst->GetSingleWordInOperand(1u); + op = other_inst->opcode(); + } + if (op1 == 0 || op2 == 0) return false; + + inst->SetOpcode(op); + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {op1}}, {SPV_OPERAND_TYPE_ID, {op2}}}); + return true; + } + return false; + }; +} + +// Folds subtraction of an addition where each operand has a constant operand. +// Cases: +// (x + 2) - 2 = x + 0 +// (2 + x) - 2 = x + 0 +// 2 - (x + 2) = 0 - x +// 2 - (2 + x) = 0 - x +FoldingRule MergeSubAddArithmetic() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFSub || inst->opcode() == SpvOpISub); + ir::IRContext* context = inst->context(); + const analysis::Type* type = + context->get_type_mgr()->GetType(inst->type_id()); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + bool uses_float = HasFloatingPoint(type); + if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false; + + uint32_t width = ElementWidth(type); + if (width != 32 && width != 64) return false; + + const analysis::Constant* const_input1 = ConstInput(constants); + if (!const_input1) return false; + ir::Instruction* other_inst = NonConstInput(context, constants[0], inst); + if (uses_float && !other_inst->IsFloatingPointFoldingAllowed()) + return false; + + if (other_inst->opcode() == SpvOpFAdd || + other_inst->opcode() == SpvOpIAdd) { + std::vector other_constants = + const_mgr->GetOperandConstants(other_inst); + const analysis::Constant* const_input2 = ConstInput(other_constants); + if (!const_input2) return false; + + ir::Instruction* non_const_input = + NonConstInput(context, other_constants[0], other_inst); + + // If the first operand of the sub is not a constant, swap the constants + // so the subtraction has the correct operands. + if (constants[0] == nullptr) std::swap(const_input1, const_input2); + // Subtract the constants. + uint32_t merged_id = PerformOperation(const_mgr, inst->opcode(), + const_input1, const_input2); + SpvOp op = inst->opcode(); + uint32_t op1 = 0; + uint32_t op2 = 0; + if (constants[0] == nullptr) { + // Non-constant operand is first. Change the opcode. + op1 = non_const_input->result_id(); + op2 = merged_id; + op = other_inst->opcode(); + } else { + // Constant operand is first. + op1 = merged_id; + op2 = non_const_input->result_id(); + } + if (op1 == 0 || op2 == 0) return false; + + inst->SetOpcode(op); + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {op1}}, {SPV_OPERAND_TYPE_ID, {op2}}}); + return true; + } + return false; + }; +} + +// Folds subtraction of a subtraction where each operand has a constant operand. +// Cases: +// (x - 2) - 2 = x - 4 +// (2 - x) - 2 = 0 - x +// 2 - (x - 2) = 4 - x +// 2 - (2 - x) = x + 0 +FoldingRule MergeSubSubArithmetic() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFSub || inst->opcode() == SpvOpISub); + ir::IRContext* context = inst->context(); + const analysis::Type* type = + context->get_type_mgr()->GetType(inst->type_id()); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + bool uses_float = HasFloatingPoint(type); + if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false; + + uint32_t width = ElementWidth(type); + if (width != 32 && width != 64) return false; + + const analysis::Constant* const_input1 = ConstInput(constants); + if (!const_input1) return false; + ir::Instruction* other_inst = NonConstInput(context, constants[0], inst); + if (uses_float && !other_inst->IsFloatingPointFoldingAllowed()) + return false; + + if (other_inst->opcode() == SpvOpFSub || + other_inst->opcode() == SpvOpISub) { + std::vector other_constants = + const_mgr->GetOperandConstants(other_inst); + const analysis::Constant* const_input2 = ConstInput(other_constants); + if (!const_input2) return false; + + ir::Instruction* non_const_input = + NonConstInput(context, other_constants[0], other_inst); + + // Merge the constants. + uint32_t merged_id = 0; + SpvOp merge_op = inst->opcode(); + if (other_constants[0] == nullptr) { + merge_op = uses_float ? SpvOpFAdd : SpvOpIAdd; + } else if (constants[0] == nullptr) { + std::swap(const_input1, const_input2); + } + merged_id = + PerformOperation(const_mgr, merge_op, const_input1, const_input2); + if (merged_id == 0) return false; + + SpvOp op = inst->opcode(); + if (constants[0] != nullptr && other_constants[0] != nullptr) { + // Change the operation. + op = uses_float ? SpvOpFAdd : SpvOpIAdd; + } + + uint32_t op1 = 0; + uint32_t op2 = 0; + if ((constants[0] == nullptr) ^ (other_constants[0] == nullptr)) { + op1 = merged_id; + op2 = non_const_input->result_id(); + } else { + op1 = non_const_input->result_id(); + op2 = merged_id; + } + + inst->SetOpcode(op); + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {op1}}, {SPV_OPERAND_TYPE_ID, {op2}}}); + return true; + } + return false; + }; +} + +FoldingRule IntMultipleBy1() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpIMul && "Wrong opcode. Should be OpIMul."); + for (uint32_t i = 0; i < 2; i++) { + if (constants[i] == nullptr) { + continue; + } + const analysis::IntConstant* int_constant = constants[i]->AsIntConstant(); + if (int_constant) { + uint32_t width = ElementWidth(int_constant->type()); + if (width != 32 && width != 64) return false; + bool is_one = (width == 32) ? int_constant->GetU32BitValue() == 1u + : int_constant->GetU64BitValue() == 1ull; + if (is_one) { + inst->SetOpcode(SpvOpCopyObject); + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {inst->GetSingleWordInOperand(1 - i)}}}); + return true; + } + } + } + return false; + }; +} + +FoldingRule CompositeConstructFeedingExtract() { + return [](ir::Instruction* inst, + const std::vector&) { + // If the input to an OpCompositeExtract is an OpCompositeConstruct, + // then we can simply use the appropriate element in the construction. + assert(inst->opcode() == SpvOpCompositeExtract && + "Wrong opcode. Should be OpCompositeExtract."); + analysis::DefUseManager* def_use_mgr = inst->context()->get_def_use_mgr(); + analysis::TypeManager* type_mgr = inst->context()->get_type_mgr(); + uint32_t cid = inst->GetSingleWordInOperand(kExtractCompositeIdInIdx); + ir::Instruction* cinst = def_use_mgr->GetDef(cid); + + if (cinst->opcode() != SpvOpCompositeConstruct) { + return false; + } + + std::vector operands; + analysis::Type* composite_type = type_mgr->GetType(cinst->type_id()); + if (composite_type->AsVector() == nullptr) { + // Get the element being extracted from the OpCompositeConstruct + // Since it is not a vector, it is simple to extract the single element. + uint32_t element_index = inst->GetSingleWordInOperand(1); + uint32_t element_id = cinst->GetSingleWordInOperand(element_index); + operands.push_back({SPV_OPERAND_TYPE_ID, {element_id}}); + + // Add the remaining indices for extraction. + for (uint32_t i = 2; i < inst->NumInOperands(); ++i) { + operands.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER, + {inst->GetSingleWordInOperand(i)}}); + } + + } else { + // With vectors we have to handle the case where it is concatenating + // vectors. + assert(inst->NumInOperands() == 2 && + "Expecting a vector of scalar values."); + + uint32_t element_index = inst->GetSingleWordInOperand(1); + for (uint32_t construct_index = 0; + construct_index < cinst->NumInOperands(); ++construct_index) { + uint32_t element_id = cinst->GetSingleWordInOperand(construct_index); + ir::Instruction* element_def = def_use_mgr->GetDef(element_id); + analysis::Vector* element_type = + type_mgr->GetType(element_def->type_id())->AsVector(); + if (element_type) { + uint32_t vector_size = element_type->element_count(); + if (vector_size < element_index) { + // The element we want comes after this vector. + element_index -= vector_size; + } else { + // We want an element of this vector. + operands.push_back({SPV_OPERAND_TYPE_ID, {element_id}}); + operands.push_back( + {SPV_OPERAND_TYPE_LITERAL_INTEGER, {element_index}}); + break; + } + } else { + if (element_index == 0) { + // This is a scalar, and we this is the element we are extracting. + operands.push_back({SPV_OPERAND_TYPE_ID, {element_id}}); + break; + } else { + // Skip over this scalar value. + --element_index; + } + } + } + } + + // If there were no extra indices, then we have the final object. No need + // to extract even more. + if (operands.size() == 1) { + inst->SetOpcode(SpvOpCopyObject); + } + + inst->SetInOperands(std::move(operands)); + return true; + }; +} + +FoldingRule CompositeExtractFeedingConstruct() { + // If the OpCompositeConstruct is simply putting back together elements that + // where extracted from the same souce, we can simlpy reuse the source. + // + // This is a common code pattern because of the way that scalar replacement + // works. + return [](ir::Instruction* inst, + const std::vector&) { + assert(inst->opcode() == SpvOpCompositeConstruct && + "Wrong opcode. Should be OpCompositeConstruct."); + analysis::DefUseManager* def_use_mgr = inst->context()->get_def_use_mgr(); + uint32_t original_id = 0; + + // Check each element to make sure they are: + // - extractions + // - extracting the same position they are inserting + // - all extract from the same id. + for (uint32_t i = 0; i < inst->NumInOperands(); ++i) { + uint32_t element_id = inst->GetSingleWordInOperand(i); + ir::Instruction* element_inst = def_use_mgr->GetDef(element_id); + + if (element_inst->opcode() != SpvOpCompositeExtract) { + return false; + } + + if (element_inst->NumInOperands() != 2) { + return false; + } + + if (element_inst->GetSingleWordInOperand(1) != i) { + return false; + } + + if (i == 0) { + original_id = + element_inst->GetSingleWordInOperand(kExtractCompositeIdInIdx); + } else if (original_id != element_inst->GetSingleWordInOperand( + kExtractCompositeIdInIdx)) { + return false; + } + } + + // The last check it to see that the object being extracted from is the + // correct type. + ir::Instruction* original_inst = def_use_mgr->GetDef(original_id); + if (original_inst->type_id() != inst->type_id()) { + return false; + } + + // Simplify by using the original object. + inst->SetOpcode(SpvOpCopyObject); + inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {original_id}}}); + return true; + }; +} + +FoldingRule InsertFeedingExtract() { + return [](ir::Instruction* inst, + const std::vector&) { + assert(inst->opcode() == SpvOpCompositeExtract && + "Wrong opcode. Should be OpCompositeExtract."); + analysis::DefUseManager* def_use_mgr = inst->context()->get_def_use_mgr(); + uint32_t cid = inst->GetSingleWordInOperand(kExtractCompositeIdInIdx); + ir::Instruction* cinst = def_use_mgr->GetDef(cid); + + if (cinst->opcode() != SpvOpCompositeInsert) { + return false; + } + + // Find the first position where the list of insert and extract indicies + // differ, if at all. + uint32_t i; + for (i = 1; i < inst->NumInOperands(); ++i) { + if (i + 1 >= cinst->NumInOperands()) { + break; + } + + if (inst->GetSingleWordInOperand(i) != + cinst->GetSingleWordInOperand(i + 1)) { + break; + } + } + + // We are extracting the element that was inserted. + if (i == inst->NumInOperands() && i + 1 == cinst->NumInOperands()) { + inst->SetOpcode(SpvOpCopyObject); + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, + {cinst->GetSingleWordInOperand(kInsertObjectIdInIdx)}}}); + return true; + } + + // Extracting the value that was inserted along with values for the base + // composite. Cannot do anything. + if (i == inst->NumInOperands()) { + return false; + } + + // Extracting an element of the value that was inserted. Extract from + // that value directly. + if (i + 1 == cinst->NumInOperands()) { + std::vector operands; + operands.push_back( + {SPV_OPERAND_TYPE_ID, + {cinst->GetSingleWordInOperand(kInsertObjectIdInIdx)}}); + for (; i < inst->NumInOperands(); ++i) { + operands.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER, + {inst->GetSingleWordInOperand(i)}}); + } + inst->SetInOperands(std::move(operands)); + return true; + } + + // Extracting a value that is disjoint from the element being inserted. + // Rewrite the extract to use the composite input to the insert. + std::vector operands; + operands.push_back( + {SPV_OPERAND_TYPE_ID, + {cinst->GetSingleWordInOperand(kInsertCompositeIdInIdx)}}); + for (i = 1; i < inst->NumInOperands(); ++i) { + operands.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER, + {inst->GetSingleWordInOperand(i)}}); + } + inst->SetInOperands(std::move(operands)); + return true; + }; +} + +// When a VectorShuffle is feeding an Extract, we can extract from one of the +// operands of the VectorShuffle. We just need to adjust the index in the +// extract instruction. +FoldingRule VectorShuffleFeedingExtract() { + return [](ir::Instruction* inst, + const std::vector&) { + assert(inst->opcode() == SpvOpCompositeExtract && + "Wrong opcode. Should be OpCompositeExtract."); + analysis::DefUseManager* def_use_mgr = inst->context()->get_def_use_mgr(); + analysis::TypeManager* type_mgr = inst->context()->get_type_mgr(); + uint32_t cid = inst->GetSingleWordInOperand(kExtractCompositeIdInIdx); + ir::Instruction* cinst = def_use_mgr->GetDef(cid); + + if (cinst->opcode() != SpvOpVectorShuffle) { + return false; + } + + // Find the size of the first vector operand of the VectorShuffle + ir::Instruction* first_input = + def_use_mgr->GetDef(cinst->GetSingleWordInOperand(0)); + analysis::Type* first_input_type = + type_mgr->GetType(first_input->type_id()); + assert(first_input_type->AsVector() && + "Input to vector shuffle should be vectors."); + uint32_t first_input_size = first_input_type->AsVector()->element_count(); + + // Get index of the element the vector shuffle is placing in the position + // being extracted. + uint32_t new_index = + cinst->GetSingleWordInOperand(2 + inst->GetSingleWordInOperand(1)); + + // Get the id of the of the vector the elemtent comes from, and update the + // index if needed. + uint32_t new_vector = 0; + if (new_index < first_input_size) { + new_vector = cinst->GetSingleWordInOperand(0); + } else { + new_vector = cinst->GetSingleWordInOperand(1); + new_index -= first_input_size; + } + + // Update the extract instruction. + inst->SetInOperand(kExtractCompositeIdInIdx, {new_vector}); + inst->SetInOperand(1, {new_index}); + return true; + }; +} + +FoldingRule RedundantPhi() { + // An OpPhi instruction where all values are the same or the result of the phi + // itself, can be replaced by the value itself. + return + [](ir::Instruction* inst, const std::vector&) { + assert(inst->opcode() == SpvOpPhi && "Wrong opcode. Should be OpPhi."); + + ir::IRContext* context = inst->context(); + analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); + + uint32_t incoming_value = 0; + + for (uint32_t i = 0; i < inst->NumInOperands(); i += 2) { + uint32_t op_id = inst->GetSingleWordInOperand(i); + if (op_id == inst->result_id()) { + continue; + } + + ir::Instruction* op_inst = def_use_mgr->GetDef(op_id); + if (op_inst->opcode() == SpvOpUndef) { + // TODO: We should be able to still use op_id if we know that + // the definition of op_id dominates |inst|. + return false; + } + + if (incoming_value == 0) { + incoming_value = op_id; + } else if (op_id != incoming_value) { + // Found two possible value. Can't simplify. + return false; + } + } + + if (incoming_value == 0) { + // Code looks invalid. Don't do anything. + return false; + } + + // We have a single incoming value. Simplify using that value. + inst->SetOpcode(SpvOpCopyObject); + inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {incoming_value}}}); + return true; + }; +} + +FoldingRule RedundantSelect() { + // An OpSelect instruction where both values are the same or the condition is + // constant can be replaced by one of the values + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpSelect && + "Wrong opcode. Should be OpSelect."); + assert(inst->NumInOperands() == 3); + assert(constants.size() == 3); + + uint32_t true_id = inst->GetSingleWordInOperand(1); + uint32_t false_id = inst->GetSingleWordInOperand(2); + + if (true_id == false_id) { + // Both results are the same, condition doesn't matter + inst->SetOpcode(SpvOpCopyObject); + inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {true_id}}}); + return true; + } else if (constants[0]) { + const analysis::Type* type = constants[0]->type(); + if (type->AsBool()) { + // Scalar constant value, select the corresponding value. + inst->SetOpcode(SpvOpCopyObject); + if (constants[0]->AsNullConstant() || + !constants[0]->AsBoolConstant()->value()) { + inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {false_id}}}); + } else { + inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {true_id}}}); + } + return true; + } else { + assert(type->AsVector()); + if (constants[0]->AsNullConstant()) { + // All values come from false id. + inst->SetOpcode(SpvOpCopyObject); + inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {false_id}}}); + return true; + } else { + // Convert to a vector shuffle. + std::vector ops; + ops.push_back({SPV_OPERAND_TYPE_ID, {true_id}}); + ops.push_back({SPV_OPERAND_TYPE_ID, {false_id}}); + const analysis::VectorConstant* vector_const = + constants[0]->AsVectorConstant(); + uint32_t size = + static_cast(vector_const->GetComponents().size()); + for (uint32_t i = 0; i != size; ++i) { + const analysis::Constant* component = + vector_const->GetComponents()[i]; + if (component->AsNullConstant() || + !component->AsBoolConstant()->value()) { + // Selecting from the false vector which is the second input + // vector to the shuffle. Offset the index by |size|. + ops.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER, {i + size}}); + } else { + // Selecting from true vector which is the first input vector to + // the shuffle. + ops.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER, {i}}); + } + } + + inst->SetOpcode(SpvOpVectorShuffle); + inst->SetInOperands(std::move(ops)); + return true; + } + } + } + + return false; + }; +} + +enum class FloatConstantKind { Unknown, Zero, One }; + +FloatConstantKind getFloatConstantKind(const analysis::Constant* constant) { + if (constant == nullptr) { + return FloatConstantKind::Unknown; + } + + assert(HasFloatingPoint(constant->type()) && "Unexpected constant type"); + + if (constant->AsNullConstant()) { + return FloatConstantKind::Zero; + } else if (const analysis::VectorConstant* vc = + constant->AsVectorConstant()) { + const std::vector& components = + vc->GetComponents(); + assert(!components.empty()); + + FloatConstantKind kind = getFloatConstantKind(components[0]); + + for (size_t i = 1; i < components.size(); ++i) { + if (getFloatConstantKind(components[i]) != kind) { + return FloatConstantKind::Unknown; + } + } + + return kind; + } else if (const analysis::FloatConstant* fc = constant->AsFloatConstant()) { + if (fc->IsZero()) return FloatConstantKind::Zero; + + uint32_t width = fc->type()->AsFloat()->width(); + if (width != 32 && width != 64) return FloatConstantKind::Unknown; + + double value = (width == 64) ? fc->GetDoubleValue() : fc->GetFloatValue(); + + if (value == 0.0) { + return FloatConstantKind::Zero; + } else if (value == 1.0) { + return FloatConstantKind::One; + } else { + return FloatConstantKind::Unknown; + } + } else { + return FloatConstantKind::Unknown; + } +} + +FoldingRule RedundantFAdd() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFAdd && "Wrong opcode. Should be OpFAdd."); + assert(constants.size() == 2); + + if (!inst->IsFloatingPointFoldingAllowed()) { + return false; + } + + FloatConstantKind kind0 = getFloatConstantKind(constants[0]); + FloatConstantKind kind1 = getFloatConstantKind(constants[1]); + + if (kind0 == FloatConstantKind::Zero || kind1 == FloatConstantKind::Zero) { + inst->SetOpcode(SpvOpCopyObject); + inst->SetInOperands({{SPV_OPERAND_TYPE_ID, + {inst->GetSingleWordInOperand( + kind0 == FloatConstantKind::Zero ? 1 : 0)}}}); + return true; + } + + return false; + }; +} + +FoldingRule RedundantFSub() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFSub && "Wrong opcode. Should be OpFSub."); + assert(constants.size() == 2); + + if (!inst->IsFloatingPointFoldingAllowed()) { + return false; + } + + FloatConstantKind kind0 = getFloatConstantKind(constants[0]); + FloatConstantKind kind1 = getFloatConstantKind(constants[1]); + + if (kind0 == FloatConstantKind::Zero) { + inst->SetOpcode(SpvOpFNegate); + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {inst->GetSingleWordInOperand(1)}}}); + return true; + } + + if (kind1 == FloatConstantKind::Zero) { + inst->SetOpcode(SpvOpCopyObject); + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {inst->GetSingleWordInOperand(0)}}}); + return true; + } + + return false; + }; +} + +FoldingRule RedundantFMul() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFMul && "Wrong opcode. Should be OpFMul."); + assert(constants.size() == 2); + + if (!inst->IsFloatingPointFoldingAllowed()) { + return false; + } + + FloatConstantKind kind0 = getFloatConstantKind(constants[0]); + FloatConstantKind kind1 = getFloatConstantKind(constants[1]); + + if (kind0 == FloatConstantKind::Zero || kind1 == FloatConstantKind::Zero) { + inst->SetOpcode(SpvOpCopyObject); + inst->SetInOperands({{SPV_OPERAND_TYPE_ID, + {inst->GetSingleWordInOperand( + kind0 == FloatConstantKind::Zero ? 0 : 1)}}}); + return true; + } + + if (kind0 == FloatConstantKind::One || kind1 == FloatConstantKind::One) { + inst->SetOpcode(SpvOpCopyObject); + inst->SetInOperands({{SPV_OPERAND_TYPE_ID, + {inst->GetSingleWordInOperand( + kind0 == FloatConstantKind::One ? 1 : 0)}}}); + return true; + } + + return false; + }; +} + +FoldingRule RedundantFDiv() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpFDiv && "Wrong opcode. Should be OpFDiv."); + assert(constants.size() == 2); + + if (!inst->IsFloatingPointFoldingAllowed()) { + return false; + } + + FloatConstantKind kind0 = getFloatConstantKind(constants[0]); + FloatConstantKind kind1 = getFloatConstantKind(constants[1]); + + if (kind0 == FloatConstantKind::Zero) { + inst->SetOpcode(SpvOpCopyObject); + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {inst->GetSingleWordInOperand(0)}}}); + return true; + } + + if (kind1 == FloatConstantKind::One) { + inst->SetOpcode(SpvOpCopyObject); + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {inst->GetSingleWordInOperand(0)}}}); + return true; + } + + return false; + }; +} + +FoldingRule RedundantFMix() { + return [](ir::Instruction* inst, + const std::vector& constants) { + assert(inst->opcode() == SpvOpExtInst && + "Wrong opcode. Should be OpExtInst."); + + if (!inst->IsFloatingPointFoldingAllowed()) { + return false; + } + + uint32_t instSetId = + inst->context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450(); + + if (inst->GetSingleWordInOperand(kExtInstSetIdInIdx) == instSetId && + inst->GetSingleWordInOperand(kExtInstInstructionInIdx) == + GLSLstd450FMix) { + assert(constants.size() == 5); + + FloatConstantKind kind4 = getFloatConstantKind(constants[4]); + + if (kind4 == FloatConstantKind::Zero || kind4 == FloatConstantKind::One) { + inst->SetOpcode(SpvOpCopyObject); + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, + {inst->GetSingleWordInOperand(kind4 == FloatConstantKind::Zero + ? kFMixXIdInIdx + : kFMixYIdInIdx)}}}); + return true; + } + } + + return false; + }; +} + +} // namespace + +spvtools::opt::FoldingRules::FoldingRules() { + // Add all folding rules to the list for the opcodes to which they apply. + // Note that the order in which rules are added to the list matters. If a rule + // applies to the instruction, the rest of the rules will not be attempted. + // Take that into consideration. + + rules_[SpvOpCompositeConstruct].push_back(CompositeExtractFeedingConstruct()); + + rules_[SpvOpCompositeExtract].push_back(InsertFeedingExtract()); + rules_[SpvOpCompositeExtract].push_back(CompositeConstructFeedingExtract()); + rules_[SpvOpCompositeExtract].push_back(VectorShuffleFeedingExtract()); + + rules_[SpvOpExtInst].push_back(RedundantFMix()); + + rules_[SpvOpFAdd].push_back(RedundantFAdd()); + rules_[SpvOpFAdd].push_back(MergeAddNegateArithmetic()); + rules_[SpvOpFAdd].push_back(MergeAddAddArithmetic()); + rules_[SpvOpFAdd].push_back(MergeAddSubArithmetic()); + + rules_[SpvOpFDiv].push_back(RedundantFDiv()); + rules_[SpvOpFDiv].push_back(ReciprocalFDiv()); + rules_[SpvOpFDiv].push_back(MergeDivDivArithmetic()); + rules_[SpvOpFDiv].push_back(MergeDivMulArithmetic()); + rules_[SpvOpFDiv].push_back(MergeDivNegateArithmetic()); + + rules_[SpvOpFMul].push_back(RedundantFMul()); + rules_[SpvOpFMul].push_back(MergeMulMulArithmetic()); + rules_[SpvOpFMul].push_back(MergeMulDivArithmetic()); + rules_[SpvOpFMul].push_back(MergeMulNegateArithmetic()); + + rules_[SpvOpFNegate].push_back(MergeNegateArithmetic()); + rules_[SpvOpFNegate].push_back(MergeNegateAddSubArithmetic()); + rules_[SpvOpFNegate].push_back(MergeNegateMulDivArithmetic()); + + rules_[SpvOpFSub].push_back(RedundantFSub()); + rules_[SpvOpFSub].push_back(MergeSubNegateArithmetic()); + rules_[SpvOpFSub].push_back(MergeSubAddArithmetic()); + rules_[SpvOpFSub].push_back(MergeSubSubArithmetic()); + + rules_[SpvOpIAdd].push_back(MergeAddNegateArithmetic()); + rules_[SpvOpIAdd].push_back(MergeAddAddArithmetic()); + rules_[SpvOpIAdd].push_back(MergeAddSubArithmetic()); + + rules_[SpvOpIMul].push_back(IntMultipleBy1()); + rules_[SpvOpIMul].push_back(MergeMulMulArithmetic()); + rules_[SpvOpIMul].push_back(MergeMulNegateArithmetic()); + + rules_[SpvOpISub].push_back(MergeSubNegateArithmetic()); + rules_[SpvOpISub].push_back(MergeSubAddArithmetic()); + rules_[SpvOpISub].push_back(MergeSubSubArithmetic()); + + rules_[SpvOpPhi].push_back(RedundantPhi()); + + rules_[SpvOpSDiv].push_back(MergeDivNegateArithmetic()); + + rules_[SpvOpSNegate].push_back(MergeNegateArithmetic()); + rules_[SpvOpSNegate].push_back(MergeNegateMulDivArithmetic()); + rules_[SpvOpSNegate].push_back(MergeNegateAddSubArithmetic()); + + rules_[SpvOpSelect].push_back(RedundantSelect()); + + rules_[SpvOpUDiv].push_back(MergeDivNegateArithmetic()); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/folding_rules.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/folding_rules.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/folding_rules.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/folding_rules.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,81 @@ +// Copyright (c) 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_UTIL_FOLDING_RULES_H_ +#define LIBSPIRV_UTIL_FOLDING_RULES_H_ + +#include +#include + +#include "constants.h" +#include "def_use_manager.h" +#include "ir_builder.h" +#include "ir_context.h" + +namespace spvtools { +namespace opt { + +// Folding Rules: +// +// The folding mechanism is built around the concept of a |FoldingRule|. A +// folding rule is a function that implements a method of simplifying an +// instruction. +// +// The inputs to a folding rule are: +// |inst| - the instruction to be simplified. +// |constants| - if an in-operands is an id of a constant, then the +// corresponding value in |constants| contains that +// constant value. Otherwise, the corresponding entry in +// |constants| is |nullptr|. +// +// A folding rule returns true if |inst| can be simplified using this rule. If +// the instruction can be simplified, then |inst| is changed to the simplified +// instruction. Otherwise, |inst| remains the same. +// +// See folding_rules.cpp for examples on how to write a folding rule. It is +// important to note that if |inst| can be folded to the result of an +// instruction that feed it, then |inst| should be changed to an OpCopyObject +// that copies that id. +// +// Be sure to add new folding rules to the table of folding rules in the +// constructor for FoldingRules. The new rule should be added to the list for +// every opcode that it applies to. Note that earlier rules in the list are +// given priority. That is, if an earlier rule is able to fold an instruction, +// the later rules will not be attempted. + +using FoldingRule = std::function& constants)>; + +class FoldingRules { + public: + FoldingRules(); + + const std::vector& GetRulesForOpcode(SpvOp opcode) { + auto it = rules_.find(opcode); + if (it != rules_.end()) { + return it->second; + } + return empty_vector_; + } + + private: + std::unordered_map> rules_; + std::vector empty_vector_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_UTIL_FOLDING_RULES_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,397 @@ +// Copyright (c) 2016 Google 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. + +#include "fold_spec_constant_op_and_composite_pass.h" + +#include +#include +#include + +#include "constants.h" +#include "fold.h" +#include "ir_context.h" +#include "make_unique.h" + +namespace spvtools { +namespace opt { + +Pass::Status FoldSpecConstantOpAndCompositePass::Process( + ir::IRContext* irContext) { + Initialize(irContext); + return ProcessImpl(irContext); +} + +void FoldSpecConstantOpAndCompositePass::Initialize(ir::IRContext* irContext) { + InitializeProcessing(irContext); +} + +Pass::Status FoldSpecConstantOpAndCompositePass::ProcessImpl( + ir::IRContext* irContext) { + bool modified = false; + // Traverse through all the constant defining instructions. For Normal + // Constants whose values are determined and do not depend on OpUndef + // instructions, records their values in two internal maps: id_to_const_val_ + // and const_val_to_id_ so that we can use them to infer the value of Spec + // Constants later. + // For Spec Constants defined with OpSpecConstantComposite instructions, if + // all of their components are Normal Constants, they will be turned into + // Normal Constants too. For Spec Constants defined with OpSpecConstantOp + // instructions, we check if they only depends on Normal Constants and fold + // them when possible. The two maps for Normal Constants: id_to_const_val_ + // and const_val_to_id_ will be updated along the traversal so that the new + // Normal Constants generated from folding can be used to fold following Spec + // Constants. + // This algorithm depends on the SSA property of SPIR-V when + // defining constants. The dependent constants must be defined before the + // dependee constants. So a dependent Spec Constant must be defined and + // will be processed before its dependee Spec Constant. When we encounter + // the dependee Spec Constants, all its dependent constants must have been + // processed and all its dependent Spec Constants should have been folded if + // possible. + ir::Module::inst_iterator next_inst = irContext->types_values_begin(); + for (ir::Module::inst_iterator inst_iter = next_inst; + // Need to re-evaluate the end iterator since we may modify the list of + // instructions in this section of the module as the process goes. + inst_iter != irContext->types_values_end(); inst_iter = next_inst) { + ++next_inst; + ir::Instruction* inst = &*inst_iter; + // Collect constant values of normal constants and process the + // OpSpecConstantOp and OpSpecConstantComposite instructions if possible. + // The constant values will be stored in analysis::Constant instances. + // OpConstantSampler instruction is not collected here because it cannot be + // used in OpSpecConstant{Composite|Op} instructions. + // TODO(qining): If the constant or its type has decoration, we may need + // to skip it. + if (context()->get_constant_mgr()->GetType(inst) && + !context()->get_constant_mgr()->GetType(inst)->decoration_empty()) + continue; + switch (SpvOp opcode = inst->opcode()) { + // Records the values of Normal Constants. + case SpvOp::SpvOpConstantTrue: + case SpvOp::SpvOpConstantFalse: + case SpvOp::SpvOpConstant: + case SpvOp::SpvOpConstantNull: + case SpvOp::SpvOpConstantComposite: + case SpvOp::SpvOpSpecConstantComposite: { + // A Constant instance will be created if the given instruction is a + // Normal Constant whose value(s) are fixed. Note that for a composite + // Spec Constant defined with OpSpecConstantComposite instruction, if + // all of its components are Normal Constants already, the Spec + // Constant will be turned in to a Normal Constant. In that case, a + // Constant instance should also be created successfully and recorded + // in the id_to_const_val_ and const_val_to_id_ mapps. + if (auto const_value = + context()->get_constant_mgr()->GetConstantFromInst(inst)) { + // Need to replace the OpSpecConstantComposite instruction with a + // corresponding OpConstantComposite instruction. + if (opcode == SpvOp::SpvOpSpecConstantComposite) { + inst->SetOpcode(SpvOp::SpvOpConstantComposite); + modified = true; + } + context()->get_constant_mgr()->MapConstantToInst(const_value, inst); + } + break; + } + // For a Spec Constants defined with OpSpecConstantOp instruction, check + // if it only depends on Normal Constants. If so, the Spec Constant will + // be folded. The original Spec Constant defining instruction will be + // replaced by Normal Constant defining instructions, and the new Normal + // Constants will be added to id_to_const_val_ and const_val_to_id_ so + // that we can use the new Normal Constants when folding following Spec + // Constants. + case SpvOp::SpvOpSpecConstantOp: + modified |= ProcessOpSpecConstantOp(&inst_iter); + break; + default: + break; + } + } + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +bool FoldSpecConstantOpAndCompositePass::ProcessOpSpecConstantOp( + ir::Module::inst_iterator* pos) { + ir::Instruction* inst = &**pos; + ir::Instruction* folded_inst = nullptr; + assert(inst->GetInOperand(0).type == + SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER && + "The first in-operand of OpSpecContantOp instruction must be of " + "SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER type"); + + switch (static_cast(inst->GetSingleWordInOperand(0))) { + case SpvOp::SpvOpCompositeExtract: + folded_inst = DoCompositeExtract(pos); + break; + case SpvOp::SpvOpVectorShuffle: + folded_inst = DoVectorShuffle(pos); + break; + + case SpvOp::SpvOpCompositeInsert: + // Current Glslang does not generate code with OpSpecConstantOp + // CompositeInsert instruction, so this is not implmented so far. + // TODO(qining): Implement CompositeInsert case. + return false; + + default: + // Component-wise operations. + folded_inst = DoComponentWiseOperation(pos); + break; + } + if (!folded_inst) return false; + + // Replace the original constant with the new folded constant, kill the + // original constant. + uint32_t new_id = folded_inst->result_id(); + uint32_t old_id = inst->result_id(); + context()->ReplaceAllUsesWith(old_id, new_id); + context()->KillDef(old_id); + return true; +} + +uint32_t FoldSpecConstantOpAndCompositePass::GetTypeComponent( + uint32_t typeId, uint32_t element) const { + ir::Instruction* type = context()->get_def_use_mgr()->GetDef(typeId); + uint32_t subtype = type->GetTypeComponent(element); + assert(subtype != 0); + + return subtype; +} + +ir::Instruction* FoldSpecConstantOpAndCompositePass::DoCompositeExtract( + ir::Module::inst_iterator* pos) { + ir::Instruction* inst = &**pos; + assert(inst->NumInOperands() - 1 >= 2 && + "OpSpecConstantOp CompositeExtract requires at least two non-type " + "non-opcode operands."); + assert(inst->GetInOperand(1).type == SPV_OPERAND_TYPE_ID && + "The composite operand must have a SPV_OPERAND_TYPE_ID type"); + assert( + inst->GetInOperand(2).type == SPV_OPERAND_TYPE_LITERAL_INTEGER && + "The literal operand must have a SPV_OPERAND_TYPE_LITERAL_INTEGER type"); + + // Note that for OpSpecConstantOp, the second in-operand is the first id + // operand. The first in-operand is the spec opcode. + uint32_t source = inst->GetSingleWordInOperand(1); + uint32_t type = context()->get_def_use_mgr()->GetDef(source)->type_id(); + const analysis::Constant* first_operand_const = + context()->get_constant_mgr()->FindDeclaredConstant(source); + if (!first_operand_const) return nullptr; + + const analysis::Constant* current_const = first_operand_const; + for (uint32_t i = 2; i < inst->NumInOperands(); i++) { + uint32_t literal = inst->GetSingleWordInOperand(i); + type = GetTypeComponent(type, literal); + } + for (uint32_t i = 2; i < inst->NumInOperands(); i++) { + uint32_t literal = inst->GetSingleWordInOperand(i); + if (const analysis::CompositeConstant* composite_const = + current_const->AsCompositeConstant()) { + // Case 1: current constant is a non-null composite type constant. + assert(literal < composite_const->GetComponents().size() && + "Literal index out of bound of the composite constant"); + current_const = composite_const->GetComponents().at(literal); + } else if (current_const->AsNullConstant()) { + // Case 2: current constant is a constant created with OpConstantNull. + // Because components of a NullConstant are always NullConstants, we can + // return early with a NullConstant in the result type. + return context()->get_constant_mgr()->BuildInstructionAndAddToModule( + context()->get_constant_mgr()->GetConstant( + context()->get_constant_mgr()->GetType(inst), {}), + pos, type); + } else { + // Dereferencing a non-composite constant. Invalid case. + return nullptr; + } + } + return context()->get_constant_mgr()->BuildInstructionAndAddToModule( + current_const, pos); +} + +ir::Instruction* FoldSpecConstantOpAndCompositePass::DoVectorShuffle( + ir::Module::inst_iterator* pos) { + ir::Instruction* inst = &**pos; + analysis::Vector* result_vec_type = + context()->get_constant_mgr()->GetType(inst)->AsVector(); + assert(inst->NumInOperands() - 1 > 2 && + "OpSpecConstantOp DoVectorShuffle instruction requires more than 2 " + "operands (2 vector ids and at least one literal operand"); + assert(result_vec_type && + "The result of VectorShuffle must be of type vector"); + + // A temporary null constants that can be used as the components of the result + // vector. This is needed when any one of the vector operands are null + // constant. + const analysis::Constant* null_component_constants = nullptr; + + // Get a concatenated vector of scalar constants. The vector should be built + // with the components from the first and the second operand of VectorShuffle. + std::vector concatenated_components; + // Note that for OpSpecConstantOp, the second in-operand is the first id + // operand. The first in-operand is the spec opcode. + for (uint32_t i : {1, 2}) { + assert(inst->GetInOperand(i).type == SPV_OPERAND_TYPE_ID && + "The vector operand must have a SPV_OPERAND_TYPE_ID type"); + uint32_t operand_id = inst->GetSingleWordInOperand(i); + auto operand_const = + context()->get_constant_mgr()->FindDeclaredConstant(operand_id); + if (!operand_const) return nullptr; + const analysis::Type* operand_type = operand_const->type(); + assert(operand_type->AsVector() && + "The first two operand of VectorShuffle must be of vector type"); + if (auto vec_const = operand_const->AsVectorConstant()) { + // case 1: current operand is a non-null vector constant. + concatenated_components.insert(concatenated_components.end(), + vec_const->GetComponents().begin(), + vec_const->GetComponents().end()); + } else if (operand_const->AsNullConstant()) { + // case 2: current operand is a null vector constant. Create a temporary + // null scalar constant as the component. + if (!null_component_constants) { + const analysis::Type* component_type = + operand_type->AsVector()->element_type(); + null_component_constants = + context()->get_constant_mgr()->GetConstant(component_type, {}); + } + // Append the null scalar consts to the concatenated components + // vector. + concatenated_components.insert(concatenated_components.end(), + operand_type->AsVector()->element_count(), + null_component_constants); + } else { + // no other valid cases + return nullptr; + } + } + // Create null component constants if there are any. The component constants + // must be added to the module before the dependee composite constants to + // satisfy SSA def-use dominance. + if (null_component_constants) { + context()->get_constant_mgr()->BuildInstructionAndAddToModule( + null_component_constants, pos); + } + // Create the new vector constant with the selected components. + std::vector selected_components; + for (uint32_t i = 3; i < inst->NumInOperands(); i++) { + assert(inst->GetInOperand(i).type == SPV_OPERAND_TYPE_LITERAL_INTEGER && + "The literal operand must of type SPV_OPERAND_TYPE_LITERAL_INTEGER"); + uint32_t literal = inst->GetSingleWordInOperand(i); + assert(literal < concatenated_components.size() && + "Literal index out of bound of the concatenated vector"); + selected_components.push_back(concatenated_components[literal]); + } + auto new_vec_const = + new analysis::VectorConstant(result_vec_type, selected_components); + auto reg_vec_const = + context()->get_constant_mgr()->RegisterConstant(new_vec_const); + if (reg_vec_const != new_vec_const) delete new_vec_const; + return context()->get_constant_mgr()->BuildInstructionAndAddToModule( + reg_vec_const, pos); +} + +namespace { +// A helper function to check the type for component wise operations. Returns +// true if the type: +// 1) is bool type; +// 2) is 32-bit int type; +// 3) is vector of bool type; +// 4) is vector of 32-bit integer type. +// Otherwise returns false. +bool IsValidTypeForComponentWiseOperation(const analysis::Type* type) { + if (type->AsBool()) { + return true; + } else if (auto* it = type->AsInteger()) { + if (it->width() == 32) return true; + } else if (auto* vt = type->AsVector()) { + if (vt->element_type()->AsBool()) + return true; + else if (auto* vit = vt->element_type()->AsInteger()) { + if (vit->width() == 32) return true; + } + } + return false; +} +} // namespace + +ir::Instruction* FoldSpecConstantOpAndCompositePass::DoComponentWiseOperation( + ir::Module::inst_iterator* pos) { + const ir::Instruction* inst = &**pos; + const analysis::Type* result_type = + context()->get_constant_mgr()->GetType(inst); + SpvOp spec_opcode = static_cast(inst->GetSingleWordInOperand(0)); + // Check and collect operands. + std::vector operands; + + if (!std::all_of( + inst->cbegin(), inst->cend(), + [&operands, this](const ir::Operand& o) { + // skip the operands that is not an id. + if (o.type != spv_operand_type_t::SPV_OPERAND_TYPE_ID) return true; + uint32_t id = o.words.front(); + if (auto c = + context()->get_constant_mgr()->FindDeclaredConstant(id)) { + if (IsValidTypeForComponentWiseOperation(c->type())) { + operands.push_back(c); + return true; + } + } + return false; + })) + return nullptr; + + if (result_type->AsInteger() || result_type->AsBool()) { + // Scalar operation + uint32_t result_val = FoldScalars(spec_opcode, operands); + auto result_const = + context()->get_constant_mgr()->GetConstant(result_type, {result_val}); + return context()->get_constant_mgr()->BuildInstructionAndAddToModule( + result_const, pos); + } else if (result_type->AsVector()) { + // Vector operation + const analysis::Type* element_type = + result_type->AsVector()->element_type(); + uint32_t num_dims = result_type->AsVector()->element_count(); + std::vector result_vec = + FoldVectors(spec_opcode, num_dims, operands); + std::vector result_vector_components; + for (uint32_t r : result_vec) { + if (auto rc = + context()->get_constant_mgr()->GetConstant(element_type, {r})) { + result_vector_components.push_back(rc); + if (!context()->get_constant_mgr()->BuildInstructionAndAddToModule( + rc, pos)) { + assert(false && + "Failed to build and insert constant declaring instruction " + "for the given vector component constant"); + } + } else { + assert(false && "Failed to create constants with 32-bit word"); + } + } + auto new_vec_const = new analysis::VectorConstant(result_type->AsVector(), + result_vector_components); + auto reg_vec_const = + context()->get_constant_mgr()->RegisterConstant(new_vec_const); + if (reg_vec_const != new_vec_const) delete new_vec_const; + return context()->get_constant_mgr()->BuildInstructionAndAddToModule( + reg_vec_const, pos); + } else { + // Cannot process invalid component wise operation. The result of component + // wise operation must be of integer or bool scalar or vector of + // integer/bool type. + return nullptr; + } +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,92 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_FOLD_SPEC_CONSTANT_OP_AND_COMPOSITE_PASS_H_ +#define LIBSPIRV_OPT_FOLD_SPEC_CONSTANT_OP_AND_COMPOSITE_PASS_H_ + +#include +#include +#include + +#include "constants.h" +#include "def_use_manager.h" +#include "ir_context.h" +#include "module.h" +#include "pass.h" +#include "type_manager.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class FoldSpecConstantOpAndCompositePass : public Pass { + public: + FoldSpecConstantOpAndCompositePass() = default; + + const char* name() const override { return "fold-spec-const-op-composite"; } + + Status Process(ir::IRContext* irContext) override; + + private: + // Initializes the type manager, def-use manager and get the maximal id used + // in the module. + void Initialize(ir::IRContext* irContext); + + // The real entry of processing. Iterates through the types-constants-globals + // section of the given module, finds the Spec Constants defined with + // OpSpecConstantOp and OpSpecConstantComposite instructions. If the result + // value of those spec constants can be folded, fold them to their + // corresponding normal constants. + Status ProcessImpl(ir::IRContext* irContext); + + // Processes the OpSpecConstantOp instruction pointed by the given + // instruction iterator, folds it to normal constants if possible. Returns + // true if the spec constant is folded to normal constants. New instructions + // will be inserted before the OpSpecConstantOp instruction pointed by the + // instruction iterator. The instruction iterator, which is passed by + // pointer, will still point to the original OpSpecConstantOp instruction. If + // folding is done successfully, the original OpSpecConstantOp instruction + // will be changed to Nop and new folded instruction will be inserted before + // it. + bool ProcessOpSpecConstantOp(ir::Module::inst_iterator* pos); + + // Try to fold the OpSpecConstantOp CompositeExtract instruction pointed by + // the given instruction iterator to a normal constant defining instruction. + // Returns the pointer to the new constant defining instruction if succeeded. + // Otherwise returns nullptr. + ir::Instruction* DoCompositeExtract(ir::Module::inst_iterator* inst_iter_ptr); + + // Try to fold the OpSpecConstantOp VectorShuffle instruction pointed by the + // given instruction iterator to a normal constant defining instruction. + // Returns the pointer to the new constant defining instruction if succeeded. + // Otherwise return nullptr. + ir::Instruction* DoVectorShuffle(ir::Module::inst_iterator* inst_iter_ptr); + + // Try to fold the OpSpecConstantOp instruction + // pointed by the given instruction iterator to a normal constant defining + // instruction. Returns the pointer to the new constant defining instruction + // if succeeded, otherwise return nullptr. + ir::Instruction* DoComponentWiseOperation( + ir::Module::inst_iterator* inst_iter_ptr); + + // Returns the |element|'th subtype of |type|. + // + // |type| must be a composite type. + uint32_t GetTypeComponent(uint32_t type, uint32_t element) const; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_FOLD_SPEC_CONSTANT_OP_AND_COMPOSITE_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/freeze_spec_constant_value_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/freeze_spec_constant_value_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/freeze_spec_constant_value_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/freeze_spec_constant_value_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,53 @@ +// Copyright (c) 2016 Google 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. + +#include "freeze_spec_constant_value_pass.h" +#include "ir_context.h" + +namespace spvtools { +namespace opt { + +Pass::Status FreezeSpecConstantValuePass::Process(ir::IRContext* irContext) { + bool modified = false; + irContext->module()->ForEachInst( + [&modified, irContext](ir::Instruction* inst) { + switch (inst->opcode()) { + case SpvOp::SpvOpSpecConstant: + inst->SetOpcode(SpvOp::SpvOpConstant); + modified = true; + break; + case SpvOp::SpvOpSpecConstantTrue: + inst->SetOpcode(SpvOp::SpvOpConstantTrue); + modified = true; + break; + case SpvOp::SpvOpSpecConstantFalse: + inst->SetOpcode(SpvOp::SpvOpConstantFalse); + modified = true; + break; + case SpvOp::SpvOpDecorate: + if (inst->GetSingleWordInOperand(1) == + SpvDecoration::SpvDecorationSpecId) { + irContext->KillInst(inst); + modified = true; + } + break; + default: + break; + } + }); + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/freeze_spec_constant_value_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/freeze_spec_constant_value_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/freeze_spec_constant_value_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/freeze_spec_constant_value_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,35 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_FREEZE_SPEC_CONSTANT_VALUE_PASS_H_ +#define LIBSPIRV_OPT_FREEZE_SPEC_CONSTANT_VALUE_PASS_H_ + +#include "ir_context.h" +#include "module.h" +#include "pass.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class FreezeSpecConstantValuePass : public Pass { + public: + const char* name() const override { return "freeze-spec-const"; } + Status Process(ir::IRContext*) override; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_FREEZE_SPEC_CONSTANT_VALUE_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/function.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/function.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/function.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/function.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,109 @@ +// Copyright (c) 2016 Google 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. + +#include "function.h" + +#include +#include + +namespace spvtools { +namespace ir { + +Function* Function::Clone(IRContext* ctx) const { + Function* clone = + new Function(std::unique_ptr(DefInst().Clone(ctx))); + clone->params_.reserve(params_.size()); + ForEachParam( + [clone, ctx](const Instruction* inst) { + clone->AddParameter(std::unique_ptr(inst->Clone(ctx))); + }, + true); + + clone->blocks_.reserve(blocks_.size()); + for (const auto& b : blocks_) { + std::unique_ptr bb(b->Clone(ctx)); + bb->SetParent(clone); + clone->AddBasicBlock(std::move(bb)); + } + + clone->SetFunctionEnd(std::unique_ptr(EndInst()->Clone(ctx))); + return clone; +} + +void Function::ForEachInst(const std::function& f, + bool run_on_debug_line_insts) { + if (def_inst_) def_inst_->ForEachInst(f, run_on_debug_line_insts); + for (auto& param : params_) param->ForEachInst(f, run_on_debug_line_insts); + for (auto& bb : blocks_) bb->ForEachInst(f, run_on_debug_line_insts); + if (end_inst_) end_inst_->ForEachInst(f, run_on_debug_line_insts); +} + +void Function::ForEachInst(const std::function& f, + bool run_on_debug_line_insts) const { + if (def_inst_) + static_cast(def_inst_.get()) + ->ForEachInst(f, run_on_debug_line_insts); + + for (const auto& param : params_) + static_cast(param.get()) + ->ForEachInst(f, run_on_debug_line_insts); + + for (const auto& bb : blocks_) + static_cast(bb.get())->ForEachInst( + f, run_on_debug_line_insts); + + if (end_inst_) + static_cast(end_inst_.get()) + ->ForEachInst(f, run_on_debug_line_insts); +} + +void Function::ForEachParam(const std::function& f, + bool run_on_debug_line_insts) const { + for (const auto& param : params_) + static_cast(param.get()) + ->ForEachInst(f, run_on_debug_line_insts); +} + +BasicBlock* Function::InsertBasicBlockAfter( + std::unique_ptr&& new_block, BasicBlock* position) { + for (auto bb_iter = begin(); bb_iter != end(); ++bb_iter) { + if (&*bb_iter == position) { + new_block->SetParent(this); + ++bb_iter; + bb_iter = bb_iter.InsertBefore(std::move(new_block)); + return &*bb_iter; + } + } + assert(false && "Could not find insertion point."); + return nullptr; +} + +std::ostream& operator<<(std::ostream& str, const Function& func) { + str << func.PrettyPrint(); + return str; +} + +std::string Function::PrettyPrint(uint32_t options) const { + std::ostringstream str; + ForEachInst([&str, options](const ir::Instruction* inst) { + str << inst->PrettyPrint(options); + if (inst->opcode() != SpvOpFunctionEnd) { + str << std::endl; + } + }); + return str.str(); +} + +} // namespace ir +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/function.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/function.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/function.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/function.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,172 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_CONSTRUCTS_H_ +#define LIBSPIRV_OPT_CONSTRUCTS_H_ + +#include +#include +#include +#include +#include + +#include "basic_block.h" +#include "instruction.h" +#include "iterator.h" + +namespace spvtools { +namespace ir { + +class CFG; +class IRContext; +class Module; + +// A SPIR-V function. +class Function { + public: + using iterator = UptrVectorIterator; + using const_iterator = UptrVectorIterator; + + // Creates a function instance declared by the given OpFunction instruction + // |def_inst|. + inline explicit Function(std::unique_ptr def_inst); + + explicit Function(const Function& f) = delete; + + // Creates a clone of the instruction in the given |context| + // + // The parent module will default to null and needs to be explicitly set by + // the user. + Function* Clone(IRContext*) const; + // The OpFunction instruction that begins the definition of this function. + Instruction& DefInst() { return *def_inst_; } + const Instruction& DefInst() const { return *def_inst_; } + + // Sets the enclosing module for this function. + void SetParent(Module* module) { module_ = module; } + // Gets the enclosing module for this function + Module* GetParent() const { return module_; } + // Appends a parameter to this function. + inline void AddParameter(std::unique_ptr p); + // Appends a basic block to this function. + inline void AddBasicBlock(std::unique_ptr b); + // Appends a basic block to this function at the position |ip|. + inline void AddBasicBlock(std::unique_ptr b, iterator ip); + template + inline void AddBasicBlocks(T begin, T end, iterator ip); + + // Saves the given function end instruction. + inline void SetFunctionEnd(std::unique_ptr end_inst); + + // Returns the given function end instruction. + inline Instruction* EndInst() { return end_inst_.get(); } + inline const Instruction* EndInst() const { return end_inst_.get(); } + + // Returns function's id + inline uint32_t result_id() const { return def_inst_->result_id(); } + + // Returns function's return type id + inline uint32_t type_id() const { return def_inst_->type_id(); } + + // Returns the entry basic block for this function. + const std::unique_ptr& entry() const { return blocks_.front(); } + + iterator begin() { return iterator(&blocks_, blocks_.begin()); } + iterator end() { return iterator(&blocks_, blocks_.end()); } + const_iterator begin() const { return cbegin(); } + const_iterator end() const { return cend(); } + const_iterator cbegin() const { + return const_iterator(&blocks_, blocks_.cbegin()); + } + const_iterator cend() const { + return const_iterator(&blocks_, blocks_.cend()); + } + + // Returns an iterator to the basic block |id|. + iterator FindBlock(uint32_t bb_id) { + return std::find_if(begin(), end(), [bb_id](const ir::BasicBlock& it_bb) { + return bb_id == it_bb.id(); + }); + } + + // Runs the given function |f| on each instruction in this function, and + // optionally on debug line instructions that might precede them. + void ForEachInst(const std::function& f, + bool run_on_debug_line_insts = false); + void ForEachInst(const std::function& f, + bool run_on_debug_line_insts = false) const; + + // Runs the given function |f| on each parameter instruction in this function, + // and optionally on debug line instructions that might precede them. + void ForEachParam(const std::function& f, + bool run_on_debug_line_insts = false) const; + + // Returns the context of the current function. + IRContext* context() const { return def_inst_->context(); } + + BasicBlock* InsertBasicBlockAfter(std::unique_ptr&& new_block, + BasicBlock* position); + + // Pretty-prints all the basic blocks in this function into a std::string. + // + // |options| are the disassembly options. SPV_BINARY_TO_TEXT_OPTION_NO_HEADER + // is always added to |options|. + std::string PrettyPrint(uint32_t options = 0u) const; + + private: + // The enclosing module. + Module* module_; + // The OpFunction instruction that begins the definition of this function. + std::unique_ptr def_inst_; + // All parameters to this function. + std::vector> params_; + // All basic blocks inside this function in specification order + std::vector> blocks_; + // The OpFunctionEnd instruction. + std::unique_ptr end_inst_; +}; + +// Pretty-prints |func| to |str|. Returns |str|. +std::ostream& operator<<(std::ostream& str, const Function& func); + +inline Function::Function(std::unique_ptr def_inst) + : module_(nullptr), def_inst_(std::move(def_inst)), end_inst_() {} + +inline void Function::AddParameter(std::unique_ptr p) { + params_.emplace_back(std::move(p)); +} + +inline void Function::AddBasicBlock(std::unique_ptr b) { + AddBasicBlock(std::move(b), end()); +} + +inline void Function::AddBasicBlock(std::unique_ptr b, + iterator ip) { + ip.InsertBefore(std::move(b)); +} + +template +inline void Function::AddBasicBlocks(T src_begin, T src_end, iterator ip) { + blocks_.insert(ip.Get(), std::make_move_iterator(src_begin), + std::make_move_iterator(src_end)); +} + +inline void Function::SetFunctionEnd(std::unique_ptr end_inst) { + end_inst_ = std::move(end_inst); +} + +} // namespace ir +} // namespace spvtools + +#endif // LIBSPIRV_OPT_CONSTRUCTS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/if_conversion.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/if_conversion.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/if_conversion.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/if_conversion.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,188 @@ +// Copyright (c) 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "if_conversion.h" + +namespace spvtools { +namespace opt { + +Pass::Status IfConversion::Process(ir::IRContext* c) { + InitializeProcessing(c); + + bool modified = false; + std::vector to_kill; + for (auto& func : *get_module()) { + DominatorAnalysis* dominators = + context()->GetDominatorAnalysis(&func, *cfg()); + for (auto& block : func) { + // Check if it is possible for |block| to have phis that can be + // transformed. + ir::BasicBlock* common = nullptr; + if (!CheckBlock(&block, dominators, &common)) continue; + + // Get an insertion point. + auto iter = block.begin(); + while (iter != block.end() && iter->opcode() == SpvOpPhi) { + ++iter; + } + + InstructionBuilder builder( + context(), &*iter, + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping); + block.ForEachPhiInst([this, &builder, &modified, &common, &to_kill, + dominators, &block](ir::Instruction* phi) { + // This phi is not compatible, but subsequent phis might be. + if (!CheckType(phi->type_id())) return; + + // We cannot transform cases where the phi is used by another phi in the + // same block due to instruction ordering restrictions. + // TODO(alan-baker): If all inappropriate uses could also be + // transformed, we could still remove this phi. + if (!CheckPhiUsers(phi, &block)) return; + + // Identify the incoming values associated with the true and false + // branches. If |then_block| dominates |inc0| or if the true edge + // branches straight to this block and |common| is |inc0|, then |inc0| + // is on the true branch. Otherwise the |inc1| is on the true branch. + ir::BasicBlock* inc0 = GetIncomingBlock(phi, 0u); + ir::Instruction* branch = common->terminator(); + uint32_t condition = branch->GetSingleWordInOperand(0u); + ir::BasicBlock* then_block = + GetBlock(branch->GetSingleWordInOperand(1u)); + ir::Instruction* true_value = nullptr; + ir::Instruction* false_value = nullptr; + if ((then_block == &block && inc0 == common) || + dominators->Dominates(then_block, inc0)) { + true_value = GetIncomingValue(phi, 0u); + false_value = GetIncomingValue(phi, 1u); + } else { + true_value = GetIncomingValue(phi, 1u); + false_value = GetIncomingValue(phi, 0u); + } + + // If either incoming value is defined in a block that does not dominate + // this phi, then we cannot eliminate the phi with a select. + // TODO(alan-baker): Perform code motion where it makes sense to enable + // the transform in this case. + ir::BasicBlock* true_def_block = context()->get_instr_block(true_value); + if (true_def_block && !dominators->Dominates(true_def_block, &block)) + return; + + ir::BasicBlock* false_def_block = + context()->get_instr_block(false_value); + if (false_def_block && !dominators->Dominates(false_def_block, &block)) + return; + + analysis::Type* data_ty = + context()->get_type_mgr()->GetType(true_value->type_id()); + if (analysis::Vector* vec_data_ty = data_ty->AsVector()) { + condition = SplatCondition(vec_data_ty, condition, &builder); + } + + ir::Instruction* select = builder.AddSelect(phi->type_id(), condition, + true_value->result_id(), + false_value->result_id()); + context()->ReplaceAllUsesWith(phi->result_id(), select->result_id()); + to_kill.push_back(phi); + modified = true; + + return; + }); + } + } + + for (auto inst : to_kill) { + context()->KillInst(inst); + } + + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +bool IfConversion::CheckBlock(ir::BasicBlock* block, + DominatorAnalysis* dominators, + ir::BasicBlock** common) { + const std::vector& preds = cfg()->preds(block->id()); + + // TODO(alan-baker): Extend to more than two predecessors + if (preds.size() != 2) return false; + + ir::BasicBlock* inc0 = context()->get_instr_block(preds[0]); + if (dominators->Dominates(block, inc0)) return false; + + ir::BasicBlock* inc1 = context()->get_instr_block(preds[1]); + if (dominators->Dominates(block, inc1)) return false; + + // All phis will have the same common dominator, so cache the result + // for this block. If there is no common dominator, then we cannot transform + // any phi in this basic block. + *common = dominators->CommonDominator(inc0, inc1); + if (!*common || cfg()->IsPseudoEntryBlock(*common)) return false; + ir::Instruction* branch = (*common)->terminator(); + if (branch->opcode() != SpvOpBranchConditional) return false; + + return true; +} + +bool IfConversion::CheckPhiUsers(ir::Instruction* phi, ir::BasicBlock* block) { + return get_def_use_mgr()->WhileEachUser(phi, [block, + this](ir::Instruction* user) { + if (user->opcode() == SpvOpPhi && context()->get_instr_block(user) == block) + return false; + return true; + }); +} + +uint32_t IfConversion::SplatCondition(analysis::Vector* vec_data_ty, + uint32_t cond, + InstructionBuilder* builder) { + // If the data inputs to OpSelect are vectors, the condition for + // OpSelect must be a boolean vector with the same number of + // components. So splat the condition for the branch into a vector + // type. + analysis::Bool bool_ty; + analysis::Vector bool_vec_ty(&bool_ty, vec_data_ty->element_count()); + uint32_t bool_vec_id = + context()->get_type_mgr()->GetTypeInstruction(&bool_vec_ty); + std::vector ids(vec_data_ty->element_count(), cond); + return builder->AddCompositeConstruct(bool_vec_id, ids)->result_id(); +} + +bool IfConversion::CheckType(uint32_t id) { + ir::Instruction* type = get_def_use_mgr()->GetDef(id); + SpvOp op = type->opcode(); + if (spvOpcodeIsScalarType(op) || op == SpvOpTypePointer || + op == SpvOpTypeVector) + return true; + return false; +} + +ir::BasicBlock* IfConversion::GetBlock(uint32_t id) { + return context()->get_instr_block(get_def_use_mgr()->GetDef(id)); +} + +ir::BasicBlock* IfConversion::GetIncomingBlock(ir::Instruction* phi, + uint32_t predecessor) { + uint32_t in_index = 2 * predecessor + 1; + return GetBlock(phi->GetSingleWordInOperand(in_index)); +} + +ir::Instruction* IfConversion::GetIncomingValue(ir::Instruction* phi, + uint32_t predecessor) { + uint32_t in_index = 2 * predecessor; + return get_def_use_mgr()->GetDef(phi->GetSingleWordInOperand(in_index)); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/if_conversion.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/if_conversion.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/if_conversion.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/if_conversion.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,76 @@ +// Copyright (c) 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_IF_CONVERSION_H_ +#define LIBSPIRV_OPT_IF_CONVERSION_H_ + +#include "basic_block.h" +#include "ir_builder.h" +#include "pass.h" +#include "types.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class IfConversion : public Pass { + public: + const char* name() const override { return "if-conversion"; } + Status Process(ir::IRContext* context) override; + + ir::IRContext::Analysis GetPreservedAnalyses() override { + return ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisDominatorAnalysis | + ir::IRContext::kAnalysisInstrToBlockMapping | + ir::IRContext::kAnalysisCFG | ir::IRContext::kAnalysisNameMap; + } + + private: + // Returns true if |id| is a valid type for use with OpSelect. OpSelect only + // allows scalars, vectors and pointers as valid inputs. + bool CheckType(uint32_t id); + + // Returns the basic block containing |id|. + ir::BasicBlock* GetBlock(uint32_t id); + + // Returns the basic block for the |predecessor|'th index predecessor of + // |phi|. + ir::BasicBlock* GetIncomingBlock(ir::Instruction* phi, uint32_t predecessor); + + // Returns the instruction defining the |predecessor|'th index of |phi|. + ir::Instruction* GetIncomingValue(ir::Instruction* phi, uint32_t predecessor); + + // Returns the id of a OpCompositeConstruct boolean vector. The composite has + // the same number of elements as |vec_data_ty| and each member is |cond|. + // |where| indicates the location in |block| to insert the composite + // construct. If necessary, this function will also construct the necessary + // type instructions for the boolean vector. + uint32_t SplatCondition(analysis::Vector* vec_data_ty, uint32_t cond, + InstructionBuilder* builder); + + // Returns true if none of |phi|'s users are in |block|. + bool CheckPhiUsers(ir::Instruction* phi, ir::BasicBlock* block); + + // Returns |false| if |block| is not appropriate to transform. Only + // transforms blocks with two predecessors. Neither incoming block can be + // dominated by |block|. Both predecessors must share a common dominator that + // is terminated by a conditional branch. + bool CheckBlock(ir::BasicBlock* block, DominatorAnalysis* dominators, + ir::BasicBlock** common); +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_IF_CONVERSION_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/inline_exhaustive_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/inline_exhaustive_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/inline_exhaustive_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/inline_exhaustive_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,81 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "inline_exhaustive_pass.h" + +namespace spvtools { +namespace opt { + +bool InlineExhaustivePass::InlineExhaustive(ir::Function* func) { + bool modified = false; + // Using block iterators here because of block erasures and insertions. + for (auto bi = func->begin(); bi != func->end(); ++bi) { + for (auto ii = bi->begin(); ii != bi->end();) { + if (IsInlinableFunctionCall(&*ii)) { + // Inline call. + std::vector> newBlocks; + std::vector> newVars; + GenInlineCode(&newBlocks, &newVars, ii, bi); + // If call block is replaced with more than one block, point + // succeeding phis at new last block. + if (newBlocks.size() > 1) UpdateSucceedingPhis(newBlocks); + // Replace old calling block with new block(s). + + // We need to kill the name and decorations for the call, which + // will be deleted. Other instructions in the block will be moved to + // newBlocks. We don't need to do anything with those. + context()->KillNamesAndDecorates(&*ii); + + bi = bi.Erase(); + + for (auto& bb : newBlocks) { + bb->SetParent(func); + } + bi = bi.InsertBefore(&newBlocks); + // Insert new function variables. + if (newVars.size() > 0) + func->begin()->begin().InsertBefore(std::move(newVars)); + // Restart inlining at beginning of calling block. + ii = bi->begin(); + modified = true; + } else { + ++ii; + } + } + } + return modified; +} + +void InlineExhaustivePass::Initialize(ir::IRContext* c) { InitializeInline(c); } + +Pass::Status InlineExhaustivePass::ProcessImpl() { + // Attempt exhaustive inlining on each entry point function in module + ProcessFunction pfn = [this](ir::Function* fp) { + return InlineExhaustive(fp); + }; + bool modified = ProcessEntryPointCallTree(pfn, get_module()); + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +InlineExhaustivePass::InlineExhaustivePass() {} + +Pass::Status InlineExhaustivePass::Process(ir::IRContext* c) { + Initialize(c); + return ProcessImpl(); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/inline_exhaustive_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/inline_exhaustive_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/inline_exhaustive_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/inline_exhaustive_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,53 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#ifndef LIBSPIRV_OPT_INLINE_EXHAUSTIVE_PASS_H_ +#define LIBSPIRV_OPT_INLINE_EXHAUSTIVE_PASS_H_ + +#include +#include +#include +#include +#include + +#include "def_use_manager.h" +#include "inline_pass.h" +#include "module.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class InlineExhaustivePass : public InlinePass { + public: + InlineExhaustivePass(); + Status Process(ir::IRContext* c) override; + + const char* name() const override { return "inline-entry-points-exhaustive"; } + + private: + // Exhaustively inline all function calls in func as well as in + // all code that is inlined into func. Return true if func is modified. + bool InlineExhaustive(ir::Function* func); + + void Initialize(ir::IRContext* c); + Pass::Status ProcessImpl(); +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_INLINE_EXHAUSTIVE_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/inline_opaque_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/inline_opaque_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/inline_opaque_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/inline_opaque_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,112 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "inline_opaque_pass.h" + +namespace spvtools { +namespace opt { + +namespace { + +const uint32_t kTypePointerTypeIdInIdx = 1; + +} // anonymous namespace + +bool InlineOpaquePass::IsOpaqueType(uint32_t typeId) { + const ir::Instruction* typeInst = get_def_use_mgr()->GetDef(typeId); + switch (typeInst->opcode()) { + case SpvOpTypeSampler: + case SpvOpTypeImage: + case SpvOpTypeSampledImage: + return true; + case SpvOpTypePointer: + return IsOpaqueType( + typeInst->GetSingleWordInOperand(kTypePointerTypeIdInIdx)); + default: + break; + } + // TODO(greg-lunarg): Handle arrays containing opaque type + if (typeInst->opcode() != SpvOpTypeStruct) return false; + // Return true if any member is opaque + return !typeInst->WhileEachInId([this](const uint32_t* tid) { + if (IsOpaqueType(*tid)) return false; + return true; + }); +} + +bool InlineOpaquePass::HasOpaqueArgsOrReturn(const ir::Instruction* callInst) { + // Check return type + if (IsOpaqueType(callInst->type_id())) return true; + // Check args + int icnt = 0; + return !callInst->WhileEachInId([&icnt, this](const uint32_t* iid) { + if (icnt > 0) { + const ir::Instruction* argInst = get_def_use_mgr()->GetDef(*iid); + if (IsOpaqueType(argInst->type_id())) return false; + } + ++icnt; + return true; + }); +} + +bool InlineOpaquePass::InlineOpaque(ir::Function* func) { + bool modified = false; + // Using block iterators here because of block erasures and insertions. + for (auto bi = func->begin(); bi != func->end(); ++bi) { + for (auto ii = bi->begin(); ii != bi->end();) { + if (IsInlinableFunctionCall(&*ii) && HasOpaqueArgsOrReturn(&*ii)) { + // Inline call. + std::vector> newBlocks; + std::vector> newVars; + GenInlineCode(&newBlocks, &newVars, ii, bi); + // If call block is replaced with more than one block, point + // succeeding phis at new last block. + if (newBlocks.size() > 1) UpdateSucceedingPhis(newBlocks); + // Replace old calling block with new block(s). + bi = bi.Erase(); + bi = bi.InsertBefore(&newBlocks); + // Insert new function variables. + if (newVars.size() > 0) + func->begin()->begin().InsertBefore(std::move(newVars)); + // Restart inlining at beginning of calling block. + ii = bi->begin(); + modified = true; + } else { + ++ii; + } + } + } + return modified; +} + +void InlineOpaquePass::Initialize(ir::IRContext* c) { InitializeInline(c); } + +Pass::Status InlineOpaquePass::ProcessImpl() { + // Do opaque inlining on each function in entry point call tree + ProcessFunction pfn = [this](ir::Function* fp) { return InlineOpaque(fp); }; + bool modified = ProcessEntryPointCallTree(pfn, get_module()); + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +InlineOpaquePass::InlineOpaquePass() {} + +Pass::Status InlineOpaquePass::Process(ir::IRContext* c) { + Initialize(c); + return ProcessImpl(); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/inline_opaque_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/inline_opaque_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/inline_opaque_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/inline_opaque_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,60 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#ifndef LIBSPIRV_OPT_INLINE_OPAQUE_PASS_H_ +#define LIBSPIRV_OPT_INLINE_OPAQUE_PASS_H_ + +#include +#include +#include +#include +#include + +#include "def_use_manager.h" +#include "inline_pass.h" +#include "module.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class InlineOpaquePass : public InlinePass { + public: + InlineOpaquePass(); + Status Process(ir::IRContext* c) override; + + const char* name() const override { return "inline-entry-points-opaque"; } + + private: + // Return true if |typeId| is or contains opaque type + bool IsOpaqueType(uint32_t typeId); + + // Return true if function call |callInst| has opaque argument or return type + bool HasOpaqueArgsOrReturn(const ir::Instruction* callInst); + + // Inline all function calls in |func| that have opaque params or return + // type. Inline similarly all code that is inlined into func. Return true + // if func is modified. + bool InlineOpaque(ir::Function* func); + + void Initialize(ir::IRContext* c); + Pass::Status ProcessImpl(); +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_INLINE_OPAQUE_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/inline_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/inline_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/inline_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/inline_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,676 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "inline_pass.h" + +#include "cfa.h" + +// Indices of operands in SPIR-V instructions + +static const int kSpvFunctionCallFunctionId = 2; +static const int kSpvFunctionCallArgumentId = 3; +static const int kSpvReturnValueId = 0; +static const int kSpvLoopMergeMergeBlockId = 0; +static const int kSpvLoopMergeContinueTargetIdInIdx = 1; + +namespace spvtools { +namespace opt { + +uint32_t InlinePass::AddPointerToType(uint32_t type_id, + SpvStorageClass storage_class) { + uint32_t resultId = TakeNextId(); + std::unique_ptr type_inst(new ir::Instruction( + context(), SpvOpTypePointer, 0, resultId, + {{spv_operand_type_t::SPV_OPERAND_TYPE_STORAGE_CLASS, + {uint32_t(storage_class)}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {type_id}}})); + context()->AddType(std::move(type_inst)); + analysis::Type* pointeeTy; + std::unique_ptr pointerTy; + std::tie(pointeeTy, pointerTy) = + context()->get_type_mgr()->GetTypeAndPointerType(type_id, + SpvStorageClassFunction); + context()->get_type_mgr()->RegisterType(resultId, *pointerTy); + return resultId; +} + +void InlinePass::AddBranch(uint32_t label_id, + std::unique_ptr* block_ptr) { + std::unique_ptr newBranch(new ir::Instruction( + context(), SpvOpBranch, 0, 0, + {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {label_id}}})); + (*block_ptr)->AddInstruction(std::move(newBranch)); +} + +void InlinePass::AddBranchCond(uint32_t cond_id, uint32_t true_id, + uint32_t false_id, + std::unique_ptr* block_ptr) { + std::unique_ptr newBranch(new ir::Instruction( + context(), SpvOpBranchConditional, 0, 0, + {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {cond_id}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {true_id}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {false_id}}})); + (*block_ptr)->AddInstruction(std::move(newBranch)); +} + +void InlinePass::AddLoopMerge(uint32_t merge_id, uint32_t continue_id, + std::unique_ptr* block_ptr) { + std::unique_ptr newLoopMerge(new ir::Instruction( + context(), SpvOpLoopMerge, 0, 0, + {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {merge_id}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {continue_id}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_LOOP_CONTROL, {0}}})); + (*block_ptr)->AddInstruction(std::move(newLoopMerge)); +} + +void InlinePass::AddStore(uint32_t ptr_id, uint32_t val_id, + std::unique_ptr* block_ptr) { + std::unique_ptr newStore(new ir::Instruction( + context(), SpvOpStore, 0, 0, + {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {ptr_id}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {val_id}}})); + (*block_ptr)->AddInstruction(std::move(newStore)); +} + +void InlinePass::AddLoad(uint32_t type_id, uint32_t resultId, uint32_t ptr_id, + std::unique_ptr* block_ptr) { + std::unique_ptr newLoad(new ir::Instruction( + context(), SpvOpLoad, type_id, resultId, + {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {ptr_id}}})); + (*block_ptr)->AddInstruction(std::move(newLoad)); +} + +std::unique_ptr InlinePass::NewLabel(uint32_t label_id) { + std::unique_ptr newLabel( + new ir::Instruction(context(), SpvOpLabel, 0, label_id, {})); + return newLabel; +} + +uint32_t InlinePass::GetFalseId() { + if (false_id_ != 0) return false_id_; + false_id_ = get_module()->GetGlobalValue(SpvOpConstantFalse); + if (false_id_ != 0) return false_id_; + uint32_t boolId = get_module()->GetGlobalValue(SpvOpTypeBool); + if (boolId == 0) { + boolId = TakeNextId(); + get_module()->AddGlobalValue(SpvOpTypeBool, boolId, 0); + } + false_id_ = TakeNextId(); + get_module()->AddGlobalValue(SpvOpConstantFalse, false_id_, boolId); + return false_id_; +} + +void InlinePass::MapParams( + ir::Function* calleeFn, ir::BasicBlock::iterator call_inst_itr, + std::unordered_map* callee2caller) { + int param_idx = 0; + calleeFn->ForEachParam( + [&call_inst_itr, ¶m_idx, &callee2caller](const ir::Instruction* cpi) { + const uint32_t pid = cpi->result_id(); + (*callee2caller)[pid] = call_inst_itr->GetSingleWordOperand( + kSpvFunctionCallArgumentId + param_idx); + ++param_idx; + }); +} + +void InlinePass::CloneAndMapLocals( + ir::Function* calleeFn, + std::vector>* new_vars, + std::unordered_map* callee2caller) { + auto callee_block_itr = calleeFn->begin(); + auto callee_var_itr = callee_block_itr->begin(); + while (callee_var_itr->opcode() == SpvOp::SpvOpVariable) { + std::unique_ptr var_inst( + callee_var_itr->Clone(callee_var_itr->context())); + uint32_t newId = TakeNextId(); + get_decoration_mgr()->CloneDecorations(callee_var_itr->result_id(), newId); + var_inst->SetResultId(newId); + (*callee2caller)[callee_var_itr->result_id()] = newId; + new_vars->push_back(std::move(var_inst)); + ++callee_var_itr; + } +} + +uint32_t InlinePass::CreateReturnVar( + ir::Function* calleeFn, + std::vector>* new_vars) { + uint32_t returnVarId = 0; + const uint32_t calleeTypeId = calleeFn->type_id(); + analysis::Type* calleeType = context()->get_type_mgr()->GetType(calleeTypeId); + if (calleeType->AsVoid() == nullptr) { + // Find or create ptr to callee return type. + uint32_t returnVarTypeId = context()->get_type_mgr()->FindPointerToType( + calleeTypeId, SpvStorageClassFunction); + if (returnVarTypeId == 0) + returnVarTypeId = AddPointerToType(calleeTypeId, SpvStorageClassFunction); + // Add return var to new function scope variables. + returnVarId = TakeNextId(); + std::unique_ptr var_inst(new ir::Instruction( + context(), SpvOpVariable, returnVarTypeId, returnVarId, + {{spv_operand_type_t::SPV_OPERAND_TYPE_STORAGE_CLASS, + {SpvStorageClassFunction}}})); + new_vars->push_back(std::move(var_inst)); + } + get_decoration_mgr()->CloneDecorations(calleeFn->result_id(), returnVarId); + return returnVarId; +} + +bool InlinePass::IsSameBlockOp(const ir::Instruction* inst) const { + return inst->opcode() == SpvOpSampledImage || inst->opcode() == SpvOpImage; +} + +void InlinePass::CloneSameBlockOps( + std::unique_ptr* inst, + std::unordered_map* postCallSB, + std::unordered_map* preCallSB, + std::unique_ptr* block_ptr) { + (*inst)->ForEachInId( + [&postCallSB, &preCallSB, &block_ptr, this](uint32_t* iid) { + const auto mapItr = (*postCallSB).find(*iid); + if (mapItr == (*postCallSB).end()) { + const auto mapItr2 = (*preCallSB).find(*iid); + if (mapItr2 != (*preCallSB).end()) { + // Clone pre-call same-block ops, map result id. + const ir::Instruction* inInst = mapItr2->second; + std::unique_ptr sb_inst( + inInst->Clone(inInst->context())); + CloneSameBlockOps(&sb_inst, postCallSB, preCallSB, block_ptr); + const uint32_t rid = sb_inst->result_id(); + const uint32_t nid = this->TakeNextId(); + get_decoration_mgr()->CloneDecorations(rid, nid); + sb_inst->SetResultId(nid); + (*postCallSB)[rid] = nid; + *iid = nid; + (*block_ptr)->AddInstruction(std::move(sb_inst)); + } + } else { + // Reset same-block op operand. + *iid = mapItr->second; + } + }); +} + +void InlinePass::GenInlineCode( + std::vector>* new_blocks, + std::vector>* new_vars, + ir::BasicBlock::iterator call_inst_itr, + ir::UptrVectorIterator call_block_itr) { + // Map from all ids in the callee to their equivalent id in the caller + // as callee instructions are copied into caller. + std::unordered_map callee2caller; + // Pre-call same-block insts + std::unordered_map preCallSB; + // Post-call same-block op ids + std::unordered_map postCallSB; + + // Invalidate the def-use chains. They are not kept up to date while + // inlining. However, certain calls try to keep them up-to-date if they are + // valid. These operations can fail. + context()->InvalidateAnalyses(ir::IRContext::kAnalysisDefUse); + + ir::Function* calleeFn = id2function_[call_inst_itr->GetSingleWordOperand( + kSpvFunctionCallFunctionId)]; + + // Check for multiple returns in the callee. + auto fi = multi_return_funcs_.find(calleeFn->result_id()); + const bool multiReturn = fi != multi_return_funcs_.end(); + + // Map parameters to actual arguments. + MapParams(calleeFn, call_inst_itr, &callee2caller); + + // Define caller local variables for all callee variables and create map to + // them. + CloneAndMapLocals(calleeFn, new_vars, &callee2caller); + + // Create return var if needed. + uint32_t returnVarId = CreateReturnVar(calleeFn, new_vars); + + // Create set of callee result ids. Used to detect forward references + std::unordered_set callee_result_ids; + calleeFn->ForEachInst([&callee_result_ids](const ir::Instruction* cpi) { + const uint32_t rid = cpi->result_id(); + if (rid != 0) callee_result_ids.insert(rid); + }); + + // If the caller is in a single-block loop, and the callee has multiple + // blocks, then the normal inlining logic will place the OpLoopMerge in + // the last of several blocks in the loop. Instead, it should be placed + // at the end of the first block. First determine if the caller is in a + // single block loop. We'll wait to move the OpLoopMerge until the end + // of the regular inlining logic, and only if necessary. + bool caller_is_single_block_loop = false; + bool caller_is_loop_header = false; + if (auto* loop_merge = call_block_itr->GetLoopMergeInst()) { + caller_is_loop_header = true; + caller_is_single_block_loop = + call_block_itr->id() == + loop_merge->GetSingleWordInOperand(kSpvLoopMergeContinueTargetIdInIdx); + } + + bool callee_begins_with_structured_header = + (*(calleeFn->begin())).GetMergeInst() != nullptr; + + // Clone and map callee code. Copy caller block code to beginning of + // first block and end of last block. + bool prevInstWasReturn = false; + uint32_t singleTripLoopHeaderId = 0; + uint32_t singleTripLoopContinueId = 0; + uint32_t returnLabelId = 0; + bool multiBlocks = false; + const uint32_t calleeTypeId = calleeFn->type_id(); + // new_blk_ptr is a new basic block in the caller. New instructions are + // written to it. It is created when we encounter the OpLabel + // of the first callee block. It is appended to new_blocks only when + // it is complete. + std::unique_ptr new_blk_ptr; + calleeFn->ForEachInst([&new_blocks, &callee2caller, &call_block_itr, + &call_inst_itr, &new_blk_ptr, &prevInstWasReturn, + &returnLabelId, &returnVarId, caller_is_loop_header, + callee_begins_with_structured_header, &calleeTypeId, + &multiBlocks, &postCallSB, &preCallSB, multiReturn, + &singleTripLoopHeaderId, &singleTripLoopContinueId, + &callee_result_ids, this](const ir::Instruction* cpi) { + switch (cpi->opcode()) { + case SpvOpFunction: + case SpvOpFunctionParameter: + case SpvOpVariable: + // Already processed + break; + case SpvOpLabel: { + // If previous instruction was early return, insert branch + // instruction to return block. + if (prevInstWasReturn) { + if (returnLabelId == 0) returnLabelId = this->TakeNextId(); + AddBranch(returnLabelId, &new_blk_ptr); + prevInstWasReturn = false; + } + // Finish current block (if it exists) and get label for next block. + uint32_t labelId; + bool firstBlock = false; + if (new_blk_ptr != nullptr) { + new_blocks->push_back(std::move(new_blk_ptr)); + // If result id is already mapped, use it, otherwise get a new + // one. + const uint32_t rid = cpi->result_id(); + const auto mapItr = callee2caller.find(rid); + labelId = (mapItr != callee2caller.end()) ? mapItr->second + : this->TakeNextId(); + } else { + // First block needs to use label of original block + // but map callee label in case of phi reference. + labelId = call_block_itr->id(); + callee2caller[cpi->result_id()] = labelId; + firstBlock = true; + } + // Create first/next block. + new_blk_ptr.reset(new ir::BasicBlock(NewLabel(labelId))); + if (firstBlock) { + // Copy contents of original caller block up to call instruction. + for (auto cii = call_block_itr->begin(); cii != call_inst_itr; + cii = call_block_itr->begin()) { + ir::Instruction* inst = &*cii; + inst->RemoveFromList(); + std::unique_ptr cp_inst(inst); + // Remember same-block ops for possible regeneration. + if (IsSameBlockOp(&*cp_inst)) { + auto* sb_inst_ptr = cp_inst.get(); + preCallSB[cp_inst->result_id()] = sb_inst_ptr; + } + new_blk_ptr->AddInstruction(std::move(cp_inst)); + } + if (caller_is_loop_header && callee_begins_with_structured_header) { + // We can't place both the caller's merge instruction and another + // merge instruction in the same block. So split the calling block. + // Insert an unconditional branch to a new guard block. Later, + // once we know the ID of the last block, we will move the caller's + // OpLoopMerge from the last generated block into the first block. + // We also wait to avoid invalidating various iterators. + const auto guard_block_id = this->TakeNextId(); + AddBranch(guard_block_id, &new_blk_ptr); + new_blocks->push_back(std::move(new_blk_ptr)); + // Start the next block. + new_blk_ptr.reset(new ir::BasicBlock(NewLabel(guard_block_id))); + // Reset the mapping of the callee's entry block to point to + // the guard block. Do this so we can fix up phis later on to + // satisfy dominance. + callee2caller[cpi->result_id()] = guard_block_id; + } + // If callee has multiple returns, insert a header block for + // single-trip loop that will encompass callee code. Start postheader + // block. + // + // Note: Consider the following combination: + // - the caller is a single block loop + // - the callee does not begin with a structure header + // - the callee has multiple returns. + // We still need to split the caller block and insert a guard block. + // But we only need to do it once. We haven't done it yet, but the + // single-trip loop header will serve the same purpose. + if (multiReturn) { + singleTripLoopHeaderId = this->TakeNextId(); + AddBranch(singleTripLoopHeaderId, &new_blk_ptr); + new_blocks->push_back(std::move(new_blk_ptr)); + new_blk_ptr.reset( + new ir::BasicBlock(NewLabel(singleTripLoopHeaderId))); + returnLabelId = this->TakeNextId(); + singleTripLoopContinueId = this->TakeNextId(); + AddLoopMerge(returnLabelId, singleTripLoopContinueId, &new_blk_ptr); + uint32_t postHeaderId = this->TakeNextId(); + AddBranch(postHeaderId, &new_blk_ptr); + new_blocks->push_back(std::move(new_blk_ptr)); + new_blk_ptr.reset(new ir::BasicBlock(NewLabel(postHeaderId))); + multiBlocks = true; + // Reset the mapping of the callee's entry block to point to + // the post-header block. Do this so we can fix up phis later + // on to satisfy dominance. + callee2caller[cpi->result_id()] = postHeaderId; + } + } else { + multiBlocks = true; + } + } break; + case SpvOpReturnValue: { + // Store return value to return variable. + assert(returnVarId != 0); + uint32_t valId = cpi->GetInOperand(kSpvReturnValueId).words[0]; + const auto mapItr = callee2caller.find(valId); + if (mapItr != callee2caller.end()) { + valId = mapItr->second; + } + AddStore(returnVarId, valId, &new_blk_ptr); + + // Remember we saw a return; if followed by a label, will need to + // insert branch. + prevInstWasReturn = true; + } break; + case SpvOpReturn: { + // Remember we saw a return; if followed by a label, will need to + // insert branch. + prevInstWasReturn = true; + } break; + case SpvOpFunctionEnd: { + // If there was an early return, we generated a return label id + // for it. Now we have to generate the return block with that Id. + if (returnLabelId != 0) { + // If previous instruction was return, insert branch instruction + // to return block. + if (prevInstWasReturn) AddBranch(returnLabelId, &new_blk_ptr); + if (multiReturn) { + // If we generated a loop header to for the single-trip loop + // to accommodate multiple returns, insert the continue + // target block now, with a false branch back to the loop header. + new_blocks->push_back(std::move(new_blk_ptr)); + new_blk_ptr.reset( + new ir::BasicBlock(NewLabel(singleTripLoopContinueId))); + AddBranchCond(GetFalseId(), singleTripLoopHeaderId, returnLabelId, + &new_blk_ptr); + } + // Generate the return block. + new_blocks->push_back(std::move(new_blk_ptr)); + new_blk_ptr.reset(new ir::BasicBlock(NewLabel(returnLabelId))); + multiBlocks = true; + } + // Load return value into result id of call, if it exists. + if (returnVarId != 0) { + const uint32_t resId = call_inst_itr->result_id(); + assert(resId != 0); + AddLoad(calleeTypeId, resId, returnVarId, &new_blk_ptr); + } + // Copy remaining instructions from caller block. + for (ir::Instruction* inst = call_inst_itr->NextNode(); inst; + inst = call_inst_itr->NextNode()) { + inst->RemoveFromList(); + std::unique_ptr cp_inst(inst); + // If multiple blocks generated, regenerate any same-block + // instruction that has not been seen in this last block. + if (multiBlocks) { + CloneSameBlockOps(&cp_inst, &postCallSB, &preCallSB, &new_blk_ptr); + // Remember same-block ops in this block. + if (IsSameBlockOp(&*cp_inst)) { + const uint32_t rid = cp_inst->result_id(); + postCallSB[rid] = rid; + } + } + new_blk_ptr->AddInstruction(std::move(cp_inst)); + } + // Finalize inline code. + new_blocks->push_back(std::move(new_blk_ptr)); + } break; + default: { + // Copy callee instruction and remap all input Ids. + std::unique_ptr cp_inst(cpi->Clone(context())); + cp_inst->ForEachInId([&callee2caller, &callee_result_ids, + this](uint32_t* iid) { + const auto mapItr = callee2caller.find(*iid); + if (mapItr != callee2caller.end()) { + *iid = mapItr->second; + } else if (callee_result_ids.find(*iid) != callee_result_ids.end()) { + // Forward reference. Allocate a new id, map it, + // use it and check for it when remapping result ids + const uint32_t nid = this->TakeNextId(); + callee2caller[*iid] = nid; + *iid = nid; + } + }); + // If result id is non-zero, remap it. If already mapped, use mapped + // value, else use next id. + const uint32_t rid = cp_inst->result_id(); + if (rid != 0) { + const auto mapItr = callee2caller.find(rid); + uint32_t nid; + if (mapItr != callee2caller.end()) { + nid = mapItr->second; + } else { + nid = this->TakeNextId(); + callee2caller[rid] = nid; + } + cp_inst->SetResultId(nid); + get_decoration_mgr()->CloneDecorations(rid, nid); + } + new_blk_ptr->AddInstruction(std::move(cp_inst)); + } break; + } + }); + + if (caller_is_loop_header && (new_blocks->size() > 1)) { + // Move the OpLoopMerge from the last block back to the first, where + // it belongs. + auto& first = new_blocks->front(); + auto& last = new_blocks->back(); + assert(first != last); + + // Insert a modified copy of the loop merge into the first block. + auto loop_merge_itr = last->tail(); + --loop_merge_itr; + assert(loop_merge_itr->opcode() == SpvOpLoopMerge); + std::unique_ptr cp_inst(loop_merge_itr->Clone(context())); + if (caller_is_single_block_loop) { + // Also, update its continue target to point to the last block. + cp_inst->SetInOperand(kSpvLoopMergeContinueTargetIdInIdx, {last->id()}); + } + first->tail().InsertBefore(std::move(cp_inst)); + + // Remove the loop merge from the last block. + loop_merge_itr->RemoveFromList(); + delete &*loop_merge_itr; + } + + // Update block map given replacement blocks. + for (auto& blk : *new_blocks) { + id2block_[blk->id()] = &*blk; + } +} + +bool InlinePass::IsInlinableFunctionCall(const ir::Instruction* inst) { + if (inst->opcode() != SpvOp::SpvOpFunctionCall) return false; + const uint32_t calleeFnId = + inst->GetSingleWordOperand(kSpvFunctionCallFunctionId); + const auto ci = inlinable_.find(calleeFnId); + return ci != inlinable_.cend(); +} + +void InlinePass::UpdateSucceedingPhis( + std::vector>& new_blocks) { + const auto firstBlk = new_blocks.begin(); + const auto lastBlk = new_blocks.end() - 1; + const uint32_t firstId = (*firstBlk)->id(); + const uint32_t lastId = (*lastBlk)->id(); + const ir::BasicBlock& const_last_block = *lastBlk->get(); + const_last_block.ForEachSuccessorLabel( + [&firstId, &lastId, this](const uint32_t succ) { + ir::BasicBlock* sbp = this->id2block_[succ]; + sbp->ForEachPhiInst([&firstId, &lastId](ir::Instruction* phi) { + phi->ForEachInId([&firstId, &lastId](uint32_t* id) { + if (*id == firstId) *id = lastId; + }); + }); + }); +} + +bool InlinePass::HasMultipleReturns(ir::Function* func) { + bool seenReturn = false; + bool multipleReturns = false; + for (auto& blk : *func) { + auto terminal_ii = blk.cend(); + --terminal_ii; + if (terminal_ii->opcode() == SpvOpReturn || + terminal_ii->opcode() == SpvOpReturnValue) { + if (seenReturn) { + multipleReturns = true; + break; + } + seenReturn = true; + } + } + return multipleReturns; +} + +void InlinePass::ComputeStructuredSuccessors(ir::Function* func) { + // If header, make merge block first successor. + for (auto& blk : *func) { + uint32_t mbid = blk.MergeBlockIdIfAny(); + if (mbid != 0) { + block2structured_succs_[&blk].push_back(id2block_[mbid]); + } + + // Add true successors. + const auto& const_blk = blk; + const_blk.ForEachSuccessorLabel([&blk, this](const uint32_t sbid) { + block2structured_succs_[&blk].push_back(id2block_[sbid]); + }); + } +} + +InlinePass::GetBlocksFunction InlinePass::StructuredSuccessorsFunction() { + return [this](const ir::BasicBlock* block) { + return &(block2structured_succs_[block]); + }; +} + +bool InlinePass::HasNoReturnInLoop(ir::Function* func) { + // If control not structured, do not do loop/return analysis + // TODO: Analyze returns in non-structured control flow + if (!context()->get_feature_mgr()->HasCapability(SpvCapabilityShader)) + return false; + // Compute structured block order. This order has the property + // that dominators are before all blocks they dominate and merge blocks + // are after all blocks that are in the control constructs of their header. + ComputeStructuredSuccessors(func); + auto ignore_block = [](cbb_ptr) {}; + auto ignore_edge = [](cbb_ptr, cbb_ptr) {}; + std::list structuredOrder; + spvtools::CFA::DepthFirstTraversal( + &*func->begin(), StructuredSuccessorsFunction(), ignore_block, + [&](cbb_ptr b) { structuredOrder.push_front(b); }, ignore_edge); + // Search for returns in loops. Only need to track outermost loop + bool return_in_loop = false; + uint32_t outerLoopMergeId = 0; + for (auto& blk : structuredOrder) { + // Exiting current outer loop + if (blk->id() == outerLoopMergeId) outerLoopMergeId = 0; + // Return block + auto terminal_ii = blk->cend(); + --terminal_ii; + if (terminal_ii->opcode() == SpvOpReturn || + terminal_ii->opcode() == SpvOpReturnValue) { + if (outerLoopMergeId != 0) { + return_in_loop = true; + break; + } + } else if (terminal_ii != blk->cbegin()) { + auto merge_ii = terminal_ii; + --merge_ii; + // Entering outermost loop + if (merge_ii->opcode() == SpvOpLoopMerge && outerLoopMergeId == 0) + outerLoopMergeId = + merge_ii->GetSingleWordOperand(kSpvLoopMergeMergeBlockId); + } + } + return !return_in_loop; +} + +void InlinePass::AnalyzeReturns(ir::Function* func) { + // Look for multiple returns + if (!HasMultipleReturns(func)) { + no_return_in_loop_.insert(func->result_id()); + return; + } + multi_return_funcs_.insert(func->result_id()); + // If multiple returns, see if any are in a loop + if (HasNoReturnInLoop(func)) no_return_in_loop_.insert(func->result_id()); +} + +bool InlinePass::IsInlinableFunction(ir::Function* func) { + // We can only inline a function if it has blocks. + if (func->cbegin() == func->cend()) return false; + // Do not inline functions with returns in loops. Currently early return + // functions are inlined by wrapping them in a one trip loop and implementing + // the returns as a branch to the loop's merge block. However, this can only + // done validly if the return was not in a loop in the original function. + // Also remember functions with multiple (early) returns. + AnalyzeReturns(func); + return no_return_in_loop_.find(func->result_id()) != + no_return_in_loop_.cend(); +} + +void InlinePass::InitializeInline(ir::IRContext* c) { + InitializeProcessing(c); + + false_id_ = 0; + + // clear collections + id2function_.clear(); + id2block_.clear(); + block2structured_succs_.clear(); + inlinable_.clear(); + no_return_in_loop_.clear(); + multi_return_funcs_.clear(); + + for (auto& fn : *get_module()) { + // Initialize function and block maps. + id2function_[fn.result_id()] = &fn; + for (auto& blk : fn) { + id2block_[blk.id()] = &blk; + } + // Compute inlinability + if (IsInlinableFunction(&fn)) inlinable_.insert(fn.result_id()); + } +} + +InlinePass::InlinePass() {} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/inline_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/inline_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/inline_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/inline_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,191 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#ifndef LIBSPIRV_OPT_INLINE_PASS_H_ +#define LIBSPIRV_OPT_INLINE_PASS_H_ + +#include +#include +#include +#include +#include + +#include "decoration_manager.h" +#include "module.h" +#include "pass.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class InlinePass : public Pass { + using cbb_ptr = const ir::BasicBlock*; + + public: + using GetBlocksFunction = + std::function*(const ir::BasicBlock*)>; + + InlinePass(); + virtual ~InlinePass() = default; + + protected: + + // Add pointer to type to module and return resultId. + uint32_t AddPointerToType(uint32_t type_id, SpvStorageClass storage_class); + + // Add unconditional branch to labelId to end of block block_ptr. + void AddBranch(uint32_t labelId, std::unique_ptr* block_ptr); + + // Add conditional branch to end of block |block_ptr|. + void AddBranchCond(uint32_t cond_id, uint32_t true_id, uint32_t false_id, + std::unique_ptr* block_ptr); + + // Add unconditional branch to labelId to end of block block_ptr. + void AddLoopMerge(uint32_t merge_id, uint32_t continue_id, + std::unique_ptr* block_ptr); + + // Add store of valId to ptrId to end of block block_ptr. + void AddStore(uint32_t ptrId, uint32_t valId, + std::unique_ptr* block_ptr); + + // Add load of ptrId into resultId to end of block block_ptr. + void AddLoad(uint32_t typeId, uint32_t resultId, uint32_t ptrId, + std::unique_ptr* block_ptr); + + // Return new label. + std::unique_ptr NewLabel(uint32_t label_id); + + // Returns the id for the boolean false value. Looks in the module first + // and creates it if not found. Remembers it for future calls. + uint32_t GetFalseId(); + + // Map callee params to caller args + void MapParams(ir::Function* calleeFn, ir::BasicBlock::iterator call_inst_itr, + std::unordered_map* callee2caller); + + // Clone and map callee locals + void CloneAndMapLocals( + ir::Function* calleeFn, + std::vector>* new_vars, + std::unordered_map* callee2caller); + + // Create return variable for callee clone code if needed. Return id + // if created, otherwise 0. + uint32_t CreateReturnVar( + ir::Function* calleeFn, + std::vector>* new_vars); + + // Return true if instruction must be in the same block that its result + // is used. + bool IsSameBlockOp(const ir::Instruction* inst) const; + + // Clone operands which must be in same block as consumer instructions. + // Look in preCallSB for instructions that need cloning. Look in + // postCallSB for instructions already cloned. Add cloned instruction + // to postCallSB. + void CloneSameBlockOps( + std::unique_ptr* inst, + std::unordered_map* postCallSB, + std::unordered_map* preCallSB, + std::unique_ptr* block_ptr); + + // Return in new_blocks the result of inlining the call at call_inst_itr + // within its block at call_block_itr. The block at call_block_itr can + // just be replaced with the blocks in new_blocks. Any additional branches + // are avoided. Debug instructions are cloned along with their callee + // instructions. Early returns are replaced by a store to a local return + // variable and a branch to a (created) exit block where the local variable + // is returned. Formal parameters are trivially mapped to their actual + // parameters. Note that the first block in new_blocks retains the label + // of the original calling block. Also note that if an exit block is + // created, it is the last block of new_blocks. + // + // Also return in new_vars additional OpVariable instructions required by + // and to be inserted into the caller function after the block at + // call_block_itr is replaced with new_blocks. + void GenInlineCode(std::vector>* new_blocks, + std::vector>* new_vars, + ir::BasicBlock::iterator call_inst_itr, + ir::UptrVectorIterator call_block_itr); + + // Return true if |inst| is a function call that can be inlined. + bool IsInlinableFunctionCall(const ir::Instruction* inst); + + // Compute structured successors for function |func|. + // A block's structured successors are the blocks it branches to + // together with its declared merge block if it has one. + // When order matters, the merge block always appears first. + // This assures correct depth first search in the presence of early + // returns and kills. If the successor vector contain duplicates + // if the merge block, they are safely ignored by DFS. + void ComputeStructuredSuccessors(ir::Function* func); + + // Return function to return ordered structure successors for a given block + // Assumes ComputeStructuredSuccessors() has been called. + GetBlocksFunction StructuredSuccessorsFunction(); + + // Return true if |func| has multiple returns + bool HasMultipleReturns(ir::Function* func); + + // Return true if |func| has no return in a loop. The current analysis + // requires structured control flow, so return false if control flow not + // structured ie. module is not a shader. + bool HasNoReturnInLoop(ir::Function* func); + + // Find all functions with multiple returns and no returns in loops + void AnalyzeReturns(ir::Function* func); + + // Return true if |func| is a function that can be inlined. + bool IsInlinableFunction(ir::Function* func); + + // Update phis in succeeding blocks to point to new last block + void UpdateSucceedingPhis( + std::vector>& new_blocks); + + // Initialize state for optimization of |module| + void InitializeInline(ir::IRContext* c); + + // Map from function's result id to function. + std::unordered_map id2function_; + + // Map from block's label id to block. TODO(dnovillo): This is superfluous wrt + // opt::CFG. It has functionality not present in opt::CFG. Consolidate. + std::unordered_map id2block_; + + // Set of ids of functions with multiple returns. + std::set multi_return_funcs_; + + // Set of ids of functions with no returns in loop + std::set no_return_in_loop_; + + // Set of ids of inlinable functions + std::set inlinable_; + + // result id for OpConstantFalse + uint32_t false_id_; + + // Map from block to its structured successor blocks. See + // ComputeStructuredSuccessors() for definition. TODO(dnovillo): This is + // superfluous wrt opt::CFG, but it seems to be computed in a slightly + // different way in the inliner. Can these be consolidated? + std::unordered_map> + block2structured_succs_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_INLINE_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/insert_extract_elim.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/insert_extract_elim.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/insert_extract_elim.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/insert_extract_elim.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,221 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "insert_extract_elim.h" + +#include "composite.h" +#include "ir_context.h" +#include "iterator.h" +#include "latest_version_glsl_std_450_header.h" + +#include + +namespace spvtools { +namespace opt { + +namespace { + +const uint32_t kConstantValueInIdx = 0; +const uint32_t kExtractCompositeIdInIdx = 0; +const uint32_t kInsertObjectIdInIdx = 0; +const uint32_t kInsertCompositeIdInIdx = 1; +const uint32_t kVectorShuffleVec1IdInIdx = 0; +const uint32_t kVectorShuffleVec2IdInIdx = 1; +const uint32_t kVectorShuffleCompsInIdx = 2; +const uint32_t kTypeVectorCompTypeIdInIdx = 0; +const uint32_t kTypeVectorLengthInIdx = 1; +const uint32_t kTypeFloatWidthInIdx = 0; +const uint32_t kExtInstSetIdInIdx = 0; +const uint32_t kExtInstInstructionInIdx = 1; +const uint32_t kFMixXIdInIdx = 2; +const uint32_t kFMixYIdInIdx = 3; +const uint32_t kFMixAIdInIdx = 4; + +} // anonymous namespace + +uint32_t InsertExtractElimPass::DoExtract(ir::Instruction* compInst, + std::vector* pExtIndices, + uint32_t extOffset) { + ir::Instruction* cinst = compInst; + uint32_t cid = 0; + uint32_t replId = 0; + while (true) { + if (cinst->opcode() == SpvOpCompositeInsert) { + if (ExtInsMatch(*pExtIndices, cinst, extOffset)) { + // Match! Use inserted value as replacement + replId = cinst->GetSingleWordInOperand(kInsertObjectIdInIdx); + break; + } else if (ExtInsConflict(*pExtIndices, cinst, extOffset)) { + // If extract has fewer indices than the insert, stop searching. + // Otherwise increment offset of extract indices considered and + // continue searching through the inserted value + if (pExtIndices->size() - extOffset < cinst->NumInOperands() - 2) { + break; + } else { + extOffset += cinst->NumInOperands() - 2; + cid = cinst->GetSingleWordInOperand(kInsertObjectIdInIdx); + } + } else { + // Consider next composite in insert chain + cid = cinst->GetSingleWordInOperand(kInsertCompositeIdInIdx); + } + } else if (cinst->opcode() == SpvOpVectorShuffle) { + // Get length of vector1 + uint32_t v1_id = cinst->GetSingleWordInOperand(kVectorShuffleVec1IdInIdx); + ir::Instruction* v1_inst = get_def_use_mgr()->GetDef(v1_id); + uint32_t v1_type_id = v1_inst->type_id(); + ir::Instruction* v1_type_inst = get_def_use_mgr()->GetDef(v1_type_id); + uint32_t v1_len = + v1_type_inst->GetSingleWordInOperand(kTypeVectorLengthInIdx); + // Get shuffle idx + uint32_t comp_idx = (*pExtIndices)[extOffset]; + uint32_t shuffle_idx = + cinst->GetSingleWordInOperand(kVectorShuffleCompsInIdx + comp_idx); + // If undefined, give up + // TODO(greg-lunarg): Return OpUndef + if (shuffle_idx == 0xFFFFFFFF) break; + if (shuffle_idx < v1_len) { + cid = v1_id; + (*pExtIndices)[extOffset] = shuffle_idx; + } else { + cid = cinst->GetSingleWordInOperand(kVectorShuffleVec2IdInIdx); + (*pExtIndices)[extOffset] = shuffle_idx - v1_len; + } + } else if (cinst->opcode() == SpvOpExtInst && + cinst->GetSingleWordInOperand(kExtInstSetIdInIdx) == + get_feature_mgr()->GetExtInstImportId_GLSLstd450() && + cinst->GetSingleWordInOperand(kExtInstInstructionInIdx) == + GLSLstd450FMix) { + // If mixing value component is 0 or 1 we just match with x or y. + // Otherwise give up. + uint32_t comp_idx = (*pExtIndices)[extOffset]; + std::vector aIndices = {comp_idx}; + uint32_t a_id = cinst->GetSingleWordInOperand(kFMixAIdInIdx); + ir::Instruction* a_inst = get_def_use_mgr()->GetDef(a_id); + uint32_t a_comp_id = DoExtract(a_inst, &aIndices, 0); + if (a_comp_id == 0) break; + ir::Instruction* a_comp_inst = get_def_use_mgr()->GetDef(a_comp_id); + if (a_comp_inst->opcode() != SpvOpConstant) break; + // If a value is not 32-bit, give up + uint32_t a_comp_type_id = a_comp_inst->type_id(); + ir::Instruction* a_comp_type = get_def_use_mgr()->GetDef(a_comp_type_id); + if (a_comp_type->GetSingleWordInOperand(kTypeFloatWidthInIdx) != 32) + break; + uint32_t u = a_comp_inst->GetSingleWordInOperand(kConstantValueInIdx); + float* fp = reinterpret_cast(&u); + if (*fp == 0.0) + cid = cinst->GetSingleWordInOperand(kFMixXIdInIdx); + else if (*fp == 1.0) + cid = cinst->GetSingleWordInOperand(kFMixYIdInIdx); + else + break; + } else { + break; + } + cinst = get_def_use_mgr()->GetDef(cid); + } + // If search ended with CompositeConstruct or ConstantComposite + // and the extract has one index, return the appropriate component. + // TODO(greg-lunarg): Handle multiple-indices, ConstantNull, special + // vector composition, and additional CompositeInsert. + if (replId == 0 && + (cinst->opcode() == SpvOpCompositeConstruct || + cinst->opcode() == SpvOpConstantComposite) && + (*pExtIndices).size() - extOffset == 1) { + uint32_t compIdx = (*pExtIndices)[extOffset]; + // If a vector CompositeConstruct we make sure all preceding + // components are of component type (not vector composition). + uint32_t ctype_id = cinst->type_id(); + ir::Instruction* ctype_inst = get_def_use_mgr()->GetDef(ctype_id); + if (ctype_inst->opcode() == SpvOpTypeVector && + cinst->opcode() == SpvOpConstantComposite) { + uint32_t vec_comp_type_id = + ctype_inst->GetSingleWordInOperand(kTypeVectorCompTypeIdInIdx); + if (compIdx < cinst->NumInOperands()) { + uint32_t i = 0; + for (; i <= compIdx; i++) { + uint32_t compId = cinst->GetSingleWordInOperand(i); + ir::Instruction* componentInst = get_def_use_mgr()->GetDef(compId); + if (componentInst->type_id() != vec_comp_type_id) break; + } + if (i > compIdx) replId = cinst->GetSingleWordInOperand(compIdx); + } + } else { + replId = cinst->GetSingleWordInOperand(compIdx); + } + } + return replId; +} + +bool InsertExtractElimPass::EliminateInsertExtract(ir::Function* func) { + bool modified = false; + for (auto bi = func->begin(); bi != func->end(); ++bi) { + ir::Instruction* inst = &*bi->begin(); + while (inst) { + switch (inst->opcode()) { + case SpvOpCompositeExtract: { + uint32_t cid = inst->GetSingleWordInOperand(kExtractCompositeIdInIdx); + ir::Instruction* cinst = get_def_use_mgr()->GetDef(cid); + // Capture extract indices + std::vector extIndices; + uint32_t icnt = 0; + inst->ForEachInOperand([&icnt, &extIndices](const uint32_t* idp) { + if (icnt > 0) extIndices.push_back(*idp); + ++icnt; + }); + // Offset of extract indices being compared to insert indices. + // Offset increases as indices are matched. + uint32_t replId = DoExtract(cinst, &extIndices, 0); + if (replId != 0) { + const uint32_t extId = inst->result_id(); + (void)context()->ReplaceAllUsesWith(extId, replId); + inst = context()->KillInst(inst); + modified = true; + } else { + inst = inst->NextNode(); + } + } break; + default: + inst = inst->NextNode(); + break; + } + } + } + return modified; +} + +void InsertExtractElimPass::Initialize(ir::IRContext* c) { + InitializeProcessing(c); +} + +Pass::Status InsertExtractElimPass::ProcessImpl() { + // Process all entry point functions. + ProcessFunction pfn = [this](ir::Function* fp) { + return EliminateInsertExtract(fp); + }; + bool modified = ProcessEntryPointCallTree(pfn, get_module()); + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +InsertExtractElimPass::InsertExtractElimPass() {} + +Pass::Status InsertExtractElimPass::Process(ir::IRContext* c) { + Initialize(c); + return ProcessImpl(); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/insert_extract_elim.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/insert_extract_elim.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/insert_extract_elim.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/insert_extract_elim.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#ifndef LIBSPIRV_OPT_INSERT_EXTRACT_ELIM_PASS_H_ +#define LIBSPIRV_OPT_INSERT_EXTRACT_ELIM_PASS_H_ + +#include +#include +#include +#include +#include + +#include "basic_block.h" +#include "def_use_manager.h" +#include "ir_context.h" +#include "mem_pass.h" +#include "module.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class InsertExtractElimPass : public MemPass { + public: + InsertExtractElimPass(); + const char* name() const override { return "eliminate-insert-extract"; } + Status Process(ir::IRContext*) override; + + private: + // Return id of component of |cinst| specified by |extIndices| starting with + // index at |extOffset|. Return 0 if indices cannot be matched exactly. + uint32_t DoExtract(ir::Instruction* cinst, std::vector* extIndices, + uint32_t extOffset); + + // Look for OpExtract on sequence of OpInserts in |func|. If there is a + // reaching insert which corresponds to the indices of the extract, replace + // the extract with the value that is inserted. Also resolve extracts from + // CompositeConstruct or ConstantComposite. + bool EliminateInsertExtract(ir::Function* func); + + void Initialize(ir::IRContext* c); + Pass::Status ProcessImpl(); +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_INSERT_EXTRACT_ELIM_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/instruction.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/instruction.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/instruction.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/instruction.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,600 @@ +// Copyright (c) 2016 Google 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. + +#include "instruction.h" + +#include + +#include "disassemble.h" +#include "fold.h" +#include "ir_context.h" +#include "reflect.h" + +namespace spvtools { +namespace ir { + +namespace { +// Indices used to get particular operands out of instructions using InOperand. +const uint32_t kTypeImageDimIndex = 1; +const uint32_t kLoadBaseIndex = 0; +const uint32_t kVariableStorageClassIndex = 0; +const uint32_t kTypeImageSampledIndex = 5; +} // namespace + +Instruction::Instruction(IRContext* c) + : utils::IntrusiveNodeBase(), + context_(c), + opcode_(SpvOpNop), + type_id_(0), + result_id_(0), + unique_id_(c->TakeNextUniqueId()) {} + +Instruction::Instruction(IRContext* c, SpvOp op) + : utils::IntrusiveNodeBase(), + context_(c), + opcode_(op), + type_id_(0), + result_id_(0), + unique_id_(c->TakeNextUniqueId()) {} + +Instruction::Instruction(IRContext* c, const spv_parsed_instruction_t& inst, + std::vector&& dbg_line) + : context_(c), + opcode_(static_cast(inst.opcode)), + type_id_(inst.type_id), + result_id_(inst.result_id), + unique_id_(c->TakeNextUniqueId()), + dbg_line_insts_(std::move(dbg_line)) { + assert((!IsDebugLineInst(opcode_) || dbg_line.empty()) && + "Op(No)Line attaching to Op(No)Line found"); + for (uint32_t i = 0; i < inst.num_operands; ++i) { + const auto& current_payload = inst.operands[i]; + std::vector words( + inst.words + current_payload.offset, + inst.words + current_payload.offset + current_payload.num_words); + operands_.emplace_back(current_payload.type, std::move(words)); + } +} + +Instruction::Instruction(IRContext* c, SpvOp op, uint32_t ty_id, + uint32_t res_id, + const std::vector& in_operands) + : utils::IntrusiveNodeBase(), + context_(c), + opcode_(op), + type_id_(ty_id), + result_id_(res_id), + unique_id_(c->TakeNextUniqueId()), + operands_() { + if (type_id_ != 0) { + operands_.emplace_back(spv_operand_type_t::SPV_OPERAND_TYPE_TYPE_ID, + std::initializer_list{type_id_}); + } + if (result_id_ != 0) { + operands_.emplace_back(spv_operand_type_t::SPV_OPERAND_TYPE_RESULT_ID, + std::initializer_list{result_id_}); + } + operands_.insert(operands_.end(), in_operands.begin(), in_operands.end()); +} + +Instruction::Instruction(Instruction&& that) + : utils::IntrusiveNodeBase(), + opcode_(that.opcode_), + type_id_(that.type_id_), + result_id_(that.result_id_), + unique_id_(that.unique_id_), + operands_(std::move(that.operands_)), + dbg_line_insts_(std::move(that.dbg_line_insts_)) {} + +Instruction& Instruction::operator=(Instruction&& that) { + opcode_ = that.opcode_; + type_id_ = that.type_id_; + result_id_ = that.result_id_; + unique_id_ = that.unique_id_; + operands_ = std::move(that.operands_); + dbg_line_insts_ = std::move(that.dbg_line_insts_); + return *this; +} + +Instruction* Instruction::Clone(IRContext* c) const { + Instruction* clone = new Instruction(c); + clone->opcode_ = opcode_; + clone->type_id_ = type_id_; + clone->result_id_ = result_id_; + clone->unique_id_ = c->TakeNextUniqueId(); + clone->operands_ = operands_; + clone->dbg_line_insts_ = dbg_line_insts_; + return clone; +} + +uint32_t Instruction::GetSingleWordOperand(uint32_t index) const { + const auto& words = GetOperand(index).words; + assert(words.size() == 1 && "expected the operand only taking one word"); + return words.front(); +} + +uint32_t Instruction::NumInOperandWords() const { + uint32_t size = 0; + for (uint32_t i = TypeResultIdCount(); i < operands_.size(); ++i) + size += static_cast(operands_[i].words.size()); + return size; +} + +void Instruction::ToBinaryWithoutAttachedDebugInsts( + std::vector* binary) const { + const uint32_t num_words = 1 + NumOperandWords(); + binary->push_back((num_words << 16) | static_cast(opcode_)); + for (const auto& operand : operands_) + binary->insert(binary->end(), operand.words.begin(), operand.words.end()); +} + +void Instruction::ReplaceOperands(const std::vector& new_operands) { + operands_.clear(); + operands_.insert(operands_.begin(), new_operands.begin(), new_operands.end()); + operands_.shrink_to_fit(); +} + +bool Instruction::IsReadOnlyLoad() const { + if (IsLoad()) { + ir::Instruction* address_def = GetBaseAddress(); + if (!address_def || address_def->opcode() != SpvOpVariable) { + return false; + } + return address_def->IsReadOnlyVariable(); + } + return false; +} + +Instruction* Instruction::GetBaseAddress() const { + assert((IsLoad() || opcode() == SpvOpStore || opcode() == SpvOpAccessChain || + opcode() == SpvOpInBoundsAccessChain || opcode() == SpvOpCopyObject || + opcode() == SpvOpImageTexelPointer) && + "GetBaseAddress should only be called on instructions that take a " + "pointer or image."); + uint32_t base = GetSingleWordInOperand(kLoadBaseIndex); + ir::Instruction* base_inst = context()->get_def_use_mgr()->GetDef(base); + bool done = false; + while (!done) { + switch (base_inst->opcode()) { + case SpvOpAccessChain: + case SpvOpInBoundsAccessChain: + case SpvOpPtrAccessChain: + case SpvOpInBoundsPtrAccessChain: + case SpvOpImageTexelPointer: + case SpvOpCopyObject: + // All of these instructions have the base pointer use a base pointer + // in in-operand 0. + base = base_inst->GetSingleWordInOperand(0); + base_inst = context()->get_def_use_mgr()->GetDef(base); + break; + default: + done = true; + break; + } + } + + switch (opcode()) { + case SpvOpLoad: + case SpvOpStore: + case SpvOpAccessChain: + case SpvOpInBoundsAccessChain: + case SpvOpCopyObject: + // A load or store through a pointer. + assert(base_inst->IsValidBasePointer() && + "We cannot have a base pointer come from this load"); + break; + default: + // A load or store of an image. + assert(base_inst->IsValidBaseImage() && "We are expecting an image."); + break; + } + return base_inst; +} + +bool Instruction::IsReadOnlyVariable() const { + if (context()->get_feature_mgr()->HasCapability(SpvCapabilityShader)) + return IsReadOnlyVariableShaders(); + else + return IsReadOnlyVariableKernel(); +} + +bool Instruction::IsVulkanStorageImage() const { + if (opcode() != SpvOpTypePointer) { + return false; + } + + uint32_t storage_class = GetSingleWordInOperand(kVariableStorageClassIndex); + if (storage_class != SpvStorageClassUniformConstant) { + return false; + } + + ir::Instruction* base_type = + context()->get_def_use_mgr()->GetDef(GetSingleWordInOperand(1)); + if (base_type->opcode() != SpvOpTypeImage) { + return false; + } + + if (base_type->GetSingleWordInOperand(kTypeImageDimIndex) == SpvDimBuffer) { + return false; + } + + // Check if the image is sampled. If we do not know for sure that it is, + // then assume it is a storage image. + auto s = base_type->GetSingleWordInOperand(kTypeImageSampledIndex); + return s != 1; +} + +bool Instruction::IsVulkanSampledImage() const { + if (opcode() != SpvOpTypePointer) { + return false; + } + + uint32_t storage_class = GetSingleWordInOperand(kVariableStorageClassIndex); + if (storage_class != SpvStorageClassUniformConstant) { + return false; + } + + ir::Instruction* base_type = + context()->get_def_use_mgr()->GetDef(GetSingleWordInOperand(1)); + if (base_type->opcode() != SpvOpTypeImage) { + return false; + } + + if (base_type->GetSingleWordInOperand(kTypeImageDimIndex) == SpvDimBuffer) { + return false; + } + + // Check if the image is sampled. If we know for sure that it is, + // then return true. + auto s = base_type->GetSingleWordInOperand(kTypeImageSampledIndex); + return s == 1; +} + +bool Instruction::IsVulkanStorageTexelBuffer() const { + if (opcode() != SpvOpTypePointer) { + return false; + } + + uint32_t storage_class = GetSingleWordInOperand(kVariableStorageClassIndex); + if (storage_class != SpvStorageClassUniformConstant) { + return false; + } + + ir::Instruction* base_type = + context()->get_def_use_mgr()->GetDef(GetSingleWordInOperand(1)); + if (base_type->opcode() != SpvOpTypeImage) { + return false; + } + + if (base_type->GetSingleWordInOperand(kTypeImageDimIndex) != SpvDimBuffer) { + return false; + } + + // Check if the image is sampled. If we do not know for sure that it is, + // then assume it is a storage texel buffer. + return base_type->GetSingleWordInOperand(kTypeImageSampledIndex) != 1; +} + +bool Instruction::IsVulkanStorageBuffer() const { + // Is there a difference between a "Storage buffer" and a "dynamic storage + // buffer" in SPIR-V and do we care about the difference? + if (opcode() != SpvOpTypePointer) { + return false; + } + + ir::Instruction* base_type = + context()->get_def_use_mgr()->GetDef(GetSingleWordInOperand(1)); + + if (base_type->opcode() != SpvOpTypeStruct) { + return false; + } + + uint32_t storage_class = GetSingleWordInOperand(kVariableStorageClassIndex); + if (storage_class == SpvStorageClassUniform) { + bool is_buffer_block = false; + context()->get_decoration_mgr()->ForEachDecoration( + base_type->result_id(), SpvDecorationBufferBlock, + [&is_buffer_block](const ir::Instruction&) { is_buffer_block = true; }); + return is_buffer_block; + } else if (storage_class == SpvStorageClassStorageBuffer) { + bool is_block = false; + context()->get_decoration_mgr()->ForEachDecoration( + base_type->result_id(), SpvDecorationBlock, + [&is_block](const ir::Instruction&) { is_block = true; }); + return is_block; + } + return false; +} + +bool Instruction::IsVulkanUniformBuffer() const { + if (opcode() != SpvOpTypePointer) { + return false; + } + + uint32_t storage_class = GetSingleWordInOperand(kVariableStorageClassIndex); + if (storage_class != SpvStorageClassUniform) { + return false; + } + + ir::Instruction* base_type = + context()->get_def_use_mgr()->GetDef(GetSingleWordInOperand(1)); + if (base_type->opcode() != SpvOpTypeStruct) { + return false; + } + + bool is_block = false; + context()->get_decoration_mgr()->ForEachDecoration( + base_type->result_id(), SpvDecorationBlock, + [&is_block](const ir::Instruction&) { is_block = true; }); + return is_block; +} + +bool Instruction::IsReadOnlyVariableShaders() const { + uint32_t storage_class = GetSingleWordInOperand(kVariableStorageClassIndex); + Instruction* type_def = context()->get_def_use_mgr()->GetDef(type_id()); + + switch (storage_class) { + case SpvStorageClassUniformConstant: + if (!type_def->IsVulkanStorageImage() && + !type_def->IsVulkanStorageTexelBuffer()) { + return true; + } + break; + case SpvStorageClassUniform: + if (!type_def->IsVulkanStorageBuffer()) { + return true; + } + break; + case SpvStorageClassPushConstant: + case SpvStorageClassInput: + return true; + default: + break; + } + + bool is_nonwritable = false; + context()->get_decoration_mgr()->ForEachDecoration( + result_id(), SpvDecorationNonWritable, + [&is_nonwritable](const Instruction&) { is_nonwritable = true; }); + return is_nonwritable; +} + +bool Instruction::IsReadOnlyVariableKernel() const { + uint32_t storage_class = GetSingleWordInOperand(kVariableStorageClassIndex); + return storage_class == SpvStorageClassUniformConstant; +} + +uint32_t Instruction::GetTypeComponent(uint32_t element) const { + uint32_t subtype = 0; + switch (opcode()) { + case SpvOpTypeStruct: + subtype = GetSingleWordInOperand(element); + break; + case SpvOpTypeArray: + case SpvOpTypeRuntimeArray: + case SpvOpTypeVector: + case SpvOpTypeMatrix: + // These types all have uniform subtypes. + subtype = GetSingleWordInOperand(0u); + break; + default: + break; + } + + return subtype; +} + +Instruction* Instruction::InsertBefore( + std::vector>&& list) { + Instruction* first_node = list.front().get(); + for (auto& i : list) { + i.release()->InsertBefore(this); + } + list.clear(); + return first_node; +} + +Instruction* Instruction::InsertBefore(std::unique_ptr&& i) { + i.get()->InsertBefore(this); + return i.release(); +} + +bool Instruction::IsValidBasePointer() const { + uint32_t tid = type_id(); + if (tid == 0) { + return false; + } + + ir::Instruction* type = context()->get_def_use_mgr()->GetDef(tid); + if (type->opcode() != SpvOpTypePointer) { + return false; + } + + if (context()->get_feature_mgr()->HasCapability(SpvCapabilityAddresses)) { + // TODO: The rules here could be more restrictive. + return true; + } + + if (opcode() == SpvOpVariable || opcode() == SpvOpFunctionParameter) { + return true; + } + + uint32_t pointee_type_id = type->GetSingleWordInOperand(1); + ir::Instruction* pointee_type_inst = + context()->get_def_use_mgr()->GetDef(pointee_type_id); + + if (pointee_type_inst->IsOpaqueType()) { + return true; + } + return false; +} + +bool Instruction::IsValidBaseImage() const { + uint32_t tid = type_id(); + if (tid == 0) { + return false; + } + + ir::Instruction* type = context()->get_def_use_mgr()->GetDef(tid); + return (type->opcode() == SpvOpTypeImage || + type->opcode() == SpvOpTypeSampledImage); +} + +bool Instruction::IsOpaqueType() const { + if (opcode() == SpvOpTypeStruct) { + bool is_opaque = false; + ForEachInOperand([&is_opaque, this](const uint32_t* op_id) { + ir::Instruction* type_inst = context()->get_def_use_mgr()->GetDef(*op_id); + is_opaque |= type_inst->IsOpaqueType(); + }); + return is_opaque; + } else if (opcode() == SpvOpTypeArray) { + uint32_t sub_type_id = GetSingleWordInOperand(0); + ir::Instruction* sub_type_inst = + context()->get_def_use_mgr()->GetDef(sub_type_id); + return sub_type_inst->IsOpaqueType(); + } else { + return opcode() == SpvOpTypeRuntimeArray || + spvOpcodeIsBaseOpaqueType(opcode()); + } +} + +bool Instruction::IsFoldable() const { + return IsFoldableByFoldScalar() || + opt::GetConstantFoldingRules().HasFoldingRule(opcode()); +} + +bool Instruction::IsFoldableByFoldScalar() const { + if (!opt::IsFoldableOpcode(opcode())) { + return false; + } + Instruction* type = context()->get_def_use_mgr()->GetDef(type_id()); + return opt::IsFoldableType(type); +} + +bool Instruction::IsFloatingPointFoldingAllowed() const { + // TODO: Add the rules for kernels. For now it will be pessimistic. + if (!context_->get_feature_mgr()->HasCapability(SpvCapabilityShader)) { + return false; + } + + bool is_nocontract = false; + context_->get_decoration_mgr()->WhileEachDecoration( + opcode_, SpvDecorationNoContraction, + [&is_nocontract](const ir::Instruction&) { + is_nocontract = true; + return false; + }); + return !is_nocontract; +} + +std::string Instruction::PrettyPrint(uint32_t options) const { + // Convert the module to binary. + std::vector module_binary; + context()->module()->ToBinary(&module_binary, /* skip_nop = */ false); + + // Convert the instruction to binary. This is used to identify the correct + // stream of words to output from the module. + std::vector inst_binary; + ToBinaryWithoutAttachedDebugInsts(&inst_binary); + + // Do not generate a header. + return spvInstructionBinaryToText( + context()->grammar().target_env(), inst_binary.data(), inst_binary.size(), + module_binary.data(), module_binary.size(), + options | SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); +} + +std::ostream& operator<<(std::ostream& str, const ir::Instruction& inst) { + str << inst.PrettyPrint(); + return str; +} + +bool Instruction::IsOpcodeCodeMotionSafe() const { + switch (opcode_) { + case SpvOpVectorExtractDynamic: + case SpvOpVectorInsertDynamic: + case SpvOpVectorShuffle: + case SpvOpConvertFToU: + case SpvOpConvertFToS: + case SpvOpConvertSToF: + case SpvOpConvertUToF: + case SpvOpUConvert: + case SpvOpSConvert: + case SpvOpFConvert: + case SpvOpQuantizeToF16: + case SpvOpBitcast: + case SpvOpSNegate: + case SpvOpFNegate: + case SpvOpIAdd: + case SpvOpFAdd: + case SpvOpISub: + case SpvOpFSub: + case SpvOpIMul: + case SpvOpFMul: + case SpvOpUDiv: + case SpvOpSDiv: + case SpvOpFDiv: + case SpvOpUMod: + case SpvOpSRem: + case SpvOpSMod: + case SpvOpFRem: + case SpvOpFMod: + case SpvOpVectorTimesScalar: + case SpvOpMatrixTimesScalar: + case SpvOpVectorTimesMatrix: + case SpvOpMatrixTimesVector: + case SpvOpMatrixTimesMatrix: + case SpvOpLogicalEqual: + case SpvOpLogicalNotEqual: + case SpvOpLogicalOr: + case SpvOpLogicalAnd: + case SpvOpLogicalNot: + case SpvOpIEqual: + case SpvOpINotEqual: + case SpvOpUGreaterThan: + case SpvOpSGreaterThan: + case SpvOpUGreaterThanEqual: + case SpvOpSGreaterThanEqual: + case SpvOpULessThan: + case SpvOpSLessThan: + case SpvOpULessThanEqual: + case SpvOpSLessThanEqual: + case SpvOpFOrdEqual: + case SpvOpFUnordEqual: + case SpvOpFOrdNotEqual: + case SpvOpFUnordNotEqual: + case SpvOpFOrdLessThan: + case SpvOpFUnordLessThan: + case SpvOpFOrdGreaterThan: + case SpvOpFUnordGreaterThan: + case SpvOpFOrdLessThanEqual: + case SpvOpFUnordLessThanEqual: + case SpvOpFOrdGreaterThanEqual: + case SpvOpFUnordGreaterThanEqual: + case SpvOpShiftRightLogical: + case SpvOpShiftRightArithmetic: + case SpvOpShiftLeftLogical: + case SpvOpBitwiseOr: + case SpvOpBitwiseXor: + case SpvOpBitwiseAnd: + case SpvOpNot: + return true; + default: + return false; + } +} + +} // namespace ir +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/instruction.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/instruction.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/instruction.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/instruction.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,705 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_INSTRUCTION_H_ +#define LIBSPIRV_OPT_INSTRUCTION_H_ + +#include +#include +#include +#include + +#include "opcode.h" +#include "operand.h" +#include "util/ilist_node.h" + +#include "latest_version_spirv_header.h" +#include "reflect.h" +#include "spirv-tools/libspirv.h" + +namespace spvtools { +namespace ir { + +class Function; +class IRContext; +class Module; +class InstructionList; + +// Relaxed logcial addressing: +// +// In the logical addressing model, pointers cannot be stored or loaded. This +// is a useful assumption because it simplifies the aliasing significantly. +// However, for the purpose of legalizing code generated from HLSL, we will have +// to allow storing and loading of pointers to opaque objects and runtime +// arrays. This relaxation of the rule still implies that function and private +// scope variables do not have any aliasing, so we can treat them as before. +// This will be call the relaxed logical addressing model. +// +// This relaxation of the rule will be allowed by |GetBaseAddress|, but it will +// enforce that no other pointers are stored or loaded. + +// About operand: +// +// In the SPIR-V specification, the term "operand" is used to mean any single +// SPIR-V word following the leading wordcount-opcode word. Here, the term +// "operand" is used to mean a *logical* operand. A logical operand may consist +// of multiple SPIR-V words, which together make up the same component. For +// example, a logical operand of a 64-bit integer needs two words to express. +// +// Further, we categorize logical operands into *in* and *out* operands. +// In operands are operands actually serve as input to operations, while out +// operands are operands that represent ids generated from operations (result +// type id or result id). For example, for "OpIAdd %rtype %rid %inop1 %inop2", +// "%inop1" and "%inop2" are in operands, while "%rtype" and "%rid" are out +// operands. + +// A *logical* operand to a SPIR-V instruction. It can be the type id, result +// id, or other additional operands carried in an instruction. +struct Operand { + Operand(spv_operand_type_t t, std::vector&& w) + : type(t), words(std::move(w)) {} + + Operand(spv_operand_type_t t, const std::vector& w) + : type(t), words(w) {} + + spv_operand_type_t type; // Type of this logical operand. + std::vector words; // Binary segments of this logical operand. + + friend bool operator==(const Operand& o1, const Operand& o2) { + return o1.type == o2.type && o1.words == o2.words; + } + + // TODO(antiagainst): create fields for literal number kind, width, etc. +}; + +inline bool operator!=(const Operand& o1, const Operand& o2) { + return !(o1 == o2); +} + +// A SPIR-V instruction. It contains the opcode and any additional logical +// operand, including the result id (if any) and result type id (if any). It +// may also contain line-related debug instruction (OpLine, OpNoLine) directly +// appearing before this instruction. Note that the result id of an instruction +// should never change after the instruction being built. If the result id +// needs to change, the user should create a new instruction instead. +class Instruction : public utils::IntrusiveNodeBase { + public: + using iterator = std::vector::iterator; + using const_iterator = std::vector::const_iterator; + + // Creates a default OpNop instruction. + // This exists solely for containers that can't do without. Should be removed. + Instruction() + : utils::IntrusiveNodeBase(), + context_(nullptr), + opcode_(SpvOpNop), + type_id_(0), + result_id_(0), + unique_id_(0) {} + + // Creates a default OpNop instruction. + Instruction(IRContext*); + // Creates an instruction with the given opcode |op| and no additional logical + // operands. + Instruction(IRContext*, SpvOp); + // Creates an instruction using the given spv_parsed_instruction_t |inst|. All + // the data inside |inst| will be copied and owned in this instance. And keep + // record of line-related debug instructions |dbg_line| ahead of this + // instruction, if any. + Instruction(IRContext* c, const spv_parsed_instruction_t& inst, + std::vector&& dbg_line = {}); + + // Creates an instruction with the given opcode |op|, type id: |ty_id|, + // result id: |res_id| and input operands: |in_operands|. + Instruction(IRContext* c, SpvOp op, uint32_t ty_id, uint32_t res_id, + const std::vector& in_operands); + + // TODO: I will want to remove these, but will first have to remove the use of + // std::vector. + Instruction(const Instruction&) = default; + Instruction& operator=(const Instruction&) = default; + + Instruction(Instruction&&); + Instruction& operator=(Instruction&&); + + virtual ~Instruction() = default; + + // Returns a newly allocated instruction that has the same operands, result, + // and type as |this|. The new instruction is not linked into any list. + // It is the responsibility of the caller to make sure that the storage is + // removed. It is the caller's responsibility to make sure that there is only + // one instruction for each result id. + Instruction* Clone(IRContext* c) const; + + IRContext* context() const { return context_; } + + SpvOp opcode() const { return opcode_; } + // Sets the opcode of this instruction to a specific opcode. Note this may + // invalidate the instruction. + // TODO(qining): Remove this function when instruction building and insertion + // is well implemented. + void SetOpcode(SpvOp op) { opcode_ = op; } + uint32_t type_id() const { return type_id_; } + uint32_t result_id() const { return result_id_; } + uint32_t unique_id() const { + assert(unique_id_ != 0); + return unique_id_; + } + // Returns the vector of line-related debug instructions attached to this + // instruction and the caller can directly modify them. + std::vector& dbg_line_insts() { return dbg_line_insts_; } + const std::vector& dbg_line_insts() const { + return dbg_line_insts_; + } + + // Same semantics as in the base class except the list the InstructionList + // containing |pos| will now assume ownership of |this|. + // inline void MoveBefore(Instruction* pos); + // inline void InsertAfter(Instruction* pos); + + // Begin and end iterators for operands. + iterator begin() { return operands_.begin(); } + iterator end() { return operands_.end(); } + const_iterator begin() const { return operands_.cbegin(); } + const_iterator end() const { return operands_.cend(); } + // Const begin and end iterators for operands. + const_iterator cbegin() const { return operands_.cbegin(); } + const_iterator cend() const { return operands_.cend(); } + + // Gets the number of logical operands. + uint32_t NumOperands() const { + return static_cast(operands_.size()); + } + // Gets the number of SPIR-V words occupied by all logical operands. + uint32_t NumOperandWords() const { + return NumInOperandWords() + TypeResultIdCount(); + } + // Gets the |index|-th logical operand. + inline Operand& GetOperand(uint32_t index); + inline const Operand& GetOperand(uint32_t index) const; + // Adds |operand| to the list of operands of this instruction. + // It is the responsibility of the caller to make sure + // that the instruction remains valid. + inline void AddOperand(Operand&& operand); + // Gets the |index|-th logical operand as a single SPIR-V word. This method is + // not expected to be used with logical operands consisting of multiple SPIR-V + // words. + uint32_t GetSingleWordOperand(uint32_t index) const; + // Sets the |index|-th in-operand's data to the given |data|. + inline void SetInOperand(uint32_t index, std::vector&& data); + // Sets the |index|-th operand's data to the given |data|. + // This is for in-operands modification only, but with |index| expressed in + // terms of operand index rather than in-operand index. + inline void SetOperand(uint32_t index, std::vector&& data); + // Replace all of the in operands with those in |new_operands|. + inline void SetInOperands(std::vector&& new_operands); + // Sets the result type id. + inline void SetResultType(uint32_t ty_id); + // Sets the result id + inline void SetResultId(uint32_t res_id); + inline bool HasResultId() const { return result_id_ != 0; } + // Remove the |index|-th operand + void RemoveOperand(uint32_t index) { + operands_.erase(operands_.begin() + index); + } + + // The following methods are similar to the above, but are for in operands. + uint32_t NumInOperands() const { + return static_cast(operands_.size() - TypeResultIdCount()); + } + uint32_t NumInOperandWords() const; + Operand& GetInOperand(uint32_t index) { + return GetOperand(index + TypeResultIdCount()); + } + const Operand& GetInOperand(uint32_t index) const { + return GetOperand(index + TypeResultIdCount()); + } + uint32_t GetSingleWordInOperand(uint32_t index) const { + return GetSingleWordOperand(index + TypeResultIdCount()); + } + void RemoveInOperand(uint32_t index) { + operands_.erase(operands_.begin() + index + TypeResultIdCount()); + } + + // Returns true if this instruction is OpNop. + inline bool IsNop() const; + // Turns this instruction to OpNop. This does not clear out all preceding + // line-related debug instructions. + inline void ToNop(); + + // Runs the given function |f| on this instruction and optionally on the + // preceding debug line instructions. The function will always be run + // if this is itself a debug line instruction. + inline void ForEachInst(const std::function& f, + bool run_on_debug_line_insts = false); + inline void ForEachInst(const std::function& f, + bool run_on_debug_line_insts = false) const; + + // Runs the given function |f| on this instruction and optionally on the + // preceding debug line instructions. The function will always be run + // if this is itself a debug line instruction. If |f| returns false, + // iteration is terminated and this function returns false. + inline bool WhileEachInst(const std::function& f, + bool run_on_debug_line_insts = false); + inline bool WhileEachInst(const std::function& f, + bool run_on_debug_line_insts = false) const; + + // Runs the given function |f| on all operand ids. + // + // |f| should not transform an ID into 0, as 0 is an invalid ID. + inline void ForEachId(const std::function& f); + inline void ForEachId(const std::function& f) const; + + // Runs the given function |f| on all "in" operand ids. + inline void ForEachInId(const std::function& f); + inline void ForEachInId(const std::function& f) const; + + // Runs the given function |f| on all "in" operand ids. If |f| returns false, + // iteration is terminated and this function returns false. + inline bool WhileEachInId(const std::function& f); + inline bool WhileEachInId( + const std::function& f) const; + + // Runs the given function |f| on all "in" operands. + inline void ForEachInOperand(const std::function& f); + inline void ForEachInOperand( + const std::function& f) const; + + // Runs the given function |f| on all "in" operands. If |f| returns false, + // iteration is terminated and this function return false. + inline bool WhileEachInOperand(const std::function& f); + inline bool WhileEachInOperand( + const std::function& f) const; + + // Returns true if any operands can be labels + inline bool HasLabels() const; + + // Pushes the binary segments for this instruction into the back of *|binary|. + void ToBinaryWithoutAttachedDebugInsts(std::vector* binary) const; + + // Replaces the operands to the instruction with |new_operands|. The caller + // is responsible for building a complete and valid list of operands for + // this instruction. + void ReplaceOperands(const std::vector& new_operands); + + // Returns true if the instruction annotates an id with a decoration. + inline bool IsDecoration() const; + + // Returns true if the instruction is known to be a load from read-only + // memory. + bool IsReadOnlyLoad() const; + + // Returns the instruction that gives the base address of an address + // calculation. The instruction must be a load, as defined by |IsLoad|, + // store, copy, or access chain instruction. In logical addressing mode, will + // return an OpVariable or OpFunctionParameter instruction. For relaxed + // logical addressing, it would also return a load of a pointer to an opaque + // object. For physical addressing mode, could return other types of + // instructions. + Instruction* GetBaseAddress() const; + + // Returns true if the instruction loads from memory or samples an image, and + // stores the result into an id. It considers only core instructions. + // Memory-to-memory instructions are not considered loads. + inline bool IsLoad() const; + + // Returns true if the instruction declares a variable that is read-only. + bool IsReadOnlyVariable() const; + + // The following functions check for the various descriptor types defined in + // the Vulkan specification section 13.1. + + // Returns true if the instruction defines a pointer type that points to a + // storage image. + bool IsVulkanStorageImage() const; + + // Returns true if the instruction defines a pointer type that points to a + // sampled image. + bool IsVulkanSampledImage() const; + + // Returns true if the instruction defines a pointer type that points to a + // storage texel buffer. + bool IsVulkanStorageTexelBuffer() const; + + // Returns true if the instruction defines a pointer type that points to a + // storage buffer. + bool IsVulkanStorageBuffer() const; + + // Returns true if the instruction defines a pointer type that points to a + // uniform buffer. + bool IsVulkanUniformBuffer() const; + + // Returns true if the instruction is an atom operation. + inline bool IsAtomicOp() const; + + // Returns true if this instruction is a branch or switch instruction (either + // conditional or not). + bool IsBranch() const { return spvOpcodeIsBranch(opcode()); } + + // Returns true if this instruction causes the function to finish execution + // and return to its caller + bool IsReturn() const { return spvOpcodeIsReturn(opcode()); } + + // Returns true if this instruction exits this function or aborts execution. + bool IsReturnOrAbort() const { return spvOpcodeIsReturnOrAbort(opcode()); } + + // Returns the id for the |element|'th subtype. If the |this| is not a + // composite type, this function returns 0. + uint32_t GetTypeComponent(uint32_t element) const; + + // Returns true if this instruction is a basic block terminator. + bool IsBlockTerminator() const { + return spvOpcodeIsBlockTerminator(opcode()); + } + + // Returns true if |this| is an instruction that define an opaque type. Since + // runtime array have similar characteristics they are included as opaque + // types. + bool IsOpaqueType() const; + + // Returns true if |this| is an instruction which could be folded into a + // constant value. + bool IsFoldable() const; + + // Returns true if |this| is an instruction which could be folded into a + // constant value by |FoldScalar|. + bool IsFoldableByFoldScalar() const; + + // Returns true if we are allowed to fold or otherwise manipulate the + // instruction that defines |id| in the given context. This includes not + // handling NaN values. + bool IsFloatingPointFoldingAllowed() const; + + inline bool operator==(const Instruction&) const; + inline bool operator!=(const Instruction&) const; + inline bool operator<(const Instruction&) const; + + Instruction* InsertBefore(std::vector>&& list); + Instruction* InsertBefore(std::unique_ptr&& i); + using utils::IntrusiveNodeBase::InsertBefore; + + // Returns true if |this| is an instruction defining a constant, but not a + // Spec constant. + inline bool IsConstant() const; + + // Returns true if |this| is an instruction with an opcode safe to move + bool IsOpcodeCodeMotionSafe() const; + + // Pretty-prints |inst|. + // + // Provides the disassembly of a specific instruction. Utilizes |inst|'s + // context to provide the correct interpretation of types, constants, etc. + // + // |options| are the disassembly options. SPV_BINARY_TO_TEXT_OPTION_NO_HEADER + // is always added to |options|. + std::string PrettyPrint(uint32_t options = 0u) const; + + private: + // Returns the total count of result type id and result id. + uint32_t TypeResultIdCount() const { + return (type_id_ != 0) + (result_id_ != 0); + } + + // Returns true if the instruction declares a variable that is read-only. The + // first version assumes the module is a shader module. The second assumes a + // kernel. + bool IsReadOnlyVariableShaders() const; + bool IsReadOnlyVariableKernel() const; + + // Returns true if it is valid to use the result of |inst| as the base + // pointer for a load or store. In this case, valid is defined by the relaxed + // logical addressing rules when using logical addressing. Normal validation + // rules for physical addressing. + bool IsValidBasePointer() const; + + // Returns true if the result of |inst| can be used as the base image for an + // instruction that samples a image, reads an image, or writes to an image. + bool IsValidBaseImage() const; + + IRContext* context_; // IR Context + SpvOp opcode_; // Opcode + uint32_t type_id_; // Result type id. A value of 0 means no result type id. + uint32_t result_id_; // Result id. A value of 0 means no result id. + uint32_t unique_id_; // Unique instruction id + // All logical operands, including result type id and result id. + std::vector operands_; + // Opline and OpNoLine instructions preceding this instruction. Note that for + // Instructions representing OpLine or OpNonLine itself, this field should be + // empty. + std::vector dbg_line_insts_; + + friend InstructionList; +}; + +// Pretty-prints |inst| to |str| and returns |str|. +// +// Provides the disassembly of a specific instruction. Utilizes |inst|'s context +// to provide the correct interpretation of types, constants, etc. +// +// Disassembly uses raw ids (not pretty printed names). +std::ostream& operator<<(std::ostream& str, const ir::Instruction& inst); + +inline bool Instruction::operator==(const Instruction& other) const { + return unique_id() == other.unique_id(); +} + +inline bool Instruction::operator!=(const Instruction& other) const { + return !(*this == other); +} + +inline bool Instruction::operator<(const Instruction& other) const { + return unique_id() < other.unique_id(); +} + +inline Operand& Instruction::GetOperand(uint32_t index) { + assert(index < operands_.size() && "operand index out of bound"); + return operands_[index]; +} + +inline const Operand& Instruction::GetOperand(uint32_t index) const { + assert(index < operands_.size() && "operand index out of bound"); + return operands_[index]; +} + +inline void Instruction::AddOperand(Operand&& operand) { + operands_.push_back(std::move(operand)); +} + +inline void Instruction::SetInOperand(uint32_t index, + std::vector&& data) { + SetOperand(index + TypeResultIdCount(), std::move(data)); +} + +inline void Instruction::SetOperand(uint32_t index, + std::vector&& data) { + assert(index < operands_.size() && "operand index out of bound"); + assert(index >= TypeResultIdCount() && "operand is not a in-operand"); + operands_[index].words = std::move(data); +} + +inline void Instruction::SetInOperands(std::vector&& new_operands) { + // Remove the old in operands. + operands_.erase(operands_.begin() + TypeResultIdCount(), operands_.end()); + // Add the new in operands. + operands_.insert(operands_.end(), new_operands.begin(), new_operands.end()); +} + +inline void Instruction::SetResultId(uint32_t res_id) { + result_id_ = res_id; + auto ridx = (type_id_ != 0) ? 1 : 0; + assert(operands_[ridx].type == SPV_OPERAND_TYPE_RESULT_ID); + operands_[ridx].words = {res_id}; +} + +inline void Instruction::SetResultType(uint32_t ty_id) { + if (type_id_ != 0) { + type_id_ = ty_id; + assert(operands_.front().type == SPV_OPERAND_TYPE_TYPE_ID); + operands_.front().words = {ty_id}; + } +} + +inline bool Instruction::IsNop() const { + return opcode_ == SpvOpNop && type_id_ == 0 && result_id_ == 0 && + operands_.empty(); +} + +inline void Instruction::ToNop() { + opcode_ = SpvOpNop; + type_id_ = result_id_ = 0; + operands_.clear(); +} + +inline bool Instruction::WhileEachInst( + const std::function& f, bool run_on_debug_line_insts) { + if (run_on_debug_line_insts) { + for (auto& dbg_line : dbg_line_insts_) { + if (!f(&dbg_line)) return false; + } + } + return f(this); +} + +inline bool Instruction::WhileEachInst( + const std::function& f, + bool run_on_debug_line_insts) const { + if (run_on_debug_line_insts) { + for (auto& dbg_line : dbg_line_insts_) { + if (!f(&dbg_line)) return false; + } + } + return f(this); +} + +inline void Instruction::ForEachInst(const std::function& f, + bool run_on_debug_line_insts) { + WhileEachInst( + [&f](Instruction* inst) { + f(inst); + return true; + }, + run_on_debug_line_insts); +} + +inline void Instruction::ForEachInst( + const std::function& f, + bool run_on_debug_line_insts) const { + WhileEachInst( + [&f](const Instruction* inst) { + f(inst); + return true; + }, + run_on_debug_line_insts); +} + +inline void Instruction::ForEachId(const std::function& f) { + for (auto& opnd : operands_) + if (spvIsIdType(opnd.type)) f(&opnd.words[0]); + if (type_id_ != 0u) type_id_ = GetSingleWordOperand(0u); + if (result_id_ != 0u) + result_id_ = GetSingleWordOperand(type_id_ == 0u ? 0u : 1u); +} + +inline void Instruction::ForEachId( + const std::function& f) const { + for (const auto& opnd : operands_) + if (spvIsIdType(opnd.type)) f(&opnd.words[0]); +} + +inline bool Instruction::WhileEachInId( + const std::function& f) { + for (auto& opnd : operands_) { + switch (opnd.type) { + case SPV_OPERAND_TYPE_RESULT_ID: + case SPV_OPERAND_TYPE_TYPE_ID: + break; + default: + if (spvIsIdType(opnd.type)) { + if (!f(&opnd.words[0])) return false; + } + break; + } + } + return true; +} + +inline bool Instruction::WhileEachInId( + const std::function& f) const { + for (const auto& opnd : operands_) { + switch (opnd.type) { + case SPV_OPERAND_TYPE_RESULT_ID: + case SPV_OPERAND_TYPE_TYPE_ID: + break; + default: + if (spvIsIdType(opnd.type)) { + if (!f(&opnd.words[0])) return false; + } + break; + } + } + return true; +} + +inline void Instruction::ForEachInId(const std::function& f) { + WhileEachInId([&f](uint32_t* id) { + f(id); + return true; + }); +} + +inline void Instruction::ForEachInId( + const std::function& f) const { + WhileEachInId([&f](const uint32_t* id) { + f(id); + return true; + }); +} + +inline bool Instruction::WhileEachInOperand( + const std::function& f) { + for (auto& opnd : operands_) { + switch (opnd.type) { + case SPV_OPERAND_TYPE_RESULT_ID: + case SPV_OPERAND_TYPE_TYPE_ID: + break; + default: + if (!f(&opnd.words[0])) return false; + break; + } + } + return true; +} + +inline bool Instruction::WhileEachInOperand( + const std::function& f) const { + for (const auto& opnd : operands_) { + switch (opnd.type) { + case SPV_OPERAND_TYPE_RESULT_ID: + case SPV_OPERAND_TYPE_TYPE_ID: + break; + default: + if (!f(&opnd.words[0])) return false; + break; + } + } + return true; +} + +inline void Instruction::ForEachInOperand( + const std::function& f) { + WhileEachInOperand([&f](uint32_t* op) { + f(op); + return true; + }); +} + +inline void Instruction::ForEachInOperand( + const std::function& f) const { + WhileEachInOperand([&f](const uint32_t* op) { + f(op); + return true; + }); +} + +inline bool Instruction::HasLabels() const { + switch (opcode_) { + case SpvOpSelectionMerge: + case SpvOpBranch: + case SpvOpLoopMerge: + case SpvOpBranchConditional: + case SpvOpSwitch: + case SpvOpPhi: + return true; + break; + default: + break; + } + return false; +} + +bool Instruction::IsDecoration() const { + return spvOpcodeIsDecoration(opcode()); +} + +bool Instruction::IsLoad() const { return spvOpcodeIsLoad(opcode()); } + +bool Instruction::IsAtomicOp() const { return spvOpcodeIsAtomicOp(opcode()); } + +bool Instruction::IsConstant() const { + return IsCompileTimeConstantInst(opcode()); +} +} // namespace ir +} // namespace spvtools + +#endif // LIBSPIRV_OPT_INSTRUCTION_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/instruction_list.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/instruction_list.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/instruction_list.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/instruction_list.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,36 @@ +// Copyright (c) 2017 Google 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. + +#include "instruction_list.h" + +namespace spvtools { +namespace ir { + +InstructionList::iterator InstructionList::iterator::InsertBefore( + std::vector>&& list) { + Instruction* first_node = list.front().get(); + for (auto& i : list) { + i.release()->InsertBefore(node_); + } + list.clear(); + return iterator(first_node); +} + +InstructionList::iterator InstructionList::iterator::InsertBefore( + std::unique_ptr&& i) { + i.get()->InsertBefore(node_); + return iterator(i.release()); +} +} // namespace ir +} // namespace spvtools \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/instruction_list.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/instruction_list.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/instruction_list.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/instruction_list.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,130 @@ + +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_INSTRUCTION_LIST_H_ +#define LIBSPIRV_OPT_INSTRUCTION_LIST_H_ + +#include +#include +#include +#include + +#include "instruction.h" +#include "operand.h" +#include "util/ilist.h" + +#include "latest_version_spirv_header.h" +#include "spirv-tools/libspirv.h" + +namespace spvtools { +namespace ir { + +// This class is intended to be the container for Instructions. This container +// owns the instructions that are in it. When removing an Instruction from the +// list, the caller is assuming responsibility for deleting the storage. +// +// TODO: Because there are a number of other data structures that will want +// pointers to instruction, ownership should probably be moved to the module. +// Because of that I have not made the ownership passing in this class fully +// explicit. For example, RemoveFromList takes ownership from the list, but +// does not return an std::unique_ptr to signal that. When we fully decide on +// ownership, this will have to be fixed up one way or the other. +class InstructionList : public utils::IntrusiveList { + public: + InstructionList() = default; + InstructionList(InstructionList&& that) + : utils::IntrusiveList(std::move(that)) {} + InstructionList& operator=(InstructionList&& that) { + auto p = static_cast*>(this); + *p = std::move(that); + return *this; + } + + // Destroy this list and any instructions in the list. + inline virtual ~InstructionList(); + + class iterator : public utils::IntrusiveList::iterator { + public: + iterator(const utils::IntrusiveList::iterator& i) + : utils::IntrusiveList::iterator(i) {} + iterator(Instruction* i) : utils::IntrusiveList::iterator(i) {} + + // DEPRECATED: Please use MoveBefore with an InstructionList instead. + // + // Moves the nodes in |list| to the list that |this| points to. The + // positions of the nodes will be immediately before the element pointed to + // by the iterator. The return value will be an iterator pointing to the + // first of the newly inserted elements. Ownership of the elements in + // |list| is now passed on to |*this|. + iterator InsertBefore(std::vector>&& list); + + // The node |i| will be inserted immediately before |this|. The return value + // will be an iterator pointing to the newly inserted node. The owner of + // |*i| becomes |*this| + iterator InsertBefore(std::unique_ptr&& i); + + // Removes the node from the list, and deletes the storage. Returns a valid + // iterator to the next node. + iterator Erase() { + iterator_template next_node = *this; + ++next_node; + node_->RemoveFromList(); + delete node_; + return next_node; + } + }; + + iterator begin() { return utils::IntrusiveList::begin(); } + iterator end() { return utils::IntrusiveList::end(); } + const_iterator begin() const { + return utils::IntrusiveList::begin(); + } + const_iterator end() const { + return utils::IntrusiveList::end(); + } + + void push_back(std::unique_ptr&& inst) { + utils::IntrusiveList::push_back(inst.release()); + } + + // Same as in the base class, except it will delete the data as well. + inline void clear(); + + // Runs the given function |f| on the instructions in the list and optionally + // on the preceding debug line instructions. + inline void ForEachInst(const std::function& f, + bool run_on_debug_line_insts) { + auto next = begin(); + for (auto i = next; i != end(); i = next) { + ++next; + i->ForEachInst(f, run_on_debug_line_insts); + } + } +}; + +InstructionList::~InstructionList() { clear(); } + +void InstructionList::clear() { + while (!empty()) { + Instruction* inst = &front(); + inst->RemoveFromList(); + delete inst; + } +} + +} // namespace ir +} // namespace spvtools + +#endif // LIBSPIRV_OPT_INSTRUCTION_LIST_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/ir_builder.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/ir_builder.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/ir_builder.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/ir_builder.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,411 @@ +// Copyright (c) 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_IR_BUILDER_H_ +#define LIBSPIRV_OPT_IR_BUILDER_H_ + +#include "opt/basic_block.h" +#include "opt/constants.h" +#include "opt/instruction.h" +#include "opt/ir_context.h" +namespace spvtools { +namespace opt { + +// In SPIR-V, ids are encoded as uint16_t, this id is guaranteed to be always +// invalid. +const uint32_t kInvalidId = std::numeric_limits::max(); + +// Helper class to abstract instruction construction and insertion. +// The instruction builder can preserve the following analyses (specified via +// the constructors): +// - Def-use analysis +// - Instruction to block analysis +class InstructionBuilder { + public: + using InsertionPointTy = spvtools::ir::BasicBlock::iterator; + + // Creates an InstructionBuilder, all new instructions will be inserted before + // the instruction |insert_before|. + InstructionBuilder( + ir::IRContext* context, ir::Instruction* insert_before, + ir::IRContext::Analysis preserved_analyses = ir::IRContext::kAnalysisNone) + : InstructionBuilder(context, context->get_instr_block(insert_before), + InsertionPointTy(insert_before), + preserved_analyses) {} + + // Creates an InstructionBuilder, all new instructions will be inserted at the + // end of the basic block |parent_block|. + InstructionBuilder( + ir::IRContext* context, ir::BasicBlock* parent_block, + ir::IRContext::Analysis preserved_analyses = ir::IRContext::kAnalysisNone) + : InstructionBuilder(context, parent_block, parent_block->end(), + preserved_analyses) {} + + // Creates a new selection merge instruction. + // The id |merge_id| is the merge basic block id. + ir::Instruction* AddSelectionMerge( + uint32_t merge_id, + uint32_t selection_control = SpvSelectionControlMaskNone) { + std::unique_ptr new_branch_merge(new ir::Instruction( + GetContext(), SpvOpSelectionMerge, 0, 0, + {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {merge_id}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_SELECTION_CONTROL, + {selection_control}}})); + return AddInstruction(std::move(new_branch_merge)); + } + + // Creates a new branch instruction to |label_id|. + // Note that the user must make sure the final basic block is + // well formed. + ir::Instruction* AddBranch(uint32_t label_id) { + std::unique_ptr new_branch(new ir::Instruction( + GetContext(), SpvOpBranch, 0, 0, + {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {label_id}}})); + return AddInstruction(std::move(new_branch)); + } + + // Creates a new conditional instruction and the associated selection merge + // instruction if requested. + // The id |cond_id| is the id of the condition instruction, must be of + // type bool. + // The id |true_id| is the id of the basic block to branch to if the condition + // is true. + // The id |false_id| is the id of the basic block to branch to if the + // condition is false. + // The id |merge_id| is the id of the merge basic block for the selection + // merge instruction. If |merge_id| equals kInvalidId then no selection merge + // instruction will be created. + // The value |selection_control| is the selection control flag for the + // selection merge instruction. + // Note that the user must make sure the final basic block is + // well formed. + ir::Instruction* AddConditionalBranch( + uint32_t cond_id, uint32_t true_id, uint32_t false_id, + uint32_t merge_id = kInvalidId, + uint32_t selection_control = SpvSelectionControlMaskNone) { + if (merge_id != kInvalidId) { + AddSelectionMerge(merge_id, selection_control); + } + std::unique_ptr new_branch(new ir::Instruction( + GetContext(), SpvOpBranchConditional, 0, 0, + {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {cond_id}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {true_id}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {false_id}}})); + return AddInstruction(std::move(new_branch)); + } + + // Creates a new switch instruction and the associated selection merge + // instruction if requested. + // The id |selector_id| is the id of the selector instruction, must be of + // type int. + // The id |default_id| is the id of the default basic block to branch to. + // The vector |targets| is the pair of literal/branch id. + // The id |merge_id| is the id of the merge basic block for the selection + // merge instruction. If |merge_id| equals kInvalidId then no selection merge + // instruction will be created. + // The value |selection_control| is the selection control flag for the + // selection merge instruction. + // Note that the user must make sure the final basic block is + // well formed. + ir::Instruction* AddSwitch( + uint32_t selector_id, uint32_t default_id, + const std::vector, uint32_t>>& targets, + uint32_t merge_id = kInvalidId, + uint32_t selection_control = SpvSelectionControlMaskNone) { + if (merge_id != kInvalidId) { + AddSelectionMerge(merge_id, selection_control); + } + std::vector operands; + operands.emplace_back( + ir::Operand{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {selector_id}}); + operands.emplace_back( + ir::Operand{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {default_id}}); + for (auto& target : targets) { + operands.emplace_back( + ir::Operand{spv_operand_type_t::SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER, + target.first}); + operands.emplace_back(ir::Operand{spv_operand_type_t::SPV_OPERAND_TYPE_ID, + {target.second}}); + } + std::unique_ptr new_switch( + new ir::Instruction(GetContext(), SpvOpSwitch, 0, 0, operands)); + return AddInstruction(std::move(new_switch)); + } + + // Creates a phi instruction. + // The id |type| must be the id of the phi instruction's type. + // The vector |incomings| must be a sequence of pairs of . + ir::Instruction* AddPhi(uint32_t type, + const std::vector& incomings) { + assert(incomings.size() % 2 == 0 && "A sequence of pairs is expected"); + std::vector phi_ops; + for (size_t i = 0; i < incomings.size(); i++) { + phi_ops.push_back({SPV_OPERAND_TYPE_ID, {incomings[i]}}); + } + std::unique_ptr phi_inst(new ir::Instruction( + GetContext(), SpvOpPhi, type, GetContext()->TakeNextId(), phi_ops)); + return AddInstruction(std::move(phi_inst)); + } + + // Creates an addition instruction. + // The id |type| must be the id of the instruction's type, must be the same as + // |op1| and |op2| types. + // The id |op1| is the left hand side of the operation. + // The id |op2| is the right hand side of the operation. + ir::Instruction* AddIAdd(uint32_t type, uint32_t op1, uint32_t op2) { + std::unique_ptr inst(new ir::Instruction( + GetContext(), SpvOpIAdd, type, GetContext()->TakeNextId(), + {{SPV_OPERAND_TYPE_ID, {op1}}, {SPV_OPERAND_TYPE_ID, {op2}}})); + return AddInstruction(std::move(inst)); + } + + // Creates a less than instruction for unsigned integer. + // The id |op1| is the left hand side of the operation. + // The id |op2| is the right hand side of the operation. + // It is assumed that |op1| and |op2| have the same underlying type. + ir::Instruction* AddULessThan(uint32_t op1, uint32_t op2) { + analysis::Bool bool_type; + uint32_t type = GetContext()->get_type_mgr()->GetId(&bool_type); + std::unique_ptr inst(new ir::Instruction( + GetContext(), SpvOpULessThan, type, GetContext()->TakeNextId(), + {{SPV_OPERAND_TYPE_ID, {op1}}, {SPV_OPERAND_TYPE_ID, {op2}}})); + return AddInstruction(std::move(inst)); + } + + // Creates a less than instruction for signed integer. + // The id |op1| is the left hand side of the operation. + // The id |op2| is the right hand side of the operation. + // It is assumed that |op1| and |op2| have the same underlying type. + ir::Instruction* AddSLessThan(uint32_t op1, uint32_t op2) { + analysis::Bool bool_type; + uint32_t type = GetContext()->get_type_mgr()->GetId(&bool_type); + std::unique_ptr inst(new ir::Instruction( + GetContext(), SpvOpSLessThan, type, GetContext()->TakeNextId(), + {{SPV_OPERAND_TYPE_ID, {op1}}, {SPV_OPERAND_TYPE_ID, {op2}}})); + return AddInstruction(std::move(inst)); + } + + // Creates an OpILessThan or OpULessThen instruction depending on the sign of + // |op1|. The id |op1| is the left hand side of the operation. The id |op2| is + // the right hand side of the operation. It is assumed that |op1| and |op2| + // have the same underlying type. + ir::Instruction* AddLessThan(uint32_t op1, uint32_t op2) { + ir::Instruction* op1_insn = context_->get_def_use_mgr()->GetDef(op1); + analysis::Type* type = + GetContext()->get_type_mgr()->GetType(op1_insn->type_id()); + analysis::Integer* int_type = type->AsInteger(); + assert(int_type && "Operand is not of int type"); + + if (int_type->IsSigned()) + return AddSLessThan(op1, op2); + else + return AddULessThan(op1, op2); + } + + // Creates a select instruction. + // |type| must match the types of |true_value| and |false_value|. It is up to + // the caller to ensure that |cond| is a correct type (bool or vector of + // bool) for |type|. + ir::Instruction* AddSelect(uint32_t type, uint32_t cond, uint32_t true_value, + uint32_t false_value) { + std::unique_ptr select(new ir::Instruction( + GetContext(), SpvOpSelect, type, GetContext()->TakeNextId(), + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {cond}}, + {SPV_OPERAND_TYPE_ID, {true_value}}, + {SPV_OPERAND_TYPE_ID, {false_value}}})); + return AddInstruction(std::move(select)); + } + + // Adds a signed int32 constant to the binary. + // The |value| parameter is the constant value to be added. + ir::Instruction* Add32BitSignedIntegerConstant(int32_t value) { + return Add32BitConstantInteger(value, true); + } + + // Create a composite construct. + // |type| should be a composite type and the number of elements it has should + // match the size od |ids|. + ir::Instruction* AddCompositeConstruct(uint32_t type, + const std::vector& ids) { + std::vector ops; + for (auto id : ids) { + ops.emplace_back(SPV_OPERAND_TYPE_ID, + std::initializer_list{id}); + } + std::unique_ptr construct( + new ir::Instruction(GetContext(), SpvOpCompositeConstruct, type, + GetContext()->TakeNextId(), ops)); + return AddInstruction(std::move(construct)); + } + // Adds an unsigned int32 constant to the binary. + // The |value| parameter is the constant value to be added. + ir::Instruction* Add32BitUnsignedIntegerConstant(uint32_t value) { + return Add32BitConstantInteger(value, false); + } + + // Adds either a signed or unsigned 32 bit integer constant to the binary + // depedning on the |sign|. If |sign| is true then the value is added as a + // signed constant otherwise as an unsigned constant. If |sign| is false the + // value must not be a negative number. + template + ir::Instruction* Add32BitConstantInteger(T value, bool sign) { + // Assert that we are not trying to store a negative number in an unsigned + // type. + if (!sign) + assert(value >= 0 && + "Trying to add a signed integer with an unsigned type!"); + + analysis::Integer int_type{32, sign}; + + // Get or create the integer type. This rebuilds the type and manages the + // memory for the rebuilt type. + uint32_t type_id = + GetContext()->get_type_mgr()->GetTypeInstruction(&int_type); + + // Get the memory managed type so that it is safe to be stored by + // GetConstant. + analysis::Type* rebuilt_type = + GetContext()->get_type_mgr()->GetType(type_id); + + // Even if the value is negative we need to pass the bit pattern as a + // uint32_t to GetConstant. + uint32_t word = value; + + // Create the constant value. + const opt::analysis::Constant* constant = + GetContext()->get_constant_mgr()->GetConstant(rebuilt_type, {word}); + + // Create the OpConstant instruction using the type and the value. + return GetContext()->get_constant_mgr()->GetDefiningInstruction(constant); + } + + ir::Instruction* AddCompositeExtract( + uint32_t type, uint32_t id_of_composite, + const std::vector& index_list) { + std::vector operands; + operands.push_back({SPV_OPERAND_TYPE_ID, {id_of_composite}}); + + for (uint32_t index : index_list) { + operands.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER, {index}}); + } + + std::unique_ptr new_inst( + new ir::Instruction(GetContext(), SpvOpCompositeExtract, type, + GetContext()->TakeNextId(), operands)); + return AddInstruction(std::move(new_inst)); + } + + // Creates an unreachable instruction. + ir::Instruction* AddUnreachable() { + std::unique_ptr select( + new ir::Instruction(GetContext(), SpvOpUnreachable, 0, 0, + std::initializer_list{})); + return AddInstruction(std::move(select)); + } + + ir::Instruction* AddAccessChain(uint32_t type_id, uint32_t base_ptr_id, + std::vector ids) { + std::vector operands; + operands.push_back({SPV_OPERAND_TYPE_ID, {base_ptr_id}}); + + for (uint32_t index_id : ids) { + operands.push_back({SPV_OPERAND_TYPE_ID, {index_id}}); + } + + std::unique_ptr new_inst( + new ir::Instruction(GetContext(), SpvOpAccessChain, type_id, + GetContext()->TakeNextId(), operands)); + return AddInstruction(std::move(new_inst)); + } + + // Inserts the new instruction before the insertion point. + ir::Instruction* AddInstruction(std::unique_ptr&& insn) { + ir::Instruction* insn_ptr = &*insert_before_.InsertBefore(std::move(insn)); + UpdateInstrToBlockMapping(insn_ptr); + UpdateDefUseMgr(insn_ptr); + return insn_ptr; + } + + // Returns the insertion point iterator. + InsertionPointTy GetInsertPoint() { return insert_before_; } + + // Change the insertion point to insert before the instruction + // |insert_before|. + void SetInsertPoint(ir::Instruction* insert_before) { + parent_ = context_->get_instr_block(insert_before); + insert_before_ = InsertionPointTy(insert_before); + } + + // Change the insertion point to insert at the end of the basic block + // |parent_block|. + void SetInsertPoint(ir::BasicBlock* parent_block) { + parent_ = parent_block; + insert_before_ = parent_block->end(); + } + + // Returns the context which instructions are constructed for. + ir::IRContext* GetContext() const { return context_; } + + // Returns the set of preserved analyses. + inline ir::IRContext::Analysis GetPreservedAnalysis() const { + return preserved_analyses_; + } + + private: + InstructionBuilder(ir::IRContext* context, ir::BasicBlock* parent, + InsertionPointTy insert_before, + ir::IRContext::Analysis preserved_analyses) + : context_(context), + parent_(parent), + insert_before_(insert_before), + preserved_analyses_(preserved_analyses) { + assert(!(preserved_analyses_ & + ~(ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping))); + } + + // Returns true if the users requested to update |analysis|. + inline bool IsAnalysisUpdateRequested( + ir::IRContext::Analysis analysis) const { + return preserved_analyses_ & analysis; + } + + // Updates the def/use manager if the user requested it. If he did not request + // an update, this function does nothing. + inline void UpdateDefUseMgr(ir::Instruction* insn) { + if (IsAnalysisUpdateRequested(ir::IRContext::kAnalysisDefUse)) + GetContext()->get_def_use_mgr()->AnalyzeInstDefUse(insn); + } + + // Updates the instruction to block analysis if the user requested it. If he + // did not request an update, this function does nothing. + inline void UpdateInstrToBlockMapping(ir::Instruction* insn) { + if (IsAnalysisUpdateRequested( + ir::IRContext::kAnalysisInstrToBlockMapping) && + parent_) + GetContext()->set_instr_block(insn, parent_); + } + + ir::IRContext* context_; + ir::BasicBlock* parent_; + InsertionPointTy insert_before_; + const ir::IRContext::Analysis preserved_analyses_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_IR_BUILDER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/ir_context.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/ir_context.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/ir_context.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/ir_context.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,643 @@ +// Copyright (c) 2017 Google 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. + +#include "ir_context.h" +#include "latest_version_glsl_std_450_header.h" +#include "log.h" +#include "mem_pass.h" +#include "reflect.h" + +#include + +namespace spvtools { +namespace ir { + +void IRContext::BuildInvalidAnalyses(IRContext::Analysis set) { + if (set & kAnalysisDefUse) { + BuildDefUseManager(); + } + if (set & kAnalysisInstrToBlockMapping) { + BuildInstrToBlockMapping(); + } + if (set & kAnalysisDecorations) { + BuildDecorationManager(); + } + if (set & kAnalysisCFG) { + BuildCFG(); + } + if (set & kAnalysisDominatorAnalysis) { + ResetDominatorAnalysis(); + } + if (set & kAnalysisLoopAnalysis) { + ResetLoopAnalysis(); + } + if (set & kAnalysisNameMap) { + BuildIdToNameMap(); + } + if (set & kAnalysisScalarEvolution) { + BuildScalarEvolutionAnalysis(); + } +} + +void IRContext::InvalidateAnalysesExceptFor( + IRContext::Analysis preserved_analyses) { + uint32_t analyses_to_invalidate = valid_analyses_ & (~preserved_analyses); + InvalidateAnalyses(static_cast(analyses_to_invalidate)); +} + +void IRContext::InvalidateAnalyses(IRContext::Analysis analyses_to_invalidate) { + if (analyses_to_invalidate & kAnalysisDefUse) { + def_use_mgr_.reset(nullptr); + } + if (analyses_to_invalidate & kAnalysisInstrToBlockMapping) { + instr_to_block_.clear(); + } + if (analyses_to_invalidate & kAnalysisDecorations) { + decoration_mgr_.reset(nullptr); + } + if (analyses_to_invalidate & kAnalysisCombinators) { + combinator_ops_.clear(); + } + if (analyses_to_invalidate & kAnalysisCFG) { + cfg_.reset(nullptr); + } + if (analyses_to_invalidate & kAnalysisDominatorAnalysis) { + dominator_trees_.clear(); + post_dominator_trees_.clear(); + } + if (analyses_to_invalidate & kAnalysisNameMap) { + id_to_name_.reset(nullptr); + } + + valid_analyses_ = Analysis(valid_analyses_ & ~analyses_to_invalidate); +} + +Instruction* IRContext::KillInst(ir::Instruction* inst) { + if (!inst) { + return nullptr; + } + + KillNamesAndDecorates(inst); + + if (AreAnalysesValid(kAnalysisDefUse)) { + get_def_use_mgr()->ClearInst(inst); + } + if (AreAnalysesValid(kAnalysisInstrToBlockMapping)) { + instr_to_block_.erase(inst); + } + if (AreAnalysesValid(kAnalysisDecorations)) { + if (inst->result_id() != 0) { + decoration_mgr_->RemoveDecorationsFrom(inst->result_id()); + } + if (inst->IsDecoration()) { + decoration_mgr_->RemoveDecoration(inst); + } + } + + if (type_mgr_ && ir::IsTypeInst(inst->opcode())) { + type_mgr_->RemoveId(inst->result_id()); + } + + if (constant_mgr_ && ir::IsConstantInst(inst->opcode())) { + constant_mgr_->RemoveId(inst->result_id()); + } + + RemoveFromIdToName(inst); + + Instruction* next_instruction = nullptr; + if (inst->IsInAList()) { + next_instruction = inst->NextNode(); + inst->RemoveFromList(); + delete inst; + } else { + // Needed for instructions that are not part of a list like OpLabels, + // OpFunction, OpFunctionEnd, etc.. + inst->ToNop(); + } + return next_instruction; +} + +bool IRContext::KillDef(uint32_t id) { + ir::Instruction* def = get_def_use_mgr()->GetDef(id); + if (def != nullptr) { + KillInst(def); + return true; + } + return false; +} + +bool IRContext::ReplaceAllUsesWith(uint32_t before, uint32_t after) { + if (before == after) return false; + + // Ensure that |after| has been registered as def. + assert(get_def_use_mgr()->GetDef(after) && + "'after' is not a registered def."); + + std::vector> uses_to_update; + get_def_use_mgr()->ForEachUse( + before, [&uses_to_update](ir::Instruction* user, uint32_t index) { + uses_to_update.emplace_back(user, index); + }); + + ir::Instruction* prev = nullptr; + for (auto p : uses_to_update) { + ir::Instruction* user = p.first; + uint32_t index = p.second; + if (prev == nullptr || prev != user) { + ForgetUses(user); + prev = user; + } + const uint32_t type_result_id_count = + (user->result_id() != 0) + (user->type_id() != 0); + + if (index < type_result_id_count) { + // Update the type_id. Note that result id is immutable so it should + // never be updated. + if (user->type_id() != 0 && index == 0) { + user->SetResultType(after); + } else if (user->type_id() == 0) { + SPIRV_ASSERT(consumer_, false, + "Result type id considered as use while the instruction " + "doesn't have a result type id."); + (void)consumer_; // Makes the compiler happy for release build. + } else { + SPIRV_ASSERT(consumer_, false, + "Trying setting the immutable result id."); + } + } else { + // Update an in-operand. + uint32_t in_operand_pos = index - type_result_id_count; + // Make the modification in the instruction. + user->SetInOperand(in_operand_pos, {after}); + } + AnalyzeUses(user); + }; + + return true; +} + +bool IRContext::IsConsistent() { +#ifndef SPIRV_CHECK_CONTEXT + return true; +#endif + + if (AreAnalysesValid(kAnalysisDefUse)) { + opt::analysis::DefUseManager new_def_use(module()); + if (*get_def_use_mgr() != new_def_use) { + return false; + } + } + + if (AreAnalysesValid(kAnalysisInstrToBlockMapping)) { + for (auto& func : *module()) { + for (auto& block : func) { + if (!block.WhileEachInst([this, &block](ir::Instruction* inst) { + if (get_instr_block(inst) != &block) { + return false; + } + return true; + })) + return false; + } + } + } + + if (!CheckCFG()) { + return false; + } + + return true; +} + +void spvtools::ir::IRContext::ForgetUses(Instruction* inst) { + if (AreAnalysesValid(kAnalysisDefUse)) { + get_def_use_mgr()->EraseUseRecordsOfOperandIds(inst); + } + if (AreAnalysesValid(kAnalysisDecorations)) { + if (inst->IsDecoration()) { + get_decoration_mgr()->RemoveDecoration(inst); + } + } + RemoveFromIdToName(inst); +} + +void IRContext::AnalyzeUses(Instruction* inst) { + if (AreAnalysesValid(kAnalysisDefUse)) { + get_def_use_mgr()->AnalyzeInstUse(inst); + } + if (AreAnalysesValid(kAnalysisDecorations)) { + if (inst->IsDecoration()) { + get_decoration_mgr()->AddDecoration(inst); + } + } + if (id_to_name_ && + (inst->opcode() == SpvOpName || inst->opcode() == SpvOpMemberName)) { + id_to_name_->insert({inst->GetSingleWordInOperand(0), inst}); + } +} + +void IRContext::KillNamesAndDecorates(uint32_t id) { + std::vector decorations = + get_decoration_mgr()->GetDecorationsFor(id, true); + + for (Instruction* inst : decorations) { + KillInst(inst); + } + + std::vector name_to_kill; + for (auto name : GetNames(id)) { + name_to_kill.push_back(name.second); + } + for (ir::Instruction* name_inst : name_to_kill) { + KillInst(name_inst); + } +} + +void IRContext::KillNamesAndDecorates(Instruction* inst) { + const uint32_t rId = inst->result_id(); + if (rId == 0) return; + KillNamesAndDecorates(rId); +} + +void IRContext::AddCombinatorsForCapability(uint32_t capability) { + if (capability == SpvCapabilityShader) { + combinator_ops_[0].insert({ + SpvOpNop, + SpvOpUndef, + SpvOpConstant, + SpvOpConstantTrue, + SpvOpConstantFalse, + SpvOpConstantComposite, + SpvOpConstantSampler, + SpvOpConstantNull, + SpvOpTypeVoid, + SpvOpTypeBool, + SpvOpTypeInt, + SpvOpTypeFloat, + SpvOpTypeVector, + SpvOpTypeMatrix, + SpvOpTypeImage, + SpvOpTypeSampler, + SpvOpTypeSampledImage, + SpvOpTypeArray, + SpvOpTypeRuntimeArray, + SpvOpTypeStruct, + SpvOpTypeOpaque, + SpvOpTypePointer, + SpvOpTypeFunction, + SpvOpTypeEvent, + SpvOpTypeDeviceEvent, + SpvOpTypeReserveId, + SpvOpTypeQueue, + SpvOpTypePipe, + SpvOpTypeForwardPointer, + SpvOpVariable, + SpvOpImageTexelPointer, + SpvOpLoad, + SpvOpAccessChain, + SpvOpInBoundsAccessChain, + SpvOpArrayLength, + SpvOpVectorExtractDynamic, + SpvOpVectorInsertDynamic, + SpvOpVectorShuffle, + SpvOpCompositeConstruct, + SpvOpCompositeExtract, + SpvOpCompositeInsert, + SpvOpCopyObject, + SpvOpTranspose, + SpvOpSampledImage, + SpvOpImageSampleImplicitLod, + SpvOpImageSampleExplicitLod, + SpvOpImageSampleDrefImplicitLod, + SpvOpImageSampleDrefExplicitLod, + SpvOpImageSampleProjImplicitLod, + SpvOpImageSampleProjExplicitLod, + SpvOpImageSampleProjDrefImplicitLod, + SpvOpImageSampleProjDrefExplicitLod, + SpvOpImageFetch, + SpvOpImageGather, + SpvOpImageDrefGather, + SpvOpImageRead, + SpvOpImage, + SpvOpConvertFToU, + SpvOpConvertFToS, + SpvOpConvertSToF, + SpvOpConvertUToF, + SpvOpUConvert, + SpvOpSConvert, + SpvOpFConvert, + SpvOpQuantizeToF16, + SpvOpBitcast, + SpvOpSNegate, + SpvOpFNegate, + SpvOpIAdd, + SpvOpFAdd, + SpvOpISub, + SpvOpFSub, + SpvOpIMul, + SpvOpFMul, + SpvOpUDiv, + SpvOpSDiv, + SpvOpFDiv, + SpvOpUMod, + SpvOpSRem, + SpvOpSMod, + SpvOpFRem, + SpvOpFMod, + SpvOpVectorTimesScalar, + SpvOpMatrixTimesScalar, + SpvOpVectorTimesMatrix, + SpvOpMatrixTimesVector, + SpvOpMatrixTimesMatrix, + SpvOpOuterProduct, + SpvOpDot, + SpvOpIAddCarry, + SpvOpISubBorrow, + SpvOpUMulExtended, + SpvOpSMulExtended, + SpvOpAny, + SpvOpAll, + SpvOpIsNan, + SpvOpIsInf, + SpvOpLogicalEqual, + SpvOpLogicalNotEqual, + SpvOpLogicalOr, + SpvOpLogicalAnd, + SpvOpLogicalNot, + SpvOpSelect, + SpvOpIEqual, + SpvOpINotEqual, + SpvOpUGreaterThan, + SpvOpSGreaterThan, + SpvOpUGreaterThanEqual, + SpvOpSGreaterThanEqual, + SpvOpULessThan, + SpvOpSLessThan, + SpvOpULessThanEqual, + SpvOpSLessThanEqual, + SpvOpFOrdEqual, + SpvOpFUnordEqual, + SpvOpFOrdNotEqual, + SpvOpFUnordNotEqual, + SpvOpFOrdLessThan, + SpvOpFUnordLessThan, + SpvOpFOrdGreaterThan, + SpvOpFUnordGreaterThan, + SpvOpFOrdLessThanEqual, + SpvOpFUnordLessThanEqual, + SpvOpFOrdGreaterThanEqual, + SpvOpFUnordGreaterThanEqual, + SpvOpShiftRightLogical, + SpvOpShiftRightArithmetic, + SpvOpShiftLeftLogical, + SpvOpBitwiseOr, + SpvOpBitwiseXor, + SpvOpBitwiseAnd, + SpvOpNot, + SpvOpBitFieldInsert, + SpvOpBitFieldSExtract, + SpvOpBitFieldUExtract, + SpvOpBitReverse, + SpvOpBitCount, + SpvOpPhi, + SpvOpImageSparseSampleImplicitLod, + SpvOpImageSparseSampleExplicitLod, + SpvOpImageSparseSampleDrefImplicitLod, + SpvOpImageSparseSampleDrefExplicitLod, + SpvOpImageSparseSampleProjImplicitLod, + SpvOpImageSparseSampleProjExplicitLod, + SpvOpImageSparseSampleProjDrefImplicitLod, + SpvOpImageSparseSampleProjDrefExplicitLod, + SpvOpImageSparseFetch, + SpvOpImageSparseGather, + SpvOpImageSparseDrefGather, + SpvOpImageSparseTexelsResident, + SpvOpImageSparseRead, + SpvOpSizeOf + // TODO(dneto): Add instructions enabled by ImageQuery + }); + } +} + +void IRContext::AddCombinatorsForExtension(ir::Instruction* extension) { + assert(extension->opcode() == SpvOpExtInstImport && + "Expecting an import of an extension's instruction set."); + const char* extension_name = + reinterpret_cast(&extension->GetInOperand(0).words[0]); + if (!strcmp(extension_name, "GLSL.std.450")) { + combinator_ops_[extension->result_id()] = {GLSLstd450Round, + GLSLstd450RoundEven, + GLSLstd450Trunc, + GLSLstd450FAbs, + GLSLstd450SAbs, + GLSLstd450FSign, + GLSLstd450SSign, + GLSLstd450Floor, + GLSLstd450Ceil, + GLSLstd450Fract, + GLSLstd450Radians, + GLSLstd450Degrees, + GLSLstd450Sin, + GLSLstd450Cos, + GLSLstd450Tan, + GLSLstd450Asin, + GLSLstd450Acos, + GLSLstd450Atan, + GLSLstd450Sinh, + GLSLstd450Cosh, + GLSLstd450Tanh, + GLSLstd450Asinh, + GLSLstd450Acosh, + GLSLstd450Atanh, + GLSLstd450Atan2, + GLSLstd450Pow, + GLSLstd450Exp, + GLSLstd450Log, + GLSLstd450Exp2, + GLSLstd450Log2, + GLSLstd450Sqrt, + GLSLstd450InverseSqrt, + GLSLstd450Determinant, + GLSLstd450MatrixInverse, + GLSLstd450ModfStruct, + GLSLstd450FMin, + GLSLstd450UMin, + GLSLstd450SMin, + GLSLstd450FMax, + GLSLstd450UMax, + GLSLstd450SMax, + GLSLstd450FClamp, + GLSLstd450UClamp, + GLSLstd450SClamp, + GLSLstd450FMix, + GLSLstd450IMix, + GLSLstd450Step, + GLSLstd450SmoothStep, + GLSLstd450Fma, + GLSLstd450FrexpStruct, + GLSLstd450Ldexp, + GLSLstd450PackSnorm4x8, + GLSLstd450PackUnorm4x8, + GLSLstd450PackSnorm2x16, + GLSLstd450PackUnorm2x16, + GLSLstd450PackHalf2x16, + GLSLstd450PackDouble2x32, + GLSLstd450UnpackSnorm2x16, + GLSLstd450UnpackUnorm2x16, + GLSLstd450UnpackHalf2x16, + GLSLstd450UnpackSnorm4x8, + GLSLstd450UnpackUnorm4x8, + GLSLstd450UnpackDouble2x32, + GLSLstd450Length, + GLSLstd450Distance, + GLSLstd450Cross, + GLSLstd450Normalize, + GLSLstd450FaceForward, + GLSLstd450Reflect, + GLSLstd450Refract, + GLSLstd450FindILsb, + GLSLstd450FindSMsb, + GLSLstd450FindUMsb, + GLSLstd450InterpolateAtCentroid, + GLSLstd450InterpolateAtSample, + GLSLstd450InterpolateAtOffset, + GLSLstd450NMin, + GLSLstd450NMax, + GLSLstd450NClamp}; + } else { + // Map the result id to the empty set. + combinator_ops_[extension->result_id()]; + } +} + +void IRContext::InitializeCombinators() { + get_feature_mgr()->GetCapabilities()->ForEach( + [this](SpvCapability cap) { AddCombinatorsForCapability(cap); }); + + for (auto& extension : module()->ext_inst_imports()) { + AddCombinatorsForExtension(&extension); + } + + valid_analyses_ |= kAnalysisCombinators; +} + +void IRContext::RemoveFromIdToName(const Instruction* inst) { + if (id_to_name_ && + (inst->opcode() == SpvOpName || inst->opcode() == SpvOpMemberName)) { + auto range = id_to_name_->equal_range(inst->GetSingleWordInOperand(0)); + for (auto it = range.first; it != range.second; ++it) { + if (it->second == inst) { + id_to_name_->erase(it); + break; + } + } + } +} + +ir::LoopDescriptor* IRContext::GetLoopDescriptor(const ir::Function* f) { + if (!AreAnalysesValid(kAnalysisLoopAnalysis)) { + ResetLoopAnalysis(); + } + + std::unordered_map::iterator it = + loop_descriptors_.find(f); + if (it == loop_descriptors_.end()) { + return &loop_descriptors_.emplace(std::make_pair(f, ir::LoopDescriptor(f))) + .first->second; + } + + return &it->second; +} + +// Gets the dominator analysis for function |f|. +opt::DominatorAnalysis* IRContext::GetDominatorAnalysis(const ir::Function* f, + const ir::CFG& in_cfg) { + if (!AreAnalysesValid(kAnalysisDominatorAnalysis)) { + ResetDominatorAnalysis(); + } + + if (dominator_trees_.find(f) == dominator_trees_.end()) { + dominator_trees_[f].InitializeTree(f, in_cfg); + } + + return &dominator_trees_[f]; +} + +// Gets the postdominator analysis for function |f|. +opt::PostDominatorAnalysis* IRContext::GetPostDominatorAnalysis( + const ir::Function* f, const ir::CFG& in_cfg) { + if (!AreAnalysesValid(kAnalysisDominatorAnalysis)) { + ResetDominatorAnalysis(); + } + + if (post_dominator_trees_.find(f) == post_dominator_trees_.end()) { + post_dominator_trees_[f].InitializeTree(f, in_cfg); + } + + return &post_dominator_trees_[f]; +} + +bool ir::IRContext::CheckCFG() { + std::unordered_map> real_preds; + if (!AreAnalysesValid(kAnalysisCFG)) { + return true; + } + + for (ir::Function& function : *module()) { + for (const auto& bb : function) { + bb.ForEachSuccessorLabel([&bb, &real_preds](const uint32_t lab_id) { + real_preds[lab_id].push_back(bb.id()); + }); + } + + for (auto& bb : function) { + std::vector preds = cfg()->preds(bb.id()); + std::vector real = real_preds[bb.id()]; + std::sort(preds.begin(), preds.end()); + std::sort(real.begin(), real.end()); + + bool same = true; + if (preds.size() != real.size()) { + same = false; + } + + for (size_t i = 0; i < real.size() && same; i++) { + if (preds[i] != real[i]) { + same = false; + } + } + + if (!same) { + std::cerr << "Predecessors for " << bb.id() << " are different:\n"; + + std::cerr << "Real:"; + for (uint32_t i : real) { + std::cerr << ' ' << i; + } + std::cerr << std::endl; + + std::cerr << "Recorded:"; + for (uint32_t i : preds) { + std::cerr << ' ' << i; + } + std::cerr << std::endl; + } + if (!same) return false; + } + } + + return true; +} +} // namespace ir +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/ir_context.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/ir_context.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/ir_context.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/ir_context.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,809 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SPIRV_TOOLS_IR_CONTEXT_H +#define SPIRV_TOOLS_IR_CONTEXT_H + +#include "assembly_grammar.h" +#include "cfg.h" +#include "constants.h" +#include "decoration_manager.h" +#include "def_use_manager.h" +#include "dominator_analysis.h" +#include "feature_manager.h" +#include "loop_descriptor.h" +#include "module.h" +#include "scalar_analysis.h" +#include "type_manager.h" + +#include +#include +#include +#include + +namespace spvtools { +namespace ir { + +class IRContext { + public: + // Available analyses. + // + // When adding a new analysis: + // + // 1. Enum values should be powers of 2. These are cast into uint32_t + // bitmasks, so we can have at most 31 analyses represented. + // + // 2. Make sure it gets invalidated or preserved by IRContext methods that add + // or remove IR elements (e.g., KillDef, KillInst, ReplaceAllUsesWith). + // + // 3. Add handling code in BuildInvalidAnalyses and InvalidateAnalyses + enum Analysis { + kAnalysisNone = 0 << 0, + kAnalysisBegin = 1 << 0, + kAnalysisDefUse = kAnalysisBegin, + kAnalysisInstrToBlockMapping = 1 << 1, + kAnalysisDecorations = 1 << 2, + kAnalysisCombinators = 1 << 3, + kAnalysisCFG = 1 << 4, + kAnalysisDominatorAnalysis = 1 << 5, + kAnalysisLoopAnalysis = 1 << 6, + kAnalysisNameMap = 1 << 7, + kAnalysisScalarEvolution = 1 << 8, + kAnalysisEnd = 1 << 9 + }; + + friend inline Analysis operator|(Analysis lhs, Analysis rhs); + friend inline Analysis& operator|=(Analysis& lhs, Analysis rhs); + friend inline Analysis operator<<(Analysis a, int shift); + friend inline Analysis& operator<<=(Analysis& a, int shift); + + // Creates an |IRContext| that contains an owned |Module| + IRContext(spv_target_env env, spvtools::MessageConsumer c) + : syntax_context_(spvContextCreate(env)), + grammar_(syntax_context_), + unique_id_(0), + module_(new Module()), + consumer_(std::move(c)), + def_use_mgr_(nullptr), + valid_analyses_(kAnalysisNone), + constant_mgr_(nullptr), + type_mgr_(nullptr), + id_to_name_(nullptr) { + libspirv::SetContextMessageConsumer(syntax_context_, consumer_); + module_->SetContext(this); + } + + IRContext(spv_target_env env, std::unique_ptr&& m, + spvtools::MessageConsumer c) + : syntax_context_(spvContextCreate(env)), + grammar_(syntax_context_), + unique_id_(0), + module_(std::move(m)), + consumer_(std::move(c)), + def_use_mgr_(nullptr), + valid_analyses_(kAnalysisNone), + type_mgr_(nullptr), + id_to_name_(nullptr) { + libspirv::SetContextMessageConsumer(syntax_context_, consumer_); + module_->SetContext(this); + InitializeCombinators(); + } + + ~IRContext() { spvContextDestroy(syntax_context_); } + + Module* module() const { return module_.get(); } + + // Returns a vector of pointers to constant-creation instructions in this + // context. + inline std::vector GetConstants(); + inline std::vector GetConstants() const; + + // Iterators for annotation instructions contained in this context. + inline Module::inst_iterator annotation_begin(); + inline Module::inst_iterator annotation_end(); + inline IteratorRange annotations(); + inline IteratorRange annotations() const; + + // Iterators for capabilities instructions contained in this module. + inline Module::inst_iterator capability_begin(); + inline Module::inst_iterator capability_end(); + inline IteratorRange capabilities(); + inline IteratorRange capabilities() const; + + // Iterators for types, constants and global variables instructions. + inline ir::Module::inst_iterator types_values_begin(); + inline ir::Module::inst_iterator types_values_end(); + inline IteratorRange types_values(); + inline IteratorRange types_values() const; + + // Iterators for extension instructions contained in this module. + inline Module::inst_iterator ext_inst_import_begin(); + inline Module::inst_iterator ext_inst_import_end(); + inline IteratorRange ext_inst_imports(); + inline IteratorRange ext_inst_imports() const; + + // There are several kinds of debug instructions, according to where they can + // appear in the logical layout of a module: + // - Section 7a: OpString, OpSourceExtension, OpSource, OpSourceContinued + // - Section 7b: OpName, OpMemberName + // - Section 7c: OpModuleProcessed + // - Mostly anywhere: OpLine and OpNoLine + // + + // Iterators for debug 1 instructions (excluding OpLine & OpNoLine) contained + // in this module. These are for layout section 7a. + inline Module::inst_iterator debug1_begin(); + inline Module::inst_iterator debug1_end(); + inline IteratorRange debugs1(); + inline IteratorRange debugs1() const; + + // Iterators for debug 2 instructions (excluding OpLine & OpNoLine) contained + // in this module. These are for layout section 7b. + inline Module::inst_iterator debug2_begin(); + inline Module::inst_iterator debug2_end(); + inline IteratorRange debugs2(); + inline IteratorRange debugs2() const; + + // Iterators for debug 3 instructions (excluding OpLine & OpNoLine) contained + // in this module. These are for layout section 7c. + inline Module::inst_iterator debug3_begin(); + inline Module::inst_iterator debug3_end(); + inline IteratorRange debugs3(); + inline IteratorRange debugs3() const; + + // Clears all debug instructions (excluding OpLine & OpNoLine). + inline void debug_clear(); + + // Appends a capability instruction to this module. + inline void AddCapability(std::unique_ptr&& c); + // Appends an extension instruction to this module. + inline void AddExtension(std::unique_ptr&& e); + // Appends an extended instruction set instruction to this module. + inline void AddExtInstImport(std::unique_ptr&& e); + // Set the memory model for this module. + inline void SetMemoryModel(std::unique_ptr&& m); + // Appends an entry point instruction to this module. + inline void AddEntryPoint(std::unique_ptr&& e); + // Appends an execution mode instruction to this module. + inline void AddExecutionMode(std::unique_ptr&& e); + // Appends a debug 1 instruction (excluding OpLine & OpNoLine) to this module. + // "debug 1" instructions are the ones in layout section 7.a), see section + // 2.4 Logical Layout of a Module from the SPIR-V specification. + inline void AddDebug1Inst(std::unique_ptr&& d); + // Appends a debug 2 instruction (excluding OpLine & OpNoLine) to this module. + // "debug 2" instructions are the ones in layout section 7.b), see section + // 2.4 Logical Layout of a Module from the SPIR-V specification. + inline void AddDebug2Inst(std::unique_ptr&& d); + // Appends a debug 3 instruction (OpModuleProcessed) to this module. + // This is due to decision by the SPIR Working Group, pending publication. + inline void AddDebug3Inst(std::unique_ptr&& d); + // Appends an annotation instruction to this module. + inline void AddAnnotationInst(std::unique_ptr&& a); + // Appends a type-declaration instruction to this module. + inline void AddType(std::unique_ptr&& t); + // Appends a constant, global variable, or OpUndef instruction to this module. + inline void AddGlobalValue(std::unique_ptr&& v); + // Appends a function to this module. + inline void AddFunction(std::unique_ptr&& f); + + // Returns a pointer to a def-use manager. If the def-use manager is + // invalid, it is rebuilt first. + opt::analysis::DefUseManager* get_def_use_mgr() { + if (!AreAnalysesValid(kAnalysisDefUse)) { + BuildDefUseManager(); + } + return def_use_mgr_.get(); + } + + // Returns the basic block for instruction |instr|. Re-builds the instruction + // block map, if needed. + ir::BasicBlock* get_instr_block(ir::Instruction* instr) { + if (!AreAnalysesValid(kAnalysisInstrToBlockMapping)) { + BuildInstrToBlockMapping(); + } + auto entry = instr_to_block_.find(instr); + return (entry != instr_to_block_.end()) ? entry->second : nullptr; + } + + // Returns the basic block for |id|. Re-builds the instruction block map, if + // needed. + // + // |id| must be a registered definition. + ir::BasicBlock* get_instr_block(uint32_t id) { + ir::Instruction* def = get_def_use_mgr()->GetDef(id); + return get_instr_block(def); + } + + // Sets the basic block for |inst|. Re-builds the mapping if it has become + // invalid. + void set_instr_block(ir::Instruction* inst, ir::BasicBlock* block) { + if (AreAnalysesValid(kAnalysisInstrToBlockMapping)) { + instr_to_block_[inst] = block; + } + } + + // Returns a pointer the decoration manager. If the decoration manger is + // invalid, it is rebuilt first. + opt::analysis::DecorationManager* get_decoration_mgr() { + if (!AreAnalysesValid(kAnalysisDecorations)) { + BuildDecorationManager(); + } + return decoration_mgr_.get(); + }; + + // Returns a pointer to the constant manager. If no constant manager has been + // created yet, it creates one. NOTE: Once created, the constant manager + // remains active and it is never re-built. + opt::analysis::ConstantManager* get_constant_mgr() { + if (!constant_mgr_) + constant_mgr_.reset(new opt::analysis::ConstantManager(this)); + return constant_mgr_.get(); + } + + // Returns a pointer to the type manager. If no type manager has been created + // yet, it creates one. NOTE: Once created, the type manager remains active it + // is never re-built. + opt::analysis::TypeManager* get_type_mgr() { + if (!type_mgr_) + type_mgr_.reset(new opt::analysis::TypeManager(consumer(), this)); + return type_mgr_.get(); + } + + // Returns a pointer to the scalar evolution analysis. If it is invalid it + // will be rebuilt first. + opt::ScalarEvolutionAnalysis* GetScalarEvolutionAnalysis() { + if (!AreAnalysesValid(kAnalysisScalarEvolution)) { + BuildScalarEvolutionAnalysis(); + } + return scalar_evolution_analysis_.get(); + } + + // Build the map from the ids to the OpName and OpMemberName instruction + // associated with it. + inline void BuildIdToNameMap(); + + // Returns a range of instrucions that contain all of the OpName and + // OpMemberNames associated with the given id. + inline IteratorRange::iterator> + GetNames(uint32_t id); + + // Sets the message consumer to the given |consumer|. |consumer| which will be + // invoked every time there is a message to be communicated to the outside. + void SetMessageConsumer(spvtools::MessageConsumer c) { + consumer_ = std::move(c); + } + + // Returns the reference to the message consumer for this pass. + const spvtools::MessageConsumer& consumer() const { return consumer_; } + + // Rebuilds the analyses in |set| that are invalid. + void BuildInvalidAnalyses(Analysis set); + + // Invalidates all of the analyses except for those in |preserved_analyses|. + void InvalidateAnalysesExceptFor(Analysis preserved_analyses); + + // Invalidates the analyses marked in |analyses_to_invalidate|. + void InvalidateAnalyses(Analysis analyses_to_invalidate); + + // Deletes the instruction defining the given |id|. Returns true on + // success, false if the given |id| is not defined at all. This method also + // erases the name, decorations, and defintion of |id|. + // + // Pointers and iterators pointing to the deleted instructions become invalid. + // However other pointers and iterators are still valid. + bool KillDef(uint32_t id); + + // Deletes the given instruction |inst|. This method erases the + // information of the given instruction's uses of its operands. If |inst| + // defines a result id, its name and decorations will also be deleted. + // + // Pointer and iterator pointing to the deleted instructions become invalid. + // However other pointers and iterators are still valid. + // + // Note that if an instruction is not in an instruction list, the memory may + // not be safe to delete, so the instruction is turned into a OpNop instead. + // This can happen with OpLabel. + // + // Returns a pointer to the instruction after |inst| or |nullptr| if no such + // instruction exists. + Instruction* KillInst(ir::Instruction* inst); + + // Returns true if all of the given analyses are valid. + bool AreAnalysesValid(Analysis set) { return (set & valid_analyses_) == set; } + + // Replaces all uses of |before| id with |after| id. Returns true if any + // replacement happens. This method does not kill the definition of the + // |before| id. If |after| is the same as |before|, does nothing and returns + // false. + // + // |before| and |after| must be registered definitions in the DefUseManager. + bool ReplaceAllUsesWith(uint32_t before, uint32_t after); + + // Returns true if all of the analyses that are suppose to be valid are + // actually valid. + bool IsConsistent(); + + // The IRContext will look at the def and uses of |inst| and update any valid + // analyses will be updated accordingly. + inline void AnalyzeDefUse(Instruction* inst); + + // Informs the IRContext that the uses of |inst| are going to change, and that + // is should forget everything it know about the current uses. Any valid + // analyses will be updated accordingly. + void ForgetUses(Instruction* inst); + + // The IRContext will look at the uses of |inst| and update any valid analyses + // will be updated accordingly. + void AnalyzeUses(Instruction* inst); + + // Kill all name and decorate ops targeting |id|. + void KillNamesAndDecorates(uint32_t id); + + // Kill all name and decorate ops targeting the result id of |inst|. + void KillNamesAndDecorates(ir::Instruction* inst); + + // Returns the next unique id for use by an instruction. + inline uint32_t TakeNextUniqueId() { + assert(unique_id_ != std::numeric_limits::max()); + + // Skip zero. + return ++unique_id_; + } + + // Returns true if |inst| is a combinator in the current context. + // |combinator_ops_| is built if it has not been already. + inline bool IsCombinatorInstruction(ir::Instruction* inst) { + if (!AreAnalysesValid(kAnalysisCombinators)) { + InitializeCombinators(); + } + const uint32_t kExtInstSetIdInIndx = 0; + const uint32_t kExtInstInstructionInIndx = 1; + + if (inst->opcode() != SpvOpExtInst) { + return combinator_ops_[0].count(inst->opcode()) != 0; + } else { + uint32_t set = inst->GetSingleWordInOperand(kExtInstSetIdInIndx); + uint32_t op = inst->GetSingleWordInOperand(kExtInstInstructionInIndx); + return combinator_ops_[set].count(op) != 0; + } + } + + // Returns a pointer to the CFG for all the functions in |module_|. + ir::CFG* cfg() { + if (!AreAnalysesValid(kAnalysisCFG)) { + BuildCFG(); + } + return cfg_.get(); + } + + // Gets the loop descriptor for function |f|. + ir::LoopDescriptor* GetLoopDescriptor(const ir::Function* f); + + // Gets the dominator analysis for function |f|. + opt::DominatorAnalysis* GetDominatorAnalysis(const ir::Function* f, + const ir::CFG&); + + // Gets the postdominator analysis for function |f|. + opt::PostDominatorAnalysis* GetPostDominatorAnalysis(const ir::Function* f, + const ir::CFG&); + + // Remove the dominator tree of |f| from the cache. + inline void RemoveDominatorAnalysis(const ir::Function* f) { + dominator_trees_.erase(f); + } + + // Remove the postdominator tree of |f| from the cache. + inline void RemovePostDominatorAnalysis(const ir::Function* f) { + post_dominator_trees_.erase(f); + } + + // Return the next available SSA id and increment it. + inline uint32_t TakeNextId() { return module()->TakeNextIdBound(); } + + opt::FeatureManager* get_feature_mgr() { + if (!feature_mgr_.get()) { + AnalyzeFeatures(); + } + return feature_mgr_.get(); + } + + // Returns the grammar for this context. + const libspirv::AssemblyGrammar& grammar() const { return grammar_; } + + // If |inst| has not yet been analysed by the def-use manager, then analyse + // its definitions and uses. + inline void UpdateDefUse(Instruction* inst); + + private: + // Builds the def-use manager from scratch, even if it was already valid. + void BuildDefUseManager() { + def_use_mgr_.reset(new opt::analysis::DefUseManager(module())); + valid_analyses_ = valid_analyses_ | kAnalysisDefUse; + } + + // Builds the instruction-block map for the whole module. + void BuildInstrToBlockMapping() { + instr_to_block_.clear(); + for (auto& fn : *module_) { + for (auto& block : fn) { + block.ForEachInst([this, &block](ir::Instruction* inst) { + instr_to_block_[inst] = █ + }); + } + } + valid_analyses_ = valid_analyses_ | kAnalysisInstrToBlockMapping; + } + + void BuildDecorationManager() { + decoration_mgr_.reset(new opt::analysis::DecorationManager(module())); + valid_analyses_ = valid_analyses_ | kAnalysisDecorations; + } + + void BuildCFG() { + cfg_.reset(new ir::CFG(module())); + valid_analyses_ = valid_analyses_ | kAnalysisCFG; + } + + void BuildScalarEvolutionAnalysis() { + scalar_evolution_analysis_.reset(new opt::ScalarEvolutionAnalysis(this)); + valid_analyses_ = valid_analyses_ | kAnalysisScalarEvolution; + } + + // Removes all computed dominator and post-dominator trees. This will force + // the context to rebuild the trees on demand. + void ResetDominatorAnalysis() { + // Clear the cache. + dominator_trees_.clear(); + post_dominator_trees_.clear(); + valid_analyses_ = valid_analyses_ | kAnalysisDominatorAnalysis; + } + + // Removes all computed loop descriptors. + void ResetLoopAnalysis() { + // Clear the cache. + loop_descriptors_.clear(); + valid_analyses_ = valid_analyses_ | kAnalysisLoopAnalysis; + } + + // Analyzes the features in the owned module. Builds the manager if required. + void AnalyzeFeatures() { + feature_mgr_.reset(new opt::FeatureManager(grammar_)); + feature_mgr_->Analyze(module()); + } + + // Scans a module looking for it capabilities, and initializes combinator_ops_ + // accordingly. + void InitializeCombinators(); + + // Add the combinator opcode for the given capability to combinator_ops_. + void AddCombinatorsForCapability(uint32_t capability); + + // Add the combinator opcode for the given extension to combinator_ops_. + void AddCombinatorsForExtension(ir::Instruction* extension); + + // Remove |inst| from |id_to_name_| if it is in map. + void RemoveFromIdToName(const Instruction* inst); + + // Returns true if it is suppose to be valid but it is incorrect. Returns + // true if the cfg is invalidated. + bool CheckCFG(); + + // The SPIR-V syntax context containing grammar tables for opcodes and + // operands. + spv_context syntax_context_; + + // Auxiliary object for querying SPIR-V grammar facts. + libspirv::AssemblyGrammar grammar_; + + // An unique identifier for instructions in |module_|. Can be used to order + // instructions in a container. + // + // This member is initialized to 0, but always issues this value plus one. + // Therefore, 0 is not a valid unique id for an instruction. + uint32_t unique_id_; + + // The module being processed within this IR context. + std::unique_ptr module_; + + // A message consumer for diagnostics. + spvtools::MessageConsumer consumer_; + + // The def-use manager for |module_|. + std::unique_ptr def_use_mgr_; + + // The instruction decoration manager for |module_|. + std::unique_ptr decoration_mgr_; + std::unique_ptr feature_mgr_; + + // A map from instructions the the basic block they belong to. This mapping is + // built on-demand when get_instr_block() is called. + // + // NOTE: Do not traverse this map. Ever. Use the function and basic block + // iterators to traverse instructions. + std::unordered_map instr_to_block_; + + // A bitset indicating which analyes are currently valid. + Analysis valid_analyses_; + + // Opcodes of shader capability core executable instructions + // without side-effect. + std::unordered_map> combinator_ops_; + + // The CFG for all the functions in |module_|. + std::unique_ptr cfg_; + + // Each function in the module will create its own dominator tree. We cache + // the result so it doesn't need to be rebuilt each time. + std::map dominator_trees_; + std::map + post_dominator_trees_; + + // Cache of loop descriptors for each function. + std::unordered_map loop_descriptors_; + + // Constant manager for |module_|. + std::unique_ptr constant_mgr_; + + // Type manager for |module_|. + std::unique_ptr type_mgr_; + + // A map from an id to its corresponding OpName and OpMemberName instructions. + std::unique_ptr> id_to_name_; + + // The cache scalar evolution analysis node. + std::unique_ptr scalar_evolution_analysis_; +}; + +inline ir::IRContext::Analysis operator|(ir::IRContext::Analysis lhs, + ir::IRContext::Analysis rhs) { + return static_cast(static_cast(lhs) | + static_cast(rhs)); +} + +inline ir::IRContext::Analysis& operator|=(ir::IRContext::Analysis& lhs, + ir::IRContext::Analysis rhs) { + lhs = static_cast(static_cast(lhs) | + static_cast(rhs)); + return lhs; +} + +inline ir::IRContext::Analysis operator<<(ir::IRContext::Analysis a, + int shift) { + return static_cast(static_cast(a) << shift); +} + +inline ir::IRContext::Analysis& operator<<=(ir::IRContext::Analysis& a, + int shift) { + a = static_cast(static_cast(a) << shift); + return a; +} + +std::vector spvtools::ir::IRContext::GetConstants() { + return module()->GetConstants(); +} + +std::vector IRContext::GetConstants() const { + return ((const Module*)module())->GetConstants(); +} + +Module::inst_iterator IRContext::annotation_begin() { + return module()->annotation_begin(); +} + +Module::inst_iterator IRContext::annotation_end() { + return module()->annotation_end(); +} + +IteratorRange IRContext::annotations() { + return module_->annotations(); +} + +IteratorRange IRContext::annotations() const { + return ((const Module*)module_.get())->annotations(); +} + +Module::inst_iterator IRContext::capability_begin() { + return module()->capability_begin(); +} + +Module::inst_iterator IRContext::capability_end() { + return module()->capability_end(); +} + +IteratorRange IRContext::capabilities() { + return module()->capabilities(); +} + +IteratorRange IRContext::capabilities() const { + return ((const Module*)module())->capabilities(); +} + +ir::Module::inst_iterator IRContext::types_values_begin() { + return module()->types_values_begin(); +} + +ir::Module::inst_iterator IRContext::types_values_end() { + return module()->types_values_end(); +} + +IteratorRange IRContext::types_values() { + return module()->types_values(); +} + +IteratorRange IRContext::types_values() const { + return ((const Module*)module_.get())->types_values(); +} + +Module::inst_iterator IRContext::ext_inst_import_begin() { + return module()->ext_inst_import_begin(); +} + +Module::inst_iterator IRContext::ext_inst_import_end() { + return module()->ext_inst_import_end(); +} + +IteratorRange IRContext::ext_inst_imports() { + return module()->ext_inst_imports(); +} + +IteratorRange IRContext::ext_inst_imports() const { + return ((const Module*)module_.get())->ext_inst_imports(); +} + +Module::inst_iterator IRContext::debug1_begin() { + return module()->debug1_begin(); +} + +Module::inst_iterator IRContext::debug1_end() { return module()->debug1_end(); } + +IteratorRange IRContext::debugs1() { + return module()->debugs1(); +} + +IteratorRange IRContext::debugs1() const { + return ((const Module*)module_.get())->debugs1(); +} + +Module::inst_iterator IRContext::debug2_begin() { + return module()->debug2_begin(); +} +Module::inst_iterator IRContext::debug2_end() { return module()->debug2_end(); } + +IteratorRange IRContext::debugs2() { + return module()->debugs2(); +} + +IteratorRange IRContext::debugs2() const { + return ((const Module*)module_.get())->debugs2(); +} + +Module::inst_iterator IRContext::debug3_begin() { + return module()->debug3_begin(); +} + +Module::inst_iterator IRContext::debug3_end() { return module()->debug3_end(); } + +IteratorRange IRContext::debugs3() { + return module()->debugs3(); +} + +IteratorRange IRContext::debugs3() const { + return ((const Module*)module_.get())->debugs3(); +} + +void IRContext::debug_clear() { module_->debug_clear(); } + +void IRContext::AddCapability(std::unique_ptr&& c) { + AddCombinatorsForCapability(c->GetSingleWordInOperand(0)); + module()->AddCapability(std::move(c)); +} + +void IRContext::AddExtension(std::unique_ptr&& e) { + module()->AddExtension(std::move(e)); +} + +void IRContext::AddExtInstImport(std::unique_ptr&& e) { + AddCombinatorsForExtension(e.get()); + module()->AddExtInstImport(std::move(e)); +} + +void IRContext::SetMemoryModel(std::unique_ptr&& m) { + module()->SetMemoryModel(std::move(m)); +} + +void IRContext::AddEntryPoint(std::unique_ptr&& e) { + module()->AddEntryPoint(std::move(e)); +} + +void IRContext::AddExecutionMode(std::unique_ptr&& e) { + module()->AddExecutionMode(std::move(e)); +} + +void IRContext::AddDebug1Inst(std::unique_ptr&& d) { + module()->AddDebug1Inst(std::move(d)); +} + +void IRContext::AddDebug2Inst(std::unique_ptr&& d) { + if (AreAnalysesValid(kAnalysisNameMap)) { + if (d->opcode() == SpvOpName || d->opcode() == SpvOpMemberName) { + id_to_name_->insert({d->result_id(), d.get()}); + } + } + module()->AddDebug2Inst(std::move(d)); +} + +void IRContext::AddDebug3Inst(std::unique_ptr&& d) { + module()->AddDebug3Inst(std::move(d)); +} + +void IRContext::AddAnnotationInst(std::unique_ptr&& a) { + if (AreAnalysesValid(kAnalysisDecorations)) { + get_decoration_mgr()->AddDecoration(a.get()); + } + module()->AddAnnotationInst(std::move(a)); +} + +void IRContext::AddType(std::unique_ptr&& t) { + module()->AddType(std::move(t)); + if (AreAnalysesValid(kAnalysisDefUse)) { + get_def_use_mgr()->AnalyzeInstDef(&*(--types_values_end())); + } +} + +void IRContext::AddGlobalValue(std::unique_ptr&& v) { + module()->AddGlobalValue(std::move(v)); + if (AreAnalysesValid(kAnalysisDefUse)) { + get_def_use_mgr()->AnalyzeInstDef(&*(--types_values_end())); + } +} + +void IRContext::AddFunction(std::unique_ptr&& f) { + module()->AddFunction(std::move(f)); +} + +void IRContext::AnalyzeDefUse(Instruction* inst) { + if (AreAnalysesValid(kAnalysisDefUse)) { + get_def_use_mgr()->AnalyzeInstDefUse(inst); + } +} + +void IRContext::UpdateDefUse(Instruction* inst) { + if (AreAnalysesValid(kAnalysisDefUse)) { + get_def_use_mgr()->UpdateDefUse(inst); + } +} + +void IRContext::BuildIdToNameMap() { + id_to_name_.reset(new std::multimap()); + for (Instruction& debug_inst : debugs2()) { + if (debug_inst.opcode() == SpvOpMemberName || + debug_inst.opcode() == SpvOpName) { + id_to_name_->insert({debug_inst.GetSingleWordInOperand(0), &debug_inst}); + } + } + valid_analyses_ = valid_analyses_ | kAnalysisNameMap; +} + +IteratorRange::iterator> +IRContext::GetNames(uint32_t id) { + if (!AreAnalysesValid(kAnalysisNameMap)) { + BuildIdToNameMap(); + } + auto result = id_to_name_->equal_range(id); + return make_range(std::move(result.first), std::move(result.second)); +} + +} // namespace ir +} // namespace spvtools +#endif // SPIRV_TOOLS_IR_CONTEXT_H diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/ir_loader.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/ir_loader.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/ir_loader.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/ir_loader.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,161 @@ +// Copyright (c) 2016 Google 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. + +#include "ir_loader.h" + +#include "log.h" +#include "reflect.h" + +namespace spvtools { +namespace ir { + +IrLoader::IrLoader(const MessageConsumer& consumer, Module* m) + : consumer_(consumer), + module_(m), + source_(""), + inst_index_(0) {} + +bool IrLoader::AddInstruction(const spv_parsed_instruction_t* inst) { + ++inst_index_; + const auto opcode = static_cast(inst->opcode); + if (IsDebugLineInst(opcode)) { + dbg_line_info_.push_back(Instruction(module()->context(), *inst)); + return true; + } + + std::unique_ptr spv_inst( + new Instruction(module()->context(), *inst, std::move(dbg_line_info_))); + dbg_line_info_.clear(); + + const char* src = source_.c_str(); + spv_position_t loc = {inst_index_, 0, 0}; + + // Handle function and basic block boundaries first, then normal + // instructions. + if (opcode == SpvOpFunction) { + if (function_ != nullptr) { + Error(consumer_, src, loc, "function inside function"); + return false; + } + function_.reset(new Function(std::move(spv_inst))); + } else if (opcode == SpvOpFunctionEnd) { + if (function_ == nullptr) { + Error(consumer_, src, loc, + "OpFunctionEnd without corresponding OpFunction"); + return false; + } + if (block_ != nullptr) { + Error(consumer_, src, loc, "OpFunctionEnd inside basic block"); + return false; + } + function_->SetFunctionEnd(std::move(spv_inst)); + module_->AddFunction(std::move(function_)); + function_ = nullptr; + } else if (opcode == SpvOpLabel) { + if (function_ == nullptr) { + Error(consumer_, src, loc, "OpLabel outside function"); + return false; + } + if (block_ != nullptr) { + Error(consumer_, src, loc, "OpLabel inside basic block"); + return false; + } + block_.reset(new BasicBlock(std::move(spv_inst))); + } else if (IsTerminatorInst(opcode)) { + if (function_ == nullptr) { + Error(consumer_, src, loc, "terminator instruction outside function"); + return false; + } + if (block_ == nullptr) { + Error(consumer_, src, loc, "terminator instruction outside basic block"); + return false; + } + block_->AddInstruction(std::move(spv_inst)); + function_->AddBasicBlock(std::move(block_)); + block_ = nullptr; + } else { + if (function_ == nullptr) { // Outside function definition + SPIRV_ASSERT(consumer_, block_ == nullptr); + if (opcode == SpvOpCapability) { + module_->AddCapability(std::move(spv_inst)); + } else if (opcode == SpvOpExtension) { + module_->AddExtension(std::move(spv_inst)); + } else if (opcode == SpvOpExtInstImport) { + module_->AddExtInstImport(std::move(spv_inst)); + } else if (opcode == SpvOpMemoryModel) { + module_->SetMemoryModel(std::move(spv_inst)); + } else if (opcode == SpvOpEntryPoint) { + module_->AddEntryPoint(std::move(spv_inst)); + } else if (opcode == SpvOpExecutionMode) { + module_->AddExecutionMode(std::move(spv_inst)); + } else if (IsDebug1Inst(opcode)) { + module_->AddDebug1Inst(std::move(spv_inst)); + } else if (IsDebug2Inst(opcode)) { + module_->AddDebug2Inst(std::move(spv_inst)); + } else if (IsDebug3Inst(opcode)) { + module_->AddDebug3Inst(std::move(spv_inst)); + } else if (IsAnnotationInst(opcode)) { + module_->AddAnnotationInst(std::move(spv_inst)); + } else if (IsTypeInst(opcode)) { + module_->AddType(std::move(spv_inst)); + } else if (IsConstantInst(opcode) || opcode == SpvOpVariable || + opcode == SpvOpUndef) { + module_->AddGlobalValue(std::move(spv_inst)); + } else { + SPIRV_UNIMPLEMENTED(consumer_, + "unhandled inst type outside function definition"); + } + } else { + if (block_ == nullptr) { // Inside function but outside blocks + if (opcode != SpvOpFunctionParameter) { + Errorf(consumer_, src, loc, + "Non-OpFunctionParameter (opcode: %d) found inside " + "function but outside basic block", + opcode); + return false; + } + function_->AddParameter(std::move(spv_inst)); + } else { + block_->AddInstruction(std::move(spv_inst)); + } + } + } + return true; +} + +// Resolves internal references among the module, functions, basic blocks, etc. +// This function should be called after adding all instructions. +void IrLoader::EndModule() { + if (block_ && function_) { + // We're in the middle of a basic block, but the terminator is missing. + // Register the block anyway. This lets us write tests with less + // boilerplate. + function_->AddBasicBlock(std::move(block_)); + block_ = nullptr; + } + if (function_) { + // We're in the middle of a function, but the OpFunctionEnd is missing. + // Register the function anyway. This lets us write tests with less + // boilerplate. + module_->AddFunction(std::move(function_)); + function_ = nullptr; + } + for (auto& function : *module_) { + for (auto& bb : function) bb.SetParent(&function); + function.SetParent(module_); + } +} + +} // namespace ir +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/ir_loader.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/ir_loader.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/ir_loader.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/ir_loader.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,84 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_IR_LOADER_H_ +#define LIBSPIRV_OPT_IR_LOADER_H_ + +#include + +#include "basic_block.h" +#include "instruction.h" +#include "module.h" +#include "spirv-tools/libspirv.hpp" + +namespace spvtools { +namespace ir { + +// Loader class for constructing SPIR-V in-memory IR representation. Methods in +// this class are designed to work with the interface for spvBinaryParse() in +// libspirv.h so that we can leverage the syntax checks implemented behind it. +// +// The user is expected to call SetModuleHeader() to fill in the module's +// header, and then AddInstruction() for each decoded instruction, and finally +// EndModule() to finalize the module. The instructions processed in sequence +// by AddInstruction() should comprise a valid SPIR-V module. +class IrLoader { + public: + // Instantiates a builder to construct the given |module| gradually. + // All internal messages will be communicated to the outside via the given + // message |consumer|. This instance only keeps a reference to the |consumer|, + // so the |consumer| should outlive this instance. + IrLoader(const MessageConsumer& consumer, Module* m); + + // Sets the source name of the module. + void SetSource(const std::string& src) { source_ = src; } + + Module* module() const { return module_; } + + // Sets the fields in the module's header to the given parameters. + void SetModuleHeader(uint32_t magic, uint32_t version, uint32_t generator, + uint32_t bound, uint32_t reserved) { + module_->SetHeader({magic, version, generator, bound, reserved}); + } + // Adds an instruction to the module. Returns true if no error occurs. This + // method will properly capture and store the data provided in |inst| so that + // |inst| is no longer needed after returning. + bool AddInstruction(const spv_parsed_instruction_t* inst); + // Finalizes the module construction. This must be called after the module + // header has been set and all instructions have been added. This is + // forgiving in the case of a missing terminator instruction on a basic block, + // or a missing OpFunctionEnd. Resolves internal bookkeeping. + void EndModule(); + + private: + // Consumer for communicating messages to outside. + const MessageConsumer& consumer_; + // The module to be built. + Module* module_; + // The source name of the module. + std::string source_; + // The last used instruction index. + uint32_t inst_index_; + // The current Function under construction. + std::unique_ptr function_; + // The current BasicBlock under construction. + std::unique_ptr block_; + // Line related debug instructions accumulated thus far. + std::vector dbg_line_info_; +}; + +} // namespace ir +} // namespace spvtools + +#endif // LIBSPIRV_OPT_IR_LOADER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/iterator.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/iterator.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/iterator.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/iterator.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,258 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_ITERATOR_H_ +#define LIBSPIRV_OPT_ITERATOR_H_ + +#include // for ptrdiff_t +#include +#include +#include +#include + +namespace spvtools { +namespace ir { + +// An ad hoc iterator class for std::vector>. The +// purpose of this iterator class is to provide transparent access to those +// std::unique_ptr managed elements in the vector, behaving like we are using +// std::vector<|ValueType|>. +template +class UptrVectorIterator + : public std::iterator::type> { + public: + using super = std::iterator< + std::random_access_iterator_tag, + typename std::conditional::type>; + + using pointer = typename super::pointer; + using reference = typename super::reference; + using difference_type = typename super::difference_type; + + // Type aliases. We need to apply constness properly if |IsConst| is true. + using Uptr = std::unique_ptr; + using UptrVector = typename std::conditional, + std::vector>::type; + using UnderlyingIterator = + typename std::conditional::type; + + // Creates a new iterator from the given |container| and its raw iterator + // |it|. + UptrVectorIterator(UptrVector* container, const UnderlyingIterator& it) + : container_(container), iterator_(it) {} + UptrVectorIterator(const UptrVectorIterator&) = default; + UptrVectorIterator& operator=(const UptrVectorIterator&) = default; + + inline UptrVectorIterator& operator++(); + inline UptrVectorIterator operator++(int); + inline UptrVectorIterator& operator--(); + inline UptrVectorIterator operator--(int); + + reference operator*() const { return **iterator_; } + pointer operator->() { return (*iterator_).get(); } + reference operator[](ptrdiff_t index) { return **(iterator_ + index); } + + inline bool operator==(const UptrVectorIterator& that) const; + inline bool operator!=(const UptrVectorIterator& that) const; + + inline ptrdiff_t operator-(const UptrVectorIterator& that) const; + inline bool operator<(const UptrVectorIterator& that) const; + + // Inserts the given |value| to the position pointed to by this iterator + // and returns an iterator to the newly iserted |value|. + // If the underlying vector changes capacity, all previous iterators will be + // invalidated. Otherwise, those previous iterators pointing to after the + // insertion point will be invalidated. + template + inline typename std::enable_if::type + InsertBefore(Uptr value); + + // Inserts the given |valueVector| to the position pointed to by this iterator + // and returns an iterator to the first newly inserted value. + // If the underlying vector changes capacity, all previous iterators will be + // invalidated. Otherwise, those previous iterators pointing to after the + // insertion point will be invalidated. + template + inline typename std::enable_if::type + InsertBefore(UptrVector* valueVector); + + // Erases the value at the position pointed to by this iterator + // and returns an iterator to the following value. + // If the underlying vector changes capacity, all previous iterators will be + // invalidated. Otherwise, those previous iterators pointing to after the + // erasure point will be invalidated. + template + inline typename std::enable_if::type + Erase(); + + // Returns the underlying iterator. + UnderlyingIterator Get() const { return iterator_; } + + // Returns a valid end iterator for the underlying container. + UptrVectorIterator End() const { + return UptrVectorIterator(container_, container_->end()); + } + + private: + UptrVector* container_; // The container we are manipulating. + UnderlyingIterator iterator_; // The raw iterator from the container. +}; + +// Handy class for a (begin, end) iterator pair. +template +class IteratorRange { + public: + IteratorRange(const IteratorType& b, const IteratorType& e) + : begin_(b), end_(e) {} + IteratorRange(IteratorType&& b, IteratorType&& e) + : begin_(std::move(b)), end_(std::move(e)) {} + + IteratorType begin() const { return begin_; } + IteratorType end() const { return end_; } + + bool empty() const { return begin_ == end_; } + size_t size() const { return end_ - begin_; } + + private: + IteratorType begin_; + IteratorType end_; +}; + +// Returns a (begin, end) iterator pair for the given iterators. +// The iterators must belong to the same container. +template +inline IteratorRange make_range(const IteratorType& begin, + const IteratorType& end) { + return {begin, end}; +} + +// Returns a (begin, end) iterator pair for the given iterators. +// The iterators must belong to the same container. +template +inline IteratorRange make_range(IteratorType&& begin, + IteratorType&& end) { + return {std::move(begin), std::move(end)}; +} + +// Returns a (begin, end) iterator pair for the given container. +template > +inline IteratorRange make_range( + std::vector>& container) { + return {IteratorType(&container, container.begin()), + IteratorType(&container, container.end())}; +} + +// Returns a const (begin, end) iterator pair for the given container. +template > +inline IteratorRange make_const_range( + const std::vector>& container) { + return {IteratorType(&container, container.cbegin()), + IteratorType(&container, container.cend())}; +} + +template +inline UptrVectorIterator& UptrVectorIterator::operator++() { + ++iterator_; + return *this; +} + +template +inline UptrVectorIterator UptrVectorIterator::operator++(int) { + auto it = *this; + ++(*this); + return it; +} + +template +inline UptrVectorIterator& UptrVectorIterator::operator--() { + --iterator_; + return *this; +} + +template +inline UptrVectorIterator UptrVectorIterator::operator--(int) { + auto it = *this; + --(*this); + return it; +} + +template +inline bool UptrVectorIterator::operator==( + const UptrVectorIterator& that) const { + return container_ == that.container_ && iterator_ == that.iterator_; +} + +template +inline bool UptrVectorIterator::operator!=( + const UptrVectorIterator& that) const { + return !(*this == that); +} + +template +inline ptrdiff_t UptrVectorIterator::operator-( + const UptrVectorIterator& that) const { + assert(container_ == that.container_); + return iterator_ - that.iterator_; +} + +template +inline bool UptrVectorIterator::operator<( + const UptrVectorIterator& that) const { + assert(container_ == that.container_); + return iterator_ < that.iterator_; +} + +template +template +inline + typename std::enable_if>::type + UptrVectorIterator::InsertBefore(Uptr value) { + auto index = iterator_ - container_->begin(); + container_->insert(iterator_, std::move(value)); + return UptrVectorIterator(container_, container_->begin() + index); +} + +template +template +inline + typename std::enable_if>::type + UptrVectorIterator::InsertBefore(UptrVector* values) { + const auto pos = iterator_ - container_->begin(); + const auto origsz = container_->size(); + container_->resize(origsz + values->size()); + std::move_backward(container_->begin() + pos, container_->begin() + origsz, + container_->end()); + std::move(values->begin(), values->end(), container_->begin() + pos); + return UptrVectorIterator(container_, container_->begin() + pos); +} + +template +template +inline + typename std::enable_if>::type + UptrVectorIterator::Erase() { + auto index = iterator_ - container_->begin(); + (void)container_->erase(iterator_); + return UptrVectorIterator(container_, container_->begin() + index); +} + +} // namespace ir +} // namespace spvtools + +#endif // LIBSPIRV_OPT_ITERATOR_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/licm_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/licm_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/licm_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/licm_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,125 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "opt/licm_pass.h" +#include "opt/module.h" +#include "opt/pass.h" + +#include +#include + +namespace spvtools { +namespace opt { + +Pass::Status LICMPass::Process(ir::IRContext* c) { + InitializeProcessing(c); + bool modified = false; + + if (c != nullptr) { + modified = ProcessIRContext(); + } + + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +bool LICMPass::ProcessIRContext() { + bool modified = false; + ir::Module* module = get_module(); + + // Process each function in the module + for (ir::Function& f : *module) { + modified |= ProcessFunction(&f); + } + return modified; +} + +bool LICMPass::ProcessFunction(ir::Function* f) { + bool modified = false; + ir::LoopDescriptor* loop_descriptor = context()->GetLoopDescriptor(f); + + // Process each loop in the function + for (ir::Loop& loop : *loop_descriptor) { + // Ignore nested loops, as we will process them in order in ProcessLoop + if (loop.IsNested()) { + continue; + } + modified |= ProcessLoop(&loop, f); + } + return modified; +} + +bool LICMPass::ProcessLoop(ir::Loop* loop, ir::Function* f) { + bool modified = false; + + // Process all nested loops first + for (ir::Loop* nested_loop : *loop) { + modified |= ProcessLoop(nested_loop, f); + } + + std::vector loop_bbs{}; + modified |= AnalyseAndHoistFromBB(loop, f, loop->GetHeaderBlock(), &loop_bbs); + + for (size_t i = 0; i < loop_bbs.size(); ++i) { + ir::BasicBlock* bb = loop_bbs[i]; + // do not delete the element + modified |= AnalyseAndHoistFromBB(loop, f, bb, &loop_bbs); + } + + return modified; +} + +bool LICMPass::AnalyseAndHoistFromBB(ir::Loop* loop, ir::Function* f, + ir::BasicBlock* bb, + std::vector* loop_bbs) { + bool modified = false; + std::function hoist_inst = + [this, &loop, &modified](ir::Instruction* inst) { + if (loop->ShouldHoistInstruction(this->context(), inst)) { + HoistInstruction(loop, inst); + modified = true; + } + }; + + if (IsImmediatelyContainedInLoop(loop, f, bb)) { + bb->ForEachInst(hoist_inst, false); + } + + opt::DominatorAnalysis* dom_analysis = + context()->GetDominatorAnalysis(f, *cfg()); + opt::DominatorTree& dom_tree = dom_analysis->GetDomTree(); + + for (opt::DominatorTreeNode* child_dom_tree_node : + *dom_tree.GetTreeNode(bb)) { + if (loop->IsInsideLoop(child_dom_tree_node->bb_)) { + loop_bbs->push_back(child_dom_tree_node->bb_); + } + } + + return modified; +} + +bool LICMPass::IsImmediatelyContainedInLoop(ir::Loop* loop, ir::Function* f, + ir::BasicBlock* bb) { + ir::LoopDescriptor* loop_descriptor = context()->GetLoopDescriptor(f); + return loop == (*loop_descriptor)[bb->id()]; +} + +void LICMPass::HoistInstruction(ir::Loop* loop, ir::Instruction* inst) { + ir::BasicBlock* pre_header_bb = loop->GetOrCreatePreHeaderBlock(); + inst->InsertBefore(std::move(&(*pre_header_bb->tail()))); + context()->set_instr_block(inst, pre_header_bb); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/licm_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/licm_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/licm_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/licm_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,68 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SOURCE_OPT_LICM_PASS_H_ +#define SOURCE_OPT_LICM_PASS_H_ + +#include "opt/basic_block.h" +#include "opt/instruction.h" +#include "opt/loop_descriptor.h" +#include "opt/pass.h" + +#include + +namespace spvtools { +namespace opt { + +class LICMPass : public Pass { + public: + LICMPass() {} + + const char* name() const override { return "loop-invariant-code-motion"; } + Status Process(ir::IRContext*) override; + + private: + // Searches the IRContext for functions and processes each, moving invariants + // outside loops within the function where possible + // Returns true if a change was made to a function within the IRContext + bool ProcessIRContext(); + + // Checks the function for loops, calling ProcessLoop on each one found. + // Returns true if a change was made to the function, false otherwise. + bool ProcessFunction(ir::Function* f); + + // Checks for invariants in the loop and attempts to move them to the loops + // preheader. Works from inner loop to outer when nested loops are found. + // Returns true if a change was made to the loop, false otherwise. + bool ProcessLoop(ir::Loop* loop, ir::Function* f); + + // Analyses each instruction in |bb|, hoisting invariants to |pre_header_bb|. + // Each child of |bb| wrt to |dom_tree| is pushed to |loop_bbs| + bool AnalyseAndHoistFromBB(ir::Loop* loop, ir::Function* f, + ir::BasicBlock* bb, + std::vector* loop_bbs); + + // Returns true if |bb| is immediately contained in |loop| + bool IsImmediatelyContainedInLoop(ir::Loop* loop, ir::Function* f, + ir::BasicBlock* bb); + + // Move the instruction to the given BasicBlock + // This method will update the instruction to block mapping for the context + void HoistInstruction(ir::Loop* loop, ir::Instruction* inst); +}; + +} // namespace opt +} // namespace spvtools + +#endif // SOURCE_OPT_LICM_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_access_chain_convert_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_access_chain_convert_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_access_chain_convert_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_access_chain_convert_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,341 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "local_access_chain_convert_pass.h" + +#include "ir_context.h" +#include "iterator.h" + +namespace spvtools { +namespace opt { + +namespace { + +const uint32_t kStoreValIdInIdx = 1; +const uint32_t kAccessChainPtrIdInIdx = 0; +const uint32_t kConstantValueInIdx = 0; +const uint32_t kTypeIntWidthInIdx = 0; + +} // anonymous namespace + +void LocalAccessChainConvertPass::BuildAndAppendInst( + SpvOp opcode, uint32_t typeId, uint32_t resultId, + const std::vector& in_opnds, + std::vector>* newInsts) { + std::unique_ptr newInst( + new ir::Instruction(context(), opcode, typeId, resultId, in_opnds)); + get_def_use_mgr()->AnalyzeInstDefUse(&*newInst); + newInsts->emplace_back(std::move(newInst)); +} + +uint32_t LocalAccessChainConvertPass::BuildAndAppendVarLoad( + const ir::Instruction* ptrInst, uint32_t* varId, uint32_t* varPteTypeId, + std::vector>* newInsts) { + const uint32_t ldResultId = TakeNextId(); + *varId = ptrInst->GetSingleWordInOperand(kAccessChainPtrIdInIdx); + const ir::Instruction* varInst = get_def_use_mgr()->GetDef(*varId); + assert(varInst->opcode() == SpvOpVariable); + *varPteTypeId = GetPointeeTypeId(varInst); + BuildAndAppendInst(SpvOpLoad, *varPteTypeId, ldResultId, + {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {*varId}}}, + newInsts); + return ldResultId; +} + +void LocalAccessChainConvertPass::AppendConstantOperands( + const ir::Instruction* ptrInst, std::vector* in_opnds) { + uint32_t iidIdx = 0; + ptrInst->ForEachInId([&iidIdx, &in_opnds, this](const uint32_t* iid) { + if (iidIdx > 0) { + const ir::Instruction* cInst = get_def_use_mgr()->GetDef(*iid); + uint32_t val = cInst->GetSingleWordInOperand(kConstantValueInIdx); + in_opnds->push_back( + {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, {val}}); + } + ++iidIdx; + }); +} + +uint32_t LocalAccessChainConvertPass::GenAccessChainLoadReplacement( + const ir::Instruction* ptrInst, + std::vector>* newInsts) { + // Build and append load of variable in ptrInst + uint32_t varId; + uint32_t varPteTypeId; + const uint32_t ldResultId = + BuildAndAppendVarLoad(ptrInst, &varId, &varPteTypeId, newInsts); + + // Build and append Extract + const uint32_t extResultId = TakeNextId(); + const uint32_t ptrPteTypeId = GetPointeeTypeId(ptrInst); + std::vector ext_in_opnds = { + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {ldResultId}}}; + AppendConstantOperands(ptrInst, &ext_in_opnds); + BuildAndAppendInst(SpvOpCompositeExtract, ptrPteTypeId, extResultId, + ext_in_opnds, newInsts); + return extResultId; +} + +void LocalAccessChainConvertPass::GenAccessChainStoreReplacement( + const ir::Instruction* ptrInst, uint32_t valId, + std::vector>* newInsts) { + // Build and append load of variable in ptrInst + uint32_t varId; + uint32_t varPteTypeId; + const uint32_t ldResultId = + BuildAndAppendVarLoad(ptrInst, &varId, &varPteTypeId, newInsts); + + // Build and append Insert + const uint32_t insResultId = TakeNextId(); + std::vector ins_in_opnds = { + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {valId}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {ldResultId}}}; + AppendConstantOperands(ptrInst, &ins_in_opnds); + BuildAndAppendInst(SpvOpCompositeInsert, varPteTypeId, insResultId, + ins_in_opnds, newInsts); + + // Build and append Store + BuildAndAppendInst(SpvOpStore, 0, 0, + {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {varId}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {insResultId}}}, + newInsts); +} + +bool LocalAccessChainConvertPass::IsConstantIndexAccessChain( + const ir::Instruction* acp) const { + uint32_t inIdx = 0; + return acp->WhileEachInId([&inIdx, this](const uint32_t* tid) { + if (inIdx > 0) { + ir::Instruction* opInst = get_def_use_mgr()->GetDef(*tid); + if (opInst->opcode() != SpvOpConstant) return false; + } + ++inIdx; + return true; + }); +} + +bool LocalAccessChainConvertPass::HasOnlySupportedRefs(uint32_t ptrId) { + if (supported_ref_ptrs_.find(ptrId) != supported_ref_ptrs_.end()) return true; + if (get_def_use_mgr()->WhileEachUser(ptrId, [this](ir::Instruction* user) { + SpvOp op = user->opcode(); + if (IsNonPtrAccessChain(op) || op == SpvOpCopyObject) { + if (!HasOnlySupportedRefs(user->result_id())) { + return false; + } + } else if (op != SpvOpStore && op != SpvOpLoad && op != SpvOpName && + !IsNonTypeDecorate(op)) { + return false; + } + return true; + })) { + supported_ref_ptrs_.insert(ptrId); + return true; + } + return false; +} + +void LocalAccessChainConvertPass::FindTargetVars(ir::Function* func) { + for (auto bi = func->begin(); bi != func->end(); ++bi) { + for (auto ii = bi->begin(); ii != bi->end(); ++ii) { + switch (ii->opcode()) { + case SpvOpStore: + case SpvOpLoad: { + uint32_t varId; + ir::Instruction* ptrInst = GetPtr(&*ii, &varId); + if (!IsTargetVar(varId)) break; + const SpvOp op = ptrInst->opcode(); + // Rule out variables with non-supported refs eg function calls + if (!HasOnlySupportedRefs(varId)) { + seen_non_target_vars_.insert(varId); + seen_target_vars_.erase(varId); + break; + } + // Rule out variables with nested access chains + // TODO(): Convert nested access chains + if (IsNonPtrAccessChain(op) && ptrInst->GetSingleWordInOperand( + kAccessChainPtrIdInIdx) != varId) { + seen_non_target_vars_.insert(varId); + seen_target_vars_.erase(varId); + break; + } + // Rule out variables accessed with non-constant indices + if (!IsConstantIndexAccessChain(ptrInst)) { + seen_non_target_vars_.insert(varId); + seen_target_vars_.erase(varId); + break; + } + } break; + default: + break; + } + } + } +} + +bool LocalAccessChainConvertPass::ConvertLocalAccessChains(ir::Function* func) { + FindTargetVars(func); + // Replace access chains of all targeted variables with equivalent + // extract and insert sequences + bool modified = false; + for (auto bi = func->begin(); bi != func->end(); ++bi) { + std::vector dead_instructions; + for (auto ii = bi->begin(); ii != bi->end(); ++ii) { + switch (ii->opcode()) { + case SpvOpLoad: { + uint32_t varId; + ir::Instruction* ptrInst = GetPtr(&*ii, &varId); + if (!IsNonPtrAccessChain(ptrInst->opcode())) break; + if (!IsTargetVar(varId)) break; + std::vector> newInsts; + uint32_t replId = GenAccessChainLoadReplacement(ptrInst, &newInsts); + context()->KillNamesAndDecorates(&*ii); + context()->ReplaceAllUsesWith(ii->result_id(), replId); + dead_instructions.push_back(&*ii); + ++ii; + ii = ii.InsertBefore(std::move(newInsts)); + ++ii; + modified = true; + } break; + case SpvOpStore: { + uint32_t varId; + ir::Instruction* ptrInst = GetPtr(&*ii, &varId); + if (!IsNonPtrAccessChain(ptrInst->opcode())) break; + if (!IsTargetVar(varId)) break; + std::vector> newInsts; + uint32_t valId = ii->GetSingleWordInOperand(kStoreValIdInIdx); + GenAccessChainStoreReplacement(ptrInst, valId, &newInsts); + dead_instructions.push_back(&*ii); + ++ii; + ii = ii.InsertBefore(std::move(newInsts)); + ++ii; + ++ii; + modified = true; + } break; + default: + break; + } + } + + while (!dead_instructions.empty()) { + ir::Instruction* inst = dead_instructions.back(); + dead_instructions.pop_back(); + DCEInst(inst, [&dead_instructions](ir::Instruction* other_inst) { + auto i = std::find(dead_instructions.begin(), dead_instructions.end(), + other_inst); + if (i != dead_instructions.end()) { + dead_instructions.erase(i); + } + }); + } + } + return modified; +} + +void LocalAccessChainConvertPass::Initialize(ir::IRContext* c) { + InitializeProcessing(c); + + // Initialize Target Variable Caches + seen_target_vars_.clear(); + seen_non_target_vars_.clear(); + + // Initialize collections + supported_ref_ptrs_.clear(); + + // Initialize extension whitelist + InitExtensions(); +} + +bool LocalAccessChainConvertPass::AllExtensionsSupported() const { + // If any extension not in whitelist, return false + for (auto& ei : get_module()->extensions()) { + const char* extName = + reinterpret_cast(&ei.GetInOperand(0).words[0]); + if (extensions_whitelist_.find(extName) == extensions_whitelist_.end()) + return false; + } + return true; +} + +Pass::Status LocalAccessChainConvertPass::ProcessImpl() { + // If non-32-bit integer type in module, terminate processing + // TODO(): Handle non-32-bit integer constants in access chains + for (const ir::Instruction& inst : get_module()->types_values()) + if (inst.opcode() == SpvOpTypeInt && + inst.GetSingleWordInOperand(kTypeIntWidthInIdx) != 32) + return Status::SuccessWithoutChange; + // Do not process if module contains OpGroupDecorate. Additional + // support required in KillNamesAndDecorates(). + // TODO(greg-lunarg): Add support for OpGroupDecorate + for (auto& ai : get_module()->annotations()) + if (ai.opcode() == SpvOpGroupDecorate) return Status::SuccessWithoutChange; + // Do not process if any disallowed extensions are enabled + if (!AllExtensionsSupported()) return Status::SuccessWithoutChange; + // Process all entry point functions. + ProcessFunction pfn = [this](ir::Function* fp) { + return ConvertLocalAccessChains(fp); + }; + bool modified = ProcessEntryPointCallTree(pfn, get_module()); + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +LocalAccessChainConvertPass::LocalAccessChainConvertPass() {} + +Pass::Status LocalAccessChainConvertPass::Process(ir::IRContext* c) { + Initialize(c); + return ProcessImpl(); +} + +void LocalAccessChainConvertPass::InitExtensions() { + extensions_whitelist_.clear(); + extensions_whitelist_.insert({ + "SPV_AMD_shader_explicit_vertex_parameter", + "SPV_AMD_shader_trinary_minmax", + "SPV_AMD_gcn_shader", + "SPV_KHR_shader_ballot", + "SPV_AMD_shader_ballot", + "SPV_AMD_gpu_shader_half_float", + "SPV_KHR_shader_draw_parameters", + "SPV_KHR_subgroup_vote", + "SPV_KHR_16bit_storage", + "SPV_KHR_device_group", + "SPV_KHR_multiview", + "SPV_NVX_multiview_per_view_attributes", + "SPV_NV_viewport_array2", + "SPV_NV_stereo_view_rendering", + "SPV_NV_sample_mask_override_coverage", + "SPV_NV_geometry_shader_passthrough", + "SPV_AMD_texture_gather_bias_lod", + "SPV_KHR_storage_buffer_storage_class", + // SPV_KHR_variable_pointers + // Currently do not support extended pointer expressions + "SPV_AMD_gpu_shader_int16", + "SPV_KHR_post_depth_coverage", + "SPV_KHR_shader_atomic_counter_ops", + "SPV_EXT_shader_stencil_export", + "SPV_EXT_shader_viewport_index_layer", + "SPV_AMD_shader_image_load_store_lod", + "SPV_AMD_shader_fragment_mask", + "SPV_EXT_fragment_fully_covered", + "SPV_AMD_gpu_shader_half_float_fetch", + "SPV_GOOGLE_decorate_string", + "SPV_GOOGLE_hlsl_functionality1", + "SPV_NV_shader_subgroup_partitioned", + "SPV_EXT_descriptor_indexing", + }); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_access_chain_convert_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_access_chain_convert_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_access_chain_convert_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_access_chain_convert_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,126 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#ifndef LIBSPIRV_OPT_LOCAL_ACCESS_CHAIN_CONVERT_PASS_H_ +#define LIBSPIRV_OPT_LOCAL_ACCESS_CHAIN_CONVERT_PASS_H_ + +#include +#include +#include +#include +#include +#include + +#include "basic_block.h" +#include "def_use_manager.h" +#include "mem_pass.h" +#include "module.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class LocalAccessChainConvertPass : public MemPass { + public: + LocalAccessChainConvertPass(); + const char* name() const override { return "convert-local-access-chains"; } + Status Process(ir::IRContext* c) override; + + ir::IRContext::Analysis GetPreservedAnalyses() override { + return ir::IRContext::kAnalysisDefUse; + } + + using ProcessFunction = std::function; + + private: + // Return true if all refs through |ptrId| are only loads or stores and + // cache ptrId in supported_ref_ptrs_. TODO(dnovillo): This function is + // replicated in other passes and it's slightly different in every pass. Is it + // possible to make one common implementation? + bool HasOnlySupportedRefs(uint32_t ptrId); + + // Search |func| and cache function scope variables of target type that are + // not accessed with non-constant-index access chains. Also cache non-target + // variables. + void FindTargetVars(ir::Function* func); + + // Build instruction from |opcode|, |typeId|, |resultId|, and |in_opnds|. + // Append to |newInsts|. + void BuildAndAppendInst( + SpvOp opcode, uint32_t typeId, uint32_t resultId, + const std::vector& in_opnds, + std::vector>* newInsts); + + // Build load of variable in |ptrInst| and append to |newInsts|. + // Return var in |varId| and its pointee type in |varPteTypeId|. + uint32_t BuildAndAppendVarLoad( + const ir::Instruction* ptrInst, uint32_t* varId, uint32_t* varPteTypeId, + std::vector>* newInsts); + + // Append literal integer operands to |in_opnds| corresponding to constant + // integer operands from access chain |ptrInst|. Assumes all indices in + // access chains are OpConstant. + void AppendConstantOperands(const ir::Instruction* ptrInst, + std::vector* in_opnds); + + // Create a load/insert/store equivalent to a store of + // |valId| through (constant index) access chaing |ptrInst|. + // Append to |newInsts|. + void GenAccessChainStoreReplacement( + const ir::Instruction* ptrInst, uint32_t valId, + std::vector>* newInsts); + + // For the (constant index) access chain |ptrInst|, create an + // equivalent load and extract. Append to |newInsts|. + uint32_t GenAccessChainLoadReplacement( + const ir::Instruction* ptrInst, + std::vector>* newInsts); + + // Return true if all indices of access chain |acp| are OpConstant integers + bool IsConstantIndexAccessChain(const ir::Instruction* acp) const; + + // Identify all function scope variables of target type which are + // accessed only with loads, stores and access chains with constant + // indices. Convert all loads and stores of such variables into equivalent + // loads, stores, extracts and inserts. This unifies access to these + // variables to a single mode and simplifies analysis and optimization. + // See IsTargetType() for targeted types. + // + // Nested access chains and pointer access chains are not currently + // converted. + bool ConvertLocalAccessChains(ir::Function* func); + + // Initialize extensions whitelist + void InitExtensions(); + + // Return true if all extensions in this module are allowed by this pass. + bool AllExtensionsSupported() const; + + void Initialize(ir::IRContext* c); + Pass::Status ProcessImpl(); + + // Variables with only supported references, ie. loads and stores using + // variable directly or through non-ptr access chains. + std::unordered_set supported_ref_ptrs_; + + // Extensions supported by this pass. + std::unordered_set extensions_whitelist_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_LOCAL_ACCESS_CHAIN_CONVERT_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_redundancy_elimination.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_redundancy_elimination.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_redundancy_elimination.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_redundancy_elimination.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2017 Google 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. + +#include "local_redundancy_elimination.h" + +#include "value_number_table.h" + +namespace spvtools { +namespace opt { + +Pass::Status LocalRedundancyEliminationPass::Process(ir::IRContext* c) { + InitializeProcessing(c); + + bool modified = false; + ValueNumberTable vnTable(context()); + + for (auto& func : *get_module()) { + for (auto& bb : func) { + // Keeps track of all ids that contain a given value number. We keep + // track of multiple values because they could have the same value, but + // different decorations. + std::map value_to_ids; + if (EliminateRedundanciesInBB(&bb, vnTable, &value_to_ids)) + modified = true; + } + } + return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange); +} + +bool LocalRedundancyEliminationPass::EliminateRedundanciesInBB( + ir::BasicBlock* block, const ValueNumberTable& vnTable, + std::map* value_to_ids) { + bool modified = false; + + auto func = [this, &vnTable, &modified, value_to_ids](ir::Instruction* inst) { + if (inst->result_id() == 0) { + return; + } + + uint32_t value = vnTable.GetValueNumber(inst); + + if (value == 0) { + return; + } + + auto candidate = value_to_ids->insert({value, inst->result_id()}); + if (!candidate.second) { + context()->KillNamesAndDecorates(inst); + context()->ReplaceAllUsesWith(inst->result_id(), candidate.first->second); + context()->KillInst(inst); + modified = true; + } + }; + block->ForEachInst(func); + return modified; +} +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_redundancy_elimination.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_redundancy_elimination.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_redundancy_elimination.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_redundancy_elimination.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_LOCAL_REDUNDANCY_ELIMINATION_H_ +#define LIBSPIRV_OPT_LOCAL_REDUNDANCY_ELIMINATION_H_ + +#include "ir_context.h" +#include "pass.h" +#include "value_number_table.h" + +namespace spvtools { +namespace opt { + +// This pass implements local redundancy elimination. Its goal is to reduce the +// number of times the same value is computed. It works on each basic block +// independently, ie local. For each instruction in a basic block, it gets the +// value number for the result id, |id|, of the instruction. If that value +// number has already been computed in the basic block, it tries to replace the +// uses of |id| by the id that already contains the same value. Then the +// current instruction is deleted. +class LocalRedundancyEliminationPass : public Pass { + public: + const char* name() const override { return "local-redundancy-elimination"; } + Status Process(ir::IRContext*) override; + virtual ir::IRContext::Analysis GetPreservedAnalyses() override { + return ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping | + ir::IRContext::kAnalysisDecorations | + ir::IRContext::kAnalysisCombinators | ir::IRContext::kAnalysisCFG | + ir::IRContext::kAnalysisDominatorAnalysis | + ir::IRContext::kAnalysisNameMap; + } + + protected: + // Deletes instructions in |block| whose value is in |value_to_ids| or is + // computed earlier in |block|. + // + // |vnTable| must have computed a value number for every result id defined + // in |bb|. + // + // |value_to_ids| is a map from value number to ids. If {vn, id} is in + // |value_to_ids| then vn is the value number of id, and the definition of id + // dominates |bb|. + // + // Returns true if the module is changed. + bool EliminateRedundanciesInBB(ir::BasicBlock* block, + const ValueNumberTable& vnTable, + std::map* value_to_ids); +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_LOCAL_REDUNDANCY_ELIMINATION_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_single_block_elim_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_single_block_elim_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_single_block_elim_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_single_block_elim_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,221 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "local_single_block_elim_pass.h" + +#include "iterator.h" + +namespace spvtools { +namespace opt { + +namespace { + +const uint32_t kStoreValIdInIdx = 1; + +} // anonymous namespace + +bool LocalSingleBlockLoadStoreElimPass::HasOnlySupportedRefs(uint32_t ptrId) { + if (supported_ref_ptrs_.find(ptrId) != supported_ref_ptrs_.end()) return true; + if (get_def_use_mgr()->WhileEachUser(ptrId, [this](ir::Instruction* user) { + SpvOp op = user->opcode(); + if (IsNonPtrAccessChain(op) || op == SpvOpCopyObject) { + if (!HasOnlySupportedRefs(user->result_id())) { + return false; + } + } else if (op != SpvOpStore && op != SpvOpLoad && op != SpvOpName && + !IsNonTypeDecorate(op)) { + return false; + } + return true; + })) { + supported_ref_ptrs_.insert(ptrId); + return true; + } + return false; +} + +bool LocalSingleBlockLoadStoreElimPass::LocalSingleBlockLoadStoreElim( + ir::Function* func) { + // Perform local store/load and load/load elimination on each block + bool modified = false; + for (auto bi = func->begin(); bi != func->end(); ++bi) { + var2store_.clear(); + var2load_.clear(); + pinned_vars_.clear(); + auto next = bi->begin(); + for (auto ii = next; ii != bi->end(); ii = next) { + ++next; + switch (ii->opcode()) { + case SpvOpStore: { + // Verify store variable is target type + uint32_t varId; + ir::Instruction* ptrInst = GetPtr(&*ii, &varId); + if (!IsTargetVar(varId)) continue; + if (!HasOnlySupportedRefs(varId)) continue; + // Register the store + if (ptrInst->opcode() == SpvOpVariable) { + // if not pinned, look for WAW + if (pinned_vars_.find(varId) == pinned_vars_.end()) { + auto si = var2store_.find(varId); + if (si != var2store_.end()) { + } + } + var2store_[varId] = &*ii; + } else { + assert(IsNonPtrAccessChain(ptrInst->opcode())); + var2store_.erase(varId); + } + pinned_vars_.erase(varId); + var2load_.erase(varId); + } break; + case SpvOpLoad: { + // Verify store variable is target type + uint32_t varId; + ir::Instruction* ptrInst = GetPtr(&*ii, &varId); + if (!IsTargetVar(varId)) continue; + if (!HasOnlySupportedRefs(varId)) continue; + // Look for previous store or load + uint32_t replId = 0; + if (ptrInst->opcode() == SpvOpVariable) { + auto si = var2store_.find(varId); + if (si != var2store_.end()) { + replId = si->second->GetSingleWordInOperand(kStoreValIdInIdx); + } else { + auto li = var2load_.find(varId); + if (li != var2load_.end()) { + replId = li->second->result_id(); + } + } + } + if (replId != 0) { + // replace load's result id and delete load + context()->KillNamesAndDecorates(&*ii); + context()->ReplaceAllUsesWith(ii->result_id(), replId); + modified = true; + } else { + if (ptrInst->opcode() == SpvOpVariable) + var2load_[varId] = &*ii; // register load + pinned_vars_.insert(varId); + } + } break; + case SpvOpFunctionCall: { + // Conservatively assume all locals are redefined for now. + // TODO(): Handle more optimally + var2store_.clear(); + var2load_.clear(); + pinned_vars_.clear(); + } break; + default: + break; + } + } + } + return modified; +} + +void LocalSingleBlockLoadStoreElimPass::Initialize(ir::IRContext* c) { + InitializeProcessing(c); + + // Initialize Target Type Caches + seen_target_vars_.clear(); + seen_non_target_vars_.clear(); + + // Clear collections + supported_ref_ptrs_.clear(); + + // Initialize extensions whitelist + InitExtensions(); +} + +bool LocalSingleBlockLoadStoreElimPass::AllExtensionsSupported() const { + // If any extension not in whitelist, return false + for (auto& ei : get_module()->extensions()) { + const char* extName = + reinterpret_cast(&ei.GetInOperand(0).words[0]); + if (extensions_whitelist_.find(extName) == extensions_whitelist_.end()) + return false; + } + return true; +} + +Pass::Status LocalSingleBlockLoadStoreElimPass::ProcessImpl() { + // Assumes relaxed logical addressing only (see instruction.h). + if (context()->get_feature_mgr()->HasCapability(SpvCapabilityAddresses)) + return Status::SuccessWithoutChange; + // Do not process if module contains OpGroupDecorate. Additional + // support required in KillNamesAndDecorates(). + // TODO(greg-lunarg): Add support for OpGroupDecorate + for (auto& ai : get_module()->annotations()) + if (ai.opcode() == SpvOpGroupDecorate) return Status::SuccessWithoutChange; + // If any extensions in the module are not explicitly supported, + // return unmodified. + if (!AllExtensionsSupported()) return Status::SuccessWithoutChange; + // Process all entry point functions + ProcessFunction pfn = [this](ir::Function* fp) { + return LocalSingleBlockLoadStoreElim(fp); + }; + bool modified = ProcessEntryPointCallTree(pfn, get_module()); + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +LocalSingleBlockLoadStoreElimPass::LocalSingleBlockLoadStoreElimPass() {} + +Pass::Status LocalSingleBlockLoadStoreElimPass::Process(ir::IRContext* c) { + Initialize(c); + return ProcessImpl(); +} + +void LocalSingleBlockLoadStoreElimPass::InitExtensions() { + extensions_whitelist_.clear(); + extensions_whitelist_.insert({ + "SPV_AMD_shader_explicit_vertex_parameter", + "SPV_AMD_shader_trinary_minmax", + "SPV_AMD_gcn_shader", + "SPV_KHR_shader_ballot", + "SPV_AMD_shader_ballot", + "SPV_AMD_gpu_shader_half_float", + "SPV_KHR_shader_draw_parameters", + "SPV_KHR_subgroup_vote", + "SPV_KHR_16bit_storage", + "SPV_KHR_device_group", + "SPV_KHR_multiview", + "SPV_NVX_multiview_per_view_attributes", + "SPV_NV_viewport_array2", + "SPV_NV_stereo_view_rendering", + "SPV_NV_sample_mask_override_coverage", + "SPV_NV_geometry_shader_passthrough", + "SPV_AMD_texture_gather_bias_lod", + "SPV_KHR_storage_buffer_storage_class", + // SPV_KHR_variable_pointers + // Currently do not support extended pointer expressions + "SPV_AMD_gpu_shader_int16", + "SPV_KHR_post_depth_coverage", + "SPV_KHR_shader_atomic_counter_ops", + "SPV_EXT_shader_stencil_export", + "SPV_EXT_shader_viewport_index_layer", + "SPV_AMD_shader_image_load_store_lod", + "SPV_AMD_shader_fragment_mask", + "SPV_EXT_fragment_fully_covered", + "SPV_AMD_gpu_shader_half_float_fetch", + "SPV_GOOGLE_decorate_string", + "SPV_GOOGLE_hlsl_functionality1", + "SPV_NV_shader_subgroup_partitioned", + "SPV_EXT_descriptor_indexing", + }); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_single_block_elim_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_single_block_elim_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_single_block_elim_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_single_block_elim_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,103 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#ifndef LIBSPIRV_OPT_LOCAL_SINGLE_BLOCK_ELIM_PASS_H_ +#define LIBSPIRV_OPT_LOCAL_SINGLE_BLOCK_ELIM_PASS_H_ + +#include +#include +#include +#include +#include +#include + +#include "basic_block.h" +#include "def_use_manager.h" +#include "mem_pass.h" +#include "module.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class LocalSingleBlockLoadStoreElimPass : public MemPass { + public: + LocalSingleBlockLoadStoreElimPass(); + const char* name() const override { return "eliminate-local-single-block"; } + Status Process(ir::IRContext* c) override; + + ir::IRContext::Analysis GetPreservedAnalyses() override { + return ir::IRContext::kAnalysisDefUse; + } + + private: + // Return true if all uses of |varId| are only through supported reference + // operations ie. loads and store. Also cache in supported_ref_ptrs_. + // TODO(dnovillo): This function is replicated in other passes and it's + // slightly different in every pass. Is it possible to make one common + // implementation? + bool HasOnlySupportedRefs(uint32_t varId); + + // On all entry point functions, within each basic block, eliminate + // loads and stores to function variables where possible. For + // loads, if previous load or store to same variable, replace + // load id with previous id and delete load. Finally, check if + // remaining stores are useless, and delete store and variable + // where possible. Assumes logical addressing. + bool LocalSingleBlockLoadStoreElim(ir::Function* func); + + // Initialize extensions whitelist + void InitExtensions(); + + // Return true if all extensions in this module are supported by this pass. + bool AllExtensionsSupported() const; + + void Initialize(ir::IRContext* c); + Pass::Status ProcessImpl(); + + // Map from function scope variable to a store of that variable in the + // current block whose value is currently valid. This map is cleared + // at the start of each block and incrementally updated as the block + // is scanned. The stores are candidates for elimination. The map is + // conservatively cleared when a function call is encountered. + std::unordered_map var2store_; + + // Map from function scope variable to a load of that variable in the + // current block whose value is currently valid. This map is cleared + // at the start of each block and incrementally updated as the block + // is scanned. The stores are candidates for elimination. The map is + // conservatively cleared when a function call is encountered. + std::unordered_map var2load_; + + // Set of variables whose most recent store in the current block cannot be + // deleted, for example, if there is a load of the variable which is + // dependent on the store and is not replaced and deleted by this pass, + // for example, a load through an access chain. A variable is removed + // from this set each time a new store of that variable is encountered. + std::unordered_set pinned_vars_; + + // Extensions supported by this pass. + std::unordered_set extensions_whitelist_; + + // Variables that are only referenced by supported operations for this + // pass ie. loads and stores. + std::unordered_set supported_ref_ptrs_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_LOCAL_SINGLE_BLOCK_ELIM_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_single_store_elim_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_single_store_elim_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_single_store_elim_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_single_store_elim_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,324 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "local_single_store_elim_pass.h" + +#include "cfa.h" +#include "iterator.h" +#include "latest_version_glsl_std_450_header.h" + +namespace spvtools { +namespace opt { + +namespace { + +const uint32_t kStoreValIdInIdx = 1; +const uint32_t kVariableInitIdInIdx = 1; + +} // anonymous namespace + +bool LocalSingleStoreElimPass::HasOnlySupportedRefs(uint32_t ptrId) { + if (supported_ref_ptrs_.find(ptrId) != supported_ref_ptrs_.end()) return true; + if (get_def_use_mgr()->WhileEachUser(ptrId, [this](ir::Instruction* user) { + SpvOp op = user->opcode(); + if (IsNonPtrAccessChain(op) || op == SpvOpCopyObject) { + if (!HasOnlySupportedRefs(user->result_id())) { + return false; + } + } else if (op != SpvOpStore && op != SpvOpLoad && op != SpvOpName && + !IsNonTypeDecorate(op)) { + return false; + } + return true; + })) { + supported_ref_ptrs_.insert(ptrId); + return true; + } + return false; +} + +void LocalSingleStoreElimPass::SingleStoreAnalyze(ir::Function* func) { + ssa_var2store_.clear(); + non_ssa_vars_.clear(); + store2idx_.clear(); + store2blk_.clear(); + for (auto bi = func->begin(); bi != func->end(); ++bi) { + uint32_t instIdx = 0; + for (auto ii = bi->begin(); ii != bi->end(); ++ii, ++instIdx) { + uint32_t varId = 0; + ir::Instruction* ptrInst = nullptr; + switch (ii->opcode()) { + case SpvOpStore: { + ptrInst = GetPtr(&*ii, &varId); + } break; + case SpvOpVariable: { + // If initializer, treat like store + if (ii->NumInOperands() > 1) { + varId = ii->result_id(); + ptrInst = &*ii; + } + } break; + default: + break; + } // switch + if (varId == 0) continue; + // Verify variable is target type + if (non_ssa_vars_.find(varId) != non_ssa_vars_.end()) continue; + if (ptrInst->opcode() != SpvOpVariable) { + non_ssa_vars_.insert(varId); + ssa_var2store_.erase(varId); + continue; + } + // Verify target type and function storage class + if (!IsTargetVar(varId)) { + non_ssa_vars_.insert(varId); + continue; + } + if (!HasOnlySupportedRefs(varId)) { + non_ssa_vars_.insert(varId); + continue; + } + // Ignore variables with multiple stores + if (ssa_var2store_.find(varId) != ssa_var2store_.end()) { + non_ssa_vars_.insert(varId); + ssa_var2store_.erase(varId); + continue; + } + // Remember pointer to variable's store and it's + // ordinal position in block + ssa_var2store_[varId] = &*ii; + store2idx_[&*ii] = instIdx; + store2blk_[&*ii] = &*bi; + } + } +} + +LocalSingleStoreElimPass::GetBlocksFunction +LocalSingleStoreElimPass::AugmentedCFGSuccessorsFunction() const { + return [this](const ir::BasicBlock* block) { + auto asmi = augmented_successors_map_.find(block); + if (asmi != augmented_successors_map_.end()) return &(*asmi).second; + auto smi = successors_map_.find(block); + return &(*smi).second; + }; +} + +LocalSingleStoreElimPass::GetBlocksFunction +LocalSingleStoreElimPass::AugmentedCFGPredecessorsFunction() const { + return [this](const ir::BasicBlock* block) { + auto apmi = augmented_predecessors_map_.find(block); + if (apmi != augmented_predecessors_map_.end()) return &(*apmi).second; + auto pmi = predecessors_map_.find(block); + return &(*pmi).second; + }; +} + +void LocalSingleStoreElimPass::CalculateImmediateDominators( + ir::Function* func) { + // Compute CFG + vector ordered_blocks; + predecessors_map_.clear(); + successors_map_.clear(); + for (auto& blk : *func) { + ordered_blocks.push_back(&blk); + const auto& const_blk = blk; + const_blk.ForEachSuccessorLabel([&blk, this](const uint32_t sbid) { + successors_map_[&blk].push_back(label2block_[sbid]); + predecessors_map_[label2block_[sbid]].push_back(&blk); + }); + } + // Compute Augmented CFG + augmented_successors_map_.clear(); + augmented_predecessors_map_.clear(); + successors_map_[cfg()->pseudo_exit_block()] = {}; + predecessors_map_[cfg()->pseudo_entry_block()] = {}; + auto succ_func = [this](const ir::BasicBlock* b) { + return &successors_map_[b]; + }; + auto pred_func = [this](const ir::BasicBlock* b) { + return &predecessors_map_[b]; + }; + CFA::ComputeAugmentedCFG( + ordered_blocks, cfg()->pseudo_entry_block(), cfg()->pseudo_exit_block(), + &augmented_successors_map_, &augmented_predecessors_map_, succ_func, + pred_func); + // Compute Dominators + vector postorder; + auto ignore_block = [](cbb_ptr) {}; + auto ignore_edge = [](cbb_ptr, cbb_ptr) {}; + spvtools::CFA::DepthFirstTraversal( + ordered_blocks[0], AugmentedCFGSuccessorsFunction(), ignore_block, + [&](cbb_ptr b) { postorder.push_back(b); }, ignore_edge); + auto edges = spvtools::CFA::CalculateDominators( + postorder, AugmentedCFGPredecessorsFunction()); + idom_.clear(); + for (auto edge : edges) idom_[edge.first] = edge.second; +} + +bool LocalSingleStoreElimPass::Dominates(ir::BasicBlock* blk0, uint32_t idx0, + ir::BasicBlock* blk1, uint32_t idx1) { + if (blk0 == blk1) return idx0 <= idx1; + ir::BasicBlock* b = blk1; + while (idom_[b] != b) { + b = idom_[b]; + if (b == blk0) return true; + } + return false; +} + +bool LocalSingleStoreElimPass::SingleStoreProcess(ir::Function* func) { + CalculateImmediateDominators(func); + bool modified = false; + for (auto bi = func->begin(); bi != func->end(); ++bi) { + uint32_t instIdx = 0; + for (auto ii = bi->begin(); ii != bi->end(); ++ii, ++instIdx) { + if (ii->opcode() != SpvOpLoad) continue; + uint32_t varId; + ir::Instruction* ptrInst = GetPtr(&*ii, &varId); + // Skip access chain loads + if (ptrInst->opcode() != SpvOpVariable) continue; + const auto vsi = ssa_var2store_.find(varId); + if (vsi == ssa_var2store_.end()) continue; + if (non_ssa_vars_.find(varId) != non_ssa_vars_.end()) continue; + // store must dominate load + if (!Dominates(store2blk_[vsi->second], store2idx_[vsi->second], &*bi, + instIdx)) + continue; + // Determine replacement id depending on OpStore or OpVariable + uint32_t replId; + if (vsi->second->opcode() == SpvOpStore) + replId = vsi->second->GetSingleWordInOperand(kStoreValIdInIdx); + else + replId = vsi->second->GetSingleWordInOperand(kVariableInitIdInIdx); + // Replace all instances of the load's id with the SSA value's id + // and add load to removal list + context()->KillNamesAndDecorates(&*ii); + context()->ReplaceAllUsesWith(ii->result_id(), replId); + modified = true; + } + } + return modified; +} + +bool LocalSingleStoreElimPass::LocalSingleStoreElim(ir::Function* func) { + bool modified = false; + SingleStoreAnalyze(func); + if (ssa_var2store_.empty()) return false; + modified |= SingleStoreProcess(func); + return modified; +} + +void LocalSingleStoreElimPass::Initialize(ir::IRContext* irContext) { + InitializeProcessing(irContext); + + // Initialize function and block maps + label2block_.clear(); + for (auto& fn : *get_module()) { + for (auto& blk : fn) { + uint32_t bid = blk.id(); + label2block_[bid] = &blk; + } + } + + // Initialize Target Type Caches + seen_target_vars_.clear(); + seen_non_target_vars_.clear(); + + // Initialize Supported Ref Pointer Cache + supported_ref_ptrs_.clear(); + + // Initialize extension whitelist + InitExtensions(); +} + +bool LocalSingleStoreElimPass::AllExtensionsSupported() const { + // If any extension not in whitelist, return false + for (auto& ei : get_module()->extensions()) { + const char* extName = + reinterpret_cast(&ei.GetInOperand(0).words[0]); + if (extensions_whitelist_.find(extName) == extensions_whitelist_.end()) + return false; + } + return true; +} + +Pass::Status LocalSingleStoreElimPass::ProcessImpl() { + // Assumes relaxed logical addressing only (see instruction.h) + if (context()->get_feature_mgr()->HasCapability(SpvCapabilityAddresses)) + return Status::SuccessWithoutChange; + // Do not process if module contains OpGroupDecorate. Additional + // support required in KillNamesAndDecorates(). + // TODO(greg-lunarg): Add support for OpGroupDecorate + for (auto& ai : get_module()->annotations()) + if (ai.opcode() == SpvOpGroupDecorate) return Status::SuccessWithoutChange; + // Do not process if any disallowed extensions are enabled + if (!AllExtensionsSupported()) return Status::SuccessWithoutChange; + // Process all entry point functions + ProcessFunction pfn = [this](ir::Function* fp) { + return LocalSingleStoreElim(fp); + }; + bool modified = ProcessEntryPointCallTree(pfn, get_module()); + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +LocalSingleStoreElimPass::LocalSingleStoreElimPass() {} + +Pass::Status LocalSingleStoreElimPass::Process(ir::IRContext* irContext) { + Initialize(irContext); + return ProcessImpl(); +} + +void LocalSingleStoreElimPass::InitExtensions() { + extensions_whitelist_.clear(); + extensions_whitelist_.insert({ + "SPV_AMD_shader_explicit_vertex_parameter", + "SPV_AMD_shader_trinary_minmax", + "SPV_AMD_gcn_shader", + "SPV_KHR_shader_ballot", + "SPV_AMD_shader_ballot", + "SPV_AMD_gpu_shader_half_float", + "SPV_KHR_shader_draw_parameters", + "SPV_KHR_subgroup_vote", + "SPV_KHR_16bit_storage", + "SPV_KHR_device_group", + "SPV_KHR_multiview", + "SPV_NVX_multiview_per_view_attributes", + "SPV_NV_viewport_array2", + "SPV_NV_stereo_view_rendering", + "SPV_NV_sample_mask_override_coverage", + "SPV_NV_geometry_shader_passthrough", + "SPV_AMD_texture_gather_bias_lod", + "SPV_KHR_storage_buffer_storage_class", + // SPV_KHR_variable_pointers + // Currently do not support extended pointer expressions + "SPV_AMD_gpu_shader_int16", + "SPV_KHR_post_depth_coverage", + "SPV_KHR_shader_atomic_counter_ops", + "SPV_EXT_shader_stencil_export", + "SPV_EXT_shader_viewport_index_layer", + "SPV_AMD_shader_image_load_store_lod", + "SPV_AMD_shader_fragment_mask", + "SPV_EXT_fragment_fully_covered", + "SPV_AMD_gpu_shader_half_float_fetch", + "SPV_GOOGLE_decorate_string", + "SPV_GOOGLE_hlsl_functionality1", + "SPV_NV_shader_subgroup_partitioned", + "SPV_EXT_descriptor_indexing", + }); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_single_store_elim_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_single_store_elim_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_single_store_elim_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_single_store_elim_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,149 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#ifndef LIBSPIRV_OPT_LOCAL_SINGLE_STORE_ELIM_PASS_H_ +#define LIBSPIRV_OPT_LOCAL_SINGLE_STORE_ELIM_PASS_H_ + +#include +#include +#include +#include +#include +#include + +#include "basic_block.h" +#include "def_use_manager.h" +#include "mem_pass.h" +#include "module.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class LocalSingleStoreElimPass : public MemPass { + using cbb_ptr = const ir::BasicBlock*; + + public: + LocalSingleStoreElimPass(); + const char* name() const override { return "eliminate-local-single-store"; } + Status Process(ir::IRContext* irContext) override; + + ir::IRContext::Analysis GetPreservedAnalyses() override { + return ir::IRContext::kAnalysisDefUse; + } + + private: + // Return true if all refs through |ptrId| are only loads or stores and + // cache ptrId in supported_ref_ptrs_. TODO(dnovillo): This function is + // replicated in other passes and it's slightly different in every pass. Is it + // possible to make one common implementation? + bool HasOnlySupportedRefs(uint32_t ptrId); + + // Find all function scope variables in |func| that are stored to + // only once (SSA) and map to their stored value id. Only analyze + // variables of scalar, vector, matrix types and struct and array + // types comprising only these types. Currently this analysis is + // is not done in the presence of function calls. TODO(): Allow + // analysis in the presence of function calls. + void SingleStoreAnalyze(ir::Function* func); + + using GetBlocksFunction = + std::function*(const ir::BasicBlock*)>; + + /// Returns the block successors function for the augmented CFG. + GetBlocksFunction AugmentedCFGSuccessorsFunction() const; + + /// Returns the block predecessors function for the augmented CFG. + GetBlocksFunction AugmentedCFGPredecessorsFunction() const; + + // Calculate immediate dominators for |func|'s CFG. Leaves result + // in idom_. Entries for augmented CFG (pseudo blocks) are not created. + // TODO(dnovillo): Move to new CFG class. + void CalculateImmediateDominators(ir::Function* func); + + // Return true if instruction in |blk0| at ordinal position |idx0| + // dominates instruction in |blk1| at position |idx1|. + bool Dominates(ir::BasicBlock* blk0, uint32_t idx0, ir::BasicBlock* blk1, + uint32_t idx1); + + // For each load of an SSA variable in |func|, replace all uses of + // the load with the value stored if the store dominates the load. + // Assumes that SingleStoreAnalyze() has just been run. Return true + // if any instructions are modified. + bool SingleStoreProcess(ir::Function* func); + + // Do "single-store" optimization of function variables defined only + // with a single non-access-chain store in |func|. Replace all their + // non-access-chain loads with the value that is stored and eliminate + // any resulting dead code. + bool LocalSingleStoreElim(ir::Function* func); + + // Initialize extensions whitelist + void InitExtensions(); + + // Return true if all extensions in this module are allowed by this pass. + bool AllExtensionsSupported() const; + + void Initialize(ir::IRContext* irContext); + Pass::Status ProcessImpl(); + + // Map from block's label id to block + std::unordered_map label2block_; + + // Map from SSA Variable to its single store + std::unordered_map ssa_var2store_; + + // Map from store to its ordinal position in its block. + std::unordered_map store2idx_; + + // Map from store to its block. + std::unordered_map store2blk_; + + // Set of non-SSA Variables + std::unordered_set non_ssa_vars_; + + // Variables with only supported references, ie. loads and stores using + // variable directly or through non-ptr access chains. + std::unordered_set supported_ref_ptrs_; + + // CFG Predecessors + std::unordered_map> + predecessors_map_; + + // CFG Successors + std::unordered_map> + successors_map_; + + // CFG Augmented Predecessors + std::unordered_map> + augmented_predecessors_map_; + + // CFG Augmented Successors + std::unordered_map> + augmented_successors_map_; + + // Immediate Dominator Map + // If block has no idom it points to itself. + std::unordered_map idom_; + + // Extensions supported by this pass. + std::unordered_set extensions_whitelist_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_LOCAL_SINGLE_STORE_ELIM_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_ssa_elim_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_ssa_elim_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_ssa_elim_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_ssa_elim_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,111 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "local_ssa_elim_pass.h" + +#include "cfa.h" +#include "iterator.h" +#include "ssa_rewrite_pass.h" + +namespace spvtools { +namespace opt { + +void LocalMultiStoreElimPass::Initialize(ir::IRContext* c) { + InitializeProcessing(c); + + // Initialize extension whitelist + InitExtensions(); +} + +bool LocalMultiStoreElimPass::AllExtensionsSupported() const { + // If any extension not in whitelist, return false + for (auto& ei : get_module()->extensions()) { + const char* extName = + reinterpret_cast(&ei.GetInOperand(0).words[0]); + if (extensions_whitelist_.find(extName) == extensions_whitelist_.end()) + return false; + } + return true; +} + +Pass::Status LocalMultiStoreElimPass::ProcessImpl() { + // Assumes relaxed logical addressing only (see instruction.h) + // TODO(greg-lunarg): Add support for physical addressing + if (context()->get_feature_mgr()->HasCapability(SpvCapabilityAddresses)) + return Status::SuccessWithoutChange; + // Do not process if module contains OpGroupDecorate. Additional + // support required in KillNamesAndDecorates(). + // TODO(greg-lunarg): Add support for OpGroupDecorate + for (auto& ai : get_module()->annotations()) + if (ai.opcode() == SpvOpGroupDecorate) return Status::SuccessWithoutChange; + // Do not process if any disallowed extensions are enabled + if (!AllExtensionsSupported()) return Status::SuccessWithoutChange; + // Process functions + ProcessFunction pfn = [this](ir::Function* fp) { + return SSARewriter(this).RewriteFunctionIntoSSA(fp); + }; + bool modified = ProcessEntryPointCallTree(pfn, get_module()); + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +LocalMultiStoreElimPass::LocalMultiStoreElimPass() {} + +Pass::Status LocalMultiStoreElimPass::Process(ir::IRContext* c) { + Initialize(c); + return ProcessImpl(); +} + +void LocalMultiStoreElimPass::InitExtensions() { + extensions_whitelist_.clear(); + extensions_whitelist_.insert({ + "SPV_AMD_shader_explicit_vertex_parameter", + "SPV_AMD_shader_trinary_minmax", + "SPV_AMD_gcn_shader", + "SPV_KHR_shader_ballot", + "SPV_AMD_shader_ballot", + "SPV_AMD_gpu_shader_half_float", + "SPV_KHR_shader_draw_parameters", + "SPV_KHR_subgroup_vote", + "SPV_KHR_16bit_storage", + "SPV_KHR_device_group", + "SPV_KHR_multiview", + "SPV_NVX_multiview_per_view_attributes", + "SPV_NV_viewport_array2", + "SPV_NV_stereo_view_rendering", + "SPV_NV_sample_mask_override_coverage", + "SPV_NV_geometry_shader_passthrough", + "SPV_AMD_texture_gather_bias_lod", + "SPV_KHR_storage_buffer_storage_class", + // SPV_KHR_variable_pointers + // Currently do not support extended pointer expressions + "SPV_AMD_gpu_shader_int16", + "SPV_KHR_post_depth_coverage", + "SPV_KHR_shader_atomic_counter_ops", + "SPV_EXT_shader_stencil_export", + "SPV_EXT_shader_viewport_index_layer", + "SPV_AMD_shader_image_load_store_lod", + "SPV_AMD_shader_fragment_mask", + "SPV_EXT_fragment_fully_covered", + "SPV_AMD_gpu_shader_half_float_fetch", + "SPV_GOOGLE_decorate_string", + "SPV_GOOGLE_hlsl_functionality1", + "SPV_NV_shader_subgroup_partitioned", + "SPV_EXT_descriptor_indexing", + }); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_ssa_elim_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_ssa_elim_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/local_ssa_elim_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/local_ssa_elim_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#ifndef LIBSPIRV_OPT_LOCAL_SSA_ELIM_PASS_H_ +#define LIBSPIRV_OPT_LOCAL_SSA_ELIM_PASS_H_ + +#include +#include +#include +#include +#include +#include + +#include "basic_block.h" +#include "def_use_manager.h" +#include "mem_pass.h" +#include "module.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class LocalMultiStoreElimPass : public MemPass { + using cbb_ptr = const ir::BasicBlock*; + + public: + using GetBlocksFunction = + std::function*(const ir::BasicBlock*)>; + + LocalMultiStoreElimPass(); + const char* name() const override { return "eliminate-local-multi-store"; } + Status Process(ir::IRContext* c) override; + + ir::IRContext::Analysis GetPreservedAnalyses() override { + return ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping; + } + + private: + // Initialize extensions whitelist + void InitExtensions(); + + // Return true if all extensions in this module are allowed by this pass. + bool AllExtensionsSupported() const; + + void Initialize(ir::IRContext* c); + Pass::Status ProcessImpl(); + + // Extensions supported by this pass. + std::unordered_set extensions_whitelist_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_LOCAL_SSA_ELIM_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/log.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/log.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/log.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/log.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,231 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SPIRV_TOOLS_LOG_H_ +#define SPIRV_TOOLS_LOG_H_ + +#include +#include +#include +#include + +#include "spirv-tools/libspirv.hpp" + +// Asserts the given condition is true. Otherwise, sends a message to the +// consumer and exits the problem with failure code. Accepts the following +// formats: +// +// SPIRV_ASSERT(, ); +// SPIRV_ASSERT(, , ); +// SPIRV_ASSERT(, , +// , ); +// +// In the third format, the number of cannot exceed (5 - +// 2). If more arguments are wanted, grow PP_ARG_N and PP_NARGS in the below. +#if !defined(NDEBUG) +#define SPIRV_ASSERT(consumer, ...) SPIRV_ASSERT_IMPL(consumer, __VA_ARGS__) +#else +#define SPIRV_ASSERT(consumer, ...) +#endif + +// Logs a debug message to the consumer. Accepts the following formats: +// +// SPIRV_DEBUG(, ); +// SPIRV_DEBUG(, , ); +// +// In the second format, the number of cannot exceed (5 - +// 1). If more arguments are wanted, grow PP_ARG_N and PP_NARGS in the below. +#if !defined(NDEBUG) && defined(SPIRV_LOG_DEBUG) +#define SPIRV_DEBUG(consumer, ...) SPIRV_DEBUG_IMPL(consumer, __VA_ARGS__) +#else +#define SPIRV_DEBUG(consumer, ...) +#endif + +// Logs an error message to the consumer saying the given feature is +// unimplemented. +#define SPIRV_UNIMPLEMENTED(consumer, feature) \ + do { \ + spvtools::Log(consumer, SPV_MSG_INTERNAL_ERROR, __FILE__, \ + {__LINE__, 0, 0}, "unimplemented: " feature); \ + } while (0) + +// Logs an error message to the consumer saying the code location +// should be unreachable. +#define SPIRV_UNREACHABLE(consumer) \ + do { \ + spvtools::Log(consumer, SPV_MSG_INTERNAL_ERROR, __FILE__, \ + {__LINE__, 0, 0}, "unreachable"); \ + } while (0) + +// Helper macros for concatenating arguments. +#define SPIRV_CONCATENATE(a, b) SPIRV_CONCATENATE_(a, b) +#define SPIRV_CONCATENATE_(a, b) a##b + +// Helper macro to force expanding __VA_ARGS__ to satisfy MSVC compiler. +#define PP_EXPAND(x) x + +namespace spvtools { + +// Calls the given |consumer| by supplying the |message|. The |message| is from +// the given |source| and |location| and of the given severity |level|. +inline void Log(const MessageConsumer& consumer, spv_message_level_t level, + const char* source, const spv_position_t& position, + const char* message) { + if (consumer != nullptr) consumer(level, source, position, message); +} + +// Calls the given |consumer| by supplying the message composed according to the +// given |format|. The |message| is from the given |source| and |location| and +// of the given severity |level|. +template +void Logf(const MessageConsumer& consumer, spv_message_level_t level, + const char* source, const spv_position_t& position, + const char* format, Args&&... args) { +#if defined(_MSC_VER) && _MSC_VER < 1900 +// Sadly, snprintf() is not supported until Visual Studio 2015! +#define snprintf _snprintf +#endif + + enum { kInitBufferSize = 256 }; + + char message[kInitBufferSize]; + const int size = + snprintf(message, kInitBufferSize, format, std::forward(args)...); + + if (size >= 0 && size < kInitBufferSize) { + Log(consumer, level, source, position, message); + return; + } + + if (size >= 0) { + // The initial buffer is insufficient. Allocate a buffer of a larger size, + // and write to it instead. Force the size to be unsigned to avoid a + // warning in GCC 7.1. + std::vector longer_message(size + 1u); + snprintf(longer_message.data(), longer_message.size(), format, + std::forward(args)...); + Log(consumer, level, source, position, longer_message.data()); + return; + } + + Log(consumer, level, source, position, "cannot compose log message"); + +#if defined(_MSC_VER) && _MSC_VER < 1900 +#undef snprintf +#endif +} + +// Calls the given |consumer| by supplying the given error |message|. The +// |message| is from the given |source| and |location|. +inline void Error(const MessageConsumer& consumer, const char* source, + const spv_position_t& position, const char* message) { + Log(consumer, SPV_MSG_ERROR, source, position, message); +} + +// Calls the given |consumer| by supplying the error message composed according +// to the given |format|. The |message| is from the given |source| and +// |location|. +template +inline void Errorf(const MessageConsumer& consumer, const char* source, + const spv_position_t& position, const char* format, + Args&&... args) { + Logf(consumer, SPV_MSG_ERROR, source, position, format, + std::forward(args)...); +} + +} // namespace spvtools + +#define SPIRV_ASSERT_IMPL(consumer, ...) \ + PP_EXPAND(SPIRV_CONCATENATE(SPIRV_ASSERT_, PP_NARGS(__VA_ARGS__))( \ + consumer, __VA_ARGS__)) + +#define SPIRV_DEBUG_IMPL(consumer, ...) \ + PP_EXPAND(SPIRV_CONCATENATE(SPIRV_DEBUG_, PP_NARGS(__VA_ARGS__))( \ + consumer, __VA_ARGS__)) + +#define SPIRV_ASSERT_1(consumer, condition) \ + do { \ + if (!(condition)) { \ + spvtools::Log(consumer, SPV_MSG_INTERNAL_ERROR, __FILE__, \ + {__LINE__, 0, 0}, "assertion failed: " #condition); \ + std::exit(EXIT_FAILURE); \ + } \ + } while (0) + +#define SPIRV_ASSERT_2(consumer, condition, message) \ + do { \ + if (!(condition)) { \ + spvtools::Log(consumer, SPV_MSG_INTERNAL_ERROR, __FILE__, \ + {__LINE__, 0, 0}, "assertion failed: " message); \ + std::exit(EXIT_FAILURE); \ + } \ + } while (0) + +#define SPIRV_ASSERT_more(consumer, condition, format, ...) \ + do { \ + if (!(condition)) { \ + spvtools::Logf(consumer, SPV_MSG_INTERNAL_ERROR, __FILE__, \ + {__LINE__, 0, 0}, "assertion failed: " format, \ + __VA_ARGS__); \ + std::exit(EXIT_FAILURE); \ + } \ + } while (0) + +#define SPIRV_ASSERT_3(consumer, condition, format, ...) \ + SPIRV_ASSERT_more(consumer, condition, format, __VA_ARGS__) + +#define SPIRV_ASSERT_4(consumer, condition, format, ...) \ + SPIRV_ASSERT_more(consumer, condition, format, __VA_ARGS__) + +#define SPIRV_ASSERT_5(consumer, condition, format, ...) \ + SPIRV_ASSERT_more(consumer, condition, format, __VA_ARGS__) + +#define SPIRV_DEBUG_1(consumer, message) \ + do { \ + spvtools::Log(consumer, SPV_MSG_DEBUG, __FILE__, {__LINE__, 0, 0}, \ + message); \ + } while (0) + +#define SPIRV_DEBUG_more(consumer, format, ...) \ + do { \ + spvtools::Logf(consumer, SPV_MSG_DEBUG, __FILE__, {__LINE__, 0, 0}, \ + format, __VA_ARGS__); \ + } while (0) + +#define SPIRV_DEBUG_2(consumer, format, ...) \ + SPIRV_DEBUG_more(consumer, format, __VA_ARGS__) + +#define SPIRV_DEBUG_3(consumer, format, ...) \ + SPIRV_DEBUG_more(consumer, format, __VA_ARGS__) + +#define SPIRV_DEBUG_4(consumer, format, ...) \ + SPIRV_DEBUG_more(consumer, format, __VA_ARGS__) + +#define SPIRV_DEBUG_5(consumer, format, ...) \ + SPIRV_DEBUG_more(consumer, format, __VA_ARGS__) + +// Macros for counting the number of arguments passed in. +#define PP_NARGS(...) PP_EXPAND(PP_ARG_N(__VA_ARGS__, 5, 4, 3, 2, 1, 0)) +#define PP_ARG_N(_1, _2, _3, _4, _5, N, ...) N + +// Tests for making sure that PP_NARGS() behaves as expected. +static_assert(PP_NARGS(0) == 1, "PP_NARGS macro error"); +static_assert(PP_NARGS(0, 0) == 2, "PP_NARGS macro error"); +static_assert(PP_NARGS(0, 0, 0) == 3, "PP_NARGS macro error"); +static_assert(PP_NARGS(0, 0, 0, 0) == 4, "PP_NARGS macro error"); +static_assert(PP_NARGS(0, 0, 0, 0, 0) == 5, "PP_NARGS macro error"); +static_assert(PP_NARGS(1 + 1, 2, 3 / 3) == 3, "PP_NARGS macro error"); +static_assert(PP_NARGS((1, 1), 2, (3, 3)) == 3, "PP_NARGS macro error"); + +#endif // SPIRV_TOOLS_LOG_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_descriptor.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_descriptor.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_descriptor.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_descriptor.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,908 @@ +// Copyright (c) 2017 Google 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. + +#include "opt/loop_descriptor.h" +#include +#include +#include +#include +#include + +#include "constants.h" +#include "opt/cfg.h" +#include "opt/dominator_tree.h" +#include "opt/ir_builder.h" +#include "opt/ir_context.h" +#include "opt/iterator.h" +#include "opt/make_unique.h" +#include "opt/tree_iterator.h" + +namespace spvtools { +namespace ir { + +// Takes in a phi instruction |induction| and the loop |header| and returns the +// step operation of the loop. +ir::Instruction* Loop::GetInductionStepOperation( + const ir::Instruction* induction) const { + // Induction must be a phi instruction. + assert(induction->opcode() == SpvOpPhi); + + ir::Instruction* step = nullptr; + + opt::analysis::DefUseManager* def_use_manager = context_->get_def_use_mgr(); + + // Traverse the incoming operands of the phi instruction. + for (uint32_t operand_id = 1; operand_id < induction->NumInOperands(); + operand_id += 2) { + // Incoming edge. + ir::BasicBlock* incoming_block = + context_->cfg()->block(induction->GetSingleWordInOperand(operand_id)); + + // Check if the block is dominated by header, and thus coming from within + // the loop. + if (IsInsideLoop(incoming_block)) { + step = def_use_manager->GetDef( + induction->GetSingleWordInOperand(operand_id - 1)); + break; + } + } + + if (!step || !IsSupportedStepOp(step->opcode())) { + return nullptr; + } + + // The induction variable which binds the loop must only be modified once. + uint32_t lhs = step->GetSingleWordInOperand(0); + uint32_t rhs = step->GetSingleWordInOperand(1); + + // One of the left hand side or right hand side of the step instruction must + // be the induction phi and the other must be an OpConstant. + if (lhs != induction->result_id() && rhs != induction->result_id()) { + return nullptr; + } + + if (def_use_manager->GetDef(lhs)->opcode() != SpvOp::SpvOpConstant && + def_use_manager->GetDef(rhs)->opcode() != SpvOp::SpvOpConstant) { + return nullptr; + } + + return step; +} + +// Returns true if the |step| operation is an induction variable step operation +// which is currently handled. +bool Loop::IsSupportedStepOp(SpvOp step) const { + switch (step) { + case SpvOp::SpvOpISub: + case SpvOp::SpvOpIAdd: + return true; + default: + return false; + } +} + +bool Loop::IsSupportedCondition(SpvOp condition) const { + switch (condition) { + // < + case SpvOp::SpvOpULessThan: + case SpvOp::SpvOpSLessThan: + // > + case SpvOp::SpvOpUGreaterThan: + case SpvOp::SpvOpSGreaterThan: + + // >= + case SpvOp::SpvOpSGreaterThanEqual: + case SpvOp::SpvOpUGreaterThanEqual: + // <= + case SpvOp::SpvOpSLessThanEqual: + case SpvOp::SpvOpULessThanEqual: + + return true; + default: + return false; + } +} + +int64_t Loop::GetResidualConditionValue(SpvOp condition, int64_t initial_value, + int64_t step_value, + size_t number_of_iterations, + size_t factor) { + int64_t remainder = + initial_value + (number_of_iterations % factor) * step_value; + + // We subtract or add one as the above formula calculates the remainder if the + // loop where just less than or greater than. Adding or subtracting one should + // give a functionally equivalent value. + switch (condition) { + case SpvOp::SpvOpSGreaterThanEqual: + case SpvOp::SpvOpUGreaterThanEqual: { + remainder -= 1; + break; + } + case SpvOp::SpvOpSLessThanEqual: + case SpvOp::SpvOpULessThanEqual: { + remainder += 1; + break; + } + + default: + break; + } + return remainder; +} + +// Extract the initial value from the |induction| OpPhi instruction and store it +// in |value|. If the function couldn't find the initial value of |induction| +// return false. +bool Loop::GetInductionInitValue(const ir::Instruction* induction, + int64_t* value) const { + ir::Instruction* constant_instruction = nullptr; + opt::analysis::DefUseManager* def_use_manager = context_->get_def_use_mgr(); + + for (uint32_t operand_id = 0; operand_id < induction->NumInOperands(); + operand_id += 2) { + ir::BasicBlock* bb = context_->cfg()->block( + induction->GetSingleWordInOperand(operand_id + 1)); + + if (!IsInsideLoop(bb)) { + constant_instruction = def_use_manager->GetDef( + induction->GetSingleWordInOperand(operand_id)); + } + } + + if (!constant_instruction) return false; + + const opt::analysis::Constant* constant = + context_->get_constant_mgr()->FindDeclaredConstant( + constant_instruction->result_id()); + if (!constant) return false; + + if (value) { + const opt::analysis::Integer* type = + constant->AsIntConstant()->type()->AsInteger(); + + if (type->IsSigned()) { + *value = constant->AsIntConstant()->GetS32BitValue(); + } else { + *value = constant->AsIntConstant()->GetU32BitValue(); + } + } + + return true; +} + +Loop::Loop(IRContext* context, opt::DominatorAnalysis* dom_analysis, + BasicBlock* header, BasicBlock* continue_target, + BasicBlock* merge_target) + : context_(context), + loop_header_(header), + loop_continue_(continue_target), + loop_merge_(merge_target), + loop_preheader_(nullptr), + parent_(nullptr), + loop_is_marked_for_removal_(false) { + assert(context); + assert(dom_analysis); + loop_preheader_ = FindLoopPreheader(dom_analysis); +} + +BasicBlock* Loop::FindLoopPreheader(opt::DominatorAnalysis* dom_analysis) { + CFG* cfg = context_->cfg(); + opt::DominatorTree& dom_tree = dom_analysis->GetDomTree(); + opt::DominatorTreeNode* header_node = dom_tree.GetTreeNode(loop_header_); + + // The loop predecessor. + BasicBlock* loop_pred = nullptr; + + auto header_pred = cfg->preds(loop_header_->id()); + for (uint32_t p_id : header_pred) { + opt::DominatorTreeNode* node = dom_tree.GetTreeNode(p_id); + if (node && !dom_tree.Dominates(header_node, node)) { + // The predecessor is not part of the loop, so potential loop preheader. + if (loop_pred && node->bb_ != loop_pred) { + // If we saw 2 distinct predecessors that are outside the loop, we don't + // have a loop preheader. + return nullptr; + } + loop_pred = node->bb_; + } + } + // Safe guard against invalid code, SPIR-V spec forbids loop with the entry + // node as header. + assert(loop_pred && "The header node is the entry block ?"); + + // So we have a unique basic block that can enter this loop. + // If this loop is the unique successor of this block, then it is a loop + // preheader. + bool is_preheader = true; + uint32_t loop_header_id = loop_header_->id(); + const auto* const_loop_pred = loop_pred; + const_loop_pred->ForEachSuccessorLabel( + [&is_preheader, loop_header_id](const uint32_t id) { + if (id != loop_header_id) is_preheader = false; + }); + if (is_preheader) return loop_pred; + return nullptr; +} + +bool Loop::IsInsideLoop(Instruction* inst) const { + const BasicBlock* parent_block = context_->get_instr_block(inst); + if (!parent_block) return false; + return IsInsideLoop(parent_block); +} + +bool Loop::IsBasicBlockInLoopSlow(const BasicBlock* bb) { + assert(bb->GetParent() && "The basic block does not belong to a function"); + opt::DominatorAnalysis* dom_analysis = + context_->GetDominatorAnalysis(bb->GetParent(), *context_->cfg()); + if (dom_analysis->IsReachable(bb) && + !dom_analysis->Dominates(GetHeaderBlock(), bb)) + return false; + + return true; +} + +BasicBlock* Loop::GetOrCreatePreHeaderBlock() { + if (loop_preheader_) return loop_preheader_; + + CFG* cfg = context_->cfg(); + loop_header_ = cfg->SplitLoopHeader(loop_header_); + return loop_preheader_; +} + +void Loop::SetLatchBlock(BasicBlock* latch) { +#ifndef NDEBUG + assert(latch->GetParent() && "The basic block does not belong to a function"); + + const auto* const_latch = latch; + const_latch->ForEachSuccessorLabel([this](uint32_t id) { + assert((!IsInsideLoop(id) || id == GetHeaderBlock()->id()) && + "A predecessor of the continue block does not belong to the loop"); + }); +#endif // NDEBUG + assert(IsInsideLoop(latch) && "The continue block is not in the loop"); + + SetLatchBlockImpl(latch); +} + +void Loop::SetMergeBlock(BasicBlock* merge) { +#ifndef NDEBUG + assert(merge->GetParent() && "The basic block does not belong to a function"); +#endif // NDEBUG + assert(!IsInsideLoop(merge) && "The merge block is in the loop"); + + SetMergeBlockImpl(merge); + if (GetHeaderBlock()->GetLoopMergeInst()) { + UpdateLoopMergeInst(); + } +} + +void Loop::SetPreHeaderBlock(BasicBlock* preheader) { + if (preheader) { + assert(!IsInsideLoop(preheader) && "The preheader block is in the loop"); + assert(preheader->tail()->opcode() == SpvOpBranch && + "The preheader block does not unconditionally branch to the header " + "block"); + assert(preheader->tail()->GetSingleWordOperand(0) == + GetHeaderBlock()->id() && + "The preheader block does not unconditionally branch to the header " + "block"); + } + loop_preheader_ = preheader; +} + +void Loop::GetExitBlocks(std::unordered_set* exit_blocks) const { + ir::CFG* cfg = context_->cfg(); + exit_blocks->clear(); + + for (uint32_t bb_id : GetBlocks()) { + const spvtools::ir::BasicBlock* bb = cfg->block(bb_id); + bb->ForEachSuccessorLabel([exit_blocks, this](uint32_t succ) { + if (!IsInsideLoop(succ)) { + exit_blocks->insert(succ); + } + }); + } +} + +void Loop::GetMergingBlocks( + std::unordered_set* merging_blocks) const { + assert(GetMergeBlock() && "This loop is not structured"); + ir::CFG* cfg = context_->cfg(); + merging_blocks->clear(); + + std::stack to_visit; + to_visit.push(GetMergeBlock()); + while (!to_visit.empty()) { + const ir::BasicBlock* bb = to_visit.top(); + to_visit.pop(); + merging_blocks->insert(bb->id()); + for (uint32_t pred_id : cfg->preds(bb->id())) { + if (!IsInsideLoop(pred_id) && !merging_blocks->count(pred_id)) { + to_visit.push(cfg->block(pred_id)); + } + } + } +} + +namespace { + +static inline bool IsBasicBlockSafeToClone(IRContext* context, BasicBlock* bb) { + for (ir::Instruction& inst : *bb) { + if (!inst.IsBranch() && !context->IsCombinatorInstruction(&inst)) + return false; + } + + return true; +} + +} // namespace + +bool Loop::IsSafeToClone() const { + ir::CFG& cfg = *context_->cfg(); + + for (uint32_t bb_id : GetBlocks()) { + BasicBlock* bb = cfg.block(bb_id); + assert(bb); + if (!IsBasicBlockSafeToClone(context_, bb)) return false; + } + + // Look at the merge construct. + if (GetHeaderBlock()->GetLoopMergeInst()) { + std::unordered_set blocks; + GetMergingBlocks(&blocks); + blocks.erase(GetMergeBlock()->id()); + for (uint32_t bb_id : blocks) { + BasicBlock* bb = cfg.block(bb_id); + assert(bb); + if (!IsBasicBlockSafeToClone(context_, bb)) return false; + } + } + + return true; +} + +bool Loop::IsLCSSA() const { + ir::CFG* cfg = context_->cfg(); + opt::analysis::DefUseManager* def_use_mgr = context_->get_def_use_mgr(); + + std::unordered_set exit_blocks; + GetExitBlocks(&exit_blocks); + + // Declare ir_context so we can capture context_ in the below lambda + ir::IRContext* ir_context = context_; + + for (uint32_t bb_id : GetBlocks()) { + for (Instruction& insn : *cfg->block(bb_id)) { + // All uses must be either: + // - In the loop; + // - In an exit block and in a phi instruction. + if (!def_use_mgr->WhileEachUser( + &insn, + [&exit_blocks, ir_context, this](ir::Instruction* use) -> bool { + BasicBlock* parent = ir_context->get_instr_block(use); + assert(parent && "Invalid analysis"); + if (IsInsideLoop(parent)) return true; + if (use->opcode() != SpvOpPhi) return false; + return exit_blocks.count(parent->id()); + })) + return false; + } + } + return true; +} + +bool Loop::ShouldHoistInstruction(IRContext* context, Instruction* inst) { + return AreAllOperandsOutsideLoop(context, inst) && + inst->IsOpcodeCodeMotionSafe(); +} + +bool Loop::AreAllOperandsOutsideLoop(IRContext* context, Instruction* inst) { + opt::analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); + bool all_outside_loop = true; + + const std::function operand_outside_loop = + [this, &def_use_mgr, &all_outside_loop](uint32_t* id) { + if (this->IsInsideLoop(def_use_mgr->GetDef(*id))) { + all_outside_loop = false; + return; + } + }; + + inst->ForEachInId(operand_outside_loop); + return all_outside_loop; +} + +void Loop::ComputeLoopStructuredOrder( + std::vector* ordered_loop_blocks, bool include_pre_header, + bool include_merge) const { + ir::CFG& cfg = *context_->cfg(); + + // Reserve the memory: all blocks in the loop + extra if needed. + ordered_loop_blocks->reserve(GetBlocks().size() + include_pre_header + + include_merge); + + if (include_pre_header && GetPreHeaderBlock()) + ordered_loop_blocks->push_back(loop_preheader_); + cfg.ForEachBlockInReversePostOrder( + loop_header_, [ordered_loop_blocks, this](BasicBlock* bb) { + if (IsInsideLoop(bb)) ordered_loop_blocks->push_back(bb); + }); + if (include_merge && GetMergeBlock()) + ordered_loop_blocks->push_back(loop_merge_); +} + +LoopDescriptor::LoopDescriptor(const Function* f) + : loops_(), dummy_top_loop_(nullptr) { + PopulateList(f); +} + +LoopDescriptor::~LoopDescriptor() { ClearLoops(); } + +void LoopDescriptor::PopulateList(const Function* f) { + IRContext* context = f->GetParent()->context(); + + opt::DominatorAnalysis* dom_analysis = + context->GetDominatorAnalysis(f, *context->cfg()); + + ClearLoops(); + + // Post-order traversal of the dominator tree to find all the OpLoopMerge + // instructions. + opt::DominatorTree& dom_tree = dom_analysis->GetDomTree(); + for (opt::DominatorTreeNode& node : + ir::make_range(dom_tree.post_begin(), dom_tree.post_end())) { + Instruction* merge_inst = node.bb_->GetLoopMergeInst(); + if (merge_inst) { + bool all_backedge_unreachable = true; + for (uint32_t pid : context->cfg()->preds(node.bb_->id())) { + if (dom_analysis->IsReachable(pid) && + dom_analysis->Dominates(node.bb_->id(), pid)) { + all_backedge_unreachable = false; + break; + } + } + if (all_backedge_unreachable) + continue; // ignore this one, we actually never branch back. + + // The id of the merge basic block of this loop. + uint32_t merge_bb_id = merge_inst->GetSingleWordOperand(0); + + // The id of the continue basic block of this loop. + uint32_t continue_bb_id = merge_inst->GetSingleWordOperand(1); + + // The merge target of this loop. + BasicBlock* merge_bb = context->cfg()->block(merge_bb_id); + + // The continue target of this loop. + BasicBlock* continue_bb = context->cfg()->block(continue_bb_id); + + // The basic block containing the merge instruction. + BasicBlock* header_bb = context->get_instr_block(merge_inst); + + // Add the loop to the list of all the loops in the function. + Loop* current_loop = + new Loop(context, dom_analysis, header_bb, continue_bb, merge_bb); + loops_.push_back(current_loop); + + // We have a bottom-up construction, so if this loop has nested-loops, + // they are by construction at the tail of the loop list. + for (auto itr = loops_.rbegin() + 1; itr != loops_.rend(); ++itr) { + Loop* previous_loop = *itr; + + // If the loop already has a parent, then it has been processed. + if (previous_loop->HasParent()) continue; + + // If the current loop does not dominates the previous loop then it is + // not nested loop. + if (!dom_analysis->Dominates(header_bb, + previous_loop->GetHeaderBlock())) + continue; + // If the current loop merge dominates the previous loop then it is + // not nested loop. + if (dom_analysis->Dominates(merge_bb, previous_loop->GetHeaderBlock())) + continue; + + current_loop->AddNestedLoop(previous_loop); + } + opt::DominatorTreeNode* dom_merge_node = dom_tree.GetTreeNode(merge_bb); + for (opt::DominatorTreeNode& loop_node : + make_range(node.df_begin(), node.df_end())) { + // Check if we are in the loop. + if (dom_tree.Dominates(dom_merge_node, &loop_node)) continue; + current_loop->AddBasicBlock(loop_node.bb_); + basic_block_to_loop_.insert( + std::make_pair(loop_node.bb_->id(), current_loop)); + } + } + } + for (Loop* loop : loops_) { + if (!loop->HasParent()) dummy_top_loop_.nested_loops_.push_back(loop); + } +} + +ir::BasicBlock* Loop::FindConditionBlock() const { + const ir::Function& function = *loop_merge_->GetParent(); + ir::BasicBlock* condition_block = nullptr; + + const opt::DominatorAnalysis* dom_analysis = + context_->GetDominatorAnalysis(&function, *context_->cfg()); + ir::BasicBlock* bb = dom_analysis->ImmediateDominator(loop_merge_); + + if (!bb) return nullptr; + + const ir::Instruction& branch = *bb->ctail(); + + // Make sure the branch is a conditional branch. + if (branch.opcode() != SpvOpBranchConditional) return nullptr; + + // Make sure one of the two possible branches is to the merge block. + if (branch.GetSingleWordInOperand(1) == loop_merge_->id() || + branch.GetSingleWordInOperand(2) == loop_merge_->id()) { + condition_block = bb; + } + + return condition_block; +} + +bool Loop::FindNumberOfIterations(const ir::Instruction* induction, + const ir::Instruction* branch_inst, + size_t* iterations_out, + int64_t* step_value_out, + int64_t* init_value_out) const { + // From the branch instruction find the branch condition. + opt::analysis::DefUseManager* def_use_manager = context_->get_def_use_mgr(); + + // Condition instruction from the OpConditionalBranch. + ir::Instruction* condition = + def_use_manager->GetDef(branch_inst->GetSingleWordOperand(0)); + + assert(IsSupportedCondition(condition->opcode())); + + // Get the constant manager from the ir context. + opt::analysis::ConstantManager* const_manager = context_->get_constant_mgr(); + + // Find the constant value used by the condition variable. Exit out if it + // isn't a constant int. + const opt::analysis::Constant* upper_bound = + const_manager->FindDeclaredConstant(condition->GetSingleWordOperand(3)); + if (!upper_bound) return false; + + // Must be integer because of the opcode on the condition. + int64_t condition_value = 0; + + const opt::analysis::Integer* type = + upper_bound->AsIntConstant()->type()->AsInteger(); + + if (type->IsSigned()) { + condition_value = upper_bound->AsIntConstant()->GetS32BitValue(); + } else { + condition_value = upper_bound->AsIntConstant()->GetU32BitValue(); + } + + // Find the instruction which is stepping through the loop. + ir::Instruction* step_inst = GetInductionStepOperation(induction); + if (!step_inst) return false; + + // Find the constant value used by the condition variable. + const opt::analysis::Constant* step_constant = + const_manager->FindDeclaredConstant(step_inst->GetSingleWordOperand(3)); + if (!step_constant) return false; + + // Must be integer because of the opcode on the condition. + int64_t step_value = 0; + + const opt::analysis::Integer* step_type = + step_constant->AsIntConstant()->type()->AsInteger(); + + if (step_type->IsSigned()) { + step_value = step_constant->AsIntConstant()->GetS32BitValue(); + } else { + step_value = step_constant->AsIntConstant()->GetU32BitValue(); + } + + // If this is a subtraction step we should negate the step value. + if (step_inst->opcode() == SpvOp::SpvOpISub) { + step_value = -step_value; + } + + // Find the inital value of the loop and make sure it is a constant integer. + int64_t init_value = 0; + if (!GetInductionInitValue(induction, &init_value)) return false; + + // If iterations is non null then store the value in that. + int64_t num_itrs = GetIterations(condition->opcode(), condition_value, + init_value, step_value); + + // If the loop body will not be reached return false. + if (num_itrs <= 0) { + return false; + } + + if (iterations_out) { + assert(static_cast(num_itrs) <= std::numeric_limits::max()); + *iterations_out = static_cast(num_itrs); + } + + if (step_value_out) { + *step_value_out = step_value; + } + + if (init_value_out) { + *init_value_out = init_value; + } + + return true; +} + +// We retrieve the number of iterations using the following formula, diff / +// |step_value| where diff is calculated differently according to the +// |condition| and uses the |condition_value| and |init_value|. If diff / +// |step_value| is NOT cleanly divisable then we add one to the sum. +int64_t Loop::GetIterations(SpvOp condition, int64_t condition_value, + int64_t init_value, int64_t step_value) const { + int64_t diff = 0; + + switch (condition) { + case SpvOp::SpvOpSLessThan: + case SpvOp::SpvOpULessThan: { + // If the condition is not met to begin with the loop will never iterate. + if (!(init_value < condition_value)) return 0; + + diff = condition_value - init_value; + + // If the operation is a less then operation then the diff and step must + // have the same sign otherwise the induction will never cross the + // condition (either never true or always true). + if ((diff < 0 && step_value > 0) || (diff > 0 && step_value < 0)) { + return 0; + } + + break; + } + case SpvOp::SpvOpSGreaterThan: + case SpvOp::SpvOpUGreaterThan: { + // If the condition is not met to begin with the loop will never iterate. + if (!(init_value > condition_value)) return 0; + + diff = init_value - condition_value; + + // If the operation is a greater than operation then the diff and step + // must have opposite signs. Otherwise the condition will always be true + // or will never be true. + if ((diff < 0 && step_value < 0) || (diff > 0 && step_value > 0)) { + return 0; + } + + break; + } + + case SpvOp::SpvOpSGreaterThanEqual: + case SpvOp::SpvOpUGreaterThanEqual: { + // If the condition is not met to begin with the loop will never iterate. + if (!(init_value >= condition_value)) return 0; + + // We subract one to make it the same as SpvOpGreaterThan as it is + // functionally equivalent. + diff = init_value - (condition_value - 1); + + // If the operation is a greater than operation then the diff and step + // must have opposite signs. Otherwise the condition will always be true + // or will never be true. + if ((diff > 0 && step_value > 0) || (diff < 0 && step_value < 0)) { + return 0; + } + + break; + } + + case SpvOp::SpvOpSLessThanEqual: + case SpvOp::SpvOpULessThanEqual: { + // If the condition is not met to begin with the loop will never iterate. + if (!(init_value <= condition_value)) return 0; + + // We add one to make it the same as SpvOpLessThan as it is functionally + // equivalent. + diff = (condition_value + 1) - init_value; + + // If the operation is a less than operation then the diff and step must + // have the same sign otherwise the induction will never cross the + // condition (either never true or always true). + if ((diff < 0 && step_value > 0) || (diff > 0 && step_value < 0)) { + return 0; + } + + break; + } + + default: + assert(false && + "Could not retrieve number of iterations from the loop condition. " + "Condition is not supported."); + } + + // Take the abs of - step values. + step_value = llabs(step_value); + diff = llabs(diff); + int64_t result = diff / step_value; + + if (diff % step_value != 0) { + result += 1; + } + return result; +} + +// Returns the list of induction variables within the loop. +void Loop::GetInductionVariables( + std::vector& induction_variables) const { + for (ir::Instruction& inst : *loop_header_) { + if (inst.opcode() == SpvOp::SpvOpPhi) { + induction_variables.push_back(&inst); + } + } +} + +ir::Instruction* Loop::FindConditionVariable( + const ir::BasicBlock* condition_block) const { + // Find the branch instruction. + const ir::Instruction& branch_inst = *condition_block->ctail(); + + ir::Instruction* induction = nullptr; + // Verify that the branch instruction is a conditional branch. + if (branch_inst.opcode() == SpvOp::SpvOpBranchConditional) { + // From the branch instruction find the branch condition. + opt::analysis::DefUseManager* def_use_manager = context_->get_def_use_mgr(); + + // Find the instruction representing the condition used in the conditional + // branch. + ir::Instruction* condition = + def_use_manager->GetDef(branch_inst.GetSingleWordOperand(0)); + + // Ensure that the condition is a less than operation. + if (condition && IsSupportedCondition(condition->opcode())) { + // The left hand side operand of the operation. + ir::Instruction* variable_inst = + def_use_manager->GetDef(condition->GetSingleWordOperand(2)); + + // Make sure the variable instruction used is a phi. + if (!variable_inst || variable_inst->opcode() != SpvOpPhi) return nullptr; + + // Make sure the phi instruction only has two incoming blocks. Each + // incoming block will be represented by two in operands in the phi + // instruction, the value and the block which that value came from. We + // assume the cannocalised phi will have two incoming values, one from the + // preheader and one from the continue block. + size_t max_supported_operands = 4; + if (variable_inst->NumInOperands() == max_supported_operands) { + // The operand index of the first incoming block label. + uint32_t operand_label_1 = 1; + + // The operand index of the second incoming block label. + uint32_t operand_label_2 = 3; + + // Make sure one of them is the preheader. + if (variable_inst->GetSingleWordInOperand(operand_label_1) != + loop_preheader_->id() && + variable_inst->GetSingleWordInOperand(operand_label_2) != + loop_preheader_->id()) { + return nullptr; + } + + // And make sure that the other is the latch block. + if (variable_inst->GetSingleWordInOperand(operand_label_1) != + loop_continue_->id() && + variable_inst->GetSingleWordInOperand(operand_label_2) != + loop_continue_->id()) { + return nullptr; + } + } else { + return nullptr; + } + + if (!FindNumberOfIterations(variable_inst, &branch_inst, nullptr)) + return nullptr; + induction = variable_inst; + } + } + + return induction; +} + +// Add and remove loops which have been marked for addition and removal to +// maintain the state of the loop descriptor class. +void LoopDescriptor::PostModificationCleanup() { + LoopContainerType loops_to_remove_; + for (ir::Loop* loop : loops_) { + if (loop->IsMarkedForRemoval()) { + loops_to_remove_.push_back(loop); + if (loop->HasParent()) { + loop->GetParent()->RemoveChildLoop(loop); + } + } + } + + for (ir::Loop* loop : loops_to_remove_) { + loops_.erase(std::find(loops_.begin(), loops_.end(), loop)); + } + + for (auto& pair : loops_to_add_) { + ir::Loop* parent = pair.first; + ir::Loop* loop = pair.second; + + if (parent) { + loop->SetParent(nullptr); + parent->AddNestedLoop(loop); + + for (uint32_t block_id : loop->GetBlocks()) { + parent->AddBasicBlock(block_id); + } + } + + loops_.emplace_back(loop); + } + + loops_to_add_.clear(); +} + +void LoopDescriptor::ClearLoops() { + for (Loop* loop : loops_) { + delete loop; + } + loops_.clear(); +} + +// Adds a new loop nest to the descriptor set. +ir::Loop* LoopDescriptor::AddLoopNest(std::unique_ptr new_loop) { + ir::Loop* loop = new_loop.release(); + if (!loop->HasParent()) dummy_top_loop_.nested_loops_.push_back(loop); + // Iterate from inner to outer most loop, adding basic block to loop mapping + // as we go. + for (ir::Loop& current_loop : + make_range(iterator::begin(loop), iterator::end(nullptr))) { + loops_.push_back(¤t_loop); + for (uint32_t bb_id : current_loop.GetBlocks()) + basic_block_to_loop_.insert(std::make_pair(bb_id, ¤t_loop)); + } + + return loop; +} + +void LoopDescriptor::RemoveLoop(ir::Loop* loop) { + ir::Loop* parent = loop->GetParent() ? loop->GetParent() : &dummy_top_loop_; + parent->nested_loops_.erase(std::find(parent->nested_loops_.begin(), + parent->nested_loops_.end(), loop)); + std::for_each( + loop->nested_loops_.begin(), loop->nested_loops_.end(), + [loop](ir::Loop* sub_loop) { sub_loop->SetParent(loop->GetParent()); }); + parent->nested_loops_.insert(parent->nested_loops_.end(), + loop->nested_loops_.begin(), + loop->nested_loops_.end()); + for (uint32_t bb_id : loop->GetBlocks()) { + ir::Loop* l = FindLoopForBasicBlock(bb_id); + if (l == loop) { + SetBasicBlockToLoop(bb_id, l->GetParent()); + } else { + ForgetBasicBlock(bb_id); + } + } + + LoopContainerType::iterator it = + std::find(loops_.begin(), loops_.end(), loop); + assert(it != loops_.end()); + delete loop; + loops_.erase(it); +} + +} // namespace ir +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_descriptor.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_descriptor.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_descriptor.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_descriptor.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,527 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_LOOP_DESCRIPTORS_H_ +#define LIBSPIRV_OPT_LOOP_DESCRIPTORS_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include "opt/basic_block.h" +#include "opt/module.h" +#include "opt/tree_iterator.h" + +namespace spvtools { +namespace opt { +class DominatorAnalysis; +struct DominatorTreeNode; +} // namespace opt +namespace ir { +class IRContext; +class CFG; +class LoopDescriptor; + +// A class to represent and manipulate a loop in structured control flow. +class Loop { + // The type used to represent nested child loops. + using ChildrenList = std::vector; + + public: + using iterator = ChildrenList::iterator; + using const_iterator = ChildrenList::const_iterator; + using BasicBlockListTy = std::unordered_set; + + explicit Loop(IRContext* context) + : context_(context), + loop_header_(nullptr), + loop_continue_(nullptr), + loop_merge_(nullptr), + loop_preheader_(nullptr), + parent_(nullptr), + loop_is_marked_for_removal_(false) {} + + Loop(IRContext* context, opt::DominatorAnalysis* analysis, BasicBlock* header, + BasicBlock* continue_target, BasicBlock* merge_target); + + ~Loop() {} + + // Iterators over the immediate sub-loops. + inline iterator begin() { return nested_loops_.begin(); } + inline iterator end() { return nested_loops_.end(); } + inline const_iterator begin() const { return cbegin(); } + inline const_iterator end() const { return cend(); } + inline const_iterator cbegin() const { return nested_loops_.begin(); } + inline const_iterator cend() const { return nested_loops_.end(); } + + // Returns the header (first basic block of the loop). This block contains the + // OpLoopMerge instruction. + inline BasicBlock* GetHeaderBlock() { return loop_header_; } + inline const BasicBlock* GetHeaderBlock() const { return loop_header_; } + inline void SetHeaderBlock(BasicBlock* header) { loop_header_ = header; } + + // Updates the OpLoopMerge instruction to reflect the current state of the + // loop. + inline void UpdateLoopMergeInst() { + assert(GetHeaderBlock()->GetLoopMergeInst() && + "The loop is not structured"); + ir::Instruction* merge_inst = GetHeaderBlock()->GetLoopMergeInst(); + merge_inst->SetInOperand(0, {GetMergeBlock()->id()}); + } + + // Returns the latch basic block (basic block that holds the back-edge). + // These functions return nullptr if the loop is not structured (i.e. if it + // has more than one backedge). + inline BasicBlock* GetLatchBlock() { return loop_continue_; } + inline const BasicBlock* GetLatchBlock() const { return loop_continue_; } + // Sets |latch| as the loop unique block branching back to the header. + // A latch block must have the following properties: + // - |latch| must be in the loop; + // - must be the only block branching back to the header block. + void SetLatchBlock(BasicBlock* latch); + + // Returns the basic block which marks the end of the loop. + // These functions return nullptr if the loop is not structured. + inline BasicBlock* GetMergeBlock() { return loop_merge_; } + inline const BasicBlock* GetMergeBlock() const { return loop_merge_; } + // Sets |merge| as the loop merge block. A merge block must have the following + // properties: + // - |merge| must not be in the loop; + // - all its predecessors must be in the loop. + // - it must not be already used as merge block. + // If the loop has an OpLoopMerge in its header, this instruction is also + // updated. + void SetMergeBlock(BasicBlock* merge); + + // Returns the loop pre-header, nullptr means that the loop predecessor does + // not qualify as a preheader. + // The preheader is the unique predecessor that: + // - Dominates the loop header; + // - Has only the loop header as successor. + inline BasicBlock* GetPreHeaderBlock() { return loop_preheader_; } + + // Returns the loop pre-header. + inline const BasicBlock* GetPreHeaderBlock() const { return loop_preheader_; } + // Sets |preheader| as the loop preheader block. A preheader block must have + // the following properties: + // - |merge| must not be in the loop; + // - have an unconditional branch to the loop header. + void SetPreHeaderBlock(BasicBlock* preheader); + + // Returns the loop pre-header, if there is no suitable preheader it will be + // created. + BasicBlock* GetOrCreatePreHeaderBlock(); + + // Returns true if this loop contains any nested loops. + inline bool HasNestedLoops() const { return nested_loops_.size() != 0; } + + // Clears and fills |exit_blocks| with all basic blocks that are not in the + // loop and has at least one predecessor in the loop. + void GetExitBlocks(std::unordered_set* exit_blocks) const; + + // Clears and fills |merging_blocks| with all basic blocks that are + // post-dominated by the merge block. The merge block must exist. + // The set |merging_blocks| will only contain the merge block if it is + // unreachable. + void GetMergingBlocks(std::unordered_set* merging_blocks) const; + + // Returns true if the loop is in a Loop Closed SSA form. + // In LCSSA form, all in-loop definitions are used in the loop or in phi + // instructions in the loop exit blocks. + bool IsLCSSA() const; + + // Returns the depth of this loop in the loop nest. + // The outer-most loop has a depth of 1. + inline size_t GetDepth() const { + size_t lvl = 1; + for (const Loop* loop = GetParent(); loop; loop = loop->GetParent()) lvl++; + return lvl; + } + + inline size_t NumImmediateChildren() const { return nested_loops_.size(); } + + // Adds |nested| as a nested loop of this loop. Automatically register |this| + // as the parent of |nested|. + inline void AddNestedLoop(Loop* nested) { + assert(!nested->GetParent() && "The loop has another parent."); + nested_loops_.push_back(nested); + nested->SetParent(this); + } + + inline Loop* GetParent() { return parent_; } + inline const Loop* GetParent() const { return parent_; } + + inline bool HasParent() const { return parent_; } + + // Returns true if this loop is itself nested within another loop. + inline bool IsNested() const { return parent_ != nullptr; } + + // Returns the set of all basic blocks contained within the loop. Will be all + // BasicBlocks dominated by the header which are not also dominated by the + // loop merge block. + inline const BasicBlockListTy& GetBlocks() const { + return loop_basic_blocks_; + } + + // Returns true if the basic block |bb| is inside this loop. + inline bool IsInsideLoop(const BasicBlock* bb) const { + return IsInsideLoop(bb->id()); + } + + // Returns true if the basic block id |bb_id| is inside this loop. + inline bool IsInsideLoop(uint32_t bb_id) const { + return loop_basic_blocks_.count(bb_id); + } + + // Returns true if the instruction |inst| is inside this loop. + bool IsInsideLoop(Instruction* inst) const; + + // Adds the Basic Block |bb| to this loop and its parents. + void AddBasicBlock(const BasicBlock* bb) { AddBasicBlock(bb->id()); } + + // Adds the Basic Block with |id| to this loop and its parents. + void AddBasicBlock(uint32_t id) { + for (Loop* loop = this; loop != nullptr; loop = loop->parent_) { + loop->loop_basic_blocks_.insert(id); + } + } + + // Removes the Basic Block id |bb_id| from this loop and its parents. + // It the user responsibility to make sure the removed block is not a merge, + // header or continue block. + void RemoveBasicBlock(uint32_t bb_id) { + for (Loop* loop = this; loop != nullptr; loop = loop->parent_) { + loop->loop_basic_blocks_.erase(bb_id); + } + } + + // Removes all the basic blocks from the set of basic blocks within the loop. + // This does not affect any of the stored pointers to the header, preheader, + // merge, or continue blocks. + void ClearBlocks() { loop_basic_blocks_.clear(); } + + // Adds the Basic Block |bb| this loop and its parents. + void AddBasicBlockToLoop(const BasicBlock* bb) { + assert(IsBasicBlockInLoopSlow(bb) && + "Basic block does not belong to the loop"); + + AddBasicBlock(bb); + } + + // Returns the list of induction variables within the loop. + void GetInductionVariables(std::vector& inductions) const; + + // This function uses the |condition| to find the induction variable which is + // used by the loop condition within the loop. This only works if the loop is + // bound by a single condition and single induction variable. + ir::Instruction* FindConditionVariable(const ir::BasicBlock* condition) const; + + // Returns the number of iterations within a loop when given the |induction| + // variable and the loop |condition| check. It stores the found number of + // iterations in the output parameter |iterations| and optionally, the step + // value in |step_value| and the initial value of the induction variable in + // |init_value|. + bool FindNumberOfIterations(const ir::Instruction* induction, + const ir::Instruction* condition, + size_t* iterations, + int64_t* step_amount = nullptr, + int64_t* init_value = nullptr) const; + + // Returns the value of the OpLoopMerge control operand as a bool. Loop + // control can be None(0), Unroll(1), or DontUnroll(2). This function returns + // true if it is set to Unroll. + inline bool HasUnrollLoopControl() const { + assert(loop_header_); + if (!loop_header_->GetLoopMergeInst()) return false; + + return loop_header_->GetLoopMergeInst()->GetSingleWordOperand(2) == 1; + } + + // Finds the conditional block with a branch to the merge and continue blocks + // within the loop body. + ir::BasicBlock* FindConditionBlock() const; + + // Remove the child loop form this loop. + inline void RemoveChildLoop(Loop* loop) { + nested_loops_.erase( + std::find(nested_loops_.begin(), nested_loops_.end(), loop)); + loop->SetParent(nullptr); + } + + // Mark this loop to be removed later by a call to + // LoopDescriptor::PostModificationCleanup. + inline void MarkLoopForRemoval() { loop_is_marked_for_removal_ = true; } + + // Returns whether or not this loop has been marked for removal. + inline bool IsMarkedForRemoval() const { return loop_is_marked_for_removal_; } + + // Returns true if all nested loops have been marked for removal. + inline bool AreAllChildrenMarkedForRemoval() const { + for (const Loop* child : nested_loops_) { + if (!child->IsMarkedForRemoval()) { + return false; + } + } + return true; + } + + // Checks if the loop contains any instruction that will prevent it from being + // cloned. If the loop is structured, the merge construct is also considered. + bool IsSafeToClone() const; + + // Sets the parent loop of this loop, that is, a loop which contains this loop + // as a nested child loop. + inline void SetParent(Loop* parent) { parent_ = parent; } + + // Returns true is the instruction is invariant and safe to move wrt loop + bool ShouldHoistInstruction(IRContext* context, Instruction* inst); + + // Returns true if all operands of inst are in basic blocks not contained in + // loop + bool AreAllOperandsOutsideLoop(IRContext* context, Instruction* inst); + + // Extract the initial value from the |induction| variable and store it in + // |value|. If the function couldn't find the initial value of |induction| + // return false. + bool GetInductionInitValue(const ir::Instruction* induction, + int64_t* value) const; + + // Takes in a phi instruction |induction| and the loop |header| and returns + // the step operation of the loop. + ir::Instruction* GetInductionStepOperation( + const ir::Instruction* induction) const; + + // Returns true if we can deduce the number of loop iterations in the step + // operation |step|. IsSupportedCondition must also be true for the condition + // instruction. + bool IsSupportedStepOp(SpvOp step) const; + + // Returns true if we can deduce the number of loop iterations in the + // condition operation |condition|. IsSupportedStepOp must also be true for + // the step instruction. + bool IsSupportedCondition(SpvOp condition) const; + + // Creates the list of the loop's basic block in structured order and store + // the result in |ordered_loop_blocks|. If |include_pre_header| is true, the + // pre-header block will also be included at the beginning of the list if it + // exist. If |include_merge| is true, the merge block will also be included at + // the end of the list if it exist. + void ComputeLoopStructuredOrder( + std::vector* ordered_loop_blocks, + bool include_pre_header = false, bool include_merge = false) const; + + // Given the loop |condition|, |initial_value|, |step_value|, the trip count + // |number_of_iterations|, and the |unroll_factor| requested, get the new + // condition value for the residual loop. + static int64_t GetResidualConditionValue(SpvOp condition, + int64_t initial_value, + int64_t step_value, + size_t number_of_iterations, + size_t unroll_factor); + + private: + IRContext* context_; + // The block which marks the start of the loop. + BasicBlock* loop_header_; + + // The block which begins the body of the loop. + BasicBlock* loop_continue_; + + // The block which marks the end of the loop. + BasicBlock* loop_merge_; + + // The block immediately before the loop header. + BasicBlock* loop_preheader_; + + // A parent of a loop is the loop which contains it as a nested child loop. + Loop* parent_; + + // Nested child loops of this loop. + ChildrenList nested_loops_; + + // A set of all the basic blocks which comprise the loop structure. Will be + // computed only when needed on demand. + BasicBlockListTy loop_basic_blocks_; + + // Check that |bb| is inside the loop using domination property. + // Note: this is for assertion purposes only, IsInsideLoop should be used + // instead. + bool IsBasicBlockInLoopSlow(const BasicBlock* bb); + + // Returns the loop preheader if it exists, returns nullptr otherwise. + BasicBlock* FindLoopPreheader(opt::DominatorAnalysis* dom_analysis); + + // Sets |latch| as the loop unique continue block. No checks are performed + // here. + inline void SetLatchBlockImpl(BasicBlock* latch) { loop_continue_ = latch; } + // Sets |merge| as the loop merge block. No checks are performed here. + inline void SetMergeBlockImpl(BasicBlock* merge) { loop_merge_ = merge; } + + // Each differnt loop |condition| affects how we calculate the number of + // iterations using the |condition_value|, |init_value|, and |step_values| of + // the induction variable. This method will return the number of iterations in + // a loop with those values for a given |condition|. + int64_t GetIterations(SpvOp condition, int64_t condition_value, + int64_t init_value, int64_t step_value) const; + + // This is to allow for loops to be removed mid iteration without invalidating + // the iterators. + bool loop_is_marked_for_removal_; + + // This is only to allow LoopDescriptor::dummy_top_loop_ to add top level + // loops as child. + friend class LoopDescriptor; + friend class LoopUtils; +}; + +// Loop descriptions class for a given function. +// For a given function, the class builds loop nests information. +// The analysis expects a structured control flow. +class LoopDescriptor { + public: + // Iterator interface (depth first postorder traversal). + using iterator = opt::PostOrderTreeDFIterator; + using const_iterator = opt::PostOrderTreeDFIterator; + + // Creates a loop object for all loops found in |f|. + explicit LoopDescriptor(const Function* f); + + // Disable copy constructor, to avoid double-free on destruction. + LoopDescriptor(const LoopDescriptor&) = delete; + // Move constructor. + LoopDescriptor(LoopDescriptor&& other) : dummy_top_loop_(nullptr) { + // We need to take ownership of the Loop objects in the other + // LoopDescriptor, to avoid double-free. + loops_ = std::move(other.loops_); + other.loops_.clear(); + basic_block_to_loop_ = std::move(other.basic_block_to_loop_); + other.basic_block_to_loop_.clear(); + dummy_top_loop_ = std::move(other.dummy_top_loop_); + } + + // Destructor + ~LoopDescriptor(); + + // Returns the number of loops found in the function. + inline size_t NumLoops() const { return loops_.size(); } + + // Returns the loop at a particular |index|. The |index| must be in bounds, + // check with NumLoops before calling. + inline Loop& GetLoopByIndex(size_t index) const { + assert(loops_.size() > index && + "Index out of range (larger than loop count)"); + return *loops_[index]; + } + + // Returns the inner most loop that contains the basic block id |block_id|. + inline Loop* operator[](uint32_t block_id) const { + return FindLoopForBasicBlock(block_id); + } + + // Returns the inner most loop that contains the basic block |bb|. + inline Loop* operator[](const BasicBlock* bb) const { + return (*this)[bb->id()]; + } + + // Iterators for post order depth first traversal of the loops. + // Inner most loops will be visited first. + inline iterator begin() { return iterator::begin(&dummy_top_loop_); } + inline iterator end() { return iterator::end(&dummy_top_loop_); } + inline const_iterator begin() const { return cbegin(); } + inline const_iterator end() const { return cend(); } + inline const_iterator cbegin() const { + return const_iterator::begin(&dummy_top_loop_); + } + inline const_iterator cend() const { + return const_iterator::end(&dummy_top_loop_); + } + + // Returns the inner most loop that contains the basic block |bb|. + inline void SetBasicBlockToLoop(uint32_t bb_id, Loop* loop) { + basic_block_to_loop_[bb_id] = loop; + } + + // Mark the loop |loop_to_add| as needing to be added when the user calls + // PostModificationCleanup. |parent| may be null. + inline void AddLoop(ir::Loop* loop_to_add, ir::Loop* parent) { + loops_to_add_.emplace_back(std::make_pair(parent, loop_to_add)); + } + + // Should be called to preserve the LoopAnalysis after loops have been marked + // for addition with AddLoop or MarkLoopForRemoval. + void PostModificationCleanup(); + + // Removes the basic block id |bb_id| from the block to loop mapping. + inline void ForgetBasicBlock(uint32_t bb_id) { + basic_block_to_loop_.erase(bb_id); + } + + // Adds the loop |new_loop| and all its nested loops to the descriptor set. + // The object takes ownership of all the loops. + ir::Loop* AddLoopNest(std::unique_ptr new_loop); + + // Remove the loop |loop|. + void RemoveLoop(ir::Loop* loop); + + void SetAsTopLoop(ir::Loop* loop) { + assert(std::find(dummy_top_loop_.begin(), dummy_top_loop_.end(), loop) == + dummy_top_loop_.end() && + "already registered"); + dummy_top_loop_.nested_loops_.push_back(loop); + } + + Loop* GetDummyRootLoop() { return &dummy_top_loop_; } + const Loop* GetDummyRootLoop() const { return &dummy_top_loop_; } + + private: + // TODO(dneto): This should be a vector of unique_ptr. But VisualStudio 2013 + // is unable to compile it. + using LoopContainerType = std::vector; + using LoopsToAddContainerType = std::vector>; + + // Creates loop descriptors for the function |f|. + void PopulateList(const Function* f); + + // Returns the inner most loop that contains the basic block id |block_id|. + inline Loop* FindLoopForBasicBlock(uint32_t block_id) const { + std::unordered_map::const_iterator it = + basic_block_to_loop_.find(block_id); + return it != basic_block_to_loop_.end() ? it->second : nullptr; + } + + // Erase all the loop information. + void ClearLoops(); + + // A list of all the loops in the function. This variable owns the Loop + // objects. + LoopContainerType loops_; + + // Dummy root: this "loop" is only there to help iterators creation. + Loop dummy_top_loop_; + + std::unordered_map basic_block_to_loop_; + + // List of the loops marked for addition when PostModificationCleanup is + // called. + LoopsToAddContainerType loops_to_add_; +}; + +} // namespace ir +} // namespace spvtools + +#endif // LIBSPIRV_OPT_LOOP_DESCRIPTORS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_peeling.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_peeling.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_peeling.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_peeling.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,563 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include +#include +#include + +#include "ir_builder.h" +#include "ir_context.h" +#include "loop_descriptor.h" +#include "loop_peeling.h" +#include "loop_utils.h" + +namespace spvtools { +namespace opt { + +void LoopPeeling::DuplicateAndConnectLoop( + LoopUtils::LoopCloningResult* clone_results) { + ir::CFG& cfg = *context_->cfg(); + analysis::DefUseManager* def_use_mgr = context_->get_def_use_mgr(); + + assert(CanPeelLoop() && "Cannot peel loop!"); + + std::vector ordered_loop_blocks; + ir::BasicBlock* pre_header = loop_->GetOrCreatePreHeaderBlock(); + + loop_->ComputeLoopStructuredOrder(&ordered_loop_blocks); + + cloned_loop_ = loop_utils_.CloneLoop(clone_results, ordered_loop_blocks); + + // Add the basic block to the function. + ir::Function::iterator it = + loop_utils_.GetFunction()->FindBlock(pre_header->id()); + assert(it != loop_utils_.GetFunction()->end() && + "Pre-header not found in the function."); + loop_utils_.GetFunction()->AddBasicBlocks( + clone_results->cloned_bb_.begin(), clone_results->cloned_bb_.end(), ++it); + + // Make the |loop_|'s preheader the |cloned_loop_| one. + ir::BasicBlock* cloned_header = cloned_loop_->GetHeaderBlock(); + pre_header->ForEachSuccessorLabel( + [cloned_header](uint32_t* succ) { *succ = cloned_header->id(); }); + + // Update cfg. + cfg.RemoveEdge(pre_header->id(), loop_->GetHeaderBlock()->id()); + cloned_loop_->SetPreHeaderBlock(pre_header); + loop_->SetPreHeaderBlock(nullptr); + + // When cloning the loop, we didn't cloned the merge block, so currently + // |cloned_loop_| shares the same block as |loop_|. + // We mutate all branches from |cloned_loop_| block to |loop_|'s merge into a + // branch to |loop_|'s header (so header will also be the merge of + // |cloned_loop_|). + uint32_t cloned_loop_exit = 0; + for (uint32_t pred_id : cfg.preds(loop_->GetMergeBlock()->id())) { + if (loop_->IsInsideLoop(pred_id)) continue; + ir::BasicBlock* bb = cfg.block(pred_id); + assert(cloned_loop_exit == 0 && "The loop has multiple exits."); + cloned_loop_exit = bb->id(); + bb->ForEachSuccessorLabel([this](uint32_t* succ) { + if (*succ == loop_->GetMergeBlock()->id()) + *succ = loop_->GetHeaderBlock()->id(); + }); + } + + // Update cfg. + cfg.RemoveNonExistingEdges(loop_->GetMergeBlock()->id()); + cfg.AddEdge(cloned_loop_exit, loop_->GetHeaderBlock()->id()); + + // Patch the phi of the original loop header: + // - Set the loop entry branch to come from the cloned loop exit block; + // - Set the initial value of the phi using the corresponding cloned loop + // exit values. + // + // We patch the iterating value initializers of the original loop using the + // corresponding cloned loop exit values. Connects the cloned loop iterating + // values to the original loop. This make sure that the initial value of the + // second loop starts with the last value of the first loop. + // + // For example, loops like: + // + // int z = 0; + // for (int i = 0; i++ < M; i += cst1) { + // if (cond) + // z += cst2; + // } + // + // Will become: + // + // int z = 0; + // int i = 0; + // for (; i++ < M; i += cst1) { + // if (cond) + // z += cst2; + // } + // for (; i++ < M; i += cst1) { + // if (cond) + // z += cst2; + // } + loop_->GetHeaderBlock()->ForEachPhiInst([cloned_loop_exit, def_use_mgr, + clone_results, + this](ir::Instruction* phi) { + for (uint32_t i = 0; i < phi->NumInOperands(); i += 2) { + if (!loop_->IsInsideLoop(phi->GetSingleWordInOperand(i + 1))) { + phi->SetInOperand(i, + {clone_results->value_map_.at( + exit_value_.at(phi->result_id())->result_id())}); + phi->SetInOperand(i + 1, {cloned_loop_exit}); + def_use_mgr->AnalyzeInstUse(phi); + return; + } + } + }); + + // Force the creation of a new preheader for the original loop and set it as + // the merge block for the cloned loop. + cloned_loop_->SetMergeBlock(loop_->GetOrCreatePreHeaderBlock()); +} + +void LoopPeeling::InsertCanonicalInductionVariable() { + ir::BasicBlock::iterator insert_point = + GetClonedLoop()->GetLatchBlock()->tail(); + if (GetClonedLoop()->GetLatchBlock()->GetMergeInst()) { + --insert_point; + } + InstructionBuilder builder(context_, &*insert_point, + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping); + ir::Instruction* uint_1_cst = + builder.Add32BitConstantInteger(1, int_type_->IsSigned()); + // Create the increment. + // Note that we do "1 + 1" here, one of the operand should the phi + // value but we don't have it yet. The operand will be set latter. + ir::Instruction* iv_inc = builder.AddIAdd( + uint_1_cst->type_id(), uint_1_cst->result_id(), uint_1_cst->result_id()); + + builder.SetInsertPoint(&*GetClonedLoop()->GetHeaderBlock()->begin()); + + canonical_induction_variable_ = builder.AddPhi( + uint_1_cst->type_id(), + {builder.Add32BitConstantInteger(0, int_type_->IsSigned()) + ->result_id(), + GetClonedLoop()->GetPreHeaderBlock()->id(), iv_inc->result_id(), + GetClonedLoop()->GetLatchBlock()->id()}); + // Connect everything. + iv_inc->SetInOperand(0, {canonical_induction_variable_->result_id()}); + + // Update def/use manager. + context_->get_def_use_mgr()->AnalyzeInstUse(iv_inc); + + // If do-while form, use the incremented value. + if (do_while_form_) { + canonical_induction_variable_ = iv_inc; + } +} + +void LoopPeeling::GetIteratorUpdateOperations( + const ir::Loop* loop, ir::Instruction* iterator, + std::unordered_set* operations) { + opt::analysis::DefUseManager* def_use_mgr = context_->get_def_use_mgr(); + operations->insert(iterator); + iterator->ForEachInId([def_use_mgr, loop, operations, this](uint32_t* id) { + ir::Instruction* insn = def_use_mgr->GetDef(*id); + if (insn->opcode() == SpvOpLabel) { + return; + } + if (operations->count(insn)) { + return; + } + if (!loop->IsInsideLoop(insn)) { + return; + } + GetIteratorUpdateOperations(loop, insn, operations); + }); +} + +// Gather the set of blocks for all the path from |entry| to |root|. +static void GetBlocksInPath(uint32_t block, uint32_t entry, + std::unordered_set* blocks_in_path, + const ir::CFG& cfg) { + for (uint32_t pid : cfg.preds(block)) { + if (blocks_in_path->insert(pid).second) { + if (pid != entry) { + GetBlocksInPath(pid, entry, blocks_in_path, cfg); + } + } + } +} + +bool LoopPeeling::IsConditionCheckSideEffectFree() const { + ir::CFG& cfg = *context_->cfg(); + + // The "do-while" form does not cause issues, the algorithm takes into account + // the first iteration. + if (!do_while_form_) { + uint32_t condition_block_id = cfg.preds(loop_->GetMergeBlock()->id())[0]; + + std::unordered_set blocks_in_path; + + blocks_in_path.insert(condition_block_id); + GetBlocksInPath(condition_block_id, loop_->GetHeaderBlock()->id(), + &blocks_in_path, cfg); + + for (uint32_t bb_id : blocks_in_path) { + ir::BasicBlock* bb = cfg.block(bb_id); + if (!bb->WhileEachInst([this](ir::Instruction* insn) { + if (insn->IsBranch()) return true; + switch (insn->opcode()) { + case SpvOpLabel: + case SpvOpSelectionMerge: + case SpvOpLoopMerge: + return true; + default: + break; + } + return context_->IsCombinatorInstruction(insn); + })) { + return false; + } + } + } + + return true; +} + +void LoopPeeling::GetIteratingExitValues() { + ir::CFG& cfg = *context_->cfg(); + + loop_->GetHeaderBlock()->ForEachPhiInst([this](ir::Instruction* phi) { + exit_value_[phi->result_id()] = nullptr; + }); + + if (!loop_->GetMergeBlock()) { + return; + } + if (cfg.preds(loop_->GetMergeBlock()->id()).size() != 1) { + return; + } + opt::analysis::DefUseManager* def_use_mgr = context_->get_def_use_mgr(); + + uint32_t condition_block_id = cfg.preds(loop_->GetMergeBlock()->id())[0]; + + auto& header_pred = cfg.preds(loop_->GetHeaderBlock()->id()); + do_while_form_ = std::find(header_pred.begin(), header_pred.end(), + condition_block_id) != header_pred.end(); + if (do_while_form_) { + loop_->GetHeaderBlock()->ForEachPhiInst( + [condition_block_id, def_use_mgr, this](ir::Instruction* phi) { + std::unordered_set operations; + + for (uint32_t i = 0; i < phi->NumInOperands(); i += 2) { + if (condition_block_id == phi->GetSingleWordInOperand(i + 1)) { + exit_value_[phi->result_id()] = + def_use_mgr->GetDef(phi->GetSingleWordInOperand(i)); + } + } + }); + } else { + DominatorTree* dom_tree = + &context_->GetDominatorAnalysis(loop_utils_.GetFunction(), cfg) + ->GetDomTree(); + ir::BasicBlock* condition_block = cfg.block(condition_block_id); + + loop_->GetHeaderBlock()->ForEachPhiInst( + [dom_tree, condition_block, this](ir::Instruction* phi) { + std::unordered_set operations; + + // Not the back-edge value, check if the phi instruction is the only + // possible candidate. + GetIteratorUpdateOperations(loop_, phi, &operations); + + for (ir::Instruction* insn : operations) { + if (insn == phi) { + continue; + } + if (dom_tree->Dominates(context_->get_instr_block(insn), + condition_block)) { + return; + } + } + exit_value_[phi->result_id()] = phi; + }); + } +} + +void LoopPeeling::FixExitCondition( + const std::function& condition_builder) { + ir::CFG& cfg = *context_->cfg(); + + uint32_t condition_block_id = 0; + for (uint32_t id : cfg.preds(GetClonedLoop()->GetMergeBlock()->id())) { + if (GetClonedLoop()->IsInsideLoop(id)) { + condition_block_id = id; + break; + } + } + assert(condition_block_id != 0 && "2nd loop in improperly connected"); + + ir::BasicBlock* condition_block = cfg.block(condition_block_id); + ir::Instruction* exit_condition = condition_block->terminator(); + assert(exit_condition->opcode() == SpvOpBranchConditional); + ir::BasicBlock::iterator insert_point = condition_block->tail(); + if (condition_block->GetMergeInst()) { + --insert_point; + } + + exit_condition->SetInOperand(0, {condition_builder(&*insert_point)}); + + uint32_t to_continue_block_idx = + GetClonedLoop()->IsInsideLoop(exit_condition->GetSingleWordInOperand(1)) + ? 1 + : 2; + exit_condition->SetInOperand( + 1, {exit_condition->GetSingleWordInOperand(to_continue_block_idx)}); + exit_condition->SetInOperand(2, {GetClonedLoop()->GetMergeBlock()->id()}); + + // Update def/use manager. + context_->get_def_use_mgr()->AnalyzeInstUse(exit_condition); +} + +ir::BasicBlock* LoopPeeling::CreateBlockBefore(ir::BasicBlock* bb) { + analysis::DefUseManager* def_use_mgr = context_->get_def_use_mgr(); + ir::CFG& cfg = *context_->cfg(); + assert(cfg.preds(bb->id()).size() == 1 && "More than one predecessor"); + + std::unique_ptr new_bb = MakeUnique( + std::unique_ptr(new ir::Instruction( + context_, SpvOpLabel, 0, context_->TakeNextId(), {}))); + new_bb->SetParent(loop_utils_.GetFunction()); + // Update the loop descriptor. + ir::Loop* in_loop = (*loop_utils_.GetLoopDescriptor())[bb]; + if (in_loop) { + in_loop->AddBasicBlock(new_bb.get()); + loop_utils_.GetLoopDescriptor()->SetBasicBlockToLoop(new_bb->id(), in_loop); + } + + context_->set_instr_block(new_bb->GetLabelInst(), new_bb.get()); + def_use_mgr->AnalyzeInstDefUse(new_bb->GetLabelInst()); + + ir::BasicBlock* bb_pred = cfg.block(cfg.preds(bb->id())[0]); + bb_pred->tail()->ForEachInId([bb, &new_bb](uint32_t* id) { + if (*id == bb->id()) { + *id = new_bb->id(); + } + }); + cfg.RemoveEdge(bb_pred->id(), bb->id()); + cfg.AddEdge(bb_pred->id(), new_bb->id()); + def_use_mgr->AnalyzeInstUse(&*bb_pred->tail()); + + // Update the incoming branch. + bb->ForEachPhiInst([&new_bb, def_use_mgr](ir::Instruction* phi) { + phi->SetInOperand(1, {new_bb->id()}); + def_use_mgr->AnalyzeInstUse(phi); + }); + InstructionBuilder(context_, new_bb.get(), + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping) + .AddBranch(bb->id()); + cfg.AddEdge(new_bb->id(), bb->id()); + + // Add the basic block to the function. + ir::Function::iterator it = loop_utils_.GetFunction()->FindBlock(bb->id()); + assert(it != loop_utils_.GetFunction()->end() && + "Basic block not found in the function."); + ir::BasicBlock* ret = new_bb.get(); + loop_utils_.GetFunction()->AddBasicBlock(std::move(new_bb), it); + return ret; +} + +ir::BasicBlock* LoopPeeling::ProtectLoop(ir::Loop* loop, + ir::Instruction* condition, + ir::BasicBlock* if_merge) { + ir::BasicBlock* if_block = loop->GetOrCreatePreHeaderBlock(); + // Will no longer be a pre-header because of the if. + loop->SetPreHeaderBlock(nullptr); + // Kill the branch to the header. + context_->KillInst(&*if_block->tail()); + + InstructionBuilder builder(context_, if_block, + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping); + builder.AddConditionalBranch(condition->result_id(), + loop->GetHeaderBlock()->id(), if_merge->id(), + if_merge->id()); + + return if_block; +} + +void LoopPeeling::PeelBefore(uint32_t peel_factor) { + assert(CanPeelLoop() && "Cannot peel loop"); + LoopUtils::LoopCloningResult clone_results; + + // Clone the loop and insert the cloned one before the loop. + DuplicateAndConnectLoop(&clone_results); + + // Add a canonical induction variable "canonical_induction_variable_". + InsertCanonicalInductionVariable(); + + InstructionBuilder builder(context_, + &*cloned_loop_->GetPreHeaderBlock()->tail(), + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping); + ir::Instruction* factor = + builder.Add32BitConstantInteger(peel_factor, int_type_->IsSigned()); + + ir::Instruction* has_remaining_iteration = builder.AddLessThan( + factor->result_id(), loop_iteration_count_->result_id()); + ir::Instruction* max_iteration = builder.AddSelect( + factor->type_id(), has_remaining_iteration->result_id(), + factor->result_id(), loop_iteration_count_->result_id()); + + // Change the exit condition of the cloned loop to be (exit when become + // false): + // "canonical_induction_variable_" < min("factor", "loop_iteration_count_") + FixExitCondition([max_iteration, this](ir::Instruction* insert_before_point) { + return InstructionBuilder(context_, insert_before_point, + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping) + .AddLessThan(canonical_induction_variable_->result_id(), + max_iteration->result_id()) + ->result_id(); + }); + + // "Protect" the second loop: the second loop can only be executed if + // |has_remaining_iteration| is true (i.e. factor < loop_iteration_count_). + ir::BasicBlock* if_merge_block = loop_->GetMergeBlock(); + loop_->SetMergeBlock(CreateBlockBefore(loop_->GetMergeBlock())); + // Prevent the second loop from being executed if we already executed all the + // required iterations. + ir::BasicBlock* if_block = + ProtectLoop(loop_, has_remaining_iteration, if_merge_block); + // Patch the phi of the merge block. + if_merge_block->ForEachPhiInst( + [&clone_results, if_block, this](ir::Instruction* phi) { + // if_merge_block had previously only 1 predecessor. + uint32_t incoming_value = phi->GetSingleWordInOperand(0); + auto def_in_loop = clone_results.value_map_.find(incoming_value); + if (def_in_loop != clone_results.value_map_.end()) + incoming_value = def_in_loop->second; + phi->AddOperand( + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {incoming_value}}); + phi->AddOperand( + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {if_block->id()}}); + context_->get_def_use_mgr()->AnalyzeInstUse(phi); + }); + + context_->InvalidateAnalysesExceptFor( + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping | + ir::IRContext::kAnalysisLoopAnalysis | ir::IRContext::kAnalysisCFG); +} + +void LoopPeeling::PeelAfter(uint32_t peel_factor) { + assert(CanPeelLoop() && "Cannot peel loop"); + LoopUtils::LoopCloningResult clone_results; + + // Clone the loop and insert the cloned one before the loop. + DuplicateAndConnectLoop(&clone_results); + + // Add a canonical induction variable "canonical_induction_variable_". + InsertCanonicalInductionVariable(); + + InstructionBuilder builder(context_, + &*cloned_loop_->GetPreHeaderBlock()->tail(), + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping); + ir::Instruction* factor = + builder.Add32BitConstantInteger(peel_factor, int_type_->IsSigned()); + + ir::Instruction* has_remaining_iteration = builder.AddLessThan( + factor->result_id(), loop_iteration_count_->result_id()); + + // Change the exit condition of the cloned loop to be (exit when become + // false): + // "canonical_induction_variable_" + "factor" < "loop_iteration_count_" + FixExitCondition([factor, this](ir::Instruction* insert_before_point) { + InstructionBuilder cond_builder( + context_, insert_before_point, + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping); + // Build the following check: canonical_induction_variable_ + factor < + // iteration_count + return cond_builder + .AddLessThan(cond_builder + .AddIAdd(canonical_induction_variable_->type_id(), + canonical_induction_variable_->result_id(), + factor->result_id()) + ->result_id(), + loop_iteration_count_->result_id()) + ->result_id(); + }); + + // "Protect" the first loop: the first loop can only be executed if + // factor < loop_iteration_count_. + + // The original loop's pre-header was the cloned loop merge block. + GetClonedLoop()->SetMergeBlock( + CreateBlockBefore(GetOriginalLoop()->GetPreHeaderBlock())); + // Use the second loop preheader as if merge block. + + // Prevent the first loop if only the peeled loop needs it. + ir::BasicBlock* if_block = + ProtectLoop(cloned_loop_, has_remaining_iteration, + GetOriginalLoop()->GetPreHeaderBlock()); + + // Patch the phi of the header block. + // We added an if to enclose the first loop and because the phi node are + // connected to the exit value of the first loop, the definition no longer + // dominate the preheader. + // We had to the preheader (our if merge block) the required phi instruction + // and patch the header phi. + GetOriginalLoop()->GetHeaderBlock()->ForEachPhiInst( + [&clone_results, if_block, this](ir::Instruction* phi) { + opt::analysis::DefUseManager* def_use_mgr = context_->get_def_use_mgr(); + + auto find_value_idx = [](ir::Instruction* phi_inst, ir::Loop* loop) { + uint32_t preheader_value_idx = + !loop->IsInsideLoop(phi_inst->GetSingleWordInOperand(1)) ? 0 : 2; + return preheader_value_idx; + }; + + ir::Instruction* cloned_phi = + def_use_mgr->GetDef(clone_results.value_map_.at(phi->result_id())); + uint32_t cloned_preheader_value = cloned_phi->GetSingleWordInOperand( + find_value_idx(cloned_phi, GetClonedLoop())); + + ir::Instruction* new_phi = + InstructionBuilder(context_, + &*GetOriginalLoop()->GetPreHeaderBlock()->tail(), + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping) + .AddPhi(phi->type_id(), + {phi->GetSingleWordInOperand( + find_value_idx(phi, GetOriginalLoop())), + GetClonedLoop()->GetMergeBlock()->id(), + cloned_preheader_value, if_block->id()}); + + phi->SetInOperand(find_value_idx(phi, GetOriginalLoop()), + {new_phi->result_id()}); + def_use_mgr->AnalyzeInstUse(phi); + }); + + context_->InvalidateAnalysesExceptFor( + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping | + ir::IRContext::kAnalysisLoopAnalysis | ir::IRContext::kAnalysisCFG); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_peeling.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_peeling.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_peeling.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_peeling.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,223 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SOURCE_OPT_LOOP_PEELING_H_ +#define SOURCE_OPT_LOOP_PEELING_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include "opt/ir_context.h" +#include "opt/loop_descriptor.h" +#include "opt/loop_utils.h" + +namespace spvtools { +namespace opt { + +// Utility class to perform the peeling of a given loop. +// The loop peeling transformation make a certain amount of a loop iterations to +// be executed either before (peel before) or after (peel after) the transformed +// loop. +// +// For peeling cases the transformation does the following steps: +// - It clones the loop and inserts the cloned loop before the original loop; +// - It connects all iterating values of the cloned loop with the +// corresponding original loop values so that the second loop starts with +// the appropriate values. +// - It inserts a new induction variable "i" is inserted into the cloned that +// starts with the value 0 and increment by step of one. +// +// The last step is specific to each case: +// - Peel before: the transformation is to peel the "N" first iterations. +// The exit condition of the cloned loop is changed so that the loop +// exits when "i < N" becomes false. The original loop is then protected to +// only execute if there is any iteration left to do. +// - Peel after: the transformation is to peel the "N" last iterations, +// then the exit condition of the cloned loop is changed so that the loop +// exits when "i + N < max_iteration" becomes false, where "max_iteration" +// is the upper bound of the loop. The cloned loop is then protected to +// only execute if there is any iteration left to do no covered by the +// second. +// +// To be peelable: +// - The loop must be in LCSSA form; +// - The loop must not contain any breaks; +// - The loop must not have any ambiguous iterators updates (see +// "CanPeelLoop"). +// The method "CanPeelLoop" checks that those constrained are met. +// +// FIXME(Victor): Allow the utility it accept an canonical induction variable +// rather than automatically create one. +// FIXME(Victor): When possible, evaluate the initial value of the second loop +// iterating values rather than using the exit value of the first loop. +// FIXME(Victor): Make the utility work-out the upper bound without having to +// provide it. This should become easy once the scalar evolution is in. +class LoopPeeling { + public: + // LoopPeeling constructor. + // |loop| is the loop to peel. + // |loop_iteration_count| is the instruction holding the |loop| iteration + // count, must be invariant for |loop| and must be of an int 32 type (signed + // or unsigned). + LoopPeeling(ir::IRContext* context, ir::Loop* loop, + ir::Instruction* loop_iteration_count) + : context_(context), + loop_utils_(context, loop), + loop_(loop), + loop_iteration_count_(!loop->IsInsideLoop(loop_iteration_count) + ? loop_iteration_count + : nullptr), + int_type_(nullptr), + canonical_induction_variable_(nullptr) { + if (loop_iteration_count_) { + int_type_ = context_->get_type_mgr() + ->GetType(loop_iteration_count_->type_id()) + ->AsInteger(); + } + GetIteratingExitValues(); + } + + // Returns true if the loop can be peeled. + // To be peelable, all operation involved in the update of the loop iterators + // must not dominates the exit condition. This restriction is a work around to + // not miss compile code like: + // + // for (int i = 0; i + 1 < N; i++) {} + // for (int i = 0; ++i < N; i++) {} + // + // The increment will happen before the test on the exit condition leading to + // very look-a-like code. + // + // This restriction will not apply if a loop rotate is applied before (i.e. + // becomes a do-while loop). + bool CanPeelLoop() const { + ir::CFG& cfg = *context_->cfg(); + + if (!loop_iteration_count_) { + return false; + } + if (!int_type_) { + return false; + } + if (int_type_->width() != 32) { + return false; + } + if (!loop_->IsLCSSA()) { + return false; + } + if (!loop_->GetMergeBlock()) { + return false; + } + if (cfg.preds(loop_->GetMergeBlock()->id()).size() != 1) { + return false; + } + if (!IsConditionCheckSideEffectFree()) { + return false; + } + + return !std::any_of(exit_value_.cbegin(), exit_value_.cend(), + [](std::pair it) { + return it.second == nullptr; + }); + } + + // Moves the execution of the |factor| first iterations of the loop into a + // dedicated loop. + void PeelBefore(uint32_t factor); + + // Moves the execution of the |factor| last iterations of the loop into a + // dedicated loop. + void PeelAfter(uint32_t factor); + + // Returns the cloned loop. + ir::Loop* GetClonedLoop() { return cloned_loop_; } + // Returns the original loop. + ir::Loop* GetOriginalLoop() { return loop_; } + + private: + ir::IRContext* context_; + LoopUtils loop_utils_; + // The original loop. + ir::Loop* loop_; + // The initial |loop_| upper bound. + ir::Instruction* loop_iteration_count_; + // The int type to use for the canonical_induction_variable_. + analysis::Integer* int_type_; + // The cloned loop. + ir::Loop* cloned_loop_; + // This is set to true when the exit and back-edge branch instruction is the + // same. + bool do_while_form_; + + // The canonical induction variable of the cloned loop. The induction variable + // is initialized to 0 and incremented by step of 1. + ir::Instruction* canonical_induction_variable_; + + // Map between loop iterators and exit values. Loop iterators + std::unordered_map exit_value_; + + // Duplicate |loop_| and place the new loop before the cloned loop. Iterating + // values from the cloned loop are then connected to the original loop as + // initializer. + void DuplicateAndConnectLoop(LoopUtils::LoopCloningResult* clone_results); + + // Insert the canonical induction variable into the first loop as a simplified + // counter. + void InsertCanonicalInductionVariable(); + + // Fixes the exit condition of the before loop. The function calls + // |condition_builder| to get the condition to use in the conditional branch + // of the loop exit. The loop will be exited if the condition evaluate to + // true. |condition_builder| takes an ir::Instruction* that represent the + // insertion point. + void FixExitCondition( + const std::function& condition_builder); + + // Gathers all operations involved in the update of |iterator| into + // |operations|. + void GetIteratorUpdateOperations( + const ir::Loop* loop, ir::Instruction* iterator, + std::unordered_set* operations); + + // Gathers exiting iterator values. The function builds a map between each + // iterating value in the loop (a phi instruction in the loop header) and its + // SSA value when it exit the loop. If no exit value can be accurately found, + // it is map to nullptr (see comment on CanPeelLoop). + void GetIteratingExitValues(); + + // Returns true if a for-loop has no instruction with effects before the + // condition check. + bool IsConditionCheckSideEffectFree() const; + + // Creates a new basic block and insert it between |bb| and the predecessor of + // |bb|. + ir::BasicBlock* CreateBlockBefore(ir::BasicBlock* bb); + + // Inserts code to only execute |loop| only if the given |condition| is true. + // |if_merge| is a suitable basic block to be used by the if condition as + // merge block. + // The function returns the if block protecting the loop. + ir::BasicBlock* ProtectLoop(ir::Loop* loop, ir::Instruction* condition, + ir::BasicBlock* if_merge); +}; + +} // namespace opt +} // namespace spvtools + +#endif // SOURCE_OPT_LOOP_PEELING_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_unroller.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_unroller.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_unroller.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_unroller.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1057 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "opt/loop_unroller.h" +#include +#include +#include +#include "opt/ir_builder.h" +#include "opt/loop_utils.h" + +// Implements loop util unrolling functionality for fully and partially +// unrolling loops. Given a factor it will duplicate the loop that many times, +// appending each one to the end of the old loop and removing backedges, to +// create a new unrolled loop. +// +// 1 - User calls LoopUtils::FullyUnroll or LoopUtils::PartiallyUnroll with a +// loop they wish to unroll. LoopUtils::CanPerformUnroll is used to +// validate that a given loop can be unrolled. That method (along with the +// constructor of loop) checks that the IR is in the expected canonicalised +// format. +// +// 2 - The LoopUtils methods create a LoopUnrollerUtilsImpl object to actually +// perform the unrolling. This implements helper methods to copy the loop basic +// blocks and remap the ids of instructions used inside them. +// +// 3 - The core of LoopUnrollerUtilsImpl is the Unroll method, this method +// actually performs the loop duplication. It does this by creating a +// LoopUnrollState object and then copying the loop as given by the factor +// parameter. The LoopUnrollState object retains the state of the unroller +// between the loop body copies as each iteration needs information on the last +// to adjust the phi induction variable, adjust the OpLoopMerge instruction in +// the main loop header, and change the previous continue block to point to the +// new header and the new continue block to the main loop header. +// +// 4 - If the loop is to be fully unrolled then it is simply closed after step +// 3, with the OpLoopMerge being deleted, the backedge removed, and the +// condition blocks folded. +// +// 5 - If it is being partially unrolled: if the unrolling factor leaves the +// loop with an even number of bodies with respect to the number of loop +// iterations then step 3 is all that is needed. If it is uneven then we need to +// duplicate the loop completely and unroll the duplicated loop to cover the +// residual part and adjust the first loop to cover only the "even" part. For +// instance if you request an unroll factor of 3 on a loop with 10 iterations +// then copying the body three times would leave you with three bodies in the +// loop +// where the loop still iterates over each 4 times. So we make two loops one +// iterating once then a second loop of three iterating 3 times. + +namespace spvtools { +namespace opt { +namespace { + +// Loop control constant value for DontUnroll flag. +static const uint32_t kLoopControlDontUnrollIndex = 2; + +// Operand index of the loop control parameter of the OpLoopMerge. +static const uint32_t kLoopControlIndex = 2; + +// This utility class encapsulates some of the state we need to maintain between +// loop unrolls. Specifically it maintains key blocks and the induction variable +// in the current loop duplication step and the blocks from the previous one. +// This is because each step of the unroll needs to use data from both the +// preceding step and the original loop. +struct LoopUnrollState { + LoopUnrollState() + : previous_phi_(nullptr), + previous_continue_block_(nullptr), + previous_condition_block_(nullptr), + new_phi(nullptr), + new_continue_block(nullptr), + new_condition_block(nullptr), + new_header_block(nullptr) {} + + // Initialize from the loop descriptor class. + LoopUnrollState(ir::Instruction* induction, ir::BasicBlock* continue_block, + ir::BasicBlock* condition, + std::vector&& phis) + : previous_phi_(induction), + previous_continue_block_(continue_block), + previous_condition_block_(condition), + new_phi(nullptr), + new_continue_block(nullptr), + new_condition_block(nullptr), + new_header_block(nullptr) { + previous_phis_ = std::move(phis); + } + + // Swap the state so that the new nodes are now the previous nodes. + void NextIterationState() { + previous_phi_ = new_phi; + previous_continue_block_ = new_continue_block; + previous_condition_block_ = new_condition_block; + previous_phis_ = std::move(new_phis_); + + // Clear new nodes. + new_phi = nullptr; + new_continue_block = nullptr; + new_condition_block = nullptr; + new_header_block = nullptr; + + // Clear new block/instruction maps. + new_blocks.clear(); + new_inst.clear(); + ids_to_new_inst.clear(); + } + + // The induction variable from the immediately preceding loop body. + ir::Instruction* previous_phi_; + + // All the phi nodes from the previous loop iteration. + std::vector previous_phis_; + + std::vector new_phis_; + // The previous continue block. The backedge will be removed from this and + // added to the new continue block. + ir::BasicBlock* previous_continue_block_; + + // The previous condition block. This may be folded to flatten the loop. + ir::BasicBlock* previous_condition_block_; + + // The new induction variable. + ir::Instruction* new_phi; + + // The new continue block. + ir::BasicBlock* new_continue_block; + + // The new condition block. + ir::BasicBlock* new_condition_block; + + // The new header block. + ir::BasicBlock* new_header_block; + + // A mapping of new block ids to the original blocks which they were copied + // from. + std::unordered_map new_blocks; + + // A mapping of the original instruction ids to the instruction ids to their + // copies. + std::unordered_map new_inst; + + std::unordered_map ids_to_new_inst; +}; + +// This class implements the actual unrolling. It uses a LoopUnrollState to +// maintain the state of the unrolling inbetween steps. +class LoopUnrollerUtilsImpl { + public: + using BasicBlockListTy = std::vector>; + + LoopUnrollerUtilsImpl(ir::IRContext* c, ir::Function* function) + : context_(c), + function_(*function), + loop_condition_block_(nullptr), + loop_induction_variable_(nullptr), + number_of_loop_iterations_(0), + loop_step_value_(0), + loop_init_value_(0) {} + + // Unroll the |loop| by given |factor| by copying the whole body |factor| + // times. The resulting basicblock structure will remain a loop. + void PartiallyUnroll(ir::Loop*, size_t factor); + + // If partially unrolling the |loop| would leave the loop with too many bodies + // for its number of iterations then this method should be used. This method + // will duplicate the |loop| completely, making the duplicated loop the + // successor of the original's merge block. The original loop will have its + // condition changed to loop over the residual part and the duplicate will be + // partially unrolled. The resulting structure will be two loops. + void PartiallyUnrollResidualFactor(ir::Loop* loop, size_t factor); + + // Fully unroll the |loop| by copying the full body by the total number of + // loop iterations, folding all conditions, and removing the backedge from the + // continue block to the header. + void FullyUnroll(ir::Loop* loop); + + // Get the ID of the variable in the |phi| paired with |label|. + uint32_t GetPhiDefID(const ir::Instruction* phi, uint32_t label) const; + + // Close the loop by removing the OpLoopMerge from the |loop| header block and + // making the backedge point to the merge block. + void CloseUnrolledLoop(ir::Loop* loop); + + // Remove the OpConditionalBranch instruction inside |conditional_block| used + // to branch to either exit or continue the loop and replace it with an + // unconditional OpBranch to block |new_target|. + void FoldConditionBlock(ir::BasicBlock* condtion_block, uint32_t new_target); + + // Add all blocks_to_add_ to function_ at the |insert_point|. + void AddBlocksToFunction(const ir::BasicBlock* insert_point); + + // Duplicates the |old_loop|, cloning each body and remaping the ids without + // removing instructions or changing relative structure. Result will be stored + // in |new_loop|. + void DuplicateLoop(ir::Loop* old_loop, ir::Loop* new_loop); + + inline size_t GetLoopIterationCount() const { + return number_of_loop_iterations_; + } + + // Extracts the initial state information from the |loop|. + void Init(ir::Loop* loop); + + // Replace the uses of each induction variable outside the loop with the final + // value of the induction variable before the loop exit. To reflect the proper + // state of a fully unrolled loop. + void ReplaceInductionUseWithFinalValue(ir::Loop* loop); + + // Remove all the instructions in the invalidated_instructions_ vector. + void RemoveDeadInstructions(); + + // Replace any use of induction variables outwith the loop with the final + // value of the induction variable in the unrolled loop. + void ReplaceOutsideLoopUseWithFinalValue(ir::Loop* loop); + + // Set the LoopControl operand of the OpLoopMerge instruction to be + // DontUnroll. + void MarkLoopControlAsDontUnroll(ir::Loop* loop) const; + + private: + // Remap all the in |basic_block| to new IDs and keep the mapping of new ids + // to old + // ids. |loop| is used to identify special loop blocks (header, continue, + // ect). + void AssignNewResultIds(ir::BasicBlock* basic_block); + + // Using the map built by AssignNewResultIds, for each instruction in + // |basic_block| use + // that map to substitute the IDs used by instructions (in the operands) with + // the new ids. + void RemapOperands(ir::BasicBlock* basic_block); + + // Copy the whole body of the loop, all blocks dominated by the |loop| header + // and not dominated by the |loop| merge. The copied body will be linked to by + // the old |loop| continue block and the new body will link to the |loop| + // header via the new continue block. |eliminate_conditions| is used to decide + // whether or not to fold all the condition blocks other than the last one. + void CopyBody(ir::Loop* loop, bool eliminate_conditions); + + // Copy a given |block_to_copy| in the |loop| and record the mapping of the + // old/new ids. |preserve_instructions| determines whether or not the method + // will modify (other than result_id) instructions which are copied. + void CopyBasicBlock(ir::Loop* loop, const ir::BasicBlock* block_to_copy, + bool preserve_instructions); + + // The actual implementation of the unroll step. Unrolls |loop| by given + // |factor| by copying the body by |factor| times. Also propagates the + // induction variable value throughout the copies. + void Unroll(ir::Loop* loop, size_t factor); + + // Fills the loop_blocks_inorder_ field with the ordered list of basic blocks + // as computed by the method ComputeLoopOrderedBlocks. + void ComputeLoopOrderedBlocks(ir::Loop* loop); + + // Adds the blocks_to_add_ to both the |loop| and to the parent of |loop| if + // the parent exists. + void AddBlocksToLoop(ir::Loop* loop) const; + + // After the partially unroll step the phi instructions in the header block + // will be in an illegal format. This function makes the phis legal by making + // the edge from the latch block come from the new latch block and the value + // to be the actual value of the phi at that point. + void LinkLastPhisToStart(ir::Loop* loop) const; + + // A pointer to the IRContext. Used to add/remove instructions and for usedef + // chains. + ir::IRContext* context_; + + // A reference the function the loop is within. + ir::Function& function_; + + // A list of basic blocks to be added to the loop at the end of an unroll + // step. + BasicBlockListTy blocks_to_add_; + + // List of instructions which are now dead and can be removed. + std::vector invalidated_instructions_; + + // Maintains the current state of the transform between calls to unroll. + LoopUnrollState state_; + + // An ordered list containing the loop basic blocks. + std::vector loop_blocks_inorder_; + + // The block containing the condition check which contains a conditional + // branch to the merge and continue block. + ir::BasicBlock* loop_condition_block_; + + // The induction variable of the loop. + ir::Instruction* loop_induction_variable_; + + // Phis used in the loop need to be remapped to use the actual result values + // and then be remapped at the end. + std::vector loop_phi_instructions_; + + // The number of loop iterations that the loop would preform pre-unroll. + size_t number_of_loop_iterations_; + + // The amount that the loop steps each iteration. + int64_t loop_step_value_; + + // The value the loop starts stepping from. + int64_t loop_init_value_; +}; + +/* + * Static helper functions. + */ + +// Retrieve the index of the OpPhi instruction |phi| which corresponds to the +// incoming |block| id. +static uint32_t GetPhiIndexFromLabel(const ir::BasicBlock* block, + const ir::Instruction* phi) { + for (uint32_t i = 1; i < phi->NumInOperands(); i += 2) { + if (block->id() == phi->GetSingleWordInOperand(i)) { + return i; + } + } + assert(false && "Could not find operand in instruction."); + return 0; +} + +void LoopUnrollerUtilsImpl::Init(ir::Loop* loop) { + loop_condition_block_ = loop->FindConditionBlock(); + + // When we reinit the second loop during PartiallyUnrollResidualFactor we need + // to use the cached value from the duplicate step as the dominator tree + // basded solution, loop->FindConditionBlock, requires all the nodes to be + // connected up with the correct branches. They won't be at this point. + if (!loop_condition_block_) { + loop_condition_block_ = state_.new_condition_block; + } + assert(loop_condition_block_); + + loop_induction_variable_ = loop->FindConditionVariable(loop_condition_block_); + assert(loop_induction_variable_); + + bool found = loop->FindNumberOfIterations( + loop_induction_variable_, &*loop_condition_block_->ctail(), + &number_of_loop_iterations_, &loop_step_value_, &loop_init_value_); + (void)found; // To silence unused variable warning on release builds. + assert(found); + + // Blocks are stored in an unordered set of ids in the loop class, we need to + // create the dominator ordered list. + ComputeLoopOrderedBlocks(loop); +} + +// This function is used to partially unroll the loop when the factor provided +// would normally lead to an illegal optimization. Instead of just unrolling the +// loop it creates two loops and unrolls one and adjusts the condition on the +// other. The end result being that the new loop pair iterates over the correct +// number of bodies. +void LoopUnrollerUtilsImpl::PartiallyUnrollResidualFactor(ir::Loop* loop, + size_t factor) { + std::unique_ptr new_label{new ir::Instruction( + context_, SpvOp::SpvOpLabel, 0, context_->TakeNextId(), {})}; + std::unique_ptr new_exit_bb{ + new ir::BasicBlock(std::move(new_label))}; + + // Save the id of the block before we move it. + uint32_t new_merge_id = new_exit_bb->id(); + + // Add the block the list of blocks to add, we want this merge block to be + // right at the start of the new blocks. + blocks_to_add_.push_back(std::move(new_exit_bb)); + ir::BasicBlock* new_exit_bb_raw = blocks_to_add_[0].get(); + ir::Instruction& original_conditional_branch = *loop_condition_block_->tail(); + // Duplicate the loop, providing access to the blocks of both loops. + // This is a naked new due to the VS2013 requirement of not having unique + // pointers in vectors, as it will be inserted into a vector with + // loop_descriptor.AddLoop. + ir::Loop* new_loop = new ir::Loop(*loop); + + // Clear the basic blocks of the new loop. + new_loop->ClearBlocks(); + + DuplicateLoop(loop, new_loop); + + // Add the blocks to the function. + AddBlocksToFunction(loop->GetMergeBlock()); + blocks_to_add_.clear(); + + // Create a new merge block for the first loop. + InstructionBuilder builder{context_, new_exit_bb_raw}; + // Make the first loop branch to the second. + builder.AddBranch(new_loop->GetHeaderBlock()->id()); + + loop_condition_block_ = state_.new_condition_block; + loop_induction_variable_ = state_.new_phi; + // Unroll the new loop by the factor with the usual -1 to account for the + // existing block iteration. + Unroll(new_loop, factor); + + LinkLastPhisToStart(new_loop); + AddBlocksToLoop(new_loop); + + // Add the new merge block to the back of the list of blocks to be added. It + // needs to be the last block added to maintain dominator order in the binary. + blocks_to_add_.push_back( + std::unique_ptr(new_loop->GetMergeBlock())); + + // Add the blocks to the function. + AddBlocksToFunction(loop->GetMergeBlock()); + + // Reset the usedef analysis. + context_->InvalidateAnalysesExceptFor( + ir::IRContext::Analysis::kAnalysisLoopAnalysis); + opt::analysis::DefUseManager* def_use_manager = context_->get_def_use_mgr(); + + // The loop condition. + ir::Instruction* condition_check = def_use_manager->GetDef( + original_conditional_branch.GetSingleWordOperand(0)); + + // This should have been checked by the LoopUtils::CanPerformUnroll function + // before entering this. + assert(loop->IsSupportedCondition(condition_check->opcode())); + + // We need to account for the initial body when calculating the remainder. + int64_t remainder = ir::Loop::GetResidualConditionValue( + condition_check->opcode(), loop_init_value_, loop_step_value_, + number_of_loop_iterations_, factor); + + assert(remainder > std::numeric_limits::min() && + remainder < std::numeric_limits::max()); + + ir::Instruction* new_constant = nullptr; + + // If the remainder is negative then we add a signed constant, otherwise just + // add an unsigned constant. + if (remainder < 0) { + new_constant = + builder.Add32BitSignedIntegerConstant(static_cast(remainder)); + } else { + new_constant = builder.Add32BitUnsignedIntegerConstant( + static_cast(remainder)); + } + + uint32_t constant_id = new_constant->result_id(); + + // Update the condition check. + condition_check->SetInOperand(1, {constant_id}); + + // Update the next phi node. The phi will have a constant value coming in from + // the preheader block. For the duplicated loop we need to update the constant + // to be the amount of iterations covered by the first loop and the incoming + // block to be the first loops new merge block. + std::vector new_inductions; + new_loop->GetInductionVariables(new_inductions); + + std::vector old_inductions; + loop->GetInductionVariables(old_inductions); + for (size_t index = 0; index < new_inductions.size(); ++index) { + ir::Instruction* new_induction = new_inductions[index]; + ir::Instruction* old_induction = old_inductions[index]; + // Get the index of the loop initalizer, the value coming in from the + // preheader. + uint32_t initalizer_index = + GetPhiIndexFromLabel(new_loop->GetPreHeaderBlock(), old_induction); + + // Replace the second loop initalizer with the phi from the first + new_induction->SetInOperand(initalizer_index - 1, + {old_induction->result_id()}); + new_induction->SetInOperand(initalizer_index, {new_merge_id}); + + // If the use of the first loop induction variable is outside of the loop + // then replace that use with the second loop induction variable. + uint32_t second_loop_induction = new_induction->result_id(); + auto replace_use_outside_of_loop = [loop, second_loop_induction]( + ir::Instruction* user, + uint32_t operand_index) { + if (!loop->IsInsideLoop(user)) { + user->SetOperand(operand_index, {second_loop_induction}); + } + }; + + context_->get_def_use_mgr()->ForEachUse(old_induction, + replace_use_outside_of_loop); + } + + context_->InvalidateAnalysesExceptFor( + ir::IRContext::Analysis::kAnalysisLoopAnalysis); + + context_->ReplaceAllUsesWith(loop->GetMergeBlock()->id(), new_merge_id); + + ir::LoopDescriptor& loop_descriptor = + *context_->GetLoopDescriptor(&function_); + + loop_descriptor.AddLoop(new_loop, loop->GetParent()); + + RemoveDeadInstructions(); +} + +// Mark this loop as DontUnroll as it will already be unrolled and it may not +// be safe to unroll a previously partially unrolled loop. +void LoopUnrollerUtilsImpl::MarkLoopControlAsDontUnroll(ir::Loop* loop) const { + ir::Instruction* loop_merge_inst = loop->GetHeaderBlock()->GetLoopMergeInst(); + assert(loop_merge_inst && + "Loop merge instruction could not be found after entering unroller " + "(should have exited before this)"); + loop_merge_inst->SetInOperand(kLoopControlIndex, + {kLoopControlDontUnrollIndex}); +} + +// Duplicate the |loop| body |factor| - 1 number of times while keeping the loop +// backedge intact. This will leave the loop with |factor| number of bodies +// after accounting for the initial body. +void LoopUnrollerUtilsImpl::Unroll(ir::Loop* loop, size_t factor) { + // If we unroll a loop partially it will not be safe to unroll it further. + // This is due to the current method of calculating the number of loop + // iterations. + MarkLoopControlAsDontUnroll(loop); + + std::vector inductions; + loop->GetInductionVariables(inductions); + state_ = LoopUnrollState{loop_induction_variable_, loop->GetLatchBlock(), + loop_condition_block_, std::move(inductions)}; + for (size_t i = 0; i < factor - 1; ++i) { + CopyBody(loop, true); + } +} + +void LoopUnrollerUtilsImpl::RemoveDeadInstructions() { + // Remove the dead instructions. + for (ir::Instruction* inst : invalidated_instructions_) { + context_->KillInst(inst); + } +} + +void LoopUnrollerUtilsImpl::ReplaceInductionUseWithFinalValue(ir::Loop* loop) { + context_->InvalidateAnalysesExceptFor( + ir::IRContext::Analysis::kAnalysisLoopAnalysis); + std::vector inductions; + loop->GetInductionVariables(inductions); + + for (size_t index = 0; index < inductions.size(); ++index) { + uint32_t trip_step_id = GetPhiDefID(state_.previous_phis_[index], + state_.previous_continue_block_->id()); + context_->ReplaceAllUsesWith(inductions[index]->result_id(), trip_step_id); + invalidated_instructions_.push_back(inductions[index]); + } +} + +// Fully unroll the loop by partially unrolling it by the number of loop +// iterations minus one for the body already accounted for. +void LoopUnrollerUtilsImpl::FullyUnroll(ir::Loop* loop) { + // We unroll the loop by number of iterations in the loop. + Unroll(loop, number_of_loop_iterations_); + + // The first condition block is preserved until now so it can be copied. + FoldConditionBlock(loop_condition_block_, 1); + + // Delete the OpLoopMerge and remove the backedge to the header. + CloseUnrolledLoop(loop); + + // Mark the loop for later deletion. This allows us to preserve the loop + // iterators but still disregard dead loops. + loop->MarkLoopForRemoval(); + + // If the loop has a parent add the new blocks to the parent. + if (loop->GetParent()) { + AddBlocksToLoop(loop->GetParent()); + } + + // Add the blocks to the function. + AddBlocksToFunction(loop->GetMergeBlock()); + + ReplaceInductionUseWithFinalValue(loop); + + RemoveDeadInstructions(); + // Invalidate all analyses. + context_->InvalidateAnalysesExceptFor( + ir::IRContext::Analysis::kAnalysisLoopAnalysis); +} + +// Copy a given basic block, give it a new result_id, and store the new block +// and the id mapping in the state. |preserve_instructions| is used to determine +// whether or not this function should edit instructions other than the +// |result_id|. +void LoopUnrollerUtilsImpl::CopyBasicBlock(ir::Loop* loop, + const ir::BasicBlock* itr, + bool preserve_instructions) { + // Clone the block exactly, including the IDs. + ir::BasicBlock* basic_block = itr->Clone(context_); + basic_block->SetParent(itr->GetParent()); + + // Assign each result a new unique ID and keep a mapping of the old ids to + // the new ones. + AssignNewResultIds(basic_block); + + // If this is the continue block we are copying. + if (itr == loop->GetLatchBlock()) { + // Make the OpLoopMerge point to this block for the continue. + if (!preserve_instructions) { + ir::Instruction* merge_inst = loop->GetHeaderBlock()->GetLoopMergeInst(); + merge_inst->SetInOperand(1, {basic_block->id()}); + } + + state_.new_continue_block = basic_block; + } + + // If this is the header block we are copying. + if (itr == loop->GetHeaderBlock()) { + state_.new_header_block = basic_block; + + if (!preserve_instructions) { + // Remove the loop merge instruction if it exists. + ir::Instruction* merge_inst = basic_block->GetLoopMergeInst(); + if (merge_inst) invalidated_instructions_.push_back(merge_inst); + } + } + + // If this is the condition block we are copying. + if (itr == loop_condition_block_) { + state_.new_condition_block = basic_block; + } + + // Add this block to the list of blocks to add to the function at the end of + // the unrolling process. + blocks_to_add_.push_back(std::unique_ptr(basic_block)); + + // Keep tracking the old block via a map. + state_.new_blocks[itr->id()] = basic_block; +} + +void LoopUnrollerUtilsImpl::CopyBody(ir::Loop* loop, + bool eliminate_conditions) { + // Copy each basic block in the loop, give them new ids, and save state + // information. + for (const ir::BasicBlock* itr : loop_blocks_inorder_) { + CopyBasicBlock(loop, itr, false); + } + + // Set the previous continue block to point to the new header. + ir::Instruction& continue_branch = *state_.previous_continue_block_->tail(); + continue_branch.SetInOperand(0, {state_.new_header_block->id()}); + + // As the algorithm copies the original loop blocks exactly, the tail of the + // latch block on iterations after the first one will be a branch to the new + // header and not the actual loop header. The last continue block in the loop + // should always be a backedge to the global header. + ir::Instruction& new_continue_branch = *state_.new_continue_block->tail(); + new_continue_branch.SetInOperand(0, {loop->GetHeaderBlock()->id()}); + + std::vector inductions; + loop->GetInductionVariables(inductions); + for (size_t index = 0; index < inductions.size(); ++index) { + ir::Instruction* master_copy = inductions[index]; + + assert(master_copy->result_id() != 0); + ir::Instruction* induction_clone = + state_.ids_to_new_inst[state_.new_inst[master_copy->result_id()]]; + + state_.new_phis_.push_back(induction_clone); + assert(induction_clone->result_id() != 0); + + if (!state_.previous_phis_.empty()) { + state_.new_inst[master_copy->result_id()] = GetPhiDefID( + state_.previous_phis_[index], state_.previous_continue_block_->id()); + } else { + // Do not replace the first phi block ids. + state_.new_inst[master_copy->result_id()] = master_copy->result_id(); + } + } + + if (eliminate_conditions && + state_.new_condition_block != loop_condition_block_) { + FoldConditionBlock(state_.new_condition_block, 1); + } + + // Only reference to the header block is the backedge in the latch block, + // don't change this. + state_.new_inst[loop->GetHeaderBlock()->id()] = loop->GetHeaderBlock()->id(); + + for (auto& pair : state_.new_blocks) { + RemapOperands(pair.second); + } + + for (ir::Instruction* dead_phi : state_.new_phis_) + invalidated_instructions_.push_back(dead_phi); + + // Swap the state so the new is now the previous. + state_.NextIterationState(); +} + +uint32_t LoopUnrollerUtilsImpl::GetPhiDefID(const ir::Instruction* phi, + uint32_t label) const { + for (uint32_t operand = 3; operand < phi->NumOperands(); operand += 2) { + if (phi->GetSingleWordOperand(operand) == label) { + return phi->GetSingleWordOperand(operand - 1); + } + } + assert(false && "Could not find a phi index matching the provided label"); + return 0; +} + +void LoopUnrollerUtilsImpl::FoldConditionBlock(ir::BasicBlock* condition_block, + uint32_t operand_label) { + // Remove the old conditional branch to the merge and continue blocks. + ir::Instruction& old_branch = *condition_block->tail(); + uint32_t new_target = old_branch.GetSingleWordOperand(operand_label); + + context_->KillInst(&old_branch); + // Add the new unconditional branch to the merge block. + InstructionBuilder builder{context_, condition_block}; + builder.AddBranch(new_target); +} + +void LoopUnrollerUtilsImpl::CloseUnrolledLoop(ir::Loop* loop) { + // Remove the OpLoopMerge instruction from the function. + ir::Instruction* merge_inst = loop->GetHeaderBlock()->GetLoopMergeInst(); + invalidated_instructions_.push_back(merge_inst); + + // Remove the final backedge to the header and make it point instead to the + // merge block. + state_.previous_continue_block_->tail()->SetInOperand( + 0, {loop->GetMergeBlock()->id()}); + + // Remove all induction variables as the phis will now be invalid. Replace all + // uses with the constant initializer value (all uses of phis will be in + // the first iteration with the subsequent phis already having been removed). + std::vector inductions; + loop->GetInductionVariables(inductions); + + // We can use the state instruction mechanism to replace all internal loop + // values within the first loop trip (as the subsequent ones will be updated + // by the copy function) with the value coming in from the preheader and then + // use context ReplaceAllUsesWith for the uses outside the loop with the final + // trip phi value. + state_.new_inst.clear(); + for (ir::Instruction* induction : inductions) { + uint32_t initalizer_id = + GetPhiDefID(induction, loop->GetPreHeaderBlock()->id()); + + state_.new_inst[induction->result_id()] = initalizer_id; + } + + for (ir::BasicBlock* block : loop_blocks_inorder_) { + RemapOperands(block); + } +} + +// Uses the first loop to create a copy of the loop with new IDs. +void LoopUnrollerUtilsImpl::DuplicateLoop(ir::Loop* old_loop, + ir::Loop* new_loop) { + std::vector new_block_order; + + // Copy every block in the old loop. + for (const ir::BasicBlock* itr : loop_blocks_inorder_) { + CopyBasicBlock(old_loop, itr, true); + new_block_order.push_back(blocks_to_add_.back().get()); + } + + // Clone the merge block, give it a new id and record it in the state. + ir::BasicBlock* new_merge = old_loop->GetMergeBlock()->Clone(context_); + new_merge->SetParent(old_loop->GetMergeBlock()->GetParent()); + AssignNewResultIds(new_merge); + state_.new_blocks[old_loop->GetMergeBlock()->id()] = new_merge; + + // Remap the operands of every instruction in the loop to point to the new + // copies. + for (auto& pair : state_.new_blocks) { + RemapOperands(pair.second); + } + + loop_blocks_inorder_ = std::move(new_block_order); + + AddBlocksToLoop(new_loop); + + new_loop->SetHeaderBlock(state_.new_header_block); + new_loop->SetLatchBlock(state_.new_continue_block); + new_loop->SetMergeBlock(new_merge); +} + +// Whenever the utility copies a block it stores it in a tempory buffer, this +// function adds the buffer into the ir::Function. The blocks will be inserted +// after the block |insert_point|. +void LoopUnrollerUtilsImpl::AddBlocksToFunction( + const ir::BasicBlock* insert_point) { + for (auto basic_block_iterator = function_.begin(); + basic_block_iterator != function_.end(); ++basic_block_iterator) { + if (basic_block_iterator->id() == insert_point->id()) { + basic_block_iterator.InsertBefore(&blocks_to_add_); + return; + } + } + + assert( + false && + "Could not add basic blocks to function as insert point was not found."); +} + +// Assign all result_ids in |basic_block| instructions to new IDs and preserve +// the mapping of new ids to old ones. +void LoopUnrollerUtilsImpl::AssignNewResultIds(ir::BasicBlock* basic_block) { + // Label instructions aren't covered by normal traversal of the + // instructions. + uint32_t new_label_id = context_->TakeNextId(); + + // Assign a new id to the label. + state_.new_inst[basic_block->GetLabelInst()->result_id()] = new_label_id; + basic_block->GetLabelInst()->SetResultId(new_label_id); + + for (ir::Instruction& inst : *basic_block) { + uint32_t old_id = inst.result_id(); + + // Ignore stores etc. + if (old_id == 0) { + continue; + } + + // Give the instruction a new id. + inst.SetResultId(context_->TakeNextId()); + + // Save the mapping of old_id -> new_id. + state_.new_inst[old_id] = inst.result_id(); + // Check if this instruction is the induction variable. + if (loop_induction_variable_->result_id() == old_id) { + // Save a pointer to the new copy of it. + state_.new_phi = &inst; + } + state_.ids_to_new_inst[inst.result_id()] = &inst; + } +} + +// For all instructions in |basic_block| check if the operands used are from a +// copied instruction and if so swap out the operand for the copy of it. +void LoopUnrollerUtilsImpl::RemapOperands(ir::BasicBlock* basic_block) { + for (ir::Instruction& inst : *basic_block) { + auto remap_operands_to_new_ids = [this](uint32_t* id) { + auto itr = state_.new_inst.find(*id); + + if (itr != state_.new_inst.end()) { + *id = itr->second; + } + }; + + inst.ForEachInId(remap_operands_to_new_ids); + } +} + +// Generate the ordered list of basic blocks in the |loop| and cache it for +// later use. +void LoopUnrollerUtilsImpl::ComputeLoopOrderedBlocks(ir::Loop* loop) { + loop_blocks_inorder_.clear(); + loop->ComputeLoopStructuredOrder(&loop_blocks_inorder_); +} + +// Adds the blocks_to_add_ to both the loop and to the parent. +void LoopUnrollerUtilsImpl::AddBlocksToLoop(ir::Loop* loop) const { + // Add the blocks to this loop. + for (auto& block_itr : blocks_to_add_) { + loop->AddBasicBlock(block_itr.get()); + } + + // Add the blocks to the parent as well. + if (loop->GetParent()) AddBlocksToLoop(loop->GetParent()); +} + +void LoopUnrollerUtilsImpl::LinkLastPhisToStart(ir::Loop* loop) const { + std::vector inductions; + loop->GetInductionVariables(inductions); + + for (size_t i = 0; i < inductions.size(); ++i) { + ir::Instruction* last_phi_in_block = state_.previous_phis_[i]; + + uint32_t phi_index = GetPhiIndexFromLabel(state_.previous_continue_block_, + last_phi_in_block); + uint32_t phi_variable = + last_phi_in_block->GetSingleWordInOperand(phi_index - 1); + uint32_t phi_label = last_phi_in_block->GetSingleWordInOperand(phi_index); + + ir::Instruction* phi = inductions[i]; + phi->SetInOperand(phi_index - 1, {phi_variable}); + phi->SetInOperand(phi_index, {phi_label}); + } +} + +// Duplicate the |loop| body |factor| number of times while keeping the loop +// backedge intact. +void LoopUnrollerUtilsImpl::PartiallyUnroll(ir::Loop* loop, size_t factor) { + Unroll(loop, factor); + LinkLastPhisToStart(loop); + AddBlocksToLoop(loop); + AddBlocksToFunction(loop->GetMergeBlock()); + RemoveDeadInstructions(); +} + +/* + * End LoopUtilsImpl. + */ + +} // namespace + +/* + * + * Begin Utils. + * + * */ + +bool LoopUtils::CanPerformUnroll() { + // The loop is expected to be in structured order. + if (!loop_->GetHeaderBlock()->GetMergeInst()) { + return false; + } + + // Find check the loop has a condition we can find and evaluate. + const ir::BasicBlock* condition = loop_->FindConditionBlock(); + if (!condition) return false; + + // Check that we can find and process the induction variable. + const ir::Instruction* induction = loop_->FindConditionVariable(condition); + if (!induction || induction->opcode() != SpvOpPhi) return false; + + // Check that we can find the number of loop iterations. + if (!loop_->FindNumberOfIterations(induction, &*condition->ctail(), nullptr)) + return false; + + // Make sure the continue block is a unconditional branch to the header + // block. + const ir::Instruction& branch = *loop_->GetLatchBlock()->ctail(); + bool branching_assumption = + branch.opcode() == SpvOpBranch && + branch.GetSingleWordInOperand(0) == loop_->GetHeaderBlock()->id(); + if (!branching_assumption) { + return false; + } + + std::vector inductions; + loop_->GetInductionVariables(inductions); + + // Ban breaks within the loop. + const std::vector& merge_block_preds = + context_->cfg()->preds(loop_->GetMergeBlock()->id()); + if (merge_block_preds.size() != 1) { + return false; + } + + // Ban continues within the loop. + const std::vector& continue_block_preds = + context_->cfg()->preds(loop_->GetLatchBlock()->id()); + if (continue_block_preds.size() != 1) { + return false; + } + + // Ban returns in the loop. + // Iterate over all the blocks within the loop and check that none of them + // exit the loop. + for (uint32_t label_id : loop_->GetBlocks()) { + const ir::BasicBlock* block = context_->cfg()->block(label_id); + if (block->ctail()->opcode() == SpvOp::SpvOpKill || + block->ctail()->opcode() == SpvOp::SpvOpReturn || + block->ctail()->opcode() == SpvOp::SpvOpReturnValue) { + return false; + } + } + // Can only unroll inner loops. + if (!loop_->AreAllChildrenMarkedForRemoval()) { + return false; + } + + return true; +} + +bool LoopUtils::PartiallyUnroll(size_t factor) { + if (factor == 1 || !CanPerformUnroll()) return false; + + // Create the unroller utility. + LoopUnrollerUtilsImpl unroller{context_, + loop_->GetHeaderBlock()->GetParent()}; + unroller.Init(loop_); + + // If the unrolling factor is larger than or the same size as the loop just + // fully unroll the loop. + if (factor >= unroller.GetLoopIterationCount()) { + unroller.FullyUnroll(loop_); + return true; + } + + // If the loop unrolling factor is an residual number of iterations we need to + // let run the loop for the residual part then let it branch into the unrolled + // remaining part. We add one when calucating the remainder to take into + // account the one iteration already in the loop. + if (unroller.GetLoopIterationCount() % factor != 0) { + unroller.PartiallyUnrollResidualFactor(loop_, factor); + } else { + unroller.PartiallyUnroll(loop_, factor); + } + + return true; +} + +bool LoopUtils::FullyUnroll() { + if (!CanPerformUnroll()) return false; + + std::vector inductions; + loop_->GetInductionVariables(inductions); + + LoopUnrollerUtilsImpl unroller{context_, + loop_->GetHeaderBlock()->GetParent()}; + + unroller.Init(loop_); + unroller.FullyUnroll(loop_); + + return true; +} + +void LoopUtils::Finalize() { + // Clean up the loop descriptor to preserve the analysis. + + ir::LoopDescriptor* LD = context_->GetLoopDescriptor(&function_); + LD->PostModificationCleanup(); +} + +/* + * + * Begin Pass. + * + */ + +Pass::Status LoopUnroller::Process(ir::IRContext* c) { + context_ = c; + bool changed = false; + for (ir::Function& f : *c->module()) { + ir::LoopDescriptor* LD = context_->GetLoopDescriptor(&f); + for (ir::Loop& loop : *LD) { + LoopUtils loop_utils{c, &loop}; + if (!loop.HasUnrollLoopControl() || !loop_utils.CanPerformUnroll()) { + continue; + } + + if (fully_unroll_) { + loop_utils.FullyUnroll(); + } else { + loop_utils.PartiallyUnroll(unroll_factor_); + } + changed = true; + } + LD->PostModificationCleanup(); + } + + return changed ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_unroller.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_unroller.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_unroller.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_unroller.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,41 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SOURCE_OPT_LOOP_UNROLLER_H_ +#define SOURCE_OPT_LOOP_UNROLLER_H_ +#include "opt/pass.h" + +namespace spvtools { +namespace opt { + +class LoopUnroller : public Pass { + public: + LoopUnroller() : Pass(), fully_unroll_(true), unroll_factor_(0) {} + LoopUnroller(bool fully_unroll, int unroll_factor) + : Pass(), fully_unroll_(fully_unroll), unroll_factor_(unroll_factor) {} + + const char* name() const override { return "Loop unroller"; } + + Status Process(ir::IRContext* context) override; + + private: + ir::IRContext* context_; + bool fully_unroll_; + int unroll_factor_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // SOURCE_OPT_LOOP_UNROLLER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_unswitch_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_unswitch_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_unswitch_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_unswitch_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,906 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "loop_unswitch_pass.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "basic_block.h" +#include "dominator_tree.h" +#include "fold.h" +#include "function.h" +#include "instruction.h" +#include "ir_builder.h" +#include "ir_context.h" +#include "loop_descriptor.h" + +#include "loop_utils.h" + +namespace spvtools { +namespace opt { +namespace { + +static const uint32_t kTypePointerStorageClassInIdx = 0; +static const uint32_t kBranchCondTrueLabIdInIdx = 1; +static const uint32_t kBranchCondFalseLabIdInIdx = 2; + +} // anonymous namespace + +namespace { + +// This class handle the unswitch procedure for a given loop. +// The unswitch will not happen if: +// - The loop has any instruction that will prevent it; +// - The loop invariant condition is not uniform. +class LoopUnswitch { + public: + LoopUnswitch(ir::IRContext* context, ir::Function* function, ir::Loop* loop, + ir::LoopDescriptor* loop_desc) + : function_(function), + loop_(loop), + loop_desc_(*loop_desc), + context_(context), + switch_block_(nullptr) {} + + // Returns true if the loop can be unswitched. + // Can be unswitch if: + // - The loop has no instructions that prevents it (such as barrier); + // - The loop has one conditional branch or switch that do not depends on the + // loop; + // - The loop invariant condition is uniform; + bool CanUnswitchLoop() { + if (switch_block_) return true; + if (loop_->IsSafeToClone()) return false; + + ir::CFG& cfg = *context_->cfg(); + + for (uint32_t bb_id : loop_->GetBlocks()) { + ir::BasicBlock* bb = cfg.block(bb_id); + if (bb->terminator()->IsBranch() && + bb->terminator()->opcode() != SpvOpBranch) { + if (IsConditionLoopInvariant(bb->terminator())) { + switch_block_ = bb; + break; + } + } + } + + return switch_block_; + } + + // Return the iterator to the basic block |bb|. + ir::Function::iterator FindBasicBlockPosition(ir::BasicBlock* bb_to_find) { + ir::Function::iterator it = function_->FindBlock(bb_to_find->id()); + assert(it != function_->end() && "Basic Block not found"); + return it; + } + + // Creates a new basic block and insert it into the function |fn| at the + // position |ip|. This function preserves the def/use and instr to block + // managers. + ir::BasicBlock* CreateBasicBlock(ir::Function::iterator ip) { + analysis::DefUseManager* def_use_mgr = context_->get_def_use_mgr(); + + ir::BasicBlock* bb = &*ip.InsertBefore(std::unique_ptr( + new ir::BasicBlock(std::unique_ptr(new ir::Instruction( + context_, SpvOpLabel, 0, context_->TakeNextId(), {}))))); + bb->SetParent(function_); + def_use_mgr->AnalyzeInstDef(bb->GetLabelInst()); + context_->set_instr_block(bb->GetLabelInst(), bb); + + return bb; + } + + // Unswitches |loop_|. + void PerformUnswitch() { + assert(CanUnswitchLoop() && + "Cannot unswitch if there is not constant condition"); + assert(loop_->GetPreHeaderBlock() && "This loop has no pre-header block"); + assert(loop_->IsLCSSA() && "This loop is not in LCSSA form"); + + ir::CFG& cfg = *context_->cfg(); + DominatorTree* dom_tree = + &context_->GetDominatorAnalysis(function_, *context_->cfg()) + ->GetDomTree(); + analysis::DefUseManager* def_use_mgr = context_->get_def_use_mgr(); + LoopUtils loop_utils(context_, loop_); + + ////////////////////////////////////////////////////////////////////////////// + // Step 1: Create the if merge block for structured modules. + // To do so, the |loop_| merge block will become the if's one and we + // create a merge for the loop. This will limit the amount of duplicated + // code the structured control flow imposes. + // For non structured program, the new loop will be connected to + // the old loop's exit blocks. + ////////////////////////////////////////////////////////////////////////////// + + // Get the merge block if it exists. + ir::BasicBlock* if_merge_block = loop_->GetMergeBlock(); + // The merge block is only created if the loop has a unique exit block. We + // have this guarantee for structured loops, for compute loop it will + // trivially help maintain both a structured-like form and LCSAA. + ir::BasicBlock* loop_merge_block = + if_merge_block + ? CreateBasicBlock(FindBasicBlockPosition(if_merge_block)) + : nullptr; + if (loop_merge_block) { + // Add the instruction and update managers. + opt::InstructionBuilder builder( + context_, loop_merge_block, + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping); + builder.AddBranch(if_merge_block->id()); + builder.SetInsertPoint(&*loop_merge_block->begin()); + cfg.RegisterBlock(loop_merge_block); + def_use_mgr->AnalyzeInstDef(loop_merge_block->GetLabelInst()); + // Update CFG. + if_merge_block->ForEachPhiInst( + [loop_merge_block, &builder, this](ir::Instruction* phi) { + ir::Instruction* cloned = phi->Clone(context_); + builder.AddInstruction(std::unique_ptr(cloned)); + phi->SetInOperand(0, {cloned->result_id()}); + phi->SetInOperand(1, {loop_merge_block->id()}); + for (uint32_t j = phi->NumInOperands() - 1; j > 1; j--) + phi->RemoveInOperand(j); + }); + // Copy the predecessor list (will get invalidated otherwise). + std::vector preds = cfg.preds(if_merge_block->id()); + for (uint32_t pid : preds) { + if (pid == loop_merge_block->id()) continue; + ir::BasicBlock* p_bb = cfg.block(pid); + p_bb->ForEachSuccessorLabel( + [if_merge_block, loop_merge_block](uint32_t* id) { + if (*id == if_merge_block->id()) *id = loop_merge_block->id(); + }); + cfg.AddEdge(pid, loop_merge_block->id()); + } + cfg.RemoveNonExistingEdges(if_merge_block->id()); + // Update loop descriptor. + if (ir::Loop* ploop = loop_->GetParent()) { + ploop->AddBasicBlock(loop_merge_block); + loop_desc_.SetBasicBlockToLoop(loop_merge_block->id(), ploop); + } + + // Update the dominator tree. + DominatorTreeNode* loop_merge_dtn = + dom_tree->GetOrInsertNode(loop_merge_block); + DominatorTreeNode* if_merge_block_dtn = + dom_tree->GetOrInsertNode(if_merge_block); + loop_merge_dtn->parent_ = if_merge_block_dtn->parent_; + loop_merge_dtn->children_.push_back(if_merge_block_dtn); + loop_merge_dtn->parent_->children_.push_back(loop_merge_dtn); + if_merge_block_dtn->parent_->children_.erase(std::find( + if_merge_block_dtn->parent_->children_.begin(), + if_merge_block_dtn->parent_->children_.end(), if_merge_block_dtn)); + + loop_->SetMergeBlock(loop_merge_block); + } + + //////////////////////////////////////////////////////////////////////////// + // Step 2: Build a new preheader for |loop_|, use the old one + // for the constant branch. + //////////////////////////////////////////////////////////////////////////// + + ir::BasicBlock* if_block = loop_->GetPreHeaderBlock(); + // If this preheader is the parent loop header, + // we need to create a dedicated block for the if. + ir::BasicBlock* loop_pre_header = + CreateBasicBlock(++FindBasicBlockPosition(if_block)); + opt::InstructionBuilder(context_, loop_pre_header, + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping) + .AddBranch(loop_->GetHeaderBlock()->id()); + + if_block->tail()->SetInOperand(0, {loop_pre_header->id()}); + + // Update loop descriptor. + if (ir::Loop* ploop = loop_desc_[if_block]) { + ploop->AddBasicBlock(loop_pre_header); + loop_desc_.SetBasicBlockToLoop(loop_pre_header->id(), ploop); + } + + // Update the CFG. + cfg.RegisterBlock(loop_pre_header); + def_use_mgr->AnalyzeInstDef(loop_pre_header->GetLabelInst()); + cfg.AddEdge(if_block->id(), loop_pre_header->id()); + cfg.RemoveNonExistingEdges(loop_->GetHeaderBlock()->id()); + + loop_->GetHeaderBlock()->ForEachPhiInst( + [loop_pre_header, if_block](ir::Instruction* phi) { + phi->ForEachInId([loop_pre_header, if_block](uint32_t* id) { + if (*id == if_block->id()) { + *id = loop_pre_header->id(); + } + }); + }); + loop_->SetPreHeaderBlock(loop_pre_header); + + // Update the dominator tree. + DominatorTreeNode* loop_pre_header_dtn = + dom_tree->GetOrInsertNode(loop_pre_header); + DominatorTreeNode* if_block_dtn = dom_tree->GetTreeNode(if_block); + loop_pre_header_dtn->parent_ = if_block_dtn; + assert( + if_block_dtn->children_.size() == 1 && + "A loop preheader should only have the header block as a child in the " + "dominator tree"); + loop_pre_header_dtn->children_.push_back(if_block_dtn->children_[0]); + if_block_dtn->children_.clear(); + if_block_dtn->children_.push_back(loop_pre_header_dtn); + + // Make domination queries valid. + dom_tree->ResetDFNumbering(); + + // Compute an ordered list of basic block to clone: loop blocks + pre-header + // + merge block. + loop_->ComputeLoopStructuredOrder(&ordered_loop_blocks_, true, true); + + ///////////////////////////// + // Do the actual unswitch: // + // - Clone the loop // + // - Connect exits // + // - Specialize the loop // + ///////////////////////////// + + ir::Instruction* iv_condition = &*switch_block_->tail(); + SpvOp iv_opcode = iv_condition->opcode(); + ir::Instruction* condition = + def_use_mgr->GetDef(iv_condition->GetOperand(0).words[0]); + + analysis::ConstantManager* cst_mgr = context_->get_constant_mgr(); + const analysis::Type* cond_type = + context_->get_type_mgr()->GetType(condition->type_id()); + + // Build the list of value for which we need to clone and specialize the + // loop. + std::vector> constant_branch; + // Special case for the original loop + ir::Instruction* original_loop_constant_value; + ir::BasicBlock* original_loop_target; + if (iv_opcode == SpvOpBranchConditional) { + constant_branch.emplace_back( + cst_mgr->GetDefiningInstruction(cst_mgr->GetConstant(cond_type, {0})), + nullptr); + original_loop_constant_value = + cst_mgr->GetDefiningInstruction(cst_mgr->GetConstant(cond_type, {1})); + } else { + // We are looking to take the default branch, so we can't provide a + // specific value. + original_loop_constant_value = nullptr; + for (uint32_t i = 2; i < iv_condition->NumInOperands(); i += 2) { + constant_branch.emplace_back( + cst_mgr->GetDefiningInstruction(cst_mgr->GetConstant( + cond_type, iv_condition->GetInOperand(i).words)), + nullptr); + } + } + + // Get the loop landing pads. + std::unordered_set if_merging_blocks; + std::function is_from_original_loop; + if (loop_->GetHeaderBlock()->GetLoopMergeInst()) { + if_merging_blocks.insert(if_merge_block->id()); + is_from_original_loop = [this](uint32_t id) { + return loop_->IsInsideLoop(id) || loop_->GetMergeBlock()->id() == id; + }; + } else { + loop_->GetExitBlocks(&if_merging_blocks); + is_from_original_loop = [this](uint32_t id) { + return loop_->IsInsideLoop(id); + }; + } + + for (auto& specialisation_pair : constant_branch) { + ir::Instruction* specialisation_value = specialisation_pair.first; + ////////////////////////////////////////////////////////// + // Step 3: Duplicate |loop_|. + ////////////////////////////////////////////////////////// + LoopUtils::LoopCloningResult clone_result; + + ir::Loop* cloned_loop = + loop_utils.CloneLoop(&clone_result, ordered_loop_blocks_); + specialisation_pair.second = cloned_loop->GetPreHeaderBlock(); + + //////////////////////////////////// + // Step 4: Specialize the loop. // + //////////////////////////////////// + + { + std::unordered_set dead_blocks; + std::unordered_set unreachable_merges; + SimplifyLoop( + ir::make_range( + ir::UptrVectorIterator( + &clone_result.cloned_bb_, clone_result.cloned_bb_.begin()), + ir::UptrVectorIterator( + &clone_result.cloned_bb_, clone_result.cloned_bb_.end())), + cloned_loop, condition, specialisation_value, &dead_blocks); + + // We tagged dead blocks, create the loop before we invalidate any basic + // block. + cloned_loop = + CleanLoopNest(cloned_loop, dead_blocks, &unreachable_merges); + CleanUpCFG( + ir::UptrVectorIterator( + &clone_result.cloned_bb_, clone_result.cloned_bb_.begin()), + dead_blocks, unreachable_merges); + + /////////////////////////////////////////////////////////// + // Step 5: Connect convergent edges to the landing pads. // + /////////////////////////////////////////////////////////// + + for (uint32_t merge_bb_id : if_merging_blocks) { + ir::BasicBlock* merge = context_->cfg()->block(merge_bb_id); + // We are in LCSSA so we only care about phi instructions. + merge->ForEachPhiInst([is_from_original_loop, &dead_blocks, + &clone_result](ir::Instruction* phi) { + uint32_t num_in_operands = phi->NumInOperands(); + for (uint32_t i = 0; i < num_in_operands; i += 2) { + uint32_t pred = phi->GetSingleWordInOperand(i + 1); + if (is_from_original_loop(pred)) { + pred = clone_result.value_map_.at(pred); + if (!dead_blocks.count(pred)) { + uint32_t incoming_value_id = phi->GetSingleWordInOperand(i); + // Not all the incoming value are coming from the loop. + ValueMapTy::iterator new_value = + clone_result.value_map_.find(incoming_value_id); + if (new_value != clone_result.value_map_.end()) { + incoming_value_id = new_value->second; + } + phi->AddOperand({SPV_OPERAND_TYPE_ID, {incoming_value_id}}); + phi->AddOperand({SPV_OPERAND_TYPE_ID, {pred}}); + } + } + } + }); + } + } + function_->AddBasicBlocks(clone_result.cloned_bb_.begin(), + clone_result.cloned_bb_.end(), + ++FindBasicBlockPosition(if_block)); + } + + // Same as above but specialize the existing loop + { + std::unordered_set dead_blocks; + std::unordered_set unreachable_merges; + SimplifyLoop(ir::make_range(function_->begin(), function_->end()), loop_, + condition, original_loop_constant_value, &dead_blocks); + + for (uint32_t merge_bb_id : if_merging_blocks) { + ir::BasicBlock* merge = context_->cfg()->block(merge_bb_id); + // LCSSA, so we only care about phi instructions. + // If we the phi is reduced to a single incoming branch, do not + // propagate it to preserve LCSSA. + PatchPhis(merge, dead_blocks, true); + } + if (if_merge_block) { + bool has_live_pred = false; + for (uint32_t pid : cfg.preds(if_merge_block->id())) { + if (!dead_blocks.count(pid)) { + has_live_pred = true; + break; + } + } + if (!has_live_pred) unreachable_merges.insert(if_merge_block->id()); + } + original_loop_target = loop_->GetPreHeaderBlock(); + // We tagged dead blocks, prune the loop descriptor from any dead loops. + // After this call, |loop_| can be nullptr (i.e. the unswitch killed this + // loop). + loop_ = CleanLoopNest(loop_, dead_blocks, &unreachable_merges); + + CleanUpCFG(function_->begin(), dead_blocks, unreachable_merges); + } + + ///////////////////////////////////// + // Finally: connect the new loops. // + ///////////////////////////////////// + + // Delete the old jump + context_->KillInst(&*if_block->tail()); + opt::InstructionBuilder builder(context_, if_block); + if (iv_opcode == SpvOpBranchConditional) { + assert(constant_branch.size() == 1); + builder.AddConditionalBranch( + condition->result_id(), original_loop_target->id(), + constant_branch[0].second->id(), + if_merge_block ? if_merge_block->id() : kInvalidId); + } else { + std::vector, uint32_t>> targets; + for (auto& t : constant_branch) { + targets.emplace_back(t.first->GetInOperand(0).words, t.second->id()); + } + + builder.AddSwitch(condition->result_id(), original_loop_target->id(), + targets, + if_merge_block ? if_merge_block->id() : kInvalidId); + } + + switch_block_ = nullptr; + ordered_loop_blocks_.clear(); + + context_->InvalidateAnalysesExceptFor( + ir::IRContext::Analysis::kAnalysisLoopAnalysis); + } + + // Returns true if the unswitch killed the original |loop_|. + bool WasLoopKilled() const { return loop_ == nullptr; } + + private: + using ValueMapTy = std::unordered_map; + using BlockMapTy = std::unordered_map; + + ir::Function* function_; + ir::Loop* loop_; + ir::LoopDescriptor& loop_desc_; + ir::IRContext* context_; + + ir::BasicBlock* switch_block_; + // Map between instructions and if they are dynamically uniform. + std::unordered_map dynamically_uniform_; + // The loop basic blocks in structured order. + std::vector ordered_loop_blocks_; + + // Returns the next usable id for the context. + uint32_t TakeNextId() { return context_->TakeNextId(); } + + // Patches |bb|'s phi instruction by removing incoming value from unexisting + // or tagged as dead branches. + void PatchPhis(ir::BasicBlock* bb, + const std::unordered_set& dead_blocks, + bool preserve_phi) { + ir::CFG& cfg = *context_->cfg(); + + std::vector phi_to_kill; + const std::vector& bb_preds = cfg.preds(bb->id()); + auto is_branch_dead = [&bb_preds, &dead_blocks](uint32_t id) { + return dead_blocks.count(id) || + std::find(bb_preds.begin(), bb_preds.end(), id) == bb_preds.end(); + }; + bb->ForEachPhiInst([&phi_to_kill, &is_branch_dead, preserve_phi, + this](ir::Instruction* insn) { + uint32_t i = 0; + while (i < insn->NumInOperands()) { + uint32_t incoming_id = insn->GetSingleWordInOperand(i + 1); + if (is_branch_dead(incoming_id)) { + // Remove the incoming block id operand. + insn->RemoveInOperand(i + 1); + // Remove the definition id operand. + insn->RemoveInOperand(i); + continue; + } + i += 2; + } + // If there is only 1 remaining edge, propagate the value and + // kill the instruction. + if (insn->NumInOperands() == 2 && !preserve_phi) { + phi_to_kill.push_back(insn); + context_->ReplaceAllUsesWith(insn->result_id(), + insn->GetSingleWordInOperand(0)); + } + }); + for (ir::Instruction* insn : phi_to_kill) { + context_->KillInst(insn); + } + } + + // Removes any block that is tagged as dead, if the block is in + // |unreachable_merges| then all block's instructions are replaced by a + // OpUnreachable. + void CleanUpCFG(ir::UptrVectorIterator bb_it, + const std::unordered_set& dead_blocks, + const std::unordered_set& unreachable_merges) { + ir::CFG& cfg = *context_->cfg(); + + while (bb_it != bb_it.End()) { + ir::BasicBlock& bb = *bb_it; + + if (unreachable_merges.count(bb.id())) { + if (bb.begin() != bb.tail() || + bb.terminator()->opcode() != SpvOpUnreachable) { + // Make unreachable, but leave the label. + bb.KillAllInsts(false); + opt::InstructionBuilder(context_, &bb).AddUnreachable(); + cfg.RemoveNonExistingEdges(bb.id()); + } + ++bb_it; + } else if (dead_blocks.count(bb.id())) { + cfg.ForgetBlock(&bb); + // Kill this block. + bb.KillAllInsts(true); + bb_it = bb_it.Erase(); + } else { + cfg.RemoveNonExistingEdges(bb.id()); + ++bb_it; + } + } + } + + // Return true if |c_inst| is a Boolean constant and set |cond_val| with the + // value that |c_inst| + bool GetConstCondition(const ir::Instruction* c_inst, bool* cond_val) { + bool cond_is_const; + switch (c_inst->opcode()) { + case SpvOpConstantFalse: { + *cond_val = false; + cond_is_const = true; + } break; + case SpvOpConstantTrue: { + *cond_val = true; + cond_is_const = true; + } break; + default: { cond_is_const = false; } break; + } + return cond_is_const; + } + + // Simplifies |loop| assuming the instruction |to_version_insn| takes the + // value |cst_value|. |block_range| is an iterator range returning the loop + // basic blocks in a structured order (dominator first). + // The function will ignore basic blocks returned by |block_range| if they + // does not belong to the loop. + // The set |dead_blocks| will contain all the dead basic blocks. + // + // Requirements: + // - |loop| must be in the LCSSA form; + // - |cst_value| must be constant or null (to represent the default target + // of an OpSwitch). + void SimplifyLoop( + ir::IteratorRange> block_range, + ir::Loop* loop, ir::Instruction* to_version_insn, + ir::Instruction* cst_value, std::unordered_set* dead_blocks) { + ir::CFG& cfg = *context_->cfg(); + analysis::DefUseManager* def_use_mgr = context_->get_def_use_mgr(); + + std::function ignore_node; + ignore_node = [loop](uint32_t bb_id) { return !loop->IsInsideLoop(bb_id); }; + + std::vector> use_list; + def_use_mgr->ForEachUse( + to_version_insn, [&use_list, &ignore_node, this]( + ir::Instruction* inst, uint32_t operand_index) { + ir::BasicBlock* bb = context_->get_instr_block(inst); + + if (!bb || ignore_node(bb->id())) { + // Out of the loop, the specialization does not apply any more. + return; + } + use_list.emplace_back(inst, operand_index); + }); + + // First pass: inject the specialized value into the loop (and only the + // loop). + for (auto use : use_list) { + ir::Instruction* inst = use.first; + uint32_t operand_index = use.second; + ir::BasicBlock* bb = context_->get_instr_block(inst); + + // If it is not a branch, simply inject the value. + if (!inst->IsBranch()) { + // To also handle switch, cst_value can be nullptr: this case + // means that we are looking to branch to the default target of + // the switch. We don't actually know its value so we don't touch + // it if it not a switch. + if (cst_value) { + inst->SetOperand(operand_index, {cst_value->result_id()}); + def_use_mgr->AnalyzeInstUse(inst); + } + } + + // The user is a branch, kill dead branches. + uint32_t live_target = 0; + std::unordered_set dead_branches; + switch (inst->opcode()) { + case SpvOpBranchConditional: { + assert(cst_value && "No constant value to specialize !"); + bool branch_cond = false; + if (GetConstCondition(cst_value, &branch_cond)) { + uint32_t true_label = + inst->GetSingleWordInOperand(kBranchCondTrueLabIdInIdx); + uint32_t false_label = + inst->GetSingleWordInOperand(kBranchCondFalseLabIdInIdx); + live_target = branch_cond ? true_label : false_label; + uint32_t dead_target = !branch_cond ? true_label : false_label; + cfg.RemoveEdge(bb->id(), dead_target); + } + break; + } + case SpvOpSwitch: { + live_target = inst->GetSingleWordInOperand(1); + if (cst_value) { + if (!cst_value->IsConstant()) break; + const ir::Operand& cst = cst_value->GetInOperand(0); + for (uint32_t i = 2; i < inst->NumInOperands(); i += 2) { + const ir::Operand& literal = inst->GetInOperand(i); + if (literal == cst) { + live_target = inst->GetSingleWordInOperand(i + 1); + break; + } + } + } + for (uint32_t i = 1; i < inst->NumInOperands(); i += 2) { + uint32_t id = inst->GetSingleWordInOperand(i); + if (id != live_target) { + cfg.RemoveEdge(bb->id(), id); + } + } + } + default: + break; + } + if (live_target != 0) { + // Check for the presence of the merge block. + if (ir::Instruction* merge = bb->GetMergeInst()) + context_->KillInst(merge); + context_->KillInst(&*bb->tail()); + opt::InstructionBuilder builder( + context_, bb, + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping); + builder.AddBranch(live_target); + } + } + + // Go through the loop basic block and tag all blocks that are obviously + // dead. + std::unordered_set visited; + for (ir::BasicBlock& bb : block_range) { + if (ignore_node(bb.id())) continue; + visited.insert(bb.id()); + + // Check if this block is dead, if so tag it as dead otherwise patch phi + // instructions. + bool has_live_pred = false; + for (uint32_t pid : cfg.preds(bb.id())) { + if (!dead_blocks->count(pid)) { + has_live_pred = true; + break; + } + } + if (!has_live_pred) { + dead_blocks->insert(bb.id()); + const ir::BasicBlock& cbb = bb; + // Patch the phis for any back-edge. + cbb.ForEachSuccessorLabel( + [dead_blocks, &visited, &cfg, this](uint32_t id) { + if (!visited.count(id) || dead_blocks->count(id)) return; + ir::BasicBlock* succ = cfg.block(id); + PatchPhis(succ, *dead_blocks, false); + }); + continue; + } + // Update the phi instructions, some incoming branch have/will disappear. + PatchPhis(&bb, *dead_blocks, /* preserve_phi = */ false); + } + } + + // Returns true if the header is not reachable or tagged as dead or if we + // never loop back. + bool IsLoopDead(ir::BasicBlock* header, ir::BasicBlock* latch, + const std::unordered_set& dead_blocks) { + if (!header || dead_blocks.count(header->id())) return true; + if (!latch || dead_blocks.count(latch->id())) return true; + for (uint32_t pid : context_->cfg()->preds(header->id())) { + if (!dead_blocks.count(pid)) { + // Seems reachable. + return false; + } + } + return true; + } + + // Cleans the loop nest under |loop| and reflect changes to the loop + // descriptor. This will kill all descriptors that represent dead loops. + // If |loop_| is killed, it will be set to nullptr. + // Any merge blocks that become unreachable will be added to + // |unreachable_merges|. + // The function returns the pointer to |loop| or nullptr if the loop was + // killed. + ir::Loop* CleanLoopNest(ir::Loop* loop, + const std::unordered_set& dead_blocks, + std::unordered_set* unreachable_merges) { + // This represent the pair of dead loop and nearest alive parent (nullptr if + // no parent). + std::unordered_map dead_loops; + auto get_parent = [&dead_loops](ir::Loop* l) -> ir::Loop* { + std::unordered_map::iterator it = + dead_loops.find(l); + if (it != dead_loops.end()) return it->second; + return nullptr; + }; + + bool is_main_loop_dead = + IsLoopDead(loop->GetHeaderBlock(), loop->GetLatchBlock(), dead_blocks); + if (is_main_loop_dead) { + if (ir::Instruction* merge = loop->GetHeaderBlock()->GetLoopMergeInst()) { + context_->KillInst(merge); + } + dead_loops[loop] = loop->GetParent(); + } else + dead_loops[loop] = loop; + // For each loop, check if we killed it. If we did, find a suitable parent + // for its children. + for (ir::Loop& sub_loop : + ir::make_range(++opt::TreeDFIterator(loop), + opt::TreeDFIterator())) { + if (IsLoopDead(sub_loop.GetHeaderBlock(), sub_loop.GetLatchBlock(), + dead_blocks)) { + if (ir::Instruction* merge = + sub_loop.GetHeaderBlock()->GetLoopMergeInst()) { + context_->KillInst(merge); + } + dead_loops[&sub_loop] = get_parent(&sub_loop); + } else { + // The loop is alive, check if its merge block is dead, if it is, tag it + // as required. + if (sub_loop.GetMergeBlock()) { + uint32_t merge_id = sub_loop.GetMergeBlock()->id(); + if (dead_blocks.count(merge_id)) { + unreachable_merges->insert(sub_loop.GetMergeBlock()->id()); + } + } + } + } + if (!is_main_loop_dead) dead_loops.erase(loop); + + // Remove dead blocks from live loops. + for (uint32_t bb_id : dead_blocks) { + ir::Loop* l = loop_desc_[bb_id]; + if (l) { + l->RemoveBasicBlock(bb_id); + loop_desc_.ForgetBasicBlock(bb_id); + } + } + + std::for_each( + dead_loops.begin(), dead_loops.end(), + [&loop, this]( + std::unordered_map::iterator::reference it) { + if (it.first == loop) loop = nullptr; + loop_desc_.RemoveLoop(it.first); + }); + + return loop; + } + + // Returns true if |var| is dynamically uniform. + // Note: this is currently approximated as uniform. + bool IsDynamicallyUniform(ir::Instruction* var, const ir::BasicBlock* entry, + const DominatorTree& post_dom_tree) { + assert(post_dom_tree.IsPostDominator()); + analysis::DefUseManager* def_use_mgr = context_->get_def_use_mgr(); + + auto it = dynamically_uniform_.find(var->result_id()); + + if (it != dynamically_uniform_.end()) return it->second; + + analysis::DecorationManager* dec_mgr = context_->get_decoration_mgr(); + + bool& is_uniform = dynamically_uniform_[var->result_id()]; + is_uniform = false; + + dec_mgr->WhileEachDecoration(var->result_id(), SpvDecorationUniform, + [&is_uniform](const ir::Instruction&) { + is_uniform = true; + return false; + }); + if (is_uniform) { + return is_uniform; + } + + ir::BasicBlock* parent = context_->get_instr_block(var); + if (!parent) { + return is_uniform = true; + } + + if (!post_dom_tree.Dominates(parent->id(), entry->id())) { + return is_uniform = false; + } + if (var->opcode() == SpvOpLoad) { + const uint32_t PtrTypeId = + def_use_mgr->GetDef(var->GetSingleWordInOperand(0))->type_id(); + const ir::Instruction* PtrTypeInst = def_use_mgr->GetDef(PtrTypeId); + uint32_t storage_class = + PtrTypeInst->GetSingleWordInOperand(kTypePointerStorageClassInIdx); + if (storage_class != SpvStorageClassUniform && + storage_class != SpvStorageClassUniformConstant) { + return is_uniform = false; + } + } else { + if (!context_->IsCombinatorInstruction(var)) { + return is_uniform = false; + } + } + + return is_uniform = var->WhileEachInId([entry, &post_dom_tree, + this](const uint32_t* id) { + return IsDynamicallyUniform(context_->get_def_use_mgr()->GetDef(*id), + entry, post_dom_tree); + }); + } + + // Returns true if |insn| is constant and dynamically uniform within the loop. + bool IsConditionLoopInvariant(ir::Instruction* insn) { + assert(insn->IsBranch()); + assert(insn->opcode() != SpvOpBranch); + analysis::DefUseManager* def_use_mgr = context_->get_def_use_mgr(); + + ir::Instruction* condition = + def_use_mgr->GetDef(insn->GetOperand(0).words[0]); + return !loop_->IsInsideLoop(condition) && + IsDynamicallyUniform( + condition, function_->entry().get(), + context_->GetPostDominatorAnalysis(function_, *context_->cfg()) + ->GetDomTree()); + } +}; + +} // namespace + +Pass::Status LoopUnswitchPass::Process(ir::IRContext* c) { + InitializeProcessing(c); + + bool modified = false; + ir::Module* module = c->module(); + + // Process each function in the module + for (ir::Function& f : *module) { + modified |= ProcessFunction(&f); + } + + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +bool LoopUnswitchPass::ProcessFunction(ir::Function* f) { + bool modified = false; + std::unordered_set processed_loop; + + ir::LoopDescriptor& loop_descriptor = *context()->GetLoopDescriptor(f); + + bool loop_changed = true; + while (loop_changed) { + loop_changed = false; + for (ir::Loop& loop : + ir::make_range(++opt::TreeDFIterator( + loop_descriptor.GetDummyRootLoop()), + opt::TreeDFIterator())) { + if (processed_loop.count(&loop)) continue; + processed_loop.insert(&loop); + + LoopUnswitch unswitcher(context(), f, &loop, &loop_descriptor); + while (!unswitcher.WasLoopKilled() && unswitcher.CanUnswitchLoop()) { + if (!loop.IsLCSSA()) { + LoopUtils(context(), &loop).MakeLoopClosedSSA(); + } + modified = true; + loop_changed = true; + unswitcher.PerformUnswitch(); + } + if (loop_changed) break; + } + } + + return modified; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_unswitch_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_unswitch_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_unswitch_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_unswitch_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,43 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_LOOP_UNSWITCH_PASS_H_ +#define LIBSPIRV_OPT_LOOP_UNSWITCH_PASS_H_ + +#include "opt/loop_descriptor.h" +#include "opt/pass.h" + +namespace spvtools { +namespace opt { + +// Implements the loop unswitch optimization. +// The loop unswitch hoists invariant "if" statements if the conditions are +// constant within the loop and clones the loop for each branch. +class LoopUnswitchPass : public Pass { + public: + const char* name() const override { return "loop-unswitch"; } + + // Processes the given |module|. Returns Status::Failure if errors occur when + // processing. Returns the corresponding Status::Success if processing is + // succesful to indicate whether changes have been made to the modue. + Pass::Status Process(ir::IRContext* context) override; + + private: + bool ProcessFunction(ir::Function* f); +}; + +} // namespace opt +} // namespace spvtools + +#endif // !LIBSPIRV_OPT_LOOP_UNSWITCH_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_utils.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_utils.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_utils.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_utils.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,602 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include +#include +#include + +#include "cfa.h" +#include "opt/cfg.h" +#include "opt/ir_builder.h" +#include "opt/ir_context.h" +#include "opt/loop_descriptor.h" +#include "opt/loop_utils.h" + +namespace spvtools { +namespace opt { + +namespace { +// Return true if |bb| is dominated by at least one block in |exits| +static inline bool DominatesAnExit( + ir::BasicBlock* bb, const std::unordered_set& exits, + const opt::DominatorTree& dom_tree) { + for (ir::BasicBlock* e_bb : exits) + if (dom_tree.Dominates(bb, e_bb)) return true; + return false; +} + +// Utility class to rewrite out-of-loop uses of an in-loop definition in terms +// of phi instructions to achieve a LCSSA form. +// For a given definition, the class user registers phi instructions using that +// definition in all loop exit blocks by which the definition escapes. +// Then, when rewriting a use of the definition, the rewriter walks the +// paths from the use the loop exits. At each step, it will insert a phi +// instruction to merge the incoming value according to exit blocks definition. +class LCSSARewriter { + public: + LCSSARewriter(ir::IRContext* context, const opt::DominatorTree& dom_tree, + const std::unordered_set& exit_bb, + ir::BasicBlock* merge_block) + : context_(context), + cfg_(context_->cfg()), + dom_tree_(dom_tree), + exit_bb_(exit_bb), + merge_block_id_(merge_block ? merge_block->id() : 0) {} + + struct UseRewriter { + explicit UseRewriter(LCSSARewriter* base, const ir::Instruction& def_insn) + : base_(base), def_insn_(def_insn) {} + // Rewrites the use of |def_insn_| by the instruction |user| at the index + // |operand_index| in terms of phi instruction. This recursively builds new + // phi instructions from |user| to the loop exit blocks' phis. The use of + // |def_insn_| in |user| is replaced by the relevant phi instruction at the + // end of the operation. + // It is assumed that |user| does not dominates any of the loop exit basic + // block. This operation does not update the def/use manager, instead it + // records what needs to be updated. The actual update is performed by + // UpdateManagers. + void RewriteUse(ir::BasicBlock* bb, ir::Instruction* user, + uint32_t operand_index) { + assert( + (user->opcode() != SpvOpPhi || bb != GetParent(user)) && + "The root basic block must be the incoming edge if |user| is a phi " + "instruction"); + assert((user->opcode() == SpvOpPhi || bb == GetParent(user)) && + "The root basic block must be the instruction parent if |user| is " + "not " + "phi instruction"); + + ir::Instruction* new_def = GetOrBuildIncoming(bb->id()); + + user->SetOperand(operand_index, {new_def->result_id()}); + rewritten_.insert(user); + } + + // In-place update of some managers (avoid full invalidation). + inline void UpdateManagers() { + opt::analysis::DefUseManager* def_use_mgr = + base_->context_->get_def_use_mgr(); + // Register all new definitions. + for (ir::Instruction* insn : rewritten_) { + def_use_mgr->AnalyzeInstDef(insn); + } + // Register all new uses. + for (ir::Instruction* insn : rewritten_) { + def_use_mgr->AnalyzeInstUse(insn); + } + } + + private: + // Return the basic block that |instr| belongs to. + ir::BasicBlock* GetParent(ir::Instruction* instr) { + return base_->context_->get_instr_block(instr); + } + + // Builds a phi instruction for the basic block |bb|. The function assumes + // that |defining_blocks| contains the list of basic block that define the + // usable value for each predecessor of |bb|. + inline ir::Instruction* CreatePhiInstruction( + ir::BasicBlock* bb, const std::vector& defining_blocks) { + std::vector incomings; + const std::vector& bb_preds = base_->cfg_->preds(bb->id()); + assert(bb_preds.size() == defining_blocks.size()); + for (size_t i = 0; i < bb_preds.size(); i++) { + incomings.push_back( + GetOrBuildIncoming(defining_blocks[i])->result_id()); + incomings.push_back(bb_preds[i]); + } + opt::InstructionBuilder builder( + base_->context_, &*bb->begin(), + ir::IRContext::kAnalysisInstrToBlockMapping); + ir::Instruction* incoming_phi = + builder.AddPhi(def_insn_.type_id(), incomings); + + rewritten_.insert(incoming_phi); + return incoming_phi; + } + + // Builds a phi instruction for the basic block |bb|, all incoming values + // will be |value|. + inline ir::Instruction* CreatePhiInstruction(ir::BasicBlock* bb, + const ir::Instruction& value) { + std::vector incomings; + const std::vector& bb_preds = base_->cfg_->preds(bb->id()); + for (size_t i = 0; i < bb_preds.size(); i++) { + incomings.push_back(value.result_id()); + incomings.push_back(bb_preds[i]); + } + opt::InstructionBuilder builder( + base_->context_, &*bb->begin(), + ir::IRContext::kAnalysisInstrToBlockMapping); + ir::Instruction* incoming_phi = + builder.AddPhi(def_insn_.type_id(), incomings); + + rewritten_.insert(incoming_phi); + return incoming_phi; + } + + // Return the new def to use for the basic block |bb_id|. + // If |bb_id| does not have a suitable def to use then we: + // - return the common def used by all predecessors; + // - if there is no common def, then we build a new phi instr at the + // beginning of |bb_id| and return this new instruction. + ir::Instruction* GetOrBuildIncoming(uint32_t bb_id) { + assert(base_->cfg_->block(bb_id) != nullptr && "Unknown basic block"); + + ir::Instruction*& incoming_phi = bb_to_phi_[bb_id]; + if (incoming_phi) { + return incoming_phi; + } + + ir::BasicBlock* bb = &*base_->cfg_->block(bb_id); + // If this is an exit basic block, look if there already is an eligible + // phi instruction. An eligible phi has |def_insn_| as all incoming + // values. + if (base_->exit_bb_.count(bb)) { + // Look if there is an eligible phi in this block. + if (!bb->WhileEachPhiInst([&incoming_phi, this](ir::Instruction* phi) { + for (uint32_t i = 0; i < phi->NumInOperands(); i += 2) { + if (phi->GetSingleWordInOperand(i) != def_insn_.result_id()) + return true; + } + incoming_phi = phi; + rewritten_.insert(incoming_phi); + return false; + })) { + return incoming_phi; + } + incoming_phi = CreatePhiInstruction(bb, def_insn_); + return incoming_phi; + } + + // Get the block that defines the value to use for each predecessor. + // If the vector has 1 value, then it means that this block does not need + // to build a phi instruction unless |bb_id| is the loop merge block. + const std::vector& defining_blocks = + base_->GetDefiningBlocks(bb_id); + + // Special case for structured loops: merge block might be different from + // the exit block set. To maintain structured properties it will ease + // transformations if the merge block also holds a phi instruction like + // the exit ones. + if (defining_blocks.size() > 1 || bb_id == base_->merge_block_id_) { + if (defining_blocks.size() > 1) { + incoming_phi = CreatePhiInstruction(bb, defining_blocks); + } else { + assert(bb_id == base_->merge_block_id_); + incoming_phi = + CreatePhiInstruction(bb, *GetOrBuildIncoming(defining_blocks[0])); + } + } else { + incoming_phi = GetOrBuildIncoming(defining_blocks[0]); + } + + return incoming_phi; + } + + LCSSARewriter* base_; + const ir::Instruction& def_insn_; + std::unordered_map bb_to_phi_; + std::unordered_set rewritten_; + }; + + private: + // Return the new def to use for the basic block |bb_id|. + // If |bb_id| does not have a suitable def to use then we: + // - return the common def used by all predecessors; + // - if there is no common def, then we build a new phi instr at the + // beginning of |bb_id| and return this new instruction. + const std::vector& GetDefiningBlocks(uint32_t bb_id) { + assert(cfg_->block(bb_id) != nullptr && "Unknown basic block"); + std::vector& defining_blocks = bb_to_defining_blocks_[bb_id]; + + if (defining_blocks.size()) return defining_blocks; + + // Check if one of the loop exit basic block dominates |bb_id|. + for (const ir::BasicBlock* e_bb : exit_bb_) { + if (dom_tree_.Dominates(e_bb->id(), bb_id)) { + defining_blocks.push_back(e_bb->id()); + return defining_blocks; + } + } + + // Process parents, they will returns their suitable blocks. + // If they are all the same, this means this basic block is dominated by a + // common block, so we won't need to build a phi instruction. + for (uint32_t pred_id : cfg_->preds(bb_id)) { + const std::vector& pred_blocks = GetDefiningBlocks(pred_id); + if (pred_blocks.size() == 1) + defining_blocks.push_back(pred_blocks[0]); + else + defining_blocks.push_back(pred_id); + } + assert(defining_blocks.size()); + if (std::all_of(defining_blocks.begin(), defining_blocks.end(), + [&defining_blocks](uint32_t id) { + return id == defining_blocks[0]; + })) { + // No need for a phi. + defining_blocks.resize(1); + } + + return defining_blocks; + } + + ir::IRContext* context_; + ir::CFG* cfg_; + const opt::DominatorTree& dom_tree_; + const std::unordered_set& exit_bb_; + uint32_t merge_block_id_; + // This map represent the set of known paths. For each key, the vector + // represent the set of blocks holding the definition to be used to build the + // phi instruction. + // If the vector has 0 value, then the path is unknown yet, and must be built. + // If the vector has 1 value, then the value defined by that basic block + // should be used. + // If the vector has more than 1 value, then a phi node must be created, the + // basic block ordering is the same as the predecessor ordering. + std::unordered_map> bb_to_defining_blocks_; +}; + +// Make the set |blocks| closed SSA. The set is closed SSA if all the uses +// outside the set are phi instructions in exiting basic block set (hold by +// |lcssa_rewriter|). +inline void MakeSetClosedSSA(ir::IRContext* context, ir::Function* function, + const std::unordered_set& blocks, + const std::unordered_set& exit_bb, + LCSSARewriter* lcssa_rewriter) { + ir::CFG& cfg = *context->cfg(); + opt::DominatorTree& dom_tree = + context->GetDominatorAnalysis(function, cfg)->GetDomTree(); + opt::analysis::DefUseManager* def_use_manager = context->get_def_use_mgr(); + + for (uint32_t bb_id : blocks) { + ir::BasicBlock* bb = cfg.block(bb_id); + // If bb does not dominate an exit block, then it cannot have escaping defs. + if (!DominatesAnExit(bb, exit_bb, dom_tree)) continue; + for (ir::Instruction& inst : *bb) { + LCSSARewriter::UseRewriter rewriter(lcssa_rewriter, inst); + def_use_manager->ForEachUse( + &inst, [&blocks, &rewriter, &exit_bb, context]( + ir::Instruction* use, uint32_t operand_index) { + ir::BasicBlock* use_parent = context->get_instr_block(use); + assert(use_parent); + if (blocks.count(use_parent->id())) return; + + if (use->opcode() == SpvOpPhi) { + // If the use is a Phi instruction and the incoming block is + // coming from the loop, then that's consistent with LCSSA form. + if (exit_bb.count(use_parent)) { + return; + } else { + // That's not an exit block, but the user is a phi instruction. + // Consider the incoming branch only. + use_parent = context->get_instr_block( + use->GetSingleWordOperand(operand_index + 1)); + } + } + // Rewrite the use. Note that this call does not invalidate the + // def/use manager. So this operation is safe. + rewriter.RewriteUse(use_parent, use, operand_index); + }); + rewriter.UpdateManagers(); + } + } +} + +} // namespace + +void LoopUtils::CreateLoopDedicatedExits() { + ir::Function* function = loop_->GetHeaderBlock()->GetParent(); + ir::LoopDescriptor& loop_desc = *context_->GetLoopDescriptor(function); + ir::CFG& cfg = *context_->cfg(); + opt::analysis::DefUseManager* def_use_mgr = context_->get_def_use_mgr(); + + const ir::IRContext::Analysis PreservedAnalyses = + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping; + + // Gathers the set of basic block that are not in this loop and have at least + // one predecessor in the loop and one not in the loop. + std::unordered_set exit_bb_set; + loop_->GetExitBlocks(&exit_bb_set); + + std::unordered_set new_loop_exits; + bool made_change = false; + // For each block, we create a new one that gathers all branches from + // the loop and fall into the block. + for (uint32_t non_dedicate_id : exit_bb_set) { + ir::BasicBlock* non_dedicate = cfg.block(non_dedicate_id); + const std::vector& bb_pred = cfg.preds(non_dedicate_id); + // Ignore the block if all the predecessors are in the loop. + if (std::all_of(bb_pred.begin(), bb_pred.end(), + [this](uint32_t id) { return loop_->IsInsideLoop(id); })) { + new_loop_exits.insert(non_dedicate); + continue; + } + + made_change = true; + ir::Function::iterator insert_pt = function->begin(); + for (; insert_pt != function->end() && &*insert_pt != non_dedicate; + ++insert_pt) { + } + assert(insert_pt != function->end() && "Basic Block not found"); + + // Create the dedicate exit basic block. + ir::BasicBlock& exit = *insert_pt.InsertBefore( + std::unique_ptr(new ir::BasicBlock( + std::unique_ptr(new ir::Instruction( + context_, SpvOpLabel, 0, context_->TakeNextId(), {}))))); + exit.SetParent(function); + + // Redirect in loop predecessors to |exit| block. + for (uint32_t exit_pred_id : bb_pred) { + if (loop_->IsInsideLoop(exit_pred_id)) { + ir::BasicBlock* pred_block = cfg.block(exit_pred_id); + pred_block->ForEachSuccessorLabel([non_dedicate, &exit](uint32_t* id) { + if (*id == non_dedicate->id()) *id = exit.id(); + }); + // Update the CFG. + // |non_dedicate|'s predecessor list will be updated at the end of the + // loop. + cfg.RegisterBlock(pred_block); + } + } + + // Register the label to the def/use manager, requires for the phi patching. + def_use_mgr->AnalyzeInstDefUse(exit.GetLabelInst()); + context_->set_instr_block(exit.GetLabelInst(), &exit); + + opt::InstructionBuilder builder(context_, &exit, PreservedAnalyses); + // Now jump from our dedicate basic block to the old exit. + // We also reset the insert point so all instructions are inserted before + // the branch. + builder.SetInsertPoint(builder.AddBranch(non_dedicate->id())); + non_dedicate->ForEachPhiInst([&builder, &exit, def_use_mgr, + this](ir::Instruction* phi) { + // New phi operands for this instruction. + std::vector new_phi_op; + // Phi operands for the dedicated exit block. + std::vector exit_phi_op; + for (uint32_t i = 0; i < phi->NumInOperands(); i += 2) { + uint32_t def_id = phi->GetSingleWordInOperand(i); + uint32_t incoming_id = phi->GetSingleWordInOperand(i + 1); + if (loop_->IsInsideLoop(incoming_id)) { + exit_phi_op.push_back(def_id); + exit_phi_op.push_back(incoming_id); + } else { + new_phi_op.push_back(def_id); + new_phi_op.push_back(incoming_id); + } + } + + // Build the new phi instruction dedicated exit block. + ir::Instruction* exit_phi = builder.AddPhi(phi->type_id(), exit_phi_op); + // Build the new incoming branch. + new_phi_op.push_back(exit_phi->result_id()); + new_phi_op.push_back(exit.id()); + // Rewrite operands. + uint32_t idx = 0; + for (; idx < new_phi_op.size(); idx++) + phi->SetInOperand(idx, {new_phi_op[idx]}); + // Remove extra operands, from last to first (more efficient). + for (uint32_t j = phi->NumInOperands() - 1; j >= idx; j--) + phi->RemoveInOperand(j); + // Update the def/use manager for this |phi|. + def_use_mgr->AnalyzeInstUse(phi); + }); + // Update the CFG. + cfg.RegisterBlock(&exit); + cfg.RemoveNonExistingEdges(non_dedicate->id()); + new_loop_exits.insert(&exit); + // If non_dedicate is in a loop, add the new dedicated exit in that loop. + if (ir::Loop* parent_loop = loop_desc[non_dedicate]) + parent_loop->AddBasicBlock(&exit); + } + + if (new_loop_exits.size() == 1) { + loop_->SetMergeBlock(*new_loop_exits.begin()); + } + + if (made_change) { + context_->InvalidateAnalysesExceptFor( + PreservedAnalyses | ir::IRContext::kAnalysisCFG | + ir::IRContext::Analysis::kAnalysisLoopAnalysis); + } +} + +void LoopUtils::MakeLoopClosedSSA() { + CreateLoopDedicatedExits(); + + ir::Function* function = loop_->GetHeaderBlock()->GetParent(); + ir::CFG& cfg = *context_->cfg(); + opt::DominatorTree& dom_tree = + context_->GetDominatorAnalysis(function, cfg)->GetDomTree(); + + std::unordered_set exit_bb; + { + std::unordered_set exit_bb_id; + loop_->GetExitBlocks(&exit_bb_id); + for (uint32_t bb_id : exit_bb_id) { + exit_bb.insert(cfg.block(bb_id)); + } + } + + LCSSARewriter lcssa_rewriter(context_, dom_tree, exit_bb, + loop_->GetMergeBlock()); + MakeSetClosedSSA(context_, function, loop_->GetBlocks(), exit_bb, + &lcssa_rewriter); + + // Make sure all defs post-dominated by the merge block have their last use no + // further than the merge block. + if (loop_->GetMergeBlock()) { + std::unordered_set merging_bb_id; + loop_->GetMergingBlocks(&merging_bb_id); + merging_bb_id.erase(loop_->GetMergeBlock()->id()); + // Reset the exit set, now only the merge block is the exit. + exit_bb.clear(); + exit_bb.insert(loop_->GetMergeBlock()); + // LCSSARewriter is reusable here only because it forces the creation of a + // phi instruction in the merge block. + MakeSetClosedSSA(context_, function, merging_bb_id, exit_bb, + &lcssa_rewriter); + } + + context_->InvalidateAnalysesExceptFor( + ir::IRContext::Analysis::kAnalysisDefUse | + ir::IRContext::Analysis::kAnalysisCFG | + ir::IRContext::Analysis::kAnalysisDominatorAnalysis | + ir::IRContext::Analysis::kAnalysisLoopAnalysis); +} + +ir::Loop* LoopUtils::CloneLoop( + LoopCloningResult* cloning_result, + const std::vector& ordered_loop_blocks) const { + analysis::DefUseManager* def_use_mgr = context_->get_def_use_mgr(); + + std::unique_ptr new_loop = MakeUnique(context_); + if (loop_->HasParent()) new_loop->SetParent(loop_->GetParent()); + + ir::CFG& cfg = *context_->cfg(); + + // Clone and place blocks in a SPIR-V compliant order (dominators first). + for (ir::BasicBlock* old_bb : ordered_loop_blocks) { + // For each basic block in the loop, we clone it and register the mapping + // between old and new ids. + ir::BasicBlock* new_bb = old_bb->Clone(context_); + new_bb->SetParent(&function_); + new_bb->GetLabelInst()->SetResultId(context_->TakeNextId()); + def_use_mgr->AnalyzeInstDef(new_bb->GetLabelInst()); + context_->set_instr_block(new_bb->GetLabelInst(), new_bb); + cloning_result->cloned_bb_.emplace_back(new_bb); + + cloning_result->old_to_new_bb_[old_bb->id()] = new_bb; + cloning_result->new_to_old_bb_[new_bb->id()] = old_bb; + cloning_result->value_map_[old_bb->id()] = new_bb->id(); + + if (loop_->IsInsideLoop(old_bb)) new_loop->AddBasicBlock(new_bb); + + for (auto& inst : *new_bb) { + if (inst.HasResultId()) { + uint32_t old_result_id = inst.result_id(); + inst.SetResultId(context_->TakeNextId()); + cloning_result->value_map_[old_result_id] = inst.result_id(); + + // Only look at the defs for now, uses are not updated yet. + def_use_mgr->AnalyzeInstDef(&inst); + } + } + } + + // All instructions (including all labels) have been cloned, + // remap instruction operands id with the new ones. + for (std::unique_ptr& bb_ref : cloning_result->cloned_bb_) { + ir::BasicBlock* bb = bb_ref.get(); + + for (ir::Instruction& insn : *bb) { + insn.ForEachInId([cloning_result](uint32_t* old_id) { + // If the operand is defined in the loop, remap the id. + auto id_it = cloning_result->value_map_.find(*old_id); + if (id_it != cloning_result->value_map_.end()) { + *old_id = id_it->second; + } + }); + // Only look at what the instruction uses. All defs are register, so all + // should be fine now. + def_use_mgr->AnalyzeInstUse(&insn); + context_->set_instr_block(&insn, bb); + } + cfg.RegisterBlock(bb); + } + + PopulateLoopNest(new_loop.get(), *cloning_result); + + return new_loop.release(); +} + +void LoopUtils::PopulateLoopNest( + ir::Loop* new_loop, const LoopCloningResult& cloning_result) const { + std::unordered_map loop_mapping; + loop_mapping[loop_] = new_loop; + + if (loop_->HasParent()) loop_->GetParent()->AddNestedLoop(new_loop); + PopulateLoopDesc(new_loop, loop_, cloning_result); + + for (ir::Loop& sub_loop : + ir::make_range(++opt::TreeDFIterator(loop_), + opt::TreeDFIterator())) { + ir::Loop* cloned = new ir::Loop(context_); + if (ir::Loop* parent = loop_mapping[sub_loop.GetParent()]) + parent->AddNestedLoop(cloned); + loop_mapping[&sub_loop] = cloned; + PopulateLoopDesc(cloned, &sub_loop, cloning_result); + } + + loop_desc_->AddLoopNest(std::unique_ptr(new_loop)); +} + +// Populates |new_loop| descriptor according to |old_loop|'s one. +void LoopUtils::PopulateLoopDesc( + ir::Loop* new_loop, ir::Loop* old_loop, + const LoopCloningResult& cloning_result) const { + for (uint32_t bb_id : old_loop->GetBlocks()) { + ir::BasicBlock* bb = cloning_result.old_to_new_bb_.at(bb_id); + new_loop->AddBasicBlock(bb); + } + new_loop->SetHeaderBlock( + cloning_result.old_to_new_bb_.at(old_loop->GetHeaderBlock()->id())); + if (old_loop->GetLatchBlock()) + new_loop->SetLatchBlock( + cloning_result.old_to_new_bb_.at(old_loop->GetLatchBlock()->id())); + if (old_loop->GetMergeBlock()) { + auto it = + cloning_result.old_to_new_bb_.find(old_loop->GetMergeBlock()->id()); + ir::BasicBlock* bb = it != cloning_result.old_to_new_bb_.end() + ? it->second + : old_loop->GetMergeBlock(); + new_loop->SetMergeBlock(bb); + } + if (old_loop->GetPreHeaderBlock()) { + auto it = + cloning_result.old_to_new_bb_.find(old_loop->GetPreHeaderBlock()->id()); + if (it != cloning_result.old_to_new_bb_.end()) { + new_loop->SetPreHeaderBlock(it->second); + } + } +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_utils.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_utils.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/loop_utils.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/loop_utils.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,158 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SOURCE_OPT_LOOP_UTILS_H_ +#define SOURCE_OPT_LOOP_UTILS_H_ +#include +#include +#include +#include "opt/ir_context.h" +#include "opt/loop_descriptor.h" + +namespace spvtools { + +namespace opt { + +// LoopUtils is used to encapsulte loop optimizations and from the passes which +// use them. Any pass which needs a loop optimization should do it through this +// or through a pass which is using this. +class LoopUtils { + public: + // Holds a auxiliary results of the loop cloning procedure. + struct LoopCloningResult { + using ValueMapTy = std::unordered_map; + using BlockMapTy = std::unordered_map; + + // Mapping between the original loop ids and the new one. + ValueMapTy value_map_; + // Mapping between original loop blocks to the cloned one. + BlockMapTy old_to_new_bb_; + // Mapping between the cloned loop blocks to original one. + BlockMapTy new_to_old_bb_; + // List of cloned basic block. + std::vector> cloned_bb_; + }; + + LoopUtils(ir::IRContext* context, ir::Loop* loop) + : context_(context), + loop_desc_( + context->GetLoopDescriptor(loop->GetHeaderBlock()->GetParent())), + loop_(loop), + function_(*loop_->GetHeaderBlock()->GetParent()) {} + + // The converts the current loop to loop closed SSA form. + // In the loop closed SSA, all loop exiting values go through a dedicated Phi + // instruction. For instance: + // + // for (...) { + // A1 = ... + // if (...) + // A2 = ... + // A = phi A1, A2 + // } + // ... = op A ... + // + // Becomes + // + // for (...) { + // A1 = ... + // if (...) + // A2 = ... + // A = phi A1, A2 + // } + // C = phi A + // ... = op C ... + // + // This makes some loop transformations (such as loop unswitch) simpler + // (removes the needs to take care of exiting variables). + void MakeLoopClosedSSA(); + + // Create dedicate exit basic block. This ensure all exit basic blocks has the + // loop as sole predecessors. + // By construction, structured control flow already has a dedicated exit + // block. + // Preserves: CFG, def/use and instruction to block mapping. + void CreateLoopDedicatedExits(); + + // Clone |loop_| and remap its instructions. Newly created blocks + // will be added to the |cloning_result.cloned_bb_| list, correctly ordered to + // be inserted into a function. + // It is assumed that |ordered_loop_blocks| is compatible with the result of + // |Loop::ComputeLoopStructuredOrder|. If the preheader and merge block are in + // the list they will also be cloned. If not, the resulting loop will share + // them with the original loop. + // The function preserves the def/use, cfg and instr to block analyses. + // The cloned loop nest will be added to the loop descriptor and will have + // ownership. + ir::Loop* CloneLoop( + LoopCloningResult* cloning_result, + const std::vector& ordered_loop_blocks) const; + + // Perfom a partial unroll of |loop| by given |factor|. This will copy the + // body of the loop |factor| times. So a |factor| of one would give a new loop + // with the original body plus one unrolled copy body. + bool PartiallyUnroll(size_t factor); + + // Fully unroll |loop|. + bool FullyUnroll(); + + // This function validates that |loop| meets the assumptions made by the + // implementation of the loop unroller. As the implementation accommodates + // more types of loops this function can reduce its checks. + // + // The conditions checked to ensure the loop can be unrolled are as follows: + // 1. That the loop is in structured order. + // 2. That the continue block is a branch to the header. + // 3. That the only phi used in the loop is the induction variable. + // TODO(stephen@codeplay.com): This is a temporary mesure, after the loop is + // converted into LCSAA form and has a single entry and exit we can rewrite + // the other phis. + // 4. That this is an inner most loop, or that loops contained within this + // loop have already been fully unrolled. + // 5. That each instruction in the loop is only used within the loop. + // (Related to the above phi condition). + bool CanPerformUnroll(); + + // Maintains the loop descriptor object after the unroll functions have been + // called, otherwise the analysis should be invalidated. + void Finalize(); + + // Returns the context associate to |loop_|. + ir::IRContext* GetContext() { return context_; } + // Returns the loop descriptor owning |loop_|. + ir::LoopDescriptor* GetLoopDescriptor() { return loop_desc_; } + // Returns the loop on which the object operates on. + ir::Loop* GetLoop() const { return loop_; } + // Returns the function that |loop_| belong to. + ir::Function* GetFunction() const { return &function_; } + + private: + ir::IRContext* context_; + ir::LoopDescriptor* loop_desc_; + ir::Loop* loop_; + ir::Function& function_; + + // Populates the loop nest of |new_loop| according to |loop_| nest. + void PopulateLoopNest(ir::Loop* new_loop, + const LoopCloningResult& cloning_result) const; + + // Populates |new_loop| descriptor according to |old_loop|'s one. + void PopulateLoopDesc(ir::Loop* new_loop, ir::Loop* old_loop, + const LoopCloningResult& cloning_result) const; +}; + +} // namespace opt +} // namespace spvtools + +#endif // SOURCE_OPT_LOOP_UTILS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/make_unique.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/make_unique.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/make_unique.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/make_unique.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_MAKE_UNIQUE_H_ +#define LIBSPIRV_OPT_MAKE_UNIQUE_H_ + +#include +#include + +namespace spvtools { + +template +std::unique_ptr MakeUnique(Args&&... args) { + return std::unique_ptr(new T(std::forward(args)...)); +} + +} // namespace spvtools + +#endif // LIBSPIRV_OPT_MAKE_UNIQUE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/mem_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/mem_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/mem_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/mem_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,880 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "mem_pass.h" + +#include "basic_block.h" +#include "cfa.h" +#include "dominator_analysis.h" +#include "ir_context.h" +#include "iterator.h" + +namespace spvtools { +namespace opt { + +namespace { + +const uint32_t kCopyObjectOperandInIdx = 0; +const uint32_t kLoopMergeMergeBlockIdInIdx = 0; +const uint32_t kStoreValIdInIdx = 1; +const uint32_t kTypePointerStorageClassInIdx = 0; +const uint32_t kTypePointerTypeIdInIdx = 1; +const uint32_t kVariableInitIdInIdx = 1; + +} // namespace + +bool MemPass::IsBaseTargetType(const ir::Instruction* typeInst) const { + switch (typeInst->opcode()) { + case SpvOpTypeInt: + case SpvOpTypeFloat: + case SpvOpTypeBool: + case SpvOpTypeVector: + case SpvOpTypeMatrix: + case SpvOpTypeImage: + case SpvOpTypeSampler: + case SpvOpTypeSampledImage: + case SpvOpTypePointer: + return true; + default: + break; + } + return false; +} + +bool MemPass::IsTargetType(const ir::Instruction* typeInst) const { + if (IsBaseTargetType(typeInst)) return true; + if (typeInst->opcode() == SpvOpTypeArray) { + if (!IsTargetType( + get_def_use_mgr()->GetDef(typeInst->GetSingleWordOperand(1)))) { + return false; + } + return true; + } + if (typeInst->opcode() != SpvOpTypeStruct) return false; + // All struct members must be math type + return typeInst->WhileEachInId([this](const uint32_t* tid) { + ir::Instruction* compTypeInst = get_def_use_mgr()->GetDef(*tid); + if (!IsTargetType(compTypeInst)) return false; + return true; + }); +} + +bool MemPass::IsNonPtrAccessChain(const SpvOp opcode) const { + return opcode == SpvOpAccessChain || opcode == SpvOpInBoundsAccessChain; +} + +bool MemPass::IsPtr(uint32_t ptrId) { + uint32_t varId = ptrId; + ir::Instruction* ptrInst = get_def_use_mgr()->GetDef(varId); + while (ptrInst->opcode() == SpvOpCopyObject) { + varId = ptrInst->GetSingleWordInOperand(kCopyObjectOperandInIdx); + ptrInst = get_def_use_mgr()->GetDef(varId); + } + const SpvOp op = ptrInst->opcode(); + if (op == SpvOpVariable || IsNonPtrAccessChain(op)) return true; + if (op != SpvOpFunctionParameter) return false; + const uint32_t varTypeId = ptrInst->type_id(); + const ir::Instruction* varTypeInst = get_def_use_mgr()->GetDef(varTypeId); + return varTypeInst->opcode() == SpvOpTypePointer; +} + +ir::Instruction* MemPass::GetPtr(uint32_t ptrId, uint32_t* varId) { + *varId = ptrId; + ir::Instruction* ptrInst = get_def_use_mgr()->GetDef(*varId); + ir::Instruction* varInst; + + if (ptrInst->opcode() != SpvOpVariable && + ptrInst->opcode() != SpvOpFunctionParameter) { + varInst = ptrInst->GetBaseAddress(); + } else { + varInst = ptrInst; + } + if (varInst->opcode() == SpvOpVariable) { + *varId = varInst->result_id(); + } else { + *varId = 0; + } + + while (ptrInst->opcode() == SpvOpCopyObject) { + uint32_t temp = ptrInst->GetSingleWordInOperand(0); + ptrInst = get_def_use_mgr()->GetDef(temp); + } + + return ptrInst; +} + +ir::Instruction* MemPass::GetPtr(ir::Instruction* ip, uint32_t* varId) { + assert(ip->opcode() == SpvOpStore || ip->opcode() == SpvOpLoad || + ip->opcode() == SpvOpImageTexelPointer); + + // All of these opcode place the pointer in position 0. + const uint32_t ptrId = ip->GetSingleWordInOperand(0); + return GetPtr(ptrId, varId); +} + +bool MemPass::HasOnlyNamesAndDecorates(uint32_t id) const { + return get_def_use_mgr()->WhileEachUser(id, [this](ir::Instruction* user) { + SpvOp op = user->opcode(); + if (op != SpvOpName && !IsNonTypeDecorate(op)) { + return false; + } + return true; + }); +} + +void MemPass::KillAllInsts(ir::BasicBlock* bp, bool killLabel) { + bp->KillAllInsts(killLabel); +} + +bool MemPass::HasLoads(uint32_t varId) const { + return !get_def_use_mgr()->WhileEachUser(varId, [this]( + ir::Instruction* user) { + SpvOp op = user->opcode(); + // TODO(): The following is slightly conservative. Could be + // better handling of non-store/name. + if (IsNonPtrAccessChain(op) || op == SpvOpCopyObject) { + if (HasLoads(user->result_id())) { + return false; + } + } else if (op != SpvOpStore && op != SpvOpName && !IsNonTypeDecorate(op)) { + return false; + } + return true; + }); +} + +bool MemPass::IsLiveVar(uint32_t varId) const { + const ir::Instruction* varInst = get_def_use_mgr()->GetDef(varId); + // assume live if not a variable eg. function parameter + if (varInst->opcode() != SpvOpVariable) return true; + // non-function scope vars are live + const uint32_t varTypeId = varInst->type_id(); + const ir::Instruction* varTypeInst = get_def_use_mgr()->GetDef(varTypeId); + if (varTypeInst->GetSingleWordInOperand(kTypePointerStorageClassInIdx) != + SpvStorageClassFunction) + return true; + // test if variable is loaded from + return HasLoads(varId); +} + +bool MemPass::IsLiveStore(ir::Instruction* storeInst) { + // get store's variable + uint32_t varId; + (void)GetPtr(storeInst, &varId); + if (varId == 0) { + // If we do not know which variable we are accessing, assume the store is + // live. + return true; + } + return IsLiveVar(varId); +} + +void MemPass::AddStores(uint32_t ptr_id, std::queue* insts) { + get_def_use_mgr()->ForEachUser(ptr_id, [this, insts](ir::Instruction* user) { + SpvOp op = user->opcode(); + if (IsNonPtrAccessChain(op)) { + AddStores(user->result_id(), insts); + } else if (op == SpvOpStore) { + insts->push(user); + } + }); +} + +void MemPass::DCEInst(ir::Instruction* inst, + const function& call_back) { + std::queue deadInsts; + deadInsts.push(inst); + while (!deadInsts.empty()) { + ir::Instruction* di = deadInsts.front(); + // Don't delete labels + if (di->opcode() == SpvOpLabel) { + deadInsts.pop(); + continue; + } + // Remember operands + std::set ids; + di->ForEachInId([&ids](uint32_t* iid) { ids.insert(*iid); }); + uint32_t varId = 0; + // Remember variable if dead load + if (di->opcode() == SpvOpLoad) (void)GetPtr(di, &varId); + if (call_back) { + call_back(di); + } + context()->KillInst(di); + // For all operands with no remaining uses, add their instruction + // to the dead instruction queue. + for (auto id : ids) + if (HasOnlyNamesAndDecorates(id)) { + ir::Instruction* odi = get_def_use_mgr()->GetDef(id); + if (context()->IsCombinatorInstruction(odi)) deadInsts.push(odi); + } + // if a load was deleted and it was the variable's + // last load, add all its stores to dead queue + if (varId != 0 && !IsLiveVar(varId)) AddStores(varId, &deadInsts); + deadInsts.pop(); + } +} + +MemPass::MemPass() {} + +bool MemPass::HasOnlySupportedRefs(uint32_t varId) { + if (supported_ref_vars_.find(varId) != supported_ref_vars_.end()) return true; + return get_def_use_mgr()->WhileEachUser(varId, [this](ir::Instruction* user) { + SpvOp op = user->opcode(); + if (op != SpvOpStore && op != SpvOpLoad && op != SpvOpName && + !IsNonTypeDecorate(op)) { + return false; + } + return true; + }); +} + +void MemPass::InitSSARewrite(ir::Function* func) { + // Clear collections. + visitedBlocks_.clear(); + block_defs_map_.clear(); + phis_to_patch_.clear(); + dominator_ = context()->GetDominatorAnalysis(func, *cfg()); + CollectTargetVars(func); +} + +bool MemPass::IsLiveAfter(uint32_t var_id, uint32_t label) const { + // For now, return very conservative result: true. This will result in + // correct, but possibly usused, phi code to be generated. A subsequent + // DCE pass should eliminate this code. + // TODO(greg-lunarg): Return more accurate information + (void)var_id; + (void)label; + return true; +} + +uint32_t MemPass::Type2Undef(uint32_t type_id) { + const auto uitr = type2undefs_.find(type_id); + if (uitr != type2undefs_.end()) return uitr->second; + const uint32_t undefId = TakeNextId(); + std::unique_ptr undef_inst( + new ir::Instruction(context(), SpvOpUndef, type_id, undefId, {})); + get_def_use_mgr()->AnalyzeInstDefUse(&*undef_inst); + get_module()->AddGlobalValue(std::move(undef_inst)); + type2undefs_[type_id] = undefId; + return undefId; +} + +void MemPass::CollectLiveVars(uint32_t block_label, + std::map* live_vars) { + // Walk up the dominator chain starting at |block_label| looking for variables + // defined at each block in the chain. Since we are only interested for the + // most recent value for each live variable, we only add a + // pair to |live_vars| if this is the first time we find the variable in the + // chain. + for (ir::BasicBlock* block = cfg()->block(block_label); block != nullptr; + block = dominator_->ImmediateDominator(block)) { + for (const auto& var_val : block_defs_map_[block->id()]) { + auto live_vars_it = live_vars->find(var_val.first); + if (live_vars_it == live_vars->end()) live_vars->insert(var_val); + } + } +} + +uint32_t MemPass::GetCurrentValue(uint32_t var_id, uint32_t block_label) { + // Walk up the dominator chain starting at |block_label| looking for the + // current value of variable |var_id|. The first block we find containing a + // definition for |var_id| is the one we are interested in. + for (ir::BasicBlock* block = cfg()->block(block_label); block != nullptr; + block = dominator_->ImmediateDominator(block)) { + const auto& block_defs = block_defs_map_[block->id()]; + const auto& var_val_it = block_defs.find(var_id); + if (var_val_it != block_defs.end()) return var_val_it->second; + } + return 0; +} + +bool MemPass::SSABlockInitLoopHeader( + std::list::iterator block_itr) { + bool modified = false; + const uint32_t label = (*block_itr)->id(); + + // Determine the back-edge label. + uint32_t backLabel = 0; + for (uint32_t predLabel : cfg()->preds(label)) + if (visitedBlocks_.find(predLabel) == visitedBlocks_.end()) { + assert(backLabel == 0); + backLabel = predLabel; + break; + } + assert(backLabel != 0); + + // Determine merge block. + auto mergeInst = (*block_itr)->end(); + --mergeInst; + --mergeInst; + uint32_t mergeLabel = + mergeInst->GetSingleWordInOperand(kLoopMergeMergeBlockIdInIdx); + + // Collect all live variables and a default value for each across all + // non-backedge predecesors. Must be ordered map because phis are + // generated based on order and test results will otherwise vary across + // platforms. + std::map liveVars; + for (uint32_t predLabel : cfg()->preds(label)) { + CollectLiveVars(predLabel, &liveVars); + } + + // Add all stored variables in loop. Set their default value id to zero. + for (auto bi = block_itr; (*bi)->id() != mergeLabel; ++bi) { + ir::BasicBlock* bp = *bi; + for (auto ii = bp->begin(); ii != bp->end(); ++ii) { + if (ii->opcode() != SpvOpStore) { + continue; + } + uint32_t varId; + (void)GetPtr(&*ii, &varId); + if (!IsTargetVar(varId)) { + continue; + } + liveVars[varId] = 0; + } + } + // Insert phi for all live variables that require them. All variables + // defined in loop require a phi. Otherwise all variables + // with differing predecessor values require a phi. + auto insertItr = (*block_itr)->begin(); + for (auto var_val : liveVars) { + const uint32_t varId = var_val.first; + if (!IsLiveAfter(varId, label)) { + continue; + } + const uint32_t val0Id = var_val.second; + bool needsPhi = false; + if (val0Id != 0) { + for (uint32_t predLabel : cfg()->preds(label)) { + // Skip back edge predecessor. + if (predLabel == backLabel) continue; + uint32_t current_value = GetCurrentValue(varId, predLabel); + // Missing (undef) values always cause difference with (defined) value + if (current_value == 0) { + needsPhi = true; + break; + } + if (current_value != val0Id) { + needsPhi = true; + break; + } + } + } else { + needsPhi = true; + } + + // If val is the same for all predecessors, enter it in map + if (!needsPhi) { + block_defs_map_[label].insert(var_val); + continue; + } + + // Val differs across predecessors. Add phi op to block and + // add its result id to the map. For back edge predecessor, + // use the variable id. We will patch this after visiting back + // edge predecessor. For predecessors that do not define a value, + // use undef. + modified = true; + std::vector phi_in_operands; + uint32_t typeId = GetPointeeTypeId(get_def_use_mgr()->GetDef(varId)); + for (uint32_t predLabel : cfg()->preds(label)) { + uint32_t valId; + if (predLabel == backLabel) { + valId = varId; + } else { + uint32_t current_value = GetCurrentValue(varId, predLabel); + if (current_value == 0) + valId = Type2Undef(typeId); + else + valId = current_value; + } + phi_in_operands.push_back( + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {valId}}); + phi_in_operands.push_back( + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {predLabel}}); + } + const uint32_t phiId = TakeNextId(); + std::unique_ptr newPhi(new ir::Instruction( + context(), SpvOpPhi, typeId, phiId, phi_in_operands)); + // The only phis requiring patching are the ones we create. + phis_to_patch_.insert(phiId); + // Only analyze the phi define now; analyze the phi uses after the + // phi backedge predecessor value is patched. + get_def_use_mgr()->AnalyzeInstDef(&*newPhi); + context()->set_instr_block(&*newPhi, *block_itr); + insertItr = insertItr.InsertBefore(std::move(newPhi)); + ++insertItr; + block_defs_map_[label].insert({varId, phiId}); + } + return modified; +} + +bool MemPass::SSABlockInitMultiPred(ir::BasicBlock* block_ptr) { + bool modified = false; + const uint32_t label = block_ptr->id(); + // Collect all live variables and a default value for each across all + // predecesors. Must be ordered map because phis are generated based on + // order and test results will otherwise vary across platforms. + std::map liveVars; + for (uint32_t predLabel : cfg()->preds(label)) { + assert(visitedBlocks_.find(predLabel) != visitedBlocks_.end()); + CollectLiveVars(predLabel, &liveVars); + } + + // For each live variable, look for a difference in values across + // predecessors that would require a phi and insert one. + auto insertItr = block_ptr->begin(); + for (auto var_val : liveVars) { + const uint32_t varId = var_val.first; + if (!IsLiveAfter(varId, label)) continue; + const uint32_t val0Id = var_val.second; + bool differs = false; + for (uint32_t predLabel : cfg()->preds(label)) { + uint32_t current_value = GetCurrentValue(varId, predLabel); + // Missing values cause a difference because we'll need to create an + // undef for that predecessor. + if (current_value == 0) { + differs = true; + break; + } + if (current_value != val0Id) { + differs = true; + break; + } + } + // If val is the same for all predecessors, enter it in map + if (!differs) { + block_defs_map_[label].insert(var_val); + continue; + } + + modified = true; + + // Val differs across predecessors. Add phi op to block and add its result + // id to the map. + std::vector phi_in_operands; + const uint32_t typeId = GetPointeeTypeId(get_def_use_mgr()->GetDef(varId)); + for (uint32_t predLabel : cfg()->preds(label)) { + uint32_t current_value = GetCurrentValue(varId, predLabel); + // If variable not defined on this path, use undef + const uint32_t valId = + (current_value > 0) ? current_value : Type2Undef(typeId); + phi_in_operands.push_back( + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {valId}}); + phi_in_operands.push_back( + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {predLabel}}); + } + const uint32_t phiId = TakeNextId(); + std::unique_ptr newPhi(new ir::Instruction( + context(), SpvOpPhi, typeId, phiId, phi_in_operands)); + get_def_use_mgr()->AnalyzeInstDefUse(&*newPhi); + context()->set_instr_block(&*newPhi, block_ptr); + insertItr = insertItr.InsertBefore(std::move(newPhi)); + ++insertItr; + block_defs_map_[label].insert({varId, phiId}); + } + return modified; +} + +bool MemPass::SSABlockInit(std::list::iterator block_itr) { + const size_t numPreds = cfg()->preds((*block_itr)->id()).size(); + if (numPreds == 0) return false; + if ((*block_itr)->IsLoopHeader()) + return SSABlockInitLoopHeader(block_itr); + else + return SSABlockInitMultiPred(*block_itr); +} + +bool MemPass::IsTargetVar(uint32_t varId) { + if (varId == 0) { + return false; + } + + if (seen_non_target_vars_.find(varId) != seen_non_target_vars_.end()) + return false; + if (seen_target_vars_.find(varId) != seen_target_vars_.end()) return true; + const ir::Instruction* varInst = get_def_use_mgr()->GetDef(varId); + if (varInst->opcode() != SpvOpVariable) return false; + const uint32_t varTypeId = varInst->type_id(); + const ir::Instruction* varTypeInst = get_def_use_mgr()->GetDef(varTypeId); + if (varTypeInst->GetSingleWordInOperand(kTypePointerStorageClassInIdx) != + SpvStorageClassFunction) { + seen_non_target_vars_.insert(varId); + return false; + } + const uint32_t varPteTypeId = + varTypeInst->GetSingleWordInOperand(kTypePointerTypeIdInIdx); + ir::Instruction* varPteTypeInst = get_def_use_mgr()->GetDef(varPteTypeId); + if (!IsTargetType(varPteTypeInst)) { + seen_non_target_vars_.insert(varId); + return false; + } + seen_target_vars_.insert(varId); + return true; +} + +void MemPass::PatchPhis(uint32_t header_id, uint32_t back_id) { + ir::BasicBlock* header = cfg()->block(header_id); + auto phiItr = header->begin(); + for (; phiItr->opcode() == SpvOpPhi; ++phiItr) { + // Only patch phis that we created in a loop header. + // There might be other phis unrelated to our optimizations. + if (0 == phis_to_patch_.count(phiItr->result_id())) continue; + + // Find phi operand index for back edge + uint32_t cnt = 0; + uint32_t idx = phiItr->NumInOperands(); + phiItr->ForEachInId([&cnt, &back_id, &idx](uint32_t* iid) { + if (cnt % 2 == 1 && *iid == back_id) idx = cnt - 1; + ++cnt; + }); + assert(idx != phiItr->NumInOperands()); + + // Replace temporary phi operand with variable's value in backedge block + // map. Use undef if variable not in map. + const uint32_t varId = phiItr->GetSingleWordInOperand(idx); + uint32_t current_value = GetCurrentValue(varId, back_id); + uint32_t valId = + (current_value > 0) + ? current_value + : Type2Undef(GetPointeeTypeId(get_def_use_mgr()->GetDef(varId))); + phiItr->SetInOperand(idx, {valId}); + // Analyze uses now that they are complete + get_def_use_mgr()->AnalyzeInstUse(&*phiItr); + } +} + +bool MemPass::InsertPhiInstructions(ir::Function* func) { + // TODO(dnovillo) the current Phi placement mechanism assumes structured + // control-flow. This should be generalized + // (https://github.com/KhronosGroup/SPIRV-Tools/issues/893). + assert(context()->get_feature_mgr()->HasCapability(SpvCapabilityShader) && + "This only works on structured control flow"); + + bool modified = false; + + // Initialize the data structures used to insert Phi instructions. + InitSSARewrite(func); + + // Process all blocks in structured order. This is just one way (the + // simplest?) to make sure all predecessors blocks are processed before + // a block itself. + std::list structuredOrder; + cfg()->ComputeStructuredOrder(func, cfg()->pseudo_entry_block(), + &structuredOrder); + for (auto bi = structuredOrder.begin(); bi != structuredOrder.end(); ++bi) { + // Skip pseudo entry block + if (cfg()->IsPseudoEntryBlock(*bi)) { + continue; + } + + // Process all stores and loads of targeted variables. + if (SSABlockInit(bi)) { + modified = true; + } + + ir::BasicBlock* bp = *bi; + const uint32_t label = bp->id(); + ir::Instruction* inst = &*bp->begin(); + while (inst) { + ir::Instruction* next_instruction = inst->NextNode(); + switch (inst->opcode()) { + case SpvOpStore: { + uint32_t varId; + (void)GetPtr(inst, &varId); + if (!IsTargetVar(varId)) break; + // Register new stored value for the variable + block_defs_map_[label][varId] = + inst->GetSingleWordInOperand(kStoreValIdInIdx); + } break; + case SpvOpVariable: { + // Treat initialized OpVariable like an OpStore + if (inst->NumInOperands() < 2) break; + uint32_t varId = inst->result_id(); + if (!IsTargetVar(varId)) break; + // Register new stored value for the variable + block_defs_map_[label][varId] = + inst->GetSingleWordInOperand(kVariableInitIdInIdx); + } break; + case SpvOpLoad: { + uint32_t varId; + (void)GetPtr(inst, &varId); + if (!IsTargetVar(varId)) break; + modified = true; + uint32_t replId = GetCurrentValue(varId, label); + // If the variable is not defined, use undef. + if (replId == 0) { + replId = + Type2Undef(GetPointeeTypeId(get_def_use_mgr()->GetDef(varId))); + } + + // Replace load's id with the last stored value id for variable + // and delete load. Kill any names or decorates using id before + // replacing to prevent incorrect replacement in those instructions. + const uint32_t loadId = inst->result_id(); + context()->KillNamesAndDecorates(loadId); + (void)context()->ReplaceAllUsesWith(loadId, replId); + context()->KillInst(inst); + } break; + default: + break; + } + inst = next_instruction; + } + visitedBlocks_.insert(label); + // Look for successor backedge and patch phis in loop header + // if found. + uint32_t header = 0; + const auto* const_bp = bp; + const_bp->ForEachSuccessorLabel([&header, this](uint32_t succ) { + if (visitedBlocks_.find(succ) == visitedBlocks_.end()) return; + assert(header == 0); + header = succ; + }); + if (header != 0) PatchPhis(header, label); + } + + return modified; +} + +// Remove all |phi| operands coming from unreachable blocks (i.e., blocks not in +// |reachable_blocks|). There are two types of removal that this function can +// perform: +// +// 1- Any operand that comes directly from an unreachable block is completely +// removed. Since the block is unreachable, the edge between the unreachable +// block and the block holding |phi| has been removed. +// +// 2- Any operand that comes via a live block and was defined at an unreachable +// block gets its value replaced with an OpUndef value. Since the argument +// was generated in an unreachable block, it no longer exists, so it cannot +// be referenced. However, since the value does not reach |phi| directly +// from the unreachable block, the operand cannot be removed from |phi|. +// Therefore, we replace the argument value with OpUndef. +// +// For example, in the switch() below, assume that we want to remove the +// argument with value %11 coming from block %41. +// +// [ ... ] +// %41 = OpLabel <--- Unreachable block +// %11 = OpLoad %int %y +// [ ... ] +// OpSelectionMerge %16 None +// OpSwitch %12 %16 10 %13 13 %14 18 %15 +// %13 = OpLabel +// OpBranch %16 +// %14 = OpLabel +// OpStore %outparm %int_14 +// OpBranch %16 +// %15 = OpLabel +// OpStore %outparm %int_15 +// OpBranch %16 +// %16 = OpLabel +// %30 = OpPhi %int %11 %41 %int_42 %13 %11 %14 %11 %15 +// +// Since %41 is now an unreachable block, the first operand of |phi| needs to +// be removed completely. But the operands (%11 %14) and (%11 %15) cannot be +// removed because %14 and %15 are reachable blocks. Since %11 no longer exist, +// in those arguments, we replace all references to %11 with an OpUndef value. +// This results in |phi| looking like: +// +// %50 = OpUndef %int +// [ ... ] +// %30 = OpPhi %int %int_42 %13 %50 %14 %50 %15 +void MemPass::RemovePhiOperands( + ir::Instruction* phi, + std::unordered_set reachable_blocks) { + std::vector keep_operands; + uint32_t type_id = 0; + // The id of an undefined value we've generated. + uint32_t undef_id = 0; + + // Traverse all the operands in |phi|. Build the new operand vector by adding + // all the original operands from |phi| except the unwanted ones. + for (uint32_t i = 0; i < phi->NumOperands();) { + if (i < 2) { + // The first two arguments are always preserved. + keep_operands.push_back(phi->GetOperand(i)); + ++i; + continue; + } + + // The remaining Phi arguments come in pairs. Index 'i' contains the + // variable id, index 'i + 1' is the originating block id. + assert(i % 2 == 0 && i < phi->NumOperands() - 1 && + "malformed Phi arguments"); + + ir::BasicBlock* in_block = cfg()->block(phi->GetSingleWordOperand(i + 1)); + if (reachable_blocks.find(in_block) == reachable_blocks.end()) { + // If the incoming block is unreachable, remove both operands as this + // means that the |phi| has lost an incoming edge. + i += 2; + continue; + } + + // In all other cases, the operand must be kept but may need to be changed. + uint32_t arg_id = phi->GetSingleWordOperand(i); + ir::Instruction* arg_def_instr = get_def_use_mgr()->GetDef(arg_id); + ir::BasicBlock* def_block = context()->get_instr_block(arg_def_instr); + if (def_block && + reachable_blocks.find(def_block) == reachable_blocks.end()) { + // If the current |phi| argument was defined in an unreachable block, it + // means that this |phi| argument is no longer defined. Replace it with + // |undef_id|. + if (!undef_id) { + type_id = arg_def_instr->type_id(); + undef_id = Type2Undef(type_id); + } + keep_operands.push_back( + ir::Operand(spv_operand_type_t::SPV_OPERAND_TYPE_ID, {undef_id})); + } else { + // Otherwise, the argument comes from a reachable block or from no block + // at all (meaning that it was defined in the global section of the + // program). In both cases, keep the argument intact. + keep_operands.push_back(phi->GetOperand(i)); + } + + keep_operands.push_back(phi->GetOperand(i + 1)); + + i += 2; + } + + context()->ForgetUses(phi); + phi->ReplaceOperands(keep_operands); + context()->AnalyzeUses(phi); +} + +void MemPass::RemoveBlock(ir::Function::iterator* bi) { + auto& rm_block = **bi; + + // Remove instructions from the block. + rm_block.ForEachInst([&rm_block, this](ir::Instruction* inst) { + // Note that we do not kill the block label instruction here. The label + // instruction is needed to identify the block, which is needed by the + // removal of phi operands. + if (inst != rm_block.GetLabelInst()) { + context()->KillInst(inst); + } + }); + + // Remove the label instruction last. + auto label = rm_block.GetLabelInst(); + context()->KillInst(label); + + *bi = bi->Erase(); +} + +bool MemPass::RemoveUnreachableBlocks(ir::Function* func) { + bool modified = false; + + // Mark reachable all blocks reachable from the function's entry block. + std::unordered_set reachable_blocks; + std::unordered_set visited_blocks; + std::queue worklist; + reachable_blocks.insert(func->entry().get()); + + // Initially mark the function entry point as reachable. + worklist.push(func->entry().get()); + + auto mark_reachable = [&reachable_blocks, &visited_blocks, &worklist, + this](uint32_t label_id) { + auto successor = cfg()->block(label_id); + if (visited_blocks.count(successor) == 0) { + reachable_blocks.insert(successor); + worklist.push(successor); + visited_blocks.insert(successor); + } + }; + + // Transitively mark all blocks reachable from the entry as reachable. + while (!worklist.empty()) { + ir::BasicBlock* block = worklist.front(); + worklist.pop(); + + // All the successors of a live block are also live. + static_cast(block)->ForEachSuccessorLabel( + mark_reachable); + + // All the Merge and ContinueTarget blocks of a live block are also live. + block->ForMergeAndContinueLabel(mark_reachable); + } + + // Update operands of Phi nodes that reference unreachable blocks. + for (auto& block : *func) { + // If the block is about to be removed, don't bother updating its + // Phi instructions. + if (reachable_blocks.count(&block) == 0) { + continue; + } + + // If the block is reachable and has Phi instructions, remove all + // operands from its Phi instructions that reference unreachable blocks. + // If the block has no Phi instructions, this is a no-op. + block.ForEachPhiInst([&reachable_blocks, this](ir::Instruction* phi) { + RemovePhiOperands(phi, reachable_blocks); + }); + } + + // Erase unreachable blocks. + for (auto ebi = func->begin(); ebi != func->end();) { + if (reachable_blocks.count(&*ebi) == 0) { + RemoveBlock(&ebi); + modified = true; + } else { + ++ebi; + } + } + + return modified; +} + +bool MemPass::CFGCleanup(ir::Function* func) { + bool modified = false; + modified |= RemoveUnreachableBlocks(func); + return modified; +} + +void MemPass::CollectTargetVars(ir::Function* func) { + seen_target_vars_.clear(); + seen_non_target_vars_.clear(); + supported_ref_vars_.clear(); + type2undefs_.clear(); + + // Collect target (and non-) variable sets. Remove variables with + // non-load/store refs from target variable set + for (auto& blk : *func) { + for (auto& inst : blk) { + switch (inst.opcode()) { + case SpvOpStore: + case SpvOpLoad: { + uint32_t varId; + (void)GetPtr(&inst, &varId); + if (!IsTargetVar(varId)) break; + if (HasOnlySupportedRefs(varId)) break; + seen_non_target_vars_.insert(varId); + seen_target_vars_.erase(varId); + } break; + default: + break; + } + } + } +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/mem_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/mem_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/mem_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/mem_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,250 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#ifndef LIBSPIRV_OPT_MEM_PASS_H_ +#define LIBSPIRV_OPT_MEM_PASS_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include "basic_block.h" +#include "def_use_manager.h" +#include "dominator_analysis.h" +#include "module.h" +#include "pass.h" + +namespace spvtools { +namespace opt { + +// A common base class for mem2reg-type passes. Provides common +// utility functions and supporting state. +class MemPass : public Pass { + public: + MemPass(); + virtual ~MemPass() = default; + + // Returns an undef value for the given |var_id|'s type. + uint32_t GetUndefVal(uint32_t var_id) { + return Type2Undef(GetPointeeTypeId(get_def_use_mgr()->GetDef(var_id))); + } + + // Given a load or store |ip|, return the pointer instruction. + // Also return the base variable's id in |varId|. If no base variable is + // found, |varId| will be 0. + ir::Instruction* GetPtr(ir::Instruction* ip, uint32_t* varId); + + // Return true if |varId| is a previously identified target variable. + // Return false if |varId| is a previously identified non-target variable. + // + // Non-target variables are variable of function scope of a target type that + // are accessed with constant-index access chains. not accessed with + // non-constant-index access chains. Also cache non-target variables. + // + // If variable is not cached, return true if variable is a function scope + // variable of target type, false otherwise. Updates caches of target and + // non-target variables. + bool IsTargetVar(uint32_t varId); + + // Collect target SSA variables. This traverses all the loads and stores in + // function |func| looking for variables that can be replaced with SSA IDs. It + // populates the sets |seen_target_vars_|, |seen_non_target_vars_| and + // |supported_ref_vars_|. + void CollectTargetVars(ir::Function* func); + + protected: + // Returns true if |typeInst| is a scalar type + // or a vector or matrix + bool IsBaseTargetType(const ir::Instruction* typeInst) const; + + // Returns true if |typeInst| is a math type or a struct or array + // of a math type. + // TODO(): Add more complex types to convert + bool IsTargetType(const ir::Instruction* typeInst) const; + + // Returns true if |opcode| is a non-ptr access chain op + bool IsNonPtrAccessChain(const SpvOp opcode) const; + + // Given the id |ptrId|, return true if the top-most non-CopyObj is + // a variable, a non-ptr access chain or a parameter of pointer type. + bool IsPtr(uint32_t ptrId); + + // Given the id of a pointer |ptrId|, return the top-most non-CopyObj. + // Also return the base variable's id in |varId|. If no base variable is + // found, |varId| will be 0. + ir::Instruction* GetPtr(uint32_t ptrId, uint32_t* varId); + + // Return true if all uses of |id| are only name or decorate ops. + bool HasOnlyNamesAndDecorates(uint32_t id) const; + + // Kill all instructions in block |bp|. Whether or not to kill the label is + // indicated by |killLabel|. + void KillAllInsts(ir::BasicBlock* bp, bool killLabel = true); + + // Return true if any instruction loads from |varId| + bool HasLoads(uint32_t varId) const; + + // Return true if |varId| is not a function variable or if it has + // a load + bool IsLiveVar(uint32_t varId) const; + + // Return true if |storeInst| is not a function variable or if its + // base variable has a load + bool IsLiveStore(ir::Instruction* storeInst); + + // Add stores using |ptr_id| to |insts| + void AddStores(uint32_t ptr_id, std::queue* insts); + + // Delete |inst| and iterate DCE on all its operands if they are now + // useless. If a load is deleted and its variable has no other loads, + // delete all its variable's stores. + void DCEInst(ir::Instruction* inst, + const std::function&); + + // Call all the cleanup helper functions on |func|. + bool CFGCleanup(ir::Function* func); + + // Return true if |op| is supported decorate. + inline bool IsNonTypeDecorate(uint32_t op) const { + return (op == SpvOpDecorate || op == SpvOpDecorateId); + } + + // Return undef in function for type. Create and insert an undef after the + // first non-variable in the function if it doesn't already exist. Add + // undef to function undef map. + uint32_t Type2Undef(uint32_t type_id); + + // Insert Phi instructions in the CFG of |func|. This removes extra + // load/store operations to local storage while preserving the SSA form of the + // code. Returns true if the code was modified. + bool InsertPhiInstructions(ir::Function* func); + + // Cache of verified target vars + std::unordered_set seen_target_vars_; + + // Cache of verified non-target vars + std::unordered_set seen_non_target_vars_; + + private: + // Return true if all uses of |varId| are only through supported reference + // operations ie. loads and store. Also cache in supported_ref_vars_. + // TODO(dnovillo): This function is replicated in other passes and it's + // slightly different in every pass. Is it possible to make one common + // implementation? + bool HasOnlySupportedRefs(uint32_t varId); + + // Patch phis in loop header block |header_id| now that the map is complete + // for the backedge predecessor |back_id|. Specifically, for each phi, find + // the value corresponding to the backedge predecessor. That was temporarily + // set with the variable id that this phi corresponds to. Change this phi + // operand to the the value which corresponds to that variable in the + // predecessor map. + void PatchPhis(uint32_t header_id, uint32_t back_id); + + // Initialize data structures used by EliminateLocalMultiStore for + // function |func|, specifically block predecessors and target variables. + void InitSSARewrite(ir::Function* func); + + // Initialize block_defs_map_ entry for loop header block pointed to + // |block_itr| by merging entries from all predecessors. If any value + // ids differ for any variable across predecessors, create a phi function + // in the block and use that value id for the variable in the new map. + // Assumes all predecessors have been visited by EliminateLocalMultiStore + // except the back edge. Use a dummy value in the phi for the back edge + // until the back edge block is visited and patch the phi value then. + // Returns true if the code was modified. + bool SSABlockInitLoopHeader(std::list::iterator block_itr); + + // Initialize block_defs_map_ entry for multiple predecessor block + // |block_ptr| by merging block_defs_map_ entries for all predecessors. + // If any value ids differ for any variable across predecessors, create + // a phi function in the block and use that value id for the variable in + // the new map. Assumes all predecessors have been visited by + // EliminateLocalMultiStore. + // Returns true if the code was modified. + bool SSABlockInitMultiPred(ir::BasicBlock* block_ptr); + + // Initialize the label2ssa_map entry for a block pointed to by |block_itr|. + // Insert phi instructions into block when necessary. All predecessor + // blocks must have been visited by EliminateLocalMultiStore except for + // backedges. + // Returns true if the code was modified. + bool SSABlockInit(std::list::iterator block_itr); + + // Return true if variable is loaded in block with |label| or in any + // succeeding block in structured order. + bool IsLiveAfter(uint32_t var_id, uint32_t label) const; + + // Remove all the unreachable basic blocks in |func|. + bool RemoveUnreachableBlocks(ir::Function* func); + + // Remove the block pointed by the iterator |*bi|. This also removes + // all the instructions in the pointed-to block. + void RemoveBlock(ir::Function::iterator* bi); + + // Remove Phi operands in |phi| that are coming from blocks not in + // |reachable_blocks|. + void RemovePhiOperands(ir::Instruction* phi, + std::unordered_set reachable_blocks); + + // Collects a map of all the live variables and their values along the path of + // dominator parents starting at |block_label|. Each entry + // |live_vars[var_id]| returns the latest value of |var_id| along that + // dominator path. Note that the mapping |live_vars| is never cleared, + // multiple calls to this function will accumulate new + // mappings. This is done to support the logic in + // MemPass::SSABlockInitLoopHeader. + void CollectLiveVars(uint32_t block_label, + std::map* live_vars); + + // Returns the ID of the most current value taken by variable |var_id| on the + // dominator path starting at |block_id|. This walks the dominator parents + // starting at |block_id| and returns the first value it finds for |var_id|. + // If no value for |var_id| is found along the dominator path, this returns 0. + uint32_t GetCurrentValue(uint32_t var_id, uint32_t block_label); + + // Dominator information. + DominatorAnalysis* dominator_; + + // Each entry |block_defs_map_[block_id]| contains a map {variable_id, + // value_id} associating all the variables |variable_id| stored in |block_id| + // to their respective value |value_id|. + std::unordered_map> + block_defs_map_; + + // Set of label ids of visited blocks + std::unordered_set visitedBlocks_; + + // Variables that are only referenced by supported operations for this + // pass ie. loads and stores. + std::unordered_set supported_ref_vars_; + + // Map from type to undef + std::unordered_map type2undefs_; + + // The Ids of OpPhi instructions that are in a loop header and which require + // patching of the value for the loop back-edge. + std::unordered_set phis_to_patch_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_MEM_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/merge_return_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/merge_return_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/merge_return_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/merge_return_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,661 @@ +// Copyright (c) 2017 Google 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. + +#include "merge_return_pass.h" + +#include "instruction.h" +#include "ir_builder.h" +#include "ir_context.h" +#include "make_unique.h" +#include "reflect.h" + +namespace spvtools { +namespace opt { + +Pass::Status MergeReturnPass::Process(ir::IRContext* irContext) { + InitializeProcessing(irContext); + + bool modified = false; + bool is_shader = + context()->get_feature_mgr()->HasCapability(SpvCapabilityShader); + for (auto& function : *get_module()) { + std::vector return_blocks = CollectReturnBlocks(&function); + if (return_blocks.size() <= 1) continue; + + function_ = &function; + return_flag_ = nullptr; + return_value_ = nullptr; + final_return_block_ = nullptr; + + modified = true; + if (is_shader) { + ProcessStructured(&function, return_blocks); + } else { + MergeReturnBlocks(&function, return_blocks); + } + } + + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +void MergeReturnPass::ProcessStructured( + ir::Function* function, const std::vector& return_blocks) { + std::list order; + cfg()->ComputeStructuredOrder(function, &*function->begin(), &order); + + // Create the new return block + CreateReturnBlock(); + + // Create the return + CreateReturn(final_return_block_); + + cfg()->RegisterBlock(final_return_block_); + + state_.clear(); + state_.emplace_back(nullptr, nullptr); + for (auto block : order) { + if (cfg()->IsPseudoEntryBlock(block) || cfg()->IsPseudoExitBlock(block)) { + continue; + } + + auto blockId = block->GetLabelInst()->result_id(); + if (blockId == CurrentState().CurrentMergeId()) { + // Pop the current state as we've hit the merge + state_.pop_back(); + } + + ProcessStructuredBlock(block); + + // Generate state for next block + if (ir::Instruction* mergeInst = block->GetMergeInst()) { + ir::Instruction* loopMergeInst = block->GetLoopMergeInst(); + if (!loopMergeInst) loopMergeInst = state_.back().LoopMergeInst(); + state_.emplace_back(loopMergeInst, mergeInst); + } + } + + // Predicate successors of the original return blocks as necessary. + PredicateBlocks(return_blocks); + + // We have not kept the dominator tree up-to-date. + // Invalidate it at this point to make sure it will be rebuilt. + context()->RemoveDominatorAnalysis(function); + AddNewPhiNodes(); +} + +void MergeReturnPass::CreateReturnBlock() { + // Create a label for the new return block + std::unique_ptr return_label( + new ir::Instruction(context(), SpvOpLabel, 0u, TakeNextId(), {})); + + // Create the new basic block + std::unique_ptr return_block( + new ir::BasicBlock(std::move(return_label))); + function_->AddBasicBlock(std::move(return_block)); + final_return_block_ = &*(--function_->end()); + context()->AnalyzeDefUse(final_return_block_->GetLabelInst()); + context()->set_instr_block(final_return_block_->GetLabelInst(), + final_return_block_); + final_return_block_->SetParent(function_); +} + +void MergeReturnPass::CreateReturn(ir::BasicBlock* block) { + AddReturnValue(); + + if (return_value_) { + // Load and return the final return value + uint32_t loadId = TakeNextId(); + block->AddInstruction(MakeUnique( + context(), SpvOpLoad, function_->type_id(), loadId, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {return_value_->result_id()}}})); + ir::Instruction* var_inst = block->terminator(); + context()->AnalyzeDefUse(var_inst); + context()->set_instr_block(var_inst, block); + + block->AddInstruction(MakeUnique( + context(), SpvOpReturnValue, 0, 0, + std::initializer_list{{SPV_OPERAND_TYPE_ID, {loadId}}})); + context()->AnalyzeDefUse(block->terminator()); + context()->set_instr_block(block->terminator(), block); + } else { + block->AddInstruction(MakeUnique(context(), SpvOpReturn)); + context()->AnalyzeDefUse(block->terminator()); + context()->set_instr_block(block->terminator(), block); + } +} + +void MergeReturnPass::ProcessStructuredBlock(ir::BasicBlock* block) { + SpvOp tail_opcode = block->tail()->opcode(); + if (tail_opcode == SpvOpReturn || tail_opcode == SpvOpReturnValue) { + if (!return_flag_) { + AddReturnFlag(); + } + } + + if (tail_opcode == SpvOpReturn || tail_opcode == SpvOpReturnValue || + tail_opcode == SpvOpUnreachable) { + if (CurrentState().InLoop()) { + // Can always break out of innermost loop + BranchToBlock(block, CurrentState().LoopMergeId()); + } else if (CurrentState().InStructuredFlow()) { + BranchToBlock(block, CurrentState().CurrentMergeId()); + } else { + BranchToBlock(block, final_return_block_->id()); + } + } +} + +void MergeReturnPass::BranchToBlock(ir::BasicBlock* block, uint32_t target) { + if (block->tail()->opcode() == SpvOpReturn || + block->tail()->opcode() == SpvOpReturnValue) { + RecordReturned(block); + RecordReturnValue(block); + } + + // Fix up existing phi nodes. + // + // A new edge is being added from |block| to |target|, so go through + // |target|'s phi nodes add an undef incoming value for |block|. + ir::BasicBlock* target_block = context()->get_instr_block(target); + target_block->ForEachPhiInst([this, block](ir::Instruction* inst) { + uint32_t undefId = Type2Undef(inst->type_id()); + inst->AddOperand({SPV_OPERAND_TYPE_ID, {undefId}}); + inst->AddOperand({SPV_OPERAND_TYPE_ID, {block->id()}}); + context()->UpdateDefUse(inst); + }); + + const auto& target_pred = cfg()->preds(target); + if (target_pred.size() == 1) { + MarkForNewPhiNodes(target_block, + context()->get_instr_block(target_pred[0])); + } + + ir::Instruction* return_inst = block->terminator(); + return_inst->SetOpcode(SpvOpBranch); + return_inst->ReplaceOperands({{SPV_OPERAND_TYPE_ID, {target}}}); + context()->get_def_use_mgr()->AnalyzeInstDefUse(return_inst); + cfg()->AddEdge(block->id(), target); +} + +void MergeReturnPass::CreatePhiNodesForInst(ir::BasicBlock* merge_block, + uint32_t predecessor, + ir::Instruction& inst) { + opt::DominatorAnalysis* dom_tree = + context()->GetDominatorAnalysis(merge_block->GetParent(), *cfg()); + ir::BasicBlock* inst_bb = context()->get_instr_block(&inst); + + if (inst.result_id() != 0) { + std::vector users_to_update; + context()->get_def_use_mgr()->ForEachUser( + &inst, + [&users_to_update, &dom_tree, inst_bb, this](ir::Instruction* user) { + if (!dom_tree->Dominates(inst_bb, context()->get_instr_block(user))) { + users_to_update.push_back(user); + } + }); + + if (users_to_update.empty()) { + return; + } + + // There is at least one values that needs to be replaced. + // First create the OpPhi instruction. + InstructionBuilder builder(context(), &*merge_block->begin(), + ir::IRContext::kAnalysisDefUse); + uint32_t undef_id = Type2Undef(inst.type_id()); + std::vector phi_operands; + + // Add the operands for the defining instructions. + phi_operands.push_back(inst.result_id()); + phi_operands.push_back(predecessor); + + // Add undef from all other blocks. + std::vector preds = cfg()->preds(merge_block->id()); + for (uint32_t pred_id : preds) { + if (pred_id != predecessor) { + phi_operands.push_back(undef_id); + phi_operands.push_back(pred_id); + } + } + + ir::Instruction* new_phi = builder.AddPhi(inst.type_id(), phi_operands); + uint32_t result_of_phi = new_phi->result_id(); + + // Update all of the users to use the result of the new OpPhi. + for (ir::Instruction* user : users_to_update) { + user->ForEachInId([&inst, result_of_phi](uint32_t* id) { + if (*id == inst.result_id()) { + *id = result_of_phi; + } + }); + context()->AnalyzeUses(user); + } + } +} + +void MergeReturnPass::PredicateBlocks( + const std::vector& return_blocks) { + // The CFG is being modified as the function proceeds so avoid caching + // successors. + std::vector stack; + auto add_successors = [this, &stack](ir::BasicBlock* block) { + const ir::BasicBlock* const_block = + const_cast(block); + const_block->ForEachSuccessorLabel([this, &stack](const uint32_t idx) { + stack.push_back(context()->get_instr_block(idx)); + }); + }; + + std::unordered_set seen; + std::unordered_set predicated; + for (auto b : return_blocks) { + seen.clear(); + add_successors(b); + + while (!stack.empty()) { + ir::BasicBlock* block = stack.back(); + assert(block); + stack.pop_back(); + + if (block == b) continue; + if (block == final_return_block_) continue; + if (!seen.insert(block).second) continue; + if (!predicated.insert(block).second) continue; + + // Skip structured subgraphs. + ir::BasicBlock* next = block; + while (next->GetMergeInst()) { + next = context()->get_instr_block(next->MergeBlockIdIfAny()); + } + add_successors(next); + PredicateBlock(block, next, &predicated); + } + } +} + +bool MergeReturnPass::RequiresPredication( + const ir::BasicBlock* block, const ir::BasicBlock* tail_block) const { + // This is intentionally conservative. + // TODO(alanbaker): re-visit this when more performance data is available. + if (block != tail_block) return true; + + bool requires_predicate = false; + block->ForEachInst([&requires_predicate](const ir::Instruction* inst) { + if (inst->opcode() != SpvOpPhi && inst->opcode() != SpvOpLabel && + !ir::IsTerminatorInst(inst->opcode())) { + requires_predicate = true; + } + }); + return requires_predicate; +} + +void MergeReturnPass::PredicateBlock( + ir::BasicBlock* block, ir::BasicBlock* tail_block, + std::unordered_set* predicated) { + if (!RequiresPredication(block, tail_block)) { + return; + } + + // Make sure the cfg is build here. If we don't then it becomes very hard to + // know which new blocks need to be updated. + context()->BuildInvalidAnalyses(ir::IRContext::kAnalysisCFG); + + // When predicating, be aware of whether this block is a header block, a merge + // block or both. + // + // If this block is a merge block, ensure the appropriate header stays + // up-to-date with any changes (i.e. points to the pre-header). + // + // If this block is a header block, predicate the entire structured subgraph. + // This can act recursively. + + // If |block| is a loop head, then the back edge must jump to the original + // code, not the new header. + if (block->GetLoopMergeInst()) { + cfg()->SplitLoopHeader(block); + } + + // Leave the phi instructions behind. + auto iter = block->begin(); + while (iter->opcode() == SpvOpPhi) { + ++iter; + } + + // Forget about the edges leaving block. They will be removed. + cfg()->RemoveSuccessorEdges(block); + + std::unique_ptr new_block( + block->SplitBasicBlock(context(), TakeNextId(), iter)); + ir::BasicBlock* old_body = + function_->InsertBasicBlockAfter(std::move(new_block), block); + predicated->insert(old_body); + + if (tail_block == block) { + tail_block = old_body; + } + + const ir::BasicBlock* const_old_body = + static_cast(old_body); + const_old_body->ForEachSuccessorLabel( + [old_body, block, this](const uint32_t label) { + ir::BasicBlock* target_bb = context()->get_instr_block(label); + if (MarkedSinglePred(target_bb) == block) { + MarkForNewPhiNodes(target_bb, old_body); + } + }); + + std::unique_ptr new_merge_block(new ir::BasicBlock( + MakeUnique(context(), SpvOpLabel, 0, TakeNextId(), + std::initializer_list{}))); + + ir::BasicBlock* new_merge = + function_->InsertBasicBlockAfter(std::move(new_merge_block), tail_block); + predicated->insert(new_merge); + new_merge->SetParent(function_); + + // Register the new labels. + get_def_use_mgr()->AnalyzeInstDef(old_body->GetLabelInst()); + context()->set_instr_block(old_body->GetLabelInst(), old_body); + get_def_use_mgr()->AnalyzeInstDef(new_merge->GetLabelInst()); + context()->set_instr_block(new_merge->GetLabelInst(), new_merge); + + // Move the tail branch into the new merge and fix the mapping. If a single + // block is being predicated then its branch was moved to the old body + // previously. + std::unique_ptr inst; + ir::Instruction* i = tail_block->terminator(); + cfg()->RemoveSuccessorEdges(tail_block); + get_def_use_mgr()->ClearInst(i); + inst.reset(std::move(i)); + inst->RemoveFromList(); + new_merge->end().InsertBefore(std::move(inst)); + get_def_use_mgr()->AnalyzeInstUse(new_merge->terminator()); + context()->set_instr_block(new_merge->terminator(), new_merge); + + // Add a branch to the new merge. If we jumped multiple blocks, the branch is + // added to tail_block, otherwise the branch belongs in old_body. + tail_block->AddInstruction(MakeUnique( + context(), SpvOpBranch, 0, 0, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {new_merge->id()}}})); + get_def_use_mgr()->AnalyzeInstUse(tail_block->terminator()); + context()->set_instr_block(tail_block->terminator(), tail_block); + + // Within the new header we need the following: + // 1. Load of the return status flag + // 2. Declare the merge block + // 3. Branch to new merge (true) or old body (false) + + // 1. Load of the return status flag + analysis::Bool bool_type; + uint32_t bool_id = context()->get_type_mgr()->GetId(&bool_type); + assert(bool_id != 0); + uint32_t load_id = TakeNextId(); + block->AddInstruction(MakeUnique( + context(), SpvOpLoad, bool_id, load_id, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {return_flag_->result_id()}}})); + get_def_use_mgr()->AnalyzeInstDefUse(block->terminator()); + context()->set_instr_block(block->terminator(), block); + + // 2. Declare the merge block + block->AddInstruction( + MakeUnique(context(), SpvOpSelectionMerge, 0, 0, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {new_merge->id()}}, + {SPV_OPERAND_TYPE_SELECTION_CONTROL, + {SpvSelectionControlMaskNone}}})); + get_def_use_mgr()->AnalyzeInstUse(block->terminator()); + context()->set_instr_block(block->terminator(), block); + + // 3. Branch to new merge (true) or old body (false) + block->AddInstruction(MakeUnique( + context(), SpvOpBranchConditional, 0, 0, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {load_id}}, + {SPV_OPERAND_TYPE_ID, {new_merge->id()}}, + {SPV_OPERAND_TYPE_ID, {old_body->id()}}})); + get_def_use_mgr()->AnalyzeInstUse(block->terminator()); + context()->set_instr_block(block->terminator(), block); + + assert(old_body->begin() != old_body->end()); + assert(block->begin() != block->end()); + assert(new_merge->begin() != new_merge->end()); + + // Update the cfg + cfg()->AddEdges(block); + cfg()->RegisterBlock(old_body); + if (old_body != tail_block) { + cfg()->AddEdges(tail_block); + } + cfg()->RegisterBlock(new_merge); + MarkForNewPhiNodes(new_merge, tail_block); +} + +void MergeReturnPass::RecordReturned(ir::BasicBlock* block) { + if (block->tail()->opcode() != SpvOpReturn && + block->tail()->opcode() != SpvOpReturnValue) + return; + + assert(return_flag_ && "Did not generate the return flag variable."); + + if (!constant_true_) { + analysis::Bool temp; + const analysis::Bool* bool_type = + context()->get_type_mgr()->GetRegisteredType(&temp)->AsBool(); + + analysis::ConstantManager* const_mgr = context()->get_constant_mgr(); + const analysis::Constant* true_const = + const_mgr->GetConstant(bool_type, {true}); + constant_true_ = const_mgr->GetDefiningInstruction(true_const); + context()->UpdateDefUse(constant_true_); + } + + std::unique_ptr return_store(new ir::Instruction( + context(), SpvOpStore, 0, 0, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {return_flag_->result_id()}}, + {SPV_OPERAND_TYPE_ID, {constant_true_->result_id()}}})); + + ir::Instruction* store_inst = + &*block->tail().InsertBefore(std::move(return_store)); + context()->set_instr_block(store_inst, block); + context()->AnalyzeDefUse(store_inst); +} + +void MergeReturnPass::RecordReturnValue(ir::BasicBlock* block) { + auto terminator = *block->tail(); + if (terminator.opcode() != SpvOpReturnValue) { + return; + } + + assert(return_value_ && + "Did not generate the variable to hold the return value."); + + std::unique_ptr value_store(new ir::Instruction( + context(), SpvOpStore, 0, 0, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {return_value_->result_id()}}, + {SPV_OPERAND_TYPE_ID, {terminator.GetSingleWordInOperand(0u)}}})); + + ir::Instruction* store_inst = + &*block->tail().InsertBefore(std::move(value_store)); + context()->set_instr_block(store_inst, block); + context()->AnalyzeDefUse(store_inst); +} + +void MergeReturnPass::AddReturnValue() { + if (return_value_) return; + + uint32_t return_type_id = function_->type_id(); + if (get_def_use_mgr()->GetDef(return_type_id)->opcode() == SpvOpTypeVoid) + return; + + uint32_t return_ptr_type = context()->get_type_mgr()->FindPointerToType( + return_type_id, SpvStorageClassFunction); + + uint32_t var_id = TakeNextId(); + std::unique_ptr returnValue(new ir::Instruction( + context(), SpvOpVariable, return_ptr_type, var_id, + std::initializer_list{ + {SPV_OPERAND_TYPE_STORAGE_CLASS, {SpvStorageClassFunction}}})); + + auto insert_iter = function_->begin()->begin(); + insert_iter.InsertBefore(std::move(returnValue)); + ir::BasicBlock* entry_block = &*function_->begin(); + return_value_ = &*entry_block->begin(); + context()->AnalyzeDefUse(return_value_); + context()->set_instr_block(return_value_, entry_block); +} + +void MergeReturnPass::AddReturnFlag() { + if (return_flag_) return; + + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + analysis::ConstantManager* const_mgr = context()->get_constant_mgr(); + + analysis::Bool temp; + uint32_t bool_id = type_mgr->GetTypeInstruction(&temp); + analysis::Bool* bool_type = type_mgr->GetType(bool_id)->AsBool(); + + const analysis::Constant* false_const = + const_mgr->GetConstant(bool_type, {false}); + uint32_t const_false_id = + const_mgr->GetDefiningInstruction(false_const)->result_id(); + + uint32_t bool_ptr_id = + type_mgr->FindPointerToType(bool_id, SpvStorageClassFunction); + + uint32_t var_id = TakeNextId(); + std::unique_ptr returnFlag(new ir::Instruction( + context(), SpvOpVariable, bool_ptr_id, var_id, + std::initializer_list{ + {SPV_OPERAND_TYPE_STORAGE_CLASS, {SpvStorageClassFunction}}, + {SPV_OPERAND_TYPE_ID, {const_false_id}}})); + + auto insert_iter = function_->begin()->begin(); + + insert_iter.InsertBefore(std::move(returnFlag)); + ir::BasicBlock* entry_block = &*function_->begin(); + return_flag_ = &*entry_block->begin(); + context()->AnalyzeDefUse(return_flag_); + context()->set_instr_block(return_flag_, entry_block); +} + +std::vector MergeReturnPass::CollectReturnBlocks( + ir::Function* function) { + std::vector return_blocks; + for (auto& block : *function) { + ir::Instruction& terminator = *block.tail(); + if (terminator.opcode() == SpvOpReturn || + terminator.opcode() == SpvOpReturnValue) { + return_blocks.push_back(&block); + } + } + return return_blocks; +} + +void MergeReturnPass::MergeReturnBlocks( + ir::Function* function, const std::vector& return_blocks) { + if (return_blocks.size() <= 1) { + // No work to do. + return; + } + + CreateReturnBlock(); + uint32_t return_id = final_return_block_->id(); + auto ret_block_iter = --function->end(); + // Create the PHI for the merged block (if necessary). + // Create new return. + std::vector phi_ops; + for (auto block : return_blocks) { + if (block->tail()->opcode() == SpvOpReturnValue) { + phi_ops.push_back( + {SPV_OPERAND_TYPE_ID, {block->tail()->GetSingleWordInOperand(0u)}}); + phi_ops.push_back({SPV_OPERAND_TYPE_ID, {block->id()}}); + } + } + + if (!phi_ops.empty()) { + // Need a PHI node to select the correct return value. + uint32_t phi_result_id = TakeNextId(); + uint32_t phi_type_id = function->type_id(); + std::unique_ptr phi_inst(new ir::Instruction( + context(), SpvOpPhi, phi_type_id, phi_result_id, phi_ops)); + ret_block_iter->AddInstruction(std::move(phi_inst)); + ir::BasicBlock::iterator phiIter = ret_block_iter->tail(); + + std::unique_ptr return_inst( + new ir::Instruction(context(), SpvOpReturnValue, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {phi_result_id}}})); + ret_block_iter->AddInstruction(std::move(return_inst)); + ir::BasicBlock::iterator ret = ret_block_iter->tail(); + + // Register the phi def and mark instructions for use updates. + get_def_use_mgr()->AnalyzeInstDefUse(&*phiIter); + get_def_use_mgr()->AnalyzeInstDef(&*ret); + } else { + std::unique_ptr return_inst( + new ir::Instruction(context(), SpvOpReturn)); + ret_block_iter->AddInstruction(std::move(return_inst)); + } + + // Replace returns with branches + for (auto block : return_blocks) { + context()->ForgetUses(block->terminator()); + block->tail()->SetOpcode(SpvOpBranch); + block->tail()->ReplaceOperands({{SPV_OPERAND_TYPE_ID, {return_id}}}); + get_def_use_mgr()->AnalyzeInstUse(block->terminator()); + get_def_use_mgr()->AnalyzeInstUse(block->GetLabelInst()); + } + + get_def_use_mgr()->AnalyzeInstDefUse(ret_block_iter->GetLabelInst()); +} + +void MergeReturnPass::AddNewPhiNodes() { + opt::DominatorAnalysis* dom_tree = + context()->GetDominatorAnalysis(function_, *cfg()); + std::list order; + cfg()->ComputeStructuredOrder(function_, &*function_->begin(), &order); + + for (ir::BasicBlock* bb : order) { + AddNewPhiNodes(bb, new_merge_nodes_[bb], + dom_tree->ImmediateDominator(bb)->id()); + } +} + +void MergeReturnPass::AddNewPhiNodes(ir::BasicBlock* bb, ir::BasicBlock* pred, + uint32_t header_id) { + opt::DominatorAnalysis* dom_tree = + context()->GetDominatorAnalysis(function_, *cfg()); + // Insert as a stopping point. We do not have to add anything in the block or + // above because the header dominates |bb|. + + ir::BasicBlock* current_bb = pred; + while (current_bb != nullptr && current_bb->id() != header_id) { + for (ir::Instruction& inst : *current_bb) { + CreatePhiNodesForInst(bb, pred->id(), inst); + } + current_bb = dom_tree->ImmediateDominator(current_bb); + } +} + +void MergeReturnPass::MarkForNewPhiNodes(ir::BasicBlock* block, + ir::BasicBlock* single_original_pred) { + new_merge_nodes_[block] = single_original_pred; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/merge_return_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/merge_return_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/merge_return_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/merge_return_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,307 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_MERGE_RETURN_PASS_H_ +#define LIBSPIRV_OPT_MERGE_RETURN_PASS_H_ + +#include "basic_block.h" +#include "function.h" +#include "mem_pass.h" + +#include +#include + +namespace spvtools { +namespace opt { + +/******************************************************************************* + * + * Handling Structured Control Flow: + * + * Structured control flow guarantees that the CFG will reconverge at a given + * point (the merge block). Within structured control flow, all blocks must be + * post-dominated by the merge block, except return blocks and break blocks. + * A break block is a block that branches to the innermost loop's merge block. + * + * Beyond this, we further assume that all unreachable blocks have been + * cleanedup. This means that the only unreachable blocks are those necessary + * for valid structured control flow. + * + * Algorithm: + * + * If a return is encountered, it should record that: i) the function has + * "returned" and ii) the value of the return. The return should be replaced + * with a branch. If current block is not within structured control flow, this + * is the final return. This block should branch to the new return block (its + * direct successor). If the current block is within structured control flow, + * the branch destination should be the innermost loop's merge (if it exists) + * or the merge block of the immediate structured control flow. If the merge + * block produces any live values it will need to be predicated. While the merge + * is nested in structured control flow, the predication path should branch to + * the next best merge block available. Once structured control flow has been + * exited, remaining blocks must be predicated with new structured control flow + * (OpSelectionMerge). These should be nested correctly in case of straight line + * branching to reach the final return block. + * + * In the final return block, the return value should be loaded and returned. + * Memory promotion passes should be able to promote the newly introduced + * variables ("has returned" and "return value"). + * + * Predicating the Final Merge: + * + * At each merge block predication needs to be introduced (optimization: only if + * that block produces value live beyond it). This needs to be done carefully. + * The merge block should be split into multiple blocks. + * + * 1 (header) + * / \ + * (ret) 2 3 (merge) + * + * || + * \/ + * + * 1 (header) + * / \ + * 2 | + * \ / + * 3 (merge for 1, new header) + * / \ + * | 3 (old body) + * \ / + * (ret) 4 (new merge) + * + * In the above (simple) example, the return originally in |2| is passed through + * the merge. That merge is predicated such that the old body of the block is + * the else branch. The branch condition is based on the value of the "has + * returned" variable. In more complicated examples (blocks between |1| and + * |3|), the SSA would need to fixed up due the newly reconvergent path at the + * merge for |1|. Assuming |3| originally was also a return block, the old body + * of |3| should also store the return value for that case. The return value in + * |4| just requires loading the return value variable. + * + ******************************************************************************/ + +// Documented in optimizer.hpp +class MergeReturnPass : public MemPass { + public: + MergeReturnPass() + : function_(nullptr), + return_flag_(nullptr), + return_value_(nullptr), + constant_true_(nullptr), + final_return_block_(nullptr) {} + + const char* name() const override { return "merge-return"; } + Status Process(ir::IRContext*) override; + + ir::IRContext::Analysis GetPreservedAnalyses() override { + // return ir::IRContext::kAnalysisDefUse; + return ir::IRContext::kAnalysisNone; + } + + private: + // This class is used to store the a loop merge instruction and a selection + // merge instruction. The intended use is that is represent the inner most + // contain selection construct and the inner most loop construct. + class StructuredControlState { + public: + StructuredControlState(ir::Instruction* loop, ir::Instruction* merge) + : loop_merge_(loop), current_merge_(merge) {} + + StructuredControlState(const StructuredControlState&) = default; + + bool InLoop() const { return loop_merge_; } + bool InStructuredFlow() const { return CurrentMergeId() != 0; } + + uint32_t CurrentMergeId() const { + return current_merge_ ? current_merge_->GetSingleWordInOperand(0u) : 0u; + } + + uint32_t CurrentMergeHeader() const { + return current_merge_ ? current_merge_->context() + ->get_instr_block(current_merge_) + ->id() + : 0; + } + + uint32_t LoopMergeId() const { + return loop_merge_ ? loop_merge_->GetSingleWordInOperand(0u) : 0u; + } + + uint32_t CurrentLoopHeader() const { + return loop_merge_ + ? loop_merge_->context()->get_instr_block(loop_merge_)->id() + : 0; + } + + ir::Instruction* LoopMergeInst() const { return loop_merge_; } + + private: + ir::Instruction* loop_merge_; + ir::Instruction* current_merge_; + }; + + // Returns all BasicBlocks terminated by OpReturn or OpReturnValue in + // |function|. + std::vector CollectReturnBlocks(ir::Function* function); + + // Creates a new basic block with a single return. If |function| returns a + // value, a phi node is created to select the correct value to return. + // Replaces old returns with an unconditional branch to the new block. + void MergeReturnBlocks(ir::Function* function, + const std::vector& returnBlocks); + + // Merges the return instruction in |function| so that it has a single return + // statement. It is assumed that |function| has structured control flow, and + // that |return_blocks| is a list of all of the basic blocks in |function| + // that have a return. + void ProcessStructured(ir::Function* function, + const std::vector& return_blocks); + + // Changes an OpReturn* or OpUnreachable instruction at the end of |block| + // into a store to |return_flag_|, a store to |return_value_| (if necessary), + // and a branch to the appropriate merge block. + // + // Is is assumed that |AddReturnValue| have already been called to created the + // variable to store a return value if there is one. + // + // Note this will break the semantics. To fix this, PredicateBlock will have + // to be called on the merge block the branch targets. + void ProcessStructuredBlock(ir::BasicBlock* block); + + // Creates a variable used to store whether or not the control flow has + // traversed a block that used to have a return. A pointer to the instruction + // declaring the variable is stored in |return_flag_|. + void AddReturnFlag(); + + // Creates the variable used to store the return value when passing through + // a block that use to contain an OpReturnValue. + void AddReturnValue(); + + // Adds a store that stores true to |return_flag_| immediately before the + // terminator of |block|. It is assumed that |AddReturnFlag| has already been + // called. + void RecordReturned(ir::BasicBlock* block); + + // Adds an instruction that stores the value being returned in the + // OpReturnValue in |block|. The value is stored to |return_value_|, and the + // store is placed before the OpReturnValue. + // + // If |block| does not contain an OpReturnValue, then this function has no + // effect. If |block| contains an OpReturnValue, then |AddReturnValue| must + // have already been called to create the variable to store to. + void RecordReturnValue(ir::BasicBlock* block); + + // Adds an unconditional branch in |block| that branches to |target|. It also + // adds stores to |return_flag_| and |return_value_| as needed. + // |AddReturnFlag| and |AddReturnValue| must have already been called. + void BranchToBlock(ir::BasicBlock* block, uint32_t target); + + // Returns true if we need to pridicate |block| where |tail_block| is the + // merge point. (See |PredicateBlocks|). There is no need to predicate if + // there is no code that could be executed. + bool RequiresPredication(const ir::BasicBlock* block, + const ir::BasicBlock* tail_block) const; + + // For every basic block that is reachable from a basic block in + // |return_blocks|, extra code is added to jump around any code that should + // not be executed because the original code would have already returned. This + // involves adding new selections constructs to jump around these + // instructions. + void PredicateBlocks(const std::vector& return_blocks); + + // Add the predication code (see |PredicateBlocks|) to |tail_block| if it + // requires predication. |tail_block| and any new blocks that are known to + // not require predication will be added to |predicated|. + void PredicateBlock(ir::BasicBlock* block, ir::BasicBlock* tail_block, + std::unordered_set* predicated); + + // Add an |OpReturn| or |OpReturnValue| to the end of |block|. If an + // |OpReturnValue| is needed, the return value is loaded from |return_value_|. + void CreateReturn(ir::BasicBlock* block); + + // Creates a block at the end of the function that will become the single + // return block at the end of the pass. + void CreateReturnBlock(); + + // Creates a Phi node in |merge_block| for the result of |inst| coming from + // |predecessor|. Any uses of the result of |inst| that are no longer + // dominated by |inst|, are replaced with the result of the new |OpPhi| + // instruction. + void CreatePhiNodesForInst(ir::BasicBlock* merge_block, uint32_t predecessor, + ir::Instruction& inst); + + // Traverse the nodes in |new_merge_nodes_|, and adds the OpPhi instructions + // that are needed to make the code correct. It is assumed that at this point + // there are no unreachable blocks in the control flow graph. + void AddNewPhiNodes(); + + // Creates any new phi nodes that are needed in |bb| now that |pred| is no + // longer the only block that preceedes |bb|. |header_id| is the id of the + // basic block for the loop or selection construct that merges at |bb|. + void AddNewPhiNodes(ir::BasicBlock* bb, ir::BasicBlock* pred, + uint32_t header_id); + + // Saves |block| to a list of basic block that will require OpPhi nodes to be + // added by calling |AddNewPhiNodes|. It is assumed that |block| used to have + // a single predecessor, |single_original_pred|, but now has more. + void MarkForNewPhiNodes(ir::BasicBlock* block, + ir::BasicBlock* single_original_pred); + + // Return the original single predcessor of |block| if it was flagged as + // having a single predecessor. |nullptr| is returned otherwise. + ir::BasicBlock* MarkedSinglePred(ir::BasicBlock* block) { + auto it = new_merge_nodes_.find(block); + if (it != new_merge_nodes_.end()) { + return it->second; + } else { + return nullptr; + } + } + + StructuredControlState& CurrentState() { return state_.back(); } + + // A stack used to keep track of the innermost contain loop and selection + // constructs. + std::vector state_; + + // The current function being transformed. + ir::Function* function_; + + // The |OpVariable| instruction defining a boolean variable used to keep track + // of whether or not the function is trying to return. + ir::Instruction* return_flag_; + + // The |OpVariable| instruction defining a variabled to used to keep track of + // the value that was returned when passing through a block that use to + // contain an |OpReturnValue|. + ir::Instruction* return_value_; + + // The instruction defining the boolean constant true. + ir::Instruction* constant_true_; + + // The basic block that is suppose to become the contain the only return value + // after processing the current function. + ir::BasicBlock* final_return_block_; + // This map contains the set of nodes that use to have a single predcessor, + // but now have more. They will need new OpPhi nodes. For each of the nodes, + // it is mapped to it original single predcessor. It is assumed there are no + // values that will need a phi on the new edges. + std::unordered_map new_merge_nodes_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_MERGE_RETURN_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/module.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/module.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/module.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/module.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,173 @@ +// Copyright (c) 2016 Google 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. + +#include "module.h" + +#include +#include +#include + +#include "operand.h" +#include "reflect.h" + +namespace spvtools { +namespace ir { + +std::vector Module::GetTypes() { + std::vector type_insts; + for (auto& inst : types_values_) { + if (IsTypeInst(inst.opcode())) type_insts.push_back(&inst); + } + return type_insts; +} + +std::vector Module::GetTypes() const { + std::vector type_insts; + for (auto& inst : types_values_) { + if (IsTypeInst(inst.opcode())) type_insts.push_back(&inst); + } + return type_insts; +} + +std::vector Module::GetConstants() { + std::vector const_insts; + for (auto& inst : types_values_) { + if (IsConstantInst(inst.opcode())) const_insts.push_back(&inst); + } + return const_insts; +} + +std::vector Module::GetConstants() const { + std::vector const_insts; + for (auto& inst : types_values_) { + if (IsConstantInst(inst.opcode())) const_insts.push_back(&inst); + } + return const_insts; +} + +uint32_t Module::GetGlobalValue(SpvOp opcode) const { + for (auto& inst : types_values_) { + if (inst.opcode() == opcode) return inst.result_id(); + } + return 0; +} + +void Module::AddGlobalValue(SpvOp opcode, uint32_t result_id, + uint32_t type_id) { + std::unique_ptr newGlobal( + new ir::Instruction(context(), opcode, type_id, result_id, {})); + AddGlobalValue(std::move(newGlobal)); +} + +void Module::ForEachInst(const std::function& f, + bool run_on_debug_line_insts) { +#define DELEGATE(list) list.ForEachInst(f, run_on_debug_line_insts) + DELEGATE(capabilities_); + DELEGATE(extensions_); + DELEGATE(ext_inst_imports_); + if (memory_model_) memory_model_->ForEachInst(f, run_on_debug_line_insts); + DELEGATE(entry_points_); + DELEGATE(execution_modes_); + DELEGATE(debugs1_); + DELEGATE(debugs2_); + DELEGATE(debugs3_); + DELEGATE(annotations_); + DELEGATE(types_values_); + for (auto& i : functions_) i->ForEachInst(f, run_on_debug_line_insts); +#undef DELEGATE +} + +void Module::ForEachInst(const std::function& f, + bool run_on_debug_line_insts) const { +#define DELEGATE(i) i.ForEachInst(f, run_on_debug_line_insts) + for (auto& i : capabilities_) DELEGATE(i); + for (auto& i : extensions_) DELEGATE(i); + for (auto& i : ext_inst_imports_) DELEGATE(i); + if (memory_model_) + static_cast(memory_model_.get()) + ->ForEachInst(f, run_on_debug_line_insts); + for (auto& i : entry_points_) DELEGATE(i); + for (auto& i : execution_modes_) DELEGATE(i); + for (auto& i : debugs1_) DELEGATE(i); + for (auto& i : debugs2_) DELEGATE(i); + for (auto& i : debugs3_) DELEGATE(i); + for (auto& i : annotations_) DELEGATE(i); + for (auto& i : types_values_) DELEGATE(i); + for (auto& i : functions_) { + static_cast(i.get())->ForEachInst(f, + run_on_debug_line_insts); + } +#undef DELEGATE +} + +void Module::ToBinary(std::vector* binary, bool skip_nop) const { + binary->push_back(header_.magic_number); + binary->push_back(header_.version); + // TODO(antiagainst): should we change the generator number? + binary->push_back(header_.generator); + binary->push_back(header_.bound); + binary->push_back(header_.reserved); + + auto write_inst = [binary, skip_nop](const Instruction* i) { + if (!(skip_nop && i->IsNop())) i->ToBinaryWithoutAttachedDebugInsts(binary); + }; + ForEachInst(write_inst, true); +} + +uint32_t Module::ComputeIdBound() const { + uint32_t highest = 0; + + ForEachInst( + [&highest](const Instruction* inst) { + for (const auto& operand : *inst) { + if (spvIsIdType(operand.type)) { + highest = std::max(highest, operand.words[0]); + } + } + }, + true /* scan debug line insts as well */); + + return highest + 1; +} + +bool Module::HasExplicitCapability(uint32_t cap) { + for (auto& ci : capabilities_) { + uint32_t tcap = ci.GetSingleWordOperand(0); + if (tcap == cap) { + return true; + } + } + return false; +} + +uint32_t Module::GetExtInstImportId(const char* extstr) { + for (auto& ei : ext_inst_imports_) + if (!strcmp(extstr, + reinterpret_cast(&(ei.GetInOperand(0).words[0])))) + return ei.result_id(); + return 0; +} + +std::ostream& operator<<(std::ostream& str, const Module& module) { + module.ForEachInst([&str](const ir::Instruction* inst) { + str << *inst; + if (inst->opcode() != SpvOpFunctionEnd) { + str << std::endl; + } + }); + return str; +} + +} // namespace ir +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/module.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/module.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/module.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/module.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,476 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_MODULE_H_ +#define LIBSPIRV_OPT_MODULE_H_ + +#include +#include +#include +#include + +#include "function.h" +#include "instruction.h" +#include "iterator.h" + +namespace spvtools { +namespace ir { + +class IRContext; + +// A struct for containing the module header information. +struct ModuleHeader { + uint32_t magic_number; + uint32_t version; + uint32_t generator; + uint32_t bound; + uint32_t reserved; +}; + +// A SPIR-V module. It contains all the information for a SPIR-V module and +// serves as the backbone of optimization transformations. +class Module { + public: + using iterator = UptrVectorIterator; + using const_iterator = UptrVectorIterator; + using inst_iterator = InstructionList::iterator; + using const_inst_iterator = InstructionList::const_iterator; + + // Creates an empty module with zero'd header. + Module() : header_({}) {} + + // Sets the header to the given |header|. + void SetHeader(const ModuleHeader& header) { header_ = header; } + + // Sets the Id bound. + void SetIdBound(uint32_t bound) { header_.bound = bound; } + + // Returns the Id bound. + uint32_t IdBound() { return header_.bound; } + + // Returns the current Id bound and increases it to the next available value. + uint32_t TakeNextIdBound() { return header_.bound++; } + + // Appends a capability instruction to this module. + inline void AddCapability(std::unique_ptr c); + + // Appends an extension instruction to this module. + inline void AddExtension(std::unique_ptr e); + + // Appends an extended instruction set instruction to this module. + inline void AddExtInstImport(std::unique_ptr e); + + // Set the memory model for this module. + inline void SetMemoryModel(std::unique_ptr m); + + // Appends an entry point instruction to this module. + inline void AddEntryPoint(std::unique_ptr e); + + // Appends an execution mode instruction to this module. + inline void AddExecutionMode(std::unique_ptr e); + + // Appends a debug 1 instruction (excluding OpLine & OpNoLine) to this module. + // "debug 1" instructions are the ones in layout section 7.a), see section + // 2.4 Logical Layout of a Module from the SPIR-V specification. + inline void AddDebug1Inst(std::unique_ptr d); + + // Appends a debug 2 instruction (excluding OpLine & OpNoLine) to this module. + // "debug 2" instructions are the ones in layout section 7.b), see section + // 2.4 Logical Layout of a Module from the SPIR-V specification. + inline void AddDebug2Inst(std::unique_ptr d); + + // Appends a debug 3 instruction (OpModuleProcessed) to this module. + // This is due to decision by the SPIR Working Group, pending publication. + inline void AddDebug3Inst(std::unique_ptr d); + + // Appends an annotation instruction to this module. + inline void AddAnnotationInst(std::unique_ptr a); + + // Appends a type-declaration instruction to this module. + inline void AddType(std::unique_ptr t); + + // Appends a constant, global variable, or OpUndef instruction to this module. + inline void AddGlobalValue(std::unique_ptr v); + + // Appends a function to this module. + inline void AddFunction(std::unique_ptr f); + + // Returns a vector of pointers to type-declaration instructions in this + // module. + std::vector GetTypes(); + std::vector GetTypes() const; + // Returns a vector of pointers to constant-creation instructions in this + // module. + std::vector GetConstants(); + std::vector GetConstants() const; + + // Return result id of global value with |opcode|, 0 if not present. + uint32_t GetGlobalValue(SpvOp opcode) const; + + // Add global value with |opcode|, |result_id| and |type_id| + void AddGlobalValue(SpvOp opcode, uint32_t result_id, uint32_t type_id); + + inline uint32_t id_bound() const { return header_.bound; } + + inline uint32_t version() const { return header_.version; } + + // Iterators for capabilities instructions contained in this module. + inline inst_iterator capability_begin(); + inline inst_iterator capability_end(); + inline IteratorRange capabilities(); + inline IteratorRange capabilities() const; + + // Iterators for ext_inst_imports instructions contained in this module. + inline inst_iterator ext_inst_import_begin(); + inline inst_iterator ext_inst_import_end(); + inline IteratorRange ext_inst_imports(); + inline IteratorRange ext_inst_imports() const; + + // Return the memory model instruction contained inthis module. + inline Instruction* GetMemoryModel() { return memory_model_.get(); } + inline const Instruction* GetMemoryModel() const { + return memory_model_.get(); + } + + // There are several kinds of debug instructions, according to where they can + // appear in the logical layout of a module: + // - Section 7a: OpString, OpSourceExtension, OpSource, OpSourceContinued + // - Section 7b: OpName, OpMemberName + // - Section 7c: OpModuleProcessed + // - Mostly anywhere: OpLine and OpNoLine + // + + // Iterators for debug 1 instructions (excluding OpLine & OpNoLine) contained + // in this module. These are for layout section 7a. + inline inst_iterator debug1_begin(); + inline inst_iterator debug1_end(); + inline IteratorRange debugs1(); + inline IteratorRange debugs1() const; + + // Iterators for debug 2 instructions (excluding OpLine & OpNoLine) contained + // in this module. These are for layout section 7b. + inline inst_iterator debug2_begin(); + inline inst_iterator debug2_end(); + inline IteratorRange debugs2(); + inline IteratorRange debugs2() const; + + // Iterators for debug 3 instructions (excluding OpLine & OpNoLine) contained + // in this module. These are for layout section 7c. + inline inst_iterator debug3_begin(); + inline inst_iterator debug3_end(); + inline IteratorRange debugs3(); + inline IteratorRange debugs3() const; + + // Iterators for entry point instructions contained in this module + inline IteratorRange entry_points(); + inline IteratorRange entry_points() const; + + // Iterators for execution_modes instructions contained in this module. + inline inst_iterator execution_mode_begin(); + inline inst_iterator execution_mode_end(); + inline IteratorRange execution_modes(); + inline IteratorRange execution_modes() const; + + // Clears all debug instructions (excluding OpLine & OpNoLine). + void debug_clear() { + debug1_clear(); + debug2_clear(); + debug3_clear(); + } + + // Clears all debug 1 instructions (excluding OpLine & OpNoLine). + void debug1_clear() { debugs1_.clear(); } + + // Clears all debug 2 instructions (excluding OpLine & OpNoLine). + void debug2_clear() { debugs2_.clear(); } + + // Clears all debug 3 instructions (excluding OpLine & OpNoLine). + void debug3_clear() { debugs3_.clear(); } + + // Iterators for annotation instructions contained in this module. + inline inst_iterator annotation_begin(); + inline inst_iterator annotation_end(); + IteratorRange annotations(); + IteratorRange annotations() const; + + // Iterators for extension instructions contained in this module. + inline inst_iterator extension_begin(); + inline inst_iterator extension_end(); + IteratorRange extensions(); + IteratorRange extensions() const; + + // Iterators for types, constants and global variables instructions. + inline inst_iterator types_values_begin(); + inline inst_iterator types_values_end(); + inline IteratorRange types_values(); + inline IteratorRange types_values() const; + + // Iterators for functions contained in this module. + iterator begin() { return iterator(&functions_, functions_.begin()); } + iterator end() { return iterator(&functions_, functions_.end()); } + const_iterator begin() const { return cbegin(); } + const_iterator end() const { return cend(); } + inline const_iterator cbegin() const; + inline const_iterator cend() const; + + // Invokes function |f| on all instructions in this module, and optionally on + // the debug line instructions that precede them. + void ForEachInst(const std::function& f, + bool run_on_debug_line_insts = false); + void ForEachInst(const std::function& f, + bool run_on_debug_line_insts = false) const; + + // Pushes the binary segments for this instruction into the back of *|binary|. + // If |skip_nop| is true and this is a OpNop, do nothing. + void ToBinary(std::vector* binary, bool skip_nop) const; + + // Returns 1 more than the maximum Id value mentioned in the module. + uint32_t ComputeIdBound() const; + + // Returns true if module has capability |cap| + bool HasExplicitCapability(uint32_t cap); + + // Returns id for OpExtInst instruction for extension |extstr|. + // Returns 0 if not found. + uint32_t GetExtInstImportId(const char* extstr); + + // Sets the associated context for this module + void SetContext(IRContext* c) { context_ = c; } + + // Gets the associated context for this module + IRContext* context() const { return context_; } + + private: + ModuleHeader header_; // Module header + + // The following fields respect the "Logical Layout of a Module" in + // Section 2.4 of the SPIR-V specification. + IRContext* context_; + InstructionList capabilities_; + InstructionList extensions_; + InstructionList ext_inst_imports_; + // A module only has one memory model instruction. + std::unique_ptr memory_model_; + InstructionList entry_points_; + InstructionList execution_modes_; + InstructionList debugs1_; + InstructionList debugs2_; + InstructionList debugs3_; + InstructionList annotations_; + // Type declarations, constants, and global variable declarations. + InstructionList types_values_; + std::vector> functions_; +}; + +// Pretty-prints |module| to |str|. Returns |str|. +std::ostream& operator<<(std::ostream& str, const Module& module); + +inline void Module::AddCapability(std::unique_ptr c) { + capabilities_.push_back(std::move(c)); +} + +inline void Module::AddExtension(std::unique_ptr e) { + extensions_.push_back(std::move(e)); +} + +inline void Module::AddExtInstImport(std::unique_ptr e) { + ext_inst_imports_.push_back(std::move(e)); +} + +inline void Module::SetMemoryModel(std::unique_ptr m) { + memory_model_ = std::move(m); +} + +inline void Module::AddEntryPoint(std::unique_ptr e) { + entry_points_.push_back(std::move(e)); +} + +inline void Module::AddExecutionMode(std::unique_ptr e) { + execution_modes_.push_back(std::move(e)); +} + +inline void Module::AddDebug1Inst(std::unique_ptr d) { + debugs1_.push_back(std::move(d)); +} + +inline void Module::AddDebug2Inst(std::unique_ptr d) { + debugs2_.push_back(std::move(d)); +} + +inline void Module::AddDebug3Inst(std::unique_ptr d) { + debugs3_.push_back(std::move(d)); +} + +inline void Module::AddAnnotationInst(std::unique_ptr a) { + annotations_.push_back(std::move(a)); +} + +inline void Module::AddType(std::unique_ptr t) { + types_values_.push_back(std::move(t)); +} + +inline void Module::AddGlobalValue(std::unique_ptr v) { + types_values_.push_back(std::move(v)); +} + +inline void Module::AddFunction(std::unique_ptr f) { + functions_.emplace_back(std::move(f)); +} + +inline Module::inst_iterator Module::capability_begin() { + return capabilities_.begin(); +} +inline Module::inst_iterator Module::capability_end() { + return capabilities_.end(); +} + +inline IteratorRange Module::capabilities() { + return make_range(capabilities_.begin(), capabilities_.end()); +} + +inline IteratorRange Module::capabilities() const { + return make_range(capabilities_.begin(), capabilities_.end()); +} + +inline Module::inst_iterator Module::ext_inst_import_begin() { + return ext_inst_imports_.begin(); +} +inline Module::inst_iterator Module::ext_inst_import_end() { + return ext_inst_imports_.end(); +} + +inline IteratorRange Module::ext_inst_imports() { + return make_range(ext_inst_imports_.begin(), ext_inst_imports_.end()); +} + +inline IteratorRange Module::ext_inst_imports() + const { + return make_range(ext_inst_imports_.begin(), ext_inst_imports_.end()); +} + +inline Module::inst_iterator Module::debug1_begin() { return debugs1_.begin(); } +inline Module::inst_iterator Module::debug1_end() { return debugs1_.end(); } + +inline IteratorRange Module::debugs1() { + return make_range(debugs1_.begin(), debugs1_.end()); +} + +inline IteratorRange Module::debugs1() const { + return make_range(debugs1_.begin(), debugs1_.end()); +} + +inline Module::inst_iterator Module::debug2_begin() { return debugs2_.begin(); } +inline Module::inst_iterator Module::debug2_end() { return debugs2_.end(); } + +inline IteratorRange Module::debugs2() { + return make_range(debugs2_.begin(), debugs2_.end()); +} + +inline IteratorRange Module::debugs2() const { + return make_range(debugs2_.begin(), debugs2_.end()); +} + +inline Module::inst_iterator Module::debug3_begin() { return debugs3_.begin(); } +inline Module::inst_iterator Module::debug3_end() { return debugs3_.end(); } + +inline IteratorRange Module::debugs3() { + return make_range(debugs3_.begin(), debugs3_.end()); +} + +inline IteratorRange Module::debugs3() const { + return make_range(debugs3_.begin(), debugs3_.end()); +} + +inline IteratorRange Module::entry_points() { + return make_range(entry_points_.begin(), entry_points_.end()); +} + +inline IteratorRange Module::entry_points() const { + return make_range(entry_points_.begin(), entry_points_.end()); +} + +inline Module::inst_iterator Module::execution_mode_begin() { + return execution_modes_.begin(); +} +inline Module::inst_iterator Module::execution_mode_end() { + return execution_modes_.end(); +} + +inline IteratorRange Module::execution_modes() { + return make_range(execution_modes_.begin(), execution_modes_.end()); +} + +inline IteratorRange Module::execution_modes() + const { + return make_range(execution_modes_.begin(), execution_modes_.end()); +} + +inline Module::inst_iterator Module::annotation_begin() { + return annotations_.begin(); +} +inline Module::inst_iterator Module::annotation_end() { + return annotations_.end(); +} + +inline IteratorRange Module::annotations() { + return make_range(annotations_.begin(), annotations_.end()); +} + +inline IteratorRange Module::annotations() const { + return make_range(annotations_.begin(), annotations_.end()); +} + +inline Module::inst_iterator Module::extension_begin() { + return extensions_.begin(); +} +inline Module::inst_iterator Module::extension_end() { + return extensions_.end(); +} + +inline IteratorRange Module::extensions() { + return make_range(extensions_.begin(), extensions_.end()); +} + +inline IteratorRange Module::extensions() const { + return make_range(extensions_.begin(), extensions_.end()); +} + +inline Module::inst_iterator Module::types_values_begin() { + return types_values_.begin(); +} + +inline Module::inst_iterator Module::types_values_end() { + return types_values_.end(); +} + +inline IteratorRange Module::types_values() { + return make_range(types_values_.begin(), types_values_.end()); +} + +inline IteratorRange Module::types_values() const { + return make_range(types_values_.begin(), types_values_.end()); +} + +inline Module::const_iterator Module::cbegin() const { + return const_iterator(&functions_, functions_.cbegin()); +} + +inline Module::const_iterator Module::cend() const { + return const_iterator(&functions_, functions_.cend()); +} + +} // namespace ir +} // namespace spvtools + +#endif // LIBSPIRV_OPT_MODULE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/null_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/null_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/null_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/null_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,36 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_NULL_PASS_H_ +#define LIBSPIRV_OPT_NULL_PASS_H_ + +#include "module.h" +#include "pass.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class NullPass : public Pass { + public: + const char* name() const override { return "null"; } + Status Process(ir::IRContext*) override { + return Status::SuccessWithoutChange; + } +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_NULL_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/optimizer.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/optimizer.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/optimizer.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/optimizer.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,448 @@ +// Copyright (c) 2016 Google 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. + +#include "spirv-tools/optimizer.hpp" + +#include "build_module.h" +#include "make_unique.h" +#include "pass_manager.h" +#include "passes.h" +#include "simplification_pass.h" + +namespace spvtools { + +struct Optimizer::PassToken::Impl { + Impl(std::unique_ptr p) : pass(std::move(p)) {} + + std::unique_ptr pass; // Internal implementation pass. +}; + +Optimizer::PassToken::PassToken( + std::unique_ptr impl) + : impl_(std::move(impl)) {} +Optimizer::PassToken::PassToken(PassToken&& that) + : impl_(std::move(that.impl_)) {} + +Optimizer::PassToken& Optimizer::PassToken::operator=(PassToken&& that) { + impl_ = std::move(that.impl_); + return *this; +} + +Optimizer::PassToken::~PassToken() {} + +struct Optimizer::Impl { + explicit Impl(spv_target_env env) : target_env(env), pass_manager() {} + + const spv_target_env target_env; // Target environment. + opt::PassManager pass_manager; // Internal implementation pass manager. +}; + +Optimizer::Optimizer(spv_target_env env) : impl_(new Impl(env)) {} + +Optimizer::~Optimizer() {} + +void Optimizer::SetMessageConsumer(MessageConsumer c) { + // All passes' message consumer needs to be updated. + for (uint32_t i = 0; i < impl_->pass_manager.NumPasses(); ++i) { + impl_->pass_manager.GetPass(i)->SetMessageConsumer(c); + } + impl_->pass_manager.SetMessageConsumer(std::move(c)); +} + +Optimizer& Optimizer::RegisterPass(PassToken&& p) { + // Change to use the pass manager's consumer. + p.impl_->pass->SetMessageConsumer(impl_->pass_manager.consumer()); + impl_->pass_manager.AddPass(std::move(p.impl_->pass)); + return *this; +} + +// The legalization passes take a spir-v shader generated by an HLSL front-end +// and turn it into a valid vulkan spir-v shader. There are two ways in which +// the code will be invalid at the start: +// +// 1) There will be opaque objects, like images, which will be passed around +// in intermediate objects. Valid spir-v will have to replace the use of +// the opaque object with an intermediate object that is the result of the +// load of the global opaque object. +// +// 2) There will be variables that contain pointers to structured or uniform +// buffers. It be legal, the variables must be eliminated, and the +// references to the structured buffers must use the result of OpVariable +// in the Uniform storage class. +// +// Optimization in this list must accept shaders with these relaxation of the +// rules. There is not guarantee that this list of optimizations is able to +// legalize all inputs, but it is on a best effort basis. +// +// The legalization problem is essentially a very general copy propagation +// problem. The optimization we use are all used to either do copy propagation +// or enable more copy propagation. +Optimizer& Optimizer::RegisterLegalizationPasses() { + return + // Remove unreachable block so that merge return works. + RegisterPass(CreateDeadBranchElimPass()) + // Merge the returns so we can inline. + .RegisterPass(CreateMergeReturnPass()) + // Make sure uses and definitions are in the same function. + .RegisterPass(CreateInlineExhaustivePass()) + // Make private variable function scope + .RegisterPass(CreateEliminateDeadFunctionsPass()) + .RegisterPass(CreatePrivateToLocalPass()) + // Propagate the value stored to the loads in very simple cases. + .RegisterPass(CreateLocalSingleBlockLoadStoreElimPass()) + .RegisterPass(CreateLocalSingleStoreElimPass()) + .RegisterPass(CreateAggressiveDCEPass()) + // Split up aggragates so they are easier to deal with. + .RegisterPass(CreateScalarReplacementPass()) + // Remove loads and stores so everything is in intermediate values. + // Takes care of copy propagation of non-members. + .RegisterPass(CreateLocalSingleBlockLoadStoreElimPass()) + .RegisterPass(CreateLocalSingleStoreElimPass()) + .RegisterPass(CreateAggressiveDCEPass()) + .RegisterPass(CreateLocalMultiStoreElimPass()) + .RegisterPass(CreateAggressiveDCEPass()) + // Propagate constants to get as many constant conditions on branches + // as possible. + .RegisterPass(CreateCCPPass()) + .RegisterPass(CreateDeadBranchElimPass()) + // Copy propagate members. Cleans up code sequences generated by + // scalar replacement. Also important for removing OpPhi nodes. + .RegisterPass(CreateSimplificationPass()) + .RegisterPass(CreateInsertExtractElimPass()) + .RegisterPass(CreateAggressiveDCEPass()) + .RegisterPass(CreateCopyPropagateArraysPass()) + // May need loop unrolling here see + // https://github.com/Microsoft/DirectXShaderCompiler/pull/930 + // Get rid of unused code that contain traces of illegal code + // or unused references to unbound external objects + .RegisterPass(CreateDeadInsertElimPass()) + .RegisterPass(CreateAggressiveDCEPass()); +} + +Optimizer& Optimizer::RegisterPerformancePasses() { + return RegisterPass(CreateRemoveDuplicatesPass()) + .RegisterPass(CreateMergeReturnPass()) + .RegisterPass(CreateInlineExhaustivePass()) + .RegisterPass(CreateAggressiveDCEPass()) + .RegisterPass(CreateLocalSingleBlockLoadStoreElimPass()) + .RegisterPass(CreateLocalSingleStoreElimPass()) + .RegisterPass(CreateAggressiveDCEPass()) + .RegisterPass(CreateScalarReplacementPass()) + .RegisterPass(CreateLocalAccessChainConvertPass()) + .RegisterPass(CreateLocalSingleBlockLoadStoreElimPass()) + .RegisterPass(CreateLocalSingleStoreElimPass()) + .RegisterPass(CreateAggressiveDCEPass()) + .RegisterPass(CreateLocalMultiStoreElimPass()) + .RegisterPass(CreateAggressiveDCEPass()) + .RegisterPass(CreateCCPPass()) + .RegisterPass(CreateAggressiveDCEPass()) + .RegisterPass(CreateRedundancyEliminationPass()) + .RegisterPass(CreateInsertExtractElimPass()) + .RegisterPass(CreateDeadInsertElimPass()) + .RegisterPass(CreateDeadBranchElimPass()) + .RegisterPass(CreateSimplificationPass()) + .RegisterPass(CreateIfConversionPass()) + .RegisterPass(CreateCopyPropagateArraysPass()) + .RegisterPass(CreateAggressiveDCEPass()) + .RegisterPass(CreateBlockMergePass()) + .RegisterPass(CreateRedundancyEliminationPass()) + .RegisterPass(CreateDeadBranchElimPass()) + .RegisterPass(CreateBlockMergePass()) + .RegisterPass(CreateInsertExtractElimPass()); + // Currently exposing driver bugs resulting in crashes (#946) + // .RegisterPass(CreateCommonUniformElimPass()) +} + +Optimizer& Optimizer::RegisterSizePasses() { + return RegisterPass(CreateRemoveDuplicatesPass()) + .RegisterPass(CreateMergeReturnPass()) + .RegisterPass(CreateInlineExhaustivePass()) + .RegisterPass(CreateAggressiveDCEPass()) + .RegisterPass(CreateScalarReplacementPass()) + .RegisterPass(CreateLocalAccessChainConvertPass()) + .RegisterPass(CreateLocalSingleBlockLoadStoreElimPass()) + .RegisterPass(CreateLocalSingleStoreElimPass()) + .RegisterPass(CreateAggressiveDCEPass()) + .RegisterPass(CreateInsertExtractElimPass()) + .RegisterPass(CreateDeadInsertElimPass()) + .RegisterPass(CreateLocalMultiStoreElimPass()) + .RegisterPass(CreateAggressiveDCEPass()) + .RegisterPass(CreateCCPPass()) + .RegisterPass(CreateAggressiveDCEPass()) + .RegisterPass(CreateDeadBranchElimPass()) + .RegisterPass(CreateIfConversionPass()) + .RegisterPass(CreateAggressiveDCEPass()) + .RegisterPass(CreateBlockMergePass()) + .RegisterPass(CreateInsertExtractElimPass()) + .RegisterPass(CreateDeadInsertElimPass()) + .RegisterPass(CreateRedundancyEliminationPass()) + .RegisterPass(CreateCFGCleanupPass()) + // Currently exposing driver bugs resulting in crashes (#946) + // .RegisterPass(CreateCommonUniformElimPass()) + .RegisterPass(CreateAggressiveDCEPass()); +} + +bool Optimizer::Run(const uint32_t* original_binary, + const size_t original_binary_size, + std::vector* optimized_binary) const { + std::unique_ptr context = + BuildModule(impl_->target_env, impl_->pass_manager.consumer(), + original_binary, original_binary_size); + if (context == nullptr) return false; + + auto status = impl_->pass_manager.Run(context.get()); + if (status == opt::Pass::Status::SuccessWithChange || + (status == opt::Pass::Status::SuccessWithoutChange && + (optimized_binary->data() != original_binary || + optimized_binary->size() != original_binary_size))) { + optimized_binary->clear(); + context->module()->ToBinary(optimized_binary, /* skip_nop = */ true); + } + + return status != opt::Pass::Status::Failure; +} + +Optimizer& Optimizer::SetPrintAll(std::ostream* out) { + impl_->pass_manager.SetPrintAll(out); + return *this; +} + +Optimizer& Optimizer::SetTimeReport(std::ostream* out) { + impl_->pass_manager.SetTimeReport(out); + return *this; +} + +Optimizer::PassToken CreateNullPass() { + return MakeUnique(MakeUnique()); +} + +Optimizer::PassToken CreateStripDebugInfoPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateStripReflectInfoPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateEliminateDeadFunctionsPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateSetSpecConstantDefaultValuePass( + const std::unordered_map& id_value_map) { + return MakeUnique( + MakeUnique(id_value_map)); +} + +Optimizer::PassToken CreateSetSpecConstantDefaultValuePass( + const std::unordered_map>& id_value_map) { + return MakeUnique( + MakeUnique(id_value_map)); +} + +Optimizer::PassToken CreateFlattenDecorationPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateFreezeSpecConstantValuePass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateFoldSpecConstantOpAndCompositePass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateUnifyConstantPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateEliminateDeadConstantPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateDeadVariableEliminationPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateStrengthReductionPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateBlockMergePass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateInlineExhaustivePass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateInlineOpaquePass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateLocalAccessChainConvertPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateLocalSingleBlockLoadStoreElimPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateLocalSingleStoreElimPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateInsertExtractElimPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateDeadInsertElimPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateDeadBranchElimPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateLocalMultiStoreElimPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateAggressiveDCEPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateCommonUniformElimPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateCompactIdsPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateMergeReturnPass() { + return MakeUnique( + MakeUnique()); +} + +std::vector Optimizer::GetPassNames() const { + std::vector v; + for (uint32_t i = 0; i < impl_->pass_manager.NumPasses(); i++) { + v.push_back(impl_->pass_manager.GetPass(i)->name()); + } + return v; +} + +Optimizer::PassToken CreateCFGCleanupPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateLocalRedundancyEliminationPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateLoopInvariantCodeMotionPass() { + return MakeUnique(MakeUnique()); +} + +Optimizer::PassToken CreateLoopUnswitchPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateRedundancyEliminationPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateRemoveDuplicatesPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateScalarReplacementPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreatePrivateToLocalPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateCCPPass() { + return MakeUnique(MakeUnique()); +} + +Optimizer::PassToken CreateWorkaround1209Pass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateIfConversionPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateReplaceInvalidOpcodePass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateSimplificationPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateLoopUnrollPass(bool fully_unroll, int factor) { + return MakeUnique( + MakeUnique(fully_unroll, factor)); +} + +Optimizer::PassToken CreateSSARewritePass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateCopyPropagateArraysPass() { + return MakeUnique( + MakeUnique()); +} + +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,121 @@ +// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "pass.h" + +#include "iterator.h" + +namespace spvtools { +namespace opt { + +namespace { + +const uint32_t kEntryPointFunctionIdInIdx = 1; +const uint32_t kTypePointerTypeIdInIdx = 1; + +} // namespace + +Pass::Pass() : consumer_(nullptr), context_(nullptr) {} + +void Pass::AddCalls(ir::Function* func, std::queue* todo) { + for (auto bi = func->begin(); bi != func->end(); ++bi) + for (auto ii = bi->begin(); ii != bi->end(); ++ii) + if (ii->opcode() == SpvOpFunctionCall) + todo->push(ii->GetSingleWordInOperand(0)); +} + +bool Pass::ProcessEntryPointCallTree(ProcessFunction& pfn, ir::Module* module) { + // Map from function's result id to function + std::unordered_map id2function; + for (auto& fn : *module) id2function[fn.result_id()] = &fn; + + // Collect all of the entry points as the roots. + std::queue roots; + for (auto& e : module->entry_points()) + roots.push(e.GetSingleWordInOperand(kEntryPointFunctionIdInIdx)); + return ProcessCallTreeFromRoots(pfn, id2function, &roots); +} + +bool Pass::ProcessReachableCallTree(ProcessFunction& pfn, + ir::IRContext* irContext) { + // Map from function's result id to function + std::unordered_map id2function; + for (auto& fn : *irContext->module()) id2function[fn.result_id()] = &fn; + + std::queue roots; + + // Add all entry points since they can be reached from outside the module. + for (auto& e : irContext->module()->entry_points()) + roots.push(e.GetSingleWordInOperand(kEntryPointFunctionIdInIdx)); + + // Add all exported functions since they can be reached from outside the + // module. + for (auto& a : irContext->annotations()) { + // TODO: Handle group decorations as well. Currently not generate by any + // front-end, but could be coming. + if (a.opcode() == SpvOp::SpvOpDecorate) { + if (a.GetSingleWordOperand(1) == + SpvDecoration::SpvDecorationLinkageAttributes) { + uint32_t lastOperand = a.NumOperands() - 1; + if (a.GetSingleWordOperand(lastOperand) == + SpvLinkageType::SpvLinkageTypeExport) { + uint32_t id = a.GetSingleWordOperand(0); + if (id2function.count(id) != 0) roots.push(id); + } + } + } + } + + return ProcessCallTreeFromRoots(pfn, id2function, &roots); +} + +bool Pass::ProcessCallTreeFromRoots( + ProcessFunction& pfn, + const std::unordered_map& id2function, + std::queue* roots) { + // Process call tree + bool modified = false; + std::unordered_set done; + + while (!roots->empty()) { + const uint32_t fi = roots->front(); + roots->pop(); + if (done.insert(fi).second) { + ir::Function* fn = id2function.at(fi); + modified = pfn(fn) || modified; + AddCalls(fn, roots); + } + } + return modified; +} + +Pass::Status Pass::Run(ir::IRContext* ctx) { + Pass::Status status = Process(ctx); + if (status == Status::SuccessWithChange) { + ctx->InvalidateAnalysesExceptFor(GetPreservedAnalyses()); + } + assert(ctx->IsConsistent()); + return status; +} + +uint32_t Pass::GetPointeeTypeId(const ir::Instruction* ptrInst) const { + const uint32_t ptrTypeId = ptrInst->type_id(); + const ir::Instruction* ptrTypeInst = get_def_use_mgr()->GetDef(ptrTypeId); + return ptrTypeInst->GetSingleWordInOperand(kTypePointerTypeIdInIdx); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/passes.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/passes.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/passes.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/passes.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_PASSES_H_ +#define LIBSPIRV_OPT_PASSES_H_ + +// A single header to include all passes. + +#include "aggressive_dead_code_elim_pass.h" +#include "block_merge_pass.h" +#include "ccp_pass.h" +#include "cfg_cleanup_pass.h" +#include "common_uniform_elim_pass.h" +#include "compact_ids_pass.h" +#include "copy_prop_arrays.h" +#include "dead_branch_elim_pass.h" +#include "dead_insert_elim_pass.h" +#include "dead_variable_elimination.h" +#include "eliminate_dead_constant_pass.h" +#include "eliminate_dead_functions_pass.h" +#include "flatten_decoration_pass.h" +#include "fold_spec_constant_op_and_composite_pass.h" +#include "freeze_spec_constant_value_pass.h" +#include "if_conversion.h" +#include "inline_exhaustive_pass.h" +#include "inline_opaque_pass.h" +#include "insert_extract_elim.h" +#include "licm_pass.h" +#include "local_access_chain_convert_pass.h" +#include "local_redundancy_elimination.h" +#include "local_single_block_elim_pass.h" +#include "local_single_store_elim_pass.h" +#include "local_ssa_elim_pass.h" +#include "loop_unroller.h" +#include "loop_unswitch_pass.h" +#include "merge_return_pass.h" +#include "null_pass.h" +#include "private_to_local_pass.h" +#include "redundancy_elimination.h" +#include "remove_duplicates_pass.h" +#include "replace_invalid_opc.h" +#include "scalar_replacement_pass.h" +#include "set_spec_constant_default_value_pass.h" +#include "ssa_rewrite_pass.h" +#include "strength_reduction_pass.h" +#include "strip_debug_info_pass.h" +#include "strip_reflect_info_pass.h" +#include "unify_const_pass.h" +#include "workaround1209.h" +#endif // LIBSPIRV_OPT_PASSES_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,159 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_PASS_H_ +#define LIBSPIRV_OPT_PASS_H_ + +#include +#include +#include +#include +#include +#include + +#include "basic_block.h" +#include "def_use_manager.h" +#include "ir_context.h" +#include "module.h" +#include "spirv-tools/libspirv.hpp" + +namespace spvtools { +namespace opt { + +// Abstract class of a pass. All passes should implement this abstract class +// and all analysis and transformation is done via the Process() method. +class Pass { + public: + // The status of processing a module using a pass. + // + // The numbers for the cases are assigned to make sure that Failure & anything + // is Failure, SuccessWithChange & any success is SuccessWithChange. + enum class Status { + Failure = 0x00, + SuccessWithChange = 0x10, + SuccessWithoutChange = 0x11, + }; + + using ProcessFunction = std::function; + + // Constructs a new pass. + // + // The constructed instance will have an empty message consumer, which just + // ignores all messages from the library. Use SetMessageConsumer() to supply + // one if messages are of concern. + Pass(); + + // Destructs the pass. + virtual ~Pass() = default; + + // Returns a descriptive name for this pass. + // + // NOTE: When deriving a new pass class, make sure you make the name + // compatible with the corresponding spirv-opt command-line flag. For example, + // if you add the flag --my-pass to spirv-opt, make this function return + // "my-pass" (no leading hyphens). + virtual const char* name() const = 0; + + // Sets the message consumer to the given |consumer|. |consumer| which will be + // invoked every time there is a message to be communicated to the outside. + void SetMessageConsumer(MessageConsumer c) { consumer_ = std::move(c); } + + // Returns the reference to the message consumer for this pass. + const MessageConsumer& consumer() const { return consumer_; } + + // Returns the def-use manager used for this pass. TODO(dnovillo): This should + // be handled by the pass manager. + analysis::DefUseManager* get_def_use_mgr() const { + return context()->get_def_use_mgr(); + } + + analysis::DecorationManager* get_decoration_mgr() const { + return context()->get_decoration_mgr(); + } + + FeatureManager* get_feature_mgr() const { + return context()->get_feature_mgr(); + } + + // Returns a pointer to the current module for this pass. + ir::Module* get_module() const { return context_->module(); } + + // Returns a pointer to the current context for this pass. + ir::IRContext* context() const { return context_; } + + // Returns a pointer to the CFG for current module. + ir::CFG* cfg() const { return context()->cfg(); } + + // Add to |todo| all ids of functions called in |func|. + void AddCalls(ir::Function* func, std::queue* todo); + + // Applies |pfn| to every function in the call trees that are rooted at the + // entry points. Returns true if any call |pfn| returns true. By convention + // |pfn| should return true if it modified the module. + bool ProcessEntryPointCallTree(ProcessFunction& pfn, ir::Module* module); + + // Applies |pfn| to every function in the call trees rooted at the entry + // points and exported functions. Returns true if any call |pfn| returns + // true. By convention |pfn| should return true if it modified the module. + bool ProcessReachableCallTree(ProcessFunction& pfn, ir::IRContext* irContext); + + // Applies |pfn| to every function in the call trees rooted at the elements of + // |roots|. Returns true if any call to |pfn| returns true. By convention + // |pfn| should return true if it modified the module. After returning + // |roots| will be empty. + bool ProcessCallTreeFromRoots( + ProcessFunction& pfn, + const std::unordered_map& id2function, + std::queue* roots); + + // Run the pass on the given |module|. Returns Status::Failure if errors occur + // when + // processing. Returns the corresponding Status::Success if processing is + // successful to indicate whether changes are made to the module. If there + // were any changes it will also invalidate the analyses in the IRContext + // that are not preserved. + virtual Status Run(ir::IRContext* ctx) final; + + // Returns the set of analyses that the pass is guaranteed to preserve. + virtual ir::IRContext::Analysis GetPreservedAnalyses() { + return ir::IRContext::kAnalysisNone; + } + + // Return type id for |ptrInst|'s pointee + uint32_t GetPointeeTypeId(const ir::Instruction* ptrInst) const; + + protected: + // Initialize basic data structures for the pass. This sets up the def-use + // manager, module and other attributes. + virtual void InitializeProcessing(ir::IRContext* c) { context_ = c; } + + // Processes the given |module|. Returns Status::Failure if errors occur when + // processing. Returns the corresponding Status::Success if processing is + // succesful to indicate whether changes are made to the module. + virtual Status Process(ir::IRContext* context) = 0; + + // Return the next available SSA id and increment it. + uint32_t TakeNextId() { return context_->TakeNextId(); } + + private: + MessageConsumer consumer_; // Message consumer. + + // The context that this pass belongs to. + ir::IRContext* context_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/pass_manager.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/pass_manager.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/pass_manager.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/pass_manager.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016 Google 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. + +#include "pass_manager.h" + +#include +#include + +#include "ir_context.h" +#include "spirv-tools/libspirv.hpp" +#include "util/timer.h" + +namespace spvtools { + +namespace opt { + +Pass::Status PassManager::Run(ir::IRContext* context) { + auto status = Pass::Status::SuccessWithoutChange; + + // If print_all_stream_ is not null, prints the disassembly of the module + // to that stream, with the given preamble and optionally the pass name. + auto print_disassembly = [&context, this](const char* preamble, Pass* pass) { + if (print_all_stream_) { + std::vector binary; + context->module()->ToBinary(&binary, false); + SpirvTools t(SPV_ENV_UNIVERSAL_1_2); + std::string disassembly; + t.Disassemble(binary, &disassembly, 0); + *print_all_stream_ << preamble << (pass ? pass->name() : "") << "\n" + << disassembly << std::endl; + } + }; + + SPIRV_TIMER_DESCRIPTION(time_report_stream_, /* measure_mem_usage = */ true); + for (const auto& pass : passes_) { + print_disassembly("; IR before pass ", pass.get()); + SPIRV_TIMER_SCOPED(time_report_stream_, (pass ? pass->name() : ""), true); + const auto one_status = pass->Run(context); + if (one_status == Pass::Status::Failure) return one_status; + if (one_status == Pass::Status::SuccessWithChange) status = one_status; + } + print_disassembly("; IR after last pass", nullptr); + + // Set the Id bound in the header in case a pass forgot to do so. + // + // TODO(dnovillo): This should be unnecessary and automatically maintained by + // the IRContext. + if (status == Pass::Status::SuccessWithChange) { + context->module()->SetIdBound(context->module()->ComputeIdBound()); + } + passes_.clear(); + return status; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/pass_manager.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/pass_manager.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/pass_manager.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/pass_manager.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,130 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_PASS_MANAGER_H_ +#define LIBSPIRV_OPT_PASS_MANAGER_H_ + +#include +#include +#include + +#include "log.h" +#include "module.h" +#include "pass.h" + +#include "ir_context.h" +#include "spirv-tools/libspirv.hpp" + +namespace spvtools { +namespace opt { + +// The pass manager, responsible for tracking and running passes. +// Clients should first call AddPass() to add passes and then call Run() +// to run on a module. Passes are executed in the exact order of addition. +class PassManager { + public: + // Constructs a pass manager. + // + // The constructed instance will have an empty message consumer, which just + // ignores all messages from the library. Use SetMessageConsumer() to supply + // one if messages are of concern. + PassManager() + : consumer_(nullptr), + print_all_stream_(nullptr), + time_report_stream_(nullptr) {} + + // Sets the message consumer to the given |consumer|. + void SetMessageConsumer(MessageConsumer c) { consumer_ = std::move(c); } + + // Adds an externally constructed pass. + void AddPass(std::unique_ptr pass); + // Uses the argument |args| to construct a pass instance of type |T|, and adds + // the pass instance to this pass manger. The pass added will use this pass + // manager's message consumer. + template + void AddPass(Args&&... args); + + // Returns the number of passes added. + uint32_t NumPasses() const; + // Returns a pointer to the |index|th pass added. + inline Pass* GetPass(uint32_t index) const; + + // Returns the message consumer. + inline const MessageConsumer& consumer() const; + + // Runs all passes on the given |module|. Returns Status::Failure if errors + // occur when processing using one of the registered passes. All passes + // registered after the error-reporting pass will be skipped. Returns the + // corresponding Status::Success if processing is succesful to indicate + // whether changes are made to the module. + // + // After running all the passes, they are removed from the list. + Pass::Status Run(ir::IRContext* context); + + // Sets the option to print the disassembly before each pass and after the + // last pass. Output is written to |out| if that is not null. No output + // is generated if |out| is null. + PassManager& SetPrintAll(std::ostream* out) { + print_all_stream_ = out; + return *this; + } + + // Sets the option to print the resource utilization of each pass. Output is + // written to |out| if that is not null. No output is generated if |out| is + // null. + PassManager& SetTimeReport(std::ostream* out) { + time_report_stream_ = out; + return *this; + } + + private: + // Consumer for messages. + MessageConsumer consumer_; + // A vector of passes. Order matters. + std::vector> passes_; + // The output stream to write disassembly to before each pass, and after + // the last pass. If this is null, no output is generated. + std::ostream* print_all_stream_; + // The output stream to write the resource utilization of each pass. If this + // is null, no output is generated. + std::ostream* time_report_stream_; +}; + +inline void PassManager::AddPass(std::unique_ptr pass) { + passes_.push_back(std::move(pass)); +} + +template +inline void PassManager::AddPass(Args&&... args) { + passes_.emplace_back(new T(std::forward(args)...)); + passes_.back()->SetMessageConsumer(consumer_); +} + +inline uint32_t PassManager::NumPasses() const { + return static_cast(passes_.size()); +} + +inline Pass* PassManager::GetPass(uint32_t index) const { + SPIRV_ASSERT(consumer_, index < passes_.size(), "index out of bound"); + return passes_[index].get(); +} + +inline const MessageConsumer& PassManager::consumer() const { + return consumer_; +} + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_PASS_MANAGER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/private_to_local_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/private_to_local_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/private_to_local_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/private_to_local_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,181 @@ +// Copyright (c) 2017 Google 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. + +#include "private_to_local_pass.h" + +#include "ir_context.h" + +namespace { +const uint32_t kVariableStorageClassInIdx = 0; +const uint32_t kSpvTypePointerTypeIdInIdx = 1; +} // namespace + +namespace spvtools { +namespace opt { + +Pass::Status PrivateToLocalPass::Process(ir::IRContext* c) { + InitializeProcessing(c); + bool modified = false; + + // Private variables require the shader capability. If this is not a shader, + // there is no work to do. + if (context()->get_feature_mgr()->HasCapability(SpvCapabilityAddresses)) + return Status::SuccessWithoutChange; + + std::vector> variables_to_move; + for (auto& inst : context()->types_values()) { + if (inst.opcode() != SpvOpVariable) { + continue; + } + + if (inst.GetSingleWordInOperand(kVariableStorageClassInIdx) != + SpvStorageClassPrivate) { + continue; + } + + ir::Function* target_function = FindLocalFunction(inst); + if (target_function != nullptr) { + variables_to_move.push_back({&inst, target_function}); + } + } + + modified = !variables_to_move.empty(); + for (auto p : variables_to_move) { + MoveVariable(p.first, p.second); + } + + return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange); +} + +ir::Function* PrivateToLocalPass::FindLocalFunction( + const ir::Instruction& inst) const { + bool found_first_use = false; + ir::Function* target_function = nullptr; + context()->get_def_use_mgr()->ForEachUser( + inst.result_id(), + [&target_function, &found_first_use, this](ir::Instruction* use) { + ir::BasicBlock* current_block = context()->get_instr_block(use); + if (current_block == nullptr) { + return; + } + + if (!IsValidUse(use)) { + found_first_use = true; + target_function = nullptr; + return; + } + ir::Function* current_function = current_block->GetParent(); + if (!found_first_use) { + found_first_use = true; + target_function = current_function; + } else if (target_function != current_function) { + target_function = nullptr; + } + }); + return target_function; +} // namespace opt + +void PrivateToLocalPass::MoveVariable(ir::Instruction* variable, + ir::Function* function) { + // The variable needs to be removed from the global section, and placed in the + // header of the function. First step remove from the global list. + variable->RemoveFromList(); + std::unique_ptr var(variable); // Take ownership. + context()->ForgetUses(variable); + + // Update the storage class of the variable. + variable->SetInOperand(kVariableStorageClassInIdx, {SpvStorageClassFunction}); + + // Update the type as well. + uint32_t new_type_id = GetNewType(variable->type_id()); + variable->SetResultType(new_type_id); + + // Place the variable at the start of the first basic block. + context()->AnalyzeUses(variable); + function->begin()->begin()->InsertBefore(move(var)); + + // Update uses where the type may have changed. + UpdateUses(variable->result_id()); +} + +uint32_t PrivateToLocalPass::GetNewType(uint32_t old_type_id) { + auto type_mgr = context()->get_type_mgr(); + ir::Instruction* old_type_inst = get_def_use_mgr()->GetDef(old_type_id); + uint32_t pointee_type_id = + old_type_inst->GetSingleWordInOperand(kSpvTypePointerTypeIdInIdx); + uint32_t new_type_id = + type_mgr->FindPointerToType(pointee_type_id, SpvStorageClassFunction); + return new_type_id; +} + +bool PrivateToLocalPass::IsValidUse(const ir::Instruction* inst) const { + // The cases in this switch have to match the cases in |UpdateUse|. + // If we don't know how to update it, it is not valid. + switch (inst->opcode()) { + case SpvOpLoad: + case SpvOpStore: + case SpvOpImageTexelPointer: // Treat like a load + return true; + case SpvOpAccessChain: + return context()->get_def_use_mgr()->WhileEachUser( + inst, [this](const ir::Instruction* user) { + if (!IsValidUse(user)) return false; + return true; + }); + case SpvOpName: + return true; + default: + return spvOpcodeIsDecoration(inst->opcode()); + } +} + +void PrivateToLocalPass::UpdateUse(ir::Instruction* inst) { + // The cases in this switch have to match the cases in |IsValidUse|. If we + // don't think it is valid, the optimization will not view the variable as a + // candidate, and therefore the use will not be updated. + switch (inst->opcode()) { + case SpvOpLoad: + case SpvOpStore: + case SpvOpImageTexelPointer: // Treat like a load + // The type is fine because it is the type pointed to, and that does not + // change. + break; + case SpvOpAccessChain: + context()->ForgetUses(inst); + inst->SetResultType(GetNewType(inst->type_id())); + context()->AnalyzeUses(inst); + + // Update uses where the type may have changed. + UpdateUses(inst->result_id()); + break; + case SpvOpName: + break; + default: + assert(spvOpcodeIsDecoration(inst->opcode()) && + "Do not know how to update the type for this instruction."); + break; + } +} +void PrivateToLocalPass::UpdateUses(uint32_t id) { + std::vector uses; + this->context()->get_def_use_mgr()->ForEachUser( + id, [&uses](ir::Instruction* use) { uses.push_back(use); }); + + for (ir::Instruction* use : uses) { + UpdateUse(use); + } +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/private_to_local_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/private_to_local_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/private_to_local_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/private_to_local_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_PRIVATE_TO_LOCAL_PASS_H_ +#define LIBSPIRV_OPT_PRIVATE_TO_LOCAL_PASS_H_ + +#include "ir_context.h" +#include "pass.h" + +namespace spvtools { +namespace opt { + +// This pass implements total redundancy elimination. This is the same as +// local redundancy elimination except it looks across basic block boundaries. +// An instruction, inst, is totally redundant if there is another instruction +// that dominates inst, and also computes the same value. +class PrivateToLocalPass : public Pass { + public: + const char* name() const override { return "private-to-local"; } + Status Process(ir::IRContext*) override; + ir::IRContext::Analysis GetPreservedAnalyses() override { + return ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisDecorations | + ir::IRContext::kAnalysisCombinators | ir::IRContext::kAnalysisCFG | + ir::IRContext::kAnalysisDominatorAnalysis | + ir::IRContext::kAnalysisNameMap; + } + + private: + // Moves |variable| from the private storage class to the function storage + // class of |function|. + void MoveVariable(ir::Instruction* variable, ir::Function* function); + + // |inst| is an instruction declaring a varible. If that variable is + // referenced in a single function and all of uses are valid as defined by + // |IsValidUse|, then that function is returned. Otherwise, the return + // value is |nullptr|. + ir::Function* FindLocalFunction(const ir::Instruction& inst) const; + + // Returns true is |inst| is a valid use of a pointer. In this case, a + // valid use is one where the transformation is able to rewrite the type to + // match a change in storage class of the original variable. + bool IsValidUse(const ir::Instruction* inst) const; + + // Given the result id of a pointer type, |old_type_id|, this function + // returns the id of a the same pointer type except the storage class has + // been changed to function. If the type does not already exist, it will be + // created. + uint32_t GetNewType(uint32_t old_type_id); + + // Updates |inst|, and any instruction dependent on |inst|, to reflect the + // change of the base pointer now pointing to the function storage class. + void UpdateUse(ir::Instruction* inst); + void UpdateUses(uint32_t id); +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_PRIVATE_TO_LOCAL_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/propagator.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/propagator.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/propagator.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/propagator.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,291 @@ +// Copyright (c) 2017 Google 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. + +#include "propagator.h" + +namespace spvtools { +namespace opt { + +void SSAPropagator::AddControlEdge(const Edge& edge) { + ir::BasicBlock* dest_bb = edge.dest; + + // Refuse to add the exit block to the work list. + if (dest_bb == ctx_->cfg()->pseudo_exit_block()) { + return; + } + + // Try to mark the edge executable. If it was already in the set of + // executable edges, do nothing. + if (!MarkEdgeExecutable(edge)) { + return; + } + + // If the edge had not already been marked executable, add the destination + // basic block to the work list. + blocks_.push(dest_bb); +} + +void SSAPropagator::AddSSAEdges(ir::Instruction* instr) { + // Ignore instructions that produce no result. + if (instr->result_id() == 0) { + return; + } + + get_def_use_mgr()->ForEachUser( + instr->result_id(), [this](ir::Instruction* use_instr) { + // If the basic block for |use_instr| has not been simulated yet, do + // nothing. The instruction |use_instr| will be simulated next time the + // block is scheduled. + if (!BlockHasBeenSimulated(ctx_->get_instr_block(use_instr))) { + return; + } + + if (ShouldSimulateAgain(use_instr)) { + ssa_edge_uses_.push(use_instr); + } + }); +} + +bool SSAPropagator::IsPhiArgExecutable(ir::Instruction* phi, uint32_t i) const { + ir::BasicBlock* phi_bb = ctx_->get_instr_block(phi); + + uint32_t in_label_id = phi->GetSingleWordOperand(i + 1); + ir::Instruction* in_label_instr = get_def_use_mgr()->GetDef(in_label_id); + ir::BasicBlock* in_bb = ctx_->get_instr_block(in_label_instr); + + return IsEdgeExecutable(Edge(in_bb, phi_bb)); +} + +bool SSAPropagator::SetStatus(ir::Instruction* inst, PropStatus status) { + bool has_old_status = false; + PropStatus old_status = kVarying; + if (HasStatus(inst)) { + has_old_status = true; + old_status = Status(inst); + } + + assert((!has_old_status || old_status <= status) && + "Invalid lattice transition"); + + bool status_changed = !has_old_status || (old_status != status); + if (status_changed) statuses_[inst] = status; + + return status_changed; +} + +bool SSAPropagator::Simulate(ir::Instruction* instr) { + bool changed = false; + + // Don't bother visiting instructions that should not be simulated again. + if (!ShouldSimulateAgain(instr)) { + return changed; + } + + ir::BasicBlock* dest_bb = nullptr; + PropStatus status = visit_fn_(instr, &dest_bb); + bool status_changed = SetStatus(instr, status); + + if (status == kVarying) { + // The statement produces a varying result, add it to the list of statements + // not to simulate anymore and add its SSA def-use edges for simulation. + DontSimulateAgain(instr); + if (status_changed) { + AddSSAEdges(instr); + } + + // If |instr| is a block terminator, add all the control edges out of its + // block. + if (instr->IsBlockTerminator()) { + ir::BasicBlock* block = ctx_->get_instr_block(instr); + for (const auto& e : bb_succs_.at(block)) { + AddControlEdge(e); + } + } + return false; + } else if (status == kInteresting) { + // Add the SSA edges coming out of this instruction if the propagation + // status has changed. + if (status_changed) { + AddSSAEdges(instr); + } + + // If there are multiple outgoing control flow edges and we know which one + // will be taken, add the destination block to the CFG work list. + if (dest_bb) { + AddControlEdge(Edge(ctx_->get_instr_block(instr), dest_bb)); + } + changed = true; + } + + // At this point, we are dealing with instructions that are in status + // kInteresting or kNotInteresting. To decide whether this instruction should + // be simulated again, we examine its operands. If at least one operand O is + // defined at an instruction D that should be simulated again, then the output + // of D might affect |instr|, so we should simulate |instr| again. + bool has_operands_to_simulate = false; + if (instr->opcode() == SpvOpPhi) { + // For Phi instructions, an operand causes the Phi to be simulated again if + // the operand comes from an edge that has not yet been traversed or if its + // definition should be simulated again. + for (uint32_t i = 2; i < instr->NumOperands(); i += 2) { + // Phi arguments come in pairs. Index 'i' contains the + // variable id, index 'i + 1' is the originating block id. + assert(i % 2 == 0 && i < instr->NumOperands() - 1 && + "malformed Phi arguments"); + + uint32_t arg_id = instr->GetSingleWordOperand(i); + ir::Instruction* arg_def_instr = get_def_use_mgr()->GetDef(arg_id); + if (!IsPhiArgExecutable(instr, i) || ShouldSimulateAgain(arg_def_instr)) { + has_operands_to_simulate = true; + break; + } + } + } else { + // For regular instructions, check if the defining instruction of each + // operand needs to be simulated again. If so, then this instruction should + // also be simulated again. + has_operands_to_simulate = + !instr->WhileEachInId([this](const uint32_t* use) { + ir::Instruction* def_instr = get_def_use_mgr()->GetDef(*use); + if (ShouldSimulateAgain(def_instr)) { + return false; + } + return true; + }); + } + + if (!has_operands_to_simulate) { + DontSimulateAgain(instr); + } + + return changed; +} + +bool SSAPropagator::Simulate(ir::BasicBlock* block) { + if (block == ctx_->cfg()->pseudo_exit_block()) { + return false; + } + + // Always simulate Phi instructions, even if we have simulated this block + // before. We do this because Phi instructions receive their inputs from + // incoming edges. When those edges are marked executable, the corresponding + // operand can be simulated. + bool changed = false; + block->ForEachPhiInst( + [&changed, this](ir::Instruction* instr) { changed |= Simulate(instr); }); + + // If this is the first time this block is being simulated, simulate every + // statement in it. + if (!BlockHasBeenSimulated(block)) { + block->ForEachInst([this, &changed](ir::Instruction* instr) { + if (instr->opcode() != SpvOpPhi) { + changed |= Simulate(instr); + } + }); + + MarkBlockSimulated(block); + + // If this block has exactly one successor, mark the edge to its successor + // as executable. + if (bb_succs_.at(block).size() == 1) { + AddControlEdge(bb_succs_.at(block).at(0)); + } + } + + return changed; +} + +void SSAPropagator::Initialize(ir::Function* fn) { + // Compute predecessor and successor blocks for every block in |fn|'s CFG. + // TODO(dnovillo): Move this to ir::CFG and always build them. Alternately, + // move it to IRContext and build CFG preds/succs on-demand. + bb_succs_[ctx_->cfg()->pseudo_entry_block()].push_back( + Edge(ctx_->cfg()->pseudo_entry_block(), fn->entry().get())); + + for (auto& block : *fn) { + const auto& const_block = block; + const_block.ForEachSuccessorLabel([this, &block](const uint32_t label_id) { + ir::BasicBlock* succ_bb = + ctx_->get_instr_block(get_def_use_mgr()->GetDef(label_id)); + bb_succs_[&block].push_back(Edge(&block, succ_bb)); + bb_preds_[succ_bb].push_back(Edge(succ_bb, &block)); + }); + if (block.IsReturnOrAbort()) { + bb_succs_[&block].push_back( + Edge(&block, ctx_->cfg()->pseudo_exit_block())); + bb_preds_[ctx_->cfg()->pseudo_exit_block()].push_back( + Edge(ctx_->cfg()->pseudo_exit_block(), &block)); + } + } + + // Add the edges out of the entry block to seed the propagator. + const auto& entry_succs = bb_succs_[ctx_->cfg()->pseudo_entry_block()]; + for (const auto& e : entry_succs) { + AddControlEdge(e); + } +} + +bool SSAPropagator::Run(ir::Function* fn) { + Initialize(fn); + + bool changed = false; + while (!blocks_.empty() || !ssa_edge_uses_.empty()) { + // Simulate all blocks first. Simulating blocks will add SSA edges to + // follow after all the blocks have been simulated. + if (!blocks_.empty()) { + auto block = blocks_.front(); + changed |= Simulate(block); + blocks_.pop(); + continue; + } + + // Simulate edges from the SSA queue. + if (!ssa_edge_uses_.empty()) { + ir::Instruction* instr = ssa_edge_uses_.front(); + changed |= Simulate(instr); + ssa_edge_uses_.pop(); + } + } + +#ifndef NDEBUG + // Verify all visited values have settled. No value that has been simulated + // should end on not interesting. + fn->ForEachInst([this](ir::Instruction* inst) { + assert( + (!HasStatus(inst) || Status(inst) != SSAPropagator::kNotInteresting) && + "Unsettled value"); + }); +#endif + + return changed; +} + +std::ostream& operator<<(std::ostream& str, + const SSAPropagator::PropStatus& status) { + switch (status) { + case SSAPropagator::kVarying: + str << "Varying"; + break; + case SSAPropagator::kInteresting: + str << "Interesting"; + break; + default: + str << "Not interesting"; + break; + } + return str; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/propagator.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/propagator.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/propagator.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/propagator.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,319 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_PROPAGATOR_H_ +#define LIBSPIRV_OPT_PROPAGATOR_H_ + +#include +#include +#include +#include +#include +#include + +#include "ir_context.h" +#include "module.h" + +namespace spvtools { +namespace opt { + +// Represents a CFG control edge. +struct Edge { + Edge(ir::BasicBlock* b1, ir::BasicBlock* b2) : source(b1), dest(b2) { + assert(source && "CFG edges cannot have a null source block."); + assert(dest && "CFG edges cannot have a null destination block."); + } + ir::BasicBlock* source; + ir::BasicBlock* dest; + bool operator<(const Edge& o) const { + return std::make_pair(source->id(), dest->id()) < + std::make_pair(o.source->id(), o.dest->id()); + } +}; + +// This class implements a generic value propagation algorithm based on the +// conditional constant propagation algorithm proposed in +// +// Constant propagation with conditional branches, +// Wegman and Zadeck, ACM TOPLAS 13(2):181-210. +// +// A Propagation Engine for GCC +// Diego Novillo, GCC Summit 2005 +// http://ols.fedoraproject.org/GCC/Reprints-2005/novillo-Reprint.pdf +// +// The purpose of this implementation is to act as a common framework for any +// transformation that needs to propagate values from statements producing new +// values to statements using those values. Simulation proceeds as follows: +// +// 1- Initially, all edges of the CFG are marked not executable and the CFG +// worklist is seeded with all the statements in the entry basic block. +// +// 2- Every instruction I is simulated by calling a pass-provided function +// |visit_fn|. This function is responsible for three things: +// +// (a) Keep a value table of interesting values. This table maps SSA IDs to +// their values. For instance, when implementing constant propagation, +// given a store operation 'OpStore %f %int_3', |visit_fn| should assign +// the value 3 to the table slot for %f. +// +// In general, |visit_fn| will need to use the value table to replace its +// operands, fold the result and decide whether a new value needs to be +// stored in the table. |visit_fn| should only create a new mapping in +// the value table if all the operands in the instruction are known and +// present in the value table. +// +// (b) Return a status indicator to direct the propagator logic. Once the +// instruction is simulated, the propagator needs to know whether this +// instruction produced something interesting. This is indicated via +// |visit_fn|'s return value: +// +// SSAPropagator::kNotInteresting: Instruction I produces nothing of +// interest and does not affect any of the work lists. The +// propagator will visit the statement again if any of its operands +// produce an interesting value in the future. +// +// |visit_fn| should always return this value when it is not sure +// whether the instruction will produce an interesting value in the +// future or not. For instance, for constant propagation, an OpIAdd +// instruction may produce a constant if its two operands are +// constant, but the first time we visit the instruction, we still +// may not have its operands in the value table. +// +// SSAPropagator::kVarying: The value produced by I cannot be determined +// at compile time. Further simulation of I is not required. The +// propagator will not visit this instruction again. Additionally, +// the propagator will add all the instructions at the end of SSA +// def-use edges to be simulated again. +// +// If I is a basic block terminator, it will mark all outgoing edges +// as executable so they are traversed one more time. Eventually +// the kVarying attribute will be spread out to all the data and +// control dependents for I. +// +// It is important for propagation to use kVarying as a bottom value +// for the propagation lattice. It should never be possible for an +// instruction to return kVarying once and kInteresting on a second +// visit. Otherwise, propagation would not stabilize. +// +// SSAPropagator::kInteresting: Instruction I produces a value that can +// be computed at compile time. In this case, |visit_fn| should +// create a new mapping between I's result ID and the produced +// value. Much like the kNotInteresting case, the propagator will +// visit this instruction again if any of its operands changes. +// This is useful when the statement changes from one interesting +// state to another. +// +// (c) For conditional branches, |visit_fn| may decide which edge to take out +// of I's basic block. For example, if the operand for an OpSwitch is +// known to take a specific constant value, |visit_fn| should figure out +// the destination basic block and pass it back by setting the second +// argument to |visit_fn|. +// +// At the end of propagation, values in the value table are guaranteed to be +// stable and can be replaced in the IR. +// +// 3- The propagator keeps two work queues. Instructions are only added to +// these queues if they produce an interesting or varying value. None of this +// should be handled by |visit_fn|. The propagator keeps track of this +// automatically (see SSAPropagator::Simulate for implementation). +// +// CFG blocks: contains the queue of blocks to be simulated. +// Blocks are added to this queue if their incoming edges are +// executable. +// +// SSA Edges: An SSA edge is a def-use edge between a value-producing +// instruction and its use instruction. The SSA edges list +// contains the statements at the end of a def-use edge that need +// to be re-visited when an instruction produces a kVarying or +// kInteresting result. +// +// 4- Simulation terminates when all work queues are drained. +// +// +// EXAMPLE: Basic constant store propagator. +// +// Suppose we want to propagate all constant assignments of the form "OpStore +// %id %cst" where "%id" is some variable and "%cst" an OpConstant. The +// following code builds a table |values| where every id that was assigned a +// constant value is mapped to the constant value it was assigned. +// +// auto ctx = spvtools::BuildModule(...); +// std::map values; +// const auto visit_fn = [&ctx, &values](ir::Instruction* instr, +// ir::BasicBlock** dest_bb) { +// if (instr->opcode() == SpvOpStore) { +// uint32_t rhs_id = instr->GetSingleWordOperand(1); +// ir::Instruction* rhs_def = ctx->get_def_use_mgr()->GetDef(rhs_id); +// if (rhs_def->opcode() == SpvOpConstant) { +// uint32_t val = rhs_def->GetSingleWordOperand(2); +// values[rhs_id] = val; +// return opt::SSAPropagator::kInteresting; +// } +// } +// return opt::SSAPropagator::kVarying; +// }; +// opt::SSAPropagator propagator(ctx.get(), &cfg, visit_fn); +// propagator.Run(&fn); +// +// Given the code: +// +// %int_4 = OpConstant %int 4 +// %int_3 = OpConstant %int 3 +// %int_1 = OpConstant %int 1 +// OpStore %x %int_4 +// OpStore %y %int_3 +// OpStore %z %int_1 +// +// After SSAPropagator::Run returns, the |values| map will contain the entries: +// values[%x] = 4, values[%y] = 3, and, values[%z] = 1. +class SSAPropagator { + public: + // Lattice values used for propagation. See class documentation for + // a description. + enum PropStatus { kNotInteresting, kInteresting, kVarying }; + + using VisitFunction = + std::function; + + SSAPropagator(ir::IRContext* context, const VisitFunction& visit_fn) + : ctx_(context), visit_fn_(visit_fn) {} + + // Runs the propagator on function |fn|. Returns true if changes were made to + // the function. Otherwise, it returns false. + bool Run(ir::Function* fn); + + // Returns true if the |i|th argument for |phi| comes through a CFG edge that + // has been marked executable. |i| should be an index value accepted by + // Instruction::GetSingleWordOperand. + bool IsPhiArgExecutable(ir::Instruction* phi, uint32_t i) const; + + // Returns true if |inst| has a recorded status. This will be true once |inst| + // has been simulated once. + bool HasStatus(ir::Instruction* inst) const { return statuses_.count(inst); } + + // Returns the current propagation status of |inst|. Assumes + // |HasStatus(inst)| returns true. + PropStatus Status(ir::Instruction* inst) const { + return statuses_.find(inst)->second; + } + + // Records the propagation status |status| for |inst|. Returns true if the + // status for |inst| has changed or set was set for the first time. + bool SetStatus(ir::Instruction* inst, PropStatus status); + + private: + // Initialize processing. + void Initialize(ir::Function* fn); + + // Simulate the execution |block| by calling |visit_fn_| on every instruction + // in it. + bool Simulate(ir::BasicBlock* block); + + // Simulate the execution of |instr| by replacing all the known values in + // every operand and determining whether the result is interesting for + // propagation. This invokes the callback function |visit_fn_| to determine + // the value computed by |instr|. + bool Simulate(ir::Instruction* instr); + + // Returns true if |instr| should be simulated again. + bool ShouldSimulateAgain(ir::Instruction* instr) const { + return do_not_simulate_.find(instr) == do_not_simulate_.end(); + } + + // Add |instr| to the set of instructions not to simulate again. + void DontSimulateAgain(ir::Instruction* instr) { + do_not_simulate_.insert(instr); + } + + // Returns true if |block| has been simulated already. + bool BlockHasBeenSimulated(ir::BasicBlock* block) const { + return simulated_blocks_.find(block) != simulated_blocks_.end(); + } + + // Marks block |block| as simulated. + void MarkBlockSimulated(ir::BasicBlock* block) { + simulated_blocks_.insert(block); + } + + // Marks |edge| as executable. Returns false if the edge was already marked + // as executable. + bool MarkEdgeExecutable(const Edge& edge) { + return executable_edges_.insert(edge).second; + } + + // Returns true if |edge| has been marked as executable. + bool IsEdgeExecutable(const Edge& edge) const { + return executable_edges_.find(edge) != executable_edges_.end(); + } + + // Returns a pointer to the def-use manager for |ctx_|. + analysis::DefUseManager* get_def_use_mgr() const { + return ctx_->get_def_use_mgr(); + } + + // If the CFG edge |e| has not been executed, this function adds |e|'s + // destination block to the work list. + void AddControlEdge(const Edge& e); + + // Adds all the instructions that use the result of |instr| to the SSA edges + // work list. If |instr| produces no result id, this does nothing. + void AddSSAEdges(ir::Instruction* instr); + + // IR context to use. + ir::IRContext* ctx_; + + // Function that visits instructions during simulation. The output of this + // function is used to determine if the simulated instruction produced a value + // interesting for propagation. The function is responsible for keeping + // track of interesting values by storing them in some user-provided map. + VisitFunction visit_fn_; + + // SSA def-use edges to traverse. Each entry is a destination statement for an + // SSA def-use edge as returned by |def_use_manager_|. + std::queue ssa_edge_uses_; + + // Blocks to simulate. + std::queue blocks_; + + // Blocks simulated during propagation. + std::unordered_set simulated_blocks_; + + // Set of instructions that should not be simulated again because they have + // been found to be in the kVarying state. + std::unordered_set do_not_simulate_; + + // Map between a basic block and its predecessor edges. + // TODO(dnovillo): Move this to ir::CFG and always build them. Alternately, + // move it to IRContext and build CFG preds/succs on-demand. + std::unordered_map> bb_preds_; + + // Map between a basic block and its successor edges. + // TODO(dnovillo): Move this to ir::CFG and always build them. Alternately, + // move it to IRContext and build CFG preds/succs on-demand. + std::unordered_map> bb_succs_; + + // Set of executable CFG edges. + std::set executable_edges_; + + // Tracks instruction propagation status. + std::unordered_map statuses_; +}; + +std::ostream& operator<<(std::ostream& str, + const SSAPropagator::PropStatus& status); + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_PROPAGATOR_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/redundancy_elimination.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/redundancy_elimination.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/redundancy_elimination.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/redundancy_elimination.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,58 @@ +// Copyright (c) 2017 Google 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. + +#include "redundancy_elimination.h" + +#include "value_number_table.h" + +namespace spvtools { +namespace opt { + +Pass::Status RedundancyEliminationPass::Process(ir::IRContext* c) { + InitializeProcessing(c); + + bool modified = false; + ValueNumberTable vnTable(context()); + + for (auto& func : *get_module()) { + // Build the dominator tree for this function. It is how the code is + // traversed. + opt::DominatorTree& dom_tree = + context()->GetDominatorAnalysis(&func, *context()->cfg())->GetDomTree(); + + // Keeps track of all ids that contain a given value number. We keep + // track of multiple values because they could have the same value, but + // different decorations. + std::map value_to_ids; + + if (EliminateRedundanciesFrom(dom_tree.GetRoot(), vnTable, value_to_ids)) { + modified = true; + } + } + return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange); +} + +bool RedundancyEliminationPass::EliminateRedundanciesFrom( + DominatorTreeNode* bb, const ValueNumberTable& vnTable, + std::map value_to_ids) { + bool modified = EliminateRedundanciesInBB(bb->bb_, vnTable, &value_to_ids); + + for (auto dominated_bb : bb->children_) { + modified |= EliminateRedundanciesFrom(dominated_bb, vnTable, value_to_ids); + } + + return modified; +} +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/redundancy_elimination.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/redundancy_elimination.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/redundancy_elimination.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/redundancy_elimination.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,54 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_REDUNDANCY_ELIMINATION_H_ +#define LIBSPIRV_OPT_REDUNDANCY_ELIMINATION_H_ + +#include "ir_context.h" +#include "local_redundancy_elimination.h" +#include "pass.h" +#include "value_number_table.h" + +namespace spvtools { +namespace opt { + +// This pass implements total redundancy elimination. This is the same as +// local redundancy elimination except it looks across basic block boundaries. +// An instruction, inst, is totally redundant if there is another instruction +// that dominates inst, and also computes the same value. +class RedundancyEliminationPass : public LocalRedundancyEliminationPass { + public: + const char* name() const override { return "redundancy-elimination"; } + Status Process(ir::IRContext*) override; + + protected: + // Removes for all total redundancies in the function starting at |bb|. + // + // |vnTable| must have computed a value number for every result id defined + // in the function containing |bb|. + // + // |value_to_ids| is a map from value number to ids. If {vn, id} is in + // |value_to_ids| then vn is the value number of id, and the defintion of id + // dominates |bb|. + // + // Returns true if at least one instruction is deleted. + bool EliminateRedundanciesFrom(DominatorTreeNode* bb, + const ValueNumberTable& vnTable, + std::map value_to_ids); +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_REDUNDANCY_ELIMINATION_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/reflect.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/reflect.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/reflect.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/reflect.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_REFLECT_H_ +#define LIBSPIRV_OPT_REFLECT_H_ + +#include "latest_version_spirv_header.h" + +namespace spvtools { +namespace ir { + +// Note that as SPIR-V evolves over time, new opcodes may appear. So the +// following functions tend to be outdated and should be updated when SPIR-V +// version bumps. + +inline bool IsDebug1Inst(SpvOp opcode) { + return (opcode >= SpvOpSourceContinued && opcode <= SpvOpSourceExtension) || + opcode == SpvOpString; +} +inline bool IsDebug2Inst(SpvOp opcode) { + return opcode == SpvOpName || opcode == SpvOpMemberName; +} +inline bool IsDebug3Inst(SpvOp opcode) { + return opcode == SpvOpModuleProcessed; +} +inline bool IsDebugLineInst(SpvOp opcode) { + return opcode == SpvOpLine || opcode == SpvOpNoLine; +} +inline bool IsAnnotationInst(SpvOp opcode) { + return (opcode >= SpvOpDecorate && opcode <= SpvOpGroupMemberDecorate) || + opcode == SpvOpDecorateId || opcode == SpvOpDecorateStringGOOGLE || + opcode == SpvOpMemberDecorateStringGOOGLE; +} +inline bool IsTypeInst(SpvOp opcode) { + return (opcode >= SpvOpTypeVoid && opcode <= SpvOpTypeForwardPointer) || + opcode == SpvOpTypePipeStorage || opcode == SpvOpTypeNamedBarrier; +} +inline bool IsConstantInst(SpvOp opcode) { + return opcode >= SpvOpConstantTrue && opcode <= SpvOpSpecConstantOp; +} +inline bool IsCompileTimeConstantInst(SpvOp opcode) { + return opcode >= SpvOpConstantTrue && opcode <= SpvOpConstantNull; +} +inline bool IsSpecConstantInst(SpvOp opcode) { + return opcode >= SpvOpSpecConstantTrue && opcode <= SpvOpSpecConstantOp; +} +inline bool IsTerminatorInst(SpvOp opcode) { + return opcode >= SpvOpBranch && opcode <= SpvOpUnreachable; +} + +} // namespace ir +} // namespace spvtools + +#endif // LIBSPIRV_OPT_REFLECT_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/remove_duplicates_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/remove_duplicates_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/remove_duplicates_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/remove_duplicates_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,206 @@ +// Copyright (c) 2017 Pierre Moreau +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "remove_duplicates_pass.h" + +#include + +#include +#include +#include +#include +#include + +#include "decoration_manager.h" +#include "ir_context.h" +#include "opcode.h" +#include "reflect.h" + +namespace spvtools { +namespace opt { + +using ir::Instruction; +using ir::Module; +using ir::Operand; +using opt::analysis::DecorationManager; +using opt::analysis::DefUseManager; + +Pass::Status RemoveDuplicatesPass::Process(ir::IRContext* ir_context) { + bool modified = RemoveDuplicateCapabilities(ir_context); + modified |= RemoveDuplicatesExtInstImports(ir_context); + modified |= RemoveDuplicateTypes(ir_context); + modified |= RemoveDuplicateDecorations(ir_context); + + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +bool RemoveDuplicatesPass::RemoveDuplicateCapabilities( + ir::IRContext* ir_context) const { + bool modified = false; + + if (ir_context->capabilities().empty()) { + return modified; + } + + std::unordered_set capabilities; + for (auto* i = &*ir_context->capability_begin(); i;) { + auto res = capabilities.insert(i->GetSingleWordOperand(0u)); + + if (res.second) { + // Never seen before, keep it. + i = i->NextNode(); + } else { + // It's a duplicate, remove it. + i = ir_context->KillInst(i); + modified = true; + } + } + + return modified; +} + +bool RemoveDuplicatesPass::RemoveDuplicatesExtInstImports( + ir::IRContext* ir_context) const { + bool modified = false; + + if (ir_context->ext_inst_imports().empty()) { + return modified; + } + + std::unordered_map ext_inst_imports; + for (auto* i = &*ir_context->ext_inst_import_begin(); i;) { + auto res = ext_inst_imports.emplace( + reinterpret_cast(i->GetInOperand(0u).words.data()), + i->result_id()); + if (res.second) { + // Never seen before, keep it. + i = i->NextNode(); + } else { + // It's a duplicate, remove it. + ir_context->ReplaceAllUsesWith(i->result_id(), res.first->second); + i = ir_context->KillInst(i); + modified = true; + } + } + + return modified; +} + +bool RemoveDuplicatesPass::RemoveDuplicateTypes( + ir::IRContext* ir_context) const { + bool modified = false; + + if (ir_context->types_values().empty()) { + return modified; + } + + std::vector visited_types; + std::vector to_delete; + for (auto* i = &*ir_context->types_values_begin(); i; i = i->NextNode()) { + // We only care about types. + if (!spvOpcodeGeneratesType((i->opcode())) && + i->opcode() != SpvOpTypeForwardPointer) { + continue; + } + + // Is the current type equal to one of the types we have aready visited? + SpvId id_to_keep = 0u; + // TODO(dneto0): Use a trie to avoid quadratic behaviour? Extract the + // ResultIdTrie from unify_const_pass.cpp for this. + for (auto j : visited_types) { + if (AreTypesEqual(*i, *j, ir_context)) { + id_to_keep = j->result_id(); + break; + } + } + + if (id_to_keep == 0u) { + // This is a never seen before type, keep it around. + visited_types.emplace_back(i); + } else { + // The same type has already been seen before, remove this one. + ir_context->KillNamesAndDecorates(i->result_id()); + ir_context->ReplaceAllUsesWith(i->result_id(), id_to_keep); + modified = true; + to_delete.emplace_back(i); + } + } + + for (auto i : to_delete) { + ir_context->KillInst(i); + } + + return modified; +} + +// TODO(pierremoreau): Duplicate decoration groups should be removed. For +// example, in +// OpDecorate %1 Constant +// %1 = OpDecorationGroup +// OpDecorate %2 Constant +// %2 = OpDecorationGroup +// OpGroupDecorate %1 %3 +// OpGroupDecorate %2 %4 +// group %2 could be removed. +bool RemoveDuplicatesPass::RemoveDuplicateDecorations( + ir::IRContext* ir_context) const { + bool modified = false; + + std::vector visited_decorations; + + opt::analysis::DecorationManager decoration_manager(ir_context->module()); + for (auto* i = &*ir_context->annotation_begin(); i;) { + // Is the current decoration equal to one of the decorations we have aready + // visited? + bool already_visited = false; + // TODO(dneto0): Use a trie to avoid quadratic behaviour? Extract the + // ResultIdTrie from unify_const_pass.cpp for this. + for (const Instruction* j : visited_decorations) { + if (decoration_manager.AreDecorationsTheSame(&*i, j, false)) { + already_visited = true; + break; + } + } + + if (!already_visited) { + // This is a never seen before decoration, keep it around. + visited_decorations.emplace_back(&*i); + i = i->NextNode(); + } else { + // The same decoration has already been seen before, remove this one. + modified = true; + i = ir_context->KillInst(i); + } + } + + return modified; +} + +bool RemoveDuplicatesPass::AreTypesEqual(const Instruction& inst1, + const Instruction& inst2, + ir::IRContext* context) { + if (inst1.opcode() != inst2.opcode()) return false; + if (!ir::IsTypeInst(inst1.opcode())) return false; + + const analysis::Type* type1 = + context->get_type_mgr()->GetType(inst1.result_id()); + const analysis::Type* type2 = + context->get_type_mgr()->GetType(inst2.result_id()); + if (type1 && type2 && *type1 == *type2) return true; + + return false; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/remove_duplicates_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/remove_duplicates_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/remove_duplicates_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/remove_duplicates_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2017 Pierre Moreau +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_REMOVE_DUPLICATES_PASS_H_ +#define LIBSPIRV_OPT_REMOVE_DUPLICATES_PASS_H_ + +#include + +#include "decoration_manager.h" +#include "def_use_manager.h" +#include "ir_context.h" +#include "module.h" +#include "pass.h" + +namespace spvtools { +namespace opt { + +using IdDecorationsList = + std::unordered_map>; + +// See optimizer.hpp for documentation. +class RemoveDuplicatesPass : public Pass { + public: + const char* name() const override { return "remove-duplicates"; } + Status Process(ir::IRContext*) override; + // TODO(pierremoreau): Move this function somewhere else (e.g. pass.h or + // within the type manager) + // Returns whether two types are equal, and have the same decorations. + static bool AreTypesEqual(const ir::Instruction& inst1, + const ir::Instruction& inst2, + ir::IRContext* context); + + private: + // Remove duplicate capabilities from the module attached to |ir_context|. + // + // Returns true if the module was modified, false otherwise. + bool RemoveDuplicateCapabilities(ir::IRContext* ir_context) const; + // Remove duplicate extended instruction imports from the module attached to + // |ir_context|. + // + // Returns true if the module was modified, false otherwise. + bool RemoveDuplicatesExtInstImports(ir::IRContext* ir_context) const; + // Remove duplicate types from the module attached to |ir_context|. + // + // Returns true if the module was modified, false otherwise. + bool RemoveDuplicateTypes(ir::IRContext* ir_context) const; + // Remove duplicate decorations from the module attached to |ir_context|. + // + // Returns true if the module was modified, false otherwise. + bool RemoveDuplicateDecorations(ir::IRContext* ir_context) const; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_REMOVE_DUPLICATES_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/replace_invalid_opc.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/replace_invalid_opc.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/replace_invalid_opc.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/replace_invalid_opc.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,207 @@ +// Copyright (c) 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "replace_invalid_opc.h" + +#include + +namespace spvtools { +namespace opt { + +Pass::Status ReplaceInvalidOpcodePass::Process(ir::IRContext* c) { + InitializeProcessing(c); + bool modified = false; + + if (context()->get_feature_mgr()->HasCapability(SpvCapabilityLinkage)) { + return Status::SuccessWithoutChange; + } + + SpvExecutionModel execution_model = GetExecutionModel(); + if (execution_model == SpvExecutionModelKernel) { + // We do not handle kernels. + return Status::SuccessWithoutChange; + } + if (execution_model == SpvExecutionModelMax) { + // Mixed execution models for the entry points. This case is not currently + // handled. + return Status::SuccessWithoutChange; + } + + for (ir::Function& func : *get_module()) { + modified |= RewriteFunction(&func, execution_model); + } + return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange); +} + +SpvExecutionModel ReplaceInvalidOpcodePass::GetExecutionModel() { + SpvExecutionModel result = SpvExecutionModelMax; + bool first = true; + for (ir::Instruction& entry_point : get_module()->entry_points()) { + if (first) { + result = + static_cast(entry_point.GetSingleWordInOperand(0)); + first = false; + } else { + SpvExecutionModel current_model = + static_cast(entry_point.GetSingleWordInOperand(0)); + if (current_model != result) { + result = SpvExecutionModelMax; + break; + } + } + } + return result; +} + +bool ReplaceInvalidOpcodePass::RewriteFunction(ir::Function* function, + SpvExecutionModel model) { + bool modified = false; + ir::Instruction* last_line_dbg_inst = nullptr; + function->ForEachInst( + [model, &modified, &last_line_dbg_inst, this](ir::Instruction* inst) { + // Track the debug information so we can have a meaningful message. + if (inst->opcode() == SpvOpLabel || inst->opcode() == SpvOpNoLine) { + last_line_dbg_inst = nullptr; + return; + } else if (inst->opcode() == SpvOpLine) { + last_line_dbg_inst = inst; + return; + } + + bool replace = false; + if (model != SpvExecutionModelFragment && + IsFragmentShaderOnlyInstruction(inst)) { + replace = true; + } + + if (model != SpvExecutionModelTessellationControl && + model != SpvExecutionModelGLCompute) { + if (inst->opcode() == SpvOpControlBarrier) { + assert(model != SpvExecutionModelKernel && + "Expecting to be working on a shader module."); + replace = true; + } + } + + if (replace) { + modified = true; + if (last_line_dbg_inst == nullptr) { + ReplaceInstruction(inst, nullptr, 0, 0); + } else { + // Get the name of the source file. + ir::Instruction* file_name = context()->get_def_use_mgr()->GetDef( + last_line_dbg_inst->GetSingleWordInOperand(0)); + const char* source = reinterpret_cast( + &file_name->GetInOperand(0).words[0]); + + // Get the line number and column number. + uint32_t line_number = + last_line_dbg_inst->GetSingleWordInOperand(1); + uint32_t col_number = last_line_dbg_inst->GetSingleWordInOperand(2); + + // Replace the instruction. + ReplaceInstruction(inst, source, line_number, col_number); + } + } + }, + /* run_on_debug_line_insts = */ true); + return modified; +} + +bool ReplaceInvalidOpcodePass::IsFragmentShaderOnlyInstruction( + ir::Instruction* inst) { + switch (inst->opcode()) { + case SpvOpDPdx: + case SpvOpDPdy: + case SpvOpFwidth: + case SpvOpDPdxFine: + case SpvOpDPdyFine: + case SpvOpFwidthFine: + case SpvOpDPdxCoarse: + case SpvOpDPdyCoarse: + case SpvOpFwidthCoarse: + case SpvOpImageSampleImplicitLod: + case SpvOpImageSampleDrefImplicitLod: + case SpvOpImageSampleProjImplicitLod: + case SpvOpImageSampleProjDrefImplicitLod: + case SpvOpImageSparseSampleImplicitLod: + case SpvOpImageSparseSampleDrefImplicitLod: + case SpvOpImageQueryLod: + // TODO: Teach |ReplaceInstruction| to handle block terminators. Then + // uncomment the OpKill case. + // case SpvOpKill: + return true; + default: + return false; + } +} + +void ReplaceInvalidOpcodePass::ReplaceInstruction(ir::Instruction* inst, + const char* source, + uint32_t line_number, + uint32_t column_number) { + if (inst->result_id() != 0) { + uint32_t const_id = GetSpecialConstant(inst->type_id()); + context()->KillNamesAndDecorates(inst); + context()->ReplaceAllUsesWith(inst->result_id(), const_id); + } + assert(!inst->IsBlockTerminator() && + "We cannot simply delete a block terminator. It must be replaced " + "with something."); + if (consumer()) { + std::string message = BuildWarningMessage(inst->opcode()); + consumer()(SPV_MSG_WARNING, source, {line_number, column_number, 0}, + message.c_str()); + } + context()->KillInst(inst); +} + +uint32_t ReplaceInvalidOpcodePass::GetSpecialConstant(uint32_t type_id) { + const analysis::Constant* special_const = nullptr; + analysis::ConstantManager* const_mgr = context()->get_constant_mgr(); + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + + ir::Instruction* type = context()->get_def_use_mgr()->GetDef(type_id); + if (type->opcode() == SpvOpTypeVector) { + uint32_t component_const = + GetSpecialConstant(type->GetSingleWordInOperand(0)); + std::vector ids; + for (uint32_t i = 0; i < type->GetSingleWordInOperand(1); ++i) { + ids.push_back(component_const); + } + special_const = const_mgr->GetConstant(type_mgr->GetType(type_id), ids); + } else { + assert(type->opcode() == SpvOpTypeInt || type->opcode() == SpvOpTypeFloat); + std::vector literal_words; + for (uint32_t i = 0; i < type->GetSingleWordInOperand(0); i += 32) { + literal_words.push_back(0xDEADBEEF); + } + special_const = + const_mgr->GetConstant(type_mgr->GetType(type_id), literal_words); + } + assert(special_const != nullptr); + return const_mgr->GetDefiningInstruction(special_const)->result_id(); +} + +std::string ReplaceInvalidOpcodePass::BuildWarningMessage(SpvOp opcode) { + spv_opcode_desc opcode_info; + context()->grammar().lookupOpcode(opcode, &opcode_info); + std::string message = "Removing "; + message += opcode_info->name; + message += " instruction because of incompatible execution model."; + return message; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/replace_invalid_opc.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/replace_invalid_opc.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/replace_invalid_opc.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/replace_invalid_opc.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_REPLACE_INVALID_OPC_H_ +#define LIBSPIRV_OPT_REPLACE_INVALID_OPC_H_ + +#include "pass.h" + +namespace spvtools { +namespace opt { + +// This pass will runs on shader modules only. It will replace the result of +// instructions that are valid for shader modules, but not the current shader +// stage, with a constant value. If the instruction does not have a return +// value, the instruction will simply be deleted. +class ReplaceInvalidOpcodePass : public Pass { + public: + const char* name() const override { return "replace-invalid-opcodes"; } + Status Process(ir::IRContext*) override; + + private: + // Returns the execution model that is used by every entry point in the + // module. If more than one execution model is used in the module, then the + // return value is SpvExecutionModelMax. + SpvExecutionModel GetExecutionModel(); + + // Replaces all instructions in |function| that are invalid with execution + // model |mode|, but valid for another shader model, with a special constant + // value. See |GetSpecialConstant|. + bool RewriteFunction(ir::Function* function, SpvExecutionModel mode); + + // Returns true if |inst| is valid for fragment shaders only. + bool IsFragmentShaderOnlyInstruction(ir::Instruction* inst); + + // Replaces all uses of the result of |inst|, if there is one, with the id of + // a special constant. Then |inst| is killed. |inst| cannot be a block + // terminator because the basic block will then become invalid. |inst| is no + // longer valid after calling this function. + void ReplaceInstruction(ir::Instruction* inst, const char* source, + uint32_t line_number, uint32_t column_number); + + // Returns the id of a constant with type |type_id|. The type must be an + // integer, float, or vector. For scalar types, the hex representation of the + // constant will be the concatenation of 0xDEADBEEF with itself until the + // width of the type has been reached. For a vector, each element of the + // constant will be constructed the same way. + uint32_t GetSpecialConstant(uint32_t type_id); + std::string BuildWarningMessage(SpvOp opcode); +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_REPLACE_INVALID_OPC_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/scalar_analysis.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/scalar_analysis.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/scalar_analysis.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/scalar_analysis.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,638 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "opt/scalar_analysis.h" + +#include +#include +#include +#include + +#include "opt/ir_context.h" + +// Transforms a given scalar operation instruction into a DAG representation. +// +// 1. Take an instruction and traverse its operands until we reach a +// constant node or an instruction which we do not know how to compute the +// value, such as a load. +// +// 2. Create a new node for each instruction traversed and build the nodes for +// the in operands of that instruction as well. +// +// 3. Add the operand nodes as children of the first and hash the node. Use the +// hash to see if the node is already in the cache. We ensure the children are +// always in sorted order so that two nodes with the same children but inserted +// in a different order have the same hash and so that the overloaded operator== +// will return true. If the node is already in the cache return the cached +// version instead. +// +// 4. The created DAG can then be simplified by +// ScalarAnalysis::SimplifyExpression, implemented in +// scalar_analysis_simplification.cpp. See that file for further information on +// the simplification process. +// + +namespace spvtools { +namespace opt { + +uint32_t SENode::NumberOfNodes = 0; + +ScalarEvolutionAnalysis::ScalarEvolutionAnalysis(ir::IRContext* context) + : context_(context) { + // Create and cached the CantComputeNode. + cached_cant_compute_ = + GetCachedOrAdd(std::unique_ptr(new SECantCompute(this))); +} + +SENode* ScalarEvolutionAnalysis::CreateNegation(SENode* operand) { + // If operand is can't compute then the whole graph is can't compute. + if (operand->IsCantCompute()) return CreateCantComputeNode(); + + if (operand->GetType() == SENode::Constant) { + return CreateConstant(-operand->AsSEConstantNode()->FoldToSingleValue()); + } + std::unique_ptr negation_node{new SENegative(this)}; + negation_node->AddChild(operand); + return GetCachedOrAdd(std::move(negation_node)); +} + +SENode* ScalarEvolutionAnalysis::CreateConstant(int64_t integer) { + return GetCachedOrAdd( + std::unique_ptr(new SEConstantNode(this, integer))); +} + +SENode* ScalarEvolutionAnalysis::CreateRecurrentExpression( + const ir::Loop* loop, SENode* offset, SENode* coefficient) { + assert(loop && "Recurrent add expressions must have a valid loop."); + + // If operands are can't compute then the whole graph is can't compute. + if (offset->IsCantCompute() || coefficient->IsCantCompute()) + return CreateCantComputeNode(); + + std::unique_ptr phi_node{new SERecurrentNode(this, loop)}; + phi_node->AddOffset(offset); + phi_node->AddCoefficient(coefficient); + + return GetCachedOrAdd(std::move(phi_node)); +} + +SENode* ScalarEvolutionAnalysis::AnalyzeMultiplyOp( + const ir::Instruction* multiply) { + assert(multiply->opcode() == SpvOp::SpvOpIMul && + "Multiply node did not come from a multiply instruction"); + opt::analysis::DefUseManager* def_use = context_->get_def_use_mgr(); + + SENode* op1 = + AnalyzeInstruction(def_use->GetDef(multiply->GetSingleWordInOperand(0))); + SENode* op2 = + AnalyzeInstruction(def_use->GetDef(multiply->GetSingleWordInOperand(1))); + + return CreateMultiplyNode(op1, op2); +} + +SENode* ScalarEvolutionAnalysis::CreateMultiplyNode(SENode* operand_1, + SENode* operand_2) { + // If operands are can't compute then the whole graph is can't compute. + if (operand_1->IsCantCompute() || operand_2->IsCantCompute()) + return CreateCantComputeNode(); + + if (operand_1->GetType() == SENode::Constant && + operand_2->GetType() == SENode::Constant) { + return CreateConstant(operand_1->AsSEConstantNode()->FoldToSingleValue() * + operand_2->AsSEConstantNode()->FoldToSingleValue()); + } + + std::unique_ptr multiply_node{new SEMultiplyNode(this)}; + + multiply_node->AddChild(operand_1); + multiply_node->AddChild(operand_2); + + return GetCachedOrAdd(std::move(multiply_node)); +} + +SENode* ScalarEvolutionAnalysis::CreateSubtraction(SENode* operand_1, + SENode* operand_2) { + // Fold if both operands are constant. + if (operand_1->GetType() == SENode::Constant && + operand_2->GetType() == SENode::Constant) { + return CreateConstant(operand_1->AsSEConstantNode()->FoldToSingleValue() - + operand_2->AsSEConstantNode()->FoldToSingleValue()); + } + + return CreateAddNode(operand_1, CreateNegation(operand_2)); +} + +SENode* ScalarEvolutionAnalysis::CreateAddNode(SENode* operand_1, + SENode* operand_2) { + // Fold if both operands are constant and the |simplify| flag is true. + if (operand_1->GetType() == SENode::Constant && + operand_2->GetType() == SENode::Constant) { + return CreateConstant(operand_1->AsSEConstantNode()->FoldToSingleValue() + + operand_2->AsSEConstantNode()->FoldToSingleValue()); + } + + // If operands are can't compute then the whole graph is can't compute. + if (operand_1->IsCantCompute() || operand_2->IsCantCompute()) + return CreateCantComputeNode(); + + std::unique_ptr add_node{new SEAddNode(this)}; + + add_node->AddChild(operand_1); + add_node->AddChild(operand_2); + + return GetCachedOrAdd(std::move(add_node)); +} + +SENode* ScalarEvolutionAnalysis::AnalyzeInstruction( + const ir::Instruction* inst) { + auto itr = recurrent_node_map_.find(inst); + if (itr != recurrent_node_map_.end()) return itr->second; + + SENode* output = nullptr; + switch (inst->opcode()) { + case SpvOp::SpvOpPhi: { + output = AnalyzePhiInstruction(inst); + break; + } + case SpvOp::SpvOpConstant: + case SpvOp::SpvOpConstantNull: { + output = AnalyzeConstant(inst); + break; + } + case SpvOp::SpvOpISub: + case SpvOp::SpvOpIAdd: { + output = AnalyzeAddOp(inst); + break; + } + case SpvOp::SpvOpIMul: { + output = AnalyzeMultiplyOp(inst); + break; + } + default: { + output = CreateValueUnknownNode(inst); + break; + } + } + + return output; +} + +SENode* ScalarEvolutionAnalysis::AnalyzeConstant(const ir::Instruction* inst) { + if (inst->opcode() == SpvOp::SpvOpConstantNull) return CreateConstant(0); + + assert(inst->opcode() == SpvOp::SpvOpConstant); + assert(inst->NumInOperands() == 1); + int64_t value = 0; + + // Look up the instruction in the constant manager. + const opt::analysis::Constant* constant = + context_->get_constant_mgr()->FindDeclaredConstant(inst->result_id()); + + if (!constant) return CreateCantComputeNode(); + + const opt::analysis::IntConstant* int_constant = constant->AsIntConstant(); + + // Exit out if it is a 64 bit integer. + if (!int_constant || int_constant->words().size() != 1) + return CreateCantComputeNode(); + + if (int_constant->type()->AsInteger()->IsSigned()) { + value = int_constant->GetS32BitValue(); + } else { + value = int_constant->GetU32BitValue(); + } + + return CreateConstant(value); +} + +// Handles both addition and subtraction. If the |sub| flag is set then the +// addition will be op1+(-op2) otherwise op1+op2. +SENode* ScalarEvolutionAnalysis::AnalyzeAddOp(const ir::Instruction* inst) { + assert((inst->opcode() == SpvOp::SpvOpIAdd || + inst->opcode() == SpvOp::SpvOpISub) && + "Add node must be created from a OpIAdd or OpISub instruction"); + + opt::analysis::DefUseManager* def_use = context_->get_def_use_mgr(); + + SENode* op1 = + AnalyzeInstruction(def_use->GetDef(inst->GetSingleWordInOperand(0))); + + SENode* op2 = + AnalyzeInstruction(def_use->GetDef(inst->GetSingleWordInOperand(1))); + + // To handle subtraction we wrap the second operand in a unary negation node. + if (inst->opcode() == SpvOp::SpvOpISub) { + op2 = CreateNegation(op2); + } + + return CreateAddNode(op1, op2); +} + +SENode* ScalarEvolutionAnalysis::AnalyzePhiInstruction( + const ir::Instruction* phi) { + // The phi should only have two incoming value pairs. + if (phi->NumInOperands() != 4) { + return CreateCantComputeNode(); + } + + opt::analysis::DefUseManager* def_use = context_->get_def_use_mgr(); + + // Get the basic block this instruction belongs to. + ir::BasicBlock* basic_block = + context_->get_instr_block(const_cast(phi)); + + // And then the function that the basic blocks belongs to. + ir::Function* function = basic_block->GetParent(); + + // Use the function to get the loop descriptor. + ir::LoopDescriptor* loop_descriptor = context_->GetLoopDescriptor(function); + + // We only handle phis in loops at the moment. + if (!loop_descriptor) return CreateCantComputeNode(); + + // Get the innermost loop which this block belongs to. + ir::Loop* loop = (*loop_descriptor)[basic_block->id()]; + + // If the loop doesn't exist or doesn't have a preheader or latch block, exit + // out. + if (!loop || !loop->GetLatchBlock() || !loop->GetPreHeaderBlock() || + loop->GetHeaderBlock() != basic_block) + return recurrent_node_map_[phi] = CreateCantComputeNode(); + + std::unique_ptr phi_node{new SERecurrentNode(this, loop)}; + + // We add the node to this map to allow it to be returned before the node is + // fully built. This is needed as the subsequent call to AnalyzeInstruction + // could lead back to this |phi| instruction so we return the pointer + // immediately in AnalyzeInstruction to break the recursion. + recurrent_node_map_[phi] = phi_node.get(); + + // Traverse the operands of the instruction an create new nodes for each one. + for (uint32_t i = 0; i < phi->NumInOperands(); i += 2) { + uint32_t value_id = phi->GetSingleWordInOperand(i); + uint32_t incoming_label_id = phi->GetSingleWordInOperand(i + 1); + + ir::Instruction* value_inst = def_use->GetDef(value_id); + SENode* value_node = AnalyzeInstruction(value_inst); + + // If any operand is CantCompute then the whole graph is CantCompute. + if (value_node->IsCantCompute()) + return recurrent_node_map_[phi] = CreateCantComputeNode(); + + // If the value is coming from the preheader block then the value is the + // initial value of the phi. + if (incoming_label_id == loop->GetPreHeaderBlock()->id()) { + phi_node->AddOffset(value_node); + } else if (incoming_label_id == loop->GetLatchBlock()->id()) { + // Assumed to be in the form of step + phi. + if (value_node->GetType() != SENode::Add) + return recurrent_node_map_[phi] = CreateCantComputeNode(); + + SENode* step_node = nullptr; + SENode* phi_operand = nullptr; + SENode* operand_1 = value_node->GetChild(0); + SENode* operand_2 = value_node->GetChild(1); + + // Find which node is the step term. + if (!operand_1->AsSERecurrentNode()) + step_node = operand_1; + else if (!operand_2->AsSERecurrentNode()) + step_node = operand_2; + + // Find which node is the recurrent expression. + if (operand_1->AsSERecurrentNode()) + phi_operand = operand_1; + else if (operand_2->AsSERecurrentNode()) + phi_operand = operand_2; + + // If it is not in the form step + phi exit out. + if (!(step_node && phi_operand)) + return recurrent_node_map_[phi] = CreateCantComputeNode(); + + // If the phi operand is not the same phi node exit out. + if (phi_operand != phi_node.get()) + return recurrent_node_map_[phi] = CreateCantComputeNode(); + + if (!IsLoopInvariant(loop, step_node)) + return recurrent_node_map_[phi] = CreateCantComputeNode(); + + phi_node->AddCoefficient(step_node); + } + } + + // Once the node is fully built we update the map with the version from the + // cache (if it has already been added to the cache). + return recurrent_node_map_[phi] = GetCachedOrAdd(std::move(phi_node)); +} + +SENode* ScalarEvolutionAnalysis::CreateValueUnknownNode( + const ir::Instruction* inst) { + std::unique_ptr load_node{ + new SEValueUnknown(this, inst->result_id())}; + return GetCachedOrAdd(std::move(load_node)); +} + +SENode* ScalarEvolutionAnalysis::CreateCantComputeNode() { + return cached_cant_compute_; +} + +// Add the created node into the cache of nodes. If it already exists return it. +SENode* ScalarEvolutionAnalysis::GetCachedOrAdd( + std::unique_ptr prospective_node) { + auto itr = node_cache_.find(prospective_node); + if (itr != node_cache_.end()) { + return (*itr).get(); + } + + SENode* raw_ptr_to_node = prospective_node.get(); + node_cache_.insert(std::move(prospective_node)); + return raw_ptr_to_node; +} + +bool ScalarEvolutionAnalysis::IsLoopInvariant(const ir::Loop* loop, + const SENode* node) const { + for (auto itr = node->graph_cbegin(); itr != node->graph_cend(); ++itr) { + if (const SERecurrentNode* rec = itr->AsSERecurrentNode()) { + const ir::BasicBlock* header = rec->GetLoop()->GetHeaderBlock(); + + // If the loop which the recurrent expression belongs to is either |loop + // or a nested loop inside |loop| then we assume it is variant. + if (loop->IsInsideLoop(header)) { + return false; + } + } else if (const SEValueUnknown* unknown = itr->AsSEValueUnknown()) { + // If the instruction is inside the loop we conservatively assume it is + // loop variant. + if (loop->IsInsideLoop(unknown->ResultId())) return false; + } + } + + return true; +} + +SENode* ScalarEvolutionAnalysis::GetCoefficientFromRecurrentTerm( + SENode* node, const ir::Loop* loop) { + // Traverse the DAG to find the recurrent expression belonging to |loop|. + for (auto itr = node->graph_begin(); itr != node->graph_end(); ++itr) { + SERecurrentNode* rec = itr->AsSERecurrentNode(); + if (rec && rec->GetLoop() == loop) { + return rec->GetCoefficient(); + } + } + return CreateConstant(0); +} + +SENode* ScalarEvolutionAnalysis::UpdateChildNode(SENode* parent, + SENode* old_child, + SENode* new_child) { + // Only handles add. + if (parent->GetType() != SENode::Add) return parent; + + std::vector new_children; + for (SENode* child : *parent) { + if (child == old_child) { + new_children.push_back(new_child); + } else { + new_children.push_back(child); + } + } + + std::unique_ptr add_node{new SEAddNode(this)}; + for (SENode* child : new_children) { + add_node->AddChild(child); + } + + return SimplifyExpression(GetCachedOrAdd(std::move(add_node))); +} + +// Rebuild the |node| eliminating, if it exists, the recurrent term which +// belongs to the |loop|. +SENode* ScalarEvolutionAnalysis::BuildGraphWithoutRecurrentTerm( + SENode* node, const ir::Loop* loop) { + // If the node is already a recurrent expression belonging to loop then just + // return the offset. + SERecurrentNode* recurrent = node->AsSERecurrentNode(); + if (recurrent) { + if (recurrent->GetLoop() == loop) { + return recurrent->GetOffset(); + } else { + return node; + } + } + + std::vector new_children; + // Otherwise find the recurrent node in the children of this node. + for (auto itr : *node) { + recurrent = itr->AsSERecurrentNode(); + if (recurrent && recurrent->GetLoop() == loop) { + new_children.push_back(recurrent->GetOffset()); + } else { + new_children.push_back(itr); + } + } + + std::unique_ptr add_node{new SEAddNode(this)}; + for (SENode* child : new_children) { + add_node->AddChild(child); + } + + return SimplifyExpression(GetCachedOrAdd(std::move(add_node))); +} + +// Return the recurrent term belonging to |loop| if it appears in the graph +// starting at |node| or null if it doesn't. +SERecurrentNode* ScalarEvolutionAnalysis::GetRecurrentTerm( + SENode* node, const ir::Loop* loop) { + for (auto itr = node->graph_begin(); itr != node->graph_end(); ++itr) { + SERecurrentNode* rec = itr->AsSERecurrentNode(); + if (rec && rec->GetLoop() == loop) { + return rec; + } + } + return nullptr; +} +std::string SENode::AsString() const { + switch (GetType()) { + case Constant: + return "Constant"; + case RecurrentAddExpr: + return "RecurrentAddExpr"; + case Add: + return "Add"; + case Negative: + return "Negative"; + case Multiply: + return "Multiply"; + case ValueUnknown: + return "Value Unknown"; + case CanNotCompute: + return "Can not compute"; + } + return "NULL"; +} + +bool SENode::operator==(const SENode& other) const { + if (GetType() != other.GetType()) return false; + + if (other.GetChildren().size() != children_.size()) return false; + + const SERecurrentNode* this_as_recurrent = AsSERecurrentNode(); + + // Check the children are the same, for SERecurrentNodes we need to check the + // offset and coefficient manually as the child vector is sorted by ids so the + // offset/coefficient information is lost. + if (!this_as_recurrent) { + for (size_t index = 0; index < children_.size(); ++index) { + if (other.GetChildren()[index] != children_[index]) return false; + } + } else { + const SERecurrentNode* other_as_recurrent = other.AsSERecurrentNode(); + + // We've already checked the types are the same, this should not fail if + // this->AsSERecurrentNode() succeeded. + assert(other_as_recurrent); + + if (this_as_recurrent->GetCoefficient() != + other_as_recurrent->GetCoefficient()) + return false; + + if (this_as_recurrent->GetOffset() != other_as_recurrent->GetOffset()) + return false; + + if (this_as_recurrent->GetLoop() != other_as_recurrent->GetLoop()) + return false; + } + + // If we're dealing with a value unknown node check both nodes were created by + // the same instruction. + if (GetType() == SENode::ValueUnknown) { + if (AsSEValueUnknown()->ResultId() != + other.AsSEValueUnknown()->ResultId()) { + return false; + } + } + + if (AsSEConstantNode()) { + if (AsSEConstantNode()->FoldToSingleValue() != + other.AsSEConstantNode()->FoldToSingleValue()) + return false; + } + + return true; +} + +bool SENode::operator!=(const SENode& other) const { return !(*this == other); } + +namespace { +// Helper functions to insert 32/64 bit values into the 32 bit hash string. This +// allows us to add pointers to the string by reinterpreting the pointers as +// uintptr_t. PushToString will deduce the type, call sizeof on it and use +// that size to call into the correct PushToStringImpl functor depending on +// whether it is 32 or 64 bit. + +template +struct PushToStringImpl; + +template +struct PushToStringImpl { + void operator()(T id, std::u32string* str) { + str->push_back(static_cast(id >> 32)); + str->push_back(static_cast(id)); + } +}; + +template +struct PushToStringImpl { + void operator()(T id, std::u32string* str) { + str->push_back(static_cast(id)); + } +}; + +template +static void PushToString(T id, std::u32string* str) { + PushToStringImpl{}(id, str); +} + +} // namespace + +// Implements the hashing of SENodes. +size_t SENodeHash::operator()(const SENode* node) const { + // Concatinate the terms into a string which we can hash. + std::u32string hash_string{}; + + // Hashing the type as a string is safer than hashing the enum as the enum is + // very likely to collide with constants. + for (char ch : node->AsString()) { + hash_string.push_back(static_cast(ch)); + } + + // We just ignore the literal value unless it is a constant. + if (node->GetType() == SENode::Constant) + PushToString(node->AsSEConstantNode()->FoldToSingleValue(), &hash_string); + + const SERecurrentNode* recurrent = node->AsSERecurrentNode(); + + // If we're dealing with a recurrent expression hash the loop as well so that + // nested inductions like i=0,i++ and j=0,j++ correspond to different nodes. + if (recurrent) { + PushToString(reinterpret_cast(recurrent->GetLoop()), + &hash_string); + + // Recurrent expressions can't be hashed using the normal method as the + // order of coefficient and offset matters to the hash. + PushToString(reinterpret_cast(recurrent->GetCoefficient()), + &hash_string); + PushToString(reinterpret_cast(recurrent->GetOffset()), + &hash_string); + + return std::hash{}(hash_string); + } + + // Hash the result id of the original instruction which created this node if + // it is a value unknown node. + if (node->GetType() == SENode::ValueUnknown) { + PushToString(node->AsSEValueUnknown()->ResultId(), &hash_string); + } + + // Hash the pointers of the child nodes, each SENode has a unique pointer + // associated with it. + const std::vector& children = node->GetChildren(); + for (const SENode* child : children) { + PushToString(reinterpret_cast(child), &hash_string); + } + + return std::hash{}(hash_string); +} + +// This overload is the actual overload used by the node_cache_ set. +size_t SENodeHash::operator()(const std::unique_ptr& node) const { + return this->operator()(node.get()); +} + +void SENode::DumpDot(std::ostream& out, bool recurse) const { + size_t unique_id = std::hash{}(this); + out << unique_id << " [label=\"" << AsString() << " "; + if (GetType() == SENode::Constant) { + out << "\nwith value: " << this->AsSEConstantNode()->FoldToSingleValue(); + } + out << "\"]\n"; + for (const SENode* child : children_) { + size_t child_unique_id = std::hash{}(child); + out << unique_id << " -> " << child_unique_id << " \n"; + if (recurse) child->DumpDot(out, true); + } +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/scalar_analysis.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/scalar_analysis.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/scalar_analysis.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/scalar_analysis.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,156 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SOURCE_OPT_SCALAR_ANALYSIS_H_ +#define SOURCE_OPT_SCALAR_ANALYSIS_H_ + +#include +#include +#include +#include +#include +#include + +#include "opt/basic_block.h" +#include "opt/instruction.h" +#include "opt/scalar_analysis_nodes.h" + +namespace spvtools { +namespace ir { +class IRContext; +class Loop; +} // namespace ir + +namespace opt { + +// Manager for the Scalar Evolution analysis. Creates and maintains a DAG of +// scalar operations generated from analysing the use def graph from incoming +// instructions. Each node is hashed as it is added so like node (for instance, +// two induction variables i=0,i++ and j=0,j++) become the same node. After +// creating a DAG with AnalyzeInstruction it can the be simplified into a more +// usable form with SimplifyExpression. +class ScalarEvolutionAnalysis { + public: + explicit ScalarEvolutionAnalysis(ir::IRContext* context); + + // Create a unary negative node on |operand|. + SENode* CreateNegation(SENode* operand); + + // Creates a subtraction between the two operands by adding |operand_1| to the + // negation of |operand_2|. + SENode* CreateSubtraction(SENode* operand_1, SENode* operand_2); + + // Create an addition node between two operands. The |simplify| when set will + // allow the function to return an SEConstant instead of an addition if the + // two input operands are also constant. + SENode* CreateAddNode(SENode* operand_1, SENode* operand_2); + + // Create a multiply node between two operands. + SENode* CreateMultiplyNode(SENode* operand_1, SENode* operand_2); + + // Create a node representing a constant integer. + SENode* CreateConstant(int64_t integer); + + // Create a value unknown node, such as a load. + SENode* CreateValueUnknownNode(const ir::Instruction* inst); + + // Create a CantComputeNode. Used to exit out of analysis. + SENode* CreateCantComputeNode(); + + // Create a new recurrent node with |offset| and |coefficient|, with respect + // to |loop|. + SENode* CreateRecurrentExpression(const ir::Loop* loop, SENode* offset, + SENode* coefficient); + + // Construct the DAG by traversing use def chain of |inst|. + SENode* AnalyzeInstruction(const ir::Instruction* inst); + + // Simplify the |node| by grouping like terms or if contains a recurrent + // expression, rewrite the graph so the whole DAG (from |node| down) is in + // terms of that recurrent expression. + // + // For example. + // Induction variable i=0, i++ would produce Rec(0,1) so i+1 could be + // transformed into Rec(1,1). + // + // X+X*2+Y-Y+34-17 would be transformed into 3*X + 17, where X and Y are + // ValueUnknown nodes (such as a load instruction). + SENode* SimplifyExpression(SENode* node); + + // Add |prospective_node| into the cache and return a raw pointer to it. If + // |prospective_node| is already in the cache just return the raw pointer. + SENode* GetCachedOrAdd(std::unique_ptr prospective_node); + + // Checks that the graph starting from |node| is invariant to the |loop|. + bool IsLoopInvariant(const ir::Loop* loop, const SENode* node) const; + + // Find the recurrent term belonging to |loop| in the graph starting from + // |node| and return the coefficient of that recurrent term. Constant zero + // will be returned if no recurrent could be found. |node| should be in + // simplest form. + SENode* GetCoefficientFromRecurrentTerm(SENode* node, const ir::Loop* loop); + + // Return a rebuilt graph starting from |node| with the recurrent expression + // belonging to |loop| being zeroed out. Returned node will be simplified. + SENode* BuildGraphWithoutRecurrentTerm(SENode* node, const ir::Loop* loop); + + // Return the recurrent term belonging to |loop| if it appears in the graph + // starting at |node| or null if it doesn't. + SERecurrentNode* GetRecurrentTerm(SENode* node, const ir::Loop* loop); + + SENode* UpdateChildNode(SENode* parent, SENode* child, SENode* new_child); + + private: + SENode* AnalyzeConstant(const ir::Instruction* inst); + + // Handles both addition and subtraction. If the |instruction| is OpISub + // then the resulting node will be op1+(-op2) otherwise if it is OpIAdd then + // the result will be op1+op2. |instruction| must be OpIAdd or OpISub. + SENode* AnalyzeAddOp(const ir::Instruction* instruction); + + SENode* AnalyzeMultiplyOp(const ir::Instruction* multiply); + + SENode* AnalyzePhiInstruction(const ir::Instruction* phi); + + ir::IRContext* context_; + + // A map of instructions to SENodes. This is used to track recurrent + // expressions as they are added when analyzing instructions. Recurrent + // expressions come from phi nodes which by nature can include recursion so we + // check if nodes have already been built when analyzing instructions. + std::map recurrent_node_map_; + + // On creation we create and cache the CantCompute node so we not need to + // perform a needless create step. + SENode* cached_cant_compute_; + + // Helper functor to allow two unique_ptr to nodes to be compare. Only + // needed + // for the unordered_set implementation. + struct NodePointersEquality { + bool operator()(const std::unique_ptr& lhs, + const std::unique_ptr& rhs) const { + return *lhs == *rhs; + } + }; + + // Cache of nodes. All pointers to the nodes are references to the memory + // managed by they set. + std::unordered_set, SENodeHash, NodePointersEquality> + node_cache_; +}; + +} // namespace opt +} // namespace spvtools +#endif // SOURCE_OPT_SCALAR_ANALYSIS_H__ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/scalar_analysis_nodes.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/scalar_analysis_nodes.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/scalar_analysis_nodes.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/scalar_analysis_nodes.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,313 @@ +// Copyright (c) 2018 Google LLC. +// +// 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" BASI, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SOURCE_OPT_SCALAR_ANALYSIS_NODES_H_ +#define SOURCE_OPT_SCALAR_ANALYSIS_NODES_H_ + +#include +#include +#include +#include +#include "opt/tree_iterator.h" + +namespace spvtools { +namespace ir { +class Loop; +} // namespace ir + +namespace opt { + +class ScalarEvolutionAnalysis; +class SEConstantNode; +class SERecurrentNode; +class SEAddNode; +class SEMultiplyNode; +class SENegative; +class SEValueUnknown; +class SECantCompute; + +// Abstract class representing a node in the scalar evolution DAG. Each node +// contains a vector of pointers to its children and each subclass of SENode +// implements GetType and an As method to allow casting. SENodes can be hashed +// using the SENodeHash functor. The vector of children is sorted when a node is +// added. This is important as it allows the hash of X+Y to be the same as Y+X. +class SENode { + public: + enum SENodeType { + Constant, + RecurrentAddExpr, + Add, + Multiply, + Negative, + ValueUnknown, + CanNotCompute + }; + + using ChildContainerType = std::vector; + + explicit SENode(opt::ScalarEvolutionAnalysis* parent_analysis) + : parent_analysis_(parent_analysis), unique_id_(++NumberOfNodes) {} + + virtual SENodeType GetType() const = 0; + + virtual ~SENode() {} + + virtual inline void AddChild(SENode* child) { + // If this is a constant node, assert. + if (AsSEConstantNode()) { + assert(false && "Trying to add a child node to a constant!"); + } + + // Find the first point in the vector where |child| is greater than the node + // currently in the vector. + auto find_first_less_than = [child](const SENode* node) { + return child->unique_id_ <= node->unique_id_; + }; + + auto position = std::find_if_not(children_.begin(), children_.end(), + find_first_less_than); + // Children are sorted so the hashing and equality operator will be the same + // for a node with the same children. X+Y should be the same as Y+X. + children_.insert(position, child); + } + + // Get the type as an std::string. This is used to represent the node in the + // dot output and is used to hash the type as well. + std::string AsString() const; + + // Dump the SENode and its immediate children, if |recurse| is true then it + // will recurse through all children to print the DAG starting from this node + // as a root. + void DumpDot(std::ostream& out, bool recurse = false) const; + + // Checks if two nodes are the same by hashing them. + bool operator==(const SENode& other) const; + + // Checks if two nodes are not the same by comparing the hashes. + bool operator!=(const SENode& other) const; + + // Return the child node at |index|. + inline SENode* GetChild(size_t index) { return children_[index]; } + inline const SENode* GetChild(size_t index) const { return children_[index]; } + + // Iterator to iterate over the child nodes. + using iterator = ChildContainerType::iterator; + using const_iterator = ChildContainerType::const_iterator; + + // Iterate over immediate child nodes. + iterator begin() { return children_.begin(); } + iterator end() { return children_.end(); } + + // Constant overloads for iterating over immediate child nodes. + const_iterator begin() const { return children_.cbegin(); } + const_iterator end() const { return children_.cend(); } + const_iterator cbegin() { return children_.cbegin(); } + const_iterator cend() { return children_.cend(); } + + // Iterator to iterate over the entire DAG. Even though we are using the tree + // iterator it should still be safe to iterate over. However, nodes with + // multiple parents will be visited multiple times, unlike in a tree. + using dag_iterator = TreeDFIterator; + using const_dag_iterator = TreeDFIterator; + + // Iterate over all child nodes in the graph. + dag_iterator graph_begin() { return dag_iterator(this); } + dag_iterator graph_end() { return dag_iterator(); } + const_dag_iterator graph_begin() const { return graph_cbegin(); } + const_dag_iterator graph_end() const { return graph_cend(); } + const_dag_iterator graph_cbegin() const { return const_dag_iterator(this); } + const_dag_iterator graph_cend() const { return const_dag_iterator(); } + + // Return the vector of immediate children. + const ChildContainerType& GetChildren() const { return children_; } + ChildContainerType& GetChildren() { return children_; } + + // Return true if this node is a cant compute node. + bool IsCantCompute() const { return GetType() == CanNotCompute; } + +// Implements a casting method for each type. +#define DeclareCastMethod(target) \ + virtual target* As##target() { return nullptr; } \ + virtual const target* As##target() const { return nullptr; } + DeclareCastMethod(SEConstantNode); + DeclareCastMethod(SERecurrentNode); + DeclareCastMethod(SEAddNode); + DeclareCastMethod(SEMultiplyNode); + DeclareCastMethod(SENegative); + DeclareCastMethod(SEValueUnknown); + DeclareCastMethod(SECantCompute); +#undef DeclareCastMethod + + // Get the analysis which has this node in its cache. + inline opt::ScalarEvolutionAnalysis* GetParentAnalysis() const { + return parent_analysis_; + } + + protected: + ChildContainerType children_; + + opt::ScalarEvolutionAnalysis* parent_analysis_; + + // The unique id of this node, assigned on creation by incrementing the static + // node count. + uint32_t unique_id_; + + // The number of nodes created. + static uint32_t NumberOfNodes; +}; + +// Function object to handle the hashing of SENodes. Hashing algorithm hashes +// the type (as a string), the literal value of any constants, and the child +// pointers which are assumed to be unique. +struct SENodeHash { + size_t operator()(const std::unique_ptr& node) const; + size_t operator()(const SENode* node) const; +}; + +// A node representing a constant integer. +class SEConstantNode : public SENode { + public: + SEConstantNode(opt::ScalarEvolutionAnalysis* parent_analysis, int64_t value) + : SENode(parent_analysis), literal_value_(value) {} + + SENodeType GetType() const final { return Constant; } + + int64_t FoldToSingleValue() const { return literal_value_; } + + SEConstantNode* AsSEConstantNode() override { return this; } + const SEConstantNode* AsSEConstantNode() const override { return this; } + + inline void AddChild(SENode*) final { + assert(false && "Attempting to add a child to a constant node!"); + } + + protected: + int64_t literal_value_; +}; + +// A node representing a recurrent expression in the code. A recurrent +// expression is an expression whose value can be expressed as a linear +// expression of the loop iterations. Such as an induction variable. The actual +// value of a recurrent expression is coefficent_ * iteration + offset_, hence +// an induction variable i=0, i++ becomes a recurrent expression with an offset +// of zero and a coefficient of one. +class SERecurrentNode : public SENode { + public: + SERecurrentNode(opt::ScalarEvolutionAnalysis* parent_analysis, + const ir::Loop* loop) + : SENode(parent_analysis), loop_(loop) {} + + SENodeType GetType() const final { return RecurrentAddExpr; } + + inline void AddCoefficient(SENode* child) { + coefficient_ = child; + SENode::AddChild(child); + } + + inline void AddOffset(SENode* child) { + offset_ = child; + SENode::AddChild(child); + } + + inline const SENode* GetCoefficient() const { return coefficient_; } + inline SENode* GetCoefficient() { return coefficient_; } + + inline const SENode* GetOffset() const { return offset_; } + inline SENode* GetOffset() { return offset_; } + + // Return the loop which this recurrent expression is recurring within. + const ir::Loop* GetLoop() const { return loop_; } + + SERecurrentNode* AsSERecurrentNode() override { return this; } + const SERecurrentNode* AsSERecurrentNode() const override { return this; } + + private: + SENode* coefficient_; + SENode* offset_; + const ir::Loop* loop_; +}; + +// A node representing an addition operation between child nodes. +class SEAddNode : public SENode { + public: + explicit SEAddNode(opt::ScalarEvolutionAnalysis* parent_analysis) + : SENode(parent_analysis) {} + + SENodeType GetType() const final { return Add; } + + SEAddNode* AsSEAddNode() override { return this; } + const SEAddNode* AsSEAddNode() const override { return this; } +}; + +// A node representing a multiply operation between child nodes. +class SEMultiplyNode : public SENode { + public: + explicit SEMultiplyNode(opt::ScalarEvolutionAnalysis* parent_analysis) + : SENode(parent_analysis) {} + + SENodeType GetType() const final { return Multiply; } + + SEMultiplyNode* AsSEMultiplyNode() override { return this; } + const SEMultiplyNode* AsSEMultiplyNode() const override { return this; } +}; + +// A node representing a unary negative operation. +class SENegative : public SENode { + public: + explicit SENegative(opt::ScalarEvolutionAnalysis* parent_analysis) + : SENode(parent_analysis) {} + + SENodeType GetType() const final { return Negative; } + + SENegative* AsSENegative() override { return this; } + const SENegative* AsSENegative() const override { return this; } +}; + +// A node representing a value which we do not know the value of, such as a load +// instruction. +class SEValueUnknown : public SENode { + public: + // SEValueUnknowns must come from an instruction |unique_id| is the unique id + // of that instruction. This is so we cancompare value unknowns and have a + // unique value unknown for each instruction. + SEValueUnknown(opt::ScalarEvolutionAnalysis* parent_analysis, + uint32_t result_id) + : SENode(parent_analysis), result_id_(result_id) {} + + SENodeType GetType() const final { return ValueUnknown; } + + SEValueUnknown* AsSEValueUnknown() override { return this; } + const SEValueUnknown* AsSEValueUnknown() const override { return this; } + + inline uint32_t ResultId() const { return result_id_; } + + private: + uint32_t result_id_; +}; + +// A node which we cannot reason about at all. +class SECantCompute : public SENode { + public: + explicit SECantCompute(opt::ScalarEvolutionAnalysis* parent_analysis) + : SENode(parent_analysis) {} + + SENodeType GetType() const final { return CanNotCompute; } + + SECantCompute* AsSECantCompute() override { return this; } + const SECantCompute* AsSECantCompute() const override { return this; } +}; + +} // namespace opt +} // namespace spvtools +#endif // SOURCE_OPT_SCALAR_ANALYSIS_NODES_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/scalar_analysis_simplification.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/scalar_analysis_simplification.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/scalar_analysis_simplification.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/scalar_analysis_simplification.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,539 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "opt/scalar_analysis.h" + +#include +#include +#include +#include +#include +#include +#include + +// Simplifies scalar analysis DAGs. +// +// 1. Given a node passed to SimplifyExpression we first simplify the graph by +// calling SimplifyPolynomial. This groups like nodes following basic arithmetic +// rules, so multiple adds of the same load instruction could be grouped into a +// single multiply of that instruction. SimplifyPolynomial will traverse the DAG +// and build up an accumulator buffer for each class of instruction it finds. +// For example take the loop: +// for (i=0, i accumulators_; +}; + +// From a |multiply| build up the accumulator objects. +bool SENodeSimplifyImpl::AccumulatorsFromMultiply(SENode* multiply, + bool negation) { + if (multiply->GetChildren().size() != 2 || + multiply->GetType() != SENode::Multiply) + return false; + + SENode* operand_1 = multiply->GetChild(0); + SENode* operand_2 = multiply->GetChild(1); + + SENode* value_unknown = nullptr; + SENode* constant = nullptr; + + // Work out which operand is the unknown value. + if (operand_1->GetType() == SENode::ValueUnknown || + operand_1->GetType() == SENode::RecurrentAddExpr) + value_unknown = operand_1; + else if (operand_2->GetType() == SENode::ValueUnknown || + operand_2->GetType() == SENode::RecurrentAddExpr) + value_unknown = operand_2; + + // Work out which operand is the constant coefficient. + if (operand_1->GetType() == SENode::Constant) + constant = operand_1; + else if (operand_2->GetType() == SENode::Constant) + constant = operand_2; + + // If the expression is not a variable multiplied by a constant coefficient, + // exit out. + if (!(value_unknown && constant)) { + return false; + } + + int64_t sign = negation ? -1 : 1; + + auto iterator = accumulators_.find(value_unknown); + int64_t new_value = constant->AsSEConstantNode()->FoldToSingleValue() * sign; + // Add the result of the multiplication to the accumulators. + if (iterator != accumulators_.end()) { + (*iterator).second += new_value; + } else { + accumulators_.insert({value_unknown, new_value}); + } + + return true; +} + +SENode* SENodeSimplifyImpl::Simplify() { + // We only handle graphs with an addition, multiplication, or negation, at the + // root. + if (node_->GetType() != SENode::Add && node_->GetType() != SENode::Multiply && + node_->GetType() != SENode::Negative) + return node_; + + SENode* simplified_polynomial = SimplifyPolynomial(); + + SERecurrentNode* recurrent_expr = nullptr; + node_ = simplified_polynomial; + + // Fold recurrent expressions which are with respect to the same loop into a + // single recurrent expression. + simplified_polynomial = FoldRecurrentAddExpressions(simplified_polynomial); + + simplified_polynomial = + EliminateZeroCoefficientRecurrents(simplified_polynomial); + + // Traverse the immediate children of the new node to find the recurrent + // expression. If there is more than one there is nothing further we can do. + for (SENode* child : simplified_polynomial->GetChildren()) { + if (child->GetType() == SENode::RecurrentAddExpr) { + recurrent_expr = child->AsSERecurrentNode(); + } + } + + // We need to count the number of unique recurrent expressions in the DAG to + // ensure there is only one. + for (auto child_iterator = simplified_polynomial->graph_begin(); + child_iterator != simplified_polynomial->graph_end(); ++child_iterator) { + if (child_iterator->GetType() == SENode::RecurrentAddExpr && + recurrent_expr != child_iterator->AsSERecurrentNode()) { + return simplified_polynomial; + } + } + + if (recurrent_expr) { + return SimplifyRecurrentAddExpression(recurrent_expr); + } + + return simplified_polynomial; +} + +// Traverse the graph to build up the accumulator objects. +void SENodeSimplifyImpl::GatherAccumulatorsFromChildNodes(SENode* new_node, + SENode* child, + bool negation) { + int32_t sign = negation ? -1 : 1; + + if (child->GetType() == SENode::Constant) { + // Collect all the constants and add them together. + constant_accumulator_ += + child->AsSEConstantNode()->FoldToSingleValue() * sign; + + } else if (child->GetType() == SENode::ValueUnknown || + child->GetType() == SENode::RecurrentAddExpr) { + // To rebuild the graph of X+X+X*2 into 4*X we count the occurrences of X + // and create a new node of count*X after. X can either be a ValueUnknown or + // a RecurrentAddExpr. The count for each X is stored in the accumulators_ + // map. + + auto iterator = accumulators_.find(child); + // If we've encountered this term before add to the accumulator for it. + if (iterator == accumulators_.end()) + accumulators_.insert({child, sign}); + else + iterator->second += sign; + + } else if (child->GetType() == SENode::Multiply) { + if (!AccumulatorsFromMultiply(child, negation)) { + new_node->AddChild(child); + } + + } else if (child->GetType() == SENode::Add) { + for (SENode* next_child : *child) { + GatherAccumulatorsFromChildNodes(new_node, next_child, negation); + } + + } else if (child->GetType() == SENode::Negative) { + SENode* negated_node = child->GetChild(0); + GatherAccumulatorsFromChildNodes(new_node, negated_node, !negation); + } else { + // If we can't work out how to fold the expression just add it back into + // the graph. + new_node->AddChild(child); + } +} + +SERecurrentNode* SENodeSimplifyImpl::UpdateCoefficient( + SERecurrentNode* recurrent, int64_t coefficient_update) const { + std::unique_ptr new_recurrent_node{new SERecurrentNode( + recurrent->GetParentAnalysis(), recurrent->GetLoop())}; + + SENode* new_coefficient = analysis_.CreateMultiplyNode( + recurrent->GetCoefficient(), + analysis_.CreateConstant(coefficient_update)); + + // See if the node can be simplified. + SENode* simplified = analysis_.SimplifyExpression(new_coefficient); + if (simplified->GetType() != SENode::CanNotCompute) + new_coefficient = simplified; + + if (coefficient_update < 0) { + new_recurrent_node->AddOffset( + analysis_.CreateNegation(recurrent->GetOffset())); + } else { + new_recurrent_node->AddOffset(recurrent->GetOffset()); + } + + new_recurrent_node->AddCoefficient(new_coefficient); + + return analysis_.GetCachedOrAdd(std::move(new_recurrent_node)) + ->AsSERecurrentNode(); +} + +// Simplify all the terms in the polynomial function. +SENode* SENodeSimplifyImpl::SimplifyPolynomial() { + std::unique_ptr new_add{new SEAddNode(node_->GetParentAnalysis())}; + + // Traverse the graph and gather the accumulators from it. + GatherAccumulatorsFromChildNodes(new_add.get(), node_, false); + + // Fold all the constants into a single constant node. + if (constant_accumulator_ != 0) { + new_add->AddChild(analysis_.CreateConstant(constant_accumulator_)); + } + + for (auto& pair : accumulators_) { + SENode* term = pair.first; + int64_t count = pair.second; + + // We can eliminate the term completely. + if (count == 0) continue; + + if (count == 1) { + new_add->AddChild(term); + } else if (count == -1 && term->GetType() != SENode::RecurrentAddExpr) { + // If the count is -1 we can just add a negative version of that node, + // unless it is a recurrent expression as we would rather the negative + // goes on the recurrent expressions children. This makes it easier to + // work with in other places. + new_add->AddChild(analysis_.CreateNegation(term)); + } else { + // Output value unknown terms as count*term and output recurrent + // expression terms as rec(offset, coefficient + count) offset and + // coefficient are the same as in the original expression. + if (term->GetType() == SENode::ValueUnknown) { + SENode* count_as_constant = analysis_.CreateConstant(count); + new_add->AddChild( + analysis_.CreateMultiplyNode(count_as_constant, term)); + } else { + assert(term->GetType() == SENode::RecurrentAddExpr && + "We only handle value unknowns or recurrent expressions"); + + // Create a new recurrent expression by adding the count to the + // coefficient of the old one. + new_add->AddChild(UpdateCoefficient(term->AsSERecurrentNode(), count)); + } + } + } + + // If there is only one term in the addition left just return that term. + if (new_add->GetChildren().size() == 1) { + return new_add->GetChild(0); + } + + // If there are no terms left in the addition just return 0. + if (new_add->GetChildren().size() == 0) { + return analysis_.CreateConstant(0); + } + + return analysis_.GetCachedOrAdd(std::move(new_add)); +} + +SENode* SENodeSimplifyImpl::FoldRecurrentAddExpressions(SENode* root) { + std::unique_ptr new_node{new SEAddNode(&analysis_)}; + + // A mapping of loops to the list of recurrent expressions which are with + // respect to those loops. + std::map>> + loops_to_recurrent{}; + + bool has_multiple_same_loop_recurrent_terms = false; + + for (SENode* child : *root) { + bool negation = false; + + if (child->GetType() == SENode::Negative) { + child = child->GetChild(0); + negation = true; + } + + if (child->GetType() == SENode::RecurrentAddExpr) { + const ir::Loop* loop = child->AsSERecurrentNode()->GetLoop(); + + SERecurrentNode* rec = child->AsSERecurrentNode(); + if (loops_to_recurrent.find(loop) == loops_to_recurrent.end()) { + loops_to_recurrent[loop] = {std::make_pair(rec, negation)}; + } else { + loops_to_recurrent[loop].push_back(std::make_pair(rec, negation)); + has_multiple_same_loop_recurrent_terms = true; + } + } else { + new_node->AddChild(child); + } + } + + if (!has_multiple_same_loop_recurrent_terms) return root; + + for (auto pair : loops_to_recurrent) { + std::vector>& recurrent_expressions = + pair.second; + const ir::Loop* loop = pair.first; + + std::unique_ptr new_coefficient{new SEAddNode(&analysis_)}; + std::unique_ptr new_offset{new SEAddNode(&analysis_)}; + + for (auto node_pair : recurrent_expressions) { + SERecurrentNode* node = node_pair.first; + bool negative = node_pair.second; + + if (!negative) { + new_coefficient->AddChild(node->GetCoefficient()); + new_offset->AddChild(node->GetOffset()); + } else { + new_coefficient->AddChild( + analysis_.CreateNegation(node->GetCoefficient())); + new_offset->AddChild(analysis_.CreateNegation(node->GetOffset())); + } + } + + std::unique_ptr new_recurrent{ + new SERecurrentNode(&analysis_, loop)}; + + SENode* new_coefficient_simplified = + analysis_.SimplifyExpression(new_coefficient.get()); + + SENode* new_offset_simplified = + analysis_.SimplifyExpression(new_offset.get()); + + if (new_coefficient_simplified->GetType() == SENode::Constant && + new_coefficient_simplified->AsSEConstantNode()->FoldToSingleValue() == + 0) { + return new_offset_simplified; + } + + new_recurrent->AddCoefficient(new_coefficient_simplified); + new_recurrent->AddOffset(new_offset_simplified); + + new_node->AddChild(analysis_.GetCachedOrAdd(std::move(new_recurrent))); + } + + // If we only have one child in the add just return that. + if (new_node->GetChildren().size() == 1) { + return new_node->GetChild(0); + } + + return analysis_.GetCachedOrAdd(std::move(new_node)); +} + +SENode* SENodeSimplifyImpl::EliminateZeroCoefficientRecurrents(SENode* node) { + if (node->GetType() != SENode::Add) return node; + + bool has_change = false; + + std::vector new_children{}; + for (SENode* child : *node) { + if (child->GetType() == SENode::RecurrentAddExpr) { + SENode* coefficient = child->AsSERecurrentNode()->GetCoefficient(); + // If coefficient is zero then we can eliminate the recurrent expression + // entirely and just return the offset as the recurrent expression is + // representing the equation coefficient*iterations + offset. + if (coefficient->GetType() == SENode::Constant && + coefficient->AsSEConstantNode()->FoldToSingleValue() == 0) { + new_children.push_back(child->AsSERecurrentNode()->GetOffset()); + has_change = true; + } else { + new_children.push_back(child); + } + } else { + new_children.push_back(child); + } + } + + if (!has_change) return node; + + std::unique_ptr new_add{new SEAddNode(node_->GetParentAnalysis())}; + + for (SENode* child : new_children) { + new_add->AddChild(child); + } + + return analysis_.GetCachedOrAdd(std::move(new_add)); +} + +SENode* SENodeSimplifyImpl::SimplifyRecurrentAddExpression( + SERecurrentNode* recurrent_expr) { + const std::vector& children = node_->GetChildren(); + + std::unique_ptr recurrent_node{new SERecurrentNode( + recurrent_expr->GetParentAnalysis(), recurrent_expr->GetLoop())}; + + // Create and simplify the new offset node. + std::unique_ptr new_offset{ + new SEAddNode(recurrent_expr->GetParentAnalysis())}; + new_offset->AddChild(recurrent_expr->GetOffset()); + + for (SENode* child : children) { + if (child->GetType() != SENode::RecurrentAddExpr) { + new_offset->AddChild(child); + } + } + + // Simplify the new offset. + SENode* simplified_child = analysis_.SimplifyExpression(new_offset.get()); + + // If the child can be simplified, add the simplified form otherwise, add it + // via the usual caching mechanism. + if (simplified_child->GetType() != SENode::CanNotCompute) { + recurrent_node->AddOffset(simplified_child); + } else { + recurrent_expr->AddOffset(analysis_.GetCachedOrAdd(std::move(new_offset))); + } + + recurrent_node->AddCoefficient(recurrent_expr->GetCoefficient()); + + return analysis_.GetCachedOrAdd(std::move(recurrent_node)); +} + +/* + * Scalar Analysis simplification public methods. + */ + +SENode* ScalarEvolutionAnalysis::SimplifyExpression(SENode* node) { + SENodeSimplifyImpl impl{this, node}; + + return impl.Simplify(); +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/scalar_replacement_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/scalar_replacement_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/scalar_replacement_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/scalar_replacement_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,694 @@ +// Copyright (c) 2017 Google 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. + +#include "scalar_replacement_pass.h" + +#include "enum_string_mapping.h" +#include "extensions.h" +#include "make_unique.h" +#include "reflect.h" +#include "types.h" + +#include +#include + +namespace spvtools { +namespace opt { + +// Heuristic aggregate element limit. +const uint32_t MAX_NUM_ELEMENTS = 100u; + +Pass::Status ScalarReplacementPass::Process(ir::IRContext* c) { + InitializeProcessing(c); + + Status status = Status::SuccessWithoutChange; + for (auto& f : *get_module()) { + Status functionStatus = ProcessFunction(&f); + if (functionStatus == Status::Failure) + return functionStatus; + else if (functionStatus == Status::SuccessWithChange) + status = functionStatus; + } + + return status; +} + +Pass::Status ScalarReplacementPass::ProcessFunction(ir::Function* function) { + std::queue worklist; + ir::BasicBlock& entry = *function->begin(); + for (auto iter = entry.begin(); iter != entry.end(); ++iter) { + // Function storage class OpVariables must appear as the first instructions + // of the entry block. + if (iter->opcode() != SpvOpVariable) break; + + ir::Instruction* varInst = &*iter; + if (CanReplaceVariable(varInst)) { + worklist.push(varInst); + } + } + + Status status = Status::SuccessWithoutChange; + while (!worklist.empty()) { + ir::Instruction* varInst = worklist.front(); + worklist.pop(); + + if (!ReplaceVariable(varInst, &worklist)) + return Status::Failure; + else + status = Status::SuccessWithChange; + } + + return status; +} + +bool ScalarReplacementPass::ReplaceVariable( + ir::Instruction* inst, std::queue* worklist) { + std::vector replacements; + CreateReplacementVariables(inst, &replacements); + + std::vector dead; + dead.push_back(inst); + if (!get_def_use_mgr()->WhileEachUser( + inst, [this, &replacements, &dead](ir::Instruction* user) { + if (!ir::IsAnnotationInst(user->opcode())) { + switch (user->opcode()) { + case SpvOpLoad: + ReplaceWholeLoad(user, replacements); + dead.push_back(user); + break; + case SpvOpStore: + ReplaceWholeStore(user, replacements); + dead.push_back(user); + break; + case SpvOpAccessChain: + case SpvOpInBoundsAccessChain: + if (!ReplaceAccessChain(user, replacements)) return false; + dead.push_back(user); + break; + case SpvOpName: + case SpvOpMemberName: + break; + default: + assert(false && "Unexpected opcode"); + break; + } + } + return true; + })) + return false; + + // Clean up some dead code. + while (!dead.empty()) { + ir::Instruction* toKill = dead.back(); + dead.pop_back(); + + context()->KillInst(toKill); + } + + // Attempt to further scalarize. + for (auto var : replacements) { + if (get_def_use_mgr()->NumUsers(var) == 0) { + context()->KillInst(var); + } else if (CanReplaceVariable(var)) { + worklist->push(var); + } + } + + return true; +} + +void ScalarReplacementPass::ReplaceWholeLoad( + ir::Instruction* load, const std::vector& replacements) { + // Replaces the load of the entire composite with a load from each replacement + // variable followed by a composite construction. + ir::BasicBlock* block = context()->get_instr_block(load); + std::vector loads; + loads.reserve(replacements.size()); + ir::BasicBlock::iterator where(load); + for (auto var : replacements) { + // Create a load of each replacement variable. + ir::Instruction* type = GetStorageType(var); + uint32_t loadId = TakeNextId(); + std::unique_ptr newLoad( + new ir::Instruction(context(), SpvOpLoad, type->result_id(), loadId, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {var->result_id()}}})); + // Copy memory access attributes which start at index 1. Index 0 is the + // pointer to load. + for (uint32_t i = 1; i < load->NumInOperands(); ++i) { + ir::Operand copy(load->GetInOperand(i)); + newLoad->AddOperand(std::move(copy)); + } + where = where.InsertBefore(std::move(newLoad)); + get_def_use_mgr()->AnalyzeInstDefUse(&*where); + context()->set_instr_block(&*where, block); + loads.push_back(&*where); + } + + // Construct a new composite. + uint32_t compositeId = TakeNextId(); + where = load; + std::unique_ptr compositeConstruct(new ir::Instruction( + context(), SpvOpCompositeConstruct, load->type_id(), compositeId, {})); + for (auto l : loads) { + ir::Operand op(SPV_OPERAND_TYPE_ID, + std::initializer_list{l->result_id()}); + compositeConstruct->AddOperand(std::move(op)); + } + where = where.InsertBefore(std::move(compositeConstruct)); + get_def_use_mgr()->AnalyzeInstDefUse(&*where); + context()->set_instr_block(&*where, block); + context()->ReplaceAllUsesWith(load->result_id(), compositeId); +} + +void ScalarReplacementPass::ReplaceWholeStore( + ir::Instruction* store, const std::vector& replacements) { + // Replaces a store to the whole composite with a series of extract and stores + // to each element. + uint32_t storeInput = store->GetSingleWordInOperand(1u); + ir::BasicBlock* block = context()->get_instr_block(store); + ir::BasicBlock::iterator where(store); + uint32_t elementIndex = 0; + for (auto var : replacements) { + // Create the extract. + ir::Instruction* type = GetStorageType(var); + uint32_t extractId = TakeNextId(); + std::unique_ptr extract(new ir::Instruction( + context(), SpvOpCompositeExtract, type->result_id(), extractId, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {storeInput}}, + {SPV_OPERAND_TYPE_LITERAL_INTEGER, {elementIndex++}}})); + auto iter = where.InsertBefore(std::move(extract)); + get_def_use_mgr()->AnalyzeInstDefUse(&*iter); + context()->set_instr_block(&*iter, block); + + // Create the store. + std::unique_ptr newStore( + new ir::Instruction(context(), SpvOpStore, 0, 0, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {var->result_id()}}, + {SPV_OPERAND_TYPE_ID, {extractId}}})); + // Copy memory access attributes which start at index 2. Index 0 is the + // pointer and index 1 is the data. + for (uint32_t i = 2; i < store->NumInOperands(); ++i) { + ir::Operand copy(store->GetInOperand(i)); + newStore->AddOperand(std::move(copy)); + } + iter = where.InsertBefore(std::move(newStore)); + get_def_use_mgr()->AnalyzeInstDefUse(&*iter); + context()->set_instr_block(&*iter, block); + } +} + +bool ScalarReplacementPass::ReplaceAccessChain( + ir::Instruction* chain, const std::vector& replacements) { + // Replaces the access chain with either another access chain (with one fewer + // indexes) or a direct use of the replacement variable. + uint32_t indexId = chain->GetSingleWordInOperand(1u); + const ir::Instruction* index = get_def_use_mgr()->GetDef(indexId); + size_t indexValue = GetConstantInteger(index); + if (indexValue > replacements.size()) { + // Out of bounds access, this is illegal IR. + return false; + } else { + const ir::Instruction* var = replacements[indexValue]; + if (chain->NumInOperands() > 2) { + // Replace input access chain with another access chain. + ir::BasicBlock::iterator chainIter(chain); + uint32_t replacementId = TakeNextId(); + std::unique_ptr replacementChain(new ir::Instruction( + context(), chain->opcode(), chain->type_id(), replacementId, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {var->result_id()}}})); + // Add the remaining indexes. + for (uint32_t i = 2; i < chain->NumInOperands(); ++i) { + ir::Operand copy(chain->GetInOperand(i)); + replacementChain->AddOperand(std::move(copy)); + } + auto iter = chainIter.InsertBefore(std::move(replacementChain)); + get_def_use_mgr()->AnalyzeInstDefUse(&*iter); + context()->set_instr_block(&*iter, context()->get_instr_block(chain)); + context()->ReplaceAllUsesWith(chain->result_id(), replacementId); + } else { + // Replace with a use of the variable. + context()->ReplaceAllUsesWith(chain->result_id(), var->result_id()); + } + } + + return true; +} + +void ScalarReplacementPass::CreateReplacementVariables( + ir::Instruction* inst, std::vector* replacements) { + ir::Instruction* type = GetStorageType(inst); + uint32_t elem = 0; + switch (type->opcode()) { + case SpvOpTypeStruct: + type->ForEachInOperand([this, inst, &elem, replacements](uint32_t* id) { + CreateVariable(*id, inst, elem++, replacements); + }); + break; + case SpvOpTypeArray: + for (uint32_t i = 0; i != GetArrayLength(type); ++i) { + CreateVariable(type->GetSingleWordInOperand(0u), inst, i, replacements); + } + break; + + case SpvOpTypeMatrix: + case SpvOpTypeVector: + for (uint32_t i = 0; i != GetNumElements(type); ++i) { + CreateVariable(type->GetSingleWordInOperand(0u), inst, i, replacements); + } + break; + + default: + assert(false && "Unexpected type."); + break; + } + + TransferAnnotations(inst, replacements); +} + +void ScalarReplacementPass::TransferAnnotations( + const ir::Instruction* source, + std::vector* replacements) { + // Only transfer invariant and restrict decorations on the variable. There are + // no type or member decorations that are necessary to transfer. + for (auto inst : + get_decoration_mgr()->GetDecorationsFor(source->result_id(), false)) { + assert(inst->opcode() == SpvOpDecorate); + uint32_t decoration = inst->GetSingleWordInOperand(1u); + if (decoration == SpvDecorationInvariant || + decoration == SpvDecorationRestrict) { + for (auto var : *replacements) { + std::unique_ptr annotation(new ir::Instruction( + context(), SpvOpDecorate, 0, 0, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {var->result_id()}}, + {SPV_OPERAND_TYPE_DECORATION, {decoration}}})); + for (uint32_t i = 2; i < inst->NumInOperands(); ++i) { + ir::Operand copy(inst->GetInOperand(i)); + annotation->AddOperand(std::move(copy)); + } + context()->AddAnnotationInst(std::move(annotation)); + get_def_use_mgr()->AnalyzeInstUse(&*--context()->annotation_end()); + } + } + } +} + +void ScalarReplacementPass::CreateVariable( + uint32_t typeId, ir::Instruction* varInst, uint32_t index, + std::vector* replacements) { + uint32_t ptrId = GetOrCreatePointerType(typeId); + uint32_t id = TakeNextId(); + std::unique_ptr variable(new ir::Instruction( + context(), SpvOpVariable, ptrId, id, + std::initializer_list{ + {SPV_OPERAND_TYPE_STORAGE_CLASS, {SpvStorageClassFunction}}})); + + ir::BasicBlock* block = context()->get_instr_block(varInst); + block->begin().InsertBefore(std::move(variable)); + ir::Instruction* inst = &*block->begin(); + + // If varInst was initialized, make sure to initialize its replacement. + GetOrCreateInitialValue(varInst, index, inst); + get_def_use_mgr()->AnalyzeInstDefUse(inst); + context()->set_instr_block(inst, block); + + replacements->push_back(inst); +} + +uint32_t ScalarReplacementPass::GetOrCreatePointerType(uint32_t id) { + auto iter = pointee_to_pointer_.find(id); + if (iter != pointee_to_pointer_.end()) return iter->second; + + analysis::Type* pointeeTy; + std::unique_ptr pointerTy; + std::tie(pointeeTy, pointerTy) = + context()->get_type_mgr()->GetTypeAndPointerType(id, + SpvStorageClassFunction); + uint32_t ptrId = 0; + if (id == context()->get_type_mgr()->GetId(pointeeTy)) { + // Non-ambiguous type, just ask the type manager for an id. + ptrId = context()->get_type_mgr()->GetTypeInstruction(pointerTy.get()); + pointee_to_pointer_[id] = ptrId; + return ptrId; + } + + // Ambiguous type. We must perform a linear search to try and find the right + // type. + for (auto global : context()->types_values()) { + if (global.opcode() == SpvOpTypePointer && + global.GetSingleWordInOperand(0u) == SpvStorageClassFunction && + global.GetSingleWordInOperand(1u) == id) { + if (!context()->get_feature_mgr()->HasExtension( + libspirv::Extension::kSPV_KHR_variable_pointers) || + get_decoration_mgr()->GetDecorationsFor(id, false).empty()) { + // If variable pointers is enabled, only reuse a decoration-less + // pointer of the correct type. + ptrId = global.result_id(); + break; + } + } + } + + if (ptrId != 0) { + pointee_to_pointer_[id] = ptrId; + return ptrId; + } + + ptrId = TakeNextId(); + context()->AddType(MakeUnique( + context(), SpvOpTypePointer, 0, ptrId, + std::initializer_list{ + {SPV_OPERAND_TYPE_STORAGE_CLASS, {SpvStorageClassFunction}}, + {SPV_OPERAND_TYPE_ID, {id}}})); + ir::Instruction* ptr = &*--context()->types_values_end(); + get_def_use_mgr()->AnalyzeInstDefUse(ptr); + pointee_to_pointer_[id] = ptrId; + // Register with the type manager if necessary. + context()->get_type_mgr()->RegisterType(ptrId, *pointerTy); + + return ptrId; +} + +void ScalarReplacementPass::GetOrCreateInitialValue(ir::Instruction* source, + uint32_t index, + ir::Instruction* newVar) { + assert(source->opcode() == SpvOpVariable); + if (source->NumInOperands() < 2) return; + + uint32_t initId = source->GetSingleWordInOperand(1u); + uint32_t storageId = GetStorageType(newVar)->result_id(); + ir::Instruction* init = get_def_use_mgr()->GetDef(initId); + uint32_t newInitId = 0; + // TODO(dnovillo): Refactor this with constant propagation. + if (init->opcode() == SpvOpConstantNull) { + // Initialize to appropriate NULL. + auto iter = type_to_null_.find(storageId); + if (iter == type_to_null_.end()) { + newInitId = TakeNextId(); + type_to_null_[storageId] = newInitId; + context()->AddGlobalValue(MakeUnique( + context(), SpvOpConstantNull, storageId, newInitId, + std::initializer_list{})); + ir::Instruction* newNull = &*--context()->types_values_end(); + get_def_use_mgr()->AnalyzeInstDefUse(newNull); + } else { + newInitId = iter->second; + } + } else if (ir::IsSpecConstantInst(init->opcode())) { + // Create a new constant extract. + newInitId = TakeNextId(); + context()->AddGlobalValue(MakeUnique( + context(), SpvOpSpecConstantOp, storageId, newInitId, + std::initializer_list{ + {SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER, {SpvOpCompositeExtract}}, + {SPV_OPERAND_TYPE_ID, {init->result_id()}}, + {SPV_OPERAND_TYPE_LITERAL_INTEGER, {index}}})); + ir::Instruction* newSpecConst = &*--context()->types_values_end(); + get_def_use_mgr()->AnalyzeInstDefUse(newSpecConst); + } else if (init->opcode() == SpvOpConstantComposite) { + // Get the appropriate index constant. + newInitId = init->GetSingleWordInOperand(index); + ir::Instruction* element = get_def_use_mgr()->GetDef(newInitId); + if (element->opcode() == SpvOpUndef) { + // Undef is not a valid initializer for a variable. + newInitId = 0; + } + } else { + assert(false); + } + + if (newInitId != 0) { + newVar->AddOperand({SPV_OPERAND_TYPE_ID, {newInitId}}); + } +} + +size_t ScalarReplacementPass::GetIntegerLiteral(const ir::Operand& op) const { + assert(op.words.size() <= 2); + size_t len = 0; + for (uint32_t i = 0; i != op.words.size(); ++i) { + len |= (op.words[i] << (32 * i)); + } + return len; +} + +size_t ScalarReplacementPass::GetConstantInteger( + const ir::Instruction* constant) const { + assert(get_def_use_mgr()->GetDef(constant->type_id())->opcode() == + SpvOpTypeInt); + assert(constant->opcode() == SpvOpConstant || + constant->opcode() == SpvOpConstantNull); + if (constant->opcode() == SpvOpConstantNull) { + return 0; + } + + const ir::Operand& op = constant->GetInOperand(0u); + return GetIntegerLiteral(op); +} + +size_t ScalarReplacementPass::GetArrayLength( + const ir::Instruction* arrayType) const { + assert(arrayType->opcode() == SpvOpTypeArray); + const ir::Instruction* length = + get_def_use_mgr()->GetDef(arrayType->GetSingleWordInOperand(1u)); + return GetConstantInteger(length); +} + +size_t ScalarReplacementPass::GetNumElements( + const ir::Instruction* type) const { + assert(type->opcode() == SpvOpTypeVector || + type->opcode() == SpvOpTypeMatrix); + const ir::Operand& op = type->GetInOperand(1u); + assert(op.words.size() <= 2); + size_t len = 0; + for (uint32_t i = 0; i != op.words.size(); ++i) { + len |= (op.words[i] << (32 * i)); + } + return len; +} + +ir::Instruction* ScalarReplacementPass::GetStorageType( + const ir::Instruction* inst) const { + assert(inst->opcode() == SpvOpVariable); + + uint32_t ptrTypeId = inst->type_id(); + uint32_t typeId = + get_def_use_mgr()->GetDef(ptrTypeId)->GetSingleWordInOperand(1u); + return get_def_use_mgr()->GetDef(typeId); +} + +bool ScalarReplacementPass::CanReplaceVariable( + const ir::Instruction* varInst) const { + assert(varInst->opcode() == SpvOpVariable); + + // Can only replace function scope variables. + if (varInst->GetSingleWordInOperand(0u) != SpvStorageClassFunction) + return false; + + if (!CheckTypeAnnotations(get_def_use_mgr()->GetDef(varInst->type_id()))) + return false; + + const ir::Instruction* typeInst = GetStorageType(varInst); + return CheckType(typeInst) && CheckAnnotations(varInst) && CheckUses(varInst); +} + +bool ScalarReplacementPass::CheckType(const ir::Instruction* typeInst) const { + if (!CheckTypeAnnotations(typeInst)) return false; + + switch (typeInst->opcode()) { + case SpvOpTypeStruct: + // Don't bother with empty structs or very large structs. + if (typeInst->NumInOperands() == 0 || + typeInst->NumInOperands() > MAX_NUM_ELEMENTS) + return false; + return true; + case SpvOpTypeArray: + if (GetArrayLength(typeInst) > MAX_NUM_ELEMENTS) return false; + return true; + // TODO(alanbaker): Develop some heuristics for when this should be + // re-enabled. + //// Specifically including matrix and vector in an attempt to reduce the + //// number of vector registers required. + // case SpvOpTypeMatrix: + // case SpvOpTypeVector: + // if (GetNumElements(typeInst) > MAX_NUM_ELEMENTS) return false; + // return true; + + case SpvOpTypeRuntimeArray: + default: + return false; + } +} + +bool ScalarReplacementPass::CheckTypeAnnotations( + const ir::Instruction* typeInst) const { + for (auto inst : + get_decoration_mgr()->GetDecorationsFor(typeInst->result_id(), false)) { + uint32_t decoration; + if (inst->opcode() == SpvOpDecorate) { + decoration = inst->GetSingleWordInOperand(1u); + } else { + assert(inst->opcode() == SpvOpMemberDecorate); + decoration = inst->GetSingleWordInOperand(2u); + } + + switch (decoration) { + case SpvDecorationRowMajor: + case SpvDecorationColMajor: + case SpvDecorationArrayStride: + case SpvDecorationMatrixStride: + case SpvDecorationCPacked: + case SpvDecorationInvariant: + case SpvDecorationRestrict: + case SpvDecorationOffset: + case SpvDecorationAlignment: + case SpvDecorationAlignmentId: + case SpvDecorationMaxByteOffset: + break; + default: + return false; + } + } + + return true; +} + +bool ScalarReplacementPass::CheckAnnotations( + const ir::Instruction* varInst) const { + for (auto inst : + get_decoration_mgr()->GetDecorationsFor(varInst->result_id(), false)) { + assert(inst->opcode() == SpvOpDecorate); + uint32_t decoration = inst->GetSingleWordInOperand(1u); + switch (decoration) { + case SpvDecorationInvariant: + case SpvDecorationRestrict: + case SpvDecorationAlignment: + case SpvDecorationAlignmentId: + case SpvDecorationMaxByteOffset: + break; + default: + return false; + } + } + + return true; +} + +bool ScalarReplacementPass::CheckUses(const ir::Instruction* inst) const { + VariableStats stats = {0, 0}; + bool ok = CheckUses(inst, &stats); + + // TODO(alanbaker/greg-lunarg): Add some meaningful heuristics about when + // SRoA is costly, such as when the structure has many (unaccessed?) + // members. + + return ok; +} + +bool ScalarReplacementPass::CheckUses(const ir::Instruction* inst, + VariableStats* stats) const { + bool ok = true; + get_def_use_mgr()->ForEachUse( + inst, [this, stats, &ok](const ir::Instruction* user, uint32_t index) { + // Annotations are check as a group separately. + if (!ir::IsAnnotationInst(user->opcode())) { + switch (user->opcode()) { + case SpvOpAccessChain: + case SpvOpInBoundsAccessChain: + if (index == 2u) { + uint32_t id = user->GetSingleWordOperand(3u); + const ir::Instruction* opInst = get_def_use_mgr()->GetDef(id); + if (!ir::IsCompileTimeConstantInst(opInst->opcode())) { + ok = false; + } else { + if (!CheckUsesRelaxed(user)) ok = false; + } + stats->num_partial_accesses++; + } else { + ok = false; + } + break; + case SpvOpLoad: + if (!CheckLoad(user, index)) ok = false; + stats->num_full_accesses++; + break; + case SpvOpStore: + if (!CheckStore(user, index)) ok = false; + stats->num_full_accesses++; + break; + case SpvOpName: + case SpvOpMemberName: + break; + default: + ok = false; + break; + } + } + }); + + return ok; +} + +bool ScalarReplacementPass::CheckUsesRelaxed( + const ir::Instruction* inst) const { + bool ok = true; + get_def_use_mgr()->ForEachUse( + inst, [this, &ok](const ir::Instruction* user, uint32_t index) { + switch (user->opcode()) { + case SpvOpAccessChain: + case SpvOpInBoundsAccessChain: + if (index != 2u) { + ok = false; + } else { + if (!CheckUsesRelaxed(user)) ok = false; + } + break; + case SpvOpLoad: + if (!CheckLoad(user, index)) ok = false; + break; + case SpvOpStore: + if (!CheckStore(user, index)) ok = false; + break; + default: + ok = false; + break; + } + }); + + return ok; +} + +bool ScalarReplacementPass::CheckLoad(const ir::Instruction* inst, + uint32_t index) const { + if (index != 2u) return false; + if (inst->NumInOperands() >= 2 && + inst->GetSingleWordInOperand(1u) & SpvMemoryAccessVolatileMask) + return false; + return true; +} + +bool ScalarReplacementPass::CheckStore(const ir::Instruction* inst, + uint32_t index) const { + if (index != 0u) return false; + if (inst->NumInOperands() >= 3 && + inst->GetSingleWordInOperand(2u) & SpvMemoryAccessVolatileMask) + return false; + return true; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/scalar_replacement_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/scalar_replacement_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/scalar_replacement_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/scalar_replacement_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,205 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_SCALAR_REPLACEMENT_PASS_H_ +#define LIBSPIRV_OPT_SCALAR_REPLACEMENT_PASS_H_ + +#include "function.h" +#include "pass.h" +#include "type_manager.h" + +#include + +namespace spvtools { +namespace opt { + +// Documented in optimizer.hpp +class ScalarReplacementPass : public Pass { + public: + ScalarReplacementPass() = default; + + const char* name() const override { return "scalar-replacement"; } + + // Attempts to scalarize all appropriate function scope variables. Returns + // SuccessWithChange if any change is made. + Status Process(ir::IRContext* c) override; + + ir::IRContext::Analysis GetPreservedAnalyses() override { + return ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping | + ir::IRContext::kAnalysisDecorations | + ir::IRContext::kAnalysisCombinators | ir::IRContext::kAnalysisCFG | + ir::IRContext::kAnalysisNameMap; + } + + private: + // Small container for tracking statistics about variables. + // + // TODO(alanbaker): Develop some useful heuristics to tune this pass. + struct VariableStats { + uint32_t num_partial_accesses; + uint32_t num_full_accesses; + }; + + // Attempts to scalarize all appropriate function scope variables in + // |function|. Returns SuccessWithChange if any changes are mode. + Status ProcessFunction(ir::Function* function); + + // Returns true if |varInst| can be scalarized. + // + // Examines the use chain of |varInst| to verify all uses are valid for + // scalarization. + bool CanReplaceVariable(const ir::Instruction* varInst) const; + + // Returns true if |typeInst| is an acceptable type to scalarize. + // + // Allows all aggregate types except runtime arrays. Additionally, checks the + // that the number of elements that would be scalarized is within bounds. + bool CheckType(const ir::Instruction* typeInst) const; + + // Returns true if all the decorations for |varInst| are acceptable for + // scalarization. + bool CheckAnnotations(const ir::Instruction* varInst) const; + + // Returns true if all the decorations for |typeInst| are acceptable for + // scalarization. + bool CheckTypeAnnotations(const ir::Instruction* typeInst) const; + + // Returns true if the uses of |inst| are acceptable for scalarization. + // + // Recursively checks all the uses of |inst|. For |inst| specifically, only + // allows SpvOpAccessChain, SpvOpInBoundsAccessChain, SpvOpLoad and + // SpvOpStore. Access chains must have the first index be a compile-time + // constant. Subsequent uses of access chains (including other access chains) + // are checked in a more relaxed manner. + bool CheckUses(const ir::Instruction* inst) const; + + // Helper function for the above |CheckUses|. + // + // This version tracks some stats about the current OpVariable. These stats + // are used to drive heuristics about when to scalarize. + bool CheckUses(const ir::Instruction* inst, VariableStats* stats) const; + + // Relaxed helper function for |CheckUses|. + bool CheckUsesRelaxed(const ir::Instruction* inst) const; + + // Transfers appropriate decorations from |source| to |replacements|. + void TransferAnnotations(const ir::Instruction* source, + std::vector* replacements); + + // Scalarizes |inst| and updates its uses. + // + // |inst| must be an OpVariable. It is replaced with an OpVariable for each + // for element of the composite type. Uses of |inst| are updated as + // appropriate. If the replacement variables are themselves scalarizable, they + // get added to |worklist| for further processing. If any replacement + // variable ends up with no uses it is erased. Returns false if any + // subsequent access chain is out of bounds. + bool ReplaceVariable(ir::Instruction* inst, + std::queue* worklist); + + // Returns the underlying storage type for |inst|. + // + // |inst| must be an OpVariable. Returns the type that is pointed to by + // |inst|. + ir::Instruction* GetStorageType(const ir::Instruction* inst) const; + + // Returns true if the load can be scalarized. + // + // |inst| must be an OpLoad. Returns true if |index| is the pointer operand of + // |inst| and the load is not from volatile memory. + bool CheckLoad(const ir::Instruction* inst, uint32_t index) const; + + // Returns true if the store can be scalarized. + // + // |inst| must be an OpStore. Returns true if |index| is the pointer operand + // of |inst| and the store is not to volatile memory. + bool CheckStore(const ir::Instruction* inst, uint32_t index) const; + + // Creates a variable of type |typeId| from the |index|'th element of + // |varInst|. The new variable is added to |replacements|. + void CreateVariable(uint32_t typeId, ir::Instruction* varInst, uint32_t index, + std::vector* replacements); + + // Populates |replacements| with a new OpVariable for each element of |inst|. + // + // |inst| must be an OpVariable of a composite type. New variables are + // initialized the same as the corresponding index in |inst|. |replacements| + // will contain a variable for each element of the composite with matching + // indexes (i.e. the 0'th element of |inst| is the 0'th entry of + // |replacements|). + void CreateReplacementVariables(ir::Instruction* inst, + std::vector* replacements); + + // Returns the value of an OpConstant of integer type. + // + // |constant| must use two or fewer words to generate the value. + size_t GetConstantInteger(const ir::Instruction* constant) const; + + // Returns the integer literal for |op|. + size_t GetIntegerLiteral(const ir::Operand& op) const; + + // Returns the array length for |arrayInst|. + size_t GetArrayLength(const ir::Instruction* arrayInst) const; + + // Returns the number of elements in |type|. + // + // |type| must be a vector or matrix type. + size_t GetNumElements(const ir::Instruction* type) const; + + // Returns an id for a pointer to |id|. + uint32_t GetOrCreatePointerType(uint32_t id); + + // Creates the initial value for the |index| element of |source| in |newVar|. + // + // If there is an initial value for |source| for element |index|, it is + // appended as an operand on |newVar|. If the initial value is OpUndef, no + // initial value is added to |newVar|. + void GetOrCreateInitialValue(ir::Instruction* source, uint32_t index, + ir::Instruction* newVar); + + // Replaces the load to the entire composite. + // + // Generates a load for each replacement variable and then creates a new + // composite by combining all of the loads. + // + // |load| must be a load. + void ReplaceWholeLoad(ir::Instruction* load, + const std::vector& replacements); + + // Replaces the store to the entire composite. + // + // Generates a composite extract and store for each element in the scalarized + // variable from the original store data input. + void ReplaceWholeStore(ir::Instruction* store, + const std::vector& replacements); + + // Replaces an access chain to the composite variable with either a direct use + // of the appropriate replacement variable or another access chain with the + // replacement variable as the base and one fewer indexes. Returns false if + // the chain has an out of bounds access. + bool ReplaceAccessChain(ir::Instruction* chain, + const std::vector& replacements); + + // Maps storage type to a pointer type enclosing that type. + std::unordered_map pointee_to_pointer_; + + // Maps type id to OpConstantNull for that type. + std::unordered_map type_to_null_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_SCALAR_REPLACEMENT_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,371 @@ +// Copyright (c) 2016 Google 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. + +#include "set_spec_constant_default_value_pass.h" + +#include +#include +#include +#include +#include + +#include "def_use_manager.h" +#include "ir_context.h" +#include "make_unique.h" +#include "spirv-tools/libspirv.h" +#include "type_manager.h" +#include "types.h" +#include "util/parse_number.h" + +namespace spvtools { +namespace opt { + +namespace { +using spvutils::EncodeNumberStatus; +using spvutils::NumberType; +using spvutils::ParseAndEncodeNumber; +using spvutils::ParseNumber; + +// Given a numeric value in a null-terminated c string and the expected type of +// the value, parses the string and encodes it in a vector of words. If the +// value is a scalar integer or floating point value, encodes the value in +// SPIR-V encoding format. If the value is 'false' or 'true', returns a vector +// with single word with value 0 or 1 respectively. Returns the vector +// containing the encoded value on success. Otherwise returns an empty vector. +std::vector ParseDefaultValueStr(const char* text, + const analysis::Type* type) { + std::vector result; + if (!strcmp(text, "true") && type->AsBool()) { + result.push_back(1u); + } else if (!strcmp(text, "false") && type->AsBool()) { + result.push_back(0u); + } else { + NumberType number_type = {32, SPV_NUMBER_UNSIGNED_INT}; + if (const auto* IT = type->AsInteger()) { + number_type.bitwidth = IT->width(); + number_type.kind = + IT->IsSigned() ? SPV_NUMBER_SIGNED_INT : SPV_NUMBER_UNSIGNED_INT; + } else if (const auto* FT = type->AsFloat()) { + number_type.bitwidth = FT->width(); + number_type.kind = SPV_NUMBER_FLOATING; + } else { + // Does not handle types other then boolean, integer or float. Returns + // empty vector. + result.clear(); + return result; + } + EncodeNumberStatus rc = ParseAndEncodeNumber( + text, number_type, [&result](uint32_t word) { result.push_back(word); }, + nullptr); + // Clear the result vector on failure. + if (rc != EncodeNumberStatus::kSuccess) { + result.clear(); + } + } + return result; +} + +// Given a bit pattern and a type, checks if the bit pattern is compatible +// with the type. If so, returns the bit pattern, otherwise returns an empty +// bit pattern. If the given bit pattern is empty, returns an empty bit +// pattern. If the given type represents a SPIR-V Boolean type, the bit pattern +// to be returned is determined with the following standard: +// If any words in the input bit pattern are non zero, returns a bit pattern +// with 0x1, which represents a 'true'. +// If all words in the bit pattern are zero, returns a bit pattern with 0x0, +// which represents a 'false'. +std::vector ParseDefaultValueBitPattern( + const std::vector& input_bit_pattern, + const analysis::Type* type) { + std::vector result; + if (type->AsBool()) { + if (std::any_of(input_bit_pattern.begin(), input_bit_pattern.end(), + [](uint32_t i) { return i != 0; })) { + result.push_back(1u); + } else { + result.push_back(0u); + } + return result; + } else if (const auto* IT = type->AsInteger()) { + if (IT->width() == input_bit_pattern.size() * sizeof(uint32_t) * 8) { + return std::vector(input_bit_pattern); + } + } else if (const auto* FT = type->AsFloat()) { + if (FT->width() == input_bit_pattern.size() * sizeof(uint32_t) * 8) { + return std::vector(input_bit_pattern); + } + } + result.clear(); + return result; +} + +// Returns true if the given instruction's result id could have a SpecId +// decoration. +bool CanHaveSpecIdDecoration(const ir::Instruction& inst) { + switch (inst.opcode()) { + case SpvOp::SpvOpSpecConstant: + case SpvOp::SpvOpSpecConstantFalse: + case SpvOp::SpvOpSpecConstantTrue: + return true; + default: + return false; + } +} + +// Given a decoration group defining instruction that is decorated with SpecId +// decoration, finds the spec constant defining instruction which is the real +// target of the SpecId decoration. Returns the spec constant defining +// instruction if such an instruction is found, otherwise returns a nullptr. +ir::Instruction* GetSpecIdTargetFromDecorationGroup( + const ir::Instruction& decoration_group_defining_inst, + analysis::DefUseManager* def_use_mgr) { + // Find the OpGroupDecorate instruction which consumes the given decoration + // group. Note that the given decoration group has SpecId decoration, which + // is unique for different spec constants. So the decoration group cannot be + // consumed by different OpGroupDecorate instructions. Therefore we only need + // the first OpGroupDecoration instruction that uses the given decoration + // group. + ir::Instruction* group_decorate_inst = nullptr; + if (def_use_mgr->WhileEachUser(&decoration_group_defining_inst, + [&group_decorate_inst](ir::Instruction* user) { + if (user->opcode() == + SpvOp::SpvOpGroupDecorate) { + group_decorate_inst = user; + return false; + } + return true; + })) + return nullptr; + + // Scan through the target ids of the OpGroupDecorate instruction. There + // should be only one spec constant target consumes the SpecId decoration. + // If multiple target ids are presented in the OpGroupDecorate instruction, + // they must be the same one that defined by an eligible spec constant + // instruction. If the OpGroupDecorate instruction has different target ids + // or a target id is not defined by an eligible spec cosntant instruction, + // returns a nullptr. + ir::Instruction* target_inst = nullptr; + for (uint32_t i = 1; i < group_decorate_inst->NumInOperands(); i++) { + // All the operands of a OpGroupDecorate instruction should be of type + // SPV_OPERAND_TYPE_ID. + uint32_t candidate_id = group_decorate_inst->GetSingleWordInOperand(i); + ir::Instruction* candidate_inst = def_use_mgr->GetDef(candidate_id); + + if (!candidate_inst) { + continue; + } + + if (!target_inst) { + // If the spec constant target has not been found yet, check if the + // candidate instruction is the target. + if (CanHaveSpecIdDecoration(*candidate_inst)) { + target_inst = candidate_inst; + } else { + // Spec id decoration should not be applied on other instructions. + // TODO(qining): Emit an error message in the invalid case once the + // error handling is done. + return nullptr; + } + } else { + // If the spec constant target has been found, check if the candidate + // instruction is the same one as the target. The module is invalid if + // the candidate instruction is different with the found target. + // TODO(qining): Emit an error messaage in the invalid case once the + // error handling is done. + if (candidate_inst != target_inst) return nullptr; + } + } + return target_inst; +} +} // namespace + +Pass::Status SetSpecConstantDefaultValuePass::Process( + ir::IRContext* irContext) { + InitializeProcessing(irContext); + + // The operand index of decoration target in an OpDecorate instruction. + const uint32_t kTargetIdOperandIndex = 0; + // The operand index of the decoration literal in an OpDecorate instruction. + const uint32_t kDecorationOperandIndex = 1; + // The operand index of Spec id literal value in an OpDecorate SpecId + // instruction. + const uint32_t kSpecIdLiteralOperandIndex = 2; + // The number of operands in an OpDecorate SpecId instruction. + const uint32_t kOpDecorateSpecIdNumOperands = 3; + // The in-operand index of the default value in a OpSpecConstant instruction. + const uint32_t kOpSpecConstantLiteralInOperandIndex = 0; + + bool modified = false; + // Scan through all the annotation instructions to find 'OpDecorate SpecId' + // instructions. Then extract the decoration target of those instructions. + // The decoration targets should be spec constant defining instructions with + // opcode: OpSpecConstant{|True|False}. The spec id of those spec constants + // will be used to look up their new default values in the mapping from + // spec id to new default value strings. Once a new default value string + // is found for a spec id, the string will be parsed according to the target + // spec constant type. The parsed value will be used to replace the original + // default value of the target spec constant. + for (ir::Instruction& inst : irContext->annotations()) { + // Only process 'OpDecorate SpecId' instructions + if (inst.opcode() != SpvOp::SpvOpDecorate) continue; + if (inst.NumOperands() != kOpDecorateSpecIdNumOperands) continue; + if (inst.GetSingleWordInOperand(kDecorationOperandIndex) != + uint32_t(SpvDecoration::SpvDecorationSpecId)) { + continue; + } + + // 'inst' is an OpDecorate SpecId instruction. + uint32_t spec_id = inst.GetSingleWordOperand(kSpecIdLiteralOperandIndex); + uint32_t target_id = inst.GetSingleWordOperand(kTargetIdOperandIndex); + + // Find the spec constant defining instruction. Note that the + // target_id might be a decoration group id. + ir::Instruction* spec_inst = nullptr; + if (ir::Instruction* target_inst = get_def_use_mgr()->GetDef(target_id)) { + if (target_inst->opcode() == SpvOp::SpvOpDecorationGroup) { + spec_inst = + GetSpecIdTargetFromDecorationGroup(*target_inst, get_def_use_mgr()); + } else { + spec_inst = target_inst; + } + } else { + continue; + } + if (!spec_inst) continue; + + // Get the default value bit pattern for this spec id. + std::vector bit_pattern; + + if (spec_id_to_value_str_.size() != 0) { + // Search for the new string-form default value for this spec id. + auto iter = spec_id_to_value_str_.find(spec_id); + if (iter == spec_id_to_value_str_.end()) { + continue; + } + + // Gets the string of the default value and parses it to bit pattern + // with the type of the spec constant. + const std::string& default_value_str = iter->second; + bit_pattern = ParseDefaultValueStr( + default_value_str.c_str(), + context()->get_type_mgr()->GetType(spec_inst->type_id())); + + } else { + // Search for the new bit-pattern-form default value for this spec id. + auto iter = spec_id_to_value_bit_pattern_.find(spec_id); + if (iter == spec_id_to_value_bit_pattern_.end()) { + continue; + } + + // Gets the bit-pattern of the default value from the map directly. + bit_pattern = ParseDefaultValueBitPattern( + iter->second, + context()->get_type_mgr()->GetType(spec_inst->type_id())); + } + + if (bit_pattern.empty()) continue; + + // Update the operand bit patterns of the spec constant defining + // instruction. + switch (spec_inst->opcode()) { + case SpvOp::SpvOpSpecConstant: + // If the new value is the same with the original value, no + // need to do anything. Otherwise update the operand words. + if (spec_inst->GetInOperand(kOpSpecConstantLiteralInOperandIndex) + .words != bit_pattern) { + spec_inst->SetInOperand(kOpSpecConstantLiteralInOperandIndex, + std::move(bit_pattern)); + modified = true; + } + break; + case SpvOp::SpvOpSpecConstantTrue: + // If the new value is also 'true', no need to change anything. + // Otherwise, set the opcode to OpSpecConstantFalse; + if (!static_cast(bit_pattern.front())) { + spec_inst->SetOpcode(SpvOp::SpvOpSpecConstantFalse); + modified = true; + } + break; + case SpvOp::SpvOpSpecConstantFalse: + // If the new value is also 'false', no need to change anything. + // Otherwise, set the opcode to OpSpecConstantTrue; + if (static_cast(bit_pattern.front())) { + spec_inst->SetOpcode(SpvOp::SpvOpSpecConstantTrue); + modified = true; + } + break; + default: + break; + } + // No need to update the DefUse manager, as this pass does not change any + // ids. + } + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +// Returns true if the given char is ':', '\0' or considered as blank space +// (i.e.: '\n', '\r', '\v', '\t', '\f' and ' '). +bool IsSeparator(char ch) { + return std::strchr(":\0", ch) || std::isspace(ch) != 0; +} + +std::unique_ptr +SetSpecConstantDefaultValuePass::ParseDefaultValuesString(const char* str) { + if (!str) return nullptr; + + auto spec_id_to_value = MakeUnique(); + + // The parsing loop, break when points to the end. + while (*str) { + // Find the spec id. + while (std::isspace(*str)) str++; // skip leading spaces. + const char* entry_begin = str; + while (!IsSeparator(*str)) str++; + const char* entry_end = str; + std::string spec_id_str(entry_begin, entry_end - entry_begin); + uint32_t spec_id = 0; + if (!ParseNumber(spec_id_str.c_str(), &spec_id)) { + // The spec id is not a valid uint32 number. + return nullptr; + } + auto iter = spec_id_to_value->find(spec_id); + if (iter != spec_id_to_value->end()) { + // Same spec id has been defined before + return nullptr; + } + // Find the ':', spaces between the spec id and the ':' are not allowed. + if (*str++ != ':') { + // ':' not found + return nullptr; + } + // Find the value string + const char* val_begin = str; + while (!IsSeparator(*str)) str++; + const char* val_end = str; + if (val_end == val_begin) { + // Value string is empty. + return nullptr; + } + // Update the mapping with spec id and value string. + (*spec_id_to_value)[spec_id] = std::string(val_begin, val_end - val_begin); + + // Skip trailing spaces. + while (std::isspace(*str)) str++; + } + + return spec_id_to_value; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/set_spec_constant_default_value_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/set_spec_constant_default_value_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/set_spec_constant_default_value_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/set_spec_constant_default_value_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,112 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_SET_SPEC_CONSTANT_DEFAULT_VALUE_PASS_H_ +#define LIBSPIRV_OPT_SET_SPEC_CONSTANT_DEFAULT_VALUE_PASS_H_ + +#include +#include +#include + +#include "ir_context.h" +#include "module.h" +#include "pass.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class SetSpecConstantDefaultValuePass : public Pass { + public: + using SpecIdToValueStrMap = std::unordered_map; + using SpecIdToValueBitPatternMap = + std::unordered_map>; + using SpecIdToInstMap = std::unordered_map; + + // Constructs a pass instance with a map from spec ids to default values + // in the form of string. + explicit SetSpecConstantDefaultValuePass( + const SpecIdToValueStrMap& default_values) + : spec_id_to_value_str_(default_values), + spec_id_to_value_bit_pattern_() {} + explicit SetSpecConstantDefaultValuePass(SpecIdToValueStrMap&& default_values) + : spec_id_to_value_str_(std::move(default_values)), + spec_id_to_value_bit_pattern_() {} + + // Constructs a pass instance with a map from spec ids to default values in + // the form of bit pattern. + explicit SetSpecConstantDefaultValuePass( + const SpecIdToValueBitPatternMap& default_values) + : spec_id_to_value_str_(), + spec_id_to_value_bit_pattern_(default_values) {} + explicit SetSpecConstantDefaultValuePass( + SpecIdToValueBitPatternMap&& default_values) + : spec_id_to_value_str_(), + spec_id_to_value_bit_pattern_(std::move(default_values)) {} + + const char* name() const override { return "set-spec-const-default-value"; } + Status Process(ir::IRContext*) override; + + // Parses the given null-terminated C string to get a mapping from Spec Id to + // default value strings. Returns a unique pointer of the mapping from spec + // ids to spec constant default value strings built from the given |str| on + // success. Returns a nullptr if the given string is not valid for building + // the mapping. + // A valid string for building the mapping should follow the rule below: + // + // ": : ..." + // Example: + // "200:0x11 201:3.14 202:1.4728" + // + // Entries are separated with blank spaces (i.e.:' ', '\n', '\r', '\t', + // '\f', '\v'). Each entry corresponds to a Spec Id and default value pair. + // Multiple spaces between, before or after entries are allowed. However, + // spaces are not allowed within spec id or the default value string because + // spaces are always considered as delimiter to separate entries. + // + // In each entry, the spec id and value string is separated by ':'. Missing + // ':' in any entry is invalid. And it is invalid to have blank spaces in + // between the spec id and ':' or the default value and ':'. + // + // : specifies the spec id value. + // The text must represent a valid uint32_t number. + // Hex format with '0x' prefix is allowed. + // Empty is not allowed. + // One spec id value can only be defined once, multiple default values + // defined for the same spec id is not allowed. Spec ids with same value + // but different formats (e.g. 0x100 and 256) are considered the same. + // + // : the default value string. + // Spaces before and after default value text is allowed. + // Spaces within the text is not allowed. + // Empty is not allowed. + static std::unique_ptr ParseDefaultValuesString( + const char* str); + + private: + // The mappings from spec ids to default values. Two maps are defined here, + // each to be used for one specific form of the default values. Only one of + // them will be populated in practice. + + // The mapping from spec ids to their string-form default values to be set. + const SpecIdToValueStrMap spec_id_to_value_str_; + // The mapping from spec ids to their bitpattern-form default values to be + // set. + const SpecIdToValueBitPatternMap spec_id_to_value_bit_pattern_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_SET_SPEC_CONSTANT_DEFAULT_VALUE_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/simplification_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/simplification_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/simplification_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/simplification_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,114 @@ +// Copyright (c) 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "simplification_pass.h" + +#include +#include +#include + +#include "fold.h" + +namespace spvtools { +namespace opt { + +Pass::Status SimplificationPass::Process(ir::IRContext* c) { + InitializeProcessing(c); + bool modified = false; + + for (ir::Function& function : *get_module()) { + modified |= SimplifyFunction(&function); + } + return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange); +} + +bool SimplificationPass::SimplifyFunction(ir::Function* function) { + bool modified = false; + // Phase 1: Traverse all instructions in dominance order. + // The second phase will only be on the instructions whose inputs have changed + // after being processed during phase 1. Since OpPhi instructions are the + // only instructions whose inputs do not necessarily dominate the use, we keep + // track of the OpPhi instructions already seen, and add them to the work list + // for phase 2 when needed. + std::vector work_list; + std::unordered_set process_phis; + std::unordered_set inst_to_kill; + std::unordered_set in_work_list; + + cfg()->ForEachBlockInReversePostOrder( + function->entry().get(), + [&modified, &process_phis, &work_list, &in_work_list, &inst_to_kill, + this](ir::BasicBlock* bb) { + for (ir::Instruction* inst = &*bb->begin(); inst; + inst = inst->NextNode()) { + if (inst->opcode() == SpvOpPhi) { + process_phis.insert(inst); + } + + if (inst->opcode() == SpvOpCopyObject || FoldInstruction(inst)) { + modified = true; + context()->AnalyzeUses(inst); + get_def_use_mgr()->ForEachUser(inst, [&work_list, &process_phis, + &in_work_list]( + ir::Instruction* use) { + if (process_phis.count(use) && in_work_list.insert(use).second) { + work_list.push_back(use); + } + }); + if (inst->opcode() == SpvOpCopyObject) { + context()->ReplaceAllUsesWith(inst->result_id(), + inst->GetSingleWordInOperand(0)); + inst_to_kill.insert(inst); + in_work_list.insert(inst); + } + } + } + }); + + // Phase 2: process the instructions in the work list until all of the work is + // done. This time we add all users to the work list because phase 1 + // has already finished. + for (size_t i = 0; i < work_list.size(); ++i) { + ir::Instruction* inst = work_list[i]; + in_work_list.erase(inst); + if (inst->opcode() == SpvOpCopyObject || FoldInstruction(inst)) { + modified = true; + context()->AnalyzeUses(inst); + get_def_use_mgr()->ForEachUser( + inst, [&work_list, &in_work_list](ir::Instruction* use) { + if (!use->IsDecoration() && use->opcode() != SpvOpName && + in_work_list.insert(use).second) { + work_list.push_back(use); + } + }); + + if (inst->opcode() == SpvOpCopyObject) { + context()->ReplaceAllUsesWith(inst->result_id(), + inst->GetSingleWordInOperand(0)); + inst_to_kill.insert(inst); + in_work_list.insert(inst); + } + } + } + + // Phase 3: Kill instructions we know are no longer needed. + for (ir::Instruction* inst : inst_to_kill) { + context()->KillInst(inst); + } + + return modified; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/simplification_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/simplification_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/simplification_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/simplification_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,49 @@ +// Copyright (c) 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_SIMPLIFICATION_PASS_H_ +#define LIBSPIRV_OPT_SIMPLIFICATION_PASS_H_ + +#include "function.h" +#include "ir_context.h" +#include "pass.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class SimplificationPass : public Pass { + public: + const char* name() const override { return "simplify-instructions"; } + Status Process(ir::IRContext*) override; + virtual ir::IRContext::Analysis GetPreservedAnalyses() override { + return ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping | + ir::IRContext::kAnalysisDecorations | + ir::IRContext::kAnalysisCombinators | ir::IRContext::kAnalysisCFG | + ir::IRContext::kAnalysisDominatorAnalysis | + ir::IRContext::kAnalysisNameMap; + } + + private: + // Returns true if the module was changed. The simplifier is called on every + // instruction in |function| until nothing else in the function can be + // simplified. + bool SimplifyFunction(ir::Function* function); +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_SIMPLIFICATION_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/ssa_rewrite_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/ssa_rewrite_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/ssa_rewrite_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/ssa_rewrite_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,582 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file implements the SSA rewriting algorithm proposed in +// +// Simple and Efficient Construction of Static Single Assignment Form. +// Braun M., Buchwald S., Hack S., Leißa R., Mallon C., Zwinkau A. (2013) +// In: Jhala R., De Bosschere K. (eds) +// Compiler Construction. CC 2013. +// Lecture Notes in Computer Science, vol 7791. +// Springer, Berlin, Heidelberg +// +// https://link.springer.com/chapter/10.1007/978-3-642-37051-9_6 +// +// In contrast to common eager algorithms based on dominance and dominance +// frontier information, this algorithm works backwards from load operations. +// +// When a target variable is loaded, it queries the variable's reaching +// definition. If the reaching definition is unknown at the current location, +// it searches backwards in the CFG, inserting Phi instructions at join points +// in the CFG along the way until it finds the desired store instruction. +// +// The algorithm avoids repeated lookups using memoization. +// +// For reducible CFGs, which are a superset of the structured CFGs in SPIRV, +// this algorithm is proven to produce minimal SSA. That is, it inserts the +// minimal number of Phi instructions required to ensure the SSA property, but +// some Phi instructions may be dead +// (https://en.wikipedia.org/wiki/Static_single_assignment_form). + +#include "ssa_rewrite_pass.h" +#include "cfg.h" +#include "make_unique.h" +#include "mem_pass.h" +#include "opcode.h" + +#include + +// Debug logging (0: Off, 1-N: Verbosity level). Replace this with the +// implementation done for +// https://github.com/KhronosGroup/SPIRV-Tools/issues/1351 +// #define SSA_REWRITE_DEBUGGING_LEVEL 3 + +#ifdef SSA_REWRITE_DEBUGGING_LEVEL +#include +#else +#define SSA_REWRITE_DEBUGGING_LEVEL 0 +#endif + +namespace spvtools { +namespace opt { + +namespace { +const uint32_t kStoreValIdInIdx = 1; +const uint32_t kVariableInitIdInIdx = 1; +} // namespace + +std::string SSARewriter::PhiCandidate::PrettyPrint(const ir::CFG* cfg) const { + std::ostringstream str; + str << "%" << result_id_ << " = Phi[%" << var_id_ << ", BB %" << bb_->id() + << "]("; + if (phi_args_.size() > 0) { + uint32_t arg_ix = 0; + for (uint32_t pred_label : cfg->preds(bb_->id())) { + uint32_t arg_id = phi_args_[arg_ix++]; + str << "[%" << arg_id << ", bb(%" << pred_label << ")] "; + } + } + str << ")"; + if (copy_of_ != 0) { + str << " [COPY OF " << copy_of_ << "]"; + } + str << ((is_complete_) ? " [COMPLETE]" : " [INCOMPLETE]"); + + return str.str(); +} + +SSARewriter::PhiCandidate& SSARewriter::CreatePhiCandidate(uint32_t var_id, + ir::BasicBlock* bb) { + uint32_t phi_result_id = pass_->context()->TakeNextId(); + auto result = phi_candidates_.emplace( + phi_result_id, PhiCandidate(var_id, phi_result_id, bb)); + PhiCandidate& phi_candidate = result.first->second; + return phi_candidate; +} + +void SSARewriter::ReplacePhiUsersWith(const PhiCandidate& phi_to_remove, + uint32_t repl_id) { + for (uint32_t user_id : phi_to_remove.users()) { + PhiCandidate* user_phi = GetPhiCandidate(user_id); + if (user_phi) { + // If the user is a Phi candidate, replace all arguments that refer to + // |phi_to_remove.result_id()| with |repl_id|. + for (uint32_t& arg : user_phi->phi_args()) { + if (arg == phi_to_remove.result_id()) { + arg = repl_id; + } + } + } else { + // For regular loads, traverse the |load_replacement_| table looking for + // instances of |phi_to_remove|. + for (auto& it : load_replacement_) { + if (it.second == phi_to_remove.result_id()) { + it.second = repl_id; + } + } + } + } +} + +uint32_t SSARewriter::TryRemoveTrivialPhi(PhiCandidate* phi_candidate) { + uint32_t same_id = 0; + for (uint32_t arg_id : phi_candidate->phi_args()) { + if (arg_id == same_id || arg_id == phi_candidate->result_id()) { + // This is a self-reference operand or a reference to the same value ID. + continue; + } + if (same_id != 0) { + // This Phi candidate merges at least two values. Therefore, it is not + // trivial. + assert(phi_candidate->copy_of() == 0 && + "Phi candidate transitioning from copy to non-copy."); + return phi_candidate->result_id(); + } + same_id = arg_id; + } + + // The previous logic has determined that this Phi candidate |phi_candidate| + // is trivial. It is essentially the copy operation phi_candidate->phi_result + // = Phi(same, same, same, ...). Since it is not necessary, we can re-route + // all the users of |phi_candidate->phi_result| to all its users, and remove + // |phi_candidate|. + + // Mark the Phi candidate as a trivial copy of |same_id|, so it won't be + // generated. + phi_candidate->MarkCopyOf(same_id); + + assert(same_id != 0 && "Completed Phis cannot have %0 in their arguments"); + + // Since |phi_candidate| always produces |same_id|, replace all the users of + // |phi_candidate| with |same_id|. + ReplacePhiUsersWith(*phi_candidate, same_id); + + return same_id; +} + +uint32_t SSARewriter::AddPhiOperands(PhiCandidate* phi_candidate) { + assert(phi_candidate->phi_args().size() == 0 && + "Phi candidate already has arguments"); + + bool found_0_arg = false; + for (uint32_t pred : pass_->cfg()->preds(phi_candidate->bb()->id())) { + ir::BasicBlock* pred_bb = pass_->cfg()->block(pred); + + // If |pred_bb| is not sealed, use %0 to indicate that + // |phi_candidate| needs to be completed after the whole CFG has + // been processed. + // + // Note that we cannot call GetReachingDef() in these cases + // because this would generate an empty Phi candidate in + // |pred_bb|. When |pred_bb| is later processed, a new definition + // for |phi_candidate->var_id_| will be lost because + // |phi_candidate| will still be reached by the empty Phi. + // + // Consider: + // + // BB %23: + // %38 = Phi[%i](%int_0[%1], %39[%25]) + // + // ... + // + // BB %25: [Starts unsealed] + // %39 = Phi[%i]() + // %34 = ... + // OpStore %i %34 -> Currdef(%i) at %25 is %34 + // OpBranch %23 + // + // When we first create the Phi in %38, we add an operandless Phi in + // %39 to hold the unknown reaching def for %i. + // + // But then, when we go to complete %39 at the end. The reaching def + // for %i in %25's predecessor is %38 itself. So we miss the fact + // that %25 has a def for %i that should be used. + // + // By making the argument %0, we make |phi_candidate| incomplete, + // which will cause it to be completed after the whole CFG has + // been scanned. + uint32_t arg_id = IsBlockSealed(pred_bb) + ? GetReachingDef(phi_candidate->var_id(), pred_bb) + : 0; + phi_candidate->phi_args().push_back(arg_id); + + if (arg_id == 0) { + found_0_arg = true; + } else { + // If this argument is another Phi candidate, add |phi_candidate| to the + // list of users for the defining Phi. + PhiCandidate* defining_phi = GetPhiCandidate(arg_id); + if (defining_phi && defining_phi != phi_candidate) { + defining_phi->AddUser(phi_candidate->result_id()); + } + } + } + + // If we could not fill-in all the arguments of this Phi, mark it incomplete + // so it gets completed after the whole CFG has been processed. + if (found_0_arg) { + phi_candidate->MarkIncomplete(); + incomplete_phis_.push(phi_candidate); + return phi_candidate->result_id(); + } + + // Try to remove |phi_candidate|, if it's trivial. + uint32_t repl_id = TryRemoveTrivialPhi(phi_candidate); + if (repl_id == phi_candidate->result_id()) { + // |phi_candidate| is complete and not trivial. Add it to the + // list of Phi candidates to generate. + phi_candidate->MarkComplete(); + phis_to_generate_.push_back(phi_candidate); + } + + return repl_id; +} + +uint32_t SSARewriter::GetReachingDef(uint32_t var_id, ir::BasicBlock* bb) { + // If |var_id| has a definition in |bb|, return it. + const auto& bb_it = defs_at_block_.find(bb); + if (bb_it != defs_at_block_.end()) { + const auto& current_defs = bb_it->second; + const auto& var_it = current_defs.find(var_id); + if (var_it != current_defs.end()) { + return var_it->second; + } + } + + // Otherwise, look up the value for |var_id| in |bb|'s predecessors. + uint32_t val_id = 0; + auto& predecessors = pass_->cfg()->preds(bb->id()); + if (predecessors.size() == 1) { + // If |bb| has exactly one predecessor, we look for |var_id|'s definition + // there. + val_id = GetReachingDef(var_id, pass_->cfg()->block(predecessors[0])); + } else if (predecessors.size() > 1) { + // If there is more than one predecessor, this is a join block which may + // require a Phi instruction. This will act as |var_id|'s current + // definition to break potential cycles. + PhiCandidate& phi_candidate = CreatePhiCandidate(var_id, bb); + WriteVariable(var_id, bb, phi_candidate.result_id()); + val_id = AddPhiOperands(&phi_candidate); + } + + // If we could not find a store for this variable in the path from the root + // of the CFG, the variable is not defined, so we use undef. + if (val_id == 0) { + val_id = pass_->GetUndefVal(var_id); + } + + WriteVariable(var_id, bb, val_id); + + return val_id; +} + +void SSARewriter::SealBlock(ir::BasicBlock* bb) { + auto result = sealed_blocks_.insert(bb); + (void)result; + assert(result.second == true && + "Tried to seal the same basic block more than once."); +} + +void SSARewriter::ProcessStore(ir::Instruction* inst, ir::BasicBlock* bb) { + auto opcode = inst->opcode(); + assert((opcode == SpvOpStore || opcode == SpvOpVariable) && + "Expecting a store or a variable definition instruction."); + + uint32_t var_id = 0; + uint32_t val_id = 0; + if (opcode == SpvOpStore) { + (void)pass_->GetPtr(inst, &var_id); + val_id = inst->GetSingleWordInOperand(kStoreValIdInIdx); + } else if (inst->NumInOperands() >= 2) { + var_id = inst->result_id(); + val_id = inst->GetSingleWordInOperand(kVariableInitIdInIdx); + } + if (pass_->IsTargetVar(var_id)) { + WriteVariable(var_id, bb, val_id); + +#if SSA_REWRITE_DEBUGGING_LEVEL > 1 + std::cerr << "\tFound store '%" << var_id << " = %" << val_id << "': " + << inst->PrettyPrint(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES) + << "\n"; +#endif + } +} + +void SSARewriter::ProcessLoad(ir::Instruction* inst, ir::BasicBlock* bb) { + uint32_t var_id = 0; + (void)pass_->GetPtr(inst, &var_id); + if (pass_->IsTargetVar(var_id)) { + // Get the immediate reaching definition for |var_id|. + uint32_t val_id = GetReachingDef(var_id, bb); + + // Schedule a replacement for the result of this load instruction with + // |val_id|. After all the rewriting decisions are made, every use of + // this load will be replaced with |val_id|. + const uint32_t load_id = inst->result_id(); + assert(load_replacement_.count(load_id) == 0); + load_replacement_[load_id] = val_id; + PhiCandidate* defining_phi = GetPhiCandidate(val_id); + if (defining_phi) { + defining_phi->AddUser(load_id); + } + +#if SSA_REWRITE_DEBUGGING_LEVEL > 1 + std::cerr << "\tFound load: " + << inst->PrettyPrint(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES) + << " (replacement for %" << load_id << " is %" << val_id << ")\n"; +#endif + } +} + +void SSARewriter::PrintPhiCandidates() const { + std::cerr << "\nPhi candidates:\n"; + for (const auto& phi_it : phi_candidates_) { + std::cerr << "\tBB %" << phi_it.second.bb()->id() << ": " + << phi_it.second.PrettyPrint(pass_->cfg()) << "\n"; + } + std::cerr << "\n"; +} + +void SSARewriter::PrintReplacementTable() const { + std::cerr << "\nLoad replacement table\n"; + for (const auto& it : load_replacement_) { + std::cerr << "\t%" << it.first << " -> %" << it.second << "\n"; + } + std::cerr << "\n"; +} + +void SSARewriter::GenerateSSAReplacements(ir::BasicBlock* bb) { +#if SSA_REWRITE_DEBUGGING_LEVEL > 1 + std::cerr << "Generating SSA replacements for block: " << bb->id() << "\n"; + std::cerr << bb->PrettyPrint(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES) + << "\n"; +#endif + + for (auto& inst : *bb) { + auto opcode = inst.opcode(); + if (opcode == SpvOpStore || opcode == SpvOpVariable) { + ProcessStore(&inst, bb); + } else if (inst.opcode() == SpvOpLoad) { + ProcessLoad(&inst, bb); + } + } + + // Seal |bb|. This means that all the stores in it have been scanned and it's + // ready to feed them into its successors. + SealBlock(bb); + +#if SSA_REWRITE_DEBUGGING_LEVEL > 1 + PrintPhiCandidates(); + PrintReplacementTable(); + std::cerr << "\n\n"; +#endif +} + +uint32_t SSARewriter::GetReplacement(std::pair repl) { + uint32_t val_id = repl.second; + auto it = load_replacement_.find(val_id); + while (it != load_replacement_.end()) { + val_id = it->second; + it = load_replacement_.find(val_id); + } + return val_id; +} + +uint32_t SSARewriter::GetPhiArgument(const PhiCandidate* phi_candidate, + uint32_t ix) { + assert(phi_candidate->IsReady() && + "Tried to get the final argument from an incomplete/trivial Phi"); + + uint32_t arg_id = phi_candidate->phi_args()[ix]; + while (arg_id != 0) { + PhiCandidate* phi_user = GetPhiCandidate(arg_id); + if (phi_user == nullptr || phi_user->IsReady()) { + // If the argument is not a Phi or it's a Phi candidate ready to be + // emitted, return it. + return arg_id; + } + arg_id = phi_user->copy_of(); + } + + assert(false && + "No Phi candidates in the copy-of chain are ready to be generated"); + + return 0; +} + +bool SSARewriter::ApplyReplacements() { + bool modified = false; + +#if SSA_REWRITE_DEBUGGING_LEVEL > 2 + std::cerr << "\n\nApplying replacement decisions to IR\n\n"; + PrintPhiCandidates(); + PrintReplacementTable(); + std::cerr << "\n\n"; +#endif + + // Add Phi instructions from completed Phi candidates. + std::vector generated_phis; + for (const PhiCandidate* phi_candidate : phis_to_generate_) { +#if SSA_REWRITE_DEBUGGING_LEVEL > 2 + std::cerr << "Phi candidate: " << phi_candidate->PrettyPrint(pass_->cfg()) + << "\n"; +#endif + + assert(phi_candidate->is_complete() && + "Tried to instantiate a Phi instruction from an incomplete Phi " + "candidate"); + + // Build the vector of operands for the new OpPhi instruction. + uint32_t type_id = pass_->GetPointeeTypeId( + pass_->get_def_use_mgr()->GetDef(phi_candidate->var_id())); + std::vector phi_operands; + uint32_t arg_ix = 0; + for (uint32_t pred_label : pass_->cfg()->preds(phi_candidate->bb()->id())) { + uint32_t op_val_id = GetPhiArgument(phi_candidate, arg_ix++); + phi_operands.push_back( + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {op_val_id}}); + phi_operands.push_back( + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {pred_label}}); + } + + // Generate a new OpPhi instruction and insert it in its basic + // block. + std::unique_ptr phi_inst( + new ir::Instruction(pass_->context(), SpvOpPhi, type_id, + phi_candidate->result_id(), phi_operands)); + generated_phis.push_back(phi_inst.get()); + pass_->get_def_use_mgr()->AnalyzeInstDef(&*phi_inst); + pass_->context()->set_instr_block(&*phi_inst, phi_candidate->bb()); + auto insert_it = phi_candidate->bb()->begin(); + insert_it.InsertBefore(std::move(phi_inst)); + modified = true; + } + + // Scan uses for all inserted Phi instructions. Do this separately from the + // registration of the Phi instruction itself to avoid trying to analyze uses + // of Phi instructions that have not been registered yet. + for (ir::Instruction* phi_inst : generated_phis) { + pass_->get_def_use_mgr()->AnalyzeInstUse(&*phi_inst); + } + +#if SSA_REWRITE_DEBUGGING_LEVEL > 1 + std::cerr << "\n\nReplacing the result of load instructions with the " + "corresponding SSA id\n\n"; +#endif + + // Apply replacements from the load replacement table. + for (auto& repl : load_replacement_) { + uint32_t load_id = repl.first; + uint32_t val_id = GetReplacement(repl); + ir::Instruction* load_inst = + pass_->context()->get_def_use_mgr()->GetDef(load_id); + +#if SSA_REWRITE_DEBUGGING_LEVEL > 2 + std::cerr << "\t" + << load_inst->PrettyPrint( + SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES) + << " (%" << load_id << " -> %" << val_id << ")\n"; +#endif + + // Remove the load instruction and replace all the uses of this load's + // result with |val_id|. Kill any names or decorates using the load's + // result before replacing to prevent incorrect replacement in those + // instructions. + pass_->context()->KillNamesAndDecorates(load_id); + pass_->context()->ReplaceAllUsesWith(load_id, val_id); + pass_->context()->KillInst(load_inst); + modified = true; + } + + return modified; +} + +void SSARewriter::FinalizePhiCandidate(PhiCandidate* phi_candidate) { + assert(phi_candidate->phi_args().size() > 0 && + "Phi candidate should have arguments"); + + uint32_t ix = 0; + for (uint32_t pred : pass_->cfg()->preds(phi_candidate->bb()->id())) { + ir::BasicBlock* pred_bb = pass_->cfg()->block(pred); + uint32_t& arg_id = phi_candidate->phi_args()[ix++]; + if (arg_id == 0) { + // If |pred_bb| is still not sealed, it means it's unreachable. In this + // case, we just use Undef as an argument. + arg_id = IsBlockSealed(pred_bb) + ? GetReachingDef(phi_candidate->var_id(), pred_bb) + : pass_->GetUndefVal(phi_candidate->var_id()); + } + } + + // This candidate is now completed. + phi_candidate->MarkComplete(); + + // If |phi_candidate| is not trivial, add it to the list of Phis to generate. + if (TryRemoveTrivialPhi(phi_candidate) == phi_candidate->result_id()) { + // If we could not remove |phi_candidate|, it means that it is complete + // and not trivial. Add it to the list of Phis to generate. + assert(!phi_candidate->copy_of() && "A completed Phi cannot be trivial."); + phis_to_generate_.push_back(phi_candidate); + } +} + +void SSARewriter::FinalizePhiCandidates() { +#if SSA_REWRITE_DEBUGGING_LEVEL > 1 + std::cerr << "Finalizing Phi candidates:\n\n"; + PrintPhiCandidates(); + std::cerr << "\n"; +#endif + + // Now, complete the collected candidates. + while (incomplete_phis_.size() > 0) { + PhiCandidate* phi_candidate = incomplete_phis_.front(); + incomplete_phis_.pop(); + FinalizePhiCandidate(phi_candidate); + } +} + +bool SSARewriter::RewriteFunctionIntoSSA(ir::Function* fp) { +#if SSA_REWRITE_DEBUGGING_LEVEL > 0 + std::cerr << "Function before SSA rewrite:\n" + << fp->PrettyPrint(0) << "\n\n\n"; +#endif + + // Collect variables that can be converted into SSA IDs. + pass_->CollectTargetVars(fp); + + // Generate all the SSA replacements and Phi candidates. This will + // generate incomplete and trivial Phis. + pass_->cfg()->ForEachBlockInReversePostOrder( + fp->entry().get(), + [this](ir::BasicBlock* bb) { GenerateSSAReplacements(bb); }); + + // Remove trivial Phis and add arguments to incomplete Phis. + FinalizePhiCandidates(); + + // Finally, apply all the replacements in the IR. + bool modified = ApplyReplacements(); + +#if SSA_REWRITE_DEBUGGING_LEVEL > 0 + std::cerr << "\n\n\nFunction after SSA rewrite:\n" + << fp->PrettyPrint(0) << "\n"; +#endif + + return modified; +} + +void SSARewritePass::Initialize(ir::IRContext* c) { InitializeProcessing(c); } + +Pass::Status SSARewritePass::Process(ir::IRContext* c) { + Initialize(c); + + bool modified = false; + for (auto& fn : *get_module()) { + modified |= SSARewriter(this).RewriteFunctionIntoSSA(&fn); + } + return modified ? Pass::Status::SuccessWithChange + : Pass::Status::SuccessWithoutChange; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/ssa_rewrite_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/ssa_rewrite_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/ssa_rewrite_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/ssa_rewrite_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,304 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_SSA_REWRITE_PASS_H_ +#define LIBSPIRV_OPT_SSA_REWRITE_PASS_H_ + +#include "basic_block.h" +#include "ir_context.h" +#include "mem_pass.h" + +#include + +namespace spvtools { +namespace opt { + +// Utility class for passes that need to rewrite a function into SSA. This +// converts load/store operations on function-local variables into SSA IDs, +// which allows them to be the target of optimizing transformations. +// +// Store and load operations to these variables are converted into +// operations on SSA IDs. Phi instructions are added when needed. See the +// SSA construction paper for algorithmic details +// (https://link.springer.com/chapter/10.1007/978-3-642-37051-9_6) +class SSARewriter { + public: + SSARewriter(MemPass* pass) + : pass_(pass), first_phi_id_(pass_->get_module()->IdBound()) {} + + // Rewrites SSA-target variables in function |fp| into SSA. This is the + // entry point for the SSA rewrite algorithm. SSA-target variables are + // locally defined variables that meet the criteria set by IsSSATargetVar. + // + // It returns true if function |fp| was modified. Otherwise, it returns + // false. + bool RewriteFunctionIntoSSA(ir::Function* fp); + + private: + class PhiCandidate { + public: + explicit PhiCandidate(uint32_t var, uint32_t result, ir::BasicBlock* block) + : var_id_(var), + result_id_(result), + bb_(block), + phi_args_(), + copy_of_(0), + is_complete_(false), + users_() {} + + uint32_t var_id() const { return var_id_; } + uint32_t result_id() const { return result_id_; } + ir::BasicBlock* bb() const { return bb_; } + std::vector& phi_args() { return phi_args_; } + const std::vector& phi_args() const { return phi_args_; } + uint32_t copy_of() const { return copy_of_; } + bool is_complete() const { return is_complete_; } + std::vector& users() { return users_; } + const std::vector& users() const { return users_; } + + // Marks this phi candidate as a trivial copy of |orig_id|. + void MarkCopyOf(uint32_t orig_id) { copy_of_ = orig_id; } + + // Marks this phi candidate as incomplete. + void MarkIncomplete() { is_complete_ = false; } + + // Marks this phi candidate as complete. + void MarkComplete() { is_complete_ = true; } + + // Returns true if this Phi candidate is ready to be emitted. + bool IsReady() const { return is_complete() && copy_of() == 0; } + + // Pretty prints this Phi candidate into a string and returns it. |cfg| is + // needed to lookup basic block predecessors. + std::string PrettyPrint(const ir::CFG* cfg) const; + + // Registers |operand_id| as a user of this Phi candidate. + void AddUser(uint32_t operand_id) { users_.push_back(operand_id); } + + private: + // Variable ID that this Phi is merging. + uint32_t var_id_; + + // SSA ID generated by this Phi (i.e., this is the result ID of the eventual + // Phi instruction). + uint32_t result_id_; + + // Basic block to hold this Phi. + ir::BasicBlock* bb_; + + // Vector of operands for every predecessor block of |bb|. This vector is + // organized so that the Ith slot contains the argument coming from the Ith + // predecessor of |bb|. + std::vector phi_args_; + + // If this Phi is a trivial copy of another Phi, this is the ID of the + // original. If this is 0, it means that this is not a trivial Phi. + uint32_t copy_of_; + + // False, if this Phi candidate has no arguments or at least one argument is + // %0. + bool is_complete_; + + // List of all users for this Phi instruction. Each element is the result ID + // of the load instruction replaced by this Phi, or the result ID of a Phi + // candidate that has this Phi in its list of operands. + std::vector users_; + }; + + // Type used to keep track of store operations in each basic block. + typedef std::unordered_map> + BlockDefsMap; + + // Generates all the SSA rewriting decisions for basic block |bb|. This + // populates the Phi candidate table (|phi_candidate_|) and the load + // replacement table (|load_replacement_). + void GenerateSSAReplacements(ir::BasicBlock* bb); + + // Seals block |bb|. Sealing a basic block means |bb| and all its + // predecessors of |bb| have been scanned for loads/stores. + void SealBlock(ir::BasicBlock* bb); + + // Returns true if |bb| has been sealed. + bool IsBlockSealed(ir::BasicBlock* bb) { + return sealed_blocks_.count(bb) != 0; + } + + // Returns the Phi candidate with result ID |id| if it exists in the table + // |phi_candidates_|. If no such Phi candidate exists, it returns nullptr. + PhiCandidate* GetPhiCandidate(uint32_t id) { + auto it = phi_candidates_.find(id); + return (it != phi_candidates_.end()) ? &it->second : nullptr; + } + + // Replaces all the users of Phi candidate |phi_cand| to be users of + // |repl_id|. + void ReplacePhiUsersWith(const PhiCandidate& phi_cand, uint32_t repl_id); + + // Returns the value ID that should replace the load ID in the given + // replacement pair |repl|. The replacement is a pair (|load_id|, |val_id|). + // If |val_id| is itself replaced by another value in the table, this function + // will look the replacement for |val_id| until it finds one that is not + // itself replaced. For instance, given: + // + // %34 = OpLoad %float %f1 + // OpStore %t %34 + // %36 = OpLoad %float %t + // + // Assume that %f1 is reached by a Phi candidate %42, the load + // replacement table will have the following entries: + // + // %34 -> %42 + // %36 -> %34 + // + // So, when looking for the replacement for %36, we should not use + // %34. Rather, we should use %42. To do this, the chain of + // replacements must be followed until we reach an element that has + // no replacement. + uint32_t GetReplacement(std::pair repl); + + // Returns the argument at index |ix| from |phi_candidate|. If argument |ix| + // comes from a trivial Phi, it follows the copy-of chain from that trivial + // Phi until it finds the original Phi candidate. + // + // This is only valid after all Phi candidates have been completed. It can + // only be called when generating the IR for these Phis. + uint32_t GetPhiArgument(const PhiCandidate* phi_candidate, uint32_t ix); + + // Applies all the SSA replacement decisions. This replaces loads/stores to + // SSA target variables with their corresponding SSA IDs, and inserts Phi + // instructions for them. + bool ApplyReplacements(); + + // Registers a definition for variable |var_id| in basic block |bb| with + // value |val_id|. + void WriteVariable(uint32_t var_id, ir::BasicBlock* bb, uint32_t val_id) { + defs_at_block_[bb][var_id] = val_id; + } + + // Processes the store operation |inst| in basic block |bb|. This extracts + // the variable ID being stored into, determines whether the variable is an + // SSA-target variable, and, if it is, it stores its value in the + // |defs_at_block_| map. + void ProcessStore(ir::Instruction* inst, ir::BasicBlock* bb); + + // Processes the load operation |inst| in basic block |bb|. This extracts + // the variable ID being stored into, determines whether the variable is an + // SSA-target variable, and, if it is, it reads its reaching definition by + // calling |GetReachingDef|. + void ProcessLoad(ir::Instruction* inst, ir::BasicBlock* bb); + + // Reads the current definition for variable |var_id| in basic block |bb|. + // If |var_id| is not defined in block |bb| it walks up the predecessors of + // |bb|, creating new Phi candidates along the way, if needed. + // + // It returns the value for |var_id| from the RHS of the current reaching + // definition for |var_id|. + uint32_t GetReachingDef(uint32_t var_id, ir::BasicBlock* bb); + + // Adds arguments to |phi_candidate| by getting the reaching definition of + // |phi_candidate|'s variable on each of the predecessors of its basic + // block. After populating the argument list, it determines whether all its + // arguments are the same. If so, it returns the ID of the argument that + // this Phi copies. + uint32_t AddPhiOperands(PhiCandidate* phi_candidate); + + // Creates a Phi candidate instruction for variable |var_id| in basic block + // |bb|. + // + // Since the rewriting algorithm may remove Phi candidates when it finds + // them to be trivial, we avoid the expense of creating actual Phi + // instructions by keeping a pool of Phi candidates (|phi_candidates_|) + // during rewriting. + // + // Once the candidate Phi is created, it returns its ID. + PhiCandidate& CreatePhiCandidate(uint32_t var_id, ir::BasicBlock* bb); + + // Attempts to remove a trivial Phi candidate |phi_cand|. Trivial Phis are + // those that only reference themselves and one other value |val| any number + // of times. This will try to remove any other Phis that become trivial + // after |phi_cand| is removed. + // + // If |phi_cand| is trivial, it returns the SSA ID for the value that should + // replace it. Otherwise, it returns the SSA ID for |phi_cand|. + uint32_t TryRemoveTrivialPhi(PhiCandidate* phi_cand); + + // Finalizes |phi_candidate| by replacing every argument that is still %0 + // with its reaching definition. + void FinalizePhiCandidate(PhiCandidate* phi_candidate); + + // Finalizes processing of Phi candidates. Once the whole function has been + // scanned for loads and stores, the CFG will still have some incomplete and + // trivial Phis. This will add missing arguments and remove trivial Phi + // candidates. + void FinalizePhiCandidates(); + + // Prints the table of Phi candidates to std::cerr. + void PrintPhiCandidates() const; + + // Prints the load replacement table to std::cerr. + void PrintReplacementTable() const; + + // Map holding the value of every SSA-target variable at every basic block + // where the variable is stored. defs_at_block_[block][var_id] = val_id + // means that there is a store or Phi instruction for variable |var_id| at + // basic block |block| with value |val_id|. + BlockDefsMap defs_at_block_; + + // Map, indexed by Phi ID, holding all the Phi candidates created during SSA + // rewriting. |phi_candidates_[id]| returns the Phi candidate whose result + // is |id|. + std::unordered_map phi_candidates_; + + // Queue of incomplete Phi candidates. These are Phi candidates created at + // unsealed blocks. They need to be completed before they are instantiated + // in ApplyReplacements. + std::queue incomplete_phis_; + + // List of completed Phi candidates. These are the only candidates that + // will become real Phi instructions. + std::vector phis_to_generate_; + + // SSA replacement table. This maps variable IDs, resulting from a load + // operation, to the value IDs that will replace them after SSA rewriting. + // After all the rewriting decisions are made, a final scan through the IR + // is done to replace all uses of the original load ID with the value ID. + std::unordered_map load_replacement_; + + // Set of blocks that have been sealed already. + std::unordered_set sealed_blocks_; + + // Memory pass requesting the SSA rewriter. + MemPass* pass_; + + // ID of the first Phi created by the SSA rewriter. During rewriting, any + // ID bigger than this corresponds to a Phi candidate. + uint32_t first_phi_id_; +}; + +class SSARewritePass : public MemPass { + public: + SSARewritePass() = default; + const char* name() const override { return "ssa-rewrite"; } + Status Process(ir::IRContext* c) override; + + private: + // Initializes the pass. + void Initialize(ir::IRContext* c); +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_SSA_REWRITE_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/strength_reduction_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/strength_reduction_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/strength_reduction_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/strength_reduction_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,199 @@ +// Copyright (c) 2017 Google 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. + +#include "strength_reduction_pass.h" + +#include +#include +#include +#include +#include + +#include "def_use_manager.h" +#include "ir_context.h" +#include "log.h" +#include "reflect.h" + +namespace { +// Count the number of trailing zeros in the binary representation of +// |constVal|. +uint32_t CountTrailingZeros(uint32_t constVal) { + // Faster if we use the hardware count trailing zeros instruction. + // If not available, we could create a table. + uint32_t shiftAmount = 0; + while ((constVal & 1) == 0) { + ++shiftAmount; + constVal = (constVal >> 1); + } + return shiftAmount; +} + +// Return true if |val| is a power of 2. +bool IsPowerOf2(uint32_t val) { + // The idea is that the & will clear out the least + // significant 1 bit. If it is a power of 2, then + // there is exactly 1 bit set, and the value becomes 0. + if (val == 0) return false; + return ((val - 1) & val) == 0; +} + +} // namespace + +namespace spvtools { +namespace opt { + +Pass::Status StrengthReductionPass::Process(ir::IRContext* c) { + InitializeProcessing(c); + + // Initialize the member variables on a per module basis. + bool modified = false; + int32_type_id_ = 0; + uint32_type_id_ = 0; + std::memset(constant_ids_, 0, sizeof(constant_ids_)); + + FindIntTypesAndConstants(); + modified = ScanFunctions(); + return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange); +} + +bool StrengthReductionPass::ReplaceMultiplyByPowerOf2( + ir::BasicBlock::iterator* inst) { + assert((*inst)->opcode() == SpvOp::SpvOpIMul && + "Only works for multiplication of integers."); + bool modified = false; + + // Currently only works on 32-bit integers. + if ((*inst)->type_id() != int32_type_id_ && + (*inst)->type_id() != uint32_type_id_) { + return modified; + } + + // Check the operands for a constant that is a power of 2. + for (int i = 0; i < 2; i++) { + uint32_t opId = (*inst)->GetSingleWordInOperand(i); + ir::Instruction* opInst = get_def_use_mgr()->GetDef(opId); + if (opInst->opcode() == SpvOp::SpvOpConstant) { + // We found a constant operand. + uint32_t constVal = opInst->GetSingleWordOperand(2); + + if (IsPowerOf2(constVal)) { + modified = true; + uint32_t shiftAmount = CountTrailingZeros(constVal); + uint32_t shiftConstResultId = GetConstantId(shiftAmount); + + // Create the new instruction. + uint32_t newResultId = TakeNextId(); + std::vector newOperands; + newOperands.push_back((*inst)->GetInOperand(1 - i)); + ir::Operand shiftOperand(spv_operand_type_t::SPV_OPERAND_TYPE_ID, + {shiftConstResultId}); + newOperands.push_back(shiftOperand); + std::unique_ptr newInstruction( + new ir::Instruction(context(), SpvOp::SpvOpShiftLeftLogical, + (*inst)->type_id(), newResultId, newOperands)); + + // Insert the new instruction and update the data structures. + (*inst) = (*inst).InsertBefore(std::move(newInstruction)); + get_def_use_mgr()->AnalyzeInstDefUse(&*(*inst)); + ++(*inst); + context()->ReplaceAllUsesWith((*inst)->result_id(), newResultId); + + // Remove the old instruction. + ir::Instruction* inst_to_delete = &*(*inst); + --(*inst); + context()->KillInst(inst_to_delete); + + // We do not want to replace the instruction twice if both operands + // are constants that are a power of 2. So we break here. + break; + } + } + } + + return modified; +} + +void StrengthReductionPass::FindIntTypesAndConstants() { + analysis::Integer int32(32, true); + int32_type_id_ = context()->get_type_mgr()->GetId(&int32); + analysis::Integer uint32(32, false); + uint32_type_id_ = context()->get_type_mgr()->GetId(&uint32); + for (auto iter = get_module()->types_values_begin(); + iter != get_module()->types_values_end(); ++iter) { + switch (iter->opcode()) { + case SpvOp::SpvOpConstant: + if (iter->type_id() == uint32_type_id_) { + uint32_t value = iter->GetSingleWordOperand(2); + if (value <= 32) constant_ids_[value] = iter->result_id(); + } + break; + default: + break; + } + } +} + +uint32_t StrengthReductionPass::GetConstantId(uint32_t val) { + assert(val <= 32 && + "This function does not handle constants larger than 32."); + + if (constant_ids_[val] == 0) { + if (uint32_type_id_ == 0) { + analysis::Integer uint(32, false); + uint32_type_id_ = context()->get_type_mgr()->GetTypeInstruction(&uint); + } + + // Construct the constant. + uint32_t resultId = TakeNextId(); + ir::Operand constant(spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, + {val}); + std::unique_ptr newConstant( + new ir::Instruction(context(), SpvOp::SpvOpConstant, uint32_type_id_, + resultId, {constant})); + get_module()->AddGlobalValue(std::move(newConstant)); + + // Notify the DefUseManager about this constant. + auto constantIter = --get_module()->types_values_end(); + get_def_use_mgr()->AnalyzeInstDef(&*constantIter); + + // Store the result id for next time. + constant_ids_[val] = resultId; + } + + return constant_ids_[val]; +} + +bool StrengthReductionPass::ScanFunctions() { + // I did not use |ForEachInst| in the module because the function that acts on + // the instruction gets a pointer to the instruction. We cannot use that to + // insert a new instruction. I want an iterator. + bool modified = false; + for (auto& func : *get_module()) { + for (auto& bb : func) { + for (auto inst = bb.begin(); inst != bb.end(); ++inst) { + switch (inst->opcode()) { + case SpvOp::SpvOpIMul: + if (ReplaceMultiplyByPowerOf2(&inst)) modified = true; + break; + default: + break; + } + } + } + } + return modified; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/strength_reduction_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/strength_reduction_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/strength_reduction_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/strength_reduction_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_STRENGTH_REDUCTION_PASS_H_ +#define LIBSPIRV_OPT_STRENGTH_REDUCTION_PASS_H_ + +#include "def_use_manager.h" +#include "ir_context.h" +#include "module.h" +#include "pass.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class StrengthReductionPass : public Pass { + public: + const char* name() const override { return "strength-reduction"; } + Status Process(ir::IRContext*) override; + + private: + // Replaces multiple by power of 2 with an equivalent bit shift. + // Returns true if something changed. + bool ReplaceMultiplyByPowerOf2(ir::BasicBlock::iterator*); + + // Scan the types and constants in the module looking for the the integer + // types that we are + // interested in. The shift operation needs a small unsigned integer. We + // need to find + // them or create them. We do not want duplicates. + void FindIntTypesAndConstants(); + + // Get the id for the given constant. If it does not exist, it will be + // created. The parameter must be between 0 and 32 inclusive. + uint32_t GetConstantId(uint32_t); + + // Replaces certain instructions in function bodies with presumably cheaper + // ones. Returns true if something changed. + bool ScanFunctions(); + + // Type ids for the types of interest, or 0 if they do not exist. + uint32_t int32_type_id_; + uint32_t uint32_type_id_; + + // constant_ids[i] is the id for unsigned integer constant i. + // We set the limit at 32 because a bit shift of a 32-bit integer does not + // need a value larger than 32. + uint32_t constant_ids_[33]; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_STRENGTH_REDUCTION_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/strip_debug_info_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/strip_debug_info_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/strip_debug_info_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/strip_debug_info_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,36 @@ +// Copyright (c) 2016 Google 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. + +#include "strip_debug_info_pass.h" +#include "ir_context.h" + +namespace spvtools { +namespace opt { + +Pass::Status StripDebugInfoPass::Process(ir::IRContext* irContext) { + bool modified = !irContext->debugs1().empty() || + !irContext->debugs2().empty() || + !irContext->debugs3().empty(); + irContext->debug_clear(); + + irContext->module()->ForEachInst([&modified](ir::Instruction* inst) { + modified |= !inst->dbg_line_insts().empty(); + inst->dbg_line_insts().clear(); + }); + + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/strip_debug_info_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/strip_debug_info_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/strip_debug_info_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/strip_debug_info_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,35 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_STRIP_DEBUG_INFO_PASS_H_ +#define LIBSPIRV_OPT_STRIP_DEBUG_INFO_PASS_H_ + +#include "ir_context.h" +#include "module.h" +#include "pass.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class StripDebugInfoPass : public Pass { + public: + const char* name() const override { return "strip-debug"; } + Status Process(ir::IRContext* irContext) override; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_STRIP_DEBUG_INFO_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/strip_reflect_info_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/strip_reflect_info_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/strip_reflect_info_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/strip_reflect_info_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright (c) 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "strip_reflect_info_pass.h" + +#include + +#include "instruction.h" +#include "ir_context.h" + +namespace spvtools { +namespace opt { + +using spvtools::ir::Instruction; + +Pass::Status StripReflectInfoPass::Process(ir::IRContext* irContext) { + bool modified = false; + + std::vector to_remove; + + bool other_uses_for_decorate_string = false; + for (auto& inst : irContext->module()->annotations()) { + switch (inst.opcode()) { + case SpvOpDecorateStringGOOGLE: + if (inst.GetSingleWordInOperand(1) == SpvDecorationHlslSemanticGOOGLE) { + to_remove.push_back(&inst); + } else { + other_uses_for_decorate_string = true; + } + break; + + case SpvOpDecorateId: + if (inst.GetSingleWordInOperand(1) == + SpvDecorationHlslCounterBufferGOOGLE) { + to_remove.push_back(&inst); + } + break; + + default: + break; + } + } + + for (auto& inst : irContext->module()->extensions()) { + const char* ext_name = + reinterpret_cast(&inst.GetInOperand(0).words[0]); + if (0 == std::strcmp(ext_name, "SPV_GOOGLE_hlsl_functionality1")) { + to_remove.push_back(&inst); + } else if (!other_uses_for_decorate_string && + 0 == std::strcmp(ext_name, "SPV_GOOGLE_decorate_string")) { + to_remove.push_back(&inst); + } + } + + for (auto* inst : to_remove) { + modified = true; + irContext->KillInst(inst); + } + + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/strip_reflect_info_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/strip_reflect_info_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/strip_reflect_info_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/strip_reflect_info_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,44 @@ +// Copyright (c) 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_STRIP_REFLECT_INFO_PASS_H_ +#define LIBSPIRV_OPT_STRIP_REFLECT_INFO_PASS_H_ + +#include "ir_context.h" +#include "module.h" +#include "pass.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class StripReflectInfoPass : public Pass { + public: + const char* name() const override { return "strip-reflect"; } + Status Process(ir::IRContext* irContext) override; + + // Return the mask of preserved Analyses. + ir::IRContext::Analysis GetPreservedAnalyses() override { + return ir::IRContext::kAnalysisInstrToBlockMapping | + ir::IRContext::kAnalysisCombinators | ir::IRContext::kAnalysisCFG | + ir::IRContext::kAnalysisDominatorAnalysis | + ir::IRContext::kAnalysisLoopAnalysis | + ir::IRContext::kAnalysisNameMap; + } +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_STRIP_REFLECT_INFO_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/tree_iterator.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/tree_iterator.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/tree_iterator.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/tree_iterator.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,246 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_TREE_ITERATOR_H_ +#define LIBSPIRV_OPT_TREE_ITERATOR_H_ + +#include +#include +#include + +namespace spvtools { +namespace opt { + +// Helper class to iterate over a tree in a depth first order. +// The class assumes the data structure is a tree, tree node type implements a +// forward iterator. +// At each step, the iterator holds the pointer to the current node and state of +// the walk. +// The state is recorded by stacking the iteration position of the node +// children. To move to the next node, the iterator: +// - Looks at the top of the stack; +// - Sets the node behind the iterator as the current node; +// - Increments the iterator if it has more children to visit, pops otherwise; +// - If the current node has children, the children iterator is pushed into the +// stack. +template +class TreeDFIterator { + static_assert(!std::is_pointer::value && + !std::is_reference::value, + "NodeTy should be a class"); + // Type alias to keep track of the const qualifier. + using NodeIterator = + typename std::conditional::value, + typename NodeTy::const_iterator, + typename NodeTy::iterator>::type; + + // Type alias to keep track of the const qualifier. + using NodePtr = NodeTy*; + + public: + // Standard iterator interface. + using reference = NodeTy&; + using value_type = NodeTy; + + explicit inline TreeDFIterator(NodePtr top_node) : current_(top_node) { + if (current_ && current_->begin() != current_->end()) + parent_iterators_.emplace(make_pair(current_, current_->begin())); + } + + // end() iterator. + inline TreeDFIterator() : TreeDFIterator(nullptr) {} + + bool operator==(const TreeDFIterator& x) const { + return current_ == x.current_; + } + + bool operator!=(const TreeDFIterator& x) const { return !(*this == x); } + + reference operator*() const { return *current_; } + + NodePtr operator->() const { return current_; } + + TreeDFIterator& operator++() { + MoveToNextNode(); + return *this; + } + + TreeDFIterator operator++(int) { + TreeDFIterator tmp = *this; + ++*this; + return tmp; + } + + private: + // Moves the iterator to the next node in the tree. + // If we are at the end, do nothing, otherwise + // if our current node has children, use the children iterator and push the + // current node into the stack. + // If we reach the end of the local iterator, pop it. + inline void MoveToNextNode() { + if (!current_) return; + if (parent_iterators_.empty()) { + current_ = nullptr; + return; + } + std::pair& next_it = parent_iterators_.top(); + // Set the new node. + current_ = *next_it.second; + // Update the iterator for the next child. + ++next_it.second; + // If we finished with node, pop it. + if (next_it.first->end() == next_it.second) parent_iterators_.pop(); + // If our current node is not a leaf, store the iteration state for later. + if (current_->begin() != current_->end()) + parent_iterators_.emplace(make_pair(current_, current_->begin())); + } + + // The current node of the tree. + NodePtr current_; + // State of the tree walk: each pair contains the parent node (which has been + // already visited) and the iterator of the next children to visit. + // When all the children has been visited, we pop the entry, get the next + // child and push back the pair if the children iterator is not end(). + std::stack> parent_iterators_; +}; + +// Helper class to iterate over a tree in a depth first post-order. +// The class assumes the data structure is a tree, tree node type implements a +// forward iterator. +// At each step, the iterator holds the pointer to the current node and state of +// the walk. +// The state is recorded by stacking the iteration position of the node +// children. To move to the next node, the iterator: +// - Looks at the top of the stack; +// - If the children iterator has reach the end, then the node become the +// current one and we pop the stack; +// - Otherwise, we save the child and increment the iterator; +// - We walk the child sub-tree until we find a leaf, stacking all non-leaves +// states (pair of node pointer and child iterator) as we walk it. +template +class PostOrderTreeDFIterator { + static_assert(!std::is_pointer::value && + !std::is_reference::value, + "NodeTy should be a class"); + // Type alias to keep track of the const qualifier. + using NodeIterator = + typename std::conditional::value, + typename NodeTy::const_iterator, + typename NodeTy::iterator>::type; + + // Type alias to keep track of the const qualifier. + using NodePtr = NodeTy*; + + public: + // Standard iterator interface. + using reference = NodeTy&; + using value_type = NodeTy; + + static inline PostOrderTreeDFIterator begin(NodePtr top_node) { + return PostOrderTreeDFIterator(top_node); + } + + static inline PostOrderTreeDFIterator end(NodePtr sentinel_node) { + return PostOrderTreeDFIterator(sentinel_node, false); + } + + bool operator==(const PostOrderTreeDFIterator& x) const { + return current_ == x.current_; + } + + bool operator!=(const PostOrderTreeDFIterator& x) const { + return !(*this == x); + } + + reference operator*() const { return *current_; } + + NodePtr operator->() const { return current_; } + + PostOrderTreeDFIterator& operator++() { + MoveToNextNode(); + return *this; + } + + PostOrderTreeDFIterator operator++(int) { + PostOrderTreeDFIterator tmp = *this; + ++*this; + return tmp; + } + + private: + explicit inline PostOrderTreeDFIterator(NodePtr top_node) + : current_(top_node) { + if (current_) WalkToLeaf(); + } + + // Constructor for the "end()" iterator. + // |end_sentinel| is the value that acts as end value (can be null). The bool + // parameters is to distinguish from the start() Ctor. + inline PostOrderTreeDFIterator(NodePtr sentinel_node, bool) + : current_(sentinel_node) {} + + // Moves the iterator to the next node in the tree. + // If we are at the end, do nothing, otherwise + // if our current node has children, use the children iterator and push the + // current node into the stack. + // If we reach the end of the local iterator, pop it. + inline void MoveToNextNode() { + if (!current_) return; + if (parent_iterators_.empty()) { + current_ = nullptr; + return; + } + std::pair& next_it = parent_iterators_.top(); + // If we visited all children, the current node is the top of the stack. + if (next_it.second == next_it.first->end()) { + // Set the new node. + current_ = next_it.first; + parent_iterators_.pop(); + return; + } + // We have more children to visit, set the current node to the first child + // and dive to leaf. + current_ = *next_it.second; + // Update the iterator for the next child (avoid unneeded pop). + ++next_it.second; + WalkToLeaf(); + } + + // Moves the iterator to the next node in the tree. + // If we are at the end, do nothing, otherwise + // if our current node has children, use the children iterator and push the + // current node into the stack. + // If we reach the end of the local iterator, pop it. + inline void WalkToLeaf() { + while (current_->begin() != current_->end()) { + NodeIterator next = ++current_->begin(); + parent_iterators_.emplace(make_pair(current_, next)); + // Set the first child as the new node. + current_ = *current_->begin(); + } + } + + // The current node of the tree. + NodePtr current_; + // State of the tree walk: each pair contains the parent node and the iterator + // of the next children to visit. + // When all the children has been visited, we pop the first entry and the + // parent node become the current node. + std::stack> parent_iterators_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_TREE_ITERATOR_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/type_manager.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/type_manager.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/type_manager.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/type_manager.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,695 @@ +// Copyright (c) 2016 Google 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. + +#include "type_manager.h" + +#include +#include +#include + +#include "ir_context.h" +#include "log.h" +#include "make_unique.h" +#include "reflect.h" + +namespace { +const int kSpvTypePointerStorageClass = 1; +const int kSpvTypePointerTypeIdInIdx = 2; +} // namespace + +namespace spvtools { +namespace opt { +namespace analysis { + +TypeManager::TypeManager(const MessageConsumer& consumer, + spvtools::ir::IRContext* c) + : consumer_(consumer), context_(c) { + AnalyzeTypes(*c->module()); +} + +Type* TypeManager::GetType(uint32_t id) const { + auto iter = id_to_type_.find(id); + if (iter != id_to_type_.end()) return (*iter).second; + return nullptr; +} + +std::pair> TypeManager::GetTypeAndPointerType( + uint32_t id, SpvStorageClass sc) const { + Type* type = GetType(id); + if (type) { + return std::make_pair(type, MakeUnique(type, sc)); + } else { + return std::make_pair(type, std::unique_ptr()); + } +} + +uint32_t TypeManager::GetId(const Type* type) const { + auto iter = type_to_id_.find(type); + if (iter != type_to_id_.end()) return (*iter).second; + return 0; +} + +ForwardPointer* TypeManager::GetForwardPointer(uint32_t index) const { + if (index >= forward_pointers_.size()) return nullptr; + return forward_pointers_.at(index).get(); +} + +void TypeManager::AnalyzeTypes(const spvtools::ir::Module& module) { + for (const auto* inst : module.GetTypes()) RecordIfTypeDefinition(*inst); +} + +void TypeManager::RemoveId(uint32_t id) { + auto iter = id_to_type_.find(id); + if (iter == id_to_type_.end()) return; + + auto& type = iter->second; + if (!type->IsUniqueType(true)) { + auto tIter = type_to_id_.find(type); + if (tIter != type_to_id_.end() && tIter->second == id) { + // |type| currently maps to |id|. + // Search for an equivalent type to re-map. + bool found = false; + for (auto& pair : id_to_type_) { + if (pair.first != id && *pair.second == *type) { + // Equivalent ambiguous type, re-map type. + type_to_id_.erase(type); + type_to_id_[pair.second] = pair.first; + found = true; + break; + } + } + // No equivalent ambiguous type, remove mapping. + if (!found) type_to_id_.erase(tIter); + } + } else { + // Unique type, so just erase the entry. + type_to_id_.erase(type); + } + + // Erase the entry for |id|. + id_to_type_.erase(iter); +} + +uint32_t TypeManager::GetTypeInstruction(const Type* type) { + uint32_t id = GetId(type); + if (id != 0) return id; + + std::unique_ptr typeInst; + id = context()->TakeNextId(); + RegisterType(id, *type); + switch (type->kind()) { +#define DefineParameterlessCase(kind) \ + case Type::k##kind: \ + typeInst.reset(new ir::Instruction(context(), SpvOpType##kind, 0, id, \ + std::initializer_list{})); \ + break; + DefineParameterlessCase(Void); + DefineParameterlessCase(Bool); + DefineParameterlessCase(Sampler); + DefineParameterlessCase(Event); + DefineParameterlessCase(DeviceEvent); + DefineParameterlessCase(ReserveId); + DefineParameterlessCase(Queue); + DefineParameterlessCase(PipeStorage); + DefineParameterlessCase(NamedBarrier); +#undef DefineParameterlessCase + case Type::kInteger: + typeInst.reset(new ir::Instruction( + context(), SpvOpTypeInt, 0, id, + std::initializer_list{ + {SPV_OPERAND_TYPE_LITERAL_INTEGER, {type->AsInteger()->width()}}, + {SPV_OPERAND_TYPE_LITERAL_INTEGER, + {(type->AsInteger()->IsSigned() ? 1u : 0u)}}})); + break; + case Type::kFloat: + typeInst.reset(new ir::Instruction( + context(), SpvOpTypeFloat, 0, id, + std::initializer_list{ + {SPV_OPERAND_TYPE_LITERAL_INTEGER, {type->AsFloat()->width()}}})); + break; + case Type::kVector: { + uint32_t subtype = GetTypeInstruction(type->AsVector()->element_type()); + typeInst.reset( + new ir::Instruction(context(), SpvOpTypeVector, 0, id, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {subtype}}, + {SPV_OPERAND_TYPE_LITERAL_INTEGER, + {type->AsVector()->element_count()}}})); + break; + } + case Type::kMatrix: { + uint32_t subtype = GetTypeInstruction(type->AsMatrix()->element_type()); + typeInst.reset( + new ir::Instruction(context(), SpvOpTypeMatrix, 0, id, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {subtype}}, + {SPV_OPERAND_TYPE_LITERAL_INTEGER, + {type->AsMatrix()->element_count()}}})); + break; + } + case Type::kImage: { + const Image* image = type->AsImage(); + uint32_t subtype = GetTypeInstruction(image->sampled_type()); + typeInst.reset(new ir::Instruction( + context(), SpvOpTypeImage, 0, id, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {subtype}}, + {SPV_OPERAND_TYPE_DIMENSIONALITY, + {static_cast(image->dim())}}, + {SPV_OPERAND_TYPE_LITERAL_INTEGER, {image->depth()}}, + {SPV_OPERAND_TYPE_LITERAL_INTEGER, + {(image->is_arrayed() ? 1u : 0u)}}, + {SPV_OPERAND_TYPE_LITERAL_INTEGER, + {(image->is_multisampled() ? 1u : 0u)}}, + {SPV_OPERAND_TYPE_LITERAL_INTEGER, {image->sampled()}}, + {SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT, + {static_cast(image->format())}}, + {SPV_OPERAND_TYPE_ACCESS_QUALIFIER, + {static_cast(image->access_qualifier())}}})); + break; + } + case Type::kSampledImage: { + uint32_t subtype = + GetTypeInstruction(type->AsSampledImage()->image_type()); + typeInst.reset( + new ir::Instruction(context(), SpvOpTypeSampledImage, 0, id, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {subtype}}})); + break; + } + case Type::kArray: { + uint32_t subtype = GetTypeInstruction(type->AsArray()->element_type()); + typeInst.reset(new ir::Instruction( + context(), SpvOpTypeArray, 0, id, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {subtype}}, + {SPV_OPERAND_TYPE_ID, {type->AsArray()->LengthId()}}})); + break; + } + case Type::kRuntimeArray: { + uint32_t subtype = + GetTypeInstruction(type->AsRuntimeArray()->element_type()); + typeInst.reset( + new ir::Instruction(context(), SpvOpTypeRuntimeArray, 0, id, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {subtype}}})); + break; + } + case Type::kStruct: { + std::vector ops; + const Struct* structTy = type->AsStruct(); + for (auto ty : structTy->element_types()) { + ops.push_back( + ir::Operand(SPV_OPERAND_TYPE_ID, {GetTypeInstruction(ty)})); + } + typeInst.reset( + new ir::Instruction(context(), SpvOpTypeStruct, 0, id, ops)); + break; + } + case Type::kOpaque: { + const Opaque* opaque = type->AsOpaque(); + size_t size = opaque->name().size(); + // Convert to null-terminated packed UTF-8 string. + std::vector words(size / 4 + 1, 0); + char* dst = reinterpret_cast(words.data()); + strncpy(dst, opaque->name().c_str(), size); + typeInst.reset( + new ir::Instruction(context(), SpvOpTypeOpaque, 0, id, + std::initializer_list{ + {SPV_OPERAND_TYPE_LITERAL_STRING, words}})); + break; + } + case Type::kPointer: { + const Pointer* pointer = type->AsPointer(); + uint32_t subtype = GetTypeInstruction(pointer->pointee_type()); + typeInst.reset(new ir::Instruction( + context(), SpvOpTypePointer, 0, id, + std::initializer_list{ + {SPV_OPERAND_TYPE_STORAGE_CLASS, + {static_cast(pointer->storage_class())}}, + {SPV_OPERAND_TYPE_ID, {subtype}}})); + break; + } + case Type::kFunction: { + std::vector ops; + const Function* function = type->AsFunction(); + ops.push_back(ir::Operand(SPV_OPERAND_TYPE_ID, + {GetTypeInstruction(function->return_type())})); + for (auto ty : function->param_types()) { + ops.push_back( + ir::Operand(SPV_OPERAND_TYPE_ID, {GetTypeInstruction(ty)})); + } + typeInst.reset( + new ir::Instruction(context(), SpvOpTypeFunction, 0, id, ops)); + break; + } + case Type::kPipe: + typeInst.reset(new ir::Instruction( + context(), SpvOpTypePipe, 0, id, + std::initializer_list{ + {SPV_OPERAND_TYPE_ACCESS_QUALIFIER, + {static_cast(type->AsPipe()->access_qualifier())}}})); + break; + case Type::kForwardPointer: + typeInst.reset(new ir::Instruction( + context(), SpvOpTypeForwardPointer, 0, 0, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {type->AsForwardPointer()->target_id()}}, + {SPV_OPERAND_TYPE_STORAGE_CLASS, + {static_cast( + type->AsForwardPointer()->storage_class())}}})); + break; + default: + assert(false && "Unexpected type"); + break; + } + context()->AddType(std::move(typeInst)); + context()->AnalyzeDefUse(&*--context()->types_values_end()); + AttachDecorations(id, type); + return id; +} + +uint32_t TypeManager::FindPointerToType(uint32_t type_id, + SpvStorageClass storage_class) { + opt::analysis::Type* pointeeTy = context()->get_type_mgr()->GetType(type_id); + opt::analysis::Pointer pointerTy(pointeeTy, storage_class); + if (type_id == context()->get_type_mgr()->GetId(pointeeTy)) { + // Non-ambiguous type. Get the pointer type through the type manager. + return context()->get_type_mgr()->GetTypeInstruction(&pointerTy); + } + + // Ambiguous type, do a linear search. + ir::Module::inst_iterator type_itr = + context()->module()->types_values_begin(); + for (; type_itr != context()->module()->types_values_end(); ++type_itr) { + const ir::Instruction* type_inst = &*type_itr; + if (type_inst->opcode() == SpvOpTypePointer && + type_inst->GetSingleWordOperand(kSpvTypePointerTypeIdInIdx) == + type_id && + type_inst->GetSingleWordOperand(kSpvTypePointerStorageClass) == + storage_class) + return type_inst->result_id(); + } + + // Must create the pointer type. + uint32_t resultId = context()->TakeNextId(); + std::unique_ptr type_inst(new ir::Instruction( + context(), SpvOpTypePointer, 0, resultId, + {{spv_operand_type_t::SPV_OPERAND_TYPE_STORAGE_CLASS, + {uint32_t(storage_class)}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {type_id}}})); + context()->AnalyzeDefUse(type_inst.get()); + context()->AddType(std::move(type_inst)); + context()->get_type_mgr()->RegisterType(resultId, pointerTy); + return resultId; +} + +void TypeManager::AttachDecorations(uint32_t id, const Type* type) { + for (auto vec : type->decorations()) { + CreateDecoration(id, vec); + } + if (const Struct* structTy = type->AsStruct()) { + for (auto pair : structTy->element_decorations()) { + uint32_t element = pair.first; + for (auto vec : pair.second) { + CreateDecoration(id, vec, element); + } + } + } +} + +void TypeManager::CreateDecoration(uint32_t target, + const std::vector& decoration, + uint32_t element) { + std::vector ops; + ops.push_back(ir::Operand(SPV_OPERAND_TYPE_ID, {target})); + if (element != 0) { + ops.push_back(ir::Operand(SPV_OPERAND_TYPE_LITERAL_INTEGER, {element})); + } + ops.push_back(ir::Operand(SPV_OPERAND_TYPE_DECORATION, {decoration[0]})); + for (size_t i = 1; i < decoration.size(); ++i) { + ops.push_back( + ir::Operand(SPV_OPERAND_TYPE_LITERAL_INTEGER, {decoration[i]})); + } + context()->AddAnnotationInst(MakeUnique( + context(), (element == 0 ? SpvOpDecorate : SpvOpMemberDecorate), 0, 0, + ops)); + ir::Instruction* inst = &*--context()->annotation_end(); + context()->get_def_use_mgr()->AnalyzeInstUse(inst); +} + +Type* TypeManager::RebuildType(const Type& type) { + // The comparison and hash on the type pool will avoid inserting the rebuilt + // type if an equivalent type already exists. The rebuilt type will be deleted + // when it goes out of scope at the end of the function in that case. Repeated + // insertions of the same Type will, at most, keep one corresponding object in + // the type pool. + std::unique_ptr rebuilt_ty; + switch (type.kind()) { +#define DefineNoSubtypeCase(kind) \ + case Type::k##kind: \ + rebuilt_ty.reset(type.Clone().release()); \ + break; + DefineNoSubtypeCase(Void); + DefineNoSubtypeCase(Bool); + DefineNoSubtypeCase(Integer); + DefineNoSubtypeCase(Float); + DefineNoSubtypeCase(Sampler); + DefineNoSubtypeCase(Opaque); + DefineNoSubtypeCase(Event); + DefineNoSubtypeCase(DeviceEvent); + DefineNoSubtypeCase(ReserveId); + DefineNoSubtypeCase(Queue); + DefineNoSubtypeCase(Pipe); + DefineNoSubtypeCase(PipeStorage); + DefineNoSubtypeCase(NamedBarrier); +#undef DefineNoSubtypeCase + case Type::kVector: { + const Vector* vec_ty = type.AsVector(); + const Type* ele_ty = vec_ty->element_type(); + rebuilt_ty.reset( + new Vector(RebuildType(*ele_ty), vec_ty->element_count())); + break; + } + case Type::kMatrix: { + const Matrix* mat_ty = type.AsMatrix(); + const Type* ele_ty = mat_ty->element_type(); + rebuilt_ty.reset( + new Matrix(RebuildType(*ele_ty), mat_ty->element_count())); + break; + } + case Type::kImage: { + const Image* image_ty = type.AsImage(); + const Type* ele_ty = image_ty->sampled_type(); + rebuilt_ty.reset(new Image(RebuildType(*ele_ty), image_ty->dim(), + image_ty->depth(), image_ty->is_arrayed(), + image_ty->is_multisampled(), + image_ty->sampled(), image_ty->format(), + image_ty->access_qualifier())); + break; + } + case Type::kSampledImage: { + const SampledImage* image_ty = type.AsSampledImage(); + const Type* ele_ty = image_ty->image_type(); + rebuilt_ty.reset( + + new SampledImage(RebuildType(*ele_ty))); + break; + } + case Type::kArray: { + const Array* array_ty = type.AsArray(); + const Type* ele_ty = array_ty->element_type(); + rebuilt_ty.reset(new Array(RebuildType(*ele_ty), array_ty->LengthId())); + break; + } + case Type::kRuntimeArray: { + const RuntimeArray* array_ty = type.AsRuntimeArray(); + const Type* ele_ty = array_ty->element_type(); + rebuilt_ty.reset(new RuntimeArray(RebuildType(*ele_ty))); + break; + } + case Type::kStruct: { + const Struct* struct_ty = type.AsStruct(); + std::vector subtypes; + subtypes.reserve(struct_ty->element_types().size()); + for (const auto* ele_ty : struct_ty->element_types()) { + subtypes.push_back(RebuildType(*ele_ty)); + } + rebuilt_ty.reset(new Struct(subtypes)); + Struct* rebuilt_struct = rebuilt_ty->AsStruct(); + for (auto pair : struct_ty->element_decorations()) { + uint32_t index = pair.first; + for (const auto& dec : pair.second) { + // Explicit copy intended. + std::vector copy(dec); + rebuilt_struct->AddMemberDecoration(index, std::move(copy)); + } + } + break; + } + case Type::kPointer: { + const Pointer* pointer_ty = type.AsPointer(); + const Type* ele_ty = pointer_ty->pointee_type(); + rebuilt_ty.reset( + new Pointer(RebuildType(*ele_ty), pointer_ty->storage_class())); + break; + } + case Type::kFunction: { + const Function* function_ty = type.AsFunction(); + const Type* ret_ty = function_ty->return_type(); + std::vector param_types; + param_types.reserve(function_ty->param_types().size()); + for (const auto* param_ty : function_ty->param_types()) { + param_types.push_back(RebuildType(*param_ty)); + } + rebuilt_ty.reset(new Function(RebuildType(*ret_ty), param_types)); + break; + } + case Type::kForwardPointer: { + const ForwardPointer* forward_ptr_ty = type.AsForwardPointer(); + rebuilt_ty.reset(new ForwardPointer(forward_ptr_ty->target_id(), + forward_ptr_ty->storage_class())); + const Pointer* target_ptr = forward_ptr_ty->target_pointer(); + if (target_ptr) { + rebuilt_ty->AsForwardPointer()->SetTargetPointer( + RebuildType(*target_ptr)->AsPointer()); + } + break; + } + default: + assert(false && "Unhandled type"); + return nullptr; + } + for (const auto& dec : type.decorations()) { + // Explicit copy intended. + std::vector copy(dec); + rebuilt_ty->AddDecoration(std::move(copy)); + } + + return type_pool_.insert(std::move(rebuilt_ty)).first->get(); +} + +void TypeManager::RegisterType(uint32_t id, const Type& type) { + // Rebuild |type| so it and all its constituent types are owned by the type + // pool. + Type* rebuilt = RebuildType(type); + assert(rebuilt->IsSame(&type)); + id_to_type_[id] = rebuilt; + if (GetId(rebuilt) == 0) { + type_to_id_[rebuilt] = id; + } +} + +Type* TypeManager::GetRegisteredType(const Type* type) { + uint32_t id = GetTypeInstruction(type); + return GetType(id); +} + +Type* TypeManager::RecordIfTypeDefinition( + const spvtools::ir::Instruction& inst) { + if (!spvtools::ir::IsTypeInst(inst.opcode())) return nullptr; + + Type* type = nullptr; + switch (inst.opcode()) { + case SpvOpTypeVoid: + type = new Void(); + break; + case SpvOpTypeBool: + type = new Bool(); + break; + case SpvOpTypeInt: + type = new Integer(inst.GetSingleWordInOperand(0), + inst.GetSingleWordInOperand(1)); + break; + case SpvOpTypeFloat: + type = new Float(inst.GetSingleWordInOperand(0)); + break; + case SpvOpTypeVector: + type = new Vector(GetType(inst.GetSingleWordInOperand(0)), + inst.GetSingleWordInOperand(1)); + break; + case SpvOpTypeMatrix: + type = new Matrix(GetType(inst.GetSingleWordInOperand(0)), + inst.GetSingleWordInOperand(1)); + break; + case SpvOpTypeImage: { + const SpvAccessQualifier access = + inst.NumInOperands() < 8 + ? SpvAccessQualifierReadOnly + : static_cast(inst.GetSingleWordInOperand(7)); + type = new Image( + GetType(inst.GetSingleWordInOperand(0)), + static_cast(inst.GetSingleWordInOperand(1)), + inst.GetSingleWordInOperand(2), inst.GetSingleWordInOperand(3) == 1, + inst.GetSingleWordInOperand(4) == 1, inst.GetSingleWordInOperand(5), + static_cast(inst.GetSingleWordInOperand(6)), access); + } break; + case SpvOpTypeSampler: + type = new Sampler(); + break; + case SpvOpTypeSampledImage: + type = new SampledImage(GetType(inst.GetSingleWordInOperand(0))); + break; + case SpvOpTypeArray: + type = new Array(GetType(inst.GetSingleWordInOperand(0)), + inst.GetSingleWordInOperand(1)); + break; + case SpvOpTypeRuntimeArray: + type = new RuntimeArray(GetType(inst.GetSingleWordInOperand(0))); + break; + case SpvOpTypeStruct: { + std::vector element_types; + for (uint32_t i = 0; i < inst.NumInOperands(); ++i) { + element_types.push_back(GetType(inst.GetSingleWordInOperand(i))); + } + type = new Struct(element_types); + } break; + case SpvOpTypeOpaque: { + const uint32_t* data = inst.GetInOperand(0).words.data(); + type = new Opaque(reinterpret_cast(data)); + } break; + case SpvOpTypePointer: { + auto* ptr = new Pointer( + GetType(inst.GetSingleWordInOperand(1)), + static_cast(inst.GetSingleWordInOperand(0))); + // Let's see if somebody forward references this pointer. + for (auto* fp : unresolved_forward_pointers_) { + if (fp->target_id() == inst.result_id()) { + fp->SetTargetPointer(ptr); + unresolved_forward_pointers_.erase(fp); + break; + } + } + type = ptr; + } break; + case SpvOpTypeFunction: { + Type* return_type = GetType(inst.GetSingleWordInOperand(0)); + std::vector param_types; + for (uint32_t i = 1; i < inst.NumInOperands(); ++i) { + param_types.push_back(GetType(inst.GetSingleWordInOperand(i))); + } + type = new Function(return_type, param_types); + } break; + case SpvOpTypeEvent: + type = new Event(); + break; + case SpvOpTypeDeviceEvent: + type = new DeviceEvent(); + break; + case SpvOpTypeReserveId: + type = new ReserveId(); + break; + case SpvOpTypeQueue: + type = new Queue(); + break; + case SpvOpTypePipe: + type = new Pipe( + static_cast(inst.GetSingleWordInOperand(0))); + break; + case SpvOpTypeForwardPointer: { + // Handling of forward pointers is different from the other types. + auto* fp = new ForwardPointer( + inst.GetSingleWordInOperand(0), + static_cast(inst.GetSingleWordInOperand(1))); + forward_pointers_.emplace_back(fp); + unresolved_forward_pointers_.insert(fp); + return fp; + } + case SpvOpTypePipeStorage: + type = new PipeStorage(); + break; + case SpvOpTypeNamedBarrier: + type = new NamedBarrier(); + break; + default: + SPIRV_UNIMPLEMENTED(consumer_, "unhandled type"); + break; + } + + uint32_t id = inst.result_id(); + if (id == 0) { + SPIRV_ASSERT(consumer_, inst.opcode() == SpvOpTypeForwardPointer, + "instruction without result id found"); + } else { + SPIRV_ASSERT(consumer_, type != nullptr, + "type should not be nullptr at this point"); + std::vector decorations = + context()->get_decoration_mgr()->GetDecorationsFor(id, true); + for (auto dec : decorations) { + AttachDecoration(*dec, type); + } + std::unique_ptr unique(type); + auto pair = type_pool_.insert(std::move(unique)); + id_to_type_[id] = pair.first->get(); + type_to_id_[pair.first->get()] = id; + } + return type; +} + +void TypeManager::AttachDecoration(const ir::Instruction& inst, Type* type) { + const SpvOp opcode = inst.opcode(); + if (!ir::IsAnnotationInst(opcode)) return; + + switch (opcode) { + case SpvOpDecorate: { + const auto count = inst.NumOperands(); + std::vector data; + for (uint32_t i = 1; i < count; ++i) { + data.push_back(inst.GetSingleWordOperand(i)); + } + type->AddDecoration(std::move(data)); + } break; + case SpvOpMemberDecorate: { + const auto count = inst.NumOperands(); + const uint32_t index = inst.GetSingleWordOperand(1); + std::vector data; + for (uint32_t i = 2; i < count; ++i) { + data.push_back(inst.GetSingleWordOperand(i)); + } + if (Struct* st = type->AsStruct()) { + st->AddMemberDecoration(index, std::move(data)); + } else { + SPIRV_UNIMPLEMENTED(consumer_, "OpMemberDecorate non-struct type"); + } + } break; + default: + SPIRV_UNREACHABLE(consumer_); + break; + } +} + +const Type* TypeManager::GetMemberType( + const Type* parent_type, const std::vector& access_chain) { + for (uint32_t element_index : access_chain) { + if (const analysis::Struct* struct_type = parent_type->AsStruct()) { + parent_type = struct_type->element_types()[element_index]; + } else if (const analysis::Array* array_type = parent_type->AsArray()) { + parent_type = array_type->element_type(); + } else if (const analysis::RuntimeArray* runtime_array_type = + parent_type->AsRuntimeArray()) { + parent_type = runtime_array_type->element_type(); + } else if (const analysis::Vector* vector_type = parent_type->AsVector()) { + parent_type = vector_type->element_type(); + } else if (const analysis::Matrix* matrix_type = parent_type->AsMatrix()) { + parent_type = matrix_type->element_type(); + } else { + assert(false && "Trying to get a member of a type without members."); + } + } + return parent_type; +} + +} // namespace analysis +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/type_manager.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/type_manager.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/type_manager.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/type_manager.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,195 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_TYPE_MANAGER_H_ +#define LIBSPIRV_OPT_TYPE_MANAGER_H_ + +#include +#include +#include +#include + +#include "module.h" +#include "spirv-tools/libspirv.hpp" +#include "types.h" + +namespace spvtools { +namespace ir { +class IRContext; +} // namespace ir +namespace opt { +namespace analysis { + +// Hashing functor. +// +// All type pointers must be non-null. +struct HashTypePointer { + size_t operator()(const Type* type) const { + assert(type); + return type->HashValue(); + } +}; +struct HashTypeUniquePointer { + size_t operator()(const std::unique_ptr& type) const { + assert(type); + return type->HashValue(); + } +}; + +// Equality functor. +// +// Checks if two types pointers are the same type. +// +// All type pointers must be non-null. +struct CompareTypePointers { + bool operator()(const Type* lhs, const Type* rhs) const { + assert(lhs && rhs); + return lhs->IsSame(rhs); + } +}; +struct CompareTypeUniquePointers { + bool operator()(const std::unique_ptr& lhs, + const std::unique_ptr& rhs) const { + assert(lhs && rhs); + return lhs->IsSame(rhs.get()); + } +}; + +// A class for managing the SPIR-V type hierarchy. +class TypeManager { + public: + using IdToTypeMap = std::unordered_map; + + // Constructs a type manager from the given |module|. All internal messages + // will be communicated to the outside via the given message |consumer|. + // This instance only keeps a reference to the |consumer|, so the |consumer| + // should outlive this instance. + TypeManager(const MessageConsumer& consumer, spvtools::ir::IRContext* c); + + TypeManager(const TypeManager&) = delete; + TypeManager(TypeManager&&) = delete; + TypeManager& operator=(const TypeManager&) = delete; + TypeManager& operator=(TypeManager&&) = delete; + + // Returns the type for the given type |id|. Returns nullptr if the given |id| + // does not define a type. + Type* GetType(uint32_t id) const; + // Returns the id for the given |type|. Returns 0 if can not find the given + // |type|. + uint32_t GetId(const Type* type) const; + // Returns the number of types hold in this manager. + size_t NumTypes() const { return id_to_type_.size(); } + // Iterators for all types contained in this manager. + IdToTypeMap::const_iterator begin() const { return id_to_type_.cbegin(); } + IdToTypeMap::const_iterator end() const { return id_to_type_.cend(); } + + // Returns the forward pointer type at the given |index|. + ForwardPointer* GetForwardPointer(uint32_t index) const; + // Returns the number of forward pointer types hold in this manager. + size_t NumForwardPointers() const { return forward_pointers_.size(); } + + // Returns a pair of the type and pointer to the type in |sc|. + // + // |id| must be a registered type. + std::pair> GetTypeAndPointerType( + uint32_t id, SpvStorageClass sc) const; + + // Returns an id for a declaration representing |type|. + // + // If |type| is registered, then the registered id is returned. Otherwise, + // this function recursively adds type and annotation instructions as + // necessary to fully define |type|. + uint32_t GetTypeInstruction(const Type* type); + + // Find pointer to type and storage in module, return its resultId. If it is + // not found, a new type is created, and its id is returned. + uint32_t FindPointerToType(uint32_t type_id, SpvStorageClass storage_class); + + // Registers |id| to |type|. + // + // If GetId(|type|) already returns a non-zero id, that mapping will be + // unchanged. + void RegisterType(uint32_t id, const Type& type); + + Type* GetRegisteredType(const Type* type); + + // Removes knowledge of |id| from the manager. + // + // If |id| is an ambiguous type the multiple ids may be registered to |id|'s + // type (e.g. %struct1 and %struct1 might hash to the same type). In that + // case, calling GetId() with |id|'s type will return another suitable id + // defining that type. + void RemoveId(uint32_t id); + + // Returns the type of the member of |parent_type| that is identified by + // |access_chain|. The vector |access_chain| is a series of integers that are + // used to pick members as in the |OpCompositeExtract| instructions. If you + // want a member of an array, vector, or matrix that does not have a constant + // index, you can use 0 in that position. All elements have the same type. + const Type* GetMemberType(const Type* parent_type, + const std::vector& access_chain); + + private: + using TypeToIdMap = std::unordered_map; + using TypePool = + std::unordered_set, HashTypeUniquePointer, + CompareTypeUniquePointers>; + using ForwardPointerVector = std::vector>; + + // Analyzes the types and decorations on types in the given |module|. + void AnalyzeTypes(const spvtools::ir::Module& module); + + spvtools::ir::IRContext* context() { return context_; } + + // Attachs the decorations on |type| to |id|. + void AttachDecorations(uint32_t id, const Type* type); + + // Create the annotation instruction. + // + // If |element| is zero, an OpDecorate is created, other an OpMemberDecorate + // is created. The annotation is registered with the DefUseManager and the + // DecorationManager. + void CreateDecoration(uint32_t id, const std::vector& decoration, + uint32_t element = 0); + + // Creates and returns a type from the given SPIR-V |inst|. Returns nullptr if + // the given instruction is not for defining a type. + Type* RecordIfTypeDefinition(const spvtools::ir::Instruction& inst); + // Attaches the decoration encoded in |inst| to |type|. Does nothing if the + // given instruction is not a decoration instruction. Assumes the target is + // |type| (e.g. should be called in loop of |type|'s decorations). + void AttachDecoration(const spvtools::ir::Instruction& inst, Type* type); + + // Returns an equivalent pointer to |type| built in terms of pointers owned by + // |type_pool_|. For example, if |type| is a vec3 of bool, it will be rebuilt + // replacing the bool subtype with one owned by |type_pool_|. + Type* RebuildType(const Type& type); + + const MessageConsumer& consumer_; // Message consumer. + spvtools::ir::IRContext* context_; + IdToTypeMap id_to_type_; // Mapping from ids to their type representations. + TypeToIdMap type_to_id_; // Mapping from types to their defining ids. + TypePool type_pool_; // Memory owner of type pointers. + ForwardPointerVector forward_pointers_; // All forward pointer declarations. + // All unresolved forward pointer declarations. + // Refers the contents in the above vector. + std::unordered_set unresolved_forward_pointers_; +}; + +} // namespace analysis +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_TYPE_MANAGER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/types.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/types.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/types.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/types.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,588 @@ +// Copyright (c) 2016 Google 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. + +#include +#include +#include +#include + +#include "types.h" + +namespace spvtools { +namespace opt { +namespace analysis { + +using U32VecVec = std::vector>; + +namespace { + +// Returns true if the two vector of vectors are identical. +bool CompareTwoVectors(const U32VecVec a, const U32VecVec b) { + const auto size = a.size(); + if (size != b.size()) return false; + + if (size == 0) return true; + if (size == 1) return a.front() == b.front(); + + std::vector*> a_ptrs, b_ptrs; + a_ptrs.reserve(size); + a_ptrs.reserve(size); + for (uint32_t i = 0; i < size; ++i) { + a_ptrs.push_back(&a[i]); + b_ptrs.push_back(&b[i]); + } + + const auto cmp = [](const std::vector* m, + const std::vector* n) { + return m->front() < n->front(); + }; + + std::sort(a_ptrs.begin(), a_ptrs.end(), cmp); + std::sort(b_ptrs.begin(), b_ptrs.end(), cmp); + + for (uint32_t i = 0; i < size; ++i) { + if (*a_ptrs[i] != *b_ptrs[i]) return false; + } + return true; +} + +} // anonymous namespace + +std::string Type::GetDecorationStr() const { + std::ostringstream oss; + oss << "[["; + for (const auto& decoration : decorations_) { + oss << "("; + for (size_t i = 0; i < decoration.size(); ++i) { + oss << (i > 0 ? ", " : ""); + oss << decoration.at(i); + } + oss << ")"; + } + oss << "]]"; + return oss.str(); +} + +bool Type::HasSameDecorations(const Type* that) const { + return CompareTwoVectors(decorations_, that->decorations_); +} + +bool Type::IsUniqueType(bool allowVariablePointers) const { + switch (kind_) { + case kPointer: + return !allowVariablePointers; + case kStruct: + case kArray: + case kRuntimeArray: + return false; + default: + return true; + } +} + +std::unique_ptr Type::Clone() const { + std::unique_ptr type; + switch (kind_) { +#define DeclareKindCase(kind) \ + case k##kind: \ + type.reset(new kind(*this->As##kind())); \ + break; + DeclareKindCase(Void); + DeclareKindCase(Bool); + DeclareKindCase(Integer); + DeclareKindCase(Float); + DeclareKindCase(Vector); + DeclareKindCase(Matrix); + DeclareKindCase(Image); + DeclareKindCase(Sampler); + DeclareKindCase(SampledImage); + DeclareKindCase(Array); + DeclareKindCase(RuntimeArray); + DeclareKindCase(Struct); + DeclareKindCase(Opaque); + DeclareKindCase(Pointer); + DeclareKindCase(Function); + DeclareKindCase(Event); + DeclareKindCase(DeviceEvent); + DeclareKindCase(ReserveId); + DeclareKindCase(Queue); + DeclareKindCase(Pipe); + DeclareKindCase(ForwardPointer); + DeclareKindCase(PipeStorage); + DeclareKindCase(NamedBarrier); +#undef DeclareKindCase + default: + assert(false && "Unhandled type"); + } + return type; +} + +std::unique_ptr Type::RemoveDecorations() const { + std::unique_ptr type(Clone()); + type->ClearDecorations(); + return type; +} + +bool Type::operator==(const Type& other) const { + if (kind_ != other.kind_) return false; + + switch (kind_) { +#define DeclareKindCase(kind) \ + case k##kind: \ + return As##kind()->IsSame(&other); + DeclareKindCase(Void); + DeclareKindCase(Bool); + DeclareKindCase(Integer); + DeclareKindCase(Float); + DeclareKindCase(Vector); + DeclareKindCase(Matrix); + DeclareKindCase(Image); + DeclareKindCase(Sampler); + DeclareKindCase(SampledImage); + DeclareKindCase(Array); + DeclareKindCase(RuntimeArray); + DeclareKindCase(Struct); + DeclareKindCase(Opaque); + DeclareKindCase(Pointer); + DeclareKindCase(Function); + DeclareKindCase(Event); + DeclareKindCase(DeviceEvent); + DeclareKindCase(ReserveId); + DeclareKindCase(Queue); + DeclareKindCase(Pipe); + DeclareKindCase(ForwardPointer); + DeclareKindCase(PipeStorage); + DeclareKindCase(NamedBarrier); +#undef DeclareKindCase + default: + assert(false && "Unhandled type"); + return false; + } +} + +void Type::GetHashWords(std::vector* words) const { + words->push_back(kind_); + for (const auto& d : decorations_) { + for (auto w : d) { + words->push_back(w); + } + } + + switch (kind_) { +#define DeclareKindCase(type) \ + case k##type: \ + As##type()->GetExtraHashWords(words); \ + break; + DeclareKindCase(Void); + DeclareKindCase(Bool); + DeclareKindCase(Integer); + DeclareKindCase(Float); + DeclareKindCase(Vector); + DeclareKindCase(Matrix); + DeclareKindCase(Image); + DeclareKindCase(Sampler); + DeclareKindCase(SampledImage); + DeclareKindCase(Array); + DeclareKindCase(RuntimeArray); + DeclareKindCase(Struct); + DeclareKindCase(Opaque); + DeclareKindCase(Pointer); + DeclareKindCase(Function); + DeclareKindCase(Event); + DeclareKindCase(DeviceEvent); + DeclareKindCase(ReserveId); + DeclareKindCase(Queue); + DeclareKindCase(Pipe); + DeclareKindCase(ForwardPointer); + DeclareKindCase(PipeStorage); + DeclareKindCase(NamedBarrier); +#undef DeclareKindCase + default: + assert(false && "Unhandled type"); + break; + } +} + +size_t Type::HashValue() const { + std::u32string h; + std::vector words; + GetHashWords(&words); + for (auto w : words) { + h.push_back(w); + } + + return std::hash()(h); +} + +bool Integer::IsSame(const Type* that) const { + const Integer* it = that->AsInteger(); + return it && width_ == it->width_ && signed_ == it->signed_ && + HasSameDecorations(that); +} + +std::string Integer::str() const { + std::ostringstream oss; + oss << (signed_ ? "s" : "u") << "int" << width_; + return oss.str(); +} + +void Integer::GetExtraHashWords(std::vector* words) const { + words->push_back(width_); + words->push_back(signed_); +} + +bool Float::IsSame(const Type* that) const { + const Float* ft = that->AsFloat(); + return ft && width_ == ft->width_ && HasSameDecorations(that); +} + +std::string Float::str() const { + std::ostringstream oss; + oss << "float" << width_; + return oss.str(); +} + +void Float::GetExtraHashWords(std::vector* words) const { + words->push_back(width_); +} + +Vector::Vector(Type* type, uint32_t count) + : Type(kVector), element_type_(type), count_(count) { + assert(type->AsBool() || type->AsInteger() || type->AsFloat()); +} + +bool Vector::IsSame(const Type* that) const { + const Vector* vt = that->AsVector(); + if (!vt) return false; + return count_ == vt->count_ && element_type_->IsSame(vt->element_type_) && + HasSameDecorations(that); +} + +std::string Vector::str() const { + std::ostringstream oss; + oss << "<" << element_type_->str() << ", " << count_ << ">"; + return oss.str(); +} + +void Vector::GetExtraHashWords(std::vector* words) const { + element_type_->GetHashWords(words); + words->push_back(count_); +} + +Matrix::Matrix(Type* type, uint32_t count) + : Type(kMatrix), element_type_(type), count_(count) { + assert(type->AsVector()); +} + +bool Matrix::IsSame(const Type* that) const { + const Matrix* mt = that->AsMatrix(); + if (!mt) return false; + return count_ == mt->count_ && element_type_->IsSame(mt->element_type_) && + HasSameDecorations(that); +} + +std::string Matrix::str() const { + std::ostringstream oss; + oss << "<" << element_type_->str() << ", " << count_ << ">"; + return oss.str(); +} + +void Matrix::GetExtraHashWords(std::vector* words) const { + element_type_->GetHashWords(words); + words->push_back(count_); +} + +Image::Image(Type* type, SpvDim dimen, uint32_t d, bool array, bool multisample, + uint32_t sampling, SpvImageFormat f, SpvAccessQualifier qualifier) + : Type(kImage), + sampled_type_(type), + dim_(dimen), + depth_(d), + arrayed_(array), + ms_(multisample), + sampled_(sampling), + format_(f), + access_qualifier_(qualifier) { + // TODO(antiagainst): check sampled_type +} + +bool Image::IsSame(const Type* that) const { + const Image* it = that->AsImage(); + if (!it) return false; + return dim_ == it->dim_ && depth_ == it->depth_ && arrayed_ == it->arrayed_ && + ms_ == it->ms_ && sampled_ == it->sampled_ && format_ == it->format_ && + access_qualifier_ == it->access_qualifier_ && + sampled_type_->IsSame(it->sampled_type_) && HasSameDecorations(that); +} + +std::string Image::str() const { + std::ostringstream oss; + oss << "image(" << sampled_type_->str() << ", " << dim_ << ", " << depth_ + << ", " << arrayed_ << ", " << ms_ << ", " << sampled_ << ", " << format_ + << ", " << access_qualifier_ << ")"; + return oss.str(); +} + +void Image::GetExtraHashWords(std::vector* words) const { + sampled_type_->GetHashWords(words); + words->push_back(dim_); + words->push_back(depth_); + words->push_back(arrayed_); + words->push_back(ms_); + words->push_back(sampled_); + words->push_back(format_); + words->push_back(access_qualifier_); +} + +bool SampledImage::IsSame(const Type* that) const { + const SampledImage* sit = that->AsSampledImage(); + if (!sit) return false; + return image_type_->IsSame(sit->image_type_) && HasSameDecorations(that); +} + +std::string SampledImage::str() const { + std::ostringstream oss; + oss << "sampled_image(" << image_type_->str() << ")"; + return oss.str(); +} + +void SampledImage::GetExtraHashWords(std::vector* words) const { + image_type_->GetHashWords(words); +} + +Array::Array(Type* type, uint32_t length_id) + : Type(kArray), element_type_(type), length_id_(length_id) { + assert(!type->AsVoid()); +} + +bool Array::IsSame(const Type* that) const { + const Array* at = that->AsArray(); + if (!at) return false; + return length_id_ == at->length_id_ && + element_type_->IsSame(at->element_type_) && HasSameDecorations(that); +} + +std::string Array::str() const { + std::ostringstream oss; + oss << "[" << element_type_->str() << ", id(" << length_id_ << ")]"; + return oss.str(); +} + +void Array::GetExtraHashWords(std::vector* words) const { + element_type_->GetHashWords(words); + words->push_back(length_id_); +} + +RuntimeArray::RuntimeArray(Type* type) + : Type(kRuntimeArray), element_type_(type) { + assert(!type->AsVoid()); +} + +bool RuntimeArray::IsSame(const Type* that) const { + const RuntimeArray* rat = that->AsRuntimeArray(); + if (!rat) return false; + return element_type_->IsSame(rat->element_type_) && HasSameDecorations(that); +} + +std::string RuntimeArray::str() const { + std::ostringstream oss; + oss << "[" << element_type_->str() << "]"; + return oss.str(); +} + +void RuntimeArray::GetExtraHashWords(std::vector* words) const { + element_type_->GetHashWords(words); +} + +Struct::Struct(const std::vector& types) + : Type(kStruct), element_types_(types) { + for (const auto* t : types) { + (void)t; + assert(!t->AsVoid()); + } +} + +void Struct::AddMemberDecoration(uint32_t index, + std::vector&& decoration) { + if (index >= element_types_.size()) { + assert(0 && "index out of bound"); + return; + } + + element_decorations_[index].push_back(std::move(decoration)); +} + +bool Struct::IsSame(const Type* that) const { + const Struct* st = that->AsStruct(); + if (!st) return false; + if (element_types_.size() != st->element_types_.size()) return false; + const auto size = element_decorations_.size(); + if (size != st->element_decorations_.size()) return false; + if (!HasSameDecorations(that)) return false; + + for (size_t i = 0; i < element_types_.size(); ++i) { + if (!element_types_[i]->IsSame(st->element_types_[i])) return false; + } + for (const auto& p : element_decorations_) { + if (st->element_decorations_.count(p.first) == 0) return false; + if (!CompareTwoVectors(p.second, st->element_decorations_.at(p.first))) + return false; + } + return true; +} + +std::string Struct::str() const { + std::ostringstream oss; + oss << "{"; + const size_t count = element_types_.size(); + for (size_t i = 0; i < count; ++i) { + oss << element_types_[i]->str(); + if (i + 1 != count) oss << ", "; + } + oss << "}"; + return oss.str(); +} + +void Struct::GetExtraHashWords(std::vector* words) const { + for (auto* t : element_types_) { + t->GetHashWords(words); + } + for (const auto& pair : element_decorations_) { + words->push_back(pair.first); + for (const auto& d : pair.second) { + for (auto w : d) { + words->push_back(w); + } + } + } +} + +bool Opaque::IsSame(const Type* that) const { + const Opaque* ot = that->AsOpaque(); + if (!ot) return false; + return name_ == ot->name_ && HasSameDecorations(that); +} + +std::string Opaque::str() const { + std::ostringstream oss; + oss << "opaque('" << name_ << "')"; + return oss.str(); +} + +void Opaque::GetExtraHashWords(std::vector* words) const { + for (auto c : name_) { + words->push_back(static_cast(c)); + } +} + +Pointer::Pointer(const Type* type, SpvStorageClass sc) + : Type(kPointer), pointee_type_(type), storage_class_(sc) {} + +bool Pointer::IsSame(const Type* that) const { + const Pointer* pt = that->AsPointer(); + if (!pt) return false; + if (storage_class_ != pt->storage_class_) return false; + if (!pointee_type_->IsSame(pt->pointee_type_)) return false; + return HasSameDecorations(that); +} + +std::string Pointer::str() const { return pointee_type_->str() + "*"; } + +void Pointer::GetExtraHashWords(std::vector* words) const { + pointee_type_->GetHashWords(words); + words->push_back(storage_class_); +} + +Function::Function(Type* ret_type, const std::vector& params) + : Type(kFunction), return_type_(ret_type), param_types_(params) { + for (auto* t : params) { + (void)t; + assert(!t->AsVoid()); + } +} + +bool Function::IsSame(const Type* that) const { + const Function* ft = that->AsFunction(); + if (!ft) return false; + if (!return_type_->IsSame(ft->return_type_)) return false; + if (param_types_.size() != ft->param_types_.size()) return false; + for (size_t i = 0; i < param_types_.size(); ++i) { + if (!param_types_[i]->IsSame(ft->param_types_[i])) return false; + } + return HasSameDecorations(that); +} + +std::string Function::str() const { + std::ostringstream oss; + const size_t count = param_types_.size(); + oss << "("; + for (size_t i = 0; i < count; ++i) { + oss << param_types_[i]->str(); + if (i + 1 != count) oss << ", "; + } + oss << ") -> " << return_type_->str(); + return oss.str(); +} + +void Function::GetExtraHashWords(std::vector* words) const { + return_type_->GetHashWords(words); + for (const auto* t : param_types_) { + t->GetHashWords(words); + } +} + +bool Pipe::IsSame(const Type* that) const { + const Pipe* pt = that->AsPipe(); + if (!pt) return false; + return access_qualifier_ == pt->access_qualifier_ && HasSameDecorations(that); +} + +std::string Pipe::str() const { + std::ostringstream oss; + oss << "pipe(" << access_qualifier_ << ")"; + return oss.str(); +} + +void Pipe::GetExtraHashWords(std::vector* words) const { + words->push_back(access_qualifier_); +} + +bool ForwardPointer::IsSame(const Type* that) const { + const ForwardPointer* fpt = that->AsForwardPointer(); + if (!fpt) return false; + return target_id_ == fpt->target_id_ && + storage_class_ == fpt->storage_class_ && HasSameDecorations(that); +} + +std::string ForwardPointer::str() const { + std::ostringstream oss; + oss << "forward_pointer("; + if (pointer_ != nullptr) { + oss << pointer_->str(); + } else { + oss << target_id_; + } + oss << ")"; + return oss.str(); +} + +void ForwardPointer::GetExtraHashWords(std::vector* words) const { + words->push_back(target_id_); + words->push_back(storage_class_); + if (pointer_) pointer_->GetHashWords(words); +} + +} // namespace analysis +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/types.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/types.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/types.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/types.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,538 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file provides a class hierarchy for representing SPIR-V types. + +#ifndef LIBSPIRV_OPT_TYPES_H_ +#define LIBSPIRV_OPT_TYPES_H_ + +#include +#include +#include +#include +#include + +#include "latest_version_spirv_header.h" +#include "spirv-tools/libspirv.h" + +namespace spvtools { +namespace opt { +namespace analysis { + +class Void; +class Bool; +class Integer; +class Float; +class Vector; +class Matrix; +class Image; +class Sampler; +class SampledImage; +class Array; +class RuntimeArray; +class Struct; +class Opaque; +class Pointer; +class Function; +class Event; +class DeviceEvent; +class ReserveId; +class Queue; +class Pipe; +class ForwardPointer; +class PipeStorage; +class NamedBarrier; + +// Abstract class for a SPIR-V type. It has a bunch of As() methods, +// which is used as a way to probe the actual . +class Type { + public: + // Available subtypes. + // + // When adding a new derived class of Type, please add an entry to the enum. + enum Kind { + kVoid, + kBool, + kInteger, + kFloat, + kVector, + kMatrix, + kImage, + kSampler, + kSampledImage, + kArray, + kRuntimeArray, + kStruct, + kOpaque, + kPointer, + kFunction, + kEvent, + kDeviceEvent, + kReserveId, + kQueue, + kPipe, + kForwardPointer, + kPipeStorage, + kNamedBarrier, + }; + + Type(Kind k) : kind_(k) {} + + virtual ~Type() {} + + // Attaches a decoration directly on this type. + void AddDecoration(std::vector&& d) { + decorations_.push_back(std::move(d)); + } + // Returns the decorations on this type as a string. + std::string GetDecorationStr() const; + // Returns true if this type has exactly the same decorations as |that| type. + bool HasSameDecorations(const Type* that) const; + // Returns true if this type is exactly the same as |that| type, including + // decorations. + virtual bool IsSame(const Type* that) const = 0; + // Returns a human-readable string to represent this type. + virtual std::string str() const = 0; + + Kind kind() const { return kind_; } + const std::vector>& decorations() const { + return decorations_; + } + + // Returns true if there is no decoration on this type. For struct types, + // returns true only when there is no decoration for both the struct type + // and the struct members. + virtual bool decoration_empty() const { return decorations_.empty(); } + + // Creates a clone of |this|. + std::unique_ptr Clone() const; + + // Returns a clone of |this| minus any decorations. + std::unique_ptr RemoveDecorations() const; + + // Returns true if this type must be unique. + // + // If variable pointers are allowed, then pointers are not required to be + // unique. + // TODO(alanbaker): Update this if variable pointers become a core feature. + bool IsUniqueType(bool allowVariablePointers = false) const; + +// A bunch of methods for casting this type to a given type. Returns this if the +// cast can be done, nullptr otherwise. +#define DeclareCastMethod(target) \ + virtual target* As##target() { return nullptr; } \ + virtual const target* As##target() const { return nullptr; } + DeclareCastMethod(Void); + DeclareCastMethod(Bool); + DeclareCastMethod(Integer); + DeclareCastMethod(Float); + DeclareCastMethod(Vector); + DeclareCastMethod(Matrix); + DeclareCastMethod(Image); + DeclareCastMethod(Sampler); + DeclareCastMethod(SampledImage); + DeclareCastMethod(Array); + DeclareCastMethod(RuntimeArray); + DeclareCastMethod(Struct); + DeclareCastMethod(Opaque); + DeclareCastMethod(Pointer); + DeclareCastMethod(Function); + DeclareCastMethod(Event); + DeclareCastMethod(DeviceEvent); + DeclareCastMethod(ReserveId); + DeclareCastMethod(Queue); + DeclareCastMethod(Pipe); + DeclareCastMethod(ForwardPointer); + DeclareCastMethod(PipeStorage); + DeclareCastMethod(NamedBarrier); +#undef DeclareCastMethod + + bool operator==(const Type& other) const; + + // Returns the hash value of this type. + size_t HashValue() const; + + // Adds the necessary words to compute a hash value of this type to |words|. + void GetHashWords(std::vector* words) const; + + // Adds necessary extra words for a subtype to calculate a hash value into + // |words|. + virtual void GetExtraHashWords(std::vector* words) const = 0; + + protected: + // Decorations attached to this type. Each decoration is encoded as a vector + // of uint32_t numbers. The first uint32_t number is the decoration value, + // and the rest are the parameters to the decoration (if exists). + std::vector> decorations_; + + private: + // Removes decorations on this type. For struct types, also removes element + // decorations. + virtual void ClearDecorations() { decorations_.clear(); } + + Kind kind_; +}; + +class Integer : public Type { + public: + Integer(uint32_t w, bool is_signed) + : Type(kInteger), width_(w), signed_(is_signed) {} + Integer(const Integer&) = default; + + bool IsSame(const Type* that) const override; + std::string str() const override; + + Integer* AsInteger() override { return this; } + const Integer* AsInteger() const override { return this; } + uint32_t width() const { return width_; } + bool IsSigned() const { return signed_; } + + void GetExtraHashWords(std::vector* words) const override; + + private: + uint32_t width_; // bit width + bool signed_; // true if this integer is signed +}; + +class Float : public Type { + public: + Float(uint32_t w) : Type(kFloat), width_(w) {} + Float(const Float&) = default; + + bool IsSame(const Type* that) const override; + std::string str() const override; + + Float* AsFloat() override { return this; } + const Float* AsFloat() const override { return this; } + uint32_t width() const { return width_; } + + void GetExtraHashWords(std::vector* words) const override; + + private: + uint32_t width_; // bit width +}; + +class Vector : public Type { + public: + Vector(Type* element_type, uint32_t count); + Vector(const Vector&) = default; + + bool IsSame(const Type* that) const override; + std::string str() const override; + const Type* element_type() const { return element_type_; } + uint32_t element_count() const { return count_; } + + Vector* AsVector() override { return this; } + const Vector* AsVector() const override { return this; } + + void GetExtraHashWords(std::vector* words) const override; + + private: + Type* element_type_; + uint32_t count_; +}; + +class Matrix : public Type { + public: + Matrix(Type* element_type, uint32_t count); + Matrix(const Matrix&) = default; + + bool IsSame(const Type* that) const override; + std::string str() const override; + const Type* element_type() const { return element_type_; } + uint32_t element_count() const { return count_; } + + Matrix* AsMatrix() override { return this; } + const Matrix* AsMatrix() const override { return this; } + + void GetExtraHashWords(std::vector* words) const override; + + private: + Type* element_type_; + uint32_t count_; +}; + +class Image : public Type { + public: + Image(Type* type, SpvDim dimen, uint32_t d, bool array, bool multisample, + uint32_t sampling, SpvImageFormat f, + SpvAccessQualifier qualifier = SpvAccessQualifierReadOnly); + Image(const Image&) = default; + + bool IsSame(const Type* that) const override; + std::string str() const override; + + Image* AsImage() override { return this; } + const Image* AsImage() const override { return this; } + + const Type* sampled_type() const { return sampled_type_; } + SpvDim dim() const { return dim_; } + uint32_t depth() const { return depth_; } + bool is_arrayed() const { return arrayed_; } + bool is_multisampled() const { return ms_; } + uint32_t sampled() const { return sampled_; } + SpvImageFormat format() const { return format_; } + SpvAccessQualifier access_qualifier() const { return access_qualifier_; } + + void GetExtraHashWords(std::vector* words) const override; + + private: + Type* sampled_type_; + SpvDim dim_; + uint32_t depth_; + bool arrayed_; + bool ms_; + uint32_t sampled_; + SpvImageFormat format_; + SpvAccessQualifier access_qualifier_; +}; + +class SampledImage : public Type { + public: + SampledImage(Type* image) : Type(kSampledImage), image_type_(image) {} + SampledImage(const SampledImage&) = default; + + bool IsSame(const Type* that) const override; + std::string str() const override; + + SampledImage* AsSampledImage() override { return this; } + const SampledImage* AsSampledImage() const override { return this; } + + const Type* image_type() const { return image_type_; } + + void GetExtraHashWords(std::vector* words) const override; + + private: + Type* image_type_; +}; + +class Array : public Type { + public: + Array(Type* element_type, uint32_t length_id); + Array(const Array&) = default; + + bool IsSame(const Type* that) const override; + std::string str() const override; + const Type* element_type() const { return element_type_; } + uint32_t LengthId() const { return length_id_; } + + Array* AsArray() override { return this; } + const Array* AsArray() const override { return this; } + + void GetExtraHashWords(std::vector* words) const override; + + private: + Type* element_type_; + uint32_t length_id_; +}; + +class RuntimeArray : public Type { + public: + RuntimeArray(Type* element_type); + RuntimeArray(const RuntimeArray&) = default; + + bool IsSame(const Type* that) const override; + std::string str() const override; + const Type* element_type() const { return element_type_; } + + RuntimeArray* AsRuntimeArray() override { return this; } + const RuntimeArray* AsRuntimeArray() const override { return this; } + + void GetExtraHashWords(std::vector* words) const override; + + private: + Type* element_type_; +}; + +class Struct : public Type { + public: + Struct(const std::vector& element_types); + Struct(const Struct&) = default; + + // Adds a decoration to the member at the given index. The first word is the + // decoration enum, and the remaining words, if any, are its operands. + void AddMemberDecoration(uint32_t index, std::vector&& decoration); + + bool IsSame(const Type* that) const override; + std::string str() const override; + const std::vector& element_types() const { return element_types_; } + bool decoration_empty() const override { + return decorations_.empty() && element_decorations_.empty(); + } + + const std::map>>& + element_decorations() const { + return element_decorations_; + } + + Struct* AsStruct() override { return this; } + const Struct* AsStruct() const override { return this; } + + void GetExtraHashWords(std::vector* words) const override; + + private: + void ClearDecorations() override { + decorations_.clear(); + element_decorations_.clear(); + } + + std::vector element_types_; + // We can attach decorations to struct members and that should not affect the + // underlying element type. So we need an extra data structure here to keep + // track of element type decorations. They must be stored in an ordered map + // because |GetExtraHashWords| will traverse the structure. It must have a + // fixed order in order to hash to the same value every time. + std::map>> element_decorations_; +}; + +class Opaque : public Type { + public: + Opaque(std::string n) : Type(kOpaque), name_(std::move(n)) {} + Opaque(const Opaque&) = default; + + bool IsSame(const Type* that) const override; + std::string str() const override; + + Opaque* AsOpaque() override { return this; } + const Opaque* AsOpaque() const override { return this; } + + const std::string& name() const { return name_; } + + void GetExtraHashWords(std::vector* words) const override; + + private: + std::string name_; +}; + +class Pointer : public Type { + public: + Pointer(const Type* pointee, SpvStorageClass sc); + Pointer(const Pointer&) = default; + + bool IsSame(const Type* that) const override; + std::string str() const override; + const Type* pointee_type() const { return pointee_type_; } + SpvStorageClass storage_class() const { return storage_class_; } + + Pointer* AsPointer() override { return this; } + const Pointer* AsPointer() const override { return this; } + + void GetExtraHashWords(std::vector* words) const override; + + private: + const Type* pointee_type_; + SpvStorageClass storage_class_; +}; + +class Function : public Type { + public: + Function(Type* ret_type, const std::vector& params); + Function(const Function&) = default; + + bool IsSame(const Type* that) const override; + std::string str() const override; + + Function* AsFunction() override { return this; } + const Function* AsFunction() const override { return this; } + + const Type* return_type() const { return return_type_; } + const std::vector& param_types() const { return param_types_; } + + void GetExtraHashWords(std::vector* words) const override; + + private: + Type* return_type_; + std::vector param_types_; +}; + +class Pipe : public Type { + public: + Pipe(SpvAccessQualifier qualifier) + : Type(kPipe), access_qualifier_(qualifier) {} + Pipe(const Pipe&) = default; + + bool IsSame(const Type* that) const override; + std::string str() const override; + + Pipe* AsPipe() override { return this; } + const Pipe* AsPipe() const override { return this; } + + SpvAccessQualifier access_qualifier() const { return access_qualifier_; } + + void GetExtraHashWords(std::vector* words) const override; + + private: + SpvAccessQualifier access_qualifier_; +}; + +class ForwardPointer : public Type { + public: + ForwardPointer(uint32_t id, SpvStorageClass sc) + : Type(kForwardPointer), + target_id_(id), + storage_class_(sc), + pointer_(nullptr) {} + ForwardPointer(const ForwardPointer&) = default; + + uint32_t target_id() const { return target_id_; } + void SetTargetPointer(Pointer* pointer) { pointer_ = pointer; } + SpvStorageClass storage_class() const { return storage_class_; } + const Pointer* target_pointer() const { return pointer_; } + + bool IsSame(const Type* that) const override; + std::string str() const override; + + ForwardPointer* AsForwardPointer() override { return this; } + const ForwardPointer* AsForwardPointer() const override { return this; } + + void GetExtraHashWords(std::vector* words) const override; + + private: + uint32_t target_id_; + SpvStorageClass storage_class_; + Pointer* pointer_; +}; + +#define DefineParameterlessType(type, name) \ + class type : public Type { \ + public: \ + type() : Type(k##type) {} \ + type(const type&) = default; \ + \ + bool IsSame(const Type* that) const override { \ + return that->As##type() && HasSameDecorations(that); \ + } \ + std::string str() const override { return #name; } \ + \ + type* As##type() override { return this; } \ + const type* As##type() const override { return this; } \ + \ + void GetExtraHashWords(std::vector*) const override {} \ + } +DefineParameterlessType(Void, void); +DefineParameterlessType(Bool, bool); +DefineParameterlessType(Sampler, sampler); +DefineParameterlessType(Event, event); +DefineParameterlessType(DeviceEvent, device_event); +DefineParameterlessType(ReserveId, reserve_id); +DefineParameterlessType(Queue, queue); +DefineParameterlessType(PipeStorage, pipe_storage); +DefineParameterlessType(NamedBarrier, named_barrier); +#undef DefineParameterlessType + +} // namespace analysis +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_TYPES_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/unify_const_pass.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/unify_const_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/unify_const_pass.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/unify_const_pass.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,174 @@ +// Copyright (c) 2016 Google 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. + +#include "unify_const_pass.h" + +#include +#include + +#include "def_use_manager.h" +#include "ir_context.h" +#include "make_unique.h" + +namespace spvtools { +namespace opt { + +namespace { + +// The trie that stores a bunch of result ids and, for a given instruction, +// searches the result id that has been defined with the same opcode, type and +// operands. +class ResultIdTrie { + public: + ResultIdTrie() : root_(new Node) {} + + // For a given instruction, extracts its opcode, type id and operand words + // as an array of keys, looks up the trie to find a result id which is stored + // with the same opcode, type id and operand words. If none of such result id + // is found, creates a trie node with those keys, stores the instruction's + // result id and returns that result id. If an existing result id is found, + // returns the existing result id. + uint32_t LookupEquivalentResultFor(const ir::Instruction& inst) { + auto keys = GetLookUpKeys(inst); + auto* node = root_.get(); + for (uint32_t key : keys) { + node = node->GetOrCreateTrieNodeFor(key); + } + if (node->result_id() == 0) { + node->SetResultId(inst.result_id()); + } + return node->result_id(); + } + + private: + // The trie node to store result ids. + class Node { + public: + using TrieNodeMap = std::unordered_map>; + + Node() : result_id_(0), next_() {} + uint32_t result_id() const { return result_id_; } + + // Sets the result id stored in this node. + void SetResultId(uint32_t id) { result_id_ = id; } + + // Searches for the child trie node with the given key. If the node is + // found, returns that node. Otherwise creates an empty child node with + // that key and returns that newly created node. + Node* GetOrCreateTrieNodeFor(uint32_t key) { + auto iter = next_.find(key); + if (iter == next_.end()) { + // insert a new node and return the node. + return next_.insert(std::make_pair(key, MakeUnique())) + .first->second.get(); + } + return iter->second.get(); + } + + private: + // The result id stored in this node. 0 means this node is empty. + uint32_t result_id_; + // The mapping from the keys to the child nodes of this node. + TrieNodeMap next_; + }; + + // Returns a vector of the opcode followed by the words in the raw SPIR-V + // instruction encoding but without the result id. + std::vector GetLookUpKeys(const ir::Instruction& inst) { + std::vector keys; + // Need to use the opcode, otherwise there might be a conflict with the + // following case when 's binary value equals xx's id: + // OpSpecConstantOp tt yy zz + // OpSpecConstantComposite tt xx yy zz; + keys.push_back(static_cast(inst.opcode())); + for (const auto& operand : inst) { + if (operand.type == SPV_OPERAND_TYPE_RESULT_ID) continue; + keys.insert(keys.end(), operand.words.cbegin(), operand.words.cend()); + } + return keys; + } + + std::unique_ptr root_; // The root node of the trie. +}; +} // anonymous namespace + +Pass::Status UnifyConstantPass::Process(ir::IRContext* c) { + InitializeProcessing(c); + bool modified = false; + ResultIdTrie defined_constants; + + for( ir::Instruction* next_instruction, *inst = &*(context()->types_values_begin()); inst; inst = next_instruction) { + next_instruction = inst->NextNode(); + + // Do not handle the instruction when there are decorations upon the result + // id. + if (get_def_use_mgr()->GetAnnotations(inst->result_id()).size() != 0) { + continue; + } + + // The overall algorithm is to store the result ids of all the eligible + // constants encountered so far in a trie. For a constant defining + // instruction under consideration, use its opcode, result type id and + // words in operands as an array of keys to lookup the trie. If a result id + // can be found for that array of keys, a constant with exactly the same + // value must has been defined before, the constant under processing + // should be replaced by the constant previously defined. If no such result + // id can be found for that array of keys, this must be the first time a + // constant with its value be defined, we then create a new trie node to + // store the result id with the keys. When replacing a duplicated constant + // with a previously defined constant, all the uses of the duplicated + // constant, which must be placed after the duplicated constant defining + // instruction, will be updated. This way, the descendants of the + // previously defined constant and the duplicated constant will both refer + // to the previously defined constant. So that the operand ids which are + // used in key arrays will be the ids of the unified constants, when + // processing is up to a descendant. This makes comparing the key array + // always valid for judging duplication. + switch (inst->opcode()) { + case SpvOp::SpvOpConstantTrue: + case SpvOp::SpvOpConstantFalse: + case SpvOp::SpvOpConstant: + case SpvOp::SpvOpConstantNull: + case SpvOp::SpvOpConstantSampler: + case SpvOp::SpvOpConstantComposite: + // Only spec constants defined with OpSpecConstantOp and + // OpSpecConstantComposite should be processed in this pass. Spec + // constants defined with OpSpecConstant{|True|False} are decorated with + // 'SpecId' decoration and all of them should be treated as unique. + // 'SpecId' is not applicable to SpecConstants defined with + // OpSpecConstant{Op|Composite}, their values are not necessary to be + // unique. When all the operands/compoents are the same between two + // OpSpecConstant{Op|Composite} results, their result values must be the + // same so are unifiable. + case SpvOp::SpvOpSpecConstantOp: + case SpvOp::SpvOpSpecConstantComposite: { + uint32_t id = defined_constants.LookupEquivalentResultFor(*inst); + if (id != inst->result_id()) { + // The constant is a duplicated one, use the cached constant to + // replace the uses of this duplicated one, then turn it to nop. + context()->ReplaceAllUsesWith(inst->result_id(), id); + context()->KillInst(inst); + modified = true; + } + break; + } + default: + break; + } + } + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/unify_const_pass.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/unify_const_pass.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/unify_const_pass.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/unify_const_pass.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,35 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_UNIFY_CONSTANT_PASS_H_ +#define LIBSPIRV_OPT_UNIFY_CONSTANT_PASS_H_ + +#include "ir_context.h" +#include "module.h" +#include "pass.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class UnifyConstantPass : public Pass { + public: + const char* name() const override { return "unify-const"; } + Status Process(ir::IRContext*) override; +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_UNIFY_CONSTANT_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/value_number_table.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/value_number_table.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/value_number_table.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/value_number_table.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,224 @@ +// Copyright (c) 2017 Google 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. + +#include "value_number_table.h" + +#include + +#include "cfg.h" + +namespace spvtools { +namespace opt { + +uint32_t ValueNumberTable::GetValueNumber( + spvtools::ir::Instruction* inst) const { + assert(inst->result_id() != 0 && + "inst must have a result id to get a value number."); + + // Check if this instruction already has a value. + auto result_id_to_val = id_to_value_.find(inst->result_id()); + if (result_id_to_val != id_to_value_.end()) { + return result_id_to_val->second; + } + return 0; +} + +uint32_t ValueNumberTable::AssignValueNumber(ir::Instruction* inst) { + // If it already has a value return that. + uint32_t value = GetValueNumber(inst); + if (value != 0) { + return value; + } + + // If the instruction has other side effects, then it must + // have its own value number. + // OpSampledImage and OpImage must remain in the same basic block in which + // they are used, because of this we will assign each one it own value number. + if (!context()->IsCombinatorInstruction(inst)) { + value = TakeNextValueNumber(); + id_to_value_[inst->result_id()] = value; + return value; + } + + switch (inst->opcode()) { + case SpvOpSampledImage: + case SpvOpImage: + case SpvOpVariable: + value = TakeNextValueNumber(); + id_to_value_[inst->result_id()] = value; + return value; + default: + break; + } + + // If it is a load from memory that can be modified, we have to assume the + // memory has been modified, so we give it a new value number. + // + // Note that this test will also handle volatile loads because they are not + // read only. However, if this is ever relaxed because we analyze stores, we + // will have to add a new case for volatile loads. + if (inst->IsLoad() && !inst->IsReadOnlyLoad()) { + value = TakeNextValueNumber(); + id_to_value_[inst->result_id()] = value; + return value; + } + + // When we copy an object, the value numbers should be the same. + if (inst->opcode() == SpvOpCopyObject) { + value = GetValueNumber(inst->GetSingleWordInOperand(0)); + if (value != 0) { + id_to_value_[inst->result_id()] = value; + return value; + } + } + + // Phi nodes are a type of copy. If all of the inputs have the same value + // number, then we can assign the result of the phi the same value number. + if (inst->opcode() == SpvOpPhi) { + value = GetValueNumber(inst->GetSingleWordInOperand(0)); + if (value != 0) { + for (uint32_t op = 2; op < inst->NumInOperands(); op += 2) { + if (value != GetValueNumber(inst->GetSingleWordInOperand(op))) { + value = 0; + break; + } + } + if (value != 0) { + id_to_value_[inst->result_id()] = value; + return value; + } + } + } + + // Replace all of the operands by their value number. The sign bit will be + // set to distinguish between an id and a value number. + ir::Instruction value_ins(context(), inst->opcode(), inst->type_id(), + inst->result_id(), {}); + for (uint32_t o = 0; o < inst->NumInOperands(); ++o) { + const ir::Operand& op = inst->GetInOperand(o); + if (spvIsIdType(op.type)) { + uint32_t id_value = op.words[0]; + auto use_id_to_val = id_to_value_.find(id_value); + if (use_id_to_val != id_to_value_.end()) { + id_value = (1 << 31) | use_id_to_val->second; + } + value_ins.AddOperand(ir::Operand(op.type, {id_value})); + } else { + value_ins.AddOperand(ir::Operand(op.type, op.words)); + } + } + + // TODO: Implement a normal form for opcodes that commute like integer + // addition. This will let us know that a+b is the same value as b+a. + + // Otherwise, we check if this value has been computed before. + auto value_iterator = instruction_to_value_.find(value_ins); + if (value_iterator != instruction_to_value_.end()) { + value = id_to_value_[value_iterator->first.result_id()]; + id_to_value_[inst->result_id()] = value; + return value; + } + + // If not, assign it a new value number. + value = TakeNextValueNumber(); + id_to_value_[inst->result_id()] = value; + instruction_to_value_[value_ins] = value; + return value; +} + +void ValueNumberTable::BuildDominatorTreeValueNumberTable() { + // First value number the headers. + for (auto& inst : context()->annotations()) { + if (inst.result_id() != 0) { + AssignValueNumber(&inst); + } + } + + for (auto& inst : context()->capabilities()) { + if (inst.result_id() != 0) { + AssignValueNumber(&inst); + } + } + + for (auto& inst : context()->types_values()) { + if (inst.result_id() != 0) { + AssignValueNumber(&inst); + } + } + + for (auto& inst : context()->module()->ext_inst_imports()) { + if (inst.result_id() != 0) { + AssignValueNumber(&inst); + } + } + + for (ir::Function& func : *context()->module()) { + // For best results we want to traverse the code in reverse post order. + // This happens naturally because of the forward referencing rules. + for (ir::BasicBlock& block : func) { + for (ir::Instruction& inst : block) { + if (inst.result_id() != 0) { + AssignValueNumber(&inst); + } + } + } + } +} + +bool ComputeSameValue::operator()(const ir::Instruction& lhs, + const ir::Instruction& rhs) const { + if (lhs.result_id() == 0 || rhs.result_id() == 0) { + return false; + } + + if (lhs.opcode() != rhs.opcode()) { + return false; + } + + if (lhs.type_id() != rhs.type_id()) { + return false; + } + + if (lhs.NumInOperands() != rhs.NumInOperands()) { + return false; + } + + for (uint32_t i = 0; i < lhs.NumInOperands(); ++i) { + if (lhs.GetInOperand(i) != rhs.GetInOperand(i)) { + return false; + } + } + + return lhs.context()->get_decoration_mgr()->HaveTheSameDecorations( + lhs.result_id(), rhs.result_id()); +} + +std::size_t ValueTableHash::operator()( + const spvtools::ir::Instruction& inst) const { + // We hash the opcode and in-operands, not the result, because we want + // instructions that are the same except for the result to hash to the + // same value. + std::u32string h; + h.push_back(inst.opcode()); + h.push_back(inst.type_id()); + for (uint32_t i = 0; i < inst.NumInOperands(); ++i) { + const auto& opnd = inst.GetInOperand(i); + for (uint32_t word : opnd.words) { + h.push_back(word); + } + } + return std::hash()(h); +} +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/value_number_table.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/value_number_table.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/value_number_table.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/value_number_table.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,94 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_VALUE_NUMBER_TABLE_H_ +#define LIBSPIRV_OPT_VALUE_NUMBER_TABLE_H_ + +#include +#include +#include "instruction.h" +#include "ir_context.h" + +namespace spvtools { +namespace opt { + +// Returns true if the two instructions compute the same value. Used by the +// value number table to compare two instructions. +class ComputeSameValue { + public: + bool operator()(const ir::Instruction& lhs, const ir::Instruction& rhs) const; +}; + +// The hash function used in the value number table. +class ValueTableHash { + public: + std::size_t operator()(const spvtools::ir::Instruction& inst) const; +}; + +// This class implements the value number analysis. It is using a hash-based +// approach to value numbering. It is essentially doing dominator-tree value +// numbering described in +// +// Preston Briggs, Keith D. Cooper, and L. Taylor Simpson. 1997. Value +// numbering. Softw. Pract. Exper. 27, 6 (June 1997), 701-724. +// https://www.cs.rice.edu/~keith/Promo/CRPC-TR94517.pdf.gz +// +// The main difference is that because we do not perform redundancy elimination +// as we build the value number table, we do not have to deal with cleaning up +// the scope. +class ValueNumberTable { + public: + ValueNumberTable(ir::IRContext* ctx) : context_(ctx), next_value_number_(1) { + BuildDominatorTreeValueNumberTable(); + } + + // Returns the value number of the value computed by |inst|. |inst| must have + // a result id that will hold the computed value. If no value number has been + // assigned to the result id, then the return value is 0. + uint32_t GetValueNumber(spvtools::ir::Instruction* inst) const; + + // Returns the value number of the value contain in |id|. Returns 0 if it + // has not been assigned a value number. + inline uint32_t GetValueNumber(uint32_t id) const; + + ir::IRContext* context() const { return context_; } + + private: + // Assigns a value number to every result id in the module. + void BuildDominatorTreeValueNumberTable(); + + // Returns the new value number. + uint32_t TakeNextValueNumber() { return next_value_number_++; } + + // Assigns a new value number to the result of |inst| if it does not already + // have one. Return the value number for |inst|. |inst| must have a result + // id. + uint32_t AssignValueNumber(ir::Instruction* inst); + + std::unordered_map + instruction_to_value_; + std::unordered_map id_to_value_; + ir::IRContext* context_; + uint32_t next_value_number_; +}; + +uint32_t ValueNumberTable::GetValueNumber(uint32_t id) const { + return GetValueNumber(context()->get_def_use_mgr()->GetDef(id)); +} + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_VALUE_NUMBER_TABLE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/workaround1209.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/workaround1209.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/workaround1209.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/workaround1209.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,68 @@ +// Copyright (c) 2018 Google 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. + +#include "workaround1209.h" + +#include +#include + +namespace spvtools { +namespace opt { + +Pass::Status Workaround1209::Process(ir::IRContext* c) { + InitializeProcessing(c); + bool modified = false; + modified = RemoveOpUnreachableInLoops(); + return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange); +} + +bool Workaround1209::RemoveOpUnreachableInLoops() { + bool modified = false; + for (auto& func : *get_module()) { + std::list structured_order; + cfg()->ComputeStructuredOrder(&func, &*func.begin(), &structured_order); + + // Keep track of the loop merges. The top of the stack will always be the + // loop merge for the loop that immediately contains the basic block being + // processed. + std::stack loop_merges; + for (ir::BasicBlock* bb : structured_order) { + if (!loop_merges.empty() && bb->id() == loop_merges.top()) { + loop_merges.pop(); + } + + if (bb->tail()->opcode() == SpvOpUnreachable) { + if (!loop_merges.empty()) { + // We found an OpUnreachable inside a loop. + // Replace it with an unconditional branch to the loop merge. + context()->KillInst(&*bb->tail()); + std::unique_ptr new_branch( + new ir::Instruction(context(), SpvOpBranch, 0, 0, + {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, + {loop_merges.top()}}})); + context()->AnalyzeDefUse(&*new_branch); + bb->AddInstruction(std::move(new_branch)); + modified = true; + } + } else { + if (bb->GetLoopMergeInst()) { + loop_merges.push(bb->MergeBlockIdIfAny()); + } + } + } + } + return modified; +} +} // namespace opt +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/workaround1209.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/workaround1209.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/opt/workaround1209.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/opt/workaround1209.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,41 @@ +// Copyright (c) 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_WORKAROUND1209_H_ +#define LIBSPIRV_OPT_WORKAROUND1209_H_ + +#include "pass.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class Workaround1209 : public Pass { + public: + const char* name() const override { return "workaround-1209"; } + Status Process(ir::IRContext*) override; + + private: + // There is at least one driver where an OpUnreachable found in a loop is not + // handled correctly. Workaround that by changing the OpUnreachable into a + // branch to the loop merge. + // + // Returns true if the code changed. + bool RemoveOpUnreachableInLoops(); +}; + +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_WORKAROUND1209_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/parsed_operand.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/parsed_operand.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/parsed_operand.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/parsed_operand.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file contains utility functions for spv_parsed_operand_t. + +#include "parsed_operand.h" + +#include +#include "util/hex_float.h" + +namespace libspirv { + +void EmitNumericLiteral(std::ostream* out, const spv_parsed_instruction_t& inst, + const spv_parsed_operand_t& operand) { + assert(operand.type == SPV_OPERAND_TYPE_LITERAL_INTEGER || + operand.type == SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER); + assert(1 <= operand.num_words); + assert(operand.num_words <= 2); + + const uint32_t word = inst.words[operand.offset]; + if (operand.num_words == 1) { + switch (operand.number_kind) { + case SPV_NUMBER_SIGNED_INT: + *out << int32_t(word); + break; + case SPV_NUMBER_UNSIGNED_INT: + *out << word; + break; + case SPV_NUMBER_FLOATING: + if (operand.number_bit_width == 16) { + *out << spvutils::FloatProxy( + uint16_t(word & 0xFFFF)); + } else { + // Assume 32-bit floats. + *out << spvutils::FloatProxy(word); + } + break; + default: + assert(false && "Unreachable"); + } + } else if (operand.num_words == 2) { + // Multi-word numbers are presented with lower order words first. + uint64_t bits = + uint64_t(word) | (uint64_t(inst.words[operand.offset + 1]) << 32); + switch (operand.number_kind) { + case SPV_NUMBER_SIGNED_INT: + *out << int64_t(bits); + break; + case SPV_NUMBER_UNSIGNED_INT: + *out << bits; + break; + case SPV_NUMBER_FLOATING: + // Assume only 64-bit floats. + *out << spvutils::FloatProxy(bits); + break; + default: + assert(false && "Unreachable"); + } + } else { + // TODO(dneto): Support more than 64-bits at a time. + assert(false && "Unhandled"); + } +} +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/parsed_operand.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/parsed_operand.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/parsed_operand.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/parsed_operand.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,32 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_PARSED_OPERAND_H_ +#define LIBSPIRV_PARSED_OPERAND_H_ + +#include +#include "spirv-tools/libspirv.h" + +namespace libspirv { + +// Emits the numeric literal representation of the given instruction operand +// to the stream. The operand must be of numeric type. If integral it may +// be up to 64 bits wide. If floating point, then it must be 16, 32, or 64 +// bits wide. +void EmitNumericLiteral(std::ostream* out, const spv_parsed_instruction_t& inst, + const spv_parsed_operand_t& operand); + +} // namespace libspirv + +#endif // LIBSPIRV_BINARY_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/print.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/print.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/print.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/print.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,125 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "print.h" + +#if defined(SPIRV_ANDROID) || defined(SPIRV_LINUX) || defined(SPIRV_MAC) || \ + defined(SPIRV_FREEBSD) +namespace libspirv { + +clr::reset::operator const char*() { return "\x1b[0m"; } + +clr::grey::operator const char*() { return "\x1b[1;30m"; } + +clr::red::operator const char*() { return "\x1b[31m"; } + +clr::green::operator const char*() { return "\x1b[32m"; } + +clr::yellow::operator const char*() { return "\x1b[33m"; } + +clr::blue::operator const char*() { return "\x1b[34m"; } + +} // namespace libspirv +#elif defined(SPIRV_WINDOWS) +#include + +namespace libspirv { + +static void SetConsoleForegroundColorPrimary(HANDLE hConsole, WORD color) { + // Get screen buffer information from console handle + CONSOLE_SCREEN_BUFFER_INFO bufInfo; + GetConsoleScreenBufferInfo(hConsole, &bufInfo); + + // Get background color + color = WORD(color | (bufInfo.wAttributes & 0xfff0)); + + // Set foreground color + SetConsoleTextAttribute(hConsole, color); +} + +static void SetConsoleForegroundColor(WORD color) { + SetConsoleForegroundColorPrimary(GetStdHandle(STD_OUTPUT_HANDLE), color); + SetConsoleForegroundColorPrimary(GetStdHandle(STD_ERROR_HANDLE), color); +} + +clr::reset::operator const char*() { + if (isPrint) { + SetConsoleForegroundColor(0xf); + return ""; + } + return "\x1b[0m"; +} + +clr::grey::operator const char*() { + if (isPrint) { + SetConsoleForegroundColor(FOREGROUND_INTENSITY); + return ""; + } + return "\x1b[1;30m"; +} + +clr::red::operator const char*() { + if (isPrint) { + SetConsoleForegroundColor(FOREGROUND_RED); + return ""; + } + return "\x1b[31m"; +} + +clr::green::operator const char*() { + if (isPrint) { + SetConsoleForegroundColor(FOREGROUND_GREEN); + return ""; + } + return "\x1b[32m"; +} + +clr::yellow::operator const char*() { + if (isPrint) { + SetConsoleForegroundColor(FOREGROUND_RED | FOREGROUND_GREEN); + return ""; + } + return "\x1b[33m"; +} + +clr::blue::operator const char*() { + // Blue all by itself is hard to see against a black background (the + // default on command shell), or a medium blue background (the default + // on PowerShell). So increase its intensity. + + if (isPrint) { + SetConsoleForegroundColor(FOREGROUND_BLUE | FOREGROUND_INTENSITY); + return ""; + } + return "\x1b[94m"; +} + +} // namespace libspirv +#else +namespace libspirv { + +clr::reset::operator const char*() { return ""; } + +clr::grey::operator const char*() { return ""; } + +clr::red::operator const char*() { return ""; } + +clr::green::operator const char*() { return ""; } + +clr::yellow::operator const char*() { return ""; } + +clr::blue::operator const char*() { return ""; } + +} // namespace libspirv +#endif diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/print.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/print.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/print.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/print.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_PRINT_H_ +#define LIBSPIRV_PRINT_H_ + +#include +#include + +namespace libspirv { + +// Wrapper for out stream selection. +class out_stream { + public: + out_stream() : pStream(nullptr) {} + explicit out_stream(std::stringstream& stream) : pStream(&stream) {} + + std::ostream& get() { + if (pStream) { + return *pStream; + } + return std::cout; + } + + private: + std::stringstream* pStream; +}; + +namespace clr { +// Resets console color. +struct reset { + operator const char*(); + bool isPrint; +}; +// Sets console color to grey. +struct grey { + operator const char*(); + bool isPrint; +}; +// Sets console color to red. +struct red { + operator const char*(); + bool isPrint; +}; +// Sets console color to green. +struct green { + operator const char*(); + bool isPrint; +}; +// Sets console color to yellow. +struct yellow { + operator const char*(); + bool isPrint; +}; +// Sets console color to blue. +struct blue { + operator const char*(); + bool isPrint; +}; +} // namespace clr + +} // namespace libspirv + +#endif // LIBSPIRV_PRINT_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/software_version.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/software_version.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/software_version.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/software_version.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,27 @@ +// Copyright (c) 2015-2016 Google 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. + +#include "spirv-tools/libspirv.h" + +namespace { + +const char* kBuildVersions[] = { +#include "build-version.inc" +}; + +} // anonymous namespace + +const char* spvSoftwareVersionString(void) { return kBuildVersions[0]; } + +const char* spvSoftwareVersionDetailsString(void) { return kBuildVersions[1]; } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_constant.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_constant.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_constant.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_constant.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,103 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_SPIRV_CONSTANT_H_ +#define LIBSPIRV_SPIRV_CONSTANT_H_ + +#include "latest_version_spirv_header.h" +#include "spirv-tools/libspirv.h" + +// Version number macros. + +// Evaluates to a well-formed version header word, given valid +// SPIR-V version major and minor version numbers. +#define SPV_SPIRV_VERSION_WORD(MAJOR, MINOR) \ + ((uint32_t(uint8_t(MAJOR)) << 16) | (uint32_t(uint8_t(MINOR)) << 8)) +// Returns the major version extracted from a version header word. +#define SPV_SPIRV_VERSION_MAJOR_PART(WORD) ((uint32_t(WORD) >> 16) & 0xff) +// Returns the minor version extracted from a version header word. +#define SPV_SPIRV_VERSION_MINOR_PART(WORD) ((uint32_t(WORD) >> 8) & 0xff) + +// Returns the version number for the given SPIR-V target environment. +uint32_t spvVersionForTargetEnv(spv_target_env env); + +// Header indices + +#define SPV_INDEX_MAGIC_NUMBER 0u +#define SPV_INDEX_VERSION_NUMBER 1u +#define SPV_INDEX_GENERATOR_NUMBER 2u +#define SPV_INDEX_BOUND 3u +#define SPV_INDEX_SCHEMA 4u +#define SPV_INDEX_INSTRUCTION 5u + +// Universal limits + +// SPIR-V 1.0 limits +#define SPV_LIMIT_INSTRUCTION_WORD_COUNT_MAX 0xffff +#define SPV_LIMIT_LITERAL_STRING_UTF8_CHARS_MAX 0xffff + +// A single Unicode character in UTF-8 encoding can take +// up 4 bytes. +#define SPV_LIMIT_LITERAL_STRING_BYTES_MAX \ + (SPV_LIMIT_LITERAL_STRING_UTF8_CHARS_MAX * 4) + +// NOTE: These are set to the minimum maximum values +// TODO(dneto): Check these. + +// libspirv limits. +#define SPV_LIMIT_RESULT_ID_BOUND 0x00400000 +#define SPV_LIMIT_CONTROL_FLOW_NEST_DEPTH 0x00000400 +#define SPV_LIMIT_GLOBAL_VARIABLES_MAX 0x00010000 +#define SPV_LIMIT_LOCAL_VARIABLES_MAX 0x00080000 +// TODO: Decorations per target ID max, depends on decoration table size +#define SPV_LIMIT_EXECUTION_MODE_PER_ENTRY_POINT_MAX 0x00000100 +#define SPV_LIMIT_INDICIES_MAX_ACCESS_CHAIN_COMPOSITE_MAX 0x00000100 +#define SPV_LIMIT_FUNCTION_PARAMETERS_PER_FUNCTION_DECL 0x00000100 +#define SPV_LIMIT_FUNCTION_CALL_ARGUMENTS_MAX 0x00000100 +#define SPV_LIMIT_EXT_FUNCTION_CALL_ARGUMENTS_MAX 0x00000100 +#define SPV_LIMIT_SWITCH_LITERAL_LABEL_PAIRS_MAX 0x00004000 +#define SPV_LIMIT_STRUCT_MEMBERS_MAX 0x0000400 +#define SPV_LIMIT_STRUCT_NESTING_DEPTH_MAX 0x00000100 + +// Enumerations + +// Values mapping to registered tools. See the registry at +// https://www.khronos.org/registry/spir-v/api/spir-v.xml +// These values occupy the higher order 16 bits of the generator magic word. +typedef enum spv_generator_t { + // TODO(dneto) Values 0 through 5 were registered only as vendor. + SPV_GENERATOR_KHRONOS = 0, + SPV_GENERATOR_LUNARG = 1, + SPV_GENERATOR_VALVE = 2, + SPV_GENERATOR_CODEPLAY = 3, + SPV_GENERATOR_NVIDIA = 4, + SPV_GENERATOR_ARM = 5, + // These are vendor and tool. + SPV_GENERATOR_KHRONOS_LLVM_TRANSLATOR = 6, + SPV_GENERATOR_KHRONOS_ASSEMBLER = 7, + SPV_GENERATOR_KHRONOS_GLSLANG = 8, + SPV_GENERATOR_NUM_ENTRIES, + SPV_FORCE_16_BIT_ENUM(spv_generator_t) +} spv_generator_t; + +// Evaluates to a well-formed generator magic word from a tool value and +// miscellaneous 16-bit value. +#define SPV_GENERATOR_WORD(TOOL, MISC) \ + ((uint32_t(uint16_t(TOOL)) << 16) | uint16_t(MISC)) +// Returns the tool component of the generator word. +#define SPV_GENERATOR_TOOL_PART(WORD) (uint32_t(WORD) >> 16) +// Returns the misc part of the generator word. +#define SPV_GENERATOR_MISC_PART(WORD) (uint32_t(WORD) & 0xFFFF) + +#endif // LIBSPIRV_SPIRV_CONSTANT_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_definition.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_definition.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_definition.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_definition.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,33 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_SPIRV_DEFINITION_H_ +#define LIBSPIRV_SPIRV_DEFINITION_H_ + +#include + +#include "latest_version_spirv_header.h" + +#define spvIsInBitfield(value, bitfield) ((value) == ((value)&bitfield)) + +typedef struct spv_header_t { + uint32_t magic; + uint32_t version; + uint32_t generator; + uint32_t bound; + uint32_t schema; // NOTE: Reserved + const uint32_t* instructions; // NOTE: Unfixed pointer to instruciton stream +} spv_header_t; + +#endif // LIBSPIRV_SPIRV_DEFINITION_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_endian.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_endian.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_endian.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_endian.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "spirv_endian.h" + +#include + +enum { + I32_ENDIAN_LITTLE = 0x03020100ul, + I32_ENDIAN_BIG = 0x00010203ul, +}; + +// This constant value allows the detection of the host machine's endianness. +// Accessing it through the "value" member is valid due to C++11 section 3.10 +// paragraph 10. +static const union { + unsigned char bytes[4]; + uint32_t value; +} o32_host_order = {{0, 1, 2, 3}}; + +#define I32_ENDIAN_HOST (o32_host_order.value) + +uint32_t spvFixWord(const uint32_t word, const spv_endianness_t endian) { + if ((SPV_ENDIANNESS_LITTLE == endian && I32_ENDIAN_HOST == I32_ENDIAN_BIG) || + (SPV_ENDIANNESS_BIG == endian && I32_ENDIAN_HOST == I32_ENDIAN_LITTLE)) { + return (word & 0x000000ff) << 24 | (word & 0x0000ff00) << 8 | + (word & 0x00ff0000) >> 8 | (word & 0xff000000) >> 24; + } + + return word; +} + +uint64_t spvFixDoubleWord(const uint32_t low, const uint32_t high, + const spv_endianness_t endian) { + return (uint64_t(spvFixWord(high, endian)) << 32) | spvFixWord(low, endian); +} + +spv_result_t spvBinaryEndianness(spv_const_binary binary, + spv_endianness_t* pEndian) { + if (!binary->code || !binary->wordCount) return SPV_ERROR_INVALID_BINARY; + if (!pEndian) return SPV_ERROR_INVALID_POINTER; + + uint8_t bytes[4]; + memcpy(bytes, binary->code, sizeof(uint32_t)); + + if (0x03 == bytes[0] && 0x02 == bytes[1] && 0x23 == bytes[2] && + 0x07 == bytes[3]) { + *pEndian = SPV_ENDIANNESS_LITTLE; + return SPV_SUCCESS; + } + + if (0x07 == bytes[0] && 0x23 == bytes[1] && 0x02 == bytes[2] && + 0x03 == bytes[3]) { + *pEndian = SPV_ENDIANNESS_BIG; + return SPV_SUCCESS; + } + + return SPV_ERROR_INVALID_BINARY; +} + +bool spvIsHostEndian(spv_endianness_t endian) { + return ((SPV_ENDIANNESS_LITTLE == endian) && + (I32_ENDIAN_LITTLE == I32_ENDIAN_HOST)) || + ((SPV_ENDIANNESS_BIG == endian) && + (I32_ENDIAN_BIG == I32_ENDIAN_HOST)); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_endian.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_endian.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_endian.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_endian.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,37 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_SPIRV_ENDIAN_H_ +#define LIBSPIRV_SPIRV_ENDIAN_H_ + +#include "spirv-tools/libspirv.h" + +// Converts a word in the specified endianness to the host native endianness. +uint32_t spvFixWord(const uint32_t word, const spv_endianness_t endianness); + +// Converts a pair of words in the specified endianness to the host native +// endianness. +uint64_t spvFixDoubleWord(const uint32_t low, const uint32_t high, + const spv_endianness_t endianness); + +// Gets the endianness of the SPIR-V module given in the binary parameter. +// Returns SPV_ENDIANNESS_UNKNOWN if the SPIR-V magic number is invalid, +// otherwise writes the determined endianness into *endian. +spv_result_t spvBinaryEndianness(const spv_const_binary binary, + spv_endianness_t* endian); + +// Returns true if the given endianness matches the host's native endiannes. +bool spvIsHostEndian(spv_endianness_t endian); + +#endif // LIBSPIRV_SPIRV_ENDIAN_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_stats.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_stats.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_stats.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_stats.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,325 @@ +// Copyright (c) 2017 Google 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. + +#include "spirv_stats.h" + +#include + +#include +#include +#include +#include + +#include "binary.h" +#include "diagnostic.h" +#include "enum_string_mapping.h" +#include "extensions.h" +#include "id_descriptor.h" +#include "instruction.h" +#include "opcode.h" +#include "operand.h" +#include "spirv-tools/libspirv.h" +#include "spirv_endian.h" +#include "spirv_validator_options.h" +#include "val/instruction.h" +#include "val/validation_state.h" +#include "validate.h" + +using libspirv::IdDescriptorCollection; +using libspirv::Instruction; +using libspirv::SpirvStats; +using libspirv::ValidationState_t; + +namespace { + +// Helper class for stats aggregation. Receives as in/out parameter. +// Constructs ValidationState and updates it by running validator for each +// instruction. +class StatsAggregator { + public: + StatsAggregator(SpirvStats* in_out_stats, const spv_const_context context) { + stats_ = in_out_stats; + vstate_.reset(new ValidationState_t(context, &validator_options_)); + } + + // Collects header statistics and sets correct id_bound. + spv_result_t ProcessHeader(spv_endianness_t /* endian */, + uint32_t /* magic */, uint32_t version, + uint32_t generator, uint32_t id_bound, + uint32_t /* schema */) { + vstate_->setIdBound(id_bound); + ++stats_->version_hist[version]; + ++stats_->generator_hist[generator]; + return SPV_SUCCESS; + } + + // Runs validator to validate the instruction and update vstate_, + // then procession the instruction to collect stats. + spv_result_t ProcessInstruction(const spv_parsed_instruction_t* inst) { + const spv_result_t validation_result = + spvtools::ValidateInstructionAndUpdateValidationState(vstate_.get(), + inst); + if (validation_result != SPV_SUCCESS) return validation_result; + + ProcessOpcode(); + ProcessCapability(); + ProcessExtension(); + ProcessConstant(); + ProcessEnums(); + ProcessLiteralStrings(); + ProcessNonIdWords(); + ProcessIdDescriptors(); + + return SPV_SUCCESS; + } + + // Collects statistics of descriptors generated by IdDescriptorCollection. + void ProcessIdDescriptors() { + const Instruction& inst = GetCurrentInstruction(); + const uint32_t new_descriptor = + id_descriptors_.ProcessInstruction(inst.c_inst()); + + if (new_descriptor) { + std::stringstream ss; + ss << spvOpcodeString(inst.opcode()); + for (size_t i = 1; i < inst.words().size(); ++i) { + ss << " " << inst.word(i); + } + stats_->id_descriptor_labels.emplace(new_descriptor, ss.str()); + } + + uint32_t index = 0; + for (const auto& operand : inst.operands()) { + if (spvIsIdType(operand.type)) { + const uint32_t descriptor = + id_descriptors_.GetDescriptor(inst.word(operand.offset)); + if (descriptor) { + ++stats_->id_descriptor_hist[descriptor]; + ++stats_ + ->operand_slot_id_descriptor_hist[std::pair( + inst.opcode(), index)][descriptor]; + } + } + ++index; + } + } + + // Collects statistics of enum words for operands of specific types. + void ProcessEnums() { + const Instruction& inst = GetCurrentInstruction(); + for (const auto& operand : inst.operands()) { + switch (operand.type) { + case SPV_OPERAND_TYPE_SOURCE_LANGUAGE: + case SPV_OPERAND_TYPE_EXECUTION_MODEL: + case SPV_OPERAND_TYPE_ADDRESSING_MODEL: + case SPV_OPERAND_TYPE_MEMORY_MODEL: + case SPV_OPERAND_TYPE_EXECUTION_MODE: + case SPV_OPERAND_TYPE_STORAGE_CLASS: + case SPV_OPERAND_TYPE_DIMENSIONALITY: + case SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE: + case SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE: + case SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT: + case SPV_OPERAND_TYPE_IMAGE_CHANNEL_ORDER: + case SPV_OPERAND_TYPE_IMAGE_CHANNEL_DATA_TYPE: + case SPV_OPERAND_TYPE_FP_ROUNDING_MODE: + case SPV_OPERAND_TYPE_LINKAGE_TYPE: + case SPV_OPERAND_TYPE_ACCESS_QUALIFIER: + case SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE: + case SPV_OPERAND_TYPE_DECORATION: + case SPV_OPERAND_TYPE_BUILT_IN: + case SPV_OPERAND_TYPE_GROUP_OPERATION: + case SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS: + case SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO: + case SPV_OPERAND_TYPE_CAPABILITY: { + ++stats_->enum_hist[operand.type][inst.word(operand.offset)]; + break; + } + default: + break; + } + } + } + + // Collects statistics of literal strings used by opcodes. + void ProcessLiteralStrings() { + const Instruction& inst = GetCurrentInstruction(); + for (const auto& operand : inst.operands()) { + if (operand.type == SPV_OPERAND_TYPE_LITERAL_STRING) { + const std::string str = + reinterpret_cast(&inst.words()[operand.offset]); + ++stats_->literal_strings_hist[inst.opcode()][str]; + } + } + } + + // Collects statistics of all single word non-id operand slots. + void ProcessNonIdWords() { + const Instruction& inst = GetCurrentInstruction(); + uint32_t index = 0; + for (const auto& operand : inst.operands()) { + if (operand.num_words == 1 && !spvIsIdType(operand.type)) { + ++stats_->operand_slot_non_id_words_hist[std::pair( + inst.opcode(), index)][inst.word(operand.offset)]; + } + ++index; + } + } + + // Collects OpCapability statistics. + void ProcessCapability() { + const Instruction& inst = GetCurrentInstruction(); + if (inst.opcode() != SpvOpCapability) return; + const uint32_t capability = inst.word(inst.operands()[0].offset); + ++stats_->capability_hist[capability]; + } + + // Collects OpExtension statistics. + void ProcessExtension() { + const Instruction& inst = GetCurrentInstruction(); + if (inst.opcode() != SpvOpExtension) return; + const std::string extension = libspirv::GetExtensionString(&inst.c_inst()); + ++stats_->extension_hist[extension]; + } + + // Collects OpCode statistics. + void ProcessOpcode() { + auto inst_it = vstate_->ordered_instructions().rbegin(); + const SpvOp opcode = inst_it->opcode(); + ++stats_->opcode_hist[opcode]; + + const uint32_t opcode_and_num_operands = + (uint32_t(inst_it->operands().size()) << 16) | uint32_t(opcode); + ++stats_->opcode_and_num_operands_hist[opcode_and_num_operands]; + + ++inst_it; + + if (inst_it != vstate_->ordered_instructions().rend()) { + const SpvOp prev_opcode = inst_it->opcode(); + ++stats_->opcode_and_num_operands_markov_hist[prev_opcode] + [opcode_and_num_operands]; + } + + auto step_it = stats_->opcode_markov_hist.begin(); + for (; inst_it != vstate_->ordered_instructions().rend() && + step_it != stats_->opcode_markov_hist.end(); + ++inst_it, ++step_it) { + auto& hist = (*step_it)[inst_it->opcode()]; + ++hist[opcode]; + } + } + + // Collects OpConstant statistics. + void ProcessConstant() { + const Instruction& inst = GetCurrentInstruction(); + if (inst.opcode() != SpvOpConstant) return; + const uint32_t type_id = inst.GetOperandAs(0); + const auto type_decl_it = vstate_->all_definitions().find(type_id); + assert(type_decl_it != vstate_->all_definitions().end()); + const Instruction& type_decl_inst = *type_decl_it->second; + const SpvOp type_op = type_decl_inst.opcode(); + if (type_op == SpvOpTypeInt) { + const uint32_t bit_width = type_decl_inst.GetOperandAs(1); + const uint32_t is_signed = type_decl_inst.GetOperandAs(2); + assert(is_signed == 0 || is_signed == 1); + if (bit_width == 16) { + if (is_signed) + ++stats_->s16_constant_hist[inst.GetOperandAs(2)]; + else + ++stats_->u16_constant_hist[inst.GetOperandAs(2)]; + } else if (bit_width == 32) { + if (is_signed) + ++stats_->s32_constant_hist[inst.GetOperandAs(2)]; + else + ++stats_->u32_constant_hist[inst.GetOperandAs(2)]; + } else if (bit_width == 64) { + if (is_signed) + ++stats_->s64_constant_hist[inst.GetOperandAs(2)]; + else + ++stats_->u64_constant_hist[inst.GetOperandAs(2)]; + } else { + assert(false && "TypeInt bit width is not 16, 32 or 64"); + } + } else if (type_op == SpvOpTypeFloat) { + const uint32_t bit_width = type_decl_inst.GetOperandAs(1); + if (bit_width == 32) { + ++stats_->f32_constant_hist[inst.GetOperandAs(2)]; + } else if (bit_width == 64) { + ++stats_->f64_constant_hist[inst.GetOperandAs(2)]; + } else { + assert(bit_width == 16); + } + } + } + + SpirvStats* stats() { return stats_; } + + private: + // Returns the current instruction (the one last processed by the validator). + const Instruction& GetCurrentInstruction() const { + return vstate_->ordered_instructions().back(); + } + + SpirvStats* stats_; + spv_validator_options_t validator_options_; + std::unique_ptr vstate_; + IdDescriptorCollection id_descriptors_; +}; + +spv_result_t ProcessHeader(void* user_data, spv_endianness_t endian, + uint32_t magic, uint32_t version, uint32_t generator, + uint32_t id_bound, uint32_t schema) { + StatsAggregator* stats_aggregator = + reinterpret_cast(user_data); + return stats_aggregator->ProcessHeader(endian, magic, version, generator, + id_bound, schema); +} + +spv_result_t ProcessInstruction(void* user_data, + const spv_parsed_instruction_t* inst) { + StatsAggregator* stats_aggregator = + reinterpret_cast(user_data); + return stats_aggregator->ProcessInstruction(inst); +} + +} // namespace + +namespace libspirv { + +spv_result_t AggregateStats(const spv_context_t& context, const uint32_t* words, + const size_t num_words, spv_diagnostic* pDiagnostic, + SpirvStats* stats) { + spv_const_binary_t binary = {words, num_words}; + + spv_endianness_t endian; + spv_position_t position = {}; + if (spvBinaryEndianness(&binary, &endian)) { + return libspirv::DiagnosticStream(position, context.consumer, + SPV_ERROR_INVALID_BINARY) + << "Invalid SPIR-V magic number."; + } + + spv_header_t header; + if (spvBinaryHeaderGet(&binary, endian, &header)) { + return libspirv::DiagnosticStream(position, context.consumer, + SPV_ERROR_INVALID_BINARY) + << "Invalid SPIR-V header."; + } + + StatsAggregator stats_aggregator(stats, &context); + + return spvBinaryParse(&context, &stats_aggregator, words, num_words, + ProcessHeader, ProcessInstruction, pDiagnostic); +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_stats.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_stats.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_stats.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_stats.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,130 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_SPIRV_STATS_H_ +#define LIBSPIRV_SPIRV_STATS_H_ + +#include +#include +#include +#include + +#include "spirv-tools/libspirv.hpp" + +namespace libspirv { + +struct SpirvStats { + // Version histogram, version_word -> count. + std::unordered_map version_hist; + + // Generator histogram, generator_word -> count. + std::unordered_map generator_hist; + + // Capability histogram, SpvCapabilityXXX -> count. + std::unordered_map capability_hist; + + // Extension histogram, extension_string -> count. + std::unordered_map extension_hist; + + // Opcode histogram, SpvOpXXX -> count. + std::unordered_map opcode_hist; + + // Histogram of words combining opcode and number of operands, + // opcode | (num_operands << 16) -> count. + std::unordered_map opcode_and_num_operands_hist; + + // OpConstant u16 histogram, value -> count. + std::unordered_map u16_constant_hist; + + // OpConstant u32 histogram, value -> count. + std::unordered_map u32_constant_hist; + + // OpConstant u64 histogram, value -> count. + std::unordered_map u64_constant_hist; + + // OpConstant s16 histogram, value -> count. + std::unordered_map s16_constant_hist; + + // OpConstant s32 histogram, value -> count. + std::unordered_map s32_constant_hist; + + // OpConstant s64 histogram, value -> count. + std::unordered_map s64_constant_hist; + + // OpConstant f32 histogram, value -> count. + std::unordered_map f32_constant_hist; + + // OpConstant f64 histogram, value -> count. + std::unordered_map f64_constant_hist; + + // Enum histogram, operand type -> operand value -> count. + std::unordered_map> + enum_hist; + + // Histogram of all non-id single words. + // pair -> value -> count. + // This is a generalization of enum_hist, also includes literal integers and + // masks. + std::map, std::map> + operand_slot_non_id_words_hist; + + // Historgam of descriptors generated by IdDescriptorCollection. + // Descriptor -> count. + std::unordered_map id_descriptor_hist; + + // Debut labels for id descriptors, descriptor -> label. + std::unordered_map id_descriptor_labels; + + // Historgam of descriptors generated by IdDescriptorCollection for every + // operand slot. pair -> descriptor -> count. + std::map, std::map> + operand_slot_id_descriptor_hist; + + // Histogram of literal strings, sharded by opcodes, opcode -> string -> + // count. + // This is suboptimal if an opcode has multiple literal string operands, + // as it wouldn't differentiate between operands. + std::unordered_map> + literal_strings_hist; + + // Markov chain histograms: + // opcode -> next(opcode | (num_operands << 16)) -> count. + // See also opcode_and_num_operands_hist, which collects global statistics. + std::unordered_map> + opcode_and_num_operands_markov_hist; + + // Used to collect statistics on opcodes triggering other opcodes. + // Container scheme: gap between instructions -> cue opcode -> later opcode + // -> count. + // For example opcode_markov_hist[2][OpFMul][OpFAdd] corresponds to + // the number of times an OpMul appears, followed by 2 other instructions, + // followed by OpFAdd. + // opcode_markov_hist[0][OpFMul][OpFAdd] corresponds to how many times + // OpFMul appears, directly followed by OpFAdd. + // The size of the outer std::vector also serves as an input parameter, + // determining how many steps will be collected. + // I.e. do opcode_markov_hist.resize(1) to collect data for one step only. + std::vector< + std::unordered_map>> + opcode_markov_hist; +}; + +// Aggregates existing |stats| with new stats extracted from |binary|. +spv_result_t AggregateStats(const spv_context_t& context, const uint32_t* words, + const size_t num_words, spv_diagnostic* pDiagnostic, + SpirvStats* stats); + +} // namespace libspirv + +#endif // LIBSPIRV_SPIRV_STATS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_target_env.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_target_env.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_target_env.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_target_env.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,188 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include + +#include "spirv-tools/libspirv.h" +#include "spirv_constant.h" + +const char* spvTargetEnvDescription(spv_target_env env) { + switch (env) { + case SPV_ENV_UNIVERSAL_1_0: + return "SPIR-V 1.0"; + case SPV_ENV_VULKAN_1_0: + return "SPIR-V 1.0 (under Vulkan 1.0 semantics)"; + case SPV_ENV_UNIVERSAL_1_1: + return "SPIR-V 1.1"; + case SPV_ENV_OPENCL_1_2: + return "SPIR-V 1.0 (under OpenCL 1.2 Full Profile semantics)"; + case SPV_ENV_OPENCL_EMBEDDED_1_2: + return "SPIR-V 1.0 (under OpenCL 1.2 Embedded Profile semantics)"; + case SPV_ENV_OPENCL_2_0: + return "SPIR-V 1.0 (under OpenCL 2.0 Full Profile semantics)"; + case SPV_ENV_OPENCL_EMBEDDED_2_0: + return "SPIR-V 1.0 (under OpenCL 2.0 Embedded Profile semantics)"; + case SPV_ENV_OPENCL_2_1: + return "SPIR-V 1.0 (under OpenCL 2.1 Full Profile semantics)"; + case SPV_ENV_OPENCL_EMBEDDED_2_1: + return "SPIR-V 1.0 (under OpenCL 2.1 Embedded Profile semantics)"; + case SPV_ENV_OPENCL_2_2: + return "SPIR-V 1.2 (under OpenCL 2.2 Full Profile semantics)"; + case SPV_ENV_OPENCL_EMBEDDED_2_2: + return "SPIR-V 1.2 (under OpenCL 2.2 Embedded Profile semantics)"; + case SPV_ENV_OPENGL_4_0: + return "SPIR-V 1.0 (under OpenCL 4.0 semantics)"; + case SPV_ENV_OPENGL_4_1: + return "SPIR-V 1.0 (under OpenCL 4.1 semantics)"; + case SPV_ENV_OPENGL_4_2: + return "SPIR-V 1.0 (under OpenCL 4.2 semantics)"; + case SPV_ENV_OPENGL_4_3: + return "SPIR-V 1.0 (under OpenCL 4.3 semantics)"; + case SPV_ENV_OPENGL_4_5: + return "SPIR-V 1.0 (under OpenCL 4.5 semantics)"; + case SPV_ENV_UNIVERSAL_1_2: + return "SPIR-V 1.2"; + case SPV_ENV_UNIVERSAL_1_3: + return "SPIR-V 1.3"; + case SPV_ENV_VULKAN_1_1: + return "SPIR-V 1.3 (under Vulkan 1.1 semantics)"; + } + assert(0 && "Unhandled SPIR-V target environment"); + return ""; +} + +uint32_t spvVersionForTargetEnv(spv_target_env env) { + switch (env) { + case SPV_ENV_UNIVERSAL_1_0: + case SPV_ENV_VULKAN_1_0: + case SPV_ENV_OPENCL_1_2: + case SPV_ENV_OPENCL_EMBEDDED_1_2: + case SPV_ENV_OPENCL_2_0: + case SPV_ENV_OPENCL_EMBEDDED_2_0: + case SPV_ENV_OPENCL_2_1: + case SPV_ENV_OPENCL_EMBEDDED_2_1: + case SPV_ENV_OPENGL_4_0: + case SPV_ENV_OPENGL_4_1: + case SPV_ENV_OPENGL_4_2: + case SPV_ENV_OPENGL_4_3: + case SPV_ENV_OPENGL_4_5: + return SPV_SPIRV_VERSION_WORD(1, 0); + case SPV_ENV_UNIVERSAL_1_1: + return SPV_SPIRV_VERSION_WORD(1, 1); + case SPV_ENV_UNIVERSAL_1_2: + case SPV_ENV_OPENCL_2_2: + case SPV_ENV_OPENCL_EMBEDDED_2_2: + return SPV_SPIRV_VERSION_WORD(1, 2); + case SPV_ENV_UNIVERSAL_1_3: + case SPV_ENV_VULKAN_1_1: + return SPV_SPIRV_VERSION_WORD(1, 3); + } + assert(0 && "Unhandled SPIR-V target environment"); + return SPV_SPIRV_VERSION_WORD(0, 0); +} + +bool spvParseTargetEnv(const char* s, spv_target_env* env) { + auto match = [s](const char* b) { + return s && (0 == strncmp(s, b, strlen(b))); + }; + if (match("vulkan1.0")) { + if (env) *env = SPV_ENV_VULKAN_1_0; + return true; + } else if (match("vulkan1.1")) { + if (env) *env = SPV_ENV_VULKAN_1_1; + return true; + } else if (match("spv1.0")) { + if (env) *env = SPV_ENV_UNIVERSAL_1_0; + return true; + } else if (match("spv1.1")) { + if (env) *env = SPV_ENV_UNIVERSAL_1_1; + return true; + } else if (match("spv1.2")) { + if (env) *env = SPV_ENV_UNIVERSAL_1_2; + return true; + } else if (match("spv1.3")) { + if (env) *env = SPV_ENV_UNIVERSAL_1_3; + return true; + } else if (match("opencl1.2embedded")) { + if (env) *env = SPV_ENV_OPENCL_EMBEDDED_1_2; + return true; + } else if (match("opencl1.2")) { + if (env) *env = SPV_ENV_OPENCL_1_2; + return true; + } else if (match("opencl2.0embedded")) { + if (env) *env = SPV_ENV_OPENCL_EMBEDDED_2_0; + return true; + } else if (match("opencl2.0")) { + if (env) *env = SPV_ENV_OPENCL_2_0; + return true; + } else if (match("opencl2.1embedded")) { + if (env) *env = SPV_ENV_OPENCL_EMBEDDED_2_1; + return true; + } else if (match("opencl2.1")) { + if (env) *env = SPV_ENV_OPENCL_2_1; + return true; + } else if (match("opencl2.2embedded")) { + if (env) *env = SPV_ENV_OPENCL_EMBEDDED_2_2; + return true; + } else if (match("opencl2.2")) { + if (env) *env = SPV_ENV_OPENCL_2_2; + return true; + } else if (match("opengl4.0")) { + if (env) *env = SPV_ENV_OPENGL_4_0; + return true; + } else if (match("opengl4.1")) { + if (env) *env = SPV_ENV_OPENGL_4_1; + return true; + } else if (match("opengl4.2")) { + if (env) *env = SPV_ENV_OPENGL_4_2; + return true; + } else if (match("opengl4.3")) { + if (env) *env = SPV_ENV_OPENGL_4_3; + return true; + } else if (match("opengl4.5")) { + if (env) *env = SPV_ENV_OPENGL_4_5; + return true; + } else { + if (env) *env = SPV_ENV_UNIVERSAL_1_0; + return false; + } +} + +bool spvIsVulkanEnv(spv_target_env env) { + switch (env) { + case SPV_ENV_UNIVERSAL_1_0: + case SPV_ENV_OPENCL_1_2: + case SPV_ENV_OPENCL_EMBEDDED_1_2: + case SPV_ENV_OPENCL_2_0: + case SPV_ENV_OPENCL_EMBEDDED_2_0: + case SPV_ENV_OPENCL_2_1: + case SPV_ENV_OPENCL_EMBEDDED_2_1: + case SPV_ENV_OPENGL_4_0: + case SPV_ENV_OPENGL_4_1: + case SPV_ENV_OPENGL_4_2: + case SPV_ENV_OPENGL_4_3: + case SPV_ENV_OPENGL_4_5: + case SPV_ENV_UNIVERSAL_1_1: + case SPV_ENV_UNIVERSAL_1_2: + case SPV_ENV_OPENCL_2_2: + case SPV_ENV_OPENCL_EMBEDDED_2_2: + case SPV_ENV_UNIVERSAL_1_3: + return false; + case SPV_ENV_VULKAN_1_0: + case SPV_ENV_VULKAN_1_1: + return true; + } + return false; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_target_env.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_target_env.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_target_env.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_target_env.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,27 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_SPIRV_TARGET_ENV_H_ +#define LIBSPIRV_SPIRV_TARGET_ENV_H_ + +#include "spirv-tools/libspirv.h" + +// Parses s into *env and returns true if successful. If unparsable, returns +// false and sets *env to SPV_ENV_UNIVERSAL_1_0. +bool spvParseTargetEnv(const char* s, spv_target_env* env); + +// Returns true if |env| is a VULKAN environment, false otherwise. +bool spvIsVulkanEnv(spv_target_env env); + +#endif // LIBSPIRV_SPIRV_TARGET_ENV_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_validator_options.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_validator_options.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_validator_options.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_validator_options.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,88 @@ +// Copyright (c) 2017 Google 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. + +#include +#include + +#include "spirv_validator_options.h" + +bool spvParseUniversalLimitsOptions(const char* s, spv_validator_limit* type) { + auto match = [s](const char* b) { + return s && (0 == strncmp(s, b, strlen(b))); + }; + if (match("--max-struct-members")) { + *type = spv_validator_limit_max_struct_members; + } else if (match("--max-struct_depth")) { + *type = spv_validator_limit_max_struct_depth; + } else if (match("--max-local-variables")) { + *type = spv_validator_limit_max_local_variables; + } else if (match("--max-global-variables")) { + *type = spv_validator_limit_max_global_variables; + } else if (match("--max-switch-branches")) { + *type = spv_validator_limit_max_global_variables; + } else if (match("--max-function-args")) { + *type = spv_validator_limit_max_function_args; + } else if (match("--max-control-flow-nesting-depth")) { + *type = spv_validator_limit_max_control_flow_nesting_depth; + } else if (match("--max-access-chain-indexes")) { + *type = spv_validator_limit_max_access_chain_indexes; + } else { + // The command line option for this validator limit has not been added. + // Therefore we return false. + return false; + } + + return true; +} + +spv_validator_options spvValidatorOptionsCreate(void) { + return new spv_validator_options_t; +} + +void spvValidatorOptionsDestroy(spv_validator_options options) { + delete options; +} + +void spvValidatorOptionsSetUniversalLimit(spv_validator_options options, + spv_validator_limit limit_type, + uint32_t limit) { + assert(options && "Validator options object may not be Null"); + switch (limit_type) { +#define LIMIT(TYPE, FIELD) \ + case TYPE: \ + options->universal_limits_.FIELD = limit; \ + break; + LIMIT(spv_validator_limit_max_struct_members, max_struct_members) + LIMIT(spv_validator_limit_max_struct_depth, max_struct_depth) + LIMIT(spv_validator_limit_max_local_variables, max_local_variables) + LIMIT(spv_validator_limit_max_global_variables, max_global_variables) + LIMIT(spv_validator_limit_max_switch_branches, max_switch_branches) + LIMIT(spv_validator_limit_max_function_args, max_function_args) + LIMIT(spv_validator_limit_max_control_flow_nesting_depth, + max_control_flow_nesting_depth) + LIMIT(spv_validator_limit_max_access_chain_indexes, + max_access_chain_indexes) +#undef LIMIT + } +} + +void spvValidatorOptionsSetRelaxStoreStruct(spv_validator_options options, + bool val) { + options->relax_struct_store = val; +} + +void spvValidatorOptionsSetRelaxLogicalPointer(spv_validator_options options, + bool val) { + options->relax_logcial_pointer = val; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_validator_options.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_validator_options.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/spirv_validator_options.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/spirv_validator_options.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,50 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_SPIRV_VALIDATOR_OPTIONS_H_ +#define LIBSPIRV_SPIRV_VALIDATOR_OPTIONS_H_ + +#include "spirv-tools/libspirv.h" + +// Return true if the command line option for the validator limit is valid (Also +// returns the Enum for option in this case). Returns false otherwise. +bool spvParseUniversalLimitsOptions(const char* s, spv_validator_limit* limit); + +// Default initialization of this structure is to the default Universal Limits +// described in the SPIR-V Spec. +struct validator_universal_limits_t { + uint32_t max_struct_members{16383}; + uint32_t max_struct_depth{255}; + uint32_t max_local_variables{524287}; + uint32_t max_global_variables{65535}; + uint32_t max_switch_branches{16383}; + uint32_t max_function_args{255}; + uint32_t max_control_flow_nesting_depth{1023}; + uint32_t max_access_chain_indexes{255}; +}; + +// Manages command line options passed to the SPIR-V Validator. New struct +// members may be added for any new option. +struct spv_validator_options_t { + spv_validator_options_t() + : universal_limits_(), + relax_struct_store(false), + relax_logcial_pointer(false) {} + + validator_universal_limits_t universal_limits_; + bool relax_struct_store; + bool relax_logcial_pointer; +}; + +#endif // LIBSPIRV_SPIRV_VALIDATOR_OPTIONS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/table.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/table.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/table.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/table.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "table.h" + +#include + +spv_context spvContextCreate(spv_target_env env) { + switch (env) { + case SPV_ENV_UNIVERSAL_1_0: + case SPV_ENV_VULKAN_1_0: + case SPV_ENV_UNIVERSAL_1_1: + case SPV_ENV_OPENCL_1_2: + case SPV_ENV_OPENCL_EMBEDDED_1_2: + case SPV_ENV_OPENCL_2_0: + case SPV_ENV_OPENCL_EMBEDDED_2_0: + case SPV_ENV_OPENCL_2_1: + case SPV_ENV_OPENCL_EMBEDDED_2_1: + case SPV_ENV_OPENCL_2_2: + case SPV_ENV_OPENCL_EMBEDDED_2_2: + case SPV_ENV_OPENGL_4_0: + case SPV_ENV_OPENGL_4_1: + case SPV_ENV_OPENGL_4_2: + case SPV_ENV_OPENGL_4_3: + case SPV_ENV_OPENGL_4_5: + case SPV_ENV_UNIVERSAL_1_2: + case SPV_ENV_UNIVERSAL_1_3: + case SPV_ENV_VULKAN_1_1: + break; + default: + return nullptr; + } + + spv_opcode_table opcode_table; + spv_operand_table operand_table; + spv_ext_inst_table ext_inst_table; + + spvOpcodeTableGet(&opcode_table, env); + spvOperandTableGet(&operand_table, env); + spvExtInstTableGet(&ext_inst_table, env); + + return new spv_context_t{env, opcode_table, operand_table, ext_inst_table, + nullptr /* a null default consumer */}; +} + +void spvContextDestroy(spv_context context) { delete context; } + +void libspirv::SetContextMessageConsumer(spv_context context, + spvtools::MessageConsumer consumer) { + context->consumer = std::move(consumer); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/table.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/table.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/table.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/table.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,133 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_TABLE_H_ +#define LIBSPIRV_TABLE_H_ + +#include "latest_version_spirv_header.h" + +#include "extensions.h" +#include "message.h" +#include "spirv-tools/libspirv.hpp" + +typedef struct spv_opcode_desc_t { + const char* name; + const SpvOp opcode; + const uint32_t numCapabilities; + const SpvCapability* capabilities; + // operandTypes[0..numTypes-1] describe logical operands for the instruction. + // The operand types include result id and result-type id, followed by + // the types of arguments. + const uint16_t numTypes; + spv_operand_type_t operandTypes[16]; // TODO: Smaller/larger? + const bool hasResult; // Does the instruction have a result ID operand? + const bool hasType; // Does the instruction have a type ID operand? + // A set of extensions that enable this feature. If empty then this operand + // value is in core and its availability is subject to minVersion. The + // assembler, binary parser, and disassembler ignore this rule, so you can + // freely process invalid modules. + const uint32_t numExtensions; + const libspirv::Extension* extensions; + // Minimal core SPIR-V version required for this feature, if without + // extensions. ~0u means reserved for future use. ~0u and non-empty extension + // lists means only available in extensions. + const uint32_t minVersion; +} spv_opcode_desc_t; + +typedef struct spv_operand_desc_t { + const char* name; + const uint32_t value; + const uint32_t numCapabilities; + const SpvCapability* capabilities; + // A set of extensions that enable this feature. If empty then this operand + // value is in core and its availability is subject to minVersion. The + // assembler, binary parser, and disassembler ignore this rule, so you can + // freely process invalid modules. + const uint32_t numExtensions; + const libspirv::Extension* extensions; + const spv_operand_type_t operandTypes[16]; // TODO: Smaller/larger? + // Minimal core SPIR-V version required for this feature, if without + // extensions. ~0u means reserved for future use. ~0u and non-empty extension + // lists means only available in extensions. + const uint32_t minVersion; +} spv_operand_desc_t; + +typedef struct spv_operand_desc_group_t { + const spv_operand_type_t type; + const uint32_t count; + const spv_operand_desc_t* entries; +} spv_operand_desc_group_t; + +typedef struct spv_ext_inst_desc_t { + const char* name; + const uint32_t ext_inst; + const uint32_t numCapabilities; + const SpvCapability* capabilities; + const spv_operand_type_t operandTypes[16]; // TODO: Smaller/larger? +} spv_ext_inst_desc_t; + +typedef struct spv_ext_inst_group_t { + const spv_ext_inst_type_t type; + const uint32_t count; + const spv_ext_inst_desc_t* entries; +} spv_ext_inst_group_t; + +typedef struct spv_opcode_table_t { + const uint32_t count; + const spv_opcode_desc_t* entries; +} spv_opcode_table_t; + +typedef struct spv_operand_table_t { + const uint32_t count; + const spv_operand_desc_group_t* types; +} spv_operand_table_t; + +typedef struct spv_ext_inst_table_t { + const uint32_t count; + const spv_ext_inst_group_t* groups; +} spv_ext_inst_table_t; + +typedef const spv_opcode_desc_t* spv_opcode_desc; +typedef const spv_operand_desc_t* spv_operand_desc; +typedef const spv_ext_inst_desc_t* spv_ext_inst_desc; + +typedef const spv_opcode_table_t* spv_opcode_table; +typedef const spv_operand_table_t* spv_operand_table; +typedef const spv_ext_inst_table_t* spv_ext_inst_table; + +struct spv_context_t { + const spv_target_env target_env; + const spv_opcode_table opcode_table; + const spv_operand_table operand_table; + const spv_ext_inst_table ext_inst_table; + spvtools::MessageConsumer consumer; +}; + +namespace libspirv { +// Sets the message consumer to |consumer| in the given |context|. The original +// message consumer will be overwritten. +void SetContextMessageConsumer(spv_context context, + spvtools::MessageConsumer consumer); +} // namespace libspirv + +// Populates *table with entries for env. +spv_result_t spvOpcodeTableGet(spv_opcode_table* table, spv_target_env env); + +// Populates *table with entries for env. +spv_result_t spvOperandTableGet(spv_operand_table* table, spv_target_env env); + +// Populates *table with entries for env. +spv_result_t spvExtInstTableGet(spv_ext_inst_table* table, spv_target_env env); + +#endif // LIBSPIRV_TABLE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/text.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/text.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/text.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/text.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,809 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "text.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "assembly_grammar.h" +#include "binary.h" +#include "diagnostic.h" +#include "ext_inst.h" +#include "instruction.h" +#include "message.h" +#include "opcode.h" +#include "operand.h" +#include "spirv-tools/libspirv.h" +#include "spirv_constant.h" +#include "table.h" +#include "text_handler.h" +#include "util/bitutils.h" +#include "util/parse_number.h" + +bool spvIsValidIDCharacter(const char value) { + return value == '_' || 0 != ::isalnum(value); +} + +// Returns true if the given string represents a valid ID name. +bool spvIsValidID(const char* textValue) { + const char* c = textValue; + for (; *c != '\0'; ++c) { + if (!spvIsValidIDCharacter(*c)) { + return false; + } + } + // If the string was empty, then the ID also is not valid. + return c != textValue; +} + +// Text API + +spv_result_t spvTextToLiteral(const char* textValue, spv_literal_t* pLiteral) { + bool isSigned = false; + int numPeriods = 0; + bool isString = false; + + const size_t len = strlen(textValue); + if (len == 0) return SPV_FAILED_MATCH; + + for (uint64_t index = 0; index < len; ++index) { + switch (textValue[index]) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + break; + case '.': + numPeriods++; + break; + case '-': + if (index == 0) { + isSigned = true; + } else { + isString = true; + } + break; + default: + isString = true; + index = len; // break out of the loop too. + break; + } + } + + pLiteral->type = spv_literal_type_t(99); + + if (isString || numPeriods > 1 || (isSigned && len == 1)) { + if (len < 2 || textValue[0] != '"' || textValue[len - 1] != '"') + return SPV_FAILED_MATCH; + bool escaping = false; + for (const char* val = textValue + 1; val != textValue + len - 1; ++val) { + if ((*val == '\\') && (!escaping)) { + escaping = true; + } else { + // Have to save space for the null-terminator + if (pLiteral->str.size() >= SPV_LIMIT_LITERAL_STRING_BYTES_MAX) + return SPV_ERROR_OUT_OF_MEMORY; + pLiteral->str.push_back(*val); + escaping = false; + } + } + + pLiteral->type = SPV_LITERAL_TYPE_STRING; + } else if (numPeriods == 1) { + double d = std::strtod(textValue, nullptr); + float f = (float)d; + if (d == (double)f) { + pLiteral->type = SPV_LITERAL_TYPE_FLOAT_32; + pLiteral->value.f = f; + } else { + pLiteral->type = SPV_LITERAL_TYPE_FLOAT_64; + pLiteral->value.d = d; + } + } else if (isSigned) { + int64_t i64 = strtoll(textValue, nullptr, 10); + int32_t i32 = (int32_t)i64; + if (i64 == (int64_t)i32) { + pLiteral->type = SPV_LITERAL_TYPE_INT_32; + pLiteral->value.i32 = i32; + } else { + pLiteral->type = SPV_LITERAL_TYPE_INT_64; + pLiteral->value.i64 = i64; + } + } else { + uint64_t u64 = strtoull(textValue, nullptr, 10); + uint32_t u32 = (uint32_t)u64; + if (u64 == (uint64_t)u32) { + pLiteral->type = SPV_LITERAL_TYPE_UINT_32; + pLiteral->value.u32 = u32; + } else { + pLiteral->type = SPV_LITERAL_TYPE_UINT_64; + pLiteral->value.u64 = u64; + } + } + + return SPV_SUCCESS; +} + +namespace { + +/// Parses an immediate integer from text, guarding against overflow. If +/// successful, adds the parsed value to pInst, advances the context past it, +/// and returns SPV_SUCCESS. Otherwise, leaves pInst alone, emits diagnostics, +/// and returns SPV_ERROR_INVALID_TEXT. +spv_result_t encodeImmediate(libspirv::AssemblyContext* context, + const char* text, spv_instruction_t* pInst) { + assert(*text == '!'); + uint32_t parse_result; + if (!spvutils::ParseNumber(text + 1, &parse_result)) { + return context->diagnostic(SPV_ERROR_INVALID_TEXT) + << "Invalid immediate integer: !" << text + 1; + } + context->binaryEncodeU32(parse_result, pInst); + context->seekForward(static_cast(strlen(text))); + return SPV_SUCCESS; +} + +} // anonymous namespace + +/// @brief Translate an Opcode operand to binary form +/// +/// @param[in] grammar the grammar to use for compilation +/// @param[in, out] context the dynamic compilation info +/// @param[in] type of the operand +/// @param[in] textValue word of text to be parsed +/// @param[out] pInst return binary Opcode +/// @param[in,out] pExpectedOperands the operand types expected +/// +/// @return result code +spv_result_t spvTextEncodeOperand(const libspirv::AssemblyGrammar& grammar, + libspirv::AssemblyContext* context, + const spv_operand_type_t type, + const char* textValue, + spv_instruction_t* pInst, + spv_operand_pattern_t* pExpectedOperands) { + // NOTE: Handle immediate int in the stream + if ('!' == textValue[0]) { + if (auto error = encodeImmediate(context, textValue, pInst)) { + return error; + } + *pExpectedOperands = + spvAlternatePatternFollowingImmediate(*pExpectedOperands); + return SPV_SUCCESS; + } + + // Optional literal operands can fail to parse. In that case use + // SPV_FAILED_MATCH to avoid emitting a diagostic. Use the following + // for those situations. + spv_result_t error_code_for_literals = + spvOperandIsOptional(type) ? SPV_FAILED_MATCH : SPV_ERROR_INVALID_TEXT; + + switch (type) { + case SPV_OPERAND_TYPE_ID: + case SPV_OPERAND_TYPE_TYPE_ID: + case SPV_OPERAND_TYPE_RESULT_ID: + case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: + case SPV_OPERAND_TYPE_SCOPE_ID: + case SPV_OPERAND_TYPE_OPTIONAL_ID: { + if ('%' == textValue[0]) { + textValue++; + } else { + return context->diagnostic() << "Expected id to start with %."; + } + if (!spvIsValidID(textValue)) { + return context->diagnostic() << "Invalid ID " << textValue; + } + const uint32_t id = context->spvNamedIdAssignOrGet(textValue); + if (type == SPV_OPERAND_TYPE_TYPE_ID) pInst->resultTypeId = id; + spvInstructionAddWord(pInst, id); + + // Set the extended instruction type. + // The import set id is the 3rd operand of OpExtInst. + if (pInst->opcode == SpvOpExtInst && pInst->words.size() == 4) { + auto ext_inst_type = context->getExtInstTypeForId(pInst->words[3]); + if (ext_inst_type == SPV_EXT_INST_TYPE_NONE) { + return context->diagnostic() + << "Invalid extended instruction import Id " + << pInst->words[2]; + } + pInst->extInstType = ext_inst_type; + } + } break; + + case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: { + // The assembler accepts the symbolic name for an extended instruction, + // and emits its corresponding number. + spv_ext_inst_desc extInst; + if (grammar.lookupExtInst(pInst->extInstType, textValue, &extInst)) { + return context->diagnostic() + << "Invalid extended instruction name '" << textValue << "'."; + } + spvInstructionAddWord(pInst, extInst->ext_inst); + + // Prepare to parse the operands for the extended instructions. + spvPushOperandTypes(extInst->operandTypes, pExpectedOperands); + } break; + + case SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER: { + // The assembler accepts the symbolic name for the opcode, but without + // the "Op" prefix. For example, "IAdd" is accepted. The number + // of the opcode is emitted. + SpvOp opcode; + if (grammar.lookupSpecConstantOpcode(textValue, &opcode)) { + return context->diagnostic() << "Invalid " << spvOperandTypeStr(type) + << " '" << textValue << "'."; + } + spv_opcode_desc opcodeEntry = nullptr; + if (grammar.lookupOpcode(opcode, &opcodeEntry)) { + return context->diagnostic(SPV_ERROR_INTERNAL) + << "OpSpecConstant opcode table out of sync"; + } + spvInstructionAddWord(pInst, uint32_t(opcodeEntry->opcode)); + + // Prepare to parse the operands for the opcode. Except skip the + // type Id and result Id, since they've already been processed. + assert(opcodeEntry->hasType); + assert(opcodeEntry->hasResult); + assert(opcodeEntry->numTypes >= 2); + spvPushOperandTypes(opcodeEntry->operandTypes + 2, pExpectedOperands); + } break; + + case SPV_OPERAND_TYPE_LITERAL_INTEGER: + case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER: { + // The current operand is an *unsigned* 32-bit integer. + // That's just how the grammar works. + libspirv::IdType expected_type = { + 32, false, libspirv::IdTypeClass::kScalarIntegerType}; + if (auto error = context->binaryEncodeNumericLiteral( + textValue, error_code_for_literals, expected_type, pInst)) { + return error; + } + } break; + + case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_NUMBER: + // This is a context-independent literal number which can be a 32-bit + // number of floating point value. + if (auto error = context->binaryEncodeNumericLiteral( + textValue, error_code_for_literals, libspirv::kUnknownType, + pInst)) { + return error; + } + break; + + case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER: + case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: { + libspirv::IdType expected_type = libspirv::kUnknownType; + // The encoding for OpConstant, OpSpecConstant and OpSwitch all + // depend on either their own result-id or the result-id of + // one of their parameters. + if (SpvOpConstant == pInst->opcode || + SpvOpSpecConstant == pInst->opcode) { + // The type of the literal is determined by the type Id of the + // instruction. + expected_type = + context->getTypeOfTypeGeneratingValue(pInst->resultTypeId); + if (!libspirv::isScalarFloating(expected_type) && + !libspirv::isScalarIntegral(expected_type)) { + spv_opcode_desc d; + const char* opcode_name = "opcode"; + if (SPV_SUCCESS == grammar.lookupOpcode(pInst->opcode, &d)) { + opcode_name = d->name; + } + return context->diagnostic() + << "Type for " << opcode_name + << " must be a scalar floating point or integer type"; + } + } else if (pInst->opcode == SpvOpSwitch) { + // The type of the literal is the same as the type of the selector. + expected_type = context->getTypeOfValueInstruction(pInst->words[1]); + if (!libspirv::isScalarIntegral(expected_type)) { + return context->diagnostic() + << "The selector operand for OpSwitch must be the result" + " of an instruction that generates an integer scalar"; + } + } + if (auto error = context->binaryEncodeNumericLiteral( + textValue, error_code_for_literals, expected_type, pInst)) { + return error; + } + } break; + + case SPV_OPERAND_TYPE_LITERAL_STRING: + case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING: { + spv_literal_t literal = {}; + spv_result_t error = spvTextToLiteral(textValue, &literal); + if (error != SPV_SUCCESS) { + if (error == SPV_ERROR_OUT_OF_MEMORY) return error; + return context->diagnostic(error_code_for_literals) + << "Invalid literal string '" << textValue << "'."; + } + if (literal.type != SPV_LITERAL_TYPE_STRING) { + return context->diagnostic() + << "Expected literal string, found literal number '" << textValue + << "'."; + } + + // NOTE: Special case for extended instruction library import + if (SpvOpExtInstImport == pInst->opcode) { + const spv_ext_inst_type_t ext_inst_type = + spvExtInstImportTypeGet(literal.str.c_str()); + if (SPV_EXT_INST_TYPE_NONE == ext_inst_type) { + return context->diagnostic() + << "Invalid extended instruction import '" << literal.str + << "'"; + } + if ((error = context->recordIdAsExtInstImport(pInst->words[1], + ext_inst_type))) + return error; + } + + if (context->binaryEncodeString(literal.str.c_str(), pInst)) + return SPV_ERROR_INVALID_TEXT; + } break; + + // Masks. + case SPV_OPERAND_TYPE_FP_FAST_MATH_MODE: + case SPV_OPERAND_TYPE_FUNCTION_CONTROL: + case SPV_OPERAND_TYPE_LOOP_CONTROL: + case SPV_OPERAND_TYPE_IMAGE: + case SPV_OPERAND_TYPE_OPTIONAL_IMAGE: + case SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS: + case SPV_OPERAND_TYPE_SELECTION_CONTROL: + case SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS: { + uint32_t value; + if (grammar.parseMaskOperand(type, textValue, &value)) { + return context->diagnostic() << "Invalid " << spvOperandTypeStr(type) + << " operand '" << textValue << "'."; + } + if (auto error = context->binaryEncodeU32(value, pInst)) return error; + // Prepare to parse the operands for this logical operand. + grammar.pushOperandTypesForMask(type, value, pExpectedOperands); + } break; + case SPV_OPERAND_TYPE_OPTIONAL_CIV: { + auto error = spvTextEncodeOperand( + grammar, context, SPV_OPERAND_TYPE_OPTIONAL_LITERAL_NUMBER, textValue, + pInst, pExpectedOperands); + if (error == SPV_FAILED_MATCH) { + // It's not a literal number -- is it a literal string? + error = spvTextEncodeOperand(grammar, context, + SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING, + textValue, pInst, pExpectedOperands); + } + if (error == SPV_FAILED_MATCH) { + // It's not a literal -- is it an ID? + error = + spvTextEncodeOperand(grammar, context, SPV_OPERAND_TYPE_OPTIONAL_ID, + textValue, pInst, pExpectedOperands); + } + if (error) { + return context->diagnostic(error) + << "Invalid word following !: " << textValue; + } + if (pExpectedOperands->empty()) { + pExpectedOperands->push_back(SPV_OPERAND_TYPE_OPTIONAL_CIV); + } + } break; + default: { + // NOTE: All non literal operands are handled here using the operand + // table. + spv_operand_desc entry; + if (grammar.lookupOperand(type, textValue, strlen(textValue), &entry)) { + return context->diagnostic() << "Invalid " << spvOperandTypeStr(type) + << " '" << textValue << "'."; + } + if (context->binaryEncodeU32(entry->value, pInst)) { + return context->diagnostic() << "Invalid " << spvOperandTypeStr(type) + << " '" << textValue << "'."; + } + + // Prepare to parse the operands for this logical operand. + spvPushOperandTypes(entry->operandTypes, pExpectedOperands); + } break; + } + return SPV_SUCCESS; +} + +namespace { + +/// Encodes an instruction started by ! at the given position in text. +/// +/// Puts the encoded words into *pInst. If successful, moves position past the +/// instruction and returns SPV_SUCCESS. Otherwise, returns an error code and +/// leaves position pointing to the error in text. +spv_result_t encodeInstructionStartingWithImmediate( + const libspirv::AssemblyGrammar& grammar, + libspirv::AssemblyContext* context, spv_instruction_t* pInst) { + std::string firstWord; + spv_position_t nextPosition = {}; + auto error = context->getWord(&firstWord, &nextPosition); + if (error) return context->diagnostic(error) << "Internal Error"; + + if ((error = encodeImmediate(context, firstWord.c_str(), pInst))) { + return error; + } + while (context->advance() != SPV_END_OF_STREAM) { + // A beginning of a new instruction means we're done. + if (context->isStartOfNewInst()) return SPV_SUCCESS; + + // Otherwise, there must be an operand that's either a literal, an ID, or + // an immediate. + std::string operandValue; + if ((error = context->getWord(&operandValue, &nextPosition))) + return context->diagnostic(error) << "Internal Error"; + + if (operandValue == "=") + return context->diagnostic() << firstWord << " not allowed before =."; + + // Needed to pass to spvTextEncodeOpcode(), but it shouldn't ever be + // expanded. + spv_operand_pattern_t dummyExpectedOperands; + error = spvTextEncodeOperand( + grammar, context, SPV_OPERAND_TYPE_OPTIONAL_CIV, operandValue.c_str(), + pInst, &dummyExpectedOperands); + if (error) return error; + context->setPosition(nextPosition); + } + return SPV_SUCCESS; +} + +/// @brief Translate single Opcode and operands to binary form +/// +/// @param[in] grammar the grammar to use for compilation +/// @param[in, out] context the dynamic compilation info +/// @param[in] text stream to translate +/// @param[out] pInst returned binary Opcode +/// @param[in,out] pPosition in the text stream +/// +/// @return result code +spv_result_t spvTextEncodeOpcode(const libspirv::AssemblyGrammar& grammar, + libspirv::AssemblyContext* context, + spv_instruction_t* pInst) { + // Check for ! first. + if ('!' == context->peek()) { + return encodeInstructionStartingWithImmediate(grammar, context, pInst); + } + + std::string firstWord; + spv_position_t nextPosition = {}; + spv_result_t error = context->getWord(&firstWord, &nextPosition); + if (error) return context->diagnostic() << "Internal Error"; + + std::string opcodeName; + std::string result_id; + spv_position_t result_id_position = {}; + if (context->startsWithOp()) { + opcodeName = firstWord; + } else { + result_id = firstWord; + if ('%' != result_id.front()) { + return context->diagnostic() + << "Expected or at the beginning " + "of an instruction, found '" + << result_id << "'."; + } + result_id_position = context->position(); + + // The '=' sign. + context->setPosition(nextPosition); + if (context->advance()) + return context->diagnostic() << "Expected '=', found end of stream."; + std::string equal_sign; + error = context->getWord(&equal_sign, &nextPosition); + if ("=" != equal_sign) + return context->diagnostic() << "'=' expected after result id."; + + // The after the '=' sign. + context->setPosition(nextPosition); + if (context->advance()) + return context->diagnostic() << "Expected opcode, found end of stream."; + error = context->getWord(&opcodeName, &nextPosition); + if (error) return context->diagnostic(error) << "Internal Error"; + if (!context->startsWithOp()) { + return context->diagnostic() + << "Invalid Opcode prefix '" << opcodeName << "'."; + } + } + + // NOTE: The table contains Opcode names without the "Op" prefix. + const char* pInstName = opcodeName.data() + 2; + + spv_opcode_desc opcodeEntry; + error = grammar.lookupOpcode(pInstName, &opcodeEntry); + if (error) { + return context->diagnostic(error) + << "Invalid Opcode name '" << opcodeName << "'"; + } + if (opcodeEntry->hasResult && result_id.empty()) { + return context->diagnostic() + << "Expected at the beginning of an instruction, found '" + << firstWord << "'."; + } + pInst->opcode = opcodeEntry->opcode; + context->setPosition(nextPosition); + // Reserve the first word for the instruction. + spvInstructionAddWord(pInst, 0); + + // Maintains the ordered list of expected operand types. + // For many instructions we only need the {numTypes, operandTypes} + // entries in opcodeEntry. However, sometimes we need to modify + // the list as we parse the operands. This occurs when an operand + // has its own logical operands (such as the LocalSize operand for + // ExecutionMode), or for extended instructions that may have their + // own operands depending on the selected extended instruction. + spv_operand_pattern_t expectedOperands; + expectedOperands.reserve(opcodeEntry->numTypes); + for (auto i = 0; i < opcodeEntry->numTypes; i++) + expectedOperands.push_back( + opcodeEntry->operandTypes[opcodeEntry->numTypes - i - 1]); + + while (!expectedOperands.empty()) { + const spv_operand_type_t type = expectedOperands.back(); + expectedOperands.pop_back(); + + // Expand optional tuples lazily. + if (spvExpandOperandSequenceOnce(type, &expectedOperands)) continue; + + if (type == SPV_OPERAND_TYPE_RESULT_ID && !result_id.empty()) { + // Handle the for value generating instructions. + // We've already consumed it from the text stream. Here + // we inject its words into the instruction. + spv_position_t temp_pos = context->position(); + error = spvTextEncodeOperand(grammar, context, SPV_OPERAND_TYPE_RESULT_ID, + result_id.c_str(), pInst, nullptr); + result_id_position = context->position(); + // Because we are injecting we have to reset the position afterwards. + context->setPosition(temp_pos); + if (error) return error; + } else { + // Find the next word. + error = context->advance(); + if (error == SPV_END_OF_STREAM) { + if (spvOperandIsOptional(type)) { + // This would have been the last potential operand for the + // instruction, + // and we didn't find one. We're finished parsing this instruction. + break; + } else { + return context->diagnostic() + << "Expected operand, found end of stream."; + } + } + assert(error == SPV_SUCCESS && "Somebody added another way to fail"); + + if (context->isStartOfNewInst()) { + if (spvOperandIsOptional(type)) { + break; + } else { + return context->diagnostic() + << "Expected operand, found next instruction instead."; + } + } + + std::string operandValue; + error = context->getWord(&operandValue, &nextPosition); + if (error) return context->diagnostic(error) << "Internal Error"; + + error = spvTextEncodeOperand(grammar, context, type, operandValue.c_str(), + pInst, &expectedOperands); + + if (error == SPV_FAILED_MATCH && spvOperandIsOptional(type)) + return SPV_SUCCESS; + + if (error) return error; + + context->setPosition(nextPosition); + } + } + + if (spvOpcodeGeneratesType(pInst->opcode)) { + if (context->recordTypeDefinition(pInst) != SPV_SUCCESS) { + return SPV_ERROR_INVALID_TEXT; + } + } else if (opcodeEntry->hasType) { + // SPIR-V dictates that if an instruction has both a return value and a + // type ID then the type id is first, and the return value is second. + assert(opcodeEntry->hasResult && + "Unknown opcode: has a type but no result."); + context->recordTypeIdForValue(pInst->words[2], pInst->words[1]); + } + + if (pInst->words.size() > SPV_LIMIT_INSTRUCTION_WORD_COUNT_MAX) { + return context->diagnostic() + << "Instruction too long: " << pInst->words.size() + << " words, but the limit is " + << SPV_LIMIT_INSTRUCTION_WORD_COUNT_MAX; + } + + pInst->words[0] = + spvOpcodeMake(uint16_t(pInst->words.size()), opcodeEntry->opcode); + + return SPV_SUCCESS; +} + +enum { kAssemblerVersion = 0 }; + +// Populates a binary stream's |header|. The target environment is specified via +// |env| and Id bound is via |bound|. +spv_result_t SetHeader(spv_target_env env, const uint32_t bound, + uint32_t* header) { + if (!header) return SPV_ERROR_INVALID_BINARY; + + header[SPV_INDEX_MAGIC_NUMBER] = SpvMagicNumber; + header[SPV_INDEX_VERSION_NUMBER] = spvVersionForTargetEnv(env); + header[SPV_INDEX_GENERATOR_NUMBER] = + SPV_GENERATOR_WORD(SPV_GENERATOR_KHRONOS_ASSEMBLER, kAssemblerVersion); + header[SPV_INDEX_BOUND] = bound; + header[SPV_INDEX_SCHEMA] = 0; // NOTE: Reserved + + return SPV_SUCCESS; +} + +// Collects all numeric ids in the module source into |numeric_ids|. +// This function is essentially a dry-run of spvTextToBinary. +spv_result_t GetNumericIds(const libspirv::AssemblyGrammar& grammar, + const spvtools::MessageConsumer& consumer, + const spv_text text, + std::set* numeric_ids) { + libspirv::AssemblyContext context(text, consumer); + + if (!text->str) return context.diagnostic() << "Missing assembly text."; + + if (!grammar.isValid()) { + return SPV_ERROR_INVALID_TABLE; + } + + // Skip past whitespace and comments. + context.advance(); + + while (context.hasText()) { + spv_instruction_t inst; + + if (spvTextEncodeOpcode(grammar, &context, &inst)) { + return SPV_ERROR_INVALID_TEXT; + } + + if (context.advance()) break; + } + + *numeric_ids = context.GetNumericIds(); + return SPV_SUCCESS; +} + +// Translates a given assembly language module into binary form. +// If a diagnostic is generated, it is not yet marked as being +// for a text-based input. +spv_result_t spvTextToBinaryInternal(const libspirv::AssemblyGrammar& grammar, + const spvtools::MessageConsumer& consumer, + const spv_text text, + const uint32_t options, + spv_binary* pBinary) { + // The ids in this set will have the same values both in source and binary. + // All other ids will be generated by filling in the gaps. + std::set ids_to_preserve; + + if (options & SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS) { + // Collect all numeric ids from the source into ids_to_preserve. + const spv_result_t result = + GetNumericIds(grammar, consumer, text, &ids_to_preserve); + if (result != SPV_SUCCESS) return result; + } + + libspirv::AssemblyContext context(text, consumer, std::move(ids_to_preserve)); + + if (!text->str) return context.diagnostic() << "Missing assembly text."; + + if (!grammar.isValid()) { + return SPV_ERROR_INVALID_TABLE; + } + if (!pBinary) return SPV_ERROR_INVALID_POINTER; + + std::vector instructions; + + // Skip past whitespace and comments. + context.advance(); + + while (context.hasText()) { + instructions.push_back({}); + spv_instruction_t& inst = instructions.back(); + + if (spvTextEncodeOpcode(grammar, &context, &inst)) { + return SPV_ERROR_INVALID_TEXT; + } + + if (context.advance()) break; + } + + size_t totalSize = SPV_INDEX_INSTRUCTION; + for (auto& inst : instructions) { + totalSize += inst.words.size(); + } + + uint32_t* data = new uint32_t[totalSize]; + if (!data) return SPV_ERROR_OUT_OF_MEMORY; + uint64_t currentIndex = SPV_INDEX_INSTRUCTION; + for (auto& inst : instructions) { + memcpy(data + currentIndex, inst.words.data(), + sizeof(uint32_t) * inst.words.size()); + currentIndex += inst.words.size(); + } + + if (auto error = SetHeader(grammar.target_env(), context.getBound(), data)) + return error; + + spv_binary binary = new spv_binary_t(); + if (!binary) { + delete[] data; + return SPV_ERROR_OUT_OF_MEMORY; + } + binary->code = data; + binary->wordCount = totalSize; + + *pBinary = binary; + + return SPV_SUCCESS; +} + +} // anonymous namespace + +spv_result_t spvTextToBinary(const spv_const_context context, + const char* input_text, + const size_t input_text_size, spv_binary* pBinary, + spv_diagnostic* pDiagnostic) { + return spvTextToBinaryWithOptions(context, input_text, input_text_size, + SPV_BINARY_TO_TEXT_OPTION_NONE, pBinary, + pDiagnostic); +} + +spv_result_t spvTextToBinaryWithOptions(const spv_const_context context, + const char* input_text, + const size_t input_text_size, + const uint32_t options, + spv_binary* pBinary, + spv_diagnostic* pDiagnostic) { + spv_context_t hijack_context = *context; + if (pDiagnostic) { + *pDiagnostic = nullptr; + libspirv::UseDiagnosticAsMessageConsumer(&hijack_context, pDiagnostic); + } + + spv_text_t text = {input_text, input_text_size}; + libspirv::AssemblyGrammar grammar(&hijack_context); + + spv_result_t result = spvTextToBinaryInternal( + grammar, hijack_context.consumer, &text, options, pBinary); + if (pDiagnostic && *pDiagnostic) (*pDiagnostic)->isTextSource = true; + + return result; +} + +void spvTextDestroy(spv_text text) { + if (!text) return; + delete[] text->str; + delete text; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/text.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/text.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/text.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/text.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,53 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_TEXT_H_ +#define LIBSPIRV_TEXT_H_ + +#include + +#include "operand.h" +#include "spirv-tools/libspirv.h" +#include "spirv_constant.h" + +typedef enum spv_literal_type_t { + SPV_LITERAL_TYPE_INT_32, + SPV_LITERAL_TYPE_INT_64, + SPV_LITERAL_TYPE_UINT_32, + SPV_LITERAL_TYPE_UINT_64, + SPV_LITERAL_TYPE_FLOAT_32, + SPV_LITERAL_TYPE_FLOAT_64, + SPV_LITERAL_TYPE_STRING, + SPV_FORCE_32_BIT_ENUM(spv_literal_type_t) +} spv_literal_type_t; + +typedef struct spv_literal_t { + spv_literal_type_t type; + union value_t { + int32_t i32; + int64_t i64; + uint32_t u32; + uint64_t u64; + float f; + double d; + } value; + std::string str; // Special field for literal string. +} spv_literal_t; + +// Converts the given text string to a number/string literal and writes the +// result to *literal. String literals must be surrounded by double-quotes ("), +// which are then stripped. +spv_result_t spvTextToLiteral(const char* text, spv_literal_t* literal); + +#endif // LIBSPIRV_TEXT_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/text_handler.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/text_handler.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/text_handler.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/text_handler.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,397 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "text_handler.h" + +#include +#include +#include +#include +#include + +#include "assembly_grammar.h" +#include "binary.h" +#include "ext_inst.h" +#include "instruction.h" +#include "opcode.h" +#include "text.h" +#include "util/bitutils.h" +#include "util/hex_float.h" +#include "util/parse_number.h" + +namespace { +// Advances |text| to the start of the next line and writes the new position to +// |position|. +spv_result_t advanceLine(spv_text text, spv_position position) { + while (true) { + if (position->index >= text->length) return SPV_END_OF_STREAM; + switch (text->str[position->index]) { + case '\0': + return SPV_END_OF_STREAM; + case '\n': + position->column = 0; + position->line++; + position->index++; + return SPV_SUCCESS; + default: + position->column++; + position->index++; + break; + } + } +} + +// Advances |text| to first non white space character and writes the new +// position to |position|. +// If a null terminator is found during the text advance, SPV_END_OF_STREAM is +// returned, SPV_SUCCESS otherwise. No error checking is performed on the +// parameters, its the users responsibility to ensure these are non null. +spv_result_t advance(spv_text text, spv_position position) { + // NOTE: Consume white space, otherwise don't advance. + if (position->index >= text->length) return SPV_END_OF_STREAM; + switch (text->str[position->index]) { + case '\0': + return SPV_END_OF_STREAM; + case ';': + if (spv_result_t error = advanceLine(text, position)) return error; + return advance(text, position); + case ' ': + case '\t': + case '\r': + position->column++; + position->index++; + return advance(text, position); + case '\n': + position->column = 0; + position->line++; + position->index++; + return advance(text, position); + default: + break; + } + return SPV_SUCCESS; +} + +// Fetches the next word from the given text stream starting from the given +// *position. On success, writes the decoded word into *word and updates +// *position to the location past the returned word. +// +// A word ends at the next comment or whitespace. However, double-quoted +// strings remain intact, and a backslash always escapes the next character. +spv_result_t getWord(spv_text text, spv_position position, std::string* word) { + if (!text->str || !text->length) return SPV_ERROR_INVALID_TEXT; + if (!position) return SPV_ERROR_INVALID_POINTER; + + const size_t start_index = position->index; + + bool quoting = false; + bool escaping = false; + + // NOTE: Assumes first character is not white space! + while (true) { + if (position->index >= text->length) { + word->assign(text->str + start_index, text->str + position->index); + return SPV_SUCCESS; + } + const char ch = text->str[position->index]; + if (ch == '\\') + escaping = !escaping; + else { + switch (ch) { + case '"': + if (!escaping) quoting = !quoting; + break; + case ' ': + case ';': + case '\t': + case '\n': + case '\r': + if (escaping || quoting) break; + // Fall through. + case '\0': { // NOTE: End of word found! + word->assign(text->str + start_index, text->str + position->index); + return SPV_SUCCESS; + } + default: + break; + } + escaping = false; + } + + position->column++; + position->index++; + } +} + +// Returns true if the characters in the text as position represent +// the start of an Opcode. +bool startsWithOp(spv_text text, spv_position position) { + if (text->length < position->index + 3) return false; + char ch0 = text->str[position->index]; + char ch1 = text->str[position->index + 1]; + char ch2 = text->str[position->index + 2]; + return ('O' == ch0 && 'p' == ch1 && ('A' <= ch2 && ch2 <= 'Z')); +} + +} // anonymous namespace + +namespace libspirv { + +const IdType kUnknownType = {0, false, IdTypeClass::kBottom}; + +// TODO(dneto): Reorder AssemblyContext definitions to match declaration order. + +// This represents all of the data that is only valid for the duration of +// a single compilation. +uint32_t AssemblyContext::spvNamedIdAssignOrGet(const char* textValue) { + if (!ids_to_preserve_.empty()) { + uint32_t id = 0; + if (spvutils::ParseNumber(textValue, &id)) { + if (ids_to_preserve_.find(id) != ids_to_preserve_.end()) { + bound_ = std::max(bound_, id + 1); + return id; + } + } + } + + const auto it = named_ids_.find(textValue); + if (it == named_ids_.end()) { + uint32_t id = next_id_++; + if (!ids_to_preserve_.empty()) { + while (ids_to_preserve_.find(id) != ids_to_preserve_.end()) { + id = next_id_++; + } + } + + named_ids_.emplace(textValue, id); + bound_ = std::max(bound_, id + 1); + return id; + } + + return it->second; +} + +uint32_t AssemblyContext::getBound() const { return bound_; } + +spv_result_t AssemblyContext::advance() { + return ::advance(text_, ¤t_position_); +} + +spv_result_t AssemblyContext::getWord(std::string* word, + spv_position next_position) { + *next_position = current_position_; + return ::getWord(text_, next_position, word); +} + +bool AssemblyContext::startsWithOp() { + return ::startsWithOp(text_, ¤t_position_); +} + +bool AssemblyContext::isStartOfNewInst() { + spv_position_t pos = current_position_; + if (::advance(text_, &pos)) return false; + if (::startsWithOp(text_, &pos)) return true; + + std::string word; + pos = current_position_; + if (::getWord(text_, &pos, &word)) return false; + if ('%' != word.front()) return false; + + if (::advance(text_, &pos)) return false; + if (::getWord(text_, &pos, &word)) return false; + if ("=" != word) return false; + + if (::advance(text_, &pos)) return false; + if (::startsWithOp(text_, &pos)) return true; + return false; +} + +char AssemblyContext::peek() const { + return text_->str[current_position_.index]; +} + +bool AssemblyContext::hasText() const { + return text_->length > current_position_.index; +} + +void AssemblyContext::seekForward(uint32_t size) { + current_position_.index += size; + current_position_.column += size; +} + +spv_result_t AssemblyContext::binaryEncodeU32(const uint32_t value, + spv_instruction_t* pInst) { + pInst->words.insert(pInst->words.end(), value); + return SPV_SUCCESS; +} + +spv_result_t AssemblyContext::binaryEncodeNumericLiteral( + const char* val, spv_result_t error_code, const IdType& type, + spv_instruction_t* pInst) { + using spvutils::EncodeNumberStatus; + // Populate the NumberType from the IdType for parsing. + spvutils::NumberType number_type; + switch (type.type_class) { + case IdTypeClass::kOtherType: + return diagnostic(SPV_ERROR_INTERNAL) + << "Unexpected numeric literal type"; + case IdTypeClass::kScalarIntegerType: + if (type.isSigned) { + number_type = {type.bitwidth, SPV_NUMBER_SIGNED_INT}; + } else { + number_type = {type.bitwidth, SPV_NUMBER_UNSIGNED_INT}; + } + break; + case IdTypeClass::kScalarFloatType: + number_type = {type.bitwidth, SPV_NUMBER_FLOATING}; + break; + case IdTypeClass::kBottom: + // kBottom means the type is unknown and we need to infer the type before + // parsing the number. The rule is: If there is a decimal point, treat + // the value as a floating point value, otherwise a integer value, then + // if the first char of the integer text is '-', treat the integer as a + // signed integer, otherwise an unsigned integer. + uint32_t bitwidth = static_cast(assumedBitWidth(type)); + if (strchr(val, '.')) { + number_type = {bitwidth, SPV_NUMBER_FLOATING}; + } else if (type.isSigned || val[0] == '-') { + number_type = {bitwidth, SPV_NUMBER_SIGNED_INT}; + } else { + number_type = {bitwidth, SPV_NUMBER_UNSIGNED_INT}; + } + break; + } + + std::string error_msg; + EncodeNumberStatus parse_status = ParseAndEncodeNumber( + val, number_type, + [this, pInst](uint32_t d) { this->binaryEncodeU32(d, pInst); }, + &error_msg); + switch (parse_status) { + case EncodeNumberStatus::kSuccess: + return SPV_SUCCESS; + case EncodeNumberStatus::kInvalidText: + return diagnostic(error_code) << error_msg; + case EncodeNumberStatus::kUnsupported: + return diagnostic(SPV_ERROR_INTERNAL) << error_msg; + case EncodeNumberStatus::kInvalidUsage: + return diagnostic(SPV_ERROR_INVALID_TEXT) << error_msg; + } + // This line is not reachable, only added to satisfy the compiler. + return diagnostic(SPV_ERROR_INTERNAL) + << "Unexpected result code from ParseAndEncodeNumber()"; +} + +spv_result_t AssemblyContext::binaryEncodeString(const char* value, + spv_instruction_t* pInst) { + const size_t length = strlen(value); + const size_t wordCount = (length / 4) + 1; + const size_t oldWordCount = pInst->words.size(); + const size_t newWordCount = oldWordCount + wordCount; + + // TODO(dneto): We can just defer this check until later. + if (newWordCount > SPV_LIMIT_INSTRUCTION_WORD_COUNT_MAX) { + return diagnostic() << "Instruction too long: more than " + << SPV_LIMIT_INSTRUCTION_WORD_COUNT_MAX << " words."; + } + + pInst->words.resize(newWordCount); + + // Make sure all the bytes in the last word are 0, in case we only + // write a partial word at the end. + pInst->words.back() = 0; + + char* dest = (char*)&pInst->words[oldWordCount]; + strncpy(dest, value, length); + + return SPV_SUCCESS; +} + +spv_result_t AssemblyContext::recordTypeDefinition( + const spv_instruction_t* pInst) { + uint32_t value = pInst->words[1]; + if (types_.find(value) != types_.end()) { + return diagnostic() << "Value " << value + << " has already been used to generate a type"; + } + + if (pInst->opcode == SpvOpTypeInt) { + if (pInst->words.size() != 4) + return diagnostic() << "Invalid OpTypeInt instruction"; + types_[value] = {pInst->words[2], pInst->words[3] != 0, + IdTypeClass::kScalarIntegerType}; + } else if (pInst->opcode == SpvOpTypeFloat) { + if (pInst->words.size() != 3) + return diagnostic() << "Invalid OpTypeFloat instruction"; + types_[value] = {pInst->words[2], false, IdTypeClass::kScalarFloatType}; + } else { + types_[value] = {0, false, IdTypeClass::kOtherType}; + } + return SPV_SUCCESS; +} + +IdType AssemblyContext::getTypeOfTypeGeneratingValue(uint32_t value) const { + auto type = types_.find(value); + if (type == types_.end()) { + return kUnknownType; + } + return std::get<1>(*type); +} + +IdType AssemblyContext::getTypeOfValueInstruction(uint32_t value) const { + auto type_value = value_types_.find(value); + if (type_value == value_types_.end()) { + return {0, false, IdTypeClass::kBottom}; + } + return getTypeOfTypeGeneratingValue(std::get<1>(*type_value)); +} + +spv_result_t AssemblyContext::recordTypeIdForValue(uint32_t value, + uint32_t type) { + bool successfully_inserted = false; + std::tie(std::ignore, successfully_inserted) = + value_types_.insert(std::make_pair(value, type)); + if (!successfully_inserted) + return diagnostic() << "Value is being defined a second time"; + return SPV_SUCCESS; +} + +spv_result_t AssemblyContext::recordIdAsExtInstImport( + uint32_t id, spv_ext_inst_type_t type) { + bool successfully_inserted = false; + std::tie(std::ignore, successfully_inserted) = + import_id_to_ext_inst_type_.insert(std::make_pair(id, type)); + if (!successfully_inserted) + return diagnostic() << "Import Id is being defined a second time"; + return SPV_SUCCESS; +} + +spv_ext_inst_type_t AssemblyContext::getExtInstTypeForId(uint32_t id) const { + auto type = import_id_to_ext_inst_type_.find(id); + if (type == import_id_to_ext_inst_type_.end()) { + return SPV_EXT_INST_TYPE_NONE; + } + return std::get<1>(*type); +} + +std::set AssemblyContext::GetNumericIds() const { + std::set ids; + for (const auto& kv : named_ids_) { + uint32_t id; + if (spvutils::ParseNumber(kv.first.c_str(), &id)) ids.insert(id); + } + return ids; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/text_handler.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/text_handler.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/text_handler.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/text_handler.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,259 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_TEXT_HANDLER_H_ +#define LIBSPIRV_TEXT_HANDLER_H_ + +#include +#include +#include +#include + +#include "diagnostic.h" +#include "instruction.h" +#include "message.h" +#include "spirv-tools/libspirv.h" +#include "text.h" + +namespace libspirv { +// Structures + +// This is a lattice for tracking types. +enum class IdTypeClass { + kBottom = 0, // We have no information yet. + kScalarIntegerType, + kScalarFloatType, + kOtherType +}; + +// Contains ID type information that needs to be tracked across all Ids. +// Bitwidth is only valid when type_class is kScalarIntegerType or +// kScalarFloatType. +struct IdType { + uint32_t bitwidth; // Safe to assume that we will not have > 2^32 bits. + bool isSigned; // This is only significant if type_class is integral. + IdTypeClass type_class; +}; + +// Default equality operator for IdType. Tests if all members are the same. +inline bool operator==(const IdType& first, const IdType& second) { + return (first.bitwidth == second.bitwidth) && + (first.isSigned == second.isSigned) && + (first.type_class == second.type_class); +} + +// Tests whether any member of the IdTypes do not match. +inline bool operator!=(const IdType& first, const IdType& second) { + return !(first == second); +} + +// A value representing an unknown type. +extern const IdType kUnknownType; + +// Returns true if the type is a scalar integer type. +inline bool isScalarIntegral(const IdType& type) { + return type.type_class == IdTypeClass::kScalarIntegerType; +} + +// Returns true if the type is a scalar floating point type. +inline bool isScalarFloating(const IdType& type) { + return type.type_class == IdTypeClass::kScalarFloatType; +} + +// Returns the number of bits in the type. +// This is only valid for bottom, scalar integer, and scalar floating +// classes. For bottom, assume 32 bits. +inline int assumedBitWidth(const IdType& type) { + switch (type.type_class) { + case IdTypeClass::kBottom: + return 32; + case IdTypeClass::kScalarIntegerType: + case IdTypeClass::kScalarFloatType: + return type.bitwidth; + default: + break; + } + // We don't care about this case. + return 0; +} + +// A templated class with a static member function Clamp, where Clamp +// sets a referenced value of type T to 0 if T is an unsigned +// integer type, and returns true if it modified the referenced +// value. +template +class ClampToZeroIfUnsignedType { + public: + // The default specialization does not clamp the value. + static bool Clamp(T*) { return false; } +}; + +// The specialization of ClampToZeroIfUnsignedType for unsigned integer +// types. +template +class ClampToZeroIfUnsignedType< + T, typename std::enable_if::value>::type> { + public: + static bool Clamp(T* value_pointer) { + if (*value_pointer) { + *value_pointer = 0; + return true; + } + return false; + } +}; + +// Encapsulates the data used during the assembly of a SPIR-V module. +class AssemblyContext { + public: + AssemblyContext(spv_text text, const spvtools::MessageConsumer& consumer, + std::set&& ids_to_preserve = std::set()) + : current_position_({}), + consumer_(consumer), + text_(text), + bound_(1), + next_id_(1), + ids_to_preserve_(std::move(ids_to_preserve)) {} + + // Assigns a new integer value to the given text ID, or returns the previously + // assigned integer value if the ID has been seen before. + uint32_t spvNamedIdAssignOrGet(const char* textValue); + + // Returns the largest largest numeric ID that has been assigned. + uint32_t getBound() const; + + // Advances position to point to the next word in the input stream. + // Returns SPV_SUCCESS on success. + spv_result_t advance(); + + // Sets word to the next word in the input text. Fills next_position with + // the next location past the end of the word. + spv_result_t getWord(std::string* word, spv_position next_position); + + // Returns true if the next word in the input is the start of a new Opcode. + bool startsWithOp(); + + // Returns true if the next word in the input is the start of a new + // instruction. + bool isStartOfNewInst(); + + // Returns a diagnostic object initialized with current position in the input + // stream, and for the given error code. Any data written to this object will + // show up in pDiagnsotic on destruction. + DiagnosticStream diagnostic(spv_result_t error) { + return DiagnosticStream(current_position_, consumer_, error); + } + + // Returns a diagnostic object with the default assembly error code. + DiagnosticStream diagnostic() { + // The default failure for assembly is invalid text. + return diagnostic(SPV_ERROR_INVALID_TEXT); + } + + // Returns then next character in the input stream. + char peek() const; + + // Returns true if there is more text in the input stream. + bool hasText() const; + + // Seeks the input stream forward by 'size' characters. + void seekForward(uint32_t size); + + // Sets the current position in the input stream to the given position. + void setPosition(const spv_position_t& newPosition) { + current_position_ = newPosition; + } + + // Returns the current position in the input stream. + const spv_position_t& position() const { return current_position_; } + + // Appends the given 32-bit value to the given instruction. + // Returns SPV_SUCCESS if the value could be correctly inserted in the + // instruction. + spv_result_t binaryEncodeU32(const uint32_t value, spv_instruction_t* pInst); + + // Appends the given string to the given instruction. + // Returns SPV_SUCCESS if the value could be correctly inserted in the + // instruction. + spv_result_t binaryEncodeString(const char* value, spv_instruction_t* pInst); + + // Appends the given numeric literal to the given instruction. + // Validates and respects the bitwidth supplied in the IdType argument. + // If the type is of class kBottom the value will be encoded as a + // 32-bit integer. + // Returns SPV_SUCCESS if the value could be correctly added to the + // instruction. Returns the given error code on failure, and emits + // a diagnostic if that error code is not SPV_FAILED_MATCH. + spv_result_t binaryEncodeNumericLiteral(const char* numeric_literal, + spv_result_t error_code, + const IdType& type, + spv_instruction_t* pInst); + + // Returns the IdType associated with this type-generating value. + // If the type has not been previously recorded with recordTypeDefinition, + // kUnknownType will be returned. + IdType getTypeOfTypeGeneratingValue(uint32_t value) const; + + // Returns the IdType that represents the return value of this Value + // generating instruction. + // If the value has not been recorded with recordTypeIdForValue, or the type + // could not be determined kUnknownType will be returned. + IdType getTypeOfValueInstruction(uint32_t value) const; + + // Tracks the type-defining instruction. The result of the tracking can + // later be queried using getValueType. + // pInst is expected to be completely filled in by the time this instruction + // is called. + // Returns SPV_SUCCESS on success, or SPV_ERROR_INVALID_VALUE on error. + spv_result_t recordTypeDefinition(const spv_instruction_t* pInst); + + // Tracks the relationship between the value and its type. + spv_result_t recordTypeIdForValue(uint32_t value, uint32_t type); + + // Records the given Id as being the import of the given extended instruction + // type. + spv_result_t recordIdAsExtInstImport(uint32_t id, spv_ext_inst_type_t type); + + // Returns the extended instruction type corresponding to the import with + // the given Id, if it exists. Returns SPV_EXT_INST_TYPE_NONE if the + // id is not the id for an extended instruction type. + spv_ext_inst_type_t getExtInstTypeForId(uint32_t id) const; + + // Returns a set consisting of each ID generated by spvNamedIdAssignOrGet from + // a numeric ID text representation. For example, generated from "%12" but not + // from "%foo". + std::set GetNumericIds() const; + + private: + // Maps ID names to their corresponding numerical ids. + using spv_named_id_table = std::unordered_map; + // Maps type-defining IDs to their IdType. + using spv_id_to_type_map = std::unordered_map; + // Maps Ids to the id of their type. + using spv_id_to_type_id = std::unordered_map; + + spv_named_id_table named_ids_; + spv_id_to_type_map types_; + spv_id_to_type_id value_types_; + // Maps an extended instruction import Id to the extended instruction type. + std::unordered_map import_id_to_ext_inst_type_; + spv_position_t current_position_; + spvtools::MessageConsumer consumer_; + spv_text text_; + uint32_t bound_; + uint32_t next_id_; + std::set ids_to_preserve_; +}; +} // namespace libspirv +#endif // _LIBSPIRV_TEXT_HANDLER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/bit_stream.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/bit_stream.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/bit_stream.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/bit_stream.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,437 @@ +// Copyright (c) 2017 Google 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. + +#include +#include +#include +#include +#include + +#include "util/bit_stream.h" + +namespace spvutils { + +namespace { + +// Returns if the system is little-endian. Unfortunately only works during +// runtime. +bool IsLittleEndian() { + // This constant value allows the detection of the host machine's endianness. + // Accessing it as an array of bytes is valid due to C++11 section 3.10 + // paragraph 10. + static const uint16_t kFF00 = 0xff00; + return reinterpret_cast(&kFF00)[0] == 0; +} + +// Copies bytes from the given buffer to a uint64_t buffer. +// Motivation: casting uint64_t* to uint8_t* is ok. Casting in the other +// direction is only advisable if uint8_t* is aligned to 64-bit word boundary. +std::vector ToBuffer64(const void* buffer, size_t num_bytes) { + std::vector out; + out.resize((num_bytes + 7) / 8, 0); + memcpy(out.data(), buffer, num_bytes); + return out; +} + +// Copies uint8_t buffer to a uint64_t buffer. +std::vector ToBuffer64(const std::vector& in) { + return ToBuffer64(in.data(), in.size()); +} + +// Returns uint64_t containing the same bits as |val|. +// Type size must be less than 8 bytes. +template +uint64_t ToU64(T val) { + static_assert(sizeof(T) <= 8, "Type size too big"); + uint64_t val64 = 0; + std::memcpy(&val64, &val, sizeof(T)); + return val64; +} + +// Returns value of type T containing the same bits as |val64|. +// Type size must be less than 8 bytes. Upper (unused) bits of |val64| must be +// zero (irrelevant, but is checked with assertion). +template +T FromU64(uint64_t val64) { + assert(sizeof(T) == 8 || (val64 >> (sizeof(T) * 8)) == 0); + static_assert(sizeof(T) <= 8, "Type size too big"); + T val = 0; + std::memcpy(&val, &val64, sizeof(T)); + return val; +} + +// Writes bits from |val| to |writer| in chunks of size |chunk_length|. +// Signal bit is used to signal if the reader should expect another chunk: +// 0 - no more chunks to follow +// 1 - more chunks to follow +// If number of written bits reaches |max_payload| last chunk is truncated. +void WriteVariableWidthInternal(BitWriterInterface* writer, uint64_t val, + size_t chunk_length, size_t max_payload) { + assert(chunk_length > 0); + assert(chunk_length < max_payload); + assert(max_payload == 64 || (val >> max_payload) == 0); + + if (val == 0) { + // Split in two writes for more readable logging. + writer->WriteBits(0, chunk_length); + writer->WriteBits(0, 1); + return; + } + + size_t payload_written = 0; + + while (val) { + if (payload_written + chunk_length >= max_payload) { + // This has to be the last chunk. + // There is no need for the signal bit and the chunk can be truncated. + const size_t left_to_write = max_payload - payload_written; + assert((val >> left_to_write) == 0); + writer->WriteBits(val, left_to_write); + break; + } + + writer->WriteBits(val, chunk_length); + payload_written += chunk_length; + val = val >> chunk_length; + + // Write a single bit to signal if there is more to come. + writer->WriteBits(val ? 1 : 0, 1); + } +} + +// Reads data written with WriteVariableWidthInternal. |chunk_length| and +// |max_payload| should be identical to those used to write the data. +// Returns false if the stream ends prematurely. +bool ReadVariableWidthInternal(BitReaderInterface* reader, uint64_t* val, + size_t chunk_length, size_t max_payload) { + assert(chunk_length > 0); + assert(chunk_length <= max_payload); + size_t payload_read = 0; + + while (payload_read + chunk_length < max_payload) { + uint64_t bits = 0; + if (reader->ReadBits(&bits, chunk_length) != chunk_length) return false; + + *val |= bits << payload_read; + payload_read += chunk_length; + + uint64_t more_to_come = 0; + if (reader->ReadBits(&more_to_come, 1) != 1) return false; + + if (!more_to_come) { + return true; + } + } + + // Need to read the last chunk which may be truncated. No signal bit follows. + uint64_t bits = 0; + const size_t left_to_read = max_payload - payload_read; + if (reader->ReadBits(&bits, left_to_read) != left_to_read) return false; + + *val |= bits << payload_read; + return true; +} + +// Calls WriteVariableWidthInternal with the right max_payload argument. +template +void WriteVariableWidthUnsigned(BitWriterInterface* writer, T val, + size_t chunk_length) { + static_assert(std::is_unsigned::value, "Type must be unsigned"); + static_assert(std::is_integral::value, "Type must be integral"); + WriteVariableWidthInternal(writer, val, chunk_length, sizeof(T) * 8); +} + +// Calls ReadVariableWidthInternal with the right max_payload argument. +template +bool ReadVariableWidthUnsigned(BitReaderInterface* reader, T* val, + size_t chunk_length) { + static_assert(std::is_unsigned::value, "Type must be unsigned"); + static_assert(std::is_integral::value, "Type must be integral"); + uint64_t val64 = 0; + if (!ReadVariableWidthInternal(reader, &val64, chunk_length, sizeof(T) * 8)) + return false; + *val = static_cast(val64); + assert(*val == val64); + return true; +} + +// Encodes signed |val| to an unsigned value and calls +// WriteVariableWidthInternal with the right max_payload argument. +template +void WriteVariableWidthSigned(BitWriterInterface* writer, T val, + size_t chunk_length, size_t zigzag_exponent) { + static_assert(std::is_signed::value, "Type must be signed"); + static_assert(std::is_integral::value, "Type must be integral"); + WriteVariableWidthInternal(writer, EncodeZigZag(val, zigzag_exponent), + chunk_length, sizeof(T) * 8); +} + +// Calls ReadVariableWidthInternal with the right max_payload argument +// and decodes the value. +template +bool ReadVariableWidthSigned(BitReaderInterface* reader, T* val, + size_t chunk_length, size_t zigzag_exponent) { + static_assert(std::is_signed::value, "Type must be signed"); + static_assert(std::is_integral::value, "Type must be integral"); + uint64_t encoded = 0; + if (!ReadVariableWidthInternal(reader, &encoded, chunk_length, sizeof(T) * 8)) + return false; + + const int64_t decoded = DecodeZigZag(encoded, zigzag_exponent); + + *val = static_cast(decoded); + assert(*val == decoded); + return true; +} + +} // namespace + +size_t Log2U64(uint64_t val) { + size_t res = 0; + + if (val & 0xFFFFFFFF00000000) { + val >>= 32; + res |= 32; + } + + if (val & 0xFFFF0000) { + val >>= 16; + res |= 16; + } + + if (val & 0xFF00) { + val >>= 8; + res |= 8; + } + + if (val & 0xF0) { + val >>= 4; + res |= 4; + } + + if (val & 0xC) { + val >>= 2; + res |= 2; + } + + if (val & 0x2) { + res |= 1; + } + + return res; +} + +void BitWriterInterface::WriteVariableWidthU64(uint64_t val, + size_t chunk_length) { + WriteVariableWidthUnsigned(this, val, chunk_length); +} + +void BitWriterInterface::WriteVariableWidthU32(uint32_t val, + size_t chunk_length) { + WriteVariableWidthUnsigned(this, val, chunk_length); +} + +void BitWriterInterface::WriteVariableWidthU16(uint16_t val, + size_t chunk_length) { + WriteVariableWidthUnsigned(this, val, chunk_length); +} + +void BitWriterInterface::WriteVariableWidthU8(uint8_t val, + size_t chunk_length) { + WriteVariableWidthUnsigned(this, val, chunk_length); +} + +void BitWriterInterface::WriteVariableWidthS64(int64_t val, size_t chunk_length, + size_t zigzag_exponent) { + WriteVariableWidthSigned(this, val, chunk_length, zigzag_exponent); +} + +void BitWriterInterface::WriteVariableWidthS32(int32_t val, size_t chunk_length, + size_t zigzag_exponent) { + WriteVariableWidthSigned(this, val, chunk_length, zigzag_exponent); +} + +void BitWriterInterface::WriteVariableWidthS16(int16_t val, size_t chunk_length, + size_t zigzag_exponent) { + WriteVariableWidthSigned(this, val, chunk_length, zigzag_exponent); +} + +void BitWriterInterface::WriteVariableWidthS8(int8_t val, size_t chunk_length, + size_t zigzag_exponent) { + WriteVariableWidthSigned(this, val, chunk_length, zigzag_exponent); +} + +void BitWriterInterface::WriteFixedWidth(uint64_t val, uint64_t max_val) { + if (val > max_val) { + assert(0 && "WriteFixedWidth: value too wide"); + return; + } + + const size_t num_bits = 1 + Log2U64(max_val); + WriteBits(val, num_bits); +} + +BitWriterWord64::BitWriterWord64(size_t reserve_bits) : end_(0) { + buffer_.reserve(NumBitsToNumWords<64>(reserve_bits)); +} + +void BitWriterWord64::WriteBits(uint64_t bits, size_t num_bits) { + // Check that |bits| and |num_bits| are valid and consistent. + assert(num_bits <= 64); + const bool is_little_endian = IsLittleEndian(); + assert(is_little_endian && "Big-endian architecture support not implemented"); + if (!is_little_endian) return; + + if (num_bits == 0) return; + + bits = GetLowerBits(bits, num_bits); + + EmitSequence(bits, num_bits); + + // Offset from the start of the current word. + const size_t offset = end_ % 64; + + if (offset == 0) { + // If no offset, simply add |bits| as a new word to the buffer_. + buffer_.push_back(bits); + } else { + // Shift bits and add them to the current word after offset. + const uint64_t first_word = bits << offset; + buffer_.back() |= first_word; + + // If we don't overflow to the next word, there is nothing more to do. + + if (offset + num_bits > 64) { + // We overflow to the next word. + const uint64_t second_word = bits >> (64 - offset); + // Add remaining bits as a new word to buffer_. + buffer_.push_back(second_word); + } + } + + // Move end_ into position for next write. + end_ += num_bits; + assert(buffer_.size() * 64 >= end_); +} + +bool BitReaderInterface::ReadVariableWidthU64(uint64_t* val, + size_t chunk_length) { + return ReadVariableWidthUnsigned(this, val, chunk_length); +} + +bool BitReaderInterface::ReadVariableWidthU32(uint32_t* val, + size_t chunk_length) { + return ReadVariableWidthUnsigned(this, val, chunk_length); +} + +bool BitReaderInterface::ReadVariableWidthU16(uint16_t* val, + size_t chunk_length) { + return ReadVariableWidthUnsigned(this, val, chunk_length); +} + +bool BitReaderInterface::ReadVariableWidthU8(uint8_t* val, + size_t chunk_length) { + return ReadVariableWidthUnsigned(this, val, chunk_length); +} + +bool BitReaderInterface::ReadVariableWidthS64(int64_t* val, size_t chunk_length, + size_t zigzag_exponent) { + return ReadVariableWidthSigned(this, val, chunk_length, zigzag_exponent); +} + +bool BitReaderInterface::ReadVariableWidthS32(int32_t* val, size_t chunk_length, + size_t zigzag_exponent) { + return ReadVariableWidthSigned(this, val, chunk_length, zigzag_exponent); +} + +bool BitReaderInterface::ReadVariableWidthS16(int16_t* val, size_t chunk_length, + size_t zigzag_exponent) { + return ReadVariableWidthSigned(this, val, chunk_length, zigzag_exponent); +} + +bool BitReaderInterface::ReadVariableWidthS8(int8_t* val, size_t chunk_length, + size_t zigzag_exponent) { + return ReadVariableWidthSigned(this, val, chunk_length, zigzag_exponent); +} + +bool BitReaderInterface::ReadFixedWidth(uint64_t* val, uint64_t max_val) { + const size_t num_bits = 1 + Log2U64(max_val); + return ReadBits(val, num_bits) == num_bits; +} + +BitReaderWord64::BitReaderWord64(std::vector&& buffer) + : buffer_(std::move(buffer)), pos_(0) {} + +BitReaderWord64::BitReaderWord64(const std::vector& buffer) + : buffer_(ToBuffer64(buffer)), pos_(0) {} + +BitReaderWord64::BitReaderWord64(const void* buffer, size_t num_bytes) + : buffer_(ToBuffer64(buffer, num_bytes)), pos_(0) {} + +size_t BitReaderWord64::ReadBits(uint64_t* bits, size_t num_bits) { + assert(num_bits <= 64); + const bool is_little_endian = IsLittleEndian(); + assert(is_little_endian && "Big-endian architecture support not implemented"); + if (!is_little_endian) return 0; + + if (ReachedEnd()) return 0; + + // Index of the current word. + const size_t index = pos_ / 64; + + // Bit position in the current word where we start reading. + const size_t offset = pos_ % 64; + + // Read all bits from the current word (it might be too much, but + // excessive bits will be removed later). + *bits = buffer_[index] >> offset; + + const size_t num_read_from_first_word = std::min(64 - offset, num_bits); + pos_ += num_read_from_first_word; + + if (pos_ >= buffer_.size() * 64) { + // Reached end of buffer_. + EmitSequence(*bits, num_read_from_first_word); + return num_read_from_first_word; + } + + if (offset + num_bits > 64) { + // Requested |num_bits| overflows to next word. + // Write all bits from the beginning of next word to *bits after offset. + *bits |= buffer_[index + 1] << (64 - offset); + pos_ += offset + num_bits - 64; + } + + // We likely have written more bits than requested. Clear excessive bits. + *bits = GetLowerBits(*bits, num_bits); + EmitSequence(*bits, num_bits); + return num_bits; +} + +bool BitReaderWord64::ReachedEnd() const { return pos_ >= buffer_.size() * 64; } + +bool BitReaderWord64::OnlyZeroesLeft() const { + if (ReachedEnd()) return true; + + const size_t index = pos_ / 64; + if (index < buffer_.size() - 1) return false; + + assert(index == buffer_.size() - 1); + + const size_t offset = pos_ % 64; + const uint64_t remaining_bits = buffer_[index] >> offset; + return !remaining_bits; +} + +} // namespace spvutils diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/bit_stream.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/bit_stream.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/bit_stream.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/bit_stream.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,447 @@ +// Copyright (c) 2017 Google 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. + +// Contains utils for reading, writing and debug printing bit streams. + +#ifndef LIBSPIRV_UTIL_BIT_STREAM_H_ +#define LIBSPIRV_UTIL_BIT_STREAM_H_ + +#include +#include +#include +#include +#include +#include +#include + +namespace spvutils { + +// Returns rounded down log2(val). log2(0) is considered 0. +size_t Log2U64(uint64_t val); + +// Terminology: +// Bits - usually used for a uint64 word, first bit is the lowest. +// Stream - std::string of '0' and '1', read left-to-right, +// i.e. first bit is at the front and not at the end as in +// std::bitset::to_string(). +// Bitset - std::bitset corresponding to uint64 bits and to reverse(stream). + +// Converts number of bits to a respective number of chunks of size N. +// For example NumBitsToNumWords<8> returns how many bytes are needed to store +// |num_bits|. +template +inline size_t NumBitsToNumWords(size_t num_bits) { + return (num_bits + (N - 1)) / N; +} + +// Returns value of the same type as |in|, where all but the first |num_bits| +// are set to zero. +template +inline T GetLowerBits(T in, size_t num_bits) { + return sizeof(T) * 8 == num_bits ? in : in & T((T(1) << num_bits) - T(1)); +} + +// Encodes signed integer as unsigned in zigzag order: +// 0 -> 0 +// -1 -> 1 +// 1 -> 2 +// -2 -> 3 +// 2 -> 4 +// Motivation: -1 is 0xFF...FF what doesn't work very well with +// WriteVariableWidth which prefers to have as many 0 bits as possible. +inline uint64_t EncodeZigZag(int64_t val) { return (val << 1) ^ (val >> 63); } + +// Decodes signed integer encoded with EncodeZigZag. +inline int64_t DecodeZigZag(uint64_t val) { + if (val & 1) { + // Negative. + // 1 -> -1 + // 3 -> -2 + // 5 -> -3 + return -1 - (val >> 1); + } else { + // Non-negative. + // 0 -> 0 + // 2 -> 1 + // 4 -> 2 + return val >> 1; + } +} + +// Encodes signed integer as unsigned. This is a generalized version of +// EncodeZigZag, designed to favor small positive numbers. +// Values are transformed in blocks of 2^|block_exponent|. +// If |block_exponent| is zero, then this degenerates into normal EncodeZigZag. +// Example when |block_exponent| is 1 (return value is the index): +// 0, 1, -1, -2, 2, 3, -3, -4, 4, 5, -5, -6, 6, 7, -7, -8 +// Example when |block_exponent| is 2: +// 0, 1, 2, 3, -1, -2, -3, -4, 4, 5, 6, 7, -5, -6, -7, -8 +inline uint64_t EncodeZigZag(int64_t val, size_t block_exponent) { + assert(block_exponent < 64); + const uint64_t uval = static_cast(val >= 0 ? val : -val - 1); + const uint64_t block_num = + ((uval >> block_exponent) << 1) + (val >= 0 ? 0 : 1); + const uint64_t pos = GetLowerBits(uval, block_exponent); + return (block_num << block_exponent) + pos; +} + +// Decodes signed integer encoded with EncodeZigZag. |block_exponent| must be +// the same. +inline int64_t DecodeZigZag(uint64_t val, size_t block_exponent) { + assert(block_exponent < 64); + const uint64_t block_num = val >> block_exponent; + const uint64_t pos = GetLowerBits(val, block_exponent); + if (block_num & 1) { + // Negative. + return -1LL - ((block_num >> 1) << block_exponent) - pos; + } else { + // Positive. + return ((block_num >> 1) << block_exponent) + pos; + } +} + +// Converts |buffer| to a stream of '0' and '1'. +template +std::string BufferToStream(const std::vector& buffer) { + std::stringstream ss; + for (auto it = buffer.begin(); it != buffer.end(); ++it) { + std::string str = std::bitset(*it).to_string(); + // Strings generated by std::bitset::to_string are read right to left. + // Reversing to left to right. + std::reverse(str.begin(), str.end()); + ss << str; + } + return ss.str(); +} + +// Converts a left-to-right input string of '0' and '1' to a buffer of |T| +// words. +template +std::vector StreamToBuffer(std::string str) { + // The input string is left-to-right, the input argument of std::bitset needs + // to right-to-left. Instead of reversing tokens, reverse the entire string + // and iterate tokens from end to begin. + std::reverse(str.begin(), str.end()); + const int word_size = static_cast(sizeof(T) * 8); + const int str_length = static_cast(str.length()); + std::vector buffer; + buffer.reserve(NumBitsToNumWords(str.length())); + for (int index = str_length - word_size; index >= 0; index -= word_size) { + buffer.push_back(static_cast( + std::bitset(str, index, word_size).to_ullong())); + } + const size_t suffix_length = str.length() % word_size; + if (suffix_length != 0) { + buffer.push_back(static_cast( + std::bitset(str, 0, suffix_length).to_ullong())); + } + return buffer; +} + +// Adds '0' chars at the end of the string until the size is a multiple of N. +template +inline std::string PadToWord(std::string&& str) { + const size_t tail_length = str.size() % N; + if (tail_length != 0) str += std::string(N - tail_length, '0'); + return str; +} + +// Adds '0' chars at the end of the string until the size is a multiple of N. +template +inline std::string PadToWord(const std::string& str) { + return PadToWord(std::string(str)); +} + +// Converts a left-to-right stream of bits to std::bitset. +template +inline std::bitset StreamToBitset(std::string str) { + std::reverse(str.begin(), str.end()); + return std::bitset(str); +} + +// Converts first |num_bits| of std::bitset to a left-to-right stream of bits. +template +inline std::string BitsetToStream(const std::bitset& bits, + size_t num_bits = N) { + std::string str = bits.to_string().substr(N - num_bits); + std::reverse(str.begin(), str.end()); + return str; +} + +// Converts a left-to-right stream of bits to uint64. +inline uint64_t StreamToBits(std::string str) { + std::reverse(str.begin(), str.end()); + return std::bitset<64>(str).to_ullong(); +} + +// Converts first |num_bits| stored in uint64 to a left-to-right stream of bits. +inline std::string BitsToStream(uint64_t bits, size_t num_bits = 64) { + std::bitset<64> bitset(bits); + return BitsetToStream(bitset, num_bits); +} + +// Base class for writing sequences of bits. +class BitWriterInterface { + public: + BitWriterInterface() {} + virtual ~BitWriterInterface() {} + + // Writes lower |num_bits| in |bits| to the stream. + // |num_bits| must be no greater than 64. + virtual void WriteBits(uint64_t bits, size_t num_bits) = 0; + + // Writes left-to-right string of '0' and '1' to stream. + // String length must be no greater than 64. + // Note: "01" will be writen as 0x2, not 0x1. The string doesn't represent + // numbers but a stream of bits in the order they come from encoder. + virtual void WriteStream(const std::string& bits) { + WriteBits(StreamToBits(bits), bits.length()); + } + + // Writes lower |num_bits| in |bits| to the stream. + // |num_bits| must be no greater than 64. + template + void WriteBitset(const std::bitset& bits, size_t num_bits = N) { + WriteBits(bits.to_ullong(), num_bits); + } + + // Writes bits from value of type |T| to the stream. No encoding is done. + // Always writes 8 * sizeof(T) bits. + template + void WriteUnencoded(T val) { + static_assert(sizeof(T) <= 64, "Type size too large"); + uint64_t bits = 0; + memcpy(&bits, &val, sizeof(T)); + WriteBits(bits, sizeof(T) * 8); + } + + // Writes |val| in chunks of size |chunk_length| followed by a signal bit: + // 0 - no more chunks to follow + // 1 - more chunks to follow + // for example 255 is encoded into 1111 1 1111 0 for chunk length 4. + // The last chunk can be truncated and signal bit omitted, if the entire + // payload (for example 16 bit for uint16_t has already been written). + void WriteVariableWidthU64(uint64_t val, size_t chunk_length); + void WriteVariableWidthU32(uint32_t val, size_t chunk_length); + void WriteVariableWidthU16(uint16_t val, size_t chunk_length); + void WriteVariableWidthU8(uint8_t val, size_t chunk_length); + void WriteVariableWidthS64(int64_t val, size_t chunk_length, + size_t zigzag_exponent); + void WriteVariableWidthS32(int32_t val, size_t chunk_length, + size_t zigzag_exponent); + void WriteVariableWidthS16(int16_t val, size_t chunk_length, + size_t zigzag_exponent); + void WriteVariableWidthS8(int8_t val, size_t chunk_length, + size_t zigzag_exponent); + + // Writes |val| using fixed bit width. Bit width is determined by |max_val|: + // max_val 0 -> bit width 1 + // max_val 1 -> bit width 1 + // max_val 2 -> bit width 2 + // max_val 3 -> bit width 2 + // max_val 4 -> bit width 3 + // max_val 5 -> bit width 3 + // max_val 8 -> bit width 4 + // max_val n -> bit width 1 + floor(log2(n)) + // |val| needs to be <= |max_val|. + void WriteFixedWidth(uint64_t val, uint64_t max_val); + + // Returns number of bits written. + virtual size_t GetNumBits() const = 0; + + // Provides direct access to the buffer data if implemented. + virtual const uint8_t* GetData() const { return nullptr; } + + // Returns buffer size in bytes. + size_t GetDataSizeBytes() const { return NumBitsToNumWords<8>(GetNumBits()); } + + // Generates and returns byte array containing written bits. + virtual std::vector GetDataCopy() const = 0; + + BitWriterInterface(const BitWriterInterface&) = delete; + BitWriterInterface& operator=(const BitWriterInterface&) = delete; +}; + +// This class is an implementation of BitWriterInterface, using +// std::vector to store written bits. +class BitWriterWord64 : public BitWriterInterface { + public: + explicit BitWriterWord64(size_t reserve_bits = 64); + + void WriteBits(uint64_t bits, size_t num_bits) override; + + size_t GetNumBits() const override { return end_; } + + const uint8_t* GetData() const override { + return reinterpret_cast(buffer_.data()); + } + + std::vector GetDataCopy() const override { + return std::vector(GetData(), GetData() + GetDataSizeBytes()); + } + + // Returns written stream as std::string, padded with zeroes so that the + // length is a multiple of 64. + std::string GetStreamPadded64() const { return BufferToStream(buffer_); } + + // Sets callback to emit bit sequences after every write. + void SetCallback(std::function callback) { + callback_ = callback; + } + + protected: + // Sends string generated from arguments to callback_ if defined. + void EmitSequence(uint64_t bits, size_t num_bits) const { + if (callback_) callback_(BitsToStream(bits, num_bits)); + } + + private: + std::vector buffer_; + // Total number of bits written so far. Named 'end' as analogy to std::end(). + size_t end_; + + // If not null, the writer will use the callback to emit the written bit + // sequence as a string of '0' and '1'. + std::function callback_; +}; + +// Base class for reading sequences of bits. +class BitReaderInterface { + public: + BitReaderInterface() {} + virtual ~BitReaderInterface() {} + + // Reads |num_bits| from the stream, stores them in |bits|. + // Returns number of read bits. |num_bits| must be no greater than 64. + virtual size_t ReadBits(uint64_t* bits, size_t num_bits) = 0; + + // Reads |num_bits| from the stream, stores them in |bits|. + // Returns number of read bits. |num_bits| must be no greater than 64. + template + size_t ReadBitset(std::bitset* bits, size_t num_bits = N) { + uint64_t val = 0; + size_t num_read = ReadBits(&val, num_bits); + if (num_read) { + *bits = std::bitset(val); + } + return num_read; + } + + // Reads |num_bits| from the stream, returns string in left-to-right order. + // The length of the returned string may be less than |num_bits| if end was + // reached. + std::string ReadStream(size_t num_bits) { + uint64_t bits = 0; + size_t num_read = ReadBits(&bits, num_bits); + return BitsToStream(bits, num_read); + } + + // Reads 8 * sizeof(T) bits and stores them in |val|. + template + bool ReadUnencoded(T* val) { + static_assert(sizeof(T) <= 64, "Type size too large"); + uint64_t bits = 0; + const size_t num_read = ReadBits(&bits, sizeof(T) * 8); + if (num_read != sizeof(T) * 8) return false; + memcpy(val, &bits, sizeof(T)); + return true; + } + + // Returns number of bits already read. + virtual size_t GetNumReadBits() const = 0; + + // These two functions define 'hard' and 'soft' EOF. + // + // Returns true if the end of the buffer was reached. + virtual bool ReachedEnd() const = 0; + // Returns true if we reached the end of the buffer or are nearing it and only + // zero bits are left to read. Implementations of this function are allowed to + // commit a "false negative" error if the end of the buffer was not reached, + // i.e. it can return false even if indeed only zeroes are left. + // It is assumed that the consumer expects that + // the buffer stream ends with padding zeroes, and would accept this as a + // 'soft' EOF. Implementations of this class do not necessarily need to + // implement this, default behavior can simply delegate to ReachedEnd(). + virtual bool OnlyZeroesLeft() const { return ReachedEnd(); } + + // Reads value encoded with WriteVariableWidthXXX (see BitWriterInterface). + // Reader and writer must use the same |chunk_length| and variable type. + // Returns true on success, false if the bit stream ends prematurely. + bool ReadVariableWidthU64(uint64_t* val, size_t chunk_length); + bool ReadVariableWidthU32(uint32_t* val, size_t chunk_length); + bool ReadVariableWidthU16(uint16_t* val, size_t chunk_length); + bool ReadVariableWidthU8(uint8_t* val, size_t chunk_length); + bool ReadVariableWidthS64(int64_t* val, size_t chunk_length, + size_t zigzag_exponent); + bool ReadVariableWidthS32(int32_t* val, size_t chunk_length, + size_t zigzag_exponent); + bool ReadVariableWidthS16(int16_t* val, size_t chunk_length, + size_t zigzag_exponent); + bool ReadVariableWidthS8(int8_t* val, size_t chunk_length, + size_t zigzag_exponent); + + // Reads value written by WriteFixedWidth (|max_val| needs to be the same). + // Returns true on success, false if the bit stream ends prematurely. + bool ReadFixedWidth(uint64_t* val, uint64_t max_val); + + BitReaderInterface(const BitReaderInterface&) = delete; + BitReaderInterface& operator=(const BitReaderInterface&) = delete; +}; + +// This class is an implementation of BitReaderInterface which accepts both +// uint8_t and uint64_t buffers as input. uint64_t buffers are consumed and +// owned. uint8_t buffers are copied. +class BitReaderWord64 : public BitReaderInterface { + public: + // Consumes and owns the buffer. + explicit BitReaderWord64(std::vector&& buffer); + + // Copies the buffer and casts it to uint64. + // Consuming the original buffer and casting it to uint64 is difficult, + // as it would potentially cause data misalignment and poor performance. + explicit BitReaderWord64(const std::vector& buffer); + BitReaderWord64(const void* buffer, size_t num_bytes); + + size_t ReadBits(uint64_t* bits, size_t num_bits) override; + + size_t GetNumReadBits() const override { return pos_; } + + bool ReachedEnd() const override; + bool OnlyZeroesLeft() const override; + + BitReaderWord64() = delete; + + // Sets callback to emit bit sequences after every read. + void SetCallback(std::function callback) { + callback_ = callback; + } + + protected: + // Sends string generated from arguments to callback_ if defined. + void EmitSequence(uint64_t bits, size_t num_bits) const { + if (callback_) callback_(BitsToStream(bits, num_bits)); + } + + private: + const std::vector buffer_; + size_t pos_; + + // If not null, the reader will use the callback to emit the read bit + // sequence as a string of '0' and '1'. + std::function callback_; +}; + +} // namespace spvutils + +#endif // LIBSPIRV_UTIL_BIT_STREAM_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/bitutils.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/bitutils.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/bitutils.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/bitutils.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,94 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_UTIL_BITUTILS_H_ +#define LIBSPIRV_UTIL_BITUTILS_H_ + +#include +#include + +namespace spvutils { + +// Performs a bitwise copy of source to the destination type Dest. +template +Dest BitwiseCast(Src source) { + Dest dest; + static_assert(sizeof(source) == sizeof(dest), + "BitwiseCast: Source and destination must have the same size"); + std::memcpy(&dest, &source, sizeof(dest)); + return dest; +} + +// SetBits returns an integer of type with bits set +// for position through , counting from the least +// significant bit. In particular when Num == 0, no positions are set to 1. +// A static assert will be triggered if First + Num > sizeof(T) * 8, that is, +// a bit that will not fit in the underlying type is set. +template +struct SetBits { + static_assert(First < sizeof(T) * 8, + "Tried to set a bit that is shifted too far."); + const static T get = (T(1) << First) | SetBits::get; +}; + +template +struct SetBits { + const static T get = T(0); +}; + +// This is all compile-time so we can put our tests right here. +static_assert(SetBits::get == uint32_t(0x00000000), + "SetBits failed"); +static_assert(SetBits::get == uint32_t(0x00000001), + "SetBits failed"); +static_assert(SetBits::get == uint32_t(0x80000000), + "SetBits failed"); +static_assert(SetBits::get == uint32_t(0x00000006), + "SetBits failed"); +static_assert(SetBits::get == uint32_t(0xc0000000), + "SetBits failed"); +static_assert(SetBits::get == uint32_t(0x7FFFFFFF), + "SetBits failed"); +static_assert(SetBits::get == uint32_t(0xFFFFFFFF), + "SetBits failed"); +static_assert(SetBits::get == uint32_t(0xFFFF0000), + "SetBits failed"); + +static_assert(SetBits::get == uint64_t(0x0000000000000001LL), + "SetBits failed"); +static_assert(SetBits::get == uint64_t(0x8000000000000000LL), + "SetBits failed"); +static_assert(SetBits::get == uint64_t(0xc000000000000000LL), + "SetBits failed"); +static_assert(SetBits::get == uint64_t(0x0000000080000000LL), + "SetBits failed"); +static_assert(SetBits::get == uint64_t(0x00000000FFFF0000LL), + "SetBits failed"); + +// Returns number of '1' bits in a word. +template +size_t CountSetBits(T word) { + static_assert(std::is_integral::value, + "CountSetBits requires integer type"); + size_t count = 0; + while (word) { + word &= word - 1; + ++count; + } + return count; +} + +} // namespace spvutils + +#endif // LIBSPIRV_UTIL_BITUTILS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/hex_float.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/hex_float.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/hex_float.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/hex_float.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1148 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_UTIL_HEX_FLOAT_H_ +#define LIBSPIRV_UTIL_HEX_FLOAT_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bitutils.h" + +#ifndef __GNUC__ +#define GCC_VERSION 0 +#else +#define GCC_VERSION \ + (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +#endif + +namespace spvutils { + +class Float16 { + public: + Float16(uint16_t v) : val(v) {} + Float16() = default; + static bool isNan(const Float16& val) { + return ((val.val & 0x7C00) == 0x7C00) && ((val.val & 0x3FF) != 0); + } + // Returns true if the given value is any kind of infinity. + static bool isInfinity(const Float16& val) { + return ((val.val & 0x7C00) == 0x7C00) && ((val.val & 0x3FF) == 0); + } + Float16(const Float16& other) { val = other.val; } + uint16_t get_value() const { return val; } + + // Returns the maximum normal value. + static Float16 max() { return Float16(0x7bff); } + // Returns the lowest normal value. + static Float16 lowest() { return Float16(0xfbff); } + + private: + uint16_t val; +}; + +// To specialize this type, you must override uint_type to define +// an unsigned integer that can fit your floating point type. +// You must also add a isNan function that returns true if +// a value is Nan. +template +struct FloatProxyTraits { + using uint_type = void; +}; + +template <> +struct FloatProxyTraits { + using uint_type = uint32_t; + static bool isNan(float f) { return std::isnan(f); } + // Returns true if the given value is any kind of infinity. + static bool isInfinity(float f) { return std::isinf(f); } + // Returns the maximum normal value. + static float max() { return std::numeric_limits::max(); } + // Returns the lowest normal value. + static float lowest() { return std::numeric_limits::lowest(); } + // Returns the value as the native floating point format. + static float getAsFloat(const uint_type& t) { return BitwiseCast(t); } + // Returns the bits from the given floating pointer number. + static uint_type getBitsFromFloat(const float& t) { + return BitwiseCast(t); + } + // Returns the bitwidth. + static uint32_t width() { return 32u; } +}; + +template <> +struct FloatProxyTraits { + using uint_type = uint64_t; + static bool isNan(double f) { return std::isnan(f); } + // Returns true if the given value is any kind of infinity. + static bool isInfinity(double f) { return std::isinf(f); } + // Returns the maximum normal value. + static double max() { return std::numeric_limits::max(); } + // Returns the lowest normal value. + static double lowest() { return std::numeric_limits::lowest(); } + // Returns the value as the native floating point format. + static double getAsFloat(const uint_type& t) { + return BitwiseCast(t); + } + // Returns the bits from the given floating pointer number. + static uint_type getBitsFromFloat(const double& t) { + return BitwiseCast(t); + } + // Returns the bitwidth. + static uint32_t width() { return 64u; } +}; + +template <> +struct FloatProxyTraits { + using uint_type = uint16_t; + static bool isNan(Float16 f) { return Float16::isNan(f); } + // Returns true if the given value is any kind of infinity. + static bool isInfinity(Float16 f) { return Float16::isInfinity(f); } + // Returns the maximum normal value. + static Float16 max() { return Float16::max(); } + // Returns the lowest normal value. + static Float16 lowest() { return Float16::lowest(); } + // Returns the value as the native floating point format. + static Float16 getAsFloat(const uint_type& t) { return Float16(t); } + // Returns the bits from the given floating pointer number. + static uint_type getBitsFromFloat(const Float16& t) { return t.get_value(); } + // Returns the bitwidth. + static uint32_t width() { return 16u; } +}; + +// Since copying a floating point number (especially if it is NaN) +// does not guarantee that bits are preserved, this class lets us +// store the type and use it as a float when necessary. +template +class FloatProxy { + public: + using uint_type = typename FloatProxyTraits::uint_type; + + // Since this is to act similar to the normal floats, + // do not initialize the data by default. + FloatProxy() = default; + + // Intentionally non-explicit. This is a proxy type so + // implicit conversions allow us to use it more transparently. + FloatProxy(T val) { data_ = FloatProxyTraits::getBitsFromFloat(val); } + + // Intentionally non-explicit. This is a proxy type so + // implicit conversions allow us to use it more transparently. + FloatProxy(uint_type val) { data_ = val; } + + // This is helpful to have and is guaranteed not to stomp bits. + FloatProxy operator-() const { + return static_cast(data_ ^ + (uint_type(0x1) << (sizeof(T) * 8 - 1))); + } + + // Returns the data as a floating point value. + T getAsFloat() const { return FloatProxyTraits::getAsFloat(data_); } + + // Returns the raw data. + uint_type data() const { return data_; } + + // Returns a vector of words suitable for use in an Operand. + std::vector GetWords() const { + std::vector words; + if (FloatProxyTraits::width() == 64) { + FloatProxyTraits::uint_type d = data(); + words.push_back(static_cast(d)); + words.push_back(static_cast(d >> 32)); + } else { + words.push_back(static_cast(data())); + } + return words; + } + + // Returns true if the value represents any type of NaN. + bool isNan() { return FloatProxyTraits::isNan(getAsFloat()); } + // Returns true if the value represents any type of infinity. + bool isInfinity() { return FloatProxyTraits::isInfinity(getAsFloat()); } + + // Returns the maximum normal value. + static FloatProxy max() { + return FloatProxy(FloatProxyTraits::max()); + } + // Returns the lowest normal value. + static FloatProxy lowest() { + return FloatProxy(FloatProxyTraits::lowest()); + } + + private: + uint_type data_; +}; + +template +bool operator==(const FloatProxy& first, const FloatProxy& second) { + return first.data() == second.data(); +} + +// Reads a FloatProxy value as a normal float from a stream. +template +std::istream& operator>>(std::istream& is, FloatProxy& value) { + T float_val; + is >> float_val; + value = FloatProxy(float_val); + return is; +} + +// This is an example traits. It is not meant to be used in practice, but will +// be the default for any non-specialized type. +template +struct HexFloatTraits { + // Integer type that can store this hex-float. + using uint_type = void; + // Signed integer type that can store this hex-float. + using int_type = void; + // The numerical type that this HexFloat represents. + using underlying_type = void; + // The type needed to construct the underlying type. + using native_type = void; + // The number of bits that are actually relevant in the uint_type. + // This allows us to deal with, for example, 24-bit values in a 32-bit + // integer. + static const uint32_t num_used_bits = 0; + // Number of bits that represent the exponent. + static const uint32_t num_exponent_bits = 0; + // Number of bits that represent the fractional part. + static const uint32_t num_fraction_bits = 0; + // The bias of the exponent. (How much we need to subtract from the stored + // value to get the correct value.) + static const uint32_t exponent_bias = 0; +}; + +// Traits for IEEE float. +// 1 sign bit, 8 exponent bits, 23 fractional bits. +template <> +struct HexFloatTraits> { + using uint_type = uint32_t; + using int_type = int32_t; + using underlying_type = FloatProxy; + using native_type = float; + static const uint_type num_used_bits = 32; + static const uint_type num_exponent_bits = 8; + static const uint_type num_fraction_bits = 23; + static const uint_type exponent_bias = 127; +}; + +// Traits for IEEE double. +// 1 sign bit, 11 exponent bits, 52 fractional bits. +template <> +struct HexFloatTraits> { + using uint_type = uint64_t; + using int_type = int64_t; + using underlying_type = FloatProxy; + using native_type = double; + static const uint_type num_used_bits = 64; + static const uint_type num_exponent_bits = 11; + static const uint_type num_fraction_bits = 52; + static const uint_type exponent_bias = 1023; +}; + +// Traits for IEEE half. +// 1 sign bit, 5 exponent bits, 10 fractional bits. +template <> +struct HexFloatTraits> { + using uint_type = uint16_t; + using int_type = int16_t; + using underlying_type = uint16_t; + using native_type = uint16_t; + static const uint_type num_used_bits = 16; + static const uint_type num_exponent_bits = 5; + static const uint_type num_fraction_bits = 10; + static const uint_type exponent_bias = 15; +}; + +enum class round_direction { + kToZero, + kToNearestEven, + kToPositiveInfinity, + kToNegativeInfinity, + max = kToNegativeInfinity +}; + +// Template class that houses a floating pointer number. +// It exposes a number of constants based on the provided traits to +// assist in interpreting the bits of the value. +template > +class HexFloat { + public: + using uint_type = typename Traits::uint_type; + using int_type = typename Traits::int_type; + using underlying_type = typename Traits::underlying_type; + using native_type = typename Traits::native_type; + + explicit HexFloat(T f) : value_(f) {} + + T value() const { return value_; } + void set_value(T f) { value_ = f; } + + // These are all written like this because it is convenient to have + // compile-time constants for all of these values. + + // Pass-through values to save typing. + static const uint32_t num_used_bits = Traits::num_used_bits; + static const uint32_t exponent_bias = Traits::exponent_bias; + static const uint32_t num_exponent_bits = Traits::num_exponent_bits; + static const uint32_t num_fraction_bits = Traits::num_fraction_bits; + + // Number of bits to shift left to set the highest relevant bit. + static const uint32_t top_bit_left_shift = num_used_bits - 1; + // How many nibbles (hex characters) the fractional part takes up. + static const uint32_t fraction_nibbles = (num_fraction_bits + 3) / 4; + // If the fractional part does not fit evenly into a hex character (4-bits) + // then we have to left-shift to get rid of leading 0s. This is the amount + // we have to shift (might be 0). + static const uint32_t num_overflow_bits = + fraction_nibbles * 4 - num_fraction_bits; + + // The representation of the fraction, not the actual bits. This + // includes the leading bit that is usually implicit. + static const uint_type fraction_represent_mask = + spvutils::SetBits::get; + + // The topmost bit in the nibble-aligned fraction. + static const uint_type fraction_top_bit = + uint_type(1) << (num_fraction_bits + num_overflow_bits - 1); + + // The least significant bit in the exponent, which is also the bit + // immediately to the left of the significand. + static const uint_type first_exponent_bit = uint_type(1) + << (num_fraction_bits); + + // The mask for the encoded fraction. It does not include the + // implicit bit. + static const uint_type fraction_encode_mask = + spvutils::SetBits::get; + + // The bit that is used as a sign. + static const uint_type sign_mask = uint_type(1) << top_bit_left_shift; + + // The bits that represent the exponent. + static const uint_type exponent_mask = + spvutils::SetBits::get; + + // How far left the exponent is shifted. + static const uint32_t exponent_left_shift = num_fraction_bits; + + // How far from the right edge the fraction is shifted. + static const uint32_t fraction_right_shift = + static_cast(sizeof(uint_type) * 8) - num_fraction_bits; + + // The maximum representable unbiased exponent. + static const int_type max_exponent = + (exponent_mask >> num_fraction_bits) - exponent_bias; + // The minimum representable exponent for normalized numbers. + static const int_type min_exponent = -static_cast(exponent_bias); + + // Returns the bits associated with the value. + uint_type getBits() const { return value_.data(); } + + // Returns the bits associated with the value, without the leading sign bit. + uint_type getUnsignedBits() const { + return static_cast(value_.data() & ~sign_mask); + } + + // Returns the bits associated with the exponent, shifted to start at the + // lsb of the type. + const uint_type getExponentBits() const { + return static_cast((getBits() & exponent_mask) >> + num_fraction_bits); + } + + // Returns the exponent in unbiased form. This is the exponent in the + // human-friendly form. + const int_type getUnbiasedExponent() const { + return static_cast(getExponentBits() - exponent_bias); + } + + // Returns just the significand bits from the value. + const uint_type getSignificandBits() const { + return getBits() & fraction_encode_mask; + } + + // If the number was normalized, returns the unbiased exponent. + // If the number was denormal, normalize the exponent first. + const int_type getUnbiasedNormalizedExponent() const { + if ((getBits() & ~sign_mask) == 0) { // special case if everything is 0 + return 0; + } + int_type exp = getUnbiasedExponent(); + if (exp == min_exponent) { // We are in denorm land. + uint_type significand_bits = getSignificandBits(); + while ((significand_bits & (first_exponent_bit >> 1)) == 0) { + significand_bits = static_cast(significand_bits << 1); + exp = static_cast(exp - 1); + } + significand_bits &= fraction_encode_mask; + } + return exp; + } + + // Returns the signficand after it has been normalized. + const uint_type getNormalizedSignificand() const { + int_type unbiased_exponent = getUnbiasedNormalizedExponent(); + uint_type significand = getSignificandBits(); + for (int_type i = unbiased_exponent; i <= min_exponent; ++i) { + significand = static_cast(significand << 1); + } + significand &= fraction_encode_mask; + return significand; + } + + // Returns true if this number represents a negative value. + bool isNegative() const { return (getBits() & sign_mask) != 0; } + + // Sets this HexFloat from the individual components. + // Note this assumes EVERY significand is normalized, and has an implicit + // leading one. This means that the only way that this method will set 0, + // is if you set a number so denormalized that it underflows. + // Do not use this method with raw bits extracted from a subnormal number, + // since subnormals do not have an implicit leading 1 in the significand. + // The significand is also expected to be in the + // lowest-most num_fraction_bits of the uint_type. + // The exponent is expected to be unbiased, meaning an exponent of + // 0 actually means 0. + // If underflow_round_up is set, then on underflow, if a number is non-0 + // and would underflow, we round up to the smallest denorm. + void setFromSignUnbiasedExponentAndNormalizedSignificand( + bool negative, int_type exponent, uint_type significand, + bool round_denorm_up) { + bool significand_is_zero = significand == 0; + + if (exponent <= min_exponent) { + // If this was denormalized, then we have to shift the bit on, meaning + // the significand is not zero. + significand_is_zero = false; + significand |= first_exponent_bit; + significand = static_cast(significand >> 1); + } + + while (exponent < min_exponent) { + significand = static_cast(significand >> 1); + ++exponent; + } + + if (exponent == min_exponent) { + if (significand == 0 && !significand_is_zero && round_denorm_up) { + significand = static_cast(0x1); + } + } + + uint_type new_value = 0; + if (negative) { + new_value = static_cast(new_value | sign_mask); + } + exponent = static_cast(exponent + exponent_bias); + assert(exponent >= 0); + + // put it all together + exponent = static_cast((exponent << exponent_left_shift) & + exponent_mask); + significand = static_cast(significand & fraction_encode_mask); + new_value = static_cast(new_value | (exponent | significand)); + value_ = T(new_value); + } + + // Increments the significand of this number by the given amount. + // If this would spill the significand into the implicit bit, + // carry is set to true and the significand is shifted to fit into + // the correct location, otherwise carry is set to false. + // All significands and to_increment are assumed to be within the bounds + // for a valid significand. + static uint_type incrementSignificand(uint_type significand, + uint_type to_increment, bool* carry) { + significand = static_cast(significand + to_increment); + *carry = false; + if (significand & first_exponent_bit) { + *carry = true; + // The implicit 1-bit will have carried, so we should zero-out the + // top bit and shift back. + significand = static_cast(significand & ~first_exponent_bit); + significand = static_cast(significand >> 1); + } + return significand; + } + +#if GCC_VERSION == 40801 + // These exist because MSVC throws warnings on negative right-shifts + // even if they are not going to be executed. Eg: + // constant_number < 0? 0: constant_number + // These convert the negative left-shifts into right shifts. + template + struct negatable_left_shift { + static uint_type val(uint_type val) { + if (N > 0) { + return static_cast(val << N); + } else { + return static_cast(val >> N); + } + } + }; + + template + struct negatable_right_shift { + static uint_type val(uint_type val) { + if (N > 0) { + return static_cast(val >> N); + } else { + return static_cast(val << N); + } + } + }; + +#else + // These exist because MSVC throws warnings on negative right-shifts + // even if they are not going to be executed. Eg: + // constant_number < 0? 0: constant_number + // These convert the negative left-shifts into right shifts. + template + struct negatable_left_shift { + static uint_type val(uint_type val) { + return static_cast(val >> -N); + } + }; + + template + struct negatable_left_shift= 0>::type> { + static uint_type val(uint_type val) { + return static_cast(val << N); + } + }; + + template + struct negatable_right_shift { + static uint_type val(uint_type val) { + return static_cast(val << -N); + } + }; + + template + struct negatable_right_shift= 0>::type> { + static uint_type val(uint_type val) { + return static_cast(val >> N); + } + }; +#endif + + // Returns the significand, rounded to fit in a significand in + // other_T. This is shifted so that the most significant + // bit of the rounded number lines up with the most significant bit + // of the returned significand. + template + typename other_T::uint_type getRoundedNormalizedSignificand( + round_direction dir, bool* carry_bit) { + using other_uint_type = typename other_T::uint_type; + static const int_type num_throwaway_bits = + static_cast(num_fraction_bits) - + static_cast(other_T::num_fraction_bits); + + static const uint_type last_significant_bit = + (num_throwaway_bits < 0) + ? 0 + : negatable_left_shift::val(1u); + static const uint_type first_rounded_bit = + (num_throwaway_bits < 1) + ? 0 + : negatable_left_shift::val(1u); + + static const uint_type throwaway_mask_bits = + num_throwaway_bits > 0 ? num_throwaway_bits : 0; + static const uint_type throwaway_mask = + spvutils::SetBits::get; + + *carry_bit = false; + other_uint_type out_val = 0; + uint_type significand = getNormalizedSignificand(); + // If we are up-casting, then we just have to shift to the right location. + if (num_throwaway_bits <= 0) { + out_val = static_cast(significand); + uint_type shift_amount = static_cast(-num_throwaway_bits); + out_val = static_cast(out_val << shift_amount); + return out_val; + } + + // If every non-representable bit is 0, then we don't have any casting to + // do. + if ((significand & throwaway_mask) == 0) { + return static_cast( + negatable_right_shift::val(significand)); + } + + bool round_away_from_zero = false; + // We actually have to narrow the significand here, so we have to follow the + // rounding rules. + switch (dir) { + case round_direction::kToZero: + break; + case round_direction::kToPositiveInfinity: + round_away_from_zero = !isNegative(); + break; + case round_direction::kToNegativeInfinity: + round_away_from_zero = isNegative(); + break; + case round_direction::kToNearestEven: + // Have to round down, round bit is 0 + if ((first_rounded_bit & significand) == 0) { + break; + } + if (((significand & throwaway_mask) & ~first_rounded_bit) != 0) { + // If any subsequent bit of the rounded portion is non-0 then we round + // up. + round_away_from_zero = true; + break; + } + // We are exactly half-way between 2 numbers, pick even. + if ((significand & last_significant_bit) != 0) { + // 1 for our last bit, round up. + round_away_from_zero = true; + break; + } + break; + } + + if (round_away_from_zero) { + return static_cast( + negatable_right_shift::val(incrementSignificand( + significand, last_significant_bit, carry_bit))); + } else { + return static_cast( + negatable_right_shift::val(significand)); + } + } + + // Casts this value to another HexFloat. If the cast is widening, + // then round_dir is ignored. If the cast is narrowing, then + // the result is rounded in the direction specified. + // This number will retain Nan and Inf values. + // It will also saturate to Inf if the number overflows, and + // underflow to (0 or min depending on rounding) if the number underflows. + template + void castTo(other_T& other, round_direction round_dir) { + other = other_T(static_cast(0)); + bool negate = isNegative(); + if (getUnsignedBits() == 0) { + if (negate) { + other.set_value(-other.value()); + } + return; + } + uint_type significand = getSignificandBits(); + bool carried = false; + typename other_T::uint_type rounded_significand = + getRoundedNormalizedSignificand(round_dir, &carried); + + int_type exponent = getUnbiasedExponent(); + if (exponent == min_exponent) { + // If we are denormal, normalize the exponent, so that we can encode + // easily. + exponent = static_cast(exponent + 1); + for (uint_type check_bit = first_exponent_bit >> 1; check_bit != 0; + check_bit = static_cast(check_bit >> 1)) { + exponent = static_cast(exponent - 1); + if (check_bit & significand) break; + } + } + + bool is_nan = + (getBits() & exponent_mask) == exponent_mask && significand != 0; + bool is_inf = + !is_nan && + ((exponent + carried) > static_cast(other_T::exponent_bias) || + (significand == 0 && (getBits() & exponent_mask) == exponent_mask)); + + // If we are Nan or Inf we should pass that through. + if (is_inf) { + other.set_value(BitwiseCast( + static_cast( + (negate ? other_T::sign_mask : 0) | other_T::exponent_mask))); + return; + } + if (is_nan) { + typename other_T::uint_type shifted_significand; + shifted_significand = static_cast( + negatable_left_shift< + static_cast(other_T::num_fraction_bits) - + static_cast(num_fraction_bits)>::val(significand)); + + // We are some sort of Nan. We try to keep the bit-pattern of the Nan + // as close as possible. If we had to shift off bits so we are 0, then we + // just set the last bit. + other.set_value(BitwiseCast( + static_cast( + (negate ? other_T::sign_mask : 0) | other_T::exponent_mask | + (shifted_significand == 0 ? 0x1 : shifted_significand)))); + return; + } + + bool round_underflow_up = + isNegative() ? round_dir == round_direction::kToNegativeInfinity + : round_dir == round_direction::kToPositiveInfinity; + using other_int_type = typename other_T::int_type; + // setFromSignUnbiasedExponentAndNormalizedSignificand will + // zero out any underflowing value (but retain the sign). + other.setFromSignUnbiasedExponentAndNormalizedSignificand( + negate, static_cast(exponent), rounded_significand, + round_underflow_up); + return; + } + + private: + T value_; + + static_assert(num_used_bits == + Traits::num_exponent_bits + Traits::num_fraction_bits + 1, + "The number of bits do not fit"); + static_assert(sizeof(T) == sizeof(uint_type), "The type sizes do not match"); +}; + +// Returns 4 bits represented by the hex character. +inline uint8_t get_nibble_from_character(int character) { + const char* dec = "0123456789"; + const char* lower = "abcdef"; + const char* upper = "ABCDEF"; + const char* p = nullptr; + if ((p = strchr(dec, character))) { + return static_cast(p - dec); + } else if ((p = strchr(lower, character))) { + return static_cast(p - lower + 0xa); + } else if ((p = strchr(upper, character))) { + return static_cast(p - upper + 0xa); + } + + assert(false && "This was called with a non-hex character"); + return 0; +} + +// Outputs the given HexFloat to the stream. +template +std::ostream& operator<<(std::ostream& os, const HexFloat& value) { + using HF = HexFloat; + using uint_type = typename HF::uint_type; + using int_type = typename HF::int_type; + + static_assert(HF::num_used_bits != 0, + "num_used_bits must be non-zero for a valid float"); + static_assert(HF::num_exponent_bits != 0, + "num_exponent_bits must be non-zero for a valid float"); + static_assert(HF::num_fraction_bits != 0, + "num_fractin_bits must be non-zero for a valid float"); + + const uint_type bits = value.value().data(); + const char* const sign = (bits & HF::sign_mask) ? "-" : ""; + const uint_type exponent = static_cast( + (bits & HF::exponent_mask) >> HF::num_fraction_bits); + + uint_type fraction = static_cast((bits & HF::fraction_encode_mask) + << HF::num_overflow_bits); + + const bool is_zero = exponent == 0 && fraction == 0; + const bool is_denorm = exponent == 0 && !is_zero; + + // exponent contains the biased exponent we have to convert it back into + // the normal range. + int_type int_exponent = static_cast(exponent - HF::exponent_bias); + // If the number is all zeros, then we actually have to NOT shift the + // exponent. + int_exponent = is_zero ? 0 : int_exponent; + + // If we are denorm, then start shifting, and decreasing the exponent until + // our leading bit is 1. + + if (is_denorm) { + while ((fraction & HF::fraction_top_bit) == 0) { + fraction = static_cast(fraction << 1); + int_exponent = static_cast(int_exponent - 1); + } + // Since this is denormalized, we have to consume the leading 1 since it + // will end up being implicit. + fraction = static_cast(fraction << 1); // eat the leading 1 + fraction &= HF::fraction_represent_mask; + } + + uint_type fraction_nibbles = HF::fraction_nibbles; + // We do not have to display any trailing 0s, since this represents the + // fractional part. + while (fraction_nibbles > 0 && (fraction & 0xF) == 0) { + // Shift off any trailing values; + fraction = static_cast(fraction >> 4); + --fraction_nibbles; + } + + const auto saved_flags = os.flags(); + const auto saved_fill = os.fill(); + + os << sign << "0x" << (is_zero ? '0' : '1'); + if (fraction_nibbles) { + // Make sure to keep the leading 0s in place, since this is the fractional + // part. + os << "." << std::setw(static_cast(fraction_nibbles)) + << std::setfill('0') << std::hex << fraction; + } + os << "p" << std::dec << (int_exponent >= 0 ? "+" : "") << int_exponent; + + os.flags(saved_flags); + os.fill(saved_fill); + + return os; +} + +// Returns true if negate_value is true and the next character on the +// input stream is a plus or minus sign. In that case we also set the fail bit +// on the stream and set the value to the zero value for its type. +template +inline bool RejectParseDueToLeadingSign(std::istream& is, bool negate_value, + HexFloat& value) { + if (negate_value) { + auto next_char = is.peek(); + if (next_char == '-' || next_char == '+') { + // Fail the parse. Emulate standard behaviour by setting the value to + // the zero value, and set the fail bit on the stream. + value = HexFloat(typename HexFloat::uint_type{0}); + is.setstate(std::ios_base::failbit); + return true; + } + } + return false; +} + +// Parses a floating point number from the given stream and stores it into the +// value parameter. +// If negate_value is true then the number may not have a leading minus or +// plus, and if it successfully parses, then the number is negated before +// being stored into the value parameter. +// If the value cannot be correctly parsed or overflows the target floating +// point type, then set the fail bit on the stream. +// TODO(dneto): Promise C++11 standard behavior in how the value is set in +// the error case, but only after all target platforms implement it correctly. +// In particular, the Microsoft C++ runtime appears to be out of spec. +template +inline std::istream& ParseNormalFloat(std::istream& is, bool negate_value, + HexFloat& value) { + if (RejectParseDueToLeadingSign(is, negate_value, value)) { + return is; + } + T val; + is >> val; + if (negate_value) { + val = -val; + } + value.set_value(val); + // In the failure case, map -0.0 to 0.0. + if (is.fail() && value.getUnsignedBits() == 0u) { + value = HexFloat(typename HexFloat::uint_type{0}); + } + if (val.isInfinity()) { + // Fail the parse. Emulate standard behaviour by setting the value to + // the closest normal value, and set the fail bit on the stream. + value.set_value((value.isNegative() | negate_value) ? T::lowest() + : T::max()); + is.setstate(std::ios_base::failbit); + } + return is; +} + +// Specialization of ParseNormalFloat for FloatProxy values. +// This will parse the float as it were a 32-bit floating point number, +// and then round it down to fit into a Float16 value. +// The number is rounded towards zero. +// If negate_value is true then the number may not have a leading minus or +// plus, and if it successfully parses, then the number is negated before +// being stored into the value parameter. +// If the value cannot be correctly parsed or overflows the target floating +// point type, then set the fail bit on the stream. +// TODO(dneto): Promise C++11 standard behavior in how the value is set in +// the error case, but only after all target platforms implement it correctly. +// In particular, the Microsoft C++ runtime appears to be out of spec. +template <> +inline std::istream& +ParseNormalFloat, HexFloatTraits>>( + std::istream& is, bool negate_value, + HexFloat, HexFloatTraits>>& value) { + // First parse as a 32-bit float. + HexFloat> float_val(0.0f); + ParseNormalFloat(is, negate_value, float_val); + + // Then convert to 16-bit float, saturating at infinities, and + // rounding toward zero. + float_val.castTo(value, round_direction::kToZero); + + // Overflow on 16-bit behaves the same as for 32- and 64-bit: set the + // fail bit and set the lowest or highest value. + if (Float16::isInfinity(value.value().getAsFloat())) { + value.set_value(value.isNegative() ? Float16::lowest() : Float16::max()); + is.setstate(std::ios_base::failbit); + } + return is; +} + +// Reads a HexFloat from the given stream. +// If the float is not encoded as a hex-float then it will be parsed +// as a regular float. +// This may fail if your stream does not support at least one unget. +// Nan values can be encoded with "0x1.p+exponent_bias". +// This would normally overflow a float and round to +// infinity but this special pattern is the exact representation for a NaN, +// and therefore is actually encoded as the correct NaN. To encode inf, +// either 0x0p+exponent_bias can be specified or any exponent greater than +// exponent_bias. +// Examples using IEEE 32-bit float encoding. +// 0x1.0p+128 (+inf) +// -0x1.0p-128 (-inf) +// +// 0x1.1p+128 (+Nan) +// -0x1.1p+128 (-Nan) +// +// 0x1p+129 (+inf) +// -0x1p+129 (-inf) +template +std::istream& operator>>(std::istream& is, HexFloat& value) { + using HF = HexFloat; + using uint_type = typename HF::uint_type; + using int_type = typename HF::int_type; + + value.set_value(static_cast(0.f)); + + if (is.flags() & std::ios::skipws) { + // If the user wants to skip whitespace , then we should obey that. + while (std::isspace(is.peek())) { + is.get(); + } + } + + auto next_char = is.peek(); + bool negate_value = false; + + if (next_char != '-' && next_char != '0') { + return ParseNormalFloat(is, negate_value, value); + } + + if (next_char == '-') { + negate_value = true; + is.get(); + next_char = is.peek(); + } + + if (next_char == '0') { + is.get(); // We may have to unget this. + auto maybe_hex_start = is.peek(); + if (maybe_hex_start != 'x' && maybe_hex_start != 'X') { + is.unget(); + return ParseNormalFloat(is, negate_value, value); + } else { + is.get(); // Throw away the 'x'; + } + } else { + return ParseNormalFloat(is, negate_value, value); + } + + // This "looks" like a hex-float so treat it as one. + bool seen_p = false; + bool seen_dot = false; + uint_type fraction_index = 0; + + uint_type fraction = 0; + int_type exponent = HF::exponent_bias; + + // Strip off leading zeros so we don't have to special-case them later. + while ((next_char = is.peek()) == '0') { + is.get(); + } + + bool is_denorm = + true; // Assume denorm "representation" until we hear otherwise. + // NB: This does not mean the value is actually denorm, + // it just means that it was written 0. + bool bits_written = false; // Stays false until we write a bit. + while (!seen_p && !seen_dot) { + // Handle characters that are left of the fractional part. + if (next_char == '.') { + seen_dot = true; + } else if (next_char == 'p') { + seen_p = true; + } else if (::isxdigit(next_char)) { + // We know this is not denormalized since we have stripped all leading + // zeroes and we are not a ".". + is_denorm = false; + int number = get_nibble_from_character(next_char); + for (int i = 0; i < 4; ++i, number <<= 1) { + uint_type write_bit = (number & 0x8) ? 0x1 : 0x0; + if (bits_written) { + // If we are here the bits represented belong in the fractional + // part of the float, and we have to adjust the exponent accordingly. + fraction = static_cast( + fraction | + static_cast( + write_bit << (HF::top_bit_left_shift - fraction_index++))); + exponent = static_cast(exponent + 1); + } + bits_written |= write_bit != 0; + } + } else { + // We have not found our exponent yet, so we have to fail. + is.setstate(std::ios::failbit); + return is; + } + is.get(); + next_char = is.peek(); + } + bits_written = false; + while (seen_dot && !seen_p) { + // Handle only fractional parts now. + if (next_char == 'p') { + seen_p = true; + } else if (::isxdigit(next_char)) { + int number = get_nibble_from_character(next_char); + for (int i = 0; i < 4; ++i, number <<= 1) { + uint_type write_bit = (number & 0x8) ? 0x01 : 0x00; + bits_written |= write_bit != 0; + if (is_denorm && !bits_written) { + // Handle modifying the exponent here this way we can handle + // an arbitrary number of hex values without overflowing our + // integer. + exponent = static_cast(exponent - 1); + } else { + fraction = static_cast( + fraction | + static_cast( + write_bit << (HF::top_bit_left_shift - fraction_index++))); + } + } + } else { + // We still have not found our 'p' exponent yet, so this is not a valid + // hex-float. + is.setstate(std::ios::failbit); + return is; + } + is.get(); + next_char = is.peek(); + } + + bool seen_sign = false; + int8_t exponent_sign = 1; + int_type written_exponent = 0; + while (true) { + if ((next_char == '-' || next_char == '+')) { + if (seen_sign) { + is.setstate(std::ios::failbit); + return is; + } + seen_sign = true; + exponent_sign = (next_char == '-') ? -1 : 1; + } else if (::isdigit(next_char)) { + // Hex-floats express their exponent as decimal. + written_exponent = static_cast(written_exponent * 10); + written_exponent = + static_cast(written_exponent + (next_char - '0')); + } else { + break; + } + is.get(); + next_char = is.peek(); + } + + written_exponent = static_cast(written_exponent * exponent_sign); + exponent = static_cast(exponent + written_exponent); + + bool is_zero = is_denorm && (fraction == 0); + if (is_denorm && !is_zero) { + fraction = static_cast(fraction << 1); + exponent = static_cast(exponent - 1); + } else if (is_zero) { + exponent = 0; + } + + if (exponent <= 0 && !is_zero) { + fraction = static_cast(fraction >> 1); + fraction |= static_cast(1) << HF::top_bit_left_shift; + } + + fraction = (fraction >> HF::fraction_right_shift) & HF::fraction_encode_mask; + + const int_type max_exponent = + SetBits::get; + + // Handle actual denorm numbers + while (exponent < 0 && !is_zero) { + fraction = static_cast(fraction >> 1); + exponent = static_cast(exponent + 1); + + fraction &= HF::fraction_encode_mask; + if (fraction == 0) { + // We have underflowed our fraction. We should clamp to zero. + is_zero = true; + exponent = 0; + } + } + + // We have overflowed so we should be inf/-inf. + if (exponent > max_exponent) { + exponent = max_exponent; + fraction = 0; + } + + uint_type output_bits = static_cast( + static_cast(negate_value ? 1 : 0) << HF::top_bit_left_shift); + output_bits |= fraction; + + uint_type shifted_exponent = static_cast( + static_cast(exponent << HF::exponent_left_shift) & + HF::exponent_mask); + output_bits |= shifted_exponent; + + T output_float(output_bits); + value.set_value(output_float); + + return is; +} + +// Writes a FloatProxy value to a stream. +// Zero and normal numbers are printed in the usual notation, but with +// enough digits to fully reproduce the value. Other values (subnormal, +// NaN, and infinity) are printed as a hex float. +template +std::ostream& operator<<(std::ostream& os, const FloatProxy& value) { + auto float_val = value.getAsFloat(); + switch (std::fpclassify(float_val)) { + case FP_ZERO: + case FP_NORMAL: { + auto saved_precision = os.precision(); + os.precision(std::numeric_limits::max_digits10); + os << float_val; + os.precision(saved_precision); + } break; + default: + os << HexFloat>(value); + break; + } + return os; +} + +template <> +inline std::ostream& operator<<(std::ostream& os, + const FloatProxy& value) { + os << HexFloat>(value); + return os; +} +} // namespace spvutils + +#endif // LIBSPIRV_UTIL_HEX_FLOAT_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/huffman_codec.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/huffman_codec.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/huffman_codec.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/huffman_codec.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,385 @@ +// Copyright (c) 2017 Google 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. + +// Contains utils for reading, writing and debug printing bit streams. + +#ifndef LIBSPIRV_UTIL_HUFFMAN_CODEC_H_ +#define LIBSPIRV_UTIL_HUFFMAN_CODEC_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace spvutils { + +// Used to generate and apply a Huffman coding scheme. +// |Val| is the type of variable being encoded (for example a string or a +// literal). +template +class HuffmanCodec { + public: + // Huffman tree node. + struct Node { + Node() {} + + // Creates Node from serialization leaving weight and id undefined. + Node(const Val& in_value, uint32_t in_left, uint32_t in_right) + : value(in_value), left(in_left), right(in_right) {} + + Val value = Val(); + uint32_t weight = 0; + // Ids are issued sequentially starting from 1. Ids are used as an ordering + // tie-breaker, to make sure that the ordering (and resulting coding scheme) + // are consistent accross multiple platforms. + uint32_t id = 0; + // Handles of children. + uint32_t left = 0; + uint32_t right = 0; + }; + + // Creates Huffman codec from a histogramm. + // Histogramm counts must not be zero. + explicit HuffmanCodec(const std::map& hist) { + if (hist.empty()) return; + + // Heuristic estimate. + nodes_.reserve(3 * hist.size()); + + // Create NIL. + CreateNode(); + + // The queue is sorted in ascending order by weight (or by node id if + // weights are equal). + std::vector queue_vector; + queue_vector.reserve(hist.size()); + std::priority_queue, + std::function> + queue(std::bind(&HuffmanCodec::LeftIsBigger, this, + std::placeholders::_1, std::placeholders::_2), + std::move(queue_vector)); + + // Put all leaves in the queue. + for (const auto& pair : hist) { + const uint32_t node = CreateNode(); + MutableValueOf(node) = pair.first; + MutableWeightOf(node) = pair.second; + assert(WeightOf(node)); + queue.push(node); + } + + // Form the tree by combining two subtrees with the least weight, + // and pushing the root of the new tree in the queue. + while (true) { + // We push a node at the end of each iteration, so the queue is never + // supposed to be empty at this point, unless there are no leaves, but + // that case was already handled. + assert(!queue.empty()); + const uint32_t right = queue.top(); + queue.pop(); + + // If the queue is empty at this point, then the last node is + // the root of the complete Huffman tree. + if (queue.empty()) { + root_ = right; + break; + } + + const uint32_t left = queue.top(); + queue.pop(); + + // Combine left and right into a new tree and push it into the queue. + const uint32_t parent = CreateNode(); + MutableWeightOf(parent) = WeightOf(right) + WeightOf(left); + MutableLeftOf(parent) = left; + MutableRightOf(parent) = right; + queue.push(parent); + } + + // Traverse the tree and form encoding table. + CreateEncodingTable(); + } + + // Creates Huffman codec from saved tree structure. + // |nodes| is the list of nodes of the tree, nodes[0] being NIL. + // |root_handle| is the index of the root node. + HuffmanCodec(uint32_t root_handle, std::vector&& nodes) { + nodes_ = std::move(nodes); + assert(!nodes_.empty()); + assert(root_handle > 0 && root_handle < nodes_.size()); + assert(!LeftOf(0) && !RightOf(0)); + + root_ = root_handle; + + // Traverse the tree and form encoding table. + CreateEncodingTable(); + } + + // Serializes the codec in the following text format: + // (, { + // {0, 0, 0}, + // {val1, left1, right1}, + // {val2, left2, right2}, + // ... + // }) + std::string SerializeToText(int indent_num_whitespaces) const { + const bool value_is_text = std::is_same::value; + + const std::string indent1 = std::string(indent_num_whitespaces, ' '); + const std::string indent2 = std::string(indent_num_whitespaces + 2, ' '); + + std::stringstream code; + code << "(" << root_ << ", {\n"; + + for (const Node& node : nodes_) { + code << indent2 << "{"; + if (value_is_text) code << "\""; + code << node.value; + if (value_is_text) code << "\""; + code << ", " << node.left << ", " << node.right << "},\n"; + } + + code << indent1 << "})"; + + return code.str(); + } + + // Prints the Huffman tree in the following format: + // w------w------'x' + // w------'y' + // Where w stands for the weight of the node. + // Right tree branches appear above left branches. Taking the right path + // adds 1 to the code, taking the left adds 0. + void PrintTree(std::ostream& out) const { PrintTreeInternal(out, root_, 0); } + + // Traverses the tree and prints the Huffman table: value, code + // and optionally node weight for every leaf. + void PrintTable(std::ostream& out, bool print_weights = true) { + std::queue> queue; + queue.emplace(root_, ""); + + while (!queue.empty()) { + const uint32_t node = queue.front().first; + const std::string code = queue.front().second; + queue.pop(); + if (!RightOf(node) && !LeftOf(node)) { + out << ValueOf(node); + if (print_weights) out << " " << WeightOf(node); + out << " " << code << std::endl; + } else { + if (LeftOf(node)) queue.emplace(LeftOf(node), code + "0"); + + if (RightOf(node)) queue.emplace(RightOf(node), code + "1"); + } + } + } + + // Returns the Huffman table. The table was built at at construction time, + // this function just returns a const reference. + const std::unordered_map>& GetEncodingTable() + const { + return encoding_table_; + } + + // Encodes |val| and stores its Huffman code in the lower |num_bits| of + // |bits|. Returns false of |val| is not in the Huffman table. + bool Encode(const Val& val, uint64_t* bits, size_t* num_bits) const { + auto it = encoding_table_.find(val); + if (it == encoding_table_.end()) return false; + *bits = it->second.first; + *num_bits = it->second.second; + return true; + } + + // Reads bits one-by-one using callback |read_bit| until a match is found. + // Matching value is stored in |val|. Returns false if |read_bit| terminates + // before a code was mathced. + // |read_bit| has type bool func(bool* bit). When called, the next bit is + // stored in |bit|. |read_bit| returns false if the stream terminates + // prematurely. + bool DecodeFromStream(const std::function& read_bit, + Val* val) const { + uint32_t node = root_; + while (true) { + assert(node); + + if (!RightOf(node) && !LeftOf(node)) { + *val = ValueOf(node); + return true; + } + + bool go_right; + if (!read_bit(&go_right)) return false; + + if (go_right) + node = RightOf(node); + else + node = LeftOf(node); + } + + assert(0); + return false; + } + + private: + // Returns value of the node referenced by |handle|. + Val ValueOf(uint32_t node) const { return nodes_.at(node).value; } + + // Returns left child of |node|. + uint32_t LeftOf(uint32_t node) const { return nodes_.at(node).left; } + + // Returns right child of |node|. + uint32_t RightOf(uint32_t node) const { return nodes_.at(node).right; } + + // Returns weight of |node|. + uint32_t WeightOf(uint32_t node) const { return nodes_.at(node).weight; } + + // Returns id of |node|. + uint32_t IdOf(uint32_t node) const { return nodes_.at(node).id; } + + // Returns mutable reference to value of |node|. + Val& MutableValueOf(uint32_t node) { + assert(node); + return nodes_.at(node).value; + } + + // Returns mutable reference to handle of left child of |node|. + uint32_t& MutableLeftOf(uint32_t node) { + assert(node); + return nodes_.at(node).left; + } + + // Returns mutable reference to handle of right child of |node|. + uint32_t& MutableRightOf(uint32_t node) { + assert(node); + return nodes_.at(node).right; + } + + // Returns mutable reference to weight of |node|. + uint32_t& MutableWeightOf(uint32_t node) { return nodes_.at(node).weight; } + + // Returns mutable reference to id of |node|. + uint32_t& MutableIdOf(uint32_t node) { return nodes_.at(node).id; } + + // Returns true if |left| has bigger weight than |right|. Node ids are + // used as tie-breaker. + bool LeftIsBigger(uint32_t left, uint32_t right) const { + if (WeightOf(left) == WeightOf(right)) { + assert(IdOf(left) != IdOf(right)); + return IdOf(left) > IdOf(right); + } + return WeightOf(left) > WeightOf(right); + } + + // Prints subtree (helper function used by PrintTree). + void PrintTreeInternal(std::ostream& out, uint32_t node, size_t depth) const { + if (!node) return; + + const size_t kTextFieldWidth = 7; + + if (!RightOf(node) && !LeftOf(node)) { + out << ValueOf(node) << std::endl; + } else { + if (RightOf(node)) { + std::stringstream label; + label << std::setfill('-') << std::left << std::setw(kTextFieldWidth) + << WeightOf(RightOf(node)); + out << label.str(); + PrintTreeInternal(out, RightOf(node), depth + 1); + } + + if (LeftOf(node)) { + out << std::string(depth * kTextFieldWidth, ' '); + std::stringstream label; + label << std::setfill('-') << std::left << std::setw(kTextFieldWidth) + << WeightOf(LeftOf(node)); + out << label.str(); + PrintTreeInternal(out, LeftOf(node), depth + 1); + } + } + } + + // Traverses the Huffman tree and saves paths to the leaves as bit + // sequences to encoding_table_. + void CreateEncodingTable() { + struct Context { + Context(uint32_t in_node, uint64_t in_bits, size_t in_depth) + : node(in_node), bits(in_bits), depth(in_depth) {} + uint32_t node; + // Huffman tree depth cannot exceed 64 as histogramm counts are expected + // to be positive and limited by numeric_limits::max(). + // For practical applications tree depth would be much smaller than 64. + uint64_t bits; + size_t depth; + }; + + std::queue queue; + queue.emplace(root_, 0, 0); + + while (!queue.empty()) { + const Context& context = queue.front(); + const uint32_t node = context.node; + const uint64_t bits = context.bits; + const size_t depth = context.depth; + queue.pop(); + + if (!RightOf(node) && !LeftOf(node)) { + auto insertion_result = encoding_table_.emplace( + ValueOf(node), std::pair(bits, depth)); + assert(insertion_result.second); + (void)insertion_result; + } else { + if (LeftOf(node)) queue.emplace(LeftOf(node), bits, depth + 1); + + if (RightOf(node)) + queue.emplace(RightOf(node), bits | (1ULL << depth), depth + 1); + } + } + } + + // Creates new Huffman tree node and stores it in the deleter array. + uint32_t CreateNode() { + const uint32_t handle = static_cast(nodes_.size()); + nodes_.emplace_back(Node()); + nodes_.back().id = next_node_id_++; + return handle; + } + + // Huffman tree root handle. + uint32_t root_ = 0; + + // Huffman tree deleter. + std::vector nodes_; + + // Encoding table value -> {bits, num_bits}. + // Huffman codes are expected to never exceed 64 bit length (this is in fact + // impossible if frequencies are stored as uint32_t). + std::unordered_map> encoding_table_; + + // Next node id issued by CreateNode(); + uint32_t next_node_id_ = 1; +}; + +} // namespace spvutils + +#endif // LIBSPIRV_UTIL_HUFFMAN_CODEC_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/ilist.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/ilist.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/ilist.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/ilist.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,365 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_ILIST_H_ +#define LIBSPIRV_OPT_ILIST_H_ + +#include +#include +#include +#include + +#include "ilist_node.h" + +namespace spvtools { +namespace utils { + +// An IntrusiveList is a generic implementation of a doubly-linked list. The +// intended convention for using this container is: +// +// class Node : public IntrusiveNodeBase { +// // Note that "Node", the class being defined is the template. +// // Must have a default constructor accessible to List. +// // Add whatever data is needed in the node +// }; +// +// using List = IntrusiveList; +// +// You can also inherit from IntrusiveList instead of a typedef if you want to +// add more functionality. +// +// The condition on the template for IntrusiveNodeBase is there to add some type +// checking to the container. The compiler will still allow inserting elements +// of type IntrusiveNodeBase, but that would be an error. This assumption +// allows NextNode and PreviousNode to return pointers to Node, and casting will +// not be required by the user. + +template +class IntrusiveList { + public: + static_assert( + std::is_base_of, NodeType>::value, + "The type from the node must be derived from IntrusiveNodeBase, with " + "itself in the template."); + + // Creates an empty list. + inline IntrusiveList(); + + // Moves the contents of the given list to the list being constructed. + IntrusiveList(IntrusiveList&&); + + // Destorys the list. Note that the elements of the list will not be deleted, + // but they will be removed from the list. + virtual ~IntrusiveList(); + + // Moves all of the elements in the list on the RHS to the list on the LHS. + IntrusiveList& operator=(IntrusiveList&&); + + // Basetype for iterators so an IntrusiveList can be traversed like STL + // containers. + template + class iterator_template { + public: + iterator_template(const iterator_template& i) : node_(i.node_) {} + + iterator_template& operator++() { + node_ = node_->next_node_; + return *this; + } + + iterator_template& operator--() { + node_ = node_->previous_node_; + return *this; + } + + iterator_template& operator=(const iterator_template& i) { + node_ = i.node_; + return *this; + } + + T& operator*() const { return *node_; } + T* operator->() const { return node_; } + + friend inline bool operator==(const iterator_template& lhs, + const iterator_template& rhs) { + return lhs.node_ == rhs.node_; + } + friend inline bool operator!=(const iterator_template& lhs, + const iterator_template& rhs) { + return !(lhs == rhs); + } + + // Moves the nodes in |list| to the list that |this| points to. The + // positions of the nodes will be immediately before the element pointed to + // by the iterator. The return value will be an iterator pointing to the + // first of the newly inserted elements. + iterator_template MoveBefore(IntrusiveList* list) { + if (list->empty()) return *this; + + NodeType* first_node = list->sentinel_.next_node_; + NodeType* last_node = list->sentinel_.previous_node_; + + this->node_->previous_node_->next_node_ = first_node; + first_node->previous_node_ = this->node_->previous_node_; + + last_node->next_node_ = this->node_; + this->node_->previous_node_ = last_node; + + list->sentinel_.next_node_ = &list->sentinel_; + list->sentinel_.previous_node_ = &list->sentinel_; + + return iterator(first_node); + } + + // Define standard iterator types needs so this class can be + // used with . + using iterator_category = std::bidirectional_iterator_tag; + using difference_type = std::ptrdiff_t; + using value_type = T; + using pointer = T*; + using const_pointer = const T*; + using reference = T&; + using const_reference = const T&; + using size_type = size_t; + + protected: + iterator_template() = delete; + inline iterator_template(T* node) { node_ = node; } + T* node_; + + friend IntrusiveList; + }; + + using iterator = iterator_template; + using const_iterator = iterator_template; + + // Various types of iterators for the start (begin) and one past the end (end) + // of the list. + // + // Decrementing |end()| iterator will give and iterator pointing to the last + // element in the list, if one exists. + // + // Incrementing |end()| iterator will give |begin()|. + // + // Decrementing |begin()| will give |end()|. + // + // TODO: Not marking these functions as noexcept because Visual Studio 2013 + // does not support it. When we no longer care about that compiler, we should + // mark these as noexcept. + iterator begin(); + iterator end(); + const_iterator begin() const; + const_iterator end() const; + const_iterator cbegin() const; + const_iterator cend() const; + + // Appends |node| to the end of the list. If |node| is already in a list, it + // will be removed from that list first. + void push_back(NodeType* node); + + // Returns true if the list is empty. + bool empty() const; + + // Makes the current list empty. + inline void clear(); + + // Returns references to the first or last element in the list. It is an + // error to call these functions on an empty list. + NodeType& front(); + NodeType& back(); + const NodeType& front() const; + const NodeType& back() const; + + // Transfers [|first|, |last|) from |other| into the list at |where|. + // + // If |other| is |this|, no change is made. + void Splice(iterator where, IntrusiveList* other, iterator first, + iterator last); + + protected: + // Doing a deep copy of the list does not make sense if the list does not own + // the data. It is not clear who will own the newly created data. Making + // copies illegal for that reason. + IntrusiveList(const IntrusiveList&) = delete; + IntrusiveList& operator=(const IntrusiveList&) = delete; + + // This function will assert if it finds the list containing |node| is not in + // a valid state. + static void Check(NodeType* node); + + // A special node used to represent both the start and end of the list, + // without being part of the list. + NodeType sentinel_; +}; + +// Implementation of IntrusiveList + +template +inline IntrusiveList::IntrusiveList() : sentinel_() { + sentinel_.next_node_ = &sentinel_; + sentinel_.previous_node_ = &sentinel_; + sentinel_.is_sentinel_ = true; +} + +template +IntrusiveList::IntrusiveList(IntrusiveList&& list) : sentinel_() { + sentinel_.next_node_ = &sentinel_; + sentinel_.previous_node_ = &sentinel_; + sentinel_.is_sentinel_ = true; + list.sentinel_.ReplaceWith(&sentinel_); +} + +template +IntrusiveList::~IntrusiveList() { + clear(); +} + +template +IntrusiveList& IntrusiveList::operator=( + IntrusiveList&& list) { + list.sentinel_.ReplaceWith(&sentinel_); + return *this; +} + +template +inline typename IntrusiveList::iterator +IntrusiveList::begin() { + return iterator(sentinel_.next_node_); +} + +template +inline typename IntrusiveList::iterator +IntrusiveList::end() { + return iterator(&sentinel_); +} + +template +inline typename IntrusiveList::const_iterator +IntrusiveList::begin() const { + return const_iterator(sentinel_.next_node_); +} + +template +inline typename IntrusiveList::const_iterator +IntrusiveList::end() const { + return const_iterator(&sentinel_); +} + +template +inline typename IntrusiveList::const_iterator +IntrusiveList::cbegin() const { + return const_iterator(sentinel_.next_node_); +} + +template +inline typename IntrusiveList::const_iterator +IntrusiveList::cend() const { + return const_iterator(&sentinel_); +} + +template +void IntrusiveList::push_back(NodeType* node) { + node->InsertBefore(&sentinel_); +} + +template +bool IntrusiveList::empty() const { + return sentinel_.NextNode() == nullptr; +} + +template +void IntrusiveList::clear() { + while (!empty()) { + front().RemoveFromList(); + } +} + +template +NodeType& IntrusiveList::front() { + NodeType* node = sentinel_.NextNode(); + assert(node != nullptr && "Can't get the front of an empty list."); + return *node; +} + +template +NodeType& IntrusiveList::back() { + NodeType* node = sentinel_.PreviousNode(); + assert(node != nullptr && "Can't get the back of an empty list."); + return *node; +} + +template +const NodeType& IntrusiveList::front() const { + NodeType* node = sentinel_.NextNode(); + assert(node != nullptr && "Can't get the front of an empty list."); + return *node; +} + +template +const NodeType& IntrusiveList::back() const { + NodeType* node = sentinel_.PreviousNode(); + assert(node != nullptr && "Can't get the back of an empty list."); + return *node; +} + +template +void IntrusiveList::Splice(iterator where, + IntrusiveList* other, + iterator first, iterator last) { + if (first == last) return; + if (other == this) return; + + NodeType* first_prev = first.node_->previous_node_; + NodeType* where_next = where.node_->next_node_; + + // Attach first. + where.node_->next_node_ = first.node_; + first.node_->previous_node_ = where.node_; + + // Attach last. + where_next->previous_node_ = last.node_->previous_node_; + last.node_->previous_node_->next_node_ = where_next; + + // Fixup other. + first_prev->next_node_ = last.node_; + last.node_->previous_node_ = first_prev; +} + +template +void IntrusiveList::Check(NodeType* start) { + int sentinel_count = 0; + NodeType* p = start; + do { + assert(p != nullptr); + assert(p->next_node_->previous_node_ == p); + assert(p->previous_node_->next_node_ == p); + if (p->is_sentinel_) sentinel_count++; + p = p->next_node_; + } while (p != start); + assert(sentinel_count == 1 && "List should have exactly 1 sentinel node."); + + p = start; + do { + assert(p != nullptr); + assert(p->previous_node_->next_node_ == p); + assert(p->next_node_->previous_node_ == p); + if (p->is_sentinel_) sentinel_count++; + p = p->previous_node_; + } while (p != start); +} + +} // namespace utils +} // namespace spvtools + +#endif // LIBSPIRV_OPT_ILIST_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/ilist_node.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/ilist_node.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/ilist_node.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/ilist_node.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,263 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_ILIST_NODE_H_ +#define LIBSPIRV_OPT_ILIST_NODE_H_ + +#include + +namespace spvtools { +namespace utils { + +template +class IntrusiveList; + +// IntrusiveNodeBase is the base class for nodes in an IntrusiveList. +// See the comments in ilist.h on how to use the class. + +template +class IntrusiveNodeBase { + public: + // Creates a new node that is not in a list. + inline IntrusiveNodeBase(); + inline IntrusiveNodeBase(const IntrusiveNodeBase&); + inline IntrusiveNodeBase& operator=(const IntrusiveNodeBase&); + inline IntrusiveNodeBase(IntrusiveNodeBase&& that); + + // Destroys a node. It is an error to destroy a node that is part of a + // list, unless it is a sentinel. + virtual ~IntrusiveNodeBase(); + + IntrusiveNodeBase& operator=(IntrusiveNodeBase&& that); + + // Returns true if |this| is in a list. + inline bool IsInAList() const; + + // Returns the node that comes after the given node in the list, if one + // exists. If the given node is not in a list or is at the end of the list, + // the return value is nullptr. + inline NodeType* NextNode() const; + + // Returns the node that comes before the given node in the list, if one + // exists. If the given node is not in a list or is at the start of the + // list, the return value is nullptr. + inline NodeType* PreviousNode() const; + + // Inserts the given node immediately before |pos| in the list. + // If the given node is already in a list, it will first be removed + // from that list. + // + // It is assumed that the given node is of type NodeType. It is an error if + // |pos| is not already in a list. + inline void InsertBefore(NodeType* pos); + + // Inserts the given node immediately after |pos| in the list. + // If the given node is already in a list, it will first be removed + // from that list. + // + // It is assumed that the given node is of type NodeType. It is an error if + // |pos| is not already in a list. + inline void InsertAfter(NodeType* pos); + + // Removes the given node from the list. It is assumed that the node is + // in a list. Note that this does not free any storage related to the node, + // it becomes the caller's responsibility to free the storage. + inline void RemoveFromList(); + + protected: + // Replaces |this| with |target|. |this| is a sentinel if and only if + // |target| is also a sentinel. + // + // If neither node is a sentinel, |target| takes + // the place of |this|. It is assumed that |target| is not in a list. + // + // If both are sentinels, then it will cause all of the + // nodes in the list containing |this| to be moved to the list containing + // |target|. In this case, it is assumed that |target| is an empty list. + // + // No storage will be deleted. + void ReplaceWith(NodeType* target); + + // Returns true if |this| is the sentinel node of an empty list. + bool IsEmptyList(); + + // The pointers to the next and previous nodes in the list. + // If the current node is not part of a list, then |next_node_| and + // |previous_node_| are equal to |nullptr|. + NodeType* next_node_; + NodeType* previous_node_; + + // Only true for the sentinel node stored in the list itself. + bool is_sentinel_; + + friend IntrusiveList; +}; + +// Implementation of IntrusiveNodeBase + +template +inline IntrusiveNodeBase::IntrusiveNodeBase() + : next_node_(nullptr), previous_node_(nullptr), is_sentinel_(false) {} + +template +inline IntrusiveNodeBase::IntrusiveNodeBase( + const IntrusiveNodeBase&) { + next_node_ = nullptr; + previous_node_ = nullptr; + is_sentinel_ = false; +} + +template +inline IntrusiveNodeBase& IntrusiveNodeBase::operator=( + const IntrusiveNodeBase&) { + assert(!is_sentinel_); + if (IsInAList()) { + RemoveFromList(); + } + return *this; +} + +template +inline IntrusiveNodeBase::IntrusiveNodeBase(IntrusiveNodeBase&& that) + : next_node_(nullptr), + previous_node_(nullptr), + is_sentinel_(that.is_sentinel_) { + if (is_sentinel_) { + next_node_ = this; + previous_node_ = this; + } + that.ReplaceWith(this); +} + +template +IntrusiveNodeBase::~IntrusiveNodeBase() { + assert(is_sentinel_ || !IsInAList()); +} + +template +IntrusiveNodeBase& IntrusiveNodeBase::operator=( + IntrusiveNodeBase&& that) { + that.ReplaceWith(this); + return *this; +} + +template +inline bool IntrusiveNodeBase::IsInAList() const { + return next_node_ != nullptr; +} + +template +inline NodeType* IntrusiveNodeBase::NextNode() const { + if (!next_node_->is_sentinel_) return next_node_; + return nullptr; +} + +template +inline NodeType* IntrusiveNodeBase::PreviousNode() const { + if (!previous_node_->is_sentinel_) return previous_node_; + return nullptr; +} + +template +inline void IntrusiveNodeBase::InsertBefore(NodeType* pos) { + assert(!this->is_sentinel_ && "Sentinel nodes cannot be moved around."); + assert(pos->IsInAList() && "Pos should already be in a list."); + if (this->IsInAList()) this->RemoveFromList(); + + this->next_node_ = pos; + this->previous_node_ = pos->previous_node_; + pos->previous_node_ = static_cast(this); + this->previous_node_->next_node_ = static_cast(this); +} + +template +inline void IntrusiveNodeBase::InsertAfter(NodeType* pos) { + assert(!this->is_sentinel_ && "Sentinel nodes cannot be moved around."); + assert(pos->IsInAList() && "Pos should already be in a list."); + if (this->IsInAList()) { + this->RemoveFromList(); + } + + this->previous_node_ = pos; + this->next_node_ = pos->next_node_; + pos->next_node_ = static_cast(this); + this->next_node_->previous_node_ = static_cast(this); +} + +template +inline void IntrusiveNodeBase::RemoveFromList() { + assert(!this->is_sentinel_ && "Sentinel nodes cannot be moved around."); + assert(this->IsInAList() && + "Cannot remove a node from a list if it is not in a list."); + + this->next_node_->previous_node_ = this->previous_node_; + this->previous_node_->next_node_ = this->next_node_; + this->next_node_ = nullptr; + this->previous_node_ = nullptr; +} + +template +void IntrusiveNodeBase::ReplaceWith(NodeType* target) { + if (this->is_sentinel_) { + assert(target->IsEmptyList() && + "If target is not an empty list, the nodes in that list would not " + "be linked to a sentinel."); + } else { + assert(IsInAList() && "The node being replaced must be in a list."); + assert(!target->is_sentinel_ && + "Cannot turn a sentinel node into one that is not."); + } + + if (!this->IsEmptyList()) { + // Link target into the same position that |this| was in. + target->next_node_ = this->next_node_; + target->previous_node_ = this->previous_node_; + target->next_node_->previous_node_ = target; + target->previous_node_->next_node_ = target; + + // Reset |this| to itself default value. + if (!this->is_sentinel_) { + // Reset |this| so that it is not in a list. + this->next_node_ = nullptr; + this->previous_node_ = nullptr; + } else { + // Set |this| so that it is the head of an empty list. + // We cannot treat sentinel nodes like others because it is invalid for + // a sentinel node to not be in a list. + this->next_node_ = static_cast(this); + this->previous_node_ = static_cast(this); + } + } else { + // If |this| points to itself, it must be a sentinel node with an empty + // list. Reset |this| so that it is the head of an empty list. We want + // |target| to be the same. The asserts above guarantee that. + } +} + +template +bool IntrusiveNodeBase::IsEmptyList() { + if (next_node_ == this) { + assert(is_sentinel_ && + "None sentinel nodes should never point to themselves."); + assert(previous_node_ == this && + "Inconsistency with the previous and next nodes."); + return true; + } + return false; +} + +} // namespace utils +} // namespace spvtools + +#endif // LIBSPIRV_OPT_ILIST_NODE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/move_to_front.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/move_to_front.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/move_to_front.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/move_to_front.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,825 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_UTIL_MOVE_TO_FRONT_H_ +#define LIBSPIRV_UTIL_MOVE_TO_FRONT_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace spvutils { + +// Log(n) move-to-front implementation. Implements the following functions: +// Insert - pushes value to the front of the mtf sequence +// (only unique values allowed). +// Remove - remove value from the sequence. +// ValueFromRank - access value by its 1-indexed rank in the sequence. +// RankFromValue - get the rank of the given value in the sequence. +// Accessing a value with ValueFromRank or RankFromValue moves the value to the +// front of the sequence (rank of 1). +// +// The implementation is based on an AVL-based order statistic tree. The tree +// is ordered by timestamps issued when values are inserted or accessed (recent +// values go to the left side of the tree, old values are gradually rotated to +// the right side). +// +// Terminology +// rank: 1-indexed rank showing how recently the value was inserted or accessed. +// node: handle used internally to access node data. +// size: size of the subtree of a node (including the node). +// height: distance from a node to the farthest leaf. +template +class MoveToFront { + public: + explicit MoveToFront(size_t reserve_capacity = 4) { + nodes_.reserve(reserve_capacity); + + // Create NIL node. + nodes_.emplace_back(Node()); + } + + virtual ~MoveToFront() {} + + // Inserts value in the move-to-front sequence. Does nothing if the value is + // already in the sequence. Returns true if insertion was successful. + // The inserted value is placed at the front of the sequence (rank 1). + bool Insert(const Val& value); + + // Removes value from move-to-front sequence. Returns false iff the value + // was not found. + bool Remove(const Val& value); + + // Computes 1-indexed rank of value in the move-to-front sequence and moves + // the value to the front. Example: + // Before the call: 4 8 2 1 7 + // RankFromValue(8) returns 2 + // After the call: 8 4 2 1 7 + // Returns true iff the value was found in the sequence. + bool RankFromValue(const Val& value, uint32_t* rank); + + // Returns value corresponding to a 1-indexed rank in the move-to-front + // sequence and moves the value to the front. Example: + // Before the call: 4 8 2 1 7 + // ValueFromRank(2) returns 8 + // After the call: 8 4 2 1 7 + // Returns true iff the rank is within bounds [1, GetSize()]. + bool ValueFromRank(uint32_t rank, Val* value); + + // Moves the value to the front of the sequence. + // Returns false iff value is not in the sequence. + bool Promote(const Val& value); + + // Returns true iff the move-to-front sequence contains the value. + bool HasValue(const Val& value) const; + + // Returns the number of elements in the move-to-front sequence. + uint32_t GetSize() const { return SizeOf(root_); } + + protected: + // Internal tree data structure uses handles instead of pointers. Leaves and + // root parent reference a singleton under handle 0. Although dereferencing + // a null pointer is not possible, inappropriate access to handle 0 would + // cause an assertion. Handles are not garbage collected if value was + // deprecated + // with DeprecateValue(). But handles are recycled when a node is + // repositioned. + + // Internal tree data structure node. + struct Node { + // Timestamp from a logical clock which updates every time the element is + // accessed through ValueFromRank or RankFromValue. + uint32_t timestamp = 0; + // The size of the node's subtree, including the node. + // SizeOf(LeftOf(node)) + SizeOf(RightOf(node)) + 1. + uint32_t size = 0; + // Handles to connected nodes. + uint32_t left = 0; + uint32_t right = 0; + uint32_t parent = 0; + // Distance to the farthest leaf. + // Leaves have height 0, real nodes at least 1. + uint32_t height = 0; + // Stored value. + Val value = Val(); + }; + + // Creates node and sets correct values. Non-NIL nodes should be created only + // through this function. If the node with this value has been created + // previously + // and since orphaned, reuses the old node instead of creating a new one. + uint32_t CreateNode(uint32_t timestamp, const Val& value) { + uint32_t handle = static_cast(nodes_.size()); + const auto result = value_to_node_.emplace(value, handle); + if (result.second) { + // Create new node. + nodes_.emplace_back(Node()); + Node& node = nodes_.back(); + node.timestamp = timestamp; + node.value = value; + node.size = 1; + // Non-NIL nodes start with height 1 because their NIL children are + // leaves. + node.height = 1; + } else { + // Reuse old node. + handle = result.first->second; + assert(!IsInTree(handle)); + assert(ValueOf(handle) == value); + assert(SizeOf(handle) == 1); + assert(HeightOf(handle) == 1); + MutableTimestampOf(handle) = timestamp; + } + + return handle; + } + + // Node accessor methods. Naming is designed to be similar to natural + // language as these functions tend to be used in sequences, for example: + // ParentOf(LeftestDescendentOf(RightOf(node))) + + // Returns value of the node referenced by |handle|. + Val ValueOf(uint32_t node) const { return nodes_.at(node).value; } + + // Returns left child of |node|. + uint32_t LeftOf(uint32_t node) const { return nodes_.at(node).left; } + + // Returns right child of |node|. + uint32_t RightOf(uint32_t node) const { return nodes_.at(node).right; } + + // Returns parent of |node|. + uint32_t ParentOf(uint32_t node) const { return nodes_.at(node).parent; } + + // Returns timestamp of |node|. + uint32_t TimestampOf(uint32_t node) const { + assert(node); + return nodes_.at(node).timestamp; + } + + // Returns size of |node|. + uint32_t SizeOf(uint32_t node) const { return nodes_.at(node).size; } + + // Returns height of |node|. + uint32_t HeightOf(uint32_t node) const { return nodes_.at(node).height; } + + // Returns mutable reference to value of |node|. + Val& MutableValueOf(uint32_t node) { + assert(node); + return nodes_.at(node).value; + } + + // Returns mutable reference to handle of left child of |node|. + uint32_t& MutableLeftOf(uint32_t node) { + assert(node); + return nodes_.at(node).left; + } + + // Returns mutable reference to handle of right child of |node|. + uint32_t& MutableRightOf(uint32_t node) { + assert(node); + return nodes_.at(node).right; + } + + // Returns mutable reference to handle of parent of |node|. + uint32_t& MutableParentOf(uint32_t node) { + assert(node); + return nodes_.at(node).parent; + } + + // Returns mutable reference to timestamp of |node|. + uint32_t& MutableTimestampOf(uint32_t node) { + assert(node); + return nodes_.at(node).timestamp; + } + + // Returns mutable reference to size of |node|. + uint32_t& MutableSizeOf(uint32_t node) { + assert(node); + return nodes_.at(node).size; + } + + // Returns mutable reference to height of |node|. + uint32_t& MutableHeightOf(uint32_t node) { + assert(node); + return nodes_.at(node).height; + } + + // Returns true iff |node| is left child of its parent. + bool IsLeftChild(uint32_t node) const { + assert(node); + return LeftOf(ParentOf(node)) == node; + } + + // Returns true iff |node| is right child of its parent. + bool IsRightChild(uint32_t node) const { + assert(node); + return RightOf(ParentOf(node)) == node; + } + + // Returns true iff |node| has no relatives. + bool IsOrphan(uint32_t node) const { + assert(node); + return !ParentOf(node) && !LeftOf(node) && !RightOf(node); + } + + // Returns true iff |node| is in the tree. + bool IsInTree(uint32_t node) const { + assert(node); + return node == root_ || !IsOrphan(node); + } + + // Returns the height difference between right and left subtrees. + int BalanceOf(uint32_t node) const { + return int(HeightOf(RightOf(node))) - int(HeightOf(LeftOf(node))); + } + + // Updates size and height of the node, assuming that the children have + // correct values. + void UpdateNode(uint32_t node); + + // Returns the most LeftOf(LeftOf(... descendent which is not leaf. + uint32_t LeftestDescendantOf(uint32_t node) const { + uint32_t parent = 0; + while (node) { + parent = node; + node = LeftOf(node); + } + return parent; + } + + // Returns the most RightOf(RightOf(... descendent which is not leaf. + uint32_t RightestDescendantOf(uint32_t node) const { + uint32_t parent = 0; + while (node) { + parent = node; + node = RightOf(node); + } + return parent; + } + + // Inserts node in the tree. The node must be an orphan. + void InsertNode(uint32_t node); + + // Removes node from the tree. May change value_to_node_ if removal uses a + // scapegoat. Returns the removed (orphaned) handle for recycling. The + // returned handle may not be equal to |node| if scapegoat was used. + uint32_t RemoveNode(uint32_t node); + + // Rotates |node| left, reassigns all connections and returns the node + // which takes place of the |node|. + uint32_t RotateLeft(const uint32_t node); + + // Rotates |node| right, reassigns all connections and returns the node + // which takes place of the |node|. + uint32_t RotateRight(const uint32_t node); + + // Root node handle. The tree is empty if root_ is 0. + uint32_t root_ = 0; + + // Incremented counters for next timestamp and value. + uint32_t next_timestamp_ = 1; + + // Holds all tree nodes. Indices of this vector are node handles. + std::vector nodes_; + + // Maps ids to node handles. + std::unordered_map value_to_node_; + + // Cache for the last accessed value in the sequence. + Val last_accessed_value_ = Val(); + bool last_accessed_value_valid_ = false; +}; + +template +class MultiMoveToFront { + public: + // Inserts |value| to sequence with handle |mtf|. + // Returns false if |mtf| already has |value|. + bool Insert(uint64_t mtf, const Val& value) { + if (GetMtf(mtf).Insert(value)) { + val_to_mtfs_[value].insert(mtf); + return true; + } + return false; + } + + // Removes |value| from sequence with handle |mtf|. + // Returns false if |mtf| doesn't have |value|. + bool Remove(uint64_t mtf, const Val& value) { + if (GetMtf(mtf).Remove(value)) { + val_to_mtfs_[value].erase(mtf); + return true; + } + assert(val_to_mtfs_[value].count(mtf) == 0); + return false; + } + + // Removes |value| from all sequences which have it. + void RemoveFromAll(const Val& value) { + auto it = val_to_mtfs_.find(value); + if (it == val_to_mtfs_.end()) return; + + auto& mtfs_containing_value = it->second; + for (uint64_t mtf : mtfs_containing_value) { + GetMtf(mtf).Remove(value); + } + + val_to_mtfs_.erase(value); + } + + // Computes rank of |value| in sequence |mtf|. + // Returns false if |mtf| doesn't have |value|. + bool RankFromValue(uint64_t mtf, const Val& value, uint32_t* rank) { + return GetMtf(mtf).RankFromValue(value, rank); + } + + // Finds |value| with |rank| in sequence |mtf|. + // Returns false if |rank| is out of bounds. + bool ValueFromRank(uint64_t mtf, uint32_t rank, Val* value) { + return GetMtf(mtf).ValueFromRank(rank, value); + } + + // Returns size of |mtf| sequence. + uint32_t GetSize(uint64_t mtf) { return GetMtf(mtf).GetSize(); } + + // Promotes |value| in all sequences which have it. + void Promote(const Val& value) { + const auto it = val_to_mtfs_.find(value); + if (it == val_to_mtfs_.end()) return; + + const auto& mtfs_containing_value = it->second; + for (uint64_t mtf : mtfs_containing_value) { + GetMtf(mtf).Promote(value); + } + } + + // Inserts |value| in sequence |mtf| or promotes if it's already there. + void InsertOrPromote(uint64_t mtf, const Val& value) { + if (!Insert(mtf, value)) { + GetMtf(mtf).Promote(value); + } + } + + // Returns if |mtf| sequence has |value|. + bool HasValue(uint64_t mtf, const Val& value) { + return GetMtf(mtf).HasValue(value); + } + + private: + // Returns actual MoveToFront object corresponding to |handle|. + // As multiple operations are often performed consecutively for the same + // sequence, the last returned value is cached. + MoveToFront& GetMtf(uint64_t handle) { + if (!cached_mtf_ || cached_handle_ != handle) { + cached_handle_ = handle; + cached_mtf_ = &mtfs_[handle]; + } + + return *cached_mtf_; + } + + // Container holding MoveToFront objects. Map key is sequence handle. + std::map> mtfs_; + + // Container mapping value to sequences which contain that value. + std::unordered_map> val_to_mtfs_; + + // Cache for the last accessed sequence. + uint64_t cached_handle_ = 0; + MoveToFront* cached_mtf_ = nullptr; +}; + +template +bool MoveToFront::Insert(const Val& value) { + auto it = value_to_node_.find(value); + if (it != value_to_node_.end() && IsInTree(it->second)) return false; + + const uint32_t old_size = GetSize(); + (void)old_size; + + InsertNode(CreateNode(next_timestamp_++, value)); + + last_accessed_value_ = value; + last_accessed_value_valid_ = true; + + assert(value_to_node_.count(value)); + assert(old_size + 1 == GetSize()); + return true; +} + +template +bool MoveToFront::Remove(const Val& value) { + auto it = value_to_node_.find(value); + if (it == value_to_node_.end()) return false; + + if (!IsInTree(it->second)) return false; + + if (last_accessed_value_ == value) last_accessed_value_valid_ = false; + + const uint32_t orphan = RemoveNode(it->second); + (void)orphan; + // The node of |value| is still alive but it's orphaned now. Can still be + // reused later. + assert(!IsInTree(orphan)); + assert(ValueOf(orphan) == value); + return true; +} + +template +bool MoveToFront::RankFromValue(const Val& value, uint32_t* rank) { + if (last_accessed_value_valid_ && last_accessed_value_ == value) { + *rank = 1; + return true; + } + + const uint32_t old_size = GetSize(); + if (old_size == 1) { + if (ValueOf(root_) == value) { + *rank = 1; + return true; + } else { + return false; + } + } + + const auto it = value_to_node_.find(value); + if (it == value_to_node_.end()) { + return false; + } + + uint32_t target = it->second; + + if (!IsInTree(target)) { + return false; + } + + uint32_t node = target; + *rank = 1 + SizeOf(LeftOf(node)); + while (node) { + if (IsRightChild(node)) *rank += 1 + SizeOf(LeftOf(ParentOf(node))); + node = ParentOf(node); + } + + // Don't update timestamp if the node has rank 1. + if (*rank != 1) { + // Update timestamp and reposition the node. + target = RemoveNode(target); + assert(ValueOf(target) == value); + assert(old_size == GetSize() + 1); + MutableTimestampOf(target) = next_timestamp_++; + InsertNode(target); + assert(old_size == GetSize()); + } + + last_accessed_value_ = value; + last_accessed_value_valid_ = true; + return true; +} + +template +bool MoveToFront::HasValue(const Val& value) const { + const auto it = value_to_node_.find(value); + if (it == value_to_node_.end()) { + return false; + } + + return IsInTree(it->second); +} + +template +bool MoveToFront::Promote(const Val& value) { + if (last_accessed_value_valid_ && last_accessed_value_ == value) { + return true; + } + + const uint32_t old_size = GetSize(); + if (old_size == 1) return ValueOf(root_) == value; + + const auto it = value_to_node_.find(value); + if (it == value_to_node_.end()) { + return false; + } + + uint32_t target = it->second; + + if (!IsInTree(target)) { + return false; + } + + // Update timestamp and reposition the node. + target = RemoveNode(target); + assert(ValueOf(target) == value); + assert(old_size == GetSize() + 1); + MutableTimestampOf(target) = next_timestamp_++; + InsertNode(target); + assert(old_size == GetSize()); + + last_accessed_value_ = value; + last_accessed_value_valid_ = true; + return true; +} + +template +bool MoveToFront::ValueFromRank(uint32_t rank, Val* value) { + if (last_accessed_value_valid_ && rank == 1) { + *value = last_accessed_value_; + return true; + } + + const uint32_t old_size = GetSize(); + if (rank <= 0 || rank > old_size) { + return false; + } + + if (old_size == 1) { + *value = ValueOf(root_); + return true; + } + + const bool update_timestamp = (rank != 1); + + uint32_t node = root_; + while (node) { + const uint32_t left_subtree_num_nodes = SizeOf(LeftOf(node)); + if (rank == left_subtree_num_nodes + 1) { + // This is the node we are looking for. + // Don't update timestamp if the node has rank 1. + if (update_timestamp) { + node = RemoveNode(node); + assert(old_size == GetSize() + 1); + MutableTimestampOf(node) = next_timestamp_++; + InsertNode(node); + assert(old_size == GetSize()); + } + *value = ValueOf(node); + last_accessed_value_ = *value; + last_accessed_value_valid_ = true; + return true; + } + + if (rank < left_subtree_num_nodes + 1) { + // Descend into the left subtree. The rank is still valid. + node = LeftOf(node); + } else { + // Descend into the right subtree. We leave behind the left subtree and + // the current node, adjust the |rank| accordingly. + rank -= left_subtree_num_nodes + 1; + node = RightOf(node); + } + } + + assert(0); + return false; +} + +template +void MoveToFront::InsertNode(uint32_t node) { + assert(!IsInTree(node)); + assert(SizeOf(node) == 1); + assert(HeightOf(node) == 1); + assert(TimestampOf(node)); + + if (!root_) { + root_ = node; + return; + } + + uint32_t iter = root_; + uint32_t parent = 0; + + // Will determine if |node| will become the right or left child after + // insertion (but before balancing). + bool right_child = true; + + // Find the node which will become |node|'s parent after insertion + // (but before balancing). + while (iter) { + parent = iter; + assert(TimestampOf(iter) != TimestampOf(node)); + right_child = TimestampOf(iter) > TimestampOf(node); + iter = right_child ? RightOf(iter) : LeftOf(iter); + } + + assert(parent); + + // Connect node and parent. + MutableParentOf(node) = parent; + if (right_child) + MutableRightOf(parent) = node; + else + MutableLeftOf(parent) = node; + + // Insertion is finished. Start the balancing process. + bool needs_rebalancing = true; + parent = ParentOf(node); + + while (parent) { + UpdateNode(parent); + + if (needs_rebalancing) { + const int parent_balance = BalanceOf(parent); + + if (RightOf(parent) == node) { + // Added node to the right subtree. + if (parent_balance > 1) { + // Parent is right heavy, rotate left. + if (BalanceOf(node) < 0) RotateRight(node); + parent = RotateLeft(parent); + } else if (parent_balance == 0 || parent_balance == -1) { + // Parent is balanced or left heavy, no need to balance further. + needs_rebalancing = false; + } + } else { + // Added node to the left subtree. + if (parent_balance < -1) { + // Parent is left heavy, rotate right. + if (BalanceOf(node) > 0) RotateLeft(node); + parent = RotateRight(parent); + } else if (parent_balance == 0 || parent_balance == 1) { + // Parent is balanced or right heavy, no need to balance further. + needs_rebalancing = false; + } + } + } + + assert(BalanceOf(parent) >= -1 && (BalanceOf(parent) <= 1)); + + node = parent; + parent = ParentOf(parent); + } +} + +template +uint32_t MoveToFront::RemoveNode(uint32_t node) { + if (LeftOf(node) && RightOf(node)) { + // If |node| has two children, then use another node as scapegoat and swap + // their contents. We pick the scapegoat on the side of the tree which has + // more nodes. + const uint32_t scapegoat = SizeOf(LeftOf(node)) >= SizeOf(RightOf(node)) + ? RightestDescendantOf(LeftOf(node)) + : LeftestDescendantOf(RightOf(node)); + assert(scapegoat); + std::swap(MutableValueOf(node), MutableValueOf(scapegoat)); + std::swap(MutableTimestampOf(node), MutableTimestampOf(scapegoat)); + value_to_node_[ValueOf(node)] = node; + value_to_node_[ValueOf(scapegoat)] = scapegoat; + node = scapegoat; + } + + // |node| may have only one child at this point. + assert(!RightOf(node) || !LeftOf(node)); + + uint32_t parent = ParentOf(node); + uint32_t child = RightOf(node) ? RightOf(node) : LeftOf(node); + + // Orphan |node| and reconnect parent and child. + if (child) MutableParentOf(child) = parent; + + if (parent) { + if (LeftOf(parent) == node) + MutableLeftOf(parent) = child; + else + MutableRightOf(parent) = child; + } + + MutableParentOf(node) = 0; + MutableLeftOf(node) = 0; + MutableRightOf(node) = 0; + UpdateNode(node); + const uint32_t orphan = node; + + if (root_ == node) root_ = child; + + // Removal is finished. Start the balancing process. + bool needs_rebalancing = true; + node = child; + + while (parent) { + UpdateNode(parent); + + if (needs_rebalancing) { + const int parent_balance = BalanceOf(parent); + + if (parent_balance == 1 || parent_balance == -1) { + // The height of the subtree was not changed. + needs_rebalancing = false; + } else { + if (RightOf(parent) == node) { + // Removed node from the right subtree. + if (parent_balance < -1) { + // Parent is left heavy, rotate right. + const uint32_t sibling = LeftOf(parent); + if (BalanceOf(sibling) > 0) RotateLeft(sibling); + parent = RotateRight(parent); + } + } else { + // Removed node from the left subtree. + if (parent_balance > 1) { + // Parent is right heavy, rotate left. + const uint32_t sibling = RightOf(parent); + if (BalanceOf(sibling) < 0) RotateRight(sibling); + parent = RotateLeft(parent); + } + } + } + } + + assert(BalanceOf(parent) >= -1 && (BalanceOf(parent) <= 1)); + + node = parent; + parent = ParentOf(parent); + } + + return orphan; +} + +template +uint32_t MoveToFront::RotateLeft(const uint32_t node) { + const uint32_t pivot = RightOf(node); + assert(pivot); + + // LeftOf(pivot) gets attached to node in place of pivot. + MutableRightOf(node) = LeftOf(pivot); + if (RightOf(node)) MutableParentOf(RightOf(node)) = node; + + // Pivot gets attached to ParentOf(node) in place of node. + MutableParentOf(pivot) = ParentOf(node); + if (!ParentOf(node)) + root_ = pivot; + else if (IsLeftChild(node)) + MutableLeftOf(ParentOf(node)) = pivot; + else + MutableRightOf(ParentOf(node)) = pivot; + + // Node is child of pivot. + MutableLeftOf(pivot) = node; + MutableParentOf(node) = pivot; + + // Update both node and pivot. Pivot is the new parent of node, so node should + // be updated first. + UpdateNode(node); + UpdateNode(pivot); + + return pivot; +} + +template +uint32_t MoveToFront::RotateRight(const uint32_t node) { + const uint32_t pivot = LeftOf(node); + assert(pivot); + + // RightOf(pivot) gets attached to node in place of pivot. + MutableLeftOf(node) = RightOf(pivot); + if (LeftOf(node)) MutableParentOf(LeftOf(node)) = node; + + // Pivot gets attached to ParentOf(node) in place of node. + MutableParentOf(pivot) = ParentOf(node); + if (!ParentOf(node)) + root_ = pivot; + else if (IsLeftChild(node)) + MutableLeftOf(ParentOf(node)) = pivot; + else + MutableRightOf(ParentOf(node)) = pivot; + + // Node is child of pivot. + MutableRightOf(pivot) = node; + MutableParentOf(node) = pivot; + + // Update both node and pivot. Pivot is the new parent of node, so node should + // be updated first. + UpdateNode(node); + UpdateNode(pivot); + + return pivot; +} + +template +void MoveToFront::UpdateNode(uint32_t node) { + MutableSizeOf(node) = 1 + SizeOf(LeftOf(node)) + SizeOf(RightOf(node)); + MutableHeightOf(node) = + 1 + std::max(HeightOf(LeftOf(node)), HeightOf(RightOf(node))); +} + +} // namespace spvutils + +#endif // LIBSPIRV_UTIL_MOVE_TO_FRONT_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/parse_number.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/parse_number.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/parse_number.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/parse_number.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,214 @@ +// Copyright (c) 2016 Google 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. + +#include "util/parse_number.h" + +#include +#include +#include +#include +#include +#include + +#include "util/hex_float.h" + +namespace spvutils { + +namespace { +// A helper class that temporarily stores error messages and dump the messages +// to a string which given as as pointer when it is destructed. If the given +// pointer is a nullptr, this class does not store error message. +class ErrorMsgStream { + public: + explicit ErrorMsgStream(std::string* error_msg_sink) + : error_msg_sink_(error_msg_sink) { + if (error_msg_sink_) stream_.reset(new std::ostringstream()); + } + ~ErrorMsgStream() { + if (error_msg_sink_ && stream_) *error_msg_sink_ = stream_->str(); + } + template + ErrorMsgStream& operator<<(T val) { + if (stream_) *stream_ << val; + return *this; + } + + private: + std::unique_ptr stream_; + // The destination string to which this class dump the error message when + // destructor is called. + std::string* error_msg_sink_; +}; +} // namespace + +EncodeNumberStatus ParseAndEncodeIntegerNumber( + const char* text, const NumberType& type, + std::function emit, std::string* error_msg) { + if (!text) { + ErrorMsgStream(error_msg) << "The given text is a nullptr"; + return EncodeNumberStatus::kInvalidText; + } + + if (!IsIntegral(type)) { + ErrorMsgStream(error_msg) << "The expected type is not a integer type"; + return EncodeNumberStatus::kInvalidUsage; + } + + const uint32_t bit_width = AssumedBitWidth(type); + + if (bit_width > 64) { + ErrorMsgStream(error_msg) + << "Unsupported " << bit_width << "-bit integer literals"; + return EncodeNumberStatus::kUnsupported; + } + + // Either we are expecting anything or integer. + bool is_negative = text[0] == '-'; + bool can_be_signed = IsSigned(type); + + if (is_negative && !can_be_signed) { + ErrorMsgStream(error_msg) + << "Cannot put a negative number in an unsigned literal"; + return EncodeNumberStatus::kInvalidUsage; + } + + const bool is_hex = text[0] == '0' && (text[1] == 'x' || text[1] == 'X'); + + uint64_t decoded_bits; + if (is_negative) { + int64_t decoded_signed = 0; + + if (!ParseNumber(text, &decoded_signed)) { + ErrorMsgStream(error_msg) << "Invalid signed integer literal: " << text; + return EncodeNumberStatus::kInvalidText; + } + + if (!CheckRangeAndIfHexThenSignExtend(decoded_signed, type, is_hex, + &decoded_signed)) { + ErrorMsgStream(error_msg) + << "Integer " << (is_hex ? std::hex : std::dec) << std::showbase + << decoded_signed << " does not fit in a " << std::dec << bit_width + << "-bit " << (IsSigned(type) ? "signed" : "unsigned") << " integer"; + return EncodeNumberStatus::kInvalidText; + } + decoded_bits = decoded_signed; + } else { + // There's no leading minus sign, so parse it as an unsigned integer. + if (!ParseNumber(text, &decoded_bits)) { + ErrorMsgStream(error_msg) << "Invalid unsigned integer literal: " << text; + return EncodeNumberStatus::kInvalidText; + } + if (!CheckRangeAndIfHexThenSignExtend(decoded_bits, type, is_hex, + &decoded_bits)) { + ErrorMsgStream(error_msg) + << "Integer " << (is_hex ? std::hex : std::dec) << std::showbase + << decoded_bits << " does not fit in a " << std::dec << bit_width + << "-bit " << (IsSigned(type) ? "signed" : "unsigned") << " integer"; + return EncodeNumberStatus::kInvalidText; + } + } + if (bit_width > 32) { + uint32_t low = uint32_t(0x00000000ffffffff & decoded_bits); + uint32_t high = uint32_t((0xffffffff00000000 & decoded_bits) >> 32); + emit(low); + emit(high); + } else { + emit(uint32_t(decoded_bits)); + } + return EncodeNumberStatus::kSuccess; +} + +EncodeNumberStatus ParseAndEncodeFloatingPointNumber( + const char* text, const NumberType& type, + std::function emit, std::string* error_msg) { + if (!text) { + ErrorMsgStream(error_msg) << "The given text is a nullptr"; + return EncodeNumberStatus::kInvalidText; + } + + if (!IsFloating(type)) { + ErrorMsgStream(error_msg) << "The expected type is not a float type"; + return EncodeNumberStatus::kInvalidUsage; + } + + const auto bit_width = AssumedBitWidth(type); + switch (bit_width) { + case 16: { + HexFloat> hVal(0); + if (!ParseNumber(text, &hVal)) { + ErrorMsgStream(error_msg) << "Invalid 16-bit float literal: " << text; + return EncodeNumberStatus::kInvalidText; + } + // getAsFloat will return the spvutils::Float16 value, and get_value + // will return a uint16_t representing the bits of the float. + // The encoding is therefore correct from the perspective of the SPIR-V + // spec since the top 16 bits will be 0. + emit(static_cast(hVal.value().getAsFloat().get_value())); + return EncodeNumberStatus::kSuccess; + } break; + case 32: { + HexFloat> fVal(0.0f); + if (!ParseNumber(text, &fVal)) { + ErrorMsgStream(error_msg) << "Invalid 32-bit float literal: " << text; + return EncodeNumberStatus::kInvalidText; + } + emit(BitwiseCast(fVal)); + return EncodeNumberStatus::kSuccess; + } break; + case 64: { + HexFloat> dVal(0.0); + if (!ParseNumber(text, &dVal)) { + ErrorMsgStream(error_msg) << "Invalid 64-bit float literal: " << text; + return EncodeNumberStatus::kInvalidText; + } + uint64_t decoded_val = BitwiseCast(dVal); + uint32_t low = uint32_t(0x00000000ffffffff & decoded_val); + uint32_t high = uint32_t((0xffffffff00000000 & decoded_val) >> 32); + emit(low); + emit(high); + return EncodeNumberStatus::kSuccess; + } break; + default: + break; + } + ErrorMsgStream(error_msg) + << "Unsupported " << bit_width << "-bit float literals"; + return EncodeNumberStatus::kUnsupported; +} + +EncodeNumberStatus ParseAndEncodeNumber(const char* text, + const NumberType& type, + std::function emit, + std::string* error_msg) { + if (!text) { + ErrorMsgStream(error_msg) << "The given text is a nullptr"; + return EncodeNumberStatus::kInvalidText; + } + + if (IsUnknown(type)) { + ErrorMsgStream(error_msg) + << "The expected type is not a integer or float type"; + return EncodeNumberStatus::kInvalidUsage; + } + + // If we explicitly expect a floating-point number, we should handle that + // first. + if (IsFloating(type)) { + return ParseAndEncodeFloatingPointNumber(text, type, emit, error_msg); + } + + return ParseAndEncodeIntegerNumber(text, type, emit, error_msg); +} + +} // namespace spvutils diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/parse_number.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/parse_number.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/parse_number.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/parse_number.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,250 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_UTIL_PARSE_NUMBER_H_ +#define LIBSPIRV_UTIL_PARSE_NUMBER_H_ + +#include +#include +#include + +#include "spirv-tools/libspirv.h" +#include "util/hex_float.h" + +namespace spvutils { + +// A struct to hold the expected type information for the number in text to be +// parsed. +struct NumberType { + uint32_t bitwidth; + // SPV_NUMBER_NONE means the type is unknown and is invalid to be used with + // ParseAndEncode{|Integer|Floating}Number(). + spv_number_kind_t kind; +}; + +// Returns true if the type is a scalar integer type. +inline bool IsIntegral(const NumberType& type) { + return type.kind == SPV_NUMBER_UNSIGNED_INT || + type.kind == SPV_NUMBER_SIGNED_INT; +} + +// Returns true if the type is a scalar floating point type. +inline bool IsFloating(const NumberType& type) { + return type.kind == SPV_NUMBER_FLOATING; +} + +// Returns true if the type is a signed value. +inline bool IsSigned(const NumberType& type) { + return type.kind == SPV_NUMBER_FLOATING || type.kind == SPV_NUMBER_SIGNED_INT; +} + +// Returns true if the type is unknown. +inline bool IsUnknown(const NumberType& type) { + return type.kind == SPV_NUMBER_NONE; +} + +// Returns the number of bits in the type. This is only valid for integer and +// floating types. +inline int AssumedBitWidth(const NumberType& type) { + switch (type.kind) { + case SPV_NUMBER_SIGNED_INT: + case SPV_NUMBER_UNSIGNED_INT: + case SPV_NUMBER_FLOATING: + return type.bitwidth; + default: + break; + } + // We don't care about this case. + return 0; +} + +// A templated class with a static member function Clamp, where Clamp sets a +// referenced value of type T to 0 if T is an unsigned integer type, and +// returns true if it modified the referenced value. +template +class ClampToZeroIfUnsignedType { + public: + // The default specialization does not clamp the value. + static bool Clamp(T*) { return false; } +}; + +// The specialization of ClampToZeroIfUnsignedType for unsigned integer types. +template +class ClampToZeroIfUnsignedType< + T, typename std::enable_if::value>::type> { + public: + static bool Clamp(T* value_pointer) { + if (*value_pointer) { + *value_pointer = 0; + return true; + } + return false; + } +}; + +// Returns true if the given value fits within the target scalar integral type. +// The target type may have an unusual bit width. If the value was originally +// specified as a hexadecimal number, then the overflow bits should be zero. +// If it was hex and the target type is signed, then return the sign-extended +// value through the updated_value_for_hex pointer argument. On failure, +// returns false. +template +bool CheckRangeAndIfHexThenSignExtend(T value, const NumberType& type, + bool is_hex, T* updated_value_for_hex) { + // The encoded result has three regions of bits that are of interest, from + // least to most significant: + // - magnitude bits, where the magnitude of the number would be stored if + // we were using a signed-magnitude representation. + // - an optional sign bit + // - overflow bits, up to bit 63 of a 64-bit number + // For example: + // Type Overflow Sign Magnitude + // --------------- -------- ---- --------- + // unsigned 8 bit 8-63 n/a 0-7 + // signed 8 bit 8-63 7 0-6 + // unsigned 16 bit 16-63 n/a 0-15 + // signed 16 bit 16-63 15 0-14 + + // We'll use masks to define the three regions. + // At first we'll assume the number is unsigned. + const uint32_t bit_width = AssumedBitWidth(type); + uint64_t magnitude_mask = + (bit_width == 64) ? -1 : ((uint64_t(1) << bit_width) - 1); + uint64_t sign_mask = 0; + uint64_t overflow_mask = ~magnitude_mask; + + if (value < 0 || IsSigned(type)) { + // Accommodate the sign bit. + magnitude_mask >>= 1; + sign_mask = magnitude_mask + 1; + } + + bool failed = false; + if (value < 0) { + // The top bits must all be 1 for a negative signed value. + failed = ((value & overflow_mask) != overflow_mask) || + ((value & sign_mask) != sign_mask); + } else { + if (is_hex) { + // Hex values are a bit special. They decode as unsigned values, but may + // represent a negative number. In this case, the overflow bits should + // be zero. + failed = (value & overflow_mask) != 0; + } else { + const uint64_t value_as_u64 = static_cast(value); + // Check overflow in the ordinary case. + failed = (value_as_u64 & magnitude_mask) != value_as_u64; + } + } + + if (failed) { + return false; + } + + // Sign extend hex the number. + if (is_hex && (value & sign_mask)) + *updated_value_for_hex = (value | overflow_mask); + + return true; +} + +// Parses a numeric value of a given type from the given text. The number +// should take up the entire string, and should be within bounds for the target +// type. On success, returns true and populates the object referenced by +// value_pointer. On failure, returns false. +template +bool ParseNumber(const char* text, T* value_pointer) { + // C++11 doesn't define std::istringstream(int8_t&), so calling this method + // with a single-byte type leads to implementation-defined behaviour. + // Similarly for uint8_t. + static_assert(sizeof(T) > 1, + "Single-byte types are not supported in this parse method"); + + if (!text) return false; + std::istringstream text_stream(text); + // Allow both decimal and hex input for integers. + // It also allows octal input, but we don't care about that case. + text_stream >> std::setbase(0); + text_stream >> *value_pointer; + + // We should have read something. + bool ok = (text[0] != 0) && !text_stream.bad(); + // It should have been all the text. + ok = ok && text_stream.eof(); + // It should have been in range. + ok = ok && !text_stream.fail(); + + // Work around a bug in the GNU C++11 library. It will happily parse + // "-1" for uint16_t as 65535. + if (ok && text[0] == '-') + ok = !ClampToZeroIfUnsignedType::Clamp(value_pointer); + + return ok; +} + +// Enum to indicate the parsing and encoding status. +enum class EncodeNumberStatus { + kSuccess = 0, + // Unsupported bit width etc. + kUnsupported, + // Expected type (NumberType) is not a scalar int or float, or putting a + // negative number in an unsigned literal. + kInvalidUsage, + // Number value does not fit the bit width of the expected type etc. + kInvalidText, +}; + +// Parses an integer value of a given |type| from the given |text| and encodes +// the number by the given |emit| function. On success, returns +// EncodeNumberStatus::kSuccess and the parsed number will be consumed by the +// given |emit| function word by word (least significant word first). On +// failure, this function returns the error code of the encoding status and +// |emit| function will not be called. If the string pointer |error_msg| is not +// a nullptr, it will be overwritten with error messages in case of failure. In +// case of success, |error_msg| will not be touched. Integers up to 64 bits are +// supported. +EncodeNumberStatus ParseAndEncodeIntegerNumber( + const char* text, const NumberType& type, + std::function emit, std::string* error_msg); + +// Parses a floating point value of a given |type| from the given |text| and +// encodes the number by the given |emit| funciton. On success, returns +// EncodeNumberStatus::kSuccess and the parsed number will be consumed by the +// given |emit| function word by word (least significant word first). On +// failure, this function returns the error code of the encoding status and +// |emit| function will not be called. If the string pointer |error_msg| is not +// a nullptr, it will be overwritten with error messages in case of failure. In +// case of success, |error_msg| will not be touched. Only 16, 32 and 64 bit +// floating point numbers are supported. +EncodeNumberStatus ParseAndEncodeFloatingPointNumber( + const char* text, const NumberType& type, + std::function emit, std::string* error_msg); + +// Parses an integer or floating point number of a given |type| from the given +// |text| and encodes the number by the given |emit| function. On success, +// returns EncodeNumberStatus::kSuccess and the parsed number will be consumed +// by the given |emit| function word by word (least significant word first). On +// failure, this function returns the error code of the encoding status and +// |emit| function will not be called. If the string pointer |error_msg| is not +// a nullptr, it will be overwritten with error messages in case of failure. In +// case of success, |error_msg| will not be touched. Integers up to 64 bits +// and 16/32/64 bit floating point values are supported. +EncodeNumberStatus ParseAndEncodeNumber(const char* text, + const NumberType& type, + std::function emit, + std::string* error_msg); + +} // namespace spvutils + +#endif // LIBSPIRV_UTIL_PARSE_NUMBER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/string_utils.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/string_utils.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/string_utils.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/string_utils.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,39 @@ +// Copyright (c) 2017 Google 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. + +#include +#include +#include + +#include "util/string_utils.h" + +namespace spvutils { + +std::string CardinalToOrdinal(size_t cardinal) { + const size_t mod10 = cardinal % 10; + const size_t mod100 = cardinal % 100; + std::string suffix; + if (mod10 == 1 && mod100 != 11) + suffix = "st"; + else if (mod10 == 2 && mod100 != 12) + suffix = "nd"; + else if (mod10 == 3 && mod100 != 13) + suffix = "rd"; + else + suffix = "th"; + + return ToString(cardinal) + suffix; +} + +} // namespace spvutils diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/string_utils.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/string_utils.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/string_utils.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/string_utils.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,40 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_UTIL_STRING_UTILS_H_ +#define LIBSPIRV_UTIL_STRING_UTILS_H_ + +#include +#include + +#include "util/string_utils.h" + +namespace spvutils { + +// Converts arithmetic value |val| to its default string representation. +template +std::string ToString(T val) { + static_assert(std::is_arithmetic::value, + "spvutils::ToString is restricted to only arithmetic values"); + std::stringstream os; + os << val; + return os.str(); +} + +// Converts cardinal number to ordinal number string. +std::string CardinalToOrdinal(size_t cardinal); + +} // namespace spvutils + +#endif // LIBSPIRV_UTIL_STRING_UTILS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/timer.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/timer.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/timer.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/timer.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,100 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "util/timer.h" + +#include +#include +#include +#include +#include + +namespace spvutils { + +#if defined(SPIRV_TIMER_ENABLED) + +void PrintTimerDescription(std::ostream* out, bool measure_mem_usage) { + if (out) { + *out << std::setw(30) << "PASS name" << std::setw(12) << "CPU time" + << std::setw(12) << "WALL time" << std::setw(12) << "USR time" + << std::setw(12) << "SYS time"; + if (measure_mem_usage) { + *out << std::setw(12) << "RSS delta" << std::setw(16) << "PGFault delta"; + } + *out << std::endl; + } +} + +// Do not change the order of invoking system calls. We want to make CPU/Wall +// time correct as much as possible. Calling functions to get CPU/Wall time must +// closely surround the target code of measuring. +void Timer::Start() { + if (report_stream_) { + if (getrusage(RUSAGE_SELF, &usage_before_) == -1) + usage_status_ |= kGetrusageFailed; + if (clock_gettime(CLOCK_MONOTONIC, &wall_before_) == -1) + usage_status_ |= kClockGettimeWalltimeFailed; + if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &cpu_before_) == -1) + usage_status_ |= kClockGettimeCPUtimeFailed; + } +} + +// The order of invoking system calls is important with the same reason as +// Timer::Start(). +void Timer::Stop() { + if (report_stream_ && usage_status_ == kSucceeded) { + if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &cpu_after_) == -1) + usage_status_ |= kClockGettimeCPUtimeFailed; + if (clock_gettime(CLOCK_MONOTONIC, &wall_after_) == -1) + usage_status_ |= kClockGettimeWalltimeFailed; + if (getrusage(RUSAGE_SELF, &usage_after_) == -1) + usage_status_ = kGetrusageFailed; + } +} + +void Timer::Report(const char* tag) { + if (!report_stream_) return; + + report_stream_->precision(2); + *report_stream_ << std::fixed << std::setw(30) << tag; + + if (usage_status_ & kClockGettimeCPUtimeFailed) + *report_stream_ << std::setw(12) << "Failed"; + else + *report_stream_ << std::setw(12) << CPUTime(); + + if (usage_status_ & kClockGettimeWalltimeFailed) + *report_stream_ << std::setw(12) << "Failed"; + else + *report_stream_ << std::setw(12) << WallTime(); + + if (usage_status_ & kGetrusageFailed) { + *report_stream_ << std::setw(12) << "Failed" << std::setw(12) << "Failed"; + if (measure_mem_usage_) { + *report_stream_ << std::setw(12) << "Failed" << std::setw(12) << "Failed"; + } + } else { + *report_stream_ << std::setw(12) << UserTime() << std::setw(12) + << SystemTime(); + if (measure_mem_usage_) { + *report_stream_ << std::fixed << std::setw(12) << RSS() << std::setw(16) + << PageFault(); + } + } + *report_stream_ << std::endl; +} + +#endif // defined(SPIRV_TIMER_ENABLED) + +} // namespace spvutils diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/timer.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/timer.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/util/timer.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/util/timer.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,387 @@ +// Copyright (c) 2018 Google LLC. +// +// 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. + +// Contains utils for getting resource utilization + +#ifndef LIBSPIRV_UTIL_TIMER_H_ +#define LIBSPIRV_UTIL_TIMER_H_ + +#if defined(SPIRV_TIMER_ENABLED) + +#include +#include +#include + +// A macro to call spvutils::PrintTimerDescription(std::ostream*, bool). The +// first argument must be given as std::ostream*. If it is NULL, the function +// does nothing. Otherwise, it prints resource types measured by Timer class. +// The second is optional and if it is true, the function also prints resource +// type fields related to memory. Otherwise, it does not print memory related +// fields. Its default is false. In usual, this must be placed before calling +// Timer::Report() to inform what those fields printed by Timer::Report() +// indicate (or spvutils::PrintTimerDescription() must be used instead). +#define SPIRV_TIMER_DESCRIPTION(...) \ + spvutils::PrintTimerDescription(__VA_ARGS__) + +// Creates an object of ScopedTimer to measure the resource utilization for the +// scope surrounding it as the following example: +// +// { // <-- beginning of this scope +// +// /* ... code out of interest ... */ +// +// SPIRV_TIMER_SCOPED(std::cout, tag); +// +// /* ... lines of code that we want to know its resource usage ... */ +// +// } // <-- end of this scope. The destructor of ScopedTimer prints tag and +// the resource utilization to std::cout. +#define SPIRV_TIMER_SCOPED(...) \ + spvutils::ScopedTimer timer##__LINE__(__VA_ARGS__) + +namespace spvutils { + +// Prints the description of resource types measured by Timer class. If |out| is +// NULL, it does nothing. Otherwise, it prints resource types. The second is +// optional and if it is true, the function also prints resource type fields +// related to memory. Its default is false. In usual, this must be placed before +// calling Timer::Report() to inform what those fields printed by +// Timer::Report() indicate. +void PrintTimerDescription(std::ostream*, bool = false); + +// Status of Timer. kGetrusageFailed means it failed in calling getrusage(). +// kClockGettimeWalltimeFailed means it failed in getting wall time when calling +// clock_gettime(). kClockGettimeCPUtimeFailed means it failed in getting CPU +// time when calling clock_gettime(). +enum UsageStatus { + kSucceeded = 0, + kGetrusageFailed = 1 << 0, + kClockGettimeWalltimeFailed = 1 << 1, + kClockGettimeCPUtimeFailed = 1 << 2, +}; + +// Timer measures the resource utilization for a range of code. The resource +// utilization consists of CPU time (i.e., process time), WALL time (elapsed +// time), USR time, SYS time, RSS delta, and the delta of the number of page +// faults. RSS delta and the delta of the number of page faults are measured +// only when |measure_mem_usage| given to the constructor is true. This class +// should be used as the following example: +// +// spvutils::Timer timer(std::cout); +// timer.Start(); // <-- set |usage_before_|, |wall_before_|, +// and |cpu_before_| +// +// /* ... lines of code that we want to know its resource usage ... */ +// +// timer.Stop(); // <-- set |cpu_after_|, |wall_after_|, and +// |usage_after_| +// timer.Report(tag); // <-- print tag and the resource utilization to +// std::cout. +class Timer { + public: + Timer(std::ostream* out, bool measure_mem_usage = false) + : report_stream_(out), + usage_status_(kSucceeded), + measure_mem_usage_(measure_mem_usage) {} + + // Sets |usage_before_|, |wall_before_|, and |cpu_before_| as results of + // getrusage(), clock_gettime() for the wall time, and clock_gettime() for the + // CPU time respectively. Note that this method erases all previous state of + // |usage_before_|, |wall_before_|, |cpu_before_|. + virtual void Start(); + + // Sets |cpu_after_|, |wall_after_|, and |usage_after_| as results of + // clock_gettime() for the wall time, and clock_gettime() for the CPU time, + // getrusage() respectively. Note that this method erases all previous state + // of |cpu_after_|, |wall_after_|, |usage_after_|. + virtual void Stop(); + + // If |report_stream_| is NULL, it does nothing. Otherwise, it prints the + // resource utilization (i.e., CPU/WALL/USR/SYS time, RSS delta) between the + // time of calling Timer::Start() and the time of calling Timer::Stop(). If we + // cannot get a resource usage because of failures, it prints "Failed" instead + // for the resource. + void Report(const char* tag); + + // Returns the measured CPU Time (i.e., process time) for a range of code + // execution. If kClockGettimeCPUtimeFailed is set by the failure of calling + // clock_gettime(), it returns -1. + virtual double CPUTime() { + if (usage_status_ & kClockGettimeCPUtimeFailed) return -1; + return TimeDifference(cpu_before_, cpu_after_); + } + + // Returns the measured Wall Time (i.e., elapsed time) for a range of code + // execution. If kClockGettimeWalltimeFailed is set by the failure of + // calling clock_gettime(), it returns -1. + virtual double WallTime() { + if (usage_status_ & kClockGettimeWalltimeFailed) return -1; + return TimeDifference(wall_before_, wall_after_); + } + + // Returns the measured USR Time for a range of code execution. If + // kGetrusageFailed is set because of the failure of calling getrusage(), it + // returns -1. + virtual double UserTime() { + if (usage_status_ & kGetrusageFailed) return -1; + return TimeDifference(usage_before_.ru_utime, usage_after_.ru_utime); + } + + // Returns the measured SYS Time for a range of code execution. If + // kGetrusageFailed is set because of the failure of calling getrusage(), it + // returns -1. + virtual double SystemTime() { + if (usage_status_ & kGetrusageFailed) return -1; + return TimeDifference(usage_before_.ru_stime, usage_after_.ru_stime); + } + + // Returns the measured RSS delta for a range of code execution. If + // kGetrusageFailed is set because of the failure of calling getrusage(), it + // returns -1. + virtual long RSS() const { + if (usage_status_ & kGetrusageFailed) return -1; + return usage_after_.ru_maxrss - usage_before_.ru_maxrss; + } + + // Returns the measured the delta of the number of page faults for a range of + // code execution. If kGetrusageFailed is set because of the failure of + // calling getrusage(), it returns -1. + virtual long PageFault() const { + if (usage_status_ & kGetrusageFailed) return -1; + return (usage_after_.ru_minflt - usage_before_.ru_minflt) + + (usage_after_.ru_majflt - usage_before_.ru_majflt); + } + + virtual ~Timer() {} + + private: + // Returns the time gap between |from| and |to| in seconds. + static double TimeDifference(const timeval& from, const timeval& to) { + assert((to.tv_sec > from.tv_sec) || + (to.tv_sec == from.tv_sec && to.tv_usec >= from.tv_usec)); + return static_cast(to.tv_sec - from.tv_sec) + + static_cast(to.tv_usec - from.tv_usec) * .000001; + } + + // Returns the time gap between |from| and |to| in seconds. + static double TimeDifference(const timespec& from, const timespec& to) { + assert((to.tv_sec > from.tv_sec) || + (to.tv_sec == from.tv_sec && to.tv_nsec >= from.tv_nsec)); + return static_cast(to.tv_sec - from.tv_sec) + + static_cast(to.tv_nsec - from.tv_nsec) * .000000001; + } + + // Output stream to print out the resource utilization. If it is NULL, + // Report() does nothing. + std::ostream* report_stream_; + + // Status to stop measurement if a system call returns an error. + unsigned usage_status_; + + // Variable to save the result of clock_gettime(CLOCK_PROCESS_CPUTIME_ID) when + // Timer::Start() is called. It is used as the base status of CPU time. + timespec cpu_before_; + + // Variable to save the result of clock_gettime(CLOCK_MONOTONIC) when + // Timer::Start() is called. It is used as the base status of WALL time. + timespec wall_before_; + + // Variable to save the result of getrusage() when Timer::Start() is called. + // It is used as the base status of USR time, SYS time, and RSS. + rusage usage_before_; + + // Variable to save the result of clock_gettime(CLOCK_PROCESS_CPUTIME_ID) when + // Timer::Stop() is called. It is used as the last status of CPU time. The + // resouce usage is measured by subtracting |cpu_before_| from it. + timespec cpu_after_; + + // Variable to save the result of clock_gettime(CLOCK_MONOTONIC) when + // Timer::Stop() is called. It is used as the last status of WALL time. The + // resouce usage is measured by subtracting |wall_before_| from it. + timespec wall_after_; + + // Variable to save the result of getrusage() when Timer::Stop() is called. It + // is used as the last status of USR time, SYS time, and RSS. Those resouce + // usages are measured by subtracting |usage_before_| from it. + rusage usage_after_; + + // If true, Timer reports the memory usage information too. Otherwise, Timer + // reports only USR time, WALL time, SYS time. + bool measure_mem_usage_; +}; + +// The purpose of ScopedTimer is to measure the resource utilization for a +// scope. Simply creating a local variable of ScopedTimer will call +// Timer::Start() and it calls Timer::Stop() and Timer::Report() at the end of +// the scope by its destructor. When we use this class, we must choose the +// proper Timer class (for class TimerType template) in advance. This class +// should be used as the following example: +// +// { // <-- beginning of this scope +// +// /* ... code out of interest ... */ +// +// spvutils::ScopedTimer scopedtimer(std::cout, tag); +// +// /* ... lines of code that we want to know its resource usage ... */ +// +// } // <-- end of this scope. The destructor of ScopedTimer prints tag and +// the resource utilization to std::cout. +// +// The template is used to choose a Timer class. Currently, +// only options for the Timer class are Timer and MockTimer in the unit test. +template +class ScopedTimer { + public: + ScopedTimer(std::ostream* out, const char* tag, + bool measure_mem_usage = false) + : timer(new TimerType(out, measure_mem_usage)), tag_(tag) { + timer->Start(); + } + + // At the end of the scope surrounding the instance of this class, this + // destructor saves the last status of resource usage and reports it. + virtual ~ScopedTimer() { + timer->Stop(); + timer->Report(tag_); + delete timer; + } + + private: + // Actual timer that measures the resource utilization. It must be an instance + // of Timer class if there is no special reason to use other class. + TimerType* timer; + + // A tag that will be printed in front of the trace reported by Timer class. + const char* tag_; +}; + +// CumulativeTimer is the same as Timer class, but it supports a cumulative +// measurement as the following example: +// +// CumulativeTimer *ctimer = new CumulativeTimer(std::cout); +// ctimer->Start(); +// +// /* ... lines of code that we want to know its resource usage ... */ +// +// ctimer->Stop(); +// +// /* ... code out of interest ... */ +// +// ctimer->Start(); +// +// /* ... lines of code that we want to know its resource usage ... */ +// +// ctimer->Stop(); +// ctimer->Report(tag); +// delete ctimer; +// +class CumulativeTimer : public Timer { + public: + CumulativeTimer(std::ostream* out, bool measure_mem_usage = false) + : Timer(out, measure_mem_usage), + cpu_time_(0), + wall_time_(0), + usr_time_(0), + sys_time_(0), + rss_(0), + pgfaults_(0) {} + + // If we cannot get a resource usage because of failures, it sets -1 for the + // resource usage. + void Stop() override { + Timer::Stop(); + + if (cpu_time_ >= 0 && Timer::CPUTime() >= 0) + cpu_time_ += Timer::CPUTime(); + else + cpu_time_ = -1; + + if (wall_time_ >= 0 && Timer::WallTime() >= 0) + wall_time_ += Timer::WallTime(); + else + wall_time_ = -1; + + if (usr_time_ >= 0 && Timer::UserTime() >= 0) + usr_time_ += Timer::UserTime(); + else + usr_time_ = -1; + + if (sys_time_ >= 0 && Timer::SystemTime() >= 0) + sys_time_ += Timer::SystemTime(); + else + sys_time_ = -1; + + if (rss_ >= 0 && Timer::RSS() >= 0) + rss_ += Timer::RSS(); + else + rss_ = -1; + + if (pgfaults_ >= 0 && Timer::PageFault() >= 0) + pgfaults_ += Timer::PageFault(); + else + pgfaults_ = -1; + } + + // Returns the cumulative CPU Time (i.e., process time) for a range of code + // execution. + double CPUTime() override { return cpu_time_; } + + // Returns the cumulative Wall Time (i.e., elapsed time) for a range of code + // execution. + double WallTime() override { return wall_time_; } + + // Returns the cumulative USR Time for a range of code execution. + double UserTime() override { return usr_time_; } + + // Returns the cumulative SYS Time for a range of code execution. + double SystemTime() override { return sys_time_; } + + // Returns the cumulative RSS delta for a range of code execution. + long RSS() const override { return rss_; } + + // Returns the cumulative delta of number of page faults for a range of code + // execution. + long PageFault() const override { return pgfaults_; } + + private: + // Variable to save the cumulative CPU time (i.e., process time). + double cpu_time_; + + // Variable to save the cumulative wall time (i.e., elapsed time). + double wall_time_; + + // Variable to save the cumulative user time. + double usr_time_; + + // Variable to save the cumulative system time. + double sys_time_; + + // Variable to save the cumulative RSS delta. + long rss_; + + // Variable to save the cumulative delta of the number of page faults. + long pgfaults_; +}; + +} // namespace spvutils + +#else // defined(SPIRV_TIMER_ENABLED) + +#define SPIRV_TIMER_DESCRIPTION(...) +#define SPIRV_TIMER_SCOPED(...) + +#endif // defined(SPIRV_TIMER_ENABLED) + +#endif // LIBSPIRV_UTIL_TIMER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/basic_block.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/basic_block.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/basic_block.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/basic_block.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,145 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "val/basic_block.h" + +#include +#include +#include + +using std::vector; + +namespace libspirv { + +BasicBlock::BasicBlock(uint32_t label_id) + : id_(label_id), + immediate_dominator_(nullptr), + immediate_post_dominator_(nullptr), + predecessors_(), + successors_(), + type_(0), + reachable_(false) {} + +void BasicBlock::SetImmediateDominator(BasicBlock* dom_block) { + immediate_dominator_ = dom_block; +} + +void BasicBlock::SetImmediatePostDominator(BasicBlock* pdom_block) { + immediate_post_dominator_ = pdom_block; +} + +const BasicBlock* BasicBlock::immediate_dominator() const { + return immediate_dominator_; +} + +const BasicBlock* BasicBlock::immediate_post_dominator() const { + return immediate_post_dominator_; +} + +BasicBlock* BasicBlock::immediate_dominator() { return immediate_dominator_; } +BasicBlock* BasicBlock::immediate_post_dominator() { + return immediate_post_dominator_; +} + +void BasicBlock::RegisterSuccessors(const vector& next_blocks) { + for (auto& block : next_blocks) { + block->predecessors_.push_back(this); + successors_.push_back(block); + if (block->reachable_ == false) block->set_reachable(reachable_); + } +} + +void BasicBlock::RegisterBranchInstruction(SpvOp branch_instruction) { + if (branch_instruction == SpvOpUnreachable) reachable_ = false; + return; +} + +bool BasicBlock::dominates(const BasicBlock& other) const { + return (this == &other) || + !(other.dom_end() == + std::find(other.dom_begin(), other.dom_end(), this)); +} + +bool BasicBlock::postdominates(const BasicBlock& other) const { + return (this == &other) || + !(other.pdom_end() == + std::find(other.pdom_begin(), other.pdom_end(), this)); +} + +BasicBlock::DominatorIterator::DominatorIterator() : current_(nullptr) {} + +BasicBlock::DominatorIterator::DominatorIterator( + const BasicBlock* block, + std::function dominator_func) + : current_(block), dom_func_(dominator_func) {} + +BasicBlock::DominatorIterator& BasicBlock::DominatorIterator::operator++() { + if (current_ == dom_func_(current_)) { + current_ = nullptr; + } else { + current_ = dom_func_(current_); + } + return *this; +} + +const BasicBlock::DominatorIterator BasicBlock::dom_begin() const { + return DominatorIterator( + this, [](const BasicBlock* b) { return b->immediate_dominator(); }); +} + +BasicBlock::DominatorIterator BasicBlock::dom_begin() { + return DominatorIterator( + this, [](const BasicBlock* b) { return b->immediate_dominator(); }); +} + +const BasicBlock::DominatorIterator BasicBlock::dom_end() const { + return DominatorIterator(); +} + +BasicBlock::DominatorIterator BasicBlock::dom_end() { + return DominatorIterator(); +} + +const BasicBlock::DominatorIterator BasicBlock::pdom_begin() const { + return DominatorIterator( + this, [](const BasicBlock* b) { return b->immediate_post_dominator(); }); +} + +BasicBlock::DominatorIterator BasicBlock::pdom_begin() { + return DominatorIterator( + this, [](const BasicBlock* b) { return b->immediate_post_dominator(); }); +} + +const BasicBlock::DominatorIterator BasicBlock::pdom_end() const { + return DominatorIterator(); +} + +BasicBlock::DominatorIterator BasicBlock::pdom_end() { + return DominatorIterator(); +} + +bool operator==(const BasicBlock::DominatorIterator& lhs, + const BasicBlock::DominatorIterator& rhs) { + return lhs.current_ == rhs.current_; +} + +bool operator!=(const BasicBlock::DominatorIterator& lhs, + const BasicBlock::DominatorIterator& rhs) { + return !(lhs == rhs); +} + +const BasicBlock*& BasicBlock::DominatorIterator::operator*() { + return current_; +} +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/basic_block.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/basic_block.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/basic_block.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/basic_block.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,226 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_VAL_BASICBLOCK_H_ +#define LIBSPIRV_VAL_BASICBLOCK_H_ + +#include "latest_version_spirv_header.h" + +#include + +#include +#include +#include +#include + +namespace libspirv { + +enum BlockType : uint32_t { + kBlockTypeUndefined, + kBlockTypeHeader, + kBlockTypeLoop, + kBlockTypeMerge, + kBlockTypeBreak, + kBlockTypeContinue, + kBlockTypeReturn, + kBlockTypeCOUNT ///< Total number of block types. (must be the last element) +}; + +// This class represents a basic block in a SPIR-V module +class BasicBlock { + public: + /// Constructor for a BasicBlock + /// + /// @param[in] id The ID of the basic block + explicit BasicBlock(uint32_t id); + + /// Returns the id of the BasicBlock + uint32_t id() const { return id_; } + + /// Returns the predecessors of the BasicBlock + const std::vector* predecessors() const { + return &predecessors_; + } + + /// Returns the predecessors of the BasicBlock + std::vector* predecessors() { return &predecessors_; } + + /// Returns the successors of the BasicBlock + const std::vector* successors() const { return &successors_; } + + /// Returns the successors of the BasicBlock + std::vector* successors() { return &successors_; } + + /// Returns true if the block is reachable in the CFG + bool reachable() const { return reachable_; } + + /// Returns true if BasicBlock is of the given type + bool is_type(BlockType type) const { + if (type == kBlockTypeUndefined) return type_.none(); + return type_.test(type); + } + + /// Sets the reachability of the basic block in the CFG + void set_reachable(bool reachability) { reachable_ = reachability; } + + /// Sets the type of the BasicBlock + void set_type(BlockType type) { + if (type == kBlockTypeUndefined) + type_.reset(); + else + type_.set(type); + } + + /// Sets the immedate dominator of this basic block + /// + /// @param[in] dom_block The dominator block + void SetImmediateDominator(BasicBlock* dom_block); + + /// Sets the immedate post dominator of this basic block + /// + /// @param[in] pdom_block The post dominator block + void SetImmediatePostDominator(BasicBlock* pdom_block); + + /// Returns the immedate dominator of this basic block + BasicBlock* immediate_dominator(); + + /// Returns the immedate dominator of this basic block + const BasicBlock* immediate_dominator() const; + + /// Returns the immedate post dominator of this basic block + BasicBlock* immediate_post_dominator(); + + /// Returns the immedate post dominator of this basic block + const BasicBlock* immediate_post_dominator() const; + + /// Ends the block without a successor + void RegisterBranchInstruction(SpvOp branch_instruction); + + /// Adds @p next BasicBlocks as successors of this BasicBlock + void RegisterSuccessors( + const std::vector& next = std::vector()); + + /// Returns true if the id of the BasicBlock matches + bool operator==(const BasicBlock& other) const { return other.id_ == id_; } + + /// Returns true if the id of the BasicBlock matches + bool operator==(const uint32_t& other_id) const { return other_id == id_; } + + /// Returns true if this block dominates the other block. + /// Assumes dominators have been computed. + bool dominates(const BasicBlock& other) const; + + /// Returns true if this block postdominates the other block. + /// Assumes dominators have been computed. + bool postdominates(const BasicBlock& other) const; + + /// @brief A BasicBlock dominator iterator class + /// + /// This iterator will iterate over the (post)dominators of the block + class DominatorIterator + : public std::iterator { + public: + /// @brief Constructs the end of dominator iterator + /// + /// This will create an iterator which will represent the element + /// before the root node of the dominator tree + DominatorIterator(); + + /// @brief Constructs an iterator for the given block which points to + /// @p block + /// + /// @param block The block which is referenced by the iterator + /// @param dominator_func This function will be called to get the immediate + /// (post)dominator of the current block + DominatorIterator( + const BasicBlock* block, + std::function dominator_func); + + /// @brief Advances the iterator + DominatorIterator& operator++(); + + /// @brief Returns the current element + const BasicBlock*& operator*(); + + friend bool operator==(const DominatorIterator& lhs, + const DominatorIterator& rhs); + + private: + const BasicBlock* current_; + std::function dom_func_; + }; + + /// Returns a dominator iterator which points to the current block + const DominatorIterator dom_begin() const; + + /// Returns a dominator iterator which points to the current block + DominatorIterator dom_begin(); + + /// Returns a dominator iterator which points to one element past the first + /// block + const DominatorIterator dom_end() const; + + /// Returns a dominator iterator which points to one element past the first + /// block + DominatorIterator dom_end(); + + /// Returns a post dominator iterator which points to the current block + const DominatorIterator pdom_begin() const; + /// Returns a post dominator iterator which points to the current block + DominatorIterator pdom_begin(); + + /// Returns a post dominator iterator which points to one element past the + /// last block + const DominatorIterator pdom_end() const; + + /// Returns a post dominator iterator which points to one element past the + /// last block + DominatorIterator pdom_end(); + + private: + /// Id of the BasicBlock + const uint32_t id_; + + /// Pointer to the immediate dominator of the BasicBlock + BasicBlock* immediate_dominator_; + + /// Pointer to the immediate dominator of the BasicBlock + BasicBlock* immediate_post_dominator_; + + /// The set of predecessors of the BasicBlock + std::vector predecessors_; + + /// The set of successors of the BasicBlock + std::vector successors_; + + /// The type of the block + std::bitset type_; + + /// True if the block is reachable in the CFG + bool reachable_; +}; + +/// @brief Returns true if the iterators point to the same element or if both +/// iterators point to the @p dom_end block +bool operator==(const BasicBlock::DominatorIterator& lhs, + const BasicBlock::DominatorIterator& rhs); + +/// @brief Returns true if the iterators point to different elements and they +/// do not both point to the @p dom_end block +bool operator!=(const BasicBlock::DominatorIterator& lhs, + const BasicBlock::DominatorIterator& rhs); + +} // namespace libspirv + +#endif /// LIBSPIRV_VAL_BASICBLOCK_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/construct.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/construct.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/construct.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/construct.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "val/construct.h" + +#include +#include + +namespace libspirv { + +Construct::Construct(ConstructType construct_type, BasicBlock* entry, + BasicBlock* exit, std::vector constructs) + : type_(construct_type), + corresponding_constructs_(constructs), + entry_block_(entry), + exit_block_(exit) {} + +ConstructType Construct::type() const { return type_; } + +const std::vector& Construct::corresponding_constructs() const { + return corresponding_constructs_; +} +std::vector& Construct::corresponding_constructs() { + return corresponding_constructs_; +} + +bool ValidateConstructSize(ConstructType type, size_t size) { + switch (type) { + case ConstructType::kSelection: + return size == 0; + case ConstructType::kContinue: + return size == 1; + case ConstructType::kLoop: + return size == 1; + case ConstructType::kCase: + return size >= 1; + default: + assert(1 == 0 && "Type not defined"); + } + return false; +} + +void Construct::set_corresponding_constructs( + std::vector constructs) { + assert(ValidateConstructSize(type_, constructs.size())); + corresponding_constructs_ = constructs; +} + +const BasicBlock* Construct::entry_block() const { return entry_block_; } +BasicBlock* Construct::entry_block() { return entry_block_; } + +const BasicBlock* Construct::exit_block() const { return exit_block_; } +BasicBlock* Construct::exit_block() { return exit_block_; } + +void Construct::set_exit(BasicBlock* block) { exit_block_ = block; } +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/construct.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/construct.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/construct.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/construct.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,132 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_VAL_CONSTRUCT_H_ +#define LIBSPIRV_VAL_CONSTRUCT_H_ + +#include +#include + +namespace libspirv { + +enum class ConstructType : int { + kNone = 0, + /// The set of blocks dominated by a selection header, minus the set of blocks + /// dominated by the header's merge block + kSelection, + /// The set of blocks dominated by an OpLoopMerge's Continue Target and post + /// dominated by the corresponding back + kContinue, + /// The set of blocks dominated by a loop header, minus the set of blocks + /// dominated by the loop's merge block, minus the loop's corresponding + /// continue construct + kLoop, + /// The set of blocks dominated by an OpSwitch's Target or Default, minus the + /// set of blocks dominated by the OpSwitch's merge block (this construct is + /// only defined for those OpSwitch Target or Default that are not equal to + /// the OpSwitch's corresponding merge block) + kCase +}; + +class BasicBlock; + +/// @brief This class tracks the CFG constructs as defined in the SPIR-V spec +class Construct { + public: + Construct(ConstructType type, BasicBlock* dominator, + BasicBlock* exit = nullptr, + std::vector constructs = std::vector()); + + /// Returns the type of the construct + ConstructType type() const; + + const std::vector& corresponding_constructs() const; + std::vector& corresponding_constructs(); + void set_corresponding_constructs(std::vector constructs); + + /// Returns the dominator block of the construct. + /// + /// This is usually the header block or the first block of the construct. + const BasicBlock* entry_block() const; + + /// Returns the dominator block of the construct. + /// + /// This is usually the header block or the first block of the construct. + BasicBlock* entry_block(); + + /// Returns the exit block of the construct. + /// + /// For a continue construct it is the backedge block of the corresponding + /// loop construct. For the case construct it is the block that branches to + /// the OpSwitch merge block or other case blocks. Otherwise it is the merge + /// block of the corresponding header block + const BasicBlock* exit_block() const; + + /// Returns the exit block of the construct. + /// + /// For a continue construct it is the backedge block of the corresponding + /// loop construct. For the case construct it is the block that branches to + /// the OpSwitch merge block or other case blocks. Otherwise it is the merge + /// block of the corresponding header block + BasicBlock* exit_block(); + + /// Sets the exit block for this construct. This is useful for continue + /// constructs which do not know the back-edge block during construction + void set_exit(BasicBlock* exit_block); + + // Returns whether the exit block of this construct is the merge block + // for an OpLoopMerge or OpSelectionMerge + bool ExitBlockIsMergeBlock() const { + return type_ == ConstructType::kLoop || type_ == ConstructType::kSelection; + } + + private: + /// The type of the construct + ConstructType type_; + + /// These are the constructs that are related to this construct. These + /// constructs can be the continue construct, for the corresponding loop + /// construct, the case construct that are part of the same OpSwitch + /// instruction + /// + /// Here is a table that describes what constructs are included in + /// @p corresponding_constructs_ + /// | this construct | corresponding construct | + /// |----------------|----------------------------------| + /// | loop | continue | + /// | continue | loop | + /// | case | other cases in the same OpSwitch | + /// + /// kContinue and kLoop constructs will always have corresponding + /// constructs even if they are represented by the same block + std::vector corresponding_constructs_; + + /// @brief Dominator block for the construct + /// + /// The dominator block for the construct. Depending on the construct this may + /// be a selection header, a continue target of a loop, a loop header or a + /// Target or Default block of a switch + BasicBlock* entry_block_; + + /// @brief Exiting block for the construct + /// + /// The exit block for the construct. This can be a merge block for the loop + /// and selection constructs, a back-edge block for a continue construct, or + /// the branching block for the case construct + BasicBlock* exit_block_; +}; + +} // namespace libspirv + +#endif /// LIBSPIRV_VAL_CONSTRUCT_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/decoration.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/decoration.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/decoration.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/decoration.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,87 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_VAL_DECORATION_H_ +#define LIBSPIRV_VAL_DECORATION_H_ + +#include +#include +#include + +#include "latest_version_spirv_header.h" + +namespace libspirv { + +// An object of this class represents a specific decoration including its +// parameters (if any). Decorations are used by OpDecorate and OpMemberDecorate, +// and they describe certain properties that can be assigned to one or several +// s. +// +// A Decoration object contains the decoration type (an enum), associated +// literal parameters, and struct member index. If the decoration does not apply +// to a struct member, then the index is kInvalidIndex. A Decoration object does +// not store the target Id, i.e. the Id to which it applies. It is +// possible for the same decoration to be applied to several s (and they +// might be assigned using separate SPIR-V instructions, possibly using an +// assignment through GroupDecorate). +// +// Example 1: Decoration for an object with no parameters: +// OpDecorate %obj Flat +// dec_type_ = SpvDecorationFlat +// params_ = empty vector +// struct_member_index_ = kInvalidMember +// +// Example 2: Decoration for an object with two parameters: +// OpDecorate %obj LinkageAttributes "link" Import +// dec_type_ = SpvDecorationLinkageAttributes +// params_ = vector { link, Import } +// struct_member_index_ = kInvalidMember +// +// Example 3: Decoration for a member of a structure with one parameter: +// OpMemberDecorate %struct 2 Offset 2 +// dec_type_ = SpvDecorationOffset +// params_ = vector { 2 } +// struct_member_index_ = 2 +// +class Decoration { + public: + enum { kInvalidMember = -1 }; + Decoration(SpvDecoration t, + const std::vector& parameters = std::vector(), + uint32_t member_index = kInvalidMember) + : dec_type_(t), params_(parameters), struct_member_index_(member_index) {} + + void set_struct_member_index(uint32_t index) { struct_member_index_ = index; } + int struct_member_index() const { return struct_member_index_; } + SpvDecoration dec_type() const { return dec_type_; } + std::vector& params() { return params_; } + const std::vector& params() const { return params_; } + + inline bool operator==(const Decoration& rhs) const { + return (dec_type_ == rhs.dec_type_ && params_ == rhs.params_ && + struct_member_index_ == rhs.struct_member_index_); + } + + private: + SpvDecoration dec_type_; + std::vector params_; + + // If the decoration applies to a member of a structure type, then the index + // of the member is stored here. Otherwise, this is kInvalidIndex. + int struct_member_index_; +}; + +} // namespace libspirv + +#endif /// LIBSPIRV_VAL_DECORATION_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/function.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/function.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/function.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/function.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,389 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "val/function.h" + +#include + +#include +#include +#include +#include +#include + +#include "cfa.h" +#include "val/basic_block.h" +#include "val/construct.h" +#include "validate.h" + +using std::ignore; +using std::list; +using std::make_pair; +using std::pair; +using std::tie; +using std::vector; + +namespace libspirv { + +// Universal Limit of ResultID + 1 +static const uint32_t kInvalidId = 0x400000; + +Function::Function(uint32_t function_id, uint32_t result_type_id, + SpvFunctionControlMask function_control, + uint32_t function_type_id) + : id_(function_id), + function_type_id_(function_type_id), + result_type_id_(result_type_id), + function_control_(function_control), + declaration_type_(FunctionDecl::kFunctionDeclUnknown), + end_has_been_registered_(false), + blocks_(), + current_block_(nullptr), + pseudo_entry_block_(0), + pseudo_exit_block_(kInvalidId), + cfg_constructs_(), + variable_ids_(), + parameter_ids_() {} + +bool Function::IsFirstBlock(uint32_t block_id) const { + return !ordered_blocks_.empty() && *first_block() == block_id; +} + +spv_result_t Function::RegisterFunctionParameter(uint32_t parameter_id, + uint32_t type_id) { + assert(current_block_ == nullptr && + "RegisterFunctionParameter can only be called when parsing the binary " + "ouside of a block"); + // TODO(umar): Validate function parameter type order and count + // TODO(umar): Use these variables to validate parameter type + (void)parameter_id; + (void)type_id; + return SPV_SUCCESS; +} + +spv_result_t Function::RegisterLoopMerge(uint32_t merge_id, + uint32_t continue_id) { + RegisterBlock(merge_id, false); + RegisterBlock(continue_id, false); + BasicBlock& merge_block = blocks_.at(merge_id); + BasicBlock& continue_target_block = blocks_.at(continue_id); + assert(current_block_ && + "RegisterLoopMerge must be called when called within a block"); + + current_block_->set_type(kBlockTypeLoop); + merge_block.set_type(kBlockTypeMerge); + continue_target_block.set_type(kBlockTypeContinue); + Construct& loop_construct = + AddConstruct({ConstructType::kLoop, current_block_, &merge_block}); + Construct& continue_construct = + AddConstruct({ConstructType::kContinue, &continue_target_block}); + + continue_construct.set_corresponding_constructs({&loop_construct}); + loop_construct.set_corresponding_constructs({&continue_construct}); + merge_block_header_[&merge_block] = current_block_; + + return SPV_SUCCESS; +} + +spv_result_t Function::RegisterSelectionMerge(uint32_t merge_id) { + RegisterBlock(merge_id, false); + BasicBlock& merge_block = blocks_.at(merge_id); + current_block_->set_type(kBlockTypeHeader); + merge_block.set_type(kBlockTypeMerge); + merge_block_header_[&merge_block] = current_block_; + + AddConstruct({ConstructType::kSelection, current_block(), &merge_block}); + + return SPV_SUCCESS; +} + +spv_result_t Function::RegisterSetFunctionDeclType(FunctionDecl type) { + assert(declaration_type_ == FunctionDecl::kFunctionDeclUnknown); + declaration_type_ = type; + return SPV_SUCCESS; +} + +spv_result_t Function::RegisterBlock(uint32_t block_id, bool is_definition) { + assert( + declaration_type_ == FunctionDecl::kFunctionDeclDefinition && + "RegisterBlocks can only be called after declaration_type_ is defined"); + + std::unordered_map::iterator inserted_block; + bool success = false; + tie(inserted_block, success) = + blocks_.insert({block_id, BasicBlock(block_id)}); + if (is_definition) { // new block definition + assert(current_block_ == nullptr && + "Register Block can only be called when parsing a binary outside of " + "a BasicBlock"); + + undefined_blocks_.erase(block_id); + current_block_ = &inserted_block->second; + ordered_blocks_.push_back(current_block_); + if (IsFirstBlock(block_id)) current_block_->set_reachable(true); + } else if (success) { // Block doesn't exsist but this is not a definition + undefined_blocks_.insert(block_id); + } + + return SPV_SUCCESS; +} + +void Function::RegisterBlockEnd(vector next_list, + SpvOp branch_instruction) { + assert( + current_block_ && + "RegisterBlockEnd can only be called when parsing a binary in a block"); + vector next_blocks; + next_blocks.reserve(next_list.size()); + + std::unordered_map::iterator inserted_block; + bool success; + for (uint32_t successor_id : next_list) { + tie(inserted_block, success) = + blocks_.insert({successor_id, BasicBlock(successor_id)}); + if (success) { + undefined_blocks_.insert(successor_id); + } + next_blocks.push_back(&inserted_block->second); + } + + if (current_block_->is_type(kBlockTypeLoop)) { + // For each loop header, record the set of its successors, and include + // its continue target if the continue target is not the loop header + // itself. + std::vector& next_blocks_plus_continue_target = + loop_header_successors_plus_continue_target_map_[current_block_]; + next_blocks_plus_continue_target = next_blocks; + auto continue_target = + FindConstructForEntryBlock(current_block_, ConstructType::kLoop) + .corresponding_constructs() + .back() + ->entry_block(); + if (continue_target != current_block_) { + next_blocks_plus_continue_target.push_back(continue_target); + } + } + + current_block_->RegisterBranchInstruction(branch_instruction); + current_block_->RegisterSuccessors(next_blocks); + current_block_ = nullptr; + return; +} + +void Function::RegisterFunctionEnd() { + if (!end_has_been_registered_) { + end_has_been_registered_ = true; + + ComputeAugmentedCFG(); + } +} + +size_t Function::block_count() const { return blocks_.size(); } + +size_t Function::undefined_block_count() const { + return undefined_blocks_.size(); +} + +const vector& Function::ordered_blocks() const { + return ordered_blocks_; +} +vector& Function::ordered_blocks() { return ordered_blocks_; } + +const BasicBlock* Function::current_block() const { return current_block_; } +BasicBlock* Function::current_block() { return current_block_; } + +const list& Function::constructs() const { return cfg_constructs_; } +list& Function::constructs() { return cfg_constructs_; } + +const BasicBlock* Function::first_block() const { + if (ordered_blocks_.empty()) return nullptr; + return ordered_blocks_[0]; +} +BasicBlock* Function::first_block() { + if (ordered_blocks_.empty()) return nullptr; + return ordered_blocks_[0]; +} + +bool Function::IsBlockType(uint32_t merge_block_id, BlockType type) const { + bool ret = false; + const BasicBlock* block; + tie(block, ignore) = GetBlock(merge_block_id); + if (block) { + ret = block->is_type(type); + } + return ret; +} + +pair Function::GetBlock(uint32_t block_id) const { + const auto b = blocks_.find(block_id); + if (b != end(blocks_)) { + const BasicBlock* block = &(b->second); + bool defined = + undefined_blocks_.find(block->id()) == end(undefined_blocks_); + return make_pair(block, defined); + } else { + return make_pair(nullptr, false); + } +} + +pair Function::GetBlock(uint32_t block_id) { + const BasicBlock* out; + bool defined; + tie(out, defined) = const_cast(this)->GetBlock(block_id); + return make_pair(const_cast(out), defined); +} + +Function::GetBlocksFunction Function::AugmentedCFGSuccessorsFunction() const { + return [this](const BasicBlock* block) { + auto where = augmented_successors_map_.find(block); + return where == augmented_successors_map_.end() ? block->successors() + : &(*where).second; + }; +} + +Function::GetBlocksFunction +Function::AugmentedCFGSuccessorsFunctionIncludingHeaderToContinueEdge() const { + return [this](const BasicBlock* block) { + auto where = loop_header_successors_plus_continue_target_map_.find(block); + return where == loop_header_successors_plus_continue_target_map_.end() + ? AugmentedCFGSuccessorsFunction()(block) + : &(*where).second; + }; +} + +Function::GetBlocksFunction Function::AugmentedCFGPredecessorsFunction() const { + return [this](const BasicBlock* block) { + auto where = augmented_predecessors_map_.find(block); + return where == augmented_predecessors_map_.end() ? block->predecessors() + : &(*where).second; + }; +} + +void Function::ComputeAugmentedCFG() { + // Compute the successors of the pseudo-entry block, and + // the predecessors of the pseudo exit block. + auto succ_func = [](const BasicBlock* b) { return b->successors(); }; + auto pred_func = [](const BasicBlock* b) { return b->predecessors(); }; + spvtools::CFA::ComputeAugmentedCFG( + ordered_blocks_, &pseudo_entry_block_, &pseudo_exit_block_, + &augmented_successors_map_, &augmented_predecessors_map_, succ_func, + pred_func); +} + +Construct& Function::AddConstruct(const Construct& new_construct) { + cfg_constructs_.push_back(new_construct); + auto& result = cfg_constructs_.back(); + entry_block_to_construct_[std::make_pair(new_construct.entry_block(), + new_construct.type())] = &result; + return result; +} + +Construct& Function::FindConstructForEntryBlock(const BasicBlock* entry_block, + ConstructType type) { + auto where = + entry_block_to_construct_.find(std::make_pair(entry_block, type)); + assert(where != entry_block_to_construct_.end()); + auto construct_ptr = (*where).second; + assert(construct_ptr); + return *construct_ptr; +} + +int Function::GetBlockDepth(BasicBlock* bb) { + // Guard against nullptr. + if (!bb) { + return 0; + } + // Only calculate the depth if it's not already calculated. + // This function uses memoization to avoid duplicate CFG depth calculations. + if (block_depth_.find(bb) != block_depth_.end()) { + return block_depth_[bb]; + } + + BasicBlock* bb_dom = bb->immediate_dominator(); + if (!bb_dom || bb == bb_dom) { + // This block has no dominator, so it's at depth 0. + block_depth_[bb] = 0; + } else if (bb->is_type(kBlockTypeMerge)) { + // If this is a merge block, its depth is equal to the block before + // branching. + BasicBlock* header = merge_block_header_[bb]; + assert(header); + block_depth_[bb] = GetBlockDepth(header); + } else if (bb->is_type(kBlockTypeContinue)) { + // The depth of the continue block entry point is 1 + loop header depth. + Construct* continue_construct = + entry_block_to_construct_[std::make_pair(bb, ConstructType::kContinue)]; + assert(continue_construct); + // Continue construct has only 1 corresponding construct (loop header). + Construct* loop_construct = + continue_construct->corresponding_constructs()[0]; + assert(loop_construct); + BasicBlock* loop_header = loop_construct->entry_block(); + // The continue target may be the loop itself (while 1). + // In such cases, the depth of the continue block is: 1 + depth of the + // loop's dominator block. + if (loop_header == bb) { + block_depth_[bb] = 1 + GetBlockDepth(bb_dom); + } else { + block_depth_[bb] = 1 + GetBlockDepth(loop_header); + } + } else if (bb_dom->is_type(kBlockTypeHeader) || + bb_dom->is_type(kBlockTypeLoop)) { + // The dominator of the given block is a header block. So, the nesting + // depth of this block is: 1 + nesting depth of the header. + block_depth_[bb] = 1 + GetBlockDepth(bb_dom); + } else { + block_depth_[bb] = GetBlockDepth(bb_dom); + } + return block_depth_[bb]; +} + +void Function::RegisterExecutionModelLimitation(SpvExecutionModel model, + const std::string& message) { + execution_model_limitations_.push_back( + [model, message](SpvExecutionModel in_model, std::string* out_message) { + if (model != in_model) { + if (out_message) { + *out_message = message; + } + return false; + } + return true; + }); +} + +bool Function::IsCompatibleWithExecutionModel(SpvExecutionModel model, + std::string* reason) const { + bool return_value = true; + std::stringstream ss_reason; + + for (const auto& is_compatible : execution_model_limitations_) { + std::string message; + if (!is_compatible(model, &message)) { + if (!reason) return false; + return_value = false; + if (!message.empty()) { + ss_reason << message << "\n"; + } + } + } + + if (!return_value && reason) { + *reason = ss_reason.str(); + } + + return return_value; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/function.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/function.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/function.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/function.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,356 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_VAL_FUNCTION_H_ +#define LIBSPIRV_VAL_FUNCTION_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include "latest_version_spirv_header.h" +#include "spirv-tools/libspirv.h" +#include "val/basic_block.h" +#include "val/construct.h" + +namespace libspirv { + +struct bb_constr_type_pair_hash { + std::size_t operator()( + const std::pair& p) const { + auto h1 = std::hash{}(p.first); + auto h2 = std::hash::type>{}( + static_cast::type>(p.second)); + return (h1 ^ h2); + } +}; + +enum class FunctionDecl { + kFunctionDeclUnknown, /// < Unknown function declaration + kFunctionDeclDeclaration, /// < Function declaration + kFunctionDeclDefinition /// < Function definition +}; + +/// This class manages all function declaration and definitions in a module. It +/// handles the state and id information while parsing a function in the SPIR-V +/// binary. +class Function { + public: + Function(uint32_t id, uint32_t result_type_id, + SpvFunctionControlMask function_control, uint32_t function_type_id); + + /// Registers a function parameter in the current function + /// @return Returns SPV_SUCCESS if the call was successful + spv_result_t RegisterFunctionParameter(uint32_t id, uint32_t type_id); + + /// Sets the declaration type of the current function + /// @return Returns SPV_SUCCESS if the call was successful + spv_result_t RegisterSetFunctionDeclType(FunctionDecl type); + + /// Registers a block in the current function. Subsequent block instructions + /// will target this block + /// @param id The ID of the label of the block + /// @return Returns SPV_SUCCESS if the call was successful + spv_result_t RegisterBlock(uint32_t id, bool is_definition = true); + + /// Registers a variable in the current block + /// + /// @param[in] type_id The type ID of the varaible + /// @param[in] id The ID of the varaible + /// @param[in] storage The storage of the variable + /// @param[in] init_id The initializer ID of the variable + /// + /// @return Returns SPV_SUCCESS if the call was successful + spv_result_t RegisterBlockVariable(uint32_t type_id, uint32_t id, + SpvStorageClass storage, uint32_t init_id); + + /// Registers a loop merge construct in the function + /// + /// @param[in] merge_id The merge block ID of the loop + /// @param[in] continue_id The continue block ID of the loop + /// + /// @return Returns SPV_SUCCESS if the call was successful + spv_result_t RegisterLoopMerge(uint32_t merge_id, uint32_t continue_id); + + /// Registers a selection merge construct in the function + /// @return Returns SPV_SUCCESS if the call was successful + spv_result_t RegisterSelectionMerge(uint32_t merge_id); + + /// Registers the end of the block + /// + /// @param[in] successors_list A list of ids to the block's successors + /// @param[in] branch_instruction the branch instruction that ended the block + void RegisterBlockEnd(std::vector successors_list, + SpvOp branch_instruction); + + /// Registers the end of the function. This is idempotent. + void RegisterFunctionEnd(); + + /// Returns true if the \p id block is the first block of this function + bool IsFirstBlock(uint32_t id) const; + + /// Returns true if the \p merge_block_id is a BlockType of \p type + bool IsBlockType(uint32_t merge_block_id, BlockType type) const; + + /// Returns a pair consisting of the BasicBlock with \p id and a bool + /// which is true if the block has been defined, and false if it is + /// declared but not defined. This function will return nullptr if the + /// \p id was not declared and not defined at the current point in the binary + std::pair GetBlock(uint32_t id) const; + std::pair GetBlock(uint32_t id); + + /// Returns the first block of the current function + const BasicBlock* first_block() const; + + /// Returns the first block of the current function + BasicBlock* first_block(); + + /// Returns a vector of all the blocks in the function + const std::vector& ordered_blocks() const; + + /// Returns a vector of all the blocks in the function + std::vector& ordered_blocks(); + + /// Returns a list of all the cfg constructs in the function + const std::list& constructs() const; + + /// Returns a list of all the cfg constructs in the function + std::list& constructs(); + + /// Returns the number of blocks in the current function being parsed + size_t block_count() const; + + /// Returns the id of the function + uint32_t id() const { return id_; } + + /// Returns return type id of the function + uint32_t GetResultTypeId() const { return result_type_id_; } + + /// Returns the number of blocks in the current function being parsed + size_t undefined_block_count() const; + const std::unordered_set& undefined_blocks() const { + return undefined_blocks_; + } + + /// Returns the block that is currently being parsed in the binary + BasicBlock* current_block(); + + /// Returns the block that is currently being parsed in the binary + const BasicBlock* current_block() const; + + // For dominance calculations, we want to analyze all the + // blocks in the function, even in degenerate control flow cases + // including unreachable blocks. We therefore make an "augmented CFG" + // which is the same as the ordinary CFG but adds: + // - A pseudo-entry node. + // - A pseudo-exit node. + // - A minimal set of edges so that a forward traversal from the + // pseudo-entry node will visit all nodes. + // - A minimal set of edges so that a backward traversal from the + // pseudo-exit node will visit all nodes. + // In particular, the pseudo-entry node is the unique source of the + // augmented CFG, and the psueo-exit node is the unique sink of the + // augmented CFG. + + /// Returns the pseudo exit block + BasicBlock* pseudo_entry_block() { return &pseudo_entry_block_; } + + /// Returns the pseudo exit block + const BasicBlock* pseudo_entry_block() const { return &pseudo_entry_block_; } + + /// Returns the pseudo exit block + BasicBlock* pseudo_exit_block() { return &pseudo_exit_block_; } + + /// Returns the pseudo exit block + const BasicBlock* pseudo_exit_block() const { return &pseudo_exit_block_; } + + using GetBlocksFunction = + std::function*(const BasicBlock*)>; + /// Returns the block successors function for the augmented CFG. + GetBlocksFunction AugmentedCFGSuccessorsFunction() const; + /// Like AugmentedCFGSuccessorsFunction, but also includes a forward edge from + /// a loop header block to its continue target, if they are different blocks. + GetBlocksFunction + AugmentedCFGSuccessorsFunctionIncludingHeaderToContinueEdge() const; + /// Returns the block predecessors function for the augmented CFG. + GetBlocksFunction AugmentedCFGPredecessorsFunction() const; + + /// Returns the control flow nesting depth of the given basic block. + /// This function only works when you have structured control flow. + /// This function should only be called after the control flow constructs have + /// been identified and dominators have been computed. + int GetBlockDepth(BasicBlock* bb); + + /// Prints a GraphViz digraph of the CFG of the current funciton + void PrintDotGraph() const; + + /// Prints a directed graph of the CFG of the current funciton + void PrintBlocks() const; + + /// Registers execution model limitation such as "Feature X is only available + /// with Execution Model Y". + void RegisterExecutionModelLimitation(SpvExecutionModel model, + const std::string& message); + + /// Registers execution model limitation with an |is_compatible| functor. + void RegisterExecutionModelLimitation( + std::function is_compatible) { + execution_model_limitations_.push_back(is_compatible); + } + + /// Returns true if the given execution model passes the limitations stored in + /// execution_model_limitations_. Returns false otherwise and fills optional + /// |reason| parameter. + bool IsCompatibleWithExecutionModel(SpvExecutionModel model, + std::string* reason = nullptr) const; + + // Inserts id to the set of functions called from this function. + void AddFunctionCallTarget(uint32_t call_target_id) { + function_call_targets_.insert(call_target_id); + } + + // Returns a set with ids of all functions called from this function. + const std::set function_call_targets() const { + return function_call_targets_; + } + + private: + // Computes the representation of the augmented CFG. + // Populates augmented_successors_map_ and augmented_predecessors_map_. + void ComputeAugmentedCFG(); + + // Adds a copy of the given Construct, and tracks it by its entry block. + // Returns a reference to the stored construct. + Construct& AddConstruct(const Construct& new_construct); + + // Returns a reference to the construct corresponding to the given entry + // block. + Construct& FindConstructForEntryBlock(const BasicBlock* entry_block, + ConstructType t); + + /// The result id of the OpLabel that defined this block + uint32_t id_; + + /// The type of the function + uint32_t function_type_id_; + + /// The type of the return value + uint32_t result_type_id_; + + /// The control fo the funciton + SpvFunctionControlMask function_control_; + + /// The type of declaration of each function + FunctionDecl declaration_type_; + + // Have we finished parsing this function? + bool end_has_been_registered_; + + /// The blocks in the function mapped by block ID + std::unordered_map blocks_; + + /// A list of blocks in the order they appeared in the binary + std::vector ordered_blocks_; + + /// Blocks which are forward referenced by blocks but not defined + std::unordered_set undefined_blocks_; + + /// The block that is currently being parsed + BasicBlock* current_block_; + + /// A pseudo entry node used in dominance analysis. + /// After the function end has been registered, the successor list of the + /// pseudo entry node is the minimal set of nodes such that all nodes in the + /// CFG can be reached by following successor lists. That is, the successors + /// will be: + /// - Any basic block without predecessors. This includes the entry + /// block to the function. + /// - A single node from each otherwise unreachable cycle in the CFG, if + /// such cycles exist. + /// The pseudo entry node does not appear in the predecessor or successor + /// list of any ordinary block. + /// It has no predecessors. + /// It has Id 0. + BasicBlock pseudo_entry_block_; + + /// A pseudo exit block used in dominance analysis. + /// After the function end has been registered, the predecessor list of the + /// pseudo exit node is the minimal set of nodes such that all nodes in the + /// CFG can be reached by following predecessor lists. That is, the + /// predecessors will be: + /// - Any basic block without successors. This includes any basic block + /// ending with an OpReturn, OpReturnValue or similar instructions. + /// - A single node from each otherwise unreachable cycle in the CFG, if + /// such cycles exist. + /// The pseudo exit node does not appear in the predecessor or successor + /// list of any ordinary block. + /// It has no successors. + BasicBlock pseudo_exit_block_; + + // Maps a block to its successors in the augmented CFG, if that set is + // different from its successors in the ordinary CFG. + std::unordered_map> + augmented_successors_map_; + // Maps a block to its predecessors in the augmented CFG, if that set is + // different from its predecessors in the ordinary CFG. + std::unordered_map> + augmented_predecessors_map_; + + // Maps a structured loop header to its CFG successors and also its + // continue target if that continue target is not the loop header + // itself. This might have duplicates. + std::unordered_map> + loop_header_successors_plus_continue_target_map_; + + /// The constructs that are available in this function + std::list cfg_constructs_; + + /// The variable IDs of the functions + std::vector variable_ids_; + + /// The function parameter ids of the functions + std::vector parameter_ids_; + + /// Maps a construct's entry block to the construct(s). + /// Since a basic block may be the entry block of different types of + /// constructs, the type of the construct should also be specified in order to + /// get the unique construct. + std::unordered_map, Construct*, + libspirv::bb_constr_type_pair_hash> + entry_block_to_construct_; + + /// This map provides the header block for a given merge block. + std::unordered_map merge_block_header_; + + /// Stores the control flow nesting depth of a given basic block + std::unordered_map block_depth_; + + /// Stores execution model limitations imposed by instructions used within the + /// function. The functor stored in the list return true if execution model + /// is compatible, false otherwise. If the functor returns false, it can also + /// optionally fill the string parameter with the reason for incompatibility. + std::list> + execution_model_limitations_; + + /// Stores ids of all functions called from this function. + std::set function_call_targets_; +}; + +} // namespace libspirv + +#endif /// LIBSPIRV_VAL_FUNCTION_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/instruction.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/instruction.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/instruction.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/instruction.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,49 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "val/instruction.h" + +#include + +using std::make_pair; + +namespace libspirv { +#define OPERATOR(OP) \ + bool operator OP(const Instruction& lhs, const Instruction& rhs) { \ + return lhs.id() OP rhs.id(); \ + } \ + bool operator OP(const Instruction& lhs, uint32_t rhs) { \ + return lhs.id() OP rhs; \ + } + +OPERATOR(<) +OPERATOR(==) +#undef OPERATOR + +Instruction::Instruction(const spv_parsed_instruction_t* inst, + Function* defining_function, + BasicBlock* defining_block) + : words_(inst->words, inst->words + inst->num_words), + operands_(inst->operands, inst->operands + inst->num_operands), + inst_({words_.data(), inst->num_words, inst->opcode, inst->ext_inst_type, + inst->type_id, inst->result_id, operands_.data(), + inst->num_operands}), + function_(defining_function), + block_(defining_block), + uses_() {} + +void Instruction::RegisterUse(const Instruction* inst, uint32_t index) { + uses_.push_back(make_pair(inst, index)); +} +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/instruction.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/instruction.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/instruction.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/instruction.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,126 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_VAL_INSTRUCTION_H_ +#define LIBSPIRV_VAL_INSTRUCTION_H_ + +#include +#include +#include +#include +#include + +#include "spirv-tools/libspirv.h" +#include "table.h" + +namespace libspirv { + +class BasicBlock; +class Function; + +/// Wraps the spv_parsed_instruction struct along with use and definition of the +/// instruction's result id +class Instruction { + public: + explicit Instruction(const spv_parsed_instruction_t* inst, + Function* defining_function = nullptr, + BasicBlock* defining_block = nullptr); + + /// Registers the use of the Instruction in instruction \p inst at \p index + void RegisterUse(const Instruction* inst, uint32_t index); + + uint32_t id() const { return inst_.result_id; } + uint32_t type_id() const { return inst_.type_id; } + SpvOp opcode() const { return static_cast(inst_.opcode); } + + /// Returns the Function where the instruction was defined. nullptr if it was + /// defined outside of a Function + const Function* function() const { return function_; } + + /// Returns the BasicBlock where the instruction was defined. nullptr if it + /// was defined outside of a BasicBlock + const BasicBlock* block() const { return block_; } + + /// Returns a vector of pairs of all references to this instruction's result + /// id. The first element is the instruction in which this result id was + /// referenced and the second is the index of the word in that instruction + /// where this result id appeared + const std::vector>& uses() const { + return uses_; + } + + /// The word used to define the Instruction + uint32_t word(size_t index) const { return words_[index]; } + + /// The words used to define the Instruction + const std::vector& words() const { return words_; } + + /// The operands of the Instruction + const std::vector& operands() const { + return operands_; + } + + /// Provides direct access to the stored C instruction object. + const spv_parsed_instruction_t& c_inst() const { return inst_; } + + // Casts the words belonging to the operand under |index| to |T| and returns. + template + T GetOperandAs(size_t index) const { + const spv_parsed_operand_t& operand = operands_.at(index); + assert(operand.num_words * 4 >= sizeof(T)); + assert(operand.offset + operand.num_words <= inst_.num_words); + return *reinterpret_cast(&words_[operand.offset]); + } + + private: + const std::vector words_; + const std::vector operands_; + spv_parsed_instruction_t inst_; + + /// The function in which this instruction was declared + Function* function_; + + /// The basic block in which this instruction was declared + BasicBlock* block_; + + /// This is a vector of pairs of all references to this instruction's result + /// id. The first element is the instruction in which this result id was + /// referenced and the second is the index of the word in the referencing + /// instruction where this instruction appeared + std::vector> uses_; +}; + +#define OPERATOR(OP) \ + bool operator OP(const Instruction& lhs, const Instruction& rhs); \ + bool operator OP(const Instruction& lhs, uint32_t rhs) + +OPERATOR(<); +OPERATOR(==); +#undef OPERATOR + +} // namespace libspirv + +// custom specialization of std::hash for Instruction +namespace std { +template <> +struct hash { + typedef libspirv::Instruction argument_type; + typedef std::size_t result_type; + result_type operator()(const argument_type& inst) const { + return hash()(inst.id()); + } +}; +} // namespace std + +#endif // LIBSPIRV_VAL_INSTRUCTION_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/validation_state.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/validation_state.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/validation_state.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/validation_state.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,795 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "val/validation_state.h" + +#include + +#include "opcode.h" +#include "val/basic_block.h" +#include "val/construct.h" +#include "val/function.h" + +using std::deque; +using std::make_pair; +using std::pair; +using std::string; +using std::unordered_map; +using std::vector; + +namespace libspirv { + +namespace { +bool IsInstructionInLayoutSection(ModuleLayoutSection layout, SpvOp op) { + // See Section 2.4 + bool out = false; + // clang-format off + switch (layout) { + case kLayoutCapabilities: out = op == SpvOpCapability; break; + case kLayoutExtensions: out = op == SpvOpExtension; break; + case kLayoutExtInstImport: out = op == SpvOpExtInstImport; break; + case kLayoutMemoryModel: out = op == SpvOpMemoryModel; break; + case kLayoutEntryPoint: out = op == SpvOpEntryPoint; break; + case kLayoutExecutionMode: out = op == SpvOpExecutionMode; break; + case kLayoutDebug1: + switch (op) { + case SpvOpSourceContinued: + case SpvOpSource: + case SpvOpSourceExtension: + case SpvOpString: + out = true; + break; + default: break; + } + break; + case kLayoutDebug2: + switch (op) { + case SpvOpName: + case SpvOpMemberName: + out = true; + break; + default: break; + } + break; + case kLayoutDebug3: + // Only OpModuleProcessed is allowed here. + out = (op == SpvOpModuleProcessed); + break; + case kLayoutAnnotations: + switch (op) { + case SpvOpDecorate: + case SpvOpMemberDecorate: + case SpvOpGroupDecorate: + case SpvOpGroupMemberDecorate: + case SpvOpDecorationGroup: + case SpvOpDecorateId: + case SpvOpDecorateStringGOOGLE: + case SpvOpMemberDecorateStringGOOGLE: + out = true; + break; + default: break; + } + break; + case kLayoutTypes: + if (spvOpcodeGeneratesType(op) || spvOpcodeIsConstant(op)) { + out = true; + break; + } + switch (op) { + case SpvOpTypeForwardPointer: + case SpvOpVariable: + case SpvOpLine: + case SpvOpNoLine: + case SpvOpUndef: + out = true; + break; + default: break; + } + break; + case kLayoutFunctionDeclarations: + case kLayoutFunctionDefinitions: + // NOTE: These instructions should NOT be in these layout sections + if (spvOpcodeGeneratesType(op) || spvOpcodeIsConstant(op)) { + out = false; + break; + } + switch (op) { + case SpvOpCapability: + case SpvOpExtension: + case SpvOpExtInstImport: + case SpvOpMemoryModel: + case SpvOpEntryPoint: + case SpvOpExecutionMode: + case SpvOpSourceContinued: + case SpvOpSource: + case SpvOpSourceExtension: + case SpvOpString: + case SpvOpName: + case SpvOpMemberName: + case SpvOpModuleProcessed: + case SpvOpDecorate: + case SpvOpMemberDecorate: + case SpvOpGroupDecorate: + case SpvOpGroupMemberDecorate: + case SpvOpDecorationGroup: + case SpvOpTypeForwardPointer: + out = false; + break; + default: + out = true; + break; + } + } + // clang-format on + return out; +} + +} // anonymous namespace + +ValidationState_t::ValidationState_t(const spv_const_context ctx, + const spv_const_validator_options opt) + : context_(ctx), + options_(opt), + instruction_counter_(0), + unresolved_forward_ids_{}, + operand_names_{}, + current_layout_section_(kLayoutCapabilities), + module_functions_(), + module_capabilities_(), + module_extensions_(), + ordered_instructions_(), + all_definitions_(), + global_vars_(), + local_vars_(), + struct_nesting_depth_(), + grammar_(ctx), + addressing_model_(SpvAddressingModelLogical), + memory_model_(SpvMemoryModelSimple), + in_function_(false) { + assert(opt && "Validator options may not be Null."); +} + +spv_result_t ValidationState_t::ForwardDeclareId(uint32_t id) { + unresolved_forward_ids_.insert(id); + return SPV_SUCCESS; +} + +spv_result_t ValidationState_t::RemoveIfForwardDeclared(uint32_t id) { + unresolved_forward_ids_.erase(id); + return SPV_SUCCESS; +} + +spv_result_t ValidationState_t::RegisterForwardPointer(uint32_t id) { + forward_pointer_ids_.insert(id); + return SPV_SUCCESS; +} + +bool ValidationState_t::IsForwardPointer(uint32_t id) const { + return (forward_pointer_ids_.find(id) != forward_pointer_ids_.end()); +} + +void ValidationState_t::AssignNameToId(uint32_t id, string name) { + operand_names_[id] = name; +} + +string ValidationState_t::getIdName(uint32_t id) const { + std::stringstream out; + out << id; + if (operand_names_.find(id) != end(operand_names_)) { + out << "[" << operand_names_.at(id) << "]"; + } + return out.str(); +} + +string ValidationState_t::getIdOrName(uint32_t id) const { + std::stringstream out; + if (operand_names_.find(id) != end(operand_names_)) { + out << operand_names_.at(id); + } else { + out << id; + } + return out.str(); +} + +size_t ValidationState_t::unresolved_forward_id_count() const { + return unresolved_forward_ids_.size(); +} + +vector ValidationState_t::UnresolvedForwardIds() const { + vector out(begin(unresolved_forward_ids_), + end(unresolved_forward_ids_)); + return out; +} + +bool ValidationState_t::IsDefinedId(uint32_t id) const { + return all_definitions_.find(id) != end(all_definitions_); +} + +const Instruction* ValidationState_t::FindDef(uint32_t id) const { + auto it = all_definitions_.find(id); + if (it == all_definitions_.end()) return nullptr; + return it->second; +} + +Instruction* ValidationState_t::FindDef(uint32_t id) { + auto it = all_definitions_.find(id); + if (it == all_definitions_.end()) return nullptr; + return it->second; +} + +// Increments the instruction count. Used for diagnostic +int ValidationState_t::increment_instruction_count() { + return instruction_counter_++; +} + +ModuleLayoutSection ValidationState_t::current_layout_section() const { + return current_layout_section_; +} + +void ValidationState_t::ProgressToNextLayoutSectionOrder() { + // Guard against going past the last element(kLayoutFunctionDefinitions) + if (current_layout_section_ <= kLayoutFunctionDefinitions) { + current_layout_section_ = + static_cast(current_layout_section_ + 1); + } +} + +bool ValidationState_t::IsOpcodeInCurrentLayoutSection(SpvOp op) { + return IsInstructionInLayoutSection(current_layout_section_, op); +} + +DiagnosticStream ValidationState_t::diag(spv_result_t error_code) const { + return libspirv::DiagnosticStream( + {0, 0, static_cast(instruction_counter_)}, context_->consumer, + error_code); +} + +deque& ValidationState_t::functions() { return module_functions_; } + +Function& ValidationState_t::current_function() { + assert(in_function_body()); + return module_functions_.back(); +} + +const Function& ValidationState_t::current_function() const { + assert(in_function_body()); + return module_functions_.back(); +} + +const Function* ValidationState_t::function(uint32_t id) const { + const auto it = id_to_function_.find(id); + if (it == id_to_function_.end()) return nullptr; + return it->second; +} + +bool ValidationState_t::in_function_body() const { return in_function_; } + +bool ValidationState_t::in_block() const { + return module_functions_.empty() == false && + module_functions_.back().current_block() != nullptr; +} + +void ValidationState_t::RegisterCapability(SpvCapability cap) { + // Avoid redundant work. Otherwise the recursion could induce work + // quadrdatic in the capability dependency depth. (Ok, not much, but + // it's something.) + if (module_capabilities_.Contains(cap)) return; + + module_capabilities_.Add(cap); + spv_operand_desc desc; + if (SPV_SUCCESS == + grammar_.lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, cap, &desc)) { + CapabilitySet(desc->numCapabilities, desc->capabilities) + .ForEach([this](SpvCapability c) { RegisterCapability(c); }); + } + + switch (cap) { + case SpvCapabilityKernel: + features_.group_ops_reduce_and_scans = true; + break; + case SpvCapabilityInt16: + features_.declare_int16_type = true; + break; + case SpvCapabilityFloat16: + case SpvCapabilityFloat16Buffer: + features_.declare_float16_type = true; + break; + case SpvCapabilityStorageUniformBufferBlock16: + case SpvCapabilityStorageUniform16: + case SpvCapabilityStoragePushConstant16: + case SpvCapabilityStorageInputOutput16: + features_.declare_int16_type = true; + features_.declare_float16_type = true; + features_.free_fp_rounding_mode = true; + break; + case SpvCapabilityVariablePointers: + features_.variable_pointers = true; + features_.variable_pointers_storage_buffer = true; + break; + case SpvCapabilityVariablePointersStorageBuffer: + features_.variable_pointers_storage_buffer = true; + break; + default: + break; + } +} + +void ValidationState_t::RegisterExtension(Extension ext) { + if (module_extensions_.Contains(ext)) return; + + module_extensions_.Add(ext); + + switch (ext) { + case kSPV_AMD_gpu_shader_half_float: + // SPV_AMD_gpu_shader_half_float enables float16 type. + // https://github.com/KhronosGroup/SPIRV-Tools/issues/1375 + features_.declare_float16_type = true; + break; + case kSPV_AMD_shader_ballot: + // The grammar doesn't encode the fact that SPV_AMD_shader_ballot + // enables the use of group operations Reduce, InclusiveScan, + // and ExclusiveScan. Enable it manually. + // https://github.com/KhronosGroup/SPIRV-Tools/issues/991 + features_.group_ops_reduce_and_scans = true; + break; + default: + break; + } +} + +bool ValidationState_t::HasAnyOfCapabilities( + const CapabilitySet& capabilities) const { + return module_capabilities_.HasAnyOf(capabilities); +} + +bool ValidationState_t::HasAnyOfExtensions( + const ExtensionSet& extensions) const { + return module_extensions_.HasAnyOf(extensions); +} + +void ValidationState_t::set_addressing_model(SpvAddressingModel am) { + addressing_model_ = am; +} + +SpvAddressingModel ValidationState_t::addressing_model() const { + return addressing_model_; +} + +void ValidationState_t::set_memory_model(SpvMemoryModel mm) { + memory_model_ = mm; +} + +SpvMemoryModel ValidationState_t::memory_model() const { return memory_model_; } + +spv_result_t ValidationState_t::RegisterFunction( + uint32_t id, uint32_t ret_type_id, SpvFunctionControlMask function_control, + uint32_t function_type_id) { + assert(in_function_body() == false && + "RegisterFunction can only be called when parsing the binary outside " + "of another function"); + in_function_ = true; + module_functions_.emplace_back(id, ret_type_id, function_control, + function_type_id); + id_to_function_.emplace(id, ¤t_function()); + + // TODO(umar): validate function type and type_id + + return SPV_SUCCESS; +} + +spv_result_t ValidationState_t::RegisterFunctionEnd() { + assert(in_function_body() == true && + "RegisterFunctionEnd can only be called when parsing the binary " + "inside of another function"); + assert(in_block() == false && + "RegisterFunctionParameter can only be called when parsing the binary " + "ouside of a block"); + current_function().RegisterFunctionEnd(); + in_function_ = false; + return SPV_SUCCESS; +} + +void ValidationState_t::RegisterInstruction( + const spv_parsed_instruction_t& inst) { + if (in_function_body()) { + ordered_instructions_.emplace_back(&inst, ¤t_function(), + current_function().current_block()); + } else { + ordered_instructions_.emplace_back(&inst, nullptr, nullptr); + } + uint32_t id = ordered_instructions_.back().id(); + if (id) { + all_definitions_.insert(make_pair(id, &ordered_instructions_.back())); + } + + // If the instruction is using an OpTypeSampledImage as an operand, it should + // be recorded. The validator will ensure that all usages of an + // OpTypeSampledImage and its definition are in the same basic block. + for (uint16_t i = 0; i < inst.num_operands; ++i) { + const spv_parsed_operand_t& operand = inst.operands[i]; + if (SPV_OPERAND_TYPE_ID == operand.type) { + const uint32_t operand_word = inst.words[operand.offset]; + Instruction* operand_inst = FindDef(operand_word); + if (operand_inst && SpvOpSampledImage == operand_inst->opcode()) { + RegisterSampledImageConsumer(operand_word, inst.result_id); + } + } + } +} + +std::vector ValidationState_t::getSampledImageConsumers( + uint32_t sampled_image_id) const { + std::vector result; + auto iter = sampled_image_consumers_.find(sampled_image_id); + if (iter != sampled_image_consumers_.end()) { + result = iter->second; + } + return result; +} + +void ValidationState_t::RegisterSampledImageConsumer(uint32_t sampled_image_id, + uint32_t consumer_id) { + sampled_image_consumers_[sampled_image_id].push_back(consumer_id); +} + +uint32_t ValidationState_t::getIdBound() const { return id_bound_; } + +void ValidationState_t::setIdBound(const uint32_t bound) { id_bound_ = bound; } + +bool ValidationState_t::RegisterUniqueTypeDeclaration( + const spv_parsed_instruction_t& inst) { + std::vector key; + key.push_back(static_cast(inst.opcode)); + for (int index = 0; index < inst.num_operands; ++index) { + const spv_parsed_operand_t& operand = inst.operands[index]; + + if (operand.type == SPV_OPERAND_TYPE_RESULT_ID) continue; + + const int words_begin = operand.offset; + const int words_end = words_begin + operand.num_words; + assert(words_end <= static_cast(inst.num_words)); + + key.insert(key.end(), inst.words + words_begin, inst.words + words_end); + } + + return unique_type_declarations_.insert(std::move(key)).second; +} + +uint32_t ValidationState_t::GetTypeId(uint32_t id) const { + const Instruction* inst = FindDef(id); + return inst ? inst->type_id() : 0; +} + +SpvOp ValidationState_t::GetIdOpcode(uint32_t id) const { + const Instruction* inst = FindDef(id); + return inst ? inst->opcode() : SpvOpNop; +} + +uint32_t ValidationState_t::GetComponentType(uint32_t id) const { + const Instruction* inst = FindDef(id); + assert(inst); + + switch (inst->opcode()) { + case SpvOpTypeFloat: + case SpvOpTypeInt: + case SpvOpTypeBool: + return id; + + case SpvOpTypeVector: + return inst->word(2); + + case SpvOpTypeMatrix: + return GetComponentType(inst->word(2)); + + default: + break; + } + + if (inst->type_id()) return GetComponentType(inst->type_id()); + + assert(0); + return 0; +} + +uint32_t ValidationState_t::GetDimension(uint32_t id) const { + const Instruction* inst = FindDef(id); + assert(inst); + + switch (inst->opcode()) { + case SpvOpTypeFloat: + case SpvOpTypeInt: + case SpvOpTypeBool: + return 1; + + case SpvOpTypeVector: + case SpvOpTypeMatrix: + return inst->word(3); + + default: + break; + } + + if (inst->type_id()) return GetDimension(inst->type_id()); + + assert(0); + return 0; +} + +uint32_t ValidationState_t::GetBitWidth(uint32_t id) const { + const uint32_t component_type_id = GetComponentType(id); + const Instruction* inst = FindDef(component_type_id); + assert(inst); + + if (inst->opcode() == SpvOpTypeFloat || inst->opcode() == SpvOpTypeInt) + return inst->word(2); + + if (inst->opcode() == SpvOpTypeBool) return 1; + + assert(0); + return 0; +} + +bool ValidationState_t::IsFloatScalarType(uint32_t id) const { + const Instruction* inst = FindDef(id); + assert(inst); + return inst->opcode() == SpvOpTypeFloat; +} + +bool ValidationState_t::IsFloatVectorType(uint32_t id) const { + const Instruction* inst = FindDef(id); + assert(inst); + + if (inst->opcode() == SpvOpTypeVector) { + return IsFloatScalarType(GetComponentType(id)); + } + + return false; +} + +bool ValidationState_t::IsFloatScalarOrVectorType(uint32_t id) const { + const Instruction* inst = FindDef(id); + assert(inst); + + if (inst->opcode() == SpvOpTypeFloat) { + return true; + } + + if (inst->opcode() == SpvOpTypeVector) { + return IsFloatScalarType(GetComponentType(id)); + } + + return false; +} + +bool ValidationState_t::IsIntScalarType(uint32_t id) const { + const Instruction* inst = FindDef(id); + assert(inst); + return inst->opcode() == SpvOpTypeInt; +} + +bool ValidationState_t::IsIntVectorType(uint32_t id) const { + const Instruction* inst = FindDef(id); + assert(inst); + + if (inst->opcode() == SpvOpTypeVector) { + return IsIntScalarType(GetComponentType(id)); + } + + return false; +} + +bool ValidationState_t::IsIntScalarOrVectorType(uint32_t id) const { + const Instruction* inst = FindDef(id); + assert(inst); + + if (inst->opcode() == SpvOpTypeInt) { + return true; + } + + if (inst->opcode() == SpvOpTypeVector) { + return IsIntScalarType(GetComponentType(id)); + } + + return false; +} + +bool ValidationState_t::IsUnsignedIntScalarType(uint32_t id) const { + const Instruction* inst = FindDef(id); + assert(inst); + return inst->opcode() == SpvOpTypeInt && inst->word(3) == 0; +} + +bool ValidationState_t::IsUnsignedIntVectorType(uint32_t id) const { + const Instruction* inst = FindDef(id); + assert(inst); + + if (inst->opcode() == SpvOpTypeVector) { + return IsUnsignedIntScalarType(GetComponentType(id)); + } + + return false; +} + +bool ValidationState_t::IsSignedIntScalarType(uint32_t id) const { + const Instruction* inst = FindDef(id); + assert(inst); + return inst->opcode() == SpvOpTypeInt && inst->word(3) == 1; +} + +bool ValidationState_t::IsSignedIntVectorType(uint32_t id) const { + const Instruction* inst = FindDef(id); + assert(inst); + + if (inst->opcode() == SpvOpTypeVector) { + return IsSignedIntScalarType(GetComponentType(id)); + } + + return false; +} + +bool ValidationState_t::IsBoolScalarType(uint32_t id) const { + const Instruction* inst = FindDef(id); + assert(inst); + return inst->opcode() == SpvOpTypeBool; +} + +bool ValidationState_t::IsBoolVectorType(uint32_t id) const { + const Instruction* inst = FindDef(id); + assert(inst); + + if (inst->opcode() == SpvOpTypeVector) { + return IsBoolScalarType(GetComponentType(id)); + } + + return false; +} + +bool ValidationState_t::IsBoolScalarOrVectorType(uint32_t id) const { + const Instruction* inst = FindDef(id); + assert(inst); + + if (inst->opcode() == SpvOpTypeBool) { + return true; + } + + if (inst->opcode() == SpvOpTypeVector) { + return IsBoolScalarType(GetComponentType(id)); + } + + return false; +} + +bool ValidationState_t::IsFloatMatrixType(uint32_t id) const { + const Instruction* inst = FindDef(id); + assert(inst); + + if (inst->opcode() == SpvOpTypeMatrix) { + return IsFloatScalarType(GetComponentType(id)); + } + + return false; +} + +bool ValidationState_t::GetMatrixTypeInfo(uint32_t id, uint32_t* num_rows, + uint32_t* num_cols, + uint32_t* column_type, + uint32_t* component_type) const { + if (!id) return false; + + const Instruction* mat_inst = FindDef(id); + assert(mat_inst); + if (mat_inst->opcode() != SpvOpTypeMatrix) return false; + + const uint32_t vec_type = mat_inst->word(2); + const Instruction* vec_inst = FindDef(vec_type); + assert(vec_inst); + + if (vec_inst->opcode() != SpvOpTypeVector) { + assert(0); + return false; + } + + *num_cols = mat_inst->word(3); + *num_rows = vec_inst->word(3); + *column_type = mat_inst->word(2); + *component_type = vec_inst->word(2); + + return true; +} + +bool ValidationState_t::GetStructMemberTypes( + uint32_t struct_type_id, std::vector* member_types) const { + member_types->clear(); + if (!struct_type_id) return false; + + const Instruction* inst = FindDef(struct_type_id); + assert(inst); + if (inst->opcode() != SpvOpTypeStruct) return false; + + *member_types = + std::vector(inst->words().cbegin() + 2, inst->words().cend()); + + if (member_types->empty()) return false; + + return true; +} + +bool ValidationState_t::IsPointerType(uint32_t id) const { + const Instruction* inst = FindDef(id); + assert(inst); + return inst->opcode() == SpvOpTypePointer; +} + +bool ValidationState_t::GetPointerTypeInfo(uint32_t id, uint32_t* data_type, + uint32_t* storage_class) const { + if (!id) return false; + + const Instruction* inst = FindDef(id); + assert(inst); + if (inst->opcode() != SpvOpTypePointer) return false; + + *storage_class = inst->word(2); + *data_type = inst->word(3); + return true; +} + +uint32_t ValidationState_t::GetOperandTypeId( + const spv_parsed_instruction_t* inst, size_t operand_index) const { + assert(operand_index < inst->num_operands); + const spv_parsed_operand_t& operand = inst->operands[operand_index]; + assert(operand.num_words == 1); + return GetTypeId(inst->words[operand.offset]); +} + +bool ValidationState_t::GetConstantValUint64(uint32_t id, uint64_t* val) const { + const Instruction* inst = FindDef(id); + if (!inst) { + assert(0 && "Instruction not found"); + return false; + } + + if (inst->opcode() != SpvOpConstant && inst->opcode() != SpvOpSpecConstant) + return false; + + if (!IsIntScalarType(inst->type_id())) return false; + + if (inst->words().size() == 4) { + *val = inst->word(3); + } else { + assert(inst->words().size() == 5); + *val = inst->word(3); + *val |= uint64_t(inst->word(4)) << 32; + } + return true; +} + +std::tuple ValidationState_t::EvalInt32IfConst( + uint32_t id) { + const Instruction* const inst = FindDef(id); + assert(inst); + const uint32_t type = inst->type_id(); + + if (!IsIntScalarType(type) || GetBitWidth(type) != 32) { + return std::make_tuple(false, false, 0); + } + + if (inst->opcode() != SpvOpConstant && inst->opcode() != SpvOpSpecConstant) { + return std::make_tuple(true, false, 0); + } + + assert(inst->words().size() == 4); + return std::make_tuple(true, true, inst->word(3)); +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/validation_state.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/validation_state.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/val/validation_state.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/val/validation_state.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,566 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_VAL_VALIDATIONSTATE_H_ +#define LIBSPIRV_VAL_VALIDATIONSTATE_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include "assembly_grammar.h" +#include "decoration.h" +#include "diagnostic.h" +#include "enum_set.h" +#include "latest_version_spirv_header.h" +#include "spirv-tools/libspirv.h" +#include "spirv_definition.h" +#include "val/function.h" +#include "val/instruction.h" + +namespace libspirv { + +/// This enum represents the sections of a SPIRV module. See section 2.4 +/// of the SPIRV spec for additional details of the order. The enumerant values +/// are in the same order as the vector returned by GetModuleOrder +enum ModuleLayoutSection { + kLayoutCapabilities, /// < Section 2.4 #1 + kLayoutExtensions, /// < Section 2.4 #2 + kLayoutExtInstImport, /// < Section 2.4 #3 + kLayoutMemoryModel, /// < Section 2.4 #4 + kLayoutEntryPoint, /// < Section 2.4 #5 + kLayoutExecutionMode, /// < Section 2.4 #6 + kLayoutDebug1, /// < Section 2.4 #7 > 1 + kLayoutDebug2, /// < Section 2.4 #7 > 2 + kLayoutDebug3, /// < Section 2.4 #7 > 3 + kLayoutAnnotations, /// < Section 2.4 #8 + kLayoutTypes, /// < Section 2.4 #9 + kLayoutFunctionDeclarations, /// < Section 2.4 #10 + kLayoutFunctionDefinitions /// < Section 2.4 #11 +}; + +/// This class manages the state of the SPIR-V validation as it is being parsed. +class ValidationState_t { + public: + // Features that can optionally be turned on by a capability. + struct Feature { + bool declare_int16_type = false; // Allow OpTypeInt with 16 bit width? + bool declare_float16_type = false; // Allow OpTypeFloat with 16 bit width? + bool free_fp_rounding_mode = false; // Allow the FPRoundingMode decoration + // and its vaules to be used without + // requiring any capability + + // Allow functionalities enabled by VariablePointers capability. + bool variable_pointers = false; + // Allow functionalities enabled by VariablePointersStorageBuffer + // capability. + bool variable_pointers_storage_buffer = false; + + // Permit group oerations Reduce, InclusiveScan, ExclusiveScan + bool group_ops_reduce_and_scans = false; + }; + + ValidationState_t(const spv_const_context context, + const spv_const_validator_options opt); + + /// Returns the context + spv_const_context context() const { return context_; } + + /// Returns the command line options + spv_const_validator_options options() const { return options_; } + + /// Forward declares the id in the module + spv_result_t ForwardDeclareId(uint32_t id); + + /// Removes a forward declared ID if it has been defined + spv_result_t RemoveIfForwardDeclared(uint32_t id); + + /// Registers an ID as a forward pointer + spv_result_t RegisterForwardPointer(uint32_t id); + + /// Returns whether or not an ID is a forward pointer + bool IsForwardPointer(uint32_t id) const; + + /// Assigns a name to an ID + void AssignNameToId(uint32_t id, std::string name); + + /// Returns a string representation of the ID in the format [Name] where + /// the is the numeric valid of the id and the Name is a name assigned by + /// the OpName instruction + std::string getIdName(uint32_t id) const; + + /// Accessor function for ID bound. + uint32_t getIdBound() const; + + /// Mutator function for ID bound. + void setIdBound(uint32_t bound); + + /// Like getIdName but does not display the id if the \p id has a name + std::string getIdOrName(uint32_t id) const; + + /// Returns the number of ID which have been forward referenced but not + /// defined + size_t unresolved_forward_id_count() const; + + /// Returns a vector of unresolved forward ids. + std::vector UnresolvedForwardIds() const; + + /// Returns true if the id has been defined + bool IsDefinedId(uint32_t id) const; + + /// Increments the instruction count. Used for diagnostic + int increment_instruction_count(); + + /// Returns the current layout section which is being processed + ModuleLayoutSection current_layout_section() const; + + /// Increments the module_layout_order_section_ + void ProgressToNextLayoutSectionOrder(); + + /// Determines if the op instruction is part of the current section + bool IsOpcodeInCurrentLayoutSection(SpvOp op); + + libspirv::DiagnosticStream diag(spv_result_t error_code) const; + + /// Returns the function states + std::deque& functions(); + + /// Returns the function states + Function& current_function(); + const Function& current_function() const; + + /// Returns function state with the given id, or nullptr if no such function. + const Function* function(uint32_t id) const; + + /// Returns true if the called after a function instruction but before the + /// function end instruction + bool in_function_body() const; + + /// Returns true if called after a label instruction but before a branch + /// instruction + bool in_block() const; + + /// Registers the given as an Entry Point with |execution_model|. + void RegisterEntryPointId(const uint32_t id, + SpvExecutionModel execution_model) { + entry_points_.push_back(id); + entry_point_interfaces_.emplace(id, std::vector()); + entry_point_to_execution_models_[id].insert(execution_model); + } + + /// Returns a list of entry point function ids + const std::vector& entry_points() const { return entry_points_; } + + /// Adds a new interface id to the interfaces of the given entry point. + void RegisterInterfaceForEntryPoint(uint32_t entry_point, + uint32_t interface) { + entry_point_interfaces_[entry_point].push_back(interface); + } + + /// Registers execution mode for the given entry point. + void RegisterExecutionModeForEntryPoint(uint32_t entry_point, + SpvExecutionMode execution_mode) { + entry_point_to_execution_modes_[entry_point].insert(execution_mode); + } + + /// Returns the interfaces of a given entry point. If the given id is not a + /// valid Entry Point id, std::out_of_range exception is thrown. + const std::vector& entry_point_interfaces( + uint32_t entry_point) const { + return entry_point_interfaces_.at(entry_point); + } + + /// Returns Execution Models for the given Entry Point. + /// Returns nullptr if none found (would trigger assertion). + const std::set* GetExecutionModels( + uint32_t entry_point) const { + const auto it = entry_point_to_execution_models_.find(entry_point); + if (it == entry_point_to_execution_models_.end()) { + assert(0); + return nullptr; + } + return &it->second; + } + + /// Returns Execution Modes for the given Entry Point. + /// Returns nullptr if none found. + const std::set* GetExecutionModes( + uint32_t entry_point) const { + const auto it = entry_point_to_execution_modes_.find(entry_point); + if (it == entry_point_to_execution_modes_.end()) { + return nullptr; + } + return &it->second; + } + + /// Inserts an to the set of functions that are target of OpFunctionCall. + void AddFunctionCallTarget(const uint32_t id) { + function_call_targets_.insert(id); + current_function().AddFunctionCallTarget(id); + } + + /// Returns whether or not a function is the target of OpFunctionCall. + bool IsFunctionCallTarget(const uint32_t id) { + return (function_call_targets_.find(id) != function_call_targets_.end()); + } + + /// Registers the capability and its dependent capabilities + void RegisterCapability(SpvCapability cap); + + /// Registers the extension. + void RegisterExtension(Extension ext); + + /// Registers the function in the module. Subsequent instructions will be + /// called against this function + spv_result_t RegisterFunction(uint32_t id, uint32_t ret_type_id, + SpvFunctionControlMask function_control, + uint32_t function_type_id); + + /// Register a function end instruction + spv_result_t RegisterFunctionEnd(); + + /// Returns true if the capability is enabled in the module. + bool HasCapability(SpvCapability cap) const { + return module_capabilities_.Contains(cap); + } + + /// Returns true if the extension is enabled in the module. + bool HasExtension(Extension ext) const { + return module_extensions_.Contains(ext); + } + + /// Returns true if any of the capabilities is enabled, or if |capabilities| + /// is an empty set. + bool HasAnyOfCapabilities(const libspirv::CapabilitySet& capabilities) const; + + /// Returns true if any of the extensions is enabled, or if |extensions| + /// is an empty set. + bool HasAnyOfExtensions(const libspirv::ExtensionSet& extensions) const; + + /// Sets the addressing model of this module (logical/physical). + void set_addressing_model(SpvAddressingModel am); + + /// Returns the addressing model of this module, or Logical if uninitialized. + SpvAddressingModel addressing_model() const; + + /// Sets the memory model of this module. + void set_memory_model(SpvMemoryModel mm); + + /// Returns the memory model of this module, or Simple if uninitialized. + SpvMemoryModel memory_model() const; + + const AssemblyGrammar& grammar() const { return grammar_; } + + /// Registers the instruction + void RegisterInstruction(const spv_parsed_instruction_t& inst); + + /// Registers the decoration for the given + void RegisterDecorationForId(uint32_t id, const Decoration& dec) { + id_decorations_[id].push_back(dec); + } + + /// Registers the list of decorations for the given + template + void RegisterDecorationsForId(uint32_t id, InputIt begin, InputIt end) { + std::vector& cur_decs = id_decorations_[id]; + cur_decs.insert(cur_decs.end(), begin, end); + } + + /// Registers the list of decorations for the given member of the given + /// structure. + template + void RegisterDecorationsForStructMember(uint32_t struct_id, + uint32_t member_index, InputIt begin, + InputIt end) { + RegisterDecorationsForId(struct_id, begin, end); + for (auto& decoration : id_decorations_[struct_id]) { + decoration.set_struct_member_index(member_index); + } + } + + /// Returns all the decorations for the given . If no decorations exist + /// for the , it registers an empty vector for it in the map and + /// returns the empty vector. + std::vector& id_decorations(uint32_t id) { + return id_decorations_[id]; + } + const std::vector& id_decorations(uint32_t id) const { + // TODO: This would throw or generate SIGABRT if id has no + // decorations. Remove/refactor this function. + return id_decorations_.at(id); + } + + // Returns const pointer to the internal decoration container. + const std::map>& id_decorations() const { + return id_decorations_; + } + + /// Finds id's def, if it exists. If found, returns the definition otherwise + /// nullptr + const Instruction* FindDef(uint32_t id) const; + + /// Finds id's def, if it exists. If found, returns the definition otherwise + /// nullptr + Instruction* FindDef(uint32_t id); + + /// Returns a deque of instructions in the order they appear in the binary + const std::deque& ordered_instructions() const { + return ordered_instructions_; + } + + /// Returns a map of instructions mapped by their result id + const std::unordered_map& all_definitions() const { + return all_definitions_; + } + + /// Returns a vector containing the Ids of instructions that consume the given + /// SampledImage id. + std::vector getSampledImageConsumers(uint32_t id) const; + + /// Records cons_id as a consumer of sampled_image_id. + void RegisterSampledImageConsumer(uint32_t sampled_image_id, + uint32_t cons_id); + + /// Returns the set of Global Variables. + std::unordered_set& global_vars() { return global_vars_; } + + /// Returns the set of Local Variables. + std::unordered_set& local_vars() { return local_vars_; } + + /// Returns the number of Global Variables. + size_t num_global_vars() { return global_vars_.size(); } + + /// Returns the number of Local Variables. + size_t num_local_vars() { return local_vars_.size(); } + + /// Inserts a new to the set of Global Variables. + void registerGlobalVariable(const uint32_t id) { global_vars_.insert(id); } + + /// Inserts a new to the set of Local Variables. + void registerLocalVariable(const uint32_t id) { local_vars_.insert(id); } + + /// Sets the struct nesting depth for a given struct ID + void set_struct_nesting_depth(uint32_t id, uint32_t depth) { + struct_nesting_depth_[id] = depth; + } + + /// Returns the nesting depth of a given structure ID + uint32_t struct_nesting_depth(uint32_t id) { + return struct_nesting_depth_[id]; + } + + /// Records that the structure type has a member decorated with a built-in. + void RegisterStructTypeWithBuiltInMember(uint32_t id) { + builtin_structs_.insert(id); + } + + /// Returns true if the struct type with the given Id has a BuiltIn member. + bool IsStructTypeWithBuiltInMember(uint32_t id) const { + return (builtin_structs_.find(id) != builtin_structs_.end()); + } + + // Returns the state of optional features. + const Feature& features() const { return features_; } + + /// Adds the instruction data to unique_type_declarations_. + /// Returns false if an identical type declaration already exists. + bool RegisterUniqueTypeDeclaration(const spv_parsed_instruction_t& inst); + + // Returns type_id of the scalar component of |id|. + // |id| can be either + // - scalar, vector or matrix type + // - object of either scalar, vector or matrix type + uint32_t GetComponentType(uint32_t id) const; + + // Returns + // - 1 for scalar types or objects + // - vector size for vector types or objects + // - num columns for matrix types or objects + // Should not be called with any other arguments (will return zero and invoke + // assertion). + uint32_t GetDimension(uint32_t id) const; + + // Returns bit width of scalar or component. + // |id| can be + // - scalar, vector or matrix type + // - object of either scalar, vector or matrix type + // Will invoke assertion and return 0 if |id| is none of the above. + uint32_t GetBitWidth(uint32_t id) const; + + // Provides detailed information on matrix type. + // Returns false iff |id| is not matrix type. + bool GetMatrixTypeInfo(uint32_t id, uint32_t* num_rows, uint32_t* num_cols, + uint32_t* column_type, uint32_t* component_type) const; + + // Collects struct member types into |member_types|. + // Returns false iff not struct type or has no members. + // Deletes prior contents of |member_types|. + bool GetStructMemberTypes(uint32_t struct_type_id, + std::vector* member_types) const; + + // Returns true iff |id| is a type corresponding to the name of the function. + // Only works for types not for objects. + bool IsFloatScalarType(uint32_t id) const; + bool IsFloatVectorType(uint32_t id) const; + bool IsFloatScalarOrVectorType(uint32_t id) const; + bool IsFloatMatrixType(uint32_t id) const; + bool IsIntScalarType(uint32_t id) const; + bool IsIntVectorType(uint32_t id) const; + bool IsIntScalarOrVectorType(uint32_t id) const; + bool IsUnsignedIntScalarType(uint32_t id) const; + bool IsUnsignedIntVectorType(uint32_t id) const; + bool IsSignedIntScalarType(uint32_t id) const; + bool IsSignedIntVectorType(uint32_t id) const; + bool IsBoolScalarType(uint32_t id) const; + bool IsBoolVectorType(uint32_t id) const; + bool IsBoolScalarOrVectorType(uint32_t id) const; + bool IsPointerType(uint32_t id) const; + + // Gets value from OpConstant and OpSpecConstant as uint64. + // Returns false on failure (no instruction, wrong instruction, not int). + bool GetConstantValUint64(uint32_t id, uint64_t* val) const; + + // Returns type_id if id has type or zero otherwise. + uint32_t GetTypeId(uint32_t id) const; + + // Returns opcode of the instruction which issued the id or OpNop if the + // instruction is not registered. + SpvOp GetIdOpcode(uint32_t id) const; + + // Returns type_id for given id operand if it has a type or zero otherwise. + // |operand_index| is expected to be pointing towards an operand which is an + // id. + uint32_t GetOperandTypeId(const spv_parsed_instruction_t* inst, + size_t operand_index) const; + + // Provides information on pointer type. Returns false iff not pointer type. + bool GetPointerTypeInfo(uint32_t id, uint32_t* data_type, + uint32_t* storage_class) const; + + // Tries to evaluate a 32-bit signed or unsigned scalar integer constant. + // Returns tuple . + std::tuple EvalInt32IfConst(uint32_t id); + + private: + ValidationState_t(const ValidationState_t&); + + const spv_const_context context_; + + /// Stores the Validator command line options. Must be a valid options object. + const spv_const_validator_options options_; + + /// Tracks the number of instructions evaluated by the validator + int instruction_counter_; + + /// IDs which have been forward declared but have not been defined + std::unordered_set unresolved_forward_ids_; + + /// IDs that have been declared as forward pointers. + std::unordered_set forward_pointer_ids_; + + /// Stores a vector of instructions that use the result of a given + /// OpSampledImage instruction. + std::unordered_map> sampled_image_consumers_; + + /// A map of operand IDs and their names defined by the OpName instruction + std::unordered_map operand_names_; + + /// The section of the code being processed + ModuleLayoutSection current_layout_section_; + + /// A list of functions in the module. + /// Pointers to objects in this container are guaranteed to be stable and + /// valid until the end of lifetime of the validation state. + std::deque module_functions_; + + /// Capabilities declared in the module + libspirv::CapabilitySet module_capabilities_; + + /// Extensions declared in the module + libspirv::ExtensionSet module_extensions_; + + /// List of all instructions in the order they appear in the binary + /// Pointers to objects in this container are guaranteed to be stable and + /// valid until the end of lifetime of the validation state. + std::deque ordered_instructions_; + + /// Instructions that can be referenced by Ids + std::unordered_map all_definitions_; + + /// IDs that are entry points, ie, arguments to OpEntryPoint. + std::vector entry_points_; + + /// Maps an entry point id to its interfaces. + std::unordered_map> entry_point_interfaces_; + + /// Functions IDs that are target of OpFunctionCall. + std::unordered_set function_call_targets_; + + /// ID Bound from the Header + uint32_t id_bound_; + + /// Set of Global Variable IDs (Storage Class other than 'Function') + std::unordered_set global_vars_; + + /// Set of Local Variable IDs ('Function' Storage Class) + std::unordered_set local_vars_; + + /// Set of struct types that have members with a BuiltIn decoration. + std::unordered_set builtin_structs_; + + /// Structure Nesting Depth + std::unordered_map struct_nesting_depth_; + + /// Stores the list of decorations for a given + std::map> id_decorations_; + + /// Stores type declarations which need to be unique (i.e. non-aggregates), + /// in the form [opcode, operand words], result_id is not stored. + /// Using ordered set to avoid the need for a vector hash function. + /// The size of this container is expected not to exceed double-digits. + std::set> unique_type_declarations_; + + AssemblyGrammar grammar_; + + SpvAddressingModel addressing_model_; + SpvMemoryModel memory_model_; + + /// NOTE: See correspoding getter functions + bool in_function_; + + /// The state of optional features. These are determined by capabilities + /// declared by the module. + Feature features_; + + /// Maps function ids to function stat objects. + std::unordered_map id_to_function_; + + /// Mapping entry point -> execution models. It is presumed that the same + /// function could theoretically be used as 'main' by multiple OpEntryPoint + /// instructions. + std::unordered_map> + entry_point_to_execution_models_; + + /// Mapping entry point -> execution modes. + std::unordered_map> + entry_point_to_execution_modes_; +}; + +} // namespace libspirv + +#endif /// LIBSPIRV_VAL_VALIDATIONSTATE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_adjacency.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_adjacency.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_adjacency.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_adjacency.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,84 @@ +// Copyright (c) 2018 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. + +// Validates correctness of the intra-block preconditions of SPIR-V +// instructions. + +#include "validate.h" + +#include + +#include "diagnostic.h" +#include "opcode.h" +#include "val/instruction.h" +#include "val/validation_state.h" + +namespace libspirv { + +spv_result_t ValidateAdjacency(ValidationState_t& _) { + const auto& instructions = _.ordered_instructions(); + for (auto i = instructions.cbegin(); i != instructions.cend(); ++i) { + switch (i->opcode()) { + case SpvOpPhi: + if (i != instructions.cbegin()) { + switch (prev(i)->opcode()) { + case SpvOpLabel: + case SpvOpPhi: + case SpvOpLine: + break; + default: + return _.diag(SPV_ERROR_INVALID_DATA) + << "OpPhi must appear before all non-OpPhi instructions " + << "(except for OpLine, which can be mixed with OpPhi)."; + } + } + break; + case SpvOpLoopMerge: + if (next(i) != instructions.cend()) { + switch (next(i)->opcode()) { + case SpvOpBranch: + case SpvOpBranchConditional: + break; + default: + return _.diag(SPV_ERROR_INVALID_DATA) + << "OpLoopMerge must immediately precede either an " + << "OpBranch or OpBranchConditional instruction. " + << "OpLoopMerge must be the second-to-last instruction in " + << "its block."; + } + } + break; + case SpvOpSelectionMerge: + if (next(i) != instructions.cend()) { + switch (next(i)->opcode()) { + case SpvOpBranchConditional: + case SpvOpSwitch: + break; + default: + return _.diag(SPV_ERROR_INVALID_DATA) + << "OpSelectionMerge must immediately precede either an " + << "OpBranchConditional or OpSwitch instruction. " + << "OpSelectionMerge must be the second-to-last " + << "instruction in its block."; + } + } + default: + break; + } + } + + return SPV_SUCCESS; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_arithmetics.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_arithmetics.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_arithmetics.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_arithmetics.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,471 @@ +// Copyright (c) 2017 Google 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. + +// Performs validation of arithmetic instructions. + +#include "validate.h" + +#include "diagnostic.h" +#include "opcode.h" +#include "val/instruction.h" +#include "val/validation_state.h" + +namespace libspirv { + +namespace { + +// Returns operand word for given instruction and operand index. +// The operand is expected to only have one word. +inline uint32_t GetOperandWord(const spv_parsed_instruction_t* inst, + size_t operand_index) { + assert(operand_index < inst->num_operands); + const spv_parsed_operand_t& operand = inst->operands[operand_index]; + assert(operand.num_words == 1); + return inst->words[operand.offset]; +} + +// Returns the type id of instruction operand at |operand_index|. +// The operand is expected to be an id. +inline uint32_t GetOperandTypeId(ValidationState_t& _, + const spv_parsed_instruction_t* inst, + size_t operand_index) { + return _.GetTypeId(GetOperandWord(inst, operand_index)); +} +} // namespace + +// Validates correctness of arithmetic instructions. +spv_result_t ArithmeticsPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const SpvOp opcode = static_cast(inst->opcode); + const uint32_t result_type = inst->type_id; + + switch (opcode) { + case SpvOpFAdd: + case SpvOpFSub: + case SpvOpFMul: + case SpvOpFDiv: + case SpvOpFRem: + case SpvOpFMod: + case SpvOpFNegate: { + if (!_.IsFloatScalarType(result_type) && + !_.IsFloatVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected floating scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + for (size_t operand_index = 2; operand_index < inst->num_operands; + ++operand_index) { + if (GetOperandTypeId(_, inst, operand_index) != result_type) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected arithmetic operands to be of Result Type: " + << spvOpcodeString(opcode) << " operand index " + << operand_index; + } + break; + } + + case SpvOpUDiv: + case SpvOpUMod: { + if (!_.IsUnsignedIntScalarType(result_type) && + !_.IsUnsignedIntVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected unsigned int scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + for (size_t operand_index = 2; operand_index < inst->num_operands; + ++operand_index) { + if (GetOperandTypeId(_, inst, operand_index) != result_type) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected arithmetic operands to be of Result Type: " + << spvOpcodeString(opcode) << " operand index " + << operand_index; + } + break; + } + + case SpvOpISub: + case SpvOpIAdd: + case SpvOpIMul: + case SpvOpSDiv: + case SpvOpSMod: + case SpvOpSRem: + case SpvOpSNegate: { + if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected int scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t dimension = _.GetDimension(result_type); + const uint32_t bit_width = _.GetBitWidth(result_type); + + for (size_t operand_index = 2; operand_index < inst->num_operands; + ++operand_index) { + const uint32_t type_id = GetOperandTypeId(_, inst, operand_index); + if (!type_id || + (!_.IsIntScalarType(type_id) && !_.IsIntVectorType(type_id))) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected int scalar or vector type as operand: " + << spvOpcodeString(opcode) << " operand index " + << operand_index; + + if (_.GetDimension(type_id) != dimension) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected arithmetic operands to have the same dimension " + << "as Result Type: " << spvOpcodeString(opcode) + << " operand index " << operand_index; + + if (_.GetBitWidth(type_id) != bit_width) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected arithmetic operands to have the same bit width " + << "as Result Type: " << spvOpcodeString(opcode) + << " operand index " << operand_index; + } + break; + } + + case SpvOpDot: { + if (!_.IsFloatScalarType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected float scalar type as Result Type: " + << spvOpcodeString(opcode); + + uint32_t first_vector_num_components = 0; + + for (size_t operand_index = 2; operand_index < inst->num_operands; + ++operand_index) { + const uint32_t type_id = GetOperandTypeId(_, inst, operand_index); + + if (!type_id || !_.IsFloatVectorType(type_id)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected float vector as operand: " + << spvOpcodeString(opcode) << " operand index " + << operand_index; + + const uint32_t component_type = _.GetComponentType(type_id); + if (component_type != result_type) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected component type to be equal to Result Type: " + << spvOpcodeString(opcode) << " operand index " + << operand_index; + + const uint32_t num_components = _.GetDimension(type_id); + if (operand_index == 2) { + first_vector_num_components = num_components; + } else if (num_components != first_vector_num_components) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected operands to have the same number of componenets: " + << spvOpcodeString(opcode); + } + } + break; + } + + case SpvOpVectorTimesScalar: { + if (!_.IsFloatVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected float vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t vector_type_id = GetOperandTypeId(_, inst, 2); + if (result_type != vector_type_id) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected vector operand type to be equal to Result Type: " + << spvOpcodeString(opcode); + + const uint32_t component_type = _.GetComponentType(vector_type_id); + + const uint32_t scalar_type_id = GetOperandTypeId(_, inst, 3); + if (component_type != scalar_type_id) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected scalar operand type to be equal to the component " + << "type of the vector operand: " << spvOpcodeString(opcode); + + break; + } + + case SpvOpMatrixTimesScalar: { + if (!_.IsFloatMatrixType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected float matrix type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t matrix_type_id = GetOperandTypeId(_, inst, 2); + if (result_type != matrix_type_id) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected matrix operand type to be equal to Result Type: " + << spvOpcodeString(opcode); + + const uint32_t component_type = _.GetComponentType(matrix_type_id); + + const uint32_t scalar_type_id = GetOperandTypeId(_, inst, 3); + if (component_type != scalar_type_id) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected scalar operand type to be equal to the component " + << "type of the matrix operand: " << spvOpcodeString(opcode); + + break; + } + + case SpvOpVectorTimesMatrix: { + const uint32_t vector_type_id = GetOperandTypeId(_, inst, 2); + const uint32_t matrix_type_id = GetOperandTypeId(_, inst, 3); + + if (!_.IsFloatVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected float vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t res_component_type = _.GetComponentType(result_type); + + if (!vector_type_id || !_.IsFloatVectorType(vector_type_id)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected float vector type as left operand: " + << spvOpcodeString(opcode); + + if (res_component_type != _.GetComponentType(vector_type_id)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected component types of Result Type and vector to be " + << "equal: " << spvOpcodeString(opcode); + + uint32_t matrix_num_rows = 0; + uint32_t matrix_num_cols = 0; + uint32_t matrix_col_type = 0; + uint32_t matrix_component_type = 0; + if (!_.GetMatrixTypeInfo(matrix_type_id, &matrix_num_rows, + &matrix_num_cols, &matrix_col_type, + &matrix_component_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected float matrix type as right operand: " + << spvOpcodeString(opcode); + + if (res_component_type != matrix_component_type) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected component types of Result Type and matrix to be " + << "equal: " << spvOpcodeString(opcode); + + if (matrix_num_cols != _.GetDimension(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected number of columns of the matrix to be equal to " + << "Result Type vector size: " << spvOpcodeString(opcode); + + if (matrix_num_rows != _.GetDimension(vector_type_id)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected number of rows of the matrix to be equal to the " + << "vector operand size: " << spvOpcodeString(opcode); + + break; + } + + case SpvOpMatrixTimesVector: { + const uint32_t matrix_type_id = GetOperandTypeId(_, inst, 2); + const uint32_t vector_type_id = GetOperandTypeId(_, inst, 3); + + if (!_.IsFloatVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected float vector type as Result Type: " + << spvOpcodeString(opcode); + + uint32_t matrix_num_rows = 0; + uint32_t matrix_num_cols = 0; + uint32_t matrix_col_type = 0; + uint32_t matrix_component_type = 0; + if (!_.GetMatrixTypeInfo(matrix_type_id, &matrix_num_rows, + &matrix_num_cols, &matrix_col_type, + &matrix_component_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected float matrix type as left operand: " + << spvOpcodeString(opcode); + + if (result_type != matrix_col_type) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected column type of the matrix to be equal to Result " + "Type: " + << spvOpcodeString(opcode); + + if (!vector_type_id || !_.IsFloatVectorType(vector_type_id)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected float vector type as right operand: " + << spvOpcodeString(opcode); + + if (matrix_component_type != _.GetComponentType(vector_type_id)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected component types of the operands to be equal: " + << spvOpcodeString(opcode); + + if (matrix_num_cols != _.GetDimension(vector_type_id)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected number of columns of the matrix to be equal to the " + << "vector size: " << spvOpcodeString(opcode); + + break; + } + + case SpvOpMatrixTimesMatrix: { + const uint32_t left_type_id = GetOperandTypeId(_, inst, 2); + const uint32_t right_type_id = GetOperandTypeId(_, inst, 3); + + uint32_t res_num_rows = 0; + uint32_t res_num_cols = 0; + uint32_t res_col_type = 0; + uint32_t res_component_type = 0; + if (!_.GetMatrixTypeInfo(result_type, &res_num_rows, &res_num_cols, + &res_col_type, &res_component_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected float matrix type as Result Type: " + << spvOpcodeString(opcode); + + uint32_t left_num_rows = 0; + uint32_t left_num_cols = 0; + uint32_t left_col_type = 0; + uint32_t left_component_type = 0; + if (!_.GetMatrixTypeInfo(left_type_id, &left_num_rows, &left_num_cols, + &left_col_type, &left_component_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected float matrix type as left operand: " + << spvOpcodeString(opcode); + + uint32_t right_num_rows = 0; + uint32_t right_num_cols = 0; + uint32_t right_col_type = 0; + uint32_t right_component_type = 0; + if (!_.GetMatrixTypeInfo(right_type_id, &right_num_rows, &right_num_cols, + &right_col_type, &right_component_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected float matrix type as right operand: " + << spvOpcodeString(opcode); + + if (!_.IsFloatScalarType(res_component_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected float matrix type as Result Type: " + << spvOpcodeString(opcode); + + if (res_col_type != left_col_type) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected column types of Result Type and left matrix to be " + << "equal: " << spvOpcodeString(opcode); + + if (res_component_type != right_component_type) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected component types of Result Type and right matrix to " + "be " + << "equal: " << spvOpcodeString(opcode); + + if (res_num_cols != right_num_cols) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected number of columns of Result Type and right matrix " + "to " + << "be equal: " << spvOpcodeString(opcode); + + if (left_num_cols != right_num_rows) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected number of columns of left matrix and number of " + "rows " + << "of right matrix to be equal: " << spvOpcodeString(opcode); + + assert(left_num_rows == res_num_rows); + break; + } + + case SpvOpOuterProduct: { + const uint32_t left_type_id = GetOperandTypeId(_, inst, 2); + const uint32_t right_type_id = GetOperandTypeId(_, inst, 3); + + uint32_t res_num_rows = 0; + uint32_t res_num_cols = 0; + uint32_t res_col_type = 0; + uint32_t res_component_type = 0; + if (!_.GetMatrixTypeInfo(result_type, &res_num_rows, &res_num_cols, + &res_col_type, &res_component_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected float matrix type as Result Type: " + << spvOpcodeString(opcode); + + if (left_type_id != res_col_type) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected column type of Result Type to be equal to the type " + << "of the left operand: " << spvOpcodeString(opcode); + + if (!right_type_id || !_.IsFloatVectorType(right_type_id)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected float vector type as right operand: " + << spvOpcodeString(opcode); + + if (res_component_type != _.GetComponentType(right_type_id)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected component types of the operands to be equal: " + << spvOpcodeString(opcode); + + if (res_num_cols != _.GetDimension(right_type_id)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected number of columns of the matrix to be equal to the " + << "vector size of the right operand: " + << spvOpcodeString(opcode); + + break; + } + + case SpvOpIAddCarry: + case SpvOpISubBorrow: + case SpvOpUMulExtended: + case SpvOpSMulExtended: { + std::vector result_types; + if (!_.GetStructMemberTypes(result_type, &result_types)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected a struct as Result Type: " + << spvOpcodeString(opcode); + + if (result_types.size() != 2) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type struct to have two members: " + << spvOpcodeString(opcode); + + if (opcode == SpvOpSMulExtended) { + if (!_.IsIntScalarType(result_types[0]) && + !_.IsIntVectorType(result_types[0])) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type struct member types to be integer " + "scalar " + << "or vector: " << spvOpcodeString(opcode); + } else { + if (!_.IsUnsignedIntScalarType(result_types[0]) && + !_.IsUnsignedIntVectorType(result_types[0])) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type struct member types to be unsigned " + << "integer scalar or vector: " << spvOpcodeString(opcode); + } + + if (result_types[0] != result_types[1]) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type struct member types to be identical: " + << spvOpcodeString(opcode); + + const uint32_t left_type_id = GetOperandTypeId(_, inst, 2); + const uint32_t right_type_id = GetOperandTypeId(_, inst, 3); + + if (left_type_id != result_types[0] || right_type_id != result_types[0]) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected both operands to be of Result Type member type: " + << spvOpcodeString(opcode); + + break; + } + + default: + break; + } + + return SPV_SUCCESS; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_atomics.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_atomics.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_atomics.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_atomics.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,321 @@ +// Copyright (c) 2017 Google 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. + +// Validates correctness of atomic SPIR-V instructions. + +#include "validate.h" + +#include "diagnostic.h" +#include "opcode.h" +#include "spirv_target_env.h" +#include "util/bitutils.h" +#include "val/instruction.h" +#include "val/validation_state.h" + +namespace libspirv { + +// Validates Memory Scope operand. +spv_result_t ValidateMemoryScope(ValidationState_t& _, + const spv_parsed_instruction_t* inst, + uint32_t id) { + const SpvOp opcode = static_cast(inst->opcode); + bool is_int32 = false, is_const_int32 = false; + uint32_t value = 0; + std::tie(is_int32, is_const_int32, value) = _.EvalInt32IfConst(id); + + if (!is_int32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) << ": expected Scope to be 32-bit int"; + } + + if (!is_const_int32) { + return SPV_SUCCESS; + } + +#if 0 + // TODO(atgoo@github.com): this check fails Vulkan CTS, reenable once fixed. + if (spvIsVulkanEnv(_.context()->target_env)) { + if (value != SpvScopeDevice && value != SpvScopeWorkgroup && + value != SpvScopeInvocation) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": in Vulkan environment memory scope is limited to Device, " + "Workgroup and Invocation"; + } + } +#endif + + // TODO(atgoo@github.com) Add checks for OpenCL and OpenGL environments. + + return SPV_SUCCESS; +} + +// Validates a Memory Semantics operand. +spv_result_t ValidateMemorySemantics(ValidationState_t& _, + const spv_parsed_instruction_t* inst, + uint32_t operand_index) { + const SpvOp opcode = static_cast(inst->opcode); + bool is_int32 = false, is_const_int32 = false; + uint32_t flags = 0; + const uint32_t memory_semantics_id = + inst->words[inst->operands[operand_index].offset]; + std::tie(is_int32, is_const_int32, flags) = + _.EvalInt32IfConst(memory_semantics_id); + + if (!is_int32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Memory Semantics to be 32-bit int"; + } + + if (!is_const_int32) { + return SPV_SUCCESS; + } + + if (spvutils::CountSetBits( + flags & + (SpvMemorySemanticsAcquireMask | SpvMemorySemanticsReleaseMask | + SpvMemorySemanticsAcquireReleaseMask | + SpvMemorySemanticsSequentiallyConsistentMask)) > 1) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": no more than one of the following Memory Semantics bits can " + "be set at the same time: Acquire, Release, AcquireRelease or " + "SequentiallyConsistent"; + } + + if (flags & SpvMemorySemanticsUniformMemoryMask && + !_.HasCapability(SpvCapabilityShader)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": Memory Semantics UniformMemory requires capability Shader"; + } + + if (flags & SpvMemorySemanticsAtomicCounterMemoryMask && + !_.HasCapability(SpvCapabilityAtomicStorage)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": Memory Semantics UniformMemory requires capability " + "AtomicStorage"; + } + + if (opcode == SpvOpAtomicFlagClear && + (flags & SpvMemorySemanticsAcquireMask || + flags & SpvMemorySemanticsAcquireReleaseMask)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Memory Semantics Acquire and AcquireRelease cannot be used with " + << spvOpcodeString(opcode); + } + + if (opcode == SpvOpAtomicCompareExchange && operand_index == 5 && + (flags & SpvMemorySemanticsReleaseMask || + flags & SpvMemorySemanticsAcquireReleaseMask)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": Memory Semantics Release and AcquireRelease cannot be used " + "for operand Unequal"; + } + + if (spvIsVulkanEnv(_.context()->target_env)) { + if (opcode == SpvOpAtomicLoad && + (flags & SpvMemorySemanticsReleaseMask || + flags & SpvMemorySemanticsAcquireReleaseMask || + flags & SpvMemorySemanticsSequentiallyConsistentMask)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec disallows OpAtomicLoad with Memory Semantics " + "Release, AcquireRelease and SequentiallyConsistent"; + } + + if (opcode == SpvOpAtomicStore && + (flags & SpvMemorySemanticsAcquireMask || + flags & SpvMemorySemanticsAcquireReleaseMask || + flags & SpvMemorySemanticsSequentiallyConsistentMask)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec disallows OpAtomicStore with Memory Semantics " + "Acquire, AcquireRelease and SequentiallyConsistent"; + } + } + + // TODO(atgoo@github.com) Add checks for OpenCL and OpenGL environments. + + return SPV_SUCCESS; +} + +// Validates correctness of atomic instructions. +spv_result_t AtomicsPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const SpvOp opcode = static_cast(inst->opcode); + const uint32_t result_type = inst->type_id; + + switch (opcode) { + case SpvOpAtomicLoad: + case SpvOpAtomicStore: + case SpvOpAtomicExchange: + case SpvOpAtomicCompareExchange: + case SpvOpAtomicCompareExchangeWeak: + case SpvOpAtomicIIncrement: + case SpvOpAtomicIDecrement: + case SpvOpAtomicIAdd: + case SpvOpAtomicISub: + case SpvOpAtomicSMin: + case SpvOpAtomicUMin: + case SpvOpAtomicSMax: + case SpvOpAtomicUMax: + case SpvOpAtomicAnd: + case SpvOpAtomicOr: + case SpvOpAtomicXor: + case SpvOpAtomicFlagTestAndSet: + case SpvOpAtomicFlagClear: { + if (_.HasCapability(SpvCapabilityKernel) && + (opcode == SpvOpAtomicLoad || opcode == SpvOpAtomicExchange || + opcode == SpvOpAtomicCompareExchange)) { + if (!_.IsFloatScalarType(result_type) && + !_.IsIntScalarType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Result Type to be int or float scalar type"; + } + } else if (opcode == SpvOpAtomicFlagTestAndSet) { + if (!_.IsBoolScalarType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Result Type to be bool scalar type"; + } + } else if (opcode == SpvOpAtomicFlagClear || opcode == SpvOpAtomicStore) { + assert(result_type == 0); + } else { + if (!_.IsIntScalarType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Result Type to be int scalar type"; + } + if (spvIsVulkanEnv(_.context()->target_env) && + _.GetBitWidth(result_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": according to the Vulkan spec atomic Result Type needs " + "to be a 32-bit int scalar type"; + } + } + + uint32_t operand_index = + opcode == SpvOpAtomicFlagClear || opcode == SpvOpAtomicStore ? 0 : 2; + const uint32_t pointer_type = _.GetOperandTypeId(inst, operand_index++); + + uint32_t data_type = 0; + uint32_t storage_class = 0; + if (!_.GetPointerTypeInfo(pointer_type, &data_type, &storage_class)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Pointer to be of type OpTypePointer"; + } + + switch (storage_class) { + case SpvStorageClassUniform: + case SpvStorageClassWorkgroup: + case SpvStorageClassCrossWorkgroup: + case SpvStorageClassGeneric: + case SpvStorageClassAtomicCounter: + case SpvStorageClassImage: + case SpvStorageClassStorageBuffer: + break; + default: + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Pointer Storage Class to be Uniform, " + "Workgroup, CrossWorkgroup, Generic, AtomicCounter, Image " + "or StorageBuffer"; + } + + if (opcode == SpvOpAtomicFlagTestAndSet || + opcode == SpvOpAtomicFlagClear) { + if (!_.IsIntScalarType(data_type) || _.GetBitWidth(data_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Pointer to point to a value of 32-bit int type"; + } + } else if (opcode == SpvOpAtomicStore) { + if (!_.IsFloatScalarType(data_type) && !_.IsIntScalarType(data_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Pointer to be a pointer to int or float " + << "scalar type"; + } + } else { + if (data_type != result_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Pointer to point to a value of type Result " + "Type"; + } + } + + const uint32_t memory_scope = + inst->words[inst->operands[operand_index++].offset]; + if (auto error = ValidateMemoryScope(_, inst, memory_scope)) { + return error; + } + + if (auto error = ValidateMemorySemantics(_, inst, operand_index++)) + return error; + + if (opcode == SpvOpAtomicCompareExchange || + opcode == SpvOpAtomicCompareExchangeWeak) { + if (auto error = ValidateMemorySemantics(_, inst, operand_index++)) + return error; + } + + if (opcode == SpvOpAtomicStore) { + const uint32_t value_type = _.GetOperandTypeId(inst, 3); + if (value_type != data_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Value type and the type pointed to by Pointer " + "to" + << " be the same"; + } + } else if (opcode != SpvOpAtomicLoad && opcode != SpvOpAtomicIIncrement && + opcode != SpvOpAtomicIDecrement && + opcode != SpvOpAtomicFlagTestAndSet && + opcode != SpvOpAtomicFlagClear) { + const uint32_t value_type = _.GetOperandTypeId(inst, operand_index++); + if (value_type != result_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Value to be of type Result Type"; + } + } + + if (opcode == SpvOpAtomicCompareExchange || + opcode == SpvOpAtomicCompareExchangeWeak) { + const uint32_t comparator_type = + _.GetOperandTypeId(inst, operand_index++); + if (comparator_type != result_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Comparator to be of type Result Type"; + } + } + + break; + } + + default: + break; + } + + return SPV_SUCCESS; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_barriers.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_barriers.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_barriers.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_barriers.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,272 @@ +// Copyright (c) 2018 Google LLC. +// +// 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. + +// Validates correctness of barrier SPIR-V instructions. + +#include "validate.h" + +#include "diagnostic.h" +#include "opcode.h" +#include "spirv_constant.h" +#include "spirv_target_env.h" +#include "util/bitutils.h" +#include "val/instruction.h" +#include "val/validation_state.h" + +namespace libspirv { + +namespace { + +// Validates Execution Scope operand. +spv_result_t ValidateExecutionScope(ValidationState_t& _, + const spv_parsed_instruction_t* inst, + uint32_t id) { + const SpvOp opcode = static_cast(inst->opcode); + bool is_int32 = false, is_const_int32 = false; + uint32_t value = 0; + std::tie(is_int32, is_const_int32, value) = _.EvalInt32IfConst(id); + + if (!is_int32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Execution Scope to be a 32-bit int"; + } + + if (!is_const_int32) { + return SPV_SUCCESS; + } + + if (spvIsVulkanEnv(_.context()->target_env)) { + if (value != SpvScopeWorkgroup && value != SpvScopeSubgroup) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": in Vulkan environment Execution Scope is limited to " + "Workgroup and Subgroup"; + } + } + + // TODO(atgoo@github.com) Add checks for OpenCL and OpenGL environments. + + return SPV_SUCCESS; +} + +// Validates Memory Scope operand. +spv_result_t ValidateMemoryScope(ValidationState_t& _, + const spv_parsed_instruction_t* inst, + uint32_t id) { + const SpvOp opcode = static_cast(inst->opcode); + bool is_int32 = false, is_const_int32 = false; + uint32_t value = 0; + std::tie(is_int32, is_const_int32, value) = _.EvalInt32IfConst(id); + + if (!is_int32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Memory Scope to be a 32-bit int"; + } + + if (!is_const_int32) { + return SPV_SUCCESS; + } + + if (spvIsVulkanEnv(_.context()->target_env)) { + if (value != SpvScopeDevice && value != SpvScopeWorkgroup && + value != SpvScopeInvocation) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": in Vulkan environment Memory Scope is limited to Device, " + "Workgroup and Invocation"; + } + } + + // TODO(atgoo@github.com) Add checks for OpenCL and OpenGL environments. + + return SPV_SUCCESS; +} + +// Validates Memory Semantics operand. +spv_result_t ValidateMemorySemantics(ValidationState_t& _, + const spv_parsed_instruction_t* inst, + uint32_t id) { + const SpvOp opcode = static_cast(inst->opcode); + bool is_int32 = false, is_const_int32 = false; + uint32_t value = 0; + std::tie(is_int32, is_const_int32, value) = _.EvalInt32IfConst(id); + + if (!is_int32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Memory Semantics to be a 32-bit int"; + } + + if (!is_const_int32) { + return SPV_SUCCESS; + } + + const size_t num_memory_order_set_bits = spvutils::CountSetBits( + value & (SpvMemorySemanticsAcquireMask | SpvMemorySemanticsReleaseMask | + SpvMemorySemanticsAcquireReleaseMask | + SpvMemorySemanticsSequentiallyConsistentMask)); + + if (num_memory_order_set_bits > 1) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": Memory Semantics can have at most one of the following bits " + "set: Acquire, Release, AcquireRelease or SequentiallyConsistent"; + } + + if (spvIsVulkanEnv(_.context()->target_env)) { + const bool includes_storage_class = + value & (SpvMemorySemanticsUniformMemoryMask | + SpvMemorySemanticsWorkgroupMemoryMask | + SpvMemorySemanticsImageMemoryMask); + + if (opcode == SpvOpMemoryBarrier && !num_memory_order_set_bits) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": Vulkan specification requires Memory Semantics to have one " + "of the following bits set: Acquire, Release, AcquireRelease " + "or SequentiallyConsistent"; + } + + if (opcode == SpvOpMemoryBarrier && !includes_storage_class) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Memory Semantics to include a Vulkan-supported " + "storage class"; + } + +#if 0 + // TODO(atgoo@github.com): this check fails Vulkan CTS, reenable once fixed. + if (opcode == SpvOpControlBarrier && value && !includes_storage_class) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Memory Semantics to include a Vulkan-supported " + "storage class if Memory Semantics is not None"; + } +#endif + } + + // TODO(atgoo@github.com) Add checks for OpenCL and OpenGL environments. + + return SPV_SUCCESS; +} + +} // anonymous namespace + +// Validates correctness of barrier instructions. +spv_result_t BarriersPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const SpvOp opcode = static_cast(inst->opcode); + const uint32_t result_type = inst->type_id; + + switch (opcode) { + case SpvOpControlBarrier: { + if (spvVersionForTargetEnv(_.context()->target_env) < + SPV_SPIRV_VERSION_WORD(1, 3)) { + _.current_function().RegisterExecutionModelLimitation( + [](SpvExecutionModel model, std::string* message) { + if (model != SpvExecutionModelTessellationControl && + model != SpvExecutionModelGLCompute && + model != SpvExecutionModelKernel) { + if (message) { + *message = + "OpControlBarrier requires one of the following " + "Execution " + "Models: TessellationControl, GLCompute or Kernel"; + } + return false; + } + return true; + }); + } + + const uint32_t execution_scope = inst->words[1]; + const uint32_t memory_scope = inst->words[2]; + const uint32_t memory_semantics = inst->words[3]; + + if (auto error = ValidateExecutionScope(_, inst, execution_scope)) { + return error; + } + + if (auto error = ValidateMemoryScope(_, inst, memory_scope)) { + return error; + } + + if (auto error = ValidateMemorySemantics(_, inst, memory_semantics)) { + return error; + } + break; + } + + case SpvOpMemoryBarrier: { + const uint32_t memory_scope = inst->words[1]; + const uint32_t memory_semantics = inst->words[2]; + + if (auto error = ValidateMemoryScope(_, inst, memory_scope)) { + return error; + } + + if (auto error = ValidateMemorySemantics(_, inst, memory_semantics)) { + return error; + } + break; + } + + case SpvOpNamedBarrierInitialize: { + if (_.GetIdOpcode(result_type) != SpvOpTypeNamedBarrier) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Result Type to be OpTypeNamedBarrier"; + } + + const uint32_t subgroup_count_type = _.GetOperandTypeId(inst, 2); + if (!_.IsIntScalarType(subgroup_count_type) || + _.GetBitWidth(subgroup_count_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Subgroup Count to be a 32-bit int"; + } + break; + } + + case SpvOpMemoryNamedBarrier: { + const uint32_t named_barrier_type = _.GetOperandTypeId(inst, 0); + if (_.GetIdOpcode(named_barrier_type) != SpvOpTypeNamedBarrier) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Named Barrier to be of type OpTypeNamedBarrier"; + } + + const uint32_t memory_scope = inst->words[2]; + const uint32_t memory_semantics = inst->words[3]; + + if (auto error = ValidateMemoryScope(_, inst, memory_scope)) { + return error; + } + + if (auto error = ValidateMemorySemantics(_, inst, memory_semantics)) { + return error; + } + break; + } + + default: + break; + } + + return SPV_SUCCESS; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_bitwise.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_bitwise.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_bitwise.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_bitwise.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,239 @@ +// Copyright (c) 2017 Google 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. + +// Validates correctness of bitwise instructions. + +#include "validate.h" + +#include "diagnostic.h" +#include "opcode.h" +#include "val/instruction.h" +#include "val/validation_state.h" + +namespace libspirv { + +namespace { + +// Returns operand word for given instruction and operand index. +// The operand is expected to only have one word. +inline uint32_t GetOperandWord(const spv_parsed_instruction_t* inst, + size_t operand_index) { + assert(operand_index < inst->num_operands); + const spv_parsed_operand_t& operand = inst->operands[operand_index]; + assert(operand.num_words == 1); + return inst->words[operand.offset]; +} + +// Returns the type id of instruction operand at |operand_index|. +// The operand is expected to be an id. +inline uint32_t GetOperandTypeId(ValidationState_t& _, + const spv_parsed_instruction_t* inst, + size_t operand_index) { + return _.GetTypeId(GetOperandWord(inst, operand_index)); +} +} // namespace + +// Validates correctness of bitwise instructions. +spv_result_t BitwisePass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const SpvOp opcode = static_cast(inst->opcode); + const uint32_t result_type = inst->type_id; + + switch (opcode) { + case SpvOpShiftRightLogical: + case SpvOpShiftRightArithmetic: + case SpvOpShiftLeftLogical: { + if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected int scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t result_dimension = _.GetDimension(result_type); + const uint32_t base_type = GetOperandTypeId(_, inst, 2); + const uint32_t shift_type = GetOperandTypeId(_, inst, 3); + + if (!base_type || + (!_.IsIntScalarType(base_type) && !_.IsIntVectorType(base_type))) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Base to be int scalar or vector: " + << spvOpcodeString(opcode); + + if (_.GetDimension(base_type) != result_dimension) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Base to have the same dimension " + << "as Result Type: " << spvOpcodeString(opcode); + + if (_.GetBitWidth(base_type) != _.GetBitWidth(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Base to have the same bit width " + << "as Result Type: " << spvOpcodeString(opcode); + + if (!shift_type || + (!_.IsIntScalarType(shift_type) && !_.IsIntVectorType(shift_type))) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Shift to be int scalar or vector: " + << spvOpcodeString(opcode); + + if (_.GetDimension(shift_type) != result_dimension) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Shift to have the same dimension " + << "as Result Type: " << spvOpcodeString(opcode); + break; + } + + case SpvOpBitwiseOr: + case SpvOpBitwiseXor: + case SpvOpBitwiseAnd: + case SpvOpNot: { + if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected int scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t result_dimension = _.GetDimension(result_type); + const uint32_t result_bit_width = _.GetBitWidth(result_type); + + for (size_t operand_index = 2; operand_index < inst->num_operands; + ++operand_index) { + const uint32_t type_id = GetOperandTypeId(_, inst, operand_index); + if (!type_id || + (!_.IsIntScalarType(type_id) && !_.IsIntVectorType(type_id))) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected int scalar or vector as operand: " + << spvOpcodeString(opcode) << " operand index " + << operand_index; + + if (_.GetDimension(type_id) != result_dimension) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected operands to have the same dimension " + << "as Result Type: " << spvOpcodeString(opcode) + << " operand index " << operand_index; + + if (_.GetBitWidth(type_id) != result_bit_width) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected operands to have the same bit width " + << "as Result Type: " << spvOpcodeString(opcode) + << " operand index " << operand_index; + } + break; + } + + case SpvOpBitFieldInsert: { + if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected int scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t base_type = GetOperandTypeId(_, inst, 2); + const uint32_t insert_type = GetOperandTypeId(_, inst, 3); + const uint32_t offset_type = GetOperandTypeId(_, inst, 4); + const uint32_t count_type = GetOperandTypeId(_, inst, 5); + + if (base_type != result_type) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Base Type to be equal to Result Type: " + << spvOpcodeString(opcode); + + if (insert_type != result_type) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Insert Type to be equal to Result Type: " + << spvOpcodeString(opcode); + + if (!offset_type || !_.IsIntScalarType(offset_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Offset Type to be int scalar: " + << spvOpcodeString(opcode); + + if (!count_type || !_.IsIntScalarType(count_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Count Type to be int scalar: " + << spvOpcodeString(opcode); + break; + } + + case SpvOpBitFieldSExtract: + case SpvOpBitFieldUExtract: { + if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected int scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t base_type = GetOperandTypeId(_, inst, 2); + const uint32_t offset_type = GetOperandTypeId(_, inst, 3); + const uint32_t count_type = GetOperandTypeId(_, inst, 4); + + if (base_type != result_type) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Base Type to be equal to Result Type: " + << spvOpcodeString(opcode); + + if (!offset_type || !_.IsIntScalarType(offset_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Offset Type to be int scalar: " + << spvOpcodeString(opcode); + + if (!count_type || !_.IsIntScalarType(count_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Count Type to be int scalar: " + << spvOpcodeString(opcode); + break; + } + + case SpvOpBitReverse: { + if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected int scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t base_type = GetOperandTypeId(_, inst, 2); + + if (base_type != result_type) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Base Type to be equal to Result Type: " + << spvOpcodeString(opcode); + break; + } + + case SpvOpBitCount: { + if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected int scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t base_type = GetOperandTypeId(_, inst, 2); + if (!base_type || + (!_.IsIntScalarType(base_type) && !_.IsIntVectorType(base_type))) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Base Type to be int scalar or vector: " + << spvOpcodeString(opcode); + + const uint32_t base_dimension = _.GetDimension(base_type); + const uint32_t result_dimension = _.GetDimension(result_type); + + if (base_dimension != result_dimension) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Base dimension to be equal to Result Type " + "dimension: " + << spvOpcodeString(opcode); + break; + } + + default: + break; + } + + return SPV_SUCCESS; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_builtins.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_builtins.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_builtins.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_builtins.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,2386 @@ +// Copyright (c) 2018 Google LLC. +// +// 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. + +// Validates correctness of built-in variables. + +#include "validate.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "diagnostic.h" +#include "opcode.h" +#include "spirv_target_env.h" +#include "util/bitutils.h" +#include "val/instruction.h" +#include "val/validation_state.h" + +namespace libspirv { + +namespace { + +// Returns a short textual description of the id defined by the given +// instruction. +std::string GetIdDesc(const Instruction& inst) { + std::ostringstream ss; + ss << "ID <" << inst.id() << "> (Op" << spvOpcodeString(inst.opcode()) << ")"; + return ss.str(); +} + +// Gets underlying data type which is +// - member type if instruction is OpTypeStruct +// (member index is taken from decoration). +// - data type if id creates a pointer. +// - type of the constant if instruction is OpConst or OpSpecConst. +// +// Fails in any other case. The function is based on built-ins allowed by +// the Vulkan spec. +// TODO: If non-Vulkan validation rules are added then it might need +// to be refactored. +spv_result_t GetUnderlyingType(const ValidationState_t& _, + const Decoration& decoration, + const Instruction& inst, + uint32_t* underlying_type) { + if (decoration.struct_member_index() != Decoration::kInvalidMember) { + assert(inst.opcode() == SpvOpTypeStruct); + *underlying_type = inst.word(decoration.struct_member_index() + 2); + return SPV_SUCCESS; + } + + assert(inst.opcode() != SpvOpTypeStruct); + + if (spvOpcodeIsConstant(inst.opcode())) { + *underlying_type = inst.type_id(); + return SPV_SUCCESS; + } + + uint32_t storage_class = 0; + if (!_.GetPointerTypeInfo(inst.type_id(), underlying_type, &storage_class)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << GetIdDesc(inst) + << " is decorated with BuiltIn. BuiltIn decoration should only be " + "applied to struct types, variables and constants."; + } + return SPV_SUCCESS; +} + +// Returns Storage Class used by the instruction if applicable. +// Returns SpvStorageClassMax if not. +SpvStorageClass GetStorageClass(const Instruction& inst) { + switch (inst.opcode()) { + case SpvOpTypePointer: + case SpvOpTypeForwardPointer: { + return SpvStorageClass(inst.word(2)); + } + case SpvOpVariable: { + return SpvStorageClass(inst.word(3)); + } + case SpvOpGenericCastToPtrExplicit: { + return SpvStorageClass(inst.word(4)); + } + default: { break; } + } + return SpvStorageClassMax; +} + +// Helper class managing validation of built-ins. +// TODO: Generic functionality of this class can be moved into +// ValidationState_t to be made available to other users. +class BuiltInsValidator { + public: + BuiltInsValidator(const ValidationState_t& vstate) : _(vstate) {} + + // Run validation. + spv_result_t Run(); + + private: + // Goes through all decorations in the module, if decoration is BuiltIn + // calls ValidateSingleBuiltInAtDefinition(). + spv_result_t ValidateBuiltInsAtDefinition(); + + // Validates the instruction defining an id with built-in decoration. + // Can be called multiple times for the same id, if multiple built-ins are + // specified. Seeds id_to_at_reference_checks_ with decorated ids if needed. + spv_result_t ValidateSingleBuiltInAtDefinition(const Decoration& decoration, + const Instruction& inst); + + // The following section contains functions which are called when id defined + // by |inst| is decorated with BuiltIn |decoration|. + // Most functions are specific to a single built-in and have naming scheme: + // ValidateXYZAtDefinition. Some functions are common to multiple kinds of + // BuiltIn. + spv_result_t ValidateClipOrCullDistanceAtDefinition( + const Decoration& decoration, const Instruction& inst); + spv_result_t ValidateFragCoordAtDefinition(const Decoration& decoration, + const Instruction& inst); + spv_result_t ValidateFragDepthAtDefinition(const Decoration& decoration, + const Instruction& inst); + spv_result_t ValidateFrontFacingAtDefinition(const Decoration& decoration, + const Instruction& inst); + spv_result_t ValidateHelperInvocationAtDefinition( + const Decoration& decoration, const Instruction& inst); + spv_result_t ValidateInvocationIdAtDefinition(const Decoration& decoration, + const Instruction& inst); + spv_result_t ValidateInstanceIndexAtDefinition(const Decoration& decoration, + const Instruction& inst); + spv_result_t ValidateLayerOrViewportIndexAtDefinition( + const Decoration& decoration, const Instruction& inst); + spv_result_t ValidatePatchVerticesAtDefinition(const Decoration& decoration, + const Instruction& inst); + spv_result_t ValidatePointCoordAtDefinition(const Decoration& decoration, + const Instruction& inst); + spv_result_t ValidatePointSizeAtDefinition(const Decoration& decoration, + const Instruction& inst); + spv_result_t ValidatePositionAtDefinition(const Decoration& decoration, + const Instruction& inst); + spv_result_t ValidatePrimitiveIdAtDefinition(const Decoration& decoration, + const Instruction& inst); + spv_result_t ValidateSampleIdAtDefinition(const Decoration& decoration, + const Instruction& inst); + spv_result_t ValidateSampleMaskAtDefinition(const Decoration& decoration, + const Instruction& inst); + spv_result_t ValidateSamplePositionAtDefinition(const Decoration& decoration, + const Instruction& inst); + spv_result_t ValidateTessCoordAtDefinition(const Decoration& decoration, + const Instruction& inst); + spv_result_t ValidateTessLevelOuterAtDefinition(const Decoration& decoration, + const Instruction& inst); + spv_result_t ValidateTessLevelInnerAtDefinition(const Decoration& decoration, + const Instruction& inst); + spv_result_t ValidateVertexIndexAtDefinition(const Decoration& decoration, + const Instruction& inst); + spv_result_t ValidateWorkgroupSizeAtDefinition(const Decoration& decoration, + const Instruction& inst); + // Used for GlobalInvocationId, LocalInvocationId, NumWorkgroups, WorkgroupId. + spv_result_t ValidateComputeShaderI32Vec3InputAtDefinition( + const Decoration& decoration, const Instruction& inst); + + // The following section contains functions which are called when id defined + // by |referenced_inst| is + // 1. referenced by |referenced_from_inst| + // 2. dependent on |built_in_inst| which is decorated with BuiltIn + // |decoration|. Most functions are specific to a single built-in and have + // naming scheme: ValidateXYZAtReference. Some functions are common to + // multiple kinds of BuiltIn. + spv_result_t ValidateFragCoordAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidateFragDepthAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidateFrontFacingAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidateHelperInvocationAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidateInvocationIdAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidateInstanceIndexAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidatePatchVerticesAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidatePointCoordAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidatePointSizeAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidatePositionAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidatePrimitiveIdAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidateSampleIdAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidateSampleMaskAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidateSamplePositionAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidateTessCoordAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidateTessLevelAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidateVertexIndexAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidateLayerOrViewportIndexAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidateWorkgroupSizeAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + spv_result_t ValidateClipOrCullDistanceAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + // Used for GlobalInvocationId, LocalInvocationId, NumWorkgroups, WorkgroupId. + spv_result_t ValidateComputeShaderI32Vec3InputAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + // Validates that |built_in_inst| is not (even indirectly) referenced from + // within a function which can be called with |execution_model|. + // + // |comment| - text explaining why the restriction was imposed. + // |decoration| - BuiltIn decoration which causes the restriction. + // |referenced_inst| - instruction which is dependent on |built_in_inst| and + // defines the id which was referenced. + // |referenced_from_inst| - instruction which references id defined by + // |referenced_inst| from within a function. + spv_result_t ValidateNotCalledWithExecutionModel( + const char* comment, SpvExecutionModel execution_model, + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + + // The following section contains functions which check that the decorated + // variable has the type specified in the function name. |diag| would be + // called with a corresponding error message, if validation is not successful. + spv_result_t ValidateBool( + const Decoration& decoration, const Instruction& inst, + const std::function& diag); + spv_result_t ValidateI32( + const Decoration& decoration, const Instruction& inst, + const std::function& diag); + spv_result_t ValidateI32Vec( + const Decoration& decoration, const Instruction& inst, + uint32_t num_components, + const std::function& diag); + spv_result_t ValidateI32Arr( + const Decoration& decoration, const Instruction& inst, + const std::function& diag); + spv_result_t ValidateF32( + const Decoration& decoration, const Instruction& inst, + const std::function& diag); + spv_result_t ValidateF32Vec( + const Decoration& decoration, const Instruction& inst, + uint32_t num_components, + const std::function& diag); + // If |num_components| is zero, the number of components is not checked. + spv_result_t ValidateF32Arr( + const Decoration& decoration, const Instruction& inst, + uint32_t num_components, + const std::function& diag); + + // Generates strings like "Member #0 of struct ID <2>". + std::string GetDefinitionDesc(const Decoration& decoration, + const Instruction& inst) const; + + // Generates strings like "ID <51> (OpTypePointer) is referencing ID <2> + // (OpTypeStruct) which is decorated with BuiltIn Position". + std::string GetReferenceDesc( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst, + SpvExecutionModel execution_model = SpvExecutionModelMax) const; + + // Generates strings like "ID <51> (OpTypePointer) uses storage class + // UniformConstant". + std::string GetStorageClassDesc(const Instruction& inst) const; + + // Updates inner working of the class. Is called sequentially for every + // instruction. + void Update(const Instruction& inst); + + // Traverses call tree and computes function_to_entry_points_. + void ComputeFunctionToEntryPointMapping(); + + const ValidationState_t& _; + + // Mapping id -> list of rules which validate instruction referencing the + // id. Rules can create new rules and add them to this container. + // Using std::map, and not std::unordered_map to avoid iterator invalidation + // during rehashing. + std::map>> + id_to_at_reference_checks_; + + // Id of the function we are currently inside. 0 if not inside a function. + uint32_t function_id_ = 0; + + // Entry points which can (indirectly) call the current function. + // The pointer either points to a vector inside to function_to_entry_points_ + // or to no_entry_points_. The pointer is guaranteed to never be null. + const std::vector no_entry_points; + const std::vector* entry_points_ = &no_entry_points; + + // Mapping function -> array of entry points inside this + // module which can (indirectly) call the function. + std::unordered_map> function_to_entry_points_; + + // Execution models with which the current function can be called. + std::set execution_models_; +}; + +void BuiltInsValidator::Update(const Instruction& inst) { + const SpvOp opcode = inst.opcode(); + if (opcode == SpvOpFunction) { + // Entering a function. + assert(function_id_ == 0); + function_id_ = inst.id(); + execution_models_.clear(); + const auto it = function_to_entry_points_.find(function_id_); + if (it == function_to_entry_points_.end()) { + entry_points_ = &no_entry_points; + } else { + entry_points_ = &it->second; + // Collect execution models from all entry points from which the current + // function can be called. + for (const uint32_t entry_point : *entry_points_) { + if (const auto* models = _.GetExecutionModels(entry_point)) { + execution_models_.insert(models->begin(), models->end()); + } + } + } + } + + if (opcode == SpvOpFunctionEnd) { + // Exiting a function. + assert(function_id_ != 0); + function_id_ = 0; + entry_points_ = &no_entry_points; + execution_models_.clear(); + } +} + +void BuiltInsValidator::ComputeFunctionToEntryPointMapping() { + // TODO: Move this into validation_state.cpp. + for (const uint32_t entry_point : _.entry_points()) { + std::stack call_stack; + std::set visited; + call_stack.push(entry_point); + while (!call_stack.empty()) { + const uint32_t called_func_id = call_stack.top(); + call_stack.pop(); + if (!visited.insert(called_func_id).second) continue; + + function_to_entry_points_[called_func_id].push_back(entry_point); + + const Function* called_func = _.function(called_func_id); + assert(called_func); + for (const uint32_t new_call : called_func->function_call_targets()) { + call_stack.push(new_call); + } + } + } +} + +std::string BuiltInsValidator::GetDefinitionDesc( + const Decoration& decoration, const Instruction& inst) const { + std::ostringstream ss; + if (decoration.struct_member_index() != Decoration::kInvalidMember) { + assert(inst.opcode() == SpvOpTypeStruct); + ss << "Member #" << decoration.struct_member_index(); + ss << " of struct ID <" << inst.id() << ">"; + } else { + ss << GetIdDesc(inst); + } + return ss.str(); +} + +std::string BuiltInsValidator::GetReferenceDesc( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, const Instruction& referenced_from_inst, + SpvExecutionModel execution_model) const { + std::ostringstream ss; + ss << GetIdDesc(referenced_from_inst) << " is referencing " + << GetIdDesc(referenced_inst); + if (built_in_inst.id() != referenced_inst.id()) { + ss << " which is dependent on " << GetIdDesc(built_in_inst); + } + + ss << " which is decorated with BuiltIn "; + ss << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, + decoration.params()[0]); + if (function_id_) { + ss << " in function <" << function_id_ << ">"; + if (execution_model != SpvExecutionModelMax) { + ss << " called with execution model "; + ss << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_EXECUTION_MODEL, + execution_model); + } + } + ss << "."; + return ss.str(); +} + +std::string BuiltInsValidator::GetStorageClassDesc( + const Instruction& inst) const { + std::ostringstream ss; + ss << GetIdDesc(inst) << " uses storage class "; + ss << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_STORAGE_CLASS, + GetStorageClass(inst)); + ss << "."; + return ss.str(); +} + +spv_result_t BuiltInsValidator::ValidateBool( + const Decoration& decoration, const Instruction& inst, + const std::function& diag) { + uint32_t underlying_type = 0; + if (spv_result_t error = + GetUnderlyingType(_, decoration, inst, &underlying_type)) { + return error; + } + + if (!_.IsBoolScalarType(underlying_type)) { + return diag(GetDefinitionDesc(decoration, inst) + " is not a bool scalar."); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateI32( + const Decoration& decoration, const Instruction& inst, + const std::function& diag) { + uint32_t underlying_type = 0; + if (spv_result_t error = + GetUnderlyingType(_, decoration, inst, &underlying_type)) { + return error; + } + + if (!_.IsIntScalarType(underlying_type)) { + return diag(GetDefinitionDesc(decoration, inst) + " is not an int scalar."); + } + + const uint32_t bit_width = _.GetBitWidth(underlying_type); + if (bit_width != 32) { + std::ostringstream ss; + ss << GetDefinitionDesc(decoration, inst) << " has bit width " << bit_width + << "."; + return diag(ss.str()); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateF32( + const Decoration& decoration, const Instruction& inst, + const std::function& diag) { + uint32_t underlying_type = 0; + if (spv_result_t error = + GetUnderlyingType(_, decoration, inst, &underlying_type)) { + return error; + } + + if (!_.IsFloatScalarType(underlying_type)) { + return diag(GetDefinitionDesc(decoration, inst) + + " is not a float scalar."); + } + + const uint32_t bit_width = _.GetBitWidth(underlying_type); + if (bit_width != 32) { + std::ostringstream ss; + ss << GetDefinitionDesc(decoration, inst) << " has bit width " << bit_width + << "."; + return diag(ss.str()); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateI32Vec( + const Decoration& decoration, const Instruction& inst, + uint32_t num_components, + const std::function& diag) { + uint32_t underlying_type = 0; + if (spv_result_t error = + GetUnderlyingType(_, decoration, inst, &underlying_type)) { + return error; + } + + if (!_.IsIntVectorType(underlying_type)) { + return diag(GetDefinitionDesc(decoration, inst) + " is not an int vector."); + } + + const uint32_t actual_num_components = _.GetDimension(underlying_type); + if (_.GetDimension(underlying_type) != num_components) { + std::ostringstream ss; + ss << GetDefinitionDesc(decoration, inst) << " has " + << actual_num_components << " components."; + return diag(ss.str()); + } + + const uint32_t bit_width = _.GetBitWidth(underlying_type); + if (bit_width != 32) { + std::ostringstream ss; + ss << GetDefinitionDesc(decoration, inst) + << " has components with bit width " << bit_width << "."; + return diag(ss.str()); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateF32Vec( + const Decoration& decoration, const Instruction& inst, + uint32_t num_components, + const std::function& diag) { + uint32_t underlying_type = 0; + if (spv_result_t error = + GetUnderlyingType(_, decoration, inst, &underlying_type)) { + return error; + } + + if (!_.IsFloatVectorType(underlying_type)) { + return diag(GetDefinitionDesc(decoration, inst) + + " is not a float vector."); + } + + const uint32_t actual_num_components = _.GetDimension(underlying_type); + if (_.GetDimension(underlying_type) != num_components) { + std::ostringstream ss; + ss << GetDefinitionDesc(decoration, inst) << " has " + << actual_num_components << " components."; + return diag(ss.str()); + } + + const uint32_t bit_width = _.GetBitWidth(underlying_type); + if (bit_width != 32) { + std::ostringstream ss; + ss << GetDefinitionDesc(decoration, inst) + << " has components with bit width " << bit_width << "."; + return diag(ss.str()); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateI32Arr( + const Decoration& decoration, const Instruction& inst, + const std::function& diag) { + uint32_t underlying_type = 0; + if (spv_result_t error = + GetUnderlyingType(_, decoration, inst, &underlying_type)) { + return error; + } + + const Instruction* const type_inst = _.FindDef(underlying_type); + if (type_inst->opcode() != SpvOpTypeArray) { + return diag(GetDefinitionDesc(decoration, inst) + " is not an array."); + } + + const uint32_t component_type = type_inst->word(2); + if (!_.IsIntScalarType(component_type)) { + return diag(GetDefinitionDesc(decoration, inst) + + " components are not int scalar."); + } + + const uint32_t bit_width = _.GetBitWidth(component_type); + if (bit_width != 32) { + std::ostringstream ss; + ss << GetDefinitionDesc(decoration, inst) + << " has components with bit width " << bit_width << "."; + return diag(ss.str()); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateF32Arr( + const Decoration& decoration, const Instruction& inst, + uint32_t num_components, + const std::function& diag) { + uint32_t underlying_type = 0; + if (spv_result_t error = + GetUnderlyingType(_, decoration, inst, &underlying_type)) { + return error; + } + + const Instruction* const type_inst = _.FindDef(underlying_type); + if (type_inst->opcode() != SpvOpTypeArray) { + return diag(GetDefinitionDesc(decoration, inst) + " is not an array."); + } + + const uint32_t component_type = type_inst->word(2); + if (!_.IsFloatScalarType(component_type)) { + return diag(GetDefinitionDesc(decoration, inst) + + " components are not float scalar."); + } + + const uint32_t bit_width = _.GetBitWidth(component_type); + if (bit_width != 32) { + std::ostringstream ss; + ss << GetDefinitionDesc(decoration, inst) + << " has components with bit width " << bit_width << "."; + return diag(ss.str()); + } + + if (num_components != 0) { + uint64_t actual_num_components = 0; + if (!_.GetConstantValUint64(type_inst->word(3), &actual_num_components)) { + assert(0 && "Array type definition is corrupt"); + } + if (actual_num_components != num_components) { + std::ostringstream ss; + ss << GetDefinitionDesc(decoration, inst) << " has " + << actual_num_components << " components."; + return diag(ss.str()); + } + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateNotCalledWithExecutionModel( + const char* comment, SpvExecutionModel execution_model, + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (function_id_) { + if (execution_models_.count(execution_model)) { + const char* execution_model_str = _.grammar().lookupOperandName( + SPV_OPERAND_TYPE_EXECUTION_MODEL, execution_model); + const char* built_in_str = _.grammar().lookupOperandName( + SPV_OPERAND_TYPE_BUILT_IN, decoration.params()[0]); + return _.diag(SPV_ERROR_INVALID_DATA) + << comment << " " << GetIdDesc(referenced_inst) << " depends on " + << GetIdDesc(built_in_inst) << " which is decorated with BuiltIn " + << built_in_str << "." + << " Id <" << referenced_inst.id() << "> is later referenced by " + << GetIdDesc(referenced_from_inst) << " in function <" + << function_id_ << "> which is called with execution model " + << execution_model_str << "."; + } + } else { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back( + std::bind(&BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, + comment, execution_model, decoration, built_in_inst, + referenced_from_inst, std::placeholders::_1)); + } + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateF32Arr( + decoration, inst, /* Any number of components */ 0, + [this, &decoration](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn " + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, + decoration.params()[0]) + << " variable needs to be a 32-bit float array. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidateClipOrCullDistanceAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput && + storage_class != SpvStorageClassOutput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn " + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, + decoration.params()[0]) + << " to be only used for variables with Input or Output storage " + "class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + if (storage_class == SpvStorageClassInput) { + assert(function_id_ == 0); + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, + "Vulkan spec doesn't allow BuiltIn ClipDistance/CullDistance to be " + "used for variables with Input storage class if execution model is " + "Vertex.", + SpvExecutionModelVertex, decoration, built_in_inst, + referenced_from_inst, std::placeholders::_1)); + } + + if (storage_class == SpvStorageClassOutput) { + assert(function_id_ == 0); + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, + "Vulkan spec doesn't allow BuiltIn ClipDistance/CullDistance to be " + "used for variables with Output storage class if execution model is " + "Fragment.", + SpvExecutionModelFragment, decoration, built_in_inst, + referenced_from_inst, std::placeholders::_1)); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + switch (execution_model) { + case SpvExecutionModelFragment: + case SpvExecutionModelVertex: + case SpvExecutionModelTessellationControl: + case SpvExecutionModelTessellationEvaluation: + case SpvExecutionModelGeometry: { + // Ok. + break; + } + + default: { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn " + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, + decoration.params()[0]) + << " to be used only with Fragment, Vertex, " + "TessellationControl, TessellationEvaluation or Geometry " + "execution models. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back( + std::bind(&BuiltInsValidator::ValidateClipOrCullDistanceAtReference, + this, decoration, built_in_inst, referenced_from_inst, + std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateFragCoordAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateF32Vec( + decoration, inst, 4, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn FragCoord " + "variable needs to be a 4-component 32-bit float " + "vector. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidateFragCoordAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidateFragCoordAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn FragCoord to be only used for " + "variables with Input storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + if (execution_model != SpvExecutionModelFragment) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn FragCoord to be used only with " + "Fragment execution model. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateFragCoordAtReference, this, decoration, + built_in_inst, referenced_from_inst, std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateFragDepthAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateF32( + decoration, inst, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn FragDepth " + "variable needs to be a 32-bit float scalar. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidateFragDepthAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidateFragDepthAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassOutput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn FragDepth to be only used for " + "variables with Output storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + if (execution_model != SpvExecutionModelFragment) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn FragDepth to be used only with " + "Fragment execution model. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + + for (const uint32_t entry_point : *entry_points_) { + // Every entry point from which this function is called needs to have + // Execution Mode DepthReplacing. + const auto* modes = _.GetExecutionModes(entry_point); + if (!modes || !modes->count(SpvExecutionModeDepthReplacing)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec requires DepthReplacing execution mode to be " + "declared when using BuiltIn FragDepth. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst); + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateFragDepthAtReference, this, decoration, + built_in_inst, referenced_from_inst, std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateFrontFacingAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateBool( + decoration, inst, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn FrontFacing " + "variable needs to be a bool scalar. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidateFrontFacingAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidateFrontFacingAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn FrontFacing to be only used for " + "variables with Input storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + if (execution_model != SpvExecutionModelFragment) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn FrontFacing to be used only with " + "Fragment execution model. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateFrontFacingAtReference, this, decoration, + built_in_inst, referenced_from_inst, std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateHelperInvocationAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateBool( + decoration, inst, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn HelperInvocation " + "variable needs to be a bool scalar. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidateHelperInvocationAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidateHelperInvocationAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn HelperInvocation to be only used " + "for variables with Input storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + if (execution_model != SpvExecutionModelFragment) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn HelperInvocation to be used only " + "with Fragment execution model. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back( + std::bind(&BuiltInsValidator::ValidateHelperInvocationAtReference, this, + decoration, built_in_inst, referenced_from_inst, + std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateInvocationIdAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateI32( + decoration, inst, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn InvocationId " + "variable needs to be a 32-bit int scalar. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidateInvocationIdAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidateInvocationIdAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn InvocationId to be only used for " + "variables with Input storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + if (execution_model != SpvExecutionModelTessellationControl && + execution_model != SpvExecutionModelGeometry) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn InvocationId to be used only " + "with TessellationControl or Geometry execution models. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateInvocationIdAtReference, this, decoration, + built_in_inst, referenced_from_inst, std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateInstanceIndexAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateI32( + decoration, inst, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn InstanceIndex " + "variable needs to be a 32-bit int scalar. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidateInstanceIndexAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidateInstanceIndexAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn InstanceIndex to be only used for " + "variables with Input storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + if (execution_model != SpvExecutionModelVertex) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn InstanceIndex to be used only " + "with Vertex execution model. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateInstanceIndexAtReference, this, decoration, + built_in_inst, referenced_from_inst, std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidatePatchVerticesAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateI32( + decoration, inst, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn PatchVertices " + "variable needs to be a 32-bit int scalar. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidatePatchVerticesAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidatePatchVerticesAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn PatchVertices to be only used for " + "variables with Input storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + if (execution_model != SpvExecutionModelTessellationControl && + execution_model != SpvExecutionModelTessellationEvaluation) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn PatchVertices to be used only " + "with TessellationControl or TessellationEvaluation " + "execution models. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidatePatchVerticesAtReference, this, decoration, + built_in_inst, referenced_from_inst, std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidatePointCoordAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateF32Vec( + decoration, inst, 2, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn PointCoord " + "variable needs to be a 2-component 32-bit float " + "vector. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidatePointCoordAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidatePointCoordAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn PointCoord to be only used for " + "variables with Input storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + if (execution_model != SpvExecutionModelFragment) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn PointCoord to be used only with " + "Fragment execution model. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidatePointCoordAtReference, this, decoration, + built_in_inst, referenced_from_inst, std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidatePointSizeAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateF32( + decoration, inst, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn PointSize " + "variable needs to be a 32-bit float scalar. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidatePointSizeAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidatePointSizeAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput && + storage_class != SpvStorageClassOutput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn PointSize to be only used for " + "variables with Input or Output storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + if (storage_class == SpvStorageClassInput) { + assert(function_id_ == 0); + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, + "Vulkan spec doesn't allow BuiltIn PointSize to be used for " + "variables with Input storage class if execution model is Vertex.", + SpvExecutionModelVertex, decoration, built_in_inst, + referenced_from_inst, std::placeholders::_1)); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + switch (execution_model) { + case SpvExecutionModelVertex: + case SpvExecutionModelTessellationControl: + case SpvExecutionModelTessellationEvaluation: + case SpvExecutionModelGeometry: { + // Ok. + break; + } + + default: { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn PointSize to be used only with " + "Vertex, TessellationControl, TessellationEvaluation or " + "Geometry execution models. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidatePointSizeAtReference, this, decoration, + built_in_inst, referenced_from_inst, std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidatePositionAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateF32Vec( + decoration, inst, 4, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn Position " + "variable needs to be a 4-component 32-bit float " + "vector. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidatePositionAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidatePositionAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput && + storage_class != SpvStorageClassOutput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn Position to be only used for " + "variables with Input or Output storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + if (storage_class == SpvStorageClassInput) { + assert(function_id_ == 0); + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, + "Vulkan spec doesn't allow BuiltIn Position to be used for variables " + "with Input storage class if execution model is Vertex.", + SpvExecutionModelVertex, decoration, built_in_inst, + referenced_from_inst, std::placeholders::_1)); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + switch (execution_model) { + case SpvExecutionModelVertex: + case SpvExecutionModelTessellationControl: + case SpvExecutionModelTessellationEvaluation: + case SpvExecutionModelGeometry: { + // Ok. + break; + } + + default: { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn Position to be used only with " + "Vertex, TessellationControl, TessellationEvaluation or " + "Geometry execution models. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidatePositionAtReference, this, decoration, + built_in_inst, referenced_from_inst, std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidatePrimitiveIdAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateI32( + decoration, inst, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn PrimitiveId " + "variable needs to be a 32-bit int scalar. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidatePrimitiveIdAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidatePrimitiveIdAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput && + storage_class != SpvStorageClassOutput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn PrimitiveId to be only used for " + "variables with Input or Output storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + if (storage_class == SpvStorageClassOutput) { + assert(function_id_ == 0); + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, + "Vulkan spec doesn't allow BuiltIn PrimitiveId to be used for " + "variables with Output storage class if execution model is " + "TessellationControl.", + SpvExecutionModelTessellationControl, decoration, built_in_inst, + referenced_from_inst, std::placeholders::_1)); + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, + "Vulkan spec doesn't allow BuiltIn PrimitiveId to be used for " + "variables with Output storage class if execution model is " + "TessellationEvaluation.", + SpvExecutionModelTessellationEvaluation, decoration, built_in_inst, + referenced_from_inst, std::placeholders::_1)); + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, + "Vulkan spec doesn't allow BuiltIn PrimitiveId to be used for " + "variables with Output storage class if execution model is Fragment.", + SpvExecutionModelFragment, decoration, built_in_inst, + referenced_from_inst, std::placeholders::_1)); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + switch (execution_model) { + case SpvExecutionModelFragment: + case SpvExecutionModelTessellationControl: + case SpvExecutionModelTessellationEvaluation: + case SpvExecutionModelGeometry: { + // Ok. + break; + } + + default: { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn PrimitiveId to be used only " + "with Fragment, TessellationControl, " + "TessellationEvaluation or Geometry execution models. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidatePrimitiveIdAtReference, this, decoration, + built_in_inst, referenced_from_inst, std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateSampleIdAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateI32( + decoration, inst, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn SampleId " + "variable needs to be a 32-bit int scalar. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidateSampleIdAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidateSampleIdAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn SampleId to be only used for " + "variables with Input storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + if (execution_model != SpvExecutionModelFragment) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn SampleId to be used only with " + "Fragment execution model. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateSampleIdAtReference, this, decoration, + built_in_inst, referenced_from_inst, std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateSampleMaskAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateI32Arr( + decoration, inst, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn SampleMask " + "variable needs to be a 32-bit int array. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidateSampleMaskAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidateSampleMaskAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput && + storage_class != SpvStorageClassOutput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn SampleMask to be only used for " + "variables with Input or Output storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + if (execution_model != SpvExecutionModelFragment) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn SampleMask to be used only with " + "Fragment execution model. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateSampleMaskAtReference, this, decoration, + built_in_inst, referenced_from_inst, std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateSamplePositionAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateF32Vec( + decoration, inst, 2, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn SamplePosition " + "variable needs to be a 2-component 32-bit float " + "vector. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidateSamplePositionAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidateSamplePositionAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn SamplePosition to be only used for " + "variables with Input storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + if (execution_model != SpvExecutionModelFragment) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn SamplePosition to be used only " + "with " + "Fragment execution model. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateSamplePositionAtReference, this, decoration, + built_in_inst, referenced_from_inst, std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateTessCoordAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateF32Vec( + decoration, inst, 3, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn TessCoord " + "variable needs to be a 3-component 32-bit float " + "vector. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidateTessCoordAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidateTessCoordAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn TessCoord to be only used for " + "variables with Input storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + if (execution_model != SpvExecutionModelTessellationEvaluation) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn TessCoord to be used only with " + "TessellationEvaluation execution model. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateTessCoordAtReference, this, decoration, + built_in_inst, referenced_from_inst, std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateTessLevelOuterAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateF32Arr( + decoration, inst, 4, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn TessLevelOuter " + "variable needs to be a 4-component 32-bit float " + "array. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidateTessLevelAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidateTessLevelInnerAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateF32Arr( + decoration, inst, 2, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn TessLevelOuter " + "variable needs to be a 2-component 32-bit float " + "array. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidateTessLevelAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidateTessLevelAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput && + storage_class != SpvStorageClassOutput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn " + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, + decoration.params()[0]) + << " to be only used for variables with Input or Output storage " + "class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + if (storage_class == SpvStorageClassInput) { + assert(function_id_ == 0); + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, + "Vulkan spec doesn't allow TessLevelOuter/TessLevelInner to be used " + "for variables with Input storage class if execution model is " + "TessellationControl.", + SpvExecutionModelTessellationControl, decoration, built_in_inst, + referenced_from_inst, std::placeholders::_1)); + } + + if (storage_class == SpvStorageClassOutput) { + assert(function_id_ == 0); + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, + "Vulkan spec doesn't allow TessLevelOuter/TessLevelInner to be used " + "for variables with Output storage class if execution model is " + "TessellationEvaluation.", + SpvExecutionModelTessellationEvaluation, decoration, built_in_inst, + referenced_from_inst, std::placeholders::_1)); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + switch (execution_model) { + case SpvExecutionModelTessellationControl: + case SpvExecutionModelTessellationEvaluation: { + // Ok. + break; + } + + default: { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn " + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, + decoration.params()[0]) + << " to be used only with TessellationControl or " + "TessellationEvaluation execution models. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateTessLevelAtReference, this, decoration, + built_in_inst, referenced_from_inst, std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateVertexIndexAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateI32( + decoration, inst, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn VertexIndex " + "variable needs to be a 32-bit int scalar. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidateVertexIndexAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidateVertexIndexAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn VertexIndex to be only used for " + "variables with Input storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + if (execution_model != SpvExecutionModelVertex) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn VertexIndex to be used only with " + "Vertex execution model. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateVertexIndexAtReference, this, decoration, + built_in_inst, referenced_from_inst, std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateI32( + decoration, inst, + [this, &decoration](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn " + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, + decoration.params()[0]) + << "variable needs to be a 32-bit int scalar. " << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidateLayerOrViewportIndexAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput && + storage_class != SpvStorageClassOutput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn " + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, + decoration.params()[0]) + << " to be only used for variables with Input or Output storage " + "class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + if (storage_class == SpvStorageClassInput) { + assert(function_id_ == 0); + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, + "Vulkan spec doesn't allow BuiltIn Layer and ViewportIndex to be " + "used for variables with Input storage class if execution model is " + "Geometry.", + SpvExecutionModelGeometry, decoration, built_in_inst, + referenced_from_inst, std::placeholders::_1)); + } + + if (storage_class == SpvStorageClassOutput) { + assert(function_id_ == 0); + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, + "Vulkan spec doesn't allow BuiltIn Layer and ViewportIndex to be " + "used for variables with Output storage class if execution model is " + "Fragment.", + SpvExecutionModelFragment, decoration, built_in_inst, + referenced_from_inst, std::placeholders::_1)); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + switch (execution_model) { + case SpvExecutionModelGeometry: + case SpvExecutionModelFragment: { + // Ok. + break; + } + + default: { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn " + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, + decoration.params()[0]) + << " to be used only with Fragment or Geometry execution " + "models. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back( + std::bind(&BuiltInsValidator::ValidateLayerOrViewportIndexAtReference, + this, decoration, built_in_inst, referenced_from_inst, + std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (spv_result_t error = ValidateI32Vec( + decoration, inst, 3, + [this, &decoration](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn " + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, + decoration.params()[0]) + << " variable needs to be a 3-component 32-bit int " + "vector. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidateComputeShaderI32Vec3InputAtReference(decoration, inst, inst, + inst); +} + +spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn " + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, + decoration.params()[0]) + << " to be only used for variables with Input storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + if (execution_model != SpvExecutionModelGLCompute) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn " + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, + decoration.params()[0]) + << " to be used only with GLCompute execution model. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtReference, this, + decoration, built_in_inst, referenced_from_inst, + std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateWorkgroupSizeAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + if (!spvOpcodeIsConstant(inst.opcode())) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec requires BuiltIn WorkgroupSize to be a constant. " + << GetIdDesc(inst) << " is not a constant."; + } + + if (spv_result_t error = ValidateI32Vec( + decoration, inst, 3, + [this](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA) + << "According to the Vulkan spec BuiltIn WorkgroupSize " + "variable " + "needs to be a 3-component 32-bit int vector. " + << message; + })) { + return error; + } + } + + // Seed at reference checks with this built-in. + return ValidateWorkgroupSizeAtReference(decoration, inst, inst, inst); +} + +spv_result_t BuiltInsValidator::ValidateWorkgroupSizeAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != SpvStorageClassMax && + storage_class != SpvStorageClassInput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn " + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, + decoration.params()[0]) + << " to be only used for variables with Input storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + for (const SpvExecutionModel execution_model : execution_models_) { + if (execution_model != SpvExecutionModelGLCompute) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Vulkan spec allows BuiltIn " + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, + decoration.params()[0]) + << " to be used only with GLCompute execution model. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( + &BuiltInsValidator::ValidateWorkgroupSizeAtReference, this, decoration, + built_in_inst, referenced_from_inst, std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateSingleBuiltInAtDefinition( + const Decoration& decoration, const Instruction& inst) { + const SpvBuiltIn label = SpvBuiltIn(decoration.params()[0]); + // If you are adding a new BuiltIn enum, please register it here. + // If the newly added enum has validation rules associated with it + // consider leaving a TODO and/or creating an issue. + switch (label) { + case SpvBuiltInClipDistance: + case SpvBuiltInCullDistance: { + return ValidateClipOrCullDistanceAtDefinition(decoration, inst); + } + case SpvBuiltInFragCoord: { + return ValidateFragCoordAtDefinition(decoration, inst); + } + case SpvBuiltInFragDepth: { + return ValidateFragDepthAtDefinition(decoration, inst); + } + case SpvBuiltInFrontFacing: { + return ValidateFrontFacingAtDefinition(decoration, inst); + } + case SpvBuiltInGlobalInvocationId: + case SpvBuiltInLocalInvocationId: + case SpvBuiltInNumWorkgroups: + case SpvBuiltInWorkgroupId: { + return ValidateComputeShaderI32Vec3InputAtDefinition(decoration, inst); + } + case SpvBuiltInHelperInvocation: { + return ValidateHelperInvocationAtDefinition(decoration, inst); + } + case SpvBuiltInInvocationId: { + return ValidateInvocationIdAtDefinition(decoration, inst); + } + case SpvBuiltInInstanceIndex: { + return ValidateInstanceIndexAtDefinition(decoration, inst); + } + case SpvBuiltInLayer: + case SpvBuiltInViewportIndex: { + return ValidateLayerOrViewportIndexAtDefinition(decoration, inst); + } + case SpvBuiltInPatchVertices: { + return ValidatePatchVerticesAtDefinition(decoration, inst); + } + case SpvBuiltInPointCoord: { + return ValidatePointCoordAtDefinition(decoration, inst); + } + case SpvBuiltInPointSize: { + return ValidatePointSizeAtDefinition(decoration, inst); + } + case SpvBuiltInPosition: { + return ValidatePositionAtDefinition(decoration, inst); + } + case SpvBuiltInPrimitiveId: { + return ValidatePrimitiveIdAtDefinition(decoration, inst); + } + case SpvBuiltInSampleId: { + return ValidateSampleIdAtDefinition(decoration, inst); + } + case SpvBuiltInSampleMask: { + return ValidateSampleMaskAtDefinition(decoration, inst); + } + case SpvBuiltInSamplePosition: { + return ValidateSamplePositionAtDefinition(decoration, inst); + } + case SpvBuiltInTessCoord: { + return ValidateTessCoordAtDefinition(decoration, inst); + } + case SpvBuiltInTessLevelOuter: { + return ValidateTessLevelOuterAtDefinition(decoration, inst); + } + case SpvBuiltInTessLevelInner: { + return ValidateTessLevelInnerAtDefinition(decoration, inst); + } + case SpvBuiltInVertexIndex: { + return ValidateVertexIndexAtDefinition(decoration, inst); + } + case SpvBuiltInWorkgroupSize: { + return ValidateWorkgroupSizeAtDefinition(decoration, inst); + } + case SpvBuiltInVertexId: + case SpvBuiltInInstanceId: + case SpvBuiltInLocalInvocationIndex: + case SpvBuiltInWorkDim: + case SpvBuiltInGlobalSize: + case SpvBuiltInEnqueuedWorkgroupSize: + case SpvBuiltInGlobalOffset: + case SpvBuiltInGlobalLinearId: + case SpvBuiltInSubgroupSize: + case SpvBuiltInSubgroupMaxSize: + case SpvBuiltInNumSubgroups: + case SpvBuiltInNumEnqueuedSubgroups: + case SpvBuiltInSubgroupId: + case SpvBuiltInSubgroupLocalInvocationId: + case SpvBuiltInSubgroupEqMaskKHR: + case SpvBuiltInSubgroupGeMaskKHR: + case SpvBuiltInSubgroupGtMaskKHR: + case SpvBuiltInSubgroupLeMaskKHR: + case SpvBuiltInSubgroupLtMaskKHR: + case SpvBuiltInBaseVertex: + case SpvBuiltInBaseInstance: + case SpvBuiltInDrawIndex: + case SpvBuiltInDeviceIndex: + case SpvBuiltInViewIndex: + case SpvBuiltInBaryCoordNoPerspAMD: + case SpvBuiltInBaryCoordNoPerspCentroidAMD: + case SpvBuiltInBaryCoordNoPerspSampleAMD: + case SpvBuiltInBaryCoordSmoothAMD: + case SpvBuiltInBaryCoordSmoothCentroidAMD: + case SpvBuiltInBaryCoordSmoothSampleAMD: + case SpvBuiltInBaryCoordPullModelAMD: + case SpvBuiltInFragStencilRefEXT: + case SpvBuiltInViewportMaskNV: + case SpvBuiltInSecondaryPositionNV: + case SpvBuiltInSecondaryViewportMaskNV: + case SpvBuiltInPositionPerViewNV: + case SpvBuiltInViewportMaskPerViewNV: + case SpvBuiltInFullyCoveredEXT: + case SpvBuiltInMax: { + // No validation rules (for the moment). + break; + } + } + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::ValidateBuiltInsAtDefinition() { + for (const auto& kv : _.id_decorations()) { + const uint32_t id = kv.first; + const auto& decorations = kv.second; + if (decorations.empty()) { + continue; + } + + const Instruction* inst = _.FindDef(id); + assert(inst); + + for (const auto& decoration : kv.second) { + if (decoration.dec_type() != SpvDecorationBuiltIn) { + continue; + } + + if (spv_result_t error = + ValidateSingleBuiltInAtDefinition(decoration, *inst)) { + return error; + } + } + } + + return SPV_SUCCESS; +} + +spv_result_t BuiltInsValidator::Run() { + // First pass: validate all built-ins at definition and seed + // id_to_at_reference_checks_ with built-ins. + if (auto error = ValidateBuiltInsAtDefinition()) { + return error; + } + + if (id_to_at_reference_checks_.empty()) { + // No validation tasks were seeded. Nothing else to do. + return SPV_SUCCESS; + } + + ComputeFunctionToEntryPointMapping(); + + // Second pass: validate every id reference in the module using + // rules in id_to_at_reference_checks_. + for (const Instruction& inst : _.ordered_instructions()) { + Update(inst); + + std::set already_checked; + + for (const auto& operand : inst.operands()) { + if (!spvIsIdType(operand.type)) { + // Not id. + continue; + } + + const uint32_t id = inst.word(operand.offset); + if (id == inst.id()) { + // No need to check result id. + continue; + } + + if (!already_checked.insert(id).second) { + // The instruction has already referenced this id. + continue; + } + + // Instruction references the id. Run all checks associated with the id on + // the instruction. id_to_at_reference_checks_ can be modified in the + // process, iterators are safe because it's a tree-based map. + const auto it = id_to_at_reference_checks_.find(id); + if (it != id_to_at_reference_checks_.end()) { + for (const auto& check : it->second) { + if (spv_result_t error = check(inst)) { + return error; + } + } + } + } + } + + return SPV_SUCCESS; +} + +} // anonymous namespace + +// Validates correctness of built-in variables. +spv_result_t ValidateBuiltIns(const ValidationState_t& _) { + if (!spvIsVulkanEnv(_.context()->target_env)) { + // Early return. All currently implemented rules are based on Vulkan spec. + // + // TODO: If you are adding validation rules for environments other than + // Vulkan (or general rules which are not environment independent), then you + // need to modify or remove this condition. Consider also adding early + // returns into BuiltIn-specific rules, so that the system doesn't spawn new + // rules which don't do anything. + return SPV_SUCCESS; + } + + BuiltInsValidator validator(_); + return validator.Run(); +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_capability.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_capability.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_capability.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_capability.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,262 @@ +// Copyright (c) 2017 Google 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. + +// Validates OpCapability instruction. + +#include "validate.h" + +#include +#include + +#include "diagnostic.h" +#include "opcode.h" +#include "val/instruction.h" +#include "val/validation_state.h" + +namespace libspirv { + +namespace { + +bool IsSupportGuaranteedVulkan_1_0(uint32_t capability) { + switch (capability) { + case SpvCapabilityMatrix: + case SpvCapabilityShader: + case SpvCapabilityInputAttachment: + case SpvCapabilitySampled1D: + case SpvCapabilityImage1D: + case SpvCapabilitySampledBuffer: + case SpvCapabilityImageBuffer: + case SpvCapabilityImageQuery: + case SpvCapabilityDerivativeControl: + return true; + } + return false; +} + +bool IsSupportOptionalVulkan_1_0(uint32_t capability) { + switch (capability) { + case SpvCapabilityGeometry: + case SpvCapabilityTessellation: + case SpvCapabilityFloat64: + case SpvCapabilityInt64: + case SpvCapabilityInt16: + case SpvCapabilityTessellationPointSize: + case SpvCapabilityGeometryPointSize: + case SpvCapabilityImageGatherExtended: + case SpvCapabilityStorageImageMultisample: + case SpvCapabilityUniformBufferArrayDynamicIndexing: + case SpvCapabilitySampledImageArrayDynamicIndexing: + case SpvCapabilityStorageBufferArrayDynamicIndexing: + case SpvCapabilityStorageImageArrayDynamicIndexing: + case SpvCapabilityClipDistance: + case SpvCapabilityCullDistance: + case SpvCapabilityImageCubeArray: + case SpvCapabilitySampleRateShading: + case SpvCapabilitySparseResidency: + case SpvCapabilityMinLod: + case SpvCapabilitySampledCubeArray: + case SpvCapabilityImageMSArray: + case SpvCapabilityStorageImageExtendedFormats: + case SpvCapabilityInterpolationFunction: + case SpvCapabilityStorageImageReadWithoutFormat: + case SpvCapabilityStorageImageWriteWithoutFormat: + case SpvCapabilityMultiViewport: + return true; + } + return false; +} + +bool IsSupportGuaranteedOpenCL_1_2(uint32_t capability, bool embedded_profile) { + switch (capability) { + case SpvCapabilityAddresses: + case SpvCapabilityFloat16Buffer: + case SpvCapabilityGroups: + case SpvCapabilityInt16: + case SpvCapabilityInt8: + case SpvCapabilityKernel: + case SpvCapabilityLinkage: + case SpvCapabilityVector16: + return true; + case SpvCapabilityInt64: + return !embedded_profile; + case SpvCapabilityPipes: + return embedded_profile; + } + return false; +} + +bool IsSupportGuaranteedOpenCL_2_0(uint32_t capability, bool embedded_profile) { + if (IsSupportGuaranteedOpenCL_1_2(capability, embedded_profile)) return true; + + switch (capability) { + case SpvCapabilityDeviceEnqueue: + case SpvCapabilityGenericPointer: + case SpvCapabilityPipes: + return true; + } + return false; +} + +bool IsSupportGuaranteedOpenCL_2_2(uint32_t capability, bool embedded_profile) { + if (IsSupportGuaranteedOpenCL_2_0(capability, embedded_profile)) return true; + + switch (capability) { + case SpvCapabilitySubgroupDispatch: + case SpvCapabilityPipeStorage: + return true; + } + return false; +} + +bool IsSupportOptionalOpenCL_1_2(uint32_t capability) { + switch (capability) { + case SpvCapabilityImageBasic: + case SpvCapabilityFloat64: + return true; + } + return false; +} + +// Checks if |capability| was enabled by extension. +bool IsEnabledByExtension(ValidationState_t& _, uint32_t capability) { + spv_operand_desc operand_desc = nullptr; + _.grammar().lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, capability, + &operand_desc); + + // operand_desc is expected to be not null, otherwise validator would have + // failed at an earlier stage. This 'assert' is 'just in case'. + assert(operand_desc); + + ExtensionSet operand_exts(operand_desc->numExtensions, + operand_desc->extensions); + if (operand_exts.IsEmpty()) return false; + + return _.HasAnyOfExtensions(operand_exts); +} + +bool IsEnabledByCapabilityOpenCL_1_2(ValidationState_t& _, + uint32_t capability) { + if (_.HasCapability(SpvCapabilityImageBasic)) { + switch (capability) { + case SpvCapabilityLiteralSampler: + case SpvCapabilitySampled1D: + case SpvCapabilityImage1D: + case SpvCapabilitySampledBuffer: + case SpvCapabilityImageBuffer: + return true; + } + return false; + } + return false; +} + +bool IsEnabledByCapabilityOpenCL_2_0(ValidationState_t& _, + uint32_t capability) { + if (_.HasCapability(SpvCapabilityImageBasic)) { + switch (capability) { + case SpvCapabilityImageReadWrite: + case SpvCapabilityLiteralSampler: + case SpvCapabilitySampled1D: + case SpvCapabilityImage1D: + case SpvCapabilitySampledBuffer: + case SpvCapabilityImageBuffer: + return true; + } + return false; + } + return false; +} + +} // namespace + +// Validates that capability declarations use operands allowed in the current +// context. +spv_result_t CapabilityPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const SpvOp opcode = static_cast(inst->opcode); + if (opcode != SpvOpCapability) return SPV_SUCCESS; + + assert(inst->num_operands == 1); + + const spv_parsed_operand_t& operand = inst->operands[0]; + + assert(operand.num_words == 1); + assert(operand.offset < inst->num_words); + + const uint32_t capability = inst->words[operand.offset]; + const auto capability_str = [&_, capability]() { + spv_operand_desc desc = nullptr; + if (_.grammar().lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, capability, + &desc) != SPV_SUCCESS || + !desc) { + return std::string("Unknown"); + } + return std::string(desc->name); + }; + + const auto env = _.context()->target_env; + const bool opencl_embedded = env == SPV_ENV_OPENCL_EMBEDDED_1_2 || + env == SPV_ENV_OPENCL_EMBEDDED_2_0 || + env == SPV_ENV_OPENCL_EMBEDDED_2_1 || + env == SPV_ENV_OPENCL_EMBEDDED_2_2; + const std::string opencl_profile = opencl_embedded ? "Embedded" : "Full"; + if (env == SPV_ENV_VULKAN_1_0) { + if (!IsSupportGuaranteedVulkan_1_0(capability) && + !IsSupportOptionalVulkan_1_0(capability) && + !IsEnabledByExtension(_, capability)) { + return _.diag(SPV_ERROR_INVALID_CAPABILITY) + << "Capability " << capability_str() + << " is not allowed by Vulkan 1.0 specification" + << " (or requires extension)"; + } + } else if (env == SPV_ENV_OPENCL_1_2 || env == SPV_ENV_OPENCL_EMBEDDED_1_2) { + if (!IsSupportGuaranteedOpenCL_1_2(capability, opencl_embedded) && + !IsSupportOptionalOpenCL_1_2(capability) && + !IsEnabledByExtension(_, capability) && + !IsEnabledByCapabilityOpenCL_1_2(_, capability)) { + return _.diag(SPV_ERROR_INVALID_CAPABILITY) + << "Capability " << capability_str() + << " is not allowed by OpenCL 1.2 " << opencl_profile + << " Profile specification" + << " (or requires extension or capability)"; + } + } else if (env == SPV_ENV_OPENCL_2_0 || env == SPV_ENV_OPENCL_EMBEDDED_2_0 || + env == SPV_ENV_OPENCL_2_1 || env == SPV_ENV_OPENCL_EMBEDDED_2_1) { + if (!IsSupportGuaranteedOpenCL_2_0(capability, opencl_embedded) && + !IsSupportOptionalOpenCL_1_2(capability) && + !IsEnabledByExtension(_, capability) && + !IsEnabledByCapabilityOpenCL_2_0(_, capability)) { + return _.diag(SPV_ERROR_INVALID_CAPABILITY) + << "Capability " << capability_str() + << " is not allowed by OpenCL 2.0/2.1 " << opencl_profile + << " Profile specification" + << " (or requires extension or capability)"; + } + } else if (env == SPV_ENV_OPENCL_2_2 || env == SPV_ENV_OPENCL_EMBEDDED_2_2) { + if (!IsSupportGuaranteedOpenCL_2_2(capability, opencl_embedded) && + !IsSupportOptionalOpenCL_1_2(capability) && + !IsEnabledByExtension(_, capability) && + !IsEnabledByCapabilityOpenCL_2_0(_, capability)) { + return _.diag(SPV_ERROR_INVALID_CAPABILITY) + << "Capability " << capability_str() + << " is not allowed by OpenCL 2.2 " << opencl_profile + << " Profile specification" + << " (or requires extension or capability)"; + } + } + + return SPV_SUCCESS; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_cfg.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_cfg.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_cfg.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_cfg.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,430 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "cfa.h" +#include "validate.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "spirv_validator_options.h" +#include "val/basic_block.h" +#include "val/construct.h" +#include "val/function.h" +#include "val/validation_state.h" + +using std::find; +using std::function; +using std::get; +using std::ignore; +using std::make_pair; +using std::make_tuple; +using std::numeric_limits; +using std::pair; +using std::string; +using std::tie; +using std::transform; +using std::tuple; +using std::unordered_map; +using std::unordered_set; +using std::vector; + +using libspirv::BasicBlock; + +namespace libspirv { + +namespace { + +using bb_ptr = BasicBlock*; +using cbb_ptr = const BasicBlock*; +using bb_iter = vector::const_iterator; + +} // namespace + +void printDominatorList(const BasicBlock& b) { + std::cout << b.id() << " is dominated by: "; + const BasicBlock* bb = &b; + while (bb->immediate_dominator() != bb) { + bb = bb->immediate_dominator(); + std::cout << bb->id() << " "; + } +} + +#define CFG_ASSERT(ASSERT_FUNC, TARGET) \ + if (spv_result_t rcode = ASSERT_FUNC(_, TARGET)) return rcode + +spv_result_t FirstBlockAssert(ValidationState_t& _, uint32_t target) { + if (_.current_function().IsFirstBlock(target)) { + return _.diag(SPV_ERROR_INVALID_CFG) + << "First block " << _.getIdName(target) << " of function " + << _.getIdName(_.current_function().id()) << " is targeted by block " + << _.getIdName(_.current_function().current_block()->id()); + } + return SPV_SUCCESS; +} + +spv_result_t MergeBlockAssert(ValidationState_t& _, uint32_t merge_block) { + if (_.current_function().IsBlockType(merge_block, kBlockTypeMerge)) { + return _.diag(SPV_ERROR_INVALID_CFG) + << "Block " << _.getIdName(merge_block) + << " is already a merge block for another header"; + } + return SPV_SUCCESS; +} + +/// Update the continue construct's exit blocks once the backedge blocks are +/// identified in the CFG. +void UpdateContinueConstructExitBlocks( + Function& function, const vector>& back_edges) { + auto& constructs = function.constructs(); + // TODO(umar): Think of a faster way to do this + for (auto& edge : back_edges) { + uint32_t back_edge_block_id; + uint32_t loop_header_block_id; + tie(back_edge_block_id, loop_header_block_id) = edge; + auto is_this_header = [=](Construct& c) { + return c.type() == ConstructType::kLoop && + c.entry_block()->id() == loop_header_block_id; + }; + + for (auto construct : constructs) { + if (is_this_header(construct)) { + Construct* continue_construct = + construct.corresponding_constructs().back(); + assert(continue_construct->type() == ConstructType::kContinue); + + BasicBlock* back_edge_block; + tie(back_edge_block, ignore) = function.GetBlock(back_edge_block_id); + continue_construct->set_exit(back_edge_block); + } + } + } +} + +tuple ConstructNames(ConstructType type) { + string construct_name, header_name, exit_name; + + switch (type) { + case ConstructType::kSelection: + construct_name = "selection"; + header_name = "selection header"; + exit_name = "merge block"; + break; + case ConstructType::kLoop: + construct_name = "loop"; + header_name = "loop header"; + exit_name = "merge block"; + break; + case ConstructType::kContinue: + construct_name = "continue"; + header_name = "continue target"; + exit_name = "back-edge block"; + break; + case ConstructType::kCase: + construct_name = "case"; + header_name = "case entry block"; + exit_name = "case exit block"; + break; + default: + assert(1 == 0 && "Not defined type"); + } + + return make_tuple(construct_name, header_name, exit_name); +} + +/// Constructs an error message for construct validation errors +string ConstructErrorString(const Construct& construct, + const string& header_string, + const string& exit_string, + const string& dominate_text) { + string construct_name, header_name, exit_name; + tie(construct_name, header_name, exit_name) = + ConstructNames(construct.type()); + + // TODO(umar): Add header block for continue constructs to error message + return "The " + construct_name + " construct with the " + header_name + " " + + header_string + " " + dominate_text + " the " + exit_name + " " + + exit_string; +} + +spv_result_t StructuredControlFlowChecks( + const ValidationState_t& _, const Function& function, + const vector>& back_edges) { + /// Check all backedges target only loop headers and have exactly one + /// back-edge branching to it + + // Map a loop header to blocks with back-edges to the loop header. + std::map> loop_latch_blocks; + for (auto back_edge : back_edges) { + uint32_t back_edge_block; + uint32_t header_block; + tie(back_edge_block, header_block) = back_edge; + if (!function.IsBlockType(header_block, kBlockTypeLoop)) { + return _.diag(SPV_ERROR_INVALID_CFG) + << "Back-edges (" << _.getIdName(back_edge_block) << " -> " + << _.getIdName(header_block) + << ") can only be formed between a block and a loop header."; + } + loop_latch_blocks[header_block].insert(back_edge_block); + } + + // Check the loop headers have exactly one back-edge branching to it + for (BasicBlock* loop_header : function.ordered_blocks()) { + if (!loop_header->reachable()) continue; + if (!loop_header->is_type(kBlockTypeLoop)) continue; + auto loop_header_id = loop_header->id(); + auto num_latch_blocks = loop_latch_blocks[loop_header_id].size(); + if (num_latch_blocks != 1) { + return _.diag(SPV_ERROR_INVALID_CFG) + << "Loop header " << _.getIdName(loop_header_id) + << " is targeted by " << num_latch_blocks + << " back-edge blocks but the standard requires exactly one"; + } + } + + // Check construct rules + for (const Construct& construct : function.constructs()) { + auto header = construct.entry_block(); + auto merge = construct.exit_block(); + + if (header->reachable() && !merge) { + string construct_name, header_name, exit_name; + tie(construct_name, header_name, exit_name) = + ConstructNames(construct.type()); + return _.diag(SPV_ERROR_INTERNAL) + << "Construct " + construct_name + " with " + header_name + " " + + _.getIdName(header->id()) + " does not have a " + + exit_name + ". This may be a bug in the validator."; + } + + // If the exit block is reachable then it's dominated by the + // header. + if (merge && merge->reachable()) { + if (!header->dominates(*merge)) { + return _.diag(SPV_ERROR_INVALID_CFG) << ConstructErrorString( + construct, _.getIdName(header->id()), + _.getIdName(merge->id()), "does not dominate"); + } + // If it's really a merge block for a selection or loop, then it must be + // *strictly* dominated by the header. + if (construct.ExitBlockIsMergeBlock() && (header == merge)) { + return _.diag(SPV_ERROR_INVALID_CFG) << ConstructErrorString( + construct, _.getIdName(header->id()), + _.getIdName(merge->id()), "does not strictly dominate"); + } + } + // Check post-dominance for continue constructs. But dominance and + // post-dominance only make sense when the construct is reachable. + if (header->reachable() && construct.type() == ConstructType::kContinue) { + if (!merge->postdominates(*header)) { + return _.diag(SPV_ERROR_INVALID_CFG) << ConstructErrorString( + construct, _.getIdName(header->id()), + _.getIdName(merge->id()), "is not post dominated by"); + } + } + // TODO(umar): an OpSwitch block dominates all its defined case + // constructs + // TODO(umar): each case construct has at most one branch to another + // case construct + // TODO(umar): each case construct is branched to by at most one other + // case construct + // TODO(umar): if Target T1 branches to Target T2, or if Target T1 + // branches to the Default and the Default branches to Target T2, then + // T1 must immediately precede T2 in the list of the OpSwitch Target + // operands + } + return SPV_SUCCESS; +} + +spv_result_t PerformCfgChecks(ValidationState_t& _) { + for (auto& function : _.functions()) { + // Check all referenced blocks are defined within a function + if (function.undefined_block_count() != 0) { + string undef_blocks("{"); + for (auto undefined_block : function.undefined_blocks()) { + undef_blocks += _.getIdName(undefined_block) + " "; + } + return _.diag(SPV_ERROR_INVALID_CFG) + << "Block(s) " << undef_blocks << "\b}" + << " are referenced but not defined in function " + << _.getIdName(function.id()); + } + + // Set each block's immediate dominator and immediate postdominator, + // and find all back-edges. + // + // We want to analyze all the blocks in the function, even in degenerate + // control flow cases including unreachable blocks. So use the augmented + // CFG to ensure we cover all the blocks. + vector postorder; + vector postdom_postorder; + vector> back_edges; + auto ignore_block = [](cbb_ptr) {}; + auto ignore_edge = [](cbb_ptr, cbb_ptr) {}; + if (!function.ordered_blocks().empty()) { + /// calculate dominators + spvtools::CFA::DepthFirstTraversal( + function.first_block(), function.AugmentedCFGSuccessorsFunction(), + ignore_block, [&](cbb_ptr b) { postorder.push_back(b); }, + ignore_edge); + auto edges = spvtools::CFA::CalculateDominators( + postorder, function.AugmentedCFGPredecessorsFunction()); + for (auto edge : edges) { + edge.first->SetImmediateDominator(edge.second); + } + + /// calculate post dominators + spvtools::CFA::DepthFirstTraversal( + function.pseudo_exit_block(), + function.AugmentedCFGPredecessorsFunction(), ignore_block, + [&](cbb_ptr b) { postdom_postorder.push_back(b); }, ignore_edge); + auto postdom_edges = + spvtools::CFA::CalculateDominators( + postdom_postorder, function.AugmentedCFGSuccessorsFunction()); + for (auto edge : postdom_edges) { + edge.first->SetImmediatePostDominator(edge.second); + } + /// calculate back edges. + spvtools::CFA::DepthFirstTraversal( + function.pseudo_entry_block(), + function + .AugmentedCFGSuccessorsFunctionIncludingHeaderToContinueEdge(), + ignore_block, ignore_block, [&](cbb_ptr from, cbb_ptr to) { + back_edges.emplace_back(from->id(), to->id()); + }); + } + UpdateContinueConstructExitBlocks(function, back_edges); + + auto& blocks = function.ordered_blocks(); + if (!blocks.empty()) { + // Check if the order of blocks in the binary appear before the blocks + // they dominate + for (auto block = begin(blocks) + 1; block != end(blocks); ++block) { + if (auto idom = (*block)->immediate_dominator()) { + if (idom != function.pseudo_entry_block() && + block == std::find(begin(blocks), block, idom)) { + return _.diag(SPV_ERROR_INVALID_CFG) + << "Block " << _.getIdName((*block)->id()) + << " appears in the binary before its dominator " + << _.getIdName(idom->id()); + } + } + } + // If we have structed control flow, check that no block has a control + // flow nesting depth larger than the limit. + if (_.HasCapability(SpvCapabilityShader)) { + const int control_flow_nesting_depth_limit = + _.options()->universal_limits_.max_control_flow_nesting_depth; + for (auto block = begin(blocks); block != end(blocks); ++block) { + if (function.GetBlockDepth(*block) > + control_flow_nesting_depth_limit) { + return _.diag(SPV_ERROR_INVALID_CFG) + << "Maximum Control Flow nesting depth exceeded."; + } + } + } + } + + /// Structured control flow checks are only required for shader capabilities + if (_.HasCapability(SpvCapabilityShader)) { + if (auto error = StructuredControlFlowChecks(_, function, back_edges)) + return error; + } + } + return SPV_SUCCESS; +} + +spv_result_t CfgPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + SpvOp opcode = static_cast(inst->opcode); + switch (opcode) { + case SpvOpLabel: + if (auto error = _.current_function().RegisterBlock(inst->result_id)) + return error; + break; + case SpvOpLoopMerge: { + uint32_t merge_block = inst->words[inst->operands[0].offset]; + uint32_t continue_block = inst->words[inst->operands[1].offset]; + CFG_ASSERT(MergeBlockAssert, merge_block); + + if (auto error = _.current_function().RegisterLoopMerge(merge_block, + continue_block)) + return error; + } break; + case SpvOpSelectionMerge: { + uint32_t merge_block = inst->words[inst->operands[0].offset]; + CFG_ASSERT(MergeBlockAssert, merge_block); + + if (auto error = _.current_function().RegisterSelectionMerge(merge_block)) + return error; + } break; + case SpvOpBranch: { + uint32_t target = inst->words[inst->operands[0].offset]; + CFG_ASSERT(FirstBlockAssert, target); + + _.current_function().RegisterBlockEnd({target}, opcode); + } break; + case SpvOpBranchConditional: { + uint32_t tlabel = inst->words[inst->operands[1].offset]; + uint32_t flabel = inst->words[inst->operands[2].offset]; + CFG_ASSERT(FirstBlockAssert, tlabel); + CFG_ASSERT(FirstBlockAssert, flabel); + + _.current_function().RegisterBlockEnd({tlabel, flabel}, opcode); + } break; + + case SpvOpSwitch: { + vector cases; + for (int i = 1; i < inst->num_operands; i += 2) { + uint32_t target = inst->words[inst->operands[i].offset]; + CFG_ASSERT(FirstBlockAssert, target); + cases.push_back(target); + } + _.current_function().RegisterBlockEnd({cases}, opcode); + } break; + case SpvOpReturn: { + const uint32_t return_type = _.current_function().GetResultTypeId(); + const Instruction* return_type_inst = _.FindDef(return_type); + assert(return_type_inst); + if (return_type_inst->opcode() != SpvOpTypeVoid) + return _.diag(SPV_ERROR_INVALID_CFG) + << "OpReturn can only be called from a function with void " + << "return type."; + } + // Fallthrough. + case SpvOpKill: + case SpvOpReturnValue: + case SpvOpUnreachable: + _.current_function().RegisterBlockEnd(vector(), opcode); + if (opcode == SpvOpKill) { + _.current_function().RegisterExecutionModelLimitation( + SpvExecutionModelFragment, + "OpKill requires Fragment execution model"); + } + break; + default: + break; + } + return SPV_SUCCESS; +} +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_composites.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_composites.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_composites.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_composites.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,481 @@ +// Copyright (c) 2017 Google 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. + +// Validates correctness of composite SPIR-V instructions. + +#include "validate.h" + +#include "diagnostic.h" +#include "opcode.h" +#include "val/instruction.h" +#include "val/validation_state.h" + +namespace libspirv { + +namespace { + +// Returns the type of the value accessed by OpCompositeExtract or +// OpCompositeInsert instruction. The function traverses the hierarchy of +// nested data structures (structs, arrays, vectors, matrices) as directed by +// the sequence of indices in the instruction. May return error if traversal +// fails (encountered non-composite, out of bounds, nesting too deep). +// Returns the type of Composite operand if the instruction has no indices. +spv_result_t GetExtractInsertValueType(ValidationState_t& _, + const spv_parsed_instruction_t& inst, + uint32_t* member_type) { + const SpvOp opcode = static_cast(inst.opcode); + assert(opcode == SpvOpCompositeExtract || opcode == SpvOpCompositeInsert); + uint32_t word_index = opcode == SpvOpCompositeExtract ? 4 : 5; + const uint32_t num_words = static_cast(inst.num_words); + const uint32_t composite_id_index = word_index - 1; + + const uint32_t num_indices = num_words - word_index; + const uint32_t kCompositeExtractInsertMaxNumIndices = 255; + if (num_indices > kCompositeExtractInsertMaxNumIndices) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "The number of indexes in Op" << spvOpcodeString(opcode) + << " may not exceed " << kCompositeExtractInsertMaxNumIndices + << ". Found " << num_indices << " indexes."; + } + + *member_type = _.GetTypeId(inst.words[composite_id_index]); + if (*member_type == 0) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Composite to be an object of composite type"; + } + + for (; word_index < num_words; ++word_index) { + const uint32_t component_index = inst.words[word_index]; + const Instruction* const type_inst = _.FindDef(*member_type); + assert(type_inst); + switch (type_inst->opcode()) { + case SpvOpTypeVector: { + *member_type = type_inst->word(2); + const uint32_t vector_size = type_inst->word(3); + if (component_index >= vector_size) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": vector access is out of bounds, vector size is " + << vector_size << ", but access index is " << component_index; + } + break; + } + case SpvOpTypeMatrix: { + *member_type = type_inst->word(2); + const uint32_t num_cols = type_inst->word(3); + if (component_index >= num_cols) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": matrix access is out of bounds, matrix has " << num_cols + << " columns, but access index is " << component_index; + } + break; + } + case SpvOpTypeArray: { + uint64_t array_size = 0; + auto size = _.FindDef(type_inst->word(3)); + *member_type = type_inst->word(2); + if (spvOpcodeIsSpecConstant(size->opcode())) { + // Cannot verify against the size of this array. + break; + } + + if (!_.GetConstantValUint64(type_inst->word(3), &array_size)) { + assert(0 && "Array type definition is corrupt"); + } + if (component_index >= array_size) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": array access is out of bounds, array size is " + << array_size << ", but access index is " << component_index; + } + break; + } + case SpvOpTypeRuntimeArray: { + *member_type = type_inst->word(2); + // Array size is unknown. + break; + } + case SpvOpTypeStruct: { + const size_t num_struct_members = type_inst->words().size() - 2; + if (component_index >= num_struct_members) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Index is out of bounds: Op" << spvOpcodeString(opcode) + << " can not find index " << component_index + << " into the structure '" << type_inst->id() + << "'. This structure has " << num_struct_members + << " members. Largest valid index is " + << num_struct_members - 1 << "."; + } + *member_type = type_inst->word(component_index + 2); + break; + } + default: + return _.diag(SPV_ERROR_INVALID_DATA) + << "Op" << spvOpcodeString(opcode) + << " reached non-composite type while indexes still remain to " + "be traversed."; + } + } + + return SPV_SUCCESS; +} + +} // anonymous namespace + +// Validates correctness of composite instructions. +spv_result_t CompositesPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const SpvOp opcode = static_cast(inst->opcode); + const uint32_t result_type = inst->type_id; + const uint32_t num_operands = static_cast(inst->num_operands); + + switch (opcode) { + case SpvOpVectorExtractDynamic: { + const SpvOp result_opcode = _.GetIdOpcode(result_type); + if (!spvOpcodeIsScalarType(result_opcode)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Result Type to be a scalar type"; + } + + const uint32_t vector_type = _.GetOperandTypeId(inst, 2); + const SpvOp vector_opcode = _.GetIdOpcode(vector_type); + if (vector_opcode != SpvOpTypeVector) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Vector type to be OpTypeVector"; + } + + if (_.GetComponentType(vector_type) != result_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Vector component type to be equal to Result Type"; + } + + const uint32_t index_type = _.GetOperandTypeId(inst, 3); + if (!_.IsIntScalarType(index_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Index to be int scalar"; + } + + break; + } + + case SpvOpVectorInsertDynamic: { + const SpvOp result_opcode = _.GetIdOpcode(result_type); + if (result_opcode != SpvOpTypeVector) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Result Type to be OpTypeVector"; + } + + const uint32_t vector_type = _.GetOperandTypeId(inst, 2); + if (vector_type != result_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Vector type to be equal to Result Type"; + } + + const uint32_t component_type = _.GetOperandTypeId(inst, 3); + if (_.GetComponentType(result_type) != component_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Component type to be equal to Result Type " + << "component type"; + } + + const uint32_t index_type = _.GetOperandTypeId(inst, 4); + if (!_.IsIntScalarType(index_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Index to be int scalar"; + } + + break; + } + + case SpvOpVectorShuffle: { + // Handled in validate_id.cpp. + // TODO(atgoo@github.com) Consider moving it here. + break; + } + + case SpvOpCompositeConstruct: { + const SpvOp result_opcode = _.GetIdOpcode(result_type); + switch (result_opcode) { + case SpvOpTypeVector: { + const uint32_t num_result_components = _.GetDimension(result_type); + const uint32_t result_component_type = + _.GetComponentType(result_type); + uint32_t given_component_count = 0; + + if (num_operands <= 3) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected number of constituents to be at least 2"; + } + + for (uint32_t operand_index = 2; operand_index < num_operands; + ++operand_index) { + const uint32_t operand_type = + _.GetOperandTypeId(inst, operand_index); + if (operand_type == result_component_type) { + ++given_component_count; + } else { + if (_.GetIdOpcode(operand_type) != SpvOpTypeVector || + _.GetComponentType(operand_type) != result_component_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Constituents to be scalars or vectors of " + << "the same type as Result Type components"; + } + + given_component_count += _.GetDimension(operand_type); + } + } + + if (num_result_components != given_component_count) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected total number of given components to be equal " + << "to the size of Result Type vector"; + } + + break; + } + case SpvOpTypeMatrix: { + uint32_t result_num_rows = 0; + uint32_t result_num_cols = 0; + uint32_t result_col_type = 0; + uint32_t result_component_type = 0; + if (!_.GetMatrixTypeInfo(result_type, &result_num_rows, + &result_num_cols, &result_col_type, + &result_component_type)) { + assert(0); + } + + if (result_num_cols + 2 != num_operands) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected total number of Constituents to be equal " + << "to the number of columns of Result Type matrix"; + } + + for (uint32_t operand_index = 2; operand_index < num_operands; + ++operand_index) { + const uint32_t operand_type = + _.GetOperandTypeId(inst, operand_index); + if (operand_type != result_col_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Constituent type to be equal to the column " + << "type Result Type matrix"; + } + } + + break; + } + case SpvOpTypeArray: { + const Instruction* const array_inst = _.FindDef(result_type); + assert(array_inst); + assert(array_inst->opcode() == SpvOpTypeArray); + + auto size = _.FindDef(array_inst->word(3)); + if (spvOpcodeIsSpecConstant(size->opcode())) { + // Cannot verify against the size of this array. + break; + } + + uint64_t array_size = 0; + if (!_.GetConstantValUint64(array_inst->word(3), &array_size)) { + assert(0 && "Array type definition is corrupt"); + } + + if (array_size + 2 != num_operands) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected total number of Constituents to be equal " + << "to the number of elements of Result Type array"; + } + + const uint32_t result_component_type = array_inst->word(2); + for (uint32_t operand_index = 2; operand_index < num_operands; + ++operand_index) { + const uint32_t operand_type = + _.GetOperandTypeId(inst, operand_index); + if (operand_type != result_component_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Constituent type to be equal to the column " + << "type Result Type array"; + } + } + + break; + } + case SpvOpTypeStruct: { + const Instruction* const struct_inst = _.FindDef(result_type); + assert(struct_inst); + assert(struct_inst->opcode() == SpvOpTypeStruct); + + if (struct_inst->operands().size() + 1 != num_operands) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected total number of Constituents to be equal " + << "to the number of members of Result Type struct"; + } + + for (uint32_t operand_index = 2; operand_index < num_operands; + ++operand_index) { + const uint32_t operand_type = + _.GetOperandTypeId(inst, operand_index); + const uint32_t member_type = struct_inst->word(operand_index); + if (operand_type != member_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Constituent type to be equal to the " + << "corresponding member type of Result Type struct"; + } + } + + break; + } + default: { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Result Type to be a composite type"; + } + } + + break; + } + + case SpvOpCompositeExtract: { + uint32_t member_type = 0; + if (spv_result_t error = + GetExtractInsertValueType(_, *inst, &member_type)) { + return error; + } + + if (result_type != member_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Op" << spvOpcodeString(opcode) << " result type (Op" + << spvOpcodeString(_.GetIdOpcode(result_type)) + << ") does not match the type that results from indexing into " + "the " + "composite (Op" + << spvOpcodeString(_.GetIdOpcode(member_type)) << ")."; + } + break; + } + + case SpvOpCompositeInsert: { + const uint32_t object_type = _.GetOperandTypeId(inst, 2); + const uint32_t composite_type = _.GetOperandTypeId(inst, 3); + + if (result_type != composite_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "The Result Type must be the same as Composite type in Op" + << spvOpcodeString(opcode) << " yielding Result Id " + << result_type << "."; + } + + uint32_t member_type = 0; + if (spv_result_t error = + GetExtractInsertValueType(_, *inst, &member_type)) { + return error; + } + + if (object_type != member_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "The Object type (Op" + << spvOpcodeString(_.GetIdOpcode(object_type)) << ") in Op" + << spvOpcodeString(opcode) + << " does not match the type that results from indexing into " + "the Composite (Op" + << spvOpcodeString(_.GetIdOpcode(member_type)) << ")."; + } + break; + } + + case SpvOpCopyObject: { + if (!spvOpcodeGeneratesType(_.GetIdOpcode(result_type))) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Result Type to be a type"; + } + + const uint32_t operand_type = _.GetOperandTypeId(inst, 2); + if (operand_type != result_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Result Type and Operand type to be the same"; + } + + break; + } + + case SpvOpTranspose: { + uint32_t result_num_rows = 0; + uint32_t result_num_cols = 0; + uint32_t result_col_type = 0; + uint32_t result_component_type = 0; + if (!_.GetMatrixTypeInfo(result_type, &result_num_rows, &result_num_cols, + &result_col_type, &result_component_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Result Type to be a matrix type"; + } + + const uint32_t matrix_type = _.GetOperandTypeId(inst, 2); + uint32_t matrix_num_rows = 0; + uint32_t matrix_num_cols = 0; + uint32_t matrix_col_type = 0; + uint32_t matrix_component_type = 0; + if (!_.GetMatrixTypeInfo(matrix_type, &matrix_num_rows, &matrix_num_cols, + &matrix_col_type, &matrix_component_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Matrix to be of type OpTypeMatrix"; + } + + if (result_component_type != matrix_component_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected component types of Matrix and Result Type to be " + << "identical"; + } + + if (result_num_rows != matrix_num_cols || + result_num_cols != matrix_num_rows) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected number of columns and the column size of Matrix " + << "to be the reverse of those of Result Type"; + } + + break; + } + + default: + break; + } + + return SPV_SUCCESS; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_conversion.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_conversion.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_conversion.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_conversion.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,412 @@ +// Copyright (c) 2017 Google 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. + +// Validates correctness of conversion instructions. + +#include "validate.h" + +#include "diagnostic.h" +#include "opcode.h" +#include "val/instruction.h" +#include "val/validation_state.h" + +namespace libspirv { + +// Validates correctness of conversion instructions. +spv_result_t ConversionPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const SpvOp opcode = static_cast(inst->opcode); + const uint32_t result_type = inst->type_id; + + switch (opcode) { + case SpvOpConvertFToU: { + if (!_.IsUnsignedIntScalarType(result_type) && + !_.IsUnsignedIntVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected unsigned int scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t input_type = _.GetOperandTypeId(inst, 2); + if (!input_type || (!_.IsFloatScalarType(input_type) && + !_.IsFloatVectorType(input_type))) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to be float scalar or vector: " + << spvOpcodeString(opcode); + + if (_.GetDimension(result_type) != _.GetDimension(input_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to have the same dimension as Result Type: " + << spvOpcodeString(opcode); + + break; + } + + case SpvOpConvertFToS: { + if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected int scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t input_type = _.GetOperandTypeId(inst, 2); + if (!input_type || (!_.IsFloatScalarType(input_type) && + !_.IsFloatVectorType(input_type))) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to be float scalar or vector: " + << spvOpcodeString(opcode); + + if (_.GetDimension(result_type) != _.GetDimension(input_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to have the same dimension as Result Type: " + << spvOpcodeString(opcode); + + break; + } + + case SpvOpConvertSToF: + case SpvOpConvertUToF: { + if (!_.IsFloatScalarType(result_type) && + !_.IsFloatVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected float scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t input_type = _.GetOperandTypeId(inst, 2); + if (!input_type || + (!_.IsIntScalarType(input_type) && !_.IsIntVectorType(input_type))) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to be int scalar or vector: " + << spvOpcodeString(opcode); + + if (_.GetDimension(result_type) != _.GetDimension(input_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to have the same dimension as Result Type: " + << spvOpcodeString(opcode); + + break; + } + + case SpvOpUConvert: { + if (!_.IsUnsignedIntScalarType(result_type) && + !_.IsUnsignedIntVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected unsigned int scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t input_type = _.GetOperandTypeId(inst, 2); + if (!input_type || + (!_.IsIntScalarType(input_type) && !_.IsIntVectorType(input_type))) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to be int scalar or vector: " + << spvOpcodeString(opcode); + + if (_.GetDimension(result_type) != _.GetDimension(input_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to have the same dimension as Result Type: " + << spvOpcodeString(opcode); + + if (_.GetBitWidth(result_type) == _.GetBitWidth(input_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to have different bit width from Result " + "Type: " + << spvOpcodeString(opcode); + break; + } + + case SpvOpSConvert: { + if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected int scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t input_type = _.GetOperandTypeId(inst, 2); + if (!input_type || + (!_.IsIntScalarType(input_type) && !_.IsIntVectorType(input_type))) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to be int scalar or vector: " + << spvOpcodeString(opcode); + + if (_.GetDimension(result_type) != _.GetDimension(input_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to have the same dimension as Result Type: " + << spvOpcodeString(opcode); + + if (_.GetBitWidth(result_type) == _.GetBitWidth(input_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to have different bit width from Result " + "Type: " + << spvOpcodeString(opcode); + break; + } + + case SpvOpFConvert: { + if (!_.IsFloatScalarType(result_type) && + !_.IsFloatVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected float scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t input_type = _.GetOperandTypeId(inst, 2); + if (!input_type || (!_.IsFloatScalarType(input_type) && + !_.IsFloatVectorType(input_type))) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to be float scalar or vector: " + << spvOpcodeString(opcode); + + if (_.GetDimension(result_type) != _.GetDimension(input_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to have the same dimension as Result Type: " + << spvOpcodeString(opcode); + + if (_.GetBitWidth(result_type) == _.GetBitWidth(input_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to have different bit width from Result " + "Type: " + << spvOpcodeString(opcode); + break; + } + + case SpvOpQuantizeToF16: { + if ((!_.IsFloatScalarType(result_type) && + !_.IsFloatVectorType(result_type)) || + _.GetBitWidth(result_type) != 32) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected 32-bit float scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t input_type = _.GetOperandTypeId(inst, 2); + if (input_type != result_type) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input type to be equal to Result Type: " + << spvOpcodeString(opcode); + break; + } + + case SpvOpConvertPtrToU: { + if (!_.IsUnsignedIntScalarType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected unsigned int scalar type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t input_type = _.GetOperandTypeId(inst, 2); + if (!_.IsPointerType(input_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to be a pointer: " << spvOpcodeString(opcode); + break; + } + + case SpvOpSatConvertSToU: + case SpvOpSatConvertUToS: { + if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected int scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t input_type = _.GetOperandTypeId(inst, 2); + if (!input_type || + (!_.IsIntScalarType(input_type) && !_.IsIntVectorType(input_type))) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected int scalar or vector as input: " + << spvOpcodeString(opcode); + + if (_.GetDimension(result_type) != _.GetDimension(input_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to have the same dimension as Result Type: " + << spvOpcodeString(opcode); + break; + } + + case SpvOpConvertUToPtr: { + if (!_.IsPointerType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type to be a pointer: " + << spvOpcodeString(opcode); + + const uint32_t input_type = _.GetOperandTypeId(inst, 2); + if (!_.IsIntScalarType(input_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected int scalar as input: " << spvOpcodeString(opcode); + break; + } + + case SpvOpPtrCastToGeneric: { + uint32_t result_storage_class = 0; + uint32_t result_data_type = 0; + if (!_.GetPointerTypeInfo(result_type, &result_data_type, + &result_storage_class)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type to be a pointer: " + << spvOpcodeString(opcode); + + if (result_storage_class != SpvStorageClassGeneric) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type to have storage class Generic: " + << spvOpcodeString(opcode); + + const uint32_t input_type = _.GetOperandTypeId(inst, 2); + uint32_t input_storage_class = 0; + uint32_t input_data_type = 0; + if (!_.GetPointerTypeInfo(input_type, &input_data_type, + &input_storage_class)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to be a pointer: " << spvOpcodeString(opcode); + + if (input_storage_class != SpvStorageClassWorkgroup && + input_storage_class != SpvStorageClassCrossWorkgroup && + input_storage_class != SpvStorageClassFunction) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to have storage class Workgroup, " + << "CrossWorkgroup or Function: " << spvOpcodeString(opcode); + + if (result_data_type != input_data_type) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input and Result Type to point to the same type: " + << spvOpcodeString(opcode); + break; + } + + case SpvOpGenericCastToPtr: { + uint32_t result_storage_class = 0; + uint32_t result_data_type = 0; + if (!_.GetPointerTypeInfo(result_type, &result_data_type, + &result_storage_class)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type to be a pointer: " + << spvOpcodeString(opcode); + + if (result_storage_class != SpvStorageClassWorkgroup && + result_storage_class != SpvStorageClassCrossWorkgroup && + result_storage_class != SpvStorageClassFunction) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type to have storage class Workgroup, " + << "CrossWorkgroup or Function: " << spvOpcodeString(opcode); + + const uint32_t input_type = _.GetOperandTypeId(inst, 2); + uint32_t input_storage_class = 0; + uint32_t input_data_type = 0; + if (!_.GetPointerTypeInfo(input_type, &input_data_type, + &input_storage_class)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to be a pointer: " << spvOpcodeString(opcode); + + if (input_storage_class != SpvStorageClassGeneric) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to have storage class Generic: " + << spvOpcodeString(opcode); + + if (result_data_type != input_data_type) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input and Result Type to point to the same type: " + << spvOpcodeString(opcode); + break; + } + + case SpvOpGenericCastToPtrExplicit: { + uint32_t result_storage_class = 0; + uint32_t result_data_type = 0; + if (!_.GetPointerTypeInfo(result_type, &result_data_type, + &result_storage_class)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type to be a pointer: " + << spvOpcodeString(opcode); + + const uint32_t target_storage_class = inst->words[4]; + if (result_storage_class != target_storage_class) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type to be of target storage class: " + << spvOpcodeString(opcode); + + const uint32_t input_type = _.GetOperandTypeId(inst, 2); + uint32_t input_storage_class = 0; + uint32_t input_data_type = 0; + if (!_.GetPointerTypeInfo(input_type, &input_data_type, + &input_storage_class)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to be a pointer: " << spvOpcodeString(opcode); + + if (input_storage_class != SpvStorageClassGeneric) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to have storage class Generic: " + << spvOpcodeString(opcode); + + if (result_data_type != input_data_type) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input and Result Type to point to the same type: " + << spvOpcodeString(opcode); + + if (target_storage_class != SpvStorageClassWorkgroup && + target_storage_class != SpvStorageClassCrossWorkgroup && + target_storage_class != SpvStorageClassFunction) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected target storage class to be Workgroup, " + << "CrossWorkgroup or Function: " << spvOpcodeString(opcode); + break; + } + + case SpvOpBitcast: { + const uint32_t input_type = _.GetOperandTypeId(inst, 2); + if (!input_type) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to have a type: " << spvOpcodeString(opcode); + + const bool result_is_pointer = _.IsPointerType(result_type); + const bool result_is_int_scalar = _.IsIntScalarType(result_type); + const bool input_is_pointer = _.IsPointerType(input_type); + const bool input_is_int_scalar = _.IsIntScalarType(input_type); + + if (!result_is_pointer && !result_is_int_scalar && + !_.IsIntVectorType(result_type) && + !_.IsFloatScalarType(result_type) && + !_.IsFloatVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type to be a pointer or int or float vector " + << "or scalar type: " << spvOpcodeString(opcode); + + if (!input_is_pointer && !input_is_int_scalar && + !_.IsIntVectorType(input_type) && !_.IsFloatScalarType(input_type) && + !_.IsFloatVectorType(input_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to be a pointer or int or float vector " + << "or scalar: " << spvOpcodeString(opcode); + + if (result_is_pointer && !input_is_pointer && !input_is_int_scalar) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to be a pointer or int scalar if Result Type " + << "is pointer: " << spvOpcodeString(opcode); + + if (input_is_pointer && !result_is_pointer && !result_is_int_scalar) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Pointer can only be converted to another pointer or int " + << "scalar: " << spvOpcodeString(opcode); + + if (!result_is_pointer && !input_is_pointer) { + const uint32_t result_size = + _.GetBitWidth(result_type) * _.GetDimension(result_type); + const uint32_t input_size = + _.GetBitWidth(input_type) * _.GetDimension(input_type); + if (result_size != input_size) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected input to have the same total bit width as " + << "Result Type: " << spvOpcodeString(opcode); + } + break; + } + + default: + break; + } + + return SPV_SUCCESS; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,419 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "validate.h" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "binary.h" +#include "diagnostic.h" +#include "enum_string_mapping.h" +#include "extensions.h" +#include "instruction.h" +#include "opcode.h" +#include "operand.h" +#include "spirv-tools/libspirv.h" +#include "spirv_constant.h" +#include "spirv_endian.h" +#include "spirv_validator_options.h" +#include "val/construct.h" +#include "val/function.h" +#include "val/validation_state.h" + +using std::function; +using std::ostream_iterator; +using std::string; +using std::stringstream; +using std::transform; +using std::vector; +using std::placeholders::_1; + +using libspirv::CfgPass; +using libspirv::DataRulesPass; +using libspirv::Extension; +using libspirv::IdPass; +using libspirv::InstructionPass; +using libspirv::LiteralsPass; +using libspirv::ModuleLayoutPass; +using libspirv::ValidationState_t; + +spv_result_t spvValidateIDs(const spv_instruction_t* pInsts, + const uint64_t count, + const ValidationState_t& state, + spv_position position) { + position->index = SPV_INDEX_INSTRUCTION; + if (auto error = spvValidateInstructionIDs(pInsts, count, state, position)) + return error; + return SPV_SUCCESS; +} + +namespace { + +// TODO(umar): Validate header +// TODO(umar): The binary parser validates the magic word, and the length of the +// header, but nothing else. +spv_result_t setHeader(void* user_data, spv_endianness_t endian, uint32_t magic, + uint32_t version, uint32_t generator, uint32_t id_bound, + uint32_t reserved) { + // Record the ID bound so that the validator can ensure no ID is out of bound. + ValidationState_t& _ = *(reinterpret_cast(user_data)); + _.setIdBound(id_bound); + + (void)endian; + (void)magic; + (void)version; + (void)generator; + (void)id_bound; + (void)reserved; + return SPV_SUCCESS; +} + +// Improves diagnostic messages by collecting names of IDs +// NOTE: This function returns void and is not involved in validation +void DebugInstructionPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + switch (inst->opcode) { + case SpvOpName: { + const uint32_t target = *(inst->words + inst->operands[0].offset); + const char* str = + reinterpret_cast(inst->words + inst->operands[1].offset); + _.AssignNameToId(target, str); + } break; + case SpvOpMemberName: { + const uint32_t target = *(inst->words + inst->operands[0].offset); + const char* str = + reinterpret_cast(inst->words + inst->operands[2].offset); + _.AssignNameToId(target, str); + } break; + case SpvOpSourceContinued: + case SpvOpSource: + case SpvOpSourceExtension: + case SpvOpString: + case SpvOpLine: + case SpvOpNoLine: + + default: + break; + } +} + +// Parses OpExtension instruction and registers extension. +void RegisterExtension(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const std::string extension_str = libspirv::GetExtensionString(inst); + Extension extension; + if (!GetExtensionFromString(extension_str.c_str(), &extension)) { + // The error will be logged in the ProcessInstruction pass. + return; + } + + _.RegisterExtension(extension); +} + +// Parses the beginning of the module searching for OpExtension instructions. +// Registers extensions if recognized. Returns SPV_REQUESTED_TERMINATION +// once an instruction which is not SpvOpCapability and SpvOpExtension is +// encountered. According to the SPIR-V spec extensions are declared after +// capabilities and before everything else. +spv_result_t ProcessExtensions(void* user_data, + const spv_parsed_instruction_t* inst) { + const SpvOp opcode = static_cast(inst->opcode); + if (opcode == SpvOpCapability) return SPV_SUCCESS; + + if (opcode == SpvOpExtension) { + ValidationState_t& _ = *(reinterpret_cast(user_data)); + RegisterExtension(_, inst); + return SPV_SUCCESS; + } + + // OpExtension block is finished, requesting termination. + return SPV_REQUESTED_TERMINATION; +} + +spv_result_t ProcessInstruction(void* user_data, + const spv_parsed_instruction_t* inst) { + ValidationState_t& _ = *(reinterpret_cast(user_data)); + _.increment_instruction_count(); + if (static_cast(inst->opcode) == SpvOpEntryPoint) { + const auto entry_point = inst->words[2]; + const SpvExecutionModel execution_model = SpvExecutionModel(inst->words[1]); + _.RegisterEntryPointId(entry_point, execution_model); + // Operand 3 and later are the of interfaces for the entry point. + for (int i = 3; i < inst->num_operands; ++i) { + _.RegisterInterfaceForEntryPoint(entry_point, + inst->words[inst->operands[i].offset]); + } + } + if (static_cast(inst->opcode) == SpvOpFunctionCall) { + _.AddFunctionCallTarget(inst->words[3]); + } + + DebugInstructionPass(_, inst); + if (auto error = CapabilityPass(_, inst)) return error; + if (auto error = DataRulesPass(_, inst)) return error; + if (auto error = IdPass(_, inst)) return error; + if (auto error = ModuleLayoutPass(_, inst)) return error; + if (auto error = CfgPass(_, inst)) return error; + if (auto error = InstructionPass(_, inst)) return error; + if (auto error = TypeUniquePass(_, inst)) return error; + if (auto error = ArithmeticsPass(_, inst)) return error; + if (auto error = CompositesPass(_, inst)) return error; + if (auto error = ConversionPass(_, inst)) return error; + if (auto error = DerivativesPass(_, inst)) return error; + if (auto error = LogicalsPass(_, inst)) return error; + if (auto error = BitwisePass(_, inst)) return error; + if (auto error = ExtInstPass(_, inst)) return error; + if (auto error = ImagePass(_, inst)) return error; + if (auto error = AtomicsPass(_, inst)) return error; + if (auto error = BarriersPass(_, inst)) return error; + if (auto error = PrimitivesPass(_, inst)) return error; + if (auto error = LiteralsPass(_, inst)) return error; + + return SPV_SUCCESS; +} + +void printDot(const ValidationState_t& _, const libspirv::BasicBlock& other) { + string block_string; + if (other.successors()->empty()) { + block_string += "end "; + } else { + for (auto block : *other.successors()) { + block_string += _.getIdOrName(block->id()) + " "; + } + } + printf("%10s -> {%s\b}\n", _.getIdOrName(other.id()).c_str(), + block_string.c_str()); +} + +void PrintBlocks(ValidationState_t& _, libspirv::Function func) { + assert(func.first_block()); + + printf("%10s -> %s\n", _.getIdOrName(func.id()).c_str(), + _.getIdOrName(func.first_block()->id()).c_str()); + for (const auto& block : func.ordered_blocks()) { + printDot(_, *block); + } +} + +#ifdef __clang__ +#define UNUSED(func) [[gnu::unused]] func +#elif defined(__GNUC__) +#define UNUSED(func) \ + func __attribute__((unused)); \ + func +#elif defined(_MSC_VER) +#define UNUSED(func) func +#endif + +UNUSED(void PrintDotGraph(ValidationState_t& _, libspirv::Function func)) { + if (func.first_block()) { + string func_name(_.getIdOrName(func.id())); + printf("digraph %s {\n", func_name.c_str()); + PrintBlocks(_, func); + printf("}\n"); + } +} + +spv_result_t ValidateBinaryUsingContextAndValidationState( + const spv_context_t& context, const uint32_t* words, const size_t num_words, + spv_diagnostic* pDiagnostic, ValidationState_t* vstate) { + auto binary = std::unique_ptr( + new spv_const_binary_t{words, num_words}); + + spv_endianness_t endian; + spv_position_t position = {}; + if (spvBinaryEndianness(binary.get(), &endian)) { + return libspirv::DiagnosticStream(position, context.consumer, + SPV_ERROR_INVALID_BINARY) + << "Invalid SPIR-V magic number."; + } + + spv_header_t header; + if (spvBinaryHeaderGet(binary.get(), endian, &header)) { + return libspirv::DiagnosticStream(position, context.consumer, + SPV_ERROR_INVALID_BINARY) + << "Invalid SPIR-V header."; + } + + // Look for OpExtension instructions and register extensions. + // Diagnostics if any will be produced in the next pass (ProcessInstruction). + spvBinaryParse(&context, vstate, words, num_words, + /* parsed_header = */ nullptr, ProcessExtensions, + /* diagnostic = */ nullptr); + + // NOTE: Parse the module and perform inline validation checks. These + // checks do not require the the knowledge of the whole module. + if (auto error = spvBinaryParse(&context, vstate, words, num_words, setHeader, + ProcessInstruction, pDiagnostic)) + return error; + + if (vstate->in_function_body()) + return vstate->diag(SPV_ERROR_INVALID_LAYOUT) + << "Missing OpFunctionEnd at end of module."; + + // TODO(umar): Add validation checks which require the parsing of the entire + // module. Use the information from the ProcessInstruction pass to make the + // checks. + if (vstate->unresolved_forward_id_count() > 0) { + stringstream ss; + vector ids = vstate->UnresolvedForwardIds(); + + transform(begin(ids), end(ids), ostream_iterator(ss, " "), + bind(&ValidationState_t::getIdName, std::ref(*vstate), _1)); + + auto id_str = ss.str(); + return vstate->diag(SPV_ERROR_INVALID_ID) + << "The following forward referenced IDs have not been defined:\n" + << id_str.substr(0, id_str.size() - 1); + } + + // Validate the preconditions involving adjacent instructions. e.g. SpvOpPhi + // must only be preceeded by SpvOpLabel, SpvOpPhi, or SpvOpLine. + if (auto error = ValidateAdjacency(*vstate)) return error; + + // CFG checks are performed after the binary has been parsed + // and the CFGPass has collected information about the control flow + if (auto error = PerformCfgChecks(*vstate)) return error; + if (auto error = UpdateIdUse(*vstate)) return error; + if (auto error = CheckIdDefinitionDominateUse(*vstate)) return error; + if (auto error = ValidateDecorations(*vstate)) return error; + + // Entry point validation. Based on 2.16.1 (Universal Validation Rules) of the + // SPIRV spec: + // * There is at least one OpEntryPoint instruction, unless the Linkage + // capability is being used. + // * No function can be targeted by both an OpEntryPoint instruction and an + // OpFunctionCall instruction. + if (vstate->entry_points().empty() && + !vstate->HasCapability(SpvCapabilityLinkage)) { + return vstate->diag(SPV_ERROR_INVALID_BINARY) + << "No OpEntryPoint instruction was found. This is only allowed if " + "the Linkage capability is being used."; + } + for (const auto& entry_point : vstate->entry_points()) { + if (vstate->IsFunctionCallTarget(entry_point)) { + return vstate->diag(SPV_ERROR_INVALID_BINARY) + << "A function (" << entry_point + << ") may not be targeted by both an OpEntryPoint instruction and " + "an OpFunctionCall instruction."; + } + } + + // NOTE: Copy each instruction for easier processing + std::vector instructions; + // Expect average instruction length to be a bit over 2 words. + instructions.reserve(binary->wordCount / 2); + uint64_t index = SPV_INDEX_INSTRUCTION; + while (index < binary->wordCount) { + uint16_t wordCount; + uint16_t opcode; + spvOpcodeSplit(spvFixWord(binary->code[index], endian), &wordCount, + &opcode); + spv_instruction_t inst; + spvInstructionCopy(&binary->code[index], static_cast(opcode), + wordCount, endian, &inst); + instructions.emplace_back(std::move(inst)); + index += wordCount; + } + + position.index = SPV_INDEX_INSTRUCTION; + if (auto error = spvValidateIDs(instructions.data(), instructions.size(), + *vstate, &position)) + return error; + + if (auto error = ValidateBuiltIns(*vstate)) return error; + + return SPV_SUCCESS; +} +} // anonymous namespace + +spv_result_t spvValidate(const spv_const_context context, + const spv_const_binary binary, + spv_diagnostic* pDiagnostic) { + return spvValidateBinary(context, binary->code, binary->wordCount, + pDiagnostic); +} + +spv_result_t spvValidateBinary(const spv_const_context context, + const uint32_t* words, const size_t num_words, + spv_diagnostic* pDiagnostic) { + spv_context_t hijack_context = *context; + if (pDiagnostic) { + *pDiagnostic = nullptr; + libspirv::UseDiagnosticAsMessageConsumer(&hijack_context, pDiagnostic); + } + + // This interface is used for default command line options. + spv_validator_options default_options = spvValidatorOptionsCreate(); + + // Create the ValidationState using the context and default options. + ValidationState_t vstate(&hijack_context, default_options); + + spv_result_t result = ValidateBinaryUsingContextAndValidationState( + hijack_context, words, num_words, pDiagnostic, &vstate); + + spvValidatorOptionsDestroy(default_options); + return result; +} + +spv_result_t spvValidateWithOptions(const spv_const_context context, + spv_const_validator_options options, + const spv_const_binary binary, + spv_diagnostic* pDiagnostic) { + spv_context_t hijack_context = *context; + if (pDiagnostic) { + *pDiagnostic = nullptr; + libspirv::UseDiagnosticAsMessageConsumer(&hijack_context, pDiagnostic); + } + + // Create the ValidationState using the context. + ValidationState_t vstate(&hijack_context, options); + + return ValidateBinaryUsingContextAndValidationState( + hijack_context, binary->code, binary->wordCount, pDiagnostic, &vstate); +} + +namespace spvtools { + +spv_result_t ValidateBinaryAndKeepValidationState( + const spv_const_context context, spv_const_validator_options options, + const uint32_t* words, const size_t num_words, spv_diagnostic* pDiagnostic, + std::unique_ptr* vstate) { + spv_context_t hijack_context = *context; + if (pDiagnostic) { + *pDiagnostic = nullptr; + libspirv::UseDiagnosticAsMessageConsumer(&hijack_context, pDiagnostic); + } + + vstate->reset(new ValidationState_t(&hijack_context, options)); + + return ValidateBinaryUsingContextAndValidationState( + hijack_context, words, num_words, pDiagnostic, vstate->get()); +} + +spv_result_t ValidateInstructionAndUpdateValidationState( + ValidationState_t* vstate, const spv_parsed_instruction_t* inst) { + return ProcessInstruction(vstate, inst); +} + +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_datarules.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_datarules.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_datarules.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_datarules.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,273 @@ +// Copyright (c) 2016 Google 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. + +// Ensures Data Rules are followed according to the specifications. + +#include "validate.h" + +#include +#include +#include + +#include "diagnostic.h" +#include "opcode.h" +#include "operand.h" +#include "val/instruction.h" +#include "val/validation_state.h" + +using libspirv::CapabilitySet; +using libspirv::DiagnosticStream; +using libspirv::ValidationState_t; + +namespace { + +// Validates that the number of components in the vector is valid. +// Vector types can only be parameterized as having 2, 3, or 4 components. +// If the Vector16 capability is added, 8 and 16 components are also allowed. +spv_result_t ValidateVecNumComponents(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + // Operand 2 specifies the number of components in the vector. + const uint32_t num_components = inst->words[inst->operands[2].offset]; + if (num_components == 2 || num_components == 3 || num_components == 4) { + return SPV_SUCCESS; + } + if (num_components == 8 || num_components == 16) { + if (_.HasCapability(SpvCapabilityVector16)) { + return SPV_SUCCESS; + } + return _.diag(SPV_ERROR_INVALID_DATA) + << "Having " << num_components << " components for " + << spvOpcodeString(static_cast(inst->opcode)) + << " requires the Vector16 capability"; + } + return _.diag(SPV_ERROR_INVALID_DATA) + << "Illegal number of components (" << num_components << ") for " + << spvOpcodeString(static_cast(inst->opcode)); +} + +// Validates that the number of bits specifed for a float type is valid. +// Scalar floating-point types can be parameterized only with 32-bits. +// Float16 capability allows using a 16-bit OpTypeFloat. +// Float16Buffer capability allows creation of a 16-bit OpTypeFloat. +// Float64 capability allows using a 64-bit OpTypeFloat. +spv_result_t ValidateFloatSize(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + // Operand 1 is the number of bits for this float + const uint32_t num_bits = inst->words[inst->operands[1].offset]; + if (num_bits == 32) { + return SPV_SUCCESS; + } + if (num_bits == 16) { + if (_.features().declare_float16_type) { + return SPV_SUCCESS; + } + return _.diag(SPV_ERROR_INVALID_DATA) + << "Using a 16-bit floating point " + << "type requires the Float16 or Float16Buffer capability," + " or an extension that explicitly enables 16-bit floating point."; + } + if (num_bits == 64) { + if (_.HasCapability(SpvCapabilityFloat64)) { + return SPV_SUCCESS; + } + return _.diag(SPV_ERROR_INVALID_DATA) + << "Using a 64-bit floating point " + << "type requires the Float64 capability."; + } + return _.diag(SPV_ERROR_INVALID_DATA) + << "Invalid number of bits (" << num_bits << ") used for OpTypeFloat."; +} + +// Validates that the number of bits specified for an Int type is valid. +// Scalar integer types can be parameterized only with 32-bits. +// Int8, Int16, and Int64 capabilities allow using 8-bit, 16-bit, and 64-bit +// integers, respectively. +spv_result_t ValidateIntSize(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + // Operand 1 is the number of bits for this integer. + const uint32_t num_bits = inst->words[inst->operands[1].offset]; + if (num_bits == 32) { + return SPV_SUCCESS; + } + if (num_bits == 8) { + if (_.HasCapability(SpvCapabilityInt8)) { + return SPV_SUCCESS; + } + return _.diag(SPV_ERROR_INVALID_DATA) + << "Using an 8-bit integer type requires the Int8 capability."; + } + if (num_bits == 16) { + if (_.features().declare_int16_type) { + return SPV_SUCCESS; + } + return _.diag(SPV_ERROR_INVALID_DATA) + << "Using a 16-bit integer type requires the Int16 capability," + " or an extension that explicitly enables 16-bit integers."; + } + if (num_bits == 64) { + if (_.HasCapability(SpvCapabilityInt64)) { + return SPV_SUCCESS; + } + return _.diag(SPV_ERROR_INVALID_DATA) + << "Using a 64-bit integer type requires the Int64 capability."; + } + return _.diag(SPV_ERROR_INVALID_DATA) + << "Invalid number of bits (" << num_bits << ") used for OpTypeInt."; +} + +// Validates that the matrix is parameterized with floating-point types. +spv_result_t ValidateMatrixColumnType(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + // Find the component type of matrix columns (must be vector). + // Operand 1 is the of the type specified for matrix columns. + auto type_id = inst->words[inst->operands[1].offset]; + auto col_type_instr = _.FindDef(type_id); + if (col_type_instr->opcode() != SpvOpTypeVector) { + return _.diag(SPV_ERROR_INVALID_ID) + << "Columns in a matrix must be of type vector."; + } + + // Trace back once more to find out the type of components in the vector. + // Operand 1 is the of the type of data in the vector. + auto comp_type_id = + col_type_instr->words()[col_type_instr->operands()[1].offset]; + auto comp_type_instruction = _.FindDef(comp_type_id); + if (comp_type_instruction->opcode() != SpvOpTypeFloat) { + return _.diag(SPV_ERROR_INVALID_DATA) << "Matrix types can only be " + "parameterized with " + "floating-point types."; + } + return SPV_SUCCESS; +} + +// Validates that the matrix has 2,3, or 4 columns. +spv_result_t ValidateMatrixNumCols(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + // Operand 2 is the number of columns in the matrix. + const uint32_t num_cols = inst->words[inst->operands[2].offset]; + if (num_cols != 2 && num_cols != 3 && num_cols != 4) { + return _.diag(SPV_ERROR_INVALID_DATA) << "Matrix types can only be " + "parameterized as having only 2, " + "3, or 4 columns."; + } + return SPV_SUCCESS; +} + +// Validates that OpSpecConstant specializes to either int or float type. +spv_result_t ValidateSpecConstNumerical(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + // Operand 0 is the of the type that we're specializing to. + auto type_id = inst->words[inst->operands[0].offset]; + auto type_instruction = _.FindDef(type_id); + auto type_opcode = type_instruction->opcode(); + if (type_opcode != SpvOpTypeInt && type_opcode != SpvOpTypeFloat) { + return _.diag(SPV_ERROR_INVALID_DATA) << "Specialization constant must be " + "an integer or floating-point " + "number."; + } + return SPV_SUCCESS; +} + +// Validates that OpSpecConstantTrue and OpSpecConstantFalse specialize to bool. +spv_result_t ValidateSpecConstBoolean(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + // Find out the type that we're specializing to. + auto type_instruction = _.FindDef(inst->type_id); + if (type_instruction->opcode() != SpvOpTypeBool) { + return _.diag(SPV_ERROR_INVALID_ID) << "Specialization constant must be " + "a boolean type."; + } + return SPV_SUCCESS; +} + +// Records the of the forward pointer to be used for validation. +spv_result_t ValidateForwardPointer(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + // Record the (which is operand 0) to ensure it's used properly. + // OpTypeStruct can only include undefined pointers that are + // previously declared as a ForwardPointer + return (_.RegisterForwardPointer(inst->words[inst->operands[0].offset])); +} + +// Validates that any undefined component of the struct is a forward pointer. +// It is valid to declare a forward pointer, and use its as one of the +// components of a struct. +spv_result_t ValidateStruct(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + // Struct components are operands 1, 2, etc. + for (unsigned i = 1; i < inst->num_operands; i++) { + auto type_id = inst->words[inst->operands[i].offset]; + auto type_instruction = _.FindDef(type_id); + if (type_instruction == nullptr && !_.IsForwardPointer(type_id)) { + return _.diag(SPV_ERROR_INVALID_ID) + << "Forward reference operands in an OpTypeStruct must first be " + "declared using OpTypeForwardPointer."; + } + } + return SPV_SUCCESS; +} + +} // anonymous namespace + +namespace libspirv { + +// Validates that Data Rules are followed according to the specifications. +// (Data Rules subsection of 2.16.1 Universal Validation Rules) +spv_result_t DataRulesPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + switch (inst->opcode) { + case SpvOpTypeVector: { + if (auto error = ValidateVecNumComponents(_, inst)) return error; + break; + } + case SpvOpTypeFloat: { + if (auto error = ValidateFloatSize(_, inst)) return error; + break; + } + case SpvOpTypeInt: { + if (auto error = ValidateIntSize(_, inst)) return error; + break; + } + case SpvOpTypeMatrix: { + if (auto error = ValidateMatrixColumnType(_, inst)) return error; + if (auto error = ValidateMatrixNumCols(_, inst)) return error; + break; + } + // TODO(ehsan): Add OpSpecConstantComposite validation code. + // TODO(ehsan): Add OpSpecConstantOp validation code (if any). + case SpvOpSpecConstant: { + if (auto error = ValidateSpecConstNumerical(_, inst)) return error; + break; + } + case SpvOpSpecConstantFalse: + case SpvOpSpecConstantTrue: { + if (auto error = ValidateSpecConstBoolean(_, inst)) return error; + break; + } + case SpvOpTypeForwardPointer: { + if (auto error = ValidateForwardPointer(_, inst)) return error; + break; + } + case SpvOpTypeStruct: { + if (auto error = ValidateStruct(_, inst)) return error; + break; + } + // TODO(ehsan): add more data rules validation here. + default: { break; } + } + + return SPV_SUCCESS; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_decorations.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_decorations.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_decorations.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_decorations.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,195 @@ +// Copyright (c) 2017 Google 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. + +#include "validate.h" + +#include +#include + +#include "diagnostic.h" +#include "opcode.h" +#include "spirv_target_env.h" +#include "val/validation_state.h" + +using libspirv::Decoration; +using libspirv::DiagnosticStream; +using libspirv::Instruction; +using libspirv::ValidationState_t; + +namespace { + +// Returns whether the given variable has a BuiltIn decoration. +bool isBuiltInVar(uint32_t var_id, ValidationState_t& vstate) { + const auto& decorations = vstate.id_decorations(var_id); + return std::any_of( + decorations.begin(), decorations.end(), + [](const Decoration& d) { return SpvDecorationBuiltIn == d.dec_type(); }); +} + +// Returns whether the given structure type has any members with BuiltIn +// decoration. +bool isBuiltInStruct(uint32_t struct_id, ValidationState_t& vstate) { + const auto& decorations = vstate.id_decorations(struct_id); + return std::any_of( + decorations.begin(), decorations.end(), [](const Decoration& d) { + return SpvDecorationBuiltIn == d.dec_type() && + Decoration::kInvalidMember != d.struct_member_index(); + }); +} + +// Returns true if the given ID has the Import LinkageAttributes decoration. +bool hasImportLinkageAttribute(uint32_t id, ValidationState_t& vstate) { + const auto& decorations = vstate.id_decorations(id); + return std::any_of(decorations.begin(), decorations.end(), + [](const Decoration& d) { + return SpvDecorationLinkageAttributes == d.dec_type() && + d.params().size() >= 2u && + d.params().back() == SpvLinkageTypeImport; + }); +} + +spv_result_t CheckLinkageAttrOfFunctions(ValidationState_t& vstate) { + for (const auto& function : vstate.functions()) { + if (function.block_count() == 0u) { + // A function declaration (an OpFunction with no basic blocks), must have + // a Linkage Attributes Decoration with the Import Linkage Type. + if (!hasImportLinkageAttribute(function.id(), vstate)) { + return vstate.diag(SPV_ERROR_INVALID_BINARY) + << "Function declaration (id " << function.id() + << ") must have a LinkageAttributes decoration with the Import " + "Linkage type."; + } + } else { + if (hasImportLinkageAttribute(function.id(), vstate)) { + return vstate.diag(SPV_ERROR_INVALID_BINARY) + << "Function definition (id " << function.id() + << ") may not be decorated with Import Linkage type."; + } + } + } + return SPV_SUCCESS; +} + +// Checks whether an imported variable is initialized by this module. +spv_result_t CheckImportedVariableInitialization(ValidationState_t& vstate) { + // According the SPIR-V Spec 2.16.1, it is illegal to initialize an imported + // variable. This means that a module-scope OpVariable with initialization + // value cannot be marked with the Import Linkage Type (import type id = 1). + for (auto global_var_id : vstate.global_vars()) { + // Initializer is an optional argument for OpVariable. If initializer + // is present, the instruction will have 5 words. + auto variable_instr = vstate.FindDef(global_var_id); + if (variable_instr->words().size() == 5u && + hasImportLinkageAttribute(global_var_id, vstate)) { + return vstate.diag(SPV_ERROR_INVALID_ID) + << "A module-scope OpVariable with initialization value " + "cannot be marked with the Import Linkage Type."; + } + } + return SPV_SUCCESS; +} + +// Checks whether a builtin variable is valid. +spv_result_t CheckBuiltInVariable(uint32_t var_id, ValidationState_t& vstate) { + const auto& decorations = vstate.id_decorations(var_id); + for (const auto& d : decorations) { + if (spvIsVulkanEnv(vstate.context()->target_env)) { + if (d.dec_type() == SpvDecorationLocation || + d.dec_type() == SpvDecorationComponent) { + return vstate.diag(SPV_ERROR_INVALID_ID) + << "A BuiltIn variable (id " << var_id + << ") cannot have any Location or Component decorations"; + } + } + } + return SPV_SUCCESS; +} + +// Checks whether proper decorations have been appied to the entry points. +spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) { + for (uint32_t entry_point : vstate.entry_points()) { + const auto& interfaces = vstate.entry_point_interfaces(entry_point); + int num_builtin_inputs = 0; + int num_builtin_outputs = 0; + for (auto interface : interfaces) { + Instruction* var_instr = vstate.FindDef(interface); + if (SpvOpVariable != var_instr->opcode()) { + return vstate.diag(SPV_ERROR_INVALID_ID) + << "Interfaces passed to OpEntryPoint must be of type " + "OpTypeVariable. Found Op" + << spvOpcodeString(static_cast(var_instr->opcode())) + << "."; + } + const uint32_t ptr_id = var_instr->word(1); + Instruction* ptr_instr = vstate.FindDef(ptr_id); + // It is guaranteed (by validator ID checks) that ptr_instr is + // OpTypePointer. Word 3 of this instruction is the type being pointed to. + const uint32_t type_id = ptr_instr->word(3); + Instruction* type_instr = vstate.FindDef(type_id); + const auto storage_class = + static_cast(var_instr->word(3)); + if (storage_class != SpvStorageClassInput && + storage_class != SpvStorageClassOutput) { + return vstate.diag(SPV_ERROR_INVALID_ID) + << "OpEntryPoint interfaces must be OpVariables with " + "Storage Class of Input(1) or Output(3). Found Storage Class " + << storage_class << " for Entry Point id " << entry_point << "."; + } + if (type_instr && SpvOpTypeStruct == type_instr->opcode() && + isBuiltInStruct(type_id, vstate)) { + if (storage_class == SpvStorageClassInput) ++num_builtin_inputs; + if (storage_class == SpvStorageClassOutput) ++num_builtin_outputs; + if (num_builtin_inputs > 1 || num_builtin_outputs > 1) break; + if (auto error = CheckBuiltInVariable(interface, vstate)) return error; + } else if (isBuiltInVar(interface, vstate)) { + if (auto error = CheckBuiltInVariable(interface, vstate)) return error; + } + } + if (num_builtin_inputs > 1 || num_builtin_outputs > 1) { + return vstate.diag(SPV_ERROR_INVALID_BINARY) + << "There must be at most one object per Storage Class that can " + "contain a structure type containing members decorated with " + "BuiltIn, consumed per entry-point. Entry Point id " + << entry_point << " does not meet this requirement."; + } + // The LinkageAttributes Decoration cannot be applied to functions targeted + // by an OpEntryPoint instruction + for (auto& decoration : vstate.id_decorations(entry_point)) { + if (SpvDecorationLinkageAttributes == decoration.dec_type()) { + const char* linkage_name = + reinterpret_cast(&decoration.params()[0]); + return vstate.diag(SPV_ERROR_INVALID_BINARY) + << "The LinkageAttributes Decoration (Linkage name: " + << linkage_name << ") cannot be applied to function id " + << entry_point + << " because it is targeted by an OpEntryPoint instruction."; + } + } + } + return SPV_SUCCESS; +} + +} // anonymous namespace + +namespace libspirv { + +// Validates that decorations have been applied properly. +spv_result_t ValidateDecorations(ValidationState_t& vstate) { + if (auto error = CheckImportedVariableInitialization(vstate)) return error; + if (auto error = CheckDecorationsOfEntryPoints(vstate)) return error; + if (auto error = CheckLinkageAttrOfFunctions(vstate)) return error; + return SPV_SUCCESS; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_derivatives.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_derivatives.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_derivatives.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_derivatives.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2017 Google 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. + +// Validates correctness of derivative SPIR-V instructions. + +#include "validate.h" + +#include "diagnostic.h" +#include "opcode.h" +#include "val/instruction.h" +#include "val/validation_state.h" + +namespace libspirv { + +// Validates correctness of derivative instructions. +spv_result_t DerivativesPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const SpvOp opcode = static_cast(inst->opcode); + const uint32_t result_type = inst->type_id; + + switch (opcode) { + case SpvOpDPdx: + case SpvOpDPdy: + case SpvOpFwidth: + case SpvOpDPdxFine: + case SpvOpDPdyFine: + case SpvOpFwidthFine: + case SpvOpDPdxCoarse: + case SpvOpDPdyCoarse: + case SpvOpFwidthCoarse: { + if (!_.IsFloatScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type to be float scalar or vector type: " + << spvOpcodeString(opcode); + } + + const uint32_t p_type = _.GetOperandTypeId(inst, 2); + if (p_type != result_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected P type and Result Type to be the same: " + << spvOpcodeString(opcode); + } + + _.current_function().RegisterExecutionModelLimitation( + SpvExecutionModelFragment, std::string( + "Derivative instructions require Fragment execution model: ") + + spvOpcodeString(opcode)); + break; + } + + default: + break; + } + + return SPV_SUCCESS; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_ext_inst.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_ext_inst.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_ext_inst.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_ext_inst.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1976 @@ +// Copyright (c) 2017 Google 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. + +// Validates correctness of ExtInst SPIR-V instructions. + +#include "validate.h" + +#include + +#include "latest_version_glsl_std_450_header.h" +#include "latest_version_opencl_std_header.h" + +#include "diagnostic.h" +#include "opcode.h" +#include "val/instruction.h" +#include "val/validation_state.h" + +namespace libspirv { + +namespace { + +uint32_t GetSizeTBitWidth(const ValidationState_t& _) { + if (_.addressing_model() == SpvAddressingModelPhysical32) return 32; + + if (_.addressing_model() == SpvAddressingModelPhysical64) return 64; + + return 0; +} + +} // anonymous namespace + +// Validates correctness of ExtInst instructions. +spv_result_t ExtInstPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const SpvOp opcode = static_cast(inst->opcode); + const uint32_t result_type = inst->type_id; + const uint32_t num_operands = inst->num_operands; + + if (opcode != SpvOpExtInst) return SPV_SUCCESS; + + const uint32_t ext_inst_set = inst->words[3]; + const uint32_t ext_inst_index = inst->words[4]; + const spv_ext_inst_type_t ext_inst_type = + spv_ext_inst_type_t(inst->ext_inst_type); + + auto ext_inst_name = [&_, ext_inst_set, ext_inst_type, ext_inst_index]() { + spv_ext_inst_desc desc = nullptr; + if (_.grammar().lookupExtInst(ext_inst_type, ext_inst_index, &desc) != + SPV_SUCCESS || + !desc) { + return std::string("Unknown ExtInst"); + } + + auto* import_inst = _.FindDef(ext_inst_set); + assert(import_inst); + + std::ostringstream ss; + ss << reinterpret_cast(import_inst->words().data() + 2); + ss << " "; + ss << desc->name; + + return ss.str(); + }; + + if (ext_inst_type == SPV_EXT_INST_TYPE_GLSL_STD_450) { + const GLSLstd450 ext_inst_key = GLSLstd450(ext_inst_index); + switch (ext_inst_key) { + case GLSLstd450Round: + case GLSLstd450RoundEven: + case GLSLstd450FAbs: + case GLSLstd450Trunc: + case GLSLstd450FSign: + case GLSLstd450Floor: + case GLSLstd450Ceil: + case GLSLstd450Fract: + case GLSLstd450Sqrt: + case GLSLstd450InverseSqrt: + case GLSLstd450FMin: + case GLSLstd450FMax: + case GLSLstd450FClamp: + case GLSLstd450FMix: + case GLSLstd450Step: + case GLSLstd450SmoothStep: + case GLSLstd450Fma: + case GLSLstd450Normalize: + case GLSLstd450FaceForward: + case GLSLstd450Reflect: + case GLSLstd450NMin: + case GLSLstd450NMax: + case GLSLstd450NClamp: { + if (!_.IsFloatScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a float scalar or vector type"; + } + + for (uint32_t operand_index = 4; operand_index < num_operands; + ++operand_index) { + const uint32_t operand_type = _.GetOperandTypeId(inst, operand_index); + if (result_type != operand_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected types of all operands to be equal to Result " + "Type"; + } + } + break; + } + + case GLSLstd450SAbs: + case GLSLstd450SSign: + case GLSLstd450UMin: + case GLSLstd450SMin: + case GLSLstd450UMax: + case GLSLstd450SMax: + case GLSLstd450UClamp: + case GLSLstd450SClamp: + case GLSLstd450FindILsb: + case GLSLstd450FindUMsb: + case GLSLstd450FindSMsb: { + if (!_.IsIntScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be an int scalar or vector type"; + } + + const uint32_t result_type_bit_width = _.GetBitWidth(result_type); + const uint32_t result_type_dimension = _.GetDimension(result_type); + + for (uint32_t operand_index = 4; operand_index < num_operands; + ++operand_index) { + const uint32_t operand_type = _.GetOperandTypeId(inst, operand_index); + if (!_.IsIntScalarOrVectorType(operand_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected all operands to be int scalars or vectors"; + } + + if (result_type_dimension != _.GetDimension(operand_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected all operands to have the same dimension as " + << "Result Type"; + } + + if (result_type_bit_width != _.GetBitWidth(operand_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected all operands to have the same bit width as " + << "Result Type"; + } + + if (ext_inst_key == GLSLstd450FindUMsb || + ext_inst_key == GLSLstd450FindSMsb) { + if (result_type_bit_width != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "this instruction is currently limited to 32-bit width " + << "components"; + } + } + } + break; + } + + case GLSLstd450Radians: + case GLSLstd450Degrees: + case GLSLstd450Sin: + case GLSLstd450Cos: + case GLSLstd450Tan: + case GLSLstd450Asin: + case GLSLstd450Acos: + case GLSLstd450Atan: + case GLSLstd450Sinh: + case GLSLstd450Cosh: + case GLSLstd450Tanh: + case GLSLstd450Asinh: + case GLSLstd450Acosh: + case GLSLstd450Atanh: + case GLSLstd450Exp: + case GLSLstd450Exp2: + case GLSLstd450Log: + case GLSLstd450Log2: + case GLSLstd450Atan2: + case GLSLstd450Pow: { + if (!_.IsFloatScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a 16 or 32-bit scalar or " + "vector float type"; + } + + const uint32_t result_type_bit_width = _.GetBitWidth(result_type); + if (result_type_bit_width != 16 && result_type_bit_width != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a 16 or 32-bit scalar or " + "vector float type"; + } + + for (uint32_t operand_index = 4; operand_index < num_operands; + ++operand_index) { + const uint32_t operand_type = _.GetOperandTypeId(inst, operand_index); + if (result_type != operand_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected types of all operands to be equal to Result " + "Type"; + } + } + break; + } + + case GLSLstd450Determinant: { + const uint32_t x_type = _.GetOperandTypeId(inst, 4); + uint32_t num_rows = 0; + uint32_t num_cols = 0; + uint32_t col_type = 0; + uint32_t component_type = 0; + if (!_.GetMatrixTypeInfo(x_type, &num_rows, &num_cols, &col_type, + &component_type) || + num_rows != num_cols) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand X to be a square matrix"; + } + + if (result_type != component_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand X component type to be equal to " + << "Result Type"; + } + break; + } + + case GLSLstd450MatrixInverse: { + uint32_t num_rows = 0; + uint32_t num_cols = 0; + uint32_t col_type = 0; + uint32_t component_type = 0; + if (!_.GetMatrixTypeInfo(result_type, &num_rows, &num_cols, &col_type, + &component_type) || + num_rows != num_cols) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a square matrix"; + } + + const uint32_t x_type = _.GetOperandTypeId(inst, 4); + if (result_type != x_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand X type to be equal to Result Type"; + } + break; + } + + case GLSLstd450Modf: { + if (!_.IsFloatScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a scalar or vector float type"; + } + + const uint32_t x_type = _.GetOperandTypeId(inst, 4); + const uint32_t i_type = _.GetOperandTypeId(inst, 5); + + if (x_type != result_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand X type to be equal to Result Type"; + } + + uint32_t i_storage_class = 0; + uint32_t i_data_type = 0; + if (!_.GetPointerTypeInfo(i_type, &i_data_type, &i_storage_class)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand I to be a pointer"; + } + + if (i_data_type != result_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand I data type to be equal to Result Type"; + } + + break; + } + + case GLSLstd450ModfStruct: { + std::vector result_types; + if (!_.GetStructMemberTypes(result_type, &result_types) || + result_types.size() != 2 || + !_.IsFloatScalarOrVectorType(result_types[0]) || + result_types[1] != result_types[0]) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a struct with two identical " + << "scalar or vector float type members"; + } + + const uint32_t x_type = _.GetOperandTypeId(inst, 4); + if (x_type != result_types[0]) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand X type to be equal to members of " + << "Result Type struct"; + } + break; + } + + case GLSLstd450Frexp: { + if (!_.IsFloatScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a scalar or vector float type"; + } + + const uint32_t x_type = _.GetOperandTypeId(inst, 4); + const uint32_t exp_type = _.GetOperandTypeId(inst, 5); + + if (x_type != result_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand X type to be equal to Result Type"; + } + + uint32_t exp_storage_class = 0; + uint32_t exp_data_type = 0; + if (!_.GetPointerTypeInfo(exp_type, &exp_data_type, + &exp_storage_class)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Exp to be a pointer"; + } + + if (!_.IsIntScalarOrVectorType(exp_data_type) || + _.GetBitWidth(exp_data_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Exp data type to be a 32-bit int scalar " + << "or vector type"; + } + + if (_.GetDimension(result_type) != _.GetDimension(exp_data_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Exp data type to have the same component " + << "number as Result Type"; + } + + break; + } + + case GLSLstd450Ldexp: { + if (!_.IsFloatScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a scalar or vector float type"; + } + + const uint32_t x_type = _.GetOperandTypeId(inst, 4); + const uint32_t exp_type = _.GetOperandTypeId(inst, 5); + + if (x_type != result_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand X type to be equal to Result Type"; + } + + if (!_.IsIntScalarOrVectorType(exp_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Exp to be a 32-bit int scalar " + << "or vector type"; + } + + if (_.GetDimension(result_type) != _.GetDimension(exp_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Exp to have the same component " + << "number as Result Type"; + } + + break; + } + + case GLSLstd450FrexpStruct: { + std::vector result_types; + if (!_.GetStructMemberTypes(result_type, &result_types) || + result_types.size() != 2 || + !_.IsFloatScalarOrVectorType(result_types[0]) || + !_.IsIntScalarOrVectorType(result_types[1]) || + _.GetBitWidth(result_types[1]) != 32 || + _.GetDimension(result_types[0]) != + _.GetDimension(result_types[1])) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a struct with two members, " + << "first member a float scalar or vector, second member " + << "a 32-bit int scalar or vector with the same number of " + << "components as the first member"; + } + + const uint32_t x_type = _.GetOperandTypeId(inst, 4); + if (x_type != result_types[0]) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand X type to be equal to the first member " + << "of Result Type struct"; + } + break; + } + + case GLSLstd450PackSnorm4x8: + case GLSLstd450PackUnorm4x8: { + if (!_.IsIntScalarType(result_type) || + _.GetBitWidth(result_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be 32-bit int scalar type"; + } + + const uint32_t v_type = _.GetOperandTypeId(inst, 4); + if (!_.IsFloatVectorType(v_type) || _.GetDimension(v_type) != 4 || + _.GetBitWidth(v_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand V to be a 32-bit float vector of size 4"; + } + break; + } + + case GLSLstd450PackSnorm2x16: + case GLSLstd450PackUnorm2x16: + case GLSLstd450PackHalf2x16: { + if (!_.IsIntScalarType(result_type) || + _.GetBitWidth(result_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be 32-bit int scalar type"; + } + + const uint32_t v_type = _.GetOperandTypeId(inst, 4); + if (!_.IsFloatVectorType(v_type) || _.GetDimension(v_type) != 2 || + _.GetBitWidth(v_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand V to be a 32-bit float vector of size 2"; + } + break; + } + + case GLSLstd450PackDouble2x32: { + if (!_.IsFloatScalarType(result_type) || + _.GetBitWidth(result_type) != 64) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be 64-bit float scalar type"; + } + + const uint32_t v_type = _.GetOperandTypeId(inst, 4); + if (!_.IsIntVectorType(v_type) || _.GetDimension(v_type) != 2 || + _.GetBitWidth(v_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand V to be a 32-bit int vector of size 2"; + } + break; + } + + case GLSLstd450UnpackSnorm4x8: + case GLSLstd450UnpackUnorm4x8: { + if (!_.IsFloatVectorType(result_type) || + _.GetDimension(result_type) != 4 || + _.GetBitWidth(result_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a 32-bit float vector of size " + "4"; + } + + const uint32_t v_type = _.GetOperandTypeId(inst, 4); + if (!_.IsIntScalarType(v_type) || _.GetBitWidth(v_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P to be a 32-bit int scalar"; + } + break; + } + + case GLSLstd450UnpackSnorm2x16: + case GLSLstd450UnpackUnorm2x16: + case GLSLstd450UnpackHalf2x16: { + if (!_.IsFloatVectorType(result_type) || + _.GetDimension(result_type) != 2 || + _.GetBitWidth(result_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a 32-bit float vector of size " + "2"; + } + + const uint32_t v_type = _.GetOperandTypeId(inst, 4); + if (!_.IsIntScalarType(v_type) || _.GetBitWidth(v_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P to be a 32-bit int scalar"; + } + break; + } + + case GLSLstd450UnpackDouble2x32: { + if (!_.IsIntVectorType(result_type) || + _.GetDimension(result_type) != 2 || + _.GetBitWidth(result_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a 32-bit int vector of size " + "2"; + } + + const uint32_t v_type = _.GetOperandTypeId(inst, 4); + if (!_.IsFloatScalarType(v_type) || _.GetBitWidth(v_type) != 64) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand V to be a 64-bit float scalar"; + } + break; + } + + case GLSLstd450Length: { + if (!_.IsFloatScalarType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a float scalar type"; + } + + const uint32_t x_type = _.GetOperandTypeId(inst, 4); + if (!_.IsFloatScalarOrVectorType(x_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand X to be of float scalar or vector type"; + } + + if (result_type != _.GetComponentType(x_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand X component type to be equal to Result " + "Type"; + } + break; + } + + case GLSLstd450Distance: { + if (!_.IsFloatScalarType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a float scalar type"; + } + + const uint32_t p0_type = _.GetOperandTypeId(inst, 4); + if (!_.IsFloatScalarOrVectorType(p0_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P0 to be of float scalar or vector type"; + } + + if (result_type != _.GetComponentType(p0_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P0 component type to be equal to " + << "Result Type"; + } + + const uint32_t p1_type = _.GetOperandTypeId(inst, 5); + if (!_.IsFloatScalarOrVectorType(p1_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P1 to be of float scalar or vector type"; + } + + if (result_type != _.GetComponentType(p1_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P1 component type to be equal to " + << "Result Type"; + } + + if (_.GetDimension(p0_type) != _.GetDimension(p1_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operands P0 and P1 to have the same number of " + << "components"; + } + break; + } + + case GLSLstd450Cross: { + if (!_.IsFloatVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a float vector type"; + } + + if (_.GetDimension(result_type) != 3) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to have 3 components"; + } + + const uint32_t x_type = _.GetOperandTypeId(inst, 4); + const uint32_t y_type = _.GetOperandTypeId(inst, 5); + + if (x_type != result_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand X type to be equal to Result Type"; + } + + if (y_type != result_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Y type to be equal to Result Type"; + } + break; + } + + case GLSLstd450Refract: { + if (!_.IsFloatScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a float scalar or vector type"; + } + + const uint32_t i_type = _.GetOperandTypeId(inst, 4); + const uint32_t n_type = _.GetOperandTypeId(inst, 5); + const uint32_t eta_type = _.GetOperandTypeId(inst, 6); + + if (result_type != i_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand I to be of type equal to Result Type"; + } + + if (result_type != n_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand N to be of type equal to Result Type"; + } + + const uint32_t eta_type_bit_width = _.GetBitWidth(eta_type); + if (!_.IsFloatScalarType(eta_type) || + (eta_type_bit_width != 16 && eta_type_bit_width != 32)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Eta to be a 16 or 32-bit float scalar"; + } + break; + } + + case GLSLstd450InterpolateAtCentroid: + case GLSLstd450InterpolateAtSample: + case GLSLstd450InterpolateAtOffset: { + if (!_.HasCapability(SpvCapabilityInterpolationFunction)) { + return _.diag(SPV_ERROR_INVALID_CAPABILITY) + << ext_inst_name() + << " requires capability InterpolationFunction"; + } + + if (!_.IsFloatScalarOrVectorType(result_type) || + _.GetBitWidth(result_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a 32-bit float scalar " + << "or vector type"; + } + + const uint32_t interpolant_type = _.GetOperandTypeId(inst, 4); + uint32_t interpolant_storage_class = 0; + uint32_t interpolant_data_type = 0; + if (!_.GetPointerTypeInfo(interpolant_type, &interpolant_data_type, + &interpolant_storage_class)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Interpolant to be a pointer"; + } + + if (result_type != interpolant_data_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Interpolant data type to be equal to Result Type"; + } + + if (interpolant_storage_class != SpvStorageClassInput) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Interpolant storage class to be Input"; + } + + if (ext_inst_key == GLSLstd450InterpolateAtSample) { + const uint32_t sample_type = _.GetOperandTypeId(inst, 5); + if (!_.IsIntScalarType(sample_type) || + _.GetBitWidth(sample_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Sample to be 32-bit integer"; + } + } + + if (ext_inst_key == GLSLstd450InterpolateAtOffset) { + const uint32_t offset_type = _.GetOperandTypeId(inst, 5); + if (!_.IsFloatVectorType(offset_type) || + _.GetDimension(offset_type) != 2 || + _.GetBitWidth(offset_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Offset to be a vector of 2 32-bit floats"; + } + } + + _.current_function().RegisterExecutionModelLimitation( + SpvExecutionModelFragment, + ext_inst_name() + + std::string(" requires Fragment execution model")); + break; + } + + case GLSLstd450IMix: { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Extended instruction GLSLstd450IMix is not supported"; + } + + case GLSLstd450Bad: { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Encountered extended instruction GLSLstd450Bad"; + } + + case GLSLstd450Count: { + assert(0); + break; + } + } + } else if (ext_inst_type == SPV_EXT_INST_TYPE_OPENCL_STD) { + const OpenCLLIB::Entrypoints ext_inst_key = + OpenCLLIB::Entrypoints(ext_inst_index); + switch (ext_inst_key) { + case OpenCLLIB::Acos: + case OpenCLLIB::Acosh: + case OpenCLLIB::Acospi: + case OpenCLLIB::Asin: + case OpenCLLIB::Asinh: + case OpenCLLIB::Asinpi: + case OpenCLLIB::Atan: + case OpenCLLIB::Atan2: + case OpenCLLIB::Atanh: + case OpenCLLIB::Atanpi: + case OpenCLLIB::Atan2pi: + case OpenCLLIB::Cbrt: + case OpenCLLIB::Ceil: + case OpenCLLIB::Copysign: + case OpenCLLIB::Cos: + case OpenCLLIB::Cosh: + case OpenCLLIB::Cospi: + case OpenCLLIB::Erfc: + case OpenCLLIB::Erf: + case OpenCLLIB::Exp: + case OpenCLLIB::Exp2: + case OpenCLLIB::Exp10: + case OpenCLLIB::Expm1: + case OpenCLLIB::Fabs: + case OpenCLLIB::Fdim: + case OpenCLLIB::Floor: + case OpenCLLIB::Fma: + case OpenCLLIB::Fmax: + case OpenCLLIB::Fmin: + case OpenCLLIB::Fmod: + case OpenCLLIB::Hypot: + case OpenCLLIB::Lgamma: + case OpenCLLIB::Log: + case OpenCLLIB::Log2: + case OpenCLLIB::Log10: + case OpenCLLIB::Log1p: + case OpenCLLIB::Logb: + case OpenCLLIB::Mad: + case OpenCLLIB::Maxmag: + case OpenCLLIB::Minmag: + case OpenCLLIB::Nextafter: + case OpenCLLIB::Pow: + case OpenCLLIB::Powr: + case OpenCLLIB::Remainder: + case OpenCLLIB::Rint: + case OpenCLLIB::Round: + case OpenCLLIB::Rsqrt: + case OpenCLLIB::Sin: + case OpenCLLIB::Sinh: + case OpenCLLIB::Sinpi: + case OpenCLLIB::Sqrt: + case OpenCLLIB::Tan: + case OpenCLLIB::Tanh: + case OpenCLLIB::Tanpi: + case OpenCLLIB::Tgamma: + case OpenCLLIB::Trunc: + case OpenCLLIB::Half_cos: + case OpenCLLIB::Half_divide: + case OpenCLLIB::Half_exp: + case OpenCLLIB::Half_exp2: + case OpenCLLIB::Half_exp10: + case OpenCLLIB::Half_log: + case OpenCLLIB::Half_log2: + case OpenCLLIB::Half_log10: + case OpenCLLIB::Half_powr: + case OpenCLLIB::Half_recip: + case OpenCLLIB::Half_rsqrt: + case OpenCLLIB::Half_sin: + case OpenCLLIB::Half_sqrt: + case OpenCLLIB::Half_tan: + case OpenCLLIB::Native_cos: + case OpenCLLIB::Native_divide: + case OpenCLLIB::Native_exp: + case OpenCLLIB::Native_exp2: + case OpenCLLIB::Native_exp10: + case OpenCLLIB::Native_log: + case OpenCLLIB::Native_log2: + case OpenCLLIB::Native_log10: + case OpenCLLIB::Native_powr: + case OpenCLLIB::Native_recip: + case OpenCLLIB::Native_rsqrt: + case OpenCLLIB::Native_sin: + case OpenCLLIB::Native_sqrt: + case OpenCLLIB::Native_tan: + case OpenCLLIB::FClamp: + case OpenCLLIB::Degrees: + case OpenCLLIB::FMax_common: + case OpenCLLIB::FMin_common: + case OpenCLLIB::Mix: + case OpenCLLIB::Radians: + case OpenCLLIB::Step: + case OpenCLLIB::Smoothstep: + case OpenCLLIB::Sign: { + if (!_.IsFloatScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a float scalar or vector type"; + } + + const uint32_t num_components = _.GetDimension(result_type); + if (num_components > 4 && num_components != 8 && num_components != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a scalar or a vector with 2, " + "3, 4, 8 or 16 components"; + } + + for (uint32_t operand_index = 4; operand_index < num_operands; + ++operand_index) { + const uint32_t operand_type = _.GetOperandTypeId(inst, operand_index); + if (result_type != operand_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected types of all operands to be equal to Result " + "Type"; + } + } + break; + } + + case OpenCLLIB::Fract: + case OpenCLLIB::Modf: + case OpenCLLIB::Sincos: + case OpenCLLIB::Remquo: { + if (!_.IsFloatScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a float scalar or vector type"; + } + + const uint32_t num_components = _.GetDimension(result_type); + if (num_components > 4 && num_components != 8 && num_components != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a scalar or a vector with 2, " + "3, 4, 8 or 16 components"; + } + + uint32_t operand_index = 4; + const uint32_t x_type = _.GetOperandTypeId(inst, operand_index++); + if (result_type != x_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected type of operand X to be equal to Result Type"; + } + + if (ext_inst_key == OpenCLLIB::Remquo) { + const uint32_t y_type = _.GetOperandTypeId(inst, operand_index++); + if (result_type != y_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected type of operand Y to be equal to Result Type"; + } + } + + const uint32_t p_type = _.GetOperandTypeId(inst, operand_index++); + uint32_t p_storage_class = 0; + uint32_t p_data_type = 0; + if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected the last operand to be a pointer"; + } + + if (p_storage_class != SpvStorageClassGeneric && + p_storage_class != SpvStorageClassCrossWorkgroup && + p_storage_class != SpvStorageClassWorkgroup && + p_storage_class != SpvStorageClassFunction) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected storage class of the pointer to be Generic, " + "CrossWorkgroup, Workgroup or Function"; + } + + if (result_type != p_data_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected data type of the pointer to be equal to Result " + "Type"; + } + break; + } + + case OpenCLLIB::Frexp: + case OpenCLLIB::Lgamma_r: { + if (!_.IsFloatScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a float scalar or vector type"; + } + + const uint32_t num_components = _.GetDimension(result_type); + if (num_components > 4 && num_components != 8 && num_components != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a scalar or a vector with 2, " + "3, 4, 8 or 16 components"; + } + + const uint32_t x_type = _.GetOperandTypeId(inst, 4); + if (result_type != x_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected type of operand X to be equal to Result Type"; + } + + const uint32_t p_type = _.GetOperandTypeId(inst, 5); + uint32_t p_storage_class = 0; + uint32_t p_data_type = 0; + if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected the last operand to be a pointer"; + } + + if (p_storage_class != SpvStorageClassGeneric && + p_storage_class != SpvStorageClassCrossWorkgroup && + p_storage_class != SpvStorageClassWorkgroup && + p_storage_class != SpvStorageClassFunction) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected storage class of the pointer to be Generic, " + "CrossWorkgroup, Workgroup or Function"; + } + + if (!_.IsIntScalarOrVectorType(p_data_type) || + _.GetBitWidth(p_data_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected data type of the pointer to be a 32-bit int " + "scalar or vector type"; + } + + if (_.GetDimension(p_data_type) != num_components) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected data type of the pointer to have the same number " + "of components as Result Type"; + } + break; + } + + case OpenCLLIB::Ilogb: { + if (!_.IsIntScalarOrVectorType(result_type) || + _.GetBitWidth(result_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a 32-bit int scalar or vector " + "type"; + } + + const uint32_t num_components = _.GetDimension(result_type); + if (num_components > 4 && num_components != 8 && num_components != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a scalar or a vector with 2, " + "3, 4, 8 or 16 components"; + } + + const uint32_t x_type = _.GetOperandTypeId(inst, 4); + if (!_.IsFloatScalarOrVectorType(x_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand X to be a float scalar or vector"; + } + + if (_.GetDimension(x_type) != num_components) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand X to have the same number of components " + "as Result Type"; + } + break; + } + + case OpenCLLIB::Ldexp: + case OpenCLLIB::Pown: + case OpenCLLIB::Rootn: { + if (!_.IsFloatScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a float scalar or vector type"; + } + + const uint32_t num_components = _.GetDimension(result_type); + if (num_components > 4 && num_components != 8 && num_components != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a scalar or a vector with 2, " + "3, 4, 8 or 16 components"; + } + + const uint32_t x_type = _.GetOperandTypeId(inst, 4); + if (result_type != x_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected type of operand X to be equal to Result Type"; + } + + const uint32_t exp_type = _.GetOperandTypeId(inst, 5); + if (!_.IsIntScalarOrVectorType(exp_type) || + _.GetBitWidth(exp_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected the exponent to be a 32-bit int scalar or vector"; + } + + if (_.GetDimension(exp_type) != num_components) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected the exponent to have the same number of " + "components as Result Type"; + } + break; + } + + case OpenCLLIB::Nan: { + if (!_.IsFloatScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a float scalar or vector type"; + } + + const uint32_t num_components = _.GetDimension(result_type); + if (num_components > 4 && num_components != 8 && num_components != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a scalar or a vector with 2, " + "3, 4, 8 or 16 components"; + } + + const uint32_t nancode_type = _.GetOperandTypeId(inst, 4); + if (!_.IsIntScalarOrVectorType(nancode_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Nancode to be an int scalar or vector type"; + } + + if (_.GetDimension(nancode_type) != num_components) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Nancode to have the same number of components as " + "Result Type"; + } + + if (_.GetBitWidth(result_type) != _.GetBitWidth(nancode_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Nancode to have the same bit width as Result " + "Type"; + } + break; + } + + case OpenCLLIB::SAbs: + case OpenCLLIB::SAbs_diff: + case OpenCLLIB::SAdd_sat: + case OpenCLLIB::UAdd_sat: + case OpenCLLIB::SHadd: + case OpenCLLIB::UHadd: + case OpenCLLIB::SRhadd: + case OpenCLLIB::URhadd: + case OpenCLLIB::SClamp: + case OpenCLLIB::UClamp: + case OpenCLLIB::Clz: + case OpenCLLIB::Ctz: + case OpenCLLIB::SMad_hi: + case OpenCLLIB::UMad_sat: + case OpenCLLIB::SMad_sat: + case OpenCLLIB::SMax: + case OpenCLLIB::UMax: + case OpenCLLIB::SMin: + case OpenCLLIB::UMin: + case OpenCLLIB::SMul_hi: + case OpenCLLIB::Rotate: + case OpenCLLIB::SSub_sat: + case OpenCLLIB::USub_sat: + case OpenCLLIB::Popcount: + case OpenCLLIB::UAbs: + case OpenCLLIB::UAbs_diff: + case OpenCLLIB::UMul_hi: + case OpenCLLIB::UMad_hi: { + if (!_.IsIntScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be an int scalar or vector type"; + } + + const uint32_t num_components = _.GetDimension(result_type); + if (num_components > 4 && num_components != 8 && num_components != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a scalar or a vector with 2, " + "3, 4, 8 or 16 components"; + } + + for (uint32_t operand_index = 4; operand_index < num_operands; + ++operand_index) { + const uint32_t operand_type = _.GetOperandTypeId(inst, operand_index); + if (result_type != operand_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected types of all operands to be equal to Result " + "Type"; + } + } + break; + } + + case OpenCLLIB::U_Upsample: + case OpenCLLIB::S_Upsample: { + if (!_.IsIntScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be an int scalar or vector " + "type"; + } + + const uint32_t result_num_components = _.GetDimension(result_type); + if (result_num_components > 4 && result_num_components != 8 && + result_num_components != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a scalar or a vector with 2, " + "3, 4, 8 or 16 components"; + } + + const uint32_t result_bit_width = _.GetBitWidth(result_type); + if (result_bit_width != 16 && result_bit_width != 32 && + result_bit_width != 64) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected bit width of Result Type components to be 16, 32 " + "or 64"; + } + + const uint32_t hi_type = _.GetOperandTypeId(inst, 4); + const uint32_t lo_type = _.GetOperandTypeId(inst, 5); + + if (hi_type != lo_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Hi and Lo operands to have the same type"; + } + + if (result_num_components != _.GetDimension(hi_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Hi and Lo operands to have the same number of " + "components as Result Type"; + } + + if (result_bit_width != 2 * _.GetBitWidth(hi_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected bit width of components of Hi and Lo operands to " + "be half of the bit width of components of Result Type"; + } + break; + } + + case OpenCLLIB::SMad24: + case OpenCLLIB::UMad24: + case OpenCLLIB::SMul24: + case OpenCLLIB::UMul24: { + if (!_.IsIntScalarOrVectorType(result_type) || + _.GetBitWidth(result_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a 32-bit int scalar or vector " + "type"; + } + + const uint32_t num_components = _.GetDimension(result_type); + if (num_components > 4 && num_components != 8 && num_components != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a scalar or a vector with 2, " + "3, 4, 8 or 16 components"; + } + + for (uint32_t operand_index = 4; operand_index < num_operands; + ++operand_index) { + const uint32_t operand_type = _.GetOperandTypeId(inst, operand_index); + if (result_type != operand_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected types of all operands to be equal to Result " + "Type"; + } + } + break; + } + + case OpenCLLIB::Cross: { + if (!_.IsFloatVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a float vector type"; + } + + const uint32_t num_components = _.GetDimension(result_type); + if (num_components != 3 && num_components != 4) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to have 3 or 4 components"; + } + + const uint32_t x_type = _.GetOperandTypeId(inst, 4); + const uint32_t y_type = _.GetOperandTypeId(inst, 5); + + if (x_type != result_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand X type to be equal to Result Type"; + } + + if (y_type != result_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Y type to be equal to Result Type"; + } + break; + } + + case OpenCLLIB::Distance: + case OpenCLLIB::Fast_distance: { + if (!_.IsFloatScalarType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a float scalar type"; + } + + const uint32_t p0_type = _.GetOperandTypeId(inst, 4); + if (!_.IsFloatScalarOrVectorType(p0_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P0 to be of float scalar or vector type"; + } + + const uint32_t num_components = _.GetDimension(p0_type); + if (num_components > 4) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P0 to have no more than 4 components"; + } + + if (result_type != _.GetComponentType(p0_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P0 component type to be equal to " + << "Result Type"; + } + + const uint32_t p1_type = _.GetOperandTypeId(inst, 5); + if (p0_type != p1_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operands P0 and P1 to be of the same type"; + } + break; + } + + case OpenCLLIB::Length: + case OpenCLLIB::Fast_length: { + if (!_.IsFloatScalarType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a float scalar type"; + } + + const uint32_t p_type = _.GetOperandTypeId(inst, 4); + if (!_.IsFloatScalarOrVectorType(p_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P to be a float scalar or vector"; + } + + const uint32_t num_components = _.GetDimension(p_type); + if (num_components > 4) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P to have no more than 4 components"; + } + + if (result_type != _.GetComponentType(p_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P component type to be equal to Result " + "Type"; + } + break; + } + + case OpenCLLIB::Normalize: + case OpenCLLIB::Fast_normalize: { + if (!_.IsFloatScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a float scalar or vector type"; + } + + const uint32_t num_components = _.GetDimension(result_type); + if (num_components > 4) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to have no more than 4 components"; + } + + const uint32_t p_type = _.GetOperandTypeId(inst, 4); + if (p_type != result_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P type to be equal to Result Type"; + } + break; + } + + case OpenCLLIB::Bitselect: { + if (!_.IsFloatScalarOrVectorType(result_type) && + !_.IsIntScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be an int or float scalar or " + "vector type"; + } + + const uint32_t num_components = _.GetDimension(result_type); + if (num_components > 4 && num_components != 8 && num_components != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a scalar or a vector with 2, " + "3, 4, 8 or 16 components"; + } + + for (uint32_t operand_index = 4; operand_index < num_operands; + ++operand_index) { + const uint32_t operand_type = _.GetOperandTypeId(inst, operand_index); + if (result_type != operand_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected types of all operands to be equal to Result " + "Type"; + } + } + break; + } + + case OpenCLLIB::Select: { + if (!_.IsFloatScalarOrVectorType(result_type) && + !_.IsIntScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be an int or float scalar or " + "vector type"; + } + + const uint32_t num_components = _.GetDimension(result_type); + if (num_components > 4 && num_components != 8 && num_components != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a scalar or a vector with 2, " + "3, 4, 8 or 16 components"; + } + + const uint32_t a_type = _.GetOperandTypeId(inst, 4); + const uint32_t b_type = _.GetOperandTypeId(inst, 5); + const uint32_t c_type = _.GetOperandTypeId(inst, 6); + + if (result_type != a_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand A type to be equal to Result Type"; + } + + if (result_type != b_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand B type to be equal to Result Type"; + } + + if (!_.IsIntScalarOrVectorType(c_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand C to be an int scalar or vector"; + } + + if (num_components != _.GetDimension(c_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand C to have the same number of components " + "as Result Type"; + } + + if (_.GetBitWidth(result_type) != _.GetBitWidth(c_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand C to have the same bit width as Result " + "Type"; + } + break; + } + + case OpenCLLIB::Vloadn: { + if (!_.IsFloatVectorType(result_type) && + !_.IsIntVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be an int or float vector type"; + } + + const uint32_t num_components = _.GetDimension(result_type); + if (num_components > 4 && num_components != 8 && num_components != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to have 2, 3, 4, 8 or 16 components"; + } + + const uint32_t offset_type = _.GetOperandTypeId(inst, 4); + const uint32_t p_type = _.GetOperandTypeId(inst, 5); + + const uint32_t size_t_bit_width = GetSizeTBitWidth(_); + if (!size_t_bit_width) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() + << " can only be used with physical addressing models"; + } + + if (!_.IsIntScalarType(offset_type) || + _.GetBitWidth(offset_type) != size_t_bit_width) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Offset to be of type size_t (" + << size_t_bit_width + << "-bit integer for the addressing model used in the module)"; + } + + uint32_t p_storage_class = 0; + uint32_t p_data_type = 0; + if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P to be a pointer"; + } + + if (p_storage_class != SpvStorageClassUniformConstant && + p_storage_class != SpvStorageClassGeneric) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P storage class to be UniformConstant or " + "Generic"; + } + + if (_.GetComponentType(result_type) != p_data_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P data type to be equal to component " + "type of Result Type"; + } + + const uint32_t n_value = inst->words[7]; + if (num_components != n_value) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected literal N to be equal to the number of " + "components of Result Type"; + } + break; + } + + case OpenCLLIB::Vstoren: { + if (_.GetIdOpcode(result_type) != SpvOpTypeVoid) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": expected Result Type to be void"; + } + + const uint32_t data_type = _.GetOperandTypeId(inst, 4); + const uint32_t offset_type = _.GetOperandTypeId(inst, 5); + const uint32_t p_type = _.GetOperandTypeId(inst, 6); + + if (!_.IsFloatVectorType(data_type) && !_.IsIntVectorType(data_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Data to be an int or float vector"; + } + + const uint32_t num_components = _.GetDimension(data_type); + if (num_components > 4 && num_components != 8 && num_components != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Data to have 2, 3, 4, 8 or 16 components"; + } + + const uint32_t size_t_bit_width = GetSizeTBitWidth(_); + if (!size_t_bit_width) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() + << " can only be used with physical addressing models"; + } + + if (!_.IsIntScalarType(offset_type) || + _.GetBitWidth(offset_type) != size_t_bit_width) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Offset to be of type size_t (" + << size_t_bit_width + << "-bit integer for the addressing model used in the module)"; + } + + uint32_t p_storage_class = 0; + uint32_t p_data_type = 0; + if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P to be a pointer"; + } + + if (p_storage_class != SpvStorageClassGeneric) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P storage class to be Generic"; + } + + if (_.GetComponentType(data_type) != p_data_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P data type to be equal to the type of " + "operand Data components"; + } + break; + } + + case OpenCLLIB::Vload_half: { + if (!_.IsFloatScalarType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a float scalar type"; + } + + const uint32_t offset_type = _.GetOperandTypeId(inst, 4); + const uint32_t p_type = _.GetOperandTypeId(inst, 5); + + const uint32_t size_t_bit_width = GetSizeTBitWidth(_); + if (!size_t_bit_width) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() + << " can only be used with physical addressing models"; + } + + if (!_.IsIntScalarType(offset_type) || + _.GetBitWidth(offset_type) != size_t_bit_width) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Offset to be of type size_t (" + << size_t_bit_width + << "-bit integer for the addressing model used in the module)"; + } + + uint32_t p_storage_class = 0; + uint32_t p_data_type = 0; + if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P to be a pointer"; + } + + if (p_storage_class != SpvStorageClassUniformConstant && + p_storage_class != SpvStorageClassGeneric && + p_storage_class != SpvStorageClassCrossWorkgroup && + p_storage_class != SpvStorageClassWorkgroup && + p_storage_class != SpvStorageClassFunction) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P storage class to be UniformConstant, " + "Generic, CrossWorkgroup, Workgroup or Function"; + } + + if (!_.IsFloatScalarType(p_data_type) || + _.GetBitWidth(p_data_type) != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P data type to be 16-bit float scalar"; + } + break; + } + + case OpenCLLIB::Vload_halfn: + case OpenCLLIB::Vloada_halfn: { + if (!_.IsFloatVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a float vector type"; + } + + const uint32_t num_components = _.GetDimension(result_type); + if (num_components > 4 && num_components != 8 && num_components != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to have 2, 3, 4, 8 or 16 components"; + } + + const uint32_t offset_type = _.GetOperandTypeId(inst, 4); + const uint32_t p_type = _.GetOperandTypeId(inst, 5); + + const uint32_t size_t_bit_width = GetSizeTBitWidth(_); + if (!size_t_bit_width) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() + << " can only be used with physical addressing models"; + } + + if (!_.IsIntScalarType(offset_type) || + _.GetBitWidth(offset_type) != size_t_bit_width) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Offset to be of type size_t (" + << size_t_bit_width + << "-bit integer for the addressing model used in the module)"; + } + + uint32_t p_storage_class = 0; + uint32_t p_data_type = 0; + if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P to be a pointer"; + } + + if (p_storage_class != SpvStorageClassUniformConstant && + p_storage_class != SpvStorageClassGeneric && + p_storage_class != SpvStorageClassCrossWorkgroup && + p_storage_class != SpvStorageClassWorkgroup && + p_storage_class != SpvStorageClassFunction) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P storage class to be UniformConstant, " + "Generic, CrossWorkgroup, Workgroup or Function"; + } + + if (!_.IsFloatScalarType(p_data_type) || + _.GetBitWidth(p_data_type) != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P data type to be 16-bit float scalar"; + } + + const uint32_t n_value = inst->words[7]; + if (num_components != n_value) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected literal N to be equal to the number of " + "components of Result Type"; + } + break; + } + + case OpenCLLIB::Vstore_half: + case OpenCLLIB::Vstore_half_r: + case OpenCLLIB::Vstore_halfn: + case OpenCLLIB::Vstore_halfn_r: + case OpenCLLIB::Vstorea_halfn: + case OpenCLLIB::Vstorea_halfn_r: { + if (_.GetIdOpcode(result_type) != SpvOpTypeVoid) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": expected Result Type to be void"; + } + + const uint32_t data_type = _.GetOperandTypeId(inst, 4); + const uint32_t offset_type = _.GetOperandTypeId(inst, 5); + const uint32_t p_type = _.GetOperandTypeId(inst, 6); + const uint32_t data_type_bit_width = _.GetBitWidth(data_type); + + if (ext_inst_key == OpenCLLIB::Vstore_half || + ext_inst_key == OpenCLLIB::Vstore_half_r) { + if (!_.IsFloatScalarType(data_type) || + (data_type_bit_width != 32 && data_type_bit_width != 64)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Data to be a 32 or 64-bit float scalar"; + } + } else { + if (!_.IsFloatVectorType(data_type) || + (data_type_bit_width != 32 && data_type_bit_width != 64)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Data to be a 32 or 64-bit float vector"; + } + + const uint32_t num_components = _.GetDimension(data_type); + if (num_components > 4 && num_components != 8 && + num_components != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Data to have 2, 3, 4, 8 or 16 components"; + } + } + + const uint32_t size_t_bit_width = GetSizeTBitWidth(_); + if (!size_t_bit_width) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() + << " can only be used with physical addressing models"; + } + + if (!_.IsIntScalarType(offset_type) || + _.GetBitWidth(offset_type) != size_t_bit_width) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Offset to be of type size_t (" + << size_t_bit_width + << "-bit integer for the addressing model used in the module)"; + } + + uint32_t p_storage_class = 0; + uint32_t p_data_type = 0; + if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P to be a pointer"; + } + + if (p_storage_class != SpvStorageClassGeneric && + p_storage_class != SpvStorageClassCrossWorkgroup && + p_storage_class != SpvStorageClassWorkgroup && + p_storage_class != SpvStorageClassFunction) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P storage class to be Generic, " + "CrossWorkgroup, Workgroup or Function"; + } + + if (!_.IsFloatScalarType(p_data_type) || + _.GetBitWidth(p_data_type) != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand P data type to be 16-bit float scalar"; + } + + // Rounding mode enum is checked by assembler. + break; + } + + case OpenCLLIB::Shuffle: + case OpenCLLIB::Shuffle2: { + if (!_.IsFloatVectorType(result_type) && + !_.IsIntVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be an int or float vector type"; + } + + const uint32_t result_num_components = _.GetDimension(result_type); + if (result_num_components != 2 && result_num_components != 4 && + result_num_components != 8 && result_num_components != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to have 2, 4, 8 or 16 components"; + } + + uint32_t operand_index = 4; + const uint32_t x_type = _.GetOperandTypeId(inst, operand_index++); + + if (ext_inst_key == OpenCLLIB::Shuffle2) { + const uint32_t y_type = _.GetOperandTypeId(inst, operand_index++); + if (x_type != y_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operands X and Y to be of the same type"; + } + } + + const uint32_t shuffle_mask_type = + _.GetOperandTypeId(inst, operand_index++); + + if (!_.IsFloatVectorType(x_type) && !_.IsIntVectorType(x_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand X to be an int or float vector"; + } + + const uint32_t x_num_components = _.GetDimension(x_type); + if (x_num_components != 2 && x_num_components != 4 && + x_num_components != 8 && x_num_components != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand X to have 2, 4, 8 or 16 components"; + } + + const uint32_t result_component_type = _.GetComponentType(result_type); + + if (result_component_type != _.GetComponentType(x_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand X and Result Type to have equal " + "component types"; + } + + if (!_.IsIntVectorType(shuffle_mask_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Shuffle Mask to be an int vector"; + } + + if (result_num_components != _.GetDimension(shuffle_mask_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Shuffle Mask to have the same number of " + "components as Result Type"; + } + + if (_.GetBitWidth(result_component_type) != + _.GetBitWidth(shuffle_mask_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Shuffle Mask components to have the same " + "bit width as Result Type components"; + } + break; + } + + case OpenCLLIB::Printf: { + if (!_.IsIntScalarType(result_type) || + _.GetBitWidth(result_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a 32-bit int type"; + } + + const uint32_t format_type = _.GetOperandTypeId(inst, 4); + uint32_t format_storage_class = 0; + uint32_t format_data_type = 0; + if (!_.GetPointerTypeInfo(format_type, &format_data_type, + &format_storage_class)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Format to be a pointer"; + } + + if (format_storage_class != SpvStorageClassUniformConstant) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Format storage class to be UniformConstant"; + } + + if (!_.IsIntScalarType(format_data_type) || + _.GetBitWidth(format_data_type) != 8) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Format data type to be 8-bit int"; + } + break; + } + + case OpenCLLIB::Prefetch: { + if (_.GetIdOpcode(result_type) != SpvOpTypeVoid) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": expected Result Type to be void"; + } + + const uint32_t p_type = _.GetOperandTypeId(inst, 4); + const uint32_t num_elements_type = _.GetOperandTypeId(inst, 5); + + uint32_t p_storage_class = 0; + uint32_t p_data_type = 0; + if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Ptr to be a pointer"; + } + + if (p_storage_class != SpvStorageClassCrossWorkgroup) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Ptr storage class to be CrossWorkgroup"; + } + + if (!_.IsFloatScalarOrVectorType(p_data_type) && + !_.IsIntScalarOrVectorType(p_data_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Ptr data type to be int or float scalar or " + "vector"; + } + + const uint32_t num_components = _.GetDimension(p_data_type); + if (num_components > 4 && num_components != 8 && num_components != 16) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected Result Type to be a scalar or a vector with 2, " + "3, 4, 8 or 16 components"; + } + + const uint32_t size_t_bit_width = GetSizeTBitWidth(_); + if (!size_t_bit_width) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() + << " can only be used with physical addressing models"; + } + + if (!_.IsIntScalarType(num_elements_type) || + _.GetBitWidth(num_elements_type) != size_t_bit_width) { + return _.diag(SPV_ERROR_INVALID_DATA) + << ext_inst_name() << ": " + << "expected operand Num Elements to be of type size_t (" + << size_t_bit_width + << "-bit integer for the addressing model used in the module)"; + } + break; + } + } + } + + return SPV_SUCCESS; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,228 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_VALIDATE_H_ +#define LIBSPIRV_VALIDATE_H_ + +#include +#include +#include + +#include "instruction.h" +#include "message.h" +#include "spirv-tools/libspirv.h" +#include "table.h" + +namespace libspirv { + +class ValidationState_t; +class BasicBlock; + +/// A function that returns a vector of BasicBlocks given a BasicBlock. Used to +/// get the successor and predecessor nodes of a CFG block +using get_blocks_func = + std::function*(const BasicBlock*)>; + +/// @brief Performs the Control Flow Graph checks +/// +/// @param[in] _ the validation state of the module +/// +/// @return SPV_SUCCESS if no errors are found. SPV_ERROR_INVALID_CFG otherwise +spv_result_t PerformCfgChecks(ValidationState_t& _); + +/// @brief Updates the use vectors of all instructions that can be referenced +/// +/// This function will update the vector which define where an instruction was +/// referenced in the binary. +/// +/// @param[in] _ the validation state of the module +/// +/// @return SPV_SUCCESS if no errors are found. +spv_result_t UpdateIdUse(ValidationState_t& _); + +/// @brief This function checks all ID definitions dominate their use in the +/// CFG. +/// +/// This function will iterate over all ID definitions that are defined in the +/// functions of a module and make sure that the definitions appear in a +/// block that dominates their use. +/// +/// @param[in] _ the validation state of the module +/// +/// @return SPV_SUCCESS if no errors are found. SPV_ERROR_INVALID_ID otherwise +spv_result_t CheckIdDefinitionDominateUse(const ValidationState_t& _); + +/// @brief This function checks for preconditions involving the adjacent +/// instructions. +/// +/// This function will iterate over all instructions and check for any required +/// predecessor and/or successor instructions. e.g. SpvOpPhi must only be +/// preceeded by SpvOpLabel, SpvOpPhi, or SpvOpLine. +/// +/// @param[in] _ the validation state of the module +/// +/// @return SPV_SUCCESS if no errors are found. SPV_ERROR_INVALID_DATA otherwise +spv_result_t ValidateAdjacency(ValidationState_t& _); + +/// @brief Updates the immediate dominator for each of the block edges +/// +/// Updates the immediate dominator of the blocks for each of the edges +/// provided by the @p dom_edges parameter +/// +/// @param[in,out] dom_edges The edges of the dominator tree +/// @param[in] set_func This function will be called to updated the Immediate +/// dominator +void UpdateImmediateDominators( + const std::vector>& dom_edges, + std::function set_func); + +/// @brief Prints all of the dominators of a BasicBlock +/// +/// @param[in] block The dominators of this block will be printed +void printDominatorList(BasicBlock& block); + +/// Performs logical layout validation as described in section 2.4 of the SPIR-V +/// spec. +spv_result_t ModuleLayoutPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst); + +/// Performs Control Flow Graph validation of a module +spv_result_t CfgPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst); + +/// Performs Id and SSA validation of a module +spv_result_t IdPass(ValidationState_t& _, const spv_parsed_instruction_t* inst); + +/// Performs validation of the Data Rules subsection of 2.16.1 Universal +/// Validation Rules. +/// TODO(ehsann): add more comments here as more validation code is added. +spv_result_t DataRulesPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst); + +/// Performs instruction validation. +spv_result_t InstructionPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst); + +/// Performs decoration validation. +spv_result_t ValidateDecorations(ValidationState_t& _); + +/// Performs validation of built-in variables. +spv_result_t ValidateBuiltIns(const ValidationState_t& _); + +/// Validates that type declarations are unique, unless multiple declarations +/// of the same data type are allowed by the specification. +/// (see section 2.8 Types and Variables) +spv_result_t TypeUniquePass(ValidationState_t& _, + const spv_parsed_instruction_t* inst); + +/// Validates correctness of arithmetic instructions. +spv_result_t ArithmeticsPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst); + +/// Validates correctness of composite instructions. +spv_result_t CompositesPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst); + +/// Validates correctness of conversion instructions. +spv_result_t ConversionPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst); + +/// Validates correctness of derivative instructions. +spv_result_t DerivativesPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst); + +/// Validates correctness of logical instructions. +spv_result_t LogicalsPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst); + +/// Validates correctness of bitwise instructions. +spv_result_t BitwisePass(ValidationState_t& _, + const spv_parsed_instruction_t* inst); + +/// Validates correctness of image instructions. +spv_result_t ImagePass(ValidationState_t& _, + const spv_parsed_instruction_t* inst); + +/// Validates correctness of atomic instructions. +spv_result_t AtomicsPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst); + +/// Validates correctness of barrier instructions. +spv_result_t BarriersPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst); + +/// Validates correctness of literal numbers. +spv_result_t LiteralsPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst); + +/// Validates correctness of ExtInst instructions. +spv_result_t ExtInstPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst); + +// Validates that capability declarations use operands allowed in the current +// context. +spv_result_t CapabilityPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst); + +/// Validates correctness of primitive instructions. +spv_result_t PrimitivesPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst); + +} // namespace libspirv + +/// @brief Validate the ID usage of the instruction stream +/// +/// @param[in] pInsts stream of instructions +/// @param[in] instCount number of instructions +/// @param[in] usedefs use-def info from module parsing +/// @param[in,out] position current position in the stream +/// +/// @return result code +spv_result_t spvValidateInstructionIDs(const spv_instruction_t* pInsts, + const uint64_t instCount, + const libspirv::ValidationState_t& state, + spv_position position); + +/// @brief Validate the ID's within a SPIR-V binary +/// +/// @param[in] pInstructions array of instructions +/// @param[in] count number of elements in instruction array +/// @param[in] bound the binary header +/// @param[in,out] position current word in the binary +/// @param[in] consumer message consumer callback +/// +/// @return result code +spv_result_t spvValidateIDs(const spv_instruction_t* pInstructions, + const uint64_t count, const uint32_t bound, + spv_position position, + const spvtools::MessageConsumer& consumer); + +namespace spvtools { +// Performs validation for the SPIRV-V module binary. +// The main difference between this API and spvValidateBinary is that the +// "Validation State" is not destroyed upon function return; it lives on and is +// pointed to by the vstate unique_ptr. +spv_result_t ValidateBinaryAndKeepValidationState( + const spv_const_context context, spv_const_validator_options options, + const uint32_t* words, const size_t num_words, spv_diagnostic* pDiagnostic, + std::unique_ptr* vstate); + +// Performs validation for a single instruction and updates given validation +// state. +spv_result_t ValidateInstructionAndUpdateValidationState( + libspirv::ValidationState_t* vstate, const spv_parsed_instruction_t* inst); + +} // namespace spvtools + +#endif // LIBSPIRV_VALIDATE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_id.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_id.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_id.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_id.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,2767 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "validate.h" + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "diagnostic.h" +#include "instruction.h" +#include "message.h" +#include "opcode.h" +#include "operand.h" +#include "spirv-tools/libspirv.h" +#include "spirv_validator_options.h" +#include "val/function.h" +#include "val/validation_state.h" + +using libspirv::Decoration; +using libspirv::Function; +using libspirv::ValidationState_t; +using std::function; +using std::ignore; +using std::make_pair; +using std::pair; +using std::unordered_set; +using std::vector; + +namespace { + +class idUsage { + public: + idUsage(spv_const_context context, const spv_instruction_t* pInsts, + const uint64_t instCountArg, const SpvMemoryModel memoryModelArg, + const SpvAddressingModel addressingModelArg, + const ValidationState_t& module, const vector& entry_points, + spv_position positionArg, const spvtools::MessageConsumer& consumer) + : targetEnv(context->target_env), + opcodeTable(context->opcode_table), + operandTable(context->operand_table), + extInstTable(context->ext_inst_table), + firstInst(pInsts), + instCount(instCountArg), + memoryModel(memoryModelArg), + addressingModel(addressingModelArg), + position(positionArg), + consumer_(consumer), + module_(module), + entry_points_(entry_points) {} + + bool isValid(const spv_instruction_t* inst); + + template + bool isValid(const spv_instruction_t* inst, const spv_opcode_desc); + + private: + const spv_target_env targetEnv; + const spv_opcode_table opcodeTable; + const spv_operand_table operandTable; + const spv_ext_inst_table extInstTable; + const spv_instruction_t* const firstInst; + const uint64_t instCount; + const SpvMemoryModel memoryModel; + const SpvAddressingModel addressingModel; + spv_position position; + const spvtools::MessageConsumer& consumer_; + const ValidationState_t& module_; + vector entry_points_; + + // Returns true if the two instructions represent structs that, as far as the + // validator can tell, have the exact same data layout. + bool AreLayoutCompatibleStructs(const libspirv::Instruction* type1, + const libspirv::Instruction* type2); + + // Returns true if the operands to the OpTypeStruct instruction defining the + // types are the same or are layout compatible types. |type1| and |type2| must + // be OpTypeStruct instructions. + bool HaveLayoutCompatibleMembers(const libspirv::Instruction* type1, + const libspirv::Instruction* type2); + + // Returns true if all decorations that affect the data layout of the struct + // (like Offset), are the same for the two types. |type1| and |type2| must be + // OpTypeStruct instructions. + bool HaveSameLayoutDecorations(const libspirv::Instruction* type1, + const libspirv::Instruction* type2); + bool HasConflictingMemberOffsets( + const vector& type1_decorations, + const vector& type2_decorations) const; +}; + +#define DIAG(INDEX) \ + position->index += INDEX; \ + libspirv::DiagnosticStream helper(*position, consumer_, \ + SPV_ERROR_INVALID_DIAGNOSTIC); \ + helper + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc) { + assert(0 && "Unimplemented!"); + return false; +} +#endif // 0 + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto typeIndex = 1; + auto type = module_.FindDef(inst->words[typeIndex]); + if (!type || SpvOpTypeStruct != type->opcode()) { + DIAG(typeIndex) << "OpMemberName Type '" << inst->words[typeIndex] + << "' is not a struct type."; + return false; + } + auto memberIndex = 2; + auto member = inst->words[memberIndex]; + auto memberCount = (uint32_t)(type->words().size() - 2); + if (memberCount <= member) { + DIAG(memberIndex) << "OpMemberName Member '" + << inst->words[memberIndex] + << "' index is larger than Type '" << type->id() + << "'s member count."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto fileIndex = 1; + auto file = module_.FindDef(inst->words[fileIndex]); + if (!file || SpvOpString != file->opcode()) { + DIAG(fileIndex) << "OpLine Target '" << inst->words[fileIndex] + << "' is not an OpString."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto decorationIndex = 2; + auto decoration = inst->words[decorationIndex]; + if (decoration == SpvDecorationSpecId) { + auto targetIndex = 1; + auto target = module_.FindDef(inst->words[targetIndex]); + if (!target || !spvOpcodeIsScalarSpecConstant(target->opcode())) { + DIAG(targetIndex) << "OpDecorate SpectId decoration target '" + << inst->words[decorationIndex] + << "' is not a scalar specialization constant."; + return false; + } + } + // TODO: Add validations for all decorations. + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto structTypeIndex = 1; + auto structType = module_.FindDef(inst->words[structTypeIndex]); + if (!structType || SpvOpTypeStruct != structType->opcode()) { + DIAG(structTypeIndex) << "OpMemberDecorate Structure type '" + << inst->words[structTypeIndex] + << "' is not a struct type."; + return false; + } + auto memberIndex = 2; + auto member = inst->words[memberIndex]; + auto memberCount = static_cast(structType->words().size() - 2); + if (memberCount < member) { + DIAG(memberIndex) << "Index " << member + << " provided in OpMemberDecorate for struct " + << inst->words[structTypeIndex] + << " is out of bounds. The structure has " << memberCount + << " members. Largest valid index is " << memberCount - 1 + << "."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto decorationGroupIndex = 1; + auto decorationGroup = module_.FindDef(inst->words[decorationGroupIndex]); + + for (auto pair : decorationGroup->uses()) { + auto use = pair.first; + if (use->opcode() != SpvOpDecorate && use->opcode() != SpvOpGroupDecorate && + use->opcode() != SpvOpGroupMemberDecorate && + use->opcode() != SpvOpName) { + DIAG(decorationGroupIndex) << "Result id of OpDecorationGroup can only " + << "be targeted by OpName, OpGroupDecorate, " + << "OpDecorate, and OpGroupMemberDecorate"; + return false; + } + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto decorationGroupIndex = 1; + auto decorationGroup = module_.FindDef(inst->words[decorationGroupIndex]); + if (!decorationGroup || SpvOpDecorationGroup != decorationGroup->opcode()) { + DIAG(decorationGroupIndex) + << "OpGroupDecorate Decoration group '" + << inst->words[decorationGroupIndex] << "' is not a decoration group."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto decorationGroupIndex = 1; + auto decorationGroup = module_.FindDef(inst->words[decorationGroupIndex]); + if (!decorationGroup || SpvOpDecorationGroup != decorationGroup->opcode()) { + DIAG(decorationGroupIndex) + << "OpGroupMemberDecorate Decoration group '" + << inst->words[decorationGroupIndex] << "' is not a decoration group."; + return false; + } + // Grammar checks ensures that the number of arguments to this instruction + // is an odd number: 1 decoration group + (id,literal) pairs. + for (size_t i = 2; i + 1 < inst->words.size(); i = i + 2) { + const uint32_t struct_id = inst->words[i]; + const uint32_t index = inst->words[i + 1]; + auto struct_instr = module_.FindDef(struct_id); + if (!struct_instr || SpvOpTypeStruct != struct_instr->opcode()) { + DIAG(i) << "OpGroupMemberDecorate Structure type '" << struct_id + << "' is not a struct type."; + return false; + } + const uint32_t num_struct_members = + static_cast(struct_instr->words().size() - 2); + if (index >= num_struct_members) { + DIAG(i) << "Index " << index + << " provided in OpGroupMemberDecorate for struct " + << struct_id << " is out of bounds. The structure has " + << num_struct_members << " members. Largest valid index is " + << num_struct_members - 1 << "."; + return false; + } + } + return true; +} + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif // 0 + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto entryPointIndex = 2; + auto entryPoint = module_.FindDef(inst->words[entryPointIndex]); + if (!entryPoint || SpvOpFunction != entryPoint->opcode()) { + DIAG(entryPointIndex) << "OpEntryPoint Entry Point '" + << inst->words[entryPointIndex] + << "' is not a function."; + return false; + } + // don't check kernel function signatures + const SpvExecutionModel executionModel = SpvExecutionModel(inst->words[1]); + if (executionModel != SpvExecutionModelKernel) { + // TODO: Check the entry point signature is void main(void), may be subject + // to change + auto entryPointType = module_.FindDef(entryPoint->words()[4]); + if (!entryPointType || 3 != entryPointType->words().size()) { + DIAG(entryPointIndex) + << "OpEntryPoint Entry Point '" << inst->words[entryPointIndex] + << "'s function parameter count is not zero."; + return false; + } + } + + std::stack call_stack; + std::set visited; + call_stack.push(entryPoint->id()); + while (!call_stack.empty()) { + const uint32_t called_func_id = call_stack.top(); + call_stack.pop(); + if (!visited.insert(called_func_id).second) continue; + + const Function* called_func = module_.function(called_func_id); + assert(called_func); + + std::string reason; + if (!called_func->IsCompatibleWithExecutionModel(executionModel, &reason)) { + DIAG(entryPointIndex) + << "OpEntryPoint Entry Point '" << inst->words[entryPointIndex] + << "'s callgraph contains function " << called_func_id + << ", which cannot be used with the current execution model:\n" + << reason; + return false; + } + + for (uint32_t new_call : called_func->function_call_targets()) { + call_stack.push(new_call); + } + } + + auto returnType = module_.FindDef(entryPoint->type_id()); + if (!returnType || SpvOpTypeVoid != returnType->opcode()) { + DIAG(entryPointIndex) << "OpEntryPoint Entry Point '" + << inst->words[entryPointIndex] + << "'s function return type is not void."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto entryPointIndex = 1; + auto entryPointID = inst->words[entryPointIndex]; + auto found = + std::find(entry_points_.cbegin(), entry_points_.cend(), entryPointID); + if (found == entry_points_.cend()) { + DIAG(entryPointIndex) << "OpExecutionMode Entry Point '" + << inst->words[entryPointIndex] + << "' is not the Entry Point " + "operand of an OpEntryPoint."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto componentIndex = 2; + auto componentType = module_.FindDef(inst->words[componentIndex]); + if (!componentType || !spvOpcodeIsScalarType(componentType->opcode())) { + DIAG(componentIndex) << "OpTypeVector Component Type '" + << inst->words[componentIndex] + << "' is not a scalar type."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto columnTypeIndex = 2; + auto columnType = module_.FindDef(inst->words[columnTypeIndex]); + if (!columnType || SpvOpTypeVector != columnType->opcode()) { + DIAG(columnTypeIndex) << "OpTypeMatrix Column Type '" + << inst->words[columnTypeIndex] + << "' is not a vector."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t*, + const spv_opcode_desc) { + // OpTypeSampler takes no arguments in Rev31 and beyond. + return true; +} + +// True if the integer constant is > 0. constWords are words of the +// constant-defining instruction (either OpConstant or +// OpSpecConstant). typeWords are the words of the constant's-type-defining +// OpTypeInt. +bool aboveZero(const vector& constWords, + const vector& typeWords) { + const uint32_t width = typeWords[2]; + const bool is_signed = typeWords[3] > 0; + const uint32_t loWord = constWords[3]; + if (width > 32) { + // The spec currently doesn't allow integers wider than 64 bits. + const uint32_t hiWord = constWords[4]; // Must exist, per spec. + if (is_signed && (hiWord >> 31)) return false; + return (loWord | hiWord) > 0; + } else { + if (is_signed && (loWord >> 31)) return false; + return loWord > 0; + } +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto elementTypeIndex = 2; + auto elementType = module_.FindDef(inst->words[elementTypeIndex]); + if (!elementType || !spvOpcodeGeneratesType(elementType->opcode())) { + DIAG(elementTypeIndex) << "OpTypeArray Element Type '" + << inst->words[elementTypeIndex] + << "' is not a type."; + return false; + } + auto lengthIndex = 3; + auto length = module_.FindDef(inst->words[lengthIndex]); + if (!length || !spvOpcodeIsConstant(length->opcode())) { + DIAG(lengthIndex) << "OpTypeArray Length '" << inst->words[lengthIndex] + << "' is not a scalar constant type."; + return false; + } + + // NOTE: Check the initialiser value of the constant + auto constInst = length->words(); + auto constResultTypeIndex = 1; + auto constResultType = module_.FindDef(constInst[constResultTypeIndex]); + if (!constResultType || SpvOpTypeInt != constResultType->opcode()) { + DIAG(lengthIndex) << "OpTypeArray Length '" << inst->words[lengthIndex] + << "' is not a constant integer type."; + return false; + } + + switch (length->opcode()) { + case SpvOpSpecConstant: + case SpvOpConstant: + if (aboveZero(length->words(), constResultType->words())) break; + // Else fall through! + case SpvOpConstantNull: { + DIAG(lengthIndex) << "OpTypeArray Length '" + << inst->words[lengthIndex] + << "' default value must be at least 1."; + return false; + } + case SpvOpSpecConstantOp: + // Assume it's OK, rather than try to evaluate the operation. + break; + default: + assert(0 && "bug in spvOpcodeIsConstant() or result type isn't int"); + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto elementTypeIndex = 2; + auto elementType = module_.FindDef(inst->words[elementTypeIndex]); + if (!elementType || !spvOpcodeGeneratesType(elementType->opcode())) { + DIAG(elementTypeIndex) << "OpTypeRuntimeArray Element Type '" + << inst->words[elementTypeIndex] + << "' is not a type."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + ValidationState_t& vstate = const_cast(module_); + const uint32_t struct_id = inst->words[1]; + for (size_t memberTypeIndex = 2; memberTypeIndex < inst->words.size(); + ++memberTypeIndex) { + auto memberTypeId = inst->words[memberTypeIndex]; + auto memberType = module_.FindDef(memberTypeId); + if (!memberType || !spvOpcodeGeneratesType(memberType->opcode())) { + DIAG(memberTypeIndex) + << "OpTypeStruct Member Type '" << inst->words[memberTypeIndex] + << "' is not a type."; + return false; + } + if (SpvOpTypeStruct == memberType->opcode() && + module_.IsStructTypeWithBuiltInMember(memberTypeId)) { + DIAG(memberTypeIndex) + << "Structure " << memberTypeId + << " contains members with BuiltIn decoration. Therefore this " + "structure may not be contained as a member of another structure " + "type. Structure " + << struct_id << " contains structure " << memberTypeId << "."; + return false; + } + if (module_.IsForwardPointer(memberTypeId)) { + if (memberType->opcode() != SpvOpTypePointer) { + DIAG(memberTypeIndex) << "Found a forward reference to a non-pointer " + "type in OpTypeStruct instruction."; + return false; + } + // If we're dealing with a forward pointer: + // Find out the type that the pointer is pointing to (must be struct) + // word 3 is the of the type being pointed to. + auto typePointingTo = module_.FindDef(memberType->words()[3]); + if (typePointingTo && typePointingTo->opcode() != SpvOpTypeStruct) { + // Forward declared operands of a struct may only point to a struct. + DIAG(memberTypeIndex) + << "A forward reference operand in an OpTypeStruct must be an " + "OpTypePointer that points to an OpTypeStruct. " + "Found OpTypePointer that points to Op" + << spvOpcodeString(static_cast(typePointingTo->opcode())) + << "."; + return false; + } + } + } + std::unordered_set built_in_members; + for (auto decoration : vstate.id_decorations(struct_id)) { + if (decoration.dec_type() == SpvDecorationBuiltIn && + decoration.struct_member_index() != Decoration::kInvalidMember) { + built_in_members.insert(decoration.struct_member_index()); + } + } + int num_struct_members = static_cast(inst->words.size() - 2); + int num_builtin_members = static_cast(built_in_members.size()); + if (num_builtin_members > 0 && num_builtin_members != num_struct_members) { + DIAG(0) + << "When BuiltIn decoration is applied to a structure-type member, " + "all members of that structure type must also be decorated with " + "BuiltIn (No allowed mixing of built-in variables and " + "non-built-in variables within a single structure). Structure id " + << struct_id << " does not meet this requirement."; + return false; + } + if (num_builtin_members > 0) { + vstate.RegisterStructTypeWithBuiltInMember(struct_id); + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto typeIndex = 3; + auto type = module_.FindDef(inst->words[typeIndex]); + if (!type || !spvOpcodeGeneratesType(type->opcode())) { + DIAG(typeIndex) << "OpTypePointer Type '" << inst->words[typeIndex] + << "' is not a type."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto returnTypeIndex = 2; + auto returnType = module_.FindDef(inst->words[returnTypeIndex]); + if (!returnType || !spvOpcodeGeneratesType(returnType->opcode())) { + DIAG(returnTypeIndex) << "OpTypeFunction Return Type '" + << inst->words[returnTypeIndex] << "' is not a type."; + return false; + } + size_t num_args = 0; + for (size_t paramTypeIndex = 3; paramTypeIndex < inst->words.size(); + ++paramTypeIndex, ++num_args) { + auto paramType = module_.FindDef(inst->words[paramTypeIndex]); + if (!paramType || !spvOpcodeGeneratesType(paramType->opcode())) { + DIAG(paramTypeIndex) << "OpTypeFunction Parameter Type '" + << inst->words[paramTypeIndex] << "' is not a type."; + return false; + } + } + const uint32_t num_function_args_limit = + module_.options()->universal_limits_.max_function_args; + if (num_args > num_function_args_limit) { + DIAG(returnTypeIndex) << "OpTypeFunction may not take more than " + << num_function_args_limit + << " arguments. OpTypeFunction '" + << inst->words[1] << "' has " << num_args + << " arguments."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t*, + const spv_opcode_desc) { + // OpTypePipe has no ID arguments. + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto resultTypeIndex = 1; + auto resultType = module_.FindDef(inst->words[resultTypeIndex]); + if (!resultType || SpvOpTypeBool != resultType->opcode()) { + DIAG(resultTypeIndex) << "OpConstantTrue Result Type '" + << inst->words[resultTypeIndex] + << "' is not a boolean type."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto resultTypeIndex = 1; + auto resultType = module_.FindDef(inst->words[resultTypeIndex]); + if (!resultType || SpvOpTypeBool != resultType->opcode()) { + DIAG(resultTypeIndex) << "OpConstantFalse Result Type '" + << inst->words[resultTypeIndex] + << "' is not a boolean type."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto resultTypeIndex = 1; + auto resultType = module_.FindDef(inst->words[resultTypeIndex]); + if (!resultType || !spvOpcodeIsComposite(resultType->opcode())) { + DIAG(resultTypeIndex) << "OpConstantComposite Result Type '" + << inst->words[resultTypeIndex] + << "' is not a composite type."; + return false; + } + + auto constituentCount = inst->words.size() - 3; + switch (resultType->opcode()) { + case SpvOpTypeVector: { + auto componentCount = resultType->words()[3]; + if (componentCount != constituentCount) { + // TODO: Output ID's on diagnostic + DIAG(inst->words.size() - 1) + << "OpConstantComposite Constituent count does not match " + "Result Type '" + << resultType->id() << "'s vector component count."; + return false; + } + auto componentType = module_.FindDef(resultType->words()[2]); + assert(componentType); + for (size_t constituentIndex = 3; constituentIndex < inst->words.size(); + constituentIndex++) { + auto constituent = module_.FindDef(inst->words[constituentIndex]); + if (!constituent || + !spvOpcodeIsConstantOrUndef(constituent->opcode())) { + DIAG(constituentIndex) << "OpConstantComposite Constituent '" + << inst->words[constituentIndex] + << "' is not a constant or undef."; + return false; + } + auto constituentResultType = module_.FindDef(constituent->type_id()); + if (!constituentResultType || + componentType->opcode() != constituentResultType->opcode()) { + DIAG(constituentIndex) + << "OpConstantComposite Constituent '" + << inst->words[constituentIndex] + << "'s type does not match Result Type '" << resultType->id() + << "'s vector element type."; + return false; + } + } + } break; + case SpvOpTypeMatrix: { + auto columnCount = resultType->words()[3]; + if (columnCount != constituentCount) { + // TODO: Output ID's on diagnostic + DIAG(inst->words.size() - 1) + << "OpConstantComposite Constituent count does not match " + "Result Type '" + << resultType->id() << "'s matrix column count."; + return false; + } + + auto columnType = module_.FindDef(resultType->words()[2]); + assert(columnType); + auto componentCount = columnType->words()[3]; + auto componentType = module_.FindDef(columnType->words()[2]); + assert(componentType); + + for (size_t constituentIndex = 3; constituentIndex < inst->words.size(); + constituentIndex++) { + auto constituent = module_.FindDef(inst->words[constituentIndex]); + if (!constituent || !(SpvOpConstantComposite == constituent->opcode() || + SpvOpUndef == constituent->opcode())) { + // The message says "... or undef" because the spec does not say + // undef is a constant. + DIAG(constituentIndex) << "OpConstantComposite Constituent '" + << inst->words[constituentIndex] + << "' is not a constant composite or undef."; + return false; + } + auto vector = module_.FindDef(constituent->type_id()); + assert(vector); + if (columnType->opcode() != vector->opcode()) { + DIAG(constituentIndex) + << "OpConstantComposite Constituent '" + << inst->words[constituentIndex] + << "' type does not match Result Type '" << resultType->id() + << "'s matrix column type."; + return false; + } + auto vectorComponentType = module_.FindDef(vector->words()[2]); + assert(vectorComponentType); + if (componentType->id() != vectorComponentType->id()) { + DIAG(constituentIndex) + << "OpConstantComposite Constituent '" + << inst->words[constituentIndex] + << "' component type does not match Result Type '" + << resultType->id() << "'s matrix column component type."; + return false; + } + if (componentCount != vector->words()[3]) { + DIAG(constituentIndex) + << "OpConstantComposite Constituent '" + << inst->words[constituentIndex] + << "' vector component count does not match Result Type '" + << resultType->id() << "'s vector component count."; + return false; + } + } + } break; + case SpvOpTypeArray: { + auto elementType = module_.FindDef(resultType->words()[2]); + assert(elementType); + auto length = module_.FindDef(resultType->words()[3]); + assert(length); + if (length->words()[3] != constituentCount) { + DIAG(inst->words.size() - 1) + << "OpConstantComposite Constituent count does not match " + "Result Type '" + << resultType->id() << "'s array length."; + return false; + } + for (size_t constituentIndex = 3; constituentIndex < inst->words.size(); + constituentIndex++) { + auto constituent = module_.FindDef(inst->words[constituentIndex]); + if (!constituent || + !spvOpcodeIsConstantOrUndef(constituent->opcode())) { + DIAG(constituentIndex) << "OpConstantComposite Constituent '" + << inst->words[constituentIndex] + << "' is not a constant or undef."; + return false; + } + auto constituentType = module_.FindDef(constituent->type_id()); + assert(constituentType); + if (elementType->id() != constituentType->id()) { + DIAG(constituentIndex) + << "OpConstantComposite Constituent '" + << inst->words[constituentIndex] + << "'s type does not match Result Type '" << resultType->id() + << "'s array element type."; + return false; + } + } + } break; + case SpvOpTypeStruct: { + auto memberCount = resultType->words().size() - 2; + if (memberCount != constituentCount) { + DIAG(resultTypeIndex) << "OpConstantComposite Constituent '" + << inst->words[resultTypeIndex] + << "' count does not match Result Type '" + << resultType->id() << "'s struct member count."; + return false; + } + for (uint32_t constituentIndex = 3, memberIndex = 2; + constituentIndex < inst->words.size(); + constituentIndex++, memberIndex++) { + auto constituent = module_.FindDef(inst->words[constituentIndex]); + if (!constituent || + !spvOpcodeIsConstantOrUndef(constituent->opcode())) { + DIAG(constituentIndex) << "OpConstantComposite Constituent '" + << inst->words[constituentIndex] + << "' is not a constant or undef."; + return false; + } + auto constituentType = module_.FindDef(constituent->type_id()); + assert(constituentType); + + auto memberType = module_.FindDef(resultType->words()[memberIndex]); + assert(memberType); + if (memberType->id() != constituentType->id()) { + DIAG(constituentIndex) + << "OpConstantComposite Constituent '" + << inst->words[constituentIndex] + << "' type does not match the Result Type '" + << resultType->id() << "'s member type."; + return false; + } + } + } break; + default: { assert(0 && "Unreachable!"); } break; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto resultTypeIndex = 1; + auto resultType = module_.FindDef(inst->words[resultTypeIndex]); + if (!resultType || SpvOpTypeSampler != resultType->opcode()) { + DIAG(resultTypeIndex) << "OpConstantSampler Result Type '" + << inst->words[resultTypeIndex] + << "' is not a sampler type."; + return false; + } + return true; +} + +// True if instruction defines a type that can have a null value, as defined by +// the SPIR-V spec. Tracks composite-type components through module to check +// nullability transitively. +bool IsTypeNullable(const vector& instruction, + const ValidationState_t& module) { + uint16_t opcode; + uint16_t word_count; + spvOpcodeSplit(instruction[0], &word_count, &opcode); + switch (static_cast(opcode)) { + case SpvOpTypeBool: + case SpvOpTypeInt: + case SpvOpTypeFloat: + case SpvOpTypePointer: + case SpvOpTypeEvent: + case SpvOpTypeDeviceEvent: + case SpvOpTypeReserveId: + case SpvOpTypeQueue: + return true; + case SpvOpTypeArray: + case SpvOpTypeMatrix: + case SpvOpTypeVector: { + auto base_type = module.FindDef(instruction[2]); + return base_type && IsTypeNullable(base_type->words(), module); + } + case SpvOpTypeStruct: { + for (size_t elementIndex = 2; elementIndex < instruction.size(); + ++elementIndex) { + auto element = module.FindDef(instruction[elementIndex]); + if (!element || !IsTypeNullable(element->words(), module)) return false; + } + return true; + } + default: + return false; + } +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto resultTypeIndex = 1; + auto resultType = module_.FindDef(inst->words[resultTypeIndex]); + if (!resultType || !IsTypeNullable(resultType->words(), module_)) { + DIAG(resultTypeIndex) << "OpConstantNull Result Type '" + << inst->words[resultTypeIndex] + << "' cannot have a null value."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto resultTypeIndex = 1; + auto resultType = module_.FindDef(inst->words[resultTypeIndex]); + if (!resultType || SpvOpTypeBool != resultType->opcode()) { + DIAG(resultTypeIndex) << "OpSpecConstantTrue Result Type '" + << inst->words[resultTypeIndex] + << "' is not a boolean type."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto resultTypeIndex = 1; + auto resultType = module_.FindDef(inst->words[resultTypeIndex]); + if (!resultType || SpvOpTypeBool != resultType->opcode()) { + DIAG(resultTypeIndex) << "OpSpecConstantFalse Result Type '" + << inst->words[resultTypeIndex] + << "' is not a boolean type."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto resultTypeIndex = 2; + auto resultID = inst->words[resultTypeIndex]; + auto sampledImageInstr = module_.FindDef(resultID); + // We need to validate 2 things: + // * All OpSampledImage instructions must be in the same block in which their + // Result are consumed. + // * Result from OpSampledImage instructions must not appear as operands + // to OpPhi instructions or OpSelect instructions, or any instructions other + // than the image lookup and query instructions specified to take an operand + // whose type is OpTypeSampledImage. + std::vector consumers = module_.getSampledImageConsumers(resultID); + if (!consumers.empty()) { + for (auto consumer_id : consumers) { + auto consumer_instr = module_.FindDef(consumer_id); + auto consumer_opcode = consumer_instr->opcode(); + if (consumer_instr->block() != sampledImageInstr->block()) { + DIAG(resultTypeIndex) + << "All OpSampledImage instructions must be in the same block in " + "which their Result are consumed. OpSampledImage Result " + "Type '" + << resultID + << "' has a consumer in a different basic " + "block. The consumer instruction is '" + << consumer_id << "'."; + return false; + } + // TODO: The following check is incomplete. We should also check that the + // Sampled Image is not used by instructions that should not take + // SampledImage as an argument. We could find the list of valid + // instructions by scanning for "Sampled Image" in the operand description + // field in the grammar file. + if (consumer_opcode == SpvOpPhi || consumer_opcode == SpvOpSelect) { + DIAG(resultTypeIndex) + << "Result from OpSampledImage instruction must not appear as " + "operands of Op" + << spvOpcodeString(static_cast(consumer_opcode)) << "." + << " Found result '" << resultID << "' as an operand of '" + << consumer_id << "'."; + return false; + } + } + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + // The result type must be a composite type. + auto resultTypeIndex = 1; + auto resultType = module_.FindDef(inst->words[resultTypeIndex]); + if (!resultType || !spvOpcodeIsComposite(resultType->opcode())) { + DIAG(resultTypeIndex) << "OpSpecConstantComposite Result Type '" + << inst->words[resultTypeIndex] + << "' is not a composite type."; + return false; + } + // Validation checks differ based on the type of composite type. + auto constituentCount = inst->words.size() - 3; + switch (resultType->opcode()) { + // For Vectors, the following must be met: + // * Number of constituents in the result type and the vector must match. + // * All the components of the vector must have the same type (or specialize + // to the same type). OpConstant and OpSpecConstant are allowed. + // To check that condition, we check each supplied value argument's type + // against the element type of the result type. + case SpvOpTypeVector: { + auto componentCount = resultType->words()[3]; + if (componentCount != constituentCount) { + DIAG(inst->words.size() - 1) + << "OpSpecConstantComposite Constituent count does not match " + "Result Type '" + << resultType->id() << "'s vector component count."; + return false; + } + auto componentType = module_.FindDef(resultType->words()[2]); + assert(componentType); + for (size_t constituentIndex = 3; constituentIndex < inst->words.size(); + constituentIndex++) { + auto constituent = module_.FindDef(inst->words[constituentIndex]); + if (!constituent || + !spvOpcodeIsConstantOrUndef(constituent->opcode())) { + DIAG(constituentIndex) << "OpSpecConstantComposite Constituent '" + << inst->words[constituentIndex] + << "' is not a constant or undef."; + return false; + } + auto constituentResultType = module_.FindDef(constituent->type_id()); + if (!constituentResultType || + componentType->opcode() != constituentResultType->opcode()) { + DIAG(constituentIndex) + << "OpSpecConstantComposite Constituent '" + << inst->words[constituentIndex] + << "'s type does not match Result Type '" << resultType->id() + << "'s vector element type."; + return false; + } + } + break; + } + case SpvOpTypeMatrix: { + auto columnCount = resultType->words()[3]; + if (columnCount != constituentCount) { + DIAG(inst->words.size() - 1) + << "OpSpecConstantComposite Constituent count does not match " + "Result Type '" + << resultType->id() << "'s matrix column count."; + return false; + } + + auto columnType = module_.FindDef(resultType->words()[2]); + assert(columnType); + auto componentCount = columnType->words()[3]; + auto componentType = module_.FindDef(columnType->words()[2]); + assert(componentType); + + for (size_t constituentIndex = 3; constituentIndex < inst->words.size(); + constituentIndex++) { + auto constituent = module_.FindDef(inst->words[constituentIndex]); + auto constituentOpCode = constituent->opcode(); + if (!constituent || !(SpvOpSpecConstantComposite == constituentOpCode || + SpvOpConstantComposite == constituentOpCode || + SpvOpUndef == constituentOpCode)) { + // The message says "... or undef" because the spec does not say + // undef is a constant. + DIAG(constituentIndex) << "OpSpecConstantComposite Constituent '" + << inst->words[constituentIndex] + << "' is not a constant composite or undef."; + return false; + } + auto vector = module_.FindDef(constituent->type_id()); + assert(vector); + if (columnType->opcode() != vector->opcode()) { + DIAG(constituentIndex) + << "OpSpecConstantComposite Constituent '" + << inst->words[constituentIndex] + << "' type does not match Result Type '" << resultType->id() + << "'s matrix column type."; + return false; + } + auto vectorComponentType = module_.FindDef(vector->words()[2]); + assert(vectorComponentType); + if (componentType->id() != vectorComponentType->id()) { + DIAG(constituentIndex) + << "OpSpecConstantComposite Constituent '" + << inst->words[constituentIndex] + << "' component type does not match Result Type '" + << resultType->id() << "'s matrix column component type."; + return false; + } + if (componentCount != vector->words()[3]) { + DIAG(constituentIndex) + << "OpSpecConstantComposite Constituent '" + << inst->words[constituentIndex] + << "' vector component count does not match Result Type '" + << resultType->id() << "'s vector component count."; + return false; + } + } + break; + } + case SpvOpTypeArray: { + auto elementType = module_.FindDef(resultType->words()[2]); + assert(elementType); + auto length = module_.FindDef(resultType->words()[3]); + assert(length); + if (length->words()[3] != constituentCount) { + DIAG(inst->words.size() - 1) + << "OpSpecConstantComposite Constituent count does not match " + "Result Type '" + << resultType->id() << "'s array length."; + return false; + } + for (size_t constituentIndex = 3; constituentIndex < inst->words.size(); + constituentIndex++) { + auto constituent = module_.FindDef(inst->words[constituentIndex]); + if (!constituent || + !spvOpcodeIsConstantOrUndef(constituent->opcode())) { + DIAG(constituentIndex) << "OpSpecConstantComposite Constituent '" + << inst->words[constituentIndex] + << "' is not a constant or undef."; + return false; + } + auto constituentType = module_.FindDef(constituent->type_id()); + assert(constituentType); + if (elementType->id() != constituentType->id()) { + DIAG(constituentIndex) + << "OpSpecConstantComposite Constituent '" + << inst->words[constituentIndex] + << "'s type does not match Result Type '" << resultType->id() + << "'s array element type."; + return false; + } + } + break; + } + case SpvOpTypeStruct: { + auto memberCount = resultType->words().size() - 2; + if (memberCount != constituentCount) { + DIAG(resultTypeIndex) << "OpSpecConstantComposite Constituent '" + << inst->words[resultTypeIndex] + << "' count does not match Result Type '" + << resultType->id() << "'s struct member count."; + return false; + } + for (uint32_t constituentIndex = 3, memberIndex = 2; + constituentIndex < inst->words.size(); + constituentIndex++, memberIndex++) { + auto constituent = module_.FindDef(inst->words[constituentIndex]); + if (!constituent || + !spvOpcodeIsConstantOrUndef(constituent->opcode())) { + DIAG(constituentIndex) << "OpSpecConstantComposite Constituent '" + << inst->words[constituentIndex] + << "' is not a constant or undef."; + return false; + } + auto constituentType = module_.FindDef(constituent->type_id()); + assert(constituentType); + + auto memberType = module_.FindDef(resultType->words()[memberIndex]); + assert(memberType); + if (memberType->id() != constituentType->id()) { + DIAG(constituentIndex) + << "OpSpecConstantComposite Constituent '" + << inst->words[constituentIndex] + << "' type does not match the Result Type '" + << resultType->id() << "'s member type."; + return false; + } + } + break; + } + default: { assert(0 && "Unreachable!"); } break; + } + return true; +} + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst) {} +#endif + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto resultTypeIndex = 1; + auto resultType = module_.FindDef(inst->words[resultTypeIndex]); + if (!resultType || SpvOpTypePointer != resultType->opcode()) { + DIAG(resultTypeIndex) << "OpVariable Result Type '" + << inst->words[resultTypeIndex] + << "' is not a pointer type."; + return false; + } + const auto initialiserIndex = 4; + if (initialiserIndex < inst->words.size()) { + const auto initialiser = module_.FindDef(inst->words[initialiserIndex]); + const auto storageClassIndex = 3; + const auto is_module_scope_var = + initialiser && (initialiser->opcode() == SpvOpVariable) && + (initialiser->word(storageClassIndex) != SpvStorageClassFunction); + const auto is_constant = + initialiser && spvOpcodeIsConstant(initialiser->opcode()); + if (!initialiser || !(is_constant || is_module_scope_var)) { + DIAG(initialiserIndex) + << "OpVariable Initializer '" << inst->words[initialiserIndex] + << "' is not a constant or module-scope variable."; + return false; + } + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto resultTypeIndex = 1; + auto resultType = module_.FindDef(inst->words[resultTypeIndex]); + if (!resultType) { + DIAG(resultTypeIndex) << "OpLoad Result Type '" + << inst->words[resultTypeIndex] << "' is not defind."; + return false; + } + const bool uses_variable_pointer = + module_.features().variable_pointers || + module_.features().variable_pointers_storage_buffer; + auto pointerIndex = 3; + auto pointer = module_.FindDef(inst->words[pointerIndex]); + if (!pointer || + (addressingModel == SpvAddressingModelLogical && + ((!uses_variable_pointer && + !spvOpcodeReturnsLogicalPointer(pointer->opcode())) || + (uses_variable_pointer && + !spvOpcodeReturnsLogicalVariablePointer(pointer->opcode()))))) { + DIAG(pointerIndex) << "OpLoad Pointer '" << inst->words[pointerIndex] + << "' is not a logical pointer."; + return false; + } + auto pointerType = module_.FindDef(pointer->type_id()); + if (!pointerType || pointerType->opcode() != SpvOpTypePointer) { + DIAG(pointerIndex) << "OpLoad type for pointer '" + << inst->words[pointerIndex] + << "' is not a pointer type."; + return false; + } + auto pointeeType = module_.FindDef(pointerType->words()[3]); + if (!pointeeType || resultType->id() != pointeeType->id()) { + DIAG(resultTypeIndex) << "OpLoad Result Type '" + << inst->words[resultTypeIndex] + << "' does not match Pointer '" << pointer->id() + << "'s type."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + const bool uses_variable_pointer = + module_.features().variable_pointers || + module_.features().variable_pointers_storage_buffer; + const auto pointerIndex = 1; + auto pointer = module_.FindDef(inst->words[pointerIndex]); + if (!pointer || + (addressingModel == SpvAddressingModelLogical && + ((!uses_variable_pointer && + !spvOpcodeReturnsLogicalPointer(pointer->opcode())) || + (uses_variable_pointer && + !spvOpcodeReturnsLogicalVariablePointer(pointer->opcode()))))) { + DIAG(pointerIndex) << "OpStore Pointer '" << inst->words[pointerIndex] + << "' is not a logical pointer."; + return false; + } + auto pointerType = module_.FindDef(pointer->type_id()); + if (!pointer || pointerType->opcode() != SpvOpTypePointer) { + DIAG(pointerIndex) << "OpStore type for pointer '" + << inst->words[pointerIndex] + << "' is not a pointer type."; + return false; + } + auto type = module_.FindDef(pointerType->words()[3]); + assert(type); + if (SpvOpTypeVoid == type->opcode()) { + DIAG(pointerIndex) << "OpStore Pointer '" << inst->words[pointerIndex] + << "'s type is void."; + return false; + } + + // validate storage class + { + uint32_t dataType; + uint32_t storageClass; + if (!module_.GetPointerTypeInfo(pointerType->id(), &dataType, + &storageClass)) { + DIAG(pointerIndex) << "OpStore Pointer '" + << inst->words[pointerIndex] + << "' is not pointer type"; + return false; + } + + if (storageClass == SpvStorageClassUniformConstant || + storageClass == SpvStorageClassInput || + storageClass == SpvStorageClassPushConstant) { + DIAG(pointerIndex) << "OpStore Pointer '" + << inst->words[pointerIndex] + << "' storage class is read-only"; + return false; + } + } + + auto objectIndex = 2; + auto object = module_.FindDef(inst->words[objectIndex]); + if (!object || !object->type_id()) { + DIAG(objectIndex) << "OpStore Object '" << inst->words[objectIndex] + << "' is not an object."; + return false; + } + auto objectType = module_.FindDef(object->type_id()); + assert(objectType); + if (SpvOpTypeVoid == objectType->opcode()) { + DIAG(objectIndex) << "OpStore Object '" << inst->words[objectIndex] + << "'s type is void."; + return false; + } + + if (type->id() != objectType->id()) { + if (!module_.options()->relax_struct_store || + type->opcode() != SpvOpTypeStruct || + objectType->opcode() != SpvOpTypeStruct) { + DIAG(pointerIndex) << "OpStore Pointer '" + << inst->words[pointerIndex] + << "'s type does not match Object '" + << object->id() << "'s type."; + return false; + } + + // TODO: Check for layout compatible matricies and arrays as well. + if (!AreLayoutCompatibleStructs(type, objectType)) { + DIAG(pointerIndex) << "OpStore Pointer '" + << inst->words[pointerIndex] + << "'s layout does not match Object '" + << object->id() << "'s layout."; + return false; + } + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto targetIndex = 1; + auto target = module_.FindDef(inst->words[targetIndex]); + if (!target) return false; + auto sourceIndex = 2; + auto source = module_.FindDef(inst->words[sourceIndex]); + if (!source) return false; + auto targetPointerType = module_.FindDef(target->type_id()); + assert(targetPointerType); + auto targetType = module_.FindDef(targetPointerType->words()[3]); + assert(targetType); + auto sourcePointerType = module_.FindDef(source->type_id()); + assert(sourcePointerType); + auto sourceType = module_.FindDef(sourcePointerType->words()[3]); + assert(sourceType); + if (targetType->id() != sourceType->id()) { + DIAG(sourceIndex) << "OpCopyMemory Target '" + << inst->words[sourceIndex] + << "'s type does not match Source '" + << sourceType->id() << "'s type."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto targetIndex = 1; + auto target = module_.FindDef(inst->words[targetIndex]); + if (!target) return false; + auto sourceIndex = 2; + auto source = module_.FindDef(inst->words[sourceIndex]); + if (!source) return false; + auto sizeIndex = 3; + auto size = module_.FindDef(inst->words[sizeIndex]); + if (!size) return false; + auto targetPointerType = module_.FindDef(target->type_id()); + if (!targetPointerType || SpvOpTypePointer != targetPointerType->opcode()) { + DIAG(targetIndex) << "OpCopyMemorySized Target '" + << inst->words[targetIndex] << "' is not a pointer."; + return false; + } + auto sourcePointerType = module_.FindDef(source->type_id()); + if (!sourcePointerType || SpvOpTypePointer != sourcePointerType->opcode()) { + DIAG(sourceIndex) << "OpCopyMemorySized Source '" + << inst->words[sourceIndex] << "' is not a pointer."; + return false; + } + switch (size->opcode()) { + // TODO: The following opcode's are assumed to be valid, refer to the + // following bug https://cvs.khronos.org/bugzilla/show_bug.cgi?id=13871 for + // clarification + case SpvOpConstant: + case SpvOpSpecConstant: { + auto sizeType = module_.FindDef(size->type_id()); + assert(sizeType); + if (SpvOpTypeInt != sizeType->opcode()) { + DIAG(sizeIndex) << "OpCopyMemorySized Size '" + << inst->words[sizeIndex] + << "'s type is not an integer type."; + return false; + } + } break; + case SpvOpVariable: { + auto pointerType = module_.FindDef(size->type_id()); + assert(pointerType); + auto sizeType = module_.FindDef(pointerType->type_id()); + if (!sizeType || SpvOpTypeInt != sizeType->opcode()) { + DIAG(sizeIndex) << "OpCopyMemorySized Size '" + << inst->words[sizeIndex] + << "'s variable type is not an integer type."; + return false; + } + } break; + default: + DIAG(sizeIndex) << "OpCopyMemorySized Size '" + << inst->words[sizeIndex] + << "' is not a constant or variable."; + return false; + } + // TODO: Check that consant is a least size 1, see the same bug as above for + // clarification? + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + std::string instr_name = + "Op" + std::string(spvOpcodeString(static_cast(inst->opcode))); + + // The result type must be OpTypePointer. Result Type is at word 1. + auto resultTypeIndex = 1; + auto resultTypeInstr = module_.FindDef(inst->words[resultTypeIndex]); + if (SpvOpTypePointer != resultTypeInstr->opcode()) { + DIAG(resultTypeIndex) << "The Result Type of " << instr_name << " '" + << inst->words[2] + << "' must be OpTypePointer. Found Op" + << spvOpcodeString( + static_cast(resultTypeInstr->opcode())) + << "."; + return false; + } + + // Result type is a pointer. Find out what it's pointing to. + // This will be used to make sure the indexing results in the same type. + // OpTypePointer word 3 is the type being pointed to. + auto resultTypePointedTo = module_.FindDef(resultTypeInstr->word(3)); + + // Base must be a pointer, pointing to the base of a composite object. + auto baseIdIndex = 3; + auto baseInstr = module_.FindDef(inst->words[baseIdIndex]); + auto baseTypeInstr = module_.FindDef(baseInstr->type_id()); + if (!baseTypeInstr || SpvOpTypePointer != baseTypeInstr->opcode()) { + DIAG(baseIdIndex) << "The Base '" << inst->words[baseIdIndex] + << "' in " << instr_name + << " instruction must be a pointer."; + return false; + } + + // The result pointer storage class and base pointer storage class must match. + // Word 2 of OpTypePointer is the Storage Class. + auto resultTypeStorageClass = resultTypeInstr->word(2); + auto baseTypeStorageClass = baseTypeInstr->word(2); + if (resultTypeStorageClass != baseTypeStorageClass) { + DIAG(resultTypeIndex) << "The result pointer storage class and base " + "pointer storage class in " + << instr_name << " do not match."; + return false; + } + + // The type pointed to by OpTypePointer (word 3) must be a composite type. + auto typePointedTo = module_.FindDef(baseTypeInstr->word(3)); + + // Check Universal Limit (SPIR-V Spec. Section 2.17). + // The number of indexes passed to OpAccessChain may not exceed 255 + // The instruction includes 4 words + N words (for N indexes) + const size_t num_indexes = inst->words.size() - 4; + const size_t num_indexes_limit = + module_.options()->universal_limits_.max_access_chain_indexes; + if (num_indexes > num_indexes_limit) { + DIAG(resultTypeIndex) << "The number of indexes in " << instr_name + << " may not exceed " << num_indexes_limit + << ". Found " << num_indexes << " indexes."; + return false; + } + // Indexes walk the type hierarchy to the desired depth, potentially down to + // scalar granularity. The first index in Indexes will select the top-level + // member/element/component/element of the base composite. All composite + // constituents use zero-based numbering, as described by their OpType... + // instruction. The second index will apply similarly to that result, and so + // on. Once any non-composite type is reached, there must be no remaining + // (unused) indexes. + for (size_t i = 4; i < inst->words.size(); ++i) { + const uint32_t cur_word = inst->words[i]; + // Earlier ID checks ensure that cur_word definition exists. + auto cur_word_instr = module_.FindDef(cur_word); + // The index must be a scalar integer type (See OpAccessChain in the Spec.) + auto indexTypeInstr = module_.FindDef(cur_word_instr->type_id()); + if (!indexTypeInstr || SpvOpTypeInt != indexTypeInstr->opcode()) { + DIAG(i) << "Indexes passed to " << instr_name + << " must be of type integer."; + return false; + } + switch (typePointedTo->opcode()) { + case SpvOpTypeMatrix: + case SpvOpTypeVector: + case SpvOpTypeArray: + case SpvOpTypeRuntimeArray: { + // In OpTypeMatrix, OpTypeVector, OpTypeArray, and OpTypeRuntimeArray, + // word 2 is the Element Type. + typePointedTo = module_.FindDef(typePointedTo->word(2)); + break; + } + case SpvOpTypeStruct: { + // In case of structures, there is an additional constraint on the + // index: the index must be an OpConstant. + if (SpvOpConstant != cur_word_instr->opcode()) { + DIAG(i) << "The passed to " << instr_name + << " to index into a " + "structure must be an OpConstant."; + return false; + } + // Get the index value from the OpConstant (word 3 of OpConstant). + // OpConstant could be a signed integer. But it's okay to treat it as + // unsigned because a negative constant int would never be seen as + // correct as a struct offset, since structs can't have more than 2 + // billion members. + const uint32_t cur_index = cur_word_instr->word(3); + // The index points to the struct member we want, therefore, the index + // should be less than the number of struct members. + const uint32_t num_struct_members = + static_cast(typePointedTo->words().size() - 2); + if (cur_index >= num_struct_members) { + DIAG(i) << "Index is out of bounds: " << instr_name + << " can not find index " << cur_index + << " into the structure '" << typePointedTo->id() + << "'. This structure has " << num_struct_members + << " members. Largest valid index is " + << num_struct_members - 1 << "."; + return false; + } + // Struct members IDs start at word 2 of OpTypeStruct. + auto structMemberId = typePointedTo->word(cur_index + 2); + typePointedTo = module_.FindDef(structMemberId); + break; + } + default: { + // Give an error. reached non-composite type while indexes still remain. + DIAG(i) << instr_name + << " reached non-composite type while indexes " + "still remain to be traversed."; + return false; + } + } + } + // At this point, we have fully walked down from the base using the indeces. + // The type being pointed to should be the same as the result type. + if (typePointedTo->id() != resultTypePointedTo->id()) { + DIAG(resultTypeIndex) + << instr_name << " result type (Op" + << spvOpcodeString(static_cast(resultTypePointedTo->opcode())) + << ") does not match the type that results from indexing into the base " + " (Op" + << spvOpcodeString(static_cast(typePointedTo->opcode())) << ")."; + return false; + } + + return true; +} + +template <> +bool idUsage::isValid( + const spv_instruction_t* inst, const spv_opcode_desc opcodeEntry) { + return isValid(inst, opcodeEntry); +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc opcodeEntry) { + // OpPtrAccessChain's validation rules are similar to OpAccessChain, with one + // difference: word 4 must be id of an integer (Element ). + // The grammar guarantees that there are at least 5 words in the instruction + // (i.e. if there are fewer than 5 words, the SPIR-V code will not compile.) + int elem_index = 4; + // We can remove the Element from the instruction words, and simply call + // the validation code of OpAccessChain. + spv_instruction_t new_inst = *inst; + new_inst.words.erase(new_inst.words.begin() + elem_index); + return isValid(&new_inst, opcodeEntry); +} + +template <> +bool idUsage::isValid( + const spv_instruction_t* inst, const spv_opcode_desc opcodeEntry) { + // Has the same validation rules as OpPtrAccessChain + return isValid(inst, opcodeEntry); +} + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto resultTypeIndex = 1; + auto resultType = module_.FindDef(inst->words[resultTypeIndex]); + if (!resultType) return false; + auto functionTypeIndex = 4; + auto functionType = module_.FindDef(inst->words[functionTypeIndex]); + if (!functionType || SpvOpTypeFunction != functionType->opcode()) { + DIAG(functionTypeIndex) + << "OpFunction Function Type '" << inst->words[functionTypeIndex] + << "' is not a function type."; + return false; + } + auto returnType = module_.FindDef(functionType->words()[2]); + assert(returnType); + if (returnType->id() != resultType->id()) { + DIAG(resultTypeIndex) << "OpFunction Result Type '" + << inst->words[resultTypeIndex] + << "' does not match the Function Type '" + << resultType->id() << "'s return type."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto resultTypeIndex = 1; + auto resultType = module_.FindDef(inst->words[resultTypeIndex]); + if (!resultType) return false; + // NOTE: Find OpFunction & ensure OpFunctionParameter is not out of place. + size_t paramIndex = 0; + assert(firstInst < inst && "Invalid instruction pointer"); + while (firstInst != --inst) { + if (SpvOpFunction == inst->opcode) { + break; + } else if (SpvOpFunctionParameter == inst->opcode) { + paramIndex++; + } + } + auto functionType = module_.FindDef(inst->words[4]); + assert(functionType); + if (paramIndex >= functionType->words().size() - 3) { + DIAG(0) << "Too many OpFunctionParameters for " << inst->words[2] + << ": expected " << functionType->words().size() - 3 + << " based on the function's type"; + return false; + } + auto paramType = module_.FindDef(functionType->words()[paramIndex + 3]); + assert(paramType); + if (resultType->id() != paramType->id()) { + DIAG(resultTypeIndex) << "OpFunctionParameter Result Type '" + << inst->words[resultTypeIndex] + << "' does not match the OpTypeFunction parameter " + "type of the same index."; + return false; + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto resultTypeIndex = 1; + auto resultType = module_.FindDef(inst->words[resultTypeIndex]); + if (!resultType) return false; + auto functionIndex = 3; + auto function = module_.FindDef(inst->words[functionIndex]); + if (!function || SpvOpFunction != function->opcode()) { + DIAG(functionIndex) << "OpFunctionCall Function '" + << inst->words[functionIndex] << "' is not a function."; + return false; + } + auto returnType = module_.FindDef(function->type_id()); + assert(returnType); + if (returnType->id() != resultType->id()) { + DIAG(resultTypeIndex) << "OpFunctionCall Result Type '" + << inst->words[resultTypeIndex] + << "'s type does not match Function '" + << returnType->id() << "'s return type."; + return false; + } + auto functionType = module_.FindDef(function->words()[4]); + assert(functionType); + auto functionCallArgCount = inst->words.size() - 4; + auto functionParamCount = functionType->words().size() - 3; + if (functionParamCount != functionCallArgCount) { + DIAG(inst->words.size() - 1) + << "OpFunctionCall Function 's parameter count does not match " + "the argument count."; + return false; + } + for (size_t argumentIndex = 4, paramIndex = 3; + argumentIndex < inst->words.size(); argumentIndex++, paramIndex++) { + auto argument = module_.FindDef(inst->words[argumentIndex]); + if (!argument) return false; + auto argumentType = module_.FindDef(argument->type_id()); + assert(argumentType); + auto parameterType = module_.FindDef(functionType->words()[paramIndex]); + assert(parameterType); + if (argumentType->id() != parameterType->id()) { + DIAG(argumentIndex) << "OpFunctionCall Argument '" + << inst->words[argumentIndex] + << "'s type does not match Function '" + << parameterType->id() << "'s parameter type."; + return false; + } + } + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto instr_name = [&inst]() { + std::string name = + "Op" + std::string(spvOpcodeString(static_cast(inst->opcode))); + return name; + }; + + // Result Type must be an OpTypeVector. + auto resultTypeIndex = 1; + auto resultType = module_.FindDef(inst->words[resultTypeIndex]); + if (!resultType || resultType->opcode() != SpvOpTypeVector) { + DIAG(resultTypeIndex) << "The Result Type of " << instr_name() + << " must be OpTypeVector. Found Op" + << spvOpcodeString( + static_cast(resultType->opcode())) + << "."; + return false; + } + + // The number of components in Result Type must be the same as the number of + // Component operands. + auto componentCount = inst->words.size() - 5; + auto vectorComponentCountIndex = 3; + auto resultVectorDimension = resultType->words()[vectorComponentCountIndex]; + if (componentCount != resultVectorDimension) { + DIAG(inst->words.size() - 1) + << instr_name() + << " component literals count does not match " + "Result Type '" + << resultType->id() << "'s vector component count."; + return false; + } + + // Vector 1 and Vector 2 must both have vector types, with the same Component + // Type as Result Type. + auto vector1Index = 3; + auto vector1Object = module_.FindDef(inst->words[vector1Index]); + auto vector1Type = module_.FindDef(vector1Object->type_id()); + auto vector2Index = 4; + auto vector2Object = module_.FindDef(inst->words[vector2Index]); + auto vector2Type = module_.FindDef(vector2Object->type_id()); + if (!vector1Type || vector1Type->opcode() != SpvOpTypeVector) { + DIAG(vector1Index) << "The type of Vector 1 must be OpTypeVector."; + return false; + } + if (!vector2Type || vector2Type->opcode() != SpvOpTypeVector) { + DIAG(vector2Index) << "The type of Vector 2 must be OpTypeVector."; + return false; + } + auto vectorComponentTypeIndex = 2; + auto resultComponentType = resultType->words()[vectorComponentTypeIndex]; + auto vector1ComponentType = vector1Type->words()[vectorComponentTypeIndex]; + if (vector1ComponentType != resultComponentType) { + DIAG(vector1Index) << "The Component Type of Vector 1 must be the same " + "as ResultType."; + return false; + } + auto vector2ComponentType = vector2Type->words()[vectorComponentTypeIndex]; + if (vector2ComponentType != resultComponentType) { + DIAG(vector2Index) << "The Component Type of Vector 2 must be the same " + "as ResultType."; + return false; + } + + // All Component literals must either be FFFFFFFF or in [0, N - 1]. + auto vector1ComponentCount = vector1Type->words()[vectorComponentCountIndex]; + auto vector2ComponentCount = vector2Type->words()[vectorComponentCountIndex]; + auto N = vector1ComponentCount + vector2ComponentCount; + auto firstLiteralIndex = 5; + for (size_t i = firstLiteralIndex; i < inst->words.size(); ++i) { + auto literal = inst->words[i]; + if (literal != 0xFFFFFFFF && literal >= N) { + DIAG(i) << "Component literal value " << literal << " is greater than " + << N - 1 << "."; + return false; + } + } + + return true; +} + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc /*opcodeEntry*/) { + auto thisInst = module_.FindDef(inst->words[2]); + SpvOp typeOp = module_.GetIdOpcode(thisInst->type_id()); + if (!spvOpcodeGeneratesType(typeOp)) { + DIAG(0) << "OpPhi's type " << module_.getIdName(thisInst->type_id()) + << " is not a type instruction."; + return false; + } + + auto block = thisInst->block(); + size_t numInOps = inst->words.size() - 3; + if (numInOps % 2 != 0) { + DIAG(0) << "OpPhi does not have an equal number of incoming values and " + "basic blocks."; + return false; + } + + // Create a uniqued vector of predecessor ids for comparison against + // incoming values. OpBranchConditional %cond %label %label produces two + // predecessors in the CFG. + std::vector predIds; + std::transform(block->predecessors()->begin(), block->predecessors()->end(), + std::back_inserter(predIds), + [](const libspirv::BasicBlock* b) { return b->id(); }); + std::sort(predIds.begin(), predIds.end()); + predIds.erase(std::unique(predIds.begin(), predIds.end()), predIds.end()); + + size_t numEdges = numInOps / 2; + if (numEdges != predIds.size()) { + DIAG(0) << "OpPhi's number of incoming blocks (" << numEdges + << ") does not match block's predecessor count (" + << block->predecessors()->size() << ")."; + return false; + } + + for (size_t i = 3; i < inst->words.size(); ++i) { + auto incId = inst->words[i]; + if (i % 2 == 1) { + // Incoming value type must match the phi result type. + auto incTypeId = module_.GetTypeId(incId); + if (thisInst->type_id() != incTypeId) { + DIAG(i) << "OpPhi's result type " + << module_.getIdName(thisInst->type_id()) + << " does not match incoming value " + << module_.getIdName(incId) << " type " + << module_.getIdName(incTypeId) << "."; + return false; + } + } else { + if (module_.GetIdOpcode(incId) != SpvOpLabel) { + DIAG(i) << "OpPhi's incoming basic block " + << module_.getIdName(incId) << " is not an OpLabel."; + return false; + } + + // Incoming basic block must be an immediate predecessor of the phi's + // block. + if (!std::binary_search(predIds.begin(), predIds.end(), incId)) { + DIAG(i) << "OpPhi's incoming basic block " + << module_.getIdName(incId) << " is not a predecessor of " + << module_.getIdName(block->id()) << "."; + return false; + } + } + } + + return true; +} + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + const size_t numOperands = inst->words.size() - 1; + const size_t condOperandIndex = 1; + const size_t targetTrueIndex = 2; + const size_t targetFalseIndex = 3; + + // num_operands is either 3 or 5 --- if 5, the last two need to be literal + // integers + if (numOperands != 3 && numOperands != 5) { + DIAG(0) << "OpBranchConditional requires either 3 or 5 parameters"; + return false; + } + + bool ret = true; + + // grab the condition operand and check that it is a bool + const auto condOp = module_.FindDef(inst->words[condOperandIndex]); + if (!condOp || !module_.IsBoolScalarType(condOp->type_id())) { + DIAG(0) + << "Condition operand for OpBranchConditional must be of boolean type"; + ret = false; + } + + // target operands must be OpLabel + // note that we don't need to check that the target labels are in the same + // function, + // PerformCfgChecks already checks for that + const auto targetOpTrue = module_.FindDef(inst->words[targetTrueIndex]); + if (!targetOpTrue || SpvOpLabel != targetOpTrue->opcode()) { + DIAG(0) << "The 'True Label' operand for OpBranchConditional must be the " + "ID of an OpLabel instruction"; + ret = false; + } + + const auto targetOpFalse = module_.FindDef(inst->words[targetFalseIndex]); + if (!targetOpFalse || SpvOpLabel != targetOpFalse->opcode()) { + DIAG(0) << "The 'False Label' operand for OpBranchConditional must be the " + "ID of an OpLabel instruction"; + ret = false; + } + + return ret; +} + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +template <> +bool idUsage::isValid(const spv_instruction_t* inst, + const spv_opcode_desc) { + auto valueIndex = 1; + auto value = module_.FindDef(inst->words[valueIndex]); + if (!value || !value->type_id()) { + DIAG(valueIndex) << "OpReturnValue Value '" << inst->words[valueIndex] + << "' does not represent a value."; + return false; + } + auto valueType = module_.FindDef(value->type_id()); + if (!valueType || SpvOpTypeVoid == valueType->opcode()) { + DIAG(valueIndex) << "OpReturnValue value's type '" << value->type_id() + << "' is missing or void."; + return false; + } + + const bool uses_variable_pointer = + module_.features().variable_pointers || + module_.features().variable_pointers_storage_buffer; + + if (addressingModel == SpvAddressingModelLogical && + SpvOpTypePointer == valueType->opcode() && !uses_variable_pointer && + !module_.options()->relax_logcial_pointer) { + DIAG(valueIndex) + << "OpReturnValue value's type '" << value->type_id() + << "' is a pointer, which is invalid in the Logical addressing model."; + return false; + } + + // NOTE: Find OpFunction + const spv_instruction_t* function = inst - 1; + while (firstInst != function) { + if (SpvOpFunction == function->opcode) break; + function--; + } + if (SpvOpFunction != function->opcode) { + DIAG(valueIndex) << "OpReturnValue is not in a basic block."; + return false; + } + auto returnType = module_.FindDef(function->words[1]); + if (!returnType || returnType->id() != valueType->id()) { + DIAG(valueIndex) << "OpReturnValue Value '" << inst->words[valueIndex] + << "'s type does not match OpFunction's return type."; + return false; + } + return true; +} + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) { +} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) { +} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) { +} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid(const spv_instruction_t *inst, + const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#if 0 +template <> +bool idUsage::isValid( + const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} +#endif + +#undef DIAG + +bool idUsage::isValid(const spv_instruction_t* inst) { + spv_opcode_desc opcodeEntry = nullptr; + if (spvOpcodeTableValueLookup(targetEnv, opcodeTable, inst->opcode, + &opcodeEntry)) + return false; +#define CASE(OpCode) \ + case Spv##OpCode: \ + return isValid(inst, opcodeEntry); +#define TODO(OpCode) \ + case Spv##OpCode: \ + return true; + switch (inst->opcode) { + TODO(OpUndef) + CASE(OpMemberName) + CASE(OpLine) + CASE(OpDecorate) + CASE(OpMemberDecorate) + CASE(OpDecorationGroup) + CASE(OpGroupDecorate) + CASE(OpGroupMemberDecorate) + TODO(OpExtInst) + CASE(OpEntryPoint) + CASE(OpExecutionMode) + CASE(OpTypeVector) + CASE(OpTypeMatrix) + CASE(OpTypeSampler) + CASE(OpTypeArray) + CASE(OpTypeRuntimeArray) + CASE(OpTypeStruct) + CASE(OpTypePointer) + CASE(OpTypeFunction) + CASE(OpTypePipe) + CASE(OpConstantTrue) + CASE(OpConstantFalse) + CASE(OpConstantComposite) + CASE(OpConstantSampler) + CASE(OpConstantNull) + CASE(OpSpecConstantTrue) + CASE(OpSpecConstantFalse) + CASE(OpSpecConstantComposite) + CASE(OpSampledImage) + TODO(OpSpecConstantOp) + CASE(OpVariable) + CASE(OpLoad) + CASE(OpStore) + CASE(OpCopyMemory) + CASE(OpCopyMemorySized) + CASE(OpAccessChain) + CASE(OpInBoundsAccessChain) + CASE(OpPtrAccessChain) + CASE(OpInBoundsPtrAccessChain) + TODO(OpArrayLength) + TODO(OpGenericPtrMemSemantics) + CASE(OpFunction) + CASE(OpFunctionParameter) + CASE(OpFunctionCall) + // Conversion opcodes are validated in validate_conversion.cpp. + CASE(OpVectorShuffle) + // Other composite opcodes are validated in validate_composites.cpp. + // Arithmetic opcodes are validated in validate_arithmetics.cpp. + // Bitwise opcodes are validated in validate_bitwise.cpp. + // Logical opcodes are validated in validate_logicals.cpp. + // Derivative opcodes are validated in validate_derivatives.cpp. + CASE(OpPhi) + TODO(OpLoopMerge) + TODO(OpSelectionMerge) + TODO(OpBranch) + CASE(OpBranchConditional) + TODO(OpSwitch) + CASE(OpReturnValue) + TODO(OpLifetimeStart) + TODO(OpLifetimeStop) + TODO(OpAtomicLoad) + TODO(OpAtomicStore) + TODO(OpAtomicExchange) + TODO(OpAtomicCompareExchange) + TODO(OpAtomicCompareExchangeWeak) + TODO(OpAtomicIIncrement) + TODO(OpAtomicIDecrement) + TODO(OpAtomicIAdd) + TODO(OpAtomicISub) + TODO(OpAtomicUMin) + TODO(OpAtomicUMax) + TODO(OpAtomicAnd) + TODO(OpAtomicOr) + TODO(OpAtomicSMin) + TODO(OpAtomicSMax) + TODO(OpEmitStreamVertex) + TODO(OpEndStreamPrimitive) + TODO(OpGroupAsyncCopy) + TODO(OpGroupWaitEvents) + TODO(OpGroupAll) + TODO(OpGroupAny) + TODO(OpGroupBroadcast) + TODO(OpGroupIAdd) + TODO(OpGroupFAdd) + TODO(OpGroupFMin) + TODO(OpGroupUMin) + TODO(OpGroupSMin) + TODO(OpGroupFMax) + TODO(OpGroupUMax) + TODO(OpGroupSMax) + TODO(OpEnqueueMarker) + TODO(OpEnqueueKernel) + TODO(OpGetKernelNDrangeSubGroupCount) + TODO(OpGetKernelNDrangeMaxSubGroupSize) + TODO(OpGetKernelWorkGroupSize) + TODO(OpGetKernelPreferredWorkGroupSizeMultiple) + TODO(OpRetainEvent) + TODO(OpReleaseEvent) + TODO(OpCreateUserEvent) + TODO(OpIsValidEvent) + TODO(OpSetUserEventStatus) + TODO(OpCaptureEventProfilingInfo) + TODO(OpGetDefaultQueue) + TODO(OpBuildNDRange) + TODO(OpReadPipe) + TODO(OpWritePipe) + TODO(OpReservedReadPipe) + TODO(OpReservedWritePipe) + TODO(OpReserveReadPipePackets) + TODO(OpReserveWritePipePackets) + TODO(OpCommitReadPipe) + TODO(OpCommitWritePipe) + TODO(OpIsValidReserveId) + TODO(OpGetNumPipePackets) + TODO(OpGetMaxPipePackets) + TODO(OpGroupReserveReadPipePackets) + TODO(OpGroupReserveWritePipePackets) + TODO(OpGroupCommitReadPipe) + TODO(OpGroupCommitWritePipe) + default: + return true; + } +#undef TODO +#undef CASE +} + +bool idUsage::AreLayoutCompatibleStructs(const libspirv::Instruction* type1, + const libspirv::Instruction* type2) { + if (type1->opcode() != SpvOpTypeStruct) { + return false; + } + if (type2->opcode() != SpvOpTypeStruct) { + return false; + } + + if (!HaveLayoutCompatibleMembers(type1, type2)) return false; + + return HaveSameLayoutDecorations(type1, type2); +} + +bool idUsage::HaveLayoutCompatibleMembers(const libspirv::Instruction* type1, + const libspirv::Instruction* type2) { + assert(type1->opcode() == SpvOpTypeStruct && + "type1 must be and OpTypeStruct instruction."); + assert(type2->opcode() == SpvOpTypeStruct && + "type2 must be and OpTypeStruct instruction."); + const auto& type1_operands = type1->operands(); + const auto& type2_operands = type2->operands(); + if (type1_operands.size() != type2_operands.size()) { + return false; + } + + for (size_t operand = 2; operand < type1_operands.size(); ++operand) { + if (type1->word(operand) != type2->word(operand)) { + auto def1 = module_.FindDef(type1->word(operand)); + auto def2 = module_.FindDef(type2->word(operand)); + if (!AreLayoutCompatibleStructs(def1, def2)) { + return false; + } + } + } + return true; +} + +bool idUsage::HaveSameLayoutDecorations(const libspirv::Instruction* type1, + const libspirv::Instruction* type2) { + assert(type1->opcode() == SpvOpTypeStruct && + "type1 must be and OpTypeStruct instruction."); + assert(type2->opcode() == SpvOpTypeStruct && + "type2 must be and OpTypeStruct instruction."); + const std::vector& type1_decorations = + module_.id_decorations(type1->id()); + const std::vector& type2_decorations = + module_.id_decorations(type2->id()); + + // TODO: Will have to add other check for arrays an matricies if we want to + // handle them. + if (HasConflictingMemberOffsets(type1_decorations, type2_decorations)) { + return false; + } + + return true; +} + +bool idUsage::HasConflictingMemberOffsets( + const vector& type1_decorations, + const vector& type2_decorations) const { + { + // We are interested in conflicting decoration. If a decoration is in one + // list but not the other, then we will assume the code is correct. We are + // looking for things we know to be wrong. + // + // We do not have to traverse type2_decoration because, after traversing + // type1_decorations, anything new will not be found in + // type1_decoration. Therefore, it cannot lead to a conflict. + for (const Decoration& decoration : type1_decorations) { + switch (decoration.dec_type()) { + case SpvDecorationOffset: { + // Since these affect the layout of the struct, they must be present + // in both structs. + auto compare = [&decoration](const Decoration& rhs) { + if (rhs.dec_type() != SpvDecorationOffset) return false; + return decoration.struct_member_index() == + rhs.struct_member_index(); + }; + auto i = find_if(type2_decorations.begin(), type2_decorations.end(), + compare); + if (i != type2_decorations.end() && + decoration.params().front() != i->params().front()) { + return true; + } + } break; + default: + // This decoration does not affect the layout of the structure, so + // just moving on. + break; + } + } + } + return false; +} +} // anonymous namespace + +namespace libspirv { + +spv_result_t UpdateIdUse(ValidationState_t& _) { + for (const auto& inst : _.ordered_instructions()) { + for (auto& operand : inst.operands()) { + const spv_operand_type_t& type = operand.type; + const uint32_t operand_id = inst.word(operand.offset); + if (spvIsIdType(type) && type != SPV_OPERAND_TYPE_RESULT_ID) { + if (auto def = _.FindDef(operand_id)) + def->RegisterUse(&inst, operand.offset); + } + } + } + return SPV_SUCCESS; +} + +/// This function checks all ID definitions dominate their use in the CFG. +/// +/// This function will iterate over all ID definitions that are defined in the +/// functions of a module and make sure that the definitions appear in a +/// block that dominates their use. +/// +/// NOTE: This function does NOT check module scoped functions which are +/// checked during the initial binary parse in the IdPass below +spv_result_t CheckIdDefinitionDominateUse(const ValidationState_t& _) { + unordered_set phi_instructions; + for (const auto& definition : _.all_definitions()) { + // Check only those definitions defined in a function + if (const Function* func = definition.second->function()) { + if (const BasicBlock* block = definition.second->block()) { + if (!block->reachable()) continue; + // If the Id is defined within a block then make sure all references to + // that Id appear in a blocks that are dominated by the defining block + for (auto& use_index_pair : definition.second->uses()) { + const Instruction* use = use_index_pair.first; + if (const BasicBlock* use_block = use->block()) { + if (use_block->reachable() == false) continue; + if (use->opcode() == SpvOpPhi) { + phi_instructions.insert(use); + } else if (!block->dominates(*use->block())) { + return _.diag(SPV_ERROR_INVALID_ID) + << "ID " << _.getIdName(definition.first) + << " defined in block " << _.getIdName(block->id()) + << " does not dominate its use in block " + << _.getIdName(use_block->id()); + } + } + } + } else { + // If the Ids defined within a function but not in a block(i.e. function + // parameters, block ids), then make sure all references to that Id + // appear within the same function + for (auto use : definition.second->uses()) { + const Instruction* inst = use.first; + if (inst->function() && inst->function() != func) { + return _.diag(SPV_ERROR_INVALID_ID) + << "ID " << _.getIdName(definition.first) + << " used in function " + << _.getIdName(inst->function()->id()) + << " is used outside of it's defining function " + << _.getIdName(func->id()); + } + } + } + } + // NOTE: Ids defined outside of functions must appear before they are used + // This check is being performed in the IdPass function + } + + // Check all OpPhi parent blocks are dominated by the variable's defining + // blocks + for (const Instruction* phi : phi_instructions) { + if (phi->block()->reachable() == false) continue; + for (size_t i = 3; i < phi->operands().size(); i += 2) { + const Instruction* variable = _.FindDef(phi->word(i)); + const BasicBlock* parent = + phi->function()->GetBlock(phi->word(i + 1)).first; + if (variable->block() && parent->reachable() && + !variable->block()->dominates(*parent)) { + return _.diag(SPV_ERROR_INVALID_ID) + << "In OpPhi instruction " << _.getIdName(phi->id()) << ", ID " + << _.getIdName(variable->id()) + << " definition does not dominate its parent " + << _.getIdName(parent->id()); + } + } + } + + return SPV_SUCCESS; +} + +// Performs SSA validation on the IDs of an instruction. The +// can_have_forward_declared_ids functor should return true if the +// instruction operand's ID can be forward referenced. +spv_result_t IdPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + auto can_have_forward_declared_ids = + spvOperandCanBeForwardDeclaredFunction(static_cast(inst->opcode)); + + // Keep track of a result id defined by this instruction. 0 means it + // does not define an id. + uint32_t result_id = 0; + + for (unsigned i = 0; i < inst->num_operands; i++) { + const spv_parsed_operand_t& operand = inst->operands[i]; + const spv_operand_type_t& type = operand.type; + // We only care about Id operands, which are a single word. + const uint32_t operand_word = inst->words[operand.offset]; + + auto ret = SPV_ERROR_INTERNAL; + switch (type) { + case SPV_OPERAND_TYPE_RESULT_ID: + // NOTE: Multiple Id definitions are being checked by the binary parser. + // + // Defer undefined-forward-reference removal until after we've analyzed + // the remaining operands to this instruction. Deferral only matters + // for + // OpPhi since it's the only case where it defines its own forward + // reference. Other instructions that can have forward references + // either don't define a value or the forward reference is to a function + // Id (and hence defined outside of a function body). + result_id = operand_word; + // NOTE: The result Id is added (in RegisterInstruction) *after* all of + // the other Ids have been checked to avoid premature use in the same + // instruction. + ret = SPV_SUCCESS; + break; + case SPV_OPERAND_TYPE_ID: + case SPV_OPERAND_TYPE_TYPE_ID: + case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: + case SPV_OPERAND_TYPE_SCOPE_ID: + if (_.IsDefinedId(operand_word)) { + ret = SPV_SUCCESS; + } else if (can_have_forward_declared_ids(i)) { + ret = _.ForwardDeclareId(operand_word); + } else { + ret = _.diag(SPV_ERROR_INVALID_ID) + << "ID " << _.getIdName(operand_word) + << " has not been defined"; + } + break; + default: + ret = SPV_SUCCESS; + break; + } + if (SPV_SUCCESS != ret) { + return ret; + } + } + if (result_id) { + _.RemoveIfForwardDeclared(result_id); + } + _.RegisterInstruction(*inst); + return SPV_SUCCESS; +} +} // namespace libspirv + +spv_result_t spvValidateInstructionIDs(const spv_instruction_t* pInsts, + const uint64_t instCount, + const libspirv::ValidationState_t& state, + spv_position position) { + idUsage idUsage(state.context(), pInsts, instCount, state.memory_model(), + state.addressing_model(), state, state.entry_points(), + position, state.context()->consumer); + for (uint64_t instIndex = 0; instIndex < instCount; ++instIndex) { + if (!idUsage.isValid(&pInsts[instIndex])) return SPV_ERROR_INVALID_ID; + position->index += pInsts[instIndex].words.size(); + } + return SPV_SUCCESS; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_image.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_image.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_image.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_image.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1670 @@ +// Copyright (c) 2017 Google 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. + +// Validates correctness of image instructions. + +#include "validate.h" + +#include "diagnostic.h" +#include "opcode.h" +#include "spirv_target_env.h" +#include "util/bitutils.h" +#include "val/instruction.h" +#include "val/validation_state.h" + +namespace libspirv { + +namespace { + +// Performs compile time check that all SpvImageOperandsXXX cases are handled in +// this module. If SpvImageOperandsXXX list changes, this function will fail the +// build. +// For all other purposes this is a dummy function. +bool CheckAllImageOperandsHandled() { + SpvImageOperandsMask enum_val = SpvImageOperandsBiasMask; + + // Some improvised code to prevent the compiler from considering enum_val + // constant and optimizing the switch away. + uint32_t stack_var = 0; + if (reinterpret_cast(&stack_var) % 256) + enum_val = SpvImageOperandsLodMask; + + switch (enum_val) { + // Please update the validation rules in this module if you are changing + // the list of image operands, and add new enum values to this switch. + case SpvImageOperandsMaskNone: + return false; + case SpvImageOperandsBiasMask: + case SpvImageOperandsLodMask: + case SpvImageOperandsGradMask: + case SpvImageOperandsConstOffsetMask: + case SpvImageOperandsOffsetMask: + case SpvImageOperandsConstOffsetsMask: + case SpvImageOperandsSampleMask: + case SpvImageOperandsMinLodMask: + return true; + } + return false; +} + +// Used by GetImageTypeInfo. See OpTypeImage spec for more information. +struct ImageTypeInfo { + uint32_t sampled_type = 0; + SpvDim dim = SpvDimMax; + uint32_t depth = 0; + uint32_t arrayed = 0; + uint32_t multisampled = 0; + uint32_t sampled = 0; + SpvImageFormat format = SpvImageFormatMax; + SpvAccessQualifier access_qualifier = SpvAccessQualifierMax; +}; + +// Provides information on image type. |id| should be object of either +// OpTypeImage or OpTypeSampledImage type. Returns false in case of failure +// (not a valid id, failed to parse the instruction, etc). +bool GetImageTypeInfo(const ValidationState_t& _, uint32_t id, + ImageTypeInfo* info) { + if (!id || !info) return false; + + const Instruction* inst = _.FindDef(id); + assert(inst); + + if (inst->opcode() == SpvOpTypeSampledImage) { + inst = _.FindDef(inst->word(2)); + assert(inst); + } + + if (inst->opcode() != SpvOpTypeImage) return false; + + const size_t num_words = inst->words().size(); + if (num_words != 9 && num_words != 10) return false; + + info->sampled_type = inst->word(2); + info->dim = static_cast(inst->word(3)); + info->depth = inst->word(4); + info->arrayed = inst->word(5); + info->multisampled = inst->word(6); + info->sampled = inst->word(7); + info->format = static_cast(inst->word(8)); + info->access_qualifier = num_words < 10 + ? SpvAccessQualifierMax + : static_cast(inst->word(9)); + return true; +} + +bool IsImplicitLod(SpvOp opcode) { + switch (opcode) { + case SpvOpImageSampleImplicitLod: + case SpvOpImageSampleDrefImplicitLod: + case SpvOpImageSampleProjImplicitLod: + case SpvOpImageSampleProjDrefImplicitLod: + case SpvOpImageSparseSampleImplicitLod: + case SpvOpImageSparseSampleDrefImplicitLod: + case SpvOpImageSparseSampleProjImplicitLod: + case SpvOpImageSparseSampleProjDrefImplicitLod: + return true; + default: + break; + }; + return false; +} + +bool IsExplicitLod(SpvOp opcode) { + switch (opcode) { + case SpvOpImageSampleExplicitLod: + case SpvOpImageSampleDrefExplicitLod: + case SpvOpImageSampleProjExplicitLod: + case SpvOpImageSampleProjDrefExplicitLod: + case SpvOpImageSparseSampleExplicitLod: + case SpvOpImageSparseSampleDrefExplicitLod: + case SpvOpImageSparseSampleProjExplicitLod: + case SpvOpImageSparseSampleProjDrefExplicitLod: + return true; + default: + break; + }; + return false; +} + +// Returns true if the opcode is a Image instruction which applies +// homogenous projection to the coordinates. +bool IsProj(SpvOp opcode) { + switch (opcode) { + case SpvOpImageSampleProjImplicitLod: + case SpvOpImageSampleProjDrefImplicitLod: + case SpvOpImageSparseSampleProjImplicitLod: + case SpvOpImageSparseSampleProjDrefImplicitLod: + case SpvOpImageSampleProjExplicitLod: + case SpvOpImageSampleProjDrefExplicitLod: + case SpvOpImageSparseSampleProjExplicitLod: + case SpvOpImageSparseSampleProjDrefExplicitLod: + return true; + default: + break; + }; + return false; +} + +// Returns the number of components in a coordinate used to access a texel in +// a single plane of an image with the given parameters. +uint32_t GetPlaneCoordSize(const ImageTypeInfo& info) { + uint32_t plane_size = 0; + // If this switch breaks your build, please add new values below. + switch (info.dim) { + case SpvDim1D: + case SpvDimBuffer: + plane_size = 1; + break; + case SpvDim2D: + case SpvDimRect: + case SpvDimSubpassData: + plane_size = 2; + break; + case SpvDim3D: + case SpvDimCube: + // For Cube direction vector is used instead of UV. + plane_size = 3; + break; + case SpvDimMax: + assert(0); + break; + } + + return plane_size; +} + +// Returns minimal number of coordinates based on image dim, arrayed and whether +// the instruction uses projection coordinates. +uint32_t GetMinCoordSize(SpvOp opcode, const ImageTypeInfo& info) { + if (info.dim == SpvDimCube && + (opcode == SpvOpImageRead || opcode == SpvOpImageWrite || + opcode == SpvOpImageSparseRead)) { + // These opcodes use UV for Cube, not direction vector. + return 3; + } + + return GetPlaneCoordSize(info) + info.arrayed + (IsProj(opcode) ? 1 : 0); +} + +// Checks ImageOperand bitfield and respective operands. +spv_result_t ValidateImageOperands(ValidationState_t& _, + const spv_parsed_instruction_t& inst, + const ImageTypeInfo& info, uint32_t mask, + uint32_t word_index) { + static const bool kAllImageOperandsHandled = CheckAllImageOperandsHandled(); + (void)kAllImageOperandsHandled; + + const SpvOp opcode = static_cast(inst.opcode); + const uint32_t num_words = inst.num_words; + + size_t expected_num_image_operand_words = spvutils::CountSetBits(mask); + if (mask & SpvImageOperandsGradMask) { + // Grad uses two words. + ++expected_num_image_operand_words; + } + + if (expected_num_image_operand_words != num_words - word_index) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Number of image operand ids doesn't correspond to the bit mask: " + << spvOpcodeString(opcode); + } + + if (spvutils::CountSetBits(mask & (SpvImageOperandsOffsetMask | + SpvImageOperandsConstOffsetMask | + SpvImageOperandsConstOffsetsMask)) > 1) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operands Offset, ConstOffset, ConstOffsets cannot be used " + << "together: " << spvOpcodeString(opcode); + }; + + const bool is_implicit_lod = IsImplicitLod(opcode); + const bool is_explicit_lod = IsExplicitLod(opcode); + + // The checks should be done in the order of definition of OperandImage. + + if (mask & SpvImageOperandsBiasMask) { + if (!is_implicit_lod) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operand Bias can only be used with ImplicitLod opcodes: " + << spvOpcodeString(opcode); + }; + + const uint32_t type_id = _.GetTypeId(inst.words[word_index++]); + if (!_.IsFloatScalarType(type_id)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image Operand Bias to be float scalar: " + << spvOpcodeString(opcode); + } + + if (info.dim != SpvDim1D && info.dim != SpvDim2D && info.dim != SpvDim3D && + info.dim != SpvDimCube) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operand Bias requires 'Dim' parameter to be 1D, 2D, 3D " + "or " + << "Cube: " << spvOpcodeString(opcode); + } + + if (info.multisampled != 0) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operand Bias requires 'MS' parameter to be 0: " + << spvOpcodeString(opcode); + } + } + + if (mask & SpvImageOperandsLodMask) { + if (!is_explicit_lod && opcode != SpvOpImageFetch && + opcode != SpvOpImageSparseFetch) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operand Lod can only be used with ExplicitLod opcodes " + << "and OpImageFetch: " << spvOpcodeString(opcode); + }; + + if (mask & SpvImageOperandsGradMask) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operand bits Lod and Grad cannot be set at the same " + "time: " + << spvOpcodeString(opcode); + } + + const uint32_t type_id = _.GetTypeId(inst.words[word_index++]); + if (is_explicit_lod) { + if (!_.IsFloatScalarType(type_id)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image Operand Lod to be float scalar when used " + << "with ExplicitLod: " << spvOpcodeString(opcode); + } + } else { + if (!_.IsIntScalarType(type_id)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image Operand Lod to be int scalar when used with " + << "OpImageFetch"; + } + } + + if (info.dim != SpvDim1D && info.dim != SpvDim2D && info.dim != SpvDim3D && + info.dim != SpvDimCube) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operand Lod requires 'Dim' parameter to be 1D, 2D, 3D " + "or " + << "Cube: " << spvOpcodeString(opcode); + } + + if (info.multisampled != 0) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operand Lod requires 'MS' parameter to be 0: " + << spvOpcodeString(opcode); + } + } + + if (mask & SpvImageOperandsGradMask) { + if (!is_explicit_lod) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operand Grad can only be used with ExplicitLod opcodes: " + << spvOpcodeString(opcode); + }; + + const uint32_t dx_type_id = _.GetTypeId(inst.words[word_index++]); + const uint32_t dy_type_id = _.GetTypeId(inst.words[word_index++]); + if (!_.IsFloatScalarOrVectorType(dx_type_id) || + !_.IsFloatScalarOrVectorType(dy_type_id)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected both Image Operand Grad ids to be float scalars or " + << "vectors: " << spvOpcodeString(opcode); + } + + const uint32_t plane_size = GetPlaneCoordSize(info); + const uint32_t dx_size = _.GetDimension(dx_type_id); + const uint32_t dy_size = _.GetDimension(dy_type_id); + if (plane_size != dx_size) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image Operand Grad dx to have " << plane_size + << " components, but given " << dx_size << ": " + << spvOpcodeString(opcode); + } + + if (plane_size != dy_size) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image Operand Grad dy to have " << plane_size + << " components, but given " << dy_size << ": " + << spvOpcodeString(opcode); + } + + if (info.multisampled != 0) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operand Grad requires 'MS' parameter to be 0: " + << spvOpcodeString(opcode); + } + } + + if (mask & SpvImageOperandsConstOffsetMask) { + if (info.dim == SpvDimCube) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operand ConstOffset cannot be used with Cube Image " + "'Dim': " + << spvOpcodeString(opcode); + } + + const uint32_t id = inst.words[word_index++]; + const uint32_t type_id = _.GetTypeId(id); + if (!_.IsIntScalarOrVectorType(type_id)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image Operand ConstOffset to be int scalar or " + << "vector: " << spvOpcodeString(opcode); + } + + if (!spvOpcodeIsConstant(_.GetIdOpcode(id))) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image Operand ConstOffset to be a const object: " + << spvOpcodeString(opcode); + } + + const uint32_t plane_size = GetPlaneCoordSize(info); + const uint32_t offset_size = _.GetDimension(type_id); + if (plane_size != offset_size) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image Operand ConstOffset to have " << plane_size + << " components, but given " << offset_size << ": " + << spvOpcodeString(opcode); + } + } + + if (mask & SpvImageOperandsOffsetMask) { + if (info.dim == SpvDimCube) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operand Offset cannot be used with Cube Image 'Dim': " + << spvOpcodeString(opcode); + } + + const uint32_t id = inst.words[word_index++]; + const uint32_t type_id = _.GetTypeId(id); + if (!_.IsIntScalarOrVectorType(type_id)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image Operand Offset to be int scalar or " + << "vector: " << spvOpcodeString(opcode); + } + + const uint32_t plane_size = GetPlaneCoordSize(info); + const uint32_t offset_size = _.GetDimension(type_id); + if (plane_size != offset_size) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image Operand Offset to have " << plane_size + << " components, but given " << offset_size << ": " + << spvOpcodeString(opcode); + } + } + + if (mask & SpvImageOperandsConstOffsetsMask) { + if (opcode != SpvOpImageGather && opcode != SpvOpImageDrefGather && + opcode != SpvOpImageSparseGather && + opcode != SpvOpImageSparseDrefGather) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operand ConstOffsets can only be used with " + "OpImageGather " + << "and OpImageDrefGather: " << spvOpcodeString(opcode); + } + + if (info.dim == SpvDimCube) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operand ConstOffsets cannot be used with Cube Image " + "'Dim': " + << spvOpcodeString(opcode); + } + + const uint32_t id = inst.words[word_index++]; + const uint32_t type_id = _.GetTypeId(id); + const Instruction* type_inst = _.FindDef(type_id); + assert(type_inst); + + if (type_inst->opcode() != SpvOpTypeArray) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image Operand ConstOffsets to be an array of size 4: " + << spvOpcodeString(opcode); + } + + uint64_t array_size = 0; + if (!_.GetConstantValUint64(type_inst->word(3), &array_size)) { + assert(0 && "Array type definition is corrupt"); + } + + if (array_size != 4) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image Operand ConstOffsets to be an array of size 4: " + << spvOpcodeString(opcode); + } + + const uint32_t component_type = type_inst->word(2); + if (!_.IsIntVectorType(component_type) || + _.GetDimension(component_type) != 2) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image Operand ConstOffsets array componenets to be " + "int " + << "vectors of size 2: " << spvOpcodeString(opcode); + } + + if (!spvOpcodeIsConstant(_.GetIdOpcode(id))) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image Operand ConstOffsets to be a const object: " + << spvOpcodeString(opcode); + } + } + + if (mask & SpvImageOperandsSampleMask) { + if (opcode != SpvOpImageFetch && opcode != SpvOpImageRead && + opcode != SpvOpImageWrite && opcode != SpvOpImageSparseFetch && + opcode != SpvOpImageSparseRead) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operand Sample can only be used with OpImageFetch, " + << "OpImageRead, OpImageWrite, OpImageSparseFetch and " + << "OpImageSparseRead: " << spvOpcodeString(opcode); + } + + if (info.multisampled == 0) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operand Sample requires non-zero 'MS' parameter: " + << spvOpcodeString(opcode); + } + + const uint32_t type_id = _.GetTypeId(inst.words[word_index++]); + if (!_.IsIntScalarType(type_id)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image Operand Sample to be int scalar: " + << spvOpcodeString(opcode); + } + } + + if (mask & SpvImageOperandsMinLodMask) { + if (!is_implicit_lod && !(mask & SpvImageOperandsGradMask)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operand MinLod can only be used with ImplicitLod " + << "opcodes or together with Image Operand Grad: " + << spvOpcodeString(opcode); + }; + + const uint32_t type_id = _.GetTypeId(inst.words[word_index++]); + if (!_.IsFloatScalarType(type_id)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image Operand MinLod to be float scalar: " + << spvOpcodeString(opcode); + } + + if (info.dim != SpvDim1D && info.dim != SpvDim2D && info.dim != SpvDim3D && + info.dim != SpvDimCube) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operand MinLod requires 'Dim' parameter to be 1D, 2D, " + "3D " + << "or Cube: " << spvOpcodeString(opcode); + } + + if (info.multisampled != 0) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Operand MinLod requires 'MS' parameter to be 0: " + << spvOpcodeString(opcode); + } + } + + return SPV_SUCCESS; +} + +// Checks some of the validation rules which are common to multiple opcodes. +spv_result_t ValidateImageCommon(ValidationState_t& _, + const spv_parsed_instruction_t& inst, + const ImageTypeInfo& info) { + const SpvOp opcode = static_cast(inst.opcode); + if (IsProj(opcode)) { + if (info.dim != SpvDim1D && info.dim != SpvDim2D && info.dim != SpvDim3D && + info.dim != SpvDimRect) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image 'Dim' parameter to be 1D, 2D, 3D or Rect: " + << spvOpcodeString(opcode); + } + + if (info.multisampled != 0) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Image 'MS' parameter to be 0: " + << spvOpcodeString(opcode); + } + + if (info.arrayed != 0) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Image 'arrayed' parameter to be 0: " + << spvOpcodeString(opcode); + } + } + + if (opcode == SpvOpImageRead || opcode == SpvOpImageSparseRead || + opcode == SpvOpImageWrite) { + if (info.sampled == 0) { + } else if (info.sampled == 2) { + if (info.dim == SpvDim1D && !_.HasCapability(SpvCapabilityImage1D)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Capability Image1D is required to access storage image: " + << spvOpcodeString(opcode); + } else if (info.dim == SpvDimRect && + !_.HasCapability(SpvCapabilityImageRect)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Capability ImageRect is required to access storage image: " + << spvOpcodeString(opcode); + } else if (info.dim == SpvDimBuffer && + !_.HasCapability(SpvCapabilityImageBuffer)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Capability ImageBuffer is required to access storage image: " + << spvOpcodeString(opcode); + } else if (info.dim == SpvDimCube && info.arrayed == 1 && + !_.HasCapability(SpvCapabilityImageCubeArray)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Capability ImageCubeArray is required to access storage " + << "image: " << spvOpcodeString(opcode); + } + + if (info.multisampled == 1 && + !_.HasCapability(SpvCapabilityImageMSArray)) { +#if 0 + // TODO(atgoo@github.com) The description of this rule in the spec + // is unclear and Glslang doesn't declare ImageMSArray. Need to clarify + // and reenable. + return _.diag(SPV_ERROR_INVALID_DATA) + << "Capability ImageMSArray is required to access storage " + << "image: " << spvOpcodeString(opcode); +#endif + } + } else { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image 'Sampled' parameter to be 0 or 2: " + << spvOpcodeString(opcode); + } + } + + return SPV_SUCCESS; +} + +// Returns true if opcode is *ImageSparse*, false otherwise. +bool IsSparse(SpvOp opcode) { + switch (opcode) { + case SpvOpImageSparseSampleImplicitLod: + case SpvOpImageSparseSampleExplicitLod: + case SpvOpImageSparseSampleDrefImplicitLod: + case SpvOpImageSparseSampleDrefExplicitLod: + case SpvOpImageSparseSampleProjImplicitLod: + case SpvOpImageSparseSampleProjExplicitLod: + case SpvOpImageSparseSampleProjDrefImplicitLod: + case SpvOpImageSparseSampleProjDrefExplicitLod: + case SpvOpImageSparseFetch: + case SpvOpImageSparseGather: + case SpvOpImageSparseDrefGather: + case SpvOpImageSparseTexelsResident: + case SpvOpImageSparseRead: { + return true; + } + + default: { return false; } + } + + return false; +} + +// Checks sparse image opcode result type and returns the second struct member. +// Returns inst.type_id for non-sparse image opcodes. +// Not valid for sparse image opcodes which do not return a struct. +spv_result_t GetActualResultType(ValidationState_t& _, + const spv_parsed_instruction_t& inst, + uint32_t* actual_result_type) { + const SpvOp opcode = static_cast(inst.opcode); + + if (IsSparse(opcode)) { + const Instruction* const type_inst = _.FindDef(inst.type_id); + assert(type_inst); + + if (!type_inst || type_inst->opcode() != SpvOpTypeStruct) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Result Type to be OpTypeStruct"; + } + + if (type_inst->words().size() != 4 || + !_.IsIntScalarType(type_inst->word(2))) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Result Type to be a struct containing an int " + "scalar " + << "and a texel"; + } + + *actual_result_type = type_inst->word(3); + } else { + *actual_result_type = inst.type_id; + } + + return SPV_SUCCESS; +} + +// Returns a string describing actual result type of an opcode. +// Not valid for sparse image opcodes which do not return a struct. +const char* GetActualResultTypeStr(SpvOp opcode) { + if (IsSparse(opcode)) return "Result Type's second member"; + return "Result Type"; +} + +} // namespace + +// Validates correctness of image instructions. +spv_result_t ImagePass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const SpvOp opcode = static_cast(inst->opcode); + const uint32_t result_type = inst->type_id; + + if (IsImplicitLod(opcode)) { + _.current_function().RegisterExecutionModelLimitation( + SpvExecutionModelFragment, + "ImplicitLod instructions require Fragment execution model"); + } + + switch (opcode) { + case SpvOpTypeImage: { + assert(result_type == 0); + + ImageTypeInfo info; + if (!GetImageTypeInfo(_, inst->words[1], &info)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "OpTypeImage: corrupt definition"; + } + + if (spvIsVulkanEnv(_.context()->target_env)) { + if ((!_.IsFloatScalarType(info.sampled_type) && + !_.IsIntScalarType(info.sampled_type)) || + 32 != _.GetBitWidth(info.sampled_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Sampled Type to be a 32-bit int or float " + "scalar type for Vulkan environment"; + } + } else { + const SpvOp sampled_type_opcode = _.GetIdOpcode(info.sampled_type); + if (sampled_type_opcode != SpvOpTypeVoid && + sampled_type_opcode != SpvOpTypeInt && + sampled_type_opcode != SpvOpTypeFloat) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Sampled Type to be either void or numerical " + << "scalar type"; + } + } + + // Dim is checked elsewhere. + + if (info.depth > 2) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) << ": invalid Depth " << info.depth + << " (must be 0, 1 or 2)"; + } + + if (info.arrayed > 1) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) << ": invalid Arrayed " + << info.arrayed << " (must be 0 or 1)"; + } + + if (info.multisampled > 1) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) << ": invalid MS " + << info.multisampled << " (must be 0 or 1)"; + } + + if (info.sampled > 2) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) << ": invalid Sampled " + << info.sampled << " (must be 0, 1 or 2)"; + } + + if (info.dim == SpvDimSubpassData) { + if (info.sampled != 2) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": Dim SubpassData requires Sampled to be 2"; + } + + if (info.format != SpvImageFormatUnknown) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": Dim SubpassData requires format Unknown"; + } + } + + // Format and Access Qualifier are checked elsewhere. + + break; + } + + case SpvOpTypeSampledImage: { + const uint32_t image_type = inst->words[2]; + if (_.GetIdOpcode(image_type) != SpvOpTypeImage) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Image to be of type OpTypeImage"; + } + + break; + } + + case SpvOpSampledImage: { + if (_.GetIdOpcode(result_type) != SpvOpTypeSampledImage) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type to be OpTypeSampledImage: " + << spvOpcodeString(opcode); + } + + const uint32_t image_type = _.GetOperandTypeId(inst, 2); + if (_.GetIdOpcode(image_type) != SpvOpTypeImage) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image to be of type OpTypeImage: " + << spvOpcodeString(opcode); + } + + ImageTypeInfo info; + if (!GetImageTypeInfo(_, image_type, &info)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Corrupt image type definition"; + } + + // TODO(atgoo@github.com) Check compatibility of result type and received + // image. + + if (spvIsVulkanEnv(_.context()->target_env)) { + if (info.sampled != 1) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image 'Sampled' parameter to be 1 for Vulkan " + "environment: " + << spvOpcodeString(opcode); + } + } else { + if (info.sampled != 0 && info.sampled != 1) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image 'Sampled' parameter to be 0 or 1: " + << spvOpcodeString(opcode); + } + } + + if (info.dim == SpvDimSubpassData) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image 'Dim' parameter to be not SubpassData: " + << spvOpcodeString(opcode); + } + + if (_.GetIdOpcode(_.GetOperandTypeId(inst, 3)) != SpvOpTypeSampler) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Sampler to be of type OpTypeSampler: " + << spvOpcodeString(opcode); + } + + break; + } + + case SpvOpImageSampleImplicitLod: + case SpvOpImageSampleExplicitLod: + case SpvOpImageSampleProjImplicitLod: + case SpvOpImageSampleProjExplicitLod: + case SpvOpImageSparseSampleImplicitLod: + case SpvOpImageSparseSampleExplicitLod: { + uint32_t actual_result_type = 0; + if (spv_result_t error = + GetActualResultType(_, *inst, &actual_result_type)) { + return error; + } + + if (!_.IsIntVectorType(actual_result_type) && + !_.IsFloatVectorType(actual_result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected " << GetActualResultTypeStr(opcode) + << " to be int or float vector type: " + << spvOpcodeString(opcode); + } + + if (_.GetDimension(actual_result_type) != 4) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected " << GetActualResultTypeStr(opcode) + << " to have 4 components: " << spvOpcodeString(opcode); + } + + const uint32_t image_type = _.GetOperandTypeId(inst, 2); + if (_.GetIdOpcode(image_type) != SpvOpTypeSampledImage) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Sampled Image to be of type OpTypeSampledImage: " + << spvOpcodeString(opcode); + } + + ImageTypeInfo info; + if (!GetImageTypeInfo(_, image_type, &info)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Corrupt image type definition"; + } + + if (spv_result_t result = ValidateImageCommon(_, *inst, info)) + return result; + + if (_.GetIdOpcode(info.sampled_type) != SpvOpTypeVoid) { + const uint32_t texel_component_type = + _.GetComponentType(actual_result_type); + if (texel_component_type != info.sampled_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image 'Sampled Type' to be the same as " + << GetActualResultTypeStr(opcode) + << " components: " << spvOpcodeString(opcode); + } + } + + const uint32_t coord_type = _.GetOperandTypeId(inst, 3); + if ((opcode == SpvOpImageSampleExplicitLod || + opcode == SpvOpImageSparseSampleExplicitLod) && + _.HasCapability(SpvCapabilityKernel)) { + if (!_.IsFloatScalarOrVectorType(coord_type) && + !_.IsIntScalarOrVectorType(coord_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Coordinate to be int or float scalar or vector: " + << spvOpcodeString(opcode); + } + } else { + if (!_.IsFloatScalarOrVectorType(coord_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Coordinate to be float scalar or vector: " + << spvOpcodeString(opcode); + } + } + + const uint32_t min_coord_size = GetMinCoordSize(opcode, info); + const uint32_t actual_coord_size = _.GetDimension(coord_type); + if (min_coord_size > actual_coord_size) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Coordinate to have at least " << min_coord_size + << " components, but given only " << actual_coord_size << ": " + << spvOpcodeString(opcode); + } + + if (inst->num_words <= 5) { + assert(IsImplicitLod(opcode)); + break; + } + + const uint32_t mask = inst->words[5]; + if (spv_result_t result = + ValidateImageOperands(_, *inst, info, mask, /* word_index = */ 6)) + return result; + + break; + } + + case SpvOpImageSampleDrefImplicitLod: + case SpvOpImageSampleDrefExplicitLod: + case SpvOpImageSampleProjDrefImplicitLod: + case SpvOpImageSampleProjDrefExplicitLod: + case SpvOpImageSparseSampleDrefImplicitLod: + case SpvOpImageSparseSampleDrefExplicitLod: { + uint32_t actual_result_type = 0; + if (spv_result_t error = + GetActualResultType(_, *inst, &actual_result_type)) { + return error; + } + + if (!_.IsIntScalarType(actual_result_type) && + !_.IsFloatScalarType(actual_result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected " << GetActualResultTypeStr(opcode) + << " to be int or float scalar type: " + << spvOpcodeString(opcode); + } + + const uint32_t image_type = _.GetOperandTypeId(inst, 2); + if (_.GetIdOpcode(image_type) != SpvOpTypeSampledImage) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Sampled Image to be of type OpTypeSampledImage: " + << spvOpcodeString(opcode); + } + + ImageTypeInfo info; + if (!GetImageTypeInfo(_, image_type, &info)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Corrupt image type definition"; + } + + if (spv_result_t result = ValidateImageCommon(_, *inst, info)) + return result; + + if (actual_result_type != info.sampled_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image 'Sampled Type' to be the same as " + << GetActualResultTypeStr(opcode) << ": " + << spvOpcodeString(opcode); + } + + const uint32_t coord_type = _.GetOperandTypeId(inst, 3); + if (!_.IsFloatScalarOrVectorType(coord_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Coordinate to be float scalar or vector: " + << spvOpcodeString(opcode); + } + + const uint32_t min_coord_size = GetMinCoordSize(opcode, info); + const uint32_t actual_coord_size = _.GetDimension(coord_type); + if (min_coord_size > actual_coord_size) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Coordinate to have at least " << min_coord_size + << " components, but given only " << actual_coord_size << ": " + << spvOpcodeString(opcode); + } + + const uint32_t dref_type = _.GetOperandTypeId(inst, 4); + if (!_.IsFloatScalarType(dref_type) || _.GetBitWidth(dref_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": Expected Dref to be of 32-bit float type"; + } + + if (inst->num_words <= 6) { + assert(IsImplicitLod(opcode)); + break; + } + + const uint32_t mask = inst->words[6]; + if (spv_result_t result = + ValidateImageOperands(_, *inst, info, mask, /* word_index = */ 7)) + return result; + + break; + } + + case SpvOpImageFetch: + case SpvOpImageSparseFetch: { + uint32_t actual_result_type = 0; + if (spv_result_t error = + GetActualResultType(_, *inst, &actual_result_type)) { + return error; + } + + if (!_.IsIntVectorType(actual_result_type) && + !_.IsFloatVectorType(actual_result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected " << GetActualResultTypeStr(opcode) + << " to be int or float vector type: " + << spvOpcodeString(opcode); + } + + if (_.GetDimension(actual_result_type) != 4) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected " << GetActualResultTypeStr(opcode) + << " to have 4 components: " << spvOpcodeString(opcode); + } + + const uint32_t image_type = _.GetOperandTypeId(inst, 2); + if (_.GetIdOpcode(image_type) != SpvOpTypeImage) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image to be of type OpTypeImage: " + << spvOpcodeString(opcode); + } + + ImageTypeInfo info; + if (!GetImageTypeInfo(_, image_type, &info)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Corrupt image type definition"; + } + + if (_.GetIdOpcode(info.sampled_type) != SpvOpTypeVoid) { + const uint32_t result_component_type = + _.GetComponentType(actual_result_type); + if (result_component_type != info.sampled_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image 'Sampled Type' to be the same as " + << GetActualResultTypeStr(opcode) + << " components: " << spvOpcodeString(opcode); + } + } + + if (info.dim == SpvDimCube) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image 'Dim' cannot be Cube: " << spvOpcodeString(opcode); + } + + if (info.sampled != 1) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image 'Sampled' parameter to be 1: " + << spvOpcodeString(opcode); + } + + const uint32_t coord_type = _.GetOperandTypeId(inst, 3); + if (!_.IsIntScalarOrVectorType(coord_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Coordinate to be int scalar or vector: " + << spvOpcodeString(opcode); + } + + const uint32_t min_coord_size = GetMinCoordSize(opcode, info); + const uint32_t actual_coord_size = _.GetDimension(coord_type); + if (min_coord_size > actual_coord_size) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Coordinate to have at least " << min_coord_size + << " components, but given only " << actual_coord_size << ": " + << spvOpcodeString(opcode); + } + + if (inst->num_words <= 5) break; + + const uint32_t mask = inst->words[5]; + if (spv_result_t result = + ValidateImageOperands(_, *inst, info, mask, /* word_index = */ 6)) + return result; + + break; + } + + case SpvOpImageGather: + case SpvOpImageDrefGather: + case SpvOpImageSparseGather: + case SpvOpImageSparseDrefGather: { + uint32_t actual_result_type = 0; + if (spv_result_t error = + GetActualResultType(_, *inst, &actual_result_type)) { + return error; + } + + if (!_.IsIntVectorType(actual_result_type) && + !_.IsFloatVectorType(actual_result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected " << GetActualResultTypeStr(opcode) + << " to be int or float vector type: " + << spvOpcodeString(opcode); + } + + if (_.GetDimension(actual_result_type) != 4) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected " << GetActualResultTypeStr(opcode) + << " to have 4 components: " << spvOpcodeString(opcode); + } + + const uint32_t image_type = _.GetOperandTypeId(inst, 2); + if (_.GetIdOpcode(image_type) != SpvOpTypeSampledImage) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Sampled Image to be of type OpTypeSampledImage: " + << spvOpcodeString(opcode); + } + + ImageTypeInfo info; + if (!GetImageTypeInfo(_, image_type, &info)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Corrupt image type definition"; + } + + if (opcode == SpvOpImageDrefGather || + opcode == SpvOpImageSparseDrefGather || + _.GetIdOpcode(info.sampled_type) != SpvOpTypeVoid) { + const uint32_t result_component_type = + _.GetComponentType(actual_result_type); + if (result_component_type != info.sampled_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image 'Sampled Type' to be the same as " + << GetActualResultTypeStr(opcode) + << " components: " << spvOpcodeString(opcode); + } + } + + if (info.dim != SpvDim2D && info.dim != SpvDimCube && + info.dim != SpvDimRect) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image 'Dim' cannot be Cube: " + << spvOpcodeString(opcode); + } + + const uint32_t coord_type = _.GetOperandTypeId(inst, 3); + if (!_.IsFloatScalarOrVectorType(coord_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Coordinate to be float scalar or vector: " + << spvOpcodeString(opcode); + } + + const uint32_t min_coord_size = GetMinCoordSize(opcode, info); + const uint32_t actual_coord_size = _.GetDimension(coord_type); + if (min_coord_size > actual_coord_size) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Coordinate to have at least " << min_coord_size + << " components, but given only " << actual_coord_size << ": " + << spvOpcodeString(opcode); + } + + if (opcode == SpvOpImageGather || opcode == SpvOpImageSparseGather) { + const uint32_t component_index_type = _.GetOperandTypeId(inst, 4); + if (!_.IsIntScalarType(component_index_type) || + _.GetBitWidth(component_index_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Component to be 32-bit int scalar: " + << spvOpcodeString(opcode); + } + } else { + assert(opcode == SpvOpImageDrefGather || + opcode == SpvOpImageSparseDrefGather); + const uint32_t dref_type = _.GetOperandTypeId(inst, 4); + if (!_.IsFloatScalarType(dref_type) || _.GetBitWidth(dref_type) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": Expected Dref to be of 32-bit float type"; + } + } + + if (inst->num_words <= 6) break; + + const uint32_t mask = inst->words[6]; + if (spv_result_t result = + ValidateImageOperands(_, *inst, info, mask, /* word_index = */ 7)) + return result; + + break; + } + + case SpvOpImageRead: + case SpvOpImageSparseRead: { + uint32_t actual_result_type = 0; + if (spv_result_t error = + GetActualResultType(_, *inst, &actual_result_type)) { + return error; + } + + if (!_.IsIntScalarOrVectorType(actual_result_type) && + !_.IsFloatScalarOrVectorType(actual_result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected " << GetActualResultTypeStr(opcode) + << " to be int or float scalar or vector type: " + << spvOpcodeString(opcode); + } + +#if 0 + // TODO(atgoo@github.com) Disabled until the spec is clarified. + if (_.GetDimension(actual_result_type) != 4) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected " << GetActualResultTypeStr(opcode) + << " to have 4 components: " << spvOpcodeString(opcode); + } +#endif + + const uint32_t image_type = _.GetOperandTypeId(inst, 2); + if (_.GetIdOpcode(image_type) != SpvOpTypeImage) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image to be of type OpTypeImage: " + << spvOpcodeString(opcode); + } + + ImageTypeInfo info; + if (!GetImageTypeInfo(_, image_type, &info)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Corrupt image type definition"; + } + + if (info.dim == SpvDimSubpassData) { + if (opcode == SpvOpImageSparseRead) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image Dim SubpassData cannot be used with " + << spvOpcodeString(opcode); + } + + _.current_function().RegisterExecutionModelLimitation( + SpvExecutionModelFragment, + std::string("Dim SubpassData requires Fragment execution model: ") + + spvOpcodeString(opcode)); + } + + if (_.GetIdOpcode(info.sampled_type) != SpvOpTypeVoid) { + const uint32_t result_component_type = + _.GetComponentType(actual_result_type); + if (result_component_type != info.sampled_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image 'Sampled Type' to be the same as " + << GetActualResultTypeStr(opcode) + << " components: " << spvOpcodeString(opcode); + } + } + + if (spv_result_t result = ValidateImageCommon(_, *inst, info)) + return result; + + const uint32_t coord_type = _.GetOperandTypeId(inst, 3); + if (!_.IsIntScalarOrVectorType(coord_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Coordinate to be int scalar or vector: " + << spvOpcodeString(opcode); + } + + const uint32_t min_coord_size = GetMinCoordSize(opcode, info); + const uint32_t actual_coord_size = _.GetDimension(coord_type); + if (min_coord_size > actual_coord_size) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Coordinate to have at least " << min_coord_size + << " components, but given only " << actual_coord_size << ": " + << spvOpcodeString(opcode); + } + + if (info.format == SpvImageFormatUnknown && + info.dim != SpvDimSubpassData && + !_.HasCapability(SpvCapabilityStorageImageReadWithoutFormat)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Capability StorageImageReadWithoutFormat is required to " + << "read storage image: " << spvOpcodeString(opcode); + } + + if (inst->num_words <= 5) break; + + const uint32_t mask = inst->words[5]; + if (spv_result_t result = + ValidateImageOperands(_, *inst, info, mask, /* word_index = */ 6)) + return result; + + break; + } + + case SpvOpImageWrite: { + const uint32_t image_type = _.GetOperandTypeId(inst, 0); + if (_.GetIdOpcode(image_type) != SpvOpTypeImage) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image to be of type OpTypeImage: " + << spvOpcodeString(opcode); + } + + ImageTypeInfo info; + if (!GetImageTypeInfo(_, image_type, &info)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Corrupt image type definition"; + } + + if (info.dim == SpvDimSubpassData) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image 'Dim' cannot be SubpassData: " + << spvOpcodeString(opcode); + } + + if (spv_result_t result = ValidateImageCommon(_, *inst, info)) + return result; + + const uint32_t coord_type = _.GetOperandTypeId(inst, 1); + if (!_.IsIntScalarOrVectorType(coord_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Coordinate to be int scalar or vector: " + << spvOpcodeString(opcode); + } + + const uint32_t min_coord_size = GetMinCoordSize(opcode, info); + const uint32_t actual_coord_size = _.GetDimension(coord_type); + if (min_coord_size > actual_coord_size) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Coordinate to have at least " << min_coord_size + << " components, but given only " << actual_coord_size << ": " + << spvOpcodeString(opcode); + } + + // TODO(atgoo@github.com) The spec doesn't explicitely say what the type + // of texel should be. + const uint32_t texel_type = _.GetOperandTypeId(inst, 2); + if (!_.IsIntScalarOrVectorType(texel_type) && + !_.IsFloatScalarOrVectorType(texel_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Texel to be int or float vector or scalar: " + << spvOpcodeString(opcode); + } + +#if 0 + // TODO: See above. + if (_.GetDimension(texel_type) != 4) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Texel to have 4 components: " + << spvOpcodeString(opcode); + } +#endif + + if (_.GetIdOpcode(info.sampled_type) != SpvOpTypeVoid) { + const uint32_t texel_component_type = _.GetComponentType(texel_type); + if (texel_component_type != info.sampled_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image 'Sampled Type' to be the same as Texel " + << "components: " << spvOpcodeString(opcode); + } + } + + if (info.format == SpvImageFormatUnknown && + info.dim != SpvDimSubpassData && + !_.HasCapability(SpvCapabilityStorageImageWriteWithoutFormat)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Capability StorageImageWriteWithoutFormat is required to " + "write " + << "to storage image: " << spvOpcodeString(opcode); + } + + if (inst->num_words <= 4) break; + + const uint32_t mask = inst->words[4]; + if (spv_result_t result = + ValidateImageOperands(_, *inst, info, mask, /* word_index = */ 5)) + return result; + + break; + } + + case SpvOpImage: { + if (_.GetIdOpcode(result_type) != SpvOpTypeImage) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type to be OpTypeImage: " + << spvOpcodeString(opcode); + } + + const uint32_t sampled_image_type = _.GetOperandTypeId(inst, 2); + const Instruction* sampled_image_type_inst = + _.FindDef(sampled_image_type); + assert(sampled_image_type_inst); + + if (sampled_image_type_inst->opcode() != SpvOpTypeSampledImage) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Sample Image to be of type OpTypeSampleImage: " + << spvOpcodeString(opcode); + } + + if (sampled_image_type_inst->word(2) != result_type) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Sample Image image type to be equal to Result " + "Type: " + << spvOpcodeString(opcode); + } + + break; + } + + case SpvOpImageQueryFormat: + case SpvOpImageQueryOrder: { + if (!_.IsIntScalarType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type to be int scalar type: " + << spvOpcodeString(opcode); + } + + if (_.GetIdOpcode(_.GetOperandTypeId(inst, 2)) != SpvOpTypeImage) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected operand to be of type OpTypeImage: " + << spvOpcodeString(opcode); + } + break; + } + + case SpvOpImageQuerySizeLod: { + if (!_.IsIntScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type to be int scalar or vector type: " + << spvOpcodeString(opcode); + } + + const uint32_t image_type = _.GetOperandTypeId(inst, 2); + if (_.GetIdOpcode(image_type) != SpvOpTypeImage) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image to be of type OpTypeImage: " + << spvOpcodeString(opcode); + } + + ImageTypeInfo info; + if (!GetImageTypeInfo(_, image_type, &info)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Corrupt image type definition"; + } + + uint32_t expected_num_components = info.arrayed; + switch (info.dim) { + case SpvDim1D: + expected_num_components += 1; + break; + case SpvDim2D: + case SpvDimCube: + expected_num_components += 2; + break; + case SpvDim3D: + expected_num_components += 3; + break; + default: + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image 'Dim' must be 1D, 2D, 3D or Cube: " + << spvOpcodeString(opcode); + }; + + if (info.multisampled != 0) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image 'MS' must be 0: " << spvOpcodeString(opcode); + } + + uint32_t result_num_components = _.GetDimension(result_type); + if (result_num_components != expected_num_components) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Result Type has " << result_num_components << " components, " + << "but " << expected_num_components + << " expected: " << spvOpcodeString(opcode); + } + + const uint32_t lod_type = _.GetOperandTypeId(inst, 3); + if (!_.IsIntScalarType(lod_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Level of Detail to be int scalar: " + << spvOpcodeString(opcode); + } + + break; + } + + case SpvOpImageQuerySize: { + if (!_.IsIntScalarOrVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type to be int scalar or vector type: " + << spvOpcodeString(opcode); + } + + const uint32_t image_type = _.GetOperandTypeId(inst, 2); + if (_.GetIdOpcode(image_type) != SpvOpTypeImage) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image to be of type OpTypeImage: " + << spvOpcodeString(opcode); + } + +#if 0 + // TODO(atgoo@github.com) The spec doesn't whitelist all Dims supported by + // GLSL. Need to verify if there is an error and reenable. + ImageTypeInfo info; + if (!GetImageTypeInfo(_, image_type, &info)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Corrupt image type definition"; + } + + uint32_t expected_num_components = info.arrayed; + switch (info.dim) { + case SpvDimBuffer: + expected_num_components += 1; + break; + case SpvDim2D: + if (info.multisampled != 1 && info.sampled != 0 && + info.sampled != 2) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected either 'MS'=1 or 'Sampled'=0 or 'Sampled'=2 " + << "for 2D dim: " << spvOpcodeString(opcode); + } + case SpvDimRect: + expected_num_components += 2; + break; + case SpvDim3D: + expected_num_components += 3; + if (info.sampled != 0 && + info.sampled != 2) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected either 'Sampled'=0 or 'Sampled'=2 " + << "for 3D dim: " << spvOpcodeString(opcode); + } + break; + default: + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image 'Dim' must be Buffer, 2D, 3D or Rect: " + << spvOpcodeString(opcode); + }; + + + if (info.multisampled != 0) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image 'MS' must be 0: " << spvOpcodeString(opcode); + } + + uint32_t result_num_components = _.GetDimension(result_type); + if (result_num_components != expected_num_components) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Result Type has " << result_num_components << " components, " + << "but " << expected_num_components << " expected: " + << spvOpcodeString(opcode); + } +#endif + break; + } + + case SpvOpImageQueryLod: { + _.current_function().RegisterExecutionModelLimitation( + SpvExecutionModelFragment, + "OpImageQueryLod requires Fragment execution model"); + + if (!_.IsFloatVectorType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type to be float vector type: " + << spvOpcodeString(opcode); + } + + if (_.GetDimension(result_type) != 2) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type to have 2 components: " + << spvOpcodeString(opcode); + } + + const uint32_t image_type = _.GetOperandTypeId(inst, 2); + if (_.GetIdOpcode(image_type) != SpvOpTypeSampledImage) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image operand to be of type OpTypeSampledImage: " + << spvOpcodeString(opcode); + } + + ImageTypeInfo info; + if (!GetImageTypeInfo(_, image_type, &info)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Corrupt image type definition"; + } + + if (info.dim != SpvDim1D && info.dim != SpvDim2D && + info.dim != SpvDim3D && info.dim != SpvDimCube) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image 'Dim' must be 1D, 2D, 3D or Cube: " + << spvOpcodeString(opcode); + } + + const uint32_t coord_type = _.GetOperandTypeId(inst, 3); + if (_.HasCapability(SpvCapabilityKernel)) { + if (!_.IsFloatScalarOrVectorType(coord_type) && + !_.IsIntScalarOrVectorType(coord_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Coordinate to be int or float scalar or vector: " + << spvOpcodeString(opcode); + } + } else { + if (!_.IsFloatScalarOrVectorType(coord_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Coordinate to be float scalar or vector: " + << spvOpcodeString(opcode); + } + } + + const uint32_t min_coord_size = GetPlaneCoordSize(info); + const uint32_t actual_coord_size = _.GetDimension(coord_type); + if (min_coord_size > actual_coord_size) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Coordinate to have at least " << min_coord_size + << " components, but given only " << actual_coord_size << ": " + << spvOpcodeString(opcode); + } + break; + } + + case SpvOpImageQueryLevels: + case SpvOpImageQuerySamples: { + if (!_.IsIntScalarType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Result Type to be int scalar type: " + << spvOpcodeString(opcode); + } + + const uint32_t image_type = _.GetOperandTypeId(inst, 2); + if (_.GetIdOpcode(image_type) != SpvOpTypeImage) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected Image to be of type OpTypeImage: " + << spvOpcodeString(opcode); + } + + ImageTypeInfo info; + if (!GetImageTypeInfo(_, image_type, &info)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Corrupt image type definition"; + } + + if (opcode == SpvOpImageQueryLevels) { + if (info.dim != SpvDim1D && info.dim != SpvDim2D && + info.dim != SpvDim3D && info.dim != SpvDimCube) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image 'Dim' must be 1D, 2D, 3D or Cube: " + << spvOpcodeString(opcode); + } + } else { + assert(opcode == SpvOpImageQuerySamples); + if (info.dim != SpvDim2D) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image 'Dim' must be 2D: " << spvOpcodeString(opcode); + } + + if (info.multisampled != 1) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Image 'MS' must be 1: " << spvOpcodeString(opcode); + } + } + + break; + } + + case SpvOpImageSparseSampleProjImplicitLod: + case SpvOpImageSparseSampleProjExplicitLod: + case SpvOpImageSparseSampleProjDrefImplicitLod: + case SpvOpImageSparseSampleProjDrefExplicitLod: { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": instruction reserved for future use, " + << "use of this instruction is invalid"; + } + + case SpvOpImageSparseTexelsResident: { + if (!_.IsBoolScalarType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Result Type to be bool scalar type"; + } + + const uint32_t resident_code_type = _.GetOperandTypeId(inst, 2); + if (!_.IsIntScalarType(resident_code_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Resident Code to be int scalar"; + } + break; + } + + default: + break; + } + + return SPV_SUCCESS; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_instruction.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_instruction.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_instruction.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_instruction.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,552 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Performs validation on instructions that appear inside of a SPIR-V block. + +#include "validate.h" + +#include +#include + +#include +#include + +#include "binary.h" +#include "diagnostic.h" +#include "enum_set.h" +#include "enum_string_mapping.h" +#include "extensions.h" +#include "opcode.h" +#include "operand.h" +#include "spirv_constant.h" +#include "spirv_definition.h" +#include "spirv_target_env.h" +#include "spirv_validator_options.h" +#include "util/string_utils.h" +#include "val/function.h" +#include "val/validation_state.h" + +using libspirv::AssemblyGrammar; +using libspirv::CapabilitySet; +using libspirv::DiagnosticStream; +using libspirv::ExtensionSet; +using libspirv::ValidationState_t; + +namespace { + +std::string ToString(const CapabilitySet& capabilities, + const AssemblyGrammar& grammar) { + std::stringstream ss; + capabilities.ForEach([&grammar, &ss](SpvCapability cap) { + spv_operand_desc desc; + if (SPV_SUCCESS == + grammar.lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, cap, &desc)) + ss << desc->name << " "; + else + ss << cap << " "; + }); + return ss.str(); +} + +// Reports a missing-capability error to _'s diagnostic stream and returns +// SPV_ERROR_INVALID_CAPABILITY. +spv_result_t CapabilityError(ValidationState_t& _, int which_operand, + SpvOp opcode, + const std::string& required_capabilities) { + return _.diag(SPV_ERROR_INVALID_CAPABILITY) + << "Operand " << which_operand << " of " << spvOpcodeString(opcode) + << " requires one of these capabilities: " << required_capabilities; +} + +// Returns capabilities that enable an opcode. An empty result is interpreted +// as no prohibition of use of the opcode. If the result is non-empty, then +// the opcode may only be used if at least one of the capabilities is specified +// by the module. +CapabilitySet EnablingCapabilitiesForOp(const ValidationState_t& state, + SpvOp opcode) { + // Exceptions for SPV_AMD_shader_ballot + switch (opcode) { + // Normally these would require Group capability + case SpvOpGroupIAddNonUniformAMD: + case SpvOpGroupFAddNonUniformAMD: + case SpvOpGroupFMinNonUniformAMD: + case SpvOpGroupUMinNonUniformAMD: + case SpvOpGroupSMinNonUniformAMD: + case SpvOpGroupFMaxNonUniformAMD: + case SpvOpGroupUMaxNonUniformAMD: + case SpvOpGroupSMaxNonUniformAMD: + if (state.HasExtension(libspirv::kSPV_AMD_shader_ballot)) + return CapabilitySet(); + break; + default: + break; + } + // Look it up in the grammar + spv_opcode_desc opcode_desc = {}; + if (SPV_SUCCESS == state.grammar().lookupOpcode(opcode, &opcode_desc)) { + return state.grammar().filterCapsAgainstTargetEnv( + opcode_desc->capabilities, opcode_desc->numCapabilities); + } + return CapabilitySet(); +} + +// Returns an operand's required capabilities. +CapabilitySet RequiredCapabilities(const ValidationState_t& state, + spv_operand_type_t type, uint32_t operand) { + // Mere mention of PointSize, ClipDistance, or CullDistance in a Builtin + // decoration does not require the associated capability. The use of such + // a variable value should trigger the capability requirement, but that's + // not implemented yet. This rule is independent of target environment. + // See https://github.com/KhronosGroup/SPIRV-Tools/issues/365 + if (type == SPV_OPERAND_TYPE_BUILT_IN) { + switch (operand) { + case SpvBuiltInPointSize: + case SpvBuiltInClipDistance: + case SpvBuiltInCullDistance: + return CapabilitySet(); + default: + break; + } + } else if (type == SPV_OPERAND_TYPE_FP_ROUNDING_MODE) { + // Allow all FP rounding modes if requested + if (state.features().free_fp_rounding_mode) { + return CapabilitySet(); + } + } + + spv_operand_desc operand_desc; + const auto ret = state.grammar().lookupOperand(type, operand, &operand_desc); + if (ret == SPV_SUCCESS) { + // Allow FPRoundingMode decoration if requested. + if (type == SPV_OPERAND_TYPE_DECORATION && + operand_desc->value == SpvDecorationFPRoundingMode) { + if (state.features().free_fp_rounding_mode) return CapabilitySet(); + + // Vulkan API requires more capabilities on rounding mode. + if (spvIsVulkanEnv(state.context()->target_env)) { + CapabilitySet cap_set; + cap_set.Add(SpvCapabilityStorageUniformBufferBlock16); + cap_set.Add(SpvCapabilityStorageUniform16); + cap_set.Add(SpvCapabilityStoragePushConstant16); + cap_set.Add(SpvCapabilityStorageInputOutput16); + return cap_set; + } + } + // Allow certain group operations if requested. + if (state.features().group_ops_reduce_and_scans && + type == SPV_OPERAND_TYPE_GROUP_OPERATION && + (operand <= uint32_t(SpvGroupOperationExclusiveScan))) { + return CapabilitySet(); + } + + return state.grammar().filterCapsAgainstTargetEnv( + operand_desc->capabilities, operand_desc->numCapabilities); + } + + return CapabilitySet(); +} + +// Returns operand's required extensions. +ExtensionSet RequiredExtensions(const ValidationState_t& state, + spv_operand_type_t type, uint32_t operand) { + spv_operand_desc operand_desc; + if (state.grammar().lookupOperand(type, operand, &operand_desc) == + SPV_SUCCESS) { + assert(operand_desc); + // If this operand is incorporated into core SPIR-V before or in the current + // target environment, we don't require extensions anymore. + if (spvVersionForTargetEnv(state.grammar().target_env()) >= + operand_desc->minVersion) + return {}; + return {operand_desc->numExtensions, operand_desc->extensions}; + } + + return {}; +} + +} // namespace + +namespace libspirv { + +spv_result_t CapabilityCheck(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const SpvOp opcode = static_cast(inst->opcode); + CapabilitySet opcode_caps = EnablingCapabilitiesForOp(_, opcode); + if (!_.HasAnyOfCapabilities(opcode_caps)) { + return _.diag(SPV_ERROR_INVALID_CAPABILITY) + << "Opcode " << spvOpcodeString(opcode) + << " requires one of these capabilities: " + << ToString(opcode_caps, _.grammar()); + } + for (int i = 0; i < inst->num_operands; ++i) { + const auto& operand = inst->operands[i]; + const auto word = inst->words[operand.offset]; + if (spvOperandIsConcreteMask(operand.type)) { + // Check for required capabilities for each bit position of the mask. + for (uint32_t mask_bit = 0x80000000; mask_bit; mask_bit >>= 1) { + if (word & mask_bit) { + const auto caps = RequiredCapabilities(_, operand.type, mask_bit); + if (!_.HasAnyOfCapabilities(caps)) { + return CapabilityError(_, i + 1, opcode, + ToString(caps, _.grammar())); + } + } + } + } else if (spvIsIdType(operand.type)) { + // TODO(dneto): Check the value referenced by this Id, if we can compute + // it. For now, just punt, to fix issue 248: + // https://github.com/KhronosGroup/SPIRV-Tools/issues/248 + } else { + // Check the operand word as a whole. + const auto caps = RequiredCapabilities(_, operand.type, word); + if (!_.HasAnyOfCapabilities(caps)) { + return CapabilityError(_, i + 1, opcode, ToString(caps, _.grammar())); + } + } + } + return SPV_SUCCESS; +} + +// Checks that all extensions required by the given instruction's operands were +// declared in the module. +spv_result_t ExtensionCheck(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const SpvOp opcode = static_cast(inst->opcode); + for (size_t operand_index = 0; operand_index < inst->num_operands; + ++operand_index) { + const auto& operand = inst->operands[operand_index]; + const uint32_t word = inst->words[operand.offset]; + const ExtensionSet required_extensions = + RequiredExtensions(_, operand.type, word); + if (!_.HasAnyOfExtensions(required_extensions)) { + return _.diag(SPV_ERROR_MISSING_EXTENSION) + << spvutils::CardinalToOrdinal(operand_index + 1) << " operand of " + << spvOpcodeString(opcode) << ": operand " << word + << " requires one of these extensions: " + << ExtensionSetToString(required_extensions); + } + } + return SPV_SUCCESS; +} + +// Checks that the instruction can be used in this target environment. +spv_result_t VersionCheck(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const auto opcode = static_cast(inst->opcode); + spv_opcode_desc inst_desc; + const bool r = _.grammar().lookupOpcode(opcode, &inst_desc); + assert(r == SPV_SUCCESS); + (void)r; + + const auto min_version = inst_desc->minVersion; + + ExtensionSet exts(inst_desc->numExtensions, inst_desc->extensions); + if (exts.IsEmpty()) { + // If no extensions can enable this instruction, then emit error messages + // only concerning core SPIR-V versions if errors happen. + if (min_version == ~0u) { + return _.diag(SPV_ERROR_WRONG_VERSION) + << spvOpcodeString(opcode) << " is reserved for future use."; + } + + if (spvVersionForTargetEnv(_.grammar().target_env()) < min_version) { + return _.diag(SPV_ERROR_WRONG_VERSION) + << spvOpcodeString(opcode) << " requires " + << spvTargetEnvDescription( + static_cast(min_version)) + << " at minimum."; + } + } + // Otherwise, we only error out when no enabling extensions are registered. + else if (!_.HasAnyOfExtensions(exts)) { + if (min_version == ~0u) { + return _.diag(SPV_ERROR_MISSING_EXTENSION) + << spvOpcodeString(opcode) + << " requires one of the following extensions: " + << ExtensionSetToString(exts); + } + + if (static_cast(_.grammar().target_env()) < min_version) { + return _.diag(SPV_ERROR_WRONG_VERSION) + << spvOpcodeString(opcode) << " requires " + << spvTargetEnvDescription( + static_cast(min_version)) + << " at minimum or one of the following extensions: " + << ExtensionSetToString(exts); + } + } + + return SPV_SUCCESS; +} + +// Checks that the Resuld is within the valid bound. +spv_result_t LimitCheckIdBound(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + if (inst->result_id >= _.getIdBound()) { + return _.diag(SPV_ERROR_INVALID_BINARY) + << "Result '" << inst->result_id + << "' must be less than the ID bound '" << _.getIdBound() << "'."; + } + return SPV_SUCCESS; +} + +// Checks that the number of OpTypeStruct members is within the limit. +spv_result_t LimitCheckStruct(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + if (SpvOpTypeStruct != inst->opcode) { + return SPV_SUCCESS; + } + + // Number of members is the number of operands of the instruction minus 1. + // One operand is the result ID. + const uint16_t limit = + static_cast(_.options()->universal_limits_.max_struct_members); + if (inst->num_operands - 1 > limit) { + return _.diag(SPV_ERROR_INVALID_BINARY) + << "Number of OpTypeStruct members (" << inst->num_operands - 1 + << ") has exceeded the limit (" << limit << ")."; + } + + // Section 2.17 of SPIRV Spec specifies that the "Structure Nesting Depth" + // must be less than or equal to 255. + // This is interpreted as structures including other structures as members. + // The code does not follow pointers or look into arrays to see if we reach a + // structure downstream. + // The nesting depth of a struct is 1+(largest depth of any member). + // Scalars are at depth 0. + uint32_t max_member_depth = 0; + // Struct members start at word 2 of OpTypeStruct instruction. + for (size_t word_i = 2; word_i < inst->num_words; ++word_i) { + auto member = inst->words[word_i]; + auto memberTypeInstr = _.FindDef(member); + if (memberTypeInstr && SpvOpTypeStruct == memberTypeInstr->opcode()) { + max_member_depth = std::max( + max_member_depth, _.struct_nesting_depth(memberTypeInstr->id())); + } + } + + const uint32_t depth_limit = _.options()->universal_limits_.max_struct_depth; + const uint32_t cur_depth = 1 + max_member_depth; + _.set_struct_nesting_depth(inst->result_id, cur_depth); + if (cur_depth > depth_limit) { + return _.diag(SPV_ERROR_INVALID_BINARY) + << "Structure Nesting Depth may not be larger than " << depth_limit + << ". Found " << cur_depth << "."; + } + return SPV_SUCCESS; +} + +// Checks that the number of (literal, label) pairs in OpSwitch is within the +// limit. +spv_result_t LimitCheckSwitch(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + if (SpvOpSwitch == inst->opcode) { + // The instruction syntax is as follows: + // OpSwitch literal label literal label ... + // literal,label pairs come after the first 2 operands. + // It is guaranteed at this point that num_operands is an even numner. + unsigned int num_pairs = (inst->num_operands - 2) / 2; + const unsigned int num_pairs_limit = + _.options()->universal_limits_.max_switch_branches; + if (num_pairs > num_pairs_limit) { + return _.diag(SPV_ERROR_INVALID_BINARY) + << "Number of (literal, label) pairs in OpSwitch (" << num_pairs + << ") exceeds the limit (" << num_pairs_limit << ")."; + } + } + return SPV_SUCCESS; +} + +// Ensure the number of variables of the given class does not exceed the limit. +spv_result_t LimitCheckNumVars(ValidationState_t& _, const uint32_t var_id, + const SpvStorageClass storage_class) { + if (SpvStorageClassFunction == storage_class) { + _.registerLocalVariable(var_id); + const uint32_t num_local_vars_limit = + _.options()->universal_limits_.max_local_variables; + if (_.num_local_vars() > num_local_vars_limit) { + return _.diag(SPV_ERROR_INVALID_BINARY) + << "Number of local variables ('Function' Storage Class) " + "exceeded the valid limit (" + << num_local_vars_limit << ")."; + } + } else { + _.registerGlobalVariable(var_id); + const uint32_t num_global_vars_limit = + _.options()->universal_limits_.max_global_variables; + if (_.num_global_vars() > num_global_vars_limit) { + return _.diag(SPV_ERROR_INVALID_BINARY) + << "Number of Global Variables (Storage Class other than " + "'Function') exceeded the valid limit (" + << num_global_vars_limit << ")."; + } + } + return SPV_SUCCESS; +} + +// Registers necessary decoration(s) for the appropriate IDs based on the +// instruction. +spv_result_t RegisterDecorations(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + switch (inst->opcode) { + case SpvOpDecorate: { + const uint32_t target_id = inst->words[1]; + const SpvDecoration dec_type = static_cast(inst->words[2]); + std::vector dec_params; + if (inst->num_words > 3) { + dec_params.insert(dec_params.end(), inst->words + 3, + inst->words + inst->num_words); + } + _.RegisterDecorationForId(target_id, Decoration(dec_type, dec_params)); + break; + } + case SpvOpMemberDecorate: { + const uint32_t struct_id = inst->words[1]; + const uint32_t index = inst->words[2]; + const SpvDecoration dec_type = static_cast(inst->words[3]); + std::vector dec_params; + if (inst->num_words > 4) { + dec_params.insert(dec_params.end(), inst->words + 4, + inst->words + inst->num_words); + } + _.RegisterDecorationForId(struct_id, + Decoration(dec_type, dec_params, index)); + break; + } + case SpvOpDecorationGroup: { + // We don't need to do anything right now. Assigning decorations to groups + // will be taken care of via OpGroupDecorate. + break; + } + case SpvOpGroupDecorate: { + // Word 1 is the group . All subsequent words are target s that + // are going to be decorated with the decorations. + const uint32_t decoration_group_id = inst->words[1]; + std::vector& group_decorations = + _.id_decorations(decoration_group_id); + for (int i = 2; i < inst->num_words; ++i) { + const uint32_t target_id = inst->words[i]; + _.RegisterDecorationsForId(target_id, group_decorations.begin(), + group_decorations.end()); + } + break; + } + case SpvOpGroupMemberDecorate: { + // Word 1 is the Decoration Group followed by (struct,literal) + // pairs. All decorations of the group should be applied to all the struct + // members that are specified in the instructions. + const uint32_t decoration_group_id = inst->words[1]; + std::vector& group_decorations = + _.id_decorations(decoration_group_id); + // Grammar checks ensures that the number of arguments to this instruction + // is an odd number: 1 decoration group + (id,literal) pairs. + for (int i = 2; i + 1 < inst->num_words; i = i + 2) { + const uint32_t struct_id = inst->words[i]; + const uint32_t index = inst->words[i + 1]; + // ID validation phase ensures this is in fact a struct instruction and + // that the index is not out of bound. + _.RegisterDecorationsForStructMember(struct_id, index, + group_decorations.begin(), + group_decorations.end()); + } + break; + } + default: + break; + } + return SPV_SUCCESS; +} + +// Parses OpExtension instruction and logs warnings if unsuccessful. +void CheckIfKnownExtension(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const std::string extension_str = GetExtensionString(inst); + Extension extension; + if (!GetExtensionFromString(extension_str.c_str(), &extension)) { + _.diag(SPV_SUCCESS) << "Found unrecognized extension " << extension_str; + return; + } +} + +spv_result_t InstructionPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const SpvOp opcode = static_cast(inst->opcode); + if (opcode == SpvOpExtension) { + CheckIfKnownExtension(_, inst); + } else if (opcode == SpvOpCapability) { + _.RegisterCapability( + static_cast(inst->words[inst->operands[0].offset])); + } else if (opcode == SpvOpMemoryModel) { + _.set_addressing_model( + static_cast(inst->words[inst->operands[0].offset])); + _.set_memory_model( + static_cast(inst->words[inst->operands[1].offset])); + } else if (opcode == SpvOpExecutionMode) { + const uint32_t entry_point = inst->words[1]; + _.RegisterExecutionModeForEntryPoint(entry_point, + SpvExecutionMode(inst->words[2])); + } else if (opcode == SpvOpVariable) { + const auto storage_class = + static_cast(inst->words[inst->operands[2].offset]); + if (auto error = LimitCheckNumVars(_, inst->result_id, storage_class)) { + return error; + } + if (storage_class == SpvStorageClassGeneric) + return _.diag(SPV_ERROR_INVALID_BINARY) + << "OpVariable storage class cannot be Generic"; + if (_.current_layout_section() == kLayoutFunctionDefinitions) { + if (storage_class != SpvStorageClassFunction) { + return _.diag(SPV_ERROR_INVALID_LAYOUT) + << "Variables must have a function[7] storage class inside" + " of a function"; + } + if (_.current_function().IsFirstBlock( + _.current_function().current_block()->id()) == false) { + return _.diag(SPV_ERROR_INVALID_CFG) << "Variables can only be defined " + "in the first block of a " + "function"; + } + } else { + if (storage_class == SpvStorageClassFunction) { + return _.diag(SPV_ERROR_INVALID_LAYOUT) + << "Variables can not have a function[7] storage class " + "outside of a function"; + } + } + } + + // SPIR-V Spec 2.16.3: Validation Rules for Kernel Capabilities: The + // Signedness in OpTypeInt must always be 0. + if (SpvOpTypeInt == inst->opcode && _.HasCapability(SpvCapabilityKernel) && + inst->words[inst->operands[2].offset] != 0u) { + return _.diag(SPV_ERROR_INVALID_BINARY) << "The Signedness in OpTypeInt " + "must always be 0 when Kernel " + "capability is used."; + } + + // In order to validate decoration rules, we need to know all the decorations + // that are applied to any given . + RegisterDecorations(_, inst); + + if (auto error = ExtensionCheck(_, inst)) return error; + if (auto error = CapabilityCheck(_, inst)) return error; + if (auto error = LimitCheckIdBound(_, inst)) return error; + if (auto error = LimitCheckStruct(_, inst)) return error; + if (auto error = LimitCheckSwitch(_, inst)) return error; + if (auto error = VersionCheck(_, inst)) return error; + + // All instruction checks have passed. + return SPV_SUCCESS; +} +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_layout.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_layout.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_layout.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_layout.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,207 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Source code for logical layout validation as described in section 2.4 + +#include "validate.h" + +#include + +#include "diagnostic.h" +#include "opcode.h" +#include "operand.h" +#include "spirv-tools/libspirv.h" +#include "val/function.h" +#include "val/validation_state.h" + +using libspirv::FunctionDecl; +using libspirv::kLayoutFunctionDeclarations; +using libspirv::kLayoutFunctionDefinitions; +using libspirv::kLayoutMemoryModel; +using libspirv::ValidationState_t; + +namespace { +// Module scoped instructions are processed by determining if the opcode +// is part of the current layout section. If it is not then the next sections is +// checked. +spv_result_t ModuleScopedInstructions(ValidationState_t& _, + const spv_parsed_instruction_t* inst, + SpvOp opcode) { + while (_.IsOpcodeInCurrentLayoutSection(opcode) == false) { + _.ProgressToNextLayoutSectionOrder(); + + switch (_.current_layout_section()) { + case kLayoutMemoryModel: + if (opcode != SpvOpMemoryModel) { + return _.diag(SPV_ERROR_INVALID_LAYOUT) + << spvOpcodeString(opcode) + << " cannot appear before the memory model instruction"; + } + break; + case kLayoutFunctionDeclarations: + // All module sections have been processed. Recursively call + // ModuleLayoutPass to process the next section of the module + return libspirv::ModuleLayoutPass(_, inst); + default: + break; + } + } + return SPV_SUCCESS; +} + +// Function declaration validation is performed by making sure that the +// FunctionParameter and FunctionEnd instructions only appear inside of +// functions. It also ensures that the Function instruction does not appear +// inside of another function. This stage ends when the first label is +// encountered inside of a function. +spv_result_t FunctionScopedInstructions(ValidationState_t& _, + const spv_parsed_instruction_t* inst, + SpvOp opcode) { + if (_.IsOpcodeInCurrentLayoutSection(opcode)) { + switch (opcode) { + case SpvOpFunction: { + if (_.in_function_body()) { + return _.diag(SPV_ERROR_INVALID_LAYOUT) + << "Cannot declare a function in a function body"; + } + auto control_mask = static_cast( + inst->words[inst->operands[2].offset]); + if (auto error = + _.RegisterFunction(inst->result_id, inst->type_id, control_mask, + inst->words[inst->operands[3].offset])) + return error; + if (_.current_layout_section() == kLayoutFunctionDefinitions) { + if (auto error = _.current_function().RegisterSetFunctionDeclType( + FunctionDecl::kFunctionDeclDefinition)) + return error; + } + } break; + + case SpvOpFunctionParameter: + if (_.in_function_body() == false) { + return _.diag(SPV_ERROR_INVALID_LAYOUT) << "Function parameter " + "instructions must be in " + "a function body"; + } + if (_.current_function().block_count() != 0) { + return _.diag(SPV_ERROR_INVALID_LAYOUT) + << "Function parameters must only appear immediately after " + "the function definition"; + } + if (auto error = _.current_function().RegisterFunctionParameter( + inst->result_id, inst->type_id)) + return error; + break; + + case SpvOpFunctionEnd: + if (_.in_function_body() == false) { + return _.diag(SPV_ERROR_INVALID_LAYOUT) + << "Function end instructions must be in a function body"; + } + if (_.in_block()) { + return _.diag(SPV_ERROR_INVALID_LAYOUT) + << "Function end cannot be called in blocks"; + } + if (_.current_function().block_count() == 0 && + _.current_layout_section() == kLayoutFunctionDefinitions) { + return _.diag(SPV_ERROR_INVALID_LAYOUT) << "Function declarations " + "must appear before " + "function definitions."; + } + if (_.current_layout_section() == kLayoutFunctionDeclarations) { + if (auto error = _.current_function().RegisterSetFunctionDeclType( + FunctionDecl::kFunctionDeclDeclaration)) + return error; + } + if (auto error = _.RegisterFunctionEnd()) return error; + break; + + case SpvOpLine: + case SpvOpNoLine: + break; + case SpvOpLabel: + // If the label is encountered then the current function is a + // definition so set the function to a declaration and update the + // module section + if (_.in_function_body() == false) { + return _.diag(SPV_ERROR_INVALID_LAYOUT) + << "Label instructions must be in a function body"; + } + if (_.in_block()) { + return _.diag(SPV_ERROR_INVALID_LAYOUT) + << "A block must end with a branch instruction."; + } + if (_.current_layout_section() == kLayoutFunctionDeclarations) { + _.ProgressToNextLayoutSectionOrder(); + if (auto error = _.current_function().RegisterSetFunctionDeclType( + FunctionDecl::kFunctionDeclDefinition)) + return error; + } + break; + + default: + if (_.current_layout_section() == kLayoutFunctionDeclarations && + _.in_function_body()) { + return _.diag(SPV_ERROR_INVALID_LAYOUT) + << "A function must begin with a label"; + } else { + if (_.in_block() == false) { + return _.diag(SPV_ERROR_INVALID_LAYOUT) + << spvOpcodeString(opcode) << " must appear in a block"; + } + } + break; + } + } else { + return _.diag(SPV_ERROR_INVALID_LAYOUT) + << spvOpcodeString(opcode) + << " cannot appear in a function declaration"; + } + return SPV_SUCCESS; +} +} // namespace + +namespace libspirv { +// TODO(umar): Check linkage capabilities for function declarations +// TODO(umar): Better error messages +// NOTE: This function does not handle CFG related validation +// Performs logical layout validation. See Section 2.4 +spv_result_t ModuleLayoutPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const SpvOp opcode = static_cast(inst->opcode); + + switch (_.current_layout_section()) { + case kLayoutCapabilities: + case kLayoutExtensions: + case kLayoutExtInstImport: + case kLayoutMemoryModel: + case kLayoutEntryPoint: + case kLayoutExecutionMode: + case kLayoutDebug1: + case kLayoutDebug2: + case kLayoutDebug3: + case kLayoutAnnotations: + case kLayoutTypes: + if (auto error = ModuleScopedInstructions(_, inst, opcode)) return error; + break; + case kLayoutFunctionDeclarations: + case kLayoutFunctionDefinitions: + if (auto error = FunctionScopedInstructions(_, inst, opcode)) { + return error; + } + break; + } + return SPV_SUCCESS; +} +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_literals.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_literals.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_literals.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_literals.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,99 @@ +// Copyright (c) 2017 Google 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. + +// Validates literal numbers. + +#include "validate.h" + +#include + +#include "diagnostic.h" +#include "opcode.h" +#include "val/instruction.h" +#include "val/validation_state.h" + +namespace libspirv { + +namespace { + +// Returns true if the operand holds a literal number +bool IsLiteralNumber(const spv_parsed_operand_t* operand) { + switch (operand->number_kind) { + case SPV_NUMBER_SIGNED_INT: + case SPV_NUMBER_UNSIGNED_INT: + case SPV_NUMBER_FLOATING: + return true; + default: + return false; + } +} + +// Verifies that the upper bits of the given upper |word| with given +// lower |width| are zero- or sign-extended when |signed_int| is true +bool VerifyUpperBits(uint32_t word, uint32_t width, bool signed_int) { + assert(width < 32); + assert(0 < width); + const uint32_t upper_mask = 0xFFFFFFFFu << width; + const uint32_t upper_bits = word & upper_mask; + + bool result = false; + if (signed_int) { + const uint32_t sign_bit = word & (1u << (width - 1)); + if (sign_bit) { + result = upper_bits == upper_mask; + } else { + result = upper_bits == 0; + } + } else { + result = upper_bits == 0; + } + return result; +} + +} // namespace + +// Validates that literal numbers are represented according to the spec +spv_result_t LiteralsPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + // For every operand that is a literal number + for (uint16_t i = 0; i < inst->num_operands; i++) { + const spv_parsed_operand_t* operand = inst->operands + i; + if (!IsLiteralNumber(operand)) continue; + + // The upper bits are always in the last word (little-endian) + int last_index = operand->offset + operand->num_words - 1; + const uint32_t upper_word = inst->words[last_index]; + + // TODO(jcaraban): is the |word size| defined in some header? + const uint32_t word_size = 32; + uint32_t bit_width = operand->number_bit_width; + + // Bit widths that are a multiple of the word size have no upper bits + const auto remaining_value_bits = bit_width % word_size; + if (remaining_value_bits == 0) continue; + + const bool signedness = operand->number_kind == SPV_NUMBER_SIGNED_INT; + + if (!VerifyUpperBits(upper_word, remaining_value_bits, signedness)) { + return _.diag(SPV_ERROR_INVALID_VALUE) + << "The high-order bits of a literal number in instruction " + << inst->result_id << " must be 0 for a floating-point type, " + << "or 0 for an integer type with Signedness of 0, " + << "or sign extended when Signedness is 1"; + } + } + return SPV_SUCCESS; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_logicals.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_logicals.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_logicals.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_logicals.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,284 @@ +// Copyright (c) 2017 Google 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. + +// Validates correctness of logical SPIR-V instructions. + +#include "validate.h" + +#include "diagnostic.h" +#include "opcode.h" +#include "val/instruction.h" +#include "val/validation_state.h" + +namespace libspirv { + +namespace { + +// Returns operand word for given instruction and operand index. +// The operand is expected to only have one word. +inline uint32_t GetOperandWord(const spv_parsed_instruction_t* inst, + size_t operand_index) { + assert(operand_index < inst->num_operands); + const spv_parsed_operand_t& operand = inst->operands[operand_index]; + assert(operand.num_words == 1); + return inst->words[operand.offset]; +} + +// Returns the type id of instruction operand at |operand_index|. +// The operand is expected to be an id. +inline uint32_t GetOperandTypeId(ValidationState_t& _, + const spv_parsed_instruction_t* inst, + size_t operand_index) { + return _.GetTypeId(GetOperandWord(inst, operand_index)); +} +} // namespace + +// Validates correctness of logical instructions. +spv_result_t LogicalsPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const SpvOp opcode = static_cast(inst->opcode); + const uint32_t result_type = inst->type_id; + + switch (opcode) { + case SpvOpAny: + case SpvOpAll: { + if (!_.IsBoolScalarType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected bool scalar type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t vector_type = GetOperandTypeId(_, inst, 2); + if (!vector_type || !_.IsBoolVectorType(vector_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected operand to be vector bool: " + << spvOpcodeString(opcode); + + break; + } + + case SpvOpIsNan: + case SpvOpIsInf: + case SpvOpIsFinite: + case SpvOpIsNormal: + case SpvOpSignBitSet: { + if (!_.IsBoolScalarType(result_type) && !_.IsBoolVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected bool scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t operand_type = GetOperandTypeId(_, inst, 2); + if (!operand_type || (!_.IsFloatScalarType(operand_type) && + !_.IsFloatVectorType(operand_type))) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected operand to be scalar or vector float: " + << spvOpcodeString(opcode); + + if (_.GetDimension(result_type) != _.GetDimension(operand_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected vector sizes of Result Type and the operand to be " + "equal: " + << spvOpcodeString(opcode); + + break; + } + + case SpvOpFOrdEqual: + case SpvOpFUnordEqual: + case SpvOpFOrdNotEqual: + case SpvOpFUnordNotEqual: + case SpvOpFOrdLessThan: + case SpvOpFUnordLessThan: + case SpvOpFOrdGreaterThan: + case SpvOpFUnordGreaterThan: + case SpvOpFOrdLessThanEqual: + case SpvOpFUnordLessThanEqual: + case SpvOpFOrdGreaterThanEqual: + case SpvOpFUnordGreaterThanEqual: + case SpvOpLessOrGreater: + case SpvOpOrdered: + case SpvOpUnordered: { + if (!_.IsBoolScalarType(result_type) && !_.IsBoolVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected bool scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t left_operand_type = GetOperandTypeId(_, inst, 2); + if (!left_operand_type || (!_.IsFloatScalarType(left_operand_type) && + !_.IsFloatVectorType(left_operand_type))) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected operands to be scalar or vector float: " + << spvOpcodeString(opcode); + + if (_.GetDimension(result_type) != _.GetDimension(left_operand_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected vector sizes of Result Type and the operands to be " + "equal: " + << spvOpcodeString(opcode); + + if (left_operand_type != GetOperandTypeId(_, inst, 3)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected left and right operands to have the same type: " + << spvOpcodeString(opcode); + + break; + } + + case SpvOpLogicalEqual: + case SpvOpLogicalNotEqual: + case SpvOpLogicalOr: + case SpvOpLogicalAnd: { + if (!_.IsBoolScalarType(result_type) && !_.IsBoolVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected bool scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + if (result_type != GetOperandTypeId(_, inst, 2) || + result_type != GetOperandTypeId(_, inst, 3)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected both operands to be of Result Type: " + << spvOpcodeString(opcode); + + break; + } + + case SpvOpLogicalNot: { + if (!_.IsBoolScalarType(result_type) && !_.IsBoolVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected bool scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + if (result_type != GetOperandTypeId(_, inst, 2)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected operand to be of Result Type: " + << spvOpcodeString(opcode); + + break; + } + + case SpvOpSelect: { + uint32_t dimension = 1; + { + const Instruction* type_inst = _.FindDef(result_type); + assert(type_inst); + + const SpvOp type_opcode = type_inst->opcode(); + switch (type_opcode) { + case SpvOpTypePointer: { + if (!_.features().variable_pointers && + !_.features().variable_pointers_storage_buffer) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Using pointers with OpSelect requires capability " + << "VariablePointers or VariablePointersStorageBuffer"; + break; + } + + case SpvOpTypeVector: { + dimension = type_inst->word(3); + break; + } + + case SpvOpTypeBool: + case SpvOpTypeInt: + case SpvOpTypeFloat: { + break; + } + + default: { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + } + } + } + + const uint32_t condition_type = GetOperandTypeId(_, inst, 2); + const uint32_t left_type = GetOperandTypeId(_, inst, 3); + const uint32_t right_type = GetOperandTypeId(_, inst, 4); + + if (!condition_type || (!_.IsBoolScalarType(condition_type) && + !_.IsBoolVectorType(condition_type))) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected bool scalar or vector type as condition: " + << spvOpcodeString(opcode); + + if (_.GetDimension(condition_type) != dimension) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected vector sizes of Result Type and the condition to be" + << " equal: " << spvOpcodeString(opcode); + + if (result_type != left_type || result_type != right_type) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected both objects to be of Result Type: " + << spvOpcodeString(opcode); + + break; + } + + case SpvOpIEqual: + case SpvOpINotEqual: + case SpvOpUGreaterThan: + case SpvOpUGreaterThanEqual: + case SpvOpULessThan: + case SpvOpULessThanEqual: + case SpvOpSGreaterThan: + case SpvOpSGreaterThanEqual: + case SpvOpSLessThan: + case SpvOpSLessThanEqual: { + if (!_.IsBoolScalarType(result_type) && !_.IsBoolVectorType(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected bool scalar or vector type as Result Type: " + << spvOpcodeString(opcode); + + const uint32_t left_type = GetOperandTypeId(_, inst, 2); + const uint32_t right_type = GetOperandTypeId(_, inst, 3); + + if (!left_type || + (!_.IsIntScalarType(left_type) && !_.IsIntVectorType(left_type))) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected operands to be scalar or vector int: " + << spvOpcodeString(opcode); + + if (_.GetDimension(result_type) != _.GetDimension(left_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected vector sizes of Result Type and the operands to be" + << " equal: " << spvOpcodeString(opcode); + + if (!right_type || + (!_.IsIntScalarType(right_type) && !_.IsIntVectorType(right_type))) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected operands to be scalar or vector int: " + << spvOpcodeString(opcode); + + if (_.GetDimension(result_type) != _.GetDimension(right_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected vector sizes of Result Type and the operands to be" + << " equal: " << spvOpcodeString(opcode); + + if (_.GetBitWidth(left_type) != _.GetBitWidth(right_type)) + return _.diag(SPV_ERROR_INVALID_DATA) + << "Expected both operands to have the same component bit " + "width: " + << spvOpcodeString(opcode); + + break; + } + + default: + break; + } + + return SPV_SUCCESS; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_primitives.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_primitives.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_primitives.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_primitives.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,73 @@ +// Copyright (c) 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. + +// Validates correctness of primitive SPIR-V instructions. + +#include "validate.h" + +#include + +#include "diagnostic.h" +#include "opcode.h" +#include "val/instruction.h" +#include "val/validation_state.h" + +namespace libspirv { + +// Validates correctness of primitive instructions. +spv_result_t PrimitivesPass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + const SpvOp opcode = static_cast(inst->opcode); + + switch (opcode) { + case SpvOpEmitVertex: + case SpvOpEndPrimitive: + case SpvOpEmitStreamVertex: + case SpvOpEndStreamPrimitive: + _.current_function().RegisterExecutionModelLimitation( + SpvExecutionModelGeometry, + std::string(spvOpcodeString(opcode)) + + " instructions require Geometry execution model"); + break; + default: + break; + } + + switch (opcode) { + case SpvOpEmitStreamVertex: + case SpvOpEndStreamPrimitive: { + const uint32_t stream_id = inst->words[1]; + const uint32_t stream_type = _.GetTypeId(stream_id); + if (!_.IsIntScalarType(stream_type)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Stream to be int scalar"; + } + + const SpvOp stream_opcode = _.GetIdOpcode(stream_id); + if (!spvOpcodeIsConstant(stream_opcode)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << spvOpcodeString(opcode) + << ": expected Stream to be constant instruction"; + } + } + + default: + break; + } + + return SPV_SUCCESS; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_type_unique.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_type_unique.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/source/validate_type_unique.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/source/validate_type_unique.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2017 Google 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. + +// Ensures type declarations are unique unless allowed by the specification. + +#include "validate.h" + +#include "diagnostic.h" +#include "opcode.h" +#include "val/instruction.h" +#include "val/validation_state.h" + +namespace libspirv { + +// Validates that type declarations are unique, unless multiple declarations +// of the same data type are allowed by the specification. +// (see section 2.8 Types and Variables) +// Doesn't do anything if SPV_VAL_ignore_type_decl_unique was declared in the +// module. +spv_result_t TypeUniquePass(ValidationState_t& _, + const spv_parsed_instruction_t* inst) { + if (_.HasExtension(Extension::kSPV_VALIDATOR_ignore_type_decl_unique)) + return SPV_SUCCESS; + + const SpvOp opcode = static_cast(inst->opcode); + + if (spvOpcodeGeneratesType(opcode)) { + if (opcode == SpvOpTypeArray || opcode == SpvOpTypeRuntimeArray || + opcode == SpvOpTypeStruct) { + // Duplicate declarations of aggregates are allowed. + return SPV_SUCCESS; + } + + if (inst->opcode == SpvOpTypePointer && + _.HasExtension(Extension::kSPV_KHR_variable_pointers)) { + // Duplicate pointer types are allowed with this extension. + return SPV_SUCCESS; + } + + if (!_.RegisterUniqueTypeDeclaration(*inst)) { + return _.diag(SPV_ERROR_INVALID_DATA) + << "Duplicate non-aggregate type declarations are not allowed." + << " Opcode: " << spvOpcodeString(SpvOp(inst->opcode)) + << " id: " << inst->result_id; + } + } + + return SPV_SUCCESS; +} + +} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/syntax.md vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/syntax.md --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/syntax.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/syntax.md 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,238 @@ +# SPIR-V Assembly language syntax + +## Overview + +The assembly attempts to adhere to the binary form from Section 3 of the SPIR-V +spec as closely as possible, with one exception aiming at improving the text's +readability. The `` generated by an instruction is moved to the +beginning of that instruction and followed by an `=` sign. This allows us to +distinguish between variable definitions and uses and locate value definitions +more easily. + +Here is an example: + +``` + OpCapability Shader + OpMemoryModel Logical Simple + OpEntryPoint GLCompute %3 "main" + OpExecutionMode %3 LocalSize 64 64 1 +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpFunction %1 None %2 +%4 = OpLabel + OpReturn + OpFunctionEnd +``` + +A module is a sequence of instructions, separated by whitespace. +An instruction is an opcode name followed by operands, separated by +whitespace. Typically each instruction is presented on its own line, +but the assembler does not enforce this rule. + +The opcode names and expected operands are described in Section 3 of +the SPIR-V specification. An operand is one of: +* a literal integer: A decimal integer, or a hexadecimal integer. + A hexadecimal integer is indicated by a leading `0x` or `0X`. A hex + integer supplied for a signed integer value will be sign-extended. + For example, `0xffff` supplied as the literal for an `OpConstant` + on a signed 16-bit integer type will be interpreted as the value `-1`. +* a literal floating point number, in decimal or hexadecimal form. + See [below](#floats). +* a literal string. + * A literal string is everything following a double-quote `"` until the + following un-escaped double-quote. This includes special characters such + as newlines. + * A backslash `\` may be used to escape characters in the string. The `\` + may be used to escape a double-quote or a `\` but is simply ignored when + preceding any other character. +* a named enumerated value, specific to that operand position. For example, + the `OpMemoryModel` takes a named Addressing Model operand (e.g. `Logical` or + `Physical32`), and a named Memory Model operand (e.g. `Simple` or `OpenCL`). + Named enumerated values are only meaningful in specific positions, and will + otherwise generate an error. +* a mask expression, consisting of one or more mask enum names separated + by `|`. For example, the expression `NotNaN|NotInf|NSZ` denotes the mask + which is the combination of the `NotNaN`, `NotInf`, and `NSZ` flags. +* an injected immediate integer: `!`. See [below](#immediate). +* an ID, e.g. `%foo`. See [below](#id). +* the name of an extended instruction. For example, `sqrt` in an extended + instruction such as `%f = OpExtInst %f32 %OpenCLImport sqrt %arg` +* the name of an opcode for OpSpecConstantOp, but where the `Op` prefix + is removed. For example, the following indicates the use of an integer + addition in a specialization constant computation: + `%sum = OpSpecConstantOp %i32 IAdd %a %b` + +## ID Definitions & Usage + + +An ID _definition_ pertains to the `` of an instruction, and ID +_usage_ is a use of an ID as an input to an instruction. + +An ID in the assembly language begins with `%` and must be followed by a name +consisting of one or more letters, numbers or underscore characters. + +For every ID in the assembly program, the assembler generates a unique number +called the ID's internal number. Then each ID reference translates into its +internal number in the SPIR-V output. Internal numbers are unique within the +compilation unit: no two IDs in the same unit will share internal numbers. + +The disassembler generates IDs where the name is always a decimal number +greater than 0. + +So the example can be rewritten using more user-friendly names, as follows: +``` + OpCapability Shader + OpMemoryModel Logical Simple + OpEntryPoint GLCompute %main "main" + OpExecutionMode %main LocalSize 64 64 1 + %void = OpTypeVoid +%fnMain = OpTypeFunction %void + %main = OpFunction %void None %fnMain +%lbMain = OpLabel + OpReturn + OpFunctionEnd +``` + +## Floating point literals + + +The assembler and disassembler support floating point literals in both +decimal and hexadecimal form. + +The syntax for a floating point literal is the same as floating point +constants in the C programming language, except: +* An optional leading minus (`-`) is part of the literal. +* An optional type specifier suffix is not allowed. +Infinity and NaN values are expressed in hexadecimal float literals +by using the maximum representable exponent for the bit width. + +For example, in 32-bit floating point, 8 bits are used for the exponent, and the +exponent bias is 127. So the maximum representable unbiased exponent is 128. +Therefore, we represent the infinities and some NaNs as follows: + +``` +%float32 = OpTypeFloat 32 +%inf = OpConstant %float32 0x1p+128 +%neginf = OpConstant %float32 -0x1p+128 +%aNaN = OpConstant %float32 0x1.8p+128 +%moreNaN = OpConstant %float32 -0x1.0002p+128 +``` +The assembler preserves all the bits of a NaN value. For example, the encoding +of `%aNaN` in the previous example is the same as the word with bits +`0x7fc00000`, and `%moreNaN` is encoded as `0xff800100`. + +The disassembler prints infinite, NaN, and subnormal values in hexadecimal form. +Zero and normal values are printed in decimal form with enough digits +to preserve all significand bits. + +## Arbitrary Integers + + +When writing tests it can be useful to emit an invalid 32 bit word into the +binary stream at arbitrary positions within the assembly. To specify an +arbitrary word into the stream the prefix `!` is used, this takes the form +`!`. Here is an example. + +``` +OpCapability !0x0000FF00 +``` + +Any token in a valid assembly program may be replaced by `!` -- even +tokens that dictate how the rest of the instruction is parsed. Consider, for +example, the following assembly program: + +``` +%4 = OpConstant %1 123 456 789 OpExecutionMode %2 LocalSize 11 22 33 +OpExecutionMode %3 InputLines +``` + +The tokens `OpConstant`, `LocalSize`, and `InputLines` may be replaced by random +`!` values, and the assembler will still assemble an output binary with +three instructions. It will not necessarily be valid SPIR-V, but it will +faithfully reflect the input text. + +You may wonder how the assembler recognizes the instruction structure (including +instruction boundaries) in the text with certain crucial tokens replaced by +arbitrary integers. If, say, `OpConstant` becomes a `!` whose value +differs from the binary representation of `OpConstant` (remember that this +feature is intended for fine-grain control in SPIR-V testing), the assembler +generally has no idea what that value stands for. So how does it know there is +exactly one `` and three number literals following in that instruction, +before the next one begins? And if `LocalSize` is replaced by an arbitrary +`!`, how does it know to take the next three tokens (instead of zero or +one, both of which are possible in the absence of certainty that `LocalSize` +provided)? The answer is a simple rule governing the parsing of instructions +with `!` in them: + +When a token in the assembly program is a `!`, that integer value is +emitted into the binary output, and parsing proceeds differently than before: +each subsequent token not recognized as an OpCode or a is emitted +into the binary output without any checking; when a recognizable OpCode or a + is eventually encountered, it begins a new instruction and parsing +returns to normal. (If a subsequent OpCode is never found, then this alternate +parsing mode handles all the remaining tokens in the program.) + +The assembler processes the tokens encountered in alternate parsing mode as +follows: + +* If the token is a number literal, since context may be lost, the number + is interpreted as a 32-bit value and output as a single word. In order to + specify multiple-word literals in alternate-parsing mode, further uses of + `!` tokens may be required. + All formats supported by `strtoul()` are accepted. +* If the token is a string literal, it outputs a sequence of words representing + the string as defined in the SPIR-V specification for Literal String. +* If the token is an ID, it outputs the ID's internal number. +* If the token is another `!`, it outputs that integer. +* Any other token causes the assembler to quit with an error. + +Note that this has some interesting consequences, including: + +* When an OpCode is replaced by `!`, the integer value should encode + the instruction's word count, as specified in the physical-layout section of + the SPIR-V specification. + +* Consecutive instructions may have their OpCode replaced by `!` and + still produce valid SPIR-V. For example, `!262187 %1 %2 "abc" !327739 %1 %3 6 + %2` will successfully assemble into SPIR-V declaring a constant and a + PrivateGlobal variable. + +* Enums (such as `DontInline` or `SubgroupMemory`, for instance) are not handled + by the alternate parsing mode. They must be replaced by `!` for + successful assembly. + +* The `` on the left-hand side of an assignment cannot be a + `!`. The `` can be still be manually controlled if desired + by expressing the entire instruction as `!` tokens for its opcode and + operands. + +* The `=` sign cannot be processed by the alternate parsing mode if the OpCode + following it is a `!`. + +* When replacing a named ID with `!`, it is possible to generate + unintentionally valid SPIR-V. If the integer provided happens to equal a + number generated for an existing named ID, it will result in a reference to + that named ID being output. This may be valid SPIR-V, contrary to the + presumed intention of the writer. + +## Notes + +* Some enumerants cannot be used by name, because the target instruction +in which they are meaningful take an ID reference instead of a literal value. +For example: + * Named enumerated value `CmdExecTime` from section 3.30 Kernel + Profiling Info is used in constructing a mask value supplied as + an ID for `OpCaptureEventProfilingInfo`. But no other instruction + has enough context to bring the enumerant names from section 3.30 + into scope. + * Similarly, the names in section 3.29 Kernel Enqueue Flags are used to + construct a value supplied as an ID to the Flags argument of + OpEnqueueKernel. + * Similarly for the names in section 3.25 Memory Semantics. + * Similarly for the names in section 3.27 Scope. +* Some enumerants cannot be used by name, because they only name values +returned by an instruction: + * Enumerants from 3.12 Image Channel Order name possible values returned + by the `OpImageQueryOrder` instruction. + * Enumerants from 3.13 Image Channel Data Type name possible values + returned by the `OpImageQueryFormat` instruction. diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/assembly_context_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/assembly_context_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/assembly_context_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/assembly_context_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,76 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +#include +#include + +#include "source/instruction.h" + +using libspirv::AssemblyContext; +using spvtest::AutoText; +using spvtest::Concatenate; +using ::testing::Eq; + +namespace { + +struct EncodeStringCase { + std::string str; + std::vector initial_contents; +}; + +using EncodeStringTest = ::testing::TestWithParam; + +TEST_P(EncodeStringTest, Sample) { + AssemblyContext context(AutoText(""), nullptr); + spv_instruction_t inst; + inst.words = GetParam().initial_contents; + ASSERT_EQ(SPV_SUCCESS, + context.binaryEncodeString(GetParam().str.c_str(), &inst)); + // We already trust MakeVector + EXPECT_THAT(inst.words, + Eq(Concatenate({GetParam().initial_contents, + spvtest::MakeVector(GetParam().str)}))); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + BinaryEncodeString, EncodeStringTest, + ::testing::ValuesIn(std::vector{ + // Use cases that exercise at least one to two words, + // and both empty and non-empty initial contents. + {"", {}}, + {"", {1,2,3}}, + {"a", {}}, + {"a", {4}}, + {"ab", {4}}, + {"abc", {}}, + {"abc", {18}}, + {"abcd", {}}, + {"abcd", {22}}, + {"abcde", {4}}, + {"abcdef", {}}, + {"abcdef", {99,42}}, + {"abcdefg", {}}, + {"abcdefg", {101}}, + {"abcdefgh", {}}, + {"abcdefgh", {102, 103, 104}}, + // A very long string, encoded after an initial word. + // SPIR-V limits strings to 65535 characters. + {std::string(65535, 'a'), {1}}, + }),); +// clang-format on + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/assembly_format_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/assembly_format_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/assembly_format_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/assembly_format_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,35 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "test_fixture.h" + +namespace { + +using spvtest::ScopedContext; +using spvtest::TextToBinaryTest; + +TEST_F(TextToBinaryTest, NotPlacingResultIDAtTheBeginning) { + SetText("OpTypeMatrix %1 %2 1000"); + EXPECT_EQ(SPV_ERROR_INVALID_TEXT, + spvTextToBinary(ScopedContext().context, text.str, text.length, + &binary, &diagnostic)); + ASSERT_NE(nullptr, diagnostic); + EXPECT_STREQ( + "Expected at the beginning of an instruction, found " + "'OpTypeMatrix'.", + diagnostic->error); + EXPECT_EQ(0u, diagnostic->position.line); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/binary_destroy_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/binary_destroy_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/binary_destroy_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/binary_destroy_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,42 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +#include "test_fixture.h" + +namespace { + +using spvtest::ScopedContext; + +TEST(BinaryDestroy, Null) { + // There is no state or return value to check. Just check + // for the ability to call the API without abnormal termination. + spvBinaryDestroy(nullptr); +} + +using BinaryDestroySomething = spvtest::TextToBinaryTest; + +// Checks safety of destroying a validly constructed binary. +TEST_F(BinaryDestroySomething, Default) { + // Use a binary object constructed by the API instead of rolling our own. + SetText("OpSource OpenCL_C 120"); + spv_binary my_binary = nullptr; + ASSERT_EQ(SPV_SUCCESS, spvTextToBinary(ScopedContext().context, text.str, + text.length, &my_binary, &diagnostic)); + ASSERT_NE(nullptr, my_binary); + spvBinaryDestroy(my_binary); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/binary_endianness_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/binary_endianness_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/binary_endianness_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/binary_endianness_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,52 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +namespace { + +TEST(BinaryEndianness, InvalidCode) { + uint32_t invalidMagicNumber[] = {0}; + spv_const_binary_t binary = {invalidMagicNumber, 1}; + spv_endianness_t endian; + ASSERT_EQ(SPV_ERROR_INVALID_BINARY, spvBinaryEndianness(&binary, &endian)); +} + +TEST(BinaryEndianness, Little) { + uint32_t magicNumber; + if (I32_ENDIAN_HOST == I32_ENDIAN_LITTLE) { + magicNumber = 0x07230203; + } else { + magicNumber = 0x03022307; + } + spv_const_binary_t binary = {&magicNumber, 1}; + spv_endianness_t endian; + ASSERT_EQ(SPV_SUCCESS, spvBinaryEndianness(&binary, &endian)); + ASSERT_EQ(SPV_ENDIANNESS_LITTLE, endian); +} + +TEST(BinaryEndianness, Big) { + uint32_t magicNumber; + if (I32_ENDIAN_HOST == I32_ENDIAN_BIG) { + magicNumber = 0x07230203; + } else { + magicNumber = 0x03022307; + } + spv_const_binary_t binary = {&magicNumber, 1}; + spv_endianness_t endian; + ASSERT_EQ(SPV_SUCCESS, spvBinaryEndianness(&binary, &endian)); + ASSERT_EQ(SPV_ENDIANNESS_BIG, endian); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/binary_header_get_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/binary_header_get_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/binary_header_get_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/binary_header_get_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,82 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "source/spirv_constant.h" +#include "unit_spirv.h" + +namespace { + +class BinaryHeaderGet : public ::testing::Test { + public: + BinaryHeaderGet() { memset(code, 0, sizeof(code)); } + + virtual void SetUp() { + code[0] = SpvMagicNumber; + code[1] = SpvVersion; + code[2] = SPV_GENERATOR_CODEPLAY; + code[3] = 1; // NOTE: Bound + code[4] = 0; // NOTE: Schema; reserved + code[5] = 0; // NOTE: Instructions + + binary.code = code; + binary.wordCount = 6; + } + spv_const_binary_t get_const_binary() { + return spv_const_binary_t{binary.code, binary.wordCount}; + } + virtual void TearDown() {} + + uint32_t code[6]; + spv_binary_t binary; +}; + +TEST_F(BinaryHeaderGet, Default) { + spv_endianness_t endian; + spv_const_binary_t const_bin = get_const_binary(); + ASSERT_EQ(SPV_SUCCESS, spvBinaryEndianness(&const_bin, &endian)); + + spv_header_t header; + ASSERT_EQ(SPV_SUCCESS, spvBinaryHeaderGet(&const_bin, endian, &header)); + + ASSERT_EQ(static_cast(SpvMagicNumber), header.magic); + ASSERT_EQ(0x00010300u, header.version); + ASSERT_EQ(static_cast(SPV_GENERATOR_CODEPLAY), header.generator); + ASSERT_EQ(1u, header.bound); + ASSERT_EQ(0u, header.schema); + ASSERT_EQ(&code[5], header.instructions); +} + +TEST_F(BinaryHeaderGet, InvalidCode) { + spv_const_binary_t my_binary = {nullptr, 0}; + spv_header_t header; + ASSERT_EQ(SPV_ERROR_INVALID_BINARY, + spvBinaryHeaderGet(&my_binary, SPV_ENDIANNESS_LITTLE, &header)); +} + +TEST_F(BinaryHeaderGet, InvalidPointerHeader) { + spv_const_binary_t const_bin = get_const_binary(); + ASSERT_EQ(SPV_ERROR_INVALID_POINTER, + spvBinaryHeaderGet(&const_bin, SPV_ENDIANNESS_LITTLE, nullptr)); +} + +TEST_F(BinaryHeaderGet, TruncatedHeader) { + for (uint8_t i = 1; i < SPV_INDEX_INSTRUCTION; i++) { + binary.wordCount = i; + spv_const_binary_t const_bin = get_const_binary(); + ASSERT_EQ(SPV_ERROR_INVALID_BINARY, + spvBinaryHeaderGet(&const_bin, SPV_ENDIANNESS_LITTLE, nullptr)); + } +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/binary_parse_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/binary_parse_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/binary_parse_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/binary_parse_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,898 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include + +#include "gmock/gmock.h" +#include "latest_version_opencl_std_header.h" +#include "source/message.h" +#include "source/table.h" +#include "test_fixture.h" +#include "unit_spirv.h" + +// Returns true if two spv_parsed_operand_t values are equal. +// To use this operator, this definition must appear in the same namespace +// as spv_parsed_operand_t. +static bool operator==(const spv_parsed_operand_t& a, + const spv_parsed_operand_t& b) { + return a.offset == b.offset && a.num_words == b.num_words && + a.type == b.type && a.number_kind == b.number_kind && + a.number_bit_width == b.number_bit_width; +} + +namespace { + +using ::libspirv::SetContextMessageConsumer; +using ::spvtest::Concatenate; +using ::spvtest::MakeInstruction; +using ::spvtest::MakeVector; +using ::spvtest::ScopedContext; +using ::testing::_; +using ::testing::AnyOf; +using ::testing::Eq; +using ::testing::InSequence; +using ::testing::Return; + +// An easily-constructible and comparable object for the contents of an +// spv_parsed_instruction_t. Unlike spv_parsed_instruction_t, owns the memory +// of its components. +struct ParsedInstruction { + explicit ParsedInstruction(const spv_parsed_instruction_t& inst) + : words(inst.words, inst.words + inst.num_words), + opcode(static_cast(inst.opcode)), + ext_inst_type(inst.ext_inst_type), + type_id(inst.type_id), + result_id(inst.result_id), + operands(inst.operands, inst.operands + inst.num_operands) {} + + std::vector words; + SpvOp opcode; + spv_ext_inst_type_t ext_inst_type; + uint32_t type_id; + uint32_t result_id; + std::vector operands; + + bool operator==(const ParsedInstruction& b) const { + return words == b.words && opcode == b.opcode && + ext_inst_type == b.ext_inst_type && type_id == b.type_id && + result_id == b.result_id && operands == b.operands; + } +}; + +// Prints a ParsedInstruction object to the given output stream, and returns +// the stream. +std::ostream& operator<<(std::ostream& os, const ParsedInstruction& inst) { + os << "\nParsedInstruction( {"; + spvtest::PrintTo(spvtest::WordVector(inst.words), &os); + os << "}, opcode: " << int(inst.opcode) + << " ext_inst_type: " << int(inst.ext_inst_type) + << " type_id: " << inst.type_id << " result_id: " << inst.result_id; + for (const auto& operand : inst.operands) { + os << " { offset: " << operand.offset << " num_words: " << operand.num_words + << " type: " << int(operand.type) + << " number_kind: " << int(operand.number_kind) + << " number_bit_width: " << int(operand.number_bit_width) << "}"; + } + os << ")"; + return os; +} + +// Sanity check for the equality operator on ParsedInstruction. +TEST(ParsedInstruction, ZeroInitializedAreEqual) { + spv_parsed_instruction_t pi = {}; + ParsedInstruction a(pi); + ParsedInstruction b(pi); + EXPECT_THAT(a, ::testing::TypedEq(b)); +} + +// Googlemock class receiving Header/Instruction calls from spvBinaryParse(). +class MockParseClient { + public: + MOCK_METHOD6(Header, spv_result_t(spv_endianness_t endian, uint32_t magic, + uint32_t version, uint32_t generator, + uint32_t id_bound, uint32_t reserved)); + MOCK_METHOD1(Instruction, spv_result_t(const ParsedInstruction&)); +}; + +// Casts user_data as MockParseClient and invokes its Header(). +spv_result_t invoke_header(void* user_data, spv_endianness_t endian, + uint32_t magic, uint32_t version, uint32_t generator, + uint32_t id_bound, uint32_t reserved) { + return static_cast(user_data)->Header( + endian, magic, version, generator, id_bound, reserved); +} + +// Casts user_data as MockParseClient and invokes its Instruction(). +spv_result_t invoke_instruction( + void* user_data, const spv_parsed_instruction_t* parsed_instruction) { + return static_cast(user_data)->Instruction( + ParsedInstruction(*parsed_instruction)); +} + +// The SPIR-V module header words for the Khronos Assembler generator, +// for a module with an ID bound of 1. +const uint32_t kHeaderForBound1[] = { + SpvMagicNumber, SpvVersion, + SPV_GENERATOR_WORD(SPV_GENERATOR_KHRONOS_ASSEMBLER, 0), 1 /*bound*/, + 0 /*schema*/}; + +// Returns the expected SPIR-V module header words for the Khronos +// Assembler generator, and with a given Id bound. +std::vector ExpectedHeaderForBound(uint32_t bound) { + return {SpvMagicNumber, 0x10000, + SPV_GENERATOR_WORD(SPV_GENERATOR_KHRONOS_ASSEMBLER, 0), bound, 0}; +} + +// Returns a parsed operand for a non-number value at the given word offset +// within an instruction. +spv_parsed_operand_t MakeSimpleOperand(uint16_t offset, + spv_operand_type_t type) { + return {offset, 1, type, SPV_NUMBER_NONE, 0}; +} + +// Returns a parsed operand for a literal unsigned integer value at the given +// word offset within an instruction. +spv_parsed_operand_t MakeLiteralNumberOperand(uint16_t offset) { + return {offset, 1, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_NUMBER_UNSIGNED_INT, + 32}; +} + +// Returns a parsed operand for a literal string value at the given +// word offset within an instruction. +spv_parsed_operand_t MakeLiteralStringOperand(uint16_t offset, + uint16_t length) { + return {offset, length, SPV_OPERAND_TYPE_LITERAL_STRING, SPV_NUMBER_NONE, 0}; +} + +// Returns a ParsedInstruction for an OpTypeVoid instruction that would +// generate the given result Id. +ParsedInstruction MakeParsedVoidTypeInstruction(uint32_t result_id) { + const auto void_inst = MakeInstruction(SpvOpTypeVoid, {result_id}); + const auto void_operands = std::vector{ + MakeSimpleOperand(1, SPV_OPERAND_TYPE_RESULT_ID)}; + const spv_parsed_instruction_t parsed_void_inst = { + void_inst.data(), + static_cast(void_inst.size()), + SpvOpTypeVoid, + SPV_EXT_INST_TYPE_NONE, + 0, // type id + result_id, + void_operands.data(), + static_cast(void_operands.size())}; + return ParsedInstruction(parsed_void_inst); +} + +// Returns a ParsedInstruction for an OpTypeInt instruction that generates +// the given result Id for a 32-bit signed integer scalar type. +ParsedInstruction MakeParsedInt32TypeInstruction(uint32_t result_id) { + const auto i32_inst = MakeInstruction(SpvOpTypeInt, {result_id, 32, 1}); + const auto i32_operands = std::vector{ + MakeSimpleOperand(1, SPV_OPERAND_TYPE_RESULT_ID), + MakeLiteralNumberOperand(2), MakeLiteralNumberOperand(3)}; + spv_parsed_instruction_t parsed_i32_inst = { + i32_inst.data(), + static_cast(i32_inst.size()), + SpvOpTypeInt, + SPV_EXT_INST_TYPE_NONE, + 0, // type id + result_id, + i32_operands.data(), + static_cast(i32_operands.size())}; + return ParsedInstruction(parsed_i32_inst); +} + +class BinaryParseTest : public spvtest::TextToBinaryTestBase<::testing::Test> { + protected: + void Parse(const SpirvVector& words, spv_result_t expected_result, + bool flip_words = false) { + SpirvVector flipped_words(words); + SCOPED_TRACE(flip_words ? "Flipped Endianness" : "Normal Endianness"); + if (flip_words) { + std::transform(flipped_words.begin(), flipped_words.end(), + flipped_words.begin(), [](const uint32_t raw_word) { + return spvFixWord(raw_word, + I32_ENDIAN_HOST == I32_ENDIAN_BIG + ? SPV_ENDIANNESS_LITTLE + : SPV_ENDIANNESS_BIG); + }); + } + EXPECT_EQ(expected_result, + spvBinaryParse(ScopedContext().context, &client_, + flipped_words.data(), flipped_words.size(), + invoke_header, invoke_instruction, &diagnostic_)); + } + + spv_diagnostic diagnostic_ = nullptr; + MockParseClient client_; +}; + +// Adds an EXPECT_CALL to client_->Header() with appropriate parameters, +// including bound. Returns the EXPECT_CALL result. +#define EXPECT_HEADER(bound) \ + EXPECT_CALL( \ + client_, \ + Header(AnyOf(SPV_ENDIANNESS_LITTLE, SPV_ENDIANNESS_BIG), SpvMagicNumber, \ + 0x10000, SPV_GENERATOR_WORD(SPV_GENERATOR_KHRONOS_ASSEMBLER, 0), \ + bound, 0 /*reserved*/)) + +static const bool kSwapEndians[] = {false, true}; + +TEST_F(BinaryParseTest, EmptyModuleHasValidHeaderAndNoInstructionCallbacks) { + for (bool endian_swap : kSwapEndians) { + const auto words = CompileSuccessfully(""); + EXPECT_HEADER(1).WillOnce(Return(SPV_SUCCESS)); + EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. + Parse(words, SPV_SUCCESS, endian_swap); + EXPECT_EQ(nullptr, diagnostic_); + } +} + +TEST_F(BinaryParseTest, NullDiagnosticsIsOkForGoodParse) { + const auto words = CompileSuccessfully(""); + EXPECT_HEADER(1).WillOnce(Return(SPV_SUCCESS)); + EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. + EXPECT_EQ( + SPV_SUCCESS, + spvBinaryParse(ScopedContext().context, &client_, words.data(), + words.size(), invoke_header, invoke_instruction, nullptr)); +} + +TEST_F(BinaryParseTest, NullDiagnosticsIsOkForBadParse) { + auto words = CompileSuccessfully(""); + words.push_back(0xffffffff); // Certainly invalid instruction header. + EXPECT_HEADER(1).WillOnce(Return(SPV_SUCCESS)); + EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. + EXPECT_EQ( + SPV_ERROR_INVALID_BINARY, + spvBinaryParse(ScopedContext().context, &client_, words.data(), + words.size(), invoke_header, invoke_instruction, nullptr)); +} + +// Make sure that we don't blow up when both the consumer and the diagnostic are +// null. +TEST_F(BinaryParseTest, NullConsumerNullDiagnosticsForBadParse) { + auto words = CompileSuccessfully(""); + + auto ctx = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); + SetContextMessageConsumer(ctx, nullptr); + + words.push_back(0xffffffff); // Certainly invalid instruction header. + EXPECT_HEADER(1).WillOnce(Return(SPV_SUCCESS)); + EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, + spvBinaryParse(ctx, &client_, words.data(), words.size(), + invoke_header, invoke_instruction, nullptr)); + + spvContextDestroy(ctx); +} + +TEST_F(BinaryParseTest, SpecifyConsumerNullDiagnosticsForGoodParse) { + const auto words = CompileSuccessfully(""); + + auto ctx = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); + int invocation = 0; + SetContextMessageConsumer( + ctx, [&invocation](spv_message_level_t, const char*, + const spv_position_t&, const char*) { ++invocation; }); + + EXPECT_HEADER(1).WillOnce(Return(SPV_SUCCESS)); + EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. + EXPECT_EQ(SPV_SUCCESS, + spvBinaryParse(ctx, &client_, words.data(), words.size(), + invoke_header, invoke_instruction, nullptr)); + EXPECT_EQ(0, invocation); + + spvContextDestroy(ctx); +} + +TEST_F(BinaryParseTest, SpecifyConsumerNullDiagnosticsForBadParse) { + auto words = CompileSuccessfully(""); + + auto ctx = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); + int invocation = 0; + SetContextMessageConsumer( + ctx, [&invocation](spv_message_level_t level, const char* source, + const spv_position_t& position, const char* message) { + ++invocation; + EXPECT_EQ(SPV_MSG_ERROR, level); + EXPECT_STREQ("input", source); + EXPECT_EQ(0u, position.line); + EXPECT_EQ(0u, position.column); + EXPECT_EQ(5u, position.index); + EXPECT_STREQ("Invalid opcode: 65535", message); + }); + + words.push_back(0xffffffff); // Certainly invalid instruction header. + EXPECT_HEADER(1).WillOnce(Return(SPV_SUCCESS)); + EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, + spvBinaryParse(ctx, &client_, words.data(), words.size(), + invoke_header, invoke_instruction, nullptr)); + EXPECT_EQ(1, invocation); + + spvContextDestroy(ctx); +} + +TEST_F(BinaryParseTest, SpecifyConsumerSpecifyDiagnosticsForGoodParse) { + const auto words = CompileSuccessfully(""); + + auto ctx = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); + int invocation = 0; + SetContextMessageConsumer( + ctx, [&invocation](spv_message_level_t, const char*, + const spv_position_t&, const char*) { ++invocation; }); + + EXPECT_HEADER(1).WillOnce(Return(SPV_SUCCESS)); + EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. + EXPECT_EQ(SPV_SUCCESS, + spvBinaryParse(ctx, &client_, words.data(), words.size(), + invoke_header, invoke_instruction, &diagnostic_)); + EXPECT_EQ(0, invocation); + EXPECT_EQ(nullptr, diagnostic_); + + spvContextDestroy(ctx); +} + +TEST_F(BinaryParseTest, SpecifyConsumerSpecifyDiagnosticsForBadParse) { + auto words = CompileSuccessfully(""); + + auto ctx = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); + int invocation = 0; + SetContextMessageConsumer( + ctx, [&invocation](spv_message_level_t, const char*, + const spv_position_t&, const char*) { ++invocation; }); + + words.push_back(0xffffffff); // Certainly invalid instruction header. + EXPECT_HEADER(1).WillOnce(Return(SPV_SUCCESS)); + EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, + spvBinaryParse(ctx, &client_, words.data(), words.size(), + invoke_header, invoke_instruction, &diagnostic_)); + EXPECT_EQ(0, invocation); + EXPECT_STREQ("Invalid opcode: 65535", diagnostic_->error); + + spvContextDestroy(ctx); +} + +TEST_F(BinaryParseTest, + ModuleWithSingleInstructionHasValidHeaderAndInstructionCallback) { + for (bool endian_swap : kSwapEndians) { + const auto words = CompileSuccessfully("%1 = OpTypeVoid"); + InSequence calls_expected_in_specific_order; + EXPECT_HEADER(2).WillOnce(Return(SPV_SUCCESS)); + EXPECT_CALL(client_, Instruction(MakeParsedVoidTypeInstruction(1))) + .WillOnce(Return(SPV_SUCCESS)); + Parse(words, SPV_SUCCESS, endian_swap); + EXPECT_EQ(nullptr, diagnostic_); + } +} + +TEST_F(BinaryParseTest, NullHeaderCallbackIsIgnored) { + const auto words = CompileSuccessfully("%1 = OpTypeVoid"); + EXPECT_CALL(client_, Header(_, _, _, _, _, _)) + .Times(0); // No header callback. + EXPECT_CALL(client_, Instruction(MakeParsedVoidTypeInstruction(1))) + .WillOnce(Return(SPV_SUCCESS)); + EXPECT_EQ(SPV_SUCCESS, spvBinaryParse(ScopedContext().context, &client_, + words.data(), words.size(), nullptr, + invoke_instruction, &diagnostic_)); + EXPECT_EQ(nullptr, diagnostic_); +} + +TEST_F(BinaryParseTest, NullInstructionCallbackIsIgnored) { + const auto words = CompileSuccessfully("%1 = OpTypeVoid"); + EXPECT_HEADER((2)).WillOnce(Return(SPV_SUCCESS)); + EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. + EXPECT_EQ(SPV_SUCCESS, + spvBinaryParse(ScopedContext().context, &client_, words.data(), + words.size(), invoke_header, nullptr, &diagnostic_)); + EXPECT_EQ(nullptr, diagnostic_); +} + +// Check the result of multiple instruction callbacks. +// +// This test exercises non-default values for the following members of the +// spv_parsed_instruction_t struct: words, num_words, opcode, result_id, +// operands, num_operands. +TEST_F(BinaryParseTest, TwoScalarTypesGenerateTwoInstructionCallbacks) { + for (bool endian_swap : kSwapEndians) { + const auto words = CompileSuccessfully( + "%1 = OpTypeVoid " + "%2 = OpTypeInt 32 1"); + InSequence calls_expected_in_specific_order; + EXPECT_HEADER(3).WillOnce(Return(SPV_SUCCESS)); + EXPECT_CALL(client_, Instruction(MakeParsedVoidTypeInstruction(1))) + .WillOnce(Return(SPV_SUCCESS)); + EXPECT_CALL(client_, Instruction(MakeParsedInt32TypeInstruction(2))) + .WillOnce(Return(SPV_SUCCESS)); + Parse(words, SPV_SUCCESS, endian_swap); + EXPECT_EQ(nullptr, diagnostic_); + } +} + +TEST_F(BinaryParseTest, EarlyReturnWithZeroPassingCallbacks) { + for (bool endian_swap : kSwapEndians) { + const auto words = CompileSuccessfully( + "%1 = OpTypeVoid " + "%2 = OpTypeInt 32 1"); + InSequence calls_expected_in_specific_order; + EXPECT_HEADER(3).WillOnce(Return(SPV_ERROR_INVALID_BINARY)); + // Early exit means no calls to Instruction(). + EXPECT_CALL(client_, Instruction(_)).Times(0); + Parse(words, SPV_ERROR_INVALID_BINARY, endian_swap); + // On error, the binary parser doesn't generate its own diagnostics. + EXPECT_EQ(nullptr, diagnostic_); + } +} + +TEST_F(BinaryParseTest, + EarlyReturnWithZeroPassingCallbacksAndSpecifiedResultCode) { + for (bool endian_swap : kSwapEndians) { + const auto words = CompileSuccessfully( + "%1 = OpTypeVoid " + "%2 = OpTypeInt 32 1"); + InSequence calls_expected_in_specific_order; + EXPECT_HEADER(3).WillOnce(Return(SPV_REQUESTED_TERMINATION)); + // Early exit means no calls to Instruction(). + EXPECT_CALL(client_, Instruction(_)).Times(0); + Parse(words, SPV_REQUESTED_TERMINATION, endian_swap); + // On early termination, the binary parser doesn't generate its own + // diagnostics. + EXPECT_EQ(nullptr, diagnostic_); + } +} + +TEST_F(BinaryParseTest, EarlyReturnWithOnePassingCallback) { + for (bool endian_swap : kSwapEndians) { + const auto words = CompileSuccessfully( + "%1 = OpTypeVoid " + "%2 = OpTypeInt 32 1 " + "%3 = OpTypeFloat 32"); + InSequence calls_expected_in_specific_order; + EXPECT_HEADER(4).WillOnce(Return(SPV_SUCCESS)); + EXPECT_CALL(client_, Instruction(MakeParsedVoidTypeInstruction(1))) + .WillOnce(Return(SPV_REQUESTED_TERMINATION)); + Parse(words, SPV_REQUESTED_TERMINATION, endian_swap); + // On early termination, the binary parser doesn't generate its own + // diagnostics. + EXPECT_EQ(nullptr, diagnostic_); + } +} + +TEST_F(BinaryParseTest, EarlyReturnWithTwoPassingCallbacks) { + for (bool endian_swap : kSwapEndians) { + const auto words = CompileSuccessfully( + "%1 = OpTypeVoid " + "%2 = OpTypeInt 32 1 " + "%3 = OpTypeFloat 32"); + InSequence calls_expected_in_specific_order; + EXPECT_HEADER(4).WillOnce(Return(SPV_SUCCESS)); + EXPECT_CALL(client_, Instruction(MakeParsedVoidTypeInstruction(1))) + .WillOnce(Return(SPV_SUCCESS)); + EXPECT_CALL(client_, Instruction(MakeParsedInt32TypeInstruction(2))) + .WillOnce(Return(SPV_REQUESTED_TERMINATION)); + Parse(words, SPV_REQUESTED_TERMINATION, endian_swap); + // On early termination, the binary parser doesn't generate its own + // diagnostics. + EXPECT_EQ(nullptr, diagnostic_); + } +} + +TEST_F(BinaryParseTest, InstructionWithStringOperand) { + const std::string str = + "the future is already here, it's just not evenly distributed"; + const auto str_words = MakeVector(str); + const auto instruction = MakeInstruction(SpvOpName, {99}, str_words); + const auto words = Concatenate({ExpectedHeaderForBound(100), instruction}); + InSequence calls_expected_in_specific_order; + EXPECT_HEADER(100).WillOnce(Return(SPV_SUCCESS)); + const auto operands = std::vector{ + MakeSimpleOperand(1, SPV_OPERAND_TYPE_ID), + MakeLiteralStringOperand(2, static_cast(str_words.size()))}; + EXPECT_CALL(client_, + Instruction(ParsedInstruction(spv_parsed_instruction_t{ + instruction.data(), static_cast(instruction.size()), + SpvOpName, SPV_EXT_INST_TYPE_NONE, 0 /*type id*/, + 0 /* No result id for OpName*/, operands.data(), + static_cast(operands.size())}))) + .WillOnce(Return(SPV_SUCCESS)); + // Since we are actually checking the output, don't test the + // endian-swapped version. + Parse(words, SPV_SUCCESS, false); + EXPECT_EQ(nullptr, diagnostic_); +} + +// Checks for non-zero values for the result_id and ext_inst_type members +// spv_parsed_instruction_t. +TEST_F(BinaryParseTest, ExtendedInstruction) { + const auto words = CompileSuccessfully( + "%extcl = OpExtInstImport \"OpenCL.std\" " + "%result = OpExtInst %float %extcl sqrt %x"); + EXPECT_HEADER(5).WillOnce(Return(SPV_SUCCESS)); + EXPECT_CALL(client_, Instruction(_)).WillOnce(Return(SPV_SUCCESS)); + // We're only interested in the second call to Instruction(): + const auto operands = std::vector{ + MakeSimpleOperand(1, SPV_OPERAND_TYPE_TYPE_ID), + MakeSimpleOperand(2, SPV_OPERAND_TYPE_RESULT_ID), + MakeSimpleOperand(3, + SPV_OPERAND_TYPE_ID), // Extended instruction set Id + MakeSimpleOperand(4, SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER), + MakeSimpleOperand(5, SPV_OPERAND_TYPE_ID), // Id of the argument + }; + const auto instruction = MakeInstruction( + SpvOpExtInst, + {2, 3, 1, static_cast(OpenCLLIB::Entrypoints::Sqrt), 4}); + EXPECT_CALL(client_, + Instruction(ParsedInstruction(spv_parsed_instruction_t{ + instruction.data(), static_cast(instruction.size()), + SpvOpExtInst, SPV_EXT_INST_TYPE_OPENCL_STD, 2 /*type id*/, + 3 /*result id*/, operands.data(), + static_cast(operands.size())}))) + .WillOnce(Return(SPV_SUCCESS)); + // Since we are actually checking the output, don't test the + // endian-swapped version. + Parse(words, SPV_SUCCESS, false); + EXPECT_EQ(nullptr, diagnostic_); +} + +// A binary parser diagnostic test case where we provide the words array +// pointer and word count explicitly. +struct WordsAndCountDiagnosticCase { + const uint32_t* words; + size_t num_words; + std::string expected_diagnostic; +}; + +using BinaryParseWordsAndCountDiagnosticTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>; + +TEST_P(BinaryParseWordsAndCountDiagnosticTest, WordAndCountCases) { + EXPECT_EQ( + SPV_ERROR_INVALID_BINARY, + spvBinaryParse(ScopedContext().context, nullptr, GetParam().words, + GetParam().num_words, nullptr, nullptr, &diagnostic)); + ASSERT_NE(nullptr, diagnostic); + EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic)); +} + +INSTANTIATE_TEST_CASE_P( + BinaryParseDiagnostic, BinaryParseWordsAndCountDiagnosticTest, + ::testing::ValuesIn(std::vector{ + {nullptr, 0, "Missing module."}, + {kHeaderForBound1, 0, + "Module has incomplete header: only 0 words instead of 5"}, + {kHeaderForBound1, 1, + "Module has incomplete header: only 1 words instead of 5"}, + {kHeaderForBound1, 2, + "Module has incomplete header: only 2 words instead of 5"}, + {kHeaderForBound1, 3, + "Module has incomplete header: only 3 words instead of 5"}, + {kHeaderForBound1, 4, + "Module has incomplete header: only 4 words instead of 5"}, + }), ); + +// A binary parser diagnostic test case where a vector of words is +// provided. We'll use this to express cases that can't be created +// via the assembler. Either we want to make a malformed instruction, +// or an invalid case the assembler would reject. +struct WordVectorDiagnosticCase { + std::vector words; + std::string expected_diagnostic; +}; + +using BinaryParseWordVectorDiagnosticTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>; + +TEST_P(BinaryParseWordVectorDiagnosticTest, WordVectorCases) { + const auto& words = GetParam().words; + EXPECT_THAT(spvBinaryParse(ScopedContext().context, nullptr, words.data(), + words.size(), nullptr, nullptr, &diagnostic), + AnyOf(SPV_ERROR_INVALID_BINARY, SPV_ERROR_INVALID_ID)); + ASSERT_NE(nullptr, diagnostic); + EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic)); +} + +INSTANTIATE_TEST_CASE_P( + BinaryParseDiagnostic, BinaryParseWordVectorDiagnosticTest, + ::testing::ValuesIn(std::vector{ + {Concatenate({ExpectedHeaderForBound(1), {spvOpcodeMake(0, SpvOpNop)}}), + "Invalid instruction word count: 0"}, + {Concatenate( + {ExpectedHeaderForBound(1), + {spvOpcodeMake(1, static_cast( + std::numeric_limits::max()))}}), + "Invalid opcode: 65535"}, + {Concatenate({ExpectedHeaderForBound(1), + MakeInstruction(SpvOpNop, {42})}), + "Invalid instruction OpNop starting at word 5: expected " + "no more operands after 1 words, but stated word count is 2."}, + // Supply several more unexpectd words. + {Concatenate({ExpectedHeaderForBound(1), + MakeInstruction(SpvOpNop, {42, 43, 44, 45, 46, 47})}), + "Invalid instruction OpNop starting at word 5: expected " + "no more operands after 1 words, but stated word count is 7."}, + {Concatenate({ExpectedHeaderForBound(1), + MakeInstruction(SpvOpTypeVoid, {1, 2})}), + "Invalid instruction OpTypeVoid starting at word 5: expected " + "no more operands after 2 words, but stated word count is 3."}, + {Concatenate({ExpectedHeaderForBound(1), + MakeInstruction(SpvOpTypeVoid, {1, 2, 5, 9, 10})}), + "Invalid instruction OpTypeVoid starting at word 5: expected " + "no more operands after 2 words, but stated word count is 6."}, + {Concatenate({ExpectedHeaderForBound(1), + MakeInstruction(SpvOpTypeInt, {1, 32, 1, 9})}), + "Invalid instruction OpTypeInt starting at word 5: expected " + "no more operands after 4 words, but stated word count is 5."}, + {Concatenate({ExpectedHeaderForBound(1), + MakeInstruction(SpvOpTypeInt, {1})}), + "End of input reached while decoding OpTypeInt starting at word 5:" + " expected more operands after 2 words."}, + + // Check several cases for running off the end of input. + + // Detect a missing single word operand. + {Concatenate({ExpectedHeaderForBound(1), + {spvOpcodeMake(2, SpvOpTypeStruct)}}), + "End of input reached while decoding OpTypeStruct starting at word" + " 5: missing result ID operand at word offset 1."}, + // Detect this a missing a multi-word operand to OpConstant. + // We also lie and say the OpConstant instruction has 5 words when + // it only has 3. Corresponds to something like this: + // %1 = OpTypeInt 64 0 + // %2 = OpConstant %1 + {Concatenate({ExpectedHeaderForBound(3), + {MakeInstruction(SpvOpTypeInt, {1, 64, 0})}, + {spvOpcodeMake(5, SpvOpConstant), 1, 2}}), + "End of input reached while decoding OpConstant starting at word" + " 9: missing possibly multi-word literal number operand at word " + "offset 3."}, + // Detect when we provide only one word from the 64-bit literal, + // and again lie about the number of words in the instruction. + {Concatenate({ExpectedHeaderForBound(3), + {MakeInstruction(SpvOpTypeInt, {1, 64, 0})}, + {spvOpcodeMake(5, SpvOpConstant), 1, 2, 42}}), + "End of input reached while decoding OpConstant starting at word" + " 9: truncated possibly multi-word literal number operand at word " + "offset 3."}, + // Detect when a required string operand is missing. + // Also, lie about the length of the instruction. + {Concatenate({ExpectedHeaderForBound(3), + {spvOpcodeMake(3, SpvOpString), 1}}), + "End of input reached while decoding OpString starting at word" + " 5: missing literal string operand at word offset 2."}, + // Detect when a required string operand is truncated: it's missing + // a null terminator. Catching the error avoids a buffer overrun. + {Concatenate({ExpectedHeaderForBound(3), + {spvOpcodeMake(4, SpvOpString), 1, 0x41414141, + 0x41414141}}), + "End of input reached while decoding OpString starting at word" + " 5: truncated literal string operand at word offset 2."}, + // Detect when an optional string operand is truncated: it's missing + // a null terminator. Catching the error avoids a buffer overrun. + // (It is valid for an optional string operand to be absent.) + {Concatenate({ExpectedHeaderForBound(3), + {spvOpcodeMake(6, SpvOpSource), + static_cast(SpvSourceLanguageOpenCL_C), 210, + 1 /* file id */, + /*start of string*/ 0x41414141, 0x41414141}}), + "End of input reached while decoding OpSource starting at word" + " 5: truncated literal string operand at word offset 4."}, + + // (End of input exhaustion test cases.) + + // In this case the instruction word count is too small, where + // it would truncate a multi-word operand to OpConstant. + {Concatenate({ExpectedHeaderForBound(3), + {MakeInstruction(SpvOpTypeInt, {1, 64, 0})}, + {spvOpcodeMake(4, SpvOpConstant), 1, 2, 44, 44}}), + "Invalid word count: OpConstant starting at word 9 says it has 4" + " words, but found 5 words instead."}, + // Word count is to small, where it would truncate a literal string. + {Concatenate({ExpectedHeaderForBound(2), + {spvOpcodeMake(3, SpvOpString), 1, 0x41414141, 0}}), + "Invalid word count: OpString starting at word 5 says it has 3" + " words, but found 4 words instead."}, + // Word count is too large. The string terminates before the last + // word. + {Concatenate({ExpectedHeaderForBound(2), + {spvOpcodeMake(4, SpvOpString), 1 /* result id */}, + MakeVector("abc"), + {0 /* this word does not belong*/}}), + "Invalid instruction OpString starting at word 5: expected no more" + " operands after 3 words, but stated word count is 4."}, + // Word count is too large. There are too many words after the string + // literal. A linkage attribute decoration is the only case in SPIR-V + // where a string operand is followed by another operand. + {Concatenate({ExpectedHeaderForBound(2), + {spvOpcodeMake(6, SpvOpDecorate), 1 /* target id */, + static_cast(SpvDecorationLinkageAttributes)}, + MakeVector("abc"), + {static_cast(SpvLinkageTypeImport), + 0 /* does not belong */}}), + "Invalid instruction OpDecorate starting at word 5: expected no more" + " operands after 5 words, but stated word count is 6."}, + // Like the previous case, but with 5 extra words. + {Concatenate({ExpectedHeaderForBound(2), + {spvOpcodeMake(10, SpvOpDecorate), 1 /* target id */, + static_cast(SpvDecorationLinkageAttributes)}, + MakeVector("abc"), + {static_cast(SpvLinkageTypeImport), + /* don't belong */ 0, 1, 2, 3, 4}}), + "Invalid instruction OpDecorate starting at word 5: expected no more" + " operands after 5 words, but stated word count is 10."}, + // Like the previous two cases, but with OpMemberDecorate. + {Concatenate({ExpectedHeaderForBound(2), + {spvOpcodeMake(7, SpvOpMemberDecorate), 1 /* target id */, + 42 /* member index */, + static_cast(SpvDecorationLinkageAttributes)}, + MakeVector("abc"), + {static_cast(SpvLinkageTypeImport), + 0 /* does not belong */}}), + "Invalid instruction OpMemberDecorate starting at word 5: expected no" + " more operands after 6 words, but stated word count is 7."}, + {Concatenate({ExpectedHeaderForBound(2), + {spvOpcodeMake(11, SpvOpMemberDecorate), + 1 /* target id */, 42 /* member index */, + static_cast(SpvDecorationLinkageAttributes)}, + MakeVector("abc"), + {static_cast(SpvLinkageTypeImport), + /* don't belong */ 0, 1, 2, 3, 4}}), + "Invalid instruction OpMemberDecorate starting at word 5: expected no" + " more operands after 6 words, but stated word count is 11."}, + // Word count is too large. There should be no more words + // after the RelaxedPrecision decoration. + {Concatenate({ExpectedHeaderForBound(2), + {spvOpcodeMake(4, SpvOpDecorate), 1 /* target id */, + static_cast(SpvDecorationRelaxedPrecision), + 0 /* does not belong */}}), + "Invalid instruction OpDecorate starting at word 5: expected no" + " more operands after 3 words, but stated word count is 4."}, + // Word count is too large. There should be only one word after + // the SpecId decoration enum word. + {Concatenate({ExpectedHeaderForBound(2), + {spvOpcodeMake(5, SpvOpDecorate), 1 /* target id */, + static_cast(SpvDecorationSpecId), + 42 /* the spec id */, 0 /* does not belong */}}), + "Invalid instruction OpDecorate starting at word 5: expected no" + " more operands after 4 words, but stated word count is 5."}, + {Concatenate({ExpectedHeaderForBound(2), + {spvOpcodeMake(2, SpvOpTypeVoid), 0}}), + "Error: Result Id is 0"}, + {Concatenate({ + ExpectedHeaderForBound(2), + {spvOpcodeMake(2, SpvOpTypeVoid), 1}, + {spvOpcodeMake(2, SpvOpTypeBool), 1}, + }), + "Id 1 is defined more than once"}, + {Concatenate({ExpectedHeaderForBound(3), + MakeInstruction(SpvOpExtInst, {2, 3, 100, 4, 5})}), + "OpExtInst set Id 100 does not reference an OpExtInstImport result " + "Id"}, + {Concatenate({ExpectedHeaderForBound(101), + MakeInstruction(SpvOpExtInstImport, {100}, + MakeVector("OpenCL.std")), + // OpenCL cos is #14 + MakeInstruction(SpvOpExtInst, {2, 3, 100, 14, 5, 999})}), + "Invalid instruction OpExtInst starting at word 10: expected no " + "more operands after 6 words, but stated word count is 7."}, + // In this case, the OpSwitch selector refers to an invalid ID. + {Concatenate({ExpectedHeaderForBound(3), + MakeInstruction(SpvOpSwitch, {1, 2, 42, 3})}), + "Invalid OpSwitch: selector id 1 has no type"}, + // In this case, the OpSwitch selector refers to an ID that has + // no type. + {Concatenate({ExpectedHeaderForBound(3), + MakeInstruction(SpvOpLabel, {1}), + MakeInstruction(SpvOpSwitch, {1, 2, 42, 3})}), + "Invalid OpSwitch: selector id 1 has no type"}, + {Concatenate({ExpectedHeaderForBound(3), + MakeInstruction(SpvOpTypeInt, {1, 32, 0}), + MakeInstruction(SpvOpSwitch, {1, 3, 42, 3})}), + "Invalid OpSwitch: selector id 1 is a type, not a value"}, + {Concatenate({ExpectedHeaderForBound(3), + MakeInstruction(SpvOpTypeFloat, {1, 32}), + MakeInstruction(SpvOpConstant, {1, 2, 0x78f00000}), + MakeInstruction(SpvOpSwitch, {2, 3, 42, 3})}), + "Invalid OpSwitch: selector id 2 is not a scalar integer"}, + {Concatenate({ExpectedHeaderForBound(3), + MakeInstruction(SpvOpExtInstImport, {1}, + MakeVector("invalid-import"))}), + "Invalid extended instruction import 'invalid-import'"}, + {Concatenate({ + ExpectedHeaderForBound(3), + MakeInstruction(SpvOpTypeInt, {1, 32, 0}), + MakeInstruction(SpvOpConstant, {2, 2, 42}), + }), + "Type Id 2 is not a type"}, + {Concatenate({ + ExpectedHeaderForBound(3), + MakeInstruction(SpvOpTypeBool, {1}), + MakeInstruction(SpvOpConstant, {1, 2, 42}), + }), + "Type Id 1 is not a scalar numeric type"}, + }), ); + +// A binary parser diagnostic case generated from an assembly text input. +struct AssemblyDiagnosticCase { + std::string assembly; + std::string expected_diagnostic; +}; + +using BinaryParseAssemblyDiagnosticTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>; + +TEST_P(BinaryParseAssemblyDiagnosticTest, AssemblyCases) { + auto words = CompileSuccessfully(GetParam().assembly); + EXPECT_THAT(spvBinaryParse(ScopedContext().context, nullptr, words.data(), + words.size(), nullptr, nullptr, &diagnostic), + AnyOf(SPV_ERROR_INVALID_BINARY, SPV_ERROR_INVALID_ID)); + ASSERT_NE(nullptr, diagnostic); + EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic)); +} + +INSTANTIATE_TEST_CASE_P( + BinaryParseDiagnostic, BinaryParseAssemblyDiagnosticTest, + ::testing::ValuesIn(std::vector{ + {"%1 = OpConstant !0 42", "Error: Type Id is 0"}, + // A required id is 0. + {"OpName !0 \"foo\"", "Id is 0"}, + // An optional id is 0, in this case the optional + // initializer. + {"%2 = OpVariable %1 CrossWorkgroup !0", "Id is 0"}, + {"OpControlBarrier !0 %1 %2", "scope ID is 0"}, + {"OpControlBarrier %1 !0 %2", "scope ID is 0"}, + {"OpControlBarrier %1 %2 !0", "memory semantics ID is 0"}, + {"%import = OpExtInstImport \"GLSL.std.450\" " + "%result = OpExtInst %type %import !999999 %x", + "Invalid extended instruction number: 999999"}, + {"%2 = OpSpecConstantOp %1 !1000 %2", + "Invalid OpSpecConstantOp opcode: 1000"}, + {"OpCapability !9999", "Invalid capability operand: 9999"}, + {"OpSource !9999 100", "Invalid source language operand: 9999"}, + {"OpEntryPoint !9999", "Invalid execution model operand: 9999"}, + {"OpMemoryModel !9999", "Invalid addressing model operand: 9999"}, + {"OpMemoryModel Logical !9999", "Invalid memory model operand: 9999"}, + {"OpExecutionMode %1 !9999", "Invalid execution mode operand: 9999"}, + {"OpTypeForwardPointer %1 !9999", + "Invalid storage class operand: 9999"}, + {"%2 = OpTypeImage %1 !9999", "Invalid dimensionality operand: 9999"}, + {"%2 = OpTypeImage %1 1D 0 0 0 0 !9999", + "Invalid image format operand: 9999"}, + {"OpDecorate %1 FPRoundingMode !9999", + "Invalid floating-point rounding mode operand: 9999"}, + {"OpDecorate %1 LinkageAttributes \"C\" !9999", + "Invalid linkage type operand: 9999"}, + {"%1 = OpTypePipe !9999", "Invalid access qualifier operand: 9999"}, + {"OpDecorate %1 FuncParamAttr !9999", + "Invalid function parameter attribute operand: 9999"}, + {"OpDecorate %1 !9999", "Invalid decoration operand: 9999"}, + {"OpDecorate %1 BuiltIn !9999", "Invalid built-in operand: 9999"}, + {"%2 = OpGroupIAdd %1 %3 !9999", + "Invalid group operation operand: 9999"}, + {"OpDecorate %1 FPFastMathMode !63", + "Invalid floating-point fast math mode operand: 63 has invalid mask " + "component 32"}, + {"%2 = OpFunction %2 !31", + "Invalid function control operand: 31 has invalid mask component 16"}, + {"OpLoopMerge %1 %2 !7", + "Invalid loop control operand: 7 has invalid mask component 4"}, + {"%2 = OpImageFetch %1 %image %coord !511", + "Invalid image operand: 511 has invalid mask component 256"}, + {"OpSelectionMerge %1 !7", + "Invalid selection control operand: 7 has invalid mask component 4"}, + }), ); + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/binary_strnlen_s_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/binary_strnlen_s_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/binary_strnlen_s_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/binary_strnlen_s_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016 Google 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. + +#include "unit_spirv.h" + +namespace { + +TEST(Strnlen, Samples) { + EXPECT_EQ(0u, spv_strnlen_s(nullptr, 0)); + EXPECT_EQ(0u, spv_strnlen_s(nullptr, 5)); + EXPECT_EQ(0u, spv_strnlen_s("abc", 0)); + EXPECT_EQ(1u, spv_strnlen_s("abc", 1)); + EXPECT_EQ(3u, spv_strnlen_s("abc", 3)); + EXPECT_EQ(3u, spv_strnlen_s("abc\0", 5)); + EXPECT_EQ(0u, spv_strnlen_s("\0", 5)); + EXPECT_EQ(1u, spv_strnlen_s("a\0c", 5)); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/binary_to_text.literal_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/binary_to_text.literal_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/binary_to_text.literal_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/binary_to_text.literal_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +#include "gmock/gmock.h" +#include "test_fixture.h" + +using ::testing::Eq; + +namespace { + +using RoundTripLiteralsTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(RoundTripLiteralsTest, Sample) { + EXPECT_THAT(EncodeAndDecodeSuccessfully(GetParam()), Eq(GetParam())); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + StringLiterals, RoundTripLiteralsTest, + ::testing::ValuesIn(std::vector{ + "OpName %1 \"\"\n", // empty + "OpName %1 \"foo\"\n", // normal + "OpName %1 \"foo bar\"\n", // string with spaces + "OpName %1 \"foo\tbar\"\n", // string with tab + "OpName %1 \"\tfoo\"\n", // starts with tab + "OpName %1 \" foo\"\n", // starts with space + "OpName %1 \"foo \"\n", // ends with space + "OpName %1 \"foo\t\"\n", // ends with tab + "OpName %1 \"foo\nbar\"\n", // contains newline + "OpName %1 \"\nfoo\nbar\"\n", // starts with newline + "OpName %1 \"\n\n\nfoo\nbar\"\n", // multiple newlines + "OpName %1 \"\\\"foo\nbar\\\"\"\n", // escaped quote + "OpName %1 \"\\\\foo\nbar\\\\\"\n", // escaped backslash + "OpName %1 \"\xE4\xBA\xB2\"\n", // UTF-8 + }),); +// clang-format on + +using RoundTripSpecialCaseLiteralsTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>>; + +// Test case where the generated disassembly is not the same as the +// assembly passed in. +TEST_P(RoundTripSpecialCaseLiteralsTest, Sample) { + EXPECT_THAT(EncodeAndDecodeSuccessfully(std::get<0>(GetParam())), + Eq(std::get<1>(GetParam()))); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + StringLiterals, RoundTripSpecialCaseLiteralsTest, + ::testing::ValuesIn(std::vector>{ + {"OpName %1 \"\\foo\"\n", "OpName %1 \"foo\"\n"}, // Escape f + {"OpName %1 \"\\\nfoo\"\n", "OpName %1 \"\nfoo\"\n"}, // Escape newline + {"OpName %1 \"\\\xE4\xBA\xB2\"\n", "OpName %1 \"\xE4\xBA\xB2\"\n"}, // Escape utf-8 + }),); +// clang-format on + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/binary_to_text_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/binary_to_text_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/binary_to_text_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/binary_to_text_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,553 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +#include + +#include "gmock/gmock.h" + +#include "source/spirv_constant.h" +#include "test_fixture.h" + +namespace { + +using spvtest::AutoText; +using spvtest::ScopedContext; +using spvtest::TextToBinaryTest; +using std::get; +using std::tuple; +using ::testing::Combine; +using ::testing::Eq; +using ::testing::HasSubstr; + +class BinaryToText : public ::testing::Test { + public: + BinaryToText() : context(spvContextCreate(SPV_ENV_UNIVERSAL_1_0)) {} + ~BinaryToText() { spvContextDestroy(context); } + + virtual void SetUp() { + const char* textStr = R"( + OpSource OpenCL_C 12 + OpMemoryModel Physical64 OpenCL + OpSourceExtension "PlaceholderExtensionName" + OpEntryPoint Kernel %1 "foo" + OpExecutionMode %1 LocalSizeHint 1 1 1 + %2 = OpTypeVoid + %3 = OpTypeBool + %4 = OpTypeInt 8 0 + %5 = OpTypeInt 8 1 + %6 = OpTypeInt 16 0 + %7 = OpTypeInt 16 1 + %8 = OpTypeInt 32 0 + %9 = OpTypeInt 32 1 +%10 = OpTypeInt 64 0 +%11 = OpTypeInt 64 1 +%12 = OpTypeFloat 16 +%13 = OpTypeFloat 32 +%14 = OpTypeFloat 64 +%15 = OpTypeVector %4 2 +)"; + spv_text_t text = {textStr, strlen(textStr)}; + spv_diagnostic diagnostic = nullptr; + spv_result_t error = + spvTextToBinary(context, text.str, text.length, &binary, &diagnostic); + if (error) { + spvDiagnosticPrint(diagnostic); + spvDiagnosticDestroy(diagnostic); + ASSERT_EQ(SPV_SUCCESS, error); + } + } + + virtual void TearDown() { spvBinaryDestroy(binary); } + + // Compiles the given assembly text, and saves it into 'binary'. + void CompileSuccessfully(std::string text) { + spv_diagnostic diagnostic = nullptr; + EXPECT_EQ(SPV_SUCCESS, spvTextToBinary(context, text.c_str(), text.size(), + &binary, &diagnostic)); + } + + spv_context context; + spv_binary binary; +}; + +TEST_F(BinaryToText, Default) { + spv_text text = nullptr; + spv_diagnostic diagnostic = nullptr; + ASSERT_EQ( + SPV_SUCCESS, + spvBinaryToText(context, binary->code, binary->wordCount, + SPV_BINARY_TO_TEXT_OPTION_NONE, &text, &diagnostic)); + printf("%s", text->str); + spvTextDestroy(text); +} + +TEST_F(BinaryToText, MissingModule) { + spv_text text; + spv_diagnostic diagnostic = nullptr; + EXPECT_EQ( + SPV_ERROR_INVALID_BINARY, + spvBinaryToText(context, nullptr, 42, SPV_BINARY_TO_TEXT_OPTION_NONE, + &text, &diagnostic)); + EXPECT_THAT(diagnostic->error, Eq(std::string("Missing module."))); + if (diagnostic) { + spvDiagnosticPrint(diagnostic); + spvDiagnosticDestroy(diagnostic); + } +} + +TEST_F(BinaryToText, TruncatedModule) { + // Make a valid module with zero instructions. + CompileSuccessfully(""); + EXPECT_EQ(SPV_INDEX_INSTRUCTION, binary->wordCount); + + for (size_t length = 0; length < SPV_INDEX_INSTRUCTION; length++) { + spv_text text = nullptr; + spv_diagnostic diagnostic = nullptr; + EXPECT_EQ( + SPV_ERROR_INVALID_BINARY, + spvBinaryToText(context, binary->code, length, + SPV_BINARY_TO_TEXT_OPTION_NONE, &text, &diagnostic)); + ASSERT_NE(nullptr, diagnostic); + std::stringstream expected; + expected << "Module has incomplete header: only " << length + << " words instead of " << SPV_INDEX_INSTRUCTION; + EXPECT_THAT(diagnostic->error, Eq(expected.str())); + spvDiagnosticDestroy(diagnostic); + } +} + +TEST_F(BinaryToText, InvalidMagicNumber) { + CompileSuccessfully(""); + std::vector damaged_binary(binary->code, + binary->code + binary->wordCount); + damaged_binary[SPV_INDEX_MAGIC_NUMBER] ^= 123; + + spv_diagnostic diagnostic = nullptr; + spv_text text; + EXPECT_EQ( + SPV_ERROR_INVALID_BINARY, + spvBinaryToText(context, damaged_binary.data(), damaged_binary.size(), + SPV_BINARY_TO_TEXT_OPTION_NONE, &text, &diagnostic)); + ASSERT_NE(nullptr, diagnostic); + std::stringstream expected; + expected << "Invalid SPIR-V magic number '" << std::hex + << damaged_binary[SPV_INDEX_MAGIC_NUMBER] << "'."; + EXPECT_THAT(diagnostic->error, Eq(expected.str())); + spvDiagnosticDestroy(diagnostic); +} + +struct FailedDecodeCase { + std::string source_text; + std::vector appended_instruction; + std::string expected_error_message; +}; + +using BinaryToTextFail = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(BinaryToTextFail, EncodeSuccessfullyDecodeFailed) { + EXPECT_THAT(EncodeSuccessfullyDecodeFailed(GetParam().source_text, + GetParam().appended_instruction), + Eq(GetParam().expected_error_message)); +} + +INSTANTIATE_TEST_CASE_P( + InvalidIds, BinaryToTextFail, + ::testing::ValuesIn(std::vector{ + {"", spvtest::MakeInstruction(SpvOpTypeVoid, {0}), + "Error: Result Id is 0"}, + {"", spvtest::MakeInstruction(SpvOpConstant, {0, 1, 42}), + "Error: Type Id is 0"}, + {"%1 = OpTypeVoid", spvtest::MakeInstruction(SpvOpTypeVoid, {1}), + "Id 1 is defined more than once"}, + {"%1 = OpTypeVoid\n" + "%2 = OpNot %1 %foo", + spvtest::MakeInstruction(SpvOpNot, {1, 2, 3}), + "Id 2 is defined more than once"}, + {"%1 = OpTypeVoid\n" + "%2 = OpNot %1 %foo", + spvtest::MakeInstruction(SpvOpNot, {1, 1, 3}), + "Id 1 is defined more than once"}, + // The following are the two failure cases for + // Parser::setNumericTypeInfoForType. + {"", spvtest::MakeInstruction(SpvOpConstant, {500, 1, 42}), + "Type Id 500 is not a type"}, + {"%1 = OpTypeInt 32 0\n" + "%2 = OpTypeVector %1 4", + spvtest::MakeInstruction(SpvOpConstant, {2, 3, 999}), + "Type Id 2 is not a scalar numeric type"}, + }), ); + +INSTANTIATE_TEST_CASE_P( + InvalidIdsCheckedDuringLiteralCaseParsing, BinaryToTextFail, + ::testing::ValuesIn(std::vector{ + {"", spvtest::MakeInstruction(SpvOpSwitch, {1, 2, 3, 4}), + "Invalid OpSwitch: selector id 1 has no type"}, + {"%1 = OpTypeVoid\n", + spvtest::MakeInstruction(SpvOpSwitch, {1, 2, 3, 4}), + "Invalid OpSwitch: selector id 1 is a type, not a value"}, + {"%1 = OpConstantTrue !500", + spvtest::MakeInstruction(SpvOpSwitch, {1, 2, 3, 4}), + "Type Id 500 is not a type"}, + {"%1 = OpTypeFloat 32\n%2 = OpConstant %1 1.5", + spvtest::MakeInstruction(SpvOpSwitch, {2, 3, 4, 5}), + "Invalid OpSwitch: selector id 2 is not a scalar integer"}, + }), ); + +TEST_F(TextToBinaryTest, OneInstruction) { + const std::string input = "OpSource OpenCL_C 12\n"; + EXPECT_EQ(input, EncodeAndDecodeSuccessfully(input)); +} + +// Exercise the case where an operand itself has operands. +// This could detect problems in updating the expected-set-of-operands +// list. +TEST_F(TextToBinaryTest, OperandWithOperands) { + const std::string input = R"(OpEntryPoint Kernel %1 "foo" +OpExecutionMode %1 LocalSizeHint 100 200 300 +%2 = OpTypeVoid +%3 = OpTypeFunction %2 +%1 = OpFunction %1 None %3 +)"; + EXPECT_EQ(input, EncodeAndDecodeSuccessfully(input)); +} + +using RoundTripInstructionsTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>>; + +TEST_P(RoundTripInstructionsTest, Sample) { + EXPECT_THAT(EncodeAndDecodeSuccessfully(get<1>(GetParam()), + SPV_BINARY_TO_TEXT_OPTION_NONE, + get<0>(GetParam())), + Eq(get<1>(GetParam()))); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + NumericLiterals, RoundTripInstructionsTest, + // This test is independent of environment, so just test the one. + Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3), + ::testing::ValuesIn(std::vector{ + "%1 = OpTypeInt 12 0\n%2 = OpConstant %1 1867\n", + "%1 = OpTypeInt 12 1\n%2 = OpConstant %1 1867\n", + "%1 = OpTypeInt 12 1\n%2 = OpConstant %1 -1867\n", + "%1 = OpTypeInt 32 0\n%2 = OpConstant %1 1867\n", + "%1 = OpTypeInt 32 1\n%2 = OpConstant %1 1867\n", + "%1 = OpTypeInt 32 1\n%2 = OpConstant %1 -1867\n", + "%1 = OpTypeInt 64 0\n%2 = OpConstant %1 18446744073709551615\n", + "%1 = OpTypeInt 64 1\n%2 = OpConstant %1 9223372036854775807\n", + "%1 = OpTypeInt 64 1\n%2 = OpConstant %1 -9223372036854775808\n", + // 16-bit floats print as hex floats. + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.ff4p+16\n", + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.d2cp-10\n", + // 32-bit floats + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -3.125\n", + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1.8p+128\n", // NaN + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1.0002p+128\n", // NaN + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1p+128\n", // Inf + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1p+128\n", // -Inf + // 64-bit floats + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -3.125\n", + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.ffffffffffffap-1023\n", // small normal + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.ffffffffffffap-1023\n", + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.8p+1024\n", // NaN + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.0002p+1024\n", // NaN + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1p+1024\n", // Inf + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1p+1024\n", // -Inf + })), ); +// clang-format on + +INSTANTIATE_TEST_CASE_P( + MemoryAccessMasks, RoundTripInstructionsTest, + Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3), + ::testing::ValuesIn(std::vector{ + "OpStore %1 %2\n", // 3 words long. + "OpStore %1 %2 None\n", // 4 words long, explicit final 0. + "OpStore %1 %2 Volatile\n", + "OpStore %1 %2 Aligned 8\n", + "OpStore %1 %2 Nontemporal\n", + // Combinations show the names from LSB to MSB + "OpStore %1 %2 Volatile|Aligned 16\n", + "OpStore %1 %2 Volatile|Nontemporal\n", + "OpStore %1 %2 Volatile|Aligned|Nontemporal 32\n", + })), ); + +INSTANTIATE_TEST_CASE_P( + FPFastMathModeMasks, RoundTripInstructionsTest, + Combine( + ::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3), + ::testing::ValuesIn(std::vector{ + "OpDecorate %1 FPFastMathMode None\n", + "OpDecorate %1 FPFastMathMode NotNaN\n", + "OpDecorate %1 FPFastMathMode NotInf\n", + "OpDecorate %1 FPFastMathMode NSZ\n", + "OpDecorate %1 FPFastMathMode AllowRecip\n", + "OpDecorate %1 FPFastMathMode Fast\n", + // Combinations show the names from LSB to MSB + "OpDecorate %1 FPFastMathMode NotNaN|NotInf\n", + "OpDecorate %1 FPFastMathMode NSZ|AllowRecip\n", + "OpDecorate %1 FPFastMathMode NotNaN|NotInf|NSZ|AllowRecip|Fast\n", + })), ); + +INSTANTIATE_TEST_CASE_P( + LoopControlMasks, RoundTripInstructionsTest, + Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_UNIVERSAL_1_3, SPV_ENV_UNIVERSAL_1_2), + ::testing::ValuesIn(std::vector{ + "OpLoopMerge %1 %2 None\n", + "OpLoopMerge %1 %2 Unroll\n", + "OpLoopMerge %1 %2 DontUnroll\n", + "OpLoopMerge %1 %2 Unroll|DontUnroll\n", + })), ); + +INSTANTIATE_TEST_CASE_P(LoopControlMasksV11, RoundTripInstructionsTest, + Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_UNIVERSAL_1_2, + SPV_ENV_UNIVERSAL_1_3), + ::testing::ValuesIn(std::vector{ + "OpLoopMerge %1 %2 DependencyInfinite\n", + "OpLoopMerge %1 %2 DependencyLength 8\n", + })), ); + +INSTANTIATE_TEST_CASE_P( + SelectionControlMasks, RoundTripInstructionsTest, + Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_UNIVERSAL_1_3, SPV_ENV_UNIVERSAL_1_2), + ::testing::ValuesIn(std::vector{ + "OpSelectionMerge %1 None\n", + "OpSelectionMerge %1 Flatten\n", + "OpSelectionMerge %1 DontFlatten\n", + "OpSelectionMerge %1 Flatten|DontFlatten\n", + })), ); + +INSTANTIATE_TEST_CASE_P( + FunctionControlMasks, RoundTripInstructionsTest, + Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3), + ::testing::ValuesIn(std::vector{ + "%2 = OpFunction %1 None %3\n", + "%2 = OpFunction %1 Inline %3\n", + "%2 = OpFunction %1 DontInline %3\n", + "%2 = OpFunction %1 Pure %3\n", + "%2 = OpFunction %1 Const %3\n", + "%2 = OpFunction %1 Inline|Pure|Const %3\n", + "%2 = OpFunction %1 DontInline|Const %3\n", + })), ); + +INSTANTIATE_TEST_CASE_P( + ImageMasks, RoundTripInstructionsTest, + Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3), + ::testing::ValuesIn(std::vector{ + "%2 = OpImageFetch %1 %3 %4\n", + "%2 = OpImageFetch %1 %3 %4 None\n", + "%2 = OpImageFetch %1 %3 %4 Bias %5\n", + "%2 = OpImageFetch %1 %3 %4 Lod %5\n", + "%2 = OpImageFetch %1 %3 %4 Grad %5 %6\n", + "%2 = OpImageFetch %1 %3 %4 ConstOffset %5\n", + "%2 = OpImageFetch %1 %3 %4 Offset %5\n", + "%2 = OpImageFetch %1 %3 %4 ConstOffsets %5\n", + "%2 = OpImageFetch %1 %3 %4 Sample %5\n", + "%2 = OpImageFetch %1 %3 %4 MinLod %5\n", + "%2 = OpImageFetch %1 %3 %4 Bias|Lod|Grad %5 %6 %7 %8\n", + "%2 = OpImageFetch %1 %3 %4 ConstOffset|Offset|ConstOffsets" + " %5 %6 %7\n", + "%2 = OpImageFetch %1 %3 %4 Sample|MinLod %5 %6\n", + "%2 = OpImageFetch %1 %3 %4" + " Bias|Lod|Grad|ConstOffset|Offset|ConstOffsets|Sample|MinLod" + " %5 %6 %7 %8 %9 %10 %11 %12 %13\n"})), ); + +INSTANTIATE_TEST_CASE_P( + NewInstructionsInSPIRV1_2, RoundTripInstructionsTest, + Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3), + ::testing::ValuesIn(std::vector{ + "OpExecutionModeId %1 SubgroupsPerWorkgroupId %2\n", + "OpExecutionModeId %1 LocalSizeId %2 %3 %4\n", + "OpExecutionModeId %1 LocalSizeHintId %2\n", + "OpDecorateId %1 AlignmentId %2\n", + "OpDecorateId %1 MaxByteOffsetId %2\n", + })), ); + +using MaskSorting = TextToBinaryTest; + +TEST_F(MaskSorting, MasksAreSortedFromLSBToMSB) { + EXPECT_THAT(EncodeAndDecodeSuccessfully( + "OpStore %1 %2 Nontemporal|Aligned|Volatile 32"), + Eq("OpStore %1 %2 Volatile|Aligned|Nontemporal 32\n")); + EXPECT_THAT( + EncodeAndDecodeSuccessfully( + "OpDecorate %1 FPFastMathMode NotInf|Fast|AllowRecip|NotNaN|NSZ"), + Eq("OpDecorate %1 FPFastMathMode NotNaN|NotInf|NSZ|AllowRecip|Fast\n")); + EXPECT_THAT( + EncodeAndDecodeSuccessfully("OpLoopMerge %1 %2 DontUnroll|Unroll"), + Eq("OpLoopMerge %1 %2 Unroll|DontUnroll\n")); + EXPECT_THAT( + EncodeAndDecodeSuccessfully("OpSelectionMerge %1 DontFlatten|Flatten"), + Eq("OpSelectionMerge %1 Flatten|DontFlatten\n")); + EXPECT_THAT(EncodeAndDecodeSuccessfully( + "%2 = OpFunction %1 DontInline|Const|Pure|Inline %3"), + Eq("%2 = OpFunction %1 Inline|DontInline|Pure|Const %3\n")); + EXPECT_THAT(EncodeAndDecodeSuccessfully( + "%2 = OpImageFetch %1 %3 %4" + " MinLod|Sample|Offset|Lod|Grad|ConstOffsets|ConstOffset|Bias" + " %5 %6 %7 %8 %9 %10 %11 %12 %13\n"), + Eq("%2 = OpImageFetch %1 %3 %4" + " Bias|Lod|Grad|ConstOffset|Offset|ConstOffsets|Sample|MinLod" + " %5 %6 %7 %8 %9 %10 %11 %12 %13\n")); +} + +using OperandTypeTest = TextToBinaryTest; + +TEST_F(OperandTypeTest, OptionalTypedLiteralNumber) { + const std::string input = + "%1 = OpTypeInt 32 0\n" + "%2 = OpConstant %1 42\n" + "OpSwitch %2 %3 100 %4\n"; + EXPECT_EQ(input, EncodeAndDecodeSuccessfully(input)); +} + +using IndentTest = spvtest::TextToBinaryTest; + +TEST_F(IndentTest, Sample) { + const std::string input = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +%1 = OpTypeInt 32 0 +%2 = OpTypeStruct %1 %3 %4 %5 %6 %7 %8 %9 %10 ; force IDs into double digits +%11 = OpConstant %1 42 +OpStore %2 %3 Aligned|Volatile 4 ; bogus, but not indented +)"; + const std::string expected = + R"( OpCapability Shader + OpMemoryModel Logical GLSL450 + %1 = OpTypeInt 32 0 + %2 = OpTypeStruct %1 %3 %4 %5 %6 %7 %8 %9 %10 + %11 = OpConstant %1 42 + OpStore %2 %3 Volatile|Aligned 4 +)"; + EXPECT_THAT( + EncodeAndDecodeSuccessfully(input, SPV_BINARY_TO_TEXT_OPTION_INDENT), + expected); +} + +using FriendlyNameDisassemblyTest = spvtest::TextToBinaryTest; + +TEST_F(FriendlyNameDisassemblyTest, Sample) { + const std::string input = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +%1 = OpTypeInt 32 0 +%2 = OpTypeStruct %1 %3 %4 %5 %6 %7 %8 %9 %10 ; force IDs into double digits +%11 = OpConstant %1 42 +)"; + const std::string expected = + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +%uint = OpTypeInt 32 0 +%_struct_2 = OpTypeStruct %uint %3 %4 %5 %6 %7 %8 %9 %10 +%uint_42 = OpConstant %uint 42 +)"; + EXPECT_THAT(EncodeAndDecodeSuccessfully( + input, SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES), + expected); +} + +TEST_F(TextToBinaryTest, ShowByteOffsetsWhenRequested) { + const std::string input = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +%1 = OpTypeInt 32 0 +%2 = OpTypeVoid +)"; + const std::string expected = + R"(OpCapability Shader ; 0x00000014 +OpMemoryModel Logical GLSL450 ; 0x0000001c +%1 = OpTypeInt 32 0 ; 0x00000028 +%2 = OpTypeVoid ; 0x00000038 +)"; + EXPECT_THAT(EncodeAndDecodeSuccessfully( + input, SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET), + expected); +} + +// Test version string. +TEST_F(TextToBinaryTest, VersionString) { + auto words = CompileSuccessfully(""); + spv_text decoded_text = nullptr; + EXPECT_THAT(spvBinaryToText(ScopedContext().context, words.data(), + words.size(), SPV_BINARY_TO_TEXT_OPTION_NONE, + &decoded_text, &diagnostic), + Eq(SPV_SUCCESS)); + EXPECT_EQ(nullptr, diagnostic); + + EXPECT_THAT(decoded_text->str, HasSubstr("Version: 1.0\n")) + << EncodeAndDecodeSuccessfully(""); + spvTextDestroy(decoded_text); +} + +// Test generator string. + +// A test case for the generator string. This allows us to +// test both of the 16-bit components of the generator word. +struct GeneratorStringCase { + uint16_t generator; + uint16_t misc; + std::string expected; +}; + +using GeneratorStringTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>; + +TEST_P(GeneratorStringTest, Sample) { + auto words = CompileSuccessfully(""); + EXPECT_EQ(2u, SPV_INDEX_GENERATOR_NUMBER); + words[SPV_INDEX_GENERATOR_NUMBER] = + SPV_GENERATOR_WORD(GetParam().generator, GetParam().misc); + + spv_text decoded_text = nullptr; + EXPECT_THAT(spvBinaryToText(ScopedContext().context, words.data(), + words.size(), SPV_BINARY_TO_TEXT_OPTION_NONE, + &decoded_text, &diagnostic), + Eq(SPV_SUCCESS)); + EXPECT_THAT(diagnostic, Eq(nullptr)); + EXPECT_THAT(std::string(decoded_text->str), HasSubstr(GetParam().expected)); + spvTextDestroy(decoded_text); +} + +INSTANTIATE_TEST_CASE_P(GeneratorStrings, GeneratorStringTest, + ::testing::ValuesIn(std::vector{ + {SPV_GENERATOR_KHRONOS, 12, "Khronos; 12"}, + {SPV_GENERATOR_LUNARG, 99, "LunarG; 99"}, + {SPV_GENERATOR_VALVE, 1, "Valve; 1"}, + {SPV_GENERATOR_CODEPLAY, 65535, "Codeplay; 65535"}, + {SPV_GENERATOR_NVIDIA, 19, "NVIDIA; 19"}, + {SPV_GENERATOR_ARM, 1000, "ARM; 1000"}, + {SPV_GENERATOR_KHRONOS_LLVM_TRANSLATOR, 38, + "Khronos LLVM/SPIR-V Translator; 38"}, + {SPV_GENERATOR_KHRONOS_ASSEMBLER, 2, + "Khronos SPIR-V Tools Assembler; 2"}, + {SPV_GENERATOR_KHRONOS_GLSLANG, 1, + "Khronos Glslang Reference Front End; 1"}, + {1000, 18, "Unknown(1000); 18"}, + {65535, 32767, "Unknown(65535); 32767"}, + }), ); + +// TODO(dneto): Test new instructions and enums in SPIR-V 1.3 + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/bit_stream.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/bit_stream.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/bit_stream.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/bit_stream.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1424 @@ +// Copyright (c) 2017 Google 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. + +#include +#include +#include + +#include "gmock/gmock.h" +#include "util/bit_stream.h" + +namespace { + +using spvutils::BitReaderInterface; +using spvutils::BitReaderWord64; +using spvutils::BitsetToStream; +using spvutils::BitsToStream; +using spvutils::BitWriterInterface; +using spvutils::BitWriterWord64; +using spvutils::BufferToStream; +using spvutils::DecodeZigZag; +using spvutils::EncodeZigZag; +using spvutils::GetLowerBits; +using spvutils::Log2U64; +using spvutils::NumBitsToNumWords; +using spvutils::PadToWord; +using spvutils::StreamToBits; +using spvutils::StreamToBitset; +using spvutils::StreamToBuffer; + +// A simple and inefficient implementatition of BitWriterInterface, +// using std::stringstream. Intended for tests only. +class BitWriterStringStream : public BitWriterInterface { + public: + void WriteStream(const std::string& bits) override { ss_ << bits; } + + void WriteBits(uint64_t bits, size_t num_bits) override { + assert(num_bits <= 64); + ss_ << BitsToStream(bits, num_bits); + } + + size_t GetNumBits() const override { return ss_.str().size(); } + + std::vector GetDataCopy() const override { + return StreamToBuffer(ss_.str()); + } + + std::string GetStreamRaw() const { return ss_.str(); } + + private: + std::stringstream ss_; +}; + +// A simple and inefficient implementatition of BitReaderInterface. +// Intended for tests only. +class BitReaderFromString : public BitReaderInterface { + public: + explicit BitReaderFromString(std::string&& str) + : str_(std::move(str)), pos_(0) {} + + explicit BitReaderFromString(const std::vector& buffer) + : str_(BufferToStream(buffer)), pos_(0) {} + + explicit BitReaderFromString(const std::vector& buffer) + : str_(PadToWord<64>(BufferToStream(buffer))), pos_(0) {} + + size_t ReadBits(uint64_t* bits, size_t num_bits) override { + if (ReachedEnd()) return 0; + std::string sub = str_.substr(pos_, num_bits); + *bits = StreamToBits(sub); + pos_ += sub.length(); + return sub.length(); + } + + size_t GetNumReadBits() const override { return pos_; } + + bool ReachedEnd() const override { return pos_ >= str_.length(); } + + const std::string& GetStreamPadded64() const { return str_; } + + private: + std::string str_; + size_t pos_; +}; + +TEST(Log2U16, Test) { + EXPECT_EQ(0u, Log2U64(0)); + EXPECT_EQ(0u, Log2U64(1)); + EXPECT_EQ(1u, Log2U64(2)); + EXPECT_EQ(1u, Log2U64(3)); + EXPECT_EQ(2u, Log2U64(4)); + EXPECT_EQ(2u, Log2U64(5)); + EXPECT_EQ(2u, Log2U64(6)); + EXPECT_EQ(2u, Log2U64(7)); + EXPECT_EQ(3u, Log2U64(8)); + EXPECT_EQ(3u, Log2U64(9)); + EXPECT_EQ(3u, Log2U64(10)); + EXPECT_EQ(3u, Log2U64(11)); + EXPECT_EQ(3u, Log2U64(12)); + EXPECT_EQ(3u, Log2U64(13)); + EXPECT_EQ(3u, Log2U64(14)); + EXPECT_EQ(3u, Log2U64(15)); + EXPECT_EQ(4u, Log2U64(16)); + EXPECT_EQ(4u, Log2U64(17)); + EXPECT_EQ(5u, Log2U64(35)); + EXPECT_EQ(6u, Log2U64(72)); + EXPECT_EQ(7u, Log2U64(255)); + EXPECT_EQ(8u, Log2U64(256)); + EXPECT_EQ(15u, Log2U64(65535)); + EXPECT_EQ(16u, Log2U64(65536)); + EXPECT_EQ(19u, Log2U64(0xFFFFF)); + EXPECT_EQ(23u, Log2U64(0xFFFFFF)); + EXPECT_EQ(27u, Log2U64(0xFFFFFFF)); + EXPECT_EQ(31u, Log2U64(0xFFFFFFFF)); + EXPECT_EQ(35u, Log2U64(0xFFFFFFFFF)); + EXPECT_EQ(39u, Log2U64(0xFFFFFFFFFF)); + EXPECT_EQ(43u, Log2U64(0xFFFFFFFFFFF)); + EXPECT_EQ(47u, Log2U64(0xFFFFFFFFFFFF)); + EXPECT_EQ(51u, Log2U64(0xFFFFFFFFFFFFF)); + EXPECT_EQ(55u, Log2U64(0xFFFFFFFFFFFFFF)); + EXPECT_EQ(59u, Log2U64(0xFFFFFFFFFFFFFFF)); + EXPECT_EQ(63u, Log2U64(0xFFFFFFFFFFFFFFFF)); +} + +TEST(NumBitsToNumWords, Word8) { + EXPECT_EQ(0u, NumBitsToNumWords<8>(0)); + EXPECT_EQ(1u, NumBitsToNumWords<8>(1)); + EXPECT_EQ(1u, NumBitsToNumWords<8>(7)); + EXPECT_EQ(1u, NumBitsToNumWords<8>(8)); + EXPECT_EQ(2u, NumBitsToNumWords<8>(9)); + EXPECT_EQ(2u, NumBitsToNumWords<8>(16)); + EXPECT_EQ(3u, NumBitsToNumWords<8>(17)); + EXPECT_EQ(3u, NumBitsToNumWords<8>(23)); + EXPECT_EQ(3u, NumBitsToNumWords<8>(24)); + EXPECT_EQ(4u, NumBitsToNumWords<8>(25)); +} + +TEST(NumBitsToNumWords, Word64) { + EXPECT_EQ(0u, NumBitsToNumWords<64>(0)); + EXPECT_EQ(1u, NumBitsToNumWords<64>(1)); + EXPECT_EQ(1u, NumBitsToNumWords<64>(64)); + EXPECT_EQ(2u, NumBitsToNumWords<64>(65)); + EXPECT_EQ(2u, NumBitsToNumWords<64>(128)); + EXPECT_EQ(3u, NumBitsToNumWords<64>(129)); +} + +TEST(ZigZagCoding, Encode) { + EXPECT_EQ(0u, EncodeZigZag(0)); + EXPECT_EQ(1u, EncodeZigZag(-1)); + EXPECT_EQ(2u, EncodeZigZag(1)); + EXPECT_EQ(3u, EncodeZigZag(-2)); + EXPECT_EQ(4u, EncodeZigZag(2)); + EXPECT_EQ(5u, EncodeZigZag(-3)); + EXPECT_EQ(6u, EncodeZigZag(3)); + EXPECT_EQ(std::numeric_limits::max() - 1, + EncodeZigZag(std::numeric_limits::max())); + EXPECT_EQ(std::numeric_limits::max(), + EncodeZigZag(std::numeric_limits::min())); +} + +TEST(ZigZagCoding, Decode) { + EXPECT_EQ(0, DecodeZigZag(0)); + EXPECT_EQ(-1, DecodeZigZag(1)); + EXPECT_EQ(1, DecodeZigZag(2)); + EXPECT_EQ(-2, DecodeZigZag(3)); + EXPECT_EQ(2, DecodeZigZag(4)); + EXPECT_EQ(-3, DecodeZigZag(5)); + EXPECT_EQ(3, DecodeZigZag(6)); + EXPECT_EQ(std::numeric_limits::min(), + DecodeZigZag(std::numeric_limits::max())); + EXPECT_EQ(std::numeric_limits::max(), + DecodeZigZag(std::numeric_limits::max() - 1)); +} + +TEST(ZigZagCoding, Encode0) { + EXPECT_EQ(0u, EncodeZigZag(0, 0)); + EXPECT_EQ(1u, EncodeZigZag(-1, 0)); + EXPECT_EQ(2u, EncodeZigZag(1, 0)); + EXPECT_EQ(3u, EncodeZigZag(-2, 0)); + EXPECT_EQ(std::numeric_limits::max() - 1, + EncodeZigZag(std::numeric_limits::max(), 0)); + EXPECT_EQ(std::numeric_limits::max(), + EncodeZigZag(std::numeric_limits::min(), 0)); +} + +TEST(ZigZagCoding, Decode0) { + EXPECT_EQ(0, DecodeZigZag(0, 0)); + EXPECT_EQ(-1, DecodeZigZag(1, 0)); + EXPECT_EQ(1, DecodeZigZag(2, 0)); + EXPECT_EQ(-2, DecodeZigZag(3, 0)); + EXPECT_EQ(std::numeric_limits::min(), + DecodeZigZag(std::numeric_limits::max(), 0)); + EXPECT_EQ(std::numeric_limits::max(), + DecodeZigZag(std::numeric_limits::max() - 1, 0)); +} + +TEST(ZigZagCoding, Decode0SameAsNormalZigZag) { + for (int32_t i = -10000; i < 10000; i += 123) { + ASSERT_EQ(DecodeZigZag(i), DecodeZigZag(i, 0)); + } +} + +TEST(ZigZagCoding, Encode0SameAsNormalZigZag) { + for (uint32_t i = 0; i < 10000; i += 123) { + ASSERT_EQ(EncodeZigZag(i), EncodeZigZag(i, 0)); + } +} + +TEST(ZigZagCoding, Encode1) { + EXPECT_EQ(0u, EncodeZigZag(0, 1)); + EXPECT_EQ(1u, EncodeZigZag(1, 1)); + EXPECT_EQ(2u, EncodeZigZag(-1, 1)); + EXPECT_EQ(3u, EncodeZigZag(-2, 1)); + EXPECT_EQ(4u, EncodeZigZag(2, 1)); + EXPECT_EQ(5u, EncodeZigZag(3, 1)); + EXPECT_EQ(6u, EncodeZigZag(-3, 1)); + EXPECT_EQ(7u, EncodeZigZag(-4, 1)); + EXPECT_EQ(std::numeric_limits::max() - 2, + EncodeZigZag(std::numeric_limits::max(), 1)); + EXPECT_EQ(std::numeric_limits::max() - 1, + EncodeZigZag(std::numeric_limits::min() + 1, 1)); + EXPECT_EQ(std::numeric_limits::max(), + EncodeZigZag(std::numeric_limits::min(), 1)); +} + +TEST(ZigZagCoding, Decode1) { + EXPECT_EQ(0, DecodeZigZag(0, 1)); + EXPECT_EQ(1, DecodeZigZag(1, 1)); + EXPECT_EQ(-1, DecodeZigZag(2, 1)); + EXPECT_EQ(-2, DecodeZigZag(3, 1)); + EXPECT_EQ(2, DecodeZigZag(4, 1)); + EXPECT_EQ(3, DecodeZigZag(5, 1)); + EXPECT_EQ(-3, DecodeZigZag(6, 1)); + EXPECT_EQ(-4, DecodeZigZag(7, 1)); + EXPECT_EQ(std::numeric_limits::min(), + DecodeZigZag(std::numeric_limits::max(), 1)); + EXPECT_EQ(std::numeric_limits::min() + 1, + DecodeZigZag(std::numeric_limits::max() - 1, 1)); + EXPECT_EQ(std::numeric_limits::max(), + DecodeZigZag(std::numeric_limits::max() - 2, 1)); +} + +TEST(ZigZagCoding, Encode2) { + EXPECT_EQ(0u, EncodeZigZag(0, 2)); + EXPECT_EQ(1u, EncodeZigZag(1, 2)); + EXPECT_EQ(2u, EncodeZigZag(2, 2)); + EXPECT_EQ(3u, EncodeZigZag(3, 2)); + EXPECT_EQ(4u, EncodeZigZag(-1, 2)); + EXPECT_EQ(5u, EncodeZigZag(-2, 2)); + EXPECT_EQ(6u, EncodeZigZag(-3, 2)); + EXPECT_EQ(7u, EncodeZigZag(-4, 2)); + EXPECT_EQ(8u, EncodeZigZag(4, 2)); + EXPECT_EQ(9u, EncodeZigZag(5, 2)); + EXPECT_EQ(10u, EncodeZigZag(6, 2)); + EXPECT_EQ(11u, EncodeZigZag(7, 2)); + EXPECT_EQ(12u, EncodeZigZag(-5, 2)); + EXPECT_EQ(13u, EncodeZigZag(-6, 2)); + EXPECT_EQ(14u, EncodeZigZag(-7, 2)); + EXPECT_EQ(15u, EncodeZigZag(-8, 2)); + EXPECT_EQ(std::numeric_limits::max() - 4, + EncodeZigZag(std::numeric_limits::max(), 2)); + EXPECT_EQ(std::numeric_limits::max() - 3, + EncodeZigZag(std::numeric_limits::min() + 3, 2)); + EXPECT_EQ(std::numeric_limits::max() - 2, + EncodeZigZag(std::numeric_limits::min() + 2, 2)); + EXPECT_EQ(std::numeric_limits::max() - 1, + EncodeZigZag(std::numeric_limits::min() + 1, 2)); + EXPECT_EQ(std::numeric_limits::max(), + EncodeZigZag(std::numeric_limits::min(), 2)); +} + +TEST(ZigZagCoding, Decode2) { + EXPECT_EQ(0, DecodeZigZag(0, 2)); + EXPECT_EQ(1, DecodeZigZag(1, 2)); + EXPECT_EQ(2, DecodeZigZag(2, 2)); + EXPECT_EQ(3, DecodeZigZag(3, 2)); + EXPECT_EQ(-1, DecodeZigZag(4, 2)); + EXPECT_EQ(-2, DecodeZigZag(5, 2)); + EXPECT_EQ(-3, DecodeZigZag(6, 2)); + EXPECT_EQ(-4, DecodeZigZag(7, 2)); + EXPECT_EQ(4, DecodeZigZag(8, 2)); + EXPECT_EQ(5, DecodeZigZag(9, 2)); + EXPECT_EQ(6, DecodeZigZag(10, 2)); + EXPECT_EQ(7, DecodeZigZag(11, 2)); + EXPECT_EQ(-5, DecodeZigZag(12, 2)); + EXPECT_EQ(-6, DecodeZigZag(13, 2)); + EXPECT_EQ(-7, DecodeZigZag(14, 2)); + EXPECT_EQ(-8, DecodeZigZag(15, 2)); + EXPECT_EQ(std::numeric_limits::min(), + DecodeZigZag(std::numeric_limits::max(), 2)); + EXPECT_EQ(std::numeric_limits::min() + 1, + DecodeZigZag(std::numeric_limits::max() - 1, 2)); + EXPECT_EQ(std::numeric_limits::min() + 2, + DecodeZigZag(std::numeric_limits::max() - 2, 2)); + EXPECT_EQ(std::numeric_limits::min() + 3, + DecodeZigZag(std::numeric_limits::max() - 3, 2)); + EXPECT_EQ(std::numeric_limits::max(), + DecodeZigZag(std::numeric_limits::max() - 4, 2)); +} + +TEST(ZigZagCoding, Encode63) { + EXPECT_EQ(0u, EncodeZigZag(0, 63)); + + for (int64_t i = 0; i < 0xFFFFFFFF; i += 1234567) { + const int64_t positive_val = GetLowerBits(i * i * i + i * i, 63) | 1UL; + ASSERT_EQ(static_cast(positive_val), + EncodeZigZag(positive_val, 63)); + ASSERT_EQ((1ULL << 63) - 1 + positive_val, EncodeZigZag(-positive_val, 63)); + } + + EXPECT_EQ((1ULL << 63) - 1, + EncodeZigZag(std::numeric_limits::max(), 63)); + EXPECT_EQ(std::numeric_limits::max() - 1, + EncodeZigZag(std::numeric_limits::min() + 1, 63)); + EXPECT_EQ(std::numeric_limits::max(), + EncodeZigZag(std::numeric_limits::min(), 63)); +} + +TEST(BufToStream, UInt8_Empty) { + const std::string expected_bits = ""; + std::vector buffer = StreamToBuffer(expected_bits); + EXPECT_TRUE(buffer.empty()); + const std::string result_bits = BufferToStream(buffer); + EXPECT_EQ(expected_bits, result_bits); +} + +TEST(BufToStream, UInt8_OneWord) { + const std::string expected_bits = "00101100"; + std::vector buffer = StreamToBuffer(expected_bits); + EXPECT_EQ(std::vector({static_cast( + StreamToBitset<8>(expected_bits).to_ulong())}), + buffer); + const std::string result_bits = BufferToStream(buffer); + EXPECT_EQ(expected_bits, result_bits); +} + +TEST(BufToStream, UInt8_MultipleWords) { + const std::string expected_bits = + "00100010" + "01101010" + "01111101" + "00100010"; + std::vector buffer = StreamToBuffer(expected_bits); + EXPECT_EQ(std::vector({ + static_cast(StreamToBitset<8>("00100010").to_ulong()), + static_cast(StreamToBitset<8>("01101010").to_ulong()), + static_cast(StreamToBitset<8>("01111101").to_ulong()), + static_cast(StreamToBitset<8>("00100010").to_ulong()), + }), + buffer); + const std::string result_bits = BufferToStream(buffer); + EXPECT_EQ(expected_bits, result_bits); +} + +TEST(BufToStream, UInt64_Empty) { + const std::string expected_bits = ""; + std::vector buffer = StreamToBuffer(expected_bits); + EXPECT_TRUE(buffer.empty()); + const std::string result_bits = BufferToStream(buffer); + EXPECT_EQ(expected_bits, result_bits); +} + +TEST(BufToStream, UInt64_OneWord) { + const std::string expected_bits = + "0001000111101110011001101010101000100010110011000100010010001000"; + std::vector buffer = StreamToBuffer(expected_bits); + ASSERT_EQ(1u, buffer.size()); + EXPECT_EQ(0x1122334455667788u, buffer[0]); + const std::string result_bits = BufferToStream(buffer); + EXPECT_EQ(expected_bits, result_bits); +} + +TEST(BufToStream, UInt64_Unaligned) { + const std::string expected_bits = + "0010001001101010011111010010001001001010000111110010010010010101" + "0010001001101010011111111111111111111111"; + std::vector buffer = StreamToBuffer(expected_bits); + EXPECT_EQ(std::vector({ + StreamToBits(expected_bits.substr(0, 64)), + StreamToBits(expected_bits.substr(64, 64)), + }), + buffer); + const std::string result_bits = BufferToStream(buffer); + EXPECT_EQ(PadToWord<64>(expected_bits), result_bits); +} + +TEST(BufToStream, UInt64_MultipleWords) { + const std::string expected_bits = + "0010001001101010011111010010001001001010000111110010010010010101" + "0010001001101010011111111111111111111111000111110010010010010111" + "0000000000000000000000000000000000000000000000000010010011111111"; + std::vector buffer = StreamToBuffer(expected_bits); + EXPECT_EQ(std::vector({ + StreamToBits(expected_bits.substr(0, 64)), + StreamToBits(expected_bits.substr(64, 64)), + StreamToBits(expected_bits.substr(128, 64)), + }), + buffer); + const std::string result_bits = BufferToStream(buffer); + EXPECT_EQ(expected_bits, result_bits); +} + +TEST(PadToWord, Test) { + EXPECT_EQ("10100000", PadToWord<8>("101")); + EXPECT_EQ( + "10100000" + "00000000", + PadToWord<16>("101")); + EXPECT_EQ( + "10100000" + "00000000" + "00000000" + "00000000", + PadToWord<32>("101")); + EXPECT_EQ( + "10100000" + "00000000" + "00000000" + "00000000" + "00000000" + "00000000" + "00000000" + "00000000", + PadToWord<64>("101")); +} + +TEST(BitWriterStringStream, Empty) { + BitWriterStringStream writer; + EXPECT_EQ(0u, writer.GetNumBits()); + EXPECT_EQ(0u, writer.GetDataSizeBytes()); + EXPECT_EQ("", writer.GetStreamRaw()); +} + +TEST(BitWriterStringStream, WriteStream) { + BitWriterStringStream writer; + const std::string bits1 = "1011111111111111111"; + writer.WriteStream(bits1); + EXPECT_EQ(19u, writer.GetNumBits()); + EXPECT_EQ(3u, writer.GetDataSizeBytes()); + EXPECT_EQ(bits1, writer.GetStreamRaw()); + + const std::string bits2 = "10100001010101010000111111111111111111111111111"; + writer.WriteStream(bits2); + EXPECT_EQ(66u, writer.GetNumBits()); + EXPECT_EQ(9u, writer.GetDataSizeBytes()); + EXPECT_EQ(bits1 + bits2, writer.GetStreamRaw()); +} + +TEST(BitWriterStringStream, WriteBitSet) { + BitWriterStringStream writer; + const std::string bits1 = "10101"; + writer.WriteBitset(StreamToBitset<16>(bits1)); + EXPECT_EQ(16u, writer.GetNumBits()); + EXPECT_EQ(2u, writer.GetDataSizeBytes()); + EXPECT_EQ(PadToWord<16>(bits1), writer.GetStreamRaw()); +} + +TEST(BitWriterStringStream, WriteBits) { + BitWriterStringStream writer; + const uint64_t bits1 = 0x1 | 0x2 | 0x10; + writer.WriteBits(bits1, 5); + EXPECT_EQ(5u, writer.GetNumBits()); + EXPECT_EQ(1u, writer.GetDataSizeBytes()); + EXPECT_EQ("11001", writer.GetStreamRaw()); +} + +TEST(BitWriterStringStream, WriteUnencodedU8) { + BitWriterStringStream writer; + const uint8_t bits = 127; + writer.WriteUnencoded(bits); + EXPECT_EQ(8u, writer.GetNumBits()); + EXPECT_EQ("11111110", writer.GetStreamRaw()); +} + +TEST(BitWriterStringStream, WriteUnencodedS64) { + BitWriterStringStream writer; + const int64_t bits = std::numeric_limits::min() + 7; + writer.WriteUnencoded(bits); + EXPECT_EQ(64u, writer.GetNumBits()); + EXPECT_EQ("1110000000000000000000000000000000000000000000000000000000000001", + writer.GetStreamRaw()); +} + +TEST(BitWriterStringStream, WriteMultiple) { + BitWriterStringStream writer; + + std::string expected_result; + const std::string bits1 = "101001111111001100010000001110001111111100"; + writer.WriteStream(bits1); + + const std::string bits2 = "10100011000010010101"; + writer.WriteBitset(StreamToBitset<20>(bits2)); + + const uint64_t val = 0x1 | 0x2 | 0x10; + const std::string bits3 = BitsToStream(val, 8); + writer.WriteBits(val, 8); + + const std::string expected = bits1 + bits2 + bits3; + + EXPECT_EQ(expected.length(), writer.GetNumBits()); + EXPECT_EQ(9u, writer.GetDataSizeBytes()); + EXPECT_EQ(expected, writer.GetStreamRaw()); + + EXPECT_EQ(PadToWord<8>(expected), BufferToStream(writer.GetDataCopy())); +} + +TEST(BitWriterWord64, Empty) { + BitWriterWord64 writer; + EXPECT_EQ(0u, writer.GetNumBits()); + EXPECT_EQ(0u, writer.GetDataSizeBytes()); + EXPECT_EQ("", writer.GetStreamPadded64()); +} + +TEST(BitWriterWord64, WriteStream) { + BitWriterWord64 writer; + std::string expected; + + { + const std::string bits = "101"; + expected += bits; + writer.WriteStream(bits); + EXPECT_EQ(expected.length(), writer.GetNumBits()); + EXPECT_EQ(1u, writer.GetDataSizeBytes()); + EXPECT_EQ(PadToWord<64>(expected), writer.GetStreamPadded64()); + } + + { + const std::string bits = "10000111111111110000000"; + expected += bits; + writer.WriteStream(bits); + EXPECT_EQ(expected.length(), writer.GetNumBits()); + EXPECT_EQ(PadToWord<64>(expected), writer.GetStreamPadded64()); + } + + { + const std::string bits = "101001111111111100000111111111111100"; + expected += bits; + writer.WriteStream(bits); + EXPECT_EQ(expected.length(), writer.GetNumBits()); + EXPECT_EQ(PadToWord<64>(expected), writer.GetStreamPadded64()); + } +} + +TEST(BitWriterWord64, WriteBitset) { + BitWriterWord64 writer; + const std::string bits1 = "10101"; + writer.WriteBitset(StreamToBitset<16>(bits1), 12); + EXPECT_EQ(12u, writer.GetNumBits()); + EXPECT_EQ(2u, writer.GetDataSizeBytes()); + EXPECT_EQ(PadToWord<64>(bits1), writer.GetStreamPadded64()); +} + +TEST(BitWriterWord64, WriteBits) { + BitWriterWord64 writer; + const uint64_t bits1 = 0x1 | 0x2 | 0x10; + writer.WriteBits(bits1, 5); + writer.WriteBits(bits1, 5); + writer.WriteBits(bits1, 5); + EXPECT_EQ(15u, writer.GetNumBits()); + EXPECT_EQ(2u, writer.GetDataSizeBytes()); + EXPECT_EQ(PadToWord<64>("110011100111001"), writer.GetStreamPadded64()); +} + +TEST(BitWriterWord64, WriteZeroBits) { + BitWriterWord64 writer; + writer.WriteBits(0, 0); + writer.WriteBits(1, 0); + EXPECT_EQ(0u, writer.GetNumBits()); + writer.WriteBits(1, 1); + writer.WriteBits(0, 0); + EXPECT_EQ(PadToWord<64>("1"), writer.GetStreamPadded64()); + writer.WriteBits(0, 63); + EXPECT_EQ(64u, writer.GetNumBits()); + writer.WriteBits(0, 0); + writer.WriteBits(7, 3); + writer.WriteBits(0, 0); + EXPECT_EQ( + PadToWord<64>( + "1" + "000000000000000000000000000000000000000000000000000000000000000" + "111"), + writer.GetStreamPadded64()); +} + +TEST(BitWriterWord64, ComparisonTestWriteLotsOfBits) { + BitWriterStringStream writer1; + BitWriterWord64 writer2(16384); + + for (uint64_t i = 0; i < 65000; i += 25) { + writer1.WriteBits(i, 16); + writer2.WriteBits(i, 16); + ASSERT_EQ(writer1.GetNumBits(), writer2.GetNumBits()); + } + + EXPECT_EQ(PadToWord<64>(writer1.GetStreamRaw()), writer2.GetStreamPadded64()); +} + +TEST(BitWriterWord64, ComparisonTestWriteLotsOfStreams) { + BitWriterStringStream writer1; + BitWriterWord64 writer2(16384); + + for (int i = 0; i < 1000; ++i) { + std::string bits = "1111100000"; + if (i % 2) bits += "101010"; + if (i % 3) bits += "1110100"; + if (i % 5) bits += "1110100111111111111"; + writer1.WriteStream(bits); + writer2.WriteStream(bits); + ASSERT_EQ(writer1.GetNumBits(), writer2.GetNumBits()); + } + + EXPECT_EQ(PadToWord<64>(writer1.GetStreamRaw()), writer2.GetStreamPadded64()); +} + +TEST(BitWriterWord64, ComparisonTestWriteLotsOfBitsets) { + BitWriterStringStream writer1; + BitWriterWord64 writer2(16384); + + for (uint64_t i = 0; i < 65000; i += 25) { + std::bitset<16> bits1(i); + std::bitset<24> bits2(i); + writer1.WriteBitset(bits1); + writer1.WriteBitset(bits2); + writer2.WriteBitset(bits1); + writer2.WriteBitset(bits2); + ASSERT_EQ(writer1.GetNumBits(), writer2.GetNumBits()); + } + + EXPECT_EQ(PadToWord<64>(writer1.GetStreamRaw()), writer2.GetStreamPadded64()); +} + +TEST(GetLowerBits, Test) { + EXPECT_EQ(0u, GetLowerBits(255, 0)); + EXPECT_EQ(1u, GetLowerBits(255, 1)); + EXPECT_EQ(3u, GetLowerBits(255, 2)); + EXPECT_EQ(7u, GetLowerBits(255, 3)); + EXPECT_EQ(15u, GetLowerBits(255, 4)); + EXPECT_EQ(31u, GetLowerBits(255, 5)); + EXPECT_EQ(63u, GetLowerBits(255, 6)); + EXPECT_EQ(127u, GetLowerBits(255, 7)); + EXPECT_EQ(255u, GetLowerBits(255, 8)); + EXPECT_EQ(0xFFu, GetLowerBits(0xFFFFFFFF, 8)); + EXPECT_EQ(0xFFFFu, GetLowerBits(0xFFFFFFFF, 16)); + EXPECT_EQ(0xFFFFFFu, GetLowerBits(0xFFFFFFFF, 24)); + EXPECT_EQ(0xFFFFFFu, GetLowerBits(0xFFFFFFFFFFFF, 24)); + EXPECT_EQ(0xFFFFFFFFFFFFFFFFu, + GetLowerBits(0xFFFFFFFFFFFFFFFFu, 64)); + EXPECT_EQ(StreamToBits("1010001110"), + GetLowerBits(StreamToBits("1010001110111101111111"), 10)); +} + +TEST(BitReaderFromString, FromU8) { + std::vector buffer = { + 0xAA, + 0xBB, + 0xCC, + 0xDD, + }; + + const std::string total_stream = + "01010101" + "11011101" + "00110011" + "10111011"; + + BitReaderFromString reader(buffer); + EXPECT_EQ(PadToWord<64>(total_stream), reader.GetStreamPadded64()); + + uint64_t bits = 0; + EXPECT_EQ(2u, reader.ReadBits(&bits, 2)); + EXPECT_EQ(PadToWord<64>("01"), BitsToStream(bits)); + EXPECT_EQ(20u, reader.ReadBits(&bits, 20)); + EXPECT_EQ(PadToWord<64>("01010111011101001100"), BitsToStream(bits)); + EXPECT_EQ(20u, reader.ReadBits(&bits, 20)); + EXPECT_EQ(PadToWord<64>("11101110110000000000"), BitsToStream(bits)); + EXPECT_EQ(22u, reader.ReadBits(&bits, 30)); + EXPECT_EQ(PadToWord<64>("0000000000000000000000"), BitsToStream(bits)); + EXPECT_TRUE(reader.ReachedEnd()); +} + +TEST(BitReaderFromString, FromU64) { + std::vector buffer = { + 0xAAAAAAAAAAAAAAAA, + 0xBBBBBBBBBBBBBBBB, + 0xCCCCCCCCCCCCCCCC, + 0xDDDDDDDDDDDDDDDD, + }; + + const std::string total_stream = + "0101010101010101010101010101010101010101010101010101010101010101" + "1101110111011101110111011101110111011101110111011101110111011101" + "0011001100110011001100110011001100110011001100110011001100110011" + "1011101110111011101110111011101110111011101110111011101110111011"; + + BitReaderFromString reader(buffer); + EXPECT_EQ(total_stream, reader.GetStreamPadded64()); + + uint64_t bits = 0; + size_t pos = 0; + size_t to_read = 5; + while (reader.ReadBits(&bits, to_read) > 0) { + EXPECT_EQ(BitsToStream(bits), + PadToWord<64>(total_stream.substr(pos, to_read))); + pos += to_read; + to_read = (to_read + 35) % 64 + 1; + } + EXPECT_TRUE(reader.ReachedEnd()); +} + +TEST(BitReaderWord64, ReadBitsSingleByte) { + BitReaderWord64 reader(std::vector({uint8_t(0xF0)})); + EXPECT_FALSE(reader.ReachedEnd()); + + uint64_t bits = 0; + EXPECT_EQ(1u, reader.ReadBits(&bits, 1)); + EXPECT_EQ(0u, bits); + EXPECT_EQ(2u, reader.ReadBits(&bits, 2)); + EXPECT_EQ(0u, bits); + EXPECT_EQ(2u, reader.ReadBits(&bits, 2)); + EXPECT_EQ(2u, bits); + EXPECT_EQ(2u, reader.ReadBits(&bits, 2)); + EXPECT_EQ(3u, bits); + EXPECT_FALSE(reader.OnlyZeroesLeft()); + EXPECT_FALSE(reader.ReachedEnd()); + EXPECT_EQ(2u, reader.ReadBits(&bits, 2)); + EXPECT_EQ(1u, bits); + EXPECT_TRUE(reader.OnlyZeroesLeft()); + EXPECT_FALSE(reader.ReachedEnd()); + EXPECT_EQ(55u, reader.ReadBits(&bits, 64)); + EXPECT_EQ(0u, bits); + EXPECT_TRUE(reader.ReachedEnd()); +} + +TEST(BitReaderWord64, ReadBitsetSingleByte) { + BitReaderWord64 reader(std::vector({uint8_t(0xCC)})); + std::bitset<4> bits; + EXPECT_EQ(2u, reader.ReadBitset(&bits, 2)); + EXPECT_EQ(0u, bits.to_ullong()); + EXPECT_EQ(2u, reader.ReadBitset(&bits, 2)); + EXPECT_EQ(3u, bits.to_ullong()); + EXPECT_FALSE(reader.OnlyZeroesLeft()); + EXPECT_EQ(4u, reader.ReadBitset(&bits, 4)); + EXPECT_EQ(12u, bits.to_ullong()); + EXPECT_TRUE(reader.OnlyZeroesLeft()); +} + +TEST(BitReaderWord64, ReadStreamSingleByte) { + BitReaderWord64 reader(std::vector({uint8_t(0xAA)})); + EXPECT_EQ("", reader.ReadStream(0)); + EXPECT_EQ("0", reader.ReadStream(1)); + EXPECT_EQ("101", reader.ReadStream(3)); + EXPECT_EQ("01010000", reader.ReadStream(8)); + EXPECT_TRUE(reader.OnlyZeroesLeft()); + EXPECT_EQ("0000000000000000000000000000000000000000000000000000", + reader.ReadStream(64)); + EXPECT_TRUE(reader.ReachedEnd()); +} + +TEST(BitReaderWord64, ReadStreamEmpty) { + std::vector buffer; + BitReaderWord64 reader(std::move(buffer)); + EXPECT_TRUE(reader.OnlyZeroesLeft()); + EXPECT_TRUE(reader.ReachedEnd()); + EXPECT_EQ("", reader.ReadStream(10)); + EXPECT_TRUE(reader.ReachedEnd()); +} + +TEST(BitReaderWord64, ReadBitsTwoWords) { + std::vector buffer = {0x0000000000000001, 0x0000000000FFFFFF}; + + BitReaderWord64 reader(std::move(buffer)); + + uint64_t bits = 0; + EXPECT_EQ(1u, reader.ReadBits(&bits, 1)); + EXPECT_EQ(1u, bits); + EXPECT_EQ(62u, reader.ReadBits(&bits, 62)); + EXPECT_EQ(0u, bits); + EXPECT_EQ(2u, reader.ReadBits(&bits, 2)); + EXPECT_EQ(2u, bits); + EXPECT_EQ(3u, reader.ReadBits(&bits, 3)); + EXPECT_EQ(7u, bits); + EXPECT_FALSE(reader.OnlyZeroesLeft()); + EXPECT_EQ(32u, reader.ReadBits(&bits, 32)); + EXPECT_EQ(0xFFFFFu, bits); + EXPECT_TRUE(reader.OnlyZeroesLeft()); + EXPECT_FALSE(reader.ReachedEnd()); + EXPECT_EQ(28u, reader.ReadBits(&bits, 32)); + EXPECT_EQ(0u, bits); + EXPECT_TRUE(reader.ReachedEnd()); +} + +TEST(BitReaderFromString, ReadUnencodedU8) { + BitReaderFromString reader("11111110"); + uint8_t val = 0; + ASSERT_TRUE(reader.ReadUnencoded(&val)); + EXPECT_EQ(8u, reader.GetNumReadBits()); + EXPECT_EQ(127, val); +} + +TEST(BitReaderFromString, ReadUnencodedU16Fail) { + BitReaderFromString reader("11111110"); + uint16_t val = 0; + ASSERT_FALSE(reader.ReadUnencoded(&val)); +} + +TEST(BitReaderFromString, ReadUnencodedS64) { + BitReaderFromString reader( + "1110000000000000000000000000000000000000000000000000000000000001"); + int64_t val = 0; + ASSERT_TRUE(reader.ReadUnencoded(&val)); + EXPECT_EQ(64u, reader.GetNumReadBits()); + EXPECT_EQ(std::numeric_limits::min() + 7, val); +} + +TEST(BitReaderWord64, FromU8) { + std::vector buffer = { + 0xAA, + 0xBB, + 0xCC, + 0xDD, + }; + + BitReaderWord64 reader(std::move(buffer)); + + uint64_t bits = 0; + EXPECT_EQ(2u, reader.ReadBits(&bits, 2)); + EXPECT_EQ(PadToWord<64>("01"), BitsToStream(bits)); + EXPECT_EQ(20u, reader.ReadBits(&bits, 20)); + EXPECT_EQ(PadToWord<64>("01010111011101001100"), BitsToStream(bits)); + EXPECT_EQ(20u, reader.ReadBits(&bits, 20)); + EXPECT_EQ(PadToWord<64>("11101110110000000000"), BitsToStream(bits)); + EXPECT_EQ(22u, reader.ReadBits(&bits, 30)); + EXPECT_EQ(PadToWord<64>("0000000000000000000000"), BitsToStream(bits)); + EXPECT_TRUE(reader.ReachedEnd()); +} + +TEST(BitReaderWord64, FromU64) { + std::vector buffer = { + 0xAAAAAAAAAAAAAAAA, + 0xBBBBBBBBBBBBBBBB, + 0xCCCCCCCCCCCCCCCC, + 0xDDDDDDDDDDDDDDDD, + }; + + const std::string total_stream = + "0101010101010101010101010101010101010101010101010101010101010101" + "1101110111011101110111011101110111011101110111011101110111011101" + "0011001100110011001100110011001100110011001100110011001100110011" + "1011101110111011101110111011101110111011101110111011101110111011"; + + BitReaderWord64 reader(std::move(buffer)); + + uint64_t bits = 0; + size_t pos = 0; + size_t to_read = 5; + while (reader.ReadBits(&bits, to_read) > 0) { + EXPECT_EQ(BitsToStream(bits), + PadToWord<64>(total_stream.substr(pos, to_read))); + pos += to_read; + to_read = (to_read + 35) % 64 + 1; + } + EXPECT_TRUE(reader.ReachedEnd()); +} + +TEST(BitReaderWord64, ComparisonLotsOfU8) { + std::vector buffer; + for (uint32_t i = 0; i < 10003; ++i) { + buffer.push_back(static_cast(i % 255)); + } + + BitReaderFromString reader1(buffer); + BitReaderWord64 reader2(std::move(buffer)); + + uint64_t bits1 = 0, bits2 = 0; + size_t to_read = 5; + while (reader1.ReadBits(&bits1, to_read) > 0) { + reader2.ReadBits(&bits2, to_read); + EXPECT_EQ(bits1, bits2); + to_read = (to_read + 35) % 64 + 1; + } + + EXPECT_EQ(0u, reader2.ReadBits(&bits2, 1)); +} + +TEST(BitReaderWord64, ComparisonLotsOfU64) { + std::vector buffer; + for (uint64_t i = 0; i < 1000; ++i) { + buffer.push_back(i); + } + + BitReaderFromString reader1(buffer); + BitReaderWord64 reader2(std::move(buffer)); + + uint64_t bits1 = 0, bits2 = 0; + size_t to_read = 5; + while (reader1.ReadBits(&bits1, to_read) > 0) { + reader2.ReadBits(&bits2, to_read); + EXPECT_EQ(bits1, bits2); + to_read = (to_read + 35) % 64 + 1; + } + + EXPECT_EQ(0u, reader2.ReadBits(&bits2, 1)); +} + +TEST(ReadWriteWord64, ReadWriteLotsOfBits) { + BitWriterWord64 writer(16384); + for (uint64_t i = 0; i < 65000; i += 25) { + const uint64_t num_bits = i % 64 + 1; + const uint64_t bits = i >> (64 - num_bits); + writer.WriteBits(bits, size_t(num_bits)); + } + + BitReaderWord64 reader(writer.GetDataCopy()); + for (uint64_t i = 0; i < 65000; i += 25) { + const uint64_t num_bits = i % 64 + 1; + const uint64_t expected_bits = i >> (64 - num_bits); + uint64_t bits = 0; + reader.ReadBits(&bits, size_t(num_bits)); + EXPECT_EQ(expected_bits, bits); + } + + EXPECT_TRUE(reader.OnlyZeroesLeft()); +} + +TEST(VariableWidthWrite, Write0U) { + BitWriterStringStream writer; + writer.WriteVariableWidthU64(0, 2); + EXPECT_EQ("000", writer.GetStreamRaw()); + writer.WriteVariableWidthU32(0, 2); + EXPECT_EQ( + "000" + "000", + writer.GetStreamRaw()); + writer.WriteVariableWidthU16(0, 2); + EXPECT_EQ( + "000" + "000" + "000", + writer.GetStreamRaw()); + writer.WriteVariableWidthU8(0, 2); + EXPECT_EQ( + "000" + "000" + "000" + "000", + writer.GetStreamRaw()); +} + +TEST(VariableWidthWrite, Write0S) { + BitWriterStringStream writer; + writer.WriteVariableWidthS64(0, 2, 0); + EXPECT_EQ("000", writer.GetStreamRaw()); + writer.WriteVariableWidthS32(0, 2, 0); + EXPECT_EQ( + "000" + "000", + writer.GetStreamRaw()); + writer.WriteVariableWidthS16(0, 2, 0); + EXPECT_EQ( + "000" + "000" + "000", + writer.GetStreamRaw()); + writer.WriteVariableWidthS8(0, 2, 0); + EXPECT_EQ( + "000" + "000" + "000" + "000", + writer.GetStreamRaw()); +} + +TEST(VariableWidthWrite, WriteSmallUnsigned) { + BitWriterStringStream writer; + writer.WriteVariableWidthU64(1, 2); + EXPECT_EQ("100", writer.GetStreamRaw()); + writer.WriteVariableWidthU32(2, 2); + EXPECT_EQ( + "100" + "010", + writer.GetStreamRaw()); + writer.WriteVariableWidthU16(3, 2); + EXPECT_EQ( + "100" + "010" + "110", + writer.GetStreamRaw()); + writer.WriteVariableWidthU8(4, 2); + EXPECT_EQ( + "100" + "010" + "110" + "001100", + writer.GetStreamRaw()); +} + +TEST(VariableWidthWrite, WriteSmallSigned) { + BitWriterStringStream writer; + writer.WriteVariableWidthS64(1, 2, 0); + EXPECT_EQ("010", writer.GetStreamRaw()); + writer.WriteVariableWidthS64(-1, 2, 0); + EXPECT_EQ( + "010" + "100", + writer.GetStreamRaw()); + writer.WriteVariableWidthS16(3, 2, 0); + EXPECT_EQ( + "010" + "100" + "011100", + writer.GetStreamRaw()); + writer.WriteVariableWidthS8(-4, 2, 0); + EXPECT_EQ( + "010" + "100" + "011100" + "111100", + writer.GetStreamRaw()); +} + +TEST(VariableWidthWrite, U64Val127ChunkLength7) { + BitWriterStringStream writer; + writer.WriteVariableWidthU64(127, 7); + EXPECT_EQ( + "1111111" + "0", + writer.GetStreamRaw()); +} + +TEST(VariableWidthWrite, U32Val255ChunkLength7) { + BitWriterStringStream writer; + writer.WriteVariableWidthU32(255, 7); + EXPECT_EQ( + "1111111" + "1" + "1000000" + "0", + writer.GetStreamRaw()); +} + +TEST(VariableWidthWrite, U16Val2ChunkLength4) { + BitWriterStringStream writer; + writer.WriteVariableWidthU16(2, 4); + EXPECT_EQ( + "0100" + "0", + writer.GetStreamRaw()); +} + +TEST(VariableWidthWrite, U8Val128ChunkLength7) { + BitWriterStringStream writer; + writer.WriteVariableWidthU8(128, 7); + EXPECT_EQ( + "0000000" + "1" + "1", + writer.GetStreamRaw()); +} + +TEST(VariableWidthWrite, U64ValAAAAChunkLength2) { + BitWriterStringStream writer; + writer.WriteVariableWidthU64(0xAAAA, 2); + EXPECT_EQ( + "01" + "1" + "01" + "1" + "01" + "1" + "01" + "1" + "01" + "1" + "01" + "1" + "01" + "1" + "01" + "0", + writer.GetStreamRaw()); +} + +TEST(VariableWidthWrite, S8ValM128ChunkLength7) { + BitWriterStringStream writer; + writer.WriteVariableWidthS8(-128, 7, 0); + EXPECT_EQ( + "1111111" + "1" + "1", + writer.GetStreamRaw()); +} + +TEST(VariableWidthRead, U64Val127ChunkLength7) { + BitReaderFromString reader( + "1111111" + "0"); + uint64_t val = 0; + ASSERT_TRUE(reader.ReadVariableWidthU64(&val, 7)); + EXPECT_EQ(127u, val); +} + +TEST(VariableWidthRead, U32Val255ChunkLength7) { + BitReaderFromString reader( + "1111111" + "1" + "1000000" + "0"); + uint32_t val = 0; + ASSERT_TRUE(reader.ReadVariableWidthU32(&val, 7)); + EXPECT_EQ(255u, val); +} + +TEST(VariableWidthRead, U16Val2ChunkLength4) { + BitReaderFromString reader( + "0100" + "0"); + uint16_t val = 0; + ASSERT_TRUE(reader.ReadVariableWidthU16(&val, 4)); + EXPECT_EQ(2u, val); +} + +TEST(VariableWidthRead, U8Val128ChunkLength7) { + BitReaderFromString reader( + "0000000" + "1" + "1"); + uint8_t val = 0; + ASSERT_TRUE(reader.ReadVariableWidthU8(&val, 7)); + EXPECT_EQ(128u, val); +} + +TEST(VariableWidthRead, U64ValAAAAChunkLength2) { + BitReaderFromString reader( + "01" + "1" + "01" + "1" + "01" + "1" + "01" + "1" + "01" + "1" + "01" + "1" + "01" + "1" + "01" + "0"); + uint64_t val = 0; + ASSERT_TRUE(reader.ReadVariableWidthU64(&val, 2)); + EXPECT_EQ(0xAAAAu, val); +} + +TEST(VariableWidthRead, S8ValM128ChunkLength7) { + BitReaderFromString reader( + "1111111" + "1" + "1"); + int8_t val = 0; + ASSERT_TRUE(reader.ReadVariableWidthS8(&val, 7, 0)); + EXPECT_EQ(-128, val); +} + +TEST(VariableWidthRead, FailTooShort) { + BitReaderFromString reader("00000001100000"); + uint64_t val = 0; + ASSERT_FALSE(reader.ReadVariableWidthU64(&val, 7)); +} + +TEST(VariableWidthWriteRead, SingleWriteReadU64) { + for (uint64_t i = 0; i < 1000000; i += 1234) { + const uint64_t val = i * i * i; + const size_t chunk_length = size_t(i % 16 + 1); + + BitWriterWord64 writer; + writer.WriteVariableWidthU64(val, chunk_length); + + BitReaderWord64 reader(writer.GetDataCopy()); + uint64_t read_val = 0; + ASSERT_TRUE(reader.ReadVariableWidthU64(&read_val, chunk_length)); + + ASSERT_EQ(val, read_val) << "Chunk length " << chunk_length; + } +} + +TEST(VariableWidthWriteRead, SingleWriteReadS64) { + for (int64_t i = 0; i < 1000000; i += 4321) { + const int64_t val = i * i * (i % 2 ? -i : i); + const size_t chunk_length = size_t(i % 16 + 1); + const size_t zigzag_exponent = size_t(i % 13); + + BitWriterWord64 writer; + writer.WriteVariableWidthS64(val, chunk_length, zigzag_exponent); + + BitReaderWord64 reader(writer.GetDataCopy()); + int64_t read_val = 0; + ASSERT_TRUE( + reader.ReadVariableWidthS64(&read_val, chunk_length, zigzag_exponent)); + + ASSERT_EQ(val, read_val) << "Chunk length " << chunk_length; + } +} + +TEST(VariableWidthWriteRead, SingleWriteReadU32) { + for (uint32_t i = 0; i < 100000; i += 123) { + const uint32_t val = i * i; + const size_t chunk_length = i % 16 + 1; + + BitWriterWord64 writer; + writer.WriteVariableWidthU32(val, chunk_length); + + BitReaderWord64 reader(writer.GetDataCopy()); + uint32_t read_val = 0; + ASSERT_TRUE(reader.ReadVariableWidthU32(&read_val, chunk_length)); + + ASSERT_EQ(val, read_val) << "Chunk length " << chunk_length; + } +} + +TEST(VariableWidthWriteRead, SingleWriteReadS32) { + for (int32_t i = 0; i < 100000; i += 123) { + const int32_t val = i * (i % 2 ? -i : i); + const size_t chunk_length = i % 16 + 1; + const size_t zigzag_exponent = i % 11; + + BitWriterWord64 writer; + writer.WriteVariableWidthS32(val, chunk_length, zigzag_exponent); + + BitReaderWord64 reader(writer.GetDataCopy()); + int32_t read_val = 0; + ASSERT_TRUE( + reader.ReadVariableWidthS32(&read_val, chunk_length, zigzag_exponent)); + + ASSERT_EQ(val, read_val) << "Chunk length " << chunk_length; + } +} + +TEST(VariableWidthWriteRead, SingleWriteReadU16) { + for (int i = 0; i < 65536; i += 123) { + const uint16_t val = static_cast(i); + const size_t chunk_length = val % 10 + 1; + + BitWriterWord64 writer; + writer.WriteVariableWidthU16(val, chunk_length); + + BitReaderWord64 reader(writer.GetDataCopy()); + uint16_t read_val = 0; + ASSERT_TRUE(reader.ReadVariableWidthU16(&read_val, chunk_length)); + + ASSERT_EQ(val, read_val) << "Chunk length " << chunk_length; + } +} + +TEST(VariableWidthWriteRead, SingleWriteReadS16) { + for (int i = -32768; i < 32768; i += 123) { + const int16_t val = static_cast(i); + const size_t chunk_length = std::abs(i) % 10 + 1; + const size_t zigzag_exponent = std::abs(i) % 7; + + BitWriterWord64 writer; + writer.WriteVariableWidthS16(val, chunk_length, zigzag_exponent); + + BitReaderWord64 reader(writer.GetDataCopy()); + int16_t read_val = 0; + ASSERT_TRUE( + reader.ReadVariableWidthS16(&read_val, chunk_length, zigzag_exponent)); + + ASSERT_EQ(val, read_val) << "Chunk length " << chunk_length; + } +} + +TEST(VariableWidthWriteRead, SingleWriteReadU8) { + for (int i = 0; i < 256; ++i) { + const uint8_t val = static_cast(i); + const size_t chunk_length = val % 5 + 1; + + BitWriterWord64 writer; + writer.WriteVariableWidthU8(val, chunk_length); + + BitReaderWord64 reader(writer.GetDataCopy()); + uint8_t read_val = 0; + ASSERT_TRUE(reader.ReadVariableWidthU8(&read_val, chunk_length)); + + ASSERT_EQ(val, read_val) << "Chunk length " << chunk_length; + } +} + +TEST(VariableWidthWriteRead, SingleWriteReadS8) { + for (int i = -128; i < 128; ++i) { + const int8_t val = static_cast(i); + const size_t chunk_length = std::abs(i) % 5 + 1; + const size_t zigzag_exponent = std::abs(i) % 3; + + BitWriterWord64 writer; + writer.WriteVariableWidthS8(val, chunk_length, zigzag_exponent); + + BitReaderWord64 reader(writer.GetDataCopy()); + int8_t read_val = 0; + ASSERT_TRUE( + reader.ReadVariableWidthS8(&read_val, chunk_length, zigzag_exponent)); + + ASSERT_EQ(val, read_val) << "Chunk length " << chunk_length; + } +} + +TEST(VariableWidthWriteRead, SmallNumbersChunkLength4) { + const std::vector expected_values = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + + BitWriterWord64 writer; + for (uint64_t val : expected_values) { + writer.WriteVariableWidthU64(val, 4); + } + + EXPECT_EQ(50u, writer.GetNumBits()); + + std::vector actual_values; + BitReaderWord64 reader(writer.GetDataCopy()); + while (!reader.OnlyZeroesLeft()) { + uint64_t val = 0; + ASSERT_TRUE(reader.ReadVariableWidthU64(&val, 4)); + actual_values.push_back(val); + } + + EXPECT_EQ(expected_values, actual_values); +} + +TEST(VariableWidthWriteRead, VariedNumbersChunkLength8) { + const std::vector expected_values = {1000, 0, 255, 4294967296}; + const size_t kExpectedNumBits = 9 * (2 + 1 + 1 + 5); + + BitWriterWord64 writer; + for (uint64_t val : expected_values) { + writer.WriteVariableWidthU64(val, 8); + } + + EXPECT_EQ(kExpectedNumBits, writer.GetNumBits()); + + std::vector actual_values; + BitReaderWord64 reader(writer.GetDataCopy()); + while (!reader.OnlyZeroesLeft()) { + uint64_t val = 0; + ASSERT_TRUE(reader.ReadVariableWidthU64(&val, 8)); + actual_values.push_back(val); + } + + EXPECT_EQ(expected_values, actual_values); +} + +TEST(FixedWidthWrite, Val0Max3) { + BitWriterStringStream writer; + writer.WriteFixedWidth(0, 3); + EXPECT_EQ("00", writer.GetStreamRaw()); +} + +TEST(FixedWidthWrite, Val0Max5) { + BitWriterStringStream writer; + writer.WriteFixedWidth(0, 5); + EXPECT_EQ("000", writer.GetStreamRaw()); +} + +TEST(FixedWidthWrite, Val0Max255) { + BitWriterStringStream writer; + writer.WriteFixedWidth(0, 255); + EXPECT_EQ("00000000", writer.GetStreamRaw()); +} + +TEST(FixedWidthWrite, Val3Max8) { + BitWriterStringStream writer; + writer.WriteFixedWidth(3, 8); + EXPECT_EQ("1100", writer.GetStreamRaw()); +} + +TEST(FixedWidthWrite, Val15Max127) { + BitWriterStringStream writer; + writer.WriteFixedWidth(15, 127); + EXPECT_EQ("1111000", writer.GetStreamRaw()); +} + +TEST(FixedWidthRead, Val0Max3) { + BitReaderFromString reader("0011111"); + uint64_t val = 0; + ASSERT_TRUE(reader.ReadFixedWidth(&val, 3)); + EXPECT_EQ(0u, val); +} + +TEST(FixedWidthRead, Val0Max5) { + BitReaderFromString reader("0001010101"); + uint64_t val = 0; + ASSERT_TRUE(reader.ReadFixedWidth(&val, 5)); + EXPECT_EQ(0u, val); +} + +TEST(FixedWidthRead, Val3Max8) { + BitReaderFromString reader("11001010101"); + uint64_t val = 0; + ASSERT_TRUE(reader.ReadFixedWidth(&val, 8)); + EXPECT_EQ(3u, val); +} + +TEST(FixedWidthRead, Val15Max127) { + BitReaderFromString reader("111100010101"); + uint64_t val = 0; + ASSERT_TRUE(reader.ReadFixedWidth(&val, 127)); + EXPECT_EQ(15u, val); +} + +TEST(FixedWidthRead, Fail) { + BitReaderFromString reader("111100"); + uint64_t val = 0; + ASSERT_FALSE(reader.ReadFixedWidth(&val, 127)); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/c_interface_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/c_interface_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/c_interface_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/c_interface_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,298 @@ +// Copyright (c) 2016 Google 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. + +#include + +#include "message.h" +#include "spirv-tools/libspirv.h" +#include "table.h" + +namespace { + +using namespace spvtools; + +// TODO(antiagainst): Use public C API for setting the consumer once exists. +#ifndef SPIRV_TOOLS_SHAREDLIB +void SetContextMessageConsumer(spv_context context, + spvtools::MessageConsumer consumer) { + libspirv::SetContextMessageConsumer(context, consumer); +} +#else +void SetContextMessageConsumer(spv_context, spvtools::MessageConsumer) {} +#endif + +// The default consumer is a null std::function. +TEST(CInterface, DefaultConsumerNullDiagnosticForValidInput) { + auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); + const char input_text[] = + "OpCapability Shader\n" + "OpCapability Linkage\n" + "OpMemoryModel Logical GLSL450"; + + spv_binary binary = nullptr; + EXPECT_EQ(SPV_SUCCESS, spvTextToBinary(context, input_text, + sizeof(input_text), &binary, nullptr)); + + { + // Sadly the compiler don't allow me to feed binary directly to + // spvValidate(). + spv_const_binary_t b{binary->code, binary->wordCount}; + EXPECT_EQ(SPV_SUCCESS, spvValidate(context, &b, nullptr)); + } + + spv_text text = nullptr; + EXPECT_EQ(SPV_SUCCESS, spvBinaryToText(context, binary->code, + binary->wordCount, 0, &text, nullptr)); + + spvTextDestroy(text); + spvBinaryDestroy(binary); + spvContextDestroy(context); +} + +// The default consumer is a null std::function. +TEST(CInterface, DefaultConsumerNullDiagnosticForInvalidAssembling) { + auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); + const char input_text[] = "%1 = OpName"; + + spv_binary binary = nullptr; + EXPECT_EQ(SPV_ERROR_INVALID_TEXT, + spvTextToBinary(context, input_text, sizeof(input_text), &binary, + nullptr)); + spvBinaryDestroy(binary); + spvContextDestroy(context); +} + +// The default consumer is a null std::function. +TEST(CInterface, DefaultConsumerNullDiagnosticForInvalidDiassembling) { + auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); + const char input_text[] = "OpNop"; + + spv_binary binary = nullptr; + ASSERT_EQ(SPV_SUCCESS, spvTextToBinary(context, input_text, + sizeof(input_text), &binary, nullptr)); + // Change OpNop to an invalid (wordcount|opcode) word. + binary->code[binary->wordCount - 1] = 0xffffffff; + + spv_text text = nullptr; + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, + spvBinaryToText(context, binary->code, binary->wordCount, 0, &text, + nullptr)); + + spvTextDestroy(text); + spvBinaryDestroy(binary); + spvContextDestroy(context); +} + +// The default consumer is a null std::function. +TEST(CInterface, DefaultConsumerNullDiagnosticForInvalidValidating) { + auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); + const char input_text[] = "OpNop"; + + spv_binary binary = nullptr; + ASSERT_EQ(SPV_SUCCESS, spvTextToBinary(context, input_text, + sizeof(input_text), &binary, nullptr)); + + spv_const_binary_t b{binary->code, binary->wordCount}; + EXPECT_EQ(SPV_ERROR_INVALID_LAYOUT, spvValidate(context, &b, nullptr)); + + spvBinaryDestroy(binary); + spvContextDestroy(context); +} + +TEST(CInterface, SpecifyConsumerNullDiagnosticForAssembling) { + const char input_text[] = "%1 = OpName\n"; + + auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); + int invocation = 0; + SetContextMessageConsumer( + context, + [&invocation](spv_message_level_t level, const char* source, + const spv_position_t& position, const char* message) { + ++invocation; + EXPECT_EQ(SPV_MSG_ERROR, level); + // The error happens at scanning the begining of second line. + EXPECT_STREQ("input", source); + EXPECT_EQ(1u, position.line); + EXPECT_EQ(0u, position.column); + EXPECT_EQ(12u, position.index); + EXPECT_STREQ("Expected operand, found end of stream.", message); + }); + + spv_binary binary = nullptr; + EXPECT_EQ(SPV_ERROR_INVALID_TEXT, + spvTextToBinary(context, input_text, sizeof(input_text), &binary, + nullptr)); +#ifndef SPIRV_TOOLS_SHAREDLIB + EXPECT_EQ(1, invocation); +#endif + spvBinaryDestroy(binary); + spvContextDestroy(context); +} + +TEST(CInterface, SpecifyConsumerNullDiagnosticForDisassembling) { + const char input_text[] = "OpNop"; + + auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); + int invocation = 0; + SetContextMessageConsumer( + context, + [&invocation](spv_message_level_t level, const char* source, + const spv_position_t& position, const char* message) { + ++invocation; + EXPECT_EQ(SPV_MSG_ERROR, level); + EXPECT_STREQ("input", source); + EXPECT_EQ(0u, position.line); + EXPECT_EQ(0u, position.column); + EXPECT_EQ(5u, position.index); + EXPECT_STREQ("Invalid opcode: 65535", message); + }); + + spv_binary binary = nullptr; + ASSERT_EQ(SPV_SUCCESS, spvTextToBinary(context, input_text, + sizeof(input_text), &binary, nullptr)); + // Change OpNop to an invalid (wordcount|opcode) word. + binary->code[binary->wordCount - 1] = 0xffffffff; + + spv_text text = nullptr; + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, + spvBinaryToText(context, binary->code, binary->wordCount, 0, &text, + nullptr)); +#ifndef SPIRV_TOOLS_SHAREDLIB + EXPECT_EQ(1, invocation); +#endif + + spvTextDestroy(text); + spvBinaryDestroy(binary); + spvContextDestroy(context); +} + +TEST(CInterface, SpecifyConsumerNullDiagnosticForValidating) { + const char input_text[] = "OpNop"; + + auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); + int invocation = 0; + SetContextMessageConsumer( + context, + [&invocation](spv_message_level_t level, const char* source, + const spv_position_t& position, const char* message) { + ++invocation; + EXPECT_EQ(SPV_MSG_ERROR, level); + EXPECT_STREQ("input", source); + EXPECT_EQ(0u, position.line); + EXPECT_EQ(0u, position.column); + // TODO(antiagainst): what validation reports is not a word offset here. + // It is inconsistent with diassembler. Should be fixed. + EXPECT_EQ(1u, position.index); + EXPECT_STREQ("Nop cannot appear before the memory model instruction", + message); + }); + + spv_binary binary = nullptr; + ASSERT_EQ(SPV_SUCCESS, spvTextToBinary(context, input_text, + sizeof(input_text), &binary, nullptr)); + + spv_const_binary_t b{binary->code, binary->wordCount}; + EXPECT_EQ(SPV_ERROR_INVALID_LAYOUT, spvValidate(context, &b, nullptr)); +#ifndef SPIRV_TOOLS_SHAREDLIB + EXPECT_EQ(1, invocation); +#endif + + spvBinaryDestroy(binary); + spvContextDestroy(context); +} + +// When having both a consumer and an diagnostic object, the diagnostic object +// should take priority. +TEST(CInterface, SpecifyConsumerSpecifyDiagnosticForAssembling) { + const char input_text[] = "%1 = OpName"; + + auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); + int invocation = 0; + SetContextMessageConsumer( + context, + [&invocation](spv_message_level_t, const char*, const spv_position_t&, + const char*) { ++invocation; }); + + spv_binary binary = nullptr; + spv_diagnostic diagnostic = nullptr; + EXPECT_EQ(SPV_ERROR_INVALID_TEXT, + spvTextToBinary(context, input_text, sizeof(input_text), &binary, + &diagnostic)); + EXPECT_EQ(0, invocation); // Consumer should not be invoked at all. + EXPECT_STREQ("Expected operand, found end of stream.", diagnostic->error); + + spvDiagnosticDestroy(diagnostic); + spvBinaryDestroy(binary); + spvContextDestroy(context); +} + +TEST(CInterface, SpecifyConsumerSpecifyDiagnosticForDisassembling) { + const char input_text[] = "OpNop"; + + auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); + int invocation = 0; + SetContextMessageConsumer( + context, + [&invocation](spv_message_level_t, const char*, const spv_position_t&, + const char*) { ++invocation; }); + + spv_binary binary = nullptr; + ASSERT_EQ(SPV_SUCCESS, spvTextToBinary(context, input_text, + sizeof(input_text), &binary, nullptr)); + // Change OpNop to an invalid (wordcount|opcode) word. + binary->code[binary->wordCount - 1] = 0xffffffff; + + spv_diagnostic diagnostic = nullptr; + spv_text text = nullptr; + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, + spvBinaryToText(context, binary->code, binary->wordCount, 0, &text, + &diagnostic)); + + EXPECT_EQ(0, invocation); // Consumer should not be invoked at all. + EXPECT_STREQ("Invalid opcode: 65535", diagnostic->error); + + spvTextDestroy(text); + spvDiagnosticDestroy(diagnostic); + spvBinaryDestroy(binary); + spvContextDestroy(context); +} + +TEST(CInterface, SpecifyConsumerSpecifyDiagnosticForValidating) { + const char input_text[] = "OpNop"; + + auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); + int invocation = 0; + SetContextMessageConsumer( + context, + [&invocation](spv_message_level_t, const char*, const spv_position_t&, + const char*) { ++invocation; }); + + spv_binary binary = nullptr; + ASSERT_EQ(SPV_SUCCESS, spvTextToBinary(context, input_text, + sizeof(input_text), &binary, nullptr)); + + spv_diagnostic diagnostic = nullptr; + spv_const_binary_t b{binary->code, binary->wordCount}; + EXPECT_EQ(SPV_ERROR_INVALID_LAYOUT, spvValidate(context, &b, &diagnostic)); + + EXPECT_EQ(0, invocation); // Consumer should not be invoked at all. + EXPECT_STREQ("Nop cannot appear before the memory model instruction", + diagnostic->error); + + spvDiagnosticDestroy(diagnostic); + spvBinaryDestroy(binary); + spvContextDestroy(context); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,218 @@ +# Copyright (c) 2015-2016 The Khronos Group Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Add a SPIR-V Tools unit test. Signature: +# add_spvtools_unittest( +# TARGET target_name +# SRCS src_file.h src_file.cpp +# LIBS lib1 lib2 +# ) + +if (NOT "${SPIRV_SKIP_TESTS}") + if (TARGET gmock_main) + message(STATUS "Found Google Mock, building tests.") + else() + message(STATUS "Did not find googletest, tests will not be built. " + "To enable tests place googletest in '/external/googletest'.") + endif() +endif() + +function(add_spvtools_unittest) + if (NOT "${SPIRV_SKIP_TESTS}" AND TARGET gmock_main) + set(one_value_args TARGET) + set(multi_value_args SRCS LIBS ENVIRONMENT) + cmake_parse_arguments( + ARG "" "${one_value_args}" "${multi_value_args}" ${ARGN}) + set(target test_${ARG_TARGET}) + add_executable(${target} ${ARG_SRCS}) + spvtools_default_compile_options(${target}) + if(${COMPILER_IS_LIKE_GNU}) + target_compile_options(${target} PRIVATE -Wno-undef) + # Effcee and RE2 headers exhibit shadowing. + target_compile_options(${target} PRIVATE -Wno-shadow) + endif() + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + # Disable C4503 "decorated name length exceeded" warning, + # triggered by some heavily templated types. + # We don't care much about that in test code. + # Important to do since we have warnings-as-errors. + target_compile_options(${target} PRIVATE /wd4503) + # Googletest accidentally turns off support for ::testing::Combine + # in VS 2017. See https://github.com/google/googletest/issues/1352 + # Forcibly turn it on again. + target_compile_options(${target} PRIVATE /DGTEST_HAS_COMBINE=1) + endif() + target_include_directories(${target} PRIVATE + ${SPIRV_HEADER_INCLUDE_DIR} + ${spirv-tools_SOURCE_DIR} + ${spirv-tools_SOURCE_DIR}/include + ${spirv-tools_SOURCE_DIR}/test + ${spirv-tools_BINARY_DIR} + ${gtest_SOURCE_DIR}/include + ${gmock_SOURCE_DIR}/include + ) + if (TARGET effcee) + # If using Effcee for testing, then add its include directory. + target_include_directories(${target} PRIVATE ${effcee_SOURCE_DIR}) + endif() + target_link_libraries(${target} PRIVATE ${ARG_LIBS}) + if (TARGET effcee) + target_link_libraries(${target} PRIVATE effcee) + endif() + target_link_libraries(${target} PRIVATE gmock_main) + add_test(NAME spirv-tools-${target} COMMAND ${target}) + if (DEFINED ARG_ENVIRONMENT) + set_tests_properties(spirv-tools-${target} PROPERTIES ENVIRONMENT ${ARG_ENVIRONMENT}) + endif() + set_property(TARGET ${target} PROPERTY FOLDER "SPIRV-Tools tests") + endif() +endfunction() + +set(TEST_SOURCES + test_fixture.h + unit_spirv.h + + assembly_context_test.cpp + assembly_format_test.cpp + binary_destroy_test.cpp + binary_endianness_test.cpp + binary_header_get_test.cpp + binary_parse_test.cpp + binary_strnlen_s_test.cpp + binary_to_text_test.cpp + binary_to_text.literal_test.cpp + comment_test.cpp + enum_string_mapping_test.cpp + enum_set_test.cpp + ext_inst.debuginfo_test.cpp + ext_inst.glsl_test.cpp + ext_inst.opencl_test.cpp + fix_word_test.cpp + generator_magic_number_test.cpp + hex_float_test.cpp + immediate_int_test.cpp + libspirv_macros_test.cpp + named_id_test.cpp + name_mapper_test.cpp + opcode_make_test.cpp + opcode_require_capabilities_test.cpp + opcode_split_test.cpp + opcode_table_get_test.cpp + operand_capabilities_test.cpp + operand_test.cpp + operand_pattern_test.cpp + software_version_test.cpp + target_env_test.cpp + text_advance_test.cpp + text_destroy_test.cpp + text_literal_test.cpp + text_start_new_inst_test.cpp + text_to_binary.annotation_test.cpp + text_to_binary.barrier_test.cpp + text_to_binary.constant_test.cpp + text_to_binary.control_flow_test.cpp + text_to_binary_test.cpp + text_to_binary.debug_test.cpp + text_to_binary.device_side_enqueue_test.cpp + text_to_binary.extension_test.cpp + text_to_binary.function_test.cpp + text_to_binary.group_test.cpp + text_to_binary.image_test.cpp + text_to_binary.literal_test.cpp + text_to_binary.memory_test.cpp + text_to_binary.misc_test.cpp + text_to_binary.mode_setting_test.cpp + text_to_binary.pipe_storage_test.cpp + text_to_binary.type_declaration_test.cpp + text_to_binary.subgroup_dispatch_test.cpp + text_to_binary.reserved_sampling_test.cpp + text_word_get_test.cpp + + unit_spirv.cpp +) + +add_spvtools_unittest( + TARGET spirv_unit_tests + SRCS ${TEST_SOURCES} + LIBS ${SPIRV_TOOLS}) + +add_spvtools_unittest( + TARGET diagnostic + SRCS diagnostic_test.cpp + LIBS ${SPIRV_TOOLS}) + +add_spvtools_unittest( + TARGET c_interface + SRCS c_interface_test.cpp + LIBS ${SPIRV_TOOLS}) + +add_spvtools_unittest( + TARGET c_interface_shared + SRCS c_interface_test.cpp + LIBS ${SPIRV_TOOLS}-shared + ENVIRONMENT PATH=$) + +add_spvtools_unittest( + TARGET cpp_interface + SRCS cpp_interface_test.cpp + LIBS SPIRV-Tools-opt) + +add_spvtools_unittest( + TARGET parse_number + SRCS parse_number_test.cpp + LIBS ${SPIRV_TOOLS}) + +add_spvtools_unittest( + TARGET string_utils + SRCS string_utils_test.cpp + LIBS ${SPIRV_TOOLS}) + +if (${SPIRV_TIMER_ENABLED}) +add_spvtools_unittest( + TARGET timer + SRCS timer_test.cpp + LIBS ${SPIRV_TOOLS}) +endif() + +add_spvtools_unittest( + TARGET log + SRCS log_test.cpp + LIBS ${SPIRV_TOOLS}) + +add_spvtools_unittest( + TARGET preserve_numeric_ids + SRCS preserve_numeric_ids_test.cpp + LIBS ${SPIRV_TOOLS}) + +add_spvtools_unittest( + TARGET bit_stream + SRCS bit_stream.cpp + LIBS ${SPIRV_TOOLS}) + +add_spvtools_unittest( + TARGET huffman_codec + SRCS huffman_codec.cpp + LIBS ${SPIRV_TOOLS}) + +add_spvtools_unittest( + TARGET move_to_front + SRCS move_to_front_test.cpp + LIBS ${SPIRV_TOOLS}) + +add_subdirectory(comp) +add_subdirectory(link) +add_subdirectory(opt) +add_subdirectory(stats) +add_subdirectory(util) +add_subdirectory(val) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/comment_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/comment_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/comment_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/comment_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,46 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "gmock/gmock.h" +#include "test_fixture.h" +#include "unit_spirv.h" + +namespace { + +using spvtest::Concatenate; +using spvtest::MakeInstruction; +using spvtest::MakeVector; +using spvtest::TextToBinaryTest; +using testing::Eq; + +TEST_F(TextToBinaryTest, Whitespace) { + std::string input = R"( +; I'm a proud comment at the beginning of the file +; I hide: OpCapability Shader + OpMemoryModel Logical Simple ; comment after instruction +;;;;;;;; many ;'s + %glsl450 = OpExtInstImport "GLSL.std.450" + ; comment indented +)"; + + EXPECT_THAT( + CompiledInstructions(input), + Eq(Concatenate({MakeInstruction(SpvOpMemoryModel, + {uint32_t(SpvAddressingModelLogical), + uint32_t(SpvMemoryModelSimple)}), + MakeInstruction(SpvOpExtInstImport, {1}, + MakeVector("GLSL.std.450"))}))); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/comp/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/comp/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/comp/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/comp/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,29 @@ +# Copyright (c) 2017 Google 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. + +set(VAL_TEST_COMMON_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/../test_fixture.h + ${CMAKE_CURRENT_SOURCE_DIR}/../unit_spirv.h +) + +if(SPIRV_BUILD_COMPRESSION) + add_spvtools_unittest(TARGET markv_codec + SRCS + markv_codec_test.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../../tools/comp/markv_model_factory.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../../tools/comp/markv_model_shader.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS SPIRV-Tools-comp ${SPIRV_TOOLS} + ) +endif(SPIRV_BUILD_COMPRESSION) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/comp/markv_codec_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/comp/markv_codec_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/comp/markv_codec_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/comp/markv_codec_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,828 @@ +// Copyright (c) 2017 Google 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. + +// Tests for unique type declaration rules validator. + +#include +#include +#include + +#include "gmock/gmock.h" +#include "source/comp/markv.h" +#include "test_fixture.h" +#include "tools/comp/markv_model_factory.h" +#include "unit_spirv.h" + +namespace { + +using libspirv::SetContextMessageConsumer; +using spvtest::ScopedContext; +using spvtools::MarkvModelType; +using MarkvTest = ::testing::TestWithParam; + +void DiagnosticsMessageHandler(spv_message_level_t level, const char*, + const spv_position_t& position, + const char* message) { + switch (level) { + case SPV_MSG_FATAL: + case SPV_MSG_INTERNAL_ERROR: + case SPV_MSG_ERROR: + std::cerr << "error: " << position.index << ": " << message << std::endl; + break; + case SPV_MSG_WARNING: + std::cout << "warning: " << position.index << ": " << message + << std::endl; + break; + case SPV_MSG_INFO: + std::cout << "info: " << position.index << ": " << message << std::endl; + break; + default: + break; + } +} + +// Compiles |code| to SPIR-V |words|. +void Compile(const std::string& code, std::vector* words, + uint32_t options = SPV_TEXT_TO_BINARY_OPTION_NONE, + spv_target_env env = SPV_ENV_UNIVERSAL_1_2) { + ScopedContext ctx(env); + SetContextMessageConsumer(ctx.context, DiagnosticsMessageHandler); + + spv_binary spirv_binary; + ASSERT_EQ(SPV_SUCCESS, + spvTextToBinaryWithOptions(ctx.context, code.c_str(), code.size(), + options, &spirv_binary, nullptr)); + + *words = std::vector(spirv_binary->code, + spirv_binary->code + spirv_binary->wordCount); + + spvBinaryDestroy(spirv_binary); +} + +// Disassembles SPIR-V |words| to |out_text|. +void Disassemble(const std::vector& words, std::string* out_text, + spv_target_env env = SPV_ENV_UNIVERSAL_1_2) { + ScopedContext ctx(env); + SetContextMessageConsumer(ctx.context, DiagnosticsMessageHandler); + + spv_text text = nullptr; + ASSERT_EQ(SPV_SUCCESS, spvBinaryToText(ctx.context, words.data(), + words.size(), 0, &text, nullptr)); + assert(text); + + *out_text = std::string(text->str, text->length); + spvTextDestroy(text); +} + +// Encodes/decodes |original|, assembles/dissasembles |original|, then compares +// the results of the two operations. +void TestEncodeDecode(MarkvModelType model_type, + const std::string& original_text) { + ScopedContext ctx(SPV_ENV_UNIVERSAL_1_2); + std::unique_ptr model = + spvtools::CreateMarkvModel(model_type); + spvtools::MarkvCodecOptions options; + + std::vector expected_binary; + Compile(original_text, &expected_binary); + ASSERT_FALSE(expected_binary.empty()); + + std::string expected_text; + Disassemble(expected_binary, &expected_text); + ASSERT_FALSE(expected_text.empty()); + + std::vector binary_to_encode; + Compile(original_text, &binary_to_encode, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ASSERT_FALSE(binary_to_encode.empty()); + + std::stringstream encoder_comments; + const auto output_to_string_stream = + [&encoder_comments](const std::string& str) { encoder_comments << str; }; + + std::vector markv; + ASSERT_EQ(SPV_SUCCESS, spvtools::SpirvToMarkv( + ctx.context, binary_to_encode, options, *model, + DiagnosticsMessageHandler, output_to_string_stream, + spvtools::MarkvDebugConsumer(), &markv)); + ASSERT_FALSE(markv.empty()); + + std::vector decoded_binary; + ASSERT_EQ(SPV_SUCCESS, + spvtools::MarkvToSpirv( + ctx.context, markv, options, *model, DiagnosticsMessageHandler, + spvtools::MarkvLogConsumer(), spvtools::MarkvDebugConsumer(), + &decoded_binary)); + ASSERT_FALSE(decoded_binary.empty()); + + EXPECT_EQ(expected_binary, decoded_binary) << encoder_comments.str(); + + std::string decoded_text; + Disassemble(decoded_binary, &decoded_text); + ASSERT_FALSE(decoded_text.empty()); + + EXPECT_EQ(expected_text, decoded_text) << encoder_comments.str(); +} + +void TestEncodeDecodeShaderMainBody(MarkvModelType model_type, + const std::string& body) { + const std::string prefix = + R"( +OpCapability Shader +OpCapability Int64 +OpCapability Float64 +%ext_inst = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f32 = OpTypeFloat 32 +%u32 = OpTypeInt 32 0 +%s32 = OpTypeInt 32 1 +%f64 = OpTypeFloat 64 +%u64 = OpTypeInt 64 0 +%s64 = OpTypeInt 64 1 +%boolvec2 = OpTypeVector %bool 2 +%s32vec2 = OpTypeVector %s32 2 +%u32vec2 = OpTypeVector %u32 2 +%f32vec2 = OpTypeVector %f32 2 +%f64vec2 = OpTypeVector %f64 2 +%boolvec3 = OpTypeVector %bool 3 +%u32vec3 = OpTypeVector %u32 3 +%s32vec3 = OpTypeVector %s32 3 +%f32vec3 = OpTypeVector %f32 3 +%f64vec3 = OpTypeVector %f64 3 +%boolvec4 = OpTypeVector %bool 4 +%u32vec4 = OpTypeVector %u32 4 +%s32vec4 = OpTypeVector %s32 4 +%f32vec4 = OpTypeVector %f32 4 +%f64vec4 = OpTypeVector %f64 4 + +%f32_0 = OpConstant %f32 0 +%f32_1 = OpConstant %f32 1 +%f32_2 = OpConstant %f32 2 +%f32_3 = OpConstant %f32 3 +%f32_4 = OpConstant %f32 4 +%f32_pi = OpConstant %f32 3.14159 + +%s32_0 = OpConstant %s32 0 +%s32_1 = OpConstant %s32 1 +%s32_2 = OpConstant %s32 2 +%s32_3 = OpConstant %s32 3 +%s32_4 = OpConstant %s32 4 +%s32_m1 = OpConstant %s32 -1 + +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u32_2 = OpConstant %u32 2 +%u32_3 = OpConstant %u32 3 +%u32_4 = OpConstant %u32 4 + +%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 +%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 +%u32vec3_012 = OpConstantComposite %u32vec3 %u32_0 %u32_1 %u32_2 +%u32vec3_123 = OpConstantComposite %u32vec3 %u32_1 %u32_2 %u32_3 +%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 +%u32vec4_1234 = OpConstantComposite %u32vec4 %u32_1 %u32_2 %u32_3 %u32_4 + +%s32vec2_01 = OpConstantComposite %s32vec2 %s32_0 %s32_1 +%s32vec2_12 = OpConstantComposite %s32vec2 %s32_1 %s32_2 +%s32vec3_012 = OpConstantComposite %s32vec3 %s32_0 %s32_1 %s32_2 +%s32vec3_123 = OpConstantComposite %s32vec3 %s32_1 %s32_2 %s32_3 +%s32vec4_0123 = OpConstantComposite %s32vec4 %s32_0 %s32_1 %s32_2 %s32_3 +%s32vec4_1234 = OpConstantComposite %s32vec4 %s32_1 %s32_2 %s32_3 %s32_4 + +%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 +%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 +%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 +%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 +%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 +%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 + +%main = OpFunction %void None %func +%main_entry = OpLabel)"; + + const std::string suffix = + R"( +OpReturn +OpFunctionEnd)"; + + TestEncodeDecode(model_type, prefix + body + suffix); +} + +TEST_P(MarkvTest, U32Literal) { + TestEncodeDecode(GetParam(), R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%u32 = OpTypeInt 32 0 +%100 = OpConstant %u32 0 +%200 = OpConstant %u32 1 +%300 = OpConstant %u32 4294967295 +)"); +} + +TEST_P(MarkvTest, S32Literal) { + TestEncodeDecode(GetParam(), R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%s32 = OpTypeInt 32 1 +%100 = OpConstant %s32 0 +%200 = OpConstant %s32 1 +%300 = OpConstant %s32 -1 +%400 = OpConstant %s32 2147483647 +%500 = OpConstant %s32 -2147483648 +)"); +} + +TEST_P(MarkvTest, U64Literal) { + TestEncodeDecode(GetParam(), R"( +OpCapability Shader +OpCapability Linkage +OpCapability Int64 +OpMemoryModel Logical GLSL450 +%u64 = OpTypeInt 64 0 +%100 = OpConstant %u64 0 +%200 = OpConstant %u64 1 +%300 = OpConstant %u64 18446744073709551615 +)"); +} + +TEST_P(MarkvTest, S64Literal) { + TestEncodeDecode(GetParam(), R"( +OpCapability Shader +OpCapability Linkage +OpCapability Int64 +OpMemoryModel Logical GLSL450 +%s64 = OpTypeInt 64 1 +%100 = OpConstant %s64 0 +%200 = OpConstant %s64 1 +%300 = OpConstant %s64 -1 +%400 = OpConstant %s64 9223372036854775807 +%500 = OpConstant %s64 -9223372036854775808 +)"); +} + +TEST_P(MarkvTest, U16Literal) { + TestEncodeDecode(GetParam(), R"( +OpCapability Shader +OpCapability Linkage +OpCapability Int16 +OpMemoryModel Logical GLSL450 +%u16 = OpTypeInt 16 0 +%100 = OpConstant %u16 0 +%200 = OpConstant %u16 1 +%300 = OpConstant %u16 65535 +)"); +} + +TEST_P(MarkvTest, S16Literal) { + TestEncodeDecode(GetParam(), R"( +OpCapability Shader +OpCapability Linkage +OpCapability Int16 +OpMemoryModel Logical GLSL450 +%s16 = OpTypeInt 16 1 +%100 = OpConstant %s16 0 +%200 = OpConstant %s16 1 +%300 = OpConstant %s16 -1 +%400 = OpConstant %s16 32767 +%500 = OpConstant %s16 -32768 +)"); +} + +TEST_P(MarkvTest, F32Literal) { + TestEncodeDecode(GetParam(), R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%f32 = OpTypeFloat 32 +%100 = OpConstant %f32 0 +%200 = OpConstant %f32 1 +%300 = OpConstant %f32 0.1 +%400 = OpConstant %f32 -0.1 +)"); +} + +TEST_P(MarkvTest, F64Literal) { + TestEncodeDecode(GetParam(), R"( +OpCapability Shader +OpCapability Linkage +OpCapability Float64 +OpMemoryModel Logical GLSL450 +%f64 = OpTypeFloat 64 +%100 = OpConstant %f64 0 +%200 = OpConstant %f64 1 +%300 = OpConstant %f64 0.1 +%400 = OpConstant %f64 -0.1 +)"); +} + +TEST_P(MarkvTest, F16Literal) { + TestEncodeDecode(GetParam(), R"( +OpCapability Shader +OpCapability Linkage +OpCapability Float16 +OpMemoryModel Logical GLSL450 +%f16 = OpTypeFloat 16 +%100 = OpConstant %f16 0 +%200 = OpConstant %f16 1 +%300 = OpConstant %f16 0.1 +%400 = OpConstant %f16 -0.1 +)"); +} + +TEST_P(MarkvTest, StringLiteral) { + TestEncodeDecode(GetParam(), R"( +OpCapability Shader +OpCapability Linkage +OpExtension "SPV_KHR_16bit_storage" +OpExtension "xxx" +OpExtension "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +OpExtension "" +OpMemoryModel Logical GLSL450 +)"); +} + +TEST_P(MarkvTest, WithFunction) { + TestEncodeDecode(GetParam(), R"( +OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpExtension "SPV_KHR_16bit_storage" +OpMemoryModel Physical32 OpenCL +%f32 = OpTypeFloat 32 +%u32 = OpTypeInt 32 0 +%void = OpTypeVoid +%void_func = OpTypeFunction %void +%100 = OpConstant %u32 1 +%200 = OpConstant %u32 2 +%main = OpFunction %void None %void_func +%entry_main = OpLabel +%300 = OpIAdd %u32 %100 %200 +OpReturn +OpFunctionEnd +)"); +} + +TEST_P(MarkvTest, WithMultipleFunctions) { + TestEncodeDecode(GetParam(), R"( +OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +%f32 = OpTypeFloat 32 +%one = OpConstant %f32 1 +%void = OpTypeVoid +%void_func = OpTypeFunction %void +%f32_func = OpTypeFunction %f32 %f32 +%sqr_plus_one = OpFunction %f32 None %f32_func +%x = OpFunctionParameter %f32 +%100 = OpLabel +%x2 = OpFMul %f32 %x %x +%x2p1 = OpFunctionCall %f32 %plus_one %x2 +OpReturnValue %x2p1 +OpFunctionEnd +%plus_one = OpFunction %f32 None %f32_func +%y = OpFunctionParameter %f32 +%200 = OpLabel +%yp1 = OpFAdd %f32 %y %one +OpReturnValue %yp1 +OpFunctionEnd +%main = OpFunction %void None %void_func +%entry_main = OpLabel +%1p1 = OpFunctionCall %f32 %sqr_plus_one %one +OpReturn +OpFunctionEnd +)"); +} + +TEST_P(MarkvTest, ForwardDeclaredId) { + TestEncodeDecode(GetParam(), R"( +OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +OpEntryPoint Kernel %1 "simple_kernel" +%2 = OpTypeInt 32 0 +%3 = OpTypeVector %2 2 +%4 = OpConstant %2 2 +%5 = OpTypeArray %2 %4 +%6 = OpTypeVoid +%7 = OpTypeFunction %6 +%1 = OpFunction %6 None %7 +%8 = OpLabel +OpReturn +OpFunctionEnd +)"); +} + +TEST_P(MarkvTest, WithSwitch) { + TestEncodeDecode(GetParam(), R"( +OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpCapability Int64 +OpMemoryModel Physical32 OpenCL +%u64 = OpTypeInt 64 0 +%void = OpTypeVoid +%void_func = OpTypeFunction %void +%val = OpConstant %u64 1 +%main = OpFunction %void None %void_func +%entry_main = OpLabel +OpSwitch %val %default 1 %case1 1000000000000 %case2 +%case1 = OpLabel +OpNop +OpBranch %after_switch +%case2 = OpLabel +OpNop +OpBranch %after_switch +%default = OpLabel +OpNop +OpBranch %after_switch +%after_switch = OpLabel +OpReturn +OpFunctionEnd +)"); +} + +TEST_P(MarkvTest, WithLoop) { + TestEncodeDecode(GetParam(), R"( +OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +%void = OpTypeVoid +%void_func = OpTypeFunction %void +%main = OpFunction %void None %void_func +%entry_main = OpLabel +OpLoopMerge %merge %continue DontUnroll|DependencyLength 10 +OpBranch %begin_loop +%begin_loop = OpLabel +OpNop +OpBranch %continue +%continue = OpLabel +OpNop +OpBranch %begin_loop +%merge = OpLabel +OpReturn +OpFunctionEnd +)"); +} + +TEST_P(MarkvTest, WithDecorate) { + TestEncodeDecode(GetParam(), R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 ArrayStride 4 +OpDecorate %1 Uniform +%2 = OpTypeFloat 32 +%1 = OpTypeRuntimeArray %2 +)"); +} + +TEST_P(MarkvTest, WithExtInst) { + TestEncodeDecode(GetParam(), R"( +OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +%opencl = OpExtInstImport "OpenCL.std" +OpMemoryModel Physical32 OpenCL +%f32 = OpTypeFloat 32 +%void = OpTypeVoid +%void_func = OpTypeFunction %void +%100 = OpConstant %f32 1.1 +%main = OpFunction %void None %void_func +%entry_main = OpLabel +%200 = OpExtInst %f32 %opencl cos %100 +OpReturn +OpFunctionEnd +)"); +} + +TEST_P(MarkvTest, F32Mul) { + TestEncodeDecodeShaderMainBody(GetParam(), R"( +%val1 = OpFMul %f32 %f32_0 %f32_1 +%val2 = OpFMul %f32 %f32_2 %f32_0 +%val3 = OpFMul %f32 %f32_pi %f32_2 +%val4 = OpFMul %f32 %f32_1 %f32_1 +)"); +} + +TEST_P(MarkvTest, U32Mul) { + TestEncodeDecodeShaderMainBody(GetParam(), R"( +%val1 = OpIMul %u32 %u32_0 %u32_1 +%val2 = OpIMul %u32 %u32_2 %u32_0 +%val3 = OpIMul %u32 %u32_3 %u32_2 +%val4 = OpIMul %u32 %u32_1 %u32_1 +)"); +} + +TEST_P(MarkvTest, S32Mul) { + TestEncodeDecodeShaderMainBody(GetParam(), R"( +%val1 = OpIMul %s32 %s32_0 %s32_1 +%val2 = OpIMul %s32 %s32_2 %s32_0 +%val3 = OpIMul %s32 %s32_m1 %s32_2 +%val4 = OpIMul %s32 %s32_1 %s32_1 +)"); +} + +TEST_P(MarkvTest, F32Add) { + TestEncodeDecodeShaderMainBody(GetParam(), R"( +%val1 = OpFAdd %f32 %f32_0 %f32_1 +%val2 = OpFAdd %f32 %f32_2 %f32_0 +%val3 = OpFAdd %f32 %f32_pi %f32_2 +%val4 = OpFAdd %f32 %f32_1 %f32_1 +)"); +} + +TEST_P(MarkvTest, U32Add) { + TestEncodeDecodeShaderMainBody(GetParam(), R"( +%val1 = OpIAdd %u32 %u32_0 %u32_1 +%val2 = OpIAdd %u32 %u32_2 %u32_0 +%val3 = OpIAdd %u32 %u32_3 %u32_2 +%val4 = OpIAdd %u32 %u32_1 %u32_1 +)"); +} + +TEST_P(MarkvTest, S32Add) { + TestEncodeDecodeShaderMainBody(GetParam(), R"( +%val1 = OpIAdd %s32 %s32_0 %s32_1 +%val2 = OpIAdd %s32 %s32_2 %s32_0 +%val3 = OpIAdd %s32 %s32_m1 %s32_2 +%val4 = OpIAdd %s32 %s32_1 %s32_1 +)"); +} + +TEST_P(MarkvTest, F32Dot) { + TestEncodeDecodeShaderMainBody(GetParam(), R"( +%dot2_1 = OpDot %f32 %f32vec2_01 %f32vec2_12 +%dot2_2 = OpDot %f32 %f32vec2_01 %f32vec2_01 +%dot2_3 = OpDot %f32 %f32vec2_12 %f32vec2_12 +%dot3_1 = OpDot %f32 %f32vec3_012 %f32vec3_123 +%dot3_2 = OpDot %f32 %f32vec3_012 %f32vec3_012 +%dot3_3 = OpDot %f32 %f32vec3_123 %f32vec3_123 +%dot4_1 = OpDot %f32 %f32vec4_0123 %f32vec4_1234 +%dot4_2 = OpDot %f32 %f32vec4_0123 %f32vec4_0123 +%dot4_3 = OpDot %f32 %f32vec4_1234 %f32vec4_1234 +)"); +} + +TEST_P(MarkvTest, F32VectorCompositeConstruct) { + TestEncodeDecodeShaderMainBody(GetParam(), R"( +%cc1 = OpCompositeConstruct %f32vec4 %f32vec2_01 %f32vec2_12 +%cc2 = OpCompositeConstruct %f32vec3 %f32vec2_01 %f32_2 +%cc3 = OpCompositeConstruct %f32vec2 %f32_1 %f32_2 +%cc4 = OpCompositeConstruct %f32vec4 %f32_1 %f32_2 %cc3 +)"); +} + +TEST_P(MarkvTest, U32VectorCompositeConstruct) { + TestEncodeDecodeShaderMainBody(GetParam(), R"( +%cc1 = OpCompositeConstruct %u32vec4 %u32vec2_01 %u32vec2_12 +%cc2 = OpCompositeConstruct %u32vec3 %u32vec2_01 %u32_2 +%cc3 = OpCompositeConstruct %u32vec2 %u32_1 %u32_2 +%cc4 = OpCompositeConstruct %u32vec4 %u32_1 %u32_2 %cc3 +)"); +} + +TEST_P(MarkvTest, S32VectorCompositeConstruct) { + TestEncodeDecodeShaderMainBody(GetParam(), R"( +%cc1 = OpCompositeConstruct %u32vec4 %u32vec2_01 %u32vec2_12 +%cc2 = OpCompositeConstruct %u32vec3 %u32vec2_01 %u32_2 +%cc3 = OpCompositeConstruct %u32vec2 %u32_1 %u32_2 +%cc4 = OpCompositeConstruct %u32vec4 %u32_1 %u32_2 %cc3 +)"); +} + +TEST_P(MarkvTest, F32VectorCompositeExtract) { + TestEncodeDecodeShaderMainBody(GetParam(), R"( +%f32vec4_3210 = OpCompositeConstruct %f32vec4 %f32_3 %f32_2 %f32_1 %f32_0 +%f32vec3_013 = OpCompositeExtract %f32vec3 %f32vec4_0123 0 1 3 +)"); +} + +TEST_P(MarkvTest, F32VectorComparison) { + TestEncodeDecodeShaderMainBody(GetParam(), R"( +%f32vec4_3210 = OpCompositeConstruct %f32vec4 %f32_3 %f32_2 %f32_1 %f32_0 +%c1 = OpFOrdEqual %boolvec4 %f32vec4_0123 %f32vec4_3210 +%c2 = OpFUnordEqual %boolvec4 %f32vec4_0123 %f32vec4_3210 +%c3 = OpFOrdNotEqual %boolvec4 %f32vec4_0123 %f32vec4_3210 +%c4 = OpFUnordNotEqual %boolvec4 %f32vec4_0123 %f32vec4_3210 +%c5 = OpFOrdLessThan %boolvec4 %f32vec4_0123 %f32vec4_3210 +%c6 = OpFUnordLessThan %boolvec4 %f32vec4_0123 %f32vec4_3210 +%c7 = OpFOrdGreaterThan %boolvec4 %f32vec4_0123 %f32vec4_3210 +%c8 = OpFUnordGreaterThan %boolvec4 %f32vec4_0123 %f32vec4_3210 +%c9 = OpFOrdLessThanEqual %boolvec4 %f32vec4_0123 %f32vec4_3210 +%c10 = OpFUnordLessThanEqual %boolvec4 %f32vec4_0123 %f32vec4_3210 +%c11 = OpFOrdGreaterThanEqual %boolvec4 %f32vec4_0123 %f32vec4_3210 +%c12 = OpFUnordGreaterThanEqual %boolvec4 %f32vec4_0123 %f32vec4_3210 +)"); +} + +TEST_P(MarkvTest, VectorShuffle) { + TestEncodeDecodeShaderMainBody(GetParam(), R"( +%f32vec4_3210 = OpCompositeConstruct %f32vec4 %f32_3 %f32_2 %f32_1 %f32_0 +%sh1 = OpVectorShuffle %f32vec2 %f32vec4_0123 %f32vec4_3210 3 6 +%sh2 = OpVectorShuffle %f32vec3 %f32vec2_01 %f32vec4_3210 0 3 4 +)"); +} + +TEST_P(MarkvTest, VectorTimesScalar) { + TestEncodeDecodeShaderMainBody(GetParam(), R"( +%f32vec4_3210 = OpCompositeConstruct %f32vec4 %f32_3 %f32_2 %f32_1 %f32_0 +%res1 = OpVectorTimesScalar %f32vec4 %f32vec4_0123 %f32_2 +%res2 = OpVectorTimesScalar %f32vec4 %f32vec4_3210 %f32_2 +)"); +} + +TEST_P(MarkvTest, SpirvSpecSample) { + TestEncodeDecode(GetParam(), R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" %31 %33 %42 %57 + OpExecutionMode %4 OriginLowerLeft + +; Debug information + OpSource GLSL 450 + OpName %4 "main" + OpName %9 "scale" + OpName %17 "S" + OpMemberName %17 0 "b" + OpMemberName %17 1 "v" + OpMemberName %17 2 "i" + OpName %18 "blockName" + OpMemberName %18 0 "s" + OpMemberName %18 1 "cond" + OpName %20 "" + OpName %31 "color" + OpName %33 "color1" + OpName %42 "color2" + OpName %48 "i" + OpName %57 "multiplier" + +; Annotations (non-debug) + OpDecorate %15 ArrayStride 16 + OpMemberDecorate %17 0 Offset 0 + OpMemberDecorate %17 1 Offset 16 + OpMemberDecorate %17 2 Offset 96 + OpMemberDecorate %18 0 Offset 0 + OpMemberDecorate %18 1 Offset 112 + OpDecorate %18 Block + OpDecorate %20 DescriptorSet 0 + OpDecorate %42 NoPerspective + +; All types, variables, and constants + %2 = OpTypeVoid + %3 = OpTypeFunction %2 ; void () + %6 = OpTypeFloat 32 ; 32-bit float + %7 = OpTypeVector %6 4 ; vec4 + %8 = OpTypePointer Function %7 ; function-local vec4* + %10 = OpConstant %6 1 + %11 = OpConstant %6 2 + %12 = OpConstantComposite %7 %10 %10 %11 %10 ; vec4(1.0, 1.0, 2.0, 1.0) + %13 = OpTypeInt 32 0 ; 32-bit int, sign-less + %14 = OpConstant %13 5 + %15 = OpTypeArray %7 %14 + %16 = OpTypeInt 32 1 + %17 = OpTypeStruct %13 %15 %16 + %18 = OpTypeStruct %17 %13 + %19 = OpTypePointer Uniform %18 + %20 = OpVariable %19 Uniform + %21 = OpConstant %16 1 + %22 = OpTypePointer Uniform %13 + %25 = OpTypeBool + %26 = OpConstant %13 0 + %30 = OpTypePointer Output %7 + %31 = OpVariable %30 Output + %32 = OpTypePointer Input %7 + %33 = OpVariable %32 Input + %35 = OpConstant %16 0 + %36 = OpConstant %16 2 + %37 = OpTypePointer Uniform %7 + %42 = OpVariable %32 Input + %47 = OpTypePointer Function %16 + %55 = OpConstant %16 4 + %57 = OpVariable %32 Input + +; All functions + %4 = OpFunction %2 None %3 ; main() + %5 = OpLabel + %9 = OpVariable %8 Function + %48 = OpVariable %47 Function + OpStore %9 %12 + %23 = OpAccessChain %22 %20 %21 ; location of cond + %24 = OpLoad %13 %23 ; load 32-bit int from cond + %27 = OpINotEqual %25 %24 %26 ; convert to bool + OpSelectionMerge %29 None ; structured if + OpBranchConditional %27 %28 %41 ; if cond + %28 = OpLabel ; then + %34 = OpLoad %7 %33 + %38 = OpAccessChain %37 %20 %35 %21 %36 ; s.v[2] + %39 = OpLoad %7 %38 + %40 = OpFAdd %7 %34 %39 + OpStore %31 %40 + OpBranch %29 + %41 = OpLabel ; else + %43 = OpLoad %7 %42 + %44 = OpExtInst %7 %1 Sqrt %43 ; extended instruction sqrt + %45 = OpLoad %7 %9 + %46 = OpFMul %7 %44 %45 + OpStore %31 %46 + OpBranch %29 + %29 = OpLabel ; endif + OpStore %48 %35 + OpBranch %49 + %49 = OpLabel + OpLoopMerge %51 %52 None ; structured loop + OpBranch %53 + %53 = OpLabel + %54 = OpLoad %16 %48 + %56 = OpSLessThan %25 %54 %55 ; i < 4 ? + OpBranchConditional %56 %50 %51 ; body or break + %50 = OpLabel ; body + %58 = OpLoad %7 %57 + %59 = OpLoad %7 %31 + %60 = OpFMul %7 %59 %58 + OpStore %31 %60 + OpBranch %52 + %52 = OpLabel ; continue target + %61 = OpLoad %16 %48 + %62 = OpIAdd %16 %61 %21 ; ++i + OpStore %48 %62 + OpBranch %49 ; loop back + %51 = OpLabel ; loop merge point + OpReturn + OpFunctionEnd +)"); +} + +TEST_P(MarkvTest, SampleFromDeadBranchEliminationTest) { + TestEncodeDecode(GetParam(), R"( +OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%5 = OpTypeFunction %void +%bool = OpTypeBool +%true = OpConstantTrue %bool +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%float_0 = OpConstant %float 0 +%12 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%float_1 = OpConstant %float 1 +%14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%_ptr_Input_v4float = OpTypePointer Input %v4float +%main = OpFunction %void None %5 +%17 = OpLabel +OpSelectionMerge %18 None +OpBranchConditional %true %19 %20 +%19 = OpLabel +OpBranch %18 +%20 = OpLabel +OpBranch %18 +%18 = OpLabel +%21 = OpPhi %v4float %12 %19 %14 %20 +OpStore %gl_FragColor %21 +OpReturn +OpFunctionEnd +)"); +} + +INSTANTIATE_TEST_CASE_P(AllMarkvModels, MarkvTest, + ::testing::ValuesIn(std::vector{ + spvtools::kMarkvModelShaderLite, + spvtools::kMarkvModelShaderMid, + spvtools::kMarkvModelShaderMax, + }), ); + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/cpp_interface_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/cpp_interface_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/cpp_interface_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/cpp_interface_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,365 @@ +// Copyright (c) 2016 Google 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. + +#include +#include + +#include "spirv-tools/optimizer.hpp" +#include "spirv/1.1/spirv.h" + +namespace { + +using namespace spvtools; +using ::testing::ContainerEq; +using ::testing::HasSubstr; + +TEST(CppInterface, SuccessfulRoundTrip) { + const std::string input_text = "%2 = OpSizeOf %1 %3\n"; + SpirvTools t(SPV_ENV_UNIVERSAL_1_1); + + std::vector binary; + EXPECT_TRUE(t.Assemble(input_text, &binary)); + EXPECT_TRUE(binary.size() > 5u); + EXPECT_EQ(SpvMagicNumber, binary[0]); + EXPECT_EQ(SpvVersion, binary[1]); + + // This cannot pass validation since %1 is not defined. + t.SetMessageConsumer([](spv_message_level_t level, const char* source, + const spv_position_t& position, const char* message) { + EXPECT_EQ(SPV_MSG_ERROR, level); + EXPECT_STREQ("input", source); + EXPECT_EQ(0u, position.line); + EXPECT_EQ(0u, position.column); + EXPECT_EQ(1u, position.index); + EXPECT_STREQ("ID 1 has not been defined", message); + }); + EXPECT_FALSE(t.Validate(binary)); + + std::string output_text; + EXPECT_TRUE(t.Disassemble(binary, &output_text)); + EXPECT_EQ(input_text, output_text); +} + +TEST(CppInterface, AssembleEmptyModule) { + std::vector binary(10, 42); + SpirvTools t(SPV_ENV_UNIVERSAL_1_1); + EXPECT_TRUE(t.Assemble("", &binary)); + // We only have the header. + EXPECT_EQ(5u, binary.size()); + EXPECT_EQ(SpvMagicNumber, binary[0]); + EXPECT_EQ(SpvVersion, binary[1]); +} + +TEST(CppInterface, AssembleOverloads) { + const std::string input_text = "%2 = OpSizeOf %1 %3\n"; + SpirvTools t(SPV_ENV_UNIVERSAL_1_1); + { + std::vector binary; + EXPECT_TRUE(t.Assemble(input_text, &binary)); + EXPECT_TRUE(binary.size() > 5u); + EXPECT_EQ(SpvMagicNumber, binary[0]); + EXPECT_EQ(SpvVersion, binary[1]); + } + { + std::vector binary; + EXPECT_TRUE(t.Assemble(input_text.data(), input_text.size(), &binary)); + EXPECT_TRUE(binary.size() > 5u); + EXPECT_EQ(SpvMagicNumber, binary[0]); + EXPECT_EQ(SpvVersion, binary[1]); + } + { // Ignore the last newline. + std::vector binary; + EXPECT_TRUE(t.Assemble(input_text.data(), input_text.size() - 1, &binary)); + EXPECT_TRUE(binary.size() > 5u); + EXPECT_EQ(SpvMagicNumber, binary[0]); + EXPECT_EQ(SpvVersion, binary[1]); + } +} + +TEST(CppInterface, AssembleWithWrongTargetEnv) { + const std::string input_text = "%r = OpSizeOf %type %pointer"; + SpirvTools t(SPV_ENV_UNIVERSAL_1_0); + int invocation_count = 0; + t.SetMessageConsumer( + [&invocation_count](spv_message_level_t level, const char* source, + const spv_position_t& position, const char* message) { + ++invocation_count; + EXPECT_EQ(SPV_MSG_ERROR, level); + EXPECT_STREQ("input", source); + EXPECT_EQ(0u, position.line); + EXPECT_EQ(5u, position.column); + EXPECT_EQ(5u, position.index); + EXPECT_STREQ("Invalid Opcode name 'OpSizeOf'", message); + }); + + std::vector binary = {42, 42}; + EXPECT_FALSE(t.Assemble(input_text, &binary)); + EXPECT_THAT(binary, ContainerEq(std::vector{42, 42})); + EXPECT_EQ(1, invocation_count); +} + +TEST(CppInterface, DisassembleEmptyModule) { + std::string text(10, 'x'); + SpirvTools t(SPV_ENV_UNIVERSAL_1_1); + int invocation_count = 0; + t.SetMessageConsumer( + [&invocation_count](spv_message_level_t level, const char* source, + const spv_position_t& position, const char* message) { + ++invocation_count; + EXPECT_EQ(SPV_MSG_ERROR, level); + EXPECT_STREQ("input", source); + EXPECT_EQ(0u, position.line); + EXPECT_EQ(0u, position.column); + EXPECT_EQ(0u, position.index); + EXPECT_STREQ("Missing module.", message); + }); + EXPECT_FALSE(t.Disassemble({}, &text)); + EXPECT_EQ("xxxxxxxxxx", text); // The original string is unmodified. + EXPECT_EQ(1, invocation_count); +} + +TEST(CppInterface, DisassembleOverloads) { + const std::string input_text = "%2 = OpSizeOf %1 %3\n"; + SpirvTools t(SPV_ENV_UNIVERSAL_1_1); + + std::vector binary; + EXPECT_TRUE(t.Assemble(input_text, &binary)); + + { + std::string output_text; + EXPECT_TRUE(t.Disassemble(binary, &output_text)); + EXPECT_EQ(input_text, output_text); + } + { + std::string output_text; + EXPECT_TRUE(t.Disassemble(binary.data(), binary.size(), &output_text)); + EXPECT_EQ(input_text, output_text); + } +} + +TEST(CppInterface, DisassembleWithWrongTargetEnv) { + const std::string input_text = "%r = OpSizeOf %type %pointer"; + SpirvTools t11(SPV_ENV_UNIVERSAL_1_1); + SpirvTools t10(SPV_ENV_UNIVERSAL_1_0); + int invocation_count = 0; + t10.SetMessageConsumer( + [&invocation_count](spv_message_level_t level, const char* source, + const spv_position_t& position, const char* message) { + ++invocation_count; + EXPECT_EQ(SPV_MSG_ERROR, level); + EXPECT_STREQ("input", source); + EXPECT_EQ(0u, position.line); + EXPECT_EQ(0u, position.column); + EXPECT_EQ(5u, position.index); + EXPECT_STREQ("Invalid opcode: 321", message); + }); + + std::vector binary; + EXPECT_TRUE(t11.Assemble(input_text, &binary)); + + std::string output_text(10, 'x'); + EXPECT_FALSE(t10.Disassemble(binary, &output_text)); + EXPECT_EQ("xxxxxxxxxx", output_text); // The original string is unmodified. +} + +TEST(CppInterface, SuccessfulValidation) { + const std::string input_text = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450)"; + SpirvTools t(SPV_ENV_UNIVERSAL_1_1); + int invocation_count = 0; + t.SetMessageConsumer([&invocation_count](spv_message_level_t, const char*, + const spv_position_t&, const char*) { + ++invocation_count; + }); + + std::vector binary; + EXPECT_TRUE(t.Assemble(input_text, &binary)); + EXPECT_TRUE(t.Validate(binary)); + EXPECT_EQ(0, invocation_count); +} + +TEST(CppInterface, ValidateOverloads) { + const std::string input_text = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450)"; + SpirvTools t(SPV_ENV_UNIVERSAL_1_1); + std::vector binary; + EXPECT_TRUE(t.Assemble(input_text, &binary)); + + { EXPECT_TRUE(t.Validate(binary)); } + { EXPECT_TRUE(t.Validate(binary.data(), binary.size())); } +} + +TEST(CppInterface, ValidateEmptyModule) { + SpirvTools t(SPV_ENV_UNIVERSAL_1_1); + int invocation_count = 0; + t.SetMessageConsumer( + [&invocation_count](spv_message_level_t level, const char* source, + const spv_position_t& position, const char* message) { + ++invocation_count; + EXPECT_EQ(SPV_MSG_ERROR, level); + EXPECT_STREQ("input", source); + EXPECT_EQ(0u, position.line); + EXPECT_EQ(0u, position.column); + EXPECT_EQ(0u, position.index); + EXPECT_STREQ("Invalid SPIR-V magic number.", message); + }); + EXPECT_FALSE(t.Validate({})); + EXPECT_EQ(1, invocation_count); +} + +// Returns the assembly for a SPIR-V module with a struct declaration +// with the given number of members. +std::string MakeModuleHavingStruct(int num_members) { + std::stringstream os; + os << R"(OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + %1 = OpTypeInt 32 0 + %2 = OpTypeStruct)"; + for (int i = 0; i < num_members; i++) os << " %1"; + return os.str(); +} + +TEST(CppInterface, ValidateWithOptionsPass) { + SpirvTools t(SPV_ENV_UNIVERSAL_1_1); + std::vector binary; + EXPECT_TRUE(t.Assemble(MakeModuleHavingStruct(10), &binary)); + const spvtools::ValidatorOptions opts; + + EXPECT_TRUE(t.Validate(binary.data(), binary.size(), opts)); +} + +TEST(CppInterface, ValidateWithOptionsFail) { + SpirvTools t(SPV_ENV_UNIVERSAL_1_1); + std::vector binary; + EXPECT_TRUE(t.Assemble(MakeModuleHavingStruct(10), &binary)); + spvtools::ValidatorOptions opts; + opts.SetUniversalLimit(spv_validator_limit_max_struct_members, 9); + std::stringstream os; + t.SetMessageConsumer([&os](spv_message_level_t, const char*, + const spv_position_t&, + const char* message) { os << message; }); + + EXPECT_FALSE(t.Validate(binary.data(), binary.size(), opts)); + EXPECT_THAT( + os.str(), + HasSubstr( + "Number of OpTypeStruct members (10) has exceeded the limit (9)")); +} + +// Checks that after running the given optimizer |opt| on the given |original| +// source code, we can get the given |optimized| source code. +void CheckOptimization(const char* original, const char* optimized, + const Optimizer& opt) { + SpirvTools t(SPV_ENV_UNIVERSAL_1_1); + std::vector original_binary; + ASSERT_TRUE(t.Assemble(original, &original_binary)); + + std::vector optimized_binary; + EXPECT_TRUE(opt.Run(original_binary.data(), original_binary.size(), + &optimized_binary)); + + std::string optimized_text; + EXPECT_TRUE(t.Disassemble(optimized_binary, &optimized_text)); + EXPECT_EQ(optimized, optimized_text); +} + +TEST(CppInterface, OptimizeEmptyModule) { + SpirvTools t(SPV_ENV_UNIVERSAL_1_1); + std::vector binary; + EXPECT_TRUE(t.Assemble("", &binary)); + + Optimizer o(SPV_ENV_UNIVERSAL_1_1); + o.RegisterPass(CreateStripDebugInfoPass()); + EXPECT_TRUE(o.Run(binary.data(), binary.size(), &binary)); +} + +TEST(CppInterface, OptimizeModifiedModule) { + Optimizer o(SPV_ENV_UNIVERSAL_1_1); + o.RegisterPass(CreateStripDebugInfoPass()); + CheckOptimization("OpSource GLSL 450", "", o); +} + +TEST(CppInterface, OptimizeMulitplePasses) { + const char* original_text = + "OpSource GLSL 450 " + "OpDecorate %true SpecId 1 " + "%bool = OpTypeBool " + "%true = OpSpecConstantTrue %bool"; + + Optimizer o(SPV_ENV_UNIVERSAL_1_1); + o.RegisterPass(CreateStripDebugInfoPass()) + .RegisterPass(CreateFreezeSpecConstantValuePass()); + + const char* expected_text = + "%bool = OpTypeBool\n" + "%true = OpConstantTrue %bool\n"; + + CheckOptimization(original_text, expected_text, o); +} + +TEST(CppInterface, OptimizeDoNothingWithPassToken) { + CreateFreezeSpecConstantValuePass(); + auto token = CreateUnifyConstantPass(); +} + +TEST(CppInterface, OptimizeReassignPassToken) { + auto token = CreateNullPass(); + token = CreateStripDebugInfoPass(); + + CheckOptimization( + "OpSource GLSL 450", "", + Optimizer(SPV_ENV_UNIVERSAL_1_1).RegisterPass(std::move(token))); +} + +TEST(CppInterface, OptimizeMoveConstructPassToken) { + auto token1 = CreateStripDebugInfoPass(); + Optimizer::PassToken token2(std::move(token1)); + + CheckOptimization( + "OpSource GLSL 450", "", + Optimizer(SPV_ENV_UNIVERSAL_1_1).RegisterPass(std::move(token2))); +} + +TEST(CppInterface, OptimizeMoveAssignPassToken) { + auto token1 = CreateStripDebugInfoPass(); + auto token2 = CreateNullPass(); + token2 = std::move(token1); + + CheckOptimization( + "OpSource GLSL 450", "", + Optimizer(SPV_ENV_UNIVERSAL_1_1).RegisterPass(std::move(token2))); +} + +TEST(CppInterface, OptimizeSameAddressForOriginalOptimizedBinary) { + SpirvTools t(SPV_ENV_UNIVERSAL_1_1); + std::vector binary; + ASSERT_TRUE(t.Assemble("OpSource GLSL 450", &binary)); + + EXPECT_TRUE(Optimizer(SPV_ENV_UNIVERSAL_1_1) + .RegisterPass(CreateStripDebugInfoPass()) + .Run(binary.data(), binary.size(), &binary)); + + std::string optimized_text; + EXPECT_TRUE(t.Disassemble(binary, &optimized_text)); + EXPECT_EQ("", optimized_text); +} + +// TODO(antiagainst): tests for SetMessageConsumer(). + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/diagnostic_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/diagnostic_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/diagnostic_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/diagnostic_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,106 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include + +#include "gmock/gmock.h" +#include "unit_spirv.h" + +namespace { + +using libspirv::DiagnosticStream; +using ::testing::Eq; + +// Returns a newly created diagnostic value. +spv_diagnostic MakeValidDiagnostic() { + spv_position_t position = {}; + spv_diagnostic diagnostic = spvDiagnosticCreate(&position, ""); + EXPECT_NE(nullptr, diagnostic); + return diagnostic; +} + +TEST(Diagnostic, DestroyNull) { spvDiagnosticDestroy(nullptr); } + +TEST(Diagnostic, DestroyValidDiagnostic) { + spv_diagnostic diagnostic = MakeValidDiagnostic(); + spvDiagnosticDestroy(diagnostic); + // We aren't allowed to use the diagnostic pointer anymore. + // So we can't test its behaviour. +} + +TEST(Diagnostic, DestroyValidDiagnosticAfterReassignment) { + spv_diagnostic diagnostic = MakeValidDiagnostic(); + spv_diagnostic second_diagnostic = MakeValidDiagnostic(); + EXPECT_TRUE(diagnostic != second_diagnostic); + spvDiagnosticDestroy(diagnostic); + diagnostic = second_diagnostic; + spvDiagnosticDestroy(diagnostic); +} + +TEST(Diagnostic, PrintDefault) { + char message[] = "Test Diagnostic!"; + spv_diagnostic_t diagnostic = {{2, 3, 5}, message}; + // TODO: Redirect stderr + ASSERT_EQ(SPV_SUCCESS, spvDiagnosticPrint(&diagnostic)); + // TODO: Validate the output of spvDiagnosticPrint() + // TODO: Remove the redirection of stderr +} + +TEST(Diagnostic, PrintInvalidDiagnostic) { + ASSERT_EQ(SPV_ERROR_INVALID_DIAGNOSTIC, spvDiagnosticPrint(nullptr)); +} + +// TODO(dneto): We should be able to redirect the diagnostic printing. +// Once we do that, we can test diagnostic corner cases. + +TEST(DiagnosticStream, ConversionToResultType) { + // Check after the DiagnosticStream object is destroyed. + spv_result_t value; + { value = DiagnosticStream({}, nullptr, SPV_ERROR_INVALID_TEXT); } + EXPECT_EQ(SPV_ERROR_INVALID_TEXT, value); + + // Check implicit conversion via plain assignment. + value = DiagnosticStream({}, nullptr, SPV_SUCCESS); + EXPECT_EQ(SPV_SUCCESS, value); + + // Check conversion via constructor. + EXPECT_EQ(SPV_FAILED_MATCH, + spv_result_t(DiagnosticStream({}, nullptr, SPV_FAILED_MATCH))); +} + +TEST( + DiagnosticStream, + MoveConstructorPreservesPreviousMessagesAndPreventsOutputFromExpiringValue) { + std::ostringstream messages; + int message_count = 0; + auto consumer = [&messages, &message_count](spv_message_level_t, const char*, + const spv_position_t&, + const char* msg) { + message_count++; + messages << msg; + }; + + // Enclose the DiagnosticStream variables in a scope to force destruction. + { + DiagnosticStream ds0({}, consumer, SPV_ERROR_INVALID_BINARY); + ds0 << "First"; + DiagnosticStream ds1(std::move(ds0)); + ds1 << "Second"; + } + EXPECT_THAT(message_count, Eq(1)); + EXPECT_THAT(messages.str(), Eq("FirstSecond")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/enum_set_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/enum_set_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/enum_set_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/enum_set_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,288 @@ +// Copyright (c) 2016 Google 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. + +#include +#include "gmock/gmock.h" + +#include "enum_set.h" +#include "unit_spirv.h" + +namespace { + +using libspirv::CapabilitySet; +using libspirv::EnumSet; +using spvtest::ElementsIn; +using ::testing::Eq; +using ::testing::ValuesIn; + +TEST(EnumSet, IsEmpty1) { + EnumSet set; + EXPECT_TRUE(set.IsEmpty()); + set.Add(0); + EXPECT_FALSE(set.IsEmpty()); +} + +TEST(EnumSet, IsEmpty2) { + EnumSet set; + EXPECT_TRUE(set.IsEmpty()); + set.Add(150); + EXPECT_FALSE(set.IsEmpty()); +} + +TEST(EnumSet, IsEmpty3) { + EnumSet set(4); + EXPECT_FALSE(set.IsEmpty()); +} + +TEST(EnumSet, IsEmpty4) { + EnumSet set(300); + EXPECT_FALSE(set.IsEmpty()); +} + +TEST(EnumSetHasAnyOf, EmptySetEmptyQuery) { + const EnumSet set; + const EnumSet empty; + EXPECT_TRUE(set.HasAnyOf(empty)); + EXPECT_TRUE(EnumSet().HasAnyOf(EnumSet())); +} + +TEST(EnumSetHasAnyOf, MaskSetEmptyQuery) { + EnumSet set; + const EnumSet empty; + set.Add(5); + set.Add(8); + EXPECT_TRUE(set.HasAnyOf(empty)); +} + +TEST(EnumSetHasAnyOf, OverflowSetEmptyQuery) { + EnumSet set; + const EnumSet empty; + set.Add(200); + set.Add(300); + EXPECT_TRUE(set.HasAnyOf(empty)); +} + +TEST(EnumSetHasAnyOf, EmptyQuery) { + EnumSet set; + const EnumSet empty; + set.Add(5); + set.Add(8); + set.Add(200); + set.Add(300); + EXPECT_TRUE(set.HasAnyOf(empty)); +} + +TEST(EnumSetHasAnyOf, EmptyQueryAlwaysTrue) { + EnumSet set; + const EnumSet empty; + EXPECT_TRUE(set.HasAnyOf(empty)); + set.Add(5); + EXPECT_TRUE(set.HasAnyOf(empty)); + + EXPECT_TRUE(EnumSet(100).HasAnyOf(EnumSet())); +} + +TEST(EnumSetHasAnyOf, ReflexiveMask) { + EnumSet set(3); + set.Add(24); + set.Add(30); + EXPECT_TRUE(set.HasAnyOf(set)); +} + +TEST(EnumSetHasAnyOf, ReflexiveOverflow) { + EnumSet set(200); + set.Add(300); + set.Add(400); + EXPECT_TRUE(set.HasAnyOf(set)); +} + +TEST(EnumSetHasAnyOf, Reflexive) { + EnumSet set(3); + set.Add(24); + set.Add(300); + set.Add(400); + EXPECT_TRUE(set.HasAnyOf(set)); +} + +TEST(EnumSetHasAnyOf, EmptySetHasNone) { + EnumSet set; + EnumSet items; + for (uint32_t i = 0; i < 200; ++i) { + items.Add(i); + EXPECT_FALSE(set.HasAnyOf(items)); + EXPECT_FALSE(set.HasAnyOf(EnumSet(i))); + } +} + +TEST(EnumSetHasAnyOf, MaskSetMaskQuery) { + EnumSet set(0); + EnumSet items(1); + EXPECT_FALSE(set.HasAnyOf(items)); + set.Add(2); + items.Add(3); + EXPECT_FALSE(set.HasAnyOf(items)); + set.Add(3); + EXPECT_TRUE(set.HasAnyOf(items)); + set.Add(4); + EXPECT_TRUE(set.HasAnyOf(items)); +} + +TEST(EnumSetHasAnyOf, OverflowSetOverflowQuery) { + EnumSet set(100); + EnumSet items(200); + EXPECT_FALSE(set.HasAnyOf(items)); + set.Add(300); + items.Add(400); + EXPECT_FALSE(set.HasAnyOf(items)); + set.Add(200); + EXPECT_TRUE(set.HasAnyOf(items)); + set.Add(500); + EXPECT_TRUE(set.HasAnyOf(items)); +} + +TEST(EnumSetHasAnyOf, GeneralCase) { + EnumSet set(0); + EnumSet items(100); + EXPECT_FALSE(set.HasAnyOf(items)); + set.Add(300); + items.Add(4); + EXPECT_FALSE(set.HasAnyOf(items)); + set.Add(5); + items.Add(500); + EXPECT_FALSE(set.HasAnyOf(items)); + set.Add(500); + EXPECT_TRUE(set.HasAnyOf(items)); + EXPECT_FALSE(set.HasAnyOf(EnumSet(20))); + EXPECT_FALSE(set.HasAnyOf(EnumSet(600))); + EXPECT_TRUE(set.HasAnyOf(EnumSet(5))); + EXPECT_TRUE(set.HasAnyOf(EnumSet(300))); + EXPECT_TRUE(set.HasAnyOf(EnumSet(0))); +} + +TEST(EnumSet, DefaultIsEmpty) { + EnumSet set; + for (uint32_t i = 0; i < 1000; ++i) { + EXPECT_FALSE(set.Contains(i)); + } +} + +TEST(CapabilitySet, ConstructSingleMemberMatrix) { + CapabilitySet s(SpvCapabilityMatrix); + EXPECT_TRUE(s.Contains(SpvCapabilityMatrix)); + EXPECT_FALSE(s.Contains(SpvCapabilityShader)); + EXPECT_FALSE(s.Contains(static_cast(1000))); +} + +TEST(CapabilitySet, ConstructSingleMemberMaxInMask) { + CapabilitySet s(static_cast(63)); + EXPECT_FALSE(s.Contains(SpvCapabilityMatrix)); + EXPECT_FALSE(s.Contains(SpvCapabilityShader)); + EXPECT_TRUE(s.Contains(static_cast(63))); + EXPECT_FALSE(s.Contains(static_cast(64))); + EXPECT_FALSE(s.Contains(static_cast(1000))); +} + +TEST(CapabilitySet, ConstructSingleMemberMinOverflow) { + // Check the first one that forces overflow beyond the mask. + CapabilitySet s(static_cast(64)); + EXPECT_FALSE(s.Contains(SpvCapabilityMatrix)); + EXPECT_FALSE(s.Contains(SpvCapabilityShader)); + EXPECT_FALSE(s.Contains(static_cast(63))); + EXPECT_TRUE(s.Contains(static_cast(64))); + EXPECT_FALSE(s.Contains(static_cast(1000))); +} + +TEST(CapabilitySet, ConstructSingleMemberMaxOverflow) { + // Check the max 32-bit signed int. + CapabilitySet s(static_cast(0x7fffffffu)); + EXPECT_FALSE(s.Contains(SpvCapabilityMatrix)); + EXPECT_FALSE(s.Contains(SpvCapabilityShader)); + EXPECT_FALSE(s.Contains(static_cast(1000))); + EXPECT_TRUE(s.Contains(static_cast(0x7fffffffu))); +} + +TEST(CapabilitySet, AddEnum) { + CapabilitySet s(SpvCapabilityShader); + s.Add(SpvCapabilityKernel); + s.Add(static_cast(42)); + EXPECT_FALSE(s.Contains(SpvCapabilityMatrix)); + EXPECT_TRUE(s.Contains(SpvCapabilityShader)); + EXPECT_TRUE(s.Contains(SpvCapabilityKernel)); + EXPECT_TRUE(s.Contains(static_cast(42))); +} + +TEST(CapabilitySet, InitializerListEmpty) { + CapabilitySet s{}; + for (uint32_t i = 0; i < 1000; i++) { + EXPECT_FALSE(s.Contains(static_cast(i))); + } +} + +struct ForEachCase { + CapabilitySet capabilities; + std::vector expected; +}; + +using CapabilitySetForEachTest = ::testing::TestWithParam; + +TEST_P(CapabilitySetForEachTest, CallsAsExpected) { + EXPECT_THAT(ElementsIn(GetParam().capabilities), Eq(GetParam().expected)); +} + +TEST_P(CapabilitySetForEachTest, CopyConstructor) { + CapabilitySet copy(GetParam().capabilities); + EXPECT_THAT(ElementsIn(copy), Eq(GetParam().expected)); +} + +TEST_P(CapabilitySetForEachTest, MoveConstructor) { + // We need a writable copy to move from. + CapabilitySet copy(GetParam().capabilities); + CapabilitySet moved(std::move(copy)); + EXPECT_THAT(ElementsIn(moved), Eq(GetParam().expected)); + + // The moved-from set is empty. + EXPECT_THAT(ElementsIn(copy), Eq(std::vector{})); +} + +TEST_P(CapabilitySetForEachTest, OperatorEquals) { + CapabilitySet assigned = GetParam().capabilities; + EXPECT_THAT(ElementsIn(assigned), Eq(GetParam().expected)); +} + +TEST_P(CapabilitySetForEachTest, OperatorEqualsSelfAssign) { + CapabilitySet assigned{GetParam().capabilities}; + assigned = assigned; + EXPECT_THAT(ElementsIn(assigned), Eq(GetParam().expected)); +} + +INSTANTIATE_TEST_CASE_P(Samples, CapabilitySetForEachTest, + ValuesIn(std::vector{ + {{}, {}}, + {{SpvCapabilityMatrix}, {SpvCapabilityMatrix}}, + {{SpvCapabilityKernel, SpvCapabilityShader}, + {SpvCapabilityShader, SpvCapabilityKernel}}, + {{static_cast(999)}, + {static_cast(999)}}, + {{static_cast(0x7fffffff)}, + {static_cast(0x7fffffff)}}, + // Mixture and out of order + {{static_cast(0x7fffffff), + static_cast(100), + SpvCapabilityShader, SpvCapabilityMatrix}, + {SpvCapabilityMatrix, SpvCapabilityShader, + static_cast(100), + static_cast(0x7fffffff)}}, + }), ); + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/enum_string_mapping_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/enum_string_mapping_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/enum_string_mapping_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/enum_string_mapping_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,194 @@ +// Copyright (c) 2017 Google 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. + +// Tests for OpExtension validator rules. + +#include + +#include "enum_string_mapping.h" +#include "extensions.h" +#include "gtest/gtest.h" + +namespace { + +using ::libspirv::Extension; + +using ::testing::Values; +using ::testing::ValuesIn; + +using ExtensionTest = + ::testing::TestWithParam>; +using UnknownExtensionTest = ::testing::TestWithParam; +using CapabilityTest = + ::testing::TestWithParam>; + +TEST_P(ExtensionTest, TestExtensionFromString) { + const std::pair& param = GetParam(); + const Extension extension = param.first; + const std::string extension_str = param.second; + Extension result_extension; + ASSERT_TRUE(libspirv::GetExtensionFromString(extension_str.c_str(), + &result_extension)); + EXPECT_EQ(extension, result_extension); +} + +TEST_P(ExtensionTest, TestExtensionToString) { + const std::pair& param = GetParam(); + const Extension extension = param.first; + const std::string extension_str = param.second; + const std::string result_str = libspirv::ExtensionToString(extension); + EXPECT_EQ(extension_str, result_str); +} + +TEST_P(UnknownExtensionTest, TestExtensionFromStringFails) { + Extension result_extension; + ASSERT_FALSE( + libspirv::GetExtensionFromString(GetParam().c_str(), &result_extension)); +} + +TEST_P(CapabilityTest, TestCapabilityToString) { + const std::pair& param = GetParam(); + const SpvCapability capability = param.first; + const std::string capability_str = param.second; + const std::string result_str = libspirv::CapabilityToString(capability); + EXPECT_EQ(capability_str, result_str); +} + +INSTANTIATE_TEST_CASE_P( + AllExtensions, ExtensionTest, + ValuesIn(std::vector>({ + {Extension::kSPV_KHR_16bit_storage, "SPV_KHR_16bit_storage"}, + {Extension::kSPV_KHR_device_group, "SPV_KHR_device_group"}, + {Extension::kSPV_KHR_multiview, "SPV_KHR_multiview"}, + {Extension::kSPV_KHR_shader_ballot, "SPV_KHR_shader_ballot"}, + {Extension::kSPV_KHR_shader_draw_parameters, + "SPV_KHR_shader_draw_parameters"}, + {Extension::kSPV_KHR_subgroup_vote, "SPV_KHR_subgroup_vote"}, + {Extension::kSPV_NVX_multiview_per_view_attributes, + "SPV_NVX_multiview_per_view_attributes"}, + {Extension::kSPV_NV_geometry_shader_passthrough, + "SPV_NV_geometry_shader_passthrough"}, + {Extension::kSPV_NV_sample_mask_override_coverage, + "SPV_NV_sample_mask_override_coverage"}, + {Extension::kSPV_NV_stereo_view_rendering, + "SPV_NV_stereo_view_rendering"}, + {Extension::kSPV_NV_viewport_array2, "SPV_NV_viewport_array2"}, + {Extension::kSPV_GOOGLE_decorate_string, "SPV_GOOGLE_decorate_string"}, + {Extension::kSPV_GOOGLE_hlsl_functionality1, + "SPV_GOOGLE_hlsl_functionality1"}, + }))); + +INSTANTIATE_TEST_CASE_P(UnknownExtensions, UnknownExtensionTest, + Values("", "SPV_KHR_", "SPV_KHR_device_group_ERROR", + /*alphabetically before all extensions*/ "A", + /*alphabetically after all extensions*/ "Z", + "SPV_ERROR_random_string_hfsdklhlktherh")); + +INSTANTIATE_TEST_CASE_P( + AllCapabilities, CapabilityTest, + ValuesIn(std::vector>( + {{SpvCapabilityMatrix, "Matrix"}, + {SpvCapabilityShader, "Shader"}, + {SpvCapabilityGeometry, "Geometry"}, + {SpvCapabilityTessellation, "Tessellation"}, + {SpvCapabilityAddresses, "Addresses"}, + {SpvCapabilityLinkage, "Linkage"}, + {SpvCapabilityKernel, "Kernel"}, + {SpvCapabilityVector16, "Vector16"}, + {SpvCapabilityFloat16Buffer, "Float16Buffer"}, + {SpvCapabilityFloat16, "Float16"}, + {SpvCapabilityFloat64, "Float64"}, + {SpvCapabilityInt64, "Int64"}, + {SpvCapabilityInt64Atomics, "Int64Atomics"}, + {SpvCapabilityImageBasic, "ImageBasic"}, + {SpvCapabilityImageReadWrite, "ImageReadWrite"}, + {SpvCapabilityImageMipmap, "ImageMipmap"}, + {SpvCapabilityPipes, "Pipes"}, + {SpvCapabilityGroups, "Groups"}, + {SpvCapabilityDeviceEnqueue, "DeviceEnqueue"}, + {SpvCapabilityLiteralSampler, "LiteralSampler"}, + {SpvCapabilityAtomicStorage, "AtomicStorage"}, + {SpvCapabilityInt16, "Int16"}, + {SpvCapabilityTessellationPointSize, "TessellationPointSize"}, + {SpvCapabilityGeometryPointSize, "GeometryPointSize"}, + {SpvCapabilityImageGatherExtended, "ImageGatherExtended"}, + {SpvCapabilityStorageImageMultisample, "StorageImageMultisample"}, + {SpvCapabilityUniformBufferArrayDynamicIndexing, + "UniformBufferArrayDynamicIndexing"}, + {SpvCapabilitySampledImageArrayDynamicIndexing, + "SampledImageArrayDynamicIndexing"}, + {SpvCapabilityStorageBufferArrayDynamicIndexing, + "StorageBufferArrayDynamicIndexing"}, + {SpvCapabilityStorageImageArrayDynamicIndexing, + "StorageImageArrayDynamicIndexing"}, + {SpvCapabilityClipDistance, "ClipDistance"}, + {SpvCapabilityCullDistance, "CullDistance"}, + {SpvCapabilityImageCubeArray, "ImageCubeArray"}, + {SpvCapabilitySampleRateShading, "SampleRateShading"}, + {SpvCapabilityImageRect, "ImageRect"}, + {SpvCapabilitySampledRect, "SampledRect"}, + {SpvCapabilityGenericPointer, "GenericPointer"}, + {SpvCapabilityInt8, "Int8"}, + {SpvCapabilityInputAttachment, "InputAttachment"}, + {SpvCapabilitySparseResidency, "SparseResidency"}, + {SpvCapabilityMinLod, "MinLod"}, + {SpvCapabilitySampled1D, "Sampled1D"}, + {SpvCapabilityImage1D, "Image1D"}, + {SpvCapabilitySampledCubeArray, "SampledCubeArray"}, + {SpvCapabilitySampledBuffer, "SampledBuffer"}, + {SpvCapabilityImageBuffer, "ImageBuffer"}, + {SpvCapabilityImageMSArray, "ImageMSArray"}, + {SpvCapabilityStorageImageExtendedFormats, + "StorageImageExtendedFormats"}, + {SpvCapabilityImageQuery, "ImageQuery"}, + {SpvCapabilityDerivativeControl, "DerivativeControl"}, + {SpvCapabilityInterpolationFunction, "InterpolationFunction"}, + {SpvCapabilityTransformFeedback, "TransformFeedback"}, + {SpvCapabilityGeometryStreams, "GeometryStreams"}, + {SpvCapabilityStorageImageReadWithoutFormat, + "StorageImageReadWithoutFormat"}, + {SpvCapabilityStorageImageWriteWithoutFormat, + "StorageImageWriteWithoutFormat"}, + {SpvCapabilityMultiViewport, "MultiViewport"}, + {SpvCapabilitySubgroupDispatch, "SubgroupDispatch"}, + {SpvCapabilityNamedBarrier, "NamedBarrier"}, + {SpvCapabilityPipeStorage, "PipeStorage"}, + {SpvCapabilitySubgroupBallotKHR, "SubgroupBallotKHR"}, + {SpvCapabilityDrawParameters, "DrawParameters"}, + {SpvCapabilitySubgroupVoteKHR, "SubgroupVoteKHR"}, + {SpvCapabilityStorageBuffer16BitAccess, "StorageBuffer16BitAccess"}, + {SpvCapabilityStorageUniformBufferBlock16, + "StorageBuffer16BitAccess"}, // Preferred name + {SpvCapabilityUniformAndStorageBuffer16BitAccess, + "UniformAndStorageBuffer16BitAccess"}, + {SpvCapabilityStorageUniform16, + "UniformAndStorageBuffer16BitAccess"}, // Preferred name + {SpvCapabilityStoragePushConstant16, "StoragePushConstant16"}, + {SpvCapabilityStorageInputOutput16, "StorageInputOutput16"}, + {SpvCapabilityDeviceGroup, "DeviceGroup"}, + {SpvCapabilityMultiView, "MultiView"}, + {SpvCapabilitySampleMaskOverrideCoverageNV, + "SampleMaskOverrideCoverageNV"}, + {SpvCapabilityGeometryShaderPassthroughNV, + "GeometryShaderPassthroughNV"}, + // The next two are different names for the same token. + {SpvCapabilityShaderViewportIndexLayerNV, + "ShaderViewportIndexLayerEXT"}, + {SpvCapabilityShaderViewportIndexLayerEXT, + "ShaderViewportIndexLayerEXT"}, + {SpvCapabilityShaderViewportMaskNV, "ShaderViewportMaskNV"}, + {SpvCapabilityShaderStereoViewNV, "ShaderStereoViewNV"}, + {SpvCapabilityPerViewAttributesNV, "PerViewAttributesNV"}})), ); + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/ext_inst.debuginfo_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/ext_inst.debuginfo_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/ext_inst.debuginfo_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/ext_inst.debuginfo_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,808 @@ +// Copyright (c) 2017 Google 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. + +#include "unit_spirv.h" + +#include +#include "DebugInfo.h" +#include "test_fixture.h" + +// This file tests the correctness of encoding and decoding of instructions +// involving the DebugInfo extended instruction set. +// Semantic correctness should be the responsibility of validator. +// +// See https://www.khronos.org/registry/spir-v/specs/1.0/DebugInfo.html + +namespace { + +using spvtest::Concatenate; +using spvtest::MakeInstruction; +using spvtest::MakeVector; +using testing::Eq; + +struct InstructionCase { + uint32_t opcode; + std::string name; + std::string operands; + std::vector expected_operands; +}; + +using ExtInstDebugInfoRoundTripTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; +using ExtInstDebugInfoRoundTripTestExplicit = spvtest::TextToBinaryTest; + +TEST_P(ExtInstDebugInfoRoundTripTest, ParameterizedExtInst) { + const std::string input = + "%1 = OpExtInstImport \"DebugInfo\"\n" + "%3 = OpExtInst %2 %1 " + + GetParam().name + GetParam().operands + "\n"; + // First make sure it assembles correctly. + EXPECT_THAT( + CompiledInstructions(input), + Eq(Concatenate( + {MakeInstruction(SpvOpExtInstImport, {1}, MakeVector("DebugInfo")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, GetParam().opcode}, + GetParam().expected_operands)}))) + << input; + // Now check the round trip through the disassembler. + EXPECT_THAT(EncodeAndDecodeSuccessfully(input), input) << input; +} + +#define CASE_0(Enum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, "", {} \ + } + +#define CASE_ILL(Enum, L0, L1) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " %4 " #L0 " " #L1, { \ + 4, L0, L1 \ + } \ + } + +#define CASE_IL(Enum, L0) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " %4 " #L0, { 4, L0 } \ + } + +#define CASE_I(Enum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " %4", { 4 } \ + } + +#define CASE_II(Enum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " %4 %5", { 4, 5 } \ + } + +#define CASE_III(Enum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " %4 %5 %6", { 4, 5, 6 } \ + } + +#define CASE_IIII(Enum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " %4 %5 %6 %7", { \ + 4, 5, 6, 7 \ + } \ + } + +#define CASE_IIIII(Enum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " %4 %5 %6 %7 %8", { \ + 4, 5, 6, 7, 8 \ + } \ + } + +#define CASE_IIIIII(Enum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " %4 %5 %6 %7 %8 %9", { \ + 4, 5, 6, 7, 8, 9 \ + } \ + } + +#define CASE_IIIIIII(Enum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " %4 %5 %6 %7 %8 %9 %10", { \ + 4, 5, 6, 7, 8, 9, 10 \ + } \ + } + +#define CASE_IIILLI(Enum, L0, L1) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 %5 %6 " #L0 " " #L1 " %7", { \ + 4, 5, 6, L0, L1, 7 \ + } \ + } + +#define CASE_IIILLIL(Enum, L0, L1, L2) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 %5 %6 " #L0 " " #L1 " %7 " #L2, { \ + 4, 5, 6, L0, L1, 7, L2 \ + } \ + } + +#define CASE_IE(Enum, E0) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " %4 " #E0, { \ + 4, uint32_t(DebugInfo##E0) \ + } \ + } + +#define CASE_IIE(Enum, E0) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " %4 %5 " #E0, { \ + 4, 5, uint32_t(DebugInfo##E0) \ + } \ + } + +#define CASE_ISF(Enum, S0, Fstr, Fnum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " %4 " #S0 " " Fstr, { \ + 4, uint32_t(SpvStorageClass##S0), Fnum \ + } \ + } + +#define CASE_LII(Enum, L0) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " " #L0 " %4 %5", { \ + L0, 4, 5 \ + } \ + } + +#define CASE_ILI(Enum, L0) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " %4 " #L0 " %5", { \ + 4, L0, 5 \ + } \ + } + +#define CASE_ILII(Enum, L0) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " %4 " #L0 " %5 %6", { \ + 4, L0, 5, 6 \ + } \ + } + +#define CASE_ILLII(Enum, L0, L1) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 " #L0 " " #L1 " %5 %6", { \ + 4, L0, L1, 5, 6 \ + } \ + } + +#define CASE_IIILLIIF(Enum, L0, L1, Fstr, Fnum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 %5 %6 " #L0 " " #L1 " %7 %8 " Fstr, { \ + 4, 5, 6, L0, L1, 7, 8, Fnum \ + } \ + } + +#define CASE_IIILLIIFII(Enum, L0, L1, Fstr, Fnum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 %5 %6 " #L0 " " #L1 " %7 %8 " Fstr " %9 %10", { \ + 4, 5, 6, L0, L1, 7, 8, Fnum, 9, 10 \ + } \ + } + +#define CASE_IIILLIIFIIII(Enum, L0, L1, Fstr, Fnum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 %5 %6 " #L0 " " #L1 " %7 %8 " Fstr " %9 %10 %11 %12", { \ + 4, 5, 6, L0, L1, 7, 8, Fnum, 9, 10, 11, 12 \ + } \ + } + +#define CASE_IIILLIIFIIIIII(Enum, L0, L1, Fstr, Fnum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 %5 %6 " #L0 " " #L1 " %7 %8 " Fstr " %9 %10 %11 %12 %13 %14", { \ + 4, 5, 6, L0, L1, 7, 8, Fnum, 9, 10, 11, 12, 13, 14 \ + } \ + } + +#define CASE_IEILLIIF(Enum, E0, L0, L1, Fstr, Fnum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 " #E0 " %5 " #L0 " " #L1 " %6 %7 " Fstr, { \ + 4, uint32_t(DebugInfo##E0), 5, L0, L1, 6, 7, Fnum \ + } \ + } + +#define CASE_IEILLIIFI(Enum, E0, L0, L1, Fstr, Fnum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 " #E0 " %5 " #L0 " " #L1 " %6 %7 " Fstr " %8", { \ + 4, uint32_t(DebugInfo##E0), 5, L0, L1, 6, 7, Fnum, 8 \ + } \ + } + +#define CASE_IEILLIIFII(Enum, E0, L0, L1, Fstr, Fnum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 " #E0 " %5 " #L0 " " #L1 " %6 %7 " Fstr " %8 %9", { \ + 4, uint32_t(DebugInfo##E0), 5, L0, L1, 6, 7, Fnum, 8, 9 \ + } \ + } + +#define CASE_IEILLIIFIII(Enum, E0, L0, L1, Fstr, Fnum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 " #E0 " %5 " #L0 " " #L1 " %6 %7 " Fstr " %8 %9 %10", { \ + 4, uint32_t(DebugInfo##E0), 5, L0, L1, 6, 7, Fnum, 8, 9, 10 \ + } \ + } + +#define CASE_IEILLIIFIIII(Enum, E0, L0, L1, Fstr, Fnum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 " #E0 " %5 " #L0 " " #L1 " %6 %7 " Fstr " %8 %9 %10 %11", { \ + 4, uint32_t(DebugInfo##E0), 5, L0, L1, 6, 7, Fnum, 8, 9, 10, 11 \ + } \ + } + +#define CASE_IIILLIIIF(Enum, L0, L1, Fstr, Fnum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 %5 %6 " #L0 " " #L1 " %7 %8 %9 " Fstr, { \ + 4, 5, 6, L0, L1, 7, 8, 9, Fnum \ + } \ + } + +#define CASE_IIILLIIIFI(Enum, L0, L1, Fstr, Fnum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 %5 %6 " #L0 " " #L1 " %7 %8 %9 " Fstr " %10", { \ + 4, 5, 6, L0, L1, 7, 8, 9, Fnum, 10 \ + } \ + } + +#define CASE_IIIIF(Enum, Fstr, Fnum) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " %4 %5 %6 %7 " Fstr, { \ + 4, 5, 6, 7, Fnum \ + } \ + } + +#define CASE_IIILL(Enum, L0, L1) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " %4 %5 %6 " #L0 " " #L1, { \ + 4, 5, 6, L0, L1 \ + } \ + } + +#define CASE_IIIILL(Enum, L0, L1) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 %5 %6 %7 " #L0 " " #L1, { \ + 4, 5, 6, 7, L0, L1 \ + } \ + } + +#define CASE_IILLI(Enum, L0, L1) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 %5 " #L0 " " #L1 " %6", { \ + 4, 5, L0, L1, 6 \ + } \ + } + +#define CASE_IILLII(Enum, L0, L1) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 %5 " #L0 " " #L1 " %6 %7", { \ + 4, 5, L0, L1, 6, 7 \ + } \ + } + +#define CASE_IILLIII(Enum, L0, L1) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 %5 " #L0 " " #L1 " %6 %7 %8", { \ + 4, 5, L0, L1, 6, 7, 8 \ + } \ + } + +#define CASE_IILLIIII(Enum, L0, L1) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 %5 " #L0 " " #L1 " %6 %7 %8 %9", { \ + 4, 5, L0, L1, 6, 7, 8, 9 \ + } \ + } + +#define CASE_IIILLIIFLI(Enum, L0, L1, Fstr, Fnum, L2) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 %5 %6 " #L0 " " #L1 " %7 %8 " Fstr " " #L2 " %9", { \ + 4, 5, 6, L0, L1, 7, 8, Fnum, L2, 9 \ + } \ + } + +#define CASE_IIILLIIFLII(Enum, L0, L1, Fstr, Fnum, L2) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, \ + " %4 %5 %6 " #L0 " " #L1 " %7 %8 " Fstr " " #L2 " %9 %10", { \ + 4, 5, 6, L0, L1, 7, 8, Fnum, L2, 9, 10 \ + } \ + } + +#define CASE_E(Enum, E0) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " " #E0, { \ + uint32_t(DebugInfo##E0) \ + } \ + } + +#define CASE_EL(Enum, E0, L0) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " " #E0 " " #L0, { \ + uint32_t(DebugInfo##E0), L0 \ + } \ + } + +#define CASE_ELL(Enum, E0, L0, L1) \ + { \ + uint32_t(DebugInfoDebug##Enum), "Debug" #Enum, " " #E0 " " #L0 " " #L1, { \ + uint32_t(DebugInfo##E0), L0, L1 \ + } \ + } + +// DebugInfo 4.1 Absent Debugging Information +INSTANTIATE_TEST_CASE_P(DebugInfoDebugInfoNone, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_0(InfoNone), // enum value 0 + })), ); + +// DebugInfo 4.2 Compilation Unit +INSTANTIATE_TEST_CASE_P(DebugInfoDebugCompilationUnit, + ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_ILL(CompilationUnit, 100, 42), + })), ); + +// DebugInfo 4.3 Type instructions +INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeBasic, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_IIE(TypeBasic, Unspecified), + CASE_IIE(TypeBasic, Address), + CASE_IIE(TypeBasic, Boolean), + CASE_IIE(TypeBasic, Float), + CASE_IIE(TypeBasic, Signed), + CASE_IIE(TypeBasic, SignedChar), + CASE_IIE(TypeBasic, Unsigned), + CASE_IIE(TypeBasic, UnsignedChar), + })), ); + +// The FlagIsPublic is value is (1 << 0) | (1 << 2) which is the same +// as the bitwise-OR of FlagIsProtected and FlagIsPrivate. +// The disassembler will emit the compound expression instead. +// There is no simple fix for this. This enum is not really a mask +// for the bottom two bits. +TEST_F(ExtInstDebugInfoRoundTripTestExplicit, FlagIsPublic) { + const std::string prefix = + "%1 = OpExtInstImport \"DebugInfo\"\n" + "%3 = OpExtInst %2 %1 DebugTypePointer %4 Private "; + const std::string input = prefix + "FlagIsPublic\n"; + const std::string expected = prefix + "FlagIsProtected|FlagIsPrivate\n"; + // First make sure it assembles correctly. + EXPECT_THAT( + CompiledInstructions(input), + Eq(Concatenate( + {MakeInstruction(SpvOpExtInstImport, {1}, MakeVector("DebugInfo")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, DebugInfoDebugTypePointer, 4, + uint32_t(SpvStorageClassPrivate), + DebugInfoFlagIsPublic})}))) + << input; + // Now check the round trip through the disassembler. + EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(expected)) << input; +} + +INSTANTIATE_TEST_CASE_P( + DebugInfoDebugTypePointer, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + + //// Use each flag independently. + CASE_ISF(TypePointer, Private, "FlagIsProtected", + uint32_t(DebugInfoFlagIsProtected)), + CASE_ISF(TypePointer, Private, "FlagIsPrivate", + uint32_t(DebugInfoFlagIsPrivate)), + + // FlagIsPublic is tested above. + + CASE_ISF(TypePointer, Private, "FlagIsLocal", + uint32_t(DebugInfoFlagIsLocal)), + CASE_ISF(TypePointer, Private, "FlagIsDefinition", + uint32_t(DebugInfoFlagIsDefinition)), + CASE_ISF(TypePointer, Private, "FlagFwdDecl", + uint32_t(DebugInfoFlagFwdDecl)), + CASE_ISF(TypePointer, Private, "FlagArtificial", + uint32_t(DebugInfoFlagArtificial)), + CASE_ISF(TypePointer, Private, "FlagExplicit", + uint32_t(DebugInfoFlagExplicit)), + CASE_ISF(TypePointer, Private, "FlagPrototyped", + uint32_t(DebugInfoFlagPrototyped)), + CASE_ISF(TypePointer, Private, "FlagObjectPointer", + uint32_t(DebugInfoFlagObjectPointer)), + CASE_ISF(TypePointer, Private, "FlagStaticMember", + uint32_t(DebugInfoFlagStaticMember)), + CASE_ISF(TypePointer, Private, "FlagIndirectVariable", + uint32_t(DebugInfoFlagIndirectVariable)), + CASE_ISF(TypePointer, Private, "FlagLValueReference", + uint32_t(DebugInfoFlagLValueReference)), + CASE_ISF(TypePointer, Private, "FlagIsOptimized", + uint32_t(DebugInfoFlagIsOptimized)), + + //// Use flags in combination, and try different storage classes. + CASE_ISF(TypePointer, Function, "FlagIsProtected|FlagIsPrivate", + uint32_t(DebugInfoFlagIsProtected) | + uint32_t(DebugInfoFlagIsPrivate)), + CASE_ISF( + TypePointer, Workgroup, + "FlagIsPrivate|FlagFwdDecl|FlagIndirectVariable|FlagIsOptimized", + uint32_t(DebugInfoFlagIsPrivate) | uint32_t(DebugInfoFlagFwdDecl) | + uint32_t(DebugInfoFlagIndirectVariable) | + uint32_t(DebugInfoFlagIsOptimized)), + + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeQualifier, + ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_IE(TypeQualifier, ConstType), + CASE_IE(TypeQualifier, VolatileType), + CASE_IE(TypeQualifier, RestrictType), + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeArray, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_II(TypeArray), + CASE_III(TypeArray), + CASE_IIII(TypeArray), + CASE_IIIII(TypeArray), + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeVector, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_IL(TypeVector, 2), + CASE_IL(TypeVector, 3), + CASE_IL(TypeVector, 4), + CASE_IL(TypeVector, 16), + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypedef, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_IIILLI(Typedef, 12, 13), + CASE_IIILLI(Typedef, 14, 99), + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeFunction, + ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_I(TypeFunction), + CASE_II(TypeFunction), + CASE_III(TypeFunction), + CASE_IIII(TypeFunction), + CASE_IIIII(TypeFunction), + })), ); + +INSTANTIATE_TEST_CASE_P( + DebugInfoDebugTypeEnum, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_IIILLIIFII( + TypeEnum, 12, 13, + "FlagIsPrivate|FlagFwdDecl|FlagIndirectVariable|FlagIsOptimized", + uint32_t(DebugInfoFlagIsPrivate) | uint32_t(DebugInfoFlagFwdDecl) | + uint32_t(DebugInfoFlagIndirectVariable) | + uint32_t(DebugInfoFlagIsOptimized)), + CASE_IIILLIIFIIII(TypeEnum, 17, 18, "FlagStaticMember", + uint32_t(DebugInfoFlagStaticMember)), + CASE_IIILLIIFIIIIII(TypeEnum, 99, 1, "FlagStaticMember", + uint32_t(DebugInfoFlagStaticMember)), + })), ); + +INSTANTIATE_TEST_CASE_P( + DebugInfoDebugTypeComposite, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_IEILLIIF( + TypeComposite, Class, 12, 13, + "FlagIsPrivate|FlagFwdDecl|FlagIndirectVariable|FlagIsOptimized", + uint32_t(DebugInfoFlagIsPrivate) | uint32_t(DebugInfoFlagFwdDecl) | + uint32_t(DebugInfoFlagIndirectVariable) | + uint32_t(DebugInfoFlagIsOptimized)), + // Cover all tag values: Class, Structure, Union + CASE_IEILLIIF(TypeComposite, Class, 12, 13, "FlagIsPrivate", + uint32_t(DebugInfoFlagIsPrivate)), + CASE_IEILLIIF(TypeComposite, Structure, 12, 13, "FlagIsPrivate", + uint32_t(DebugInfoFlagIsPrivate)), + CASE_IEILLIIF(TypeComposite, Union, 12, 13, "FlagIsPrivate", + uint32_t(DebugInfoFlagIsPrivate)), + // Now add members + CASE_IEILLIIFI(TypeComposite, Class, 9, 10, "FlagIsPrivate", + uint32_t(DebugInfoFlagIsPrivate)), + CASE_IEILLIIFII(TypeComposite, Class, 9, 10, "FlagIsPrivate", + uint32_t(DebugInfoFlagIsPrivate)), + CASE_IEILLIIFIII(TypeComposite, Class, 9, 10, "FlagIsPrivate", + uint32_t(DebugInfoFlagIsPrivate)), + CASE_IEILLIIFIIII(TypeComposite, Class, 9, 10, "FlagIsPrivate", + uint32_t(DebugInfoFlagIsPrivate)), + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeMember, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_IIILLIIIF(TypeMember, 12, 13, "FlagIsPrivate", + uint32_t(DebugInfoFlagIsPrivate)), + CASE_IIILLIIIF(TypeMember, 99, 100, + "FlagIsPrivate|FlagFwdDecl", + uint32_t(DebugInfoFlagIsPrivate) | + uint32_t(DebugInfoFlagFwdDecl)), + // Add the optional Id argument. + CASE_IIILLIIIFI(TypeMember, 12, 13, "FlagIsPrivate", + uint32_t(DebugInfoFlagIsPrivate)), + })), ); + +INSTANTIATE_TEST_CASE_P( + DebugInfoDebugTypeInheritance, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_IIIIF(TypeInheritance, "FlagIsPrivate", + uint32_t(DebugInfoFlagIsPrivate)), + CASE_IIIIF(TypeInheritance, "FlagIsPrivate|FlagFwdDecl", + uint32_t(DebugInfoFlagIsPrivate) | + uint32_t(DebugInfoFlagFwdDecl)), + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypePtrToMember, + ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_II(TypePtrToMember), + })), ); + +// DebugInfo 4.4 Templates + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeTemplate, + ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_II(TypeTemplate), + CASE_III(TypeTemplate), + CASE_IIII(TypeTemplate), + CASE_IIIII(TypeTemplate), + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeTemplateParameter, + ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_IIIILL(TypeTemplateParameter, 1, 2), + CASE_IIIILL(TypeTemplateParameter, 99, 102), + CASE_IIIILL(TypeTemplateParameter, 10, 7), + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeTemplateTemplateParameter, + ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_IIILL(TypeTemplateTemplateParameter, 1, 2), + CASE_IIILL(TypeTemplateTemplateParameter, 99, 102), + CASE_IIILL(TypeTemplateTemplateParameter, 10, 7), + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeTemplateParameterPack, + ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_IILLI(TypeTemplateParameterPack, 1, 2), + CASE_IILLII(TypeTemplateParameterPack, 99, 102), + CASE_IILLIII(TypeTemplateParameterPack, 10, 7), + CASE_IILLIIII(TypeTemplateParameterPack, 10, 7), + })), ); + +// DebugInfo 4.5 Global Variables + +INSTANTIATE_TEST_CASE_P( + DebugInfoDebugGlobalVariable, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_IIILLIIIF(GlobalVariable, 1, 2, "FlagIsOptimized", + uint32_t(DebugInfoFlagIsOptimized)), + CASE_IIILLIIIF(GlobalVariable, 42, 43, "FlagIsOptimized", + uint32_t(DebugInfoFlagIsOptimized)), + CASE_IIILLIIIFI(GlobalVariable, 1, 2, "FlagIsOptimized", + uint32_t(DebugInfoFlagIsOptimized)), + CASE_IIILLIIIFI(GlobalVariable, 42, 43, "FlagIsOptimized", + uint32_t(DebugInfoFlagIsOptimized)), + })), ); + +// DebugInfo 4.6 Functions + +INSTANTIATE_TEST_CASE_P( + DebugInfoDebugFunctionDeclaration, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_IIILLIIF(FunctionDeclaration, 1, 2, "FlagIsOptimized", + uint32_t(DebugInfoFlagIsOptimized)), + CASE_IIILLIIF(FunctionDeclaration, 42, 43, "FlagFwdDecl", + uint32_t(DebugInfoFlagFwdDecl)), + })), ); + +INSTANTIATE_TEST_CASE_P( + DebugInfoDebugFunction, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_IIILLIIFLI(Function, 1, 2, "FlagIsOptimized", + uint32_t(DebugInfoFlagIsOptimized), 3), + CASE_IIILLIIFLI(Function, 42, 43, "FlagFwdDecl", + uint32_t(DebugInfoFlagFwdDecl), 44), + // Add the optional declaration Id. + CASE_IIILLIIFLII(Function, 1, 2, "FlagIsOptimized", + uint32_t(DebugInfoFlagIsOptimized), 3), + CASE_IIILLIIFLII(Function, 42, 43, "FlagFwdDecl", + uint32_t(DebugInfoFlagFwdDecl), 44), + })), ); + +// DebugInfo 4.7 Local Information + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugLexicalBlock, + ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_ILLII(LexicalBlock, 1, 2), + CASE_ILLII(LexicalBlock, 42, 43), + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugLexicalBlockDiscriminator, + ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_ILI(LexicalBlockDiscriminator, 1), + CASE_ILI(LexicalBlockDiscriminator, 42), + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugScope, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_I(Scope), + CASE_II(Scope), + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugNoScope, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_0(NoScope), + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugInlinedAt, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_LII(InlinedAt, 1), + CASE_LII(InlinedAt, 42), + })), ); + +// DebugInfo 4.8 Local Variables + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugLocalVariable, + ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_IIILLI(LocalVariable, 1, 2), + CASE_IIILLI(LocalVariable, 42, 43), + CASE_IIILLIL(LocalVariable, 1, 2, 3), + CASE_IIILLIL(LocalVariable, 42, 43, 44), + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugInlinedVariable, + ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_II(InlinedVariable), + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugDebugDeclare, + ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_III(Declare), + })), ); + +INSTANTIATE_TEST_CASE_P( + DebugInfoDebugDebugValue, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_III(Value), + CASE_IIII(Value), + CASE_IIIII(Value), + CASE_IIIIII(Value), + // Test up to 4 id parameters. We can always try more. + CASE_IIIIIII(Value), + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugDebugOperation, + ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_E(Operation, Deref), + CASE_E(Operation, Plus), + CASE_E(Operation, Minus), + CASE_EL(Operation, PlusUconst, 1), + CASE_EL(Operation, PlusUconst, 42), + CASE_ELL(Operation, BitPiece, 1, 2), + CASE_ELL(Operation, BitPiece, 4, 5), + CASE_E(Operation, Swap), + CASE_E(Operation, Xderef), + CASE_E(Operation, StackValue), + CASE_EL(Operation, Constu, 1), + CASE_EL(Operation, Constu, 42), + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugDebugExpression, + ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_0(Expression), + CASE_I(Expression), + CASE_II(Expression), + CASE_III(Expression), + CASE_IIII(Expression), + CASE_IIIII(Expression), + CASE_IIIIII(Expression), + CASE_IIIIIII(Expression), + })), ); + +// DebugInfo 4.9 Macros + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugMacroDef, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_ILI(MacroDef, 1), + CASE_ILI(MacroDef, 42), + CASE_ILII(MacroDef, 1), + CASE_ILII(MacroDef, 42), + })), ); + +INSTANTIATE_TEST_CASE_P(DebugInfoDebugMacroUndef, ExtInstDebugInfoRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE_ILI(MacroUndef, 1), + CASE_ILI(MacroUndef, 42), + })), ); + +#undef CASE_0 +#undef CASE_ILL +#undef CASE_IL +#undef CASE_I +#undef CASE_II +#undef CASE_III +#undef CASE_IIII +#undef CASE_IIIII +#undef CASE_IIIIII +#undef CASE_IIIIIII +#undef CASE_IIILLI +#undef CASE_IIILLIL +#undef CASE_IE +#undef CASE_IIE +#undef CASE_ISF +#undef CASE_LII +#undef CASE_ILI +#undef CASE_ILII +#undef CASE_ILLII +#undef CASE_IIILLIIF +#undef CASE_IIILLIIFII +#undef CASE_IIILLIIFIIII +#undef CASE_IIILLIIFIIIIII +#undef CASE_IEILLIIF +#undef CASE_IEILLIIFI +#undef CASE_IEILLIIFII +#undef CASE_IEILLIIFIII +#undef CASE_IEILLIIFIIII +#undef CASE_IIILLIIIF +#undef CASE_IIILLIIIFI +#undef CASE_IIIIF +#undef CASE_IIILL +#undef CASE_IIIILL +#undef CASE_IILLI +#undef CASE_IILLII +#undef CASE_IILLIII +#undef CASE_IILLIIII +#undef CASE_IIILLIIFLI +#undef CASE_IIILLIIFLII +#undef CASE_E +#undef CASE_EL +#undef CASE_ELL + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/ext_inst.glsl_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/ext_inst.glsl_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/ext_inst.glsl_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/ext_inst.glsl_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,200 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include + +#include "latest_version_glsl_std_450_header.h" +#include "unit_spirv.h" + +namespace { + +/// Context for an extended instruction. +/// +/// Information about a GLSL extended instruction (including its opname, return +/// type, etc.) and related instructions used to generate the return type and +/// constant as the operands. Used in generating extended instruction tests. +struct ExtInstContext { + const char* extInstOpName; + const char* extInstOperandVars; + /// The following fields are used to check the SPIR-V binary representation + /// of this instruction. + uint32_t extInstOpcode; ///< Opcode value for this extended instruction. + uint32_t extInstLength; ///< Wordcount of this extended instruction. + std::vector extInstOperandIds; ///< Ids for operands. +}; + +using ExtInstGLSLstd450RoundTripTest = ::testing::TestWithParam; + +TEST_P(ExtInstGLSLstd450RoundTripTest, ParameterizedExtInst) { + spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_0); + const std::string spirv = R"( +OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical Simple +OpEntryPoint Vertex %2 "main" +%3 = OpTypeVoid +%4 = OpTypeFunction %3 +%2 = OpFunction %3 None %5 +%6 = OpLabel +%8 = OpExtInst %7 %1 )" + std::string(GetParam().extInstOpName) + + " " + GetParam().extInstOperandVars + R"( +OpReturn +OpFunctionEnd +)"; + const std::string spirv_header = + R"(; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 9 +; Schema: 0)"; + spv_binary binary; + spv_diagnostic diagnostic; + spv_result_t error = spvTextToBinary(context, spirv.c_str(), spirv.size(), + &binary, &diagnostic); + if (error) { + spvDiagnosticPrint(diagnostic); + spvDiagnosticDestroy(diagnostic); + ASSERT_EQ(SPV_SUCCESS, error) + << "Source was: " << std::endl + << spirv << std::endl + << "Test case for : " << GetParam().extInstOpName << std::endl; + } + + // Check we do have the extended instruction's corresponding binary code in + // the generated SPIR-V binary. + std::vector expected_contains( + {12 /*OpExtInst*/ | GetParam().extInstLength << 16, 7 /*return type*/, + 8 /*result id*/, 1 /*glsl450 import*/, GetParam().extInstOpcode}); + for (uint32_t operand : GetParam().extInstOperandIds) { + expected_contains.push_back(operand); + } + EXPECT_NE(binary->code + binary->wordCount, + std::search(binary->code, binary->code + binary->wordCount, + expected_contains.begin(), expected_contains.end())) + << "Cannot find\n" + << spvtest::WordVector(expected_contains).str() << "in\n" + << spvtest::WordVector(*binary).str(); + + // Check round trip gives the same text. + spv_text output_text = nullptr; + error = spvBinaryToText(context, binary->code, binary->wordCount, + SPV_BINARY_TO_TEXT_OPTION_NONE, &output_text, + &diagnostic); + + if (error) { + spvDiagnosticPrint(diagnostic); + spvDiagnosticDestroy(diagnostic); + ASSERT_EQ(SPV_SUCCESS, error); + } + EXPECT_EQ(spirv_header + spirv, output_text->str); + spvTextDestroy(output_text); + spvContextDestroy(context); +} + +INSTANTIATE_TEST_CASE_P( + ExtInstParameters, ExtInstGLSLstd450RoundTripTest, + ::testing::ValuesIn(std::vector({ + // We are only testing the correctness of encoding and decoding here. + // Semantic correctness should be the responsibility of validator. So + // some of the instructions below have incorrect operand and/or return + // types, e.g, Modf, ModfStruct, etc. + {"Round", "%5", 1, 6, {5}}, + {"RoundEven", "%5", 2, 6, {5}}, + {"Trunc", "%5", 3, 6, {5}}, + {"FAbs", "%5", 4, 6, {5}}, + {"SAbs", "%5", 5, 6, {5}}, + {"FSign", "%5", 6, 6, {5}}, + {"SSign", "%5", 7, 6, {5}}, + {"Floor", "%5", 8, 6, {5}}, + {"Ceil", "%5", 9, 6, {5}}, + {"Fract", "%5", 10, 6, {5}}, + {"Radians", "%5", 11, 6, {5}}, + {"Degrees", "%5", 12, 6, {5}}, + {"Sin", "%5", 13, 6, {5}}, + {"Cos", "%5", 14, 6, {5}}, + {"Tan", "%5", 15, 6, {5}}, + {"Asin", "%5", 16, 6, {5}}, + {"Acos", "%5", 17, 6, {5}}, + {"Atan", "%5", 18, 6, {5}}, + {"Sinh", "%5", 19, 6, {5}}, + {"Cosh", "%5", 20, 6, {5}}, + {"Tanh", "%5", 21, 6, {5}}, + {"Asinh", "%5", 22, 6, {5}}, + {"Acosh", "%5", 23, 6, {5}}, + {"Atanh", "%5", 24, 6, {5}}, + {"Atan2", "%5 %5", 25, 7, {5, 5}}, + {"Pow", "%5 %5", 26, 7, {5, 5}}, + {"Exp", "%5", 27, 6, {5}}, + {"Log", "%5", 28, 6, {5}}, + {"Exp2", "%5", 29, 6, {5}}, + {"Log2", "%5", 30, 6, {5}}, + {"Sqrt", "%5", 31, 6, {5}}, + {"InverseSqrt", "%5", 32, 6, {5}}, + {"Determinant", "%5", 33, 6, {5}}, + {"MatrixInverse", "%5", 34, 6, {5}}, + {"Modf", "%5 %5", 35, 7, {5, 5}}, + {"ModfStruct", "%5", 36, 6, {5}}, + {"FMin", "%5 %5", 37, 7, {5, 5}}, + {"UMin", "%5 %5", 38, 7, {5, 5}}, + {"SMin", "%5 %5", 39, 7, {5, 5}}, + {"FMax", "%5 %5", 40, 7, {5, 5}}, + {"UMax", "%5 %5", 41, 7, {5, 5}}, + {"SMax", "%5 %5", 42, 7, {5, 5}}, + {"FClamp", "%5 %5 %5", 43, 8, {5, 5, 5}}, + {"UClamp", "%5 %5 %5", 44, 8, {5, 5, 5}}, + {"SClamp", "%5 %5 %5", 45, 8, {5, 5, 5}}, + {"FMix", "%5 %5 %5", 46, 8, {5, 5, 5}}, + {"IMix", "%5 %5 %5", 47, 8, {5, 5, 5}}, // Bug 15452. Reserved. + {"Step", "%5 %5", 48, 7, {5, 5}}, + {"SmoothStep", "%5 %5 %5", 49, 8, {5, 5, 5}}, + {"Fma", "%5 %5 %5", 50, 8, {5, 5, 5}}, + {"Frexp", "%5 %5", 51, 7, {5, 5}}, + {"FrexpStruct", "%5", 52, 6, {5}}, + {"Ldexp", "%5 %5", 53, 7, {5, 5}}, + {"PackSnorm4x8", "%5", 54, 6, {5}}, + {"PackUnorm4x8", "%5", 55, 6, {5}}, + {"PackSnorm2x16", "%5", 56, 6, {5}}, + {"PackUnorm2x16", "%5", 57, 6, {5}}, + {"PackHalf2x16", "%5", 58, 6, {5}}, + {"PackDouble2x32", "%5", 59, 6, {5}}, + {"UnpackSnorm2x16", "%5", 60, 6, {5}}, + {"UnpackUnorm2x16", "%5", 61, 6, {5}}, + {"UnpackHalf2x16", "%5", 62, 6, {5}}, + {"UnpackSnorm4x8", "%5", 63, 6, {5}}, + {"UnpackUnorm4x8", "%5", 64, 6, {5}}, + {"UnpackDouble2x32", "%5", 65, 6, {5}}, + {"Length", "%5", 66, 6, {5}}, + {"Distance", "%5 %5", 67, 7, {5, 5}}, + {"Cross", "%5 %5", 68, 7, {5, 5}}, + {"Normalize", "%5", 69, 6, {5}}, + // clang-format off + {"FaceForward", "%5 %5 %5", 70, 8, {5, 5, 5}}, + // clang-format on + {"Reflect", "%5 %5", 71, 7, {5, 5}}, + {"Refract", "%5 %5 %5", 72, 8, {5, 5, 5}}, + {"FindILsb", "%5", 73, 6, {5}}, + {"FindSMsb", "%5", 74, 6, {5}}, + {"FindUMsb", "%5", 75, 6, {5}}, + {"InterpolateAtCentroid", "%5", 76, 6, {5}}, + // clang-format off + {"InterpolateAtSample", "%5 %5", 77, 7, {5, 5}}, + {"InterpolateAtOffset", "%5 %5", 78, 7, {5, 5}}, + // clang-format on + {"NMin", "%5 %5", 79, 7, {5, 5}}, + {"NMax", "%5 %5", 80, 7, {5, 5}}, + {"NClamp", "%5 %5 %5", 81, 8, {5, 5, 5}}, + })), ); + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/ext_inst.opencl_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/ext_inst.opencl_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/ext_inst.opencl_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/ext_inst.opencl_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,369 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +#include +#include "latest_version_opencl_std_header.h" +#include "test_fixture.h" + +namespace { + +using spvtest::Concatenate; +using spvtest::MakeInstruction; +using spvtest::MakeVector; +using spvtest::TextToBinaryTest; +using testing::Eq; + +struct InstructionCase { + uint32_t opcode; + std::string name; + std::string operands; + std::vector expected_operands; +}; + +using ExtInstOpenCLStdRoundTripTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(ExtInstOpenCLStdRoundTripTest, ParameterizedExtInst) { + // This example should not validate. + const std::string input = + "%1 = OpExtInstImport \"OpenCL.std\"\n" + "%3 = OpExtInst %2 %1 " + + GetParam().name + " " + GetParam().operands + "\n"; + // First make sure it assembles correctly. + EXPECT_THAT( + CompiledInstructions(input), + Eq(Concatenate( + {MakeInstruction(SpvOpExtInstImport, {1}, MakeVector("OpenCL.std")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, GetParam().opcode}, + GetParam().expected_operands)}))) + << input; + // Now check the round trip through the disassembler. + EXPECT_THAT(EncodeAndDecodeSuccessfully(input), input) << input; +} + +#define CASE1(Enum, Name) \ + { \ + uint32_t(OpenCLLIB::Entrypoints::Enum), #Name, "%4", { 4 } \ + } +#define CASE2(Enum, Name) \ + { \ + uint32_t(OpenCLLIB::Entrypoints::Enum), #Name, "%4 %5", { 4, 5 } \ + } +#define CASE3(Enum, Name) \ + { \ + uint32_t(OpenCLLIB::Entrypoints::Enum), #Name, "%4 %5 %6", { 4, 5, 6 } \ + } +#define CASE4(Enum, Name) \ + { \ + uint32_t(OpenCLLIB::Entrypoints::Enum), #Name, "%4 %5 %6 %7", { \ + 4, 5, 6, 7 \ + } \ + } +#define CASE2Lit(Enum, Name, LiteralNumber) \ + { \ + uint32_t(OpenCLLIB::Entrypoints::Enum), #Name, "%4 %5 " #LiteralNumber, { \ + 4, 5, LiteralNumber \ + } \ + } +#define CASE3Round(Enum, Name, Mode) \ + { \ + uint32_t(OpenCLLIB::Entrypoints::Enum), #Name, "%4 %5 %6 " #Mode, { \ + 4, 5, 6, uint32_t(SpvFPRoundingMode##Mode) \ + } \ + } + +// clang-format off +// OpenCL.std: 2.1 Math extended instructions +INSTANTIATE_TEST_CASE_P( + OpenCLMath, ExtInstOpenCLStdRoundTripTest, + ::testing::ValuesIn(std::vector({ + // We are only testing the correctness of encoding and decoding here. + // Semantic correctness should be the responsibility of validator. + CASE1(Acos, acos), // enum value 0 + CASE1(Acosh, acosh), + CASE1(Acospi, acospi), + CASE1(Asin, asin), + CASE1(Asinh, asinh), + CASE1(Asinh, asinh), + CASE1(Asinpi, asinpi), + CASE1(Atan, atan), + CASE2(Atan2, atan2), + CASE1(Atanh, atanh), + CASE1(Atanpi, atanpi), + CASE2(Atan2pi, atan2pi), + CASE1(Cbrt, cbrt), + CASE1(Ceil, ceil), + CASE1(Ceil, ceil), + CASE2(Copysign, copysign), + CASE1(Cos, cos), + CASE1(Cosh, cosh), + CASE1(Cospi, cospi), + CASE1(Erfc, erfc), + CASE1(Erf, erf), + CASE1(Exp, exp), + CASE1(Exp2, exp2), + CASE1(Exp10, exp10), + CASE1(Expm1, expm1), + CASE1(Fabs, fabs), + CASE2(Fdim, fdim), + CASE1(Floor, floor), + CASE3(Fma, fma), + CASE2(Fmax, fmax), + CASE2(Fmin, fmin), + CASE2(Fmod, fmod), + CASE2(Fract, fract), + CASE2(Frexp, frexp), + CASE2(Hypot, hypot), + CASE1(Ilogb, ilogb), + CASE2(Ldexp, ldexp), + CASE1(Lgamma, lgamma), + CASE2(Lgamma_r, lgamma_r), + CASE1(Log, log), + CASE1(Log2, log2), + CASE1(Log10, log10), + CASE1(Log1p, log1p), + CASE3(Mad, mad), + CASE2(Maxmag, maxmag), + CASE2(Minmag, minmag), + CASE2(Modf, modf), + CASE1(Nan, nan), + CASE2(Nextafter, nextafter), + CASE2(Pow, pow), + CASE2(Pown, pown), + CASE2(Powr, powr), + CASE2(Remainder, remainder), + CASE3(Remquo, remquo), + CASE1(Rint, rint), + CASE2(Rootn, rootn), + CASE1(Round, round), + CASE1(Rsqrt, rsqrt), + CASE1(Sin, sin), + CASE2(Sincos, sincos), + CASE1(Sinh, sinh), + CASE1(Sinpi, sinpi), + CASE1(Sqrt, sqrt), + CASE1(Tan, tan), + CASE1(Tanh, tanh), + CASE1(Tanpi, tanpi), + CASE1(Tgamma, tgamma), + CASE1(Trunc, trunc), + CASE1(Half_cos, half_cos), + CASE2(Half_divide, half_divide), + CASE1(Half_exp, half_exp), + CASE1(Half_exp2, half_exp2), + CASE1(Half_exp10, half_exp10), + CASE1(Half_log, half_log), + CASE1(Half_log2, half_log2), + CASE1(Half_log10, half_log10), + CASE2(Half_powr, half_powr), + CASE1(Half_recip, half_recip), + CASE1(Half_rsqrt, half_rsqrt), + CASE1(Half_sin, half_sin), + CASE1(Half_sqrt, half_sqrt), + CASE1(Half_tan, half_tan), + CASE1(Native_cos, native_cos), + CASE2(Native_divide, native_divide), + CASE1(Native_exp, native_exp), + CASE1(Native_exp2, native_exp2), + CASE1(Native_exp10, native_exp10), + CASE1(Native_log, native_log), + CASE1(Native_log10, native_log10), + CASE2(Native_powr, native_powr), + CASE1(Native_recip, native_recip), + CASE1(Native_rsqrt, native_rsqrt), + CASE1(Native_sin, native_sin), + CASE1(Native_sqrt, native_sqrt), + CASE1(Native_tan, native_tan), // enum value 94 + })),); + +// OpenCL.std: 2.1 Integer instructions +INSTANTIATE_TEST_CASE_P( + OpenCLInteger, ExtInstOpenCLStdRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE1(SAbs, s_abs), // enum value 141 + CASE2(SAbs_diff, s_abs_diff), + CASE2(SAdd_sat, s_add_sat), + CASE2(UAdd_sat, u_add_sat), + CASE2(SHadd, s_hadd), + CASE2(UHadd, u_hadd), + CASE2(SRhadd, s_rhadd), + CASE2(SRhadd, s_rhadd), + CASE3(SClamp, s_clamp), + CASE3(UClamp, u_clamp), + CASE1(Clz, clz), + CASE1(Ctz, ctz), + CASE3(SMad_hi, s_mad_hi), + CASE3(UMad_sat, u_mad_sat), + CASE3(SMad_sat, s_mad_sat), + CASE2(SMax, s_max), + CASE2(UMax, u_max), + CASE2(SMin, s_min), + CASE2(UMin, u_min), + CASE2(SMul_hi, s_mul_hi), + CASE2(Rotate, rotate), + CASE2(SSub_sat, s_sub_sat), + CASE2(USub_sat, u_sub_sat), + CASE2(U_Upsample, u_upsample), + CASE2(S_Upsample, s_upsample), + CASE1(Popcount, popcount), + CASE3(SMad24, s_mad24), + CASE3(UMad24, u_mad24), + CASE2(SMul24, s_mul24), + CASE2(UMul24, u_mul24), // enum value 170 + CASE1(UAbs, u_abs), // enum value 201 + CASE2(UAbs_diff, u_abs_diff), + CASE2(UMul_hi, u_mul_hi), + CASE3(UMad_hi, u_mad_hi), // enum value 204 + })),); + +// OpenCL.std: 2.3 Common instrucitons +INSTANTIATE_TEST_CASE_P( + OpenCLCommon, ExtInstOpenCLStdRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE3(FClamp, fclamp), // enum value 95 + CASE1(Degrees, degrees), + CASE2(FMax_common, fmax_common), + CASE2(FMin_common, fmin_common), + CASE3(Mix, mix), + CASE1(Radians, radians), + CASE2(Step, step), + CASE3(Smoothstep, smoothstep), + CASE1(Sign, sign), // enum value 103 + })),); + +// OpenCL.std: 2.4 Geometric instructions +INSTANTIATE_TEST_CASE_P( + OpenCLGeometric, ExtInstOpenCLStdRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE2(Cross, cross), // enum value 104 + CASE2(Distance, distance), + CASE1(Length, length), + CASE1(Normalize, normalize), + CASE2(Fast_distance, fast_distance), + CASE1(Fast_length, fast_length), + CASE1(Fast_normalize, fast_normalize), // enum value 110 + })),); + +// OpenCL.std: 2.5 Relational instructions +INSTANTIATE_TEST_CASE_P( + OpenCLRelational, ExtInstOpenCLStdRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE3(Bitselect, bitselect), // enum value 186 + CASE3(Select, select), // enum value 187 + })),); + +// OpenCL.std: 2.6 Vector data load and store instructions +INSTANTIATE_TEST_CASE_P( + OpenCLVectorLoadStore, ExtInstOpenCLStdRoundTripTest, + ::testing::ValuesIn(std::vector({ + // The last argument to Vloadn must be one of 2, 3, 4, 8, 16. + CASE2Lit(Vloadn, vloadn, 2), + CASE2Lit(Vloadn, vloadn, 3), + CASE2Lit(Vloadn, vloadn, 4), + CASE2Lit(Vloadn, vloadn, 8), + CASE2Lit(Vloadn, vloadn, 16), + CASE3(Vstoren, vstoren), + CASE2(Vload_half, vload_half), + CASE2Lit(Vload_halfn, vload_halfn, 2), + CASE2Lit(Vload_halfn, vload_halfn, 3), + CASE2Lit(Vload_halfn, vload_halfn, 4), + CASE2Lit(Vload_halfn, vload_halfn, 8), + CASE2Lit(Vload_halfn, vload_halfn, 16), + CASE3(Vstore_half, vstore_half), + // Try all the rounding modes. + CASE3Round(Vstore_half_r, vstore_half_r, RTE), + CASE3Round(Vstore_half_r, vstore_half_r, RTZ), + CASE3Round(Vstore_half_r, vstore_half_r, RTP), + CASE3Round(Vstore_half_r, vstore_half_r, RTN), + CASE3(Vstore_halfn, vstore_halfn), + CASE3Round(Vstore_halfn_r, vstore_halfn_r, RTE), + CASE3Round(Vstore_halfn_r, vstore_halfn_r, RTZ), + CASE3Round(Vstore_halfn_r, vstore_halfn_r, RTP), + CASE3Round(Vstore_halfn_r, vstore_halfn_r, RTN), + CASE2Lit(Vloada_halfn, vloada_halfn, 2), + CASE2Lit(Vloada_halfn, vloada_halfn, 3), + CASE2Lit(Vloada_halfn, vloada_halfn, 4), + CASE2Lit(Vloada_halfn, vloada_halfn, 8), + CASE2Lit(Vloada_halfn, vloada_halfn, 16), + CASE3(Vstorea_halfn, vstorea_halfn), + CASE3Round(Vstorea_halfn_r, vstorea_halfn_r, RTE), + CASE3Round(Vstorea_halfn_r, vstorea_halfn_r, RTZ), + CASE3Round(Vstorea_halfn_r, vstorea_halfn_r, RTP), + CASE3Round(Vstorea_halfn_r, vstorea_halfn_r, RTN), + })),); + +// OpenCL.std: 2.7 Miscellaneous vector instructions +INSTANTIATE_TEST_CASE_P( + OpenCLMiscellaneousVector, ExtInstOpenCLStdRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE2(Shuffle, shuffle), + CASE3(Shuffle2, shuffle2), + })),); + +// OpenCL.std: 2.8 Miscellaneous instructions + +#define PREFIX uint32_t(OpenCLLIB::Entrypoints::Printf), "printf" +INSTANTIATE_TEST_CASE_P( + OpenCLMiscPrintf, ExtInstOpenCLStdRoundTripTest, + ::testing::ValuesIn(std::vector({ + // Printf is interesting because it takes a variable number of arguments. + // Start with zero optional arguments. + {PREFIX, "%4", {4}}, + {PREFIX, "%4 %5", {4, 5}}, + {PREFIX, "%4 %5 %6", {4, 5, 6}}, + {PREFIX, "%4 %5 %6 %7", {4, 5, 6, 7}}, + {PREFIX, "%4 %5 %6 %7 %8", {4, 5, 6, 7, 8}}, + {PREFIX, "%4 %5 %6 %7 %8 %9", {4, 5, 6, 7, 8, 9}}, + {PREFIX, "%4 %5 %6 %7 %8 %9 %10", {4, 5, 6, 7, 8, 9, 10}}, + {PREFIX, "%4 %5 %6 %7 %8 %9 %10 %11", {4, 5, 6, 7, 8, 9, 10, 11}}, + {PREFIX, "%4 %5 %6 %7 %8 %9 %10 %11 %12", + {4, 5, 6, 7, 8, 9, 10, 11, 12}}, + {PREFIX, "%4 %5 %6 %7 %8 %9 %10 %11 %12 %13", + {4, 5, 6, 7, 8, 9, 10, 11, 12, 13}}, + {PREFIX, "%4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14", + {4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}}, + })),); +#undef PREFIX + +INSTANTIATE_TEST_CASE_P( + OpenCLMiscPrefetch, ExtInstOpenCLStdRoundTripTest, + ::testing::ValuesIn(std::vector({ + CASE2(Prefetch, prefetch), + })),); + +// OpenCL.std: 2.9.1 Image encoding +// No new instructions defined in this section. + +// OpenCL.std: 2.9.2 Sampler encoding +// No new instructions defined in this section. + +// OpenCL.std: 2.9.3 Image read +// No new instructions defined in this section. +// Use core instruction OpImageSampleExplicitLod instead. + +// OpenCL.std: 2.9.4 Image write +// No new instructions defined in this section. + +// clang-format on + +#undef CASE1 +#undef CASE2 +#undef CASE3 +#undef CASE4 +#undef CASE2Lit +#undef CASE3Round + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/fix_word_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/fix_word_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/fix_word_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/fix_word_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +namespace { + +TEST(FixWord, Default) { + spv_endianness_t endian; + if (I32_ENDIAN_HOST == I32_ENDIAN_LITTLE) { + endian = SPV_ENDIANNESS_LITTLE; + } else { + endian = SPV_ENDIANNESS_BIG; + } + uint32_t word = 0x53780921; + ASSERT_EQ(word, spvFixWord(word, endian)); +} + +TEST(FixWord, Reorder) { + spv_endianness_t endian; + if (I32_ENDIAN_HOST == I32_ENDIAN_LITTLE) { + endian = SPV_ENDIANNESS_BIG; + } else { + endian = SPV_ENDIANNESS_LITTLE; + } + uint32_t word = 0x53780921; + uint32_t result = 0x21097853; + ASSERT_EQ(result, spvFixWord(word, endian)); +} + +TEST(FixDoubleWord, Default) { + spv_endianness_t endian = + (I32_ENDIAN_HOST == I32_ENDIAN_LITTLE ? SPV_ENDIANNESS_LITTLE + : SPV_ENDIANNESS_BIG); + uint32_t low = 0x53780921; + uint32_t high = 0xdeadbeef; + uint64_t result = 0xdeadbeef53780921; + ASSERT_EQ(result, spvFixDoubleWord(low, high, endian)); +} + +TEST(FixDoubleWord, Reorder) { + spv_endianness_t endian = + (I32_ENDIAN_HOST == I32_ENDIAN_LITTLE ? SPV_ENDIANNESS_BIG + : SPV_ENDIANNESS_LITTLE); + uint32_t low = 0x53780921; + uint32_t high = 0xdeadbeef; + uint64_t result = 0xefbeadde21097853; + ASSERT_EQ(result, spvFixDoubleWord(low, high, endian)); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/generator_magic_number_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/generator_magic_number_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/generator_magic_number_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/generator_magic_number_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,57 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +#include + +#include "source/opcode.h" + +using ::spvtest::EnumCase; +using ::testing::Eq; + +namespace { + +using GeneratorMagicNumberTest = + ::testing::TestWithParam>; + +TEST_P(GeneratorMagicNumberTest, Single) { + EXPECT_THAT(std::string(spvGeneratorStr(GetParam().value())), + GetParam().name()); +} + +INSTANTIATE_TEST_CASE_P( + Registered, GeneratorMagicNumberTest, + ::testing::ValuesIn(std::vector>{ + {SPV_GENERATOR_KHRONOS, "Khronos"}, + {SPV_GENERATOR_LUNARG, "LunarG"}, + {SPV_GENERATOR_VALVE, "Valve"}, + {SPV_GENERATOR_CODEPLAY, "Codeplay"}, + {SPV_GENERATOR_NVIDIA, "NVIDIA"}, + {SPV_GENERATOR_ARM, "ARM"}, + {SPV_GENERATOR_KHRONOS_LLVM_TRANSLATOR, + "Khronos LLVM/SPIR-V Translator"}, + {SPV_GENERATOR_KHRONOS_ASSEMBLER, "Khronos SPIR-V Tools Assembler"}, + {SPV_GENERATOR_KHRONOS_GLSLANG, "Khronos Glslang Reference Front End"}, + }), ); + +INSTANTIATE_TEST_CASE_P( + Unregistered, GeneratorMagicNumberTest, + ::testing::ValuesIn(std::vector>{ + // We read registered entries from the SPIR-V XML Registry file + // which can change over time. + {spv_generator_t(1000), "Unknown"}, + {spv_generator_t(9999), "Unknown"}, + }), ); +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/hex_float_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/hex_float_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/hex_float_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/hex_float_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1329 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include +#include +#include +#include + +#include + +#include "source/util/hex_float.h" +#include "unit_spirv.h" + +namespace { +using spvutils::BitwiseCast; +using spvutils::Float16; +using spvutils::FloatProxy; +using spvutils::HexFloat; +using spvutils::ParseNormalFloat; +using ::testing::Eq; + +// In this file "encode" means converting a number into a string, +// and "decode" means converting a string into a number. + +using HexFloatTest = + ::testing::TestWithParam, std::string>>; +using DecodeHexFloatTest = + ::testing::TestWithParam>>; +using HexDoubleTest = + ::testing::TestWithParam, std::string>>; +using DecodeHexDoubleTest = + ::testing::TestWithParam>>; +using RoundTripFloatTest = ::testing::TestWithParam; +using RoundTripDoubleTest = ::testing::TestWithParam; + +// Hex-encodes a float value. +template +std::string EncodeViaHexFloat(const T& value) { + std::stringstream ss; + ss << spvutils::HexFloat(value); + return ss.str(); +} + +// The following two tests can't be DRY because they take different parameter +// types. + +TEST_P(HexFloatTest, EncodeCorrectly) { + EXPECT_THAT(EncodeViaHexFloat(GetParam().first), Eq(GetParam().second)); +} + +TEST_P(HexDoubleTest, EncodeCorrectly) { + EXPECT_THAT(EncodeViaHexFloat(GetParam().first), Eq(GetParam().second)); +} + +// Decodes a hex-float string. +template +FloatProxy Decode(const std::string& str) { + spvutils::HexFloat> decoded(0.f); + EXPECT_TRUE((std::stringstream(str) >> decoded).eof()); + return decoded.value(); +} + +TEST_P(HexFloatTest, DecodeCorrectly) { + EXPECT_THAT(Decode(GetParam().second), Eq(GetParam().first)); +} + +TEST_P(HexDoubleTest, DecodeCorrectly) { + EXPECT_THAT(Decode(GetParam().second), Eq(GetParam().first)); +} + +INSTANTIATE_TEST_CASE_P( + Float32Tests, HexFloatTest, + ::testing::ValuesIn(std::vector, std::string>>({ + {0.f, "0x0p+0"}, + {1.f, "0x1p+0"}, + {2.f, "0x1p+1"}, + {3.f, "0x1.8p+1"}, + {0.5f, "0x1p-1"}, + {0.25f, "0x1p-2"}, + {0.75f, "0x1.8p-1"}, + {-0.f, "-0x0p+0"}, + {-1.f, "-0x1p+0"}, + {-0.5f, "-0x1p-1"}, + {-0.25f, "-0x1p-2"}, + {-0.75f, "-0x1.8p-1"}, + + // Larger numbers + {512.f, "0x1p+9"}, + {-512.f, "-0x1p+9"}, + {1024.f, "0x1p+10"}, + {-1024.f, "-0x1p+10"}, + {1024.f + 8.f, "0x1.02p+10"}, + {-1024.f - 8.f, "-0x1.02p+10"}, + + // Small numbers + {1.0f / 512.f, "0x1p-9"}, + {1.0f / -512.f, "-0x1p-9"}, + {1.0f / 1024.f, "0x1p-10"}, + {1.0f / -1024.f, "-0x1p-10"}, + {1.0f / 1024.f + 1.0f / 8.f, "0x1.02p-3"}, + {1.0f / -1024.f - 1.0f / 8.f, "-0x1.02p-3"}, + + // lowest non-denorm + {float(ldexp(1.0f, -126)), "0x1p-126"}, + {float(ldexp(-1.0f, -126)), "-0x1p-126"}, + + // Denormalized values + {float(ldexp(1.0f, -127)), "0x1p-127"}, + {float(ldexp(1.0f, -127) / 2.0f), "0x1p-128"}, + {float(ldexp(1.0f, -127) / 4.0f), "0x1p-129"}, + {float(ldexp(1.0f, -127) / 8.0f), "0x1p-130"}, + {float(ldexp(-1.0f, -127)), "-0x1p-127"}, + {float(ldexp(-1.0f, -127) / 2.0f), "-0x1p-128"}, + {float(ldexp(-1.0f, -127) / 4.0f), "-0x1p-129"}, + {float(ldexp(-1.0f, -127) / 8.0f), "-0x1p-130"}, + + {float(ldexp(1.0, -127) + (ldexp(1.0, -127) / 2.0f)), "0x1.8p-127"}, + {float(ldexp(1.0, -127) / 2.0 + (ldexp(1.0, -127) / 4.0f)), + "0x1.8p-128"}, + + })), ); + +INSTANTIATE_TEST_CASE_P( + Float32NanTests, HexFloatTest, + ::testing::ValuesIn(std::vector, std::string>>({ + // Various NAN and INF cases + {uint32_t(0xFF800000), "-0x1p+128"}, // -inf + {uint32_t(0x7F800000), "0x1p+128"}, // inf + {uint32_t(0xFFC00000), "-0x1.8p+128"}, // -nan + {uint32_t(0xFF800100), "-0x1.0002p+128"}, // -nan + {uint32_t(0xFF800c00), "-0x1.0018p+128"}, // -nan + {uint32_t(0xFF80F000), "-0x1.01ep+128"}, // -nan + {uint32_t(0xFFFFFFFF), "-0x1.fffffep+128"}, // -nan + {uint32_t(0x7FC00000), "0x1.8p+128"}, // +nan + {uint32_t(0x7F800100), "0x1.0002p+128"}, // +nan + {uint32_t(0x7f800c00), "0x1.0018p+128"}, // +nan + {uint32_t(0x7F80F000), "0x1.01ep+128"}, // +nan + {uint32_t(0x7FFFFFFF), "0x1.fffffep+128"}, // +nan + })), ); + +INSTANTIATE_TEST_CASE_P( + Float64Tests, HexDoubleTest, + ::testing::ValuesIn( + std::vector, std::string>>({ + {0., "0x0p+0"}, + {1., "0x1p+0"}, + {2., "0x1p+1"}, + {3., "0x1.8p+1"}, + {0.5, "0x1p-1"}, + {0.25, "0x1p-2"}, + {0.75, "0x1.8p-1"}, + {-0., "-0x0p+0"}, + {-1., "-0x1p+0"}, + {-0.5, "-0x1p-1"}, + {-0.25, "-0x1p-2"}, + {-0.75, "-0x1.8p-1"}, + + // Larger numbers + {512., "0x1p+9"}, + {-512., "-0x1p+9"}, + {1024., "0x1p+10"}, + {-1024., "-0x1p+10"}, + {1024. + 8., "0x1.02p+10"}, + {-1024. - 8., "-0x1.02p+10"}, + + // Large outside the range of normal floats + {ldexp(1.0, 128), "0x1p+128"}, + {ldexp(1.0, 129), "0x1p+129"}, + {ldexp(-1.0, 128), "-0x1p+128"}, + {ldexp(-1.0, 129), "-0x1p+129"}, + {ldexp(1.0, 128) + ldexp(1.0, 90), "0x1.0000000004p+128"}, + {ldexp(1.0, 129) + ldexp(1.0, 120), "0x1.008p+129"}, + {ldexp(-1.0, 128) + ldexp(1.0, 90), "-0x1.fffffffff8p+127"}, + {ldexp(-1.0, 129) + ldexp(1.0, 120), "-0x1.ffp+128"}, + + // Small numbers + {1.0 / 512., "0x1p-9"}, + {1.0 / -512., "-0x1p-9"}, + {1.0 / 1024., "0x1p-10"}, + {1.0 / -1024., "-0x1p-10"}, + {1.0 / 1024. + 1.0 / 8., "0x1.02p-3"}, + {1.0 / -1024. - 1.0 / 8., "-0x1.02p-3"}, + + // Small outside the range of normal floats + {ldexp(1.0, -128), "0x1p-128"}, + {ldexp(1.0, -129), "0x1p-129"}, + {ldexp(-1.0, -128), "-0x1p-128"}, + {ldexp(-1.0, -129), "-0x1p-129"}, + {ldexp(1.0, -128) + ldexp(1.0, -90), "0x1.0000000004p-90"}, + {ldexp(1.0, -129) + ldexp(1.0, -120), "0x1.008p-120"}, + {ldexp(-1.0, -128) + ldexp(1.0, -90), "0x1.fffffffff8p-91"}, + {ldexp(-1.0, -129) + ldexp(1.0, -120), "0x1.ffp-121"}, + + // lowest non-denorm + {ldexp(1.0, -1022), "0x1p-1022"}, + {ldexp(-1.0, -1022), "-0x1p-1022"}, + + // Denormalized values + {ldexp(1.0, -1023), "0x1p-1023"}, + {ldexp(1.0, -1023) / 2.0, "0x1p-1024"}, + {ldexp(1.0, -1023) / 4.0, "0x1p-1025"}, + {ldexp(1.0, -1023) / 8.0, "0x1p-1026"}, + {ldexp(-1.0, -1024), "-0x1p-1024"}, + {ldexp(-1.0, -1024) / 2.0, "-0x1p-1025"}, + {ldexp(-1.0, -1024) / 4.0, "-0x1p-1026"}, + {ldexp(-1.0, -1024) / 8.0, "-0x1p-1027"}, + + {ldexp(1.0, -1023) + (ldexp(1.0, -1023) / 2.0), "0x1.8p-1023"}, + {ldexp(1.0, -1023) / 2.0 + (ldexp(1.0, -1023) / 4.0), + "0x1.8p-1024"}, + + })), ); + +INSTANTIATE_TEST_CASE_P( + Float64NanTests, HexDoubleTest, + ::testing::ValuesIn(std::vector< + std::pair, std::string>>({ + // Various NAN and INF cases + {uint64_t(0xFFF0000000000000LL), "-0x1p+1024"}, //-inf + {uint64_t(0x7FF0000000000000LL), "0x1p+1024"}, //+inf + {uint64_t(0xFFF8000000000000LL), "-0x1.8p+1024"}, // -nan + {uint64_t(0xFFF0F00000000000LL), "-0x1.0fp+1024"}, // -nan + {uint64_t(0xFFF0000000000001LL), "-0x1.0000000000001p+1024"}, // -nan + {uint64_t(0xFFF0000300000000LL), "-0x1.00003p+1024"}, // -nan + {uint64_t(0xFFFFFFFFFFFFFFFFLL), "-0x1.fffffffffffffp+1024"}, // -nan + {uint64_t(0x7FF8000000000000LL), "0x1.8p+1024"}, // +nan + {uint64_t(0x7FF0F00000000000LL), "0x1.0fp+1024"}, // +nan + {uint64_t(0x7FF0000000000001LL), "0x1.0000000000001p+1024"}, // -nan + {uint64_t(0x7FF0000300000000LL), "0x1.00003p+1024"}, // -nan + {uint64_t(0x7FFFFFFFFFFFFFFFLL), "0x1.fffffffffffffp+1024"}, // -nan + })), ); + +// Tests that encoding a value and decoding it again restores +// the same value. +TEST_P(RoundTripFloatTest, CanStoreAccurately) { + std::stringstream ss; + ss << FloatProxy(GetParam()); + ss.seekg(0); + FloatProxy res; + ss >> res; + EXPECT_THAT(GetParam(), Eq(res.getAsFloat())); +} + +TEST_P(RoundTripDoubleTest, CanStoreAccurately) { + std::stringstream ss; + ss << FloatProxy(GetParam()); + ss.seekg(0); + FloatProxy res; + ss >> res; + EXPECT_THAT(GetParam(), Eq(res.getAsFloat())); +} + +INSTANTIATE_TEST_CASE_P( + Float32StoreTests, RoundTripFloatTest, + ::testing::ValuesIn(std::vector( + {// Value requiring more than 6 digits of precision to be + // represented accurately. + 3.0000002f}))); + +INSTANTIATE_TEST_CASE_P( + Float64StoreTests, RoundTripDoubleTest, + ::testing::ValuesIn(std::vector( + {// Value requiring more than 15 digits of precision to be + // represented accurately. + 1.5000000000000002}))); + +TEST(HexFloatStreamTest, OperatorLeftShiftPreservesFloatAndFill) { + std::stringstream s; + s << std::setw(4) << std::oct << std::setfill('x') << 8 << " " + << FloatProxy(uint32_t(0xFF800100)) << " " << std::setw(4) << 9; + EXPECT_THAT(s.str(), Eq(std::string("xx10 -0x1.0002p+128 xx11"))); +} + +TEST(HexDoubleStreamTest, OperatorLeftShiftPreservesFloatAndFill) { + std::stringstream s; + s << std::setw(4) << std::oct << std::setfill('x') << 8 << " " + << FloatProxy(uint64_t(0x7FF0F00000000000LL)) << " " << std::setw(4) + << 9; + EXPECT_THAT(s.str(), Eq(std::string("xx10 0x1.0fp+1024 xx11"))); +} + +TEST_P(DecodeHexFloatTest, DecodeCorrectly) { + EXPECT_THAT(Decode(GetParam().first), Eq(GetParam().second)); +} + +TEST_P(DecodeHexDoubleTest, DecodeCorrectly) { + EXPECT_THAT(Decode(GetParam().first), Eq(GetParam().second)); +} + +INSTANTIATE_TEST_CASE_P( + Float32DecodeTests, DecodeHexFloatTest, + ::testing::ValuesIn(std::vector>>({ + {"0x0p+000", 0.f}, + {"0x0p0", 0.f}, + {"0x0p-0", 0.f}, + + // flush to zero cases + {"0x1p-500", 0.f}, // Exponent underflows. + {"-0x1p-500", -0.f}, + {"0x0.00000000001p-126", 0.f}, // Fraction causes underflow. + {"-0x0.0000000001p-127", -0.f}, + {"-0x0.01p-142", -0.f}, // Fraction causes additional underflow. + {"0x0.01p-142", 0.f}, + + // Some floats that do not encode the same way as they decode. + {"0x2p+0", 2.f}, + {"0xFFp+0", 255.f}, + {"0x0.8p+0", 0.5f}, + {"0x0.4p+0", 0.25f}, + })), ); + +INSTANTIATE_TEST_CASE_P( + Float32DecodeInfTests, DecodeHexFloatTest, + ::testing::ValuesIn(std::vector>>({ + // inf cases + {"-0x1p+128", uint32_t(0xFF800000)}, // -inf + {"0x32p+127", uint32_t(0x7F800000)}, // inf + {"0x32p+500", uint32_t(0x7F800000)}, // inf + {"-0x32p+127", uint32_t(0xFF800000)}, // -inf + })), ); + +INSTANTIATE_TEST_CASE_P( + Float64DecodeTests, DecodeHexDoubleTest, + ::testing::ValuesIn( + std::vector>>({ + {"0x0p+000", 0.}, + {"0x0p0", 0.}, + {"0x0p-0", 0.}, + + // flush to zero cases + {"0x1p-5000", 0.}, // Exponent underflows. + {"-0x1p-5000", -0.}, + {"0x0.0000000000000001p-1023", 0.}, // Fraction causes underflow. + {"-0x0.000000000000001p-1024", -0.}, + {"-0x0.01p-1090", -0.f}, // Fraction causes additional underflow. + {"0x0.01p-1090", 0.}, + + // Some floats that do not encode the same way as they decode. + {"0x2p+0", 2.}, + {"0xFFp+0", 255.}, + {"0x0.8p+0", 0.5}, + {"0x0.4p+0", 0.25}, + })), ); + +INSTANTIATE_TEST_CASE_P( + Float64DecodeInfTests, DecodeHexDoubleTest, + ::testing::ValuesIn( + std::vector>>({ + // inf cases + {"-0x1p+1024", uint64_t(0xFFF0000000000000)}, // -inf + {"0x32p+1023", uint64_t(0x7FF0000000000000)}, // inf + {"0x32p+5000", uint64_t(0x7FF0000000000000)}, // inf + {"-0x32p+1023", uint64_t(0xFFF0000000000000)}, // -inf + })), ); + +TEST(FloatProxy, ValidConversion) { + EXPECT_THAT(FloatProxy(1.f).getAsFloat(), Eq(1.0f)); + EXPECT_THAT(FloatProxy(32.f).getAsFloat(), Eq(32.0f)); + EXPECT_THAT(FloatProxy(-1.f).getAsFloat(), Eq(-1.0f)); + EXPECT_THAT(FloatProxy(0.f).getAsFloat(), Eq(0.0f)); + EXPECT_THAT(FloatProxy(-0.f).getAsFloat(), Eq(-0.0f)); + EXPECT_THAT(FloatProxy(1.2e32f).getAsFloat(), Eq(1.2e32f)); + + EXPECT_TRUE(std::isinf(FloatProxy(uint32_t(0xFF800000)).getAsFloat())); + EXPECT_TRUE(std::isinf(FloatProxy(uint32_t(0x7F800000)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0xFFC00000)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0xFF800100)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0xFF800c00)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0xFF80F000)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0xFFFFFFFF)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0x7FC00000)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0x7F800100)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0x7f800c00)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0x7F80F000)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0x7FFFFFFF)).getAsFloat())); + + EXPECT_THAT(FloatProxy(uint32_t(0xFF800000)).data(), Eq(0xFF800000u)); + EXPECT_THAT(FloatProxy(uint32_t(0x7F800000)).data(), Eq(0x7F800000u)); + EXPECT_THAT(FloatProxy(uint32_t(0xFFC00000)).data(), Eq(0xFFC00000u)); + EXPECT_THAT(FloatProxy(uint32_t(0xFF800100)).data(), Eq(0xFF800100u)); + EXPECT_THAT(FloatProxy(uint32_t(0xFF800c00)).data(), Eq(0xFF800c00u)); + EXPECT_THAT(FloatProxy(uint32_t(0xFF80F000)).data(), Eq(0xFF80F000u)); + EXPECT_THAT(FloatProxy(uint32_t(0xFFFFFFFF)).data(), Eq(0xFFFFFFFFu)); + EXPECT_THAT(FloatProxy(uint32_t(0x7FC00000)).data(), Eq(0x7FC00000u)); + EXPECT_THAT(FloatProxy(uint32_t(0x7F800100)).data(), Eq(0x7F800100u)); + EXPECT_THAT(FloatProxy(uint32_t(0x7f800c00)).data(), Eq(0x7f800c00u)); + EXPECT_THAT(FloatProxy(uint32_t(0x7F80F000)).data(), Eq(0x7F80F000u)); + EXPECT_THAT(FloatProxy(uint32_t(0x7FFFFFFF)).data(), Eq(0x7FFFFFFFu)); +} + +TEST(FloatProxy, Nan) { + EXPECT_TRUE(FloatProxy(uint32_t(0xFFC00000)).isNan()); + EXPECT_TRUE(FloatProxy(uint32_t(0xFF800100)).isNan()); + EXPECT_TRUE(FloatProxy(uint32_t(0xFF800c00)).isNan()); + EXPECT_TRUE(FloatProxy(uint32_t(0xFF80F000)).isNan()); + EXPECT_TRUE(FloatProxy(uint32_t(0xFFFFFFFF)).isNan()); + EXPECT_TRUE(FloatProxy(uint32_t(0x7FC00000)).isNan()); + EXPECT_TRUE(FloatProxy(uint32_t(0x7F800100)).isNan()); + EXPECT_TRUE(FloatProxy(uint32_t(0x7f800c00)).isNan()); + EXPECT_TRUE(FloatProxy(uint32_t(0x7F80F000)).isNan()); + EXPECT_TRUE(FloatProxy(uint32_t(0x7FFFFFFF)).isNan()); +} + +TEST(FloatProxy, Negation) { + EXPECT_THAT((-FloatProxy(1.f)).getAsFloat(), Eq(-1.0f)); + EXPECT_THAT((-FloatProxy(0.f)).getAsFloat(), Eq(-0.0f)); + + EXPECT_THAT((-FloatProxy(-1.f)).getAsFloat(), Eq(1.0f)); + EXPECT_THAT((-FloatProxy(-0.f)).getAsFloat(), Eq(0.0f)); + + EXPECT_THAT((-FloatProxy(32.f)).getAsFloat(), Eq(-32.0f)); + EXPECT_THAT((-FloatProxy(-32.f)).getAsFloat(), Eq(32.0f)); + + EXPECT_THAT((-FloatProxy(1.2e32f)).getAsFloat(), Eq(-1.2e32f)); + EXPECT_THAT((-FloatProxy(-1.2e32f)).getAsFloat(), Eq(1.2e32f)); + + EXPECT_THAT( + (-FloatProxy(std::numeric_limits::infinity())).getAsFloat(), + Eq(-std::numeric_limits::infinity())); + EXPECT_THAT((-FloatProxy(-std::numeric_limits::infinity())) + .getAsFloat(), + Eq(std::numeric_limits::infinity())); +} + +// Test conversion of FloatProxy values to strings. +// +// In previous cases, we always wrapped the FloatProxy value in a HexFloat +// before conversion to a string. In the following cases, the FloatProxy +// decides for itself whether to print as a regular number or as a hex float. + +using FloatProxyFloatTest = + ::testing::TestWithParam, std::string>>; +using FloatProxyDoubleTest = + ::testing::TestWithParam, std::string>>; + +// Converts a float value to a string via a FloatProxy. +template +std::string EncodeViaFloatProxy(const T& value) { + std::stringstream ss; + ss << value; + return ss.str(); +} + +// Converts a floating point string so that the exponent prefix +// is 'e', and the exponent value does not have leading zeros. +// The Microsoft runtime library likes to write things like "2.5E+010". +// Convert that to "2.5e+10". +// We don't care what happens to strings that are not floating point +// strings. +std::string NormalizeExponentInFloatString(std::string in) { + std::string result; + // Reserve one spot for the terminating null, even when the sscanf fails. + std::vector prefix(in.size() + 1); + char e; + char plus_or_minus; + int exponent; // in base 10 + if ((4 == std::sscanf(in.c_str(), "%[-+.0123456789]%c%c%d", prefix.data(), &e, + &plus_or_minus, &exponent)) && + (e == 'e' || e == 'E') && + (plus_or_minus == '-' || plus_or_minus == '+')) { + // It looks like a floating point value with exponent. + std::stringstream out; + out << prefix.data() << 'e' << plus_or_minus << exponent; + result = out.str(); + } else { + result = in; + } + return result; +} + +TEST(NormalizeFloat, Sample) { + EXPECT_THAT(NormalizeExponentInFloatString(""), Eq("")); + EXPECT_THAT(NormalizeExponentInFloatString("1e-12"), Eq("1e-12")); + EXPECT_THAT(NormalizeExponentInFloatString("1E+14"), Eq("1e+14")); + EXPECT_THAT(NormalizeExponentInFloatString("1e-0012"), Eq("1e-12")); + EXPECT_THAT(NormalizeExponentInFloatString("1.263E+014"), Eq("1.263e+14")); +} + +// The following two tests can't be DRY because they take different parameter +// types. +TEST_P(FloatProxyFloatTest, EncodeCorrectly) { + EXPECT_THAT( + NormalizeExponentInFloatString(EncodeViaFloatProxy(GetParam().first)), + Eq(GetParam().second)); +} + +TEST_P(FloatProxyDoubleTest, EncodeCorrectly) { + EXPECT_THAT( + NormalizeExponentInFloatString(EncodeViaFloatProxy(GetParam().first)), + Eq(GetParam().second)); +} + +INSTANTIATE_TEST_CASE_P( + Float32Tests, FloatProxyFloatTest, + ::testing::ValuesIn(std::vector, std::string>>({ + // Zero + {0.f, "0"}, + // Normal numbers + {1.f, "1"}, + {-0.25f, "-0.25"}, + {1000.0f, "1000"}, + + // Still normal numbers, but with large magnitude exponents. + {float(ldexp(1.f, 126)), "8.50705917e+37"}, + {float(ldexp(-1.f, -126)), "-1.17549435e-38"}, + + // denormalized values are printed as hex floats. + {float(ldexp(1.0f, -127)), "0x1p-127"}, + {float(ldexp(1.5f, -128)), "0x1.8p-128"}, + {float(ldexp(1.25, -129)), "0x1.4p-129"}, + {float(ldexp(1.125, -130)), "0x1.2p-130"}, + {float(ldexp(-1.0f, -127)), "-0x1p-127"}, + {float(ldexp(-1.0f, -128)), "-0x1p-128"}, + {float(ldexp(-1.0f, -129)), "-0x1p-129"}, + {float(ldexp(-1.5f, -130)), "-0x1.8p-130"}, + + // NaNs + {FloatProxy(uint32_t(0xFFC00000)), "-0x1.8p+128"}, + {FloatProxy(uint32_t(0xFF800100)), "-0x1.0002p+128"}, + + {std::numeric_limits::infinity(), "0x1p+128"}, + {-std::numeric_limits::infinity(), "-0x1p+128"}, + })), ); + +INSTANTIATE_TEST_CASE_P( + Float64Tests, FloatProxyDoubleTest, + ::testing::ValuesIn( + std::vector, std::string>>({ + {0., "0"}, + {1., "1"}, + {-0.25, "-0.25"}, + {1000.0, "1000"}, + + // Large outside the range of normal floats + {ldexp(1.0, 128), "3.4028236692093846e+38"}, + {ldexp(1.5, 129), "1.0208471007628154e+39"}, + {ldexp(-1.0, 128), "-3.4028236692093846e+38"}, + {ldexp(-1.5, 129), "-1.0208471007628154e+39"}, + + // Small outside the range of normal floats + {ldexp(1.5, -129), "2.2040519077917891e-39"}, + {ldexp(-1.5, -129), "-2.2040519077917891e-39"}, + + // lowest non-denorm + {ldexp(1.0, -1022), "2.2250738585072014e-308"}, + {ldexp(-1.0, -1022), "-2.2250738585072014e-308"}, + + // Denormalized values + {ldexp(1.125, -1023), "0x1.2p-1023"}, + {ldexp(-1.375, -1024), "-0x1.6p-1024"}, + + // NaNs + {uint64_t(0x7FF8000000000000LL), "0x1.8p+1024"}, + {uint64_t(0xFFF0F00000000000LL), "-0x1.0fp+1024"}, + + // Infinity + {std::numeric_limits::infinity(), "0x1p+1024"}, + {-std::numeric_limits::infinity(), "-0x1p+1024"}, + + })), ); + +// double is used so that unbiased_exponent can be used with the output +// of ldexp directly. +int32_t unbiased_exponent(double f) { + return spvutils::HexFloat>(static_cast(f)) + .getUnbiasedNormalizedExponent(); +} + +int16_t unbiased_half_exponent(uint16_t f) { + return spvutils::HexFloat>(f) + .getUnbiasedNormalizedExponent(); +} + +TEST(HexFloatOperationTest, UnbiasedExponent) { + // Float cases + EXPECT_EQ(0, unbiased_exponent(ldexp(1.0f, 0))); + EXPECT_EQ(-32, unbiased_exponent(ldexp(1.0f, -32))); + EXPECT_EQ(42, unbiased_exponent(ldexp(1.0f, 42))); + EXPECT_EQ(125, unbiased_exponent(ldexp(1.0f, 125))); + + EXPECT_EQ(128, spvutils::HexFloat>( + std::numeric_limits::infinity()) + .getUnbiasedNormalizedExponent()); + + EXPECT_EQ(-100, unbiased_exponent(ldexp(1.0f, -100))); + EXPECT_EQ(-127, unbiased_exponent(ldexp(1.0f, -127))); // First denorm + EXPECT_EQ(-128, unbiased_exponent(ldexp(1.0f, -128))); + EXPECT_EQ(-129, unbiased_exponent(ldexp(1.0f, -129))); + EXPECT_EQ(-140, unbiased_exponent(ldexp(1.0f, -140))); + // Smallest representable number + EXPECT_EQ(-126 - 23, unbiased_exponent(ldexp(1.0f, -126 - 23))); + // Should get rounded to 0 first. + EXPECT_EQ(0, unbiased_exponent(ldexp(1.0f, -127 - 23))); + + // Float16 cases + // The exponent is represented in the bits 0x7C00 + // The offset is -15 + EXPECT_EQ(0, unbiased_half_exponent(0x3C00)); + EXPECT_EQ(3, unbiased_half_exponent(0x4800)); + EXPECT_EQ(-1, unbiased_half_exponent(0x3800)); + EXPECT_EQ(-14, unbiased_half_exponent(0x0400)); + EXPECT_EQ(16, unbiased_half_exponent(0x7C00)); + EXPECT_EQ(10, unbiased_half_exponent(0x6400)); + + // Smallest representable number + EXPECT_EQ(-24, unbiased_half_exponent(0x0001)); +} + +// Creates a float that is the sum of 1/(2 ^ fractions[i]) for i in factions +float float_fractions(const std::vector& fractions) { + float f = 0; + for (int32_t i : fractions) { + f += std::ldexp(1.0f, -i); + } + return f; +} + +// Returns the normalized significand of a HexFloat> +// that was created by calling float_fractions with the input fractions, +// raised to the power of exp. +uint32_t normalized_significand(const std::vector& fractions, + uint32_t exp) { + return spvutils::HexFloat>( + static_cast(ldexp(float_fractions(fractions), exp))) + .getNormalizedSignificand(); +} + +// Sets the bits from MSB to LSB of the significand part of a float. +// For example 0 would set the bit 23 (counting from LSB to MSB), +// and 1 would set the 22nd bit. +uint32_t bits_set(const std::vector& bits) { + const uint32_t top_bit = 1u << 22u; + uint32_t val = 0; + for (uint32_t i : bits) { + val |= top_bit >> i; + } + return val; +} + +// The same as bits_set but for a Float16 value instead of 32-bit floating +// point. +uint16_t half_bits_set(const std::vector& bits) { + const uint32_t top_bit = 1u << 9u; + uint32_t val = 0; + for (uint32_t i : bits) { + val |= top_bit >> i; + } + return static_cast(val); +} + +TEST(HexFloatOperationTest, NormalizedSignificand) { + // For normalized numbers (the following) it should be a simple matter + // of getting rid of the top implicit bit + EXPECT_EQ(bits_set({}), normalized_significand({0}, 0)); + EXPECT_EQ(bits_set({0}), normalized_significand({0, 1}, 0)); + EXPECT_EQ(bits_set({0, 1}), normalized_significand({0, 1, 2}, 0)); + EXPECT_EQ(bits_set({1}), normalized_significand({0, 2}, 0)); + EXPECT_EQ(bits_set({1}), normalized_significand({0, 2}, 32)); + EXPECT_EQ(bits_set({1}), normalized_significand({0, 2}, 126)); + + // For denormalized numbers we expect the normalized significand to + // shift as if it were normalized. This means, in practice that the + // top_most set bit will be cut off. Looks very similar to above (on purpose) + EXPECT_EQ(bits_set({}), normalized_significand({0}, -127)); + EXPECT_EQ(bits_set({3}), normalized_significand({0, 4}, -128)); + EXPECT_EQ(bits_set({3}), normalized_significand({0, 4}, -127)); + EXPECT_EQ(bits_set({}), normalized_significand({22}, -127)); + EXPECT_EQ(bits_set({0}), normalized_significand({21, 22}, -127)); +} + +// Returns the 32-bit floating point value created by +// calling setFromSignUnbiasedExponentAndNormalizedSignificand +// on a HexFloat> +float set_from_sign(bool negative, int32_t unbiased_exponent, + uint32_t significand, bool round_denorm_up) { + spvutils::HexFloat> f(0.f); + f.setFromSignUnbiasedExponentAndNormalizedSignificand( + negative, unbiased_exponent, significand, round_denorm_up); + return f.value().getAsFloat(); +} + +TEST(HexFloatOperationTests, + SetFromSignUnbiasedExponentAndNormalizedSignificand) { + EXPECT_EQ(1.f, set_from_sign(false, 0, 0, false)); + + // Tests insertion of various denormalized numbers with and without round up. + EXPECT_EQ(static_cast(ldexp(1.f, -149)), + set_from_sign(false, -149, 0, false)); + EXPECT_EQ(static_cast(ldexp(1.f, -149)), + set_from_sign(false, -149, 0, true)); + EXPECT_EQ(0.f, set_from_sign(false, -150, 1, false)); + EXPECT_EQ(static_cast(ldexp(1.f, -149)), + set_from_sign(false, -150, 1, true)); + + EXPECT_EQ(ldexp(1.0f, -127), set_from_sign(false, -127, 0, false)); + EXPECT_EQ(ldexp(1.0f, -128), set_from_sign(false, -128, 0, false)); + EXPECT_EQ(float_fractions({0, 1, 2, 5}), + set_from_sign(false, 0, bits_set({0, 1, 4}), false)); + EXPECT_EQ(ldexp(float_fractions({0, 1, 2, 5}), -32), + set_from_sign(false, -32, bits_set({0, 1, 4}), false)); + EXPECT_EQ(ldexp(float_fractions({0, 1, 2, 5}), -128), + set_from_sign(false, -128, bits_set({0, 1, 4}), false)); + + // The negative cases from above. + EXPECT_EQ(-1.f, set_from_sign(true, 0, 0, false)); + EXPECT_EQ(-ldexp(1.0, -127), set_from_sign(true, -127, 0, false)); + EXPECT_EQ(-ldexp(1.0, -128), set_from_sign(true, -128, 0, false)); + EXPECT_EQ(-float_fractions({0, 1, 2, 5}), + set_from_sign(true, 0, bits_set({0, 1, 4}), false)); + EXPECT_EQ(-ldexp(float_fractions({0, 1, 2, 5}), -32), + set_from_sign(true, -32, bits_set({0, 1, 4}), false)); + EXPECT_EQ(-ldexp(float_fractions({0, 1, 2, 5}), -128), + set_from_sign(true, -128, bits_set({0, 1, 4}), false)); +} + +TEST(HexFloatOperationTests, NonRounding) { + // Rounding from 32-bit hex-float to 32-bit hex-float should be trivial, + // except in the denorm case which is a bit more complex. + using HF = spvutils::HexFloat>; + bool carry_bit = false; + + spvutils::round_direction rounding[] = { + spvutils::round_direction::kToZero, + spvutils::round_direction::kToNearestEven, + spvutils::round_direction::kToPositiveInfinity, + spvutils::round_direction::kToNegativeInfinity}; + + // Everything fits, so this should be straight-forward + for (spvutils::round_direction round : rounding) { + EXPECT_EQ(bits_set({}), + HF(0.f).getRoundedNormalizedSignificand(round, &carry_bit)); + EXPECT_FALSE(carry_bit); + + EXPECT_EQ(bits_set({0}), + HF(float_fractions({0, 1})) + .getRoundedNormalizedSignificand(round, &carry_bit)); + EXPECT_FALSE(carry_bit); + + EXPECT_EQ(bits_set({1, 3}), + HF(float_fractions({0, 2, 4})) + .getRoundedNormalizedSignificand(round, &carry_bit)); + EXPECT_FALSE(carry_bit); + + EXPECT_EQ( + bits_set({0, 1, 4}), + HF(static_cast(-ldexp(float_fractions({0, 1, 2, 5}), -128))) + .getRoundedNormalizedSignificand(round, &carry_bit)); + EXPECT_FALSE(carry_bit); + + EXPECT_EQ(bits_set({0, 1, 4, 22}), + HF(static_cast(float_fractions({0, 1, 2, 5, 23}))) + .getRoundedNormalizedSignificand(round, &carry_bit)); + EXPECT_FALSE(carry_bit); + } +} + +using RD = spvutils::round_direction; +struct RoundSignificandCase { + float source_float; + std::pair expected_results; + spvutils::round_direction round; +}; + +using HexFloatRoundTest = ::testing::TestWithParam; + +TEST_P(HexFloatRoundTest, RoundDownToFP16) { + using HF = spvutils::HexFloat>; + using HF16 = spvutils::HexFloat>; + + HF input_value(GetParam().source_float); + bool carry_bit = false; + EXPECT_EQ(GetParam().expected_results.first, + input_value.getRoundedNormalizedSignificand(GetParam().round, + &carry_bit)); + EXPECT_EQ(carry_bit, GetParam().expected_results.second); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P(F32ToF16, HexFloatRoundTest, + ::testing::ValuesIn(std::vector( + { + {float_fractions({0}), std::make_pair(half_bits_set({}), false), RD::kToZero}, + {float_fractions({0}), std::make_pair(half_bits_set({}), false), RD::kToNearestEven}, + {float_fractions({0}), std::make_pair(half_bits_set({}), false), RD::kToPositiveInfinity}, + {float_fractions({0}), std::make_pair(half_bits_set({}), false), RD::kToNegativeInfinity}, + {float_fractions({0, 1}), std::make_pair(half_bits_set({0}), false), RD::kToZero}, + + {float_fractions({0, 1, 11}), std::make_pair(half_bits_set({0}), false), RD::kToZero}, + {float_fractions({0, 1, 11}), std::make_pair(half_bits_set({0, 9}), false), RD::kToPositiveInfinity}, + {float_fractions({0, 1, 11}), std::make_pair(half_bits_set({0}), false), RD::kToNegativeInfinity}, + {float_fractions({0, 1, 11}), std::make_pair(half_bits_set({0}), false), RD::kToNearestEven}, + + {float_fractions({0, 1, 10, 11}), std::make_pair(half_bits_set({0, 9}), false), RD::kToZero}, + {float_fractions({0, 1, 10, 11}), std::make_pair(half_bits_set({0, 8}), false), RD::kToPositiveInfinity}, + {float_fractions({0, 1, 10, 11}), std::make_pair(half_bits_set({0, 9}), false), RD::kToNegativeInfinity}, + {float_fractions({0, 1, 10, 11}), std::make_pair(half_bits_set({0, 8}), false), RD::kToNearestEven}, + + {float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0}), false), RD::kToZero}, + {float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0, 9}), false), RD::kToPositiveInfinity}, + {float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0}), false), RD::kToNegativeInfinity}, + {float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0, 9}), false), RD::kToNearestEven}, + + {-float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0}), false), RD::kToZero}, + {-float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0}), false), RD::kToPositiveInfinity}, + {-float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0, 9}), false), RD::kToNegativeInfinity}, + {-float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0, 9}), false), RD::kToNearestEven}, + + {float_fractions({0, 1, 11, 22}), std::make_pair(half_bits_set({0}), false), RD::kToZero}, + {float_fractions({0, 1, 11, 22}), std::make_pair(half_bits_set({0, 9}), false), RD::kToPositiveInfinity}, + {float_fractions({0, 1, 11, 22}), std::make_pair(half_bits_set({0}), false), RD::kToNegativeInfinity}, + {float_fractions({0, 1, 11, 22}), std::make_pair(half_bits_set({0, 9}), false), RD::kToNearestEven}, + + // Carries + {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(half_bits_set({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}), false), RD::kToZero}, + {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(half_bits_set({}), true), RD::kToPositiveInfinity}, + {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(half_bits_set({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}), false), RD::kToNegativeInfinity}, + {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(half_bits_set({}), true), RD::kToNearestEven}, + + // Cases where original number was denorm. Note: this should have no effect + // the number is pre-normalized. + {static_cast(ldexp(float_fractions({0, 1, 11, 13}), -128)), std::make_pair(half_bits_set({0}), false), RD::kToZero}, + {static_cast(ldexp(float_fractions({0, 1, 11, 13}), -129)), std::make_pair(half_bits_set({0, 9}), false), RD::kToPositiveInfinity}, + {static_cast(ldexp(float_fractions({0, 1, 11, 13}), -131)), std::make_pair(half_bits_set({0}), false), RD::kToNegativeInfinity}, + {static_cast(ldexp(float_fractions({0, 1, 11, 13}), -130)), std::make_pair(half_bits_set({0, 9}), false), RD::kToNearestEven}, + })),); +// clang-format on + +struct UpCastSignificandCase { + uint16_t source_half; + uint32_t expected_result; +}; + +using HexFloatRoundUpSignificandTest = + ::testing::TestWithParam; +TEST_P(HexFloatRoundUpSignificandTest, Widening) { + using HF = spvutils::HexFloat>; + using HF16 = spvutils::HexFloat>; + bool carry_bit = false; + + spvutils::round_direction rounding[] = { + spvutils::round_direction::kToZero, + spvutils::round_direction::kToNearestEven, + spvutils::round_direction::kToPositiveInfinity, + spvutils::round_direction::kToNegativeInfinity}; + + // Everything fits, so everything should just be bit-shifts. + for (spvutils::round_direction round : rounding) { + carry_bit = false; + HF16 input_value(GetParam().source_half); + EXPECT_EQ( + GetParam().expected_result, + input_value.getRoundedNormalizedSignificand(round, &carry_bit)) + << std::hex << "0x" + << input_value.getRoundedNormalizedSignificand(round, &carry_bit) + << " 0x" << GetParam().expected_result; + EXPECT_FALSE(carry_bit); + } +} + +INSTANTIATE_TEST_CASE_P( + F16toF32, HexFloatRoundUpSignificandTest, + // 0xFC00 of the source 16-bit hex value cover the sign and the exponent. + // They are ignored for this test. + ::testing::ValuesIn(std::vector({ + {0x3F00, 0x600000}, + {0x0F00, 0x600000}, + {0x0F01, 0x602000}, + {0x0FFF, 0x7FE000}, + })), ); + +struct DownCastTest { + float source_float; + uint16_t expected_half; + std::vector directions; +}; + +std::string get_round_text(spvutils::round_direction direction) { +#define CASE(round_direction) \ + case round_direction: \ + return #round_direction + + switch (direction) { + CASE(spvutils::round_direction::kToZero); + CASE(spvutils::round_direction::kToPositiveInfinity); + CASE(spvutils::round_direction::kToNegativeInfinity); + CASE(spvutils::round_direction::kToNearestEven); + } +#undef CASE + return ""; +} + +using HexFloatFP32To16Tests = ::testing::TestWithParam; + +TEST_P(HexFloatFP32To16Tests, NarrowingCasts) { + using HF = spvutils::HexFloat>; + using HF16 = spvutils::HexFloat>; + HF f(GetParam().source_float); + for (auto round : GetParam().directions) { + HF16 half(0); + f.castTo(half, round); + EXPECT_EQ(GetParam().expected_half, half.value().getAsFloat().get_value()) + << get_round_text(round) << " " << std::hex + << spvutils::BitwiseCast(GetParam().source_float) + << " cast to: " << half.value().getAsFloat().get_value(); + } +} + +const uint16_t positive_infinity = 0x7C00; +const uint16_t negative_infinity = 0xFC00; + +INSTANTIATE_TEST_CASE_P( + F32ToF16, HexFloatFP32To16Tests, + ::testing::ValuesIn(std::vector({ + // Exactly representable as half. + {0.f, + 0x0, + {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, + RD::kToNearestEven}}, + {-0.f, + 0x8000, + {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, + RD::kToNearestEven}}, + {1.0f, + 0x3C00, + {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, + RD::kToNearestEven}}, + {-1.0f, + 0xBC00, + {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, + RD::kToNearestEven}}, + + {float_fractions({0, 1, 10}), + 0x3E01, + {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, + RD::kToNearestEven}}, + {-float_fractions({0, 1, 10}), + 0xBE01, + {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, + RD::kToNearestEven}}, + {static_cast(ldexp(float_fractions({0, 1, 10}), 3)), + 0x4A01, + {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, + RD::kToNearestEven}}, + {static_cast(-ldexp(float_fractions({0, 1, 10}), 3)), + 0xCA01, + {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, + RD::kToNearestEven}}, + + // Underflow + {static_cast(ldexp(1.0f, -25)), + 0x0, + {RD::kToZero, RD::kToNegativeInfinity, RD::kToNearestEven}}, + {static_cast(ldexp(1.0f, -25)), 0x1, {RD::kToPositiveInfinity}}, + {static_cast(-ldexp(1.0f, -25)), + 0x8000, + {RD::kToZero, RD::kToPositiveInfinity, RD::kToNearestEven}}, + {static_cast(-ldexp(1.0f, -25)), + 0x8001, + {RD::kToNegativeInfinity}}, + {static_cast(ldexp(1.0f, -24)), + 0x1, + {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, + RD::kToNearestEven}}, + + // Overflow + {static_cast(ldexp(1.0f, 16)), + positive_infinity, + {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, + RD::kToNearestEven}}, + {static_cast(ldexp(1.0f, 18)), + positive_infinity, + {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, + RD::kToNearestEven}}, + {static_cast(ldexp(1.3f, 16)), + positive_infinity, + {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, + RD::kToNearestEven}}, + {static_cast(-ldexp(1.0f, 16)), + negative_infinity, + {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, + RD::kToNearestEven}}, + {static_cast(-ldexp(1.0f, 18)), + negative_infinity, + {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, + RD::kToNearestEven}}, + {static_cast(-ldexp(1.3f, 16)), + negative_infinity, + {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, + RD::kToNearestEven}}, + + // Transfer of Infinities + {std::numeric_limits::infinity(), + positive_infinity, + {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, + RD::kToNearestEven}}, + {-std::numeric_limits::infinity(), + negative_infinity, + {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, + RD::kToNearestEven}}, + + // Nans are below because we cannot test for equality. + })), ); + +struct UpCastCase { + uint16_t source_half; + float expected_float; +}; + +using HexFloatFP16To32Tests = ::testing::TestWithParam; +TEST_P(HexFloatFP16To32Tests, WideningCasts) { + using HF = spvutils::HexFloat>; + using HF16 = spvutils::HexFloat>; + HF16 f(GetParam().source_half); + + spvutils::round_direction rounding[] = { + spvutils::round_direction::kToZero, + spvutils::round_direction::kToNearestEven, + spvutils::round_direction::kToPositiveInfinity, + spvutils::round_direction::kToNegativeInfinity}; + + // Everything fits, so everything should just be bit-shifts. + for (spvutils::round_direction round : rounding) { + HF flt(0.f); + f.castTo(flt, round); + EXPECT_EQ(GetParam().expected_float, flt.value().getAsFloat()) + << get_round_text(round) << " " << std::hex + << spvutils::BitwiseCast(GetParam().source_half) + << " cast to: " << flt.value().getAsFloat(); + } +} + +INSTANTIATE_TEST_CASE_P( + F16ToF32, HexFloatFP16To32Tests, + ::testing::ValuesIn(std::vector({ + {0x0000, 0.f}, + {0x8000, -0.f}, + {0x3C00, 1.0f}, + {0xBC00, -1.0f}, + {0x3F00, float_fractions({0, 1, 2})}, + {0xBF00, -float_fractions({0, 1, 2})}, + {0x3F01, float_fractions({0, 1, 2, 10})}, + {0xBF01, -float_fractions({0, 1, 2, 10})}, + + // denorm + {0x0001, static_cast(ldexp(1.0, -24))}, + {0x0002, static_cast(ldexp(1.0, -23))}, + {0x8001, static_cast(-ldexp(1.0, -24))}, + {0x8011, static_cast(-ldexp(1.0, -20) + -ldexp(1.0, -24))}, + + // inf + {0x7C00, std::numeric_limits::infinity()}, + {0xFC00, -std::numeric_limits::infinity()}, + })), ); + +TEST(HexFloatOperationTests, NanTests) { + using HF = spvutils::HexFloat>; + using HF16 = spvutils::HexFloat>; + spvutils::round_direction rounding[] = { + spvutils::round_direction::kToZero, + spvutils::round_direction::kToNearestEven, + spvutils::round_direction::kToPositiveInfinity, + spvutils::round_direction::kToNegativeInfinity}; + + // Everything fits, so everything should just be bit-shifts. + for (spvutils::round_direction round : rounding) { + HF16 f16(0); + HF f(0.f); + HF(std::numeric_limits::quiet_NaN()).castTo(f16, round); + EXPECT_TRUE(f16.value().isNan()); + HF(std::numeric_limits::signaling_NaN()).castTo(f16, round); + EXPECT_TRUE(f16.value().isNan()); + + HF16(0x7C01).castTo(f, round); + EXPECT_TRUE(f.value().isNan()); + HF16(0x7C11).castTo(f, round); + EXPECT_TRUE(f.value().isNan()); + HF16(0xFC01).castTo(f, round); + EXPECT_TRUE(f.value().isNan()); + HF16(0x7C10).castTo(f, round); + EXPECT_TRUE(f.value().isNan()); + HF16(0xFF00).castTo(f, round); + EXPECT_TRUE(f.value().isNan()); + } +} + +// A test case for parsing good and bad HexFloat> literals. +template +struct FloatParseCase { + std::string literal; + bool negate_value; + bool expect_success; + HexFloat> expected_value; +}; + +using ParseNormalFloatTest = ::testing::TestWithParam>; + +TEST_P(ParseNormalFloatTest, Samples) { + std::stringstream input(GetParam().literal); + HexFloat> parsed_value(0.0f); + ParseNormalFloat(input, GetParam().negate_value, parsed_value); + EXPECT_NE(GetParam().expect_success, input.fail()) + << " literal: " << GetParam().literal + << " negate: " << GetParam().negate_value; + if (GetParam().expect_success) { + EXPECT_THAT(parsed_value.value(), Eq(GetParam().expected_value.value())) + << " literal: " << GetParam().literal + << " negate: " << GetParam().negate_value; + } +} + +// Returns a FloatParseCase with expected failure. +template +FloatParseCase BadFloatParseCase(std::string literal, bool negate_value, + T expected_value) { + HexFloat> proxy_expected_value(expected_value); + return FloatParseCase{literal, negate_value, false, proxy_expected_value}; +} + +// Returns a FloatParseCase that should successfully parse to a given value. +template +FloatParseCase GoodFloatParseCase(std::string literal, bool negate_value, + T expected_value) { + HexFloat> proxy_expected_value(expected_value); + return FloatParseCase{literal, negate_value, true, proxy_expected_value}; +} + +INSTANTIATE_TEST_CASE_P( + FloatParse, ParseNormalFloatTest, + ::testing::ValuesIn(std::vector>{ + // Failing cases due to trivially incorrect syntax. + BadFloatParseCase("abc", false, 0.0f), + BadFloatParseCase("abc", true, 0.0f), + + // Valid cases. + GoodFloatParseCase("0", false, 0.0f), + GoodFloatParseCase("0.0", false, 0.0f), + GoodFloatParseCase("-0.0", false, -0.0f), + GoodFloatParseCase("2.0", false, 2.0f), + GoodFloatParseCase("-2.0", false, -2.0f), + GoodFloatParseCase("+2.0", false, 2.0f), + // Cases with negate_value being true. + GoodFloatParseCase("0.0", true, -0.0f), + GoodFloatParseCase("2.0", true, -2.0f), + + // When negate_value is true, we should not accept a + // leading minus or plus. + BadFloatParseCase("-0.0", true, 0.0f), + BadFloatParseCase("-2.0", true, 0.0f), + BadFloatParseCase("+0.0", true, 0.0f), + BadFloatParseCase("+2.0", true, 0.0f), + + // Overflow is an error for 32-bit float parsing. + BadFloatParseCase("1e40", false, FLT_MAX), + BadFloatParseCase("1e40", true, -FLT_MAX), + BadFloatParseCase("-1e40", false, -FLT_MAX), + // We can't have -1e40 and negate_value == true since + // that represents an original case of "--1e40" which + // is invalid. + }), ); + +using ParseNormalFloat16Test = + ::testing::TestWithParam>; + +TEST_P(ParseNormalFloat16Test, Samples) { + std::stringstream input(GetParam().literal); + HexFloat> parsed_value(0); + ParseNormalFloat(input, GetParam().negate_value, parsed_value); + EXPECT_NE(GetParam().expect_success, input.fail()) + << " literal: " << GetParam().literal + << " negate: " << GetParam().negate_value; + if (GetParam().expect_success) { + EXPECT_THAT(parsed_value.value(), Eq(GetParam().expected_value.value())) + << " literal: " << GetParam().literal + << " negate: " << GetParam().negate_value; + } +} + +INSTANTIATE_TEST_CASE_P( + Float16Parse, ParseNormalFloat16Test, + ::testing::ValuesIn(std::vector>{ + // Failing cases due to trivially incorrect syntax. + BadFloatParseCase("abc", false, uint16_t{0}), + BadFloatParseCase("abc", true, uint16_t{0}), + + // Valid cases. + GoodFloatParseCase("0", false, uint16_t{0}), + GoodFloatParseCase("0.0", false, uint16_t{0}), + GoodFloatParseCase("-0.0", false, uint16_t{0x8000}), + GoodFloatParseCase("2.0", false, uint16_t{0x4000}), + GoodFloatParseCase("-2.0", false, uint16_t{0xc000}), + GoodFloatParseCase("+2.0", false, uint16_t{0x4000}), + // Cases with negate_value being true. + GoodFloatParseCase("0.0", true, uint16_t{0x8000}), + GoodFloatParseCase("2.0", true, uint16_t{0xc000}), + + // When negate_value is true, we should not accept a leading minus or + // plus. + BadFloatParseCase("-0.0", true, uint16_t{0}), + BadFloatParseCase("-2.0", true, uint16_t{0}), + BadFloatParseCase("+0.0", true, uint16_t{0}), + BadFloatParseCase("+2.0", true, uint16_t{0}), + }), ); + +// A test case for detecting infinities. +template +struct OverflowParseCase { + std::string input; + bool expect_success; + T expected_value; +}; + +using FloatProxyParseOverflowFloatTest = + ::testing::TestWithParam>; + +TEST_P(FloatProxyParseOverflowFloatTest, Sample) { + std::istringstream input(GetParam().input); + HexFloat> value(0.0f); + input >> value; + EXPECT_NE(GetParam().expect_success, input.fail()); + if (GetParam().expect_success) { + EXPECT_THAT(value.value().getAsFloat(), GetParam().expected_value); + } +} + +INSTANTIATE_TEST_CASE_P( + FloatOverflow, FloatProxyParseOverflowFloatTest, + ::testing::ValuesIn(std::vector>({ + {"0", true, 0.0f}, + {"0.0", true, 0.0f}, + {"1.0", true, 1.0f}, + {"1e38", true, 1e38f}, + {"-1e38", true, -1e38f}, + {"1e40", false, FLT_MAX}, + {"-1e40", false, -FLT_MAX}, + {"1e400", false, FLT_MAX}, + {"-1e400", false, -FLT_MAX}, + })), ); + +using FloatProxyParseOverflowDoubleTest = + ::testing::TestWithParam>; + +TEST_P(FloatProxyParseOverflowDoubleTest, Sample) { + std::istringstream input(GetParam().input); + HexFloat> value(0.0); + input >> value; + EXPECT_NE(GetParam().expect_success, input.fail()); + if (GetParam().expect_success) { + EXPECT_THAT(value.value().getAsFloat(), Eq(GetParam().expected_value)); + } +} + +INSTANTIATE_TEST_CASE_P( + DoubleOverflow, FloatProxyParseOverflowDoubleTest, + ::testing::ValuesIn(std::vector>({ + {"0", true, 0.0}, + {"0.0", true, 0.0}, + {"1.0", true, 1.0}, + {"1e38", true, 1e38}, + {"-1e38", true, -1e38}, + {"1e40", true, 1e40}, + {"-1e40", true, -1e40}, + {"1e400", false, DBL_MAX}, + {"-1e400", false, -DBL_MAX}, + })), ); + +using FloatProxyParseOverflowFloat16Test = + ::testing::TestWithParam>; + +TEST_P(FloatProxyParseOverflowFloat16Test, Sample) { + std::istringstream input(GetParam().input); + HexFloat> value(0); + input >> value; + EXPECT_NE(GetParam().expect_success, input.fail()) + << " literal: " << GetParam().input; + if (GetParam().expect_success) { + EXPECT_THAT(value.value().data(), Eq(GetParam().expected_value)) + << " literal: " << GetParam().input; + } +} + +INSTANTIATE_TEST_CASE_P( + Float16Overflow, FloatProxyParseOverflowFloat16Test, + ::testing::ValuesIn(std::vector>({ + {"0", true, uint16_t{0}}, + {"0.0", true, uint16_t{0}}, + {"1.0", true, uint16_t{0x3c00}}, + // Overflow for 16-bit float is an error, and returns max or + // lowest value. + {"1e38", false, uint16_t{0x7bff}}, + {"1e40", false, uint16_t{0x7bff}}, + {"1e400", false, uint16_t{0x7bff}}, + {"-1e38", false, uint16_t{0xfbff}}, + {"-1e40", false, uint16_t{0xfbff}}, + {"-1e400", false, uint16_t{0xfbff}}, + })), ); + +TEST(FloatProxy, Max) { + EXPECT_THAT(FloatProxy::max().getAsFloat().get_value(), + Eq(uint16_t{0x7bff})); + EXPECT_THAT(FloatProxy::max().getAsFloat(), + Eq(std::numeric_limits::max())); + EXPECT_THAT(FloatProxy::max().getAsFloat(), + Eq(std::numeric_limits::max())); +} + +TEST(FloatProxy, Lowest) { + EXPECT_THAT(FloatProxy::lowest().getAsFloat().get_value(), + Eq(uint16_t{0xfbff})); + EXPECT_THAT(FloatProxy::lowest().getAsFloat(), + Eq(std::numeric_limits::lowest())); + EXPECT_THAT(FloatProxy::lowest().getAsFloat(), + Eq(std::numeric_limits::lowest())); +} + +// TODO(awoloszyn): Add fp16 tests and HexFloatTraits. +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/huffman_codec.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/huffman_codec.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/huffman_codec.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/huffman_codec.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,315 @@ +// Copyright (c) 2017 Google 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. + +// Contains utils for reading, writing and debug printing bit streams. + +#include +#include +#include +#include + +#include "gmock/gmock.h" +#include "util/bit_stream.h" +#include "util/huffman_codec.h" + +namespace { + +using spvutils::BitsToStream; +using spvutils::HuffmanCodec; + +const std::map& GetTestSet() { + static const std::map hist = { + {"a", 4}, {"e", 7}, {"f", 3}, {"h", 2}, {"i", 3}, + {"m", 2}, {"n", 2}, {"s", 2}, {"t", 2}, {"l", 1}, + {"o", 2}, {"p", 1}, {"r", 1}, {"u", 1}, {"x", 1}, + }; + + return hist; +} + +class TestBitReader { + public: + TestBitReader(const std::string& bits) : bits_(bits) {} + + bool ReadBit(bool* bit) { + if (pos_ < bits_.length()) { + *bit = bits_[pos_++] == '0' ? false : true; + return true; + } + return false; + } + + private: + std::string bits_; + size_t pos_ = 0; +}; + +TEST(Huffman, PrintTree) { + HuffmanCodec huffman(GetTestSet()); + std::stringstream ss; + huffman.PrintTree(ss); + + // clang-format off + const std::string expected = std::string(R"( +15-----7------e + 8------4------a + 4------2------m + 2------n +19-----8------4------2------o + 2------s + 4------2------t + 2------1------l + 1------p + 11-----5------2------1------r + 1------u + 3------f + 6------3------i + 3------1------x + 2------h +)").substr(1); + // clang-format on + + EXPECT_EQ(expected, ss.str()); +} + +TEST(Huffman, PrintTable) { + HuffmanCodec huffman(GetTestSet()); + std::stringstream ss; + huffman.PrintTable(ss); + + const std::string expected = std::string(R"( +e 7 11 +a 4 101 +i 3 0001 +f 3 0010 +t 2 0101 +s 2 0110 +o 2 0111 +n 2 1000 +m 2 1001 +h 2 00000 +x 1 00001 +u 1 00110 +r 1 00111 +p 1 01000 +l 1 01001 +)") + .substr(1); + + EXPECT_EQ(expected, ss.str()); +} + +TEST(Huffman, TestValidity) { + HuffmanCodec huffman(GetTestSet()); + const auto& encoding_table = huffman.GetEncodingTable(); + std::vector codes; + for (const auto& entry : encoding_table) { + codes.push_back(BitsToStream(entry.second.first, entry.second.second)); + } + + std::sort(codes.begin(), codes.end()); + + ASSERT_LT(codes.size(), 20u) << "Inefficient test ahead"; + + for (size_t i = 0; i < codes.size(); ++i) { + for (size_t j = i + 1; j < codes.size(); ++j) { + ASSERT_FALSE(codes[i] == codes[j].substr(0, codes[i].length())) + << codes[i] << " is prefix of " << codes[j]; + } + } +} + +TEST(Huffman, TestEncode) { + HuffmanCodec huffman(GetTestSet()); + + uint64_t bits = 0; + size_t num_bits = 0; + + EXPECT_TRUE(huffman.Encode("e", &bits, &num_bits)); + EXPECT_EQ(2u, num_bits); + EXPECT_EQ("11", BitsToStream(bits, num_bits)); + + EXPECT_TRUE(huffman.Encode("a", &bits, &num_bits)); + EXPECT_EQ(3u, num_bits); + EXPECT_EQ("101", BitsToStream(bits, num_bits)); + + EXPECT_TRUE(huffman.Encode("x", &bits, &num_bits)); + EXPECT_EQ(5u, num_bits); + EXPECT_EQ("00001", BitsToStream(bits, num_bits)); + + EXPECT_FALSE(huffman.Encode("y", &bits, &num_bits)); +} + +TEST(Huffman, TestDecode) { + HuffmanCodec huffman(GetTestSet()); + TestBitReader bit_reader( + "01001" + "0001" + "1000" + "00110" + "00001" + "00"); + auto read_bit = [&bit_reader](bool* bit) { return bit_reader.ReadBit(bit); }; + + std::string decoded; + + ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); + EXPECT_EQ("l", decoded); + + ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); + EXPECT_EQ("i", decoded); + + ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); + EXPECT_EQ("n", decoded); + + ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); + EXPECT_EQ("u", decoded); + + ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); + EXPECT_EQ("x", decoded); + + ASSERT_FALSE(huffman.DecodeFromStream(read_bit, &decoded)); +} + +TEST(Huffman, TestDecodeNumbers) { + const std::map hist = {{1, 10}, {2, 5}, {3, 15}}; + HuffmanCodec huffman(hist); + + TestBitReader bit_reader( + "1" + "1" + "01" + "00" + "01" + "1"); + auto read_bit = [&bit_reader](bool* bit) { return bit_reader.ReadBit(bit); }; + + uint32_t decoded; + + ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); + EXPECT_EQ(3u, decoded); + + ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); + EXPECT_EQ(3u, decoded); + + ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); + EXPECT_EQ(2u, decoded); + + ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); + EXPECT_EQ(1u, decoded); + + ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); + EXPECT_EQ(2u, decoded); + + ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); + EXPECT_EQ(3u, decoded); +} + +TEST(Huffman, SerializeToTextU64) { + const std::map hist = {{1001, 10}, {1002, 5}, {1003, 15}}; + HuffmanCodec huffman(hist); + + const std::string code = huffman.SerializeToText(2); + + const std::string expected = R"((5, { + {0, 0, 0}, + {1001, 0, 0}, + {1002, 0, 0}, + {1003, 0, 0}, + {0, 1, 2}, + {0, 4, 3}, + }))"; + + ASSERT_EQ(expected, code); +} + +TEST(Huffman, SerializeToTextString) { + const std::map hist = { + {"aaa", 10}, {"bbb", 20}, {"ccc", 15}}; + HuffmanCodec huffman(hist); + + const std::string code = huffman.SerializeToText(4); + + const std::string expected = R"((5, { + {"", 0, 0}, + {"aaa", 0, 0}, + {"bbb", 0, 0}, + {"ccc", 0, 0}, + {"", 3, 1}, + {"", 4, 2}, + }))"; + + ASSERT_EQ(expected, code); +} + +TEST(Huffman, CreateFromTextString) { + std::vector::Node> nodes = { + {}, + {"root", 2, 3}, + {"left", 0, 0}, + {"right", 0, 0}, + }; + + HuffmanCodec huffman(1, std::move(nodes)); + + std::stringstream ss; + huffman.PrintTree(ss); + + const std::string expected = std::string(R"( +0------right +0------left +)") + .substr(1); + + EXPECT_EQ(expected, ss.str()); +} + +TEST(Huffman, CreateFromTextU64) { + HuffmanCodec huffman(5, { + {0, 0, 0}, + {1001, 0, 0}, + {1002, 0, 0}, + {1003, 0, 0}, + {0, 1, 2}, + {0, 4, 3}, + }); + + std::stringstream ss; + huffman.PrintTree(ss); + + const std::string expected = std::string(R"( +0------1003 +0------0------1002 + 0------1001 +)") + .substr(1); + + EXPECT_EQ(expected, ss.str()); + + TestBitReader bit_reader("01"); + auto read_bit = [&bit_reader](bool* bit) { return bit_reader.ReadBit(bit); }; + + uint64_t decoded = 0; + ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); + EXPECT_EQ(1002u, decoded); + + uint64_t bits = 0; + size_t num_bits = 0; + + EXPECT_TRUE(huffman.Encode(1001, &bits, &num_bits)); + EXPECT_EQ(2u, num_bits); + EXPECT_EQ("00", BitsToStream(bits, num_bits)); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/immediate_int_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/immediate_int_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/immediate_int_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/immediate_int_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,289 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include + +#include + +#include "source/util/bitutils.h" +#include "test_fixture.h" + +namespace { + +using spvtest::Concatenate; +using spvtest::MakeInstruction; +using spvtest::ScopedContext; +using spvtest::TextToBinaryTest; +using spvutils::BitwiseCast; +using ::testing::ElementsAre; +using ::testing::Eq; +using ::testing::HasSubstr; +using ::testing::StrEq; + +TEST_F(TextToBinaryTest, ImmediateIntOpCode) { + SetText("!0x00FF00FF"); + ASSERT_EQ(SPV_SUCCESS, spvTextToBinary(ScopedContext().context, text.str, + text.length, &binary, &diagnostic)); + EXPECT_EQ(0x00FF00FFu, binary->code[5]); + if (diagnostic) { + spvDiagnosticPrint(diagnostic); + } +} + +TEST_F(TextToBinaryTest, ImmediateIntOperand) { + SetText("OpCapability !0x00FF00FF"); + EXPECT_EQ(SPV_SUCCESS, spvTextToBinary(ScopedContext().context, text.str, + text.length, &binary, &diagnostic)); + EXPECT_EQ(0x00FF00FFu, binary->code[6]); + if (diagnostic) { + spvDiagnosticPrint(diagnostic); + } +} + +using ImmediateIntTest = TextToBinaryTest; + +TEST_F(ImmediateIntTest, AnyWordInSimpleStatement) { + EXPECT_THAT(CompiledInstructions("!0x00040018 %a %b %123"), + Eq(MakeInstruction(SpvOpTypeMatrix, {1, 2, 3}))); + EXPECT_THAT(CompiledInstructions("!0x00040018 !1 %b %123"), + Eq(MakeInstruction(SpvOpTypeMatrix, {1, 1, 2}))); + EXPECT_THAT(CompiledInstructions("%a = OpTypeMatrix !2 %123"), + Eq(MakeInstruction(SpvOpTypeMatrix, {1, 2, 2}))); + EXPECT_THAT(CompiledInstructions("%a = OpTypeMatrix %b !123"), + Eq(MakeInstruction(SpvOpTypeMatrix, {1, 2, 123}))); + EXPECT_THAT(CompiledInstructions("!0x00040018 %a !2 %123"), + Eq(MakeInstruction(SpvOpTypeMatrix, {1, 2, 2}))); + EXPECT_THAT(CompiledInstructions("!0x00040018 !1 %b !123"), + Eq(MakeInstruction(SpvOpTypeMatrix, {1, 1, 123}))); + EXPECT_THAT(CompiledInstructions("!0x00040018 !1 !2 !123"), + Eq(MakeInstruction(SpvOpTypeMatrix, {1, 2, 123}))); +} + +TEST_F(ImmediateIntTest, AnyWordAfterEqualsAndOpCode) { + EXPECT_THAT(CompiledInstructions("%a = OpArrayLength !2 %c 123"), + Eq(MakeInstruction(SpvOpArrayLength, {2, 1, 2, 123}))); + EXPECT_THAT(CompiledInstructions("%a = OpArrayLength %b !3 123"), + Eq(MakeInstruction(SpvOpArrayLength, {1, 2, 3, 123}))); + EXPECT_THAT(CompiledInstructions("%a = OpArrayLength %b %c !123"), + Eq(MakeInstruction(SpvOpArrayLength, {1, 2, 3, 123}))); + EXPECT_THAT(CompiledInstructions("%a = OpArrayLength %b !3 !123"), + Eq(MakeInstruction(SpvOpArrayLength, {1, 2, 3, 123}))); + EXPECT_THAT(CompiledInstructions("%a = OpArrayLength !2 !3 123"), + Eq(MakeInstruction(SpvOpArrayLength, {2, 1, 3, 123}))); + EXPECT_THAT(CompiledInstructions("%a = OpArrayLength !2 !3 !123"), + Eq(MakeInstruction(SpvOpArrayLength, {2, 1, 3, 123}))); +} + +TEST_F(ImmediateIntTest, ResultIdInAssignment) { + EXPECT_EQ("!2 not allowed before =.", + CompileFailure("!2 = OpArrayLength %12 %1 123")); + EXPECT_EQ("!2 not allowed before =.", + CompileFailure("!2 = !0x00040044 %12 %1 123")); +} + +TEST_F(ImmediateIntTest, OpCodeInAssignment) { + EXPECT_EQ("Invalid Opcode prefix '!0x00040044'.", + CompileFailure("%2 = !0x00040044 %12 %1 123")); +} + +// Literal integers after ! are handled correctly. +TEST_F(ImmediateIntTest, IntegerFollowingImmediate) { + const SpirvVector original = CompiledInstructions("%1 = OpTypeInt 8 1"); + EXPECT_EQ(original, CompiledInstructions("!0x00040015 1 8 1")); + EXPECT_EQ(original, CompiledInstructions("!0x00040015 !1 8 1")); + + // With !, we can (and can only) accept 32-bit number literals, + // even when we declare the return type is 64-bit. + EXPECT_EQ(Concatenate({ + MakeInstruction(SpvOpTypeInt, {1, 64, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 4294967295}), + }), + CompiledInstructions("%i64 = OpTypeInt 64 0\n" + "!0x0004002b %i64 !2 4294967295")); + // 64-bit integer literal. + EXPECT_EQ("Invalid word following !: 5000000000", + CompileFailure("%2 = OpConstant !1 5000000000")); + EXPECT_EQ("Invalid word following !: 5000000000", + CompileFailure("%i64 = OpTypeInt 64 0\n" + "!0x0005002b %i64 !2 5000000000")); + + // Negative integer. + EXPECT_EQ(CompiledInstructions("%i64 = OpTypeInt 32 1\n" + "%2 = OpConstant %i64 -123"), + CompiledInstructions("%i64 = OpTypeInt 32 1\n" + "!0x0004002b %i64 !2 -123")); + + // TODO(deki): uncomment assertions below and make them pass. + // Hex value(s). + // EXPECT_EQ(CompileSuccessfully("%1 = OpConstant %10 0x12345678"), + // CompileSuccessfully("OpConstant %10 !1 0x12345678", kCAF)); + // EXPECT_EQ( + // CompileSuccessfully("%1 = OpConstant %10 0x12345678 0x87654321"), + // CompileSuccessfully("OpConstant %10 !1 0x12345678 0x87654321", kCAF)); +} + +// Literal floats after ! are handled correctly. +TEST_F(ImmediateIntTest, FloatFollowingImmediate) { + EXPECT_EQ( + CompiledInstructions("%1 = OpTypeFloat 32\n%2 = OpConstant %1 0.123"), + CompiledInstructions("%1 = OpTypeFloat 32\n!0x0004002b %1 !2 0.123")); + EXPECT_EQ( + CompiledInstructions("%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0.5"), + CompiledInstructions("%1 = OpTypeFloat 32\n!0x0004002b %1 !2 -0.5")); + EXPECT_EQ( + CompiledInstructions("%1 = OpTypeFloat 32\n%2 = OpConstant %1 0.123"), + CompiledInstructions("%1 = OpTypeFloat 32\n!0x0004002b %1 %2 0.123")); + EXPECT_EQ( + CompiledInstructions("%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0.5"), + CompiledInstructions("%1 = OpTypeFloat 32\n!0x0004002b %1 %2 -0.5")); + + EXPECT_EQ(Concatenate({ + MakeInstruction(SpvOpTypeInt, {1, 64, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 0xb, 0xa}), + MakeInstruction(SpvOpSwitch, + {2, 1234, BitwiseCast(2.5f), 3}), + }), + CompiledInstructions("%i64 = OpTypeInt 64 0\n" + "%big = OpConstant %i64 0xa0000000b\n" + "OpSwitch %big !1234 2.5 %target\n")); +} + +// Literal strings after ! are handled correctly. +TEST_F(ImmediateIntTest, StringFollowingImmediate) { + // Try a variety of strings, including empty and single-character. + for (std::string name : {"", "s", "longish", "really looooooooooooooooong"}) { + const SpirvVector original = + CompiledInstructions("OpMemberName %10 4 \"" + name + "\""); + EXPECT_EQ(original, + CompiledInstructions("OpMemberName %10 !4 \"" + name + "\"")) + << name; + EXPECT_EQ(original, + CompiledInstructions("OpMemberName !1 !4 \"" + name + "\"")) + << name; + const uint16_t wordCount = static_cast(4 + name.size() / 4); + const uint32_t firstWord = spvOpcodeMake(wordCount, SpvOpMemberName); + EXPECT_EQ(original, CompiledInstructions("!" + std::to_string(firstWord) + + " %10 !4 \"" + name + "\"")) + << name; + } +} + +// IDs after ! are handled correctly. +TEST_F(ImmediateIntTest, IdFollowingImmediate) { + EXPECT_EQ(CompileSuccessfully("%123 = OpDecorationGroup"), + CompileSuccessfully("!0x00020049 %123")); + EXPECT_EQ(CompileSuccessfully("%group = OpDecorationGroup"), + CompileSuccessfully("!0x00020049 %group")); +} + +// ! after ! is handled correctly. +TEST_F(ImmediateIntTest, ImmediateFollowingImmediate) { + const SpirvVector original = CompiledInstructions("%a = OpTypeMatrix %b 7"); + EXPECT_EQ(original, CompiledInstructions("%a = OpTypeMatrix !2 !7")); + EXPECT_EQ(original, CompiledInstructions("!0x00040018 %a !2 !7")); +} + +TEST_F(ImmediateIntTest, InvalidStatement) { + EXPECT_THAT(Subvector(CompileSuccessfully("!4 !3 !2 !1"), kFirstInstruction), + ElementsAre(4, 3, 2, 1)); +} + +TEST_F(ImmediateIntTest, InvalidStatementBetweenValidOnes) { + EXPECT_THAT(Subvector(CompileSuccessfully( + "%10 = OpTypeFloat 32 !5 !6 !7 OpEmitVertex"), + kFirstInstruction), + ElementsAre(spvOpcodeMake(3, SpvOpTypeFloat), 1, 32, 5, 6, 7, + spvOpcodeMake(1, SpvOpEmitVertex))); +} + +TEST_F(ImmediateIntTest, NextOpcodeRecognized) { + const SpirvVector original = CompileSuccessfully(R"( +%1 = OpLoad %10 %2 Volatile +%4 = OpCompositeInsert %11 %1 %3 0 1 2 +)"); + const SpirvVector alternate = CompileSuccessfully(R"( +%1 = OpLoad %10 %2 !1 +%4 = OpCompositeInsert %11 %1 %3 0 1 2 +)"); + EXPECT_EQ(original, alternate); +} + +TEST_F(ImmediateIntTest, WrongLengthButNextOpcodeStillRecognized) { + const SpirvVector original = CompileSuccessfully(R"( +%1 = OpLoad %10 %2 Volatile +OpCopyMemorySized %3 %4 %1 +)"); + const SpirvVector alternate = CompileSuccessfully(R"( +!0x0002003D %10 %1 %2 !1 +OpCopyMemorySized %3 %4 %1 +)"); + EXPECT_EQ(0x0002003Du, alternate[kFirstInstruction]); + EXPECT_EQ(Subvector(original, kFirstInstruction + 1), + Subvector(alternate, kFirstInstruction + 1)); +} + +// Like NextOpcodeRecognized, but next statement is in assignment form. +TEST_F(ImmediateIntTest, NextAssignmentRecognized) { + const SpirvVector original = CompileSuccessfully(R"( +%1 = OpLoad %10 %2 None +%4 = OpFunctionCall %10 %3 %123 +)"); + const SpirvVector alternate = CompileSuccessfully(R"( +%1 = OpLoad %10 %2 !0 +%4 = OpFunctionCall %10 %3 %123 +)"); + EXPECT_EQ(original, alternate); +} + +// Two instructions in a row each have ! opcode. +TEST_F(ImmediateIntTest, ConsecutiveImmediateOpcodes) { + const SpirvVector original = CompileSuccessfully(R"( +%1 = OpConstantSampler %10 Clamp 78 Linear +%4 = OpFRem %11 %3 %2 +%5 = OpIsValidEvent %12 %2 +)"); + const SpirvVector alternate = CompileSuccessfully(R"( +!0x0006002D %10 %1 !2 78 !1 +!0x0005008C %11 %4 %3 %2 +%5 = OpIsValidEvent %12 %2 +)"); + EXPECT_EQ(original, alternate); +} + +// ! followed by, eg, an enum or '=' or a random bareword. +TEST_F(ImmediateIntTest, ForbiddenOperands) { + EXPECT_THAT(CompileFailure("OpMemoryModel !0 OpenCL"), HasSubstr("OpenCL")); + EXPECT_THAT(CompileFailure("!1 %0 = !2"), HasSubstr("=")); + EXPECT_THAT(CompileFailure("OpMemoryModel !0 random_bareword"), + HasSubstr("random_bareword")); + // Immediate integers longer than one 32-bit word. + EXPECT_THAT(CompileFailure("!5000000000"), HasSubstr("5000000000")); + EXPECT_THAT(CompileFailure("!999999999999999999"), + HasSubstr("999999999999999999")); + EXPECT_THAT(CompileFailure("!0x00020049 !5000000000"), + HasSubstr("5000000000")); + // Negative numbers. + EXPECT_THAT(CompileFailure("!0x00020049 !-123"), HasSubstr("-123")); +} + +TEST_F(ImmediateIntTest, NotInteger) { + EXPECT_THAT(CompileFailure("!abc"), StrEq("Invalid immediate integer: !abc")); + EXPECT_THAT(CompileFailure("!12.3"), + StrEq("Invalid immediate integer: !12.3")); + EXPECT_THAT(CompileFailure("!12K"), StrEq("Invalid immediate integer: !12K")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/libspirv_macros_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/libspirv_macros_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/libspirv_macros_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/libspirv_macros_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,23 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +namespace { + +TEST(Macros, BitShiftInnerParens) { ASSERT_EQ(65536, SPV_BIT(2 << 3)); } + +TEST(Macros, BitShiftOuterParens) { ASSERT_EQ(15, SPV_BIT(4) - 1); } + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/binary_version_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/binary_version_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/binary_version_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/binary_version_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,56 @@ +// Copyright (c) 2017 Pierre Moreau +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "gmock/gmock.h" +#include "linker_fixture.h" + +namespace { + +using BinaryVersion = spvtest::LinkerTest; + +TEST_F(BinaryVersion, LinkerChoosesMaxSpirvVersion) { + // clang-format off + spvtest::Binaries binaries = { + { + SpvMagicNumber, + 0x00000300u, + SPV_GENERATOR_CODEPLAY, + 1u, // NOTE: Bound + 0u // NOTE: Schema; reserved + }, + { + SpvMagicNumber, + 0x00000600u, + SPV_GENERATOR_CODEPLAY, + 1u, // NOTE: Bound + 0u // NOTE: Schema; reserved + }, + { + SpvMagicNumber, + 0x00000100u, + SPV_GENERATOR_CODEPLAY, + 1u, // NOTE: Bound + 0u // NOTE: Schema; reserved + } + }; + // clang-format on + spvtest::Binary linked_binary; + + ASSERT_EQ(SPV_SUCCESS, Link(binaries, &linked_binary)); + EXPECT_THAT(GetErrorMessage(), std::string()); + + EXPECT_EQ(0x00000600u, linked_binary[1]); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,53 @@ +# Copyright (c) 2017 Pierre Moreau +# +# 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. + +add_spvtools_unittest(TARGET link_binary_version + SRCS binary_version_test.cpp + LIBS SPIRV-Tools-opt SPIRV-Tools-link +) + +add_spvtools_unittest(TARGET link_memory_model + SRCS memory_model_test.cpp + LIBS SPIRV-Tools-opt SPIRV-Tools-link +) + +add_spvtools_unittest(TARGET link_entry_points + SRCS entry_points_test.cpp + LIBS SPIRV-Tools-opt SPIRV-Tools-link +) + +add_spvtools_unittest(TARGET link_global_values_amount + SRCS global_values_amount_test.cpp + LIBS SPIRV-Tools-opt SPIRV-Tools-link +) + +add_spvtools_unittest(TARGET link_ids_limit + SRCS ids_limit_test.cpp + LIBS SPIRV-Tools-opt SPIRV-Tools-link +) + +add_spvtools_unittest(TARGET link_matching_imports_to_exports + SRCS matching_imports_to_exports_test.cpp + LIBS SPIRV-Tools-opt SPIRV-Tools-link +) + +add_spvtools_unittest(TARGET link_unique_ids + SRCS unique_ids_test.cpp + LIBS SPIRV-Tools-opt SPIRV-Tools-link +) + +add_spvtools_unittest(TARGET link_partial_linkage + SRCS partial_linkage_test.cpp + LIBS SPIRV-Tools-opt SPIRV-Tools-link +) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/entry_points_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/entry_points_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/entry_points_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/entry_points_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,90 @@ +// Copyright (c) 2017 Pierre Moreau +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "gmock/gmock.h" +#include "linker_fixture.h" + +namespace { + +using ::testing::HasSubstr; + +class EntryPoints : public spvtest::LinkerTest {}; + +TEST_F(EntryPoints, SameModelDifferentName) { + const std::string body1 = R"( +OpEntryPoint GLCompute %3 "foo" +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpFunction %1 None %2 +OpFunctionEnd +)"; + const std::string body2 = R"( +OpEntryPoint GLCompute %3 "bar" +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpFunction %1 None %2 +OpFunctionEnd +)"; + + spvtest::Binary linked_binary; + EXPECT_EQ(SPV_SUCCESS, AssembleAndLink({body1, body2}, &linked_binary)); + EXPECT_THAT(GetErrorMessage(), std::string()); +} + +TEST_F(EntryPoints, DifferentModelSameName) { + const std::string body1 = R"( +OpEntryPoint GLCompute %3 "foo" +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpFunction %1 None %2 +OpFunctionEnd +)"; + const std::string body2 = R"( +OpEntryPoint Vertex %3 "foo" +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpFunction %1 None %2 +OpFunctionEnd +)"; + + spvtest::Binary linked_binary; + EXPECT_EQ(SPV_SUCCESS, AssembleAndLink({body1, body2}, &linked_binary)); + EXPECT_THAT(GetErrorMessage(), std::string()); +} + +TEST_F(EntryPoints, SameModelAndName) { + const std::string body1 = R"( +OpEntryPoint GLCompute %3 "foo" +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpFunction %1 None %2 +OpFunctionEnd +)"; + const std::string body2 = R"( +OpEntryPoint GLCompute %3 "foo" +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpFunction %1 None %2 +OpFunctionEnd +)"; + + spvtest::Binary linked_binary; + EXPECT_EQ(SPV_ERROR_INTERNAL, + AssembleAndLink({body1, body2}, &linked_binary)); + EXPECT_THAT(GetErrorMessage(), + HasSubstr("The entry point \"foo\", with execution model " + "GLCompute, was already defined.")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/global_values_amount_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/global_values_amount_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/global_values_amount_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/global_values_amount_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,149 @@ +// Copyright (c) 2017 Pierre Moreau +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "gmock/gmock.h" +#include "linker_fixture.h" + +namespace { + +using ::testing::HasSubstr; + +class EntryPoints : public spvtest::LinkerTest { + public: + EntryPoints() { binaries.reserve(0xFFFF); } + + virtual void SetUp() override { + binaries.push_back({SpvMagicNumber, + SpvVersion, + SPV_GENERATOR_CODEPLAY, + 10u, // NOTE: Bound + 0u, // NOTE: Schema; reserved + + 3u << SpvWordCountShift | SpvOpTypeFloat, + 1u, // NOTE: Result ID + 32u, // NOTE: Width + + 4u << SpvWordCountShift | SpvOpTypePointer, + 2u, // NOTE: Result ID + SpvStorageClassInput, + 1u, // NOTE: Type ID + + 2u << SpvWordCountShift | SpvOpTypeVoid, + 3u, // NOTE: Result ID + + 3u << SpvWordCountShift | SpvOpTypeFunction, + 4u, // NOTE: Result ID + 3u, // NOTE: Return type + + 5u << SpvWordCountShift | SpvOpFunction, + 3u, // NOTE: Result type + 5u, // NOTE: Result ID + SpvFunctionControlMaskNone, + 4u, // NOTE: Function type + + 2u << SpvWordCountShift | SpvOpLabel, + 6u, // NOTE: Result ID + + 4u << SpvWordCountShift | SpvOpVariable, + 2u, // NOTE: Type ID + 7u, // NOTE: Result ID + SpvStorageClassFunction, + + 4u << SpvWordCountShift | SpvOpVariable, + 2u, // NOTE: Type ID + 8u, // NOTE: Result ID + SpvStorageClassFunction, + + 4u << SpvWordCountShift | SpvOpVariable, + 2u, // NOTE: Type ID + 9u, // NOTE: Result ID + SpvStorageClassFunction, + + 1u << SpvWordCountShift | SpvOpReturn, + + 1u << SpvWordCountShift | SpvOpFunctionEnd}); + for (size_t i = 0u; i < 2u; ++i) { + spvtest::Binary binary = { + SpvMagicNumber, + SpvVersion, + SPV_GENERATOR_CODEPLAY, + 103u, // NOTE: Bound + 0u, // NOTE: Schema; reserved + + 3u << SpvWordCountShift | SpvOpTypeFloat, + 1u, // NOTE: Result ID + 32u, // NOTE: Width + + 4u << SpvWordCountShift | SpvOpTypePointer, + 2u, // NOTE: Result ID + SpvStorageClassInput, + 1u // NOTE: Type ID + }; + + for (uint32_t j = 0u; j < 0xFFFFu / 2u; ++j) { + binary.push_back(4u << SpvWordCountShift | SpvOpVariable); + binary.push_back(2u); // NOTE: Type ID + binary.push_back(j + 3u); // NOTE: Result ID + binary.push_back(SpvStorageClassInput); + } + binaries.push_back(binary); + } + } + virtual void TearDown() override { binaries.clear(); } + + spvtest::Binaries binaries; +}; + +TEST_F(EntryPoints, UnderLimit) { + spvtest::Binary linked_binary; + + EXPECT_EQ(SPV_SUCCESS, Link(binaries, &linked_binary)); + EXPECT_THAT(GetErrorMessage(), std::string()); +} + +TEST_F(EntryPoints, OverLimit) { + binaries.push_back({SpvMagicNumber, + SpvVersion, + SPV_GENERATOR_CODEPLAY, + 5u, // NOTE: Bound + 0u, // NOTE: Schema; reserved + + 3u << SpvWordCountShift | SpvOpTypeFloat, + 1u, // NOTE: Result ID + 32u, // NOTE: Width + + 4u << SpvWordCountShift | SpvOpTypePointer, + 2u, // NOTE: Result ID + SpvStorageClassInput, + 1u, // NOTE: Type ID + + 4u << SpvWordCountShift | SpvOpVariable, + 2u, // NOTE: Type ID + 3u, // NOTE: Result ID + SpvStorageClassInput, + + 4u << SpvWordCountShift | SpvOpVariable, + 2u, // NOTE: Type ID + 4u, // NOTE: Result ID + SpvStorageClassInput}); + + spvtest::Binary linked_binary; + + EXPECT_EQ(SPV_ERROR_INTERNAL, Link(binaries, &linked_binary)); + EXPECT_THAT(GetErrorMessage(), + HasSubstr("The limit of global values, 65535, was exceeded; " + "65536 global values were found.")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/ids_limit_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/ids_limit_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/ids_limit_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/ids_limit_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2017 Pierre Moreau +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "gmock/gmock.h" +#include "linker_fixture.h" + +namespace { + +using ::testing::HasSubstr; + +using IdsLimit = spvtest::LinkerTest; + +TEST_F(IdsLimit, UnderLimit) { + spvtest::Binaries binaries = { + { + SpvMagicNumber, SpvVersion, SPV_GENERATOR_CODEPLAY, + 0x2FFFFFu, // NOTE: Bound + 0u, // NOTE: Schema; reserved + }, + { + SpvMagicNumber, SpvVersion, SPV_GENERATOR_CODEPLAY, + 0x100000u, // NOTE: Bound + 0u, // NOTE: Schema; reserved + }}; + spvtest::Binary linked_binary; + + ASSERT_EQ(SPV_SUCCESS, Link(binaries, &linked_binary)); + EXPECT_THAT(GetErrorMessage(), std::string()); + EXPECT_EQ(0x3FFFFEu, linked_binary[3]); +} + +TEST_F(IdsLimit, OverLimit) { + spvtest::Binaries binaries = { + { + SpvMagicNumber, SpvVersion, SPV_GENERATOR_CODEPLAY, + 0x2FFFFFu, // NOTE: Bound + 0u, // NOTE: Schema; reserved + }, + { + SpvMagicNumber, SpvVersion, SPV_GENERATOR_CODEPLAY, + 0x100000u, // NOTE: Bound + 0u, // NOTE: Schema; reserved + }, + { + SpvMagicNumber, SpvVersion, SPV_GENERATOR_CODEPLAY, + 3u, // NOTE: Bound + 0u, // NOTE: Schema; reserved + }}; + + spvtest::Binary linked_binary; + + EXPECT_EQ(SPV_ERROR_INVALID_ID, Link(binaries, &linked_binary)); + EXPECT_THAT(GetErrorMessage(), + HasSubstr("The limit of IDs, 4194303, was exceeded: 4194304 is " + "the current ID bound.")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/linker_fixture.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/linker_fixture.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/linker_fixture.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/linker_fixture.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,124 @@ +// Copyright (c) 2017 Pierre Moreau +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_TEST_LINK_LINK_TEST +#define LIBSPIRV_TEST_LINK_LINK_TEST + +#include + +#include "source/spirv_constant.h" +#include "unit_spirv.h" + +#include "spirv-tools/linker.hpp" + +namespace spvtest { + +using Binary = std::vector; +using Binaries = std::vector; + +class LinkerTest : public ::testing::Test { + public: + LinkerTest() + : context_(SPV_ENV_UNIVERSAL_1_2), + tools_(SPV_ENV_UNIVERSAL_1_2), + assemble_options_(spvtools::SpirvTools::kDefaultAssembleOption), + disassemble_options_(spvtools::SpirvTools::kDefaultDisassembleOption) { + const auto consumer = [this](spv_message_level_t level, const char*, + const spv_position_t& position, + const char* message) { + if (!error_message_.empty()) error_message_ += "\n"; + switch (level) { + case SPV_MSG_FATAL: + case SPV_MSG_INTERNAL_ERROR: + case SPV_MSG_ERROR: + error_message_ += "ERROR"; + break; + case SPV_MSG_WARNING: + error_message_ += "WARNING"; + break; + case SPV_MSG_INFO: + error_message_ += "INFO"; + break; + case SPV_MSG_DEBUG: + error_message_ += "DEBUG"; + break; + } + error_message_ += ": " + std::to_string(position.index) + ": " + message; + }; + context_.SetMessageConsumer(consumer); + tools_.SetMessageConsumer(consumer); + } + + virtual void TearDown() override { error_message_.clear(); } + + // Assembles each of the given strings into SPIR-V binaries before linking + // them together. SPV_ERROR_INVALID_TEXT is returned if the assembling failed + // for any of the input strings, and SPV_ERROR_INVALID_POINTER if + // |linked_binary| is a null pointer. + spv_result_t AssembleAndLink( + const std::vector& bodies, spvtest::Binary* linked_binary, + spvtools::LinkerOptions options = spvtools::LinkerOptions()) { + if (!linked_binary) return SPV_ERROR_INVALID_POINTER; + + spvtest::Binaries binaries(bodies.size()); + for (size_t i = 0u; i < bodies.size(); ++i) + if (!tools_.Assemble(bodies[i], binaries.data() + i, assemble_options_)) + return SPV_ERROR_INVALID_TEXT; + + return spvtools::Link(context_, binaries, linked_binary, options); + } + + // Links the given SPIR-V binaries together; SPV_ERROR_INVALID_POINTER is + // returned if |linked_binary| is a null pointer. + spv_result_t Link( + const spvtest::Binaries& binaries, spvtest::Binary* linked_binary, + spvtools::LinkerOptions options = spvtools::LinkerOptions()) { + if (!linked_binary) return SPV_ERROR_INVALID_POINTER; + return spvtools::Link(context_, binaries, linked_binary, options); + } + + // Disassembles |binary| and outputs the result in |text|. If |text| is a + // null pointer, SPV_ERROR_INVALID_POINTER is returned. + spv_result_t Disassemble(const spvtest::Binary& binary, std::string* text) { + if (!text) return SPV_ERROR_INVALID_POINTER; + return tools_.Disassemble(binary, text, disassemble_options_) + ? SPV_SUCCESS + : SPV_ERROR_INVALID_BINARY; + } + + // Sets the options for the assembler. + void SetAssembleOptions(uint32_t assemble_options) { + assemble_options_ = assemble_options; + } + + // Sets the options used by the disassembler. + void SetDisassembleOptions(uint32_t disassemble_options) { + disassemble_options_ = disassemble_options; + } + + // Returns the accumulated error messages for the test. + std::string GetErrorMessage() const { return error_message_; } + + private: + spvtools::Context context_; + spvtools::SpirvTools + tools_; // An instance for calling SPIRV-Tools functionalities. + uint32_t assemble_options_; + uint32_t disassemble_options_; + std::string error_message_; +}; + +} // namespace spvtest + +#endif // LIBSPIRV_TEST_LINK_LINK_TEST diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/matching_imports_to_exports_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/matching_imports_to_exports_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/matching_imports_to_exports_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/matching_imports_to_exports_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,399 @@ +// Copyright (c) 2017 Pierre Moreau +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "gmock/gmock.h" +#include "linker_fixture.h" + +namespace { + +using ::testing::HasSubstr; +using MatchingImportsToExports = spvtest::LinkerTest; + +TEST_F(MatchingImportsToExports, Default) { + const std::string body1 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Import +%2 = OpTypeFloat 32 +%1 = OpVariable %2 Uniform +%3 = OpVariable %2 Input +)"; + const std::string body2 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Export +%2 = OpTypeFloat 32 +%3 = OpConstant %2 42 +%1 = OpVariable %2 Uniform %3 +)"; + + spvtest::Binary linked_binary; + EXPECT_EQ(SPV_SUCCESS, AssembleAndLink({body1, body2}, &linked_binary)) + << GetErrorMessage(); + + const std::string expected_res = + R"(OpModuleProcessed "Linked by SPIR-V Tools Linker" +%1 = OpTypeFloat 32 +%2 = OpVariable %1 Input +%3 = OpConstant %1 42 +%4 = OpVariable %1 Uniform %3 +)"; + std::string res_body; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + EXPECT_EQ(SPV_SUCCESS, Disassemble(linked_binary, &res_body)) + << GetErrorMessage(); + EXPECT_EQ(expected_res, res_body); +} + +TEST_F(MatchingImportsToExports, NotALibraryExtraExports) { + const std::string body = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Export +%2 = OpTypeFloat 32 +%1 = OpVariable %2 Uniform +)"; + + spvtest::Binary linked_binary; + EXPECT_EQ(SPV_SUCCESS, AssembleAndLink({body}, &linked_binary)) + << GetErrorMessage(); + + const std::string expected_res = + R"(OpModuleProcessed "Linked by SPIR-V Tools Linker" +%1 = OpTypeFloat 32 +%2 = OpVariable %1 Uniform +)"; + std::string res_body; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + EXPECT_EQ(SPV_SUCCESS, Disassemble(linked_binary, &res_body)) + << GetErrorMessage(); + EXPECT_EQ(expected_res, res_body); +} + +TEST_F(MatchingImportsToExports, LibraryExtraExports) { + const std::string body = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Export +%2 = OpTypeFloat 32 +%1 = OpVariable %2 Uniform +)"; + + spvtest::Binary linked_binary; + spvtools::LinkerOptions options; + options.SetCreateLibrary(true); + EXPECT_EQ(SPV_SUCCESS, AssembleAndLink({body}, &linked_binary, options)) + << GetErrorMessage(); + + const std::string expected_res = R"(OpCapability Linkage +OpModuleProcessed "Linked by SPIR-V Tools Linker" +OpDecorate %1 LinkageAttributes "foo" Export +%2 = OpTypeFloat 32 +%1 = OpVariable %2 Uniform +)"; + std::string res_body; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + EXPECT_EQ(SPV_SUCCESS, Disassemble(linked_binary, &res_body)) + << GetErrorMessage(); + EXPECT_EQ(expected_res, res_body); +} + +TEST_F(MatchingImportsToExports, UnresolvedImports) { + const std::string body1 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Import +%2 = OpTypeFloat 32 +%1 = OpVariable %2 Uniform +)"; + const std::string body2 = R"()"; + + spvtest::Binary linked_binary; + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, + AssembleAndLink({body1, body2}, &linked_binary)); + EXPECT_THAT(GetErrorMessage(), + HasSubstr("Unresolved external reference to \"foo\".")); +} + +TEST_F(MatchingImportsToExports, TypeMismatch) { + const std::string body1 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Import +%2 = OpTypeFloat 32 +%1 = OpVariable %2 Uniform +%3 = OpVariable %2 Input +)"; + const std::string body2 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Export +%2 = OpTypeInt 32 0 +%3 = OpConstant %2 42 +%1 = OpVariable %2 Uniform %3 +)"; + + spvtest::Binary linked_binary; + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, + AssembleAndLink({body1, body2}, &linked_binary)) + << GetErrorMessage(); + EXPECT_THAT( + GetErrorMessage(), + HasSubstr("Type mismatch on symbol \"foo\" between imported " + "variable/function %1 and exported variable/function %4")); +} + +TEST_F(MatchingImportsToExports, MultipleDefinitions) { + const std::string body1 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Import +%2 = OpTypeFloat 32 +%1 = OpVariable %2 Uniform +%3 = OpVariable %2 Input +)"; + const std::string body2 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Export +%2 = OpTypeFloat 32 +%3 = OpConstant %2 42 +%1 = OpVariable %2 Uniform %3 +)"; + const std::string body3 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Export +%2 = OpTypeFloat 32 +%3 = OpConstant %2 -1 +%1 = OpVariable %2 Uniform %3 +)"; + + spvtest::Binary linked_binary; + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, + AssembleAndLink({body1, body2, body3}, &linked_binary)) + << GetErrorMessage(); + EXPECT_THAT(GetErrorMessage(), + HasSubstr("Too many external references, 2, were found " + "for \"foo\".")); +} + +TEST_F(MatchingImportsToExports, SameNameDifferentTypes) { + const std::string body1 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Import +%2 = OpTypeFloat 32 +%1 = OpVariable %2 Uniform +%3 = OpVariable %2 Input +)"; + const std::string body2 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Export +%2 = OpTypeInt 32 0 +%3 = OpConstant %2 42 +%1 = OpVariable %2 Uniform %3 +)"; + const std::string body3 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Export +%2 = OpTypeFloat 32 +%3 = OpConstant %2 12 +%1 = OpVariable %2 Uniform %3 +)"; + + spvtest::Binary linked_binary; + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, + AssembleAndLink({body1, body2, body3}, &linked_binary)) + << GetErrorMessage(); + EXPECT_THAT(GetErrorMessage(), + HasSubstr("Too many external references, 2, were found " + "for \"foo\".")); +} + +TEST_F(MatchingImportsToExports, DecorationMismatch) { + const std::string body1 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Import +OpDecorate %2 Constant +%2 = OpTypeFloat 32 +%1 = OpVariable %2 Uniform +%3 = OpVariable %2 Input +)"; + const std::string body2 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Export +%2 = OpTypeFloat 32 +%3 = OpConstant %2 42 +%1 = OpVariable %2 Uniform %3 +)"; + + spvtest::Binary linked_binary; + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, + AssembleAndLink({body1, body2}, &linked_binary)) + << GetErrorMessage(); + EXPECT_THAT( + GetErrorMessage(), + HasSubstr("Type mismatch on symbol \"foo\" between imported " + "variable/function %1 and exported variable/function %4")); +} + +TEST_F(MatchingImportsToExports, + FuncParamAttrDifferButStillMatchExportToImport) { + const std::string body1 = R"( +OpCapability Kernel +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Import +OpDecorate %2 FuncParamAttr Zext +%3 = OpTypeVoid +%4 = OpTypeInt 32 0 +%5 = OpTypeFunction %3 %4 +%1 = OpFunction %3 None %5 +%2 = OpFunctionParameter %4 +OpFunctionEnd +)"; + const std::string body2 = R"( +OpCapability Kernel +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Export +OpDecorate %2 FuncParamAttr Sext +%3 = OpTypeVoid +%4 = OpTypeInt 32 0 +%5 = OpTypeFunction %3 %4 +%1 = OpFunction %3 None %5 +%2 = OpFunctionParameter %4 +%6 = OpLabel +OpReturn +OpFunctionEnd +)"; + + spvtest::Binary linked_binary; + EXPECT_EQ(SPV_SUCCESS, AssembleAndLink({body1, body2}, &linked_binary)) + << GetErrorMessage(); + + const std::string expected_res = R"(OpCapability Kernel +OpModuleProcessed "Linked by SPIR-V Tools Linker" +OpDecorate %1 FuncParamAttr Sext +%2 = OpTypeVoid +%3 = OpTypeInt 32 0 +%4 = OpTypeFunction %2 %3 +%5 = OpFunction %2 None %4 +%1 = OpFunctionParameter %3 +%6 = OpLabel +OpReturn +OpFunctionEnd +)"; + std::string res_body; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + EXPECT_EQ(SPV_SUCCESS, Disassemble(linked_binary, &res_body)) + << GetErrorMessage(); + EXPECT_EQ(expected_res, res_body); +} + +TEST_F(MatchingImportsToExports, FunctionCtrl) { + const std::string body1 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Import +%2 = OpTypeVoid +%3 = OpTypeFunction %2 +%4 = OpTypeFloat 32 +%5 = OpVariable %4 Uniform +%1 = OpFunction %2 None %3 +OpFunctionEnd +)"; + const std::string body2 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Export +%2 = OpTypeVoid +%3 = OpTypeFunction %2 +%1 = OpFunction %2 Inline %3 +%4 = OpLabel +OpReturn +OpFunctionEnd +)"; + + spvtest::Binary linked_binary; + EXPECT_EQ(SPV_SUCCESS, AssembleAndLink({body1, body2}, &linked_binary)) + << GetErrorMessage(); + + const std::string expected_res = + R"(OpModuleProcessed "Linked by SPIR-V Tools Linker" +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpTypeFloat 32 +%4 = OpVariable %3 Uniform +%5 = OpFunction %1 Inline %2 +%6 = OpLabel +OpReturn +OpFunctionEnd +)"; + std::string res_body; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + EXPECT_EQ(SPV_SUCCESS, Disassemble(linked_binary, &res_body)) + << GetErrorMessage(); + EXPECT_EQ(expected_res, res_body); +} + +TEST_F(MatchingImportsToExports, UseExportedFuncParamAttr) { + const std::string body1 = R"( +OpCapability Kernel +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Import +OpDecorate %2 FuncParamAttr Zext +%2 = OpDecorationGroup +OpGroupDecorate %2 %3 %4 +%5 = OpTypeVoid +%6 = OpTypeInt 32 0 +%7 = OpTypeFunction %5 %6 +%1 = OpFunction %5 None %7 +%3 = OpFunctionParameter %6 +OpFunctionEnd +%8 = OpFunction %5 None %7 +%4 = OpFunctionParameter %6 +OpFunctionEnd +)"; + const std::string body2 = R"( +OpCapability Kernel +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Export +OpDecorate %2 FuncParamAttr Sext +%3 = OpTypeVoid +%4 = OpTypeInt 32 0 +%5 = OpTypeFunction %3 %4 +%1 = OpFunction %3 None %5 +%2 = OpFunctionParameter %4 +%6 = OpLabel +OpReturn +OpFunctionEnd +)"; + + spvtest::Binary linked_binary; + EXPECT_EQ(SPV_SUCCESS, AssembleAndLink({body1, body2}, &linked_binary)) + << GetErrorMessage(); + + const std::string expected_res = R"(OpCapability Kernel +OpModuleProcessed "Linked by SPIR-V Tools Linker" +OpDecorate %1 FuncParamAttr Zext +%1 = OpDecorationGroup +OpGroupDecorate %1 %2 +OpDecorate %3 FuncParamAttr Sext +%4 = OpTypeVoid +%5 = OpTypeInt 32 0 +%6 = OpTypeFunction %4 %5 +%7 = OpFunction %4 None %6 +%2 = OpFunctionParameter %5 +OpFunctionEnd +%8 = OpFunction %4 None %6 +%3 = OpFunctionParameter %5 +%9 = OpLabel +OpReturn +OpFunctionEnd +)"; + std::string res_body; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + EXPECT_EQ(SPV_SUCCESS, Disassemble(linked_binary, &res_body)) + << GetErrorMessage(); + EXPECT_EQ(expected_res, res_body); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/memory_model_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/memory_model_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/memory_model_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/memory_model_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2017 Pierre Moreau +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "gmock/gmock.h" +#include "linker_fixture.h" + +namespace { + +using ::testing::HasSubstr; + +using MemoryModel = spvtest::LinkerTest; + +TEST_F(MemoryModel, Default) { + const std::string body1 = R"( +OpMemoryModel Logical Simple +)"; + const std::string body2 = R"( +OpMemoryModel Logical Simple +)"; + + spvtest::Binary linked_binary; + ASSERT_EQ(SPV_SUCCESS, AssembleAndLink({body1, body2}, &linked_binary)); + EXPECT_THAT(GetErrorMessage(), std::string()); + + EXPECT_EQ(SpvAddressingModelLogical, linked_binary[6]); + EXPECT_EQ(SpvMemoryModelSimple, linked_binary[7]); +} + +TEST_F(MemoryModel, AddressingMismatch) { + const std::string body1 = R"( +OpMemoryModel Logical Simple +)"; + const std::string body2 = R"( +OpMemoryModel Physical32 Simple +)"; + + spvtest::Binary linked_binary; + EXPECT_EQ(SPV_ERROR_INTERNAL, + AssembleAndLink({body1, body2}, &linked_binary)); + EXPECT_THAT( + GetErrorMessage(), + HasSubstr("Conflicting addressing models: Logical vs Physical32.")); +} + +TEST_F(MemoryModel, MemoryMismatch) { + const std::string body1 = R"( +OpMemoryModel Logical Simple +)"; + const std::string body2 = R"( +OpMemoryModel Logical GLSL450 +)"; + + spvtest::Binary linked_binary; + EXPECT_EQ(SPV_ERROR_INTERNAL, + AssembleAndLink({body1, body2}, &linked_binary)); + EXPECT_THAT(GetErrorMessage(), + HasSubstr("Conflicting memory models: Simple vs GLSL450.")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/partial_linkage_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/partial_linkage_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/partial_linkage_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/partial_linkage_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,85 @@ +// Copyright (c) 2018 Pierre Moreau +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "gmock/gmock.h" +#include "linker_fixture.h" + +namespace { + +using ::testing::HasSubstr; +using PartialLinkage = spvtest::LinkerTest; + +TEST_F(PartialLinkage, Allowed) { + const std::string body1 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Import +OpDecorate %2 LinkageAttributes "bar" Import +%3 = OpTypeFloat 32 +%1 = OpVariable %3 Uniform +%2 = OpVariable %3 Uniform +)"; + const std::string body2 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "bar" Export +%2 = OpTypeFloat 32 +%3 = OpConstant %2 3.1415 +%1 = OpVariable %2 Uniform %3 +)"; + + spvtest::Binary linked_binary; + spvtools::LinkerOptions linker_options; + linker_options.SetAllowPartialLinkage(true); + ASSERT_EQ(SPV_SUCCESS, + AssembleAndLink({body1, body2}, &linked_binary, linker_options)); + + const std::string expected_res = R"(OpCapability Linkage +OpModuleProcessed "Linked by SPIR-V Tools Linker" +OpDecorate %1 LinkageAttributes "foo" Import +%2 = OpTypeFloat 32 +%1 = OpVariable %2 Uniform +%3 = OpConstant %2 3.1415 +%4 = OpVariable %2 Uniform %3 +)"; + std::string res_body; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + ASSERT_EQ(SPV_SUCCESS, Disassemble(linked_binary, &res_body)) + << GetErrorMessage(); + EXPECT_EQ(expected_res, res_body); +} + +TEST_F(PartialLinkage, Disallowed) { + const std::string body1 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "foo" Import +OpDecorate %2 LinkageAttributes "bar" Import +%3 = OpTypeFloat 32 +%1 = OpVariable %3 Uniform +%2 = OpVariable %3 Uniform +)"; + const std::string body2 = R"( +OpCapability Linkage +OpDecorate %1 LinkageAttributes "bar" Export +%2 = OpTypeFloat 32 +%3 = OpConstant %2 3.1415 +%1 = OpVariable %2 Uniform %3 +)"; + + spvtest::Binary linked_binary; + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, + AssembleAndLink({body1, body2}, &linked_binary)); + EXPECT_THAT(GetErrorMessage(), + HasSubstr("Unresolved external reference to \"foo\".")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/unique_ids_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/unique_ids_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/link/unique_ids_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/link/unique_ids_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,137 @@ +// Copyright (c) 2017 Google 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. + +#include "gmock/gmock.h" +#include "linker_fixture.h" + +namespace { + +using UniqueIds = spvtest::LinkerTest; + +TEST_F(UniqueIds, UniquelyMerged) { + std::vector bodies(2); + bodies[0] = + // clang-format off + "OpCapability Shader\n" + "%1 = OpExtInstImport \"GLSL.std.450\"\n" + "OpMemoryModel Logical GLSL450\n" + "OpEntryPoint Vertex %main \"main\"\n" + "OpSource ESSL 310\n" + "OpName %main \"main\"\n" + "OpName %f_ \"f(\"\n" + "OpName %gv1 \"gv1\"\n" + "OpName %gv2 \"gv2\"\n" + "OpName %lv1 \"lv1\"\n" + "OpName %lv2 \"lv2\"\n" + "OpName %lv1_0 \"lv1\"\n" + "%void = OpTypeVoid\n" + "%10 = OpTypeFunction %void\n" + "%float = OpTypeFloat 32\n" + "%12 = OpTypeFunction %float\n" + "%_ptr_Private_float = OpTypePointer Private %float\n" + "%gv1 = OpVariable %_ptr_Private_float Private\n" + "%float_10 = OpConstant %float 10\n" + "%gv2 = OpVariable %_ptr_Private_float Private\n" + "%float_100 = OpConstant %float 100\n" + "%_ptr_Function_float = OpTypePointer Function %float\n" + "%main = OpFunction %void None %10\n" + "%17 = OpLabel\n" + "%lv1_0 = OpVariable %_ptr_Function_float Function\n" + "OpStore %gv1 %float_10\n" + "OpStore %gv2 %float_100\n" + "%18 = OpLoad %float %gv1\n" + "%19 = OpLoad %float %gv2\n" + "%20 = OpFSub %float %18 %19\n" + "OpStore %lv1_0 %20\n" + "OpReturn\n" + "OpFunctionEnd\n" + "%f_ = OpFunction %float None %12\n" + "%21 = OpLabel\n" + "%lv1 = OpVariable %_ptr_Function_float Function\n" + "%lv2 = OpVariable %_ptr_Function_float Function\n" + "%22 = OpLoad %float %gv1\n" + "%23 = OpLoad %float %gv2\n" + "%24 = OpFAdd %float %22 %23\n" + "OpStore %lv1 %24\n" + "%25 = OpLoad %float %gv1\n" + "%26 = OpLoad %float %gv2\n" + "%27 = OpFMul %float %25 %26\n" + "OpStore %lv2 %27\n" + "%28 = OpLoad %float %lv1\n" + "%29 = OpLoad %float %lv2\n" + "%30 = OpFDiv %float %28 %29\n" + "OpReturnValue %30\n" + "OpFunctionEnd\n"; + // clang-format on + bodies[1] = + // clang-format off + "OpCapability Shader\n" + "%1 = OpExtInstImport \"GLSL.std.450\"\n" + "OpMemoryModel Logical GLSL450\n" + "OpSource ESSL 310\n" + "OpName %main \"main2\"\n" + "OpName %f_ \"f(\"\n" + "OpName %gv1 \"gv12\"\n" + "OpName %gv2 \"gv22\"\n" + "OpName %lv1 \"lv12\"\n" + "OpName %lv2 \"lv22\"\n" + "OpName %lv1_0 \"lv12\"\n" + "%void = OpTypeVoid\n" + "%10 = OpTypeFunction %void\n" + "%float = OpTypeFloat 32\n" + "%12 = OpTypeFunction %float\n" + "%_ptr_Private_float = OpTypePointer Private %float\n" + "%gv1 = OpVariable %_ptr_Private_float Private\n" + "%float_10 = OpConstant %float 10\n" + "%gv2 = OpVariable %_ptr_Private_float Private\n" + "%float_100 = OpConstant %float 100\n" + "%_ptr_Function_float = OpTypePointer Function %float\n" + "%main = OpFunction %void None %10\n" + "%17 = OpLabel\n" + "%lv1_0 = OpVariable %_ptr_Function_float Function\n" + "OpStore %gv1 %float_10\n" + "OpStore %gv2 %float_100\n" + "%18 = OpLoad %float %gv1\n" + "%19 = OpLoad %float %gv2\n" + "%20 = OpFSub %float %18 %19\n" + "OpStore %lv1_0 %20\n" + "OpReturn\n" + "OpFunctionEnd\n" + "%f_ = OpFunction %float None %12\n" + "%21 = OpLabel\n" + "%lv1 = OpVariable %_ptr_Function_float Function\n" + "%lv2 = OpVariable %_ptr_Function_float Function\n" + "%22 = OpLoad %float %gv1\n" + "%23 = OpLoad %float %gv2\n" + "%24 = OpFAdd %float %22 %23\n" + "OpStore %lv1 %24\n" + "%25 = OpLoad %float %gv1\n" + "%26 = OpLoad %float %gv2\n" + "%27 = OpFMul %float %25 %26\n" + "OpStore %lv2 %27\n" + "%28 = OpLoad %float %lv1\n" + "%29 = OpLoad %float %lv2\n" + "%30 = OpFDiv %float %28 %29\n" + "OpReturnValue %30\n" + "OpFunctionEnd\n"; + // clang-format on + + spvtest::Binary linked_binary; + spvtools::LinkerOptions options; + options.SetVerifyIds(true); + spv_result_t res = AssembleAndLink(bodies, &linked_binary, options); + EXPECT_EQ(SPV_SUCCESS, res); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/log_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/log_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/log_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/log_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,54 @@ +// Copyright (c) 2016 Google 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. + +#include +#include + +#include "message.h" +#include "opt/log.h" + +namespace { + +using namespace spvtools; +using ::testing::MatchesRegex; + +TEST(Log, Unimplemented) { + int invocation = 0; + auto consumer = [&invocation](spv_message_level_t level, const char* source, + const spv_position_t&, const char* message) { + ++invocation; + EXPECT_EQ(SPV_MSG_INTERNAL_ERROR, level); + EXPECT_THAT(source, MatchesRegex(".*log_test.cpp$")); + EXPECT_STREQ("unimplemented: the-ultimite-feature", message); + }; + + SPIRV_UNIMPLEMENTED(consumer, "the-ultimite-feature"); + EXPECT_EQ(1, invocation); +} + +TEST(Log, Unreachable) { + int invocation = 0; + auto consumer = [&invocation](spv_message_level_t level, const char* source, + const spv_position_t&, const char* message) { + ++invocation; + EXPECT_EQ(SPV_MSG_INTERNAL_ERROR, level); + EXPECT_THAT(source, MatchesRegex(".*log_test.cpp$")); + EXPECT_STREQ("unreachable", message); + }; + + SPIRV_UNREACHABLE(consumer); + EXPECT_EQ(1, invocation); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/move_to_front_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/move_to_front_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/move_to_front_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/move_to_front_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,941 @@ +// Copyright (c) 2017 Google 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. + +#include +#include +#include + +#include "gmock/gmock.h" +#include "util/move_to_front.h" + +namespace { + +using spvutils::MoveToFront; +using spvutils::MultiMoveToFront; + +// Class used to test the inner workings of MoveToFront. +class MoveToFrontTester : public MoveToFront { + public: + // Inserts the value in the internal tree data structure. For testing only. + void TestInsert(uint32_t val) { InsertNode(CreateNode(val, val)); } + + // Removes the value from the internal tree data structure. For testing only. + void TestRemove(uint32_t val) { + const auto it = value_to_node_.find(val); + assert(it != value_to_node_.end()); + RemoveNode(it->second); + } + + // Prints the internal tree data structure to |out|. For testing only. + void PrintTree(std::ostream& out, bool print_timestamp = false) const { + if (root_) PrintTreeInternal(out, root_, 1, print_timestamp); + } + + // Returns node handle corresponding to the value. The value may not be in the + // tree. + uint32_t GetNodeHandle(uint32_t value) const { + const auto it = value_to_node_.find(value); + if (it == value_to_node_.end()) return 0; + + return it->second; + } + + // Returns total node count (both those in the tree and removed, + // but not the NIL singleton). + size_t GetTotalNodeCount() const { + assert(nodes_.size()); + return nodes_.size() - 1; + } + + uint32_t GetLastAccessedValue() const { return last_accessed_value_; } + + private: + // Prints the internal tree data structure for debug purposes in the following + // format: + // 10H3S4----5H1S1-----D2 + // 15H2S2----12H1S1----D3 + // Right links are horizontal, left links step down one line. + // 5H1S1 is read as value 5, height 1, size 1. Optionally node label can also + // contain timestamp (5H1S1T15). D3 stands for depth 3. + void PrintTreeInternal(std::ostream& out, uint32_t node, size_t depth, + bool print_timestamp) const; +}; + +void MoveToFrontTester::PrintTreeInternal(std::ostream& out, uint32_t node, + size_t depth, + bool print_timestamp) const { + if (!node) { + out << "D" << depth - 1 << std::endl; + return; + } + + const size_t kTextFieldWvaluethWithoutTimestamp = 10; + const size_t kTextFieldWvaluethWithTimestamp = 14; + const size_t text_field_wvalueth = print_timestamp + ? kTextFieldWvaluethWithTimestamp + : kTextFieldWvaluethWithoutTimestamp; + + std::stringstream label; + label << ValueOf(node) << "H" << HeightOf(node) << "S" << SizeOf(node); + if (print_timestamp) label << "T" << TimestampOf(node); + const size_t label_length = label.str().length(); + if (label_length < text_field_wvalueth) + label << std::string(text_field_wvalueth - label_length, '-'); + + out << label.str(); + + PrintTreeInternal(out, RightOf(node), depth + 1, print_timestamp); + + if (LeftOf(node)) { + out << std::string(depth * text_field_wvalueth, ' '); + PrintTreeInternal(out, LeftOf(node), depth + 1, print_timestamp); + } +} + +void CheckTree(const MoveToFrontTester& mtf, const std::string& expected, + bool print_timestamp = false) { + std::stringstream ss; + mtf.PrintTree(ss, print_timestamp); + EXPECT_EQ(expected, ss.str()); +} + +TEST(MoveToFront, EmptyTree) { + MoveToFrontTester mtf; + CheckTree(mtf, std::string()); +} + +TEST(MoveToFront, InsertLeftRotation) { + MoveToFrontTester mtf; + + mtf.TestInsert(30); + mtf.TestInsert(20); + + CheckTree(mtf, std::string(R"( +30H2S2----20H1S1----D2 +)") + .substr(1)); + + mtf.TestInsert(10); + CheckTree(mtf, std::string(R"( +20H2S3----10H1S1----D2 + 30H1S1----D2 +)") + .substr(1)); +} + +TEST(MoveToFront, InsertRightRotation) { + MoveToFrontTester mtf; + + mtf.TestInsert(10); + mtf.TestInsert(20); + + CheckTree(mtf, std::string(R"( +10H2S2----D1 + 20H1S1----D2 +)") + .substr(1)); + + mtf.TestInsert(30); + CheckTree(mtf, std::string(R"( +20H2S3----10H1S1----D2 + 30H1S1----D2 +)") + .substr(1)); +} + +TEST(MoveToFront, InsertRightLeftRotation) { + MoveToFrontTester mtf; + + mtf.TestInsert(30); + mtf.TestInsert(20); + + CheckTree(mtf, std::string(R"( +30H2S2----20H1S1----D2 +)") + .substr(1)); + + mtf.TestInsert(25); + CheckTree(mtf, std::string(R"( +25H2S3----20H1S1----D2 + 30H1S1----D2 +)") + .substr(1)); +} + +TEST(MoveToFront, InsertLeftRightRotation) { + MoveToFrontTester mtf; + + mtf.TestInsert(10); + mtf.TestInsert(20); + + CheckTree(mtf, std::string(R"( +10H2S2----D1 + 20H1S1----D2 +)") + .substr(1)); + + mtf.TestInsert(15); + CheckTree(mtf, std::string(R"( +15H2S3----10H1S1----D2 + 20H1S1----D2 +)") + .substr(1)); +} + +TEST(MoveToFront, RemoveSingleton) { + MoveToFrontTester mtf; + + mtf.TestInsert(10); + CheckTree(mtf, std::string(R"( +10H1S1----D1 +)") + .substr(1)); + + mtf.TestRemove(10); + CheckTree(mtf, ""); +} + +TEST(MoveToFront, RemoveRootWithScapegoat) { + MoveToFrontTester mtf; + + mtf.TestInsert(10); + mtf.TestInsert(5); + mtf.TestInsert(15); + CheckTree(mtf, std::string(R"( +10H2S3----5H1S1-----D2 + 15H1S1----D2 +)") + .substr(1)); + + mtf.TestRemove(10); + CheckTree(mtf, std::string(R"( +15H2S2----5H1S1-----D2 +)") + .substr(1)); +} + +TEST(MoveToFront, RemoveRightRotation) { + MoveToFrontTester mtf; + + mtf.TestInsert(10); + mtf.TestInsert(5); + mtf.TestInsert(15); + mtf.TestInsert(20); + CheckTree(mtf, std::string(R"( +10H3S4----5H1S1-----D2 + 15H2S2----D2 + 20H1S1----D3 +)") + .substr(1)); + + mtf.TestRemove(5); + + CheckTree(mtf, std::string(R"( +15H2S3----10H1S1----D2 + 20H1S1----D2 +)") + .substr(1)); +} + +TEST(MoveToFront, RemoveLeftRotation) { + MoveToFrontTester mtf; + + mtf.TestInsert(10); + mtf.TestInsert(15); + mtf.TestInsert(5); + mtf.TestInsert(1); + CheckTree(mtf, std::string(R"( +10H3S4----5H2S2-----1H1S1-----D3 + 15H1S1----D2 +)") + .substr(1)); + + mtf.TestRemove(15); + + CheckTree(mtf, std::string(R"( +5H2S3-----1H1S1-----D2 + 10H1S1----D2 +)") + .substr(1)); +} + +TEST(MoveToFront, RemoveLeftRightRotation) { + MoveToFrontTester mtf; + + mtf.TestInsert(10); + mtf.TestInsert(15); + mtf.TestInsert(5); + mtf.TestInsert(12); + CheckTree(mtf, std::string(R"( +10H3S4----5H1S1-----D2 + 15H2S2----12H1S1----D3 +)") + .substr(1)); + + mtf.TestRemove(5); + + CheckTree(mtf, std::string(R"( +12H2S3----10H1S1----D2 + 15H1S1----D2 +)") + .substr(1)); +} + +TEST(MoveToFront, RemoveRightLeftRotation) { + MoveToFrontTester mtf; + + mtf.TestInsert(10); + mtf.TestInsert(15); + mtf.TestInsert(5); + mtf.TestInsert(8); + CheckTree(mtf, std::string(R"( +10H3S4----5H2S2-----D2 + 8H1S1-----D3 + 15H1S1----D2 +)") + .substr(1)); + + mtf.TestRemove(15); + + CheckTree(mtf, std::string(R"( +8H2S3-----5H1S1-----D2 + 10H1S1----D2 +)") + .substr(1)); +} + +TEST(MoveToFront, MultipleOperations) { + MoveToFrontTester mtf; + std::vector vals = {5, 11, 12, 16, 15, 6, 14, 2, + 7, 10, 4, 8, 9, 3, 1, 13}; + + for (uint32_t i : vals) { + mtf.TestInsert(i); + } + + CheckTree(mtf, std::string(R"( +11H5S16---5H4S10----3H3S4-----2H2S2-----1H1S1-----D5 + 4H1S1-----D4 + 7H3S5-----6H1S1-----D4 + 9H2S3-----8H1S1-----D5 + 10H1S1----D5 + 15H3S5----13H2S3----12H1S1----D4 + 14H1S1----D4 + 16H1S1----D3 +)") + .substr(1)); + + mtf.TestRemove(11); + + CheckTree(mtf, std::string(R"( +10H5S15---5H4S9-----3H3S4-----2H2S2-----1H1S1-----D5 + 4H1S1-----D4 + 7H3S4-----6H1S1-----D4 + 9H2S2-----8H1S1-----D5 + 15H3S5----13H2S3----12H1S1----D4 + 14H1S1----D4 + 16H1S1----D3 +)") + .substr(1)); + + mtf.TestInsert(11); + + CheckTree(mtf, std::string(R"( +10H5S16---5H4S9-----3H3S4-----2H2S2-----1H1S1-----D5 + 4H1S1-----D4 + 7H3S4-----6H1S1-----D4 + 9H2S2-----8H1S1-----D5 + 13H3S6----12H2S2----11H1S1----D4 + 15H2S3----14H1S1----D4 + 16H1S1----D4 +)") + .substr(1)); + + mtf.TestRemove(5); + + CheckTree(mtf, std::string(R"( +10H5S15---6H4S8-----3H3S4-----2H2S2-----1H1S1-----D5 + 4H1S1-----D4 + 8H2S3-----7H1S1-----D4 + 9H1S1-----D4 + 13H3S6----12H2S2----11H1S1----D4 + 15H2S3----14H1S1----D4 + 16H1S1----D4 +)") + .substr(1)); + + mtf.TestInsert(5); + + CheckTree(mtf, std::string(R"( +10H5S16---6H4S9-----3H3S5-----2H2S2-----1H1S1-----D5 + 4H2S2-----D4 + 5H1S1-----D5 + 8H2S3-----7H1S1-----D4 + 9H1S1-----D4 + 13H3S6----12H2S2----11H1S1----D4 + 15H2S3----14H1S1----D4 + 16H1S1----D4 +)") + .substr(1)); + + mtf.TestRemove(2); + mtf.TestRemove(1); + mtf.TestRemove(4); + mtf.TestRemove(3); + mtf.TestRemove(6); + mtf.TestRemove(5); + mtf.TestRemove(7); + mtf.TestRemove(9); + + CheckTree(mtf, std::string(R"( +13H4S8----10H3S4----8H1S1-----D3 + 12H2S2----11H1S1----D4 + 15H2S3----14H1S1----D3 + 16H1S1----D3 +)") + .substr(1)); +} + +TEST(MoveToFront, BiggerScaleTreeTest) { + MoveToFrontTester mtf; + std::set all_vals; + + const uint32_t kMagic1 = 2654435761; + const uint32_t kMagic2 = 10000; + + for (uint32_t i = 1; i < 1000; ++i) { + const uint32_t val = (i * kMagic1) % kMagic2; + if (!all_vals.count(val)) { + mtf.TestInsert(val); + all_vals.insert(val); + } + } + + for (uint32_t i = 1; i < 1000; ++i) { + const uint32_t val = (i * kMagic1) % kMagic2; + if (val % 2 == 0) { + mtf.TestRemove(val); + all_vals.erase(val); + } + } + + for (uint32_t i = 1000; i < 2000; ++i) { + const uint32_t val = (i * kMagic1) % kMagic2; + if (!all_vals.count(val)) { + mtf.TestInsert(val); + all_vals.insert(val); + } + } + + for (uint32_t i = 1; i < 2000; ++i) { + const uint32_t val = (i * kMagic1) % kMagic2; + if (val > 50) { + mtf.TestRemove(val); + all_vals.erase(val); + } + } + + EXPECT_EQ(all_vals, std::set({2, 4, 11, 13, 24, 33, 35, 37, 46})); + + CheckTree(mtf, std::string(R"( +33H4S9----11H3S5----2H2S2-----D3 + 4H1S1-----D4 + 13H2S2----D3 + 24H1S1----D4 + 37H2S3----35H1S1----D3 + 46H1S1----D3 +)") + .substr(1)); +} + +TEST(MoveToFront, RankFromValue) { + MoveToFrontTester mtf; + + uint32_t rank = 0; + EXPECT_FALSE(mtf.RankFromValue(1, &rank)); + + EXPECT_TRUE(mtf.Insert(1)); + EXPECT_TRUE(mtf.Insert(2)); + EXPECT_TRUE(mtf.Insert(3)); + EXPECT_FALSE(mtf.Insert(2)); + CheckTree(mtf, + std::string(R"( +2H2S3T2-------1H1S1T1-------D2 + 3H1S1T3-------D2 +)") + .substr(1), + /* print_timestamp = */ true); + + EXPECT_FALSE(mtf.RankFromValue(4, &rank)); + + EXPECT_TRUE(mtf.RankFromValue(1, &rank)); + EXPECT_EQ(3u, rank); + + CheckTree(mtf, + std::string(R"( +3H2S3T3-------2H1S1T2-------D2 + 1H1S1T4-------D2 +)") + .substr(1), + /* print_timestamp = */ true); + + EXPECT_TRUE(mtf.RankFromValue(1, &rank)); + EXPECT_EQ(1u, rank); + + EXPECT_TRUE(mtf.RankFromValue(3, &rank)); + EXPECT_EQ(2u, rank); + + EXPECT_TRUE(mtf.RankFromValue(2, &rank)); + EXPECT_EQ(3u, rank); + + EXPECT_TRUE(mtf.Insert(40)); + + EXPECT_TRUE(mtf.RankFromValue(1, &rank)); + EXPECT_EQ(4u, rank); + + EXPECT_TRUE(mtf.Insert(50)); + + EXPECT_TRUE(mtf.RankFromValue(1, &rank)); + EXPECT_EQ(2u, rank); + + CheckTree(mtf, + std::string(R"( +2H3S5T6-------3H1S1T5-------D2 + 50H2S3T9------40H1S1T7------D3 + 1H1S1T10------D3 +)") + .substr(1), + /* print_timestamp = */ true); + + EXPECT_TRUE(mtf.RankFromValue(50, &rank)); + EXPECT_EQ(2u, rank); + + EXPECT_EQ(5u, mtf.GetSize()); + CheckTree(mtf, + std::string(R"( +2H3S5T6-------3H1S1T5-------D2 + 1H2S3T10------40H1S1T7------D3 + 50H1S1T11-----D3 +)") + .substr(1), + /* print_timestamp = */ true); + + EXPECT_FALSE(mtf.RankFromValue(0, &rank)); + EXPECT_FALSE(mtf.RankFromValue(20, &rank)); +} + +TEST(MoveToFront, ValueFromRank) { + MoveToFrontTester mtf; + + uint32_t value = 0; + EXPECT_FALSE(mtf.ValueFromRank(0, &value)); + EXPECT_FALSE(mtf.ValueFromRank(1, &value)); + + EXPECT_TRUE(mtf.Insert(1)); + EXPECT_EQ(1u, mtf.GetLastAccessedValue()); + EXPECT_TRUE(mtf.Insert(2)); + EXPECT_EQ(2u, mtf.GetLastAccessedValue()); + EXPECT_TRUE(mtf.Insert(3)); + EXPECT_EQ(3u, mtf.GetLastAccessedValue()); + + EXPECT_TRUE(mtf.ValueFromRank(3, &value)); + EXPECT_EQ(1u, value); + EXPECT_EQ(1u, mtf.GetLastAccessedValue()); + + EXPECT_TRUE(mtf.ValueFromRank(1, &value)); + EXPECT_EQ(1u, value); + EXPECT_EQ(1u, mtf.GetLastAccessedValue()); + + CheckTree(mtf, + std::string(R"( +3H2S3T3-------2H1S1T2-------D2 + 1H1S1T4-------D2 +)") + .substr(1), + /* print_timestamp = */ true); + + EXPECT_TRUE(mtf.ValueFromRank(2, &value)); + EXPECT_EQ(3u, value); + + EXPECT_EQ(3u, mtf.GetSize()); + + CheckTree(mtf, + std::string(R"( +1H2S3T4-------2H1S1T2-------D2 + 3H1S1T5-------D2 +)") + .substr(1), + /* print_timestamp = */ true); + + EXPECT_TRUE(mtf.ValueFromRank(3, &value)); + EXPECT_EQ(2u, value); + + CheckTree(mtf, + std::string(R"( +3H2S3T5-------1H1S1T4-------D2 + 2H1S1T6-------D2 +)") + .substr(1), + /* print_timestamp = */ true); + + EXPECT_TRUE(mtf.Insert(10)); + CheckTree(mtf, + std::string(R"( +3H3S4T5-------1H1S1T4-------D2 + 2H2S2T6-------D2 + 10H1S1T7------D3 +)") + .substr(1), + /* print_timestamp = */ true); + + EXPECT_TRUE(mtf.ValueFromRank(1, &value)); + EXPECT_EQ(10u, value); +} + +TEST(MoveToFront, Remove) { + MoveToFrontTester mtf; + + EXPECT_FALSE(mtf.Remove(1)); + EXPECT_EQ(0u, mtf.GetTotalNodeCount()); + + EXPECT_TRUE(mtf.Insert(1)); + EXPECT_TRUE(mtf.Insert(2)); + EXPECT_TRUE(mtf.Insert(3)); + + CheckTree(mtf, + std::string(R"( +2H2S3T2-------1H1S1T1-------D2 + 3H1S1T3-------D2 +)") + .substr(1), + /* print_timestamp = */ true); + + EXPECT_EQ(1u, mtf.GetNodeHandle(1)); + EXPECT_EQ(3u, mtf.GetTotalNodeCount()); + EXPECT_TRUE(mtf.Remove(1)); + EXPECT_EQ(3u, mtf.GetTotalNodeCount()); + + CheckTree(mtf, + std::string(R"( +2H2S2T2-------D1 + 3H1S1T3-------D2 +)") + .substr(1), + /* print_timestamp = */ true); + + uint32_t value = 0; + EXPECT_TRUE(mtf.ValueFromRank(2, &value)); + EXPECT_EQ(2u, value); + + CheckTree(mtf, + std::string(R"( +3H2S2T3-------D1 + 2H1S1T4-------D2 +)") + .substr(1), + /* print_timestamp = */ true); + + EXPECT_TRUE(mtf.Insert(1)); + EXPECT_EQ(1u, mtf.GetNodeHandle(1)); + EXPECT_EQ(3u, mtf.GetTotalNodeCount()); +} + +TEST(MoveToFront, LargerScale) { + MoveToFrontTester mtf; + uint32_t value = 0; + uint32_t rank = 0; + + for (uint32_t i = 1; i < 1000; ++i) { + ASSERT_TRUE(mtf.Insert(i)); + ASSERT_EQ(i, mtf.GetSize()); + + ASSERT_TRUE(mtf.RankFromValue(i, &rank)); + ASSERT_EQ(1u, rank); + + ASSERT_TRUE(mtf.ValueFromRank(1, &value)); + ASSERT_EQ(i, value); + } + + ASSERT_TRUE(mtf.ValueFromRank(999, &value)); + ASSERT_EQ(1u, value); + + ASSERT_TRUE(mtf.ValueFromRank(999, &value)); + ASSERT_EQ(2u, value); + + ASSERT_TRUE(mtf.ValueFromRank(999, &value)); + ASSERT_EQ(3u, value); + + ASSERT_TRUE(mtf.ValueFromRank(999, &value)); + ASSERT_EQ(4u, value); + + ASSERT_TRUE(mtf.ValueFromRank(999, &value)); + ASSERT_EQ(5u, value); + + ASSERT_TRUE(mtf.ValueFromRank(999, &value)); + ASSERT_EQ(6u, value); + + ASSERT_TRUE(mtf.ValueFromRank(101, &value)); + ASSERT_EQ(905u, value); + + ASSERT_TRUE(mtf.ValueFromRank(101, &value)); + ASSERT_EQ(906u, value); + + ASSERT_TRUE(mtf.ValueFromRank(101, &value)); + ASSERT_EQ(907u, value); + + ASSERT_TRUE(mtf.ValueFromRank(201, &value)); + ASSERT_EQ(805u, value); + + ASSERT_TRUE(mtf.ValueFromRank(201, &value)); + ASSERT_EQ(806u, value); + + ASSERT_TRUE(mtf.ValueFromRank(201, &value)); + ASSERT_EQ(807u, value); + + ASSERT_TRUE(mtf.ValueFromRank(301, &value)); + ASSERT_EQ(705u, value); + + ASSERT_TRUE(mtf.ValueFromRank(301, &value)); + ASSERT_EQ(706u, value); + + ASSERT_TRUE(mtf.ValueFromRank(301, &value)); + ASSERT_EQ(707u, value); + + ASSERT_TRUE(mtf.RankFromValue(605, &rank)); + ASSERT_EQ(401u, rank); + + ASSERT_TRUE(mtf.RankFromValue(606, &rank)); + ASSERT_EQ(401u, rank); + + ASSERT_TRUE(mtf.RankFromValue(607, &rank)); + ASSERT_EQ(401u, rank); + + ASSERT_TRUE(mtf.ValueFromRank(1, &value)); + ASSERT_EQ(607u, value); + + ASSERT_TRUE(mtf.ValueFromRank(2, &value)); + ASSERT_EQ(606u, value); + + ASSERT_TRUE(mtf.ValueFromRank(3, &value)); + ASSERT_EQ(605u, value); + + ASSERT_TRUE(mtf.ValueFromRank(4, &value)); + ASSERT_EQ(707u, value); + + ASSERT_TRUE(mtf.ValueFromRank(5, &value)); + ASSERT_EQ(706u, value); + + ASSERT_TRUE(mtf.ValueFromRank(6, &value)); + ASSERT_EQ(705u, value); + + ASSERT_TRUE(mtf.ValueFromRank(7, &value)); + ASSERT_EQ(807u, value); + + ASSERT_TRUE(mtf.ValueFromRank(8, &value)); + ASSERT_EQ(806u, value); + + ASSERT_TRUE(mtf.ValueFromRank(9, &value)); + ASSERT_EQ(805u, value); + + ASSERT_TRUE(mtf.ValueFromRank(10, &value)); + ASSERT_EQ(907u, value); + + ASSERT_TRUE(mtf.ValueFromRank(11, &value)); + ASSERT_EQ(906u, value); + + ASSERT_TRUE(mtf.ValueFromRank(12, &value)); + ASSERT_EQ(905u, value); + + ASSERT_TRUE(mtf.ValueFromRank(13, &value)); + ASSERT_EQ(6u, value); + + ASSERT_TRUE(mtf.ValueFromRank(14, &value)); + ASSERT_EQ(5u, value); + + ASSERT_TRUE(mtf.ValueFromRank(15, &value)); + ASSERT_EQ(4u, value); + + ASSERT_TRUE(mtf.ValueFromRank(16, &value)); + ASSERT_EQ(3u, value); + + ASSERT_TRUE(mtf.ValueFromRank(17, &value)); + ASSERT_EQ(2u, value); + + ASSERT_TRUE(mtf.ValueFromRank(18, &value)); + ASSERT_EQ(1u, value); + + ASSERT_TRUE(mtf.ValueFromRank(19, &value)); + ASSERT_EQ(999u, value); + + ASSERT_TRUE(mtf.ValueFromRank(20, &value)); + ASSERT_EQ(998u, value); + + ASSERT_TRUE(mtf.ValueFromRank(21, &value)); + ASSERT_EQ(997u, value); + + ASSERT_TRUE(mtf.RankFromValue(997, &rank)); + ASSERT_EQ(1u, rank); + + ASSERT_TRUE(mtf.RankFromValue(998, &rank)); + ASSERT_EQ(2u, rank); + + ASSERT_TRUE(mtf.RankFromValue(996, &rank)); + ASSERT_EQ(22u, rank); + + ASSERT_TRUE(mtf.Remove(995)); + + ASSERT_TRUE(mtf.RankFromValue(994, &rank)); + ASSERT_EQ(23u, rank); + + for (uint32_t i = 10; i < 1000; ++i) { + if (i != 995) { + ASSERT_TRUE(mtf.Remove(i)); + } else { + ASSERT_FALSE(mtf.Remove(i)); + } + } + + CheckTree(mtf, + std::string(R"( +6H4S9T1029----8H2S3T8-------7H1S1T7-------D3 + 9H1S1T9-------D3 + 2H3S5T1033----4H2S3T1031----5H1S1T1030----D4 + 3H1S1T1032----D4 + 1H1S1T1034----D3 +)") + .substr(1), + /* print_timestamp = */ true); + + ASSERT_TRUE(mtf.Insert(1000)); + ASSERT_TRUE(mtf.ValueFromRank(1, &value)); + ASSERT_EQ(1000u, value); +} + +TEST(MoveToFront, String) { + MoveToFront mtf; + + EXPECT_TRUE(mtf.Insert("AAA")); + EXPECT_TRUE(mtf.Insert("BBB")); + EXPECT_TRUE(mtf.Insert("CCC")); + EXPECT_FALSE(mtf.Insert("AAA")); + + EXPECT_TRUE(mtf.HasValue("AAA")); + EXPECT_FALSE(mtf.HasValue("DDD")); + + std::string value; + EXPECT_TRUE(mtf.ValueFromRank(2, &value)); + EXPECT_EQ("BBB", value); + + EXPECT_TRUE(mtf.ValueFromRank(2, &value)); + EXPECT_EQ("CCC", value); + + uint32_t rank = 0; + EXPECT_TRUE(mtf.RankFromValue("AAA", &rank)); + EXPECT_EQ(3u, rank); + + EXPECT_FALSE(mtf.ValueFromRank(0, &value)); + EXPECT_FALSE(mtf.RankFromValue("ABC", &rank)); + EXPECT_FALSE(mtf.Remove("ABC")); + + EXPECT_TRUE(mtf.Remove("AAA")); + EXPECT_FALSE(mtf.Remove("AAA")); + EXPECT_FALSE(mtf.RankFromValue("AAA", &rank)); + + EXPECT_TRUE(mtf.Insert("AAA")); + EXPECT_TRUE(mtf.RankFromValue("AAA", &rank)); + EXPECT_EQ(1u, rank); + + EXPECT_TRUE(mtf.Promote("BBB")); + EXPECT_TRUE(mtf.RankFromValue("BBB", &rank)); + EXPECT_EQ(1u, rank); +} + +TEST(MultiMoveToFront, Empty) { + MultiMoveToFront multi_mtf; + + uint32_t rank = 0; + std::string value; + + EXPECT_EQ(0u, multi_mtf.GetSize(1001)); + EXPECT_FALSE(multi_mtf.RankFromValue(1001, "AAA", &rank)); + EXPECT_FALSE(multi_mtf.ValueFromRank(1001, 1, &value)); + EXPECT_FALSE(multi_mtf.HasValue(1001, "AAA")); + EXPECT_FALSE(multi_mtf.Remove(1001, "AAA")); +} + +TEST(MultiMoveToFront, TwoSequences) { + MultiMoveToFront multi_mtf; + + uint32_t rank = 0; + std::string value; + + EXPECT_TRUE(multi_mtf.Insert(1001, "AAA")); + + EXPECT_EQ(1u, multi_mtf.GetSize(1001)); + EXPECT_EQ(0u, multi_mtf.GetSize(1002)); + EXPECT_TRUE(multi_mtf.HasValue(1001, "AAA")); + EXPECT_FALSE(multi_mtf.HasValue(1002, "AAA")); + + EXPECT_TRUE(multi_mtf.RankFromValue(1001, "AAA", &rank)); + EXPECT_EQ(1u, rank); + EXPECT_FALSE(multi_mtf.RankFromValue(1002, "AAA", &rank)); + + EXPECT_TRUE(multi_mtf.ValueFromRank(1001, rank, &value)); + EXPECT_EQ("AAA", value); + EXPECT_FALSE(multi_mtf.ValueFromRank(1002, rank, &value)); + + EXPECT_TRUE(multi_mtf.Insert(1001, "BBB")); + + EXPECT_EQ(2u, multi_mtf.GetSize(1001)); + EXPECT_EQ(0u, multi_mtf.GetSize(1002)); + EXPECT_TRUE(multi_mtf.HasValue(1001, "BBB")); + EXPECT_FALSE(multi_mtf.HasValue(1002, "BBB")); + + EXPECT_TRUE(multi_mtf.RankFromValue(1001, "BBB", &rank)); + EXPECT_EQ(1u, rank); + EXPECT_FALSE(multi_mtf.RankFromValue(1002, "BBB", &rank)); + + EXPECT_TRUE(multi_mtf.ValueFromRank(1001, rank, &value)); + EXPECT_EQ("BBB", value); + EXPECT_FALSE(multi_mtf.ValueFromRank(1002, rank, &value)); + + EXPECT_TRUE(multi_mtf.Insert(1002, "AAA")); + + EXPECT_EQ(2u, multi_mtf.GetSize(1001)); + EXPECT_EQ(1u, multi_mtf.GetSize(1002)); + EXPECT_TRUE(multi_mtf.HasValue(1002, "AAA")); + + EXPECT_TRUE(multi_mtf.RankFromValue(1002, "AAA", &rank)); + EXPECT_EQ(1u, rank); + + EXPECT_TRUE(multi_mtf.RankFromValue(1001, "AAA", &rank)); + EXPECT_EQ(2u, rank); + + multi_mtf.Promote("BBB"); + + EXPECT_TRUE(multi_mtf.RankFromValue(1001, "BBB", &rank)); + EXPECT_EQ(1u, rank); + + EXPECT_TRUE(multi_mtf.Insert(1002, "CCC")); + EXPECT_TRUE(multi_mtf.RankFromValue(1002, "CCC", &rank)); + EXPECT_EQ(1u, rank); + + multi_mtf.Promote("AAA"); + EXPECT_TRUE(multi_mtf.RankFromValue(1001, "AAA", &rank)); + EXPECT_EQ(1u, rank); + EXPECT_TRUE(multi_mtf.RankFromValue(1002, "AAA", &rank)); + EXPECT_EQ(1u, rank); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/named_id_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/named_id_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/named_id_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/named_id_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,84 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include "test_fixture.h" +#include "unit_spirv.h" + +namespace { + +using NamedIdTest = spvtest::TextToBinaryTest; + +TEST_F(NamedIdTest, Default) { + const std::string input = R"( + OpCapability Shader + OpMemoryModel Logical Simple + OpEntryPoint Vertex %main "foo" + %void = OpTypeVoid +%fnMain = OpTypeFunction %void + %main = OpFunction %void None %fnMain +%lbMain = OpLabel + OpReturn + OpFunctionEnd)"; + const std::string output = + "OpCapability Shader\n" + "OpMemoryModel Logical Simple\n" + "OpEntryPoint Vertex %1 \"foo\"\n" + "%2 = OpTypeVoid\n" + "%3 = OpTypeFunction %2\n" + "%1 = OpFunction %2 None %3\n" + "%4 = OpLabel\n" + "OpReturn\n" + "OpFunctionEnd\n"; + EXPECT_EQ(output, EncodeAndDecodeSuccessfully(input)); +} + +struct IdCheckCase { + std::string id; + bool valid; +}; + +using IdValidityTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(IdValidityTest, IdTypes) { + const std::string input = GetParam().id + " = OpTypeVoid"; + SetText(input); + if (GetParam().valid) { + CompileSuccessfully(input); + } else { + CompileFailure(input); + } +} + +INSTANTIATE_TEST_CASE_P( + ValidAndInvalidIds, IdValidityTest, + ::testing::ValuesIn(std::vector( + {{"%1", true}, {"%2abc", true}, {"%3Def", true}, + {"%4GHI", true}, {"%5_j_k", true}, {"%6J_M", true}, + {"%n", true}, {"%O", true}, {"%p7", true}, + {"%Q8", true}, {"%R_S", true}, {"%T_10_U", true}, + {"%V_11", true}, {"%W_X_13", true}, {"%_A", true}, + {"%_", true}, {"%__", true}, {"%A_", true}, + {"%_A_", true}, + + {"%@", false}, {"%!", false}, {"%ABC!", false}, + {"%__A__@", false}, {"%%", false}, {"%-", false}, + {"%foo_@_bar", false}, {"%", false}, + + {"5", false}, {"32", false}, {"foo", false}, + {"a%bar", false}})), ); + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/name_mapper_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/name_mapper_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/name_mapper_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/name_mapper_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,346 @@ +// Copyright (c) 2016 Google 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. + +#include "gmock/gmock.h" + +#include "test_fixture.h" +#include "unit_spirv.h" + +#include "source/name_mapper.h" + +using libspirv::FriendlyNameMapper; +using libspirv::NameMapper; +using spvtest::ScopedContext; +using ::testing::Eq; + +namespace { + +TEST(TrivialNameTest, Samples) { + auto mapper = libspirv::GetTrivialNameMapper(); + EXPECT_EQ(mapper(1), "1"); + EXPECT_EQ(mapper(1999), "1999"); + EXPECT_EQ(mapper(1024), "1024"); +} + +// A test case for the name mappers that actually look at an assembled module. +struct NameIdCase { + std::string assembly; // Input assembly text + uint32_t id; + std::string expected_name; +}; + +using FriendlyNameTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(FriendlyNameTest, SingleMapping) { + ScopedContext context(SPV_ENV_UNIVERSAL_1_1); + auto words = CompileSuccessfully(GetParam().assembly, SPV_ENV_UNIVERSAL_1_1); + auto friendly_mapper = + FriendlyNameMapper(context.context, words.data(), words.size()); + NameMapper mapper = friendly_mapper.GetNameMapper(); + EXPECT_THAT(mapper(GetParam().id), Eq(GetParam().expected_name)) + << GetParam().assembly << std::endl + << " for id " << GetParam().id; +} + +INSTANTIATE_TEST_CASE_P(ScalarType, FriendlyNameTest, + ::testing::ValuesIn(std::vector{ + {"%1 = OpTypeVoid", 1, "void"}, + {"%1 = OpTypeBool", 1, "bool"}, + {"%1 = OpTypeInt 8 0", 1, "uchar"}, + {"%1 = OpTypeInt 8 1", 1, "char"}, + {"%1 = OpTypeInt 16 0", 1, "ushort"}, + {"%1 = OpTypeInt 16 1", 1, "short"}, + {"%1 = OpTypeInt 32 0", 1, "uint"}, + {"%1 = OpTypeInt 32 1", 1, "int"}, + {"%1 = OpTypeInt 64 0", 1, "ulong"}, + {"%1 = OpTypeInt 64 1", 1, "long"}, + {"%1 = OpTypeInt 1 0", 1, "u1"}, + {"%1 = OpTypeInt 1 1", 1, "i1"}, + {"%1 = OpTypeInt 33 0", 1, "u33"}, + {"%1 = OpTypeInt 33 1", 1, "i33"}, + + {"%1 = OpTypeFloat 16", 1, "half"}, + {"%1 = OpTypeFloat 32", 1, "float"}, + {"%1 = OpTypeFloat 64", 1, "double"}, + {"%1 = OpTypeFloat 10", 1, "fp10"}, + {"%1 = OpTypeFloat 55", 1, "fp55"}, + }), ); + +INSTANTIATE_TEST_CASE_P( + VectorType, FriendlyNameTest, + ::testing::ValuesIn(std::vector{ + {"%1 = OpTypeBool %2 = OpTypeVector %1 1", 2, "v1bool"}, + {"%1 = OpTypeBool %2 = OpTypeVector %1 2", 2, "v2bool"}, + {"%1 = OpTypeBool %2 = OpTypeVector %1 3", 2, "v3bool"}, + {"%1 = OpTypeBool %2 = OpTypeVector %1 4", 2, "v4bool"}, + + {"%1 = OpTypeInt 8 0 %2 = OpTypeVector %1 2", 2, "v2uchar"}, + {"%1 = OpTypeInt 16 1 %2 = OpTypeVector %1 3", 2, "v3short"}, + {"%1 = OpTypeInt 32 0 %2 = OpTypeVector %1 4", 2, "v4uint"}, + {"%1 = OpTypeInt 64 1 %2 = OpTypeVector %1 3", 2, "v3long"}, + {"%1 = OpTypeInt 20 0 %2 = OpTypeVector %1 4", 2, "v4u20"}, + {"%1 = OpTypeInt 21 1 %2 = OpTypeVector %1 3", 2, "v3i21"}, + + {"%1 = OpTypeFloat 32 %2 = OpTypeVector %1 2", 2, "v2float"}, + // OpName overrides the element name. + {"OpName %1 \"time\" %1 = OpTypeFloat 32 %2 = OpTypeVector %1 2", 2, + "v2time"}, + }), ); + +INSTANTIATE_TEST_CASE_P( + MatrixType, FriendlyNameTest, + ::testing::ValuesIn(std::vector{ + {"%1 = OpTypeBool %2 = OpTypeVector %1 2 %3 = OpTypeMatrix %2 2", 3, + "mat2v2bool"}, + {"%1 = OpTypeFloat 32 %2 = OpTypeVector %1 2 %3 = OpTypeMatrix %2 3", 3, + "mat3v2float"}, + {"%1 = OpTypeFloat 32 %2 = OpTypeVector %1 2 %3 = OpTypeMatrix %2 4", 3, + "mat4v2float"}, + {"OpName %1 \"time\" %1 = OpTypeFloat 32 %2 = OpTypeVector %1 2 %3 = " + "OpTypeMatrix %2 4", + 3, "mat4v2time"}, + {"OpName %2 \"lat_long\" %1 = OpTypeFloat 32 %2 = OpTypeVector %1 2 %3 " + "= OpTypeMatrix %2 4", + 3, "mat4lat_long"}, + }), ); + +INSTANTIATE_TEST_CASE_P( + OpName, FriendlyNameTest, + ::testing::ValuesIn(std::vector{ + {"OpName %1 \"abcdefg\"", 1, "abcdefg"}, + {"OpName %1 \"Hello world!\"", 1, "Hello_world_"}, + {"OpName %1 \"0123456789\"", 1, "0123456789"}, + {"OpName %1 \"_\"", 1, "_"}, + // An empty string is not valid for SPIR-V assembly IDs. + {"OpName %1 \"\"", 1, "_"}, + // Test uniqueness when presented with things mapping to "_" + {"OpName %1 \"\" OpName %2 \"\"", 1, "_"}, + {"OpName %1 \"\" OpName %2 \"\"", 2, "__0"}, + {"OpName %1 \"\" OpName %2 \"\" OpName %3 \"_\"", 3, "__1"}, + // Test uniqueness of names that are forced to be + // numbers. + {"OpName %1 \"2\" OpName %2 \"2\"", 1, "2"}, + {"OpName %1 \"2\" OpName %2 \"2\"", 2, "2_0"}, + // Test uniqueness in the face of forward references + // for Ids that don't already have friendly names. + // In particular, the first OpDecorate assigns the name, and + // the second one can't override it. + {"OpDecorate %1 Volatile OpDecorate %1 Restrict", 1, "1"}, + // But a forced name can override the name that + // would have been assigned via the OpDecorate + // forward reference. + {"OpName %1 \"mememe\" OpDecorate %1 Volatile OpDecorate %1 Restrict", + 1, "mememe"}, + // OpName can override other inferences. We assume valid instruction + // ordering, where OpName precedes type definitions. + {"OpName %1 \"myfloat\" %1 = OpTypeFloat 32", 1, "myfloat"}, + }), ); + +INSTANTIATE_TEST_CASE_P( + UniquenessHeuristic, FriendlyNameTest, + ::testing::ValuesIn(std::vector{ + {"%1 = OpTypeVoid %2 = OpTypeVoid %3 = OpTypeVoid", 1, "void"}, + {"%1 = OpTypeVoid %2 = OpTypeVoid %3 = OpTypeVoid", 2, "void_0"}, + {"%1 = OpTypeVoid %2 = OpTypeVoid %3 = OpTypeVoid", 3, "void_1"}, + }), ); + +INSTANTIATE_TEST_CASE_P(Arrays, FriendlyNameTest, + ::testing::ValuesIn(std::vector{ + {"OpName %2 \"FortyTwo\" %1 = OpTypeFloat 32 " + "%2 = OpConstant %1 42 %3 = OpTypeArray %1 %2", + 3, "_arr_float_FortyTwo"}, + {"%1 = OpTypeInt 32 0 " + "%2 = OpTypeRuntimeArray %1", + 2, "_runtimearr_uint"}, + }), ); + +INSTANTIATE_TEST_CASE_P(Structs, FriendlyNameTest, + ::testing::ValuesIn(std::vector{ + {"%1 = OpTypeBool " + "%2 = OpTypeStruct %1 %1 %1", + 2, "_struct_2"}, + {"%1 = OpTypeBool " + "%2 = OpTypeStruct %1 %1 %1 " + "%3 = OpTypeStruct %2 %2", + 3, "_struct_3"}, + }), ); + +INSTANTIATE_TEST_CASE_P( + Pointer, FriendlyNameTest, + ::testing::ValuesIn(std::vector{ + {"%1 = OpTypeFloat 32 %2 = OpTypePointer Workgroup %1", 2, + "_ptr_Workgroup_float"}, + {"%1 = OpTypeBool %2 = OpTypePointer Private %1", 2, + "_ptr_Private_bool"}, + // OpTypeForwardPointer doesn't force generation of the name for its + // target type. + {"%1 = OpTypeBool OpTypeForwardPointer %2 Private %2 = OpTypePointer " + "Private %1", + 2, "_ptr_Private_bool"}, + }), ); + +INSTANTIATE_TEST_CASE_P(ExoticTypes, FriendlyNameTest, + ::testing::ValuesIn(std::vector{ + {"%1 = OpTypeEvent", 1, "Event"}, + {"%1 = OpTypeDeviceEvent", 1, "DeviceEvent"}, + {"%1 = OpTypeReserveId", 1, "ReserveId"}, + {"%1 = OpTypeQueue", 1, "Queue"}, + {"%1 = OpTypeOpaque \"hello world!\"", 1, + "Opaque_hello_world_"}, + {"%1 = OpTypePipe ReadOnly", 1, "PipeReadOnly"}, + {"%1 = OpTypePipe WriteOnly", 1, "PipeWriteOnly"}, + {"%1 = OpTypePipe ReadWrite", 1, "PipeReadWrite"}, + {"%1 = OpTypePipeStorage", 1, "PipeStorage"}, + {"%1 = OpTypeNamedBarrier", 1, "NamedBarrier"}, + }), ); + +// Makes a test case for a BuiltIn variable declaration. +NameIdCase BuiltInCase(std::string assembly_name, std::string expected) { + return NameIdCase{std::string("OpDecorate %1 BuiltIn ") + assembly_name + + " %1 = OpVariable %2 Input", + 1, expected}; +} + +// Makes a test case for a BuiltIn variable declaration. In this overload, +// the expected result is the same as the assembly name. +NameIdCase BuiltInCase(std::string assembly_name) { + return BuiltInCase(assembly_name, assembly_name); +} + +// Makes a test case for a BuiltIn variable declaration. In this overload, +// the expected result is the same as the assembly name, but with a "gl_" +// prefix. +NameIdCase BuiltInGLCase(std::string assembly_name) { + return BuiltInCase(assembly_name, std::string("gl_") + assembly_name); +} + +INSTANTIATE_TEST_CASE_P( + BuiltIns, FriendlyNameTest, + ::testing::ValuesIn(std::vector{ + BuiltInGLCase("Position"), + BuiltInGLCase("PointSize"), + BuiltInGLCase("ClipDistance"), + BuiltInGLCase("CullDistance"), + BuiltInCase("VertexId", "gl_VertexID"), + BuiltInCase("InstanceId", "gl_InstanceID"), + BuiltInCase("PrimitiveId", "gl_PrimitiveID"), + BuiltInCase("InvocationId", "gl_InvocationID"), + BuiltInGLCase("Layer"), + BuiltInGLCase("ViewportIndex"), + BuiltInGLCase("TessLevelOuter"), + BuiltInGLCase("TessLevelInner"), + BuiltInGLCase("TessCoord"), + BuiltInGLCase("PatchVertices"), + BuiltInGLCase("FragCoord"), + BuiltInGLCase("PointCoord"), + BuiltInGLCase("FrontFacing"), + BuiltInCase("SampleId", "gl_SampleID"), + BuiltInGLCase("SamplePosition"), + BuiltInGLCase("SampleMask"), + BuiltInGLCase("FragDepth"), + BuiltInGLCase("HelperInvocation"), + BuiltInCase("NumWorkgroups", "gl_NumWorkGroups"), + BuiltInCase("WorkgroupSize", "gl_WorkGroupSize"), + BuiltInCase("WorkgroupId", "gl_WorkGroupID"), + BuiltInCase("LocalInvocationId", "gl_LocalInvocationID"), + BuiltInCase("GlobalInvocationId", "gl_GlobalInvocationID"), + BuiltInGLCase("LocalInvocationIndex"), + BuiltInCase("WorkDim"), + BuiltInCase("GlobalSize"), + BuiltInCase("EnqueuedWorkgroupSize"), + BuiltInCase("GlobalOffset"), + BuiltInCase("GlobalLinearId"), + BuiltInCase("SubgroupSize"), + BuiltInCase("SubgroupMaxSize"), + BuiltInCase("NumSubgroups"), + BuiltInCase("NumEnqueuedSubgroups"), + BuiltInCase("SubgroupId"), + BuiltInCase("SubgroupLocalInvocationId"), + BuiltInGLCase("VertexIndex"), + BuiltInGLCase("InstanceIndex"), + BuiltInCase("SubgroupEqMaskKHR"), + BuiltInCase("SubgroupGeMaskKHR"), + BuiltInCase("SubgroupGtMaskKHR"), + BuiltInCase("SubgroupLeMaskKHR"), + BuiltInCase("SubgroupLtMaskKHR"), + }), ); + +INSTANTIATE_TEST_CASE_P(DebugNameOverridesBuiltin, FriendlyNameTest, + ::testing::ValuesIn(std::vector{ + {"OpName %1 \"foo\" OpDecorate %1 BuiltIn WorkDim " + "%1 = OpVariable %2 Input", + 1, "foo"}}), ); + +INSTANTIATE_TEST_CASE_P( + SimpleIntegralConstants, FriendlyNameTest, + ::testing::ValuesIn(std::vector{ + {"%1 = OpTypeInt 32 0 %2 = OpConstant %1 0", 2, "uint_0"}, + {"%1 = OpTypeInt 32 0 %2 = OpConstant %1 1", 2, "uint_1"}, + {"%1 = OpTypeInt 32 0 %2 = OpConstant %1 2", 2, "uint_2"}, + {"%1 = OpTypeInt 32 0 %2 = OpConstant %1 9", 2, "uint_9"}, + {"%1 = OpTypeInt 32 0 %2 = OpConstant %1 42", 2, "uint_42"}, + {"%1 = OpTypeInt 32 1 %2 = OpConstant %1 0", 2, "int_0"}, + {"%1 = OpTypeInt 32 1 %2 = OpConstant %1 1", 2, "int_1"}, + {"%1 = OpTypeInt 32 1 %2 = OpConstant %1 2", 2, "int_2"}, + {"%1 = OpTypeInt 32 1 %2 = OpConstant %1 9", 2, "int_9"}, + {"%1 = OpTypeInt 32 1 %2 = OpConstant %1 42", 2, "int_42"}, + {"%1 = OpTypeInt 32 1 %2 = OpConstant %1 -42", 2, "int_n42"}, + // Exotic bit widths + {"%1 = OpTypeInt 33 0 %2 = OpConstant %1 0", 2, "u33_0"}, + {"%1 = OpTypeInt 33 1 %2 = OpConstant %1 10", 2, "i33_10"}, + {"%1 = OpTypeInt 33 1 %2 = OpConstant %1 -19", 2, "i33_n19"}, + }), ); + +INSTANTIATE_TEST_CASE_P( + SimpleFloatConstants, FriendlyNameTest, + ::testing::ValuesIn(std::vector{ + {"%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.ff4p+16", 2, + "half_0x1_ff4p_16"}, + {"%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.d2cp-10", 2, + "half_n0x1_d2cpn10"}, + // 32-bit floats + {"%1 = OpTypeFloat 32\n%2 = OpConstant %1 -3.125", 2, "float_n3_125"}, + {"%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1.8p+128", 2, + "float_0x1_8p_128"}, // NaN + {"%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1.0002p+128", 2, + "float_n0x1_0002p_128"}, // NaN + {"%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1p+128", 2, + "float_0x1p_128"}, // Inf + {"%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1p+128", 2, + "float_n0x1p_128"}, // -Inf + // 64-bit floats + {"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -3.125", 2, "double_n3_125"}, + {"%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.ffffffffffffap-1023", 2, + "double_0x1_ffffffffffffapn1023"}, // small normal + {"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.ffffffffffffap-1023", 2, + "double_n0x1_ffffffffffffapn1023"}, + {"%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.8p+1024", 2, + "double_0x1_8p_1024"}, // NaN + {"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.0002p+1024", 2, + "double_n0x1_0002p_1024"}, // NaN + {"%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1p+1024", 2, + "double_0x1p_1024"}, // Inf + {"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1p+1024", 2, + "double_n0x1p_1024"}, // -Inf + }), ); + +INSTANTIATE_TEST_CASE_P( + BooleanConstants, FriendlyNameTest, + ::testing::ValuesIn(std::vector{ + {"%1 = OpTypeBool\n%2 = OpConstantTrue %1", 2, "true"}, + {"%1 = OpTypeBool\n%2 = OpConstantFalse %1", 2, "false"}, + }), ); + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opcode_make_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opcode_make_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opcode_make_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opcode_make_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,42 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +namespace { + +// A sampling of word counts. Covers extreme points well, and all bit +// positions, and some combinations of bit positions. +const uint16_t kSampleWordCounts[] = { + 0, 1, 2, 3, 4, 8, 16, 32, 64, 127, 128, + 256, 511, 512, 1024, 2048, 4096, 8192, 16384, 32768, 0xfffe, 0xffff}; + +// A sampling of opcode values. Covers the lower values well, a few samples +// around the number of core instructions (as of this writing), and some +// higher values. +const uint16_t kSampleOpcodes[] = {0, 1, 2, 3, 4, 100, + 300, 305, 1023, 0xfffe, 0xffff}; + +TEST(OpcodeMake, Samples) { + for (auto wordCount : kSampleWordCounts) { + for (auto opcode : kSampleOpcodes) { + uint32_t word = 0; + word |= uint32_t(opcode); + word |= uint32_t(wordCount) << 16; + EXPECT_EQ(word, spvOpcodeMake(wordCount, SpvOp(opcode))); + } + } +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opcode_require_capabilities_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opcode_require_capabilities_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opcode_require_capabilities_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opcode_require_capabilities_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +#include "enum_set.h" + +namespace { + +using libspirv::CapabilitySet; +using spvtest::ElementsIn; + +// Capabilities required by an Opcode. +struct ExpectedOpCodeCapabilities { + SpvOp opcode; + CapabilitySet capabilities; +}; + +using OpcodeTableCapabilitiesTest = + ::testing::TestWithParam; + +TEST_P(OpcodeTableCapabilitiesTest, TableEntryMatchesExpectedCapabilities) { + auto env = SPV_ENV_UNIVERSAL_1_1; + spv_opcode_table opcodeTable; + ASSERT_EQ(SPV_SUCCESS, spvOpcodeTableGet(&opcodeTable, env)); + spv_opcode_desc entry; + ASSERT_EQ(SPV_SUCCESS, spvOpcodeTableValueLookup(env, opcodeTable, + GetParam().opcode, &entry)); + EXPECT_EQ( + ElementsIn(GetParam().capabilities), + ElementsIn(CapabilitySet(entry->numCapabilities, entry->capabilities))); +} + +INSTANTIATE_TEST_CASE_P( + TableRowTest, OpcodeTableCapabilitiesTest, + // Spot-check a few opcodes. + ::testing::Values( + ExpectedOpCodeCapabilities{ + SpvOpImageQuerySize, + CapabilitySet{SpvCapabilityKernel, SpvCapabilityImageQuery}}, + ExpectedOpCodeCapabilities{ + SpvOpImageQuerySizeLod, + CapabilitySet{SpvCapabilityKernel, SpvCapabilityImageQuery}}, + ExpectedOpCodeCapabilities{ + SpvOpImageQueryLevels, + CapabilitySet{SpvCapabilityKernel, SpvCapabilityImageQuery}}, + ExpectedOpCodeCapabilities{ + SpvOpImageQuerySamples, + CapabilitySet{SpvCapabilityKernel, SpvCapabilityImageQuery}}, + ExpectedOpCodeCapabilities{SpvOpImageSparseSampleImplicitLod, + CapabilitySet{SpvCapabilitySparseResidency}}, + ExpectedOpCodeCapabilities{SpvOpCopyMemorySized, + CapabilitySet{SpvCapabilityAddresses}}, + ExpectedOpCodeCapabilities{SpvOpArrayLength, + CapabilitySet{SpvCapabilityShader}}, + ExpectedOpCodeCapabilities{SpvOpFunction, CapabilitySet()}, + ExpectedOpCodeCapabilities{SpvOpConvertFToS, CapabilitySet()}, + ExpectedOpCodeCapabilities{SpvOpEmitStreamVertex, + CapabilitySet{SpvCapabilityGeometryStreams}}, + ExpectedOpCodeCapabilities{SpvOpTypeNamedBarrier, + CapabilitySet{SpvCapabilityNamedBarrier}}, + ExpectedOpCodeCapabilities{ + SpvOpGetKernelMaxNumSubgroups, + CapabilitySet{SpvCapabilitySubgroupDispatch}}), ); + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opcode_split_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opcode_split_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opcode_split_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opcode_split_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,28 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +namespace { + +TEST(OpcodeSplit, Default) { + uint32_t word = spvOpcodeMake(42, (SpvOp)23); + uint16_t wordCount = 0; + uint16_t opcode; + spvOpcodeSplit(word, &wordCount, &opcode); + ASSERT_EQ(42, wordCount); + ASSERT_EQ(23, opcode); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opcode_table_get_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opcode_table_get_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opcode_table_get_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opcode_table_get_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,38 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include "unit_spirv.h" + +namespace { + +using GetTargetOpcodeTableGetTest = ::testing::TestWithParam; +using ::testing::ValuesIn; + +TEST_P(GetTargetOpcodeTableGetTest, SanityCheck) { + spv_opcode_table table; + ASSERT_EQ(SPV_SUCCESS, spvOpcodeTableGet(&table, GetParam())); + ASSERT_NE(0u, table->count); + ASSERT_NE(nullptr, table->entries); +} + +TEST_P(GetTargetOpcodeTableGetTest, InvalidPointerTable) { + ASSERT_EQ(SPV_ERROR_INVALID_POINTER, spvOpcodeTableGet(nullptr, GetParam())); +} + +INSTANTIATE_TEST_CASE_P(OpcodeTableGet, GetTargetOpcodeTableGetTest, + ValuesIn(spvtest::AllTargetEnvironments())); + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/operand_capabilities_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/operand_capabilities_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/operand_capabilities_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/operand_capabilities_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,723 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Test capability dependencies for enums. + +#include + +#include "gmock/gmock.h" + +#include "enum_set.h" +#include "unit_spirv.h" + +namespace { + +using libspirv::CapabilitySet; +using spvtest::ElementsIn; +using std::get; +using std::tuple; +using ::testing::Combine; +using ::testing::Eq; +using ::testing::TestWithParam; +using ::testing::Values; +using ::testing::ValuesIn; + +// A test case for mapping an enum to a capability mask. +struct EnumCapabilityCase { + spv_operand_type_t type; + uint32_t value; + CapabilitySet expected_capabilities; +}; + +// Test fixture for testing EnumCapabilityCases. +using EnumCapabilityTest = + TestWithParam>; + +TEST_P(EnumCapabilityTest, Sample) { + const auto env = get<0>(GetParam()); + const auto context = spvContextCreate(env); + const libspirv::AssemblyGrammar grammar(context); + spv_operand_desc entry; + + ASSERT_EQ(SPV_SUCCESS, + grammar.lookupOperand(get<1>(GetParam()).type, + get<1>(GetParam()).value, &entry)); + const auto cap_set = grammar.filterCapsAgainstTargetEnv( + entry->capabilities, entry->numCapabilities); + + EXPECT_THAT(ElementsIn(cap_set), + Eq(ElementsIn(get<1>(GetParam()).expected_capabilities))) + << " capability value " << get<1>(GetParam()).value; +} + +#define CASE0(TYPE, VALUE) \ + { \ + SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), {} \ + } +#define CASE1(TYPE, VALUE, CAP) \ + { \ + SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), CapabilitySet { \ + SpvCapability##CAP \ + } \ + } +#define CASE2(TYPE, VALUE, CAP1, CAP2) \ + { \ + SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), CapabilitySet { \ + SpvCapability##CAP1, SpvCapability##CAP2 \ + } \ + } +#define CASE5(TYPE, VALUE, CAP1, CAP2, CAP3, CAP4, CAP5) \ + { \ + SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), CapabilitySet { \ + SpvCapability##CAP1, SpvCapability##CAP2, SpvCapability##CAP3, \ + SpvCapability##CAP4, SpvCapability##CAP5 \ + } \ + } + +// See SPIR-V Section 3.3 Execution Model +INSTANTIATE_TEST_CASE_P( + ExecutionModel, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE1(EXECUTION_MODEL, ExecutionModelVertex, Shader), + CASE1(EXECUTION_MODEL, ExecutionModelTessellationControl, + Tessellation), + CASE1(EXECUTION_MODEL, ExecutionModelTessellationEvaluation, + Tessellation), + CASE1(EXECUTION_MODEL, ExecutionModelGeometry, Geometry), + CASE1(EXECUTION_MODEL, ExecutionModelFragment, Shader), + CASE1(EXECUTION_MODEL, ExecutionModelGLCompute, Shader), + CASE1(EXECUTION_MODEL, ExecutionModelKernel, Kernel), + })), ); + +// See SPIR-V Section 3.4 Addressing Model +INSTANTIATE_TEST_CASE_P( + AddressingModel, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE0(ADDRESSING_MODEL, AddressingModelLogical), + CASE1(ADDRESSING_MODEL, AddressingModelPhysical32, Addresses), + CASE1(ADDRESSING_MODEL, AddressingModelPhysical64, Addresses), + })), ); + +// See SPIR-V Section 3.5 Memory Model +INSTANTIATE_TEST_CASE_P( + MemoryModel, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE1(MEMORY_MODEL, MemoryModelSimple, Shader), + CASE1(MEMORY_MODEL, MemoryModelGLSL450, Shader), + CASE1(MEMORY_MODEL, MemoryModelOpenCL, Kernel), + })), ); + +// See SPIR-V Section 3.6 Execution Mode +INSTANTIATE_TEST_CASE_P( + ExecutionMode, EnumCapabilityTest, + Combine( + Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE1(EXECUTION_MODE, ExecutionModeInvocations, Geometry), + CASE1(EXECUTION_MODE, ExecutionModeSpacingEqual, Tessellation), + CASE1(EXECUTION_MODE, ExecutionModeSpacingFractionalEven, + Tessellation), + CASE1(EXECUTION_MODE, ExecutionModeSpacingFractionalOdd, + Tessellation), + CASE1(EXECUTION_MODE, ExecutionModeVertexOrderCw, Tessellation), + CASE1(EXECUTION_MODE, ExecutionModeVertexOrderCcw, Tessellation), + CASE1(EXECUTION_MODE, ExecutionModePixelCenterInteger, Shader), + CASE1(EXECUTION_MODE, ExecutionModeOriginUpperLeft, Shader), + CASE1(EXECUTION_MODE, ExecutionModeOriginLowerLeft, Shader), + CASE1(EXECUTION_MODE, ExecutionModeEarlyFragmentTests, Shader), + CASE1(EXECUTION_MODE, ExecutionModePointMode, Tessellation), + CASE1(EXECUTION_MODE, ExecutionModeXfb, TransformFeedback), + CASE1(EXECUTION_MODE, ExecutionModeDepthReplacing, Shader), + CASE1(EXECUTION_MODE, ExecutionModeDepthGreater, Shader), + CASE1(EXECUTION_MODE, ExecutionModeDepthLess, Shader), + CASE1(EXECUTION_MODE, ExecutionModeDepthUnchanged, Shader), + CASE0(EXECUTION_MODE, ExecutionModeLocalSize), + CASE1(EXECUTION_MODE, ExecutionModeLocalSizeHint, Kernel), + CASE1(EXECUTION_MODE, ExecutionModeInputPoints, Geometry), + CASE1(EXECUTION_MODE, ExecutionModeInputLines, Geometry), + CASE1(EXECUTION_MODE, ExecutionModeInputLinesAdjacency, Geometry), + CASE2(EXECUTION_MODE, ExecutionModeTriangles, Geometry, + Tessellation), + CASE1(EXECUTION_MODE, ExecutionModeInputTrianglesAdjacency, + Geometry), + CASE1(EXECUTION_MODE, ExecutionModeQuads, Tessellation), + CASE1(EXECUTION_MODE, ExecutionModeIsolines, Tessellation), + CASE2(EXECUTION_MODE, ExecutionModeOutputVertices, Geometry, + Tessellation), + CASE1(EXECUTION_MODE, ExecutionModeOutputPoints, Geometry), + CASE1(EXECUTION_MODE, ExecutionModeOutputLineStrip, Geometry), + CASE1(EXECUTION_MODE, ExecutionModeOutputTriangleStrip, Geometry), + CASE1(EXECUTION_MODE, ExecutionModeVecTypeHint, Kernel), + CASE1(EXECUTION_MODE, ExecutionModeContractionOff, Kernel), + })), ); + +INSTANTIATE_TEST_CASE_P( + ExecutionModeV11, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE1(EXECUTION_MODE, ExecutionModeInitializer, Kernel), + CASE1(EXECUTION_MODE, ExecutionModeFinalizer, Kernel), + CASE1(EXECUTION_MODE, ExecutionModeSubgroupSize, + SubgroupDispatch), + CASE1(EXECUTION_MODE, ExecutionModeSubgroupsPerWorkgroup, + SubgroupDispatch)})), ); + +// See SPIR-V Section 3.7 Storage Class +INSTANTIATE_TEST_CASE_P( + StorageClass, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE0(STORAGE_CLASS, StorageClassUniformConstant), + CASE1(STORAGE_CLASS, StorageClassUniform, Shader), + CASE1(STORAGE_CLASS, StorageClassOutput, Shader), + CASE0(STORAGE_CLASS, StorageClassWorkgroup), + CASE0(STORAGE_CLASS, StorageClassCrossWorkgroup), + CASE1(STORAGE_CLASS, StorageClassPrivate, Shader), + CASE0(STORAGE_CLASS, StorageClassFunction), + CASE1(STORAGE_CLASS, StorageClassGeneric, + GenericPointer), // Bug 14287 + CASE1(STORAGE_CLASS, StorageClassPushConstant, Shader), + CASE1(STORAGE_CLASS, StorageClassAtomicCounter, AtomicStorage), + CASE0(STORAGE_CLASS, StorageClassImage), + })), ); + +// See SPIR-V Section 3.8 Dim +INSTANTIATE_TEST_CASE_P( + Dim, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE1(DIMENSIONALITY, Dim1D, Sampled1D), + CASE0(DIMENSIONALITY, Dim2D), + CASE0(DIMENSIONALITY, Dim3D), + CASE1(DIMENSIONALITY, DimCube, Shader), + CASE1(DIMENSIONALITY, DimRect, SampledRect), + CASE1(DIMENSIONALITY, DimBuffer, SampledBuffer), + CASE1(DIMENSIONALITY, DimSubpassData, InputAttachment), + })), ); + +// See SPIR-V Section 3.9 Sampler Addressing Mode +INSTANTIATE_TEST_CASE_P( + SamplerAddressingMode, EnumCapabilityTest, + Combine( + Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeNone, Kernel), + CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeClampToEdge, + Kernel), + CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeClamp, Kernel), + CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeRepeat, Kernel), + CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeRepeatMirrored, + Kernel), + })), ); + +// See SPIR-V Section 3.10 Sampler Filter Mode +INSTANTIATE_TEST_CASE_P( + SamplerFilterMode, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE1(SAMPLER_FILTER_MODE, SamplerFilterModeNearest, Kernel), + CASE1(SAMPLER_FILTER_MODE, SamplerFilterModeLinear, Kernel), + })), ); + +// See SPIR-V Section 3.11 Image Format +INSTANTIATE_TEST_CASE_P( + ImageFormat, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + // clang-format off + CASE0(SAMPLER_IMAGE_FORMAT, ImageFormatUnknown), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba32f, Shader), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16f, Shader), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR32f, Shader), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8, Shader), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8Snorm, Shader), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg32f, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16f, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR11fG11fB10f, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16f, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgb10A2, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg8, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16Snorm, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16Snorm, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg8Snorm, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16Snorm, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8Snorm, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba32i, Shader), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16i, Shader), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8i, Shader), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR32i, Shader), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg32i, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16i, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg8i, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16i, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8i, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba32ui, Shader), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16ui, Shader), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8ui, Shader), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8ui, Shader), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgb10a2ui, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg32ui, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16ui, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg8ui, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16ui, StorageImageExtendedFormats), + CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8ui, StorageImageExtendedFormats), + // clang-format on + })), ); + +// See SPIR-V Section 3.12 Image Channel Order +INSTANTIATE_TEST_CASE_P( + ImageChannelOrder, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderR, Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderA, Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRG, Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRA, Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRGB, Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRGBA, Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderBGRA, Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderARGB, Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderIntensity, Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderLuminance, Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRx, Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRGx, Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRGBx, Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderDepth, Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderDepthStencil, + Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersRGB, Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersRGBx, Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersRGBA, Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersBGRA, Kernel), + CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderABGR, Kernel), + })), ); + +// See SPIR-V Section 3.13 Image Channel Data Type +INSTANTIATE_TEST_CASE_P( + ImageChannelDataType, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + // clang-format off + CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSnormInt8, Kernel), + CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSnormInt16, Kernel), + CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt8, Kernel), + CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt16, Kernel), + CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormShort565, Kernel), + CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormShort555, Kernel), + CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt101010, Kernel), + CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSignedInt8, Kernel), + CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSignedInt16, Kernel), + CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSignedInt32, Kernel), + CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnsignedInt8, Kernel), + CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnsignedInt16, Kernel), + CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnsignedInt32, Kernel), + CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeHalfFloat, Kernel), + CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeFloat, Kernel), + CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt24, Kernel), + CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt101010_2, Kernel), + // clang-format on + })), ); + +// See SPIR-V Section 3.14 Image Operands +INSTANTIATE_TEST_CASE_P( + ImageOperands, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + // clang-format off + CASE0(OPTIONAL_IMAGE, ImageOperandsMaskNone), + CASE1(OPTIONAL_IMAGE, ImageOperandsBiasMask, Shader), + CASE0(OPTIONAL_IMAGE, ImageOperandsLodMask), + CASE0(OPTIONAL_IMAGE, ImageOperandsGradMask), + CASE0(OPTIONAL_IMAGE, ImageOperandsConstOffsetMask), + CASE1(OPTIONAL_IMAGE, ImageOperandsOffsetMask, ImageGatherExtended), + CASE0(OPTIONAL_IMAGE, ImageOperandsConstOffsetsMask), + CASE0(OPTIONAL_IMAGE, ImageOperandsSampleMask), + CASE1(OPTIONAL_IMAGE, ImageOperandsMinLodMask, MinLod), + // clang-format on + })), ); + +// See SPIR-V Section 3.15 FP Fast Math Mode +INSTANTIATE_TEST_CASE_P( + FPFastMathMode, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE0(FP_FAST_MATH_MODE, FPFastMathModeMaskNone), + CASE1(FP_FAST_MATH_MODE, FPFastMathModeNotNaNMask, Kernel), + CASE1(FP_FAST_MATH_MODE, FPFastMathModeNotInfMask, Kernel), + CASE1(FP_FAST_MATH_MODE, FPFastMathModeNSZMask, Kernel), + CASE1(FP_FAST_MATH_MODE, FPFastMathModeAllowRecipMask, Kernel), + CASE1(FP_FAST_MATH_MODE, FPFastMathModeFastMask, Kernel), + })), ); + +// See SPIR-V Section 3.17 Linkage Type +INSTANTIATE_TEST_CASE_P( + LinkageType, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE1(LINKAGE_TYPE, LinkageTypeExport, Linkage), + CASE1(LINKAGE_TYPE, LinkageTypeImport, Linkage), + })), ); + +// See SPIR-V Section 3.18 Access Qualifier +INSTANTIATE_TEST_CASE_P( + AccessQualifier, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE1(ACCESS_QUALIFIER, AccessQualifierReadOnly, Kernel), + CASE1(ACCESS_QUALIFIER, AccessQualifierWriteOnly, Kernel), + CASE1(ACCESS_QUALIFIER, AccessQualifierReadWrite, Kernel), + })), ); + +// See SPIR-V Section 3.19 Function Parameter Attribute +INSTANTIATE_TEST_CASE_P( + FunctionParameterAttribute, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + // clang-format off + CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeZext, Kernel), + CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeSext, Kernel), + CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeByVal, Kernel), + CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeSret, Kernel), + CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoAlias, Kernel), + CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoCapture, Kernel), + CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoWrite, Kernel), + CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoReadWrite, Kernel), + // clang-format on + })), ); + +// See SPIR-V Section 3.20 Decoration +INSTANTIATE_TEST_CASE_P( + Decoration, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE1(DECORATION, DecorationRelaxedPrecision, Shader), + // DecorationSpecId handled below. + CASE1(DECORATION, DecorationBlock, Shader), + CASE1(DECORATION, DecorationBufferBlock, Shader), + CASE1(DECORATION, DecorationRowMajor, Matrix), + CASE1(DECORATION, DecorationColMajor, Matrix), + CASE1(DECORATION, DecorationArrayStride, Shader), + CASE1(DECORATION, DecorationMatrixStride, Matrix), // Bug 15234 + CASE1(DECORATION, DecorationGLSLShared, Shader), + CASE1(DECORATION, DecorationGLSLPacked, Shader), + CASE1(DECORATION, DecorationCPacked, Kernel), + CASE0(DECORATION, DecorationBuiltIn), // Bug 15248 + // Value 12 placeholder + CASE1(DECORATION, DecorationNoPerspective, Shader), + CASE1(DECORATION, DecorationFlat, Shader), + CASE1(DECORATION, DecorationPatch, Tessellation), + CASE1(DECORATION, DecorationCentroid, Shader), + CASE1(DECORATION, DecorationSample, + SampleRateShading), // Bug 15234 + CASE1(DECORATION, DecorationInvariant, Shader), + CASE0(DECORATION, DecorationRestrict), + CASE0(DECORATION, DecorationAliased), + CASE0(DECORATION, DecorationVolatile), + CASE1(DECORATION, DecorationConstant, Kernel), + CASE0(DECORATION, DecorationCoherent), + CASE0(DECORATION, DecorationNonWritable), + CASE0(DECORATION, DecorationNonReadable), + CASE1(DECORATION, DecorationUniform, Shader), + // Value 27 is an intentional gap in the spec numbering. + CASE1(DECORATION, DecorationSaturatedConversion, Kernel), + CASE1(DECORATION, DecorationStream, GeometryStreams), + CASE1(DECORATION, DecorationLocation, Shader), + CASE1(DECORATION, DecorationComponent, Shader), + CASE1(DECORATION, DecorationIndex, Shader), + CASE1(DECORATION, DecorationBinding, Shader), + CASE1(DECORATION, DecorationDescriptorSet, Shader), + CASE1(DECORATION, DecorationOffset, Shader), // Bug 15268 + CASE1(DECORATION, DecorationXfbBuffer, TransformFeedback), + CASE1(DECORATION, DecorationXfbStride, TransformFeedback), + CASE1(DECORATION, DecorationFuncParamAttr, Kernel), + CASE1(DECORATION, DecorationFPFastMathMode, Kernel), + CASE1(DECORATION, DecorationLinkageAttributes, Linkage), + CASE1(DECORATION, DecorationNoContraction, Shader), + CASE1(DECORATION, DecorationInputAttachmentIndex, + InputAttachment), + CASE1(DECORATION, DecorationAlignment, Kernel), + })), ); + +#if 0 +// SpecId has different requirements in v1.0 and v1.1: +INSTANTIATE_TEST_CASE_P(DecorationSpecIdV10, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0), + ValuesIn(std::vector{CASE1( + DECORATION, DecorationSpecId, Shader)})), ); +#endif + +INSTANTIATE_TEST_CASE_P( + DecorationV11, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE2(DECORATION, DecorationSpecId, Shader, Kernel), + CASE1(DECORATION, DecorationMaxByteOffset, Addresses)})), ); + +// See SPIR-V Section 3.21 BuiltIn +INSTANTIATE_TEST_CASE_P( + BuiltIn, EnumCapabilityTest, + Combine( + Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + // clang-format off + CASE1(BUILT_IN, BuiltInPosition, Shader), + CASE1(BUILT_IN, BuiltInPointSize, Shader), + // 2 is an intentional gap in the spec numbering. + CASE1(BUILT_IN, BuiltInClipDistance, ClipDistance), // Bug 1407, 15234 + CASE1(BUILT_IN, BuiltInCullDistance, CullDistance), // Bug 1407, 15234 + CASE1(BUILT_IN, BuiltInVertexId, Shader), + CASE1(BUILT_IN, BuiltInInstanceId, Shader), + CASE2(BUILT_IN, BuiltInPrimitiveId, Geometry, Tessellation), + CASE2(BUILT_IN, BuiltInInvocationId, Geometry, Tessellation), + CASE1(BUILT_IN, BuiltInLayer, Geometry), + CASE1(BUILT_IN, BuiltInViewportIndex, MultiViewport), // Bug 15234 + CASE1(BUILT_IN, BuiltInTessLevelOuter, Tessellation), + CASE1(BUILT_IN, BuiltInTessLevelInner, Tessellation), + CASE1(BUILT_IN, BuiltInTessCoord, Tessellation), + CASE1(BUILT_IN, BuiltInPatchVertices, Tessellation), + CASE1(BUILT_IN, BuiltInFragCoord, Shader), + CASE1(BUILT_IN, BuiltInPointCoord, Shader), + CASE1(BUILT_IN, BuiltInFrontFacing, Shader), + CASE1(BUILT_IN, BuiltInSampleId, SampleRateShading), // Bug 15234 + CASE1(BUILT_IN, BuiltInSamplePosition, SampleRateShading), // Bug 15234 + CASE1(BUILT_IN, BuiltInSampleMask, Shader), // Bug 15234, Issue 182 + // Value 21 intentionally missing + CASE1(BUILT_IN, BuiltInFragDepth, Shader), + CASE1(BUILT_IN, BuiltInHelperInvocation, Shader), + CASE0(BUILT_IN, BuiltInNumWorkgroups), + CASE0(BUILT_IN, BuiltInWorkgroupSize), + CASE0(BUILT_IN, BuiltInWorkgroupId), + CASE0(BUILT_IN, BuiltInLocalInvocationId), + CASE0(BUILT_IN, BuiltInGlobalInvocationId), + CASE0(BUILT_IN, BuiltInLocalInvocationIndex), + CASE1(BUILT_IN, BuiltInWorkDim, Kernel), + CASE1(BUILT_IN, BuiltInGlobalSize, Kernel), + CASE1(BUILT_IN, BuiltInEnqueuedWorkgroupSize, Kernel), + CASE1(BUILT_IN, BuiltInGlobalOffset, Kernel), + CASE1(BUILT_IN, BuiltInGlobalLinearId, Kernel), + // Value 35 intentionally missing + CASE2(BUILT_IN, BuiltInSubgroupSize, Kernel, SubgroupBallotKHR), + CASE1(BUILT_IN, BuiltInSubgroupMaxSize, Kernel), + CASE1(BUILT_IN, BuiltInNumSubgroups, Kernel), + CASE1(BUILT_IN, BuiltInNumEnqueuedSubgroups, Kernel), + CASE1(BUILT_IN, BuiltInSubgroupId, Kernel), + CASE2(BUILT_IN, BuiltInSubgroupLocalInvocationId, Kernel, SubgroupBallotKHR), + CASE1(BUILT_IN, BuiltInVertexIndex, Shader), + CASE1(BUILT_IN, BuiltInInstanceIndex, Shader), + // clang-format on + })), ); + +// See SPIR-V Section 3.22 Selection Control +INSTANTIATE_TEST_CASE_P( + SelectionControl, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE0(SELECTION_CONTROL, SelectionControlMaskNone), + CASE0(SELECTION_CONTROL, SelectionControlFlattenMask), + CASE0(SELECTION_CONTROL, SelectionControlDontFlattenMask), + })), ); + +// See SPIR-V Section 3.23 Loop Control +INSTANTIATE_TEST_CASE_P( + LoopControl, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE0(LOOP_CONTROL, LoopControlMaskNone), + CASE0(LOOP_CONTROL, LoopControlUnrollMask), + CASE0(LOOP_CONTROL, LoopControlDontUnrollMask), + })), ); + +INSTANTIATE_TEST_CASE_P( + LoopControlV11, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE0(LOOP_CONTROL, LoopControlDependencyInfiniteMask), + CASE0(LOOP_CONTROL, LoopControlDependencyLengthMask), + })), ); + +// See SPIR-V Section 3.24 Function Control +INSTANTIATE_TEST_CASE_P( + FunctionControl, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE0(FUNCTION_CONTROL, FunctionControlMaskNone), + CASE0(FUNCTION_CONTROL, FunctionControlInlineMask), + CASE0(FUNCTION_CONTROL, FunctionControlDontInlineMask), + CASE0(FUNCTION_CONTROL, FunctionControlPureMask), + CASE0(FUNCTION_CONTROL, FunctionControlConstMask), + })), ); + +// See SPIR-V Section 3.25 Memory Semantics +INSTANTIATE_TEST_CASE_P( + MemorySemantics, EnumCapabilityTest, + Combine( + Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsMaskNone), + CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsAcquireMask), + CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsReleaseMask), + CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsAcquireReleaseMask), + CASE0(MEMORY_SEMANTICS_ID, + MemorySemanticsSequentiallyConsistentMask), + CASE1(MEMORY_SEMANTICS_ID, MemorySemanticsUniformMemoryMask, + Shader), + CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsSubgroupMemoryMask), + CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsWorkgroupMemoryMask), + CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsCrossWorkgroupMemoryMask), + CASE1(MEMORY_SEMANTICS_ID, MemorySemanticsAtomicCounterMemoryMask, + AtomicStorage), // Bug 15234 + CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsImageMemoryMask), + })), ); + +// See SPIR-V Section 3.26 Memory Access +INSTANTIATE_TEST_CASE_P( + MemoryAccess, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessMaskNone), + CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessVolatileMask), + CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessAlignedMask), + CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessNontemporalMask), + })), ); + +// See SPIR-V Section 3.27 Scope +INSTANTIATE_TEST_CASE_P(Scope, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, + SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE0(SCOPE_ID, ScopeCrossDevice), + CASE0(SCOPE_ID, ScopeDevice), + CASE0(SCOPE_ID, ScopeWorkgroup), + CASE0(SCOPE_ID, ScopeSubgroup), + CASE0(SCOPE_ID, ScopeInvocation), + })), ); + +// See SPIR-V Section 3.28 Group Operation +INSTANTIATE_TEST_CASE_P( + GroupOperation, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE1(GROUP_OPERATION, GroupOperationReduce, Kernel), + CASE1(GROUP_OPERATION, GroupOperationInclusiveScan, Kernel), + CASE1(GROUP_OPERATION, GroupOperationExclusiveScan, Kernel), + })), ); + +// See SPIR-V Section 3.29 Kernel Enqueue Flags +INSTANTIATE_TEST_CASE_P( + KernelEnqueueFlags, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsNoWait, Kernel), + CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsWaitKernel, Kernel), + CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsWaitWorkGroup, + Kernel), + })), ); + +// See SPIR-V Section 3.30 Kernel Profiling Info +INSTANTIATE_TEST_CASE_P( + KernelProfilingInfo, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE0(KERNEL_PROFILING_INFO, KernelProfilingInfoMaskNone), + CASE1(KERNEL_PROFILING_INFO, KernelProfilingInfoCmdExecTimeMask, + Kernel), + })), ); + +// See SPIR-V Section 3.31 Capability +INSTANTIATE_TEST_CASE_P( + CapabilityDependsOn, EnumCapabilityTest, + Combine( + Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + // clang-format off + CASE0(CAPABILITY, CapabilityMatrix), + CASE1(CAPABILITY, CapabilityShader, Matrix), + CASE1(CAPABILITY, CapabilityGeometry, Shader), + CASE1(CAPABILITY, CapabilityTessellation, Shader), + CASE0(CAPABILITY, CapabilityAddresses), + CASE0(CAPABILITY, CapabilityLinkage), + CASE0(CAPABILITY, CapabilityKernel), + CASE1(CAPABILITY, CapabilityVector16, Kernel), + CASE1(CAPABILITY, CapabilityFloat16Buffer, Kernel), + CASE0(CAPABILITY, CapabilityFloat16), // Bug 15234 + CASE0(CAPABILITY, CapabilityFloat64), + CASE0(CAPABILITY, CapabilityInt64), + CASE1(CAPABILITY, CapabilityInt64Atomics, Int64), + CASE1(CAPABILITY, CapabilityImageBasic, Kernel), + CASE1(CAPABILITY, CapabilityImageReadWrite, ImageBasic), + CASE1(CAPABILITY, CapabilityImageMipmap, ImageBasic), + // Value 16 intentionally missing. + CASE1(CAPABILITY, CapabilityPipes, Kernel), + CASE0(CAPABILITY, CapabilityGroups), + CASE1(CAPABILITY, CapabilityDeviceEnqueue, Kernel), + CASE1(CAPABILITY, CapabilityLiteralSampler, Kernel), + CASE1(CAPABILITY, CapabilityAtomicStorage, Shader), + CASE0(CAPABILITY, CapabilityInt16), + CASE1(CAPABILITY, CapabilityTessellationPointSize, Tessellation), + CASE1(CAPABILITY, CapabilityGeometryPointSize, Geometry), + CASE1(CAPABILITY, CapabilityImageGatherExtended, Shader), + // Value 26 intentionally missing. + CASE1(CAPABILITY, CapabilityStorageImageMultisample, Shader), + CASE1(CAPABILITY, CapabilityUniformBufferArrayDynamicIndexing, Shader), + CASE1(CAPABILITY, CapabilitySampledImageArrayDynamicIndexing, Shader), + CASE1(CAPABILITY, CapabilityStorageBufferArrayDynamicIndexing, Shader), + CASE1(CAPABILITY, CapabilityStorageImageArrayDynamicIndexing, Shader), + CASE1(CAPABILITY, CapabilityClipDistance, Shader), + CASE1(CAPABILITY, CapabilityCullDistance, Shader), + CASE1(CAPABILITY, CapabilityImageCubeArray, SampledCubeArray), + CASE1(CAPABILITY, CapabilitySampleRateShading, Shader), + CASE1(CAPABILITY, CapabilityImageRect, SampledRect), + CASE1(CAPABILITY, CapabilitySampledRect, Shader), + CASE1(CAPABILITY, CapabilityGenericPointer, Addresses), + CASE1(CAPABILITY, CapabilityInt8, Kernel), + CASE1(CAPABILITY, CapabilityInputAttachment, Shader), + CASE1(CAPABILITY, CapabilitySparseResidency, Shader), + CASE1(CAPABILITY, CapabilityMinLod, Shader), + CASE1(CAPABILITY, CapabilityImage1D, Sampled1D), + CASE1(CAPABILITY, CapabilitySampledCubeArray, Shader), + CASE1(CAPABILITY, CapabilityImageBuffer, SampledBuffer), + CASE1(CAPABILITY, CapabilityImageMSArray, Shader), + CASE1(CAPABILITY, CapabilityStorageImageExtendedFormats, Shader), + CASE1(CAPABILITY, CapabilityImageQuery, Shader), + CASE1(CAPABILITY, CapabilityDerivativeControl, Shader), + CASE1(CAPABILITY, CapabilityInterpolationFunction, Shader), + CASE1(CAPABILITY, CapabilityTransformFeedback, Shader), + CASE1(CAPABILITY, CapabilityGeometryStreams, Geometry), + CASE1(CAPABILITY, CapabilityStorageImageReadWithoutFormat, Shader), + CASE1(CAPABILITY, CapabilityStorageImageWriteWithoutFormat, Shader), + CASE1(CAPABILITY, CapabilityMultiViewport, Geometry), + // clang-format on + })), ); + +INSTANTIATE_TEST_CASE_P( + CapabilityDependsOnV11, EnumCapabilityTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector{ + CASE1(CAPABILITY, CapabilitySubgroupDispatch, DeviceEnqueue), + CASE1(CAPABILITY, CapabilityNamedBarrier, Kernel), + CASE1(CAPABILITY, CapabilityPipeStorage, Pipes), + })), ); + +#undef CASE0 +#undef CASE1 +#undef CASE2 + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/operand-class-test-coverage.csv vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/operand-class-test-coverage.csv --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/operand-class-test-coverage.csv 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/operand-class-test-coverage.csv 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,43 @@ +Operand class,Example instruction,Notes,example unit test,negative-enum coverage location +" OperandNone,",UNUSED,not in grammar,,not enum +" OperandId,",many,ID,too many to count,not enum +" OperandOptionalId,","Source, Variable",OPTIONAL_ID,OpSourceAcceptsOptionalFileId,not enum +" OperandOptionalImage,",ImageFetch,,ImageOperandsTest,"TEST_F(ImageOperandsTest, WrongOperand)" +" OperandVariableIds,",ExtInst,,,not enum +" OperandOptionalLiteral,",ExecutionMode,,AnyExecutionMode,not enum +" OperandOptionalLiteralString,",Source,,OpSourceAcceptsOptionalSourceText,not enum +" OperandVariableLiterals,",Decorate,,OpDecorateSimpleTest,not enum +" OperandVariableIdLiteral,",GroupMemberDecorate,,GroupMemberDecorate*,not enum +" OperandVariableLiteralId,",Switch,,Switch*,not enum +" OperandLiteralNumber,","Source, Switch, ...",,Switch*,not enum +" OperandLiteralString,",SourceContinued,,OpSourceContinued,not enum +" OperandSource,",Source,,OpSource,not enum +" OperandExecutionModel,",EntryPoint,,OpEntryPointTest,"TEST_F(OpEntryPointTest, WrongModel)" +" OperandAddressing,",OpMemoryModel,,OpMemoryModelTest,"TEST_F(OpMemoryModelTest, WrongModel)" +" OperandMemory,",OpMemoryModel,,OpMemoryModelTest,"TEST_F(OpMemoryModelTest, WrongModel)" +" OperandExecutionMode,",OpExecutionMode,,OpExecutionModeTest,"TEST_F(OpExecutionModeTest, WrongMode)" +" OperandStorage,","TypePointer, TypeForwardPointer, Variable",,StorageClassTest,"TEST_F(OpTypeForwardPointerTest, WrongClass)" +" OperandDimensionality,",TypeImage,,DimTest/AnyDim,"TEST_F(DimTest, WrongDim)" +" OperandSamplerAddressingMode,",ConstantSampler,,SamplerAddressingModeTest,"TEST_F(SamplerAddressingModeTest, WrongMode)" +" OperandSamplerFilterMode,",ConstantSampler,,AnySamplerFilterMode,"TEST_F(SamplerFilterModeTest, WrongMode)" +" OperandSamplerImageFormat,",TypeImage,SAMPLER_IMAGE_FORMAT,ImageFormatTest,"TEST_F(ImageFormatTest, WrongFormat)" +" OperandImageChannelOrder,",UNUSED,returned as result value only,, +" OperandImageChannelDataType,",UNUSED,returned as result value only,, +" OperandImageOperands,",UNUSED,used to make a spec section,,see OperandOptionalImage +" OperandFPFastMath,",OpDecorate,,CombinedFPFastMathMask,"TEST_F(OpDecorateEnumTest, WrongFPFastMathMode)" +" OperandFPRoundingMode,",OpDecorate,,,"TEST_F(OpDecorateEnumTest, WrongFPRoundingMode)" +" OperandLinkageType,",OpDecorate,,OpDecorateLinkageTest,"TEST_F(OpDecorateLinkageTest, WrongType)" +" OperandAccessQualifier,",OpTypePipe,,AnyAccessQualifier,"TEST_F(OpTypePipeTest, WrongAccessQualifier)" +" OperandFuncParamAttr,",OpDecorate,,TextToBinaryDecorateFuncParamAttr,"TEST_F(OpDecorateEnumTest, WrongFuncParamAttr)" +" OperandDecoration,",OpDecorate,,AnyAccessQualifier,"TEST_F(OpTypePipeTest, WrongAccessQualifier)" +" OperandBuiltIn,",OpDecorate,,TextToBinaryDecorateBultIn,"TEST_F(OpDecorateEnumTest, WrongBuiltIn)" +" OperandSelect,",SelectionMerge,,TextToBinarySelectionMerge,"TEST_F(OpSelectionMergeTest, WrongSelectionControl)" +" OperandLoop,",LoopMerge,,CombinedLoopControlMask,"TEST_F(OpLoopMergeTest, WrongLoopControl)" +" OperandFunction,",Function,,AnySingleFunctionControlMask,"TEST_F(OpFunctionControlTest, WrongFunctionControl)" +" OperandMemorySemantics,",OpMemoryBarrier,"it's an ID, not in grammar",OpMemoryBarrier*,not enum +" OperandMemoryAccess,",UNUSED,"should be on opstore, but hacked in opcode.cpp",,not enum +" OperandScope,",MemoryBarrier,"it's an ID, not in grammar",OpMemoryBarrier*,not enum +" OperandGroupOperation,",GroupIAdd,,GroupOperationTest,"TEST_F(GroupOperationTest, WrongGroupOperation)" +" OperandKernelEnqueueFlags,",OpEnqueueKernel,"it's an ID, not in grammar",should not have one,not enum +" OperandKernelProfilingInfo,",OpCaptureEventProfilingInfo,"it's an ID, not in grammar",should not have one,not enum +" OperandCapability,",Capability,,OpCapabilityTest,"TEST_F(TextToBinaryCapability, BadInvalidCapability)" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/operand_pattern_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/operand_pattern_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/operand_pattern_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/operand_pattern_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,265 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +#include "gmock/gmock.h" +#include "source/operand.h" + +using ::testing::Eq; + +namespace { + +TEST(OperandPattern, InitiallyEmpty) { + spv_operand_pattern_t empty; + EXPECT_THAT(empty, Eq(spv_operand_pattern_t{})); + EXPECT_EQ(0u, empty.size()); + EXPECT_TRUE(empty.empty()); +} + +TEST(OperandPattern, PushBacksAreOnTheRight) { + spv_operand_pattern_t pattern; + + pattern.push_back(SPV_OPERAND_TYPE_ID); + EXPECT_THAT(pattern, Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_ID})); + EXPECT_EQ(1u, pattern.size()); + EXPECT_TRUE(!pattern.empty()); + EXPECT_EQ(SPV_OPERAND_TYPE_ID, pattern.back()); + + pattern.push_back(SPV_OPERAND_TYPE_NONE); + EXPECT_THAT(pattern, Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_ID, + SPV_OPERAND_TYPE_NONE})); + EXPECT_EQ(2u, pattern.size()); + EXPECT_TRUE(!pattern.empty()); + EXPECT_EQ(SPV_OPERAND_TYPE_NONE, pattern.back()); +} + +TEST(OperandPattern, PopBacksAreOnTheRight) { + spv_operand_pattern_t pattern{SPV_OPERAND_TYPE_ID, + SPV_OPERAND_TYPE_LITERAL_INTEGER}; + + pattern.pop_back(); + EXPECT_THAT(pattern, Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_ID})); + + pattern.pop_back(); + EXPECT_THAT(pattern, Eq(spv_operand_pattern_t{})); +} + +// A test case for typed mask expansion +struct MaskExpansionCase { + spv_operand_type_t type; + uint32_t mask; + spv_operand_pattern_t initial; + spv_operand_pattern_t expected; +}; + +using MaskExpansionTest = ::testing::TestWithParam; + +TEST_P(MaskExpansionTest, Sample) { + spv_operand_table operandTable = nullptr; + auto env = SPV_ENV_UNIVERSAL_1_0; + ASSERT_EQ(SPV_SUCCESS, spvOperandTableGet(&operandTable, env)); + + spv_operand_pattern_t pattern(GetParam().initial); + spvPushOperandTypesForMask(env, operandTable, GetParam().type, + GetParam().mask, &pattern); + EXPECT_THAT(pattern, Eq(GetParam().expected)); +} + +// These macros let us write non-trivial examples without too much text. +#define PREFIX0 SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE +#define PREFIX1 \ + SPV_OPERAND_TYPE_STORAGE_CLASS, SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE, \ + SPV_OPERAND_TYPE_ID +INSTANTIATE_TEST_CASE_P( + OperandPattern, MaskExpansionTest, + ::testing::ValuesIn(std::vector{ + // No bits means no change. + {SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, 0, {PREFIX0}, {PREFIX0}}, + // Unknown bits means no change. + {SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, + 0xfffffffc, + {PREFIX1}, + {PREFIX1}}, + // Volatile has no operands. + {SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, + SpvMemoryAccessVolatileMask, + {PREFIX0}, + {PREFIX0}}, + // Aligned has one literal number operand. + {SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, + SpvMemoryAccessAlignedMask, + {PREFIX1}, + {PREFIX1, SPV_OPERAND_TYPE_LITERAL_INTEGER}}, + // Volatile with Aligned still has just one literal number operand. + {SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, + SpvMemoryAccessVolatileMask | SpvMemoryAccessAlignedMask, + {PREFIX1}, + {PREFIX1, SPV_OPERAND_TYPE_LITERAL_INTEGER}}, + }), ); +#undef PREFIX0 +#undef PREFIX1 + +// Returns a vector of all operand types that can be used in a pattern. +std::vector allOperandTypes() { + std::vector result; + for (int i = 0; i < SPV_OPERAND_TYPE_NUM_OPERAND_TYPES; i++) { + result.push_back(spv_operand_type_t(i)); + } + return result; +} + +using MatchableOperandExpansionTest = + ::testing::TestWithParam; + +TEST_P(MatchableOperandExpansionTest, MatchableOperandsDontExpand) { + const spv_operand_type_t type = GetParam(); + if (!spvOperandIsVariable(type)) { + spv_operand_pattern_t pattern; + const bool did_expand = spvExpandOperandSequenceOnce(type, &pattern); + EXPECT_FALSE(did_expand); + EXPECT_THAT(pattern, Eq(spv_operand_pattern_t{})); + } +} + +INSTANTIATE_TEST_CASE_P(MatchableOperandExpansion, + MatchableOperandExpansionTest, + ::testing::ValuesIn(allOperandTypes()), ); + +using VariableOperandExpansionTest = + ::testing::TestWithParam; + +TEST_P(VariableOperandExpansionTest, NonMatchableOperandsExpand) { + const spv_operand_type_t type = GetParam(); + if (spvOperandIsVariable(type)) { + spv_operand_pattern_t pattern; + const bool did_expand = spvExpandOperandSequenceOnce(type, &pattern); + EXPECT_TRUE(did_expand); + EXPECT_FALSE(pattern.empty()); + // For the existing rules, the first expansion of a zero-or-more operand + // type yields a matchable operand type. This isn't strictly necessary. + EXPECT_FALSE(spvOperandIsVariable(pattern.back())); + } +} + +INSTANTIATE_TEST_CASE_P(NonMatchableOperandExpansion, + VariableOperandExpansionTest, + ::testing::ValuesIn(allOperandTypes()), ); + +TEST(AlternatePatternFollowingImmediate, Empty) { + EXPECT_THAT(spvAlternatePatternFollowingImmediate({}), + Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV})); +} + +TEST(AlternatePatternFollowingImmediate, SingleElement) { + // Spot-check a random selection of types. + EXPECT_THAT(spvAlternatePatternFollowingImmediate( + {SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER}), + Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV})); + EXPECT_THAT( + spvAlternatePatternFollowingImmediate({SPV_OPERAND_TYPE_CAPABILITY}), + Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV})); + EXPECT_THAT( + spvAlternatePatternFollowingImmediate({SPV_OPERAND_TYPE_LOOP_CONTROL}), + Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV})); + EXPECT_THAT(spvAlternatePatternFollowingImmediate( + {SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER}), + Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV})); + EXPECT_THAT(spvAlternatePatternFollowingImmediate({SPV_OPERAND_TYPE_ID}), + Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV})); +} + +TEST(AlternatePatternFollowingImmediate, SingleResultId) { + EXPECT_THAT( + spvAlternatePatternFollowingImmediate({SPV_OPERAND_TYPE_RESULT_ID}), + Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV, + SPV_OPERAND_TYPE_RESULT_ID})); +} + +TEST(AlternatePatternFollowingImmediate, MultipleNonResultIds) { + EXPECT_THAT( + spvAlternatePatternFollowingImmediate( + {SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER, + SPV_OPERAND_TYPE_CAPABILITY, SPV_OPERAND_TYPE_LOOP_CONTROL, + SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID}), + Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV})); +} + +TEST(AlternatePatternFollowingImmediate, ResultIdFront) { + EXPECT_THAT(spvAlternatePatternFollowingImmediate( + {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}), + Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV, + SPV_OPERAND_TYPE_RESULT_ID, + SPV_OPERAND_TYPE_OPTIONAL_CIV})); + EXPECT_THAT( + spvAlternatePatternFollowingImmediate({SPV_OPERAND_TYPE_RESULT_ID, + SPV_OPERAND_TYPE_FP_ROUNDING_MODE, + SPV_OPERAND_TYPE_ID}), + Eq(spv_operand_pattern_t{ + SPV_OPERAND_TYPE_OPTIONAL_CIV, SPV_OPERAND_TYPE_RESULT_ID, + SPV_OPERAND_TYPE_OPTIONAL_CIV, SPV_OPERAND_TYPE_OPTIONAL_CIV})); + EXPECT_THAT( + spvAlternatePatternFollowingImmediate( + {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_DIMENSIONALITY, + SPV_OPERAND_TYPE_LINKAGE_TYPE, + SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE, + SPV_OPERAND_TYPE_FP_ROUNDING_MODE, SPV_OPERAND_TYPE_ID, + SPV_OPERAND_TYPE_VARIABLE_ID}), + Eq(spv_operand_pattern_t{ + SPV_OPERAND_TYPE_OPTIONAL_CIV, SPV_OPERAND_TYPE_RESULT_ID, + SPV_OPERAND_TYPE_OPTIONAL_CIV, SPV_OPERAND_TYPE_OPTIONAL_CIV, + SPV_OPERAND_TYPE_OPTIONAL_CIV, SPV_OPERAND_TYPE_OPTIONAL_CIV, + SPV_OPERAND_TYPE_OPTIONAL_CIV, SPV_OPERAND_TYPE_OPTIONAL_CIV})); +} + +TEST(AlternatePatternFollowingImmediate, ResultIdMiddle) { + EXPECT_THAT(spvAlternatePatternFollowingImmediate( + {SPV_OPERAND_TYPE_FP_ROUNDING_MODE, + SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}), + Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV, + SPV_OPERAND_TYPE_RESULT_ID, + SPV_OPERAND_TYPE_OPTIONAL_CIV})); + EXPECT_THAT( + spvAlternatePatternFollowingImmediate( + {SPV_OPERAND_TYPE_DIMENSIONALITY, SPV_OPERAND_TYPE_LINKAGE_TYPE, + SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE, + SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_FP_ROUNDING_MODE, + SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}), + Eq(spv_operand_pattern_t{ + SPV_OPERAND_TYPE_OPTIONAL_CIV, SPV_OPERAND_TYPE_RESULT_ID, + SPV_OPERAND_TYPE_OPTIONAL_CIV, SPV_OPERAND_TYPE_OPTIONAL_CIV, + SPV_OPERAND_TYPE_OPTIONAL_CIV})); +} + +TEST(AlternatePatternFollowingImmediate, ResultIdBack) { + EXPECT_THAT(spvAlternatePatternFollowingImmediate( + {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}), + Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV, + SPV_OPERAND_TYPE_RESULT_ID})); + EXPECT_THAT(spvAlternatePatternFollowingImmediate( + {SPV_OPERAND_TYPE_FP_ROUNDING_MODE, SPV_OPERAND_TYPE_ID, + SPV_OPERAND_TYPE_RESULT_ID}), + Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV, + SPV_OPERAND_TYPE_RESULT_ID})); + EXPECT_THAT( + spvAlternatePatternFollowingImmediate( + {SPV_OPERAND_TYPE_DIMENSIONALITY, SPV_OPERAND_TYPE_LINKAGE_TYPE, + SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE, + SPV_OPERAND_TYPE_FP_ROUNDING_MODE, SPV_OPERAND_TYPE_ID, + SPV_OPERAND_TYPE_VARIABLE_ID, SPV_OPERAND_TYPE_RESULT_ID}), + Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV, + SPV_OPERAND_TYPE_RESULT_ID})); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/operand_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/operand_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/operand_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/operand_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +namespace { + +using GetTargetTest = ::testing::TestWithParam; +using std::vector; +using ::testing::ValuesIn; + +TEST_P(GetTargetTest, Default) { + spv_operand_table table; + ASSERT_EQ(SPV_SUCCESS, spvOperandTableGet(&table, GetParam())); + ASSERT_NE(0u, table->count); + ASSERT_NE(nullptr, table->types); +} + +TEST_P(GetTargetTest, InvalidPointerTable) { + ASSERT_EQ(SPV_ERROR_INVALID_POINTER, spvOperandTableGet(nullptr, GetParam())); +} + +INSTANTIATE_TEST_CASE_P(OperandTableGet, GetTargetTest, + ValuesIn(vector{SPV_ENV_UNIVERSAL_1_0, + SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_VULKAN_1_0}), ); + +TEST(OperandString, AllAreDefinedExceptVariable) { + // None has no string, so don't test it. + EXPECT_EQ(0u, SPV_OPERAND_TYPE_NONE); + // Start testing at enum with value 1, skipping None. + for (int i = 1; i < int(SPV_OPERAND_TYPE_FIRST_VARIABLE_TYPE); i++) { + EXPECT_NE(nullptr, spvOperandTypeStr(static_cast(i))) + << " Operand type " << i; + } +} + +TEST(OperandIsConcreteMask, Sample) { + // Check a few operand types preceding the concrete mask types. + EXPECT_FALSE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_NONE)); + EXPECT_FALSE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_ID)); + EXPECT_FALSE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_LITERAL_INTEGER)); + EXPECT_FALSE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_CAPABILITY)); + + // Check all the concrete mask operand types. + EXPECT_TRUE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_IMAGE)); + EXPECT_TRUE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_FP_FAST_MATH_MODE)); + EXPECT_TRUE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_SELECTION_CONTROL)); + EXPECT_TRUE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_LOOP_CONTROL)); + EXPECT_TRUE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_FUNCTION_CONTROL)); + EXPECT_TRUE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_MEMORY_ACCESS)); + + // Check a few operand types after the concrete mask types, including the + // optional forms for Image and MemoryAccess. + EXPECT_FALSE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_OPTIONAL_ID)); + EXPECT_FALSE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_OPTIONAL_IMAGE)); + EXPECT_FALSE( + spvOperandIsConcreteMask(SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS)); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/aggressive_dead_code_elim_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/aggressive_dead_code_elim_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/aggressive_dead_code_elim_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/aggressive_dead_code_elim_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,5419 @@ +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "assembly_builder.h" +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using AggressiveDCETest = PassTest<::testing::Test>; + +TEST_F(AggressiveDCETest, EliminateExtendedInst) { + // #version 140 + // + // in vec4 BaseColor; + // in vec4 Dead; + // + // void main() + // { + // vec4 v = BaseColor; + // vec4 dv = sqrt(Dead); + // gl_FragColor = v; + // } + + const std::string predefs1 = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %Dead %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +)"; + + const std::string names_before = + R"(OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %dv "dv" +OpName %Dead "Dead" +OpName %gl_FragColor "gl_FragColor" +)"; + + const std::string names_after = + R"(OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %Dead "Dead" +OpName %gl_FragColor "gl_FragColor" +)"; + + const std::string predefs2 = + R"(%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%Dead = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string func_before = + R"(%main = OpFunction %void None %9 +%15 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%dv = OpVariable %_ptr_Function_v4float Function +%16 = OpLoad %v4float %BaseColor +OpStore %v %16 +%17 = OpLoad %v4float %Dead +%18 = OpExtInst %v4float %1 Sqrt %17 +OpStore %dv %18 +%19 = OpLoad %v4float %v +OpStore %gl_FragColor %19 +OpReturn +OpFunctionEnd +)"; + + const std::string func_after = + R"(%main = OpFunction %void None %9 +%15 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%16 = OpLoad %v4float %BaseColor +OpStore %v %16 +%19 = OpLoad %v4float %v +OpStore %gl_FragColor %19 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs1 + names_before + predefs2 + func_before, + predefs1 + names_after + predefs2 + func_after, true, true); +} + +TEST_F(AggressiveDCETest, NoEliminateFrexp) { + // Note: SPIR-V hand-edited to utilize Frexp + // + // #version 450 + // + // in vec4 BaseColor; + // in vec4 Dead; + // out vec4 Color; + // out ivec4 iv2; + // + // void main() + // { + // vec4 v = BaseColor; + // vec4 dv = frexp(Dead, iv2); + // Color = v; + // } + + const std::string predefs1 = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %Dead %iv2 %Color +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +)"; + + const std::string names_before = + R"(OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %dv "dv" +OpName %Dead "Dead" +OpName %iv2 "iv2" +OpName %ResType "ResType" +OpName %Color "Color" +)"; + + const std::string names_after = + R"(OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %Dead "Dead" +OpName %iv2 "iv2" +OpName %Color "Color" +)"; + + const std::string predefs2_before = + R"(%void = OpTypeVoid +%11 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%Dead = OpVariable %_ptr_Input_v4float Input +%int = OpTypeInt 32 1 +%v4int = OpTypeVector %int 4 +%_ptr_Output_v4int = OpTypePointer Output %v4int +%iv2 = OpVariable %_ptr_Output_v4int Output +%ResType = OpTypeStruct %v4float %v4int +%_ptr_Output_v4float = OpTypePointer Output %v4float +%Color = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string predefs2_after = + R"(%void = OpTypeVoid +%11 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%Dead = OpVariable %_ptr_Input_v4float Input +%int = OpTypeInt 32 1 +%v4int = OpTypeVector %int 4 +%_ptr_Output_v4int = OpTypePointer Output %v4int +%iv2 = OpVariable %_ptr_Output_v4int Output +%_ptr_Output_v4float = OpTypePointer Output %v4float +%Color = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string func_before = + R"(%main = OpFunction %void None %11 +%20 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%dv = OpVariable %_ptr_Function_v4float Function +%21 = OpLoad %v4float %BaseColor +OpStore %v %21 +%22 = OpLoad %v4float %Dead +%23 = OpExtInst %v4float %1 Frexp %22 %iv2 +OpStore %dv %23 +%24 = OpLoad %v4float %v +OpStore %Color %24 +OpReturn +OpFunctionEnd +)"; + + const std::string func_after = + R"(%main = OpFunction %void None %11 +%20 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%21 = OpLoad %v4float %BaseColor +OpStore %v %21 +%22 = OpLoad %v4float %Dead +%23 = OpExtInst %v4float %1 Frexp %22 %iv2 +%24 = OpLoad %v4float %v +OpStore %Color %24 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs1 + names_before + predefs2_before + func_before, + predefs1 + names_after + predefs2_after + func_after, true, true); +} + +TEST_F(AggressiveDCETest, EliminateDecorate) { + // Note: The SPIR-V was hand-edited to add the OpDecorate + // + // #version 140 + // + // in vec4 BaseColor; + // in vec4 Dead; + // + // void main() + // { + // vec4 v = BaseColor; + // vec4 dv = Dead * 0.5; + // gl_FragColor = v; + // } + + const std::string predefs1 = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %Dead %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +)"; + + const std::string names_before = + R"(OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %dv "dv" +OpName %Dead "Dead" +OpName %gl_FragColor "gl_FragColor" +OpDecorate %8 RelaxedPrecision +)"; + + const std::string names_after = + R"(OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %Dead "Dead" +OpName %gl_FragColor "gl_FragColor" +)"; + + const std::string predefs2_before = + R"(%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%Dead = OpVariable %_ptr_Input_v4float Input +%float_0_5 = OpConstant %float 0.5 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string predefs2_after = + R"(%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%Dead = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string func_before = + R"(%main = OpFunction %void None %10 +%17 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%dv = OpVariable %_ptr_Function_v4float Function +%18 = OpLoad %v4float %BaseColor +OpStore %v %18 +%19 = OpLoad %v4float %Dead +%8 = OpVectorTimesScalar %v4float %19 %float_0_5 +OpStore %dv %8 +%20 = OpLoad %v4float %v +OpStore %gl_FragColor %20 +OpReturn +OpFunctionEnd +)"; + + const std::string func_after = + R"(%main = OpFunction %void None %10 +%17 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%18 = OpLoad %v4float %BaseColor +OpStore %v %18 +%20 = OpLoad %v4float %v +OpStore %gl_FragColor %20 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs1 + names_before + predefs2_before + func_before, + predefs1 + names_after + predefs2_after + func_after, true, true); +} + +TEST_F(AggressiveDCETest, Simple) { + // #version 140 + // + // in vec4 BaseColor; + // in vec4 Dead; + // + // void main() + // { + // vec4 v = BaseColor; + // vec4 dv = Dead; + // gl_FragColor = v; + // } + + const std::string predefs1 = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %Dead %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +)"; + + const std::string names_before = + R"(OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %dv "dv" +OpName %Dead "Dead" +OpName %gl_FragColor "gl_FragColor" +)"; + + const std::string names_after = + R"(OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %Dead "Dead" +OpName %gl_FragColor "gl_FragColor" +)"; + + const std::string predefs2 = + R"(%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%Dead = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string func_before = + R"(%main = OpFunction %void None %9 +%15 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%dv = OpVariable %_ptr_Function_v4float Function +%16 = OpLoad %v4float %BaseColor +OpStore %v %16 +%17 = OpLoad %v4float %Dead +OpStore %dv %17 +%18 = OpLoad %v4float %v +OpStore %gl_FragColor %18 +OpReturn +OpFunctionEnd +)"; + + const std::string func_after = + R"(%main = OpFunction %void None %9 +%15 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%16 = OpLoad %v4float %BaseColor +OpStore %v %16 +%18 = OpLoad %v4float %v +OpStore %gl_FragColor %18 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs1 + names_before + predefs2 + func_before, + predefs1 + names_after + predefs2 + func_after, true, true); +} + +TEST_F(AggressiveDCETest, OptWhitelistExtension) { + // #version 140 + // + // in vec4 BaseColor; + // in vec4 Dead; + // + // void main() + // { + // vec4 v = BaseColor; + // vec4 dv = Dead; + // gl_FragColor = v; + // } + + const std::string predefs1 = + R"(OpCapability Shader +OpExtension "SPV_AMD_gpu_shader_int16" +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %Dead %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +)"; + + const std::string names_before = + R"(OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %dv "dv" +OpName %Dead "Dead" +OpName %gl_FragColor "gl_FragColor" +)"; + + const std::string names_after = + R"(OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %Dead "Dead" +OpName %gl_FragColor "gl_FragColor" +)"; + + const std::string predefs2 = + R"(%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%Dead = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string func_before = + R"(%main = OpFunction %void None %9 +%15 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%dv = OpVariable %_ptr_Function_v4float Function +%16 = OpLoad %v4float %BaseColor +OpStore %v %16 +%17 = OpLoad %v4float %Dead +OpStore %dv %17 +%18 = OpLoad %v4float %v +OpStore %gl_FragColor %18 +OpReturn +OpFunctionEnd +)"; + + const std::string func_after = + R"(%main = OpFunction %void None %9 +%15 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%16 = OpLoad %v4float %BaseColor +OpStore %v %16 +%18 = OpLoad %v4float %v +OpStore %gl_FragColor %18 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs1 + names_before + predefs2 + func_before, + predefs1 + names_after + predefs2 + func_after, true, true); +} + +TEST_F(AggressiveDCETest, NoOptBlacklistExtension) { + // #version 140 + // + // in vec4 BaseColor; + // in vec4 Dead; + // + // void main() + // { + // vec4 v = BaseColor; + // vec4 dv = Dead; + // gl_FragColor = v; + // } + + const std::string assembly = + R"(OpCapability Shader +OpExtension "SPV_KHR_variable_pointers" +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %Dead %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %dv "dv" +OpName %Dead "Dead" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%Dead = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %9 +%15 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%dv = OpVariable %_ptr_Function_v4float Function +%16 = OpLoad %v4float %BaseColor +OpStore %v %16 +%17 = OpLoad %v4float %Dead +OpStore %dv %17 +%18 = OpLoad %v4float %v +OpStore %gl_FragColor %18 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, true); +} + +TEST_F(AggressiveDCETest, ElimWithCall) { + // This demonstrates that "dead" function calls are not eliminated. + // Also demonstrates that DCE will happen in presence of function call. + // #version 140 + // in vec4 i1; + // in vec4 i2; + // + // void nothing(vec4 v) + // { + // } + // + // void main() + // { + // vec4 v1 = i1; + // vec4 v2 = i2; + // nothing(v1); + // gl_FragColor = vec4(0.0); + // } + + const std::string defs_before = + R"( OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %i1 %i2 %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %nothing_vf4_ "nothing(vf4;" +OpName %v "v" +OpName %v1 "v1" +OpName %i1 "i1" +OpName %v2 "v2" +OpName %i2 "i2" +OpName %param "param" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%12 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%16 = OpTypeFunction %void %_ptr_Function_v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%i1 = OpVariable %_ptr_Input_v4float Input +%i2 = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%float_0 = OpConstant %float 0 +%20 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +)"; + + const std::string defs_after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %i1 %i2 %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %nothing_vf4_ "nothing(vf4;" +OpName %v "v" +OpName %v1 "v1" +OpName %i1 "i1" +OpName %i2 "i2" +OpName %param "param" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%12 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%16 = OpTypeFunction %void %_ptr_Function_v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%i1 = OpVariable %_ptr_Input_v4float Input +%i2 = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%float_0 = OpConstant %float 0 +%20 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +)"; + + const std::string func_before = + R"(%main = OpFunction %void None %12 +%21 = OpLabel +%v1 = OpVariable %_ptr_Function_v4float Function +%v2 = OpVariable %_ptr_Function_v4float Function +%param = OpVariable %_ptr_Function_v4float Function +%22 = OpLoad %v4float %i1 +OpStore %v1 %22 +%23 = OpLoad %v4float %i2 +OpStore %v2 %23 +%24 = OpLoad %v4float %v1 +OpStore %param %24 +%25 = OpFunctionCall %void %nothing_vf4_ %param +OpStore %gl_FragColor %20 +OpReturn +OpFunctionEnd +%nothing_vf4_ = OpFunction %void None %16 +%v = OpFunctionParameter %_ptr_Function_v4float +%26 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string func_after = + R"(%main = OpFunction %void None %12 +%21 = OpLabel +%v1 = OpVariable %_ptr_Function_v4float Function +%param = OpVariable %_ptr_Function_v4float Function +%22 = OpLoad %v4float %i1 +OpStore %v1 %22 +%24 = OpLoad %v4float %v1 +OpStore %param %24 +%25 = OpFunctionCall %void %nothing_vf4_ %param +OpStore %gl_FragColor %20 +OpReturn +OpFunctionEnd +%nothing_vf4_ = OpFunction %void None %16 +%v = OpFunctionParameter %_ptr_Function_v4float +%26 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + defs_before + func_before, defs_after + func_after, true, true); +} + +TEST_F(AggressiveDCETest, NoParamElim) { + // This demonstrates that unused parameters are not eliminated, but + // dead uses of them are. + // #version 140 + // + // in vec4 BaseColor; + // + // vec4 foo(vec4 v1, vec4 v2) + // { + // vec4 t = -v1; + // return v2; + // } + // + // void main() + // { + // vec4 dead; + // gl_FragColor = foo(dead, BaseColor); + // } + + const std::string defs_before = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %gl_FragColor %BaseColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %foo_vf4_vf4_ "foo(vf4;vf4;" +OpName %v1 "v1" +OpName %v2 "v2" +OpName %t "t" +OpName %gl_FragColor "gl_FragColor" +OpName %dead "dead" +OpName %BaseColor "BaseColor" +OpName %param "param" +OpName %param_0 "param" +%void = OpTypeVoid +%13 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%17 = OpTypeFunction %v4float %_ptr_Function_v4float %_ptr_Function_v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%main = OpFunction %void None %13 +%20 = OpLabel +%dead = OpVariable %_ptr_Function_v4float Function +%param = OpVariable %_ptr_Function_v4float Function +%param_0 = OpVariable %_ptr_Function_v4float Function +%21 = OpLoad %v4float %dead +OpStore %param %21 +%22 = OpLoad %v4float %BaseColor +OpStore %param_0 %22 +%23 = OpFunctionCall %v4float %foo_vf4_vf4_ %param %param_0 +OpStore %gl_FragColor %23 +OpReturn +OpFunctionEnd +)"; + + const std::string defs_after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %gl_FragColor %BaseColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %foo_vf4_vf4_ "foo(vf4;vf4;" +OpName %v1 "v1" +OpName %v2 "v2" +OpName %gl_FragColor "gl_FragColor" +OpName %dead "dead" +OpName %BaseColor "BaseColor" +OpName %param "param" +OpName %param_0 "param" +%void = OpTypeVoid +%13 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%17 = OpTypeFunction %v4float %_ptr_Function_v4float %_ptr_Function_v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%main = OpFunction %void None %13 +%20 = OpLabel +%dead = OpVariable %_ptr_Function_v4float Function +%param = OpVariable %_ptr_Function_v4float Function +%param_0 = OpVariable %_ptr_Function_v4float Function +%21 = OpLoad %v4float %dead +OpStore %param %21 +%22 = OpLoad %v4float %BaseColor +OpStore %param_0 %22 +%23 = OpFunctionCall %v4float %foo_vf4_vf4_ %param %param_0 +OpStore %gl_FragColor %23 +OpReturn +OpFunctionEnd +)"; + + const std::string func_before = + R"(%foo_vf4_vf4_ = OpFunction %v4float None %17 +%v1 = OpFunctionParameter %_ptr_Function_v4float +%v2 = OpFunctionParameter %_ptr_Function_v4float +%24 = OpLabel +%t = OpVariable %_ptr_Function_v4float Function +%25 = OpLoad %v4float %v1 +%26 = OpFNegate %v4float %25 +OpStore %t %26 +%27 = OpLoad %v4float %v2 +OpReturnValue %27 +OpFunctionEnd +)"; + + const std::string func_after = + R"(%foo_vf4_vf4_ = OpFunction %v4float None %17 +%v1 = OpFunctionParameter %_ptr_Function_v4float +%v2 = OpFunctionParameter %_ptr_Function_v4float +%24 = OpLabel +%27 = OpLoad %v4float %v2 +OpReturnValue %27 +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + defs_before + func_before, defs_after + func_after, true, true); +} + +TEST_F(AggressiveDCETest, ElimOpaque) { + // SPIR-V not representable from GLSL; not generatable from HLSL + // for the moment. + + const std::string defs_before = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %outColor %texCoords +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S_t "S_t" +OpMemberName %S_t 0 "v0" +OpMemberName %S_t 1 "v1" +OpMemberName %S_t 2 "smp" +OpName %outColor "outColor" +OpName %sampler15 "sampler15" +OpName %s0 "s0" +OpName %texCoords "texCoords" +OpDecorate %sampler15 DescriptorSet 0 +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v2float = OpTypeVector %float 2 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%outColor = OpVariable %_ptr_Output_v4float Output +%14 = OpTypeImage %float 2D 0 0 0 1 Unknown +%15 = OpTypeSampledImage %14 +%S_t = OpTypeStruct %v2float %v2float %15 +%_ptr_Function_S_t = OpTypePointer Function %S_t +%17 = OpTypeFunction %void %_ptr_Function_S_t +%_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15 +%_ptr_Function_15 = OpTypePointer Function %15 +%sampler15 = OpVariable %_ptr_UniformConstant_15 UniformConstant +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%int_2 = OpConstant %int 2 +%_ptr_Function_v2float = OpTypePointer Function %v2float +%_ptr_Input_v2float = OpTypePointer Input %v2float +%texCoords = OpVariable %_ptr_Input_v2float Input +)"; + + const std::string defs_after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %outColor %texCoords +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %outColor "outColor" +OpName %sampler15 "sampler15" +OpName %texCoords "texCoords" +OpDecorate %sampler15 DescriptorSet 0 +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v2float = OpTypeVector %float 2 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%outColor = OpVariable %_ptr_Output_v4float Output +%14 = OpTypeImage %float 2D 0 0 0 1 Unknown +%15 = OpTypeSampledImage %14 +%_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15 +%sampler15 = OpVariable %_ptr_UniformConstant_15 UniformConstant +%_ptr_Input_v2float = OpTypePointer Input %v2float +%texCoords = OpVariable %_ptr_Input_v2float Input +)"; + + const std::string func_before = + R"(%main = OpFunction %void None %9 +%25 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%26 = OpLoad %v2float %texCoords +%27 = OpLoad %S_t %s0 +%28 = OpCompositeInsert %S_t %26 %27 0 +%29 = OpLoad %15 %sampler15 +%30 = OpCompositeInsert %S_t %29 %28 2 +OpStore %s0 %30 +%31 = OpImageSampleImplicitLod %v4float %29 %26 +OpStore %outColor %31 +OpReturn +OpFunctionEnd +)"; + + const std::string func_after = + R"(%main = OpFunction %void None %9 +%25 = OpLabel +%26 = OpLoad %v2float %texCoords +%29 = OpLoad %15 %sampler15 +%31 = OpImageSampleImplicitLod %v4float %29 %26 +OpStore %outColor %31 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + defs_before + func_before, defs_after + func_after, true, true); +} + +TEST_F(AggressiveDCETest, NoParamStoreElim) { + // Should not eliminate stores to params + // + // #version 450 + // + // layout(location = 0) in vec4 BaseColor; + // layout(location = 0) out vec4 OutColor; + // + // void foo(in vec4 v1, out vec4 v2) + // { + // v2 = -v1; + // } + // + // void main() + // { + // foo(BaseColor, OutColor); + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %foo_vf4_vf4_ "foo(vf4;vf4;" +OpName %v1 "v1" +OpName %v2 "v2" +OpName %BaseColor "BaseColor" +OpName %OutColor "OutColor" +OpName %param "param" +OpName %param_0 "param" +OpDecorate %BaseColor Location 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%11 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%15 = OpTypeFunction %void %_ptr_Function_v4float %_ptr_Function_v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %11 +%18 = OpLabel +%param = OpVariable %_ptr_Function_v4float Function +%param_0 = OpVariable %_ptr_Function_v4float Function +%19 = OpLoad %v4float %BaseColor +OpStore %param %19 +%20 = OpFunctionCall %void %foo_vf4_vf4_ %param %param_0 +%21 = OpLoad %v4float %param_0 +OpStore %OutColor %21 +OpReturn +OpFunctionEnd +%foo_vf4_vf4_ = OpFunction %void None %15 +%v1 = OpFunctionParameter %_ptr_Function_v4float +%v2 = OpFunctionParameter %_ptr_Function_v4float +%22 = OpLabel +%23 = OpLoad %v4float %v1 +%24 = OpFNegate %v4float %23 +OpStore %v2 %24 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, true); +} + +TEST_F(AggressiveDCETest, PrivateStoreElimInEntryNoCalls) { + // Eliminate stores to private in entry point with no calls + // Note: Not legal GLSL + // + // layout(location = 0) in vec4 BaseColor; + // layout(location = 1) in vec4 Dead; + // layout(location = 0) out vec4 OutColor; + // + // private vec4 dv; + // + // void main() + // { + // vec4 v = BaseColor; + // dv = Dead; + // OutColor = v; + // } + + const std::string predefs_before = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %Dead %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %dv "dv" +OpName %Dead "Dead" +OpName %OutColor "OutColor" +OpDecorate %BaseColor Location 0 +OpDecorate %Dead Location 1 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Private_v4float = OpTypePointer Private %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%Dead = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%dv = OpVariable %_ptr_Private_v4float Private +%OutColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string predefs_after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %Dead %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %Dead "Dead" +OpName %OutColor "OutColor" +OpDecorate %BaseColor Location 0 +OpDecorate %Dead Location 1 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%Dead = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string main_before = + R"(%main = OpFunction %void None %9 +%16 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%17 = OpLoad %v4float %BaseColor +OpStore %v %17 +%18 = OpLoad %v4float %Dead +OpStore %dv %18 +%19 = OpLoad %v4float %v +%20 = OpFNegate %v4float %19 +OpStore %OutColor %20 +OpReturn +OpFunctionEnd +)"; + + const std::string main_after = + R"(%main = OpFunction %void None %9 +%16 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%17 = OpLoad %v4float %BaseColor +OpStore %v %17 +%19 = OpLoad %v4float %v +%20 = OpFNegate %v4float %19 +OpStore %OutColor %20 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs_before + main_before, predefs_after + main_after, true, true); +} + +TEST_F(AggressiveDCETest, NoPrivateStoreElimIfLoad) { + // Should not eliminate stores to private when there is a load + // Note: Not legal GLSL + // + // #version 450 + // + // layout(location = 0) in vec4 BaseColor; + // layout(location = 0) out vec4 OutColor; + // + // private vec4 pv; + // + // void main() + // { + // pv = BaseColor; + // OutColor = pv; + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %pv "pv" +OpName %BaseColor "BaseColor" +OpName %OutColor "OutColor" +OpDecorate %BaseColor Location 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Private_v4float = OpTypePointer Private %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%pv = OpVariable %_ptr_Private_v4float Private +%main = OpFunction %void None %7 +%13 = OpLabel +%14 = OpLoad %v4float %BaseColor +OpStore %pv %14 +%15 = OpLoad %v4float %pv +%16 = OpFNegate %v4float %15 +OpStore %OutColor %16 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, true); +} + +TEST_F(AggressiveDCETest, NoPrivateStoreElimWithCall) { + // Should not eliminate stores to private when function contains call + // Note: Not legal GLSL + // + // #version 450 + // + // layout(location = 0) in vec4 BaseColor; + // layout(location = 0) out vec4 OutColor; + // + // private vec4 v1; + // + // void foo() + // { + // OutColor = -v1; + // } + // + // void main() + // { + // v1 = BaseColor; + // foo(); + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %OutColor %BaseColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %foo_ "foo(" +OpName %OutColor "OutColor" +OpName %v1 "v1" +OpName %BaseColor "BaseColor" +OpDecorate %OutColor Location 0 +OpDecorate %BaseColor Location 0 +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%_ptr_Private_v4float = OpTypePointer Private %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%v1 = OpVariable %_ptr_Private_v4float Private +%BaseColor = OpVariable %_ptr_Input_v4float Input +%main = OpFunction %void None %8 +%14 = OpLabel +%15 = OpLoad %v4float %BaseColor +OpStore %v1 %15 +%16 = OpFunctionCall %void %foo_ +OpReturn +OpFunctionEnd +%foo_ = OpFunction %void None %8 +%17 = OpLabel +%18 = OpLoad %v4float %v1 +%19 = OpFNegate %v4float %18 +OpStore %OutColor %19 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, true); +} + +TEST_F(AggressiveDCETest, NoPrivateStoreElimInNonEntry) { + // Should not eliminate stores to private when function is not entry point + // Note: Not legal GLSL + // + // #version 450 + // + // layout(location = 0) in vec4 BaseColor; + // layout(location = 0) out vec4 OutColor; + // + // private vec4 v1; + // + // void foo() + // { + // v1 = BaseColor; + // } + // + // void main() + // { + // foo(); + // OutColor = -v1; + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %foo_ "foo(" +OpName %v1 "v1" +OpName %BaseColor "BaseColor" +OpName %OutColor "OutColor" +OpDecorate %BaseColor Location 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Private_v4float = OpTypePointer Private %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%v1 = OpVariable %_ptr_Private_v4float Private +%OutColor = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %8 +%14 = OpLabel +%15 = OpFunctionCall %void %foo_ +%16 = OpLoad %v4float %v1 +%17 = OpFNegate %v4float %16 +OpStore %OutColor %17 +OpReturn +OpFunctionEnd +%foo_ = OpFunction %void None %8 +%18 = OpLabel +%19 = OpLoad %v4float %BaseColor +OpStore %v1 %19 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, true); +} + +TEST_F(AggressiveDCETest, EliminateDeadIfThenElse) { + // #version 450 + // + // layout(location = 0) in vec4 BaseColor; + // layout(location = 0) out vec4 OutColor; + // + // void main() + // { + // float d; + // if (BaseColor.x == 0) + // d = BaseColor.y; + // else + // d = BaseColor.z; + // OutColor = vec4(1.0,1.0,1.0,1.0); + // } + + const std::string predefs_before = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %BaseColor "BaseColor" +OpName %d "d" +OpName %OutColor "OutColor" +OpDecorate %BaseColor Location 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%_ptr_Input_float = OpTypePointer Input %float +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%_ptr_Function_float = OpTypePointer Function %float +%uint_1 = OpConstant %uint 1 +%uint_2 = OpConstant %uint 2 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%float_1 = OpConstant %float 1 +%21 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +)"; + + const std::string predefs_after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %BaseColor "BaseColor" +OpName %OutColor "OutColor" +OpDecorate %BaseColor Location 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%float_1 = OpConstant %float 1 +%21 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +)"; + + const std::string func_before = + R"(%main = OpFunction %void None %7 +%22 = OpLabel +%d = OpVariable %_ptr_Function_float Function +%23 = OpAccessChain %_ptr_Input_float %BaseColor %uint_0 +%24 = OpLoad %float %23 +%25 = OpFOrdEqual %bool %24 %float_0 +OpSelectionMerge %26 None +OpBranchConditional %25 %27 %28 +%27 = OpLabel +%29 = OpAccessChain %_ptr_Input_float %BaseColor %uint_1 +%30 = OpLoad %float %29 +OpStore %d %30 +OpBranch %26 +%28 = OpLabel +%31 = OpAccessChain %_ptr_Input_float %BaseColor %uint_2 +%32 = OpLoad %float %31 +OpStore %d %32 +OpBranch %26 +%26 = OpLabel +OpStore %OutColor %21 +OpReturn +OpFunctionEnd +)"; + + const std::string func_after = + R"(%main = OpFunction %void None %7 +%22 = OpLabel +OpBranch %26 +%26 = OpLabel +OpStore %OutColor %21 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs_before + func_before, predefs_after + func_after, true, true); +} + +TEST_F(AggressiveDCETest, EliminateDeadIfThen) { + // #version 450 + // + // layout(location = 0) in vec4 BaseColor; + // layout(location = 0) out vec4 OutColor; + // + // void main() + // { + // float d; + // if (BaseColor.x == 0) + // d = BaseColor.y; + // OutColor = vec4(1.0,1.0,1.0,1.0); + // } + + const std::string predefs_before = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %BaseColor "BaseColor" +OpName %d "d" +OpName %OutColor "OutColor" +OpDecorate %BaseColor Location 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%_ptr_Input_float = OpTypePointer Input %float +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%_ptr_Function_float = OpTypePointer Function %float +%uint_1 = OpConstant %uint 1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%float_1 = OpConstant %float 1 +%20 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +)"; + + const std::string predefs_after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %BaseColor "BaseColor" +OpName %OutColor "OutColor" +OpDecorate %BaseColor Location 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%float_1 = OpConstant %float 1 +%20 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +)"; + + const std::string func_before = + R"(%main = OpFunction %void None %7 +%21 = OpLabel +%d = OpVariable %_ptr_Function_float Function +%22 = OpAccessChain %_ptr_Input_float %BaseColor %uint_0 +%23 = OpLoad %float %22 +%24 = OpFOrdEqual %bool %23 %float_0 +OpSelectionMerge %25 None +OpBranchConditional %24 %26 %25 +%26 = OpLabel +%27 = OpAccessChain %_ptr_Input_float %BaseColor %uint_1 +%28 = OpLoad %float %27 +OpStore %d %28 +OpBranch %25 +%25 = OpLabel +OpStore %OutColor %20 +OpReturn +OpFunctionEnd +)"; + + const std::string func_after = + R"(%main = OpFunction %void None %7 +%21 = OpLabel +OpBranch %25 +%25 = OpLabel +OpStore %OutColor %20 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs_before + func_before, predefs_after + func_after, true, true); +} + +TEST_F(AggressiveDCETest, EliminateDeadSwitch) { + // #version 450 + // + // layout(location = 0) in vec4 BaseColor; + // layout(location = 1) in flat int x; + // layout(location = 0) out vec4 OutColor; + // + // void main() + // { + // float d; + // switch (x) { + // case 0: + // d = BaseColor.y; + // } + // OutColor = vec4(1.0,1.0,1.0,1.0); + // } + const std::string before = + R"(OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %x %BaseColor %OutColor + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %x "x" + OpName %d "d" + OpName %BaseColor "BaseColor" + OpName %OutColor "OutColor" + OpDecorate %x Flat + OpDecorate %x Location 1 + OpDecorate %BaseColor Location 0 + OpDecorate %OutColor Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int + %x = OpVariable %_ptr_Input_int Input + %float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float + %v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float + %BaseColor = OpVariable %_ptr_Input_v4float Input + %uint = OpTypeInt 32 0 + %uint_1 = OpConstant %uint 1 +%_ptr_Input_float = OpTypePointer Input %float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %OutColor = OpVariable %_ptr_Output_v4float Output + %float_1 = OpConstant %float 1 + %27 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 + %main = OpFunction %void None %3 + %5 = OpLabel + %d = OpVariable %_ptr_Function_float Function + %9 = OpLoad %int %x + OpSelectionMerge %11 None + OpSwitch %9 %11 0 %10 + %10 = OpLabel + %21 = OpAccessChain %_ptr_Input_float %BaseColor %uint_1 + %22 = OpLoad %float %21 + OpStore %d %22 + OpBranch %11 + %11 = OpLabel + OpStore %OutColor %27 + OpReturn + OpFunctionEnd)"; + + const std::string after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %x %BaseColor %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %x "x" +OpName %BaseColor "BaseColor" +OpName %OutColor "OutColor" +OpDecorate %x Flat +OpDecorate %x Location 1 +OpDecorate %BaseColor Location 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%3 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%x = OpVariable %_ptr_Input_int Input +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%float_1 = OpConstant %float 1 +%27 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +%main = OpFunction %void None %3 +%5 = OpLabel +OpBranch %11 +%11 = OpLabel +OpStore %OutColor %27 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(before, after, true, true); +} + +TEST_F(AggressiveDCETest, EliminateDeadIfThenElseNested) { + // #version 450 + // + // layout(location = 0) in vec4 BaseColor; + // layout(location = 0) out vec4 OutColor; + // + // void main() + // { + // float d; + // if (BaseColor.x == 0) + // if (BaseColor.y == 0) + // d = 0.0; + // else + // d = 0.25; + // else + // if (BaseColor.y == 0) + // d = 0.5; + // else + // d = 0.75; + // OutColor = vec4(1.0,1.0,1.0,1.0); + // } + + const std::string predefs_before = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %BaseColor "BaseColor" +OpName %d "d" +OpName %OutColor "OutColor" +OpDecorate %BaseColor Location 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%_ptr_Input_float = OpTypePointer Input %float +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%uint_1 = OpConstant %uint 1 +%_ptr_Function_float = OpTypePointer Function %float +%float_0_25 = OpConstant %float 0.25 +%float_0_5 = OpConstant %float 0.5 +%float_0_75 = OpConstant %float 0.75 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%float_1 = OpConstant %float 1 +%23 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +)"; + + const std::string predefs_after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %BaseColor "BaseColor" +OpName %OutColor "OutColor" +OpDecorate %BaseColor Location 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%float_1 = OpConstant %float 1 +%23 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +)"; + + const std::string func_before = + R"(%main = OpFunction %void None %7 +%24 = OpLabel +%d = OpVariable %_ptr_Function_float Function +%25 = OpAccessChain %_ptr_Input_float %BaseColor %uint_0 +%26 = OpLoad %float %25 +%27 = OpFOrdEqual %bool %26 %float_0 +OpSelectionMerge %28 None +OpBranchConditional %27 %29 %30 +%29 = OpLabel +%31 = OpAccessChain %_ptr_Input_float %BaseColor %uint_1 +%32 = OpLoad %float %31 +%33 = OpFOrdEqual %bool %32 %float_0 +OpSelectionMerge %34 None +OpBranchConditional %33 %35 %36 +%35 = OpLabel +OpStore %d %float_0 +OpBranch %34 +%36 = OpLabel +OpStore %d %float_0_25 +OpBranch %34 +%34 = OpLabel +OpBranch %28 +%30 = OpLabel +%37 = OpAccessChain %_ptr_Input_float %BaseColor %uint_1 +%38 = OpLoad %float %37 +%39 = OpFOrdEqual %bool %38 %float_0 +OpSelectionMerge %40 None +OpBranchConditional %39 %41 %42 +%41 = OpLabel +OpStore %d %float_0_5 +OpBranch %40 +%42 = OpLabel +OpStore %d %float_0_75 +OpBranch %40 +%40 = OpLabel +OpBranch %28 +%28 = OpLabel +OpStore %OutColor %23 +OpReturn +OpFunctionEnd +)"; + + const std::string func_after = + R"(%main = OpFunction %void None %7 +%24 = OpLabel +OpBranch %28 +%28 = OpLabel +OpStore %OutColor %23 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs_before + func_before, predefs_after + func_after, true, true); +} + +TEST_F(AggressiveDCETest, NoEliminateLiveIfThenElse) { + // #version 450 + // + // layout(location = 0) in vec4 BaseColor; + // layout(location = 0) out vec4 OutColor; + // + // void main() + // { + // float t; + // if (BaseColor.x == 0) + // t = BaseColor.y; + // else + // t = BaseColor.z; + // OutColor = vec4(t); + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %BaseColor "BaseColor" +OpName %t "t" +OpName %OutColor "OutColor" +OpDecorate %BaseColor Location 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%_ptr_Input_float = OpTypePointer Input %float +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%_ptr_Function_float = OpTypePointer Function %float +%uint_1 = OpConstant %uint 1 +%uint_2 = OpConstant %uint 2 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %7 +%20 = OpLabel +%t = OpVariable %_ptr_Function_float Function +%21 = OpAccessChain %_ptr_Input_float %BaseColor %uint_0 +%22 = OpLoad %float %21 +%23 = OpFOrdEqual %bool %22 %float_0 +OpSelectionMerge %24 None +OpBranchConditional %23 %25 %26 +%25 = OpLabel +%27 = OpAccessChain %_ptr_Input_float %BaseColor %uint_1 +%28 = OpLoad %float %27 +OpStore %t %28 +OpBranch %24 +%26 = OpLabel +%29 = OpAccessChain %_ptr_Input_float %BaseColor %uint_2 +%30 = OpLoad %float %29 +OpStore %t %30 +OpBranch %24 +%24 = OpLabel +%31 = OpLoad %float %t +%32 = OpCompositeConstruct %v4float %31 %31 %31 %31 +OpStore %OutColor %32 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, true); +} + +TEST_F(AggressiveDCETest, NoEliminateLiveIfThenElseNested) { + // #version 450 + // + // layout(location = 0) in vec4 BaseColor; + // layout(location = 0) out vec4 OutColor; + // + // void main() + // { + // float t; + // if (BaseColor.x == 0) + // if (BaseColor.y == 0) + // t = 0.0; + // else + // t = 0.25; + // else + // if (BaseColor.y == 0) + // t = 0.5; + // else + // t = 0.75; + // OutColor = vec4(t); + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %BaseColor "BaseColor" +OpName %t "t" +OpName %OutColor "OutColor" +OpDecorate %BaseColor Location 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%_ptr_Input_float = OpTypePointer Input %float +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%uint_1 = OpConstant %uint 1 +%_ptr_Function_float = OpTypePointer Function %float +%float_0_25 = OpConstant %float 0.25 +%float_0_5 = OpConstant %float 0.5 +%float_0_75 = OpConstant %float 0.75 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %7 +%22 = OpLabel +%t = OpVariable %_ptr_Function_float Function +%23 = OpAccessChain %_ptr_Input_float %BaseColor %uint_0 +%24 = OpLoad %float %23 +%25 = OpFOrdEqual %bool %24 %float_0 +OpSelectionMerge %26 None +OpBranchConditional %25 %27 %28 +%27 = OpLabel +%29 = OpAccessChain %_ptr_Input_float %BaseColor %uint_1 +%30 = OpLoad %float %29 +%31 = OpFOrdEqual %bool %30 %float_0 +OpSelectionMerge %32 None +OpBranchConditional %31 %33 %34 +%33 = OpLabel +OpStore %t %float_0 +OpBranch %32 +%34 = OpLabel +OpStore %t %float_0_25 +OpBranch %32 +%32 = OpLabel +OpBranch %26 +%28 = OpLabel +%35 = OpAccessChain %_ptr_Input_float %BaseColor %uint_1 +%36 = OpLoad %float %35 +%37 = OpFOrdEqual %bool %36 %float_0 +OpSelectionMerge %38 None +OpBranchConditional %37 %39 %40 +%39 = OpLabel +OpStore %t %float_0_5 +OpBranch %38 +%40 = OpLabel +OpStore %t %float_0_75 +OpBranch %38 +%38 = OpLabel +OpBranch %26 +%26 = OpLabel +%41 = OpLoad %float %t +%42 = OpCompositeConstruct %v4float %41 %41 %41 %41 +OpStore %OutColor %42 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, true); +} + +TEST_F(AggressiveDCETest, NoEliminateIfWithPhi) { + // Note: Assembly hand-optimized from GLSL + // + // #version 450 + // + // layout(location = 0) in vec4 BaseColor; + // layout(location = 0) out vec4 OutColor; + // + // void main() + // { + // float t; + // if (BaseColor.x == 0) + // t = 0.0; + // else + // t = 1.0; + // OutColor = vec4(t); + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %BaseColor "BaseColor" +OpName %OutColor "OutColor" +OpDecorate %BaseColor Location 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%6 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%_ptr_Input_float = OpTypePointer Input %float +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%float_1 = OpConstant %float 1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %6 +%17 = OpLabel +%18 = OpAccessChain %_ptr_Input_float %BaseColor %uint_0 +%19 = OpLoad %float %18 +%20 = OpFOrdEqual %bool %19 %float_0 +OpSelectionMerge %21 None +OpBranchConditional %20 %22 %23 +%22 = OpLabel +OpBranch %21 +%23 = OpLabel +OpBranch %21 +%21 = OpLabel +%24 = OpPhi %float %float_0 %22 %float_1 %23 +%25 = OpCompositeConstruct %v4float %24 %24 %24 %24 +OpStore %OutColor %25 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, true); +} + +TEST_F(AggressiveDCETest, NoEliminateIfBreak) { + // Note: Assembly optimized from GLSL + // + // #version 450 + // + // layout(location=0) in vec4 InColor; + // layout(location=0) out vec4 OutColor; + // + // void main() + // { + // float f = 0.0; + // for (;;) { + // f += 2.0; + // if (f > 20.0) + // break; + // } + // + // OutColor = InColor / f; + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %OutColor %InColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %f "f" +OpName %OutColor "OutColor" +OpName %InColor "InColor" +OpDecorate %OutColor Location 0 +OpDecorate %InColor Location 0 +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%float_2 = OpConstant %float 2 +%float_20 = OpConstant %float 20 +%bool = OpTypeBool +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%_ptr_Input_v4float = OpTypePointer Input %v4float +%InColor = OpVariable %_ptr_Input_v4float Input +%main = OpFunction %void None %7 +%17 = OpLabel +%f = OpVariable %_ptr_Function_float Function +OpStore %f %float_0 +OpBranch %18 +%18 = OpLabel +OpLoopMerge %19 %20 None +OpBranch %21 +%21 = OpLabel +%22 = OpLoad %float %f +%23 = OpFAdd %float %22 %float_2 +OpStore %f %23 +%24 = OpLoad %float %f +%25 = OpFOrdGreaterThan %bool %24 %float_20 +OpSelectionMerge %26 None +OpBranchConditional %25 %27 %26 +%27 = OpLabel +OpBranch %19 +%26 = OpLabel +OpBranch %20 +%20 = OpLabel +OpBranch %18 +%19 = OpLabel +%28 = OpLoad %v4float %InColor +%29 = OpLoad %float %f +%30 = OpCompositeConstruct %v4float %29 %29 %29 %29 +%31 = OpFDiv %v4float %28 %30 +OpStore %OutColor %31 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, true); +} + +TEST_F(AggressiveDCETest, NoEliminateIfBreak2) { + // Do not eliminate break as conditional branch with merge instruction + // Note: SPIR-V edited to add merge instruction before break. + // + // #version 430 + // + // layout(std430) buffer U_t + // { + // float g_F[10]; + // }; + // + // layout(location = 0)out float o; + // + // void main(void) + // { + // float s = 0.0; + // for (int i=0; i<10; i++) + // s += g_F[i]; + // o = s; + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %o +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 430 +OpName %main "main" +OpName %s "s" +OpName %i "i" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_F" +OpName %_ "" +OpName %o "o" +OpDecorate %_arr_float_uint_10 ArrayStride 4 +OpMemberDecorate %U_t 0 Offset 0 +OpDecorate %U_t BufferBlock +OpDecorate %_ DescriptorSet 0 +OpDecorate %o Location 0 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%uint = OpTypeInt 32 0 +%uint_10 = OpConstant %uint 10 +%_arr_float_uint_10 = OpTypeArray %float %uint_10 +%U_t = OpTypeStruct %_arr_float_uint_10 +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%_ptr_Uniform_float = OpTypePointer Uniform %float +%int_1 = OpConstant %int 1 +%_ptr_Output_float = OpTypePointer Output %float +%o = OpVariable %_ptr_Output_float Output +%main = OpFunction %void None %10 +%25 = OpLabel +%s = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +OpStore %s %float_0 +OpStore %i %int_0 +OpBranch %26 +%26 = OpLabel +OpLoopMerge %27 %28 None +OpBranch %29 +%29 = OpLabel +%30 = OpLoad %int %i +%31 = OpSLessThan %bool %30 %int_10 +OpSelectionMerge %32 None +OpBranchConditional %31 %32 %27 +%32 = OpLabel +%33 = OpLoad %int %i +%34 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %33 +%35 = OpLoad %float %34 +%36 = OpLoad %float %s +%37 = OpFAdd %float %36 %35 +OpStore %s %37 +OpBranch %28 +%28 = OpLabel +%38 = OpLoad %int %i +%39 = OpIAdd %int %38 %int_1 +OpStore %i %39 +OpBranch %26 +%27 = OpLabel +%40 = OpLoad %float %s +OpStore %o %40 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, true); +} + +TEST_F(AggressiveDCETest, EliminateEntireUselessLoop) { + // #version 140 + // in vec4 BaseColor; + // + // layout(std140) uniform U_t + // { + // int g_I ; + // } ; + // + // void main() + // { + // vec4 v = BaseColor; + // float df = 0.0; + // int i = 0; + // while (i < g_I) { + // df = df * 0.5; + // i = i + 1; + // } + // gl_FragColor = v; + // } + + const std::string predefs1 = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +)"; + + const std::string names_before = + R"(OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %df "df" +OpName %i "i" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_I" +OpName %_ "" +OpName %gl_FragColor "gl_FragColor" +)"; + + const std::string names_after = + R"(OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +)"; + + const std::string predefs2_before = + R"(OpMemberDecorate %U_t 0 Offset 0 +OpDecorate %U_t Block +OpDecorate %_ DescriptorSet 0 +%void = OpTypeVoid +%11 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%U_t = OpTypeStruct %int +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%_ptr_Uniform_int = OpTypePointer Uniform %int +%bool = OpTypeBool +%float_0_5 = OpConstant %float 0.5 +%int_1 = OpConstant %int 1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string predefs2_after = + R"(%void = OpTypeVoid +%11 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string func_before = + R"(%main = OpFunction %void None %11 +%27 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%df = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +%28 = OpLoad %v4float %BaseColor +OpStore %v %28 +OpStore %df %float_0 +OpStore %i %int_0 +OpBranch %29 +%29 = OpLabel +OpLoopMerge %30 %31 None +OpBranch %32 +%32 = OpLabel +%33 = OpLoad %int %i +%34 = OpAccessChain %_ptr_Uniform_int %_ %int_0 +%35 = OpLoad %int %34 +%36 = OpSLessThan %bool %33 %35 +OpBranchConditional %36 %37 %30 +%37 = OpLabel +%38 = OpLoad %float %df +%39 = OpFMul %float %38 %float_0_5 +OpStore %df %39 +%40 = OpLoad %int %i +%41 = OpIAdd %int %40 %int_1 +OpStore %i %41 +OpBranch %31 +%31 = OpLabel +OpBranch %29 +%30 = OpLabel +%42 = OpLoad %v4float %v +OpStore %gl_FragColor %42 +OpReturn +OpFunctionEnd +)"; + + const std::string func_after = + R"(%main = OpFunction %void None %11 +%27 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%28 = OpLoad %v4float %BaseColor +OpStore %v %28 +OpBranch %29 +%29 = OpLabel +OpBranch %30 +%30 = OpLabel +%42 = OpLoad %v4float %v +OpStore %gl_FragColor %42 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs1 + names_before + predefs2_before + func_before, + predefs1 + names_after + predefs2_after + func_after, true, true); +} + +TEST_F(AggressiveDCETest, NoEliminateBusyLoop) { + // Note: SPIR-V edited to replace AtomicAdd(i,0) with AtomicLoad(i) + // + // #version 450 + // + // layout(std430) buffer I_t + // { + // int g_I; + // int g_I2; + // }; + // + // layout(location = 0) out int o; + // + // void main(void) + // { + // while (atomicAdd(g_I, 0) == 0) {} + // o = g_I2; + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %o +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %I_t "I_t" +OpMemberName %I_t 0 "g_I" +OpMemberName %I_t 1 "g_I2" +OpName %_ "" +OpName %o "o" +OpMemberDecorate %I_t 0 Offset 0 +OpMemberDecorate %I_t 1 Offset 4 +OpDecorate %I_t BufferBlock +OpDecorate %_ DescriptorSet 0 +OpDecorate %o Location 0 +%void = OpTypeVoid +%7 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%I_t = OpTypeStruct %int %int +%_ptr_Uniform_I_t = OpTypePointer Uniform %I_t +%_ = OpVariable %_ptr_Uniform_I_t Uniform +%int_0 = OpConstant %int 0 +%int_1 = OpConstant %int 1 +%_ptr_Uniform_int = OpTypePointer Uniform %int +%uint = OpTypeInt 32 0 +%uint_1 = OpConstant %uint 1 +%uint_0 = OpConstant %uint 0 +%bool = OpTypeBool +%_ptr_Output_int = OpTypePointer Output %int +%o = OpVariable %_ptr_Output_int Output +%main = OpFunction %void None %7 +%18 = OpLabel +OpBranch %19 +%19 = OpLabel +OpLoopMerge %20 %21 None +OpBranch %22 +%22 = OpLabel +%23 = OpAccessChain %_ptr_Uniform_int %_ %int_0 +%24 = OpAtomicLoad %int %23 %uint_1 %uint_0 +%25 = OpIEqual %bool %24 %int_0 +OpBranchConditional %25 %26 %20 +%26 = OpLabel +OpBranch %21 +%21 = OpLabel +OpBranch %19 +%20 = OpLabel +%27 = OpAccessChain %_ptr_Uniform_int %_ %int_1 +%28 = OpLoad %int %27 +OpStore %o %28 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, true); +} + +TEST_F(AggressiveDCETest, NoEliminateLiveLoop) { + // Note: SPIR-V optimized + // + // #version 430 + // + // layout(std430) buffer U_t + // { + // float g_F[10]; + // }; + // + // layout(location = 0)out float o; + // + // void main(void) + // { + // float s = 0.0; + // for (int i=0; i<10; i++) + // s += g_F[i]; + // o = s; + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %o +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 430 +OpName %main "main" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_F" +OpName %_ "" +OpName %o "o" +OpDecorate %_arr_float_uint_10 ArrayStride 4 +OpMemberDecorate %U_t 0 Offset 0 +OpDecorate %U_t BufferBlock +OpDecorate %_ DescriptorSet 0 +OpDecorate %o Location 0 +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%float_0 = OpConstant %float 0 +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%uint = OpTypeInt 32 0 +%uint_10 = OpConstant %uint 10 +%_arr_float_uint_10 = OpTypeArray %float %uint_10 +%U_t = OpTypeStruct %_arr_float_uint_10 +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%_ptr_Uniform_float = OpTypePointer Uniform %float +%int_1 = OpConstant %int 1 +%_ptr_Output_float = OpTypePointer Output %float +%o = OpVariable %_ptr_Output_float Output +%main = OpFunction %void None %8 +%21 = OpLabel +OpBranch %22 +%22 = OpLabel +%23 = OpPhi %float %float_0 %21 %24 %25 +%26 = OpPhi %int %int_0 %21 %27 %25 +OpLoopMerge %28 %25 None +OpBranch %29 +%29 = OpLabel +%30 = OpSLessThan %bool %26 %int_10 +OpBranchConditional %30 %31 %28 +%31 = OpLabel +%32 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %26 +%33 = OpLoad %float %32 +%24 = OpFAdd %float %23 %33 +OpBranch %25 +%25 = OpLabel +%27 = OpIAdd %int %26 %int_1 +OpBranch %22 +%28 = OpLabel +OpStore %o %23 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, true); +} + +TEST_F(AggressiveDCETest, EliminateEntireFunctionBody) { + // #version 450 + // + // layout(location = 0) in vec4 BaseColor; + // layout(location = 0) out vec4 OutColor; + // + // void main() + // { + // float d; + // if (BaseColor.x == 0) + // d = BaseColor.y; + // else + // d = BaseColor.z; + // } + + const std::string predefs_before = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %BaseColor "BaseColor" +OpName %d "d" +OpName %OutColor "OutColor" +OpDecorate %BaseColor Location 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%_ptr_Input_float = OpTypePointer Input %float +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%_ptr_Function_float = OpTypePointer Function %float +%uint_1 = OpConstant %uint 1 +%uint_2 = OpConstant %uint 2 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string predefs_after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %BaseColor "BaseColor" +OpName %OutColor "OutColor" +OpDecorate %BaseColor Location 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string func_before = + R"(%main = OpFunction %void None %7 +%20 = OpLabel +%d = OpVariable %_ptr_Function_float Function +%21 = OpAccessChain %_ptr_Input_float %BaseColor %uint_0 +%22 = OpLoad %float %21 +%23 = OpFOrdEqual %bool %22 %float_0 +OpSelectionMerge %24 None +OpBranchConditional %23 %25 %26 +%25 = OpLabel +%27 = OpAccessChain %_ptr_Input_float %BaseColor %uint_1 +%28 = OpLoad %float %27 +OpStore %d %28 +OpBranch %24 +%26 = OpLabel +%29 = OpAccessChain %_ptr_Input_float %BaseColor %uint_2 +%30 = OpLoad %float %29 +OpStore %d %30 +OpBranch %24 +%24 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string func_after = + R"(%main = OpFunction %void None %7 +%20 = OpLabel +OpBranch %24 +%24 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs_before + func_before, predefs_after + func_after, true, true); +} + +TEST_F(AggressiveDCETest, EliminateUselessInnerLoop) { + // #version 430 + // + // layout(std430) buffer U_t + // { + // float g_F[10]; + // }; + // + // layout(location = 0)out float o; + // + // void main(void) + // { + // float s = 0.0; + // for (int i=0; i<10; i++) { + // for (int j=0; j<10; j++) { + // } + // s += g_F[i]; + // } + // o = s; + // } + + const std::string predefs_before = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %o +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 430 +OpName %main "main" +OpName %s "s" +OpName %i "i" +OpName %j "j" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_F" +OpName %_ "" +OpName %o "o" +OpDecorate %_arr_float_uint_10 ArrayStride 4 +OpMemberDecorate %U_t 0 Offset 0 +OpDecorate %U_t BufferBlock +OpDecorate %_ DescriptorSet 0 +OpDecorate %o Location 0 +%void = OpTypeVoid +%11 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%int_1 = OpConstant %int 1 +%uint = OpTypeInt 32 0 +%uint_10 = OpConstant %uint 10 +%_arr_float_uint_10 = OpTypeArray %float %uint_10 +%U_t = OpTypeStruct %_arr_float_uint_10 +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%_ptr_Uniform_float = OpTypePointer Uniform %float +%_ptr_Output_float = OpTypePointer Output %float +%o = OpVariable %_ptr_Output_float Output +)"; + + const std::string predefs_after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %o +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 430 +OpName %main "main" +OpName %s "s" +OpName %i "i" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_F" +OpName %_ "" +OpName %o "o" +OpDecorate %_arr_float_uint_10 ArrayStride 4 +OpMemberDecorate %U_t 0 Offset 0 +OpDecorate %U_t BufferBlock +OpDecorate %_ DescriptorSet 0 +OpDecorate %o Location 0 +%void = OpTypeVoid +%11 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%int_1 = OpConstant %int 1 +%uint = OpTypeInt 32 0 +%uint_10 = OpConstant %uint 10 +%_arr_float_uint_10 = OpTypeArray %float %uint_10 +%U_t = OpTypeStruct %_arr_float_uint_10 +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%_ptr_Uniform_float = OpTypePointer Uniform %float +%_ptr_Output_float = OpTypePointer Output %float +%o = OpVariable %_ptr_Output_float Output +)"; + + const std::string func_before = + R"(%main = OpFunction %void None %11 +%26 = OpLabel +%s = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +%j = OpVariable %_ptr_Function_int Function +OpStore %s %float_0 +OpStore %i %int_0 +OpBranch %27 +%27 = OpLabel +OpLoopMerge %28 %29 None +OpBranch %30 +%30 = OpLabel +%31 = OpLoad %int %i +%32 = OpSLessThan %bool %31 %int_10 +OpBranchConditional %32 %33 %28 +%33 = OpLabel +OpStore %j %int_0 +OpBranch %34 +%34 = OpLabel +OpLoopMerge %35 %36 None +OpBranch %37 +%37 = OpLabel +%38 = OpLoad %int %j +%39 = OpSLessThan %bool %38 %int_10 +OpBranchConditional %39 %40 %35 +%40 = OpLabel +OpBranch %36 +%36 = OpLabel +%41 = OpLoad %int %j +%42 = OpIAdd %int %41 %int_1 +OpStore %j %42 +OpBranch %34 +%35 = OpLabel +%43 = OpLoad %int %i +%44 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %43 +%45 = OpLoad %float %44 +%46 = OpLoad %float %s +%47 = OpFAdd %float %46 %45 +OpStore %s %47 +OpBranch %29 +%29 = OpLabel +%48 = OpLoad %int %i +%49 = OpIAdd %int %48 %int_1 +OpStore %i %49 +OpBranch %27 +%28 = OpLabel +%50 = OpLoad %float %s +OpStore %o %50 +OpReturn +OpFunctionEnd +)"; + + const std::string func_after = + R"(%main = OpFunction %void None %11 +%26 = OpLabel +%s = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +OpStore %s %float_0 +OpStore %i %int_0 +OpBranch %27 +%27 = OpLabel +OpLoopMerge %28 %29 None +OpBranch %30 +%30 = OpLabel +%31 = OpLoad %int %i +%32 = OpSLessThan %bool %31 %int_10 +OpBranchConditional %32 %33 %28 +%33 = OpLabel +OpBranch %34 +%34 = OpLabel +OpBranch %35 +%35 = OpLabel +%43 = OpLoad %int %i +%44 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %43 +%45 = OpLoad %float %44 +%46 = OpLoad %float %s +%47 = OpFAdd %float %46 %45 +OpStore %s %47 +OpBranch %29 +%29 = OpLabel +%48 = OpLoad %int %i +%49 = OpIAdd %int %48 %int_1 +OpStore %i %49 +OpBranch %27 +%28 = OpLabel +%50 = OpLoad %float %s +OpStore %o %50 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs_before + func_before, predefs_after + func_after, true, true); +} + +TEST_F(AggressiveDCETest, EliminateUselessNestedLoopWithIf) { + // #version 430 + // + // layout(std430) buffer U_t + // { + // float g_F[10][10]; + // }; + // + // layout(location = 0)out float o; + // + // void main(void) + // { + // float s = 0.0; + // for (int i=0; i<10; i++) { + // for (int j=0; j<10; j++) { + // float t = g_F[i][j]; + // if (t > 0.0) + // s += t; + // } + // } + // o = 0.0; + // } + + const std::string predefs_before = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %o +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 430 +OpName %main "main" +OpName %s "s" +OpName %i "i" +OpName %j "j" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_F" +OpName %_ "" +OpName %o "o" +OpDecorate %_arr_float_uint_10 ArrayStride 4 +OpDecorate %_arr__arr_float_uint_10_uint_10 ArrayStride 40 +OpMemberDecorate %U_t 0 Offset 0 +OpDecorate %U_t BufferBlock +OpDecorate %_ DescriptorSet 0 +OpDecorate %o Location 0 +%void = OpTypeVoid +%12 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%uint = OpTypeInt 32 0 +%uint_10 = OpConstant %uint 10 +%_arr_float_uint_10 = OpTypeArray %float %uint_10 +%_arr__arr_float_uint_10_uint_10 = OpTypeArray %_arr_float_uint_10 %uint_10 +%U_t = OpTypeStruct %_arr__arr_float_uint_10_uint_10 +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%_ptr_Uniform_float = OpTypePointer Uniform %float +%int_1 = OpConstant %int 1 +%_ptr_Output_float = OpTypePointer Output %float +%o = OpVariable %_ptr_Output_float Output +)"; + + const std::string predefs_after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %o +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 430 +OpName %main "main" +OpName %o "o" +OpDecorate %o Location 0 +%void = OpTypeVoid +%12 = OpTypeFunction %void +%float = OpTypeFloat 32 +%float_0 = OpConstant %float 0 +%_ptr_Output_float = OpTypePointer Output %float +%o = OpVariable %_ptr_Output_float Output +)"; + + const std::string func_before = + R"(%main = OpFunction %void None %12 +%27 = OpLabel +%s = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +%j = OpVariable %_ptr_Function_int Function +OpStore %s %float_0 +OpStore %i %int_0 +OpBranch %28 +%28 = OpLabel +OpLoopMerge %29 %30 None +OpBranch %31 +%31 = OpLabel +%32 = OpLoad %int %i +%33 = OpSLessThan %bool %32 %int_10 +OpBranchConditional %33 %34 %29 +%34 = OpLabel +OpStore %j %int_0 +OpBranch %35 +%35 = OpLabel +OpLoopMerge %36 %37 None +OpBranch %38 +%38 = OpLabel +%39 = OpLoad %int %j +%40 = OpSLessThan %bool %39 %int_10 +OpBranchConditional %40 %41 %36 +%41 = OpLabel +%42 = OpLoad %int %i +%43 = OpLoad %int %j +%44 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %42 %43 +%45 = OpLoad %float %44 +%46 = OpFOrdGreaterThan %bool %45 %float_0 +OpSelectionMerge %47 None +OpBranchConditional %46 %48 %47 +%48 = OpLabel +%49 = OpLoad %float %s +%50 = OpFAdd %float %49 %45 +OpStore %s %50 +OpBranch %47 +%47 = OpLabel +OpBranch %37 +%37 = OpLabel +%51 = OpLoad %int %j +%52 = OpIAdd %int %51 %int_1 +OpStore %j %52 +OpBranch %35 +%36 = OpLabel +OpBranch %30 +%30 = OpLabel +%53 = OpLoad %int %i +%54 = OpIAdd %int %53 %int_1 +OpStore %i %54 +OpBranch %28 +%29 = OpLabel +OpStore %o %float_0 +OpReturn +OpFunctionEnd +)"; + + const std::string func_after = + R"(%main = OpFunction %void None %12 +%27 = OpLabel +OpBranch %28 +%28 = OpLabel +OpBranch %29 +%29 = OpLabel +OpStore %o %float_0 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs_before + func_before, predefs_after + func_after, true, true); +} + +TEST_F(AggressiveDCETest, EliminateEmptyIfBeforeContinue) { + // #version 430 + // + // layout(location = 0)out float o; + // + // void main(void) + // { + // float s = 0.0; + // for (int i=0; i<10; i++) { + // s += 1.0; + // if (i > s) {} + // } + // o = s; + // } + + const std::string predefs_before = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %3 +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 430 +OpSourceExtension "GL_GOOGLE_cpp_style_line_directive" +OpSourceExtension "GL_GOOGLE_include_directive" +OpName %main "main" +OpDecorate %3 Location 0 +%void = OpTypeVoid +%5 = OpTypeFunction %void +%float = OpTypeFloat 32 +%float_0 = OpConstant %float 0 +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%float_1 = OpConstant %float 1 +%int_1 = OpConstant %int 1 +%_ptr_Output_float = OpTypePointer Output %float +%3 = OpVariable %_ptr_Output_float Output +)"; + + const std::string predefs_after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %3 +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 430 +OpSourceExtension "GL_GOOGLE_cpp_style_line_directive" +OpSourceExtension "GL_GOOGLE_include_directive" +OpName %main "main" +OpDecorate %3 Location 0 +%void = OpTypeVoid +%5 = OpTypeFunction %void +%float = OpTypeFloat 32 +%float_0 = OpConstant %float 0 +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%float_1 = OpConstant %float 1 +%int_1 = OpConstant %int 1 +%_ptr_Output_float = OpTypePointer Output %float +%3 = OpVariable %_ptr_Output_float Output +)"; + + const std::string func_before = + R"(%main = OpFunction %void None %5 +%16 = OpLabel +OpBranch %17 +%17 = OpLabel +%18 = OpPhi %float %float_0 %16 %19 %20 +%21 = OpPhi %int %int_0 %16 %22 %20 +OpLoopMerge %23 %20 None +OpBranch %24 +%24 = OpLabel +%25 = OpSLessThan %bool %21 %int_10 +OpBranchConditional %25 %26 %23 +%26 = OpLabel +%19 = OpFAdd %float %18 %float_1 +%27 = OpConvertFToS %int %19 +%28 = OpSGreaterThan %bool %21 %27 +OpSelectionMerge %20 None +OpBranchConditional %28 %29 %20 +%29 = OpLabel +OpBranch %20 +%20 = OpLabel +%22 = OpIAdd %int %21 %int_1 +OpBranch %17 +%23 = OpLabel +OpStore %3 %18 +OpReturn +OpFunctionEnd +)"; + + const std::string func_after = + R"(%main = OpFunction %void None %5 +%16 = OpLabel +OpBranch %17 +%17 = OpLabel +%18 = OpPhi %float %float_0 %16 %19 %20 +%21 = OpPhi %int %int_0 %16 %22 %20 +OpLoopMerge %23 %20 None +OpBranch %24 +%24 = OpLabel +%25 = OpSLessThan %bool %21 %int_10 +OpBranchConditional %25 %26 %23 +%26 = OpLabel +%19 = OpFAdd %float %18 %float_1 +OpBranch %20 +%20 = OpLabel +%22 = OpIAdd %int %21 %int_1 +OpBranch %17 +%23 = OpLabel +OpStore %3 %18 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs_before + func_before, predefs_after + func_after, true, true); +} + +TEST_F(AggressiveDCETest, NoEliminateLiveNestedLoopWithIf) { + // Note: SPIR-V optimized + // + // #version 430 + // + // layout(std430) buffer U_t + // { + // float g_F[10][10]; + // }; + // + // layout(location = 0)out float o; + // + // void main(void) + // { + // float s = 0.0; + // for (int i=0; i<10; i++) { + // for (int j=0; j<10; j++) { + // float t = g_F[i][j]; + // if (t > 0.0) + // s += t; + // } + // } + // o = s; + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %o +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 430 +OpName %main "main" +OpName %s "s" +OpName %i "i" +OpName %j "j" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_F" +OpName %_ "" +OpName %o "o" +OpDecorate %_arr_float_uint_10 ArrayStride 4 +OpDecorate %_arr__arr_float_uint_10_uint_10 ArrayStride 40 +OpMemberDecorate %U_t 0 Offset 0 +OpDecorate %U_t BufferBlock +OpDecorate %_ DescriptorSet 0 +OpDecorate %o Location 0 +%void = OpTypeVoid +%12 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%uint = OpTypeInt 32 0 +%uint_10 = OpConstant %uint 10 +%_arr_float_uint_10 = OpTypeArray %float %uint_10 +%_arr__arr_float_uint_10_uint_10 = OpTypeArray %_arr_float_uint_10 %uint_10 +%U_t = OpTypeStruct %_arr__arr_float_uint_10_uint_10 +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%_ptr_Uniform_float = OpTypePointer Uniform %float +%int_1 = OpConstant %int 1 +%_ptr_Output_float = OpTypePointer Output %float +%o = OpVariable %_ptr_Output_float Output +%main = OpFunction %void None %12 +%27 = OpLabel +%s = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +%j = OpVariable %_ptr_Function_int Function +OpStore %s %float_0 +OpStore %i %int_0 +OpBranch %28 +%28 = OpLabel +OpLoopMerge %29 %30 None +OpBranch %31 +%31 = OpLabel +%32 = OpLoad %int %i +%33 = OpSLessThan %bool %32 %int_10 +OpBranchConditional %33 %34 %29 +%34 = OpLabel +OpStore %j %int_0 +OpBranch %35 +%35 = OpLabel +OpLoopMerge %36 %37 None +OpBranch %38 +%38 = OpLabel +%39 = OpLoad %int %j +%40 = OpSLessThan %bool %39 %int_10 +OpBranchConditional %40 %41 %36 +%41 = OpLabel +%42 = OpLoad %int %i +%43 = OpLoad %int %j +%44 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %42 %43 +%45 = OpLoad %float %44 +%46 = OpFOrdGreaterThan %bool %45 %float_0 +OpSelectionMerge %47 None +OpBranchConditional %46 %48 %47 +%48 = OpLabel +%49 = OpLoad %float %s +%50 = OpFAdd %float %49 %45 +OpStore %s %50 +OpBranch %47 +%47 = OpLabel +OpBranch %37 +%37 = OpLabel +%51 = OpLoad %int %j +%52 = OpIAdd %int %51 %int_1 +OpStore %j %52 +OpBranch %35 +%36 = OpLabel +OpBranch %30 +%30 = OpLabel +%53 = OpLoad %int %i +%54 = OpIAdd %int %53 %int_1 +OpStore %i %54 +OpBranch %28 +%29 = OpLabel +%55 = OpLoad %float %s +OpStore %o %55 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, true); +} + +TEST_F(AggressiveDCETest, NoEliminateIfContinue) { + // Do not eliminate continue embedded in if construct + // + // #version 430 + // + // layout(std430) buffer U_t + // { + // float g_F[10]; + // }; + // + // layout(location = 0)out float o; + // + // void main(void) + // { + // float s = 0.0; + // for (int i=0; i<10; i++) { + // if (i % 2 == 0) continue; + // s += g_F[i]; + // } + // o = s; + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %o +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 430 +OpName %main "main" +OpName %s "s" +OpName %i "i" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_F" +OpName %_ "" +OpName %o "o" +OpDecorate %_arr_float_uint_10 ArrayStride 4 +OpMemberDecorate %U_t 0 Offset 0 +OpDecorate %U_t BufferBlock +OpDecorate %_ DescriptorSet 0 +OpDecorate %o Location 0 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%int_2 = OpConstant %int 2 +%uint = OpTypeInt 32 0 +%uint_10 = OpConstant %uint 10 +%_arr_float_uint_10 = OpTypeArray %float %uint_10 +%U_t = OpTypeStruct %_arr_float_uint_10 +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%_ptr_Uniform_float = OpTypePointer Uniform %float +%int_1 = OpConstant %int 1 +%_ptr_Output_float = OpTypePointer Output %float +%o = OpVariable %_ptr_Output_float Output +%main = OpFunction %void None %10 +%26 = OpLabel +%s = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +OpStore %s %float_0 +OpStore %i %int_0 +OpBranch %27 +%27 = OpLabel +OpLoopMerge %28 %29 None +OpBranch %30 +%30 = OpLabel +%31 = OpLoad %int %i +%32 = OpSLessThan %bool %31 %int_10 +OpBranchConditional %32 %33 %28 +%33 = OpLabel +%34 = OpLoad %int %i +%35 = OpSMod %int %34 %int_2 +%36 = OpIEqual %bool %35 %int_0 +OpSelectionMerge %37 None +OpBranchConditional %36 %38 %37 +%38 = OpLabel +OpBranch %29 +%37 = OpLabel +%39 = OpLoad %int %i +%40 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %39 +%41 = OpLoad %float %40 +%42 = OpLoad %float %s +%43 = OpFAdd %float %42 %41 +OpStore %s %43 +OpBranch %29 +%29 = OpLabel +%44 = OpLoad %int %i +%45 = OpIAdd %int %44 %int_1 +OpStore %i %45 +OpBranch %27 +%28 = OpLabel +%46 = OpLoad %float %s +OpStore %o %46 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, true); +} + +TEST_F(AggressiveDCETest, NoEliminateIfContinue2) { + // Do not eliminate continue not embedded in if construct + // + // #version 430 + // + // layout(std430) buffer U_t + // { + // float g_F[10]; + // }; + // + // layout(location = 0)out float o; + // + // void main(void) + // { + // float s = 0.0; + // for (int i=0; i<10; i++) { + // if (i % 2 == 0) continue; + // s += g_F[i]; + // } + // o = s; + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %o +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 430 +OpName %main "main" +OpName %s "s" +OpName %i "i" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_F" +OpName %_ "" +OpName %o "o" +OpDecorate %_arr_float_uint_10 ArrayStride 4 +OpMemberDecorate %U_t 0 Offset 0 +OpDecorate %U_t BufferBlock +OpDecorate %_ DescriptorSet 0 +OpDecorate %o Location 0 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%int_2 = OpConstant %int 2 +%uint = OpTypeInt 32 0 +%uint_10 = OpConstant %uint 10 +%_arr_float_uint_10 = OpTypeArray %float %uint_10 +%U_t = OpTypeStruct %_arr_float_uint_10 +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%_ptr_Uniform_float = OpTypePointer Uniform %float +%int_1 = OpConstant %int 1 +%_ptr_Output_float = OpTypePointer Output %float +%o = OpVariable %_ptr_Output_float Output +%main = OpFunction %void None %10 +%26 = OpLabel +%s = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +OpStore %s %float_0 +OpStore %i %int_0 +OpBranch %27 +%27 = OpLabel +OpLoopMerge %28 %29 None +OpBranch %30 +%30 = OpLabel +%31 = OpLoad %int %i +%32 = OpSLessThan %bool %31 %int_10 +OpBranchConditional %32 %33 %28 +%33 = OpLabel +%34 = OpLoad %int %i +%35 = OpSMod %int %34 %int_2 +%36 = OpIEqual %bool %35 %int_0 +OpBranchConditional %36 %29 %37 +%37 = OpLabel +%38 = OpLoad %int %i +%39 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %38 +%40 = OpLoad %float %39 +%41 = OpLoad %float %s +%42 = OpFAdd %float %41 %40 +OpStore %s %42 +OpBranch %29 +%29 = OpLabel +%43 = OpLoad %int %i +%44 = OpIAdd %int %43 %int_1 +OpStore %i %44 +OpBranch %27 +%28 = OpLabel +%45 = OpLoad %float %s +OpStore %o %45 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, true); +} + +TEST_F(AggressiveDCETest, NoEliminateIfContinue3) { + // Do not eliminate continue as conditional branch with merge instruction + // Note: SPIR-V edited to add merge instruction before continue. + // + // #version 430 + // + // layout(std430) buffer U_t + // { + // float g_F[10]; + // }; + // + // layout(location = 0)out float o; + // + // void main(void) + // { + // float s = 0.0; + // for (int i=0; i<10; i++) { + // if (i % 2 == 0) continue; + // s += g_F[i]; + // } + // o = s; + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %o +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 430 +OpName %main "main" +OpName %s "s" +OpName %i "i" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_F" +OpName %_ "" +OpName %o "o" +OpDecorate %_arr_float_uint_10 ArrayStride 4 +OpMemberDecorate %U_t 0 Offset 0 +OpDecorate %U_t BufferBlock +OpDecorate %_ DescriptorSet 0 +OpDecorate %o Location 0 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%int_2 = OpConstant %int 2 +%uint = OpTypeInt 32 0 +%uint_10 = OpConstant %uint 10 +%_arr_float_uint_10 = OpTypeArray %float %uint_10 +%U_t = OpTypeStruct %_arr_float_uint_10 +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%_ptr_Uniform_float = OpTypePointer Uniform %float +%int_1 = OpConstant %int 1 +%_ptr_Output_float = OpTypePointer Output %float +%o = OpVariable %_ptr_Output_float Output +%main = OpFunction %void None %10 +%26 = OpLabel +%s = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +OpStore %s %float_0 +OpStore %i %int_0 +OpBranch %27 +%27 = OpLabel +OpLoopMerge %28 %29 None +OpBranch %30 +%30 = OpLabel +%31 = OpLoad %int %i +%32 = OpSLessThan %bool %31 %int_10 +OpBranchConditional %32 %33 %28 +%33 = OpLabel +%34 = OpLoad %int %i +%35 = OpSMod %int %34 %int_2 +%36 = OpIEqual %bool %35 %int_0 +OpSelectionMerge %37 None +OpBranchConditional %36 %29 %37 +%37 = OpLabel +%38 = OpLoad %int %i +%39 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %38 +%40 = OpLoad %float %39 +%41 = OpLoad %float %s +%42 = OpFAdd %float %41 %40 +OpStore %s %42 +OpBranch %29 +%29 = OpLabel +%43 = OpLoad %int %i +%44 = OpIAdd %int %43 %int_1 +OpStore %i %44 +OpBranch %27 +%28 = OpLabel +%45 = OpLoad %float %s +OpStore %o %45 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, true); +} + +TEST_F(AggressiveDCETest, PointerVariable) { + // ADCE is able to handle code that contains a load whose base address + // comes from a load and not an OpVariable. I want to see an instruction + // removed to be sure that ADCE is not exiting early. + + const std::string before = + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %1 "main" %2 +OpExecutionMode %1 OriginUpperLeft +OpMemberDecorate %_struct_3 0 Offset 0 +OpDecorate %_runtimearr__struct_3 ArrayStride 16 +OpMemberDecorate %_struct_5 0 Offset 0 +OpDecorate %_struct_5 BufferBlock +OpMemberDecorate %_struct_6 0 Offset 0 +OpDecorate %_struct_6 BufferBlock +OpDecorate %2 Location 0 +OpDecorate %7 DescriptorSet 0 +OpDecorate %7 Binding 0 +OpDecorate %8 DescriptorSet 0 +OpDecorate %8 Binding 1 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%uint = OpTypeInt 32 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float +%_struct_3 = OpTypeStruct %v4float +%_runtimearr__struct_3 = OpTypeRuntimeArray %_struct_3 +%_struct_5 = OpTypeStruct %_runtimearr__struct_3 +%_ptr_Uniform__struct_5 = OpTypePointer Uniform %_struct_5 +%_struct_6 = OpTypeStruct %int +%_ptr_Uniform__struct_6 = OpTypePointer Uniform %_struct_6 +%_ptr_Function__ptr_Uniform__struct_5 = OpTypePointer Function %_ptr_Uniform__struct_5 +%_ptr_Function__ptr_Uniform__struct_6 = OpTypePointer Function %_ptr_Uniform__struct_6 +%int_0 = OpConstant %int 0 +%uint_0 = OpConstant %uint 0 +%2 = OpVariable %_ptr_Output_v4float Output +%7 = OpVariable %_ptr_Uniform__struct_5 Uniform +%8 = OpVariable %_ptr_Uniform__struct_6 Uniform +%1 = OpFunction %void None %10 +%23 = OpLabel +%24 = OpVariable %_ptr_Function__ptr_Uniform__struct_5 Function +OpStore %24 %7 +%26 = OpLoad %_ptr_Uniform__struct_5 %24 +%27 = OpAccessChain %_ptr_Uniform_v4float %26 %int_0 %uint_0 %int_0 +%28 = OpLoad %v4float %27 +%29 = OpCopyObject %v4float %28 +OpStore %2 %28 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %1 "main" %2 +OpExecutionMode %1 OriginUpperLeft +OpMemberDecorate %_struct_3 0 Offset 0 +OpDecorate %_runtimearr__struct_3 ArrayStride 16 +OpMemberDecorate %_struct_5 0 Offset 0 +OpDecorate %_struct_5 BufferBlock +OpDecorate %2 Location 0 +OpDecorate %7 DescriptorSet 0 +OpDecorate %7 Binding 0 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%uint = OpTypeInt 32 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float +%_struct_3 = OpTypeStruct %v4float +%_runtimearr__struct_3 = OpTypeRuntimeArray %_struct_3 +%_struct_5 = OpTypeStruct %_runtimearr__struct_3 +%_ptr_Uniform__struct_5 = OpTypePointer Uniform %_struct_5 +%_ptr_Function__ptr_Uniform__struct_5 = OpTypePointer Function %_ptr_Uniform__struct_5 +%int_0 = OpConstant %int 0 +%uint_0 = OpConstant %uint 0 +%2 = OpVariable %_ptr_Output_v4float Output +%7 = OpVariable %_ptr_Uniform__struct_5 Uniform +%1 = OpFunction %void None %10 +%23 = OpLabel +%24 = OpVariable %_ptr_Function__ptr_Uniform__struct_5 Function +OpStore %24 %7 +%25 = OpLoad %_ptr_Uniform__struct_5 %24 +%26 = OpAccessChain %_ptr_Uniform_v4float %25 %int_0 %uint_0 %int_0 +%27 = OpLoad %v4float %26 +OpStore %2 %27 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(before, after, true, true); +} + +// %dead is unused. Make sure we remove it along with its name. +TEST_F(AggressiveDCETest, RemoveUnreferenced) { + const std::string before = + R"(OpCapability Shader +OpCapability Linkage +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 150 +OpName %main "main" +OpName %dead "dead" +%void = OpTypeVoid +%5 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Private_float = OpTypePointer Private %float +%dead = OpVariable %_ptr_Private_float Private +%main = OpFunction %void None %5 +%8 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Shader +OpCapability Linkage +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 150 +OpName %main "main" +%void = OpTypeVoid +%5 = OpTypeFunction %void +%main = OpFunction %void None %5 +%8 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(before, after, true, true); +} + +// Delete %dead because it is unreferenced. Then %initializer becomes +// unreferenced, so remove it as well. +TEST_F(AggressiveDCETest, RemoveUnreferencedWithInit1) { + const std::string before = + R"(OpCapability Shader +OpCapability Linkage +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 150 +OpName %main "main" +OpName %dead "dead" +OpName %initializer "initializer" +%void = OpTypeVoid +%6 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Private_float = OpTypePointer Private %float +%initializer = OpVariable %_ptr_Private_float Private +%dead = OpVariable %_ptr_Private_float Private %initializer +%main = OpFunction %void None %6 +%9 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Shader +OpCapability Linkage +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 150 +OpName %main "main" +%void = OpTypeVoid +%6 = OpTypeFunction %void +%main = OpFunction %void None %6 +%9 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(before, after, true, true); +} + +// Keep %live because it is used, and its initializer. +TEST_F(AggressiveDCETest, KeepReferenced) { + const std::string before = + R"(OpCapability Shader +OpCapability Linkage +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %output +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 150 +OpName %main "main" +OpName %live "live" +OpName %initializer "initializer" +OpName %output "output" +%void = OpTypeVoid +%6 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Private_float = OpTypePointer Private %float +%initializer = OpVariable %_ptr_Private_float Private +%live = OpVariable %_ptr_Private_float Private %initializer +%_ptr_Output_float = OpTypePointer Output %float +%output = OpVariable %_ptr_Output_float Output +%main = OpFunction %void None %6 +%9 = OpLabel +%10 = OpLoad %float %live +OpStore %output %10 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(before, before, true, true); +} + +// This test that the decoration associated with a variable are removed when the +// variable is removed. +TEST_F(AggressiveDCETest, RemoveVariableAndDecorations) { + const std::string before = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %main "main" +OpSource GLSL 450 +OpName %main "main" +OpName %B "B" +OpMemberName %B 0 "a" +OpName %Bdat "Bdat" +OpMemberDecorate %B 0 Offset 0 +OpDecorate %B BufferBlock +OpDecorate %Bdat DescriptorSet 0 +OpDecorate %Bdat Binding 0 +%void = OpTypeVoid +%6 = OpTypeFunction %void +%uint = OpTypeInt 32 0 +%B = OpTypeStruct %uint +%_ptr_Uniform_B = OpTypePointer Uniform %B +%Bdat = OpVariable %_ptr_Uniform_B Uniform +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%uint_1 = OpConstant %uint 1 +%_ptr_Uniform_uint = OpTypePointer Uniform %uint +%main = OpFunction %void None %6 +%13 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %main "main" +OpSource GLSL 450 +OpName %main "main" +%void = OpTypeVoid +%6 = OpTypeFunction %void +%main = OpFunction %void None %6 +%13 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(before, after, true, true); +} + +#ifdef SPIRV_EFFCEE +TEST_F(AggressiveDCETest, DeadNestedSwitch) { + const std::string text = R"( +; CHECK: OpLabel +; CHECK: OpBranch [[block:%\w+]] +; CHECK-NOT: OpSwitch +; CHECK-NEXT: [[block]] = OpLabel +; CHECK: OpBranch [[block:%\w+]] +; CHECK-NOT: OpSwitch +; CHECK-NEXT: [[block]] = OpLabel +; CHECK-NEXT: OpStore +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" %x +OpExecutionMode %func OriginUpperLeft +OpName %func "func" +%void = OpTypeVoid +%1 = OpTypeFunction %void +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%uint_ptr_Output = OpTypePointer Output %uint +%uint_ptr_Input = OpTypePointer Input %uint +%x = OpVariable %uint_ptr_Output Output +%a = OpVariable %uint_ptr_Input Input +%func = OpFunction %void None %1 +%entry = OpLabel +OpBranch %header +%header = OpLabel +%ld = OpLoad %uint %a +OpLoopMerge %merge %continue None +OpBranch %postheader +%postheader = OpLabel +; This switch doesn't require an OpSelectionMerge and is nested in the dead loop. +OpSwitch %ld %merge 0 %extra 1 %continue +%extra = OpLabel +OpBranch %continue +%continue = OpLabel +OpBranch %header +%merge = OpLabel +OpStore %x %uint_0 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} +#endif // SPIRV_EFFCEE + +TEST_F(AggressiveDCETest, LiveNestedSwitch) { + const std::string text = R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" %3 +OpExecutionMode %func OriginUpperLeft +OpName %func "func" +%void = OpTypeVoid +%1 = OpTypeFunction %void +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%_ptr_Output_uint = OpTypePointer Output %uint +%_ptr_Input_uint = OpTypePointer Input %uint +%3 = OpVariable %_ptr_Output_uint Output +%10 = OpVariable %_ptr_Input_uint Input +%func = OpFunction %void None %1 +%11 = OpLabel +OpBranch %12 +%12 = OpLabel +%13 = OpLoad %uint %10 +OpLoopMerge %14 %15 None +OpBranch %16 +%16 = OpLabel +OpSwitch %13 %14 0 %17 1 %15 +%17 = OpLabel +OpStore %3 %uint_1 +OpBranch %15 +%15 = OpLabel +OpBranch %12 +%14 = OpLabel +OpStore %3 %uint_0 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(text, text, false, true); +} + +TEST_F(AggressiveDCETest, BasicDeleteDeadFunction) { + // The function Dead should be removed because it is never called. + const std::vector common_code = { + // clang-format off + "OpCapability Shader", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Fragment %main \"main\"", + "OpName %main \"main\"", + "OpName %Live \"Live\"", + "%void = OpTypeVoid", + "%7 = OpTypeFunction %void", + "%main = OpFunction %void None %7", + "%15 = OpLabel", + "%16 = OpFunctionCall %void %Live", + "%17 = OpFunctionCall %void %Live", + "OpReturn", + "OpFunctionEnd", + "%Live = OpFunction %void None %7", + "%20 = OpLabel", + "OpReturn", + "OpFunctionEnd" + // clang-format on + }; + + const std::vector dead_function = { + // clang-format off + "%Dead = OpFunction %void None %7", + "%19 = OpLabel", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck( + JoinAllInsts(Concat(common_code, dead_function)), + JoinAllInsts(common_code), /* skip_nop = */ true); +} + +TEST_F(AggressiveDCETest, BasicKeepLiveFunction) { + // Everything is reachable from an entry point, so no functions should be + // deleted. + const std::vector text = { + // clang-format off + "OpCapability Shader", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Fragment %main \"main\"", + "OpName %main \"main\"", + "OpName %Live1 \"Live1\"", + "OpName %Live2 \"Live2\"", + "%void = OpTypeVoid", + "%7 = OpTypeFunction %void", + "%main = OpFunction %void None %7", + "%15 = OpLabel", + "%16 = OpFunctionCall %void %Live2", + "%17 = OpFunctionCall %void %Live1", + "OpReturn", + "OpFunctionEnd", + "%Live1 = OpFunction %void None %7", + "%19 = OpLabel", + "OpReturn", + "OpFunctionEnd", + "%Live2 = OpFunction %void None %7", + "%20 = OpLabel", + "OpReturn", + "OpFunctionEnd" + // clang-format on + }; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + std::string assembly = JoinAllInsts(text); + auto result = SinglePassRunAndDisassemble( + assembly, /* skip_nop = */ true, /* do_validation = */ false); + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); + EXPECT_EQ(assembly, std::get<0>(result)); +} + +TEST_F(AggressiveDCETest, BasicRemoveDecorationsAndNames) { + // We want to remove the names and decorations associated with results that + // are removed. This test will check for that. + const std::string text = R"( + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" + OpName %main "main" + OpName %Dead "Dead" + OpName %x "x" + OpName %y "y" + OpName %z "z" + OpDecorate %x RelaxedPrecision + OpDecorate %y RelaxedPrecision + OpDecorate %z RelaxedPrecision + OpDecorate %6 RelaxedPrecision + OpDecorate %7 RelaxedPrecision + OpDecorate %8 RelaxedPrecision + %void = OpTypeVoid + %10 = OpTypeFunction %void + %float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 + %main = OpFunction %void None %10 + %14 = OpLabel + OpReturn + OpFunctionEnd + %Dead = OpFunction %void None %10 + %15 = OpLabel + %x = OpVariable %_ptr_Function_float Function + %y = OpVariable %_ptr_Function_float Function + %z = OpVariable %_ptr_Function_float Function + OpStore %x %float_1 + OpStore %y %float_1 + %6 = OpLoad %float %x + %7 = OpLoad %float %y + %8 = OpFAdd %float %6 %7 + OpStore %z %8 + OpReturn + OpFunctionEnd)"; + + const std::string expected_output = R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %main "main" +OpName %main "main" +%void = OpTypeVoid +%10 = OpTypeFunction %void +%main = OpFunction %void None %10 +%14 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(text, expected_output, + /* skip_nop = */ true); +} + +#ifdef SPIRV_EFFCEE +TEST_F(AggressiveDCETest, BasicAllDeadConstants) { + const std::string text = R"( + ; CHECK-NOT: OpConstant + OpCapability Shader + OpCapability Float64 + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" + OpName %main "main" + %void = OpTypeVoid + %4 = OpTypeFunction %void + %bool = OpTypeBool + %true = OpConstantTrue %bool + %false = OpConstantFalse %bool + %int = OpTypeInt 32 1 + %9 = OpConstant %int 1 + %uint = OpTypeInt 32 0 + %11 = OpConstant %uint 2 + %float = OpTypeFloat 32 + %13 = OpConstant %float 3.1415 + %double = OpTypeFloat 64 + %15 = OpConstant %double 3.14159265358979 + %main = OpFunction %void None %4 + %16 = OpLabel + OpReturn + OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} +#endif // SPIRV_EFFCEE + +TEST_F(AggressiveDCETest, BasicNoneDeadConstants) { + const std::vector text = { + // clang-format off + "OpCapability Shader", + "OpCapability Float64", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Vertex %main \"main\" %btv %bfv %iv %uv %fv %dv", + "OpName %main \"main\"", + "OpName %btv \"btv\"", + "OpName %bfv \"bfv\"", + "OpName %iv \"iv\"", + "OpName %uv \"uv\"", + "OpName %fv \"fv\"", + "OpName %dv \"dv\"", + "%void = OpTypeVoid", + "%10 = OpTypeFunction %void", + "%bool = OpTypeBool", + "%_ptr_Output_bool = OpTypePointer Output %bool", + "%true = OpConstantTrue %bool", + "%false = OpConstantFalse %bool", + "%int = OpTypeInt 32 1", + "%_ptr_Output_int = OpTypePointer Output %int", + "%int_1 = OpConstant %int 1", + "%uint = OpTypeInt 32 0", + "%_ptr_Output_uint = OpTypePointer Output %uint", + "%uint_2 = OpConstant %uint 2", + "%float = OpTypeFloat 32", + "%_ptr_Output_float = OpTypePointer Output %float", + "%float_3_1415 = OpConstant %float 3.1415", + "%double = OpTypeFloat 64", + "%_ptr_Output_double = OpTypePointer Output %double", + "%double_3_14159265358979 = OpConstant %double 3.14159265358979", + "%btv = OpVariable %_ptr_Output_bool Output", + "%bfv = OpVariable %_ptr_Output_bool Output", + "%iv = OpVariable %_ptr_Output_int Output", + "%uv = OpVariable %_ptr_Output_uint Output", + "%fv = OpVariable %_ptr_Output_float Output", + "%dv = OpVariable %_ptr_Output_double Output", + "%main = OpFunction %void None %10", + "%27 = OpLabel", + "OpStore %btv %true", + "OpStore %bfv %false", + "OpStore %iv %int_1", + "OpStore %uv %uint_2", + "OpStore %fv %float_3_1415", + "OpStore %dv %double_3_14159265358979", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + // All constants are used, so none of them should be eliminated. + SinglePassRunAndCheck( + JoinAllInsts(text), JoinAllInsts(text), /* skip_nop = */ true); +} + +struct EliminateDeadConstantTestCase { + // Type declarations and constants that should be kept. + std::vector used_consts; + // Instructions that refer to constants, this is added to create uses for + // some constants so they won't be treated as dead constants. + std::vector main_insts; + // Dead constants that should be removed. + std::vector dead_consts; + // Expectations + std::vector checks; +}; + +// All types that are potentially required in EliminateDeadConstantTest. +const std::vector CommonTypes = { + // clang-format off + // scalar types + "%bool = OpTypeBool", + "%uint = OpTypeInt 32 0", + "%int = OpTypeInt 32 1", + "%float = OpTypeFloat 32", + "%double = OpTypeFloat 64", + // vector types + "%v2bool = OpTypeVector %bool 2", + "%v2uint = OpTypeVector %uint 2", + "%v2int = OpTypeVector %int 2", + "%v3int = OpTypeVector %int 3", + "%v4int = OpTypeVector %int 4", + "%v2float = OpTypeVector %float 2", + "%v3float = OpTypeVector %float 3", + "%v2double = OpTypeVector %double 2", + // variable pointer types + "%_pf_bool = OpTypePointer Output %bool", + "%_pf_uint = OpTypePointer Output %uint", + "%_pf_int = OpTypePointer Output %int", + "%_pf_float = OpTypePointer Output %float", + "%_pf_double = OpTypePointer Output %double", + "%_pf_v2int = OpTypePointer Output %v2int", + "%_pf_v3int = OpTypePointer Output %v3int", + "%_pf_v2float = OpTypePointer Output %v2float", + "%_pf_v3float = OpTypePointer Output %v3float", + "%_pf_v2double = OpTypePointer Output %v2double", + // struct types + "%inner_struct = OpTypeStruct %bool %int %float %double", + "%outer_struct = OpTypeStruct %inner_struct %int %double", + "%flat_struct = OpTypeStruct %bool %int %float %double", + // clang-format on +}; + +using EliminateDeadConstantTest = + PassTest<::testing::TestWithParam>; + +#ifdef SPIRV_EFFCEE +TEST_P(EliminateDeadConstantTest, Custom) { + auto& tc = GetParam(); + AssemblyBuilder builder; + builder.AppendTypesConstantsGlobals(CommonTypes) + .AppendTypesConstantsGlobals(tc.used_consts) + .AppendInMain(tc.main_insts); + const std::string expected = builder.GetCode(); + builder.AppendTypesConstantsGlobals(tc.dead_consts); + builder.PrependPreamble(tc.checks); + const std::string assembly_with_dead_const = builder.GetCode(); + + // Do not enable validation. As the input code is invalid from the base + // tests (ported from other passes). + SinglePassRunAndMatch(assembly_with_dead_const, + false); +} + +INSTANTIATE_TEST_CASE_P( + ScalarTypeConstants, EliminateDeadConstantTest, + ::testing::ValuesIn(std::vector({ + // clang-format off + // Scalar type constants, one dead constant and one used constant. + { + /* .used_consts = */ + { + "%used_const_int = OpConstant %int 1", + }, + /* .main_insts = */ + { + "%int_var = OpVariable %_pf_int Output", + "OpStore %int_var %used_const_int", + }, + /* .dead_consts = */ + { + "%dead_const_int = OpConstant %int 1", + }, + /* .checks = */ + { + "; CHECK: [[const:%\\w+]] = OpConstant %int 1", + "; CHECK-NOT: OpConstant", + "; CHECK: OpStore {{%\\w+}} [[const]]", + }, + }, + { + /* .used_consts = */ + { + "%used_const_uint = OpConstant %uint 1", + }, + /* .main_insts = */ + { + "%uint_var = OpVariable %_pf_uint Output", + "OpStore %uint_var %used_const_uint", + }, + /* .dead_consts = */ + { + "%dead_const_uint = OpConstant %uint 1", + }, + /* .checks = */ + { + "; CHECK: [[const:%\\w+]] = OpConstant %uint 1", + "; CHECK-NOT: OpConstant", + "; CHECK: OpStore {{%\\w+}} [[const]]", + }, + }, + { + /* .used_consts = */ + { + "%used_const_float = OpConstant %float 3.1415", + }, + /* .main_insts = */ + { + "%float_var = OpVariable %_pf_float Output", + "OpStore %float_var %used_const_float", + }, + /* .dead_consts = */ + { + "%dead_const_float = OpConstant %float 3.1415", + }, + /* .checks = */ + { + "; CHECK: [[const:%\\w+]] = OpConstant %float 3.1415", + "; CHECK-NOT: OpConstant", + "; CHECK: OpStore {{%\\w+}} [[const]]", + }, + }, + { + /* .used_consts = */ + { + "%used_const_double = OpConstant %double 3.14", + }, + /* .main_insts = */ + { + "%double_var = OpVariable %_pf_double Output", + "OpStore %double_var %used_const_double", + }, + /* .dead_consts = */ + { + "%dead_const_double = OpConstant %double 3.14", + }, + /* .checks = */ + { + "; CHECK: [[const:%\\w+]] = OpConstant %double 3.14", + "; CHECK-NOT: OpConstant", + "; CHECK: OpStore {{%\\w+}} [[const]]", + }, + }, + // clang-format on + }))); + +INSTANTIATE_TEST_CASE_P( + VectorTypeConstants, EliminateDeadConstantTest, + ::testing::ValuesIn(std::vector({ + // clang-format off + // Tests eliminating dead constant type ivec2. One dead constant vector + // and one used constant vector, each built from its own group of + // scalar constants. + { + /* .used_consts = */ + { + "%used_int_x = OpConstant %int 1", + "%used_int_y = OpConstant %int 2", + "%used_v2int = OpConstantComposite %v2int %used_int_x %used_int_y", + }, + /* .main_insts = */ + { + "%v2int_var = OpVariable %_pf_v2int Output", + "OpStore %v2int_var %used_v2int", + }, + /* .dead_consts = */ + { + "%dead_int_x = OpConstant %int 1", + "%dead_int_y = OpConstant %int 2", + "%dead_v2int = OpConstantComposite %v2int %dead_int_x %dead_int_y", + }, + /* .checks = */ + { + "; CHECK: [[constx:%\\w+]] = OpConstant %int 1", + "; CHECK: [[consty:%\\w+]] = OpConstant %int 2", + "; CHECK: [[const:%\\w+]] = OpConstantComposite %v2int [[constx]] [[consty]]", + "; CHECK-NOT: OpConstant", + "; CHECK: OpStore {{%\\w+}} [[const]]", + }, + }, + // Tests eliminating dead constant ivec3. One dead constant vector and + // one used constant vector. But both built from a same group of + // scalar constants. + { + /* .used_consts = */ + { + "%used_int_x = OpConstant %int 1", + "%used_int_y = OpConstant %int 2", + "%used_int_z = OpConstant %int 3", + "%used_v3int = OpConstantComposite %v3int %used_int_x %used_int_y %used_int_z", + }, + /* .main_insts = */ + { + "%v3int_var = OpVariable %_pf_v3int Output", + "OpStore %v3int_var %used_v3int", + }, + /* .dead_consts = */ + { + "%dead_v3int = OpConstantComposite %v3int %used_int_x %used_int_y %used_int_z", + }, + /* .checks = */ + { + "; CHECK: [[constx:%\\w+]] = OpConstant %int 1", + "; CHECK: [[consty:%\\w+]] = OpConstant %int 2", + "; CHECK: [[constz:%\\w+]] = OpConstant %int 3", + "; CHECK: [[const:%\\w+]] = OpConstantComposite %v3int [[constx]] [[consty]] [[constz]]", + "; CHECK-NOT: OpConstant", + "; CHECK: OpStore {{%\\w+}} [[const]]", + }, + }, + // Tests eliminating dead constant vec2. One dead constant vector and + // one used constant vector. Each built from its own group of scalar + // constants. + { + /* .used_consts = */ + { + "%used_float_x = OpConstant %float 3.1415", + "%used_float_y = OpConstant %float 4.13", + "%used_v2float = OpConstantComposite %v2float %used_float_x %used_float_y", + }, + /* .main_insts = */ + { + "%v2float_var = OpVariable %_pf_v2float Output", + "OpStore %v2float_var %used_v2float", + }, + /* .dead_consts = */ + { + "%dead_float_x = OpConstant %float 3.1415", + "%dead_float_y = OpConstant %float 4.13", + "%dead_v2float = OpConstantComposite %v2float %dead_float_x %dead_float_y", + }, + /* .checks = */ + { + "; CHECK: [[constx:%\\w+]] = OpConstant %float 3.1415", + "; CHECK: [[consty:%\\w+]] = OpConstant %float 4.13", + "; CHECK: [[const:%\\w+]] = OpConstantComposite %v2float [[constx]] [[consty]]", + "; CHECK-NOT: OpConstant", + "; CHECK: OpStore {{%\\w+}} [[const]]", + }, + }, + // Tests eliminating dead constant vec3. One dead constant vector and + // one used constant vector. Both built from a same group of scalar + // constants. + { + /* .used_consts = */ + { + "%used_float_x = OpConstant %float 3.1415", + "%used_float_y = OpConstant %float 4.25", + "%used_float_z = OpConstant %float 4.75", + "%used_v3float = OpConstantComposite %v3float %used_float_x %used_float_y %used_float_z", + }, + /* .main_insts = */ + { + "%v3float_var = OpVariable %_pf_v3float Output", + "OpStore %v3float_var %used_v3float", + }, + /* .dead_consts = */ + { + "%dead_v3float = OpConstantComposite %v3float %used_float_x %used_float_y %used_float_z", + }, + /* .checks = */ + { + "; CHECK: [[constx:%\\w+]] = OpConstant %float 3.1415", + "; CHECK: [[consty:%\\w+]] = OpConstant %float 4.25", + "; CHECK: [[constz:%\\w+]] = OpConstant %float 4.75", + "; CHECK: [[const:%\\w+]] = OpConstantComposite %v3float [[constx]] [[consty]]", + "; CHECK-NOT: OpConstant", + "; CHECK: OpStore {{%\\w+}} [[const]]", + }, + }, + // clang-format on + }))); + +INSTANTIATE_TEST_CASE_P( + StructTypeConstants, EliminateDeadConstantTest, + ::testing::ValuesIn(std::vector({ + // clang-format off + // A plain struct type dead constants. All of its components are dead + // constants too. + { + /* .used_consts = */ {}, + /* .main_insts = */ {}, + /* .dead_consts = */ + { + "%dead_bool = OpConstantTrue %bool", + "%dead_int = OpConstant %int 1", + "%dead_float = OpConstant %float 2.5", + "%dead_double = OpConstant %double 3.14159265358979", + "%dead_struct = OpConstantComposite %flat_struct %dead_bool %dead_int %dead_float %dead_double", + }, + /* .checks = */ + { + "; CHECK-NOT: OpConstant", + }, + }, + // A plain struct type dead constants. Some of its components are dead + // constants while others are not. + { + /* .used_consts = */ + { + "%used_int = OpConstant %int 1", + "%used_double = OpConstant %double 3.14159265358979", + }, + /* .main_insts = */ + { + "%int_var = OpVariable %_pf_int Output", + "OpStore %int_var %used_int", + "%double_var = OpVariable %_pf_double Output", + "OpStore %double_var %used_double", + }, + /* .dead_consts = */ + { + "%dead_bool = OpConstantTrue %bool", + "%dead_float = OpConstant %float 2.5", + "%dead_struct = OpConstantComposite %flat_struct %dead_bool %used_int %dead_float %used_double", + }, + /* .checks = */ + { + "; CHECK: [[int:%\\w+]] = OpConstant %int 1", + "; CHECK: [[double:%\\w+]] = OpConstant %double 3.14159265358979", + "; CHECK-NOT: OpConstant", + "; CHECK: OpStore {{%\\w+}} [[int]]", + "; CHECK: OpStore {{%\\w+}} [[double]]", + }, + }, + // A nesting struct type dead constants. All components of both outer + // and inner structs are dead and should be removed after dead constant + // elimination. + { + /* .used_consts = */ {}, + /* .main_insts = */ {}, + /* .dead_consts = */ + { + "%dead_bool = OpConstantTrue %bool", + "%dead_int = OpConstant %int 1", + "%dead_float = OpConstant %float 2.5", + "%dead_double = OpConstant %double 3.1415926535", + "%dead_inner_struct = OpConstantComposite %inner_struct %dead_bool %dead_int %dead_float %dead_double", + "%dead_int2 = OpConstant %int 2", + "%dead_double2 = OpConstant %double 1.428571428514", + "%dead_outer_struct = OpConstantComposite %outer_struct %dead_inner_struct %dead_int2 %dead_double2", + }, + /* .checks = */ + { + "; CHECK-NOT: OpConstant", + }, + }, + // A nesting struct type dead constants. Some of its components are + // dead constants while others are not. + { + /* .used_consts = */ + { + "%used_int = OpConstant %int 1", + "%used_double = OpConstant %double 3.14159265358979", + }, + /* .main_insts = */ + { + "%int_var = OpVariable %_pf_int Output", + "OpStore %int_var %used_int", + "%double_var = OpVariable %_pf_double Output", + "OpStore %double_var %used_double", + }, + /* .dead_consts = */ + { + "%dead_bool = OpConstantTrue %bool", + "%dead_float = OpConstant %float 2.5", + "%dead_inner_struct = OpConstantComposite %inner_struct %dead_bool %used_int %dead_float %used_double", + "%dead_int = OpConstant %int 2", + "%dead_outer_struct = OpConstantComposite %outer_struct %dead_inner_struct %dead_int %used_double", + }, + /* .checks = */ + { + "; CHECK: [[int:%\\w+]] = OpConstant %int 1", + "; CHECK: [[double:%\\w+]] = OpConstant %double 3.14159265358979", + "; CHECK-NOT: OpConstant", + "; CHECK: OpStore {{%\\w+}} [[int]]", + "; CHECK: OpStore {{%\\w+}} [[double]]", + }, + }, + // A nesting struct case. The inner struct is used while the outer struct is not + { + /* .used_const = */ + { + "%used_bool = OpConstantTrue %bool", + "%used_int = OpConstant %int 1", + "%used_float = OpConstant %float 1.23", + "%used_double = OpConstant %double 1.2345678901234", + "%used_inner_struct = OpConstantComposite %inner_struct %used_bool %used_int %used_float %used_double", + }, + /* .main_insts = */ + { + "%bool_var = OpVariable %_pf_bool Output", + "%bool_from_inner_struct = OpCompositeExtract %bool %used_inner_struct 0", + "OpStore %bool_var %bool_from_inner_struct", + }, + /* .dead_consts = */ + { + "%dead_int = OpConstant %int 2", + "%dead_outer_struct = OpConstantComposite %outer_struct %used_inner_struct %dead_int %used_double" + }, + /* .checks = */ + { + "; CHECK: [[bool:%\\w+]] = OpConstantTrue", + "; CHECK: [[int:%\\w+]] = OpConstant %int 1", + "; CHECK: [[float:%\\w+]] = OpConstant %float 1.23", + "; CHECK: [[double:%\\w+]] = OpConstant %double 1.2345678901234", + "; CHECK: [[struct:%\\w+]] = OpConstantComposite %inner_struct [[bool]] [[int]] [[float]] [[double]]", + "; CHECK-NOT: OpConstant", + "; CHECK: OpCompositeExtract %bool [[struct]]", + } + }, + // A nesting struct case. The outer struct is used, so the inner struct should not + // be removed even though it is not used anywhere. + { + /* .used_const = */ + { + "%used_bool = OpConstantTrue %bool", + "%used_int = OpConstant %int 1", + "%used_float = OpConstant %float 1.23", + "%used_double = OpConstant %double 1.2345678901234", + "%used_inner_struct = OpConstantComposite %inner_struct %used_bool %used_int %used_float %used_double", + "%used_outer_struct = OpConstantComposite %outer_struct %used_inner_struct %used_int %used_double" + }, + /* .main_insts = */ + { + "%int_var = OpVariable %_pf_int Output", + "%int_from_outer_struct = OpCompositeExtract %int %used_outer_struct 1", + "OpStore %int_var %int_from_outer_struct", + }, + /* .dead_consts = */ {}, + /* .checks = */ + { + "; CHECK: [[bool:%\\w+]] = OpConstantTrue %bool", + "; CHECK: [[int:%\\w+]] = OpConstant %int 1", + "; CHECK: [[float:%\\w+]] = OpConstant %float 1.23", + "; CHECK: [[double:%\\w+]] = OpConstant %double 1.2345678901234", + "; CHECK: [[inner_struct:%\\w+]] = OpConstantComposite %inner_struct %used_bool %used_int %used_float %used_double", + "; CHECK: [[outer_struct:%\\w+]] = OpConstantComposite %outer_struct %used_inner_struct %used_int %used_double", + "; CHECK: OpCompositeExtract %int [[outer_struct]]", + }, + }, + // clang-format on + }))); + +INSTANTIATE_TEST_CASE_P( + ScalarTypeSpecConstants, EliminateDeadConstantTest, + ::testing::ValuesIn(std::vector({ + // clang-format off + // All scalar type spec constants. + { + /* .used_consts = */ + { + "%used_bool = OpSpecConstantTrue %bool", + "%used_uint = OpSpecConstant %uint 2", + "%used_int = OpSpecConstant %int 2", + "%used_float = OpSpecConstant %float 2.5", + "%used_double = OpSpecConstant %double 1.428571428514", + }, + /* .main_insts = */ + { + "%bool_var = OpVariable %_pf_bool Output", + "%uint_var = OpVariable %_pf_uint Output", + "%int_var = OpVariable %_pf_int Output", + "%float_var = OpVariable %_pf_float Output", + "%double_var = OpVariable %_pf_double Output", + "OpStore %bool_var %used_bool", + "OpStore %uint_var %used_uint", + "OpStore %int_var %used_int", + "OpStore %float_var %used_float", + "OpStore %double_var %used_double", + }, + /* .dead_consts = */ + { + "%dead_bool = OpSpecConstantTrue %bool", + "%dead_uint = OpSpecConstant %uint 2", + "%dead_int = OpSpecConstant %int 2", + "%dead_float = OpSpecConstant %float 2.5", + "%dead_double = OpSpecConstant %double 1.428571428514", + }, + /* .checks = */ + { + "; CHECK: [[bool:%\\w+]] = OpSpecConstantTrue %bool", + "; CHECK: [[uint:%\\w+]] = OpSpecConstant %uint 2", + "; CHECK: [[int:%\\w+]] = OpSpecConstant %int 2", + "; CHECK: [[float:%\\w+]] = OpSpecConstant %float 2.5", + "; CHECK: [[double:%\\w+]] = OpSpecConstant %double 1.428571428514", + "; CHECK-NOT: OpSpecConstant", + "; CHECK: OpStore {{%\\w+}} [[bool]]", + "; CHECK: OpStore {{%\\w+}} [[uint]]", + "; CHECK: OpStore {{%\\w+}} [[int]]", + "; CHECK: OpStore {{%\\w+}} [[float]]", + "; CHECK: OpStore {{%\\w+}} [[double]]", + }, + }, + // clang-format on + }))); + +INSTANTIATE_TEST_CASE_P( + VectorTypeSpecConstants, EliminateDeadConstantTest, + ::testing::ValuesIn(std::vector({ + // clang-format off + // Bool vector type spec constants. One vector has all component dead, + // another vector has one dead boolean and one used boolean. + { + /* .used_consts = */ + { + "%used_bool = OpSpecConstantTrue %bool", + }, + /* .main_insts = */ + { + "%bool_var = OpVariable %_pf_bool Output", + "OpStore %bool_var %used_bool", + }, + /* .dead_consts = */ + { + "%dead_bool = OpSpecConstantFalse %bool", + "%dead_bool_vec1 = OpSpecConstantComposite %v2bool %dead_bool %dead_bool", + "%dead_bool_vec2 = OpSpecConstantComposite %v2bool %dead_bool %used_bool", + }, + /* .checks = */ + { + "; CHECK: [[bool:%\\w+]] = OpSpecConstantTrue %bool", + "; CHECK-NOT: OpSpecConstant", + "; CHECK: OpStore {{%\\w+}} [[bool]]", + }, + }, + + // Uint vector type spec constants. One vector has all component dead, + // another vector has one dead unsigend integer and one used unsigned + // integer. + { + /* .used_consts = */ + { + "%used_uint = OpSpecConstant %uint 3", + }, + /* .main_insts = */ + { + "%uint_var = OpVariable %_pf_uint Output", + "OpStore %uint_var %used_uint", + }, + /* .dead_consts = */ + { + "%dead_uint = OpSpecConstant %uint 1", + "%dead_uint_vec1 = OpSpecConstantComposite %v2uint %dead_uint %dead_uint", + "%dead_uint_vec2 = OpSpecConstantComposite %v2uint %dead_uint %used_uint", + }, + /* .checks = */ + { + "; CHECK: [[uint:%\\w+]] = OpSpecConstant %uint 3", + "; CHECK-NOT: OpSpecConstant", + "; CHECK: OpStore {{%\\w+}} [[uint]]", + }, + }, + + // Int vector type spec constants. One vector has all component dead, + // another vector has one dead integer and one used integer. + { + /* .used_consts = */ + { + "%used_int = OpSpecConstant %int 3", + }, + /* .main_insts = */ + { + "%int_var = OpVariable %_pf_int Output", + "OpStore %int_var %used_int", + }, + /* .dead_consts = */ + { + "%dead_int = OpSpecConstant %int 1", + "%dead_int_vec1 = OpSpecConstantComposite %v2int %dead_int %dead_int", + "%dead_int_vec2 = OpSpecConstantComposite %v2int %dead_int %used_int", + }, + /* .checks = */ + { + "; CHECK: [[int:%\\w+]] = OpSpecConstant %int 3", + "; CHECK-NOT: OpSpecConstant", + "; CHECK: OpStore {{%\\w+}} [[int]]", + }, + }, + + // Int vector type spec constants built with both spec constants and + // front-end constants. + { + /* .used_consts = */ + { + "%used_spec_int = OpSpecConstant %int 3", + "%used_front_end_int = OpConstant %int 3", + }, + /* .main_insts = */ + { + "%int_var1 = OpVariable %_pf_int Output", + "OpStore %int_var1 %used_spec_int", + "%int_var2 = OpVariable %_pf_int Output", + "OpStore %int_var2 %used_front_end_int", + }, + /* .dead_consts = */ + { + "%dead_spec_int = OpSpecConstant %int 1", + "%dead_front_end_int = OpConstant %int 1", + // Dead front-end and dead spec constants + "%dead_int_vec1 = OpSpecConstantComposite %v2int %dead_spec_int %dead_front_end_int", + // Used front-end and dead spec constants + "%dead_int_vec2 = OpSpecConstantComposite %v2int %dead_spec_int %used_front_end_int", + // Dead front-end and used spec constants + "%dead_int_vec3 = OpSpecConstantComposite %v2int %dead_front_end_int %used_spec_int", + }, + /* .checks = */ + { + "; CHECK: [[int1:%\\w+]] = OpSpecConstant %int 3", + "; CHECK: [[int2:%\\w+]] = OpConstant %int 3", + "; CHECK-NOT: OpSpecConstant", + "; CHECK-NOT: OpConstant", + "; CHECK: OpStore {{%\\w+}} [[int1]]", + "; CHECK: OpStore {{%\\w+}} [[int2]]", + }, + }, + // clang-format on + }))); + +INSTANTIATE_TEST_CASE_P( + SpecConstantOp, EliminateDeadConstantTest, + ::testing::ValuesIn(std::vector({ + // clang-format off + // Cast operations: uint <-> int <-> bool + { + /* .used_consts = */ {}, + /* .main_insts = */ {}, + /* .dead_consts = */ + { + // Assistant constants, only used in dead spec constant + // operations. + "%signed_zero = OpConstant %int 0", + "%signed_zero_vec = OpConstantComposite %v2int %signed_zero %signed_zero", + "%unsigned_zero = OpConstant %uint 0", + "%unsigned_zero_vec = OpConstantComposite %v2uint %unsigned_zero %unsigned_zero", + "%signed_one = OpConstant %int 1", + "%signed_one_vec = OpConstantComposite %v2int %signed_one %signed_one", + "%unsigned_one = OpConstant %uint 1", + "%unsigned_one_vec = OpConstantComposite %v2uint %unsigned_one %unsigned_one", + + // Spec constants that support casting to each other. + "%dead_bool = OpSpecConstantTrue %bool", + "%dead_uint = OpSpecConstant %uint 1", + "%dead_int = OpSpecConstant %int 2", + "%dead_bool_vec = OpSpecConstantComposite %v2bool %dead_bool %dead_bool", + "%dead_uint_vec = OpSpecConstantComposite %v2uint %dead_uint %dead_uint", + "%dead_int_vec = OpSpecConstantComposite %v2int %dead_int %dead_int", + + // Scalar cast to boolean spec constant. + "%int_to_bool = OpSpecConstantOp %bool INotEqual %dead_int %signed_zero", + "%uint_to_bool = OpSpecConstantOp %bool INotEqual %dead_uint %unsigned_zero", + + // Vector cast to boolean spec constant. + "%int_to_bool_vec = OpSpecConstantOp %v2bool INotEqual %dead_int_vec %signed_zero_vec", + "%uint_to_bool_vec = OpSpecConstantOp %v2bool INotEqual %dead_uint_vec %unsigned_zero_vec", + + // Scalar cast to int spec constant. + "%bool_to_int = OpSpecConstantOp %int Select %dead_bool %signed_one %signed_zero", + "%uint_to_int = OpSpecConstantOp %uint IAdd %dead_uint %unsigned_zero", + + // Vector cast to int spec constant. + "%bool_to_int_vec = OpSpecConstantOp %v2int Select %dead_bool_vec %signed_one_vec %signed_zero_vec", + "%uint_to_int_vec = OpSpecConstantOp %v2uint IAdd %dead_uint_vec %unsigned_zero_vec", + + // Scalar cast to uint spec constant. + "%bool_to_uint = OpSpecConstantOp %uint Select %dead_bool %unsigned_one %unsigned_zero", + "%int_to_uint_vec = OpSpecConstantOp %uint IAdd %dead_int %signed_zero", + + // Vector cast to uint spec constant. + "%bool_to_uint_vec = OpSpecConstantOp %v2uint Select %dead_bool_vec %unsigned_one_vec %unsigned_zero_vec", + "%int_to_uint = OpSpecConstantOp %v2uint IAdd %dead_int_vec %signed_zero_vec", + }, + /* .checks = */ + { + "; CHECK-NOT: OpConstant", + "; CHECK-NOT: OpSpecConstant", + }, + }, + + // Add, sub, mul, div, rem. + { + /* .used_consts = */ {}, + /* .main_insts = */ {}, + /* .dead_consts = */ + { + "%dead_spec_int_a = OpSpecConstant %int 1", + "%dead_spec_int_a_vec = OpSpecConstantComposite %v2int %dead_spec_int_a %dead_spec_int_a", + + "%dead_spec_int_b = OpSpecConstant %int 2", + "%dead_spec_int_b_vec = OpSpecConstantComposite %v2int %dead_spec_int_b %dead_spec_int_b", + + "%dead_const_int_c = OpConstant %int 3", + "%dead_const_int_c_vec = OpConstantComposite %v2int %dead_const_int_c %dead_const_int_c", + + // Add + "%add_a_b = OpSpecConstantOp %int IAdd %dead_spec_int_a %dead_spec_int_b", + "%add_a_b_vec = OpSpecConstantOp %v2int IAdd %dead_spec_int_a_vec %dead_spec_int_b_vec", + + // Sub + "%sub_a_b = OpSpecConstantOp %int ISub %dead_spec_int_a %dead_spec_int_b", + "%sub_a_b_vec = OpSpecConstantOp %v2int ISub %dead_spec_int_a_vec %dead_spec_int_b_vec", + + // Mul + "%mul_a_b = OpSpecConstantOp %int IMul %dead_spec_int_a %dead_spec_int_b", + "%mul_a_b_vec = OpSpecConstantOp %v2int IMul %dead_spec_int_a_vec %dead_spec_int_b_vec", + + // Div + "%div_a_b = OpSpecConstantOp %int SDiv %dead_spec_int_a %dead_spec_int_b", + "%div_a_b_vec = OpSpecConstantOp %v2int SDiv %dead_spec_int_a_vec %dead_spec_int_b_vec", + + // Bitwise Xor + "%xor_a_b = OpSpecConstantOp %int BitwiseXor %dead_spec_int_a %dead_spec_int_b", + "%xor_a_b_vec = OpSpecConstantOp %v2int BitwiseXor %dead_spec_int_a_vec %dead_spec_int_b_vec", + + // Scalar Comparison + "%less_a_b = OpSpecConstantOp %bool SLessThan %dead_spec_int_a %dead_spec_int_b", + }, + /* .checks = */ + { + "; CHECK-NOT: OpConstant", + "; CHECK-NOT: OpSpecConstant", + }, + }, + + // Vectors without used swizzles should be removed. + { + /* .used_consts = */ + { + "%used_int = OpConstant %int 3", + }, + /* .main_insts = */ + { + "%int_var = OpVariable %_pf_int Output", + "OpStore %int_var %used_int", + }, + /* .dead_consts = */ + { + "%dead_int = OpConstant %int 3", + + "%dead_spec_int_a = OpSpecConstant %int 1", + "%vec_a = OpSpecConstantComposite %v4int %dead_spec_int_a %dead_spec_int_a %dead_int %dead_int", + + "%dead_spec_int_b = OpSpecConstant %int 2", + "%vec_b = OpSpecConstantComposite %v4int %dead_spec_int_b %dead_spec_int_b %used_int %used_int", + + // Extract scalar + "%a_x = OpSpecConstantOp %int CompositeExtract %vec_a 0", + "%b_x = OpSpecConstantOp %int CompositeExtract %vec_b 0", + + // Extract vector + "%a_xy = OpSpecConstantOp %v2int VectorShuffle %vec_a %vec_a 0 1", + "%b_xy = OpSpecConstantOp %v2int VectorShuffle %vec_b %vec_b 0 1", + }, + /* .checks = */ + { + "; CHECK: [[int:%\\w+]] = OpConstant %int 3", + "; CHECK-NOT: OpConstant", + "; CHECK-NOT: OpSpecConstant", + "; CHECK: OpStore {{%\\w+}} [[int]]", + }, + }, + // Vectors with used swizzles should not be removed. + { + /* .used_consts = */ + { + "%used_int = OpConstant %int 3", + "%used_spec_int_a = OpSpecConstant %int 1", + "%used_spec_int_b = OpSpecConstant %int 2", + // Create vectors + "%vec_a = OpSpecConstantComposite %v4int %used_spec_int_a %used_spec_int_a %used_int %used_int", + "%vec_b = OpSpecConstantComposite %v4int %used_spec_int_b %used_spec_int_b %used_int %used_int", + // Extract vector + "%a_xy = OpSpecConstantOp %v2int VectorShuffle %vec_a %vec_a 0 1", + "%b_xy = OpSpecConstantOp %v2int VectorShuffle %vec_b %vec_b 0 1", + }, + /* .main_insts = */ + { + "%v2int_var_a = OpVariable %_pf_v2int Output", + "%v2int_var_b = OpVariable %_pf_v2int Output", + "OpStore %v2int_var_a %a_xy", + "OpStore %v2int_var_b %b_xy", + }, + /* .dead_consts = */ {}, + /* .checks = */ + { + "; CHECK: [[int:%\\w+]] = OpConstant %int 3", + "; CHECK: [[a:%\\w+]] = OpSpecConstant %int 1", + "; CHECK: [[b:%\\w+]] = OpSpecConstant %int 2", + "; CHECK: [[veca:%\\w+]] = OpSpecConstantComposite %v4int [[a]] [[a]] [[int]] [[int]]", + "; CHECK: [[vecb:%\\w+]] = OpSpecConstantComposite %v4int [[b]] [[b]] [[int]] [[int]]", + "; CHECK: [[exa:%\\w+]] = OpSpecConstantOp %v2int VectorShuffle [[veca]] [[veca]] 0 1", + "; CHECK: [[exb:%\\w+]] = OpSpecConstantOp %v2int VectorShuffle [[vecb]] [[vecb]] 0 1", + "; CHECK-NOT: OpConstant", + "; CHECK-NOT: OpSpecConstant", + "; CHECK: OpStore {{%\\w+}} [[exa]]", + "; CHECK: OpStore {{%\\w+}} [[exb]]", + }, + }, + // clang-format on + }))); + +INSTANTIATE_TEST_CASE_P( + LongDefUseChain, EliminateDeadConstantTest, + ::testing::ValuesIn(std::vector({ + // clang-format off + // Long Def-Use chain with binary operations. + { + /* .used_consts = */ + { + "%array_size = OpConstant %int 4", + "%type_arr_int_4 = OpTypeArray %int %array_size", + "%used_int_0 = OpConstant %int 100", + "%used_int_1 = OpConstant %int 1", + "%used_int_2 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_1", + "%used_int_3 = OpSpecConstantOp %int ISub %used_int_0 %used_int_2", + "%used_int_4 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_3", + "%used_int_5 = OpSpecConstantOp %int ISub %used_int_0 %used_int_4", + "%used_int_6 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_5", + "%used_int_7 = OpSpecConstantOp %int ISub %used_int_0 %used_int_6", + "%used_int_8 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_7", + "%used_int_9 = OpSpecConstantOp %int ISub %used_int_0 %used_int_8", + "%used_int_10 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_9", + "%used_int_11 = OpSpecConstantOp %int ISub %used_int_0 %used_int_10", + "%used_int_12 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_11", + "%used_int_13 = OpSpecConstantOp %int ISub %used_int_0 %used_int_12", + "%used_int_14 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_13", + "%used_int_15 = OpSpecConstantOp %int ISub %used_int_0 %used_int_14", + "%used_int_16 = OpSpecConstantOp %int ISub %used_int_0 %used_int_15", + "%used_int_17 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_16", + "%used_int_18 = OpSpecConstantOp %int ISub %used_int_0 %used_int_17", + "%used_int_19 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_18", + "%used_int_20 = OpSpecConstantOp %int ISub %used_int_0 %used_int_19", + "%used_vec_a = OpSpecConstantComposite %v2int %used_int_18 %used_int_19", + "%used_vec_b = OpSpecConstantOp %v2int IMul %used_vec_a %used_vec_a", + "%used_int_21 = OpSpecConstantOp %int CompositeExtract %used_vec_b 0", + "%used_array = OpConstantComposite %type_arr_int_4 %used_int_20 %used_int_20 %used_int_21 %used_int_21", + }, + /* .main_insts = */ + { + "%int_var = OpVariable %_pf_int Output", + "%used_array_2 = OpCompositeExtract %int %used_array 2", + "OpStore %int_var %used_array_2", + }, + /* .dead_consts = */ + { + "%dead_int_1 = OpConstant %int 2", + "%dead_int_2 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_1", + "%dead_int_3 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_2", + "%dead_int_4 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_3", + "%dead_int_5 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_4", + "%dead_int_6 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_5", + "%dead_int_7 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_6", + "%dead_int_8 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_7", + "%dead_int_9 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_8", + "%dead_int_10 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_9", + "%dead_int_11 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_10", + "%dead_int_12 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_11", + "%dead_int_13 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_12", + "%dead_int_14 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_13", + "%dead_int_15 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_14", + "%dead_int_16 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_15", + "%dead_int_17 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_16", + "%dead_int_18 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_17", + "%dead_int_19 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_18", + "%dead_int_20 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_19", + "%dead_vec_a = OpSpecConstantComposite %v2int %dead_int_18 %dead_int_19", + "%dead_vec_b = OpSpecConstantOp %v2int IMul %dead_vec_a %dead_vec_a", + "%dead_int_21 = OpSpecConstantOp %int CompositeExtract %dead_vec_b 0", + "%dead_array = OpConstantComposite %type_arr_int_4 %dead_int_20 %used_int_20 %dead_int_19 %used_int_19", + }, + /* .checks = */ + { + "; CHECK: OpConstant %int 4", + "; CHECK: [[array:%\\w+]] = OpConstantComposite %type_arr_int_4 %used_int_20 %used_int_20 %used_int_21 %used_int_21", + "; CHECK-NOT: OpConstant", + "; CHECK-NOT: OpSpecConstant", + "; CHECK: OpStore {{%\\w+}} [[array]]", + }, + }, + // Long Def-Use chain with swizzle + // clang-format on + }))); + +TEST_F(AggressiveDCETest, DeadDecorationGroup) { + // The decoration group should be eliminated because the target of group + // decorate is dead. + const std::string text = R"( +; CHECK-NOT: OpDecorat +; CHECK-NOT: OpGroupDecorate +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpDecorate %1 Restrict +OpDecorate %1 Aliased +%1 = OpDecorationGroup +OpGroupDecorate %1 %var +%void = OpTypeVoid +%func = OpTypeFunction %void +%uint = OpTypeInt 32 0 +%uint_ptr = OpTypePointer Function %uint +%main = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %uint_ptr Function +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(AggressiveDCETest, ParitallyDeadDecorationGroup) { + const std::string text = R"( +; CHECK: OpDecorate [[grp:%\w+]] Restrict +; CHECK: OpDecorate [[grp]] Aliased +; CHECK: [[grp]] = OpDecorationGroup +; CHECK: OpGroupDecorate [[grp]] [[output:%\w+]] +; CHECK: [[output]] = OpVariable {{%\w+}} Output +; CHECK-NOT: OpVariable {{%\w+}} Function +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %output +OpExecutionMode %main OriginUpperLeft +OpDecorate %1 Restrict +OpDecorate %1 Aliased +%1 = OpDecorationGroup +OpGroupDecorate %1 %var %output +%void = OpTypeVoid +%func = OpTypeFunction %void +%uint = OpTypeInt 32 0 +%uint_ptr_Function = OpTypePointer Function %uint +%uint_ptr_Output = OpTypePointer Output %uint +%uint_0 = OpConstant %uint 0 +%output = OpVariable %uint_ptr_Output Output +%main = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %uint_ptr_Function Function +OpStore %output %uint_0 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(AggressiveDCETest, ParitallyDeadDecorationGroupDifferentGroupDecorate) { + const std::string text = R"( +; CHECK: OpDecorate [[grp:%\w+]] Restrict +; CHECK: OpDecorate [[grp]] Aliased +; CHECK: [[grp]] = OpDecorationGroup +; CHECK: OpGroupDecorate [[grp]] [[output:%\w+]] +; CHECK-NOT: OpGroupDecorate +; CHECK: [[output]] = OpVariable {{%\w+}} Output +; CHECK-NOT: OpVariable {{%\w+}} Function +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %output +OpExecutionMode %main OriginUpperLeft +OpDecorate %1 Restrict +OpDecorate %1 Aliased +%1 = OpDecorationGroup +OpGroupDecorate %1 %output +OpGroupDecorate %1 %var +%void = OpTypeVoid +%func = OpTypeFunction %void +%uint = OpTypeInt 32 0 +%uint_ptr_Function = OpTypePointer Function %uint +%uint_ptr_Output = OpTypePointer Output %uint +%uint_0 = OpConstant %uint 0 +%output = OpVariable %uint_ptr_Output Output +%main = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %uint_ptr_Function Function +OpStore %output %uint_0 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(AggressiveDCETest, DeadGroupMemberDecorate) { + const std::string text = R"( +; CHECK-NOT: OpDec +; CHECK-NOT: OpGroup +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpDecorate %1 Offset 0 +OpDecorate %1 Uniform +%1 = OpDecorationGroup +OpGroupMemberDecorate %1 %var 0 +%void = OpTypeVoid +%func = OpTypeFunction %void +%uint = OpTypeInt 32 0 +%struct = OpTypeStruct %uint %uint +%struct_ptr = OpTypePointer Function %struct +%main = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %struct_ptr Function +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(AggressiveDCETest, PartiallyDeadGroupMemberDecorate) { + const std::string text = R"( +; CHECK: OpDecorate [[grp:%\w+]] Offset 0 +; CHECK: OpDecorate [[grp]] Uniform +; CHECK: [[grp]] = OpDecorationGroup +; CHECK: OpGroupMemberDecorate [[grp]] [[output:%\w+]] 1 +; CHECK: [[output]] = OpTypeStruct +; CHECK-NOT: OpTypeStruct +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %output +OpExecutionMode %main OriginUpperLeft +OpDecorate %1 Offset 0 +OpDecorate %1 Uniform +%1 = OpDecorationGroup +OpGroupMemberDecorate %1 %var_struct 0 %output_struct 1 +%void = OpTypeVoid +%func = OpTypeFunction %void +%uint = OpTypeInt 32 0 +%var_struct = OpTypeStruct %uint %uint +%output_struct = OpTypeStruct %uint %uint +%struct_ptr_Function = OpTypePointer Function %var_struct +%struct_ptr_Output = OpTypePointer Output %output_struct +%uint_ptr_Output = OpTypePointer Output %uint +%output = OpVariable %struct_ptr_Output Output +%uint_0 = OpConstant %uint 0 +%main = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %struct_ptr_Function Function +%3 = OpAccessChain %uint_ptr_Output %output %uint_0 +OpStore %3 %uint_0 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(AggressiveDCETest, + PartiallyDeadGroupMemberDecorateDifferentGroupDecorate) { + const std::string text = R"( +; CHECK: OpDecorate [[grp:%\w+]] Offset 0 +; CHECK: OpDecorate [[grp]] Uniform +; CHECK: [[grp]] = OpDecorationGroup +; CHECK: OpGroupMemberDecorate [[grp]] [[output:%\w+]] 1 +; CHECK-NOT: OpGroupMemberDecorate +; CHECK: [[output]] = OpTypeStruct +; CHECK-NOT: OpTypeStruct +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %output +OpExecutionMode %main OriginUpperLeft +OpDecorate %1 Offset 0 +OpDecorate %1 Uniform +%1 = OpDecorationGroup +OpGroupMemberDecorate %1 %var_struct 0 +OpGroupMemberDecorate %1 %output_struct 1 +%void = OpTypeVoid +%func = OpTypeFunction %void +%uint = OpTypeInt 32 0 +%var_struct = OpTypeStruct %uint %uint +%output_struct = OpTypeStruct %uint %uint +%struct_ptr_Function = OpTypePointer Function %var_struct +%struct_ptr_Output = OpTypePointer Output %output_struct +%uint_ptr_Output = OpTypePointer Output %uint +%output = OpVariable %struct_ptr_Output Output +%uint_0 = OpConstant %uint 0 +%main = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %struct_ptr_Function Function +%3 = OpAccessChain %uint_ptr_Output %output %uint_0 +OpStore %3 %uint_0 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +// Test for #1404 +TEST_F(AggressiveDCETest, DontRemoveWorkgroupSize) { + const std::string text = R"( +; CHECK: OpDecorate [[wgs:%\w+]] BuiltIn WorkgroupSize +; CHECK: [[wgs]] = OpSpecConstantComposite +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %func "func" +OpExecutionMode %func LocalSize 1 1 1 +OpDecorate %1 BuiltIn WorkgroupSize +%void = OpTypeVoid +%int = OpTypeInt 32 0 +%functy = OpTypeFunction %void +%v3int = OpTypeVector %int 3 +%2 = OpSpecConstant %int 1 +%1 = OpSpecConstantComposite %v3int %2 %2 %2 +%func = OpFunction %void None %functy +%3 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} +#endif // SPIRV_EFFCEE + +// Test for #1214 +TEST_F(AggressiveDCETest, LoopHeaderIsAlsoAnotherLoopMerge) { + const std::string text = R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %1 "func" %2 +OpExecutionMode %1 OriginUpperLeft +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%uint = OpTypeInt 32 0 +%_ptr_Output_uint = OpTypePointer Output %uint +%2 = OpVariable %_ptr_Output_uint Output +%uint_0 = OpConstant %uint 0 +%9 = OpTypeFunction %void +%1 = OpFunction %void None %9 +%10 = OpLabel +OpBranch %11 +%11 = OpLabel +OpLoopMerge %12 %13 None +OpBranchConditional %true %14 %13 +%14 = OpLabel +OpStore %2 %uint_0 +OpLoopMerge %15 %16 None +OpBranchConditional %true %15 %16 +%16 = OpLabel +OpBranch %14 +%15 = OpLabel +OpBranchConditional %true %12 %13 +%13 = OpLabel +OpBranch %11 +%12 = OpLabel +%17 = OpPhi %uint %uint_0 %15 %uint_0 %18 +OpStore %2 %17 +OpLoopMerge %19 %18 None +OpBranchConditional %true %19 %18 +%18 = OpLabel +OpBranch %12 +%19 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(text, text, true, true); +} + +TEST_F(AggressiveDCETest, BreaksDontVisitPhis) { + const std::string text = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" %var +OpExecutionMode %func OriginUpperLeft +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%int = OpTypeInt 32 0 +%int_ptr_Output = OpTypePointer Output %int +%var = OpVariable %int_ptr_Output Output +%int0 = OpConstant %int 0 +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%entry = OpLabel +OpBranch %outer_header +%outer_header = OpLabel +OpLoopMerge %outer_merge %outer_continue None +OpBranchConditional %true %inner_header %outer_continue +%inner_header = OpLabel +%phi = OpPhi %int %int0 %outer_header %int0 %inner_continue +OpStore %var %phi +OpLoopMerge %inner_merge %inner_continue None +OpBranchConditional %true %inner_merge %inner_continue +%inner_continue = OpLabel +OpBranch %inner_header +%inner_merge = OpLabel +OpBranch %outer_continue +%outer_continue = OpLabel +%p = OpPhi %int %int0 %outer_header %int0 %inner_merge +OpStore %var %p +OpBranch %outer_header +%outer_merge = OpLabel +OpReturn +OpFunctionEnd +)"; + + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, + std::get<1>(SinglePassRunAndDisassemble( + text, false, true))); +} + +// Test for #1212 +TEST_F(AggressiveDCETest, ConstStoreInnerLoop) { + const std::string text = R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %1 "main" %2 +%void = OpTypeVoid +%4 = OpTypeFunction %void +%float = OpTypeFloat 32 +%bool = OpTypeBool +%true = OpConstantTrue %bool +%_ptr_Output_float = OpTypePointer Output %float +%2 = OpVariable %_ptr_Output_float Output +%float_3 = OpConstant %float 3 +%1 = OpFunction %void None %4 +%13 = OpLabel +OpBranch %14 +%14 = OpLabel +OpLoopMerge %15 %16 None +OpBranchConditional %true %17 %15 +%17 = OpLabel +OpStore %2 %float_3 +OpLoopMerge %18 %17 None +OpBranchConditional %true %18 %17 +%18 = OpLabel +OpBranch %15 +%16 = OpLabel +OpBranch %14 +%15 = OpLabel +OpBranch %20 +%20 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(text, text, true, true); +} + +// Test for #1212 +TEST_F(AggressiveDCETest, InnerLoopCopy) { + const std::string text = R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %1 "main" %2 %3 +%void = OpTypeVoid +%5 = OpTypeFunction %void +%float = OpTypeFloat 32 +%bool = OpTypeBool +%true = OpConstantTrue %bool +%_ptr_Output_float = OpTypePointer Output %float +%_ptr_Input_float = OpTypePointer Input %float +%2 = OpVariable %_ptr_Output_float Output +%3 = OpVariable %_ptr_Input_float Input +%1 = OpFunction %void None %5 +%14 = OpLabel +OpBranch %15 +%15 = OpLabel +OpLoopMerge %16 %17 None +OpBranchConditional %true %18 %16 +%18 = OpLabel +%19 = OpLoad %float %3 +OpStore %2 %19 +OpLoopMerge %20 %18 None +OpBranchConditional %true %20 %18 +%20 = OpLabel +OpBranch %16 +%17 = OpLabel +OpBranch %15 +%16 = OpLabel +OpBranch %22 +%22 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(text, text, true, true); +} + +TEST_F(AggressiveDCETest, AtomicAdd) { + const std::string text = R"(OpCapability SampledBuffer +OpCapability StorageImageExtendedFormats +OpCapability ImageBuffer +OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %2 "min" %gl_GlobalInvocationID +OpExecutionMode %2 LocalSize 64 1 1 +OpSource HLSL 600 +OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId +OpDecorate %4 DescriptorSet 4 +OpDecorate %4 Binding 70 +%uint = OpTypeInt 32 0 +%6 = OpTypeImage %uint Buffer 0 0 0 2 R32ui +%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6 +%_ptr_Private_6 = OpTypePointer Private %6 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint +%_ptr_Image_uint = OpTypePointer Image %uint +%4 = OpVariable %_ptr_UniformConstant_6 UniformConstant +%16 = OpVariable %_ptr_Private_6 Private +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input +%2 = OpFunction %void None %10 +%17 = OpLabel +%18 = OpLoad %6 %4 +OpStore %16 %18 +%19 = OpImageTexelPointer %_ptr_Image_uint %16 %uint_0 %uint_0 +%20 = OpAtomicIAdd %uint %19 %uint_1 %uint_0 %uint_1 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(text, text, true, true); +} + +// TODO(greg-lunarg): Add tests to verify handling of these cases: +// +// Check that logical addressing required +// Check that function calls inhibit optimization +// Others? + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/assembly_builder.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/assembly_builder.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/assembly_builder.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/assembly_builder.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,264 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_TEST_OPT_ASSEMBLY_BUILDER +#define LIBSPIRV_TEST_OPT_ASSEMBLY_BUILDER + +#include +#include +#include +#include +#include +#include + +namespace spvtools { + +// A simple SPIR-V assembly code builder for test uses. It builds an SPIR-V +// assembly module from vectors of assembly strings. It allows users to add +// instructions to the main function and the type-constants-globals section +// directly. It relies on OpName instructions and friendly-name disassembling +// to keep the ID names unchanged after assembling. +// +// An assembly module is divided into several sections, matching with the +// SPIR-V Logical Layout: +// Global Preamble: +// OpCapability instructions; +// OpExtension instructions and OpExtInstImport instructions; +// OpMemoryModel instruction; +// OpEntryPoint and OpExecutionMode instruction; +// OpString, OpSourceExtension, OpSource and OpSourceContinued instructions. +// Names: +// OpName instructions. +// Annotations: +// OpDecorate, OpMemberDecorate, OpGroupDecorate, OpGroupMemberDecorate and +// OpDecorationGroup. +// Types, Constants and Global variables: +// Types, constants and global variables declaration instructions. +// Main Function: +// Main function instructions. +// Main Function Postamble: +// The return and function end instructions. +// +// The assembly code is built by concatenating all the strings in the above +// sections. +// +// Users define the contents in section +// and
. The section is to hold the names for IDs to +// keep them unchanged before and after assembling. All defined IDs to be added +// to this code builder will be assigned with a global name through OpName +// instruction. The name is extracted from the definition instruction. +// E.g. adding instruction: %var_a = OpConstant %int 2, will also add an +// instruction: OpName %var_a, "var_a". +// +// Note that the name must not be used on more than one defined IDs and +// friendly-name disassembling must be enabled so that OpName instructions will +// be respected. +class AssemblyBuilder { + // The base ID value for spec constants. + static const uint32_t SPEC_ID_BASE = 200; + + public: + // Initalize a minimal SPIR-V assembly code as the template. The minimal + // module contains an empty main function and some predefined names for the + // main function. + AssemblyBuilder() + : spec_id_counter_(SPEC_ID_BASE), + global_preamble_({ + // clang-format off + "OpCapability Shader", + "OpCapability Float64", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Vertex %main \"main\"", + // clang-format on + }), + names_(), + annotations_(), + types_consts_globals_(), + main_func_(), + main_func_postamble_({ + "OpReturn", + "OpFunctionEnd", + }) { + AppendTypesConstantsGlobals({ + "%void = OpTypeVoid", + "%main_func_type = OpTypeFunction %void", + }); + AppendInMain({ + "%main = OpFunction %void None %main_func_type", + "%main_func_entry_block = OpLabel", + }); + } + + // Appends OpName instructions to this builder. Instrcution strings that do + // not start with 'OpName ' will be skipped. Returns the references of this + // assembly builder. + AssemblyBuilder& AppendNames(const std::vector& vec_asm_code) { + for (auto& inst_str : vec_asm_code) { + if (inst_str.find("OpName ") == 0) { + names_.push_back(inst_str); + } + } + return *this; + } + + // Appends instructions to the types-constants-globals section and returns + // the reference of this assembly builder. IDs defined in the given code will + // be added to the Names section and then be registered with OpName + // instruction. Corresponding decoration instruction will be added for spec + // constants defined with opcode: 'OpSpecConstant'. + AssemblyBuilder& AppendTypesConstantsGlobals( + const std::vector& vec_asm_code) { + AddNamesForResultIDsIn(vec_asm_code); + // Check spec constants defined with OpSpecConstant. + for (auto& inst_str : vec_asm_code) { + if (inst_str.find("= OpSpecConstant ") != std::string::npos || + inst_str.find("= OpSpecConstantTrue ") != std::string::npos || + inst_str.find("= OpSpecConstantFalse ") != std::string::npos) { + AddSpecIDFor(GetResultIDName(inst_str)); + } + } + types_consts_globals_.insert(types_consts_globals_.end(), + vec_asm_code.begin(), vec_asm_code.end()); + return *this; + } + + // Appends instructions to the main function block, which is already labelled + // with "main_func_entry_block". Returns the reference of this assembly + // builder. IDs defined in the given code will be added to the Names section + // and then be registered with OpName instruction. + AssemblyBuilder& AppendInMain(const std::vector& vec_asm_code) { + AddNamesForResultIDsIn(vec_asm_code); + main_func_.insert(main_func_.end(), vec_asm_code.begin(), + vec_asm_code.end()); + return *this; + } + + // Appends annotation instructions to the annotation section, and returns the + // reference of this assembly builder. + AssemblyBuilder& AppendAnnotations( + const std::vector& vec_annotations) { + annotations_.insert(annotations_.end(), vec_annotations.begin(), + vec_annotations.end()); + return *this; + } + + // Pre-pends string to the preamble of the module. Useful for EFFCEE checks. + AssemblyBuilder& PrependPreamble(const std::vector& preamble) { + preamble_.insert(preamble_.end(), preamble.begin(), preamble.end()); + return *this; + } + + // Get the SPIR-V assembly code as string. + std::string GetCode() const { + std::ostringstream ss; + for (const auto& line : preamble_) { + ss << line << std::endl; + } + for (const auto& line : global_preamble_) { + ss << line << std::endl; + } + for (const auto& line : names_) { + ss << line << std::endl; + } + for (const auto& line : annotations_) { + ss << line << std::endl; + } + for (const auto& line : types_consts_globals_) { + ss << line << std::endl; + } + for (const auto& line : main_func_) { + ss << line << std::endl; + } + for (const auto& line : main_func_postamble_) { + ss << line << std::endl; + } + return ss.str(); + } + + private: + // Adds a given name to the Name section with OpName. If the given name has + // been added before, does nothing. + void AddOpNameIfNotExist(const std::string& id_name) { + if (!used_names_.count(id_name)) { + std::stringstream opname_inst; + opname_inst << "OpName " + << "%" << id_name << " \"" << id_name << "\""; + names_.emplace_back(opname_inst.str()); + used_names_.insert(id_name); + } + } + + // Adds the names in a vector of assembly code strings to the Names section. + // If a '=' sign is found in an instruction, this instruction will be treated + // as an ID defining instruction. The ID name used in the instruction will be + // extracted and added to the Names section. + void AddNamesForResultIDsIn(const std::vector& vec_asm_code) { + for (const auto& line : vec_asm_code) { + std::string name = GetResultIDName(line); + if (!name.empty()) { + AddOpNameIfNotExist(name); + } + } + } + + // Adds an OpDecorate SpecId instruction for the given ID name. + void AddSpecIDFor(const std::string& id_name) { + std::stringstream decorate_inst; + decorate_inst << "OpDecorate " + << "%" << id_name << " SpecId " << spec_id_counter_; + spec_id_counter_ += 1; + annotations_.emplace_back(decorate_inst.str()); + } + + // Extracts the ID name from a SPIR-V assembly instruction string. If the + // instruction is an ID-defining instruction (has result ID), returns the + // name of the result ID in string. If the instruction does not have result + // ID, returns an empty string. + std::string GetResultIDName(const std::string inst_str) { + std::string name; + if (inst_str.find('=') != std::string::npos) { + size_t assign_sign = inst_str.find('='); + name = inst_str.substr(0, assign_sign); + name.erase(remove_if(name.begin(), name.end(), + [](char c) { return c == ' ' || c == '%'; }), + name.end()); + } + return name; + } + + uint32_t spec_id_counter_; + // User-defined preamble. + std::vector preamble_; + // The vector that contains common preambles shared across all test SPIR-V + // code. + std::vector global_preamble_; + // The vector that contains OpName instructions. + std::vector names_; + // The vector that contains annotation instructions. + std::vector annotations_; + // The vector that contains the code to declare types, constants and global + // variables (aka. the Types-Constants-Globals section). + std::vector types_consts_globals_; + // The vector that contains the code in main function's entry block. + std::vector main_func_; + // The vector that contains the postamble of main function body. + std::vector main_func_postamble_; + // All of the defined variable names. + std::unordered_set used_names_; +}; + +} // namespace spvtools + +#endif // LIBSPIRV_TEST_OPT_ASSEMBLY_BUILDER diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/assembly_builder_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/assembly_builder_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/assembly_builder_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/assembly_builder_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,284 @@ +// Copyright (c) 2016 Google 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. + +#include "assembly_builder.h" + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; +using AssemblyBuilderTest = PassTest<::testing::Test>; + +TEST_F(AssemblyBuilderTest, MinimalShader) { + AssemblyBuilder builder; + std::vector expected = { + // clang-format off + "OpCapability Shader", + "OpCapability Float64", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Vertex %main \"main\"", + "OpName %void \"void\"", + "OpName %main_func_type \"main_func_type\"", + "OpName %main \"main\"", + "OpName %main_func_entry_block \"main_func_entry_block\"", + "%void = OpTypeVoid", + "%main_func_type = OpTypeFunction %void", + "%main = OpFunction %void None %main_func_type", +"%main_func_entry_block = OpLabel", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + + SinglePassRunAndCheck(builder.GetCode(), + JoinAllInsts(expected), + /* skip_nop = */ false); +} + +TEST_F(AssemblyBuilderTest, ShaderWithConstants) { + AssemblyBuilder builder; + builder + .AppendTypesConstantsGlobals({ + // clang-format off + "%bool = OpTypeBool", + "%_PF_bool = OpTypePointer Function %bool", + "%bt = OpConstantTrue %bool", + "%bf = OpConstantFalse %bool", + "%int = OpTypeInt 32 1", + "%_PF_int = OpTypePointer Function %int", + "%si = OpConstant %int 1", + "%uint = OpTypeInt 32 0", + "%_PF_uint = OpTypePointer Function %uint", + "%ui = OpConstant %uint 2", + "%float = OpTypeFloat 32", + "%_PF_float = OpTypePointer Function %float", + "%f = OpConstant %float 3.1415", + "%double = OpTypeFloat 64", + "%_PF_double = OpTypePointer Function %double", + "%d = OpConstant %double 3.14159265358979", + // clang-format on + }) + .AppendInMain({ + // clang-format off + "%btv = OpVariable %_PF_bool Function", + "%bfv = OpVariable %_PF_bool Function", + "%iv = OpVariable %_PF_int Function", + "%uv = OpVariable %_PF_uint Function", + "%fv = OpVariable %_PF_float Function", + "%dv = OpVariable %_PF_double Function", + "OpStore %btv %bt", + "OpStore %bfv %bf", + "OpStore %iv %si", + "OpStore %uv %ui", + "OpStore %fv %f", + "OpStore %dv %d", + // clang-format on + }); + + std::vector expected = { + // clang-format off + "OpCapability Shader", + "OpCapability Float64", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Vertex %main \"main\"", + "OpName %void \"void\"", + "OpName %main_func_type \"main_func_type\"", + "OpName %main \"main\"", + "OpName %main_func_entry_block \"main_func_entry_block\"", + "OpName %bool \"bool\"", + "OpName %_PF_bool \"_PF_bool\"", + "OpName %bt \"bt\"", + "OpName %bf \"bf\"", + "OpName %int \"int\"", + "OpName %_PF_int \"_PF_int\"", + "OpName %si \"si\"", + "OpName %uint \"uint\"", + "OpName %_PF_uint \"_PF_uint\"", + "OpName %ui \"ui\"", + "OpName %float \"float\"", + "OpName %_PF_float \"_PF_float\"", + "OpName %f \"f\"", + "OpName %double \"double\"", + "OpName %_PF_double \"_PF_double\"", + "OpName %d \"d\"", + "OpName %btv \"btv\"", + "OpName %bfv \"bfv\"", + "OpName %iv \"iv\"", + "OpName %uv \"uv\"", + "OpName %fv \"fv\"", + "OpName %dv \"dv\"", + "%void = OpTypeVoid", +"%main_func_type = OpTypeFunction %void", + "%bool = OpTypeBool", + "%_PF_bool = OpTypePointer Function %bool", + "%bt = OpConstantTrue %bool", + "%bf = OpConstantFalse %bool", + "%int = OpTypeInt 32 1", + "%_PF_int = OpTypePointer Function %int", + "%si = OpConstant %int 1", + "%uint = OpTypeInt 32 0", + "%_PF_uint = OpTypePointer Function %uint", + "%ui = OpConstant %uint 2", + "%float = OpTypeFloat 32", + "%_PF_float = OpTypePointer Function %float", + "%f = OpConstant %float 3.1415", + "%double = OpTypeFloat 64", + "%_PF_double = OpTypePointer Function %double", + "%d = OpConstant %double 3.14159265358979", + "%main = OpFunction %void None %main_func_type", +"%main_func_entry_block = OpLabel", + "%btv = OpVariable %_PF_bool Function", + "%bfv = OpVariable %_PF_bool Function", + "%iv = OpVariable %_PF_int Function", + "%uv = OpVariable %_PF_uint Function", + "%fv = OpVariable %_PF_float Function", + "%dv = OpVariable %_PF_double Function", + "OpStore %btv %bt", + "OpStore %bfv %bf", + "OpStore %iv %si", + "OpStore %uv %ui", + "OpStore %fv %f", + "OpStore %dv %d", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + SinglePassRunAndCheck(builder.GetCode(), + JoinAllInsts(expected), + /* skip_nop = */ false); +} + +TEST_F(AssemblyBuilderTest, SpecConstants) { + AssemblyBuilder builder; + builder.AppendTypesConstantsGlobals({ + "%bool = OpTypeBool", + "%uint = OpTypeInt 32 0", + "%int = OpTypeInt 32 1", + "%float = OpTypeFloat 32", + "%double = OpTypeFloat 64", + "%v2int = OpTypeVector %int 2", + + "%spec_true = OpSpecConstantTrue %bool", + "%spec_false = OpSpecConstantFalse %bool", + "%spec_uint = OpSpecConstant %uint 1", + "%spec_int = OpSpecConstant %int 1", + "%spec_float = OpSpecConstant %float 1.25", + "%spec_double = OpSpecConstant %double 1.2345678", + + // Spec constants defined below should not have SpecID. + "%spec_add_op = OpSpecConstantOp %int IAdd %spec_int %spec_int", + "%spec_vec = OpSpecConstantComposite %v2int %spec_int %spec_int", + "%spec_vec_x = OpSpecConstantOp %int CompositeExtract %spec_vec 0", + }); + std::vector expected = { + // clang-format off + "OpCapability Shader", + "OpCapability Float64", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Vertex %main \"main\"", + "OpName %void \"void\"", + "OpName %main_func_type \"main_func_type\"", + "OpName %main \"main\"", + "OpName %main_func_entry_block \"main_func_entry_block\"", + "OpName %bool \"bool\"", + "OpName %uint \"uint\"", + "OpName %int \"int\"", + "OpName %float \"float\"", + "OpName %double \"double\"", + "OpName %v2int \"v2int\"", + "OpName %spec_true \"spec_true\"", + "OpName %spec_false \"spec_false\"", + "OpName %spec_uint \"spec_uint\"", + "OpName %spec_int \"spec_int\"", + "OpName %spec_float \"spec_float\"", + "OpName %spec_double \"spec_double\"", + "OpName %spec_add_op \"spec_add_op\"", + "OpName %spec_vec \"spec_vec\"", + "OpName %spec_vec_x \"spec_vec_x\"", + "OpDecorate %spec_true SpecId 200", + "OpDecorate %spec_false SpecId 201", + "OpDecorate %spec_uint SpecId 202", + "OpDecorate %spec_int SpecId 203", + "OpDecorate %spec_float SpecId 204", + "OpDecorate %spec_double SpecId 205", + "%void = OpTypeVoid", + "%main_func_type = OpTypeFunction %void", + "%bool = OpTypeBool", + "%uint = OpTypeInt 32 0", + "%int = OpTypeInt 32 1", + "%float = OpTypeFloat 32", + "%double = OpTypeFloat 64", + "%v2int = OpTypeVector %int 2", + "%spec_true = OpSpecConstantTrue %bool", + "%spec_false = OpSpecConstantFalse %bool", + "%spec_uint = OpSpecConstant %uint 1", + "%spec_int = OpSpecConstant %int 1", + "%spec_float = OpSpecConstant %float 1.25", + "%spec_double = OpSpecConstant %double 1.2345678", + "%spec_add_op = OpSpecConstantOp %int IAdd %spec_int %spec_int", + "%spec_vec = OpSpecConstantComposite %v2int %spec_int %spec_int", + "%spec_vec_x = OpSpecConstantOp %int CompositeExtract %spec_vec 0", + "%main = OpFunction %void None %main_func_type", +"%main_func_entry_block = OpLabel", + "OpReturn", + "OpFunctionEnd", + + // clang-format on + }; + + SinglePassRunAndCheck(builder.GetCode(), + JoinAllInsts(expected), + /* skip_nop = */ false); +} + +TEST_F(AssemblyBuilderTest, AppendNames) { + AssemblyBuilder builder; + builder.AppendNames({ + "OpName %void \"another_name_for_void\"", + "I am an invalid OpName instruction and should not be added", + "OpName %main \"another name for main\"", + }); + std::vector expected = { + // clang-format off + "OpCapability Shader", + "OpCapability Float64", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Vertex %main \"main\"", + "OpName %void \"void\"", + "OpName %main_func_type \"main_func_type\"", + "OpName %main \"main\"", + "OpName %main_func_entry_block \"main_func_entry_block\"", + "OpName %void \"another_name_for_void\"", + "OpName %main \"another name for main\"", + "%void = OpTypeVoid", + "%main_func_type = OpTypeFunction %void", + "%main = OpFunction %void None %main_func_type", +"%main_func_entry_block = OpLabel", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + + SinglePassRunAndCheck(builder.GetCode(), + JoinAllInsts(expected), + /* skip_nop = */ false); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/block_merge_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/block_merge_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/block_merge_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/block_merge_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,699 @@ +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using BlockMergeTest = PassTest<::testing::Test>; + +TEST_F(BlockMergeTest, Simple) { + // Note: SPIR-V hand edited to insert block boundary + // between two statements in main. + // + // #version 140 + // + // in vec4 BaseColor; + // + // void main() + // { + // vec4 v = BaseColor; + // gl_FragColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %7 +%13 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%14 = OpLoad %v4float %BaseColor +OpStore %v %14 +OpBranch %15 +%15 = OpLabel +%16 = OpLoad %v4float %v +OpStore %gl_FragColor %16 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %7 +%13 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%14 = OpLoad %v4float %BaseColor +OpStore %v %14 +%16 = OpLoad %v4float %v +OpStore %gl_FragColor %16 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(predefs + before, predefs + after, + true, true); +} + +TEST_F(BlockMergeTest, EmptyBlock) { + // Note: SPIR-V hand edited to insert empty block + // after two statements in main. + // + // #version 140 + // + // in vec4 BaseColor; + // + // void main() + // { + // vec4 v = BaseColor; + // gl_FragColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %7 +%13 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%14 = OpLoad %v4float %BaseColor +OpStore %v %14 +OpBranch %15 +%15 = OpLabel +%16 = OpLoad %v4float %v +OpStore %gl_FragColor %16 +OpBranch %17 +%17 = OpLabel +OpBranch %18 +%18 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %7 +%13 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%14 = OpLoad %v4float %BaseColor +OpStore %v %14 +%16 = OpLoad %v4float %v +OpStore %gl_FragColor %16 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(predefs + before, predefs + after, + true, true); +} + +TEST_F(BlockMergeTest, NestedInControlFlow) { + // Note: SPIR-V hand edited to insert block boundary + // between OpFMul and OpStore in then-part. + // + // #version 140 + // in vec4 BaseColor; + // + // layout(std140) uniform U_t + // { + // bool g_B ; + // } ; + // + // void main() + // { + // vec4 v = BaseColor; + // if (g_B) + // vec4 v = v * 0.25; + // gl_FragColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_B" +OpName %_ "" +OpName %v_0 "v" +OpName %gl_FragColor "gl_FragColor" +OpMemberDecorate %U_t 0 Offset 0 +OpDecorate %U_t Block +OpDecorate %_ DescriptorSet 0 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%uint = OpTypeInt 32 0 +%U_t = OpTypeStruct %uint +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%_ptr_Uniform_uint = OpTypePointer Uniform %uint +%bool = OpTypeBool +%uint_0 = OpConstant %uint 0 +%float_0_25 = OpConstant %float 0.25 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %10 +%24 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%v_0 = OpVariable %_ptr_Function_v4float Function +%25 = OpLoad %v4float %BaseColor +OpStore %v %25 +%26 = OpAccessChain %_ptr_Uniform_uint %_ %int_0 +%27 = OpLoad %uint %26 +%28 = OpINotEqual %bool %27 %uint_0 +OpSelectionMerge %29 None +OpBranchConditional %28 %30 %29 +%30 = OpLabel +%31 = OpLoad %v4float %v +%32 = OpVectorTimesScalar %v4float %31 %float_0_25 +OpBranch %33 +%33 = OpLabel +OpStore %v_0 %32 +OpBranch %29 +%29 = OpLabel +%34 = OpLoad %v4float %v +OpStore %gl_FragColor %34 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %10 +%24 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%v_0 = OpVariable %_ptr_Function_v4float Function +%25 = OpLoad %v4float %BaseColor +OpStore %v %25 +%26 = OpAccessChain %_ptr_Uniform_uint %_ %int_0 +%27 = OpLoad %uint %26 +%28 = OpINotEqual %bool %27 %uint_0 +OpSelectionMerge %29 None +OpBranchConditional %28 %30 %29 +%30 = OpLabel +%31 = OpLoad %v4float %v +%32 = OpVectorTimesScalar %v4float %31 %float_0_25 +OpStore %v_0 %32 +OpBranch %29 +%29 = OpLabel +%34 = OpLoad %v4float %v +OpStore %gl_FragColor %34 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(predefs + before, predefs + after, + true, true); +} + +#ifdef SPIRV_EFFCEE +TEST_F(BlockMergeTest, PhiInSuccessorOfMergedBlock) { + const std::string text = R"( +; CHECK: OpSelectionMerge [[merge:%\w+]] None +; CHECK-NEXT: OpBranchConditional {{%\w+}} [[then:%\w+]] [[else:%\w+]] +; CHECK: [[then]] = OpLabel +; CHECK-NEXT: OpBranch [[merge]] +; CHECK: [[else]] = OpLabel +; CHECK-NEXT: OpBranch [[merge]] +; CHECK: [[merge]] = OpLabel +; CHECK-NEXT: OpPhi {{%\w+}} %true [[then]] %false [[else]] +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%entry = OpLabel +OpSelectionMerge %merge None +OpBranchConditional %true %then %else +%then = OpLabel +OpBranch %then_next +%then_next = OpLabel +OpBranch %merge +%else = OpLabel +OpBranch %merge +%merge = OpLabel +%phi = OpPhi %bool %true %then_next %false %else +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(BlockMergeTest, UpdateMergeInstruction) { + const std::string text = R"( +; CHECK: OpSelectionMerge [[merge:%\w+]] None +; CHECK-NEXT: OpBranchConditional {{%\w+}} [[then:%\w+]] [[else:%\w+]] +; CHECK: [[then]] = OpLabel +; CHECK-NEXT: OpBranch [[merge]] +; CHECK: [[else]] = OpLabel +; CHECK-NEXT: OpBranch [[merge]] +; CHECK: [[merge]] = OpLabel +; CHECK-NEXT: OpReturn +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%entry = OpLabel +OpSelectionMerge %real_merge None +OpBranchConditional %true %then %else +%then = OpLabel +OpBranch %merge +%else = OpLabel +OpBranch %merge +%merge = OpLabel +OpBranch %real_merge +%real_merge = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(BlockMergeTest, TwoMergeBlocksCannotBeMerged) { + const std::string text = R"( +; CHECK: OpSelectionMerge [[outer_merge:%\w+]] None +; CHECK: OpSelectionMerge [[inner_merge:%\w+]] None +; CHECK: [[inner_merge]] = OpLabel +; CHECK-NEXT: OpBranch [[outer_merge]] +; CHECK: [[outer_merge]] = OpLabel +; CHECK-NEXT: OpReturn +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%entry = OpLabel +OpSelectionMerge %outer_merge None +OpBranchConditional %true %then %else +%then = OpLabel +OpBranch %inner_header +%else = OpLabel +OpBranch %inner_header +%inner_header = OpLabel +OpSelectionMerge %inner_merge None +OpBranchConditional %true %inner_then %inner_else +%inner_then = OpLabel +OpBranch %inner_merge +%inner_else = OpLabel +OpBranch %inner_merge +%inner_merge = OpLabel +OpBranch %outer_merge +%outer_merge = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(BlockMergeTest, MergeContinue) { + const std::string text = R"( +; CHECK: OpBranch [[header:%\w+]] +; CHECK: [[header]] = OpLabel +; CHECK-NEXT: OpLogicalAnd +; CHECK-NEXT: OpLoopMerge {{%\w+}} [[header]] None +; CHECK-NEXT: OpBranch [[header]] +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%entry = OpLabel +OpBranch %header +%header = OpLabel +OpLoopMerge %merge %continue None +OpBranch %continue +%continue = OpLabel +%op = OpLogicalAnd %bool %true %false +OpBranch %header +%merge = OpLabel +OpUnreachable +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(BlockMergeTest, TwoHeadersCannotBeMerged) { + const std::string text = R"( +; CHECK: OpBranch [[loop_header:%\w+]] +; CHECK: [[loop_header]] = OpLabel +; CHECK-NEXT: OpLoopMerge +; CHECK-NEXT: OpBranch [[if_header:%\w+]] +; CHECK: [[if_header]] = OpLabel +; CHECK-NEXT: OpSelectionMerge +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%entry = OpLabel +OpBranch %header +%header = OpLabel +OpLoopMerge %merge %continue None +OpBranch %inner_header +%inner_header = OpLabel +OpSelectionMerge %continue None +OpBranchConditional %true %then %continue +%then = OpLabel +OpBranch %continue +%continue = OpLabel +OpBranchConditional %false %merge %header +%merge = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(BlockMergeTest, RemoveStructuredDeclaration) { + // Note: SPIR-V hand edited remove dead branch and add block + // before continue block + // + // #version 140 + // in vec4 BaseColor; + // + // void main() + // { + // while (true) { + // break; + // } + // gl_FragColor = BaseColor; + // } + + const std::string assembly = + R"( +; CHECK: OpLabel +; CHECK: [[header:%\w+]] = OpLabel +; CHECK-NOT: OpLoopMerge +; CHECK: OpReturn +; CHECK: [[continue:%\w+]] = OpLabel +; CHECK-NEXT: OpBranch [[header]] +OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %gl_FragColor %BaseColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %gl_FragColor "gl_FragColor" +OpName %BaseColor "BaseColor" +%void = OpTypeVoid +%6 = OpTypeFunction %void +%bool = OpTypeBool +%true = OpConstantTrue %bool +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%main = OpFunction %void None %6 +%13 = OpLabel +OpBranch %14 +%14 = OpLabel +OpLoopMerge %15 %16 None +OpBranch %17 +%17 = OpLabel +OpBranch %15 +%18 = OpLabel +OpBranch %16 +%16 = OpLabel +OpBranch %14 +%15 = OpLabel +%19 = OpLoad %v4float %BaseColor +OpStore %gl_FragColor %19 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(assembly, true); +} + +TEST_F(BlockMergeTest, DontMergeKill) { + const std::string text = R"( +; CHECK: OpLoopMerge [[merge:%\w+]] [[cont:%\w+]] None +; CHECK-NEXT: OpBranch [[ret:%\w+]] +; CHECK: [[ret:%\w+]] = OpLabel +; CHECK-NEXT: OpKill +; CHECK-DAG: [[cont]] = OpLabel +; CHECK-DAG: [[merge]] = OpLabel +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" +%void = OpTypeVoid +%bool = OpTypeBool +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%1 = OpLabel +OpBranch %2 +%2 = OpLabel +OpLoopMerge %3 %4 None +OpBranch %5 +%5 = OpLabel +OpKill +%4 = OpLabel +OpBranch %2 +%3 = OpLabel +OpUnreachable +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(BlockMergeTest, DontMergeUnreachable) { + const std::string text = R"( +; CHECK: OpLoopMerge [[merge:%\w+]] [[cont:%\w+]] None +; CHECK-NEXT: OpBranch [[ret:%\w+]] +; CHECK: [[ret:%\w+]] = OpLabel +; CHECK-NEXT: OpUnreachable +; CHECK-DAG: [[cont]] = OpLabel +; CHECK-DAG: [[merge]] = OpLabel +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" +%void = OpTypeVoid +%bool = OpTypeBool +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%1 = OpLabel +OpBranch %2 +%2 = OpLabel +OpLoopMerge %3 %4 None +OpBranch %5 +%5 = OpLabel +OpUnreachable +%4 = OpLabel +OpBranch %2 +%3 = OpLabel +OpUnreachable +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(BlockMergeTest, DontMergeReturn) { + const std::string text = R"( +; CHECK: OpLoopMerge [[merge:%\w+]] [[cont:%\w+]] None +; CHECK-NEXT: OpBranch [[ret:%\w+]] +; CHECK: [[ret:%\w+]] = OpLabel +; CHECK-NEXT: OpReturn +; CHECK-DAG: [[cont]] = OpLabel +; CHECK-DAG: [[merge]] = OpLabel +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" +%void = OpTypeVoid +%bool = OpTypeBool +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%1 = OpLabel +OpBranch %2 +%2 = OpLabel +OpLoopMerge %3 %4 None +OpBranch %5 +%5 = OpLabel +OpReturn +%4 = OpLabel +OpBranch %2 +%3 = OpLabel +OpUnreachable +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(BlockMergeTest, DontMergeSwitch) { + const std::string text = R"( +; CHECK: OpLoopMerge [[merge:%\w+]] [[cont:%\w+]] None +; CHECK-NEXT: OpBranch [[ret:%\w+]] +; CHECK: [[ret:%\w+]] = OpLabel +; CHECK-NEXT: OpSwitch +; CHECK-DAG: [[cont]] = OpLabel +; CHECK-DAG: [[merge]] = OpLabel +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" +%void = OpTypeVoid +%bool = OpTypeBool +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%1 = OpLabel +OpBranch %2 +%2 = OpLabel +OpLoopMerge %3 %4 None +OpBranch %5 +%5 = OpLabel +OpSwitch %int_0 %6 +%6 = OpLabel +OpReturn +%4 = OpLabel +OpBranch %2 +%3 = OpLabel +OpUnreachable +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(BlockMergeTest, DontMergeReturnValue) { + const std::string text = R"( +; CHECK: OpLoopMerge [[merge:%\w+]] [[cont:%\w+]] None +; CHECK-NEXT: OpBranch [[ret:%\w+]] +; CHECK: [[ret:%\w+]] = OpLabel +; CHECK-NEXT: OpReturn +; CHECK-DAG: [[cont]] = OpLabel +; CHECK-DAG: [[merge]] = OpLabel +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" +%void = OpTypeVoid +%bool = OpTypeBool +%functy = OpTypeFunction %void +%otherfuncty = OpTypeFunction %bool +%true = OpConstantTrue %bool +%func = OpFunction %void None %functy +%1 = OpLabel +%2 = OpFunctionCall %bool %3 +OpReturn +OpFunctionEnd +%3 = OpFunction %bool None %otherfuncty +%4 = OpLabel +OpBranch %5 +%5 = OpLabel +OpLoopMerge %6 %7 None +OpBranch %8 +%8 = OpLabel +OpReturnValue %true +%7 = OpLabel +OpBranch %5 +%6 = OpLabel +OpUnreachable +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} +#endif // SPIRV_EFFCEE + +// TODO(greg-lunarg): Add tests to verify handling of these cases: +// +// More complex control flow +// Others? + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/ccp_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/ccp_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/ccp_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/ccp_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,895 @@ +// Copyright (c) 2017 Google 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. + +#include "gmock/gmock.h" +#include "gtest/gtest.h" +#include "pass_fixture.h" +#include "pass_utils.h" + +#include "opt/ccp_pass.h" + +namespace { + +using namespace spvtools; + +using CCPTest = PassTest<::testing::Test>; + +// TODO(dneto): Add Effcee as required dependency, and make this unconditional. +#ifdef SPIRV_EFFCEE +TEST_F(CCPTest, PropagateThroughPhis) { + const std::string spv_asm = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %x %outparm + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %x "x" + OpName %outparm "outparm" + OpDecorate %x Flat + OpDecorate %x Location 0 + OpDecorate %outparm Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %bool = OpTypeBool +%_ptr_Function_int = OpTypePointer Function %int + %int_4 = OpConstant %int 4 + %int_3 = OpConstant %int 3 + %int_1 = OpConstant %int 1 +%_ptr_Input_int = OpTypePointer Input %int + %x = OpVariable %_ptr_Input_int Input +%_ptr_Output_int = OpTypePointer Output %int + %outparm = OpVariable %_ptr_Output_int Output + %main = OpFunction %void None %3 + %4 = OpLabel + %5 = OpLoad %int %x + %9 = OpIAdd %int %int_1 %int_3 + %6 = OpSGreaterThan %bool %5 %int_3 + OpSelectionMerge %25 None + OpBranchConditional %6 %22 %23 + %22 = OpLabel + +; CHECK: OpCopyObject %int %int_4 + %7 = OpCopyObject %int %9 + + OpBranch %25 + %23 = OpLabel + %8 = OpCopyObject %int %int_4 + OpBranch %25 + %25 = OpLabel + +; %int_4 should have propagated to both OpPhi operands. +; CHECK: OpPhi %int %int_4 {{%\d+}} %int_4 {{%\d+}} + %35 = OpPhi %int %7 %22 %8 %23 + +; This function always returns 4. DCE should get rid of everything else. +; CHECK OpStore %outparm %int_4 + OpStore %outparm %35 + OpReturn + OpFunctionEnd + )"; + + SinglePassRunAndMatch(spv_asm, true); +} + +TEST_F(CCPTest, SimplifyConditionals) { + const std::string spv_asm = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %outparm + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %outparm "outparm" + OpDecorate %outparm Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %bool = OpTypeBool +%_ptr_Function_int = OpTypePointer Function %int + %int_4 = OpConstant %int 4 + %int_3 = OpConstant %int 3 + %int_1 = OpConstant %int 1 +%_ptr_Output_int = OpTypePointer Output %int + %outparm = OpVariable %_ptr_Output_int Output + %main = OpFunction %void None %3 + %4 = OpLabel + %9 = OpIAdd %int %int_4 %int_3 + %6 = OpSGreaterThan %bool %9 %int_3 + OpSelectionMerge %25 None +; CHECK: OpBranchConditional %true [[bb_taken:%\d+]] [[bb_not_taken:%\d+]] + OpBranchConditional %6 %22 %23 +; CHECK: [[bb_taken]] = OpLabel + %22 = OpLabel +; CHECK: OpCopyObject %int %int_7 + %7 = OpCopyObject %int %9 + OpBranch %25 +; CHECK: [[bb_not_taken]] = OpLabel + %23 = OpLabel +; CHECK: [[id_not_evaluated:%\d+]] = OpCopyObject %int %int_4 + %8 = OpCopyObject %int %int_4 + OpBranch %25 + %25 = OpLabel + +; %int_7 should have propagated to the first OpPhi operand. But the else branch +; is not executable (conditional is always true), so no values should be +; propagated there and the value of the OpPhi should always be %int_7. +; CHECK: OpPhi %int %int_7 [[bb_taken]] [[id_not_evaluated]] [[bb_not_taken]] + %35 = OpPhi %int %7 %22 %8 %23 + +; Only the true path of the conditional is ever executed. The output of this +; function is always %int_7. +; CHECK: OpStore %outparm %int_7 + OpStore %outparm %35 + OpReturn + OpFunctionEnd + )"; + + SinglePassRunAndMatch(spv_asm, true); +} + +TEST_F(CCPTest, SimplifySwitches) { + const std::string spv_asm = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %outparm + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %outparm "outparm" + OpDecorate %outparm Location 0 + %void = OpTypeVoid + %6 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_23 = OpConstant %int 23 + %int_42 = OpConstant %int 42 + %int_14 = OpConstant %int 14 + %int_15 = OpConstant %int 15 + %int_4 = OpConstant %int 4 +%_ptr_Output_int = OpTypePointer Output %int + %outparm = OpVariable %_ptr_Output_int Output + %main = OpFunction %void None %6 + %15 = OpLabel + OpSelectionMerge %17 None + OpSwitch %int_23 %17 10 %18 13 %19 23 %20 + %18 = OpLabel + OpBranch %17 + %19 = OpLabel + OpBranch %17 + %20 = OpLabel + OpBranch %17 + %17 = OpLabel + %24 = OpPhi %int %int_23 %15 %int_42 %18 %int_14 %19 %int_15 %20 + +; The switch will always jump to label %20, which carries the value %int_15. +; CHECK: OpIAdd %int %int_15 %int_4 + %22 = OpIAdd %int %24 %int_4 + +; Consequently, the return value will always be %int_19. +; CHECK: OpStore %outparm %int_19 + OpStore %outparm %22 + OpReturn + OpFunctionEnd + )"; + + SinglePassRunAndMatch(spv_asm, true); +} + +TEST_F(CCPTest, SimplifySwitchesDefaultBranch) { + const std::string spv_asm = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %outparm + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %outparm "outparm" + OpDecorate %outparm Location 0 + %void = OpTypeVoid + %6 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_42 = OpConstant %int 42 + %int_4 = OpConstant %int 4 + %int_1 = OpConstant %int 1 +%_ptr_Output_int = OpTypePointer Output %int + %outparm = OpVariable %_ptr_Output_int Output + %main = OpFunction %void None %6 + %13 = OpLabel + %15 = OpIAdd %int %int_42 %int_4 + OpSelectionMerge %16 None + +; CHECK: OpSwitch %int_46 {{%\d+}} 10 {{%\d+}} + OpSwitch %15 %17 10 %18 + %18 = OpLabel + OpBranch %16 + %17 = OpLabel + OpBranch %16 + %16 = OpLabel + %22 = OpPhi %int %int_42 %18 %int_1 %17 + +; The switch will always jump to the default label %17. This carries the value +; %int_1. +; CHECK: OpIAdd %int %int_1 %int_4 + %20 = OpIAdd %int %22 %int_4 + +; Resulting in a return value of %int_5. +; CHECK: OpStore %outparm %int_5 + OpStore %outparm %20 + OpReturn + OpFunctionEnd + )"; + + SinglePassRunAndMatch(spv_asm, true); +} + +TEST_F(CCPTest, SimplifyIntVector) { + const std::string spv_asm = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %OutColor + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %v "v" + OpName %OutColor "OutColor" + OpDecorate %OutColor Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v4int = OpTypeVector %int 4 +%_ptr_Function_v4int = OpTypePointer Function %v4int + %int_1 = OpConstant %int 1 + %int_2 = OpConstant %int 2 + %int_3 = OpConstant %int 3 + %int_4 = OpConstant %int 4 + %14 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4 + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 +%_ptr_Function_int = OpTypePointer Function %int +%_ptr_Output_v4int = OpTypePointer Output %v4int + %OutColor = OpVariable %_ptr_Output_v4int Output + %main = OpFunction %void None %3 + %5 = OpLabel + %v = OpVariable %_ptr_Function_v4int Function + OpStore %v %14 + %18 = OpAccessChain %_ptr_Function_int %v %uint_0 + %19 = OpLoad %int %18 + +; The constant folder does not see through access chains. To get this, the +; vector would have to be scalarized. +; CHECK: [[result_id:%\d+]] = OpIAdd %int {{%\d+}} %int_1 + %20 = OpIAdd %int %19 %int_1 + %21 = OpAccessChain %_ptr_Function_int %v %uint_0 + +; CHECK: OpStore {{%\d+}} [[result_id]] + OpStore %21 %20 + %24 = OpLoad %v4int %v + OpStore %OutColor %24 + OpReturn + OpFunctionEnd + )"; + + SinglePassRunAndMatch(spv_asm, true); +} + +TEST_F(CCPTest, BadSimplifyFloatVector) { + const std::string spv_asm = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %OutColor + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %v "v" + OpName %OutColor "OutColor" + OpDecorate %OutColor Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 + %float_2 = OpConstant %float 2 + %float_3 = OpConstant %float 3 + %float_4 = OpConstant %float 4 + %14 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4 + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 +%_ptr_Function_float = OpTypePointer Function %float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %OutColor = OpVariable %_ptr_Output_v4float Output + %main = OpFunction %void None %3 + %5 = OpLabel + %v = OpVariable %_ptr_Function_v4float Function + OpStore %v %14 + %18 = OpAccessChain %_ptr_Function_float %v %uint_0 + %19 = OpLoad %float %18 + +; NOTE: This test should start failing once floating point folding is +; implemented (https://github.com/KhronosGroup/SPIRV-Tools/issues/943). +; This should be checking that we are adding %float_1 + %float_1. +; CHECK: [[result_id:%\d+]] = OpFAdd %float {{%\d+}} %float_1 + %20 = OpFAdd %float %19 %float_1 + %21 = OpAccessChain %_ptr_Function_float %v %uint_0 + +; This should be checkint that we are storing %float_2 instead of result_it. +; CHECK: OpStore {{%\d+}} [[result_id]] + OpStore %21 %20 + %24 = OpLoad %v4float %v + OpStore %OutColor %24 + OpReturn + OpFunctionEnd + )"; + + SinglePassRunAndMatch(spv_asm, true); +} + +TEST_F(CCPTest, NoLoadStorePropagation) { + const std::string spv_asm = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %outparm + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %x "x" + OpName %outparm "outparm" + OpDecorate %outparm Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_23 = OpConstant %int 23 +%_ptr_Output_int = OpTypePointer Output %int + %outparm = OpVariable %_ptr_Output_int Output + %main = OpFunction %void None %3 + %5 = OpLabel + %x = OpVariable %_ptr_Function_int Function + OpStore %x %int_23 + +; int_23 should not propagate into this load. +; CHECK: [[load_id:%\d+]] = OpLoad %int %x + %12 = OpLoad %int %x + +; Nor into this copy operation. +; CHECK: [[copy_id:%\d+]] = OpCopyObject %int [[load_id]] + %13 = OpCopyObject %int %12 + +; Likewise here. +; CHECK: OpStore %outparm [[copy_id]] + OpStore %outparm %13 + OpReturn + OpFunctionEnd + )"; + + SinglePassRunAndMatch(spv_asm, true); +} + +TEST_F(CCPTest, HandleAbortInstructions) { + const std::string spv_asm = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" + OpExecutionMode %main OriginUpperLeft + OpSource HLSL 500 + OpName %main "main" + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %bool = OpTypeBool +; CHECK: %true = OpConstantTrue %bool + %int_3 = OpConstant %int 3 + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %3 + %4 = OpLabel + %9 = OpIAdd %int %int_3 %int_1 + %6 = OpSGreaterThan %bool %9 %int_3 + OpSelectionMerge %23 None +; CHECK: OpBranchConditional %true {{%\d+}} {{%\d+}} + OpBranchConditional %6 %22 %23 + %22 = OpLabel + OpKill + %23 = OpLabel + OpReturn + OpFunctionEnd + )"; + + SinglePassRunAndMatch(spv_asm, true); +} + +TEST_F(CCPTest, SSAWebCycles) { + // Test reduced from https://github.com/KhronosGroup/SPIRV-Tools/issues/1159 + // When there is a cycle in the SSA def-use web, the propagator was getting + // into an infinite loop. SSA edges for Phi instructions should not be + // added to the edges to simulate. + const std::string spv_asm = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %int_4 = OpConstant %int 4 + %bool = OpTypeBool + %int_1 = OpConstant %int 1 +%_ptr_Output_int = OpTypePointer Output %int + %main = OpFunction %void None %3 + %5 = OpLabel + OpBranch %11 + %11 = OpLabel + %29 = OpPhi %int %int_0 %5 %22 %14 + %30 = OpPhi %int %int_0 %5 %25 %14 + OpLoopMerge %13 %14 None + OpBranch %15 + %15 = OpLabel + %19 = OpSLessThan %bool %30 %int_4 +; CHECK: OpBranchConditional %true {{%\d+}} {{%\d+}} + OpBranchConditional %19 %12 %13 + %12 = OpLabel +; CHECK: OpIAdd %int %int_0 %int_0 + %22 = OpIAdd %int %29 %30 + OpBranch %14 + %14 = OpLabel +; CHECK: OpPhi %int %int_0 {{%\d+}} + %25 = OpPhi %int %30 %12 + OpBranch %11 + %13 = OpLabel + OpReturn + OpFunctionEnd + )"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndMatch(spv_asm, true); +} + +TEST_F(CCPTest, LoopInductionVariables) { + // Test reduced from https://github.com/KhronosGroup/SPIRV-Tools/issues/1143 + // We are failing to properly consider the induction variable for this loop + // as Varying. + const std::string spv_asm = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 430 + OpName %main "main" + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %int_10 = OpConstant %int 10 + %bool = OpTypeBool + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %5 + %12 = OpLabel + OpBranch %13 + %13 = OpLabel + +; This Phi should not have all constant arguments: +; CHECK: [[phi_id:%\d+]] = OpPhi %int %int_0 {{%\d+}} {{%\d+}} {{%\d+}} + %22 = OpPhi %int %int_0 %12 %21 %15 + OpLoopMerge %14 %15 None + OpBranch %16 + %16 = OpLabel + +; The Phi should never be considered to have the value %int_0. +; CHECK: [[branch_selector:%\d+]] = OpSLessThan %bool [[phi_id]] %int_10 + %18 = OpSLessThan %bool %22 %int_10 + +; This conditional was wrongly converted into an always-true jump due to the +; bad meet evaluation of %22. +; CHECK: OpBranchConditional [[branch_selector]] {{%\d+}} {{%\d+}} + OpBranchConditional %18 %19 %14 + %19 = OpLabel + OpBranch %15 + %15 = OpLabel +; CHECK: OpIAdd %int [[phi_id]] %int_1 + %21 = OpIAdd %int %22 %int_1 + OpBranch %13 + %14 = OpLabel + OpReturn + OpFunctionEnd + )"; + + SinglePassRunAndMatch(spv_asm, true); +} + +TEST_F(CCPTest, HandleCompositeWithUndef) { + // Check to make sure that CCP does not crash when given a "constant" struct + // with an undef. If at a later time CCP is enhanced to optimize this case, + // it is not wrong. + const std::string spv_asm = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" + OpExecutionMode %main OriginUpperLeft + OpSource HLSL 500 + OpName %main "main" + %void = OpTypeVoid + %4 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %bool = OpTypeBool + %_struct_7 = OpTypeStruct %int %int + %int_1 = OpConstant %int 1 + %9 = OpUndef %int + %10 = OpConstantComposite %_struct_7 %int_1 %9 + %main = OpFunction %void None %4 + %11 = OpLabel + %12 = OpCompositeExtract %int %10 0 + %13 = OpCopyObject %int %12 + OpReturn + OpFunctionEnd + )"; + + auto res = SinglePassRunToBinary(spv_asm, true); + EXPECT_EQ(std::get<1>(res), opt::Pass::Status::SuccessWithoutChange); +} + +TEST_F(CCPTest, SkipSpecConstantInstrucitons) { + const std::string spv_asm = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" + OpExecutionMode %main OriginUpperLeft + OpSource HLSL 500 + OpName %main "main" + %void = OpTypeVoid + %4 = OpTypeFunction %void + %bool = OpTypeBool + %10 = OpSpecConstantFalse %bool + %main = OpFunction %void None %4 + %11 = OpLabel + %12 = OpBranchConditional %10 %l1 %l2 + %l1 = OpLabel + OpReturn + %l2 = OpLabel + OpReturn + OpFunctionEnd + )"; + + auto res = SinglePassRunToBinary(spv_asm, true); + EXPECT_EQ(std::get<1>(res), opt::Pass::Status::SuccessWithoutChange); +} + +TEST_F(CCPTest, UpdateSubsequentPhisToVarying) { + const std::string text = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" %in +%void = OpTypeVoid +%bool = OpTypeBool +%int = OpTypeInt 32 1 +%false = OpConstantFalse %bool +%int0 = OpConstant %int 0 +%int1 = OpConstant %int 1 +%int6 = OpConstant %int 6 +%int_ptr_Input = OpTypePointer Input %int +%in = OpVariable %int_ptr_Input Input +%undef = OpUndef %int +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%1 = OpLabel +OpBranch %2 +%2 = OpLabel +%outer_phi = OpPhi %int %int0 %1 %outer_add %15 +%cond1 = OpSLessThanEqual %bool %outer_phi %int6 +OpLoopMerge %3 %15 None +OpBranchConditional %cond1 %4 %3 +%4 = OpLabel +%ld = OpLoad %int %in +%cond2 = OpSGreaterThanEqual %bool %int1 %ld +OpSelectionMerge %10 None +OpBranchConditional %cond2 %8 %9 +%8 = OpLabel +OpBranch %10 +%9 = OpLabel +OpBranch %10 +%10 = OpLabel +%extra_phi = OpPhi %int %outer_phi %8 %outer_phi %9 +OpBranch %11 +%11 = OpLabel +%inner_phi = OpPhi %int %int0 %10 %inner_add %13 +%cond3 = OpSLessThanEqual %bool %inner_phi %int6 +OpLoopMerge %14 %13 None +OpBranchConditional %cond3 %12 %14 +%12 = OpLabel +OpBranch %13 +%13 = OpLabel +%inner_add = OpIAdd %int %inner_phi %int1 +OpBranch %11 +%14 = OpLabel +OpBranch %15 +%15 = OpLabel +%outer_add = OpIAdd %int %extra_phi %int1 +OpBranch %2 +%3 = OpLabel +OpReturn +OpFunctionEnd +)"; + + auto res = SinglePassRunToBinary(text, true); + EXPECT_EQ(std::get<1>(res), opt::Pass::Status::SuccessWithoutChange); +} + +TEST_F(CCPTest, UndefInPhi) { + const std::string text = R"( +; CHECK: [[uint1:%\w+]] = OpConstant {{%\w+}} 1 +; CHECK: [[phi:%\w+]] = OpPhi +; CHECK: OpIAdd {{%\w+}} [[phi]] [[uint1]] + OpCapability Kernel + OpCapability Linkage + OpMemoryModel Logical OpenCL + OpDecorate %1 LinkageAttributes "func" Export + %void = OpTypeVoid + %bool = OpTypeBool + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 + %7 = OpUndef %uint + %8 = OpTypeFunction %void %bool + %1 = OpFunction %void None %8 + %9 = OpFunctionParameter %bool + %10 = OpLabel + OpBranchConditional %9 %11 %12 + %11 = OpLabel + OpBranch %13 + %12 = OpLabel + OpBranch %14 + %14 = OpLabel + OpBranchConditional %9 %13 %15 + %15 = OpLabel + OpBranch %13 + %13 = OpLabel + %16 = OpPhi %uint %uint_0 %11 %7 %14 %uint_1 %15 + %17 = OpIAdd %uint %16 %uint_1 + OpReturn + OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +// Just test to make sure the constant fold rules are being used. Will rely on +// the folding test for specific testing of specific rules. +TEST_F(CCPTest, UseConstantFoldingRules) { + const std::string text = R"( +; CHECK: [[float1:%\w+]] = OpConstant {{%\w+}} 1 +; CHECK: OpReturnValue [[float1]] + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpDecorate %1 LinkageAttributes "func" Export + %void = OpTypeVoid + %bool = OpTypeBool + %float = OpTypeFloat 32 + %float_0 = OpConstant %float 0 + %float_1 = OpConstant %float 1 + %8 = OpTypeFunction %float + %1 = OpFunction %float None %8 + %10 = OpLabel + %17 = OpFAdd %float %float_0 %float_1 + OpReturnValue %17 + OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +// Test for #1300. Previously value for %5 would not settle during simulation. +TEST_F(CCPTest, SettlePhiLatticeValue) { + const std::string text = R"( +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +OpDecorate %func LinkageAttributes "func" Export +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%1 = OpLabel +OpBranchConditional %true %2 %3 +%3 = OpLabel +OpBranch %2 +%2 = OpLabel +%5 = OpPhi %bool %true %1 %false %3 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunToBinary(text, true); +} + +TEST_F(CCPTest, NullBranchCondition) { + const std::string text = R"( +; CHECK: [[int1:%\w+]] = OpConstant {{%\w+}} 1 +; CHECK: [[int2:%\w+]] = OpConstant {{%\w+}} 2 +; CHECK: OpIAdd {{%\w+}} [[int1]] [[int2]] +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" +%void = OpTypeVoid +%bool = OpTypeBool +%int = OpTypeInt 32 1 +%null = OpConstantNull %bool +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%1 = OpLabel +OpSelectionMerge %2 None +OpBranchConditional %null %2 %3 +%3 = OpLabel +OpBranch %2 +%2 = OpLabel +%phi = OpPhi %int %int_1 %1 %int_2 %3 +%add = OpIAdd %int %int_1 %phi +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(CCPTest, UndefBranchCondition) { + const std::string text = R"( +; CHECK: [[int1:%\w+]] = OpConstant {{%\w+}} 1 +; CHECK: [[phi:%\w+]] = OpPhi +; CHECK: OpIAdd {{%\w+}} [[int1]] [[phi]] +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" +%void = OpTypeVoid +%bool = OpTypeBool +%int = OpTypeInt 32 1 +%undef = OpUndef %bool +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%1 = OpLabel +OpSelectionMerge %2 None +OpBranchConditional %undef %2 %3 +%3 = OpLabel +OpBranch %2 +%2 = OpLabel +%phi = OpPhi %int %int_1 %1 %int_2 %3 +%add = OpIAdd %int %int_1 %phi +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(CCPTest, NullSwitchCondition) { + const std::string text = R"( +; CHECK: [[int1:%\w+]] = OpConstant {{%\w+}} 1 +; CHECK: [[int2:%\w+]] = OpConstant {{%\w+}} 2 +; CHECK: OpIAdd {{%\w+}} [[int1]] [[int2]] +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" +%void = OpTypeVoid +%int = OpTypeInt 32 1 +%null = OpConstantNull %int +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%1 = OpLabel +OpSelectionMerge %2 None +OpSwitch %null %2 0 %3 +%3 = OpLabel +OpBranch %2 +%2 = OpLabel +%phi = OpPhi %int %int_1 %1 %int_2 %3 +%add = OpIAdd %int %int_1 %phi +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(CCPTest, UndefSwitchCondition) { + const std::string text = R"( +; CHECK: [[int1:%\w+]] = OpConstant {{%\w+}} 1 +; CHECK: [[phi:%\w+]] = OpPhi +; CHECK: OpIAdd {{%\w+}} [[int1]] [[phi]] +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" +%void = OpTypeVoid +%int = OpTypeInt 32 1 +%undef = OpUndef %int +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%1 = OpLabel +OpSelectionMerge %2 None +OpSwitch %undef %2 0 %3 +%3 = OpLabel +OpBranch %2 +%2 = OpLabel +%phi = OpPhi %int %int_1 %1 %int_2 %3 +%add = OpIAdd %int %int_1 %phi +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +// Test for #1361. +TEST_F(CCPTest, CompositeConstructOfGlobalValue) { + const std::string text = R"( +; CHECK: [[phi:%\w+]] = OpPhi +; CHECK-NEXT: OpCompositeExtract {{%\w+}} [[phi]] 0 +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" %in +%void = OpTypeVoid +%int = OpTypeInt 32 1 +%bool = OpTypeBool +%functy = OpTypeFunction %void +%ptr_int_Input = OpTypePointer Input %int +%in = OpVariable %ptr_int_Input Input +%struct = OpTypeStruct %ptr_int_Input %ptr_int_Input +%struct_null = OpConstantNull %struct +%func = OpFunction %void None %functy +%1 = OpLabel +OpBranch %2 +%2 = OpLabel +%phi = OpPhi %struct %struct_null %1 %5 %4 +%extract = OpCompositeExtract %ptr_int_Input %phi 0 +OpLoopMerge %3 %4 None +OpBranch %4 +%4 = OpLabel +%5 = OpCompositeConstruct %struct %in %in +OpBranch %2 +%3 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} +#endif + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/cfg_cleanup_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/cfg_cleanup_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/cfg_cleanup_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/cfg_cleanup_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,443 @@ +// Copyright (c) 2017 Google 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. + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using CFGCleanupTest = PassTest<::testing::Test>; + +TEST_F(CFGCleanupTest, RemoveUnreachableBlocks) { + const std::string declarations = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %inf %outf4 +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %inf "inf" +OpName %outf4 "outf4" +OpDecorate %inf Location 0 +OpDecorate %outf4 Location 0 +%void = OpTypeVoid +%6 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Input_float = OpTypePointer Input %float +%inf = OpVariable %_ptr_Input_float Input +%float_2 = OpConstant %float 2 +%bool = OpTypeBool +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%outf4 = OpVariable %_ptr_Output_v4float Output +%float_n0_5 = OpConstant %float -0.5 +)"; + + const std::string body_before = R"(%main = OpFunction %void None %6 +%14 = OpLabel +OpBranch %18 +%19 = OpLabel +%20 = OpLoad %float %inf +%21 = OpCompositeConstruct %v4float %20 %20 %20 %20 +OpStore %outf4 %21 +OpBranch %17 +%18 = OpLabel +%22 = OpLoad %float %inf +%23 = OpFAdd %float %22 %float_n0_5 +%24 = OpCompositeConstruct %v4float %23 %23 %23 %23 +OpStore %outf4 %24 +OpBranch %17 +%17 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string body_after = R"(%main = OpFunction %void None %6 +%14 = OpLabel +OpBranch %15 +%15 = OpLabel +%20 = OpLoad %float %inf +%21 = OpFAdd %float %20 %float_n0_5 +%22 = OpCompositeConstruct %v4float %21 %21 %21 %21 +OpStore %outf4 %22 +OpBranch %19 +%19 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + declarations + body_before, declarations + body_after, true, true); +} + +TEST_F(CFGCleanupTest, RemoveDecorations) { + const std::string before = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" + OpName %main "main" + OpName %x "x" + OpName %dead "dead" + OpDecorate %x RelaxedPrecision + OpDecorate %dead RelaxedPrecision + %void = OpTypeVoid + %6 = OpTypeFunction %void + %float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float + %float_2 = OpConstant %float 2 + %float_4 = OpConstant %float 4 + + %main = OpFunction %void None %6 + %14 = OpLabel + %x = OpVariable %_ptr_Function_float Function + OpBranch %18 + %19 = OpLabel + %dead = OpVariable %_ptr_Function_float Function + OpStore %dead %float_2 + OpBranch %17 + %18 = OpLabel + OpStore %x %float_4 + OpBranch %17 + %17 = OpLabel + OpReturn + OpFunctionEnd +)"; + + const std::string after = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpName %main "main" +OpName %x "x" +OpDecorate %x RelaxedPrecision +%void = OpTypeVoid +%6 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%float_2 = OpConstant %float 2 +%float_4 = OpConstant %float 4 +%main = OpFunction %void None %6 +%11 = OpLabel +%x = OpVariable %_ptr_Function_float Function +OpBranch %12 +%12 = OpLabel +OpStore %x %float_4 +OpBranch %14 +%14 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(before, after, true, true); +} + +TEST_F(CFGCleanupTest, UpdatePhis) { + const std::string before = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %y %outparm + OpName %main "main" + OpName %y "y" + OpName %outparm "outparm" + OpDecorate %y Flat + OpDecorate %y Location 0 + OpDecorate %outparm Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%_ptr_Input_int = OpTypePointer Input %int + %y = OpVariable %_ptr_Input_int Input + %int_10 = OpConstant %int 10 + %bool = OpTypeBool + %int_42 = OpConstant %int 42 + %int_23 = OpConstant %int 23 + %int_5 = OpConstant %int 5 +%_ptr_Output_int = OpTypePointer Output %int + %outparm = OpVariable %_ptr_Output_int Output + %main = OpFunction %void None %3 + %5 = OpLabel + %11 = OpLoad %int %y + OpBranch %21 + %16 = OpLabel + %20 = OpIAdd %int %11 %int_42 + OpBranch %17 + %21 = OpLabel + %24 = OpISub %int %11 %int_23 + OpBranch %17 + %17 = OpLabel + %31 = OpPhi %int %20 %16 %24 %21 + %27 = OpIAdd %int %31 %int_5 + OpStore %outparm %27 + OpReturn + OpFunctionEnd +)"; + + const std::string after = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %y %outparm +OpName %main "main" +OpName %y "y" +OpName %outparm "outparm" +OpDecorate %y Flat +OpDecorate %y Location 0 +OpDecorate %outparm Location 0 +%void = OpTypeVoid +%6 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%_ptr_Input_int = OpTypePointer Input %int +%y = OpVariable %_ptr_Input_int Input +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%int_42 = OpConstant %int 42 +%int_23 = OpConstant %int 23 +%int_5 = OpConstant %int 5 +%_ptr_Output_int = OpTypePointer Output %int +%outparm = OpVariable %_ptr_Output_int Output +%main = OpFunction %void None %6 +%16 = OpLabel +%17 = OpLoad %int %y +OpBranch %18 +%18 = OpLabel +%22 = OpISub %int %17 %int_23 +OpBranch %21 +%21 = OpLabel +%23 = OpPhi %int %22 %18 +%24 = OpIAdd %int %23 %int_5 +OpStore %outparm %24 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(before, after, true, true); +} + +TEST_F(CFGCleanupTest, RemoveNamedLabels) { + const std::string before = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" + OpSource GLSL 430 + OpName %main "main" + OpName %dead "dead" + %void = OpTypeVoid + %5 = OpTypeFunction %void + %main = OpFunction %void None %5 + %6 = OpLabel + OpReturn + %dead = OpLabel + OpReturn + OpFunctionEnd)"; + + const std::string after = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %main "main" +OpSource GLSL 430 +OpName %main "main" +%void = OpTypeVoid +%5 = OpTypeFunction %void +%main = OpFunction %void None %5 +%6 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(before, after, true, true); +} + +TEST_F(CFGCleanupTest, RemovePhiArgsFromFarBlocks) { + const std::string before = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %y %outparm + OpName %main "main" + OpName %y "y" + OpName %outparm "outparm" + OpDecorate %y Flat + OpDecorate %y Location 0 + OpDecorate %outparm Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%_ptr_Input_int = OpTypePointer Input %int + %y = OpVariable %_ptr_Input_int Input + %int_42 = OpConstant %int 42 +%_ptr_Output_int = OpTypePointer Output %int + %outparm = OpVariable %_ptr_Output_int Output + %int_14 = OpConstant %int 14 + %int_15 = OpConstant %int 15 + %int_5 = OpConstant %int 5 + %main = OpFunction %void None %3 + %5 = OpLabel + OpBranch %40 + %41 = OpLabel + %11 = OpLoad %int %y + OpBranch %40 + %40 = OpLabel + %12 = OpLoad %int %y + OpSelectionMerge %16 None + OpSwitch %12 %16 10 %13 13 %14 18 %15 + %13 = OpLabel + OpBranch %16 + %14 = OpLabel + OpStore %outparm %int_14 + OpBranch %16 + %15 = OpLabel + OpStore %outparm %int_15 + OpBranch %16 + %16 = OpLabel + %30 = OpPhi %int %11 %40 %int_42 %13 %11 %14 %11 %15 + %28 = OpIAdd %int %30 %int_5 + OpStore %outparm %28 + OpReturn + OpFunctionEnd)"; + + const std::string after = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %y %outparm +OpName %main "main" +OpName %y "y" +OpName %outparm "outparm" +OpDecorate %y Flat +OpDecorate %y Location 0 +OpDecorate %outparm Location 0 +%void = OpTypeVoid +%6 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%_ptr_Input_int = OpTypePointer Input %int +%y = OpVariable %_ptr_Input_int Input +%int_42 = OpConstant %int 42 +%_ptr_Output_int = OpTypePointer Output %int +%outparm = OpVariable %_ptr_Output_int Output +%int_14 = OpConstant %int 14 +%int_15 = OpConstant %int 15 +%int_5 = OpConstant %int 5 +%26 = OpUndef %int +%main = OpFunction %void None %6 +%15 = OpLabel +OpBranch %16 +%16 = OpLabel +%19 = OpLoad %int %y +OpSelectionMerge %20 None +OpSwitch %19 %20 10 %21 13 %22 18 %23 +%21 = OpLabel +OpBranch %20 +%22 = OpLabel +OpStore %outparm %int_14 +OpBranch %20 +%23 = OpLabel +OpStore %outparm %int_15 +OpBranch %20 +%20 = OpLabel +%24 = OpPhi %int %26 %16 %int_42 %21 %26 %22 %26 %23 +%25 = OpIAdd %int %24 %int_5 +OpStore %outparm %25 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(before, after, true, true); +} + +TEST_F(CFGCleanupTest, RemovePhiConstantArgs) { + const std::string before = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %y %outparm + OpName %main "main" + OpName %y "y" + OpName %outparm "outparm" + OpDecorate %y Flat + OpDecorate %y Location 0 + OpDecorate %outparm Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int + %y = OpVariable %_ptr_Input_int Input + %int_10 = OpConstant %int 10 + %bool = OpTypeBool +%_ptr_Function_int = OpTypePointer Function %int + %int_23 = OpConstant %int 23 + %int_5 = OpConstant %int 5 +%_ptr_Output_int = OpTypePointer Output %int + %outparm = OpVariable %_ptr_Output_int Output + %24 = OpUndef %int + %main = OpFunction %void None %3 + %5 = OpLabel + OpBranch %14 + %40 = OpLabel + %9 = OpLoad %int %y + %12 = OpSGreaterThan %bool %9 %int_10 + OpSelectionMerge %14 None + OpBranchConditional %12 %13 %14 + %13 = OpLabel + OpBranch %14 + %14 = OpLabel + %25 = OpPhi %int %24 %5 %int_23 %13 + %20 = OpIAdd %int %25 %int_5 + OpStore %outparm %20 + OpReturn + OpFunctionEnd)"; + + const std::string after = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %y %outparm +OpName %main "main" +OpName %y "y" +OpName %outparm "outparm" +OpDecorate %y Flat +OpDecorate %y Location 0 +OpDecorate %outparm Location 0 +%void = OpTypeVoid +%6 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%y = OpVariable %_ptr_Input_int Input +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%_ptr_Function_int = OpTypePointer Function %int +%int_23 = OpConstant %int 23 +%int_5 = OpConstant %int 5 +%_ptr_Output_int = OpTypePointer Output %int +%outparm = OpVariable %_ptr_Output_int Output +%15 = OpUndef %int +%main = OpFunction %void None %6 +%16 = OpLabel +OpBranch %17 +%17 = OpLabel +%22 = OpPhi %int %15 %16 +%23 = OpIAdd %int %22 %int_5 +OpStore %outparm %23 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(before, after, true, true); +} +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,313 @@ +# Copyright (c) 2016 Google 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. + +add_subdirectory(dominator_tree) +add_subdirectory(loop_optimizations) + +add_spvtools_unittest(TARGET instruction + SRCS instruction_test.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET instruction_list + SRCS instruction_list_test.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET ir_loader + SRCS ir_loader_test.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_manager + SRCS module_utils.h + pass_manager_test.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET optimizer + SRCS optimizer_test.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_strip_debug_info + SRCS strip_debug_info_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_strip_reflect_info + SRCS strip_reflect_info_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_compact_ids + SRCS compact_ids_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_flatten_decoration + SRCS flatten_decoration_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_freeze_spec_const + SRCS freeze_spec_const_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_block_merge + SRCS block_merge_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_inline + SRCS inline_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_inline_opaque + SRCS inline_opaque_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_insert_extract_elim + SRCS insert_extract_elim_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_dead_insert_elim + SRCS dead_insert_elim_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_local_ssa_elim + SRCS local_ssa_elim_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_local_single_block_elim + SRCS local_single_block_elim.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_local_access_chain_convert + SRCS local_access_chain_convert_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_local_single_store_elim + SRCS local_single_store_elim_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_dead_branch_elim + SRCS dead_branch_elim_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_dead_variable_elim + SRCS dead_variable_elim_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_aggressive_dce + SRCS aggressive_dead_code_elim_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_common_uniform_elim + SRCS common_uniform_elim_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_eliminate_dead_const + SRCS eliminate_dead_const_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_eliminate_dead_functions + SRCS eliminate_dead_functions_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_pass + SRCS pass_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_utils + SRCS utils_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET def_use + SRCS def_use_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET assembly_builder + SRCS assembly_builder_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET types + SRCS types_test.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET type_manager + SRCS type_manager_test.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET iterator + SRCS iterator_test.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET module + SRCS module_utils.h + module_test.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_fold_spec_const_op_composite + SRCS fold_spec_const_op_composite_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_unify_const + SRCS unify_const_test.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_set_spec_const_default_value + SRCS set_spec_const_default_value_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET line_debug_info + SRCS line_debug_info_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_strength_reduction + SRCS strength_reduction_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_scalar_replacement + SRCS scalar_replacement_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET cfg_cleanup + SRCS cfg_cleanup_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET ir_context + SRCS ir_context_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET feature_manager + SRCS feature_manager_test.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_merge_return + SRCS pass_merge_return_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET value_table + SRCS value_table_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET local_redundancy_elimination + SRCS local_redundancy_elimination_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET propagator + SRCS propagator_test.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET redundancy_elimination + SRCS redundancy_elimination_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET private_to_local + SRCS private_to_local_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET decoration_manager + SRCS decoration_manager_test.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_remove_duplicates + SRCS pass_remove_duplicates_test.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET ccp + SRCS ccp_test.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_workaround1209 + SRCS workaround1209_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET pass_if_conversion + SRCS if_conversion_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET ir_builder + SRCS ir_builder.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET instruction_folding + SRCS fold_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET replace_invalid_opc + SRCS replace_invalid_opc_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET simplification + SRCS simplification_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) +add_spvtools_unittest(TARGET copy_prop_array + SRCS copy_prop_array_test.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET scalar_analysis + SRCS scalar_analysis.cpp pass_utils.cpp + LIBS SPIRV-Tools-opt +) + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/common_uniform_elim_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/common_uniform_elim_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/common_uniform_elim_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/common_uniform_elim_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1162 @@ +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "pass_fixture.h" + +namespace { + +using namespace spvtools; + +using CommonUniformElimTest = PassTest<::testing::Test>; + +TEST_F(CommonUniformElimTest, Basic1) { + // Note: This test exemplifies the following: + // - Common uniform (%_) load floated to nearest non-controlled block + // - Common extract (g_F) floated to non-controlled block + // - Non-common extract (g_F2) not floated, but common uniform load shared + // + // #version 140 + // in vec4 BaseColor; + // in float fi; + // + // layout(std140) uniform U_t + // { + // float g_F; + // float g_F2; + // } ; + // + // void main() + // { + // vec4 v = BaseColor; + // if (fi > 0) { + // v = v * g_F; + // } + // else { + // float f2 = g_F2 - g_F; + // v = v * f2; + // } + // gl_FragColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %fi %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %fi "fi" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_F" +OpMemberName %U_t 1 "g_F2" +OpName %_ "" +OpName %f2 "f2" +OpName %gl_FragColor "gl_FragColor" +OpMemberDecorate %U_t 0 Offset 0 +OpMemberDecorate %U_t 1 Offset 4 +OpDecorate %U_t Block +OpDecorate %_ DescriptorSet 0 +%void = OpTypeVoid +%11 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float +%fi = OpVariable %_ptr_Input_float Input +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%U_t = OpTypeStruct %float %float +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%_ptr_Uniform_float = OpTypePointer Uniform %float +%_ptr_Function_float = OpTypePointer Function %float +%int_1 = OpConstant %int 1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %11 +%26 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%f2 = OpVariable %_ptr_Function_float Function +%27 = OpLoad %v4float %BaseColor +OpStore %v %27 +%28 = OpLoad %float %fi +%29 = OpFOrdGreaterThan %bool %28 %float_0 +OpSelectionMerge %30 None +OpBranchConditional %29 %31 %32 +%31 = OpLabel +%33 = OpLoad %v4float %v +%34 = OpAccessChain %_ptr_Uniform_float %_ %int_0 +%35 = OpLoad %float %34 +%36 = OpVectorTimesScalar %v4float %33 %35 +OpStore %v %36 +OpBranch %30 +%32 = OpLabel +%37 = OpAccessChain %_ptr_Uniform_float %_ %int_1 +%38 = OpLoad %float %37 +%39 = OpAccessChain %_ptr_Uniform_float %_ %int_0 +%40 = OpLoad %float %39 +%41 = OpFSub %float %38 %40 +OpStore %f2 %41 +%42 = OpLoad %v4float %v +%43 = OpLoad %float %f2 +%44 = OpVectorTimesScalar %v4float %42 %43 +OpStore %v %44 +OpBranch %30 +%30 = OpLabel +%45 = OpLoad %v4float %v +OpStore %gl_FragColor %45 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %11 +%26 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%f2 = OpVariable %_ptr_Function_float Function +%52 = OpLoad %U_t %_ +%53 = OpCompositeExtract %float %52 0 +%27 = OpLoad %v4float %BaseColor +OpStore %v %27 +%28 = OpLoad %float %fi +%29 = OpFOrdGreaterThan %bool %28 %float_0 +OpSelectionMerge %30 None +OpBranchConditional %29 %31 %32 +%31 = OpLabel +%33 = OpLoad %v4float %v +%36 = OpVectorTimesScalar %v4float %33 %53 +OpStore %v %36 +OpBranch %30 +%32 = OpLabel +%49 = OpCompositeExtract %float %52 1 +%41 = OpFSub %float %49 %53 +OpStore %f2 %41 +%42 = OpLoad %v4float %v +%43 = OpLoad %float %f2 +%44 = OpVectorTimesScalar %v4float %42 %43 +OpStore %v %44 +OpBranch %30 +%30 = OpLabel +%45 = OpLoad %v4float %v +OpStore %gl_FragColor %45 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(CommonUniformElimTest, Basic2) { + // Note: This test exemplifies the following: + // - Common uniform (%_) load floated to nearest non-controlled block + // - Common extract (g_F) floated to non-controlled block + // - Non-common extract (g_F2) not floated, but common uniform load shared + // + // #version 140 + // in vec4 BaseColor; + // in float fi; + // in float fi2; + // + // layout(std140) uniform U_t + // { + // float g_F; + // float g_F2; + // } ; + // + // void main() + // { + // float f = fi; + // if (f < 0) + // f = -f; + // if (fi2 > 0) { + // f = f * g_F; + // } + // else { + // f = g_F2 - g_F; + // } + // gl_FragColor = f * BaseColor; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %fi %fi2 %gl_FragColor %BaseColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %f "f" +OpName %fi "fi" +OpName %fi2 "fi2" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_F" +OpMemberName %U_t 1 "g_F2" +OpName %_ "" +OpName %gl_FragColor "gl_FragColor" +OpName %BaseColor "BaseColor" +OpMemberDecorate %U_t 0 Offset 0 +OpMemberDecorate %U_t 1 Offset 4 +OpDecorate %U_t Block +OpDecorate %_ DescriptorSet 0 +%void = OpTypeVoid +%11 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%_ptr_Input_float = OpTypePointer Input %float +%fi = OpVariable %_ptr_Input_float Input +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%fi2 = OpVariable %_ptr_Input_float Input +%U_t = OpTypeStruct %float %float +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%_ptr_Uniform_float = OpTypePointer Uniform %float +%int_1 = OpConstant %int 1 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +)"; + + const std::string before = + R"(%main = OpFunction %void None %11 +%25 = OpLabel +%f = OpVariable %_ptr_Function_float Function +%26 = OpLoad %float %fi +OpStore %f %26 +%27 = OpLoad %float %f +%28 = OpFOrdLessThan %bool %27 %float_0 +OpSelectionMerge %29 None +OpBranchConditional %28 %30 %29 +%30 = OpLabel +%31 = OpLoad %float %f +%32 = OpFNegate %float %31 +OpStore %f %32 +OpBranch %29 +%29 = OpLabel +%33 = OpLoad %float %fi2 +%34 = OpFOrdGreaterThan %bool %33 %float_0 +OpSelectionMerge %35 None +OpBranchConditional %34 %36 %37 +%36 = OpLabel +%38 = OpLoad %float %f +%39 = OpAccessChain %_ptr_Uniform_float %_ %int_0 +%40 = OpLoad %float %39 +%41 = OpFMul %float %38 %40 +OpStore %f %41 +OpBranch %35 +%37 = OpLabel +%42 = OpAccessChain %_ptr_Uniform_float %_ %int_1 +%43 = OpLoad %float %42 +%44 = OpAccessChain %_ptr_Uniform_float %_ %int_0 +%45 = OpLoad %float %44 +%46 = OpFSub %float %43 %45 +OpStore %f %46 +OpBranch %35 +%35 = OpLabel +%47 = OpLoad %v4float %BaseColor +%48 = OpLoad %float %f +%49 = OpVectorTimesScalar %v4float %47 %48 +OpStore %gl_FragColor %49 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %11 +%25 = OpLabel +%f = OpVariable %_ptr_Function_float Function +%26 = OpLoad %float %fi +OpStore %f %26 +%27 = OpLoad %float %f +%28 = OpFOrdLessThan %bool %27 %float_0 +OpSelectionMerge %29 None +OpBranchConditional %28 %30 %29 +%30 = OpLabel +%31 = OpLoad %float %f +%32 = OpFNegate %float %31 +OpStore %f %32 +OpBranch %29 +%29 = OpLabel +%56 = OpLoad %U_t %_ +%57 = OpCompositeExtract %float %56 0 +%33 = OpLoad %float %fi2 +%34 = OpFOrdGreaterThan %bool %33 %float_0 +OpSelectionMerge %35 None +OpBranchConditional %34 %36 %37 +%36 = OpLabel +%38 = OpLoad %float %f +%41 = OpFMul %float %38 %57 +OpStore %f %41 +OpBranch %35 +%37 = OpLabel +%53 = OpCompositeExtract %float %56 1 +%46 = OpFSub %float %53 %57 +OpStore %f %46 +OpBranch %35 +%35 = OpLabel +%47 = OpLoad %v4float %BaseColor +%48 = OpLoad %float %f +%49 = OpVectorTimesScalar %v4float %47 %48 +OpStore %gl_FragColor %49 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(CommonUniformElimTest, Basic3) { + // Note: This test exemplifies the following: + // - Existing common uniform (%_) load kept in place and shared + // + // #version 140 + // in vec4 BaseColor; + // in float fi; + // + // layout(std140) uniform U_t + // { + // bool g_B; + // float g_F; + // } ; + // + // void main() + // { + // vec4 v = BaseColor; + // if (g_B) + // v = v * g_F; + // gl_FragColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor %fi +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_B" +OpMemberName %U_t 1 "g_F" +OpName %_ "" +OpName %gl_FragColor "gl_FragColor" +OpName %fi "fi" +OpMemberDecorate %U_t 0 Offset 0 +OpMemberDecorate %U_t 1 Offset 4 +OpDecorate %U_t Block +OpDecorate %_ DescriptorSet 0 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%uint = OpTypeInt 32 0 +%U_t = OpTypeStruct %uint %float +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%_ptr_Uniform_uint = OpTypePointer Uniform %uint +%bool = OpTypeBool +%uint_0 = OpConstant %uint 0 +%int_1 = OpConstant %int 1 +%_ptr_Uniform_float = OpTypePointer Uniform %float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%_ptr_Input_float = OpTypePointer Input %float +%fi = OpVariable %_ptr_Input_float Input +)"; + + const std::string before = + R"(%main = OpFunction %void None %10 +%26 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%27 = OpLoad %v4float %BaseColor +OpStore %v %27 +%28 = OpAccessChain %_ptr_Uniform_uint %_ %int_0 +%29 = OpLoad %uint %28 +%30 = OpINotEqual %bool %29 %uint_0 +OpSelectionMerge %31 None +OpBranchConditional %30 %32 %31 +%32 = OpLabel +%33 = OpLoad %v4float %v +%34 = OpAccessChain %_ptr_Uniform_float %_ %int_1 +%35 = OpLoad %float %34 +%36 = OpVectorTimesScalar %v4float %33 %35 +OpStore %v %36 +OpBranch %31 +%31 = OpLabel +%37 = OpLoad %v4float %v +OpStore %gl_FragColor %37 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %10 +%26 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%27 = OpLoad %v4float %BaseColor +OpStore %v %27 +%38 = OpLoad %U_t %_ +%39 = OpCompositeExtract %uint %38 0 +%30 = OpINotEqual %bool %39 %uint_0 +OpSelectionMerge %31 None +OpBranchConditional %30 %32 %31 +%32 = OpLabel +%33 = OpLoad %v4float %v +%41 = OpCompositeExtract %float %38 1 +%36 = OpVectorTimesScalar %v4float %33 %41 +OpStore %v %36 +OpBranch %31 +%31 = OpLabel +%37 = OpLoad %v4float %v +OpStore %gl_FragColor %37 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(CommonUniformElimTest, Loop) { + // Note: This test exemplifies the following: + // - Common extract (g_F) shared between two loops + // #version 140 + // in vec4 BC; + // in vec4 BC2; + // + // layout(std140) uniform U_t + // { + // float g_F; + // } ; + // + // void main() + // { + // vec4 v = BC; + // for (int i = 0; i < 4; i++) + // v[i] = v[i] / g_F; + // vec4 v2 = BC2; + // for (int i = 0; i < 4; i++) + // v2[i] = v2[i] * g_F; + // gl_FragColor = v + v2; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BC %BC2 %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BC "BC" +OpName %i "i" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_F" +OpName %_ "" +OpName %v2 "v2" +OpName %BC2 "BC2" +OpName %i_0 "i" +OpName %gl_FragColor "gl_FragColor" +OpMemberDecorate %U_t 0 Offset 0 +OpDecorate %U_t Block +OpDecorate %_ DescriptorSet 0 +%void = OpTypeVoid +%13 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BC = OpVariable %_ptr_Input_v4float Input +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_4 = OpConstant %int 4 +%bool = OpTypeBool +%_ptr_Function_float = OpTypePointer Function %float +%U_t = OpTypeStruct %float +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%_ptr_Uniform_float = OpTypePointer Uniform %float +%int_1 = OpConstant %int 1 +%BC2 = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %13 +%28 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%i = OpVariable %_ptr_Function_int Function +%v2 = OpVariable %_ptr_Function_v4float Function +%i_0 = OpVariable %_ptr_Function_int Function +%29 = OpLoad %v4float %BC +OpStore %v %29 +OpStore %i %int_0 +OpBranch %30 +%30 = OpLabel +OpLoopMerge %31 %32 None +OpBranch %33 +%33 = OpLabel +%34 = OpLoad %int %i +%35 = OpSLessThan %bool %34 %int_4 +OpBranchConditional %35 %36 %31 +%36 = OpLabel +%37 = OpLoad %int %i +%38 = OpLoad %int %i +%39 = OpAccessChain %_ptr_Function_float %v %38 +%40 = OpLoad %float %39 +%41 = OpAccessChain %_ptr_Uniform_float %_ %int_0 +%42 = OpLoad %float %41 +%43 = OpFDiv %float %40 %42 +%44 = OpAccessChain %_ptr_Function_float %v %37 +OpStore %44 %43 +OpBranch %32 +%32 = OpLabel +%45 = OpLoad %int %i +%46 = OpIAdd %int %45 %int_1 +OpStore %i %46 +OpBranch %30 +%31 = OpLabel +%47 = OpLoad %v4float %BC2 +OpStore %v2 %47 +OpStore %i_0 %int_0 +OpBranch %48 +%48 = OpLabel +OpLoopMerge %49 %50 None +OpBranch %51 +%51 = OpLabel +%52 = OpLoad %int %i_0 +%53 = OpSLessThan %bool %52 %int_4 +OpBranchConditional %53 %54 %49 +%54 = OpLabel +%55 = OpLoad %int %i_0 +%56 = OpLoad %int %i_0 +%57 = OpAccessChain %_ptr_Function_float %v2 %56 +%58 = OpLoad %float %57 +%59 = OpAccessChain %_ptr_Uniform_float %_ %int_0 +%60 = OpLoad %float %59 +%61 = OpFMul %float %58 %60 +%62 = OpAccessChain %_ptr_Function_float %v2 %55 +OpStore %62 %61 +OpBranch %50 +%50 = OpLabel +%63 = OpLoad %int %i_0 +%64 = OpIAdd %int %63 %int_1 +OpStore %i_0 %64 +OpBranch %48 +%49 = OpLabel +%65 = OpLoad %v4float %v +%66 = OpLoad %v4float %v2 +%67 = OpFAdd %v4float %65 %66 +OpStore %gl_FragColor %67 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %13 +%28 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%i = OpVariable %_ptr_Function_int Function +%v2 = OpVariable %_ptr_Function_v4float Function +%i_0 = OpVariable %_ptr_Function_int Function +%72 = OpLoad %U_t %_ +%73 = OpCompositeExtract %float %72 0 +%29 = OpLoad %v4float %BC +OpStore %v %29 +OpStore %i %int_0 +OpBranch %30 +%30 = OpLabel +OpLoopMerge %31 %32 None +OpBranch %33 +%33 = OpLabel +%34 = OpLoad %int %i +%35 = OpSLessThan %bool %34 %int_4 +OpBranchConditional %35 %36 %31 +%36 = OpLabel +%37 = OpLoad %int %i +%38 = OpLoad %int %i +%39 = OpAccessChain %_ptr_Function_float %v %38 +%40 = OpLoad %float %39 +%43 = OpFDiv %float %40 %73 +%44 = OpAccessChain %_ptr_Function_float %v %37 +OpStore %44 %43 +OpBranch %32 +%32 = OpLabel +%45 = OpLoad %int %i +%46 = OpIAdd %int %45 %int_1 +OpStore %i %46 +OpBranch %30 +%31 = OpLabel +%47 = OpLoad %v4float %BC2 +OpStore %v2 %47 +OpStore %i_0 %int_0 +OpBranch %48 +%48 = OpLabel +OpLoopMerge %49 %50 None +OpBranch %51 +%51 = OpLabel +%52 = OpLoad %int %i_0 +%53 = OpSLessThan %bool %52 %int_4 +OpBranchConditional %53 %54 %49 +%54 = OpLabel +%55 = OpLoad %int %i_0 +%56 = OpLoad %int %i_0 +%57 = OpAccessChain %_ptr_Function_float %v2 %56 +%58 = OpLoad %float %57 +%61 = OpFMul %float %58 %73 +%62 = OpAccessChain %_ptr_Function_float %v2 %55 +OpStore %62 %61 +OpBranch %50 +%50 = OpLabel +%63 = OpLoad %int %i_0 +%64 = OpIAdd %int %63 %int_1 +OpStore %i_0 %64 +OpBranch %48 +%49 = OpLabel +%65 = OpLoad %v4float %v +%66 = OpLoad %v4float %v2 +%67 = OpFAdd %v4float %65 %66 +OpStore %gl_FragColor %67 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(CommonUniformElimTest, Volatile1) { + // Note: This test exemplifies the following: + // - Same test as Basic1 with the exception that + // the Load of g_F in else-branch is volatile + // - Common uniform (%_) load floated to nearest non-controlled block + // + // #version 140 + // in vec4 BaseColor; + // in float fi; + // + // layout(std140) uniform U_t + // { + // float g_F; + // float g_F2; + // } ; + // + // void main() + // { + // vec4 v = BaseColor; + // if (fi > 0) { + // v = v * g_F; + // } + // else { + // float f2 = g_F2 - g_F; + // v = v * f2; + // } + // gl_FragColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %fi %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %fi "fi" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_F" +OpMemberName %U_t 1 "g_F2" +OpName %_ "" +OpName %f2 "f2" +OpName %gl_FragColor "gl_FragColor" +OpMemberDecorate %U_t 0 Offset 0 +OpMemberDecorate %U_t 1 Offset 4 +OpDecorate %U_t Block +OpDecorate %_ DescriptorSet 0 +%void = OpTypeVoid +%11 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float +%fi = OpVariable %_ptr_Input_float Input +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%U_t = OpTypeStruct %float %float +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%_ptr_Uniform_float = OpTypePointer Uniform %float +%_ptr_Function_float = OpTypePointer Function %float +%int_1 = OpConstant %int 1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %11 +%26 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%f2 = OpVariable %_ptr_Function_float Function +%27 = OpLoad %v4float %BaseColor +OpStore %v %27 +%28 = OpLoad %float %fi +%29 = OpFOrdGreaterThan %bool %28 %float_0 +OpSelectionMerge %30 None +OpBranchConditional %29 %31 %32 +%31 = OpLabel +%33 = OpLoad %v4float %v +%34 = OpAccessChain %_ptr_Uniform_float %_ %int_0 +%35 = OpLoad %float %34 +%36 = OpVectorTimesScalar %v4float %33 %35 +OpStore %v %36 +OpBranch %30 +%32 = OpLabel +%37 = OpAccessChain %_ptr_Uniform_float %_ %int_1 +%38 = OpLoad %float %37 +%39 = OpAccessChain %_ptr_Uniform_float %_ %int_0 +%40 = OpLoad %float %39 Volatile +%41 = OpFSub %float %38 %40 +OpStore %f2 %41 +%42 = OpLoad %v4float %v +%43 = OpLoad %float %f2 +%44 = OpVectorTimesScalar %v4float %42 %43 +OpStore %v %44 +OpBranch %30 +%30 = OpLabel +%45 = OpLoad %v4float %v +OpStore %gl_FragColor %45 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %11 +%26 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%f2 = OpVariable %_ptr_Function_float Function +%50 = OpLoad %U_t %_ +%27 = OpLoad %v4float %BaseColor +OpStore %v %27 +%28 = OpLoad %float %fi +%29 = OpFOrdGreaterThan %bool %28 %float_0 +OpSelectionMerge %30 None +OpBranchConditional %29 %31 %32 +%31 = OpLabel +%33 = OpLoad %v4float %v +%47 = OpCompositeExtract %float %50 0 +%36 = OpVectorTimesScalar %v4float %33 %47 +OpStore %v %36 +OpBranch %30 +%32 = OpLabel +%49 = OpCompositeExtract %float %50 1 +%39 = OpAccessChain %_ptr_Uniform_float %_ %int_0 +%40 = OpLoad %float %39 Volatile +%41 = OpFSub %float %49 %40 +OpStore %f2 %41 +%42 = OpLoad %v4float %v +%43 = OpLoad %float %f2 +%44 = OpVectorTimesScalar %v4float %42 %43 +OpStore %v %44 +OpBranch %30 +%30 = OpLabel +%45 = OpLoad %v4float %v +OpStore %gl_FragColor %45 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(CommonUniformElimTest, Volatile2) { + // Note: This test exemplifies the following: + // - Same test as Basic1 with the exception that + // U_t is Volatile. + // - No optimizations are applied + // + // #version 430 + // in vec4 BaseColor; + // in float fi; + // + // layout(std430) volatile buffer U_t + // { + // float g_F; + // float g_F2; + // }; + // + // + // void main(void) + // { + // vec4 v = BaseColor; + // if (fi > 0) { + // v = v * g_F; + // } else { + // float f2 = g_F2 - g_F; + // v = v * f2; + // } + // } + + const std::string text = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %fi +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 430 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %fi "fi" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_F" +OpMemberName %U_t 1 "g_F2" +OpName %_ "" +OpName %f2 "f2" +OpDecorate %BaseColor Location 0 +OpDecorate %fi Location 0 +OpMemberDecorate %U_t 0 Volatile +OpMemberDecorate %U_t 0 Offset 0 +OpMemberDecorate %U_t 1 Volatile +OpMemberDecorate %U_t 1 Offset 4 +OpDecorate %U_t BufferBlock +OpDecorate %_ DescriptorSet 0 +%void = OpTypeVoid +%3 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float +%fi = OpVariable %_ptr_Input_float Input +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%U_t = OpTypeStruct %float %float +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%_ptr_Uniform_float = OpTypePointer Uniform %float +%_ptr_Function_float = OpTypePointer Function %float +%int_1 = OpConstant %int 1 +%main = OpFunction %void None %3 +%5 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%f2 = OpVariable %_ptr_Function_float Function +%12 = OpLoad %v4float %BaseColor +OpStore %v %12 +%15 = OpLoad %float %fi +%18 = OpFOrdGreaterThan %bool %15 %float_0 +OpSelectionMerge %20 None +OpBranchConditional %18 %19 %31 +%19 = OpLabel +%21 = OpLoad %v4float %v +%28 = OpAccessChain %_ptr_Uniform_float %_ %int_0 +%29 = OpLoad %float %28 +%30 = OpVectorTimesScalar %v4float %21 %29 +OpStore %v %30 +OpBranch %20 +%31 = OpLabel +%35 = OpAccessChain %_ptr_Uniform_float %_ %int_1 +%36 = OpLoad %float %35 +%37 = OpAccessChain %_ptr_Uniform_float %_ %int_0 +%38 = OpLoad %float %37 +%39 = OpFSub %float %36 %38 +OpStore %f2 %39 +%40 = OpLoad %v4float %v +%41 = OpLoad %float %f2 +%42 = OpVectorTimesScalar %v4float %40 %41 +OpStore %v %42 +OpBranch %20 +%20 = OpLabel +OpReturn +OpFunctionEnd +)"; + + opt::Pass::Status res = + std::get<1>(SinglePassRunAndDisassemble( + text, true, false)); + EXPECT_EQ(res, opt::Pass::Status::SuccessWithoutChange); +} + +TEST_F(CommonUniformElimTest, Volatile3) { + // Note: This test exemplifies the following: + // - Same test as Volatile2 with the exception that + // the nested struct S is volatile + // - No optimizations are applied + // + // #version 430 + // in vec4 BaseColor; + // in float fi; + // + // struct S { + // volatile float a; + // }; + // + // layout(std430) buffer U_t + // { + // S g_F; + // S g_F2; + // }; + // + // + // void main(void) + // { + // vec4 v = BaseColor; + // if (fi > 0) { + // v = v * g_F.a; + // } else { + // float f2 = g_F2.a - g_F.a; + // v = v * f2; + // } + // } + + const std::string text = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %fi +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 430 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %fi "fi" +OpName %S "S" +OpMemberName %S 0 "a" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_F" +OpMemberName %U_t 1 "g_F2" +OpName %_ "" +OpName %f2 "f2" +OpDecorate %BaseColor Location 0 +OpDecorate %fi Location 0 +OpMemberDecorate %S 0 Offset 0 +OpMemberDecorate %S 0 Volatile +OpMemberDecorate %U_t 0 Offset 0 +OpMemberDecorate %U_t 1 Offset 4 +OpDecorate %U_t BufferBlock +OpDecorate %_ DescriptorSet 0 +%void = OpTypeVoid +%3 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float +%fi = OpVariable %_ptr_Input_float Input +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%S = OpTypeStruct %float +%U_t = OpTypeStruct %S %S +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%_ptr_Uniform_float = OpTypePointer Uniform %float +%_ptr_Function_float = OpTypePointer Function %float +%int_1 = OpConstant %int 1 +%main = OpFunction %void None %3 +%5 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%f2 = OpVariable %_ptr_Function_float Function +%12 = OpLoad %v4float %BaseColor +OpStore %v %12 +%15 = OpLoad %float %fi +%18 = OpFOrdGreaterThan %bool %15 %float_0 +OpSelectionMerge %20 None +OpBranchConditional %18 %19 %32 +%19 = OpLabel +%21 = OpLoad %v4float %v +%29 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_0 +%30 = OpLoad %float %29 +%31 = OpVectorTimesScalar %v4float %21 %30 +OpStore %v %31 +OpBranch %20 +%32 = OpLabel +%36 = OpAccessChain %_ptr_Uniform_float %_ %int_1 %int_0 +%37 = OpLoad %float %36 +%38 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_0 +%39 = OpLoad %float %38 +%40 = OpFSub %float %37 %39 +OpStore %f2 %40 +%41 = OpLoad %v4float %v +%42 = OpLoad %float %f2 +%43 = OpVectorTimesScalar %v4float %41 %42 +OpStore %v %43 +OpBranch %20 +%20 = OpLabel +OpReturn +OpFunctionEnd +)"; + + opt::Pass::Status res = + std::get<1>(SinglePassRunAndDisassemble( + text, true, false)); + EXPECT_EQ(res, opt::Pass::Status::SuccessWithoutChange); +} + +#ifdef SPIRV_EFFCEE +TEST_F(CommonUniformElimTest, MixedConstantAndNonConstantIndexes) { + const std::string text = R"( +; CHECK: [[var:%\w+]] = OpVariable {{%\w+}} Uniform +; CHECK: %501 = OpLabel +; CHECK: [[ld:%\w+]] = OpLoad +; CHECK-NOT: OpCompositeExtract {{%\w+}} {{%\w+}} 0 2 484 +; CHECK: OpAccessChain {{%\w+}} [[var]] %int_0 %int_2 [[ld]] + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "ringeffectLayer_px" %gl_FragCoord %178 %182 + OpExecutionMode %4 OriginUpperLeft + OpSource HLSL 500 + OpDecorate %_arr_v4float_uint_10 ArrayStride 16 + OpMemberDecorate %_struct_20 0 Offset 0 + OpMemberDecorate %_struct_20 1 Offset 16 + OpMemberDecorate %_struct_20 2 Offset 32 + OpMemberDecorate %_struct_21 0 Offset 0 + OpDecorate %_struct_21 Block + OpDecorate %23 DescriptorSet 0 + OpDecorate %gl_FragCoord BuiltIn FragCoord + OpDecorate %178 Location 0 + OpDecorate %182 Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %v2float = OpTypeVector %float 2 +%_ptr_Function_v2float = OpTypePointer Function %v2float + %uint = OpTypeInt 32 0 + %uint_10 = OpConstant %uint 10 +%_arr_v4float_uint_10 = OpTypeArray %v4float %uint_10 + %_struct_20 = OpTypeStruct %v4float %v4float %_arr_v4float_uint_10 + %_struct_21 = OpTypeStruct %_struct_20 +%_ptr_Uniform__struct_21 = OpTypePointer Uniform %_struct_21 + %23 = OpVariable %_ptr_Uniform__struct_21 Uniform + %int = OpTypeInt 32 1 + %int_0 = OpConstant %int 0 +%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float +%_ptr_Uniform_float = OpTypePointer Uniform %float + %uint_3 = OpConstant %uint 3 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_0 = OpConstant %float 0 + %43 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%_ptr_Function_int = OpTypePointer Function %int + %int_5 = OpConstant %int 5 + %bool = OpTypeBool + %int_1 = OpConstant %int 1 + %int_2 = OpConstant %int 2 + %uint_5 = OpConstant %uint 5 +%_arr_v2float_uint_5 = OpTypeArray %v2float %uint_5 +%_ptr_Function__arr_v2float_uint_5 = OpTypePointer Function %_arr_v2float_uint_5 + %82 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_82 = OpTypePointer UniformConstant %82 + %86 = OpTypeSampler +%_ptr_UniformConstant_86 = OpTypePointer UniformConstant %86 + %90 = OpTypeSampledImage %82 + %v3float = OpTypeVector %float 3 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%gl_FragCoord = OpVariable %_ptr_Input_v4float Input + %178 = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float + %182 = OpVariable %_ptr_Output_v4float Output + %4 = OpFunction %void None %3 + %5 = OpLabel + %483 = OpVariable %_ptr_Function_v4float Function + %484 = OpVariable %_ptr_Function_int Function + %486 = OpVariable %_ptr_Function__arr_v2float_uint_5 Function + %179 = OpLoad %v4float %178 + %493 = OpAccessChain %_ptr_Uniform_float %23 %int_0 %int_0 %uint_3 + %494 = OpLoad %float %493 + OpStore %483 %43 + OpStore %484 %int_0 + OpBranch %495 + %495 = OpLabel + OpLoopMerge %496 %497 None + OpBranch %498 + %498 = OpLabel + %499 = OpLoad %int %484 + %500 = OpSLessThan %bool %499 %int_5 + OpBranchConditional %500 %501 %496 + %501 = OpLabel + %504 = OpVectorShuffle %v2float %179 %179 0 1 + %505 = OpLoad %int %484 + %506 = OpAccessChain %_ptr_Uniform_v4float %23 %int_0 %int_2 %505 + %507 = OpLoad %v4float %506 + %508 = OpVectorShuffle %v2float %507 %507 0 1 + %509 = OpFAdd %v2float %504 %508 + %512 = OpAccessChain %_ptr_Uniform_v4float %23 %int_0 %int_1 + %513 = OpLoad %v4float %512 + %514 = OpVectorShuffle %v2float %513 %513 0 1 + %517 = OpVectorShuffle %v2float %513 %513 2 3 + %518 = OpExtInst %v2float %1 FClamp %509 %514 %517 + %519 = OpAccessChain %_ptr_Function_v2float %486 %505 + OpStore %519 %518 + OpBranch %497 + %497 = OpLabel + %520 = OpLoad %int %484 + %521 = OpIAdd %int %520 %int_1 + OpStore %484 %521 + OpBranch %495 + %496 = OpLabel + OpReturn + OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndMatch(text, true); +} +#endif // SPIRV_EFFCEE +// TODO(greg-lunarg): Add tests to verify handling of these cases: +// +// Disqualifying cases: extensions, decorations, non-logical addressing, +// non-structured control flow +// Others? + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/compact_ids_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/compact_ids_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/compact_ids_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/compact_ids_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,195 @@ +// Copyright (c) 2017 Google 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. + +#include + +#include "spirv-tools/libspirv.hpp" +#include "spirv-tools/optimizer.hpp" + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using CompactIdsTest = PassTest<::testing::Test>; + +TEST_F(CompactIdsTest, PassOff) { + const std::string before = + R"(OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +%99 = OpTypeInt 32 0 +%10 = OpTypeVector %99 2 +%20 = OpConstant %99 2 +%30 = OpTypeArray %99 %20 +)"; + + const std::string after = before; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(before, after, false, false); +} + +TEST_F(CompactIdsTest, PassOn) { + const std::string before = + R"(OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +OpEntryPoint Kernel %3 "simple_kernel" +%99 = OpTypeInt 32 0 +%10 = OpTypeVector %99 2 +%20 = OpConstant %99 2 +%30 = OpTypeArray %99 %20 +%40 = OpTypeVoid +%50 = OpTypeFunction %40 + %3 = OpFunction %40 None %50 +%70 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +OpEntryPoint Kernel %1 "simple_kernel" +%2 = OpTypeInt 32 0 +%3 = OpTypeVector %2 2 +%4 = OpConstant %2 2 +%5 = OpTypeArray %2 %4 +%6 = OpTypeVoid +%7 = OpTypeFunction %6 +%1 = OpFunction %6 None %7 +%8 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(before, after, false, false); +} + +TEST(CompactIds, InstructionResultIsUpdated) { + // For https://github.com/KhronosGroup/SPIRV-Tools/issues/827 + // In that bug, the compact Ids pass was directly updating the result Id + // word for an OpFunction instruction, but not updating the cached + // result_id_ in that Instruction object. + // + // This test is a bit cheesy. We don't expose internal interfaces enough + // to see the inconsistency. So reproduce the original scenario, with + // compact ids followed by a pass that trips up on the inconsistency. + + const std::string input(R"(OpCapability Shader +OpMemoryModel Logical Simple +OpEntryPoint GLCompute %100 "main" +%200 = OpTypeVoid +%300 = OpTypeFunction %200 +%100 = OpFunction %300 None %200 +%400 = OpLabel +OpReturn +OpFunctionEnd +)"); + + std::vector binary; + const spv_target_env env = SPV_ENV_UNIVERSAL_1_0; + spvtools::SpirvTools tools(env); + auto assembled = tools.Assemble( + input, &binary, SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_TRUE(assembled); + + spvtools::Optimizer optimizer(env); + optimizer.RegisterPass(CreateCompactIdsPass()); + // The exhaustive inliner will use the result_id + optimizer.RegisterPass(CreateInlineExhaustivePass()); + + // This should not crash! + optimizer.Run(binary.data(), binary.size(), &binary); + + std::string disassembly; + tools.Disassemble(binary, &disassembly, SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + + const std::string expected(R"(OpCapability Shader +OpMemoryModel Logical Simple +OpEntryPoint GLCompute %1 "main" +%2 = OpTypeVoid +%3 = OpTypeFunction %2 +%1 = OpFunction %3 None %2 +%4 = OpLabel +OpReturn +OpFunctionEnd +)"); + + EXPECT_THAT(disassembly, ::testing::Eq(expected)); +} + +TEST(CompactIds, HeaderIsUpdated) { + const std::string input(R"(OpCapability Shader +OpMemoryModel Logical Simple +OpEntryPoint GLCompute %100 "main" +%200 = OpTypeVoid +%300 = OpTypeFunction %200 +%100 = OpFunction %300 None %200 +%400 = OpLabel +OpReturn +OpFunctionEnd +)"); + + std::vector binary; + const spv_target_env env = SPV_ENV_UNIVERSAL_1_0; + spvtools::SpirvTools tools(env); + auto assembled = tools.Assemble( + input, &binary, SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_TRUE(assembled); + + spvtools::Optimizer optimizer(env); + optimizer.RegisterPass(CreateCompactIdsPass()); + // The exhaustive inliner will use the result_id + optimizer.RegisterPass(CreateInlineExhaustivePass()); + + // This should not crash! + optimizer.Run(binary.data(), binary.size(), &binary); + + std::string disassembly; + tools.Disassemble(binary, &disassembly, SPV_BINARY_TO_TEXT_OPTION_NONE); + + const std::string expected(R"(; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 5 +; Schema: 0 +OpCapability Shader +OpMemoryModel Logical Simple +OpEntryPoint GLCompute %1 "main" +%2 = OpTypeVoid +%3 = OpTypeFunction %2 +%1 = OpFunction %3 None %2 +%4 = OpLabel +OpReturn +OpFunctionEnd +)"); + + EXPECT_THAT(disassembly, ::testing::Eq(expected)); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/copy_prop_array_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/copy_prop_array_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/copy_prop_array_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/copy_prop_array_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1184 @@ +// Copyright (c) 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include + +#include "assembly_builder.h" +#include "pass_fixture.h" + +namespace { + +using namespace spvtools; +using ir::Instruction; +using ir::IRContext; +using opt::PassManager; + +using CopyPropArrayPassTest = PassTest<::testing::Test>; + +#ifdef SPIRV_EFFCEE +TEST_F(CopyPropArrayPassTest, BasicPropagateArray) { + const std::string before = + R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %in_var_INDEX %out_var_SV_Target +OpExecutionMode %main OriginUpperLeft +OpSource HLSL 600 +OpName %type_MyCBuffer "type.MyCBuffer" +OpMemberName %type_MyCBuffer 0 "Data" +OpName %MyCBuffer "MyCBuffer" +OpName %main "main" +OpName %in_var_INDEX "in.var.INDEX" +OpName %out_var_SV_Target "out.var.SV_Target" +OpDecorate %_arr_v4float_uint_8 ArrayStride 16 +OpMemberDecorate %type_MyCBuffer 0 Offset 0 +OpDecorate %type_MyCBuffer Block +OpDecorate %in_var_INDEX Flat +OpDecorate %in_var_INDEX Location 0 +OpDecorate %out_var_SV_Target Location 0 +OpDecorate %MyCBuffer DescriptorSet 0 +OpDecorate %MyCBuffer Binding 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%uint = OpTypeInt 32 0 +%uint_8 = OpConstant %uint 8 +%_arr_v4float_uint_8 = OpTypeArray %v4float %uint_8 +%type_MyCBuffer = OpTypeStruct %_arr_v4float_uint_8 +%_ptr_Uniform_type_MyCBuffer = OpTypePointer Uniform %type_MyCBuffer +%void = OpTypeVoid +%13 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_arr_v4float_uint_8_0 = OpTypeArray %v4float %uint_8 +%_ptr_Function__arr_v4float_uint_8_0 = OpTypePointer Function %_arr_v4float_uint_8_0 +%int_0 = OpConstant %int 0 +%_ptr_Uniform__arr_v4float_uint_8 = OpTypePointer Uniform %_arr_v4float_uint_8 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%MyCBuffer = OpVariable %_ptr_Uniform_type_MyCBuffer Uniform +%in_var_INDEX = OpVariable %_ptr_Input_int Input +%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output +; CHECK: OpFunction +; CHECK: OpLabel +; CHECK: OpVariable +; CHECK: OpAccessChain +; CHECK: [[new_address:%\w+]] = OpAccessChain %_ptr_Uniform__arr_v4float_uint_8 %MyCBuffer %int_0 +; CHECK: [[element_ptr:%\w+]] = OpAccessChain %_ptr_Uniform_v4float [[new_address]] %24 +; CHECK: [[load:%\w+]] = OpLoad %v4float [[element_ptr]] +; CHECK: OpStore %out_var_SV_Target [[load]] +%main = OpFunction %void None %13 +%22 = OpLabel +%23 = OpVariable %_ptr_Function__arr_v4float_uint_8_0 Function +%24 = OpLoad %int %in_var_INDEX +%25 = OpAccessChain %_ptr_Uniform__arr_v4float_uint_8 %MyCBuffer %int_0 +%26 = OpLoad %_arr_v4float_uint_8 %25 +%27 = OpCompositeExtract %v4float %26 0 +%28 = OpCompositeExtract %v4float %26 1 +%29 = OpCompositeExtract %v4float %26 2 +%30 = OpCompositeExtract %v4float %26 3 +%31 = OpCompositeExtract %v4float %26 4 +%32 = OpCompositeExtract %v4float %26 5 +%33 = OpCompositeExtract %v4float %26 6 +%34 = OpCompositeExtract %v4float %26 7 +%35 = OpCompositeConstruct %_arr_v4float_uint_8_0 %27 %28 %29 %30 %31 %32 %33 %34 +OpStore %23 %35 +%36 = OpAccessChain %_ptr_Function_v4float %23 %24 +%37 = OpLoad %v4float %36 +OpStore %out_var_SV_Target %37 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER | + SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); + SinglePassRunAndMatch(before, false); +} + +TEST_F(CopyPropArrayPassTest, BasicPropagateArrayWithName) { + const std::string before = + R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %in_var_INDEX %out_var_SV_Target +OpExecutionMode %main OriginUpperLeft +OpSource HLSL 600 +OpName %type_MyCBuffer "type.MyCBuffer" +OpMemberName %type_MyCBuffer 0 "Data" +OpName %MyCBuffer "MyCBuffer" +OpName %main "main" +OpName %local "local" +OpName %in_var_INDEX "in.var.INDEX" +OpName %out_var_SV_Target "out.var.SV_Target" +OpDecorate %_arr_v4float_uint_8 ArrayStride 16 +OpMemberDecorate %type_MyCBuffer 0 Offset 0 +OpDecorate %type_MyCBuffer Block +OpDecorate %in_var_INDEX Flat +OpDecorate %in_var_INDEX Location 0 +OpDecorate %out_var_SV_Target Location 0 +OpDecorate %MyCBuffer DescriptorSet 0 +OpDecorate %MyCBuffer Binding 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%uint = OpTypeInt 32 0 +%uint_8 = OpConstant %uint 8 +%_arr_v4float_uint_8 = OpTypeArray %v4float %uint_8 +%type_MyCBuffer = OpTypeStruct %_arr_v4float_uint_8 +%_ptr_Uniform_type_MyCBuffer = OpTypePointer Uniform %type_MyCBuffer +%void = OpTypeVoid +%13 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_arr_v4float_uint_8_0 = OpTypeArray %v4float %uint_8 +%_ptr_Function__arr_v4float_uint_8_0 = OpTypePointer Function %_arr_v4float_uint_8_0 +%int_0 = OpConstant %int 0 +%_ptr_Uniform__arr_v4float_uint_8 = OpTypePointer Uniform %_arr_v4float_uint_8 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%MyCBuffer = OpVariable %_ptr_Uniform_type_MyCBuffer Uniform +%in_var_INDEX = OpVariable %_ptr_Input_int Input +%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output +; CHECK: OpFunction +; CHECK: OpLabel +; CHECK: OpVariable +; CHECK: OpAccessChain +; CHECK: [[new_address:%\w+]] = OpAccessChain %_ptr_Uniform__arr_v4float_uint_8 %MyCBuffer %int_0 +; CHECK: [[element_ptr:%\w+]] = OpAccessChain %_ptr_Uniform_v4float [[new_address]] %24 +; CHECK: [[load:%\w+]] = OpLoad %v4float [[element_ptr]] +; CHECK: OpStore %out_var_SV_Target [[load]] +%main = OpFunction %void None %13 +%22 = OpLabel +%local = OpVariable %_ptr_Function__arr_v4float_uint_8_0 Function +%24 = OpLoad %int %in_var_INDEX +%25 = OpAccessChain %_ptr_Uniform__arr_v4float_uint_8 %MyCBuffer %int_0 +%26 = OpLoad %_arr_v4float_uint_8 %25 +%27 = OpCompositeExtract %v4float %26 0 +%28 = OpCompositeExtract %v4float %26 1 +%29 = OpCompositeExtract %v4float %26 2 +%30 = OpCompositeExtract %v4float %26 3 +%31 = OpCompositeExtract %v4float %26 4 +%32 = OpCompositeExtract %v4float %26 5 +%33 = OpCompositeExtract %v4float %26 6 +%34 = OpCompositeExtract %v4float %26 7 +%35 = OpCompositeConstruct %_arr_v4float_uint_8_0 %27 %28 %29 %30 %31 %32 %33 %34 +OpStore %local %35 +%36 = OpAccessChain %_ptr_Function_v4float %local %24 +%37 = OpLoad %v4float %36 +OpStore %out_var_SV_Target %37 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER | + SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); + SinglePassRunAndMatch(before, false); +} + +// Propagate 2d array. This test identifing a copy through multiple levels. +// Also has to traverse multiple OpAccessChains. +TEST_F(CopyPropArrayPassTest, Propagate2DArray) { + const std::string text = + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %in_var_INDEX %out_var_SV_Target +OpExecutionMode %main OriginUpperLeft +OpSource HLSL 600 +OpName %type_MyCBuffer "type.MyCBuffer" +OpMemberName %type_MyCBuffer 0 "Data" +OpName %MyCBuffer "MyCBuffer" +OpName %main "main" +OpName %in_var_INDEX "in.var.INDEX" +OpName %out_var_SV_Target "out.var.SV_Target" +OpDecorate %_arr_v4float_uint_2 ArrayStride 16 +OpDecorate %_arr__arr_v4float_uint_2_uint_2 ArrayStride 32 +OpMemberDecorate %type_MyCBuffer 0 Offset 0 +OpDecorate %type_MyCBuffer Block +OpDecorate %in_var_INDEX Flat +OpDecorate %in_var_INDEX Location 0 +OpDecorate %out_var_SV_Target Location 0 +OpDecorate %MyCBuffer DescriptorSet 0 +OpDecorate %MyCBuffer Binding 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%uint = OpTypeInt 32 0 +%uint_2 = OpConstant %uint 2 +%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2 +%_arr__arr_v4float_uint_2_uint_2 = OpTypeArray %_arr_v4float_uint_2 %uint_2 +%type_MyCBuffer = OpTypeStruct %_arr__arr_v4float_uint_2_uint_2 +%_ptr_Uniform_type_MyCBuffer = OpTypePointer Uniform %type_MyCBuffer +%void = OpTypeVoid +%14 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_arr_v4float_uint_2_0 = OpTypeArray %v4float %uint_2 +%_arr__arr_v4float_uint_2_0_uint_2 = OpTypeArray %_arr_v4float_uint_2_0 %uint_2 +%_ptr_Function__arr__arr_v4float_uint_2_0_uint_2 = OpTypePointer Function %_arr__arr_v4float_uint_2_0_uint_2 +%int_0 = OpConstant %int 0 +%_ptr_Uniform__arr__arr_v4float_uint_2_uint_2 = OpTypePointer Uniform %_arr__arr_v4float_uint_2_uint_2 +%_ptr_Function__arr_v4float_uint_2_0 = OpTypePointer Function %_arr_v4float_uint_2_0 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%MyCBuffer = OpVariable %_ptr_Uniform_type_MyCBuffer Uniform +%in_var_INDEX = OpVariable %_ptr_Input_int Input +%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output +; CHECK: OpFunction +; CHECK: OpLabel +; CHECK: OpVariable +; CHECK: OpVariable +; CHECK: OpAccessChain +; CHECK: [[new_address:%\w+]] = OpAccessChain %_ptr_Uniform__arr__arr_v4float_uint_2_uint_2 %MyCBuffer %int_0 +%main = OpFunction %void None %14 +%25 = OpLabel +%26 = OpVariable %_ptr_Function__arr_v4float_uint_2_0 Function +%27 = OpVariable %_ptr_Function__arr__arr_v4float_uint_2_0_uint_2 Function +%28 = OpLoad %int %in_var_INDEX +%29 = OpAccessChain %_ptr_Uniform__arr__arr_v4float_uint_2_uint_2 %MyCBuffer %int_0 +%30 = OpLoad %_arr__arr_v4float_uint_2_uint_2 %29 +%31 = OpCompositeExtract %_arr_v4float_uint_2 %30 0 +%32 = OpCompositeExtract %v4float %31 0 +%33 = OpCompositeExtract %v4float %31 1 +%34 = OpCompositeConstruct %_arr_v4float_uint_2_0 %32 %33 +%35 = OpCompositeExtract %_arr_v4float_uint_2 %30 1 +%36 = OpCompositeExtract %v4float %35 0 +%37 = OpCompositeExtract %v4float %35 1 +%38 = OpCompositeConstruct %_arr_v4float_uint_2_0 %36 %37 +%39 = OpCompositeConstruct %_arr__arr_v4float_uint_2_0_uint_2 %34 %38 +; CHECK: OpStore +OpStore %27 %39 +%40 = OpAccessChain %_ptr_Function__arr_v4float_uint_2_0 %27 %28 +%42 = OpAccessChain %_ptr_Function_v4float %40 %28 +%43 = OpLoad %v4float %42 +; CHECK: [[ac1:%\w+]] = OpAccessChain %_ptr_Uniform__arr_v4float_uint_2 [[new_address]] %28 +; CHECK: [[ac2:%\w+]] = OpAccessChain %_ptr_Uniform_v4float [[ac1]] %28 +; CHECK: [[load:%\w+]] = OpLoad %v4float [[ac2]] +; CHECK: OpStore %out_var_SV_Target [[load]] +OpStore %out_var_SV_Target %43 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER | + SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); + SinglePassRunAndMatch(text, false); +} + +// Test decomposing an object when we need to "rewrite" a store. +TEST_F(CopyPropArrayPassTest, DecomposeObjectForArrayStore) { + const std::string text = + R"( OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %in_var_INDEX %out_var_SV_Target + OpExecutionMode %main OriginUpperLeft + OpSource HLSL 600 + OpName %type_MyCBuffer "type.MyCBuffer" + OpMemberName %type_MyCBuffer 0 "Data" + OpName %MyCBuffer "MyCBuffer" + OpName %main "main" + OpName %in_var_INDEX "in.var.INDEX" + OpName %out_var_SV_Target "out.var.SV_Target" + OpDecorate %_arr_v4float_uint_2 ArrayStride 16 + OpDecorate %_arr__arr_v4float_uint_2_uint_2 ArrayStride 32 + OpMemberDecorate %type_MyCBuffer 0 Offset 0 + OpDecorate %type_MyCBuffer Block + OpDecorate %in_var_INDEX Flat + OpDecorate %in_var_INDEX Location 0 + OpDecorate %out_var_SV_Target Location 0 + OpDecorate %MyCBuffer DescriptorSet 0 + OpDecorate %MyCBuffer Binding 0 + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %uint = OpTypeInt 32 0 + %uint_2 = OpConstant %uint 2 +%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2 +%_arr__arr_v4float_uint_2_uint_2 = OpTypeArray %_arr_v4float_uint_2 %uint_2 +%type_MyCBuffer = OpTypeStruct %_arr__arr_v4float_uint_2_uint_2 +%_ptr_Uniform_type_MyCBuffer = OpTypePointer Uniform %type_MyCBuffer + %void = OpTypeVoid + %14 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_arr_v4float_uint_2_0 = OpTypeArray %v4float %uint_2 +%_arr__arr_v4float_uint_2_0_uint_2 = OpTypeArray %_arr_v4float_uint_2_0 %uint_2 +%_ptr_Function__arr__arr_v4float_uint_2_0_uint_2 = OpTypePointer Function %_arr__arr_v4float_uint_2_0_uint_2 + %int_0 = OpConstant %int 0 +%_ptr_Uniform__arr__arr_v4float_uint_2_uint_2 = OpTypePointer Uniform %_arr__arr_v4float_uint_2_uint_2 +%_ptr_Function__arr_v4float_uint_2_0 = OpTypePointer Function %_arr_v4float_uint_2_0 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %MyCBuffer = OpVariable %_ptr_Uniform_type_MyCBuffer Uniform +%in_var_INDEX = OpVariable %_ptr_Input_int Input +%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output + %main = OpFunction %void None %14 + %25 = OpLabel + %26 = OpVariable %_ptr_Function__arr_v4float_uint_2_0 Function + %27 = OpVariable %_ptr_Function__arr__arr_v4float_uint_2_0_uint_2 Function + %28 = OpLoad %int %in_var_INDEX + %29 = OpAccessChain %_ptr_Uniform__arr__arr_v4float_uint_2_uint_2 %MyCBuffer %int_0 + %30 = OpLoad %_arr__arr_v4float_uint_2_uint_2 %29 + %31 = OpCompositeExtract %_arr_v4float_uint_2 %30 0 + %32 = OpCompositeExtract %v4float %31 0 + %33 = OpCompositeExtract %v4float %31 1 + %34 = OpCompositeConstruct %_arr_v4float_uint_2_0 %32 %33 + %35 = OpCompositeExtract %_arr_v4float_uint_2 %30 1 + %36 = OpCompositeExtract %v4float %35 0 + %37 = OpCompositeExtract %v4float %35 1 + %38 = OpCompositeConstruct %_arr_v4float_uint_2_0 %36 %37 + %39 = OpCompositeConstruct %_arr__arr_v4float_uint_2_0_uint_2 %34 %38 + OpStore %27 %39 +; CHECK: [[access_chain:%\w+]] = OpAccessChain %_ptr_Uniform__arr_v4float_uint_2 + %40 = OpAccessChain %_ptr_Function__arr_v4float_uint_2_0 %27 %28 +; CHECK: [[load:%\w+]] = OpLoad %_arr_v4float_uint_2 [[access_chain]] + %41 = OpLoad %_arr_v4float_uint_2_0 %40 +; CHECK: [[extract1:%\w+]] = OpCompositeExtract %v4float [[load]] 0 +; CHECK: [[extract2:%\w+]] = OpCompositeExtract %v4float [[load]] 1 +; CHECK: [[construct:%\w+]] = OpCompositeConstruct %_arr_v4float_uint_2_0 [[extract1]] [[extract2]] +; CHEKC: OpStore %26 [[construct]] + OpStore %26 %41 + %42 = OpAccessChain %_ptr_Function_v4float %26 %28 + %43 = OpLoad %v4float %42 + OpStore %out_var_SV_Target %43 + OpReturn + OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER | + SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); + SinglePassRunAndMatch(text, false); +} + +// Test decomposing an object when we need to "rewrite" a store. +TEST_F(CopyPropArrayPassTest, DecomposeObjectForStructStore) { + const std::string text = + R"( OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %in_var_INDEX %out_var_SV_Target + OpExecutionMode %main OriginUpperLeft + OpSource HLSL 600 + OpName %type_MyCBuffer "type.MyCBuffer" + OpMemberName %type_MyCBuffer 0 "Data" + OpName %MyCBuffer "MyCBuffer" + OpName %main "main" + OpName %in_var_INDEX "in.var.INDEX" + OpName %out_var_SV_Target "out.var.SV_Target" + OpMemberDecorate %type_MyCBuffer 0 Offset 0 + OpDecorate %type_MyCBuffer Block + OpDecorate %in_var_INDEX Flat + OpDecorate %in_var_INDEX Location 0 + OpDecorate %out_var_SV_Target Location 0 + OpDecorate %MyCBuffer DescriptorSet 0 + OpDecorate %MyCBuffer Binding 0 +; CHECK: OpDecorate [[decorated_type:%\w+]] GLSLPacked + OpDecorate %struct GLSLPacked + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %uint = OpTypeInt 32 0 + %uint_2 = OpConstant %uint 2 +; CHECK: [[decorated_type]] = OpTypeStruct +%struct = OpTypeStruct %float %uint +%_arr_struct_uint_2 = OpTypeArray %struct %uint_2 +%type_MyCBuffer = OpTypeStruct %_arr_struct_uint_2 +%_ptr_Uniform_type_MyCBuffer = OpTypePointer Uniform %type_MyCBuffer + %void = OpTypeVoid + %14 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%_ptr_Output_v4float = OpTypePointer Output %v4float +; CHECK: [[struct:%\w+]] = OpTypeStruct %float %uint +%struct_0 = OpTypeStruct %float %uint +%_arr_struct_0_uint_2 = OpTypeArray %struct_0 %uint_2 +%_ptr_Function__arr_struct_0_uint_2 = OpTypePointer Function %_arr_struct_0_uint_2 + %int_0 = OpConstant %int 0 +%_ptr_Uniform__arr_struct_uint_2 = OpTypePointer Uniform %_arr_struct_uint_2 +; CHECK: [[decorated_ptr:%\w+]] = OpTypePointer Uniform [[decorated_type]] +%_ptr_Function_struct_0 = OpTypePointer Function %struct_0 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %MyCBuffer = OpVariable %_ptr_Uniform_type_MyCBuffer Uniform +%in_var_INDEX = OpVariable %_ptr_Input_int Input +%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output + %main = OpFunction %void None %14 + %25 = OpLabel + %26 = OpVariable %_ptr_Function_struct_0 Function + %27 = OpVariable %_ptr_Function__arr_struct_0_uint_2 Function + %28 = OpLoad %int %in_var_INDEX + %29 = OpAccessChain %_ptr_Uniform__arr_struct_uint_2 %MyCBuffer %int_0 + %30 = OpLoad %_arr_struct_uint_2 %29 + %31 = OpCompositeExtract %struct %30 0 + %32 = OpCompositeExtract %v4float %31 0 + %33 = OpCompositeExtract %v4float %31 1 + %34 = OpCompositeConstruct %struct_0 %32 %33 + %35 = OpCompositeExtract %struct %30 1 + %36 = OpCompositeExtract %float %35 0 + %37 = OpCompositeExtract %uint %35 1 + %38 = OpCompositeConstruct %struct_0 %36 %37 + %39 = OpCompositeConstruct %_arr_struct_0_uint_2 %34 %38 + OpStore %27 %39 +; CHECK: [[access_chain:%\w+]] = OpAccessChain [[decorated_ptr]] + %40 = OpAccessChain %_ptr_Function_struct_0 %27 %28 +; CHECK: [[load:%\w+]] = OpLoad [[decorated_type]] [[access_chain]] + %41 = OpLoad %struct_0 %40 +; CHECK: [[extract1:%\w+]] = OpCompositeExtract %float [[load]] 0 +; CHECK: [[extract2:%\w+]] = OpCompositeExtract %uint [[load]] 1 +; CHECK: [[construct:%\w+]] = OpCompositeConstruct [[struct]] [[extract1]] [[extract2]] +; CHEKC: OpStore %26 [[construct]] + OpStore %26 %41 + %42 = OpAccessChain %_ptr_Function_v4float %26 %28 + %43 = OpLoad %v4float %42 + OpStore %out_var_SV_Target %43 + OpReturn + OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER | + SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); + SinglePassRunAndMatch(text, false); +} + +TEST_F(CopyPropArrayPassTest, CopyViaInserts) { + const std::string before = + R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %in_var_INDEX %out_var_SV_Target +OpExecutionMode %main OriginUpperLeft +OpSource HLSL 600 +OpName %type_MyCBuffer "type.MyCBuffer" +OpMemberName %type_MyCBuffer 0 "Data" +OpName %MyCBuffer "MyCBuffer" +OpName %main "main" +OpName %in_var_INDEX "in.var.INDEX" +OpName %out_var_SV_Target "out.var.SV_Target" +OpDecorate %_arr_v4float_uint_8 ArrayStride 16 +OpMemberDecorate %type_MyCBuffer 0 Offset 0 +OpDecorate %type_MyCBuffer Block +OpDecorate %in_var_INDEX Flat +OpDecorate %in_var_INDEX Location 0 +OpDecorate %out_var_SV_Target Location 0 +OpDecorate %MyCBuffer DescriptorSet 0 +OpDecorate %MyCBuffer Binding 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%uint = OpTypeInt 32 0 +%uint_8 = OpConstant %uint 8 +%_arr_v4float_uint_8 = OpTypeArray %v4float %uint_8 +%type_MyCBuffer = OpTypeStruct %_arr_v4float_uint_8 +%_ptr_Uniform_type_MyCBuffer = OpTypePointer Uniform %type_MyCBuffer +%void = OpTypeVoid +%13 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_arr_v4float_uint_8_0 = OpTypeArray %v4float %uint_8 +%_ptr_Function__arr_v4float_uint_8_0 = OpTypePointer Function %_arr_v4float_uint_8_0 +%int_0 = OpConstant %int 0 +%_ptr_Uniform__arr_v4float_uint_8 = OpTypePointer Uniform %_arr_v4float_uint_8 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%MyCBuffer = OpVariable %_ptr_Uniform_type_MyCBuffer Uniform +%in_var_INDEX = OpVariable %_ptr_Input_int Input +%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output +; CHECK: OpFunction +; CHECK: OpLabel +; CHECK: OpVariable +; CHECK: OpAccessChain +; CHECK: [[new_address:%\w+]] = OpAccessChain %_ptr_Uniform__arr_v4float_uint_8 %MyCBuffer %int_0 +; CHECK: [[element_ptr:%\w+]] = OpAccessChain %_ptr_Uniform_v4float [[new_address]] %24 +; CHECK: [[load:%\w+]] = OpLoad %v4float [[element_ptr]] +; CHECK: OpStore %out_var_SV_Target [[load]] +%main = OpFunction %void None %13 +%22 = OpLabel +%23 = OpVariable %_ptr_Function__arr_v4float_uint_8_0 Function +%undef = OpUndef %_arr_v4float_uint_8_0 +%24 = OpLoad %int %in_var_INDEX +%25 = OpAccessChain %_ptr_Uniform__arr_v4float_uint_8 %MyCBuffer %int_0 +%26 = OpLoad %_arr_v4float_uint_8 %25 +%27 = OpCompositeExtract %v4float %26 0 +%i0 = OpCompositeInsert %_arr_v4float_uint_8_0 %27 %undef 0 +%28 = OpCompositeExtract %v4float %26 1 +%i1 = OpCompositeInsert %_arr_v4float_uint_8_0 %28 %i0 1 +%29 = OpCompositeExtract %v4float %26 2 +%i2 = OpCompositeInsert %_arr_v4float_uint_8_0 %29 %i1 2 +%30 = OpCompositeExtract %v4float %26 3 +%i3 = OpCompositeInsert %_arr_v4float_uint_8_0 %30 %i2 3 +%31 = OpCompositeExtract %v4float %26 4 +%i4 = OpCompositeInsert %_arr_v4float_uint_8_0 %31 %i3 4 +%32 = OpCompositeExtract %v4float %26 5 +%i5 = OpCompositeInsert %_arr_v4float_uint_8_0 %32 %i4 5 +%33 = OpCompositeExtract %v4float %26 6 +%i6 = OpCompositeInsert %_arr_v4float_uint_8_0 %33 %i5 6 +%34 = OpCompositeExtract %v4float %26 7 +%i7 = OpCompositeInsert %_arr_v4float_uint_8_0 %34 %i6 7 +OpStore %23 %i7 +%36 = OpAccessChain %_ptr_Function_v4float %23 %24 +%37 = OpLoad %v4float %36 +OpStore %out_var_SV_Target %37 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER | + SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); + SinglePassRunAndMatch(before, false); +} +#endif // SPIRV_EFFCEE + +// This test will place a load before the store. We cannot propagate in this +// case. +TEST_F(CopyPropArrayPassTest, LoadBeforeStore) { + const std::string text = + R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %in_var_INDEX %out_var_SV_Target +OpExecutionMode %main OriginUpperLeft +OpSource HLSL 600 +OpName %type_MyCBuffer "type.MyCBuffer" +OpMemberName %type_MyCBuffer 0 "Data" +OpName %MyCBuffer "MyCBuffer" +OpName %main "main" +OpName %in_var_INDEX "in.var.INDEX" +OpName %out_var_SV_Target "out.var.SV_Target" +OpDecorate %_arr_v4float_uint_8 ArrayStride 16 +OpMemberDecorate %type_MyCBuffer 0 Offset 0 +OpDecorate %type_MyCBuffer Block +OpDecorate %in_var_INDEX Flat +OpDecorate %in_var_INDEX Location 0 +OpDecorate %out_var_SV_Target Location 0 +OpDecorate %MyCBuffer DescriptorSet 0 +OpDecorate %MyCBuffer Binding 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%uint = OpTypeInt 32 0 +%uint_8 = OpConstant %uint 8 +%_arr_v4float_uint_8 = OpTypeArray %v4float %uint_8 +%type_MyCBuffer = OpTypeStruct %_arr_v4float_uint_8 +%_ptr_Uniform_type_MyCBuffer = OpTypePointer Uniform %type_MyCBuffer +%void = OpTypeVoid +%13 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_arr_v4float_uint_8_0 = OpTypeArray %v4float %uint_8 +%_ptr_Function__arr_v4float_uint_8_0 = OpTypePointer Function %_arr_v4float_uint_8_0 +%int_0 = OpConstant %int 0 +%_ptr_Uniform__arr_v4float_uint_8 = OpTypePointer Uniform %_arr_v4float_uint_8 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%MyCBuffer = OpVariable %_ptr_Uniform_type_MyCBuffer Uniform +%in_var_INDEX = OpVariable %_ptr_Input_int Input +%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %13 +%22 = OpLabel +%23 = OpVariable %_ptr_Function__arr_v4float_uint_8_0 Function +%38 = OpAccessChain %_ptr_Function_v4float %23 %24 +%39 = OpLoad %v4float %36 +%24 = OpLoad %int %in_var_INDEX +%25 = OpAccessChain %_ptr_Uniform__arr_v4float_uint_8 %MyCBuffer %int_0 +%26 = OpLoad %_arr_v4float_uint_8 %25 +%27 = OpCompositeExtract %v4float %26 0 +%28 = OpCompositeExtract %v4float %26 1 +%29 = OpCompositeExtract %v4float %26 2 +%30 = OpCompositeExtract %v4float %26 3 +%31 = OpCompositeExtract %v4float %26 4 +%32 = OpCompositeExtract %v4float %26 5 +%33 = OpCompositeExtract %v4float %26 6 +%34 = OpCompositeExtract %v4float %26 7 +%35 = OpCompositeConstruct %_arr_v4float_uint_8_0 %27 %28 %29 %30 %31 %32 %33 %34 +OpStore %23 %35 +%36 = OpAccessChain %_ptr_Function_v4float %23 %24 +%37 = OpLoad %v4float %36 +OpStore %out_var_SV_Target %37 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER | + SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); + auto result = SinglePassRunAndDisassemble( + text, /* skip_nop = */ true, /* do_validation = */ false); + + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); +} + +// This test will place a load where it is not dominated by the store. We +// cannot propagate in this case. +TEST_F(CopyPropArrayPassTest, LoadNotDominated) { + const std::string text = + R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %in_var_INDEX %out_var_SV_Target +OpExecutionMode %main OriginUpperLeft +OpSource HLSL 600 +OpName %type_MyCBuffer "type.MyCBuffer" +OpMemberName %type_MyCBuffer 0 "Data" +OpName %MyCBuffer "MyCBuffer" +OpName %main "main" +OpName %in_var_INDEX "in.var.INDEX" +OpName %out_var_SV_Target "out.var.SV_Target" +OpDecorate %_arr_v4float_uint_8 ArrayStride 16 +OpMemberDecorate %type_MyCBuffer 0 Offset 0 +OpDecorate %type_MyCBuffer Block +OpDecorate %in_var_INDEX Flat +OpDecorate %in_var_INDEX Location 0 +OpDecorate %out_var_SV_Target Location 0 +OpDecorate %MyCBuffer DescriptorSet 0 +OpDecorate %MyCBuffer Binding 0 +%bool = OpTypeBool +%true = OpConstantTrue %bool +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%uint = OpTypeInt 32 0 +%uint_8 = OpConstant %uint 8 +%_arr_v4float_uint_8 = OpTypeArray %v4float %uint_8 +%type_MyCBuffer = OpTypeStruct %_arr_v4float_uint_8 +%_ptr_Uniform_type_MyCBuffer = OpTypePointer Uniform %type_MyCBuffer +%void = OpTypeVoid +%13 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_arr_v4float_uint_8_0 = OpTypeArray %v4float %uint_8 +%_ptr_Function__arr_v4float_uint_8_0 = OpTypePointer Function %_arr_v4float_uint_8_0 +%int_0 = OpConstant %int 0 +%_ptr_Uniform__arr_v4float_uint_8 = OpTypePointer Uniform %_arr_v4float_uint_8 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%MyCBuffer = OpVariable %_ptr_Uniform_type_MyCBuffer Uniform +%in_var_INDEX = OpVariable %_ptr_Input_int Input +%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %13 +%22 = OpLabel +%23 = OpVariable %_ptr_Function__arr_v4float_uint_8_0 Function +OpSelectionMerge %merge None +OpBranchConditional %true %if %else +%if = OpLabel +%24 = OpLoad %int %in_var_INDEX +%25 = OpAccessChain %_ptr_Uniform__arr_v4float_uint_8 %MyCBuffer %int_0 +%26 = OpLoad %_arr_v4float_uint_8 %25 +%27 = OpCompositeExtract %v4float %26 0 +%28 = OpCompositeExtract %v4float %26 1 +%29 = OpCompositeExtract %v4float %26 2 +%30 = OpCompositeExtract %v4float %26 3 +%31 = OpCompositeExtract %v4float %26 4 +%32 = OpCompositeExtract %v4float %26 5 +%33 = OpCompositeExtract %v4float %26 6 +%34 = OpCompositeExtract %v4float %26 7 +%35 = OpCompositeConstruct %_arr_v4float_uint_8_0 %27 %28 %29 %30 %31 %32 %33 %34 +OpStore %23 %35 +%38 = OpAccessChain %_ptr_Function_v4float %23 %24 +%39 = OpLoad %v4float %36 +OpBranch %merge +%else = OpLabel +%36 = OpAccessChain %_ptr_Function_v4float %23 %24 +%37 = OpLoad %v4float %36 +OpBranch %merge +%merge = OpLabel +%phi = OpPhi %out_var_SV_Target %39 %if %37 %else +OpStore %out_var_SV_Target %phi +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER | + SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); + auto result = SinglePassRunAndDisassemble( + text, /* skip_nop = */ true, /* do_validation = */ false); + + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); +} + +// This test has a partial store to the variable. We cannot propagate in this +// case. +TEST_F(CopyPropArrayPassTest, PartialStore) { + const std::string text = + R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %in_var_INDEX %out_var_SV_Target +OpExecutionMode %main OriginUpperLeft +OpSource HLSL 600 +OpName %type_MyCBuffer "type.MyCBuffer" +OpMemberName %type_MyCBuffer 0 "Data" +OpName %MyCBuffer "MyCBuffer" +OpName %main "main" +OpName %in_var_INDEX "in.var.INDEX" +OpName %out_var_SV_Target "out.var.SV_Target" +OpDecorate %_arr_v4float_uint_8 ArrayStride 16 +OpMemberDecorate %type_MyCBuffer 0 Offset 0 +OpDecorate %type_MyCBuffer Block +OpDecorate %in_var_INDEX Flat +OpDecorate %in_var_INDEX Location 0 +OpDecorate %out_var_SV_Target Location 0 +OpDecorate %MyCBuffer DescriptorSet 0 +OpDecorate %MyCBuffer Binding 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%uint = OpTypeInt 32 0 +%uint_8 = OpConstant %uint 8 +%_arr_v4float_uint_8 = OpTypeArray %v4float %uint_8 +%type_MyCBuffer = OpTypeStruct %_arr_v4float_uint_8 +%_ptr_Uniform_type_MyCBuffer = OpTypePointer Uniform %type_MyCBuffer +%void = OpTypeVoid +%13 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_arr_v4float_uint_8_0 = OpTypeArray %v4float %uint_8 +%_ptr_Function__arr_v4float_uint_8_0 = OpTypePointer Function %_arr_v4float_uint_8_0 +%int_0 = OpConstant %int 0 +%f0 = OpConstant %float 0 +%v4const = OpConstantComposite %v4float %f0 %f0 %f0 %f0 +%_ptr_Uniform__arr_v4float_uint_8 = OpTypePointer Uniform %_arr_v4float_uint_8 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%MyCBuffer = OpVariable %_ptr_Uniform_type_MyCBuffer Uniform +%in_var_INDEX = OpVariable %_ptr_Input_int Input +%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %13 +%22 = OpLabel +%23 = OpVariable %_ptr_Function__arr_v4float_uint_8_0 Function +%24 = OpLoad %int %in_var_INDEX +%25 = OpAccessChain %_ptr_Uniform__arr_v4float_uint_8 %MyCBuffer %int_0 +%26 = OpLoad %_arr_v4float_uint_8 %25 +%27 = OpCompositeExtract %v4float %26 0 +%28 = OpCompositeExtract %v4float %26 1 +%29 = OpCompositeExtract %v4float %26 2 +%30 = OpCompositeExtract %v4float %26 3 +%31 = OpCompositeExtract %v4float %26 4 +%32 = OpCompositeExtract %v4float %26 5 +%33 = OpCompositeExtract %v4float %26 6 +%34 = OpCompositeExtract %v4float %26 7 +%35 = OpCompositeConstruct %_arr_v4float_uint_8_0 %27 %28 %29 %30 %31 %32 %33 %34 +OpStore %23 %35 +%36 = OpAccessChain %_ptr_Function_v4float %23 %24 +%37 = OpLoad %v4float %36 +%39 = OpStore %36 %v4const +OpStore %out_var_SV_Target %37 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER | + SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); + auto result = SinglePassRunAndDisassemble( + text, /* skip_nop = */ true, /* do_validation = */ false); + + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); +} + +// This test does not have a proper copy of an object. We cannot propagate in +// this case. +TEST_F(CopyPropArrayPassTest, NotACopy) { + const std::string text = + R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %in_var_INDEX %out_var_SV_Target +OpExecutionMode %main OriginUpperLeft +OpSource HLSL 600 +OpName %type_MyCBuffer "type.MyCBuffer" +OpMemberName %type_MyCBuffer 0 "Data" +OpName %MyCBuffer "MyCBuffer" +OpName %main "main" +OpName %in_var_INDEX "in.var.INDEX" +OpName %out_var_SV_Target "out.var.SV_Target" +OpDecorate %_arr_v4float_uint_8 ArrayStride 16 +OpMemberDecorate %type_MyCBuffer 0 Offset 0 +OpDecorate %type_MyCBuffer Block +OpDecorate %in_var_INDEX Flat +OpDecorate %in_var_INDEX Location 0 +OpDecorate %out_var_SV_Target Location 0 +OpDecorate %MyCBuffer DescriptorSet 0 +OpDecorate %MyCBuffer Binding 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%uint = OpTypeInt 32 0 +%uint_8 = OpConstant %uint 8 +%_arr_v4float_uint_8 = OpTypeArray %v4float %uint_8 +%type_MyCBuffer = OpTypeStruct %_arr_v4float_uint_8 +%_ptr_Uniform_type_MyCBuffer = OpTypePointer Uniform %type_MyCBuffer +%void = OpTypeVoid +%13 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_arr_v4float_uint_8_0 = OpTypeArray %v4float %uint_8 +%_ptr_Function__arr_v4float_uint_8_0 = OpTypePointer Function %_arr_v4float_uint_8_0 +%int_0 = OpConstant %int 0 +%f0 = OpConstant %float 0 +%v4const = OpConstantComposite %v4float %f0 %f0 %f0 %f0 +%_ptr_Uniform__arr_v4float_uint_8 = OpTypePointer Uniform %_arr_v4float_uint_8 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%MyCBuffer = OpVariable %_ptr_Uniform_type_MyCBuffer Uniform +%in_var_INDEX = OpVariable %_ptr_Input_int Input +%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %13 +%22 = OpLabel +%23 = OpVariable %_ptr_Function__arr_v4float_uint_8_0 Function +%24 = OpLoad %int %in_var_INDEX +%25 = OpAccessChain %_ptr_Uniform__arr_v4float_uint_8 %MyCBuffer %int_0 +%26 = OpLoad %_arr_v4float_uint_8 %25 +%27 = OpCompositeExtract %v4float %26 0 +%28 = OpCompositeExtract %v4float %26 0 +%29 = OpCompositeExtract %v4float %26 2 +%30 = OpCompositeExtract %v4float %26 3 +%31 = OpCompositeExtract %v4float %26 4 +%32 = OpCompositeExtract %v4float %26 5 +%33 = OpCompositeExtract %v4float %26 6 +%34 = OpCompositeExtract %v4float %26 7 +%35 = OpCompositeConstruct %_arr_v4float_uint_8_0 %27 %28 %29 %30 %31 %32 %33 %34 +OpStore %23 %35 +%36 = OpAccessChain %_ptr_Function_v4float %23 %24 +%37 = OpLoad %v4float %36 +OpStore %out_var_SV_Target %37 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER | + SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); + auto result = SinglePassRunAndDisassemble( + text, /* skip_nop = */ true, /* do_validation = */ false); + + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); +} + +TEST_F(CopyPropArrayPassTest, BadCopyViaInserts1) { + const std::string text = + R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %in_var_INDEX %out_var_SV_Target +OpExecutionMode %main OriginUpperLeft +OpSource HLSL 600 +OpName %type_MyCBuffer "type.MyCBuffer" +OpMemberName %type_MyCBuffer 0 "Data" +OpName %MyCBuffer "MyCBuffer" +OpName %main "main" +OpName %in_var_INDEX "in.var.INDEX" +OpName %out_var_SV_Target "out.var.SV_Target" +OpDecorate %_arr_v4float_uint_8 ArrayStride 16 +OpMemberDecorate %type_MyCBuffer 0 Offset 0 +OpDecorate %type_MyCBuffer Block +OpDecorate %in_var_INDEX Flat +OpDecorate %in_var_INDEX Location 0 +OpDecorate %out_var_SV_Target Location 0 +OpDecorate %MyCBuffer DescriptorSet 0 +OpDecorate %MyCBuffer Binding 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%uint = OpTypeInt 32 0 +%uint_8 = OpConstant %uint 8 +%_arr_v4float_uint_8 = OpTypeArray %v4float %uint_8 +%type_MyCBuffer = OpTypeStruct %_arr_v4float_uint_8 +%_ptr_Uniform_type_MyCBuffer = OpTypePointer Uniform %type_MyCBuffer +%void = OpTypeVoid +%13 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_arr_v4float_uint_8_0 = OpTypeArray %v4float %uint_8 +%_ptr_Function__arr_v4float_uint_8_0 = OpTypePointer Function %_arr_v4float_uint_8_0 +%int_0 = OpConstant %int 0 +%_ptr_Uniform__arr_v4float_uint_8 = OpTypePointer Uniform %_arr_v4float_uint_8 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%MyCBuffer = OpVariable %_ptr_Uniform_type_MyCBuffer Uniform +%in_var_INDEX = OpVariable %_ptr_Input_int Input +%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %13 +%22 = OpLabel +%23 = OpVariable %_ptr_Function__arr_v4float_uint_8_0 Function +%undef = OpUndef %_arr_v4float_uint_8_0 +%24 = OpLoad %int %in_var_INDEX +%25 = OpAccessChain %_ptr_Uniform__arr_v4float_uint_8 %MyCBuffer %int_0 +%26 = OpLoad %_arr_v4float_uint_8 %25 +%27 = OpCompositeExtract %v4float %26 0 +%i0 = OpCompositeInsert %_arr_v4float_uint_8_0 %27 %undef 0 +%28 = OpCompositeExtract %v4float %26 1 +%i1 = OpCompositeInsert %_arr_v4float_uint_8_0 %28 %i0 1 +%29 = OpCompositeExtract %v4float %26 2 +%i2 = OpCompositeInsert %_arr_v4float_uint_8_0 %29 %i1 3 +%30 = OpCompositeExtract %v4float %26 3 +%i3 = OpCompositeInsert %_arr_v4float_uint_8_0 %30 %i2 3 +%31 = OpCompositeExtract %v4float %26 4 +%i4 = OpCompositeInsert %_arr_v4float_uint_8_0 %31 %i3 4 +%32 = OpCompositeExtract %v4float %26 5 +%i5 = OpCompositeInsert %_arr_v4float_uint_8_0 %32 %i4 5 +%33 = OpCompositeExtract %v4float %26 6 +%i6 = OpCompositeInsert %_arr_v4float_uint_8_0 %33 %i5 6 +%34 = OpCompositeExtract %v4float %26 7 +%i7 = OpCompositeInsert %_arr_v4float_uint_8_0 %34 %i6 7 +OpStore %23 %i7 +%36 = OpAccessChain %_ptr_Function_v4float %23 %24 +%37 = OpLoad %v4float %36 +OpStore %out_var_SV_Target %37 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER | + SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); + auto result = SinglePassRunAndDisassemble( + text, /* skip_nop = */ true, /* do_validation = */ false); + + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); +} + +TEST_F(CopyPropArrayPassTest, BadCopyViaInserts2) { + const std::string text = + R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %in_var_INDEX %out_var_SV_Target +OpExecutionMode %main OriginUpperLeft +OpSource HLSL 600 +OpName %type_MyCBuffer "type.MyCBuffer" +OpMemberName %type_MyCBuffer 0 "Data" +OpName %MyCBuffer "MyCBuffer" +OpName %main "main" +OpName %in_var_INDEX "in.var.INDEX" +OpName %out_var_SV_Target "out.var.SV_Target" +OpDecorate %_arr_v4float_uint_8 ArrayStride 16 +OpMemberDecorate %type_MyCBuffer 0 Offset 0 +OpDecorate %type_MyCBuffer Block +OpDecorate %in_var_INDEX Flat +OpDecorate %in_var_INDEX Location 0 +OpDecorate %out_var_SV_Target Location 0 +OpDecorate %MyCBuffer DescriptorSet 0 +OpDecorate %MyCBuffer Binding 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%uint = OpTypeInt 32 0 +%uint_8 = OpConstant %uint 8 +%_arr_v4float_uint_8 = OpTypeArray %v4float %uint_8 +%type_MyCBuffer = OpTypeStruct %_arr_v4float_uint_8 +%_ptr_Uniform_type_MyCBuffer = OpTypePointer Uniform %type_MyCBuffer +%void = OpTypeVoid +%13 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_arr_v4float_uint_8_0 = OpTypeArray %v4float %uint_8 +%_ptr_Function__arr_v4float_uint_8_0 = OpTypePointer Function %_arr_v4float_uint_8_0 +%int_0 = OpConstant %int 0 +%_ptr_Uniform__arr_v4float_uint_8 = OpTypePointer Uniform %_arr_v4float_uint_8 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%MyCBuffer = OpVariable %_ptr_Uniform_type_MyCBuffer Uniform +%in_var_INDEX = OpVariable %_ptr_Input_int Input +%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %13 +%22 = OpLabel +%23 = OpVariable %_ptr_Function__arr_v4float_uint_8_0 Function +%undef = OpUndef %_arr_v4float_uint_8_0 +%24 = OpLoad %int %in_var_INDEX +%25 = OpAccessChain %_ptr_Uniform__arr_v4float_uint_8 %MyCBuffer %int_0 +%26 = OpLoad %_arr_v4float_uint_8 %25 +%27 = OpCompositeExtract %v4float %26 0 +%i0 = OpCompositeInsert %_arr_v4float_uint_8_0 %27 %undef 0 +%28 = OpCompositeExtract %v4float %26 1 +%i1 = OpCompositeInsert %_arr_v4float_uint_8_0 %28 %i0 1 +%29 = OpCompositeExtract %v4float %26 3 +%i2 = OpCompositeInsert %_arr_v4float_uint_8_0 %29 %i1 2 +%30 = OpCompositeExtract %v4float %26 3 +%i3 = OpCompositeInsert %_arr_v4float_uint_8_0 %30 %i2 3 +%31 = OpCompositeExtract %v4float %26 4 +%i4 = OpCompositeInsert %_arr_v4float_uint_8_0 %31 %i3 4 +%32 = OpCompositeExtract %v4float %26 5 +%i5 = OpCompositeInsert %_arr_v4float_uint_8_0 %32 %i4 5 +%33 = OpCompositeExtract %v4float %26 6 +%i6 = OpCompositeInsert %_arr_v4float_uint_8_0 %33 %i5 6 +%34 = OpCompositeExtract %v4float %26 7 +%i7 = OpCompositeInsert %_arr_v4float_uint_8_0 %34 %i6 7 +OpStore %23 %i7 +%36 = OpAccessChain %_ptr_Function_v4float %23 %24 +%37 = OpLoad %v4float %36 +OpStore %out_var_SV_Target %37 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER | + SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); + auto result = SinglePassRunAndDisassemble( + text, /* skip_nop = */ true, /* do_validation = */ false); + + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); +} + +TEST_F(CopyPropArrayPassTest, BadCopyViaInserts3) { + const std::string text = + R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %in_var_INDEX %out_var_SV_Target +OpExecutionMode %main OriginUpperLeft +OpSource HLSL 600 +OpName %type_MyCBuffer "type.MyCBuffer" +OpMemberName %type_MyCBuffer 0 "Data" +OpName %MyCBuffer "MyCBuffer" +OpName %main "main" +OpName %in_var_INDEX "in.var.INDEX" +OpName %out_var_SV_Target "out.var.SV_Target" +OpDecorate %_arr_v4float_uint_8 ArrayStride 16 +OpMemberDecorate %type_MyCBuffer 0 Offset 0 +OpDecorate %type_MyCBuffer Block +OpDecorate %in_var_INDEX Flat +OpDecorate %in_var_INDEX Location 0 +OpDecorate %out_var_SV_Target Location 0 +OpDecorate %MyCBuffer DescriptorSet 0 +OpDecorate %MyCBuffer Binding 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%uint = OpTypeInt 32 0 +%uint_8 = OpConstant %uint 8 +%_arr_v4float_uint_8 = OpTypeArray %v4float %uint_8 +%type_MyCBuffer = OpTypeStruct %_arr_v4float_uint_8 +%_ptr_Uniform_type_MyCBuffer = OpTypePointer Uniform %type_MyCBuffer +%void = OpTypeVoid +%13 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_arr_v4float_uint_8_0 = OpTypeArray %v4float %uint_8 +%_ptr_Function__arr_v4float_uint_8_0 = OpTypePointer Function %_arr_v4float_uint_8_0 +%int_0 = OpConstant %int 0 +%_ptr_Uniform__arr_v4float_uint_8 = OpTypePointer Uniform %_arr_v4float_uint_8 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%MyCBuffer = OpVariable %_ptr_Uniform_type_MyCBuffer Uniform +%in_var_INDEX = OpVariable %_ptr_Input_int Input +%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %13 +%22 = OpLabel +%23 = OpVariable %_ptr_Function__arr_v4float_uint_8_0 Function +%undef = OpUndef %_arr_v4float_uint_8_0 +%24 = OpLoad %int %in_var_INDEX +%25 = OpAccessChain %_ptr_Uniform__arr_v4float_uint_8 %MyCBuffer %int_0 +%26 = OpLoad %_arr_v4float_uint_8 %25 +%28 = OpCompositeExtract %v4float %26 1 +%i1 = OpCompositeInsert %_arr_v4float_uint_8_0 %28 %undef 1 +%29 = OpCompositeExtract %v4float %26 2 +%i2 = OpCompositeInsert %_arr_v4float_uint_8_0 %29 %i1 2 +%30 = OpCompositeExtract %v4float %26 3 +%i3 = OpCompositeInsert %_arr_v4float_uint_8_0 %30 %i2 3 +%31 = OpCompositeExtract %v4float %26 4 +%i4 = OpCompositeInsert %_arr_v4float_uint_8_0 %31 %i3 4 +%32 = OpCompositeExtract %v4float %26 5 +%i5 = OpCompositeInsert %_arr_v4float_uint_8_0 %32 %i4 5 +%33 = OpCompositeExtract %v4float %26 6 +%i6 = OpCompositeInsert %_arr_v4float_uint_8_0 %33 %i5 6 +%34 = OpCompositeExtract %v4float %26 7 +%i7 = OpCompositeInsert %_arr_v4float_uint_8_0 %34 %i6 7 +OpStore %23 %i7 +%36 = OpAccessChain %_ptr_Function_v4float %23 %24 +%37 = OpLoad %v4float %36 +OpStore %out_var_SV_Target %37 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER | + SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES); + auto result = SinglePassRunAndDisassemble( + text, /* skip_nop = */ true, /* do_validation = */ false); + + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); +} + +TEST_F(CopyPropArrayPassTest, AtomicAdd) { + const std::string before = R"(OpCapability SampledBuffer +OpCapability StorageImageExtendedFormats +OpCapability ImageBuffer +OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %2 "min" %gl_GlobalInvocationID +OpExecutionMode %2 LocalSize 64 1 1 +OpSource HLSL 600 +OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId +OpDecorate %4 DescriptorSet 4 +OpDecorate %4 Binding 70 +%uint = OpTypeInt 32 0 +%6 = OpTypeImage %uint Buffer 0 0 0 2 R32ui +%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6 +%_ptr_Function_6 = OpTypePointer Function %6 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint +%_ptr_Image_uint = OpTypePointer Image %uint +%4 = OpVariable %_ptr_UniformConstant_6 UniformConstant +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input +%2 = OpFunction %void None %10 +%17 = OpLabel +%16 = OpVariable %_ptr_Function_6 Function +%18 = OpLoad %6 %4 +OpStore %16 %18 +%19 = OpImageTexelPointer %_ptr_Image_uint %16 %uint_0 %uint_0 +%20 = OpAtomicIAdd %uint %19 %uint_1 %uint_0 %uint_1 +OpReturn +OpFunctionEnd +)"; + + const std::string after = R"(OpCapability SampledBuffer +OpCapability StorageImageExtendedFormats +OpCapability ImageBuffer +OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %2 "min" %gl_GlobalInvocationID +OpExecutionMode %2 LocalSize 64 1 1 +OpSource HLSL 600 +OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId +OpDecorate %4 DescriptorSet 4 +OpDecorate %4 Binding 70 +%uint = OpTypeInt 32 0 +%6 = OpTypeImage %uint Buffer 0 0 0 2 R32ui +%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6 +%_ptr_Function_6 = OpTypePointer Function %6 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint +%_ptr_Image_uint = OpTypePointer Image %uint +%4 = OpVariable %_ptr_UniformConstant_6 UniformConstant +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input +%2 = OpFunction %void None %10 +%17 = OpLabel +%16 = OpVariable %_ptr_Function_6 Function +%18 = OpLoad %6 %4 +OpStore %16 %18 +%19 = OpImageTexelPointer %_ptr_Image_uint %4 %uint_0 %uint_0 +%20 = OpAtomicIAdd %uint %19 %uint_1 %uint_0 %uint_1 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(before, after, true, true); +} +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dead_branch_elim_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dead_branch_elim_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dead_branch_elim_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dead_branch_elim_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,2012 @@ +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using DeadBranchElimTest = PassTest<::testing::Test>; + +TEST_F(DeadBranchElimTest, IfThenElseTrue) { + // #version 140 + // + // in vec4 BaseColor; + // + // void main() + // { + // vec4 v; + // if (true) + // v = vec4(0.0,0.0,0.0,0.0); + // else + // v = vec4(1.0,1.0,1.0,1.0); + // gl_FragColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %gl_FragColor %BaseColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %gl_FragColor "gl_FragColor" +OpName %BaseColor "BaseColor" +%void = OpTypeVoid +%7 = OpTypeFunction %void +%bool = OpTypeBool +%true = OpConstantTrue %bool +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%float_0 = OpConstant %float 0 +%14 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%float_1 = OpConstant %float 1 +%16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +)"; + + const std::string before = + R"(%main = OpFunction %void None %7 +%19 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +OpSelectionMerge %20 None +OpBranchConditional %true %21 %22 +%21 = OpLabel +OpStore %v %14 +OpBranch %20 +%22 = OpLabel +OpStore %v %16 +OpBranch %20 +%20 = OpLabel +%23 = OpLoad %v4float %v +OpStore %gl_FragColor %23 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %7 +%19 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +OpBranch %21 +%21 = OpLabel +OpStore %v %14 +OpBranch %20 +%20 = OpLabel +%23 = OpLoad %v4float %v +OpStore %gl_FragColor %23 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(predefs + before, + predefs + after, true, true); +} + +TEST_F(DeadBranchElimTest, IfThenElseFalse) { + // #version 140 + // + // in vec4 BaseColor; + // + // void main() + // { + // vec4 v; + // if (false) + // v = vec4(0.0,0.0,0.0,0.0); + // else + // v = vec4(1.0,1.0,1.0,1.0); + // gl_FragColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %gl_FragColor %BaseColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %gl_FragColor "gl_FragColor" +OpName %BaseColor "BaseColor" +%void = OpTypeVoid +%7 = OpTypeFunction %void +%bool = OpTypeBool +%false = OpConstantFalse %bool +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%float_0 = OpConstant %float 0 +%14 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%float_1 = OpConstant %float 1 +%16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +)"; + + const std::string before = + R"(%main = OpFunction %void None %7 +%19 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +OpSelectionMerge %20 None +OpBranchConditional %false %21 %22 +%21 = OpLabel +OpStore %v %14 +OpBranch %20 +%22 = OpLabel +OpStore %v %16 +OpBranch %20 +%20 = OpLabel +%23 = OpLoad %v4float %v +OpStore %gl_FragColor %23 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %7 +%19 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +OpBranch %22 +%22 = OpLabel +OpStore %v %16 +OpBranch %20 +%20 = OpLabel +%23 = OpLoad %v4float %v +OpStore %gl_FragColor %23 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(predefs + before, + predefs + after, true, true); +} + +TEST_F(DeadBranchElimTest, IfThenTrue) { + // #version 140 + // + // in vec4 BaseColor; + // + // void main() + // { + // vec4 v = BaseColor; + // if (true) + // v = v * vec4(0.5,0.5,0.5,0.5); + // gl_FragColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%bool = OpTypeBool +%true = OpConstantTrue %bool +%float_0_5 = OpConstant %float 0.5 +%15 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %7 +%17 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%18 = OpLoad %v4float %BaseColor +OpStore %v %18 +OpSelectionMerge %19 None +OpBranchConditional %true %20 %19 +%20 = OpLabel +%21 = OpLoad %v4float %v +%22 = OpFMul %v4float %21 %15 +OpStore %v %22 +OpBranch %19 +%19 = OpLabel +%23 = OpLoad %v4float %v +OpStore %gl_FragColor %23 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %7 +%17 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%18 = OpLoad %v4float %BaseColor +OpStore %v %18 +OpBranch %20 +%20 = OpLabel +%21 = OpLoad %v4float %v +%22 = OpFMul %v4float %21 %15 +OpStore %v %22 +OpBranch %19 +%19 = OpLabel +%23 = OpLoad %v4float %v +OpStore %gl_FragColor %23 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(predefs + before, + predefs + after, true, true); +} + +TEST_F(DeadBranchElimTest, IfThenFalse) { + // #version 140 + // + // in vec4 BaseColor; + // + // void main() + // { + // vec4 v = BaseColor; + // if (false) + // v = v * vec4(0.5,0.5,0.5,0.5); + // gl_FragColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%bool = OpTypeBool +%false = OpConstantFalse %bool +%float_0_5 = OpConstant %float 0.5 +%15 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %7 +%17 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%18 = OpLoad %v4float %BaseColor +OpStore %v %18 +OpSelectionMerge %19 None +OpBranchConditional %false %20 %19 +%20 = OpLabel +%21 = OpLoad %v4float %v +%22 = OpFMul %v4float %21 %15 +OpStore %v %22 +OpBranch %19 +%19 = OpLabel +%23 = OpLoad %v4float %v +OpStore %gl_FragColor %23 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %7 +%17 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%18 = OpLoad %v4float %BaseColor +OpStore %v %18 +OpBranch %19 +%19 = OpLabel +%23 = OpLoad %v4float %v +OpStore %gl_FragColor %23 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(predefs + before, + predefs + after, true, true); +} + +TEST_F(DeadBranchElimTest, IfThenElsePhiTrue) { + // Test handling of phi in merge block after dead branch elimination. + // Note: The SPIR-V has had store/load elimination and phi insertion + // + // #version 140 + // + // void main() + // { + // vec4 v; + // if (true) + // v = vec4(0.0,0.0,0.0,0.0); + // else + // v = vec4(1.0,1.0,1.0,1.0); + // gl_FragColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%5 = OpTypeFunction %void +%bool = OpTypeBool +%true = OpConstantTrue %bool +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%float_0 = OpConstant %float 0 +%12 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%float_1 = OpConstant %float 1 +%14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%_ptr_Input_v4float = OpTypePointer Input %v4float +)"; + + const std::string before = + R"(%main = OpFunction %void None %5 +%17 = OpLabel +OpSelectionMerge %18 None +OpBranchConditional %true %19 %20 +%19 = OpLabel +OpBranch %18 +%20 = OpLabel +OpBranch %18 +%18 = OpLabel +%21 = OpPhi %v4float %12 %19 %14 %20 +OpStore %gl_FragColor %21 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %5 +%17 = OpLabel +OpBranch %19 +%19 = OpLabel +OpBranch %18 +%18 = OpLabel +OpStore %gl_FragColor %12 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(predefs + before, + predefs + after, true, true); +} + +TEST_F(DeadBranchElimTest, IfThenElsePhiFalse) { + // Test handling of phi in merge block after dead branch elimination. + // Note: The SPIR-V has had store/load elimination and phi insertion + // + // #version 140 + // + // void main() + // { + // vec4 v; + // if (true) + // v = vec4(0.0,0.0,0.0,0.0); + // else + // v = vec4(1.0,1.0,1.0,1.0); + // gl_FragColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%5 = OpTypeFunction %void +%bool = OpTypeBool +%false = OpConstantFalse %bool +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%float_0 = OpConstant %float 0 +%12 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%float_1 = OpConstant %float 1 +%14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%_ptr_Input_v4float = OpTypePointer Input %v4float +)"; + + const std::string before = + R"(%main = OpFunction %void None %5 +%17 = OpLabel +OpSelectionMerge %18 None +OpBranchConditional %false %19 %20 +%19 = OpLabel +OpBranch %18 +%20 = OpLabel +OpBranch %18 +%18 = OpLabel +%21 = OpPhi %v4float %12 %19 %14 %20 +OpStore %gl_FragColor %21 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %5 +%17 = OpLabel +OpBranch %20 +%20 = OpLabel +OpBranch %18 +%18 = OpLabel +OpStore %gl_FragColor %14 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(predefs + before, + predefs + after, true, true); +} + +TEST_F(DeadBranchElimTest, CompoundIfThenElseFalse) { + // #version 140 + // + // layout(std140) uniform U_t + // { + // bool g_B ; + // } ; + // + // void main() + // { + // vec4 v; + // if (false) { + // if (g_B) + // v = vec4(0.0,0.0,0.0,0.0); + // else + // v = vec4(1.0,1.0,1.0,1.0); + // } else { + // if (g_B) + // v = vec4(1.0,1.0,1.0,1.0); + // else + // v = vec4(0.0,0.0,0.0,0.0); + // } + // gl_FragColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_B" +OpName %_ "" +OpName %v "v" +OpName %gl_FragColor "gl_FragColor" +OpMemberDecorate %U_t 0 Offset 0 +OpDecorate %U_t Block +OpDecorate %_ DescriptorSet 0 +%void = OpTypeVoid +%8 = OpTypeFunction %void +%bool = OpTypeBool +%false = OpConstantFalse %bool +%uint = OpTypeInt 32 0 +%U_t = OpTypeStruct %uint +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%_ptr_Uniform_uint = OpTypePointer Uniform %uint +%uint_0 = OpConstant %uint 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%float_0 = OpConstant %float 0 +%21 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%float_1 = OpConstant %float 1 +%23 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %8 +%25 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +OpSelectionMerge %26 None +OpBranchConditional %false %27 %28 +%27 = OpLabel +%29 = OpAccessChain %_ptr_Uniform_uint %_ %int_0 +%30 = OpLoad %uint %29 +%31 = OpINotEqual %bool %30 %uint_0 +OpSelectionMerge %32 None +OpBranchConditional %31 %33 %34 +%33 = OpLabel +OpStore %v %21 +OpBranch %32 +%34 = OpLabel +OpStore %v %23 +OpBranch %32 +%32 = OpLabel +OpBranch %26 +%28 = OpLabel +%35 = OpAccessChain %_ptr_Uniform_uint %_ %int_0 +%36 = OpLoad %uint %35 +%37 = OpINotEqual %bool %36 %uint_0 +OpSelectionMerge %38 None +OpBranchConditional %37 %39 %40 +%39 = OpLabel +OpStore %v %23 +OpBranch %38 +%40 = OpLabel +OpStore %v %21 +OpBranch %38 +%38 = OpLabel +OpBranch %26 +%26 = OpLabel +%41 = OpLoad %v4float %v +OpStore %gl_FragColor %41 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %8 +%25 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +OpBranch %28 +%28 = OpLabel +%35 = OpAccessChain %_ptr_Uniform_uint %_ %int_0 +%36 = OpLoad %uint %35 +%37 = OpINotEqual %bool %36 %uint_0 +OpSelectionMerge %38 None +OpBranchConditional %37 %39 %40 +%39 = OpLabel +OpStore %v %23 +OpBranch %38 +%40 = OpLabel +OpStore %v %21 +OpBranch %38 +%38 = OpLabel +OpBranch %26 +%26 = OpLabel +%41 = OpLoad %v4float %v +OpStore %gl_FragColor %41 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(predefs + before, + predefs + after, true, true); +} + +TEST_F(DeadBranchElimTest, PreventOrphanMerge) { + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%bool = OpTypeBool +%true = OpConstantTrue %bool +%float_0_5 = OpConstant %float 0.5 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %7 +%16 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%17 = OpLoad %v4float %BaseColor +OpStore %v %17 +OpSelectionMerge %18 None +OpBranchConditional %true %19 %20 +%19 = OpLabel +OpKill +%20 = OpLabel +%21 = OpLoad %v4float %v +%22 = OpVectorTimesScalar %v4float %21 %float_0_5 +OpStore %v %22 +OpBranch %18 +%18 = OpLabel +%23 = OpLoad %v4float %v +OpStore %gl_FragColor %23 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %7 +%16 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%17 = OpLoad %v4float %BaseColor +OpStore %v %17 +OpBranch %19 +%19 = OpLabel +OpKill +OpFunctionEnd +)"; + + SinglePassRunAndCheck(predefs + before, + predefs + after, true, true); +} + +TEST_F(DeadBranchElimTest, HandleOrphanMerge) { + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %foo_ "foo(" +OpName %gl_FragColor "gl_FragColor" +OpDecorate %gl_FragColor Location 0 +%void = OpTypeVoid +%6 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%9 = OpTypeFunction %v4float +%bool = OpTypeBool +%true = OpConstantTrue %bool +%float_0 = OpConstant %float 0 +%13 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%float_1 = OpConstant %float 1 +%15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %6 +%17 = OpLabel +%18 = OpFunctionCall %v4float %foo_ +OpStore %gl_FragColor %18 +OpReturn +OpFunctionEnd +)"; + + const std::string before = + R"(%foo_ = OpFunction %v4float None %9 +%19 = OpLabel +OpSelectionMerge %20 None +OpBranchConditional %true %21 %22 +%21 = OpLabel +OpReturnValue %13 +%22 = OpLabel +OpReturnValue %15 +%20 = OpLabel +%23 = OpUndef %v4float +OpReturnValue %23 +OpFunctionEnd +)"; + + const std::string after = + R"(%foo_ = OpFunction %v4float None %9 +%19 = OpLabel +OpBranch %21 +%21 = OpLabel +OpReturnValue %13 +OpFunctionEnd +)"; + + SinglePassRunAndCheck(predefs + before, + predefs + after, true, true); +} + +TEST_F(DeadBranchElimTest, KeepContinueTargetWhenKillAfterMerge) { + // #version 450 + // void main() { + // bool c; + // bool d; + // while(c) { + // if(d) { + // continue; + // } + // if(false) { + // continue; + // } + // discard; + // } + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %c "c" +OpName %d "d" +%void = OpTypeVoid +%6 = OpTypeFunction %void +%bool = OpTypeBool +%_ptr_Function_bool = OpTypePointer Function %bool +%false = OpConstantFalse %bool +)"; + + const std::string before = + R"(%main = OpFunction %void None %6 +%10 = OpLabel +%c = OpVariable %_ptr_Function_bool Function +%d = OpVariable %_ptr_Function_bool Function +OpBranch %11 +%11 = OpLabel +OpLoopMerge %12 %13 None +OpBranch %14 +%14 = OpLabel +%15 = OpLoad %bool %c +OpBranchConditional %15 %16 %12 +%16 = OpLabel +%17 = OpLoad %bool %d +OpSelectionMerge %18 None +OpBranchConditional %17 %19 %18 +%19 = OpLabel +OpBranch %13 +%18 = OpLabel +OpSelectionMerge %20 None +OpBranchConditional %false %21 %20 +%21 = OpLabel +OpBranch %13 +%20 = OpLabel +OpKill +%13 = OpLabel +OpBranch %11 +%12 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %6 +%10 = OpLabel +%c = OpVariable %_ptr_Function_bool Function +%d = OpVariable %_ptr_Function_bool Function +OpBranch %11 +%11 = OpLabel +OpLoopMerge %12 %13 None +OpBranch %14 +%14 = OpLabel +%15 = OpLoad %bool %c +OpBranchConditional %15 %16 %12 +%16 = OpLabel +%17 = OpLoad %bool %d +OpSelectionMerge %18 None +OpBranchConditional %17 %19 %18 +%19 = OpLabel +OpBranch %13 +%18 = OpLabel +OpBranch %20 +%20 = OpLabel +OpKill +%13 = OpLabel +OpBranch %11 +%12 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(predefs + before, + predefs + after, true, true); +} + +TEST_F(DeadBranchElimTest, DecorateDeleted) { + // Note: SPIR-V hand-edited to add decoration + // #version 140 + // + // in vec4 BaseColor; + // + // void main() + // { + // vec4 v = BaseColor; + // if (false) + // v = v * vec4(0.5,0.5,0.5,0.5); + // gl_FragColor = v; + // } + + const std::string predefs_before = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +OpDecorate %22 RelaxedPrecision +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%bool = OpTypeBool +%false = OpConstantFalse %bool +%float_0_5 = OpConstant %float 0.5 +%15 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string predefs_after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%bool = OpTypeBool +%false = OpConstantFalse %bool +%float_0_5 = OpConstant %float 0.5 +%16 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %7 +%17 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%18 = OpLoad %v4float %BaseColor +OpStore %v %18 +OpSelectionMerge %19 None +OpBranchConditional %false %20 %19 +%20 = OpLabel +%21 = OpLoad %v4float %v +%22 = OpFMul %v4float %21 %15 +OpStore %v %22 +OpBranch %19 +%19 = OpLabel +%23 = OpLoad %v4float %v +OpStore %gl_FragColor %23 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %8 +%18 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%19 = OpLoad %v4float %BaseColor +OpStore %v %19 +OpBranch %20 +%20 = OpLabel +%23 = OpLoad %v4float %v +OpStore %gl_FragColor %23 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs_before + before, predefs_after + after, true, true); +} + +TEST_F(DeadBranchElimTest, LoopInDeadBranch) { + // #version 450 + // + // layout(location = 0) in vec4 BaseColor; + // layout(location = 0) out vec4 OutColor; + // + // void main() + // { + // vec4 v = BaseColor; + // if (false) + // for (int i=0; i<3; i++) + // v = v * 0.5; + // OutColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %i "i" +OpName %OutColor "OutColor" +OpDecorate %BaseColor Location 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%bool = OpTypeBool +%false = OpConstantFalse %bool +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_3 = OpConstant %int 3 +%float_0_5 = OpConstant %float 0.5 +%int_1 = OpConstant %int 1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %8 +%22 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%i = OpVariable %_ptr_Function_int Function +%23 = OpLoad %v4float %BaseColor +OpStore %v %23 +OpSelectionMerge %24 None +OpBranchConditional %false %25 %24 +%25 = OpLabel +OpStore %i %int_0 +OpBranch %26 +%26 = OpLabel +OpLoopMerge %27 %28 None +OpBranch %29 +%29 = OpLabel +%30 = OpLoad %int %i +%31 = OpSLessThan %bool %30 %int_3 +OpBranchConditional %31 %32 %27 +%32 = OpLabel +%33 = OpLoad %v4float %v +%34 = OpVectorTimesScalar %v4float %33 %float_0_5 +OpStore %v %34 +OpBranch %28 +%28 = OpLabel +%35 = OpLoad %int %i +%36 = OpIAdd %int %35 %int_1 +OpStore %i %36 +OpBranch %26 +%27 = OpLabel +OpBranch %24 +%24 = OpLabel +%37 = OpLoad %v4float %v +OpStore %OutColor %37 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %8 +%22 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%i = OpVariable %_ptr_Function_int Function +%23 = OpLoad %v4float %BaseColor +OpStore %v %23 +OpBranch %24 +%24 = OpLabel +%37 = OpLoad %v4float %v +OpStore %OutColor %37 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(predefs + before, + predefs + after, true, true); +} + +TEST_F(DeadBranchElimTest, SwitchLiveCase) { + // #version 450 + // + // layout (location=0) in vec4 BaseColor; + // layout (location=0) out vec4 OutColor; + // + // void main() + // { + // switch (1) { + // case 0: + // OutColor = vec4(0.0,0.0,0.0,0.0); + // break; + // case 1: + // OutColor = vec4(0.125,0.125,0.125,0.125); + // break; + // case 2: + // OutColor = vec4(0.25,0.25,0.25,0.25); + // break; + // default: + // OutColor = vec4(1.0,1.0,1.0,1.0); + // } + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %OutColor %BaseColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %OutColor "OutColor" +OpName %BaseColor "BaseColor" +OpDecorate %OutColor Location 0 +OpDecorate %BaseColor Location 0 +%void = OpTypeVoid +%6 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%int_1 = OpConstant %int 1 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%float_0 = OpConstant %float 0 +%13 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%float_0_125 = OpConstant %float 0.125 +%15 = OpConstantComposite %v4float %float_0_125 %float_0_125 %float_0_125 %float_0_125 +%float_0_25 = OpConstant %float 0.25 +%17 = OpConstantComposite %v4float %float_0_25 %float_0_25 %float_0_25 %float_0_25 +%float_1 = OpConstant %float 1 +%19 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +)"; + + const std::string before = + R"(%main = OpFunction %void None %6 +%21 = OpLabel +OpSelectionMerge %22 None +OpSwitch %int_1 %23 0 %24 1 %25 2 %26 +%23 = OpLabel +OpStore %OutColor %19 +OpBranch %22 +%24 = OpLabel +OpStore %OutColor %13 +OpBranch %22 +%25 = OpLabel +OpStore %OutColor %15 +OpBranch %22 +%26 = OpLabel +OpStore %OutColor %17 +OpBranch %22 +%22 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %6 +%21 = OpLabel +OpBranch %25 +%25 = OpLabel +OpStore %OutColor %15 +OpBranch %22 +%22 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(predefs + before, + predefs + after, true, true); +} + +TEST_F(DeadBranchElimTest, SwitchLiveDefault) { + // #version 450 + // + // layout (location=0) in vec4 BaseColor; + // layout (location=0) out vec4 OutColor; + // + // void main() + // { + // switch (7) { + // case 0: + // OutColor = vec4(0.0,0.0,0.0,0.0); + // break; + // case 1: + // OutColor = vec4(0.125,0.125,0.125,0.125); + // break; + // case 2: + // OutColor = vec4(0.25,0.25,0.25,0.25); + // break; + // default: + // OutColor = vec4(1.0,1.0,1.0,1.0); + // } + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %OutColor %BaseColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %OutColor "OutColor" +OpName %BaseColor "BaseColor" +OpDecorate %OutColor Location 0 +OpDecorate %BaseColor Location 0 +%void = OpTypeVoid +%6 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%int_7 = OpConstant %int 7 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%float_0 = OpConstant %float 0 +%13 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%float_0_125 = OpConstant %float 0.125 +%15 = OpConstantComposite %v4float %float_0_125 %float_0_125 %float_0_125 %float_0_125 +%float_0_25 = OpConstant %float 0.25 +%17 = OpConstantComposite %v4float %float_0_25 %float_0_25 %float_0_25 %float_0_25 +%float_1 = OpConstant %float 1 +%19 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +)"; + + const std::string before = + R"(%main = OpFunction %void None %6 +%21 = OpLabel +OpSelectionMerge %22 None +OpSwitch %int_7 %23 0 %24 1 %25 2 %26 +%23 = OpLabel +OpStore %OutColor %19 +OpBranch %22 +%24 = OpLabel +OpStore %OutColor %13 +OpBranch %22 +%25 = OpLabel +OpStore %OutColor %15 +OpBranch %22 +%26 = OpLabel +OpStore %OutColor %17 +OpBranch %22 +%22 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %6 +%21 = OpLabel +OpBranch %23 +%23 = OpLabel +OpStore %OutColor %19 +OpBranch %22 +%22 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(predefs + before, + predefs + after, true, true); +} + +TEST_F(DeadBranchElimTest, SwitchLiveCaseBreakFromLoop) { + // This sample does not directly translate to GLSL/HLSL as + // direct breaks from a loop cannot be made from a switch. + // This construct is currently formed by inlining a function + // containing early returns from the cases of a switch. The + // function is wrapped in a one-trip loop and returns are + // translated to branches to the loop's merge block. + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %OutColor %BaseColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %oc "oc" +OpName %OutColor "OutColor" +OpName %BaseColor "BaseColor" +OpDecorate %OutColor Location 0 +OpDecorate %BaseColor Location 0 +%void = OpTypeVoid +%7 = OpTypeFunction %void +%bool = OpTypeBool +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%int = OpTypeInt 32 1 +%int_1 = OpConstant %int 1 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%float_0 = OpConstant %float 0 +%17 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%float_0_125 = OpConstant %float 0.125 +%19 = OpConstantComposite %v4float %float_0_125 %float_0_125 %float_0_125 %float_0_125 +%float_0_25 = OpConstant %float 0.25 +%21 = OpConstantComposite %v4float %float_0_25 %float_0_25 %float_0_25 %float_0_25 +%float_1 = OpConstant %float 1 +%23 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +)"; + + const std::string before = + R"(%main = OpFunction %void None %7 +%26 = OpLabel +%oc = OpVariable %_ptr_Function_v4float Function +OpBranch %27 +%27 = OpLabel +OpLoopMerge %28 %29 None +OpBranch %30 +%30 = OpLabel +OpSelectionMerge %31 None +OpSwitch %int_1 %31 0 %32 1 %33 2 %34 +%32 = OpLabel +OpStore %oc %17 +OpBranch %28 +%33 = OpLabel +OpStore %oc %19 +OpBranch %28 +%34 = OpLabel +OpStore %oc %21 +OpBranch %28 +%31 = OpLabel +OpStore %oc %23 +OpBranch %28 +%29 = OpLabel +OpBranchConditional %false %27 %28 +%28 = OpLabel +%35 = OpLoad %v4float %oc +OpStore %OutColor %35 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %7 +%26 = OpLabel +%oc = OpVariable %_ptr_Function_v4float Function +OpBranch %27 +%27 = OpLabel +OpLoopMerge %28 %29 None +OpBranch %30 +%30 = OpLabel +OpBranch %33 +%33 = OpLabel +OpStore %oc %19 +OpBranch %28 +%29 = OpLabel +OpBranch %27 +%28 = OpLabel +%35 = OpLoad %v4float %oc +OpStore %OutColor %35 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(predefs + before, + predefs + after, true, true); +} + +#ifdef SPIRV_EFFCEE +TEST_F(DeadBranchElimTest, LeaveContinueBackedge) { + const std::string text = R"( +; CHECK: OpLoopMerge [[merge:%\w+]] [[continue:%\w+]] None +; CHECK: [[continue]] = OpLabel +; CHECK-NEXT: OpBranchConditional {{%\w+}} {{%\w+}} [[merge]] +; CHECK-NEXT: [[merge]] = OpLabel +; CHECK-NEXT: OpReturn +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +%bool = OpTypeBool +%false = OpConstantFalse %bool +%void = OpTypeVoid +%funcTy = OpTypeFunction %void +%func = OpFunction %void None %funcTy +%1 = OpLabel +OpBranch %2 +%2 = OpLabel +OpLoopMerge %3 %4 None +OpBranch %4 +%4 = OpLabel +; Be careful we don't remove the backedge to %2 despite never taking it. +OpBranchConditional %false %2 %3 +%3 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} +TEST_F(DeadBranchElimTest, LeaveContinueBackedgeExtraBlock) { + const std::string text = R"( +; CHECK: OpBranch [[header:%\w+]] +; CHECK: OpLoopMerge [[merge:%\w+]] [[continue:%\w+]] None +; CHECK-NEXT: OpBranch [[continue]] +; CHECK-NEXT: [[continue]] = OpLabel +; CHECK-NEXT: OpBranchConditional {{%\w+}} [[extra:%\w+]] [[merge]] +; CHECK-NEXT: [[extra]] = OpLabel +; CHECK-NEXT: OpBranch [[header]] +; CHECK-NEXT: [[merge]] = OpLabel +; CHECK-NEXT: OpReturn +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +%bool = OpTypeBool +%false = OpConstantFalse %bool +%void = OpTypeVoid +%funcTy = OpTypeFunction %void +%func = OpFunction %void None %funcTy +%1 = OpLabel +OpBranch %2 +%2 = OpLabel +OpLoopMerge %3 %4 None +OpBranch %4 +%4 = OpLabel +; Be careful we don't remove the backedge to %2 despite never taking it. +OpBranchConditional %false %5 %3 +; This block remains live despite being unreachable. +%5 = OpLabel +OpBranch %2 +%3 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(DeadBranchElimTest, RemovePhiWithUnreachableContinue) { + const std::string text = R"( +; CHECK: [[entry:%\w+]] = OpLabel +; CHECK-NEXT: OpBranch [[header:%\w+]] +; CHECK: OpLoopMerge [[merge:%\w+]] [[continue:%\w+]] None +; CHECK-NEXT: OpBranch [[ret:%\w+]] +; CHECK-NEXT: [[ret]] = OpLabel +; CHECK-NEXT: OpReturn +; CHECK: [[continue]] = OpLabel +; CHECK-NEXT: OpBranch [[header]] +; CHECK: [[merge]] = OpLabel +; CHECK-NEXT: OpUnreachable +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +OpName %func "func" +OpDecorate %func LinkageAttributes "func" Export +%bool = OpTypeBool +%false = OpConstantFalse %bool +%true = OpConstantTrue %bool +%void = OpTypeVoid +%funcTy = OpTypeFunction %void +%func = OpFunction %void None %funcTy +%1 = OpLabel +OpBranch %2 +%2 = OpLabel +%phi = OpPhi %bool %false %1 %true %continue +OpLoopMerge %merge %continue None +OpBranch %3 +%3 = OpLabel +OpReturn +%continue = OpLabel +OpBranch %2 +%merge = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(DeadBranchElimTest, UnreachableLoopMergeAndContinueTargets) { + const std::string text = R"( +; CHECK: [[undef:%\w+]] = OpUndef %bool +; CHECK: OpSelectionMerge [[header:%\w+]] +; CHECK-NEXT: OpBranchConditional {{%\w+}} [[if_lab:%\w+]] [[else_lab:%\w+]] +; CHECK: OpPhi %bool %false [[if_lab]] %false [[else_lab]] [[undef]] [[continue:%\w+]] +; CHECK-NEXT: OpLoopMerge [[merge:%\w+]] [[continue]] None +; CHECK-NEXT: OpBranch [[ret:%\w+]] +; CHECK-NEXT: [[ret]] = OpLabel +; CHECK-NEXT: OpReturn +; CHECK: [[continue]] = OpLabel +; CHECK-NEXT: OpBranch [[header]] +; CHECK: [[merge]] = OpLabel +; CHECK-NEXT: OpUnreachable +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +OpName %func "func" +OpDecorate %func LinkageAttributes "func" Export +%bool = OpTypeBool +%false = OpConstantFalse %bool +%true = OpConstantTrue %bool +%void = OpTypeVoid +%funcTy = OpTypeFunction %void +%func = OpFunction %void None %funcTy +%1 = OpLabel +%c = OpUndef %bool +OpSelectionMerge %2 None +OpBranchConditional %c %if %else +%if = OpLabel +OpBranch %2 +%else = OpLabel +OpBranch %2 +%2 = OpLabel +%phi = OpPhi %bool %false %if %false %else %true %continue +OpLoopMerge %merge %continue None +OpBranch %3 +%3 = OpLabel +OpReturn +%continue = OpLabel +OpBranch %2 +%merge = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} +TEST_F(DeadBranchElimTest, EarlyReconvergence) { + const std::string text = R"( +; CHECK-NOT: OpBranchConditional +; CHECK: [[logical:%\w+]] = OpLogicalOr +; CHECK-NOT: OpPhi +; CHECK: OpLogicalAnd {{%\w+}} {{%\w+}} [[logical]] +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" +OpExecutionMode %func OriginUpperLeft +%void = OpTypeVoid +%bool = OpTypeBool +%false = OpConstantFalse %bool +%true = OpConstantTrue %bool +%func_ty = OpTypeFunction %void +%func = OpFunction %void None %func_ty +%1 = OpLabel +OpSelectionMerge %2 None +OpBranchConditional %false %3 %4 +%3 = OpLabel +%12 = OpLogicalNot %bool %true +OpBranch %2 +%4 = OpLabel +OpSelectionMerge %14 None +OpBranchConditional %false %5 %6 +%5 = OpLabel +%10 = OpLogicalAnd %bool %true %false +OpBranch %7 +%6 = OpLabel +%11 = OpLogicalOr %bool %true %false +OpBranch %7 +%7 = OpLabel +; This phi is in a block preceeding the merge %14! +%8 = OpPhi %bool %10 %5 %11 %6 +OpBranch %14 +%14 = OpLabel +OpBranch %2 +%2 = OpLabel +%9 = OpPhi %bool %12 %3 %8 %14 +%13 = OpLogicalAnd %bool %true %9 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(DeadBranchElimTest, RemoveUnreachableBlocksFloating) { + const std::string text = R"( +; CHECK: OpFunction +; CHECK-NEXT: OpLabel +; CHECK-NEXT: OpReturn +; CHECK-NEXT: OpFunctionEnd +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +OpName %func "func" +OpDecorate %func LinkageAttributes "func" Export +%void = OpTypeVoid +%1 = OpTypeFunction %void +%func = OpFunction %void None %1 +%2 = OpLabel +OpReturn +%3 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(DeadBranchElimTest, RemoveUnreachableBlocksFloatingJoin) { + const std::string text = R"( +; CHECK: OpFunction +; CHECK-NEXT: OpFunctionParameter +; CHECK-NEXT: OpLabel +; CHECK-NEXT: OpReturn +; CHECK-NEXT: OpFunctionEnd +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +OpName %func "func" +OpDecorate %func LinkageAttributes "func" Export +%void = OpTypeVoid +%bool = OpTypeBool +%false = OpConstantFalse %bool +%true = OpConstantTrue %bool +%1 = OpTypeFunction %void %bool +%func = OpFunction %void None %1 +%bool_param = OpFunctionParameter %bool +%2 = OpLabel +OpReturn +%3 = OpLabel +OpSelectionMerge %6 None +OpBranchConditional %bool_param %4 %5 +%4 = OpLabel +OpBranch %6 +%5 = OpLabel +OpBranch %6 +%6 = OpLabel +%7 = OpPhi %bool %true %4 %false %6 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(DeadBranchElimTest, RemoveUnreachableBlocksDeadPhi) { + const std::string text = R"( +; CHECK: OpFunction +; CHECK-NEXT: OpFunctionParameter +; CHECK-NEXT: OpLabel +; CHECK-NEXT: OpBranch [[label:%\w+]] +; CHECK-NEXT: [[label]] = OpLabel +; CHECK-NEXT: OpLogicalNot %bool %true +; CHECK-NEXT: OpReturn +; CHECK-NEXT: OpFunctionEnd +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +OpName %func "func" +OpDecorate %func LinkageAttributes "func" Export +%void = OpTypeVoid +%bool = OpTypeBool +%false = OpConstantFalse %bool +%true = OpConstantTrue %bool +%1 = OpTypeFunction %void %bool +%func = OpFunction %void None %1 +%bool_param = OpFunctionParameter %bool +%2 = OpLabel +OpBranch %3 +%4 = OpLabel +OpBranch %3 +%3 = OpLabel +%5 = OpPhi %bool %true %2 %false %4 +%6 = OpLogicalNot %bool %5 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(DeadBranchElimTest, RemoveUnreachableBlocksPartiallyDeadPhi) { + const std::string text = R"( +; CHECK: OpFunction +; CHECK-NEXT: [[param:%\w+]] = OpFunctionParameter +; CHECK-NEXT: OpLabel +; CHECK-NEXT: OpBranchConditional [[param]] [[merge:%\w+]] [[br:%\w+]] +; CHECK-NEXT: [[br]] = OpLabel +; CHECK-NEXT: OpBranch [[merge]] +; CHECK-NEXT: [[merge]] = OpLabel +; CHECK-NEXT: [[phi:%\w+]] = OpPhi %bool %true %2 %false [[br]] +; CHECK-NEXT: OpLogicalNot %bool [[phi]] +; CHECK-NEXT: OpReturn +; CHECK-NEXT: OpFunctionEnd +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +OpName %func "func" +OpDecorate %func LinkageAttributes "func" Export +%void = OpTypeVoid +%bool = OpTypeBool +%false = OpConstantFalse %bool +%true = OpConstantTrue %bool +%1 = OpTypeFunction %void %bool +%func = OpFunction %void None %1 +%bool_param = OpFunctionParameter %bool +%2 = OpLabel +OpBranchConditional %bool_param %3 %7 +%7 = OpLabel +OpBranch %3 +%4 = OpLabel +OpBranch %3 +%3 = OpLabel +%5 = OpPhi %bool %true %2 %false %7 %false %4 +%6 = OpLogicalNot %bool %5 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndMatch(text, true); +} + +TEST_F(DeadBranchElimTest, LiveHeaderDeadPhi) { + const std::string text = R"( +; CHECK: OpLabel +; CHECK-NOT: OpBranchConditional +; CHECK-NOT: OpPhi +; CHECK: OpLogicalNot %bool %false +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +OpName %func "func" +OpDecorate %func LinkageAttributes "func" Export +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%func_ty = OpTypeFunction %void +%func = OpFunction %void None %func_ty +%1 = OpLabel +OpSelectionMerge %3 None +OpBranchConditional %true %2 %3 +%2 = OpLabel +OpBranch %3 +%3 = OpLabel +%5 = OpPhi %bool %true %3 %false %2 +%6 = OpLogicalNot %bool %5 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(DeadBranchElimTest, ExtraBackedgeBlocksLive) { + const std::string text = R"( +; CHECK: [[entry:%\w+]] = OpLabel +; CHECK-NOT: OpSelectionMerge +; CHECK: OpBranch [[header:%\w+]] +; CHECK-NEXT: [[header]] = OpLabel +; CHECK-NEXT: OpPhi %bool %true [[entry]] %false [[backedge:%\w+]] +; CHECK-NEXT: OpLoopMerge +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +OpName %func "func" +OpDecorate %func LinkageAttributes "func" Export +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%func_ty = OpTypeFunction %void %bool +%func = OpFunction %void None %func_ty +%param = OpFunctionParameter %bool +%entry = OpLabel +OpSelectionMerge %if_merge None +; This dead branch is included to ensure the pass does work. +OpBranchConditional %false %if_merge %loop_header +%loop_header = OpLabel +; Both incoming edges are live, so the phi should be untouched. +%phi = OpPhi %bool %true %entry %false %backedge +OpLoopMerge %loop_merge %continue None +OpBranchConditional %param %loop_merge %continue +%continue = OpLabel +OpBranch %backedge +%backedge = OpLabel +OpBranch %loop_header +%loop_merge = OpLabel +OpBranch %if_merge +%if_merge = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(DeadBranchElimTest, ExtraBackedgeBlocksUnreachable) { + const std::string text = R"( +; CHECK: [[entry:%\w+]] = OpLabel +; CHECK-NEXT: OpBranch [[header:%\w+]] +; CHECK-NEXT: [[header]] = OpLabel +; CHECK-NEXT: OpLoopMerge [[merge:%\w+]] [[continue:%\w+]] None +; CHECK-NEXT: OpBranch [[merge]] +; CHECK-NEXT: [[continue]] = OpLabel +; CHECK-NEXT: OpBranch [[header]] +; CHECK-NEXT: [[merge]] = OpLabel +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +OpName %func "func" +OpDecorate %func LinkageAttributes "func" Export +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%func_ty = OpTypeFunction %void %bool +%func = OpFunction %void None %func_ty +%param = OpFunctionParameter %bool +%entry = OpLabel +OpBranch %loop_header +%loop_header = OpLabel +; Since the continue is unreachable, %backedge will be removed. The phi will +; instead require an edge from %continue. +%phi = OpPhi %bool %true %entry %false %backedge +OpLoopMerge %merge %continue None +OpBranch %merge +%continue = OpLabel +OpBranch %backedge +%backedge = OpLabel +OpBranch %loop_header +%merge = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(DeadBranchElimTest, NoUnnecessaryChanges) { + const std::string text = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%undef = OpUndef %bool +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%1 = OpLabel +OpBranch %2 +%2 = OpLabel +OpLoopMerge %4 %5 None +OpBranch %6 +%6 = OpLabel +OpReturn +%5 = OpLabel +OpBranch %2 +%4 = OpLabel +OpUnreachable +OpFunctionEnd +)"; + + auto result = SinglePassRunToBinary(text, true); + EXPECT_EQ(std::get<1>(result), opt::Pass::Status::SuccessWithoutChange); +} + +TEST_F(DeadBranchElimTest, ExtraBackedgePartiallyDead) { + const std::string text = R"( +; CHECK: OpLabel +; CHECK: [[header:%\w+]] = OpLabel +; CHECK: OpLoopMerge [[merge:%\w+]] [[continue:%\w+]] None +; CHECK: [[continue]] = OpLabel +; CHECK: OpBranch [[extra:%\w+]] +; CHECK: [[extra]] = OpLabel +; CHECK-NOT: OpSelectionMerge +; CHECK-NEXT: OpBranch [[else:%\w+]] +; CHECK-NEXT: [[else]] = OpLabel +; CHECK-NEXT: OpLogicalOr +; CHECK-NEXT: OpBranch [[backedge:%\w+]] +; CHECK-NEXT: [[backedge:%\w+]] = OpLabel +; CHECK-NEXT: OpBranch [[header]] +; CHECK-NEXT: [[merge]] = OpLabel +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +OpName %func "func" +OpDecorate %func LinkageAttributes "func" Export +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%func_ty = OpTypeFunction %void %bool +%func = OpFunction %void None %func_ty +%param = OpFunctionParameter %bool +%entry = OpLabel +OpBranch %loop_header +%loop_header = OpLabel +OpLoopMerge %loop_merge %continue None +OpBranchConditional %param %loop_merge %continue +%continue = OpLabel +OpBranch %extra +%extra = OpLabel +OpSelectionMerge %backedge None +OpBranchConditional %false %then %else +%then = OpLabel +%and = OpLogicalAnd %bool %true %false +OpBranch %backedge +%else = OpLabel +%or = OpLogicalOr %bool %true %false +OpBranch %backedge +%backedge = OpLabel +OpBranch %loop_header +%loop_merge = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(DeadBranchElimTest, UnreachableContinuePhiInMerge) { + const std::string text = R"( +; CHECK: [[entry:%\w+]] = OpLabel +; CHECK-NEXT: OpBranch [[header:%\w+]] +; CHECK-NEXT: [[header]] = OpLabel +; CHECK-NEXT: OpLoopMerge [[merge:%\w+]] [[continue:%\w+]] None +; CHECK-NEXT: OpBranch [[label:%\w+]] +; CHECK-NEXT: [[label]] = OpLabel +; CHECK-NEXT: [[fadd:%\w+]] = OpFAdd +; CHECK-NEXT: OpBranch [[label:%\w+]] +; CHECK-NEXT: [[label]] = OpLabel +; CHECK-NEXT: OpBranch [[merge]] +; CHECK-NEXT: [[continue]] = OpLabel +; CHECK-NEXT: OpBranch [[header]] +; CHECK-NEXT: [[merge]] = OpLabel +; CHECK-NEXT: OpStore {{%\w+}} [[fadd]] + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %o + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 430 + OpSourceExtension "GL_GOOGLE_cpp_style_line_directive" + OpSourceExtension "GL_GOOGLE_include_directive" + OpName %main "main" + OpName %o "o" + OpName %S "S" + OpMemberName %S 0 "a" + OpName %U_t "U_t" + OpMemberName %U_t 0 "g_F" + OpMemberName %U_t 1 "g_F2" + OpDecorate %o Location 0 + OpMemberDecorate %S 0 Offset 0 + OpMemberDecorate %U_t 0 Volatile + OpMemberDecorate %U_t 0 Offset 0 + OpMemberDecorate %U_t 1 Offset 4 + OpDecorate %U_t BufferBlock + %void = OpTypeVoid + %7 = OpTypeFunction %void + %float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float + %float_0 = OpConstant %float 0 + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %int_10 = OpConstant %int 10 + %bool = OpTypeBool + %true = OpConstantTrue %bool + %float_1 = OpConstant %float 1 + %float_5 = OpConstant %float 5 + %int_1 = OpConstant %int 1 +%_ptr_Output_float = OpTypePointer Output %float + %o = OpVariable %_ptr_Output_float Output + %S = OpTypeStruct %float + %U_t = OpTypeStruct %S %S +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t + %main = OpFunction %void None %7 + %22 = OpLabel + OpBranch %23 + %23 = OpLabel + %24 = OpPhi %float %float_0 %22 %25 %26 + %27 = OpPhi %int %int_0 %22 %28 %26 + OpLoopMerge %29 %26 None + OpBranch %40 + %40 = OpLabel + %25 = OpFAdd %float %24 %float_1 + OpSelectionMerge %30 None + OpBranchConditional %true %31 %30 + %31 = OpLabel + OpBranch %29 + %30 = OpLabel + OpBranch %26 + %26 = OpLabel + %28 = OpIAdd %int %27 %int_1 + %32 = OpSLessThan %bool %27 %int_10 +; continue block branches to the header or another none dead block. + OpBranchConditional %32 %23 %29 + %29 = OpLabel + %33 = OpPhi %float %24 %26 %25 %31 + OpStore %o %33 + OpReturn + OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(DeadBranchElimTest, NonStructuredIf) { + const std::string text = R"( +; CHECK-NOT: OpBranchConditional +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +OpDecorate %func LinkageAttributes "func" Export +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%entry = OpLabel +OpBranchConditional %true %then %else +%then = OpLabel +OpBranch %final +%else = OpLabel +OpBranch %final +%final = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} +#endif + +// TODO(greg-lunarg): Add tests to verify handling of these cases: +// +// More complex control flow +// Others? + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dead_insert_elim_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dead_insert_elim_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dead_insert_elim_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dead_insert_elim_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,685 @@ +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using DeadInsertElimTest = PassTest<::testing::Test>; + +TEST_F(DeadInsertElimTest, InsertAfterInsertElim) { + // With two insertions to the same offset, the first is dead. + // + // Note: The SPIR-V assembly has had store/load elimination + // performed to allow the inserts and extracts to directly + // reference each other. + // + // #version 450 + // + // layout (location=0) in float In0; + // layout (location=1) in float In1; + // layout (location=2) in vec2 In2; + // layout (location=0) out vec4 OutColor; + // + // void main() + // { + // vec2 v = In2; + // v.x = In0 + In1; // dead + // v.x = 0.0; + // OutColor = v.xyxy; + // } + + const std::string before_predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %In2 %In0 %In1 %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %In2 "In2" +OpName %In0 "In0" +OpName %In1 "In1" +OpName %OutColor "OutColor" +OpName %_Globals_ "_Globals_" +OpMemberName %_Globals_ 0 "g_b" +OpMemberName %_Globals_ 1 "g_n" +OpName %_ "" +OpDecorate %In2 Location 2 +OpDecorate %In0 Location 0 +OpDecorate %In1 Location 1 +OpDecorate %OutColor Location 0 +OpMemberDecorate %_Globals_ 0 Offset 0 +OpMemberDecorate %_Globals_ 1 Offset 4 +OpDecorate %_Globals_ Block +OpDecorate %_ DescriptorSet 0 +OpDecorate %_ Binding 0 +%void = OpTypeVoid +%11 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v2float = OpTypeVector %float 2 +%_ptr_Function_v2float = OpTypePointer Function %v2float +%_ptr_Input_v2float = OpTypePointer Input %v2float +%In2 = OpVariable %_ptr_Input_v2float Input +%_ptr_Input_float = OpTypePointer Input %float +%In0 = OpVariable %_ptr_Input_float Input +%In1 = OpVariable %_ptr_Input_float Input +%uint = OpTypeInt 32 0 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%int = OpTypeInt 32 1 +%_Globals_ = OpTypeStruct %uint %int +%_ptr_Uniform__Globals_ = OpTypePointer Uniform %_Globals_ +%_ = OpVariable %_ptr_Uniform__Globals_ Uniform +)"; + + const std::string after_predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %In2 %In0 %In1 %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %In2 "In2" +OpName %In0 "In0" +OpName %In1 "In1" +OpName %OutColor "OutColor" +OpName %_Globals_ "_Globals_" +OpMemberName %_Globals_ 0 "g_b" +OpMemberName %_Globals_ 1 "g_n" +OpName %_ "" +OpDecorate %In2 Location 2 +OpDecorate %In0 Location 0 +OpDecorate %In1 Location 1 +OpDecorate %OutColor Location 0 +OpMemberDecorate %_Globals_ 0 Offset 0 +OpMemberDecorate %_Globals_ 1 Offset 4 +OpDecorate %_Globals_ Block +OpDecorate %_ DescriptorSet 0 +OpDecorate %_ Binding 0 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v2float = OpTypeVector %float 2 +%_ptr_Function_v2float = OpTypePointer Function %v2float +%_ptr_Input_v2float = OpTypePointer Input %v2float +%In2 = OpVariable %_ptr_Input_v2float Input +%_ptr_Input_float = OpTypePointer Input %float +%In0 = OpVariable %_ptr_Input_float Input +%In1 = OpVariable %_ptr_Input_float Input +%uint = OpTypeInt 32 0 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%int = OpTypeInt 32 1 +%_Globals_ = OpTypeStruct %uint %int +%_ptr_Uniform__Globals_ = OpTypePointer Uniform %_Globals_ +%_ = OpVariable %_ptr_Uniform__Globals_ Uniform +)"; + + const std::string before = + R"(%main = OpFunction %void None %11 +%25 = OpLabel +%26 = OpLoad %v2float %In2 +%27 = OpLoad %float %In0 +%28 = OpLoad %float %In1 +%29 = OpFAdd %float %27 %28 +%35 = OpCompositeInsert %v2float %29 %26 0 +%37 = OpCompositeInsert %v2float %float_0 %35 0 +%33 = OpVectorShuffle %v4float %37 %37 0 1 0 1 +OpStore %OutColor %33 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %10 +%23 = OpLabel +%24 = OpLoad %v2float %In2 +%29 = OpCompositeInsert %v2float %float_0 %24 0 +%30 = OpVectorShuffle %v4float %29 %29 0 1 0 1 +OpStore %OutColor %30 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + before_predefs + before, after_predefs + after, true, true); +} + +TEST_F(DeadInsertElimTest, DeadInsertInChainWithPhi) { + // Dead insert eliminated with phi in insertion chain. + // + // Note: The SPIR-V assembly has had store/load elimination + // performed to allow the inserts and extracts to directly + // reference each other. + // + // #version 450 + // + // layout (location=0) in vec4 In0; + // layout (location=1) in float In1; + // layout (location=2) in float In2; + // layout (location=0) out vec4 OutColor; + // + // layout(std140, binding = 0 ) uniform _Globals_ + // { + // bool g_b; + // }; + // + // void main() + // { + // vec4 v = In0; + // v.z = In1 + In2; + // if (g_b) v.w = 1.0; + // OutColor = vec4(v.x,v.y,0.0,v.w); + // } + + const std::string before_predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %In0 %In1 %In2 %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %In0 "In0" +OpName %In1 "In1" +OpName %In2 "In2" +OpName %_Globals_ "_Globals_" +OpMemberName %_Globals_ 0 "g_b" +OpName %_ "" +OpName %OutColor "OutColor" +OpDecorate %In0 Location 0 +OpDecorate %In1 Location 1 +OpDecorate %In2 Location 2 +OpMemberDecorate %_Globals_ 0 Offset 0 +OpDecorate %_Globals_ Block +OpDecorate %_ DescriptorSet 0 +OpDecorate %_ Binding 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%11 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%In0 = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float +%In1 = OpVariable %_ptr_Input_float Input +%In2 = OpVariable %_ptr_Input_float Input +%uint = OpTypeInt 32 0 +%_ptr_Function_float = OpTypePointer Function %float +%_Globals_ = OpTypeStruct %uint +%_ptr_Uniform__Globals_ = OpTypePointer Uniform %_Globals_ +%_ = OpVariable %_ptr_Uniform__Globals_ Uniform +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%_ptr_Uniform_uint = OpTypePointer Uniform %uint +%bool = OpTypeBool +%uint_0 = OpConstant %uint 0 +%float_1 = OpConstant %float 1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%float_0 = OpConstant %float 0 +)"; + + const std::string after_predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %In0 %In1 %In2 %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %In0 "In0" +OpName %In1 "In1" +OpName %In2 "In2" +OpName %_Globals_ "_Globals_" +OpMemberName %_Globals_ 0 "g_b" +OpName %_ "" +OpName %OutColor "OutColor" +OpDecorate %In0 Location 0 +OpDecorate %In1 Location 1 +OpDecorate %In2 Location 2 +OpMemberDecorate %_Globals_ 0 Offset 0 +OpDecorate %_Globals_ Block +OpDecorate %_ DescriptorSet 0 +OpDecorate %_ Binding 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%In0 = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float +%In1 = OpVariable %_ptr_Input_float Input +%In2 = OpVariable %_ptr_Input_float Input +%uint = OpTypeInt 32 0 +%_ptr_Function_float = OpTypePointer Function %float +%_Globals_ = OpTypeStruct %uint +%_ptr_Uniform__Globals_ = OpTypePointer Uniform %_Globals_ +%_ = OpVariable %_ptr_Uniform__Globals_ Uniform +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%_ptr_Uniform_uint = OpTypePointer Uniform %uint +%bool = OpTypeBool +%uint_0 = OpConstant %uint 0 +%float_1 = OpConstant %float 1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%float_0 = OpConstant %float 0 +)"; + + const std::string before = + R"(%main = OpFunction %void None %11 +%31 = OpLabel +%32 = OpLoad %v4float %In0 +%33 = OpLoad %float %In1 +%34 = OpLoad %float %In2 +%35 = OpFAdd %float %33 %34 +%51 = OpCompositeInsert %v4float %35 %32 2 +%37 = OpAccessChain %_ptr_Uniform_uint %_ %int_0 +%38 = OpLoad %uint %37 +%39 = OpINotEqual %bool %38 %uint_0 +OpSelectionMerge %40 None +OpBranchConditional %39 %41 %40 +%41 = OpLabel +%53 = OpCompositeInsert %v4float %float_1 %51 3 +OpBranch %40 +%40 = OpLabel +%60 = OpPhi %v4float %51 %31 %53 %41 +%55 = OpCompositeExtract %float %60 0 +%57 = OpCompositeExtract %float %60 1 +%59 = OpCompositeExtract %float %60 3 +%49 = OpCompositeConstruct %v4float %55 %57 %float_0 %59 +OpStore %OutColor %49 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %10 +%27 = OpLabel +%28 = OpLoad %v4float %In0 +%33 = OpAccessChain %_ptr_Uniform_uint %_ %int_0 +%34 = OpLoad %uint %33 +%35 = OpINotEqual %bool %34 %uint_0 +OpSelectionMerge %36 None +OpBranchConditional %35 %37 %36 +%37 = OpLabel +%38 = OpCompositeInsert %v4float %float_1 %28 3 +OpBranch %36 +%36 = OpLabel +%39 = OpPhi %v4float %28 %27 %38 %37 +%40 = OpCompositeExtract %float %39 0 +%41 = OpCompositeExtract %float %39 1 +%42 = OpCompositeExtract %float %39 3 +%43 = OpCompositeConstruct %v4float %40 %41 %float_0 %42 +OpStore %OutColor %43 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + before_predefs + before, after_predefs + after, true, true); +} + +TEST_F(DeadInsertElimTest, DeadInsertTwoPasses) { + // Dead insert which requires two passes to eliminate + // + // Note: The SPIR-V assembly has had store/load elimination + // performed to allow the inserts and extracts to directly + // reference each other. + // + // #version 450 + // + // layout (location=0) in vec4 In0; + // layout (location=1) in float In1; + // layout (location=2) in float In2; + // layout (location=0) out vec4 OutColor; + // + // layout(std140, binding = 0 ) uniform _Globals_ + // { + // bool g_b; + // bool g_b2; + // }; + // + // void main() + // { + // vec4 v1, v2; + // v1 = In0; + // v1.y = In1 + In2; // dead, second pass + // if (g_b) v1.x = 1.0; + // v2.x = v1.x; + // v2.y = v1.y; // dead, first pass + // if (g_b2) v2.x = 0.0; + // OutColor = vec4(v2.x,v2.x,0.0,1.0); + // } + + const std::string before_predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %In0 %In1 %In2 %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %In0 "In0" +OpName %In1 "In1" +OpName %In2 "In2" +OpName %_Globals_ "_Globals_" +OpMemberName %_Globals_ 0 "g_b" +OpMemberName %_Globals_ 1 "g_b2" +OpName %_ "" +OpName %OutColor "OutColor" +OpDecorate %In0 Location 0 +OpDecorate %In1 Location 1 +OpDecorate %In2 Location 2 +OpMemberDecorate %_Globals_ 0 Offset 0 +OpMemberDecorate %_Globals_ 1 Offset 4 +OpDecorate %_Globals_ Block +OpDecorate %_ DescriptorSet 0 +OpDecorate %_ Binding 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%In0 = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float +%In1 = OpVariable %_ptr_Input_float Input +%In2 = OpVariable %_ptr_Input_float Input +%uint = OpTypeInt 32 0 +%_Globals_ = OpTypeStruct %uint %uint +%_ptr_Uniform__Globals_ = OpTypePointer Uniform %_Globals_ +%_ = OpVariable %_ptr_Uniform__Globals_ Uniform +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%_ptr_Uniform_uint = OpTypePointer Uniform %uint +%bool = OpTypeBool +%uint_0 = OpConstant %uint 0 +%float_1 = OpConstant %float 1 +%int_1 = OpConstant %int 1 +%float_0 = OpConstant %float 0 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%27 = OpUndef %v4float +)"; + + const std::string after_predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %In0 %In1 %In2 %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %In0 "In0" +OpName %In1 "In1" +OpName %In2 "In2" +OpName %_Globals_ "_Globals_" +OpMemberName %_Globals_ 0 "g_b" +OpMemberName %_Globals_ 1 "g_b2" +OpName %_ "" +OpName %OutColor "OutColor" +OpDecorate %In0 Location 0 +OpDecorate %In1 Location 1 +OpDecorate %In2 Location 2 +OpMemberDecorate %_Globals_ 0 Offset 0 +OpMemberDecorate %_Globals_ 1 Offset 4 +OpDecorate %_Globals_ Block +OpDecorate %_ DescriptorSet 0 +OpDecorate %_ Binding 0 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%In0 = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float +%In1 = OpVariable %_ptr_Input_float Input +%In2 = OpVariable %_ptr_Input_float Input +%uint = OpTypeInt 32 0 +%_Globals_ = OpTypeStruct %uint %uint +%_ptr_Uniform__Globals_ = OpTypePointer Uniform %_Globals_ +%_ = OpVariable %_ptr_Uniform__Globals_ Uniform +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%_ptr_Uniform_uint = OpTypePointer Uniform %uint +%bool = OpTypeBool +%uint_0 = OpConstant %uint 0 +%float_1 = OpConstant %float 1 +%int_1 = OpConstant %int 1 +%float_0 = OpConstant %float 0 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%27 = OpUndef %v4float +)"; + + const std::string before = + R"(%main = OpFunction %void None %10 +%28 = OpLabel +%29 = OpLoad %v4float %In0 +%30 = OpLoad %float %In1 +%31 = OpLoad %float %In2 +%32 = OpFAdd %float %30 %31 +%33 = OpCompositeInsert %v4float %32 %29 1 +%34 = OpAccessChain %_ptr_Uniform_uint %_ %int_0 +%35 = OpLoad %uint %34 +%36 = OpINotEqual %bool %35 %uint_0 +OpSelectionMerge %37 None +OpBranchConditional %36 %38 %37 +%38 = OpLabel +%39 = OpCompositeInsert %v4float %float_1 %33 0 +OpBranch %37 +%37 = OpLabel +%40 = OpPhi %v4float %33 %28 %39 %38 +%41 = OpCompositeExtract %float %40 0 +%42 = OpCompositeInsert %v4float %41 %27 0 +%43 = OpCompositeExtract %float %40 1 +%44 = OpCompositeInsert %v4float %43 %42 1 +%45 = OpAccessChain %_ptr_Uniform_uint %_ %int_1 +%46 = OpLoad %uint %45 +%47 = OpINotEqual %bool %46 %uint_0 +OpSelectionMerge %48 None +OpBranchConditional %47 %49 %48 +%49 = OpLabel +%50 = OpCompositeInsert %v4float %float_0 %44 0 +OpBranch %48 +%48 = OpLabel +%51 = OpPhi %v4float %44 %37 %50 %49 +%52 = OpCompositeExtract %float %51 0 +%53 = OpCompositeExtract %float %51 0 +%54 = OpCompositeConstruct %v4float %52 %53 %float_0 %float_1 +OpStore %OutColor %54 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %10 +%28 = OpLabel +%29 = OpLoad %v4float %In0 +%34 = OpAccessChain %_ptr_Uniform_uint %_ %int_0 +%35 = OpLoad %uint %34 +%36 = OpINotEqual %bool %35 %uint_0 +OpSelectionMerge %37 None +OpBranchConditional %36 %38 %37 +%38 = OpLabel +%39 = OpCompositeInsert %v4float %float_1 %29 0 +OpBranch %37 +%37 = OpLabel +%40 = OpPhi %v4float %29 %28 %39 %38 +%41 = OpCompositeExtract %float %40 0 +%42 = OpCompositeInsert %v4float %41 %27 0 +%45 = OpAccessChain %_ptr_Uniform_uint %_ %int_1 +%46 = OpLoad %uint %45 +%47 = OpINotEqual %bool %46 %uint_0 +OpSelectionMerge %48 None +OpBranchConditional %47 %49 %48 +%49 = OpLabel +%50 = OpCompositeInsert %v4float %float_0 %42 0 +OpBranch %48 +%48 = OpLabel +%51 = OpPhi %v4float %42 %37 %50 %49 +%52 = OpCompositeExtract %float %51 0 +%53 = OpCompositeExtract %float %51 0 +%54 = OpCompositeConstruct %v4float %52 %53 %float_0 %float_1 +OpStore %OutColor %54 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + before_predefs + before, after_predefs + after, true, true); +} + +TEST_F(DeadInsertElimTest, DeadInsertInCycleToDo) { + // Dead insert in chain with cycle. Demonstrates analysis can handle + // cycles in chains. + // + // TODO(greg-lunarg): Improve algorithm to remove dead insert into v.y. Will + // likely require similar logic to ADCE. + // + // Note: The SPIR-V assembly has had store/load elimination + // performed to allow the inserts and extracts to directly + // reference each other. + // + // #version 450 + // + // layout (location=0) in vec4 In0; + // layout (location=1) in float In1; + // layout (location=2) in float In2; + // layout (location=0) out vec4 OutColor; + // + // layout(std140, binding = 0 ) uniform _Globals_ + // { + // int g_n ; + // }; + // + // void main() + // { + // vec2 v = vec2(0.0, 1.0); + // for (int i = 0; i < g_n; i++) { + // v.x = v.x + 1; + // v.y = v.y * 0.9; // dead + // } + // OutColor = vec4(v.x); + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %OutColor %In0 %In1 %In2 +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %_Globals_ "_Globals_" +OpMemberName %_Globals_ 0 "g_n" +OpName %_ "" +OpName %OutColor "OutColor" +OpName %In0 "In0" +OpName %In1 "In1" +OpName %In2 "In2" +OpMemberDecorate %_Globals_ 0 Offset 0 +OpDecorate %_Globals_ Block +OpDecorate %_ DescriptorSet 0 +OpDecorate %_ Binding 0 +OpDecorate %OutColor Location 0 +OpDecorate %In0 Location 0 +OpDecorate %In1 Location 1 +OpDecorate %In2 Location 2 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v2float = OpTypeVector %float 2 +%_ptr_Function_v2float = OpTypePointer Function %v2float +%float_0 = OpConstant %float 0 +%float_1 = OpConstant %float 1 +%16 = OpConstantComposite %v2float %float_0 %float_1 +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%_Globals_ = OpTypeStruct %int +%_ptr_Uniform__Globals_ = OpTypePointer Uniform %_Globals_ +%_ = OpVariable %_ptr_Uniform__Globals_ Uniform +%_ptr_Uniform_int = OpTypePointer Uniform %int +%bool = OpTypeBool +%float_0_75 = OpConstant %float 0.75 +%int_1 = OpConstant %int 1 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%_ptr_Input_v4float = OpTypePointer Input %v4float +%In0 = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float +%In1 = OpVariable %_ptr_Input_float Input +%In2 = OpVariable %_ptr_Input_float Input +%main = OpFunction %void None %10 +%29 = OpLabel +OpBranch %30 +%30 = OpLabel +%31 = OpPhi %v2float %16 %29 %32 %33 +%34 = OpPhi %int %int_0 %29 %35 %33 +OpLoopMerge %36 %33 None +OpBranch %37 +%37 = OpLabel +%38 = OpAccessChain %_ptr_Uniform_int %_ %int_0 +%39 = OpLoad %int %38 +%40 = OpSLessThan %bool %34 %39 +OpBranchConditional %40 %41 %36 +%41 = OpLabel +%42 = OpCompositeExtract %float %31 0 +%43 = OpFAdd %float %42 %float_1 +%44 = OpCompositeInsert %v2float %43 %31 0 +%45 = OpCompositeExtract %float %44 1 +%46 = OpFMul %float %45 %float_0_75 +%32 = OpCompositeInsert %v2float %46 %44 1 +OpBranch %33 +%33 = OpLabel +%35 = OpIAdd %int %34 %int_1 +OpBranch %30 +%36 = OpLabel +%47 = OpCompositeExtract %float %31 0 +%48 = OpCompositeConstruct %v4float %47 %47 %47 %47 +OpStore %OutColor %48 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, + true); +} + +// TODO(greg-lunarg): Add tests to verify handling of these cases: +// + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dead_variable_elim_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dead_variable_elim_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dead_variable_elim_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dead_variable_elim_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,299 @@ +// Copyright (c) 2017 Google 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. + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using DeadVariableElimTest = PassTest<::testing::Test>; + +// %dead is unused. Make sure we remove it along with its name. +TEST_F(DeadVariableElimTest, RemoveUnreferenced) { + const std::string before = + R"(OpCapability Shader +OpCapability Linkage +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 150 +OpName %main "main" +OpName %dead "dead" +%void = OpTypeVoid +%5 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Private_float = OpTypePointer Private %float +%dead = OpVariable %_ptr_Private_float Private +%main = OpFunction %void None %5 +%8 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Shader +OpCapability Linkage +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 150 +OpName %main "main" +%void = OpTypeVoid +%5 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Private_float = OpTypePointer Private %float +%main = OpFunction %void None %5 +%8 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(before, after, true, + true); +} + +// Since %dead is exported, make sure we keep it. It could be referenced +// somewhere else. +TEST_F(DeadVariableElimTest, KeepExported) { + const std::string before = + R"(OpCapability Shader +OpCapability Linkage +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 150 +OpName %main "main" +OpName %dead "dead" +OpDecorate %dead LinkageAttributes "dead" Export +%void = OpTypeVoid +%5 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Private_float = OpTypePointer Private %float +%dead = OpVariable %_ptr_Private_float Private +%main = OpFunction %void None %5 +%8 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(before, before, true, + true); +} + +// Delete %dead because it is unreferenced. Then %initializer becomes +// unreferenced, so remove it as well. +TEST_F(DeadVariableElimTest, RemoveUnreferencedWithInit1) { + const std::string before = + R"(OpCapability Shader +OpCapability Linkage +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 150 +OpName %main "main" +OpName %dead "dead" +OpName %initializer "initializer" +%void = OpTypeVoid +%6 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Private_float = OpTypePointer Private %float +%initializer = OpVariable %_ptr_Private_float Private +%dead = OpVariable %_ptr_Private_float Private %initializer +%main = OpFunction %void None %6 +%9 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Shader +OpCapability Linkage +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 150 +OpName %main "main" +%void = OpTypeVoid +%6 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Private_float = OpTypePointer Private %float +%main = OpFunction %void None %6 +%9 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(before, after, true, + true); +} + +// Delete %dead because it is unreferenced. In this case, the initialized has +// another reference, and should not be removed. +TEST_F(DeadVariableElimTest, RemoveUnreferencedWithInit2) { + const std::string before = + R"(OpCapability Shader +OpCapability Linkage +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 150 +OpName %main "main" +OpName %dead "dead" +OpName %initializer "initializer" +%void = OpTypeVoid +%6 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Private_float = OpTypePointer Private %float +%initializer = OpVariable %_ptr_Private_float Private +%dead = OpVariable %_ptr_Private_float Private %initializer +%main = OpFunction %void None %6 +%9 = OpLabel +%10 = OpLoad %float %initializer +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Shader +OpCapability Linkage +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 150 +OpName %main "main" +OpName %initializer "initializer" +%void = OpTypeVoid +%6 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Private_float = OpTypePointer Private %float +%initializer = OpVariable %_ptr_Private_float Private +%main = OpFunction %void None %6 +%9 = OpLabel +%10 = OpLoad %float %initializer +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(before, after, true, + true); +} + +// Keep %live because it is used, and its initializer. +TEST_F(DeadVariableElimTest, KeepReferenced) { + const std::string before = + R"(OpCapability Shader +OpCapability Linkage +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 150 +OpName %main "main" +OpName %live "live" +OpName %initializer "initializer" +%void = OpTypeVoid +%6 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Private_float = OpTypePointer Private %float +%initializer = OpVariable %_ptr_Private_float Private +%live = OpVariable %_ptr_Private_float Private %initializer +%main = OpFunction %void None %6 +%9 = OpLabel +%10 = OpLoad %float %live +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(before, before, true, + true); +} + +// This test that the decoration associated with a variable are removed when the +// variable is removed. +TEST_F(DeadVariableElimTest, RemoveVariableAndDecorations) { + const std::string before = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %main "main" +OpSource GLSL 450 +OpName %main "main" +OpName %B "B" +OpMemberName %B 0 "a" +OpName %Bdat "Bdat" +OpMemberDecorate %B 0 Offset 0 +OpDecorate %B BufferBlock +OpDecorate %Bdat DescriptorSet 0 +OpDecorate %Bdat Binding 0 +%void = OpTypeVoid +%6 = OpTypeFunction %void +%uint = OpTypeInt 32 0 +%B = OpTypeStruct %uint +%_ptr_Uniform_B = OpTypePointer Uniform %B +%Bdat = OpVariable %_ptr_Uniform_B Uniform +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%uint_1 = OpConstant %uint 1 +%_ptr_Uniform_uint = OpTypePointer Uniform %uint +%main = OpFunction %void None %6 +%13 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %main "main" +OpSource GLSL 450 +OpName %main "main" +OpName %B "B" +OpMemberName %B 0 "a" +OpMemberDecorate %B 0 Offset 0 +OpDecorate %B BufferBlock +%void = OpTypeVoid +%6 = OpTypeFunction %void +%uint = OpTypeInt 32 0 +%B = OpTypeStruct %uint +%_ptr_Uniform_B = OpTypePointer Uniform %B +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%uint_1 = OpConstant %uint 1 +%_ptr_Uniform_uint = OpTypePointer Uniform %uint +%main = OpFunction %void None %6 +%13 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(before, after, true, + true); +} +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/decoration_manager_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/decoration_manager_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/decoration_manager_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/decoration_manager_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1162 @@ +// Copyright (c) 2017 Pierre Moreau +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include + +#include "source/opt/build_module.h" +#include "source/opt/decoration_manager.h" +#include "source/opt/ir_context.h" +#include "source/spirv_constant.h" +#include "unit_spirv.h" + +namespace { + +using spvtest::MakeVector; +using spvtools::ir::Instruction; +using spvtools::ir::IRContext; +using spvtools::opt::analysis::DecorationManager; + +class DecorationManagerTest : public ::testing::Test { + public: + DecorationManagerTest() + : tools_(SPV_ENV_UNIVERSAL_1_2), + context_(), + consumer_([this](spv_message_level_t level, const char*, + const spv_position_t& position, const char* message) { + if (!error_message_.empty()) error_message_ += "\n"; + switch (level) { + case SPV_MSG_FATAL: + case SPV_MSG_INTERNAL_ERROR: + case SPV_MSG_ERROR: + error_message_ += "ERROR"; + break; + case SPV_MSG_WARNING: + error_message_ += "WARNING"; + break; + case SPV_MSG_INFO: + error_message_ += "INFO"; + break; + case SPV_MSG_DEBUG: + error_message_ += "DEBUG"; + break; + } + error_message_ += + ": " + std::to_string(position.index) + ": " + message; + }), + disassemble_options_(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER), + error_message_() { + tools_.SetMessageConsumer(consumer_); + } + + virtual void TearDown() override { error_message_.clear(); } + + DecorationManager* GetDecorationManager(const std::string& text) { + context_ = spvtools::BuildModule(SPV_ENV_UNIVERSAL_1_2, consumer_, text); + if (context_.get()) + return context_->get_decoration_mgr(); + else + return nullptr; + } + + // Disassembles |binary| and outputs the result in |text|. If |text| is a + // null pointer, SPV_ERROR_INVALID_POINTER is returned. + spv_result_t Disassemble(const std::vector& binary, + std::string* text) { + if (!text) return SPV_ERROR_INVALID_POINTER; + return tools_.Disassemble(binary, text, disassemble_options_) + ? SPV_SUCCESS + : SPV_ERROR_INVALID_BINARY; + } + + // Returns the accumulated error messages for the test. + std::string GetErrorMessage() const { return error_message_; } + + std::string ToText(const std::vector& inst) { + std::vector binary = {SpvMagicNumber, 0x10200, 0u, 2u, 0u}; + for (const Instruction* i : inst) + i->ToBinaryWithoutAttachedDebugInsts(&binary); + std::string text; + Disassemble(binary, &text); + return text; + } + + std::string ModuleToText() { + std::vector binary; + context_->module()->ToBinary(&binary, false); + std::string text; + Disassemble(binary, &text); + return text; + } + + spvtools::MessageConsumer GetConsumer() { return consumer_; } + + private: + spvtools::SpirvTools + tools_; // An instance for calling SPIRV-Tools functionalities. + std::unique_ptr context_; + spvtools::MessageConsumer consumer_; + uint32_t disassemble_options_; + std::string error_message_; +}; + +TEST_F(DecorationManagerTest, + ComparingDecorationsWithDiffOpcodesDecorateDecorateId) { + spvtools::ir::IRContext ir_context(SPV_ENV_UNIVERSAL_1_2, GetConsumer()); + // This parameter can be interprated both as { SpvDecorationConstant } + // and also as a list of IDs: { 22 } + const std::vector param{SpvDecorationConstant}; + // OpDecorate %1 Constant + Instruction inst1( + &ir_context, SpvOpDecorate, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {1u}}, {SPV_OPERAND_TYPE_DECORATION, param}}); + // OpDecorateId %1 %22 ; 'Constant' is decoration number 22 + Instruction inst2( + &ir_context, SpvOpDecorateId, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {1u}}, {SPV_OPERAND_TYPE_ID, param}}); + DecorationManager* decoManager = ir_context.get_decoration_mgr(); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->AreDecorationsTheSame(&inst1, &inst2, true)); +} + +TEST_F(DecorationManagerTest, + ComparingDecorationsWithDiffOpcodesDecorateDecorateString) { + spvtools::ir::IRContext ir_context(SPV_ENV_UNIVERSAL_1_2, GetConsumer()); + // This parameter can be interprated both as { SpvDecorationConstant } + // and also as a null-terminated string with a single character with value 22. + const std::vector param{SpvDecorationConstant}; + // OpDecorate %1 Constant + Instruction inst1( + &ir_context, SpvOpDecorate, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {1u}}, {SPV_OPERAND_TYPE_DECORATION, param}}); + // OpDecorateStringGOOGLE %1 !22 + Instruction inst2( + &ir_context, SpvOpDecorateStringGOOGLE, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {1u}}, {SPV_OPERAND_TYPE_LITERAL_STRING, param}}); + DecorationManager* decoManager = ir_context.get_decoration_mgr(); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->AreDecorationsTheSame(&inst1, &inst2, true)); +} + +TEST_F(DecorationManagerTest, ComparingDecorationsWithDiffDecorateParam) { + spvtools::ir::IRContext ir_context(SPV_ENV_UNIVERSAL_1_2, GetConsumer()); + // OpDecorate %1 Constant + Instruction inst1(&ir_context, SpvOpDecorate, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {1u}}, + {SPV_OPERAND_TYPE_DECORATION, {SpvDecorationConstant}}}); + // OpDecorate %1 Restrict + Instruction inst2(&ir_context, SpvOpDecorate, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {1u}}, + {SPV_OPERAND_TYPE_DECORATION, {SpvDecorationRestrict}}}); + DecorationManager* decoManager = ir_context.get_decoration_mgr(); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->AreDecorationsTheSame(&inst1, &inst2, true)); +} + +TEST_F(DecorationManagerTest, ComparingDecorationsWithDiffDecorateIdParam) { + spvtools::ir::IRContext ir_context(SPV_ENV_UNIVERSAL_1_2, GetConsumer()); + // OpDecorate %1 Constant + Instruction inst1( + &ir_context, SpvOpDecorateId, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {1u}}, {SPV_OPERAND_TYPE_ID, {555}}}); + // OpDecorate %1 Restrict + Instruction inst2( + &ir_context, SpvOpDecorateId, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {1u}}, {SPV_OPERAND_TYPE_ID, {666}}}); + DecorationManager* decoManager = ir_context.get_decoration_mgr(); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->AreDecorationsTheSame(&inst1, &inst2, true)); +} + +TEST_F(DecorationManagerTest, ComparingDecorationsWithDiffDecorateStringParam) { + spvtools::ir::IRContext ir_context(SPV_ENV_UNIVERSAL_1_2, GetConsumer()); + // OpDecorate %1 Constant + Instruction inst1(&ir_context, SpvOpDecorateStringGOOGLE, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {1u}}, + {SPV_OPERAND_TYPE_LITERAL_STRING, MakeVector("Hello!")}}); + // OpDecorate %1 Restrict + Instruction inst2(&ir_context, SpvOpDecorateStringGOOGLE, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {1u}}, + {SPV_OPERAND_TYPE_LITERAL_STRING, MakeVector("Hellx")}}); + DecorationManager* decoManager = ir_context.get_decoration_mgr(); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->AreDecorationsTheSame(&inst1, &inst2, true)); +} + +TEST_F(DecorationManagerTest, ComparingSameDecorationsOnDiffTargetAllowed) { + spvtools::ir::IRContext ir_context(SPV_ENV_UNIVERSAL_1_2, GetConsumer()); + // OpDecorate %1 Constant + Instruction inst1(&ir_context, SpvOpDecorate, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {1u}}, + {SPV_OPERAND_TYPE_DECORATION, {SpvDecorationConstant}}}); + // OpDecorate %2 Constant + Instruction inst2(&ir_context, SpvOpDecorate, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {2u}}, + {SPV_OPERAND_TYPE_DECORATION, {SpvDecorationConstant}}}); + DecorationManager* decoManager = ir_context.get_decoration_mgr(); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_TRUE(decoManager->AreDecorationsTheSame(&inst1, &inst2, true)); +} + +TEST_F(DecorationManagerTest, ComparingSameDecorationIdsOnDiffTargetAllowed) { + spvtools::ir::IRContext ir_context(SPV_ENV_UNIVERSAL_1_2, GetConsumer()); + Instruction inst1( + &ir_context, SpvOpDecorateId, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {1u}}, {SPV_OPERAND_TYPE_DECORATION, {44}}}); + Instruction inst2( + &ir_context, SpvOpDecorateId, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {2u}}, {SPV_OPERAND_TYPE_DECORATION, {44}}}); + DecorationManager* decoManager = ir_context.get_decoration_mgr(); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_TRUE(decoManager->AreDecorationsTheSame(&inst1, &inst2, true)); +} + +TEST_F(DecorationManagerTest, + ComparingSameDecorationStringsOnDiffTargetAllowed) { + spvtools::ir::IRContext ir_context(SPV_ENV_UNIVERSAL_1_2, GetConsumer()); + Instruction inst1(&ir_context, SpvOpDecorateStringGOOGLE, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {1u}}, + {SPV_OPERAND_TYPE_LITERAL_STRING, MakeVector("hello")}}); + Instruction inst2(&ir_context, SpvOpDecorateStringGOOGLE, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {2u}}, + {SPV_OPERAND_TYPE_LITERAL_STRING, MakeVector("hello")}}); + DecorationManager* decoManager = ir_context.get_decoration_mgr(); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_TRUE(decoManager->AreDecorationsTheSame(&inst1, &inst2, true)); +} + +TEST_F(DecorationManagerTest, ComparingSameDecorationsOnDiffTargetDisallowed) { + spvtools::ir::IRContext ir_context(SPV_ENV_UNIVERSAL_1_2, GetConsumer()); + // OpDecorate %1 Constant + Instruction inst1(&ir_context, SpvOpDecorate, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {1u}}, + {SPV_OPERAND_TYPE_DECORATION, {SpvDecorationConstant}}}); + // OpDecorate %2 Constant + Instruction inst2(&ir_context, SpvOpDecorate, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {2u}}, + {SPV_OPERAND_TYPE_DECORATION, {SpvDecorationConstant}}}); + DecorationManager* decoManager = ir_context.get_decoration_mgr(); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->AreDecorationsTheSame(&inst1, &inst2, false)); +} + +TEST_F(DecorationManagerTest, ComparingMemberDecorationsOnSameTypeDiffMember) { + spvtools::ir::IRContext ir_context(SPV_ENV_UNIVERSAL_1_2, GetConsumer()); + // OpMemberDecorate %1 0 Constant + Instruction inst1(&ir_context, SpvOpMemberDecorate, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {1u}}, + {SPV_OPERAND_TYPE_LITERAL_INTEGER, {0u}}, + {SPV_OPERAND_TYPE_DECORATION, {SpvDecorationConstant}}}); + // OpMemberDecorate %1 1 Constant + Instruction inst2(&ir_context, SpvOpMemberDecorate, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {1u}}, + {SPV_OPERAND_TYPE_LITERAL_INTEGER, {1u}}, + {SPV_OPERAND_TYPE_DECORATION, {SpvDecorationConstant}}}); + DecorationManager* decoManager = ir_context.get_decoration_mgr(); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->AreDecorationsTheSame(&inst1, &inst2, true)); +} + +TEST_F(DecorationManagerTest, + ComparingSameMemberDecorationsOnDiffTargetAllowed) { + spvtools::ir::IRContext ir_context(SPV_ENV_UNIVERSAL_1_2, GetConsumer()); + // OpMemberDecorate %1 0 Constant + Instruction inst1(&ir_context, SpvOpMemberDecorate, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {1u}}, + {SPV_OPERAND_TYPE_LITERAL_INTEGER, {0u}}, + {SPV_OPERAND_TYPE_DECORATION, {SpvDecorationConstant}}}); + // OpMemberDecorate %2 0 Constant + Instruction inst2(&ir_context, SpvOpMemberDecorate, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {2u}}, + {SPV_OPERAND_TYPE_LITERAL_INTEGER, {0u}}, + {SPV_OPERAND_TYPE_DECORATION, {SpvDecorationConstant}}}); + DecorationManager* decoManager = ir_context.get_decoration_mgr(); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_TRUE(decoManager->AreDecorationsTheSame(&inst1, &inst2, true)); +} + +TEST_F(DecorationManagerTest, + ComparingSameMemberDecorationsOnDiffTargetDisallowed) { + spvtools::ir::IRContext ir_context(SPV_ENV_UNIVERSAL_1_2, GetConsumer()); + // OpMemberDecorate %1 0 Constant + Instruction inst1(&ir_context, SpvOpMemberDecorate, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {1u}}, + {SPV_OPERAND_TYPE_LITERAL_INTEGER, {0u}}, + {SPV_OPERAND_TYPE_DECORATION, {SpvDecorationConstant}}}); + // OpMemberDecorate %2 0 Constant + Instruction inst2(&ir_context, SpvOpMemberDecorate, 0u, 0u, + {{SPV_OPERAND_TYPE_ID, {2u}}, + {SPV_OPERAND_TYPE_LITERAL_INTEGER, {0u}}, + {SPV_OPERAND_TYPE_DECORATION, {SpvDecorationConstant}}}); + DecorationManager* decoManager = ir_context.get_decoration_mgr(); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->AreDecorationsTheSame(&inst1, &inst2, false)); +} + +TEST_F(DecorationManagerTest, RemoveDecorationFromVariable) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Constant +OpDecorate %2 Restrict +%2 = OpDecorationGroup +OpGroupDecorate %2 %1 %3 +%4 = OpTypeInt 32 0 +%1 = OpVariable %4 Uniform +%3 = OpVariable %4 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + decoManager->RemoveDecorationsFrom(1u); + auto decorations = decoManager->GetDecorationsFor(1u, false); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_TRUE(decorations.empty()); + decorations = decoManager->GetDecorationsFor(3u, false); + EXPECT_THAT(GetErrorMessage(), ""); + + const std::string expected_decorations = R"(OpDecorate %2 Restrict +)"; + EXPECT_THAT(ToText(decorations), expected_decorations); + + const std::string expected_binary = R"(OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %2 Restrict +%2 = OpDecorationGroup +OpGroupDecorate %2 %3 +%4 = OpTypeInt 32 0 +%1 = OpVariable %4 Uniform +%3 = OpVariable %4 Uniform +)"; + EXPECT_THAT(ModuleToText(), expected_binary); +} + +TEST_F(DecorationManagerTest, RemoveDecorationStringFromVariable) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpExtension "SPV_GOOGLE_hlsl_functionality1" +OpExtension "SPV_GOOGLE_decorate_string" +OpMemoryModel Logical GLSL450 +OpDecorateStringGOOGLE %1 HlslSemanticGOOGLE "hello world" +OpDecorate %2 Restrict +%2 = OpDecorationGroup +OpGroupDecorate %2 %1 %3 +%4 = OpTypeInt 32 0 +%1 = OpVariable %4 Uniform +%3 = OpVariable %4 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + decoManager->RemoveDecorationsFrom(1u); + auto decorations = decoManager->GetDecorationsFor(1u, false); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_TRUE(decorations.empty()); + decorations = decoManager->GetDecorationsFor(3u, false); + EXPECT_THAT(GetErrorMessage(), ""); + + const std::string expected_decorations = R"(OpDecorate %2 Restrict +)"; + EXPECT_THAT(ToText(decorations), expected_decorations); + + const std::string expected_binary = R"(OpCapability Shader +OpCapability Linkage +OpExtension "SPV_GOOGLE_hlsl_functionality1" +OpExtension "SPV_GOOGLE_decorate_string" +OpMemoryModel Logical GLSL450 +OpDecorate %2 Restrict +%2 = OpDecorationGroup +OpGroupDecorate %2 %3 +%4 = OpTypeInt 32 0 +%1 = OpVariable %4 Uniform +%3 = OpVariable %4 Uniform +)"; + EXPECT_THAT(ModuleToText(), expected_binary); +} + +TEST_F(DecorationManagerTest, RemoveDecorationFromDecorationGroup) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Constant +OpDecorate %2 Restrict +%2 = OpDecorationGroup +OpGroupDecorate %2 %1 %3 +%4 = OpTypeInt 32 0 +%1 = OpVariable %4 Uniform +%3 = OpVariable %4 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + decoManager->RemoveDecorationsFrom(2u); + auto decorations = decoManager->GetDecorationsFor(2u, false); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_TRUE(decorations.empty()); + decorations = decoManager->GetDecorationsFor(1u, false); + EXPECT_THAT(GetErrorMessage(), ""); + + const std::string expected_decorations = R"(OpDecorate %1 Constant +)"; + EXPECT_THAT(ToText(decorations), expected_decorations); + decorations = decoManager->GetDecorationsFor(3u, false); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_THAT(ToText(decorations), ""); + + const std::string expected_binary = R"(OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Constant +%4 = OpTypeInt 32 0 +%1 = OpVariable %4 Uniform +%3 = OpVariable %4 Uniform +)"; + EXPECT_THAT(ModuleToText(), expected_binary); +} + +TEST_F(DecorationManagerTest, + RemoveDecorationFromDecorationGroupKeepDeadDecorations) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Constant +OpDecorate %2 Restrict +%2 = OpDecorationGroup +OpGroupDecorate %2 %1 +%3 = OpTypeInt 32 0 +%1 = OpVariable %3 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + decoManager->RemoveDecorationsFrom(1u); + auto decorations = decoManager->GetDecorationsFor(1u, false); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_TRUE(decorations.empty()); + decorations = decoManager->GetDecorationsFor(2u, false); + EXPECT_THAT(GetErrorMessage(), ""); + + const std::string expected_decorations = R"(OpDecorate %2 Restrict +)"; + EXPECT_THAT(ToText(decorations), expected_decorations); + + const std::string expected_binary = R"(OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %2 Restrict +%2 = OpDecorationGroup +%3 = OpTypeInt 32 0 +%1 = OpVariable %3 Uniform +)"; + EXPECT_THAT(ModuleToText(), expected_binary); +} + +TEST_F(DecorationManagerTest, RemoveAllDecorationsAppliedByGroup) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Constant +OpDecorate %2 Restrict +%2 = OpDecorationGroup +OpGroupDecorate %2 %1 +OpDecorate %3 BuiltIn VertexId +%3 = OpDecorationGroup +OpGroupDecorate %3 %1 +%4 = OpTypeInt 32 0 +%1 = OpVariable %4 Input +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + decoManager->RemoveDecorationsFrom( + 1u, [](const spvtools::ir::Instruction& inst) { + return inst.opcode() == SpvOpDecorate && + inst.GetSingleWordInOperand(0u) == 3u; + }); + auto decorations = decoManager->GetDecorationsFor(1u, false); + EXPECT_THAT(GetErrorMessage(), ""); + + std::string expected_decorations = R"(OpDecorate %1 Constant +OpDecorate %2 Restrict +)"; + EXPECT_THAT(ToText(decorations), expected_decorations); + decorations = decoManager->GetDecorationsFor(2u, false); + EXPECT_THAT(GetErrorMessage(), ""); + + expected_decorations = R"(OpDecorate %2 Restrict +)"; + EXPECT_THAT(ToText(decorations), expected_decorations); + + const std::string expected_binary = R"(OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Constant +OpDecorate %2 Restrict +%2 = OpDecorationGroup +OpGroupDecorate %2 %1 +OpDecorate %3 BuiltIn VertexId +%3 = OpDecorationGroup +%4 = OpTypeInt 32 0 +%1 = OpVariable %4 Input +)"; + EXPECT_THAT(ModuleToText(), expected_binary); +} + +TEST_F(DecorationManagerTest, RemoveSomeDecorationsAppliedByGroup) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Constant +OpDecorate %2 Restrict +%2 = OpDecorationGroup +OpGroupDecorate %2 %1 +OpDecorate %3 BuiltIn VertexId +OpDecorate %3 Invariant +%3 = OpDecorationGroup +OpGroupDecorate %3 %1 +%uint = OpTypeInt 32 0 +%1 = OpVariable %uint Input +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + decoManager->RemoveDecorationsFrom( + 1u, [](const spvtools::ir::Instruction& inst) { + return inst.opcode() == SpvOpDecorate && + inst.GetSingleWordInOperand(0u) == 3u && + inst.GetSingleWordInOperand(1u) == SpvDecorationBuiltIn; + }); + auto decorations = decoManager->GetDecorationsFor(1u, false); + EXPECT_THAT(GetErrorMessage(), ""); + + std::string expected_decorations = R"(OpDecorate %1 Constant +OpDecorate %1 Invariant +OpDecorate %2 Restrict +)"; + EXPECT_THAT(ToText(decorations), expected_decorations); + decorations = decoManager->GetDecorationsFor(2u, false); + EXPECT_THAT(GetErrorMessage(), ""); + + expected_decorations = R"(OpDecorate %2 Restrict +)"; + EXPECT_THAT(ToText(decorations), expected_decorations); + + const std::string expected_binary = R"(OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Constant +OpDecorate %2 Restrict +%2 = OpDecorationGroup +OpGroupDecorate %2 %1 +OpDecorate %3 BuiltIn VertexId +OpDecorate %3 Invariant +%3 = OpDecorationGroup +OpDecorate %1 Invariant +%4 = OpTypeInt 32 0 +%1 = OpVariable %4 Input +)"; + EXPECT_THAT(ModuleToText(), expected_binary); +} + +TEST_F(DecorationManagerTest, RemoveDecorationDecorate) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Constant +OpDecorate %1 Restrict +%2 = OpTypeInt 32 0 +%1 = OpVariable %2 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + auto decorations = decoManager->GetDecorationsFor(1u, false); + decoManager->RemoveDecoration(decorations.front()); + decorations = decoManager->GetDecorationsFor(1u, false); + EXPECT_THAT(GetErrorMessage(), ""); + + const std::string expected_decorations = R"(OpDecorate %1 Restrict +)"; + EXPECT_THAT(ToText(decorations), expected_decorations); +} + +TEST_F(DecorationManagerTest, RemoveDecorationStringDecorate) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpExtension "SPV_GOOGLE_hlsl_functionality1" +OpExtension "SPV_GOOGLE_decorate_string" +OpMemoryModel Logical GLSL450 +OpDecorateStringGOOGLE %1 HlslSemanticGOOGLE "foobar" +OpDecorate %1 Restrict +%2 = OpTypeInt 32 0 +%1 = OpVariable %2 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + auto decorations = decoManager->GetDecorationsFor(1u, false); + decoManager->RemoveDecoration(decorations.front()); + decorations = decoManager->GetDecorationsFor(1u, false); + EXPECT_THAT(GetErrorMessage(), ""); + + const std::string expected_decorations = R"(OpDecorate %1 Restrict +)"; + EXPECT_THAT(ToText(decorations), expected_decorations); +} + +TEST_F(DecorationManagerTest, CloneDecorations) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Constant +OpDecorate %2 Restrict +%2 = OpDecorationGroup +OpGroupDecorate %2 %1 +OpDecorate %3 BuiltIn VertexId +OpDecorate %3 Invariant +%3 = OpDecorationGroup +OpGroupDecorate %3 %1 +%4 = OpTypeInt 32 0 +%1 = OpVariable %4 Input +%5 = OpVariable %4 Input +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + + // Check cloning OpDecorate including group decorations. + auto decorations = decoManager->GetDecorationsFor(5u, false); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_TRUE(decorations.empty()); + + decoManager->CloneDecorations(1u, 5u); + decorations = decoManager->GetDecorationsFor(5u, false); + EXPECT_THAT(GetErrorMessage(), ""); + + std::string expected_decorations = R"(OpDecorate %5 Constant +OpDecorate %2 Restrict +OpDecorate %3 BuiltIn VertexId +OpDecorate %3 Invariant +)"; + EXPECT_THAT(ToText(decorations), expected_decorations); + + // Check that bookkeeping for ID 2 remains the same. + decorations = decoManager->GetDecorationsFor(2u, false); + EXPECT_THAT(GetErrorMessage(), ""); + + expected_decorations = R"(OpDecorate %2 Restrict +)"; + EXPECT_THAT(ToText(decorations), expected_decorations); + + const std::string expected_binary = R"(OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Constant +OpDecorate %2 Restrict +%2 = OpDecorationGroup +OpGroupDecorate %2 %1 %5 +OpDecorate %3 BuiltIn VertexId +OpDecorate %3 Invariant +%3 = OpDecorationGroup +OpGroupDecorate %3 %1 %5 +OpDecorate %5 Constant +%4 = OpTypeInt 32 0 +%1 = OpVariable %4 Input +%5 = OpVariable %4 Input +)"; + EXPECT_THAT(ModuleToText(), expected_binary); +} + +TEST_F(DecorationManagerTest, CloneDecorationsStringAndId) { + const std::string spirv = R"(OpCapability Shader +OpCapability Linkage +OpExtension "SPV_GOOGLE_hlsl_functionality1" +OpExtension "SPV_GOOGLE_decorate_string" +OpMemoryModel Logical GLSL450 +OpDecorateStringGOOGLE %1 HlslSemanticGOOGLE "blah" +OpDecorateId %1 HlslCounterBufferGOOGLE %2 +OpDecorate %1 Aliased +%3 = OpTypeInt 32 0 +%4 = OpTypePointer Uniform %3 +%1 = OpVariable %4 Uniform +%2 = OpVariable %4 Uniform +%5 = OpVariable %4 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + + // Check cloning OpDecorate including group decorations. + auto decorations = decoManager->GetDecorationsFor(5u, false); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_TRUE(decorations.empty()); + + decoManager->CloneDecorations(1u, 5u); + decorations = decoManager->GetDecorationsFor(5u, false); + EXPECT_THAT(GetErrorMessage(), ""); + + std::string expected_decorations = + R"(OpDecorateStringGOOGLE %5 HlslSemanticGOOGLE "blah" +OpDecorateId %5 HlslCounterBufferGOOGLE %2 +OpDecorate %5 Aliased +)"; + EXPECT_THAT(ToText(decorations), expected_decorations); + + const std::string expected_binary = R"(OpCapability Shader +OpCapability Linkage +OpExtension "SPV_GOOGLE_hlsl_functionality1" +OpExtension "SPV_GOOGLE_decorate_string" +OpMemoryModel Logical GLSL450 +OpDecorateStringGOOGLE %1 HlslSemanticGOOGLE "blah" +OpDecorateId %1 HlslCounterBufferGOOGLE %2 +OpDecorate %1 Aliased +OpDecorateStringGOOGLE %5 HlslSemanticGOOGLE "blah" +OpDecorateId %5 HlslCounterBufferGOOGLE %2 +OpDecorate %5 Aliased +%3 = OpTypeInt 32 0 +%4 = OpTypePointer Uniform %3 +%1 = OpVariable %4 Uniform +%2 = OpVariable %4 Uniform +%5 = OpVariable %4 Uniform +)"; + EXPECT_THAT(ModuleToText(), expected_binary); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationsWithoutGroupsTrue) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Restrict +OpDecorate %2 Constant +OpDecorate %2 Restrict +OpDecorate %1 Constant +%u32 = OpTypeInt 32 0 +%1 = OpVariable %u32 Uniform +%2 = OpVariable %u32 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_TRUE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationsWithoutGroupsFalse) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Restrict +OpDecorate %2 Constant +OpDecorate %2 Restrict +%u32 = OpTypeInt 32 0 +%1 = OpVariable %u32 Uniform +%2 = OpVariable %u32 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationsIdWithoutGroupsTrue) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorateId %1 AlignmentId %nine +OpDecorateId %3 MaxByteOffsetId %nine +OpDecorateId %3 AlignmentId %nine +OpDecorateId %1 MaxByteOffsetId %nine +%u32 = OpTypeInt 32 0 +%nine = OpConstant %u32 9 +%1 = OpVariable %u32 Uniform +%3 = OpVariable %u32 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_TRUE(decoManager->HaveTheSameDecorations(1u, 3u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationsIdWithoutGroupsFalse) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorateId %1 AlignmentId %nine +OpDecorateId %2 MaxByteOffsetId %nine +OpDecorateId %2 AlignmentId %nine +%u32 = OpTypeInt 32 0 +%nine = OpConstant %u32 9 +%1 = OpVariable %u32 Uniform +%2 = OpVariable %u32 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationsStringWithoutGroupsTrue) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Linkage +OpExtension "SPV_GOOGLE_hlsl_functionality1" +OpExtension "SPV_GOOGLE_decorate_string" +OpMemoryModel Logical GLSL450 +OpDecorateStringGOOGLE %1 HlslSemanticGOOGLE "hello" +OpDecorateStringGOOGLE %2 HlslSemanticGOOGLE "world" +OpDecorateStringGOOGLE %2 HlslSemanticGOOGLE "hello" +OpDecorateStringGOOGLE %1 HlslSemanticGOOGLE "world" +%u32 = OpTypeInt 32 0 +%1 = OpVariable %u32 Uniform +%2 = OpVariable %u32 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_TRUE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationsStringWithoutGroupsFalse) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Linkage +OpExtension "SPV_GOOGLE_hlsl_functionality1" +OpExtension "SPV_GOOGLE_decorate_string" +OpMemoryModel Logical GLSL450 +OpDecorateStringGOOGLE %1 HlslSemanticGOOGLE "hello" +OpDecorateStringGOOGLE %2 HlslSemanticGOOGLE "world" +OpDecorateStringGOOGLE %2 HlslSemanticGOOGLE "hello" +%u32 = OpTypeInt 32 0 +%1 = OpVariable %u32 Uniform +%2 = OpVariable %u32 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationsWithGroupsTrue) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Restrict +OpDecorate %2 Constant +OpDecorate %1 Constant +OpDecorate %3 Restrict +%3 = OpDecorationGroup +OpGroupDecorate %3 %2 +OpDecorate %4 Invariant +%4 = OpDecorationGroup +OpGroupDecorate %4 %1 %2 +%u32 = OpTypeInt 32 0 +%1 = OpVariable %u32 Uniform +%2 = OpVariable %u32 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_TRUE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationsWithGroupsFalse) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Restrict +OpDecorate %2 Constant +OpDecorate %1 Constant +OpDecorate %4 Invariant +%4 = OpDecorationGroup +OpGroupDecorate %4 %1 %2 +%u32 = OpTypeInt 32 0 +%1 = OpVariable %u32 Uniform +%2 = OpVariable %u32 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationsDuplicateDecorations) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Constant +OpDecorate %2 Constant +OpDecorate %2 Constant +%u32 = OpTypeInt 32 0 +%1 = OpVariable %u32 Uniform +%2 = OpVariable %u32 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_TRUE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationsDifferentVariations) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Location 0 +OpDecorate %2 Location 1 +%u32 = OpTypeInt 32 0 +%1 = OpVariable %u32 Uniform +%2 = OpVariable %u32 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, + HaveTheSameDecorationsDuplicateMemberDecorations) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpMemberDecorate %1 0 Location 0 +OpMemberDecorate %2 0 Location 0 +OpMemberDecorate %2 0 Location 0 +%u32 = OpTypeInt 32 0 +%1 = OpTypeStruct %u32 %u32 +%2 = OpTypeStruct %u32 %u32 +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_TRUE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, + HaveTheSameDecorationsDifferentMemberSameDecoration) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpMemberDecorate %1 0 Location 0 +OpMemberDecorate %2 1 Location 0 +%u32 = OpTypeInt 32 0 +%1 = OpTypeStruct %u32 %u32 +%2 = OpTypeStruct %u32 %u32 +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationsDifferentMemberVariations) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpMemberDecorate %1 0 Location 0 +OpMemberDecorate %2 0 Location 1 +%u32 = OpTypeInt 32 0 +%1 = OpTypeStruct %u32 %u32 +%2 = OpTypeStruct %u32 %u32 +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationsDuplicateIdDecorations) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorateId %1 AlignmentId %2 +OpDecorateId %3 AlignmentId %2 +OpDecorateId %3 AlignmentId %2 +%u32 = OpTypeInt 32 0 +%1 = OpVariable %u32 Uniform +%3 = OpVariable %u32 Uniform +%2 = OpSpecConstant %u32 0 +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_TRUE(decoManager->HaveTheSameDecorations(1u, 3u)); +} + +TEST_F(DecorationManagerTest, + HaveTheSameDecorationsDuplicateStringDecorations) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpExtension "SPV_GOOGLE_hlsl_functionality1" +OpExtension "SPV_GOOGLE_decorate_string" +OpMemoryModel Logical GLSL450 +OpDecorateStringGOOGLE %1 HlslSemanticGOOGLE "hello" +OpDecorateStringGOOGLE %2 HlslSemanticGOOGLE "hello" +OpDecorateStringGOOGLE %2 HlslSemanticGOOGLE "hello" +%u32 = OpTypeInt 32 0 +%1 = OpVariable %u32 Uniform +%2 = OpVariable %u32 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_TRUE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationsDifferentIdVariations) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorateId %1 AlignmentId %2 +OpDecorateId %3 AlignmentId %4 +%u32 = OpTypeInt 32 0 +%1 = OpVariable %u32 Uniform +%3 = OpVariable %u32 Uniform +%2 = OpSpecConstant %u32 0 +%4 = OpSpecConstant %u32 0 +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationsDifferentStringVariations) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpExtension "SPV_GOOGLE_hlsl_functionality1" +OpExtension "SPV_GOOGLE_decorate_string" +OpMemoryModel Logical GLSL450 +OpDecorateStringGOOGLE %1 HlslSemanticGOOGLE "hello" +OpDecorateStringGOOGLE %2 HlslSemanticGOOGLE "world" +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationsLeftSymmetry) { + // Left being a subset of right is not enough. + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Constant +OpDecorate %1 Constant +OpDecorate %2 Constant +OpDecorate %2 Restrict +%u32 = OpTypeInt 32 0 +%1 = OpVariable %u32 Uniform +%2 = OpVariable %u32 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationsRightSymmetry) { + // Right being a subset of left is not enough. + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Constant +OpDecorate %1 Restrict +OpDecorate %2 Constant +OpDecorate %2 Constant +%u32 = OpTypeInt 32 0 +%1 = OpVariable %u32 Uniform +%2 = OpVariable %u32 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationIdsLeftSymmetry) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorateId %1 AlignmentId %nine +OpDecorateId %1 AlignmentId %nine +OpDecorateId %2 AlignmentId %nine +OpDecorateId %2 MaxByteOffsetId %nine +%u32 = OpTypeInt 32 0 +%nine = OpConstant %u32 9 +%1 = OpVariable %u32 Uniform +%2 = OpVariable %u32 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationIdsRightSymmetry) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorateId %1 AlignmentId %nine +OpDecorateId %1 MaxByteOffsetId %nine +OpDecorateId %2 AlignmentId %nine +OpDecorateId %2 AlignmentId %nine +%u32 = OpTypeInt 32 0 +%nine = OpConstant %u32 9 +%1 = OpVariable %u32 Uniform +%2 = OpVariable %u32 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationStringsLeftSymmetry) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Linkage +OpExtension "SPV_GOOGLE_hlsl_functionality1" +OpExtension "SPV_GOOGLE_decorate_string" +OpMemoryModel Logical GLSL450 +OpDecorateStringGOOGLE %1 HlslSemanticGOOGLE "hello" +OpDecorateStringGOOGLE %1 HlslSemanticGOOGLE "hello" +OpDecorateStringGOOGLE %2 HlslSemanticGOOGLE "hello" +OpDecorateStringGOOGLE %2 HlslSemanticGOOGLE "world" +%u32 = OpTypeInt 32 0 +%1 = OpVariable %u32 Uniform +%2 = OpVariable %u32 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +TEST_F(DecorationManagerTest, HaveTheSameDecorationStringsRightSymmetry) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Linkage +OpExtension "SPV_GOOGLE_hlsl_functionality1" +OpExtension "SPV_GOOGLE_decorate_string" +OpMemoryModel Logical GLSL450 +OpDecorateStringGOOGLE %1 HlslSemanticGOOGLE "hello" +OpDecorateStringGOOGLE %1 HlslSemanticGOOGLE "world" +OpDecorateStringGOOGLE %2 HlslSemanticGOOGLE "hello" +OpDecorateStringGOOGLE %2 HlslSemanticGOOGLE "hello" +%u32 = OpTypeInt 32 0 +%1 = OpVariable %u32 Uniform +%2 = OpVariable %u32 Uniform +)"; + DecorationManager* decoManager = GetDecorationManager(spirv); + EXPECT_THAT(GetErrorMessage(), ""); + EXPECT_FALSE(decoManager->HaveTheSameDecorations(1u, 2u)); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/def_use_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/def_use_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/def_use_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/def_use_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1713 @@ +// Copyright (c) 2016 Google 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. + +#include +#include + +#include +#include + +#include "opt/build_module.h" +#include "opt/def_use_manager.h" +#include "opt/ir_context.h" +#include "opt/module.h" +#include "pass_fixture.h" +#include "pass_utils.h" +#include "spirv-tools/libspirv.hpp" + +namespace { + +using ::testing::Contains; +using ::testing::UnorderedElementsAre; +using ::testing::UnorderedElementsAreArray; + +using namespace spvtools; +using spvtools::opt::analysis::DefUseManager; + +// Returns the number of uses of |id|. +uint32_t NumUses(const std::unique_ptr& context, uint32_t id) { + uint32_t count = 0; + context->get_def_use_mgr()->ForEachUse( + id, [&count](ir::Instruction*, uint32_t) { ++count; }); + return count; +} + +// Returns the opcode of each use of |id|. +// +// If |id| is used multiple times in a single instruction, that instruction's +// opcode will appear a corresponding number of times. +std::vector GetUseOpcodes(const std::unique_ptr& context, + uint32_t id) { + std::vector opcodes; + context->get_def_use_mgr()->ForEachUse( + id, [&opcodes](ir::Instruction* user, uint32_t) { + opcodes.push_back(user->opcode()); + }); + return opcodes; +} + +// Disassembles the given |inst| and returns the disassembly. +std::string DisassembleInst(ir::Instruction* inst) { + SpirvTools tools(SPV_ENV_UNIVERSAL_1_1); + + std::vector binary; + // We need this to generate the necessary header in the binary. + tools.Assemble("", &binary); + inst->ToBinaryWithoutAttachedDebugInsts(&binary); + + std::string text; + // We'll need to check the underlying id numbers. + // So turn off friendly names for ids. + tools.Disassemble(binary, &text, SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + while (!text.empty() && text.back() == '\n') text.pop_back(); + return text; +} + +// A struct for holding expected id defs and uses. +struct InstDefUse { + using IdInstPair = std::pair; + using IdInstsPair = std::pair>; + + // Ids and their corresponding def instructions. + std::vector defs; + // Ids and their corresponding use instructions. + std::vector uses; +}; + +// Checks that the |actual_defs| and |actual_uses| are in accord with +// |expected_defs_uses|. +void CheckDef(const InstDefUse& expected_defs_uses, + const DefUseManager::IdToDefMap& actual_defs) { + // Check defs. + ASSERT_EQ(expected_defs_uses.defs.size(), actual_defs.size()); + for (uint32_t i = 0; i < expected_defs_uses.defs.size(); ++i) { + const auto id = expected_defs_uses.defs[i].first; + const auto expected_def = expected_defs_uses.defs[i].second; + ASSERT_EQ(1u, actual_defs.count(id)) << "expected to def id [" << id << "]"; + auto def = actual_defs.at(id); + if (def->opcode() != SpvOpConstant) { + // Constants don't disassemble properly without a full context. + EXPECT_EQ(expected_def, DisassembleInst(actual_defs.at(id))); + } + } +} + +using UserMap = std::unordered_map>; + +// Creates a mapping of all definitions to their users (except OpConstant). +// +// OpConstants are skipped because they cannot be disassembled in isolation. +UserMap BuildAllUsers(const DefUseManager* mgr, uint32_t idBound) { + UserMap userMap; + for (uint32_t id = 0; id != idBound; ++id) { + if (mgr->GetDef(id)) { + mgr->ForEachUser(id, [id, &userMap](ir::Instruction* user) { + if (user->opcode() != SpvOpConstant) { + userMap[id].push_back(user); + } + }); + } + } + return userMap; +} + +// Constants don't disassemble properly without a full context, so skip them as +// checks. +void CheckUse(const InstDefUse& expected_defs_uses, const DefUseManager* mgr, + uint32_t idBound) { + UserMap actual_uses = BuildAllUsers(mgr, idBound); + // Check uses. + ASSERT_EQ(expected_defs_uses.uses.size(), actual_uses.size()); + for (uint32_t i = 0; i < expected_defs_uses.uses.size(); ++i) { + const auto id = expected_defs_uses.uses[i].first; + const auto& expected_uses = expected_defs_uses.uses[i].second; + + ASSERT_EQ(1u, actual_uses.count(id)) << "expected to use id [" << id << "]"; + const auto& uses = actual_uses.at(id); + + ASSERT_EQ(expected_uses.size(), uses.size()) + << "id [" << id << "] # uses: expected: " << expected_uses.size() + << " actual: " << uses.size(); + + std::vector actual_uses_disassembled; + for (const auto actual_use : uses) { + actual_uses_disassembled.emplace_back(DisassembleInst(actual_use)); + } + EXPECT_THAT(actual_uses_disassembled, + UnorderedElementsAreArray(expected_uses)); + } +} + +// The following test case mimics how LLVM handles induction variables. +// But, yeah, it's not very readable. However, we only care about the id +// defs and uses. So, no need to make sure this is valid OpPhi construct. +const char kOpPhiTestFunction[] = + " %1 = OpTypeVoid " + " %6 = OpTypeInt 32 0 " + "%10 = OpTypeFloat 32 " + "%16 = OpTypeBool " + " %3 = OpTypeFunction %1 " + " %8 = OpConstant %6 0 " + "%18 = OpConstant %6 1 " + "%12 = OpConstant %10 1.0 " + " %2 = OpFunction %1 None %3 " + " %4 = OpLabel " + " OpBranch %5 " + + " %5 = OpLabel " + " %7 = OpPhi %6 %8 %4 %9 %5 " + "%11 = OpPhi %10 %12 %4 %13 %5 " + " %9 = OpIAdd %6 %7 %8 " + "%13 = OpFAdd %10 %11 %12 " + "%17 = OpSLessThan %16 %7 %18 " + " OpLoopMerge %19 %5 None " + " OpBranchConditional %17 %5 %19 " + + "%19 = OpLabel " + " OpReturn " + " OpFunctionEnd"; + +struct ParseDefUseCase { + const char* text; + InstDefUse du; +}; + +using ParseDefUseTest = ::testing::TestWithParam; + +TEST_P(ParseDefUseTest, Case) { + const auto& tc = GetParam(); + + // Build module. + const std::vector text = {tc.text}; + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, JoinAllInsts(text), + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ASSERT_NE(nullptr, context); + + // Analyze def and use. + opt::analysis::DefUseManager manager(context->module()); + + CheckDef(tc.du, manager.id_to_defs()); + CheckUse(tc.du, &manager, context->module()->IdBound()); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + TestCase, ParseDefUseTest, + ::testing::ValuesIn(std::vector{ + {"", {{}, {}}}, // no instruction + {"OpMemoryModel Logical GLSL450", {{}, {}}}, // no def and use + { // single def, no use + "%1 = OpString \"wow\"", + { + {{1, "%1 = OpString \"wow\""}}, // defs + {} // uses + } + }, + { // multiple def, no use + "%1 = OpString \"hello\" " + "%2 = OpString \"world\" " + "%3 = OpTypeVoid", + { + { // defs + {1, "%1 = OpString \"hello\""}, + {2, "%2 = OpString \"world\""}, + {3, "%3 = OpTypeVoid"}, + }, + {} // uses + } + }, + { // multiple def, multiple use + "%1 = OpTypeBool " + "%2 = OpTypeVector %1 3 " + "%3 = OpTypeMatrix %2 3", + { + { // defs + {1, "%1 = OpTypeBool"}, + {2, "%2 = OpTypeVector %1 3"}, + {3, "%3 = OpTypeMatrix %2 3"}, + }, + { // uses + {1, {"%2 = OpTypeVector %1 3"}}, + {2, {"%3 = OpTypeMatrix %2 3"}}, + } + } + }, + { // multiple use of the same id + "%1 = OpTypeBool " + "%2 = OpTypeVector %1 2 " + "%3 = OpTypeVector %1 3 " + "%4 = OpTypeVector %1 4", + { + { // defs + {1, "%1 = OpTypeBool"}, + {2, "%2 = OpTypeVector %1 2"}, + {3, "%3 = OpTypeVector %1 3"}, + {4, "%4 = OpTypeVector %1 4"}, + }, + { // uses + {1, + { + "%2 = OpTypeVector %1 2", + "%3 = OpTypeVector %1 3", + "%4 = OpTypeVector %1 4", + } + }, + } + } + }, + { // labels + "%1 = OpTypeVoid " + "%2 = OpTypeBool " + "%3 = OpTypeFunction %1 " + "%4 = OpConstantTrue %2 " + "%5 = OpFunction %1 None %3 " + + "%6 = OpLabel " + "OpBranchConditional %4 %7 %8 " + + "%7 = OpLabel " + "OpBranch %7 " + + "%8 = OpLabel " + "OpReturn " + + "OpFunctionEnd", + { + { // defs + {1, "%1 = OpTypeVoid"}, + {2, "%2 = OpTypeBool"}, + {3, "%3 = OpTypeFunction %1"}, + {4, "%4 = OpConstantTrue %2"}, + {5, "%5 = OpFunction %1 None %3"}, + {6, "%6 = OpLabel"}, + {7, "%7 = OpLabel"}, + {8, "%8 = OpLabel"}, + }, + { // uses + {1, { + "%3 = OpTypeFunction %1", + "%5 = OpFunction %1 None %3", + } + }, + {2, {"%4 = OpConstantTrue %2"}}, + {3, {"%5 = OpFunction %1 None %3"}}, + {4, {"OpBranchConditional %4 %7 %8"}}, + {7, + { + "OpBranchConditional %4 %7 %8", + "OpBranch %7", + } + }, + {8, {"OpBranchConditional %4 %7 %8"}}, + } + } + }, + { // cross function + "%1 = OpTypeBool " + "%3 = OpTypeFunction %1 " + "%2 = OpFunction %1 None %3 " + + "%4 = OpLabel " + "%5 = OpVariable %1 Function " + "%6 = OpFunctionCall %1 %2 %5 " + "OpReturnValue %6 " + + "OpFunctionEnd", + { + { // defs + {1, "%1 = OpTypeBool"}, + {2, "%2 = OpFunction %1 None %3"}, + {3, "%3 = OpTypeFunction %1"}, + {4, "%4 = OpLabel"}, + {5, "%5 = OpVariable %1 Function"}, + {6, "%6 = OpFunctionCall %1 %2 %5"}, + }, + { // uses + {1, + { + "%2 = OpFunction %1 None %3", + "%3 = OpTypeFunction %1", + "%5 = OpVariable %1 Function", + "%6 = OpFunctionCall %1 %2 %5", + } + }, + {2, {"%6 = OpFunctionCall %1 %2 %5"}}, + {3, {"%2 = OpFunction %1 None %3"}}, + {5, {"%6 = OpFunctionCall %1 %2 %5"}}, + {6, {"OpReturnValue %6"}}, + } + } + }, + { // selection merge and loop merge + "%1 = OpTypeVoid " + "%3 = OpTypeFunction %1 " + "%10 = OpTypeBool " + "%8 = OpConstantTrue %10 " + "%2 = OpFunction %1 None %3 " + + "%4 = OpLabel " + "OpLoopMerge %5 %4 None " + "OpBranch %6 " + + "%5 = OpLabel " + "OpReturn " + + "%6 = OpLabel " + "OpSelectionMerge %7 None " + "OpBranchConditional %8 %9 %7 " + + "%7 = OpLabel " + "OpReturn " + + "%9 = OpLabel " + "OpReturn " + + "OpFunctionEnd", + { + { // defs + {1, "%1 = OpTypeVoid"}, + {2, "%2 = OpFunction %1 None %3"}, + {3, "%3 = OpTypeFunction %1"}, + {4, "%4 = OpLabel"}, + {5, "%5 = OpLabel"}, + {6, "%6 = OpLabel"}, + {7, "%7 = OpLabel"}, + {8, "%8 = OpConstantTrue %10"}, + {9, "%9 = OpLabel"}, + {10, "%10 = OpTypeBool"}, + }, + { // uses + {1, + { + "%2 = OpFunction %1 None %3", + "%3 = OpTypeFunction %1", + } + }, + {3, {"%2 = OpFunction %1 None %3"}}, + {4, {"OpLoopMerge %5 %4 None"}}, + {5, {"OpLoopMerge %5 %4 None"}}, + {6, {"OpBranch %6"}}, + {7, + { + "OpSelectionMerge %7 None", + "OpBranchConditional %8 %9 %7", + } + }, + {8, {"OpBranchConditional %8 %9 %7"}}, + {9, {"OpBranchConditional %8 %9 %7"}}, + {10, {"%8 = OpConstantTrue %10"}}, + } + } + }, + { // Forward reference + "OpDecorate %1 Block " + "OpTypeForwardPointer %2 Input " + "%3 = OpTypeInt 32 0 " + "%1 = OpTypeStruct %3 " + "%2 = OpTypePointer Input %3", + { + { // defs + {1, "%1 = OpTypeStruct %3"}, + {2, "%2 = OpTypePointer Input %3"}, + {3, "%3 = OpTypeInt 32 0"}, + }, + { // uses + {1, {"OpDecorate %1 Block"}}, + {2, {"OpTypeForwardPointer %2 Input"}}, + {3, + { + "%1 = OpTypeStruct %3", + "%2 = OpTypePointer Input %3", + } + } + }, + }, + }, + { // OpPhi + kOpPhiTestFunction, + { + { // defs + {1, "%1 = OpTypeVoid"}, + {2, "%2 = OpFunction %1 None %3"}, + {3, "%3 = OpTypeFunction %1"}, + {4, "%4 = OpLabel"}, + {5, "%5 = OpLabel"}, + {6, "%6 = OpTypeInt 32 0"}, + {7, "%7 = OpPhi %6 %8 %4 %9 %5"}, + {8, "%8 = OpConstant %6 0"}, + {9, "%9 = OpIAdd %6 %7 %8"}, + {10, "%10 = OpTypeFloat 32"}, + {11, "%11 = OpPhi %10 %12 %4 %13 %5"}, + {12, "%12 = OpConstant %10 1.0"}, + {13, "%13 = OpFAdd %10 %11 %12"}, + {16, "%16 = OpTypeBool"}, + {17, "%17 = OpSLessThan %16 %7 %18"}, + {18, "%18 = OpConstant %6 1"}, + {19, "%19 = OpLabel"}, + }, + { // uses + {1, + { + "%2 = OpFunction %1 None %3", + "%3 = OpTypeFunction %1", + } + }, + {3, {"%2 = OpFunction %1 None %3"}}, + {4, + { + "%7 = OpPhi %6 %8 %4 %9 %5", + "%11 = OpPhi %10 %12 %4 %13 %5", + } + }, + {5, + { + "OpBranch %5", + "%7 = OpPhi %6 %8 %4 %9 %5", + "%11 = OpPhi %10 %12 %4 %13 %5", + "OpLoopMerge %19 %5 None", + "OpBranchConditional %17 %5 %19", + } + }, + {6, + { + // Can't check constants properly + //"%8 = OpConstant %6 0", + //"%18 = OpConstant %6 1", + "%7 = OpPhi %6 %8 %4 %9 %5", + "%9 = OpIAdd %6 %7 %8", + } + }, + {7, + { + "%9 = OpIAdd %6 %7 %8", + "%17 = OpSLessThan %16 %7 %18", + } + }, + {8, + { + "%7 = OpPhi %6 %8 %4 %9 %5", + "%9 = OpIAdd %6 %7 %8", + } + }, + {9, {"%7 = OpPhi %6 %8 %4 %9 %5"}}, + {10, + { + //"%12 = OpConstant %10 1.0", + "%11 = OpPhi %10 %12 %4 %13 %5", + "%13 = OpFAdd %10 %11 %12", + } + }, + {11, {"%13 = OpFAdd %10 %11 %12"}}, + {12, + { + "%11 = OpPhi %10 %12 %4 %13 %5", + "%13 = OpFAdd %10 %11 %12", + } + }, + {13, {"%11 = OpPhi %10 %12 %4 %13 %5"}}, + {16, {"%17 = OpSLessThan %16 %7 %18"}}, + {17, {"OpBranchConditional %17 %5 %19"}}, + {18, {"%17 = OpSLessThan %16 %7 %18"}}, + {19, + { + "OpLoopMerge %19 %5 None", + "OpBranchConditional %17 %5 %19", + } + }, + }, + }, + }, + { // OpPhi defining and referencing the same id. + "%1 = OpTypeBool " + "%3 = OpTypeFunction %1 " + "%2 = OpConstantTrue %1 " + "%4 = OpFunction %1 None %3 " + "%6 = OpLabel " + " OpBranch %7 " + "%7 = OpLabel " + "%8 = OpPhi %1 %8 %7 %2 %6 " // both defines and uses %8 + " OpBranch %7 " + " OpFunctionEnd", + { + { // defs + {1, "%1 = OpTypeBool"}, + {2, "%2 = OpConstantTrue %1"}, + {3, "%3 = OpTypeFunction %1"}, + {4, "%4 = OpFunction %1 None %3"}, + {6, "%6 = OpLabel"}, + {7, "%7 = OpLabel"}, + {8, "%8 = OpPhi %1 %8 %7 %2 %6"}, + }, + { // uses + {1, + { + "%2 = OpConstantTrue %1", + "%3 = OpTypeFunction %1", + "%4 = OpFunction %1 None %3", + "%8 = OpPhi %1 %8 %7 %2 %6", + } + }, + {2, {"%8 = OpPhi %1 %8 %7 %2 %6"}}, + {3, {"%4 = OpFunction %1 None %3"}}, + {6, {"%8 = OpPhi %1 %8 %7 %2 %6"}}, + {7, + { + "OpBranch %7", + "%8 = OpPhi %1 %8 %7 %2 %6", + "OpBranch %7", + } + }, + {8, {"%8 = OpPhi %1 %8 %7 %2 %6"}}, + }, + }, + }, + }) +); +// clang-format on + +struct ReplaceUseCase { + const char* before; + std::vector> candidates; + const char* after; + InstDefUse du; +}; + +using ReplaceUseTest = ::testing::TestWithParam; + +// Disassembles the given |module| and returns the disassembly. +std::string DisassembleModule(ir::Module* module) { + SpirvTools tools(SPV_ENV_UNIVERSAL_1_1); + + std::vector binary; + module->ToBinary(&binary, /* skip_nop = */ false); + + std::string text; + // We'll need to check the underlying id numbers. + // So turn off friendly names for ids. + tools.Disassemble(binary, &text, SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + while (!text.empty() && text.back() == '\n') text.pop_back(); + return text; +} + +TEST_P(ReplaceUseTest, Case) { + const auto& tc = GetParam(); + + // Build module. + const std::vector text = {tc.before}; + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, JoinAllInsts(text), + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ASSERT_NE(nullptr, context); + + // Force a re-build of def-use manager. + context->InvalidateAnalyses(ir::IRContext::Analysis::kAnalysisDefUse); + (void)context->get_def_use_mgr(); + + // Do the substitution. + for (const auto& candidate : tc.candidates) { + context->ReplaceAllUsesWith(candidate.first, candidate.second); + } + + EXPECT_EQ(tc.after, DisassembleModule(context->module())); + CheckDef(tc.du, context->get_def_use_mgr()->id_to_defs()); + CheckUse(tc.du, context->get_def_use_mgr(), context->module()->IdBound()); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + TestCase, ReplaceUseTest, + ::testing::ValuesIn(std::vector{ + { // no use, no replace request + "", {}, "", {}, + }, + { // replace one use + "%1 = OpTypeBool " + "%2 = OpTypeVector %1 3 " + "%3 = OpTypeInt 32 0 ", + {{1, 3}}, + "%1 = OpTypeBool\n" + "%2 = OpTypeVector %3 3\n" + "%3 = OpTypeInt 32 0", + { + { // defs + {1, "%1 = OpTypeBool"}, + {2, "%2 = OpTypeVector %3 3"}, + {3, "%3 = OpTypeInt 32 0"}, + }, + { // uses + {3, {"%2 = OpTypeVector %3 3"}}, + }, + }, + }, + { // replace and then replace back + "%1 = OpTypeBool " + "%2 = OpTypeVector %1 3 " + "%3 = OpTypeInt 32 0", + {{1, 3}, {3, 1}}, + "%1 = OpTypeBool\n" + "%2 = OpTypeVector %1 3\n" + "%3 = OpTypeInt 32 0", + { + { // defs + {1, "%1 = OpTypeBool"}, + {2, "%2 = OpTypeVector %1 3"}, + {3, "%3 = OpTypeInt 32 0"}, + }, + { // uses + {1, {"%2 = OpTypeVector %1 3"}}, + }, + }, + }, + { // replace with the same id + "%1 = OpTypeBool " + "%2 = OpTypeVector %1 3", + {{1, 1}, {2, 2}, {3, 3}}, + "%1 = OpTypeBool\n" + "%2 = OpTypeVector %1 3", + { + { // defs + {1, "%1 = OpTypeBool"}, + {2, "%2 = OpTypeVector %1 3"}, + }, + { // uses + {1, {"%2 = OpTypeVector %1 3"}}, + }, + }, + }, + { // replace in sequence + "%1 = OpTypeBool " + "%2 = OpTypeVector %1 3 " + "%3 = OpTypeInt 32 0 " + "%4 = OpTypeInt 32 1 ", + {{1, 3}, {3, 4}}, + "%1 = OpTypeBool\n" + "%2 = OpTypeVector %4 3\n" + "%3 = OpTypeInt 32 0\n" + "%4 = OpTypeInt 32 1", + { + { // defs + {1, "%1 = OpTypeBool"}, + {2, "%2 = OpTypeVector %4 3"}, + {3, "%3 = OpTypeInt 32 0"}, + {4, "%4 = OpTypeInt 32 1"}, + }, + { // uses + {4, {"%2 = OpTypeVector %4 3"}}, + }, + }, + }, + { // replace multiple uses + "%1 = OpTypeBool " + "%2 = OpTypeVector %1 2 " + "%3 = OpTypeVector %1 3 " + "%4 = OpTypeVector %1 4 " + "%5 = OpTypeMatrix %2 2 " + "%6 = OpTypeMatrix %3 3 " + "%7 = OpTypeMatrix %4 4 " + "%8 = OpTypeInt 32 0 " + "%9 = OpTypeInt 32 1 " + "%10 = OpTypeInt 64 0", + {{1, 8}, {2, 9}, {4, 10}}, + "%1 = OpTypeBool\n" + "%2 = OpTypeVector %8 2\n" + "%3 = OpTypeVector %8 3\n" + "%4 = OpTypeVector %8 4\n" + "%5 = OpTypeMatrix %9 2\n" + "%6 = OpTypeMatrix %3 3\n" + "%7 = OpTypeMatrix %10 4\n" + "%8 = OpTypeInt 32 0\n" + "%9 = OpTypeInt 32 1\n" + "%10 = OpTypeInt 64 0", + { + { // defs + {1, "%1 = OpTypeBool"}, + {2, "%2 = OpTypeVector %8 2"}, + {3, "%3 = OpTypeVector %8 3"}, + {4, "%4 = OpTypeVector %8 4"}, + {5, "%5 = OpTypeMatrix %9 2"}, + {6, "%6 = OpTypeMatrix %3 3"}, + {7, "%7 = OpTypeMatrix %10 4"}, + {8, "%8 = OpTypeInt 32 0"}, + {9, "%9 = OpTypeInt 32 1"}, + {10, "%10 = OpTypeInt 64 0"}, + }, + { // uses + {8, + { + "%2 = OpTypeVector %8 2", + "%3 = OpTypeVector %8 3", + "%4 = OpTypeVector %8 4", + } + }, + {9, {"%5 = OpTypeMatrix %9 2"}}, + {3, {"%6 = OpTypeMatrix %3 3"}}, + {10, {"%7 = OpTypeMatrix %10 4"}}, + }, + }, + }, + { // OpPhi. + kOpPhiTestFunction, + // replace one id used by OpPhi, replace one id generated by OpPhi + {{9, 13}, {11, 9}}, + "%1 = OpTypeVoid\n" + "%6 = OpTypeInt 32 0\n" + "%10 = OpTypeFloat 32\n" + "%16 = OpTypeBool\n" + "%3 = OpTypeFunction %1\n" + "%8 = OpConstant %6 0\n" + "%18 = OpConstant %6 1\n" + "%12 = OpConstant %10 1\n" + "%2 = OpFunction %1 None %3\n" + "%4 = OpLabel\n" + "OpBranch %5\n" + + "%5 = OpLabel\n" + "%7 = OpPhi %6 %8 %4 %13 %5\n" // %9 -> %13 + "%11 = OpPhi %10 %12 %4 %13 %5\n" + "%9 = OpIAdd %6 %7 %8\n" + "%13 = OpFAdd %10 %9 %12\n" // %11 -> %9 + "%17 = OpSLessThan %16 %7 %18\n" + "OpLoopMerge %19 %5 None\n" + "OpBranchConditional %17 %5 %19\n" + + "%19 = OpLabel\n" + "OpReturn\n" + "OpFunctionEnd", + { + { // defs. + {1, "%1 = OpTypeVoid"}, + {2, "%2 = OpFunction %1 None %3"}, + {3, "%3 = OpTypeFunction %1"}, + {4, "%4 = OpLabel"}, + {5, "%5 = OpLabel"}, + {6, "%6 = OpTypeInt 32 0"}, + {7, "%7 = OpPhi %6 %8 %4 %13 %5"}, + {8, "%8 = OpConstant %6 0"}, + {9, "%9 = OpIAdd %6 %7 %8"}, + {10, "%10 = OpTypeFloat 32"}, + {11, "%11 = OpPhi %10 %12 %4 %13 %5"}, + {12, "%12 = OpConstant %10 1.0"}, + {13, "%13 = OpFAdd %10 %9 %12"}, + {16, "%16 = OpTypeBool"}, + {17, "%17 = OpSLessThan %16 %7 %18"}, + {18, "%18 = OpConstant %6 1"}, + {19, "%19 = OpLabel"}, + }, + { // uses + {1, + { + "%2 = OpFunction %1 None %3", + "%3 = OpTypeFunction %1", + } + }, + {3, {"%2 = OpFunction %1 None %3"}}, + {4, + { + "%7 = OpPhi %6 %8 %4 %13 %5", + "%11 = OpPhi %10 %12 %4 %13 %5", + } + }, + {5, + { + "OpBranch %5", + "%7 = OpPhi %6 %8 %4 %13 %5", + "%11 = OpPhi %10 %12 %4 %13 %5", + "OpLoopMerge %19 %5 None", + "OpBranchConditional %17 %5 %19", + } + }, + {6, + { + // Can't properly check constants + //"%8 = OpConstant %6 0", + //"%18 = OpConstant %6 1", + "%7 = OpPhi %6 %8 %4 %13 %5", + "%9 = OpIAdd %6 %7 %8" + } + }, + {7, + { + "%9 = OpIAdd %6 %7 %8", + "%17 = OpSLessThan %16 %7 %18", + } + }, + {8, + { + "%7 = OpPhi %6 %8 %4 %13 %5", + "%9 = OpIAdd %6 %7 %8", + } + }, + {9, {"%13 = OpFAdd %10 %9 %12"}}, // uses of %9 changed from %7 to %13 + {10, + { + "%11 = OpPhi %10 %12 %4 %13 %5", + //"%12 = OpConstant %10 1", + "%13 = OpFAdd %10 %9 %12" + } + }, + // no more uses of %11 + {12, + { + "%11 = OpPhi %10 %12 %4 %13 %5", + "%13 = OpFAdd %10 %9 %12" + } + }, + {13, { + "%7 = OpPhi %6 %8 %4 %13 %5", + "%11 = OpPhi %10 %12 %4 %13 %5", + } + }, + {16, {"%17 = OpSLessThan %16 %7 %18"}}, + {17, {"OpBranchConditional %17 %5 %19"}}, + {18, {"%17 = OpSLessThan %16 %7 %18"}}, + {19, + { + "OpLoopMerge %19 %5 None", + "OpBranchConditional %17 %5 %19", + } + }, + }, + }, + }, + { // OpPhi defining and referencing the same id. + "%1 = OpTypeBool " + "%3 = OpTypeFunction %1 " + "%2 = OpConstantTrue %1 " + + "%4 = OpFunction %3 None %1 " + "%6 = OpLabel " + " OpBranch %7 " + "%7 = OpLabel " + "%8 = OpPhi %1 %8 %7 %2 %6 " // both defines and uses %8 + " OpBranch %7 " + " OpFunctionEnd", + {{8, 2}}, + "%1 = OpTypeBool\n" + "%3 = OpTypeFunction %1\n" + "%2 = OpConstantTrue %1\n" + + "%4 = OpFunction %3 None %1\n" + "%6 = OpLabel\n" + "OpBranch %7\n" + "%7 = OpLabel\n" + "%8 = OpPhi %1 %2 %7 %2 %6\n" // use of %8 changed to %2 + "OpBranch %7\n" + "OpFunctionEnd", + { + { // defs + {1, "%1 = OpTypeBool"}, + {2, "%2 = OpConstantTrue %1"}, + {3, "%3 = OpTypeFunction %1"}, + {4, "%4 = OpFunction %3 None %1"}, + {6, "%6 = OpLabel"}, + {7, "%7 = OpLabel"}, + {8, "%8 = OpPhi %1 %2 %7 %2 %6"}, + }, + { // uses + {1, + { + "%2 = OpConstantTrue %1", + "%3 = OpTypeFunction %1", + "%4 = OpFunction %3 None %1", + "%8 = OpPhi %1 %2 %7 %2 %6", + } + }, + {2, + { + // Only checking users + "%8 = OpPhi %1 %2 %7 %2 %6", + } + }, + {3, {"%4 = OpFunction %3 None %1"}}, + {6, {"%8 = OpPhi %1 %2 %7 %2 %6"}}, + {7, + { + "OpBranch %7", + "%8 = OpPhi %1 %2 %7 %2 %6", + "OpBranch %7", + } + }, + // {8, {"%8 = OpPhi %1 %8 %7 %2 %6"}}, + }, + }, + }, + }) +); +// clang-format on + +struct KillDefCase { + const char* before; + std::vector ids_to_kill; + const char* after; + InstDefUse du; +}; + +using KillDefTest = ::testing::TestWithParam; + +TEST_P(KillDefTest, Case) { + const auto& tc = GetParam(); + + // Build module. + const std::vector text = {tc.before}; + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, JoinAllInsts(text), + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ASSERT_NE(nullptr, context); + + // Analyze def and use. + opt::analysis::DefUseManager manager(context->module()); + + // Do the substitution. + for (const auto id : tc.ids_to_kill) context->KillDef(id); + + EXPECT_EQ(tc.after, DisassembleModule(context->module())); + CheckDef(tc.du, context->get_def_use_mgr()->id_to_defs()); + CheckUse(tc.du, context->get_def_use_mgr(), context->module()->IdBound()); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + TestCase, KillDefTest, + ::testing::ValuesIn(std::vector{ + { // no def, no use, no kill + "", {}, "", {} + }, + { // kill nothing + "%1 = OpTypeBool " + "%2 = OpTypeVector %1 2 " + "%3 = OpTypeVector %1 3 ", + {}, + "%1 = OpTypeBool\n" + "%2 = OpTypeVector %1 2\n" + "%3 = OpTypeVector %1 3", + { + { // defs + {1, "%1 = OpTypeBool"}, + {2, "%2 = OpTypeVector %1 2"}, + {3, "%3 = OpTypeVector %1 3"}, + }, + { // uses + {1, + { + "%2 = OpTypeVector %1 2", + "%3 = OpTypeVector %1 3", + } + }, + }, + }, + }, + { // kill id used, kill id not used, kill id not defined + "%1 = OpTypeBool " + "%2 = OpTypeVector %1 2 " + "%3 = OpTypeVector %1 3 " + "%4 = OpTypeVector %1 4 " + "%5 = OpTypeMatrix %3 3 " + "%6 = OpTypeMatrix %2 3", + {1, 3, 5, 10}, // ids to kill + "%2 = OpTypeVector %1 2\n" + "%4 = OpTypeVector %1 4\n" + "%6 = OpTypeMatrix %2 3", + { + { // defs + {2, "%2 = OpTypeVector %1 2"}, + {4, "%4 = OpTypeVector %1 4"}, + {6, "%6 = OpTypeMatrix %2 3"}, + }, + { // uses. %1 and %3 are both killed, so no uses + // recorded for them anymore. + {2, {"%6 = OpTypeMatrix %2 3"}}, + } + }, + }, + { // OpPhi. + kOpPhiTestFunction, + {9, 11}, // kill one id used by OpPhi, kill one id generated by OpPhi + "%1 = OpTypeVoid\n" + "%6 = OpTypeInt 32 0\n" + "%10 = OpTypeFloat 32\n" + "%16 = OpTypeBool\n" + "%3 = OpTypeFunction %1\n" + "%8 = OpConstant %6 0\n" + "%18 = OpConstant %6 1\n" + "%12 = OpConstant %10 1\n" + "%2 = OpFunction %1 None %3\n" + "%4 = OpLabel\n" + "OpBranch %5\n" + + "%5 = OpLabel\n" + "%7 = OpPhi %6 %8 %4 %9 %5\n" + "%13 = OpFAdd %10 %11 %12\n" + "%17 = OpSLessThan %16 %7 %18\n" + "OpLoopMerge %19 %5 None\n" + "OpBranchConditional %17 %5 %19\n" + + "%19 = OpLabel\n" + "OpReturn\n" + "OpFunctionEnd", + { + { // defs. %9 & %11 are killed. + {1, "%1 = OpTypeVoid"}, + {2, "%2 = OpFunction %1 None %3"}, + {3, "%3 = OpTypeFunction %1"}, + {4, "%4 = OpLabel"}, + {5, "%5 = OpLabel"}, + {6, "%6 = OpTypeInt 32 0"}, + {7, "%7 = OpPhi %6 %8 %4 %9 %5"}, + {8, "%8 = OpConstant %6 0"}, + {10, "%10 = OpTypeFloat 32"}, + {12, "%12 = OpConstant %10 1.0"}, + {13, "%13 = OpFAdd %10 %11 %12"}, + {16, "%16 = OpTypeBool"}, + {17, "%17 = OpSLessThan %16 %7 %18"}, + {18, "%18 = OpConstant %6 1"}, + {19, "%19 = OpLabel"}, + }, + { // uses + {1, + { + "%2 = OpFunction %1 None %3", + "%3 = OpTypeFunction %1", + } + }, + {3, {"%2 = OpFunction %1 None %3"}}, + {4, + { + "%7 = OpPhi %6 %8 %4 %9 %5", + //"%11 = OpPhi %10 %12 %4 %13 %5", + } + }, + {5, + { + "OpBranch %5", + "%7 = OpPhi %6 %8 %4 %9 %5", + //"%11 = OpPhi %10 %12 %4 %13 %5", + "OpLoopMerge %19 %5 None", + "OpBranchConditional %17 %5 %19", + } + }, + {6, + { + // Can't properly check constants + //"%8 = OpConstant %6 0", + //"%18 = OpConstant %6 1", + "%7 = OpPhi %6 %8 %4 %9 %5", + //"%9 = OpIAdd %6 %7 %8" + } + }, + {7, {"%17 = OpSLessThan %16 %7 %18"}}, + {8, + { + "%7 = OpPhi %6 %8 %4 %9 %5", + //"%9 = OpIAdd %6 %7 %8", + } + }, + // {9, {"%7 = OpPhi %6 %8 %4 %13 %5"}}, + {10, + { + //"%11 = OpPhi %10 %12 %4 %13 %5", + //"%12 = OpConstant %10 1", + "%13 = OpFAdd %10 %11 %12" + } + }, + // {11, {"%13 = OpFAdd %10 %11 %12"}}, + {12, + { + //"%11 = OpPhi %10 %12 %4 %13 %5", + "%13 = OpFAdd %10 %11 %12" + } + }, + //{13, {"%11 = OpPhi %10 %12 %4 %13 %5"}}, + {16, {"%17 = OpSLessThan %16 %7 %18"}}, + {17, {"OpBranchConditional %17 %5 %19"}}, + {18, {"%17 = OpSLessThan %16 %7 %18"}}, + {19, + { + "OpLoopMerge %19 %5 None", + "OpBranchConditional %17 %5 %19", + } + }, + }, + }, + }, + { // OpPhi defining and referencing the same id. + "%1 = OpTypeBool " + "%3 = OpTypeFunction %1 " + "%2 = OpConstantTrue %1 " + "%4 = OpFunction %3 None %1 " + "%6 = OpLabel " + " OpBranch %7 " + "%7 = OpLabel " + "%8 = OpPhi %1 %8 %7 %2 %6 " // both defines and uses %8 + " OpBranch %7 " + " OpFunctionEnd", + {8}, + "%1 = OpTypeBool\n" + "%3 = OpTypeFunction %1\n" + "%2 = OpConstantTrue %1\n" + + "%4 = OpFunction %3 None %1\n" + "%6 = OpLabel\n" + "OpBranch %7\n" + "%7 = OpLabel\n" + "OpBranch %7\n" + "OpFunctionEnd", + { + { // defs + {1, "%1 = OpTypeBool"}, + {2, "%2 = OpConstantTrue %1"}, + {3, "%3 = OpTypeFunction %1"}, + {4, "%4 = OpFunction %3 None %1"}, + {6, "%6 = OpLabel"}, + {7, "%7 = OpLabel"}, + // {8, "%8 = OpPhi %1 %8 %7 %2 %6"}, + }, + { // uses + {1, + { + "%2 = OpConstantTrue %1", + "%3 = OpTypeFunction %1", + "%4 = OpFunction %3 None %1", + // "%8 = OpPhi %1 %8 %7 %2 %6", + } + }, + // {2, {"%8 = OpPhi %1 %8 %7 %2 %6"}}, + {3, {"%4 = OpFunction %3 None %1"}}, + // {6, {"%8 = OpPhi %1 %8 %7 %2 %6"}}, + {7, + { + "OpBranch %7", + // "%8 = OpPhi %1 %8 %7 %2 %6", + "OpBranch %7", + } + }, + // {8, {"%8 = OpPhi %1 %8 %7 %2 %6"}}, + }, + }, + }, + }) +); +// clang-format on + +TEST(DefUseTest, OpSwitch) { + // Because disassembler has basic type check for OpSwitch's selector, we + // cannot use the DisassembleInst() in the above. Thus, this special spotcheck + // test case. + + const char original_text[] = + // int64 f(int64 v) { + // switch (v) { + // case 1: break; + // case -4294967296: break; + // case 9223372036854775807: break; + // default: break; + // } + // return v; + // } + " %1 = OpTypeInt 64 1 " + " %3 = OpTypePointer Input %1 " + " %2 = OpFunction %1 None %3 " // %3 is int64(int64)* + " %4 = OpFunctionParameter %1 " + " %5 = OpLabel " + " %6 = OpLoad %1 %4 " // selector value + " OpSelectionMerge %7 None " + " OpSwitch %6 %8 " + " 1 %9 " // 1 + " -4294967296 %10 " // -2^32 + " 9223372036854775807 %11 " // 2^63-1 + " %8 = OpLabel " // default + " OpBranch %7 " + " %9 = OpLabel " + " OpBranch %7 " + "%10 = OpLabel " + " OpBranch %7 " + "%11 = OpLabel " + " OpBranch %7 " + " %7 = OpLabel " + " OpReturnValue %6 " + " OpFunctionEnd"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, original_text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ASSERT_NE(nullptr, context); + + // Force a re-build of def-use manager. + context->InvalidateAnalyses(ir::IRContext::Analysis::kAnalysisDefUse); + (void)context->get_def_use_mgr(); + + // Do a bunch replacements. + context->ReplaceAllUsesWith(11, 7); // to existing id + context->ReplaceAllUsesWith(10, 11); // to existing id + context->ReplaceAllUsesWith(9, 10); // to existing id + + // clang-format off + const char modified_text[] = + "%1 = OpTypeInt 64 1\n" + "%3 = OpTypePointer Input %1\n" + "%2 = OpFunction %1 None %3\n" // %3 is int64(int64)* + "%4 = OpFunctionParameter %1\n" + "%5 = OpLabel\n" + "%6 = OpLoad %1 %4\n" // selector value + "OpSelectionMerge %7 None\n" + "OpSwitch %6 %8 1 %10 -4294967296 %11 9223372036854775807 %7\n" // changed! + "%8 = OpLabel\n" // default + "OpBranch %7\n" + "%9 = OpLabel\n" + "OpBranch %7\n" + "%10 = OpLabel\n" + "OpBranch %7\n" + "%11 = OpLabel\n" + "OpBranch %7\n" + "%7 = OpLabel\n" + "OpReturnValue %6\n" + "OpFunctionEnd"; + // clang-format on + + EXPECT_EQ(modified_text, DisassembleModule(context->module())); + + InstDefUse def_uses = {}; + def_uses.defs = { + {1, "%1 = OpTypeInt 64 1"}, + {2, "%2 = OpFunction %1 None %3"}, + {3, "%3 = OpTypePointer Input %1"}, + {4, "%4 = OpFunctionParameter %1"}, + {5, "%5 = OpLabel"}, + {6, "%6 = OpLoad %1 %4"}, + {7, "%7 = OpLabel"}, + {8, "%8 = OpLabel"}, + {9, "%9 = OpLabel"}, + {10, "%10 = OpLabel"}, + {11, "%11 = OpLabel"}, + }; + CheckDef(def_uses, context->get_def_use_mgr()->id_to_defs()); + + { + EXPECT_EQ(2u, NumUses(context, 6)); + std::vector opcodes = GetUseOpcodes(context, 6u); + EXPECT_THAT(opcodes, UnorderedElementsAre(SpvOpSwitch, SpvOpReturnValue)); + } + { + EXPECT_EQ(6u, NumUses(context, 7)); + std::vector opcodes = GetUseOpcodes(context, 7u); + // OpSwitch is now a user of %7. + EXPECT_THAT(opcodes, UnorderedElementsAre(SpvOpSelectionMerge, SpvOpBranch, + SpvOpBranch, SpvOpBranch, + SpvOpBranch, SpvOpSwitch)); + } + // Check all ids only used by OpSwitch after replacement. + for (const auto id : {8u, 10u, 11u}) { + EXPECT_EQ(1u, NumUses(context, id)); + EXPECT_EQ(SpvOpSwitch, GetUseOpcodes(context, id).back()); + } +} + +// Test case for analyzing individual instructions. +struct AnalyzeInstDefUseTestCase { + const char* module_text; + InstDefUse expected_define_use; +}; + +using AnalyzeInstDefUseTest = + ::testing::TestWithParam; + +// Test the analyzing result for individual instructions. +TEST_P(AnalyzeInstDefUseTest, Case) { + auto tc = GetParam(); + + // Build module. + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, tc.module_text); + ASSERT_NE(nullptr, context); + + // Analyze the instructions. + opt::analysis::DefUseManager manager(context->module()); + + CheckDef(tc.expected_define_use, manager.id_to_defs()); + CheckUse(tc.expected_define_use, &manager, context->module()->IdBound()); + // CheckUse(tc.expected_define_use, manager.id_to_uses()); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + TestCase, AnalyzeInstDefUseTest, + ::testing::ValuesIn(std::vector{ + { // A type declaring instruction. + "%1 = OpTypeInt 32 1", + { + // defs + {{1, "%1 = OpTypeInt 32 1"}}, + {}, // no uses + }, + }, + { // A type declaring instruction and a constant value. + "%1 = OpTypeBool " + "%2 = OpConstantTrue %1", + { + { // defs + {1, "%1 = OpTypeBool"}, + {2, "%2 = OpConstantTrue %1"}, + }, + { // uses + {1, {"%2 = OpConstantTrue %1"}}, + }, + }, + }, + })); +// clang-format on + +using AnalyzeInstDefUse = ::testing::Test; + +TEST(AnalyzeInstDefUse, UseWithNoResultId) { + ir::IRContext context(SPV_ENV_UNIVERSAL_1_2, nullptr); + + // Analyze the instructions. + opt::analysis::DefUseManager manager(context.module()); + + ir::Instruction label(&context, SpvOpLabel, 0, 2, {}); + manager.AnalyzeInstDefUse(&label); + + ir::Instruction branch(&context, SpvOpBranch, 0, 0, + {{SPV_OPERAND_TYPE_ID, {2}}}); + manager.AnalyzeInstDefUse(&branch); + context.module()->SetIdBound(3); + + InstDefUse expected = { + // defs + { + {2, "%2 = OpLabel"}, + }, + // uses + {{2, {"OpBranch %2"}}}, + }; + + CheckDef(expected, manager.id_to_defs()); + CheckUse(expected, &manager, context.module()->IdBound()); +} + +TEST(AnalyzeInstDefUse, AddNewInstruction) { + const std::string input = "%1 = OpTypeBool"; + + // Build module. + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, input); + ASSERT_NE(nullptr, context); + + // Analyze the instructions. + opt::analysis::DefUseManager manager(context->module()); + + ir::Instruction newInst(context.get(), SpvOpConstantTrue, 1, 2, {}); + manager.AnalyzeInstDefUse(&newInst); + + InstDefUse expected = { + { + // defs + {1, "%1 = OpTypeBool"}, + {2, "%2 = OpConstantTrue %1"}, + }, + { + // uses + {1, {"%2 = OpConstantTrue %1"}}, + }, + }; + + CheckDef(expected, manager.id_to_defs()); + CheckUse(expected, &manager, context->module()->IdBound()); +} + +struct KillInstTestCase { + const char* before; + std::unordered_set indices_for_inst_to_kill; + const char* after; + InstDefUse expected_define_use; +}; + +using KillInstTest = ::testing::TestWithParam; + +TEST_P(KillInstTest, Case) { + auto tc = GetParam(); + + // Build module. + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, tc.before, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ASSERT_NE(nullptr, context); + + // Force a re-build of the def-use manager. + context->InvalidateAnalyses(ir::IRContext::Analysis::kAnalysisDefUse); + (void)context->get_def_use_mgr(); + + // KillInst + context->module()->ForEachInst([&tc, &context](ir::Instruction* inst) { + if (tc.indices_for_inst_to_kill.count(inst->result_id())) { + context->KillInst(inst); + } + }); + + EXPECT_EQ(tc.after, DisassembleModule(context->module())); + CheckDef(tc.expected_define_use, context->get_def_use_mgr()->id_to_defs()); + CheckUse(tc.expected_define_use, context->get_def_use_mgr(), + context->module()->IdBound()); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + TestCase, KillInstTest, + ::testing::ValuesIn(std::vector{ + // Kill id defining instructions. + { + "%3 = OpTypeVoid " + "%1 = OpTypeFunction %3 " + "%2 = OpFunction %1 None %3 " + "%4 = OpLabel " + " OpBranch %5 " + "%5 = OpLabel " + " OpBranch %6 " + "%6 = OpLabel " + " OpBranch %4 " + "%7 = OpLabel " + " OpReturn " + " OpFunctionEnd", + {3, 5, 7}, + "%1 = OpTypeFunction %3\n" + "%2 = OpFunction %1 None %3\n" + "%4 = OpLabel\n" + "OpBranch %5\n" + "OpNop\n" + "OpBranch %6\n" + "%6 = OpLabel\n" + "OpBranch %4\n" + "OpNop\n" + "OpReturn\n" + "OpFunctionEnd", + { + // defs + { + {1, "%1 = OpTypeFunction %3"}, + {2, "%2 = OpFunction %1 None %3"}, + {4, "%4 = OpLabel"}, + {6, "%6 = OpLabel"}, + }, + // uses + { + {1, {"%2 = OpFunction %1 None %3"}}, + {4, {"OpBranch %4"}}, + {6, {"OpBranch %6"}}, + } + } + }, + // Kill instructions that do not have result ids. + { + "%3 = OpTypeVoid " + "%1 = OpTypeFunction %3 " + "%2 = OpFunction %1 None %3 " + "%4 = OpLabel " + " OpBranch %5 " + "%5 = OpLabel " + " OpBranch %6 " + "%6 = OpLabel " + " OpBranch %4 " + "%7 = OpLabel " + " OpReturn " + " OpFunctionEnd", + {2, 4}, + "%3 = OpTypeVoid\n" + "%1 = OpTypeFunction %3\n" + "OpNop\n" + "OpNop\n" + "OpBranch %5\n" + "%5 = OpLabel\n" + "OpBranch %6\n" + "%6 = OpLabel\n" + "OpBranch %4\n" + "%7 = OpLabel\n" + "OpReturn\n" + "OpFunctionEnd", + { + // defs + { + {1, "%1 = OpTypeFunction %3"}, + {3, "%3 = OpTypeVoid"}, + {5, "%5 = OpLabel"}, + {6, "%6 = OpLabel"}, + {7, "%7 = OpLabel"}, + }, + // uses + { + {3, {"%1 = OpTypeFunction %3"}}, + {5, {"OpBranch %5"}}, + {6, {"OpBranch %6"}}, + } + } + }, + })); +// clang-format on + +struct GetAnnotationsTestCase { + const char* code; + uint32_t id; + std::vector annotations; +}; + +using GetAnnotationsTest = ::testing::TestWithParam; + +TEST_P(GetAnnotationsTest, Case) { + const GetAnnotationsTestCase& tc = GetParam(); + + // Build module. + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, tc.code); + ASSERT_NE(nullptr, context); + + // Get annotations + opt::analysis::DefUseManager manager(context->module()); + auto insts = manager.GetAnnotations(tc.id); + + // Check + ASSERT_EQ(tc.annotations.size(), insts.size()) + << "wrong number of annotation instructions"; + auto inst_iter = insts.begin(); + for (const std::string& expected_anno_inst : tc.annotations) { + EXPECT_EQ(expected_anno_inst, DisassembleInst(*inst_iter)) + << "annotation instruction mismatch"; + inst_iter++; + } +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + TestCase, GetAnnotationsTest, + ::testing::ValuesIn(std::vector{ + // empty + {"", 0, {}}, + // basic + { + // code + "OpDecorate %1 Block " + "OpDecorate %1 RelaxedPrecision " + "%3 = OpTypeInt 32 0 " + "%1 = OpTypeStruct %3", + // id + 1, + // annotations + { + "OpDecorate %1 Block", + "OpDecorate %1 RelaxedPrecision", + }, + }, + // with debug instructions + { + // code + "OpName %1 \"struct_type\" " + "OpName %3 \"int_type\" " + "OpDecorate %1 Block " + "OpDecorate %1 RelaxedPrecision " + "%3 = OpTypeInt 32 0 " + "%1 = OpTypeStruct %3", + // id + 1, + // annotations + { + "OpDecorate %1 Block", + "OpDecorate %1 RelaxedPrecision", + }, + }, + // no annotations + { + // code + "OpName %1 \"struct_type\" " + "OpName %3 \"int_type\" " + "OpDecorate %1 Block " + "OpDecorate %1 RelaxedPrecision " + "%3 = OpTypeInt 32 0 " + "%1 = OpTypeStruct %3", + // id + 3, + // annotations + {}, + }, + // decoration group + { + // code + "OpDecorate %1 Block " + "OpDecorate %1 RelaxedPrecision " + "%1 = OpDecorationGroup " + "OpGroupDecorate %1 %2 %3 " + "%4 = OpTypeInt 32 0 " + "%2 = OpTypeStruct %4 " + "%3 = OpTypeStruct %4 %4", + // id + 3, + // annotations + { + "OpGroupDecorate %1 %2 %3", + }, + }, + // memeber decorate + { + // code + "OpMemberDecorate %1 0 RelaxedPrecision " + "%2 = OpTypeInt 32 0 " + "%1 = OpTypeStruct %2 %2", + // id + 1, + // annotations + { + "OpMemberDecorate %1 0 RelaxedPrecision", + }, + }, + })); + +using UpdateUsesTest = PassTest<::testing::Test>; + +TEST_F(UpdateUsesTest, KeepOldUses) { + const std::vector text = { + // clang-format off + "OpCapability Shader", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Vertex %main \"main\"", + "OpName %main \"main\"", + "%void = OpTypeVoid", + "%4 = OpTypeFunction %void", + "%uint = OpTypeInt 32 0", + "%uint_5 = OpConstant %uint 5", + "%25 = OpConstant %uint 25", + "%main = OpFunction %void None %4", + "%8 = OpLabel", + "%9 = OpIMul %uint %uint_5 %uint_5", + "%10 = OpIMul %uint %9 %uint_5", + "OpReturn", + "OpFunctionEnd" + // clang-format on + }; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, JoinAllInsts(text), + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ASSERT_NE(nullptr, context); + + DefUseManager* def_use_mgr = context->get_def_use_mgr(); + ir::Instruction* def = def_use_mgr->GetDef(9); + ir::Instruction* use = def_use_mgr->GetDef(10); + def->SetOpcode(SpvOpCopyObject); + def->SetInOperands({{SPV_OPERAND_TYPE_ID, {25}}}); + context->UpdateDefUse(def); + + auto users = def_use_mgr->id_to_users(); + opt::analysis::UserEntry entry = {def, use}; + EXPECT_THAT(users, Contains(entry)); +} +// clang-format on +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,79 @@ +# Copyright (c) 2017 Google 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. + + +add_spvtools_unittest(TARGET dominator_analysis_simple + SRCS ../function_utils.h + simple.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET dominator_analysis_post + SRCS ../function_utils.h + post.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET dominator_analysis_nested_ifs + SRCS ../function_utils.h + nested_ifs.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET dominator_analysis_nested_ifs_post + SRCS ../function_utils.h + nested_ifs_post.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET dominator_analysis_nested_loops + SRCS ../function_utils.h + nested_loops.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET dominator_analysis_nested_loops_with_unreachables + SRCS ../function_utils.h + nested_loops_with_unreachables.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET dominator_analysis_switch_case_fallthrough + SRCS ../function_utils.h + switch_case_fallthrough.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET dominator_analysis_unreachable_for + SRCS ../function_utils.h + unreachable_for.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET dominator_analysis_unreachable_for_post + SRCS ../function_utils.h + unreachable_for_post.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET dominator_generated + SRCS ../function_utils.h + generated.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET dominator_common_dominators + SRCS common_dominators.cpp + LIBS SPIRV-Tools-opt +) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/common_dominators.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/common_dominators.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/common_dominators.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/common_dominators.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,151 @@ +// Copyright (c) 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include + +#include "opt/build_module.h" +#include "opt/ir_context.h" + +namespace { + +using namespace spvtools; +using CommonDominatorsTest = ::testing::Test; + +const std::string text = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %func "func" +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%functy = OpTypeFunction %void +%func = OpFunction %void None %functy +%1 = OpLabel +OpBranch %2 +%2 = OpLabel +OpLoopMerge %3 %4 None +OpBranch %5 +%5 = OpLabel +OpBranchConditional %true %3 %4 +%4 = OpLabel +OpBranch %2 +%3 = OpLabel +OpSelectionMerge %6 None +OpBranchConditional %true %7 %8 +%7 = OpLabel +OpBranch %6 +%8 = OpLabel +OpBranch %9 +%9 = OpLabel +OpBranch %6 +%6 = OpLabel +OpBranch %10 +%11 = OpLabel +OpBranch %10 +%10 = OpLabel +OpReturn +OpFunctionEnd +)"; + +ir::BasicBlock* GetBlock(uint32_t id, std::unique_ptr& context) { + return context->get_instr_block(context->get_def_use_mgr()->GetDef(id)); +} + +TEST(CommonDominatorsTest, SameBlock) { + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(nullptr, context); + + ir::CFG cfg(context->module()); + opt::DominatorAnalysis* analysis = + context->GetDominatorAnalysis(&*context->module()->begin(), cfg); + + for (auto& block : *context->module()->begin()) { + EXPECT_EQ(&block, analysis->CommonDominator(&block, &block)); + } +} + +TEST(CommonDominatorsTest, ParentAndChild) { + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(nullptr, context); + + ir::CFG cfg(context->module()); + opt::DominatorAnalysis* analysis = + context->GetDominatorAnalysis(&*context->module()->begin(), cfg); + + EXPECT_EQ( + GetBlock(1u, context), + analysis->CommonDominator(GetBlock(1u, context), GetBlock(2u, context))); + EXPECT_EQ( + GetBlock(2u, context), + analysis->CommonDominator(GetBlock(2u, context), GetBlock(5u, context))); + EXPECT_EQ( + GetBlock(1u, context), + analysis->CommonDominator(GetBlock(1u, context), GetBlock(5u, context))); +} + +TEST(CommonDominatorsTest, BranchSplit) { + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(nullptr, context); + + ir::CFG cfg(context->module()); + opt::DominatorAnalysis* analysis = + context->GetDominatorAnalysis(&*context->module()->begin(), cfg); + + EXPECT_EQ( + GetBlock(3u, context), + analysis->CommonDominator(GetBlock(7u, context), GetBlock(8u, context))); + EXPECT_EQ( + GetBlock(3u, context), + analysis->CommonDominator(GetBlock(7u, context), GetBlock(9u, context))); +} + +TEST(CommonDominatorsTest, LoopContinueAndMerge) { + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(nullptr, context); + + ir::CFG cfg(context->module()); + opt::DominatorAnalysis* analysis = + context->GetDominatorAnalysis(&*context->module()->begin(), cfg); + + EXPECT_EQ( + GetBlock(5u, context), + analysis->CommonDominator(GetBlock(3u, context), GetBlock(4u, context))); +} + +TEST(CommonDominatorsTest, NoCommonDominator) { + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(nullptr, context); + + ir::CFG cfg(context->module()); + opt::DominatorAnalysis* analysis = + context->GetDominatorAnalysis(&*context->module()->begin(), cfg); + + EXPECT_EQ(nullptr, analysis->CommonDominator(GetBlock(10u, context), + GetBlock(11u, context))); + EXPECT_EQ(nullptr, analysis->CommonDominator(GetBlock(11u, context), + GetBlock(6u, context))); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/generated.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/generated.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/generated.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/generated.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,908 @@ +// Copyright (c) 2017 Google 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. + +#include + +#include +#include +#include +#include +#include + +#include "../assembly_builder.h" +#include "../function_utils.h" +#include "../pass_fixture.h" +#include "../pass_utils.h" +#include "opt/dominator_analysis.h" +#include "opt/iterator.h" +#include "opt/pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +// Check that x dominates y, and +// if x != y then +// x strictly dominates y and +// y does not dominate x and +// y does not strictly dominate x +// if x == x then +// x does not strictly dominate itself +void check_dominance(const opt::DominatorAnalysisBase& dom_tree, + const ir::Function* fn, uint32_t x, uint32_t y) { + SCOPED_TRACE("Check dominance properties for Basic Block " + + std::to_string(x) + " and " + std::to_string(y)); + EXPECT_TRUE(dom_tree.Dominates(spvtest::GetBasicBlock(fn, x), + spvtest::GetBasicBlock(fn, y))); + EXPECT_TRUE(dom_tree.Dominates(x, y)); + if (x == y) { + EXPECT_FALSE(dom_tree.StrictlyDominates(x, x)); + } else { + EXPECT_TRUE(dom_tree.StrictlyDominates(x, y)); + EXPECT_FALSE(dom_tree.Dominates(y, x)); + EXPECT_FALSE(dom_tree.StrictlyDominates(y, x)); + } +} + +// Check that x does not dominates y and vise versa +void check_no_dominance(const opt::DominatorAnalysisBase& dom_tree, + const ir::Function* fn, uint32_t x, uint32_t y) { + SCOPED_TRACE("Check no domination for Basic Block " + std::to_string(x) + + " and " + std::to_string(y)); + EXPECT_FALSE(dom_tree.Dominates(spvtest::GetBasicBlock(fn, x), + spvtest::GetBasicBlock(fn, y))); + EXPECT_FALSE(dom_tree.Dominates(x, y)); + EXPECT_FALSE(dom_tree.StrictlyDominates(spvtest::GetBasicBlock(fn, x), + spvtest::GetBasicBlock(fn, y))); + EXPECT_FALSE(dom_tree.StrictlyDominates(x, y)); + + EXPECT_FALSE(dom_tree.Dominates(spvtest::GetBasicBlock(fn, y), + spvtest::GetBasicBlock(fn, x))); + EXPECT_FALSE(dom_tree.Dominates(y, x)); + EXPECT_FALSE(dom_tree.StrictlyDominates(spvtest::GetBasicBlock(fn, y), + spvtest::GetBasicBlock(fn, x))); + EXPECT_FALSE(dom_tree.StrictlyDominates(y, x)); +} + +TEST_F(PassClassTest, DominatorSimpleCFG) { + const std::string text = R"( + OpCapability Addresses + OpCapability Kernel + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "main" + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %4 = OpTypeBool + %5 = OpTypeInt 32 0 + %6 = OpConstant %5 0 + %7 = OpConstantFalse %4 + %8 = OpConstantTrue %4 + %9 = OpConstant %5 1 + %1 = OpFunction %2 None %3 + %10 = OpLabel + OpBranch %11 + %11 = OpLabel + OpSwitch %6 %12 1 %13 + %12 = OpLabel + OpBranch %14 + %13 = OpLabel + OpBranch %14 + %14 = OpLabel + OpBranchConditional %8 %11 %15 + %15 = OpLabel + OpReturn + OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_0, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* fn = spvtest::GetFunction(module, 1); + const ir::BasicBlock* entry = spvtest::GetBasicBlock(fn, 10); + EXPECT_EQ(entry, fn->entry().get()) + << "The entry node is not the expected one"; + + // Test normal dominator tree + { + opt::DominatorAnalysis dom_tree; + ir::CFG cfg(module); + dom_tree.InitializeTree(fn, cfg); + + // Inspect the actual tree + opt::DominatorTree& tree = dom_tree.GetDomTree(); + EXPECT_EQ(tree.GetRoot()->bb_, cfg.pseudo_entry_block()); + EXPECT_TRUE( + dom_tree.Dominates(cfg.pseudo_entry_block()->id(), entry->id())); + + // (strict) dominance checks + for (uint32_t id : {10, 11, 12, 13, 14, 15}) + check_dominance(dom_tree, fn, id, id); + + check_dominance(dom_tree, fn, 10, 11); + check_dominance(dom_tree, fn, 10, 12); + check_dominance(dom_tree, fn, 10, 13); + check_dominance(dom_tree, fn, 10, 14); + check_dominance(dom_tree, fn, 10, 15); + + check_dominance(dom_tree, fn, 11, 12); + check_dominance(dom_tree, fn, 11, 13); + check_dominance(dom_tree, fn, 11, 14); + check_dominance(dom_tree, fn, 11, 15); + + check_dominance(dom_tree, fn, 14, 15); + + check_no_dominance(dom_tree, fn, 12, 13); + check_no_dominance(dom_tree, fn, 12, 14); + check_no_dominance(dom_tree, fn, 13, 14); + + // check with some invalid inputs + EXPECT_FALSE(dom_tree.Dominates(nullptr, entry)); + EXPECT_FALSE(dom_tree.Dominates(entry, nullptr)); + EXPECT_FALSE(dom_tree.Dominates(static_cast(nullptr), + static_cast(nullptr))); + EXPECT_FALSE(dom_tree.Dominates(10, 1)); + EXPECT_FALSE(dom_tree.Dominates(1, 10)); + EXPECT_FALSE(dom_tree.Dominates(1, 1)); + + EXPECT_FALSE(dom_tree.StrictlyDominates(nullptr, entry)); + EXPECT_FALSE(dom_tree.StrictlyDominates(entry, nullptr)); + EXPECT_FALSE(dom_tree.StrictlyDominates(nullptr, nullptr)); + EXPECT_FALSE(dom_tree.StrictlyDominates(10, 1)); + EXPECT_FALSE(dom_tree.StrictlyDominates(1, 10)); + EXPECT_FALSE(dom_tree.StrictlyDominates(1, 1)); + + EXPECT_EQ(dom_tree.ImmediateDominator(cfg.pseudo_entry_block()), nullptr); + EXPECT_EQ(dom_tree.ImmediateDominator(entry), cfg.pseudo_entry_block()); + EXPECT_EQ(dom_tree.ImmediateDominator(nullptr), nullptr); + + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 11)), + spvtest::GetBasicBlock(fn, 10)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 12)), + spvtest::GetBasicBlock(fn, 11)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 13)), + spvtest::GetBasicBlock(fn, 11)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 14)), + spvtest::GetBasicBlock(fn, 11)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 15)), + spvtest::GetBasicBlock(fn, 14)); + } + + // Test post dominator tree + { + opt::PostDominatorAnalysis dom_tree; + ir::CFG cfg(module); + dom_tree.InitializeTree(fn, cfg); + + // Inspect the actual tree + opt::DominatorTree& tree = dom_tree.GetDomTree(); + EXPECT_EQ(tree.GetRoot()->bb_, cfg.pseudo_exit_block()); + EXPECT_TRUE(dom_tree.Dominates(cfg.pseudo_exit_block()->id(), 15)); + + // (strict) dominance checks + for (uint32_t id : {10, 11, 12, 13, 14, 15}) + check_dominance(dom_tree, fn, id, id); + + check_dominance(dom_tree, fn, 14, 10); + check_dominance(dom_tree, fn, 14, 11); + check_dominance(dom_tree, fn, 14, 12); + check_dominance(dom_tree, fn, 14, 13); + + check_dominance(dom_tree, fn, 15, 10); + check_dominance(dom_tree, fn, 15, 11); + check_dominance(dom_tree, fn, 15, 12); + check_dominance(dom_tree, fn, 15, 13); + check_dominance(dom_tree, fn, 15, 14); + + check_no_dominance(dom_tree, fn, 13, 12); + check_no_dominance(dom_tree, fn, 12, 11); + check_no_dominance(dom_tree, fn, 13, 11); + + // check with some invalid inputs + EXPECT_FALSE(dom_tree.Dominates(nullptr, entry)); + EXPECT_FALSE(dom_tree.Dominates(entry, nullptr)); + EXPECT_FALSE(dom_tree.Dominates(static_cast(nullptr), + static_cast(nullptr))); + EXPECT_FALSE(dom_tree.Dominates(10, 1)); + EXPECT_FALSE(dom_tree.Dominates(1, 10)); + EXPECT_FALSE(dom_tree.Dominates(1, 1)); + + EXPECT_FALSE(dom_tree.StrictlyDominates(nullptr, entry)); + EXPECT_FALSE(dom_tree.StrictlyDominates(entry, nullptr)); + EXPECT_FALSE(dom_tree.StrictlyDominates(nullptr, nullptr)); + EXPECT_FALSE(dom_tree.StrictlyDominates(10, 1)); + EXPECT_FALSE(dom_tree.StrictlyDominates(1, 10)); + EXPECT_FALSE(dom_tree.StrictlyDominates(1, 1)); + + EXPECT_EQ(dom_tree.ImmediateDominator(nullptr), nullptr); + + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 11)), + spvtest::GetBasicBlock(fn, 14)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 12)), + spvtest::GetBasicBlock(fn, 14)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 13)), + spvtest::GetBasicBlock(fn, 14)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 14)), + spvtest::GetBasicBlock(fn, 15)); + + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 15)), + cfg.pseudo_exit_block()); + + EXPECT_EQ(dom_tree.ImmediateDominator(cfg.pseudo_exit_block()), nullptr); + } +} + +TEST_F(PassClassTest, DominatorIrreducibleCFG) { + const std::string text = R"( + OpCapability Addresses + OpCapability Kernel + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "main" + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %4 = OpTypeBool + %5 = OpTypeInt 32 0 + %6 = OpConstantFalse %4 + %7 = OpConstantTrue %4 + %1 = OpFunction %2 None %3 + %8 = OpLabel + OpBranch %9 + %9 = OpLabel + OpBranchConditional %7 %10 %11 + %10 = OpLabel + OpBranch %11 + %11 = OpLabel + OpBranchConditional %7 %10 %12 + %12 = OpLabel + OpReturn + OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_0, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* fn = spvtest::GetFunction(module, 1); + + const ir::BasicBlock* entry = spvtest::GetBasicBlock(fn, 8); + EXPECT_EQ(entry, fn->entry().get()) + << "The entry node is not the expected one"; + + // Check normal dominator tree + { + opt::DominatorAnalysis dom_tree; + ir::CFG cfg(module); + dom_tree.InitializeTree(fn, cfg); + + // Inspect the actual tree + opt::DominatorTree& tree = dom_tree.GetDomTree(); + EXPECT_EQ(tree.GetRoot()->bb_, cfg.pseudo_entry_block()); + EXPECT_TRUE( + dom_tree.Dominates(cfg.pseudo_entry_block()->id(), entry->id())); + + // (strict) dominance checks + for (uint32_t id : {8, 9, 10, 11, 12}) + check_dominance(dom_tree, fn, id, id); + + check_dominance(dom_tree, fn, 8, 9); + check_dominance(dom_tree, fn, 8, 10); + check_dominance(dom_tree, fn, 8, 11); + check_dominance(dom_tree, fn, 8, 12); + + check_dominance(dom_tree, fn, 9, 10); + check_dominance(dom_tree, fn, 9, 11); + check_dominance(dom_tree, fn, 9, 12); + + check_dominance(dom_tree, fn, 11, 12); + + check_no_dominance(dom_tree, fn, 10, 11); + + EXPECT_EQ(dom_tree.ImmediateDominator(cfg.pseudo_entry_block()), nullptr); + EXPECT_EQ(dom_tree.ImmediateDominator(entry), cfg.pseudo_entry_block()); + + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 9)), + spvtest::GetBasicBlock(fn, 8)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 10)), + spvtest::GetBasicBlock(fn, 9)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 11)), + spvtest::GetBasicBlock(fn, 9)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 12)), + spvtest::GetBasicBlock(fn, 11)); + } + + // Check post dominator tree + { + opt::PostDominatorAnalysis dom_tree; + ir::CFG cfg(module); + dom_tree.InitializeTree(fn, cfg); + + // Inspect the actual tree + opt::DominatorTree& tree = dom_tree.GetDomTree(); + EXPECT_EQ(tree.GetRoot()->bb_, cfg.pseudo_exit_block()); + EXPECT_TRUE(dom_tree.Dominates(cfg.pseudo_exit_block()->id(), 12)); + + // (strict) dominance checks + for (uint32_t id : {8, 9, 10, 11, 12}) + check_dominance(dom_tree, fn, id, id); + + check_dominance(dom_tree, fn, 12, 8); + check_dominance(dom_tree, fn, 12, 10); + check_dominance(dom_tree, fn, 12, 11); + check_dominance(dom_tree, fn, 12, 12); + + check_dominance(dom_tree, fn, 11, 8); + check_dominance(dom_tree, fn, 11, 9); + check_dominance(dom_tree, fn, 11, 10); + + check_dominance(dom_tree, fn, 9, 8); + + EXPECT_EQ(dom_tree.ImmediateDominator(entry), + spvtest::GetBasicBlock(fn, 9)); + + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 9)), + spvtest::GetBasicBlock(fn, 11)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 10)), + spvtest::GetBasicBlock(fn, 11)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 11)), + spvtest::GetBasicBlock(fn, 12)); + + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 12)), + cfg.pseudo_exit_block()); + + EXPECT_EQ(dom_tree.ImmediateDominator(cfg.pseudo_exit_block()), nullptr); + } +} + +TEST_F(PassClassTest, DominatorLoopToSelf) { + const std::string text = R"( + OpCapability Addresses + OpCapability Kernel + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "main" + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %4 = OpTypeBool + %5 = OpTypeInt 32 0 + %6 = OpConstant %5 0 + %7 = OpConstantFalse %4 + %8 = OpConstantTrue %4 + %9 = OpConstant %5 1 + %1 = OpFunction %2 None %3 + %10 = OpLabel + OpBranch %11 + %11 = OpLabel + OpSwitch %6 %12 1 %11 + %12 = OpLabel + OpReturn + OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_0, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* fn = spvtest::GetFunction(module, 1); + + const ir::BasicBlock* entry = spvtest::GetBasicBlock(fn, 10); + EXPECT_EQ(entry, fn->entry().get()) + << "The entry node is not the expected one"; + + // Check normal dominator tree + { + opt::DominatorAnalysis dom_tree; + ir::CFG cfg(module); + dom_tree.InitializeTree(fn, cfg); + + // Inspect the actual tree + opt::DominatorTree& tree = dom_tree.GetDomTree(); + EXPECT_EQ(tree.GetRoot()->bb_, cfg.pseudo_entry_block()); + EXPECT_TRUE( + dom_tree.Dominates(cfg.pseudo_entry_block()->id(), entry->id())); + + // (strict) dominance checks + for (uint32_t id : {10, 11, 12}) check_dominance(dom_tree, fn, id, id); + + check_dominance(dom_tree, fn, 10, 11); + check_dominance(dom_tree, fn, 10, 12); + check_dominance(dom_tree, fn, 11, 12); + + EXPECT_EQ(dom_tree.ImmediateDominator(cfg.pseudo_entry_block()), nullptr); + EXPECT_EQ(dom_tree.ImmediateDominator(entry), cfg.pseudo_entry_block()); + + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 11)), + spvtest::GetBasicBlock(fn, 10)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 12)), + spvtest::GetBasicBlock(fn, 11)); + + std::array node_order = {{10, 11, 12}}; + { + // Test dominator tree iteration order. + opt::DominatorTree::iterator node_it = dom_tree.GetDomTree().begin(); + opt::DominatorTree::iterator node_end = dom_tree.GetDomTree().end(); + for (uint32_t id : node_order) { + EXPECT_NE(node_it, node_end); + EXPECT_EQ(node_it->id(), id); + node_it++; + } + EXPECT_EQ(node_it, node_end); + } + { + // Same as above, but with const iterators. + opt::DominatorTree::const_iterator node_it = + dom_tree.GetDomTree().cbegin(); + opt::DominatorTree::const_iterator node_end = + dom_tree.GetDomTree().cend(); + for (uint32_t id : node_order) { + EXPECT_NE(node_it, node_end); + EXPECT_EQ(node_it->id(), id); + node_it++; + } + EXPECT_EQ(node_it, node_end); + } + { + // Test dominator tree iteration order. + opt::DominatorTree::post_iterator node_it = + dom_tree.GetDomTree().post_begin(); + opt::DominatorTree::post_iterator node_end = + dom_tree.GetDomTree().post_end(); + for (uint32_t id : + ir::make_range(node_order.rbegin(), node_order.rend())) { + EXPECT_NE(node_it, node_end); + EXPECT_EQ(node_it->id(), id); + node_it++; + } + EXPECT_EQ(node_it, node_end); + } + { + // Same as above, but with const iterators. + opt::DominatorTree::const_post_iterator node_it = + dom_tree.GetDomTree().post_cbegin(); + opt::DominatorTree::const_post_iterator node_end = + dom_tree.GetDomTree().post_cend(); + for (uint32_t id : + ir::make_range(node_order.rbegin(), node_order.rend())) { + EXPECT_NE(node_it, node_end); + EXPECT_EQ(node_it->id(), id); + node_it++; + } + EXPECT_EQ(node_it, node_end); + } + } + + // Check post dominator tree + { + opt::PostDominatorAnalysis dom_tree; + ir::CFG cfg(module); + dom_tree.InitializeTree(fn, cfg); + + // Inspect the actual tree + opt::DominatorTree& tree = dom_tree.GetDomTree(); + EXPECT_EQ(tree.GetRoot()->bb_, cfg.pseudo_exit_block()); + EXPECT_TRUE(dom_tree.Dominates(cfg.pseudo_exit_block()->id(), 12)); + + // (strict) dominance checks + for (uint32_t id : {10, 11, 12}) check_dominance(dom_tree, fn, id, id); + + check_dominance(dom_tree, fn, 12, 10); + check_dominance(dom_tree, fn, 12, 11); + check_dominance(dom_tree, fn, 12, 12); + + EXPECT_EQ(dom_tree.ImmediateDominator(entry), + spvtest::GetBasicBlock(fn, 11)); + + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 11)), + spvtest::GetBasicBlock(fn, 12)); + + EXPECT_EQ(dom_tree.ImmediateDominator(cfg.pseudo_exit_block()), nullptr); + + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 12)), + cfg.pseudo_exit_block()); + + std::array node_order = {{12, 11, 10}}; + { + // Test dominator tree iteration order. + opt::DominatorTree::iterator node_it = tree.begin(); + opt::DominatorTree::iterator node_end = tree.end(); + for (uint32_t id : node_order) { + EXPECT_NE(node_it, node_end); + EXPECT_EQ(node_it->id(), id); + node_it++; + } + EXPECT_EQ(node_it, node_end); + } + { + // Same as above, but with const iterators. + opt::DominatorTree::const_iterator node_it = tree.cbegin(); + opt::DominatorTree::const_iterator node_end = tree.cend(); + for (uint32_t id : node_order) { + EXPECT_NE(node_it, node_end); + EXPECT_EQ(node_it->id(), id); + node_it++; + } + EXPECT_EQ(node_it, node_end); + } + { + // Test dominator tree iteration order. + opt::DominatorTree::post_iterator node_it = + dom_tree.GetDomTree().post_begin(); + opt::DominatorTree::post_iterator node_end = + dom_tree.GetDomTree().post_end(); + for (uint32_t id : + ir::make_range(node_order.rbegin(), node_order.rend())) { + EXPECT_NE(node_it, node_end); + EXPECT_EQ(node_it->id(), id); + node_it++; + } + EXPECT_EQ(node_it, node_end); + } + { + // Same as above, but with const iterators. + opt::DominatorTree::const_post_iterator node_it = + dom_tree.GetDomTree().post_cbegin(); + opt::DominatorTree::const_post_iterator node_end = + dom_tree.GetDomTree().post_cend(); + for (uint32_t id : + ir::make_range(node_order.rbegin(), node_order.rend())) { + EXPECT_NE(node_it, node_end); + EXPECT_EQ(node_it->id(), id); + node_it++; + } + EXPECT_EQ(node_it, node_end); + } + } +} + +TEST_F(PassClassTest, DominatorUnreachableInLoop) { + const std::string text = R"( + OpCapability Addresses + OpCapability Kernel + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "main" + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %4 = OpTypeBool + %5 = OpTypeInt 32 0 + %6 = OpConstant %5 0 + %7 = OpConstantFalse %4 + %8 = OpConstantTrue %4 + %9 = OpConstant %5 1 + %1 = OpFunction %2 None %3 + %10 = OpLabel + OpBranch %11 + %11 = OpLabel + OpSwitch %6 %12 1 %13 + %12 = OpLabel + OpBranch %14 + %13 = OpLabel + OpUnreachable + %14 = OpLabel + OpBranchConditional %8 %11 %15 + %15 = OpLabel + OpReturn + OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_0, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* fn = spvtest::GetFunction(module, 1); + + const ir::BasicBlock* entry = spvtest::GetBasicBlock(fn, 10); + EXPECT_EQ(entry, fn->entry().get()) + << "The entry node is not the expected one"; + + // Check normal dominator tree + { + opt::DominatorAnalysis dom_tree; + ir::CFG cfg(module); + dom_tree.InitializeTree(fn, cfg); + + // Inspect the actual tree + opt::DominatorTree& tree = dom_tree.GetDomTree(); + EXPECT_EQ(tree.GetRoot()->bb_, cfg.pseudo_entry_block()); + EXPECT_TRUE( + dom_tree.Dominates(cfg.pseudo_entry_block()->id(), entry->id())); + + // (strict) dominance checks + for (uint32_t id : {10, 11, 12, 13, 14, 15}) + check_dominance(dom_tree, fn, id, id); + + check_dominance(dom_tree, fn, 10, 11); + check_dominance(dom_tree, fn, 10, 13); + check_dominance(dom_tree, fn, 10, 12); + check_dominance(dom_tree, fn, 10, 14); + check_dominance(dom_tree, fn, 10, 15); + + check_dominance(dom_tree, fn, 11, 12); + check_dominance(dom_tree, fn, 11, 13); + check_dominance(dom_tree, fn, 11, 14); + check_dominance(dom_tree, fn, 11, 15); + + check_dominance(dom_tree, fn, 12, 14); + check_dominance(dom_tree, fn, 12, 15); + + check_dominance(dom_tree, fn, 14, 15); + + check_no_dominance(dom_tree, fn, 13, 12); + check_no_dominance(dom_tree, fn, 13, 14); + check_no_dominance(dom_tree, fn, 13, 15); + + EXPECT_EQ(dom_tree.ImmediateDominator(cfg.pseudo_entry_block()), nullptr); + EXPECT_EQ(dom_tree.ImmediateDominator(entry), cfg.pseudo_entry_block()); + + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 11)), + spvtest::GetBasicBlock(fn, 10)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 12)), + spvtest::GetBasicBlock(fn, 11)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 13)), + spvtest::GetBasicBlock(fn, 11)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 14)), + spvtest::GetBasicBlock(fn, 12)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 15)), + spvtest::GetBasicBlock(fn, 14)); + } + + // Check post dominator tree. + { + opt::PostDominatorAnalysis dom_tree; + ir::CFG cfg(module); + dom_tree.InitializeTree(fn, cfg); + + // (strict) dominance checks. + for (uint32_t id : {10, 11, 12, 13, 14, 15}) + check_dominance(dom_tree, fn, id, id); + + check_no_dominance(dom_tree, fn, 15, 10); + check_no_dominance(dom_tree, fn, 15, 11); + check_no_dominance(dom_tree, fn, 15, 12); + check_no_dominance(dom_tree, fn, 15, 13); + check_no_dominance(dom_tree, fn, 15, 14); + + check_dominance(dom_tree, fn, 14, 12); + + check_no_dominance(dom_tree, fn, 13, 10); + check_no_dominance(dom_tree, fn, 13, 11); + check_no_dominance(dom_tree, fn, 13, 12); + check_no_dominance(dom_tree, fn, 13, 14); + check_no_dominance(dom_tree, fn, 13, 15); + + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 10)), + spvtest::GetBasicBlock(fn, 11)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 12)), + spvtest::GetBasicBlock(fn, 14)); + + EXPECT_EQ(dom_tree.ImmediateDominator(cfg.pseudo_exit_block()), nullptr); + + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 15)), + cfg.pseudo_exit_block()); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 13)), + cfg.pseudo_exit_block()); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 14)), + cfg.pseudo_exit_block()); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 11)), + cfg.pseudo_exit_block()); + } +} + +TEST_F(PassClassTest, DominatorInfinitLoop) { + const std::string text = R"( + OpCapability Addresses + OpCapability Kernel + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "main" + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %4 = OpTypeBool + %5 = OpTypeInt 32 0 + %6 = OpConstant %5 0 + %7 = OpConstantFalse %4 + %8 = OpConstantTrue %4 + %9 = OpConstant %5 1 + %1 = OpFunction %2 None %3 + %10 = OpLabel + OpBranch %11 + %11 = OpLabel + OpSwitch %6 %12 1 %13 + %12 = OpLabel + OpReturn + %13 = OpLabel + OpBranch %13 + OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_0, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* fn = spvtest::GetFunction(module, 1); + + const ir::BasicBlock* entry = spvtest::GetBasicBlock(fn, 10); + EXPECT_EQ(entry, fn->entry().get()) + << "The entry node is not the expected one"; + // Check normal dominator tree + { + opt::DominatorAnalysis dom_tree; + ir::CFG cfg(module); + dom_tree.InitializeTree(fn, cfg); + + // Inspect the actual tree + opt::DominatorTree& tree = dom_tree.GetDomTree(); + EXPECT_EQ(tree.GetRoot()->bb_, cfg.pseudo_entry_block()); + EXPECT_TRUE( + dom_tree.Dominates(cfg.pseudo_entry_block()->id(), entry->id())); + + // (strict) dominance checks + for (uint32_t id : {10, 11, 12, 13}) check_dominance(dom_tree, fn, id, id); + + check_dominance(dom_tree, fn, 10, 11); + check_dominance(dom_tree, fn, 10, 12); + check_dominance(dom_tree, fn, 10, 13); + + check_dominance(dom_tree, fn, 11, 12); + check_dominance(dom_tree, fn, 11, 13); + + check_no_dominance(dom_tree, fn, 13, 12); + + EXPECT_EQ(dom_tree.ImmediateDominator(cfg.pseudo_entry_block()), nullptr); + EXPECT_EQ(dom_tree.ImmediateDominator(entry), cfg.pseudo_entry_block()); + + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 11)), + spvtest::GetBasicBlock(fn, 10)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 12)), + spvtest::GetBasicBlock(fn, 11)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 13)), + spvtest::GetBasicBlock(fn, 11)); + } + + // Check post dominator tree + { + opt::PostDominatorAnalysis dom_tree; + ir::CFG cfg(module); + dom_tree.InitializeTree(fn, cfg); + + // Inspect the actual tree + opt::DominatorTree& tree = dom_tree.GetDomTree(); + EXPECT_EQ(tree.GetRoot()->bb_, cfg.pseudo_exit_block()); + EXPECT_TRUE(dom_tree.Dominates(cfg.pseudo_exit_block()->id(), 12)); + + // (strict) dominance checks + for (uint32_t id : {10, 11, 12}) check_dominance(dom_tree, fn, id, id); + + check_dominance(dom_tree, fn, 12, 11); + check_dominance(dom_tree, fn, 12, 10); + + // 13 should be completely out of tree as it's unreachable from exit nodes + check_no_dominance(dom_tree, fn, 12, 13); + check_no_dominance(dom_tree, fn, 11, 13); + check_no_dominance(dom_tree, fn, 10, 13); + + EXPECT_EQ(dom_tree.ImmediateDominator(cfg.pseudo_exit_block()), nullptr); + + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 12)), + cfg.pseudo_exit_block()); + + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 10)), + spvtest::GetBasicBlock(fn, 11)); + + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 11)), + spvtest::GetBasicBlock(fn, 12)); + } +} + +TEST_F(PassClassTest, DominatorUnreachableFromEntry) { + const std::string text = R"( + OpCapability Addresses + OpCapability Addresses + OpCapability Kernel + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "main" + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %4 = OpTypeBool + %5 = OpTypeInt 32 0 + %6 = OpConstantFalse %4 + %7 = OpConstantTrue %4 + %1 = OpFunction %2 None %3 + %8 = OpLabel + OpBranch %9 + %9 = OpLabel + OpReturn + %10 = OpLabel + OpBranch %9 + OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_0, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* fn = spvtest::GetFunction(module, 1); + + const ir::BasicBlock* entry = spvtest::GetBasicBlock(fn, 8); + EXPECT_EQ(entry, fn->entry().get()) + << "The entry node is not the expected one"; + + // Check dominator tree + { + opt::DominatorAnalysis dom_tree; + ir::CFG cfg(module); + dom_tree.InitializeTree(fn, cfg); + // Inspect the actual tree + opt::DominatorTree& tree = dom_tree.GetDomTree(); + EXPECT_EQ(tree.GetRoot()->bb_, cfg.pseudo_entry_block()); + EXPECT_TRUE( + dom_tree.Dominates(cfg.pseudo_entry_block()->id(), entry->id())); + + // (strict) dominance checks + for (uint32_t id : {8, 9}) check_dominance(dom_tree, fn, id, id); + + check_dominance(dom_tree, fn, 8, 9); + + check_no_dominance(dom_tree, fn, 10, 8); + check_no_dominance(dom_tree, fn, 10, 9); + + EXPECT_EQ(dom_tree.ImmediateDominator(cfg.pseudo_entry_block()), nullptr); + EXPECT_EQ(dom_tree.ImmediateDominator(entry), cfg.pseudo_entry_block()); + + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 9)), + spvtest::GetBasicBlock(fn, 8)); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 10)), + nullptr); + } + + // Check post dominator tree + { + opt::PostDominatorAnalysis dom_tree; + ir::CFG cfg(module); + dom_tree.InitializeTree(fn, cfg); + + // Inspect the actual tree + opt::DominatorTree& tree = dom_tree.GetDomTree(); + EXPECT_EQ(tree.GetRoot()->bb_, cfg.pseudo_exit_block()); + EXPECT_TRUE(dom_tree.Dominates(cfg.pseudo_exit_block()->id(), 9)); + + // (strict) dominance checks + for (uint32_t id : {8, 9, 10}) check_dominance(dom_tree, fn, id, id); + + check_dominance(dom_tree, fn, 9, 8); + check_dominance(dom_tree, fn, 9, 10); + + EXPECT_EQ(dom_tree.ImmediateDominator(entry), + spvtest::GetBasicBlock(fn, 9)); + + EXPECT_EQ(dom_tree.ImmediateDominator(cfg.pseudo_exit_block()), nullptr); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 9)), + cfg.pseudo_exit_block()); + EXPECT_EQ(dom_tree.ImmediateDominator(spvtest::GetBasicBlock(fn, 10)), + spvtest::GetBasicBlock(fn, 9)); + } +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/nested_ifs.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/nested_ifs.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/nested_ifs.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/nested_ifs.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,152 @@ +// Copyright (c) 2017 Google 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. + +#include + +#include +#include +#include + +#include "../assembly_builder.h" +#include "../function_utils.h" +#include "../pass_fixture.h" +#include "../pass_utils.h" +#include "opt/dominator_analysis.h" +#include "opt/pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +/* + Generated from the following GLSL +#version 330 core +layout(location = 0) out vec4 v; +void main(){ + if (true) { + if (true) { + v = vec4(1,1,1,1); + } else { + v = vec4(2,2,2,2); + } + } else { + if (true) { + v = vec4(3,3,3,3); + } else { + v = vec4(4,4,4,4); + } + } +} +*/ +TEST_F(PassClassTest, UnreachableNestedIfs) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" %15 + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 330 + OpName %4 "main" + OpName %15 "v" + OpDecorate %15 Location 0 + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeBool + %7 = OpConstantTrue %6 + %12 = OpTypeFloat 32 + %13 = OpTypeVector %12 4 + %14 = OpTypePointer Output %13 + %15 = OpVariable %14 Output + %16 = OpConstant %12 1 + %17 = OpConstantComposite %13 %16 %16 %16 %16 + %19 = OpConstant %12 2 + %20 = OpConstantComposite %13 %19 %19 %19 %19 + %24 = OpConstant %12 3 + %25 = OpConstantComposite %13 %24 %24 %24 %24 + %27 = OpConstant %12 4 + %28 = OpConstantComposite %13 %27 %27 %27 %27 + %4 = OpFunction %2 None %3 + %5 = OpLabel + OpSelectionMerge %9 None + OpBranchConditional %7 %8 %21 + %8 = OpLabel + OpSelectionMerge %11 None + OpBranchConditional %7 %10 %18 + %10 = OpLabel + OpStore %15 %17 + OpBranch %11 + %18 = OpLabel + OpStore %15 %20 + OpBranch %11 + %11 = OpLabel + OpBranch %9 + %21 = OpLabel + OpSelectionMerge %23 None + OpBranchConditional %7 %22 %26 + %22 = OpLabel + OpStore %15 %25 + OpBranch %23 + %26 = OpLabel + OpStore %15 %28 + OpBranch %23 + %23 = OpLabel + OpBranch %9 + %9 = OpLabel + OpReturn + OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + const ir::Function* f = spvtest::GetFunction(module, 4); + + ir::CFG cfg(module); + opt::DominatorAnalysis* analysis = context->GetDominatorAnalysis(f, cfg); + + EXPECT_TRUE(analysis->Dominates(5, 8)); + EXPECT_TRUE(analysis->Dominates(5, 9)); + EXPECT_TRUE(analysis->Dominates(5, 21)); + EXPECT_TRUE(analysis->Dominates(5, 18)); + EXPECT_TRUE(analysis->Dominates(5, 10)); + EXPECT_TRUE(analysis->Dominates(5, 11)); + EXPECT_TRUE(analysis->Dominates(5, 23)); + EXPECT_TRUE(analysis->Dominates(5, 22)); + EXPECT_TRUE(analysis->Dominates(5, 26)); + EXPECT_TRUE(analysis->Dominates(8, 18)); + EXPECT_TRUE(analysis->Dominates(8, 10)); + EXPECT_TRUE(analysis->Dominates(8, 11)); + EXPECT_TRUE(analysis->Dominates(21, 23)); + EXPECT_TRUE(analysis->Dominates(21, 22)); + EXPECT_TRUE(analysis->Dominates(21, 26)); + + EXPECT_TRUE(analysis->StrictlyDominates(5, 8)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 9)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 21)); + EXPECT_TRUE(analysis->StrictlyDominates(8, 18)); + EXPECT_TRUE(analysis->StrictlyDominates(8, 10)); + EXPECT_TRUE(analysis->StrictlyDominates(8, 11)); + EXPECT_TRUE(analysis->StrictlyDominates(21, 23)); + EXPECT_TRUE(analysis->StrictlyDominates(21, 22)); + EXPECT_TRUE(analysis->StrictlyDominates(21, 26)); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/nested_ifs_post.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/nested_ifs_post.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/nested_ifs_post.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/nested_ifs_post.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,157 @@ +// Copyright (c) 2017 Google 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. + +#include + +#include +#include +#include + +#include "../assembly_builder.h" +#include "../function_utils.h" +#include "../pass_fixture.h" +#include "../pass_utils.h" +#include "opt/dominator_analysis.h" +#include "opt/pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +/* + Generated from the following GLSL +#version 330 core +layout(location = 0) out vec4 v; +void main(){ + if (true) { + if (true) { + v = vec4(1,1,1,1); + } else { + v = vec4(2,2,2,2); + } + } else { + if (true) { + v = vec4(3,3,3,3); + } else { + v = vec4(4,4,4,4); + } + } +} +*/ +TEST_F(PassClassTest, UnreachableNestedIfs) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" %15 + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 330 + OpName %4 "main" + OpName %15 "v" + OpDecorate %15 Location 0 + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeBool + %7 = OpConstantTrue %6 + %12 = OpTypeFloat 32 + %13 = OpTypeVector %12 4 + %14 = OpTypePointer Output %13 + %15 = OpVariable %14 Output + %16 = OpConstant %12 1 + %17 = OpConstantComposite %13 %16 %16 %16 %16 + %19 = OpConstant %12 2 + %20 = OpConstantComposite %13 %19 %19 %19 %19 + %24 = OpConstant %12 3 + %25 = OpConstantComposite %13 %24 %24 %24 %24 + %27 = OpConstant %12 4 + %28 = OpConstantComposite %13 %27 %27 %27 %27 + %4 = OpFunction %2 None %3 + %5 = OpLabel + OpSelectionMerge %9 None + OpBranchConditional %7 %8 %21 + %8 = OpLabel + OpSelectionMerge %11 None + OpBranchConditional %7 %10 %18 + %10 = OpLabel + OpStore %15 %17 + OpBranch %11 + %18 = OpLabel + OpStore %15 %20 + OpBranch %11 + %11 = OpLabel + OpBranch %9 + %21 = OpLabel + OpSelectionMerge %23 None + OpBranchConditional %7 %22 %26 + %22 = OpLabel + OpStore %15 %25 + OpBranch %23 + %26 = OpLabel + OpStore %15 %28 + OpBranch %23 + %23 = OpLabel + OpBranch %9 + %9 = OpLabel + OpReturn + OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + const ir::Function* f = spvtest::GetFunction(module, 4); + + ir::CFG cfg(module); + opt::PostDominatorAnalysis* analysis = + context->GetPostDominatorAnalysis(f, cfg); + + EXPECT_TRUE(analysis->Dominates(5, 5)); + EXPECT_TRUE(analysis->Dominates(8, 8)); + EXPECT_TRUE(analysis->Dominates(9, 9)); + EXPECT_TRUE(analysis->Dominates(10, 10)); + EXPECT_TRUE(analysis->Dominates(11, 11)); + EXPECT_TRUE(analysis->Dominates(18, 18)); + EXPECT_TRUE(analysis->Dominates(21, 21)); + EXPECT_TRUE(analysis->Dominates(22, 22)); + EXPECT_TRUE(analysis->Dominates(23, 23)); + EXPECT_TRUE(analysis->Dominates(26, 26)); + EXPECT_TRUE(analysis->Dominates(9, 5)); + EXPECT_TRUE(analysis->Dominates(9, 11)); + EXPECT_TRUE(analysis->Dominates(9, 23)); + EXPECT_TRUE(analysis->Dominates(11, 10)); + EXPECT_TRUE(analysis->Dominates(11, 18)); + EXPECT_TRUE(analysis->Dominates(11, 8)); + EXPECT_TRUE(analysis->Dominates(23, 22)); + EXPECT_TRUE(analysis->Dominates(23, 26)); + EXPECT_TRUE(analysis->Dominates(23, 21)); + + EXPECT_TRUE(analysis->StrictlyDominates(9, 5)); + EXPECT_TRUE(analysis->StrictlyDominates(9, 11)); + EXPECT_TRUE(analysis->StrictlyDominates(9, 23)); + EXPECT_TRUE(analysis->StrictlyDominates(11, 10)); + EXPECT_TRUE(analysis->StrictlyDominates(11, 18)); + EXPECT_TRUE(analysis->StrictlyDominates(11, 8)); + EXPECT_TRUE(analysis->StrictlyDominates(23, 22)); + EXPECT_TRUE(analysis->StrictlyDominates(23, 26)); + EXPECT_TRUE(analysis->StrictlyDominates(23, 21)); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/nested_loops.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/nested_loops.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/nested_loops.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/nested_loops.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,433 @@ +// Copyright (c) 2017 Google 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. + +#include + +#include +#include +#include + +#include "../assembly_builder.h" +#include "../function_utils.h" +#include "../pass_fixture.h" +#include "../pass_utils.h" +#include "opt/dominator_analysis.h" +#include "opt/pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +/* + Generated from the following GLSL +#version 440 core +layout(location = 0) out vec4 v; +layout(location = 1) in vec4 in_val; +void main() { + for (int i = 0; i < in_val.x; ++i) { + for (int j = 0; j < in_val.y; j++) { + } + } + for (int i = 0; i < in_val.x; ++i) { + for (int j = 0; j < in_val.y; j++) { + } + if (in_val.z == in_val.w) { + break; + } + } + int i = 0; + while (i < in_val.x) { + ++i; + for (int j = 0; j < 1; j++) { + for (int k = 0; k < 1; k++) { + } + } + } + i = 0; + while (i < in_val.x) { + ++i; + if (in_val.z == in_val.w) { + continue; + } + for (int j = 0; j < 1; j++) { + for (int k = 0; k < 1; k++) { + } + if (in_val.z == in_val.w) { + break; + } + } + } + v = vec4(1,1,1,1); +} +*/ +TEST_F(PassClassTest, BasicVisitFromEntryPoint) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" %20 %163 + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 440 + OpName %4 "main" + OpName %8 "i" + OpName %20 "in_val" + OpName %28 "j" + OpName %45 "i" + OpName %56 "j" + OpName %81 "i" + OpName %94 "j" + OpName %102 "k" + OpName %134 "j" + OpName %142 "k" + OpName %163 "v" + OpDecorate %20 Location 1 + OpDecorate %163 Location 0 + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeInt 32 1 + %7 = OpTypePointer Function %6 + %9 = OpConstant %6 0 + %16 = OpTypeFloat 32 + %18 = OpTypeVector %16 4 + %19 = OpTypePointer Input %18 + %20 = OpVariable %19 Input + %21 = OpTypeInt 32 0 + %22 = OpConstant %21 0 + %23 = OpTypePointer Input %16 + %26 = OpTypeBool + %36 = OpConstant %21 1 + %41 = OpConstant %6 1 + %69 = OpConstant %21 2 + %72 = OpConstant %21 3 + %162 = OpTypePointer Output %18 + %163 = OpVariable %162 Output + %164 = OpConstant %16 1 + %165 = OpConstantComposite %18 %164 %164 %164 %164 + %4 = OpFunction %2 None %3 + %5 = OpLabel + %8 = OpVariable %7 Function + %28 = OpVariable %7 Function + %45 = OpVariable %7 Function + %56 = OpVariable %7 Function + %81 = OpVariable %7 Function + %94 = OpVariable %7 Function + %102 = OpVariable %7 Function + %134 = OpVariable %7 Function + %142 = OpVariable %7 Function + OpStore %8 %9 + OpBranch %10 + %10 = OpLabel + OpLoopMerge %12 %13 None + OpBranch %14 + %14 = OpLabel + %15 = OpLoad %6 %8 + %17 = OpConvertSToF %16 %15 + %24 = OpAccessChain %23 %20 %22 + %25 = OpLoad %16 %24 + %27 = OpFOrdLessThan %26 %17 %25 + OpBranchConditional %27 %11 %12 + %11 = OpLabel + OpStore %28 %9 + OpBranch %29 + %29 = OpLabel + OpLoopMerge %31 %32 None + OpBranch %33 + %33 = OpLabel + %34 = OpLoad %6 %28 + %35 = OpConvertSToF %16 %34 + %37 = OpAccessChain %23 %20 %36 + %38 = OpLoad %16 %37 + %39 = OpFOrdLessThan %26 %35 %38 + OpBranchConditional %39 %30 %31 + %30 = OpLabel + OpBranch %32 + %32 = OpLabel + %40 = OpLoad %6 %28 + %42 = OpIAdd %6 %40 %41 + OpStore %28 %42 + OpBranch %29 + %31 = OpLabel + OpBranch %13 + %13 = OpLabel + %43 = OpLoad %6 %8 + %44 = OpIAdd %6 %43 %41 + OpStore %8 %44 + OpBranch %10 + %12 = OpLabel + OpStore %45 %9 + OpBranch %46 + %46 = OpLabel + OpLoopMerge %48 %49 None + OpBranch %50 + %50 = OpLabel + %51 = OpLoad %6 %45 + %52 = OpConvertSToF %16 %51 + %53 = OpAccessChain %23 %20 %22 + %54 = OpLoad %16 %53 + %55 = OpFOrdLessThan %26 %52 %54 + OpBranchConditional %55 %47 %48 + %47 = OpLabel + OpStore %56 %9 + OpBranch %57 + %57 = OpLabel + OpLoopMerge %59 %60 None + OpBranch %61 + %61 = OpLabel + %62 = OpLoad %6 %56 + %63 = OpConvertSToF %16 %62 + %64 = OpAccessChain %23 %20 %36 + %65 = OpLoad %16 %64 + %66 = OpFOrdLessThan %26 %63 %65 + OpBranchConditional %66 %58 %59 + %58 = OpLabel + OpBranch %60 + %60 = OpLabel + %67 = OpLoad %6 %56 + %68 = OpIAdd %6 %67 %41 + OpStore %56 %68 + OpBranch %57 + %59 = OpLabel + %70 = OpAccessChain %23 %20 %69 + %71 = OpLoad %16 %70 + %73 = OpAccessChain %23 %20 %72 + %74 = OpLoad %16 %73 + %75 = OpFOrdEqual %26 %71 %74 + OpSelectionMerge %77 None + OpBranchConditional %75 %76 %77 + %76 = OpLabel + OpBranch %48 + %77 = OpLabel + OpBranch %49 + %49 = OpLabel + %79 = OpLoad %6 %45 + %80 = OpIAdd %6 %79 %41 + OpStore %45 %80 + OpBranch %46 + %48 = OpLabel + OpStore %81 %9 + OpBranch %82 + %82 = OpLabel + OpLoopMerge %84 %85 None + OpBranch %86 + %86 = OpLabel + %87 = OpLoad %6 %81 + %88 = OpConvertSToF %16 %87 + %89 = OpAccessChain %23 %20 %22 + %90 = OpLoad %16 %89 + %91 = OpFOrdLessThan %26 %88 %90 + OpBranchConditional %91 %83 %84 + %83 = OpLabel + %92 = OpLoad %6 %81 + %93 = OpIAdd %6 %92 %41 + OpStore %81 %93 + OpStore %94 %9 + OpBranch %95 + %95 = OpLabel + OpLoopMerge %97 %98 None + OpBranch %99 + %99 = OpLabel + %100 = OpLoad %6 %94 + %101 = OpSLessThan %26 %100 %41 + OpBranchConditional %101 %96 %97 + %96 = OpLabel + OpStore %102 %9 + OpBranch %103 + %103 = OpLabel + OpLoopMerge %105 %106 None + OpBranch %107 + %107 = OpLabel + %108 = OpLoad %6 %102 + %109 = OpSLessThan %26 %108 %41 + OpBranchConditional %109 %104 %105 + %104 = OpLabel + OpBranch %106 + %106 = OpLabel + %110 = OpLoad %6 %102 + %111 = OpIAdd %6 %110 %41 + OpStore %102 %111 + OpBranch %103 + %105 = OpLabel + OpBranch %98 + %98 = OpLabel + %112 = OpLoad %6 %94 + %113 = OpIAdd %6 %112 %41 + OpStore %94 %113 + OpBranch %95 + %97 = OpLabel + OpBranch %85 + %85 = OpLabel + OpBranch %82 + %84 = OpLabel + OpStore %81 %9 + OpBranch %114 + %114 = OpLabel + OpLoopMerge %116 %117 None + OpBranch %118 + %118 = OpLabel + %119 = OpLoad %6 %81 + %120 = OpConvertSToF %16 %119 + %121 = OpAccessChain %23 %20 %22 + %122 = OpLoad %16 %121 + %123 = OpFOrdLessThan %26 %120 %122 + OpBranchConditional %123 %115 %116 + %115 = OpLabel + %124 = OpLoad %6 %81 + %125 = OpIAdd %6 %124 %41 + OpStore %81 %125 + %126 = OpAccessChain %23 %20 %69 + %127 = OpLoad %16 %126 + %128 = OpAccessChain %23 %20 %72 + %129 = OpLoad %16 %128 + %130 = OpFOrdEqual %26 %127 %129 + OpSelectionMerge %132 None + OpBranchConditional %130 %131 %132 + %131 = OpLabel + OpBranch %117 + %132 = OpLabel + OpStore %134 %9 + OpBranch %135 + %135 = OpLabel + OpLoopMerge %137 %138 None + OpBranch %139 + %139 = OpLabel + %140 = OpLoad %6 %134 + %141 = OpSLessThan %26 %140 %41 + OpBranchConditional %141 %136 %137 + %136 = OpLabel + OpStore %142 %9 + OpBranch %143 + %143 = OpLabel + OpLoopMerge %145 %146 None + OpBranch %147 + %147 = OpLabel + %148 = OpLoad %6 %142 + %149 = OpSLessThan %26 %148 %41 + OpBranchConditional %149 %144 %145 + %144 = OpLabel + OpBranch %146 + %146 = OpLabel + %150 = OpLoad %6 %142 + %151 = OpIAdd %6 %150 %41 + OpStore %142 %151 + OpBranch %143 + %145 = OpLabel + %152 = OpAccessChain %23 %20 %69 + %153 = OpLoad %16 %152 + %154 = OpAccessChain %23 %20 %72 + %155 = OpLoad %16 %154 + %156 = OpFOrdEqual %26 %153 %155 + OpSelectionMerge %158 None + OpBranchConditional %156 %157 %158 + %157 = OpLabel + OpBranch %137 + %158 = OpLabel + OpBranch %138 + %138 = OpLabel + %160 = OpLoad %6 %134 + %161 = OpIAdd %6 %160 %41 + OpStore %134 %161 + OpBranch %135 + %137 = OpLabel + OpBranch %117 + %117 = OpLabel + OpBranch %114 + %116 = OpLabel + OpStore %163 %165 + OpReturn + OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + const ir::Function* f = spvtest::GetFunction(module, 4); + ir::CFG cfg(module); + opt::DominatorAnalysis* analysis = context->GetDominatorAnalysis(f, cfg); + + EXPECT_TRUE(analysis->Dominates(5, 10)); + EXPECT_TRUE(analysis->Dominates(5, 46)); + EXPECT_TRUE(analysis->Dominates(5, 82)); + EXPECT_TRUE(analysis->Dominates(5, 114)); + EXPECT_TRUE(analysis->Dominates(5, 116)); + + EXPECT_TRUE(analysis->Dominates(10, 14)); + EXPECT_TRUE(analysis->Dominates(10, 11)); + EXPECT_TRUE(analysis->Dominates(10, 29)); + EXPECT_TRUE(analysis->Dominates(10, 33)); + EXPECT_TRUE(analysis->Dominates(10, 30)); + EXPECT_TRUE(analysis->Dominates(10, 32)); + EXPECT_TRUE(analysis->Dominates(10, 31)); + EXPECT_TRUE(analysis->Dominates(10, 13)); + EXPECT_TRUE(analysis->Dominates(10, 12)); + + EXPECT_TRUE(analysis->Dominates(12, 46)); + + EXPECT_TRUE(analysis->Dominates(46, 50)); + EXPECT_TRUE(analysis->Dominates(46, 47)); + EXPECT_TRUE(analysis->Dominates(46, 57)); + EXPECT_TRUE(analysis->Dominates(46, 61)); + EXPECT_TRUE(analysis->Dominates(46, 58)); + EXPECT_TRUE(analysis->Dominates(46, 60)); + EXPECT_TRUE(analysis->Dominates(46, 59)); + EXPECT_TRUE(analysis->Dominates(46, 77)); + EXPECT_TRUE(analysis->Dominates(46, 49)); + EXPECT_TRUE(analysis->Dominates(46, 76)); + EXPECT_TRUE(analysis->Dominates(46, 48)); + + EXPECT_TRUE(analysis->Dominates(48, 82)); + + EXPECT_TRUE(analysis->Dominates(82, 86)); + EXPECT_TRUE(analysis->Dominates(82, 83)); + EXPECT_TRUE(analysis->Dominates(82, 95)); + EXPECT_TRUE(analysis->Dominates(82, 99)); + EXPECT_TRUE(analysis->Dominates(82, 96)); + EXPECT_TRUE(analysis->Dominates(82, 103)); + EXPECT_TRUE(analysis->Dominates(82, 107)); + EXPECT_TRUE(analysis->Dominates(82, 104)); + EXPECT_TRUE(analysis->Dominates(82, 106)); + EXPECT_TRUE(analysis->Dominates(82, 105)); + EXPECT_TRUE(analysis->Dominates(82, 98)); + EXPECT_TRUE(analysis->Dominates(82, 97)); + EXPECT_TRUE(analysis->Dominates(82, 85)); + EXPECT_TRUE(analysis->Dominates(82, 84)); + + EXPECT_TRUE(analysis->Dominates(84, 114)); + + EXPECT_TRUE(analysis->Dominates(114, 118)); + EXPECT_TRUE(analysis->Dominates(114, 116)); + EXPECT_TRUE(analysis->Dominates(114, 115)); + EXPECT_TRUE(analysis->Dominates(114, 132)); + EXPECT_TRUE(analysis->Dominates(114, 135)); + EXPECT_TRUE(analysis->Dominates(114, 139)); + EXPECT_TRUE(analysis->Dominates(114, 136)); + EXPECT_TRUE(analysis->Dominates(114, 143)); + EXPECT_TRUE(analysis->Dominates(114, 147)); + EXPECT_TRUE(analysis->Dominates(114, 144)); + EXPECT_TRUE(analysis->Dominates(114, 146)); + EXPECT_TRUE(analysis->Dominates(114, 145)); + EXPECT_TRUE(analysis->Dominates(114, 158)); + EXPECT_TRUE(analysis->Dominates(114, 138)); + EXPECT_TRUE(analysis->Dominates(114, 137)); + EXPECT_TRUE(analysis->Dominates(114, 131)); + EXPECT_TRUE(analysis->Dominates(114, 117)); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/nested_loops_with_unreachables.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/nested_loops_with_unreachables.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/nested_loops_with_unreachables.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/nested_loops_with_unreachables.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,846 @@ +// Copyright (c) 2017 Google 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. + +#include +#include + +#include + +#include "../assembly_builder.h" +#include "../function_utils.h" +#include "../pass_fixture.h" +#include "../pass_utils.h" +#include "opt/dominator_analysis.h" +#include "opt/pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +/* +Generated from the following GLSL +#version 440 core +layout(location = 0) out vec4 v; +layout(location = 1) in vec4 in_val; +void main() { + for (int i = 0; i < in_val.x; ++i) { + for (int j = 0; j < in_val.y; j++) { + } + } + for (int i = 0; i < in_val.x; ++i) { + for (int j = 0; j < in_val.y; j++) { + } + break; + } + int i = 0; + while (i < in_val.x) { + ++i; + for (int j = 0; j < 1; j++) { + for (int k = 0; k < 1; k++) { + } + break; + } + } + i = 0; + while (i < in_val.x) { + ++i; + continue; + for (int j = 0; j < 1; j++) { + for (int k = 0; k < 1; k++) { + } + break; + } + } + v = vec4(1,1,1,1); +} +*/ +TEST_F(PassClassTest, BasicVisitFromEntryPoint) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" %20 %141 + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 440 + OpName %4 "main" + OpName %8 "i" + OpName %20 "in_val" + OpName %28 "j" + OpName %45 "i" + OpName %56 "j" + OpName %72 "i" + OpName %85 "j" + OpName %93 "k" + OpName %119 "j" + OpName %127 "k" + OpName %141 "v" + OpDecorate %20 Location 1 + OpDecorate %141 Location 0 + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeInt 32 1 + %7 = OpTypePointer Function %6 + %9 = OpConstant %6 0 + %16 = OpTypeFloat 32 + %18 = OpTypeVector %16 4 + %19 = OpTypePointer Input %18 + %20 = OpVariable %19 Input + %21 = OpTypeInt 32 0 + %22 = OpConstant %21 0 + %23 = OpTypePointer Input %16 + %26 = OpTypeBool + %36 = OpConstant %21 1 + %41 = OpConstant %6 1 + %140 = OpTypePointer Output %18 + %141 = OpVariable %140 Output + %142 = OpConstant %16 1 + %143 = OpConstantComposite %18 %142 %142 %142 %142 + %4 = OpFunction %2 None %3 + %5 = OpLabel + %8 = OpVariable %7 Function + %28 = OpVariable %7 Function + %45 = OpVariable %7 Function + %56 = OpVariable %7 Function + %72 = OpVariable %7 Function + %85 = OpVariable %7 Function + %93 = OpVariable %7 Function + %119 = OpVariable %7 Function + %127 = OpVariable %7 Function + OpStore %8 %9 + OpBranch %10 + %10 = OpLabel + OpLoopMerge %12 %13 None + OpBranch %14 + %14 = OpLabel + %15 = OpLoad %6 %8 + %17 = OpConvertSToF %16 %15 + %24 = OpAccessChain %23 %20 %22 + %25 = OpLoad %16 %24 + %27 = OpFOrdLessThan %26 %17 %25 + OpBranchConditional %27 %11 %12 + %11 = OpLabel + OpStore %28 %9 + OpBranch %29 + %29 = OpLabel + OpLoopMerge %31 %32 None + OpBranch %33 + %33 = OpLabel + %34 = OpLoad %6 %28 + %35 = OpConvertSToF %16 %34 + %37 = OpAccessChain %23 %20 %36 + %38 = OpLoad %16 %37 + %39 = OpFOrdLessThan %26 %35 %38 + OpBranchConditional %39 %30 %31 + %30 = OpLabel + OpBranch %32 + %32 = OpLabel + %40 = OpLoad %6 %28 + %42 = OpIAdd %6 %40 %41 + OpStore %28 %42 + OpBranch %29 + %31 = OpLabel + OpBranch %13 + %13 = OpLabel + %43 = OpLoad %6 %8 + %44 = OpIAdd %6 %43 %41 + OpStore %8 %44 + OpBranch %10 + %12 = OpLabel + OpStore %45 %9 + OpBranch %46 + %46 = OpLabel + OpLoopMerge %48 %49 None + OpBranch %50 + %50 = OpLabel + %51 = OpLoad %6 %45 + %52 = OpConvertSToF %16 %51 + %53 = OpAccessChain %23 %20 %22 + %54 = OpLoad %16 %53 + %55 = OpFOrdLessThan %26 %52 %54 + OpBranchConditional %55 %47 %48 + %47 = OpLabel + OpStore %56 %9 + OpBranch %57 + %57 = OpLabel + OpLoopMerge %59 %60 None + OpBranch %61 + %61 = OpLabel + %62 = OpLoad %6 %56 + %63 = OpConvertSToF %16 %62 + %64 = OpAccessChain %23 %20 %36 + %65 = OpLoad %16 %64 + %66 = OpFOrdLessThan %26 %63 %65 + OpBranchConditional %66 %58 %59 + %58 = OpLabel + OpBranch %60 + %60 = OpLabel + %67 = OpLoad %6 %56 + %68 = OpIAdd %6 %67 %41 + OpStore %56 %68 + OpBranch %57 + %59 = OpLabel + OpBranch %48 + %49 = OpLabel + %70 = OpLoad %6 %45 + %71 = OpIAdd %6 %70 %41 + OpStore %45 %71 + OpBranch %46 + %48 = OpLabel + OpStore %72 %9 + OpBranch %73 + %73 = OpLabel + OpLoopMerge %75 %76 None + OpBranch %77 + %77 = OpLabel + %78 = OpLoad %6 %72 + %79 = OpConvertSToF %16 %78 + %80 = OpAccessChain %23 %20 %22 + %81 = OpLoad %16 %80 + %82 = OpFOrdLessThan %26 %79 %81 + OpBranchConditional %82 %74 %75 + %74 = OpLabel + %83 = OpLoad %6 %72 + %84 = OpIAdd %6 %83 %41 + OpStore %72 %84 + OpStore %85 %9 + OpBranch %86 + %86 = OpLabel + OpLoopMerge %88 %89 None + OpBranch %90 + %90 = OpLabel + %91 = OpLoad %6 %85 + %92 = OpSLessThan %26 %91 %41 + OpBranchConditional %92 %87 %88 + %87 = OpLabel + OpStore %93 %9 + OpBranch %94 + %94 = OpLabel + OpLoopMerge %96 %97 None + OpBranch %98 + %98 = OpLabel + %99 = OpLoad %6 %93 + %100 = OpSLessThan %26 %99 %41 + OpBranchConditional %100 %95 %96 + %95 = OpLabel + OpBranch %97 + %97 = OpLabel + %101 = OpLoad %6 %93 + %102 = OpIAdd %6 %101 %41 + OpStore %93 %102 + OpBranch %94 + %96 = OpLabel + OpBranch %88 + %89 = OpLabel + %104 = OpLoad %6 %85 + %105 = OpIAdd %6 %104 %41 + OpStore %85 %105 + OpBranch %86 + %88 = OpLabel + OpBranch %76 + %76 = OpLabel + OpBranch %73 + %75 = OpLabel + OpStore %72 %9 + OpBranch %106 + %106 = OpLabel + OpLoopMerge %108 %109 None + OpBranch %110 + %110 = OpLabel + %111 = OpLoad %6 %72 + %112 = OpConvertSToF %16 %111 + %113 = OpAccessChain %23 %20 %22 + %114 = OpLoad %16 %113 + %115 = OpFOrdLessThan %26 %112 %114 + OpBranchConditional %115 %107 %108 + %107 = OpLabel + %116 = OpLoad %6 %72 + %117 = OpIAdd %6 %116 %41 + OpStore %72 %117 + OpBranch %109 + %109 = OpLabel + OpBranch %106 + %108 = OpLabel + OpStore %141 %143 + OpReturn + OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + const ir::Function* f = spvtest::GetFunction(module, 4); + ir::CFG cfg(module); + opt::DominatorAnalysis* analysis = context->GetDominatorAnalysis(f, cfg); + + EXPECT_TRUE(analysis->Dominates(5, 10)); + EXPECT_TRUE(analysis->Dominates(5, 14)); + EXPECT_TRUE(analysis->Dominates(5, 11)); + EXPECT_TRUE(analysis->Dominates(5, 29)); + EXPECT_TRUE(analysis->Dominates(5, 33)); + EXPECT_TRUE(analysis->Dominates(5, 30)); + EXPECT_TRUE(analysis->Dominates(5, 32)); + EXPECT_TRUE(analysis->Dominates(5, 31)); + EXPECT_TRUE(analysis->Dominates(5, 13)); + EXPECT_TRUE(analysis->Dominates(5, 12)); + EXPECT_TRUE(analysis->Dominates(5, 46)); + EXPECT_TRUE(analysis->Dominates(5, 50)); + EXPECT_TRUE(analysis->Dominates(5, 47)); + EXPECT_TRUE(analysis->Dominates(5, 57)); + EXPECT_TRUE(analysis->Dominates(5, 61)); + EXPECT_TRUE(analysis->Dominates(5, 59)); + EXPECT_TRUE(analysis->Dominates(5, 58)); + EXPECT_TRUE(analysis->Dominates(5, 60)); + EXPECT_TRUE(analysis->Dominates(5, 48)); + EXPECT_TRUE(analysis->Dominates(5, 73)); + EXPECT_TRUE(analysis->Dominates(5, 77)); + EXPECT_TRUE(analysis->Dominates(5, 75)); + EXPECT_TRUE(analysis->Dominates(5, 106)); + EXPECT_TRUE(analysis->Dominates(5, 110)); + EXPECT_TRUE(analysis->Dominates(5, 107)); + EXPECT_TRUE(analysis->Dominates(5, 108)); + EXPECT_TRUE(analysis->Dominates(5, 109)); + EXPECT_TRUE(analysis->Dominates(5, 74)); + EXPECT_TRUE(analysis->Dominates(5, 86)); + EXPECT_TRUE(analysis->Dominates(5, 90)); + EXPECT_TRUE(analysis->Dominates(5, 87)); + EXPECT_TRUE(analysis->Dominates(5, 94)); + EXPECT_TRUE(analysis->Dominates(5, 98)); + EXPECT_TRUE(analysis->Dominates(5, 95)); + EXPECT_TRUE(analysis->Dominates(5, 97)); + EXPECT_TRUE(analysis->Dominates(5, 96)); + EXPECT_TRUE(analysis->Dominates(5, 88)); + EXPECT_TRUE(analysis->Dominates(5, 76)); + + EXPECT_TRUE(analysis->Dominates(10, 14)); + EXPECT_TRUE(analysis->Dominates(10, 11)); + EXPECT_TRUE(analysis->Dominates(10, 29)); + EXPECT_TRUE(analysis->Dominates(10, 33)); + EXPECT_TRUE(analysis->Dominates(10, 30)); + EXPECT_TRUE(analysis->Dominates(10, 32)); + EXPECT_TRUE(analysis->Dominates(10, 31)); + EXPECT_TRUE(analysis->Dominates(10, 13)); + EXPECT_TRUE(analysis->Dominates(10, 12)); + EXPECT_TRUE(analysis->Dominates(10, 46)); + EXPECT_TRUE(analysis->Dominates(10, 50)); + EXPECT_TRUE(analysis->Dominates(10, 47)); + EXPECT_TRUE(analysis->Dominates(10, 57)); + EXPECT_TRUE(analysis->Dominates(10, 61)); + EXPECT_TRUE(analysis->Dominates(10, 59)); + EXPECT_TRUE(analysis->Dominates(10, 58)); + EXPECT_TRUE(analysis->Dominates(10, 60)); + EXPECT_TRUE(analysis->Dominates(10, 48)); + EXPECT_TRUE(analysis->Dominates(10, 73)); + EXPECT_TRUE(analysis->Dominates(10, 77)); + EXPECT_TRUE(analysis->Dominates(10, 75)); + EXPECT_TRUE(analysis->Dominates(10, 106)); + EXPECT_TRUE(analysis->Dominates(10, 110)); + EXPECT_TRUE(analysis->Dominates(10, 107)); + EXPECT_TRUE(analysis->Dominates(10, 108)); + EXPECT_TRUE(analysis->Dominates(10, 109)); + EXPECT_TRUE(analysis->Dominates(10, 74)); + EXPECT_TRUE(analysis->Dominates(10, 86)); + EXPECT_TRUE(analysis->Dominates(10, 90)); + EXPECT_TRUE(analysis->Dominates(10, 87)); + EXPECT_TRUE(analysis->Dominates(10, 94)); + EXPECT_TRUE(analysis->Dominates(10, 98)); + EXPECT_TRUE(analysis->Dominates(10, 95)); + EXPECT_TRUE(analysis->Dominates(10, 97)); + EXPECT_TRUE(analysis->Dominates(10, 96)); + EXPECT_TRUE(analysis->Dominates(10, 88)); + EXPECT_TRUE(analysis->Dominates(10, 76)); + + EXPECT_TRUE(analysis->Dominates(14, 11)); + EXPECT_TRUE(analysis->Dominates(14, 29)); + EXPECT_TRUE(analysis->Dominates(14, 33)); + EXPECT_TRUE(analysis->Dominates(14, 30)); + EXPECT_TRUE(analysis->Dominates(14, 32)); + EXPECT_TRUE(analysis->Dominates(14, 31)); + + EXPECT_TRUE(analysis->Dominates(11, 29)); + EXPECT_TRUE(analysis->Dominates(11, 33)); + EXPECT_TRUE(analysis->Dominates(11, 30)); + EXPECT_TRUE(analysis->Dominates(11, 32)); + EXPECT_TRUE(analysis->Dominates(11, 31)); + + EXPECT_TRUE(analysis->Dominates(29, 33)); + EXPECT_TRUE(analysis->Dominates(29, 30)); + EXPECT_TRUE(analysis->Dominates(29, 32)); + EXPECT_TRUE(analysis->Dominates(29, 31)); + + EXPECT_TRUE(analysis->Dominates(33, 30)); + + EXPECT_TRUE(analysis->Dominates(12, 46)); + EXPECT_TRUE(analysis->Dominates(12, 50)); + EXPECT_TRUE(analysis->Dominates(12, 47)); + EXPECT_TRUE(analysis->Dominates(12, 57)); + EXPECT_TRUE(analysis->Dominates(12, 61)); + EXPECT_TRUE(analysis->Dominates(12, 59)); + EXPECT_TRUE(analysis->Dominates(12, 58)); + EXPECT_TRUE(analysis->Dominates(12, 60)); + EXPECT_TRUE(analysis->Dominates(12, 48)); + EXPECT_TRUE(analysis->Dominates(12, 73)); + EXPECT_TRUE(analysis->Dominates(12, 77)); + EXPECT_TRUE(analysis->Dominates(12, 75)); + EXPECT_TRUE(analysis->Dominates(12, 106)); + EXPECT_TRUE(analysis->Dominates(12, 110)); + EXPECT_TRUE(analysis->Dominates(12, 107)); + EXPECT_TRUE(analysis->Dominates(12, 108)); + EXPECT_TRUE(analysis->Dominates(12, 109)); + EXPECT_TRUE(analysis->Dominates(12, 74)); + EXPECT_TRUE(analysis->Dominates(12, 86)); + EXPECT_TRUE(analysis->Dominates(12, 90)); + EXPECT_TRUE(analysis->Dominates(12, 87)); + EXPECT_TRUE(analysis->Dominates(12, 94)); + EXPECT_TRUE(analysis->Dominates(12, 98)); + EXPECT_TRUE(analysis->Dominates(12, 95)); + EXPECT_TRUE(analysis->Dominates(12, 97)); + EXPECT_TRUE(analysis->Dominates(12, 96)); + EXPECT_TRUE(analysis->Dominates(12, 88)); + EXPECT_TRUE(analysis->Dominates(12, 76)); + + EXPECT_TRUE(analysis->Dominates(46, 50)); + EXPECT_TRUE(analysis->Dominates(46, 47)); + EXPECT_TRUE(analysis->Dominates(46, 57)); + EXPECT_TRUE(analysis->Dominates(46, 61)); + EXPECT_TRUE(analysis->Dominates(46, 59)); + EXPECT_TRUE(analysis->Dominates(46, 58)); + EXPECT_TRUE(analysis->Dominates(46, 60)); + EXPECT_TRUE(analysis->Dominates(46, 48)); + EXPECT_TRUE(analysis->Dominates(46, 73)); + EXPECT_TRUE(analysis->Dominates(46, 77)); + EXPECT_TRUE(analysis->Dominates(46, 75)); + EXPECT_TRUE(analysis->Dominates(46, 106)); + EXPECT_TRUE(analysis->Dominates(46, 110)); + EXPECT_TRUE(analysis->Dominates(46, 107)); + EXPECT_TRUE(analysis->Dominates(46, 108)); + EXPECT_TRUE(analysis->Dominates(46, 109)); + EXPECT_TRUE(analysis->Dominates(46, 74)); + EXPECT_TRUE(analysis->Dominates(46, 86)); + EXPECT_TRUE(analysis->Dominates(46, 90)); + EXPECT_TRUE(analysis->Dominates(46, 87)); + EXPECT_TRUE(analysis->Dominates(46, 94)); + EXPECT_TRUE(analysis->Dominates(46, 98)); + EXPECT_TRUE(analysis->Dominates(46, 95)); + EXPECT_TRUE(analysis->Dominates(46, 97)); + EXPECT_TRUE(analysis->Dominates(46, 96)); + EXPECT_TRUE(analysis->Dominates(46, 88)); + EXPECT_TRUE(analysis->Dominates(46, 76)); + + EXPECT_TRUE(analysis->Dominates(50, 47)); + EXPECT_TRUE(analysis->Dominates(50, 57)); + EXPECT_TRUE(analysis->Dominates(50, 61)); + EXPECT_TRUE(analysis->Dominates(50, 59)); + EXPECT_TRUE(analysis->Dominates(50, 58)); + EXPECT_TRUE(analysis->Dominates(50, 60)); + + EXPECT_TRUE(analysis->Dominates(47, 57)); + EXPECT_TRUE(analysis->Dominates(47, 61)); + EXPECT_TRUE(analysis->Dominates(47, 59)); + EXPECT_TRUE(analysis->Dominates(47, 58)); + EXPECT_TRUE(analysis->Dominates(47, 60)); + + EXPECT_TRUE(analysis->Dominates(57, 61)); + EXPECT_TRUE(analysis->Dominates(57, 59)); + EXPECT_TRUE(analysis->Dominates(57, 58)); + EXPECT_TRUE(analysis->Dominates(57, 60)); + + EXPECT_TRUE(analysis->Dominates(61, 59)); + + EXPECT_TRUE(analysis->Dominates(48, 73)); + EXPECT_TRUE(analysis->Dominates(48, 77)); + EXPECT_TRUE(analysis->Dominates(48, 75)); + EXPECT_TRUE(analysis->Dominates(48, 106)); + EXPECT_TRUE(analysis->Dominates(48, 110)); + EXPECT_TRUE(analysis->Dominates(48, 107)); + EXPECT_TRUE(analysis->Dominates(48, 108)); + EXPECT_TRUE(analysis->Dominates(48, 109)); + EXPECT_TRUE(analysis->Dominates(48, 74)); + EXPECT_TRUE(analysis->Dominates(48, 86)); + EXPECT_TRUE(analysis->Dominates(48, 90)); + EXPECT_TRUE(analysis->Dominates(48, 87)); + EXPECT_TRUE(analysis->Dominates(48, 94)); + EXPECT_TRUE(analysis->Dominates(48, 98)); + EXPECT_TRUE(analysis->Dominates(48, 95)); + EXPECT_TRUE(analysis->Dominates(48, 97)); + EXPECT_TRUE(analysis->Dominates(48, 96)); + EXPECT_TRUE(analysis->Dominates(48, 88)); + EXPECT_TRUE(analysis->Dominates(48, 76)); + + EXPECT_TRUE(analysis->Dominates(73, 77)); + EXPECT_TRUE(analysis->Dominates(73, 75)); + EXPECT_TRUE(analysis->Dominates(73, 106)); + EXPECT_TRUE(analysis->Dominates(73, 110)); + EXPECT_TRUE(analysis->Dominates(73, 107)); + EXPECT_TRUE(analysis->Dominates(73, 108)); + EXPECT_TRUE(analysis->Dominates(73, 109)); + EXPECT_TRUE(analysis->Dominates(73, 74)); + EXPECT_TRUE(analysis->Dominates(73, 86)); + EXPECT_TRUE(analysis->Dominates(73, 90)); + EXPECT_TRUE(analysis->Dominates(73, 87)); + EXPECT_TRUE(analysis->Dominates(73, 94)); + EXPECT_TRUE(analysis->Dominates(73, 98)); + EXPECT_TRUE(analysis->Dominates(73, 95)); + EXPECT_TRUE(analysis->Dominates(73, 97)); + EXPECT_TRUE(analysis->Dominates(73, 96)); + EXPECT_TRUE(analysis->Dominates(73, 88)); + EXPECT_TRUE(analysis->Dominates(73, 76)); + + EXPECT_TRUE(analysis->Dominates(75, 106)); + EXPECT_TRUE(analysis->Dominates(75, 110)); + EXPECT_TRUE(analysis->Dominates(75, 107)); + EXPECT_TRUE(analysis->Dominates(75, 108)); + EXPECT_TRUE(analysis->Dominates(75, 109)); + + EXPECT_TRUE(analysis->Dominates(106, 110)); + EXPECT_TRUE(analysis->Dominates(106, 107)); + EXPECT_TRUE(analysis->Dominates(106, 108)); + EXPECT_TRUE(analysis->Dominates(106, 109)); + + EXPECT_TRUE(analysis->Dominates(110, 107)); + + EXPECT_TRUE(analysis->Dominates(77, 74)); + EXPECT_TRUE(analysis->Dominates(77, 86)); + EXPECT_TRUE(analysis->Dominates(77, 90)); + EXPECT_TRUE(analysis->Dominates(77, 87)); + EXPECT_TRUE(analysis->Dominates(77, 94)); + EXPECT_TRUE(analysis->Dominates(77, 98)); + EXPECT_TRUE(analysis->Dominates(77, 95)); + EXPECT_TRUE(analysis->Dominates(77, 97)); + EXPECT_TRUE(analysis->Dominates(77, 96)); + EXPECT_TRUE(analysis->Dominates(77, 88)); + + EXPECT_TRUE(analysis->Dominates(74, 86)); + EXPECT_TRUE(analysis->Dominates(74, 90)); + EXPECT_TRUE(analysis->Dominates(74, 87)); + EXPECT_TRUE(analysis->Dominates(74, 94)); + EXPECT_TRUE(analysis->Dominates(74, 98)); + EXPECT_TRUE(analysis->Dominates(74, 95)); + EXPECT_TRUE(analysis->Dominates(74, 97)); + EXPECT_TRUE(analysis->Dominates(74, 96)); + EXPECT_TRUE(analysis->Dominates(74, 88)); + + EXPECT_TRUE(analysis->Dominates(86, 90)); + EXPECT_TRUE(analysis->Dominates(86, 87)); + EXPECT_TRUE(analysis->Dominates(86, 94)); + EXPECT_TRUE(analysis->Dominates(86, 98)); + EXPECT_TRUE(analysis->Dominates(86, 95)); + EXPECT_TRUE(analysis->Dominates(86, 97)); + EXPECT_TRUE(analysis->Dominates(86, 96)); + EXPECT_TRUE(analysis->Dominates(86, 88)); + + EXPECT_TRUE(analysis->Dominates(90, 87)); + EXPECT_TRUE(analysis->Dominates(90, 94)); + EXPECT_TRUE(analysis->Dominates(90, 98)); + EXPECT_TRUE(analysis->Dominates(90, 95)); + EXPECT_TRUE(analysis->Dominates(90, 97)); + EXPECT_TRUE(analysis->Dominates(90, 96)); + + EXPECT_TRUE(analysis->Dominates(87, 94)); + EXPECT_TRUE(analysis->Dominates(87, 98)); + EXPECT_TRUE(analysis->Dominates(87, 95)); + EXPECT_TRUE(analysis->Dominates(87, 97)); + EXPECT_TRUE(analysis->Dominates(87, 96)); + + EXPECT_TRUE(analysis->Dominates(94, 98)); + EXPECT_TRUE(analysis->Dominates(94, 95)); + EXPECT_TRUE(analysis->Dominates(94, 97)); + EXPECT_TRUE(analysis->Dominates(94, 96)); + + EXPECT_TRUE(analysis->Dominates(98, 95)); + + EXPECT_TRUE(analysis->StrictlyDominates(5, 10)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 14)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 11)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 29)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 33)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 30)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 32)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 31)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 13)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 12)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 46)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 50)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 47)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 57)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 61)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 59)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 58)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 60)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 48)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 73)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 77)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 75)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 106)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 110)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 107)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 108)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 109)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 74)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 86)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 90)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 87)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 94)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 98)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 95)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 97)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 96)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 88)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 76)); + + EXPECT_TRUE(analysis->StrictlyDominates(10, 14)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 11)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 29)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 33)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 30)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 32)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 31)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 13)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 12)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 46)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 50)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 47)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 57)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 61)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 59)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 58)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 60)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 48)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 73)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 77)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 75)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 106)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 110)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 107)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 108)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 109)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 74)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 86)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 90)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 87)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 94)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 98)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 95)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 97)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 96)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 88)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 76)); + + EXPECT_TRUE(analysis->StrictlyDominates(14, 11)); + EXPECT_TRUE(analysis->StrictlyDominates(14, 29)); + EXPECT_TRUE(analysis->StrictlyDominates(14, 33)); + EXPECT_TRUE(analysis->StrictlyDominates(14, 30)); + EXPECT_TRUE(analysis->StrictlyDominates(14, 32)); + EXPECT_TRUE(analysis->StrictlyDominates(14, 31)); + + EXPECT_TRUE(analysis->StrictlyDominates(11, 29)); + EXPECT_TRUE(analysis->StrictlyDominates(11, 33)); + EXPECT_TRUE(analysis->StrictlyDominates(11, 30)); + EXPECT_TRUE(analysis->StrictlyDominates(11, 32)); + EXPECT_TRUE(analysis->StrictlyDominates(11, 31)); + + EXPECT_TRUE(analysis->StrictlyDominates(29, 33)); + EXPECT_TRUE(analysis->StrictlyDominates(29, 30)); + EXPECT_TRUE(analysis->StrictlyDominates(29, 32)); + EXPECT_TRUE(analysis->StrictlyDominates(29, 31)); + + EXPECT_TRUE(analysis->StrictlyDominates(33, 30)); + + EXPECT_TRUE(analysis->StrictlyDominates(12, 46)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 50)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 47)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 57)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 61)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 59)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 58)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 60)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 48)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 73)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 77)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 75)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 106)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 110)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 107)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 108)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 109)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 74)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 86)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 90)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 87)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 94)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 98)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 95)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 97)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 96)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 88)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 76)); + + EXPECT_TRUE(analysis->StrictlyDominates(46, 50)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 47)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 57)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 61)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 59)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 58)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 60)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 48)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 73)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 77)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 75)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 106)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 110)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 107)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 108)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 109)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 74)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 86)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 90)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 87)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 94)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 98)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 95)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 97)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 96)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 88)); + EXPECT_TRUE(analysis->StrictlyDominates(46, 76)); + + EXPECT_TRUE(analysis->StrictlyDominates(50, 47)); + EXPECT_TRUE(analysis->StrictlyDominates(50, 57)); + EXPECT_TRUE(analysis->StrictlyDominates(50, 61)); + EXPECT_TRUE(analysis->StrictlyDominates(50, 59)); + EXPECT_TRUE(analysis->StrictlyDominates(50, 58)); + EXPECT_TRUE(analysis->StrictlyDominates(50, 60)); + + EXPECT_TRUE(analysis->StrictlyDominates(47, 57)); + EXPECT_TRUE(analysis->StrictlyDominates(47, 61)); + EXPECT_TRUE(analysis->StrictlyDominates(47, 59)); + EXPECT_TRUE(analysis->StrictlyDominates(47, 58)); + EXPECT_TRUE(analysis->StrictlyDominates(47, 60)); + + EXPECT_TRUE(analysis->StrictlyDominates(57, 61)); + EXPECT_TRUE(analysis->StrictlyDominates(57, 59)); + EXPECT_TRUE(analysis->StrictlyDominates(57, 58)); + EXPECT_TRUE(analysis->StrictlyDominates(57, 60)); + + EXPECT_TRUE(analysis->StrictlyDominates(61, 59)); + + EXPECT_TRUE(analysis->StrictlyDominates(48, 73)); + EXPECT_TRUE(analysis->StrictlyDominates(48, 77)); + EXPECT_TRUE(analysis->StrictlyDominates(48, 75)); + EXPECT_TRUE(analysis->StrictlyDominates(48, 106)); + EXPECT_TRUE(analysis->StrictlyDominates(48, 110)); + EXPECT_TRUE(analysis->StrictlyDominates(48, 107)); + EXPECT_TRUE(analysis->StrictlyDominates(48, 108)); + EXPECT_TRUE(analysis->StrictlyDominates(48, 109)); + EXPECT_TRUE(analysis->StrictlyDominates(48, 74)); + EXPECT_TRUE(analysis->StrictlyDominates(48, 86)); + EXPECT_TRUE(analysis->StrictlyDominates(48, 90)); + EXPECT_TRUE(analysis->StrictlyDominates(48, 87)); + EXPECT_TRUE(analysis->StrictlyDominates(48, 94)); + EXPECT_TRUE(analysis->StrictlyDominates(48, 98)); + EXPECT_TRUE(analysis->StrictlyDominates(48, 95)); + EXPECT_TRUE(analysis->StrictlyDominates(48, 97)); + EXPECT_TRUE(analysis->StrictlyDominates(48, 96)); + EXPECT_TRUE(analysis->StrictlyDominates(48, 88)); + EXPECT_TRUE(analysis->StrictlyDominates(48, 76)); + + EXPECT_TRUE(analysis->StrictlyDominates(73, 77)); + EXPECT_TRUE(analysis->StrictlyDominates(73, 75)); + EXPECT_TRUE(analysis->StrictlyDominates(73, 106)); + EXPECT_TRUE(analysis->StrictlyDominates(73, 110)); + EXPECT_TRUE(analysis->StrictlyDominates(73, 107)); + EXPECT_TRUE(analysis->StrictlyDominates(73, 108)); + EXPECT_TRUE(analysis->StrictlyDominates(73, 109)); + EXPECT_TRUE(analysis->StrictlyDominates(73, 74)); + EXPECT_TRUE(analysis->StrictlyDominates(73, 86)); + EXPECT_TRUE(analysis->StrictlyDominates(73, 90)); + EXPECT_TRUE(analysis->StrictlyDominates(73, 87)); + EXPECT_TRUE(analysis->StrictlyDominates(73, 94)); + EXPECT_TRUE(analysis->StrictlyDominates(73, 98)); + EXPECT_TRUE(analysis->StrictlyDominates(73, 95)); + EXPECT_TRUE(analysis->StrictlyDominates(73, 97)); + EXPECT_TRUE(analysis->StrictlyDominates(73, 96)); + EXPECT_TRUE(analysis->StrictlyDominates(73, 88)); + EXPECT_TRUE(analysis->StrictlyDominates(73, 76)); + + EXPECT_TRUE(analysis->StrictlyDominates(75, 106)); + EXPECT_TRUE(analysis->StrictlyDominates(75, 110)); + EXPECT_TRUE(analysis->StrictlyDominates(75, 107)); + EXPECT_TRUE(analysis->StrictlyDominates(75, 108)); + EXPECT_TRUE(analysis->StrictlyDominates(75, 109)); + + EXPECT_TRUE(analysis->StrictlyDominates(106, 110)); + EXPECT_TRUE(analysis->StrictlyDominates(106, 107)); + EXPECT_TRUE(analysis->StrictlyDominates(106, 108)); + EXPECT_TRUE(analysis->StrictlyDominates(106, 109)); + + EXPECT_TRUE(analysis->StrictlyDominates(110, 107)); + + EXPECT_TRUE(analysis->StrictlyDominates(77, 74)); + EXPECT_TRUE(analysis->StrictlyDominates(77, 86)); + EXPECT_TRUE(analysis->StrictlyDominates(77, 90)); + EXPECT_TRUE(analysis->StrictlyDominates(77, 87)); + EXPECT_TRUE(analysis->StrictlyDominates(77, 94)); + EXPECT_TRUE(analysis->StrictlyDominates(77, 98)); + EXPECT_TRUE(analysis->StrictlyDominates(77, 95)); + EXPECT_TRUE(analysis->StrictlyDominates(77, 97)); + EXPECT_TRUE(analysis->StrictlyDominates(77, 96)); + EXPECT_TRUE(analysis->StrictlyDominates(77, 88)); + + EXPECT_TRUE(analysis->StrictlyDominates(74, 86)); + EXPECT_TRUE(analysis->StrictlyDominates(74, 90)); + EXPECT_TRUE(analysis->StrictlyDominates(74, 87)); + EXPECT_TRUE(analysis->StrictlyDominates(74, 94)); + EXPECT_TRUE(analysis->StrictlyDominates(74, 98)); + EXPECT_TRUE(analysis->StrictlyDominates(74, 95)); + EXPECT_TRUE(analysis->StrictlyDominates(74, 97)); + EXPECT_TRUE(analysis->StrictlyDominates(74, 96)); + EXPECT_TRUE(analysis->StrictlyDominates(74, 88)); + + EXPECT_TRUE(analysis->StrictlyDominates(86, 90)); + EXPECT_TRUE(analysis->StrictlyDominates(86, 87)); + EXPECT_TRUE(analysis->StrictlyDominates(86, 94)); + EXPECT_TRUE(analysis->StrictlyDominates(86, 98)); + EXPECT_TRUE(analysis->StrictlyDominates(86, 95)); + EXPECT_TRUE(analysis->StrictlyDominates(86, 97)); + EXPECT_TRUE(analysis->StrictlyDominates(86, 96)); + EXPECT_TRUE(analysis->StrictlyDominates(86, 88)); + + EXPECT_TRUE(analysis->StrictlyDominates(90, 87)); + EXPECT_TRUE(analysis->StrictlyDominates(90, 94)); + EXPECT_TRUE(analysis->StrictlyDominates(90, 98)); + EXPECT_TRUE(analysis->StrictlyDominates(90, 95)); + EXPECT_TRUE(analysis->StrictlyDominates(90, 97)); + EXPECT_TRUE(analysis->StrictlyDominates(90, 96)); + + EXPECT_TRUE(analysis->StrictlyDominates(87, 94)); + EXPECT_TRUE(analysis->StrictlyDominates(87, 98)); + EXPECT_TRUE(analysis->StrictlyDominates(87, 95)); + EXPECT_TRUE(analysis->StrictlyDominates(87, 97)); + EXPECT_TRUE(analysis->StrictlyDominates(87, 96)); + + EXPECT_TRUE(analysis->StrictlyDominates(94, 98)); + EXPECT_TRUE(analysis->StrictlyDominates(94, 95)); + EXPECT_TRUE(analysis->StrictlyDominates(94, 97)); + EXPECT_TRUE(analysis->StrictlyDominates(94, 96)); + + EXPECT_TRUE(analysis->StrictlyDominates(98, 95)); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/post.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/post.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/post.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/post.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,206 @@ +// Copyright (c) 2017 Google 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. + +#include +#include + +#include + +#include "../assembly_builder.h" +#include "../function_utils.h" +#include "../pass_fixture.h" +#include "../pass_utils.h" +#include "opt/dominator_analysis.h" +#include "opt/pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +/* + Generated from the following GLSL +#version 440 core +layout(location = 0) out vec4 c; +layout(location = 1)in vec4 in_val; +void main(){ + if ( in_val.x < 10) { + int z = 0; + int i = 0; + for (i = 0; i < in_val.y; ++i) { + z += i; + } + c = vec4(i,i,i,i); + } else { + c = vec4(1,1,1,1); + } +} +*/ +TEST_F(PassClassTest, BasicVisitFromEntryPoint) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" %9 %43 + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 440 + OpName %4 "main" + OpName %9 "in_val" + OpName %22 "z" + OpName %24 "i" + OpName %43 "c" + OpDecorate %9 Location 1 + OpDecorate %43 Location 0 + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeFloat 32 + %7 = OpTypeVector %6 4 + %8 = OpTypePointer Input %7 + %9 = OpVariable %8 Input + %10 = OpTypeInt 32 0 + %11 = OpConstant %10 0 + %12 = OpTypePointer Input %6 + %15 = OpConstant %6 10 + %16 = OpTypeBool + %20 = OpTypeInt 32 1 + %21 = OpTypePointer Function %20 + %23 = OpConstant %20 0 + %32 = OpConstant %10 1 + %40 = OpConstant %20 1 + %42 = OpTypePointer Output %7 + %43 = OpVariable %42 Output + %54 = OpConstant %6 1 + %55 = OpConstantComposite %7 %54 %54 %54 %54 + %4 = OpFunction %2 None %3 + %5 = OpLabel + %22 = OpVariable %21 Function + %24 = OpVariable %21 Function + %13 = OpAccessChain %12 %9 %11 + %14 = OpLoad %6 %13 + %17 = OpFOrdLessThan %16 %14 %15 + OpSelectionMerge %19 None + OpBranchConditional %17 %18 %53 + %18 = OpLabel + OpStore %22 %23 + OpStore %24 %23 + OpStore %24 %23 + OpBranch %25 + %25 = OpLabel + OpLoopMerge %27 %28 None + OpBranch %29 + %29 = OpLabel + %30 = OpLoad %20 %24 + %31 = OpConvertSToF %6 %30 + %33 = OpAccessChain %12 %9 %32 + %34 = OpLoad %6 %33 + %35 = OpFOrdLessThan %16 %31 %34 + OpBranchConditional %35 %26 %27 + %26 = OpLabel + %36 = OpLoad %20 %24 + %37 = OpLoad %20 %22 + %38 = OpIAdd %20 %37 %36 + OpStore %22 %38 + OpBranch %28 + %28 = OpLabel + %39 = OpLoad %20 %24 + %41 = OpIAdd %20 %39 %40 + OpStore %24 %41 + OpBranch %25 + %27 = OpLabel + %44 = OpLoad %20 %24 + %45 = OpConvertSToF %6 %44 + %46 = OpLoad %20 %24 + %47 = OpConvertSToF %6 %46 + %48 = OpLoad %20 %24 + %49 = OpConvertSToF %6 %48 + %50 = OpLoad %20 %24 + %51 = OpConvertSToF %6 %50 + %52 = OpCompositeConstruct %7 %45 %47 %49 %51 + OpStore %43 %52 + OpBranch %19 + %53 = OpLabel + OpStore %43 %55 + OpBranch %19 + %19 = OpLabel + OpReturn + OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + const ir::Function* f = spvtest::GetFunction(module, 4); + ir::CFG cfg(module); + opt::PostDominatorAnalysis* analysis = + context->GetPostDominatorAnalysis(f, cfg); + + EXPECT_TRUE(analysis->Dominates(19, 18)); + EXPECT_TRUE(analysis->Dominates(19, 5)); + EXPECT_TRUE(analysis->Dominates(19, 53)); + EXPECT_TRUE(analysis->Dominates(19, 19)); + EXPECT_TRUE(analysis->Dominates(19, 25)); + EXPECT_TRUE(analysis->Dominates(19, 29)); + EXPECT_TRUE(analysis->Dominates(19, 27)); + EXPECT_TRUE(analysis->Dominates(19, 26)); + EXPECT_TRUE(analysis->Dominates(19, 28)); + + EXPECT_TRUE(analysis->Dominates(27, 18)); + EXPECT_TRUE(analysis->Dominates(27, 25)); + EXPECT_TRUE(analysis->Dominates(27, 29)); + EXPECT_TRUE(analysis->Dominates(27, 27)); + EXPECT_TRUE(analysis->Dominates(27, 26)); + EXPECT_TRUE(analysis->Dominates(27, 28)); + + EXPECT_FALSE(analysis->Dominates(27, 19)); + EXPECT_FALSE(analysis->Dominates(27, 5)); + EXPECT_FALSE(analysis->Dominates(27, 53)); + + EXPECT_FALSE(analysis->StrictlyDominates(19, 19)); + + EXPECT_TRUE(analysis->StrictlyDominates(19, 18)); + EXPECT_TRUE(analysis->StrictlyDominates(19, 5)); + EXPECT_TRUE(analysis->StrictlyDominates(19, 53)); + EXPECT_TRUE(analysis->StrictlyDominates(19, 25)); + EXPECT_TRUE(analysis->StrictlyDominates(19, 29)); + EXPECT_TRUE(analysis->StrictlyDominates(19, 27)); + EXPECT_TRUE(analysis->StrictlyDominates(19, 26)); + EXPECT_TRUE(analysis->StrictlyDominates(19, 28)); + + // These would be expected true for a normal, non post, dominator tree + EXPECT_FALSE(analysis->Dominates(5, 18)); + EXPECT_FALSE(analysis->Dominates(5, 53)); + EXPECT_FALSE(analysis->Dominates(5, 19)); + EXPECT_FALSE(analysis->Dominates(5, 25)); + EXPECT_FALSE(analysis->Dominates(5, 29)); + EXPECT_FALSE(analysis->Dominates(5, 27)); + EXPECT_FALSE(analysis->Dominates(5, 26)); + EXPECT_FALSE(analysis->Dominates(5, 28)); + + EXPECT_FALSE(analysis->StrictlyDominates(5, 18)); + EXPECT_FALSE(analysis->StrictlyDominates(5, 53)); + EXPECT_FALSE(analysis->StrictlyDominates(5, 19)); + EXPECT_FALSE(analysis->StrictlyDominates(5, 25)); + EXPECT_FALSE(analysis->StrictlyDominates(5, 29)); + EXPECT_FALSE(analysis->StrictlyDominates(5, 27)); + EXPECT_FALSE(analysis->StrictlyDominates(5, 26)); + EXPECT_FALSE(analysis->StrictlyDominates(5, 28)); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/simple.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/simple.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/simple.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/simple.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,175 @@ +// Copyright (c) 2017 Google 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. + +#include +#include + +#include + +#include "../assembly_builder.h" +#include "../function_utils.h" +#include "../pass_fixture.h" +#include "../pass_utils.h" +#include "opt/dominator_analysis.h" +#include "opt/pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +/* +Generated from the following GLSL +#version 440 core +layout(location = 0) out vec4 c; +layout(location = 1)in vec4 in_val; +void main(){ + if ( in_val.x < 10) { + int z = 0; + int i = 0; + for (i = 0; i < in_val.y; ++i) { + z += i; + } + c = vec4(i,i,i,i); + } else { + c = vec4(1,1,1,1); + } +} +*/ +TEST_F(PassClassTest, BasicVisitFromEntryPoint) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" %9 %43 + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 440 + OpName %4 "main" + OpName %9 "in_val" + OpName %22 "z" + OpName %24 "i" + OpName %43 "c" + OpDecorate %9 Location 1 + OpDecorate %43 Location 0 + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeFloat 32 + %7 = OpTypeVector %6 4 + %8 = OpTypePointer Input %7 + %9 = OpVariable %8 Input + %10 = OpTypeInt 32 0 + %11 = OpConstant %10 0 + %12 = OpTypePointer Input %6 + %15 = OpConstant %6 10 + %16 = OpTypeBool + %20 = OpTypeInt 32 1 + %21 = OpTypePointer Function %20 + %23 = OpConstant %20 0 + %32 = OpConstant %10 1 + %40 = OpConstant %20 1 + %42 = OpTypePointer Output %7 + %43 = OpVariable %42 Output + %54 = OpConstant %6 1 + %55 = OpConstantComposite %7 %54 %54 %54 %54 + %4 = OpFunction %2 None %3 + %5 = OpLabel + %22 = OpVariable %21 Function + %24 = OpVariable %21 Function + %13 = OpAccessChain %12 %9 %11 + %14 = OpLoad %6 %13 + %17 = OpFOrdLessThan %16 %14 %15 + OpSelectionMerge %19 None + OpBranchConditional %17 %18 %53 + %18 = OpLabel + OpStore %22 %23 + OpStore %24 %23 + OpStore %24 %23 + OpBranch %25 + %25 = OpLabel + OpLoopMerge %27 %28 None + OpBranch %29 + %29 = OpLabel + %30 = OpLoad %20 %24 + %31 = OpConvertSToF %6 %30 + %33 = OpAccessChain %12 %9 %32 + %34 = OpLoad %6 %33 + %35 = OpFOrdLessThan %16 %31 %34 + OpBranchConditional %35 %26 %27 + %26 = OpLabel + %36 = OpLoad %20 %24 + %37 = OpLoad %20 %22 + %38 = OpIAdd %20 %37 %36 + OpStore %22 %38 + OpBranch %28 + %28 = OpLabel + %39 = OpLoad %20 %24 + %41 = OpIAdd %20 %39 %40 + OpStore %24 %41 + OpBranch %25 + %27 = OpLabel + %44 = OpLoad %20 %24 + %45 = OpConvertSToF %6 %44 + %46 = OpLoad %20 %24 + %47 = OpConvertSToF %6 %46 + %48 = OpLoad %20 %24 + %49 = OpConvertSToF %6 %48 + %50 = OpLoad %20 %24 + %51 = OpConvertSToF %6 %50 + %52 = OpCompositeConstruct %7 %45 %47 %49 %51 + OpStore %43 %52 + OpBranch %19 + %53 = OpLabel + OpStore %43 %55 + OpBranch %19 + %19 = OpLabel + OpReturn + OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 4); + + ir::CFG cfg(module); + opt::DominatorAnalysis* analysis = context->GetDominatorAnalysis(f, cfg); + + opt::DominatorTree& tree = analysis->GetDomTree(); + + EXPECT_EQ(tree.GetRoot()->bb_, cfg.pseudo_entry_block()); + EXPECT_TRUE(analysis->Dominates(5, 18)); + EXPECT_TRUE(analysis->Dominates(5, 53)); + EXPECT_TRUE(analysis->Dominates(5, 19)); + EXPECT_TRUE(analysis->Dominates(5, 25)); + EXPECT_TRUE(analysis->Dominates(5, 29)); + EXPECT_TRUE(analysis->Dominates(5, 27)); + EXPECT_TRUE(analysis->Dominates(5, 26)); + EXPECT_TRUE(analysis->Dominates(5, 28)); + + EXPECT_TRUE(analysis->StrictlyDominates(5, 18)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 53)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 19)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 25)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 29)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 27)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 26)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 28)); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/switch_case_fallthrough.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/switch_case_fallthrough.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/switch_case_fallthrough.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/switch_case_fallthrough.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,162 @@ +// Copyright (c) 2017 Google 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. + +#include +#include + +#include + +#include "../assembly_builder.h" +#include "../function_utils.h" +#include "../pass_fixture.h" +#include "../pass_utils.h" +#include "opt/dominator_analysis.h" +#include "opt/pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +/* + Generated from the following GLSL +#version 440 core +layout(location = 0) out vec4 v; +layout(location = 1) in vec4 in_val; +void main() { + int i; + switch (int(in_val.x)) { + case 0: + i = 0; + case 1: + i = 1; + break; + case 2: + i = 2; + case 3: + i = 3; + case 4: + i = 4; + break; + default: + i = 0; + } + v = vec4(i, i, i, i); +} +*/ +TEST_F(PassClassTest, UnreachableNestedIfs) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" %9 %35 + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 440 + OpName %4 "main" + OpName %9 "in_val" + OpName %25 "i" + OpName %35 "v" + OpDecorate %9 Location 1 + OpDecorate %35 Location 0 + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeFloat 32 + %7 = OpTypeVector %6 4 + %8 = OpTypePointer Input %7 + %9 = OpVariable %8 Input + %10 = OpTypeInt 32 0 + %11 = OpConstant %10 0 + %12 = OpTypePointer Input %6 + %15 = OpTypeInt 32 1 + %24 = OpTypePointer Function %15 + %26 = OpConstant %15 0 + %27 = OpConstant %15 1 + %29 = OpConstant %15 2 + %30 = OpConstant %15 3 + %31 = OpConstant %15 4 + %34 = OpTypePointer Output %7 + %35 = OpVariable %34 Output + %4 = OpFunction %2 None %3 + %5 = OpLabel + %25 = OpVariable %24 Function + %13 = OpAccessChain %12 %9 %11 + %14 = OpLoad %6 %13 + %16 = OpConvertFToS %15 %14 + OpSelectionMerge %23 None + OpSwitch %16 %22 0 %17 1 %18 2 %19 3 %20 4 %21 + %22 = OpLabel + OpStore %25 %26 + OpBranch %23 + %17 = OpLabel + OpStore %25 %26 + OpBranch %18 + %18 = OpLabel + OpStore %25 %27 + OpBranch %23 + %19 = OpLabel + OpStore %25 %29 + OpBranch %20 + %20 = OpLabel + OpStore %25 %30 + OpBranch %21 + %21 = OpLabel + OpStore %25 %31 + OpBranch %23 + %23 = OpLabel + %36 = OpLoad %15 %25 + %37 = OpConvertSToF %6 %36 + %38 = OpLoad %15 %25 + %39 = OpConvertSToF %6 %38 + %40 = OpLoad %15 %25 + %41 = OpConvertSToF %6 %40 + %42 = OpLoad %15 %25 + %43 = OpConvertSToF %6 %42 + %44 = OpCompositeConstruct %7 %37 %39 %41 %43 + OpStore %35 %44 + OpReturn + OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + const ir::Function* f = spvtest::GetFunction(module, 4); + ir::CFG cfg(module); + opt::DominatorAnalysis* analysis = context->GetDominatorAnalysis(f, cfg); + + EXPECT_TRUE(analysis->Dominates(5, 5)); + EXPECT_TRUE(analysis->Dominates(5, 17)); + EXPECT_TRUE(analysis->Dominates(5, 18)); + EXPECT_TRUE(analysis->Dominates(5, 19)); + EXPECT_TRUE(analysis->Dominates(5, 20)); + EXPECT_TRUE(analysis->Dominates(5, 21)); + EXPECT_TRUE(analysis->Dominates(5, 22)); + EXPECT_TRUE(analysis->Dominates(5, 23)); + + EXPECT_TRUE(analysis->StrictlyDominates(5, 17)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 18)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 19)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 20)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 21)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 22)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 23)); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/unreachable_for.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/unreachable_for.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/unreachable_for.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/unreachable_for.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,120 @@ +// Copyright (c) 2017 Google 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. + +#include +#include + +#include + +#include "../assembly_builder.h" +#include "../function_utils.h" +#include "../pass_fixture.h" +#include "../pass_utils.h" +#include "opt/dominator_analysis.h" +#include "opt/pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +/* + Generated from the following GLSL +#version 440 core +void main() { + for (int i = 0; i < 1; i++) { + break; + } +} +*/ +TEST_F(PassClassTest, UnreachableNestedIfs) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 440 + OpName %4 "main" + OpName %8 "i" + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeInt 32 1 + %7 = OpTypePointer Function %6 + %9 = OpConstant %6 0 + %16 = OpConstant %6 1 + %17 = OpTypeBool + %4 = OpFunction %2 None %3 + %5 = OpLabel + %8 = OpVariable %7 Function + OpStore %8 %9 + OpBranch %10 + %10 = OpLabel + OpLoopMerge %12 %13 None + OpBranch %14 + %14 = OpLabel + %15 = OpLoad %6 %8 + %18 = OpSLessThan %17 %15 %16 + OpBranchConditional %18 %11 %12 + %11 = OpLabel + OpBranch %12 + %13 = OpLabel + %20 = OpLoad %6 %8 + %21 = OpIAdd %6 %20 %16 + OpStore %8 %21 + OpBranch %10 + %12 = OpLabel + OpReturn + OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + const ir::Function* f = spvtest::GetFunction(module, 4); + ir::CFG cfg(module); + opt::DominatorAnalysis* analysis = context->GetDominatorAnalysis(f, cfg); + EXPECT_TRUE(analysis->Dominates(5, 5)); + EXPECT_TRUE(analysis->Dominates(5, 10)); + EXPECT_TRUE(analysis->Dominates(5, 14)); + EXPECT_TRUE(analysis->Dominates(5, 11)); + EXPECT_TRUE(analysis->Dominates(5, 12)); + EXPECT_TRUE(analysis->Dominates(10, 10)); + EXPECT_TRUE(analysis->Dominates(10, 14)); + EXPECT_TRUE(analysis->Dominates(10, 11)); + EXPECT_TRUE(analysis->Dominates(10, 12)); + EXPECT_TRUE(analysis->Dominates(14, 14)); + EXPECT_TRUE(analysis->Dominates(14, 11)); + EXPECT_TRUE(analysis->Dominates(14, 12)); + EXPECT_TRUE(analysis->Dominates(11, 11)); + EXPECT_TRUE(analysis->Dominates(12, 12)); + + EXPECT_TRUE(analysis->StrictlyDominates(5, 10)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 14)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 11)); + EXPECT_TRUE(analysis->StrictlyDominates(5, 12)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 14)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 11)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 12)); + EXPECT_TRUE(analysis->StrictlyDominates(14, 11)); + EXPECT_TRUE(analysis->StrictlyDominates(14, 12)); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/unreachable_for_post.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/unreachable_for_post.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/dominator_tree/unreachable_for_post.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/dominator_tree/unreachable_for_post.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,118 @@ +// Copyright (c) 2017 Google 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. + +#include +#include + +#include + +#include "../assembly_builder.h" +#include "../function_utils.h" +#include "../pass_fixture.h" +#include "../pass_utils.h" +#include "opt/dominator_analysis.h" +#include "opt/pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +/* + Generated from the following GLSL +#version 440 core +void main() { + for (int i = 0; i < 1; i++) { + break; + } +} +*/ +TEST_F(PassClassTest, UnreachableNestedIfs) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 440 + OpName %4 "main" + OpName %8 "i" + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeInt 32 1 + %7 = OpTypePointer Function %6 + %9 = OpConstant %6 0 + %16 = OpConstant %6 1 + %17 = OpTypeBool + %4 = OpFunction %2 None %3 + %5 = OpLabel + %8 = OpVariable %7 Function + OpStore %8 %9 + OpBranch %10 + %10 = OpLabel + OpLoopMerge %12 %13 None + OpBranch %14 + %14 = OpLabel + %15 = OpLoad %6 %8 + %18 = OpSLessThan %17 %15 %16 + OpBranchConditional %18 %11 %12 + %11 = OpLabel + OpBranch %12 + %13 = OpLabel + %20 = OpLoad %6 %8 + %21 = OpIAdd %6 %20 %16 + OpStore %8 %21 + OpBranch %10 + %12 = OpLabel + OpReturn + OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + const ir::Function* f = spvtest::GetFunction(module, 4); + + ir::CFG cfg(module); + opt::PostDominatorAnalysis* analysis = + context->GetPostDominatorAnalysis(f, cfg); + + EXPECT_TRUE(analysis->Dominates(12, 12)); + EXPECT_TRUE(analysis->Dominates(12, 14)); + EXPECT_TRUE(analysis->Dominates(12, 11)); + EXPECT_TRUE(analysis->Dominates(12, 10)); + EXPECT_TRUE(analysis->Dominates(12, 5)); + EXPECT_TRUE(analysis->Dominates(14, 14)); + EXPECT_TRUE(analysis->Dominates(14, 10)); + EXPECT_TRUE(analysis->Dominates(14, 5)); + EXPECT_TRUE(analysis->Dominates(10, 10)); + EXPECT_TRUE(analysis->Dominates(10, 5)); + EXPECT_TRUE(analysis->Dominates(5, 5)); + + EXPECT_TRUE(analysis->StrictlyDominates(12, 14)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 11)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 10)); + EXPECT_TRUE(analysis->StrictlyDominates(12, 5)); + EXPECT_TRUE(analysis->StrictlyDominates(14, 10)); + EXPECT_TRUE(analysis->StrictlyDominates(14, 5)); + EXPECT_TRUE(analysis->StrictlyDominates(10, 5)); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/eliminate_dead_const_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/eliminate_dead_const_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/eliminate_dead_const_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/eliminate_dead_const_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,842 @@ +// Copyright (c) 2016 Google 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. + +#include "assembly_builder.h" +#include "pass_fixture.h" +#include "pass_utils.h" + +#include +#include +#include +#include +#include + +namespace { + +using namespace spvtools; + +using EliminateDeadConstantBasicTest = PassTest<::testing::Test>; + +TEST_F(EliminateDeadConstantBasicTest, BasicAllDeadConstants) { + const std::vector text = { + // clang-format off + "OpCapability Shader", + "OpCapability Float64", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Vertex %main \"main\"", + "OpName %main \"main\"", + "%void = OpTypeVoid", + "%4 = OpTypeFunction %void", + "%bool = OpTypeBool", + "%true = OpConstantTrue %bool", + "%false = OpConstantFalse %bool", + "%int = OpTypeInt 32 1", + "%9 = OpConstant %int 1", + "%uint = OpTypeInt 32 0", + "%11 = OpConstant %uint 2", + "%float = OpTypeFloat 32", + "%13 = OpConstant %float 3.1415", + "%double = OpTypeFloat 64", + "%15 = OpConstant %double 3.14159265358979", + "%main = OpFunction %void None %4", + "%16 = OpLabel", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + // None of the above constants is ever used, so all of them should be + // eliminated. + const char* const_decl_opcodes[] = { + " OpConstantTrue ", + " OpConstantFalse ", + " OpConstant ", + }; + // Skip lines that have any one of const_decl_opcodes. + const std::string expected_disassembly = + SelectiveJoin(text, [&const_decl_opcodes](const char* line) { + return std::any_of( + std::begin(const_decl_opcodes), std::end(const_decl_opcodes), + [&line](const char* const_decl_op) { + return std::string(line).find(const_decl_op) != std::string::npos; + }); + }); + + SinglePassRunAndCheck( + JoinAllInsts(text), expected_disassembly, /* skip_nop = */ true); +} + +TEST_F(EliminateDeadConstantBasicTest, BasicNoneDeadConstants) { + const std::vector text = { + // clang-format off + "OpCapability Shader", + "OpCapability Float64", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Vertex %main \"main\"", + "OpName %main \"main\"", + "OpName %btv \"btv\"", + "OpName %bfv \"bfv\"", + "OpName %iv \"iv\"", + "OpName %uv \"uv\"", + "OpName %fv \"fv\"", + "OpName %dv \"dv\"", + "%void = OpTypeVoid", + "%10 = OpTypeFunction %void", + "%bool = OpTypeBool", + "%_ptr_Function_bool = OpTypePointer Function %bool", + "%true = OpConstantTrue %bool", + "%false = OpConstantFalse %bool", + "%int = OpTypeInt 32 1", + "%_ptr_Function_int = OpTypePointer Function %int", + "%int_1 = OpConstant %int 1", + "%uint = OpTypeInt 32 0", + "%_ptr_Function_uint = OpTypePointer Function %uint", + "%uint_2 = OpConstant %uint 2", + "%float = OpTypeFloat 32", + "%_ptr_Function_float = OpTypePointer Function %float", + "%float_3_1415 = OpConstant %float 3.1415", + "%double = OpTypeFloat 64", + "%_ptr_Function_double = OpTypePointer Function %double", + "%double_3_14159265358979 = OpConstant %double 3.14159265358979", + "%main = OpFunction %void None %10", + "%27 = OpLabel", + "%btv = OpVariable %_ptr_Function_bool Function", + "%bfv = OpVariable %_ptr_Function_bool Function", + "%iv = OpVariable %_ptr_Function_int Function", + "%uv = OpVariable %_ptr_Function_uint Function", + "%fv = OpVariable %_ptr_Function_float Function", + "%dv = OpVariable %_ptr_Function_double Function", + "OpStore %btv %true", + "OpStore %bfv %false", + "OpStore %iv %int_1", + "OpStore %uv %uint_2", + "OpStore %fv %float_3_1415", + "OpStore %dv %double_3_14159265358979", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + // All constants are used, so none of them should be eliminated. + SinglePassRunAndCheck( + JoinAllInsts(text), JoinAllInsts(text), /* skip_nop = */ true); +} + +struct EliminateDeadConstantTestCase { + // Type declarations and constants that should be kept. + std::vector used_consts; + // Instructions that refer to constants, this is added to create uses for + // some constants so they won't be treated as dead constants. + std::vector main_insts; + // Dead constants that should be removed. + std::vector dead_consts; +}; + +// All types that are potentially required in EliminateDeadConstantTest. +const std::vector CommonTypes = { + // clang-format off + // scalar types + "%bool = OpTypeBool", + "%uint = OpTypeInt 32 0", + "%int = OpTypeInt 32 1", + "%float = OpTypeFloat 32", + "%double = OpTypeFloat 64", + // vector types + "%v2bool = OpTypeVector %bool 2", + "%v2uint = OpTypeVector %uint 2", + "%v2int = OpTypeVector %int 2", + "%v3int = OpTypeVector %int 3", + "%v4int = OpTypeVector %int 4", + "%v2float = OpTypeVector %float 2", + "%v3float = OpTypeVector %float 3", + "%v2double = OpTypeVector %double 2", + // variable pointer types + "%_pf_bool = OpTypePointer Function %bool", + "%_pf_uint = OpTypePointer Function %uint", + "%_pf_int = OpTypePointer Function %int", + "%_pf_float = OpTypePointer Function %float", + "%_pf_double = OpTypePointer Function %double", + "%_pf_v2int = OpTypePointer Function %v2int", + "%_pf_v3int = OpTypePointer Function %v3int", + "%_pf_v2float = OpTypePointer Function %v2float", + "%_pf_v3float = OpTypePointer Function %v3float", + "%_pf_v2double = OpTypePointer Function %v2double", + // struct types + "%inner_struct = OpTypeStruct %bool %int %float %double", + "%outer_struct = OpTypeStruct %inner_struct %int %double", + "%flat_struct = OpTypeStruct %bool %int %float %double", + // clang-format on +}; + +using EliminateDeadConstantTest = + PassTest<::testing::TestWithParam>; + +TEST_P(EliminateDeadConstantTest, Custom) { + auto& tc = GetParam(); + AssemblyBuilder builder; + builder.AppendTypesConstantsGlobals(CommonTypes) + .AppendTypesConstantsGlobals(tc.used_consts) + .AppendInMain(tc.main_insts); + const std::string expected = builder.GetCode(); + builder.AppendTypesConstantsGlobals(tc.dead_consts); + const std::string assembly_with_dead_const = builder.GetCode(); + SinglePassRunAndCheck( + assembly_with_dead_const, expected, /* skip_nop = */ true); +} + +INSTANTIATE_TEST_CASE_P( + ScalarTypeConstants, EliminateDeadConstantTest, + ::testing::ValuesIn(std::vector({ + // clang-format off + // Scalar type constants, one dead constant and one used constant. + { + /* .used_consts = */ + { + "%used_const_int = OpConstant %int 1", + }, + /* .main_insts = */ + { + "%int_var = OpVariable %_pf_int Function", + "OpStore %int_var %used_const_int", + }, + /* .dead_consts = */ + { + "%dead_const_int = OpConstant %int 1", + }, + }, + { + /* .used_consts = */ + { + "%used_const_uint = OpConstant %uint 1", + }, + /* .main_insts = */ + { + "%uint_var = OpVariable %_pf_uint Function", + "OpStore %uint_var %used_const_uint", + }, + /* .dead_consts = */ + { + "%dead_const_uint = OpConstant %uint 1", + }, + }, + { + /* .used_consts = */ + { + "%used_const_float = OpConstant %float 3.1415", + }, + /* .main_insts = */ + { + "%float_var = OpVariable %_pf_float Function", + "OpStore %float_var %used_const_float", + }, + /* .dead_consts = */ + { + "%dead_const_float = OpConstant %float 3.1415", + }, + }, + { + /* .used_consts = */ + { + "%used_const_double = OpConstant %double 3.141592653", + }, + /* .main_insts = */ + { + "%double_var = OpVariable %_pf_double Function", + "OpStore %double_var %used_const_double", + }, + /* .dead_consts = */ + { + "%dead_const_double = OpConstant %double 3.141592653", + }, + }, + // clang-format on + }))); + +INSTANTIATE_TEST_CASE_P( + VectorTypeConstants, EliminateDeadConstantTest, + ::testing::ValuesIn(std::vector({ + // clang-format off + // Tests eliminating dead constant type ivec2. One dead constant vector + // and one used constant vector, each built from its own group of + // scalar constants. + { + /* .used_consts = */ + { + "%used_int_x = OpConstant %int 1", + "%used_int_y = OpConstant %int 2", + "%used_v2int = OpConstantComposite %v2int %used_int_x %used_int_y", + }, + /* .main_insts = */ + { + "%v2int_var = OpVariable %_pf_v2int Function", + "OpStore %v2int_var %used_v2int", + }, + /* .dead_consts = */ + { + "%dead_int_x = OpConstant %int 1", + "%dead_int_y = OpConstant %int 2", + "%dead_v2int = OpConstantComposite %v2int %dead_int_x %dead_int_y", + }, + }, + // Tests eliminating dead constant ivec2. One dead constant vector and + // one used constant vector. But both built from a same group of + // scalar constants. + { + /* .used_consts = */ + { + "%used_int_x = OpConstant %int 1", + "%used_int_y = OpConstant %int 2", + "%used_int_z = OpConstant %int 3", + "%used_v3int = OpConstantComposite %v3int %used_int_x %used_int_y %used_int_z", + }, + /* .main_insts = */ + { + "%v3int_var = OpVariable %_pf_v3int Function", + "OpStore %v3int_var %used_v3int", + }, + /* .dead_consts = */ + { + "%dead_v3int = OpConstantComposite %v3int %used_int_x %used_int_y %used_int_z", + }, + }, + // Tests eliminating dead cosntant vec2. One dead constant vector and + // one used constant vector. Each built from its own group of scalar + // constants. + { + /* .used_consts = */ + { + "%used_float_x = OpConstant %float 3.1415", + "%used_float_y = OpConstant %float 4.25", + "%used_v2float = OpConstantComposite %v2float %used_float_x %used_float_y", + }, + /* .main_insts = */ + { + "%v2float_var = OpVariable %_pf_v2float Function", + "OpStore %v2float_var %used_v2float", + }, + /* .dead_consts = */ + { + "%dead_float_x = OpConstant %float 3.1415", + "%dead_float_y = OpConstant %float 4.25", + "%dead_v2float = OpConstantComposite %v2float %dead_float_x %dead_float_y", + }, + }, + // Tests eliminating dead cosntant vec2. One dead constant vector and + // one used constant vector. Both built from a same group of scalar + // constants. + { + /* .used_consts = */ + { + "%used_float_x = OpConstant %float 3.1415", + "%used_float_y = OpConstant %float 4.25", + "%used_float_z = OpConstant %float 4.75", + "%used_v3float = OpConstantComposite %v3float %used_float_x %used_float_y %used_float_z", + }, + /* .main_insts = */ + { + "%v3float_var = OpVariable %_pf_v3float Function", + "OpStore %v3float_var %used_v3float", + }, + /* .dead_consts = */ + { + "%dead_v3float = OpConstantComposite %v3float %used_float_x %used_float_y %used_float_z", + }, + }, + // clang-format on + }))); + +INSTANTIATE_TEST_CASE_P( + StructTypeConstants, EliminateDeadConstantTest, + ::testing::ValuesIn(std::vector({ + // clang-format off + // A plain struct type dead constants. All of its components are dead + // constants too. + { + /* .used_consts = */ {}, + /* .main_insts = */ {}, + /* .dead_consts = */ + { + "%dead_bool = OpConstantTrue %bool", + "%dead_int = OpConstant %int 1", + "%dead_float = OpConstant %float 2.5", + "%dead_double = OpConstant %double 3.14159265358979", + "%dead_struct = OpConstantComposite %flat_struct %dead_bool %dead_int %dead_float %dead_double", + }, + }, + // A plain struct type dead constants. Some of its components are dead + // constants while others are not. + { + /* .used_consts = */ + { + "%used_int = OpConstant %int 1", + "%used_double = OpConstant %double 3.14159265358979", + }, + /* .main_insts = */ + { + "%int_var = OpVariable %_pf_int Function", + "OpStore %int_var %used_int", + "%double_var = OpVariable %_pf_double Function", + "OpStore %double_var %used_double", + }, + /* .dead_consts = */ + { + "%dead_bool = OpConstantTrue %bool", + "%dead_float = OpConstant %float 2.5", + "%dead_struct = OpConstantComposite %flat_struct %dead_bool %used_int %dead_float %used_double", + }, + }, + // A nesting struct type dead constants. All components of both outer + // and inner structs are dead and should be removed after dead constant + // elimination. + { + /* .used_consts = */ {}, + /* .main_insts = */ {}, + /* .dead_consts = */ + { + "%dead_bool = OpConstantTrue %bool", + "%dead_int = OpConstant %int 1", + "%dead_float = OpConstant %float 2.5", + "%dead_double = OpConstant %double 3.1415926535", + "%dead_inner_struct = OpConstantComposite %inner_struct %dead_bool %dead_int %dead_float %dead_double", + "%dead_int2 = OpConstant %int 2", + "%dead_double2 = OpConstant %double 1.428571428514", + "%dead_outer_struct = OpConstantComposite %outer_struct %dead_inner_struct %dead_int2 %dead_double2", + }, + }, + // A nesting struct type dead constants. Some of its components are + // dead constants while others are not. + { + /* .used_consts = */ + { + "%used_int = OpConstant %int 1", + "%used_double = OpConstant %double 3.14159265358979", + }, + /* .main_insts = */ + { + "%int_var = OpVariable %_pf_int Function", + "OpStore %int_var %used_int", + "%double_var = OpVariable %_pf_double Function", + "OpStore %double_var %used_double", + }, + /* .dead_consts = */ + { + "%dead_bool = OpConstantTrue %bool", + "%dead_float = OpConstant %float 2.5", + "%dead_inner_struct = OpConstantComposite %inner_struct %dead_bool %used_int %dead_float %used_double", + "%dead_int = OpConstant %int 2", + "%dead_outer_struct = OpConstantComposite %outer_struct %dead_inner_struct %dead_int %used_double", + }, + }, + // A nesting struct case. The inner struct is used while the outer struct is not + { + /* .used_const = */ + { + "%used_bool = OpConstantTrue %bool", + "%used_int = OpConstant %int 1", + "%used_float = OpConstant %float 1.25", + "%used_double = OpConstant %double 1.23456789012345", + "%used_inner_struct = OpConstantComposite %inner_struct %used_bool %used_int %used_float %used_double", + }, + /* .main_insts = */ + { + "%bool_var = OpVariable %_pf_bool Function", + "%bool_from_inner_struct = OpCompositeExtract %bool %used_inner_struct 0", + "OpStore %bool_var %bool_from_inner_struct", + }, + /* .dead_consts = */ + { + "%dead_int = OpConstant %int 2", + "%dead_outer_struct = OpConstantComposite %outer_struct %used_inner_struct %dead_int %used_double" + }, + }, + // A nesting struct case. The outer struct is used, so the inner struct should not + // be removed even though it is not used anywhere. + { + /* .used_const = */ + { + "%used_bool = OpConstantTrue %bool", + "%used_int = OpConstant %int 1", + "%used_float = OpConstant %float 1.25", + "%used_double = OpConstant %double 1.23456789012345", + "%used_inner_struct = OpConstantComposite %inner_struct %used_bool %used_int %used_float %used_double", + "%used_outer_struct = OpConstantComposite %outer_struct %used_inner_struct %used_int %used_double" + }, + /* .main_insts = */ + { + "%int_var = OpVariable %_pf_int Function", + "%int_from_outer_struct = OpCompositeExtract %int %used_outer_struct 1", + "OpStore %int_var %int_from_outer_struct", + }, + /* .dead_consts = */ {}, + }, + // clang-format on + }))); + +INSTANTIATE_TEST_CASE_P( + ScalarTypeSpecConstants, EliminateDeadConstantTest, + ::testing::ValuesIn(std::vector({ + // clang-format off + // All scalar type spec constants. + { + /* .used_consts = */ + { + "%used_bool = OpSpecConstantTrue %bool", + "%used_uint = OpSpecConstant %uint 2", + "%used_int = OpSpecConstant %int 2", + "%used_float = OpSpecConstant %float 2.5", + "%used_double = OpSpecConstant %double 1.42857142851", + }, + /* .main_insts = */ + { + "%bool_var = OpVariable %_pf_bool Function", + "%uint_var = OpVariable %_pf_uint Function", + "%int_var = OpVariable %_pf_int Function", + "%float_var = OpVariable %_pf_float Function", + "%double_var = OpVariable %_pf_double Function", + "OpStore %bool_var %used_bool", "OpStore %uint_var %used_uint", + "OpStore %int_var %used_int", "OpStore %float_var %used_float", + "OpStore %double_var %used_double", + }, + /* .dead_consts = */ + { + "%dead_bool = OpSpecConstantTrue %bool", + "%dead_uint = OpSpecConstant %uint 2", + "%dead_int = OpSpecConstant %int 2", + "%dead_float = OpSpecConstant %float 2.5", + "%dead_double = OpSpecConstant %double 1.42857142851", + }, + }, + // clang-format on + }))); + +INSTANTIATE_TEST_CASE_P( + VectorTypeSpecConstants, EliminateDeadConstantTest, + ::testing::ValuesIn(std::vector({ + // clang-format off + // Bool vector type spec constants. One vector has all component dead, + // another vector has one dead boolean and one used boolean. + { + /* .used_consts = */ + { + "%used_bool = OpSpecConstantTrue %bool", + }, + /* .main_insts = */ + { + "%bool_var = OpVariable %_pf_bool Function", + "OpStore %bool_var %used_bool", + }, + /* .dead_consts = */ + { + "%dead_bool = OpSpecConstantFalse %bool", + "%dead_bool_vec1 = OpSpecConstantComposite %v2bool %dead_bool %dead_bool", + "%dead_bool_vec2 = OpSpecConstantComposite %v2bool %dead_bool %used_bool", + }, + }, + + // Uint vector type spec constants. One vector has all component dead, + // another vector has one dead unsigend integer and one used unsigned + // integer. + { + /* .used_consts = */ + { + "%used_uint = OpSpecConstant %uint 3", + }, + /* .main_insts = */ + { + "%uint_var = OpVariable %_pf_uint Function", + "OpStore %uint_var %used_uint", + }, + /* .dead_consts = */ + { + "%dead_uint = OpSpecConstant %uint 1", + "%dead_uint_vec1 = OpSpecConstantComposite %v2uint %dead_uint %dead_uint", + "%dead_uint_vec2 = OpSpecConstantComposite %v2uint %dead_uint %used_uint", + }, + }, + + // Int vector type spec constants. One vector has all component dead, + // another vector has one dead integer and one used integer. + { + /* .used_consts = */ + { + "%used_int = OpSpecConstant %int 3", + }, + /* .main_insts = */ + { + "%int_var = OpVariable %_pf_int Function", + "OpStore %int_var %used_int", + }, + /* .dead_consts = */ + { + "%dead_int = OpSpecConstant %int 1", + "%dead_int_vec1 = OpSpecConstantComposite %v2int %dead_int %dead_int", + "%dead_int_vec2 = OpSpecConstantComposite %v2int %dead_int %used_int", + }, + }, + + // Int vector type spec constants built with both spec constants and + // front-end constants. + { + /* .used_consts = */ + { + "%used_spec_int = OpSpecConstant %int 3", + "%used_front_end_int = OpConstant %int 3", + }, + /* .main_insts = */ + { + "%int_var1 = OpVariable %_pf_int Function", + "OpStore %int_var1 %used_spec_int", + "%int_var2 = OpVariable %_pf_int Function", + "OpStore %int_var2 %used_front_end_int", + }, + /* .dead_consts = */ + { + "%dead_spec_int = OpSpecConstant %int 1", + "%dead_front_end_int = OpConstant %int 1", + // Dead front-end and dead spec constants + "%dead_int_vec1 = OpSpecConstantComposite %v2int %dead_spec_int %dead_front_end_int", + // Used front-end and dead spec constants + "%dead_int_vec2 = OpSpecConstantComposite %v2int %dead_spec_int %used_front_end_int", + // Dead front-end and used spec constants + "%dead_int_vec3 = OpSpecConstantComposite %v2int %dead_front_end_int %used_spec_int", + }, + }, + // clang-format on + }))); + +INSTANTIATE_TEST_CASE_P( + SpecConstantOp, EliminateDeadConstantTest, + ::testing::ValuesIn(std::vector({ + // clang-format off + // Cast operations: uint <-> int <-> bool + { + /* .used_consts = */ {}, + /* .main_insts = */ {}, + /* .dead_consts = */ + { + // Assistant constants, only used in dead spec constant + // operations. + "%signed_zero = OpConstant %int 0", + "%signed_zero_vec = OpConstantComposite %v2int %signed_zero %signed_zero", + "%unsigned_zero = OpConstant %uint 0", + "%unsigned_zero_vec = OpConstantComposite %v2uint %unsigned_zero %unsigned_zero", + "%signed_one = OpConstant %int 1", + "%signed_one_vec = OpConstantComposite %v2int %signed_one %signed_one", + "%unsigned_one = OpConstant %uint 1", + "%unsigned_one_vec = OpConstantComposite %v2uint %unsigned_one %unsigned_one", + + // Spec constants that support casting to each other. + "%dead_bool = OpSpecConstantTrue %bool", + "%dead_uint = OpSpecConstant %uint 1", + "%dead_int = OpSpecConstant %int 2", + "%dead_bool_vec = OpSpecConstantComposite %v2bool %dead_bool %dead_bool", + "%dead_uint_vec = OpSpecConstantComposite %v2uint %dead_uint %dead_uint", + "%dead_int_vec = OpSpecConstantComposite %v2int %dead_int %dead_int", + + // Scalar cast to boolean spec constant. + "%int_to_bool = OpSpecConstantOp %bool INotEqual %dead_int %signed_zero", + "%uint_to_bool = OpSpecConstantOp %bool INotEqual %dead_uint %unsigned_zero", + + // Vector cast to boolean spec constant. + "%int_to_bool_vec = OpSpecConstantOp %v2bool INotEqual %dead_int_vec %signed_zero_vec", + "%uint_to_bool_vec = OpSpecConstantOp %v2bool INotEqual %dead_uint_vec %unsigned_zero_vec", + + // Scalar cast to int spec constant. + "%bool_to_int = OpSpecConstantOp %int Select %dead_bool %signed_one %signed_zero", + "%uint_to_int = OpSpecConstantOp %uint IAdd %dead_uint %unsigned_zero", + + // Vector cast to int spec constant. + "%bool_to_int_vec = OpSpecConstantOp %v2int Select %dead_bool_vec %signed_one_vec %signed_zero_vec", + "%uint_to_int_vec = OpSpecConstantOp %v2uint IAdd %dead_uint_vec %unsigned_zero_vec", + + // Scalar cast to uint spec constant. + "%bool_to_uint = OpSpecConstantOp %uint Select %dead_bool %unsigned_one %unsigned_zero", + "%int_to_uint_vec = OpSpecConstantOp %uint IAdd %dead_int %signed_zero", + + // Vector cast to uint spec constant. + "%bool_to_uint_vec = OpSpecConstantOp %v2uint Select %dead_bool_vec %unsigned_one_vec %unsigned_zero_vec", + "%int_to_uint = OpSpecConstantOp %v2uint IAdd %dead_int_vec %signed_zero_vec", + }, + }, + + // Add, sub, mul, div, rem. + { + /* .used_consts = */ {}, + /* .main_insts = */ {}, + /* .dead_consts = */ + { + "%dead_spec_int_a = OpSpecConstant %int 1", + "%dead_spec_int_a_vec = OpSpecConstantComposite %v2int %dead_spec_int_a %dead_spec_int_a", + + "%dead_spec_int_b = OpSpecConstant %int 2", + "%dead_spec_int_b_vec = OpSpecConstantComposite %v2int %dead_spec_int_b %dead_spec_int_b", + + "%dead_const_int_c = OpConstant %int 3", + "%dead_const_int_c_vec = OpConstantComposite %v2int %dead_const_int_c %dead_const_int_c", + + // Add + "%add_a_b = OpSpecConstantOp %int IAdd %dead_spec_int_a %dead_spec_int_b", + "%add_a_b_vec = OpSpecConstantOp %v2int IAdd %dead_spec_int_a_vec %dead_spec_int_b_vec", + + // Sub + "%sub_a_b = OpSpecConstantOp %int ISub %dead_spec_int_a %dead_spec_int_b", + "%sub_a_b_vec = OpSpecConstantOp %v2int ISub %dead_spec_int_a_vec %dead_spec_int_b_vec", + + // Mul + "%mul_a_b = OpSpecConstantOp %int IMul %dead_spec_int_a %dead_spec_int_b", + "%mul_a_b_vec = OpSpecConstantOp %v2int IMul %dead_spec_int_a_vec %dead_spec_int_b_vec", + + // Div + "%div_a_b = OpSpecConstantOp %int SDiv %dead_spec_int_a %dead_spec_int_b", + "%div_a_b_vec = OpSpecConstantOp %v2int SDiv %dead_spec_int_a_vec %dead_spec_int_b_vec", + + // Bitwise Xor + "%xor_a_b = OpSpecConstantOp %int BitwiseXor %dead_spec_int_a %dead_spec_int_b", + "%xor_a_b_vec = OpSpecConstantOp %v2int BitwiseXor %dead_spec_int_a_vec %dead_spec_int_b_vec", + + // Scalar Comparison + "%less_a_b = OpSpecConstantOp %bool SLessThan %dead_spec_int_a %dead_spec_int_b", + }, + }, + + // Vectors without used swizzles should be removed. + { + /* .used_consts = */ + { + "%used_int = OpConstant %int 3", + }, + /* .main_insts = */ + { + "%int_var = OpVariable %_pf_int Function", + "OpStore %int_var %used_int", + }, + /* .dead_consts = */ + { + "%dead_int = OpConstant %int 3", + + "%dead_spec_int_a = OpSpecConstant %int 1", + "%vec_a = OpSpecConstantComposite %v4int %dead_spec_int_a %dead_spec_int_a %dead_int %dead_int", + + "%dead_spec_int_b = OpSpecConstant %int 2", + "%vec_b = OpSpecConstantComposite %v4int %dead_spec_int_b %dead_spec_int_b %used_int %used_int", + + // Extract scalar + "%a_x = OpSpecConstantOp %int CompositeExtract %vec_a 0", + "%b_x = OpSpecConstantOp %int CompositeExtract %vec_b 0", + + // Extract vector + "%a_xy = OpSpecConstantOp %v2int VectorShuffle %vec_a %vec_a 0 1", + "%b_xy = OpSpecConstantOp %v2int VectorShuffle %vec_b %vec_b 0 1", + }, + }, + // Vectors with used swizzles should not be removed. + { + /* .used_consts = */ + { + "%used_int = OpConstant %int 3", + "%used_spec_int_a = OpSpecConstant %int 1", + "%used_spec_int_b = OpSpecConstant %int 2", + // Create vectors + "%vec_a = OpSpecConstantComposite %v4int %used_spec_int_a %used_spec_int_a %used_int %used_int", + "%vec_b = OpSpecConstantComposite %v4int %used_spec_int_b %used_spec_int_b %used_int %used_int", + // Extract vector + "%a_xy = OpSpecConstantOp %v2int VectorShuffle %vec_a %vec_a 0 1", + "%b_xy = OpSpecConstantOp %v2int VectorShuffle %vec_b %vec_b 0 1", + }, + /* .main_insts = */ + { + "%v2int_var_a = OpVariable %_pf_v2int Function", + "%v2int_var_b = OpVariable %_pf_v2int Function", + "OpStore %v2int_var_a %a_xy", + "OpStore %v2int_var_b %b_xy", + }, + /* .dead_consts = */ {}, + }, + // clang-format on + }))); + +INSTANTIATE_TEST_CASE_P( + LongDefUseChain, EliminateDeadConstantTest, + ::testing::ValuesIn(std::vector({ + // clang-format off + // Long Def-Use chain with binary operations. + { + /* .used_consts = */ + { + "%array_size = OpConstant %int 4", + "%type_arr_int_4 = OpTypeArray %int %array_size", + "%used_int_0 = OpConstant %int 100", + "%used_int_1 = OpConstant %int 1", + "%used_int_2 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_1", + "%used_int_3 = OpSpecConstantOp %int ISub %used_int_0 %used_int_2", + "%used_int_4 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_3", + "%used_int_5 = OpSpecConstantOp %int ISub %used_int_0 %used_int_4", + "%used_int_6 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_5", + "%used_int_7 = OpSpecConstantOp %int ISub %used_int_0 %used_int_6", + "%used_int_8 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_7", + "%used_int_9 = OpSpecConstantOp %int ISub %used_int_0 %used_int_8", + "%used_int_10 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_9", + "%used_int_11 = OpSpecConstantOp %int ISub %used_int_0 %used_int_10", + "%used_int_12 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_11", + "%used_int_13 = OpSpecConstantOp %int ISub %used_int_0 %used_int_12", + "%used_int_14 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_13", + "%used_int_15 = OpSpecConstantOp %int ISub %used_int_0 %used_int_14", + "%used_int_16 = OpSpecConstantOp %int ISub %used_int_0 %used_int_15", + "%used_int_17 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_16", + "%used_int_18 = OpSpecConstantOp %int ISub %used_int_0 %used_int_17", + "%used_int_19 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_18", + "%used_int_20 = OpSpecConstantOp %int ISub %used_int_0 %used_int_19", + "%used_vec_a = OpSpecConstantComposite %v2int %used_int_18 %used_int_19", + "%used_vec_b = OpSpecConstantOp %v2int IMul %used_vec_a %used_vec_a", + "%used_int_21 = OpSpecConstantOp %int CompositeExtract %used_vec_b 0", + "%used_array = OpConstantComposite %type_arr_int_4 %used_int_20 %used_int_20 %used_int_21 %used_int_21", + }, + /* .main_insts = */ + { + "%int_var = OpVariable %_pf_int Function", + "%used_array_2 = OpCompositeExtract %int %used_array 2", + "OpStore %int_var %used_array_2", + }, + /* .dead_consts = */ + { + "%dead_int_1 = OpConstant %int 2", + "%dead_int_2 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_1", + "%dead_int_3 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_2", + "%dead_int_4 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_3", + "%dead_int_5 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_4", + "%dead_int_6 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_5", + "%dead_int_7 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_6", + "%dead_int_8 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_7", + "%dead_int_9 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_8", + "%dead_int_10 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_9", + "%dead_int_11 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_10", + "%dead_int_12 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_11", + "%dead_int_13 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_12", + "%dead_int_14 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_13", + "%dead_int_15 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_14", + "%dead_int_16 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_15", + "%dead_int_17 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_16", + "%dead_int_18 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_17", + "%dead_int_19 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_18", + "%dead_int_20 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_19", + "%dead_vec_a = OpSpecConstantComposite %v2int %dead_int_18 %dead_int_19", + "%dead_vec_b = OpSpecConstantOp %v2int IMul %dead_vec_a %dead_vec_a", + "%dead_int_21 = OpSpecConstantOp %int CompositeExtract %dead_vec_b 0", + "%dead_array = OpConstantComposite %type_arr_int_4 %dead_int_20 %used_int_20 %dead_int_19 %used_int_19", + }, + }, + // Long Def-Use chain with swizzle + // clang-format on + }))); +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/eliminate_dead_functions_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/eliminate_dead_functions_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/eliminate_dead_functions_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/eliminate_dead_functions_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,206 @@ +// Copyright (c) 2017 Google 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. + +#include + +#include + +#include "assembly_builder.h" +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; +using ::testing::HasSubstr; + +using EliminateDeadFunctionsBasicTest = PassTest<::testing::Test>; + +TEST_F(EliminateDeadFunctionsBasicTest, BasicDeleteDeadFunction) { + // The function Dead should be removed because it is never called. + const std::vector common_code = { + // clang-format off + "OpCapability Shader", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Fragment %main \"main\"", + "OpName %main \"main\"", + "OpName %Live \"Live\"", + "%void = OpTypeVoid", + "%7 = OpTypeFunction %void", + "%main = OpFunction %void None %7", + "%15 = OpLabel", + "%16 = OpFunctionCall %void %Live", + "%17 = OpFunctionCall %void %Live", + "OpReturn", + "OpFunctionEnd", + "%Live = OpFunction %void None %7", + "%20 = OpLabel", + "OpReturn", + "OpFunctionEnd" + // clang-format on + }; + + const std::vector dead_function = { + // clang-format off + "%Dead = OpFunction %void None %7", + "%19 = OpLabel", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck( + JoinAllInsts(Concat(common_code, dead_function)), + JoinAllInsts(common_code), /* skip_nop = */ true); +} + +TEST_F(EliminateDeadFunctionsBasicTest, BasicKeepLiveFunction) { + // Everything is reachable from an entry point, so no functions should be + // deleted. + const std::vector text = { + // clang-format off + "OpCapability Shader", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Fragment %main \"main\"", + "OpName %main \"main\"", + "OpName %Live1 \"Live1\"", + "OpName %Live2 \"Live2\"", + "%void = OpTypeVoid", + "%7 = OpTypeFunction %void", + "%main = OpFunction %void None %7", + "%15 = OpLabel", + "%16 = OpFunctionCall %void %Live2", + "%17 = OpFunctionCall %void %Live1", + "OpReturn", + "OpFunctionEnd", + "%Live1 = OpFunction %void None %7", + "%19 = OpLabel", + "OpReturn", + "OpFunctionEnd", + "%Live2 = OpFunction %void None %7", + "%20 = OpLabel", + "OpReturn", + "OpFunctionEnd" + // clang-format on + }; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + std::string assembly = JoinAllInsts(text); + auto result = SinglePassRunAndDisassemble( + assembly, /* skip_nop = */ true, /* do_validation = */ false); + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); + EXPECT_EQ(assembly, std::get<0>(result)); +} + +TEST_F(EliminateDeadFunctionsBasicTest, BasicKeepExportFunctions) { + // All functions are reachable. In particular, ExportedFunc and Constant are + // reachable because ExportedFunc is exported. Nothing should be removed. + const std::vector text = { + // clang-format off + "OpCapability Shader", + "OpCapability Linkage", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Fragment %main \"main\"", + "OpName %main \"main\"", + "OpName %ExportedFunc \"ExportedFunc\"", + "OpName %Live \"Live\"", + "OpDecorate %ExportedFunc LinkageAttributes \"ExportedFunc\" Export", + "%void = OpTypeVoid", + "%7 = OpTypeFunction %void", + "%main = OpFunction %void None %7", + "%15 = OpLabel", + "OpReturn", + "OpFunctionEnd", +"%ExportedFunc = OpFunction %void None %7", + "%19 = OpLabel", + "%16 = OpFunctionCall %void %Live", + "OpReturn", + "OpFunctionEnd", + "%Live = OpFunction %void None %7", + "%20 = OpLabel", + "OpReturn", + "OpFunctionEnd" + // clang-format on + }; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + std::string assembly = JoinAllInsts(text); + auto result = SinglePassRunAndDisassemble( + assembly, /* skip_nop = */ true, /* do_validation = */ false); + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); + EXPECT_EQ(assembly, std::get<0>(result)); +} + +TEST_F(EliminateDeadFunctionsBasicTest, BasicRemoveDecorationsAndNames) { + // We want to remove the names and decorations associated with results that + // are removed. This test will check for that. + const std::string text = R"( + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" + OpName %main "main" + OpName %Dead "Dead" + OpName %x "x" + OpName %y "y" + OpName %z "z" + OpDecorate %x RelaxedPrecision + OpDecorate %y RelaxedPrecision + OpDecorate %z RelaxedPrecision + OpDecorate %6 RelaxedPrecision + OpDecorate %7 RelaxedPrecision + OpDecorate %8 RelaxedPrecision + %void = OpTypeVoid + %10 = OpTypeFunction %void + %float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 + %main = OpFunction %void None %10 + %14 = OpLabel + OpReturn + OpFunctionEnd + %Dead = OpFunction %void None %10 + %15 = OpLabel + %x = OpVariable %_ptr_Function_float Function + %y = OpVariable %_ptr_Function_float Function + %z = OpVariable %_ptr_Function_float Function + OpStore %x %float_1 + OpStore %y %float_1 + %6 = OpLoad %float %x + %7 = OpLoad %float %y + %8 = OpFAdd %float %6 %7 + OpStore %z %8 + OpReturn + OpFunctionEnd)"; + + const std::string expected_output = R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %main "main" +OpName %main "main" +%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%float_1 = OpConstant %float 1 +%main = OpFunction %void None %10 +%14 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(text, expected_output, + /* skip_nop = */ true); +} +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/feature_manager_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/feature_manager_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/feature_manager_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/feature_manager_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,134 @@ +// Copyright (c) 2017 Google 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. + +#include +#include +#include + +#include "opt/build_module.h" +#include "opt/ir_context.h" + +using namespace spvtools; + +using FeatureManagerTest = ::testing::Test; + +TEST_F(FeatureManagerTest, MissingExtension) { + const std::string text = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + ASSERT_NE(context, nullptr); + + EXPECT_FALSE(context->get_feature_mgr()->HasExtension( + libspirv::Extension::kSPV_KHR_variable_pointers)); +} + +TEST_F(FeatureManagerTest, OneExtension) { + const std::string text = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpExtension "SPV_KHR_variable_pointers" + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + ASSERT_NE(context, nullptr); + + EXPECT_TRUE(context->get_feature_mgr()->HasExtension( + libspirv::Extension::kSPV_KHR_variable_pointers)); +} + +TEST_F(FeatureManagerTest, NotADifferentExtension) { + const std::string text = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpExtension "SPV_KHR_variable_pointers" + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + ASSERT_NE(context, nullptr); + + EXPECT_FALSE(context->get_feature_mgr()->HasExtension( + libspirv::Extension::kSPV_KHR_storage_buffer_storage_class)); +} + +TEST_F(FeatureManagerTest, TwoExtensions) { + const std::string text = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpExtension "SPV_KHR_variable_pointers" +OpExtension "SPV_KHR_storage_buffer_storage_class" + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + ASSERT_NE(context, nullptr); + + EXPECT_TRUE(context->get_feature_mgr()->HasExtension( + libspirv::Extension::kSPV_KHR_variable_pointers)); + EXPECT_TRUE(context->get_feature_mgr()->HasExtension( + libspirv::Extension::kSPV_KHR_storage_buffer_storage_class)); +} + +// Test capability checks. +TEST_F(FeatureManagerTest, ExplicitlyPresent1) { + const std::string text = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + ASSERT_NE(context, nullptr); + + EXPECT_TRUE(context->get_feature_mgr()->HasCapability(SpvCapabilityShader)); + EXPECT_FALSE(context->get_feature_mgr()->HasCapability(SpvCapabilityKernel)); +} + +TEST_F(FeatureManagerTest, ExplicitlyPresent2) { + const std::string text = R"( +OpCapability Kernel +OpMemoryModel Logical GLSL450 + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + ASSERT_NE(context, nullptr); + + EXPECT_FALSE(context->get_feature_mgr()->HasCapability(SpvCapabilityShader)); + EXPECT_TRUE(context->get_feature_mgr()->HasCapability(SpvCapabilityKernel)); +} + +TEST_F(FeatureManagerTest, ImplicitlyPresent) { + const std::string text = R"( +OpCapability Tessellation +OpMemoryModel Logical GLSL450 + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + ASSERT_NE(context, nullptr); + + // Check multiple levels of indirection. Tessellation implies Shader, which + // implies Matrix. + EXPECT_TRUE( + context->get_feature_mgr()->HasCapability(SpvCapabilityTessellation)); + EXPECT_TRUE(context->get_feature_mgr()->HasCapability(SpvCapabilityShader)); + EXPECT_TRUE(context->get_feature_mgr()->HasCapability(SpvCapabilityMatrix)); + EXPECT_FALSE(context->get_feature_mgr()->HasCapability(SpvCapabilityKernel)); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/flatten_decoration_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/flatten_decoration_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/flatten_decoration_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/flatten_decoration_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,234 @@ +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +// Returns the initial part of the assembly text for a valid +// SPIR-V module, including instructions prior to decorations. +std::string PreambleAssembly() { + return + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %hue %saturation %value +OpName %main "main" +OpName %void_fn "void_fn" +OpName %hue "hue" +OpName %saturation "saturation" +OpName %value "value" +OpName %entry "entry" +OpName %Point "Point" +OpName %Camera "Camera" +)"; +} + +// Retuns types +std::string TypesAndFunctionsAssembly() { + return + R"(%void = OpTypeVoid +%void_fn = OpTypeFunction %void +%float = OpTypeFloat 32 +%Point = OpTypeStruct %float %float %float +%Camera = OpTypeStruct %float %float +%_ptr_Input_float = OpTypePointer Input %float +%hue = OpVariable %_ptr_Input_float Input +%saturation = OpVariable %_ptr_Input_float Input +%value = OpVariable %_ptr_Input_float Input +%main = OpFunction %void None %void_fn +%entry = OpLabel +OpReturn +OpFunctionEnd +)"; +} + +struct FlattenDecorationCase { + // Names and decorations before the pass. + std::string input; + // Names and decorations after the pass. + std::string expected; +}; + +using FlattenDecorationTest = + PassTest<::testing::TestWithParam>; + +TEST_P(FlattenDecorationTest, TransformsDecorations) { + const auto before = + PreambleAssembly() + GetParam().input + TypesAndFunctionsAssembly(); + const auto after = + PreambleAssembly() + GetParam().expected + TypesAndFunctionsAssembly(); + + SinglePassRunAndCheck(before, after, false, true); +} + +INSTANTIATE_TEST_CASE_P(NoUses, FlattenDecorationTest, + ::testing::ValuesIn(std::vector{ + // No OpDecorationGroup + {"", ""}, + + // OpDecorationGroup without any uses, and + // no OpName. + {"%group = OpDecorationGroup\n", ""}, + + // OpDecorationGroup without any uses, and + // with OpName targeting it. Proves you must + // remove the names as well. + {"OpName %group \"group\"\n" + "%group = OpDecorationGroup\n", + ""}, + + // OpDecorationGroup with decorations that + // target it, but no uses in OpGroupDecorate + // or OpGroupMemberDecorate instructions. + {"OpDecorate %group Flat\n" + "OpDecorate %group NoPerspective\n" + "%group = OpDecorationGroup\n", + ""}, + }), ); + +INSTANTIATE_TEST_CASE_P(OpGroupDecorate, FlattenDecorationTest, + ::testing::ValuesIn(std::vector{ + // One OpGroupDecorate + {"OpName %group \"group\"\n" + "OpDecorate %group Flat\n" + "OpDecorate %group NoPerspective\n" + "%group = OpDecorationGroup\n" + "OpGroupDecorate %group %hue %saturation\n", + "OpDecorate %hue Flat\n" + "OpDecorate %saturation Flat\n" + "OpDecorate %hue NoPerspective\n" + "OpDecorate %saturation NoPerspective\n"}, + // Multiple OpGroupDecorate + {"OpName %group \"group\"\n" + "OpDecorate %group Flat\n" + "OpDecorate %group NoPerspective\n" + "%group = OpDecorationGroup\n" + "OpGroupDecorate %group %hue %value\n" + "OpGroupDecorate %group %saturation\n", + "OpDecorate %hue Flat\n" + "OpDecorate %value Flat\n" + "OpDecorate %saturation Flat\n" + "OpDecorate %hue NoPerspective\n" + "OpDecorate %value NoPerspective\n" + "OpDecorate %saturation NoPerspective\n"}, + // Two group decorations, interleaved + {"OpName %group0 \"group0\"\n" + "OpName %group1 \"group1\"\n" + "OpDecorate %group0 Flat\n" + "OpDecorate %group1 NoPerspective\n" + "%group0 = OpDecorationGroup\n" + "%group1 = OpDecorationGroup\n" + "OpGroupDecorate %group0 %hue %value\n" + "OpGroupDecorate %group1 %saturation\n", + "OpDecorate %hue Flat\n" + "OpDecorate %value Flat\n" + "OpDecorate %saturation NoPerspective\n"}, + // Decoration with operands + {"OpName %group \"group\"\n" + "OpDecorate %group Location 42\n" + "%group = OpDecorationGroup\n" + "OpGroupDecorate %group %hue %saturation\n", + "OpDecorate %hue Location 42\n" + "OpDecorate %saturation Location 42\n"}, + }), ); + +INSTANTIATE_TEST_CASE_P(OpGroupMemberDecorate, FlattenDecorationTest, + ::testing::ValuesIn(std::vector{ + // One OpGroupMemberDecorate + {"OpName %group \"group\"\n" + "OpDecorate %group Flat\n" + "OpDecorate %group Offset 16\n" + "%group = OpDecorationGroup\n" + "OpGroupMemberDecorate %group %Point 1\n", + "OpMemberDecorate %Point 1 Flat\n" + "OpMemberDecorate %Point 1 Offset 16\n"}, + // Multiple OpGroupMemberDecorate using the same + // decoration group. + {"OpName %group \"group\"\n" + "OpDecorate %group Flat\n" + "OpDecorate %group NoPerspective\n" + "OpDecorate %group Offset 8\n" + "%group = OpDecorationGroup\n" + "OpGroupMemberDecorate %group %Point 2\n" + "OpGroupMemberDecorate %group %Camera 1\n", + "OpMemberDecorate %Point 2 Flat\n" + "OpMemberDecorate %Camera 1 Flat\n" + "OpMemberDecorate %Point 2 NoPerspective\n" + "OpMemberDecorate %Camera 1 NoPerspective\n" + "OpMemberDecorate %Point 2 Offset 8\n" + "OpMemberDecorate %Camera 1 Offset 8\n"}, + // Two groups of member decorations, interleaved. + // Decoration is with and without operands. + {"OpName %group0 \"group0\"\n" + "OpName %group1 \"group1\"\n" + "OpDecorate %group0 Flat\n" + "OpDecorate %group0 Offset 8\n" + "OpDecorate %group1 NoPerspective\n" + "OpDecorate %group1 Offset 16\n" + "%group0 = OpDecorationGroup\n" + "%group1 = OpDecorationGroup\n" + "OpGroupMemberDecorate %group0 %Point 0\n" + "OpGroupMemberDecorate %group1 %Point 2\n", + "OpMemberDecorate %Point 0 Flat\n" + "OpMemberDecorate %Point 0 Offset 8\n" + "OpMemberDecorate %Point 2 NoPerspective\n" + "OpMemberDecorate %Point 2 Offset 16\n"}, + }), ); + +INSTANTIATE_TEST_CASE_P(UnrelatedDecorations, FlattenDecorationTest, + ::testing::ValuesIn(std::vector{ + // A non-group non-member decoration is untouched. + {"OpDecorate %hue Centroid\n" + "OpDecorate %saturation Flat\n", + "OpDecorate %hue Centroid\n" + "OpDecorate %saturation Flat\n"}, + // A non-group member decoration is untouched. + {"OpMemberDecorate %Point 0 Offset 0\n" + "OpMemberDecorate %Point 1 Offset 4\n" + "OpMemberDecorate %Point 1 Flat\n", + "OpMemberDecorate %Point 0 Offset 0\n" + "OpMemberDecorate %Point 1 Offset 4\n" + "OpMemberDecorate %Point 1 Flat\n"}, + // A non-group non-member decoration survives any + // replacement of group decorations. + {"OpName %group \"group\"\n" + "OpDecorate %group Flat\n" + "OpDecorate %hue Centroid\n" + "OpDecorate %group NoPerspective\n" + "%group = OpDecorationGroup\n" + "OpGroupDecorate %group %hue %saturation\n", + "OpDecorate %hue Flat\n" + "OpDecorate %saturation Flat\n" + "OpDecorate %hue Centroid\n" + "OpDecorate %hue NoPerspective\n" + "OpDecorate %saturation NoPerspective\n"}, + // A non-group member decoration survives any + // replacement of group decorations. + {"OpDecorate %group Offset 0\n" + "OpDecorate %group Flat\n" + "OpMemberDecorate %Point 1 Offset 4\n" + "%group = OpDecorationGroup\n" + "OpGroupMemberDecorate %group %Point 0\n", + "OpMemberDecorate %Point 0 Offset 0\n" + "OpMemberDecorate %Point 0 Flat\n" + "OpMemberDecorate %Point 1 Offset 4\n"}, + }), ); + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/fold_spec_const_op_composite_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/fold_spec_const_op_composite_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/fold_spec_const_op_composite_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/fold_spec_const_op_composite_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1389 @@ +// Copyright (c) 2016 Google 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. + +#include "assembly_builder.h" + +#include + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { +using namespace spvtools; + +using FoldSpecConstantOpAndCompositePassBasicTest = PassTest<::testing::Test>; + +TEST_F(FoldSpecConstantOpAndCompositePassBasicTest, Empty) { + SinglePassRunAndCheck( + "", "", /* skip_nop = */ true); +} + +// A test of the basic functionality of FoldSpecConstantOpAndCompositePass. +// A spec constant defined with an integer addition operation should be folded +// to a normal constant with fixed value. +TEST_F(FoldSpecConstantOpAndCompositePassBasicTest, Basic) { + AssemblyBuilder builder; + builder.AppendTypesConstantsGlobals({ + // clang-format off + "%int = OpTypeInt 32 1", + "%frozen_spec_const_int = OpConstant %int 1", + "%const_int = OpConstant %int 2", + // Folding target: + "%spec_add = OpSpecConstantOp %int IAdd %frozen_spec_const_int %const_int", + // clang-format on + }); + + std::vector expected = { + // clang-format off + "OpCapability Shader", + "OpCapability Float64", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Vertex %main \"main\"", + "OpName %void \"void\"", + "OpName %main_func_type \"main_func_type\"", + "OpName %main \"main\"", + "OpName %main_func_entry_block \"main_func_entry_block\"", + "OpName %int \"int\"", + "OpName %frozen_spec_const_int \"frozen_spec_const_int\"", + "OpName %const_int \"const_int\"", + "OpName %spec_add \"spec_add\"", + "%void = OpTypeVoid", + "%main_func_type = OpTypeFunction %void", + "%int = OpTypeInt 32 1", +"%frozen_spec_const_int = OpConstant %int 1", + "%const_int = OpConstant %int 2", + // The SpecConstantOp IAdd instruction should be replace by OpConstant + // instruction: + "%spec_add = OpConstant %int 3", + "%main = OpFunction %void None %main_func_type", +"%main_func_entry_block = OpLabel", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + SinglePassRunAndCheck( + builder.GetCode(), JoinAllInsts(expected), /* skip_nop = */ true); +} + +// A test of skipping folding an instruction when the instruction result type +// has decorations. +TEST_F(FoldSpecConstantOpAndCompositePassBasicTest, + SkipWhenTypeHasDecorations) { + AssemblyBuilder builder; + builder + .AppendAnnotations({ + // clang-format off + "OpDecorate %int RelaxedPrecision", + // clang-format on + }) + .AppendTypesConstantsGlobals({ + // clang-format off + "%int = OpTypeInt 32 1", + "%frozen_spec_const_int = OpConstant %int 1", + "%const_int = OpConstant %int 2", + // The following spec constant should not be folded as the result type + // has relaxed precision decoration. + "%spec_add = OpSpecConstantOp %int IAdd %frozen_spec_const_int %const_int", + // clang-format on + }); + + SinglePassRunAndCheck( + builder.GetCode(), builder.GetCode(), /* skip_nop = */ true); +} + +// All types and some common constants that are potentially required in +// FoldSpecConstantOpAndCompositeTest. +std::vector CommonTypesAndConstants() { + return std::vector{ + // clang-format off + // scalar types + "%bool = OpTypeBool", + "%uint = OpTypeInt 32 0", + "%int = OpTypeInt 32 1", + "%float = OpTypeFloat 32", + "%double = OpTypeFloat 64", + // vector types + "%v2bool = OpTypeVector %bool 2", + "%v2uint = OpTypeVector %uint 2", + "%v2int = OpTypeVector %int 2", + "%v3int = OpTypeVector %int 3", + "%v4int = OpTypeVector %int 4", + "%v2float = OpTypeVector %float 2", + "%v2double = OpTypeVector %double 2", + // variable pointer types + "%_pf_bool = OpTypePointer Function %bool", + "%_pf_uint = OpTypePointer Function %uint", + "%_pf_int = OpTypePointer Function %int", + "%_pf_float = OpTypePointer Function %float", + "%_pf_double = OpTypePointer Function %double", + "%_pf_v2int = OpTypePointer Function %v2int", + "%_pf_v2float = OpTypePointer Function %v2float", + "%_pf_v2double = OpTypePointer Function %v2double", + // struct types + "%inner_struct = OpTypeStruct %bool %int %float", + "%outer_struct = OpTypeStruct %inner_struct %int", + "%flat_struct = OpTypeStruct %bool %int %float", + + // common constants + // scalar constants: + "%bool_true = OpConstantTrue %bool", + "%bool_false = OpConstantFalse %bool", + "%bool_null = OpConstantNull %bool", + "%signed_zero = OpConstant %int 0", + "%unsigned_zero = OpConstant %uint 0", + "%signed_one = OpConstant %int 1", + "%unsigned_one = OpConstant %uint 1", + "%signed_two = OpConstant %int 2", + "%unsigned_two = OpConstant %uint 2", + "%signed_three = OpConstant %int 3", + "%unsigned_three = OpConstant %uint 3", + "%signed_null = OpConstantNull %int", + "%unsigned_null = OpConstantNull %uint", + // vector constants: + "%bool_true_vec = OpConstantComposite %v2bool %bool_true %bool_true", + "%bool_false_vec = OpConstantComposite %v2bool %bool_false %bool_false", + "%bool_null_vec = OpConstantNull %v2bool", + "%signed_zero_vec = OpConstantComposite %v2int %signed_zero %signed_zero", + "%unsigned_zero_vec = OpConstantComposite %v2uint %unsigned_zero %unsigned_zero", + "%signed_one_vec = OpConstantComposite %v2int %signed_one %signed_one", + "%unsigned_one_vec = OpConstantComposite %v2uint %unsigned_one %unsigned_one", + "%signed_two_vec = OpConstantComposite %v2int %signed_two %signed_two", + "%unsigned_two_vec = OpConstantComposite %v2uint %unsigned_two %unsigned_two", + "%signed_three_vec = OpConstantComposite %v2int %signed_three %signed_three", + "%unsigned_three_vec = OpConstantComposite %v2uint %unsigned_three %unsigned_three", + "%signed_null_vec = OpConstantNull %v2int", + "%unsigned_null_vec = OpConstantNull %v2uint", + "%v4int_0_1_2_3 = OpConstantComposite %v4int %signed_zero %signed_one %signed_two %signed_three", + // clang-format on + }; +} + +// A helper function to strip OpName instructions from the given string of +// disassembly code. Returns the string with all OpName instruction stripped. +std::string StripOpNameInstructions(const std::string& str) { + std::stringstream ss(str); + std::ostringstream oss; + std::string inst_str; + while (std::getline(ss, inst_str, '\n')) { + if (inst_str.find("OpName %") == std::string::npos) { + oss << inst_str << '\n'; + } + } + return oss.str(); +} + +struct FoldSpecConstantOpAndCompositePassTestCase { + // Original constants with unfolded spec constants. + std::vector original; + // Expected cosntants after folding. + std::vector expected; +}; + +using FoldSpecConstantOpAndCompositePassTest = PassTest< + ::testing::TestWithParam>; + +TEST_P(FoldSpecConstantOpAndCompositePassTest, ParamTestCase) { + AssemblyBuilder test_code_builder, expected_code_builder; + const auto& tc = GetParam(); + test_code_builder.AppendTypesConstantsGlobals(CommonTypesAndConstants()); + test_code_builder.AppendTypesConstantsGlobals(tc.original); + expected_code_builder.AppendTypesConstantsGlobals(CommonTypesAndConstants()); + expected_code_builder.AppendTypesConstantsGlobals(tc.expected); + const std::string original = test_code_builder.GetCode(); + const std::string expected = expected_code_builder.GetCode(); + + // Run the optimization and get the result code in disassembly. + std::string optimized; + auto status = opt::Pass::Status::SuccessWithoutChange; + std::tie(optimized, status) = + SinglePassRunAndDisassemble( + original, /* skip_nop = */ true, /* do_validation = */ false); + + // Check the optimized code, but ignore the OpName instructions. + EXPECT_NE(opt::Pass::Status::Failure, status); + EXPECT_EQ( + StripOpNameInstructions(expected) == StripOpNameInstructions(original), + status == opt::Pass::Status::SuccessWithoutChange); + EXPECT_EQ(StripOpNameInstructions(expected), + StripOpNameInstructions(optimized)); +} + +// Tests that OpSpecConstantComposite opcodes are replace with +// OpConstantComposite correctly. +INSTANTIATE_TEST_CASE_P( + Composite, FoldSpecConstantOpAndCompositePassTest, + ::testing::ValuesIn(std::vector< + FoldSpecConstantOpAndCompositePassTestCase>({ + // clang-format off + // normal vector + { + // original + { + "%spec_v2bool = OpSpecConstantComposite %v2bool %bool_true %bool_false", + "%spec_v2uint = OpSpecConstantComposite %v2uint %unsigned_one %unsigned_one", + "%spec_v2int_a = OpSpecConstantComposite %v2int %signed_one %signed_two", + // Spec constants whose value can not be fully resolved should + // not be processed. + "%spec_int = OpSpecConstant %int 99", + "%spec_v2int_b = OpSpecConstantComposite %v2int %signed_one %spec_int", + }, + // expected + { + "%spec_v2bool = OpConstantComposite %v2bool %bool_true %bool_false", + "%spec_v2uint = OpConstantComposite %v2uint %unsigned_one %unsigned_one", + "%spec_v2int_a = OpConstantComposite %v2int %signed_one %signed_two", + "%spec_int = OpSpecConstant %int 99", + "%spec_v2int_b = OpSpecConstantComposite %v2int %signed_one %spec_int", + }, + }, + // vector with null constants + { + // original + { + "%null_bool = OpConstantNull %bool", + "%null_int = OpConstantNull %int", + "%spec_v2bool = OpSpecConstantComposite %v2bool %null_bool %null_bool", + "%spec_v3int = OpSpecConstantComposite %v3int %null_int %null_int %null_int", + "%spec_v4int = OpSpecConstantComposite %v4int %null_int %null_int %null_int %null_int", + }, + // expected + { + "%null_bool = OpConstantNull %bool", + "%null_int = OpConstantNull %int", + "%spec_v2bool = OpConstantComposite %v2bool %null_bool %null_bool", + "%spec_v3int = OpConstantComposite %v3int %null_int %null_int %null_int", + "%spec_v4int = OpConstantComposite %v4int %null_int %null_int %null_int %null_int", + }, + }, + // flat struct + { + // original + { + "%float_1 = OpConstant %float 1", + "%flat_1 = OpSpecConstantComposite %flat_struct %bool_true %signed_null %float_1", + // following struct should not be folded as the value of + // %spec_float is not determined. + "%spec_float = OpSpecConstant %float 1", + "%flat_2 = OpSpecConstantComposite %flat_struct %bool_true %signed_one %spec_float", + }, + // expected + { + "%float_1 = OpConstant %float 1", + "%flat_1 = OpConstantComposite %flat_struct %bool_true %signed_null %float_1", + "%spec_float = OpSpecConstant %float 1", + "%flat_2 = OpSpecConstantComposite %flat_struct %bool_true %signed_one %spec_float", + } + }, + // nested struct + { + // original + { + "%float_1 = OpConstant %float 1", + "%inner_1 = OpSpecConstantComposite %inner_struct %bool_true %signed_null %float_1", + "%outer_1 = OpSpecConstantComposite %outer_struct %inner_1 %signed_one", + // following structs should not be folded as the value of + // %spec_float is not determined. + "%spec_float = OpSpecConstant %float 1", + "%inner_2 = OpSpecConstantComposite %inner_struct %bool_true %signed_null %spec_float", + "%outer_2 = OpSpecConstantComposite %outer_struct %inner_2 %signed_one", + }, + // expected + { + "%float_1 = OpConstant %float 1", + "%inner_1 = OpConstantComposite %inner_struct %bool_true %signed_null %float_1", + "%outer_1 = OpConstantComposite %outer_struct %inner_1 %signed_one", + "%spec_float = OpSpecConstant %float 1", + "%inner_2 = OpSpecConstantComposite %inner_struct %bool_true %signed_null %spec_float", + "%outer_2 = OpSpecConstantComposite %outer_struct %inner_2 %signed_one", + } + }, + // composite constants touched by OpUndef should be skipped + { + // original + { + "%undef = OpUndef %float", + "%inner = OpConstantComposite %inner_struct %bool_true %signed_one %undef", + "%outer = OpSpecConstantComposite %outer_struct %inner %signed_one", + }, + // expected + { + "%undef = OpUndef %float", + "%inner = OpConstantComposite %inner_struct %bool_true %signed_one %undef", + "%outer = OpSpecConstantComposite %outer_struct %inner %signed_one", + }, + } + // clang-format on + }))); + +// Tests for operations that resulting in different types. +INSTANTIATE_TEST_CASE_P( + Cast, FoldSpecConstantOpAndCompositePassTest, + ::testing::ValuesIn( + std::vector({ + // clang-format off + // int -> bool scalar + { + // original + { + "%spec_bool_t = OpSpecConstantOp %bool INotEqual %signed_three %signed_zero", + "%spec_bool_f = OpSpecConstantOp %bool INotEqual %signed_zero %signed_zero", + "%spec_bool_from_null = OpSpecConstantOp %bool INotEqual %signed_null %signed_zero", + }, + // expected + { + "%spec_bool_t = OpConstantTrue %bool", + "%spec_bool_f = OpConstantFalse %bool", + "%spec_bool_from_null = OpConstantFalse %bool", + }, + }, + + // uint -> bool scalar + { + // original + { + "%spec_bool_t = OpSpecConstantOp %bool INotEqual %unsigned_three %unsigned_zero", + "%spec_bool_f = OpSpecConstantOp %bool INotEqual %unsigned_zero %unsigned_zero", + "%spec_bool_from_null = OpSpecConstantOp %bool INotEqual %unsigned_null %unsigned_zero", + }, + // expected + { + "%spec_bool_t = OpConstantTrue %bool", + "%spec_bool_f = OpConstantFalse %bool", + "%spec_bool_from_null = OpConstantFalse %bool", + }, + }, + + // bool -> int scalar + { + // original + { + "%spec_int_one = OpSpecConstantOp %int Select %bool_true %signed_one %signed_zero", + "%spec_int_zero = OpSpecConstantOp %int Select %bool_false %signed_one %signed_zero", + "%spec_int_from_null = OpSpecConstantOp %int Select %bool_null %signed_one %signed_zero", + }, + // expected + { + "%spec_int_one = OpConstant %int 1", + "%spec_int_zero = OpConstant %int 0", + "%spec_int_from_null = OpConstant %int 0", + }, + }, + + // uint -> int scalar + { + // original + { + "%spec_int_one = OpSpecConstantOp %int IAdd %unsigned_one %signed_zero", + "%spec_int_zero = OpSpecConstantOp %int IAdd %unsigned_zero %signed_zero", + "%spec_int_from_null = OpSpecConstantOp %int IAdd %unsigned_null %unsigned_zero", + }, + // expected + { + "%spec_int_one = OpConstant %int 1", + "%spec_int_zero = OpConstant %int 0", + "%spec_int_from_null = OpConstant %int 0", + }, + }, + + // bool -> uint scalar + { + // original + { + "%spec_uint_one = OpSpecConstantOp %uint Select %bool_true %unsigned_one %unsigned_zero", + "%spec_uint_zero = OpSpecConstantOp %uint Select %bool_false %unsigned_one %unsigned_zero", + "%spec_uint_from_null = OpSpecConstantOp %uint Select %bool_null %unsigned_one %unsigned_zero", + }, + // expected + { + "%spec_uint_one = OpConstant %uint 1", + "%spec_uint_zero = OpConstant %uint 0", + "%spec_uint_from_null = OpConstant %uint 0", + }, + }, + + // int -> uint scalar + { + // original + { + "%spec_uint_one = OpSpecConstantOp %uint IAdd %signed_one %unsigned_zero", + "%spec_uint_zero = OpSpecConstantOp %uint IAdd %signed_zero %unsigned_zero", + "%spec_uint_from_null = OpSpecConstantOp %uint IAdd %signed_null %unsigned_zero", + }, + // expected + { + "%spec_uint_one = OpConstant %uint 1", + "%spec_uint_zero = OpConstant %uint 0", + "%spec_uint_from_null = OpConstant %uint 0", + }, + }, + + // int -> bool vector + { + // original + { + "%spec_bool_t_vec = OpSpecConstantOp %v2bool INotEqual %signed_three_vec %signed_zero_vec", + "%spec_bool_f_vec = OpSpecConstantOp %v2bool INotEqual %signed_zero_vec %signed_zero_vec", + "%spec_bool_from_null = OpSpecConstantOp %v2bool INotEqual %signed_null_vec %signed_zero_vec", + }, + // expected + { + "%true = OpConstantTrue %bool", + "%true_0 = OpConstantTrue %bool", + "%spec_bool_t_vec = OpConstantComposite %v2bool %true_0 %true_0", + "%false = OpConstantFalse %bool", + "%false_0 = OpConstantFalse %bool", + "%spec_bool_f_vec = OpConstantComposite %v2bool %false_0 %false_0", + "%false_1 = OpConstantFalse %bool", + "%false_2 = OpConstantFalse %bool", + "%spec_bool_from_null = OpConstantComposite %v2bool %false_2 %false_2", + }, + }, + + // uint -> bool vector + { + // original + { + "%spec_bool_t_vec = OpSpecConstantOp %v2bool INotEqual %unsigned_three_vec %unsigned_zero_vec", + "%spec_bool_f_vec = OpSpecConstantOp %v2bool INotEqual %unsigned_zero_vec %unsigned_zero_vec", + "%spec_bool_from_null = OpSpecConstantOp %v2bool INotEqual %unsigned_null_vec %unsigned_zero_vec", + }, + // expected + { + "%true = OpConstantTrue %bool", + "%true_0 = OpConstantTrue %bool", + "%spec_bool_t_vec = OpConstantComposite %v2bool %true_0 %true_0", + "%false = OpConstantFalse %bool", + "%false_0 = OpConstantFalse %bool", + "%spec_bool_f_vec = OpConstantComposite %v2bool %false_0 %false_0", + "%false_1 = OpConstantFalse %bool", + "%false_2 = OpConstantFalse %bool", + "%spec_bool_from_null = OpConstantComposite %v2bool %false_2 %false_2", + }, + }, + + // bool -> int vector + { + // original + { + "%spec_int_one_vec = OpSpecConstantOp %v2int Select %bool_true_vec %signed_one_vec %signed_zero_vec", + "%spec_int_zero_vec = OpSpecConstantOp %v2int Select %bool_false_vec %signed_one_vec %signed_zero_vec", + "%spec_int_from_null = OpSpecConstantOp %v2int Select %bool_null_vec %signed_one_vec %signed_zero_vec", + }, + // expected + { + "%int_1 = OpConstant %int 1", + "%int_1_0 = OpConstant %int 1", + "%spec_int_one_vec = OpConstantComposite %v2int %int_1_0 %int_1_0", + "%int_0 = OpConstant %int 0", + "%int_0_0 = OpConstant %int 0", + "%spec_int_zero_vec = OpConstantComposite %v2int %int_0_0 %int_0_0", + "%int_0_1 = OpConstant %int 0", + "%int_0_2 = OpConstant %int 0", + "%spec_int_from_null = OpConstantComposite %v2int %int_0_2 %int_0_2", + }, + }, + + // uint -> int vector + { + // original + { + "%spec_int_one_vec = OpSpecConstantOp %v2int IAdd %unsigned_one_vec %signed_zero_vec", + "%spec_int_zero_vec = OpSpecConstantOp %v2int IAdd %unsigned_zero_vec %signed_zero_vec", + "%spec_int_from_null = OpSpecConstantOp %v2int IAdd %unsigned_null_vec %signed_zero_vec", + }, + // expected + { + "%int_1 = OpConstant %int 1", + "%int_1_0 = OpConstant %int 1", + "%spec_int_one_vec = OpConstantComposite %v2int %int_1_0 %int_1_0", + "%int_0 = OpConstant %int 0", + "%int_0_0 = OpConstant %int 0", + "%spec_int_zero_vec = OpConstantComposite %v2int %int_0_0 %int_0_0", + "%int_0_1 = OpConstant %int 0", + "%int_0_2 = OpConstant %int 0", + "%spec_int_from_null = OpConstantComposite %v2int %int_0_2 %int_0_2", + }, + }, + + // bool -> uint vector + { + // original + { + "%spec_uint_one_vec = OpSpecConstantOp %v2uint Select %bool_true_vec %unsigned_one_vec %unsigned_zero_vec", + "%spec_uint_zero_vec = OpSpecConstantOp %v2uint Select %bool_false_vec %unsigned_one_vec %unsigned_zero_vec", + "%spec_uint_from_null = OpSpecConstantOp %v2uint Select %bool_null_vec %unsigned_one_vec %unsigned_zero_vec", + }, + // expected + { + "%uint_1 = OpConstant %uint 1", + "%uint_1_0 = OpConstant %uint 1", + "%spec_uint_one_vec = OpConstantComposite %v2uint %uint_1_0 %uint_1_0", + "%uint_0 = OpConstant %uint 0", + "%uint_0_0 = OpConstant %uint 0", + "%spec_uint_zero_vec = OpConstantComposite %v2uint %uint_0_0 %uint_0_0", + "%uint_0_1 = OpConstant %uint 0", + "%uint_0_2 = OpConstant %uint 0", + "%spec_uint_from_null = OpConstantComposite %v2uint %uint_0_2 %uint_0_2", + }, + }, + + // int -> uint vector + { + // original + { + "%spec_uint_one_vec = OpSpecConstantOp %v2uint IAdd %signed_one_vec %unsigned_zero_vec", + "%spec_uint_zero_vec = OpSpecConstantOp %v2uint IAdd %signed_zero_vec %unsigned_zero_vec", + "%spec_uint_from_null = OpSpecConstantOp %v2uint IAdd %signed_null_vec %unsigned_zero_vec", + }, + // expected + { + "%uint_1 = OpConstant %uint 1", + "%uint_1_0 = OpConstant %uint 1", + "%spec_uint_one_vec = OpConstantComposite %v2uint %uint_1_0 %uint_1_0", + "%uint_0 = OpConstant %uint 0", + "%uint_0_0 = OpConstant %uint 0", + "%spec_uint_zero_vec = OpConstantComposite %v2uint %uint_0_0 %uint_0_0", + "%uint_0_1 = OpConstant %uint 0", + "%uint_0_2 = OpConstant %uint 0", + "%spec_uint_from_null = OpConstantComposite %v2uint %uint_0_2 %uint_0_2", + }, + }, + // clang-format on + }))); + +// Tests about boolean scalar logical operations and comparison operations with +// scalar int/uint type. +INSTANTIATE_TEST_CASE_P( + Logical, FoldSpecConstantOpAndCompositePassTest, + ::testing::ValuesIn(std::vector< + FoldSpecConstantOpAndCompositePassTestCase>({ + // clang-format off + // scalar integer comparison + { + // original + { + "%int_minus_1 = OpConstant %int -1", + + "%slt_0_1 = OpSpecConstantOp %bool SLessThan %signed_zero %signed_one", + "%sgt_0_1 = OpSpecConstantOp %bool SGreaterThan %signed_zero %signed_one", + "%sle_2_2 = OpSpecConstantOp %bool SLessThanEqual %signed_two %signed_two", + "%sge_2_1 = OpSpecConstantOp %bool SGreaterThanEqual %signed_two %signed_one", + "%sge_2_null = OpSpecConstantOp %bool SGreaterThanEqual %signed_two %signed_null", + "%sge_minus_1_null = OpSpecConstantOp %bool SGreaterThanEqual %int_minus_1 %signed_null", + + "%ult_0_1 = OpSpecConstantOp %bool ULessThan %unsigned_zero %unsigned_one", + "%ugt_0_1 = OpSpecConstantOp %bool UGreaterThan %unsigned_zero %unsigned_one", + "%ule_2_3 = OpSpecConstantOp %bool ULessThanEqual %unsigned_two %unsigned_three", + "%uge_1_1 = OpSpecConstantOp %bool UGreaterThanEqual %unsigned_one %unsigned_one", + "%uge_2_null = OpSpecConstantOp %bool UGreaterThanEqual %unsigned_two %unsigned_null", + "%uge_minus_1_null = OpSpecConstantOp %bool UGreaterThanEqual %int_minus_1 %unsigned_null", + }, + // expected + { + "%int_minus_1 = OpConstant %int -1", + + "%slt_0_1 = OpConstantTrue %bool", + "%sgt_0_1 = OpConstantFalse %bool", + "%sle_2_2 = OpConstantTrue %bool", + "%sge_2_1 = OpConstantTrue %bool", + "%sge_2_null = OpConstantTrue %bool", + "%sge_minus_1_null = OpConstantFalse %bool", + + "%ult_0_1 = OpConstantTrue %bool", + "%ugt_0_1 = OpConstantFalse %bool", + "%ule_2_3 = OpConstantTrue %bool", + "%uge_1_1 = OpConstantTrue %bool", + "%uge_2_null = OpConstantTrue %bool", + "%uge_minus_1_null = OpConstantTrue %bool", + }, + }, + // Logical and, or, xor. + { + // original + { + "%logical_or = OpSpecConstantOp %bool LogicalOr %bool_true %bool_false", + "%logical_and = OpSpecConstantOp %bool LogicalAnd %bool_true %bool_false", + "%logical_not = OpSpecConstantOp %bool LogicalNot %bool_true", + "%logical_eq = OpSpecConstantOp %bool LogicalEqual %bool_true %bool_true", + "%logical_neq = OpSpecConstantOp %bool LogicalNotEqual %bool_true %bool_true", + "%logical_and_null = OpSpecConstantOp %bool LogicalAnd %bool_true %bool_null", + }, + // expected + { + "%logical_or = OpConstantTrue %bool", + "%logical_and = OpConstantFalse %bool", + "%logical_not = OpConstantFalse %bool", + "%logical_eq = OpConstantTrue %bool", + "%logical_neq = OpConstantFalse %bool", + "%logical_and_null = OpConstantFalse %bool", + }, + }, + // clang-format on + }))); + +// Tests about arithmetic operations for scalar int and uint types. +INSTANTIATE_TEST_CASE_P( + ScalarArithmetic, FoldSpecConstantOpAndCompositePassTest, + ::testing::ValuesIn(std::vector< + FoldSpecConstantOpAndCompositePassTestCase>({ + // clang-format off + // scalar integer negate + { + // original + { + "%int_minus_1 = OpSpecConstantOp %int SNegate %signed_one", + "%int_minus_2 = OpSpecConstantOp %int SNegate %signed_two", + "%int_neg_null = OpSpecConstantOp %int SNegate %signed_null", + "%int_max = OpConstant %int 2147483647", + "%int_neg_max = OpSpecConstantOp %int SNegate %int_max", + }, + // expected + { + "%int_minus_1 = OpConstant %int -1", + "%int_minus_2 = OpConstant %int -2", + "%int_neg_null = OpConstant %int 0", + "%int_max = OpConstant %int 2147483647", + "%int_neg_max = OpConstant %int -2147483647", + }, + }, + // scalar integer not + { + // original + { + "%uint_4294967294 = OpSpecConstantOp %uint Not %unsigned_one", + "%uint_4294967293 = OpSpecConstantOp %uint Not %unsigned_two", + "%uint_neg_null = OpSpecConstantOp %uint Not %unsigned_null", + }, + // expected + { + "%uint_4294967294 = OpConstant %uint 4294967294", + "%uint_4294967293 = OpConstant %uint 4294967293", + "%uint_neg_null = OpConstant %uint 4294967295", + }, + }, + // scalar integer add, sub, mul, div + { + // original + { + "%signed_max = OpConstant %int 2147483647", + "%signed_min = OpConstant %int -2147483648", + + "%spec_int_iadd = OpSpecConstantOp %int IAdd %signed_three %signed_two", + "%spec_int_isub = OpSpecConstantOp %int ISub %signed_one %spec_int_iadd", + "%spec_int_sdiv = OpSpecConstantOp %int SDiv %spec_int_isub %signed_two", + "%spec_int_imul = OpSpecConstantOp %int IMul %spec_int_sdiv %signed_three", + "%spec_int_iadd_null = OpSpecConstantOp %int IAdd %spec_int_imul %signed_null", + "%spec_int_imul_null = OpSpecConstantOp %int IMul %spec_int_iadd_null %signed_null", + "%spec_int_iadd_overflow = OpSpecConstantOp %int IAdd %signed_max %signed_three", + "%spec_int_isub_overflow = OpSpecConstantOp %int ISub %signed_min %signed_three", + + "%spec_uint_iadd = OpSpecConstantOp %uint IAdd %unsigned_three %unsigned_two", + "%spec_uint_isub = OpSpecConstantOp %uint ISub %unsigned_one %spec_uint_iadd", + "%spec_uint_udiv = OpSpecConstantOp %uint UDiv %spec_uint_isub %unsigned_three", + "%spec_uint_imul = OpSpecConstantOp %uint IMul %spec_uint_udiv %unsigned_two", + "%spec_uint_isub_null = OpSpecConstantOp %uint ISub %spec_uint_imul %signed_null", + }, + // expected + { + "%signed_max = OpConstant %int 2147483647", + "%signed_min = OpConstant %int -2147483648", + + "%spec_int_iadd = OpConstant %int 5", + "%spec_int_isub = OpConstant %int -4", + "%spec_int_sdiv = OpConstant %int -2", + "%spec_int_imul = OpConstant %int -6", + "%spec_int_iadd_null = OpConstant %int -6", + "%spec_int_imul_null = OpConstant %int 0", + "%spec_int_iadd_overflow = OpConstant %int -2147483646", + "%spec_int_isub_overflow = OpConstant %int 2147483645", + + "%spec_uint_iadd = OpConstant %uint 5", + "%spec_uint_isub = OpConstant %uint 4294967292", + "%spec_uint_udiv = OpConstant %uint 1431655764", + "%spec_uint_imul = OpConstant %uint 2863311528", + "%spec_uint_isub_null = OpConstant %uint 2863311528", + }, + }, + // scalar integer rem, mod + { + // original + { + // common constants + "%int_7 = OpConstant %int 7", + "%uint_7 = OpConstant %uint 7", + "%int_minus_7 = OpConstant %int -7", + "%int_minus_3 = OpConstant %int -3", + + // srem + "%7_srem_3 = OpSpecConstantOp %int SRem %int_7 %signed_three", + "%minus_7_srem_3 = OpSpecConstantOp %int SRem %int_minus_7 %signed_three", + "%7_srem_minus_3 = OpSpecConstantOp %int SRem %int_7 %int_minus_3", + "%minus_7_srem_minus_3 = OpSpecConstantOp %int SRem %int_minus_7 %int_minus_3", + // smod + "%7_smod_3 = OpSpecConstantOp %int SMod %int_7 %signed_three", + "%minus_7_smod_3 = OpSpecConstantOp %int SMod %int_minus_7 %signed_three", + "%7_smod_minus_3 = OpSpecConstantOp %int SMod %int_7 %int_minus_3", + "%minus_7_smod_minus_3 = OpSpecConstantOp %int SMod %int_minus_7 %int_minus_3", + // umod + "%7_umod_3 = OpSpecConstantOp %uint UMod %uint_7 %unsigned_three", + // null constant + "%null_srem_3 = OpSpecConstantOp %int SRem %signed_null %signed_three", + "%null_smod_3 = OpSpecConstantOp %int SMod %signed_null %signed_three", + "%null_umod_3 = OpSpecConstantOp %uint UMod %unsigned_null %unsigned_three", + }, + // expected + { + // common constants + "%int_7 = OpConstant %int 7", + "%uint_7 = OpConstant %uint 7", + "%int_minus_7 = OpConstant %int -7", + "%int_minus_3 = OpConstant %int -3", + + // srem + "%7_srem_3 = OpConstant %int 1", + "%minus_7_srem_3 = OpConstant %int -1", + "%7_srem_minus_3 = OpConstant %int 1", + "%minus_7_srem_minus_3 = OpConstant %int -1", + // smod + "%7_smod_3 = OpConstant %int 1", + "%minus_7_smod_3 = OpConstant %int 2", + "%7_smod_minus_3 = OpConstant %int -2", + "%minus_7_smod_minus_3 = OpConstant %int -1", + // umod + "%7_umod_3 = OpConstant %uint 1", + // null constant + "%null_srem_3 = OpConstant %int 0", + "%null_smod_3 = OpConstant %int 0", + "%null_umod_3 = OpConstant %uint 0", + }, + }, + // scalar integer bitwise and shift + { + // original + { + // bitwise + "%xor_1_3 = OpSpecConstantOp %int BitwiseXor %signed_one %signed_three", + "%and_1_2 = OpSpecConstantOp %int BitwiseAnd %signed_one %xor_1_3", + "%or_1_2 = OpSpecConstantOp %int BitwiseOr %signed_one %xor_1_3", + "%xor_3_null = OpSpecConstantOp %int BitwiseXor %or_1_2 %signed_null", + + // shift + "%unsigned_31 = OpConstant %uint 31", + "%unsigned_left_shift_max = OpSpecConstantOp %uint ShiftLeftLogical %unsigned_one %unsigned_31", + "%unsigned_right_shift_logical = OpSpecConstantOp %uint ShiftRightLogical %unsigned_left_shift_max %unsigned_31", + "%signed_right_shift_arithmetic = OpSpecConstantOp %int ShiftRightArithmetic %unsigned_left_shift_max %unsigned_31", + "%left_shift_null_31 = OpSpecConstantOp %uint ShiftLeftLogical %unsigned_null %unsigned_31", + "%right_shift_31_null = OpSpecConstantOp %uint ShiftRightLogical %unsigned_31 %unsigned_null", + }, + // expected + { + "%xor_1_3 = OpConstant %int 2", + "%and_1_2 = OpConstant %int 0", + "%or_1_2 = OpConstant %int 3", + "%xor_3_null = OpConstant %int 3", + + "%unsigned_31 = OpConstant %uint 31", + "%unsigned_left_shift_max = OpConstant %uint 2147483648", + "%unsigned_right_shift_logical = OpConstant %uint 1", + "%signed_right_shift_arithmetic = OpConstant %int -1", + "%left_shift_null_31 = OpConstant %uint 0", + "%right_shift_31_null = OpConstant %uint 31", + }, + }, + // Skip folding if any operands have undetermined value. + { + // original + { + "%spec_int = OpSpecConstant %int 1", + "%spec_iadd = OpSpecConstantOp %int IAdd %signed_three %spec_int", + }, + // expected + { + "%spec_int = OpSpecConstant %int 1", + "%spec_iadd = OpSpecConstantOp %int IAdd %signed_three %spec_int", + }, + }, + // clang-format on + }))); + +// Tests about arithmetic operations for vector int and uint types. +INSTANTIATE_TEST_CASE_P( + VectorArithmetic, FoldSpecConstantOpAndCompositePassTest, + ::testing::ValuesIn(std::vector< + FoldSpecConstantOpAndCompositePassTestCase>({ + // clang-format off + // vector integer negate + { + // original + { + "%v2int_minus_1 = OpSpecConstantOp %v2int SNegate %signed_one_vec", + "%v2int_minus_2 = OpSpecConstantOp %v2int SNegate %signed_two_vec", + "%v2int_neg_null = OpSpecConstantOp %v2int SNegate %signed_null_vec", + }, + // expected + { + "%int_n1 = OpConstant %int -1", + "%int_n1_0 = OpConstant %int -1", + "%v2int_minus_1 = OpConstantComposite %v2int %int_n1_0 %int_n1_0", + "%int_n2 = OpConstant %int -2", + "%int_n2_0 = OpConstant %int -2", + "%v2int_minus_2 = OpConstantComposite %v2int %int_n2_0 %int_n2_0", + "%int_0 = OpConstant %int 0", + "%int_0_0 = OpConstant %int 0", + "%v2int_neg_null = OpConstantComposite %v2int %int_0_0 %int_0_0", + }, + }, + // vector integer (including null vetors) add, sub, div, mul + { + // original + { + "%spec_v2int_iadd = OpSpecConstantOp %v2int IAdd %signed_three_vec %signed_two_vec", + "%spec_v2int_isub = OpSpecConstantOp %v2int ISub %signed_one_vec %spec_v2int_iadd", + "%spec_v2int_sdiv = OpSpecConstantOp %v2int SDiv %spec_v2int_isub %signed_two_vec", + "%spec_v2int_imul = OpSpecConstantOp %v2int IMul %spec_v2int_sdiv %signed_three_vec", + "%spec_v2int_iadd_null = OpSpecConstantOp %v2int IAdd %spec_v2int_imul %signed_null_vec", + + "%spec_v2uint_iadd = OpSpecConstantOp %v2uint IAdd %unsigned_three_vec %unsigned_two_vec", + "%spec_v2uint_isub = OpSpecConstantOp %v2uint ISub %unsigned_one_vec %spec_v2uint_iadd", + "%spec_v2uint_udiv = OpSpecConstantOp %v2uint UDiv %spec_v2uint_isub %unsigned_three_vec", + "%spec_v2uint_imul = OpSpecConstantOp %v2uint IMul %spec_v2uint_udiv %unsigned_two_vec", + "%spec_v2uint_isub_null = OpSpecConstantOp %v2uint ISub %spec_v2uint_imul %signed_null_vec", + }, + // expected + { + "%int_5 = OpConstant %int 5", + "%int_5_0 = OpConstant %int 5", + "%spec_v2int_iadd = OpConstantComposite %v2int %int_5_0 %int_5_0", + "%int_n4 = OpConstant %int -4", + "%int_n4_0 = OpConstant %int -4", + "%spec_v2int_isub = OpConstantComposite %v2int %int_n4_0 %int_n4_0", + "%int_n2 = OpConstant %int -2", + "%int_n2_0 = OpConstant %int -2", + "%spec_v2int_sdiv = OpConstantComposite %v2int %int_n2_0 %int_n2_0", + "%int_n6 = OpConstant %int -6", + "%int_n6_0 = OpConstant %int -6", + "%spec_v2int_imul = OpConstantComposite %v2int %int_n6_0 %int_n6_0", + "%int_n6_1 = OpConstant %int -6", + "%int_n6_2 = OpConstant %int -6", + "%spec_v2int_iadd_null = OpConstantComposite %v2int %int_n6_2 %int_n6_2", + + "%uint_5 = OpConstant %uint 5", + "%uint_5_0 = OpConstant %uint 5", + "%spec_v2uint_iadd = OpConstantComposite %v2uint %uint_5_0 %uint_5_0", + "%uint_4294967292 = OpConstant %uint 4294967292", + "%uint_4294967292_0 = OpConstant %uint 4294967292", + "%spec_v2uint_isub = OpConstantComposite %v2uint %uint_4294967292_0 %uint_4294967292_0", + "%uint_1431655764 = OpConstant %uint 1431655764", + "%uint_1431655764_0 = OpConstant %uint 1431655764", + "%spec_v2uint_udiv = OpConstantComposite %v2uint %uint_1431655764_0 %uint_1431655764_0", + "%uint_2863311528 = OpConstant %uint 2863311528", + "%uint_2863311528_0 = OpConstant %uint 2863311528", + "%spec_v2uint_imul = OpConstantComposite %v2uint %uint_2863311528_0 %uint_2863311528_0", + "%uint_2863311528_1 = OpConstant %uint 2863311528", + "%uint_2863311528_2 = OpConstant %uint 2863311528", + "%spec_v2uint_isub_null = OpConstantComposite %v2uint %uint_2863311528_2 %uint_2863311528_2", + }, + }, + // vector integer rem, mod + { + // original + { + // common constants + "%int_7 = OpConstant %int 7", + "%v2int_7 = OpConstantComposite %v2int %int_7 %int_7", + "%uint_7 = OpConstant %uint 7", + "%v2uint_7 = OpConstantComposite %v2uint %uint_7 %uint_7", + "%int_minus_7 = OpConstant %int -7", + "%v2int_minus_7 = OpConstantComposite %v2int %int_minus_7 %int_minus_7", + "%int_minus_3 = OpConstant %int -3", + "%v2int_minus_3 = OpConstantComposite %v2int %int_minus_3 %int_minus_3", + + // srem + "%7_srem_3 = OpSpecConstantOp %v2int SRem %v2int_7 %signed_three_vec", + "%minus_7_srem_3 = OpSpecConstantOp %v2int SRem %v2int_minus_7 %signed_three_vec", + "%7_srem_minus_3 = OpSpecConstantOp %v2int SRem %v2int_7 %v2int_minus_3", + "%minus_7_srem_minus_3 = OpSpecConstantOp %v2int SRem %v2int_minus_7 %v2int_minus_3", + // smod + "%7_smod_3 = OpSpecConstantOp %v2int SMod %v2int_7 %signed_three_vec", + "%minus_7_smod_3 = OpSpecConstantOp %v2int SMod %v2int_minus_7 %signed_three_vec", + "%7_smod_minus_3 = OpSpecConstantOp %v2int SMod %v2int_7 %v2int_minus_3", + "%minus_7_smod_minus_3 = OpSpecConstantOp %v2int SMod %v2int_minus_7 %v2int_minus_3", + // umod + "%7_umod_3 = OpSpecConstantOp %v2uint UMod %v2uint_7 %unsigned_three_vec", + }, + // expected + { + // common constants + "%int_7 = OpConstant %int 7", + "%v2int_7 = OpConstantComposite %v2int %int_7 %int_7", + "%uint_7 = OpConstant %uint 7", + "%v2uint_7 = OpConstantComposite %v2uint %uint_7 %uint_7", + "%int_minus_7 = OpConstant %int -7", + "%v2int_minus_7 = OpConstantComposite %v2int %int_minus_7 %int_minus_7", + "%int_minus_3 = OpConstant %int -3", + "%v2int_minus_3 = OpConstantComposite %v2int %int_minus_3 %int_minus_3", + + // srem + "%int_1 = OpConstant %int 1", + "%int_1_0 = OpConstant %int 1", + "%7_srem_3 = OpConstantComposite %v2int %int_1_0 %int_1_0", + "%int_n1 = OpConstant %int -1", + "%int_n1_0 = OpConstant %int -1", + "%minus_7_srem_3 = OpConstantComposite %v2int %int_n1_0 %int_n1_0", + "%int_1_1 = OpConstant %int 1", + "%int_1_2 = OpConstant %int 1", + "%7_srem_minus_3 = OpConstantComposite %v2int %int_1_2 %int_1_2", + "%int_n1_1 = OpConstant %int -1", + "%int_n1_2 = OpConstant %int -1", + "%minus_7_srem_minus_3 = OpConstantComposite %v2int %int_n1_2 %int_n1_2", + // smod + "%int_1_3 = OpConstant %int 1", + "%int_1_4 = OpConstant %int 1", + "%7_smod_3 = OpConstantComposite %v2int %int_1_4 %int_1_4", + "%int_2 = OpConstant %int 2", + "%int_2_0 = OpConstant %int 2", + "%minus_7_smod_3 = OpConstantComposite %v2int %int_2_0 %int_2_0", + "%int_n2 = OpConstant %int -2", + "%int_n2_0 = OpConstant %int -2", + "%7_smod_minus_3 = OpConstantComposite %v2int %int_n2_0 %int_n2_0", + "%int_n1_3 = OpConstant %int -1", + "%int_n1_4 = OpConstant %int -1", + "%minus_7_smod_minus_3 = OpConstantComposite %v2int %int_n1_4 %int_n1_4", + // umod + "%uint_1 = OpConstant %uint 1", + "%uint_1_0 = OpConstant %uint 1", + "%7_umod_3 = OpConstantComposite %v2uint %uint_1_0 %uint_1_0", + }, + }, + // vector integer bitwise, shift + { + // original + { + "%xor_1_3 = OpSpecConstantOp %v2int BitwiseXor %signed_one_vec %signed_three_vec", + "%and_1_2 = OpSpecConstantOp %v2int BitwiseAnd %signed_one_vec %xor_1_3", + "%or_1_2 = OpSpecConstantOp %v2int BitwiseOr %signed_one_vec %xor_1_3", + + "%unsigned_31 = OpConstant %uint 31", + "%v2unsigned_31 = OpConstantComposite %v2uint %unsigned_31 %unsigned_31", + "%unsigned_left_shift_max = OpSpecConstantOp %v2uint ShiftLeftLogical %unsigned_one_vec %v2unsigned_31", + "%unsigned_right_shift_logical = OpSpecConstantOp %v2uint ShiftRightLogical %unsigned_left_shift_max %v2unsigned_31", + "%signed_right_shift_arithmetic = OpSpecConstantOp %v2int ShiftRightArithmetic %unsigned_left_shift_max %v2unsigned_31", + }, + // expected + { + "%int_2 = OpConstant %int 2", + "%int_2_0 = OpConstant %int 2", + "%xor_1_3 = OpConstantComposite %v2int %int_2_0 %int_2_0", + "%int_0 = OpConstant %int 0", + "%int_0_0 = OpConstant %int 0", + "%and_1_2 = OpConstantComposite %v2int %int_0_0 %int_0_0", + "%int_3 = OpConstant %int 3", + "%int_3_0 = OpConstant %int 3", + "%or_1_2 = OpConstantComposite %v2int %int_3_0 %int_3_0", + + "%unsigned_31 = OpConstant %uint 31", + "%v2unsigned_31 = OpConstantComposite %v2uint %unsigned_31 %unsigned_31", + "%uint_2147483648 = OpConstant %uint 2147483648", + "%uint_2147483648_0 = OpConstant %uint 2147483648", + "%unsigned_left_shift_max = OpConstantComposite %v2uint %uint_2147483648_0 %uint_2147483648_0", + "%uint_1 = OpConstant %uint 1", + "%uint_1_0 = OpConstant %uint 1", + "%unsigned_right_shift_logical = OpConstantComposite %v2uint %uint_1_0 %uint_1_0", + "%int_n1 = OpConstant %int -1", + "%int_n1_0 = OpConstant %int -1", + "%signed_right_shift_arithmetic = OpConstantComposite %v2int %int_n1_0 %int_n1_0", + }, + }, + // Skip folding if any vector operands or components of the operands + // have undetermined value. + { + // original + { + "%spec_int = OpSpecConstant %int 1", + "%spec_vec = OpSpecConstantComposite %v2int %signed_zero %spec_int", + "%spec_iadd = OpSpecConstantOp %v2int IAdd %signed_three_vec %spec_vec", + }, + // expected + { + "%spec_int = OpSpecConstant %int 1", + "%spec_vec = OpSpecConstantComposite %v2int %signed_zero %spec_int", + "%spec_iadd = OpSpecConstantOp %v2int IAdd %signed_three_vec %spec_vec", + }, + }, + // Skip folding if any vector operands are defined by OpUndef + { + // original + { + "%undef = OpUndef %int", + "%vec = OpConstantComposite %v2int %undef %signed_one", + "%spec_iadd = OpSpecConstantOp %v2int IAdd %signed_three_vec %vec", + }, + // expected + { + "%undef = OpUndef %int", + "%vec = OpConstantComposite %v2int %undef %signed_one", + "%spec_iadd = OpSpecConstantOp %v2int IAdd %signed_three_vec %vec", + }, + }, + // clang-format on + }))); + +// Tests for SpecConstantOp CompositeExtract instruction +INSTANTIATE_TEST_CASE_P( + CompositeExtract, FoldSpecConstantOpAndCompositePassTest, + ::testing::ValuesIn(std::vector< + FoldSpecConstantOpAndCompositePassTestCase>({ + // clang-format off + // normal vector + { + // original + { + "%r = OpSpecConstantOp %int CompositeExtract %signed_three_vec 0", + "%x = OpSpecConstantOp %int CompositeExtract %v4int_0_1_2_3 0", + "%y = OpSpecConstantOp %int CompositeExtract %v4int_0_1_2_3 1", + "%z = OpSpecConstantOp %int CompositeExtract %v4int_0_1_2_3 2", + "%w = OpSpecConstantOp %int CompositeExtract %v4int_0_1_2_3 3", + }, + // expected + { + "%r = OpConstant %int 3", + "%x = OpConstant %int 0", + "%y = OpConstant %int 1", + "%z = OpConstant %int 2", + "%w = OpConstant %int 3", + }, + }, + // null vector + { + // original + { + "%x = OpSpecConstantOp %int CompositeExtract %signed_null_vec 0", + "%y = OpSpecConstantOp %int CompositeExtract %signed_null_vec 1", + "%null_v4int = OpConstantNull %v4int", + "%z = OpSpecConstantOp %int CompositeExtract %signed_null_vec 2", + }, + // expected + { + "%x = OpConstantNull %int", + "%y = OpConstantNull %int", + "%null_v4int = OpConstantNull %v4int", + "%z = OpConstantNull %int", + } + }, + // normal flat struct + { + // original + { + "%float_1 = OpConstant %float 1", + "%flat_1 = OpConstantComposite %flat_struct %bool_true %signed_null %float_1", + "%extract_bool = OpSpecConstantOp %bool CompositeExtract %flat_1 0", + "%extract_int = OpSpecConstantOp %int CompositeExtract %flat_1 1", + "%extract_float_1 = OpSpecConstantOp %float CompositeExtract %flat_1 2", + // foldable composite constants built with OpSpecConstantComposite + // should also be processed. + "%flat_2 = OpSpecConstantComposite %flat_struct %bool_true %signed_null %float_1", + "%extract_float_2 = OpSpecConstantOp %float CompositeExtract %flat_2 2", + }, + // expected + { + "%float_1 = OpConstant %float 1", + "%flat_1 = OpConstantComposite %flat_struct %bool_true %signed_null %float_1", + "%extract_bool = OpConstantTrue %bool", + "%extract_int = OpConstantNull %int", + "%extract_float_1 = OpConstant %float 1", + "%flat_2 = OpConstantComposite %flat_struct %bool_true %signed_null %float_1", + "%extract_float_2 = OpConstant %float 1", + }, + }, + // null flat struct + { + // original + { + "%flat = OpConstantNull %flat_struct", + "%extract_bool = OpSpecConstantOp %bool CompositeExtract %flat 0", + "%extract_int = OpSpecConstantOp %int CompositeExtract %flat 1", + "%extract_float = OpSpecConstantOp %float CompositeExtract %flat 2", + }, + // expected + { + "%flat = OpConstantNull %flat_struct", + "%extract_bool = OpConstantNull %bool", + "%extract_int = OpConstantNull %int", + "%extract_float = OpConstantNull %float", + }, + }, + // normal nested struct + { + // original + { + "%float_1 = OpConstant %float 1", + "%inner = OpConstantComposite %inner_struct %bool_true %signed_null %float_1", + "%outer = OpConstantComposite %outer_struct %inner %signed_one", + "%extract_inner = OpSpecConstantOp %inner_struct CompositeExtract %outer 0", + "%extract_int = OpSpecConstantOp %int CompositeExtract %outer 1", + "%extract_inner_float = OpSpecConstantOp %int CompositeExtract %outer 0 2", + }, + // expected + { + "%float_1 = OpConstant %float 1", + "%inner = OpConstantComposite %inner_struct %bool_true %signed_null %float_1", + "%outer = OpConstantComposite %outer_struct %inner %signed_one", + "%extract_inner = OpConstantComposite %flat_struct %bool_true %signed_null %float_1", + "%extract_int = OpConstant %int 1", + "%extract_inner_float = OpConstant %float 1", + }, + }, + // null nested struct + { + // original + { + "%outer = OpConstantNull %outer_struct", + "%extract_inner = OpSpecConstantOp %inner_struct CompositeExtract %outer 0", + "%extract_int = OpSpecConstantOp %int CompositeExtract %outer 1", + "%extract_inner_float = OpSpecConstantOp %float CompositeExtract %outer 0 2", + }, + // expected + { + "%outer = OpConstantNull %outer_struct", + "%extract_inner = OpConstantNull %inner_struct", + "%extract_int = OpConstantNull %int", + "%extract_inner_float = OpConstantNull %float", + }, + }, + // skip folding if the any composite constant's value are not fully + // determined, even though the extracting target might have + // determined value. + { + // original + { + "%float_1 = OpConstant %float 1", + "%spec_float = OpSpecConstant %float 1", + "%spec_inner = OpSpecConstantComposite %inner_struct %bool_true %signed_null %spec_float", + "%spec_outer = OpSpecConstantComposite %outer_struct %spec_inner %signed_one", + "%spec_vec = OpSpecConstantComposite %v2float %spec_float %float_1", + "%extract_inner = OpSpecConstantOp %int CompositeExtract %spec_inner 1", + "%extract_outer = OpSpecConstantOp %int CompositeExtract %spec_outer 1", + "%extract_vec = OpSpecConstantOp %float CompositeExtract %spec_vec 1", + }, + // expected + { + "%float_1 = OpConstant %float 1", + "%spec_float = OpSpecConstant %float 1", + "%spec_inner = OpSpecConstantComposite %inner_struct %bool_true %signed_null %spec_float", + "%spec_outer = OpSpecConstantComposite %outer_struct %spec_inner %signed_one", + "%spec_vec = OpSpecConstantComposite %v2float %spec_float %float_1", + "%extract_inner = OpSpecConstantOp %int CompositeExtract %spec_inner 1", + "%extract_outer = OpSpecConstantOp %int CompositeExtract %spec_outer 1", + "%extract_vec = OpSpecConstantOp %float CompositeExtract %spec_vec 1", + }, + }, + // skip if the composite constant depends on the result of OpUndef, + // even though the composite extract target element does not depends + // on the OpUndef. + { + // original + { + "%undef = OpUndef %float", + "%inner = OpConstantComposite %inner_struct %bool_true %signed_one %undef", + "%outer = OpConstantComposite %outer_struct %inner %signed_one", + "%extract_inner = OpSpecConstantOp %int CompositeExtract %inner 1", + "%extract_outer = OpSpecConstantOp %int CompositeExtract %outer 1", + }, + // expected + { + "%undef = OpUndef %float", + "%inner = OpConstantComposite %inner_struct %bool_true %signed_one %undef", + "%outer = OpConstantComposite %outer_struct %inner %signed_one", + "%extract_inner = OpSpecConstantOp %int CompositeExtract %inner 1", + "%extract_outer = OpSpecConstantOp %int CompositeExtract %outer 1", + }, + }, + // TODO(qining): Add tests for Array and other composite type constants. + // clang-format on + }))); + +// Tests the swizzle operations for spec const vectors. +INSTANTIATE_TEST_CASE_P( + VectorShuffle, FoldSpecConstantOpAndCompositePassTest, + ::testing::ValuesIn(std::vector< + FoldSpecConstantOpAndCompositePassTestCase>({ + // clang-format off + // normal vector + { + // original + { + "%xy = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %v4int_0_1_2_3 0 1", + "%yz = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %v4int_0_1_2_3 1 2", + "%zw = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %v4int_0_1_2_3 2 3", + "%wx = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %v4int_0_1_2_3 3 0", + "%xx = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %v4int_0_1_2_3 0 0", + "%yyy = OpSpecConstantOp %v3int VectorShuffle %v4int_0_1_2_3 %v4int_0_1_2_3 1 1 1", + "%wwww = OpSpecConstantOp %v4int VectorShuffle %v4int_0_1_2_3 %v4int_0_1_2_3 2 2 2 2", + }, + // expected + { + "%xy = OpConstantComposite %v2int %signed_zero %signed_one", + "%yz = OpConstantComposite %v2int %signed_one %signed_two", + "%zw = OpConstantComposite %v2int %signed_two %signed_three", + "%wx = OpConstantComposite %v2int %signed_three %signed_zero", + "%xx = OpConstantComposite %v2int %signed_zero %signed_zero", + "%yyy = OpConstantComposite %v3int %signed_one %signed_one %signed_one", + "%wwww = OpConstantComposite %v4int %signed_two %signed_two %signed_two %signed_two", + }, + }, + // null vector + { + // original + { + "%a = OpSpecConstantOp %v2int VectorShuffle %signed_null_vec %v4int_0_1_2_3 0 1", + "%b = OpSpecConstantOp %v2int VectorShuffle %signed_null_vec %v4int_0_1_2_3 2 3", + "%c = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %signed_null_vec 3 4", + "%d = OpSpecConstantOp %v2int VectorShuffle %signed_null_vec %signed_null_vec 1 2", + }, + // expected + { + "%60 = OpConstantNull %int", + "%a = OpConstantComposite %v2int %60 %60", + "%62 = OpConstantNull %int", + "%b = OpConstantComposite %v2int %signed_zero %signed_one", + "%64 = OpConstantNull %int", + "%c = OpConstantComposite %v2int %signed_three %64", + "%66 = OpConstantNull %int", + "%d = OpConstantComposite %v2int %66 %66", + } + }, + // skip if any of the components of the vector operands do not have + // determined value, even though the result vector might not be + // built with those undermined values. + { + // original + { + "%spec_int = OpSpecConstant %int 1", + "%spec_ivec = OpSpecConstantComposite %v2int %signed_null %spec_int", + "%a = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %spec_ivec 0 1", + "%b = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %spec_ivec 3 4", + }, + // expected + { + "%spec_int = OpSpecConstant %int 1", + "%spec_ivec = OpSpecConstantComposite %v2int %signed_null %spec_int", + "%a = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %spec_ivec 0 1", + "%b = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %spec_ivec 3 4", + }, + }, + // Skip if any components of the two vector operands depend on + // the result of OpUndef. Even though the selected components do + // not depend on the OpUndef result. + { + // original + { + "%undef = OpUndef %int", + "%vec_1 = OpConstantComposite %v2int %undef %signed_one", + "%dep = OpSpecConstantOp %v2int VectorShuffle %vec_1 %signed_three_vec 0 3", + "%not_dep_element = OpSpecConstantOp %v2int VectorShuffle %vec_1 %signed_three_vec 1 3", + "%no_dep_vector = OpSpecConstantOp %v2int VectorShuffle %vec_1 %signed_three_vec 2 3", + }, + // expected + { + "%undef = OpUndef %int", + "%vec_1 = OpConstantComposite %v2int %undef %signed_one", + "%dep = OpSpecConstantOp %v2int VectorShuffle %vec_1 %signed_three_vec 0 3", + "%not_dep_element = OpSpecConstantOp %v2int VectorShuffle %vec_1 %signed_three_vec 1 3", + "%no_dep_vector = OpSpecConstantOp %v2int VectorShuffle %vec_1 %signed_three_vec 2 3", + }, + }, + // clang-format on + }))); + +// Test with long use-def chain. +INSTANTIATE_TEST_CASE_P( + LongDefUseChain, FoldSpecConstantOpAndCompositePassTest, + ::testing::ValuesIn(std::vector< + FoldSpecConstantOpAndCompositePassTestCase>({ + // clang-format off + // Long Def-Use chain with binary operations. + { + // original + { + "%array_size = OpConstant %int 4", + "%type_arr_int_4 = OpTypeArray %int %array_size", + "%spec_int_0 = OpConstant %int 100", + "%spec_int_1 = OpConstant %int 1", + "%spec_int_2 = OpSpecConstantOp %int IAdd %spec_int_0 %spec_int_1", + "%spec_int_3 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_2", + "%spec_int_4 = OpSpecConstantOp %int IAdd %spec_int_0 %spec_int_3", + "%spec_int_5 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_4", + "%spec_int_6 = OpSpecConstantOp %int IAdd %spec_int_0 %spec_int_5", + "%spec_int_7 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_6", + "%spec_int_8 = OpSpecConstantOp %int IAdd %spec_int_0 %spec_int_7", + "%spec_int_9 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_8", + "%spec_int_10 = OpSpecConstantOp %int IAdd %spec_int_0 %spec_int_9", + "%spec_int_11 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_10", + "%spec_int_12 = OpSpecConstantOp %int IAdd %spec_int_0 %spec_int_11", + "%spec_int_13 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_12", + "%spec_int_14 = OpSpecConstantOp %int IAdd %spec_int_0 %spec_int_13", + "%spec_int_15 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_14", + "%spec_int_16 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_15", + "%spec_int_17 = OpSpecConstantOp %int IAdd %spec_int_0 %spec_int_16", + "%spec_int_18 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_17", + "%spec_int_19 = OpSpecConstantOp %int IAdd %spec_int_0 %spec_int_18", + "%spec_int_20 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_19", + "%used_vec_a = OpSpecConstantComposite %v2int %spec_int_18 %spec_int_19", + "%used_vec_b = OpSpecConstantOp %v2int IMul %used_vec_a %used_vec_a", + "%spec_int_21 = OpSpecConstantOp %int CompositeExtract %used_vec_b 0", + "%array = OpConstantComposite %type_arr_int_4 %spec_int_20 %spec_int_20 %spec_int_21 %spec_int_21", + // Spec constants whose values can not be fully resolved should + // not be processed. + "%spec_int_22 = OpSpecConstant %int 123", + "%spec_int_23 = OpSpecConstantOp %int IAdd %spec_int_22 %signed_one", + }, + // expected + { + "%array_size = OpConstant %int 4", + "%type_arr_int_4 = OpTypeArray %int %array_size", + "%spec_int_0 = OpConstant %int 100", + "%spec_int_1 = OpConstant %int 1", + "%spec_int_2 = OpConstant %int 101", + "%spec_int_3 = OpConstant %int -1", + "%spec_int_4 = OpConstant %int 99", + "%spec_int_5 = OpConstant %int 1", + "%spec_int_6 = OpConstant %int 101", + "%spec_int_7 = OpConstant %int -1", + "%spec_int_8 = OpConstant %int 99", + "%spec_int_9 = OpConstant %int 1", + "%spec_int_10 = OpConstant %int 101", + "%spec_int_11 = OpConstant %int -1", + "%spec_int_12 = OpConstant %int 99", + "%spec_int_13 = OpConstant %int 1", + "%spec_int_14 = OpConstant %int 101", + "%spec_int_15 = OpConstant %int -1", + "%spec_int_16 = OpConstant %int 101", + "%spec_int_17 = OpConstant %int 201", + "%spec_int_18 = OpConstant %int -101", + "%spec_int_19 = OpConstant %int -1", + "%spec_int_20 = OpConstant %int 101", + "%used_vec_a = OpConstantComposite %v2int %spec_int_18 %spec_int_19", + "%int_10201 = OpConstant %int 10201", + "%int_1 = OpConstant %int 1", + "%used_vec_b = OpConstantComposite %v2int %int_10201 %int_1", + "%spec_int_21 = OpConstant %int 10201", + "%array = OpConstantComposite %type_arr_int_4 %spec_int_20 %spec_int_20 %spec_int_21 %spec_int_21", + "%spec_int_22 = OpSpecConstant %int 123", + "%spec_int_23 = OpSpecConstantOp %int IAdd %spec_int_22 %signed_one", + }, + }, + // Long Def-Use chain with swizzle + }))); +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/fold_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/fold_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/fold_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/fold_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,4470 @@ +// Copyright (c) 2016 Google 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. + +#include +#include + +#include +#include +#include + +#ifdef SPIRV_EFFCEE +#include "effcee/effcee.h" +#endif + +#include "opt/build_module.h" +#include "opt/def_use_manager.h" +#include "opt/ir_context.h" +#include "opt/module.h" +#include "pass_utils.h" +#include "spirv-tools/libspirv.hpp" + +namespace { + +using ::testing::Contains; + +using namespace spvtools; +using spvtools::opt::analysis::DefUseManager; + +#ifdef SPIRV_EFFCEE +std::string Disassemble(const std::string& original, ir::IRContext* context, + uint32_t disassemble_options = 0) { + std::vector optimized_bin; + context->module()->ToBinary(&optimized_bin, true); + spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2; + SpirvTools tools(target_env); + std::string optimized_asm; + EXPECT_TRUE( + tools.Disassemble(optimized_bin, &optimized_asm, disassemble_options)) + << "Disassembling failed for shader:\n" + << original << std::endl; + return optimized_asm; +} + +void Match(const std::string& original, ir::IRContext* context, + uint32_t disassemble_options = 0) { + std::string disassembly = Disassemble(original, context, disassemble_options); + auto match_result = effcee::Match(disassembly, original); + EXPECT_EQ(effcee::Result::Status::Ok, match_result.status()) + << match_result.message() << "\nChecking result:\n" + << disassembly; +} +#endif + +template +struct InstructionFoldingCase { + InstructionFoldingCase(const std::string& tb, uint32_t id, ResultType result) + : test_body(tb), id_to_fold(id), expected_result(result) {} + + std::string test_body; + uint32_t id_to_fold; + ResultType expected_result; +}; + +using IntegerInstructionFoldingTest = + ::testing::TestWithParam>; + +TEST_P(IntegerInstructionFoldingTest, Case) { + const auto& tc = GetParam(); + + // Build module. + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, tc.test_body, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ASSERT_NE(nullptr, context); + + // Fold the instruction to test. + opt::analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); + ir::Instruction* inst = def_use_mgr->GetDef(tc.id_to_fold); + bool succeeded = opt::FoldInstruction(inst); + + // Make sure the instruction folded as expected. + EXPECT_TRUE(succeeded); + if (inst != nullptr) { + EXPECT_EQ(inst->opcode(), SpvOpCopyObject); + inst = def_use_mgr->GetDef(inst->GetSingleWordInOperand(0)); + EXPECT_EQ(inst->opcode(), SpvOpConstant); + opt::analysis::ConstantManager* const_mrg = context->get_constant_mgr(); + const opt::analysis::IntConstant* result = + const_mrg->GetConstantFromInst(inst)->AsIntConstant(); + EXPECT_NE(result, nullptr); + if (result != nullptr) { + EXPECT_EQ(result->GetU32BitValue(), tc.expected_result); + } + } +} + +// Returns a common SPIR-V header for all of the test that follow. +#define INT_0_ID 100 +#define TRUE_ID 101 +#define VEC2_0_ID 102 +#define INT_7_ID 103 +#define FLOAT_0_ID 104 +#define DOUBLE_0_ID 105 +#define VEC4_0_ID 106 +#define DVEC4_0_ID 106 +#define HALF_0_ID 108 +const std::string& Header() { + static const std::string header = R"(OpCapability Shader +OpCapability Float16 +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +%void = OpTypeVoid +%void_func = OpTypeFunction %void +%bool = OpTypeBool +%float16 = OpTypeFloat 16 +%float = OpTypeFloat 32 +%double = OpTypeFloat 64 +%half = OpTypeFloat 16 +%101 = OpConstantTrue %bool ; Need a def with an numerical id to define id maps. +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%bool_null = OpConstantNull %bool +%short = OpTypeInt 16 1 +%int = OpTypeInt 32 1 +%long = OpTypeInt 64 1 +%uint = OpTypeInt 32 0 +%v2int = OpTypeVector %int 2 +%v4int = OpTypeVector %int 4 +%v4float = OpTypeVector %float 4 +%v4double = OpTypeVector %double 4 +%v2float = OpTypeVector %float 2 +%v2bool = OpTypeVector %bool 2 +%struct_v2int_int_int = OpTypeStruct %v2int %int %int +%_ptr_int = OpTypePointer Function %int +%_ptr_uint = OpTypePointer Function %uint +%_ptr_bool = OpTypePointer Function %bool +%_ptr_float = OpTypePointer Function %float +%_ptr_double = OpTypePointer Function %double +%_ptr_half = OpTypePointer Function %half +%_ptr_long = OpTypePointer Function %long +%_ptr_v2int = OpTypePointer Function %v2int +%_ptr_v4int = OpTypePointer Function %v4int +%_ptr_v4float = OpTypePointer Function %v4float +%_ptr_v4double = OpTypePointer Function %v4double +%_ptr_struct_v2int_int_int = OpTypePointer Function %struct_v2int_int_int +%_ptr_v2float = OpTypePointer Function %v2float +%short_0 = OpConstant %short 0 +%short_3 = OpConstant %short 3 +%100 = OpConstant %int 0 ; Need a def with an numerical id to define id maps. +%103 = OpConstant %int 7 ; Need a def with an numerical id to define id maps. +%int_0 = OpConstant %int 0 +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%int_3 = OpConstant %int 3 +%int_4 = OpConstant %int 4 +%int_min = OpConstant %int -2147483648 +%int_max = OpConstant %int 2147483647 +%long_0 = OpConstant %long 0 +%long_2 = OpConstant %long 2 +%long_3 = OpConstant %long 3 +%uint_0 = OpConstant %uint 0 +%uint_2 = OpConstant %uint 2 +%uint_3 = OpConstant %uint 3 +%uint_4 = OpConstant %uint 4 +%uint_32 = OpConstant %uint 32 +%uint_max = OpConstant %uint 4294967295 +%v2int_undef = OpUndef %v2int +%v2int_2_2 = OpConstantComposite %v2int %int_2 %int_2 +%v2int_2_3 = OpConstantComposite %v2int %int_2 %int_3 +%v2int_3_2 = OpConstantComposite %v2int %int_3 %int_2 +%v2int_4_4 = OpConstantComposite %v2int %int_4 %int_4 +%v2bool_null = OpConstantNull %v2bool +%v2bool_true_false = OpConstantComposite %v2bool %true %false +%v2bool_false_true = OpConstantComposite %v2bool %false %true +%struct_v2int_int_int_null = OpConstantNull %struct_v2int_int_int +%v2int_null = OpConstantNull %v2int +%102 = OpConstantComposite %v2int %103 %103 +%v4int_0_0_0_0 = OpConstantComposite %v4int %int_0 %int_0 %int_0 %int_0 +%struct_undef_0_0 = OpConstantComposite %struct_v2int_int_int %v2int_undef %int_0 %int_0 +%float16_0 = OpConstant %float16 0 +%float16_1 = OpConstant %float16 1 +%float16_2 = OpConstant %float16 2 +%float_n1 = OpConstant %float -1 +%104 = OpConstant %float 0 ; Need a def with an numerical id to define id maps. +%float_0 = OpConstant %float 0 +%float_half = OpConstant %float 0.5 +%float_1 = OpConstant %float 1 +%float_2 = OpConstant %float 2 +%float_3 = OpConstant %float 3 +%float_4 = OpConstant %float 4 +%float_0p5 = OpConstant %float 0.5 +%v2float_2_2 = OpConstantComposite %v2float %float_2 %float_2 +%v2float_2_3 = OpConstantComposite %v2float %float_2 %float_3 +%v2float_3_2 = OpConstantComposite %v2float %float_3 %float_2 +%v2float_4_4 = OpConstantComposite %v2float %float_4 %float_4 +%v2float_2_0p5 = OpConstantComposite %v2float %float_2 %float_0p5 +%v2float_null = OpConstantNull %v2float +%double_n1 = OpConstant %double -1 +%105 = OpConstant %double 0 ; Need a def with an numerical id to define id maps. +%double_0 = OpConstant %double 0 +%double_1 = OpConstant %double 1 +%double_2 = OpConstant %double 2 +%double_3 = OpConstant %double 3 +%float_nan = OpConstant %float -0x1.8p+128 +%double_nan = OpConstant %double -0x1.8p+1024 +%108 = OpConstant %half 0 +%half_1 = OpConstant %half 1 +%106 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%v4float_0_0_0_0 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%v4float_0_0_0_1 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1 +%v4float_1_1_1_1 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +%107 = OpConstantComposite %v4double %double_0 %double_0 %double_0 %double_0 +%v4double_0_0_0_0 = OpConstantComposite %v4double %double_0 %double_0 %double_0 %double_0 +%v4double_0_0_0_1 = OpConstantComposite %v4double %double_0 %double_0 %double_0 %double_1 +%v4double_1_1_1_1 = OpConstantComposite %v4double %double_1 %double_1 %double_1 %double_1 +)"; + + return header; +} + +// clang-format off +INSTANTIATE_TEST_CASE_P(TestCase, IntegerInstructionFoldingTest, + ::testing::Values( + // Test case 0: fold 0*n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpIMul %int %int_0 %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 1: fold n*0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpIMul %int %load %int_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 2: fold 0/n (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpSDiv %int %int_0 %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 3: fold n/0 (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpSDiv %int %load %int_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 4: fold 0/n (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load = OpLoad %uint %n\n" + + "%2 = OpUDiv %uint %uint_0 %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 5: fold n/0 (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpSDiv %int %load %int_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 6: fold 0 remainder n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpSRem %int %int_0 %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 7: fold n remainder 0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpSRem %int %load %int_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 8: fold 0%n (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpSMod %int %int_0 %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 9: fold n%0 (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpSMod %int %load %int_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 10: fold 0%n (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load = OpLoad %uint %n\n" + + "%2 = OpUMod %uint %uint_0 %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 11: fold n%0 (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load = OpLoad %uint %n\n" + + "%2 = OpUMod %uint %load %uint_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 12: fold n << 32 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load = OpLoad %uint %n\n" + + "%2 = OpShiftLeftLogical %uint %load %uint_32\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 13: fold n >> 32 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load = OpLoad %uint %n\n" + + "%2 = OpShiftRightLogical %uint %load %uint_32\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 14: fold n | 0xFFFFFFFF + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load = OpLoad %uint %n\n" + + "%2 = OpBitwiseOr %uint %load %uint_max\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0xFFFFFFFF), + // Test case 15: fold 0xFFFFFFFF | n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load = OpLoad %uint %n\n" + + "%2 = OpBitwiseOr %uint %uint_max %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0xFFFFFFFF), + // Test case 16: fold n & 0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load = OpLoad %uint %n\n" + + "%2 = OpBitwiseAnd %uint %load %uint_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0) +)); +// clang-format on + +using IntVectorInstructionFoldingTest = + ::testing::TestWithParam>>; + +TEST_P(IntVectorInstructionFoldingTest, Case) { + const auto& tc = GetParam(); + + // Build module. + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, tc.test_body, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ASSERT_NE(nullptr, context); + + // Fold the instruction to test. + opt::analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); + ir::Instruction* inst = def_use_mgr->GetDef(tc.id_to_fold); + bool succeeded = opt::FoldInstruction(inst); + + // Make sure the instruction folded as expected. + EXPECT_TRUE(succeeded); + if (inst != nullptr) { + EXPECT_EQ(inst->opcode(), SpvOpCopyObject); + inst = def_use_mgr->GetDef(inst->GetSingleWordInOperand(0)); + std::vector opcodes = {SpvOpConstantComposite}; + EXPECT_THAT(opcodes, Contains(inst->opcode())); + opt::analysis::ConstantManager* const_mrg = context->get_constant_mgr(); + const opt::analysis::Constant* result = + const_mrg->GetConstantFromInst(inst); + EXPECT_NE(result, nullptr); + if (result != nullptr) { + const std::vector& componenets = + result->AsVectorConstant()->GetComponents(); + EXPECT_EQ(componenets.size(), tc.expected_result.size()); + for (size_t i = 0; i < componenets.size(); i++) { + EXPECT_EQ(tc.expected_result[i], componenets[i]->GetU32()); + } + } + } +} + +// clang-format off +INSTANTIATE_TEST_CASE_P(TestCase, IntVectorInstructionFoldingTest, +::testing::Values( + // Test case 0: fold 0*n + InstructionFoldingCase>( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpVectorShuffle %v2int %v2int_2_2 %v2int_2_3 0 3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, {2,3}), + InstructionFoldingCase>( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpVectorShuffle %v2int %v2int_null %v2int_2_3 0 3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, {0,3}) +)); +// clang-format on + +using BooleanInstructionFoldingTest = + ::testing::TestWithParam>; + +TEST_P(BooleanInstructionFoldingTest, Case) { + const auto& tc = GetParam(); + + // Build module. + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, tc.test_body, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ASSERT_NE(nullptr, context); + + // Fold the instruction to test. + opt::analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); + ir::Instruction* inst = def_use_mgr->GetDef(tc.id_to_fold); + bool succeeded = opt::FoldInstruction(inst); + + // Make sure the instruction folded as expected. + EXPECT_TRUE(succeeded); + if (inst != nullptr) { + EXPECT_EQ(inst->opcode(), SpvOpCopyObject); + inst = def_use_mgr->GetDef(inst->GetSingleWordInOperand(0)); + std::vector bool_opcodes = {SpvOpConstantTrue, SpvOpConstantFalse}; + EXPECT_THAT(bool_opcodes, Contains(inst->opcode())); + opt::analysis::ConstantManager* const_mrg = context->get_constant_mgr(); + const opt::analysis::BoolConstant* result = + const_mrg->GetConstantFromInst(inst)->AsBoolConstant(); + EXPECT_NE(result, nullptr); + if (result != nullptr) { + EXPECT_EQ(result->value(), tc.expected_result); + } + } +} + +// clang-format off +INSTANTIATE_TEST_CASE_P(TestCase, BooleanInstructionFoldingTest, + ::testing::Values( + // Test case 0: fold true || n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_bool Function\n" + + "%load = OpLoad %bool %n\n" + + "%2 = OpLogicalOr %bool %true %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 1: fold n || true + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_bool Function\n" + + "%load = OpLoad %bool %n\n" + + "%2 = OpLogicalOr %bool %load %true\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 2: fold false && n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_bool Function\n" + + "%load = OpLoad %bool %n\n" + + "%2 = OpLogicalAnd %bool %false %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 3: fold n && false + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_bool Function\n" + + "%load = OpLoad %bool %n\n" + + "%2 = OpLogicalAnd %bool %load %false\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 4: fold n < 0 (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load = OpLoad %uint %n\n" + + "%2 = OpULessThan %bool %load %uint_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 5: fold UINT_MAX < n (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load = OpLoad %uint %n\n" + + "%2 = OpULessThan %bool %uint_max %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 6: fold INT_MAX < n (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpSLessThan %bool %int_max %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 7: fold n < INT_MIN (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpSLessThan %bool %load %int_min\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 8: fold 0 > n (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load = OpLoad %uint %n\n" + + "%2 = OpUGreaterThan %bool %uint_0 %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 9: fold n > UINT_MAX (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load = OpLoad %uint %n\n" + + "%2 = OpUGreaterThan %bool %load %uint_max\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 10: fold n > INT_MAX (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpSGreaterThan %bool %load %int_max\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 11: fold INT_MIN > n (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load = OpLoad %uint %n\n" + + "%2 = OpSGreaterThan %bool %int_min %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 12: fold 0 <= n (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load = OpLoad %uint %n\n" + + "%2 = OpULessThanEqual %bool %uint_0 %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 13: fold n <= UINT_MAX (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load = OpLoad %uint %n\n" + + "%2 = OpULessThanEqual %bool %load %uint_max\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 14: fold INT_MIN <= n (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpSLessThanEqual %bool %int_min %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 15: fold n <= INT_MAX (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpSLessThanEqual %bool %load %int_max\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 16: fold n >= 0 (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load = OpLoad %uint %n\n" + + "%2 = OpUGreaterThanEqual %bool %load %uint_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 17: fold UINT_MAX >= n (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load = OpLoad %uint %n\n" + + "%2 = OpUGreaterThanEqual %bool %uint_max %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 18: fold n >= INT_MIN (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpSGreaterThanEqual %bool %load %int_min\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 19: fold INT_MAX >= n (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpSGreaterThanEqual %bool %int_max %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true) +)); +// clang-format on + +using FloatInstructionFoldingTest = + ::testing::TestWithParam>; + +TEST_P(FloatInstructionFoldingTest, Case) { + const auto& tc = GetParam(); + + // Build module. + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, tc.test_body, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ASSERT_NE(nullptr, context); + + // Fold the instruction to test. + opt::analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); + ir::Instruction* inst = def_use_mgr->GetDef(tc.id_to_fold); + bool succeeded = opt::FoldInstruction(inst); + + // Make sure the instruction folded as expected. + EXPECT_TRUE(succeeded); + if (inst != nullptr) { + EXPECT_EQ(inst->opcode(), SpvOpCopyObject); + inst = def_use_mgr->GetDef(inst->GetSingleWordInOperand(0)); + EXPECT_EQ(inst->opcode(), SpvOpConstant); + opt::analysis::ConstantManager* const_mrg = context->get_constant_mgr(); + const opt::analysis::FloatConstant* result = + const_mrg->GetConstantFromInst(inst)->AsFloatConstant(); + EXPECT_NE(result, nullptr); + if (result != nullptr) { + EXPECT_EQ(result->GetFloatValue(), tc.expected_result); + } + } +} + +// Not testing NaNs because there are no expectations concerning NaNs according +// to the "Precision and Operation of SPIR-V Instructions" section of the Vulkan +// specification. + +// clang-format off +INSTANTIATE_TEST_CASE_P(FloatConstantFoldingTest, FloatInstructionFoldingTest, +::testing::Values( + // Test case 0: Fold 2.0 - 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFSub %float %float_2 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 1.0), + // Test case 1: Fold 2.0 + 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFAdd %float %float_2 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3.0), + // Test case 2: Fold 3.0 * 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFMul %float %float_3 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 6.0), + // Test case 3: Fold 1.0 / 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFDiv %float %float_1 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0.5), + // Test case 4: Fold 1.0 / 0.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFDiv %float %float_1 %float_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, std::numeric_limits::infinity()), + // Test case 5: Fold -1.0 / 0.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFDiv %float %float_n1 %float_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, -std::numeric_limits::infinity()) +)); +// clang-format on + +using DoubleInstructionFoldingTest = + ::testing::TestWithParam>; + +TEST_P(DoubleInstructionFoldingTest, Case) { + const auto& tc = GetParam(); + + // Build module. + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, tc.test_body, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ASSERT_NE(nullptr, context); + + // Fold the instruction to test. + opt::analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); + ir::Instruction* inst = def_use_mgr->GetDef(tc.id_to_fold); + bool succeeded = opt::FoldInstruction(inst); + + // Make sure the instruction folded as expected. + EXPECT_TRUE(succeeded); + if (inst != nullptr) { + EXPECT_EQ(inst->opcode(), SpvOpCopyObject); + inst = def_use_mgr->GetDef(inst->GetSingleWordInOperand(0)); + EXPECT_EQ(inst->opcode(), SpvOpConstant); + opt::analysis::ConstantManager* const_mrg = context->get_constant_mgr(); + const opt::analysis::FloatConstant* result = + const_mrg->GetConstantFromInst(inst)->AsFloatConstant(); + EXPECT_NE(result, nullptr); + if (result != nullptr) { + EXPECT_EQ(result->GetDoubleValue(), tc.expected_result); + } + } +} + +// clang-format off +INSTANTIATE_TEST_CASE_P(DoubleConstantFoldingTest, DoubleInstructionFoldingTest, +::testing::Values( + // Test case 0: Fold 2.0 - 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFSub %double %double_2 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 1.0), + // Test case 1: Fold 2.0 + 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFAdd %double %double_2 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3.0), + // Test case 2: Fold 3.0 * 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFMul %double %double_3 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 6.0), + // Test case 3: Fold 1.0 / 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFDiv %double %double_1 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0.5), + // Test case 4: Fold 1.0 / 0.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFDiv %double %double_1 %double_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, std::numeric_limits::infinity()), + // Test case 4: Fold -1.0 / 0.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFDiv %double %double_n1 %double_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, -std::numeric_limits::infinity()) +)); +// clang-format on + +// clang-format off +INSTANTIATE_TEST_CASE_P(DoubleOrderedCompareConstantFoldingTest, BooleanInstructionFoldingTest, + ::testing::Values( + // Test case 0: fold 1.0 == 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdEqual %bool %double_1 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 1: fold 1.0 != 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdNotEqual %bool %double_1 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 2: fold 1.0 < 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdLessThan %bool %double_1 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 3: fold 1.0 > 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdGreaterThan %bool %double_1 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 4: fold 1.0 <= 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdLessThanEqual %bool %double_1 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 5: fold 1.0 >= 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdGreaterThanEqual %bool %double_1 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 6: fold 1.0 == 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdEqual %bool %double_1 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 7: fold 1.0 != 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdNotEqual %bool %double_1 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 8: fold 1.0 < 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdLessThan %bool %double_1 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 9: fold 1.0 > 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdGreaterThan %bool %double_1 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 10: fold 1.0 <= 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdLessThanEqual %bool %double_1 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 11: fold 1.0 >= 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdGreaterThanEqual %bool %double_1 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 12: fold 2.0 < 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdLessThan %bool %double_2 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 13: fold 2.0 > 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdGreaterThan %bool %double_2 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 14: fold 2.0 <= 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdLessThanEqual %bool %double_2 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 15: fold 2.0 >= 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdGreaterThanEqual %bool %double_2 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true) +)); + +INSTANTIATE_TEST_CASE_P(DoubleUnorderedCompareConstantFoldingTest, BooleanInstructionFoldingTest, + ::testing::Values( + // Test case 0: fold 1.0 == 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordEqual %bool %double_1 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 1: fold 1.0 != 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordNotEqual %bool %double_1 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 2: fold 1.0 < 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordLessThan %bool %double_1 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 3: fold 1.0 > 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordGreaterThan %bool %double_1 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 4: fold 1.0 <= 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordLessThanEqual %bool %double_1 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 5: fold 1.0 >= 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordGreaterThanEqual %bool %double_1 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 6: fold 1.0 == 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordEqual %bool %double_1 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 7: fold 1.0 != 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordNotEqual %bool %double_1 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 8: fold 1.0 < 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordLessThan %bool %double_1 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 9: fold 1.0 > 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordGreaterThan %bool %double_1 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 10: fold 1.0 <= 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordLessThanEqual %bool %double_1 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 11: fold 1.0 >= 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordGreaterThanEqual %bool %double_1 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 12: fold 2.0 < 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordLessThan %bool %double_2 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 13: fold 2.0 > 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordGreaterThan %bool %double_2 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 14: fold 2.0 <= 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordLessThanEqual %bool %double_2 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 15: fold 2.0 >= 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordGreaterThanEqual %bool %double_2 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true) +)); + +INSTANTIATE_TEST_CASE_P(FloatOrderedCompareConstantFoldingTest, BooleanInstructionFoldingTest, + ::testing::Values( + // Test case 0: fold 1.0 == 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdEqual %bool %float_1 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 1: fold 1.0 != 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdNotEqual %bool %float_1 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 2: fold 1.0 < 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdLessThan %bool %float_1 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 3: fold 1.0 > 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdGreaterThan %bool %float_1 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 4: fold 1.0 <= 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdLessThanEqual %bool %float_1 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 5: fold 1.0 >= 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdGreaterThanEqual %bool %float_1 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 6: fold 1.0 == 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdEqual %bool %float_1 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 7: fold 1.0 != 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdNotEqual %bool %float_1 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 8: fold 1.0 < 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdLessThan %bool %float_1 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 9: fold 1.0 > 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdGreaterThan %bool %float_1 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 10: fold 1.0 <= 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdLessThanEqual %bool %float_1 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 11: fold 1.0 >= 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdGreaterThanEqual %bool %float_1 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 12: fold 2.0 < 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdLessThan %bool %float_2 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 13: fold 2.0 > 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdGreaterThan %bool %float_2 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 14: fold 2.0 <= 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdLessThanEqual %bool %float_2 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 15: fold 2.0 >= 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdGreaterThanEqual %bool %float_2 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true) +)); + +INSTANTIATE_TEST_CASE_P(FloatUnorderedCompareConstantFoldingTest, BooleanInstructionFoldingTest, + ::testing::Values( + // Test case 0: fold 1.0 == 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordEqual %bool %float_1 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 1: fold 1.0 != 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordNotEqual %bool %float_1 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 2: fold 1.0 < 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordLessThan %bool %float_1 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 3: fold 1.0 > 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordGreaterThan %bool %float_1 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 4: fold 1.0 <= 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordLessThanEqual %bool %float_1 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 5: fold 1.0 >= 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordGreaterThanEqual %bool %float_1 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 6: fold 1.0 == 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordEqual %bool %float_1 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 7: fold 1.0 != 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordNotEqual %bool %float_1 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 8: fold 1.0 < 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordLessThan %bool %float_1 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 9: fold 1.0 > 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordGreaterThan %bool %float_1 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 10: fold 1.0 <= 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordLessThanEqual %bool %float_1 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 11: fold 1.0 >= 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordGreaterThanEqual %bool %float_1 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 12: fold 2.0 < 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordLessThan %bool %float_2 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 13: fold 2.0 > 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordGreaterThan %bool %float_2 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 14: fold 2.0 <= 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordLessThanEqual %bool %float_2 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 15: fold 2.0 >= 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordGreaterThanEqual %bool %float_2 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true) +)); + +INSTANTIATE_TEST_CASE_P(DoubleNaNCompareConstantFoldingTest, BooleanInstructionFoldingTest, + ::testing::Values( + // Test case 0: fold NaN == 0 (ord) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdEqual %bool %double_nan %double_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 1: fold NaN == NaN (unord) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordEqual %bool %double_nan %double_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 2: fold NaN != NaN (ord) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdNotEqual %bool %double_nan %double_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 3: fold NaN != NaN (unord) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordNotEqual %bool %double_nan %double_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true) +)); + +INSTANTIATE_TEST_CASE_P(FloatNaNCompareConstantFoldingTest, BooleanInstructionFoldingTest, + ::testing::Values( + // Test case 0: fold NaN == 0 (ord) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdEqual %bool %float_nan %float_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 1: fold NaN == NaN (unord) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordEqual %bool %float_nan %float_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 2: fold NaN != NaN (ord) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFOrdNotEqual %bool %float_nan %float_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, false), + // Test case 3: fold NaN != NaN (unord) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFUnordNotEqual %bool %float_nan %float_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true) +)); +// clang-format on + +template +struct InstructionFoldingCaseWithMap { + InstructionFoldingCaseWithMap(const std::string& tb, uint32_t id, + ResultType result, + std::function map) + : test_body(tb), id_to_fold(id), expected_result(result), id_map(map) {} + + std::string test_body; + uint32_t id_to_fold; + ResultType expected_result; + std::function id_map; +}; + +using IntegerInstructionFoldingTestWithMap = + ::testing::TestWithParam>; + +TEST_P(IntegerInstructionFoldingTestWithMap, Case) { + const auto& tc = GetParam(); + + // Build module. + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, tc.test_body, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ASSERT_NE(nullptr, context); + + // Fold the instruction to test. + opt::analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); + ir::Instruction* inst = def_use_mgr->GetDef(tc.id_to_fold); + inst = opt::FoldInstructionToConstant(inst, tc.id_map); + + // Make sure the instruction folded as expected. + EXPECT_NE(inst, nullptr); + if (inst != nullptr) { + EXPECT_EQ(inst->opcode(), SpvOpConstant); + opt::analysis::ConstantManager* const_mrg = context->get_constant_mgr(); + const opt::analysis::IntConstant* result = + const_mrg->GetConstantFromInst(inst)->AsIntConstant(); + EXPECT_NE(result, nullptr); + if (result != nullptr) { + EXPECT_EQ(result->GetU32BitValue(), tc.expected_result); + } + } +} +// clang-format off +INSTANTIATE_TEST_CASE_P(TestCase, IntegerInstructionFoldingTestWithMap, + ::testing::Values( + // Test case 0: fold %3 = 0; %3 * n + InstructionFoldingCaseWithMap( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%3 = OpCopyObject %int %int_0\n" + "%2 = OpIMul %int %3 %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0, [](uint32_t id) {return (id == 3 ? INT_0_ID : id);}) + )); +// clang-format on + +using BooleanInstructionFoldingTestWithMap = + ::testing::TestWithParam>; + +TEST_P(BooleanInstructionFoldingTestWithMap, Case) { + const auto& tc = GetParam(); + + // Build module. + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, tc.test_body, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ASSERT_NE(nullptr, context); + + // Fold the instruction to test. + opt::analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); + ir::Instruction* inst = def_use_mgr->GetDef(tc.id_to_fold); + inst = opt::FoldInstructionToConstant(inst, tc.id_map); + + // Make sure the instruction folded as expected. + EXPECT_NE(inst, nullptr); + if (inst != nullptr) { + std::vector bool_opcodes = {SpvOpConstantTrue, SpvOpConstantFalse}; + EXPECT_THAT(bool_opcodes, Contains(inst->opcode())); + opt::analysis::ConstantManager* const_mrg = context->get_constant_mgr(); + const opt::analysis::BoolConstant* result = + const_mrg->GetConstantFromInst(inst)->AsBoolConstant(); + EXPECT_NE(result, nullptr); + if (result != nullptr) { + EXPECT_EQ(result->value(), tc.expected_result); + } + } +} + +// clang-format off +INSTANTIATE_TEST_CASE_P(TestCase, BooleanInstructionFoldingTestWithMap, + ::testing::Values( + // Test case 0: fold %3 = true; %3 || n + InstructionFoldingCaseWithMap( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_bool Function\n" + + "%load = OpLoad %bool %n\n" + + "%3 = OpCopyObject %bool %true\n" + + "%2 = OpLogicalOr %bool %3 %load\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true, [](uint32_t id) {return (id == 3 ? TRUE_ID : id);}) + )); +// clang-format on + +using GeneralInstructionFoldingTest = + ::testing::TestWithParam>; + +TEST_P(GeneralInstructionFoldingTest, Case) { + const auto& tc = GetParam(); + + // Build module. + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, tc.test_body, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ASSERT_NE(nullptr, context); + + // Fold the instruction to test. + opt::analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); + ir::Instruction* inst = def_use_mgr->GetDef(tc.id_to_fold); + std::unique_ptr original_inst(inst->Clone(context.get())); + bool succeeded = opt::FoldInstruction(inst); + + // Make sure the instruction folded as expected. + EXPECT_EQ(inst->result_id(), original_inst->result_id()); + EXPECT_EQ(inst->type_id(), original_inst->type_id()); + EXPECT_TRUE((!succeeded) == (tc.expected_result == 0)); + if (succeeded) { + EXPECT_EQ(inst->opcode(), SpvOpCopyObject); + EXPECT_EQ(inst->GetSingleWordInOperand(0), tc.expected_result); + } else { + EXPECT_EQ(inst->NumInOperands(), original_inst->NumInOperands()); + for (uint32_t i = 0; i < inst->NumInOperands(); ++i) { + EXPECT_EQ(inst->GetOperand(i), original_inst->GetOperand(i)); + } + } +} + +// clang-format off +INSTANTIATE_TEST_CASE_P(IntegerArithmeticTestCases, GeneralInstructionFoldingTest, + ::testing::Values( + // Test case 0: Don't fold n * m + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%m = OpVariable %_ptr_int Function\n" + + "%load_n = OpLoad %int %n\n" + + "%load_m = OpLoad %int %m\n" + + "%2 = OpIMul %int %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 1: Don't fold n / m (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%m = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%load_m = OpLoad %uint %m\n" + + "%2 = OpUDiv %uint %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 2: Don't fold n / m (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%m = OpVariable %_ptr_int Function\n" + + "%load_n = OpLoad %int %n\n" + + "%load_m = OpLoad %int %m\n" + + "%2 = OpSDiv %int %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 3: Don't fold n remainder m + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%m = OpVariable %_ptr_int Function\n" + + "%load_n = OpLoad %int %n\n" + + "%load_m = OpLoad %int %m\n" + + "%2 = OpSRem %int %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 4: Don't fold n % m (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%m = OpVariable %_ptr_int Function\n" + + "%load_n = OpLoad %int %n\n" + + "%load_m = OpLoad %int %m\n" + + "%2 = OpSMod %int %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 5: Don't fold n % m (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%m = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%load_m = OpLoad %uint %m\n" + + "%2 = OpUMod %int %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 6: Don't fold n << m + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%m = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%load_m = OpLoad %uint %m\n" + + "%2 = OpShiftRightLogical %int %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 7: Don't fold n >> m + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%m = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%load_m = OpLoad %uint %m\n" + + "%2 = OpShiftLeftLogical %int %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 8: Don't fold n | m + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%m = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%load_m = OpLoad %uint %m\n" + + "%2 = OpBitwiseOr %int %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 9: Don't fold n & m + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%m = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%load_m = OpLoad %uint %m\n" + + "%2 = OpBitwiseAnd %int %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 10: Don't fold n < m (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%m = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%load_m = OpLoad %uint %m\n" + + "%2 = OpULessThan %bool %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 11: Don't fold n > m (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%m = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%load_m = OpLoad %uint %m\n" + + "%2 = OpUGreaterThan %bool %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 12: Don't fold n <= m (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%m = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%load_m = OpLoad %uint %m\n" + + "%2 = OpULessThanEqual %bool %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 13: Don't fold n >= m (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%m = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%load_m = OpLoad %uint %m\n" + + "%2 = OpUGreaterThanEqual %bool %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 14: Don't fold n < m (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%m = OpVariable %_ptr_int Function\n" + + "%load_n = OpLoad %int %n\n" + + "%load_m = OpLoad %int %m\n" + + "%2 = OpULessThan %bool %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 15: Don't fold n > m (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%m = OpVariable %_ptr_int Function\n" + + "%load_n = OpLoad %int %n\n" + + "%load_m = OpLoad %int %m\n" + + "%2 = OpUGreaterThan %bool %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 16: Don't fold n <= m (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%m = OpVariable %_ptr_int Function\n" + + "%load_n = OpLoad %int %n\n" + + "%load_m = OpLoad %int %m\n" + + "%2 = OpULessThanEqual %bool %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 17: Don't fold n >= m (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%m = OpVariable %_ptr_int Function\n" + + "%load_n = OpLoad %int %n\n" + + "%load_m = OpLoad %int %m\n" + + "%2 = OpUGreaterThanEqual %bool %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 18: Don't fold n || m + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_bool Function\n" + + "%m = OpVariable %_ptr_bool Function\n" + + "%load_n = OpLoad %bool %n\n" + + "%load_m = OpLoad %bool %m\n" + + "%2 = OpLogicalOr %bool %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 19: Don't fold n && m + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_bool Function\n" + + "%m = OpVariable %_ptr_bool Function\n" + + "%load_n = OpLoad %bool %n\n" + + "%load_m = OpLoad %bool %m\n" + + "%2 = OpLogicalAnd %bool %load_n %load_m\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 20: Don't fold n * 3 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load_n = OpLoad %int %n\n" + + "%2 = OpIMul %int %load_n %int_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 21: Don't fold n / 3 (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%2 = OpUDiv %uint %load_n %uint_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 22: Don't fold n / 3 (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load_n = OpLoad %int %n\n" + + "%2 = OpSDiv %int %load_n %int_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 23: Don't fold n remainder 3 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load_n = OpLoad %int %n\n" + + "%2 = OpSRem %int %load_n %int_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 24: Don't fold n % 3 (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load_n = OpLoad %int %n\n" + + "%2 = OpSMod %int %load_n %int_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 25: Don't fold n % 3 (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%2 = OpUMod %int %load_n %int_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 26: Don't fold n << 3 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%2 = OpShiftRightLogical %int %load_n %int_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 27: Don't fold n >> 3 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%2 = OpShiftLeftLogical %int %load_n %int_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 28: Don't fold n | 3 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%2 = OpBitwiseOr %int %load_n %int_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 29: Don't fold n & 3 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%2 = OpBitwiseAnd %uint %load_n %uint_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 30: Don't fold n < 3 (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%2 = OpULessThan %bool %load_n %uint_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 31: Don't fold n > 3 (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%2 = OpUGreaterThan %bool %load_n %uint_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 32: Don't fold n <= 3 (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%2 = OpULessThanEqual %bool %load_n %uint_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 33: Don't fold n >= 3 (unsigned) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_uint Function\n" + + "%load_n = OpLoad %uint %n\n" + + "%2 = OpUGreaterThanEqual %bool %load_n %uint_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 34: Don't fold n < 3 (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load_n = OpLoad %int %n\n" + + "%2 = OpULessThan %bool %load_n %int_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 35: Don't fold n > 3 (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load_n = OpLoad %int %n\n" + + "%2 = OpUGreaterThan %bool %load_n %int_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 36: Don't fold n <= 3 (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load_n = OpLoad %int %n\n" + + "%2 = OpULessThanEqual %bool %load_n %int_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 37: Don't fold n >= 3 (signed) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load_n = OpLoad %int %n\n" + + "%2 = OpUGreaterThanEqual %bool %load_n %int_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 38: Don't fold 0 + 3 (long), bad length + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpIAdd %long %long_0 %long_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 39: Don't fold 0 + 3 (short), bad length + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpIAdd %short %short_0 %short_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 40: fold 1*n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%3 = OpLoad %int %n\n" + + "%2 = OpIMul %int %int_1 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3), + // Test case 41: fold n*1 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%3 = OpLoad %int %n\n" + + "%2 = OpIMul %int %3 %int_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3) +)); + +INSTANTIATE_TEST_CASE_P(CompositeExtractFoldingTest, GeneralInstructionFoldingTest, +::testing::Values( + // Test case 0: fold Insert feeding extract + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %n\n" + + "%3 = OpCompositeInsert %v4int %2 %v4int_0_0_0_0 0\n" + + "%4 = OpCompositeInsert %v4int %int_1 %3 1\n" + + "%5 = OpCompositeInsert %v4int %int_1 %4 2\n" + + "%6 = OpCompositeInsert %v4int %int_1 %5 3\n" + + "%7 = OpCompositeExtract %int %6 0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 7, 2), + // Test case 1: fold Composite construct feeding extract (position 0) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %n\n" + + "%3 = OpCompositeConstruct %v4int %2 %int_0 %int_0 %int_0\n" + + "%4 = OpCompositeExtract %int %3 0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, 2), + // Test case 2: fold Composite construct feeding extract (position 3) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %n\n" + + "%3 = OpCompositeConstruct %v4int %2 %int_0 %int_0 %100\n" + + "%4 = OpCompositeExtract %int %3 3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, INT_0_ID), + // Test case 3: fold Composite construct with vectors feeding extract (scalar element) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %n\n" + + "%3 = OpCompositeConstruct %v2int %2 %int_0\n" + + "%4 = OpCompositeConstruct %v4int %3 %int_0 %100\n" + + "%5 = OpCompositeExtract %int %4 3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 5, INT_0_ID), + // Test case 4: fold Composite construct with vectors feeding extract (start of vector element) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %n\n" + + "%3 = OpCompositeConstruct %v2int %2 %int_0\n" + + "%4 = OpCompositeConstruct %v4int %3 %int_0 %100\n" + + "%5 = OpCompositeExtract %int %4 0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 5, 2), + // Test case 5: fold Composite construct with vectors feeding extract (middle of vector element) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %n\n" + + "%3 = OpCompositeConstruct %v2int %int_0 %2\n" + + "%4 = OpCompositeConstruct %v4int %3 %int_0 %100\n" + + "%5 = OpCompositeExtract %int %4 1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 5, 2), + // Test case 6: fold Composite construct with multiple indices. + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %n\n" + + "%3 = OpCompositeConstruct %v2int %int_0 %2\n" + + "%4 = OpCompositeConstruct %struct_v2int_int_int %3 %int_0 %100\n" + + "%5 = OpCompositeExtract %int %4 0 1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 5, 2), + // Test case 7: fold constant extract. + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpCompositeExtract %int %102 1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, INT_7_ID), + // Test case 8: constant struct has OpUndef + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpCompositeExtract %int %struct_undef_0_0 0 1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 9: Extracting a member of element inserted via Insert + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_struct_v2int_int_int Function\n" + + "%2 = OpLoad %struct_v2int_int_int %n\n" + + "%3 = OpCompositeInsert %struct_v2int_int_int %102 %2 0\n" + + "%4 = OpCompositeExtract %int %3 0 1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, 103), + // Test case 10: Extracting a element that is partially changed by Insert. (Don't fold) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_struct_v2int_int_int Function\n" + + "%2 = OpLoad %struct_v2int_int_int %n\n" + + "%3 = OpCompositeInsert %struct_v2int_int_int %int_0 %2 0 1\n" + + "%4 = OpCompositeExtract %v2int %3 0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, 0), + // Test case 11: Extracting from result of vector shuffle (first input) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_v2int Function\n" + + "%2 = OpLoad %v2int %n\n" + + "%3 = OpVectorShuffle %v2int %102 %2 3 0\n" + + "%4 = OpCompositeExtract %int %3 1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, INT_7_ID), + // Test case 12: Extracting from result of vector shuffle (second input) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_v2int Function\n" + + "%2 = OpLoad %v2int %n\n" + + "%3 = OpVectorShuffle %v2int %2 %102 2 0\n" + + "%4 = OpCompositeExtract %int %3 0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, INT_7_ID) +)); + +INSTANTIATE_TEST_CASE_P(CompositeConstructFoldingTest, GeneralInstructionFoldingTest, +::testing::Values( + // Test case 0: fold Extracts feeding construct + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpCopyObject %v4int %v4int_0_0_0_0\n" + + "%3 = OpCompositeExtract %int %2 0\n" + + "%4 = OpCompositeExtract %int %2 1\n" + + "%5 = OpCompositeExtract %int %2 2\n" + + "%6 = OpCompositeExtract %int %2 3\n" + + "%7 = OpCompositeConstruct %v4int %3 %4 %5 %6\n" + + "OpReturn\n" + + "OpFunctionEnd", + 7, 2), + // Test case 1: Don't fold Extracts feeding construct (Different source) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpCopyObject %v4int %v4int_0_0_0_0\n" + + "%3 = OpCompositeExtract %int %2 0\n" + + "%4 = OpCompositeExtract %int %2 1\n" + + "%5 = OpCompositeExtract %int %2 2\n" + + "%6 = OpCompositeExtract %int %v4int_0_0_0_0 3\n" + + "%7 = OpCompositeConstruct %v4int %3 %4 %5 %6\n" + + "OpReturn\n" + + "OpFunctionEnd", + 7, 0), + // Test case 2: Don't fold Extracts feeding construct (bad indices) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpCopyObject %v4int %v4int_0_0_0_0\n" + + "%3 = OpCompositeExtract %int %2 0\n" + + "%4 = OpCompositeExtract %int %2 0\n" + + "%5 = OpCompositeExtract %int %2 2\n" + + "%6 = OpCompositeExtract %int %2 3\n" + + "%7 = OpCompositeConstruct %v4int %3 %4 %5 %6\n" + + "OpReturn\n" + + "OpFunctionEnd", + 7, 0), + // Test case 3: Don't fold Extracts feeding construct (different type) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpCopyObject %struct_v2int_int_int %struct_v2int_int_int_null\n" + + "%3 = OpCompositeExtract %v2int %2 0\n" + + "%4 = OpCompositeExtract %int %2 1\n" + + "%5 = OpCompositeExtract %int %2 2\n" + + "%7 = OpCompositeConstruct %v4int %3 %4 %5\n" + + "OpReturn\n" + + "OpFunctionEnd", + 7, 0), + // Test case 4: Fold construct with constants to constant. + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpCompositeConstruct %v2int %103 %103\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, VEC2_0_ID) +)); + +INSTANTIATE_TEST_CASE_P(PhiFoldingTest, GeneralInstructionFoldingTest, +::testing::Values( + // Test case 0: Fold phi with the same values for all edges. + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + " OpBranchConditional %true %l1 %l2\n" + + "%l1 = OpLabel\n" + + " OpBranch %merge_lab\n" + + "%l2 = OpLabel\n" + + " OpBranch %merge_lab\n" + + "%merge_lab = OpLabel\n" + + "%2 = OpPhi %int %100 %l1 %100 %l2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, INT_0_ID), + // Test case 1: Fold phi in pass through loop. + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + " OpBranch %l1\n" + + "%l1 = OpLabel\n" + + "%2 = OpPhi %int %100 %main_lab %2 %l1\n" + + " OpBranchConditional %true %l1 %merge_lab\n" + + "%merge_lab = OpLabel\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, INT_0_ID), + // Test case 2: Don't Fold phi because of different values. + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + " OpBranch %l1\n" + + "%l1 = OpLabel\n" + + "%2 = OpPhi %int %int_0 %main_lab %int_3 %l1\n" + + " OpBranchConditional %true %l1 %merge_lab\n" + + "%merge_lab = OpLabel\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0) +)); + +INSTANTIATE_TEST_CASE_P(FloatRedundantFoldingTest, GeneralInstructionFoldingTest, + ::testing::Values( + // Test case 0: Don't fold n + 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_float Function\n" + + "%3 = OpLoad %float %n\n" + + "%2 = OpFAdd %float %3 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 1: Don't fold n - 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_float Function\n" + + "%3 = OpLoad %float %n\n" + + "%2 = OpFSub %float %3 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 2: Don't fold n * 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_float Function\n" + + "%3 = OpLoad %float %n\n" + + "%2 = OpFMul %float %3 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 3: Fold n + 0.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_float Function\n" + + "%3 = OpLoad %float %n\n" + + "%2 = OpFAdd %float %3 %float_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3), + // Test case 4: Fold 0.0 + n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_float Function\n" + + "%3 = OpLoad %float %n\n" + + "%2 = OpFAdd %float %float_0 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3), + // Test case 5: Fold n - 0.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_float Function\n" + + "%3 = OpLoad %float %n\n" + + "%2 = OpFSub %float %3 %float_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3), + // Test case 6: Fold n * 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_float Function\n" + + "%3 = OpLoad %float %n\n" + + "%2 = OpFMul %float %3 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3), + // Test case 7: Fold 1.0 * n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_float Function\n" + + "%3 = OpLoad %float %n\n" + + "%2 = OpFMul %float %float_1 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3), + // Test case 8: Fold n / 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_float Function\n" + + "%3 = OpLoad %float %n\n" + + "%2 = OpFDiv %float %3 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3), + // Test case 9: Fold n * 0.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_float Function\n" + + "%3 = OpLoad %float %n\n" + + "%2 = OpFMul %float %3 %104\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, FLOAT_0_ID), + // Test case 10: Fold 0.0 * n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_float Function\n" + + "%3 = OpLoad %float %n\n" + + "%2 = OpFMul %float %104 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, FLOAT_0_ID), + // Test case 11: Fold 0.0 / n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_float Function\n" + + "%3 = OpLoad %float %n\n" + + "%2 = OpFDiv %float %104 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, FLOAT_0_ID), + // Test case 12: Don't fold mix(a, b, 2.0) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%a = OpVariable %_ptr_float Function\n" + + "%b = OpVariable %_ptr_float Function\n" + + "%3 = OpLoad %float %a\n" + + "%4 = OpLoad %float %b\n" + + "%2 = OpExtInst %float %1 FMix %3 %4 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 13: Fold mix(a, b, 0.0) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%a = OpVariable %_ptr_float Function\n" + + "%b = OpVariable %_ptr_float Function\n" + + "%3 = OpLoad %float %a\n" + + "%4 = OpLoad %float %b\n" + + "%2 = OpExtInst %float %1 FMix %3 %4 %float_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3), + // Test case 14: Fold mix(a, b, 1.0) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%a = OpVariable %_ptr_float Function\n" + + "%b = OpVariable %_ptr_float Function\n" + + "%3 = OpLoad %float %a\n" + + "%4 = OpLoad %float %b\n" + + "%2 = OpExtInst %float %1 FMix %3 %4 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 4), + // Test case 15: Fold vector fadd with null + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%a = OpVariable %_ptr_v2float Function\n" + + "%2 = OpLoad %v2float %a\n" + + "%3 = OpFAdd %v2float %2 %v2float_null\n" + + "OpReturn\n" + + "OpFunctionEnd", + 3, 2), + // Test case 16: Fold vector fadd with null + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%a = OpVariable %_ptr_v2float Function\n" + + "%2 = OpLoad %v2float %a\n" + + "%3 = OpFAdd %v2float %v2float_null %2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 3, 2), + // Test case 15: Fold vector fsub with null + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%a = OpVariable %_ptr_v2float Function\n" + + "%2 = OpLoad %v2float %a\n" + + "%3 = OpFSub %v2float %2 %v2float_null\n" + + "OpReturn\n" + + "OpFunctionEnd", + 3, 2), + // Test case 16: Fold 0.0(half) * n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_half Function\n" + + "%3 = OpLoad %half %n\n" + + "%2 = OpFMul %half %108 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, HALF_0_ID), + // Test case 17: Don't fold 1.0(half) * n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_half Function\n" + + "%3 = OpLoad %half %n\n" + + "%2 = OpFMul %half %half_1 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 18: Don't fold 1.0 * 1.0 (half) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpFMul %half %half_1 %half_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0) +)); + +INSTANTIATE_TEST_CASE_P(DoubleRedundantFoldingTest, GeneralInstructionFoldingTest, + ::testing::Values( + // Test case 0: Don't fold n + 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_double Function\n" + + "%3 = OpLoad %double %n\n" + + "%2 = OpFAdd %double %3 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 1: Don't fold n - 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_double Function\n" + + "%3 = OpLoad %double %n\n" + + "%2 = OpFSub %double %3 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 2: Don't fold n * 2.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_double Function\n" + + "%3 = OpLoad %double %n\n" + + "%2 = OpFMul %double %3 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 3: Fold n + 0.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_double Function\n" + + "%3 = OpLoad %double %n\n" + + "%2 = OpFAdd %double %3 %double_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3), + // Test case 4: Fold 0.0 + n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_double Function\n" + + "%3 = OpLoad %double %n\n" + + "%2 = OpFAdd %double %double_0 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3), + // Test case 5: Fold n - 0.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_double Function\n" + + "%3 = OpLoad %double %n\n" + + "%2 = OpFSub %double %3 %double_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3), + // Test case 6: Fold n * 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_double Function\n" + + "%3 = OpLoad %double %n\n" + + "%2 = OpFMul %double %3 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3), + // Test case 7: Fold 1.0 * n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_double Function\n" + + "%3 = OpLoad %double %n\n" + + "%2 = OpFMul %double %double_1 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3), + // Test case 8: Fold n / 1.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_double Function\n" + + "%3 = OpLoad %double %n\n" + + "%2 = OpFDiv %double %3 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3), + // Test case 9: Fold n * 0.0 + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_double Function\n" + + "%3 = OpLoad %double %n\n" + + "%2 = OpFMul %double %3 %105\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, DOUBLE_0_ID), + // Test case 10: Fold 0.0 * n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_double Function\n" + + "%3 = OpLoad %double %n\n" + + "%2 = OpFMul %double %105 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, DOUBLE_0_ID), + // Test case 11: Fold 0.0 / n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_double Function\n" + + "%3 = OpLoad %double %n\n" + + "%2 = OpFDiv %double %105 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, DOUBLE_0_ID), + // Test case 12: Don't fold mix(a, b, 2.0) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%a = OpVariable %_ptr_double Function\n" + + "%b = OpVariable %_ptr_double Function\n" + + "%3 = OpLoad %double %a\n" + + "%4 = OpLoad %double %b\n" + + "%2 = OpExtInst %double %1 FMix %3 %4 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 13: Fold mix(a, b, 0.0) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%a = OpVariable %_ptr_double Function\n" + + "%b = OpVariable %_ptr_double Function\n" + + "%3 = OpLoad %double %a\n" + + "%4 = OpLoad %double %b\n" + + "%2 = OpExtInst %double %1 FMix %3 %4 %double_0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3), + // Test case 14: Fold mix(a, b, 1.0) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%a = OpVariable %_ptr_double Function\n" + + "%b = OpVariable %_ptr_double Function\n" + + "%3 = OpLoad %double %a\n" + + "%4 = OpLoad %double %b\n" + + "%2 = OpExtInst %double %1 FMix %3 %4 %double_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 4) +)); + +INSTANTIATE_TEST_CASE_P(FloatVectorRedundantFoldingTest, GeneralInstructionFoldingTest, + ::testing::Values( + // Test case 0: Don't fold a * vec4(0.0, 0.0, 0.0, 1.0) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_v4float Function\n" + + "%3 = OpLoad %v4float %n\n" + + "%2 = OpFMul %v4float %3 %v4float_0_0_0_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 1: Fold a * vec4(0.0, 0.0, 0.0, 0.0) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_v4float Function\n" + + "%3 = OpLoad %v4float %n\n" + + "%2 = OpFMul %v4float %3 %106\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, VEC4_0_ID), + // Test case 2: Fold a * vec4(1.0, 1.0, 1.0, 1.0) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_v4float Function\n" + + "%3 = OpLoad %v4float %n\n" + + "%2 = OpFMul %v4float %3 %v4float_1_1_1_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3) +)); + +INSTANTIATE_TEST_CASE_P(DoubleVectorRedundantFoldingTest, GeneralInstructionFoldingTest, + ::testing::Values( + // Test case 0: Don't fold a * vec4(0.0, 0.0, 0.0, 1.0) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_v4double Function\n" + + "%3 = OpLoad %v4double %n\n" + + "%2 = OpFMul %v4double %3 %v4double_0_0_0_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 1: Fold a * vec4(0.0, 0.0, 0.0, 0.0) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_v4double Function\n" + + "%3 = OpLoad %v4double %n\n" + + "%2 = OpFMul %v4double %3 %106\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, DVEC4_0_ID), + // Test case 2: Fold a * vec4(1.0, 1.0, 1.0, 1.0) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_v4double Function\n" + + "%3 = OpLoad %v4double %n\n" + + "%2 = OpFMul %v4double %3 %v4double_1_1_1_1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3) +)); + +INSTANTIATE_TEST_CASE_P(FToIConstantFoldingTest, IntegerInstructionFoldingTest, + ::testing::Values( + // Test case 0: Fold int(3.0) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpConvertFToS %int %float_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3), + // Test case 1: Fold uint(3.0) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpConvertFToU %int %float_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3) +)); + +INSTANTIATE_TEST_CASE_P(IToFConstantFoldingTest, FloatInstructionFoldingTest, + ::testing::Values( + // Test case 0: Fold float(3) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpConvertSToF %float %int_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3.0), + // Test case 1: Fold float(3u) + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%2 = OpConvertUToF %float %uint_3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3.0) +)); +// clang-format on + +using ToNegateFoldingTest = + ::testing::TestWithParam>; + +TEST_P(ToNegateFoldingTest, Case) { + const auto& tc = GetParam(); + + // Build module. + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, tc.test_body, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ASSERT_NE(nullptr, context); + + // Fold the instruction to test. + opt::analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); + ir::Instruction* inst = def_use_mgr->GetDef(tc.id_to_fold); + std::unique_ptr original_inst(inst->Clone(context.get())); + bool succeeded = opt::FoldInstruction(inst); + + // Make sure the instruction folded as expected. + EXPECT_EQ(inst->result_id(), original_inst->result_id()); + EXPECT_EQ(inst->type_id(), original_inst->type_id()); + EXPECT_TRUE((!succeeded) == (tc.expected_result == 0)); + if (succeeded) { + EXPECT_EQ(inst->opcode(), SpvOpFNegate); + EXPECT_EQ(inst->GetSingleWordInOperand(0), tc.expected_result); + } else { + EXPECT_EQ(inst->NumInOperands(), original_inst->NumInOperands()); + for (uint32_t i = 0; i < inst->NumInOperands(); ++i) { + EXPECT_EQ(inst->GetOperand(i), original_inst->GetOperand(i)); + } + } +} + +// clang-format off +INSTANTIATE_TEST_CASE_P(FloatRedundantSubFoldingTest, ToNegateFoldingTest, + ::testing::Values( + // Test case 0: Don't fold 1.0 - n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_float Function\n" + + "%3 = OpLoad %float %n\n" + + "%2 = OpFSub %float %float_1 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 1: Fold 0.0 - n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_float Function\n" + + "%3 = OpLoad %float %n\n" + + "%2 = OpFSub %float %float_0 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3), + // Test case 2: Don't fold (0,0,0,1) - n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_v4float Function\n" + + "%3 = OpLoad %v4float %n\n" + + "%2 = OpFSub %v4float %v4float_0_0_0_1 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 3: Fold (0,0,0,0) - n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_v4float Function\n" + + "%3 = OpLoad %v4float %n\n" + + "%2 = OpFSub %v4float %v4float_0_0_0_0 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3) +)); + +INSTANTIATE_TEST_CASE_P(DoubleRedundantSubFoldingTest, ToNegateFoldingTest, + ::testing::Values( + // Test case 0: Don't fold 1.0 - n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_double Function\n" + + "%3 = OpLoad %double %n\n" + + "%2 = OpFSub %double %double_1 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 1: Fold 0.0 - n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_double Function\n" + + "%3 = OpLoad %double %n\n" + + "%2 = OpFSub %double %double_0 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3), + // Test case 2: Don't fold (0,0,0,1) - n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_v4double Function\n" + + "%3 = OpLoad %v4double %n\n" + + "%2 = OpFSub %v4double %v4double_0_0_0_1 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 0), + // Test case 3: Fold (0,0,0,0) - n + InstructionFoldingCase( + Header() + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_v4double Function\n" + + "%3 = OpLoad %v4double %n\n" + + "%2 = OpFSub %v4double %v4double_0_0_0_0 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, 3) +)); + +#ifdef SPIRV_EFFCEE +using MatchingInstructionFoldingTest = + ::testing::TestWithParam>; + +TEST_P(MatchingInstructionFoldingTest, Case) { + const auto& tc = GetParam(); + + // Build module. + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, tc.test_body, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ASSERT_NE(nullptr, context); + + // Fold the instruction to test. + opt::analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); + ir::Instruction* inst = def_use_mgr->GetDef(tc.id_to_fold); + std::unique_ptr original_inst(inst->Clone(context.get())); + bool succeeded = opt::FoldInstruction(inst); + EXPECT_EQ(succeeded, tc.expected_result); + if (succeeded) { + Match(tc.test_body, context.get()); + } +} + +INSTANTIATE_TEST_CASE_P(MergeNegateTest, MatchingInstructionFoldingTest, +::testing::Values( + // Test case 0: fold consecutive fnegate + // -(-x) = x + InstructionFoldingCase( + Header() + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float:%\\w+]]\n" + + "; CHECK: %4 = OpCopyObject [[float]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFNegate %float %2\n" + + "%4 = OpFNegate %float %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 1: fold fnegate(fmul with const). + // -(x * 2.0) = x * -2.0 + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_n2:%\\w+]] = OpConstant [[float]] -2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFMul [[float]] [[ld]] [[float_n2]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFMul %float %2 %float_2\n" + + "%4 = OpFNegate %float %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 2: fold fnegate(fmul with const). + // -(2.0 * x) = x * 2.0 + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_n2:%\\w+]] = OpConstant [[float]] -2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFMul [[float]] [[ld]] [[float_n2]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFMul %float %float_2 %2\n" + + "%4 = OpFNegate %float %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 3: fold fnegate(fdiv with const). + // -(x / 2.0) = x * -0.5 + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_n0p5:%\\w+]] = OpConstant [[float]] -0.5\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFMul [[float]] [[ld]] [[float_n0p5]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFDiv %float %2 %float_2\n" + + "%4 = OpFNegate %float %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 4: fold fnegate(fdiv with const). + // -(2.0 / x) = -2.0 / x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_n2:%\\w+]] = OpConstant [[float]] -2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFDiv [[float]] [[float_n2]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFDiv %float %float_2 %2\n" + + "%4 = OpFNegate %float %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 5: fold fnegate(fadd with const). + // -(2.0 + x) = -2.0 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_n2:%\\w+]] = OpConstant [[float]] -2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFSub [[float]] [[float_n2]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFAdd %float %float_2 %2\n" + + "%4 = OpFNegate %float %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 6: fold fnegate(fadd with const). + // -(x + 2.0) = -2.0 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_n2:%\\w+]] = OpConstant [[float]] -2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFSub [[float]] [[float_n2]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFAdd %float %2 %float_2\n" + + "%4 = OpFNegate %float %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 7: fold fnegate(fsub with const). + // -(2.0 - x) = x - 2.0 + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_2:%\\w+]] = OpConstant [[float]] 2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFSub [[float]] [[ld]] [[float_2]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFSub %float %float_2 %2\n" + + "%4 = OpFNegate %float %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 8: fold fnegate(fsub with const). + // -(x - 2.0) = 2.0 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_2:%\\w+]] = OpConstant [[float]] 2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFSub [[float]] [[float_2]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFSub %float %2 %float_2\n" + + "%4 = OpFNegate %float %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 9: fold consecutive snegate + // -(-x) = x + InstructionFoldingCase( + Header() + + "; CHECK: [[ld:%\\w+]] = OpLoad [[int:%\\w+]]\n" + + "; CHECK: %4 = OpCopyObject [[int]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %var\n" + + "%3 = OpSNegate %int %2\n" + + "%4 = OpSNegate %int %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 10: fold consecutive vector negate + // -(-x) = x + InstructionFoldingCase( + Header() + + "; CHECK: [[ld:%\\w+]] = OpLoad [[v2float:%\\w+]]\n" + + "; CHECK: %4 = OpCopyObject [[v2float]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_v2float Function\n" + + "%2 = OpLoad %v2float %var\n" + + "%3 = OpFNegate %v2float %2\n" + + "%4 = OpFNegate %v2float %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 11: fold snegate(iadd with const). + // -(2 + x) = -2 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: OpConstant [[int]] -2147483648\n" + + "; CHECK: [[int_n2:%\\w+]] = OpConstant [[int]] -2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[int]]\n" + + "; CHECK: %4 = OpISub [[int]] [[int_n2]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %var\n" + + "%3 = OpIAdd %int %int_2 %2\n" + + "%4 = OpSNegate %int %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 12: fold snegate(iadd with const). + // -(x + 2) = -2 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: OpConstant [[int]] -2147483648\n" + + "; CHECK: [[int_n2:%\\w+]] = OpConstant [[int]] -2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[int]]\n" + + "; CHECK: %4 = OpISub [[int]] [[int_n2]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %var\n" + + "%3 = OpIAdd %int %2 %int_2\n" + + "%4 = OpSNegate %int %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 13: fold snegate(isub with const). + // -(2 - x) = x - 2 + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: [[int_2:%\\w+]] = OpConstant [[int]] 2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[int]]\n" + + "; CHECK: %4 = OpISub [[int]] [[ld]] [[int_2]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %var\n" + + "%3 = OpISub %int %int_2 %2\n" + + "%4 = OpSNegate %int %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 14: fold snegate(isub with const). + // -(x - 2) = 2 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: [[int_2:%\\w+]] = OpConstant [[int]] 2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[int]]\n" + + "; CHECK: %4 = OpISub [[int]] [[int_2]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %var\n" + + "%3 = OpISub %int %2 %int_2\n" + + "%4 = OpSNegate %int %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 15: fold snegate(iadd with const). + // -(x + 2) = -2 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[long:%\\w+]] = OpTypeInt 64 1\n" + + "; CHECK: [[long_n2:%\\w+]] = OpConstant [[long]] -2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[long]]\n" + + "; CHECK: %4 = OpISub [[long]] [[long_n2]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_long Function\n" + + "%2 = OpLoad %long %var\n" + + "%3 = OpIAdd %long %2 %long_2\n" + + "%4 = OpSNegate %long %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 16: fold snegate(isub with const). + // -(2 - x) = x - 2 + InstructionFoldingCase( + Header() + + "; CHECK: [[long:%\\w+]] = OpTypeInt 64 1\n" + + "; CHECK: [[long_2:%\\w+]] = OpConstant [[long]] 2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[long]]\n" + + "; CHECK: %4 = OpISub [[long]] [[ld]] [[long_2]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_long Function\n" + + "%2 = OpLoad %long %var\n" + + "%3 = OpISub %long %long_2 %2\n" + + "%4 = OpSNegate %long %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 17: fold snegate(isub with const). + // -(x - 2) = 2 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[long:%\\w+]] = OpTypeInt 64 1\n" + + "; CHECK: [[long_2:%\\w+]] = OpConstant [[long]] 2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[long]]\n" + + "; CHECK: %4 = OpISub [[long]] [[long_2]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_long Function\n" + + "%2 = OpLoad %long %var\n" + + "%3 = OpISub %long %2 %long_2\n" + + "%4 = OpSNegate %long %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true) +)); + +INSTANTIATE_TEST_CASE_P(ReciprocalFDivTest, MatchingInstructionFoldingTest, +::testing::Values( + // Test case 0: scalar reicprocal + // x / 0.5 = x * 2.0 + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_2:%\\w+]] = OpConstant [[float]] 2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %3 = OpFMul [[float]] [[ld]] [[float_2]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFDiv %float %2 %float_0p5\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 3, true), + // Test case 1: Unfoldable + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_0:%\\w+]] = OpConstant [[float]] 0\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %3 = OpFDiv [[float]] [[ld]] [[float_0]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFDiv %float %2 %104\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 3, false), + // Test case 2: Vector reciprocal + // x / {2.0, 0.5} = x * {0.5, 2.0} + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[v2float:%\\w+]] = OpTypeVector [[float]] 2\n" + + "; CHECK: [[float_2:%\\w+]] = OpConstant [[float]] 2\n" + + "; CHECK: [[float_0p5:%\\w+]] = OpConstant [[float]] 0.5\n" + + "; CHECK: [[v2float_0p5_2:%\\w+]] = OpConstantComposite [[v2float]] [[float_0p5]] [[float_2]]\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[v2float]]\n" + + "; CHECK: %3 = OpFMul [[v2float]] [[ld]] [[v2float_0p5_2]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_v2float Function\n" + + "%2 = OpLoad %v2float %var\n" + + "%3 = OpFDiv %v2float %2 %v2float_2_0p5\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 3, true), + // Test case 3: double reciprocal + // x / 2.0 = x * 0.5 + InstructionFoldingCase( + Header() + + "; CHECK: [[double:%\\w+]] = OpTypeFloat 64\n" + + "; CHECK: [[double_0p5:%\\w+]] = OpConstant [[double]] 0.5\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[double]]\n" + + "; CHECK: %3 = OpFMul [[double]] [[ld]] [[double_0p5]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_double Function\n" + + "%2 = OpLoad %double %var\n" + + "%3 = OpFDiv %double %2 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 3, true), + // Test case 4: don't fold x / 0. + InstructionFoldingCase( + Header() + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_v2float Function\n" + + "%2 = OpLoad %v2float %var\n" + + "%3 = OpFDiv %v2float %2 %v2float_null\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 3, false) +)); + +INSTANTIATE_TEST_CASE_P(MergeMulTest, MatchingInstructionFoldingTest, +::testing::Values( + // Test case 0: fold consecutive fmuls + // (x * 3.0) * 2.0 = x * 6.0 + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_6:%\\w+]] = OpConstant [[float]] 6\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFMul [[float]] [[ld]] [[float_6]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFMul %float %2 %float_3\n" + + "%4 = OpFMul %float %3 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 1: fold consecutive fmuls + // 2.0 * (x * 3.0) = x * 6.0 + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_6:%\\w+]] = OpConstant [[float]] 6\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFMul [[float]] [[ld]] [[float_6]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFMul %float %2 %float_3\n" + + "%4 = OpFMul %float %float_2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 2: fold consecutive fmuls + // (3.0 * x) * 2.0 = x * 6.0 + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_6:%\\w+]] = OpConstant [[float]] 6\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFMul [[float]] [[ld]] [[float_6]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFMul %float %float_3 %2\n" + + "%4 = OpFMul %float %float_2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 3: fold vector fmul + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[v2float:%\\w+]] = OpTypeVector [[float]] 2\n" + + "; CHECK: [[float_6:%\\w+]] = OpConstant [[float]] 6\n" + + "; CHECK: [[v2float_6_6:%\\w+]] = OpConstantComposite [[v2float]] [[float_6]] [[float_6]]\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[v2float]]\n" + + "; CHECK: %4 = OpFMul [[v2float]] [[ld]] [[v2float_6_6]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_v2float Function\n" + + "%2 = OpLoad %v2float %var\n" + + "%3 = OpFMul %v2float %2 %v2float_2_3\n" + + "%4 = OpFMul %v2float %3 %v2float_3_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 4: fold double fmuls + // (x * 3.0) * 2.0 = x * 6.0 + InstructionFoldingCase( + Header() + + "; CHECK: [[double:%\\w+]] = OpTypeFloat 64\n" + + "; CHECK: [[double_6:%\\w+]] = OpConstant [[double]] 6\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[double]]\n" + + "; CHECK: %4 = OpFMul [[double]] [[ld]] [[double_6]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_double Function\n" + + "%2 = OpLoad %double %var\n" + + "%3 = OpFMul %double %2 %double_3\n" + + "%4 = OpFMul %double %3 %double_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 5: fold 32 bit imuls + // (x * 3) * 2 = x * 6 + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: [[int_6:%\\w+]] = OpConstant [[int]] 6\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[int]]\n" + + "; CHECK: %4 = OpIMul [[int]] [[ld]] [[int_6]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %var\n" + + "%3 = OpIMul %int %2 %int_3\n" + + "%4 = OpIMul %int %3 %int_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 6: fold 64 bit imuls + // (x * 3) * 2 = x * 6 + InstructionFoldingCase( + Header() + + "; CHECK: [[long:%\\w+]] = OpTypeInt 64\n" + + "; CHECK: [[long_6:%\\w+]] = OpConstant [[long]] 6\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[long]]\n" + + "; CHECK: %4 = OpIMul [[long]] [[ld]] [[long_6]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_long Function\n" + + "%2 = OpLoad %long %var\n" + + "%3 = OpIMul %long %2 %long_3\n" + + "%4 = OpIMul %long %3 %long_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 7: merge vector integer mults + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: [[v2int:%\\w+]] = OpTypeVector [[int]] 2\n" + + "; CHECK: [[int_6:%\\w+]] = OpConstant [[int]] 6\n" + + "; CHECK: [[v2int_6_6:%\\w+]] = OpConstantComposite [[v2int]] [[int_6]] [[int_6]]\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[v2int]]\n" + + "; CHECK: %4 = OpIMul [[v2int]] [[ld]] [[v2int_6_6]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_v2int Function\n" + + "%2 = OpLoad %v2int %var\n" + + "%3 = OpIMul %v2int %2 %v2int_2_3\n" + + "%4 = OpIMul %v2int %3 %v2int_3_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 8: merge fmul of fdiv + // 2.0 * (2.0 / x) = 4.0 / x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_4:%\\w+]] = OpConstant [[float]] 4\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFDiv [[float]] [[float_4]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFDiv %float %float_2 %2\n" + + "%4 = OpFMul %float %float_2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 9: merge fmul of fdiv + // (2.0 / x) * 2.0 = 4.0 / x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_4:%\\w+]] = OpConstant [[float]] 4\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFDiv [[float]] [[float_4]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFDiv %float %float_2 %2\n" + + "%4 = OpFMul %float %3 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 10: Do not merge imul of sdiv + // 4 * (x / 2) + InstructionFoldingCase( + Header() + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %var\n" + + "%3 = OpSDiv %int %2 %int_2\n" + + "%4 = OpIMul %int %int_4 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, false), + // Test case 11: Do not merge imul of sdiv + // (x / 2) * 4 + InstructionFoldingCase( + Header() + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %var\n" + + "%3 = OpSDiv %int %2 %int_2\n" + + "%4 = OpIMul %int %3 %int_4\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, false), + // Test case 12: Do not merge imul of udiv + // 4 * (x / 2) + InstructionFoldingCase( + Header() + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_uint Function\n" + + "%2 = OpLoad %uint %var\n" + + "%3 = OpUDiv %uint %2 %uint_2\n" + + "%4 = OpIMul %uint %uint_4 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, false), + // Test case 13: Do not merge imul of udiv + // (x / 2) * 4 + InstructionFoldingCase( + Header() + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_uint Function\n" + + "%2 = OpLoad %uint %var\n" + + "%3 = OpUDiv %uint %2 %uint_2\n" + + "%4 = OpIMul %uint %3 %uint_4\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, false), + // Test case 14: Don't fold + // (x / 3) * 4 + InstructionFoldingCase( + Header() + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_uint Function\n" + + "%2 = OpLoad %uint %var\n" + + "%3 = OpUDiv %uint %2 %uint_3\n" + + "%4 = OpIMul %uint %3 %uint_4\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, false), + // Test case 15: merge vector fmul of fdiv + // (x / {2,2}) * {4,4} = x * {2,2} + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[v2float:%\\w+]] = OpTypeVector [[float]] 2\n" + + "; CHECK: [[float_2:%\\w+]] = OpConstant [[float]] 2\n" + + "; CHECK: [[v2float_2_2:%\\w+]] = OpConstantComposite [[v2float]] [[float_2]] [[float_2]]\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[v2float]]\n" + + "; CHECK: %4 = OpFMul [[v2float]] [[ld]] [[v2float_2_2]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_v2float Function\n" + + "%2 = OpLoad %v2float %var\n" + + "%3 = OpFDiv %v2float %2 %v2float_2_2\n" + + "%4 = OpFMul %v2float %3 %v2float_4_4\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 16: merge vector imul of snegate + // (-x) * {2,2} = x * {-2,-2} + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: [[v2int:%\\w+]] = OpTypeVector [[int]] 2\n" + + "; CHECK: OpConstant [[int]] -2147483648\n" + + "; CHECK: [[int_n2:%\\w+]] = OpConstant [[int]] -2\n" + + "; CHECK: [[v2int_n2_n2:%\\w+]] = OpConstantComposite [[v2int]] [[int_n2]] [[int_n2]]\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[v2int]]\n" + + "; CHECK: %4 = OpIMul [[v2int]] [[ld]] [[v2int_n2_n2]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_v2int Function\n" + + "%2 = OpLoad %v2int %var\n" + + "%3 = OpSNegate %v2int %2\n" + + "%4 = OpIMul %v2int %3 %v2int_2_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 17: merge vector imul of snegate + // {2,2} * (-x) = x * {-2,-2} + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: [[v2int:%\\w+]] = OpTypeVector [[int]] 2\n" + + "; CHECK: OpConstant [[int]] -2147483648\n" + + "; CHECK: [[int_n2:%\\w+]] = OpConstant [[int]] -2\n" + + "; CHECK: [[v2int_n2_n2:%\\w+]] = OpConstantComposite [[v2int]] [[int_n2]] [[int_n2]]\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[v2int]]\n" + + "; CHECK: %4 = OpIMul [[v2int]] [[ld]] [[v2int_n2_n2]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_v2int Function\n" + + "%2 = OpLoad %v2int %var\n" + + "%3 = OpSNegate %v2int %2\n" + + "%4 = OpIMul %v2int %v2int_2_2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true) +)); + +INSTANTIATE_TEST_CASE_P(MergeDivTest, MatchingInstructionFoldingTest, +::testing::Values( + // Test case 0: merge consecutive fdiv + // 4.0 / (2.0 / x) = 2.0 * x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_2:%\\w+]] = OpConstant [[float]] 2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFMul [[float]] [[float_2]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFDiv %float %float_2 %2\n" + + "%4 = OpFDiv %float %float_4 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 1: merge consecutive fdiv + // 4.0 / (x / 2.0) = 8.0 / x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_8:%\\w+]] = OpConstant [[float]] 8\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFDiv [[float]] [[float_8]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFDiv %float %2 %float_2\n" + + "%4 = OpFDiv %float %float_4 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 2: merge consecutive fdiv + // (4.0 / x) / 2.0 = 2.0 / x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_2:%\\w+]] = OpConstant [[float]] 2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFDiv [[float]] [[float_2]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFDiv %float %float_4 %2\n" + + "%4 = OpFDiv %float %3 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 3: Do not merge consecutive sdiv + // 4 / (2 / x) + InstructionFoldingCase( + Header() + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %var\n" + + "%3 = OpSDiv %int %int_2 %2\n" + + "%4 = OpSDiv %int %int_4 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, false), + // Test case 4: Do not merge consecutive sdiv + // 4 / (x / 2) + InstructionFoldingCase( + Header() + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %var\n" + + "%3 = OpSDiv %int %2 %int_2\n" + + "%4 = OpSDiv %int %int_4 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, false), + // Test case 5: Do not merge consecutive sdiv + // (4 / x) / 2 + InstructionFoldingCase( + Header() + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %var\n" + + "%3 = OpSDiv %int %int_4 %2\n" + + "%4 = OpSDiv %int %3 %int_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, false), + // Test case 6: Do not merge consecutive sdiv + // (x / 4) / 2 + InstructionFoldingCase( + Header() + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %var\n" + + "%3 = OpSDiv %int %2 %int_4\n" + + "%4 = OpSDiv %int %3 %int_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, false), + // Test case 7: Do not merge sdiv of imul + // 4 / (2 * x) + InstructionFoldingCase( + Header() + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %var\n" + + "%3 = OpIMul %int %int_2 %2\n" + + "%4 = OpSDiv %int %int_4 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, false), + // Test case 8: Do not merge sdiv of imul + // 4 / (x * 2) + InstructionFoldingCase( + Header() + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %var\n" + + "%3 = OpIMul %int %2 %int_2\n" + + "%4 = OpSDiv %int %int_4 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, false), + // Test case 9: Do not merge sdiv of imul + // (4 * x) / 2 + InstructionFoldingCase( + Header() + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %var\n" + + "%3 = OpIMul %int %int_4 %2\n" + + "%4 = OpSDiv %int %3 %int_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, false), + // Test case 10: Do not merge sdiv of imul + // (x * 4) / 2 + InstructionFoldingCase( + Header() + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %var\n" + + "%3 = OpIMul %int %2 %int_4\n" + + "%4 = OpSDiv %int %3 %int_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, false), + // Test case 11: merge sdiv of snegate + // (-x) / 2 = x / -2 + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: OpConstant [[int]] -2147483648\n" + + "; CHECK: [[int_n2:%\\w+]] = OpConstant [[int]] -2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[int]]\n" + + "; CHECK: %4 = OpSDiv [[int]] [[ld]] [[int_n2]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %var\n" + + "%3 = OpSNegate %int %2\n" + + "%4 = OpSDiv %int %3 %int_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 12: merge sdiv of snegate + // 2 / (-x) = -2 / x + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: OpConstant [[int]] -2147483648\n" + + "; CHECK: [[int_n2:%\\w+]] = OpConstant [[int]] -2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[int]]\n" + + "; CHECK: %4 = OpSDiv [[int]] [[int_n2]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_int Function\n" + + "%2 = OpLoad %int %var\n" + + "%3 = OpSNegate %int %2\n" + + "%4 = OpSDiv %int %int_2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 13: Don't merge + // (x / {null}) / {null} + InstructionFoldingCase( + Header() + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_v2float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFDiv %float %2 %v2float_null\n" + + "%4 = OpFDiv %float %3 %v2float_null\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, false) +)); + +INSTANTIATE_TEST_CASE_P(MergeAddTest, MatchingInstructionFoldingTest, +::testing::Values( + // Test case 0: merge add of negate + // (-x) + 2 = 2 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_2:%\\w+]] = OpConstant [[float]] 2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFSub [[float]] [[float_2]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFNegate %float %2\n" + + "%4 = OpFAdd %float %3 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 1: merge add of negate + // 2 + (-x) = 2 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_2:%\\w+]] = OpConstant [[float]] 2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFSub [[float]] [[float_2]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpSNegate %float %2\n" + + "%4 = OpIAdd %float %float_2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 2: merge add of negate + // (-x) + 2 = 2 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[long:%\\w+]] = OpTypeInt 64 1\n" + + "; CHECK: [[long_2:%\\w+]] = OpConstant [[long]] 2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[long]]\n" + + "; CHECK: %4 = OpISub [[long]] [[long_2]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_long Function\n" + + "%2 = OpLoad %long %var\n" + + "%3 = OpSNegate %long %2\n" + + "%4 = OpIAdd %long %3 %long_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 3: merge add of negate + // 2 + (-x) = 2 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[long:%\\w+]] = OpTypeInt 64 1\n" + + "; CHECK: [[long_2:%\\w+]] = OpConstant [[long]] 2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[long]]\n" + + "; CHECK: %4 = OpISub [[long]] [[long_2]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_long Function\n" + + "%2 = OpLoad %long %var\n" + + "%3 = OpSNegate %long %2\n" + + "%4 = OpIAdd %long %long_2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 4: merge add of subtract + // (x - 1) + 2 = x + 1 + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_1:%\\w+]] = OpConstant [[float]] 1\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFAdd [[float]] [[ld]] [[float_1]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFSub %float %2 %float_1\n" + + "%4 = OpFAdd %float %3 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 5: merge add of subtract + // (1 - x) + 2 = 3 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_3:%\\w+]] = OpConstant [[float]] 3\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFSub [[float]] [[float_3]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFSub %float %float_1 %2\n" + + "%4 = OpFAdd %float %3 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 6: merge add of subtract + // 2 + (x - 1) = x + 1 + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_1:%\\w+]] = OpConstant [[float]] 1\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFAdd [[float]] [[ld]] [[float_1]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFSub %float %2 %float_1\n" + + "%4 = OpFAdd %float %float_2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 7: merge add of subtract + // 2 + (1 - x) = 3 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_3:%\\w+]] = OpConstant [[float]] 3\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFSub [[float]] [[float_3]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFSub %float %float_1 %2\n" + + "%4 = OpFAdd %float %float_2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 8: merge add of add + // (x + 1) + 2 = x + 3 + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_3:%\\w+]] = OpConstant [[float]] 3\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFAdd [[float]] [[ld]] [[float_3]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFAdd %float %2 %float_1\n" + + "%4 = OpFAdd %float %3 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 9: merge add of add + // (1 + x) + 2 = 3 + x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_3:%\\w+]] = OpConstant [[float]] 3\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFAdd [[float]] [[ld]] [[float_3]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFAdd %float %float_1 %2\n" + + "%4 = OpFAdd %float %3 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 10: merge add of add + // 2 + (x + 1) = x + 1 + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_3:%\\w+]] = OpConstant [[float]] 3\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFAdd [[float]] [[ld]] [[float_3]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFAdd %float %2 %float_1\n" + + "%4 = OpFAdd %float %float_2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 11: merge add of add + // 2 + (1 + x) = 3 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_3:%\\w+]] = OpConstant [[float]] 3\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFAdd [[float]] [[ld]] [[float_3]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFAdd %float %float_1 %2\n" + + "%4 = OpFAdd %float %float_2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true) +)); + +INSTANTIATE_TEST_CASE_P(MergeSubTest, MatchingInstructionFoldingTest, +::testing::Values( + // Test case 0: merge sub of negate + // (-x) - 2 = -2 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_n2:%\\w+]] = OpConstant [[float]] -2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFSub [[float]] [[float_n2]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFNegate %float %2\n" + + "%4 = OpFSub %float %3 %float_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 1: merge sub of negate + // 2 - (-x) = x + 2 + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_2:%\\w+]] = OpConstant [[float]] 2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFAdd [[float]] [[ld]] [[float_2]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFNegate %float %2\n" + + "%4 = OpFSub %float %float_2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 2: merge sub of negate + // (-x) - 2 = -2 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[long:%\\w+]] = OpTypeInt 64 1\n" + + "; CHECK: [[long_n2:%\\w+]] = OpConstant [[long]] -2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[long]]\n" + + "; CHECK: %4 = OpISub [[long]] [[long_n2]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_long Function\n" + + "%2 = OpLoad %long %var\n" + + "%3 = OpSNegate %long %2\n" + + "%4 = OpISub %long %3 %long_2\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 3: merge sub of negate + // 2 - (-x) = x + 2 + InstructionFoldingCase( + Header() + + "; CHECK: [[long:%\\w+]] = OpTypeInt 64 1\n" + + "; CHECK: [[long_2:%\\w+]] = OpConstant [[long]] 2\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[long]]\n" + + "; CHECK: %4 = OpIAdd [[long]] [[ld]] [[long_2]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_long Function\n" + + "%2 = OpLoad %long %var\n" + + "%3 = OpSNegate %long %2\n" + + "%4 = OpISub %long %long_2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 4: merge add of subtract + // (x + 2) - 1 = x + 1 + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_1:%\\w+]] = OpConstant [[float]] 1\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFAdd [[float]] [[ld]] [[float_1]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFAdd %float %2 %float_2\n" + + "%4 = OpFSub %float %3 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 5: merge add of subtract + // (2 + x) - 1 = x + 1 + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_1:%\\w+]] = OpConstant [[float]] 1\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFAdd [[float]] [[ld]] [[float_1]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFAdd %float %float_2 %2\n" + + "%4 = OpFSub %float %3 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 6: merge add of subtract + // 2 - (x + 1) = 1 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_1:%\\w+]] = OpConstant [[float]] 1\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFSub [[float]] [[float_1]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFAdd %float %2 %float_1\n" + + "%4 = OpFSub %float %float_2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 7: merge add of subtract + // 2 - (1 + x) = 1 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_1:%\\w+]] = OpConstant [[float]] 1\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFSub [[float]] [[float_1]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFAdd %float %float_1 %2\n" + + "%4 = OpFSub %float %float_2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 8: merge subtract of subtract + // (x - 2) - 1 = x - 3 + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_3:%\\w+]] = OpConstant [[float]] 3\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFSub [[float]] [[ld]] [[float_3]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFSub %float %2 %float_2\n" + + "%4 = OpFSub %float %3 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 9: merge subtract of subtract + // (2 - x) - 1 = 1 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_1:%\\w+]] = OpConstant [[float]] 1\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFSub [[float]] [[float_1]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFSub %float %float_2 %2\n" + + "%4 = OpFSub %float %3 %float_1\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 10: merge subtract of subtract + // 2 - (x - 1) = 3 - x + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_3:%\\w+]] = OpConstant [[float]] 3\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFSub [[float]] [[float_3]] [[ld]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFSub %float %2 %float_1\n" + + "%4 = OpFSub %float %float_2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 11: merge subtract of subtract + // 1 - (2 - x) = x + (-1) + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_n1:%\\w+]] = OpConstant [[float]] -1\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFAdd [[float]] [[ld]] [[float_n1]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFSub %float %float_2 %2\n" + + "%4 = OpFSub %float %float_1 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true), + // Test case 12: merge subtract of subtract + // 2 - (1 - x) = x + 1 + InstructionFoldingCase( + Header() + + "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" + + "; CHECK: [[float_1:%\\w+]] = OpConstant [[float]] 1\n" + + "; CHECK: [[ld:%\\w+]] = OpLoad [[float]]\n" + + "; CHECK: %4 = OpFAdd [[float]] [[ld]] [[float_1]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%var = OpVariable %_ptr_float Function\n" + + "%2 = OpLoad %float %var\n" + + "%3 = OpFSub %float %float_1 %2\n" + + "%4 = OpFSub %float %float_2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd\n", + 4, true) +)); + +INSTANTIATE_TEST_CASE_P(SelectFoldingTest, MatchingInstructionFoldingTest, +::testing::Values( + // Test case 0: Fold select with the same values for both sides + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: [[int0:%\\w+]] = OpConstant [[int]] 0\n" + + "; CHECK: %2 = OpCopyObject [[int]] [[int0]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_bool Function\n" + + "%load = OpLoad %bool %n\n" + + "%2 = OpSelect %int %load %100 %100\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 1: Fold select true to left side + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: [[int0:%\\w+]] = OpConstant [[int]] 0\n" + + "; CHECK: %2 = OpCopyObject [[int]] [[int0]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %bool %n\n" + + "%2 = OpSelect %int %true %100 %n\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 2: Fold select false to right side + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: [[int0:%\\w+]] = OpConstant [[int]] 0\n" + + "; CHECK: %2 = OpCopyObject [[int]] [[int0]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %bool %n\n" + + "%2 = OpSelect %int %false %n %100\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 3: Fold select null to right side + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: [[int0:%\\w+]] = OpConstant [[int]] 0\n" + + "; CHECK: %2 = OpCopyObject [[int]] [[int0]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_int Function\n" + + "%load = OpLoad %int %n\n" + + "%2 = OpSelect %int %bool_null %load %100\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 4: vector null + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: [[v2int:%\\w+]] = OpTypeVector [[int]] 2\n" + + "; CHECK: [[int2:%\\w+]] = OpConstant [[int]] 2\n" + + "; CHECK: [[v2int2_2:%\\w+]] = OpConstantComposite [[v2int]] [[int2]] [[int2]]\n" + + "; CHECK: %2 = OpCopyObject [[v2int]] [[v2int2_2]]\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_v2int Function\n" + + "%load = OpLoad %v2int %n\n" + + "%2 = OpSelect %v2int %v2bool_null %load %v2int_2_2\n" + + "OpReturn\n" + + "OpFunctionEnd", + 2, true), + // Test case 5: vector select + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: [[v2int:%\\w+]] = OpTypeVector [[int]] 2\n" + + "; CHECK: %4 = OpVectorShuffle [[v2int]] %2 %3 0 3\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%m = OpVariable %_ptr_v2int Function\n" + + "%n = OpVariable %_ptr_v2int Function\n" + + "%2 = OpLoad %v2int %n\n" + + "%3 = OpLoad %v2int %n\n" + + "%4 = OpSelect %v2int %v2bool_true_false %2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 6: vector select + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: [[v2int:%\\w+]] = OpTypeVector [[int]] 2\n" + + "; CHECK: %4 = OpVectorShuffle [[v2int]] %2 %3 2 1\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%m = OpVariable %_ptr_v2int Function\n" + + "%n = OpVariable %_ptr_v2int Function\n" + + "%2 = OpLoad %v2int %n\n" + + "%3 = OpLoad %v2int %n\n" + + "%4 = OpSelect %v2int %v2bool_false_true %2 %3\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true) +)); + +INSTANTIATE_TEST_CASE_P(CompositeExtractMatchingTest, MatchingInstructionFoldingTest, +::testing::Values( + // Test case 0: Extracting from result of consecutive shuffles of differing + // size. + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: %5 = OpCompositeExtract [[int]] %2 2\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_v4int Function\n" + + "%2 = OpLoad %v4int %n\n" + + "%3 = OpVectorShuffle %v2int %2 %2 2 3\n" + + "%4 = OpVectorShuffle %v4int %2 %3 0 4 2 5\n" + + "%5 = OpCompositeExtract %int %4 1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 5, true), + // Test case 1: Extracting from result of vector shuffle of differing + // input and result sizes. + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: %4 = OpCompositeExtract [[int]] %2 2\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_v4int Function\n" + + "%2 = OpLoad %v4int %n\n" + + "%3 = OpVectorShuffle %v2int %2 %2 2 3\n" + + "%4 = OpCompositeExtract %int %3 0\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true), + // Test case 2: Extracting from result of vector shuffle of differing + // input and result sizes. + InstructionFoldingCase( + Header() + + "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" + + "; CHECK: %4 = OpCompositeExtract [[int]] %2 3\n" + + "%main = OpFunction %void None %void_func\n" + + "%main_lab = OpLabel\n" + + "%n = OpVariable %_ptr_v4int Function\n" + + "%2 = OpLoad %v4int %n\n" + + "%3 = OpVectorShuffle %v2int %2 %2 2 3\n" + + "%4 = OpCompositeExtract %int %3 1\n" + + "OpReturn\n" + + "OpFunctionEnd", + 4, true) +)); +#endif +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/freeze_spec_const_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/freeze_spec_const_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/freeze_spec_const_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/freeze_spec_const_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,128 @@ +// Copyright (c) 2016 Google 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. + +#include "pass_fixture.h" +#include "pass_utils.h" + +#include +#include +#include + +namespace { + +using namespace spvtools; + +struct FreezeSpecConstantValueTypeTestCase { + const char* type_decl; + const char* spec_const; + const char* expected_frozen_const; +}; + +using FreezeSpecConstantValueTypeTest = + PassTest<::testing::TestWithParam>; + +TEST_P(FreezeSpecConstantValueTypeTest, PrimaryType) { + auto& test_case = GetParam(); + std::vector text = {"OpCapability Shader", + "OpMemoryModel Logical GLSL450", + test_case.type_decl, test_case.spec_const}; + std::vector expected = { + "OpCapability Shader", "OpMemoryModel Logical GLSL450", + test_case.type_decl, test_case.expected_frozen_const}; + SinglePassRunAndCheck( + JoinAllInsts(text), JoinAllInsts(expected), /* skip_nop = */ false); +} + +// Test each primary type. +INSTANTIATE_TEST_CASE_P( + PrimaryTypeSpecConst, FreezeSpecConstantValueTypeTest, + ::testing::ValuesIn(std::vector({ + // Type declaration, original spec constant definition, expected frozen + // spec constants. + {"%int = OpTypeInt 32 1", "%2 = OpSpecConstant %int 1", + "%int_1 = OpConstant %int 1"}, + {"%uint = OpTypeInt 32 0", "%2 = OpSpecConstant %uint 1", + "%uint_1 = OpConstant %uint 1"}, + {"%float = OpTypeFloat 32", "%2 = OpSpecConstant %float 3.1415", + "%float_3_1415 = OpConstant %float 3.1415"}, + {"%double = OpTypeFloat 64", "%2 = OpSpecConstant %double 3.141592653", + "%double_3_141592653 = OpConstant %double 3.141592653"}, + {"%bool = OpTypeBool", "%2 = OpSpecConstantTrue %bool", + "%true = OpConstantTrue %bool"}, + {"%bool = OpTypeBool", "%2 = OpSpecConstantFalse %bool", + "%false = OpConstantFalse %bool"}, + }))); + +using FreezeSpecConstantValueRemoveDecorationTest = PassTest<::testing::Test>; + +TEST_F(FreezeSpecConstantValueRemoveDecorationTest, + RemoveDecorationInstWithSpecId) { + std::vector text = { + // clang-format off + "OpCapability Shader", + "OpCapability Float64", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Vertex %main \"main\"", + "OpSource GLSL 450", + "OpSourceExtension \"GL_GOOGLE_cpp_style_line_directive\"", + "OpSourceExtension \"GL_GOOGLE_include_directive\"", + "OpName %main \"main\"", + "OpDecorate %3 SpecId 200", + "OpDecorate %4 SpecId 201", + "OpDecorate %5 SpecId 202", + "OpDecorate %6 SpecId 203", + "%void = OpTypeVoid", + "%8 = OpTypeFunction %void", + "%int = OpTypeInt 32 1", + "%3 = OpSpecConstant %int 3", + "%float = OpTypeFloat 32", + "%4 = OpSpecConstant %float 3.1415", + "%double = OpTypeFloat 64", + "%5 = OpSpecConstant %double 3.14159265358979", + "%bool = OpTypeBool", + "%6 = OpSpecConstantTrue %bool", + "%13 = OpSpecConstantFalse %bool", + "%main = OpFunction %void None %8", + "%14 = OpLabel", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + std::string expected_disassembly = SelectiveJoin(text, [](const char* line) { + return std::string(line).find("SpecId") != std::string::npos; + }); + std::vector> replacement_pairs = { + {"%3 = OpSpecConstant %int 3", "%int_3 = OpConstant %int 3"}, + {"%4 = OpSpecConstant %float 3.1415", + "%float_3_1415 = OpConstant %float 3.1415"}, + {"%5 = OpSpecConstant %double 3.14159265358979", + "%double_3_14159265358979 = OpConstant %double 3.14159265358979"}, + {"%6 = OpSpecConstantTrue ", "%true = OpConstantTrue "}, + {"%13 = OpSpecConstantFalse ", "%false = OpConstantFalse "}, + }; + for (auto& p : replacement_pairs) { + EXPECT_TRUE(FindAndReplace(&expected_disassembly, p.first, p.second)) + << "text:\n" + << expected_disassembly << "\n" + << "find_str:\n" + << p.first << "\n" + << "replace_str:\n" + << p.second << "\n"; + } + SinglePassRunAndCheck( + JoinAllInsts(text), expected_disassembly, + /* skip_nop = */ true); +} +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/function_utils.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/function_utils.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/function_utils.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/function_utils.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,54 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_TEST_OPT_FUNCTION_UTILS_H_ +#define LIBSPIRV_TEST_OPT_FUNCTION_UTILS_H_ + +#include "opt/function.h" +#include "opt/module.h" + +namespace spvtest { + +spvtools::ir::Function* GetFunction(spvtools::ir::Module* module, uint32_t id) { + for (spvtools::ir::Function& f : *module) { + if (f.result_id() == id) { + return &f; + } + } + return nullptr; +} + +const spvtools::ir::Function* GetFunction(const spvtools::ir::Module* module, + uint32_t id) { + for (const spvtools::ir::Function& f : *module) { + if (f.result_id() == id) { + return &f; + } + } + return nullptr; +} + +const spvtools::ir::BasicBlock* GetBasicBlock(const spvtools::ir::Function* fn, + uint32_t id) { + for (const spvtools::ir::BasicBlock& bb : *fn) { + if (bb.id() == id) { + return &bb; + } + } + return nullptr; +} + +} // namespace spvtest + +#endif // LIBSPIRV_TEST_OPT_FUNCTION_UTILS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/if_conversion_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/if_conversion_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/if_conversion_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/if_conversion_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,332 @@ +// Copyright (c) 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "assembly_builder.h" +#include "gmock/gmock.h" +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using IfConversionTest = PassTest<::testing::Test>; + +#ifdef SPIRV_EFFCEE +TEST_F(IfConversionTest, TestSimpleIfThenElse) { + const std::string text = R"( +; CHECK: OpSelectionMerge [[merge:%\w+]] +; CHECK: [[merge]] = OpLabel +; CHECK-NOT: OpPhi +; CHECK: [[sel:%\w+]] = OpSelect %uint %true %uint_0 %uint_1 +; CHECK OpStore {{%\w+}} [[sel]] +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %1 "func" %2 +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%_ptr_Output_uint = OpTypePointer Output %uint +%2 = OpVariable %_ptr_Output_uint Output +%11 = OpTypeFunction %void +%1 = OpFunction %void None %11 +%12 = OpLabel +OpSelectionMerge %14 None +OpBranchConditional %true %15 %16 +%15 = OpLabel +OpBranch %14 +%16 = OpLabel +OpBranch %14 +%14 = OpLabel +%18 = OpPhi %uint %uint_0 %15 %uint_1 %16 +OpStore %2 %18 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(IfConversionTest, TestSimpleHalfIfTrue) { + const std::string text = R"( +; CHECK: OpSelectionMerge [[merge:%\w+]] +; CHECK: [[merge]] = OpLabel +; CHECK-NOT: OpPhi +; CHECK: [[sel:%\w+]] = OpSelect %uint %true %uint_0 %uint_1 +; CHECK OpStore {{%\w+}} [[sel]] +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %1 "func" %2 +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%_ptr_Output_uint = OpTypePointer Output %uint +%2 = OpVariable %_ptr_Output_uint Output +%11 = OpTypeFunction %void +%1 = OpFunction %void None %11 +%12 = OpLabel +OpSelectionMerge %14 None +OpBranchConditional %true %15 %14 +%15 = OpLabel +OpBranch %14 +%14 = OpLabel +%18 = OpPhi %uint %uint_0 %15 %uint_1 %12 +OpStore %2 %18 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(IfConversionTest, TestSimpleHalfIfExtraBlock) { + const std::string text = R"( +; CHECK: OpSelectionMerge [[merge:%\w+]] +; CHECK: [[merge]] = OpLabel +; CHECK-NOT: OpPhi +; CHECK: [[sel:%\w+]] = OpSelect %uint %true %uint_0 %uint_1 +; CHECK OpStore {{%\w+}} [[sel]] +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %1 "func" %2 +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%_ptr_Output_uint = OpTypePointer Output %uint +%2 = OpVariable %_ptr_Output_uint Output +%11 = OpTypeFunction %void +%1 = OpFunction %void None %11 +%12 = OpLabel +OpSelectionMerge %14 None +OpBranchConditional %true %15 %14 +%15 = OpLabel +OpBranch %16 +%16 = OpLabel +OpBranch %14 +%14 = OpLabel +%18 = OpPhi %uint %uint_0 %15 %uint_1 %12 +OpStore %2 %18 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(IfConversionTest, TestSimpleHalfIfFalse) { + const std::string text = R"( +; CHECK: OpSelectionMerge [[merge:%\w+]] +; CHECK: [[merge]] = OpLabel +; CHECK-NOT: OpPhi +; CHECK: [[sel:%\w+]] = OpSelect %uint %true %uint_0 %uint_1 +; CHECK OpStore {{%\w+}} [[sel]] +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %1 "func" %2 +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%_ptr_Output_uint = OpTypePointer Output %uint +%2 = OpVariable %_ptr_Output_uint Output +%11 = OpTypeFunction %void +%1 = OpFunction %void None %11 +%12 = OpLabel +OpSelectionMerge %14 None +OpBranchConditional %true %14 %15 +%15 = OpLabel +OpBranch %14 +%14 = OpLabel +%18 = OpPhi %uint %uint_0 %12 %uint_1 %15 +OpStore %2 %18 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(IfConversionTest, TestVectorSplat) { + const std::string text = R"( +; CHECK: [[bool_vec:%\w+]] = OpTypeVector %bool 2 +; CHECK: OpSelectionMerge [[merge:%\w+]] +; CHECK: [[merge]] = OpLabel +; CHECK-NOT: OpPhi +; CHECK: [[comp:%\w+]] = OpCompositeConstruct [[bool_vec]] %true %true +; CHECK: [[sel:%\w+]] = OpSelect {{%\w+}} [[comp]] +; CHECK OpStore {{%\w+}} [[sel]] +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %1 "func" %2 +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%uint_vec2 = OpTypeVector %uint 2 +%vec2_01 = OpConstantComposite %uint_vec2 %uint_0 %uint_1 +%vec2_10 = OpConstantComposite %uint_vec2 %uint_1 %uint_0 +%_ptr_Output_uint = OpTypePointer Output %uint_vec2 +%2 = OpVariable %_ptr_Output_uint Output +%11 = OpTypeFunction %void +%1 = OpFunction %void None %11 +%12 = OpLabel +OpSelectionMerge %14 None +OpBranchConditional %true %15 %16 +%15 = OpLabel +OpBranch %14 +%16 = OpLabel +OpBranch %14 +%14 = OpLabel +%18 = OpPhi %uint_vec2 %vec2_01 %15 %vec2_10 %16 +OpStore %2 %18 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} +#endif // SPIRV_EFFCEE + +TEST_F(IfConversionTest, NoCommonDominator) { + const std::string text = R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %1 "func" %2 +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%_ptr_Output_uint = OpTypePointer Output %uint +%2 = OpVariable %_ptr_Output_uint Output +%8 = OpTypeFunction %void +%1 = OpFunction %void None %8 +%9 = OpLabel +OpBranch %10 +%11 = OpLabel +OpBranch %10 +%10 = OpLabel +%12 = OpPhi %uint %uint_0 %9 %uint_1 %11 +OpStore %2 %12 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(text, text, true, true); +} + +TEST_F(IfConversionTest, LoopUntouched) { + const std::string text = R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %1 "func" %2 +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%_ptr_Output_uint = OpTypePointer Output %uint +%2 = OpVariable %_ptr_Output_uint Output +%8 = OpTypeFunction %void +%bool = OpTypeBool +%true = OpConstantTrue %bool +%1 = OpFunction %void None %8 +%11 = OpLabel +OpBranch %12 +%12 = OpLabel +%13 = OpPhi %uint %uint_0 %11 %uint_1 %12 +OpLoopMerge %14 %12 None +OpBranchConditional %true %14 %12 +%14 = OpLabel +OpStore %2 %13 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(text, text, true, true); +} + +TEST_F(IfConversionTest, TooManyPredecessors) { + const std::string text = R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %1 "func" %2 +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%_ptr_Output_uint = OpTypePointer Output %uint +%2 = OpVariable %_ptr_Output_uint Output +%8 = OpTypeFunction %void +%bool = OpTypeBool +%true = OpConstantTrue %bool +%1 = OpFunction %void None %8 +%11 = OpLabel +OpSelectionMerge %12 None +OpBranchConditional %true %13 %12 +%13 = OpLabel +OpBranchConditional %true %14 %15 +%14 = OpLabel +OpBranch %12 +%15 = OpLabel +OpBranch %12 +%12 = OpLabel +%16 = OpPhi %uint %uint_0 %11 %uint_0 %14 %uint_1 %15 +OpStore %2 %16 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(text, text, true, true); +} + +TEST_F(IfConversionTest, NoCodeMotion) { + const std::string text = R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %1 "func" %2 +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%_ptr_Output_uint = OpTypePointer Output %uint +%2 = OpVariable %_ptr_Output_uint Output +%8 = OpTypeFunction %void +%bool = OpTypeBool +%true = OpConstantTrue %bool +%1 = OpFunction %void None %8 +%11 = OpLabel +OpSelectionMerge %12 None +OpBranchConditional %true %13 %12 +%13 = OpLabel +%14 = OpIAdd %uint %uint_0 %uint_1 +OpBranch %12 +%12 = OpLabel +%15 = OpPhi %uint %uint_0 %11 %14 %13 +OpStore %2 %15 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(text, text, true, true); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/inline_opaque_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/inline_opaque_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/inline_opaque_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/inline_opaque_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,408 @@ +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using InlineOpaqueTest = PassTest<::testing::Test>; + +TEST_F(InlineOpaqueTest, InlineCallWithStructArgContainingSampledImage) { + // Function with opaque argument is inlined. + // TODO(greg-lunarg): Add HLSL code + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %outColor %texCoords +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S_t "S_t" +OpMemberName %S_t 0 "v0" +OpMemberName %S_t 1 "v1" +OpMemberName %S_t 2 "smp" +OpName %foo_struct_S_t_vf2_vf21_ "foo(struct-S_t-vf2-vf21;" +OpName %s "s" +OpName %outColor "outColor" +OpName %sampler15 "sampler15" +OpName %s0 "s0" +OpName %texCoords "texCoords" +OpName %param "param" +OpDecorate %sampler15 DescriptorSet 0 +%void = OpTypeVoid +%12 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v2float = OpTypeVector %float 2 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%outColor = OpVariable %_ptr_Output_v4float Output +%17 = OpTypeImage %float 2D 0 0 0 1 Unknown +%18 = OpTypeSampledImage %17 +%S_t = OpTypeStruct %v2float %v2float %18 +%_ptr_Function_S_t = OpTypePointer Function %S_t +%20 = OpTypeFunction %void %_ptr_Function_S_t +%_ptr_UniformConstant_18 = OpTypePointer UniformConstant %18 +%_ptr_Function_18 = OpTypePointer Function %18 +%sampler15 = OpVariable %_ptr_UniformConstant_18 UniformConstant +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%int_2 = OpConstant %int 2 +%_ptr_Function_v2float = OpTypePointer Function %v2float +%_ptr_Input_v2float = OpTypePointer Input %v2float +%texCoords = OpVariable %_ptr_Input_v2float Input +)"; + + const std::string before = + R"(%main = OpFunction %void None %12 +%28 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%param = OpVariable %_ptr_Function_S_t Function +%29 = OpLoad %v2float %texCoords +%30 = OpAccessChain %_ptr_Function_v2float %s0 %int_0 +OpStore %30 %29 +%31 = OpLoad %18 %sampler15 +%32 = OpAccessChain %_ptr_Function_18 %s0 %int_2 +OpStore %32 %31 +%33 = OpLoad %S_t %s0 +OpStore %param %33 +%34 = OpFunctionCall %void %foo_struct_S_t_vf2_vf21_ %param +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %12 +%28 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%param = OpVariable %_ptr_Function_S_t Function +%29 = OpLoad %v2float %texCoords +%30 = OpAccessChain %_ptr_Function_v2float %s0 %int_0 +OpStore %30 %29 +%31 = OpLoad %18 %sampler15 +%32 = OpAccessChain %_ptr_Function_18 %s0 %int_2 +OpStore %32 %31 +%33 = OpLoad %S_t %s0 +OpStore %param %33 +%41 = OpAccessChain %_ptr_Function_18 %param %int_2 +%42 = OpLoad %18 %41 +%43 = OpAccessChain %_ptr_Function_v2float %param %int_0 +%44 = OpLoad %v2float %43 +%45 = OpImageSampleImplicitLod %v4float %42 %44 +OpStore %outColor %45 +OpReturn +OpFunctionEnd +)"; + + const std::string post_defs = + R"(%foo_struct_S_t_vf2_vf21_ = OpFunction %void None %20 +%s = OpFunctionParameter %_ptr_Function_S_t +%35 = OpLabel +%36 = OpAccessChain %_ptr_Function_18 %s %int_2 +%37 = OpLoad %18 %36 +%38 = OpAccessChain %_ptr_Function_v2float %s %int_0 +%39 = OpLoad %v2float %38 +%40 = OpImageSampleImplicitLod %v4float %37 %39 +OpStore %outColor %40 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before + post_defs, predefs + after + post_defs, true, true); +} + +TEST_F(InlineOpaqueTest, InlineOpaqueReturn) { + // Function with opaque return value is inlined. + // TODO(greg-lunarg): Add HLSL code + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %texCoords %outColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %foo_ "foo(" +OpName %texCoords "texCoords" +OpName %outColor "outColor" +OpName %sampler15 "sampler15" +OpName %sampler16 "sampler16" +OpDecorate %sampler15 DescriptorSet 0 +OpDecorate %sampler16 DescriptorSet 0 +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v2float = OpTypeVector %float 2 +%bool = OpTypeBool +%false = OpConstantFalse %bool +%_ptr_Input_v2float = OpTypePointer Input %v2float +%texCoords = OpVariable %_ptr_Input_v2float Input +%float_0 = OpConstant %float 0 +%16 = OpConstantComposite %v2float %float_0 %float_0 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%outColor = OpVariable %_ptr_Output_v4float Output +%19 = OpTypeImage %float 2D 0 0 0 1 Unknown +%20 = OpTypeSampledImage %19 +%21 = OpTypeFunction %20 +%_ptr_UniformConstant_20 = OpTypePointer UniformConstant %20 +%_ptr_Function_20 = OpTypePointer Function %20 +%sampler15 = OpVariable %_ptr_UniformConstant_20 UniformConstant +%sampler16 = OpVariable %_ptr_UniformConstant_20 UniformConstant +)"; + + const std::string before = + R"(%main = OpFunction %void None %9 +%24 = OpLabel +%25 = OpVariable %_ptr_Function_20 Function +%26 = OpFunctionCall %20 %foo_ +OpStore %25 %26 +%27 = OpLoad %20 %25 +%28 = OpLoad %v2float %texCoords +%29 = OpImageSampleImplicitLod %v4float %27 %28 +OpStore %outColor %29 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %9 +%24 = OpLabel +%34 = OpVariable %_ptr_Function_20 Function +%35 = OpVariable %_ptr_Function_20 Function +%25 = OpVariable %_ptr_Function_20 Function +%36 = OpLoad %20 %sampler16 +OpStore %34 %36 +%37 = OpLoad %20 %34 +OpStore %35 %37 +%26 = OpLoad %20 %35 +OpStore %25 %26 +%27 = OpLoad %20 %25 +%28 = OpLoad %v2float %texCoords +%29 = OpImageSampleImplicitLod %v4float %27 %28 +OpStore %outColor %29 +OpReturn +OpFunctionEnd +)"; + + const std::string post_defs = + R"(%foo_ = OpFunction %20 None %21 +%30 = OpLabel +%31 = OpVariable %_ptr_Function_20 Function +%32 = OpLoad %20 %sampler16 +OpStore %31 %32 +%33 = OpLoad %20 %31 +OpReturnValue %33 +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before + post_defs, predefs + after + post_defs, true, true); +} + +TEST_F(InlineOpaqueTest, InlineInNonEntryPointFunction) { + // This demonstrates opaque inlining in a function that is not + // an entry point function (main2) but is in the call tree of an + // entry point function (main). + // TODO(greg-lunarg): Add HLSL code + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %outColor %texCoords +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %main2 "main2" +OpName %S_t "S_t" +OpMemberName %S_t 0 "v0" +OpMemberName %S_t 1 "v1" +OpMemberName %S_t 2 "smp" +OpName %foo_struct_S_t_vf2_vf21_ "foo(struct-S_t-vf2-vf21;" +OpName %s "s" +OpName %outColor "outColor" +OpName %sampler15 "sampler15" +OpName %s0 "s0" +OpName %texCoords "texCoords" +OpName %param "param" +OpDecorate %sampler15 DescriptorSet 0 +%void = OpTypeVoid +%13 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v2float = OpTypeVector %float 2 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%outColor = OpVariable %_ptr_Output_v4float Output +%18 = OpTypeImage %float 2D 0 0 0 1 Unknown +%19 = OpTypeSampledImage %18 +%S_t = OpTypeStruct %v2float %v2float %19 +%_ptr_Function_S_t = OpTypePointer Function %S_t +%21 = OpTypeFunction %void %_ptr_Function_S_t +%_ptr_UniformConstant_19 = OpTypePointer UniformConstant %19 +%_ptr_Function_19 = OpTypePointer Function %19 +%sampler15 = OpVariable %_ptr_UniformConstant_19 UniformConstant +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%int_2 = OpConstant %int 2 +%_ptr_Function_v2float = OpTypePointer Function %v2float +%_ptr_Input_v2float = OpTypePointer Input %v2float +%texCoords = OpVariable %_ptr_Input_v2float Input +)"; + + const std::string before = + R"(%main2 = OpFunction %void None %13 +%29 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%param = OpVariable %_ptr_Function_S_t Function +%30 = OpLoad %v2float %texCoords +%31 = OpAccessChain %_ptr_Function_v2float %s0 %int_0 +OpStore %31 %30 +%32 = OpLoad %19 %sampler15 +%33 = OpAccessChain %_ptr_Function_19 %s0 %int_2 +OpStore %33 %32 +%34 = OpLoad %S_t %s0 +OpStore %param %34 +%35 = OpFunctionCall %void %foo_struct_S_t_vf2_vf21_ %param +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main2 = OpFunction %void None %13 +%29 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%param = OpVariable %_ptr_Function_S_t Function +%30 = OpLoad %v2float %texCoords +%31 = OpAccessChain %_ptr_Function_v2float %s0 %int_0 +OpStore %31 %30 +%32 = OpLoad %19 %sampler15 +%33 = OpAccessChain %_ptr_Function_19 %s0 %int_2 +OpStore %33 %32 +%34 = OpLoad %S_t %s0 +OpStore %param %34 +%44 = OpAccessChain %_ptr_Function_19 %param %int_2 +%45 = OpLoad %19 %44 +%46 = OpAccessChain %_ptr_Function_v2float %param %int_0 +%47 = OpLoad %v2float %46 +%48 = OpImageSampleImplicitLod %v4float %45 %47 +OpStore %outColor %48 +OpReturn +OpFunctionEnd +)"; + + const std::string post_defs = + R"(%main = OpFunction %void None %13 +%36 = OpLabel +%37 = OpFunctionCall %void %main2 +OpReturn +OpFunctionEnd +%foo_struct_S_t_vf2_vf21_ = OpFunction %void None %21 +%s = OpFunctionParameter %_ptr_Function_S_t +%38 = OpLabel +%39 = OpAccessChain %_ptr_Function_19 %s %int_2 +%40 = OpLoad %19 %39 +%41 = OpAccessChain %_ptr_Function_v2float %s %int_0 +%42 = OpLoad %v2float %41 +%43 = OpImageSampleImplicitLod %v4float %40 %42 +OpStore %outColor %43 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before + post_defs, predefs + after + post_defs, true, true); +} + +TEST_F(InlineOpaqueTest, NoInlineNoOpaque) { + // Function without opaque interface is not inlined. + // #version 140 + // + // in vec4 BaseColor; + // + // float foo(vec4 bar) + // { + // return bar.x + bar.y; + // } + // + // void main() + // { + // vec4 color = vec4(foo(BaseColor)); + // gl_FragColor = color; + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %foo_vf4_ "foo(vf4;" +OpName %bar "bar" +OpName %color "color" +OpName %BaseColor "BaseColor" +OpName %param "param" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%14 = OpTypeFunction %float %_ptr_Function_v4float +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%_ptr_Function_float = OpTypePointer Function %float +%uint_1 = OpConstant %uint 1 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %10 +%21 = OpLabel +%color = OpVariable %_ptr_Function_v4float Function +%param = OpVariable %_ptr_Function_v4float Function +%22 = OpLoad %v4float %BaseColor +OpStore %param %22 +%23 = OpFunctionCall %float %foo_vf4_ %param +%24 = OpCompositeConstruct %v4float %23 %23 %23 %23 +OpStore %color %24 +%25 = OpLoad %v4float %color +OpStore %gl_FragColor %25 +OpReturn +OpFunctionEnd +%foo_vf4_ = OpFunction %float None %14 +%bar = OpFunctionParameter %_ptr_Function_v4float +%26 = OpLabel +%27 = OpAccessChain %_ptr_Function_float %bar %uint_0 +%28 = OpLoad %float %27 +%29 = OpAccessChain %_ptr_Function_float %bar %uint_1 +%30 = OpLoad %float %29 +%31 = OpFAdd %float %28 %30 +OpReturnValue %31 +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, true); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/inline_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/inline_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/inline_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/inline_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,2612 @@ +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using InlineTest = PassTest<::testing::Test>; + +TEST_F(InlineTest, Simple) { + // #version 140 + // + // in vec4 BaseColor; + // + // float foo(vec4 bar) + // { + // return bar.x + bar.y; + // } + // + // void main() + // { + // vec4 color = vec4(foo(BaseColor)); + // gl_FragColor = color; + // } + const std::vector predefs = { + // clang-format off + "OpCapability Shader", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Fragment %main \"main\" %BaseColor %gl_FragColor", + "OpExecutionMode %main OriginUpperLeft", + "OpSource GLSL 140", + "OpName %main \"main\"", + "OpName %foo_vf4_ \"foo(vf4;\"", + "OpName %bar \"bar\"", + "OpName %color \"color\"", + "OpName %BaseColor \"BaseColor\"", + "OpName %param \"param\"", + "OpName %gl_FragColor \"gl_FragColor\"", + "%void = OpTypeVoid", + "%10 = OpTypeFunction %void", + "%float = OpTypeFloat 32", + "%v4float = OpTypeVector %float 4", +"%_ptr_Function_v4float = OpTypePointer Function %v4float", + "%14 = OpTypeFunction %float %_ptr_Function_v4float", + "%uint = OpTypeInt 32 0", + "%uint_0 = OpConstant %uint 0", +"%_ptr_Function_float = OpTypePointer Function %float", + "%uint_1 = OpConstant %uint 1", +"%_ptr_Input_v4float = OpTypePointer Input %v4float", + "%BaseColor = OpVariable %_ptr_Input_v4float Input", +"%_ptr_Output_v4float = OpTypePointer Output %v4float", +"%gl_FragColor = OpVariable %_ptr_Output_v4float Output", + // clang-format on + }; + + const std::vector nonEntryFuncs = { + // clang-format off + "%foo_vf4_ = OpFunction %float None %14", + "%bar = OpFunctionParameter %_ptr_Function_v4float", + "%26 = OpLabel", + "%27 = OpAccessChain %_ptr_Function_float %bar %uint_0", + "%28 = OpLoad %float %27", + "%29 = OpAccessChain %_ptr_Function_float %bar %uint_1", + "%30 = OpLoad %float %29", + "%31 = OpFAdd %float %28 %30", + "OpReturnValue %31", + "OpFunctionEnd", + // clang-format on + }; + + const std::vector before = { + // clang-format off + "%main = OpFunction %void None %10", + "%21 = OpLabel", + "%color = OpVariable %_ptr_Function_v4float Function", + "%param = OpVariable %_ptr_Function_v4float Function", + "%22 = OpLoad %v4float %BaseColor", + "OpStore %param %22", + "%23 = OpFunctionCall %float %foo_vf4_ %param", + "%24 = OpCompositeConstruct %v4float %23 %23 %23 %23", + "OpStore %color %24", + "%25 = OpLoad %v4float %color", + "OpStore %gl_FragColor %25", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + + const std::vector after = { + // clang-format off + "%main = OpFunction %void None %10", + "%21 = OpLabel", + "%32 = OpVariable %_ptr_Function_float Function", + "%color = OpVariable %_ptr_Function_v4float Function", + "%param = OpVariable %_ptr_Function_v4float Function", + "%22 = OpLoad %v4float %BaseColor", + "OpStore %param %22", + "%33 = OpAccessChain %_ptr_Function_float %param %uint_0", + "%34 = OpLoad %float %33", + "%35 = OpAccessChain %_ptr_Function_float %param %uint_1", + "%36 = OpLoad %float %35", + "%37 = OpFAdd %float %34 %36", + "OpStore %32 %37", + "%23 = OpLoad %float %32", + "%24 = OpCompositeConstruct %v4float %23 %23 %23 %23", + "OpStore %color %24", + "%25 = OpLoad %v4float %color", + "OpStore %gl_FragColor %25", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + SinglePassRunAndCheck( + JoinAllInsts(Concat(Concat(predefs, before), nonEntryFuncs)), + JoinAllInsts(Concat(Concat(predefs, after), nonEntryFuncs)), + /* skip_nop = */ false, /* do_validate = */ true); +} + +TEST_F(InlineTest, Nested) { + // #version 140 + // + // in vec4 BaseColor; + // + // float foo2(float f, float f2) + // { + // return f * f2; + // } + // + // float foo(vec4 bar) + // { + // return foo2(bar.x + bar.y, bar.z); + // } + // + // void main() + // { + // vec4 color = vec4(foo(BaseColor)); + // gl_FragColor = color; + // } + const std::vector predefs = { + // clang-format off + "OpCapability Shader", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Fragment %main \"main\" %BaseColor %gl_FragColor", + "OpExecutionMode %main OriginUpperLeft", + "OpSource GLSL 140", + "OpName %main \"main\"", + "OpName %foo2_f1_f1_ \"foo2(f1;f1;\"", + "OpName %f \"f\"", + "OpName %f2 \"f2\"", + "OpName %foo_vf4_ \"foo(vf4;\"", + "OpName %bar \"bar\"", + "OpName %param \"param\"", + "OpName %param_0 \"param\"", + "OpName %color \"color\"", + "OpName %BaseColor \"BaseColor\"", + "OpName %param_1 \"param\"", + "OpName %gl_FragColor \"gl_FragColor\"", + "%void = OpTypeVoid", + "%15 = OpTypeFunction %void", + "%float = OpTypeFloat 32", +"%_ptr_Function_float = OpTypePointer Function %float", + "%18 = OpTypeFunction %float %_ptr_Function_float %_ptr_Function_float", + "%v4float = OpTypeVector %float 4", +"%_ptr_Function_v4float = OpTypePointer Function %v4float", + "%21 = OpTypeFunction %float %_ptr_Function_v4float", + "%uint = OpTypeInt 32 0", + "%uint_0 = OpConstant %uint 0", + "%uint_1 = OpConstant %uint 1", + "%uint_2 = OpConstant %uint 2", +"%_ptr_Input_v4float = OpTypePointer Input %v4float", + "%BaseColor = OpVariable %_ptr_Input_v4float Input", +"%_ptr_Output_v4float = OpTypePointer Output %v4float", +"%gl_FragColor = OpVariable %_ptr_Output_v4float Output", + // clang-format on + }; + + const std::vector nonEntryFuncs = { + // clang-format off +"%foo2_f1_f1_ = OpFunction %float None %18", + "%f = OpFunctionParameter %_ptr_Function_float", + "%f2 = OpFunctionParameter %_ptr_Function_float", + "%33 = OpLabel", + "%34 = OpLoad %float %f", + "%35 = OpLoad %float %f2", + "%36 = OpFMul %float %34 %35", + "OpReturnValue %36", + "OpFunctionEnd", + "%foo_vf4_ = OpFunction %float None %21", + "%bar = OpFunctionParameter %_ptr_Function_v4float", + "%37 = OpLabel", + "%param = OpVariable %_ptr_Function_float Function", + "%param_0 = OpVariable %_ptr_Function_float Function", + "%38 = OpAccessChain %_ptr_Function_float %bar %uint_0", + "%39 = OpLoad %float %38", + "%40 = OpAccessChain %_ptr_Function_float %bar %uint_1", + "%41 = OpLoad %float %40", + "%42 = OpFAdd %float %39 %41", + "OpStore %param %42", + "%43 = OpAccessChain %_ptr_Function_float %bar %uint_2", + "%44 = OpLoad %float %43", + "OpStore %param_0 %44", + "%45 = OpFunctionCall %float %foo2_f1_f1_ %param %param_0", + "OpReturnValue %45", + "OpFunctionEnd", + // clang-format on + }; + + const std::vector before = { + // clang-format off + "%main = OpFunction %void None %15", + "%28 = OpLabel", + "%color = OpVariable %_ptr_Function_v4float Function", + "%param_1 = OpVariable %_ptr_Function_v4float Function", + "%29 = OpLoad %v4float %BaseColor", + "OpStore %param_1 %29", + "%30 = OpFunctionCall %float %foo_vf4_ %param_1", + "%31 = OpCompositeConstruct %v4float %30 %30 %30 %30", + "OpStore %color %31", + "%32 = OpLoad %v4float %color", + "OpStore %gl_FragColor %32", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + + const std::vector after = { + // clang-format off + "%main = OpFunction %void None %15", + "%28 = OpLabel", + "%57 = OpVariable %_ptr_Function_float Function", + "%46 = OpVariable %_ptr_Function_float Function", + "%47 = OpVariable %_ptr_Function_float Function", + "%48 = OpVariable %_ptr_Function_float Function", + "%color = OpVariable %_ptr_Function_v4float Function", + "%param_1 = OpVariable %_ptr_Function_v4float Function", + "%29 = OpLoad %v4float %BaseColor", + "OpStore %param_1 %29", + "%49 = OpAccessChain %_ptr_Function_float %param_1 %uint_0", + "%50 = OpLoad %float %49", + "%51 = OpAccessChain %_ptr_Function_float %param_1 %uint_1", + "%52 = OpLoad %float %51", + "%53 = OpFAdd %float %50 %52", + "OpStore %46 %53", + "%54 = OpAccessChain %_ptr_Function_float %param_1 %uint_2", + "%55 = OpLoad %float %54", + "OpStore %47 %55", + "%58 = OpLoad %float %46", + "%59 = OpLoad %float %47", + "%60 = OpFMul %float %58 %59", + "OpStore %57 %60", + "%56 = OpLoad %float %57", + "OpStore %48 %56", + "%30 = OpLoad %float %48", + "%31 = OpCompositeConstruct %v4float %30 %30 %30 %30", + "OpStore %color %31", + "%32 = OpLoad %v4float %color", + "OpStore %gl_FragColor %32", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + SinglePassRunAndCheck( + JoinAllInsts(Concat(Concat(predefs, before), nonEntryFuncs)), + JoinAllInsts(Concat(Concat(predefs, after), nonEntryFuncs)), + /* skip_nop = */ false, /* do_validate = */ true); +} + +TEST_F(InlineTest, InOutParameter) { + // #version 400 + // + // in vec4 Basecolor; + // + // void foo(inout vec4 bar) + // { + // bar.z = bar.x + bar.y; + // } + // + // void main() + // { + // vec4 b = Basecolor; + // foo(b); + // vec4 color = vec4(b.z); + // gl_FragColor = color; + // } + const std::vector predefs = { + // clang-format off + "OpCapability Shader", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Fragment %main \"main\" %Basecolor %gl_FragColor", + "OpExecutionMode %main OriginUpperLeft", + "OpSource GLSL 400", + "OpName %main \"main\"", + "OpName %foo_vf4_ \"foo(vf4;\"", + "OpName %bar \"bar\"", + "OpName %b \"b\"", + "OpName %Basecolor \"Basecolor\"", + "OpName %param \"param\"", + "OpName %color \"color\"", + "OpName %gl_FragColor \"gl_FragColor\"", + "%void = OpTypeVoid", + "%11 = OpTypeFunction %void", + "%float = OpTypeFloat 32", + "%v4float = OpTypeVector %float 4", +"%_ptr_Function_v4float = OpTypePointer Function %v4float", + "%15 = OpTypeFunction %void %_ptr_Function_v4float", + "%uint = OpTypeInt 32 0", + "%uint_0 = OpConstant %uint 0", +"%_ptr_Function_float = OpTypePointer Function %float", + "%uint_1 = OpConstant %uint 1", + "%uint_2 = OpConstant %uint 2", +"%_ptr_Input_v4float = OpTypePointer Input %v4float", + "%Basecolor = OpVariable %_ptr_Input_v4float Input", +"%_ptr_Output_v4float = OpTypePointer Output %v4float", +"%gl_FragColor = OpVariable %_ptr_Output_v4float Output", + // clang-format on + }; + + const std::vector nonEntryFuncs = { + // clang-format off + "%foo_vf4_ = OpFunction %void None %15", + "%bar = OpFunctionParameter %_ptr_Function_v4float", + "%32 = OpLabel", + "%33 = OpAccessChain %_ptr_Function_float %bar %uint_0", + "%34 = OpLoad %float %33", + "%35 = OpAccessChain %_ptr_Function_float %bar %uint_1", + "%36 = OpLoad %float %35", + "%37 = OpFAdd %float %34 %36", + "%38 = OpAccessChain %_ptr_Function_float %bar %uint_2", + "OpStore %38 %37", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + + const std::vector before = { + // clang-format off + "%main = OpFunction %void None %11", + "%23 = OpLabel", + "%b = OpVariable %_ptr_Function_v4float Function", + "%param = OpVariable %_ptr_Function_v4float Function", + "%color = OpVariable %_ptr_Function_v4float Function", + "%24 = OpLoad %v4float %Basecolor", + "OpStore %b %24", + "%25 = OpLoad %v4float %b", + "OpStore %param %25", + "%26 = OpFunctionCall %void %foo_vf4_ %param", + "%27 = OpLoad %v4float %param", + "OpStore %b %27", + "%28 = OpAccessChain %_ptr_Function_float %b %uint_2", + "%29 = OpLoad %float %28", + "%30 = OpCompositeConstruct %v4float %29 %29 %29 %29", + "OpStore %color %30", + "%31 = OpLoad %v4float %color", + "OpStore %gl_FragColor %31", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + + const std::vector after = { + // clang-format off + "%main = OpFunction %void None %11", + "%23 = OpLabel", + "%b = OpVariable %_ptr_Function_v4float Function", + "%param = OpVariable %_ptr_Function_v4float Function", + "%color = OpVariable %_ptr_Function_v4float Function", + "%24 = OpLoad %v4float %Basecolor", + "OpStore %b %24", + "%25 = OpLoad %v4float %b", + "OpStore %param %25", + "%39 = OpAccessChain %_ptr_Function_float %param %uint_0", + "%40 = OpLoad %float %39", + "%41 = OpAccessChain %_ptr_Function_float %param %uint_1", + "%42 = OpLoad %float %41", + "%43 = OpFAdd %float %40 %42", + "%44 = OpAccessChain %_ptr_Function_float %param %uint_2", + "OpStore %44 %43", + "%27 = OpLoad %v4float %param", + "OpStore %b %27", + "%28 = OpAccessChain %_ptr_Function_float %b %uint_2", + "%29 = OpLoad %float %28", + "%30 = OpCompositeConstruct %v4float %29 %29 %29 %29", + "OpStore %color %30", + "%31 = OpLoad %v4float %color", + "OpStore %gl_FragColor %31", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + SinglePassRunAndCheck( + JoinAllInsts(Concat(Concat(predefs, before), nonEntryFuncs)), + JoinAllInsts(Concat(Concat(predefs, after), nonEntryFuncs)), + /* skip_nop = */ false, /* do_validate = */ true); +} + +TEST_F(InlineTest, BranchInCallee) { + // #version 140 + // + // in vec4 BaseColor; + // + // float foo(vec4 bar) + // { + // float r = bar.x; + // if (r < 0.0) + // r = -r; + // return r; + // } + // + // void main() + // { + // vec4 color = vec4(foo(BaseColor)); + // + // gl_FragColor = color; + // } + const std::vector predefs = { + // clang-format off + "OpCapability Shader", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Fragment %main \"main\" %BaseColor %gl_FragColor", + "OpExecutionMode %main OriginUpperLeft", + "OpSource GLSL 140", + "OpName %main \"main\"", + "OpName %foo_vf4_ \"foo(vf4;\"", + "OpName %bar \"bar\"", + "OpName %r \"r\"", + "OpName %color \"color\"", + "OpName %BaseColor \"BaseColor\"", + "OpName %param \"param\"", + "OpName %gl_FragColor \"gl_FragColor\"", + "%void = OpTypeVoid", + "%11 = OpTypeFunction %void", + "%float = OpTypeFloat 32", + "%v4float = OpTypeVector %float 4", +"%_ptr_Function_v4float = OpTypePointer Function %v4float", + "%15 = OpTypeFunction %float %_ptr_Function_v4float", +"%_ptr_Function_float = OpTypePointer Function %float", + "%uint = OpTypeInt 32 0", + "%uint_0 = OpConstant %uint 0", + "%float_0 = OpConstant %float 0", + "%bool = OpTypeBool", +"%_ptr_Input_v4float = OpTypePointer Input %v4float", + "%BaseColor = OpVariable %_ptr_Input_v4float Input", +"%_ptr_Output_v4float = OpTypePointer Output %v4float", +"%gl_FragColor = OpVariable %_ptr_Output_v4float Output", + // clang-format on + }; + + const std::vector nonEntryFuncs = { + // clang-format off + "%foo_vf4_ = OpFunction %float None %15", + "%bar = OpFunctionParameter %_ptr_Function_v4float", + "%28 = OpLabel", + "%r = OpVariable %_ptr_Function_float Function", + "%29 = OpAccessChain %_ptr_Function_float %bar %uint_0", + "%30 = OpLoad %float %29", + "OpStore %r %30", + "%31 = OpLoad %float %r", + "%32 = OpFOrdLessThan %bool %31 %float_0", + "OpSelectionMerge %33 None", + "OpBranchConditional %32 %34 %33", + "%34 = OpLabel", + "%35 = OpLoad %float %r", + "%36 = OpFNegate %float %35", + "OpStore %r %36", + "OpBranch %33", + "%33 = OpLabel", + "%37 = OpLoad %float %r", + "OpReturnValue %37", + "OpFunctionEnd", + // clang-format on + }; + + const std::vector before = { + // clang-format off + "%main = OpFunction %void None %11", + "%23 = OpLabel", + "%color = OpVariable %_ptr_Function_v4float Function", + "%param = OpVariable %_ptr_Function_v4float Function", + "%24 = OpLoad %v4float %BaseColor", + "OpStore %param %24", + "%25 = OpFunctionCall %float %foo_vf4_ %param", + "%26 = OpCompositeConstruct %v4float %25 %25 %25 %25", + "OpStore %color %26", + "%27 = OpLoad %v4float %color", + "OpStore %gl_FragColor %27", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + + const std::vector after = { + // clang-format off + "%main = OpFunction %void None %11", + "%23 = OpLabel", + "%38 = OpVariable %_ptr_Function_float Function", + "%39 = OpVariable %_ptr_Function_float Function", + "%color = OpVariable %_ptr_Function_v4float Function", + "%param = OpVariable %_ptr_Function_v4float Function", + "%24 = OpLoad %v4float %BaseColor", + "OpStore %param %24", + "%40 = OpAccessChain %_ptr_Function_float %param %uint_0", + "%41 = OpLoad %float %40", + "OpStore %38 %41", + "%42 = OpLoad %float %38", + "%43 = OpFOrdLessThan %bool %42 %float_0", + "OpSelectionMerge %44 None", + "OpBranchConditional %43 %45 %44", + "%45 = OpLabel", + "%46 = OpLoad %float %38", + "%47 = OpFNegate %float %46", + "OpStore %38 %47", + "OpBranch %44", + "%44 = OpLabel", + "%48 = OpLoad %float %38", + "OpStore %39 %48", + "%25 = OpLoad %float %39", + "%26 = OpCompositeConstruct %v4float %25 %25 %25 %25", + "OpStore %color %26", + "%27 = OpLoad %v4float %color", + "OpStore %gl_FragColor %27", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + SinglePassRunAndCheck( + JoinAllInsts(Concat(Concat(predefs, before), nonEntryFuncs)), + JoinAllInsts(Concat(Concat(predefs, after), nonEntryFuncs)), + /* skip_nop = */ false, /* do_validate = */ true); +} + +TEST_F(InlineTest, PhiAfterCall) { + // #version 140 + // + // in vec4 BaseColor; + // + // float foo(float bar) + // { + // float r = bar; + // if (r < 0.0) + // r = -r; + // return r; + // } + // + // void main() + // { + // vec4 color = BaseColor; + // if (foo(color.x) > 2.0 && foo(color.y) > 2.0) + // color = vec4(0.0); + // gl_FragColor = color; + // } + const std::vector predefs = { + // clang-format off + "OpCapability Shader", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Fragment %main \"main\" %BaseColor %gl_FragColor", + "OpExecutionMode %main OriginUpperLeft", + "OpSource GLSL 140", + "OpName %main \"main\"", + "OpName %foo_f1_ \"foo(f1;\"", + "OpName %bar \"bar\"", + "OpName %r \"r\"", + "OpName %color \"color\"", + "OpName %BaseColor \"BaseColor\"", + "OpName %param \"param\"", + "OpName %param_0 \"param\"", + "OpName %gl_FragColor \"gl_FragColor\"", + "%void = OpTypeVoid", + "%12 = OpTypeFunction %void", + "%float = OpTypeFloat 32", +"%_ptr_Function_float = OpTypePointer Function %float", + "%15 = OpTypeFunction %float %_ptr_Function_float", + "%float_0 = OpConstant %float 0", + "%bool = OpTypeBool", + "%v4float = OpTypeVector %float 4", +"%_ptr_Function_v4float = OpTypePointer Function %v4float", +"%_ptr_Input_v4float = OpTypePointer Input %v4float", + "%BaseColor = OpVariable %_ptr_Input_v4float Input", + "%uint = OpTypeInt 32 0", + "%uint_0 = OpConstant %uint 0", + "%float_2 = OpConstant %float 2", + "%uint_1 = OpConstant %uint 1", + "%25 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0", +"%_ptr_Output_v4float = OpTypePointer Output %v4float", +"%gl_FragColor = OpVariable %_ptr_Output_v4float Output", + // clang-format on + }; + + const std::vector nonEntryFuncs = { + // clang-format off + "%foo_f1_ = OpFunction %float None %15", + "%bar = OpFunctionParameter %_ptr_Function_float", + "%43 = OpLabel", + "%r = OpVariable %_ptr_Function_float Function", + "%44 = OpLoad %float %bar", + "OpStore %r %44", + "%45 = OpLoad %float %r", + "%46 = OpFOrdLessThan %bool %45 %float_0", + "OpSelectionMerge %47 None", + "OpBranchConditional %46 %48 %47", + "%48 = OpLabel", + "%49 = OpLoad %float %r", + "%50 = OpFNegate %float %49", + "OpStore %r %50", + "OpBranch %47", + "%47 = OpLabel", + "%51 = OpLoad %float %r", + "OpReturnValue %51", + "OpFunctionEnd", + // clang-format on + }; + + const std::vector before = { + // clang-format off + "%main = OpFunction %void None %12", + "%27 = OpLabel", + "%color = OpVariable %_ptr_Function_v4float Function", + "%param = OpVariable %_ptr_Function_float Function", + "%param_0 = OpVariable %_ptr_Function_float Function", + "%28 = OpLoad %v4float %BaseColor", + "OpStore %color %28", + "%29 = OpAccessChain %_ptr_Function_float %color %uint_0", + "%30 = OpLoad %float %29", + "OpStore %param %30", + "%31 = OpFunctionCall %float %foo_f1_ %param", + "%32 = OpFOrdGreaterThan %bool %31 %float_2", + "OpSelectionMerge %33 None", + "OpBranchConditional %32 %34 %33", + "%34 = OpLabel", + "%35 = OpAccessChain %_ptr_Function_float %color %uint_1", + "%36 = OpLoad %float %35", + "OpStore %param_0 %36", + "%37 = OpFunctionCall %float %foo_f1_ %param_0", + "%38 = OpFOrdGreaterThan %bool %37 %float_2", + "OpBranch %33", + "%33 = OpLabel", + "%39 = OpPhi %bool %32 %27 %38 %34", + "OpSelectionMerge %40 None", + "OpBranchConditional %39 %41 %40", + "%41 = OpLabel", + "OpStore %color %25", + "OpBranch %40", + "%40 = OpLabel", + "%42 = OpLoad %v4float %color", + "OpStore %gl_FragColor %42", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + + const std::vector after = { + // clang-format off + "%main = OpFunction %void None %12", + "%27 = OpLabel", + "%62 = OpVariable %_ptr_Function_float Function", + "%63 = OpVariable %_ptr_Function_float Function", + "%52 = OpVariable %_ptr_Function_float Function", + "%53 = OpVariable %_ptr_Function_float Function", + "%color = OpVariable %_ptr_Function_v4float Function", + "%param = OpVariable %_ptr_Function_float Function", + "%param_0 = OpVariable %_ptr_Function_float Function", + "%28 = OpLoad %v4float %BaseColor", + "OpStore %color %28", + "%29 = OpAccessChain %_ptr_Function_float %color %uint_0", + "%30 = OpLoad %float %29", + "OpStore %param %30", + "%54 = OpLoad %float %param", + "OpStore %52 %54", + "%55 = OpLoad %float %52", + "%56 = OpFOrdLessThan %bool %55 %float_0", + "OpSelectionMerge %57 None", + "OpBranchConditional %56 %58 %57", + "%58 = OpLabel", + "%59 = OpLoad %float %52", + "%60 = OpFNegate %float %59", + "OpStore %52 %60", + "OpBranch %57", + "%57 = OpLabel", + "%61 = OpLoad %float %52", + "OpStore %53 %61", + "%31 = OpLoad %float %53", + "%32 = OpFOrdGreaterThan %bool %31 %float_2", + "OpSelectionMerge %33 None", + "OpBranchConditional %32 %34 %33", + "%34 = OpLabel", + "%35 = OpAccessChain %_ptr_Function_float %color %uint_1", + "%36 = OpLoad %float %35", + "OpStore %param_0 %36", + "%64 = OpLoad %float %param_0", + "OpStore %62 %64", + "%65 = OpLoad %float %62", + "%66 = OpFOrdLessThan %bool %65 %float_0", + "OpSelectionMerge %67 None", + "OpBranchConditional %66 %68 %67", + "%68 = OpLabel", + "%69 = OpLoad %float %62", + "%70 = OpFNegate %float %69", + "OpStore %62 %70", + "OpBranch %67", + "%67 = OpLabel", + "%71 = OpLoad %float %62", + "OpStore %63 %71", + "%37 = OpLoad %float %63", + "%38 = OpFOrdGreaterThan %bool %37 %float_2", + "OpBranch %33", + "%33 = OpLabel", + "%39 = OpPhi %bool %32 %57 %38 %67", + "OpSelectionMerge %40 None", + "OpBranchConditional %39 %41 %40", + "%41 = OpLabel", + "OpStore %color %25", + "OpBranch %40", + "%40 = OpLabel", + "%42 = OpLoad %v4float %color", + "OpStore %gl_FragColor %42", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + SinglePassRunAndCheck( + JoinAllInsts(Concat(Concat(predefs, before), nonEntryFuncs)), + JoinAllInsts(Concat(Concat(predefs, after), nonEntryFuncs)), + /* skip_nop = */ false, /* do_validate = */ true); +} + +TEST_F(InlineTest, OpSampledImageOutOfBlock) { + // #version 450 + // + // uniform texture2D t2D; + // uniform sampler samp; + // out vec4 FragColor; + // in vec4 BaseColor; + // + // float foo(vec4 bar) + // { + // float r = bar.x; + // if (r < 0.0) + // r = -r; + // return r; + // } + // + // void main() + // { + // vec4 color1 = texture(sampler2D(t2D, samp), vec2(1.0)); + // vec4 color2 = vec4(foo(BaseColor)); + // vec4 color3 = texture(sampler2D(t2D, samp), vec2(0.5)); + // FragColor = (color1 + color2 + color3)/3; + // } + // + // Note: the before SPIR-V will need to be edited to create a use of + // the OpSampledImage across the function call. + const std::vector predefs = { + // clang-format off + "OpCapability Shader", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Fragment %main \"main\" %BaseColor %FragColor", + "OpExecutionMode %main OriginUpperLeft", + "OpSource GLSL 450", + "OpName %main \"main\"", + "OpName %foo_vf4_ \"foo(vf4;\"", + "OpName %bar \"bar\"", + "OpName %r \"r\"", + "OpName %color1 \"color1\"", + "OpName %t2D \"t2D\"", + "OpName %samp \"samp\"", + "OpName %color2 \"color2\"", + "OpName %BaseColor \"BaseColor\"", + "OpName %param \"param\"", + "OpName %color3 \"color3\"", + "OpName %FragColor \"FragColor\"", + "OpDecorate %t2D DescriptorSet 0", + "OpDecorate %samp DescriptorSet 0", + "%void = OpTypeVoid", + "%15 = OpTypeFunction %void", + "%float = OpTypeFloat 32", + "%v4float = OpTypeVector %float 4", +"%_ptr_Function_v4float = OpTypePointer Function %v4float", + "%19 = OpTypeFunction %float %_ptr_Function_v4float", +"%_ptr_Function_float = OpTypePointer Function %float", + "%uint = OpTypeInt 32 0", + "%uint_0 = OpConstant %uint 0", + "%float_0 = OpConstant %float 0", + "%bool = OpTypeBool", + "%25 = OpTypeImage %float 2D 0 0 0 1 Unknown", +"%_ptr_UniformConstant_25 = OpTypePointer UniformConstant %25", + "%t2D = OpVariable %_ptr_UniformConstant_25 UniformConstant", + "%27 = OpTypeSampler", +"%_ptr_UniformConstant_27 = OpTypePointer UniformConstant %27", + "%samp = OpVariable %_ptr_UniformConstant_27 UniformConstant", + "%29 = OpTypeSampledImage %25", + "%v2float = OpTypeVector %float 2", + "%float_1 = OpConstant %float 1", + "%32 = OpConstantComposite %v2float %float_1 %float_1", +"%_ptr_Input_v4float = OpTypePointer Input %v4float", + "%BaseColor = OpVariable %_ptr_Input_v4float Input", + "%float_0_5 = OpConstant %float 0.5", + "%35 = OpConstantComposite %v2float %float_0_5 %float_0_5", +"%_ptr_Output_v4float = OpTypePointer Output %v4float", + "%FragColor = OpVariable %_ptr_Output_v4float Output", + "%float_3 = OpConstant %float 3", + // clang-format on + }; + + const std::vector nonEntryFuncs = { + // clang-format off + "%foo_vf4_ = OpFunction %float None %19", + "%bar = OpFunctionParameter %_ptr_Function_v4float", + "%56 = OpLabel", + "%r = OpVariable %_ptr_Function_float Function", + "%57 = OpAccessChain %_ptr_Function_float %bar %uint_0", + "%58 = OpLoad %float %57", + "OpStore %r %58", + "%59 = OpLoad %float %r", + "%60 = OpFOrdLessThan %bool %59 %float_0", + "OpSelectionMerge %61 None", + "OpBranchConditional %60 %62 %61", + "%62 = OpLabel", + "%63 = OpLoad %float %r", + "%64 = OpFNegate %float %63", + "OpStore %r %64", + "OpBranch %61", + "%61 = OpLabel", + "%65 = OpLoad %float %r", + "OpReturnValue %65", + "OpFunctionEnd", + // clang-format on + }; + + const std::vector before = { + // clang-format off + "%main = OpFunction %void None %15", + "%38 = OpLabel", + "%color1 = OpVariable %_ptr_Function_v4float Function", + "%color2 = OpVariable %_ptr_Function_v4float Function", + "%param = OpVariable %_ptr_Function_v4float Function", + "%color3 = OpVariable %_ptr_Function_v4float Function", + "%39 = OpLoad %25 %t2D", + "%40 = OpLoad %27 %samp", + "%41 = OpSampledImage %29 %39 %40", + "%42 = OpImageSampleImplicitLod %v4float %41 %32", + "OpStore %color1 %42", + "%43 = OpLoad %v4float %BaseColor", + "OpStore %param %43", + "%44 = OpFunctionCall %float %foo_vf4_ %param", + "%45 = OpCompositeConstruct %v4float %44 %44 %44 %44", + "OpStore %color2 %45", + "%46 = OpLoad %25 %t2D", + "%47 = OpLoad %27 %samp", + "%48 = OpImageSampleImplicitLod %v4float %41 %35", + "OpStore %color3 %48", + "%49 = OpLoad %v4float %color1", + "%50 = OpLoad %v4float %color2", + "%51 = OpFAdd %v4float %49 %50", + "%52 = OpLoad %v4float %color3", + "%53 = OpFAdd %v4float %51 %52", + "%54 = OpCompositeConstruct %v4float %float_3 %float_3 %float_3 %float_3", + "%55 = OpFDiv %v4float %53 %54", + "OpStore %FragColor %55", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + + const std::vector after = { + // clang-format off + "%main = OpFunction %void None %15", + "%38 = OpLabel", + "%66 = OpVariable %_ptr_Function_float Function", + "%67 = OpVariable %_ptr_Function_float Function", + "%color1 = OpVariable %_ptr_Function_v4float Function", + "%color2 = OpVariable %_ptr_Function_v4float Function", + "%param = OpVariable %_ptr_Function_v4float Function", + "%color3 = OpVariable %_ptr_Function_v4float Function", + "%39 = OpLoad %25 %t2D", + "%40 = OpLoad %27 %samp", + "%41 = OpSampledImage %29 %39 %40", + "%42 = OpImageSampleImplicitLod %v4float %41 %32", + "OpStore %color1 %42", + "%43 = OpLoad %v4float %BaseColor", + "OpStore %param %43", + "%68 = OpAccessChain %_ptr_Function_float %param %uint_0", + "%69 = OpLoad %float %68", + "OpStore %66 %69", + "%70 = OpLoad %float %66", + "%71 = OpFOrdLessThan %bool %70 %float_0", + "OpSelectionMerge %72 None", + "OpBranchConditional %71 %73 %72", + "%73 = OpLabel", + "%74 = OpLoad %float %66", + "%75 = OpFNegate %float %74", + "OpStore %66 %75", + "OpBranch %72", + "%72 = OpLabel", + "%76 = OpLoad %float %66", + "OpStore %67 %76", + "%44 = OpLoad %float %67", + "%45 = OpCompositeConstruct %v4float %44 %44 %44 %44", + "OpStore %color2 %45", + "%46 = OpLoad %25 %t2D", + "%47 = OpLoad %27 %samp", + "%77 = OpSampledImage %29 %39 %40", + "%48 = OpImageSampleImplicitLod %v4float %77 %35", + "OpStore %color3 %48", + "%49 = OpLoad %v4float %color1", + "%50 = OpLoad %v4float %color2", + "%51 = OpFAdd %v4float %49 %50", + "%52 = OpLoad %v4float %color3", + "%53 = OpFAdd %v4float %51 %52", + "%54 = OpCompositeConstruct %v4float %float_3 %float_3 %float_3 %float_3", + "%55 = OpFDiv %v4float %53 %54", + "OpStore %FragColor %55", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + SinglePassRunAndCheck( + JoinAllInsts(Concat(Concat(predefs, before), nonEntryFuncs)), + JoinAllInsts(Concat(Concat(predefs, after), nonEntryFuncs)), + /* skip_nop = */ false, /* do_validate = */ true); +} + +TEST_F(InlineTest, OpImageOutOfBlock) { + // #version 450 + // + // uniform texture2D t2D; + // uniform sampler samp; + // uniform sampler samp2; + // + // out vec4 FragColor; + // + // in vec4 BaseColor; + // + // float foo(vec4 bar) + // { + // float r = bar.x; + // if (r < 0.0) + // r = -r; + // return r; + // } + // + // void main() + // { + // vec4 color1 = texture(sampler2D(t2D, samp), vec2(1.0)); + // vec4 color2 = vec4(foo(BaseColor)); + // vec4 color3 = texture(sampler2D(t2D, samp2), vec2(0.5)); + // FragColor = (color1 + color2 + color3)/3; + // } + // Note: the before SPIR-V will need to be edited to create an OpImage + // from the first OpSampledImage, place it before the call and use it + // in the second OpSampledImage following the call. + const std::vector predefs = { + // clang-format off + "OpCapability Shader", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Fragment %main \"main\" %BaseColor %FragColor", + "OpExecutionMode %main OriginUpperLeft", + "OpSource GLSL 450", + "OpName %main \"main\"", + "OpName %foo_vf4_ \"foo(vf4;\"", + "OpName %bar \"bar\"", + "OpName %r \"r\"", + "OpName %color1 \"color1\"", + "OpName %t2D \"t2D\"", + "OpName %samp \"samp\"", + "OpName %color2 \"color2\"", + "OpName %BaseColor \"BaseColor\"", + "OpName %param \"param\"", + "OpName %color3 \"color3\"", + "OpName %samp2 \"samp2\"", + "OpName %FragColor \"FragColor\"", + "OpDecorate %t2D DescriptorSet 0", + "OpDecorate %samp DescriptorSet 0", + "OpDecorate %samp2 DescriptorSet 0", + "%void = OpTypeVoid", + "%16 = OpTypeFunction %void", + "%float = OpTypeFloat 32", + "%v4float = OpTypeVector %float 4", +"%_ptr_Function_v4float = OpTypePointer Function %v4float", + "%20 = OpTypeFunction %float %_ptr_Function_v4float", +"%_ptr_Function_float = OpTypePointer Function %float", + "%uint = OpTypeInt 32 0", + "%uint_0 = OpConstant %uint 0", + "%float_0 = OpConstant %float 0", + "%bool = OpTypeBool", + "%26 = OpTypeImage %float 2D 0 0 0 1 Unknown", +"%_ptr_UniformConstant_26 = OpTypePointer UniformConstant %26", + "%t2D = OpVariable %_ptr_UniformConstant_26 UniformConstant", + "%28 = OpTypeSampler", +"%_ptr_UniformConstant_28 = OpTypePointer UniformConstant %28", + "%samp = OpVariable %_ptr_UniformConstant_28 UniformConstant", + "%30 = OpTypeSampledImage %26", + "%v2float = OpTypeVector %float 2", + "%float_1 = OpConstant %float 1", + "%33 = OpConstantComposite %v2float %float_1 %float_1", +"%_ptr_Input_v4float = OpTypePointer Input %v4float", + "%BaseColor = OpVariable %_ptr_Input_v4float Input", + "%samp2 = OpVariable %_ptr_UniformConstant_28 UniformConstant", + "%float_0_5 = OpConstant %float 0.5", + "%36 = OpConstantComposite %v2float %float_0_5 %float_0_5", +"%_ptr_Output_v4float = OpTypePointer Output %v4float", + "%FragColor = OpVariable %_ptr_Output_v4float Output", + "%float_3 = OpConstant %float 3", + // clang-format on + }; + + const std::vector nonEntryFuncs = { + // clang-format off + "%foo_vf4_ = OpFunction %float None %20", + "%bar = OpFunctionParameter %_ptr_Function_v4float", + "%58 = OpLabel", + "%r = OpVariable %_ptr_Function_float Function", + "%59 = OpAccessChain %_ptr_Function_float %bar %uint_0", + "%60 = OpLoad %float %59", + "OpStore %r %60", + "%61 = OpLoad %float %r", + "%62 = OpFOrdLessThan %bool %61 %float_0", + "OpSelectionMerge %63 None", + "OpBranchConditional %62 %64 %63", + "%64 = OpLabel", + "%65 = OpLoad %float %r", + "%66 = OpFNegate %float %65", + "OpStore %r %66", + "OpBranch %63", + "%63 = OpLabel", + "%67 = OpLoad %float %r", + "OpReturnValue %67", + "OpFunctionEnd", + // clang-format on + }; + + const std::vector before = { + // clang-format off + "%main = OpFunction %void None %16", + "%39 = OpLabel", + "%color1 = OpVariable %_ptr_Function_v4float Function", + "%color2 = OpVariable %_ptr_Function_v4float Function", + "%param = OpVariable %_ptr_Function_v4float Function", + "%color3 = OpVariable %_ptr_Function_v4float Function", + "%40 = OpLoad %26 %t2D", + "%41 = OpLoad %28 %samp", + "%42 = OpSampledImage %30 %40 %41", + "%43 = OpImageSampleImplicitLod %v4float %42 %33", + "%44 = OpImage %26 %42", + "%45 = OpLoad %28 %samp2", + "OpStore %color1 %43", + "%46 = OpLoad %v4float %BaseColor", + "OpStore %param %46", + "%47 = OpFunctionCall %float %foo_vf4_ %param", + "%48 = OpCompositeConstruct %v4float %47 %47 %47 %47", + "OpStore %color2 %48", + "%49 = OpSampledImage %30 %44 %45", + "%50 = OpImageSampleImplicitLod %v4float %49 %36", + "OpStore %color3 %50", + "%51 = OpLoad %v4float %color1", + "%52 = OpLoad %v4float %color2", + "%53 = OpFAdd %v4float %51 %52", + "%54 = OpLoad %v4float %color3", + "%55 = OpFAdd %v4float %53 %54", + "%56 = OpCompositeConstruct %v4float %float_3 %float_3 %float_3 %float_3", + "%57 = OpFDiv %v4float %55 %56", + "OpStore %FragColor %57", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + + const std::vector after = { + // clang-format off + "%main = OpFunction %void None %16", + "%39 = OpLabel", + "%68 = OpVariable %_ptr_Function_float Function", + "%69 = OpVariable %_ptr_Function_float Function", + "%color1 = OpVariable %_ptr_Function_v4float Function", + "%color2 = OpVariable %_ptr_Function_v4float Function", + "%param = OpVariable %_ptr_Function_v4float Function", + "%color3 = OpVariable %_ptr_Function_v4float Function", + "%40 = OpLoad %26 %t2D", + "%41 = OpLoad %28 %samp", + "%42 = OpSampledImage %30 %40 %41", + "%43 = OpImageSampleImplicitLod %v4float %42 %33", + "%44 = OpImage %26 %42", + "%45 = OpLoad %28 %samp2", + "OpStore %color1 %43", + "%46 = OpLoad %v4float %BaseColor", + "OpStore %param %46", + "%70 = OpAccessChain %_ptr_Function_float %param %uint_0", + "%71 = OpLoad %float %70", + "OpStore %68 %71", + "%72 = OpLoad %float %68", + "%73 = OpFOrdLessThan %bool %72 %float_0", + "OpSelectionMerge %74 None", + "OpBranchConditional %73 %75 %74", + "%75 = OpLabel", + "%76 = OpLoad %float %68", + "%77 = OpFNegate %float %76", + "OpStore %68 %77", + "OpBranch %74", + "%74 = OpLabel", + "%78 = OpLoad %float %68", + "OpStore %69 %78", + "%47 = OpLoad %float %69", + "%48 = OpCompositeConstruct %v4float %47 %47 %47 %47", + "OpStore %color2 %48", + "%79 = OpSampledImage %30 %40 %41", + "%80 = OpImage %26 %79", + "%49 = OpSampledImage %30 %80 %45", + "%50 = OpImageSampleImplicitLod %v4float %49 %36", + "OpStore %color3 %50", + "%51 = OpLoad %v4float %color1", + "%52 = OpLoad %v4float %color2", + "%53 = OpFAdd %v4float %51 %52", + "%54 = OpLoad %v4float %color3", + "%55 = OpFAdd %v4float %53 %54", + "%56 = OpCompositeConstruct %v4float %float_3 %float_3 %float_3 %float_3", + "%57 = OpFDiv %v4float %55 %56", + "OpStore %FragColor %57", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + SinglePassRunAndCheck( + JoinAllInsts(Concat(Concat(predefs, before), nonEntryFuncs)), + JoinAllInsts(Concat(Concat(predefs, after), nonEntryFuncs)), + /* skip_nop = */ false, /* do_validate = */ true); +} + +TEST_F(InlineTest, OpImageAndOpSampledImageOutOfBlock) { + // #version 450 + // + // uniform texture2D t2D; + // uniform sampler samp; + // uniform sampler samp2; + // + // out vec4 FragColor; + // + // in vec4 BaseColor; + // + // float foo(vec4 bar) + // { + // float r = bar.x; + // if (r < 0.0) + // r = -r; + // return r; + // } + // + // void main() + // { + // vec4 color1 = texture(sampler2D(t2D, samp), vec2(1.0)); + // vec4 color2 = vec4(foo(BaseColor)); + // vec4 color3 = texture(sampler2D(t2D, samp2), vec2(0.5)); + // FragColor = (color1 + color2 + color3)/3; + // } + // Note: the before SPIR-V will need to be edited to create an OpImage + // and subsequent OpSampledImage that is used across the function call. + const std::vector predefs = { + // clang-format off + "OpCapability Shader", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Fragment %main \"main\" %BaseColor %FragColor", + "OpExecutionMode %main OriginUpperLeft", + "OpSource GLSL 450", + "OpName %main \"main\"", + "OpName %foo_vf4_ \"foo(vf4;\"", + "OpName %bar \"bar\"", + "OpName %r \"r\"", + "OpName %color1 \"color1\"", + "OpName %t2D \"t2D\"", + "OpName %samp \"samp\"", + "OpName %color2 \"color2\"", + "OpName %BaseColor \"BaseColor\"", + "OpName %param \"param\"", + "OpName %color3 \"color3\"", + "OpName %samp2 \"samp2\"", + "OpName %FragColor \"FragColor\"", + "OpDecorate %t2D DescriptorSet 0", + "OpDecorate %samp DescriptorSet 0", + "OpDecorate %samp2 DescriptorSet 0", + "%void = OpTypeVoid", + "%16 = OpTypeFunction %void", + "%float = OpTypeFloat 32", + "%v4float = OpTypeVector %float 4", +"%_ptr_Function_v4float = OpTypePointer Function %v4float", + "%20 = OpTypeFunction %float %_ptr_Function_v4float", +"%_ptr_Function_float = OpTypePointer Function %float", + "%uint = OpTypeInt 32 0", + "%uint_0 = OpConstant %uint 0", + "%float_0 = OpConstant %float 0", + "%bool = OpTypeBool", + "%26 = OpTypeImage %float 2D 0 0 0 1 Unknown", +"%_ptr_UniformConstant_26 = OpTypePointer UniformConstant %26", + "%t2D = OpVariable %_ptr_UniformConstant_26 UniformConstant", + "%28 = OpTypeSampler", +"%_ptr_UniformConstant_28 = OpTypePointer UniformConstant %28", + "%samp = OpVariable %_ptr_UniformConstant_28 UniformConstant", + "%30 = OpTypeSampledImage %26", + "%v2float = OpTypeVector %float 2", + "%float_1 = OpConstant %float 1", + "%33 = OpConstantComposite %v2float %float_1 %float_1", +"%_ptr_Input_v4float = OpTypePointer Input %v4float", + "%BaseColor = OpVariable %_ptr_Input_v4float Input", + "%samp2 = OpVariable %_ptr_UniformConstant_28 UniformConstant", + "%float_0_5 = OpConstant %float 0.5", + "%36 = OpConstantComposite %v2float %float_0_5 %float_0_5", +"%_ptr_Output_v4float = OpTypePointer Output %v4float", + "%FragColor = OpVariable %_ptr_Output_v4float Output", + "%float_3 = OpConstant %float 3", + // clang-format on + }; + + const std::vector nonEntryFuncs = { + // clang-format off + "%foo_vf4_ = OpFunction %float None %20", + "%bar = OpFunctionParameter %_ptr_Function_v4float", + "%58 = OpLabel", + "%r = OpVariable %_ptr_Function_float Function", + "%59 = OpAccessChain %_ptr_Function_float %bar %uint_0", + "%60 = OpLoad %float %59", + "OpStore %r %60", + "%61 = OpLoad %float %r", + "%62 = OpFOrdLessThan %bool %61 %float_0", + "OpSelectionMerge %63 None", + "OpBranchConditional %62 %64 %63", + "%64 = OpLabel", + "%65 = OpLoad %float %r", + "%66 = OpFNegate %float %65", + "OpStore %r %66", + "OpBranch %63", + "%63 = OpLabel", + "%67 = OpLoad %float %r", + "OpReturnValue %67", + "OpFunctionEnd", + // clang-format on + }; + + const std::vector before = { + // clang-format off + "%main = OpFunction %void None %16", + "%39 = OpLabel", + "%color1 = OpVariable %_ptr_Function_v4float Function", + "%color2 = OpVariable %_ptr_Function_v4float Function", + "%param = OpVariable %_ptr_Function_v4float Function", + "%color3 = OpVariable %_ptr_Function_v4float Function", + "%40 = OpLoad %26 %t2D", + "%41 = OpLoad %28 %samp", + "%42 = OpSampledImage %30 %40 %41", + "%43 = OpImageSampleImplicitLod %v4float %42 %33", + "%44 = OpImage %26 %42", + "%45 = OpLoad %28 %samp2", + "%46 = OpSampledImage %30 %44 %45", + "OpStore %color1 %43", + "%47 = OpLoad %v4float %BaseColor", + "OpStore %param %47", + "%48 = OpFunctionCall %float %foo_vf4_ %param", + "%49 = OpCompositeConstruct %v4float %48 %48 %48 %48", + "OpStore %color2 %49", + "%50 = OpImageSampleImplicitLod %v4float %46 %36", + "OpStore %color3 %50", + "%51 = OpLoad %v4float %color1", + "%52 = OpLoad %v4float %color2", + "%53 = OpFAdd %v4float %51 %52", + "%54 = OpLoad %v4float %color3", + "%55 = OpFAdd %v4float %53 %54", + "%56 = OpCompositeConstruct %v4float %float_3 %float_3 %float_3 %float_3", + "%57 = OpFDiv %v4float %55 %56", + "OpStore %FragColor %57", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + + const std::vector after = { + // clang-format off + "%main = OpFunction %void None %16", + "%39 = OpLabel", + "%68 = OpVariable %_ptr_Function_float Function", + "%69 = OpVariable %_ptr_Function_float Function", + "%color1 = OpVariable %_ptr_Function_v4float Function", + "%color2 = OpVariable %_ptr_Function_v4float Function", + "%param = OpVariable %_ptr_Function_v4float Function", + "%color3 = OpVariable %_ptr_Function_v4float Function", + "%40 = OpLoad %26 %t2D", + "%41 = OpLoad %28 %samp", + "%42 = OpSampledImage %30 %40 %41", + "%43 = OpImageSampleImplicitLod %v4float %42 %33", + "%44 = OpImage %26 %42", + "%45 = OpLoad %28 %samp2", + "%46 = OpSampledImage %30 %44 %45", + "OpStore %color1 %43", + "%47 = OpLoad %v4float %BaseColor", + "OpStore %param %47", + "%70 = OpAccessChain %_ptr_Function_float %param %uint_0", + "%71 = OpLoad %float %70", + "OpStore %68 %71", + "%72 = OpLoad %float %68", + "%73 = OpFOrdLessThan %bool %72 %float_0", + "OpSelectionMerge %74 None", + "OpBranchConditional %73 %75 %74", + "%75 = OpLabel", + "%76 = OpLoad %float %68", + "%77 = OpFNegate %float %76", + "OpStore %68 %77", + "OpBranch %74", + "%74 = OpLabel", + "%78 = OpLoad %float %68", + "OpStore %69 %78", + "%48 = OpLoad %float %69", + "%49 = OpCompositeConstruct %v4float %48 %48 %48 %48", + "OpStore %color2 %49", + "%79 = OpSampledImage %30 %40 %41", + "%80 = OpImage %26 %79", + "%81 = OpSampledImage %30 %80 %45", + "%50 = OpImageSampleImplicitLod %v4float %81 %36", + "OpStore %color3 %50", + "%51 = OpLoad %v4float %color1", + "%52 = OpLoad %v4float %color2", + "%53 = OpFAdd %v4float %51 %52", + "%54 = OpLoad %v4float %color3", + "%55 = OpFAdd %v4float %53 %54", + "%56 = OpCompositeConstruct %v4float %float_3 %float_3 %float_3 %float_3", + "%57 = OpFDiv %v4float %55 %56", + "OpStore %FragColor %57", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + SinglePassRunAndCheck( + JoinAllInsts(Concat(Concat(predefs, before), nonEntryFuncs)), + JoinAllInsts(Concat(Concat(predefs, after), nonEntryFuncs)), + /* skip_nop = */ false, /* do_validate = */ true); +} + +TEST_F(InlineTest, EarlyReturnFunctionInlined) { + // #version 140 + // + // in vec4 BaseColor; + // + // float foo(vec4 bar) + // { + // if (bar.x < 0.0) + // return 0.0; + // return bar.x; + // } + // + // void main() + // { + // vec4 color = vec4(foo(BaseColor)); + // gl_FragColor = color; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %foo_vf4_ "foo(vf4;" +OpName %bar "bar" +OpName %color "color" +OpName %BaseColor "BaseColor" +OpName %param "param" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%14 = OpTypeFunction %float %_ptr_Function_v4float +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string nonEntryFuncs = + R"(%foo_vf4_ = OpFunction %float None %14 +%bar = OpFunctionParameter %_ptr_Function_v4float +%27 = OpLabel +%28 = OpAccessChain %_ptr_Function_float %bar %uint_0 +%29 = OpLoad %float %28 +%30 = OpFOrdLessThan %bool %29 %float_0 +OpSelectionMerge %31 None +OpBranchConditional %30 %32 %31 +%32 = OpLabel +OpReturnValue %float_0 +%31 = OpLabel +%33 = OpAccessChain %_ptr_Function_float %bar %uint_0 +%34 = OpLoad %float %33 +OpReturnValue %34 +OpFunctionEnd +)"; + + const std::string before = + R"(%main = OpFunction %void None %10 +%22 = OpLabel +%color = OpVariable %_ptr_Function_v4float Function +%param = OpVariable %_ptr_Function_v4float Function +%23 = OpLoad %v4float %BaseColor +OpStore %param %23 +%24 = OpFunctionCall %float %foo_vf4_ %param +%25 = OpCompositeConstruct %v4float %24 %24 %24 %24 +OpStore %color %25 +%26 = OpLoad %v4float %color +OpStore %gl_FragColor %26 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%false = OpConstantFalse %bool +%main = OpFunction %void None %10 +%22 = OpLabel +%35 = OpVariable %_ptr_Function_float Function +%color = OpVariable %_ptr_Function_v4float Function +%param = OpVariable %_ptr_Function_v4float Function +%23 = OpLoad %v4float %BaseColor +OpStore %param %23 +OpBranch %36 +%36 = OpLabel +OpLoopMerge %37 %38 None +OpBranch %39 +%39 = OpLabel +%40 = OpAccessChain %_ptr_Function_float %param %uint_0 +%41 = OpLoad %float %40 +%42 = OpFOrdLessThan %bool %41 %float_0 +OpSelectionMerge %43 None +OpBranchConditional %42 %44 %43 +%44 = OpLabel +OpStore %35 %float_0 +OpBranch %37 +%43 = OpLabel +%45 = OpAccessChain %_ptr_Function_float %param %uint_0 +%46 = OpLoad %float %45 +OpStore %35 %46 +OpBranch %37 +%38 = OpLabel +OpBranchConditional %false %36 %37 +%37 = OpLabel +%24 = OpLoad %float %35 +%25 = OpCompositeConstruct %v4float %24 %24 %24 %24 +OpStore %color %25 +%26 = OpLoad %v4float %color +OpStore %gl_FragColor %26 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before + nonEntryFuncs, predefs + after + nonEntryFuncs, false, + true); +} + +TEST_F(InlineTest, EarlyReturnNotAppearingLastInFunctionInlined) { + // Example from https://github.com/KhronosGroup/SPIRV-Tools/issues/755 + // + // Original example is derived from: + // + // #version 450 + // + // float foo() { + // if (true) { + // } + // } + // + // void main() { foo(); } + // + // But the order of basic blocks in foo is changed so that the return + // block is listed second-last. There is only one return in the callee + // but it does not appear last. + + const std::string predefs = + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %main "main" +OpSource GLSL 450 +OpName %main "main" +OpName %foo_ "foo(" +%void = OpTypeVoid +%4 = OpTypeFunction %void +%bool = OpTypeBool +%true = OpConstantTrue %bool +)"; + + const std::string nonEntryFuncs = + R"(%foo_ = OpFunction %void None %4 +%7 = OpLabel +OpSelectionMerge %8 None +OpBranchConditional %true %9 %8 +%8 = OpLabel +OpReturn +%9 = OpLabel +OpBranch %8 +OpFunctionEnd +)"; + + const std::string before = + R"(%main = OpFunction %void None %4 +%10 = OpLabel +%11 = OpFunctionCall %void %foo_ +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %4 +%10 = OpLabel +OpSelectionMerge %12 None +OpBranchConditional %true %13 %12 +%12 = OpLabel +OpBranch %14 +%13 = OpLabel +OpBranch %12 +%14 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + nonEntryFuncs + before, predefs + nonEntryFuncs + after, false, + true); +} + +TEST_F(InlineTest, ForwardReferencesInPhiInlined) { + // The basic structure of the test case is like this: + // + // int foo() { + // int result = 1; + // if (true) { + // result = 1; + // } + // return result; + // } + // + // void main() { + // int x = foo(); + // } + // + // but with modifications: Using Phi instead of load/store, and the + // return block in foo appears before the "then" block. + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %main "main" +OpSource GLSL 450 +OpName %main "main" +OpName %foo_ "foo(" +OpName %x "x" +%void = OpTypeVoid +%6 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%8 = OpTypeFunction %int +%bool = OpTypeBool +%true = OpConstantTrue %bool +%int_0 = OpConstant %int 0 +%_ptr_Function_int = OpTypePointer Function %int +)"; + + const std::string nonEntryFuncs = + R"(%foo_ = OpFunction %int None %8 +%13 = OpLabel +%14 = OpCopyObject %int %int_0 +OpSelectionMerge %15 None +OpBranchConditional %true %16 %15 +%15 = OpLabel +%17 = OpPhi %int %14 %13 %18 %16 +OpReturnValue %17 +%16 = OpLabel +%18 = OpCopyObject %int %int_0 +OpBranch %15 +OpFunctionEnd +)"; + + const std::string before = + R"(%main = OpFunction %void None %6 +%19 = OpLabel +%x = OpVariable %_ptr_Function_int Function +%20 = OpFunctionCall %int %foo_ +OpStore %x %20 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %6 +%19 = OpLabel +%21 = OpVariable %_ptr_Function_int Function +%x = OpVariable %_ptr_Function_int Function +%22 = OpCopyObject %int %int_0 +OpSelectionMerge %23 None +OpBranchConditional %true %24 %23 +%23 = OpLabel +%26 = OpPhi %int %22 %19 %25 %24 +OpStore %21 %26 +OpBranch %27 +%24 = OpLabel +%25 = OpCopyObject %int %int_0 +OpBranch %23 +%27 = OpLabel +%20 = OpLoad %int %21 +OpStore %x %20 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + nonEntryFuncs + before, predefs + nonEntryFuncs + after, false, + true); +} + +TEST_F(InlineTest, EarlyReturnInLoopIsNotInlined) { + // #version 140 + // + // in vec4 BaseColor; + // + // float foo(vec4 bar) + // { + // while (true) { + // if (bar.x < 0.0) + // return 0.0; + // return bar.x; + // } + // } + // + // void main() + // { + // vec4 color = vec4(foo(BaseColor)); + // gl_FragColor = color; + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %foo_vf4_ "foo(vf4;" +OpName %bar "bar" +OpName %color "color" +OpName %BaseColor "BaseColor" +OpName %param "param" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%14 = OpTypeFunction %float %_ptr_Function_v4float +%bool = OpTypeBool +%true = OpConstantTrue %bool +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %10 +%23 = OpLabel +%color = OpVariable %_ptr_Function_v4float Function +%param = OpVariable %_ptr_Function_v4float Function +%24 = OpLoad %v4float %BaseColor +OpStore %param %24 +%25 = OpFunctionCall %float %foo_vf4_ %param +%26 = OpCompositeConstruct %v4float %25 %25 %25 %25 +OpStore %color %26 +%27 = OpLoad %v4float %color +OpStore %gl_FragColor %27 +OpReturn +OpFunctionEnd +%foo_vf4_ = OpFunction %float None %14 +%bar = OpFunctionParameter %_ptr_Function_v4float +%28 = OpLabel +OpBranch %29 +%29 = OpLabel +OpLoopMerge %30 %31 None +OpBranch %32 +%32 = OpLabel +OpBranchConditional %true %33 %30 +%33 = OpLabel +%34 = OpAccessChain %_ptr_Function_float %bar %uint_0 +%35 = OpLoad %float %34 +%36 = OpFOrdLessThan %bool %35 %float_0 +OpSelectionMerge %37 None +OpBranchConditional %36 %38 %37 +%38 = OpLabel +OpReturnValue %float_0 +%37 = OpLabel +%39 = OpAccessChain %_ptr_Function_float %bar %uint_0 +%40 = OpLoad %float %39 +OpReturnValue %40 +%31 = OpLabel +OpBranch %29 +%30 = OpLabel +%41 = OpUndef %float +OpReturnValue %41 +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, false, + true); +} + +TEST_F(InlineTest, ExternalFunctionIsNotInlined) { + // In particular, don't crash. + // See report https://github.com/KhronosGroup/SPIRV-Tools/issues/605 + const std::string assembly = + R"(OpCapability Addresses +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +OpEntryPoint Kernel %1 "entry_pt" +OpDecorate %2 LinkageAttributes "external" Import +%void = OpTypeVoid +%4 = OpTypeFunction %void +%2 = OpFunction %void None %4 +OpFunctionEnd +%1 = OpFunction %void None %4 +%5 = OpLabel +%6 = OpFunctionCall %void %2 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, false, + true); +} + +TEST_F(InlineTest, SingleBlockLoopCallsMultiBlockCallee) { + // Example from https://github.com/KhronosGroup/SPIRV-Tools/issues/787 + // + // CFG structure is: + // foo: + // fooentry -> fooexit + // + // main: + // entry -> loop + // loop -> loop, merge + // loop calls foo() + // merge + // + // Since the callee has multiple blocks, it will split the calling block + // into at least two, resulting in a new "back-half" block that contains + // the instructions after the inlined function call. If the calling block + // has an OpLoopMerge that points back to the calling block itself, then + // the OpLoopMerge can't remain in the back-half block, but must be + // moved to the end of the original calling block, and it continue target + // operand updated to point to the back-half block. + + const std::string predefs = + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %1 "main" +OpSource OpenCL_C 120 +%bool = OpTypeBool +%true = OpConstantTrue %bool +%void = OpTypeVoid +)"; + + const std::string nonEntryFuncs = + R"(%5 = OpTypeFunction %void +%6 = OpFunction %void None %5 +%7 = OpLabel +OpBranch %8 +%8 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string before = + R"(%1 = OpFunction %void None %5 +%9 = OpLabel +OpBranch %10 +%10 = OpLabel +%11 = OpFunctionCall %void %6 +OpLoopMerge %12 %10 None +OpBranchConditional %true %10 %12 +%12 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%1 = OpFunction %void None %5 +%9 = OpLabel +OpBranch %10 +%10 = OpLabel +OpLoopMerge %12 %13 None +OpBranch %13 +%13 = OpLabel +OpBranchConditional %true %10 %12 +%12 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + nonEntryFuncs + before, predefs + nonEntryFuncs + after, false, + true); +} + +TEST_F(InlineTest, MultiBlockLoopHeaderCallsMultiBlockCallee) { + // Like SingleBlockLoopCallsMultiBlockCallee but the loop has several + // blocks, but the function call still occurs in the loop header. + // Example from https://github.com/KhronosGroup/SPIRV-Tools/issues/800 + + const std::string predefs = + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %1 "main" +OpSource OpenCL_C 120 +%bool = OpTypeBool +%true = OpConstantTrue %bool +%int = OpTypeInt 32 1 +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%int_3 = OpConstant %int 3 +%int_4 = OpConstant %int 4 +%int_5 = OpConstant %int 5 +%void = OpTypeVoid +%11 = OpTypeFunction %void +)"; + + const std::string nonEntryFuncs = + R"(%12 = OpFunction %void None %11 +%13 = OpLabel +%14 = OpCopyObject %int %int_1 +OpBranch %15 +%15 = OpLabel +%16 = OpCopyObject %int %int_2 +OpReturn +OpFunctionEnd +)"; + + const std::string before = + R"(%1 = OpFunction %void None %11 +%17 = OpLabel +OpBranch %18 +%18 = OpLabel +%19 = OpCopyObject %int %int_3 +%20 = OpFunctionCall %void %12 +%21 = OpCopyObject %int %int_4 +OpLoopMerge %22 %23 None +OpBranchConditional %true %23 %22 +%23 = OpLabel +%24 = OpCopyObject %int %int_5 +OpBranchConditional %true %18 %22 +%22 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%1 = OpFunction %void None %11 +%17 = OpLabel +OpBranch %18 +%18 = OpLabel +%19 = OpCopyObject %int %int_3 +%25 = OpCopyObject %int %int_1 +OpLoopMerge %22 %23 None +OpBranch %26 +%26 = OpLabel +%27 = OpCopyObject %int %int_2 +%21 = OpCopyObject %int %int_4 +OpBranchConditional %true %23 %22 +%23 = OpLabel +%24 = OpCopyObject %int %int_5 +OpBranchConditional %true %18 %22 +%22 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + nonEntryFuncs + before, predefs + nonEntryFuncs + after, false, + true); +} + +TEST_F(InlineTest, SingleBlockLoopCallsMultiBlockCalleeHavingSelectionMerge) { + // This is similar to SingleBlockLoopCallsMultiBlockCallee except + // that calleee block also has a merge instruction in its first block. + // That merge instruction must be an OpSelectionMerge (because the entry + // block of a function can't be the header of a loop since the entry + // block can't be the target of a branch). + // + // In this case the OpLoopMerge can't be placed in the same block as + // the OpSelectionMerge, so inlining must create a new block to contain + // the callee contents. + // + // Additionally, we have two dummy OpCopyObject instructions to prove that + // the OpLoopMerge is moved to the right location. + // + // Also ensure that OpPhis within the cloned callee code are valid. + // We need to test that the predecessor blocks are remapped correctly so that + // dominance rules are satisfied + + const std::string predefs = + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %1 "main" +OpSource OpenCL_C 120 +%bool = OpTypeBool +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%void = OpTypeVoid +%6 = OpTypeFunction %void +)"; + + // This callee has multiple blocks, and an OpPhi in the last block + // that references a value from the first block. This tests that + // cloned block IDs are remapped appropriately. The OpPhi dominance + // requires that the remapped %9 must be in a block that dominates + // the remapped %8. + const std::string nonEntryFuncs = + R"(%7 = OpFunction %void None %6 +%8 = OpLabel +%9 = OpCopyObject %bool %true +OpSelectionMerge %10 None +OpBranchConditional %true %10 %10 +%10 = OpLabel +%11 = OpPhi %bool %9 %8 +OpReturn +OpFunctionEnd +)"; + + const std::string before = + R"(%1 = OpFunction %void None %6 +%12 = OpLabel +OpBranch %13 +%13 = OpLabel +%14 = OpCopyObject %bool %false +%15 = OpFunctionCall %void %7 +OpLoopMerge %16 %13 None +OpBranchConditional %true %13 %16 +%16 = OpLabel +OpReturn +OpFunctionEnd +)"; + + // Note the remapped Phi uses %17 as the parent instead + // of %13, demonstrating that the parent block has been remapped + // correctly. + const std::string after = + R"(%1 = OpFunction %void None %6 +%12 = OpLabel +OpBranch %13 +%13 = OpLabel +%14 = OpCopyObject %bool %false +OpLoopMerge %16 %19 None +OpBranch %17 +%17 = OpLabel +%18 = OpCopyObject %bool %true +OpSelectionMerge %19 None +OpBranchConditional %true %19 %19 +%19 = OpLabel +%20 = OpPhi %bool %18 %17 +OpBranchConditional %true %13 %16 +%16 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + nonEntryFuncs + before, predefs + nonEntryFuncs + after, false, + true); +} + +TEST_F(InlineTest, + MultiBlockLoopHeaderCallsFromToMultiBlockCalleeHavingSelectionMerge) { + // This is similar to SingleBlockLoopCallsMultiBlockCalleeHavingSelectionMerge + // but the call is in the header block of a multi block loop. + + const std::string predefs = + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %1 "main" +OpSource OpenCL_C 120 +%bool = OpTypeBool +%true = OpConstantTrue %bool +%int = OpTypeInt 32 1 +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%int_3 = OpConstant %int 3 +%int_4 = OpConstant %int 4 +%int_5 = OpConstant %int 5 +%void = OpTypeVoid +%11 = OpTypeFunction %void +)"; + + const std::string nonEntryFuncs = + R"(%12 = OpFunction %void None %11 +%13 = OpLabel +%14 = OpCopyObject %int %int_1 +OpSelectionMerge %15 None +OpBranchConditional %true %15 %15 +%15 = OpLabel +%16 = OpCopyObject %int %int_2 +OpReturn +OpFunctionEnd +)"; + + const std::string before = + R"(%1 = OpFunction %void None %11 +%17 = OpLabel +OpBranch %18 +%18 = OpLabel +%19 = OpCopyObject %int %int_3 +%20 = OpFunctionCall %void %12 +%21 = OpCopyObject %int %int_4 +OpLoopMerge %22 %23 None +OpBranchConditional %true %23 %22 +%23 = OpLabel +%24 = OpCopyObject %int %int_5 +OpBranchConditional %true %18 %22 +%22 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%1 = OpFunction %void None %11 +%17 = OpLabel +OpBranch %18 +%18 = OpLabel +%19 = OpCopyObject %int %int_3 +OpLoopMerge %22 %23 None +OpBranch %25 +%25 = OpLabel +%26 = OpCopyObject %int %int_1 +OpSelectionMerge %27 None +OpBranchConditional %true %27 %27 +%27 = OpLabel +%28 = OpCopyObject %int %int_2 +%21 = OpCopyObject %int %int_4 +OpBranchConditional %true %23 %22 +%23 = OpLabel +%24 = OpCopyObject %int %int_5 +OpBranchConditional %true %18 %22 +%22 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + nonEntryFuncs + before, predefs + nonEntryFuncs + after, false, + true); +} + +TEST_F( + InlineTest, + SingleBlockLoopCallsMultiBlockCalleeHavingSelectionMergeAndMultiReturns) { + // This is similar to SingleBlockLoopCallsMultiBlockCalleeHavingSelectionMerge + // except that in addition to starting with a selection header, the + // callee also has multi returns. + // + // So now we have to accommodate: + // - The caller's OpLoopMerge (which must move to the first block) + // - The single-trip loop to wrap the multi returns, and + // - The callee's selection merge in its first block. + // Each of these must go into their own blocks. + + const std::string predefs = + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %1 "main" +OpSource OpenCL_C 120 +%bool = OpTypeBool +%int = OpTypeInt 32 1 +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%int_0 = OpConstant %int 0 +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%int_3 = OpConstant %int 3 +%int_4 = OpConstant %int 4 +%void = OpTypeVoid +%12 = OpTypeFunction %void +)"; + + const std::string nonEntryFuncs = + R"(%13 = OpFunction %void None %12 +%14 = OpLabel +%15 = OpCopyObject %int %int_0 +OpReturn +%16 = OpLabel +%17 = OpCopyObject %int %int_1 +OpReturn +OpFunctionEnd +)"; + + const std::string before = + R"(%1 = OpFunction %void None %12 +%18 = OpLabel +OpBranch %19 +%19 = OpLabel +%20 = OpCopyObject %int %int_2 +%21 = OpFunctionCall %void %13 +%22 = OpCopyObject %int %int_3 +OpLoopMerge %23 %19 None +OpBranchConditional %true %19 %23 +%23 = OpLabel +%24 = OpCopyObject %int %int_4 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%1 = OpFunction %void None %12 +%18 = OpLabel +OpBranch %19 +%19 = OpLabel +%20 = OpCopyObject %int %int_2 +OpLoopMerge %23 %26 None +OpBranch %25 +%25 = OpLabel +OpLoopMerge %26 %27 None +OpBranch %28 +%28 = OpLabel +%29 = OpCopyObject %int %int_0 +OpBranch %26 +%30 = OpLabel +%31 = OpCopyObject %int %int_1 +OpBranch %26 +%27 = OpLabel +OpBranchConditional %false %25 %26 +%26 = OpLabel +%22 = OpCopyObject %int %int_3 +OpBranchConditional %true %19 %23 +%23 = OpLabel +%24 = OpCopyObject %int %int_4 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + nonEntryFuncs + before, predefs + nonEntryFuncs + after, false, + true); +} + +TEST_F(InlineTest, CalleeWithMultiReturnAndPhiRequiresEntryBlockRemapping) { + // The case from https://github.com/KhronosGroup/SPIRV-Tools/issues/790 + // + // The callee has multiple returns, and so must be wrapped with a single-trip + // loop. That code must remap the callee entry block ID to the introduced + // loop body's ID. Otherwise you can get a dominance error in a cloned OpPhi. + + const std::string predefs = + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %1 "main" +OpSource OpenCL_C 120 +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%int_3 = OpConstant %int 3 +%int_4 = OpConstant %int 4 +%void = OpTypeVoid +%9 = OpTypeFunction %void +%bool = OpTypeBool +%false = OpConstantFalse %bool +)"; + + // This callee has multiple returns, and a Phi in the second block referencing + // a value generated in the entry block. + const std::string nonEntryFuncs = + R"(%12 = OpFunction %void None %9 +%13 = OpLabel +%14 = OpCopyObject %int %int_0 +OpBranch %15 +%15 = OpLabel +%16 = OpPhi %int %14 %13 +%17 = OpCopyObject %int %int_1 +OpReturn +%18 = OpLabel +%19 = OpCopyObject %int %int_2 +OpReturn +OpFunctionEnd +)"; + + const std::string before = + R"(%1 = OpFunction %void None %9 +%20 = OpLabel +%21 = OpCopyObject %int %int_3 +%22 = OpFunctionCall %void %12 +%23 = OpCopyObject %int %int_4 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%1 = OpFunction %void None %9 +%20 = OpLabel +%21 = OpCopyObject %int %int_3 +OpBranch %24 +%24 = OpLabel +OpLoopMerge %25 %26 None +OpBranch %27 +%27 = OpLabel +%28 = OpCopyObject %int %int_0 +OpBranch %29 +%29 = OpLabel +%30 = OpPhi %int %28 %27 +%31 = OpCopyObject %int %int_1 +OpBranch %25 +%32 = OpLabel +%33 = OpCopyObject %int %int_2 +OpBranch %25 +%26 = OpLabel +OpBranchConditional %false %24 %25 +%25 = OpLabel +%23 = OpCopyObject %int %int_4 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + nonEntryFuncs + before, predefs + nonEntryFuncs + after, false, + true); +} + +TEST_F(InlineTest, Decorated1) { + // Same test as Simple with the difference + // that OpFAdd in the outlined function is + // decorated with RelaxedPrecision + // Expected result is an equal decoration + // of the corresponding inlined instruction + // + // #version 140 + // + // in vec4 BaseColor; + // + // float foo(vec4 bar) + // { + // return bar.x + bar.y; + // } + // + // void main() + // { + // vec4 color = vec4(foo(BaseColor)); + // gl_FragColor = color; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %foo_vf4_ "foo(vf4;" +OpName %bar "bar" +OpName %color "color" +OpName %BaseColor "BaseColor" +OpName %param "param" +OpName %gl_FragColor "gl_FragColor" +OpDecorate %9 RelaxedPrecision +)"; + + const std::string before = + R"(%void = OpTypeVoid +%11 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%15 = OpTypeFunction %float %_ptr_Function_v4float +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%_ptr_Function_float = OpTypePointer Function %float +%uint_1 = OpConstant %uint 1 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %11 +%22 = OpLabel +%color = OpVariable %_ptr_Function_v4float Function +%param = OpVariable %_ptr_Function_v4float Function +%23 = OpLoad %v4float %BaseColor +OpStore %param %23 +%24 = OpFunctionCall %float %foo_vf4_ %param +%25 = OpCompositeConstruct %v4float %24 %24 %24 %24 +OpStore %color %25 +%26 = OpLoad %v4float %color +OpStore %gl_FragColor %26 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(OpDecorate %37 RelaxedPrecision +%void = OpTypeVoid +%11 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%15 = OpTypeFunction %float %_ptr_Function_v4float +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%_ptr_Function_float = OpTypePointer Function %float +%uint_1 = OpConstant %uint 1 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %11 +%22 = OpLabel +%32 = OpVariable %_ptr_Function_float Function +%color = OpVariable %_ptr_Function_v4float Function +%param = OpVariable %_ptr_Function_v4float Function +%23 = OpLoad %v4float %BaseColor +OpStore %param %23 +%33 = OpAccessChain %_ptr_Function_float %param %uint_0 +%34 = OpLoad %float %33 +%35 = OpAccessChain %_ptr_Function_float %param %uint_1 +%36 = OpLoad %float %35 +%37 = OpFAdd %float %34 %36 +OpStore %32 %37 +%24 = OpLoad %float %32 +%25 = OpCompositeConstruct %v4float %24 %24 %24 %24 +OpStore %color %25 +%26 = OpLoad %v4float %color +OpStore %gl_FragColor %26 +OpReturn +OpFunctionEnd +)"; + + const std::string nonEntryFuncs = + R"(%foo_vf4_ = OpFunction %float None %15 +%bar = OpFunctionParameter %_ptr_Function_v4float +%27 = OpLabel +%28 = OpAccessChain %_ptr_Function_float %bar %uint_0 +%29 = OpLoad %float %28 +%30 = OpAccessChain %_ptr_Function_float %bar %uint_1 +%31 = OpLoad %float %30 +%9 = OpFAdd %float %29 %31 +OpReturnValue %9 +OpFunctionEnd +)"; + SinglePassRunAndCheck( + predefs + before + nonEntryFuncs, predefs + after + nonEntryFuncs, false, + true); +} + +TEST_F(InlineTest, Decorated2) { + // Same test as Simple with the difference + // that the Result of the outlined OpFunction + // is decorated with RelaxedPrecision + // Expected result is an equal decoration + // of the created return variable + // + // #version 140 + // + // in vec4 BaseColor; + // + // float foo(vec4 bar) + // { + // return bar.x + bar.y; + // } + // + // void main() + // { + // vec4 color = vec4(foo(BaseColor)); + // gl_FragColor = color; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %foo_vf4_ "foo(vf4;" +OpName %bar "bar" +OpName %color "color" +OpName %BaseColor "BaseColor" +OpName %param "param" +OpName %gl_FragColor "gl_FragColor" +OpDecorate %foo_vf4_ RelaxedPrecision +)"; + + const std::string before = + R"(%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%14 = OpTypeFunction %float %_ptr_Function_v4float +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%_ptr_Function_float = OpTypePointer Function %float +%uint_1 = OpConstant %uint 1 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %10 +%21 = OpLabel +%color = OpVariable %_ptr_Function_v4float Function +%param = OpVariable %_ptr_Function_v4float Function +%22 = OpLoad %v4float %BaseColor +OpStore %param %22 +%23 = OpFunctionCall %float %foo_vf4_ %param +%24 = OpCompositeConstruct %v4float %23 %23 %23 %23 +OpStore %color %24 +%25 = OpLoad %v4float %color +OpStore %gl_FragColor %25 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(OpDecorate %32 RelaxedPrecision +%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%14 = OpTypeFunction %float %_ptr_Function_v4float +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%_ptr_Function_float = OpTypePointer Function %float +%uint_1 = OpConstant %uint 1 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %10 +%21 = OpLabel +%32 = OpVariable %_ptr_Function_float Function +%color = OpVariable %_ptr_Function_v4float Function +%param = OpVariable %_ptr_Function_v4float Function +%22 = OpLoad %v4float %BaseColor +OpStore %param %22 +%33 = OpAccessChain %_ptr_Function_float %param %uint_0 +%34 = OpLoad %float %33 +%35 = OpAccessChain %_ptr_Function_float %param %uint_1 +%36 = OpLoad %float %35 +%37 = OpFAdd %float %34 %36 +OpStore %32 %37 +%23 = OpLoad %float %32 +%24 = OpCompositeConstruct %v4float %23 %23 %23 %23 +OpStore %color %24 +%25 = OpLoad %v4float %color +OpStore %gl_FragColor %25 +OpReturn +OpFunctionEnd +)"; + + const std::string nonEntryFuncs = + R"(%foo_vf4_ = OpFunction %float None %14 +%bar = OpFunctionParameter %_ptr_Function_v4float +%26 = OpLabel +%27 = OpAccessChain %_ptr_Function_float %bar %uint_0 +%28 = OpLoad %float %27 +%29 = OpAccessChain %_ptr_Function_float %bar %uint_1 +%30 = OpLoad %float %29 +%31 = OpFAdd %float %28 %30 +OpReturnValue %31 +OpFunctionEnd +)"; + SinglePassRunAndCheck( + predefs + before + nonEntryFuncs, predefs + after + nonEntryFuncs, false, + true); +} + +TEST_F(InlineTest, DeleteName) { + // Test that the name of the result id of the call is deleted. + const std::string before = + R"( + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" + OpName %main "main" + OpName %main_entry "main_entry" + OpName %foo_result "foo_result" + OpName %void_fn "void_fn" + OpName %foo "foo" + OpName %foo_entry "foo_entry" + %void = OpTypeVoid + %void_fn = OpTypeFunction %void + %foo = OpFunction %void None %void_fn + %foo_entry = OpLabel + OpReturn + OpFunctionEnd + %main = OpFunction %void None %void_fn + %main_entry = OpLabel + %foo_result = OpFunctionCall %void %foo + OpReturn + OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %main "main" +OpName %main "main" +OpName %main_entry "main_entry" +OpName %void_fn "void_fn" +OpName %foo "foo" +OpName %foo_entry "foo_entry" +%void = OpTypeVoid +%void_fn = OpTypeFunction %void +%foo = OpFunction %void None %void_fn +%foo_entry = OpLabel +OpReturn +OpFunctionEnd +%main = OpFunction %void None %void_fn +%main_entry = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(before, after, false, true); +} + +TEST_F(InlineTest, SetParent) { + // Test that after inlining all basic blocks have the correct parent. + const std::string text = + R"( + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" + OpName %main "main" + OpName %main_entry "main_entry" + OpName %foo_result "foo_result" + OpName %void_fn "void_fn" + OpName %foo "foo" + OpName %foo_entry "foo_entry" + %void = OpTypeVoid + %void_fn = OpTypeFunction %void + %foo = OpFunction %void None %void_fn + %foo_entry = OpLabel + OpReturn + OpFunctionEnd + %main = OpFunction %void None %void_fn + %main_entry = OpLabel + %foo_result = OpFunctionCall %void %foo + OpReturn + OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::InlineExhaustivePass pass; + pass.Run(context.get()); + + for (ir::Function& func : *context->module()) { + for (ir::BasicBlock& bb : func) { + EXPECT_TRUE(bb.GetParent() == &func); + } + } +} + +// TODO(greg-lunarg): Add tests to verify handling of these cases: +// +// Empty modules +// Modules without function definitions +// Modules in which all functions do not call other functions +// Recursive functions (calling self & calling each other) +// Caller and callee both accessing the same global variable +// Functions with OpLine & OpNoLine +// Others? + +// TODO(dneto): Test suggestions from code review +// https://github.com/KhronosGroup/SPIRV-Tools/pull/534 +// +// Callee function returns a value generated outside the callee, +// e.g. a constant value. This might exercise some logic not yet +// exercised by the current tests: the false branch in the "if" +// inside the SpvOpReturnValue case in InlinePass::GenInlineCode? +// SampledImage before function call, but callee is only single block. +// Then the SampledImage instruction is not cloned. Documents existing +// behaviour. +// SampledImage after function call. It is not cloned or changed. + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/insert_extract_elim_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/insert_extract_elim_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/insert_extract_elim_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/insert_extract_elim_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,863 @@ +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using InsertExtractElimTest = PassTest<::testing::Test>; + +TEST_F(InsertExtractElimTest, Simple) { + // Note: The SPIR-V assembly has had store/load elimination + // performed to allow the inserts and extracts to directly + // reference each other. + // + // #version 140 + // + // in vec4 BaseColor; + // + // struct S_t { + // vec4 v0; + // vec4 v1; + // }; + // + // void main() + // { + // S_t s0; + // s0.v1 = BaseColor; + // gl_FragColor = s0.v1; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S_t "S_t" +OpMemberName %S_t 0 "v0" +OpMemberName %S_t 1 "v1" +OpName %s0 "s0" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%S_t = OpTypeStruct %v4float %v4float +%_ptr_Function_S_t = OpTypePointer Function %S_t +%int = OpTypeInt 32 1 +%int_1 = OpConstant %int 1 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %8 +%17 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%18 = OpLoad %v4float %BaseColor +%19 = OpLoad %S_t %s0 +%20 = OpCompositeInsert %S_t %18 %19 1 +OpStore %s0 %20 +%21 = OpCompositeExtract %v4float %20 1 +OpStore %gl_FragColor %21 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %8 +%17 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%18 = OpLoad %v4float %BaseColor +%19 = OpLoad %S_t %s0 +%20 = OpCompositeInsert %S_t %18 %19 1 +OpStore %s0 %20 +OpStore %gl_FragColor %18 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(InsertExtractElimTest, OptimizeAcrossNonConflictingInsert) { + // Note: The SPIR-V assembly has had store/load elimination + // performed to allow the inserts and extracts to directly + // reference each other. + // + // #version 140 + // + // in vec4 BaseColor; + // + // struct S_t { + // vec4 v0; + // vec4 v1; + // }; + // + // void main() + // { + // S_t s0; + // s0.v1 = BaseColor; + // s0.v0[2] = 0.0; + // gl_FragColor = s0.v1; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S_t "S_t" +OpMemberName %S_t 0 "v0" +OpMemberName %S_t 1 "v1" +OpName %s0 "s0" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%S_t = OpTypeStruct %v4float %v4float +%_ptr_Function_S_t = OpTypePointer Function %S_t +%int = OpTypeInt 32 1 +%int_1 = OpConstant %int 1 +%float_0 = OpConstant %float 0 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %8 +%18 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%19 = OpLoad %v4float %BaseColor +%20 = OpLoad %S_t %s0 +%21 = OpCompositeInsert %S_t %19 %20 1 +%22 = OpCompositeInsert %S_t %float_0 %21 0 2 +OpStore %s0 %22 +%23 = OpCompositeExtract %v4float %22 1 +OpStore %gl_FragColor %23 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %8 +%18 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%19 = OpLoad %v4float %BaseColor +%20 = OpLoad %S_t %s0 +%21 = OpCompositeInsert %S_t %19 %20 1 +%22 = OpCompositeInsert %S_t %float_0 %21 0 2 +OpStore %s0 %22 +OpStore %gl_FragColor %19 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(InsertExtractElimTest, OptimizeOpaque) { + // SPIR-V not representable in GLSL; not generatable from HLSL + // for the moment. + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %outColor %texCoords +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S_t "S_t" +OpMemberName %S_t 0 "v0" +OpMemberName %S_t 1 "v1" +OpMemberName %S_t 2 "smp" +OpName %outColor "outColor" +OpName %sampler15 "sampler15" +OpName %s0 "s0" +OpName %texCoords "texCoords" +OpDecorate %sampler15 DescriptorSet 0 +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v2float = OpTypeVector %float 2 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%outColor = OpVariable %_ptr_Output_v4float Output +%14 = OpTypeImage %float 2D 0 0 0 1 Unknown +%15 = OpTypeSampledImage %14 +%S_t = OpTypeStruct %v2float %v2float %15 +%_ptr_Function_S_t = OpTypePointer Function %S_t +%17 = OpTypeFunction %void %_ptr_Function_S_t +%_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15 +%_ptr_Function_15 = OpTypePointer Function %15 +%sampler15 = OpVariable %_ptr_UniformConstant_15 UniformConstant +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%int_2 = OpConstant %int 2 +%_ptr_Function_v2float = OpTypePointer Function %v2float +%_ptr_Input_v2float = OpTypePointer Input %v2float +%texCoords = OpVariable %_ptr_Input_v2float Input +)"; + + const std::string before = + R"(%main = OpFunction %void None %9 +%25 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%26 = OpLoad %v2float %texCoords +%27 = OpLoad %S_t %s0 +%28 = OpCompositeInsert %S_t %26 %27 0 +%29 = OpLoad %15 %sampler15 +%30 = OpCompositeInsert %S_t %29 %28 2 +OpStore %s0 %30 +%31 = OpCompositeExtract %15 %30 2 +%32 = OpCompositeExtract %v2float %30 0 +%33 = OpImageSampleImplicitLod %v4float %31 %32 +OpStore %outColor %33 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %9 +%25 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%26 = OpLoad %v2float %texCoords +%27 = OpLoad %S_t %s0 +%28 = OpCompositeInsert %S_t %26 %27 0 +%29 = OpLoad %15 %sampler15 +%30 = OpCompositeInsert %S_t %29 %28 2 +OpStore %s0 %30 +%33 = OpImageSampleImplicitLod %v4float %29 %26 +OpStore %outColor %33 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(InsertExtractElimTest, OptimizeNestedStruct) { + // The following HLSL has been pre-optimized to get the SPIR-V: + // struct S0 + // { + // int x; + // SamplerState ss; + // }; + // + // struct S1 + // { + // float b; + // S0 s0; + // }; + // + // struct S2 + // { + // int a1; + // S1 resources; + // }; + // + // SamplerState samp; + // Texture2D tex; + // + // float4 main(float4 vpos : VPOS) : COLOR0 + // { + // S1 s1; + // S2 s2; + // s1.s0.ss = samp; + // s2.resources = s1; + // return tex.Sample(s2.resources.s0.ss, float2(0.5)); + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %_entryPointOutput +OpExecutionMode %main OriginUpperLeft +OpSource HLSL 500 +OpName %main "main" +OpName %S0 "S0" +OpMemberName %S0 0 "x" +OpMemberName %S0 1 "ss" +OpName %S1 "S1" +OpMemberName %S1 0 "b" +OpMemberName %S1 1 "s0" +OpName %samp "samp" +OpName %S2 "S2" +OpMemberName %S2 0 "a1" +OpMemberName %S2 1 "resources" +OpName %tex "tex" +OpName %_entryPointOutput "@entryPointOutput" +OpDecorate %samp DescriptorSet 0 +OpDecorate %tex DescriptorSet 0 +OpDecorate %_entryPointOutput Location 0 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%14 = OpTypeFunction %v4float %_ptr_Function_v4float +%int = OpTypeInt 32 1 +%16 = OpTypeSampler +%S0 = OpTypeStruct %int %16 +%S1 = OpTypeStruct %float %S0 +%_ptr_Function_S1 = OpTypePointer Function %S1 +%int_1 = OpConstant %int 1 +%_ptr_UniformConstant_16 = OpTypePointer UniformConstant %16 +%samp = OpVariable %_ptr_UniformConstant_16 UniformConstant +%_ptr_Function_16 = OpTypePointer Function %16 +%S2 = OpTypeStruct %int %S1 +%_ptr_Function_S2 = OpTypePointer Function %S2 +%22 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_22 = OpTypePointer UniformConstant %22 +%tex = OpVariable %_ptr_UniformConstant_22 UniformConstant +%24 = OpTypeSampledImage %22 +%v2float = OpTypeVector %float 2 +%float_0_5 = OpConstant %float 0.5 +%27 = OpConstantComposite %v2float %float_0_5 %float_0_5 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_entryPointOutput = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %10 +%30 = OpLabel +%31 = OpVariable %_ptr_Function_S1 Function +%32 = OpVariable %_ptr_Function_S2 Function +%33 = OpLoad %16 %samp +%34 = OpLoad %S1 %31 +%35 = OpCompositeInsert %S1 %33 %34 1 1 +OpStore %31 %35 +%36 = OpLoad %S2 %32 +%37 = OpCompositeInsert %S2 %35 %36 1 +OpStore %32 %37 +%38 = OpLoad %22 %tex +%39 = OpCompositeExtract %16 %37 1 1 1 +%40 = OpSampledImage %24 %38 %39 +%41 = OpImageSampleImplicitLod %v4float %40 %27 +OpStore %_entryPointOutput %41 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %10 +%30 = OpLabel +%31 = OpVariable %_ptr_Function_S1 Function +%32 = OpVariable %_ptr_Function_S2 Function +%33 = OpLoad %16 %samp +%34 = OpLoad %S1 %31 +%35 = OpCompositeInsert %S1 %33 %34 1 1 +OpStore %31 %35 +%36 = OpLoad %S2 %32 +%37 = OpCompositeInsert %S2 %35 %36 1 +OpStore %32 %37 +%38 = OpLoad %22 %tex +%40 = OpSampledImage %24 %38 %33 +%41 = OpImageSampleImplicitLod %v4float %40 %27 +OpStore %_entryPointOutput %41 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(InsertExtractElimTest, ConflictingInsertPreventsOptimization) { + // Note: The SPIR-V assembly has had store/load elimination + // performed to allow the inserts and extracts to directly + // reference each other. + // + // #version 140 + // + // in vec4 BaseColor; + // + // struct S_t { + // vec4 v0; + // vec4 v1; + // }; + // + // void main() + // { + // S_t s0; + // s0.v1 = BaseColor; + // s0.v1[2] = 0.0; + // gl_FragColor = s0.v1; + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S_t "S_t" +OpMemberName %S_t 0 "v0" +OpMemberName %S_t 1 "v1" +OpName %s0 "s0" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%S_t = OpTypeStruct %v4float %v4float +%_ptr_Function_S_t = OpTypePointer Function %S_t +%int = OpTypeInt 32 1 +%int_1 = OpConstant %int 1 +%float_0 = OpConstant %float 0 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %8 +%18 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%19 = OpLoad %v4float %BaseColor +%20 = OpLoad %S_t %s0 +%21 = OpCompositeInsert %S_t %19 %20 1 +%22 = OpCompositeInsert %S_t %float_0 %21 1 2 +OpStore %s0 %22 +%23 = OpCompositeExtract %v4float %22 1 +OpStore %gl_FragColor %23 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, + true); +} + +TEST_F(InsertExtractElimTest, ConflictingInsertPreventsOptimization2) { + // Note: The SPIR-V assembly has had store/load elimination + // performed to allow the inserts and extracts to directly + // reference each other. + // + // #version 140 + // + // in vec4 BaseColor; + // + // struct S_t { + // vec4 v0; + // vec4 v1; + // }; + // + // void main() + // { + // S_t s0; + // s0.v1[1] = 1.0; // dead + // s0.v1 = Baseline; + // gl_FragColor = vec4(s0.v1[1], 0.0, 0.0, 0.0); + // } + + const std::string before_predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S_t "S_t" +OpMemberName %S_t 0 "v0" +OpMemberName %S_t 1 "v1" +OpName %s0 "s0" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%S_t = OpTypeStruct %v4float %v4float +%_ptr_Function_S_t = OpTypePointer Function %S_t +%int = OpTypeInt 32 1 +%int_1 = OpConstant %int 1 +%float_1 = OpConstant %float 1 +%uint = OpTypeInt 32 0 +%uint_1 = OpConstant %uint 1 +%_ptr_Function_float = OpTypePointer Function %float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%float_0 = OpConstant %float 0 +)"; + + const std::string after_predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S_t "S_t" +OpMemberName %S_t 0 "v0" +OpMemberName %S_t 1 "v1" +OpName %s0 "s0" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%S_t = OpTypeStruct %v4float %v4float +%_ptr_Function_S_t = OpTypePointer Function %S_t +%int = OpTypeInt 32 1 +%int_1 = OpConstant %int 1 +%float_1 = OpConstant %float 1 +%uint = OpTypeInt 32 0 +%uint_1 = OpConstant %uint 1 +%_ptr_Function_float = OpTypePointer Function %float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%float_0 = OpConstant %float 0 +)"; + + const std::string before = + R"(%main = OpFunction %void None %8 +%22 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%23 = OpLoad %S_t %s0 +%24 = OpCompositeInsert %S_t %float_1 %23 1 1 +%25 = OpLoad %v4float %BaseColor +%26 = OpCompositeInsert %S_t %25 %24 1 +%27 = OpCompositeExtract %float %26 1 1 +%28 = OpCompositeConstruct %v4float %27 %float_0 %float_0 %float_0 +OpStore %gl_FragColor %28 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %8 +%22 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%23 = OpLoad %S_t %s0 +%24 = OpCompositeInsert %S_t %float_1 %23 1 1 +%25 = OpLoad %v4float %BaseColor +%26 = OpCompositeInsert %S_t %25 %24 1 +%27 = OpCompositeExtract %float %26 1 1 +%28 = OpCompositeConstruct %v4float %27 %float_0 %float_0 %float_0 +OpStore %gl_FragColor %28 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + before_predefs + before, after_predefs + after, true, true); +} + +TEST_F(InsertExtractElimTest, MixWithConstants) { + // Extract component of FMix with 0.0 or 1.0 as the a-value. + // + // Note: The SPIR-V assembly has had store/load elimination + // performed to allow the inserts and extracts to directly + // reference each other. + // + // #version 450 + // + // layout (location=0) in float bc; + // layout (location=1) in float bc2; + // layout (location=2) in float m; + // layout (location=3) in float m2; + // layout (location=0) out vec4 OutColor; + // + // void main() + // { + // vec4 bcv = vec4(bc, bc2, 0.0, 1.0); + // vec4 bcv2 = vec4(bc2, bc, 1.0, 0.0); + // vec4 v = mix(bcv, bcv2, vec4(0.0,1.0,m,m2)); + // OutColor = vec4(v.y); + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %bc %bc2 %m %m2 %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %bc "bc" +OpName %bc2 "bc2" +OpName %m "m" +OpName %m2 "m2" +OpName %OutColor "OutColor" +OpDecorate %bc Location 0 +OpDecorate %bc2 Location 1 +OpDecorate %m Location 2 +OpDecorate %m2 Location 3 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_float = OpTypePointer Input %float +%bc = OpVariable %_ptr_Input_float Input +%bc2 = OpVariable %_ptr_Input_float Input +%float_0 = OpConstant %float 0 +%float_1 = OpConstant %float 1 +%m = OpVariable %_ptr_Input_float Input +%m2 = OpVariable %_ptr_Input_float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%uint = OpTypeInt 32 0 +%_ptr_Function_float = OpTypePointer Function %float +)"; + + const std::string before = + R"(%main = OpFunction %void None %9 +%19 = OpLabel +%20 = OpLoad %float %bc +%21 = OpLoad %float %bc2 +%22 = OpCompositeConstruct %v4float %20 %21 %float_0 %float_1 +%23 = OpLoad %float %bc2 +%24 = OpLoad %float %bc +%25 = OpCompositeConstruct %v4float %23 %24 %float_1 %float_0 +%26 = OpLoad %float %m +%27 = OpLoad %float %m2 +%28 = OpCompositeConstruct %v4float %float_0 %float_1 %26 %27 +%29 = OpExtInst %v4float %1 FMix %22 %25 %28 +%30 = OpCompositeExtract %float %29 1 +%31 = OpCompositeConstruct %v4float %30 %30 %30 %30 +OpStore %OutColor %31 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %9 +%19 = OpLabel +%20 = OpLoad %float %bc +%21 = OpLoad %float %bc2 +%22 = OpCompositeConstruct %v4float %20 %21 %float_0 %float_1 +%23 = OpLoad %float %bc2 +%24 = OpLoad %float %bc +%25 = OpCompositeConstruct %v4float %23 %24 %float_1 %float_0 +%26 = OpLoad %float %m +%27 = OpLoad %float %m2 +%28 = OpCompositeConstruct %v4float %float_0 %float_1 %26 %27 +%29 = OpExtInst %v4float %1 FMix %22 %25 %28 +%31 = OpCompositeConstruct %v4float %24 %24 %24 %24 +OpStore %OutColor %31 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(InsertExtractElimTest, VectorShuffle1) { + // Extract component from first vector in VectorShuffle + // + // Note: The SPIR-V assembly has had store/load elimination + // performed to allow the inserts and extracts to directly + // reference each other. + // + // #version 450 + // + // layout (location=0) in float bc; + // layout (location=1) in float bc2; + // layout (location=0) out vec4 OutColor; + // + // void main() + // { + // vec4 bcv = vec4(bc, bc2, 0.0, 1.0); + // vec4 v = bcv.zwxy; + // OutColor = vec4(v.y); + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %bc %bc2 %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %bc "bc" +OpName %bc2 "bc2" +OpName %OutColor "OutColor" +OpDecorate %bc Location 0 +OpDecorate %bc2 Location 1 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_float = OpTypePointer Input %float +%bc = OpVariable %_ptr_Input_float Input +%bc2 = OpVariable %_ptr_Input_float Input +%float_0 = OpConstant %float 0 +%float_1 = OpConstant %float 1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%uint = OpTypeInt 32 0 +%_ptr_Function_float = OpTypePointer Function %float +)"; + + const std::string before = + R"(%main = OpFunction %void None %7 +%17 = OpLabel +%18 = OpLoad %float %bc +%19 = OpLoad %float %bc2 +%20 = OpCompositeConstruct %v4float %18 %19 %float_0 %float_1 +%21 = OpVectorShuffle %v4float %20 %20 2 3 0 1 +%22 = OpCompositeExtract %float %21 1 +%23 = OpCompositeConstruct %v4float %22 %22 %22 %22 +OpStore %OutColor %23 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %7 +%17 = OpLabel +%18 = OpLoad %float %bc +%19 = OpLoad %float %bc2 +%20 = OpCompositeConstruct %v4float %18 %19 %float_0 %float_1 +%21 = OpVectorShuffle %v4float %20 %20 2 3 0 1 +%23 = OpCompositeConstruct %v4float %float_1 %float_1 %float_1 %float_1 +OpStore %OutColor %23 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(InsertExtractElimTest, VectorShuffle2) { + // Extract component from second vector in VectorShuffle + // Identical to test VectorShuffle1 except for the vector + // shuffle index of 7. + // + // Note: The SPIR-V assembly has had store/load elimination + // performed to allow the inserts and extracts to directly + // reference each other. + // + // #version 450 + // + // layout (location=0) in float bc; + // layout (location=1) in float bc2; + // layout (location=0) out vec4 OutColor; + // + // void main() + // { + // vec4 bcv = vec4(bc, bc2, 0.0, 1.0); + // vec4 v = bcv.zwxy; + // OutColor = vec4(v.y); + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %bc %bc2 %OutColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %bc "bc" +OpName %bc2 "bc2" +OpName %OutColor "OutColor" +OpDecorate %bc Location 0 +OpDecorate %bc2 Location 1 +OpDecorate %OutColor Location 0 +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_float = OpTypePointer Input %float +%bc = OpVariable %_ptr_Input_float Input +%bc2 = OpVariable %_ptr_Input_float Input +%float_0 = OpConstant %float 0 +%float_1 = OpConstant %float 1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%OutColor = OpVariable %_ptr_Output_v4float Output +%uint = OpTypeInt 32 0 +%_ptr_Function_float = OpTypePointer Function %float +)"; + + const std::string before = + R"(%main = OpFunction %void None %7 +%17 = OpLabel +%18 = OpLoad %float %bc +%19 = OpLoad %float %bc2 +%20 = OpCompositeConstruct %v4float %18 %19 %float_0 %float_1 +%21 = OpVectorShuffle %v4float %20 %20 2 7 0 1 +%22 = OpCompositeExtract %float %21 1 +%23 = OpCompositeConstruct %v4float %22 %22 %22 %22 +OpStore %OutColor %23 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %7 +%17 = OpLabel +%18 = OpLoad %float %bc +%19 = OpLoad %float %bc2 +%20 = OpCompositeConstruct %v4float %18 %19 %float_0 %float_1 +%21 = OpVectorShuffle %v4float %20 %20 2 7 0 1 +%23 = OpCompositeConstruct %v4float %float_1 %float_1 %float_1 %float_1 +OpStore %OutColor %23 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +// TODO(greg-lunarg): Add tests to verify handling of these cases: +// + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/instruction_list_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/instruction_list_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/instruction_list_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/instruction_list_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,112 @@ +// Copyright (c) 2017 Google 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. + +#include +#include +#include + +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +#include "opt/instruction.h" +#include "opt/instruction_list.h" + +namespace { + +using Instruction = spvtools::ir::Instruction; +using InstructionList = spvtools::ir::InstructionList; +using ::testing::ContainerEq; +using ::testing::ElementsAre; +using InstructionListTest = ::testing::Test; + +// A class that overrides the destructor, so we can trace it. +class TestInstruction : public Instruction { + public: + TestInstruction() : Instruction() { created_instructions_.push_back(this); } + + ~TestInstruction() { deleted_instructions_.push_back(this); } + + static std::vector created_instructions_; + static std::vector deleted_instructions_; +}; + +std::vector TestInstruction::created_instructions_; +std::vector TestInstruction::deleted_instructions_; + +// Test that the destructor for InstructionList is calling the destructor +// for every element that is in the list. +TEST(InstructionListTest, Destructor) { + InstructionList* list = new InstructionList(); + list->push_back(std::unique_ptr(new Instruction())); + list->push_back(std::unique_ptr(new Instruction())); + delete list; + + // Sorting because we do not care if the order of create and destruction is + // the same. Using generic sort just incase things are changed above. + std::sort(TestInstruction::created_instructions_.begin(), + TestInstruction::created_instructions_.end()); + std::sort(TestInstruction::deleted_instructions_.begin(), + TestInstruction::deleted_instructions_.end()); + EXPECT_THAT(TestInstruction::created_instructions_, + ContainerEq(TestInstruction::deleted_instructions_)); +} + +// Test the |InsertBefore| with a single instruction in the iterator class. +// Need to make sure the elements are inserted in the correct order, and the +// return value points to the correct location. +// +// Comparing addresses to make sure they remain stable, so other data structures +// can have pointers to instructions in InstructionList. +TEST(InstructionListTest, InsertBefore1) { + InstructionList list; + std::vector inserted_instructions; + for (int i = 0; i < 4; i++) { + std::unique_ptr inst(new Instruction()); + inserted_instructions.push_back(inst.get()); + auto new_element = list.end().InsertBefore(std::move(inst)); + EXPECT_EQ(&*new_element, inserted_instructions.back()); + } + + std::vector output; + for (auto& i : list) { + output.push_back(&i); + } + EXPECT_THAT(output, ContainerEq(inserted_instructions)); +} + +// Test inserting an entire vector of instructions using InsertBefore. Checking +// the order of insertion and the return value. +// +// Comparing addresses to make sure they remain stable, so other data structures +// can have pointers to instructions in InstructionList. +TEST(InstructionListTest, InsertBefore2) { + InstructionList list; + std::vector> new_instructions; + std::vector created_instructions; + for (int i = 0; i < 4; i++) { + std::unique_ptr inst(new Instruction()); + created_instructions.push_back(inst.get()); + new_instructions.push_back(std::move(inst)); + } + auto new_element = list.begin().InsertBefore(std::move(new_instructions)); + EXPECT_TRUE(new_instructions.empty()); + EXPECT_EQ(&*new_element, created_instructions.front()); + + std::vector output; + for (auto& i : list) { + output.push_back(&i); + } + EXPECT_THAT(output, ContainerEq(created_instructions)); +} +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/instruction_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/instruction_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/instruction_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/instruction_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,658 @@ +// Copyright (c) 2016 Google 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. + +#include "opt/instruction.h" +#include "opt/ir_context.h" + +#include "gmock/gmock.h" + +#include "pass_fixture.h" +#include "pass_utils.h" +#include "spirv-tools/libspirv.h" +#include "unit_spirv.h" + +namespace { + +using namespace spvtools; +using ir::Instruction; +using ir::IRContext; +using ir::Operand; +using spvtest::MakeInstruction; +using ::testing::Eq; +using DescriptorTypeTest = PassTest<::testing::Test>; +using OpaqueTypeTest = PassTest<::testing::Test>; +using GetBaseTest = PassTest<::testing::Test>; + +TEST(InstructionTest, CreateTrivial) { + Instruction empty; + EXPECT_EQ(SpvOpNop, empty.opcode()); + EXPECT_EQ(0u, empty.type_id()); + EXPECT_EQ(0u, empty.result_id()); + EXPECT_EQ(0u, empty.NumOperands()); + EXPECT_EQ(0u, empty.NumOperandWords()); + EXPECT_EQ(0u, empty.NumInOperandWords()); + EXPECT_EQ(empty.cend(), empty.cbegin()); + EXPECT_EQ(empty.end(), empty.begin()); +} + +TEST(InstructionTest, CreateWithOpcodeAndNoOperands) { + IRContext context(SPV_ENV_UNIVERSAL_1_2, nullptr); + Instruction inst(&context, SpvOpReturn); + EXPECT_EQ(SpvOpReturn, inst.opcode()); + EXPECT_EQ(0u, inst.type_id()); + EXPECT_EQ(0u, inst.result_id()); + EXPECT_EQ(0u, inst.NumOperands()); + EXPECT_EQ(0u, inst.NumOperandWords()); + EXPECT_EQ(0u, inst.NumInOperandWords()); + EXPECT_EQ(inst.cend(), inst.cbegin()); + EXPECT_EQ(inst.end(), inst.begin()); +} + +// The words for an OpTypeInt for 32-bit signed integer resulting in Id 44. +uint32_t kSampleInstructionWords[] = {(4 << 16) | uint32_t(SpvOpTypeInt), 44, + 32, 1}; +// The operands that would be parsed from kSampleInstructionWords +spv_parsed_operand_t kSampleParsedOperands[] = { + {1, 1, SPV_OPERAND_TYPE_RESULT_ID, SPV_NUMBER_NONE, 0}, + {2, 1, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_NUMBER_UNSIGNED_INT, 32}, + {3, 1, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_NUMBER_UNSIGNED_INT, 1}, +}; + +// A valid parse of kSampleParsedOperands. +spv_parsed_instruction_t kSampleParsedInstruction = {kSampleInstructionWords, + uint16_t(4), + uint16_t(SpvOpTypeInt), + SPV_EXT_INST_TYPE_NONE, + 0, // type id + 44, // result id + kSampleParsedOperands, + 3}; + +// The words for an OpAccessChain instruction. +uint32_t kSampleAccessChainInstructionWords[] = { + (7 << 16) | uint32_t(SpvOpAccessChain), 100, 101, 102, 103, 104, 105}; + +// The operands that would be parsed from kSampleAccessChainInstructionWords. +spv_parsed_operand_t kSampleAccessChainOperands[] = { + {1, 1, SPV_OPERAND_TYPE_RESULT_ID, SPV_NUMBER_NONE, 0}, + {2, 1, SPV_OPERAND_TYPE_TYPE_ID, SPV_NUMBER_NONE, 0}, + {3, 1, SPV_OPERAND_TYPE_ID, SPV_NUMBER_NONE, 0}, + {4, 1, SPV_OPERAND_TYPE_ID, SPV_NUMBER_NONE, 0}, + {5, 1, SPV_OPERAND_TYPE_ID, SPV_NUMBER_NONE, 0}, + {6, 1, SPV_OPERAND_TYPE_ID, SPV_NUMBER_NONE, 0}, +}; + +// A valid parse of kSampleAccessChainInstructionWords +spv_parsed_instruction_t kSampleAccessChainInstruction = { + kSampleAccessChainInstructionWords, + uint16_t(7), + uint16_t(SpvOpAccessChain), + SPV_EXT_INST_TYPE_NONE, + 100, // type id + 101, // result id + kSampleAccessChainOperands, + 6}; + +// The words for an OpControlBarrier instruction. +uint32_t kSampleControlBarrierInstructionWords[] = { + (4 << 16) | uint32_t(SpvOpControlBarrier), 100, 101, 102}; + +// The operands that would be parsed from kSampleControlBarrierInstructionWords. +spv_parsed_operand_t kSampleControlBarrierOperands[] = { + {1, 1, SPV_OPERAND_TYPE_SCOPE_ID, SPV_NUMBER_NONE, 0}, // Execution + {2, 1, SPV_OPERAND_TYPE_SCOPE_ID, SPV_NUMBER_NONE, 0}, // Memory + {3, 1, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_NUMBER_NONE, + 0}, // Semantics +}; + +// A valid parse of kSampleControlBarrierInstructionWords +spv_parsed_instruction_t kSampleControlBarrierInstruction = { + kSampleControlBarrierInstructionWords, + uint16_t(4), + uint16_t(SpvOpControlBarrier), + SPV_EXT_INST_TYPE_NONE, + 0, // type id + 0, // result id + kSampleControlBarrierOperands, + 3}; + +TEST(InstructionTest, CreateWithOpcodeAndOperands) { + IRContext context(SPV_ENV_UNIVERSAL_1_2, nullptr); + Instruction inst(&context, kSampleParsedInstruction); + EXPECT_EQ(SpvOpTypeInt, inst.opcode()); + EXPECT_EQ(0u, inst.type_id()); + EXPECT_EQ(44u, inst.result_id()); + EXPECT_EQ(3u, inst.NumOperands()); + EXPECT_EQ(3u, inst.NumOperandWords()); + EXPECT_EQ(2u, inst.NumInOperandWords()); +} + +TEST(InstructionTest, GetOperand) { + IRContext context(SPV_ENV_UNIVERSAL_1_2, nullptr); + Instruction inst(&context, kSampleParsedInstruction); + EXPECT_THAT(inst.GetOperand(0).words, Eq(std::vector{44})); + EXPECT_THAT(inst.GetOperand(1).words, Eq(std::vector{32})); + EXPECT_THAT(inst.GetOperand(2).words, Eq(std::vector{1})); +} + +TEST(InstructionTest, GetInOperand) { + IRContext context(SPV_ENV_UNIVERSAL_1_2, nullptr); + Instruction inst(&context, kSampleParsedInstruction); + EXPECT_THAT(inst.GetInOperand(0).words, Eq(std::vector{32})); + EXPECT_THAT(inst.GetInOperand(1).words, Eq(std::vector{1})); +} + +TEST(InstructionTest, OperandConstIterators) { + IRContext context(SPV_ENV_UNIVERSAL_1_2, nullptr); + Instruction inst(&context, kSampleParsedInstruction); + // Spot check iteration across operands. + auto cbegin = inst.cbegin(); + auto cend = inst.cend(); + EXPECT_NE(cend, inst.cbegin()); + + auto citer = inst.cbegin(); + for (int i = 0; i < 3; ++i, ++citer) { + const auto& operand = *citer; + EXPECT_THAT(operand.type, Eq(kSampleParsedOperands[i].type)); + EXPECT_THAT(operand.words, + Eq(std::vector{kSampleInstructionWords[i + 1]})); + EXPECT_NE(cend, citer); + } + EXPECT_EQ(cend, citer); + + // Check that cbegin and cend have not changed. + EXPECT_EQ(cbegin, inst.cbegin()); + EXPECT_EQ(cend, inst.cend()); + + // Check arithmetic. + const Operand& operand2 = *(inst.cbegin() + 2); + EXPECT_EQ(SPV_OPERAND_TYPE_LITERAL_INTEGER, operand2.type); +} + +TEST(InstructionTest, OperandIterators) { + IRContext context(SPV_ENV_UNIVERSAL_1_2, nullptr); + Instruction inst(&context, kSampleParsedInstruction); + // Spot check iteration across operands, with mutable iterators. + auto begin = inst.begin(); + auto end = inst.end(); + EXPECT_NE(end, inst.begin()); + + auto iter = inst.begin(); + for (int i = 0; i < 3; ++i, ++iter) { + const auto& operand = *iter; + EXPECT_THAT(operand.type, Eq(kSampleParsedOperands[i].type)); + EXPECT_THAT(operand.words, + Eq(std::vector{kSampleInstructionWords[i + 1]})); + EXPECT_NE(end, iter); + } + EXPECT_EQ(end, iter); + + // Check that begin and end have not changed. + EXPECT_EQ(begin, inst.begin()); + EXPECT_EQ(end, inst.end()); + + // Check arithmetic. + Operand& operand2 = *(inst.begin() + 2); + EXPECT_EQ(SPV_OPERAND_TYPE_LITERAL_INTEGER, operand2.type); + + // Check mutation through an iterator. + operand2.type = SPV_OPERAND_TYPE_TYPE_ID; + EXPECT_EQ(SPV_OPERAND_TYPE_TYPE_ID, (*(inst.cbegin() + 2)).type); +} + +TEST(InstructionTest, ForInIdStandardIdTypes) { + IRContext context(SPV_ENV_UNIVERSAL_1_2, nullptr); + Instruction inst(&context, kSampleAccessChainInstruction); + + std::vector ids; + inst.ForEachInId([&ids](const uint32_t* idptr) { ids.push_back(*idptr); }); + EXPECT_THAT(ids, Eq(std::vector{102, 103, 104, 105})); + + ids.clear(); + inst.ForEachInId([&ids](uint32_t* idptr) { ids.push_back(*idptr); }); + EXPECT_THAT(ids, Eq(std::vector{102, 103, 104, 105})); +} + +TEST(InstructionTest, ForInIdNonstandardIdTypes) { + IRContext context(SPV_ENV_UNIVERSAL_1_2, nullptr); + Instruction inst(&context, kSampleControlBarrierInstruction); + + std::vector ids; + inst.ForEachInId([&ids](const uint32_t* idptr) { ids.push_back(*idptr); }); + EXPECT_THAT(ids, Eq(std::vector{100, 101, 102})); + + ids.clear(); + inst.ForEachInId([&ids](uint32_t* idptr) { ids.push_back(*idptr); }); + EXPECT_THAT(ids, Eq(std::vector{100, 101, 102})); +} + +TEST(InstructionTest, UniqueIds) { + IRContext context(SPV_ENV_UNIVERSAL_1_2, nullptr); + Instruction inst1(&context); + Instruction inst2(&context); + EXPECT_NE(inst1.unique_id(), inst2.unique_id()); +} + +TEST(InstructionTest, CloneUniqueIdDifferent) { + IRContext context(SPV_ENV_UNIVERSAL_1_2, nullptr); + Instruction inst(&context); + std::unique_ptr clone(inst.Clone(&context)); + EXPECT_EQ(inst.context(), clone->context()); + EXPECT_NE(inst.unique_id(), clone->unique_id()); +} + +TEST(InstructionTest, CloneDifferentContext) { + IRContext c1(SPV_ENV_UNIVERSAL_1_2, nullptr); + IRContext c2(SPV_ENV_UNIVERSAL_1_2, nullptr); + Instruction inst(&c1); + std::unique_ptr clone(inst.Clone(&c2)); + EXPECT_EQ(&c1, inst.context()); + EXPECT_EQ(&c2, clone->context()); + EXPECT_NE(&c1, &c2); +} + +TEST(InstructionTest, CloneDifferentContextDifferentUniqueId) { + IRContext c1(SPV_ENV_UNIVERSAL_1_2, nullptr); + IRContext c2(SPV_ENV_UNIVERSAL_1_2, nullptr); + Instruction inst(&c1); + Instruction other(&c2); + std::unique_ptr clone(inst.Clone(&c2)); + EXPECT_EQ(&c2, clone->context()); + EXPECT_NE(other.unique_id(), clone->unique_id()); +} + +TEST(InstructionTest, EqualsEqualsOperator) { + IRContext context(SPV_ENV_UNIVERSAL_1_2, nullptr); + Instruction i1(&context); + Instruction i2(&context); + std::unique_ptr clone(i1.Clone(&context)); + EXPECT_TRUE(i1 == i1); + EXPECT_FALSE(i1 == i2); + EXPECT_FALSE(i1 == *clone); + EXPECT_FALSE(i2 == *clone); +} + +TEST(InstructionTest, LessThanOperator) { + IRContext context(SPV_ENV_UNIVERSAL_1_2, nullptr); + Instruction i1(&context); + Instruction i2(&context); + std::unique_ptr clone(i1.Clone(&context)); + EXPECT_TRUE(i1 < i2); + EXPECT_TRUE(i1 < *clone); + EXPECT_TRUE(i2 < *clone); +} + +TEST_F(DescriptorTypeTest, StorageImage) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + OpName %3 "myStorageImage" + OpDecorate %3 DescriptorSet 0 + OpDecorate %3 Binding 0 + %4 = OpTypeVoid + %5 = OpTypeFunction %4 + %6 = OpTypeFloat 32 + %7 = OpTypeImage %6 2D 0 0 0 2 R32f + %8 = OpTypePointer UniformConstant %7 + %3 = OpVariable %8 UniformConstant + %2 = OpFunction %4 None %5 + %9 = OpLabel + OpReturn + OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + Instruction* type = context->get_def_use_mgr()->GetDef(8); + EXPECT_TRUE(type->IsVulkanStorageImage()); + EXPECT_FALSE(type->IsVulkanSampledImage()); + EXPECT_FALSE(type->IsVulkanStorageTexelBuffer()); + EXPECT_FALSE(type->IsVulkanStorageBuffer()); + EXPECT_FALSE(type->IsVulkanUniformBuffer()); + + Instruction* variable = context->get_def_use_mgr()->GetDef(3); + EXPECT_FALSE(variable->IsReadOnlyVariable()); +} + +TEST_F(DescriptorTypeTest, SampledImage) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + OpName %3 "myStorageImage" + OpDecorate %3 DescriptorSet 0 + OpDecorate %3 Binding 0 + %4 = OpTypeVoid + %5 = OpTypeFunction %4 + %6 = OpTypeFloat 32 + %7 = OpTypeImage %6 2D 0 0 0 1 Unknown + %8 = OpTypePointer UniformConstant %7 + %3 = OpVariable %8 UniformConstant + %2 = OpFunction %4 None %5 + %9 = OpLabel + OpReturn + OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + Instruction* type = context->get_def_use_mgr()->GetDef(8); + EXPECT_FALSE(type->IsVulkanStorageImage()); + EXPECT_TRUE(type->IsVulkanSampledImage()); + EXPECT_FALSE(type->IsVulkanStorageTexelBuffer()); + EXPECT_FALSE(type->IsVulkanStorageBuffer()); + EXPECT_FALSE(type->IsVulkanUniformBuffer()); + + Instruction* variable = context->get_def_use_mgr()->GetDef(3); + EXPECT_TRUE(variable->IsReadOnlyVariable()); +} + +TEST_F(DescriptorTypeTest, StorageTexelBuffer) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + OpName %3 "myStorageImage" + OpDecorate %3 DescriptorSet 0 + OpDecorate %3 Binding 0 + %4 = OpTypeVoid + %5 = OpTypeFunction %4 + %6 = OpTypeFloat 32 + %7 = OpTypeImage %6 Buffer 0 0 0 2 R32f + %8 = OpTypePointer UniformConstant %7 + %3 = OpVariable %8 UniformConstant + %2 = OpFunction %4 None %5 + %9 = OpLabel + OpReturn + OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + Instruction* type = context->get_def_use_mgr()->GetDef(8); + EXPECT_FALSE(type->IsVulkanStorageImage()); + EXPECT_FALSE(type->IsVulkanSampledImage()); + EXPECT_TRUE(type->IsVulkanStorageTexelBuffer()); + EXPECT_FALSE(type->IsVulkanStorageBuffer()); + EXPECT_FALSE(type->IsVulkanUniformBuffer()); + + Instruction* variable = context->get_def_use_mgr()->GetDef(3); + EXPECT_FALSE(variable->IsReadOnlyVariable()); +} + +TEST_F(DescriptorTypeTest, StorageBuffer) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + OpName %3 "myStorageImage" + OpDecorate %3 DescriptorSet 0 + OpDecorate %3 Binding 0 + OpDecorate %9 BufferBlock + %4 = OpTypeVoid + %5 = OpTypeFunction %4 + %6 = OpTypeFloat 32 + %7 = OpTypeVector %6 4 + %8 = OpTypeRuntimeArray %7 + %9 = OpTypeStruct %8 + %10 = OpTypePointer Uniform %9 + %3 = OpVariable %10 Uniform + %2 = OpFunction %4 None %5 + %11 = OpLabel + OpReturn + OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + Instruction* type = context->get_def_use_mgr()->GetDef(10); + EXPECT_FALSE(type->IsVulkanStorageImage()); + EXPECT_FALSE(type->IsVulkanSampledImage()); + EXPECT_FALSE(type->IsVulkanStorageTexelBuffer()); + EXPECT_TRUE(type->IsVulkanStorageBuffer()); + EXPECT_FALSE(type->IsVulkanUniformBuffer()); + + Instruction* variable = context->get_def_use_mgr()->GetDef(3); + EXPECT_FALSE(variable->IsReadOnlyVariable()); +} + +TEST_F(DescriptorTypeTest, UniformBuffer) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + OpName %3 "myStorageImage" + OpDecorate %3 DescriptorSet 0 + OpDecorate %3 Binding 0 + OpDecorate %9 Block + %4 = OpTypeVoid + %5 = OpTypeFunction %4 + %6 = OpTypeFloat 32 + %7 = OpTypeVector %6 4 + %8 = OpTypeRuntimeArray %7 + %9 = OpTypeStruct %8 + %10 = OpTypePointer Uniform %9 + %3 = OpVariable %10 Uniform + %2 = OpFunction %4 None %5 + %11 = OpLabel + OpReturn + OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + Instruction* type = context->get_def_use_mgr()->GetDef(10); + EXPECT_FALSE(type->IsVulkanStorageImage()); + EXPECT_FALSE(type->IsVulkanSampledImage()); + EXPECT_FALSE(type->IsVulkanStorageTexelBuffer()); + EXPECT_FALSE(type->IsVulkanStorageBuffer()); + EXPECT_TRUE(type->IsVulkanUniformBuffer()); + + Instruction* variable = context->get_def_use_mgr()->GetDef(3); + EXPECT_TRUE(variable->IsReadOnlyVariable()); +} + +TEST_F(DescriptorTypeTest, NonWritableIsReadOnly) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + OpName %3 "myStorageImage" + OpDecorate %3 DescriptorSet 0 + OpDecorate %3 Binding 0 + OpDecorate %9 BufferBlock + OpDecorate %3 NonWritable + %4 = OpTypeVoid + %5 = OpTypeFunction %4 + %6 = OpTypeFloat 32 + %7 = OpTypeVector %6 4 + %8 = OpTypeRuntimeArray %7 + %9 = OpTypeStruct %8 + %10 = OpTypePointer Uniform %9 + %3 = OpVariable %10 Uniform + %2 = OpFunction %4 None %5 + %11 = OpLabel + OpReturn + OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + Instruction* variable = context->get_def_use_mgr()->GetDef(3); + EXPECT_TRUE(variable->IsReadOnlyVariable()); +} + +TEST_F(OpaqueTypeTest, BaseOpaqueTypesShader) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypeImage %5 2D 1 0 0 1 Unknown + %7 = OpTypeSampler + %8 = OpTypeSampledImage %6 + %9 = OpTypeRuntimeArray %5 + %2 = OpFunction %3 None %4 + %10 = OpLabel + OpReturn + OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + Instruction* image_type = context->get_def_use_mgr()->GetDef(6); + EXPECT_TRUE(image_type->IsOpaqueType()); + Instruction* sampler_type = context->get_def_use_mgr()->GetDef(7); + EXPECT_TRUE(sampler_type->IsOpaqueType()); + Instruction* sampled_image_type = context->get_def_use_mgr()->GetDef(8); + EXPECT_TRUE(sampled_image_type->IsOpaqueType()); + Instruction* runtime_array_type = context->get_def_use_mgr()->GetDef(9); + EXPECT_TRUE(runtime_array_type->IsOpaqueType()); + Instruction* float_type = context->get_def_use_mgr()->GetDef(5); + EXPECT_FALSE(float_type->IsOpaqueType()); + Instruction* void_type = context->get_def_use_mgr()->GetDef(3); + EXPECT_FALSE(void_type->IsOpaqueType()); +} + +TEST_F(OpaqueTypeTest, OpaqueStructTypes) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypeRuntimeArray %5 + %7 = OpTypeStruct %6 %6 + %8 = OpTypeStruct %5 %6 + %9 = OpTypeStruct %6 %5 + %10 = OpTypeStruct %7 + %2 = OpFunction %3 None %4 + %11 = OpLabel + OpReturn + OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + for (int i = 7; i <= 10; i++) { + Instruction* type = context->get_def_use_mgr()->GetDef(i); + EXPECT_TRUE(type->IsOpaqueType()); + } +} + +TEST_F(GetBaseTest, SampleImage) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + OpName %3 "myStorageImage" + OpDecorate %3 DescriptorSet 0 + OpDecorate %3 Binding 0 + %4 = OpTypeVoid + %5 = OpTypeFunction %4 + %6 = OpTypeFloat 32 + %7 = OpTypeVector %6 2 + %8 = OpTypeVector %6 4 + %9 = OpConstant %6 0 + %10 = OpConstantComposite %7 %9 %9 + %11 = OpTypeImage %6 2D 0 0 0 1 R32f + %12 = OpTypePointer UniformConstant %11 + %3 = OpVariable %12 UniformConstant + %13 = OpTypeSampledImage %11 + %14 = OpTypeSampler + %15 = OpTypePointer UniformConstant %14 + %16 = OpVariable %15 UniformConstant + %2 = OpFunction %4 None %5 + %17 = OpLabel + %18 = OpLoad %11 %3 + %19 = OpLoad %14 %16 + %20 = OpSampledImage %13 %18 %19 + %21 = OpImageSampleImplicitLod %8 %20 %10 + OpReturn + OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + Instruction* load = context->get_def_use_mgr()->GetDef(21); + Instruction* base = context->get_def_use_mgr()->GetDef(20); + EXPECT_TRUE(load->GetBaseAddress() == base); +} + +TEST_F(GetBaseTest, ImageRead) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + OpName %3 "myStorageImage" + OpDecorate %3 DescriptorSet 0 + OpDecorate %3 Binding 0 + %4 = OpTypeVoid + %5 = OpTypeFunction %4 + %6 = OpTypeInt 32 0 + %7 = OpTypeVector %6 2 + %8 = OpConstant %6 0 + %9 = OpConstantComposite %7 %8 %8 + %10 = OpTypeImage %6 2D 0 0 0 2 R32f + %11 = OpTypePointer UniformConstant %10 + %3 = OpVariable %11 UniformConstant + %2 = OpFunction %4 None %5 + %12 = OpLabel + %13 = OpLoad %10 %3 + %14 = OpImageRead %6 %13 %9 + OpReturn + OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + Instruction* load = context->get_def_use_mgr()->GetDef(14); + Instruction* base = context->get_def_use_mgr()->GetDef(13); + EXPECT_TRUE(load->GetBaseAddress() == base); +} +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/ir_builder.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/ir_builder.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/ir_builder.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/ir_builder.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,415 @@ +// Copyright (c) 2018 Google 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. + +#include +#include +#include +#include + +#ifdef SPIRV_EFFCEE +#include "effcee/effcee.h" +#endif + +#include "opt/basic_block.h" +#include "opt/ir_builder.h" + +#include "opt/build_module.h" +#include "opt/instruction.h" +#include "opt/type_manager.h" +#include "spirv-tools/libspirv.hpp" + +namespace { + +using namespace spvtools; +using ir::IRContext; +using Analysis = IRContext::Analysis; + +#ifdef SPIRV_EFFCEE + +using IRBuilderTest = ::testing::Test; + +bool Validate(const std::vector& bin) { + spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2; + spv_context spvContext = spvContextCreate(target_env); + spv_diagnostic diagnostic = nullptr; + spv_const_binary_t binary = {bin.data(), bin.size()}; + spv_result_t error = spvValidate(spvContext, &binary, &diagnostic); + if (error != 0) spvDiagnosticPrint(diagnostic); + spvDiagnosticDestroy(diagnostic); + spvContextDestroy(spvContext); + return error == 0; +} + +void Match(const std::string& original, ir::IRContext* context, + bool do_validation = true) { + std::vector bin; + context->module()->ToBinary(&bin, true); + if (do_validation) { + EXPECT_TRUE(Validate(bin)); + } + std::string assembly; + SpirvTools tools(SPV_ENV_UNIVERSAL_1_2); + EXPECT_TRUE( + tools.Disassemble(bin, &assembly, SpirvTools::kDefaultDisassembleOption)) + << "Disassembling failed for shader:\n" + << assembly << std::endl; + auto match_result = effcee::Match(assembly, original); + EXPECT_EQ(effcee::Result::Status::Ok, match_result.status()) + << match_result.message() << "\nChecking result:\n" + << assembly; +} + +TEST_F(IRBuilderTest, TestInsnAddition) { + const std::string text = R"( +; CHECK: %18 = OpLabel +; CHECK: OpPhi %int %int_0 %14 +; CHECK: OpPhi %bool %16 %14 +; CHECK: OpBranch %17 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 330 + OpName %2 "main" + OpName %4 "i" + OpName %3 "c" + OpDecorate %3 Location 0 + %5 = OpTypeVoid + %6 = OpTypeFunction %5 + %7 = OpTypeInt 32 1 + %8 = OpTypePointer Function %7 + %9 = OpConstant %7 0 + %10 = OpTypeBool + %11 = OpTypeFloat 32 + %12 = OpTypeVector %11 4 + %13 = OpTypePointer Output %12 + %3 = OpVariable %13 Output + %2 = OpFunction %5 None %6 + %14 = OpLabel + %4 = OpVariable %8 Function + OpStore %4 %9 + %15 = OpLoad %7 %4 + %16 = OpINotEqual %10 %15 %9 + OpSelectionMerge %17 None + OpBranchConditional %16 %18 %17 + %18 = OpLabel + OpBranch %17 + %17 = OpLabel + OpReturn + OpFunctionEnd +)"; + + { + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + + ir::BasicBlock* bb = context->cfg()->block(18); + + // Build managers. + context->get_def_use_mgr(); + context->get_instr_block(nullptr); + + opt::InstructionBuilder builder(context.get(), &*bb->begin()); + ir::Instruction* phi1 = builder.AddPhi(7, {9, 14}); + ir::Instruction* phi2 = builder.AddPhi(10, {16, 14}); + + // Make sure the InstructionBuilder did not update the def/use manager. + EXPECT_EQ(context->get_def_use_mgr()->GetDef(phi1->result_id()), nullptr); + EXPECT_EQ(context->get_def_use_mgr()->GetDef(phi2->result_id()), nullptr); + EXPECT_EQ(context->get_instr_block(phi1), nullptr); + EXPECT_EQ(context->get_instr_block(phi2), nullptr); + + Match(text, context.get()); + } + + { + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + + // Build managers. + context->get_def_use_mgr(); + context->get_instr_block(nullptr); + + ir::BasicBlock* bb = context->cfg()->block(18); + opt::InstructionBuilder builder( + context.get(), &*bb->begin(), + ir::IRContext::kAnalysisDefUse | + ir::IRContext::kAnalysisInstrToBlockMapping); + ir::Instruction* phi1 = builder.AddPhi(7, {9, 14}); + ir::Instruction* phi2 = builder.AddPhi(10, {16, 14}); + + // Make sure InstructionBuilder updated the def/use manager + EXPECT_NE(context->get_def_use_mgr()->GetDef(phi1->result_id()), nullptr); + EXPECT_NE(context->get_def_use_mgr()->GetDef(phi2->result_id()), nullptr); + EXPECT_NE(context->get_instr_block(phi1), nullptr); + EXPECT_NE(context->get_instr_block(phi2), nullptr); + + Match(text, context.get()); + } +} + +TEST_F(IRBuilderTest, TestCondBranchAddition) { + const std::string text = R"( +; CHECK: %main = OpFunction %void None %6 +; CHECK-NEXT: %15 = OpLabel +; CHECK-NEXT: OpSelectionMerge %13 None +; CHECK-NEXT: OpBranchConditional %true %14 %13 +; CHECK-NEXT: %14 = OpLabel +; CHECK-NEXT: OpBranch %13 +; CHECK-NEXT: %13 = OpLabel +; CHECK-NEXT: OpReturn + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 330 + OpName %2 "main" + OpName %4 "i" + OpName %3 "c" + OpDecorate %3 Location 0 + %5 = OpTypeVoid + %6 = OpTypeFunction %5 + %7 = OpTypeBool + %8 = OpTypePointer Function %7 + %9 = OpConstantTrue %7 + %10 = OpTypeFloat 32 + %11 = OpTypeVector %10 4 + %12 = OpTypePointer Output %11 + %3 = OpVariable %12 Output + %4 = OpVariable %8 Private + %2 = OpFunction %5 None %6 + %13 = OpLabel + OpReturn + OpFunctionEnd +)"; + + { + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + + ir::Function& fn = *context->module()->begin(); + + ir::BasicBlock& bb_merge = *fn.begin(); + + fn.begin().InsertBefore(std::unique_ptr( + new ir::BasicBlock(std::unique_ptr(new ir::Instruction( + context.get(), SpvOpLabel, 0, context->TakeNextId(), {}))))); + ir::BasicBlock& bb_true = *fn.begin(); + { + opt::InstructionBuilder builder(context.get(), &*bb_true.begin()); + builder.AddBranch(bb_merge.id()); + } + + fn.begin().InsertBefore(std::unique_ptr( + new ir::BasicBlock(std::unique_ptr(new ir::Instruction( + context.get(), SpvOpLabel, 0, context->TakeNextId(), {}))))); + ir::BasicBlock& bb_cond = *fn.begin(); + + opt::InstructionBuilder builder(context.get(), &bb_cond); + // This also test consecutive instruction insertion: merge selection + + // branch. + builder.AddConditionalBranch(9, bb_true.id(), bb_merge.id(), bb_merge.id()); + + Match(text, context.get()); + } +} + +TEST_F(IRBuilderTest, AddSelect) { + const std::string text = R"( +; CHECK: [[bool:%\w+]] = OpTypeBool +; CHECK: [[uint:%\w+]] = OpTypeInt 32 0 +; CHECK: [[true:%\w+]] = OpConstantTrue [[bool]] +; CHECK: [[u0:%\w+]] = OpConstant [[uint]] 0 +; CHECK: [[u1:%\w+]] = OpConstant [[uint]] 1 +; CHECK: OpSelect [[uint]] [[true]] [[u0]] [[u1]] +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +%1 = OpTypeVoid +%2 = OpTypeBool +%3 = OpTypeInt 32 0 +%4 = OpConstantTrue %2 +%5 = OpConstant %3 0 +%6 = OpConstant %3 1 +%7 = OpTypeFunction %1 +%8 = OpFunction %1 None %7 +%9 = OpLabel +OpReturn +OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + EXPECT_NE(nullptr, context); + + opt::InstructionBuilder builder( + context.get(), &*context->module()->begin()->begin()->begin()); + EXPECT_NE(nullptr, builder.AddSelect(3u, 4u, 5u, 6u)); + + Match(text, context.get()); +} + +TEST_F(IRBuilderTest, AddCompositeConstruct) { + const std::string text = R"( +; CHECK: [[uint:%\w+]] = OpTypeInt +; CHECK: [[u0:%\w+]] = OpConstant [[uint]] 0 +; CHECK: [[u1:%\w+]] = OpConstant [[uint]] 1 +; CHECK: [[struct:%\w+]] = OpTypeStruct [[uint]] [[uint]] [[uint]] [[uint]] +; CHECK: OpCompositeConstruct [[struct]] [[u0]] [[u1]] [[u1]] [[u0]] +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpConstant %2 0 +%4 = OpConstant %2 1 +%5 = OpTypeStruct %2 %2 %2 %2 +%6 = OpTypeFunction %1 +%7 = OpFunction %1 None %6 +%8 = OpLabel +OpReturn +OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + EXPECT_NE(nullptr, context); + + opt::InstructionBuilder builder( + context.get(), &*context->module()->begin()->begin()->begin()); + std::vector ids = {3u, 4u, 4u, 3u}; + EXPECT_NE(nullptr, builder.AddCompositeConstruct(5u, ids)); + + Match(text, context.get()); +} + +TEST_F(IRBuilderTest, ConstantAdder) { + const std::string text = R"( +; CHECK: [[uint:%\w+]] = OpTypeInt 32 0 +; CHECK: OpConstant [[uint]] 13 +; CHECK: [[sint:%\w+]] = OpTypeInt 32 1 +; CHECK: OpConstant [[sint]] -1 +; CHECK: OpConstant [[uint]] 1 +; CHECK: OpConstant [[sint]] 34 +; CHECK: OpConstant [[uint]] 0 +; CHECK: OpConstant [[sint]] 0 +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpFunction %1 None %2 +%4 = OpLabel +OpReturn +OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + EXPECT_NE(nullptr, context); + + opt::InstructionBuilder builder( + context.get(), &*context->module()->begin()->begin()->begin()); + EXPECT_NE(nullptr, builder.Add32BitUnsignedIntegerConstant(13)); + EXPECT_NE(nullptr, builder.Add32BitSignedIntegerConstant(-1)); + + // Try adding the same constants again to make sure they aren't added. + EXPECT_NE(nullptr, builder.Add32BitUnsignedIntegerConstant(13)); + EXPECT_NE(nullptr, builder.Add32BitSignedIntegerConstant(-1)); + + // Try adding different constants to make sure the type is reused. + EXPECT_NE(nullptr, builder.Add32BitUnsignedIntegerConstant(1)); + EXPECT_NE(nullptr, builder.Add32BitSignedIntegerConstant(34)); + + // Try adding 0 as both signed and unsigned. + EXPECT_NE(nullptr, builder.Add32BitUnsignedIntegerConstant(0)); + EXPECT_NE(nullptr, builder.Add32BitSignedIntegerConstant(0)); + + Match(text, context.get()); +} + +TEST_F(IRBuilderTest, ConstantAdderTypeAlreadyExists) { + const std::string text = R"( +; CHECK: OpConstant %uint 13 +; CHECK: OpConstant %int -1 +; CHECK: OpConstant %uint 1 +; CHECK: OpConstant %int 34 +; CHECK: OpConstant %uint 0 +; CHECK: OpConstant %int 0 +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%1 = OpTypeVoid +%uint = OpTypeInt 32 0 +%int = OpTypeInt 32 1 +%4 = OpTypeFunction %1 +%5 = OpFunction %1 None %4 +%6 = OpLabel +OpReturn +OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + EXPECT_NE(nullptr, context); + + opt::InstructionBuilder builder( + context.get(), &*context->module()->begin()->begin()->begin()); + ir::Instruction* const_1 = builder.Add32BitUnsignedIntegerConstant(13); + ir::Instruction* const_2 = builder.Add32BitSignedIntegerConstant(-1); + + EXPECT_NE(nullptr, const_1); + EXPECT_NE(nullptr, const_2); + + // Try adding the same constants again to make sure they aren't added. + EXPECT_EQ(const_1, builder.Add32BitUnsignedIntegerConstant(13)); + EXPECT_EQ(const_2, builder.Add32BitSignedIntegerConstant(-1)); + + ir::Instruction* const_3 = builder.Add32BitUnsignedIntegerConstant(1); + ir::Instruction* const_4 = builder.Add32BitSignedIntegerConstant(34); + + // Try adding different constants to make sure the type is reused. + EXPECT_NE(nullptr, const_3); + EXPECT_NE(nullptr, const_4); + + ir::Instruction* const_5 = builder.Add32BitUnsignedIntegerConstant(0); + ir::Instruction* const_6 = builder.Add32BitSignedIntegerConstant(0); + + // Try adding 0 as both signed and unsigned. + EXPECT_NE(nullptr, const_5); + EXPECT_NE(nullptr, const_6); + + // They have the same value but different types so should be unique. + EXPECT_NE(const_5, const_6); + + // Check the types are correct. + uint32_t type_id_unsigned = const_1->GetSingleWordOperand(0); + uint32_t type_id_signed = const_2->GetSingleWordOperand(0); + + EXPECT_NE(type_id_unsigned, type_id_signed); + + EXPECT_EQ(const_3->GetSingleWordOperand(0), type_id_unsigned); + EXPECT_EQ(const_5->GetSingleWordOperand(0), type_id_unsigned); + + EXPECT_EQ(const_4->GetSingleWordOperand(0), type_id_signed); + EXPECT_EQ(const_6->GetSingleWordOperand(0), type_id_signed); + + Match(text, context.get()); +} + +#endif // SPIRV_EFFCEE + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/ir_context_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/ir_context_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/ir_context_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/ir_context_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,215 @@ +// Copyright (c) 2017 Google 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. + +#include +#include +#include + +#include "opt/ir_context.h" +#include "opt/pass.h" +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; +using ir::IRContext; +using Analysis = IRContext::Analysis; +using ::testing::Each; + +class DummyPassPreservesNothing : public opt::Pass { + public: + DummyPassPreservesNothing(Status s) : opt::Pass(), status_to_return_(s) {} + const char* name() const override { return "dummy-pass"; } + Status Process(IRContext*) override { return status_to_return_; } + Status status_to_return_; +}; + +class DummyPassPreservesAll : public opt::Pass { + public: + DummyPassPreservesAll(Status s) : opt::Pass(), status_to_return_(s) {} + const char* name() const override { return "dummy-pass"; } + Status Process(IRContext*) override { return status_to_return_; } + Status status_to_return_; + virtual Analysis GetPreservedAnalyses() override { + return Analysis(IRContext::kAnalysisEnd - 1); + } +}; + +class DummyPassPreservesFirst : public opt::Pass { + public: + DummyPassPreservesFirst(Status s) : opt::Pass(), status_to_return_(s) {} + const char* name() const override { return "dummy-pass"; } + Status Process(IRContext*) override { return status_to_return_; } + Status status_to_return_; + virtual Analysis GetPreservedAnalyses() override { + return IRContext::kAnalysisBegin; + } +}; + +using IRContextTest = PassTest<::testing::Test>; + +TEST_F(IRContextTest, IndividualValidAfterBuild) { + std::unique_ptr module(new ir::Module()); + IRContext localContext(SPV_ENV_UNIVERSAL_1_2, std::move(module), + spvtools::MessageConsumer()); + + for (Analysis i = IRContext::kAnalysisBegin; i < IRContext::kAnalysisEnd; + i <<= 1) { + localContext.BuildInvalidAnalyses(i); + EXPECT_TRUE(localContext.AreAnalysesValid(i)); + } +} + +TEST_F(IRContextTest, AllValidAfterBuild) { + std::unique_ptr module = MakeUnique(); + IRContext localContext(SPV_ENV_UNIVERSAL_1_2, std::move(module), + spvtools::MessageConsumer()); + + Analysis built_analyses = IRContext::kAnalysisNone; + for (Analysis i = IRContext::kAnalysisBegin; i < IRContext::kAnalysisEnd; + i <<= 1) { + localContext.BuildInvalidAnalyses(i); + built_analyses |= i; + } + EXPECT_TRUE(localContext.AreAnalysesValid(built_analyses)); +} + +TEST_F(IRContextTest, AllValidAfterPassNoChange) { + std::unique_ptr module = MakeUnique(); + IRContext localContext(SPV_ENV_UNIVERSAL_1_2, std::move(module), + spvtools::MessageConsumer()); + + Analysis built_analyses = IRContext::kAnalysisNone; + for (Analysis i = IRContext::kAnalysisBegin; i < IRContext::kAnalysisEnd; + i <<= 1) { + localContext.BuildInvalidAnalyses(i); + built_analyses |= i; + } + + DummyPassPreservesNothing pass(opt::Pass::Status::SuccessWithoutChange); + opt::Pass::Status s = pass.Run(&localContext); + EXPECT_EQ(s, opt::Pass::Status::SuccessWithoutChange); + EXPECT_TRUE(localContext.AreAnalysesValid(built_analyses)); +} + +TEST_F(IRContextTest, NoneValidAfterPassWithChange) { + std::unique_ptr module = MakeUnique(); + IRContext localContext(SPV_ENV_UNIVERSAL_1_2, std::move(module), + spvtools::MessageConsumer()); + + for (Analysis i = IRContext::kAnalysisBegin; i < IRContext::kAnalysisEnd; + i <<= 1) { + localContext.BuildInvalidAnalyses(i); + } + + DummyPassPreservesNothing pass(opt::Pass::Status::SuccessWithChange); + opt::Pass::Status s = pass.Run(&localContext); + EXPECT_EQ(s, opt::Pass::Status::SuccessWithChange); + for (Analysis i = IRContext::kAnalysisBegin; i < IRContext::kAnalysisEnd; + i <<= 1) { + EXPECT_FALSE(localContext.AreAnalysesValid(i)); + } +} + +TEST_F(IRContextTest, AllPreservedAfterPassWithChange) { + std::unique_ptr module = MakeUnique(); + IRContext localContext(SPV_ENV_UNIVERSAL_1_2, std::move(module), + spvtools::MessageConsumer()); + + for (Analysis i = IRContext::kAnalysisBegin; i < IRContext::kAnalysisEnd; + i <<= 1) { + localContext.BuildInvalidAnalyses(i); + } + + DummyPassPreservesAll pass(opt::Pass::Status::SuccessWithChange); + opt::Pass::Status s = pass.Run(&localContext); + EXPECT_EQ(s, opt::Pass::Status::SuccessWithChange); + for (Analysis i = IRContext::kAnalysisBegin; i < IRContext::kAnalysisEnd; + i <<= 1) { + EXPECT_TRUE(localContext.AreAnalysesValid(i)); + } +} + +TEST_F(IRContextTest, PreserveFirstOnlyAfterPassWithChange) { + std::unique_ptr module = MakeUnique(); + IRContext localContext(SPV_ENV_UNIVERSAL_1_2, std::move(module), + spvtools::MessageConsumer()); + + for (Analysis i = IRContext::kAnalysisBegin; i < IRContext::kAnalysisEnd; + i <<= 1) { + localContext.BuildInvalidAnalyses(i); + } + + DummyPassPreservesFirst pass(opt::Pass::Status::SuccessWithChange); + opt::Pass::Status s = pass.Run(&localContext); + EXPECT_EQ(s, opt::Pass::Status::SuccessWithChange); + EXPECT_TRUE(localContext.AreAnalysesValid(IRContext::kAnalysisBegin)); + for (Analysis i = IRContext::kAnalysisBegin << 1; i < IRContext::kAnalysisEnd; + i <<= 1) { + EXPECT_FALSE(localContext.AreAnalysesValid(i)); + } +} + +TEST_F(IRContextTest, KillMemberName) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + OpName %3 "stuff" + OpMemberName %3 0 "refZ" + OpMemberDecorate %3 0 Offset 0 + OpDecorate %3 Block + %4 = OpTypeFloat 32 + %3 = OpTypeStruct %4 + %5 = OpTypeVoid + %6 = OpTypeFunction %5 + %2 = OpFunction %5 None %6 + %7 = OpLabel + OpReturn + OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + + // Build the decoration manager. + context->get_decoration_mgr(); + + // Delete the OpTypeStruct. Should delete the OpName, OpMemberName, and + // OpMemberDecorate associated with it. + context->KillDef(3); + + // Make sure all of the name are removed. + for (auto& inst : context->debugs2()) { + EXPECT_EQ(inst.opcode(), SpvOpNop); + } + + // Make sure all of the decorations are removed. + for (auto& inst : context->annotations()) { + EXPECT_EQ(inst.opcode(), SpvOpNop); + } +} + +TEST_F(IRContextTest, TakeNextUniqueIdIncrementing) { + const uint32_t NUM_TESTS = 1000; + IRContext localContext(SPV_ENV_UNIVERSAL_1_2, nullptr); + for (uint32_t i = 1; i < NUM_TESTS; ++i) + EXPECT_EQ(i, localContext.TakeNextUniqueId()); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/ir_loader_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/ir_loader_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/ir_loader_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/ir_loader_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,449 @@ +// Copyright (c) 2016 Google 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. + +#include +#include +#include + +#include "message.h" +#include "opt/build_module.h" +#include "opt/ir_context.h" +#include "spirv-tools/libspirv.hpp" + +namespace { + +using namespace spvtools; + +void DoRoundTripCheck(const std::string& text) { + SpirvTools t(SPV_ENV_UNIVERSAL_1_1); + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text); + ASSERT_NE(nullptr, context) << "Failed to assemble\n" << text; + + std::vector binary; + context->module()->ToBinary(&binary, /* skip_nop = */ false); + + std::string disassembled_text; + EXPECT_TRUE(t.Disassemble(binary, &disassembled_text)); + EXPECT_EQ(text, disassembled_text); +} + +TEST(IrBuilder, RoundTrip) { + // #version 310 es + // int add(int a, int b) { return a + b; } + // void main() { add(1, 2); } + DoRoundTripCheck( + // clang-format off + "OpCapability Shader\n" + "%1 = OpExtInstImport \"GLSL.std.450\"\n" + "OpMemoryModel Logical GLSL450\n" + "OpEntryPoint Vertex %main \"main\"\n" + "OpSource ESSL 310\n" + "OpSourceExtension \"GL_GOOGLE_cpp_style_line_directive\"\n" + "OpSourceExtension \"GL_GOOGLE_include_directive\"\n" + "OpName %main \"main\"\n" + "OpName %add_i1_i1_ \"add(i1;i1;\"\n" + "OpName %a \"a\"\n" + "OpName %b \"b\"\n" + "OpName %param \"param\"\n" + "OpName %param_0 \"param\"\n" + "%void = OpTypeVoid\n" + "%9 = OpTypeFunction %void\n" + "%int = OpTypeInt 32 1\n" + "%_ptr_Function_int = OpTypePointer Function %int\n" + "%12 = OpTypeFunction %int %_ptr_Function_int %_ptr_Function_int\n" + "%int_1 = OpConstant %int 1\n" + "%int_2 = OpConstant %int 2\n" + "%main = OpFunction %void None %9\n" + "%15 = OpLabel\n" + "%param = OpVariable %_ptr_Function_int Function\n" + "%param_0 = OpVariable %_ptr_Function_int Function\n" + "OpStore %param %int_1\n" + "OpStore %param_0 %int_2\n" + "%16 = OpFunctionCall %int %add_i1_i1_ %param %param_0\n" + "OpReturn\n" + "OpFunctionEnd\n" + "%add_i1_i1_ = OpFunction %int None %12\n" + "%a = OpFunctionParameter %_ptr_Function_int\n" + "%b = OpFunctionParameter %_ptr_Function_int\n" + "%17 = OpLabel\n" + "%18 = OpLoad %int %a\n" + "%19 = OpLoad %int %b\n" + "%20 = OpIAdd %int %18 %19\n" + "OpReturnValue %20\n" + "OpFunctionEnd\n"); + // clang-format on +} + +TEST(IrBuilder, RoundTripIncompleteBasicBlock) { + DoRoundTripCheck( + "%2 = OpFunction %1 None %3\n" + "%4 = OpLabel\n" + "OpNop\n"); +} + +TEST(IrBuilder, RoundTripIncompleteFunction) { + DoRoundTripCheck("%2 = OpFunction %1 None %3\n"); +} + +TEST(IrBuilder, KeepLineDebugInfo) { + // #version 310 es + // void main() {} + DoRoundTripCheck( + // clang-format off + "OpCapability Shader\n" + "%1 = OpExtInstImport \"GLSL.std.450\"\n" + "OpMemoryModel Logical GLSL450\n" + "OpEntryPoint Vertex %main \"main\"\n" + "%3 = OpString \"minimal.vert\"\n" + "OpSource ESSL 310\n" + "OpName %main \"main\"\n" + "OpLine %3 10 10\n" + "%void = OpTypeVoid\n" + "OpLine %3 100 100\n" + "%5 = OpTypeFunction %void\n" + "%main = OpFunction %void None %5\n" + "OpLine %3 1 1\n" + "OpNoLine\n" + "OpLine %3 2 2\n" + "OpLine %3 3 3\n" + "%6 = OpLabel\n" + "OpLine %3 4 4\n" + "OpNoLine\n" + "OpReturn\n" + "OpFunctionEnd\n"); + // clang-format on +} + +TEST(IrBuilder, LocalGlobalVariables) { + // #version 310 es + // + // float gv1 = 10.; + // float gv2 = 100.; + // + // float f() { + // float lv1 = gv1 + gv2; + // float lv2 = gv1 * gv2; + // return lv1 / lv2; + // } + // + // void main() { + // float lv1 = gv1 - gv2; + // } + DoRoundTripCheck( + // clang-format off + "OpCapability Shader\n" + "%1 = OpExtInstImport \"GLSL.std.450\"\n" + "OpMemoryModel Logical GLSL450\n" + "OpEntryPoint Vertex %main \"main\"\n" + "OpSource ESSL 310\n" + "OpName %main \"main\"\n" + "OpName %f_ \"f(\"\n" + "OpName %gv1 \"gv1\"\n" + "OpName %gv2 \"gv2\"\n" + "OpName %lv1 \"lv1\"\n" + "OpName %lv2 \"lv2\"\n" + "OpName %lv1_0 \"lv1\"\n" + "%void = OpTypeVoid\n" + "%10 = OpTypeFunction %void\n" + "%float = OpTypeFloat 32\n" + "%12 = OpTypeFunction %float\n" + "%_ptr_Private_float = OpTypePointer Private %float\n" + "%gv1 = OpVariable %_ptr_Private_float Private\n" + "%float_10 = OpConstant %float 10\n" + "%gv2 = OpVariable %_ptr_Private_float Private\n" + "%float_100 = OpConstant %float 100\n" + "%_ptr_Function_float = OpTypePointer Function %float\n" + "%main = OpFunction %void None %10\n" + "%17 = OpLabel\n" + "%lv1_0 = OpVariable %_ptr_Function_float Function\n" + "OpStore %gv1 %float_10\n" + "OpStore %gv2 %float_100\n" + "%18 = OpLoad %float %gv1\n" + "%19 = OpLoad %float %gv2\n" + "%20 = OpFSub %float %18 %19\n" + "OpStore %lv1_0 %20\n" + "OpReturn\n" + "OpFunctionEnd\n" + "%f_ = OpFunction %float None %12\n" + "%21 = OpLabel\n" + "%lv1 = OpVariable %_ptr_Function_float Function\n" + "%lv2 = OpVariable %_ptr_Function_float Function\n" + "%22 = OpLoad %float %gv1\n" + "%23 = OpLoad %float %gv2\n" + "%24 = OpFAdd %float %22 %23\n" + "OpStore %lv1 %24\n" + "%25 = OpLoad %float %gv1\n" + "%26 = OpLoad %float %gv2\n" + "%27 = OpFMul %float %25 %26\n" + "OpStore %lv2 %27\n" + "%28 = OpLoad %float %lv1\n" + "%29 = OpLoad %float %lv2\n" + "%30 = OpFDiv %float %28 %29\n" + "OpReturnValue %30\n" + "OpFunctionEnd\n"); + // clang-format on +} + +TEST(IrBuilder, OpUndefOutsideFunction) { + // #version 310 es + // void main() {} + const std::string text = + // clang-format off + "OpMemoryModel Logical GLSL450\n" + "%int = OpTypeInt 32 1\n" + "%uint = OpTypeInt 32 0\n" + "%float = OpTypeFloat 32\n" + "%4 = OpUndef %int\n" + "%int_10 = OpConstant %int 10\n" + "%6 = OpUndef %uint\n" + "%bool = OpTypeBool\n" + "%8 = OpUndef %float\n" + "%double = OpTypeFloat 64\n"; + // clang-format on + + SpirvTools t(SPV_ENV_UNIVERSAL_1_1); + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text); + ASSERT_NE(nullptr, context); + + const auto opundef_count = std::count_if( + context->module()->types_values_begin(), + context->module()->types_values_end(), + [](const ir::Instruction& inst) { return inst.opcode() == SpvOpUndef; }); + EXPECT_EQ(3, opundef_count); + + std::vector binary; + context->module()->ToBinary(&binary, /* skip_nop = */ false); + + std::string disassembled_text; + EXPECT_TRUE(t.Disassemble(binary, &disassembled_text)); + EXPECT_EQ(text, disassembled_text); +} + +TEST(IrBuilder, OpUndefInBasicBlock) { + DoRoundTripCheck( + // clang-format off + "OpMemoryModel Logical GLSL450\n" + "OpName %main \"main\"\n" + "%void = OpTypeVoid\n" + "%uint = OpTypeInt 32 0\n" + "%double = OpTypeFloat 64\n" + "%5 = OpTypeFunction %void\n" + "%main = OpFunction %void None %5\n" + "%6 = OpLabel\n" + "%7 = OpUndef %uint\n" + "%8 = OpUndef %double\n" + "OpReturn\n" + "OpFunctionEnd\n"); + // clang-format on +} + +TEST(IrBuilder, KeepLineDebugInfoBeforeType) { + DoRoundTripCheck( + // clang-format off + "OpCapability Shader\n" + "OpMemoryModel Logical GLSL450\n" + "%1 = OpString \"minimal.vert\"\n" + "OpLine %1 1 1\n" + "OpNoLine\n" + "%void = OpTypeVoid\n" + "OpLine %1 2 2\n" + "%3 = OpTypeFunction %void\n"); + // clang-format on +} + +TEST(IrBuilder, KeepLineDebugInfoBeforeLabel) { + DoRoundTripCheck( + // clang-format off + "OpCapability Shader\n" + "OpMemoryModel Logical GLSL450\n" + "%1 = OpString \"minimal.vert\"\n" + "%void = OpTypeVoid\n" + "%3 = OpTypeFunction %void\n" + "%4 = OpFunction %void None %3\n" + "%5 = OpLabel\n" + "OpBranch %6\n" + "OpLine %1 1 1\n" + "OpLine %1 2 2\n" + "%6 = OpLabel\n" + "OpBranch %7\n" + "OpLine %1 100 100\n" + "%7 = OpLabel\n" + "OpReturn\n" + "OpFunctionEnd\n"); + // clang-format on +} + +TEST(IrBuilder, KeepLineDebugInfoBeforeFunctionEnd) { + DoRoundTripCheck( + // clang-format off + "OpCapability Shader\n" + "OpMemoryModel Logical GLSL450\n" + "%1 = OpString \"minimal.vert\"\n" + "%void = OpTypeVoid\n" + "%3 = OpTypeFunction %void\n" + "%4 = OpFunction %void None %3\n" + "OpLine %1 1 1\n" + "OpLine %1 2 2\n" + "OpFunctionEnd\n"); + // clang-format on +} + +TEST(IrBuilder, KeepModuleProcessedInRightPlace) { + DoRoundTripCheck( + // clang-format off + "OpCapability Shader\n" + "OpMemoryModel Logical GLSL450\n" + "%1 = OpString \"minimal.vert\"\n" + "OpName %void \"void\"\n" + "OpModuleProcessed \"Made it faster\"\n" + "OpModuleProcessed \".. and smaller\"\n" + "%void = OpTypeVoid\n"); + // clang-format on +} + +// Checks the given |error_message| is reported when trying to build a module +// from the given |assembly|. +void DoErrorMessageCheck(const std::string& assembly, + const std::string& error_message) { + auto consumer = [error_message](spv_message_level_t level, const char* source, + const spv_position_t& position, + const char* m) { + EXPECT_EQ(error_message, StringifyMessage(level, source, position, m)); + }; + + SpirvTools t(SPV_ENV_UNIVERSAL_1_1); + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, std::move(consumer), assembly); + EXPECT_EQ(nullptr, context); +} + +TEST(IrBuilder, FunctionInsideFunction) { + DoErrorMessageCheck("%2 = OpFunction %1 None %3\n%5 = OpFunction %4 None %6", + "error: :2:0:0: function inside function"); +} + +TEST(IrBuilder, MismatchOpFunctionEnd) { + DoErrorMessageCheck("OpFunctionEnd", + "error: :1:0:0: OpFunctionEnd without " + "corresponding OpFunction"); +} + +TEST(IrBuilder, OpFunctionEndInsideBasicBlock) { + DoErrorMessageCheck( + "%2 = OpFunction %1 None %3\n" + "%4 = OpLabel\n" + "OpFunctionEnd", + "error: :3:0:0: OpFunctionEnd inside basic block"); +} + +TEST(IrBuilder, BasicBlockOutsideFunction) { + DoErrorMessageCheck("OpCapability Shader\n%1 = OpLabel", + "error: :2:0:0: OpLabel outside function"); +} + +TEST(IrBuilder, OpLabelInsideBasicBlock) { + DoErrorMessageCheck( + "%2 = OpFunction %1 None %3\n" + "%4 = OpLabel\n" + "%5 = OpLabel", + "error: :3:0:0: OpLabel inside basic block"); +} + +TEST(IrBuilder, TerminatorOutsideFunction) { + DoErrorMessageCheck( + "OpReturn", + "error: :1:0:0: terminator instruction outside function"); +} + +TEST(IrBuilder, TerminatorOutsideBasicBlock) { + DoErrorMessageCheck("%2 = OpFunction %1 None %3\nOpReturn", + "error: :2:0:0: terminator instruction " + "outside basic block"); +} + +TEST(IrBuilder, NotAllowedInstAppearingInFunction) { + DoErrorMessageCheck("%2 = OpFunction %1 None %3\n%5 = OpVariable %4 Function", + "error: :2:0:0: Non-OpFunctionParameter " + "(opcode: 59) found inside function but outside basic " + "block"); +} + +TEST(IrBuilder, UniqueIds) { + const std::string text = + // clang-format off + "OpCapability Shader\n" + "%1 = OpExtInstImport \"GLSL.std.450\"\n" + "OpMemoryModel Logical GLSL450\n" + "OpEntryPoint Vertex %main \"main\"\n" + "OpSource ESSL 310\n" + "OpName %main \"main\"\n" + "OpName %f_ \"f(\"\n" + "OpName %gv1 \"gv1\"\n" + "OpName %gv2 \"gv2\"\n" + "OpName %lv1 \"lv1\"\n" + "OpName %lv2 \"lv2\"\n" + "OpName %lv1_0 \"lv1\"\n" + "%void = OpTypeVoid\n" + "%10 = OpTypeFunction %void\n" + "%float = OpTypeFloat 32\n" + "%12 = OpTypeFunction %float\n" + "%_ptr_Private_float = OpTypePointer Private %float\n" + "%gv1 = OpVariable %_ptr_Private_float Private\n" + "%float_10 = OpConstant %float 10\n" + "%gv2 = OpVariable %_ptr_Private_float Private\n" + "%float_100 = OpConstant %float 100\n" + "%_ptr_Function_float = OpTypePointer Function %float\n" + "%main = OpFunction %void None %10\n" + "%17 = OpLabel\n" + "%lv1_0 = OpVariable %_ptr_Function_float Function\n" + "OpStore %gv1 %float_10\n" + "OpStore %gv2 %float_100\n" + "%18 = OpLoad %float %gv1\n" + "%19 = OpLoad %float %gv2\n" + "%20 = OpFSub %float %18 %19\n" + "OpStore %lv1_0 %20\n" + "OpReturn\n" + "OpFunctionEnd\n" + "%f_ = OpFunction %float None %12\n" + "%21 = OpLabel\n" + "%lv1 = OpVariable %_ptr_Function_float Function\n" + "%lv2 = OpVariable %_ptr_Function_float Function\n" + "%22 = OpLoad %float %gv1\n" + "%23 = OpLoad %float %gv2\n" + "%24 = OpFAdd %float %22 %23\n" + "OpStore %lv1 %24\n" + "%25 = OpLoad %float %gv1\n" + "%26 = OpLoad %float %gv2\n" + "%27 = OpFMul %float %25 %26\n" + "OpStore %lv2 %27\n" + "%28 = OpLoad %float %lv1\n" + "%29 = OpLoad %float %lv2\n" + "%30 = OpFDiv %float %28 %29\n" + "OpReturnValue %30\n" + "OpFunctionEnd\n"; + // clang-format on + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text); + ASSERT_NE(nullptr, context); + + std::unordered_set ids; + context->module()->ForEachInst([&ids](const ir::Instruction* inst) { + EXPECT_TRUE(ids.insert(inst->unique_id()).second); + }); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/iterator_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/iterator_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/iterator_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/iterator_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,217 @@ +// Copyright (c) 2016 Google 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. + +#include +#include + +#include "gmock/gmock.h" + +#include "opt/iterator.h" +#include "opt/make_unique.h" + +namespace { + +using namespace spvtools; +using ::testing::ContainerEq; + +TEST(Iterator, IncrementDeref) { + const int count = 100; + std::vector> data; + for (int i = 0; i < count; ++i) { + data.emplace_back(new int(i)); + } + + ir::UptrVectorIterator it(&data, data.begin()); + ir::UptrVectorIterator end(&data, data.end()); + + EXPECT_EQ(*data[0], *it); + for (int i = 1; i < count; ++i) { + EXPECT_NE(end, it); + EXPECT_EQ(*data[i], *(++it)); + } + EXPECT_EQ(end, ++it); +} + +TEST(Iterator, DecrementDeref) { + const int count = 100; + std::vector> data; + for (int i = 0; i < count; ++i) { + data.emplace_back(new int(i)); + } + + ir::UptrVectorIterator begin(&data, data.begin()); + ir::UptrVectorIterator it(&data, data.end()); + + for (int i = count - 1; i >= 0; --i) { + EXPECT_NE(begin, it); + EXPECT_EQ(*data[i], *(--it)); + } + EXPECT_EQ(begin, it); +} + +TEST(Iterator, PostIncrementDeref) { + const int count = 100; + std::vector> data; + for (int i = 0; i < count; ++i) { + data.emplace_back(new int(i)); + } + + ir::UptrVectorIterator it(&data, data.begin()); + ir::UptrVectorIterator end(&data, data.end()); + + for (int i = 0; i < count; ++i) { + EXPECT_NE(end, it); + EXPECT_EQ(*data[i], *(it++)); + } + EXPECT_EQ(end, it); +} + +TEST(Iterator, PostDecrementDeref) { + const int count = 100; + std::vector> data; + for (int i = 0; i < count; ++i) { + data.emplace_back(new int(i)); + } + + ir::UptrVectorIterator begin(&data, data.begin()); + ir::UptrVectorIterator end(&data, data.end()); + ir::UptrVectorIterator it(&data, data.end()); + + EXPECT_EQ(end, it--); + for (int i = count - 1; i >= 1; --i) { + EXPECT_EQ(*data[i], *(it--)); + } + // Decrementing .begin() is undefined behavior. + EXPECT_EQ(*data[0], *it); +} + +TEST(Iterator, Access) { + const int count = 100; + std::vector> data; + for (int i = 0; i < count; ++i) { + data.emplace_back(new int(i)); + } + + ir::UptrVectorIterator it(&data, data.begin()); + + for (int i = 0; i < count; ++i) EXPECT_EQ(*data[i], it[i]); +} + +TEST(Iterator, Comparison) { + const int count = 100; + std::vector> data; + for (int i = 0; i < count; ++i) { + data.emplace_back(new int(i)); + } + + ir::UptrVectorIterator it(&data, data.begin()); + ir::UptrVectorIterator end(&data, data.end()); + + for (int i = 0; i < count; ++i, ++it) EXPECT_TRUE(it < end); + EXPECT_EQ(end, it); +} + +TEST(Iterator, InsertBeginEnd) { + const int count = 100; + + std::vector> data; + std::vector expected; + std::vector actual; + + for (int i = 0; i < count; ++i) { + data.emplace_back(new int(i)); + expected.push_back(i); + } + + // Insert at the beginning + expected.insert(expected.begin(), -100); + ir::UptrVectorIterator begin(&data, data.begin()); + auto insert_point = begin.InsertBefore(MakeUnique(-100)); + for (int i = 0; i < count + 1; ++i) { + actual.push_back(*(insert_point++)); + } + EXPECT_THAT(actual, ContainerEq(expected)); + + // Insert at the end + expected.push_back(-42); + expected.push_back(-36); + expected.push_back(-77); + ir::UptrVectorIterator end(&data, data.end()); + end = end.InsertBefore(MakeUnique(-77)); + end = end.InsertBefore(MakeUnique(-36)); + end = end.InsertBefore(MakeUnique(-42)); + + actual.clear(); + begin = ir::UptrVectorIterator(&data, data.begin()); + for (int i = 0; i < count + 4; ++i) { + actual.push_back(*(begin++)); + } + EXPECT_THAT(actual, ContainerEq(expected)); +} + +TEST(Iterator, InsertMiddle) { + const int count = 100; + + std::vector> data; + std::vector expected; + std::vector actual; + + for (int i = 0; i < count; ++i) { + data.emplace_back(new int(i)); + expected.push_back(i); + } + + const int insert_pos = 42; + expected.insert(expected.begin() + insert_pos, -100); + expected.insert(expected.begin() + insert_pos, -42); + + ir::UptrVectorIterator it(&data, data.begin()); + for (int i = 0; i < insert_pos; ++i) ++it; + it = it.InsertBefore(MakeUnique(-100)); + it = it.InsertBefore(MakeUnique(-42)); + auto begin = ir::UptrVectorIterator(&data, data.begin()); + for (int i = 0; i < count + 2; ++i) { + actual.push_back(*(begin++)); + } + EXPECT_THAT(actual, ContainerEq(expected)); +} + +TEST(IteratorRange, Interface) { + const uint32_t count = 100; + + std::vector> data; + + for (uint32_t i = 0; i < count; ++i) { + data.emplace_back(new uint32_t(i)); + } + + auto b = ir::UptrVectorIterator(&data, data.begin()); + auto e = ir::UptrVectorIterator(&data, data.end()); + auto range = ir::IteratorRange(b, e); + + EXPECT_EQ(b, range.begin()); + EXPECT_EQ(e, range.end()); + EXPECT_FALSE(range.empty()); + EXPECT_EQ(count, range.size()); + EXPECT_EQ(0u, *range.begin()); + EXPECT_EQ(99u, *(--range.end())); + + // IteratorRange itself is immutable. + ++b, --e; + EXPECT_EQ(count, range.size()); + ++range.begin(), --range.end(); + EXPECT_EQ(count, range.size()); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/line_debug_info_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/line_debug_info_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/line_debug_info_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/line_debug_info_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,111 @@ +// Copyright (c) 2016 Google 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. + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +// A pass turning all none debug line instructions into Nop. +class NopifyPass : public opt::Pass { + public: + const char* name() const override { return "NopifyPass"; } + Status Process(ir::IRContext* irContext) override { + bool modified = false; + irContext->module()->ForEachInst( + [&modified](ir::Instruction* inst) { + inst->ToNop(); + modified = true; + }, + /* run_on_debug_line_insts = */ false); + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; + } +}; + +using PassTestForLineDebugInfo = PassTest<::testing::Test>; + +// This test's purpose to show our implementation choice: line debug info is +// preserved even if the following instruction is killed. It serves as a guard +// of potential behavior changes. +TEST_F(PassTestForLineDebugInfo, KeepLineDebugInfo) { + // clang-format off + const char* text = + "OpCapability Shader " + "%1 = OpExtInstImport \"GLSL.std.450\" " + "OpMemoryModel Logical GLSL450 " + "OpEntryPoint Vertex %2 \"main\" " + "%3 = OpString \"minimal.vert\" " + "OpNoLine " + "OpLine %3 10 10 " + "%void = OpTypeVoid " + "OpLine %3 100 100 " + "%5 = OpTypeFunction %void " + "%2 = OpFunction %void None %5 " + "OpLine %3 1 1 " + "OpNoLine " + "OpLine %3 2 2 " + "OpLine %3 3 3 " + "%6 = OpLabel " + "OpLine %3 4 4 " + "OpNoLine " + "OpReturn " + "OpLine %3 4 4 " + "OpNoLine " + "OpFunctionEnd "; + // clang-format on + + const char* result_keep_nop = + "OpNop\n" + "OpNop\n" + "OpNop\n" + "OpNop\n" + "OpNop\n" + "OpNoLine\n" + "OpLine %3 10 10\n" + "OpNop\n" + "OpLine %3 100 100\n" + "OpNop\n" + "OpNop\n" + "OpLine %3 1 1\n" + "OpNoLine\n" + "OpLine %3 2 2\n" + "OpLine %3 3 3\n" + "OpNop\n" + "OpLine %3 4 4\n" + "OpNoLine\n" + "OpNop\n" + "OpLine %3 4 4\n" + "OpNoLine\n" + "OpNop\n"; + SinglePassRunAndCheck(text, result_keep_nop, + /* skip_nop = */ false); + const char* result_skip_nop = + "OpNoLine\n" + "OpLine %3 10 10\n" + "OpLine %3 100 100\n" + "OpLine %3 1 1\n" + "OpNoLine\n" + "OpLine %3 2 2\n" + "OpLine %3 3 3\n" + "OpLine %3 4 4\n" + "OpNoLine\n" + "OpLine %3 4 4\n" + "OpNoLine\n"; + SinglePassRunAndCheck(text, result_skip_nop, + /* skip_nop = */ true); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/local_access_chain_convert_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/local_access_chain_convert_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/local_access_chain_convert_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/local_access_chain_convert_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,722 @@ +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using LocalAccessChainConvertTest = PassTest<::testing::Test>; + +TEST_F(LocalAccessChainConvertTest, StructOfVecsOfFloatConverted) { + // #version 140 + // + // in vec4 BaseColor; + // + // struct S_t { + // vec4 v0; + // vec4 v1; + // }; + // + // void main() + // { + // S_t s0; + // s0.v1 = BaseColor; + // gl_FragColor = s0.v1; + // } + + const std::string predefs_before = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S_t "S_t" +OpMemberName %S_t 0 "v0" +OpMemberName %S_t 1 "v1" +OpName %s0 "s0" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%S_t = OpTypeStruct %v4float %v4float +%_ptr_Function_S_t = OpTypePointer Function %S_t +%int = OpTypeInt 32 1 +%int_1 = OpConstant %int 1 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string predefs_after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S_t "S_t" +OpMemberName %S_t 0 "v0" +OpMemberName %S_t 1 "v1" +OpName %s0 "s0" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%S_t = OpTypeStruct %v4float %v4float +%_ptr_Function_S_t = OpTypePointer Function %S_t +%int = OpTypeInt 32 1 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %8 +%17 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%18 = OpLoad %v4float %BaseColor +%19 = OpAccessChain %_ptr_Function_v4float %s0 %int_1 +OpStore %19 %18 +%20 = OpAccessChain %_ptr_Function_v4float %s0 %int_1 +%21 = OpLoad %v4float %20 +OpStore %gl_FragColor %21 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %8 +%17 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%18 = OpLoad %v4float %BaseColor +%22 = OpLoad %S_t %s0 +%23 = OpCompositeInsert %S_t %18 %22 1 +OpStore %s0 %23 +%24 = OpLoad %S_t %s0 +%25 = OpCompositeExtract %v4float %24 1 +OpStore %gl_FragColor %25 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs_before + before, predefs_after + after, true, true); +} + +TEST_F(LocalAccessChainConvertTest, InBoundsAccessChainsConverted) { + // #version 140 + // + // in vec4 BaseColor; + // + // struct S_t { + // vec4 v0; + // vec4 v1; + // }; + // + // void main() + // { + // S_t s0; + // s0.v1 = BaseColor; + // gl_FragColor = s0.v1; + // } + + const std::string predefs_before = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S_t "S_t" +OpMemberName %S_t 0 "v0" +OpMemberName %S_t 1 "v1" +OpName %s0 "s0" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%S_t = OpTypeStruct %v4float %v4float +%_ptr_Function_S_t = OpTypePointer Function %S_t +%int = OpTypeInt 32 1 +%int_1 = OpConstant %int 1 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string predefs_after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S_t "S_t" +OpMemberName %S_t 0 "v0" +OpMemberName %S_t 1 "v1" +OpName %s0 "s0" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%S_t = OpTypeStruct %v4float %v4float +%_ptr_Function_S_t = OpTypePointer Function %S_t +%int = OpTypeInt 32 1 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %8 +%17 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%18 = OpLoad %v4float %BaseColor +%19 = OpInBoundsAccessChain %_ptr_Function_v4float %s0 %int_1 +OpStore %19 %18 +%20 = OpInBoundsAccessChain %_ptr_Function_v4float %s0 %int_1 +%21 = OpLoad %v4float %20 +OpStore %gl_FragColor %21 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %8 +%17 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%18 = OpLoad %v4float %BaseColor +%22 = OpLoad %S_t %s0 +%23 = OpCompositeInsert %S_t %18 %22 1 +OpStore %s0 %23 +%24 = OpLoad %S_t %s0 +%25 = OpCompositeExtract %v4float %24 1 +OpStore %gl_FragColor %25 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs_before + before, predefs_after + after, true, true); +} + +TEST_F(LocalAccessChainConvertTest, TwoUsesofSingleChainConverted) { + // #version 140 + // + // in vec4 BaseColor; + // + // struct S_t { + // vec4 v0; + // vec4 v1; + // }; + // + // void main() + // { + // S_t s0; + // s0.v1 = BaseColor; + // gl_FragColor = s0.v1; + // } + + const std::string predefs_before = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S_t "S_t" +OpMemberName %S_t 0 "v0" +OpMemberName %S_t 1 "v1" +OpName %s0 "s0" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%S_t = OpTypeStruct %v4float %v4float +%_ptr_Function_S_t = OpTypePointer Function %S_t +%int = OpTypeInt 32 1 +%int_1 = OpConstant %int 1 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string predefs_after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S_t "S_t" +OpMemberName %S_t 0 "v0" +OpMemberName %S_t 1 "v1" +OpName %s0 "s0" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%S_t = OpTypeStruct %v4float %v4float +%_ptr_Function_S_t = OpTypePointer Function %S_t +%int = OpTypeInt 32 1 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %8 +%17 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%18 = OpLoad %v4float %BaseColor +%19 = OpAccessChain %_ptr_Function_v4float %s0 %int_1 +OpStore %19 %18 +%20 = OpLoad %v4float %19 +OpStore %gl_FragColor %20 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %8 +%17 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%18 = OpLoad %v4float %BaseColor +%21 = OpLoad %S_t %s0 +%22 = OpCompositeInsert %S_t %18 %21 1 +OpStore %s0 %22 +%23 = OpLoad %S_t %s0 +%24 = OpCompositeExtract %v4float %23 1 +OpStore %gl_FragColor %24 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs_before + before, predefs_after + after, true, true); +} + +TEST_F(LocalAccessChainConvertTest, OpaqueConverted) { + // SPIR-V not representable in GLSL; not generatable from HLSL + // at the moment + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %outColor %texCoords +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S_t "S_t" +OpMemberName %S_t 0 "v0" +OpMemberName %S_t 1 "v1" +OpMemberName %S_t 2 "smp" +OpName %foo_struct_S_t_vf2_vf21_ "foo(struct-S_t-vf2-vf21;" +OpName %s "s" +OpName %outColor "outColor" +OpName %sampler15 "sampler15" +OpName %s0 "s0" +OpName %texCoords "texCoords" +OpName %param "param" +OpDecorate %sampler15 DescriptorSet 0 +%void = OpTypeVoid +%12 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v2float = OpTypeVector %float 2 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%outColor = OpVariable %_ptr_Output_v4float Output +%17 = OpTypeImage %float 2D 0 0 0 1 Unknown +%18 = OpTypeSampledImage %17 +%S_t = OpTypeStruct %v2float %v2float %18 +%_ptr_Function_S_t = OpTypePointer Function %S_t +%20 = OpTypeFunction %void %_ptr_Function_S_t +%_ptr_UniformConstant_18 = OpTypePointer UniformConstant %18 +%_ptr_Function_18 = OpTypePointer Function %18 +%sampler15 = OpVariable %_ptr_UniformConstant_18 UniformConstant +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%int_2 = OpConstant %int 2 +%_ptr_Function_v2float = OpTypePointer Function %v2float +%_ptr_Input_v2float = OpTypePointer Input %v2float +%texCoords = OpVariable %_ptr_Input_v2float Input +)"; + + const std::string before = + R"(%main = OpFunction %void None %12 +%28 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%param = OpVariable %_ptr_Function_S_t Function +%29 = OpLoad %v2float %texCoords +%30 = OpAccessChain %_ptr_Function_v2float %s0 %int_0 +OpStore %30 %29 +%31 = OpLoad %18 %sampler15 +%32 = OpAccessChain %_ptr_Function_18 %s0 %int_2 +OpStore %32 %31 +%33 = OpLoad %S_t %s0 +OpStore %param %33 +%34 = OpAccessChain %_ptr_Function_18 %param %int_2 +%35 = OpLoad %18 %34 +%36 = OpAccessChain %_ptr_Function_v2float %param %int_0 +%37 = OpLoad %v2float %36 +%38 = OpImageSampleImplicitLod %v4float %35 %37 +OpStore %outColor %38 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %12 +%28 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%param = OpVariable %_ptr_Function_S_t Function +%29 = OpLoad %v2float %texCoords +%45 = OpLoad %S_t %s0 +%46 = OpCompositeInsert %S_t %29 %45 0 +OpStore %s0 %46 +%31 = OpLoad %18 %sampler15 +%47 = OpLoad %S_t %s0 +%48 = OpCompositeInsert %S_t %31 %47 2 +OpStore %s0 %48 +%33 = OpLoad %S_t %s0 +OpStore %param %33 +%49 = OpLoad %S_t %param +%50 = OpCompositeExtract %18 %49 2 +%51 = OpLoad %S_t %param +%52 = OpCompositeExtract %v2float %51 0 +%38 = OpImageSampleImplicitLod %v4float %50 %52 +OpStore %outColor %38 +OpReturn +OpFunctionEnd +)"; + + const std::string remain = + R"(%foo_struct_S_t_vf2_vf21_ = OpFunction %void None %20 +%s = OpFunctionParameter %_ptr_Function_S_t +%39 = OpLabel +%40 = OpAccessChain %_ptr_Function_18 %s %int_2 +%41 = OpLoad %18 %40 +%42 = OpAccessChain %_ptr_Function_v2float %s %int_0 +%43 = OpLoad %v2float %42 +%44 = OpImageSampleImplicitLod %v4float %41 %43 +OpStore %outColor %44 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before + remain, predefs + after + remain, true, true); +} + +TEST_F(LocalAccessChainConvertTest, NestedStructsConverted) { + // #version 140 + // + // in vec4 BaseColor; + // + // struct S1_t { + // vec4 v1; + // }; + // + // struct S2_t { + // vec4 v2; + // S1_t s1; + // }; + // + // void main() + // { + // S2_t s2; + // s2.s1.v1 = BaseColor; + // gl_FragColor = s2.s1.v1; + // } + + const std::string predefs_before = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S1_t "S1_t" +OpMemberName %S1_t 0 "v1" +OpName %S2_t "S2_t" +OpMemberName %S2_t 0 "v2" +OpMemberName %S2_t 1 "s1" +OpName %s2 "s2" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%S1_t = OpTypeStruct %v4float +%S2_t = OpTypeStruct %v4float %S1_t +%_ptr_Function_S2_t = OpTypePointer Function %S2_t +%int = OpTypeInt 32 1 +%int_1 = OpConstant %int 1 +%int_0 = OpConstant %int 0 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string predefs_after = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S1_t "S1_t" +OpMemberName %S1_t 0 "v1" +OpName %S2_t "S2_t" +OpMemberName %S2_t 0 "v2" +OpMemberName %S2_t 1 "s1" +OpName %s2 "s2" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%S1_t = OpTypeStruct %v4float +%S2_t = OpTypeStruct %v4float %S1_t +%_ptr_Function_S2_t = OpTypePointer Function %S2_t +%int = OpTypeInt 32 1 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %9 +%19 = OpLabel +%s2 = OpVariable %_ptr_Function_S2_t Function +%20 = OpLoad %v4float %BaseColor +%21 = OpAccessChain %_ptr_Function_v4float %s2 %int_1 %int_0 +OpStore %21 %20 +%22 = OpAccessChain %_ptr_Function_v4float %s2 %int_1 %int_0 +%23 = OpLoad %v4float %22 +OpStore %gl_FragColor %23 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %9 +%19 = OpLabel +%s2 = OpVariable %_ptr_Function_S2_t Function +%20 = OpLoad %v4float %BaseColor +%24 = OpLoad %S2_t %s2 +%25 = OpCompositeInsert %S2_t %20 %24 1 0 +OpStore %s2 %25 +%26 = OpLoad %S2_t %s2 +%27 = OpCompositeExtract %v4float %26 1 0 +OpStore %gl_FragColor %27 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs_before + before, predefs_after + after, true, true); +} + +TEST_F(LocalAccessChainConvertTest, DynamicallyIndexedVarNotConverted) { + // #version 140 + // + // in vec4 BaseColor; + // flat in int Idx; + // in float Bi; + // + // struct S_t { + // vec4 v0; + // vec4 v1; + // }; + // + // void main() + // { + // S_t s0; + // s0.v1 = BaseColor; + // s0.v1[Idx] = Bi; + // gl_FragColor = s0.v1; + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %Idx %Bi %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S_t "S_t" +OpMemberName %S_t 0 "v0" +OpMemberName %S_t 1 "v1" +OpName %s0 "s0" +OpName %BaseColor "BaseColor" +OpName %Idx "Idx" +OpName %Bi "Bi" +OpName %gl_FragColor "gl_FragColor" +OpDecorate %Idx Flat +%void = OpTypeVoid +%10 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%S_t = OpTypeStruct %v4float %v4float +%_ptr_Function_S_t = OpTypePointer Function %S_t +%int = OpTypeInt 32 1 +%int_1 = OpConstant %int 1 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_int = OpTypePointer Input %int +%Idx = OpVariable %_ptr_Input_int Input +%_ptr_Input_float = OpTypePointer Input %float +%Bi = OpVariable %_ptr_Input_float Input +%_ptr_Function_float = OpTypePointer Function %float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %10 +%22 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%23 = OpLoad %v4float %BaseColor +%24 = OpAccessChain %_ptr_Function_v4float %s0 %int_1 +OpStore %24 %23 +%25 = OpLoad %int %Idx +%26 = OpLoad %float %Bi +%27 = OpAccessChain %_ptr_Function_float %s0 %int_1 %25 +OpStore %27 %26 +%28 = OpAccessChain %_ptr_Function_v4float %s0 %int_1 +%29 = OpLoad %v4float %28 +OpStore %gl_FragColor %29 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, + false, true); +} + +TEST_F(LocalAccessChainConvertTest, SomeAccessChainsHaveNoUse) { + // Based on HLSL source code: + // struct S { + // float f; + // }; + + // float main(float input : A) : B { + // S local = { input }; + // return local.f; + // } + + const std::string predefs = R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %main "main" %in_var_A %out_var_B +OpName %main "main" +OpName %in_var_A "in.var.A" +OpName %out_var_B "out.var.B" +OpName %S "S" +OpName %local "local" +%int = OpTypeInt 32 1 +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%_ptr_Input_float = OpTypePointer Input %float +%_ptr_Output_float = OpTypePointer Output %float +%S = OpTypeStruct %float +%_ptr_Function_S = OpTypePointer Function %S +%int_0 = OpConstant %int 0 +%in_var_A = OpVariable %_ptr_Input_float Input +%out_var_B = OpVariable %_ptr_Output_float Output +%main = OpFunction %void None %8 +%15 = OpLabel +%local = OpVariable %_ptr_Function_S Function +%16 = OpLoad %float %in_var_A +%17 = OpCompositeConstruct %S %16 +OpStore %local %17 +)"; + + const std::string before = + R"(%18 = OpAccessChain %_ptr_Function_float %local %int_0 +%19 = OpAccessChain %_ptr_Function_float %local %int_0 +%20 = OpLoad %float %18 +OpStore %out_var_B %20 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%19 = OpAccessChain %_ptr_Function_float %local %int_0 +%21 = OpLoad %S %local +%22 = OpCompositeExtract %float %21 0 +OpStore %out_var_B %22 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +// TODO(greg-lunarg): Add tests to verify handling of these cases: +// +// Assorted vector and matrix types +// Assorted struct array types +// Assorted scalar types +// Assorted non-target types +// OpInBoundsAccessChain +// Others? + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/local_redundancy_elimination_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/local_redundancy_elimination_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/local_redundancy_elimination_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/local_redundancy_elimination_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,158 @@ +// Copyright (c) 2017 Google 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. + +#include "opt/value_number_table.h" + +#include "assembly_builder.h" +#include "gmock/gmock.h" +#include "opt/build_module.h" +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using ::testing::HasSubstr; +using ::testing::MatchesRegex; + +using LocalRedundancyEliminationTest = PassTest<::testing::Test>; + +#ifdef SPIRV_EFFCEE +// Remove an instruction when it was already computed. +TEST_F(LocalRedundancyEliminationTest, RemoveRedundantAdd) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Function %5 + %2 = OpFunction %3 None %4 + %7 = OpLabel + %8 = OpVariable %6 Function + %9 = OpLoad %5 %8 + %10 = OpFAdd %5 %9 %9 +; CHECK: OpFAdd +; CHECK-NOT: OpFAdd + %11 = OpFAdd %5 %9 %9 + OpReturn + OpFunctionEnd + )"; + SinglePassRunAndMatch(text, false); +} + +// Make sure we keep instruction that are different, but look similar. +TEST_F(LocalRedundancyEliminationTest, KeepDifferentAdd) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Function %5 + %2 = OpFunction %3 None %4 + %7 = OpLabel + %8 = OpVariable %6 Function + %9 = OpLoad %5 %8 + %10 = OpFAdd %5 %9 %9 +; CHECK: OpFAdd + OpStore %8 %10 + %11 = OpLoad %5 %8 +; CHECK: %11 = OpLoad + %12 = OpFAdd %5 %11 %11 +; CHECK: OpFAdd [[:%\w+]] %11 %11 + OpReturn + OpFunctionEnd + )"; + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndMatch(text, false); +} + +// This test is check that the values are being propagated properly, and that +// we are able to identify sequences of instruction that are not needed. +TEST_F(LocalRedundancyEliminationTest, RemoveMultipleInstructions) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Uniform %5 + %8 = OpVariable %6 Uniform + %2 = OpFunction %3 None %4 + %7 = OpLabel +; CHECK: [[r1:%\w+]] = OpLoad + %9 = OpLoad %5 %8 +; CHECK-NEXT: [[r2:%\w+]] = OpFAdd [[:%\w+]] [[r1]] [[r1]] + %10 = OpFAdd %5 %9 %9 +; CHECK-NEXT: [[r3:%\w+]] = OpFMul [[:%\w+]] [[r2]] [[r1]] + %11 = OpFMul %5 %10 %9 +; CHECK-NOT: OpLoad + %12 = OpLoad %5 %8 +; CHECK-NOT: OpFAdd [[:\w+]] %12 %12 + %13 = OpFAdd %5 %12 %12 +; CHECK-NOT: OpFMul + %14 = OpFMul %5 %13 %12 +; CHECK-NEXT: [[:%\w+]] = OpFAdd [[:%\w+]] [[r3]] [[r3]] + %15 = OpFAdd %5 %14 %11 + OpReturn + OpFunctionEnd + )"; + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndMatch(text, false); +} + +// Redundant instructions in different blocks should be kept. +TEST_F(LocalRedundancyEliminationTest, KeepInstructionsInDifferentBlocks) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Function %5 + %2 = OpFunction %3 None %4 + %bb1 = OpLabel + %8 = OpVariable %6 Function + %9 = OpLoad %5 %8 + %10 = OpFAdd %5 %9 %9 +; CHECK: OpFAdd + OpBranch %bb2 + %bb2 = OpLabel +; CHECK: OpFAdd + %11 = OpFAdd %5 %9 %9 + OpReturn + OpFunctionEnd + )"; + SinglePassRunAndMatch(text, false); +} +#endif +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/local_single_block_elim.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/local_single_block_elim.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/local_single_block_elim.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/local_single_block_elim.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,801 @@ +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using LocalSingleBlockLoadStoreElimTest = PassTest<::testing::Test>; + +TEST_F(LocalSingleBlockLoadStoreElimTest, SimpleStoreLoadElim) { + // #version 140 + // + // in vec4 BaseColor; + // + // void main() + // { + // vec4 v = BaseColor; + // gl_FragColor = v; + // } + + const std::string predefs_before = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %7 +%13 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%14 = OpLoad %v4float %BaseColor +OpStore %v %14 +%15 = OpLoad %v4float %v +OpStore %gl_FragColor %15 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %7 +%13 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%14 = OpLoad %v4float %BaseColor +OpStore %v %14 +%15 = OpLoad %v4float %v +OpStore %gl_FragColor %14 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs_before + before, predefs_before + after, true, true); +} + +TEST_F(LocalSingleBlockLoadStoreElimTest, SimpleLoadLoadElim) { + // #version 140 + // + // in vec4 BaseColor; + // in float fi; + // + // void main() + // { + // vec4 v = BaseColor; + // if (fi < 0) + // v = vec4(0.0); + // gl_FragData[0] = v; + // gl_FragData[1] = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %fi %gl_FragData +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %fi "fi" +OpName %gl_FragData "gl_FragData" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float +%fi = OpVariable %_ptr_Input_float Input +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%16 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%uint = OpTypeInt 32 0 +%uint_32 = OpConstant %uint 32 +%_arr_v4float_uint_32 = OpTypeArray %v4float %uint_32 +%_ptr_Output__arr_v4float_uint_32 = OpTypePointer Output %_arr_v4float_uint_32 +%gl_FragData = OpVariable %_ptr_Output__arr_v4float_uint_32 Output +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%int_1 = OpConstant %int 1 +)"; + + const std::string before = + R"(%main = OpFunction %void None %8 +%25 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%26 = OpLoad %v4float %BaseColor +OpStore %v %26 +%27 = OpLoad %float %fi +%28 = OpFOrdLessThan %bool %27 %float_0 +OpSelectionMerge %29 None +OpBranchConditional %28 %30 %29 +%30 = OpLabel +OpStore %v %16 +OpBranch %29 +%29 = OpLabel +%31 = OpLoad %v4float %v +%32 = OpAccessChain %_ptr_Output_v4float %gl_FragData %int_0 +OpStore %32 %31 +%33 = OpLoad %v4float %v +%34 = OpAccessChain %_ptr_Output_v4float %gl_FragData %int_1 +OpStore %34 %33 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %8 +%25 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%26 = OpLoad %v4float %BaseColor +OpStore %v %26 +%27 = OpLoad %float %fi +%28 = OpFOrdLessThan %bool %27 %float_0 +OpSelectionMerge %29 None +OpBranchConditional %28 %30 %29 +%30 = OpLabel +OpStore %v %16 +OpBranch %29 +%29 = OpLabel +%31 = OpLoad %v4float %v +%32 = OpAccessChain %_ptr_Output_v4float %gl_FragData %int_0 +OpStore %32 %31 +%33 = OpLoad %v4float %v +%34 = OpAccessChain %_ptr_Output_v4float %gl_FragData %int_1 +OpStore %34 %31 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSingleBlockLoadStoreElimTest, + NoStoreElimIfInterveningAccessChainLoad) { + // + // Note that even though the Load to %v is eliminated, the Store to %v + // is not eliminated due to the following access chain reference. + // + // #version 140 + // + // in vec4 BaseColor; + // flat in int Idx; + // + // void main() + // { + // vec4 v = BaseColor; + // float f = v[Idx]; + // gl_FragColor = v/f; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %Idx %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %f "f" +OpName %Idx "Idx" +OpName %gl_FragColor "gl_FragColor" +OpDecorate %Idx Flat +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_float = OpTypePointer Function %float +%int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%Idx = OpVariable %_ptr_Input_int Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %9 +%18 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%f = OpVariable %_ptr_Function_float Function +%19 = OpLoad %v4float %BaseColor +OpStore %v %19 +%20 = OpLoad %int %Idx +%21 = OpAccessChain %_ptr_Function_float %v %20 +%22 = OpLoad %float %21 +OpStore %f %22 +%23 = OpLoad %v4float %v +%24 = OpLoad %float %f +%25 = OpCompositeConstruct %v4float %24 %24 %24 %24 +%26 = OpFDiv %v4float %23 %25 +OpStore %gl_FragColor %26 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %9 +%18 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%f = OpVariable %_ptr_Function_float Function +%19 = OpLoad %v4float %BaseColor +OpStore %v %19 +%20 = OpLoad %int %Idx +%21 = OpAccessChain %_ptr_Function_float %v %20 +%22 = OpLoad %float %21 +OpStore %f %22 +%23 = OpLoad %v4float %v +%24 = OpLoad %float %f +%25 = OpCompositeConstruct %v4float %22 %22 %22 %22 +%26 = OpFDiv %v4float %19 %25 +OpStore %gl_FragColor %26 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSingleBlockLoadStoreElimTest, NoElimIfInterveningAccessChainStore) { + // #version 140 + // + // in vec4 BaseColor; + // flat in int Idx; + // + // void main() + // { + // vec4 v = BaseColor; + // v[Idx] = 0; + // gl_FragColor = v; + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %Idx %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %Idx "Idx" +OpName %gl_FragColor "gl_FragColor" +OpDecorate %Idx Flat +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%Idx = OpVariable %_ptr_Input_int Input +%float_0 = OpConstant %float 0 +%_ptr_Function_float = OpTypePointer Function %float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %8 +%18 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%19 = OpLoad %v4float %BaseColor +OpStore %v %19 +%20 = OpLoad %int %Idx +%21 = OpAccessChain %_ptr_Function_float %v %20 +OpStore %21 %float_0 +%22 = OpLoad %v4float %v +OpStore %gl_FragColor %22 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + assembly, assembly, false, true); +} + +TEST_F(LocalSingleBlockLoadStoreElimTest, NoElimIfInterveningFunctionCall) { + // #version 140 + // + // in vec4 BaseColor; + // + // void foo() { + // } + // + // void main() + // { + // vec4 v = BaseColor; + // foo(); + // gl_FragColor = v; + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %foo_ "foo(" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %8 +%14 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%15 = OpLoad %v4float %BaseColor +OpStore %v %15 +%16 = OpFunctionCall %void %foo_ +%17 = OpLoad %v4float %v +OpStore %gl_FragColor %17 +OpReturn +OpFunctionEnd +%foo_ = OpFunction %void None %8 +%18 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + assembly, assembly, false, true); +} + +TEST_F(LocalSingleBlockLoadStoreElimTest, ElimIfCopyObjectInFunction) { + // Note: SPIR-V hand edited to insert CopyObject + // + // #version 140 + // + // in vec4 BaseColor; + // + // void main() + // { + // vec4 v1 = BaseColor; + // gl_FragData[0] = v1; + // vec4 v2 = BaseColor * 0.5; + // gl_FragData[1] = v2; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragData +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v1 "v1" +OpName %BaseColor "BaseColor" +OpName %gl_FragData "gl_FragData" +OpName %v2 "v2" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%uint = OpTypeInt 32 0 +%uint_32 = OpConstant %uint 32 +%_arr_v4float_uint_32 = OpTypeArray %v4float %uint_32 +%_ptr_Output__arr_v4float_uint_32 = OpTypePointer Output %_arr_v4float_uint_32 +%gl_FragData = OpVariable %_ptr_Output__arr_v4float_uint_32 Output +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%float_0_5 = OpConstant %float 0.5 +%int_1 = OpConstant %int 1 +)"; + + const std::string before = + R"(%main = OpFunction %void None %8 +%22 = OpLabel +%v1 = OpVariable %_ptr_Function_v4float Function +%v2 = OpVariable %_ptr_Function_v4float Function +%23 = OpLoad %v4float %BaseColor +OpStore %v1 %23 +%24 = OpLoad %v4float %v1 +%25 = OpAccessChain %_ptr_Output_v4float %gl_FragData %int_0 +OpStore %25 %24 +%26 = OpLoad %v4float %BaseColor +%27 = OpVectorTimesScalar %v4float %26 %float_0_5 +%28 = OpCopyObject %_ptr_Function_v4float %v2 +OpStore %28 %27 +%29 = OpLoad %v4float %28 +%30 = OpAccessChain %_ptr_Output_v4float %gl_FragData %int_1 +OpStore %30 %29 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %8 +%22 = OpLabel +%v1 = OpVariable %_ptr_Function_v4float Function +%v2 = OpVariable %_ptr_Function_v4float Function +%23 = OpLoad %v4float %BaseColor +OpStore %v1 %23 +%24 = OpLoad %v4float %v1 +%25 = OpAccessChain %_ptr_Output_v4float %gl_FragData %int_0 +OpStore %25 %23 +%26 = OpLoad %v4float %BaseColor +%27 = OpVectorTimesScalar %v4float %26 %float_0_5 +%28 = OpCopyObject %_ptr_Function_v4float %v2 +OpStore %28 %27 +%29 = OpLoad %v4float %28 +%30 = OpAccessChain %_ptr_Output_v4float %gl_FragData %int_1 +OpStore %30 %27 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSingleBlockLoadStoreElimTest, ElimOpaque) { + // SPIR-V not representable in GLSL; not generatable from HLSL + // at the moment + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %outColor %texCoords +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %S_t "S_t" +OpMemberName %S_t 0 "v0" +OpMemberName %S_t 1 "v1" +OpMemberName %S_t 2 "smp" +OpName %outColor "outColor" +OpName %sampler15 "sampler15" +OpName %s0 "s0" +OpName %texCoords "texCoords" +OpName %param "param" +OpDecorate %sampler15 DescriptorSet 0 +%void = OpTypeVoid +%12 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v2float = OpTypeVector %float 2 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%outColor = OpVariable %_ptr_Output_v4float Output +%17 = OpTypeImage %float 2D 0 0 0 1 Unknown +%18 = OpTypeSampledImage %17 +%S_t = OpTypeStruct %v2float %v2float %18 +%_ptr_Function_S_t = OpTypePointer Function %S_t +%20 = OpTypeFunction %void %_ptr_Function_S_t +%_ptr_UniformConstant_18 = OpTypePointer UniformConstant %18 +%_ptr_Function_18 = OpTypePointer Function %18 +%sampler15 = OpVariable %_ptr_UniformConstant_18 UniformConstant +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%int_2 = OpConstant %int 2 +%_ptr_Function_v2float = OpTypePointer Function %v2float +%_ptr_Input_v2float = OpTypePointer Input %v2float +%texCoords = OpVariable %_ptr_Input_v2float Input +)"; + + const std::string before = + R"(%main = OpFunction %void None %12 +%28 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%param = OpVariable %_ptr_Function_S_t Function +%29 = OpLoad %v2float %texCoords +%30 = OpLoad %S_t %s0 +%31 = OpCompositeInsert %S_t %29 %30 0 +OpStore %s0 %31 +%32 = OpLoad %18 %sampler15 +%33 = OpLoad %S_t %s0 +%34 = OpCompositeInsert %S_t %32 %33 2 +OpStore %s0 %34 +%35 = OpLoad %S_t %s0 +OpStore %param %35 +%36 = OpLoad %S_t %param +%37 = OpCompositeExtract %18 %36 2 +%38 = OpLoad %S_t %param +%39 = OpCompositeExtract %v2float %38 0 +%40 = OpImageSampleImplicitLod %v4float %37 %39 +OpStore %outColor %40 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %12 +%28 = OpLabel +%s0 = OpVariable %_ptr_Function_S_t Function +%param = OpVariable %_ptr_Function_S_t Function +%29 = OpLoad %v2float %texCoords +%30 = OpLoad %S_t %s0 +%31 = OpCompositeInsert %S_t %29 %30 0 +OpStore %s0 %31 +%32 = OpLoad %18 %sampler15 +%33 = OpLoad %S_t %s0 +%34 = OpCompositeInsert %S_t %32 %31 2 +OpStore %s0 %34 +%35 = OpLoad %S_t %s0 +OpStore %param %34 +%36 = OpLoad %S_t %param +%37 = OpCompositeExtract %18 %34 2 +%38 = OpLoad %S_t %param +%39 = OpCompositeExtract %v2float %34 0 +%40 = OpImageSampleImplicitLod %v4float %37 %39 +OpStore %outColor %40 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSingleBlockLoadStoreElimTest, PositiveAndNegativeCallTree) { + // Note that the call tree function bar is optimized, but foo is not + // + // #version 140 + // + // in vec4 BaseColor; + // + // vec4 foo(vec4 v1) + // { + // vec4 t = v1; + // return t; + // } + // + // vec4 bar(vec4 v1) + // { + // vec4 t = v1; + // return t; + // } + // + // void main() + // { + // gl_FragColor = bar(BaseColor); + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %gl_FragColor %BaseColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %foo_vf4_ "foo(vf4;" +OpName %v1 "v1" +OpName %bar_vf4_ "bar(vf4;" +OpName %v1_0 "v1" +OpName %t "t" +OpName %t_0 "t" +OpName %gl_FragColor "gl_FragColor" +OpName %BaseColor "BaseColor" +OpName %param "param" +%void = OpTypeVoid +%13 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%17 = OpTypeFunction %v4float %_ptr_Function_v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%main = OpFunction %void None %13 +%20 = OpLabel +%param = OpVariable %_ptr_Function_v4float Function +%21 = OpLoad %v4float %BaseColor +OpStore %param %21 +%22 = OpFunctionCall %v4float %bar_vf4_ %param +OpStore %gl_FragColor %22 +OpReturn +OpFunctionEnd +)"; + + const std::string before = + R"(%foo_vf4_ = OpFunction %v4float None %17 +%v1 = OpFunctionParameter %_ptr_Function_v4float +%23 = OpLabel +%t = OpVariable %_ptr_Function_v4float Function +%24 = OpLoad %v4float %v1 +OpStore %t %24 +%25 = OpLoad %v4float %t +OpReturnValue %25 +OpFunctionEnd +%bar_vf4_ = OpFunction %v4float None %17 +%v1_0 = OpFunctionParameter %_ptr_Function_v4float +%26 = OpLabel +%t_0 = OpVariable %_ptr_Function_v4float Function +%27 = OpLoad %v4float %v1_0 +OpStore %t_0 %27 +%28 = OpLoad %v4float %t_0 +OpReturnValue %28 +OpFunctionEnd +)"; + + const std::string after = + R"(%foo_vf4_ = OpFunction %v4float None %17 +%v1 = OpFunctionParameter %_ptr_Function_v4float +%23 = OpLabel +%t = OpVariable %_ptr_Function_v4float Function +%24 = OpLoad %v4float %v1 +OpStore %t %24 +%25 = OpLoad %v4float %t +OpReturnValue %25 +OpFunctionEnd +%bar_vf4_ = OpFunction %v4float None %17 +%v1_0 = OpFunctionParameter %_ptr_Function_v4float +%26 = OpLabel +%t_0 = OpVariable %_ptr_Function_v4float Function +%27 = OpLoad %v4float %v1_0 +OpStore %t_0 %27 +%28 = OpLoad %v4float %t_0 +OpReturnValue %27 +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSingleBlockLoadStoreElimTest, PointerVariable) { + // Test that checks if a pointer variable is removed. + + const std::string before = + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %1 "main" %2 +OpExecutionMode %1 OriginUpperLeft +OpMemberDecorate %_struct_3 0 Offset 0 +OpDecorate %_runtimearr__struct_3 ArrayStride 16 +OpMemberDecorate %_struct_5 0 Offset 0 +OpDecorate %_struct_5 BufferBlock +OpMemberDecorate %_struct_6 0 Offset 0 +OpDecorate %_struct_6 BufferBlock +OpDecorate %2 Location 0 +OpDecorate %7 DescriptorSet 0 +OpDecorate %7 Binding 0 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%uint = OpTypeInt 32 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float +%_struct_3 = OpTypeStruct %v4float +%_runtimearr__struct_3 = OpTypeRuntimeArray %_struct_3 +%_struct_5 = OpTypeStruct %_runtimearr__struct_3 +%_ptr_Uniform__struct_5 = OpTypePointer Uniform %_struct_5 +%_struct_6 = OpTypeStruct %int +%_ptr_Uniform__struct_6 = OpTypePointer Uniform %_struct_6 +%_ptr_Function__ptr_Uniform__struct_5 = OpTypePointer Function %_ptr_Uniform__struct_5 +%_ptr_Function__ptr_Uniform__struct_6 = OpTypePointer Function %_ptr_Uniform__struct_6 +%int_0 = OpConstant %int 0 +%uint_0 = OpConstant %uint 0 +%2 = OpVariable %_ptr_Output_v4float Output +%7 = OpVariable %_ptr_Uniform__struct_5 Uniform +%1 = OpFunction %void None %10 +%23 = OpLabel +%24 = OpVariable %_ptr_Function__ptr_Uniform__struct_5 Function +OpStore %24 %7 +%26 = OpLoad %_ptr_Uniform__struct_5 %24 +%27 = OpAccessChain %_ptr_Uniform_v4float %26 %int_0 %uint_0 %int_0 +%28 = OpLoad %v4float %27 +%29 = OpCopyObject %v4float %28 +OpStore %2 %28 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %1 "main" %2 +OpExecutionMode %1 OriginUpperLeft +OpMemberDecorate %_struct_3 0 Offset 0 +OpDecorate %_runtimearr__struct_3 ArrayStride 16 +OpMemberDecorate %_struct_5 0 Offset 0 +OpDecorate %_struct_5 BufferBlock +OpMemberDecorate %_struct_6 0 Offset 0 +OpDecorate %_struct_6 BufferBlock +OpDecorate %2 Location 0 +OpDecorate %7 DescriptorSet 0 +OpDecorate %7 Binding 0 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%uint = OpTypeInt 32 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float +%_struct_3 = OpTypeStruct %v4float +%_runtimearr__struct_3 = OpTypeRuntimeArray %_struct_3 +%_struct_5 = OpTypeStruct %_runtimearr__struct_3 +%_ptr_Uniform__struct_5 = OpTypePointer Uniform %_struct_5 +%_struct_6 = OpTypeStruct %int +%_ptr_Uniform__struct_6 = OpTypePointer Uniform %_struct_6 +%_ptr_Function__ptr_Uniform__struct_5 = OpTypePointer Function %_ptr_Uniform__struct_5 +%_ptr_Function__ptr_Uniform__struct_6 = OpTypePointer Function %_ptr_Uniform__struct_6 +%int_0 = OpConstant %int 0 +%uint_0 = OpConstant %uint 0 +%2 = OpVariable %_ptr_Output_v4float Output +%7 = OpVariable %_ptr_Uniform__struct_5 Uniform +%1 = OpFunction %void None %10 +%23 = OpLabel +%24 = OpVariable %_ptr_Function__ptr_Uniform__struct_5 Function +OpStore %24 %7 +%26 = OpLoad %_ptr_Uniform__struct_5 %24 +%27 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0 %uint_0 %int_0 +%28 = OpLoad %v4float %27 +%29 = OpCopyObject %v4float %28 +OpStore %2 %28 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(before, after, + true, true); +} +// TODO(greg-lunarg): Add tests to verify handling of these cases: +// +// Other target variable types +// InBounds Access Chains +// Check for correctness in the presence of function calls +// Others? + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/local_single_store_elim_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/local_single_store_elim_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/local_single_store_elim_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/local_single_store_elim_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,720 @@ +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using LocalSingleStoreElimTest = PassTest<::testing::Test>; + +TEST_F(LocalSingleStoreElimTest, PositiveAndNegative) { + // Single store to v is optimized. Multiple store to + // f is not optimized. + // + // #version 140 + // + // in vec4 BaseColor; + // in float fi; + // + // void main() + // { + // vec4 v = BaseColor; + // float f = fi; + // if (f < 0) + // f = 0.0; + // gl_FragColor = v + f; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %fi %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %f "f" +OpName %fi "fi" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_float = OpTypePointer Function %float +%_ptr_Input_float = OpTypePointer Input %float +%fi = OpVariable %_ptr_Input_float Input +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %9 +%19 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%f = OpVariable %_ptr_Function_float Function +%20 = OpLoad %v4float %BaseColor +OpStore %v %20 +%21 = OpLoad %float %fi +OpStore %f %21 +%22 = OpLoad %float %f +%23 = OpFOrdLessThan %bool %22 %float_0 +OpSelectionMerge %24 None +OpBranchConditional %23 %25 %24 +%25 = OpLabel +OpStore %f %float_0 +OpBranch %24 +%24 = OpLabel +%26 = OpLoad %v4float %v +%27 = OpLoad %float %f +%28 = OpCompositeConstruct %v4float %27 %27 %27 %27 +%29 = OpFAdd %v4float %26 %28 +OpStore %gl_FragColor %29 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %9 +%19 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%f = OpVariable %_ptr_Function_float Function +%20 = OpLoad %v4float %BaseColor +OpStore %v %20 +%21 = OpLoad %float %fi +OpStore %f %21 +%22 = OpLoad %float %f +%23 = OpFOrdLessThan %bool %22 %float_0 +OpSelectionMerge %24 None +OpBranchConditional %23 %25 %24 +%25 = OpLabel +OpStore %f %float_0 +OpBranch %24 +%24 = OpLabel +%26 = OpLoad %v4float %v +%27 = OpLoad %float %f +%28 = OpCompositeConstruct %v4float %27 %27 %27 %27 +%29 = OpFAdd %v4float %20 %28 +OpStore %gl_FragColor %29 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSingleStoreElimTest, MultipleLoads) { + // Single store to multiple loads of v is optimized. + // + // #version 140 + // + // in vec4 BaseColor; + // in float fi; + // + // void main() + // { + // vec4 v = BaseColor; + // float f = fi; + // if (f < 0) + // f = 0.0; + // gl_FragColor = v + f; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %fi %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %fi "fi" +OpName %r "r" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float +%fi = OpVariable %_ptr_Input_float Input +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%float_1 = OpConstant %float 1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %9 +%19 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%r = OpVariable %_ptr_Function_v4float Function +%20 = OpLoad %v4float %BaseColor +OpStore %v %20 +%21 = OpLoad %float %fi +%22 = OpFOrdLessThan %bool %21 %float_0 +OpSelectionMerge %23 None +OpBranchConditional %22 %24 %25 +%24 = OpLabel +%26 = OpLoad %v4float %v +OpStore %r %26 +OpBranch %23 +%25 = OpLabel +%27 = OpLoad %v4float %v +%28 = OpCompositeConstruct %v4float %float_1 %float_1 %float_1 %float_1 +%29 = OpFSub %v4float %28 %27 +OpStore %r %29 +OpBranch %23 +%23 = OpLabel +%30 = OpLoad %v4float %r +OpStore %gl_FragColor %30 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %9 +%19 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%r = OpVariable %_ptr_Function_v4float Function +%20 = OpLoad %v4float %BaseColor +OpStore %v %20 +%21 = OpLoad %float %fi +%22 = OpFOrdLessThan %bool %21 %float_0 +OpSelectionMerge %23 None +OpBranchConditional %22 %24 %25 +%24 = OpLabel +%26 = OpLoad %v4float %v +OpStore %r %20 +OpBranch %23 +%25 = OpLabel +%27 = OpLoad %v4float %v +%28 = OpCompositeConstruct %v4float %float_1 %float_1 %float_1 %float_1 +%29 = OpFSub %v4float %28 %20 +OpStore %r %29 +OpBranch %23 +%23 = OpLabel +%30 = OpLoad %v4float %r +OpStore %gl_FragColor %30 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSingleStoreElimTest, NoStoreElimWithInterveningAccessChainLoad) { + // Last load of v is eliminated, but access chain load and store of v isn't + // + // #version 140 + // + // in vec4 BaseColor; + // + // void main() + // { + // vec4 v = BaseColor; + // float f = v[3]; + // gl_FragColor = v * f; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %f "f" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_float = OpTypePointer Function %float +%uint = OpTypeInt 32 0 +%uint_3 = OpConstant %uint 3 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %8 +%17 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%f = OpVariable %_ptr_Function_float Function +%18 = OpLoad %v4float %BaseColor +OpStore %v %18 +%19 = OpAccessChain %_ptr_Function_float %v %uint_3 +%20 = OpLoad %float %19 +OpStore %f %20 +%21 = OpLoad %v4float %v +%22 = OpLoad %float %f +%23 = OpVectorTimesScalar %v4float %21 %22 +OpStore %gl_FragColor %23 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %8 +%17 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%f = OpVariable %_ptr_Function_float Function +%18 = OpLoad %v4float %BaseColor +OpStore %v %18 +%19 = OpAccessChain %_ptr_Function_float %v %uint_3 +%20 = OpLoad %float %19 +OpStore %f %20 +%21 = OpLoad %v4float %v +%22 = OpLoad %float %f +%23 = OpVectorTimesScalar %v4float %18 %20 +OpStore %gl_FragColor %23 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSingleStoreElimTest, NoReplaceOfDominatingPartialStore) { + // Note: SPIR-V hand edited to initialize v to vec4(0.0) + // + // #version 140 + // + // in vec4 BaseColor; + // + // void main() + // { + // vec4 v; + // float v[1] = 1.0; + // gl_FragColor = v; + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %gl_FragColor %BaseColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %gl_FragColor "gl_FragColor" +OpName %BaseColor "BaseColor" +%void = OpTypeVoid +%7 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%float_0 = OpConstant %float 0 +%12 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%float_1 = OpConstant %float 1 +%uint = OpTypeInt 32 0 +%uint_1 = OpConstant %uint 1 +%_ptr_Function_float = OpTypePointer Function %float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%main = OpFunction %void None %7 +%19 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function %12 +%20 = OpAccessChain %_ptr_Function_float %v %uint_1 +OpStore %20 %float_1 +%21 = OpLoad %v4float %v +OpStore %gl_FragColor %21 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, + true); +} + +TEST_F(LocalSingleStoreElimTest, ElimIfCopyObjectInFunction) { + // Note: hand edited to insert OpCopyObject + // + // #version 140 + // + // in vec4 BaseColor; + // in float fi; + // + // void main() + // { + // vec4 v = BaseColor; + // float f = fi; + // if (f < 0) + // f = 0.0; + // gl_FragColor = v + f; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %fi %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %f "f" +OpName %fi "fi" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Function_float = OpTypePointer Function %float +%_ptr_Input_float = OpTypePointer Input %float +%fi = OpVariable %_ptr_Input_float Input +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %9 +%19 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%f = OpVariable %_ptr_Function_float Function +%20 = OpLoad %v4float %BaseColor +OpStore %v %20 +%21 = OpLoad %float %fi +OpStore %f %21 +%22 = OpLoad %float %f +%23 = OpFOrdLessThan %bool %22 %float_0 +OpSelectionMerge %24 None +OpBranchConditional %23 %25 %24 +%25 = OpLabel +OpStore %f %float_0 +OpBranch %24 +%24 = OpLabel +%26 = OpCopyObject %_ptr_Function_v4float %v +%27 = OpLoad %v4float %26 +%28 = OpLoad %float %f +%29 = OpCompositeConstruct %v4float %28 %28 %28 %28 +%30 = OpFAdd %v4float %27 %29 +OpStore %gl_FragColor %30 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %9 +%19 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%f = OpVariable %_ptr_Function_float Function +%20 = OpLoad %v4float %BaseColor +OpStore %v %20 +%21 = OpLoad %float %fi +OpStore %f %21 +%22 = OpLoad %float %f +%23 = OpFOrdLessThan %bool %22 %float_0 +OpSelectionMerge %24 None +OpBranchConditional %23 %25 %24 +%25 = OpLabel +OpStore %f %float_0 +OpBranch %24 +%24 = OpLabel +%26 = OpCopyObject %_ptr_Function_v4float %v +%27 = OpLoad %v4float %26 +%28 = OpLoad %float %f +%29 = OpCompositeConstruct %v4float %28 %28 %28 %28 +%30 = OpFAdd %v4float %20 %29 +OpStore %gl_FragColor %30 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSingleStoreElimTest, NoOptIfStoreNotDominating) { + // Single store to f not optimized because it does not dominate + // the load. + // + // #version 140 + // + // in vec4 BaseColor; + // in float fi; + // + // void main() + // { + // float f; + // if (fi < 0) + // f = 0.5; + // if (fi < 0) + // gl_FragColor = BaseColor * f; + // else + // gl_FragColor = BaseColor; + // } + + const std::string assembly = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %fi %gl_FragColor %BaseColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %fi "fi" +OpName %f "f" +OpName %gl_FragColor "gl_FragColor" +OpName %BaseColor "BaseColor" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Input_float = OpTypePointer Input %float +%fi = OpVariable %_ptr_Input_float Input +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%_ptr_Function_float = OpTypePointer Function %float +%float_0_5 = OpConstant %float 0.5 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%main = OpFunction %void None %8 +%18 = OpLabel +%f = OpVariable %_ptr_Function_float Function +%19 = OpLoad %float %fi +%20 = OpFOrdLessThan %bool %19 %float_0 +OpSelectionMerge %21 None +OpBranchConditional %20 %22 %21 +%22 = OpLabel +OpStore %f %float_0_5 +OpBranch %21 +%21 = OpLabel +%23 = OpLoad %float %fi +%24 = OpFOrdLessThan %bool %23 %float_0 +OpSelectionMerge %25 None +OpBranchConditional %24 %26 %27 +%26 = OpLabel +%28 = OpLoad %v4float %BaseColor +%29 = OpLoad %float %f +%30 = OpVectorTimesScalar %v4float %28 %29 +OpStore %gl_FragColor %30 +OpBranch %25 +%27 = OpLabel +%31 = OpLoad %v4float %BaseColor +OpStore %gl_FragColor %31 +OpBranch %25 +%25 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(assembly, assembly, true, + true); +} + +TEST_F(LocalSingleStoreElimTest, OptInitializedVariableLikeStore) { + // Initialized variable f is optimized like it was a store. + // Note: The SPIR-V was edited to turn the store to f to an + // an initialization. + // + // #version 140 + // + // void main() + // { + // float f = 0.0; + // gl_FragColor = vec4(f); + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %f "f" +OpName %gl_FragColor "gl_FragColor" +OpDecorate %gl_FragColor Location 0 +%void = OpTypeVoid +%6 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %6 +%12 = OpLabel +%f = OpVariable %_ptr_Function_float Function %float_0 +%13 = OpLoad %float %f +%14 = OpCompositeConstruct %v4float %13 %13 %13 %13 +OpStore %gl_FragColor %14 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %6 +%12 = OpLabel +%f = OpVariable %_ptr_Function_float Function %float_0 +%13 = OpLoad %float %f +%14 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %float_0 +OpStore %gl_FragColor %14 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSingleStoreElimTest, PointerVariable) { + // Test that checks if a pointer variable is removed. + + const std::string before = + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %1 "main" %2 +OpExecutionMode %1 OriginUpperLeft +OpMemberDecorate %_struct_3 0 Offset 0 +OpDecorate %_runtimearr__struct_3 ArrayStride 16 +OpMemberDecorate %_struct_5 0 Offset 0 +OpDecorate %_struct_5 BufferBlock +OpMemberDecorate %_struct_6 0 Offset 0 +OpDecorate %_struct_6 BufferBlock +OpDecorate %2 Location 0 +OpDecorate %7 DescriptorSet 0 +OpDecorate %7 Binding 0 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%uint = OpTypeInt 32 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float +%_struct_3 = OpTypeStruct %v4float +%_runtimearr__struct_3 = OpTypeRuntimeArray %_struct_3 +%_struct_5 = OpTypeStruct %_runtimearr__struct_3 +%_ptr_Uniform__struct_5 = OpTypePointer Uniform %_struct_5 +%_struct_6 = OpTypeStruct %int +%_ptr_Uniform__struct_6 = OpTypePointer Uniform %_struct_6 +%_ptr_Function__ptr_Uniform__struct_5 = OpTypePointer Function %_ptr_Uniform__struct_5 +%_ptr_Function__ptr_Uniform__struct_6 = OpTypePointer Function %_ptr_Uniform__struct_6 +%int_0 = OpConstant %int 0 +%uint_0 = OpConstant %uint 0 +%2 = OpVariable %_ptr_Output_v4float Output +%7 = OpVariable %_ptr_Uniform__struct_5 Uniform +%1 = OpFunction %void None %10 +%23 = OpLabel +%24 = OpVariable %_ptr_Function__ptr_Uniform__struct_5 Function +OpStore %24 %7 +%26 = OpLoad %_ptr_Uniform__struct_5 %24 +%27 = OpAccessChain %_ptr_Uniform_v4float %26 %int_0 %uint_0 %int_0 +%28 = OpLoad %v4float %27 +%29 = OpCopyObject %v4float %28 +OpStore %2 %28 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %1 "main" %2 +OpExecutionMode %1 OriginUpperLeft +OpMemberDecorate %_struct_3 0 Offset 0 +OpDecorate %_runtimearr__struct_3 ArrayStride 16 +OpMemberDecorate %_struct_5 0 Offset 0 +OpDecorate %_struct_5 BufferBlock +OpMemberDecorate %_struct_6 0 Offset 0 +OpDecorate %_struct_6 BufferBlock +OpDecorate %2 Location 0 +OpDecorate %7 DescriptorSet 0 +OpDecorate %7 Binding 0 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%uint = OpTypeInt 32 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float +%_struct_3 = OpTypeStruct %v4float +%_runtimearr__struct_3 = OpTypeRuntimeArray %_struct_3 +%_struct_5 = OpTypeStruct %_runtimearr__struct_3 +%_ptr_Uniform__struct_5 = OpTypePointer Uniform %_struct_5 +%_struct_6 = OpTypeStruct %int +%_ptr_Uniform__struct_6 = OpTypePointer Uniform %_struct_6 +%_ptr_Function__ptr_Uniform__struct_5 = OpTypePointer Function %_ptr_Uniform__struct_5 +%_ptr_Function__ptr_Uniform__struct_6 = OpTypePointer Function %_ptr_Uniform__struct_6 +%int_0 = OpConstant %int 0 +%uint_0 = OpConstant %uint 0 +%2 = OpVariable %_ptr_Output_v4float Output +%7 = OpVariable %_ptr_Uniform__struct_5 Uniform +%1 = OpFunction %void None %10 +%23 = OpLabel +%24 = OpVariable %_ptr_Function__ptr_Uniform__struct_5 Function +OpStore %24 %7 +%26 = OpLoad %_ptr_Uniform__struct_5 %24 +%27 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0 %uint_0 %int_0 +%28 = OpLoad %v4float %27 +%29 = OpCopyObject %v4float %28 +OpStore %2 %28 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(before, after, true, + true); +} + +// TODO(greg-lunarg): Add tests to verify handling of these cases: +// +// Other types +// Others? + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/local_ssa_elim_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/local_ssa_elim_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/local_ssa_elim_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/local_ssa_elim_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1732 @@ +// Copyright (c) 2017 Valve Corporation +// Copyright (c) 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. + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using LocalSSAElimTest = PassTest<::testing::Test>; + +TEST_F(LocalSSAElimTest, ForLoop) { + // #version 140 + // + // in vec4 BC; + // out float fo; + // + // void main() + // { + // float f = 0.0; + // for (int i=0; i<4; i++) { + // f = f + BC[i]; + // } + // fo = f; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BC %fo +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %f "f" +OpName %i "i" +OpName %BC "BC" +OpName %fo "fo" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_4 = OpConstant %int 4 +%bool = OpTypeBool +%v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BC = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float +%int_1 = OpConstant %int 1 +%_ptr_Output_float = OpTypePointer Output %float +%fo = OpVariable %_ptr_Output_float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %8 +%22 = OpLabel +%f = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +OpStore %f %float_0 +OpStore %i %int_0 +OpBranch %23 +%23 = OpLabel +OpLoopMerge %24 %25 None +OpBranch %26 +%26 = OpLabel +%27 = OpLoad %int %i +%28 = OpSLessThan %bool %27 %int_4 +OpBranchConditional %28 %29 %24 +%29 = OpLabel +%30 = OpLoad %float %f +%31 = OpLoad %int %i +%32 = OpAccessChain %_ptr_Input_float %BC %31 +%33 = OpLoad %float %32 +%34 = OpFAdd %float %30 %33 +OpStore %f %34 +OpBranch %25 +%25 = OpLabel +%35 = OpLoad %int %i +%36 = OpIAdd %int %35 %int_1 +OpStore %i %36 +OpBranch %23 +%24 = OpLabel +%37 = OpLoad %float %f +OpStore %fo %37 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %8 +%22 = OpLabel +%f = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +OpStore %f %float_0 +OpStore %i %int_0 +OpBranch %23 +%23 = OpLabel +%39 = OpPhi %float %float_0 %22 %34 %25 +%38 = OpPhi %int %int_0 %22 %36 %25 +OpLoopMerge %24 %25 None +OpBranch %26 +%26 = OpLabel +%28 = OpSLessThan %bool %38 %int_4 +OpBranchConditional %28 %29 %24 +%29 = OpLabel +%32 = OpAccessChain %_ptr_Input_float %BC %38 +%33 = OpLoad %float %32 +%34 = OpFAdd %float %39 %33 +OpStore %f %34 +OpBranch %25 +%25 = OpLabel +%36 = OpIAdd %int %38 %int_1 +OpStore %i %36 +OpBranch %23 +%24 = OpLabel +OpStore %fo %39 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSSAElimTest, NestedForLoop) { + // #version 450 + // + // layout (location=0) in mat4 BC; + // layout (location=0) out float fo; + // + // void main() + // { + // float f = 0.0; + // for (int i=0; i<4; i++) + // for (int j=0; j<4; j++) + // f = f + BC[i][j]; + // fo = f; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BC %fo +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %f "f" +OpName %i "i" +OpName %j "j" +OpName %BC "BC" +OpName %fo "fo" +OpDecorate %BC Location 0 +OpDecorate %fo Location 0 +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_4 = OpConstant %int 4 +%bool = OpTypeBool +%v4float = OpTypeVector %float 4 +%mat4v4float = OpTypeMatrix %v4float 4 +%_ptr_Input_mat4v4float = OpTypePointer Input %mat4v4float +%BC = OpVariable %_ptr_Input_mat4v4float Input +%_ptr_Input_float = OpTypePointer Input %float +%int_1 = OpConstant %int 1 +%_ptr_Output_float = OpTypePointer Output %float +%fo = OpVariable %_ptr_Output_float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %9 +%24 = OpLabel +%f = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +%j = OpVariable %_ptr_Function_int Function +OpStore %f %float_0 +OpStore %i %int_0 +OpBranch %25 +%25 = OpLabel +%26 = OpLoad %int %i +%27 = OpSLessThan %bool %26 %int_4 +OpLoopMerge %28 %29 None +OpBranchConditional %27 %30 %28 +%30 = OpLabel +OpStore %j %int_0 +OpBranch %31 +%31 = OpLabel +%32 = OpLoad %int %j +%33 = OpSLessThan %bool %32 %int_4 +OpLoopMerge %29 %34 None +OpBranchConditional %33 %34 %29 +%34 = OpLabel +%35 = OpLoad %float %f +%36 = OpLoad %int %i +%37 = OpLoad %int %j +%38 = OpAccessChain %_ptr_Input_float %BC %36 %37 +%39 = OpLoad %float %38 +%40 = OpFAdd %float %35 %39 +OpStore %f %40 +%41 = OpLoad %int %j +%42 = OpIAdd %int %41 %int_1 +OpStore %j %42 +OpBranch %31 +%29 = OpLabel +%43 = OpLoad %int %i +%44 = OpIAdd %int %43 %int_1 +OpStore %i %44 +OpBranch %25 +%28 = OpLabel +%45 = OpLoad %float %f +OpStore %fo %45 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %9 +%24 = OpLabel +%f = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +%j = OpVariable %_ptr_Function_int Function +OpStore %f %float_0 +OpStore %i %int_0 +OpBranch %25 +%25 = OpLabel +%47 = OpPhi %float %float_0 %24 %50 %29 +%46 = OpPhi %int %int_0 %24 %44 %29 +%27 = OpSLessThan %bool %46 %int_4 +OpLoopMerge %28 %29 None +OpBranchConditional %27 %30 %28 +%30 = OpLabel +OpStore %j %int_0 +OpBranch %31 +%31 = OpLabel +%50 = OpPhi %float %47 %30 %40 %34 +%48 = OpPhi %int %int_0 %30 %42 %34 +%33 = OpSLessThan %bool %48 %int_4 +OpLoopMerge %29 %34 None +OpBranchConditional %33 %34 %29 +%34 = OpLabel +%38 = OpAccessChain %_ptr_Input_float %BC %46 %48 +%39 = OpLoad %float %38 +%40 = OpFAdd %float %50 %39 +OpStore %f %40 +%42 = OpIAdd %int %48 %int_1 +OpStore %j %42 +OpBranch %31 +%29 = OpLabel +%44 = OpIAdd %int %46 %int_1 +OpStore %i %44 +OpBranch %25 +%28 = OpLabel +OpStore %fo %47 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSSAElimTest, ForLoopWithContinue) { + // #version 140 + // + // in vec4 BC; + // out float fo; + // + // void main() + // { + // float f = 0.0; + // for (int i=0; i<4; i++) { + // float t = BC[i]; + // if (t < 0.0) + // continue; + // f = f + t; + // } + // fo = f; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BC %fo +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +)"; + + const std::string names = + R"(OpName %main "main" +OpName %f "f" +OpName %i "i" +OpName %t "t" +OpName %BC "BC" +OpName %fo "fo" +)"; + + const std::string predefs2 = + R"(%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_4 = OpConstant %int 4 +%bool = OpTypeBool +%v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BC = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float +%int_1 = OpConstant %int 1 +%_ptr_Output_float = OpTypePointer Output %float +%fo = OpVariable %_ptr_Output_float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %9 +%23 = OpLabel +%f = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +%t = OpVariable %_ptr_Function_float Function +OpStore %f %float_0 +OpStore %i %int_0 +OpBranch %24 +%24 = OpLabel +OpLoopMerge %25 %26 None +OpBranch %27 +%27 = OpLabel +%28 = OpLoad %int %i +%29 = OpSLessThan %bool %28 %int_4 +OpBranchConditional %29 %30 %25 +%30 = OpLabel +%31 = OpLoad %int %i +%32 = OpAccessChain %_ptr_Input_float %BC %31 +%33 = OpLoad %float %32 +OpStore %t %33 +%34 = OpLoad %float %t +%35 = OpFOrdLessThan %bool %34 %float_0 +OpSelectionMerge %36 None +OpBranchConditional %35 %37 %36 +%37 = OpLabel +OpBranch %26 +%36 = OpLabel +%38 = OpLoad %float %f +%39 = OpLoad %float %t +%40 = OpFAdd %float %38 %39 +OpStore %f %40 +OpBranch %26 +%26 = OpLabel +%41 = OpLoad %int %i +%42 = OpIAdd %int %41 %int_1 +OpStore %i %42 +OpBranch %24 +%25 = OpLabel +%43 = OpLoad %float %f +OpStore %fo %43 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %9 +%23 = OpLabel +%f = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +%t = OpVariable %_ptr_Function_float Function +OpStore %f %float_0 +OpStore %i %int_0 +OpBranch %24 +%24 = OpLabel +%45 = OpPhi %float %float_0 %23 %47 %26 +%44 = OpPhi %int %int_0 %23 %42 %26 +OpLoopMerge %25 %26 None +OpBranch %27 +%27 = OpLabel +%29 = OpSLessThan %bool %44 %int_4 +OpBranchConditional %29 %30 %25 +%30 = OpLabel +%32 = OpAccessChain %_ptr_Input_float %BC %44 +%33 = OpLoad %float %32 +OpStore %t %33 +%35 = OpFOrdLessThan %bool %33 %float_0 +OpSelectionMerge %36 None +OpBranchConditional %35 %37 %36 +%37 = OpLabel +OpBranch %26 +%36 = OpLabel +%40 = OpFAdd %float %45 %33 +OpStore %f %40 +OpBranch %26 +%26 = OpLabel +%47 = OpPhi %float %45 %37 %40 %36 +%42 = OpIAdd %int %44 %int_1 +OpStore %i %42 +OpBranch %24 +%25 = OpLabel +OpStore %fo %45 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + names + predefs2 + before, predefs + names + predefs2 + after, + true, true); +} + +TEST_F(LocalSSAElimTest, ForLoopWithBreak) { + // #version 140 + // + // in vec4 BC; + // out float fo; + // + // void main() + // { + // float f = 0.0; + // for (int i=0; i<4; i++) { + // float t = f + BC[i]; + // if (t > 1.0) + // break; + // f = t; + // } + // fo = f; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BC %fo +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %f "f" +OpName %i "i" +OpName %t "t" +OpName %BC "BC" +OpName %fo "fo" +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_4 = OpConstant %int 4 +%bool = OpTypeBool +%v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BC = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float +%float_1 = OpConstant %float 1 +%int_1 = OpConstant %int 1 +%_ptr_Output_float = OpTypePointer Output %float +%fo = OpVariable %_ptr_Output_float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %9 +%24 = OpLabel +%f = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +%t = OpVariable %_ptr_Function_float Function +OpStore %f %float_0 +OpStore %i %int_0 +OpBranch %25 +%25 = OpLabel +OpLoopMerge %26 %27 None +OpBranch %28 +%28 = OpLabel +%29 = OpLoad %int %i +%30 = OpSLessThan %bool %29 %int_4 +OpBranchConditional %30 %31 %26 +%31 = OpLabel +%32 = OpLoad %float %f +%33 = OpLoad %int %i +%34 = OpAccessChain %_ptr_Input_float %BC %33 +%35 = OpLoad %float %34 +%36 = OpFAdd %float %32 %35 +OpStore %t %36 +%37 = OpLoad %float %t +%38 = OpFOrdGreaterThan %bool %37 %float_1 +OpSelectionMerge %39 None +OpBranchConditional %38 %40 %39 +%40 = OpLabel +OpBranch %26 +%39 = OpLabel +%41 = OpLoad %float %t +OpStore %f %41 +OpBranch %27 +%27 = OpLabel +%42 = OpLoad %int %i +%43 = OpIAdd %int %42 %int_1 +OpStore %i %43 +OpBranch %25 +%26 = OpLabel +%44 = OpLoad %float %f +OpStore %fo %44 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %9 +%24 = OpLabel +%f = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +%t = OpVariable %_ptr_Function_float Function +OpStore %f %float_0 +OpStore %i %int_0 +OpBranch %25 +%25 = OpLabel +%46 = OpPhi %float %float_0 %24 %36 %27 +%45 = OpPhi %int %int_0 %24 %43 %27 +OpLoopMerge %26 %27 None +OpBranch %28 +%28 = OpLabel +%30 = OpSLessThan %bool %45 %int_4 +OpBranchConditional %30 %31 %26 +%31 = OpLabel +%34 = OpAccessChain %_ptr_Input_float %BC %45 +%35 = OpLoad %float %34 +%36 = OpFAdd %float %46 %35 +OpStore %t %36 +%38 = OpFOrdGreaterThan %bool %36 %float_1 +OpSelectionMerge %39 None +OpBranchConditional %38 %40 %39 +%40 = OpLabel +OpBranch %26 +%39 = OpLabel +OpStore %f %36 +OpBranch %27 +%27 = OpLabel +%43 = OpIAdd %int %45 %int_1 +OpStore %i %43 +OpBranch %25 +%26 = OpLabel +OpStore %fo %46 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSSAElimTest, SwapProblem) { + // #version 140 + // + // in float fe; + // out float fo; + // + // void main() + // { + // float f1 = 0.0; + // float f2 = 1.0; + // int ie = int(fe); + // for (int i=0; i( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSSAElimTest, LostCopyProblem) { + // #version 140 + // + // in vec4 BC; + // out float fo; + // + // void main() + // { + // float f = 0.0; + // float t; + // for (int i=0; i<4; i++) { + // t = f; + // f = f + BC[i]; + // if (f > 1.0) + // break; + // } + // fo = t; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BC %fo +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %f "f" +OpName %i "i" +OpName %t "t" +OpName %BC "BC" +OpName %fo "fo" +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_4 = OpConstant %int 4 +%bool = OpTypeBool +%v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BC = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float +%float_1 = OpConstant %float 1 +%int_1 = OpConstant %int 1 +%_ptr_Output_float = OpTypePointer Output %float +%fo = OpVariable %_ptr_Output_float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %9 +%24 = OpLabel +%f = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +%t = OpVariable %_ptr_Function_float Function +OpStore %f %float_0 +OpStore %i %int_0 +OpBranch %25 +%25 = OpLabel +OpLoopMerge %26 %27 None +OpBranch %28 +%28 = OpLabel +%29 = OpLoad %int %i +%30 = OpSLessThan %bool %29 %int_4 +OpBranchConditional %30 %31 %26 +%31 = OpLabel +%32 = OpLoad %float %f +OpStore %t %32 +%33 = OpLoad %float %f +%34 = OpLoad %int %i +%35 = OpAccessChain %_ptr_Input_float %BC %34 +%36 = OpLoad %float %35 +%37 = OpFAdd %float %33 %36 +OpStore %f %37 +%38 = OpLoad %float %f +%39 = OpFOrdGreaterThan %bool %38 %float_1 +OpSelectionMerge %40 None +OpBranchConditional %39 %41 %40 +%41 = OpLabel +OpBranch %26 +%40 = OpLabel +OpBranch %27 +%27 = OpLabel +%42 = OpLoad %int %i +%43 = OpIAdd %int %42 %int_1 +OpStore %i %43 +OpBranch %25 +%26 = OpLabel +%44 = OpLoad %float %t +OpStore %fo %44 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%49 = OpUndef %float +%main = OpFunction %void None %9 +%24 = OpLabel +%f = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +%t = OpVariable %_ptr_Function_float Function +OpStore %f %float_0 +OpStore %i %int_0 +OpBranch %25 +%25 = OpLabel +%46 = OpPhi %float %float_0 %24 %37 %27 +%45 = OpPhi %int %int_0 %24 %43 %27 +%48 = OpPhi %float %49 %24 %46 %27 +OpLoopMerge %26 %27 None +OpBranch %28 +%28 = OpLabel +%30 = OpSLessThan %bool %45 %int_4 +OpBranchConditional %30 %31 %26 +%31 = OpLabel +OpStore %t %46 +%35 = OpAccessChain %_ptr_Input_float %BC %45 +%36 = OpLoad %float %35 +%37 = OpFAdd %float %46 %36 +OpStore %f %37 +%39 = OpFOrdGreaterThan %bool %37 %float_1 +OpSelectionMerge %40 None +OpBranchConditional %39 %41 %40 +%41 = OpLabel +OpBranch %26 +%40 = OpLabel +OpBranch %27 +%27 = OpLabel +%43 = OpIAdd %int %45 %int_1 +OpStore %i %43 +OpBranch %25 +%26 = OpLabel +%47 = OpPhi %float %48 %28 %46 %41 +OpStore %fo %47 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSSAElimTest, IfThenElse) { + // #version 140 + // + // in vec4 BaseColor; + // in float f; + // + // void main() + // { + // vec4 v; + // if (f >= 0) + // v = BaseColor * 0.5; + // else + // v = BaseColor + vec4(1.0,1.0,1.0,1.0); + // gl_FragColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %f %BaseColor %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %f "f" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Input_float = OpTypePointer Input %float +%f = OpVariable %_ptr_Input_float Input +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%float_0_5 = OpConstant %float 0.5 +%float_1 = OpConstant %float 1 +%18 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %8 +%20 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%21 = OpLoad %float %f +%22 = OpFOrdGreaterThanEqual %bool %21 %float_0 +OpSelectionMerge %23 None +OpBranchConditional %22 %24 %25 +%24 = OpLabel +%26 = OpLoad %v4float %BaseColor +%27 = OpVectorTimesScalar %v4float %26 %float_0_5 +OpStore %v %27 +OpBranch %23 +%25 = OpLabel +%28 = OpLoad %v4float %BaseColor +%29 = OpFAdd %v4float %28 %18 +OpStore %v %29 +OpBranch %23 +%23 = OpLabel +%30 = OpLoad %v4float %v +OpStore %gl_FragColor %30 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %8 +%20 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%21 = OpLoad %float %f +%22 = OpFOrdGreaterThanEqual %bool %21 %float_0 +OpSelectionMerge %23 None +OpBranchConditional %22 %24 %25 +%24 = OpLabel +%26 = OpLoad %v4float %BaseColor +%27 = OpVectorTimesScalar %v4float %26 %float_0_5 +OpStore %v %27 +OpBranch %23 +%25 = OpLabel +%28 = OpLoad %v4float %BaseColor +%29 = OpFAdd %v4float %28 %18 +OpStore %v %29 +OpBranch %23 +%23 = OpLabel +%31 = OpPhi %v4float %27 %24 %29 %25 +OpStore %gl_FragColor %31 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSSAElimTest, IfThen) { + // #version 140 + // + // in vec4 BaseColor; + // in float f; + // + // void main() + // { + // vec4 v = BaseColor; + // if (f <= 0) + // v = v * 0.5; + // gl_FragColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %f %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %f "f" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float +%f = OpVariable %_ptr_Input_float Input +%float_0 = OpConstant %float 0 +%bool = OpTypeBool +%float_0_5 = OpConstant %float 0.5 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %8 +%18 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%19 = OpLoad %v4float %BaseColor +OpStore %v %19 +%20 = OpLoad %float %f +%21 = OpFOrdLessThanEqual %bool %20 %float_0 +OpSelectionMerge %22 None +OpBranchConditional %21 %23 %22 +%23 = OpLabel +%24 = OpLoad %v4float %v +%25 = OpVectorTimesScalar %v4float %24 %float_0_5 +OpStore %v %25 +OpBranch %22 +%22 = OpLabel +%26 = OpLoad %v4float %v +OpStore %gl_FragColor %26 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %8 +%18 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%19 = OpLoad %v4float %BaseColor +OpStore %v %19 +%20 = OpLoad %float %f +%21 = OpFOrdLessThanEqual %bool %20 %float_0 +OpSelectionMerge %22 None +OpBranchConditional %21 %23 %22 +%23 = OpLabel +%25 = OpVectorTimesScalar %v4float %19 %float_0_5 +OpStore %v %25 +OpBranch %22 +%22 = OpLabel +%27 = OpPhi %v4float %19 %18 %25 %23 +OpStore %gl_FragColor %27 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSSAElimTest, Switch) { + // #version 140 + // + // in vec4 BaseColor; + // in float f; + // + // void main() + // { + // vec4 v = BaseColor; + // int i = int(f); + // switch (i) { + // case 0: + // v = v * 0.25; + // break; + // case 1: + // v = v * 0.625; + // break; + // case 2: + // v = v * 0.75; + // break; + // default: + // break; + // } + // gl_FragColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %f %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %i "i" +OpName %f "f" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%_ptr_Input_float = OpTypePointer Input %float +%f = OpVariable %_ptr_Input_float Input +%float_0_25 = OpConstant %float 0.25 +%float_0_625 = OpConstant %float 0.625 +%float_0_75 = OpConstant %float 0.75 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %9 +%21 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%i = OpVariable %_ptr_Function_int Function +%22 = OpLoad %v4float %BaseColor +OpStore %v %22 +%23 = OpLoad %float %f +%24 = OpConvertFToS %int %23 +OpStore %i %24 +%25 = OpLoad %int %i +OpSelectionMerge %26 None +OpSwitch %25 %27 0 %28 1 %29 2 %30 +%27 = OpLabel +OpBranch %26 +%28 = OpLabel +%31 = OpLoad %v4float %v +%32 = OpVectorTimesScalar %v4float %31 %float_0_25 +OpStore %v %32 +OpBranch %26 +%29 = OpLabel +%33 = OpLoad %v4float %v +%34 = OpVectorTimesScalar %v4float %33 %float_0_625 +OpStore %v %34 +OpBranch %26 +%30 = OpLabel +%35 = OpLoad %v4float %v +%36 = OpVectorTimesScalar %v4float %35 %float_0_75 +OpStore %v %36 +OpBranch %26 +%26 = OpLabel +%37 = OpLoad %v4float %v +OpStore %gl_FragColor %37 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %9 +%21 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%i = OpVariable %_ptr_Function_int Function +%22 = OpLoad %v4float %BaseColor +OpStore %v %22 +%23 = OpLoad %float %f +%24 = OpConvertFToS %int %23 +OpStore %i %24 +OpSelectionMerge %26 None +OpSwitch %24 %27 0 %28 1 %29 2 %30 +%27 = OpLabel +OpBranch %26 +%28 = OpLabel +%32 = OpVectorTimesScalar %v4float %22 %float_0_25 +OpStore %v %32 +OpBranch %26 +%29 = OpLabel +%34 = OpVectorTimesScalar %v4float %22 %float_0_625 +OpStore %v %34 +OpBranch %26 +%30 = OpLabel +%36 = OpVectorTimesScalar %v4float %22 %float_0_75 +OpStore %v %36 +OpBranch %26 +%26 = OpLabel +%38 = OpPhi %v4float %22 %27 %32 %28 %34 %29 %36 %30 +OpStore %gl_FragColor %38 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSSAElimTest, SwitchWithFallThrough) { + // #version 140 + // + // in vec4 BaseColor; + // in float f; + // + // void main() + // { + // vec4 v = BaseColor; + // int i = int(f); + // switch (i) { + // case 0: + // v = v * 0.25; + // break; + // case 1: + // v = v + 0.25; + // case 2: + // v = v * 0.75; + // break; + // default: + // break; + // } + // gl_FragColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BaseColor %f %gl_FragColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %v "v" +OpName %BaseColor "BaseColor" +OpName %i "i" +OpName %f "f" +OpName %gl_FragColor "gl_FragColor" +%void = OpTypeVoid +%9 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BaseColor = OpVariable %_ptr_Input_v4float Input +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%_ptr_Input_float = OpTypePointer Input %float +%f = OpVariable %_ptr_Input_float Input +%float_0_25 = OpConstant %float 0.25 +%float_0_75 = OpConstant %float 0.75 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%gl_FragColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string before = + R"(%main = OpFunction %void None %9 +%20 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%i = OpVariable %_ptr_Function_int Function +%21 = OpLoad %v4float %BaseColor +OpStore %v %21 +%22 = OpLoad %float %f +%23 = OpConvertFToS %int %22 +OpStore %i %23 +%24 = OpLoad %int %i +OpSelectionMerge %25 None +OpSwitch %24 %26 0 %27 1 %28 2 %29 +%26 = OpLabel +OpBranch %25 +%27 = OpLabel +%30 = OpLoad %v4float %v +%31 = OpVectorTimesScalar %v4float %30 %float_0_25 +OpStore %v %31 +OpBranch %25 +%28 = OpLabel +%32 = OpLoad %v4float %v +%33 = OpCompositeConstruct %v4float %float_0_25 %float_0_25 %float_0_25 %float_0_25 +%34 = OpFAdd %v4float %32 %33 +OpStore %v %34 +OpBranch %29 +%29 = OpLabel +%35 = OpLoad %v4float %v +%36 = OpVectorTimesScalar %v4float %35 %float_0_75 +OpStore %v %36 +OpBranch %25 +%25 = OpLabel +%37 = OpLoad %v4float %v +OpStore %gl_FragColor %37 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(%main = OpFunction %void None %9 +%20 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function +%i = OpVariable %_ptr_Function_int Function +%21 = OpLoad %v4float %BaseColor +OpStore %v %21 +%22 = OpLoad %float %f +%23 = OpConvertFToS %int %22 +OpStore %i %23 +OpSelectionMerge %25 None +OpSwitch %23 %26 0 %27 1 %28 2 %29 +%26 = OpLabel +OpBranch %25 +%27 = OpLabel +%31 = OpVectorTimesScalar %v4float %21 %float_0_25 +OpStore %v %31 +OpBranch %25 +%28 = OpLabel +%33 = OpCompositeConstruct %v4float %float_0_25 %float_0_25 %float_0_25 %float_0_25 +%34 = OpFAdd %v4float %21 %33 +OpStore %v %34 +OpBranch %29 +%29 = OpLabel +%38 = OpPhi %v4float %21 %20 %34 %28 +%36 = OpVectorTimesScalar %v4float %38 %float_0_75 +OpStore %v %36 +OpBranch %25 +%25 = OpLabel +%39 = OpPhi %v4float %21 %26 %31 %27 %36 %29 +OpStore %gl_FragColor %39 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + before, predefs + after, true, true); +} + +TEST_F(LocalSSAElimTest, DontPatchPhiInLoopHeaderThatIsNotAVar) { + // From https://github.com/KhronosGroup/SPIRV-Tools/issues/826 + // Don't try patching the (%16 %7) value/predecessor pair in the OpPhi. + // That OpPhi is unrelated to this optimization: we did not set that up + // in the SSA initialization for the loop header block. + // The pass should be a no-op on this module. + + const std::string before = R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %1 "main" +%void = OpTypeVoid +%3 = OpTypeFunction %void +%float = OpTypeFloat 32 +%float_1 = OpConstant %float 1 +%1 = OpFunction %void None %3 +%6 = OpLabel +OpBranch %7 +%7 = OpLabel +%8 = OpPhi %float %float_1 %6 %9 %7 +%9 = OpFAdd %float %8 %float_1 +OpLoopMerge %10 %7 None +OpBranch %7 +%10 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(before, before, true, + true); +} + +TEST_F(LocalSSAElimTest, OptInitializedVariableLikeStore) { + // Note: SPIR-V edited to change store to v into variable initialization + // + // #version 450 + // + // layout (location=0) in vec4 iColor; + // layout (location=1) in float fi; + // layout (location=0) out vec4 oColor; + // + // void main() + // { + // vec4 v = vec4(0.0); + // if (fi < 0.0) + // v.x = iColor.x; + // oColor = v; + // } + + const std::string predefs = + R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %fi %iColor %oColor +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 450 +OpName %main "main" +OpName %v "v" +OpName %fi "fi" +OpName %iColor "iColor" +OpName %oColor "oColor" +OpDecorate %fi Location 1 +OpDecorate %iColor Location 0 +OpDecorate %oColor Location 0 +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float +%float_0 = OpConstant %float 0 +%13 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%_ptr_Input_float = OpTypePointer Input %float +%fi = OpVariable %_ptr_Input_float Input +%bool = OpTypeBool +%_ptr_Input_v4float = OpTypePointer Input %v4float +%iColor = OpVariable %_ptr_Input_v4float Input +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%_ptr_Function_float = OpTypePointer Function %float +%_ptr_Output_v4float = OpTypePointer Output %v4float +%oColor = OpVariable %_ptr_Output_v4float Output +)"; + + const std::string func_before = + R"(%main = OpFunction %void None %8 +%21 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function %13 +%22 = OpLoad %float %fi +%23 = OpFOrdLessThan %bool %22 %float_0 +OpSelectionMerge %24 None +OpBranchConditional %23 %25 %24 +%25 = OpLabel +%26 = OpAccessChain %_ptr_Input_float %iColor %uint_0 +%27 = OpLoad %float %26 +%28 = OpLoad %v4float %v +%29 = OpCompositeInsert %v4float %27 %28 0 +OpStore %v %29 +OpBranch %24 +%24 = OpLabel +%30 = OpLoad %v4float %v +OpStore %oColor %30 +OpReturn +OpFunctionEnd +)"; + + const std::string func_after = + R"(%main = OpFunction %void None %8 +%21 = OpLabel +%v = OpVariable %_ptr_Function_v4float Function %13 +%22 = OpLoad %float %fi +%23 = OpFOrdLessThan %bool %22 %float_0 +OpSelectionMerge %24 None +OpBranchConditional %23 %25 %24 +%25 = OpLabel +%26 = OpAccessChain %_ptr_Input_float %iColor %uint_0 +%27 = OpLoad %float %26 +%29 = OpCompositeInsert %v4float %27 %13 0 +OpStore %v %29 +OpBranch %24 +%24 = OpLabel +%31 = OpPhi %v4float %13 %21 %29 %25 +OpStore %oColor %31 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck( + predefs + func_before, predefs + func_after, true, true); +} + +TEST_F(LocalSSAElimTest, PointerVariable) { + // Test that checks if a pointer variable is removed. + + const std::string before = + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %1 "main" %2 +OpExecutionMode %1 OriginUpperLeft +OpMemberDecorate %_struct_3 0 Offset 0 +OpDecorate %_runtimearr__struct_3 ArrayStride 16 +OpMemberDecorate %_struct_5 0 Offset 0 +OpDecorate %_struct_5 BufferBlock +OpMemberDecorate %_struct_6 0 Offset 0 +OpDecorate %_struct_6 BufferBlock +OpDecorate %2 Location 0 +OpDecorate %7 DescriptorSet 0 +OpDecorate %7 Binding 0 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%uint = OpTypeInt 32 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float +%_struct_3 = OpTypeStruct %v4float +%_runtimearr__struct_3 = OpTypeRuntimeArray %_struct_3 +%_struct_5 = OpTypeStruct %_runtimearr__struct_3 +%_ptr_Uniform__struct_5 = OpTypePointer Uniform %_struct_5 +%_struct_6 = OpTypeStruct %int +%_ptr_Uniform__struct_6 = OpTypePointer Uniform %_struct_6 +%_ptr_Function__ptr_Uniform__struct_5 = OpTypePointer Function %_ptr_Uniform__struct_5 +%_ptr_Function__ptr_Uniform__struct_6 = OpTypePointer Function %_ptr_Uniform__struct_6 +%int_0 = OpConstant %int 0 +%uint_0 = OpConstant %uint 0 +%2 = OpVariable %_ptr_Output_v4float Output +%7 = OpVariable %_ptr_Uniform__struct_5 Uniform +%1 = OpFunction %void None %10 +%23 = OpLabel +%24 = OpVariable %_ptr_Function__ptr_Uniform__struct_5 Function +OpStore %24 %7 +%26 = OpLoad %_ptr_Uniform__struct_5 %24 +%27 = OpAccessChain %_ptr_Uniform_v4float %26 %int_0 %uint_0 %int_0 +%28 = OpLoad %v4float %27 +%29 = OpCopyObject %v4float %28 +OpStore %2 %28 +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %1 "main" %2 +OpExecutionMode %1 OriginUpperLeft +OpMemberDecorate %_struct_3 0 Offset 0 +OpDecorate %_runtimearr__struct_3 ArrayStride 16 +OpMemberDecorate %_struct_5 0 Offset 0 +OpDecorate %_struct_5 BufferBlock +OpMemberDecorate %_struct_6 0 Offset 0 +OpDecorate %_struct_6 BufferBlock +OpDecorate %2 Location 0 +OpDecorate %7 DescriptorSet 0 +OpDecorate %7 Binding 0 +%void = OpTypeVoid +%10 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%uint = OpTypeInt 32 0 +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float +%_struct_3 = OpTypeStruct %v4float +%_runtimearr__struct_3 = OpTypeRuntimeArray %_struct_3 +%_struct_5 = OpTypeStruct %_runtimearr__struct_3 +%_ptr_Uniform__struct_5 = OpTypePointer Uniform %_struct_5 +%_struct_6 = OpTypeStruct %int +%_ptr_Uniform__struct_6 = OpTypePointer Uniform %_struct_6 +%_ptr_Function__ptr_Uniform__struct_5 = OpTypePointer Function %_ptr_Uniform__struct_5 +%_ptr_Function__ptr_Uniform__struct_6 = OpTypePointer Function %_ptr_Uniform__struct_6 +%int_0 = OpConstant %int 0 +%uint_0 = OpConstant %uint 0 +%2 = OpVariable %_ptr_Output_v4float Output +%7 = OpVariable %_ptr_Uniform__struct_5 Uniform +%1 = OpFunction %void None %10 +%23 = OpLabel +%24 = OpVariable %_ptr_Function__ptr_Uniform__struct_5 Function +OpStore %24 %7 +%27 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0 %uint_0 %int_0 +%28 = OpLoad %v4float %27 +%29 = OpCopyObject %v4float %28 +OpStore %2 %28 +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck(before, after, true, + true); +} + +TEST_F(LocalSSAElimTest, VerifyInstToBlockMap) { + // #version 140 + // + // in vec4 BC; + // out float fo; + // + // void main() + // { + // float f = 0.0; + // for (int i=0; i<4; i++) { + // f = f + BC[i]; + // } + // fo = f; + // } + + const std::string text = R"( +OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %BC %fo +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 140 +OpName %main "main" +OpName %f "f" +OpName %i "i" +OpName %BC "BC" +OpName %fo "fo" +%void = OpTypeVoid +%8 = OpTypeFunction %void +%float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_4 = OpConstant %int 4 +%bool = OpTypeBool +%v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%BC = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float +%int_1 = OpConstant %int 1 +%_ptr_Output_float = OpTypePointer Output %float +%fo = OpVariable %_ptr_Output_float Output +%main = OpFunction %void None %8 +%22 = OpLabel +%f = OpVariable %_ptr_Function_float Function +%i = OpVariable %_ptr_Function_int Function +OpStore %f %float_0 +OpStore %i %int_0 +OpBranch %23 +%23 = OpLabel +OpLoopMerge %24 %25 None +OpBranch %26 +%26 = OpLabel +%27 = OpLoad %int %i +%28 = OpSLessThan %bool %27 %int_4 +OpBranchConditional %28 %29 %24 +%29 = OpLabel +%30 = OpLoad %float %f +%31 = OpLoad %int %i +%32 = OpAccessChain %_ptr_Input_float %BC %31 +%33 = OpLoad %float %32 +%34 = OpFAdd %float %30 %33 +OpStore %f %34 +OpBranch %25 +%25 = OpLabel +%35 = OpLoad %int %i +%36 = OpIAdd %int %35 %int_1 +OpStore %i %36 +OpBranch %23 +%24 = OpLabel +%37 = OpLoad %float %f +OpStore %fo %37 +OpReturn +OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(nullptr, context); + + // Force the instruction to block mapping to get built. + context->get_instr_block(27u); + + auto pass = MakeUnique(); + pass->SetMessageConsumer(nullptr); + const auto status = pass->Run(context.get()); + EXPECT_TRUE(status == opt::Pass::Status::SuccessWithChange); +} + +// TODO(dneto): Add Effcee as required dependency, and make this unconditional. +#ifdef SPIRV_EFFCEE +TEST_F(LocalSSAElimTest, CompositeExtractProblem) { + const std::string spv_asm = R"( + OpCapability Tessellation + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint TessellationControl %2 "main" + %void = OpTypeVoid + %4 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %uint = OpTypeInt 32 0 + %uint_3 = OpConstant %uint 3 + %v3float = OpTypeVector %float 3 + %v2float = OpTypeVector %float 2 + %_struct_11 = OpTypeStruct %v4float %v4float %v4float %v3float %v3float %v2float %v2float +%_arr__struct_11_uint_3 = OpTypeArray %_struct_11 %uint_3 +%_ptr_Function__arr__struct_11_uint_3 = OpTypePointer Function %_arr__struct_11_uint_3 +%_arr_v4float_uint_3 = OpTypeArray %v4float %uint_3 +%_ptr_Input__arr_v4float_uint_3 = OpTypePointer Input %_arr_v4float_uint_3 + %16 = OpVariable %_ptr_Input__arr_v4float_uint_3 Input + %17 = OpVariable %_ptr_Input__arr_v4float_uint_3 Input + %18 = OpVariable %_ptr_Input__arr_v4float_uint_3 Input +%_ptr_Input_uint = OpTypePointer Input %uint + %20 = OpVariable %_ptr_Input_uint Input +%_ptr_Output__arr_v4float_uint_3 = OpTypePointer Output %_arr_v4float_uint_3 + %22 = OpVariable %_ptr_Output__arr_v4float_uint_3 Output +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_arr_v3float_uint_3 = OpTypeArray %v3float %uint_3 +%_ptr_Input__arr_v3float_uint_3 = OpTypePointer Input %_arr_v3float_uint_3 + %26 = OpVariable %_ptr_Input__arr_v3float_uint_3 Input + %27 = OpVariable %_ptr_Input__arr_v3float_uint_3 Input +%_arr_v2float_uint_3 = OpTypeArray %v2float %uint_3 +%_ptr_Input__arr_v2float_uint_3 = OpTypePointer Input %_arr_v2float_uint_3 + %30 = OpVariable %_ptr_Input__arr_v2float_uint_3 Input + %31 = OpVariable %_ptr_Input__arr_v2float_uint_3 Input +%_ptr_Function__struct_11 = OpTypePointer Function %_struct_11 + %2 = OpFunction %void None %4 + %33 = OpLabel + %34 = OpLoad %_arr_v4float_uint_3 %16 + %35 = OpLoad %_arr_v4float_uint_3 %17 + %36 = OpLoad %_arr_v4float_uint_3 %18 + %37 = OpLoad %_arr_v3float_uint_3 %26 + %38 = OpLoad %_arr_v3float_uint_3 %27 + %39 = OpLoad %_arr_v2float_uint_3 %30 + %40 = OpLoad %_arr_v2float_uint_3 %31 + %41 = OpCompositeExtract %v4float %34 0 + %42 = OpCompositeExtract %v4float %35 0 + %43 = OpCompositeExtract %v4float %36 0 + %44 = OpCompositeExtract %v3float %37 0 + %45 = OpCompositeExtract %v3float %38 0 + %46 = OpCompositeExtract %v2float %39 0 + %47 = OpCompositeExtract %v2float %40 0 + %48 = OpCompositeConstruct %_struct_11 %41 %42 %43 %44 %45 %46 %47 + %49 = OpCompositeExtract %v4float %34 1 + %50 = OpCompositeExtract %v4float %35 1 + %51 = OpCompositeExtract %v4float %36 1 + %52 = OpCompositeExtract %v3float %37 1 + %53 = OpCompositeExtract %v3float %38 1 + %54 = OpCompositeExtract %v2float %39 1 + %55 = OpCompositeExtract %v2float %40 1 + %56 = OpCompositeConstruct %_struct_11 %49 %50 %51 %52 %53 %54 %55 + %57 = OpCompositeExtract %v4float %34 2 + %58 = OpCompositeExtract %v4float %35 2 + %59 = OpCompositeExtract %v4float %36 2 + %60 = OpCompositeExtract %v3float %37 2 + %61 = OpCompositeExtract %v3float %38 2 + %62 = OpCompositeExtract %v2float %39 2 + %63 = OpCompositeExtract %v2float %40 2 + %64 = OpCompositeConstruct %_struct_11 %57 %58 %59 %60 %61 %62 %63 + %65 = OpCompositeConstruct %_arr__struct_11_uint_3 %48 %56 %64 + %66 = OpVariable %_ptr_Function__arr__struct_11_uint_3 Function + %67 = OpLoad %uint %20 + +; CHECK OpStore {{%\d+}} [[store_source:%\d+]] + OpStore %66 %65 + %68 = OpAccessChain %_ptr_Function__struct_11 %66 %67 + +; This load was being removed, because %_ptr_Function__struct_11 was being +; wrongfully considered an SSA target. +; CHECK OpLoad %_struct_11 %68 + %69 = OpLoad %_struct_11 %68 + +; Similarly, %69 cannot be replaced with %65. +; CHECK-NOT: OpCompositeExtract %v4float [[store_source]] 0 + %70 = OpCompositeExtract %v4float %69 0 + + %71 = OpAccessChain %_ptr_Output_v4float %22 %67 + OpStore %71 %70 + OpReturn + OpFunctionEnd)"; + + SinglePassRunAndMatch(spv_asm, true); +} +#endif + +// TODO(greg-lunarg): Add tests to verify handling of these cases: +// +// No optimization in the presence of +// access chains +// function calls +// OpCopyMemory? +// unsupported extensions +// Others? + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,92 @@ +# Copyright (c) 2017 Google 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. + + +add_spvtools_unittest(TARGET loop_descriptor_simple + SRCS ../function_utils.h + loop_descriptions.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET loop_descriptor_nested + SRCS ../function_utils.h + nested_loops.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET lcssa_test + SRCS ../function_utils.h + lcssa.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET licm_all_loop_types + SRCS ../function_utils.h + hoist_all_loop_types.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET licm_hoist_independent_loops + SRCS ../function_utils.h + hoist_from_independent_loops.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET licm_hoist_double_nested_loops + SRCS ../function_utils.h + hoist_double_nested_loops.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET licm_hoist_single_nested_loops + SRCS ../function_utils.h + hoist_single_nested_loops.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET licm_hoist_simple_case + SRCS ../function_utils.h + hoist_simple_case.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET licm_hoist_no_preheader + SRCS ../function_utils.h + hoist_without_preheader.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET loop_unroll_simple + SRCS ../function_utils.h + unroll_simple.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET loop_unroll_assumtion_checks + SRCS ../function_utils.h + unroll_assumptions.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET unswitch_test + SRCS ../function_utils.h + unswitch.cpp + LIBS SPIRV-Tools-opt +) + +add_spvtools_unittest(TARGET peeling_test + SRCS ../function_utils.h + peeling.cpp + LIBS SPIRV-Tools-opt +) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_all_loop_types.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_all_loop_types.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_all_loop_types.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_all_loop_types.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,284 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include + +#include "../pass_fixture.h" +#include "opt/licm_pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +/* + Tests that all loop types are handled appropriately by the LICM pass. + + Generated from the following GLSL fragment shader +--eliminate-local-multi-store has also been run on the spv binary +#version 440 core +void main(){ + int i_1 = 0; + for (i_1 = 0; i_1 < 10; i_1++) { + } + int i_2 = 0; + while (i_2 < 10) { + i_2++; + } + int i_3 = 0; + do { + i_3++; + } while (i_3 < 10); + int hoist = 0; + int i_4 = 0; + int i_5 = 0; + int i_6 = 0; + for (i_4 = 0; i_4 < 10; i_4++) { + while (i_5 < 10) { + do { + hoist = i_1 + i_2 + i_3; + i_6++; + } while (i_6 < 10); + i_5++; + } + } +} +*/ +TEST_F(PassClassTest, AllLoopTypes) { + const std::string before_hoist = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 440 +OpName %main "main" +%void = OpTypeVoid +%4 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%int_1 = OpConstant %int 1 +%main = OpFunction %void None %4 +%11 = OpLabel +OpBranch %12 +%12 = OpLabel +%13 = OpPhi %int %int_0 %11 %14 %15 +OpLoopMerge %16 %15 None +OpBranch %17 +%17 = OpLabel +%18 = OpSLessThan %bool %13 %int_10 +OpBranchConditional %18 %19 %16 +%19 = OpLabel +OpBranch %15 +%15 = OpLabel +%14 = OpIAdd %int %13 %int_1 +OpBranch %12 +%16 = OpLabel +OpBranch %20 +%20 = OpLabel +%21 = OpPhi %int %int_0 %16 %22 %23 +OpLoopMerge %24 %23 None +OpBranch %25 +%25 = OpLabel +%26 = OpSLessThan %bool %21 %int_10 +OpBranchConditional %26 %27 %24 +%27 = OpLabel +%22 = OpIAdd %int %21 %int_1 +OpBranch %23 +%23 = OpLabel +OpBranch %20 +%24 = OpLabel +OpBranch %28 +%28 = OpLabel +%29 = OpPhi %int %int_0 %24 %30 %31 +OpLoopMerge %32 %31 None +OpBranch %33 +%33 = OpLabel +%30 = OpIAdd %int %29 %int_1 +OpBranch %31 +%31 = OpLabel +%34 = OpSLessThan %bool %30 %int_10 +OpBranchConditional %34 %28 %32 +%32 = OpLabel +OpBranch %35 +%35 = OpLabel +%36 = OpPhi %int %int_0 %32 %37 %38 +%39 = OpPhi %int %int_0 %32 %40 %38 +%41 = OpPhi %int %int_0 %32 %42 %38 +%43 = OpPhi %int %int_0 %32 %44 %38 +OpLoopMerge %45 %38 None +OpBranch %46 +%46 = OpLabel +%47 = OpSLessThan %bool %39 %int_10 +OpBranchConditional %47 %48 %45 +%48 = OpLabel +OpBranch %49 +%49 = OpLabel +%37 = OpPhi %int %36 %48 %50 %51 +%42 = OpPhi %int %41 %48 %52 %51 +%44 = OpPhi %int %43 %48 %53 %51 +OpLoopMerge %54 %51 None +OpBranch %55 +%55 = OpLabel +%56 = OpSLessThan %bool %42 %int_10 +OpBranchConditional %56 %57 %54 +%57 = OpLabel +OpBranch %58 +%58 = OpLabel +%59 = OpPhi %int %37 %57 %50 %60 +%61 = OpPhi %int %44 %57 %53 %60 +OpLoopMerge %62 %60 None +OpBranch %63 +%63 = OpLabel +%64 = OpIAdd %int %13 %21 +%50 = OpIAdd %int %64 %30 +%53 = OpIAdd %int %61 %int_1 +OpBranch %60 +%60 = OpLabel +%65 = OpSLessThan %bool %53 %int_10 +OpBranchConditional %65 %58 %62 +%62 = OpLabel +%52 = OpIAdd %int %42 %int_1 +OpBranch %51 +%51 = OpLabel +OpBranch %49 +%54 = OpLabel +OpBranch %38 +%38 = OpLabel +%40 = OpIAdd %int %39 %int_1 +OpBranch %35 +%45 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after_hoist = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 440 +OpName %main "main" +%void = OpTypeVoid +%4 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%int_1 = OpConstant %int 1 +%main = OpFunction %void None %4 +%11 = OpLabel +OpBranch %12 +%12 = OpLabel +%13 = OpPhi %int %int_0 %11 %14 %15 +OpLoopMerge %16 %15 None +OpBranch %17 +%17 = OpLabel +%18 = OpSLessThan %bool %13 %int_10 +OpBranchConditional %18 %19 %16 +%19 = OpLabel +OpBranch %15 +%15 = OpLabel +%14 = OpIAdd %int %13 %int_1 +OpBranch %12 +%16 = OpLabel +OpBranch %20 +%20 = OpLabel +%21 = OpPhi %int %int_0 %16 %22 %23 +OpLoopMerge %24 %23 None +OpBranch %25 +%25 = OpLabel +%26 = OpSLessThan %bool %21 %int_10 +OpBranchConditional %26 %27 %24 +%27 = OpLabel +%22 = OpIAdd %int %21 %int_1 +OpBranch %23 +%23 = OpLabel +OpBranch %20 +%24 = OpLabel +OpBranch %28 +%28 = OpLabel +%29 = OpPhi %int %int_0 %24 %30 %31 +OpLoopMerge %32 %31 None +OpBranch %33 +%33 = OpLabel +%30 = OpIAdd %int %29 %int_1 +OpBranch %31 +%31 = OpLabel +%34 = OpSLessThan %bool %30 %int_10 +OpBranchConditional %34 %28 %32 +%32 = OpLabel +%64 = OpIAdd %int %13 %21 +%50 = OpIAdd %int %64 %30 +OpBranch %35 +%35 = OpLabel +%36 = OpPhi %int %int_0 %32 %37 %38 +%39 = OpPhi %int %int_0 %32 %40 %38 +%41 = OpPhi %int %int_0 %32 %42 %38 +%43 = OpPhi %int %int_0 %32 %44 %38 +OpLoopMerge %45 %38 None +OpBranch %46 +%46 = OpLabel +%47 = OpSLessThan %bool %39 %int_10 +OpBranchConditional %47 %48 %45 +%48 = OpLabel +OpBranch %49 +%49 = OpLabel +%37 = OpPhi %int %36 %48 %50 %51 +%42 = OpPhi %int %41 %48 %52 %51 +%44 = OpPhi %int %43 %48 %53 %51 +OpLoopMerge %54 %51 None +OpBranch %55 +%55 = OpLabel +%56 = OpSLessThan %bool %42 %int_10 +OpBranchConditional %56 %57 %54 +%57 = OpLabel +OpBranch %58 +%58 = OpLabel +%59 = OpPhi %int %37 %57 %50 %60 +%61 = OpPhi %int %44 %57 %53 %60 +OpLoopMerge %62 %60 None +OpBranch %63 +%63 = OpLabel +%53 = OpIAdd %int %61 %int_1 +OpBranch %60 +%60 = OpLabel +%65 = OpSLessThan %bool %53 %int_10 +OpBranchConditional %65 %58 %62 +%62 = OpLabel +%52 = OpIAdd %int %42 %int_1 +OpBranch %51 +%51 = OpLabel +OpBranch %49 +%54 = OpLabel +OpBranch %38 +%38 = OpLabel +%40 = OpIAdd %int %39 %int_1 +OpBranch %35 +%45 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(before_hoist, after_hoist, true); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_double_nested_loops.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_double_nested_loops.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_double_nested_loops.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_double_nested_loops.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,161 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include + +#include "../pass_fixture.h" +#include "opt/licm_pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +/* + Tests that the LICM pass will move invariants through multiple loops + + Generated from the following GLSL fragment shader +--eliminate-local-multi-store has also been run on the spv binary +#version 440 core +void main(){ + int a = 2; + int b = 1; + int hoist = 0; + for (int i = 0; i < 10; i++) { + for (int j = 0; j < 10; j++) { + // hoist 'hoist = a - b' out of both loops + hoist = a - b; + } + } +} +*/ +TEST_F(PassClassTest, NestedDoubleHoist) { + const std::string before_hoist = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 440 +OpName %main "main" +%void = OpTypeVoid +%4 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_2 = OpConstant %int 2 +%int_1 = OpConstant %int 1 +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%12 = OpUndef %int +%main = OpFunction %void None %4 +%13 = OpLabel +OpBranch %14 +%14 = OpLabel +%15 = OpPhi %int %int_0 %13 %16 %17 +%18 = OpPhi %int %int_0 %13 %19 %17 +%20 = OpPhi %int %12 %13 %21 %17 +OpLoopMerge %22 %17 None +OpBranch %23 +%23 = OpLabel +%24 = OpSLessThan %bool %18 %int_10 +OpBranchConditional %24 %25 %22 +%25 = OpLabel +OpBranch %26 +%26 = OpLabel +%16 = OpPhi %int %15 %25 %27 %28 +%21 = OpPhi %int %int_0 %25 %29 %28 +OpLoopMerge %30 %28 None +OpBranch %31 +%31 = OpLabel +%32 = OpSLessThan %bool %21 %int_10 +OpBranchConditional %32 %33 %30 +%33 = OpLabel +%27 = OpISub %int %int_2 %int_1 +OpBranch %28 +%28 = OpLabel +%29 = OpIAdd %int %21 %int_1 +OpBranch %26 +%30 = OpLabel +OpBranch %17 +%17 = OpLabel +%19 = OpIAdd %int %18 %int_1 +OpBranch %14 +%22 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after_hoist = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 440 +OpName %main "main" +%void = OpTypeVoid +%4 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_2 = OpConstant %int 2 +%int_1 = OpConstant %int 1 +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%12 = OpUndef %int +%main = OpFunction %void None %4 +%13 = OpLabel +%27 = OpISub %int %int_2 %int_1 +OpBranch %14 +%14 = OpLabel +%15 = OpPhi %int %int_0 %13 %16 %17 +%18 = OpPhi %int %int_0 %13 %19 %17 +%20 = OpPhi %int %12 %13 %21 %17 +OpLoopMerge %22 %17 None +OpBranch %23 +%23 = OpLabel +%24 = OpSLessThan %bool %18 %int_10 +OpBranchConditional %24 %25 %22 +%25 = OpLabel +OpBranch %26 +%26 = OpLabel +%16 = OpPhi %int %15 %25 %27 %28 +%21 = OpPhi %int %int_0 %25 %29 %28 +OpLoopMerge %30 %28 None +OpBranch %31 +%31 = OpLabel +%32 = OpSLessThan %bool %21 %int_10 +OpBranchConditional %32 %33 %30 +%33 = OpLabel +OpBranch %28 +%28 = OpLabel +%29 = OpIAdd %int %21 %int_1 +OpBranch %26 +%30 = OpLabel +OpBranch %17 +%17 = OpLabel +%19 = OpIAdd %int %18 %int_1 +OpBranch %14 +%22 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(before_hoist, after_hoist, true); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_from_independent_loops.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_from_independent_loops.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_from_independent_loops.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_from_independent_loops.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,200 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include + +#include "../pass_fixture.h" +#include "opt/licm_pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +/* + Tests that the LICM pass will analyse multiple independent loops in a function + + Generated from the following GLSL fragment shader +--eliminate-local-multi-store has also been run on the spv binary +#version 440 core +void main(){ + int a = 1; + int b = 2; + int hoist = 0; + for (int i = 0; i < 10; i++) { + // invariant + hoist = a + b; + } + for (int i = 0; i < 10; i++) { + // invariant + hoist = a + b; + } + int c = 1; + int d = 2; + int hoist2 = 0; + for (int i = 0; i < 10; i++) { + // invariant + hoist2 = c + d; + } +} +*/ +TEST_F(PassClassTest, HoistFromIndependentLoops) { + const std::string before_hoist = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 440 +OpName %main "main" +%void = OpTypeVoid +%4 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%main = OpFunction %void None %4 +%12 = OpLabel +OpBranch %13 +%13 = OpLabel +%14 = OpPhi %int %int_0 %12 %15 %16 +%17 = OpPhi %int %int_0 %12 %18 %16 +OpLoopMerge %19 %16 None +OpBranch %20 +%20 = OpLabel +%21 = OpSLessThan %bool %17 %int_10 +OpBranchConditional %21 %22 %19 +%22 = OpLabel +%15 = OpIAdd %int %int_1 %int_2 +OpBranch %16 +%16 = OpLabel +%18 = OpIAdd %int %17 %int_1 +OpBranch %13 +%19 = OpLabel +OpBranch %23 +%23 = OpLabel +%24 = OpPhi %int %14 %19 %25 %26 +%27 = OpPhi %int %int_0 %19 %28 %26 +OpLoopMerge %29 %26 None +OpBranch %30 +%30 = OpLabel +%31 = OpSLessThan %bool %27 %int_10 +OpBranchConditional %31 %32 %29 +%32 = OpLabel +%25 = OpIAdd %int %int_1 %int_2 +OpBranch %26 +%26 = OpLabel +%28 = OpIAdd %int %27 %int_1 +OpBranch %23 +%29 = OpLabel +OpBranch %33 +%33 = OpLabel +%34 = OpPhi %int %int_0 %29 %35 %36 +%37 = OpPhi %int %int_0 %29 %38 %36 +OpLoopMerge %39 %36 None +OpBranch %40 +%40 = OpLabel +%41 = OpSLessThan %bool %37 %int_10 +OpBranchConditional %41 %42 %39 +%42 = OpLabel +%35 = OpIAdd %int %int_1 %int_2 +OpBranch %36 +%36 = OpLabel +%38 = OpIAdd %int %37 %int_1 +OpBranch %33 +%39 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after_hoist = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 440 +OpName %main "main" +%void = OpTypeVoid +%4 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%main = OpFunction %void None %4 +%12 = OpLabel +%15 = OpIAdd %int %int_1 %int_2 +OpBranch %13 +%13 = OpLabel +%14 = OpPhi %int %int_0 %12 %15 %16 +%17 = OpPhi %int %int_0 %12 %18 %16 +OpLoopMerge %19 %16 None +OpBranch %20 +%20 = OpLabel +%21 = OpSLessThan %bool %17 %int_10 +OpBranchConditional %21 %22 %19 +%22 = OpLabel +OpBranch %16 +%16 = OpLabel +%18 = OpIAdd %int %17 %int_1 +OpBranch %13 +%19 = OpLabel +%25 = OpIAdd %int %int_1 %int_2 +OpBranch %23 +%23 = OpLabel +%24 = OpPhi %int %14 %19 %25 %26 +%27 = OpPhi %int %int_0 %19 %28 %26 +OpLoopMerge %29 %26 None +OpBranch %30 +%30 = OpLabel +%31 = OpSLessThan %bool %27 %int_10 +OpBranchConditional %31 %32 %29 +%32 = OpLabel +OpBranch %26 +%26 = OpLabel +%28 = OpIAdd %int %27 %int_1 +OpBranch %23 +%29 = OpLabel +%35 = OpIAdd %int %int_1 %int_2 +OpBranch %33 +%33 = OpLabel +%34 = OpPhi %int %int_0 %29 %35 %36 +%37 = OpPhi %int %int_0 %29 %38 %36 +OpLoopMerge %39 %36 None +OpBranch %40 +%40 = OpLabel +%41 = OpSLessThan %bool %37 %int_10 +OpBranchConditional %41 %42 %39 +%42 = OpLabel +OpBranch %36 +%36 = OpLabel +%38 = OpIAdd %int %37 %int_1 +OpBranch %33 +%39 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(before_hoist, after_hoist, true); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_simple_case.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_simple_case.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_simple_case.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_simple_case.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,125 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include + +#include "../pass_fixture.h" +#include "opt/licm_pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +/* + A simple test for the LICM pass + + Generated from the following GLSL fragment shader +--eliminate-local-multi-store has also been run on the spv binary +#version 440 core +void main(){ + int a = 1; + int b = 2; + int hoist = 0; + for (int i = 0; i < 10; i++) { + // invariant + hoist = a + b; + } +} +*/ +TEST_F(PassClassTest, SimpleHoist) { + const std::string before_hoist = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 440 +OpName %main "main" +%void = OpTypeVoid +%4 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%main = OpFunction %void None %4 +%12 = OpLabel +OpBranch %13 +%13 = OpLabel +%14 = OpPhi %int %int_0 %12 %15 %16 +%17 = OpPhi %int %int_0 %12 %18 %16 +OpLoopMerge %19 %16 None +OpBranch %20 +%20 = OpLabel +%21 = OpSLessThan %bool %17 %int_10 +OpBranchConditional %21 %22 %19 +%22 = OpLabel +%15 = OpIAdd %int %int_1 %int_2 +OpBranch %16 +%16 = OpLabel +%18 = OpIAdd %int %17 %int_1 +OpBranch %13 +%19 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after_hoist = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 440 +OpName %main "main" +%void = OpTypeVoid +%4 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%main = OpFunction %void None %4 +%12 = OpLabel +%15 = OpIAdd %int %int_1 %int_2 +OpBranch %13 +%13 = OpLabel +%14 = OpPhi %int %int_0 %12 %15 %16 +%17 = OpPhi %int %int_0 %12 %18 %16 +OpLoopMerge %19 %16 None +OpBranch %20 +%20 = OpLabel +%21 = OpSLessThan %bool %17 %int_10 +OpBranchConditional %21 %22 %19 +%22 = OpLabel +OpBranch %16 +%16 = OpLabel +%18 = OpIAdd %int %17 %int_1 +OpBranch %13 +%19 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(before_hoist, after_hoist, true); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_single_nested_loops.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_single_nested_loops.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_single_nested_loops.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_single_nested_loops.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,161 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include + +#include "../pass_fixture.h" +#include "opt/licm_pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +/* + Tests that the LICM pass will detect an move an invariant from a nested loop, + but not it's parent loop + + Generated from the following GLSL fragment shader +--eliminate-local-multi-store has also been run on the spv binary +#version 440 core +void main(){ + int a = 2; + int hoist = 0; + for (int i = 0; i < 10; i++) { + for (int j = 0; j < 10; j++) { + // hoist 'hoist = a - i' out of j loop, but not i loop + hoist = a - i; + } + } +} +*/ +TEST_F(PassClassTest, NestedSingleHoist) { + const std::string before_hoist = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 440 +OpName %main "main" +%void = OpTypeVoid +%4 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_2 = OpConstant %int 2 +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%int_1 = OpConstant %int 1 +%12 = OpUndef %int +%main = OpFunction %void None %4 +%13 = OpLabel +OpBranch %14 +%14 = OpLabel +%15 = OpPhi %int %int_0 %13 %16 %17 +%18 = OpPhi %int %int_0 %13 %19 %17 +%20 = OpPhi %int %12 %13 %21 %17 +OpLoopMerge %22 %17 None +OpBranch %23 +%23 = OpLabel +%24 = OpSLessThan %bool %18 %int_10 +OpBranchConditional %24 %25 %22 +%25 = OpLabel +OpBranch %26 +%26 = OpLabel +%16 = OpPhi %int %15 %25 %27 %28 +%21 = OpPhi %int %int_0 %25 %29 %28 +OpLoopMerge %30 %28 None +OpBranch %31 +%31 = OpLabel +%32 = OpSLessThan %bool %21 %int_10 +OpBranchConditional %32 %33 %30 +%33 = OpLabel +%27 = OpISub %int %int_2 %18 +OpBranch %28 +%28 = OpLabel +%29 = OpIAdd %int %21 %int_1 +OpBranch %26 +%30 = OpLabel +OpBranch %17 +%17 = OpLabel +%19 = OpIAdd %int %18 %int_1 +OpBranch %14 +%22 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after_hoist = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 440 +OpName %main "main" +%void = OpTypeVoid +%4 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_2 = OpConstant %int 2 +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%int_1 = OpConstant %int 1 +%12 = OpUndef %int +%main = OpFunction %void None %4 +%13 = OpLabel +OpBranch %14 +%14 = OpLabel +%15 = OpPhi %int %int_0 %13 %16 %17 +%18 = OpPhi %int %int_0 %13 %19 %17 +%20 = OpPhi %int %12 %13 %21 %17 +OpLoopMerge %22 %17 None +OpBranch %23 +%23 = OpLabel +%24 = OpSLessThan %bool %18 %int_10 +OpBranchConditional %24 %25 %22 +%25 = OpLabel +%27 = OpISub %int %int_2 %18 +OpBranch %26 +%26 = OpLabel +%16 = OpPhi %int %15 %25 %27 %28 +%21 = OpPhi %int %int_0 %25 %29 %28 +OpLoopMerge %30 %28 None +OpBranch %31 +%31 = OpLabel +%32 = OpSLessThan %bool %21 %int_10 +OpBranchConditional %32 %33 %30 +%33 = OpLabel +OpBranch %28 +%28 = OpLabel +%29 = OpIAdd %int %21 %int_1 +OpBranch %26 +%30 = OpLabel +OpBranch %17 +%17 = OpLabel +%19 = OpIAdd %int %18 %int_1 +OpBranch %14 +%22 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(before_hoist, after_hoist, true); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_without_preheader.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_without_preheader.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_without_preheader.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/hoist_without_preheader.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,123 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include + +#include "../pass_fixture.h" +#include "opt/licm_pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +/* + Tests that the LICM pass will generate a preheader when one is not present + + Generated from the following GLSL fragment shader +--eliminate-local-multi-store has also been run on the spv binary +#version 440 core +void main(){ + int a = 1; + int b = 2; + int hoist = 0; + for (int i = 0; i < 10; i++) { + if (i == 5) { + break; + } + } + for (int i = 0; i < 10; i++) { + hoist = a + b; + } +} +*/ +#ifdef SPIRV_EFFCEE +TEST_F(PassClassTest, HoistWithoutPreheader) { + const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 440 +OpName %main "main" +%void = OpTypeVoid +%4 = OpTypeFunction %void +%int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%int_0 = OpConstant %int 0 +%int_10 = OpConstant %int 10 +%bool = OpTypeBool +%int_5 = OpConstant %int 5 +%main = OpFunction %void None %4 +%13 = OpLabel +OpBranch %14 +%14 = OpLabel +%15 = OpPhi %int %int_0 %13 %16 %17 +; CHECK: OpLoopMerge [[preheader:%\w+]] +OpLoopMerge %25 %17 None +OpBranch %19 +%19 = OpLabel +%20 = OpSLessThan %bool %15 %int_10 +OpBranchConditional %20 %21 %25 +%21 = OpLabel +%22 = OpIEqual %bool %15 %int_5 +OpSelectionMerge %23 None +OpBranchConditional %22 %24 %23 +%24 = OpLabel +OpBranch %25 +%23 = OpLabel +OpBranch %17 +%17 = OpLabel +%16 = OpIAdd %int %15 %int_1 +OpBranch %14 +; Check that we hoisted the code to the preheader +; CHECK: [[preheader]] = OpLabel +; CHECK-NEXT: OpPhi +; CHECK-NEXT: OpPhi +; CHECK-NEXT: OpIAdd +; CHECK-NEXT: OpBranch [[header:%\w+]] +; CHECK: [[header]] = OpLabel +; CHECK-NEXT: OpPhi +; CHECK-NEXT: OpPhi +; CHECK: OpLoopMerge +%25 = OpLabel +%26 = OpPhi %int %int_0 %24 %int_0 %19 %27 %28 +%29 = OpPhi %int %int_0 %24 %int_0 %19 %30 %28 +OpLoopMerge %31 %28 None +OpBranch %32 +%32 = OpLabel +%33 = OpSLessThan %bool %29 %int_10 +OpBranchConditional %33 %34 %31 +%34 = OpLabel +%27 = OpIAdd %int %int_1 %int_2 +OpBranch %28 +%28 = OpLabel +%30 = OpIAdd %int %29 %int_1 +OpBranch %25 +%31 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, false); +} +#endif + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/lcssa.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/lcssa.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/lcssa.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/lcssa.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,614 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include +#include +#include + +#ifdef SPIRV_EFFCEE +#include "effcee/effcee.h" +#endif + +#include "../assembly_builder.h" +#include "../function_utils.h" + +#include "opt/build_module.h" +#include "opt/loop_descriptor.h" +#include "opt/loop_utils.h" +#include "opt/pass.h" + +namespace { + +using namespace spvtools; + +#ifdef SPIRV_EFFCEE + +bool Validate(const std::vector& bin) { + spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2; + spv_context spvContext = spvContextCreate(target_env); + spv_diagnostic diagnostic = nullptr; + spv_const_binary_t binary = {bin.data(), bin.size()}; + spv_result_t error = spvValidate(spvContext, &binary, &diagnostic); + if (error != 0) spvDiagnosticPrint(diagnostic); + spvDiagnosticDestroy(diagnostic); + spvContextDestroy(spvContext); + return error == 0; +} + +void Match(const std::string& original, ir::IRContext* context, + bool do_validation = true) { + std::vector bin; + context->module()->ToBinary(&bin, true); + if (do_validation) { + EXPECT_TRUE(Validate(bin)); + } + std::string assembly; + SpirvTools tools(SPV_ENV_UNIVERSAL_1_2); + EXPECT_TRUE( + tools.Disassemble(bin, &assembly, SPV_BINARY_TO_TEXT_OPTION_NO_HEADER)) + << "Disassembling failed for shader:\n" + << assembly << std::endl; + auto match_result = effcee::Match(assembly, original); + EXPECT_EQ(effcee::Result::Status::Ok, match_result.status()) + << match_result.message() << "\nChecking result:\n" + << assembly; +} + +using LCSSATest = ::testing::Test; + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 330 core +layout(location = 0) out vec4 c; +void main() { + int i = 0; + for (; i < 10; i++) { + } + if (i != 0) { + i = 1; + } +} +*/ +TEST_F(LCSSATest, SimpleLCSSA) { + const std::string text = R"( +; CHECK: OpLoopMerge [[merge:%\w+]] %19 None +; CHECK: [[merge]] = OpLabel +; CHECK-NEXT: [[phi:%\w+]] = OpPhi {{%\w+}} %30 %20 +; CHECK-NEXT: %27 = OpINotEqual {{%\w+}} [[phi]] %9 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 330 + OpName %2 "main" + OpName %3 "c" + OpDecorate %3 Location 0 + %5 = OpTypeVoid + %6 = OpTypeFunction %5 + %7 = OpTypeInt 32 1 + %8 = OpTypePointer Function %7 + %9 = OpConstant %7 0 + %10 = OpConstant %7 10 + %11 = OpTypeBool + %12 = OpConstant %7 1 + %13 = OpTypeFloat 32 + %14 = OpTypeVector %13 4 + %15 = OpTypePointer Output %14 + %3 = OpVariable %15 Output + %2 = OpFunction %5 None %6 + %16 = OpLabel + OpBranch %17 + %17 = OpLabel + %30 = OpPhi %7 %9 %16 %25 %19 + OpLoopMerge %18 %19 None + OpBranch %20 + %20 = OpLabel + %22 = OpSLessThan %11 %30 %10 + OpBranchConditional %22 %23 %18 + %23 = OpLabel + OpBranch %19 + %19 = OpLabel + %25 = OpIAdd %7 %30 %12 + OpBranch %17 + %18 = OpLabel + %27 = OpINotEqual %11 %30 %9 + OpSelectionMerge %28 None + OpBranchConditional %27 %29 %28 + %29 = OpLabel + OpBranch %28 + %28 = OpLabel + %31 = OpPhi %7 %30 %18 %12 %29 + OpReturn + OpFunctionEnd + )"; + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 2); + ir::LoopDescriptor ld{f}; + + ir::Loop* loop = ld[17]; + EXPECT_FALSE(loop->IsLCSSA()); + opt::LoopUtils Util(context.get(), loop); + Util.MakeLoopClosedSSA(); + EXPECT_TRUE(loop->IsLCSSA()); + Match(text, context.get()); +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 330 core +layout(location = 0) out vec4 c; +void main() { + int i = 0; + for (; i < 10; i++) { + } + if (i != 0) { + i = 1; + } +} +*/ +// Same test as above, but should reuse an existing phi. +TEST_F(LCSSATest, PhiReuseLCSSA) { + const std::string text = R"( +; CHECK: OpLoopMerge [[merge:%\w+]] %19 None +; CHECK: [[merge]] = OpLabel +; CHECK-NEXT: [[phi:%\w+]] = OpPhi {{%\w+}} %30 %20 +; CHECK-NEXT: %27 = OpINotEqual {{%\w+}} [[phi]] %9 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 330 + OpName %2 "main" + OpName %3 "c" + OpDecorate %3 Location 0 + %5 = OpTypeVoid + %6 = OpTypeFunction %5 + %7 = OpTypeInt 32 1 + %8 = OpTypePointer Function %7 + %9 = OpConstant %7 0 + %10 = OpConstant %7 10 + %11 = OpTypeBool + %12 = OpConstant %7 1 + %13 = OpTypeFloat 32 + %14 = OpTypeVector %13 4 + %15 = OpTypePointer Output %14 + %3 = OpVariable %15 Output + %2 = OpFunction %5 None %6 + %16 = OpLabel + OpBranch %17 + %17 = OpLabel + %30 = OpPhi %7 %9 %16 %25 %19 + OpLoopMerge %18 %19 None + OpBranch %20 + %20 = OpLabel + %22 = OpSLessThan %11 %30 %10 + OpBranchConditional %22 %23 %18 + %23 = OpLabel + OpBranch %19 + %19 = OpLabel + %25 = OpIAdd %7 %30 %12 + OpBranch %17 + %18 = OpLabel + %32 = OpPhi %7 %30 %20 + %27 = OpINotEqual %11 %30 %9 + OpSelectionMerge %28 None + OpBranchConditional %27 %29 %28 + %29 = OpLabel + OpBranch %28 + %28 = OpLabel + %31 = OpPhi %7 %30 %18 %12 %29 + OpReturn + OpFunctionEnd + )"; + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 2); + ir::LoopDescriptor ld{f}; + + ir::Loop* loop = ld[17]; + EXPECT_FALSE(loop->IsLCSSA()); + opt::LoopUtils Util(context.get(), loop); + Util.MakeLoopClosedSSA(); + EXPECT_TRUE(loop->IsLCSSA()); + Match(text, context.get()); +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 330 core +layout(location = 0) out vec4 c; +void main() { + int i = 0; + int j = 0; + for (; i < 10; i++) {} + for (; j < 10; j++) {} + if (j != 0) { + i = 1; + } +} +*/ +TEST_F(LCSSATest, DualLoopLCSSA) { + const std::string text = R"( +; CHECK: %20 = OpLabel +; CHECK-NEXT: [[phi:%\w+]] = OpPhi %6 %17 %21 +; CHECK: %33 = OpLabel +; CHECK-NEXT: {{%\w+}} = OpPhi {{%\w+}} [[phi]] %28 %11 %34 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 330 + OpName %2 "main" + OpName %3 "c" + OpDecorate %3 Location 0 + %4 = OpTypeVoid + %5 = OpTypeFunction %4 + %6 = OpTypeInt 32 1 + %7 = OpTypePointer Function %6 + %8 = OpConstant %6 0 + %9 = OpConstant %6 10 + %10 = OpTypeBool + %11 = OpConstant %6 1 + %12 = OpTypeFloat 32 + %13 = OpTypeVector %12 4 + %14 = OpTypePointer Output %13 + %3 = OpVariable %14 Output + %2 = OpFunction %4 None %5 + %15 = OpLabel + OpBranch %16 + %16 = OpLabel + %17 = OpPhi %6 %8 %15 %18 %19 + OpLoopMerge %20 %19 None + OpBranch %21 + %21 = OpLabel + %22 = OpSLessThan %10 %17 %9 + OpBranchConditional %22 %23 %20 + %23 = OpLabel + OpBranch %19 + %19 = OpLabel + %18 = OpIAdd %6 %17 %11 + OpBranch %16 + %20 = OpLabel + OpBranch %24 + %24 = OpLabel + %25 = OpPhi %6 %8 %20 %26 %27 + OpLoopMerge %28 %27 None + OpBranch %29 + %29 = OpLabel + %30 = OpSLessThan %10 %25 %9 + OpBranchConditional %30 %31 %28 + %31 = OpLabel + OpBranch %27 + %27 = OpLabel + %26 = OpIAdd %6 %25 %11 + OpBranch %24 + %28 = OpLabel + %32 = OpINotEqual %10 %25 %8 + OpSelectionMerge %33 None + OpBranchConditional %32 %34 %33 + %34 = OpLabel + OpBranch %33 + %33 = OpLabel + %35 = OpPhi %6 %17 %28 %11 %34 + OpReturn + OpFunctionEnd + )"; + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 2); + ir::LoopDescriptor ld{f}; + + ir::Loop* loop = ld[16]; + EXPECT_FALSE(loop->IsLCSSA()); + opt::LoopUtils Util(context.get(), loop); + Util.MakeLoopClosedSSA(); + EXPECT_TRUE(loop->IsLCSSA()); + Match(text, context.get()); +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 330 core +layout(location = 0) out vec4 c; +void main() { + int i = 0; + if (i != 0) { + for (; i < 10; i++) {} + } + if (i != 0) { + i = 1; + } +} +*/ +TEST_F(LCSSATest, PhiUserLCSSA) { + const std::string text = R"( +; CHECK: OpLoopMerge [[merge:%\w+]] %22 None +; CHECK: [[merge]] = OpLabel +; CHECK-NEXT: [[phi:%\w+]] = OpPhi {{%\w+}} %20 %24 +; CHECK: %17 = OpLabel +; CHECK-NEXT: {{%\w+}} = OpPhi {{%\w+}} %8 %15 [[phi]] %23 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 330 + OpName %2 "main" + OpName %3 "c" + OpDecorate %3 Location 0 + %4 = OpTypeVoid + %5 = OpTypeFunction %4 + %6 = OpTypeInt 32 1 + %7 = OpTypePointer Function %6 + %8 = OpConstant %6 0 + %9 = OpTypeBool + %10 = OpConstant %6 10 + %11 = OpConstant %6 1 + %12 = OpTypeFloat 32 + %13 = OpTypeVector %12 4 + %14 = OpTypePointer Output %13 + %3 = OpVariable %14 Output + %2 = OpFunction %4 None %5 + %15 = OpLabel + %16 = OpINotEqual %9 %8 %8 + OpSelectionMerge %17 None + OpBranchConditional %16 %18 %17 + %18 = OpLabel + OpBranch %19 + %19 = OpLabel + %20 = OpPhi %6 %8 %18 %21 %22 + OpLoopMerge %23 %22 None + OpBranch %24 + %24 = OpLabel + %25 = OpSLessThan %9 %20 %10 + OpBranchConditional %25 %26 %23 + %26 = OpLabel + OpBranch %22 + %22 = OpLabel + %21 = OpIAdd %6 %20 %11 + OpBranch %19 + %23 = OpLabel + OpBranch %17 + %17 = OpLabel + %27 = OpPhi %6 %8 %15 %20 %23 + %28 = OpINotEqual %9 %27 %8 + OpSelectionMerge %29 None + OpBranchConditional %28 %30 %29 + %30 = OpLabel + OpBranch %29 + %29 = OpLabel + %31 = OpPhi %6 %27 %17 %11 %30 + OpReturn + OpFunctionEnd + )"; + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 2); + ir::LoopDescriptor ld{f}; + + ir::Loop* loop = ld[19]; + EXPECT_FALSE(loop->IsLCSSA()); + opt::LoopUtils Util(context.get(), loop); + Util.MakeLoopClosedSSA(); + EXPECT_TRUE(loop->IsLCSSA()); + Match(text, context.get()); +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 330 core +void main() { + int i = 0; + if (i != 0) { + for (; i < 10; i++) { + if (i > 5) break; + } + } + if (i != 0) { + i = 1; + } +} +*/ +TEST_F(LCSSATest, LCSSAWithBreak) { + const std::string text = R"( +; CHECK: OpLoopMerge [[merge:%\w+]] %19 None +; CHECK: [[merge]] = OpLabel +; CHECK-NEXT: [[phi:%\w+]] = OpPhi {{%\w+}} %17 %21 %17 %26 +; CHECK: %14 = OpLabel +; CHECK-NEXT: {{%\w+}} = OpPhi {{%\w+}} %7 %12 [[phi]] [[merge]] + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 330 + OpName %2 "main" + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeInt 32 1 + %6 = OpTypePointer Function %5 + %7 = OpConstant %5 0 + %8 = OpTypeBool + %9 = OpConstant %5 10 + %10 = OpConstant %5 5 + %11 = OpConstant %5 1 + %2 = OpFunction %3 None %4 + %12 = OpLabel + %13 = OpINotEqual %8 %7 %7 + OpSelectionMerge %14 None + OpBranchConditional %13 %15 %14 + %15 = OpLabel + OpBranch %16 + %16 = OpLabel + %17 = OpPhi %5 %7 %15 %18 %19 + OpLoopMerge %20 %19 None + OpBranch %21 + %21 = OpLabel + %22 = OpSLessThan %8 %17 %9 + OpBranchConditional %22 %23 %20 + %23 = OpLabel + %24 = OpSGreaterThan %8 %17 %10 + OpSelectionMerge %25 None + OpBranchConditional %24 %26 %25 + %26 = OpLabel + OpBranch %20 + %25 = OpLabel + OpBranch %19 + %19 = OpLabel + %18 = OpIAdd %5 %17 %11 + OpBranch %16 + %20 = OpLabel + OpBranch %14 + %14 = OpLabel + %27 = OpPhi %5 %7 %12 %17 %20 + %28 = OpINotEqual %8 %27 %7 + OpSelectionMerge %29 None + OpBranchConditional %28 %30 %29 + %30 = OpLabel + OpBranch %29 + %29 = OpLabel + %31 = OpPhi %5 %27 %14 %11 %30 + OpReturn + OpFunctionEnd + )"; + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 2); + ir::LoopDescriptor ld{f}; + + ir::Loop* loop = ld[19]; + EXPECT_FALSE(loop->IsLCSSA()); + opt::LoopUtils Util(context.get(), loop); + Util.MakeLoopClosedSSA(); + EXPECT_TRUE(loop->IsLCSSA()); + Match(text, context.get()); +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 330 core +void main() { + int i = 0; + for (; i < 10; i++) {} + for (int j = i; j < 10;) { j = i + j; } +} +*/ +TEST_F(LCSSATest, LCSSAUseInNonEligiblePhi) { + const std::string text = R"( +; CHECK: %12 = OpLabel +; CHECK-NEXT: [[def_to_close:%\w+]] = OpPhi {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}} [[continue:%\w+]] +; CHECK-NEXT: OpLoopMerge [[merge:%\w+]] [[continue]] None +; CHECK: [[merge]] = OpLabel +; CHECK-NEXT: [[closing_phi:%\w+]] = OpPhi {{%\w+}} [[def_to_close]] %17 +; CHECK: %16 = OpLabel +; CHECK-NEXT: [[use_in_phi:%\w+]] = OpPhi {{%\w+}} %21 %22 [[closing_phi]] [[merge]] +; CHECK: OpIAdd {{%\w+}} [[closing_phi]] [[use_in_phi]] + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 330 + OpName %2 "main" + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeInt 32 1 + %6 = OpTypePointer Function %5 + %7 = OpConstant %5 0 + %8 = OpConstant %5 10 + %9 = OpTypeBool + %10 = OpConstant %5 1 + %2 = OpFunction %3 None %4 + %11 = OpLabel + OpBranch %12 + %12 = OpLabel + %13 = OpPhi %5 %7 %11 %14 %15 + OpLoopMerge %16 %15 None + OpBranch %17 + %17 = OpLabel + %18 = OpSLessThan %9 %13 %8 + OpBranchConditional %18 %19 %16 + %19 = OpLabel + OpBranch %15 + %15 = OpLabel + %14 = OpIAdd %5 %13 %10 + OpBranch %12 + %16 = OpLabel + %20 = OpPhi %5 %13 %17 %21 %22 + OpLoopMerge %23 %22 None + OpBranch %24 + %24 = OpLabel + %25 = OpSLessThan %9 %20 %8 + OpBranchConditional %25 %26 %23 + %26 = OpLabel + %21 = OpIAdd %5 %13 %20 + OpBranch %22 + %22 = OpLabel + OpBranch %16 + %23 = OpLabel + OpReturn + OpFunctionEnd + )"; + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 2); + ir::LoopDescriptor ld{f}; + + ir::Loop* loop = ld[12]; + EXPECT_FALSE(loop->IsLCSSA()); + opt::LoopUtils Util(context.get(), loop); + Util.MakeLoopClosedSSA(); + EXPECT_TRUE(loop->IsLCSSA()); + Match(text, context.get()); +} + +#endif // SPIRV_EFFCEE + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/loop_descriptions.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/loop_descriptions.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/loop_descriptions.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/loop_descriptions.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,300 @@ +// Copyright (c) 2017 Google 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. + +#include + +#include +#include +#include + +#include "../assembly_builder.h" +#include "../function_utils.h" +#include "../pass_fixture.h" +#include "../pass_utils.h" +#include "opt/loop_descriptor.h" +#include "opt/pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +/* +Generated from the following GLSL +#version 330 core +layout(location = 0) out vec4 c; +void main() { + int i = 0; + for(; i < 10; ++i) { + } +} +*/ +TEST_F(PassClassTest, BasicVisitFromEntryPoint) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 330 + OpName %2 "main" + OpName %5 "i" + OpName %3 "c" + OpDecorate %3 Location 0 + %6 = OpTypeVoid + %7 = OpTypeFunction %6 + %8 = OpTypeInt 32 1 + %9 = OpTypePointer Function %8 + %10 = OpConstant %8 0 + %11 = OpConstant %8 10 + %12 = OpTypeBool + %13 = OpConstant %8 1 + %14 = OpTypeFloat 32 + %15 = OpTypeVector %14 4 + %16 = OpTypePointer Output %15 + %3 = OpVariable %16 Output + %2 = OpFunction %6 None %7 + %17 = OpLabel + %5 = OpVariable %9 Function + OpStore %5 %10 + OpBranch %18 + %18 = OpLabel + OpLoopMerge %19 %20 None + OpBranch %21 + %21 = OpLabel + %22 = OpLoad %8 %5 + %23 = OpSLessThan %12 %22 %11 + OpBranchConditional %23 %24 %19 + %24 = OpLabel + OpBranch %20 + %20 = OpLabel + %25 = OpLoad %8 %5 + %26 = OpIAdd %8 %25 %13 + OpStore %5 %26 + OpBranch %18 + %19 = OpLabel + OpReturn + OpFunctionEnd + )"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 2); + ir::LoopDescriptor& ld = *context->GetLoopDescriptor(f); + + EXPECT_EQ(ld.NumLoops(), 1u); + + ir::Loop& loop = ld.GetLoopByIndex(0); + EXPECT_EQ(loop.GetHeaderBlock(), spvtest::GetBasicBlock(f, 18)); + EXPECT_EQ(loop.GetLatchBlock(), spvtest::GetBasicBlock(f, 20)); + EXPECT_EQ(loop.GetMergeBlock(), spvtest::GetBasicBlock(f, 19)); + + EXPECT_FALSE(loop.HasNestedLoops()); + EXPECT_FALSE(loop.IsNested()); + EXPECT_EQ(loop.GetDepth(), 1u); +} + +/* +Generated from the following GLSL: +#version 330 core +layout(location = 0) out vec4 c; +void main() { + for(int i = 0; i < 10; ++i) {} + for(int i = 0; i < 10; ++i) {} +} + +But it was "hacked" to make the first loop merge block the second loop header. +*/ +TEST_F(PassClassTest, LoopWithNoPreHeader) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 330 + OpName %2 "main" + OpName %4 "i" + OpName %5 "i" + OpName %3 "c" + OpDecorate %3 Location 0 + %6 = OpTypeVoid + %7 = OpTypeFunction %6 + %8 = OpTypeInt 32 1 + %9 = OpTypePointer Function %8 + %10 = OpConstant %8 0 + %11 = OpConstant %8 10 + %12 = OpTypeBool + %13 = OpConstant %8 1 + %14 = OpTypeFloat 32 + %15 = OpTypeVector %14 4 + %16 = OpTypePointer Output %15 + %3 = OpVariable %16 Output + %2 = OpFunction %6 None %7 + %17 = OpLabel + %4 = OpVariable %9 Function + %5 = OpVariable %9 Function + OpStore %4 %10 + OpStore %5 %10 + OpBranch %18 + %18 = OpLabel + OpLoopMerge %27 %20 None + OpBranch %21 + %21 = OpLabel + %22 = OpLoad %8 %4 + %23 = OpSLessThan %12 %22 %11 + OpBranchConditional %23 %24 %27 + %24 = OpLabel + OpBranch %20 + %20 = OpLabel + %25 = OpLoad %8 %4 + %26 = OpIAdd %8 %25 %13 + OpStore %4 %26 + OpBranch %18 + %27 = OpLabel + OpLoopMerge %28 %29 None + OpBranch %30 + %30 = OpLabel + %31 = OpLoad %8 %5 + %32 = OpSLessThan %12 %31 %11 + OpBranchConditional %32 %33 %28 + %33 = OpLabel + OpBranch %29 + %29 = OpLabel + %34 = OpLoad %8 %5 + %35 = OpIAdd %8 %34 %13 + OpStore %5 %35 + OpBranch %27 + %28 = OpLabel + OpReturn + OpFunctionEnd + )"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 2); + ir::LoopDescriptor& ld = *context->GetLoopDescriptor(f); + + EXPECT_EQ(ld.NumLoops(), 2u); + + ir::Loop* loop = ld[27]; + EXPECT_EQ(loop->GetPreHeaderBlock(), nullptr); + EXPECT_NE(loop->GetOrCreatePreHeaderBlock(), nullptr); +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 330 core +in vec4 c; +void main() { + int i = 0; + bool cond = c[0] == 0; + for (; i < 10; i++) { + if (cond) { + return; + } + else { + return; + } + } + bool cond2 = i == 9; +} +*/ +TEST_F(PassClassTest, NoLoop) { + const std::string text = R"(; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 3 +; Bound: 47 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" %16 + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 330 + OpName %4 "main" + OpName %16 "c" + OpDecorate %16 Location 0 + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeInt 32 1 + %7 = OpTypePointer Function %6 + %9 = OpConstant %6 0 + %10 = OpTypeBool + %11 = OpTypePointer Function %10 + %13 = OpTypeFloat 32 + %14 = OpTypeVector %13 4 + %15 = OpTypePointer Input %14 + %16 = OpVariable %15 Input + %17 = OpTypeInt 32 0 + %18 = OpConstant %17 0 + %19 = OpTypePointer Input %13 + %22 = OpConstant %13 0 + %30 = OpConstant %6 10 + %39 = OpConstant %6 1 + %46 = OpUndef %6 + %4 = OpFunction %2 None %3 + %5 = OpLabel + %20 = OpAccessChain %19 %16 %18 + %21 = OpLoad %13 %20 + %23 = OpFOrdEqual %10 %21 %22 + OpBranch %24 + %24 = OpLabel + %45 = OpPhi %6 %9 %5 %40 %27 + OpLoopMerge %26 %27 None + OpBranch %28 + %28 = OpLabel + %31 = OpSLessThan %10 %45 %30 + OpBranchConditional %31 %25 %26 + %25 = OpLabel + OpSelectionMerge %34 None + OpBranchConditional %23 %33 %36 + %33 = OpLabel + OpReturn + %36 = OpLabel + OpReturn + %34 = OpLabel + OpBranch %27 + %27 = OpLabel + %40 = OpIAdd %6 %46 %39 + OpBranch %24 + %26 = OpLabel + OpReturn + OpFunctionEnd + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 4); + ir::LoopDescriptor ld{f}; + + EXPECT_EQ(ld.NumLoops(), 0u); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/nested_loops.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/nested_loops.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/nested_loops.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/nested_loops.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,796 @@ +// Copyright (c) 2017 Google 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. + +#include + +#include +#include +#include +#include + +#include "../assembly_builder.h" +#include "../function_utils.h" +#include "../pass_fixture.h" +#include "../pass_utils.h" + +#include "opt/iterator.h" +#include "opt/loop_descriptor.h" +#include "opt/pass.h" +#include "opt/tree_iterator.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +bool Validate(const std::vector& bin) { + spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2; + spv_context spvContext = spvContextCreate(target_env); + spv_diagnostic diagnostic = nullptr; + spv_const_binary_t binary = {bin.data(), bin.size()}; + spv_result_t error = spvValidate(spvContext, &binary, &diagnostic); + if (error != 0) spvDiagnosticPrint(diagnostic); + spvDiagnosticDestroy(diagnostic); + spvContextDestroy(spvContext); + return error == 0; +} + +using PassClassTest = PassTest<::testing::Test>; + +/* +Generated from the following GLSL +#version 330 core +layout(location = 0) out vec4 c; +void main() { + int i = 0; + for (; i < 10; ++i) { + int j = 0; + int k = 0; + for (; j < 11; ++j) {} + for (; k < 12; ++k) {} + } +} +*/ +TEST_F(PassClassTest, BasicVisitFromEntryPoint) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 330 + OpName %2 "main" + OpName %4 "i" + OpName %5 "j" + OpName %6 "k" + OpName %3 "c" + OpDecorate %3 Location 0 + %7 = OpTypeVoid + %8 = OpTypeFunction %7 + %9 = OpTypeInt 32 1 + %10 = OpTypePointer Function %9 + %11 = OpConstant %9 0 + %12 = OpConstant %9 10 + %13 = OpTypeBool + %14 = OpConstant %9 11 + %15 = OpConstant %9 1 + %16 = OpConstant %9 12 + %17 = OpTypeFloat 32 + %18 = OpTypeVector %17 4 + %19 = OpTypePointer Output %18 + %3 = OpVariable %19 Output + %2 = OpFunction %7 None %8 + %20 = OpLabel + %4 = OpVariable %10 Function + %5 = OpVariable %10 Function + %6 = OpVariable %10 Function + OpStore %4 %11 + OpBranch %21 + %21 = OpLabel + OpLoopMerge %22 %23 None + OpBranch %24 + %24 = OpLabel + %25 = OpLoad %9 %4 + %26 = OpSLessThan %13 %25 %12 + OpBranchConditional %26 %27 %22 + %27 = OpLabel + OpStore %5 %11 + OpStore %6 %11 + OpBranch %28 + %28 = OpLabel + OpLoopMerge %29 %30 None + OpBranch %31 + %31 = OpLabel + %32 = OpLoad %9 %5 + %33 = OpSLessThan %13 %32 %14 + OpBranchConditional %33 %34 %29 + %34 = OpLabel + OpBranch %30 + %30 = OpLabel + %35 = OpLoad %9 %5 + %36 = OpIAdd %9 %35 %15 + OpStore %5 %36 + OpBranch %28 + %29 = OpLabel + OpBranch %37 + %37 = OpLabel + OpLoopMerge %38 %39 None + OpBranch %40 + %40 = OpLabel + %41 = OpLoad %9 %6 + %42 = OpSLessThan %13 %41 %16 + OpBranchConditional %42 %43 %38 + %43 = OpLabel + OpBranch %39 + %39 = OpLabel + %44 = OpLoad %9 %6 + %45 = OpIAdd %9 %44 %15 + OpStore %6 %45 + OpBranch %37 + %38 = OpLabel + OpBranch %23 + %23 = OpLabel + %46 = OpLoad %9 %4 + %47 = OpIAdd %9 %46 %15 + OpStore %4 %47 + OpBranch %21 + %22 = OpLabel + OpReturn + OpFunctionEnd + )"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 2); + ir::LoopDescriptor& ld = *context->GetLoopDescriptor(f); + + EXPECT_EQ(ld.NumLoops(), 3u); + + // Invalid basic block id. + EXPECT_EQ(ld[0u], nullptr); + // Not a loop header. + EXPECT_EQ(ld[20], nullptr); + + ir::Loop& parent_loop = *ld[21]; + EXPECT_TRUE(parent_loop.HasNestedLoops()); + EXPECT_FALSE(parent_loop.IsNested()); + EXPECT_EQ(parent_loop.GetDepth(), 1u); + EXPECT_EQ(std::distance(parent_loop.begin(), parent_loop.end()), 2u); + EXPECT_EQ(parent_loop.GetHeaderBlock(), spvtest::GetBasicBlock(f, 21)); + EXPECT_EQ(parent_loop.GetLatchBlock(), spvtest::GetBasicBlock(f, 23)); + EXPECT_EQ(parent_loop.GetMergeBlock(), spvtest::GetBasicBlock(f, 22)); + + ir::Loop& child_loop_1 = *ld[28]; + EXPECT_FALSE(child_loop_1.HasNestedLoops()); + EXPECT_TRUE(child_loop_1.IsNested()); + EXPECT_EQ(child_loop_1.GetDepth(), 2u); + EXPECT_EQ(std::distance(child_loop_1.begin(), child_loop_1.end()), 0u); + EXPECT_EQ(child_loop_1.GetHeaderBlock(), spvtest::GetBasicBlock(f, 28)); + EXPECT_EQ(child_loop_1.GetLatchBlock(), spvtest::GetBasicBlock(f, 30)); + EXPECT_EQ(child_loop_1.GetMergeBlock(), spvtest::GetBasicBlock(f, 29)); + + ir::Loop& child_loop_2 = *ld[37]; + EXPECT_FALSE(child_loop_2.HasNestedLoops()); + EXPECT_TRUE(child_loop_2.IsNested()); + EXPECT_EQ(child_loop_2.GetDepth(), 2u); + EXPECT_EQ(std::distance(child_loop_2.begin(), child_loop_2.end()), 0u); + EXPECT_EQ(child_loop_2.GetHeaderBlock(), spvtest::GetBasicBlock(f, 37)); + EXPECT_EQ(child_loop_2.GetLatchBlock(), spvtest::GetBasicBlock(f, 39)); + EXPECT_EQ(child_loop_2.GetMergeBlock(), spvtest::GetBasicBlock(f, 38)); +} + +static void CheckLoopBlocks(ir::Loop* loop, + std::unordered_set* expected_ids) { + SCOPED_TRACE("Check loop " + std::to_string(loop->GetHeaderBlock()->id())); + for (uint32_t bb_id : loop->GetBlocks()) { + EXPECT_EQ(expected_ids->count(bb_id), 1u); + expected_ids->erase(bb_id); + } + EXPECT_FALSE(loop->IsInsideLoop(loop->GetMergeBlock())); + EXPECT_EQ(expected_ids->size(), 0u); +} + +/* +Generated from the following GLSL +#version 330 core +layout(location = 0) out vec4 c; +void main() { + int i = 0; + for (; i < 10; ++i) { + for (int j = 0; j < 11; ++j) { + if (j < 5) { + for (int k = 0; k < 12; ++k) {} + } + else {} + for (int k = 0; k < 12; ++k) {} + } + } +}*/ +TEST_F(PassClassTest, TripleNestedLoop) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 330 + OpName %2 "main" + OpName %4 "i" + OpName %5 "j" + OpName %6 "k" + OpName %7 "k" + OpName %3 "c" + OpDecorate %3 Location 0 + %8 = OpTypeVoid + %9 = OpTypeFunction %8 + %10 = OpTypeInt 32 1 + %11 = OpTypePointer Function %10 + %12 = OpConstant %10 0 + %13 = OpConstant %10 10 + %14 = OpTypeBool + %15 = OpConstant %10 11 + %16 = OpConstant %10 5 + %17 = OpConstant %10 12 + %18 = OpConstant %10 1 + %19 = OpTypeFloat 32 + %20 = OpTypeVector %19 4 + %21 = OpTypePointer Output %20 + %3 = OpVariable %21 Output + %2 = OpFunction %8 None %9 + %22 = OpLabel + %4 = OpVariable %11 Function + %5 = OpVariable %11 Function + %6 = OpVariable %11 Function + %7 = OpVariable %11 Function + OpStore %4 %12 + OpBranch %23 + %23 = OpLabel + OpLoopMerge %24 %25 None + OpBranch %26 + %26 = OpLabel + %27 = OpLoad %10 %4 + %28 = OpSLessThan %14 %27 %13 + OpBranchConditional %28 %29 %24 + %29 = OpLabel + OpStore %5 %12 + OpBranch %30 + %30 = OpLabel + OpLoopMerge %31 %32 None + OpBranch %33 + %33 = OpLabel + %34 = OpLoad %10 %5 + %35 = OpSLessThan %14 %34 %15 + OpBranchConditional %35 %36 %31 + %36 = OpLabel + %37 = OpLoad %10 %5 + %38 = OpSLessThan %14 %37 %16 + OpSelectionMerge %39 None + OpBranchConditional %38 %40 %39 + %40 = OpLabel + OpStore %6 %12 + OpBranch %41 + %41 = OpLabel + OpLoopMerge %42 %43 None + OpBranch %44 + %44 = OpLabel + %45 = OpLoad %10 %6 + %46 = OpSLessThan %14 %45 %17 + OpBranchConditional %46 %47 %42 + %47 = OpLabel + OpBranch %43 + %43 = OpLabel + %48 = OpLoad %10 %6 + %49 = OpIAdd %10 %48 %18 + OpStore %6 %49 + OpBranch %41 + %42 = OpLabel + OpBranch %39 + %39 = OpLabel + OpStore %7 %12 + OpBranch %50 + %50 = OpLabel + OpLoopMerge %51 %52 None + OpBranch %53 + %53 = OpLabel + %54 = OpLoad %10 %7 + %55 = OpSLessThan %14 %54 %17 + OpBranchConditional %55 %56 %51 + %56 = OpLabel + OpBranch %52 + %52 = OpLabel + %57 = OpLoad %10 %7 + %58 = OpIAdd %10 %57 %18 + OpStore %7 %58 + OpBranch %50 + %51 = OpLabel + OpBranch %32 + %32 = OpLabel + %59 = OpLoad %10 %5 + %60 = OpIAdd %10 %59 %18 + OpStore %5 %60 + OpBranch %30 + %31 = OpLabel + OpBranch %25 + %25 = OpLabel + %61 = OpLoad %10 %4 + %62 = OpIAdd %10 %61 %18 + OpStore %4 %62 + OpBranch %23 + %24 = OpLabel + OpReturn + OpFunctionEnd + )"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 2); + ir::LoopDescriptor& ld = *context->GetLoopDescriptor(f); + + EXPECT_EQ(ld.NumLoops(), 4u); + + // Invalid basic block id. + EXPECT_EQ(ld[0u], nullptr); + // Not in a loop. + EXPECT_EQ(ld[22], nullptr); + + // Check that we can map basic block to the correct loop. + // The following block ids do not belong to a loop. + for (uint32_t bb_id : {22, 24}) EXPECT_EQ(ld[bb_id], nullptr); + + { + std::unordered_set basic_block_in_loop = { + {23, 26, 29, 30, 33, 36, 40, 41, 44, 47, 43, + 42, 39, 50, 53, 56, 52, 51, 32, 31, 25}}; + ir::Loop* loop = ld[23]; + CheckLoopBlocks(loop, &basic_block_in_loop); + + EXPECT_TRUE(loop->HasNestedLoops()); + EXPECT_FALSE(loop->IsNested()); + EXPECT_EQ(loop->GetDepth(), 1u); + EXPECT_EQ(std::distance(loop->begin(), loop->end()), 1u); + EXPECT_EQ(loop->GetPreHeaderBlock(), spvtest::GetBasicBlock(f, 22)); + EXPECT_EQ(loop->GetHeaderBlock(), spvtest::GetBasicBlock(f, 23)); + EXPECT_EQ(loop->GetLatchBlock(), spvtest::GetBasicBlock(f, 25)); + EXPECT_EQ(loop->GetMergeBlock(), spvtest::GetBasicBlock(f, 24)); + EXPECT_FALSE(loop->IsInsideLoop(loop->GetMergeBlock())); + EXPECT_FALSE(loop->IsInsideLoop(loop->GetPreHeaderBlock())); + } + + { + std::unordered_set basic_block_in_loop = { + {30, 33, 36, 40, 41, 44, 47, 43, 42, 39, 50, 53, 56, 52, 51, 32}}; + ir::Loop* loop = ld[30]; + CheckLoopBlocks(loop, &basic_block_in_loop); + + EXPECT_TRUE(loop->HasNestedLoops()); + EXPECT_TRUE(loop->IsNested()); + EXPECT_EQ(loop->GetDepth(), 2u); + EXPECT_EQ(std::distance(loop->begin(), loop->end()), 2u); + EXPECT_EQ(loop->GetPreHeaderBlock(), spvtest::GetBasicBlock(f, 29)); + EXPECT_EQ(loop->GetHeaderBlock(), spvtest::GetBasicBlock(f, 30)); + EXPECT_EQ(loop->GetLatchBlock(), spvtest::GetBasicBlock(f, 32)); + EXPECT_EQ(loop->GetMergeBlock(), spvtest::GetBasicBlock(f, 31)); + EXPECT_FALSE(loop->IsInsideLoop(loop->GetMergeBlock())); + EXPECT_FALSE(loop->IsInsideLoop(loop->GetPreHeaderBlock())); + } + + { + std::unordered_set basic_block_in_loop = {{41, 44, 47, 43}}; + ir::Loop* loop = ld[41]; + CheckLoopBlocks(loop, &basic_block_in_loop); + + EXPECT_FALSE(loop->HasNestedLoops()); + EXPECT_TRUE(loop->IsNested()); + EXPECT_EQ(loop->GetDepth(), 3u); + EXPECT_EQ(std::distance(loop->begin(), loop->end()), 0u); + EXPECT_EQ(loop->GetPreHeaderBlock(), spvtest::GetBasicBlock(f, 40)); + EXPECT_EQ(loop->GetHeaderBlock(), spvtest::GetBasicBlock(f, 41)); + EXPECT_EQ(loop->GetLatchBlock(), spvtest::GetBasicBlock(f, 43)); + EXPECT_EQ(loop->GetMergeBlock(), spvtest::GetBasicBlock(f, 42)); + EXPECT_FALSE(loop->IsInsideLoop(loop->GetMergeBlock())); + EXPECT_FALSE(loop->IsInsideLoop(loop->GetPreHeaderBlock())); + } + + { + std::unordered_set basic_block_in_loop = {{50, 53, 56, 52}}; + ir::Loop* loop = ld[50]; + CheckLoopBlocks(loop, &basic_block_in_loop); + + EXPECT_FALSE(loop->HasNestedLoops()); + EXPECT_TRUE(loop->IsNested()); + EXPECT_EQ(loop->GetDepth(), 3u); + EXPECT_EQ(std::distance(loop->begin(), loop->end()), 0u); + EXPECT_EQ(loop->GetPreHeaderBlock(), spvtest::GetBasicBlock(f, 39)); + EXPECT_EQ(loop->GetHeaderBlock(), spvtest::GetBasicBlock(f, 50)); + EXPECT_EQ(loop->GetLatchBlock(), spvtest::GetBasicBlock(f, 52)); + EXPECT_EQ(loop->GetMergeBlock(), spvtest::GetBasicBlock(f, 51)); + EXPECT_FALSE(loop->IsInsideLoop(loop->GetMergeBlock())); + EXPECT_FALSE(loop->IsInsideLoop(loop->GetPreHeaderBlock())); + } + + // Make sure LoopDescriptor gives us the inner most loop when we query for + // loops. + for (const ir::BasicBlock& bb : *f) { + if (ir::Loop* loop = ld[&bb]) { + for (ir::Loop& sub_loop : + ir::make_range(++opt::TreeDFIterator(loop), + opt::TreeDFIterator())) { + EXPECT_FALSE(sub_loop.IsInsideLoop(bb.id())); + } + } + } +} + +/* +Generated from the following GLSL +#version 330 core +layout(location = 0) out vec4 c; +void main() { + for (int i = 0; i < 10; ++i) { + for (int j = 0; j < 11; ++j) { + for (int k = 0; k < 11; ++k) {} + } + for (int k = 0; k < 12; ++k) {} + } +} +*/ +TEST_F(PassClassTest, LoopParentTest) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 330 + OpName %2 "main" + OpName %4 "i" + OpName %5 "j" + OpName %6 "k" + OpName %7 "k" + OpName %3 "c" + OpDecorate %3 Location 0 + %8 = OpTypeVoid + %9 = OpTypeFunction %8 + %10 = OpTypeInt 32 1 + %11 = OpTypePointer Function %10 + %12 = OpConstant %10 0 + %13 = OpConstant %10 10 + %14 = OpTypeBool + %15 = OpConstant %10 11 + %16 = OpConstant %10 1 + %17 = OpConstant %10 12 + %18 = OpTypeFloat 32 + %19 = OpTypeVector %18 4 + %20 = OpTypePointer Output %19 + %3 = OpVariable %20 Output + %2 = OpFunction %8 None %9 + %21 = OpLabel + %4 = OpVariable %11 Function + %5 = OpVariable %11 Function + %6 = OpVariable %11 Function + %7 = OpVariable %11 Function + OpStore %4 %12 + OpBranch %22 + %22 = OpLabel + OpLoopMerge %23 %24 None + OpBranch %25 + %25 = OpLabel + %26 = OpLoad %10 %4 + %27 = OpSLessThan %14 %26 %13 + OpBranchConditional %27 %28 %23 + %28 = OpLabel + OpStore %5 %12 + OpBranch %29 + %29 = OpLabel + OpLoopMerge %30 %31 None + OpBranch %32 + %32 = OpLabel + %33 = OpLoad %10 %5 + %34 = OpSLessThan %14 %33 %15 + OpBranchConditional %34 %35 %30 + %35 = OpLabel + OpStore %6 %12 + OpBranch %36 + %36 = OpLabel + OpLoopMerge %37 %38 None + OpBranch %39 + %39 = OpLabel + %40 = OpLoad %10 %6 + %41 = OpSLessThan %14 %40 %15 + OpBranchConditional %41 %42 %37 + %42 = OpLabel + OpBranch %38 + %38 = OpLabel + %43 = OpLoad %10 %6 + %44 = OpIAdd %10 %43 %16 + OpStore %6 %44 + OpBranch %36 + %37 = OpLabel + OpBranch %31 + %31 = OpLabel + %45 = OpLoad %10 %5 + %46 = OpIAdd %10 %45 %16 + OpStore %5 %46 + OpBranch %29 + %30 = OpLabel + OpStore %7 %12 + OpBranch %47 + %47 = OpLabel + OpLoopMerge %48 %49 None + OpBranch %50 + %50 = OpLabel + %51 = OpLoad %10 %7 + %52 = OpSLessThan %14 %51 %17 + OpBranchConditional %52 %53 %48 + %53 = OpLabel + OpBranch %49 + %49 = OpLabel + %54 = OpLoad %10 %7 + %55 = OpIAdd %10 %54 %16 + OpStore %7 %55 + OpBranch %47 + %48 = OpLabel + OpBranch %24 + %24 = OpLabel + %56 = OpLoad %10 %4 + %57 = OpIAdd %10 %56 %16 + OpStore %4 %57 + OpBranch %22 + %23 = OpLabel + OpReturn + OpFunctionEnd + )"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 2); + ir::LoopDescriptor& ld = *context->GetLoopDescriptor(f); + + EXPECT_EQ(ld.NumLoops(), 4u); + + { + ir::Loop& loop = *ld[22]; + EXPECT_TRUE(loop.HasNestedLoops()); + EXPECT_FALSE(loop.IsNested()); + EXPECT_EQ(loop.GetDepth(), 1u); + EXPECT_EQ(loop.GetParent(), nullptr); + } + + { + ir::Loop& loop = *ld[29]; + EXPECT_TRUE(loop.HasNestedLoops()); + EXPECT_TRUE(loop.IsNested()); + EXPECT_EQ(loop.GetDepth(), 2u); + EXPECT_EQ(loop.GetParent(), ld[22]); + } + + { + ir::Loop& loop = *ld[36]; + EXPECT_FALSE(loop.HasNestedLoops()); + EXPECT_TRUE(loop.IsNested()); + EXPECT_EQ(loop.GetDepth(), 3u); + EXPECT_EQ(loop.GetParent(), ld[29]); + } + + { + ir::Loop& loop = *ld[47]; + EXPECT_FALSE(loop.HasNestedLoops()); + EXPECT_TRUE(loop.IsNested()); + EXPECT_EQ(loop.GetDepth(), 2u); + EXPECT_EQ(loop.GetParent(), ld[22]); + } +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store +The preheader of loop %33 and %41 were removed as well. + +#version 330 core +void main() { + int a = 0; + for (int i = 0; i < 10; ++i) { + if (i == 0) { + a = 1; + } else { + a = 2; + } + for (int j = 0; j < 11; ++j) { + a++; + } + } + for (int k = 0; k < 12; ++k) {} +} +*/ +TEST_F(PassClassTest, CreatePreheaderTest) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 330 + OpName %2 "main" + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeInt 32 1 + %6 = OpTypePointer Function %5 + %7 = OpConstant %5 0 + %8 = OpConstant %5 10 + %9 = OpTypeBool + %10 = OpConstant %5 1 + %11 = OpConstant %5 2 + %12 = OpConstant %5 11 + %13 = OpConstant %5 12 + %14 = OpUndef %5 + %2 = OpFunction %3 None %4 + %15 = OpLabel + OpBranch %16 + %16 = OpLabel + %17 = OpPhi %5 %7 %15 %18 %19 + %20 = OpPhi %5 %7 %15 %21 %19 + %22 = OpPhi %5 %14 %15 %23 %19 + OpLoopMerge %41 %19 None + OpBranch %25 + %25 = OpLabel + %26 = OpSLessThan %9 %20 %8 + OpBranchConditional %26 %27 %41 + %27 = OpLabel + %28 = OpIEqual %9 %20 %7 + OpSelectionMerge %33 None + OpBranchConditional %28 %30 %31 + %30 = OpLabel + OpBranch %33 + %31 = OpLabel + OpBranch %33 + %33 = OpLabel + %18 = OpPhi %5 %10 %30 %11 %31 %34 %35 + %23 = OpPhi %5 %7 %30 %7 %31 %36 %35 + OpLoopMerge %37 %35 None + OpBranch %38 + %38 = OpLabel + %39 = OpSLessThan %9 %23 %12 + OpBranchConditional %39 %40 %37 + %40 = OpLabel + %34 = OpIAdd %5 %18 %10 + OpBranch %35 + %35 = OpLabel + %36 = OpIAdd %5 %23 %10 + OpBranch %33 + %37 = OpLabel + OpBranch %19 + %19 = OpLabel + %21 = OpIAdd %5 %20 %10 + OpBranch %16 + %41 = OpLabel + %42 = OpPhi %5 %7 %25 %43 %44 + OpLoopMerge %45 %44 None + OpBranch %46 + %46 = OpLabel + %47 = OpSLessThan %9 %42 %13 + OpBranchConditional %47 %48 %45 + %48 = OpLabel + OpBranch %44 + %44 = OpLabel + %43 = OpIAdd %5 %42 %10 + OpBranch %41 + %45 = OpLabel + OpReturn + OpFunctionEnd + )"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 2); + ir::LoopDescriptor& ld = *context->GetLoopDescriptor(f); + // No invalidation of the cfg should occur during this test. + ir::CFG* cfg = context->cfg(); + + EXPECT_EQ(ld.NumLoops(), 3u); + + { + ir::Loop& loop = *ld[16]; + EXPECT_TRUE(loop.HasNestedLoops()); + EXPECT_FALSE(loop.IsNested()); + EXPECT_EQ(loop.GetDepth(), 1u); + EXPECT_EQ(loop.GetParent(), nullptr); + } + + { + ir::Loop& loop = *ld[33]; + EXPECT_EQ(loop.GetPreHeaderBlock(), nullptr); + EXPECT_NE(loop.GetOrCreatePreHeaderBlock(), nullptr); + // Make sure the loop descriptor was properly updated. + EXPECT_EQ(ld[loop.GetPreHeaderBlock()], ld[16]); + { + const std::vector& preds = + cfg->preds(loop.GetPreHeaderBlock()->id()); + std::unordered_set pred_set(preds.begin(), preds.end()); + EXPECT_EQ(pred_set.size(), 2u); + EXPECT_TRUE(pred_set.count(30)); + EXPECT_TRUE(pred_set.count(31)); + // Check the phi instructions. + loop.GetPreHeaderBlock()->ForEachPhiInst( + [&pred_set](ir::Instruction* phi) { + for (uint32_t i = 1; i < phi->NumInOperands(); i += 2) { + EXPECT_TRUE(pred_set.count(phi->GetSingleWordInOperand(i))); + } + }); + } + { + const std::vector& preds = + cfg->preds(loop.GetHeaderBlock()->id()); + std::unordered_set pred_set(preds.begin(), preds.end()); + EXPECT_EQ(pred_set.size(), 2u); + EXPECT_TRUE(pred_set.count(loop.GetPreHeaderBlock()->id())); + EXPECT_TRUE(pred_set.count(35)); + // Check the phi instructions. + loop.GetHeaderBlock()->ForEachPhiInst([&pred_set](ir::Instruction* phi) { + for (uint32_t i = 1; i < phi->NumInOperands(); i += 2) { + EXPECT_TRUE(pred_set.count(phi->GetSingleWordInOperand(i))); + } + }); + } + } + + { + ir::Loop& loop = *ld[41]; + EXPECT_EQ(loop.GetPreHeaderBlock(), nullptr); + EXPECT_NE(loop.GetOrCreatePreHeaderBlock(), nullptr); + EXPECT_EQ(ld[loop.GetPreHeaderBlock()], nullptr); + EXPECT_EQ(cfg->preds(loop.GetPreHeaderBlock()->id()).size(), 1u); + EXPECT_EQ(cfg->preds(loop.GetPreHeaderBlock()->id())[0], 25u); + // Check the phi instructions. + loop.GetPreHeaderBlock()->ForEachPhiInst([](ir::Instruction* phi) { + EXPECT_EQ(phi->NumInOperands(), 2u); + EXPECT_EQ(phi->GetSingleWordInOperand(1), 25u); + }); + { + const std::vector& preds = + cfg->preds(loop.GetHeaderBlock()->id()); + std::unordered_set pred_set(preds.begin(), preds.end()); + EXPECT_EQ(pred_set.size(), 2u); + EXPECT_TRUE(pred_set.count(loop.GetPreHeaderBlock()->id())); + EXPECT_TRUE(pred_set.count(44)); + // Check the phi instructions. + loop.GetHeaderBlock()->ForEachPhiInst([&pred_set](ir::Instruction* phi) { + for (uint32_t i = 1; i < phi->NumInOperands(); i += 2) { + EXPECT_TRUE(pred_set.count(phi->GetSingleWordInOperand(i))); + } + }); + } + } + + // Make sure pre-header insertion leaves the module valid. + std::vector bin; + context->module()->ToBinary(&bin, true); + EXPECT_TRUE(Validate(bin)); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/peeling.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/peeling.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/peeling.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/peeling.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1075 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#ifdef SPIRV_EFFCEE +#include "effcee/effcee.h" +#endif + +#include "../pass_fixture.h" +#include "opt/ir_builder.h" +#include "opt/loop_descriptor.h" +#include "opt/loop_peeling.h" + +namespace { + +using namespace spvtools; + +using PeelingTest = PassTest<::testing::Test>; + +bool Validate(const std::vector& bin) { + spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2; + spv_context spvContext = spvContextCreate(target_env); + spv_diagnostic diagnostic = nullptr; + spv_const_binary_t binary = {bin.data(), bin.size()}; + spv_result_t error = spvValidate(spvContext, &binary, &diagnostic); + if (error != 0) spvDiagnosticPrint(diagnostic); + spvDiagnosticDestroy(diagnostic); + spvContextDestroy(spvContext); + return error == 0; +} + +void Match(const std::string& checks, ir::IRContext* context) { + std::vector bin; + context->module()->ToBinary(&bin, true); + EXPECT_TRUE(Validate(bin)); +#ifdef SPIRV_EFFCEE + std::string assembly; + SpirvTools tools(SPV_ENV_UNIVERSAL_1_2); + EXPECT_TRUE( + tools.Disassemble(bin, &assembly, SPV_BINARY_TO_TEXT_OPTION_NO_HEADER)) + << "Disassembling failed for shader:\n" + << assembly << std::endl; + auto match_result = effcee::Match(assembly, checks); + EXPECT_EQ(effcee::Result::Status::Ok, match_result.status()) + << match_result.message() << "\nChecking result:\n" + << assembly; +#endif // ! SPIRV_EFFCEE +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +First test: +#version 330 core +void main() { + for(int i = 0; i < 10; ++i) { + if (i < 4) + break; + } +} + +Second test (with a common sub-expression elimination): +#version 330 core +void main() { + for(int i = 0; i + 1 < 10; ++i) { + } +} + +Third test: +#version 330 core +void main() { + int a[10]; + for (int i = 0; a[i] != 0; i++) {} +} + +Forth test: +#version 330 core +void main() { + for (long i = 0; i < 10; i++) {} +} + +Fifth test: +#version 330 core +void main() { + for (float i = 0; i < 10; i++) {} +} + +Sixth test: +#version 450 +layout(location = 0)out float o; +void main() { + o = 0.0; + for( int i = 0; true; i++ ) { + o += 1.0; + if (i > 10) break; + } +} +*/ +TEST_F(PeelingTest, CannotPeel) { + // Build the given SPIR-V program in |text|, take the first loop in the first + // function and test that it is not peelable. |loop_count_id| is the id + // representing the loop count, if equals to 0, then the function build a 10 + // constant as loop count. + auto test_cannot_peel = [](const std::string& text, uint32_t loop_count_id) { + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + ir::Function& f = *module->begin(); + ir::LoopDescriptor& ld = *context->GetLoopDescriptor(&f); + + EXPECT_EQ(ld.NumLoops(), 1u); + + ir::Instruction* loop_count = nullptr; + if (loop_count_id) { + loop_count = context->get_def_use_mgr()->GetDef(loop_count_id); + } else { + opt::InstructionBuilder builder(context.get(), &*f.begin()); + // Exit condition. + loop_count = builder.Add32BitSignedIntegerConstant(10); + } + + opt::LoopPeeling peel(context.get(), &*ld.begin(), loop_count); + EXPECT_FALSE(peel.CanPeelLoop()); + }; + { + SCOPED_TRACE("loop with break"); + + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" + OpExecutionMode %main OriginLowerLeft + OpSource GLSL 330 + OpName %main "main" + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %int_10 = OpConstant %int 10 + %bool = OpTypeBool + %int_4 = OpConstant %int 4 + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %3 + %5 = OpLabel + OpBranch %10 + %10 = OpLabel + %28 = OpPhi %int %int_0 %5 %27 %13 + OpLoopMerge %12 %13 None + OpBranch %14 + %14 = OpLabel + %18 = OpSLessThan %bool %28 %int_10 + OpBranchConditional %18 %11 %12 + %11 = OpLabel + %21 = OpSLessThan %bool %28 %int_4 + OpSelectionMerge %23 None + OpBranchConditional %21 %22 %23 + %22 = OpLabel + OpBranch %12 + %23 = OpLabel + OpBranch %13 + %13 = OpLabel + %27 = OpIAdd %int %28 %int_1 + OpBranch %10 + %12 = OpLabel + OpReturn + OpFunctionEnd + )"; + test_cannot_peel(text, 0); + } + + { + SCOPED_TRACE("Ambiguous iterator update"); + + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" + OpExecutionMode %main OriginLowerLeft + OpSource GLSL 330 + OpName %main "main" + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %int_1 = OpConstant %int 1 + %int_10 = OpConstant %int 10 + %bool = OpTypeBool + %main = OpFunction %void None %3 + %5 = OpLabel + OpBranch %10 + %10 = OpLabel + %23 = OpPhi %int %int_0 %5 %17 %13 + OpLoopMerge %12 %13 None + OpBranch %14 + %14 = OpLabel + %17 = OpIAdd %int %23 %int_1 + %20 = OpSLessThan %bool %17 %int_10 + OpBranchConditional %20 %11 %12 + %11 = OpLabel + OpBranch %13 + %13 = OpLabel + OpBranch %10 + %12 = OpLabel + OpReturn + OpFunctionEnd + )"; + + test_cannot_peel(text, 0); + } + + { + SCOPED_TRACE("No loop static bounds"); + + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" + OpExecutionMode %main OriginLowerLeft + OpSource GLSL 330 + OpName %main "main" + OpName %i "i" + OpName %a "a" + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %uint = OpTypeInt 32 0 + %uint_10 = OpConstant %uint 10 +%_arr_int_uint_10 = OpTypeArray %int %uint_10 +%_ptr_Function__arr_int_uint_10 = OpTypePointer Function %_arr_int_uint_10 + %bool = OpTypeBool + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %3 + %5 = OpLabel + %i = OpVariable %_ptr_Function_int Function + %a = OpVariable %_ptr_Function__arr_int_uint_10 Function + OpStore %i %int_0 + OpBranch %10 + %10 = OpLabel + %28 = OpPhi %int %int_0 %5 %27 %13 + OpLoopMerge %12 %13 None + OpBranch %14 + %14 = OpLabel + %21 = OpAccessChain %_ptr_Function_int %a %28 + %22 = OpLoad %int %21 + %24 = OpINotEqual %bool %22 %int_0 + OpBranchConditional %24 %11 %12 + %11 = OpLabel + OpBranch %13 + %13 = OpLabel + %27 = OpIAdd %int %28 %int_1 + OpStore %i %27 + OpBranch %10 + %12 = OpLabel + OpReturn + OpFunctionEnd + )"; + + test_cannot_peel(text, 22); + } + { + SCOPED_TRACE("Int 64 type for conditions"); + + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginLowerLeft + OpSource GLSL 330 + OpName %2 "main" + OpName %4 "i" + %6 = OpTypeVoid + %3 = OpTypeFunction %6 + %7 = OpTypeInt 64 1 + %8 = OpTypePointer Function %7 + %9 = OpConstant %7 0 + %15 = OpConstant %7 10 + %16 = OpTypeBool + %17 = OpConstant %7 1 + %2 = OpFunction %6 None %3 + %5 = OpLabel + %4 = OpVariable %8 Function + OpStore %4 %9 + OpBranch %10 + %10 = OpLabel + %22 = OpPhi %7 %9 %5 %21 %13 + OpLoopMerge %12 %13 None + OpBranch %14 + %14 = OpLabel + %18 = OpSLessThan %16 %22 %15 + OpBranchConditional %18 %11 %12 + %11 = OpLabel + OpBranch %13 + %13 = OpLabel + %21 = OpIAdd %7 %22 %17 + OpStore %4 %21 + OpBranch %10 + %12 = OpLabel + OpReturn + OpFunctionEnd + )"; + // %15 is a constant for a 64 int. Currently rejected. + test_cannot_peel(text, 15); + } + { + SCOPED_TRACE("Float type for conditions"); + + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginLowerLeft + OpSource GLSL 330 + OpName %2 "main" + OpName %4 "i" + %6 = OpTypeVoid + %3 = OpTypeFunction %6 + %7 = OpTypeFloat 32 + %8 = OpTypePointer Function %7 + %9 = OpConstant %7 0 + %15 = OpConstant %7 10 + %16 = OpTypeBool + %17 = OpConstant %7 1 + %2 = OpFunction %6 None %3 + %5 = OpLabel + %4 = OpVariable %8 Function + OpStore %4 %9 + OpBranch %10 + %10 = OpLabel + %22 = OpPhi %7 %9 %5 %21 %13 + OpLoopMerge %12 %13 None + OpBranch %14 + %14 = OpLabel + %18 = OpFOrdLessThan %16 %22 %15 + OpBranchConditional %18 %11 %12 + %11 = OpLabel + OpBranch %13 + %13 = OpLabel + %21 = OpFAdd %7 %22 %17 + OpStore %4 %21 + OpBranch %10 + %12 = OpLabel + OpReturn + OpFunctionEnd + )"; + // %15 is a constant for a float. Currently rejected. + test_cannot_peel(text, 15); + } + { + SCOPED_TRACE("Side effect before exit"); + + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %o + OpExecutionMode %main OriginLowerLeft + OpSource GLSL 450 + OpName %main "main" + OpName %o "o" + OpName %i "i" + OpDecorate %o Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %o = OpVariable %_ptr_Output_float Output + %float_0 = OpConstant %float 0 + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %bool = OpTypeBool + %true = OpConstantTrue %bool + %float_1 = OpConstant %float 1 + %int_10 = OpConstant %int 10 + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %3 + %5 = OpLabel + %i = OpVariable %_ptr_Function_int Function + OpStore %o %float_0 + OpStore %i %int_0 + OpBranch %14 + %14 = OpLabel + %33 = OpPhi %int %int_0 %5 %32 %17 + OpLoopMerge %16 %17 None + OpBranch %15 + %15 = OpLabel + %22 = OpLoad %float %o + %23 = OpFAdd %float %22 %float_1 + OpStore %o %23 + %26 = OpSGreaterThan %bool %33 %int_10 + OpSelectionMerge %28 None + OpBranchConditional %26 %27 %28 + %27 = OpLabel + OpBranch %16 + %28 = OpLabel + OpBranch %17 + %17 = OpLabel + %32 = OpIAdd %int %33 %int_1 + OpStore %i %32 + OpBranch %14 + %16 = OpLabel + OpReturn + OpFunctionEnd + )"; + test_cannot_peel(text, 0); + } +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 330 core +void main() { + int i = 0; + for (; i < 10; i++) {} +} +*/ +TEST_F(PeelingTest, SimplePeeling) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" + OpExecutionMode %main OriginLowerLeft + OpSource GLSL 330 + OpName %main "main" + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %int_10 = OpConstant %int 10 + %bool = OpTypeBool + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %3 + %5 = OpLabel + OpBranch %10 + %10 = OpLabel + %22 = OpPhi %int %int_0 %5 %21 %13 + OpLoopMerge %12 %13 None + OpBranch %14 + %14 = OpLabel + %18 = OpSLessThan %bool %22 %int_10 + OpBranchConditional %18 %11 %12 + %11 = OpLabel + OpBranch %13 + %13 = OpLabel + %21 = OpIAdd %int %22 %int_1 + OpBranch %10 + %12 = OpLabel + OpReturn + OpFunctionEnd + )"; + + // Peel before. + { + SCOPED_TRACE("Peel before"); + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + ir::Function& f = *module->begin(); + ir::LoopDescriptor& ld = *context->GetLoopDescriptor(&f); + + EXPECT_EQ(ld.NumLoops(), 1u); + + opt::InstructionBuilder builder(context.get(), &*f.begin()); + // Exit condition. + ir::Instruction* ten_cst = builder.Add32BitSignedIntegerConstant(10); + + opt::LoopPeeling peel(context.get(), &*ld.begin(), ten_cst); + EXPECT_TRUE(peel.CanPeelLoop()); + peel.PeelBefore(2); + + const std::string check = R"( +CHECK: [[CST_TEN:%\w+]] = OpConstant {{%\w+}} 10 +CHECK: [[CST_TWO:%\w+]] = OpConstant {{%\w+}} 2 +CHECK: OpFunction +CHECK-NEXT: [[ENTRY:%\w+]] = OpLabel +CHECK: [[MIN_LOOP_COUNT:%\w+]] = OpSLessThan {{%\w+}} [[CST_TWO]] [[CST_TEN]] +CHECK-NEXT: [[LOOP_COUNT:%\w+]] = OpSelect {{%\w+}} [[MIN_LOOP_COUNT]] [[CST_TWO]] [[CST_TEN]] +CHECK: [[BEFORE_LOOP:%\w+]] = OpLabel +CHECK-NEXT: [[DUMMY_IT:%\w+]] = OpPhi {{%\w+}} {{%\w+}} [[ENTRY]] [[DUMMY_IT_1:%\w+]] [[BE:%\w+]] +CHECK-NEXT: [[i:%\w+]] = OpPhi {{%\w+}} {{%\w+}} [[ENTRY]] [[I_1:%\w+]] [[BE]] +CHECK-NEXT: OpLoopMerge [[AFTER_LOOP_PREHEADER:%\w+]] [[BE]] None +CHECK: [[COND_BLOCK:%\w+]] = OpLabel +CHECK-NEXT: OpSLessThan +CHECK-NEXT: [[EXIT_COND:%\w+]] = OpSLessThan {{%\w+}} [[DUMMY_IT]] +CHECK-NEXT: OpBranchConditional [[EXIT_COND]] {{%\w+}} [[AFTER_LOOP_PREHEADER]] +CHECK: [[I_1]] = OpIAdd {{%\w+}} [[i]] +CHECK-NEXT: [[DUMMY_IT_1]] = OpIAdd {{%\w+}} [[DUMMY_IT]] +CHECK-NEXT: OpBranch [[BEFORE_LOOP]] + +CHECK: [[AFTER_LOOP_PREHEADER]] = OpLabel +CHECK-NEXT: OpSelectionMerge [[IF_MERGE:%\w+]] +CHECK-NEXT: OpBranchConditional [[MIN_LOOP_COUNT]] [[AFTER_LOOP:%\w+]] [[IF_MERGE]] + +CHECK: [[AFTER_LOOP]] = OpLabel +CHECK-NEXT: OpPhi {{%\w+}} {{%\w+}} {{%\w+}} [[i]] [[AFTER_LOOP_PREHEADER]] +CHECK-NEXT: OpLoopMerge +)"; + + Match(check, context.get()); + } + + // Peel after. + { + SCOPED_TRACE("Peel after"); + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + ir::Function& f = *module->begin(); + ir::LoopDescriptor& ld = *context->GetLoopDescriptor(&f); + + EXPECT_EQ(ld.NumLoops(), 1u); + + opt::InstructionBuilder builder(context.get(), &*f.begin()); + // Exit condition. + ir::Instruction* ten_cst = builder.Add32BitSignedIntegerConstant(10); + + opt::LoopPeeling peel(context.get(), &*ld.begin(), ten_cst); + EXPECT_TRUE(peel.CanPeelLoop()); + peel.PeelAfter(2); + + const std::string check = R"( +CHECK: OpFunction +CHECK-NEXT: [[ENTRY:%\w+]] = OpLabel +CHECK: [[MIN_LOOP_COUNT:%\w+]] = OpSLessThan {{%\w+}} +CHECK-NEXT: OpSelectionMerge [[IF_MERGE:%\w+]] +CHECK-NEXT: OpBranchConditional [[MIN_LOOP_COUNT]] [[BEFORE_LOOP:%\w+]] [[IF_MERGE]] +CHECK: [[BEFORE_LOOP]] = OpLabel +CHECK-NEXT: [[DUMMY_IT:%\w+]] = OpPhi {{%\w+}} {{%\w+}} [[ENTRY]] [[DUMMY_IT_1:%\w+]] [[BE:%\w+]] +CHECK-NEXT: [[I:%\w+]] = OpPhi {{%\w+}} {{%\w+}} [[ENTRY]] [[I_1:%\w+]] [[BE]] +CHECK-NEXT: OpLoopMerge [[BEFORE_LOOP_MERGE:%\w+]] [[BE]] None +CHECK: [[COND_BLOCK:%\w+]] = OpLabel +CHECK-NEXT: OpSLessThan +CHECK-NEXT: [[TMP:%\w+]] = OpIAdd {{%\w+}} [[DUMMY_IT]] {{%\w+}} +CHECK-NEXT: [[EXIT_COND:%\w+]] = OpSLessThan {{%\w+}} [[TMP]] +CHECK-NEXT: OpBranchConditional [[EXIT_COND]] {{%\w+}} [[BEFORE_LOOP_MERGE]] +CHECK: [[I_1]] = OpIAdd {{%\w+}} [[I]] +CHECK-NEXT: [[DUMMY_IT_1]] = OpIAdd {{%\w+}} [[DUMMY_IT]] +CHECK-NEXT: OpBranch [[BEFORE_LOOP]] + +CHECK: [[IF_MERGE]] = OpLabel +CHECK-NEXT: [[TMP:%\w+]] = OpPhi {{%\w+}} [[I]] [[BEFORE_LOOP_MERGE]] +CHECK-NEXT: OpBranch [[AFTER_LOOP:%\w+]] + +CHECK: [[AFTER_LOOP]] = OpLabel +CHECK-NEXT: OpPhi {{%\w+}} {{%\w+}} {{%\w+}} [[TMP]] [[IF_MERGE]] +CHECK-NEXT: OpLoopMerge + +)"; + + Match(check, context.get()); + } +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 330 core +void main() { + int a[10]; + int n = a[0]; + for(int i = 0; i < n; ++i) {} +} +*/ +TEST_F(PeelingTest, PeelingUncountable) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" + OpExecutionMode %main OriginLowerLeft + OpSource GLSL 330 + OpName %main "main" + OpName %a "a" + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %uint = OpTypeInt 32 0 + %uint_10 = OpConstant %uint 10 +%_arr_int_uint_10 = OpTypeArray %int %uint_10 +%_ptr_Function__arr_int_uint_10 = OpTypePointer Function %_arr_int_uint_10 + %int_0 = OpConstant %int 0 + %bool = OpTypeBool + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %3 + %5 = OpLabel + %a = OpVariable %_ptr_Function__arr_int_uint_10 Function + %15 = OpAccessChain %_ptr_Function_int %a %int_0 + %16 = OpLoad %int %15 + OpBranch %18 + %18 = OpLabel + %30 = OpPhi %int %int_0 %5 %29 %21 + OpLoopMerge %20 %21 None + OpBranch %22 + %22 = OpLabel + %26 = OpSLessThan %bool %30 %16 + OpBranchConditional %26 %19 %20 + %19 = OpLabel + OpBranch %21 + %21 = OpLabel + %29 = OpIAdd %int %30 %int_1 + OpBranch %18 + %20 = OpLabel + OpReturn + OpFunctionEnd + )"; + + // Peel before. + { + SCOPED_TRACE("Peel before"); + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + ir::Function& f = *module->begin(); + ir::LoopDescriptor& ld = *context->GetLoopDescriptor(&f); + + EXPECT_EQ(ld.NumLoops(), 1u); + + ir::Instruction* loop_count = context->get_def_use_mgr()->GetDef(16); + EXPECT_EQ(loop_count->opcode(), SpvOpLoad); + + opt::LoopPeeling peel(context.get(), &*ld.begin(), loop_count); + EXPECT_TRUE(peel.CanPeelLoop()); + peel.PeelBefore(1); + + const std::string check = R"( +CHECK: OpFunction +CHECK-NEXT: [[ENTRY:%\w+]] = OpLabel +CHECK: [[LOOP_COUNT:%\w+]] = OpLoad +CHECK: [[MIN_LOOP_COUNT:%\w+]] = OpSLessThan {{%\w+}} {{%\w+}} [[LOOP_COUNT]] +CHECK-NEXT: [[LOOP_COUNT:%\w+]] = OpSelect {{%\w+}} [[MIN_LOOP_COUNT]] {{%\w+}} [[LOOP_COUNT]] +CHECK: [[BEFORE_LOOP:%\w+]] = OpLabel +CHECK-NEXT: [[DUMMY_IT:%\w+]] = OpPhi {{%\w+}} {{%\w+}} [[ENTRY]] [[DUMMY_IT_1:%\w+]] [[BE:%\w+]] +CHECK-NEXT: [[i:%\w+]] = OpPhi {{%\w+}} {{%\w+}} [[ENTRY]] [[I_1:%\w+]] [[BE]] +CHECK-NEXT: OpLoopMerge [[AFTER_LOOP_PREHEADER:%\w+]] [[BE]] None +CHECK: [[COND_BLOCK:%\w+]] = OpLabel +CHECK-NEXT: OpSLessThan +CHECK-NEXT: [[EXIT_COND:%\w+]] = OpSLessThan {{%\w+}} [[DUMMY_IT]] +CHECK-NEXT: OpBranchConditional [[EXIT_COND]] {{%\w+}} [[AFTER_LOOP_PREHEADER]] +CHECK: [[I_1]] = OpIAdd {{%\w+}} [[i]] +CHECK-NEXT: [[DUMMY_IT_1]] = OpIAdd {{%\w+}} [[DUMMY_IT]] +CHECK-NEXT: OpBranch [[BEFORE_LOOP]] + +CHECK: [[AFTER_LOOP_PREHEADER]] = OpLabel +CHECK-NEXT: OpSelectionMerge [[IF_MERGE:%\w+]] +CHECK-NEXT: OpBranchConditional [[MIN_LOOP_COUNT]] [[AFTER_LOOP:%\w+]] [[IF_MERGE]] + +CHECK: [[AFTER_LOOP]] = OpLabel +CHECK-NEXT: OpPhi {{%\w+}} {{%\w+}} {{%\w+}} [[i]] [[AFTER_LOOP_PREHEADER]] +CHECK-NEXT: OpLoopMerge +)"; + + Match(check, context.get()); + } + + // Peel after. + { + SCOPED_TRACE("Peel after"); + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + ir::Function& f = *module->begin(); + ir::LoopDescriptor& ld = *context->GetLoopDescriptor(&f); + + EXPECT_EQ(ld.NumLoops(), 1u); + + ir::Instruction* loop_count = context->get_def_use_mgr()->GetDef(16); + EXPECT_EQ(loop_count->opcode(), SpvOpLoad); + + opt::LoopPeeling peel(context.get(), &*ld.begin(), loop_count); + EXPECT_TRUE(peel.CanPeelLoop()); + peel.PeelAfter(1); + + const std::string check = R"( +CHECK: OpFunction +CHECK-NEXT: [[ENTRY:%\w+]] = OpLabel +CHECK: [[MIN_LOOP_COUNT:%\w+]] = OpSLessThan {{%\w+}} +CHECK-NEXT: OpSelectionMerge [[IF_MERGE:%\w+]] +CHECK-NEXT: OpBranchConditional [[MIN_LOOP_COUNT]] [[BEFORE_LOOP:%\w+]] [[IF_MERGE]] +CHECK: [[BEFORE_LOOP]] = OpLabel +CHECK-NEXT: [[DUMMY_IT:%\w+]] = OpPhi {{%\w+}} {{%\w+}} [[ENTRY]] [[DUMMY_IT_1:%\w+]] [[BE:%\w+]] +CHECK-NEXT: [[I:%\w+]] = OpPhi {{%\w+}} {{%\w+}} [[ENTRY]] [[I_1:%\w+]] [[BE]] +CHECK-NEXT: OpLoopMerge [[BEFORE_LOOP_MERGE:%\w+]] [[BE]] None +CHECK: [[COND_BLOCK:%\w+]] = OpLabel +CHECK-NEXT: OpSLessThan +CHECK-NEXT: [[TMP:%\w+]] = OpIAdd {{%\w+}} [[DUMMY_IT]] {{%\w+}} +CHECK-NEXT: [[EXIT_COND:%\w+]] = OpSLessThan {{%\w+}} [[TMP]] +CHECK-NEXT: OpBranchConditional [[EXIT_COND]] {{%\w+}} [[BEFORE_LOOP_MERGE]] +CHECK: [[I_1]] = OpIAdd {{%\w+}} [[I]] +CHECK-NEXT: [[DUMMY_IT_1]] = OpIAdd {{%\w+}} [[DUMMY_IT]] +CHECK-NEXT: OpBranch [[BEFORE_LOOP]] + +CHECK: [[IF_MERGE]] = OpLabel +CHECK-NEXT: [[TMP:%\w+]] = OpPhi {{%\w+}} [[I]] [[BEFORE_LOOP_MERGE]] +CHECK-NEXT: OpBranch [[AFTER_LOOP:%\w+]] + +CHECK: [[AFTER_LOOP]] = OpLabel +CHECK-NEXT: OpPhi {{%\w+}} {{%\w+}} {{%\w+}} [[TMP]] [[IF_MERGE]] +CHECK-NEXT: OpLoopMerge + +)"; + + Match(check, context.get()); + } +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 330 core +void main() { + int i = 0; + do { + i++; + } while (i < 10); +} +*/ +TEST_F(PeelingTest, DoWhilePeeling) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" + OpExecutionMode %main OriginLowerLeft + OpSource GLSL 330 + OpName %main "main" + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %int_1 = OpConstant %int 1 + %int_10 = OpConstant %int 10 + %bool = OpTypeBool + %main = OpFunction %void None %3 + %5 = OpLabel + OpBranch %10 + %10 = OpLabel + %21 = OpPhi %int %int_0 %5 %16 %13 + OpLoopMerge %12 %13 None + OpBranch %11 + %11 = OpLabel + %16 = OpIAdd %int %21 %int_1 + OpBranch %13 + %13 = OpLabel + %20 = OpSLessThan %bool %16 %int_10 + OpBranchConditional %20 %10 %12 + %12 = OpLabel + OpReturn + OpFunctionEnd + )"; + + // Peel before. + { + SCOPED_TRACE("Peel before"); + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + ir::Function& f = *module->begin(); + ir::LoopDescriptor& ld = *context->GetLoopDescriptor(&f); + + EXPECT_EQ(ld.NumLoops(), 1u); + opt::InstructionBuilder builder(context.get(), &*f.begin()); + // Exit condition. + ir::Instruction* ten_cst = builder.Add32BitUnsignedIntegerConstant(10); + + opt::LoopPeeling peel(context.get(), &*ld.begin(), ten_cst); + EXPECT_TRUE(peel.CanPeelLoop()); + peel.PeelBefore(2); + + const std::string check = R"( +CHECK: OpFunction +CHECK-NEXT: [[ENTRY:%\w+]] = OpLabel +CHECK: [[MIN_LOOP_COUNT:%\w+]] = OpULessThan {{%\w+}} +CHECK-NEXT: [[LOOP_COUNT:%\w+]] = OpSelect {{%\w+}} [[MIN_LOOP_COUNT]] +CHECK: [[BEFORE_LOOP:%\w+]] = OpLabel +CHECK-NEXT: [[DUMMY_IT:%\w+]] = OpPhi {{%\w+}} {{%\w+}} [[ENTRY]] [[DUMMY_IT_1:%\w+]] [[BE:%\w+]] +CHECK-NEXT: [[i:%\w+]] = OpPhi {{%\w+}} {{%\w+}} [[ENTRY]] [[I_1:%\w+]] [[BE]] +CHECK-NEXT: OpLoopMerge [[AFTER_LOOP_PREHEADER:%\w+]] [[BE]] None +CHECK: [[I_1]] = OpIAdd {{%\w+}} [[i]] +CHECK: [[BE]] = OpLabel +CHECK: [[DUMMY_IT_1]] = OpIAdd {{%\w+}} [[DUMMY_IT]] +CHECK-NEXT: [[EXIT_COND:%\w+]] = OpULessThan {{%\w+}} [[DUMMY_IT_1]] +CHECK-NEXT: OpBranchConditional [[EXIT_COND]] [[BEFORE_LOOP]] [[AFTER_LOOP_PREHEADER]] + +CHECK: [[AFTER_LOOP_PREHEADER]] = OpLabel +CHECK-NEXT: OpSelectionMerge [[IF_MERGE:%\w+]] +CHECK-NEXT: OpBranchConditional [[MIN_LOOP_COUNT]] [[AFTER_LOOP:%\w+]] [[IF_MERGE]] + +CHECK: [[AFTER_LOOP]] = OpLabel +CHECK-NEXT: OpPhi {{%\w+}} {{%\w+}} {{%\w+}} [[I_1]] [[AFTER_LOOP_PREHEADER]] +CHECK-NEXT: OpLoopMerge +)"; + + Match(check, context.get()); + } + + // Peel after. + { + SCOPED_TRACE("Peel after"); + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + ir::Function& f = *module->begin(); + ir::LoopDescriptor& ld = *context->GetLoopDescriptor(&f); + + EXPECT_EQ(ld.NumLoops(), 1u); + + opt::InstructionBuilder builder(context.get(), &*f.begin()); + // Exit condition. + ir::Instruction* ten_cst = builder.Add32BitUnsignedIntegerConstant(10); + + opt::LoopPeeling peel(context.get(), &*ld.begin(), ten_cst); + EXPECT_TRUE(peel.CanPeelLoop()); + peel.PeelAfter(2); + + const std::string check = R"( +CHECK: OpFunction +CHECK-NEXT: [[ENTRY:%\w+]] = OpLabel +CHECK: [[MIN_LOOP_COUNT:%\w+]] = OpULessThan {{%\w+}} +CHECK-NEXT: OpSelectionMerge [[IF_MERGE:%\w+]] +CHECK-NEXT: OpBranchConditional [[MIN_LOOP_COUNT]] [[BEFORE_LOOP:%\w+]] [[IF_MERGE]] +CHECK: [[BEFORE_LOOP]] = OpLabel +CHECK-NEXT: [[DUMMY_IT:%\w+]] = OpPhi {{%\w+}} {{%\w+}} [[ENTRY]] [[DUMMY_IT_1:%\w+]] [[BE:%\w+]] +CHECK-NEXT: [[I:%\w+]] = OpPhi {{%\w+}} {{%\w+}} [[ENTRY]] [[I_1:%\w+]] [[BE]] +CHECK-NEXT: OpLoopMerge [[BEFORE_LOOP_MERGE:%\w+]] [[BE]] None +CHECK: [[I_1]] = OpIAdd {{%\w+}} [[I]] +CHECK: [[BE]] = OpLabel +CHECK: [[DUMMY_IT_1]] = OpIAdd {{%\w+}} [[DUMMY_IT]] +CHECK-NEXT: [[EXIT_VAL:%\w+]] = OpIAdd {{%\w+}} [[DUMMY_IT_1]] +CHECK-NEXT: [[EXIT_COND:%\w+]] = OpULessThan {{%\w+}} [[EXIT_VAL]] +CHECK-NEXT: OpBranchConditional [[EXIT_COND]] [[BEFORE_LOOP]] [[BEFORE_LOOP_MERGE]] + +CHECK: [[IF_MERGE]] = OpLabel +CHECK-NEXT: [[TMP:%\w+]] = OpPhi {{%\w+}} [[I_1]] [[BEFORE_LOOP_MERGE]] +CHECK-NEXT: OpBranch [[AFTER_LOOP:%\w+]] + +CHECK: [[AFTER_LOOP]] = OpLabel +CHECK-NEXT: OpPhi {{%\w+}} {{%\w+}} {{%\w+}} [[TMP]] [[IF_MERGE]] +CHECK-NEXT: OpLoopMerge +)"; + + Match(check, context.get()); + } +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 330 core +void main() { + int a[10]; + int n = a[0]; + for(int i = 0; i < n; ++i) {} +} +*/ +TEST_F(PeelingTest, PeelingLoopWithStore) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %o %n + OpExecutionMode %main OriginLowerLeft + OpSource GLSL 450 + OpName %main "main" + OpName %o "o" + OpName %end "end" + OpName %n "n" + OpName %i "i" + OpDecorate %o Location 0 + OpDecorate %n Flat + OpDecorate %n Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %o = OpVariable %_ptr_Output_float Output + %float_0 = OpConstant %float 0 + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int +%_ptr_Input_int = OpTypePointer Input %int + %n = OpVariable %_ptr_Input_int Input + %int_0 = OpConstant %int 0 + %bool = OpTypeBool + %float_1 = OpConstant %float 1 + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %3 + %5 = OpLabel + %end = OpVariable %_ptr_Function_int Function + %i = OpVariable %_ptr_Function_int Function + OpStore %o %float_0 + %15 = OpLoad %int %n + OpStore %end %15 + OpStore %i %int_0 + OpBranch %18 + %18 = OpLabel + %33 = OpPhi %int %int_0 %5 %32 %21 + OpLoopMerge %20 %21 None + OpBranch %22 + %22 = OpLabel + %26 = OpSLessThan %bool %33 %15 + OpBranchConditional %26 %19 %20 + %19 = OpLabel + %28 = OpLoad %float %o + %29 = OpFAdd %float %28 %float_1 + OpStore %o %29 + OpBranch %21 + %21 = OpLabel + %32 = OpIAdd %int %33 %int_1 + OpStore %i %32 + OpBranch %18 + %20 = OpLabel + OpReturn + OpFunctionEnd + )"; + + // Peel before. + { + SCOPED_TRACE("Peel before"); + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + ir::Function& f = *module->begin(); + ir::LoopDescriptor& ld = *context->GetLoopDescriptor(&f); + + EXPECT_EQ(ld.NumLoops(), 1u); + + ir::Instruction* loop_count = context->get_def_use_mgr()->GetDef(15); + EXPECT_EQ(loop_count->opcode(), SpvOpLoad); + + opt::LoopPeeling peel(context.get(), &*ld.begin(), loop_count); + EXPECT_TRUE(peel.CanPeelLoop()); + peel.PeelBefore(1); + + const std::string check = R"( +CHECK: OpFunction +CHECK-NEXT: [[ENTRY:%\w+]] = OpLabel +CHECK: [[LOOP_COUNT:%\w+]] = OpLoad +CHECK: [[MIN_LOOP_COUNT:%\w+]] = OpSLessThan {{%\w+}} {{%\w+}} [[LOOP_COUNT]] +CHECK-NEXT: [[LOOP_COUNT:%\w+]] = OpSelect {{%\w+}} [[MIN_LOOP_COUNT]] {{%\w+}} [[LOOP_COUNT]] +CHECK: [[BEFORE_LOOP:%\w+]] = OpLabel +CHECK-NEXT: [[DUMMY_IT:%\w+]] = OpPhi {{%\w+}} {{%\w+}} [[ENTRY]] [[DUMMY_IT_1:%\w+]] [[BE:%\w+]] +CHECK-NEXT: [[i:%\w+]] = OpPhi {{%\w+}} {{%\w+}} [[ENTRY]] [[I_1:%\w+]] [[BE]] +CHECK-NEXT: OpLoopMerge [[AFTER_LOOP_PREHEADER:%\w+]] [[BE]] None +CHECK: [[COND_BLOCK:%\w+]] = OpLabel +CHECK-NEXT: OpSLessThan +CHECK-NEXT: [[EXIT_COND:%\w+]] = OpSLessThan {{%\w+}} [[DUMMY_IT]] +CHECK-NEXT: OpBranchConditional [[EXIT_COND]] {{%\w+}} [[AFTER_LOOP_PREHEADER]] +CHECK: [[I_1]] = OpIAdd {{%\w+}} [[i]] +CHECK: [[DUMMY_IT_1]] = OpIAdd {{%\w+}} [[DUMMY_IT]] +CHECK-NEXT: OpBranch [[BEFORE_LOOP]] + +CHECK: [[AFTER_LOOP_PREHEADER]] = OpLabel +CHECK-NEXT: OpSelectionMerge [[IF_MERGE:%\w+]] +CHECK-NEXT: OpBranchConditional [[MIN_LOOP_COUNT]] [[AFTER_LOOP:%\w+]] [[IF_MERGE]] + +CHECK: [[AFTER_LOOP]] = OpLabel +CHECK-NEXT: OpPhi {{%\w+}} {{%\w+}} {{%\w+}} [[i]] [[AFTER_LOOP_PREHEADER]] +CHECK-NEXT: OpLoopMerge +)"; + + Match(check, context.get()); + } + + // Peel after. + { + SCOPED_TRACE("Peel after"); + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + ir::Function& f = *module->begin(); + ir::LoopDescriptor& ld = *context->GetLoopDescriptor(&f); + + EXPECT_EQ(ld.NumLoops(), 1u); + + ir::Instruction* loop_count = context->get_def_use_mgr()->GetDef(15); + EXPECT_EQ(loop_count->opcode(), SpvOpLoad); + + opt::LoopPeeling peel(context.get(), &*ld.begin(), loop_count); + EXPECT_TRUE(peel.CanPeelLoop()); + peel.PeelAfter(1); + + const std::string check = R"( +CHECK: OpFunction +CHECK-NEXT: [[ENTRY:%\w+]] = OpLabel +CHECK: [[MIN_LOOP_COUNT:%\w+]] = OpSLessThan {{%\w+}} +CHECK-NEXT: OpSelectionMerge [[IF_MERGE:%\w+]] +CHECK-NEXT: OpBranchConditional [[MIN_LOOP_COUNT]] [[BEFORE_LOOP:%\w+]] [[IF_MERGE]] +CHECK: [[BEFORE_LOOP]] = OpLabel +CHECK-NEXT: [[DUMMY_IT:%\w+]] = OpPhi {{%\w+}} {{%\w+}} [[ENTRY]] [[DUMMY_IT_1:%\w+]] [[BE:%\w+]] +CHECK-NEXT: [[I:%\w+]] = OpPhi {{%\w+}} {{%\w+}} [[ENTRY]] [[I_1:%\w+]] [[BE]] +CHECK-NEXT: OpLoopMerge [[BEFORE_LOOP_MERGE:%\w+]] [[BE]] None +CHECK: [[COND_BLOCK:%\w+]] = OpLabel +CHECK-NEXT: OpSLessThan +CHECK-NEXT: [[TMP:%\w+]] = OpIAdd {{%\w+}} [[DUMMY_IT]] {{%\w+}} +CHECK-NEXT: [[EXIT_COND:%\w+]] = OpSLessThan {{%\w+}} [[TMP]] +CHECK-NEXT: OpBranchConditional [[EXIT_COND]] {{%\w+}} [[BEFORE_LOOP_MERGE]] +CHECK: [[I_1]] = OpIAdd {{%\w+}} [[I]] +CHECK: [[DUMMY_IT_1]] = OpIAdd {{%\w+}} [[DUMMY_IT]] +CHECK-NEXT: OpBranch [[BEFORE_LOOP]] + +CHECK: [[IF_MERGE]] = OpLabel +CHECK-NEXT: [[TMP:%\w+]] = OpPhi {{%\w+}} [[I]] [[BEFORE_LOOP_MERGE]] +CHECK-NEXT: OpBranch [[AFTER_LOOP:%\w+]] + +CHECK: [[AFTER_LOOP]] = OpLabel +CHECK-NEXT: OpPhi {{%\w+}} {{%\w+}} {{%\w+}} [[TMP]] [[IF_MERGE]] +CHECK-NEXT: OpLoopMerge + +)"; + + Match(check, context.get()); + } +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/unroll_assumptions.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/unroll_assumptions.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/unroll_assumptions.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/unroll_assumptions.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1446 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include + +#include + +#include "../assembly_builder.h" +#include "../function_utils.h" +#include "../pass_fixture.h" +#include "../pass_utils.h" +#include "opt/loop_unroller.h" +#include "opt/loop_utils.h" +#include "opt/pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +template +class PartialUnrollerTestPass : public opt::Pass { + public: + PartialUnrollerTestPass() : Pass() {} + + const char* name() const override { return "Loop unroller"; } + + Status Process(ir::IRContext* context) override { + bool changed = false; + for (ir::Function& f : *context->module()) { + ir::LoopDescriptor& loop_descriptor = *context->GetLoopDescriptor(&f); + for (auto& loop : loop_descriptor) { + opt::LoopUtils loop_utils{context, &loop}; + if (loop_utils.PartiallyUnroll(factor)) { + changed = true; + } + } + } + + if (changed) return Pass::Status::SuccessWithChange; + return Pass::Status::SuccessWithoutChange; + } +}; + +using PassClassTest = PassTest<::testing::Test>; + +/* +Generated from the following GLSL +#version 410 core +layout(location = 0) flat in int in_upper_bound; +void main() { + for (int i = 0; i < in_upper_bound; ++i) { + x[i] = 1.0f; + } +} +*/ +TEST_F(PassClassTest, CheckUpperBound) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" %3 +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 410 +OpName %2 "main" +OpName %3 "in_upper_bound" +OpName %4 "x" +OpDecorate %3 Flat +OpDecorate %3 Location 0 +%5 = OpTypeVoid +%6 = OpTypeFunction %5 +%7 = OpTypeInt 32 1 +%8 = OpTypePointer Function %7 +%9 = OpConstant %7 0 +%10 = OpTypePointer Input %7 +%3 = OpVariable %10 Input +%11 = OpTypeBool +%12 = OpTypeFloat 32 +%13 = OpTypeInt 32 0 +%14 = OpConstant %13 10 +%15 = OpTypeArray %12 %14 +%16 = OpTypePointer Function %15 +%17 = OpConstant %12 1 +%18 = OpTypePointer Function %12 +%19 = OpConstant %7 1 +%2 = OpFunction %5 None %6 +%20 = OpLabel +%4 = OpVariable %16 Function +OpBranch %21 +%21 = OpLabel +%22 = OpPhi %7 %9 %20 %23 %24 +OpLoopMerge %25 %24 Unroll +OpBranch %26 +%26 = OpLabel +%27 = OpLoad %7 %3 +%28 = OpSLessThan %11 %22 %27 +OpBranchConditional %28 %29 %25 +%29 = OpLabel +%30 = OpAccessChain %18 %4 %22 +OpStore %30 %17 +OpBranch %24 +%24 = OpLabel +%23 = OpIAdd %7 %22 %19 +OpBranch %21 +%25 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + + // Make sure the pass doesn't run + SinglePassRunAndCheck(text, text, false); + SinglePassRunAndCheck>(text, text, false); + SinglePassRunAndCheck>(text, text, false); +} + +/* +Generated from the following GLSL +#version 410 core +void main() { + float out_array[10]; + for (uint i = 0; i < 2; i++) { + for (float x = 0; x < 5; ++x) { + out_array[x + i*5] = i; + } + } +} +*/ +TEST_F(PassClassTest, UnrollNestedLoopsInvalid) { + // clang-format off + // With opt::LocalMultiStoreElimPass +const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 410 +OpName %2 "main" +OpName %3 "out_array" +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeInt 32 0 +%7 = OpTypePointer Function %6 +%8 = OpConstant %6 0 +%9 = OpConstant %6 2 +%10 = OpTypeBool +%11 = OpTypeInt 32 1 +%12 = OpTypePointer Function %11 +%13 = OpConstant %11 0 +%14 = OpConstant %11 5 +%15 = OpTypeFloat 32 +%16 = OpConstant %6 10 +%17 = OpTypeArray %15 %16 +%18 = OpTypePointer Function %17 +%19 = OpConstant %6 5 +%20 = OpTypePointer Function %15 +%21 = OpConstant %11 1 +%22 = OpUndef %11 +%2 = OpFunction %4 None %5 +%23 = OpLabel +%3 = OpVariable %18 Function +OpBranch %24 +%24 = OpLabel +%25 = OpPhi %6 %8 %23 %26 %27 +%28 = OpPhi %11 %22 %23 %29 %27 +OpLoopMerge %30 %27 Unroll +OpBranch %31 +%31 = OpLabel +%32 = OpULessThan %10 %25 %9 +OpBranchConditional %32 %33 %30 +%33 = OpLabel +OpBranch %34 +%34 = OpLabel +%29 = OpPhi %11 %13 %33 %35 %36 +OpLoopMerge %37 %36 None +OpBranch %38 +%38 = OpLabel +%39 = OpSLessThan %10 %29 %14 +OpBranchConditional %39 %40 %37 +%40 = OpLabel +%41 = OpBitcast %6 %29 +%42 = OpIMul %6 %25 %19 +%43 = OpIAdd %6 %41 %42 +%44 = OpConvertUToF %15 %25 +%45 = OpAccessChain %20 %3 %43 +OpStore %45 %44 +OpBranch %36 +%36 = OpLabel +%35 = OpIAdd %11 %29 %21 +OpBranch %34 +%37 = OpLabel +OpBranch %27 +%27 = OpLabel +%26 = OpIAdd %6 %25 %21 +OpBranch %24 +%30 = OpLabel +OpReturn +OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(text, text, false); +} + +/* +Generated from the following GLSL +#version 440 core +void main(){ + float x[10]; + for (int i = 0; i < 10; i++) { + if (i == 5) { + break; + } + x[i] = i; + } +} +*/ +TEST_F(PassClassTest, BreakInBody) { + // clang-format off + // With opt::LocalMultiStoreElimPass +const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 440 +OpName %2 "main" +OpName %3 "x" +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeInt 32 1 +%7 = OpTypePointer Function %6 +%8 = OpConstant %6 0 +%9 = OpConstant %6 10 +%10 = OpTypeBool +%11 = OpConstant %6 5 +%12 = OpTypeFloat 32 +%13 = OpTypeInt 32 0 +%14 = OpConstant %13 10 +%15 = OpTypeArray %12 %14 +%16 = OpTypePointer Function %15 +%17 = OpTypePointer Function %12 +%18 = OpConstant %6 1 +%2 = OpFunction %4 None %5 +%19 = OpLabel +%3 = OpVariable %16 Function +OpBranch %20 +%20 = OpLabel +%21 = OpPhi %6 %8 %19 %22 %23 +OpLoopMerge %24 %23 Unroll +OpBranch %25 +%25 = OpLabel +%26 = OpSLessThan %10 %21 %9 +OpBranchConditional %26 %27 %24 +%27 = OpLabel +%28 = OpIEqual %10 %21 %11 +OpSelectionMerge %29 None +OpBranchConditional %28 %30 %29 +%30 = OpLabel +OpBranch %24 +%29 = OpLabel +%31 = OpConvertSToF %12 %21 +%32 = OpAccessChain %17 %3 %21 +OpStore %32 %31 +OpBranch %23 +%23 = OpLabel +%22 = OpIAdd %6 %21 %18 +OpBranch %20 +%24 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(text, text, false); +} + +/* +Generated from the following GLSL +#version 440 core +void main(){ + float x[10]; + for (int i = 0; i < 10; i++) { + if (i == 5) { + continue; + } + x[i] = i; + } +} +*/ +TEST_F(PassClassTest, ContinueInBody) { + // clang-format off + // With opt::LocalMultiStoreElimPass +const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 440 +OpName %2 "main" +OpName %3 "x" +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeInt 32 1 +%7 = OpTypePointer Function %6 +%8 = OpConstant %6 0 +%9 = OpConstant %6 10 +%10 = OpTypeBool +%11 = OpConstant %6 5 +%12 = OpTypeFloat 32 +%13 = OpTypeInt 32 0 +%14 = OpConstant %13 10 +%15 = OpTypeArray %12 %14 +%16 = OpTypePointer Function %15 +%17 = OpTypePointer Function %12 +%18 = OpConstant %6 1 +%2 = OpFunction %4 None %5 +%19 = OpLabel +%3 = OpVariable %16 Function +OpBranch %20 +%20 = OpLabel +%21 = OpPhi %6 %8 %19 %22 %23 +OpLoopMerge %24 %23 Unroll +OpBranch %25 +%25 = OpLabel +%26 = OpSLessThan %10 %21 %9 +OpBranchConditional %26 %27 %24 +%27 = OpLabel +%28 = OpIEqual %10 %21 %11 +OpSelectionMerge %29 None +OpBranchConditional %28 %30 %29 +%30 = OpLabel +OpBranch %23 +%29 = OpLabel +%31 = OpConvertSToF %12 %21 +%32 = OpAccessChain %17 %3 %21 +OpStore %32 %31 +OpBranch %23 +%23 = OpLabel +%22 = OpIAdd %6 %21 %18 +OpBranch %20 +%24 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(text, text, false); +} + +/* +Generated from the following GLSL +#version 440 core +void main(){ + float x[10]; + for (int i = 0; i < 10; i++) { + if (i == 5) { + return; + } + x[i] = i; + } +} +*/ +TEST_F(PassClassTest, ReturnInBody) { + // clang-format off + // With opt::LocalMultiStoreElimPass +const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 440 +OpName %2 "main" +OpName %3 "x" +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeInt 32 1 +%7 = OpTypePointer Function %6 +%8 = OpConstant %6 0 +%9 = OpConstant %6 10 +%10 = OpTypeBool +%11 = OpConstant %6 5 +%12 = OpTypeFloat 32 +%13 = OpTypeInt 32 0 +%14 = OpConstant %13 10 +%15 = OpTypeArray %12 %14 +%16 = OpTypePointer Function %15 +%17 = OpTypePointer Function %12 +%18 = OpConstant %6 1 +%2 = OpFunction %4 None %5 +%19 = OpLabel +%3 = OpVariable %16 Function +OpBranch %20 +%20 = OpLabel +%21 = OpPhi %6 %8 %19 %22 %23 +OpLoopMerge %24 %23 Unroll +OpBranch %25 +%25 = OpLabel +%26 = OpSLessThan %10 %21 %9 +OpBranchConditional %26 %27 %24 +%27 = OpLabel +%28 = OpIEqual %10 %21 %11 +OpSelectionMerge %29 None +OpBranchConditional %28 %30 %29 +%30 = OpLabel +OpReturn +%29 = OpLabel +%31 = OpConvertSToF %12 %21 +%32 = OpAccessChain %17 %3 %21 +OpStore %32 %31 +OpBranch %23 +%23 = OpLabel +%22 = OpIAdd %6 %21 %18 +OpBranch %20 +%24 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(text, text, false); +} + +/* +Generated from the following GLSL +#version 440 core +void main() { + int j = 0; + for (int i = 0; i < 10 && i > 0; i++) { + j++; + } +} +*/ +TEST_F(PassClassTest, MultipleConditionsSingleVariable) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 440 +OpName %2 "main" +%3 = OpTypeVoid +%4 = OpTypeFunction %3 +%5 = OpTypeInt 32 1 +%6 = OpTypePointer Function %5 +%7 = OpConstant %5 0 +%8 = OpConstant %5 10 +%9 = OpTypeBool +%10 = OpConstant %5 1 +%2 = OpFunction %3 None %4 +%11 = OpLabel +OpBranch %12 +%12 = OpLabel +%13 = OpPhi %5 %7 %11 %14 %15 +%16 = OpPhi %5 %7 %11 %17 %15 +OpLoopMerge %18 %15 Unroll +OpBranch %19 +%19 = OpLabel +%20 = OpSLessThan %9 %16 %8 +%21 = OpSGreaterThan %9 %16 %7 +%22 = OpLogicalAnd %9 %20 %21 +OpBranchConditional %22 %23 %18 +%23 = OpLabel +%14 = OpIAdd %5 %13 %10 +OpBranch %15 +%15 = OpLabel +%17 = OpIAdd %5 %16 %10 +OpBranch %12 +%18 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + + // Make sure the pass doesn't run + SinglePassRunAndCheck(text, text, false); + SinglePassRunAndCheck>(text, text, false); + SinglePassRunAndCheck>(text, text, false); +} + +/* +Generated from the following GLSL +#version 440 core +void main() { + int i = 0; + int j = 0; + int k = 0; + for (; i < 10 && j > 0; i++, j++) { + k++; + } +} +*/ +TEST_F(PassClassTest, MultipleConditionsMultipleVariables) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 440 +OpName %2 "main" +%3 = OpTypeVoid +%4 = OpTypeFunction %3 +%5 = OpTypeInt 32 1 +%6 = OpTypePointer Function %5 +%7 = OpConstant %5 0 +%8 = OpConstant %5 10 +%9 = OpTypeBool +%10 = OpConstant %5 1 +%2 = OpFunction %3 None %4 +%11 = OpLabel +OpBranch %12 +%12 = OpLabel +%13 = OpPhi %5 %7 %11 %14 %15 +%16 = OpPhi %5 %7 %11 %17 %15 +%18 = OpPhi %5 %7 %11 %19 %15 +OpLoopMerge %20 %15 Unroll +OpBranch %21 +%21 = OpLabel +%22 = OpSLessThan %9 %13 %8 +%23 = OpSGreaterThan %9 %16 %7 +%24 = OpLogicalAnd %9 %22 %23 +OpBranchConditional %24 %25 %20 +%25 = OpLabel +%19 = OpIAdd %5 %18 %10 +OpBranch %15 +%15 = OpLabel +%14 = OpIAdd %5 %13 %10 +%17 = OpIAdd %5 %16 %10 +OpBranch %12 +%20 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + + // Make sure the pass doesn't run + SinglePassRunAndCheck(text, text, false); + SinglePassRunAndCheck>(text, text, false); + SinglePassRunAndCheck>(text, text, false); +} + +/* +Generated from the following GLSL +#version 440 core +void main() { + float i = 0.0; + int j = 0; + for (; i < 10; i++) { + j++; + } +} +*/ +TEST_F(PassClassTest, FloatingPointLoop) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 440 +OpName %2 "main" +%3 = OpTypeVoid +%4 = OpTypeFunction %3 +%5 = OpTypeFloat 32 +%6 = OpTypePointer Function %5 +%7 = OpConstant %5 0 +%8 = OpTypeInt 32 1 +%9 = OpTypePointer Function %8 +%10 = OpConstant %8 0 +%11 = OpConstant %5 10 +%12 = OpTypeBool +%13 = OpConstant %8 1 +%14 = OpConstant %5 1 +%2 = OpFunction %3 None %4 +%15 = OpLabel +OpBranch %16 +%16 = OpLabel +%17 = OpPhi %5 %7 %15 %18 %19 +%20 = OpPhi %8 %10 %15 %21 %19 +OpLoopMerge %22 %19 Unroll +OpBranch %23 +%23 = OpLabel +%24 = OpFOrdLessThan %12 %17 %11 +OpBranchConditional %24 %25 %22 +%25 = OpLabel +%21 = OpIAdd %8 %20 %13 +OpBranch %19 +%19 = OpLabel +%18 = OpFAdd %5 %17 %14 +OpBranch %16 +%22 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + + // Make sure the pass doesn't run + SinglePassRunAndCheck(text, text, false); + SinglePassRunAndCheck>(text, text, false); + SinglePassRunAndCheck>(text, text, false); +} + +/* +Generated from the following GLSL +#version 440 core +void main() { + int i = 2; + int j = 0; + if (j == 0) { i = 5; } + for (; i < 3; ++i) { + j++; + } +} +*/ +TEST_F(PassClassTest, InductionPhiOutsideLoop) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 440 +OpName %2 "main" +%3 = OpTypeVoid +%4 = OpTypeFunction %3 +%5 = OpTypeInt 32 1 +%6 = OpTypePointer Function %5 +%7 = OpConstant %5 2 +%8 = OpConstant %5 0 +%9 = OpTypeBool +%10 = OpConstant %5 5 +%11 = OpConstant %5 3 +%12 = OpConstant %5 1 +%2 = OpFunction %3 None %4 +%13 = OpLabel +%14 = OpIEqual %9 %8 %8 +OpSelectionMerge %15 None +OpBranchConditional %14 %16 %15 +%16 = OpLabel +OpBranch %15 +%15 = OpLabel +%17 = OpPhi %5 %7 %13 %10 %16 +OpBranch %18 +%18 = OpLabel +%19 = OpPhi %5 %17 %15 %20 %21 +%22 = OpPhi %5 %8 %15 %23 %21 +OpLoopMerge %24 %21 Unroll +OpBranch %25 +%25 = OpLabel +%26 = OpSLessThan %9 %19 %11 +OpBranchConditional %26 %27 %24 +%27 = OpLabel +%23 = OpIAdd %5 %22 %12 +OpBranch %21 +%21 = OpLabel +%20 = OpIAdd %5 %19 %12 +OpBranch %18 +%24 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + + // Make sure the pass doesn't run + SinglePassRunAndCheck(text, text, false); + SinglePassRunAndCheck>(text, text, false); + SinglePassRunAndCheck>(text, text, false); +} + +/* +Generated from the following GLSL +#version 440 core +void main() { + int j = 0; + for (int i = 0; i == 0; ++i) { + ++j; + } + for (int i = 0; i != 3; ++i) { + ++j; + } + for (int i = 0; i < 3; i *= 2) { + ++j; + } + for (int i = 10; i > 3; i /= 2) { + ++j; + } + for (int i = 10; i > 3; i |= 2) { + ++j; + } + for (int i = 10; i > 3; i &= 2) { + ++j; + } + for (int i = 10; i > 3; i ^= 2) { + ++j; + } + for (int i = 0; i < 3; i << 2) { + ++j; + } + for (int i = 10; i > 3; i >> 2) { + ++j; + } +} +*/ +TEST_F(PassClassTest, UnsupportedLoopTypes) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 440 +OpName %2 "main" +%3 = OpTypeVoid +%4 = OpTypeFunction %3 +%5 = OpTypeInt 32 1 +%6 = OpTypePointer Function %5 +%7 = OpConstant %5 0 +%8 = OpTypeBool +%9 = OpConstant %5 1 +%10 = OpConstant %5 3 +%11 = OpConstant %5 2 +%12 = OpConstant %5 10 +%2 = OpFunction %3 None %4 +%13 = OpLabel +OpBranch %14 +%14 = OpLabel +%15 = OpPhi %5 %7 %13 %16 %17 +%18 = OpPhi %5 %7 %13 %19 %17 +OpLoopMerge %20 %17 Unroll +OpBranch %21 +%21 = OpLabel +%22 = OpIEqual %8 %18 %7 +OpBranchConditional %22 %23 %20 +%23 = OpLabel +%16 = OpIAdd %5 %15 %9 +OpBranch %17 +%17 = OpLabel +%19 = OpIAdd %5 %18 %9 +OpBranch %14 +%20 = OpLabel +OpBranch %24 +%24 = OpLabel +%25 = OpPhi %5 %15 %20 %26 %27 +%28 = OpPhi %5 %7 %20 %29 %27 +OpLoopMerge %30 %27 Unroll +OpBranch %31 +%31 = OpLabel +%32 = OpINotEqual %8 %28 %10 +OpBranchConditional %32 %33 %30 +%33 = OpLabel +%26 = OpIAdd %5 %25 %9 +OpBranch %27 +%27 = OpLabel +%29 = OpIAdd %5 %28 %9 +OpBranch %24 +%30 = OpLabel +OpBranch %34 +%34 = OpLabel +%35 = OpPhi %5 %25 %30 %36 %37 +%38 = OpPhi %5 %7 %30 %39 %37 +OpLoopMerge %40 %37 Unroll +OpBranch %41 +%41 = OpLabel +%42 = OpSLessThan %8 %38 %10 +OpBranchConditional %42 %43 %40 +%43 = OpLabel +%36 = OpIAdd %5 %35 %9 +OpBranch %37 +%37 = OpLabel +%39 = OpIMul %5 %38 %11 +OpBranch %34 +%40 = OpLabel +OpBranch %44 +%44 = OpLabel +%45 = OpPhi %5 %35 %40 %46 %47 +%48 = OpPhi %5 %12 %40 %49 %47 +OpLoopMerge %50 %47 Unroll +OpBranch %51 +%51 = OpLabel +%52 = OpSGreaterThan %8 %48 %10 +OpBranchConditional %52 %53 %50 +%53 = OpLabel +%46 = OpIAdd %5 %45 %9 +OpBranch %47 +%47 = OpLabel +%49 = OpSDiv %5 %48 %11 +OpBranch %44 +%50 = OpLabel +OpBranch %54 +%54 = OpLabel +%55 = OpPhi %5 %45 %50 %56 %57 +%58 = OpPhi %5 %12 %50 %59 %57 +OpLoopMerge %60 %57 Unroll +OpBranch %61 +%61 = OpLabel +%62 = OpSGreaterThan %8 %58 %10 +OpBranchConditional %62 %63 %60 +%63 = OpLabel +%56 = OpIAdd %5 %55 %9 +OpBranch %57 +%57 = OpLabel +%59 = OpBitwiseOr %5 %58 %11 +OpBranch %54 +%60 = OpLabel +OpBranch %64 +%64 = OpLabel +%65 = OpPhi %5 %55 %60 %66 %67 +%68 = OpPhi %5 %12 %60 %69 %67 +OpLoopMerge %70 %67 Unroll +OpBranch %71 +%71 = OpLabel +%72 = OpSGreaterThan %8 %68 %10 +OpBranchConditional %72 %73 %70 +%73 = OpLabel +%66 = OpIAdd %5 %65 %9 +OpBranch %67 +%67 = OpLabel +%69 = OpBitwiseAnd %5 %68 %11 +OpBranch %64 +%70 = OpLabel +OpBranch %74 +%74 = OpLabel +%75 = OpPhi %5 %65 %70 %76 %77 +%78 = OpPhi %5 %12 %70 %79 %77 +OpLoopMerge %80 %77 Unroll +OpBranch %81 +%81 = OpLabel +%82 = OpSGreaterThan %8 %78 %10 +OpBranchConditional %82 %83 %80 +%83 = OpLabel +%76 = OpIAdd %5 %75 %9 +OpBranch %77 +%77 = OpLabel +%79 = OpBitwiseXor %5 %78 %11 +OpBranch %74 +%80 = OpLabel +OpBranch %84 +%84 = OpLabel +%85 = OpPhi %5 %75 %80 %86 %87 +OpLoopMerge %88 %87 Unroll +OpBranch %89 +%89 = OpLabel +%90 = OpSLessThan %8 %7 %10 +OpBranchConditional %90 %91 %88 +%91 = OpLabel +%86 = OpIAdd %5 %85 %9 +OpBranch %87 +%87 = OpLabel +%92 = OpShiftLeftLogical %5 %7 %11 +OpBranch %84 +%88 = OpLabel +OpBranch %93 +%93 = OpLabel +%94 = OpPhi %5 %85 %88 %95 %96 +OpLoopMerge %97 %96 Unroll +OpBranch %98 +%98 = OpLabel +%99 = OpSGreaterThan %8 %12 %10 +OpBranchConditional %99 %100 %97 +%100 = OpLabel +%95 = OpIAdd %5 %94 %9 +OpBranch %96 +%96 = OpLabel +%101 = OpShiftRightArithmetic %5 %12 %11 +OpBranch %93 +%97 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + + // Make sure the pass doesn't run + SinglePassRunAndCheck(text, text, false); + SinglePassRunAndCheck>(text, text, false); + SinglePassRunAndCheck>(text, text, false); +} + +/* +#version 430 + +layout(location = 0) out float o; + +void main(void) { + for (int j = 2; j < 0; j += 1) { + o += 1.0; + } +} +*/ +TEST_F(PassClassTest, NegativeNumberOfIterations) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" %3 +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 430 +OpName %2 "main" +OpName %3 "o" +OpDecorate %3 Location 0 +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeInt 32 1 +%7 = OpTypePointer Function %6 +%8 = OpConstant %6 2 +%9 = OpConstant %6 0 +%10 = OpTypeBool +%11 = OpTypeFloat 32 +%12 = OpTypePointer Output %11 +%3 = OpVariable %12 Output +%13 = OpConstant %11 1 +%14 = OpConstant %6 1 +%2 = OpFunction %4 None %5 +%15 = OpLabel +OpBranch %16 +%16 = OpLabel +%17 = OpPhi %6 %8 %15 %18 %19 +OpLoopMerge %20 %19 None +OpBranch %21 +%21 = OpLabel +%22 = OpSLessThan %10 %17 %9 +OpBranchConditional %22 %23 %20 +%23 = OpLabel +%24 = OpLoad %11 %3 +%25 = OpFAdd %11 %24 %13 +OpStore %3 %25 +OpBranch %19 +%19 = OpLabel +%18 = OpIAdd %6 %17 %14 +OpBranch %16 +%20 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + + // Make sure the pass doesn't run + SinglePassRunAndCheck(text, text, false); + SinglePassRunAndCheck>(text, text, false); + SinglePassRunAndCheck>(text, text, false); +} + +/* +#version 430 + +layout(location = 0) out float o; + +void main(void) { + float s = 0.0; + for (int j = 0; j < 3; j += 1) { + s += 1.0; + j += 1; + } + o = s; +} +*/ +TEST_F(PassClassTest, MultipleStepOperations) { + // clang-format off + // With opt::LocalMultiStoreElimPass +const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" %3 +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 430 +OpName %2 "main" +OpName %3 "o" +OpDecorate %3 Location 0 +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeFloat 32 +%7 = OpTypePointer Function %6 +%8 = OpConstant %6 0 +%9 = OpTypeInt 32 1 +%10 = OpTypePointer Function %9 +%11 = OpConstant %9 0 +%12 = OpConstant %9 3 +%13 = OpTypeBool +%14 = OpConstant %6 1 +%15 = OpConstant %9 1 +%16 = OpTypePointer Output %6 +%3 = OpVariable %16 Output +%2 = OpFunction %4 None %5 +%17 = OpLabel +OpBranch %18 +%18 = OpLabel +%19 = OpPhi %6 %8 %17 %20 %21 +%22 = OpPhi %9 %11 %17 %23 %21 +OpLoopMerge %24 %21 Unroll +OpBranch %25 +%25 = OpLabel +%26 = OpSLessThan %13 %22 %12 +OpBranchConditional %26 %27 %24 +%27 = OpLabel +%20 = OpFAdd %6 %19 %14 +%28 = OpIAdd %9 %22 %15 +OpBranch %21 +%21 = OpLabel +%23 = OpIAdd %9 %28 %15 +OpBranch %18 +%24 = OpLabel +OpStore %3 %19 +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + + // Make sure the pass doesn't run + SinglePassRunAndCheck(text, text, false); + SinglePassRunAndCheck>(text, text, false); + SinglePassRunAndCheck>(text, text, false); +} + +/* +#version 430 + +layout(location = 0) out float o; + +void main(void) { + float s = 0.0; + for (int j = 10; j > 20; j -= 1) { + s += 1.0; + } + o = s; +} +*/ + +TEST_F(PassClassTest, ConditionFalseFromStartGreaterThan) { + // clang-format off + // With opt::LocalMultiStoreElimPass +const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" %3 +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 430 +OpName %2 "main" +OpName %3 "o" +OpDecorate %3 Location 0 +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeFloat 32 +%7 = OpTypePointer Function %6 +%8 = OpConstant %6 0 +%9 = OpTypeInt 32 1 +%10 = OpTypePointer Function %9 +%11 = OpConstant %9 10 +%12 = OpConstant %9 20 +%13 = OpTypeBool +%14 = OpConstant %6 1 +%15 = OpConstant %9 1 +%16 = OpTypePointer Output %6 +%3 = OpVariable %16 Output +%2 = OpFunction %4 None %5 +%17 = OpLabel +OpBranch %18 +%18 = OpLabel +%19 = OpPhi %6 %8 %17 %20 %21 +%22 = OpPhi %9 %11 %17 %23 %21 +OpLoopMerge %24 %21 Unroll +OpBranch %25 +%25 = OpLabel +%26 = OpSGreaterThan %13 %22 %12 +OpBranchConditional %26 %27 %24 +%27 = OpLabel +%20 = OpFAdd %6 %19 %14 +OpBranch %21 +%21 = OpLabel +%23 = OpISub %9 %22 %15 +OpBranch %18 +%24 = OpLabel +OpStore %3 %19 +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + + // Make sure the pass doesn't run + SinglePassRunAndCheck(text, text, false); + SinglePassRunAndCheck>(text, text, false); + SinglePassRunAndCheck>(text, text, false); +} + +/* +#version 430 + +layout(location = 0) out float o; + +void main(void) { + float s = 0.0; + for (int j = 10; j >= 20; j -= 1) { + s += 1.0; + } + o = s; +} +*/ +TEST_F(PassClassTest, ConditionFalseFromStartGreaterThanOrEqual) { + // clang-format off + // With opt::LocalMultiStoreElimPass +const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" %3 +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 430 +OpName %2 "main" +OpName %3 "o" +OpDecorate %3 Location 0 +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeFloat 32 +%7 = OpTypePointer Function %6 +%8 = OpConstant %6 0 +%9 = OpTypeInt 32 1 +%10 = OpTypePointer Function %9 +%11 = OpConstant %9 10 +%12 = OpConstant %9 20 +%13 = OpTypeBool +%14 = OpConstant %6 1 +%15 = OpConstant %9 1 +%16 = OpTypePointer Output %6 +%3 = OpVariable %16 Output +%2 = OpFunction %4 None %5 +%17 = OpLabel +OpBranch %18 +%18 = OpLabel +%19 = OpPhi %6 %8 %17 %20 %21 +%22 = OpPhi %9 %11 %17 %23 %21 +OpLoopMerge %24 %21 Unroll +OpBranch %25 +%25 = OpLabel +%26 = OpSGreaterThanEqual %13 %22 %12 +OpBranchConditional %26 %27 %24 +%27 = OpLabel +%20 = OpFAdd %6 %19 %14 +OpBranch %21 +%21 = OpLabel +%23 = OpISub %9 %22 %15 +OpBranch %18 +%24 = OpLabel +OpStore %3 %19 +OpReturn +OpFunctionEnd +)"; + + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + + // Make sure the pass doesn't run + SinglePassRunAndCheck(text, text, false); + SinglePassRunAndCheck>(text, text, false); + SinglePassRunAndCheck>(text, text, false); +} + +/* +#version 430 + +layout(location = 0) out float o; + +void main(void) { + float s = 0.0; + for (int j = 20; j < 10; j -= 1) { + s += 1.0; + } + o = s; +} +*/ +TEST_F(PassClassTest, ConditionFalseFromStartLessThan) { + // clang-format off + // With opt::LocalMultiStoreElimPass +const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" %3 +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 430 +OpName %2 "main" +OpName %3 "o" +OpDecorate %3 Location 0 +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeFloat 32 +%7 = OpTypePointer Function %6 +%8 = OpConstant %6 0 +%9 = OpTypeInt 32 1 +%10 = OpTypePointer Function %9 +%11 = OpConstant %9 20 +%12 = OpConstant %9 10 +%13 = OpTypeBool +%14 = OpConstant %6 1 +%15 = OpConstant %9 1 +%16 = OpTypePointer Output %6 +%3 = OpVariable %16 Output +%2 = OpFunction %4 None %5 +%17 = OpLabel +OpBranch %18 +%18 = OpLabel +%19 = OpPhi %6 %8 %17 %20 %21 +%22 = OpPhi %9 %11 %17 %23 %21 +OpLoopMerge %24 %21 Unroll +OpBranch %25 +%25 = OpLabel +%26 = OpSLessThan %13 %22 %12 +OpBranchConditional %26 %27 %24 +%27 = OpLabel +%20 = OpFAdd %6 %19 %14 +OpBranch %21 +%21 = OpLabel +%23 = OpISub %9 %22 %15 +OpBranch %18 +%24 = OpLabel +OpStore %3 %19 +OpReturn +OpFunctionEnd +)"; + + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + + // Make sure the pass doesn't run + SinglePassRunAndCheck(text, text, false); + SinglePassRunAndCheck>(text, text, false); + SinglePassRunAndCheck>(text, text, false); +} + +/* +#version 430 + +layout(location = 0) out float o; + +void main(void) { + float s = 0.0; + for (int j = 20; j <= 10; j -= 1) { + s += 1.0; + } + o = s; +} +*/ +TEST_F(PassClassTest, ConditionFalseFromStartLessThanEqual) { + // clang-format off + // With opt::LocalMultiStoreElimPass +const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" %3 +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 430 +OpName %2 "main" +OpName %3 "o" +OpDecorate %3 Location 0 +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeFloat 32 +%7 = OpTypePointer Function %6 +%8 = OpConstant %6 0 +%9 = OpTypeInt 32 1 +%10 = OpTypePointer Function %9 +%11 = OpConstant %9 20 +%12 = OpConstant %9 10 +%13 = OpTypeBool +%14 = OpConstant %6 1 +%15 = OpConstant %9 1 +%16 = OpTypePointer Output %6 +%3 = OpVariable %16 Output +%2 = OpFunction %4 None %5 +%17 = OpLabel +OpBranch %18 +%18 = OpLabel +%19 = OpPhi %6 %8 %17 %20 %21 +%22 = OpPhi %9 %11 %17 %23 %21 +OpLoopMerge %24 %21 Unroll +OpBranch %25 +%25 = OpLabel +%26 = OpSLessThanEqual %13 %22 %12 +OpBranchConditional %26 %27 %24 +%27 = OpLabel +%20 = OpFAdd %6 %19 %14 +OpBranch %21 +%21 = OpLabel +%23 = OpISub %9 %22 %15 +OpBranch %18 +%24 = OpLabel +OpStore %3 %19 +OpReturn +OpFunctionEnd +)"; + + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + + // Make sure the pass doesn't run + SinglePassRunAndCheck(text, text, false); + SinglePassRunAndCheck>(text, text, false); + SinglePassRunAndCheck>(text, text, false); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/unroll_simple.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/unroll_simple.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/unroll_simple.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/unroll_simple.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,2799 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include + +#include + +#include "../assembly_builder.h" +#include "../function_utils.h" +#include "../pass_fixture.h" +#include "../pass_utils.h" +#include "opt/loop_unroller.h" +#include "opt/loop_utils.h" +#include "opt/pass.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +/* +Generated from the following GLSL +#version 330 core +layout(location = 0) out vec4 c; +void main() { + float x[4]; + for (int i = 0; i < 4; ++i) { + x[i] = 1.0f; + } +} +*/ +TEST_F(PassClassTest, SimpleFullyUnrollTest) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 330 + OpName %2 "main" + OpName %5 "x" + OpName %3 "c" + OpDecorate %3 Location 0 + %6 = OpTypeVoid + %7 = OpTypeFunction %6 + %8 = OpTypeInt 32 1 + %9 = OpTypePointer Function %8 + %10 = OpConstant %8 0 + %11 = OpConstant %8 4 + %12 = OpTypeBool + %13 = OpTypeFloat 32 + %14 = OpTypeInt 32 0 + %15 = OpConstant %14 4 + %16 = OpTypeArray %13 %15 + %17 = OpTypePointer Function %16 + %18 = OpConstant %13 1 + %19 = OpTypePointer Function %13 + %20 = OpConstant %8 1 + %21 = OpTypeVector %13 4 + %22 = OpTypePointer Output %21 + %3 = OpVariable %22 Output + %2 = OpFunction %6 None %7 + %23 = OpLabel + %5 = OpVariable %17 Function + OpBranch %24 + %24 = OpLabel + %35 = OpPhi %8 %10 %23 %34 %26 + OpLoopMerge %25 %26 Unroll + OpBranch %27 + %27 = OpLabel + %29 = OpSLessThan %12 %35 %11 + OpBranchConditional %29 %30 %25 + %30 = OpLabel + %32 = OpAccessChain %19 %5 %35 + OpStore %32 %18 + OpBranch %26 + %26 = OpLabel + %34 = OpIAdd %8 %35 %20 + OpBranch %24 + %25 = OpLabel + OpReturn + OpFunctionEnd + )"; + +const std::string output = +R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" %3 +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 330 +OpName %2 "main" +OpName %4 "x" +OpName %3 "c" +OpDecorate %3 Location 0 +%5 = OpTypeVoid +%6 = OpTypeFunction %5 +%7 = OpTypeInt 32 1 +%8 = OpTypePointer Function %7 +%9 = OpConstant %7 0 +%10 = OpConstant %7 4 +%11 = OpTypeBool +%12 = OpTypeFloat 32 +%13 = OpTypeInt 32 0 +%14 = OpConstant %13 4 +%15 = OpTypeArray %12 %14 +%16 = OpTypePointer Function %15 +%17 = OpConstant %12 1 +%18 = OpTypePointer Function %12 +%19 = OpConstant %7 1 +%20 = OpTypeVector %12 4 +%21 = OpTypePointer Output %20 +%3 = OpVariable %21 Output +%2 = OpFunction %5 None %6 +%22 = OpLabel +%4 = OpVariable %16 Function +OpBranch %23 +%23 = OpLabel +OpBranch %28 +%28 = OpLabel +%29 = OpSLessThan %11 %9 %10 +OpBranch %30 +%30 = OpLabel +%31 = OpAccessChain %18 %4 %9 +OpStore %31 %17 +OpBranch %26 +%26 = OpLabel +%25 = OpIAdd %7 %9 %19 +OpBranch %32 +%32 = OpLabel +OpBranch %34 +%34 = OpLabel +%35 = OpSLessThan %11 %25 %10 +OpBranch %36 +%36 = OpLabel +%37 = OpAccessChain %18 %4 %25 +OpStore %37 %17 +OpBranch %38 +%38 = OpLabel +%39 = OpIAdd %7 %25 %19 +OpBranch %40 +%40 = OpLabel +OpBranch %42 +%42 = OpLabel +%43 = OpSLessThan %11 %39 %10 +OpBranch %44 +%44 = OpLabel +%45 = OpAccessChain %18 %4 %39 +OpStore %45 %17 +OpBranch %46 +%46 = OpLabel +%47 = OpIAdd %7 %39 %19 +OpBranch %48 +%48 = OpLabel +OpBranch %50 +%50 = OpLabel +%51 = OpSLessThan %11 %47 %10 +OpBranch %52 +%52 = OpLabel +%53 = OpAccessChain %18 %4 %47 +OpStore %53 %17 +OpBranch %54 +%54 = OpLabel +%55 = OpIAdd %7 %47 %19 +OpBranch %27 +%27 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(text, output, false); +} + +template +class PartialUnrollerTestPass : public opt::Pass { + public: + PartialUnrollerTestPass() : Pass() {} + + const char* name() const override { return "Loop unroller"; } + + Status Process(ir::IRContext* context) override { + for (ir::Function& f : *context->module()) { + ir::LoopDescriptor& loop_descriptor = *context->GetLoopDescriptor(&f); + for (auto& loop : loop_descriptor) { + opt::LoopUtils loop_utils{context, &loop}; + loop_utils.PartiallyUnroll(factor); + } + } + + return Pass::Status::SuccessWithChange; + } +}; + +/* +Generated from the following GLSL +#version 330 core +layout(location = 0) out vec4 c; +void main() { + float x[10]; + for (int i = 0; i < 10; ++i) { + x[i] = 1.0f; + } +} +*/ +TEST_F(PassClassTest, SimplePartialUnroll) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 330 + OpName %2 "main" + OpName %5 "x" + OpName %3 "c" + OpDecorate %3 Location 0 + %6 = OpTypeVoid + %7 = OpTypeFunction %6 + %8 = OpTypeInt 32 1 + %9 = OpTypePointer Function %8 + %10 = OpConstant %8 0 + %11 = OpConstant %8 10 + %12 = OpTypeBool + %13 = OpTypeFloat 32 + %14 = OpTypeInt 32 0 + %15 = OpConstant %14 10 + %16 = OpTypeArray %13 %15 + %17 = OpTypePointer Function %16 + %18 = OpConstant %13 1 + %19 = OpTypePointer Function %13 + %20 = OpConstant %8 1 + %21 = OpTypeVector %13 4 + %22 = OpTypePointer Output %21 + %3 = OpVariable %22 Output + %2 = OpFunction %6 None %7 + %23 = OpLabel + %5 = OpVariable %17 Function + OpBranch %24 + %24 = OpLabel + %35 = OpPhi %8 %10 %23 %34 %26 + OpLoopMerge %25 %26 Unroll + OpBranch %27 + %27 = OpLabel + %29 = OpSLessThan %12 %35 %11 + OpBranchConditional %29 %30 %25 + %30 = OpLabel + %32 = OpAccessChain %19 %5 %35 + OpStore %32 %18 + OpBranch %26 + %26 = OpLabel + %34 = OpIAdd %8 %35 %20 + OpBranch %24 + %25 = OpLabel + OpReturn + OpFunctionEnd + )"; + + const std::string output = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" %3 +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 330 +OpName %2 "main" +OpName %4 "x" +OpName %3 "c" +OpDecorate %3 Location 0 +%5 = OpTypeVoid +%6 = OpTypeFunction %5 +%7 = OpTypeInt 32 1 +%8 = OpTypePointer Function %7 +%9 = OpConstant %7 0 +%10 = OpConstant %7 10 +%11 = OpTypeBool +%12 = OpTypeFloat 32 +%13 = OpTypeInt 32 0 +%14 = OpConstant %13 10 +%15 = OpTypeArray %12 %14 +%16 = OpTypePointer Function %15 +%17 = OpConstant %12 1 +%18 = OpTypePointer Function %12 +%19 = OpConstant %7 1 +%20 = OpTypeVector %12 4 +%21 = OpTypePointer Output %20 +%3 = OpVariable %21 Output +%2 = OpFunction %5 None %6 +%22 = OpLabel +%4 = OpVariable %16 Function +OpBranch %23 +%23 = OpLabel +%24 = OpPhi %7 %9 %22 %39 %38 +OpLoopMerge %27 %38 DontUnroll +OpBranch %28 +%28 = OpLabel +%29 = OpSLessThan %11 %24 %10 +OpBranchConditional %29 %30 %27 +%30 = OpLabel +%31 = OpAccessChain %18 %4 %24 +OpStore %31 %17 +OpBranch %26 +%26 = OpLabel +%25 = OpIAdd %7 %24 %19 +OpBranch %32 +%32 = OpLabel +OpBranch %34 +%34 = OpLabel +%35 = OpSLessThan %11 %25 %10 +OpBranch %36 +%36 = OpLabel +%37 = OpAccessChain %18 %4 %25 +OpStore %37 %17 +OpBranch %38 +%38 = OpLabel +%39 = OpIAdd %7 %25 %19 +OpBranch %23 +%27 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck>(text, output, false); +} + +/* +Generated from the following GLSL +#version 330 core +layout(location = 0) out vec4 c; +void main() { + float x[10]; + for (int i = 0; i < 10; ++i) { + x[i] = 1.0f; + } +} +*/ +TEST_F(PassClassTest, SimpleUnevenPartialUnroll) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 330 + OpName %2 "main" + OpName %5 "x" + OpName %3 "c" + OpDecorate %3 Location 0 + %6 = OpTypeVoid + %7 = OpTypeFunction %6 + %8 = OpTypeInt 32 1 + %9 = OpTypePointer Function %8 + %10 = OpConstant %8 0 + %11 = OpConstant %8 10 + %12 = OpTypeBool + %13 = OpTypeFloat 32 + %14 = OpTypeInt 32 0 + %15 = OpConstant %14 10 + %16 = OpTypeArray %13 %15 + %17 = OpTypePointer Function %16 + %18 = OpConstant %13 1 + %19 = OpTypePointer Function %13 + %20 = OpConstant %8 1 + %21 = OpTypeVector %13 4 + %22 = OpTypePointer Output %21 + %3 = OpVariable %22 Output + %2 = OpFunction %6 None %7 + %23 = OpLabel + %5 = OpVariable %17 Function + OpBranch %24 + %24 = OpLabel + %35 = OpPhi %8 %10 %23 %34 %26 + OpLoopMerge %25 %26 Unroll + OpBranch %27 + %27 = OpLabel + %29 = OpSLessThan %12 %35 %11 + OpBranchConditional %29 %30 %25 + %30 = OpLabel + %32 = OpAccessChain %19 %5 %35 + OpStore %32 %18 + OpBranch %26 + %26 = OpLabel + %34 = OpIAdd %8 %35 %20 + OpBranch %24 + %25 = OpLabel + OpReturn + OpFunctionEnd + )"; + +const std::string output = +R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" %3 +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 330 +OpName %2 "main" +OpName %4 "x" +OpName %3 "c" +OpDecorate %3 Location 0 +%5 = OpTypeVoid +%6 = OpTypeFunction %5 +%7 = OpTypeInt 32 1 +%8 = OpTypePointer Function %7 +%9 = OpConstant %7 0 +%10 = OpConstant %7 10 +%11 = OpTypeBool +%12 = OpTypeFloat 32 +%13 = OpTypeInt 32 0 +%14 = OpConstant %13 10 +%15 = OpTypeArray %12 %14 +%16 = OpTypePointer Function %15 +%17 = OpConstant %12 1 +%18 = OpTypePointer Function %12 +%19 = OpConstant %7 1 +%20 = OpTypeVector %12 4 +%21 = OpTypePointer Output %20 +%3 = OpVariable %21 Output +%58 = OpConstant %13 1 +%2 = OpFunction %5 None %6 +%22 = OpLabel +%4 = OpVariable %16 Function +OpBranch %23 +%23 = OpLabel +%24 = OpPhi %7 %9 %22 %25 %26 +OpLoopMerge %32 %26 Unroll +OpBranch %28 +%28 = OpLabel +%29 = OpSLessThan %11 %24 %58 +OpBranchConditional %29 %30 %32 +%30 = OpLabel +%31 = OpAccessChain %18 %4 %24 +OpStore %31 %17 +OpBranch %26 +%26 = OpLabel +%25 = OpIAdd %7 %24 %19 +OpBranch %23 +%32 = OpLabel +OpBranch %33 +%33 = OpLabel +%34 = OpPhi %7 %24 %32 %57 %56 +OpLoopMerge %41 %56 DontUnroll +OpBranch %35 +%35 = OpLabel +%36 = OpSLessThan %11 %34 %10 +OpBranchConditional %36 %37 %41 +%37 = OpLabel +%38 = OpAccessChain %18 %4 %34 +OpStore %38 %17 +OpBranch %39 +%39 = OpLabel +%40 = OpIAdd %7 %34 %19 +OpBranch %42 +%42 = OpLabel +OpBranch %44 +%44 = OpLabel +%45 = OpSLessThan %11 %40 %10 +OpBranch %46 +%46 = OpLabel +%47 = OpAccessChain %18 %4 %40 +OpStore %47 %17 +OpBranch %48 +%48 = OpLabel +%49 = OpIAdd %7 %40 %19 +OpBranch %50 +%50 = OpLabel +OpBranch %52 +%52 = OpLabel +%53 = OpSLessThan %11 %49 %10 +OpBranch %54 +%54 = OpLabel +%55 = OpAccessChain %18 %4 %49 +OpStore %55 %17 +OpBranch %56 +%56 = OpLabel +%57 = OpIAdd %7 %49 %19 +OpBranch %33 +%41 = OpLabel +OpReturn +%27 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + // By unrolling by a factor that doesn't divide evenly into the number of loop + // iterations we perfom an additional transform when partially unrolling to + // account for the remainder. + SinglePassRunAndCheck>(text, output, false); +} + +/* Generated from +#version 410 core +layout(location=0) flat in int upper_bound; +void main() { + float x[10]; + for (int i = 2; i < 8; i+=2) { + x[i] = i; + } +} +*/ +TEST_F(PassClassTest, SimpleLoopIterationsCheck) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"( +OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" %3 +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 410 +OpName %2 "main" +OpName %5 "x" +OpName %3 "upper_bound" +OpDecorate %3 Flat +OpDecorate %3 Location 0 +%6 = OpTypeVoid +%7 = OpTypeFunction %6 +%8 = OpTypeInt 32 1 +%9 = OpTypePointer Function %8 +%10 = OpConstant %8 2 +%11 = OpConstant %8 8 +%12 = OpTypeBool +%13 = OpTypeFloat 32 +%14 = OpTypeInt 32 0 +%15 = OpConstant %14 10 +%16 = OpTypeArray %13 %15 +%17 = OpTypePointer Function %16 +%18 = OpTypePointer Function %13 +%19 = OpTypePointer Input %8 +%3 = OpVariable %19 Input +%2 = OpFunction %6 None %7 +%20 = OpLabel +%5 = OpVariable %17 Function +OpBranch %21 +%21 = OpLabel +%34 = OpPhi %8 %10 %20 %33 %23 +OpLoopMerge %22 %23 Unroll +OpBranch %24 +%24 = OpLabel +%26 = OpSLessThan %12 %34 %11 +OpBranchConditional %26 %27 %22 +%27 = OpLabel +%30 = OpConvertSToF %13 %34 +%31 = OpAccessChain %18 %5 %34 +OpStore %31 %30 +OpBranch %23 +%23 = OpLabel +%33 = OpIAdd %8 %34 %10 +OpBranch %21 +%22 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << text << std::endl; + + ir::Function* f = spvtest::GetFunction(module, 2); + + ir::LoopDescriptor& loop_descriptor = *context->GetLoopDescriptor(f); + EXPECT_EQ(loop_descriptor.NumLoops(), 1u); + + ir::Loop& loop = loop_descriptor.GetLoopByIndex(0); + + EXPECT_TRUE(loop.HasUnrollLoopControl()); + + ir::BasicBlock* condition = loop.FindConditionBlock(); + EXPECT_EQ(condition->id(), 24u); + + ir::Instruction* induction = loop.FindConditionVariable(condition); + EXPECT_EQ(induction->result_id(), 34u); + + opt::LoopUtils loop_utils{context.get(), &loop}; + EXPECT_TRUE(loop_utils.CanPerformUnroll()); + + size_t iterations = 0; + EXPECT_TRUE(loop.FindNumberOfIterations(induction, &*condition->ctail(), + &iterations)); + EXPECT_EQ(iterations, 3u); +} + +/* Generated from +#version 410 core +void main() { + float x[10]; + for (int i = -1; i < 6; i+=3) { + x[i] = i; + } +} +*/ +TEST_F(PassClassTest, SimpleLoopIterationsCheckSignedInit) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"( +OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" %3 +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 410 +OpName %2 "main" +OpName %5 "x" +OpName %3 "upper_bound" +OpDecorate %3 Flat +OpDecorate %3 Location 0 +%6 = OpTypeVoid +%7 = OpTypeFunction %6 +%8 = OpTypeInt 32 1 +%9 = OpTypePointer Function %8 +%10 = OpConstant %8 -1 +%11 = OpConstant %8 6 +%12 = OpTypeBool +%13 = OpTypeFloat 32 +%14 = OpTypeInt 32 0 +%15 = OpConstant %14 10 +%16 = OpTypeArray %13 %15 +%17 = OpTypePointer Function %16 +%18 = OpTypePointer Function %13 +%19 = OpConstant %8 3 +%20 = OpTypePointer Input %8 +%3 = OpVariable %20 Input +%2 = OpFunction %6 None %7 +%21 = OpLabel +%5 = OpVariable %17 Function +OpBranch %22 +%22 = OpLabel +%35 = OpPhi %8 %10 %21 %34 %24 +OpLoopMerge %23 %24 None +OpBranch %25 +%25 = OpLabel +%27 = OpSLessThan %12 %35 %11 +OpBranchConditional %27 %28 %23 +%28 = OpLabel +%31 = OpConvertSToF %13 %35 +%32 = OpAccessChain %18 %5 %35 +OpStore %32 %31 +OpBranch %24 +%24 = OpLabel +%34 = OpIAdd %8 %35 %19 +OpBranch %22 +%23 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << text << std::endl; + + ir::Function* f = spvtest::GetFunction(module, 2); + + ir::LoopDescriptor& loop_descriptor = *context->GetLoopDescriptor(f); + + EXPECT_EQ(loop_descriptor.NumLoops(), 1u); + + ir::Loop& loop = loop_descriptor.GetLoopByIndex(0); + + EXPECT_FALSE(loop.HasUnrollLoopControl()); + + ir::BasicBlock* condition = loop.FindConditionBlock(); + EXPECT_EQ(condition->id(), 25u); + + ir::Instruction* induction = loop.FindConditionVariable(condition); + EXPECT_EQ(induction->result_id(), 35u); + + opt::LoopUtils loop_utils{context.get(), &loop}; + EXPECT_TRUE(loop_utils.CanPerformUnroll()); + + size_t iterations = 0; + EXPECT_TRUE(loop.FindNumberOfIterations(induction, &*condition->ctail(), + &iterations)); + EXPECT_EQ(iterations, 3u); +} + +/* +Generated from the following GLSL +#version 410 core +void main() { + float out_array[6]; + for (uint i = 0; i < 2; i++) { + for (int x = 0; x < 3; ++x) { + out_array[x + i*3] = i; + } + } +} +*/ +TEST_F(PassClassTest, UnrollNestedLoops) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 410 + OpName %4 "main" + OpName %35 "out_array" + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeInt 32 0 + %7 = OpTypePointer Function %6 + %9 = OpConstant %6 0 + %16 = OpConstant %6 2 + %17 = OpTypeBool + %19 = OpTypeInt 32 1 + %20 = OpTypePointer Function %19 + %22 = OpConstant %19 0 + %29 = OpConstant %19 3 + %31 = OpTypeFloat 32 + %32 = OpConstant %6 6 + %33 = OpTypeArray %31 %32 + %34 = OpTypePointer Function %33 + %39 = OpConstant %6 3 + %44 = OpTypePointer Function %31 + %47 = OpConstant %19 1 + %4 = OpFunction %2 None %3 + %5 = OpLabel + %35 = OpVariable %34 Function + OpBranch %10 + %10 = OpLabel + %51 = OpPhi %6 %9 %5 %50 %13 + OpLoopMerge %12 %13 Unroll + OpBranch %14 + %14 = OpLabel + %18 = OpULessThan %17 %51 %16 + OpBranchConditional %18 %11 %12 + %11 = OpLabel + OpBranch %23 + %23 = OpLabel + %54 = OpPhi %19 %22 %11 %48 %26 + OpLoopMerge %25 %26 Unroll + OpBranch %27 + %27 = OpLabel + %30 = OpSLessThan %17 %54 %29 + OpBranchConditional %30 %24 %25 + %24 = OpLabel + %37 = OpBitcast %6 %54 + %40 = OpIMul %6 %51 %39 + %41 = OpIAdd %6 %37 %40 + %43 = OpConvertUToF %31 %51 + %45 = OpAccessChain %44 %35 %41 + OpStore %45 %43 + OpBranch %26 + %26 = OpLabel + %48 = OpIAdd %19 %54 %47 + OpBranch %23 + %25 = OpLabel + OpBranch %13 + %13 = OpLabel + %50 = OpIAdd %6 %51 %47 + OpBranch %10 + %12 = OpLabel + OpReturn + OpFunctionEnd + )"; + +const std::string output = +R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 410 +OpName %2 "main" +OpName %3 "out_array" +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeInt 32 0 +%7 = OpTypePointer Function %6 +%8 = OpConstant %6 0 +%9 = OpConstant %6 2 +%10 = OpTypeBool +%11 = OpTypeInt 32 1 +%12 = OpTypePointer Function %11 +%13 = OpConstant %11 0 +%14 = OpConstant %11 3 +%15 = OpTypeFloat 32 +%16 = OpConstant %6 6 +%17 = OpTypeArray %15 %16 +%18 = OpTypePointer Function %17 +%19 = OpConstant %6 3 +%20 = OpTypePointer Function %15 +%21 = OpConstant %11 1 +%2 = OpFunction %4 None %5 +%22 = OpLabel +%3 = OpVariable %18 Function +OpBranch %23 +%23 = OpLabel +OpBranch %28 +%28 = OpLabel +%29 = OpULessThan %10 %8 %9 +OpBranch %30 +%30 = OpLabel +OpBranch %31 +%31 = OpLabel +OpBranch %36 +%36 = OpLabel +%37 = OpSLessThan %10 %13 %14 +OpBranch %38 +%38 = OpLabel +%39 = OpBitcast %6 %13 +%40 = OpIMul %6 %8 %19 +%41 = OpIAdd %6 %39 %40 +%42 = OpConvertUToF %15 %8 +%43 = OpAccessChain %20 %3 %41 +OpStore %43 %42 +OpBranch %34 +%34 = OpLabel +%33 = OpIAdd %11 %13 %21 +OpBranch %44 +%44 = OpLabel +OpBranch %46 +%46 = OpLabel +%47 = OpSLessThan %10 %33 %14 +OpBranch %48 +%48 = OpLabel +%49 = OpBitcast %6 %33 +%50 = OpIMul %6 %8 %19 +%51 = OpIAdd %6 %49 %50 +%52 = OpConvertUToF %15 %8 +%53 = OpAccessChain %20 %3 %51 +OpStore %53 %52 +OpBranch %54 +%54 = OpLabel +%55 = OpIAdd %11 %33 %21 +OpBranch %56 +%56 = OpLabel +OpBranch %58 +%58 = OpLabel +%59 = OpSLessThan %10 %55 %14 +OpBranch %60 +%60 = OpLabel +%61 = OpBitcast %6 %55 +%62 = OpIMul %6 %8 %19 +%63 = OpIAdd %6 %61 %62 +%64 = OpConvertUToF %15 %8 +%65 = OpAccessChain %20 %3 %63 +OpStore %65 %64 +OpBranch %66 +%66 = OpLabel +%67 = OpIAdd %11 %55 %21 +OpBranch %35 +%35 = OpLabel +OpBranch %26 +%26 = OpLabel +%25 = OpIAdd %6 %8 %21 +OpBranch %68 +%68 = OpLabel +OpBranch %70 +%70 = OpLabel +%71 = OpULessThan %10 %25 %9 +OpBranch %72 +%72 = OpLabel +OpBranch %73 +%73 = OpLabel +OpBranch %74 +%74 = OpLabel +%75 = OpSLessThan %10 %13 %14 +OpBranch %76 +%76 = OpLabel +%77 = OpBitcast %6 %13 +%78 = OpIMul %6 %25 %19 +%79 = OpIAdd %6 %77 %78 +%80 = OpConvertUToF %15 %25 +%81 = OpAccessChain %20 %3 %79 +OpStore %81 %80 +OpBranch %82 +%82 = OpLabel +%83 = OpIAdd %11 %13 %21 +OpBranch %84 +%84 = OpLabel +OpBranch %85 +%85 = OpLabel +%86 = OpSLessThan %10 %83 %14 +OpBranch %87 +%87 = OpLabel +%88 = OpBitcast %6 %83 +%89 = OpIMul %6 %25 %19 +%90 = OpIAdd %6 %88 %89 +%91 = OpConvertUToF %15 %25 +%92 = OpAccessChain %20 %3 %90 +OpStore %92 %91 +OpBranch %93 +%93 = OpLabel +%94 = OpIAdd %11 %83 %21 +OpBranch %95 +%95 = OpLabel +OpBranch %96 +%96 = OpLabel +%97 = OpSLessThan %10 %94 %14 +OpBranch %98 +%98 = OpLabel +%99 = OpBitcast %6 %94 +%100 = OpIMul %6 %25 %19 +%101 = OpIAdd %6 %99 %100 +%102 = OpConvertUToF %15 %25 +%103 = OpAccessChain %20 %3 %101 +OpStore %103 %102 +OpBranch %104 +%104 = OpLabel +%105 = OpIAdd %11 %94 %21 +OpBranch %106 +%106 = OpLabel +OpBranch %107 +%107 = OpLabel +%108 = OpIAdd %6 %25 %21 +OpBranch %27 +%27 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << text << std::endl; + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(text, output, false); +} + +/* +Generated from the following GLSL +#version 410 core +void main() { + float out_array[2]; + for (int i = -3; i < -1; i++) { + out_array[3 + i] = i; + } +} +*/ +TEST_F(PassClassTest, NegativeConditionAndInit) { + // clang-format off + // With opt::LocalMultiStoreElimPass +const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 410 + OpName %4 "main" + OpName %23 "out_array" + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeInt 32 1 + %7 = OpTypePointer Function %6 + %9 = OpConstant %6 -3 + %16 = OpConstant %6 -1 + %17 = OpTypeBool + %19 = OpTypeInt 32 0 + %20 = OpConstant %19 2 + %21 = OpTypeArray %6 %20 + %22 = OpTypePointer Function %21 + %25 = OpConstant %6 3 + %30 = OpConstant %6 1 + %4 = OpFunction %2 None %3 + %5 = OpLabel + %23 = OpVariable %22 Function + OpBranch %10 + %10 = OpLabel + %32 = OpPhi %6 %9 %5 %31 %13 + OpLoopMerge %12 %13 Unroll + OpBranch %14 + %14 = OpLabel + %18 = OpSLessThan %17 %32 %16 + OpBranchConditional %18 %11 %12 + %11 = OpLabel + %26 = OpIAdd %6 %32 %25 + %28 = OpAccessChain %7 %23 %26 + OpStore %28 %32 + OpBranch %13 + %13 = OpLabel + %31 = OpIAdd %6 %32 %30 + OpBranch %10 + %12 = OpLabel + OpReturn + OpFunctionEnd +)"; + +const std::string expected = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 410 +OpName %2 "main" +OpName %3 "out_array" +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeInt 32 1 +%7 = OpTypePointer Function %6 +%8 = OpConstant %6 -3 +%9 = OpConstant %6 -1 +%10 = OpTypeBool +%11 = OpTypeInt 32 0 +%12 = OpConstant %11 2 +%13 = OpTypeArray %6 %12 +%14 = OpTypePointer Function %13 +%15 = OpConstant %6 3 +%16 = OpConstant %6 1 +%2 = OpFunction %4 None %5 +%17 = OpLabel +%3 = OpVariable %14 Function +OpBranch %18 +%18 = OpLabel +OpBranch %23 +%23 = OpLabel +%24 = OpSLessThan %10 %8 %9 +OpBranch %25 +%25 = OpLabel +%26 = OpIAdd %6 %8 %15 +%27 = OpAccessChain %7 %3 %26 +OpStore %27 %8 +OpBranch %21 +%21 = OpLabel +%20 = OpIAdd %6 %8 %16 +OpBranch %28 +%28 = OpLabel +OpBranch %30 +%30 = OpLabel +%31 = OpSLessThan %10 %20 %9 +OpBranch %32 +%32 = OpLabel +%33 = OpIAdd %6 %20 %15 +%34 = OpAccessChain %7 %3 %33 +OpStore %34 %20 +OpBranch %35 +%35 = OpLabel +%36 = OpIAdd %6 %20 %16 +OpBranch %22 +%22 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + // SinglePassRunAndCheck(text, expected, false); + + ir::Function* f = spvtest::GetFunction(module, 4); + + ir::LoopDescriptor& loop_descriptor = *context->GetLoopDescriptor(f); + EXPECT_EQ(loop_descriptor.NumLoops(), 1u); + + ir::Loop& loop = loop_descriptor.GetLoopByIndex(0); + + EXPECT_TRUE(loop.HasUnrollLoopControl()); + + ir::BasicBlock* condition = loop.FindConditionBlock(); + EXPECT_EQ(condition->id(), 14u); + + ir::Instruction* induction = loop.FindConditionVariable(condition); + EXPECT_EQ(induction->result_id(), 32u); + + opt::LoopUtils loop_utils{context.get(), &loop}; + EXPECT_TRUE(loop_utils.CanPerformUnroll()); + + size_t iterations = 0; + EXPECT_TRUE(loop.FindNumberOfIterations(induction, &*condition->ctail(), + &iterations)); + EXPECT_EQ(iterations, 2u); + SinglePassRunAndCheck(text, expected, false); +} + +/* +Generated from the following GLSL +#version 410 core +void main() { + float out_array[9]; + for (int i = -10; i < -1; i++) { + out_array[i] = i; + } +} +*/ +TEST_F(PassClassTest, NegativeConditionAndInitResidualUnroll) { + // clang-format off + // With opt::LocalMultiStoreElimPass +const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 410 + OpName %4 "main" + OpName %23 "out_array" + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeInt 32 1 + %7 = OpTypePointer Function %6 + %9 = OpConstant %6 -10 + %16 = OpConstant %6 -1 + %17 = OpTypeBool + %19 = OpTypeInt 32 0 + %20 = OpConstant %19 9 + %21 = OpTypeArray %6 %20 + %22 = OpTypePointer Function %21 + %25 = OpConstant %6 10 + %30 = OpConstant %6 1 + %4 = OpFunction %2 None %3 + %5 = OpLabel + %23 = OpVariable %22 Function + OpBranch %10 + %10 = OpLabel + %32 = OpPhi %6 %9 %5 %31 %13 + OpLoopMerge %12 %13 Unroll + OpBranch %14 + %14 = OpLabel + %18 = OpSLessThan %17 %32 %16 + OpBranchConditional %18 %11 %12 + %11 = OpLabel + %26 = OpIAdd %6 %32 %25 + %28 = OpAccessChain %7 %23 %26 + OpStore %28 %32 + OpBranch %13 + %13 = OpLabel + %31 = OpIAdd %6 %32 %30 + OpBranch %10 + %12 = OpLabel + OpReturn + OpFunctionEnd +)"; + +const std::string expected = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 410 +OpName %2 "main" +OpName %3 "out_array" +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeInt 32 1 +%7 = OpTypePointer Function %6 +%8 = OpConstant %6 -10 +%9 = OpConstant %6 -1 +%10 = OpTypeBool +%11 = OpTypeInt 32 0 +%12 = OpConstant %11 9 +%13 = OpTypeArray %6 %12 +%14 = OpTypePointer Function %13 +%15 = OpConstant %6 10 +%16 = OpConstant %6 1 +%48 = OpConstant %6 -9 +%2 = OpFunction %4 None %5 +%17 = OpLabel +%3 = OpVariable %14 Function +OpBranch %18 +%18 = OpLabel +%19 = OpPhi %6 %8 %17 %20 %21 +OpLoopMerge %28 %21 Unroll +OpBranch %23 +%23 = OpLabel +%24 = OpSLessThan %10 %19 %48 +OpBranchConditional %24 %25 %28 +%25 = OpLabel +%26 = OpIAdd %6 %19 %15 +%27 = OpAccessChain %7 %3 %26 +OpStore %27 %19 +OpBranch %21 +%21 = OpLabel +%20 = OpIAdd %6 %19 %16 +OpBranch %18 +%28 = OpLabel +OpBranch %29 +%29 = OpLabel +%30 = OpPhi %6 %19 %28 %47 %46 +OpLoopMerge %38 %46 DontUnroll +OpBranch %31 +%31 = OpLabel +%32 = OpSLessThan %10 %30 %9 +OpBranchConditional %32 %33 %38 +%33 = OpLabel +%34 = OpIAdd %6 %30 %15 +%35 = OpAccessChain %7 %3 %34 +OpStore %35 %30 +OpBranch %36 +%36 = OpLabel +%37 = OpIAdd %6 %30 %16 +OpBranch %39 +%39 = OpLabel +OpBranch %41 +%41 = OpLabel +%42 = OpSLessThan %10 %37 %9 +OpBranch %43 +%43 = OpLabel +%44 = OpIAdd %6 %37 %15 +%45 = OpAccessChain %7 %3 %44 +OpStore %45 %37 +OpBranch %46 +%46 = OpLabel +%47 = OpIAdd %6 %37 %16 +OpBranch %29 +%38 = OpLabel +OpReturn +%22 = OpLabel +OpReturn +OpFunctionEnd +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + + ir::Function* f = spvtest::GetFunction(module, 4); + + ir::LoopDescriptor& loop_descriptor = *context->GetLoopDescriptor(f); + EXPECT_EQ(loop_descriptor.NumLoops(), 1u); + + ir::Loop& loop = loop_descriptor.GetLoopByIndex(0); + + EXPECT_TRUE(loop.HasUnrollLoopControl()); + + ir::BasicBlock* condition = loop.FindConditionBlock(); + EXPECT_EQ(condition->id(), 14u); + + ir::Instruction* induction = loop.FindConditionVariable(condition); + EXPECT_EQ(induction->result_id(), 32u); + + opt::LoopUtils loop_utils{context.get(), &loop}; + EXPECT_TRUE(loop_utils.CanPerformUnroll()); + + size_t iterations = 0; + EXPECT_TRUE(loop.FindNumberOfIterations(induction, &*condition->ctail(), + &iterations)); + EXPECT_EQ(iterations, 9u); + SinglePassRunAndCheck>(text, expected, false); +} + +/* +Generated from the following GLSL +#version 410 core +void main() { + float out_array[10]; + for (uint i = 0; i < 2; i++) { + for (int x = 0; x < 5; ++x) { + out_array[x + i*5] = i; + } + } +} +*/ +TEST_F(PassClassTest, UnrollNestedLoopsValidateDescriptor) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 410 + OpName %4 "main" + OpName %35 "out_array" + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeInt 32 0 + %7 = OpTypePointer Function %6 + %9 = OpConstant %6 0 + %16 = OpConstant %6 2 + %17 = OpTypeBool + %19 = OpTypeInt 32 1 + %20 = OpTypePointer Function %19 + %22 = OpConstant %19 0 + %29 = OpConstant %19 5 + %31 = OpTypeFloat 32 + %32 = OpConstant %6 10 + %33 = OpTypeArray %31 %32 + %34 = OpTypePointer Function %33 + %39 = OpConstant %6 5 + %44 = OpTypePointer Function %31 + %47 = OpConstant %19 1 + %4 = OpFunction %2 None %3 + %5 = OpLabel + %35 = OpVariable %34 Function + OpBranch %10 + %10 = OpLabel + %51 = OpPhi %6 %9 %5 %50 %13 + OpLoopMerge %12 %13 Unroll + OpBranch %14 + %14 = OpLabel + %18 = OpULessThan %17 %51 %16 + OpBranchConditional %18 %11 %12 + %11 = OpLabel + OpBranch %23 + %23 = OpLabel + %54 = OpPhi %19 %22 %11 %48 %26 + OpLoopMerge %25 %26 Unroll + OpBranch %27 + %27 = OpLabel + %30 = OpSLessThan %17 %54 %29 + OpBranchConditional %30 %24 %25 + %24 = OpLabel + %37 = OpBitcast %6 %54 + %40 = OpIMul %6 %51 %39 + %41 = OpIAdd %6 %37 %40 + %43 = OpConvertUToF %31 %51 + %45 = OpAccessChain %44 %35 %41 + OpStore %45 %43 + OpBranch %26 + %26 = OpLabel + %48 = OpIAdd %19 %54 %47 + OpBranch %23 + %25 = OpLabel + OpBranch %13 + %13 = OpLabel + %50 = OpIAdd %6 %51 %47 + OpBranch %10 + %12 = OpLabel + OpReturn + OpFunctionEnd + )"; + + // clang-format on + + { // Test fully unroll + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << text << std::endl; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + + ir::Function* f = spvtest::GetFunction(module, 4); + ir::LoopDescriptor& loop_descriptor = *context->GetLoopDescriptor(f); + EXPECT_EQ(loop_descriptor.NumLoops(), 2u); + + ir::Loop& outer_loop = loop_descriptor.GetLoopByIndex(1); + + EXPECT_TRUE(outer_loop.HasUnrollLoopControl()); + + ir::Loop& inner_loop = loop_descriptor.GetLoopByIndex(0); + + EXPECT_TRUE(inner_loop.HasUnrollLoopControl()); + + EXPECT_EQ(outer_loop.GetBlocks().size(), 9u); + + EXPECT_EQ(inner_loop.GetBlocks().size(), 4u); + EXPECT_EQ(outer_loop.NumImmediateChildren(), 1u); + EXPECT_EQ(inner_loop.NumImmediateChildren(), 0u); + + { + opt::LoopUtils loop_utils{context.get(), &inner_loop}; + loop_utils.FullyUnroll(); + loop_utils.Finalize(); + } + + EXPECT_EQ(loop_descriptor.NumLoops(), 1u); + EXPECT_EQ(outer_loop.GetBlocks().size(), 25u); + EXPECT_EQ(outer_loop.NumImmediateChildren(), 0u); + { + opt::LoopUtils loop_utils{context.get(), &outer_loop}; + loop_utils.FullyUnroll(); + loop_utils.Finalize(); + } + EXPECT_EQ(loop_descriptor.NumLoops(), 0u); + } + + { // Test partially unroll + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << text << std::endl; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + + ir::Function* f = spvtest::GetFunction(module, 4); + ir::LoopDescriptor& loop_descriptor = *context->GetLoopDescriptor(f); + EXPECT_EQ(loop_descriptor.NumLoops(), 2u); + + ir::Loop& outer_loop = loop_descriptor.GetLoopByIndex(1); + + EXPECT_TRUE(outer_loop.HasUnrollLoopControl()); + + ir::Loop& inner_loop = loop_descriptor.GetLoopByIndex(0); + + EXPECT_TRUE(inner_loop.HasUnrollLoopControl()); + + EXPECT_EQ(outer_loop.GetBlocks().size(), 9u); + + EXPECT_EQ(inner_loop.GetBlocks().size(), 4u); + + EXPECT_EQ(outer_loop.NumImmediateChildren(), 1u); + EXPECT_EQ(inner_loop.NumImmediateChildren(), 0u); + + opt::LoopUtils loop_utils{context.get(), &inner_loop}; + loop_utils.PartiallyUnroll(2); + loop_utils.Finalize(); + + // The number of loops should actually grow. + EXPECT_EQ(loop_descriptor.NumLoops(), 3u); + EXPECT_EQ(outer_loop.GetBlocks().size(), 18u); + EXPECT_EQ(outer_loop.NumImmediateChildren(), 2u); + } +} + +/* +Generated from the following GLSL +#version 410 core +void main() { + float out_array[3]; + for (int i = 3; i > 0; --i) { + out_array[i] = i; + } +} +*/ +TEST_F(PassClassTest, FullyUnrollNegativeStepLoopTest) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 410 + OpName %4 "main" + OpName %24 "out_array" + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeInt 32 1 + %7 = OpTypePointer Function %6 + %9 = OpConstant %6 3 + %16 = OpConstant %6 0 + %17 = OpTypeBool + %19 = OpTypeFloat 32 + %20 = OpTypeInt 32 0 + %21 = OpConstant %20 3 + %22 = OpTypeArray %19 %21 + %23 = OpTypePointer Function %22 + %28 = OpTypePointer Function %19 + %31 = OpConstant %6 1 + %4 = OpFunction %2 None %3 + %5 = OpLabel + %24 = OpVariable %23 Function + OpBranch %10 + %10 = OpLabel + %33 = OpPhi %6 %9 %5 %32 %13 + OpLoopMerge %12 %13 Unroll + OpBranch %14 + %14 = OpLabel + %18 = OpSGreaterThan %17 %33 %16 + OpBranchConditional %18 %11 %12 + %11 = OpLabel + %27 = OpConvertSToF %19 %33 + %29 = OpAccessChain %28 %24 %33 + OpStore %29 %27 + OpBranch %13 + %13 = OpLabel + %32 = OpISub %6 %33 %31 + OpBranch %10 + %12 = OpLabel + OpReturn + OpFunctionEnd + )"; + +const std::string output = +R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 410 +OpName %2 "main" +OpName %3 "out_array" +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeInt 32 1 +%7 = OpTypePointer Function %6 +%8 = OpConstant %6 3 +%9 = OpConstant %6 0 +%10 = OpTypeBool +%11 = OpTypeFloat 32 +%12 = OpTypeInt 32 0 +%13 = OpConstant %12 3 +%14 = OpTypeArray %11 %13 +%15 = OpTypePointer Function %14 +%16 = OpTypePointer Function %11 +%17 = OpConstant %6 1 +%2 = OpFunction %4 None %5 +%18 = OpLabel +%3 = OpVariable %15 Function +OpBranch %19 +%19 = OpLabel +OpBranch %24 +%24 = OpLabel +%25 = OpSGreaterThan %10 %8 %9 +OpBranch %26 +%26 = OpLabel +%27 = OpConvertSToF %11 %8 +%28 = OpAccessChain %16 %3 %8 +OpStore %28 %27 +OpBranch %22 +%22 = OpLabel +%21 = OpISub %6 %8 %17 +OpBranch %29 +%29 = OpLabel +OpBranch %31 +%31 = OpLabel +%32 = OpSGreaterThan %10 %21 %9 +OpBranch %33 +%33 = OpLabel +%34 = OpConvertSToF %11 %21 +%35 = OpAccessChain %16 %3 %21 +OpStore %35 %34 +OpBranch %36 +%36 = OpLabel +%37 = OpISub %6 %21 %17 +OpBranch %38 +%38 = OpLabel +OpBranch %40 +%40 = OpLabel +%41 = OpSGreaterThan %10 %37 %9 +OpBranch %42 +%42 = OpLabel +%43 = OpConvertSToF %11 %37 +%44 = OpAccessChain %16 %3 %37 +OpStore %44 %43 +OpBranch %45 +%45 = OpLabel +%46 = OpISub %6 %37 %17 +OpBranch %23 +%23 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(text, output, false); +} + +/* +Generated from the following GLSL +#version 410 core +void main() { + float out_array[3]; + for (int i = 9; i > 0; i-=3) { + out_array[i] = i; + } +} +*/ +TEST_F(PassClassTest, FullyUnrollNegativeNonOneStepLoop) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 410 + OpName %4 "main" + OpName %24 "out_array" + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeInt 32 1 + %7 = OpTypePointer Function %6 + %9 = OpConstant %6 9 + %16 = OpConstant %6 0 + %17 = OpTypeBool + %19 = OpTypeFloat 32 + %20 = OpTypeInt 32 0 + %21 = OpConstant %20 3 + %22 = OpTypeArray %19 %21 + %23 = OpTypePointer Function %22 + %28 = OpTypePointer Function %19 + %30 = OpConstant %6 3 + %4 = OpFunction %2 None %3 + %5 = OpLabel + %24 = OpVariable %23 Function + OpBranch %10 + %10 = OpLabel + %33 = OpPhi %6 %9 %5 %32 %13 + OpLoopMerge %12 %13 Unroll + OpBranch %14 + %14 = OpLabel + %18 = OpSGreaterThan %17 %33 %16 + OpBranchConditional %18 %11 %12 + %11 = OpLabel + %27 = OpConvertSToF %19 %33 + %29 = OpAccessChain %28 %24 %33 + OpStore %29 %27 + OpBranch %13 + %13 = OpLabel + %32 = OpISub %6 %33 %30 + OpBranch %10 + %12 = OpLabel + OpReturn + OpFunctionEnd + )"; + +const std::string output = +R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 410 +OpName %2 "main" +OpName %3 "out_array" +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeInt 32 1 +%7 = OpTypePointer Function %6 +%8 = OpConstant %6 9 +%9 = OpConstant %6 0 +%10 = OpTypeBool +%11 = OpTypeFloat 32 +%12 = OpTypeInt 32 0 +%13 = OpConstant %12 3 +%14 = OpTypeArray %11 %13 +%15 = OpTypePointer Function %14 +%16 = OpTypePointer Function %11 +%17 = OpConstant %6 3 +%2 = OpFunction %4 None %5 +%18 = OpLabel +%3 = OpVariable %15 Function +OpBranch %19 +%19 = OpLabel +OpBranch %24 +%24 = OpLabel +%25 = OpSGreaterThan %10 %8 %9 +OpBranch %26 +%26 = OpLabel +%27 = OpConvertSToF %11 %8 +%28 = OpAccessChain %16 %3 %8 +OpStore %28 %27 +OpBranch %22 +%22 = OpLabel +%21 = OpISub %6 %8 %17 +OpBranch %29 +%29 = OpLabel +OpBranch %31 +%31 = OpLabel +%32 = OpSGreaterThan %10 %21 %9 +OpBranch %33 +%33 = OpLabel +%34 = OpConvertSToF %11 %21 +%35 = OpAccessChain %16 %3 %21 +OpStore %35 %34 +OpBranch %36 +%36 = OpLabel +%37 = OpISub %6 %21 %17 +OpBranch %38 +%38 = OpLabel +OpBranch %40 +%40 = OpLabel +%41 = OpSGreaterThan %10 %37 %9 +OpBranch %42 +%42 = OpLabel +%43 = OpConvertSToF %11 %37 +%44 = OpAccessChain %16 %3 %37 +OpStore %44 %43 +OpBranch %45 +%45 = OpLabel +%46 = OpISub %6 %37 %17 +OpBranch %23 +%23 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(text, output, false); +} + +/* +Generated from the following GLSL +#version 410 core +void main() { + float out_array[3]; + for (int i = 0; i < 7; i+=3) { + out_array[i] = i; + } +} +*/ +TEST_F(PassClassTest, FullyUnrollNonDivisibleStepLoop) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %4 "main" +OpExecutionMode %4 OriginUpperLeft +OpSource GLSL 410 +OpName %4 "main" +OpName %24 "out_array" +%2 = OpTypeVoid +%3 = OpTypeFunction %2 +%6 = OpTypeInt 32 1 +%7 = OpTypePointer Function %6 +%9 = OpConstant %6 0 +%16 = OpConstant %6 7 +%17 = OpTypeBool +%19 = OpTypeFloat 32 +%20 = OpTypeInt 32 0 +%21 = OpConstant %20 3 +%22 = OpTypeArray %19 %21 +%23 = OpTypePointer Function %22 +%28 = OpTypePointer Function %19 +%30 = OpConstant %6 3 +%4 = OpFunction %2 None %3 +%5 = OpLabel +%24 = OpVariable %23 Function +OpBranch %10 +%10 = OpLabel +%33 = OpPhi %6 %9 %5 %32 %13 +OpLoopMerge %12 %13 Unroll +OpBranch %14 +%14 = OpLabel +%18 = OpSLessThan %17 %33 %16 +OpBranchConditional %18 %11 %12 +%11 = OpLabel +%27 = OpConvertSToF %19 %33 +%29 = OpAccessChain %28 %24 %33 +OpStore %29 %27 +OpBranch %13 +%13 = OpLabel +%32 = OpIAdd %6 %33 %30 +OpBranch %10 +%12 = OpLabel +OpReturn +OpFunctionEnd +)"; + +const std::string output = +R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 410 +OpName %2 "main" +OpName %3 "out_array" +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeInt 32 1 +%7 = OpTypePointer Function %6 +%8 = OpConstant %6 0 +%9 = OpConstant %6 7 +%10 = OpTypeBool +%11 = OpTypeFloat 32 +%12 = OpTypeInt 32 0 +%13 = OpConstant %12 3 +%14 = OpTypeArray %11 %13 +%15 = OpTypePointer Function %14 +%16 = OpTypePointer Function %11 +%17 = OpConstant %6 3 +%2 = OpFunction %4 None %5 +%18 = OpLabel +%3 = OpVariable %15 Function +OpBranch %19 +%19 = OpLabel +OpBranch %24 +%24 = OpLabel +%25 = OpSLessThan %10 %8 %9 +OpBranch %26 +%26 = OpLabel +%27 = OpConvertSToF %11 %8 +%28 = OpAccessChain %16 %3 %8 +OpStore %28 %27 +OpBranch %22 +%22 = OpLabel +%21 = OpIAdd %6 %8 %17 +OpBranch %29 +%29 = OpLabel +OpBranch %31 +%31 = OpLabel +%32 = OpSLessThan %10 %21 %9 +OpBranch %33 +%33 = OpLabel +%34 = OpConvertSToF %11 %21 +%35 = OpAccessChain %16 %3 %21 +OpStore %35 %34 +OpBranch %36 +%36 = OpLabel +%37 = OpIAdd %6 %21 %17 +OpBranch %38 +%38 = OpLabel +OpBranch %40 +%40 = OpLabel +%41 = OpSLessThan %10 %37 %9 +OpBranch %42 +%42 = OpLabel +%43 = OpConvertSToF %11 %37 +%44 = OpAccessChain %16 %3 %37 +OpStore %44 %43 +OpBranch %45 +%45 = OpLabel +%46 = OpIAdd %6 %37 %17 +OpBranch %23 +%23 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(text, output, false); +} + +/* +Generated from the following GLSL +#version 410 core +void main() { + float out_array[4]; + for (int i = 11; i > 0; i-=3) { + out_array[i] = i; + } +} +*/ +TEST_F(PassClassTest, FullyUnrollNegativeNonDivisibleStepLoop) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %4 "main" +OpExecutionMode %4 OriginUpperLeft +OpSource GLSL 410 +OpName %4 "main" +OpName %24 "out_array" +%2 = OpTypeVoid +%3 = OpTypeFunction %2 +%6 = OpTypeInt 32 1 +%7 = OpTypePointer Function %6 +%9 = OpConstant %6 11 +%16 = OpConstant %6 0 +%17 = OpTypeBool +%19 = OpTypeFloat 32 +%20 = OpTypeInt 32 0 +%21 = OpConstant %20 4 +%22 = OpTypeArray %19 %21 +%23 = OpTypePointer Function %22 +%28 = OpTypePointer Function %19 +%30 = OpConstant %6 3 +%4 = OpFunction %2 None %3 +%5 = OpLabel +%24 = OpVariable %23 Function +OpBranch %10 +%10 = OpLabel +%33 = OpPhi %6 %9 %5 %32 %13 +OpLoopMerge %12 %13 Unroll +OpBranch %14 +%14 = OpLabel +%18 = OpSGreaterThan %17 %33 %16 +OpBranchConditional %18 %11 %12 +%11 = OpLabel +%27 = OpConvertSToF %19 %33 +%29 = OpAccessChain %28 %24 %33 +OpStore %29 %27 +OpBranch %13 +%13 = OpLabel +%32 = OpISub %6 %33 %30 +OpBranch %10 +%12 = OpLabel +OpReturn +OpFunctionEnd +)"; + +const std::string output = +R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 410 +OpName %2 "main" +OpName %3 "out_array" +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeInt 32 1 +%7 = OpTypePointer Function %6 +%8 = OpConstant %6 11 +%9 = OpConstant %6 0 +%10 = OpTypeBool +%11 = OpTypeFloat 32 +%12 = OpTypeInt 32 0 +%13 = OpConstant %12 4 +%14 = OpTypeArray %11 %13 +%15 = OpTypePointer Function %14 +%16 = OpTypePointer Function %11 +%17 = OpConstant %6 3 +%2 = OpFunction %4 None %5 +%18 = OpLabel +%3 = OpVariable %15 Function +OpBranch %19 +%19 = OpLabel +OpBranch %24 +%24 = OpLabel +%25 = OpSGreaterThan %10 %8 %9 +OpBranch %26 +%26 = OpLabel +%27 = OpConvertSToF %11 %8 +%28 = OpAccessChain %16 %3 %8 +OpStore %28 %27 +OpBranch %22 +%22 = OpLabel +%21 = OpISub %6 %8 %17 +OpBranch %29 +%29 = OpLabel +OpBranch %31 +%31 = OpLabel +%32 = OpSGreaterThan %10 %21 %9 +OpBranch %33 +%33 = OpLabel +%34 = OpConvertSToF %11 %21 +%35 = OpAccessChain %16 %3 %21 +OpStore %35 %34 +OpBranch %36 +%36 = OpLabel +%37 = OpISub %6 %21 %17 +OpBranch %38 +%38 = OpLabel +OpBranch %40 +%40 = OpLabel +%41 = OpSGreaterThan %10 %37 %9 +OpBranch %42 +%42 = OpLabel +%43 = OpConvertSToF %11 %37 +%44 = OpAccessChain %16 %3 %37 +OpStore %44 %43 +OpBranch %45 +%45 = OpLabel +%46 = OpISub %6 %37 %17 +OpBranch %47 +%47 = OpLabel +OpBranch %49 +%49 = OpLabel +%50 = OpSGreaterThan %10 %46 %9 +OpBranch %51 +%51 = OpLabel +%52 = OpConvertSToF %11 %46 +%53 = OpAccessChain %16 %3 %46 +OpStore %53 %52 +OpBranch %54 +%54 = OpLabel +%55 = OpISub %6 %46 %17 +OpBranch %23 +%23 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(text, output, false); +} + +// clang-format off +// With opt::LocalMultiStoreElimPass +static const std::string multiple_phi_shader = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 410 + OpName %4 "main" + OpName %8 "foo(" + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeInt 32 1 + %7 = OpTypeFunction %6 + %10 = OpTypePointer Function %6 + %12 = OpConstant %6 0 + %14 = OpConstant %6 3 + %22 = OpConstant %6 6 + %23 = OpTypeBool + %31 = OpConstant %6 1 + %4 = OpFunction %2 None %3 + %5 = OpLabel + %40 = OpFunctionCall %6 %8 + OpReturn + OpFunctionEnd + %8 = OpFunction %6 None %7 + %9 = OpLabel + OpBranch %16 + %16 = OpLabel + %41 = OpPhi %6 %12 %9 %34 %19 + %42 = OpPhi %6 %14 %9 %29 %19 + %43 = OpPhi %6 %12 %9 %32 %19 + OpLoopMerge %18 %19 Unroll + OpBranch %20 + %20 = OpLabel + %24 = OpSLessThan %23 %43 %22 + OpBranchConditional %24 %17 %18 + %17 = OpLabel + %27 = OpIMul %6 %43 %41 + %29 = OpIAdd %6 %42 %27 + OpBranch %19 + %19 = OpLabel + %32 = OpIAdd %6 %43 %31 + %34 = OpISub %6 %41 %31 + OpBranch %16 + %18 = OpLabel + %37 = OpIAdd %6 %42 %41 + OpReturnValue %37 + OpFunctionEnd + )"; +// clang-format on + +TEST_F(PassClassTest, PartiallyUnrollResidualMultipleInductionVariables) { + // clang-format off +const std::string output = +R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 410 +OpName %2 "main" +OpName %3 "foo(" +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeInt 32 1 +%7 = OpTypeFunction %6 +%8 = OpTypePointer Function %6 +%9 = OpConstant %6 0 +%10 = OpConstant %6 3 +%11 = OpConstant %6 6 +%12 = OpTypeBool +%13 = OpConstant %6 1 +%82 = OpTypeInt 32 0 +%83 = OpConstant %82 2 +%2 = OpFunction %4 None %5 +%14 = OpLabel +%15 = OpFunctionCall %6 %3 +OpReturn +OpFunctionEnd +%3 = OpFunction %6 None %7 +%16 = OpLabel +OpBranch %17 +%17 = OpLabel +%18 = OpPhi %6 %9 %16 %19 %20 +%21 = OpPhi %6 %10 %16 %22 %20 +%23 = OpPhi %6 %9 %16 %24 %20 +OpLoopMerge %31 %20 Unroll +OpBranch %26 +%26 = OpLabel +%27 = OpSLessThan %12 %23 %83 +OpBranchConditional %27 %28 %31 +%28 = OpLabel +%29 = OpIMul %6 %23 %18 +%22 = OpIAdd %6 %21 %29 +OpBranch %20 +%20 = OpLabel +%24 = OpIAdd %6 %23 %13 +%19 = OpISub %6 %18 %13 +OpBranch %17 +%31 = OpLabel +OpBranch %32 +%32 = OpLabel +%33 = OpPhi %6 %18 %31 %81 %79 +%34 = OpPhi %6 %21 %31 %78 %79 +%35 = OpPhi %6 %23 %31 %80 %79 +OpLoopMerge %44 %79 DontUnroll +OpBranch %36 +%36 = OpLabel +%37 = OpSLessThan %12 %35 %11 +OpBranchConditional %37 %38 %44 +%38 = OpLabel +%39 = OpIMul %6 %35 %33 +%40 = OpIAdd %6 %34 %39 +OpBranch %41 +%41 = OpLabel +%42 = OpIAdd %6 %35 %13 +%43 = OpISub %6 %33 %13 +OpBranch %46 +%46 = OpLabel +OpBranch %50 +%50 = OpLabel +%51 = OpSLessThan %12 %42 %11 +OpBranch %52 +%52 = OpLabel +%53 = OpIMul %6 %42 %43 +%54 = OpIAdd %6 %40 %53 +OpBranch %55 +%55 = OpLabel +%56 = OpIAdd %6 %42 %13 +%57 = OpISub %6 %43 %13 +OpBranch %58 +%58 = OpLabel +OpBranch %62 +%62 = OpLabel +%63 = OpSLessThan %12 %56 %11 +OpBranch %64 +%64 = OpLabel +%65 = OpIMul %6 %56 %57 +%66 = OpIAdd %6 %54 %65 +OpBranch %67 +%67 = OpLabel +%68 = OpIAdd %6 %56 %13 +%69 = OpISub %6 %57 %13 +OpBranch %70 +%70 = OpLabel +OpBranch %74 +%74 = OpLabel +%75 = OpSLessThan %12 %68 %11 +OpBranch %76 +%76 = OpLabel +%77 = OpIMul %6 %68 %69 +%78 = OpIAdd %6 %66 %77 +OpBranch %79 +%79 = OpLabel +%80 = OpIAdd %6 %68 %13 +%81 = OpISub %6 %69 %13 +OpBranch %32 +%44 = OpLabel +%45 = OpIAdd %6 %34 %33 +OpReturnValue %45 +%25 = OpLabel +%30 = OpIAdd %6 %34 %33 +OpReturnValue %30 +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, multiple_phi_shader, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << multiple_phi_shader << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck>(multiple_phi_shader, output, + false); +} + +TEST_F(PassClassTest, PartiallyUnrollMultipleInductionVariables) { + // clang-format off +const std::string output = +R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 410 +OpName %2 "main" +OpName %3 "foo(" +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeInt 32 1 +%7 = OpTypeFunction %6 +%8 = OpTypePointer Function %6 +%9 = OpConstant %6 0 +%10 = OpConstant %6 3 +%11 = OpConstant %6 6 +%12 = OpTypeBool +%13 = OpConstant %6 1 +%2 = OpFunction %4 None %5 +%14 = OpLabel +%15 = OpFunctionCall %6 %3 +OpReturn +OpFunctionEnd +%3 = OpFunction %6 None %7 +%16 = OpLabel +OpBranch %17 +%17 = OpLabel +%18 = OpPhi %6 %9 %16 %42 %40 +%21 = OpPhi %6 %10 %16 %39 %40 +%23 = OpPhi %6 %9 %16 %41 %40 +OpLoopMerge %25 %40 DontUnroll +OpBranch %26 +%26 = OpLabel +%27 = OpSLessThan %12 %23 %11 +OpBranchConditional %27 %28 %25 +%28 = OpLabel +%29 = OpIMul %6 %23 %18 +%22 = OpIAdd %6 %21 %29 +OpBranch %20 +%20 = OpLabel +%24 = OpIAdd %6 %23 %13 +%19 = OpISub %6 %18 %13 +OpBranch %31 +%31 = OpLabel +OpBranch %35 +%35 = OpLabel +%36 = OpSLessThan %12 %24 %11 +OpBranch %37 +%37 = OpLabel +%38 = OpIMul %6 %24 %19 +%39 = OpIAdd %6 %22 %38 +OpBranch %40 +%40 = OpLabel +%41 = OpIAdd %6 %24 %13 +%42 = OpISub %6 %19 %13 +OpBranch %17 +%25 = OpLabel +%30 = OpIAdd %6 %21 %18 +OpReturnValue %30 +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, multiple_phi_shader, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << multiple_phi_shader << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck>(multiple_phi_shader, output, + false); +} + +TEST_F(PassClassTest, FullyUnrollMultipleInductionVariables) { + // clang-format off +const std::string output = +R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 410 +OpName %2 "main" +OpName %3 "foo(" +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpTypeInt 32 1 +%7 = OpTypeFunction %6 +%8 = OpTypePointer Function %6 +%9 = OpConstant %6 0 +%10 = OpConstant %6 3 +%11 = OpConstant %6 6 +%12 = OpTypeBool +%13 = OpConstant %6 1 +%2 = OpFunction %4 None %5 +%14 = OpLabel +%15 = OpFunctionCall %6 %3 +OpReturn +OpFunctionEnd +%3 = OpFunction %6 None %7 +%16 = OpLabel +OpBranch %17 +%17 = OpLabel +OpBranch %26 +%26 = OpLabel +%27 = OpSLessThan %12 %9 %11 +OpBranch %28 +%28 = OpLabel +%29 = OpIMul %6 %9 %9 +%22 = OpIAdd %6 %10 %29 +OpBranch %20 +%20 = OpLabel +%24 = OpIAdd %6 %9 %13 +%19 = OpISub %6 %9 %13 +OpBranch %31 +%31 = OpLabel +OpBranch %35 +%35 = OpLabel +%36 = OpSLessThan %12 %24 %11 +OpBranch %37 +%37 = OpLabel +%38 = OpIMul %6 %24 %19 +%39 = OpIAdd %6 %22 %38 +OpBranch %40 +%40 = OpLabel +%41 = OpIAdd %6 %24 %13 +%42 = OpISub %6 %19 %13 +OpBranch %43 +%43 = OpLabel +OpBranch %47 +%47 = OpLabel +%48 = OpSLessThan %12 %41 %11 +OpBranch %49 +%49 = OpLabel +%50 = OpIMul %6 %41 %42 +%51 = OpIAdd %6 %39 %50 +OpBranch %52 +%52 = OpLabel +%53 = OpIAdd %6 %41 %13 +%54 = OpISub %6 %42 %13 +OpBranch %55 +%55 = OpLabel +OpBranch %59 +%59 = OpLabel +%60 = OpSLessThan %12 %53 %11 +OpBranch %61 +%61 = OpLabel +%62 = OpIMul %6 %53 %54 +%63 = OpIAdd %6 %51 %62 +OpBranch %64 +%64 = OpLabel +%65 = OpIAdd %6 %53 %13 +%66 = OpISub %6 %54 %13 +OpBranch %67 +%67 = OpLabel +OpBranch %71 +%71 = OpLabel +%72 = OpSLessThan %12 %65 %11 +OpBranch %73 +%73 = OpLabel +%74 = OpIMul %6 %65 %66 +%75 = OpIAdd %6 %63 %74 +OpBranch %76 +%76 = OpLabel +%77 = OpIAdd %6 %65 %13 +%78 = OpISub %6 %66 %13 +OpBranch %79 +%79 = OpLabel +OpBranch %83 +%83 = OpLabel +%84 = OpSLessThan %12 %77 %11 +OpBranch %85 +%85 = OpLabel +%86 = OpIMul %6 %77 %78 +%87 = OpIAdd %6 %75 %86 +OpBranch %88 +%88 = OpLabel +%89 = OpIAdd %6 %77 %13 +%90 = OpISub %6 %78 %13 +OpBranch %25 +%25 = OpLabel +%30 = OpIAdd %6 %87 %90 +OpReturnValue %30 +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, multiple_phi_shader, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << multiple_phi_shader << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(multiple_phi_shader, output, false); +} + +/* +Generated from the following GLSL +#version 440 core +void main() +{ + int j = 0; + for (int i = 0; i <= 2; ++i) + ++j; + + for (int i = 1; i >= 0; --i) + ++j; +} +*/ +TEST_F(PassClassTest, FullyUnrollEqualToOperations) { + // clang-format off + // With opt::LocalMultiStoreElimPass + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 440 + OpName %4 "main" + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeInt 32 1 + %7 = OpTypePointer Function %6 + %9 = OpConstant %6 0 + %17 = OpConstant %6 2 + %18 = OpTypeBool + %21 = OpConstant %6 1 + %4 = OpFunction %2 None %3 + %5 = OpLabel + OpBranch %11 + %11 = OpLabel + %37 = OpPhi %6 %9 %5 %22 %14 + %38 = OpPhi %6 %9 %5 %24 %14 + OpLoopMerge %13 %14 Unroll + OpBranch %15 + %15 = OpLabel + %19 = OpSLessThanEqual %18 %38 %17 + OpBranchConditional %19 %12 %13 + %12 = OpLabel + %22 = OpIAdd %6 %37 %21 + OpBranch %14 + %14 = OpLabel + %24 = OpIAdd %6 %38 %21 + OpBranch %11 + %13 = OpLabel + OpBranch %26 + %26 = OpLabel + %39 = OpPhi %6 %37 %13 %34 %29 + %40 = OpPhi %6 %21 %13 %36 %29 + OpLoopMerge %28 %29 Unroll + OpBranch %30 + %30 = OpLabel + %32 = OpSGreaterThanEqual %18 %40 %9 + OpBranchConditional %32 %27 %28 + %27 = OpLabel + %34 = OpIAdd %6 %39 %21 + OpBranch %29 + %29 = OpLabel + %36 = OpISub %6 %40 %21 + OpBranch %26 + %28 = OpLabel + OpReturn + OpFunctionEnd + )"; + +const std::string output = +R"(OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %2 "main" +OpExecutionMode %2 OriginUpperLeft +OpSource GLSL 440 +OpName %2 "main" +%3 = OpTypeVoid +%4 = OpTypeFunction %3 +%5 = OpTypeInt 32 1 +%6 = OpTypePointer Function %5 +%7 = OpConstant %5 0 +%8 = OpConstant %5 2 +%9 = OpTypeBool +%10 = OpConstant %5 1 +%2 = OpFunction %3 None %4 +%11 = OpLabel +OpBranch %12 +%12 = OpLabel +OpBranch %19 +%19 = OpLabel +%20 = OpSLessThanEqual %9 %7 %8 +OpBranch %21 +%21 = OpLabel +%14 = OpIAdd %5 %7 %10 +OpBranch %15 +%15 = OpLabel +%17 = OpIAdd %5 %7 %10 +OpBranch %41 +%41 = OpLabel +OpBranch %44 +%44 = OpLabel +%45 = OpSLessThanEqual %9 %17 %8 +OpBranch %46 +%46 = OpLabel +%47 = OpIAdd %5 %14 %10 +OpBranch %48 +%48 = OpLabel +%49 = OpIAdd %5 %17 %10 +OpBranch %50 +%50 = OpLabel +OpBranch %53 +%53 = OpLabel +%54 = OpSLessThanEqual %9 %49 %8 +OpBranch %55 +%55 = OpLabel +%56 = OpIAdd %5 %47 %10 +OpBranch %57 +%57 = OpLabel +%58 = OpIAdd %5 %49 %10 +OpBranch %18 +%18 = OpLabel +OpBranch %22 +%22 = OpLabel +OpBranch %29 +%29 = OpLabel +%30 = OpSGreaterThanEqual %9 %10 %7 +OpBranch %31 +%31 = OpLabel +%24 = OpIAdd %5 %56 %10 +OpBranch %25 +%25 = OpLabel +%27 = OpISub %5 %10 %10 +OpBranch %32 +%32 = OpLabel +OpBranch %35 +%35 = OpLabel +%36 = OpSGreaterThanEqual %9 %27 %7 +OpBranch %37 +%37 = OpLabel +%38 = OpIAdd %5 %24 %10 +OpBranch %39 +%39 = OpLabel +%40 = OpISub %5 %27 %10 +OpBranch %28 +%28 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << text << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(text, output, false); +} + +// clang-format off + // With opt::LocalMultiStoreElimPass + const std::string condition_in_header = R"( + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %o + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 430 + OpDecorate %o Location 0 + %void = OpTypeVoid + %6 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_n2 = OpConstant %int -2 + %int_2 = OpConstant %int 2 + %bool = OpTypeBool + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %o = OpVariable %_ptr_Output_float Output + %float_1 = OpConstant %float 1 + %main = OpFunction %void None %6 + %15 = OpLabel + OpBranch %16 + %16 = OpLabel + %27 = OpPhi %int %int_n2 %15 %26 %18 + %21 = OpSLessThanEqual %bool %27 %int_2 + OpLoopMerge %17 %18 Unroll + OpBranchConditional %21 %22 %17 + %22 = OpLabel + %23 = OpLoad %float %o + %24 = OpFAdd %float %23 %float_1 + OpStore %o %24 + OpBranch %18 + %18 = OpLabel + %26 = OpIAdd %int %27 %int_2 + OpBranch %16 + %17 = OpLabel + OpReturn + OpFunctionEnd + )"; +//clang-format on + + +TEST_F(PassClassTest, FullyUnrollConditionIsInHeaderBlock) { + +// clang-format off +const std::string output = +R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %1 "main" %2 +OpExecutionMode %1 OriginUpperLeft +OpSource GLSL 430 +OpDecorate %2 Location 0 +%3 = OpTypeVoid +%4 = OpTypeFunction %3 +%5 = OpTypeInt 32 1 +%6 = OpConstant %5 -2 +%7 = OpConstant %5 2 +%8 = OpTypeBool +%9 = OpTypeFloat 32 +%10 = OpTypePointer Output %9 +%2 = OpVariable %10 Output +%11 = OpConstant %9 1 +%1 = OpFunction %3 None %4 +%12 = OpLabel +OpBranch %13 +%13 = OpLabel +%17 = OpSLessThanEqual %8 %6 %7 +OpBranch %19 +%19 = OpLabel +%20 = OpLoad %9 %2 +%21 = OpFAdd %9 %20 %11 +OpStore %2 %21 +OpBranch %16 +%16 = OpLabel +%15 = OpIAdd %5 %6 %7 +OpBranch %22 +%22 = OpLabel +%24 = OpSLessThanEqual %8 %15 %7 +OpBranch %25 +%25 = OpLabel +%26 = OpLoad %9 %2 +%27 = OpFAdd %9 %26 %11 +OpStore %2 %27 +OpBranch %28 +%28 = OpLabel +%29 = OpIAdd %5 %15 %7 +OpBranch %30 +%30 = OpLabel +%32 = OpSLessThanEqual %8 %29 %7 +OpBranch %33 +%33 = OpLabel +%34 = OpLoad %9 %2 +%35 = OpFAdd %9 %34 %11 +OpStore %2 %35 +OpBranch %36 +%36 = OpLabel +%37 = OpIAdd %5 %29 %7 +OpBranch %18 +%18 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, condition_in_header, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << condition_in_header << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(condition_in_header, output, false); +} + +TEST_F(PassClassTest, PartiallyUnrollResidualConditionIsInHeaderBlock) { + // clang-format off +const std::string output = +R"(OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %1 "main" %2 +OpExecutionMode %1 OriginUpperLeft +OpSource GLSL 430 +OpDecorate %2 Location 0 +%3 = OpTypeVoid +%4 = OpTypeFunction %3 +%5 = OpTypeInt 32 1 +%6 = OpConstant %5 -2 +%7 = OpConstant %5 2 +%8 = OpTypeBool +%9 = OpTypeFloat 32 +%10 = OpTypePointer Output %9 +%2 = OpVariable %10 Output +%11 = OpConstant %9 1 +%40 = OpTypeInt 32 0 +%41 = OpConstant %40 1 +%1 = OpFunction %3 None %4 +%12 = OpLabel +OpBranch %13 +%13 = OpLabel +%14 = OpPhi %5 %6 %12 %15 %16 +%17 = OpSLessThanEqual %8 %14 %41 +OpLoopMerge %22 %16 Unroll +OpBranchConditional %17 %19 %22 +%19 = OpLabel +%20 = OpLoad %9 %2 +%21 = OpFAdd %9 %20 %11 +OpStore %2 %21 +OpBranch %16 +%16 = OpLabel +%15 = OpIAdd %5 %14 %7 +OpBranch %13 +%22 = OpLabel +OpBranch %23 +%23 = OpLabel +%24 = OpPhi %5 %14 %22 %39 %38 +%25 = OpSLessThanEqual %8 %24 %7 +OpLoopMerge %31 %38 DontUnroll +OpBranchConditional %25 %26 %31 +%26 = OpLabel +%27 = OpLoad %9 %2 +%28 = OpFAdd %9 %27 %11 +OpStore %2 %28 +OpBranch %29 +%29 = OpLabel +%30 = OpIAdd %5 %24 %7 +OpBranch %32 +%32 = OpLabel +%34 = OpSLessThanEqual %8 %30 %7 +OpBranch %35 +%35 = OpLabel +%36 = OpLoad %9 %2 +%37 = OpFAdd %9 %36 %11 +OpStore %2 %37 +OpBranch %38 +%38 = OpLabel +%39 = OpIAdd %5 %30 %7 +OpBranch %23 +%31 = OpLabel +OpReturn +%18 = OpLabel +OpReturn +OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, condition_in_header, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for ushader:\n" + << condition_in_header << std::endl; + + opt::LoopUnroller loop_unroller; + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck>(condition_in_header, output, + false); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/unswitch.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/unswitch.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/loop_optimizations/unswitch.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/loop_optimizations/unswitch.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,914 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#ifdef SPIRV_EFFCEE +#include "effcee/effcee.h" +#endif + +#include "../pass_fixture.h" + +namespace { + +using namespace spvtools; + +using UnswitchTest = PassTest<::testing::Test>; + +#ifdef SPIRV_EFFCEE + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 450 core +uniform vec4 c; +void main() { + int i = 0; + int j = 0; + bool cond = c[0] == 0; + for (; i < 10; i++, j++) { + if (cond) { + i++; + } + else { + j++; + } + } +} +*/ +TEST_F(UnswitchTest, SimpleUnswitch) { + const std::string text = R"( +; CHECK: [[cst_cond:%\w+]] = OpFOrdEqual +; CHECK-NEXT: OpSelectionMerge [[if_merge:%\w+]] None +; CHECK-NEXT: OpBranchConditional [[cst_cond]] [[loop_t:%\w+]] [[loop_f:%\w+]] + +; Loop specialized for false. +; CHECK: [[loop_f]] = OpLabel +; CHECK-NEXT: OpBranch [[loop:%\w+]] +; CHECK: [[loop]] = OpLabel +; CHECK-NEXT: [[phi_i:%\w+]] = OpPhi %int %int_0 [[loop_f]] [[iv_i:%\w+]] [[continue:%\w+]] +; CHECK-NEXT: [[phi_j:%\w+]] = OpPhi %int %int_0 [[loop_f]] [[iv_j:%\w+]] [[continue]] +; CHECK-NEXT: OpLoopMerge [[merge:%\w+]] [[continue]] None +; CHECK: [[loop_exit:%\w+]] = OpSLessThan {{%\w+}} [[phi_i]] {{%\w+}} +; CHECK-NEXT: OpBranchConditional [[loop_exit]] {{%\w+}} [[merge]] +; Check that we have i+=1 and j+=2. +; CHECK: [[phi_j:%\w+]] = OpIAdd %int [[phi_j]] %int_1 +; CHECK: [[iv_i]] = OpIAdd %int [[phi_i]] %int_1 +; CHECK: [[iv_j]] = OpIAdd %int [[phi_j]] %int_1 +; CHECK: [[merge]] = OpLabel +; CHECK-NEXT: OpBranch [[if_merge]] + +; Loop specialized for true. +; CHECK: [[loop_t]] = OpLabel +; CHECK-NEXT: OpBranch [[loop:%\w+]] +; CHECK: [[loop]] = OpLabel +; CHECK-NEXT: [[phi_i:%\w+]] = OpPhi %int %int_0 [[loop_t]] [[iv_i:%\w+]] [[continue:%\w+]] +; CHECK-NEXT: [[phi_j:%\w+]] = OpPhi %int %int_0 [[loop_t]] [[iv_j:%\w+]] [[continue]] +; CHECK-NEXT: OpLoopMerge [[merge:%\w+]] [[continue]] None +; CHECK: [[loop_exit:%\w+]] = OpSLessThan {{%\w+}} [[phi_i]] {{%\w+}} +; CHECK-NEXT: OpBranchConditional [[loop_exit]] {{%\w+}} [[merge]] +; Check that we have i+=2 and j+=1. +; CHECK: [[phi_i:%\w+]] = OpIAdd %int [[phi_i]] %int_1 +; CHECK: [[iv_i]] = OpIAdd %int [[phi_i]] %int_1 +; CHECK: [[iv_j]] = OpIAdd %int [[phi_j]] %int_1 +; CHECK: [[merge]] = OpLabel +; CHECK-NEXT: OpBranch [[if_merge]] + +; CHECK: [[if_merge]] = OpLabel +; CHECK-NEXT: OpReturn + + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" + OpExecutionMode %main OriginLowerLeft + OpSource GLSL 450 + OpName %main "main" + OpName %c "c" + OpDecorate %c Location 0 + OpDecorate %c DescriptorSet 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %bool = OpTypeBool +%_ptr_Function_bool = OpTypePointer Function %bool + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_UniformConstant_v4float = OpTypePointer UniformConstant %v4float + %c = OpVariable %_ptr_UniformConstant_v4float UniformConstant + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 +%_ptr_UniformConstant_float = OpTypePointer UniformConstant %float + %float_0 = OpConstant %float 0 + %int_10 = OpConstant %int 10 + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %3 + %5 = OpLabel + %21 = OpAccessChain %_ptr_UniformConstant_float %c %uint_0 + %22 = OpLoad %float %21 + %24 = OpFOrdEqual %bool %22 %float_0 + OpBranch %25 + %25 = OpLabel + %46 = OpPhi %int %int_0 %5 %43 %28 + %47 = OpPhi %int %int_0 %5 %45 %28 + OpLoopMerge %27 %28 None + OpBranch %29 + %29 = OpLabel + %32 = OpSLessThan %bool %46 %int_10 + OpBranchConditional %32 %26 %27 + %26 = OpLabel + OpSelectionMerge %35 None + OpBranchConditional %24 %34 %39 + %34 = OpLabel + %38 = OpIAdd %int %46 %int_1 + OpBranch %35 + %39 = OpLabel + %41 = OpIAdd %int %47 %int_1 + OpBranch %35 + %35 = OpLabel + %48 = OpPhi %int %38 %34 %46 %39 + %49 = OpPhi %int %47 %34 %41 %39 + OpBranch %28 + %28 = OpLabel + %43 = OpIAdd %int %48 %int_1 + %45 = OpIAdd %int %49 %int_1 + OpBranch %25 + %27 = OpLabel + OpReturn + OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 330 core +in vec4 c; +void main() { + int i = 0; + bool cond = c[0] == 0; + for (; i < 10; i++) { + if (cond) { + i++; + } + else { + return; + } + } +} +*/ +TEST_F(UnswitchTest, UnswitchExit) { + const std::string text = R"( +; CHECK: [[cst_cond:%\w+]] = OpFOrdEqual +; CHECK-NEXT: OpSelectionMerge [[if_merge:%\w+]] None +; CHECK-NEXT: OpBranchConditional [[cst_cond]] [[loop_t:%\w+]] [[loop_f:%\w+]] + +; Loop specialized for false. +; CHECK: [[loop_f]] = OpLabel +; CHECK: OpReturn + +; Loop specialized for true. +; CHECK: [[loop_t]] = OpLabel +; CHECK-NEXT: OpBranch [[loop:%\w+]] +; CHECK: [[loop]] = OpLabel +; CHECK-NEXT: [[phi_i:%\w+]] = OpPhi %int %int_0 [[loop_t]] [[iv_i:%\w+]] [[continue:%\w+]] +; CHECK-NEXT: OpLoopMerge [[merge:%\w+]] [[continue]] None +; CHECK: [[loop_exit:%\w+]] = OpSLessThan {{%\w+}} [[phi_i]] {{%\w+}} +; CHECK-NEXT: OpBranchConditional [[loop_exit]] {{%\w+}} [[merge]] +; Check that we have i+=2. +; CHECK: [[phi_i:%\w+]] = OpIAdd %int [[phi_i]] %int_1 +; CHECK: [[iv_i]] = OpIAdd %int [[phi_i]] %int_1 +; CHECK: [[merge]] = OpLabel +; CHECK-NEXT: OpBranch [[if_merge]] + +; CHECK: [[if_merge]] = OpLabel +; CHECK-NEXT: OpReturn + + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %c + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 330 + OpName %main "main" + OpName %c "c" + OpDecorate %c Location 0 + OpDecorate %23 Uniform + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %bool = OpTypeBool +%_ptr_Function_bool = OpTypePointer Function %bool + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float + %c = OpVariable %_ptr_Input_v4float Input + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 +%_ptr_Input_float = OpTypePointer Input %float + %float_0 = OpConstant %float 0 + %int_10 = OpConstant %int 10 + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %3 + %5 = OpLabel + %20 = OpAccessChain %_ptr_Input_float %c %uint_0 + %21 = OpLoad %float %20 + %23 = OpFOrdEqual %bool %21 %float_0 + OpBranch %24 + %24 = OpLabel + %42 = OpPhi %int %int_0 %5 %41 %27 + OpLoopMerge %26 %27 None + OpBranch %28 + %28 = OpLabel + %31 = OpSLessThan %bool %42 %int_10 + OpBranchConditional %31 %25 %26 + %25 = OpLabel + OpSelectionMerge %34 None + OpBranchConditional %23 %33 %38 + %33 = OpLabel + %37 = OpIAdd %int %42 %int_1 + OpBranch %34 + %38 = OpLabel + OpReturn + %34 = OpLabel + OpBranch %27 + %27 = OpLabel + %41 = OpIAdd %int %37 %int_1 + OpBranch %24 + %26 = OpLabel + OpReturn + OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 330 core +in vec4 c; +void main() { + int i = 0; + bool cond = c[0] == 0; + for (; i < 10; i++) { + if (cond) { + continue; + } + else { + i++; + } + } +} +*/ +TEST_F(UnswitchTest, UnswitchContinue) { + const std::string text = R"( +; CHECK: [[cst_cond:%\w+]] = OpFOrdEqual +; CHECK-NEXT: OpSelectionMerge [[if_merge:%\w+]] None +; CHECK-NEXT: OpBranchConditional [[cst_cond]] [[loop_t:%\w+]] [[loop_f:%\w+]] + +; Loop specialized for false. +; CHECK: [[loop_f]] = OpLabel +; CHECK-NEXT: OpBranch [[loop:%\w+]] +; CHECK: [[loop]] = OpLabel +; CHECK-NEXT: [[phi_i:%\w+]] = OpPhi %int %int_0 [[loop_f]] [[iv_i:%\w+]] [[continue:%\w+]] +; CHECK-NEXT: OpLoopMerge [[merge:%\w+]] [[continue]] None +; CHECK: [[loop_exit:%\w+]] = OpSLessThan {{%\w+}} [[phi_i]] {{%\w+}} +; CHECK-NEXT: OpBranchConditional [[loop_exit]] {{%\w+}} [[merge]] +; Check that we have i+=2. +; CHECK: [[phi_i:%\w+]] = OpIAdd %int [[phi_i]] %int_1 +; CHECK: [[iv_i]] = OpIAdd %int [[phi_i]] %int_1 +; CHECK: [[merge]] = OpLabel +; CHECK-NEXT: OpBranch [[if_merge]] + +; Loop specialized for true. +; CHECK: [[loop_t]] = OpLabel +; CHECK-NEXT: OpBranch [[loop:%\w+]] +; CHECK: [[loop]] = OpLabel +; CHECK-NEXT: [[phi_i:%\w+]] = OpPhi %int %int_0 [[loop_t]] [[iv_i:%\w+]] [[continue:%\w+]] +; CHECK-NEXT: OpLoopMerge [[merge:%\w+]] [[continue]] None +; CHECK: [[loop_exit:%\w+]] = OpSLessThan {{%\w+}} [[phi_i]] {{%\w+}} +; CHECK-NEXT: OpBranchConditional [[loop_exit]] {{%\w+}} [[merge]] +; Check that we have i+=1. +; CHECK: [[iv_i]] = OpIAdd %int [[phi_i]] %int_1 +; CHECK: [[merge]] = OpLabel +; CHECK-NEXT: OpBranch [[if_merge]] + +; CHECK: [[if_merge]] = OpLabel +; CHECK-NEXT: OpReturn + + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %c + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 330 + OpName %main "main" + OpName %c "c" + OpDecorate %c Location 0 + OpDecorate %23 Uniform + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %bool = OpTypeBool +%_ptr_Function_bool = OpTypePointer Function %bool + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float + %c = OpVariable %_ptr_Input_v4float Input + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 +%_ptr_Input_float = OpTypePointer Input %float + %float_0 = OpConstant %float 0 + %int_10 = OpConstant %int 10 + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %3 + %5 = OpLabel + %20 = OpAccessChain %_ptr_Input_float %c %uint_0 + %21 = OpLoad %float %20 + %23 = OpFOrdEqual %bool %21 %float_0 + OpBranch %24 + %24 = OpLabel + %42 = OpPhi %int %int_0 %5 %41 %27 + OpLoopMerge %26 %27 None + OpBranch %28 + %28 = OpLabel + %31 = OpSLessThan %bool %42 %int_10 + OpBranchConditional %31 %25 %26 + %25 = OpLabel + OpSelectionMerge %34 None + OpBranchConditional %23 %33 %36 + %33 = OpLabel + OpBranch %27 + %36 = OpLabel + %39 = OpIAdd %int %42 %int_1 + OpBranch %34 + %34 = OpLabel + OpBranch %27 + %27 = OpLabel + %43 = OpPhi %int %42 %33 %39 %34 + %41 = OpIAdd %int %43 %int_1 + OpBranch %24 + %26 = OpLabel + OpReturn + OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 330 core +in vec4 c; +void main() { + int i = 0; + bool cond = c[0] == 0; + for (; i < 10; i++) { + if (cond) { + i++; + } + else { + break; + } + } +} +*/ +TEST_F(UnswitchTest, UnswitchKillLoop) { + const std::string text = R"( +; CHECK: [[cst_cond:%\w+]] = OpFOrdEqual +; CHECK-NEXT: OpSelectionMerge [[if_merge:%\w+]] None +; CHECK-NEXT: OpBranchConditional [[cst_cond]] [[loop_t:%\w+]] [[loop_f:%\w+]] + +; Loop specialized for false. +; CHECK: [[loop_f]] = OpLabel +; CHECK: OpBranch [[if_merge]] + +; Loop specialized for true. +; CHECK: [[loop_t]] = OpLabel +; CHECK-NEXT: OpBranch [[loop:%\w+]] +; CHECK: [[loop]] = OpLabel +; CHECK-NEXT: [[phi_i:%\w+]] = OpPhi %int %int_0 [[loop_t]] [[iv_i:%\w+]] [[continue:%\w+]] +; CHECK-NEXT: OpLoopMerge [[merge:%\w+]] [[continue]] None +; CHECK: [[loop_exit:%\w+]] = OpSLessThan {{%\w+}} [[phi_i]] {{%\w+}} +; CHECK-NEXT: OpBranchConditional [[loop_exit]] {{%\w+}} [[merge]] +; Check that we have i+=2. +; CHECK: [[phi_i:%\w+]] = OpIAdd %int [[phi_i]] %int_1 +; CHECK: [[iv_i]] = OpIAdd %int [[phi_i]] %int_1 +; CHECK: [[merge]] = OpLabel +; CHECK-NEXT: OpBranch [[if_merge]] + +; CHECK: [[if_merge]] = OpLabel +; CHECK-NEXT: OpReturn + + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %c + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 330 + OpName %main "main" + OpName %c "c" + OpDecorate %c Location 0 + OpDecorate %23 Uniform + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %bool = OpTypeBool +%_ptr_Function_bool = OpTypePointer Function %bool + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float + %c = OpVariable %_ptr_Input_v4float Input + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 +%_ptr_Input_float = OpTypePointer Input %float + %float_0 = OpConstant %float 0 + %int_10 = OpConstant %int 10 + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %3 + %5 = OpLabel + %20 = OpAccessChain %_ptr_Input_float %c %uint_0 + %21 = OpLoad %float %20 + %23 = OpFOrdEqual %bool %21 %float_0 + OpBranch %24 + %24 = OpLabel + %42 = OpPhi %int %int_0 %5 %41 %27 + OpLoopMerge %26 %27 None + OpBranch %28 + %28 = OpLabel + %31 = OpSLessThan %bool %42 %int_10 + OpBranchConditional %31 %25 %26 + %25 = OpLabel + OpSelectionMerge %34 None + OpBranchConditional %23 %33 %38 + %33 = OpLabel + %37 = OpIAdd %int %42 %int_1 + OpBranch %34 + %38 = OpLabel + OpBranch %26 + %34 = OpLabel + OpBranch %27 + %27 = OpLabel + %41 = OpIAdd %int %37 %int_1 + OpBranch %24 + %26 = OpLabel + OpReturn + OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 330 core +in vec4 c; +void main() { + int i = 0; + int cond = int(c[0]); + for (; i < 10; i++) { + switch (cond) { + case 0: + return; + case 1: + discard; + case 2: + break; + default: + break; + } + } + bool cond2 = i == 9; +} +*/ +TEST_F(UnswitchTest, UnswitchSwitch) { + const std::string text = R"( +; CHECK: [[cst_cond:%\w+]] = OpConvertFToS +; CHECK-NEXT: OpSelectionMerge [[if_merge:%\w+]] None +; CHECK-NEXT: OpSwitch [[cst_cond]] [[default:%\w+]] 0 [[loop_0:%\w+]] 1 [[loop_1:%\w+]] 2 [[loop_2:%\w+]] + +; Loop specialized for 2. +; CHECK: [[loop_2]] = OpLabel +; CHECK-NEXT: OpBranch [[loop:%\w+]] +; CHECK: [[loop]] = OpLabel +; CHECK-NEXT: [[phi_i:%\w+]] = OpPhi %int %int_0 [[loop_2]] [[iv_i:%\w+]] [[continue:%\w+]] +; CHECK-NEXT: OpLoopMerge [[merge:%\w+]] [[continue]] None +; CHECK: [[loop_exit:%\w+]] = OpSLessThan {{%\w+}} [[phi_i]] {{%\w+}} +; CHECK-NEXT: OpBranchConditional [[loop_exit]] {{%\w+}} [[merge]] +; Check that we have i+=1. +; CHECK: [[iv_i]] = OpIAdd %int [[phi_i]] %int_1 +; CHECK: OpBranch [[loop]] + +; Loop specialized for 1. +; CHECK: [[loop_1]] = OpLabel +; CHECK: OpKill + +; Loop specialized for 0. +; CHECK: [[loop_0]] = OpLabel +; CHECK: OpReturn + +; Loop specialized for the default case. +; CHECK: [[default]] = OpLabel +; CHECK-NEXT: OpBranch [[loop:%\w+]] +; CHECK: [[loop]] = OpLabel +; CHECK-NEXT: [[phi_i:%\w+]] = OpPhi %int %int_0 [[default]] [[iv_i:%\w+]] [[continue:%\w+]] +; CHECK-NEXT: OpLoopMerge [[merge:%\w+]] [[continue]] None +; CHECK: [[loop_exit:%\w+]] = OpSLessThan {{%\w+}} [[phi_i]] {{%\w+}} +; CHECK-NEXT: OpBranchConditional [[loop_exit]] {{%\w+}} [[merge]] +; Check that we have i+=1. +; CHECK: [[phi_i:%\w+]] = OpIAdd %int [[phi_i]] %int_1 +; CHECK: OpBranch [[loop]] + +; CHECK: [[if_merge]] = OpLabel +; CHECK-NEXT: OpReturn + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %c + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 330 + OpName %main "main" + OpName %c "c" + OpDecorate %c Location 0 + OpDecorate %20 Uniform + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float + %c = OpVariable %_ptr_Input_v4float Input + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 +%_ptr_Input_float = OpTypePointer Input %float + %int_10 = OpConstant %int 10 + %bool = OpTypeBool + %int_1 = OpConstant %int 1 +%_ptr_Function_bool = OpTypePointer Function %bool + %main = OpFunction %void None %3 + %5 = OpLabel + %18 = OpAccessChain %_ptr_Input_float %c %uint_0 + %19 = OpLoad %float %18 + %20 = OpConvertFToS %int %19 + OpBranch %21 + %21 = OpLabel + %49 = OpPhi %int %int_0 %5 %43 %24 + OpLoopMerge %23 %24 None + OpBranch %25 + %25 = OpLabel + %29 = OpSLessThan %bool %49 %int_10 + OpBranchConditional %29 %22 %23 + %22 = OpLabel + OpSelectionMerge %35 None + OpSwitch %20 %34 0 %31 1 %32 2 %33 + %34 = OpLabel + OpBranch %35 + %31 = OpLabel + OpReturn + %32 = OpLabel + OpKill + %33 = OpLabel + OpBranch %35 + %35 = OpLabel + OpBranch %24 + %24 = OpLabel + %43 = OpIAdd %int %49 %int_1 + OpBranch %21 + %23 = OpLabel + OpReturn + OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 440 core +layout(location = 0)in vec4 c; +void main() { + int i = 0; + int j = 0; + int k = 0; + bool cond = c[0] == 0; + for (; i < 10; i++) { + for (; j < 10; j++) { + if (cond) { + i++; + } else { + j++; + } + } + } + for (; k < 10; k++) { + if (cond) { + k++; + } + } +} +*/ +TEST_F(UnswitchTest, UnSwitchNested) { + const std::string text = R"( +; CHECK: [[cst_cond:%\w+]] = OpFOrdEqual +; CHECK-NEXT: OpSelectionMerge [[if_merge:%\w+]] None +; CHECK-NEXT: OpBranchConditional [[cst_cond]] [[loop_t:%\w+]] [[loop_f:%\w+]] + +; Loop specialized for false, one loop is killed, j won't change anymore. +; CHECK: [[loop_f]] = OpLabel +; CHECK-NEXT: OpBranch [[loop:%\w+]] +; CHECK: [[loop]] = OpLabel +; CHECK-NEXT: [[phi_i:%\w+]] = OpPhi %int %int_0 [[loop_f]] [[iv_i:%\w+]] [[continue:%\w+]] +; CHECK-NEXT: [[phi_j:%\w+]] = OpPhi %int %int_0 [[loop_f]] [[iv_j:%\w+]] [[continue]] +; CHECK-NEXT: OpLoopMerge [[merge:%\w+]] [[continue]] None +; CHECK: [[iv_i]] = OpIAdd %int [[phi_i]] %int_1 +; CHECK-NEXT: OpBranch [[loop]] +; CHECK: OpReturn + +; Loop specialized for true. +; CHECK: [[loop_t]] = OpLabel +; CHECK-NEXT: OpBranch [[loop:%\w+]] +; CHECK: [[loop]] = OpLabel +; CHECK-NEXT: [[phi_i:%\w+]] = OpPhi %int %int_0 [[loop_t]] [[iv_i:%\w+]] [[continue:%\w+]] +; CHECK-NEXT: [[phi_j:%\w+]] = OpPhi %int %int_0 [[loop_t]] [[iv_j:%\w+]] [[continue]] +; CHECK-NEXT: OpLoopMerge [[merge:%\w+]] [[continue]] None +; CHECK: [[loop_exit:%\w+]] = OpSLessThan {{%\w+}} [[phi_i]] {{%\w+}} +; CHECK-NEXT: OpBranchConditional [[loop_exit]] [[pre_loop_inner:%\w+]] [[merge]] + +; CHECK: [[pre_loop_inner]] = OpLabel +; CHECK-NEXT: OpBranch [[loop_inner:%\w+]] +; CHECK-NEXT: [[loop_inner]] = OpLabel +; CHECK-NEXT: [[phi2_i:%\w+]] = OpPhi %int [[phi_i]] [[pre_loop_inner]] [[iv2_i:%\w+]] [[continue2:%\w+]] +; CHECK-NEXT: [[phi2_j:%\w+]] = OpPhi %int [[phi_j]] [[pre_loop_inner]] [[iv2_j:%\w+]] [[continue2]] +; CHECK-NEXT: OpLoopMerge [[merge2:%\w+]] [[continue2]] None + +; CHECK: OpBranch [[continue2]] +; CHECK: [[merge2]] = OpLabel +; CHECK: OpBranch [[continue]] +; CHECK: [[merge]] = OpLabel + +; Unswitched double nested loop is done. Test the single remaining one. + +; CHECK: [[if_merge]] = OpLabel +; CHECK-NEXT: OpSelectionMerge [[if_merge:%\w+]] None +; CHECK-NEXT: OpBranchConditional [[cst_cond]] [[loop_t:%\w+]] [[loop_f:%\w+]] + +; Loop specialized for false. +; CHECK: [[loop_f]] = OpLabel +; CHECK-NEXT: OpBranch [[loop:%\w+]] +; CHECK: [[loop]] = OpLabel +; CHECK-NEXT: [[phi_k:%\w+]] = OpPhi %int %int_0 [[loop_f]] [[iv_k:%\w+]] [[continue:%\w+]] +; CHECK-NEXT: OpLoopMerge [[merge:%\w+]] [[continue]] None +; CHECK: [[loop_exit:%\w+]] = OpSLessThan {{%\w+}} [[phi_k]] {{%\w+}} +; CHECK-NEXT: OpBranchConditional [[loop_exit]] {{%\w+}} [[merge]] +; Check that we have k+=1 +; CHECK: [[iv_k]] = OpIAdd %int [[phi_k]] %int_1 +; CHECK: OpBranch [[loop]] +; CHECK: [[merge]] = OpLabel +; CHECK-NEXT: OpBranch [[if_merge]] + +; Loop specialized for true. +; CHECK: [[loop_t]] = OpLabel +; CHECK-NEXT: OpBranch [[loop:%\w+]] +; CHECK: [[loop]] = OpLabel +; CHECK-NEXT: [[phi_k:%\w+]] = OpPhi %int %int_0 [[loop_t]] [[iv_k:%\w+]] [[continue:%\w+]] +; CHECK-NEXT: OpLoopMerge [[merge:%\w+]] [[continue]] None +; CHECK: [[loop_exit:%\w+]] = OpSLessThan {{%\w+}} [[phi_k]] {{%\w+}} +; CHECK-NEXT: OpBranchConditional [[loop_exit]] {{%\w+}} [[merge]] +; Check that we have k+=2. +; CHECK: [[tmp_k:%\w+]] = OpIAdd %int [[phi_k]] %int_1 +; CHECK: [[iv_k]] = OpIAdd %int [[tmp_k]] %int_1 +; CHECK: OpBranch [[loop]] +; CHECK: [[merge]] = OpLabel +; CHECK-NEXT: OpBranch [[if_merge]] + +; CHECK: [[if_merge]] = OpLabel +; CHECK-NEXT: OpReturn + + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %c + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 440 + OpName %main "main" + OpName %c "c" + OpDecorate %c Location 0 + OpDecorate %25 Uniform + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %bool = OpTypeBool +%_ptr_Function_bool = OpTypePointer Function %bool + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float + %c = OpVariable %_ptr_Input_v4float Input + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 +%_ptr_Input_float = OpTypePointer Input %float + %float_0 = OpConstant %float 0 + %int_10 = OpConstant %int 10 + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %3 + %5 = OpLabel + %22 = OpAccessChain %_ptr_Input_float %c %uint_0 + %23 = OpLoad %float %22 + %25 = OpFOrdEqual %bool %23 %float_0 + OpBranch %26 + %26 = OpLabel + %67 = OpPhi %int %int_0 %5 %52 %29 + %68 = OpPhi %int %int_0 %5 %70 %29 + OpLoopMerge %28 %29 None + OpBranch %30 + %30 = OpLabel + %33 = OpSLessThan %bool %67 %int_10 + OpBranchConditional %33 %27 %28 + %27 = OpLabel + OpBranch %34 + %34 = OpLabel + %69 = OpPhi %int %67 %27 %46 %37 + %70 = OpPhi %int %68 %27 %50 %37 + OpLoopMerge %36 %37 None + OpBranch %38 + %38 = OpLabel + %40 = OpSLessThan %bool %70 %int_10 + OpBranchConditional %40 %35 %36 + %35 = OpLabel + OpSelectionMerge %43 None + OpBranchConditional %25 %42 %47 + %42 = OpLabel + %46 = OpIAdd %int %69 %int_1 + OpBranch %43 + %47 = OpLabel + OpReturn + %43 = OpLabel + OpBranch %37 + %37 = OpLabel + %50 = OpIAdd %int %70 %int_1 + OpBranch %34 + %36 = OpLabel + OpBranch %29 + %29 = OpLabel + %52 = OpIAdd %int %69 %int_1 + OpBranch %26 + %28 = OpLabel + OpBranch %53 + %53 = OpLabel + %71 = OpPhi %int %int_0 %28 %66 %56 + OpLoopMerge %55 %56 None + OpBranch %57 + %57 = OpLabel + %59 = OpSLessThan %bool %71 %int_10 + OpBranchConditional %59 %54 %55 + %54 = OpLabel + OpSelectionMerge %62 None + OpBranchConditional %25 %61 %62 + %61 = OpLabel + %64 = OpIAdd %int %71 %int_1 + OpBranch %62 + %62 = OpLabel + %72 = OpPhi %int %71 %54 %64 %61 + OpBranch %56 + %56 = OpLabel + %66 = OpIAdd %int %72 %int_1 + OpBranch %53 + %55 = OpLabel + OpReturn + OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, true); +} +#endif // SPIRV_EFFCEE + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 330 core +in vec4 c; +void main() { + bool cond = false; + if (c[0] == 0) { + cond = c[1] == 0; + } else { + cond = c[2] == 0; + } + for (int i = 0; i < 10; i++) { + if (cond) { + i++; + } + } +} +*/ +TEST_F(UnswitchTest, UnswitchNotUniform) { + // Check that the unswitch is not triggered (condition loop invariant but not + // uniform) + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %c + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 330 + OpName %main "main" + OpName %c "c" + OpDecorate %c Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %bool = OpTypeBool +%_ptr_Function_bool = OpTypePointer Function %bool + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float + %c = OpVariable %_ptr_Input_v4float Input + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 +%_ptr_Input_float = OpTypePointer Input %float + %float_0 = OpConstant %float 0 + %uint_1 = OpConstant %uint 1 + %uint_2 = OpConstant %uint 2 + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %int_10 = OpConstant %int 10 + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %3 + %5 = OpLabel + %17 = OpAccessChain %_ptr_Input_float %c %uint_0 + %18 = OpLoad %float %17 + %20 = OpFOrdEqual %bool %18 %float_0 + OpSelectionMerge %22 None + OpBranchConditional %20 %21 %27 + %21 = OpLabel + %24 = OpAccessChain %_ptr_Input_float %c %uint_1 + %25 = OpLoad %float %24 + %26 = OpFOrdEqual %bool %25 %float_0 + OpBranch %22 + %27 = OpLabel + %29 = OpAccessChain %_ptr_Input_float %c %uint_2 + %30 = OpLoad %float %29 + %31 = OpFOrdEqual %bool %30 %float_0 + OpBranch %22 + %22 = OpLabel + %52 = OpPhi %bool %26 %21 %31 %27 + OpBranch %36 + %36 = OpLabel + %53 = OpPhi %int %int_0 %22 %51 %39 + OpLoopMerge %38 %39 None + OpBranch %40 + %40 = OpLabel + %43 = OpSLessThan %bool %53 %int_10 + OpBranchConditional %43 %37 %38 + %37 = OpLabel + OpSelectionMerge %46 None + OpBranchConditional %52 %45 %46 + %45 = OpLabel + %49 = OpIAdd %int %53 %int_1 + OpBranch %46 + %46 = OpLabel + %54 = OpPhi %int %53 %37 %49 %45 + OpBranch %39 + %39 = OpLabel + %51 = OpIAdd %int %54 %int_1 + OpBranch %36 + %38 = OpLabel + OpReturn + OpFunctionEnd + )"; + + auto result = + SinglePassRunAndDisassemble(text, true, false); + + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/module_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/module_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/module_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/module_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,143 @@ +// Copyright (c) 2016 Google 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. + +#include +#include + +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +#include "message.h" +#include "opt/build_module.h" +#include "opt/module.h" +#include "spirv-tools/libspirv.hpp" + +#include "module_utils.h" + +namespace { + +using ::testing::Eq; +using spvtest::GetIdBound; +using spvtools::ir::IRContext; +using spvtools::ir::Module; + +TEST(ModuleTest, SetIdBound) { + Module m; + // It's initialized to 0. + EXPECT_EQ(0u, GetIdBound(m)); + + m.SetIdBound(19); + EXPECT_EQ(19u, GetIdBound(m)); + + m.SetIdBound(102); + EXPECT_EQ(102u, GetIdBound(m)); +} + +// Returns an IRContext owning the module formed by assembling the given text, +// then loading the result. +inline std::unique_ptr BuildModule(std::string text) { + return spvtools::BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); +} + +TEST(ModuleTest, ComputeIdBound) { + // Emtpy module case. + EXPECT_EQ(1u, BuildModule("")->module()->ComputeIdBound()); + // Sensitive to result id + EXPECT_EQ(2u, BuildModule("%void = OpTypeVoid")->module()->ComputeIdBound()); + // Sensitive to type id + EXPECT_EQ(1000u, + BuildModule("%a = OpTypeArray !999 3")->module()->ComputeIdBound()); + // Sensitive to a regular Id parameter + EXPECT_EQ(2000u, + BuildModule("OpDecorate !1999 0")->module()->ComputeIdBound()); + // Sensitive to a scope Id parameter. + EXPECT_EQ(3000u, + BuildModule("%f = OpFunction %void None %fntype %a = OpLabel " + "OpMemoryBarrier !2999 %b\n") + ->module() + ->ComputeIdBound()); + // Sensitive to a semantics Id parameter + EXPECT_EQ(4000u, + BuildModule("%f = OpFunction %void None %fntype %a = OpLabel " + "OpMemoryBarrier %b !3999\n") + ->module() + ->ComputeIdBound()); +} + +TEST(ModuleTest, OstreamOperator) { + const std::string text = R"(OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %7 "restrict" +OpDecorate %8 Restrict +%9 = OpTypeVoid +%10 = OpTypeInt 32 0 +%11 = OpTypeStruct %10 %10 +%12 = OpTypePointer Function %10 +%13 = OpTypePointer Function %11 +%14 = OpConstant %10 0 +%15 = OpConstant %10 1 +%7 = OpTypeFunction %9 +%1 = OpFunction %9 None %7 +%2 = OpLabel +%8 = OpVariable %13 Function +%3 = OpAccessChain %12 %8 %14 +%4 = OpLoad %10 %3 +%5 = OpAccessChain %12 %8 %15 +%6 = OpLoad %10 %5 +OpReturn +OpFunctionEnd)"; + + std::string s; + std::ostringstream str(s); + str << *BuildModule(text)->module(); + EXPECT_EQ(text, str.str()); +} + +TEST(ModuleTest, OstreamOperatorInt64) { + const std::string text = R"(OpCapability Shader +OpCapability Linkage +OpCapability Int64 +OpMemoryModel Logical GLSL450 +OpName %7 "restrict" +OpDecorate %5 Restrict +%9 = OpTypeVoid +%10 = OpTypeInt 64 0 +%11 = OpTypeStruct %10 %10 +%12 = OpTypePointer Function %10 +%13 = OpTypePointer Function %11 +%14 = OpConstant %10 0 +%15 = OpConstant %10 1 +%16 = OpConstant %10 4294967297 +%7 = OpTypeFunction %9 +%1 = OpFunction %9 None %7 +%2 = OpLabel +%5 = OpVariable %12 Function +%6 = OpLoad %10 %5 +OpSelectionMerge %3 None +OpSwitch %6 %3 4294967297 %4 +%4 = OpLabel +OpBranch %3 +%3 = OpLabel +OpReturn +OpFunctionEnd)"; + + std::string s; + std::ostringstream str(s); + str << *BuildModule(text)->module(); + EXPECT_EQ(text, str.str()); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/module_utils.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/module_utils.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/module_utils.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/module_utils.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,34 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_TEST_OPT_MODULE_UTILS_H_ +#define LIBSPIRV_TEST_OPT_MODULE_UTILS_H_ + +#include +#include "opt/module.h" + +namespace spvtest { + +inline uint32_t GetIdBound(const spvtools::ir::Module& m) { + std::vector binary; + m.ToBinary(&binary, false); + // The 5-word header must always exist. + EXPECT_LE(5u, binary.size()); + // The bound is the fourth word. + return binary[3]; +} + +} // namespace spvtest + +#endif // LIBSPIRV_TEST_OPT_MODULE_UTILS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/optimizer_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/optimizer_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/optimizer_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/optimizer_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,109 @@ +// Copyright (c) 2017 Google 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. + +#include + +#include "spirv-tools/libspirv.hpp" +#include "spirv-tools/optimizer.hpp" + +#include "pass_fixture.h" + +namespace { + +using spvtools::CreateNullPass; +using spvtools::CreateStripDebugInfoPass; +using spvtools::Optimizer; +using spvtools::SpirvTools; +using ::testing::Eq; + +TEST(Optimizer, CanRunNullPassWithDistinctInputOutputVectors) { + SpirvTools tools(SPV_ENV_UNIVERSAL_1_0); + std::vector binary_in; + tools.Assemble("OpName %foo \"foo\"\n%foo = OpTypeVoid", &binary_in); + + Optimizer opt(SPV_ENV_UNIVERSAL_1_0); + opt.RegisterPass(CreateNullPass()); + std::vector binary_out; + opt.Run(binary_in.data(), binary_in.size(), &binary_out); + + std::string disassembly; + tools.Disassemble(binary_out.data(), binary_out.size(), &disassembly); + EXPECT_THAT(disassembly, Eq("OpName %foo \"foo\"\n%foo = OpTypeVoid\n")); +} + +TEST(Optimizer, CanRunTransformingPassWithDistinctInputOutputVectors) { + SpirvTools tools(SPV_ENV_UNIVERSAL_1_0); + std::vector binary_in; + tools.Assemble("OpName %foo \"foo\"\n%foo = OpTypeVoid", &binary_in); + + Optimizer opt(SPV_ENV_UNIVERSAL_1_0); + opt.RegisterPass(CreateStripDebugInfoPass()); + std::vector binary_out; + opt.Run(binary_in.data(), binary_in.size(), &binary_out); + + std::string disassembly; + tools.Disassemble(binary_out.data(), binary_out.size(), &disassembly); + EXPECT_THAT(disassembly, Eq("%void = OpTypeVoid\n")); +} + +TEST(Optimizer, CanRunNullPassWithAliasedVectors) { + SpirvTools tools(SPV_ENV_UNIVERSAL_1_0); + std::vector binary; + tools.Assemble("OpName %foo \"foo\"\n%foo = OpTypeVoid", &binary); + + Optimizer opt(SPV_ENV_UNIVERSAL_1_0); + opt.RegisterPass(CreateNullPass()); + opt.Run(binary.data(), binary.size(), &binary); // This is the key. + + std::string disassembly; + tools.Disassemble(binary.data(), binary.size(), &disassembly); + EXPECT_THAT(disassembly, Eq("OpName %foo \"foo\"\n%foo = OpTypeVoid\n")); +} + +TEST(Optimizer, CanRunNullPassWithAliasedVectorDataButDifferentSize) { + SpirvTools tools(SPV_ENV_UNIVERSAL_1_0); + std::vector binary; + tools.Assemble("OpName %foo \"foo\"\n%foo = OpTypeVoid", &binary); + + Optimizer opt(SPV_ENV_UNIVERSAL_1_0); + opt.RegisterPass(CreateNullPass()); + auto orig_size = binary.size(); + // Now change the size. Add a word that will be ignored + // by the optimizer. + binary.push_back(42); + EXPECT_THAT(orig_size + 1, Eq(binary.size())); + opt.Run(binary.data(), orig_size, &binary); // This is the key. + // The binary vector should have been rewritten. + EXPECT_THAT(binary.size(), Eq(orig_size)); + + std::string disassembly; + tools.Disassemble(binary.data(), binary.size(), &disassembly); + EXPECT_THAT(disassembly, Eq("OpName %foo \"foo\"\n%foo = OpTypeVoid\n")); +} + +TEST(Optimizer, CanRunTransformingPassWithAliasedVectors) { + SpirvTools tools(SPV_ENV_UNIVERSAL_1_0); + std::vector binary; + tools.Assemble("OpName %foo \"foo\"\n%foo = OpTypeVoid", &binary); + + Optimizer opt(SPV_ENV_UNIVERSAL_1_0); + opt.RegisterPass(CreateStripDebugInfoPass()); + opt.Run(binary.data(), binary.size(), &binary); // This is the key + + std::string disassembly; + tools.Disassemble(binary.data(), binary.size(), &disassembly); + EXPECT_THAT(disassembly, Eq("%void = OpTypeVoid\n")); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/pass_fixture.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/pass_fixture.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/pass_fixture.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/pass_fixture.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,244 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_TEST_OPT_PASS_FIXTURE_H_ +#define LIBSPIRV_TEST_OPT_PASS_FIXTURE_H_ + +#include +#include +#include +#include + +#include + +#ifdef SPIRV_EFFCEE +#include "effcee/effcee.h" +#endif + +#include "opt/build_module.h" +#include "opt/make_unique.h" +#include "opt/pass_manager.h" +#include "opt/passes.h" +#include "spirv-tools/libspirv.hpp" + +namespace spvtools { + +// Template class for testing passes. It contains some handy utility methods for +// running passes and checking results. +// +// To write value-Parameterized tests: +// using ValueParamTest = PassTest<::testing::TestWithParam>; +// To use as normal fixture: +// using FixtureTest = PassTest<::testing::Test>; +template +class PassTest : public TestT { + public: + PassTest() + : consumer_(nullptr), + context_(nullptr), + tools_(SPV_ENV_UNIVERSAL_1_1), + manager_(new opt::PassManager()), + assemble_options_(SpirvTools::kDefaultAssembleOption), + disassemble_options_(SpirvTools::kDefaultDisassembleOption) {} + + // Runs the given |pass| on the binary assembled from the |original|. + // Returns a tuple of the optimized binary and the boolean value returned + // from pass Process() function. + std::tuple, opt::Pass::Status> OptimizeToBinary( + opt::Pass* pass, const std::string& original, bool skip_nop) { + context_ = std::move(BuildModule(SPV_ENV_UNIVERSAL_1_1, consumer_, original, + assemble_options_)); + EXPECT_NE(nullptr, context()) << "Assembling failed for shader:\n" + << original << std::endl; + if (!context()) { + return std::make_tuple(std::vector(), + opt::Pass::Status::Failure); + } + + const auto status = pass->Run(context()); + + std::vector binary; + context()->module()->ToBinary(&binary, skip_nop); + return std::make_tuple(binary, status); + } + + // Runs a single pass of class |PassT| on the binary assembled from the + // |assembly|. Returns a tuple of the optimized binary and the boolean value + // from the pass Process() function. + template + std::tuple, opt::Pass::Status> SinglePassRunToBinary( + const std::string& assembly, bool skip_nop, Args&&... args) { + auto pass = MakeUnique(std::forward(args)...); + pass->SetMessageConsumer(consumer_); + return OptimizeToBinary(pass.get(), assembly, skip_nop); + } + + // Runs a single pass of class |PassT| on the binary assembled from the + // |assembly|, disassembles the optimized binary. Returns a tuple of + // disassembly string and the boolean value from the pass Process() function. + template + std::tuple SinglePassRunAndDisassemble( + const std::string& assembly, bool skip_nop, bool do_validation, + Args&&... args) { + std::vector optimized_bin; + auto status = opt::Pass::Status::SuccessWithoutChange; + std::tie(optimized_bin, status) = SinglePassRunToBinary( + assembly, skip_nop, std::forward(args)...); + if (do_validation) { + spv_target_env target_env = SPV_ENV_UNIVERSAL_1_1; + spv_context spvContext = spvContextCreate(target_env); + spv_diagnostic diagnostic = nullptr; + spv_const_binary_t binary = {optimized_bin.data(), optimized_bin.size()}; + spv_result_t error = spvValidate(spvContext, &binary, &diagnostic); + EXPECT_EQ(error, 0); + if (error != 0) spvDiagnosticPrint(diagnostic); + spvDiagnosticDestroy(diagnostic); + spvContextDestroy(spvContext); + } + std::string optimized_asm; + EXPECT_TRUE( + tools_.Disassemble(optimized_bin, &optimized_asm, disassemble_options_)) + << "Disassembling failed for shader:\n" + << assembly << std::endl; + return std::make_tuple(optimized_asm, status); + } + + // Runs a single pass of class |PassT| on the binary assembled from the + // |original| assembly, and checks whether the optimized binary can be + // disassembled to the |expected| assembly. Optionally will also validate + // the optimized binary. This does *not* involve pass manager. Callers + // are suggested to use SCOPED_TRACE() for better messages. + template + void SinglePassRunAndCheck(const std::string& original, + const std::string& expected, bool skip_nop, + bool do_validation, Args&&... args) { + std::vector optimized_bin; + auto status = opt::Pass::Status::SuccessWithoutChange; + std::tie(optimized_bin, status) = SinglePassRunToBinary( + original, skip_nop, std::forward(args)...); + // Check whether the pass returns the correct modification indication. + EXPECT_NE(opt::Pass::Status::Failure, status); + EXPECT_EQ(original == expected, + status == opt::Pass::Status::SuccessWithoutChange); + if (do_validation) { + spv_target_env target_env = SPV_ENV_UNIVERSAL_1_1; + spv_context spvContext = spvContextCreate(target_env); + spv_diagnostic diagnostic = nullptr; + spv_const_binary_t binary = {optimized_bin.data(), optimized_bin.size()}; + spv_result_t error = spvValidate(spvContext, &binary, &diagnostic); + EXPECT_EQ(error, 0); + if (error != 0) spvDiagnosticPrint(diagnostic); + spvDiagnosticDestroy(diagnostic); + spvContextDestroy(spvContext); + } + std::string optimized_asm; + EXPECT_TRUE( + tools_.Disassemble(optimized_bin, &optimized_asm, disassemble_options_)) + << "Disassembling failed for shader:\n" + << original << std::endl; + EXPECT_EQ(expected, optimized_asm); + } + + // Runs a single pass of class |PassT| on the binary assembled from the + // |original| assembly, and checks whether the optimized binary can be + // disassembled to the |expected| assembly. This does *not* involve pass + // manager. Callers are suggested to use SCOPED_TRACE() for better messages. + template + void SinglePassRunAndCheck(const std::string& original, + const std::string& expected, bool skip_nop, + Args&&... args) { + SinglePassRunAndCheck(original, expected, skip_nop, false, + std::forward(args)...); + } + +#ifdef SPIRV_EFFCEE + // Runs a single pass of class |PassT| on the binary assembled from the + // |original| assembly, then runs an Effcee matcher over the disassembled + // result, using checks parsed from |original|. Always skips OpNop. + // This does *not* involve pass manager. Callers are suggested to use + // SCOPED_TRACE() for better messages. + template + void SinglePassRunAndMatch(const std::string& original, bool do_validation, + Args&&... args) { + const bool skip_nop = true; + auto pass_result = SinglePassRunAndDisassemble( + original, skip_nop, do_validation, std::forward(args)...); + auto disassembly = std::get<0>(pass_result); + auto match_result = effcee::Match(disassembly, original); + EXPECT_EQ(effcee::Result::Status::Ok, match_result.status()) + << match_result.message() << "\nChecking result:\n" + << disassembly; + } +#endif + + // Adds a pass to be run. + template + void AddPass(Args&&... args) { + manager_->AddPass(std::forward(args)...); + } + + // Renews the pass manager, including clearing all previously added passes. + void RenewPassManger() { + manager_.reset(new opt::PassManager()); + manager_->SetMessageConsumer(consumer_); + } + + // Runs the passes added thus far using a pass manager on the binary assembled + // from the |original| assembly, and checks whether the optimized binary can + // be disassembled to the |expected| assembly. Callers are suggested to use + // SCOPED_TRACE() for better messages. + void RunAndCheck(const std::string& original, const std::string& expected) { + assert(manager_->NumPasses()); + + context_ = std::move(BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, original, + assemble_options_)); + ASSERT_NE(nullptr, context()); + + manager_->Run(context()); + + std::vector binary; + context()->module()->ToBinary(&binary, /* skip_nop = */ false); + + std::string optimized; + EXPECT_TRUE(tools_.Disassemble(binary, &optimized, disassemble_options_)); + EXPECT_EQ(expected, optimized); + } + + void SetAssembleOptions(uint32_t assemble_options) { + assemble_options_ = assemble_options; + } + + void SetDisassembleOptions(uint32_t disassemble_options) { + disassemble_options_ = disassemble_options; + } + + MessageConsumer consumer() { return consumer_; } + ir::IRContext* context() { return context_.get(); } + + void SetMessageConsumer(MessageConsumer msg_consumer) { + consumer_ = msg_consumer; + } + + private: + MessageConsumer consumer_; // Message consumer. + std::unique_ptr context_; // IR context + SpirvTools tools_; // An instance for calling SPIRV-Tools functionalities. + std::unique_ptr manager_; // The pass manager. + uint32_t assemble_options_; + uint32_t disassemble_options_; +}; + +} // namespace spvtools + +#endif // LIBSPIRV_TEST_OPT_PASS_FIXTURE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/pass_manager_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/pass_manager_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/pass_manager_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/pass_manager_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,186 @@ +// Copyright (c) 2016 Google 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. + +#include "gmock/gmock.h" + +#include + +#include "module_utils.h" +#include "opt/make_unique.h" +#include "pass_fixture.h" + +namespace { + +using namespace spvtools; +using spvtest::GetIdBound; +using ::testing::Eq; + +// A null pass whose construtors accept arguments +class NullPassWithArgs : public opt::NullPass { + public: + NullPassWithArgs(uint32_t) {} + NullPassWithArgs(std::string) {} + NullPassWithArgs(const std::vector&) {} + NullPassWithArgs(const std::vector&, uint32_t) {} + + const char* name() const override { return "null-with-args"; } +}; + +TEST(PassManager, Interface) { + opt::PassManager manager; + EXPECT_EQ(0u, manager.NumPasses()); + + manager.AddPass(); + EXPECT_EQ(1u, manager.NumPasses()); + EXPECT_STREQ("strip-debug", manager.GetPass(0)->name()); + + manager.AddPass(MakeUnique()); + EXPECT_EQ(2u, manager.NumPasses()); + EXPECT_STREQ("strip-debug", manager.GetPass(0)->name()); + EXPECT_STREQ("null", manager.GetPass(1)->name()); + + manager.AddPass(); + EXPECT_EQ(3u, manager.NumPasses()); + EXPECT_STREQ("strip-debug", manager.GetPass(0)->name()); + EXPECT_STREQ("null", manager.GetPass(1)->name()); + EXPECT_STREQ("strip-debug", manager.GetPass(2)->name()); + + manager.AddPass(1u); + manager.AddPass("null pass args"); + manager.AddPass(std::initializer_list{1, 2}); + manager.AddPass(std::initializer_list{1, 2}, 3); + EXPECT_EQ(7u, manager.NumPasses()); + EXPECT_STREQ("strip-debug", manager.GetPass(0)->name()); + EXPECT_STREQ("null", manager.GetPass(1)->name()); + EXPECT_STREQ("strip-debug", manager.GetPass(2)->name()); + EXPECT_STREQ("null-with-args", manager.GetPass(3)->name()); + EXPECT_STREQ("null-with-args", manager.GetPass(4)->name()); + EXPECT_STREQ("null-with-args", manager.GetPass(5)->name()); + EXPECT_STREQ("null-with-args", manager.GetPass(6)->name()); +} + +// A pass that appends an OpNop instruction to the debug1 section. +class AppendOpNopPass : public opt::Pass { + public: + const char* name() const override { return "AppendOpNop"; } + Status Process(ir::IRContext* irContext) override { + irContext->AddDebug1Inst(MakeUnique(irContext)); + return Status::SuccessWithChange; + } +}; + +// A pass that appends specified number of OpNop instructions to the debug1 +// section. +class AppendMultipleOpNopPass : public opt::Pass { + public: + explicit AppendMultipleOpNopPass(uint32_t num_nop) : num_nop_(num_nop) {} + + const char* name() const override { return "AppendOpNop"; } + Status Process(ir::IRContext* irContext) override { + for (uint32_t i = 0; i < num_nop_; i++) { + irContext->AddDebug1Inst(MakeUnique(irContext)); + } + return Status::SuccessWithChange; + } + + private: + uint32_t num_nop_; +}; + +// A pass that duplicates the last instruction in the debug1 section. +class DuplicateInstPass : public opt::Pass { + public: + const char* name() const override { return "DuplicateInst"; } + Status Process(ir::IRContext* irContext) override { + auto inst = MakeUnique( + *(--irContext->debug1_end())->Clone(irContext)); + irContext->AddDebug1Inst(std::move(inst)); + return Status::SuccessWithChange; + } +}; + +using PassManagerTest = PassTest<::testing::Test>; + +TEST_F(PassManagerTest, Run) { + const std::string text = "OpMemoryModel Logical GLSL450\nOpSource ESSL 310\n"; + + AddPass(); + AddPass(); + RunAndCheck(text.c_str(), (text + "OpNop\nOpNop\n").c_str()); + + RenewPassManger(); + AddPass(); + AddPass(); + RunAndCheck(text.c_str(), (text + "OpNop\nOpNop\n").c_str()); + + RenewPassManger(); + AddPass(); + AddPass(); + RunAndCheck(text.c_str(), (text + "OpSource ESSL 310\nOpNop\n").c_str()); + + RenewPassManger(); + AddPass(3); + RunAndCheck(text.c_str(), (text + "OpNop\nOpNop\nOpNop\n").c_str()); +} + +// A pass that appends an OpTypeVoid instruction that uses a given id. +class AppendTypeVoidInstPass : public opt::Pass { + public: + explicit AppendTypeVoidInstPass(uint32_t result_id) : result_id_(result_id) {} + + const char* name() const override { return "AppendTypeVoidInstPass"; } + Status Process(ir::IRContext* irContext) override { + auto inst = MakeUnique( + irContext, SpvOpTypeVoid, 0, result_id_, std::vector{}); + irContext->AddType(std::move(inst)); + return Status::SuccessWithChange; + } + + private: + uint32_t result_id_; +}; + +TEST(PassManager, RecomputeIdBoundAutomatically) { + opt::PassManager manager; + std::unique_ptr module(new ir::Module()); + ir::IRContext context(SPV_ENV_UNIVERSAL_1_2, std::move(module), + manager.consumer()); + EXPECT_THAT(GetIdBound(*context.module()), Eq(0u)); + + manager.Run(&context); + manager.AddPass(); + // With no ID changes, the ID bound does not change. + EXPECT_THAT(GetIdBound(*context.module()), Eq(0u)); + + // Now we force an Id of 100 to be used. + manager.AddPass(MakeUnique(100)); + EXPECT_THAT(GetIdBound(*context.module()), Eq(0u)); + manager.Run(&context); + // The Id has been updated automatically, even though the pass + // did not update it. + EXPECT_THAT(GetIdBound(*context.module()), Eq(101u)); + + // Try one more time! + manager.AddPass(MakeUnique(200)); + manager.Run(&context); + EXPECT_THAT(GetIdBound(*context.module()), Eq(201u)); + + // Add another pass, but which uses a lower Id. + manager.AddPass(MakeUnique(10)); + manager.Run(&context); + // The Id stays high. + EXPECT_THAT(GetIdBound(*context.module()), Eq(201u)); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/pass_merge_return_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/pass_merge_return_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/pass_merge_return_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/pass_merge_return_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,706 @@ +// Copyright (c) 2017 Google 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. + +#include + +#include "spirv-tools/libspirv.hpp" +#include "spirv-tools/optimizer.hpp" + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using MergeReturnPassTest = PassTest<::testing::Test>; + +TEST_F(MergeReturnPassTest, OneReturn) { + const std::string before = + R"(OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +OpEntryPoint Kernel %1 "simple_kernel" +%2 = OpTypeVoid +%3 = OpTypeFunction %2 +%1 = OpFunction %2 None %3 +%4 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after = before; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(before, after, false, true); +} + +TEST_F(MergeReturnPassTest, TwoReturnsNoValue) { + const std::string before = + R"(OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +OpEntryPoint Kernel %6 "simple_kernel" +%2 = OpTypeVoid +%3 = OpTypeBool +%4 = OpConstantFalse %3 +%1 = OpTypeFunction %2 +%6 = OpFunction %2 None %1 +%7 = OpLabel +OpBranchConditional %4 %8 %9 +%8 = OpLabel +OpReturn +%9 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +OpEntryPoint Kernel %6 "simple_kernel" +%2 = OpTypeVoid +%3 = OpTypeBool +%4 = OpConstantFalse %3 +%1 = OpTypeFunction %2 +%6 = OpFunction %2 None %1 +%7 = OpLabel +OpBranchConditional %4 %8 %9 +%8 = OpLabel +OpBranch %10 +%9 = OpLabel +OpBranch %10 +%10 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(before, after, false, true); +} + +TEST_F(MergeReturnPassTest, TwoReturnsWithValues) { + const std::string before = + R"(OpCapability Linkage +OpCapability Kernel +OpMemoryModel Logical OpenCL +%1 = OpTypeInt 32 0 +%2 = OpTypeBool +%3 = OpConstantFalse %2 +%4 = OpConstant %1 0 +%5 = OpConstant %1 1 +%6 = OpTypeFunction %1 +%7 = OpFunction %1 None %6 +%8 = OpLabel +OpBranchConditional %3 %9 %10 +%9 = OpLabel +OpReturnValue %4 +%10 = OpLabel +OpReturnValue %5 +OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Linkage +OpCapability Kernel +OpMemoryModel Logical OpenCL +%1 = OpTypeInt 32 0 +%2 = OpTypeBool +%3 = OpConstantFalse %2 +%4 = OpConstant %1 0 +%5 = OpConstant %1 1 +%6 = OpTypeFunction %1 +%7 = OpFunction %1 None %6 +%8 = OpLabel +OpBranchConditional %3 %9 %10 +%9 = OpLabel +OpBranch %11 +%10 = OpLabel +OpBranch %11 +%11 = OpLabel +%12 = OpPhi %1 %4 %9 %5 %10 +OpReturnValue %12 +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(before, after, false, true); +} + +TEST_F(MergeReturnPassTest, UnreachableReturnsNoValue) { + const std::string before = + R"(OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +OpEntryPoint Kernel %6 "simple_kernel" +%2 = OpTypeVoid +%3 = OpTypeBool +%4 = OpConstantFalse %3 +%1 = OpTypeFunction %2 +%6 = OpFunction %2 None %1 +%7 = OpLabel +OpReturn +%8 = OpLabel +OpBranchConditional %4 %9 %10 +%9 = OpLabel +OpReturn +%10 = OpLabel +OpReturn +OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +OpEntryPoint Kernel %6 "simple_kernel" +%2 = OpTypeVoid +%3 = OpTypeBool +%4 = OpConstantFalse %3 +%1 = OpTypeFunction %2 +%6 = OpFunction %2 None %1 +%7 = OpLabel +OpBranch %11 +%8 = OpLabel +OpBranchConditional %4 %9 %10 +%9 = OpLabel +OpBranch %11 +%10 = OpLabel +OpBranch %11 +%11 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(before, after, false, true); +} + +TEST_F(MergeReturnPassTest, UnreachableReturnsWithValues) { + const std::string before = + R"(OpCapability Linkage +OpCapability Kernel +OpMemoryModel Logical OpenCL +%1 = OpTypeInt 32 0 +%2 = OpTypeBool +%3 = OpConstantFalse %2 +%4 = OpConstant %1 0 +%5 = OpConstant %1 1 +%6 = OpTypeFunction %1 +%7 = OpFunction %1 None %6 +%8 = OpLabel +%9 = OpIAdd %1 %4 %5 +OpReturnValue %9 +%10 = OpLabel +OpBranchConditional %3 %11 %12 +%11 = OpLabel +OpReturnValue %4 +%12 = OpLabel +OpReturnValue %5 +OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Linkage +OpCapability Kernel +OpMemoryModel Logical OpenCL +%1 = OpTypeInt 32 0 +%2 = OpTypeBool +%3 = OpConstantFalse %2 +%4 = OpConstant %1 0 +%5 = OpConstant %1 1 +%6 = OpTypeFunction %1 +%7 = OpFunction %1 None %6 +%8 = OpLabel +%9 = OpIAdd %1 %4 %5 +OpBranch %13 +%10 = OpLabel +OpBranchConditional %3 %11 %12 +%11 = OpLabel +OpBranch %13 +%12 = OpLabel +OpBranch %13 +%13 = OpLabel +%14 = OpPhi %1 %9 %8 %4 %11 %5 %12 +OpReturnValue %14 +OpFunctionEnd +)"; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); + SinglePassRunAndCheck(before, after, false, true); +} + +#ifdef SPIRV_EFFCEE +TEST_F(MergeReturnPassTest, StructuredControlFlowWithUnreachableMerge) { + const std::string before = + R"( +; CHECK: [[false:%\w+]] = OpConstantFalse +; CHECK: [[true:%\w+]] = OpConstantTrue +; CHECK: OpFunction +; CHECK: [[var:%\w+]] = OpVariable [[:%\w+]] Function [[false]] +; CHECK: OpSelectionMerge [[merge_lab:%\w+]] +; CHECK: OpBranchConditional [[cond:%\w+]] [[if_lab:%\w+]] [[then_lab:%\w+]] +; CHECK: [[if_lab]] = OpLabel +; CHECK-Next: OpStore [[var]] [[true]] +; CHECK-Next: OpBranch +; CHECK: [[then_lab]] = OpLabel +; CHECK-Next: OpStore [[var]] [[true]] +; CHECK-Next: OpBranch [[merge_lab]] +; CHECK: OpReturn +OpCapability Addresses +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %6 "simple_shader" +%2 = OpTypeVoid +%3 = OpTypeBool +%4 = OpConstantFalse %3 +%1 = OpTypeFunction %2 +%6 = OpFunction %2 None %1 +%7 = OpLabel +OpSelectionMerge %10 None +OpBranchConditional %4 %8 %9 +%8 = OpLabel +OpReturn +%9 = OpLabel +OpReturn +%10 = OpLabel +OpUnreachable +OpFunctionEnd +)"; + + SinglePassRunAndMatch(before, false); +} + +TEST_F(MergeReturnPassTest, StructuredControlFlowAddPhi) { + const std::string before = + R"( +; CHECK: [[false:%\w+]] = OpConstantFalse +; CHECK: [[true:%\w+]] = OpConstantTrue +; CHECK: OpFunction +; CHECK: [[var:%\w+]] = OpVariable [[:%\w+]] Function [[false]] +; CHECK: OpSelectionMerge [[merge_lab:%\w+]] +; CHECK: OpBranchConditional [[cond:%\w+]] [[if_lab:%\w+]] [[then_lab:%\w+]] +; CHECK: [[if_lab]] = OpLabel +; CHECK-NEXT: [[add:%\w+]] = OpIAdd [[type:%\w+]] +; CHECK-Next: OpStore [[var]] [[true]] +; CHECK-Next: OpBranch +; CHECK: [[then_lab]] = OpLabel +; CHECK-Next: OpStore [[var]] [[true]] +; CHECK-Next: OpBranch [[merge_lab]] +; CHECK: [[merge_lab]] = OpLabel +; CHECK-NEXT: [[phi:%\w+]] = OpPhi [[type]] [[add]] [[if_lab]] [[undef:%\w+]] [[then_lab]] +; CHECK: OpIAdd [[type]] [[phi]] [[phi]] +; CHECK: OpReturn +OpCapability Addresses +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %6 "simple_shader" +%2 = OpTypeVoid +%3 = OpTypeBool +%int = OpTypeInt 32 0 +%int_0 = OpConstant %int 0 +%4 = OpConstantFalse %3 +%1 = OpTypeFunction %2 +%6 = OpFunction %2 None %1 +%7 = OpLabel +OpSelectionMerge %10 None +OpBranchConditional %4 %8 %9 +%8 = OpLabel +%11 = OpIAdd %int %int_0 %int_0 +OpBranch %10 +%9 = OpLabel +OpReturn +%10 = OpLabel +%12 = OpIAdd %int %11 %11 +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndMatch(before, false); +} +#endif + +TEST_F(MergeReturnPassTest, StructuredControlFlowBothMergeAndHeader) { + const std::string before = + R"(OpCapability Addresses + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %1 "simple_shader" + %2 = OpTypeVoid + %3 = OpTypeBool + %4 = OpTypeInt 32 0 + %5 = OpConstant %4 0 + %6 = OpConstantFalse %3 + %7 = OpTypeFunction %2 + %1 = OpFunction %2 None %7 + %8 = OpLabel + OpSelectionMerge %9 None + OpBranchConditional %6 %10 %11 + %10 = OpLabel + OpReturn + %11 = OpLabel + OpBranch %9 + %9 = OpLabel + OpLoopMerge %12 %13 None + OpBranch %13 + %13 = OpLabel + %14 = OpIAdd %4 %5 %5 + OpBranchConditional %6 %9 %12 + %12 = OpLabel + %15 = OpIAdd %4 %14 %14 + OpReturn + OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Addresses +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %1 "simple_shader" +%void = OpTypeVoid +%bool = OpTypeBool +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%false = OpConstantFalse %bool +%7 = OpTypeFunction %void +%_ptr_Function_bool = OpTypePointer Function %bool +%true = OpConstantTrue %bool +%1 = OpFunction %void None %7 +%8 = OpLabel +%18 = OpVariable %_ptr_Function_bool Function %false +OpSelectionMerge %9 None +OpBranchConditional %false %10 %11 +%10 = OpLabel +OpStore %18 %true +OpBranch %9 +%11 = OpLabel +OpBranch %9 +%9 = OpLabel +%23 = OpLoad %bool %18 +OpSelectionMerge %22 None +OpBranchConditional %23 %22 %21 +%21 = OpLabel +OpBranch %20 +%20 = OpLabel +OpLoopMerge %12 %13 None +OpBranch %13 +%13 = OpLabel +%14 = OpIAdd %uint %uint_0 %uint_0 +OpBranchConditional %false %20 %12 +%12 = OpLabel +%15 = OpIAdd %uint %14 %14 +OpStore %18 %true +OpBranch %22 +%22 = OpLabel +OpBranch %16 +%16 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(before, after, false, true); +} + +TEST_F(MergeReturnPassTest, NestedSelectionMerge) { + const std::string before = + R"( + OpCapability Addresses + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %1 "simple_shader" + %void = OpTypeVoid + %bool = OpTypeBool + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 + %false = OpConstantFalse %bool + %7 = OpTypeFunction %void + %1 = OpFunction %void None %7 + %8 = OpLabel + OpSelectionMerge %9 None + OpBranchConditional %false %10 %11 + %10 = OpLabel + OpReturn + %11 = OpLabel + OpSelectionMerge %12 None + OpBranchConditional %false %14 %15 + %14 = OpLabel + %16 = OpIAdd %uint %uint_0 %uint_0 + OpBranch %12 + %15 = OpLabel + OpReturn + %12 = OpLabel + OpBranch %9 + %9 = OpLabel + %17 = OpIAdd %uint %16 %16 + OpReturn + OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Addresses +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %1 "simple_shader" +%void = OpTypeVoid +%bool = OpTypeBool +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%false = OpConstantFalse %bool +%7 = OpTypeFunction %void +%_ptr_Function_bool = OpTypePointer Function %bool +%true = OpConstantTrue %bool +%24 = OpUndef %uint +%1 = OpFunction %void None %7 +%8 = OpLabel +%19 = OpVariable %_ptr_Function_bool Function %false +OpSelectionMerge %9 None +OpBranchConditional %false %10 %11 +%10 = OpLabel +OpStore %19 %true +OpBranch %9 +%11 = OpLabel +OpSelectionMerge %12 None +OpBranchConditional %false %13 %14 +%13 = OpLabel +%15 = OpIAdd %uint %uint_0 %uint_0 +OpBranch %12 +%14 = OpLabel +OpStore %19 %true +OpBranch %12 +%12 = OpLabel +%25 = OpPhi %uint %15 %13 %24 %14 +OpBranch %9 +%9 = OpLabel +%26 = OpPhi %uint %25 %12 %24 %10 +%23 = OpLoad %bool %19 +OpSelectionMerge %22 None +OpBranchConditional %23 %22 %21 +%21 = OpLabel +%16 = OpIAdd %uint %26 %26 +OpStore %19 %true +OpBranch %22 +%22 = OpLabel +OpBranch %17 +%17 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(before, after, false, true); +} + +// This is essentially the same as NestedSelectionMerge, except +// the order of the first branch is changed. This is to make sure things +// work even if the order of the traversals change. +TEST_F(MergeReturnPassTest, NestedSelectionMerge2) { + const std::string before = + R"( + OpCapability Addresses + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %1 "simple_shader" + %void = OpTypeVoid + %bool = OpTypeBool + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 + %false = OpConstantFalse %bool + %7 = OpTypeFunction %void + %1 = OpFunction %void None %7 + %8 = OpLabel + OpSelectionMerge %9 None + OpBranchConditional %false %10 %11 + %11 = OpLabel + OpReturn + %10 = OpLabel + OpSelectionMerge %12 None + OpBranchConditional %false %14 %15 + %14 = OpLabel + %16 = OpIAdd %uint %uint_0 %uint_0 + OpBranch %12 + %15 = OpLabel + OpReturn + %12 = OpLabel + OpBranch %9 + %9 = OpLabel + %17 = OpIAdd %uint %16 %16 + OpReturn + OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Addresses +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %1 "simple_shader" +%void = OpTypeVoid +%bool = OpTypeBool +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%false = OpConstantFalse %bool +%7 = OpTypeFunction %void +%_ptr_Function_bool = OpTypePointer Function %bool +%true = OpConstantTrue %bool +%24 = OpUndef %uint +%1 = OpFunction %void None %7 +%8 = OpLabel +%19 = OpVariable %_ptr_Function_bool Function %false +OpSelectionMerge %9 None +OpBranchConditional %false %10 %11 +%11 = OpLabel +OpStore %19 %true +OpBranch %9 +%10 = OpLabel +OpSelectionMerge %12 None +OpBranchConditional %false %13 %14 +%13 = OpLabel +%15 = OpIAdd %uint %uint_0 %uint_0 +OpBranch %12 +%14 = OpLabel +OpStore %19 %true +OpBranch %12 +%12 = OpLabel +%25 = OpPhi %uint %15 %13 %24 %14 +OpBranch %9 +%9 = OpLabel +%26 = OpPhi %uint %25 %12 %24 %11 +%23 = OpLoad %bool %19 +OpSelectionMerge %22 None +OpBranchConditional %23 %22 %21 +%21 = OpLabel +%16 = OpIAdd %uint %26 %26 +OpStore %19 %true +OpBranch %22 +%22 = OpLabel +OpBranch %17 +%17 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(before, after, false, true); +} + +TEST_F(MergeReturnPassTest, NestedSelectionMerge3) { + const std::string before = + R"( + OpCapability Addresses + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %1 "simple_shader" + %void = OpTypeVoid + %bool = OpTypeBool + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 + %false = OpConstantFalse %bool + %7 = OpTypeFunction %void + %1 = OpFunction %void None %7 + %8 = OpLabel + OpSelectionMerge %9 None + OpBranchConditional %false %10 %11 + %11 = OpLabel + OpReturn + %10 = OpLabel + %16 = OpIAdd %uint %uint_0 %uint_0 + OpSelectionMerge %12 None + OpBranchConditional %false %14 %15 + %14 = OpLabel + OpBranch %12 + %15 = OpLabel + OpReturn + %12 = OpLabel + OpBranch %9 + %9 = OpLabel + %17 = OpIAdd %uint %16 %16 + OpReturn + OpFunctionEnd +)"; + + const std::string after = + R"(OpCapability Addresses +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %1 "simple_shader" +%void = OpTypeVoid +%bool = OpTypeBool +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%false = OpConstantFalse %bool +%7 = OpTypeFunction %void +%_ptr_Function_bool = OpTypePointer Function %bool +%true = OpConstantTrue %bool +%24 = OpUndef %uint +%1 = OpFunction %void None %7 +%8 = OpLabel +%19 = OpVariable %_ptr_Function_bool Function %false +OpSelectionMerge %9 None +OpBranchConditional %false %10 %11 +%11 = OpLabel +OpStore %19 %true +OpBranch %9 +%10 = OpLabel +%12 = OpIAdd %uint %uint_0 %uint_0 +OpSelectionMerge %13 None +OpBranchConditional %false %14 %15 +%14 = OpLabel +OpBranch %13 +%15 = OpLabel +OpStore %19 %true +OpBranch %13 +%13 = OpLabel +OpBranch %9 +%9 = OpLabel +%25 = OpPhi %uint %12 %13 %24 %11 +%23 = OpLoad %bool %19 +OpSelectionMerge %22 None +OpBranchConditional %23 %22 %21 +%21 = OpLabel +%16 = OpIAdd %uint %25 %25 +OpStore %19 %true +OpBranch %22 +%22 = OpLabel +OpBranch %17 +%17 = OpLabel +OpReturn +OpFunctionEnd +)"; + + SinglePassRunAndCheck(before, after, false, true); +} +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/pass_remove_duplicates_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/pass_remove_duplicates_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/pass_remove_duplicates_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/pass_remove_duplicates_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,310 @@ +// Copyright (c) 2017 Pierre Moreau +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include + +#include "source/opt/build_module.h" +#include "source/opt/ir_context.h" +#include "source/opt/pass_manager.h" +#include "source/opt/remove_duplicates_pass.h" +#include "source/spirv_constant.h" +#include "unit_spirv.h" + +namespace { + +using spvtools::ir::IRContext; +using spvtools::ir::Instruction; +using spvtools::opt::PassManager; +using spvtools::opt::RemoveDuplicatesPass; + +class RemoveDuplicatesTest : public ::testing::Test { + public: + RemoveDuplicatesTest() + : tools_(SPV_ENV_UNIVERSAL_1_2), + context_(), + consumer_([this](spv_message_level_t level, const char*, + const spv_position_t& position, const char* message) { + if (!error_message_.empty()) error_message_ += "\n"; + switch (level) { + case SPV_MSG_FATAL: + case SPV_MSG_INTERNAL_ERROR: + case SPV_MSG_ERROR: + error_message_ += "ERROR"; + break; + case SPV_MSG_WARNING: + error_message_ += "WARNING"; + break; + case SPV_MSG_INFO: + error_message_ += "INFO"; + break; + case SPV_MSG_DEBUG: + error_message_ += "DEBUG"; + break; + } + error_message_ += + ": " + std::to_string(position.index) + ": " + message; + }), + disassemble_options_(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER), + error_message_() { + tools_.SetMessageConsumer(consumer_); + } + + virtual void TearDown() override { error_message_.clear(); } + + std::string RunPass(const std::string& text) { + context_ = spvtools::BuildModule(SPV_ENV_UNIVERSAL_1_2, consumer_, text); + if (!context_.get()) return std::string(); + + PassManager manager; + manager.SetMessageConsumer(consumer_); + manager.AddPass(); + + spvtools::opt::Pass::Status pass_res = manager.Run(context_.get()); + if (pass_res == spvtools::opt::Pass::Status::Failure) return std::string(); + + return ModuleToText(); + } + + // Disassembles |binary| and outputs the result in |text|. If |text| is a + // null pointer, SPV_ERROR_INVALID_POINTER is returned. + spv_result_t Disassemble(const std::vector& binary, + std::string* text) { + if (!text) return SPV_ERROR_INVALID_POINTER; + return tools_.Disassemble(binary, text, disassemble_options_) + ? SPV_SUCCESS + : SPV_ERROR_INVALID_BINARY; + } + + // Returns the accumulated error messages for the test. + std::string GetErrorMessage() const { return error_message_; } + + std::string ToText(const std::vector& inst) { + std::vector binary = {SpvMagicNumber, 0x10200, 0u, 2u, 0u}; + for (const Instruction* i : inst) + i->ToBinaryWithoutAttachedDebugInsts(&binary); + std::string text; + Disassemble(binary, &text); + return text; + } + + std::string ModuleToText() { + std::vector binary; + context_->module()->ToBinary(&binary, false); + std::string text; + Disassemble(binary, &text); + return text; + } + + private: + spvtools::SpirvTools + tools_; // An instance for calling SPIRV-Tools functionalities. + std::unique_ptr context_; + spvtools::MessageConsumer consumer_; + uint32_t disassemble_options_; + std::string error_message_; +}; + +TEST_F(RemoveDuplicatesTest, DuplicateCapabilities) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpCapability Shader +OpMemoryModel Logical GLSL450 +)"; + const std::string after = R"(OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +)"; + + EXPECT_THAT(RunPass(spirv), after); + EXPECT_THAT(GetErrorMessage(), ""); +} + +TEST_F(RemoveDuplicatesTest, DuplicateExtInstImports) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +%1 = OpExtInstImport "OpenCL.std" +%2 = OpExtInstImport "OpenCL.std" +%3 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +)"; + const std::string after = R"(OpCapability Shader +OpCapability Linkage +%1 = OpExtInstImport "OpenCL.std" +%3 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +)"; + + EXPECT_THAT(RunPass(spirv), after); + EXPECT_THAT(GetErrorMessage(), ""); +} + +TEST_F(RemoveDuplicatesTest, DuplicateTypes) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%1 = OpTypeInt 32 0 +%2 = OpTypeInt 32 0 +%3 = OpTypeStruct %1 %2 +)"; + const std::string after = R"(OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%1 = OpTypeInt 32 0 +%3 = OpTypeStruct %1 %1 +)"; + + EXPECT_THAT(RunPass(spirv), after); + EXPECT_THAT(GetErrorMessage(), ""); +} + +TEST_F(RemoveDuplicatesTest, SameTypeDifferentMemberDecoration) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 GLSLPacked +%2 = OpTypeInt 32 0 +%1 = OpTypeStruct %2 %2 +%3 = OpTypeStruct %2 %2 +)"; + const std::string after = R"(OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 GLSLPacked +%2 = OpTypeInt 32 0 +%1 = OpTypeStruct %2 %2 +%3 = OpTypeStruct %2 %2 +)"; + + EXPECT_THAT(RunPass(spirv), after); + EXPECT_THAT(GetErrorMessage(), ""); +} + +TEST_F(RemoveDuplicatesTest, SameTypeAndMemberDecoration) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 GLSLPacked +OpDecorate %2 GLSLPacked +%3 = OpTypeInt 32 0 +%1 = OpTypeStruct %3 %3 +%2 = OpTypeStruct %3 %3 +)"; + const std::string after = R"(OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 GLSLPacked +%3 = OpTypeInt 32 0 +%1 = OpTypeStruct %3 %3 +)"; + + EXPECT_THAT(RunPass(spirv), after); + EXPECT_THAT(GetErrorMessage(), ""); +} + +TEST_F(RemoveDuplicatesTest, SameTypeAndDifferentName) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %1 "Type1" +OpName %2 "Type2" +%3 = OpTypeInt 32 0 +%1 = OpTypeStruct %3 %3 +%2 = OpTypeStruct %3 %3 +)"; + const std::string after = R"(OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %1 "Type1" +%3 = OpTypeInt 32 0 +%1 = OpTypeStruct %3 %3 +)"; + + EXPECT_THAT(RunPass(spirv), after); + EXPECT_THAT(GetErrorMessage(), ""); +} + +// Check that #1033 has been fixed. +TEST_F(RemoveDuplicatesTest, DoNotRemoveDifferentOpDecorationGroup) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Constant +%1 = OpDecorationGroup +OpDecorate %2 Restrict +%2 = OpDecorationGroup +OpGroupDecorate %3 %1 %2 +%4 = OpTypeInt 32 0 +%3 = OpVariable %4 Uniform +)"; + const std::string after = R"(OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Constant +%1 = OpDecorationGroup +OpDecorate %2 Restrict +%2 = OpDecorationGroup +OpGroupDecorate %3 %1 %2 +%4 = OpTypeInt 32 0 +%3 = OpVariable %4 Uniform +)"; + + EXPECT_THAT(RunPass(spirv), after); + EXPECT_THAT(GetErrorMessage(), ""); +} + +TEST_F(RemoveDuplicatesTest, DifferentDecorationGroup) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Constant +OpDecorate %1 Restrict +%1 = OpDecorationGroup +OpDecorate %2 Constant +%2 = OpDecorationGroup +OpGroupDecorate %1 %3 +OpGroupDecorate %2 %4 +%5 = OpTypeInt 32 0 +%3 = OpVariable %5 Uniform +%4 = OpVariable %5 Uniform +)"; + const std::string after = R"(OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpDecorate %1 Constant +OpDecorate %1 Restrict +%1 = OpDecorationGroup +OpDecorate %2 Constant +%2 = OpDecorationGroup +OpGroupDecorate %1 %3 +OpGroupDecorate %2 %4 +%5 = OpTypeInt 32 0 +%3 = OpVariable %5 Uniform +%4 = OpVariable %5 Uniform +)"; + + EXPECT_THAT(RunPass(spirv), after); + EXPECT_THAT(GetErrorMessage(), ""); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/pass_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/pass_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/pass_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/pass_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,244 @@ +// Copyright (c) 2017 Google 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. + +#include +#include + +#include + +#include "assembly_builder.h" +#include "opt/pass.h" +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { +using namespace spvtools; +class DummyPass : public opt::Pass { + public: + const char* name() const override { return "dummy-pass"; } + Status Process(ir::IRContext* irContext) override { + return irContext ? Status::SuccessWithoutChange : Status::Failure; + } +}; +} // namespace + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using PassClassTest = PassTest<::testing::Test>; + +TEST_F(PassClassTest, BasicVisitFromEntryPoint) { + // Make sure we visit the entry point, and the function it calls. + // Do not visit Dead or Exported. + const std::string text = R"( + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %10 "main" + OpName %10 "main" + OpName %Dead "Dead" + OpName %11 "Constant" + OpName %ExportedFunc "ExportedFunc" + OpDecorate %ExportedFunc LinkageAttributes "ExportedFunc" Export + %void = OpTypeVoid + %6 = OpTypeFunction %void + %10 = OpFunction %void None %6 + %14 = OpLabel + %15 = OpFunctionCall %void %11 + %16 = OpFunctionCall %void %11 + OpReturn + OpFunctionEnd + %11 = OpFunction %void None %6 + %18 = OpLabel + OpReturn + OpFunctionEnd + %Dead = OpFunction %void None %6 + %19 = OpLabel + OpReturn + OpFunctionEnd +%ExportedFunc = OpFunction %void None %7 + %20 = OpLabel + %21 = OpFunctionCall %void %11 + OpReturn + OpFunctionEnd +)"; + // clang-format on + + std::unique_ptr localContext = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(nullptr, localContext) << "Assembling failed for shader:\n" + << text << std::endl; + DummyPass testPass; + std::vector processed; + opt::Pass::ProcessFunction mark_visited = [&processed](ir::Function* fp) { + processed.push_back(fp->result_id()); + return false; + }; + testPass.ProcessEntryPointCallTree(mark_visited, localContext->module()); + EXPECT_THAT(processed, UnorderedElementsAre(10, 11)); +} + +TEST_F(PassClassTest, BasicVisitReachable) { + // Make sure we visit the entry point, exported function, and the function + // they call. Do not visit Dead. + const std::string text = R"( + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %10 "main" + OpName %10 "main" + OpName %Dead "Dead" + OpName %11 "Constant" + OpName %12 "ExportedFunc" + OpName %13 "Constant2" + OpDecorate %12 LinkageAttributes "ExportedFunc" Export + %void = OpTypeVoid + %6 = OpTypeFunction %void + %10 = OpFunction %void None %6 + %14 = OpLabel + %15 = OpFunctionCall %void %11 + %16 = OpFunctionCall %void %11 + OpReturn + OpFunctionEnd + %11 = OpFunction %void None %6 + %18 = OpLabel + OpReturn + OpFunctionEnd + %Dead = OpFunction %void None %6 + %19 = OpLabel + OpReturn + OpFunctionEnd + %12 = OpFunction %void None %9 + %20 = OpLabel + %21 = OpFunctionCall %void %13 + OpReturn + OpFunctionEnd + %13 = OpFunction %void None %6 + %22 = OpLabel + OpReturn + OpFunctionEnd +)"; + // clang-format on + + std::unique_ptr localContext = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(nullptr, localContext) << "Assembling failed for shader:\n" + << text << std::endl; + + DummyPass testPass; + std::vector processed; + opt::Pass::ProcessFunction mark_visited = [&processed](ir::Function* fp) { + processed.push_back(fp->result_id()); + return false; + }; + testPass.ProcessReachableCallTree(mark_visited, localContext.get()); + EXPECT_THAT(processed, UnorderedElementsAre(10, 11, 12, 13)); +} + +TEST_F(PassClassTest, BasicVisitOnlyOnce) { + // Make sure we visit %11 only once, even if it is called from two different + // functions. + const std::string text = R"( + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %10 "main" %gl_FragColor + OpName %10 "main" + OpName %Dead "Dead" + OpName %11 "Constant" + OpName %12 "ExportedFunc" + OpDecorate %12 LinkageAttributes "ExportedFunc" Export + %void = OpTypeVoid + %6 = OpTypeFunction %void + %10 = OpFunction %void None %6 + %14 = OpLabel + %15 = OpFunctionCall %void %11 + %16 = OpFunctionCall %void %12 + OpReturn + OpFunctionEnd + %11 = OpFunction %void None %6 + %18 = OpLabel + %19 = OpFunctionCall %void %12 + OpReturn + OpFunctionEnd + %Dead = OpFunction %void None %6 + %20 = OpLabel + OpReturn + OpFunctionEnd + %12 = OpFunction %void None %9 + %21 = OpLabel + OpReturn + OpFunctionEnd +)"; + // clang-format on + + std::unique_ptr localContext = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(nullptr, localContext) << "Assembling failed for shader:\n" + << text << std::endl; + + DummyPass testPass; + std::vector processed; + opt::Pass::ProcessFunction mark_visited = [&processed](ir::Function* fp) { + processed.push_back(fp->result_id()); + return false; + }; + testPass.ProcessReachableCallTree(mark_visited, localContext.get()); + EXPECT_THAT(processed, UnorderedElementsAre(10, 11, 12)); +} + +TEST_F(PassClassTest, BasicDontVisitExportedVariable) { + // Make sure we only visit functions and not exported variables. + const std::string text = R"( + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %10 "main" %gl_FragColor + OpExecutionMode %10 OriginUpperLeft + OpSource GLSL 150 + OpName %10 "main" + OpName %Dead "Dead" + OpName %11 "Constant" + OpName %12 "export_var" + OpDecorate %12 LinkageAttributes "export_var" Export + %void = OpTypeVoid + %6 = OpTypeFunction %void + %float = OpTypeFloat 32 + %float_1 = OpConstant %float 1 + %12 = OpVariable %float Output + %10 = OpFunction %void None %6 + %14 = OpLabel + OpStore %12 %float_1 + OpReturn + OpFunctionEnd +)"; + // clang-format on + + std::unique_ptr localContext = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(nullptr, localContext) << "Assembling failed for shader:\n" + << text << std::endl; + + DummyPass testPass; + std::vector processed; + opt::Pass::ProcessFunction mark_visited = [&processed](ir::Function* fp) { + processed.push_back(fp->result_id()); + return false; + }; + testPass.ProcessReachableCallTree(mark_visited, localContext.get()); + EXPECT_THAT(processed, UnorderedElementsAre(10)); +} +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/pass_utils.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/pass_utils.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/pass_utils.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/pass_utils.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,81 @@ +// Copyright (c) 2016 Google 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. + +#include "pass_utils.h" + +#include +#include + +namespace { + +// Well, this is another place requiring the knowledge of the grammar and can be +// stale when SPIR-V is updated. It would be nice to automatically generate +// this, but the cost is just too high. + +const char* kDebugOpcodes[] = { + // clang-format off + "OpSourceContinued", "OpSource", "OpSourceExtension", + "OpName", "OpMemberName", "OpString", + "OpLine", "OpNoLine", "OpModuleProcessed" + // clang-format on +}; + +} // anonymous namespace + +namespace spvtools { + +bool FindAndReplace(std::string* process_str, const std::string find_str, + const std::string replace_str) { + if (process_str->empty() || find_str.empty()) { + return false; + } + bool replaced = false; + // Note this algorithm has quadratic time complexity. It is OK for test cases + // with short strings, but might not fit in other contexts. + for (size_t pos = process_str->find(find_str, 0); pos != std::string::npos; + pos = process_str->find(find_str, pos)) { + process_str->replace(pos, find_str.length(), replace_str); + pos += replace_str.length(); + replaced = true; + } + return replaced; +} + +bool ContainsDebugOpcode(const char* inst) { + return std::any_of(std::begin(kDebugOpcodes), std::end(kDebugOpcodes), + [inst](const char* op) { + return std::string(inst).find(op) != std::string::npos; + }); +} + +std::string SelectiveJoin(const std::vector& strings, + const std::function& skip_dictator, + char delimiter) { + std::ostringstream oss; + for (const auto* str : strings) { + if (!skip_dictator(str)) oss << str << delimiter; + } + return oss.str(); +} + +std::string JoinAllInsts(const std::vector& insts) { + return SelectiveJoin(insts, [](const char*) { return false; }); +} + +std::string JoinNonDebugInsts(const std::vector& insts) { + return SelectiveJoin( + insts, [](const char* inst) { return ContainsDebugOpcode(inst); }); +} + +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/pass_utils.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/pass_utils.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/pass_utils.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/pass_utils.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_TEST_OPT_PASS_UTILS_H_ +#define LIBSPIRV_TEST_OPT_PASS_UTILS_H_ + +#include +#include +#include +#include + +namespace spvtools { + +// In-place substring replacement. Finds the |find_str| in the |process_str| +// and replaces the found substring with |replace_str|. Returns true if at +// least one replacement is done successfully, returns false otherwise. The +// replaced substring won't be processed again, which means: If the +// |replace_str| has |find_str| as its substring, that newly replaced part of +// |process_str| won't be processed again. +bool FindAndReplace(std::string* process_str, const std::string find_str, + const std::string replace_str); + +// Returns true if the given string contains any debug opcode substring. +bool ContainsDebugOpcode(const char* inst); + +// Returns the concatenated string from a vector of |strings|, with postfixing +// each string with the given |delimiter|. if the |skip_dictator| returns true +// for an original string, that string will be omitted. +std::string SelectiveJoin(const std::vector& strings, + const std::function& skip_dictator, + char delimiter = '\n'); + +// Concatenates a vector of strings into one string. Each string is postfixed +// with '\n'. +std::string JoinAllInsts(const std::vector& insts); + +// Concatenates a vector of strings into one string. Each string is postfixed +// with '\n'. If a string contains opcode for debug instruction, that string +// will be ignored. +std::string JoinNonDebugInsts(const std::vector& insts); + +// Returns a vector that contains the contents of |a| followed by the contents +// of |b|. +template +std::vector Concat(const std::vector& a, const std::vector& b) { + std::vector ret; + std::copy(a.begin(), a.end(), back_inserter(ret)); + std::copy(b.begin(), b.end(), back_inserter(ret)); + return ret; +} + +} // namespace spvtools + +#endif // LIBSPIRV_TEST_OPT_PASS_UTILS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/private_to_local_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/private_to_local_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/private_to_local_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/private_to_local_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,242 @@ +// Copyright (c) 2017 Google 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. + +#include "opt/value_number_table.h" + +#include "assembly_builder.h" +#include "gmock/gmock.h" +#include "opt/build_module.h" +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using ::testing::HasSubstr; +using ::testing::MatchesRegex; + +using PrivateToLocalTest = PassTest<::testing::Test>; + +#ifdef SPIRV_EFFCEE +TEST_F(PrivateToLocalTest, ChangeToLocal) { + // Change the private variable to a local, and change the types accordingly. + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 +; CHECK: [[float:%[a-zA-Z_\d]+]] = OpTypeFloat 32 + %5 = OpTypeFloat 32 +; CHECK: [[newtype:%[a-zA-Z_\d]+]] = OpTypePointer Function [[float]] + %6 = OpTypePointer Private %5 +; CHECK-NOT: OpVariable [[.+]] Private + %8 = OpVariable %6 Private +; CHECK: OpFunction + %2 = OpFunction %3 None %4 +; CHECK: OpLabel + %7 = OpLabel +; CHECK-NEXT: [[newvar:%[a-zA-Z_\d]+]] = OpVariable [[newtype]] Function +; CHECK: OpLoad [[float]] [[newvar]] + %9 = OpLoad %5 %8 + OpReturn + OpFunctionEnd + )"; + SinglePassRunAndMatch(text, false); +} + +TEST_F(PrivateToLocalTest, ReuseExistingType) { + // Change the private variable to a local, and change the types accordingly. + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 +; CHECK: [[float:%[a-zA-Z_\d]+]] = OpTypeFloat 32 + %5 = OpTypeFloat 32 + %func_ptr = OpTypePointer Function %5 +; CHECK: [[newtype:%[a-zA-Z_\d]+]] = OpTypePointer Function [[float]] +; CHECK-NOT: [[%[a-zA-Z_\d]+]] = OpTypePointer Function [[float]] + %6 = OpTypePointer Private %5 +; CHECK-NOT: OpVariable [[.+]] Private + %8 = OpVariable %6 Private +; CHECK: OpFunction + %2 = OpFunction %3 None %4 +; CHECK: OpLabel + %7 = OpLabel +; CHECK-NEXT: [[newvar:%[a-zA-Z_\d]+]] = OpVariable [[newtype]] Function +; CHECK: OpLoad [[float]] [[newvar]] + %9 = OpLoad %5 %8 + OpReturn + OpFunctionEnd + )"; + SinglePassRunAndMatch(text, false); +} + +TEST_F(PrivateToLocalTest, UpdateAccessChain) { + // Change the private variable to a local, and change the AccessChain. + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 + %void = OpTypeVoid + %6 = OpTypeFunction %void +; CHECK: [[float:%[a-zA-Z_\d]+]] = OpTypeFloat + %float = OpTypeFloat 32 +; CHECK: [[struct:%[a-zA-Z_\d]+]] = OpTypeStruct + %_struct_8 = OpTypeStruct %float +%_ptr_Private_float = OpTypePointer Private %float +; CHECK: [[new_struct_type:%[a-zA-Z_\d]+]] = OpTypePointer Function [[struct]] +; CHECK: [[new_float_type:%[a-zA-Z_\d]+]] = OpTypePointer Function [[float]] +%_ptr_Private__struct_8 = OpTypePointer Private %_struct_8 +; CHECK-NOT: OpVariable [[.+]] Private + %11 = OpVariable %_ptr_Private__struct_8 Private +; CHECK: OpFunction + %2 = OpFunction %void None %6 +; CHECK: OpLabel + %12 = OpLabel +; CHECK-NEXT: [[newvar:%[a-zA-Z_\d]+]] = OpVariable [[new_struct_type]] Function +; CHECK: [[member:%[a-zA-Z_\d]+]] = OpAccessChain [[new_float_type]] [[newvar]] + %13 = OpAccessChain %_ptr_Private_float %11 %uint_0 +; CHECK: OpLoad [[float]] [[member]] + %14 = OpLoad %float %13 + OpReturn + OpFunctionEnd + )"; + SinglePassRunAndMatch(text, false); +} + +TEST_F(PrivateToLocalTest, UseTexelPointer) { + // Change the private variable to a local, and change the OpImageTexelPointer. + const std::string text = R"( +OpCapability SampledBuffer + OpCapability StorageImageExtendedFormats + OpCapability ImageBuffer + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %2 "min" %gl_GlobalInvocationID + OpExecutionMode %2 LocalSize 64 1 1 + OpSource HLSL 600 + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %4 DescriptorSet 4 + OpDecorate %4 Binding 70 + %uint = OpTypeInt 32 0 + %6 = OpTypeImage %uint Buffer 0 0 0 2 R32ui +%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6 +%_ptr_Private_6 = OpTypePointer Private %6 + %void = OpTypeVoid + %10 = OpTypeFunction %void + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint +%_ptr_Image_uint = OpTypePointer Image %uint + %4 = OpVariable %_ptr_UniformConstant_6 UniformConstant + %16 = OpVariable %_ptr_Private_6 Private +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %10 + %17 = OpLabel +; Make sure the variable was moved. +; CHECK: OpFunction +; CHECK-NEXT: OpLabel +; CHECK-NEXT: OpVariable %_ptr_Function_6 Function + %18 = OpLoad %6 %4 + OpStore %16 %18 + %19 = OpImageTexelPointer %_ptr_Image_uint %16 %uint_0 %uint_0 + %20 = OpAtomicIAdd %uint %19 %uint_1 %uint_0 %uint_1 + OpReturn + OpFunctionEnd + )"; + SinglePassRunAndMatch(text, false); +} + +TEST_F(PrivateToLocalTest, UsedInTwoFunctions) { + // Should not change because it is used in multiple functions. + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Private %5 + %8 = OpVariable %6 Private + %2 = OpFunction %3 None %4 + %7 = OpLabel + %9 = OpLoad %5 %8 + OpReturn + OpFunctionEnd + %10 = OpFunction %3 None %4 + %11 = OpLabel + %12 = OpLoad %5 %8 + OpReturn + OpFunctionEnd + )"; + auto result = SinglePassRunAndDisassemble( + text, /* skip_nop = */ true, /* do_validation = */ false); + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); +} + +TEST_F(PrivateToLocalTest, UsedInFunctionCall) { + // Should not change because it is used in a function call. Changing the + // signature of the function would require cloning the function, which is not + // worth it. + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %void = OpTypeVoid + %4 = OpTypeFunction %void + %float = OpTypeFloat 32 +%_ptr_Private_float = OpTypePointer Private %float + %7 = OpTypeFunction %void %_ptr_Private_float + %8 = OpVariable %_ptr_Private_float Private + %2 = OpFunction %void None %4 + %9 = OpLabel + %10 = OpFunctionCall %void %11 %8 + OpReturn + OpFunctionEnd + %11 = OpFunction %void None %7 + %12 = OpFunctionParameter %_ptr_Private_float + %13 = OpLabel + %14 = OpLoad %float %12 + OpReturn + OpFunctionEnd + )"; + auto result = SinglePassRunAndDisassemble( + text, /* skip_nop = */ true, /* do_validation = */ false); + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); +} +#endif +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/propagator_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/propagator_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/propagator_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/propagator_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,214 @@ +// Copyright (c) 2017 Google 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. + +#include +#include + +#include "opt/build_module.h" +#include "opt/cfg.h" +#include "opt/ir_context.h" +#include "opt/pass.h" +#include "opt/propagator.h" + +namespace { + +using namespace spvtools; + +using ::testing::UnorderedElementsAre; + +class PropagatorTest : public testing::Test { + protected: + virtual void TearDown() { + ctx_.reset(nullptr); + values_.clear(); + values_vec_.clear(); + } + + void Assemble(const std::string& input) { + ctx_ = BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, input); + ASSERT_NE(nullptr, ctx_) << "Assembling failed for shader:\n" + << input << "\n"; + } + + bool Propagate(const opt::SSAPropagator::VisitFunction& visit_fn) { + opt::SSAPropagator propagator(ctx_.get(), visit_fn); + bool retval = false; + for (auto& fn : *ctx_->module()) { + retval |= propagator.Run(&fn); + } + return retval; + } + + const std::vector& GetValues() { + values_vec_.clear(); + for (const auto& it : values_) { + values_vec_.push_back(it.second); + } + return values_vec_; + } + + std::unique_ptr ctx_; + std::map values_; + std::vector values_vec_; +}; + +TEST_F(PropagatorTest, LocalPropagate) { + const std::string spv_asm = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %outparm + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %x "x" + OpName %y "y" + OpName %z "z" + OpName %outparm "outparm" + OpDecorate %outparm Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_4 = OpConstant %int 4 + %int_3 = OpConstant %int 3 + %int_1 = OpConstant %int 1 +%_ptr_Output_int = OpTypePointer Output %int + %outparm = OpVariable %_ptr_Output_int Output + %main = OpFunction %void None %3 + %5 = OpLabel + %x = OpVariable %_ptr_Function_int Function + %y = OpVariable %_ptr_Function_int Function + %z = OpVariable %_ptr_Function_int Function + OpStore %x %int_4 + OpStore %y %int_3 + OpStore %z %int_1 + %20 = OpLoad %int %z + OpStore %outparm %20 + OpReturn + OpFunctionEnd + )"; + Assemble(spv_asm); + + const auto visit_fn = [this](ir::Instruction* instr, + ir::BasicBlock** dest_bb) { + *dest_bb = nullptr; + if (instr->opcode() == SpvOpStore) { + uint32_t lhs_id = instr->GetSingleWordOperand(0); + uint32_t rhs_id = instr->GetSingleWordOperand(1); + ir::Instruction* rhs_def = ctx_->get_def_use_mgr()->GetDef(rhs_id); + if (rhs_def->opcode() == SpvOpConstant) { + uint32_t val = rhs_def->GetSingleWordOperand(2); + values_[lhs_id] = val; + return opt::SSAPropagator::kInteresting; + } + } + return opt::SSAPropagator::kVarying; + }; + + EXPECT_TRUE(Propagate(visit_fn)); + EXPECT_THAT(GetValues(), UnorderedElementsAre(4, 3, 1)); +} + +TEST_F(PropagatorTest, PropagateThroughPhis) { + const std::string spv_asm = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %x %outparm + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %x "x" + OpName %outparm "outparm" + OpDecorate %x Flat + OpDecorate %x Location 0 + OpDecorate %outparm Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %bool = OpTypeBool +%_ptr_Function_int = OpTypePointer Function %int + %int_4 = OpConstant %int 4 + %int_3 = OpConstant %int 3 + %int_1 = OpConstant %int 1 +%_ptr_Input_int = OpTypePointer Input %int + %x = OpVariable %_ptr_Input_int Input +%_ptr_Output_int = OpTypePointer Output %int + %outparm = OpVariable %_ptr_Output_int Output + %main = OpFunction %void None %3 + %4 = OpLabel + %5 = OpLoad %int %x + %6 = OpSGreaterThan %bool %5 %int_3 + OpSelectionMerge %25 None + OpBranchConditional %6 %22 %23 + %22 = OpLabel + %7 = OpLoad %int %int_4 + OpBranch %25 + %23 = OpLabel + %8 = OpLoad %int %int_4 + OpBranch %25 + %25 = OpLabel + %35 = OpPhi %int %7 %22 %8 %23 + OpStore %outparm %35 + OpReturn + OpFunctionEnd + )"; + + Assemble(spv_asm); + + ir::Instruction *phi_instr = nullptr; + const auto visit_fn = [this, &phi_instr](ir::Instruction* instr, + ir::BasicBlock** dest_bb) { + *dest_bb = nullptr; + if (instr->opcode() == SpvOpLoad) { + uint32_t rhs_id = instr->GetSingleWordOperand(2); + ir::Instruction* rhs_def = ctx_->get_def_use_mgr()->GetDef(rhs_id); + if (rhs_def->opcode() == SpvOpConstant) { + uint32_t val = rhs_def->GetSingleWordOperand(2); + values_[instr->result_id()] = val; + return opt::SSAPropagator::kInteresting; + } + } else if (instr->opcode() == SpvOpPhi) { + phi_instr = instr; + opt::SSAPropagator::PropStatus retval; + for (uint32_t i = 2; i < instr->NumOperands(); i += 2) { + uint32_t phi_arg_id = instr->GetSingleWordOperand(i); + auto it = values_.find(phi_arg_id); + if (it != values_.end()) { + EXPECT_EQ(it->second, 4u); + retval = opt::SSAPropagator::kInteresting; + values_[instr->result_id()] = it->second; + } else { + retval = opt::SSAPropagator::kNotInteresting; + break; + } + } + return retval; + } + + return opt::SSAPropagator::kVarying; + }; + + EXPECT_TRUE(Propagate(visit_fn)); + + // The propagator should've concluded that the Phi instruction has a constant + // value of 4. + EXPECT_NE(phi_instr, nullptr); + EXPECT_EQ(values_[phi_instr->result_id()], 4u); + + EXPECT_THAT(GetValues(), UnorderedElementsAre(4u, 4u, 4u)); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/redundancy_elimination_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/redundancy_elimination_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/redundancy_elimination_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/redundancy_elimination_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,276 @@ +// Copyright (c) 2017 Google 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. + +#include "opt/value_number_table.h" + +#include "assembly_builder.h" +#include "gmock/gmock.h" +#include "opt/build_module.h" +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using ::testing::HasSubstr; +using ::testing::MatchesRegex; + +using RedundancyEliminationTest = PassTest<::testing::Test>; + +#ifdef SPIRV_EFFCEE +// Test that it can get a simple case of local redundancy elimination. +// The rest of the test check for extra functionality. +TEST_F(RedundancyEliminationTest, RemoveRedundantLocalAdd) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Function %5 + %2 = OpFunction %3 None %4 + %7 = OpLabel + %8 = OpVariable %6 Function + %9 = OpLoad %5 %8 + %10 = OpFAdd %5 %9 %9 +; CHECK: OpFAdd +; CHECK-NOT: OpFAdd + %11 = OpFAdd %5 %9 %9 + OpReturn + OpFunctionEnd + )"; + SinglePassRunAndMatch(text, false); +} + +// Remove a redundant add across basic blocks. +TEST_F(RedundancyEliminationTest, RemoveRedundantAdd) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Function %5 + %2 = OpFunction %3 None %4 + %7 = OpLabel + %8 = OpVariable %6 Function + %9 = OpLoad %5 %8 + %10 = OpFAdd %5 %9 %9 + OpBranch %11 + %11 = OpLabel +; CHECK: OpFAdd +; CHECK-NOT: OpFAdd + %12 = OpFAdd %5 %9 %9 + OpReturn + OpFunctionEnd + )"; + SinglePassRunAndMatch(text, false); +} + +// Remove a redundant add going through a multiple basic blocks. +TEST_F(RedundancyEliminationTest, RemoveRedundantAddDiamond) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Function %5 + %7 = OpTypeBool + %8 = OpConstantTrue %7 + %2 = OpFunction %3 None %4 + %9 = OpLabel + %10 = OpVariable %6 Function + %11 = OpLoad %5 %10 + %12 = OpFAdd %5 %11 %11 +; CHECK: OpFAdd +; CHECK-NOT: OpFAdd + OpBranchConditional %8 %13 %14 + %13 = OpLabel + OpBranch %15 + %14 = OpLabel + OpBranch %15 + %15 = OpLabel + %16 = OpFAdd %5 %11 %11 + OpReturn + OpFunctionEnd + + )"; + SinglePassRunAndMatch(text, false); +} + +// Remove a redundant add in a side node. +TEST_F(RedundancyEliminationTest, RemoveRedundantAddInSideNode) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Function %5 + %7 = OpTypeBool + %8 = OpConstantTrue %7 + %2 = OpFunction %3 None %4 + %9 = OpLabel + %10 = OpVariable %6 Function + %11 = OpLoad %5 %10 + %12 = OpFAdd %5 %11 %11 +; CHECK: OpFAdd +; CHECK-NOT: OpFAdd + OpBranchConditional %8 %13 %14 + %13 = OpLabel + OpBranch %15 + %14 = OpLabel + %16 = OpFAdd %5 %11 %11 + OpBranch %15 + %15 = OpLabel + OpReturn + OpFunctionEnd + + )"; + SinglePassRunAndMatch(text, false); +} + +// Remove a redundant add whose value is in the result of a phi node. +TEST_F(RedundancyEliminationTest, RemoveRedundantAddWithPhi) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Function %5 + %7 = OpTypeBool + %8 = OpConstantTrue %7 + %2 = OpFunction %3 None %4 + %9 = OpLabel + %10 = OpVariable %6 Function + %11 = OpLoad %5 %10 + OpBranchConditional %8 %13 %14 + %13 = OpLabel + %add1 = OpFAdd %5 %11 %11 +; CHECK: OpFAdd + OpBranch %15 + %14 = OpLabel + %add2 = OpFAdd %5 %11 %11 +; CHECK: OpFAdd + OpBranch %15 + %15 = OpLabel +; CHECK: OpPhi + %phi = OpPhi %5 %add1 %13 %add2 %14 +; CHECK-NOT: OpFAdd + %16 = OpFAdd %5 %11 %11 + OpReturn + OpFunctionEnd + + )"; + SinglePassRunAndMatch(text, false); +} + +// Keep the add because it is redundant on some paths, but not all paths. +TEST_F(RedundancyEliminationTest, KeepPartiallyRedundantAdd) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Function %5 + %7 = OpTypeBool + %8 = OpConstantTrue %7 + %2 = OpFunction %3 None %4 + %9 = OpLabel + %10 = OpVariable %6 Function + %11 = OpLoad %5 %10 + OpBranchConditional %8 %13 %14 + %13 = OpLabel + %add = OpFAdd %5 %11 %11 + OpBranch %15 + %14 = OpLabel + OpBranch %15 + %15 = OpLabel + %16 = OpFAdd %5 %11 %11 + OpReturn + OpFunctionEnd + + )"; + auto result = SinglePassRunAndDisassemble( + text, /* skip_nop = */ true, /* do_validation = */ false); + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); +} + +// Keep the add. Even if it is redundant on all paths, there is no single id +// whose definition dominates the add and contains the same value. +TEST_F(RedundancyEliminationTest, KeepRedundantAddWithoutPhi) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Function %5 + %7 = OpTypeBool + %8 = OpConstantTrue %7 + %2 = OpFunction %3 None %4 + %9 = OpLabel + %10 = OpVariable %6 Function + %11 = OpLoad %5 %10 + OpBranchConditional %8 %13 %14 + %13 = OpLabel + %add1 = OpFAdd %5 %11 %11 + OpBranch %15 + %14 = OpLabel + %add2 = OpFAdd %5 %11 %11 + OpBranch %15 + %15 = OpLabel + %16 = OpFAdd %5 %11 %11 + OpReturn + OpFunctionEnd + + )"; + auto result = SinglePassRunAndDisassemble( + text, /* skip_nop = */ true, /* do_validation = */ false); + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); +} +#endif +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/replace_invalid_opc_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/replace_invalid_opc_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/replace_invalid_opc_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/replace_invalid_opc_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,590 @@ +// Copyright (c) 2017 Google 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. + +#include "assembly_builder.h" +#include "gmock/gmock.h" +#include "pass_fixture.h" + +#include + +namespace { + +using namespace spvtools; + +using ReplaceInvalidOpcodeTest = PassTest<::testing::Test>; + +#ifdef SPIRV_EFFCEE +TEST_F(ReplaceInvalidOpcodeTest, ReplaceInstruction) { + const std::string text = R"( +; CHECK: [[special_const:%\w+]] = OpConstant %float -6.2598534e+18 +; CHECK: [[constant:%\w+]] = OpConstantComposite %v4float [[special_const]] [[special_const]] [[special_const]] [[special_const]] +; CHECK-NOT: OpImageSampleImplicitLod +; CHECK: OpStore [[:%\w+]] [[constant]] + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" %3 %gl_VertexIndex %5 + OpSource GLSL 400 + OpSourceExtension "GL_ARB_separate_shader_objects" + OpSourceExtension "GL_ARB_shading_language_420pack" + OpName %main "main" + OpDecorate %3 Location 0 + OpDecorate %gl_VertexIndex BuiltIn VertexIndex + OpMemberDecorate %_struct_6 0 BuiltIn Position + OpDecorate %_struct_6 Block + %void = OpTypeVoid + %8 = OpTypeFunction %void + %float = OpTypeFloat 32 + %10 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %12 = OpTypeSampler +%_ptr_UniformConstant_12 = OpTypePointer UniformConstant %12 + %14 = OpTypeSampledImage %10 + %v4float = OpTypeVector %float 4 + %v2float = OpTypeVector %float 2 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %3 = OpVariable %_ptr_Output_v4float Output + %int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%gl_VertexIndex = OpVariable %_ptr_Input_int Input + %_struct_6 = OpTypeStruct %v4float +%_ptr_Output__struct_6 = OpTypePointer Output %_struct_6 + %5 = OpVariable %_ptr_Output__struct_6 Output + %int_0 = OpConstant %int 0 + %float_0 = OpConstant %float 0 + %23 = OpConstantComposite %v2float %float_0 %float_0 + %24 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %25 = OpVariable %_ptr_UniformConstant_12 UniformConstant + %main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpLoad %12 %25 + %28 = OpLoad %10 %24 + %29 = OpSampledImage %14 %28 %27 + %30 = OpImageSampleImplicitLod %v4float %29 %23 + %31 = OpAccessChain %_ptr_Output_v4float %5 %int_0 + OpStore %31 %30 + OpReturn + OpFunctionEnd)"; + + SinglePassRunAndMatch(text, false); +} + +TEST_F(ReplaceInvalidOpcodeTest, ReplaceInstructionInNonEntryPoint) { + const std::string text = R"( +; CHECK: [[special_const:%\w+]] = OpConstant %float -6.2598534e+18 +; CHECK: [[constant:%\w+]] = OpConstantComposite %v4float [[special_const]] [[special_const]] [[special_const]] [[special_const]] +; CHECK-NOT: OpImageSampleImplicitLod +; CHECK: OpStore [[:%\w+]] [[constant]] + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" %3 %gl_VertexIndex %5 + OpSource GLSL 400 + OpSourceExtension "GL_ARB_separate_shader_objects" + OpSourceExtension "GL_ARB_shading_language_420pack" + OpName %main "main" + OpDecorate %3 Location 0 + OpDecorate %gl_VertexIndex BuiltIn VertexIndex + OpMemberDecorate %_struct_6 0 BuiltIn Position + OpDecorate %_struct_6 Block + %void = OpTypeVoid + %8 = OpTypeFunction %void + %float = OpTypeFloat 32 + %10 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %12 = OpTypeSampler +%_ptr_UniformConstant_12 = OpTypePointer UniformConstant %12 + %14 = OpTypeSampledImage %10 + %v4float = OpTypeVector %float 4 + %v2float = OpTypeVector %float 2 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %3 = OpVariable %_ptr_Output_v4float Output + %int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%gl_VertexIndex = OpVariable %_ptr_Input_int Input + %_struct_6 = OpTypeStruct %v4float +%_ptr_Output__struct_6 = OpTypePointer Output %_struct_6 + %5 = OpVariable %_ptr_Output__struct_6 Output + %int_0 = OpConstant %int 0 + %float_0 = OpConstant %float 0 + %23 = OpConstantComposite %v2float %float_0 %float_0 + %24 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %25 = OpVariable %_ptr_UniformConstant_12 UniformConstant + %main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %28 + OpReturn + OpFunctionEnd + %28 = OpFunction %void None %8 + %29 = OpLabel + %30 = OpLoad %12 %25 + %31 = OpLoad %10 %24 + %32 = OpSampledImage %14 %31 %30 + %33 = OpImageSampleImplicitLod %v4float %32 %23 + %34 = OpAccessChain %_ptr_Output_v4float %5 %int_0 + OpStore %34 %33 + OpReturn + OpFunctionEnd)"; + + SinglePassRunAndMatch(text, false); +} + +TEST_F(ReplaceInvalidOpcodeTest, ReplaceInstructionMultipleEntryPoints) { + const std::string text = R"( +; CHECK: [[special_const:%\w+]] = OpConstant %float -6.2598534e+18 +; CHECK: [[constant:%\w+]] = OpConstantComposite %v4float [[special_const]] [[special_const]] [[special_const]] [[special_const]] +; CHECK-NOT: OpImageSampleImplicitLod +; CHECK: OpStore [[:%\w+]] [[constant]] +; CHECK-NOT: OpImageSampleImplicitLod +; CHECK: OpStore [[:%\w+]] [[constant]] + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" %3 %gl_VertexIndex %5 + OpEntryPoint Vertex %main2 "main2" %3 %gl_VertexIndex %5 + OpSource GLSL 400 + OpSourceExtension "GL_ARB_separate_shader_objects" + OpSourceExtension "GL_ARB_shading_language_420pack" + OpName %main "main" + OpName %main2 "main2" + OpDecorate %3 Location 0 + OpDecorate %gl_VertexIndex BuiltIn VertexIndex + OpMemberDecorate %_struct_6 0 BuiltIn Position + OpDecorate %_struct_6 Block + %void = OpTypeVoid + %8 = OpTypeFunction %void + %float = OpTypeFloat 32 + %10 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %12 = OpTypeSampler +%_ptr_UniformConstant_12 = OpTypePointer UniformConstant %12 + %14 = OpTypeSampledImage %10 + %v4float = OpTypeVector %float 4 + %v2float = OpTypeVector %float 2 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %3 = OpVariable %_ptr_Output_v4float Output + %int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%gl_VertexIndex = OpVariable %_ptr_Input_int Input + %_struct_6 = OpTypeStruct %v4float +%_ptr_Output__struct_6 = OpTypePointer Output %_struct_6 + %5 = OpVariable %_ptr_Output__struct_6 Output + %int_0 = OpConstant %int 0 + %float_0 = OpConstant %float 0 + %23 = OpConstantComposite %v2float %float_0 %float_0 + %24 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %25 = OpVariable %_ptr_UniformConstant_12 UniformConstant + %main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpLoad %12 %25 + %28 = OpLoad %10 %24 + %29 = OpSampledImage %14 %28 %27 + %30 = OpImageSampleImplicitLod %v4float %29 %23 + %31 = OpAccessChain %_ptr_Output_v4float %5 %int_0 + OpStore %31 %30 + OpReturn + OpFunctionEnd + %main2 = OpFunction %void None %8 + %46 = OpLabel + %47 = OpLoad %12 %25 + %48 = OpLoad %10 %24 + %49 = OpSampledImage %14 %48 %47 + %50 = OpImageSampleImplicitLod %v4float %49 %23 + %51 = OpAccessChain %_ptr_Output_v4float %5 %int_0 + OpStore %51 %50 + OpReturn + OpFunctionEnd)"; + + SinglePassRunAndMatch(text, false); +} +TEST_F(ReplaceInvalidOpcodeTest, DontReplaceInstruction) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %3 %gl_VertexIndex %5 + OpSource GLSL 400 + OpSourceExtension "GL_ARB_separate_shader_objects" + OpSourceExtension "GL_ARB_shading_language_420pack" + OpName %main "main" + OpDecorate %3 Location 0 + OpDecorate %gl_VertexIndex BuiltIn VertexIndex + OpMemberDecorate %_struct_6 0 BuiltIn Position + OpDecorate %_struct_6 Block + %void = OpTypeVoid + %8 = OpTypeFunction %void + %float = OpTypeFloat 32 + %10 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %12 = OpTypeSampler +%_ptr_UniformConstant_12 = OpTypePointer UniformConstant %12 + %14 = OpTypeSampledImage %10 + %v4float = OpTypeVector %float 4 + %v2float = OpTypeVector %float 2 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %3 = OpVariable %_ptr_Output_v4float Output + %int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%gl_VertexIndex = OpVariable %_ptr_Input_int Input + %_struct_6 = OpTypeStruct %v4float +%_ptr_Output__struct_6 = OpTypePointer Output %_struct_6 + %5 = OpVariable %_ptr_Output__struct_6 Output + %int_0 = OpConstant %int 0 + %float_0 = OpConstant %float 0 + %23 = OpConstantComposite %v2float %float_0 %float_0 + %24 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %25 = OpVariable %_ptr_UniformConstant_12 UniformConstant + %main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpLoad %12 %25 + %28 = OpLoad %10 %24 + %29 = OpSampledImage %14 %28 %27 + %30 = OpImageSampleImplicitLod %v4float %29 %23 + %31 = OpAccessChain %_ptr_Output_v4float %5 %int_0 + OpStore %31 %30 + OpReturn + OpFunctionEnd)"; + + auto result = SinglePassRunAndDisassemble( + text, /* skip_nop = */ true, /* do_validation = */ false); + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); +} + +TEST_F(ReplaceInvalidOpcodeTest, MultipleEntryPointsDifferentStage) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" %3 %gl_VertexIndex %5 + OpEntryPoint Fragment %main2 "main2" %3 %gl_VertexIndex %5 + OpSource GLSL 400 + OpSourceExtension "GL_ARB_separate_shader_objects" + OpSourceExtension "GL_ARB_shading_language_420pack" + OpName %main "main" + OpName %main2 "main2" + OpDecorate %3 Location 0 + OpDecorate %gl_VertexIndex BuiltIn VertexIndex + OpMemberDecorate %_struct_6 0 BuiltIn Position + OpDecorate %_struct_6 Block + %void = OpTypeVoid + %8 = OpTypeFunction %void + %float = OpTypeFloat 32 + %10 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %12 = OpTypeSampler +%_ptr_UniformConstant_12 = OpTypePointer UniformConstant %12 + %14 = OpTypeSampledImage %10 + %v4float = OpTypeVector %float 4 + %v2float = OpTypeVector %float 2 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %3 = OpVariable %_ptr_Output_v4float Output + %int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%gl_VertexIndex = OpVariable %_ptr_Input_int Input + %_struct_6 = OpTypeStruct %v4float +%_ptr_Output__struct_6 = OpTypePointer Output %_struct_6 + %5 = OpVariable %_ptr_Output__struct_6 Output + %int_0 = OpConstant %int 0 + %float_0 = OpConstant %float 0 + %23 = OpConstantComposite %v2float %float_0 %float_0 + %24 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %25 = OpVariable %_ptr_UniformConstant_12 UniformConstant + %main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpLoad %12 %25 + %28 = OpLoad %10 %24 + %29 = OpSampledImage %14 %28 %27 + %30 = OpImageSampleImplicitLod %v4float %29 %23 + %31 = OpAccessChain %_ptr_Output_v4float %5 %int_0 + OpStore %31 %30 + OpReturn + OpFunctionEnd + %main2 = OpFunction %void None %8 + %46 = OpLabel + %47 = OpLoad %12 %25 + %48 = OpLoad %10 %24 + %49 = OpSampledImage %14 %48 %47 + %50 = OpImageSampleImplicitLod %v4float %49 %23 + %51 = OpAccessChain %_ptr_Output_v4float %5 %int_0 + OpStore %51 %50 + OpReturn + OpFunctionEnd)"; + + auto result = SinglePassRunAndDisassemble( + text, /* skip_nop = */ true, /* do_validation = */ false); + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); +} + +TEST_F(ReplaceInvalidOpcodeTest, DontReplaceLinkage) { + const std::string text = R"( + OpCapability Shader + OpCapability Linkage + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" %3 %gl_VertexIndex %5 + OpSource GLSL 400 + OpSourceExtension "GL_ARB_separate_shader_objects" + OpSourceExtension "GL_ARB_shading_language_420pack" + OpName %main "main" + OpDecorate %3 Location 0 + OpDecorate %gl_VertexIndex BuiltIn VertexIndex + OpMemberDecorate %_struct_6 0 BuiltIn Position + OpDecorate %_struct_6 Block + %void = OpTypeVoid + %8 = OpTypeFunction %void + %float = OpTypeFloat 32 + %10 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %12 = OpTypeSampler +%_ptr_UniformConstant_12 = OpTypePointer UniformConstant %12 + %14 = OpTypeSampledImage %10 + %v4float = OpTypeVector %float 4 + %v2float = OpTypeVector %float 2 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %3 = OpVariable %_ptr_Output_v4float Output + %int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%gl_VertexIndex = OpVariable %_ptr_Input_int Input + %_struct_6 = OpTypeStruct %v4float +%_ptr_Output__struct_6 = OpTypePointer Output %_struct_6 + %5 = OpVariable %_ptr_Output__struct_6 Output + %int_0 = OpConstant %int 0 + %float_0 = OpConstant %float 0 + %23 = OpConstantComposite %v2float %float_0 %float_0 + %24 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %25 = OpVariable %_ptr_UniformConstant_12 UniformConstant + %main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpLoad %12 %25 + %28 = OpLoad %10 %24 + %29 = OpSampledImage %14 %28 %27 + %30 = OpImageSampleImplicitLod %v4float %29 %23 + %31 = OpAccessChain %_ptr_Output_v4float %5 %int_0 + OpStore %31 %30 + OpReturn + OpFunctionEnd)"; + + auto result = SinglePassRunAndDisassemble( + text, /* skip_nop = */ true, /* do_validation = */ false); + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); +} + +TEST_F(ReplaceInvalidOpcodeTest, BarrierDontReplace) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %main "main" + OpExecutionMode %main LocalSize 1 1 1 + OpSource GLSL 450 + OpSourceExtension "GL_GOOGLE_cpp_style_line_directive" + OpSourceExtension "GL_GOOGLE_include_directive" + OpName %main "main" + %void = OpTypeVoid + %3 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %uint_2 = OpConstant %uint 2 +%uint_264 = OpConstant %uint 264 + %main = OpFunction %void None %3 + %5 = OpLabel + OpControlBarrier %uint_2 %uint_2 %uint_264 + OpReturn + OpFunctionEnd)"; + + auto result = SinglePassRunAndDisassemble( + text, /* skip_nop = */ true, /* do_validation = */ false); + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); +} + +TEST_F(ReplaceInvalidOpcodeTest, BarrierReplace) { + const std::string text = R"( +; CHECK-NOT: OpControlBarrier + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" + OpExecutionMode %main LocalSize 1 1 1 + OpSource GLSL 450 + OpSourceExtension "GL_GOOGLE_cpp_style_line_directive" + OpSourceExtension "GL_GOOGLE_include_directive" + OpName %main "main" + %void = OpTypeVoid + %3 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %uint_2 = OpConstant %uint 2 +%uint_264 = OpConstant %uint 264 + %main = OpFunction %void None %3 + %5 = OpLabel + OpControlBarrier %uint_2 %uint_2 %uint_264 + OpReturn + OpFunctionEnd)"; + + SinglePassRunAndMatch(text, false); +} + +struct Message { + spv_message_level_t level; + const char* source_file; + uint32_t line_number; + uint32_t column_number; + const char* message; +}; + +MessageConsumer GetTestMessageConsumer( + std::vector& expected_messages) { + return [&expected_messages](spv_message_level_t level, const char* source, + const spv_position_t& position, + const char* message) { + EXPECT_TRUE(!expected_messages.empty()); + if (expected_messages.empty()) { + return; + } + + EXPECT_EQ(expected_messages[0].level, level); + EXPECT_EQ(expected_messages[0].line_number, position.line); + EXPECT_EQ(expected_messages[0].column_number, position.column); + EXPECT_STREQ(expected_messages[0].source_file, source); + EXPECT_STREQ(expected_messages[0].message, message); + + expected_messages.erase(expected_messages.begin()); + }; +} + +TEST_F(ReplaceInvalidOpcodeTest, MessageTest) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" %3 %gl_VertexIndex %5 + OpSource GLSL 400 + %6 = OpString "test.hlsl" + OpSourceExtension "GL_ARB_separate_shader_objects" + OpSourceExtension "GL_ARB_shading_language_420pack" + OpName %main "main" + OpDecorate %3 Location 0 + OpDecorate %gl_VertexIndex BuiltIn VertexIndex + OpMemberDecorate %_struct_7 0 BuiltIn Position + OpDecorate %_struct_7 Block + %void = OpTypeVoid + %9 = OpTypeFunction %void + %float = OpTypeFloat 32 + %11 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11 + %13 = OpTypeSampler +%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13 + %15 = OpTypeSampledImage %11 + %v4float = OpTypeVector %float 4 + %v2float = OpTypeVector %float 2 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %3 = OpVariable %_ptr_Output_v4float Output + %int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%gl_VertexIndex = OpVariable %_ptr_Input_int Input + %_struct_7 = OpTypeStruct %v4float +%_ptr_Output__struct_7 = OpTypePointer Output %_struct_7 + %5 = OpVariable %_ptr_Output__struct_7 Output + %int_0 = OpConstant %int 0 + %float_0 = OpConstant %float 0 + %24 = OpConstantComposite %v2float %float_0 %float_0 + %25 = OpVariable %_ptr_UniformConstant_11 UniformConstant + %26 = OpVariable %_ptr_UniformConstant_13 UniformConstant + %main = OpFunction %void None %9 + %27 = OpLabel + OpLine %6 2 4 + %28 = OpLoad %13 %26 + %29 = OpLoad %11 %25 + %30 = OpSampledImage %15 %29 %28 + %31 = OpImageSampleImplicitLod %v4float %30 %24 + %32 = OpAccessChain %_ptr_Output_v4float %5 %int_0 + OpStore %32 %31 + OpReturn + OpFunctionEnd)"; + + std::vector messages = { + {SPV_MSG_WARNING, "test.hlsl", 2, 4, + "Removing ImageSampleImplicitLod instruction because of incompatible " + "execution model."}}; + SetMessageConsumer(GetTestMessageConsumer(messages)); + auto result = SinglePassRunAndDisassemble( + text, /* skip_nop = */ true, /* do_validation = */ false); + EXPECT_EQ(opt::Pass::Status::SuccessWithChange, std::get<1>(result)); +} + +TEST_F(ReplaceInvalidOpcodeTest, MultipleMessageTest) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" %3 %gl_VertexIndex %5 + OpSource GLSL 400 + %6 = OpString "test.hlsl" + OpSourceExtension "GL_ARB_separate_shader_objects" + OpSourceExtension "GL_ARB_shading_language_420pack" + OpName %main "main" + OpDecorate %3 Location 0 + OpDecorate %gl_VertexIndex BuiltIn VertexIndex + OpMemberDecorate %_struct_7 0 BuiltIn Position + OpDecorate %_struct_7 Block + %void = OpTypeVoid + %9 = OpTypeFunction %void + %float = OpTypeFloat 32 + %11 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11 + %13 = OpTypeSampler +%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13 + %15 = OpTypeSampledImage %11 + %v4float = OpTypeVector %float 4 + %v2float = OpTypeVector %float 2 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %3 = OpVariable %_ptr_Output_v4float Output + %int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int +%gl_VertexIndex = OpVariable %_ptr_Input_int Input + %_struct_7 = OpTypeStruct %v4float +%_ptr_Output__struct_7 = OpTypePointer Output %_struct_7 + %5 = OpVariable %_ptr_Output__struct_7 Output + %int_0 = OpConstant %int 0 + %float_0 = OpConstant %float 0 + %24 = OpConstantComposite %v2float %float_0 %float_0 + %25 = OpVariable %_ptr_UniformConstant_11 UniformConstant + %26 = OpVariable %_ptr_UniformConstant_13 UniformConstant + %main = OpFunction %void None %9 + %27 = OpLabel + OpLine %6 2 4 + %28 = OpLoad %13 %26 + %29 = OpLoad %11 %25 + %30 = OpSampledImage %15 %29 %28 + %31 = OpImageSampleImplicitLod %v4float %30 %24 + OpLine %6 12 4 + %41 = OpImageSampleProjImplicitLod %v4float %30 %24 + %32 = OpAccessChain %_ptr_Output_v4float %5 %int_0 + OpStore %32 %31 + OpReturn + OpFunctionEnd)"; + + std::vector messages = { + {SPV_MSG_WARNING, "test.hlsl", 2, 4, + "Removing ImageSampleImplicitLod instruction because of incompatible " + "execution model."}, + {SPV_MSG_WARNING, "test.hlsl", 12, 4, + "Removing ImageSampleProjImplicitLod instruction because of " + "incompatible " + "execution model."}}; + SetMessageConsumer(GetTestMessageConsumer(messages)); + auto result = SinglePassRunAndDisassemble( + text, /* skip_nop = */ true, /* do_validation = */ false); + EXPECT_EQ(opt::Pass::Status::SuccessWithChange, std::get<1>(result)); +} +#endif +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/scalar_analysis.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/scalar_analysis.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/scalar_analysis.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/scalar_analysis.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1228 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include +#include +#include +#include + +#include "assembly_builder.h" +#include "function_utils.h" +#include "pass_fixture.h" +#include "pass_utils.h" + +#include "opt/iterator.h" +#include "opt/loop_descriptor.h" +#include "opt/pass.h" +#include "opt/scalar_analysis.h" +#include "opt/tree_iterator.h" + +namespace { + +using namespace spvtools; +using ::testing::UnorderedElementsAre; + +using ScalarAnalysisTest = PassTest<::testing::Test>; + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 410 core +layout (location = 1) out float array[10]; +void main() { + for (int i = 0; i < 10; ++i) { + array[i] = array[i+1]; + } +} +*/ +TEST_F(ScalarAnalysisTest, BasicEvolutionTest) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" %24 + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 410 + OpName %4 "main" + OpName %24 "array" + OpDecorate %24 Location 1 + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeInt 32 1 + %7 = OpTypePointer Function %6 + %9 = OpConstant %6 0 + %16 = OpConstant %6 10 + %17 = OpTypeBool + %19 = OpTypeFloat 32 + %20 = OpTypeInt 32 0 + %21 = OpConstant %20 10 + %22 = OpTypeArray %19 %21 + %23 = OpTypePointer Output %22 + %24 = OpVariable %23 Output + %27 = OpConstant %6 1 + %29 = OpTypePointer Output %19 + %4 = OpFunction %2 None %3 + %5 = OpLabel + OpBranch %10 + %10 = OpLabel + %35 = OpPhi %6 %9 %5 %34 %13 + OpLoopMerge %12 %13 None + OpBranch %14 + %14 = OpLabel + %18 = OpSLessThan %17 %35 %16 + OpBranchConditional %18 %11 %12 + %11 = OpLabel + %28 = OpIAdd %6 %35 %27 + %30 = OpAccessChain %29 %24 %28 + %31 = OpLoad %19 %30 + %32 = OpAccessChain %29 %24 %35 + OpStore %32 %31 + OpBranch %13 + %13 = OpLabel + %34 = OpIAdd %6 %35 %27 + OpBranch %10 + %12 = OpLabel + OpReturn + OpFunctionEnd + )"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 4); + opt::ScalarEvolutionAnalysis analysis{context.get()}; + + const ir::Instruction* store = nullptr; + const ir::Instruction* load = nullptr; + for (const ir::Instruction& inst : *spvtest::GetBasicBlock(f, 11)) { + if (inst.opcode() == SpvOp::SpvOpStore) { + store = &inst; + } + if (inst.opcode() == SpvOp::SpvOpLoad) { + load = &inst; + } + } + + EXPECT_NE(load, nullptr); + EXPECT_NE(store, nullptr); + + ir::Instruction* access_chain = + context->get_def_use_mgr()->GetDef(load->GetSingleWordInOperand(0)); + + ir::Instruction* child = context->get_def_use_mgr()->GetDef( + access_chain->GetSingleWordInOperand(1)); + const opt::SENode* node = analysis.AnalyzeInstruction(child); + + EXPECT_NE(node, nullptr); + + // Unsimplified node should have the form of ADD(REC(0,1), 1) + EXPECT_EQ(node->GetType(), opt::SENode::Add); + + const opt::SENode* child_1 = node->GetChild(0); + EXPECT_TRUE(child_1->GetType() == opt::SENode::Constant || + child_1->GetType() == opt::SENode::RecurrentAddExpr); + + const opt::SENode* child_2 = node->GetChild(1); + EXPECT_TRUE(child_2->GetType() == opt::SENode::Constant || + child_2->GetType() == opt::SENode::RecurrentAddExpr); + + opt::SENode* simplified = + analysis.SimplifyExpression(const_cast(node)); + // Simplified should be in the form of REC(1,1) + EXPECT_EQ(simplified->GetType(), opt::SENode::RecurrentAddExpr); + + EXPECT_EQ(simplified->GetChild(0)->GetType(), opt::SENode::Constant); + EXPECT_EQ(simplified->GetChild(0)->AsSEConstantNode()->FoldToSingleValue(), + 1); + + EXPECT_EQ(simplified->GetChild(1)->GetType(), opt::SENode::Constant); + EXPECT_EQ(simplified->GetChild(1)->AsSEConstantNode()->FoldToSingleValue(), + 1); + + EXPECT_EQ(simplified->GetChild(0), simplified->GetChild(1)); +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 410 core +layout (location = 1) out float array[10]; +layout (location = 2) flat in int loop_invariant; +void main() { + for (int i = 0; i < 10; ++i) { + array[i] = array[i+loop_invariant]; + } +} + +*/ +TEST_F(ScalarAnalysisTest, LoadTest) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 %4 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + OpName %2 "main" + OpName %3 "array" + OpName %4 "loop_invariant" + OpDecorate %3 Location 1 + OpDecorate %4 Flat + OpDecorate %4 Location 2 + %5 = OpTypeVoid + %6 = OpTypeFunction %5 + %7 = OpTypeInt 32 1 + %8 = OpTypePointer Function %7 + %9 = OpConstant %7 0 + %10 = OpConstant %7 10 + %11 = OpTypeBool + %12 = OpTypeFloat 32 + %13 = OpTypeInt 32 0 + %14 = OpConstant %13 10 + %15 = OpTypeArray %12 %14 + %16 = OpTypePointer Output %15 + %3 = OpVariable %16 Output + %17 = OpTypePointer Input %7 + %4 = OpVariable %17 Input + %18 = OpTypePointer Output %12 + %19 = OpConstant %7 1 + %2 = OpFunction %5 None %6 + %20 = OpLabel + OpBranch %21 + %21 = OpLabel + %22 = OpPhi %7 %9 %20 %23 %24 + OpLoopMerge %25 %24 None + OpBranch %26 + %26 = OpLabel + %27 = OpSLessThan %11 %22 %10 + OpBranchConditional %27 %28 %25 + %28 = OpLabel + %29 = OpLoad %7 %4 + %30 = OpIAdd %7 %22 %29 + %31 = OpAccessChain %18 %3 %30 + %32 = OpLoad %12 %31 + %33 = OpAccessChain %18 %3 %22 + OpStore %33 %32 + OpBranch %24 + %24 = OpLabel + %23 = OpIAdd %7 %22 %19 + OpBranch %21 + %25 = OpLabel + OpReturn + OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 2); + opt::ScalarEvolutionAnalysis analysis{context.get()}; + + const ir::Instruction* load = nullptr; + for (const ir::Instruction& inst : *spvtest::GetBasicBlock(f, 28)) { + if (inst.opcode() == SpvOp::SpvOpLoad) { + load = &inst; + } + } + + EXPECT_NE(load, nullptr); + + ir::Instruction* access_chain = + context->get_def_use_mgr()->GetDef(load->GetSingleWordInOperand(0)); + + ir::Instruction* child = context->get_def_use_mgr()->GetDef( + access_chain->GetSingleWordInOperand(1)); + // const opt::SENode* node = + // analysis.GetNodeFromInstruction(child->unique_id()); + + const opt::SENode* node = analysis.AnalyzeInstruction(child); + + EXPECT_NE(node, nullptr); + + // Unsimplified node should have the form of ADD(REC(0,1), X) + EXPECT_EQ(node->GetType(), opt::SENode::Add); + + const opt::SENode* child_1 = node->GetChild(0); + EXPECT_TRUE(child_1->GetType() == opt::SENode::ValueUnknown || + child_1->GetType() == opt::SENode::RecurrentAddExpr); + + const opt::SENode* child_2 = node->GetChild(1); + EXPECT_TRUE(child_2->GetType() == opt::SENode::ValueUnknown || + child_2->GetType() == opt::SENode::RecurrentAddExpr); + + opt::SENode* simplified = + analysis.SimplifyExpression(const_cast(node)); + EXPECT_EQ(simplified->GetType(), opt::SENode::RecurrentAddExpr); + + const opt::SERecurrentNode* rec = simplified->AsSERecurrentNode(); + + EXPECT_NE(rec->GetChild(0), rec->GetChild(1)); + + EXPECT_EQ(rec->GetOffset()->GetType(), opt::SENode::ValueUnknown); + + EXPECT_EQ(rec->GetCoefficient()->GetType(), opt::SENode::Constant); + EXPECT_EQ(rec->GetCoefficient()->AsSEConstantNode()->FoldToSingleValue(), 1u); +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 410 core +layout (location = 1) out float array[10]; +layout (location = 2) flat in int loop_invariant; +void main() { + array[0] = array[loop_invariant * 2 + 4 + 5 - 24 - loop_invariant - +loop_invariant+ 16 * 3]; +} + +*/ +TEST_F(ScalarAnalysisTest, SimplifySimple) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 %4 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + OpName %2 "main" + OpName %3 "array" + OpName %4 "loop_invariant" + OpDecorate %3 Location 1 + OpDecorate %4 Flat + OpDecorate %4 Location 2 + %5 = OpTypeVoid + %6 = OpTypeFunction %5 + %7 = OpTypeFloat 32 + %8 = OpTypeInt 32 0 + %9 = OpConstant %8 10 + %10 = OpTypeArray %7 %9 + %11 = OpTypePointer Output %10 + %3 = OpVariable %11 Output + %12 = OpTypeInt 32 1 + %13 = OpConstant %12 0 + %14 = OpTypePointer Input %12 + %4 = OpVariable %14 Input + %15 = OpConstant %12 2 + %16 = OpConstant %12 4 + %17 = OpConstant %12 5 + %18 = OpConstant %12 24 + %19 = OpConstant %12 48 + %20 = OpTypePointer Output %7 + %2 = OpFunction %5 None %6 + %21 = OpLabel + %22 = OpLoad %12 %4 + %23 = OpIMul %12 %22 %15 + %24 = OpIAdd %12 %23 %16 + %25 = OpIAdd %12 %24 %17 + %26 = OpISub %12 %25 %18 + %28 = OpISub %12 %26 %22 + %30 = OpISub %12 %28 %22 + %31 = OpIAdd %12 %30 %19 + %32 = OpAccessChain %20 %3 %31 + %33 = OpLoad %7 %32 + %34 = OpAccessChain %20 %3 %13 + OpStore %34 %33 + OpReturn + OpFunctionEnd + )"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 2); + opt::ScalarEvolutionAnalysis analysis{context.get()}; + + const ir::Instruction* load = nullptr; + for (const ir::Instruction& inst : *spvtest::GetBasicBlock(f, 21)) { + if (inst.opcode() == SpvOp::SpvOpLoad && inst.result_id() == 33) { + load = &inst; + } + } + + EXPECT_NE(load, nullptr); + + ir::Instruction* access_chain = + context->get_def_use_mgr()->GetDef(load->GetSingleWordInOperand(0)); + + ir::Instruction* child = context->get_def_use_mgr()->GetDef( + access_chain->GetSingleWordInOperand(1)); + + const opt::SENode* node = analysis.AnalyzeInstruction(child); + + // Unsimplified is a very large graph with an add at the top. + EXPECT_NE(node, nullptr); + EXPECT_EQ(node->GetType(), opt::SENode::Add); + + // Simplified node should resolve down to a constant expression as the loads + // will eliminate themselves. + opt::SENode* simplified = + analysis.SimplifyExpression(const_cast(node)); + + EXPECT_EQ(simplified->GetType(), opt::SENode::Constant); + EXPECT_EQ(simplified->AsSEConstantNode()->FoldToSingleValue(), 33u); +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 410 core +layout(location = 0) in vec4 c; +layout (location = 1) out float array[10]; +void main() { + int N = int(c.x); + for (int i = 0; i < 10; ++i) { + array[i] = array[i]; + array[i] = array[i-1]; + array[i] = array[i+1]; + array[i+1] = array[i+1]; + array[i+N] = array[i+N]; + array[i] = array[i+N]; + } +} + +*/ +TEST_F(ScalarAnalysisTest, Simplify) { + const std::string text = R"( OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" %12 %33 + OpExecutionMode %4 OriginUpperLeft + OpSource GLSL 410 + OpName %4 "main" + OpName %8 "N" + OpName %12 "c" + OpName %19 "i" + OpName %33 "array" + OpDecorate %12 Location 0 + OpDecorate %33 Location 1 + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeInt 32 1 + %7 = OpTypePointer Function %6 + %9 = OpTypeFloat 32 + %10 = OpTypeVector %9 4 + %11 = OpTypePointer Input %10 + %12 = OpVariable %11 Input + %13 = OpTypeInt 32 0 + %14 = OpConstant %13 0 + %15 = OpTypePointer Input %9 + %20 = OpConstant %6 0 + %27 = OpConstant %6 10 + %28 = OpTypeBool + %30 = OpConstant %13 10 + %31 = OpTypeArray %9 %30 + %32 = OpTypePointer Output %31 + %33 = OpVariable %32 Output + %36 = OpTypePointer Output %9 + %42 = OpConstant %6 1 + %4 = OpFunction %2 None %3 + %5 = OpLabel + %8 = OpVariable %7 Function + %19 = OpVariable %7 Function + %16 = OpAccessChain %15 %12 %14 + %17 = OpLoad %9 %16 + %18 = OpConvertFToS %6 %17 + OpStore %8 %18 + OpStore %19 %20 + OpBranch %21 + %21 = OpLabel + %78 = OpPhi %6 %20 %5 %77 %24 + OpLoopMerge %23 %24 None + OpBranch %25 + %25 = OpLabel + %29 = OpSLessThan %28 %78 %27 + OpBranchConditional %29 %22 %23 + %22 = OpLabel + %37 = OpAccessChain %36 %33 %78 + %38 = OpLoad %9 %37 + %39 = OpAccessChain %36 %33 %78 + OpStore %39 %38 + %43 = OpISub %6 %78 %42 + %44 = OpAccessChain %36 %33 %43 + %45 = OpLoad %9 %44 + %46 = OpAccessChain %36 %33 %78 + OpStore %46 %45 + %49 = OpIAdd %6 %78 %42 + %50 = OpAccessChain %36 %33 %49 + %51 = OpLoad %9 %50 + %52 = OpAccessChain %36 %33 %78 + OpStore %52 %51 + %54 = OpIAdd %6 %78 %42 + %56 = OpIAdd %6 %78 %42 + %57 = OpAccessChain %36 %33 %56 + %58 = OpLoad %9 %57 + %59 = OpAccessChain %36 %33 %54 + OpStore %59 %58 + %62 = OpIAdd %6 %78 %18 + %65 = OpIAdd %6 %78 %18 + %66 = OpAccessChain %36 %33 %65 + %67 = OpLoad %9 %66 + %68 = OpAccessChain %36 %33 %62 + OpStore %68 %67 + %72 = OpIAdd %6 %78 %18 + %73 = OpAccessChain %36 %33 %72 + %74 = OpLoad %9 %73 + %75 = OpAccessChain %36 %33 %78 + OpStore %75 %74 + OpBranch %24 + %24 = OpLabel + %77 = OpIAdd %6 %78 %42 + OpStore %19 %77 + OpBranch %21 + %23 = OpLabel + OpReturn + OpFunctionEnd +)"; + // clang-format on + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 4); + opt::ScalarEvolutionAnalysis analysis{context.get()}; + + const ir::Instruction* loads[6]; + const ir::Instruction* stores[6]; + int load_count = 0; + int store_count = 0; + + for (const ir::Instruction& inst : *spvtest::GetBasicBlock(f, 22)) { + if (inst.opcode() == SpvOp::SpvOpLoad) { + loads[load_count] = &inst; + ++load_count; + } + if (inst.opcode() == SpvOp::SpvOpStore) { + stores[store_count] = &inst; + ++store_count; + } + } + + EXPECT_EQ(load_count, 6); + EXPECT_EQ(store_count, 6); + + ir::Instruction* load_access_chain; + ir::Instruction* store_access_chain; + ir::Instruction* load_child; + ir::Instruction* store_child; + opt::SENode* load_node; + opt::SENode* store_node; + opt::SENode* subtract_node; + opt::SENode* simplified_node; + + // Testing [i] - [i] == 0 + load_access_chain = + context->get_def_use_mgr()->GetDef(loads[0]->GetSingleWordInOperand(0)); + store_access_chain = + context->get_def_use_mgr()->GetDef(stores[0]->GetSingleWordInOperand(0)); + + load_child = context->get_def_use_mgr()->GetDef( + load_access_chain->GetSingleWordInOperand(1)); + store_child = context->get_def_use_mgr()->GetDef( + store_access_chain->GetSingleWordInOperand(1)); + + load_node = analysis.AnalyzeInstruction(load_child); + store_node = analysis.AnalyzeInstruction(store_child); + + subtract_node = analysis.CreateSubtraction(store_node, load_node); + simplified_node = analysis.SimplifyExpression(subtract_node); + EXPECT_EQ(simplified_node->GetType(), opt::SENode::Constant); + EXPECT_EQ(simplified_node->AsSEConstantNode()->FoldToSingleValue(), 0u); + + // Testing [i] - [i-1] == 1 + load_access_chain = + context->get_def_use_mgr()->GetDef(loads[1]->GetSingleWordInOperand(0)); + store_access_chain = + context->get_def_use_mgr()->GetDef(stores[1]->GetSingleWordInOperand(0)); + + load_child = context->get_def_use_mgr()->GetDef( + load_access_chain->GetSingleWordInOperand(1)); + store_child = context->get_def_use_mgr()->GetDef( + store_access_chain->GetSingleWordInOperand(1)); + + load_node = analysis.AnalyzeInstruction(load_child); + store_node = analysis.AnalyzeInstruction(store_child); + + subtract_node = analysis.CreateSubtraction(store_node, load_node); + simplified_node = analysis.SimplifyExpression(subtract_node); + + EXPECT_EQ(simplified_node->GetType(), opt::SENode::Constant); + EXPECT_EQ(simplified_node->AsSEConstantNode()->FoldToSingleValue(), 1u); + + // Testing [i] - [i+1] == -1 + load_access_chain = + context->get_def_use_mgr()->GetDef(loads[2]->GetSingleWordInOperand(0)); + store_access_chain = + context->get_def_use_mgr()->GetDef(stores[2]->GetSingleWordInOperand(0)); + + load_child = context->get_def_use_mgr()->GetDef( + load_access_chain->GetSingleWordInOperand(1)); + store_child = context->get_def_use_mgr()->GetDef( + store_access_chain->GetSingleWordInOperand(1)); + + load_node = analysis.AnalyzeInstruction(load_child); + store_node = analysis.AnalyzeInstruction(store_child); + + subtract_node = analysis.CreateSubtraction(store_node, load_node); + simplified_node = analysis.SimplifyExpression(subtract_node); + EXPECT_EQ(simplified_node->GetType(), opt::SENode::Constant); + EXPECT_EQ(simplified_node->AsSEConstantNode()->FoldToSingleValue(), -1); + + // Testing [i+1] - [i+1] == 0 + load_access_chain = + context->get_def_use_mgr()->GetDef(loads[3]->GetSingleWordInOperand(0)); + store_access_chain = + context->get_def_use_mgr()->GetDef(stores[3]->GetSingleWordInOperand(0)); + + load_child = context->get_def_use_mgr()->GetDef( + load_access_chain->GetSingleWordInOperand(1)); + store_child = context->get_def_use_mgr()->GetDef( + store_access_chain->GetSingleWordInOperand(1)); + + load_node = analysis.AnalyzeInstruction(load_child); + store_node = analysis.AnalyzeInstruction(store_child); + + subtract_node = analysis.CreateSubtraction(store_node, load_node); + simplified_node = analysis.SimplifyExpression(subtract_node); + EXPECT_EQ(simplified_node->GetType(), opt::SENode::Constant); + EXPECT_EQ(simplified_node->AsSEConstantNode()->FoldToSingleValue(), 0u); + + // Testing [i+N] - [i+N] == 0 + load_access_chain = + context->get_def_use_mgr()->GetDef(loads[4]->GetSingleWordInOperand(0)); + store_access_chain = + context->get_def_use_mgr()->GetDef(stores[4]->GetSingleWordInOperand(0)); + + load_child = context->get_def_use_mgr()->GetDef( + load_access_chain->GetSingleWordInOperand(1)); + store_child = context->get_def_use_mgr()->GetDef( + store_access_chain->GetSingleWordInOperand(1)); + + load_node = analysis.AnalyzeInstruction(load_child); + store_node = analysis.AnalyzeInstruction(store_child); + + subtract_node = analysis.CreateSubtraction(store_node, load_node); + + simplified_node = analysis.SimplifyExpression(subtract_node); + EXPECT_EQ(simplified_node->GetType(), opt::SENode::Constant); + EXPECT_EQ(simplified_node->AsSEConstantNode()->FoldToSingleValue(), 0u); + + // Testing [i] - [i+N] == -N + load_access_chain = + context->get_def_use_mgr()->GetDef(loads[5]->GetSingleWordInOperand(0)); + store_access_chain = + context->get_def_use_mgr()->GetDef(stores[5]->GetSingleWordInOperand(0)); + + load_child = context->get_def_use_mgr()->GetDef( + load_access_chain->GetSingleWordInOperand(1)); + store_child = context->get_def_use_mgr()->GetDef( + store_access_chain->GetSingleWordInOperand(1)); + + load_node = analysis.AnalyzeInstruction(load_child); + store_node = analysis.AnalyzeInstruction(store_child); + + subtract_node = analysis.CreateSubtraction(store_node, load_node); + simplified_node = analysis.SimplifyExpression(subtract_node); + EXPECT_EQ(simplified_node->GetType(), opt::SENode::Negative); +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 430 +layout(location = 1) out float array[10]; +layout(location = 2) flat in int loop_invariant; +void main(void) { + for (int i = 0; i < 10; ++i) { + array[i * 2 + i * 5] = array[i * i * 2]; + array[i * 2] = array[i * 5]; + } +} + +*/ + +TEST_F(ScalarAnalysisTest, SimplifyMultiplyInductions) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 %4 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + OpName %2 "main" + OpName %5 "i" + OpName %3 "array" + OpName %4 "loop_invariant" + OpDecorate %3 Location 1 + OpDecorate %4 Flat + OpDecorate %4 Location 2 + %6 = OpTypeVoid + %7 = OpTypeFunction %6 + %8 = OpTypeInt 32 1 + %9 = OpTypePointer Function %8 + %10 = OpConstant %8 0 + %11 = OpConstant %8 10 + %12 = OpTypeBool + %13 = OpTypeFloat 32 + %14 = OpTypeInt 32 0 + %15 = OpConstant %14 10 + %16 = OpTypeArray %13 %15 + %17 = OpTypePointer Output %16 + %3 = OpVariable %17 Output + %18 = OpConstant %8 2 + %19 = OpConstant %8 5 + %20 = OpTypePointer Output %13 + %21 = OpConstant %8 1 + %22 = OpTypePointer Input %8 + %4 = OpVariable %22 Input + %2 = OpFunction %6 None %7 + %23 = OpLabel + %5 = OpVariable %9 Function + OpStore %5 %10 + OpBranch %24 + %24 = OpLabel + %25 = OpPhi %8 %10 %23 %26 %27 + OpLoopMerge %28 %27 None + OpBranch %29 + %29 = OpLabel + %30 = OpSLessThan %12 %25 %11 + OpBranchConditional %30 %31 %28 + %31 = OpLabel + %32 = OpIMul %8 %25 %18 + %33 = OpIMul %8 %25 %19 + %34 = OpIAdd %8 %32 %33 + %35 = OpIMul %8 %25 %25 + %36 = OpIMul %8 %35 %18 + %37 = OpAccessChain %20 %3 %36 + %38 = OpLoad %13 %37 + %39 = OpAccessChain %20 %3 %34 + OpStore %39 %38 + %40 = OpIMul %8 %25 %18 + %41 = OpIMul %8 %25 %19 + %42 = OpAccessChain %20 %3 %41 + %43 = OpLoad %13 %42 + %44 = OpAccessChain %20 %3 %40 + OpStore %44 %43 + OpBranch %27 + %27 = OpLabel + %26 = OpIAdd %8 %25 %21 + OpStore %5 %26 + OpBranch %24 + %28 = OpLabel + OpReturn + OpFunctionEnd + )"; + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 2); + opt::ScalarEvolutionAnalysis analysis{context.get()}; + + const ir::Instruction* loads[2] = {nullptr, nullptr}; + const ir::Instruction* stores[2] = {nullptr, nullptr}; + int load_count = 0; + int store_count = 0; + + for (const ir::Instruction& inst : *spvtest::GetBasicBlock(f, 31)) { + if (inst.opcode() == SpvOp::SpvOpLoad) { + loads[load_count] = &inst; + ++load_count; + } + if (inst.opcode() == SpvOp::SpvOpStore) { + stores[store_count] = &inst; + ++store_count; + } + } + + EXPECT_EQ(load_count, 2); + EXPECT_EQ(store_count, 2); + + ir::Instruction* load_access_chain = + context->get_def_use_mgr()->GetDef(loads[0]->GetSingleWordInOperand(0)); + ir::Instruction* store_access_chain = + context->get_def_use_mgr()->GetDef(stores[0]->GetSingleWordInOperand(0)); + + ir::Instruction* load_child = context->get_def_use_mgr()->GetDef( + load_access_chain->GetSingleWordInOperand(1)); + ir::Instruction* store_child = context->get_def_use_mgr()->GetDef( + store_access_chain->GetSingleWordInOperand(1)); + + opt::SENode* store_node = analysis.AnalyzeInstruction(store_child); + + opt::SENode* store_simplified = analysis.SimplifyExpression(store_node); + + load_access_chain = + context->get_def_use_mgr()->GetDef(loads[1]->GetSingleWordInOperand(0)); + store_access_chain = + context->get_def_use_mgr()->GetDef(stores[1]->GetSingleWordInOperand(0)); + load_child = context->get_def_use_mgr()->GetDef( + load_access_chain->GetSingleWordInOperand(1)); + store_child = context->get_def_use_mgr()->GetDef( + store_access_chain->GetSingleWordInOperand(1)); + + opt::SENode* second_store = + analysis.SimplifyExpression(analysis.AnalyzeInstruction(store_child)); + opt::SENode* second_load = + analysis.SimplifyExpression(analysis.AnalyzeInstruction(load_child)); + opt::SENode* combined_add = analysis.SimplifyExpression( + analysis.CreateAddNode(second_load, second_store)); + + // We're checking that the two recurrent expression have been correctly + // folded. In store_simplified they will have been folded as the entire + // expression was simplified as one. In combined_add the two expressions have + // been simplified one after the other which means the recurrent expressions + // aren't exactly the same but should still be folded as they are with respect + // to the same loop. + EXPECT_EQ(combined_add, store_simplified); +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 430 +void main(void) { + for (int i = 0; i < 10; --i) { + array[i] = array[i]; + } +} + +*/ + +TEST_F(ScalarAnalysisTest, SimplifyNegativeSteps) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 %4 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + OpName %2 "main" + OpName %5 "i" + OpName %3 "array" + OpName %4 "loop_invariant" + OpDecorate %3 Location 1 + OpDecorate %4 Flat + OpDecorate %4 Location 2 + %6 = OpTypeVoid + %7 = OpTypeFunction %6 + %8 = OpTypeInt 32 1 + %9 = OpTypePointer Function %8 + %10 = OpConstant %8 0 + %11 = OpConstant %8 10 + %12 = OpTypeBool + %13 = OpTypeFloat 32 + %14 = OpTypeInt 32 0 + %15 = OpConstant %14 10 + %16 = OpTypeArray %13 %15 + %17 = OpTypePointer Output %16 + %3 = OpVariable %17 Output + %18 = OpTypePointer Output %13 + %19 = OpConstant %8 1 + %20 = OpTypePointer Input %8 + %4 = OpVariable %20 Input + %2 = OpFunction %6 None %7 + %21 = OpLabel + %5 = OpVariable %9 Function + OpStore %5 %10 + OpBranch %22 + %22 = OpLabel + %23 = OpPhi %8 %10 %21 %24 %25 + OpLoopMerge %26 %25 None + OpBranch %27 + %27 = OpLabel + %28 = OpSLessThan %12 %23 %11 + OpBranchConditional %28 %29 %26 + %29 = OpLabel + %30 = OpAccessChain %18 %3 %23 + %31 = OpLoad %13 %30 + %32 = OpAccessChain %18 %3 %23 + OpStore %32 %31 + OpBranch %25 + %25 = OpLabel + %24 = OpISub %8 %23 %19 + OpStore %5 %24 + OpBranch %22 + %26 = OpLabel + OpReturn + OpFunctionEnd + )"; + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 2); + opt::ScalarEvolutionAnalysis analysis{context.get()}; + + const ir::Instruction* loads[1] = {nullptr}; + int load_count = 0; + + for (const ir::Instruction& inst : *spvtest::GetBasicBlock(f, 29)) { + if (inst.opcode() == SpvOp::SpvOpLoad) { + loads[load_count] = &inst; + ++load_count; + } + } + + EXPECT_EQ(load_count, 1); + + ir::Instruction* load_access_chain = + context->get_def_use_mgr()->GetDef(loads[0]->GetSingleWordInOperand(0)); + ir::Instruction* load_child = context->get_def_use_mgr()->GetDef( + load_access_chain->GetSingleWordInOperand(1)); + + opt::SENode* load_node = analysis.AnalyzeInstruction(load_child); + + EXPECT_TRUE(load_node); + EXPECT_EQ(load_node->GetType(), opt::SENode::RecurrentAddExpr); + EXPECT_TRUE(load_node->AsSERecurrentNode()); + + opt::SENode* child_1 = load_node->AsSERecurrentNode()->GetCoefficient(); + opt::SENode* child_2 = load_node->AsSERecurrentNode()->GetOffset(); + + EXPECT_EQ(child_1->GetType(), opt::SENode::Constant); + EXPECT_EQ(child_2->GetType(), opt::SENode::Constant); + + EXPECT_EQ(child_1->AsSEConstantNode()->FoldToSingleValue(), -1); + EXPECT_EQ(child_2->AsSEConstantNode()->FoldToSingleValue(), 0u); + + opt::SERecurrentNode* load_simplified = + analysis.SimplifyExpression(load_node)->AsSERecurrentNode(); + + EXPECT_TRUE(load_simplified); + EXPECT_EQ(load_node, load_simplified); + + EXPECT_EQ(load_simplified->GetType(), opt::SENode::RecurrentAddExpr); + EXPECT_TRUE(load_simplified->AsSERecurrentNode()); + + opt::SENode* simplified_child_1 = + load_simplified->AsSERecurrentNode()->GetCoefficient(); + opt::SENode* simplified_child_2 = + load_simplified->AsSERecurrentNode()->GetOffset(); + + EXPECT_EQ(child_1, simplified_child_1); + EXPECT_EQ(child_2, simplified_child_2); +} + +/* +Generated from the following GLSL + --eliminate-local-multi-store + +#version 430 +void main(void) { + for (int i = 0; i < 10; --i) { + array[i] = array[i]; + } +} + +*/ + +TEST_F(ScalarAnalysisTest, SimplifyInductionsAndLoads) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 %4 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + OpName %2 "main" + OpName %5 "i" + OpName %3 "array" + OpName %4 "N" + OpDecorate %3 Location 1 + OpDecorate %4 Flat + OpDecorate %4 Location 2 + %6 = OpTypeVoid + %7 = OpTypeFunction %6 + %8 = OpTypeInt 32 1 + %9 = OpTypePointer Function %8 + %10 = OpConstant %8 0 + %11 = OpConstant %8 10 + %12 = OpTypeBool + %13 = OpTypeFloat 32 + %14 = OpTypeInt 32 0 + %15 = OpConstant %14 10 + %16 = OpTypeArray %13 %15 + %17 = OpTypePointer Output %16 + %3 = OpVariable %17 Output + %18 = OpConstant %8 2 + %19 = OpTypePointer Input %8 + %4 = OpVariable %19 Input + %20 = OpTypePointer Output %13 + %21 = OpConstant %8 1 + %2 = OpFunction %6 None %7 + %22 = OpLabel + %5 = OpVariable %9 Function + OpStore %5 %10 + OpBranch %23 + %23 = OpLabel + %24 = OpPhi %8 %10 %22 %25 %26 + OpLoopMerge %27 %26 None + OpBranch %28 + %28 = OpLabel + %29 = OpSLessThan %12 %24 %11 + OpBranchConditional %29 %30 %27 + %30 = OpLabel + %31 = OpLoad %8 %4 + %32 = OpIMul %8 %18 %31 + %33 = OpIAdd %8 %24 %32 + %35 = OpIAdd %8 %24 %31 + %36 = OpAccessChain %20 %3 %35 + %37 = OpLoad %13 %36 + %38 = OpAccessChain %20 %3 %33 + OpStore %38 %37 + %39 = OpIMul %8 %18 %24 + %41 = OpIMul %8 %18 %31 + %42 = OpIAdd %8 %39 %41 + %43 = OpIAdd %8 %42 %21 + %44 = OpIMul %8 %18 %24 + %46 = OpIAdd %8 %44 %31 + %47 = OpIAdd %8 %46 %21 + %48 = OpAccessChain %20 %3 %47 + %49 = OpLoad %13 %48 + %50 = OpAccessChain %20 %3 %43 + OpStore %50 %49 + OpBranch %26 + %26 = OpLabel + %25 = OpISub %8 %24 %21 + OpStore %5 %25 + OpBranch %23 + %27 = OpLabel + OpReturn + OpFunctionEnd + )"; + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 2); + opt::ScalarEvolutionAnalysis analysis{context.get()}; + + std::vector loads{}; + std::vector stores{}; + + for (const ir::Instruction& inst : *spvtest::GetBasicBlock(f, 30)) { + if (inst.opcode() == SpvOp::SpvOpLoad) { + loads.push_back(&inst); + } + if (inst.opcode() == SpvOp::SpvOpStore) { + stores.push_back(&inst); + } + } + + EXPECT_EQ(loads.size(), 3u); + EXPECT_EQ(stores.size(), 2u); + { + ir::Instruction* store_access_chain = context->get_def_use_mgr()->GetDef( + stores[0]->GetSingleWordInOperand(0)); + + ir::Instruction* store_child = context->get_def_use_mgr()->GetDef( + store_access_chain->GetSingleWordInOperand(1)); + + opt::SENode* store_node = analysis.AnalyzeInstruction(store_child); + + opt::SENode* store_simplified = analysis.SimplifyExpression(store_node); + + ir::Instruction* load_access_chain = + context->get_def_use_mgr()->GetDef(loads[1]->GetSingleWordInOperand(0)); + + ir::Instruction* load_child = context->get_def_use_mgr()->GetDef( + load_access_chain->GetSingleWordInOperand(1)); + + opt::SENode* load_node = analysis.AnalyzeInstruction(load_child); + + opt::SENode* load_simplified = analysis.SimplifyExpression(load_node); + + opt::SENode* difference = + analysis.CreateSubtraction(store_simplified, load_simplified); + + opt::SENode* difference_simplified = + analysis.SimplifyExpression(difference); + + // Check that i+2*N - i*N, turns into just N when both sides have already + // been simplified into a single recurrent expression. + EXPECT_EQ(difference_simplified->GetType(), opt::SENode::ValueUnknown); + + // Check that the inverse, i*N - i+2*N turns into -N. + opt::SENode* difference_inverse = analysis.SimplifyExpression( + analysis.CreateSubtraction(load_simplified, store_simplified)); + + EXPECT_EQ(difference_inverse->GetType(), opt::SENode::Negative); + EXPECT_EQ(difference_inverse->GetChild(0)->GetType(), + opt::SENode::ValueUnknown); + EXPECT_EQ(difference_inverse->GetChild(0), difference_simplified); + } + + { + ir::Instruction* store_access_chain = context->get_def_use_mgr()->GetDef( + stores[1]->GetSingleWordInOperand(0)); + + ir::Instruction* store_child = context->get_def_use_mgr()->GetDef( + store_access_chain->GetSingleWordInOperand(1)); + opt::SENode* store_node = analysis.AnalyzeInstruction(store_child); + opt::SENode* store_simplified = analysis.SimplifyExpression(store_node); + + ir::Instruction* load_access_chain = + context->get_def_use_mgr()->GetDef(loads[2]->GetSingleWordInOperand(0)); + + ir::Instruction* load_child = context->get_def_use_mgr()->GetDef( + load_access_chain->GetSingleWordInOperand(1)); + + opt::SENode* load_node = analysis.AnalyzeInstruction(load_child); + + opt::SENode* load_simplified = analysis.SimplifyExpression(load_node); + + opt::SENode* difference = + analysis.CreateSubtraction(store_simplified, load_simplified); + opt::SENode* difference_simplified = + analysis.SimplifyExpression(difference); + + // Check that 2*i + 2*N + 1 - 2*i + N + 1, turns into just N when both + // sides have already been simplified into a single recurrent expression. + EXPECT_EQ(difference_simplified->GetType(), opt::SENode::ValueUnknown); + + // Check that the inverse, (2*i + N + 1) - (2*i + 2*N + 1) turns into -N. + opt::SENode* difference_inverse = analysis.SimplifyExpression( + analysis.CreateSubtraction(load_simplified, store_simplified)); + + EXPECT_EQ(difference_inverse->GetType(), opt::SENode::Negative); + EXPECT_EQ(difference_inverse->GetChild(0)->GetType(), + opt::SENode::ValueUnknown); + EXPECT_EQ(difference_inverse->GetChild(0), difference_simplified); + } +} + +/* Generated from the following GLSL + --eliminate-local-multi-store + + #version 430 + layout(location = 1) out float array[10]; + layout(location = 2) flat in int N; + void main(void) { + int step = 0; + for (int i = 0; i < N; i += step) { + step++; + } + } +*/ +TEST_F(ScalarAnalysisTest, InductionWithVariantStep) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" %3 %4 + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + OpName %2 "main" + OpName %5 "step" + OpName %6 "i" + OpName %3 "N" + OpName %4 "array" + OpDecorate %3 Flat + OpDecorate %3 Location 2 + OpDecorate %4 Location 1 + %7 = OpTypeVoid + %8 = OpTypeFunction %7 + %9 = OpTypeInt 32 1 + %10 = OpTypePointer Function %9 + %11 = OpConstant %9 0 + %12 = OpTypePointer Input %9 + %3 = OpVariable %12 Input + %13 = OpTypeBool + %14 = OpConstant %9 1 + %15 = OpTypeFloat 32 + %16 = OpTypeInt 32 0 + %17 = OpConstant %16 10 + %18 = OpTypeArray %15 %17 + %19 = OpTypePointer Output %18 + %4 = OpVariable %19 Output + %2 = OpFunction %7 None %8 + %20 = OpLabel + %5 = OpVariable %10 Function + %6 = OpVariable %10 Function + OpStore %5 %11 + OpStore %6 %11 + OpBranch %21 + %21 = OpLabel + %22 = OpPhi %9 %11 %20 %23 %24 + %25 = OpPhi %9 %11 %20 %26 %24 + OpLoopMerge %27 %24 None + OpBranch %28 + %28 = OpLabel + %29 = OpLoad %9 %3 + %30 = OpSLessThan %13 %25 %29 + OpBranchConditional %30 %31 %27 + %31 = OpLabel + %23 = OpIAdd %9 %22 %14 + OpStore %5 %23 + OpBranch %24 + %24 = OpLabel + %26 = OpIAdd %9 %25 %23 + OpStore %6 %26 + OpBranch %21 + %27 = OpLabel + OpReturn + OpFunctionEnd + )"; + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + ir::Module* module = context->module(); + EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" + << text << std::endl; + const ir::Function* f = spvtest::GetFunction(module, 2); + opt::ScalarEvolutionAnalysis analysis{context.get()}; + + std::vector phis{}; + + for (const ir::Instruction& inst : *spvtest::GetBasicBlock(f, 21)) { + if (inst.opcode() == SpvOp::SpvOpPhi) { + phis.push_back(&inst); + } + } + + EXPECT_EQ(phis.size(), 2u); + opt::SENode* phi_node_1 = analysis.AnalyzeInstruction(phis[0]); + opt::SENode* phi_node_2 = analysis.AnalyzeInstruction(phis[1]); + phi_node_1->DumpDot(std::cout, true); + EXPECT_NE(phi_node_1, nullptr); + EXPECT_NE(phi_node_2, nullptr); + + EXPECT_EQ(phi_node_1->GetType(), opt::SENode::RecurrentAddExpr); + EXPECT_EQ(phi_node_2->GetType(), opt::SENode::CanNotCompute); + + opt::SENode* simplified_1 = analysis.SimplifyExpression(phi_node_1); + opt::SENode* simplified_2 = analysis.SimplifyExpression(phi_node_2); + + EXPECT_EQ(simplified_1->GetType(), opt::SENode::RecurrentAddExpr); + EXPECT_EQ(simplified_2->GetType(), opt::SENode::CanNotCompute); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/scalar_replacement_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/scalar_replacement_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/scalar_replacement_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/scalar_replacement_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1273 @@ +// Copyright (c) 2017 Google 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. + +#include "assembly_builder.h" +#include "gmock/gmock.h" +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using ScalarReplacementTest = PassTest<::testing::Test>; + +// TODO(dneto): Add Effcee as required dependency, and make this unconditional. +#ifdef SPIRV_EFFCEE +TEST_F(ScalarReplacementTest, SimpleStruct) { + const std::string text = R"( +; +; CHECK: [[struct:%\w+]] = OpTypeStruct [[elem:%\w+]] +; CHECK: [[struct_ptr:%\w+]] = OpTypePointer Function [[struct]] +; CHECK: [[elem_ptr:%\w+]] = OpTypePointer Function [[elem]] +; CHECK: OpConstantNull [[struct]] +; CHECK: [[null:%\w+]] = OpConstantNull [[elem]] +; CHECK-NOT: OpVariable [[struct_ptr]] +; CHECK: [[one:%\w+]] = OpVariable [[elem_ptr]] Function [[null]] +; CHECK-NEXT: [[two:%\w+]] = OpVariable [[elem_ptr]] Function [[null]] +; CHECK-NOT: OpVariable [[elem_ptr]] Function [[null]] +; CHECK-NOT: OpVariable [[struct_ptr]] +; CHECK-NOT: OpInBoundsAccessChain +; CHECK: [[l1:%\w+]] = OpLoad [[elem]] [[two]] +; CHECK-NOT: OpAccessChain +; CHECK: [[l2:%\w+]] = OpLoad [[elem]] [[one]] +; CHECK: OpIAdd [[elem]] [[l1]] [[l2]] +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %6 "simple_struct" +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeStruct %2 %2 %2 %2 +%4 = OpTypePointer Function %3 +%5 = OpTypePointer Function %2 +%6 = OpTypeFunction %2 +%7 = OpConstantNull %3 +%8 = OpConstant %2 0 +%9 = OpConstant %2 1 +%10 = OpConstant %2 2 +%11 = OpConstant %2 3 +%12 = OpFunction %2 None %6 +%13 = OpLabel +%14 = OpVariable %4 Function %7 +%15 = OpInBoundsAccessChain %5 %14 %8 +%16 = OpLoad %2 %15 +%17 = OpAccessChain %5 %14 %10 +%18 = OpLoad %2 %17 +%19 = OpIAdd %2 %16 %18 +OpReturnValue %19 +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, StructInitialization) { + const std::string text = R"( +; +; CHECK: [[elem:%\w+]] = OpTypeInt 32 0 +; CHECK: [[struct:%\w+]] = OpTypeStruct [[elem]] [[elem]] [[elem]] [[elem]] +; CHECK: [[struct_ptr:%\w+]] = OpTypePointer Function [[struct]] +; CHECK: [[elem_ptr:%\w+]] = OpTypePointer Function [[elem]] +; CHECK: [[zero:%\w+]] = OpConstant [[elem]] 0 +; CHECK: [[undef:%\w+]] = OpUndef [[elem]] +; CHECK: [[two:%\w+]] = OpConstant [[elem]] 2 +; CHECK: [[null:%\w+]] = OpConstantNull [[elem]] +; CHECK-NOT: OpVariable [[struct_ptr]] +; CHECK: OpVariable [[elem_ptr]] Function [[null]] +; CHECK-NEXT: OpVariable [[elem_ptr]] Function [[two]] +; CHECK-NOT: OpVariable [[elem_ptr]] Function [[undef]] +; CHECK-NEXT: OpVariable [[elem_ptr]] Function +; CHECK-NEXT: OpVariable [[elem_ptr]] Function [[zero]] +; CHECK-NOT: OpVariable [[elem_ptr]] Function [[undef]] +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %6 "struct_init" +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeStruct %2 %2 %2 %2 +%4 = OpTypePointer Function %3 +%20 = OpTypePointer Function %2 +%6 = OpTypeFunction %1 +%7 = OpConstant %2 0 +%8 = OpUndef %2 +%9 = OpConstant %2 2 +%30 = OpConstant %2 1 +%31 = OpConstant %2 3 +%10 = OpConstantNull %2 +%11 = OpConstantComposite %3 %7 %8 %9 %10 +%12 = OpFunction %1 None %6 +%13 = OpLabel +%14 = OpVariable %4 Function %11 +%15 = OpAccessChain %20 %14 %7 +OpStore %15 %10 +%16 = OpAccessChain %20 %14 %9 +OpStore %16 %10 +%17 = OpAccessChain %20 %14 %30 +OpStore %17 %10 +%18 = OpAccessChain %20 %14 %31 +OpStore %18 %10 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, SpecConstantInitialization) { + const std::string text = R"( +; +; CHECK: [[int:%\w+]] = OpTypeInt 32 0 +; CHECK: [[struct:%\w+]] = OpTypeStruct [[int]] [[int]] +; CHECK: [[struct_ptr:%\w+]] = OpTypePointer Function [[struct]] +; CHECK: [[int_ptr:%\w+]] = OpTypePointer Function [[int]] +; CHECK: [[spec_comp:%\w+]] = OpSpecConstantComposite [[struct]] +; CHECK: [[ex0:%\w+]] = OpSpecConstantOp [[int]] CompositeExtract [[spec_comp]] 0 +; CHECK: [[ex1:%\w+]] = OpSpecConstantOp [[int]] CompositeExtract [[spec_comp]] 1 +; CHECK-NOT: OpVariable [[struct]] +; CHECK: OpVariable [[int_ptr]] Function [[ex1]] +; CHECK-NEXT: OpVariable [[int_ptr]] Function [[ex0]] +; CHECK-NOT: OpVariable [[struct]] +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %6 "spec_const" +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeStruct %2 %2 +%4 = OpTypePointer Function %3 +%20 = OpTypePointer Function %2 +%5 = OpTypeFunction %1 +%6 = OpConstant %2 0 +%30 = OpConstant %2 1 +%7 = OpSpecConstant %2 0 +%8 = OpSpecConstantOp %2 IAdd %7 %7 +%9 = OpSpecConstantComposite %3 %7 %8 +%10 = OpFunction %1 None %5 +%11 = OpLabel +%12 = OpVariable %4 Function %9 +%13 = OpAccessChain %20 %12 %6 +%14 = OpLoad %2 %13 +%15 = OpAccessChain %20 %12 %30 +%16 = OpLoad %2 %15 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +// TODO(alanbaker): Re-enable when vector and matrix scalarization is supported. +// TEST_F(ScalarReplacementTest, VectorInitialization) { +// const std::string text = R"( +//; +//; CHECK: [[elem:%\w+]] = OpTypeInt 32 0 +//; CHECK: [[vector:%\w+]] = OpTypeVector [[elem]] 4 +//; CHECK: [[vector_ptr:%\w+]] = OpTypePointer Function [[vector]] +//; CHECK: [[elem_ptr:%\w+]] = OpTypePointer Function [[elem]] +//; CHECK: [[zero:%\w+]] = OpConstant [[elem]] 0 +//; CHECK: [[undef:%\w+]] = OpUndef [[elem]] +//; CHECK: [[two:%\w+]] = OpConstant [[elem]] 2 +//; CHECK: [[null:%\w+]] = OpConstantNull [[elem]] +//; CHECK-NOT: OpVariable [[vector_ptr]] +//; CHECK: OpVariable [[elem_ptr]] Function [[zero]] +//; CHECK-NOT: OpVariable [[elem_ptr]] Function [[undef]] +//; CHECK-NEXT: OpVariable [[elem_ptr]] Function +//; CHECK-NEXT: OpVariable [[elem_ptr]] Function [[two]] +//; CHECK-NEXT: OpVariable [[elem_ptr]] Function [[null]] +//; CHECK-NOT: OpVariable [[elem_ptr]] Function [[undef]] +//; +// OpCapability Shader +// OpCapability Linkage +// OpMemoryModel Logical GLSL450 +// OpName %6 "vector_init" +//%1 = OpTypeVoid +//%2 = OpTypeInt 32 0 +//%3 = OpTypeVector %2 4 +//%4 = OpTypePointer Function %3 +//%20 = OpTypePointer Function %2 +//%6 = OpTypeFunction %1 +//%7 = OpConstant %2 0 +//%8 = OpUndef %2 +//%9 = OpConstant %2 2 +//%30 = OpConstant %2 1 +//%31 = OpConstant %2 3 +//%10 = OpConstantNull %2 +//%11 = OpConstantComposite %3 %10 %9 %8 %7 +//%12 = OpFunction %1 None %6 +//%13 = OpLabel +//%14 = OpVariable %4 Function %11 +//%15 = OpAccessChain %20 %14 %7 +// OpStore %15 %10 +//%16 = OpAccessChain %20 %14 %9 +// OpStore %16 %10 +//%17 = OpAccessChain %20 %14 %30 +// OpStore %17 %10 +//%18 = OpAccessChain %20 %14 %31 +// OpStore %18 %10 +// OpReturn +// OpFunctionEnd +// )"; +// +// SinglePassRunAndMatch(text, true); +//} +// +// TEST_F(ScalarReplacementTest, MatrixInitialization) { +// const std::string text = R"( +//; +//; CHECK: [[float:%\w+]] = OpTypeFloat 32 +//; CHECK: [[vector:%\w+]] = OpTypeVector [[float]] 2 +//; CHECK: [[matrix:%\w+]] = OpTypeMatrix [[vector]] 2 +//; CHECK: [[matrix_ptr:%\w+]] = OpTypePointer Function [[matrix]] +//; CHECK: [[float_ptr:%\w+]] = OpTypePointer Function [[float]] +//; CHECK: [[vec_ptr:%\w+]] = OpTypePointer Function [[vector]] +//; CHECK: [[zerof:%\w+]] = OpConstant [[float]] 0 +//; CHECK: [[onef:%\w+]] = OpConstant [[float]] 1 +//; CHECK: [[one_zero:%\w+]] = OpConstantComposite [[vector]] [[onef]] [[zerof]] +//; CHECK: [[zero_one:%\w+]] = OpConstantComposite [[vector]] [[zerof]] [[onef]] +//; CHECK: [[const_mat:%\w+]] = OpConstantComposite [[matrix]] [[one_zero]] +//[[zero_one]] ; CHECK-NOT: OpVariable [[matrix]] ; CHECK-NOT: OpVariable +//[[vector]] Function [[one_zero]] ; CHECK: [[f1:%\w+]] = OpVariable +//[[float_ptr]] Function [[zerof]] ; CHECK-NEXT: [[f2:%\w+]] = OpVariable +//[[float_ptr]] Function [[onef]] ; CHECK-NEXT: [[vec_var:%\w+]] = OpVariable +//[[vec_ptr]] Function [[zero_one]] ; CHECK-NOT: OpVariable [[matrix]] ; +// CHECK-NOT: OpVariable [[vector]] Function [[one_zero]] +//; +// OpCapability Shader +// OpCapability Linkage +// OpMemoryModel Logical GLSL450 +// OpName %7 "matrix_init" +//%1 = OpTypeVoid +//%2 = OpTypeFloat 32 +//%3 = OpTypeVector %2 2 +//%4 = OpTypeMatrix %3 2 +//%5 = OpTypePointer Function %4 +//%6 = OpTypePointer Function %2 +//%30 = OpTypePointer Function %3 +//%10 = OpTypeInt 32 0 +//%7 = OpTypeFunction %1 %10 +//%8 = OpConstant %2 0.0 +//%9 = OpConstant %2 1.0 +//%11 = OpConstant %10 0 +//%12 = OpConstant %10 1 +//%13 = OpConstantComposite %3 %9 %8 +//%14 = OpConstantComposite %3 %8 %9 +//%15 = OpConstantComposite %4 %13 %14 +//%16 = OpFunction %1 None %7 +//%31 = OpFunctionParameter %10 +//%17 = OpLabel +//%18 = OpVariable %5 Function %15 +//%19 = OpAccessChain %6 %18 %11 %12 +// OpStore %19 %8 +//%20 = OpAccessChain %6 %18 %11 %11 +// OpStore %20 %8 +//%21 = OpAccessChain %30 %18 %12 +// OpStore %21 %14 +// OpReturn +// OpFunctionEnd +// )"; +// +// SinglePassRunAndMatch(text, true); +//} + +TEST_F(ScalarReplacementTest, ElideAccessChain) { + const std::string text = R"( +; +; CHECK: [[var:%\w+]] = OpVariable +; CHECK-NOT: OpAccessChain +; CHECK: OpStore [[var]] +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %6 "elide_access_chain" +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeStruct %2 %2 %2 %2 +%4 = OpTypePointer Function %3 +%20 = OpTypePointer Function %2 +%6 = OpTypeFunction %1 +%7 = OpConstant %2 0 +%8 = OpUndef %2 +%9 = OpConstant %2 2 +%10 = OpConstantNull %2 +%11 = OpConstantComposite %3 %7 %8 %9 %10 +%12 = OpFunction %1 None %6 +%13 = OpLabel +%14 = OpVariable %4 Function %11 +%15 = OpAccessChain %20 %14 %7 +OpStore %15 %10 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, ElideMultipleAccessChains) { + const std::string text = R"( +; +; CHECK: [[var:%\w+]] = OpVariable +; CHECK-NOT: OpInBoundsAccessChain +; CHECK OpStore [[var]] +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %6 "elide_two_access_chains" +%1 = OpTypeVoid +%2 = OpTypeFloat 32 +%3 = OpTypeStruct %2 %2 +%4 = OpTypeStruct %3 %3 +%5 = OpTypePointer Function %4 +%6 = OpTypePointer Function %2 +%7 = OpTypeFunction %1 +%8 = OpConstant %2 0.0 +%9 = OpConstant %2 1.0 +%10 = OpTypeInt 32 0 +%11 = OpConstant %10 0 +%12 = OpConstant %10 1 +%13 = OpConstantComposite %3 %9 %8 +%14 = OpConstantComposite %3 %8 %9 +%15 = OpConstantComposite %4 %13 %14 +%16 = OpFunction %1 None %7 +%17 = OpLabel +%18 = OpVariable %5 Function %15 +%19 = OpInBoundsAccessChain %6 %18 %11 %12 +OpStore %19 %8 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, ReplaceAccessChain) { + const std::string text = R"( +; +; CHECK: [[param:%\w+]] = OpFunctionParameter +; CHECK: [[var:%\w+]] = OpVariable +; CHECK: [[access:%\w+]] = OpAccessChain {{%\w+}} [[var]] [[param]] +; CHECK: OpStore [[access]] +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %7 "replace_access_chain" +%1 = OpTypeVoid +%2 = OpTypeFloat 32 +%10 = OpTypeInt 32 0 +%uint_2 = OpConstant %10 2 +%3 = OpTypeArray %2 %uint_2 +%4 = OpTypeStruct %3 %3 +%5 = OpTypePointer Function %4 +%20 = OpTypePointer Function %3 +%6 = OpTypePointer Function %2 +%7 = OpTypeFunction %1 %10 +%8 = OpConstant %2 0.0 +%9 = OpConstant %2 1.0 +%11 = OpConstant %10 0 +%12 = OpConstant %10 1 +%13 = OpConstantComposite %3 %9 %8 +%14 = OpConstantComposite %3 %8 %9 +%15 = OpConstantComposite %4 %13 %14 +%16 = OpFunction %1 None %7 +%32 = OpFunctionParameter %10 +%17 = OpLabel +%18 = OpVariable %5 Function %15 +%19 = OpAccessChain %6 %18 %11 %32 +OpStore %19 %8 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, ArrayInitialization) { + const std::string text = R"( +; +; CHECK: [[float:%\w+]] = OpTypeFloat 32 +; CHECK: [[array:%\w+]] = OpTypeArray +; CHECK: [[array_ptr:%\w+]] = OpTypePointer Function [[array]] +; CHECK: [[float_ptr:%\w+]] = OpTypePointer Function [[float]] +; CHECK: [[float0:%\w+]] = OpConstant [[float]] 0 +; CHECK: [[float1:%\w+]] = OpConstant [[float]] 1 +; CHECK: [[float2:%\w+]] = OpConstant [[float]] 2 +; CHECK-NOT: OpVariable [[array_ptr]] +; CHECK: [[var0:%\w+]] = OpVariable [[float_ptr]] Function [[float0]] +; CHECK-NEXT: [[var1:%\w+]] = OpVariable [[float_ptr]] Function [[float1]] +; CHECK-NEXT: [[var2:%\w+]] = OpVariable [[float_ptr]] Function [[float2]] +; CHECK-NOT: OpVariable [[array_ptr]] +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %func "array_init" +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%float = OpTypeFloat 32 +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%uint_2 = OpConstant %uint 2 +%uint_3 = OpConstant %uint 3 +%float_array = OpTypeArray %float %uint_3 +%array_ptr = OpTypePointer Function %float_array +%float_ptr = OpTypePointer Function %float +%float_0 = OpConstant %float 0 +%float_1 = OpConstant %float 1 +%float_2 = OpConstant %float 2 +%const_array = OpConstantComposite %float_array %float_2 %float_1 %float_0 +%func = OpTypeFunction %void +%1 = OpFunction %void None %func +%2 = OpLabel +%3 = OpVariable %array_ptr Function %const_array +%4 = OpInBoundsAccessChain %float_ptr %3 %uint_0 +OpStore %4 %float_0 +%5 = OpInBoundsAccessChain %float_ptr %3 %uint_1 +OpStore %5 %float_0 +%6 = OpInBoundsAccessChain %float_ptr %3 %uint_2 +OpStore %6 %float_0 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); + ; +} + +TEST_F(ScalarReplacementTest, NonUniformCompositeInitialization) { + const std::string text = R"( +; +; CHECK: [[uint:%\w+]] = OpTypeInt 32 0 +; CHECK: [[long:%\w+]] = OpTypeInt 64 1 +; CHECK: [[dvector:%\w+]] = OpTypeVector +; CHECK: [[vector:%\w+]] = OpTypeVector +; CHECK: [[array:%\w+]] = OpTypeArray +; CHECK: [[matrix:%\w+]] = OpTypeMatrix +; CHECK: [[struct1:%\w+]] = OpTypeStruct [[uint]] [[vector]] +; CHECK: [[struct2:%\w+]] = OpTypeStruct [[struct1]] [[matrix]] [[array]] [[uint]] +; CHECK: [[struct1_ptr:%\w+]] = OpTypePointer Function [[struct1]] +; CHECK: [[matrix_ptr:%\w+]] = OpTypePointer Function [[matrix]] +; CHECK: [[array_ptr:%\w+]] = OpTypePointer Function [[array]] +; CHECK: [[uint_ptr:%\w+]] = OpTypePointer Function [[uint]] +; CHECK: [[struct2_ptr:%\w+]] = OpTypePointer Function [[struct2]] +; CHECK: [[const_array:%\w+]] = OpConstantComposite [[array]] +; CHECK: [[const_matrix:%\w+]] = OpConstantNull [[matrix]] +; CHECK: [[const_struct1:%\w+]] = OpConstantComposite [[struct1]] +; CHECK: [[vector_ptr:%\w+]] = OpTypePointer Function [[vector]] +; CHECK: [[long_ptr:%\w+]] = OpTypePointer Function [[long]] +; CHECK-NOT: OpVariable [[struct2_ptr]] Function +; CHECK: OpVariable [[long_ptr]] Function +; CHECK: OpVariable [[long_ptr]] Function +; CHECK: OpVariable [[long_ptr]] Function +; CHECK: OpVariable [[vector_ptr]] Function +; CHECK: OpVariable [[uint_ptr]] Function +; CHECK: OpVariable [[uint_ptr]] Function +; CHECK-NEXT: OpVariable [[matrix_ptr]] Function [[const_matrix]] +; CHECK-NOT: OpVariable [[struct1_ptr]] Function [[const_struct1]] +; CHECK-NOT: OpVariable [[struct2_ptr]] Function +; +OpCapability Shader +OpCapability Linkage +OpCapability Int64 +OpCapability Float64 +OpMemoryModel Logical GLSL450 +OpName %func "non_uniform_composite_init" +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%int64 = OpTypeInt 64 1 +%float = OpTypeFloat 32 +%double = OpTypeFloat 64 +%double2 = OpTypeVector %double 2 +%float4 = OpTypeVector %float 4 +%int64_0 = OpConstant %int64 0 +%int64_1 = OpConstant %int64 1 +%int64_2 = OpConstant %int64 2 +%int64_3 = OpConstant %int64 3 +%int64_array3 = OpTypeArray %int64 %int64_3 +%matrix_double2 = OpTypeMatrix %double2 2 +%struct1 = OpTypeStruct %uint %float4 +%struct2 = OpTypeStruct %struct1 %matrix_double2 %int64_array3 %uint +%struct1_ptr = OpTypePointer Function %struct1 +%matrix_double2_ptr = OpTypePointer Function %matrix_double2 +%int64_array_ptr = OpTypePointer Function %int64_array3 +%uint_ptr = OpTypePointer Function %uint +%struct2_ptr = OpTypePointer Function %struct2 +%const_uint = OpConstant %uint 0 +%const_int64_array = OpConstantComposite %int64_array3 %int64_0 %int64_1 %int64_2 +%const_double2 = OpConstantNull %double2 +%const_matrix_double2 = OpConstantNull %matrix_double2 +%undef_float4 = OpUndef %float4 +%const_struct1 = OpConstantComposite %struct1 %const_uint %undef_float4 +%const_struct2 = OpConstantComposite %struct2 %const_struct1 %const_matrix_double2 %const_int64_array %const_uint +%func = OpTypeFunction %void +%1 = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %struct2_ptr Function %const_struct2 +%3 = OpAccessChain %struct1_ptr %var %int64_0 +OpStore %3 %const_struct1 +%4 = OpAccessChain %matrix_double2_ptr %var %int64_1 +OpStore %4 %const_matrix_double2 +%5 = OpAccessChain %int64_array_ptr %var %int64_2 +OpStore %5 %const_int64_array +%6 = OpAccessChain %uint_ptr %var %int64_3 +OpStore %6 %const_uint +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); + ; +} + +TEST_F(ScalarReplacementTest, ElideUncombinedAccessChains) { + const std::string text = R"( +; +; CHECK: [[uint:%\w+]] = OpTypeInt 32 0 +; CHECK: [[uint_ptr:%\w+]] = OpTypePointer Function [[uint]] +; CHECK: [[const:%\w+]] = OpConstant [[uint]] 0 +; CHECK: [[var:%\w+]] = OpVariable [[uint_ptr]] Function +; CHECK-NOT: OpAccessChain +; CHECK: OpStore [[var]] [[const]] +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %func "elide_uncombined_access_chains" +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%struct1 = OpTypeStruct %uint +%struct2 = OpTypeStruct %struct1 +%uint_ptr = OpTypePointer Function %uint +%struct1_ptr = OpTypePointer Function %struct1 +%struct2_ptr = OpTypePointer Function %struct2 +%uint_0 = OpConstant %uint 0 +%func = OpTypeFunction %void +%1 = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %struct2_ptr Function +%3 = OpAccessChain %struct1_ptr %var %uint_0 +%4 = OpAccessChain %uint_ptr %3 %uint_0 +OpStore %4 %uint_0 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, ElideSingleUncombinedAccessChains) { + const std::string text = R"( +; +; CHECK: [[uint:%\w+]] = OpTypeInt 32 0 +; CHECK: [[array:%\w+]] = OpTypeArray [[uint]] +; CHECK: [[array_ptr:%\w+]] = OpTypePointer Function [[array]] +; CHECK: [[const:%\w+]] = OpConstant [[uint]] 0 +; CHECK: [[param:%\w+]] = OpFunctionParameter [[uint]] +; CHECK: [[var:%\w+]] = OpVariable [[array_ptr]] Function +; CHECK: [[access:%\w+]] = OpAccessChain {{.*}} [[var]] [[param]] +; CHECK: OpStore [[access]] [[const]] +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %func "elide_single_uncombined_access_chains" +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%uint_1 = OpConstant %uint 1 +%array = OpTypeArray %uint %uint_1 +%struct2 = OpTypeStruct %array +%uint_ptr = OpTypePointer Function %uint +%array_ptr = OpTypePointer Function %array +%struct2_ptr = OpTypePointer Function %struct2 +%uint_0 = OpConstant %uint 0 +%func = OpTypeFunction %void %uint +%1 = OpFunction %void None %func +%param = OpFunctionParameter %uint +%2 = OpLabel +%var = OpVariable %struct2_ptr Function +%3 = OpAccessChain %array_ptr %var %uint_0 +%4 = OpAccessChain %uint_ptr %3 %param +OpStore %4 %uint_0 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, ReplaceWholeLoad) { + const std::string text = R"( +; +; CHECK: [[uint:%\w+]] = OpTypeInt 32 0 +; CHECK: [[struct1:%\w+]] = OpTypeStruct [[uint]] [[uint]] +; CHECK: [[uint_ptr:%\w+]] = OpTypePointer Function [[uint]] +; CHECK: [[const:%\w+]] = OpConstant [[uint]] 0 +; CHECK: [[var1:%\w+]] = OpVariable [[uint_ptr]] Function +; CHECK: [[var0:%\w+]] = OpVariable [[uint_ptr]] Function +; CHECK: [[l1:%\w+]] = OpLoad [[uint]] [[var1]] +; CHECK: [[l0:%\w+]] = OpLoad [[uint]] [[var0]] +; CHECK: OpCompositeConstruct [[struct1]] [[l0]] [[l1]] +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %func "replace_whole_load" +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%struct1 = OpTypeStruct %uint %uint +%uint_ptr = OpTypePointer Function %uint +%struct1_ptr = OpTypePointer Function %struct1 +%uint_0 = OpConstant %uint 0 +%func = OpTypeFunction %void +%1 = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %struct1_ptr Function +%load = OpLoad %struct1 %var +%3 = OpAccessChain %uint_ptr %var %uint_0 +OpStore %3 %uint_0 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, ReplaceWholeLoadCopyMemoryAccess) { + const std::string text = R"( +; +; CHECK: [[uint:%\w+]] = OpTypeInt 32 0 +; CHECK: [[struct1:%\w+]] = OpTypeStruct [[uint]] [[uint]] +; CHECK: [[uint_ptr:%\w+]] = OpTypePointer Function [[uint]] +; CHECK: [[const:%\w+]] = OpConstant [[uint]] 0 +; CHECK: [[var1:%\w+]] = OpVariable [[uint_ptr]] Function +; CHECK: [[var0:%\w+]] = OpVariable [[uint_ptr]] Function +; CHECK: [[l1:%\w+]] = OpLoad [[uint]] [[var1]] Nontemporal +; CHECK: [[l0:%\w+]] = OpLoad [[uint]] [[var0]] Nontemporal +; CHECK: OpCompositeConstruct [[struct1]] [[l0]] [[l1]] +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %func "replace_whole_load_copy_memory_access" +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%struct1 = OpTypeStruct %uint %uint +%uint_ptr = OpTypePointer Function %uint +%struct1_ptr = OpTypePointer Function %struct1 +%uint_0 = OpConstant %uint 0 +%func = OpTypeFunction %void +%1 = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %struct1_ptr Function +%load = OpLoad %struct1 %var Nontemporal +%3 = OpAccessChain %uint_ptr %var %uint_0 +OpStore %3 %uint_0 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, ReplaceWholeStore) { + const std::string text = R"( +; +; CHECK: [[uint:%\w+]] = OpTypeInt 32 0 +; CHECK: [[struct1:%\w+]] = OpTypeStruct [[uint]] [[uint]] +; CHECK: [[uint_ptr:%\w+]] = OpTypePointer Function [[uint]] +; CHECK: [[const:%\w+]] = OpConstant [[uint]] 0 +; CHECK: [[const_struct:%\w+]] = OpConstantComposite [[struct1]] [[const]] [[const]] +; CHECK: [[var1:%\w+]] = OpVariable [[uint_ptr]] Function +; CHECK: [[var0:%\w+]] = OpVariable [[uint_ptr]] Function +; CHECK: [[ex0:%\w+]] = OpCompositeExtract [[uint]] [[const_struct]] 0 +; CHECK: OpStore [[var0]] [[ex0]] +; CHECK: [[ex1:%\w+]] = OpCompositeExtract [[uint]] [[const_struct]] 1 +; CHECK: OpStore [[var1]] [[ex1]] +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %func "replace_whole_store" +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%struct1 = OpTypeStruct %uint %uint +%uint_ptr = OpTypePointer Function %uint +%struct1_ptr = OpTypePointer Function %struct1 +%uint_0 = OpConstant %uint 0 +%const_struct = OpConstantComposite %struct1 %uint_0 %uint_0 +%func = OpTypeFunction %void +%1 = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %struct1_ptr Function +OpStore %var %const_struct +%3 = OpAccessChain %uint_ptr %var %uint_0 +%4 = OpLoad %uint %3 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, ReplaceWholeStoreCopyMemoryAccess) { + const std::string text = R"( +; +; CHECK: [[uint:%\w+]] = OpTypeInt 32 0 +; CHECK: [[struct1:%\w+]] = OpTypeStruct [[uint]] [[uint]] +; CHECK: [[uint_ptr:%\w+]] = OpTypePointer Function [[uint]] +; CHECK: [[const:%\w+]] = OpConstant [[uint]] 0 +; CHECK: [[const_struct:%\w+]] = OpConstantComposite [[struct1]] [[const]] [[const]] +; CHECK: [[var1:%\w+]] = OpVariable [[uint_ptr]] Function +; CHECK: [[var0:%\w+]] = OpVariable [[uint_ptr]] Function +; CHECK: [[ex0:%\w+]] = OpCompositeExtract [[uint]] [[const_struct]] 0 +; CHECK: OpStore [[var0]] [[ex0]] Aligned 4 +; CHECK: [[ex1:%\w+]] = OpCompositeExtract [[uint]] [[const_struct]] 1 +; CHECK: OpStore [[var1]] [[ex1]] Aligned 4 +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %func "replace_whole_store_copy_memory_access" +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%struct1 = OpTypeStruct %uint %uint +%uint_ptr = OpTypePointer Function %uint +%struct1_ptr = OpTypePointer Function %struct1 +%uint_0 = OpConstant %uint 0 +%const_struct = OpConstantComposite %struct1 %uint_0 %uint_0 +%func = OpTypeFunction %void +%1 = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %struct1_ptr Function +OpStore %var %const_struct Aligned 4 +%3 = OpAccessChain %uint_ptr %var %uint_0 +%4 = OpLoad %uint %3 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, DontTouchVolatileLoad) { + const std::string text = R"( +; +; CHECK: [[struct:%\w+]] = OpTypeStruct +; CHECK: [[struct_ptr:%\w+]] = OpTypePointer Function [[struct]] +; CHECK: OpLabel +; CHECK-NEXT: OpVariable [[struct_ptr]] +; CHECK-NOT: OpVariable +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %func "dont_touch_volatile_load" +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%struct1 = OpTypeStruct %uint +%uint_ptr = OpTypePointer Function %uint +%struct1_ptr = OpTypePointer Function %struct1 +%uint_0 = OpConstant %uint 0 +%func = OpTypeFunction %void +%1 = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %struct1_ptr Function +%3 = OpAccessChain %uint_ptr %var %uint_0 +%4 = OpLoad %uint %3 Volatile +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, DontTouchVolatileStore) { + const std::string text = R"( +; +; CHECK: [[struct:%\w+]] = OpTypeStruct +; CHECK: [[struct_ptr:%\w+]] = OpTypePointer Function [[struct]] +; CHECK: OpLabel +; CHECK-NEXT: OpVariable [[struct_ptr]] +; CHECK-NOT: OpVariable +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %func "dont_touch_volatile_store" +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%struct1 = OpTypeStruct %uint +%uint_ptr = OpTypePointer Function %uint +%struct1_ptr = OpTypePointer Function %struct1 +%uint_0 = OpConstant %uint 0 +%func = OpTypeFunction %void +%1 = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %struct1_ptr Function +%3 = OpAccessChain %uint_ptr %var %uint_0 +OpStore %3 %uint_0 Volatile +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, DontTouchSpecNonFunctionVariable) { + const std::string text = R"( +; +; CHECK: [[struct:%\w+]] = OpTypeStruct +; CHECK: [[struct_ptr:%\w+]] = OpTypePointer Uniform [[struct]] +; CHECK: OpConstant +; CHECK-NEXT: OpVariable [[struct_ptr]] +; CHECK-NOT: OpVariable +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %func "dont_touch_spec_constant_access_chain" +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%struct1 = OpTypeStruct %uint +%uint_ptr = OpTypePointer Uniform %uint +%struct1_ptr = OpTypePointer Uniform %struct1 +%uint_0 = OpConstant %uint 0 +%var = OpVariable %struct1_ptr Uniform +%func = OpTypeFunction %void +%1 = OpFunction %void None %func +%2 = OpLabel +%3 = OpAccessChain %uint_ptr %var %uint_0 +OpStore %3 %uint_0 Volatile +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, DontTouchSpecConstantAccessChain) { + const std::string text = R"( +; +; CHECK: [[array:%\w+]] = OpTypeArray +; CHECK: [[array_ptr:%\w+]] = OpTypePointer Function [[array]] +; CHECK: OpLabel +; CHECK-NEXT: OpVariable [[array_ptr]] +; CHECK-NOT: OpVariable +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %func "dont_touch_spec_constant_access_chain" +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%uint_1 = OpConstant %uint 1 +%array = OpTypeArray %uint %uint_1 +%uint_ptr = OpTypePointer Function %uint +%array_ptr = OpTypePointer Function %array +%uint_0 = OpConstant %uint 0 +%spec_const = OpSpecConstant %uint 0 +%func = OpTypeFunction %void +%1 = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %array_ptr Function +%3 = OpAccessChain %uint_ptr %var %spec_const +OpStore %3 %uint_0 Volatile +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, NoPartialAccesses) { + const std::string text = R"( +; +; CHECK: [[uint:%\w+]] = OpTypeInt 32 0 +; CHECK: [[uint_ptr:%\w+]] = OpTypePointer Function [[uint]] +; CHECK: OpLabel +; CHECK-NEXT: OpVariable [[uint_ptr]] +; CHECK-NOT: OpVariable +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %func "no_partial_accesses" +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%struct1 = OpTypeStruct %uint +%uint_ptr = OpTypePointer Function %uint +%struct1_ptr = OpTypePointer Function %struct1 +%const = OpConstantNull %struct1 +%func = OpTypeFunction %void +%1 = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %struct1_ptr Function +OpStore %var %const +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, DontTouchPtrAccessChain) { + const std::string text = R"( +; +; CHECK: [[struct:%\w+]] = OpTypeStruct +; CHECK: [[struct_ptr:%\w+]] = OpTypePointer Function [[struct]] +; CHECK: OpLabel +; CHECK-NEXT: OpVariable [[struct_ptr]] +; CHECK-NOT: OpVariable +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %func "dont_touch_ptr_access_chain" +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%struct1 = OpTypeStruct %uint +%uint_ptr = OpTypePointer Function %uint +%struct1_ptr = OpTypePointer Function %struct1 +%uint_0 = OpConstant %uint 0 +%func = OpTypeFunction %void +%1 = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %struct1_ptr Function +%3 = OpPtrAccessChain %uint_ptr %var %uint_0 %uint_0 +OpStore %3 %uint_0 +%4 = OpAccessChain %uint_ptr %var %uint_0 +OpStore %4 %uint_0 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, false); +} + +TEST_F(ScalarReplacementTest, DontTouchInBoundsPtrAccessChain) { + const std::string text = R"( +; +; CHECK: [[struct:%\w+]] = OpTypeStruct +; CHECK: [[struct_ptr:%\w+]] = OpTypePointer Function [[struct]] +; CHECK: OpLabel +; CHECK-NEXT: OpVariable [[struct_ptr]] +; CHECK-NOT: OpVariable +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %func "dont_touch_in_bounds_ptr_access_chain" +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%struct1 = OpTypeStruct %uint +%uint_ptr = OpTypePointer Function %uint +%struct1_ptr = OpTypePointer Function %struct1 +%uint_0 = OpConstant %uint 0 +%func = OpTypeFunction %void +%1 = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %struct1_ptr Function +%3 = OpInBoundsPtrAccessChain %uint_ptr %var %uint_0 %uint_0 +OpStore %3 %uint_0 +%4 = OpInBoundsAccessChain %uint_ptr %var %uint_0 +OpStore %4 %uint_0 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, false); +} + +TEST_F(ScalarReplacementTest, DonTouchAliasedDecoration) { + const std::string text = R"( +; +; CHECK: [[struct:%\w+]] = OpTypeStruct +; CHECK: [[struct_ptr:%\w+]] = OpTypePointer Function [[struct]] +; CHECK: OpLabel +; CHECK-NEXT: OpVariable [[struct_ptr]] +; CHECK-NOT: OpVariable +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %func "aliased" +OpDecorate %var Aliased +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%struct1 = OpTypeStruct %uint +%uint_ptr = OpTypePointer Function %uint +%struct1_ptr = OpTypePointer Function %struct1 +%uint_0 = OpConstant %uint 0 +%func = OpTypeFunction %void +%1 = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %struct1_ptr Function +%3 = OpAccessChain %uint_ptr %var %uint_0 +%4 = OpLoad %uint %3 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, CopyRestrictDecoration) { + const std::string text = R"( +; +; CHECK: OpName +; CHECK-NEXT: OpDecorate [[var0:%\w+]] Restrict +; CHECK-NEXT: OpDecorate [[var1:%\w+]] Restrict +; CHECK: [[int:%\w+]] = OpTypeInt +; CHECK: [[struct:%\w+]] = OpTypeStruct +; CHECK: [[int_ptr:%\w+]] = OpTypePointer Function [[int]] +; CHECK: [[struct_ptr:%\w+]] = OpTypePointer Function [[struct]] +; CHECK: OpLabel +; CHECK-NEXT: [[var1]] = OpVariable [[int_ptr]] +; CHECK-NEXT: [[var0]] = OpVariable [[int_ptr]] +; CHECK-NOT: OpVariable [[struct_ptr]] +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %func "restrict" +OpDecorate %var Restrict +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%struct1 = OpTypeStruct %uint %uint +%uint_ptr = OpTypePointer Function %uint +%struct1_ptr = OpTypePointer Function %struct1 +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%func = OpTypeFunction %void +%1 = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %struct1_ptr Function +%3 = OpAccessChain %uint_ptr %var %uint_0 +%4 = OpLoad %uint %3 +%5 = OpAccessChain %uint_ptr %var %uint_1 +%6 = OpLoad %uint %5 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, DontClobberDecoratesOnSubtypes) { + const std::string text = R"( +; +; CHECK: OpDecorate [[array:%\w+]] ArrayStride 1 +; CHECK: [[uint:%\w+]] = OpTypeInt 32 0 +; CHECK: [[array]] = OpTypeArray [[uint]] +; CHECK: [[array_ptr:%\w+]] = OpTypePointer Function [[array]] +; CHECK: OpLabel +; CHECK-NEXT: OpVariable [[array_ptr]] Function +; CHECK-NOT: OpVariable +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %func "array_stride" +OpDecorate %array ArrayStride 1 +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%uint_1 = OpConstant %uint 1 +%array = OpTypeArray %uint %uint_1 +%struct1 = OpTypeStruct %array +%uint_ptr = OpTypePointer Function %uint +%struct1_ptr = OpTypePointer Function %struct1 +%uint_0 = OpConstant %uint 0 +%func = OpTypeFunction %void %uint +%1 = OpFunction %void None %func +%param = OpFunctionParameter %uint +%2 = OpLabel +%var = OpVariable %struct1_ptr Function +%3 = OpAccessChain %uint_ptr %var %uint_0 %param +%4 = OpLoad %uint %3 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, DontCopyMemberDecorate) { + const std::string text = R"( +; +; CHECK-NOT: OpDecorate +; CHECK: [[uint:%\w+]] = OpTypeInt 32 0 +; CHECK: [[struct:%\w+]] = OpTypeStruct [[uint]] +; CHECK: [[uint_ptr:%\w+]] = OpTypePointer Function [[uint]] +; CHECK: [[struct_ptr:%\w+]] = OpTypePointer Function [[struct]] +; CHECK: OpLabel +; CHECK-NEXT: OpVariable [[uint_ptr]] Function +; CHECK-NOT: OpVariable +; +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +OpName %func "member_decorate" +OpMemberDecorate %struct1 0 Offset 1 +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%uint_1 = OpConstant %uint 1 +%struct1 = OpTypeStruct %uint +%uint_ptr = OpTypePointer Function %uint +%struct1_ptr = OpTypePointer Function %struct1 +%uint_0 = OpConstant %uint 0 +%func = OpTypeFunction %void %uint +%1 = OpFunction %void None %func +%2 = OpLabel +%var = OpVariable %struct1_ptr Function +%3 = OpAccessChain %uint_ptr %var %uint_0 +%4 = OpLoad %uint %3 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} + +TEST_F(ScalarReplacementTest, NoPartialAccesses2) { + const std::string text = R"( +; +; CHECK: [[float:%\w+]] = OpTypeFloat 32 +; CHECK: [[float_ptr:%\w+]] = OpTypePointer Function [[float]] +; CHECK: OpVariable [[float_ptr]] Function +; CHECK: OpVariable [[float_ptr]] Function +; CHECK: OpVariable [[float_ptr]] Function +; CHECK: OpVariable [[float_ptr]] Function +; CHECK: OpVariable [[float_ptr]] Function +; CHECK: OpVariable [[float_ptr]] Function +; CHECK: OpVariable [[float_ptr]] Function +; CHECK: OpVariable [[float_ptr]] Function +; CHECK-NOT: OpVariable +; +OpCapability Shader +%1 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %fo +OpExecutionMode %main OriginUpperLeft +OpSource GLSL 430 +OpName %main "main" +OpName %S "S" +OpMemberName %S 0 "x" +OpMemberName %S 1 "y" +OpName %ts1 "ts1" +OpName %S_0 "S" +OpMemberName %S_0 0 "x" +OpMemberName %S_0 1 "y" +OpName %U_t "U_t" +OpMemberName %U_t 0 "g_s1" +OpMemberName %U_t 1 "g_s2" +OpMemberName %U_t 2 "g_s3" +OpName %_ "" +OpName %ts2 "ts2" +OpName %_Globals_ "_Globals_" +OpMemberName %_Globals_ 0 "g_b" +OpName %__0 "" +OpName %ts3 "ts3" +OpName %ts4 "ts4" +OpName %fo "fo" +OpMemberDecorate %S_0 0 Offset 0 +OpMemberDecorate %S_0 1 Offset 4 +OpMemberDecorate %U_t 0 Offset 0 +OpMemberDecorate %U_t 1 Offset 8 +OpMemberDecorate %U_t 2 Offset 16 +OpDecorate %U_t BufferBlock +OpDecorate %_ DescriptorSet 0 +OpMemberDecorate %_Globals_ 0 Offset 0 +OpDecorate %_Globals_ Block +OpDecorate %__0 DescriptorSet 0 +OpDecorate %__0 Binding 0 +OpDecorate %fo Location 0 +%void = OpTypeVoid +%15 = OpTypeFunction %void +%float = OpTypeFloat 32 +%S = OpTypeStruct %float %float +%_ptr_Function_S = OpTypePointer Function %S +%S_0 = OpTypeStruct %float %float +%U_t = OpTypeStruct %S_0 %S_0 %S_0 +%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t +%_ = OpVariable %_ptr_Uniform_U_t Uniform +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%_ptr_Uniform_S_0 = OpTypePointer Uniform %S_0 +%_ptr_Function_float = OpTypePointer Function %float +%int_1 = OpConstant %int 1 +%uint = OpTypeInt 32 0 +%_Globals_ = OpTypeStruct %uint +%_ptr_Uniform__Globals_ = OpTypePointer Uniform %_Globals_ +%__0 = OpVariable %_ptr_Uniform__Globals_ Uniform +%_ptr_Uniform_uint = OpTypePointer Uniform %uint +%bool = OpTypeBool +%uint_0 = OpConstant %uint 0 +%_ptr_Output_float = OpTypePointer Output %float +%fo = OpVariable %_ptr_Output_float Output +%main = OpFunction %void None %15 +%30 = OpLabel +%ts1 = OpVariable %_ptr_Function_S Function +%ts2 = OpVariable %_ptr_Function_S Function +%ts3 = OpVariable %_ptr_Function_S Function +%ts4 = OpVariable %_ptr_Function_S Function +%31 = OpAccessChain %_ptr_Uniform_S_0 %_ %int_0 +%32 = OpLoad %S_0 %31 +%33 = OpCompositeExtract %float %32 0 +%34 = OpAccessChain %_ptr_Function_float %ts1 %int_0 +OpStore %34 %33 +%35 = OpCompositeExtract %float %32 1 +%36 = OpAccessChain %_ptr_Function_float %ts1 %int_1 +OpStore %36 %35 +%37 = OpAccessChain %_ptr_Uniform_S_0 %_ %int_1 +%38 = OpLoad %S_0 %37 +%39 = OpCompositeExtract %float %38 0 +%40 = OpAccessChain %_ptr_Function_float %ts2 %int_0 +OpStore %40 %39 +%41 = OpCompositeExtract %float %38 1 +%42 = OpAccessChain %_ptr_Function_float %ts2 %int_1 +OpStore %42 %41 +%43 = OpAccessChain %_ptr_Uniform_uint %__0 %int_0 +%44 = OpLoad %uint %43 +%45 = OpINotEqual %bool %44 %uint_0 +OpSelectionMerge %46 None +OpBranchConditional %45 %47 %48 +%47 = OpLabel +%49 = OpLoad %S %ts1 +OpStore %ts3 %49 +OpBranch %46 +%48 = OpLabel +%50 = OpLoad %S %ts2 +OpStore %ts3 %50 +OpBranch %46 +%46 = OpLabel +%51 = OpLoad %S %ts3 +OpStore %ts4 %51 +%52 = OpAccessChain %_ptr_Function_float %ts4 %int_1 +%53 = OpLoad %float %52 +OpStore %fo %53 +OpReturn +OpFunctionEnd + )"; + + SinglePassRunAndMatch(text, true); +} +#endif // SPIRV_EFFCEE + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/set_spec_const_default_value_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/set_spec_const_default_value_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/set_spec_const_default_value_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/set_spec_const_default_value_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1075 @@ +// Copyright (c) 2016 Google 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. + +#include "pass_fixture.h" + +#include + +namespace { +using namespace spvtools; + +using testing::Eq; + +using SpecIdToValueStrMap = + opt::SetSpecConstantDefaultValuePass::SpecIdToValueStrMap; +using SpecIdToValueBitPatternMap = + opt::SetSpecConstantDefaultValuePass::SpecIdToValueBitPatternMap; + +struct DefaultValuesStringParsingTestCase { + const char* default_values_str; + bool expect_success; + SpecIdToValueStrMap expected_map; +}; + +using DefaultValuesStringParsingTest = + ::testing::TestWithParam; + +TEST_P(DefaultValuesStringParsingTest, TestCase) { + const auto& tc = GetParam(); + auto actual_map = + opt::SetSpecConstantDefaultValuePass::ParseDefaultValuesString( + tc.default_values_str); + if (tc.expect_success) { + EXPECT_NE(nullptr, actual_map); + if (actual_map) { + EXPECT_THAT(*actual_map, Eq(tc.expected_map)); + } + } else { + EXPECT_EQ(nullptr, actual_map); + } +} + +INSTANTIATE_TEST_CASE_P( + ValidString, DefaultValuesStringParsingTest, + ::testing::ValuesIn(std::vector{ + // 0. empty map + {"", true, SpecIdToValueStrMap{}}, + // 1. one pair + {"100:1024", true, SpecIdToValueStrMap{{100, "1024"}}}, + // 2. two pairs + {"100:1024 200:2048", true, + SpecIdToValueStrMap{{100, "1024"}, {200, "2048"}}}, + // 3. spaces between entries + {"100:1024 \n \r \t \v \f 200:2048", true, + SpecIdToValueStrMap{{100, "1024"}, {200, "2048"}}}, + // 4. \t, \n, \r and spaces before spec id + {" \n \r\t \t \v \f 100:1024", true, + SpecIdToValueStrMap{{100, "1024"}}}, + // 5. \t, \n, \r and spaces after value string + {"100:1024 \n \r\t \t \v \f ", true, + SpecIdToValueStrMap{{100, "1024"}}}, + // 6. maximum spec id + {"4294967295:0", true, SpecIdToValueStrMap{{4294967295, "0"}}}, + // 7. minimum spec id + {"0:100", true, SpecIdToValueStrMap{{0, "100"}}}, + // 8. random content without spaces are allowed + {"200:random_stuff", true, SpecIdToValueStrMap{{200, "random_stuff"}}}, + // 9. support hex format spec id (just because we use the + // ParseNumber() utility) + {"0x100:1024", true, SpecIdToValueStrMap{{256, "1024"}}}, + // 10. multiple entries + {"101:1 102:2 103:3 104:4 200:201 9999:1000 0x100:333", true, + SpecIdToValueStrMap{{101, "1"}, + {102, "2"}, + {103, "3"}, + {104, "4"}, + {200, "201"}, + {9999, "1000"}, + {256, "333"}}}, + // 11. default value in hex float format + {"100:0x0.3p10", true, SpecIdToValueStrMap{{100, "0x0.3p10"}}}, + // 12. default value in decimal float format + {"100:1.5e-13", true, SpecIdToValueStrMap{{100, "1.5e-13"}}}, + })); + +INSTANTIATE_TEST_CASE_P( + InvalidString, DefaultValuesStringParsingTest, + ::testing::ValuesIn(std::vector{ + // 0. missing default value + {"100:", false, SpecIdToValueStrMap{}}, + // 1. spec id is not an integer + {"100.0:200", false, SpecIdToValueStrMap{}}, + // 2. spec id is not a number + {"something_not_a_number:1", false, SpecIdToValueStrMap{}}, + // 3. only spec id number + {"100", false, SpecIdToValueStrMap{}}, + // 4. same spec id defined multiple times + {"100:20 100:21", false, SpecIdToValueStrMap{}}, + // 5. Multiple definition of an identical spec id in different forms + // is not allowed + {"0x100:100 256:200", false, SpecIdToValueStrMap{}}, + // 6. empty spec id + {":3", false, SpecIdToValueStrMap{}}, + // 7. only colon + {":", false, SpecIdToValueStrMap{}}, + // 8. spec id overflow + {"4294967296:200", false, SpecIdToValueStrMap{}}, + // 9. spec id less than 0 + {"-1:200", false, SpecIdToValueStrMap{}}, + // 10. nullptr + {nullptr, false, SpecIdToValueStrMap{}}, + // 11. only a number is invalid + {"1234", false, SpecIdToValueStrMap{}}, + // 12. invalid entry separator + {"12:34;23:14", false, SpecIdToValueStrMap{}}, + // 13. invalid spec id and default value separator + {"12@34", false, SpecIdToValueStrMap{}}, + // 14. spaces before colon + {"100 :1024", false, SpecIdToValueStrMap{}}, + // 15. spaces after colon + {"100: 1024", false, SpecIdToValueStrMap{}}, + // 16. spec id represented in hex float format is invalid + {"0x3p10:200", false, SpecIdToValueStrMap{}}, + })); + +struct SetSpecConstantDefaultValueInStringFormTestCase { + const char* code; + SpecIdToValueStrMap default_values; + const char* expected; +}; + +using SetSpecConstantDefaultValueInStringFormParamTest = PassTest< + ::testing::TestWithParam>; + +TEST_P(SetSpecConstantDefaultValueInStringFormParamTest, TestCase) { + const auto& tc = GetParam(); + SinglePassRunAndCheck( + tc.code, tc.expected, /* skip_nop = */ false, tc.default_values); +} + +INSTANTIATE_TEST_CASE_P( + ValidCases, SetSpecConstantDefaultValueInStringFormParamTest, + ::testing::ValuesIn(std::vector< + SetSpecConstantDefaultValueInStringFormTestCase>{ + // 0. Empty. + {"", SpecIdToValueStrMap{}, ""}, + // 1. Empty with non-empty values to set. + {"", SpecIdToValueStrMap{{1, "100"}, {2, "200"}}, ""}, + // 2. Bool type. + { + // code + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "%bool = OpTypeBool\n" + "%1 = OpSpecConstantTrue %bool\n" + "%2 = OpSpecConstantFalse %bool\n", + // default values + SpecIdToValueStrMap{{100, "false"}, {101, "true"}}, + // expected + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "%bool = OpTypeBool\n" + "%1 = OpSpecConstantFalse %bool\n" + "%2 = OpSpecConstantTrue %bool\n", + }, + // 3. 32-bit int type. + { + // code + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "OpDecorate %3 SpecId 102\n" + "%int = OpTypeInt 32 1\n" + "%1 = OpSpecConstant %int 10\n" + "%2 = OpSpecConstant %int 11\n" + "%3 = OpSpecConstant %int 11\n", + // default values + SpecIdToValueStrMap{ + {100, "2147483647"}, {101, "0xffffffff"}, {102, "-42"}}, + // expected + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "OpDecorate %3 SpecId 102\n" + "%int = OpTypeInt 32 1\n" + "%1 = OpSpecConstant %int 2147483647\n" + "%2 = OpSpecConstant %int -1\n" + "%3 = OpSpecConstant %int -42\n", + }, + // 4. 64-bit uint type. + { + // code + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "%ulong = OpTypeInt 64 0\n" + "%1 = OpSpecConstant %ulong 10\n" + "%2 = OpSpecConstant %ulong 11\n", + // default values + SpecIdToValueStrMap{{100, "18446744073709551614"}, {101, "0x100"}}, + // expected + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "%ulong = OpTypeInt 64 0\n" + "%1 = OpSpecConstant %ulong 18446744073709551614\n" + "%2 = OpSpecConstant %ulong 256\n", + }, + // 5. 32-bit float type. + { + // code + "OpDecorate %1 SpecId 101\n" + "OpDecorate %2 SpecId 102\n" + "%float = OpTypeFloat 32\n" + "%1 = OpSpecConstant %float 200\n" + "%2 = OpSpecConstant %float 201\n", + // default values + SpecIdToValueStrMap{{101, "-0x1.fffffep+128"}, {102, "2.5"}}, + // expected + "OpDecorate %1 SpecId 101\n" + "OpDecorate %2 SpecId 102\n" + "%float = OpTypeFloat 32\n" + "%1 = OpSpecConstant %float -0x1.fffffep+128\n" + "%2 = OpSpecConstant %float 2.5\n", + }, + // 6. 64-bit float type. + { + // code + "OpDecorate %1 SpecId 201\n" + "OpDecorate %2 SpecId 202\n" + "%double = OpTypeFloat 64\n" + "%1 = OpSpecConstant %double 3.14159265358979\n" + "%2 = OpSpecConstant %double 0.14285\n", + // default values + SpecIdToValueStrMap{{201, "0x1.fffffffffffffp+1024"}, + {202, "-32.5"}}, + // expected + "OpDecorate %1 SpecId 201\n" + "OpDecorate %2 SpecId 202\n" + "%double = OpTypeFloat 64\n" + "%1 = OpSpecConstant %double 0x1.fffffffffffffp+1024\n" + "%2 = OpSpecConstant %double -32.5\n", + }, + // 7. SpecId not found, expect no modification. + { + // code + "OpDecorate %1 SpecId 201\n" + "%double = OpTypeFloat 64\n" + "%1 = OpSpecConstant %double 3.14159265358979\n", + // default values + SpecIdToValueStrMap{{8888, "0.0"}}, + // expected + "OpDecorate %1 SpecId 201\n" + "%double = OpTypeFloat 64\n" + "%1 = OpSpecConstant %double 3.14159265358979\n", + }, + // 8. Multiple types of spec constants. + { + // code + "OpDecorate %1 SpecId 201\n" + "OpDecorate %2 SpecId 202\n" + "OpDecorate %3 SpecId 203\n" + "%bool = OpTypeBool\n" + "%int = OpTypeInt 32 1\n" + "%double = OpTypeFloat 64\n" + "%1 = OpSpecConstant %double 3.14159265358979\n" + "%2 = OpSpecConstant %int 1024\n" + "%3 = OpSpecConstantTrue %bool\n", + // default values + SpecIdToValueStrMap{ + {201, "0x1.fffffffffffffp+1024"}, + {202, "2048"}, + {203, "false"}, + }, + // expected + "OpDecorate %1 SpecId 201\n" + "OpDecorate %2 SpecId 202\n" + "OpDecorate %3 SpecId 203\n" + "%bool = OpTypeBool\n" + "%int = OpTypeInt 32 1\n" + "%double = OpTypeFloat 64\n" + "%1 = OpSpecConstant %double 0x1.fffffffffffffp+1024\n" + "%2 = OpSpecConstant %int 2048\n" + "%3 = OpSpecConstantFalse %bool\n", + }, + // 9. Ignore other decorations. + { + // code + "OpDecorate %1 ArrayStride 4\n" + "%int = OpTypeInt 32 1\n" + "%1 = OpSpecConstant %int 100\n", + // default values + SpecIdToValueStrMap{{4, "0x7fffffff"}}, + // expected + "OpDecorate %1 ArrayStride 4\n" + "%int = OpTypeInt 32 1\n" + "%1 = OpSpecConstant %int 100\n", + }, + // 10. Distinguish from other decorations. + { + // code + "OpDecorate %1 SpecId 100\n" + "OpDecorate %1 ArrayStride 4\n" + "%int = OpTypeInt 32 1\n" + "%1 = OpSpecConstant %int 100\n", + // default values + SpecIdToValueStrMap{{4, "0x7fffffff"}, {100, "0xffffffff"}}, + // expected + "OpDecorate %1 SpecId 100\n" + "OpDecorate %1 ArrayStride 4\n" + "%int = OpTypeInt 32 1\n" + "%1 = OpSpecConstant %int -1\n", + }, + // 11. Decorate through decoration group. + { + // code + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int 100\n", + // default values + SpecIdToValueStrMap{{100, "0x7fffffff"}}, + // expected + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int 2147483647\n", + }, + // 12. Ignore other decorations in decoration group. + { + // code + "OpDecorate %1 ArrayStride 4\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int 100\n", + // default values + SpecIdToValueStrMap{{4, "0x7fffffff"}}, + // expected + "OpDecorate %1 ArrayStride 4\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int 100\n", + }, + // 13. Distinguish from other decorations in decoration group. + { + // code + "OpDecorate %1 SpecId 100\n" + "OpDecorate %1 ArrayStride 4\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int 100\n", + // default values + SpecIdToValueStrMap{{100, "0x7fffffff"}, {4, "0x00000001"}}, + // expected + "OpDecorate %1 SpecId 100\n" + "OpDecorate %1 ArrayStride 4\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int 2147483647\n", + }, + // 14. Unchanged bool default value + { + // code + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "%bool = OpTypeBool\n" + "%1 = OpSpecConstantTrue %bool\n" + "%2 = OpSpecConstantFalse %bool\n", + // default values + SpecIdToValueStrMap{{100, "true"}, {101, "false"}}, + // expected + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "%bool = OpTypeBool\n" + "%1 = OpSpecConstantTrue %bool\n" + "%2 = OpSpecConstantFalse %bool\n", + }, + // 15. Unchanged int default values + { + // code + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "%int = OpTypeInt 32 1\n" + "%ulong = OpTypeInt 64 0\n" + "%1 = OpSpecConstant %int 10\n" + "%2 = OpSpecConstant %ulong 11\n", + // default values + SpecIdToValueStrMap{{100, "10"}, {101, "11"}}, + // expected + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "%int = OpTypeInt 32 1\n" + "%ulong = OpTypeInt 64 0\n" + "%1 = OpSpecConstant %int 10\n" + "%2 = OpSpecConstant %ulong 11\n", + }, + // 16. Unchanged float default values + { + // code + "OpDecorate %1 SpecId 201\n" + "OpDecorate %2 SpecId 202\n" + "%float = OpTypeFloat 32\n" + "%double = OpTypeFloat 64\n" + "%1 = OpSpecConstant %float 3.1415\n" + "%2 = OpSpecConstant %double 0.14285\n", + // default values + SpecIdToValueStrMap{{201, "3.1415"}, {202, "0.14285"}}, + // expected + "OpDecorate %1 SpecId 201\n" + "OpDecorate %2 SpecId 202\n" + "%float = OpTypeFloat 32\n" + "%double = OpTypeFloat 64\n" + "%1 = OpSpecConstant %float 3.1415\n" + "%2 = OpSpecConstant %double 0.14285\n", + }, + // 17. OpGroupDecorate may have multiple target ids defined by the same + // eligible spec constant + { + // code + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2 %2 %2\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int 100\n", + // default values + SpecIdToValueStrMap{{100, "0xffffffff"}}, + // expected + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2 %2 %2\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int -1\n", + }, + })); + +INSTANTIATE_TEST_CASE_P( + InvalidCases, SetSpecConstantDefaultValueInStringFormParamTest, + ::testing::ValuesIn(std::vector< + SetSpecConstantDefaultValueInStringFormTestCase>{ + // 0. Do not crash when decoration group is not used. + { + // code + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "%int = OpTypeInt 32 1\n" + "%3 = OpSpecConstant %int 100\n", + // default values + SpecIdToValueStrMap{{100, "0x7fffffff"}}, + // expected + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "%int = OpTypeInt 32 1\n" + "%3 = OpSpecConstant %int 100\n", + }, + // 1. Do not crash when target does not exist. + { + // code + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "%int = OpTypeInt 32 1\n", + // default values + SpecIdToValueStrMap{{100, "0x7fffffff"}}, + // expected + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "%int = OpTypeInt 32 1\n", + }, + // 2. Do nothing when SpecId decoration is not attached to a + // non-spec-constant instruction. + { + // code + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "%int = OpTypeInt 32 1\n" + "%int_101 = OpConstant %int 101\n", + // default values + SpecIdToValueStrMap{{100, "0x7fffffff"}}, + // expected + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "%int = OpTypeInt 32 1\n" + "%int_101 = OpConstant %int 101\n", + }, + // 3. Do nothing when SpecId decoration is not attached to a + // OpSpecConstant{|True|False} instruction. + { + // code + "OpDecorate %1 SpecId 100\n" + "%int = OpTypeInt 32 1\n" + "%3 = OpSpecConstant %int 101\n" + "%1 = OpSpecConstantOp %int IAdd %3 %3\n", + // default values + SpecIdToValueStrMap{{100, "0x7fffffff"}}, + // expected + "OpDecorate %1 SpecId 100\n" + "%int = OpTypeInt 32 1\n" + "%3 = OpSpecConstant %int 101\n" + "%1 = OpSpecConstantOp %int IAdd %3 %3\n", + }, + // 4. Do not crash and do nothing when SpecId decoration is applied to + // multiple spec constants. + { + // code + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2 %3 %4\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int 100\n" + "%3 = OpSpecConstant %int 200\n" + "%4 = OpSpecConstant %int 300\n", + // default values + SpecIdToValueStrMap{{100, "0xffffffff"}}, + // expected + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2 %3 %4\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int 100\n" + "%3 = OpSpecConstant %int 200\n" + "%4 = OpSpecConstant %int 300\n", + }, + // 5. Do not crash and do nothing when SpecId decoration is attached to + // non-spec-constants (invalid case). + { + // code + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "%2 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2\n" + "%int = OpTypeInt 32 1\n" + "%int_100 = OpConstant %int 100\n", + // default values + SpecIdToValueStrMap{{100, "0xffffffff"}}, + // expected + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "%2 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2\n" + "%int = OpTypeInt 32 1\n" + "%int_100 = OpConstant %int 100\n", + }, + // 6. Boolean type spec constant cannot be set with numeric values in + // string form. i.e. only 'true' and 'false' are acceptable for setting + // boolean type spec constants. Nothing should be done if numeric values + // in string form are provided. + { + // code + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "OpDecorate %3 SpecId 102\n" + "OpDecorate %4 SpecId 103\n" + "OpDecorate %5 SpecId 104\n" + "OpDecorate %6 SpecId 105\n" + "%bool = OpTypeBool\n" + "%1 = OpSpecConstantTrue %bool\n" + "%2 = OpSpecConstantFalse %bool\n" + "%3 = OpSpecConstantTrue %bool\n" + "%4 = OpSpecConstantTrue %bool\n" + "%5 = OpSpecConstantTrue %bool\n" + "%6 = OpSpecConstantFalse %bool\n", + // default values + SpecIdToValueStrMap{{100, "0"}, + {101, "1"}, + {102, "0x0"}, + {103, "0.0"}, + {104, "-0.0"}, + {105, "0x12345678"}}, + // expected + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "OpDecorate %3 SpecId 102\n" + "OpDecorate %4 SpecId 103\n" + "OpDecorate %5 SpecId 104\n" + "OpDecorate %6 SpecId 105\n" + "%bool = OpTypeBool\n" + "%1 = OpSpecConstantTrue %bool\n" + "%2 = OpSpecConstantFalse %bool\n" + "%3 = OpSpecConstantTrue %bool\n" + "%4 = OpSpecConstantTrue %bool\n" + "%5 = OpSpecConstantTrue %bool\n" + "%6 = OpSpecConstantFalse %bool\n", + }, + })); + +struct SetSpecConstantDefaultValueInBitPatternFormTestCase { + const char* code; + SpecIdToValueBitPatternMap default_values; + const char* expected; +}; + +using SetSpecConstantDefaultValueInBitPatternFormParamTest = + PassTest<::testing::TestWithParam< + SetSpecConstantDefaultValueInBitPatternFormTestCase>>; + +TEST_P(SetSpecConstantDefaultValueInBitPatternFormParamTest, TestCase) { + const auto& tc = GetParam(); + SinglePassRunAndCheck( + tc.code, tc.expected, /* skip_nop = */ false, tc.default_values); +} + +INSTANTIATE_TEST_CASE_P( + ValidCases, SetSpecConstantDefaultValueInBitPatternFormParamTest, + ::testing::ValuesIn(std::vector< + SetSpecConstantDefaultValueInBitPatternFormTestCase>{ + // 0. Empty. + {"", SpecIdToValueBitPatternMap{}, ""}, + // 1. Empty with non-empty values to set. + {"", SpecIdToValueBitPatternMap{{1, {100}}, {2, {200}}}, ""}, + // 2. Baisc bool type. + { + // code + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "%bool = OpTypeBool\n" + "%1 = OpSpecConstantTrue %bool\n" + "%2 = OpSpecConstantFalse %bool\n", + // default values + SpecIdToValueBitPatternMap{{100, {0x0}}, {101, {0x1}}}, + // expected + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "%bool = OpTypeBool\n" + "%1 = OpSpecConstantFalse %bool\n" + "%2 = OpSpecConstantTrue %bool\n", + }, + // 3. 32-bit int type. + { + // code + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "OpDecorate %3 SpecId 102\n" + "%int = OpTypeInt 32 1\n" + "%1 = OpSpecConstant %int 10\n" + "%2 = OpSpecConstant %int 11\n" + "%3 = OpSpecConstant %int 11\n", + // default values + SpecIdToValueBitPatternMap{ + {100, {2147483647}}, {101, {0xffffffff}}, {102, {0xffffffd6}}}, + // expected + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "OpDecorate %3 SpecId 102\n" + "%int = OpTypeInt 32 1\n" + "%1 = OpSpecConstant %int 2147483647\n" + "%2 = OpSpecConstant %int -1\n" + "%3 = OpSpecConstant %int -42\n", + }, + // 4. 64-bit uint type. + { + // code + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "%ulong = OpTypeInt 64 0\n" + "%1 = OpSpecConstant %ulong 10\n" + "%2 = OpSpecConstant %ulong 11\n", + // default values + SpecIdToValueBitPatternMap{{100, {0xFFFFFFFE, 0xFFFFFFFF}}, + {101, {0x100, 0x0}}}, + // expected + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "%ulong = OpTypeInt 64 0\n" + "%1 = OpSpecConstant %ulong 18446744073709551614\n" + "%2 = OpSpecConstant %ulong 256\n", + }, + // 5. 32-bit float type. + { + // code + "OpDecorate %1 SpecId 101\n" + "OpDecorate %2 SpecId 102\n" + "%float = OpTypeFloat 32\n" + "%1 = OpSpecConstant %float 200\n" + "%2 = OpSpecConstant %float 201\n", + // default values + SpecIdToValueBitPatternMap{{101, {0xffffffff}}, + {102, {0x40200000}}}, + // expected + "OpDecorate %1 SpecId 101\n" + "OpDecorate %2 SpecId 102\n" + "%float = OpTypeFloat 32\n" + "%1 = OpSpecConstant %float -0x1.fffffep+128\n" + "%2 = OpSpecConstant %float 2.5\n", + }, + // 6. 64-bit float type. + { + // code + "OpDecorate %1 SpecId 201\n" + "OpDecorate %2 SpecId 202\n" + "%double = OpTypeFloat 64\n" + "%1 = OpSpecConstant %double 3.14159265358979\n" + "%2 = OpSpecConstant %double 0.14285\n", + // default values + SpecIdToValueBitPatternMap{{201, {0xffffffff, 0x7fffffff}}, + {202, {0x00000000, 0xc0404000}}}, + // expected + "OpDecorate %1 SpecId 201\n" + "OpDecorate %2 SpecId 202\n" + "%double = OpTypeFloat 64\n" + "%1 = OpSpecConstant %double 0x1.fffffffffffffp+1024\n" + "%2 = OpSpecConstant %double -32.5\n", + }, + // 7. SpecId not found, expect no modification. + { + // code + "OpDecorate %1 SpecId 201\n" + "%double = OpTypeFloat 64\n" + "%1 = OpSpecConstant %double 3.14159265358979\n", + // default values + SpecIdToValueBitPatternMap{{8888, {0x0}}}, + // expected + "OpDecorate %1 SpecId 201\n" + "%double = OpTypeFloat 64\n" + "%1 = OpSpecConstant %double 3.14159265358979\n", + }, + // 8. Multiple types of spec constants. + { + // code + "OpDecorate %1 SpecId 201\n" + "OpDecorate %2 SpecId 202\n" + "OpDecorate %3 SpecId 203\n" + "%bool = OpTypeBool\n" + "%int = OpTypeInt 32 1\n" + "%double = OpTypeFloat 64\n" + "%1 = OpSpecConstant %double 3.14159265358979\n" + "%2 = OpSpecConstant %int 1024\n" + "%3 = OpSpecConstantTrue %bool\n", + // default values + SpecIdToValueBitPatternMap{ + {201, {0xffffffff, 0x7fffffff}}, + {202, {0x00000800}}, + {203, {0x0}}, + }, + // expected + "OpDecorate %1 SpecId 201\n" + "OpDecorate %2 SpecId 202\n" + "OpDecorate %3 SpecId 203\n" + "%bool = OpTypeBool\n" + "%int = OpTypeInt 32 1\n" + "%double = OpTypeFloat 64\n" + "%1 = OpSpecConstant %double 0x1.fffffffffffffp+1024\n" + "%2 = OpSpecConstant %int 2048\n" + "%3 = OpSpecConstantFalse %bool\n", + }, + // 9. Ignore other decorations. + { + // code + "OpDecorate %1 ArrayStride 4\n" + "%int = OpTypeInt 32 1\n" + "%1 = OpSpecConstant %int 100\n", + // default values + SpecIdToValueBitPatternMap{{4, {0x7fffffff}}}, + // expected + "OpDecorate %1 ArrayStride 4\n" + "%int = OpTypeInt 32 1\n" + "%1 = OpSpecConstant %int 100\n", + }, + // 10. Distinguish from other decorations. + { + // code + "OpDecorate %1 SpecId 100\n" + "OpDecorate %1 ArrayStride 4\n" + "%int = OpTypeInt 32 1\n" + "%1 = OpSpecConstant %int 100\n", + // default values + SpecIdToValueBitPatternMap{{4, {0x7fffffff}}, {100, {0xffffffff}}}, + // expected + "OpDecorate %1 SpecId 100\n" + "OpDecorate %1 ArrayStride 4\n" + "%int = OpTypeInt 32 1\n" + "%1 = OpSpecConstant %int -1\n", + }, + // 11. Decorate through decoration group. + { + // code + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int 100\n", + // default values + SpecIdToValueBitPatternMap{{100, {0x7fffffff}}}, + // expected + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int 2147483647\n", + }, + // 12. Ignore other decorations in decoration group. + { + // code + "OpDecorate %1 ArrayStride 4\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int 100\n", + // default values + SpecIdToValueBitPatternMap{{4, {0x7fffffff}}}, + // expected + "OpDecorate %1 ArrayStride 4\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int 100\n", + }, + // 13. Distinguish from other decorations in decoration group. + { + // code + "OpDecorate %1 SpecId 100\n" + "OpDecorate %1 ArrayStride 4\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int 100\n", + // default values + SpecIdToValueBitPatternMap{{100, {0x7fffffff}}, {4, {0x00000001}}}, + // expected + "OpDecorate %1 SpecId 100\n" + "OpDecorate %1 ArrayStride 4\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int 2147483647\n", + }, + // 14. Unchanged bool default value + { + // code + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "%bool = OpTypeBool\n" + "%1 = OpSpecConstantTrue %bool\n" + "%2 = OpSpecConstantFalse %bool\n", + // default values + SpecIdToValueBitPatternMap{{100, {0x1}}, {101, {0x0}}}, + // expected + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "%bool = OpTypeBool\n" + "%1 = OpSpecConstantTrue %bool\n" + "%2 = OpSpecConstantFalse %bool\n", + }, + // 15. Unchanged int default values + { + // code + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "%int = OpTypeInt 32 1\n" + "%ulong = OpTypeInt 64 0\n" + "%1 = OpSpecConstant %int 10\n" + "%2 = OpSpecConstant %ulong 11\n", + // default values + SpecIdToValueBitPatternMap{{100, {10}}, {101, {11, 0}}}, + // expected + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "%int = OpTypeInt 32 1\n" + "%ulong = OpTypeInt 64 0\n" + "%1 = OpSpecConstant %int 10\n" + "%2 = OpSpecConstant %ulong 11\n", + }, + // 16. Unchanged float default values + { + // code + "OpDecorate %1 SpecId 201\n" + "OpDecorate %2 SpecId 202\n" + "%float = OpTypeFloat 32\n" + "%double = OpTypeFloat 64\n" + "%1 = OpSpecConstant %float 3.25\n" + "%2 = OpSpecConstant %double 1.25\n", + // default values + SpecIdToValueBitPatternMap{{201, {0x40500000}}, + {202, {0x00000000, 0x3ff40000}}}, + // expected + "OpDecorate %1 SpecId 201\n" + "OpDecorate %2 SpecId 202\n" + "%float = OpTypeFloat 32\n" + "%double = OpTypeFloat 64\n" + "%1 = OpSpecConstant %float 3.25\n" + "%2 = OpSpecConstant %double 1.25\n", + }, + // 17. OpGroupDecorate may have multiple target ids defined by the same + // eligible spec constant + { + // code + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2 %2 %2\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int 100\n", + // default values + SpecIdToValueBitPatternMap{{100, {0xffffffff}}}, + // expected + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2 %2 %2\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int -1\n", + }, + // 18. For Boolean type spec constants,if any word in the bit pattern + // is not zero, it can be considered as a 'true', otherwise, it can be + // considered as a 'false'. + { + // code + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "OpDecorate %3 SpecId 102\n" + "%bool = OpTypeBool\n" + "%1 = OpSpecConstantTrue %bool\n" + "%2 = OpSpecConstantFalse %bool\n" + "%3 = OpSpecConstantFalse %bool\n", + // default values + SpecIdToValueBitPatternMap{ + {100, {0x0, 0x0, 0x0, 0x0}}, + {101, {0x10101010}}, + {102, {0x0, 0x0, 0x0, 0x2}}, + }, + // expected + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "OpDecorate %3 SpecId 102\n" + "%bool = OpTypeBool\n" + "%1 = OpSpecConstantFalse %bool\n" + "%2 = OpSpecConstantTrue %bool\n" + "%3 = OpSpecConstantTrue %bool\n", + }, + })); + +INSTANTIATE_TEST_CASE_P( + InvalidCases, SetSpecConstantDefaultValueInBitPatternFormParamTest, + ::testing::ValuesIn(std::vector< + SetSpecConstantDefaultValueInBitPatternFormTestCase>{ + // 0. Do not crash when decoration group is not used. + { + // code + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "%int = OpTypeInt 32 1\n" + "%3 = OpSpecConstant %int 100\n", + // default values + SpecIdToValueBitPatternMap{{100, {0x7fffffff}}}, + // expected + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "%int = OpTypeInt 32 1\n" + "%3 = OpSpecConstant %int 100\n", + }, + // 1. Do not crash when target does not exist. + { + // code + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "%int = OpTypeInt 32 1\n", + // default values + SpecIdToValueBitPatternMap{{100, {0x7fffffff}}}, + // expected + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "%int = OpTypeInt 32 1\n", + }, + // 2. Do nothing when SpecId decoration is not attached to a + // non-spec-constant instruction. + { + // code + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "%int = OpTypeInt 32 1\n" + "%int_101 = OpConstant %int 101\n", + // default values + SpecIdToValueBitPatternMap{{100, {0x7fffffff}}}, + // expected + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "%int = OpTypeInt 32 1\n" + "%int_101 = OpConstant %int 101\n", + }, + // 3. Do nothing when SpecId decoration is not attached to a + // OpSpecConstant{|True|False} instruction. + { + // code + "OpDecorate %1 SpecId 100\n" + "%int = OpTypeInt 32 1\n" + "%3 = OpSpecConstant %int 101\n" + "%1 = OpSpecConstantOp %int IAdd %3 %3\n", + // default values + SpecIdToValueBitPatternMap{{100, {0x7fffffff}}}, + // expected + "OpDecorate %1 SpecId 100\n" + "%int = OpTypeInt 32 1\n" + "%3 = OpSpecConstant %int 101\n" + "%1 = OpSpecConstantOp %int IAdd %3 %3\n", + }, + // 4. Do not crash and do nothing when SpecId decoration is applied to + // multiple spec constants. + { + // code + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2 %3 %4\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int 100\n" + "%3 = OpSpecConstant %int 200\n" + "%4 = OpSpecConstant %int 300\n", + // default values + SpecIdToValueBitPatternMap{{100, {0xffffffff}}}, + // expected + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2 %3 %4\n" + "%int = OpTypeInt 32 1\n" + "%2 = OpSpecConstant %int 100\n" + "%3 = OpSpecConstant %int 200\n" + "%4 = OpSpecConstant %int 300\n", + }, + // 5. Do not crash and do nothing when SpecId decoration is attached to + // non-spec-constants (invalid case). + { + // code + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "%2 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2\n" + "%int = OpTypeInt 32 1\n" + "%int_100 = OpConstant %int 100\n", + // default values + SpecIdToValueBitPatternMap{{100, {0xffffffff}}}, + // expected + "OpDecorate %1 SpecId 100\n" + "%1 = OpDecorationGroup\n" + "%2 = OpDecorationGroup\n" + "OpGroupDecorate %1 %2\n" + "%int = OpTypeInt 32 1\n" + "%int_100 = OpConstant %int 100\n", + }, + // 6. Incompatible input bit pattern with the type. Nothing should be + // done in such a case. + { + // code + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "OpDecorate %3 SpecId 102\n" + "%int = OpTypeInt 32 1\n" + "%ulong = OpTypeInt 64 0\n" + "%double = OpTypeFloat 64\n" + "%1 = OpSpecConstant %int 100\n" + "%2 = OpSpecConstant %ulong 200\n" + "%3 = OpSpecConstant %double 3.141592653\n", + // default values + SpecIdToValueBitPatternMap{ + {100, {10, 0}}, {101, {11}}, {102, {0xffffffff}}}, + // expected + "OpDecorate %1 SpecId 100\n" + "OpDecorate %2 SpecId 101\n" + "OpDecorate %3 SpecId 102\n" + "%int = OpTypeInt 32 1\n" + "%ulong = OpTypeInt 64 0\n" + "%double = OpTypeFloat 64\n" + "%1 = OpSpecConstant %int 100\n" + "%2 = OpSpecConstant %ulong 200\n" + "%3 = OpSpecConstant %double 3.141592653\n", + }, + })); + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/simplification_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/simplification_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/simplification_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/simplification_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,205 @@ +// Copyright (c) 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "opt/simplification_pass.h" + +#include "assembly_builder.h" +#include "gmock/gmock.h" +#include "pass_fixture.h" + +namespace { + +using namespace spvtools; + +using SimplificationTest = PassTest<::testing::Test>; + +#ifdef SPIRV_EFFCEE +TEST_F(SimplificationTest, StraightLineTest) { + // Testing that folding rules are combined in simple straight line code. + const std::string text = R"(OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %i %o + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 430 + OpSourceExtension "GL_GOOGLE_cpp_style_line_directive" + OpSourceExtension "GL_GOOGLE_include_directive" + OpName %main "main" + OpName %i "i" + OpName %o "o" + OpDecorate %i Flat + OpDecorate %i Location 0 + OpDecorate %o Location 0 + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v4int = OpTypeVector %int 4 + %int_0 = OpConstant %int 0 + %13 = OpConstantComposite %v4int %int_0 %int_0 %int_0 %int_0 + %int_1 = OpConstant %int 1 +%_ptr_Input_v4int = OpTypePointer Input %v4int + %i = OpVariable %_ptr_Input_v4int Input +%_ptr_Output_int = OpTypePointer Output %int + %o = OpVariable %_ptr_Output_int Output + %main = OpFunction %void None %8 + %21 = OpLabel + %31 = OpCompositeInsert %v4int %int_1 %13 0 +; CHECK: [[load:%[a-zA-Z_\d]+]] = OpLoad + %23 = OpLoad %v4int %i + %33 = OpCompositeInsert %v4int %int_0 %23 0 + %35 = OpCompositeExtract %int %31 0 +; CHECK: [[extract:%[a-zA-Z_\d]+]] = OpCompositeExtract %int [[load]] 1 + %37 = OpCompositeExtract %int %33 1 +; CHECK: [[add:%[a-zA-Z_\d]+]] = OpIAdd %int %int_1 [[extract]] + %29 = OpIAdd %int %35 %37 + OpStore %o %29 + OpReturn + OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, false); +} + +TEST_F(SimplificationTest, AcrossBasicBlocks) { + // Testing that folding rules are combined across basic blocks. + const std::string text = R"(OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %i %o + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 430 + OpSourceExtension "GL_GOOGLE_cpp_style_line_directive" + OpSourceExtension "GL_GOOGLE_include_directive" + OpName %main "main" + OpName %i "i" + OpName %o "o" + OpDecorate %i Flat + OpDecorate %i Location 0 + OpDecorate %o Location 0 + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v4int = OpTypeVector %int 4 + %int_0 = OpConstant %int 0 +%_ptr_Input_v4int = OpTypePointer Input %v4int + %i = OpVariable %_ptr_Input_v4int Input + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 +%_ptr_Input_int = OpTypePointer Input %int + %int_10 = OpConstant %int 10 + %bool = OpTypeBool + %int_1 = OpConstant %int 1 +%_ptr_Output_int = OpTypePointer Output %int + %o = OpVariable %_ptr_Output_int Output + %main = OpFunction %void None %8 + %24 = OpLabel +; CHECK: [[load:%[a-zA-Z_\d]+]] = OpLoad %v4int %i + %25 = OpLoad %v4int %i + %41 = OpCompositeInsert %v4int %int_0 %25 0 + %27 = OpAccessChain %_ptr_Input_int %i %uint_0 + %28 = OpLoad %int %27 + %29 = OpSGreaterThan %bool %28 %int_10 + OpSelectionMerge %30 None + OpBranchConditional %29 %31 %32 + %31 = OpLabel + %43 = OpCopyObject %v4int %25 + OpBranch %30 + %32 = OpLabel + %45 = OpCopyObject %v4int %25 + OpBranch %30 + %30 = OpLabel + %50 = OpPhi %v4int %43 %31 %45 %32 +; CHECK: [[extract1:%[a-zA-Z_\d]+]] = OpCompositeExtract %int [[load]] 0 + %47 = OpCompositeExtract %int %50 0 +; CHECK: [[extract2:%[a-zA-Z_\d]+]] = OpCompositeExtract %int [[load]] 1 + %49 = OpCompositeExtract %int %41 1 +; CHECK: [[add:%[a-zA-Z_\d]+]] = OpIAdd %int [[extract1]] [[extract2]] + %39 = OpIAdd %int %47 %49 + OpStore %o %39 + OpReturn + OpFunctionEnd + +)"; + + SinglePassRunAndMatch(text, false); +} + +TEST_F(SimplificationTest, ThroughLoops) { + // Testing that folding rules are applied multiple times to instructions + // to be able to propagate across loop iterations. + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %o %i + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 430 + OpSourceExtension "GL_GOOGLE_cpp_style_line_directive" + OpSourceExtension "GL_GOOGLE_include_directive" + OpName %main "main" + OpName %o "o" + OpName %i "i" + OpDecorate %o Location 0 + OpDecorate %i Flat + OpDecorate %i Location 0 + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v4int = OpTypeVector %int 4 + %int_0 = OpConstant %int 0 +; CHECK: [[constant:%[a-zA-Z_\d]+]] = OpConstantComposite %v4int %int_0 %int_0 %int_0 %int_0 + %13 = OpConstantComposite %v4int %int_0 %int_0 %int_0 %int_0 + %bool = OpTypeBool +%_ptr_Output_int = OpTypePointer Output %int + %o = OpVariable %_ptr_Output_int Output +%_ptr_Input_v4int = OpTypePointer Input %v4int + %i = OpVariable %_ptr_Input_v4int Input + %68 = OpUndef %v4int + %main = OpFunction %void None %8 + %23 = OpLabel +; CHECK: [[load:%[a-zA-Z_\d]+]] = OpLoad %v4int %i + %load = OpLoad %v4int %i + OpBranch %24 + %24 = OpLabel + %67 = OpPhi %v4int %load %23 %64 %26 +; CHECK: OpLoopMerge [[merge_lab:%[a-zA-Z_\d]+]] + OpLoopMerge %25 %26 None + OpBranch %27 + %27 = OpLabel + %48 = OpCompositeExtract %int %67 0 + %30 = OpIEqual %bool %48 %int_0 + OpBranchConditional %30 %31 %25 + %31 = OpLabel + %50 = OpCompositeExtract %int %67 0 + %54 = OpCompositeExtract %int %67 1 + %58 = OpCompositeExtract %int %67 2 + %62 = OpCompositeExtract %int %67 3 + %64 = OpCompositeConstruct %v4int %50 %54 %58 %62 + OpBranch %26 + %26 = OpLabel + OpBranch %24 + %25 = OpLabel +; CHECK: [[merge_lab]] = OpLabel +; CHECK: [[extract:%[a-zA-Z_\d]+]] = OpCompositeExtract %int [[load]] 0 + %66 = OpCompositeExtract %int %67 0 +; CHECK-NEXT: OpStore %o [[extract]] + OpStore %o %66 + OpReturn + OpFunctionEnd +)"; + + SinglePassRunAndMatch(text, false); +} +#endif +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/strength_reduction_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/strength_reduction_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/strength_reduction_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/strength_reduction_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,436 @@ +// Copyright (c) 2017 Google 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. + +#include "assembly_builder.h" +#include "gmock/gmock.h" +#include "pass_fixture.h" +#include "pass_utils.h" + +#include +#include +#include +#include +#include + +namespace { + +using namespace spvtools; + +using ::testing::HasSubstr; +using ::testing::MatchesRegex; + +using StrengthReductionBasicTest = PassTest<::testing::Test>; + +// Test to make sure we replace 5*8. +TEST_F(StrengthReductionBasicTest, BasicReplaceMulBy8) { + const std::vector text = { + // clang-format off + "OpCapability Shader", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Vertex %main \"main\"", + "OpName %main \"main\"", + "%void = OpTypeVoid", + "%4 = OpTypeFunction %void", + "%uint = OpTypeInt 32 0", + "%uint_5 = OpConstant %uint 5", + "%uint_8 = OpConstant %uint 8", + "%main = OpFunction %void None %4", + "%8 = OpLabel", + "%9 = OpIMul %uint %uint_5 %uint_8", + "OpReturn", + "OpFunctionEnd" + // clang-format on + }; + + auto result = SinglePassRunAndDisassemble( + JoinAllInsts(text), /* skip_nop = */ true, /* do_validation = */ false); + + EXPECT_EQ(opt::Pass::Status::SuccessWithChange, std::get<1>(result)); + const std::string& output = std::get<0>(result); + EXPECT_THAT(output, Not(HasSubstr("OpIMul"))); + EXPECT_THAT(output, HasSubstr("OpShiftLeftLogical %uint %uint_5 %uint_3")); +} + +// TODO(dneto): Add Effcee as required dependency, and make this unconditional. +#ifdef SPIRV_EFFCEE +// Test to make sure we replace 16*5 +// Also demonstrate use of Effcee matching. +TEST_F(StrengthReductionBasicTest, BasicReplaceMulBy16) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" + OpName %main "main" + %void = OpTypeVoid + %4 = OpTypeFunction %void +; We know disassembly will produce %uint here, but +; CHECK: %uint = OpTypeInt 32 0 +; CHECK-DAG: [[five:%[a-zA-Z_\d]+]] = OpConstant %uint 5 + +; We have RE2 regular expressions, so \w matches [_a-zA-Z0-9]. +; This shows the preferred pattern for matching SPIR-V identifiers. +; (We could have cheated in this case since we know the disassembler will +; generate the 'nice' name of "%uint_4". +; CHECK-DAG: [[four:%\w+]] = OpConstant %uint 4 + %uint = OpTypeInt 32 0 + %uint_5 = OpConstant %uint 5 + %uint_16 = OpConstant %uint 16 + %main = OpFunction %void None %4 +; CHECK: OpLabel + %8 = OpLabel +; CHECK-NEXT: OpShiftLeftLogical %uint [[five]] [[four]] +; The multiplication disappears. +; CHECK-NOT: OpIMul + %9 = OpIMul %uint %uint_16 %uint_5 + OpReturn +; CHECK: OpFunctionEnd + OpFunctionEnd)"; + + SinglePassRunAndMatch(text, false); +} +#endif + +// Test to make sure we replace a multiple of 32 and 4. +TEST_F(StrengthReductionBasicTest, BasicTwoPowersOf2) { + // In this case, we have two powers of 2. Need to make sure we replace only + // one of them for the bit shift. + // clang-format off + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" + OpName %main "main" + %void = OpTypeVoid + %4 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%int_32 = OpConstant %int 32 + %int_4 = OpConstant %int 4 + %main = OpFunction %void None %4 + %8 = OpLabel + %9 = OpIMul %int %int_32 %int_4 + OpReturn + OpFunctionEnd +)"; + // clang-format on + auto result = SinglePassRunAndDisassemble( + text, /* skip_nop = */ true, /* do_validation = */ false); + + EXPECT_EQ(opt::Pass::Status::SuccessWithChange, std::get<1>(result)); + const std::string& output = std::get<0>(result); + EXPECT_THAT(output, Not(HasSubstr("OpIMul"))); + EXPECT_THAT(output, HasSubstr("OpShiftLeftLogical %int %int_4 %uint_5")); +} + +// Test to make sure we don't replace 0*5. +TEST_F(StrengthReductionBasicTest, BasicDontReplace0) { + const std::vector text = { + // clang-format off + "OpCapability Shader", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Vertex %main \"main\"", + "OpName %main \"main\"", + "%void = OpTypeVoid", + "%4 = OpTypeFunction %void", + "%int = OpTypeInt 32 1", + "%int_0 = OpConstant %int 0", + "%int_5 = OpConstant %int 5", + "%main = OpFunction %void None %4", + "%8 = OpLabel", + "%9 = OpIMul %int %int_0 %int_5", + "OpReturn", + "OpFunctionEnd" + // clang-format on + }; + + auto result = SinglePassRunAndDisassemble( + JoinAllInsts(text), /* skip_nop = */ true, /* do_validation = */ false); + + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); +} + +// Test to make sure we do not replace a multiple of 5 and 7. +TEST_F(StrengthReductionBasicTest, BasicNoChange) { + const std::vector text = { + // clang-format off + "OpCapability Shader", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Vertex %2 \"main\"", + "OpName %2 \"main\"", + "%3 = OpTypeVoid", + "%4 = OpTypeFunction %3", + "%5 = OpTypeInt 32 1", + "%6 = OpTypeInt 32 0", + "%7 = OpConstant %5 5", + "%8 = OpConstant %5 7", + "%2 = OpFunction %3 None %4", + "%9 = OpLabel", + "%10 = OpIMul %5 %7 %8", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + + auto result = SinglePassRunAndDisassemble( + JoinAllInsts(text), /* skip_nop = */ true, /* do_validation = */ false); + + EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); +} + +// Test to make sure constants and types are reused and not duplicated. +TEST_F(StrengthReductionBasicTest, NoDuplicateConstantsAndTypes) { + const std::vector text = { + // clang-format off + "OpCapability Shader", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Vertex %main \"main\"", + "OpName %main \"main\"", + "%void = OpTypeVoid", + "%4 = OpTypeFunction %void", + "%uint = OpTypeInt 32 0", + "%uint_8 = OpConstant %uint 8", + "%uint_3 = OpConstant %uint 3", + "%main = OpFunction %void None %4", + "%8 = OpLabel", + "%9 = OpIMul %uint %uint_8 %uint_3", + "OpReturn", + "OpFunctionEnd", + // clang-format on + }; + + auto result = SinglePassRunAndDisassemble( + JoinAllInsts(text), /* skip_nop = */ true, /* do_validation = */ false); + + EXPECT_EQ(opt::Pass::Status::SuccessWithChange, std::get<1>(result)); + const std::string& output = std::get<0>(result); + EXPECT_THAT(output, + Not(MatchesRegex(".*OpConstant %uint 3.*OpConstant %uint 3.*"))); + EXPECT_THAT(output, Not(MatchesRegex(".*OpTypeInt 32 0.*OpTypeInt 32 0.*"))); +} + +// Test to make sure we generate the constants only once +TEST_F(StrengthReductionBasicTest, BasicCreateOneConst) { + const std::vector text = { + // clang-format off + "OpCapability Shader", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Vertex %main \"main\"", + "OpName %main \"main\"", + "%void = OpTypeVoid", + "%4 = OpTypeFunction %void", + "%uint = OpTypeInt 32 0", + "%uint_5 = OpConstant %uint 5", + "%uint_9 = OpConstant %uint 9", + "%uint_128 = OpConstant %uint 128", + "%main = OpFunction %void None %4", + "%8 = OpLabel", + "%9 = OpIMul %uint %uint_5 %uint_128", + "%10 = OpIMul %uint %uint_9 %uint_128", + "OpReturn", + "OpFunctionEnd" + // clang-format on + }; + + auto result = SinglePassRunAndDisassemble( + JoinAllInsts(text), /* skip_nop = */ true, /* do_validation = */ false); + + EXPECT_EQ(opt::Pass::Status::SuccessWithChange, std::get<1>(result)); + const std::string& output = std::get<0>(result); + EXPECT_THAT(output, Not(HasSubstr("OpIMul"))); + EXPECT_THAT(output, HasSubstr("OpShiftLeftLogical %uint %uint_5 %uint_7")); + EXPECT_THAT(output, HasSubstr("OpShiftLeftLogical %uint %uint_9 %uint_7")); +} + +// Test to make sure we generate the instructions in the correct position and +// that the uses get replaced as well. Here we check that the use in the return +// is replaced, we also check that we can replace two OpIMuls when one feeds the +// other. +TEST_F(StrengthReductionBasicTest, BasicCheckPositionAndReplacement) { + // This is just the preamble to set up the test. + const std::vector common_text = { + // clang-format off + "OpCapability Shader", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Fragment %main \"main\" %gl_FragColor", + "OpExecutionMode %main OriginUpperLeft", + "OpName %main \"main\"", + "OpName %foo_i1_ \"foo(i1;\"", + "OpName %n \"n\"", + "OpName %gl_FragColor \"gl_FragColor\"", + "OpName %param \"param\"", + "OpDecorate %gl_FragColor Location 0", + "%void = OpTypeVoid", + "%3 = OpTypeFunction %void", + "%int = OpTypeInt 32 1", +"%_ptr_Function_int = OpTypePointer Function %int", + "%8 = OpTypeFunction %int %_ptr_Function_int", + "%int_256 = OpConstant %int 256", + "%int_2 = OpConstant %int 2", + "%float = OpTypeFloat 32", + "%v4float = OpTypeVector %float 4", +"%_ptr_Output_v4float = OpTypePointer Output %v4float", +"%gl_FragColor = OpVariable %_ptr_Output_v4float Output", + "%float_1 = OpConstant %float 1", + "%int_10 = OpConstant %int 10", + "%float_0_375 = OpConstant %float 0.375", + "%float_0_75 = OpConstant %float 0.75", + "%uint = OpTypeInt 32 0", + "%uint_8 = OpConstant %uint 8", + "%uint_1 = OpConstant %uint 1", + "%main = OpFunction %void None %3", + "%5 = OpLabel", + "%param = OpVariable %_ptr_Function_int Function", + "OpStore %param %int_10", + "%26 = OpFunctionCall %int %foo_i1_ %param", + "%27 = OpConvertSToF %float %26", + "%28 = OpFDiv %float %float_1 %27", + "%31 = OpCompositeConstruct %v4float %28 %float_0_375 %float_0_75 %float_1", + "OpStore %gl_FragColor %31", + "OpReturn", + "OpFunctionEnd" + // clang-format on + }; + + // This is the real test. The two OpIMul should be replaced. The expected + // output is in |foo_after|. + const std::vector foo_before = { + // clang-format off + "%foo_i1_ = OpFunction %int None %8", + "%n = OpFunctionParameter %_ptr_Function_int", + "%11 = OpLabel", + "%12 = OpLoad %int %n", + "%14 = OpIMul %int %12 %int_256", + "%16 = OpIMul %int %14 %int_2", + "OpReturnValue %16", + "OpFunctionEnd", + + // clang-format on + }; + + const std::vector foo_after = { + // clang-format off + "%foo_i1_ = OpFunction %int None %8", + "%n = OpFunctionParameter %_ptr_Function_int", + "%11 = OpLabel", + "%12 = OpLoad %int %n", + "%33 = OpShiftLeftLogical %int %12 %uint_8", + "%34 = OpShiftLeftLogical %int %33 %uint_1", + "OpReturnValue %34", + "OpFunctionEnd", + // clang-format on + }; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck( + JoinAllInsts(Concat(common_text, foo_before)), + JoinAllInsts(Concat(common_text, foo_after)), + /* skip_nop = */ true, /* do_validate = */ true); +} + +// Test that, when the result of an OpIMul instruction has more than 1 use, and +// the instruction is replaced, all of the uses of the results are replace with +// the new result. +TEST_F(StrengthReductionBasicTest, BasicTestMultipleReplacements) { + // This is just the preamble to set up the test. + const std::vector common_text = { + // clang-format off + "OpCapability Shader", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Fragment %main \"main\" %gl_FragColor", + "OpExecutionMode %main OriginUpperLeft", + "OpName %main \"main\"", + "OpName %foo_i1_ \"foo(i1;\"", + "OpName %n \"n\"", + "OpName %gl_FragColor \"gl_FragColor\"", + "OpName %param \"param\"", + "OpDecorate %gl_FragColor Location 0", + "%void = OpTypeVoid", + "%3 = OpTypeFunction %void", + "%int = OpTypeInt 32 1", +"%_ptr_Function_int = OpTypePointer Function %int", + "%8 = OpTypeFunction %int %_ptr_Function_int", + "%int_256 = OpConstant %int 256", + "%int_2 = OpConstant %int 2", + "%float = OpTypeFloat 32", + "%v4float = OpTypeVector %float 4", +"%_ptr_Output_v4float = OpTypePointer Output %v4float", +"%gl_FragColor = OpVariable %_ptr_Output_v4float Output", + "%float_1 = OpConstant %float 1", + "%int_10 = OpConstant %int 10", + "%float_0_375 = OpConstant %float 0.375", + "%float_0_75 = OpConstant %float 0.75", + "%uint = OpTypeInt 32 0", + "%uint_8 = OpConstant %uint 8", + "%uint_1 = OpConstant %uint 1", + "%main = OpFunction %void None %3", + "%5 = OpLabel", + "%param = OpVariable %_ptr_Function_int Function", + "OpStore %param %int_10", + "%26 = OpFunctionCall %int %foo_i1_ %param", + "%27 = OpConvertSToF %float %26", + "%28 = OpFDiv %float %float_1 %27", + "%31 = OpCompositeConstruct %v4float %28 %float_0_375 %float_0_75 %float_1", + "OpStore %gl_FragColor %31", + "OpReturn", + "OpFunctionEnd" + // clang-format on + }; + + // This is the real test. The two OpIMul instructions should be replaced. In + // particular, we want to be sure that both uses of %16 are changed to use the + // new result. + const std::vector foo_before = { + // clang-format off + "%foo_i1_ = OpFunction %int None %8", + "%n = OpFunctionParameter %_ptr_Function_int", + "%11 = OpLabel", + "%12 = OpLoad %int %n", + "%14 = OpIMul %int %12 %int_256", + "%16 = OpIMul %int %14 %int_2", + "%17 = OpIAdd %int %14 %16", + "OpReturnValue %17", + "OpFunctionEnd", + + // clang-format on + }; + + const std::vector foo_after = { + // clang-format off + "%foo_i1_ = OpFunction %int None %8", + "%n = OpFunctionParameter %_ptr_Function_int", + "%11 = OpLabel", + "%12 = OpLoad %int %n", + "%34 = OpShiftLeftLogical %int %12 %uint_8", + "%35 = OpShiftLeftLogical %int %34 %uint_1", + "%17 = OpIAdd %int %34 %35", + "OpReturnValue %17", + "OpFunctionEnd", + // clang-format on + }; + + SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + SinglePassRunAndCheck( + JoinAllInsts(Concat(common_text, foo_before)), + JoinAllInsts(Concat(common_text, foo_after)), + /* skip_nop = */ true, /* do_validate = */ true); +} +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/strip_debug_info_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/strip_debug_info_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/strip_debug_info_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/strip_debug_info_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,103 @@ +// Copyright (c) 2016 Google 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. + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using StripLineDebugInfoTest = PassTest<::testing::Test>; + +TEST_F(StripLineDebugInfoTest, LineNoLine) { + std::vector text = { + // clang-format off + "OpCapability Shader", + "%1 = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint Vertex %2 \"main\"", + "%3 = OpString \"minimal.vert\"", + "OpModuleProcessed \"42\"", + "OpModuleProcessed \"43\"", + "OpModuleProcessed \"44\"", + "OpNoLine", + "OpLine %3 10 10", + "%void = OpTypeVoid", + "OpLine %3 100 100", + "%5 = OpTypeFunction %void", + "%2 = OpFunction %void None %5", + "OpLine %3 1 1", + "OpNoLine", + "OpLine %3 2 2", + "OpLine %3 3 3", + "%6 = OpLabel", + "OpLine %3 4 4", + "OpNoLine", + "OpReturn", + "OpLine %3 4 4", + "OpNoLine", + "OpFunctionEnd", + // clang-format on + }; + SinglePassRunAndCheck(JoinAllInsts(text), + JoinNonDebugInsts(text), + /* skip_nop = */ false); + + // Let's add more debug instruction before the "OpString" instruction. + const std::vector more_text = { + "OpSourceContinued \"I'm a happy shader! Yay! ;)\"", + "OpSourceContinued \"wahahaha\"", + "OpSource ESSL 310", + "OpSource ESSL 310", + "OpSourceContinued \"wahahaha\"", + "OpSourceContinued \"wahahaha\"", + "OpSourceExtension \"save-the-world-extension\"", + "OpName %2 \"main\"", + }; + text.insert(text.begin() + 4, more_text.cbegin(), more_text.cend()); + SinglePassRunAndCheck(JoinAllInsts(text), + JoinNonDebugInsts(text), + /* skip_nop = */ false); +} + +using StripDebugInfoTest = PassTest<::testing::TestWithParam>; + +TEST_P(StripDebugInfoTest, Kind) { + std::vector text = { + "OpCapability Shader", + "OpMemoryModel Logical GLSL450", + GetParam(), + }; + SinglePassRunAndCheck(JoinAllInsts(text), + JoinNonDebugInsts(text), + /* skip_nop = */ false); +} + +// Test each possible non-line debug instruction. +// clang-format off +INSTANTIATE_TEST_CASE_P( + SingleKindDebugInst, StripDebugInfoTest, + ::testing::ValuesIn(std::vector({ + "OpSourceContinued \"I'm a happy shader! Yay! ;)\"", + "OpSource ESSL 310", + "OpSourceExtension \"save-the-world-extension\"", + "OpName %main \"main\"", + "OpMemberName %struct 0 \"field\"", + "%1 = OpString \"name.vert\"", + "OpModuleProcessed \"42\"", + }))); +// clang-format on + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/strip_reflect_info_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/strip_reflect_info_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/strip_reflect_info_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/strip_reflect_info_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +using StripLineReflectInfoTest = PassTest<::testing::Test>; + +TEST_F(StripLineReflectInfoTest, StripHlslSemantic) { + // This is a non-sensical example, but exercises the instructions. + std::string before = R"(OpCapability Shader +OpCapability Linkage +OpExtension "SPV_GOOGLE_decorate_string" +OpExtension "SPV_GOOGLE_hlsl_functionality1" +OpMemoryModel Logical Simple +OpDecorateStringGOOGLE %float HlslSemanticGOOGLE "foobar" +OpDecorateStringGOOGLE %void HlslSemanticGOOGLE "my goodness" +%void = OpTypeVoid +%float = OpTypeFloat 32 +)"; + std::string after = R"(OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical Simple +%void = OpTypeVoid +%float = OpTypeFloat 32 +)"; + + SinglePassRunAndCheck(before, after, false); +} + +TEST_F(StripLineReflectInfoTest, StripHlslCounterBuffer) { + std::string before = R"(OpCapability Shader +OpCapability Linkage +OpExtension "SPV_GOOGLE_hlsl_functionality1" +OpMemoryModel Logical Simple +OpDecorateId %void HlslCounterBufferGOOGLE %float +%void = OpTypeVoid +%float = OpTypeFloat 32 +)"; + std::string after = R"(OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical Simple +%void = OpTypeVoid +%float = OpTypeFloat 32 +)"; + + SinglePassRunAndCheck(before, after, false); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/type_manager_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/type_manager_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/type_manager_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/type_manager_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,883 @@ +// Copyright (c) 2016 Google 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. + +#include +#include + +#ifdef SPIRV_EFFCEE +#include "effcee/effcee.h" +#endif + +#include "opt/build_module.h" +#include "opt/instruction.h" +#include "opt/type_manager.h" +#include "spirv-tools/libspirv.hpp" + +namespace { + +using namespace spvtools; +using namespace spvtools::opt::analysis; + +#ifdef SPIRV_EFFCEE + +bool Validate(const std::vector& bin) { + spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2; + spv_context spvContext = spvContextCreate(target_env); + spv_diagnostic diagnostic = nullptr; + spv_const_binary_t binary = {bin.data(), bin.size()}; + spv_result_t error = spvValidate(spvContext, &binary, &diagnostic); + if (error != 0) spvDiagnosticPrint(diagnostic); + spvDiagnosticDestroy(diagnostic); + spvContextDestroy(spvContext); + return error == 0; +} + +void Match(const std::string& original, ir::IRContext* context, + bool do_validation = true) { + std::vector bin; + context->module()->ToBinary(&bin, true); + if (do_validation) { + EXPECT_TRUE(Validate(bin)); + } + std::string assembly; + SpirvTools tools(SPV_ENV_UNIVERSAL_1_2); + EXPECT_TRUE( + tools.Disassemble(bin, &assembly, SpirvTools::kDefaultDisassembleOption)) + << "Disassembling failed for shader:\n" + << assembly << std::endl; + auto match_result = effcee::Match(assembly, original); + EXPECT_EQ(effcee::Result::Status::Ok, match_result.status()) + << match_result.message() << "\nChecking result:\n" + << assembly; +} + +#endif + +std::vector> GenerateAllTypes() { + // Types in this test case are only equal to themselves, nothing else. + std::vector> types; + + // Void, Bool + types.emplace_back(new Void()); + auto* voidt = types.back().get(); + types.emplace_back(new Bool()); + auto* boolt = types.back().get(); + + // Integer + types.emplace_back(new Integer(32, true)); + auto* s32 = types.back().get(); + types.emplace_back(new Integer(32, false)); + types.emplace_back(new Integer(64, true)); + types.emplace_back(new Integer(64, false)); + auto* u64 = types.back().get(); + + // Float + types.emplace_back(new Float(32)); + auto* f32 = types.back().get(); + types.emplace_back(new Float(64)); + + // Vector + types.emplace_back(new Vector(s32, 2)); + types.emplace_back(new Vector(s32, 3)); + auto* v3s32 = types.back().get(); + types.emplace_back(new Vector(u64, 4)); + types.emplace_back(new Vector(f32, 3)); + auto* v3f32 = types.back().get(); + + // Matrix + types.emplace_back(new Matrix(v3s32, 3)); + types.emplace_back(new Matrix(v3s32, 4)); + types.emplace_back(new Matrix(v3f32, 4)); + + // Images + types.emplace_back(new Image(s32, SpvDim2D, 0, 0, 0, 0, SpvImageFormatRg8, + SpvAccessQualifierReadOnly)); + auto* image1 = types.back().get(); + types.emplace_back(new Image(s32, SpvDim2D, 0, 1, 0, 0, SpvImageFormatRg8, + SpvAccessQualifierReadOnly)); + types.emplace_back(new Image(s32, SpvDim3D, 0, 1, 0, 0, SpvImageFormatRg8, + SpvAccessQualifierReadOnly)); + types.emplace_back(new Image(voidt, SpvDim3D, 0, 1, 0, 1, SpvImageFormatRg8, + SpvAccessQualifierReadWrite)); + auto* image2 = types.back().get(); + + // Sampler + types.emplace_back(new Sampler()); + + // Sampled Image + types.emplace_back(new SampledImage(image1)); + types.emplace_back(new SampledImage(image2)); + + // Array + types.emplace_back(new Array(f32, 100)); + types.emplace_back(new Array(f32, 42)); + auto* a42f32 = types.back().get(); + types.emplace_back(new Array(u64, 24)); + + // RuntimeArray + types.emplace_back(new RuntimeArray(v3f32)); + types.emplace_back(new RuntimeArray(v3s32)); + auto* rav3s32 = types.back().get(); + + // Struct + types.emplace_back(new Struct(std::vector{s32})); + types.emplace_back(new Struct(std::vector{s32, f32})); + auto* sts32f32 = types.back().get(); + types.emplace_back(new Struct(std::vector{u64, a42f32, rav3s32})); + + // Opaque + types.emplace_back(new Opaque("")); + types.emplace_back(new Opaque("hello")); + types.emplace_back(new Opaque("world")); + + // Pointer + types.emplace_back(new Pointer(f32, SpvStorageClassInput)); + types.emplace_back(new Pointer(sts32f32, SpvStorageClassFunction)); + types.emplace_back(new Pointer(a42f32, SpvStorageClassFunction)); + + // Function + types.emplace_back(new Function(voidt, {})); + types.emplace_back(new Function(voidt, {boolt})); + types.emplace_back(new Function(voidt, {boolt, s32})); + types.emplace_back(new Function(s32, {boolt, s32})); + + // Event, Device Event, Reserve Id, Queue, + types.emplace_back(new Event()); + types.emplace_back(new DeviceEvent()); + types.emplace_back(new ReserveId()); + types.emplace_back(new Queue()); + + // Pipe, Forward Pointer, PipeStorage, NamedBarrier + types.emplace_back(new Pipe(SpvAccessQualifierReadWrite)); + types.emplace_back(new Pipe(SpvAccessQualifierReadOnly)); + types.emplace_back(new ForwardPointer(1, SpvStorageClassInput)); + types.emplace_back(new ForwardPointer(2, SpvStorageClassInput)); + types.emplace_back(new ForwardPointer(2, SpvStorageClassUniform)); + types.emplace_back(new PipeStorage()); + types.emplace_back(new NamedBarrier()); + + return types; +} + +TEST(TypeManager, TypeStrings) { + const std::string text = R"( + OpTypeForwardPointer !20 !2 ; id for %p is 20, Uniform is 2 + OpTypeForwardPointer !10000 !1 + %void = OpTypeVoid + %bool = OpTypeBool + %u32 = OpTypeInt 32 0 + %id4 = OpConstant %u32 4 + %s32 = OpTypeInt 32 1 + %f64 = OpTypeFloat 64 + %v3u32 = OpTypeVector %u32 3 + %m3x3 = OpTypeMatrix %v3u32 3 + %img1 = OpTypeImage %s32 Cube 0 1 1 0 R32f ReadWrite + %img2 = OpTypeImage %s32 Cube 0 1 1 0 R32f + %sampler = OpTypeSampler + %si1 = OpTypeSampledImage %img1 + %si2 = OpTypeSampledImage %img2 + %a5u32 = OpTypeArray %u32 %id4 + %af64 = OpTypeRuntimeArray %f64 + %st1 = OpTypeStruct %u32 + %st2 = OpTypeStruct %f64 %s32 %v3u32 + %opaque1 = OpTypeOpaque "" + %opaque2 = OpTypeOpaque "opaque" + %p = OpTypePointer Uniform %st1 + %f = OpTypeFunction %void %u32 %u32 + %event = OpTypeEvent + %de = OpTypeDeviceEvent + %ri = OpTypeReserveId + %queue = OpTypeQueue + %pipe = OpTypePipe ReadOnly + %ps = OpTypePipeStorage + %nb = OpTypeNamedBarrier + )"; + + std::vector> type_id_strs = { + {1, "void"}, + {2, "bool"}, + {3, "uint32"}, + // Id 4 is used by the constant. + {5, "sint32"}, + {6, "float64"}, + {7, ""}, + {8, "<, 3>"}, + {9, "image(sint32, 3, 0, 1, 1, 0, 3, 2)"}, + {10, "image(sint32, 3, 0, 1, 1, 0, 3, 0)"}, + {11, "sampler"}, + {12, "sampled_image(image(sint32, 3, 0, 1, 1, 0, 3, 2))"}, + {13, "sampled_image(image(sint32, 3, 0, 1, 1, 0, 3, 0))"}, + {14, "[uint32, id(4)]"}, + {15, "[float64]"}, + {16, "{uint32}"}, + {17, "{float64, sint32, }"}, + {18, "opaque('')"}, + {19, "opaque('opaque')"}, + {20, "{uint32}*"}, + {21, "(uint32, uint32) -> void"}, + {22, "event"}, + {23, "device_event"}, + {24, "reserve_id"}, + {25, "queue"}, + {26, "pipe(0)"}, + {27, "pipe_storage"}, + {28, "named_barrier"}, + }; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text); + opt::analysis::TypeManager manager(nullptr, context.get()); + + EXPECT_EQ(type_id_strs.size(), manager.NumTypes()); + EXPECT_EQ(2u, manager.NumForwardPointers()); + + for (const auto& p : type_id_strs) { + EXPECT_EQ(p.second, manager.GetType(p.first)->str()); + EXPECT_EQ(p.first, manager.GetId(manager.GetType(p.first))); + } + EXPECT_EQ("forward_pointer({uint32}*)", manager.GetForwardPointer(0)->str()); + EXPECT_EQ("forward_pointer(10000)", manager.GetForwardPointer(1)->str()); +} + +TEST(TypeManager, DecorationOnStruct) { + const std::string text = R"( + OpDecorate %struct1 Block + OpDecorate %struct2 Block + OpDecorate %struct3 Block + OpDecorate %struct4 Block + + %u32 = OpTypeInt 32 0 ; id: 5 + %f32 = OpTypeFloat 32 ; id: 6 + %struct1 = OpTypeStruct %u32 %f32 ; base + %struct2 = OpTypeStruct %f32 %u32 ; different member order + %struct3 = OpTypeStruct %f32 ; different member list + %struct4 = OpTypeStruct %u32 %f32 ; the same + %struct7 = OpTypeStruct %f32 ; no decoration + )"; + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text); + opt::analysis::TypeManager manager(nullptr, context.get()); + + ASSERT_EQ(7u, manager.NumTypes()); + ASSERT_EQ(0u, manager.NumForwardPointers()); + // Make sure we get ids correct. + ASSERT_EQ("uint32", manager.GetType(5)->str()); + ASSERT_EQ("float32", manager.GetType(6)->str()); + + // Try all combinations of pairs. Expect to be the same type only when the + // same id or (1, 4). + for (const auto id1 : {1, 2, 3, 4, 7}) { + for (const auto id2 : {1, 2, 3, 4, 7}) { + if (id1 == id2 || (id1 == 1 && id2 == 4) || (id1 == 4 && id2 == 1)) { + EXPECT_TRUE(manager.GetType(id1)->IsSame(manager.GetType(id2))) + << "%struct" << id1 << " is expected to be the same as %struct" + << id2; + } else { + EXPECT_FALSE(manager.GetType(id1)->IsSame(manager.GetType(id2))) + << "%struct" << id1 << " is expected to be different with %struct" + << id2; + } + } + } +} + +TEST(TypeManager, DecorationOnMember) { + const std::string text = R"( + OpMemberDecorate %struct1 0 Offset 0 + OpMemberDecorate %struct2 0 Offset 0 + OpMemberDecorate %struct3 0 Offset 0 + OpMemberDecorate %struct4 0 Offset 0 + OpMemberDecorate %struct5 1 Offset 0 + OpMemberDecorate %struct6 0 Offset 4 + + OpDecorate %struct7 Block + OpMemberDecorate %struct7 0 Offset 0 + + %u32 = OpTypeInt 32 0 ; id: 8 + %f32 = OpTypeFloat 32 ; id: 9 + %struct1 = OpTypeStruct %u32 %f32 ; base + %struct2 = OpTypeStruct %f32 %u32 ; different member order + %struct3 = OpTypeStruct %f32 ; different member list + %struct4 = OpTypeStruct %u32 %f32 ; the same + %struct5 = OpTypeStruct %u32 %f32 ; member decorate different field + %struct6 = OpTypeStruct %u32 %f32 ; different member decoration parameter + %struct7 = OpTypeStruct %u32 %f32 ; extra decoration on the struct + %struct10 = OpTypeStruct %u32 %f32 ; no member decoration + )"; + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text); + opt::analysis::TypeManager manager(nullptr, context.get()); + + ASSERT_EQ(10u, manager.NumTypes()); + ASSERT_EQ(0u, manager.NumForwardPointers()); + // Make sure we get ids correct. + ASSERT_EQ("uint32", manager.GetType(8)->str()); + ASSERT_EQ("float32", manager.GetType(9)->str()); + + // Try all combinations of pairs. Expect to be the same type only when the + // same id or (1, 4). + for (const auto id1 : {1, 2, 3, 4, 5, 6, 7, 10}) { + for (const auto id2 : {1, 2, 3, 4, 5, 6, 7, 10}) { + if (id1 == id2 || (id1 == 1 && id2 == 4) || (id1 == 4 && id2 == 1)) { + EXPECT_TRUE(manager.GetType(id1)->IsSame(manager.GetType(id2))) + << "%struct" << id1 << " is expected to be the same as %struct" + << id2; + } else { + EXPECT_FALSE(manager.GetType(id1)->IsSame(manager.GetType(id2))) + << "%struct" << id1 << " is expected to be different with %struct" + << id2; + } + } + } +} + +TEST(TypeManager, DecorationEmpty) { + const std::string text = R"( + OpDecorate %struct1 Block + OpMemberDecorate %struct2 0 Offset 0 + + %u32 = OpTypeInt 32 0 ; id: 3 + %f32 = OpTypeFloat 32 ; id: 4 + %struct1 = OpTypeStruct %u32 %f32 + %struct2 = OpTypeStruct %f32 %u32 + %struct5 = OpTypeStruct %f32 + )"; + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text); + opt::analysis::TypeManager manager(nullptr, context.get()); + + ASSERT_EQ(5u, manager.NumTypes()); + ASSERT_EQ(0u, manager.NumForwardPointers()); + // Make sure we get ids correct. + ASSERT_EQ("uint32", manager.GetType(3)->str()); + ASSERT_EQ("float32", manager.GetType(4)->str()); + + // %struct1 with decoration on itself + EXPECT_FALSE(manager.GetType(1)->decoration_empty()); + // %struct2 with decoration on its member + EXPECT_FALSE(manager.GetType(2)->decoration_empty()); + EXPECT_TRUE(manager.GetType(3)->decoration_empty()); + EXPECT_TRUE(manager.GetType(4)->decoration_empty()); + // %struct5 has no decorations + EXPECT_TRUE(manager.GetType(5)->decoration_empty()); +} + +TEST(TypeManager, BeginEndForEmptyModule) { + const std::string text = ""; + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text); + opt::analysis::TypeManager manager(nullptr, context.get()); + ASSERT_EQ(0u, manager.NumTypes()); + ASSERT_EQ(0u, manager.NumForwardPointers()); + + EXPECT_EQ(manager.begin(), manager.end()); +} + +TEST(TypeManager, BeginEnd) { + const std::string text = R"( + %void1 = OpTypeVoid + %void2 = OpTypeVoid + %bool = OpTypeBool + %u32 = OpTypeInt 32 0 + %f64 = OpTypeFloat 64 + )"; + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text); + opt::analysis::TypeManager manager(nullptr, context.get()); + ASSERT_EQ(5u, manager.NumTypes()); + ASSERT_EQ(0u, manager.NumForwardPointers()); + + EXPECT_NE(manager.begin(), manager.end()); + for (const auto& t : manager) { + switch (t.first) { + case 1: + case 2: + EXPECT_EQ("void", t.second->str()); + break; + case 3: + EXPECT_EQ("bool", t.second->str()); + break; + case 4: + EXPECT_EQ("uint32", t.second->str()); + break; + case 5: + EXPECT_EQ("float64", t.second->str()); + break; + default: + EXPECT_TRUE(false && "unreachable"); + break; + } + } +} + +TEST(TypeManager, LookupType) { + const std::string text = R"( +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%int = OpTypeInt 32 1 +%vec2 = OpTypeVector %int 2 +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + EXPECT_NE(context, nullptr); + TypeManager manager(nullptr, context.get()); + + Void voidTy; + EXPECT_EQ(manager.GetId(&voidTy), 1u); + + Integer uintTy(32, false); + EXPECT_EQ(manager.GetId(&uintTy), 2u); + + Integer intTy(32, true); + EXPECT_EQ(manager.GetId(&intTy), 3u); + + Integer intTy2(32, true); + Vector vecTy(&intTy2, 2u); + EXPECT_EQ(manager.GetId(&vecTy), 4u); +} + +TEST(TypeManager, RemoveId) { + const std::string text = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%1 = OpTypeInt 32 0 +%2 = OpTypeInt 32 1 + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(context, nullptr); + + context->get_type_mgr()->RemoveId(1u); + ASSERT_EQ(context->get_type_mgr()->GetType(1u), nullptr); + ASSERT_NE(context->get_type_mgr()->GetType(2u), nullptr); + + context->get_type_mgr()->RemoveId(2u); + ASSERT_EQ(context->get_type_mgr()->GetType(1u), nullptr); + ASSERT_EQ(context->get_type_mgr()->GetType(2u), nullptr); +} + +TEST(TypeManager, RemoveIdNonDuplicateAmbiguousType) { + const std::string text = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%1 = OpTypeInt 32 0 +%2 = OpTypeStruct %1 + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(context, nullptr); + + Integer u32(32, false); + Struct st({&u32}); + ASSERT_EQ(context->get_type_mgr()->GetId(&st), 2u); + context->get_type_mgr()->RemoveId(2u); + ASSERT_EQ(context->get_type_mgr()->GetType(2u), nullptr); + ASSERT_EQ(context->get_type_mgr()->GetId(&st), 0u); +} + +TEST(TypeManager, RemoveIdDuplicateAmbiguousType) { + const std::string text = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%1 = OpTypeInt 32 0 +%2 = OpTypeStruct %1 +%3 = OpTypeStruct %1 + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(context, nullptr); + + Integer u32(32, false); + Struct st({&u32}); + uint32_t id = context->get_type_mgr()->GetId(&st); + ASSERT_NE(id, 0u); + uint32_t toRemove = id == 2u ? 2u : 3u; + uint32_t toStay = id == 2u ? 3u : 2u; + context->get_type_mgr()->RemoveId(toRemove); + ASSERT_EQ(context->get_type_mgr()->GetType(toRemove), nullptr); + ASSERT_EQ(context->get_type_mgr()->GetId(&st), toStay); +} + +TEST(TypeManager, RemoveIdDoesntUnmapOtherTypes) { + const std::string text = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +%1 = OpTypeInt 32 0 +%2 = OpTypeStruct %1 +%3 = OpTypeStruct %1 + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(context, nullptr); + + Integer u32(32, false); + Struct st({&u32}); + + EXPECT_EQ(1u, context->get_type_mgr()->GetId(&u32)); + uint32_t id = context->get_type_mgr()->GetId(&st); + ASSERT_NE(id, 0u); + uint32_t toRemove = id == 2u ? 3u : 2u; + uint32_t toStay = id == 2u ? 2u : 3u; + context->get_type_mgr()->RemoveId(toRemove); + ASSERT_EQ(context->get_type_mgr()->GetType(toRemove), nullptr); + ASSERT_EQ(context->get_type_mgr()->GetId(&st), toStay); +} + +TEST(TypeManager, GetTypeAndPointerType) { + const std::string text = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%1 = OpTypeInt 32 0 +%2 = OpTypeStruct %1 + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(context, nullptr); + + Integer u32(32, false); + Pointer u32Ptr(&u32, SpvStorageClassFunction); + Struct st({&u32}); + Pointer stPtr(&st, SpvStorageClassInput); + + auto pair = context->get_type_mgr()->GetTypeAndPointerType( + 3u, SpvStorageClassFunction); + ASSERT_EQ(nullptr, pair.first); + ASSERT_EQ(nullptr, pair.second); + + pair = context->get_type_mgr()->GetTypeAndPointerType( + 1u, SpvStorageClassFunction); + ASSERT_TRUE(pair.first->IsSame(&u32)); + ASSERT_TRUE(pair.second->IsSame(&u32Ptr)); + + pair = + context->get_type_mgr()->GetTypeAndPointerType(2u, SpvStorageClassInput); + ASSERT_TRUE(pair.first->IsSame(&st)); + ASSERT_TRUE(pair.second->IsSame(&stPtr)); +} + +TEST(TypeManager, DuplicateType) { + const std::string text = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +%1 = OpTypeInt 32 0 +%2 = OpTypeInt 32 0 + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(context, nullptr); + + const Type* type1 = context->get_type_mgr()->GetType(1u); + const Type* type2 = context->get_type_mgr()->GetType(2u); + EXPECT_NE(type1, nullptr); + EXPECT_NE(type2, nullptr); + EXPECT_EQ(*type1, *type2); +} + +TEST(TypeManager, MultipleStructs) { + const std::string text = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpDecorate %3 Constant +%1 = OpTypeInt 32 0 +%2 = OpTypeStruct %1 +%3 = OpTypeStruct %1 + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(context, nullptr); + + const Type* type1 = context->get_type_mgr()->GetType(2u); + const Type* type2 = context->get_type_mgr()->GetType(3u); + EXPECT_NE(type1, nullptr); + EXPECT_NE(type2, nullptr); + EXPECT_FALSE(type1->IsSame(type2)); +} + +TEST(TypeManager, RemovingIdAvoidsUseAfterFree) { + const std::string text = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +%1 = OpTypeInt 32 0 +%2 = OpTypeStruct %1 + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(context, nullptr); + + Integer u32(32, false); + Struct st({&u32}); + const Type* type = context->get_type_mgr()->GetType(2u); + EXPECT_NE(type, nullptr); + context->get_type_mgr()->RemoveId(1u); + EXPECT_TRUE(type->IsSame(&st)); +} + +TEST(TypeManager, RegisterAndRemoveId) { + const std::string text = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +%1 = OpTypeInt 32 0 +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(context, nullptr); + + uint32_t id = 2u; + { + // Ensure that u32 goes out of scope. + Integer u32(32, false); + Struct st({&u32}); + context->get_type_mgr()->RegisterType(id, st); + } + + context->get_type_mgr()->RemoveId(id); + EXPECT_EQ(nullptr, context->get_type_mgr()->GetType(id)); +} + +TEST(TypeManager, RegisterAndRemoveIdAllTypes) { + const std::string text = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(context, nullptr); + + std::vector> types = GenerateAllTypes(); + uint32_t id = 1u; + for (auto& t : types) { + context->get_type_mgr()->RegisterType(id, *t); + EXPECT_EQ(*t, *context->get_type_mgr()->GetType(id)); + } + types.clear(); + + for (; id > 0; --id) { + context->get_type_mgr()->RemoveId(id); + EXPECT_EQ(nullptr, context->get_type_mgr()->GetType(id)); + } +} + +TEST(TypeManager, RegisterAndRemoveIdWithDecorations) { + const std::string text = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +%1 = OpTypeInt 32 0 +)"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(context, nullptr); + + uint32_t id = 2u; + { + Integer u32(32, false); + Struct st({&u32, &u32}); + st.AddDecoration({10}); + st.AddDecoration({11}); + st.AddMemberDecoration(0, {{35, 4}}); + st.AddMemberDecoration(1, {{35, 4}}); + st.AddMemberDecoration(1, {{36, 5}}); + context->get_type_mgr()->RegisterType(id, st); + EXPECT_EQ(st, *context->get_type_mgr()->GetType(id)); + } + + context->get_type_mgr()->RemoveId(id); + EXPECT_EQ(nullptr, context->get_type_mgr()->GetType(id)); +} + +#ifdef SPIRV_EFFCEE +TEST(TypeManager, GetTypeInstructionInt) { + const std::string text = R"( +; CHECK: OpTypeInt 32 0 +; CHECK: OpTypeInt 16 1 +OpCapability Shader +OpCapability Int16 +OpCapability Linkage +OpMemoryModel Logical GLSL450 + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + EXPECT_NE(context, nullptr); + + Integer uint_32(32, false); + context->get_type_mgr()->GetTypeInstruction(&uint_32); + + Integer int_16(16, true); + context->get_type_mgr()->GetTypeInstruction(&int_16); + + Match(text, context.get()); +} + +TEST(TypeManager, GetTypeInstructionDuplicateInts) { + const std::string text = R"( +; CHECK: OpTypeInt 32 0 +; CHECK-NOT: OpType +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + EXPECT_NE(context, nullptr); + + Integer uint_32(32, false); + uint32_t id = context->get_type_mgr()->GetTypeInstruction(&uint_32); + + Integer other(32, false); + EXPECT_EQ(context->get_type_mgr()->GetTypeInstruction(&other), id); + + Match(text, context.get()); +} + +TEST(TypeManager, GetTypeInstructionAllTypes) { + const std::string text = R"( +; CHECK: [[uint:%\w+]] = OpTypeInt 32 0 +; CHECK: [[input_ptr:%\w+]] = OpTypePointer Input [[uint]] +; CHECK: [[uniform_ptr:%\w+]] = OpTypePointer Uniform [[uint]] +; CHECK: [[uint24:%\w+]] = OpConstant [[uint]] 24 +; CHECK: [[uint42:%\w+]] = OpConstant [[uint]] 42 +; CHECK: [[uint100:%\w+]] = OpConstant [[uint]] 100 +; CHECK: [[void:%\w+]] = OpTypeVoid +; CHECK: [[bool:%\w+]] = OpTypeBool +; CHECK: [[s32:%\w+]] = OpTypeInt 32 1 +; CHECK: OpTypeInt 64 1 +; CHECK: [[u64:%\w+]] = OpTypeInt 64 0 +; CHECK: [[f32:%\w+]] = OpTypeFloat 32 +; CHECK: OpTypeFloat 64 +; CHECK: OpTypeVector [[s32]] 2 +; CHECK: [[v3s32:%\w+]] = OpTypeVector [[s32]] 3 +; CHECK: OpTypeVector [[u64]] 4 +; CHECK: [[v3f32:%\w+]] = OpTypeVector [[f32]] 3 +; CHECK: OpTypeMatrix [[v3s32]] 3 +; CHECK: OpTypeMatrix [[v3s32]] 4 +; CHECK: OpTypeMatrix [[v3f32]] 4 +; CHECK: [[image1:%\w+]] = OpTypeImage [[s32]] 2D 0 0 0 0 Rg8 ReadOnly +; CHECK: OpTypeImage [[s32]] 2D 0 1 0 0 Rg8 ReadOnly +; CHECK: OpTypeImage [[s32]] 3D 0 1 0 0 Rg8 ReadOnly +; CHECK: [[image2:%\w+]] = OpTypeImage [[void]] 3D 0 1 0 1 Rg8 ReadWrite +; CHECK: OpTypeSampler +; CHECK: OpTypeSampledImage [[image1]] +; CHECK: OpTypeSampledImage [[image2]] +; CHECK: OpTypeArray [[f32]] [[uint100]] +; CHECK: [[a42f32:%\w+]] = OpTypeArray [[f32]] [[uint42]] +; CHECK: OpTypeArray [[u64]] [[uint24]] +; CHECK: OpTypeRuntimeArray [[v3f32]] +; CHECK: [[rav3s32:%\w+]] = OpTypeRuntimeArray [[v3s32]] +; CHECK: OpTypeStruct [[s32]] +; CHECK: [[sts32f32:%\w+]] = OpTypeStruct [[s32]] [[f32]] +; CHECK: OpTypeStruct [[u64]] [[a42f32]] [[rav3s32]] +; CHECK: OpTypeOpaque "" +; CHECK: OpTypeOpaque "hello" +; CHECK: OpTypeOpaque "world" +; CHECK: OpTypePointer Input [[f32]] +; CHECK: OpTypePointer Function [[sts32f32]] +; CHECK: OpTypePointer Function [[a42f32]] +; CHECK: OpTypeFunction [[void]] +; CHECK: OpTypeFunction [[void]] [[bool]] +; CHECK: OpTypeFunction [[void]] [[bool]] [[s32]] +; CHECK: OpTypeFunction [[s32]] [[bool]] [[s32]] +; CHECK: OpTypeEvent +; CHECK: OpTypeDeviceEvent +; CHECK: OpTypeReserveId +; CHECK: OpTypeQueue +; CHECK: OpTypePipe ReadWrite +; CHECK: OpTypePipe ReadOnly +; CHECK: OpTypeForwardPointer [[input_ptr]] Input +; CHECK: OpTypeForwardPointer [[uniform_ptr]] Input +; CHECK: OpTypeForwardPointer [[uniform_ptr]] Uniform +; CHECK: OpTypePipeStorage +; CHECK: OpTypeNamedBarrier +OpCapability Shader +OpCapability Int64 +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%uint = OpTypeInt 32 0 +%1 = OpTypePointer Input %uint +%2 = OpTypePointer Uniform %uint +%24 = OpConstant %uint 24 +%42 = OpConstant %uint 42 +%100 = OpConstant %uint 100 + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(context, nullptr); + + std::vector> types = GenerateAllTypes(); + for (auto& t : types) { + context->get_type_mgr()->GetTypeInstruction(t.get()); + } + + Match(text, context.get(), false); +} + +TEST(TypeManager, GetTypeInstructionWithDecorations) { + const std::string text = R"( +; CHECK: OpDecorate [[struct:%\w+]] CPacked +; CHECK: OpMemberDecorate [[struct]] 1 Offset 4 +; CHECK: [[uint:%\w+]] = OpTypeInt 32 0 +; CHECK: [[struct]] = OpTypeStruct [[uint]] [[uint]] +OpCapability Shader +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%uint = OpTypeInt 32 0 + )"; + + std::unique_ptr context = + BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + EXPECT_NE(context, nullptr); + + Integer u32(32, false); + Struct st({&u32, &u32}); + st.AddDecoration({10}); + st.AddMemberDecoration(1, {{35, 4}}); + (void)context->get_def_use_mgr(); + context->get_type_mgr()->GetTypeInstruction(&st); + + Match(text, context.get()); +} +#endif // SPIRV_EFFCEE + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/types_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/types_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/types_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/types_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,339 @@ +// Copyright (c) 2016 Google 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. + +#include +#include + +#include + +#include "opt/make_unique.h" +#include "opt/types.h" + +namespace { + +using namespace spvtools::opt::analysis; +using spvtools::MakeUnique; + +// Fixture class providing some element types. +class SameTypeTest : public ::testing::Test { + protected: + virtual void SetUp() override { + void_t_.reset(new Void()); + u32_t_.reset(new Integer(32, false)); + f64_t_.reset(new Float(64)); + v3u32_t_.reset(new Vector(u32_t_.get(), 3)); + image_t_.reset(new Image(f64_t_.get(), SpvDim2D, 1, 1, 0, 0, + SpvImageFormatR16, SpvAccessQualifierReadWrite)); + } + + // Element types to be used for constructing other types for testing. + std::unique_ptr void_t_; + std::unique_ptr u32_t_; + std::unique_ptr f64_t_; + std::unique_ptr v3u32_t_; + std::unique_ptr image_t_; +}; + +#define TestMultipleInstancesOfTheSameType(ty, ...) \ + TEST_F(SameTypeTest, MultiSame##ty) { \ + std::vector> types; \ + for (int i = 0; i < 10; ++i) types.emplace_back(new ty(__VA_ARGS__)); \ + for (size_t i = 0; i < types.size(); ++i) { \ + for (size_t j = 0; j < types.size(); ++j) { \ + EXPECT_TRUE(types[i]->IsSame(types[j].get())) \ + << "expected '" << types[i]->str() << "' is the same as '" \ + << types[j]->str() << "'"; \ + EXPECT_TRUE(*types[i] == *types[j]) \ + << "expected '" << types[i]->str() << "' is the same as '" \ + << types[j]->str() << "'"; \ + } \ + } \ + } +TestMultipleInstancesOfTheSameType(Void); +TestMultipleInstancesOfTheSameType(Bool); +TestMultipleInstancesOfTheSameType(Integer, 32, true); +TestMultipleInstancesOfTheSameType(Float, 64); +TestMultipleInstancesOfTheSameType(Vector, u32_t_.get(), 3); +TestMultipleInstancesOfTheSameType(Matrix, v3u32_t_.get(), 4); +TestMultipleInstancesOfTheSameType(Image, f64_t_.get(), SpvDimCube, 0, 0, 1, 1, + SpvImageFormatRgb10A2, + SpvAccessQualifierWriteOnly); +TestMultipleInstancesOfTheSameType(Sampler); +TestMultipleInstancesOfTheSameType(SampledImage, image_t_.get()); +TestMultipleInstancesOfTheSameType(Array, u32_t_.get(), 10); +TestMultipleInstancesOfTheSameType(RuntimeArray, u32_t_.get()); +TestMultipleInstancesOfTheSameType(Struct, std::vector{u32_t_.get(), + f64_t_.get()}); +TestMultipleInstancesOfTheSameType(Opaque, "testing rocks"); +TestMultipleInstancesOfTheSameType(Pointer, u32_t_.get(), SpvStorageClassInput); +TestMultipleInstancesOfTheSameType(Function, u32_t_.get(), + {f64_t_.get(), f64_t_.get()}); +TestMultipleInstancesOfTheSameType(Event); +TestMultipleInstancesOfTheSameType(DeviceEvent); +TestMultipleInstancesOfTheSameType(ReserveId); +TestMultipleInstancesOfTheSameType(Queue); +TestMultipleInstancesOfTheSameType(Pipe, SpvAccessQualifierReadWrite); +TestMultipleInstancesOfTheSameType(ForwardPointer, 10, SpvStorageClassUniform); +TestMultipleInstancesOfTheSameType(PipeStorage); +TestMultipleInstancesOfTheSameType(NamedBarrier); +#undef TestMultipleInstanceOfTheSameType + +std::vector> GenerateAllTypes() { + // Types in this test case are only equal to themselves, nothing else. + std::vector> types; + + // Forward Pointer + types.emplace_back(new ForwardPointer(10000, SpvStorageClassInput)); + types.emplace_back(new ForwardPointer(20000, SpvStorageClassInput)); + + // Void, Bool + types.emplace_back(new Void()); + auto* voidt = types.back().get(); + types.emplace_back(new Bool()); + auto* boolt = types.back().get(); + + // Integer + types.emplace_back(new Integer(32, true)); + auto* s32 = types.back().get(); + types.emplace_back(new Integer(32, false)); + types.emplace_back(new Integer(64, true)); + types.emplace_back(new Integer(64, false)); + auto* u64 = types.back().get(); + + // Float + types.emplace_back(new Float(32)); + auto* f32 = types.back().get(); + types.emplace_back(new Float(64)); + + // Vector + types.emplace_back(new Vector(s32, 2)); + types.emplace_back(new Vector(s32, 3)); + auto* v3s32 = types.back().get(); + types.emplace_back(new Vector(u64, 4)); + types.emplace_back(new Vector(f32, 3)); + auto* v3f32 = types.back().get(); + + // Matrix + types.emplace_back(new Matrix(v3s32, 3)); + types.emplace_back(new Matrix(v3s32, 4)); + types.emplace_back(new Matrix(v3f32, 4)); + + // Images + types.emplace_back(new Image(s32, SpvDim2D, 0, 0, 0, 0, SpvImageFormatRg8, + SpvAccessQualifierReadOnly)); + auto* image1 = types.back().get(); + types.emplace_back(new Image(s32, SpvDim2D, 0, 1, 0, 0, SpvImageFormatRg8, + SpvAccessQualifierReadOnly)); + types.emplace_back(new Image(s32, SpvDim3D, 0, 1, 0, 0, SpvImageFormatRg8, + SpvAccessQualifierReadOnly)); + types.emplace_back(new Image(voidt, SpvDim3D, 0, 1, 0, 1, SpvImageFormatRg8, + SpvAccessQualifierReadWrite)); + auto* image2 = types.back().get(); + + // Sampler + types.emplace_back(new Sampler()); + + // Sampled Image + types.emplace_back(new SampledImage(image1)); + types.emplace_back(new SampledImage(image2)); + + // Array + types.emplace_back(new Array(f32, 100)); + types.emplace_back(new Array(f32, 42)); + auto* a42f32 = types.back().get(); + types.emplace_back(new Array(u64, 24)); + + // RuntimeArray + types.emplace_back(new RuntimeArray(v3f32)); + types.emplace_back(new RuntimeArray(v3s32)); + auto* rav3s32 = types.back().get(); + + // Struct + types.emplace_back(new Struct(std::vector{s32})); + types.emplace_back(new Struct(std::vector{s32, f32})); + auto* sts32f32 = types.back().get(); + types.emplace_back(new Struct(std::vector{u64, a42f32, rav3s32})); + + // Opaque + types.emplace_back(new Opaque("")); + types.emplace_back(new Opaque("hello")); + types.emplace_back(new Opaque("world")); + + // Pointer + types.emplace_back(new Pointer(f32, SpvStorageClassInput)); + types.emplace_back(new Pointer(sts32f32, SpvStorageClassFunction)); + types.emplace_back(new Pointer(a42f32, SpvStorageClassFunction)); + types.emplace_back(new Pointer(voidt, SpvStorageClassFunction)); + + // Function + types.emplace_back(new Function(voidt, {})); + types.emplace_back(new Function(voidt, {boolt})); + types.emplace_back(new Function(voidt, {boolt, s32})); + types.emplace_back(new Function(s32, {boolt, s32})); + + // Event, Device Event, Reserve Id, Queue, + types.emplace_back(new Event()); + types.emplace_back(new DeviceEvent()); + types.emplace_back(new ReserveId()); + types.emplace_back(new Queue()); + + // Pipe, Forward Pointer, PipeStorage, NamedBarrier + types.emplace_back(new Pipe(SpvAccessQualifierReadWrite)); + types.emplace_back(new Pipe(SpvAccessQualifierReadOnly)); + types.emplace_back(new ForwardPointer(1, SpvStorageClassInput)); + types.emplace_back(new ForwardPointer(2, SpvStorageClassInput)); + types.emplace_back(new ForwardPointer(2, SpvStorageClassUniform)); + types.emplace_back(new PipeStorage()); + types.emplace_back(new NamedBarrier()); + + return types; +} + +TEST(Types, AllTypes) { + // Types in this test case are only equal to themselves, nothing else. + std::vector> types = GenerateAllTypes(); + + for (size_t i = 0; i < types.size(); ++i) { + for (size_t j = 0; j < types.size(); ++j) { + if (i == j) { + EXPECT_TRUE(types[i]->IsSame(types[j].get())) + << "expected '" << types[i]->str() << "' is the same as '" + << types[j]->str() << "'"; + } else { + EXPECT_FALSE(types[i]->IsSame(types[j].get())) + << "expected '" << types[i]->str() << "' is different to '" + << types[j]->str() << "'"; + } + } + } +} + +TEST(Types, IntSignedness) { + std::vector signednesses = {true, false, false, true}; + std::vector> types; + for (bool s : signednesses) { + types.emplace_back(new Integer(32, s)); + } + for (size_t i = 0; i < signednesses.size(); i++) { + EXPECT_EQ(signednesses[i], types[i]->IsSigned()); + } +} + +TEST(Types, IntWidth) { + std::vector widths = {1, 2, 4, 8, 16, 32, 48, 64, 128}; + std::vector> types; + for (uint32_t w : widths) { + types.emplace_back(new Integer(w, true)); + } + for (size_t i = 0; i < widths.size(); i++) { + EXPECT_EQ(widths[i], types[i]->width()); + } +} + +TEST(Types, FloatWidth) { + std::vector widths = {1, 2, 4, 8, 16, 32, 48, 64, 128}; + std::vector> types; + for (uint32_t w : widths) { + types.emplace_back(new Float(w)); + } + for (size_t i = 0; i < widths.size(); i++) { + EXPECT_EQ(widths[i], types[i]->width()); + } +} + +TEST(Types, VectorElementCount) { + auto s32 = MakeUnique(32, true); + for (uint32_t c : {2, 3, 4}) { + auto s32v = MakeUnique(s32.get(), c); + EXPECT_EQ(c, s32v->element_count()); + } +} + +TEST(Types, MatrixElementCount) { + auto s32 = MakeUnique(32, true); + auto s32v4 = MakeUnique(s32.get(), 4); + for (uint32_t c : {1, 2, 3, 4, 10, 100}) { + auto s32m = MakeUnique(s32v4.get(), c); + EXPECT_EQ(c, s32m->element_count()); + } +} + +TEST(Types, IsUniqueType) { + std::vector> types = GenerateAllTypes(); + + for (auto& t : types) { + bool expectation = true; + // Disallowing variable pointers. + switch (t->kind()) { + case Type::kArray: + case Type::kRuntimeArray: + case Type::kStruct: + expectation = false; + break; + default: + break; + } + EXPECT_EQ(t->IsUniqueType(false), expectation) + << "expected '" << t->str() << "' to be a " + << (expectation ? "" : "non-") << "unique type"; + + // Allowing variables pointers. + if (t->AsPointer()) expectation = false; + EXPECT_EQ(t->IsUniqueType(true), expectation) + << "expected '" << t->str() << "' to be a " + << (expectation ? "" : "non-") << "unique type"; + } +} + +std::vector> GenerateAllTypesWithDecorations() { + std::vector> types = GenerateAllTypes(); + uint32_t elems = 1; + uint32_t decs = 1; + for (auto& t : types) { + for (uint32_t i = 0; i < (decs % 10); ++i) { + std::vector decoration; + for (uint32_t j = 0; j < (elems % 4) + 1; ++j) { + decoration.push_back(j); + } + t->AddDecoration(std::move(decoration)); + ++elems; + ++decs; + } + } + + return types; +} + +TEST(Types, Clone) { + std::vector> types = GenerateAllTypesWithDecorations(); + for (auto& t : types) { + auto clone = t->Clone(); + EXPECT_TRUE(*t == *clone); + EXPECT_TRUE(t->HasSameDecorations(clone.get())); + EXPECT_NE(clone.get(), t.get()); + } +} + +TEST(Types, RemoveDecorations) { + std::vector> types = GenerateAllTypesWithDecorations(); + for (auto& t : types) { + auto decorationless = t->RemoveDecorations(); + EXPECT_EQ(*t == *decorationless, t->decoration_empty()); + EXPECT_EQ(t->HasSameDecorations(decorationless.get()), + t->decoration_empty()); + EXPECT_NE(t.get(), decorationless.get()); + } +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/unify_const_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/unify_const_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/unify_const_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/unify_const_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,983 @@ +// Copyright (c) 2016 Google 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. + +#include + +#include "assembly_builder.h" +#include "pass_fixture.h" +#include "pass_utils.h" + +namespace { +using namespace spvtools; + +// Returns the types defining instructions commonly used in many tests. +std::vector CommonTypes() { + return std::vector{ + // clang-format off + // scalar types + "%bool = OpTypeBool", + "%uint = OpTypeInt 32 0", + "%int = OpTypeInt 32 1", + "%uint64 = OpTypeInt 64 0", + "%int64 = OpTypeInt 64 1", + "%float = OpTypeFloat 32", + "%double = OpTypeFloat 64", + // vector types + "%v2bool = OpTypeVector %bool 2", + "%v2uint = OpTypeVector %uint 2", + "%v2int = OpTypeVector %int 2", + "%v3int = OpTypeVector %int 3", + "%v4int = OpTypeVector %int 4", + "%v2float = OpTypeVector %float 2", + "%v3float = OpTypeVector %float 3", + "%v2double = OpTypeVector %double 2", + // struct types + "%inner_struct = OpTypeStruct %bool %float", + "%outer_struct = OpTypeStruct %inner_struct %int %double", + "%flat_struct = OpTypeStruct %bool %int %float %double", + // variable pointer types + "%_pf_bool = OpTypePointer Function %bool", + "%_pf_uint = OpTypePointer Function %uint", + "%_pf_int = OpTypePointer Function %int", + "%_pf_uint64 = OpTypePointer Function %uint64", + "%_pf_int64 = OpTypePointer Function %int64", + "%_pf_float = OpTypePointer Function %float", + "%_pf_double = OpTypePointer Function %double", + "%_pf_v2int = OpTypePointer Function %v2int", + "%_pf_v3int = OpTypePointer Function %v3int", + "%_pf_v4int = OpTypePointer Function %v4int", + "%_pf_v2float = OpTypePointer Function %v2float", + "%_pf_v3float = OpTypePointer Function %v3float", + "%_pf_v2double = OpTypePointer Function %v2double", + "%_pf_inner_struct = OpTypePointer Function %inner_struct", + "%_pf_outer_struct = OpTypePointer Function %outer_struct", + "%_pf_flat_struct = OpTypePointer Function %flat_struct", + // clang-format on + }; +} + +// A helper function to strip OpName instructions from the given string of +// disassembly code and put those debug instructions to a set. Returns the +// string with all OpName instruction stripped and a set of OpName +// instructions. +std::tuple> +StripOpNameInstructionsToSet(const std::string& str) { + std::stringstream ss(str); + std::ostringstream oss; + std::string inst_str; + std::unordered_set opname_instructions; + while (std::getline(ss, inst_str, '\n')) { + if (inst_str.find("OpName %") == std::string::npos) { + oss << inst_str << '\n'; + } else { + opname_instructions.insert(inst_str); + } + } + return std::make_tuple(oss.str(), std::move(opname_instructions)); +} + +// The test fixture for all tests of UnifyConstantPass. This fixture defines +// the rule of checking: all the optimized code should be exactly the same as +// the expected code, except the OpName instructions, which can be different in +// order. +template +class UnifyConstantTest : public PassTest { + protected: + // Runs UnifyConstantPass on the code built from the given |test_builder|, + // and checks whether the optimization result matches with the code built + // from |expected_builder|. + void Check(const AssemblyBuilder& expected_builder, + const AssemblyBuilder& test_builder) { + // unoptimized code + const std::string original_before_strip = test_builder.GetCode(); + std::string original_without_opnames; + std::unordered_set original_opnames; + std::tie(original_without_opnames, original_opnames) = + StripOpNameInstructionsToSet(original_before_strip); + + // expected code + std::string expected_without_opnames; + std::unordered_set expected_opnames; + std::tie(expected_without_opnames, expected_opnames) = + StripOpNameInstructionsToSet(expected_builder.GetCode()); + + // optimized code + std::string optimized_before_strip; + auto status = opt::Pass::Status::SuccessWithoutChange; + std::tie(optimized_before_strip, status) = + this->template SinglePassRunAndDisassemble( + test_builder.GetCode(), + /* skip_nop = */ true, /* do_validation = */ false); + std::string optimized_without_opnames; + std::unordered_set optimized_opnames; + std::tie(optimized_without_opnames, optimized_opnames) = + StripOpNameInstructionsToSet(optimized_before_strip); + + // Flag "status" should be returned correctly. + EXPECT_NE(opt::Pass::Status::Failure, status); + EXPECT_EQ(expected_without_opnames == original_without_opnames, + status == opt::Pass::Status::SuccessWithoutChange); + // Code except OpName instructions should be exactly the same. + EXPECT_EQ(expected_without_opnames, optimized_without_opnames); + // OpName instructions can be in different order, but the content must be + // the same. + EXPECT_EQ(expected_opnames, optimized_opnames); + } +}; + +using UnifyFrontEndConstantSingleTest = + UnifyConstantTest>; + +TEST_F(UnifyFrontEndConstantSingleTest, Basic) { + AssemblyBuilder test_builder; + AssemblyBuilder expected_builder; + + test_builder + .AppendTypesConstantsGlobals({ + "%uint = OpTypeInt 32 0", "%_pf_uint = OpTypePointer Function %uint", + "%unsigned_1 = OpConstant %uint 1", + "%unsigned_1_duplicate = OpConstant %uint 1", // duplicated constant + }) + .AppendInMain({ + "%uint_var = OpVariable %_pf_uint Function", + "OpStore %uint_var %unsigned_1_duplicate", + }); + + expected_builder + .AppendTypesConstantsGlobals({ + "%uint = OpTypeInt 32 0", + "%_pf_uint = OpTypePointer Function %uint", + "%unsigned_1 = OpConstant %uint 1", + }) + .AppendInMain({ + "%uint_var = OpVariable %_pf_uint Function", + "OpStore %uint_var %unsigned_1", + }) + .AppendNames({ + "OpName %unsigned_1 \"unsigned_1_duplicate\"", // the OpName + // instruction of the + // removed duplicated + // constant won't be + // erased. + }); + Check(expected_builder, test_builder); +} + +TEST_F(UnifyFrontEndConstantSingleTest, SkipWhenResultIdHasDecorations) { + AssemblyBuilder test_builder; + AssemblyBuilder expected_builder; + + test_builder + .AppendAnnotations({ + // So far we don't have valid decorations for constants. This is + // preparing for the future updates of SPIR-V. + // TODO(qining): change to a valid decoration once they are available. + "OpDecorate %f_1 RelaxedPrecision", + "OpDecorate %f_2_dup RelaxedPrecision", + }) + .AppendTypesConstantsGlobals({ + // clang-format off + "%float = OpTypeFloat 32", + "%_pf_float = OpTypePointer Function %float", + "%f_1 = OpConstant %float 1", + // %f_1 has decoration, so %f_1 will not be used to replace %f_1_dup. + "%f_1_dup = OpConstant %float 1", + "%f_2 = OpConstant %float 2", + // %_2_dup has decoration, so %f_2 will not replace %f_2_dup. + "%f_2_dup = OpConstant %float 2", + // no decoration for %f_3 or %f_3_dup, %f_3_dup should be replaced. + "%f_3 = OpConstant %float 3", + "%f_3_dup = OpConstant %float 3", + // clang-format on + }) + .AppendInMain({ + // clang-format off + "%f_var = OpVariable %_pf_float Function", + "OpStore %f_var %f_1_dup", + "OpStore %f_var %f_2_dup", + "OpStore %f_var %f_3_dup", + // clang-format on + }); + + expected_builder + .AppendAnnotations({ + "OpDecorate %f_1 RelaxedPrecision", + "OpDecorate %f_2_dup RelaxedPrecision", + }) + .AppendTypesConstantsGlobals({ + // clang-format off + "%float = OpTypeFloat 32", + "%_pf_float = OpTypePointer Function %float", + "%f_1 = OpConstant %float 1", + "%f_1_dup = OpConstant %float 1", + "%f_2 = OpConstant %float 2", + "%f_2_dup = OpConstant %float 2", + "%f_3 = OpConstant %float 3", + // clang-format on + }) + .AppendInMain({ + // clang-format off + "%f_var = OpVariable %_pf_float Function", + "OpStore %f_var %f_1_dup", + "OpStore %f_var %f_2_dup", + "OpStore %f_var %f_3", + // clang-format on + }) + .AppendNames({ + "OpName %f_3 \"f_3_dup\"", + }); + + Check(expected_builder, test_builder); +} + +TEST_F(UnifyFrontEndConstantSingleTest, UnifyWithDecorationOnTypes) { + AssemblyBuilder test_builder; + AssemblyBuilder expected_builder; + + test_builder + .AppendAnnotations({ + "OpMemberDecorate %flat_d 1 RelaxedPrecision", + }) + .AppendTypesConstantsGlobals({ + // clang-format off + "%int = OpTypeInt 32 1", + "%float = OpTypeFloat 32", + "%flat = OpTypeStruct %int %float", + "%_pf_flat = OpTypePointer Function %flat", + // decorated flat struct + "%flat_d = OpTypeStruct %int %float", + "%_pf_flat_d = OpTypePointer Function %flat_d", + // perserved contants. %flat_1 and %flat_d has same members, but + // their type are different in decorations, so they should not be + // used to replace each other. + "%int_1 = OpConstant %int 1", + "%float_1 = OpConstant %float 1", + "%flat_1 = OpConstantComposite %flat %int_1 %float_1", + "%flat_d_1 = OpConstantComposite %flat_d %int_1 %float_1", + // duplicated constants. + "%flat_1_dup = OpConstantComposite %flat %int_1 %float_1", + "%flat_d_1_dup = OpConstantComposite %flat_d %int_1 %float_1", + // clang-format on + }) + .AppendInMain({ + "%flat_var = OpVariable %_pf_flat Function", + "OpStore %flat_var %flat_1_dup", + "%flat_d_var = OpVariable %_pf_flat_d Function", + "OpStore %flat_d_var %flat_d_1_dup", + }); + + expected_builder + .AppendAnnotations({ + "OpMemberDecorate %flat_d 1 RelaxedPrecision", + }) + .AppendTypesConstantsGlobals({ + // clang-format off + "%int = OpTypeInt 32 1", + "%float = OpTypeFloat 32", + "%flat = OpTypeStruct %int %float", + "%_pf_flat = OpTypePointer Function %flat", + // decorated flat struct + "%flat_d = OpTypeStruct %int %float", + "%_pf_flat_d = OpTypePointer Function %flat_d", + "%int_1 = OpConstant %int 1", + "%float_1 = OpConstant %float 1", + "%flat_1 = OpConstantComposite %flat %int_1 %float_1", + "%flat_d_1 = OpConstantComposite %flat_d %int_1 %float_1", + // clang-format on + }) + .AppendInMain({ + "%flat_var = OpVariable %_pf_flat Function", + "OpStore %flat_var %flat_1", + "%flat_d_var = OpVariable %_pf_flat_d Function", + "OpStore %flat_d_var %flat_d_1", + }) + .AppendNames({ + "OpName %flat_1 \"flat_1_dup\"", + "OpName %flat_d_1 \"flat_d_1_dup\"", + }); + + Check(expected_builder, test_builder); +} + +struct UnifyConstantTestCase { + // preserved constants. + std::vector preserved_consts; + // expected uses of the preserved constants. + std::vector use_preserved_consts; + // duplicated constants of the preserved constants. + std::vector duplicate_consts; + // uses of the duplicated constants, expected to be updated to use the + // preserved constants. + std::vector use_duplicate_consts; + // The updated OpName instructions that originally refer to duplicated + // constants. + std::vector remapped_names; +}; + +using UnifyFrontEndConstantParamTest = UnifyConstantTest< + PassTest<::testing::TestWithParam>>; + +TEST_P(UnifyFrontEndConstantParamTest, TestCase) { + auto& tc = GetParam(); + AssemblyBuilder test_builder; + AssemblyBuilder expected_builder; + test_builder.AppendTypesConstantsGlobals(CommonTypes()); + expected_builder.AppendTypesConstantsGlobals(CommonTypes()); + + test_builder.AppendTypesConstantsGlobals(tc.preserved_consts) + .AppendTypesConstantsGlobals(tc.duplicate_consts) + .AppendInMain(tc.use_duplicate_consts); + + // Duplicated constants are killed in the expected output, and the debug + // instructions attached to those duplicated instructions will be migrated to + // the corresponding preserved constants. + expected_builder.AppendTypesConstantsGlobals(tc.preserved_consts) + .AppendInMain(tc.use_preserved_consts) + .AppendNames(tc.remapped_names); + + Check(expected_builder, test_builder); +} + +INSTANTIATE_TEST_CASE_P(Case, UnifyFrontEndConstantParamTest, + ::testing::ValuesIn(std::vector({ + // clang-format off + // basic tests for scalar constants + { + // preserved constants + { + "%bool_true = OpConstantTrue %bool", + "%signed_1 = OpConstant %int 1", + "%signed_minus_1 = OpConstant %int64 -1", + "%unsigned_max = OpConstant %uint64 18446744073709551615", + "%float_1 = OpConstant %float 1", + "%double_1 = OpConstant %double 1", + }, + // use preserved constants in main + { + "%bool_var = OpVariable %_pf_bool Function", + "OpStore %bool_var %bool_true", + "%int_var = OpVariable %_pf_int Function", + "OpStore %int_var %signed_1", + "%int64_var = OpVariable %_pf_int64 Function", + "OpStore %int64_var %signed_minus_1", + "%uint64_var = OpVariable %_pf_uint64 Function", + "OpStore %uint64_var %unsigned_max", + "%float_var = OpVariable %_pf_float Function", + "OpStore %float_var %float_1", + "%double_var = OpVariable %_pf_double Function", + "OpStore %double_var %double_1", + }, + // duplicated constants + { + "%bool_true_duplicate = OpConstantTrue %bool", + "%signed_1_duplicate = OpConstant %int 1", + "%signed_minus_1_duplicate = OpConstant %int64 -1", + "%unsigned_max_duplicate = OpConstant %uint64 18446744073709551615", + "%float_1_duplicate = OpConstant %float 1", + "%double_1_duplicate = OpConstant %double 1", + }, + // use duplicated constants in main + { + "%bool_var = OpVariable %_pf_bool Function", + "OpStore %bool_var %bool_true_duplicate", + "%int_var = OpVariable %_pf_int Function", + "OpStore %int_var %signed_1_duplicate", + "%int64_var = OpVariable %_pf_int64 Function", + "OpStore %int64_var %signed_minus_1_duplicate", + "%uint64_var = OpVariable %_pf_uint64 Function", + "OpStore %uint64_var %unsigned_max_duplicate", + "%float_var = OpVariable %_pf_float Function", + "OpStore %float_var %float_1_duplicate", + "%double_var = OpVariable %_pf_double Function", + "OpStore %double_var %double_1_duplicate", + }, + // remapped names + { + "OpName %bool_true \"bool_true_duplicate\"", + "OpName %signed_1 \"signed_1_duplicate\"", + "OpName %signed_minus_1 \"signed_minus_1_duplicate\"", + "OpName %unsigned_max \"unsigned_max_duplicate\"", + "OpName %float_1 \"float_1_duplicate\"", + "OpName %double_1 \"double_1_duplicate\"", + }, + }, + // NaN in different bit patterns should not be unified, but the ones + // using same bit pattern should be unified. + { + // preserved constants + { + "%float_nan_1 = OpConstant %float 0x1.8p+128", // !2143289344, 7FC00000 + "%float_nan_2 = OpConstant %float 0x1.800002p+128",// !2143289345 7FC00001 + }, + // use preserved constants in main + { + "%float_var = OpVariable %_pf_float Function", + "OpStore %float_var %float_nan_1", + "OpStore %float_var %float_nan_2", + }, + // duplicated constants + { + "%float_nan_1_duplicate = OpConstant %float 0x1.8p+128", // !2143289344, 7FC00000 + "%float_nan_2_duplicate = OpConstant %float 0x1.800002p+128",// !2143289345, 7FC00001 + }, + // use duplicated constants in main + { + "%float_var = OpVariable %_pf_float Function", + "OpStore %float_var %float_nan_1_duplicate", + "OpStore %float_var %float_nan_2_duplicate", + }, + // remapped names + { + "OpName %float_nan_1 \"float_nan_1_duplicate\"", + "OpName %float_nan_2 \"float_nan_2_duplicate\"", + }, + }, + // null values + { + // preserved constants + { + "%bool_null = OpConstantNull %bool", + "%signed_null = OpConstantNull %int", + "%signed_64_null = OpConstantNull %int64", + "%float_null = OpConstantNull %float", + "%double_null = OpConstantNull %double", + // zero-valued constants will not be unified with the equivalent + // null constants. + "%signed_zero = OpConstant %int 0", + }, + // use preserved constants in main + { + "%bool_var = OpVariable %_pf_bool Function", + "OpStore %bool_var %bool_null", + "%int_var = OpVariable %_pf_int Function", + "OpStore %int_var %signed_null", + "%int64_var = OpVariable %_pf_int64 Function", + "OpStore %int64_var %signed_64_null", + "%float_var = OpVariable %_pf_float Function", + "OpStore %float_var %float_null", + "%double_var = OpVariable %_pf_double Function", + "OpStore %double_var %double_null", + }, + // duplicated constants + { + "%bool_null_duplicate = OpConstantNull %bool", + "%signed_null_duplicate = OpConstantNull %int", + "%signed_64_null_duplicate = OpConstantNull %int64", + "%float_null_duplicate = OpConstantNull %float", + "%double_null_duplicate = OpConstantNull %double", + }, + // use duplicated constants in main + { + "%bool_var = OpVariable %_pf_bool Function", + "OpStore %bool_var %bool_null_duplicate", + "%int_var = OpVariable %_pf_int Function", + "OpStore %int_var %signed_null_duplicate", + "%int64_var = OpVariable %_pf_int64 Function", + "OpStore %int64_var %signed_64_null_duplicate", + "%float_var = OpVariable %_pf_float Function", + "OpStore %float_var %float_null_duplicate", + "%double_var = OpVariable %_pf_double Function", + "OpStore %double_var %double_null_duplicate", + }, + // remapped names + { + "OpName %bool_null \"bool_null_duplicate\"", + "OpName %signed_null \"signed_null_duplicate\"", + "OpName %signed_64_null \"signed_64_null_duplicate\"", + "OpName %float_null \"float_null_duplicate\"", + "OpName %double_null \"double_null_duplicate\"", + }, + }, + // constant sampler + { + // preserved constants + { + "%sampler = OpTypeSampler", + "%_pf_sampler = OpTypePointer Function %sampler", + "%sampler_1 = OpConstantSampler %sampler Repeat 0 Linear", + }, + // use preserved constants in main + { + "%sampler_var = OpVariable %_pf_sampler Function", + "OpStore %sampler_var %sampler_1", + }, + // duplicated constants + { + "%sampler_1_duplicate = OpConstantSampler %sampler Repeat 0 Linear", + }, + // use duplicated constants in main + { + "%sampler_var = OpVariable %_pf_sampler Function", + "OpStore %sampler_var %sampler_1_duplicate", + }, + // remapped names + { + "OpName %sampler_1 \"sampler_1_duplicate\"", + }, + }, + // duplicate vector built from same ids. + { + // preserved constants + { + "%signed_1 = OpConstant %int 1", + "%signed_2 = OpConstant %int 2", + "%signed_3 = OpConstant %int 3", + "%signed_4 = OpConstant %int 4", + "%vec = OpConstantComposite %v4int %signed_1 %signed_2 %signed_3 %signed_4", + }, + // use preserved constants in main + { + "%vec_var = OpVariable %_pf_v4int Function", + "OpStore %vec_var %vec", + }, + // duplicated constants + { + "%vec_duplicate = OpConstantComposite %v4int %signed_1 %signed_2 %signed_3 %signed_4", + }, + // use duplicated constants in main + { + "%vec_var = OpVariable %_pf_v4int Function", + "OpStore %vec_var %vec_duplicate", + }, + // remapped names + { + "OpName %vec \"vec_duplicate\"", + } + }, + // duplicate vector built from duplicated ids. + { + // preserved constants + { + "%signed_1 = OpConstant %int 1", + "%signed_2 = OpConstant %int 2", + "%signed_3 = OpConstant %int 3", + "%signed_4 = OpConstant %int 4", + "%vec = OpConstantComposite %v4int %signed_1 %signed_2 %signed_3 %signed_4", + }, + // use preserved constants in main + { + "%vec_var = OpVariable %_pf_v4int Function", + "OpStore %vec_var %vec", + }, + // duplicated constants + { + "%signed_3_duplicate = OpConstant %int 3", + "%signed_4_duplicate = OpConstant %int 4", + "%vec_duplicate = OpConstantComposite %v4int %signed_1 %signed_2 %signed_3_duplicate %signed_4_duplicate", + }, + // use duplicated constants in main + { + "%vec_var = OpVariable %_pf_v4int Function", + "OpStore %vec_var %vec_duplicate", + }, + // remapped names + { + "OpName %signed_3 \"signed_3_duplicate\"", + "OpName %signed_4 \"signed_4_duplicate\"", + "OpName %vec \"vec_duplicate\"", + }, + }, + // flat struct + { + // preserved constants + { + "%bool_true = OpConstantTrue %bool", + "%signed_1 = OpConstant %int 1", + "%float_1 = OpConstant %float 1", + "%double_1 = OpConstant %double 1", + "%s = OpConstantComposite %flat_struct %bool_true %signed_1 %float_1 %double_1", + }, + // use preserved constants in main + { + "%s_var = OpVariable %_pf_flat_struct Function", + "OpStore %s_var %s", + }, + // duplicated constants + { + "%float_1_duplicate = OpConstant %float 1", + "%double_1_duplicate = OpConstant %double 1", + "%s_duplicate = OpConstantComposite %flat_struct %bool_true %signed_1 %float_1_duplicate %double_1_duplicate", + }, + // use duplicated constants in main + { + "%s_var = OpVariable %_pf_flat_struct Function", + "OpStore %s_var %s_duplicate", + }, + // remapped names + { + "OpName %float_1 \"float_1_duplicate\"", + "OpName %double_1 \"double_1_duplicate\"", + "OpName %s \"s_duplicate\"", + }, + }, + // nested struct + { + // preserved constants + { + "%bool_true = OpConstantTrue %bool", + "%signed_1 = OpConstant %int 1", + "%float_1 = OpConstant %float 1", + "%double_1 = OpConstant %double 1", + "%inner = OpConstantComposite %inner_struct %bool_true %float_1", + "%outer = OpConstantComposite %outer_struct %inner %signed_1 %double_1", + }, + // use preserved constants in main + { + "%outer_var = OpVariable %_pf_outer_struct Function", + "OpStore %outer_var %outer", + }, + // duplicated constants + { + "%float_1_duplicate = OpConstant %float 1", + "%double_1_duplicate = OpConstant %double 1", + "%inner_duplicate = OpConstantComposite %inner_struct %bool_true %float_1_duplicate", + "%outer_duplicate = OpConstantComposite %outer_struct %inner_duplicate %signed_1 %double_1_duplicate", + }, + // use duplicated constants in main + { + "%outer_var = OpVariable %_pf_outer_struct Function", + "OpStore %outer_var %outer_duplicate", + }, + // remapped names + { + "OpName %float_1 \"float_1_duplicate\"", + "OpName %double_1 \"double_1_duplicate\"", + "OpName %inner \"inner_duplicate\"", + "OpName %outer \"outer_duplicate\"", + }, + }, + // composite type null constants. Null constants and zero-valued + // constants should not be used to replace each other. + { + // preserved constants + { + "%bool_zero = OpConstantFalse %bool", + "%float_zero = OpConstant %float 0", + "%int_null = OpConstantNull %int", + "%double_null = OpConstantNull %double", + // inner_struct type null constant. + "%null_inner = OpConstantNull %inner_struct", + // zero-valued composite constant built from zero-valued constant + // component. inner_zero should not be replace by null_inner. + "%inner_zero = OpConstantComposite %inner_struct %bool_zero %float_zero", + // zero-valued composite contant built from zero-valued constants + // and null constants. + "%outer_zero = OpConstantComposite %outer_struct %inner_zero %int_null %double_null", + // outer_struct type null constant, it should not be replaced by + // outer_zero. + "%null_outer = OpConstantNull %outer_struct", + }, + // use preserved constants in main + { + "%inner_var = OpVariable %_pf_inner_struct Function", + "OpStore %inner_var %inner_zero", + "OpStore %inner_var %null_inner", + "%outer_var = OpVariable %_pf_outer_struct Function", + "OpStore %outer_var %outer_zero", + "OpStore %outer_var %null_outer", + }, + // duplicated constants + { + "%null_inner_dup = OpConstantNull %inner_struct", + "%null_outer_dup = OpConstantNull %outer_struct", + "%inner_zero_dup = OpConstantComposite %inner_struct %bool_zero %float_zero", + "%outer_zero_dup = OpConstantComposite %outer_struct %inner_zero_dup %int_null %double_null", + }, + // use duplicated constants in main + { + "%inner_var = OpVariable %_pf_inner_struct Function", + "OpStore %inner_var %inner_zero_dup", + "OpStore %inner_var %null_inner_dup", + "%outer_var = OpVariable %_pf_outer_struct Function", + "OpStore %outer_var %outer_zero_dup", + "OpStore %outer_var %null_outer_dup", + }, + // remapped names + { + "OpName %null_inner \"null_inner_dup\"", + "OpName %null_outer \"null_outer_dup\"", + "OpName %inner_zero \"inner_zero_dup\"", + "OpName %outer_zero \"outer_zero_dup\"", + }, + }, + // Spec Constants with SpecId decoration should be skipped. + { + // preserved constants + { + // Assembly builder will add OpDecorate SpecId instruction for the + // following spec constant instructions automatically. + "%spec_bool_1 = OpSpecConstantTrue %bool", + "%spec_bool_2 = OpSpecConstantTrue %bool", + "%spec_int_1 = OpSpecConstant %int 1", + "%spec_int_2 = OpSpecConstant %int 1", + }, + // use preserved constants in main + { + "%bool_var = OpVariable %_pf_bool Function", + "OpStore %bool_var %spec_bool_1", + "OpStore %bool_var %spec_bool_2", + "%int_var = OpVariable %_pf_int Function", + "OpStore %int_var %spec_int_1", + "OpStore %int_var %spec_int_2", + }, + // duplicated constants. No duplicated instruction to remove in this + // case. + {}, + // use duplicated constants in main. Same as the above 'use preserved + // constants in main' defined above, as no instruction should be + // removed in this case. + { + "%bool_var = OpVariable %_pf_bool Function", + "OpStore %bool_var %spec_bool_1", + "OpStore %bool_var %spec_bool_2", + "%int_var = OpVariable %_pf_int Function", + "OpStore %int_var %spec_int_1", + "OpStore %int_var %spec_int_2", + }, + // remapped names. No duplicated instruction removed, so this is + // empty. + {} + }, + // spec constant composite + { + // preserved constants + { + "%spec_bool_true = OpSpecConstantTrue %bool", + "%spec_signed_1 = OpSpecConstant %int 1", + "%float_1 = OpConstant %float 1", + "%double_1 = OpConstant %double 1", + "%spec_inner = OpSpecConstantComposite %inner_struct %spec_bool_true %float_1", + "%spec_outer = OpSpecConstantComposite %outer_struct %spec_inner %spec_signed_1 %double_1", + "%spec_vec2 = OpSpecConstantComposite %v2float %float_1 %float_1", + }, + // use preserved constants in main + { + "%outer_var = OpVariable %_pf_outer_struct Function", + "OpStore %outer_var %spec_outer", + "%v2float_var = OpVariable %_pf_v2float Function", + "OpStore %v2float_var %spec_vec2", + }, + // duplicated constants + { + "%float_1_duplicate = OpConstant %float 1", + "%double_1_duplicate = OpConstant %double 1", + "%spec_inner_duplicate = OpSpecConstantComposite %inner_struct %spec_bool_true %float_1_duplicate", + "%spec_outer_duplicate = OpSpecConstantComposite %outer_struct %spec_inner_duplicate %spec_signed_1 %double_1_duplicate", + "%spec_vec2_duplicate = OpSpecConstantComposite %v2float %float_1 %float_1_duplicate", + }, + // use duplicated constants in main + { + "%outer_var = OpVariable %_pf_outer_struct Function", + "OpStore %outer_var %spec_outer_duplicate", + "%v2float_var = OpVariable %_pf_v2float Function", + "OpStore %v2float_var %spec_vec2_duplicate", + }, + // remapped names + { + "OpName %float_1 \"float_1_duplicate\"", + "OpName %double_1 \"double_1_duplicate\"", + "OpName %spec_inner \"spec_inner_duplicate\"", + "OpName %spec_outer \"spec_outer_duplicate\"", + "OpName %spec_vec2 \"spec_vec2_duplicate\"", + }, + }, + // spec constant op with int scalar + { + // preserved constants + { + "%spec_signed_1 = OpSpecConstant %int 1", + "%spec_signed_2 = OpSpecConstant %int 2", + "%spec_signed_add = OpSpecConstantOp %int IAdd %spec_signed_1 %spec_signed_2", + }, + // use preserved constants in main + { + "%int_var = OpVariable %_pf_int Function", + "OpStore %int_var %spec_signed_add", + }, + // duplicated constants + { + "%spec_signed_add_duplicate = OpSpecConstantOp %int IAdd %spec_signed_1 %spec_signed_2", + }, + // use duplicated contants in main + { + "%int_var = OpVariable %_pf_int Function", + "OpStore %int_var %spec_signed_add_duplicate", + }, + // remapped names + { + "OpName %spec_signed_add \"spec_signed_add_duplicate\"", + }, + }, + // spec constant op composite extract + { + // preserved constants + { + "%float_1 = OpConstant %float 1", + "%spec_vec2 = OpSpecConstantComposite %v2float %float_1 %float_1", + "%spec_extract = OpSpecConstantOp %float CompositeExtract %spec_vec2 1", + }, + // use preserved constants in main + { + "%float_var = OpVariable %_pf_float Function", + "OpStore %float_var %spec_extract", + }, + // duplicated constants + { + "%spec_extract_duplicate = OpSpecConstantOp %float CompositeExtract %spec_vec2 1", + }, + // use duplicated constants in main + { + "%float_var = OpVariable %_pf_float Function", + "OpStore %float_var %spec_extract_duplicate", + }, + // remapped names + { + "OpName %spec_extract \"spec_extract_duplicate\"", + }, + }, + // spec constant op vector shuffle + { + // preserved constants + { + "%float_1 = OpConstant %float 1", + "%float_2 = OpConstant %float 2", + "%spec_vec2_1 = OpSpecConstantComposite %v2float %float_1 %float_1", + "%spec_vec2_2 = OpSpecConstantComposite %v2float %float_2 %float_2", + "%spec_vector_shuffle = OpSpecConstantOp %v2float VectorShuffle %spec_vec2_1 %spec_vec2_2 1 2", + }, + // use preserved constants in main + { + "%v2float_var = OpVariable %_pf_v2float Function", + "OpStore %v2float_var %spec_vector_shuffle", + }, + // duplicated constants + { + "%spec_vector_shuffle_duplicate = OpSpecConstantOp %v2float VectorShuffle %spec_vec2_1 %spec_vec2_2 1 2", + }, + // use duplicated constants in main + { + "%v2float_var = OpVariable %_pf_v2float Function", + "OpStore %v2float_var %spec_vector_shuffle_duplicate", + }, + // remapped names + { + "OpName %spec_vector_shuffle \"spec_vector_shuffle_duplicate\"", + }, + }, + // long dependency chain + { + // preserved constants + { + "%array_size = OpConstant %int 4", + "%type_arr_int_4 = OpTypeArray %int %array_size", + "%signed_0 = OpConstant %int 100", + "%signed_1 = OpConstant %int 1", + "%signed_2 = OpSpecConstantOp %int IAdd %signed_0 %signed_1", + "%signed_3 = OpSpecConstantOp %int ISub %signed_0 %signed_2", + "%signed_4 = OpSpecConstantOp %int IAdd %signed_0 %signed_3", + "%signed_5 = OpSpecConstantOp %int ISub %signed_0 %signed_4", + "%signed_6 = OpSpecConstantOp %int IAdd %signed_0 %signed_5", + "%signed_7 = OpSpecConstantOp %int ISub %signed_0 %signed_6", + "%signed_8 = OpSpecConstantOp %int IAdd %signed_0 %signed_7", + "%signed_9 = OpSpecConstantOp %int ISub %signed_0 %signed_8", + "%signed_10 = OpSpecConstantOp %int IAdd %signed_0 %signed_9", + "%signed_11 = OpSpecConstantOp %int ISub %signed_0 %signed_10", + "%signed_12 = OpSpecConstantOp %int IAdd %signed_0 %signed_11", + "%signed_13 = OpSpecConstantOp %int ISub %signed_0 %signed_12", + "%signed_14 = OpSpecConstantOp %int IAdd %signed_0 %signed_13", + "%signed_15 = OpSpecConstantOp %int ISub %signed_0 %signed_14", + "%signed_16 = OpSpecConstantOp %int ISub %signed_0 %signed_15", + "%signed_17 = OpSpecConstantOp %int IAdd %signed_0 %signed_16", + "%signed_18 = OpSpecConstantOp %int ISub %signed_0 %signed_17", + "%signed_19 = OpSpecConstantOp %int IAdd %signed_0 %signed_18", + "%signed_20 = OpSpecConstantOp %int ISub %signed_0 %signed_19", + "%signed_vec_a = OpSpecConstantComposite %v2int %signed_18 %signed_19", + "%signed_vec_b = OpSpecConstantOp %v2int IMul %signed_vec_a %signed_vec_a", + "%signed_21 = OpSpecConstantOp %int CompositeExtract %signed_vec_b 0", + "%signed_array = OpConstantComposite %type_arr_int_4 %signed_20 %signed_20 %signed_21 %signed_21", + "%signed_22 = OpSpecConstantOp %int CompositeExtract %signed_array 0", + }, + // use preserved constants in main + { + "%int_var = OpVariable %_pf_int Function", + "OpStore %int_var %signed_22", + }, + // duplicated constants + { + "%signed_0_dup = OpConstant %int 100", + "%signed_1_dup = OpConstant %int 1", + "%signed_2_dup = OpSpecConstantOp %int IAdd %signed_0_dup %signed_1_dup", + "%signed_3_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_2_dup", + "%signed_4_dup = OpSpecConstantOp %int IAdd %signed_0_dup %signed_3_dup", + "%signed_5_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_4_dup", + "%signed_6_dup = OpSpecConstantOp %int IAdd %signed_0_dup %signed_5_dup", + "%signed_7_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_6_dup", + "%signed_8_dup = OpSpecConstantOp %int IAdd %signed_0_dup %signed_7_dup", + "%signed_9_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_8_dup", + "%signed_10_dup = OpSpecConstantOp %int IAdd %signed_0_dup %signed_9_dup", + "%signed_11_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_10_dup", + "%signed_12_dup = OpSpecConstantOp %int IAdd %signed_0_dup %signed_11_dup", + "%signed_13_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_12_dup", + "%signed_14_dup = OpSpecConstantOp %int IAdd %signed_0_dup %signed_13_dup", + "%signed_15_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_14_dup", + "%signed_16_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_15_dup", + "%signed_17_dup = OpSpecConstantOp %int IAdd %signed_0_dup %signed_16_dup", + "%signed_18_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_17_dup", + "%signed_19_dup = OpSpecConstantOp %int IAdd %signed_0_dup %signed_18_dup", + "%signed_20_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_19_dup", + "%signed_vec_a_dup = OpSpecConstantComposite %v2int %signed_18_dup %signed_19_dup", + "%signed_vec_b_dup = OpSpecConstantOp %v2int IMul %signed_vec_a_dup %signed_vec_a_dup", + "%signed_21_dup = OpSpecConstantOp %int CompositeExtract %signed_vec_b_dup 0", + "%signed_array_dup = OpConstantComposite %type_arr_int_4 %signed_20_dup %signed_20_dup %signed_21_dup %signed_21_dup", + "%signed_22_dup = OpSpecConstantOp %int CompositeExtract %signed_array_dup 0", + }, + // use duplicated constants in main + { + "%int_var = OpVariable %_pf_int Function", + "OpStore %int_var %signed_22_dup", + }, + // remapped names + { + "OpName %signed_0 \"signed_0_dup\"", + "OpName %signed_1 \"signed_1_dup\"", + "OpName %signed_2 \"signed_2_dup\"", + "OpName %signed_3 \"signed_3_dup\"", + "OpName %signed_4 \"signed_4_dup\"", + "OpName %signed_5 \"signed_5_dup\"", + "OpName %signed_6 \"signed_6_dup\"", + "OpName %signed_7 \"signed_7_dup\"", + "OpName %signed_8 \"signed_8_dup\"", + "OpName %signed_9 \"signed_9_dup\"", + "OpName %signed_10 \"signed_10_dup\"", + "OpName %signed_11 \"signed_11_dup\"", + "OpName %signed_12 \"signed_12_dup\"", + "OpName %signed_13 \"signed_13_dup\"", + "OpName %signed_14 \"signed_14_dup\"", + "OpName %signed_15 \"signed_15_dup\"", + "OpName %signed_16 \"signed_16_dup\"", + "OpName %signed_17 \"signed_17_dup\"", + "OpName %signed_18 \"signed_18_dup\"", + "OpName %signed_19 \"signed_19_dup\"", + "OpName %signed_20 \"signed_20_dup\"", + "OpName %signed_vec_a \"signed_vec_a_dup\"", + "OpName %signed_vec_b \"signed_vec_b_dup\"", + "OpName %signed_21 \"signed_21_dup\"", + "OpName %signed_array \"signed_array_dup\"", + "OpName %signed_22 \"signed_22_dup\"", + }, + }, + // clang-format on + }))); + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/utils_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/utils_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/utils_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/utils_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,106 @@ +// Copyright (c) 2016 Google 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. + +#include + +#include "pass_utils.h" + +namespace { + +using namespace spvtools; + +TEST(JoinAllInsts, Cases) { + EXPECT_EQ("", JoinAllInsts({})); + EXPECT_EQ("a\n", JoinAllInsts({"a"})); + EXPECT_EQ("a\nb\n", JoinAllInsts({"a", "b"})); + EXPECT_EQ("a\nb\nc\n", JoinAllInsts({"a", "b", "c"})); + EXPECT_EQ("hello,\nworld!\n\n\n", JoinAllInsts({"hello,", "world!", "\n"})); +} + +TEST(JoinNonDebugInsts, Cases) { + EXPECT_EQ("", JoinNonDebugInsts({})); + EXPECT_EQ("a\n", JoinNonDebugInsts({"a"})); + EXPECT_EQ("", JoinNonDebugInsts({"OpName"})); + EXPECT_EQ("a\nb\n", JoinNonDebugInsts({"a", "b"})); + EXPECT_EQ("", JoinNonDebugInsts({"OpName", "%1 = OpString \"42\""})); + EXPECT_EQ("Opstring\n", JoinNonDebugInsts({"OpName", "Opstring"})); + EXPECT_EQ("the only remaining string\n", + JoinNonDebugInsts( + {"OpSourceContinued", "OpSource", "OpSourceExtension", + "lgtm OpName", "hello OpMemberName", "this is a OpString", + "lonely OpLine", "happy OpNoLine", "OpModuleProcessed", + "the only remaining string"})); +} + +namespace { +struct SubstringReplacementTestCase { + const char* orig_str; + const char* find_substr; + const char* replace_substr; + const char* expected_str; + bool replace_should_succeed; +}; +} // namespace +using FindAndReplaceTest = + ::testing::TestWithParam; + +TEST_P(FindAndReplaceTest, SubstringReplacement) { + auto process = std::string(GetParam().orig_str); + EXPECT_EQ(GetParam().replace_should_succeed, + FindAndReplace(&process, GetParam().find_substr, + GetParam().replace_substr)) + << "Original string: " << GetParam().orig_str + << " replace: " << GetParam().find_substr + << " to: " << GetParam().replace_substr + << " should returns: " << GetParam().replace_should_succeed; + EXPECT_STREQ(GetParam().expected_str, process.c_str()) + << "Original string: " << GetParam().orig_str + << " replace: " << GetParam().find_substr + << " to: " << GetParam().replace_substr + << " expected string: " << GetParam().expected_str; +} + +INSTANTIATE_TEST_CASE_P( + SubstringReplacement, FindAndReplaceTest, + ::testing::ValuesIn(std::vector({ + // orig string, find substring, replace substring, expected string, + // replacement happened + {"", "", "", "", false}, + {"", "b", "", "", false}, + {"", "", "c", "", false}, + {"", "a", "b", "", false}, + + {"a", "", "c", "a", false}, + {"a", "b", "c", "a", false}, + {"a", "b", "", "a", false}, + {"a", "a", "", "", true}, + {"a", "a", "b", "b", true}, + + {"ab", "a", "b", "bb", true}, + {"ab", "a", "", "b", true}, + {"ab", "b", "", "a", true}, + {"ab", "ab", "", "", true}, + {"ab", "ab", "cd", "cd", true}, + {"bc", "abc", "efg", "bc", false}, + + {"abc", "ab", "bc", "bcc", true}, + {"abc", "ab", "", "c", true}, + {"abc", "bc", "", "a", true}, + {"abc", "bc", "d", "ad", true}, + {"abc", "a", "123", "123bc", true}, + {"abc", "ab", "a", "ac", true}, + {"abc", "a", "aab", "aabbc", true}, + {"abc", "abcd", "efg", "abc", false}, + }))); +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/value_table_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/value_table_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/value_table_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/value_table_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,588 @@ +// Copyright (c) 2017 Google 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. + +#include "opt/value_number_table.h" + +#include "assembly_builder.h" +#include "gmock/gmock.h" +#include "opt/build_module.h" +#include "pass_fixture.h" + +namespace { + +using namespace spvtools; + +using ::testing::HasSubstr; +using ::testing::MatchesRegex; + +using ValueTableTest = PassTest<::testing::Test>; + +TEST_F(ValueTableTest, SameInstructionSameValue) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Function %5 + %2 = OpFunction %3 None %4 + %7 = OpLabel + %8 = OpVariable %6 Function + %9 = OpLoad %5 %8 + %10 = OpFAdd %5 %9 %9 + OpReturn + OpFunctionEnd + )"; + auto context = BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::ValueNumberTable vtable(context.get()); + ir::Instruction* inst = context->get_def_use_mgr()->GetDef(10); + EXPECT_EQ(vtable.GetValueNumber(inst), vtable.GetValueNumber(inst)); +} + +TEST_F(ValueTableTest, DifferentInstructionSameValue) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Function %5 + %2 = OpFunction %3 None %4 + %7 = OpLabel + %8 = OpVariable %6 Function + %9 = OpLoad %5 %8 + %10 = OpFAdd %5 %9 %9 + %11 = OpFAdd %5 %9 %9 + OpReturn + OpFunctionEnd + )"; + auto context = BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::ValueNumberTable vtable(context.get()); + ir::Instruction* inst1 = context->get_def_use_mgr()->GetDef(10); + ir::Instruction* inst2 = context->get_def_use_mgr()->GetDef(11); + EXPECT_EQ(vtable.GetValueNumber(inst1), vtable.GetValueNumber(inst2)); +} + +TEST_F(ValueTableTest, SameValueDifferentBlock) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Function %5 + %2 = OpFunction %3 None %4 + %7 = OpLabel + %8 = OpVariable %6 Function + %9 = OpLoad %5 %8 + %10 = OpFAdd %5 %9 %9 + OpBranch %11 + %11 = OpLabel + %12 = OpFAdd %5 %9 %9 + OpReturn + OpFunctionEnd + )"; + auto context = BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::ValueNumberTable vtable(context.get()); + ir::Instruction* inst1 = context->get_def_use_mgr()->GetDef(10); + ir::Instruction* inst2 = context->get_def_use_mgr()->GetDef(12); + EXPECT_EQ(vtable.GetValueNumber(inst1), vtable.GetValueNumber(inst2)); +} + +TEST_F(ValueTableTest, DifferentValue) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Function %5 + %2 = OpFunction %3 None %4 + %7 = OpLabel + %8 = OpVariable %6 Function + %9 = OpLoad %5 %8 + %10 = OpFAdd %5 %9 %9 + %11 = OpFAdd %5 %9 %10 + OpReturn + OpFunctionEnd + )"; + auto context = BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::ValueNumberTable vtable(context.get()); + ir::Instruction* inst1 = context->get_def_use_mgr()->GetDef(10); + ir::Instruction* inst2 = context->get_def_use_mgr()->GetDef(11); + EXPECT_NE(vtable.GetValueNumber(inst1), vtable.GetValueNumber(inst2)); +} + +TEST_F(ValueTableTest, DifferentValueDifferentBlock) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Function %5 + %2 = OpFunction %3 None %4 + %7 = OpLabel + %8 = OpVariable %6 Function + %9 = OpLoad %5 %8 + %10 = OpFAdd %5 %9 %9 + OpBranch %11 + %11 = OpLabel + %12 = OpFAdd %5 %9 %10 + OpReturn + OpFunctionEnd + )"; + auto context = BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::ValueNumberTable vtable(context.get()); + ir::Instruction* inst1 = context->get_def_use_mgr()->GetDef(10); + ir::Instruction* inst2 = context->get_def_use_mgr()->GetDef(12); + EXPECT_NE(vtable.GetValueNumber(inst1), vtable.GetValueNumber(inst2)); +} + +TEST_F(ValueTableTest, SameLoad) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Function %5 + %2 = OpFunction %3 None %4 + %7 = OpLabel + %8 = OpVariable %6 Function + %9 = OpLoad %5 %8 + OpReturn + OpFunctionEnd + )"; + auto context = BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::ValueNumberTable vtable(context.get()); + ir::Instruction* inst = context->get_def_use_mgr()->GetDef(9); + EXPECT_EQ(vtable.GetValueNumber(inst), vtable.GetValueNumber(inst)); +} + +// Two different loads, even from the same memory, must given different value +// numbers if the memory is not read-only. +TEST_F(ValueTableTest, DifferentFunctionLoad) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Function %5 + %2 = OpFunction %3 None %4 + %7 = OpLabel + %8 = OpVariable %6 Function + %9 = OpLoad %5 %8 + %10 = OpLoad %5 %8 + OpReturn + OpFunctionEnd + )"; + auto context = BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::ValueNumberTable vtable(context.get()); + ir::Instruction* inst1 = context->get_def_use_mgr()->GetDef(9); + ir::Instruction* inst2 = context->get_def_use_mgr()->GetDef(10); + EXPECT_NE(vtable.GetValueNumber(inst1), vtable.GetValueNumber(inst2)); +} + +TEST_F(ValueTableTest, DifferentUniformLoad) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Uniform %5 + %8 = OpVariable %6 Uniform + %2 = OpFunction %3 None %4 + %7 = OpLabel + %9 = OpLoad %5 %8 + %10 = OpLoad %5 %8 + OpReturn + OpFunctionEnd + )"; + auto context = BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::ValueNumberTable vtable(context.get()); + ir::Instruction* inst1 = context->get_def_use_mgr()->GetDef(9); + ir::Instruction* inst2 = context->get_def_use_mgr()->GetDef(10); + EXPECT_EQ(vtable.GetValueNumber(inst1), vtable.GetValueNumber(inst2)); +} + +TEST_F(ValueTableTest, DifferentInputLoad) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Input %5 + %8 = OpVariable %6 Input + %2 = OpFunction %3 None %4 + %7 = OpLabel + %9 = OpLoad %5 %8 + %10 = OpLoad %5 %8 + OpReturn + OpFunctionEnd + )"; + auto context = BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::ValueNumberTable vtable(context.get()); + ir::Instruction* inst1 = context->get_def_use_mgr()->GetDef(9); + ir::Instruction* inst2 = context->get_def_use_mgr()->GetDef(10); + EXPECT_EQ(vtable.GetValueNumber(inst1), vtable.GetValueNumber(inst2)); +} + +TEST_F(ValueTableTest, DifferentUniformConstantLoad) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer UniformConstant %5 + %8 = OpVariable %6 UniformConstant + %2 = OpFunction %3 None %4 + %7 = OpLabel + %9 = OpLoad %5 %8 + %10 = OpLoad %5 %8 + OpReturn + OpFunctionEnd + )"; + auto context = BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::ValueNumberTable vtable(context.get()); + ir::Instruction* inst1 = context->get_def_use_mgr()->GetDef(9); + ir::Instruction* inst2 = context->get_def_use_mgr()->GetDef(10); + EXPECT_EQ(vtable.GetValueNumber(inst1), vtable.GetValueNumber(inst2)); +} + +TEST_F(ValueTableTest, DifferentPushConstantLoad) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer PushConstant %5 + %8 = OpVariable %6 PushConstant + %2 = OpFunction %3 None %4 + %7 = OpLabel + %9 = OpLoad %5 %8 + %10 = OpLoad %5 %8 + OpReturn + OpFunctionEnd + )"; + auto context = BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::ValueNumberTable vtable(context.get()); + ir::Instruction* inst1 = context->get_def_use_mgr()->GetDef(9); + ir::Instruction* inst2 = context->get_def_use_mgr()->GetDef(10); + EXPECT_EQ(vtable.GetValueNumber(inst1), vtable.GetValueNumber(inst2)); +} + +TEST_F(ValueTableTest, SameCall) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypeFunction %5 + %7 = OpTypePointer Function %5 + %8 = OpVariable %7 Private + %2 = OpFunction %3 None %4 + %9 = OpLabel + %10 = OpFunctionCall %5 %11 + OpReturn + OpFunctionEnd + %11 = OpFunction %5 None %6 + %12 = OpLabel + %13 = OpLoad %5 %8 + OpReturnValue %13 + OpFunctionEnd + )"; + auto context = BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::ValueNumberTable vtable(context.get()); + ir::Instruction* inst = context->get_def_use_mgr()->GetDef(10); + EXPECT_EQ(vtable.GetValueNumber(inst), vtable.GetValueNumber(inst)); +} + +// Function calls should be given a new value number, even if they are the same. +TEST_F(ValueTableTest, DifferentCall) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypeFunction %5 + %7 = OpTypePointer Function %5 + %8 = OpVariable %7 Private + %2 = OpFunction %3 None %4 + %9 = OpLabel + %10 = OpFunctionCall %5 %11 + %12 = OpFunctionCall %5 %11 + OpReturn + OpFunctionEnd + %11 = OpFunction %5 None %6 + %13 = OpLabel + %14 = OpLoad %5 %8 + OpReturnValue %14 + OpFunctionEnd + )"; + auto context = BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::ValueNumberTable vtable(context.get()); + ir::Instruction* inst1 = context->get_def_use_mgr()->GetDef(10); + ir::Instruction* inst2 = context->get_def_use_mgr()->GetDef(12); + EXPECT_NE(vtable.GetValueNumber(inst1), vtable.GetValueNumber(inst2)); +} + +// It is possible to have two instruction that compute the same numerical value, +// but with different types. They should have different value numbers. +TEST_F(ValueTableTest, DifferentTypes) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeInt 32 0 + %6 = OpTypeInt 32 1 + %7 = OpTypePointer Function %5 + %2 = OpFunction %3 None %4 + %8 = OpLabel + %9 = OpVariable %7 Function + %10 = OpLoad %5 %9 + %11 = OpIAdd %5 %10 %10 + %12 = OpIAdd %6 %10 %10 + OpReturn + OpFunctionEnd + )"; + auto context = BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::ValueNumberTable vtable(context.get()); + ir::Instruction* inst1 = context->get_def_use_mgr()->GetDef(11); + ir::Instruction* inst2 = context->get_def_use_mgr()->GetDef(12); + EXPECT_NE(vtable.GetValueNumber(inst1), vtable.GetValueNumber(inst2)); +} + +TEST_F(ValueTableTest, CopyObject) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Function %5 + %2 = OpFunction %3 None %4 + %7 = OpLabel + %8 = OpVariable %6 Function + %9 = OpLoad %5 %8 + %10 = OpCopyObject %5 %9 + OpReturn + OpFunctionEnd + )"; + auto context = BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::ValueNumberTable vtable(context.get()); + ir::Instruction* inst1 = context->get_def_use_mgr()->GetDef(9); + ir::Instruction* inst2 = context->get_def_use_mgr()->GetDef(10); + EXPECT_EQ(vtable.GetValueNumber(inst1), vtable.GetValueNumber(inst2)); +} + +// Test that a phi where the operands have the same value assigned that value +// to the result of the phi. +TEST_F(ValueTableTest, PhiTest1) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Uniform %5 + %7 = OpTypeBool + %8 = OpConstantTrue %7 + %9 = OpVariable %6 Uniform + %2 = OpFunction %3 None %4 + %10 = OpLabel + OpBranchConditional %8 %11 %12 + %11 = OpLabel + %13 = OpLoad %5 %9 + OpBranch %14 + %12 = OpLabel + %15 = OpLoad %5 %9 + OpBranch %14 + %14 = OpLabel + %16 = OpPhi %5 %13 %11 %15 %12 + OpReturn + OpFunctionEnd + )"; + auto context = BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::ValueNumberTable vtable(context.get()); + ir::Instruction* inst1 = context->get_def_use_mgr()->GetDef(13); + ir::Instruction* inst2 = context->get_def_use_mgr()->GetDef(15); + ir::Instruction* phi = context->get_def_use_mgr()->GetDef(16); + EXPECT_EQ(vtable.GetValueNumber(inst1), vtable.GetValueNumber(inst2)); + EXPECT_EQ(vtable.GetValueNumber(inst1), vtable.GetValueNumber(phi)); +} + +// When the values for the inputs to a phi do not match, then the phi should +// have its own value number. +TEST_F(ValueTableTest, PhiTest2) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Uniform %5 + %7 = OpTypeBool + %8 = OpConstantTrue %7 + %9 = OpVariable %6 Uniform + %10 = OpVariable %6 Uniform + %2 = OpFunction %3 None %4 + %11 = OpLabel + OpBranchConditional %8 %12 %13 + %12 = OpLabel + %14 = OpLoad %5 %9 + OpBranch %15 + %13 = OpLabel + %16 = OpLoad %5 %10 + OpBranch %15 + %15 = OpLabel + %17 = OpPhi %14 %12 %16 %13 + OpReturn + OpFunctionEnd + )"; + auto context = BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::ValueNumberTable vtable(context.get()); + ir::Instruction* inst1 = context->get_def_use_mgr()->GetDef(14); + ir::Instruction* inst2 = context->get_def_use_mgr()->GetDef(16); + ir::Instruction* phi = context->get_def_use_mgr()->GetDef(17); + EXPECT_NE(vtable.GetValueNumber(inst1), vtable.GetValueNumber(inst2)); + EXPECT_NE(vtable.GetValueNumber(inst1), vtable.GetValueNumber(phi)); + EXPECT_NE(vtable.GetValueNumber(inst2), vtable.GetValueNumber(phi)); +} + +// Test that a phi node in a loop header gets a new value because one of its +// inputs comes from later in the loop. +TEST_F(ValueTableTest, PhiLoopTest) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %2 "main" + OpExecutionMode %2 OriginUpperLeft + OpSource GLSL 430 + %3 = OpTypeVoid + %4 = OpTypeFunction %3 + %5 = OpTypeFloat 32 + %6 = OpTypePointer Uniform %5 + %7 = OpTypeBool + %8 = OpConstantTrue %7 + %9 = OpVariable %6 Uniform + %10 = OpVariable %6 Uniform + %2 = OpFunction %3 None %4 + %11 = OpLabel + %12 = OpLoad %5 %9 + OpSelectionMerge %13 None + OpBranchConditional %8 %14 %13 + %14 = OpLabel + %15 = OpPhi %5 %12 %11 %16 %14 + %16 = OpLoad %5 %9 + OpLoopMerge %17 %14 None + OpBranchConditional %8 %14 %17 + %17 = OpLabel + OpBranch %13 + %13 = OpLabel + %18 = OpPhi %5 %12 %11 %16 %17 + OpReturn + OpFunctionEnd + )"; + auto context = BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text); + opt::ValueNumberTable vtable(context.get()); + ir::Instruction* inst1 = context->get_def_use_mgr()->GetDef(12); + ir::Instruction* inst2 = context->get_def_use_mgr()->GetDef(16); + EXPECT_EQ(vtable.GetValueNumber(inst1), vtable.GetValueNumber(inst2)); + + ir::Instruction* phi1 = context->get_def_use_mgr()->GetDef(15); + EXPECT_NE(vtable.GetValueNumber(inst1), vtable.GetValueNumber(phi1)); + + ir::Instruction* phi2 = context->get_def_use_mgr()->GetDef(18); + EXPECT_EQ(vtable.GetValueNumber(inst1), vtable.GetValueNumber(phi2)); + EXPECT_NE(vtable.GetValueNumber(phi1), vtable.GetValueNumber(phi2)); +} +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/workaround1209_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/workaround1209_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/opt/workaround1209_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/opt/workaround1209_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,421 @@ +// Copyright (c) 2017 Google 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. + +#include "assembly_builder.h" +#include "gmock/gmock.h" +#include "pass_fixture.h" +#include "pass_utils.h" + +#include +#include +#include +#include +#include + +namespace { + +using namespace spvtools; + +using Workaround1209Test = PassTest<::testing::Test>; + +#ifdef SPIRV_EFFCEE +TEST_F(Workaround1209Test, RemoveOpUnreachableInLoop) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" %texcoord %gl_VertexIndex %_ + OpSource GLSL 400 + OpSourceExtension "GL_ARB_separate_shader_objects" + OpSourceExtension "GL_ARB_shading_language_420pack" + OpName %main "main" + OpName %texcoord "texcoord" + OpName %buf "buf" + OpMemberName %buf 0 "MVP" + OpMemberName %buf 1 "position" + OpMemberName %buf 2 "attr" + OpName %ubuf "ubuf" + OpName %gl_VertexIndex "gl_VertexIndex" + OpName %gl_PerVertex "gl_PerVertex" + OpMemberName %gl_PerVertex 0 "gl_Position" + OpName %_ "" + OpDecorate %texcoord Location 0 + OpDecorate %_arr_v4float_uint_72 ArrayStride 16 + OpDecorate %_arr_v4float_uint_72_0 ArrayStride 16 + OpMemberDecorate %buf 0 ColMajor + OpMemberDecorate %buf 0 Offset 0 + OpMemberDecorate %buf 0 MatrixStride 16 + OpMemberDecorate %buf 1 Offset 64 + OpMemberDecorate %buf 2 Offset 1216 + OpDecorate %buf Block + OpDecorate %ubuf DescriptorSet 0 + OpDecorate %ubuf Binding 0 + OpDecorate %gl_VertexIndex BuiltIn VertexIndex + OpMemberDecorate %gl_PerVertex 0 BuiltIn Position + OpDecorate %gl_PerVertex Block + %void = OpTypeVoid + %12 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %texcoord = OpVariable %_ptr_Output_v4float Output +%mat4v4float = OpTypeMatrix %v4float 4 + %uint = OpTypeInt 32 0 + %uint_72 = OpConstant %uint 72 +%_arr_v4float_uint_72 = OpTypeArray %v4float %uint_72 +%_arr_v4float_uint_72_0 = OpTypeArray %v4float %uint_72 + %buf = OpTypeStruct %mat4v4float %_arr_v4float_uint_72 %_arr_v4float_uint_72_0 +%_ptr_Uniform_buf = OpTypePointer Uniform %buf + %ubuf = OpVariable %_ptr_Uniform_buf Uniform + %int = OpTypeInt 32 1 + %int_2 = OpConstant %int 2 +%_ptr_Input_int = OpTypePointer Input %int +%gl_VertexIndex = OpVariable %_ptr_Input_int Input +%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float +%gl_PerVertex = OpTypeStruct %v4float +%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex + %_ = OpVariable %_ptr_Output_gl_PerVertex Output + %int_0 = OpConstant %int 0 + %int_1 = OpConstant %int 1 + %float_1 = OpConstant %float 1 + %28 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 + %main = OpFunction %void None %12 + %29 = OpLabel + OpBranch %30 + %30 = OpLabel +; CHECK: OpLoopMerge [[merge:%[a-zA-Z_\d]+]] + OpLoopMerge %31 %32 None + OpBranch %33 + %33 = OpLabel +; CHECK: OpSelectionMerge [[sel_merge:%[a-zA-Z_\d]+]] + OpSelectionMerge %34 None + OpSwitch %int_1 %35 + %35 = OpLabel + %36 = OpLoad %int %gl_VertexIndex + %37 = OpAccessChain %_ptr_Uniform_v4float %ubuf %int_2 %36 + %38 = OpLoad %v4float %37 + OpStore %texcoord %38 + %39 = OpAccessChain %_ptr_Output_v4float %_ %int_0 + OpStore %39 %28 + OpBranch %31 +; CHECK: [[sel_merge]] = OpLabel + %34 = OpLabel +; CHECK-NEXT: OpBranch [[merge]] + OpUnreachable + %32 = OpLabel + OpBranch %30 + %31 = OpLabel + OpReturn + OpFunctionEnd)"; + + SinglePassRunAndMatch(text, false); +} + +TEST_F(Workaround1209Test, RemoveOpUnreachableInNestedLoop) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %2 "main" %3 %4 %5 + OpSource GLSL 400 + OpSourceExtension "GL_ARB_separate_shader_objects" + OpSourceExtension "GL_ARB_shading_language_420pack" + OpName %2 "main" + OpName %3 "texcoord" + OpName %6 "buf" + OpMemberName %6 0 "MVP" + OpMemberName %6 1 "position" + OpMemberName %6 2 "attr" + OpName %7 "ubuf" + OpName %4 "gl_VertexIndex" + OpName %8 "gl_PerVertex" + OpMemberName %8 0 "gl_Position" + OpName %5 "" + OpDecorate %3 Location 0 + OpDecorate %9 ArrayStride 16 + OpDecorate %10 ArrayStride 16 + OpMemberDecorate %6 0 ColMajor + OpMemberDecorate %6 0 Offset 0 + OpMemberDecorate %6 0 MatrixStride 16 + OpMemberDecorate %6 1 Offset 64 + OpMemberDecorate %6 2 Offset 1216 + OpDecorate %6 Block + OpDecorate %7 DescriptorSet 0 + OpDecorate %7 Binding 0 + OpDecorate %4 BuiltIn VertexIndex + OpMemberDecorate %8 0 BuiltIn Position + OpDecorate %8 Block + %11 = OpTypeVoid + %12 = OpTypeFunction %11 + %13 = OpTypeFloat 32 + %14 = OpTypeVector %13 4 + %15 = OpTypePointer Output %14 + %3 = OpVariable %15 Output + %16 = OpTypeMatrix %14 4 + %17 = OpTypeInt 32 0 + %18 = OpConstant %17 72 + %9 = OpTypeArray %14 %18 + %10 = OpTypeArray %14 %18 + %6 = OpTypeStruct %16 %9 %10 + %19 = OpTypePointer Uniform %6 + %7 = OpVariable %19 Uniform + %20 = OpTypeInt 32 1 + %21 = OpConstant %20 2 + %22 = OpTypePointer Input %20 + %4 = OpVariable %22 Input + %23 = OpTypePointer Uniform %14 + %8 = OpTypeStruct %14 + %24 = OpTypePointer Output %8 + %5 = OpVariable %24 Output + %25 = OpConstant %20 0 + %26 = OpConstant %20 1 + %27 = OpConstant %13 1 + %28 = OpConstantComposite %14 %27 %27 %27 %27 + %2 = OpFunction %11 None %12 + %29 = OpLabel + OpBranch %31 + %31 = OpLabel +; CHECK: OpLoopMerge + OpLoopMerge %32 %33 None + OpBranch %30 + %30 = OpLabel +; CHECK: OpLoopMerge [[merge:%[a-zA-Z_\d]+]] + OpLoopMerge %34 %35 None + OpBranch %36 + %36 = OpLabel +; CHECK: OpSelectionMerge [[sel_merge:%[a-zA-Z_\d]+]] + OpSelectionMerge %37 None + OpSwitch %26 %38 + %38 = OpLabel + %39 = OpLoad %20 %4 + %40 = OpAccessChain %23 %7 %21 %39 + %41 = OpLoad %14 %40 + OpStore %3 %41 + %42 = OpAccessChain %15 %5 %25 + OpStore %42 %28 + OpBranch %34 +; CHECK: [[sel_merge]] = OpLabel + %37 = OpLabel +; CHECK-NEXT: OpBranch [[merge]] + OpUnreachable + %35 = OpLabel + OpBranch %30 + %34 = OpLabel + OpBranch %32 + %33 = OpLabel + OpBranch %31 + %32 = OpLabel + OpReturn + OpFunctionEnd)"; + + SinglePassRunAndMatch(text, false); +} + +TEST_F(Workaround1209Test, RemoveOpUnreachableInAdjacentLoops) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %2 "main" %3 %4 %5 + OpSource GLSL 400 + OpSourceExtension "GL_ARB_separate_shader_objects" + OpSourceExtension "GL_ARB_shading_language_420pack" + OpName %2 "main" + OpName %3 "texcoord" + OpName %6 "buf" + OpMemberName %6 0 "MVP" + OpMemberName %6 1 "position" + OpMemberName %6 2 "attr" + OpName %7 "ubuf" + OpName %4 "gl_VertexIndex" + OpName %8 "gl_PerVertex" + OpMemberName %8 0 "gl_Position" + OpName %5 "" + OpDecorate %3 Location 0 + OpDecorate %9 ArrayStride 16 + OpDecorate %10 ArrayStride 16 + OpMemberDecorate %6 0 ColMajor + OpMemberDecorate %6 0 Offset 0 + OpMemberDecorate %6 0 MatrixStride 16 + OpMemberDecorate %6 1 Offset 64 + OpMemberDecorate %6 2 Offset 1216 + OpDecorate %6 Block + OpDecorate %7 DescriptorSet 0 + OpDecorate %7 Binding 0 + OpDecorate %4 BuiltIn VertexIndex + OpMemberDecorate %8 0 BuiltIn Position + OpDecorate %8 Block + %11 = OpTypeVoid + %12 = OpTypeFunction %11 + %13 = OpTypeFloat 32 + %14 = OpTypeVector %13 4 + %15 = OpTypePointer Output %14 + %3 = OpVariable %15 Output + %16 = OpTypeMatrix %14 4 + %17 = OpTypeInt 32 0 + %18 = OpConstant %17 72 + %9 = OpTypeArray %14 %18 + %10 = OpTypeArray %14 %18 + %6 = OpTypeStruct %16 %9 %10 + %19 = OpTypePointer Uniform %6 + %7 = OpVariable %19 Uniform + %20 = OpTypeInt 32 1 + %21 = OpConstant %20 2 + %22 = OpTypePointer Input %20 + %4 = OpVariable %22 Input + %23 = OpTypePointer Uniform %14 + %8 = OpTypeStruct %14 + %24 = OpTypePointer Output %8 + %5 = OpVariable %24 Output + %25 = OpConstant %20 0 + %26 = OpConstant %20 1 + %27 = OpConstant %13 1 + %28 = OpConstantComposite %14 %27 %27 %27 %27 + %2 = OpFunction %11 None %12 + %29 = OpLabel + OpBranch %30 + %30 = OpLabel +; CHECK: OpLoopMerge [[merge1:%[a-zA-Z_\d]+]] + OpLoopMerge %31 %32 None + OpBranch %33 + %33 = OpLabel +; CHECK: OpSelectionMerge [[sel_merge1:%[a-zA-Z_\d]+]] + OpSelectionMerge %34 None + OpSwitch %26 %35 + %35 = OpLabel + %36 = OpLoad %20 %4 + %37 = OpAccessChain %23 %7 %21 %36 + %38 = OpLoad %14 %37 + OpStore %3 %38 + %39 = OpAccessChain %15 %5 %25 + OpStore %39 %28 + OpBranch %31 +; CHECK: [[sel_merge1]] = OpLabel + %34 = OpLabel +; CHECK-NEXT: OpBranch [[merge1]] + OpUnreachable + %32 = OpLabel + OpBranch %30 + %31 = OpLabel +; CHECK: OpLoopMerge [[merge2:%[a-zA-Z_\d]+]] + OpLoopMerge %40 %41 None + OpBranch %42 + %42 = OpLabel +; CHECK: OpSelectionMerge [[sel_merge2:%[a-zA-Z_\d]+]] + OpSelectionMerge %43 None + OpSwitch %26 %44 + %44 = OpLabel + %45 = OpLoad %20 %4 + %46 = OpAccessChain %23 %7 %21 %45 + %47 = OpLoad %14 %46 + OpStore %3 %47 + %48 = OpAccessChain %15 %5 %25 + OpStore %48 %28 + OpBranch %40 +; CHECK: [[sel_merge2]] = OpLabel + %43 = OpLabel +; CHECK-NEXT: OpBranch [[merge2]] + OpUnreachable + %41 = OpLabel + OpBranch %31 + %40 = OpLabel + OpReturn + OpFunctionEnd)"; + + SinglePassRunAndMatch(text, false); +} + +TEST_F(Workaround1209Test, LeaveUnreachableNotInLoop) { + const std::string text = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" %texcoord %gl_VertexIndex %_ + OpSource GLSL 400 + OpSourceExtension "GL_ARB_separate_shader_objects" + OpSourceExtension "GL_ARB_shading_language_420pack" + OpName %main "main" + OpName %texcoord "texcoord" + OpName %buf "buf" + OpMemberName %buf 0 "MVP" + OpMemberName %buf 1 "position" + OpMemberName %buf 2 "attr" + OpName %ubuf "ubuf" + OpName %gl_VertexIndex "gl_VertexIndex" + OpName %gl_PerVertex "gl_PerVertex" + OpMemberName %gl_PerVertex 0 "gl_Position" + OpName %_ "" + OpDecorate %texcoord Location 0 + OpDecorate %_arr_v4float_uint_72 ArrayStride 16 + OpDecorate %_arr_v4float_uint_72_0 ArrayStride 16 + OpMemberDecorate %buf 0 ColMajor + OpMemberDecorate %buf 0 Offset 0 + OpMemberDecorate %buf 0 MatrixStride 16 + OpMemberDecorate %buf 1 Offset 64 + OpMemberDecorate %buf 2 Offset 1216 + OpDecorate %buf Block + OpDecorate %ubuf DescriptorSet 0 + OpDecorate %ubuf Binding 0 + OpDecorate %gl_VertexIndex BuiltIn VertexIndex + OpMemberDecorate %gl_PerVertex 0 BuiltIn Position + OpDecorate %gl_PerVertex Block + %void = OpTypeVoid + %12 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %texcoord = OpVariable %_ptr_Output_v4float Output +%mat4v4float = OpTypeMatrix %v4float 4 + %uint = OpTypeInt 32 0 + %uint_72 = OpConstant %uint 72 +%_arr_v4float_uint_72 = OpTypeArray %v4float %uint_72 +%_arr_v4float_uint_72_0 = OpTypeArray %v4float %uint_72 + %buf = OpTypeStruct %mat4v4float %_arr_v4float_uint_72 %_arr_v4float_uint_72_0 +%_ptr_Uniform_buf = OpTypePointer Uniform %buf + %ubuf = OpVariable %_ptr_Uniform_buf Uniform + %int = OpTypeInt 32 1 + %int_2 = OpConstant %int 2 +%_ptr_Input_int = OpTypePointer Input %int +%gl_VertexIndex = OpVariable %_ptr_Input_int Input +%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float +%gl_PerVertex = OpTypeStruct %v4float +%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex + %_ = OpVariable %_ptr_Output_gl_PerVertex Output + %int_0 = OpConstant %int 0 + %int_1 = OpConstant %int 1 + %float_1 = OpConstant %float 1 + %28 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 + %main = OpFunction %void None %12 + %29 = OpLabel + OpBranch %30 + %30 = OpLabel + OpSelectionMerge %34 None + OpSwitch %int_1 %35 + %35 = OpLabel + %36 = OpLoad %int %gl_VertexIndex + %37 = OpAccessChain %_ptr_Uniform_v4float %ubuf %int_2 %36 + %38 = OpLoad %v4float %37 + OpStore %texcoord %38 + %39 = OpAccessChain %_ptr_Output_v4float %_ %int_0 + OpStore %39 %28 + OpReturn + %34 = OpLabel +; CHECK: OpUnreachable + OpUnreachable + OpFunctionEnd)"; + + SinglePassRunAndMatch(text, false); +} +#endif +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/parse_number_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/parse_number_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/parse_number_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/parse_number_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,970 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include + +#include "gmock/gmock.h" +#include "source/util/parse_number.h" +#include "spirv-tools/libspirv.h" + +namespace { +using spvutils::EncodeNumberStatus; +using spvutils::NumberType; +using spvutils::ParseAndEncodeFloatingPointNumber; +using spvutils::ParseAndEncodeIntegerNumber; +using spvutils::ParseAndEncodeNumber; +using spvutils::ParseNumber; +using testing::Eq; +using testing::IsNull; +using testing::NotNull; + +TEST(ParseNarrowSignedIntegers, Sample) { + int16_t i16; + + EXPECT_FALSE(ParseNumber(nullptr, &i16)); + EXPECT_FALSE(ParseNumber("", &i16)); + EXPECT_FALSE(ParseNumber("0=", &i16)); + + EXPECT_TRUE(ParseNumber("0", &i16)); + EXPECT_EQ(0, i16); + EXPECT_TRUE(ParseNumber("32767", &i16)); + EXPECT_EQ(32767, i16); + EXPECT_TRUE(ParseNumber("-32768", &i16)); + EXPECT_EQ(-32768, i16); + EXPECT_TRUE(ParseNumber("-0", &i16)); + EXPECT_EQ(0, i16); + + // These are out of range, so they should return an error. + // The error code depends on whether this is an optional value. + EXPECT_FALSE(ParseNumber("32768", &i16)); + EXPECT_FALSE(ParseNumber("65535", &i16)); + + // Check hex parsing. + EXPECT_TRUE(ParseNumber("0x7fff", &i16)); + EXPECT_EQ(32767, i16); + // This is out of range. + EXPECT_FALSE(ParseNumber("0xffff", &i16)); +} + +TEST(ParseNarrowUnsignedIntegers, Sample) { + uint16_t u16; + + EXPECT_FALSE(ParseNumber(nullptr, &u16)); + EXPECT_FALSE(ParseNumber("", &u16)); + EXPECT_FALSE(ParseNumber("0=", &u16)); + + EXPECT_TRUE(ParseNumber("0", &u16)); + EXPECT_EQ(0, u16); + EXPECT_TRUE(ParseNumber("65535", &u16)); + EXPECT_EQ(65535, u16); + EXPECT_FALSE(ParseNumber("65536", &u16)); + + // We don't care about -0 since it's rejected at a higher level. + EXPECT_FALSE(ParseNumber("-1", &u16)); + EXPECT_TRUE(ParseNumber("0xffff", &u16)); + EXPECT_EQ(0xffff, u16); + EXPECT_FALSE(ParseNumber("0x10000", &u16)); +} + +TEST(ParseSignedIntegers, Sample) { + int32_t i32; + + // Invalid parse. + EXPECT_FALSE(ParseNumber(nullptr, &i32)); + EXPECT_FALSE(ParseNumber("", &i32)); + EXPECT_FALSE(ParseNumber("0=", &i32)); + + // Decimal values. + EXPECT_TRUE(ParseNumber("0", &i32)); + EXPECT_EQ(0, i32); + EXPECT_TRUE(ParseNumber("2147483647", &i32)); + EXPECT_EQ(std::numeric_limits::max(), i32); + EXPECT_FALSE(ParseNumber("2147483648", &i32)); + EXPECT_TRUE(ParseNumber("-0", &i32)); + EXPECT_EQ(0, i32); + EXPECT_TRUE(ParseNumber("-1", &i32)); + EXPECT_EQ(-1, i32); + EXPECT_TRUE(ParseNumber("-2147483648", &i32)); + EXPECT_EQ(std::numeric_limits::min(), i32); + + // Hex values. + EXPECT_TRUE(ParseNumber("0x7fffffff", &i32)); + EXPECT_EQ(std::numeric_limits::max(), i32); + EXPECT_FALSE(ParseNumber("0x80000000", &i32)); + EXPECT_TRUE(ParseNumber("-0x000", &i32)); + EXPECT_EQ(0, i32); + EXPECT_TRUE(ParseNumber("-0x001", &i32)); + EXPECT_EQ(-1, i32); + EXPECT_TRUE(ParseNumber("-0x80000000", &i32)); + EXPECT_EQ(std::numeric_limits::min(), i32); +} + +TEST(ParseUnsignedIntegers, Sample) { + uint32_t u32; + + // Invalid parse. + EXPECT_FALSE(ParseNumber(nullptr, &u32)); + EXPECT_FALSE(ParseNumber("", &u32)); + EXPECT_FALSE(ParseNumber("0=", &u32)); + + // Valid values. + EXPECT_TRUE(ParseNumber("0", &u32)); + EXPECT_EQ(0u, u32); + EXPECT_TRUE(ParseNumber("4294967295", &u32)); + EXPECT_EQ(std::numeric_limits::max(), u32); + EXPECT_FALSE(ParseNumber("4294967296", &u32)); + + // Hex values. + EXPECT_TRUE(ParseNumber("0xffffffff", &u32)); + EXPECT_EQ(std::numeric_limits::max(), u32); + + // We don't care about -0 since it's rejected at a higher level. + EXPECT_FALSE(ParseNumber("-1", &u32)); +} + +TEST(ParseWideSignedIntegers, Sample) { + int64_t i64; + EXPECT_FALSE(ParseNumber(nullptr, &i64)); + EXPECT_FALSE(ParseNumber("", &i64)); + EXPECT_FALSE(ParseNumber("0=", &i64)); + EXPECT_TRUE(ParseNumber("0", &i64)); + EXPECT_EQ(0, i64); + EXPECT_TRUE(ParseNumber("0x7fffffffffffffff", &i64)); + EXPECT_EQ(0x7fffffffffffffff, i64); + EXPECT_TRUE(ParseNumber("-0", &i64)); + EXPECT_EQ(0, i64); + EXPECT_TRUE(ParseNumber("-1", &i64)); + EXPECT_EQ(-1, i64); +} + +TEST(ParseWideUnsignedIntegers, Sample) { + uint64_t u64; + EXPECT_FALSE(ParseNumber(nullptr, &u64)); + EXPECT_FALSE(ParseNumber("", &u64)); + EXPECT_FALSE(ParseNumber("0=", &u64)); + EXPECT_TRUE(ParseNumber("0", &u64)); + EXPECT_EQ(0u, u64); + EXPECT_TRUE(ParseNumber("0xffffffffffffffff", &u64)); + EXPECT_EQ(0xffffffffffffffffULL, u64); + + // We don't care about -0 since it's rejected at a higher level. + EXPECT_FALSE(ParseNumber("-1", &u64)); +} + +TEST(ParseFloat, Sample) { + float f; + + EXPECT_FALSE(ParseNumber(nullptr, &f)); + EXPECT_FALSE(ParseNumber("", &f)); + EXPECT_FALSE(ParseNumber("0=", &f)); + + // These values are exactly representatble. + EXPECT_TRUE(ParseNumber("0", &f)); + EXPECT_EQ(0.0f, f); + EXPECT_TRUE(ParseNumber("42", &f)); + EXPECT_EQ(42.0f, f); + EXPECT_TRUE(ParseNumber("2.5", &f)); + EXPECT_EQ(2.5f, f); + EXPECT_TRUE(ParseNumber("-32.5", &f)); + EXPECT_EQ(-32.5f, f); + EXPECT_TRUE(ParseNumber("1e38", &f)); + EXPECT_EQ(1e38f, f); + EXPECT_TRUE(ParseNumber("-1e38", &f)); + EXPECT_EQ(-1e38f, f); +} + +TEST(ParseFloat, Overflow) { + // The assembler parses using HexFloat>. Make + // sure that succeeds for in-range values, and fails for out of + // range values. When it does overflow, the value is set to the + // nearest finite value, matching C++11 behavior for operator>> + // on floating point. + spvutils::HexFloat> f(0.0f); + + EXPECT_TRUE(ParseNumber("1e38", &f)); + EXPECT_EQ(1e38f, f.value().getAsFloat()); + EXPECT_TRUE(ParseNumber("-1e38", &f)); + EXPECT_EQ(-1e38f, f.value().getAsFloat()); + EXPECT_FALSE(ParseNumber("1e40", &f)); + EXPECT_FALSE(ParseNumber("-1e40", &f)); + EXPECT_FALSE(ParseNumber("1e400", &f)); + EXPECT_FALSE(ParseNumber("-1e400", &f)); +} + +TEST(ParseDouble, Sample) { + double f; + + EXPECT_FALSE(ParseNumber(nullptr, &f)); + EXPECT_FALSE(ParseNumber("", &f)); + EXPECT_FALSE(ParseNumber("0=", &f)); + + // These values are exactly representatble. + EXPECT_TRUE(ParseNumber("0", &f)); + EXPECT_EQ(0.0, f); + EXPECT_TRUE(ParseNumber("42", &f)); + EXPECT_EQ(42.0, f); + EXPECT_TRUE(ParseNumber("2.5", &f)); + EXPECT_EQ(2.5, f); + EXPECT_TRUE(ParseNumber("-32.5", &f)); + EXPECT_EQ(-32.5, f); + EXPECT_TRUE(ParseNumber("1e38", &f)); + EXPECT_EQ(1e38, f); + EXPECT_TRUE(ParseNumber("-1e38", &f)); + EXPECT_EQ(-1e38, f); + // These are out of range for 32-bit float, but in range for 64-bit float. + EXPECT_TRUE(ParseNumber("1e40", &f)); + EXPECT_EQ(1e40, f); + EXPECT_TRUE(ParseNumber("-1e40", &f)); + EXPECT_EQ(-1e40, f); +} + +TEST(ParseDouble, Overflow) { + // The assembler parses using HexFloat>. Make + // sure that succeeds for in-range values, and fails for out of + // range values. When it does overflow, the value is set to the + // nearest finite value, matching C++11 behavior for operator>> + // on floating point. + spvutils::HexFloat> f(0.0); + + EXPECT_TRUE(ParseNumber("1e38", &f)); + EXPECT_EQ(1e38, f.value().getAsFloat()); + EXPECT_TRUE(ParseNumber("-1e38", &f)); + EXPECT_EQ(-1e38, f.value().getAsFloat()); + EXPECT_TRUE(ParseNumber("1e40", &f)); + EXPECT_EQ(1e40, f.value().getAsFloat()); + EXPECT_TRUE(ParseNumber("-1e40", &f)); + EXPECT_EQ(-1e40, f.value().getAsFloat()); + EXPECT_FALSE(ParseNumber("1e400", &f)); + EXPECT_FALSE(ParseNumber("-1e400", &f)); +} + +TEST(ParseFloat16, Overflow) { + // The assembler parses using HexFloat>. Make + // sure that succeeds for in-range values, and fails for out of + // range values. When it does overflow, the value is set to the + // nearest finite value, matching C++11 behavior for operator>> + // on floating point. + spvutils::HexFloat> f(0); + + EXPECT_FALSE(ParseNumber(nullptr, &f)); + EXPECT_TRUE(ParseNumber("-0.0", &f)); + EXPECT_EQ(uint16_t{0x8000}, f.value().getAsFloat().get_value()); + EXPECT_TRUE(ParseNumber("1.0", &f)); + EXPECT_EQ(uint16_t{0x3c00}, f.value().getAsFloat().get_value()); + + // Overflows 16-bit but not 32-bit + EXPECT_FALSE(ParseNumber("1e38", &f)); + EXPECT_FALSE(ParseNumber("-1e38", &f)); + + // Overflows 32-bit but not 64-bit + EXPECT_FALSE(ParseNumber("1e40", &f)); + EXPECT_FALSE(ParseNumber("-1e40", &f)); + + // Overflows 64-bit + EXPECT_FALSE(ParseNumber("1e400", &f)); + EXPECT_FALSE(ParseNumber("-1e400", &f)); +} + +void AssertEmitFunc(uint32_t) { + ASSERT_FALSE(true) + << "Should not call emit() function when the number can not be parsed."; + return; +} + +TEST(ParseAndEncodeNarrowSignedIntegers, Invalid) { + // The error message should be overwritten after each parsing call. + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + std::string err_msg; + NumberType type = {16, SPV_NUMBER_SIGNED_INT}; + + rc = ParseAndEncodeIntegerNumber(nullptr, type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("The given text is a nullptr", err_msg); + rc = ParseAndEncodeIntegerNumber("", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: ", err_msg); + rc = ParseAndEncodeIntegerNumber("=", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: =", err_msg); + rc = ParseAndEncodeIntegerNumber("-", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid signed integer literal: -", err_msg); + rc = ParseAndEncodeIntegerNumber("0=", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: 0=", err_msg); +} + +TEST(ParseAndEncodeNarrowSignedIntegers, Overflow) { + // The error message should be overwritten after each parsing call. + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + std::string err_msg; + NumberType type = {16, SPV_NUMBER_SIGNED_INT}; + + rc = ParseAndEncodeIntegerNumber("32768", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Integer 32768 does not fit in a 16-bit signed integer", err_msg); + rc = ParseAndEncodeIntegerNumber("-32769", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Integer -32769 does not fit in a 16-bit signed integer", err_msg); +} + +TEST(ParseAndEncodeNarrowSignedIntegers, Success) { + // Don't care the error message in this case. + EncodeNumberStatus rc = EncodeNumberStatus::kInvalidText; + NumberType type = {16, SPV_NUMBER_SIGNED_INT}; + + // Zero, maximum, and minimum value + rc = ParseAndEncodeIntegerNumber( + "0", type, [](uint32_t word) { EXPECT_EQ(0u, word); }, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeIntegerNumber( + "-0", type, [](uint32_t word) { EXPECT_EQ(0u, word); }, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeIntegerNumber( + "32767", type, [](uint32_t word) { EXPECT_EQ(0x00007fffu, word); }, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeIntegerNumber( + "-32768", type, [](uint32_t word) { EXPECT_EQ(0xffff8000u, word); }, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + + // Hex parsing + rc = ParseAndEncodeIntegerNumber( + "0x7fff", type, [](uint32_t word) { EXPECT_EQ(0x00007fffu, word); }, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeIntegerNumber( + "0xffff", type, [](uint32_t word) { EXPECT_EQ(0xffffffffu, word); }, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); +} + +TEST(ParseAndEncodeNarrowUnsignedIntegers, Invalid) { + // The error message should be overwritten after each parsing call. + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + std::string err_msg; + NumberType type = {16, SPV_NUMBER_UNSIGNED_INT}; + + rc = ParseAndEncodeIntegerNumber(nullptr, type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("The given text is a nullptr", err_msg); + rc = ParseAndEncodeIntegerNumber("", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: ", err_msg); + rc = ParseAndEncodeIntegerNumber("=", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: =", err_msg); + rc = ParseAndEncodeIntegerNumber("-", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); + EXPECT_EQ("Cannot put a negative number in an unsigned literal", err_msg); + rc = ParseAndEncodeIntegerNumber("0=", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: 0=", err_msg); + rc = ParseAndEncodeIntegerNumber("-0", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); + EXPECT_EQ("Cannot put a negative number in an unsigned literal", err_msg); + rc = ParseAndEncodeIntegerNumber("-1", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); + EXPECT_EQ("Cannot put a negative number in an unsigned literal", err_msg); +} + +TEST(ParseAndEncodeNarrowUnsignedIntegers, Overflow) { + // The error message should be overwritten after each parsing call. + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + std::string err_msg("random content"); + NumberType type = {16, SPV_NUMBER_UNSIGNED_INT}; + + // Overflow + rc = ParseAndEncodeIntegerNumber("65536", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Integer 65536 does not fit in a 16-bit unsigned integer", err_msg); +} + +TEST(ParseAndEncodeNarrowUnsignedIntegers, Success) { + // Don't care the error message in this case. + EncodeNumberStatus rc = EncodeNumberStatus::kInvalidText; + NumberType type = {16, SPV_NUMBER_UNSIGNED_INT}; + + // Zero, maximum, and minimum value + rc = ParseAndEncodeIntegerNumber( + "0", type, [](uint32_t word) { EXPECT_EQ(0u, word); }, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeIntegerNumber( + "65535", type, [](uint32_t word) { EXPECT_EQ(0x0000ffffu, word); }, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + + // Hex parsing + rc = ParseAndEncodeIntegerNumber( + "0xffff", type, [](uint32_t word) { EXPECT_EQ(0x0000ffffu, word); }, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); +} + +TEST(ParseAndEncodeSignedIntegers, Invalid) { + // The error message should be overwritten after each parsing call. + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + std::string err_msg; + NumberType type = {32, SPV_NUMBER_SIGNED_INT}; + + rc = ParseAndEncodeIntegerNumber(nullptr, type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("The given text is a nullptr", err_msg); + rc = ParseAndEncodeIntegerNumber("", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: ", err_msg); + rc = ParseAndEncodeIntegerNumber("=", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: =", err_msg); + rc = ParseAndEncodeIntegerNumber("-", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid signed integer literal: -", err_msg); + rc = ParseAndEncodeIntegerNumber("0=", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: 0=", err_msg); +} + +TEST(ParseAndEncodeSignedIntegers, Overflow) { + // The error message should be overwritten after each parsing call. + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + std::string err_msg; + NumberType type = {32, SPV_NUMBER_SIGNED_INT}; + + rc = + ParseAndEncodeIntegerNumber("2147483648", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Integer 2147483648 does not fit in a 32-bit signed integer", + err_msg); + rc = ParseAndEncodeIntegerNumber("-2147483649", type, AssertEmitFunc, + &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Integer -2147483649 does not fit in a 32-bit signed integer", + err_msg); +} + +TEST(ParseAndEncodeSignedIntegers, Success) { + // Don't care the error message in this case. + EncodeNumberStatus rc = EncodeNumberStatus::kInvalidText; + NumberType type = {32, SPV_NUMBER_SIGNED_INT}; + + // Zero, maximum, and minimum value + rc = ParseAndEncodeIntegerNumber( + "0", type, [](uint32_t word) { EXPECT_EQ(0u, word); }, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeIntegerNumber( + "-0", type, [](uint32_t word) { EXPECT_EQ(0u, word); }, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeIntegerNumber( + "2147483647", type, [](uint32_t word) { EXPECT_EQ(0x7fffffffu, word); }, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeIntegerNumber( + "-2147483648", type, [](uint32_t word) { EXPECT_EQ(0x80000000u, word); }, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + + // Hex parsing + rc = ParseAndEncodeIntegerNumber( + "0x7fffffff", type, [](uint32_t word) { EXPECT_EQ(0x7fffffffu, word); }, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeIntegerNumber( + "0xffffffff", type, [](uint32_t word) { EXPECT_EQ(0xffffffffu, word); }, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); +} + +TEST(ParseAndEncodeUnsignedIntegers, Invalid) { + // The error message should be overwritten after each parsing call. + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + std::string err_msg; + NumberType type = {32, SPV_NUMBER_UNSIGNED_INT}; + + rc = ParseAndEncodeIntegerNumber(nullptr, type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("The given text is a nullptr", err_msg); + rc = ParseAndEncodeIntegerNumber("", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: ", err_msg); + rc = ParseAndEncodeIntegerNumber("=", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: =", err_msg); + rc = ParseAndEncodeIntegerNumber("-", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); + EXPECT_EQ("Cannot put a negative number in an unsigned literal", err_msg); + rc = ParseAndEncodeIntegerNumber("0=", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: 0=", err_msg); + rc = ParseAndEncodeIntegerNumber("-0", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); + EXPECT_EQ("Cannot put a negative number in an unsigned literal", err_msg); + rc = ParseAndEncodeIntegerNumber("-1", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); + EXPECT_EQ("Cannot put a negative number in an unsigned literal", err_msg); +} + +TEST(ParseAndEncodeUnsignedIntegers, Overflow) { + // The error message should be overwritten after each parsing call. + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + std::string err_msg("random content"); + NumberType type = {32, SPV_NUMBER_UNSIGNED_INT}; + + // Overflow + rc = + ParseAndEncodeIntegerNumber("4294967296", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Integer 4294967296 does not fit in a 32-bit unsigned integer", + err_msg); +} + +TEST(ParseAndEncodeUnsignedIntegers, Success) { + // Don't care the error message in this case. + EncodeNumberStatus rc = EncodeNumberStatus::kInvalidText; + NumberType type = {32, SPV_NUMBER_UNSIGNED_INT}; + + // Zero, maximum, and minimum value + rc = ParseAndEncodeIntegerNumber( + "0", type, [](uint32_t word) { EXPECT_EQ(0u, word); }, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeIntegerNumber( + "4294967295", type, [](uint32_t word) { EXPECT_EQ(0xffffffffu, word); }, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + + // Hex parsing + rc = ParseAndEncodeIntegerNumber( + "0xffffffff", type, [](uint32_t word) { EXPECT_EQ(0xffffffffu, word); }, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); +} + +TEST(ParseAndEncodeWideSignedIntegers, Invalid) { + // The error message should be overwritten after each parsing call. + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + std::string err_msg; + NumberType type = {64, SPV_NUMBER_SIGNED_INT}; + + rc = ParseAndEncodeIntegerNumber(nullptr, type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("The given text is a nullptr", err_msg); + rc = ParseAndEncodeIntegerNumber("", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: ", err_msg); + rc = ParseAndEncodeIntegerNumber("=", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: =", err_msg); + rc = ParseAndEncodeIntegerNumber("-", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid signed integer literal: -", err_msg); + rc = ParseAndEncodeIntegerNumber("0=", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: 0=", err_msg); +} + +TEST(ParseAndEncodeWideSignedIntegers, Overflow) { + // The error message should be overwritten after each parsing call. + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + std::string err_msg; + NumberType type = {64, SPV_NUMBER_SIGNED_INT}; + + rc = ParseAndEncodeIntegerNumber("9223372036854775808", type, AssertEmitFunc, + &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ( + "Integer 9223372036854775808 does not fit in a 64-bit signed integer", + err_msg); + rc = ParseAndEncodeIntegerNumber("-9223372036854775809", type, AssertEmitFunc, + &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid signed integer literal: -9223372036854775809", err_msg); +} + +TEST(ParseAndEncodeWideSignedIntegers, Success) { + // Don't care the error message in this case. + EncodeNumberStatus rc = EncodeNumberStatus::kInvalidText; + NumberType type = {64, SPV_NUMBER_SIGNED_INT}; + std::vector word_buffer; + auto emit = [&word_buffer](uint32_t word) { + if (word_buffer.size() == 2) word_buffer.clear(); + word_buffer.push_back(word); + }; + + // Zero, maximum, and minimum value + rc = ParseAndEncodeIntegerNumber("0", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0u, 0u})); + rc = ParseAndEncodeIntegerNumber("-0", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0u, 0u})); + rc = ParseAndEncodeIntegerNumber("9223372036854775807", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0xffffffffu, 0x7fffffffu})); + rc = ParseAndEncodeIntegerNumber("-9223372036854775808", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0u, 0x80000000u})); + rc = ParseAndEncodeIntegerNumber("-1", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0xffffffffu, 0xffffffffu})); + + // Hex parsing + rc = ParseAndEncodeIntegerNumber("0x7fffffffffffffff", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0xffffffffu, 0x7fffffffu})); + rc = ParseAndEncodeIntegerNumber("0xffffffffffffffff", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0xffffffffu, 0xffffffffu})); +} + +TEST(ParseAndEncodeWideUnsignedIntegers, Invalid) { + // The error message should be overwritten after each parsing call. + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + std::string err_msg; + NumberType type = {64, SPV_NUMBER_UNSIGNED_INT}; + + // Invalid + rc = ParseAndEncodeIntegerNumber(nullptr, type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("The given text is a nullptr", err_msg); + rc = ParseAndEncodeIntegerNumber("", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: ", err_msg); + rc = ParseAndEncodeIntegerNumber("=", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: =", err_msg); + rc = ParseAndEncodeIntegerNumber("-", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); + EXPECT_EQ("Cannot put a negative number in an unsigned literal", err_msg); + rc = ParseAndEncodeIntegerNumber("0=", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: 0=", err_msg); + rc = ParseAndEncodeIntegerNumber("-0", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); + EXPECT_EQ("Cannot put a negative number in an unsigned literal", err_msg); + rc = ParseAndEncodeIntegerNumber("-1", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); + EXPECT_EQ("Cannot put a negative number in an unsigned literal", err_msg); +} + +TEST(ParseAndEncodeWideUnsignedIntegers, Overflow) { + // The error message should be overwritten after each parsing call. + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + std::string err_msg; + NumberType type = {64, SPV_NUMBER_UNSIGNED_INT}; + + // Overflow + rc = ParseAndEncodeIntegerNumber("18446744073709551616", type, AssertEmitFunc, + &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: 18446744073709551616", err_msg); +} + +TEST(ParseAndEncodeWideUnsignedIntegers, Success) { + // Don't care the error message in this case. + EncodeNumberStatus rc = EncodeNumberStatus::kInvalidText; + NumberType type = {64, SPV_NUMBER_UNSIGNED_INT}; + std::vector word_buffer; + auto emit = [&word_buffer](uint32_t word) { + if (word_buffer.size() == 2) word_buffer.clear(); + word_buffer.push_back(word); + }; + + // Zero, maximum, and minimum value + rc = ParseAndEncodeIntegerNumber("0", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0u, 0u})); + rc = ParseAndEncodeIntegerNumber("18446744073709551615", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0xffffffffu, 0xffffffffu})); + + // Hex parsing + rc = ParseAndEncodeIntegerNumber("0xffffffffffffffff", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0xffffffffu, 0xffffffffu})); +} + +TEST(ParseAndEncodeIntegerNumber, TypeNone) { + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + std::string err_msg; + NumberType type = {32, SPV_NUMBER_NONE}; + + rc = ParseAndEncodeIntegerNumber( + "0.0", type, [](uint32_t word) { EXPECT_EQ(0x0u, word); }, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); + EXPECT_EQ("The expected type is not a integer type", err_msg); +} + +TEST(ParseAndEncodeIntegerNumber, InvalidCaseWithoutErrorMessageString) { + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + NumberType type = {32, SPV_NUMBER_SIGNED_INT}; + + rc = ParseAndEncodeIntegerNumber("invalid", type, AssertEmitFunc, nullptr); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); +} + +TEST(ParseAndEncodeIntegerNumber, DoNotTouchErrorMessageStringOnSuccess) { + EncodeNumberStatus rc = EncodeNumberStatus::kInvalidText; + std::string err_msg("random content"); + NumberType type = {32, SPV_NUMBER_SIGNED_INT}; + + rc = ParseAndEncodeIntegerNumber( + "100", type, [](uint32_t word) { EXPECT_EQ(100u, word); }, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_EQ("random content", err_msg); +} + +TEST(ParseAndEncodeFloat, Sample) { + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + std::string err_msg; + NumberType type = {32, SPV_NUMBER_FLOATING}; + + // Invalid + rc = ParseAndEncodeFloatingPointNumber("", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid 32-bit float literal: ", err_msg); + rc = ParseAndEncodeFloatingPointNumber("0=", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid 32-bit float literal: 0=", err_msg); + + // Representative samples + rc = ParseAndEncodeFloatingPointNumber( + "0.0", type, [](uint32_t word) { EXPECT_EQ(0x0u, word); }, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeFloatingPointNumber( + "-0.0", type, [](uint32_t word) { EXPECT_EQ(0x80000000u, word); }, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeFloatingPointNumber( + "42", type, [](uint32_t word) { EXPECT_EQ(0x42280000u, word); }, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeFloatingPointNumber( + "2.5", type, [](uint32_t word) { EXPECT_EQ(0x40200000u, word); }, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeFloatingPointNumber( + "-32.5", type, [](uint32_t word) { EXPECT_EQ(0xc2020000u, word); }, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeFloatingPointNumber( + "1e38", type, [](uint32_t word) { EXPECT_EQ(0x7e967699u, word); }, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeFloatingPointNumber( + "-1e38", type, [](uint32_t word) { EXPECT_EQ(0xfe967699u, word); }, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + + // Overflow + rc = + ParseAndEncodeFloatingPointNumber("1e40", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid 32-bit float literal: 1e40", err_msg); + rc = ParseAndEncodeFloatingPointNumber("-1e40", type, AssertEmitFunc, + &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid 32-bit float literal: -1e40", err_msg); + rc = ParseAndEncodeFloatingPointNumber("1e400", type, AssertEmitFunc, + &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid 32-bit float literal: 1e400", err_msg); + rc = ParseAndEncodeFloatingPointNumber("-1e400", type, AssertEmitFunc, + &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid 32-bit float literal: -1e400", err_msg); +} + +TEST(ParseAndEncodeDouble, Sample) { + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + std::string err_msg; + NumberType type = {64, SPV_NUMBER_FLOATING}; + std::vector word_buffer; + auto emit = [&word_buffer](uint32_t word) { + if (word_buffer.size() == 2) word_buffer.clear(); + word_buffer.push_back(word); + }; + + // Invalid + rc = ParseAndEncodeFloatingPointNumber("", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid 64-bit float literal: ", err_msg); + rc = ParseAndEncodeFloatingPointNumber("0=", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid 64-bit float literal: 0=", err_msg); + + // Representative samples + rc = ParseAndEncodeFloatingPointNumber("0.0", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0u, 0u})); + rc = ParseAndEncodeFloatingPointNumber("-0.0", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0u, 0x80000000u})); + rc = ParseAndEncodeFloatingPointNumber("42", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0u, 0x40450000u})); + rc = ParseAndEncodeFloatingPointNumber("2.5", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0u, 0x40040000u})); + rc = ParseAndEncodeFloatingPointNumber("32.5", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0u, 0x40404000u})); + rc = ParseAndEncodeFloatingPointNumber("1e38", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0x2a16a1b1u, 0x47d2ced3u})); + rc = ParseAndEncodeFloatingPointNumber("-1e38", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0x2a16a1b1u, 0xc7d2ced3u})); + rc = ParseAndEncodeFloatingPointNumber("1e40", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0xf1c35ca5u, 0x483d6329u})); + rc = ParseAndEncodeFloatingPointNumber("-1e40", type, emit, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_THAT(word_buffer, Eq(std::vector{0xf1c35ca5u, 0xc83d6329u})); + + // Overflow + rc = ParseAndEncodeFloatingPointNumber("1e400", type, AssertEmitFunc, + &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid 64-bit float literal: 1e400", err_msg); + rc = ParseAndEncodeFloatingPointNumber("-1e400", type, AssertEmitFunc, + &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid 64-bit float literal: -1e400", err_msg); +} + +TEST(ParseAndEncodeFloat16, Sample) { + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + std::string err_msg; + NumberType type = {16, SPV_NUMBER_FLOATING}; + + // Invalid + rc = ParseAndEncodeFloatingPointNumber("", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid 16-bit float literal: ", err_msg); + rc = ParseAndEncodeFloatingPointNumber("0=", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid 16-bit float literal: 0=", err_msg); + + // Representative samples + rc = ParseAndEncodeFloatingPointNumber( + "0.0", type, [](uint32_t word) { EXPECT_EQ(0x0u, word); }, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeFloatingPointNumber( + "-0.0", type, [](uint32_t word) { EXPECT_EQ(0x8000u, word); }, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeFloatingPointNumber( + "1.0", type, [](uint32_t word) { EXPECT_EQ(0x3c00u, word); }, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeFloatingPointNumber( + "2.5", type, [](uint32_t word) { EXPECT_EQ(0x4100u, word); }, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + rc = ParseAndEncodeFloatingPointNumber( + "32.5", type, [](uint32_t word) { EXPECT_EQ(0x5010u, word); }, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + + // Overflow + rc = + ParseAndEncodeFloatingPointNumber("1e38", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid 16-bit float literal: 1e38", err_msg); + rc = ParseAndEncodeFloatingPointNumber("-1e38", type, AssertEmitFunc, + &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid 16-bit float literal: -1e38", err_msg); + rc = + ParseAndEncodeFloatingPointNumber("1e40", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid 16-bit float literal: 1e40", err_msg); + rc = ParseAndEncodeFloatingPointNumber("-1e40", type, AssertEmitFunc, + &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid 16-bit float literal: -1e40", err_msg); + rc = ParseAndEncodeFloatingPointNumber("1e400", type, AssertEmitFunc, + &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid 16-bit float literal: 1e400", err_msg); + rc = ParseAndEncodeFloatingPointNumber("-1e400", type, AssertEmitFunc, + &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid 16-bit float literal: -1e400", err_msg); +} + +TEST(ParseAndEncodeFloatingPointNumber, TypeNone) { + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + std::string err_msg; + NumberType type = {32, SPV_NUMBER_NONE}; + + rc = ParseAndEncodeFloatingPointNumber( + "0.0", type, [](uint32_t word) { EXPECT_EQ(0x0u, word); }, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); + EXPECT_EQ("The expected type is not a float type", err_msg); +} + +TEST(ParseAndEncodeFloatingPointNumber, InvalidCaseWithoutErrorMessageString) { + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + NumberType type = {32, SPV_NUMBER_FLOATING}; + + rc = ParseAndEncodeFloatingPointNumber("invalid", type, AssertEmitFunc, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); +} + +TEST(ParseAndEncodeFloatingPointNumber, DoNotTouchErrorMessageStringOnSuccess) { + EncodeNumberStatus rc = EncodeNumberStatus::kInvalidText; + std::string err_msg("random content"); + NumberType type = {32, SPV_NUMBER_FLOATING}; + + rc = ParseAndEncodeFloatingPointNumber( + "0.0", type, [](uint32_t word) { EXPECT_EQ(0x0u, word); }, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_EQ("random content", err_msg); +} + +TEST(ParseAndEncodeNumber, Sample) { + EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; + std::string err_msg; + NumberType type = {32, SPV_NUMBER_SIGNED_INT}; + + // Invalid with error message string + rc = ParseAndEncodeNumber("something wrong", type, AssertEmitFunc, &err_msg); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + EXPECT_EQ("Invalid unsigned integer literal: something wrong", err_msg); + + // Invalid without error message string + rc = ParseAndEncodeNumber("something wrong", type, AssertEmitFunc, nullptr); + EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); + + // Signed integer, should not touch the error message string. + err_msg = "random content"; + rc = ParseAndEncodeNumber("-1", type, + [](uint32_t word) { EXPECT_EQ(0xffffffffu, word); }, + &err_msg); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + EXPECT_EQ("random content", err_msg); + + // Unsigned integer + type = {32, SPV_NUMBER_UNSIGNED_INT}; + rc = ParseAndEncodeNumber( + "1", type, [](uint32_t word) { EXPECT_EQ(1u, word); }, nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); + + // Float + type = {32, SPV_NUMBER_FLOATING}; + rc = ParseAndEncodeNumber("-1.0", type, + [](uint32_t word) { EXPECT_EQ(0xbf800000, word); }, + nullptr); + EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/preserve_numeric_ids_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/preserve_numeric_ids_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/preserve_numeric_ids_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/preserve_numeric_ids_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,157 @@ +// Copyright (c) 2017 Google 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. + +// Tests for unique type declaration rules validator. + +#include + +#include "source/text.h" +#include "source/text_handler.h" +#include "test_fixture.h" + +namespace { + +using spvtest::ScopedContext; + +// Converts code to binary and then back to text. +spv_result_t ToBinaryAndBack( + const std::string& before, std::string* after, + uint32_t text_to_binary_options = SPV_TEXT_TO_BINARY_OPTION_NONE, + uint32_t binary_to_text_options = SPV_BINARY_TO_TEXT_OPTION_NONE, + spv_target_env env = SPV_ENV_UNIVERSAL_1_0) { + ScopedContext ctx(env); + spv_binary binary; + spv_text text; + + spv_result_t result = + spvTextToBinaryWithOptions(ctx.context, before.c_str(), before.size(), + text_to_binary_options, &binary, nullptr); + if (result != SPV_SUCCESS) { + return result; + } + + result = spvBinaryToText(ctx.context, binary->code, binary->wordCount, + binary_to_text_options, &text, nullptr); + if (result != SPV_SUCCESS) { + return result; + } + + *after = std::string(text->str, text->length); + + spvBinaryDestroy(binary); + spvTextDestroy(text); + + return SPV_SUCCESS; +} + +TEST(ToBinaryAndBack, DontPreserveNumericIds) { + const std::string before = + R"(OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +%i32 = OpTypeInt 32 1 +%u32 = OpTypeInt 32 0 +%f32 = OpTypeFloat 32 +%200 = OpTypeVoid +%300 = OpTypeFunction %200 +%main = OpFunction %200 None %300 +%entry = OpLabel +%100 = OpConstant %u32 100 +%1 = OpConstant %u32 200 +%2 = OpConstant %u32 300 +OpReturn +OpFunctionEnd +)"; + + const std::string expected = + R"(OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +%1 = OpTypeInt 32 1 +%2 = OpTypeInt 32 0 +%3 = OpTypeFloat 32 +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpFunction %4 None %5 +%7 = OpLabel +%8 = OpConstant %2 100 +%9 = OpConstant %2 200 +%10 = OpConstant %2 300 +OpReturn +OpFunctionEnd +)"; + + std::string after; + EXPECT_EQ(SPV_SUCCESS, + ToBinaryAndBack(before, &after, SPV_TEXT_TO_BINARY_OPTION_NONE, + SPV_BINARY_TO_TEXT_OPTION_NO_HEADER)); + + EXPECT_EQ(expected, after); +} + +TEST(TextHandler, PreserveNumericIds) { + const std::string before = + R"(OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +%i32 = OpTypeInt 32 1 +%u32 = OpTypeInt 32 0 +%f32 = OpTypeFloat 32 +%200 = OpTypeVoid +%300 = OpTypeFunction %200 +%main = OpFunction %200 None %300 +%entry = OpLabel +%100 = OpConstant %u32 100 +%1 = OpConstant %u32 200 +%2 = OpConstant %u32 300 +OpReturn +OpFunctionEnd +)"; + + const std::string expected = + R"(OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +%3 = OpTypeInt 32 1 +%4 = OpTypeInt 32 0 +%5 = OpTypeFloat 32 +%200 = OpTypeVoid +%300 = OpTypeFunction %200 +%6 = OpFunction %200 None %300 +%7 = OpLabel +%100 = OpConstant %4 100 +%1 = OpConstant %4 200 +%2 = OpConstant %4 300 +OpReturn +OpFunctionEnd +)"; + + std::string after; + EXPECT_EQ(SPV_SUCCESS, + ToBinaryAndBack(before, &after, + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS, + SPV_BINARY_TO_TEXT_OPTION_NO_HEADER)); + + EXPECT_EQ(expected, after); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/scripts/test_compact_ids.py vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/scripts/test_compact_ids.py --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/scripts/test_compact_ids.py 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/scripts/test_compact_ids.py 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,102 @@ +#!/usr/bin/env python +# Copyright (c) 2017 Google 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. +"""Tests correctness of opt pass tools/opt --compact-ids.""" + +from __future__ import print_function + +import os.path +import sys +import tempfile + +def test_spirv_file(path, temp_dir): + optimized_spv_path = os.path.join(temp_dir, 'optimized.spv') + optimized_dis_path = os.path.join(temp_dir, 'optimized.dis') + converted_spv_path = os.path.join(temp_dir, 'converted.spv') + converted_dis_path = os.path.join(temp_dir, 'converted.dis') + + os.system('tools/spirv-opt ' + path + ' -o ' + optimized_spv_path + + ' --compact-ids') + os.system('tools/spirv-dis ' + optimized_spv_path + ' -o ' + + optimized_dis_path) + + os.system('tools/spirv-dis ' + path + ' -o ' + converted_dis_path) + os.system('tools/spirv-as ' + converted_dis_path + ' -o ' + + converted_spv_path) + os.system('tools/spirv-dis ' + converted_spv_path + ' -o ' + + converted_dis_path) + + with open(converted_dis_path, 'r') as f: + converted_dis = f.readlines()[3:] + + with open(optimized_dis_path, 'r') as f: + optimized_dis = f.readlines()[3:] + + return converted_dis == optimized_dis + +def print_usage(): + template= \ +"""{script} tests correctness of opt pass tools/opt --compact-ids + +USAGE: python {script} [] + +Requires tools/spirv-dis, tools/spirv-as and tools/spirv-opt to be in path +(call the script from the SPIRV-Tools build output directory). + +TIP: In order to test all .spv files under current dir use +find -name "*.spv" -print0 | xargs -0 -s 2000000 python {script} +""" + print(template.format(script=sys.argv[0])); + +def main(): + if not os.path.isfile('tools/spirv-dis'): + print('error: tools/spirv-dis not found') + print_usage() + exit(1) + + if not os.path.isfile('tools/spirv-as'): + print('error: tools/spirv-as not found') + print_usage() + exit(1) + + if not os.path.isfile('tools/spirv-opt'): + print('error: tools/spirv-opt not found') + print_usage() + exit(1) + + paths = sys.argv[1:] + if not paths: + print_usage() + + num_failed = 0 + + temp_dir = tempfile.mkdtemp() + + for path in paths: + success = test_spirv_file(path, temp_dir) + if not success: + print('Test failed for ' + path) + num_failed += 1 + + print('Tested ' + str(len(paths)) + ' files') + + if num_failed: + print(str(num_failed) + ' tests failed') + exit(1) + else: + print('All tests successful') + exit(0) + +if __name__ == '__main__': + main() diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/software_version_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/software_version_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/software_version_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/software_version_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2015-2016 Google 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. + +#include "unit_spirv.h" + +#include + +#include "gmock/gmock.h" + +using ::testing::AnyOf; +using ::testing::Eq; +using ::testing::Ge; +using ::testing::StartsWith; + +namespace { + +void CheckFormOfHighLevelVersion(const std::string& version) { + std::istringstream s(version); + char v = 'x'; + int year = -1; + char period = 'x'; + int index = -1; + s >> v >> year >> period >> index; + EXPECT_THAT(v, Eq('v')); + EXPECT_THAT(year, Ge(2016)); + EXPECT_THAT(period, Eq('.')); + EXPECT_THAT(index, Ge(0)); + EXPECT_TRUE(s.good() || s.eof()); + + std::string rest; + s >> rest; + EXPECT_THAT(rest, AnyOf("", "-dev")); +} + +TEST(SoftwareVersion, ShortIsCorrectForm) { + SCOPED_TRACE("short form"); + CheckFormOfHighLevelVersion(spvSoftwareVersionString()); +} + +TEST(SoftwareVersion, DetailedIsCorrectForm) { + const std::string detailed_version(spvSoftwareVersionDetailsString()); + EXPECT_THAT(detailed_version, StartsWith("SPIRV-Tools v")); + + // Parse the high level version. + const std::string from_v = + detailed_version.substr(detailed_version.find_first_of('v')); + const size_t first_space_after_v_or_npos = from_v.find_first_of(' '); + SCOPED_TRACE(detailed_version); + CheckFormOfHighLevelVersion(from_v.substr(0, first_space_after_v_or_npos)); + + // We don't actually care about what comes after the version number. +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/stats/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/stats/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/stats/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/stats/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,31 @@ +# Copyright (c) 2017 Google 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. + +set(VAL_TEST_COMMON_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/../test_fixture.h + ${CMAKE_CURRENT_SOURCE_DIR}/../unit_spirv.h +) + +add_spvtools_unittest(TARGET stats_aggregate + SRCS stats_aggregate_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET stats_analyzer + SRCS stats_analyzer_test.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../../tools/stats/stats_analyzer.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/stats/stats_aggregate_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/stats/stats_aggregate_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/stats/stats_aggregate_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/stats/stats_aggregate_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,484 @@ +// Copyright (c) 2017 Google 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. + +// Tests for unique type declaration rules validator. + +#include + +#include "source/spirv_stats.h" +#include "test_fixture.h" +#include "unit_spirv.h" + +namespace { + +using libspirv::SetContextMessageConsumer; +using libspirv::SpirvStats; +using spvtest::ScopedContext; + +void DiagnosticsMessageHandler(spv_message_level_t level, const char*, + const spv_position_t& position, + const char* message) { + switch (level) { + case SPV_MSG_FATAL: + case SPV_MSG_INTERNAL_ERROR: + case SPV_MSG_ERROR: + std::cerr << "error: " << position.index << ": " << message << std::endl; + break; + case SPV_MSG_WARNING: + std::cout << "warning: " << position.index << ": " << message + << std::endl; + break; + case SPV_MSG_INFO: + std::cout << "info: " << position.index << ": " << message << std::endl; + break; + default: + break; + } +} + +// Calls libspirv::AggregateStats for binary compiled from |code|. +void CompileAndAggregateStats(const std::string& code, SpirvStats* stats, + spv_target_env env = SPV_ENV_UNIVERSAL_1_1) { + ScopedContext ctx(env); + SetContextMessageConsumer(ctx.context, DiagnosticsMessageHandler); + spv_binary binary; + ASSERT_EQ(SPV_SUCCESS, spvTextToBinary(ctx.context, code.c_str(), code.size(), + &binary, nullptr)); + + ASSERT_EQ(SPV_SUCCESS, AggregateStats(*ctx.context, binary->code, + binary->wordCount, nullptr, stats)); + spvBinaryDestroy(binary); +} + +TEST(AggregateStats, CapabilityHistogram) { + const std::string code1 = R"( +OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +)"; + + const std::string code2 = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +)"; + + SpirvStats stats; + + CompileAndAggregateStats(code1, &stats); + EXPECT_EQ(4u, stats.capability_hist.size()); + EXPECT_EQ(0u, stats.capability_hist.count(SpvCapabilityShader)); + EXPECT_EQ(1u, stats.capability_hist.at(SpvCapabilityAddresses)); + EXPECT_EQ(1u, stats.capability_hist.at(SpvCapabilityKernel)); + EXPECT_EQ(1u, stats.capability_hist.at(SpvCapabilityGenericPointer)); + EXPECT_EQ(1u, stats.capability_hist.at(SpvCapabilityLinkage)); + + CompileAndAggregateStats(code2, &stats); + EXPECT_EQ(5u, stats.capability_hist.size()); + EXPECT_EQ(1u, stats.capability_hist.at(SpvCapabilityShader)); + EXPECT_EQ(1u, stats.capability_hist.at(SpvCapabilityAddresses)); + EXPECT_EQ(1u, stats.capability_hist.at(SpvCapabilityKernel)); + EXPECT_EQ(1u, stats.capability_hist.at(SpvCapabilityGenericPointer)); + EXPECT_EQ(2u, stats.capability_hist.at(SpvCapabilityLinkage)); + + CompileAndAggregateStats(code1, &stats); + EXPECT_EQ(5u, stats.capability_hist.size()); + EXPECT_EQ(1u, stats.capability_hist.at(SpvCapabilityShader)); + EXPECT_EQ(2u, stats.capability_hist.at(SpvCapabilityAddresses)); + EXPECT_EQ(2u, stats.capability_hist.at(SpvCapabilityKernel)); + EXPECT_EQ(2u, stats.capability_hist.at(SpvCapabilityGenericPointer)); + EXPECT_EQ(3u, stats.capability_hist.at(SpvCapabilityLinkage)); + + CompileAndAggregateStats(code2, &stats); + EXPECT_EQ(5u, stats.capability_hist.size()); + EXPECT_EQ(2u, stats.capability_hist.at(SpvCapabilityShader)); + EXPECT_EQ(2u, stats.capability_hist.at(SpvCapabilityAddresses)); + EXPECT_EQ(2u, stats.capability_hist.at(SpvCapabilityKernel)); + EXPECT_EQ(2u, stats.capability_hist.at(SpvCapabilityGenericPointer)); + EXPECT_EQ(4u, stats.capability_hist.at(SpvCapabilityLinkage)); +} + +TEST(AggregateStats, ExtensionHistogram) { + const std::string code1 = R"( +OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpExtension "SPV_KHR_16bit_storage" +OpMemoryModel Physical32 OpenCL +)"; + + const std::string code2 = R"( +OpCapability Shader +OpCapability Linkage +OpExtension "SPV_NV_viewport_array2" +OpExtension "greatest_extension_ever" +OpMemoryModel Logical GLSL450 +)"; + + SpirvStats stats; + + CompileAndAggregateStats(code1, &stats); + EXPECT_EQ(1u, stats.extension_hist.size()); + EXPECT_EQ(0u, stats.extension_hist.count("SPV_NV_viewport_array2")); + EXPECT_EQ(1u, stats.extension_hist.at("SPV_KHR_16bit_storage")); + + CompileAndAggregateStats(code2, &stats); + EXPECT_EQ(3u, stats.extension_hist.size()); + EXPECT_EQ(1u, stats.extension_hist.at("SPV_NV_viewport_array2")); + EXPECT_EQ(1u, stats.extension_hist.at("SPV_KHR_16bit_storage")); + EXPECT_EQ(1u, stats.extension_hist.at("greatest_extension_ever")); + + CompileAndAggregateStats(code1, &stats); + EXPECT_EQ(3u, stats.extension_hist.size()); + EXPECT_EQ(1u, stats.extension_hist.at("SPV_NV_viewport_array2")); + EXPECT_EQ(2u, stats.extension_hist.at("SPV_KHR_16bit_storage")); + EXPECT_EQ(1u, stats.extension_hist.at("greatest_extension_ever")); + + CompileAndAggregateStats(code2, &stats); + EXPECT_EQ(3u, stats.extension_hist.size()); + EXPECT_EQ(2u, stats.extension_hist.at("SPV_NV_viewport_array2")); + EXPECT_EQ(2u, stats.extension_hist.at("SPV_KHR_16bit_storage")); + EXPECT_EQ(2u, stats.extension_hist.at("greatest_extension_ever")); +} + +TEST(AggregateStats, VersionHistogram) { + const std::string code1 = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +)"; + + SpirvStats stats; + + CompileAndAggregateStats(code1, &stats); + EXPECT_EQ(1u, stats.version_hist.size()); + EXPECT_EQ(1u, stats.version_hist.at(0x00010100)); + + CompileAndAggregateStats(code1, &stats, SPV_ENV_UNIVERSAL_1_0); + EXPECT_EQ(2u, stats.version_hist.size()); + EXPECT_EQ(1u, stats.version_hist.at(0x00010100)); + EXPECT_EQ(1u, stats.version_hist.at(0x00010000)); + + CompileAndAggregateStats(code1, &stats); + EXPECT_EQ(2u, stats.version_hist.size()); + EXPECT_EQ(2u, stats.version_hist.at(0x00010100)); + EXPECT_EQ(1u, stats.version_hist.at(0x00010000)); + + CompileAndAggregateStats(code1, &stats, SPV_ENV_UNIVERSAL_1_0); + EXPECT_EQ(2u, stats.version_hist.size()); + EXPECT_EQ(2u, stats.version_hist.at(0x00010100)); + EXPECT_EQ(2u, stats.version_hist.at(0x00010000)); +} + +TEST(AggregateStats, GeneratorHistogram) { + const std::string code1 = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +)"; + + const uint32_t kGeneratorKhronosAssembler = SPV_GENERATOR_KHRONOS_ASSEMBLER + << 16; + + SpirvStats stats; + + CompileAndAggregateStats(code1, &stats); + EXPECT_EQ(1u, stats.generator_hist.size()); + EXPECT_EQ(1u, stats.generator_hist.at(kGeneratorKhronosAssembler)); + + CompileAndAggregateStats(code1, &stats); + EXPECT_EQ(1u, stats.generator_hist.size()); + EXPECT_EQ(2u, stats.generator_hist.at(kGeneratorKhronosAssembler)); +} + +TEST(AggregateStats, OpcodeHistogram) { + const std::string code1 = R"( +OpCapability Addresses +OpCapability Kernel +OpCapability Int64 +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +%u64 = OpTypeInt 64 0 +%u32 = OpTypeInt 32 0 +%f32 = OpTypeFloat 32 +)"; + + const std::string code2 = R"( +OpCapability Shader +OpCapability Linkage +OpExtension "SPV_NV_viewport_array2" +OpMemoryModel Logical GLSL450 +)"; + + SpirvStats stats; + + CompileAndAggregateStats(code1, &stats); + EXPECT_EQ(4u, stats.opcode_hist.size()); + EXPECT_EQ(4u, stats.opcode_hist.at(SpvOpCapability)); + EXPECT_EQ(1u, stats.opcode_hist.at(SpvOpMemoryModel)); + EXPECT_EQ(2u, stats.opcode_hist.at(SpvOpTypeInt)); + EXPECT_EQ(1u, stats.opcode_hist.at(SpvOpTypeFloat)); + + CompileAndAggregateStats(code2, &stats); + EXPECT_EQ(5u, stats.opcode_hist.size()); + EXPECT_EQ(6u, stats.opcode_hist.at(SpvOpCapability)); + EXPECT_EQ(2u, stats.opcode_hist.at(SpvOpMemoryModel)); + EXPECT_EQ(2u, stats.opcode_hist.at(SpvOpTypeInt)); + EXPECT_EQ(1u, stats.opcode_hist.at(SpvOpTypeFloat)); + EXPECT_EQ(1u, stats.opcode_hist.at(SpvOpExtension)); + + CompileAndAggregateStats(code1, &stats); + EXPECT_EQ(5u, stats.opcode_hist.size()); + EXPECT_EQ(10u, stats.opcode_hist.at(SpvOpCapability)); + EXPECT_EQ(3u, stats.opcode_hist.at(SpvOpMemoryModel)); + EXPECT_EQ(4u, stats.opcode_hist.at(SpvOpTypeInt)); + EXPECT_EQ(2u, stats.opcode_hist.at(SpvOpTypeFloat)); + EXPECT_EQ(1u, stats.opcode_hist.at(SpvOpExtension)); + + CompileAndAggregateStats(code2, &stats); + EXPECT_EQ(5u, stats.opcode_hist.size()); + EXPECT_EQ(12u, stats.opcode_hist.at(SpvOpCapability)); + EXPECT_EQ(4u, stats.opcode_hist.at(SpvOpMemoryModel)); + EXPECT_EQ(4u, stats.opcode_hist.at(SpvOpTypeInt)); + EXPECT_EQ(2u, stats.opcode_hist.at(SpvOpTypeFloat)); + EXPECT_EQ(2u, stats.opcode_hist.at(SpvOpExtension)); +} + +TEST(AggregateStats, OpcodeMarkovHistogram) { + const std::string code1 = R"( +OpCapability Shader +OpCapability Linkage +OpExtension "SPV_NV_viewport_array2" +OpMemoryModel Logical GLSL450 +)"; + + const std::string code2 = R"( +OpCapability Addresses +OpCapability Kernel +OpCapability Int64 +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +%u64 = OpTypeInt 64 0 +%u32 = OpTypeInt 32 0 +%f32 = OpTypeFloat 32 +)"; + + SpirvStats stats; + stats.opcode_markov_hist.resize(2); + + CompileAndAggregateStats(code1, &stats); + ASSERT_EQ(2u, stats.opcode_markov_hist.size()); + EXPECT_EQ(2u, stats.opcode_markov_hist[0].size()); + EXPECT_EQ(2u, stats.opcode_markov_hist[0].at(SpvOpCapability).size()); + EXPECT_EQ(1u, stats.opcode_markov_hist[0].at(SpvOpExtension).size()); + EXPECT_EQ( + 1u, stats.opcode_markov_hist[0].at(SpvOpCapability).at(SpvOpCapability)); + EXPECT_EQ(1u, + stats.opcode_markov_hist[0].at(SpvOpCapability).at(SpvOpExtension)); + EXPECT_EQ( + 1u, stats.opcode_markov_hist[0].at(SpvOpExtension).at(SpvOpMemoryModel)); + + EXPECT_EQ(1u, stats.opcode_markov_hist[1].size()); + EXPECT_EQ(2u, stats.opcode_markov_hist[1].at(SpvOpCapability).size()); + EXPECT_EQ(1u, + stats.opcode_markov_hist[1].at(SpvOpCapability).at(SpvOpExtension)); + EXPECT_EQ( + 1u, stats.opcode_markov_hist[1].at(SpvOpCapability).at(SpvOpMemoryModel)); + + CompileAndAggregateStats(code2, &stats); + ASSERT_EQ(2u, stats.opcode_markov_hist.size()); + EXPECT_EQ(4u, stats.opcode_markov_hist[0].size()); + EXPECT_EQ(3u, stats.opcode_markov_hist[0].at(SpvOpCapability).size()); + EXPECT_EQ(1u, stats.opcode_markov_hist[0].at(SpvOpExtension).size()); + EXPECT_EQ(1u, stats.opcode_markov_hist[0].at(SpvOpMemoryModel).size()); + EXPECT_EQ(2u, stats.opcode_markov_hist[0].at(SpvOpTypeInt).size()); + EXPECT_EQ( + 4u, stats.opcode_markov_hist[0].at(SpvOpCapability).at(SpvOpCapability)); + EXPECT_EQ(1u, + stats.opcode_markov_hist[0].at(SpvOpCapability).at(SpvOpExtension)); + EXPECT_EQ( + 1u, stats.opcode_markov_hist[0].at(SpvOpCapability).at(SpvOpMemoryModel)); + EXPECT_EQ( + 1u, stats.opcode_markov_hist[0].at(SpvOpExtension).at(SpvOpMemoryModel)); + EXPECT_EQ(1u, + stats.opcode_markov_hist[0].at(SpvOpMemoryModel).at(SpvOpTypeInt)); + EXPECT_EQ(1u, stats.opcode_markov_hist[0].at(SpvOpTypeInt).at(SpvOpTypeInt)); + EXPECT_EQ(1u, + stats.opcode_markov_hist[0].at(SpvOpTypeInt).at(SpvOpTypeFloat)); + + EXPECT_EQ(3u, stats.opcode_markov_hist[1].size()); + EXPECT_EQ(4u, stats.opcode_markov_hist[1].at(SpvOpCapability).size()); + EXPECT_EQ(1u, stats.opcode_markov_hist[1].at(SpvOpMemoryModel).size()); + EXPECT_EQ(1u, stats.opcode_markov_hist[1].at(SpvOpTypeInt).size()); + EXPECT_EQ( + 2u, stats.opcode_markov_hist[1].at(SpvOpCapability).at(SpvOpCapability)); + EXPECT_EQ(1u, + stats.opcode_markov_hist[1].at(SpvOpCapability).at(SpvOpExtension)); + EXPECT_EQ( + 2u, stats.opcode_markov_hist[1].at(SpvOpCapability).at(SpvOpMemoryModel)); + EXPECT_EQ(1u, + stats.opcode_markov_hist[1].at(SpvOpCapability).at(SpvOpTypeInt)); + EXPECT_EQ(1u, + stats.opcode_markov_hist[1].at(SpvOpMemoryModel).at(SpvOpTypeInt)); + EXPECT_EQ(1u, + stats.opcode_markov_hist[1].at(SpvOpTypeInt).at(SpvOpTypeFloat)); +} + +TEST(AggregateStats, ConstantLiteralsHistogram) { + const std::string code1 = R"( +OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpCapability Float64 +OpCapability Int16 +OpCapability Int64 +OpMemoryModel Physical32 OpenCL +%u16 = OpTypeInt 16 0 +%u32 = OpTypeInt 32 0 +%u64 = OpTypeInt 64 0 +%f32 = OpTypeFloat 32 +%f64 = OpTypeFloat 64 +%1 = OpConstant %f32 0.1 +%2 = OpConstant %f32 -2 +%3 = OpConstant %f64 -2 +%4 = OpConstant %u16 16 +%5 = OpConstant %u16 2 +%6 = OpConstant %u32 32 +%7 = OpConstant %u64 64 +)"; + + const std::string code2 = R"( +OpCapability Shader +OpCapability Linkage +OpCapability Int16 +OpCapability Int64 +OpMemoryModel Logical GLSL450 +%f32 = OpTypeFloat 32 +%u16 = OpTypeInt 16 0 +%s16 = OpTypeInt 16 1 +%u32 = OpTypeInt 32 0 +%s32 = OpTypeInt 32 1 +%u64 = OpTypeInt 64 0 +%s64 = OpTypeInt 64 1 +%1 = OpConstant %f32 0.1 +%2 = OpConstant %f32 -2 +%3 = OpConstant %u16 1 +%4 = OpConstant %u16 16 +%5 = OpConstant %u16 2 +%6 = OpConstant %s16 -16 +%7 = OpConstant %u32 32 +%8 = OpConstant %s32 2 +%9 = OpConstant %s32 -32 +%10 = OpConstant %u64 64 +%11 = OpConstant %s64 -64 +)"; + + SpirvStats stats; + + CompileAndAggregateStats(code1, &stats); + EXPECT_EQ(2u, stats.f32_constant_hist.size()); + EXPECT_EQ(1u, stats.f64_constant_hist.size()); + EXPECT_EQ(1u, stats.f32_constant_hist.at(0.1f)); + EXPECT_EQ(1u, stats.f32_constant_hist.at(-2.f)); + EXPECT_EQ(1u, stats.f64_constant_hist.at(-2)); + + EXPECT_EQ(2u, stats.u16_constant_hist.size()); + EXPECT_EQ(0u, stats.s16_constant_hist.size()); + EXPECT_EQ(1u, stats.u32_constant_hist.size()); + EXPECT_EQ(0u, stats.s32_constant_hist.size()); + EXPECT_EQ(1u, stats.u64_constant_hist.size()); + EXPECT_EQ(0u, stats.s64_constant_hist.size()); + EXPECT_EQ(1u, stats.u16_constant_hist.at(16)); + EXPECT_EQ(1u, stats.u16_constant_hist.at(2)); + EXPECT_EQ(1u, stats.u32_constant_hist.at(32)); + EXPECT_EQ(1u, stats.u64_constant_hist.at(64)); + + CompileAndAggregateStats(code2, &stats); + EXPECT_EQ(2u, stats.f32_constant_hist.size()); + EXPECT_EQ(1u, stats.f64_constant_hist.size()); + EXPECT_EQ(2u, stats.f32_constant_hist.at(0.1f)); + EXPECT_EQ(2u, stats.f32_constant_hist.at(-2.f)); + EXPECT_EQ(1u, stats.f64_constant_hist.at(-2)); + + EXPECT_EQ(3u, stats.u16_constant_hist.size()); + EXPECT_EQ(1u, stats.s16_constant_hist.size()); + EXPECT_EQ(1u, stats.u32_constant_hist.size()); + EXPECT_EQ(2u, stats.s32_constant_hist.size()); + EXPECT_EQ(1u, stats.u64_constant_hist.size()); + EXPECT_EQ(1u, stats.s64_constant_hist.size()); + EXPECT_EQ(2u, stats.u16_constant_hist.at(16)); + EXPECT_EQ(2u, stats.u16_constant_hist.at(2)); + EXPECT_EQ(1u, stats.u16_constant_hist.at(1)); + EXPECT_EQ(1u, stats.s16_constant_hist.at(-16)); + EXPECT_EQ(2u, stats.u32_constant_hist.at(32)); + EXPECT_EQ(1u, stats.s32_constant_hist.at(2)); + EXPECT_EQ(1u, stats.s32_constant_hist.at(-32)); + EXPECT_EQ(2u, stats.u64_constant_hist.at(64)); + EXPECT_EQ(1u, stats.s64_constant_hist.at(-64)); +} + +TEST(AggregateStats, IdDescriptor) { + const std::string code1 = R"( +OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +%u32 = OpTypeInt 32 0 +%f32 = OpTypeFloat 32 +%1 = OpConstant %f32 1 +%2 = OpConstant %f32 1 +%3 = OpConstant %u32 32 +)"; + + const std::string code2 = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%f32 = OpTypeFloat 32 +%u32 = OpTypeInt 32 0 +%1 = OpConstant %f32 1 +%2 = OpConstant %f32 3 +%3 = OpConstant %u32 32 +)"; + + const uint32_t kF32 = 1951208733; + const uint32_t kU32 = 2430404313; + const uint32_t kF32_1 = 296981500; + const uint32_t kF32_3 = 1450415100; + const uint32_t kU32_32 = 827246872; + + SpirvStats stats; + + CompileAndAggregateStats(code1, &stats); + + { + const std::unordered_map expected = { + {kF32, 3}, {kU32, 2}, {kF32_1, 2}, {kU32_32, 1}}; + EXPECT_EQ(expected, stats.id_descriptor_hist); + } + + CompileAndAggregateStats(code2, &stats); + { + const std::unordered_map expected = { + {kF32, 6}, {kU32, 4}, {kF32_1, 3}, {kF32_3, 1}, {kU32_32, 2}}; + EXPECT_EQ(expected, stats.id_descriptor_hist); + } +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/stats/stats_analyzer_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/stats/stats_analyzer_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/stats/stats_analyzer_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/stats/stats_analyzer_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,172 @@ +// Copyright (c) 2017 Google 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. + +// Tests for unique type declaration rules validator. + +#include +#include + +#include "latest_version_spirv_header.h" +#include "test_fixture.h" +#include "tools/stats/stats_analyzer.h" + +namespace { + +using libspirv::SpirvStats; + +// Fills |stats| with some synthetic header stats, as if aggregated from 100 +// modules (100 used for simpler percentage evaluation). +void FillDefaultStats(SpirvStats* stats) { + *stats = SpirvStats(); + stats->version_hist[0x00010000] = 40; + stats->version_hist[0x00010100] = 60; + stats->generator_hist[0x00000000] = 64; + stats->generator_hist[0x00010000] = 1; + stats->generator_hist[0x00020000] = 2; + stats->generator_hist[0x00030000] = 3; + stats->generator_hist[0x00040000] = 4; + stats->generator_hist[0x00050000] = 5; + stats->generator_hist[0x00060000] = 6; + stats->generator_hist[0x00070000] = 7; + stats->generator_hist[0x00080000] = 8; + + int num_version_entries = 0; + for (const auto& pair : stats->version_hist) { + num_version_entries += pair.second; + } + + int num_generator_entries = 0; + for (const auto& pair : stats->generator_hist) { + num_generator_entries += pair.second; + } + + EXPECT_EQ(num_version_entries, num_generator_entries); +} + +TEST(StatsAnalyzer, Version) { + SpirvStats stats; + FillDefaultStats(&stats); + + StatsAnalyzer analyzer(stats); + + std::stringstream ss; + analyzer.WriteVersion(ss); + const std::string output = ss.str(); + const std::string expected_output = "Version 1.1 60%\nVersion 1.0 40%\n"; + + EXPECT_EQ(expected_output, output); +} + +TEST(StatsAnalyzer, Generator) { + SpirvStats stats; + FillDefaultStats(&stats); + + StatsAnalyzer analyzer(stats); + + std::stringstream ss; + analyzer.WriteGenerator(ss); + const std::string output = ss.str(); + const std::string expected_output = + "Khronos 64%\nKhronos Glslang Reference Front End 8%\n" + "Khronos SPIR-V Tools Assembler 7%\nKhronos LLVM/SPIR-V Translator 6%" + "\nARM 5%\nNVIDIA 4%\nCodeplay 3%\nValve 2%\nLunarG 1%\n"; + + EXPECT_EQ(expected_output, output); +} + +TEST(StatsAnalyzer, Capability) { + SpirvStats stats; + FillDefaultStats(&stats); + + stats.capability_hist[SpvCapabilityShader] = 25; + stats.capability_hist[SpvCapabilityKernel] = 75; + + StatsAnalyzer analyzer(stats); + + std::stringstream ss; + analyzer.WriteCapability(ss); + const std::string output = ss.str(); + const std::string expected_output = "Kernel 75%\nShader 25%\n"; + + EXPECT_EQ(expected_output, output); +} + +TEST(StatsAnalyzer, Extension) { + SpirvStats stats; + FillDefaultStats(&stats); + + stats.extension_hist["greatest_extension_ever"] = 1; + stats.extension_hist["worst_extension_ever"] = 10; + + StatsAnalyzer analyzer(stats); + + std::stringstream ss; + analyzer.WriteExtension(ss); + const std::string output = ss.str(); + const std::string expected_output = + "worst_extension_ever 10%\ngreatest_extension_ever 1%\n"; + + EXPECT_EQ(expected_output, output); +} + +TEST(StatsAnalyzer, Opcode) { + SpirvStats stats; + FillDefaultStats(&stats); + + stats.opcode_hist[SpvOpCapability] = 20; + stats.opcode_hist[SpvOpConstant] = 80; + stats.opcode_hist[SpvOpDecorate] = 100; + + StatsAnalyzer analyzer(stats); + + std::stringstream ss; + analyzer.WriteOpcode(ss); + const std::string output = ss.str(); + const std::string expected_output = + "Total unique opcodes used: 3\nDecorate 50%\n" + "Constant 40%\nCapability 10%\n"; + + EXPECT_EQ(expected_output, output); +} + +TEST(StatsAnalyzer, OpcodeMarkov) { + SpirvStats stats; + FillDefaultStats(&stats); + + stats.opcode_hist[SpvOpFMul] = 400; + stats.opcode_hist[SpvOpFAdd] = 200; + stats.opcode_hist[SpvOpFSub] = 400; + + stats.opcode_markov_hist.resize(1); + auto& hist = stats.opcode_markov_hist[0]; + hist[SpvOpFMul][SpvOpFAdd] = 100; + hist[SpvOpFMul][SpvOpFSub] = 300; + hist[SpvOpFAdd][SpvOpFMul] = 100; + hist[SpvOpFAdd][SpvOpFAdd] = 100; + + StatsAnalyzer analyzer(stats); + + std::stringstream ss; + analyzer.WriteOpcodeMarkov(ss); + const std::string output = ss.str(); + const std::string expected_output = + "FMul -> FSub 75% (base rate 40%, pair occurrences 300)\n" + "FMul -> FAdd 25% (base rate 20%, pair occurrences 100)\n" + "FAdd -> FAdd 50% (base rate 20%, pair occurrences 100)\n" + "FAdd -> FMul 50% (base rate 40%, pair occurrences 100)\n"; + + EXPECT_EQ(expected_output, output); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/string_utils_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/string_utils_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/string_utils_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/string_utils_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,190 @@ +// Copyright (c) 2017 Google 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. + +#include + +#include "gtest/gtest.h" +#include "source/util/string_utils.h" +#include "spirv-tools/libspirv.h" + +namespace { + +using ::spvutils::CardinalToOrdinal; +using ::spvutils::ToString; + +TEST(ToString, Int) { + EXPECT_EQ("0", ToString(0)); + EXPECT_EQ("1000", ToString(1000)); + EXPECT_EQ("-1", ToString(-1)); + EXPECT_EQ("0", ToString(0LL)); + EXPECT_EQ("1000", ToString(1000LL)); + EXPECT_EQ("-1", ToString(-1LL)); +} + +TEST(ToString, Uint) { + EXPECT_EQ("0", ToString(0U)); + EXPECT_EQ("1000", ToString(1000U)); + EXPECT_EQ("0", ToString(0ULL)); + EXPECT_EQ("1000", ToString(1000ULL)); +} + +TEST(ToString, Float) { + EXPECT_EQ("0", ToString(0.f)); + EXPECT_EQ("1000", ToString(1000.f)); + EXPECT_EQ("-1.5", ToString(-1.5f)); +} + +TEST(ToString, Double) { + EXPECT_EQ("0", ToString(0.)); + EXPECT_EQ("1000", ToString(1000.)); + EXPECT_EQ("-1.5", ToString(-1.5)); +} + +TEST(CardinalToOrdinal, Test) { + EXPECT_EQ("1st", CardinalToOrdinal(1)); + EXPECT_EQ("2nd", CardinalToOrdinal(2)); + EXPECT_EQ("3rd", CardinalToOrdinal(3)); + EXPECT_EQ("4th", CardinalToOrdinal(4)); + EXPECT_EQ("5th", CardinalToOrdinal(5)); + EXPECT_EQ("6th", CardinalToOrdinal(6)); + EXPECT_EQ("7th", CardinalToOrdinal(7)); + EXPECT_EQ("8th", CardinalToOrdinal(8)); + EXPECT_EQ("9th", CardinalToOrdinal(9)); + EXPECT_EQ("10th", CardinalToOrdinal(10)); + EXPECT_EQ("11th", CardinalToOrdinal(11)); + EXPECT_EQ("12th", CardinalToOrdinal(12)); + EXPECT_EQ("13th", CardinalToOrdinal(13)); + EXPECT_EQ("14th", CardinalToOrdinal(14)); + EXPECT_EQ("15th", CardinalToOrdinal(15)); + EXPECT_EQ("16th", CardinalToOrdinal(16)); + EXPECT_EQ("17th", CardinalToOrdinal(17)); + EXPECT_EQ("18th", CardinalToOrdinal(18)); + EXPECT_EQ("19th", CardinalToOrdinal(19)); + EXPECT_EQ("20th", CardinalToOrdinal(20)); + EXPECT_EQ("21st", CardinalToOrdinal(21)); + EXPECT_EQ("22nd", CardinalToOrdinal(22)); + EXPECT_EQ("23rd", CardinalToOrdinal(23)); + EXPECT_EQ("24th", CardinalToOrdinal(24)); + EXPECT_EQ("25th", CardinalToOrdinal(25)); + EXPECT_EQ("26th", CardinalToOrdinal(26)); + EXPECT_EQ("27th", CardinalToOrdinal(27)); + EXPECT_EQ("28th", CardinalToOrdinal(28)); + EXPECT_EQ("29th", CardinalToOrdinal(29)); + EXPECT_EQ("30th", CardinalToOrdinal(30)); + EXPECT_EQ("31st", CardinalToOrdinal(31)); + EXPECT_EQ("32nd", CardinalToOrdinal(32)); + EXPECT_EQ("33rd", CardinalToOrdinal(33)); + EXPECT_EQ("34th", CardinalToOrdinal(34)); + EXPECT_EQ("35th", CardinalToOrdinal(35)); + EXPECT_EQ("100th", CardinalToOrdinal(100)); + EXPECT_EQ("101st", CardinalToOrdinal(101)); + EXPECT_EQ("102nd", CardinalToOrdinal(102)); + EXPECT_EQ("103rd", CardinalToOrdinal(103)); + EXPECT_EQ("104th", CardinalToOrdinal(104)); + EXPECT_EQ("105th", CardinalToOrdinal(105)); + EXPECT_EQ("106th", CardinalToOrdinal(106)); + EXPECT_EQ("107th", CardinalToOrdinal(107)); + EXPECT_EQ("108th", CardinalToOrdinal(108)); + EXPECT_EQ("109th", CardinalToOrdinal(109)); + EXPECT_EQ("110th", CardinalToOrdinal(110)); + EXPECT_EQ("111th", CardinalToOrdinal(111)); + EXPECT_EQ("112th", CardinalToOrdinal(112)); + EXPECT_EQ("113th", CardinalToOrdinal(113)); + EXPECT_EQ("114th", CardinalToOrdinal(114)); + EXPECT_EQ("115th", CardinalToOrdinal(115)); + EXPECT_EQ("116th", CardinalToOrdinal(116)); + EXPECT_EQ("117th", CardinalToOrdinal(117)); + EXPECT_EQ("118th", CardinalToOrdinal(118)); + EXPECT_EQ("119th", CardinalToOrdinal(119)); + EXPECT_EQ("120th", CardinalToOrdinal(120)); + EXPECT_EQ("121st", CardinalToOrdinal(121)); + EXPECT_EQ("122nd", CardinalToOrdinal(122)); + EXPECT_EQ("123rd", CardinalToOrdinal(123)); + EXPECT_EQ("124th", CardinalToOrdinal(124)); + EXPECT_EQ("125th", CardinalToOrdinal(125)); + EXPECT_EQ("126th", CardinalToOrdinal(126)); + EXPECT_EQ("127th", CardinalToOrdinal(127)); + EXPECT_EQ("128th", CardinalToOrdinal(128)); + EXPECT_EQ("129th", CardinalToOrdinal(129)); + EXPECT_EQ("130th", CardinalToOrdinal(130)); + EXPECT_EQ("131st", CardinalToOrdinal(131)); + EXPECT_EQ("132nd", CardinalToOrdinal(132)); + EXPECT_EQ("133rd", CardinalToOrdinal(133)); + EXPECT_EQ("134th", CardinalToOrdinal(134)); + EXPECT_EQ("135th", CardinalToOrdinal(135)); + EXPECT_EQ("1000th", CardinalToOrdinal(1000)); + EXPECT_EQ("1001st", CardinalToOrdinal(1001)); + EXPECT_EQ("1002nd", CardinalToOrdinal(1002)); + EXPECT_EQ("1003rd", CardinalToOrdinal(1003)); + EXPECT_EQ("1004th", CardinalToOrdinal(1004)); + EXPECT_EQ("1005th", CardinalToOrdinal(1005)); + EXPECT_EQ("1006th", CardinalToOrdinal(1006)); + EXPECT_EQ("1007th", CardinalToOrdinal(1007)); + EXPECT_EQ("1008th", CardinalToOrdinal(1008)); + EXPECT_EQ("1009th", CardinalToOrdinal(1009)); + EXPECT_EQ("1010th", CardinalToOrdinal(1010)); + EXPECT_EQ("1011th", CardinalToOrdinal(1011)); + EXPECT_EQ("1012th", CardinalToOrdinal(1012)); + EXPECT_EQ("1013th", CardinalToOrdinal(1013)); + EXPECT_EQ("1014th", CardinalToOrdinal(1014)); + EXPECT_EQ("1015th", CardinalToOrdinal(1015)); + EXPECT_EQ("1016th", CardinalToOrdinal(1016)); + EXPECT_EQ("1017th", CardinalToOrdinal(1017)); + EXPECT_EQ("1018th", CardinalToOrdinal(1018)); + EXPECT_EQ("1019th", CardinalToOrdinal(1019)); + EXPECT_EQ("1020th", CardinalToOrdinal(1020)); + EXPECT_EQ("1021st", CardinalToOrdinal(1021)); + EXPECT_EQ("1022nd", CardinalToOrdinal(1022)); + EXPECT_EQ("1023rd", CardinalToOrdinal(1023)); + EXPECT_EQ("1024th", CardinalToOrdinal(1024)); + EXPECT_EQ("1025th", CardinalToOrdinal(1025)); + EXPECT_EQ("1026th", CardinalToOrdinal(1026)); + EXPECT_EQ("1027th", CardinalToOrdinal(1027)); + EXPECT_EQ("1028th", CardinalToOrdinal(1028)); + EXPECT_EQ("1029th", CardinalToOrdinal(1029)); + EXPECT_EQ("1030th", CardinalToOrdinal(1030)); + EXPECT_EQ("1031st", CardinalToOrdinal(1031)); + EXPECT_EQ("1032nd", CardinalToOrdinal(1032)); + EXPECT_EQ("1033rd", CardinalToOrdinal(1033)); + EXPECT_EQ("1034th", CardinalToOrdinal(1034)); + EXPECT_EQ("1035th", CardinalToOrdinal(1035)); + EXPECT_EQ("1200th", CardinalToOrdinal(1200)); + EXPECT_EQ("1201st", CardinalToOrdinal(1201)); + EXPECT_EQ("1202nd", CardinalToOrdinal(1202)); + EXPECT_EQ("1203rd", CardinalToOrdinal(1203)); + EXPECT_EQ("1204th", CardinalToOrdinal(1204)); + EXPECT_EQ("1205th", CardinalToOrdinal(1205)); + EXPECT_EQ("1206th", CardinalToOrdinal(1206)); + EXPECT_EQ("1207th", CardinalToOrdinal(1207)); + EXPECT_EQ("1208th", CardinalToOrdinal(1208)); + EXPECT_EQ("1209th", CardinalToOrdinal(1209)); + EXPECT_EQ("1210th", CardinalToOrdinal(1210)); + EXPECT_EQ("1211th", CardinalToOrdinal(1211)); + EXPECT_EQ("1212th", CardinalToOrdinal(1212)); + EXPECT_EQ("1213th", CardinalToOrdinal(1213)); + EXPECT_EQ("1214th", CardinalToOrdinal(1214)); + EXPECT_EQ("1215th", CardinalToOrdinal(1215)); + EXPECT_EQ("1216th", CardinalToOrdinal(1216)); + EXPECT_EQ("1217th", CardinalToOrdinal(1217)); + EXPECT_EQ("1218th", CardinalToOrdinal(1218)); + EXPECT_EQ("1219th", CardinalToOrdinal(1219)); + EXPECT_EQ("1220th", CardinalToOrdinal(1220)); + EXPECT_EQ("1221st", CardinalToOrdinal(1221)); + EXPECT_EQ("1222nd", CardinalToOrdinal(1222)); + EXPECT_EQ("1223rd", CardinalToOrdinal(1223)); + EXPECT_EQ("1224th", CardinalToOrdinal(1224)); + EXPECT_EQ("1225th", CardinalToOrdinal(1225)); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/target_env_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/target_env_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/target_env_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/target_env_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,103 @@ +// Copyright (c) 2016 Google 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. + +#include + +#include "unit_spirv.h" + +#include "source/spirv_target_env.h" + +namespace { + +using ::testing::AnyOf; +using ::testing::Eq; +using ::testing::StartsWith; +using ::testing::ValuesIn; + +using TargetEnvTest = ::testing::TestWithParam; +TEST_P(TargetEnvTest, CreateContext) { + spv_target_env env = GetParam(); + spv_context context = spvContextCreate(env); + ASSERT_NE(nullptr, context); + spvContextDestroy(context); // Avoid leaking +} + +TEST_P(TargetEnvTest, ValidDescription) { + const char* description = spvTargetEnvDescription(GetParam()); + ASSERT_NE(nullptr, description); + ASSERT_THAT(description, StartsWith("SPIR-V ")); +} + +TEST_P(TargetEnvTest, ValidSpirvVersion) { + auto spirv_version = spvVersionForTargetEnv(GetParam()); + ASSERT_THAT(spirv_version, AnyOf(0x10000, 0x10100, 0x10200, 0x10300)); +} + +INSTANTIATE_TEST_CASE_P(AllTargetEnvs, TargetEnvTest, + ValuesIn(spvtest::AllTargetEnvironments())); + +TEST(GetContextTest, InvalidTargetEnvProducesNull) { + // Use a value beyond the last valid enum value. + spv_context context = spvContextCreate(static_cast(30)); + EXPECT_EQ(context, nullptr); +} + +// A test case for parsing an environment string. +struct ParseCase { + const char* input; + bool success; // Expect to successfully parse? + spv_target_env env; // The parsed environment, if successful. +}; + +using TargetParseTest = ::testing::TestWithParam; + +TEST_P(TargetParseTest, InvalidTargetEnvProducesNull) { + spv_target_env env; + bool parsed = spvParseTargetEnv(GetParam().input, &env); + EXPECT_THAT(parsed, Eq(GetParam().success)); + EXPECT_THAT(env, Eq(GetParam().env)); +} + +INSTANTIATE_TEST_CASE_P( + TargetParsing, TargetParseTest, + ValuesIn(std::vector{ + {"spv1.0", true, SPV_ENV_UNIVERSAL_1_0}, + {"spv1.1", true, SPV_ENV_UNIVERSAL_1_1}, + {"spv1.2", true, SPV_ENV_UNIVERSAL_1_2}, + {"spv1.3", true, SPV_ENV_UNIVERSAL_1_3}, + {"vulkan1.0", true, SPV_ENV_VULKAN_1_0}, + {"vulkan1.1", true, SPV_ENV_VULKAN_1_1}, + {"opencl2.1", true, SPV_ENV_OPENCL_2_1}, + {"opencl2.2", true, SPV_ENV_OPENCL_2_2}, + {"opengl4.0", true, SPV_ENV_OPENGL_4_0}, + {"opengl4.1", true, SPV_ENV_OPENGL_4_1}, + {"opengl4.2", true, SPV_ENV_OPENGL_4_2}, + {"opengl4.3", true, SPV_ENV_OPENGL_4_3}, + {"opengl4.5", true, SPV_ENV_OPENGL_4_5}, + {"opencl1.2", true, SPV_ENV_OPENCL_1_2}, + {"opencl1.2embedded", true, SPV_ENV_OPENCL_EMBEDDED_1_2}, + {"opencl2.0", true, SPV_ENV_OPENCL_2_0}, + {"opencl2.0embedded", true, SPV_ENV_OPENCL_EMBEDDED_2_0}, + {"opencl2.1embedded", true, SPV_ENV_OPENCL_EMBEDDED_2_1}, + {"opencl2.2embedded", true, SPV_ENV_OPENCL_EMBEDDED_2_2}, + {"opencl2.3", false, SPV_ENV_UNIVERSAL_1_0}, + {"opencl3.0", false, SPV_ENV_UNIVERSAL_1_0}, + {"vulkan1.2", false, SPV_ENV_UNIVERSAL_1_0}, + {"vulkan2.0", false, SPV_ENV_UNIVERSAL_1_0}, + {nullptr, false, SPV_ENV_UNIVERSAL_1_0}, + {"", false, SPV_ENV_UNIVERSAL_1_0}, + {"abc", false, SPV_ENV_UNIVERSAL_1_0}, + })); + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/test_fixture.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/test_fixture.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/test_fixture.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/test_fixture.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,182 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_TEST_TEST_FIXTURE_H_ +#define LIBSPIRV_TEST_TEST_FIXTURE_H_ + +#include "unit_spirv.h" + +namespace spvtest { + +// RAII for spv_context. +struct ScopedContext { + ScopedContext(spv_target_env env = SPV_ENV_UNIVERSAL_1_0) + : context(spvContextCreate(env)) {} + ~ScopedContext() { spvContextDestroy(context); } + spv_context context; +}; + +// Common setup for TextToBinary tests. SetText() should be called to populate +// the actual test text. +template +class TextToBinaryTestBase : public T { + public: + // Shorthand for SPIR-V compilation result. + using SpirvVector = std::vector; + + // Offset into a SpirvVector at which the first instruction starts. + static const SpirvVector::size_type kFirstInstruction = 5; + + TextToBinaryTestBase() : diagnostic(nullptr), text(), binary(nullptr) { + char textStr[] = "substitute the text member variable with your test"; + text = {textStr, strlen(textStr)}; + } + + virtual ~TextToBinaryTestBase() { + DestroyBinary(); + if (diagnostic) spvDiagnosticDestroy(diagnostic); + } + + // Returns subvector v[from:end). + SpirvVector Subvector(const SpirvVector& v, SpirvVector::size_type from) { + assert(from <= v.size()); + return SpirvVector(v.begin() + from, v.end()); + } + + // Compiles SPIR-V text in the given assembly syntax format, asserting + // compilation success. Returns the compiled code. + SpirvVector CompileSuccessfully(const std::string& txt, + spv_target_env env = SPV_ENV_UNIVERSAL_1_0) { + spv_result_t status = + spvTextToBinary(ScopedContext(env).context, txt.c_str(), txt.size(), + &binary, &diagnostic); + EXPECT_EQ(SPV_SUCCESS, status) << txt; + SpirvVector code_copy; + if (status == SPV_SUCCESS) { + code_copy = SpirvVector(binary->code, binary->code + binary->wordCount); + DestroyBinary(); + } else { + spvDiagnosticPrint(diagnostic); + } + return code_copy; + } + + // Compiles SPIR-V text with the given format, asserting compilation failure. + // Returns the error message(s). + std::string CompileFailure(const std::string& txt, + spv_target_env env = SPV_ENV_UNIVERSAL_1_0) { + EXPECT_NE(SPV_SUCCESS, + spvTextToBinary(ScopedContext(env).context, txt.c_str(), + txt.size(), &binary, &diagnostic)) + << txt; + DestroyBinary(); + return diagnostic->error; + } + + // Encodes SPIR-V text into binary and then decodes the binary using + // given options. Returns the decoded text. + std::string EncodeAndDecodeSuccessfully( + const std::string& txt, + uint32_t disassemble_options = SPV_BINARY_TO_TEXT_OPTION_NONE, + spv_target_env env = SPV_ENV_UNIVERSAL_1_0) { + DestroyBinary(); + ScopedContext context(env); + disassemble_options |= SPV_BINARY_TO_TEXT_OPTION_NO_HEADER; + spv_result_t error = spvTextToBinary(context.context, txt.c_str(), + txt.size(), &binary, &diagnostic); + if (error) { + spvDiagnosticPrint(diagnostic); + spvDiagnosticDestroy(diagnostic); + } + EXPECT_EQ(SPV_SUCCESS, error); + if (!binary) return ""; + + spv_text decoded_text; + error = spvBinaryToText(context.context, binary->code, binary->wordCount, + disassemble_options, &decoded_text, &diagnostic); + if (error) { + spvDiagnosticPrint(diagnostic); + spvDiagnosticDestroy(diagnostic); + } + EXPECT_EQ(SPV_SUCCESS, error) << txt; + + const std::string decoded_string = decoded_text->str; + spvTextDestroy(decoded_text); + + return decoded_string; + } + + // Encodes SPIR-V text into binary. This is expected to succeed. + // The given words are then appended to the binary, and the result + // is then decoded. This is expected to fail. + // Returns the error message. + std::string EncodeSuccessfullyDecodeFailed( + const std::string& txt, const SpirvVector& words_to_append) { + SpirvVector code = + spvtest::Concatenate({CompileSuccessfully(txt), words_to_append}); + + spv_text decoded_text; + EXPECT_NE(SPV_SUCCESS, + spvBinaryToText(ScopedContext().context, code.data(), code.size(), + SPV_BINARY_TO_TEXT_OPTION_NONE, &decoded_text, + &diagnostic)); + if (diagnostic) { + std::string error_message = diagnostic->error; + spvDiagnosticDestroy(diagnostic); + diagnostic = nullptr; + return error_message; + } + return ""; + } + + // Compiles SPIR-V text, asserts success, and returns the words representing + // the instructions. In particular, skip the words in the SPIR-V header. + SpirvVector CompiledInstructions(const std::string& txt, + spv_target_env env = SPV_ENV_UNIVERSAL_1_0) { + const SpirvVector code = CompileSuccessfully(txt, env); + SpirvVector result; + // Extract just the instructions. + // If the code fails to compile, then return the empty vector. + // In any case, don't crash or invoke undefined behaviour. + if (code.size() >= kFirstInstruction) + result = Subvector(code, kFirstInstruction); + return result; + } + + void SetText(const std::string& code) { + textString = code; + text.str = textString.c_str(); + text.length = textString.size(); + } + + // Destroys the binary, if it exists. + void DestroyBinary() { + spvBinaryDestroy(binary); + binary = nullptr; + } + + spv_diagnostic diagnostic; + + std::string textString; + spv_text_t text; + spv_binary binary; +}; + +using TextToBinaryTest = TextToBinaryTestBase<::testing::Test>; +} // namespace spvtest + +using RoundTripTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +#endif // LIBSPIRV_TEST_TEST_FIXTURE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_advance_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_advance_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_advance_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_advance_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,131 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +namespace { + +using libspirv::AssemblyContext; +using spvtest::AutoText; + +TEST(TextAdvance, LeadingNewLines) { + AutoText input("\n\nWord"); + AssemblyContext data(input, nullptr); + ASSERT_EQ(SPV_SUCCESS, data.advance()); + ASSERT_EQ(0u, data.position().column); + ASSERT_EQ(2u, data.position().line); + ASSERT_EQ(2u, data.position().index); +} + +TEST(TextAdvance, LeadingSpaces) { + AutoText input(" Word"); + AssemblyContext data(input, nullptr); + ASSERT_EQ(SPV_SUCCESS, data.advance()); + ASSERT_EQ(4u, data.position().column); + ASSERT_EQ(0u, data.position().line); + ASSERT_EQ(4u, data.position().index); +} + +TEST(TextAdvance, LeadingTabs) { + AutoText input("\t\t\tWord"); + AssemblyContext data(input, nullptr); + ASSERT_EQ(SPV_SUCCESS, data.advance()); + ASSERT_EQ(3u, data.position().column); + ASSERT_EQ(0u, data.position().line); + ASSERT_EQ(3u, data.position().index); +} + +TEST(TextAdvance, LeadingNewLinesSpacesAndTabs) { + AutoText input("\n\n\t Word"); + AssemblyContext data(input, nullptr); + ASSERT_EQ(SPV_SUCCESS, data.advance()); + ASSERT_EQ(3u, data.position().column); + ASSERT_EQ(2u, data.position().line); + ASSERT_EQ(5u, data.position().index); +} + +TEST(TextAdvance, LeadingWhitespaceAfterCommentLine) { + AutoText input("; comment\n \t \tWord"); + AssemblyContext data(input, nullptr); + ASSERT_EQ(SPV_SUCCESS, data.advance()); + ASSERT_EQ(4u, data.position().column); + ASSERT_EQ(1u, data.position().line); + ASSERT_EQ(14u, data.position().index); +} + +TEST(TextAdvance, EOFAfterCommentLine) { + AutoText input("; comment"); + AssemblyContext data(input, nullptr); + ASSERT_EQ(SPV_END_OF_STREAM, data.advance()); +} + +TEST(TextAdvance, NullTerminator) { + AutoText input(""); + AssemblyContext data(input, nullptr); + ASSERT_EQ(SPV_END_OF_STREAM, data.advance()); +} + +TEST(TextAdvance, NoNullTerminatorAfterCommentLine) { + std::string input = "; comment|padding beyond the end"; + spv_text_t text = {input.data(), 9}; + AssemblyContext data(&text, nullptr); + ASSERT_EQ(SPV_END_OF_STREAM, data.advance()); + EXPECT_EQ(9u, data.position().index); +} + +TEST(TextAdvance, NoNullTerminator) { + spv_text_t text = {"OpNop\nSomething else in memory", 6}; + AssemblyContext data(&text, nullptr); + const spv_position_t line_break = {1u, 5u, 5u}; + data.setPosition(line_break); + ASSERT_EQ(SPV_END_OF_STREAM, data.advance()); +} + +// Invokes AssemblyContext::advance() on text, asserts success, and returns +// AssemblyContext::position(). +spv_position_t PositionAfterAdvance(const char* text) { + AutoText input(text); + AssemblyContext data(input, nullptr); + EXPECT_EQ(SPV_SUCCESS, data.advance()); + return data.position(); +} + +TEST(TextAdvance, SkipOverCR) { + const auto pos = PositionAfterAdvance("\rWord"); + EXPECT_EQ(1u, pos.column); + EXPECT_EQ(0u, pos.line); + EXPECT_EQ(1u, pos.index); +} + +TEST(TextAdvance, SkipOverCRs) { + const auto pos = PositionAfterAdvance("\r\r\rWord"); + EXPECT_EQ(3u, pos.column); + EXPECT_EQ(0u, pos.line); + EXPECT_EQ(3u, pos.index); +} + +TEST(TextAdvance, SkipOverCRLF) { + const auto pos = PositionAfterAdvance("\r\nWord"); + EXPECT_EQ(0u, pos.column); + EXPECT_EQ(1u, pos.line); + EXPECT_EQ(2u, pos.index); +} + +TEST(TextAdvance, SkipOverCRLFs) { + const auto pos = PositionAfterAdvance("\r\n\r\nWord"); + EXPECT_EQ(0u, pos.column); + EXPECT_EQ(2u, pos.line); + EXPECT_EQ(4u, pos.index); +} +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_destroy_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_destroy_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_destroy_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_destroy_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,73 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +namespace { + +TEST(TextDestroy, DestroyNull) { spvBinaryDestroy(nullptr); } + +TEST(TextDestroy, Default) { + spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_0); + char textStr[] = R"( + OpSource OpenCL_C 12 + OpMemoryModel Physical64 OpenCL + OpSourceExtension "PlaceholderExtensionName" + OpEntryPoint Kernel %0 "" + OpExecutionMode %0 LocalSizeHint 1 1 1 + %1 = OpTypeVoid + %2 = OpTypeBool + %3 = OpTypeInt 8 0 + %4 = OpTypeInt 8 1 + %5 = OpTypeInt 16 0 + %6 = OpTypeInt 16 1 + %7 = OpTypeInt 32 0 + %8 = OpTypeInt 32 1 + %9 = OpTypeInt 64 0 + %10 = OpTypeInt 64 1 + %11 = OpTypeFloat 16 + %12 = OpTypeFloat 32 + %13 = OpTypeFloat 64 + %14 = OpTypeVector %3 2 + )"; + + spv_binary binary = nullptr; + spv_diagnostic diagnostic = nullptr; + EXPECT_EQ(SPV_SUCCESS, spvTextToBinary(context, textStr, strlen(textStr), + &binary, &diagnostic)); + EXPECT_NE(nullptr, binary); + EXPECT_NE(nullptr, binary->code); + EXPECT_NE(0u, binary->wordCount); + if (diagnostic) { + spvDiagnosticPrint(diagnostic); + ASSERT_TRUE(false); + } + + spv_text resultText = nullptr; + EXPECT_EQ(SPV_SUCCESS, + spvBinaryToText(context, binary->code, binary->wordCount, 0, + &resultText, &diagnostic)); + spvBinaryDestroy(binary); + if (diagnostic) { + spvDiagnosticPrint(diagnostic); + spvDiagnosticDestroy(diagnostic); + ASSERT_TRUE(false); + } + EXPECT_NE(nullptr, resultText->str); + EXPECT_NE(0u, resultText->length); + spvTextDestroy(resultText); + spvContextDestroy(context); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_literal_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_literal_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_literal_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_literal_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,413 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +#include "gmock/gmock.h" +#include "message.h" +#include "test_fixture.h" + +#include + +using ::testing::Eq; +namespace { + +TEST(TextLiteral, GoodI32) { + spv_literal_t l; + + ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral("-0", &l)); + EXPECT_EQ(SPV_LITERAL_TYPE_INT_32, l.type); + EXPECT_EQ(0, l.value.i32); + + ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral("-2147483648", &l)); + EXPECT_EQ(SPV_LITERAL_TYPE_INT_32, l.type); + EXPECT_EQ((-2147483647L - 1), l.value.i32); +} + +TEST(TextLiteral, GoodU32) { + spv_literal_t l; + + ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral("0", &l)); + EXPECT_EQ(SPV_LITERAL_TYPE_UINT_32, l.type); + EXPECT_EQ(0, l.value.i32); + + ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral("4294967295", &l)); + EXPECT_EQ(SPV_LITERAL_TYPE_UINT_32, l.type); + EXPECT_EQ(4294967295, l.value.u32); +} + +TEST(TextLiteral, GoodI64) { + spv_literal_t l; + + ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral("-2147483649", &l)); + EXPECT_EQ(SPV_LITERAL_TYPE_INT_64, l.type); + EXPECT_EQ(-2147483649LL, l.value.i64); +} + +TEST(TextLiteral, GoodU64) { + spv_literal_t l; + + ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral("4294967296", &l)); + EXPECT_EQ(SPV_LITERAL_TYPE_UINT_64, l.type); + EXPECT_EQ(4294967296u, l.value.u64); +} + +TEST(TextLiteral, GoodFloat) { + spv_literal_t l; + + ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral("1.0", &l)); + EXPECT_EQ(SPV_LITERAL_TYPE_FLOAT_32, l.type); + EXPECT_EQ(1.0, l.value.f); + + ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral("1.5", &l)); + EXPECT_EQ(SPV_LITERAL_TYPE_FLOAT_32, l.type); + EXPECT_EQ(1.5, l.value.f); + + ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral("-.25", &l)); + EXPECT_EQ(SPV_LITERAL_TYPE_FLOAT_32, l.type); + EXPECT_EQ(-.25, l.value.f); +} + +TEST(TextLiteral, BadString) { + spv_literal_t l; + + EXPECT_EQ(SPV_FAILED_MATCH, spvTextToLiteral("", &l)); + EXPECT_EQ(SPV_FAILED_MATCH, spvTextToLiteral("-", &l)); + EXPECT_EQ(SPV_FAILED_MATCH, spvTextToLiteral("--", &l)); + EXPECT_EQ(SPV_FAILED_MATCH, spvTextToLiteral("1-2", &l)); + EXPECT_EQ(SPV_FAILED_MATCH, spvTextToLiteral("123a", &l)); + EXPECT_EQ(SPV_FAILED_MATCH, spvTextToLiteral("12.2.3", &l)); + EXPECT_EQ(SPV_FAILED_MATCH, spvTextToLiteral("\"", &l)); + EXPECT_EQ(SPV_FAILED_MATCH, spvTextToLiteral("\"z", &l)); + EXPECT_EQ(SPV_FAILED_MATCH, spvTextToLiteral("a\"", &l)); +} + +class GoodStringTest + : public ::testing::TestWithParam> {}; + +TEST_P(GoodStringTest, GoodStrings) { + spv_literal_t l; + + ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral(std::get<0>(GetParam()), &l)); + EXPECT_EQ(SPV_LITERAL_TYPE_STRING, l.type); + EXPECT_EQ(std::get<1>(GetParam()), l.str); +} + +INSTANTIATE_TEST_CASE_P( + TextLiteral, GoodStringTest, + ::testing::ValuesIn(std::vector>{ + {R"("-")", "-"}, + {R"("--")", "--"}, + {R"("1-2")", "1-2"}, + {R"("123a")", "123a"}, + {R"("12.2.3")", "12.2.3"}, + {R"("\"")", "\""}, + {R"("\\")", "\\"}, + {"\"\\foo\nbar\"", "foo\nbar"}, + {"\"\\foo\\\nbar\"", "foo\nbar"}, + {"\"\xE4\xBA\xB2\"", "\xE4\xBA\xB2"}, + {"\"\\\xE4\xBA\xB2\"", "\xE4\xBA\xB2"}, + {"\"this \\\" and this \\\\ and \\\xE4\xBA\xB2\"", + "this \" and this \\ and \xE4\xBA\xB2"}}), ); + +TEST(TextLiteral, StringTooLong) { + spv_literal_t l; + std::string too_long = + std::string("\"") + + std::string(SPV_LIMIT_LITERAL_STRING_BYTES_MAX + 1, 'a') + "\""; + EXPECT_EQ(SPV_ERROR_OUT_OF_MEMORY, spvTextToLiteral(too_long.data(), &l)); +} + +TEST(TextLiteral, GoodLongString) { + spv_literal_t l; + // The universal limit of 65535 Unicode characters might make this + // fail validation, since SPV_LIMIT_LITERAL_STRING_BYTES_MAX is 4*65535. + // However, as an implementation detail, we'll allow the assembler + // to parse it. Otherwise we'd have to scan the string for valid UTF-8 + // characters. + std::string unquoted(SPV_LIMIT_LITERAL_STRING_BYTES_MAX, 'a'); + std::string good_long = std::string("\"") + unquoted + "\""; + EXPECT_EQ(SPV_SUCCESS, spvTextToLiteral(good_long.data(), &l)); + EXPECT_EQ(SPV_LITERAL_TYPE_STRING, l.type); + EXPECT_EQ(unquoted.data(), l.str); +} + +TEST(TextLiteral, GoodUTF8String) { + const std::string unquoted = + spvtest::MakeLongUTF8String(SPV_LIMIT_LITERAL_STRING_UTF8_CHARS_MAX); + const std::string good_long = std::string("\"") + unquoted + "\""; + spv_literal_t l; + EXPECT_EQ(SPV_SUCCESS, spvTextToLiteral(good_long.data(), &l)); + EXPECT_EQ(SPV_LITERAL_TYPE_STRING, l.type); + EXPECT_EQ(unquoted.data(), l.str); +} + +// A test case for parsing literal numbers. +struct TextLiteralCase { + uint32_t bitwidth; + const char* text; + bool is_signed; + bool success; + std::vector expected_values; +}; + +using IntegerTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +std::vector successfulEncode(const TextLiteralCase& test, + libspirv::IdTypeClass type) { + spv_instruction_t inst; + std::string message; + auto capture_message = [&message](spv_message_level_t, const char*, + const spv_position_t&, + const char* m) { message = m; }; + libspirv::IdType expected_type{test.bitwidth, test.is_signed, type}; + EXPECT_EQ(SPV_SUCCESS, + libspirv::AssemblyContext(nullptr, capture_message) + .binaryEncodeNumericLiteral(test.text, SPV_ERROR_INVALID_TEXT, + expected_type, &inst)) + << message; + return inst.words; +} + +std::string failedEncode(const TextLiteralCase& test, + libspirv::IdTypeClass type) { + spv_instruction_t inst; + std::string message; + auto capture_message = [&message](spv_message_level_t, const char*, + const spv_position_t&, + const char* m) { message = m; }; + libspirv::IdType expected_type{test.bitwidth, test.is_signed, type}; + EXPECT_EQ(SPV_ERROR_INVALID_TEXT, + libspirv::AssemblyContext(nullptr, capture_message) + .binaryEncodeNumericLiteral(test.text, SPV_ERROR_INVALID_TEXT, + expected_type, &inst)); + return message; +} + +TEST_P(IntegerTest, IntegerBounds) { + if (GetParam().success) { + EXPECT_THAT( + successfulEncode(GetParam(), libspirv::IdTypeClass::kScalarIntegerType), + Eq(GetParam().expected_values)); + } else { + std::stringstream ss; + ss << "Integer " << GetParam().text << " does not fit in a " + << GetParam().bitwidth << "-bit " + << (GetParam().is_signed ? "signed" : "unsigned") << " integer"; + EXPECT_THAT( + failedEncode(GetParam(), libspirv::IdTypeClass::kScalarIntegerType), + Eq(ss.str())); + } +} + +// Four nicely named methods for making TextLiteralCase values. +// Their names have underscores in some places to make it easier +// to read the table that follows. +TextLiteralCase Make_Ok__Signed(uint32_t bitwidth, const char* text, + std::vector encoding) { + return TextLiteralCase{bitwidth, text, true, true, encoding}; +} +TextLiteralCase Make_Ok__Unsigned(uint32_t bitwidth, const char* text, + std::vector encoding) { + return TextLiteralCase{bitwidth, text, false, true, encoding}; +} +TextLiteralCase Make_Bad_Signed(uint32_t bitwidth, const char* text) { + return TextLiteralCase{bitwidth, text, true, false, {}}; +} +TextLiteralCase Make_Bad_Unsigned(uint32_t bitwidth, const char* text) { + return TextLiteralCase{bitwidth, text, false, false, {}}; +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + DecimalIntegers, IntegerTest, + ::testing::ValuesIn(std::vector{ + // Check max value and overflow value for 1-bit numbers. + Make_Ok__Signed(1, "0", {0}), + Make_Ok__Unsigned(1, "1", {1}), + Make_Bad_Signed(1, "1"), + Make_Bad_Unsigned(1, "2"), + + // Check max value and overflow value for 2-bit numbers. + Make_Ok__Signed(2, "1", {1}), + Make_Ok__Unsigned(2, "3", {3}), + Make_Bad_Signed(2, "2"), + Make_Bad_Unsigned(2, "4"), + + // Check max negative value and overflow value for signed + // 1- and 2-bit numbers. Signed negative numbers are sign-extended. + Make_Ok__Signed(1, "-0", {uint32_t(0)}), + Make_Ok__Signed(1, "-1", {uint32_t(-1)}), + Make_Ok__Signed(2, "-0", {0}), + Make_Ok__Signed(2, "-1", {uint32_t(-1)}), + Make_Ok__Signed(2, "-2", {uint32_t(-2)}), + Make_Bad_Signed(2, "-3"), + + Make_Bad_Unsigned(2, "2224323424242424"), + Make_Ok__Unsigned(16, "65535", {0xFFFF}), + Make_Bad_Unsigned(16, "65536"), + Make_Bad_Signed(16, "65535"), + Make_Ok__Signed(16, "32767", {0x7FFF}), + Make_Ok__Signed(16, "-32768", {0xFFFF8000}), + + // Check values around 32-bits in magnitude. + Make_Ok__Unsigned(33, "4294967296", {0, 1}), + Make_Ok__Unsigned(33, "4294967297", {1, 1}), + Make_Bad_Unsigned(33, "8589934592"), + Make_Bad_Signed(33, "4294967296"), + Make_Ok__Signed(33, "-4294967296", {0x0, 0xFFFFFFFF}), + Make_Ok__Unsigned(64, "4294967296", {0, 1}), + Make_Ok__Unsigned(64, "4294967297", {1, 1}), + + // Check max value and overflow value for 64-bit numbers. + Make_Ok__Signed(64, "9223372036854775807", {0xffffffff, 0x7fffffff}), + Make_Bad_Signed(64, "9223372036854775808"), + Make_Ok__Unsigned(64, "9223372036854775808", {0x00000000, 0x80000000}), + Make_Ok__Unsigned(64, "18446744073709551615", {0xffffffff, 0xffffffff}), + Make_Ok__Signed(64, "-9223372036854775808", {0x00000000, 0x80000000}), + + }),); +// clang-format on + +using IntegerLeadingMinusTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(IntegerLeadingMinusTest, CantHaveLeadingMinusOnUnsigned) { + EXPECT_FALSE(GetParam().success); + EXPECT_THAT( + failedEncode(GetParam(), libspirv::IdTypeClass::kScalarIntegerType), + Eq("Cannot put a negative number in an unsigned literal")); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + DecimalAndHexIntegers, IntegerLeadingMinusTest, + ::testing::ValuesIn(std::vector{ + // Unsigned numbers never allow a leading minus sign. + Make_Bad_Unsigned(16, "-0"), + Make_Bad_Unsigned(16, "-0x0"), + Make_Bad_Unsigned(16, "-0x1"), + Make_Bad_Unsigned(32, "-0"), + Make_Bad_Unsigned(32, "-0x0"), + Make_Bad_Unsigned(32, "-0x1"), + Make_Bad_Unsigned(64, "-0"), + Make_Bad_Unsigned(64, "-0x0"), + Make_Bad_Unsigned(64, "-0x1"), + }),); + +// clang-format off +INSTANTIATE_TEST_CASE_P( + HexIntegers, IntegerTest, + ::testing::ValuesIn(std::vector{ + // Check 0x and 0X prefices. + Make_Ok__Signed(16, "0x1234", {0x1234}), + Make_Ok__Signed(16, "0X1234", {0x1234}), + + // Check 1-bit numbers + Make_Ok__Signed(1, "0x0", {0}), + Make_Ok__Signed(1, "0x1", {uint32_t(-1)}), + Make_Ok__Unsigned(1, "0x0", {0}), + Make_Ok__Unsigned(1, "0x1", {1}), + Make_Bad_Signed(1, "0x2"), + Make_Bad_Unsigned(1, "0x2"), + + // Check 2-bit numbers + Make_Ok__Signed(2, "0x0", {0}), + Make_Ok__Signed(2, "0x1", {1}), + Make_Ok__Signed(2, "0x2", {uint32_t(-2)}), + Make_Ok__Signed(2, "0x3", {uint32_t(-1)}), + Make_Ok__Unsigned(2, "0x0", {0}), + Make_Ok__Unsigned(2, "0x1", {1}), + Make_Ok__Unsigned(2, "0x2", {2}), + Make_Ok__Unsigned(2, "0x3", {3}), + Make_Bad_Signed(2, "0x4"), + Make_Bad_Unsigned(2, "0x4"), + + // Check 8-bit numbers + Make_Ok__Signed(8, "0x7f", {0x7f}), + Make_Ok__Signed(8, "0x80", {0xffffff80}), + Make_Ok__Unsigned(8, "0x80", {0x80}), + Make_Ok__Unsigned(8, "0xff", {0xff}), + Make_Bad_Signed(8, "0x100"), + Make_Bad_Unsigned(8, "0x100"), + + // Check 16-bit numbers + Make_Ok__Signed(16, "0x7fff", {0x7fff}), + Make_Ok__Signed(16, "0x8000", {0xffff8000}), + Make_Ok__Unsigned(16, "0x8000", {0x8000}), + Make_Ok__Unsigned(16, "0xffff", {0xffff}), + Make_Bad_Signed(16, "0x10000"), + Make_Bad_Unsigned(16, "0x10000"), + + // Check 32-bit numbers + Make_Ok__Signed(32, "0x7fffffff", {0x7fffffff}), + Make_Ok__Signed(32, "0x80000000", {0x80000000}), + Make_Ok__Unsigned(32, "0x80000000", {0x80000000}), + Make_Ok__Unsigned(32, "0xffffffff", {0xffffffff}), + Make_Bad_Signed(32, "0x100000000"), + Make_Bad_Unsigned(32, "0x100000000"), + + // Check 48-bit numbers + Make_Ok__Unsigned(48, "0x7ffffffff", {0xffffffff, 7}), + Make_Ok__Unsigned(48, "0x800000000", {0, 8}), + Make_Ok__Signed(48, "0x7fffffffffff", {0xffffffff, 0x7fff}), + Make_Ok__Signed(48, "0x800000000000", {0, 0xffff8000}), + Make_Bad_Signed(48, "0x1000000000000"), + Make_Bad_Unsigned(48, "0x1000000000000"), + + // Check 64-bit numbers + Make_Ok__Signed(64, "0x7fffffffffffffff", {0xffffffff, 0x7fffffff}), + Make_Ok__Signed(64, "0x8000000000000000", {0x00000000, 0x80000000}), + Make_Ok__Unsigned(64, "0x7fffffffffffffff", {0xffffffff, 0x7fffffff}), + Make_Ok__Unsigned(64, "0x8000000000000000", {0x00000000, 0x80000000}), + }),); +// clang-format on + +TEST(OverflowIntegerParse, Decimal) { + std::string signed_input = "-18446744073709551616"; + std::string expected_message0 = + "Invalid signed integer literal: " + signed_input; + EXPECT_THAT(failedEncode(Make_Bad_Signed(64, signed_input.c_str()), + libspirv::IdTypeClass::kScalarIntegerType), + Eq(expected_message0)); + + std::string unsigned_input = "18446744073709551616"; + std::string expected_message1 = + "Invalid unsigned integer literal: " + unsigned_input; + EXPECT_THAT(failedEncode(Make_Bad_Unsigned(64, unsigned_input.c_str()), + libspirv::IdTypeClass::kScalarIntegerType), + Eq(expected_message1)); + + // TODO(dneto): When the given number doesn't have a leading sign, + // we say we're trying to parse an unsigned number, even when the caller + // asked for a signed number. This is kind of weird, but it's an + // artefact of how we do the parsing. + EXPECT_THAT(failedEncode(Make_Bad_Signed(64, unsigned_input.c_str()), + libspirv::IdTypeClass::kScalarIntegerType), + Eq(expected_message1)); +} + +TEST(OverflowIntegerParse, Hex) { + std::string input = "0x10000000000000000"; + std::string expected_message = "Invalid unsigned integer literal: " + input; + EXPECT_THAT(failedEncode(Make_Bad_Signed(64, input.c_str()), + libspirv::IdTypeClass::kScalarIntegerType), + Eq(expected_message)); + EXPECT_THAT(failedEncode(Make_Bad_Unsigned(64, input.c_str()), + libspirv::IdTypeClass::kScalarIntegerType), + Eq(expected_message)); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_start_new_inst_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_start_new_inst_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_start_new_inst_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_start_new_inst_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,74 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +#include + +namespace { + +using libspirv::AssemblyContext; +using spvtest::AutoText; + +TEST(TextStartsWithOp, YesAtStart) { + EXPECT_TRUE(AssemblyContext(AutoText("OpFoo"), nullptr).isStartOfNewInst()); + EXPECT_TRUE(AssemblyContext(AutoText("OpFoo"), nullptr).isStartOfNewInst()); + EXPECT_TRUE(AssemblyContext(AutoText("OpEnCL"), nullptr).isStartOfNewInst()); +} + +TEST(TextStartsWithOp, YesAtMiddle) { + { + AutoText text(" OpFoo"); + AssemblyContext dat(text, nullptr); + dat.seekForward(2); + EXPECT_TRUE(dat.isStartOfNewInst()); + } + { + AutoText text("xx OpFoo"); + AssemblyContext dat(text, nullptr); + dat.seekForward(2); + EXPECT_TRUE(dat.isStartOfNewInst()); + } +} + +TEST(TextStartsWithOp, NoIfTooFar) { + AutoText text(" OpFoo"); + AssemblyContext dat(text, nullptr); + dat.seekForward(3); + EXPECT_FALSE(dat.isStartOfNewInst()); +} + +TEST(TextStartsWithOp, NoRegular) { + EXPECT_FALSE( + AssemblyContext(AutoText("Fee Fi Fo Fum"), nullptr).isStartOfNewInst()); + EXPECT_FALSE(AssemblyContext(AutoText("123456"), nullptr).isStartOfNewInst()); + EXPECT_FALSE(AssemblyContext(AutoText("123456"), nullptr).isStartOfNewInst()); + EXPECT_FALSE(AssemblyContext(AutoText("OpenCL"), nullptr).isStartOfNewInst()); +} + +TEST(TextStartsWithOp, YesForValueGenerationForm) { + EXPECT_TRUE( + AssemblyContext(AutoText("%foo = OpAdd"), nullptr).isStartOfNewInst()); + EXPECT_TRUE( + AssemblyContext(AutoText("%foo = OpAdd"), nullptr).isStartOfNewInst()); +} + +TEST(TextStartsWithOp, NoForNearlyValueGeneration) { + EXPECT_FALSE( + AssemblyContext(AutoText("%foo = "), nullptr).isStartOfNewInst()); + EXPECT_FALSE(AssemblyContext(AutoText("%foo "), nullptr).isStartOfNewInst()); + EXPECT_FALSE(AssemblyContext(AutoText("%foo"), nullptr).isStartOfNewInst()); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.annotation_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.annotation_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.annotation_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.annotation_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,504 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Assembler tests for instructions in the "Annotation" section of the +// SPIR-V spec. + +#include "unit_spirv.h" + +#include +#include + +#include "gmock/gmock.h" +#include "test_fixture.h" + +namespace { + +using spvtest::EnumCase; +using spvtest::MakeInstruction; +using spvtest::MakeVector; +using spvtest::TextToBinaryTest; +using std::get; +using std::tuple; +using ::testing::Combine; +using ::testing::Eq; +using ::testing::Values; +using ::testing::ValuesIn; + +// Test OpDecorate + +using OpDecorateSimpleTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>>>; + +TEST_P(OpDecorateSimpleTest, AnySimpleDecoration) { + // This string should assemble, but should not validate. + std::stringstream input; + input << "OpDecorate %1 " << get<1>(GetParam()).name(); + for (auto operand : get<1>(GetParam()).operands()) input << " " << operand; + input << std::endl; + EXPECT_THAT(CompiledInstructions(input.str(), get<0>(GetParam())), + Eq(MakeInstruction(SpvOpDecorate, + {1, uint32_t(get<1>(GetParam()).value())}, + get<1>(GetParam()).operands()))); + // Also check disassembly. + EXPECT_THAT( + EncodeAndDecodeSuccessfully(input.str(), SPV_BINARY_TO_TEXT_OPTION_NONE, + get<0>(GetParam())), + Eq(input.str())); +} + +#define CASE(NAME) SpvDecoration##NAME, #NAME +INSTANTIATE_TEST_CASE_P( + TextToBinaryDecorateSimple, OpDecorateSimpleTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector>{ + // The operand literal values are arbitrarily chosen, + // but there are the right number of them. + {CASE(RelaxedPrecision), {}}, + {CASE(SpecId), {100}}, + {CASE(Block), {}}, + {CASE(BufferBlock), {}}, + {CASE(RowMajor), {}}, + {CASE(ColMajor), {}}, + {CASE(ArrayStride), {4}}, + {CASE(MatrixStride), {16}}, + {CASE(GLSLShared), {}}, + {CASE(GLSLPacked), {}}, + {CASE(CPacked), {}}, + // Placeholder line for enum value 12 + {CASE(NoPerspective), {}}, + {CASE(Flat), {}}, + {CASE(Patch), {}}, + {CASE(Centroid), {}}, + {CASE(Sample), {}}, + {CASE(Invariant), {}}, + {CASE(Restrict), {}}, + {CASE(Aliased), {}}, + {CASE(Volatile), {}}, + {CASE(Constant), {}}, + {CASE(Coherent), {}}, + {CASE(NonWritable), {}}, + {CASE(NonReadable), {}}, + {CASE(Uniform), {}}, + {CASE(SaturatedConversion), {}}, + {CASE(Stream), {2}}, + {CASE(Location), {6}}, + {CASE(Component), {3}}, + {CASE(Index), {14}}, + {CASE(Binding), {19}}, + {CASE(DescriptorSet), {7}}, + {CASE(Offset), {12}}, + {CASE(XfbBuffer), {1}}, + {CASE(XfbStride), {8}}, + {CASE(NoContraction), {}}, + {CASE(InputAttachmentIndex), {102}}, + {CASE(Alignment), {16}}, + })), ); + +INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateSimpleV11, OpDecorateSimpleTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_1), + Values(EnumCase{ + CASE(MaxByteOffset), {128}})), ); +#undef CASE + +TEST_F(OpDecorateSimpleTest, WrongDecoration) { + EXPECT_THAT(CompileFailure("OpDecorate %1 xxyyzz"), + Eq("Invalid decoration 'xxyyzz'.")); +} + +TEST_F(OpDecorateSimpleTest, ExtraOperandsOnDecorationExpectingNone) { + EXPECT_THAT(CompileFailure("OpDecorate %1 RelaxedPrecision 99"), + Eq("Expected or at the beginning of an " + "instruction, found '99'.")); +} + +TEST_F(OpDecorateSimpleTest, ExtraOperandsOnDecorationExpectingOne) { + EXPECT_THAT(CompileFailure("OpDecorate %1 SpecId 99 100"), + Eq("Expected or at the beginning of an " + "instruction, found '100'.")); +} + +TEST_F(OpDecorateSimpleTest, ExtraOperandsOnDecorationExpectingTwo) { + EXPECT_THAT( + CompileFailure("OpDecorate %1 LinkageAttributes \"abc\" Import 42"), + Eq("Expected or at the beginning of an " + "instruction, found '42'.")); +} + +// A single test case for an enum decoration. +struct DecorateEnumCase { + // Place the enum value first, so it's easier to read the binary dumps when + // the test fails. + uint32_t value; // The value within the enum, e.g. Position + std::string name; + uint32_t enum_value; // Which enum, e.g. BuiltIn + std::string enum_name; +}; + +using OpDecorateEnumTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(OpDecorateEnumTest, AnyEnumDecoration) { + // This string should assemble, but should not validate. + const std::string input = + "OpDecorate %1 " + GetParam().enum_name + " " + GetParam().name; + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpDecorate, {1, GetParam().enum_value, + GetParam().value}))); +} + +// Test OpDecorate BuiltIn. +// clang-format off +#define CASE(NAME) \ + { SpvBuiltIn##NAME, #NAME, SpvDecorationBuiltIn, "BuiltIn" } +INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateBuiltIn, OpDecorateEnumTest, + ::testing::ValuesIn(std::vector{ + CASE(Position), + CASE(PointSize), + CASE(ClipDistance), + CASE(CullDistance), + CASE(VertexId), + CASE(InstanceId), + CASE(PrimitiveId), + CASE(InvocationId), + CASE(Layer), + CASE(ViewportIndex), + CASE(TessLevelOuter), + CASE(TessLevelInner), + CASE(TessCoord), + CASE(PatchVertices), + CASE(FragCoord), + CASE(PointCoord), + CASE(FrontFacing), + CASE(SampleId), + CASE(SamplePosition), + CASE(SampleMask), + // Value 21 intentionally missing. + CASE(FragDepth), + CASE(HelperInvocation), + CASE(NumWorkgroups), + CASE(WorkgroupSize), + CASE(WorkgroupId), + CASE(LocalInvocationId), + CASE(GlobalInvocationId), + CASE(LocalInvocationIndex), + CASE(WorkDim), + CASE(GlobalSize), + CASE(EnqueuedWorkgroupSize), + CASE(GlobalOffset), + CASE(GlobalLinearId), + // Value 35 intentionally missing. + CASE(SubgroupSize), + CASE(SubgroupMaxSize), + CASE(NumSubgroups), + CASE(NumEnqueuedSubgroups), + CASE(SubgroupId), + CASE(SubgroupLocalInvocationId), + CASE(VertexIndex), + CASE(InstanceIndex), + }),); +#undef CASE +// clang-format on + +TEST_F(OpDecorateEnumTest, WrongBuiltIn) { + EXPECT_THAT(CompileFailure("OpDecorate %1 BuiltIn xxyyzz"), + Eq("Invalid built-in 'xxyyzz'.")); +} + +// Test OpDecorate FuncParamAttr +// clang-format off +#define CASE(NAME) \ + { SpvFunctionParameterAttribute##NAME, #NAME, SpvDecorationFuncParamAttr, "FuncParamAttr" } +INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFuncParamAttr, OpDecorateEnumTest, + ::testing::ValuesIn(std::vector{ + CASE(Zext), + CASE(Sext), + CASE(ByVal), + CASE(Sret), + CASE(NoAlias), + CASE(NoCapture), + CASE(NoWrite), + CASE(NoReadWrite), + }),); +#undef CASE +// clang-format on + +TEST_F(OpDecorateEnumTest, WrongFuncParamAttr) { + EXPECT_THAT(CompileFailure("OpDecorate %1 FuncParamAttr xxyyzz"), + Eq("Invalid function parameter attribute 'xxyyzz'.")); +} + +// Test OpDecorate FPRoundingMode +// clang-format off +#define CASE(NAME) \ + { SpvFPRoundingMode##NAME, #NAME, SpvDecorationFPRoundingMode, "FPRoundingMode" } +INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFPRoundingMode, OpDecorateEnumTest, + ::testing::ValuesIn(std::vector{ + CASE(RTE), + CASE(RTZ), + CASE(RTP), + CASE(RTN), + }),); +#undef CASE +// clang-format on + +TEST_F(OpDecorateEnumTest, WrongFPRoundingMode) { + EXPECT_THAT(CompileFailure("OpDecorate %1 FPRoundingMode xxyyzz"), + Eq("Invalid floating-point rounding mode 'xxyyzz'.")); +} + +// Test OpDecorate FPFastMathMode. +// These can by named enums for the single-bit masks. However, we don't support +// symbolic combinations of the masks. Rather, they can use ! +// syntax, e.g. !0x3 + +// clang-format off +#define CASE(ENUM,NAME) \ + { SpvFPFastMathMode##ENUM, #NAME, SpvDecorationFPFastMathMode, "FPFastMathMode" } +INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFPFastMathMode, OpDecorateEnumTest, + ::testing::ValuesIn(std::vector{ + CASE(MaskNone, None), + CASE(NotNaNMask, NotNaN), + CASE(NotInfMask, NotInf), + CASE(NSZMask, NSZ), + CASE(AllowRecipMask, AllowRecip), + CASE(FastMask, Fast), + }),); +#undef CASE +// clang-format on + +TEST_F(OpDecorateEnumTest, CombinedFPFastMathMask) { + // Sample a single combination. This ensures we've integrated + // the instruction parsing logic with spvTextParseMask. + const std::string input = "OpDecorate %1 FPFastMathMode NotNaN|NotInf|NSZ"; + const uint32_t expected_enum = SpvDecorationFPFastMathMode; + const uint32_t expected_mask = SpvFPFastMathModeNotNaNMask | + SpvFPFastMathModeNotInfMask | + SpvFPFastMathModeNSZMask; + EXPECT_THAT( + CompiledInstructions(input), + Eq(MakeInstruction(SpvOpDecorate, {1, expected_enum, expected_mask}))); +} + +TEST_F(OpDecorateEnumTest, WrongFPFastMathMode) { + EXPECT_THAT( + CompileFailure("OpDecorate %1 FPFastMathMode NotNaN|xxyyzz"), + Eq("Invalid floating-point fast math mode operand 'NotNaN|xxyyzz'.")); +} + +// Test OpDecorate Linkage + +// A single test case for a linkage +struct DecorateLinkageCase { + uint32_t linkage_type_value; + std::string linkage_type_name; + std::string external_name; +}; + +using OpDecorateLinkageTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>; + +TEST_P(OpDecorateLinkageTest, AnyLinkageDecoration) { + // This string should assemble, but should not validate. + const std::string input = "OpDecorate %1 LinkageAttributes \"" + + GetParam().external_name + "\" " + + GetParam().linkage_type_name; + std::vector expected_operands{1, SpvDecorationLinkageAttributes}; + std::vector encoded_external_name = + MakeVector(GetParam().external_name); + expected_operands.insert(expected_operands.end(), + encoded_external_name.begin(), + encoded_external_name.end()); + expected_operands.push_back(GetParam().linkage_type_value); + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpDecorate, expected_operands))); +} + +// clang-format off +#define CASE(ENUM) SpvLinkageType##ENUM, #ENUM +INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateLinkage, OpDecorateLinkageTest, + ::testing::ValuesIn(std::vector{ + { CASE(Import), "a" }, + { CASE(Export), "foo" }, + { CASE(Import), "some kind of long name with spaces etc." }, + // TODO(dneto): utf-8, escaping, quoting cases. + }),); +#undef CASE +// clang-format on + +TEST_F(OpDecorateLinkageTest, WrongType) { + EXPECT_THAT(CompileFailure("OpDecorate %1 LinkageAttributes \"foo\" xxyyzz"), + Eq("Invalid linkage type 'xxyyzz'.")); +} + +// Test OpGroupMemberDecorate + +TEST_F(TextToBinaryTest, GroupMemberDecorateGoodOneTarget) { + EXPECT_THAT(CompiledInstructions("OpGroupMemberDecorate %group %id0 42"), + Eq(MakeInstruction(SpvOpGroupMemberDecorate, {1, 2, 42}))); +} + +TEST_F(TextToBinaryTest, GroupMemberDecorateGoodTwoTargets) { + EXPECT_THAT( + CompiledInstructions("OpGroupMemberDecorate %group %id0 96 %id1 42"), + Eq(MakeInstruction(SpvOpGroupMemberDecorate, {1, 2, 96, 3, 42}))); +} + +TEST_F(TextToBinaryTest, GroupMemberDecorateMissingGroupId) { + EXPECT_THAT(CompileFailure("OpGroupMemberDecorate"), + Eq("Expected operand, found end of stream.")); +} + +TEST_F(TextToBinaryTest, GroupMemberDecorateInvalidGroupId) { + EXPECT_THAT(CompileFailure("OpGroupMemberDecorate 16"), + Eq("Expected id to start with %.")); +} + +TEST_F(TextToBinaryTest, GroupMemberDecorateInvalidTargetId) { + EXPECT_THAT(CompileFailure("OpGroupMemberDecorate %group 12"), + Eq("Expected id to start with %.")); +} + +TEST_F(TextToBinaryTest, GroupMemberDecorateMissingTargetMemberNumber) { + EXPECT_THAT(CompileFailure("OpGroupMemberDecorate %group %id0"), + Eq("Expected operand, found end of stream.")); +} + +TEST_F(TextToBinaryTest, GroupMemberDecorateInvalidTargetMemberNumber) { + EXPECT_THAT(CompileFailure("OpGroupMemberDecorate %group %id0 %id1"), + Eq("Invalid unsigned integer literal: %id1")); +} + +TEST_F(TextToBinaryTest, GroupMemberDecorateInvalidSecondTargetId) { + EXPECT_THAT(CompileFailure("OpGroupMemberDecorate %group %id1 42 12"), + Eq("Expected id to start with %.")); +} + +TEST_F(TextToBinaryTest, GroupMemberDecorateMissingSecondTargetMemberNumber) { + EXPECT_THAT(CompileFailure("OpGroupMemberDecorate %group %id0 42 %id1"), + Eq("Expected operand, found end of stream.")); +} + +TEST_F(TextToBinaryTest, GroupMemberDecorateInvalidSecondTargetMemberNumber) { + EXPECT_THAT(CompileFailure("OpGroupMemberDecorate %group %id0 42 %id1 %id2"), + Eq("Invalid unsigned integer literal: %id2")); +} + +// Test OpMemberDecorate + +using OpMemberDecorateSimpleTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>>>; + +TEST_P(OpMemberDecorateSimpleTest, AnySimpleDecoration) { + // This string should assemble, but should not validate. + std::stringstream input; + input << "OpMemberDecorate %1 42 " << get<1>(GetParam()).name(); + for (auto operand : get<1>(GetParam()).operands()) input << " " << operand; + input << std::endl; + EXPECT_THAT(CompiledInstructions(input.str(), get<0>(GetParam())), + Eq(MakeInstruction(SpvOpMemberDecorate, + {1, 42, uint32_t(get<1>(GetParam()).value())}, + get<1>(GetParam()).operands()))); + // Also check disassembly. + EXPECT_THAT( + EncodeAndDecodeSuccessfully(input.str(), SPV_BINARY_TO_TEXT_OPTION_NONE, + get<0>(GetParam())), + Eq(input.str())); +} + +#define CASE(NAME) SpvDecoration##NAME, #NAME +INSTANTIATE_TEST_CASE_P( + TextToBinaryDecorateSimple, OpMemberDecorateSimpleTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector>{ + // The operand literal values are arbitrarily chosen, + // but there are the right number of them. + {CASE(RelaxedPrecision), {}}, + {CASE(SpecId), {100}}, + {CASE(Block), {}}, + {CASE(BufferBlock), {}}, + {CASE(RowMajor), {}}, + {CASE(ColMajor), {}}, + {CASE(ArrayStride), {4}}, + {CASE(MatrixStride), {16}}, + {CASE(GLSLShared), {}}, + {CASE(GLSLPacked), {}}, + {CASE(CPacked), {}}, + // Placeholder line for enum value 12 + {CASE(NoPerspective), {}}, + {CASE(Flat), {}}, + {CASE(Patch), {}}, + {CASE(Centroid), {}}, + {CASE(Sample), {}}, + {CASE(Invariant), {}}, + {CASE(Restrict), {}}, + {CASE(Aliased), {}}, + {CASE(Volatile), {}}, + {CASE(Constant), {}}, + {CASE(Coherent), {}}, + {CASE(NonWritable), {}}, + {CASE(NonReadable), {}}, + {CASE(Uniform), {}}, + {CASE(SaturatedConversion), {}}, + {CASE(Stream), {2}}, + {CASE(Location), {6}}, + {CASE(Component), {3}}, + {CASE(Index), {14}}, + {CASE(Binding), {19}}, + {CASE(DescriptorSet), {7}}, + {CASE(Offset), {12}}, + {CASE(XfbBuffer), {1}}, + {CASE(XfbStride), {8}}, + {CASE(NoContraction), {}}, + {CASE(InputAttachmentIndex), {102}}, + {CASE(Alignment), {16}}, + })), ); + +INSTANTIATE_TEST_CASE_P( + TextToBinaryDecorateSimpleV11, OpMemberDecorateSimpleTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_1), + Values(EnumCase{CASE(MaxByteOffset), {128}})), ); +#undef CASE + +TEST_F(OpMemberDecorateSimpleTest, WrongDecoration) { + EXPECT_THAT(CompileFailure("OpMemberDecorate %1 9 xxyyzz"), + Eq("Invalid decoration 'xxyyzz'.")); +} + +TEST_F(OpMemberDecorateSimpleTest, ExtraOperandsOnDecorationExpectingNone) { + EXPECT_THAT(CompileFailure("OpMemberDecorate %1 12 RelaxedPrecision 99"), + Eq("Expected or at the beginning of an " + "instruction, found '99'.")); +} + +TEST_F(OpMemberDecorateSimpleTest, ExtraOperandsOnDecorationExpectingOne) { + EXPECT_THAT(CompileFailure("OpMemberDecorate %1 0 SpecId 99 100"), + Eq("Expected or at the beginning of an " + "instruction, found '100'.")); +} + +TEST_F(OpMemberDecorateSimpleTest, ExtraOperandsOnDecorationExpectingTwo) { + EXPECT_THAT(CompileFailure( + "OpMemberDecorate %1 1 LinkageAttributes \"abc\" Import 42"), + Eq("Expected or at the beginning of an " + "instruction, found '42'.")); +} + +// TODO(dneto): OpMemberDecorate cases for decorations with parameters which +// are: not just lists of literal numbers. + +// TODO(dneto): OpDecorationGroup +// TODO(dneto): OpGroupDecorate + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.barrier_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.barrier_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.barrier_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.barrier_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,161 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Assembler tests for instructions in the "Barrier Instructions" section +// of the SPIR-V spec. + +#include "unit_spirv.h" + +#include "gmock/gmock.h" +#include "test_fixture.h" + +namespace { + +using spvtest::MakeInstruction; +using spvtest::TextToBinaryTest; +using ::testing::_; +using ::testing::ElementsAre; +using ::testing::Eq; + +// Test OpMemoryBarrier + +using OpMemoryBarrier = spvtest::TextToBinaryTest; + +TEST_F(OpMemoryBarrier, Good) { + const std::string input = "OpMemoryBarrier %1 %2\n"; + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpMemoryBarrier, {1, 2}))); + EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(input)); +} + +TEST_F(OpMemoryBarrier, BadMissingScopeId) { + const std::string input = "OpMemoryBarrier\n"; + EXPECT_THAT(CompileFailure(input), + Eq("Expected operand, found end of stream.")); +} + +TEST_F(OpMemoryBarrier, BadInvalidScopeId) { + const std::string input = "OpMemoryBarrier 99\n"; + EXPECT_THAT(CompileFailure(input), Eq("Expected id to start with %.")); +} + +TEST_F(OpMemoryBarrier, BadMissingMemorySemanticsId) { + const std::string input = "OpMemoryBarrier %scope\n"; + EXPECT_THAT(CompileFailure(input), + Eq("Expected operand, found end of stream.")); +} + +TEST_F(OpMemoryBarrier, BadInvalidMemorySemanticsId) { + const std::string input = "OpMemoryBarrier %scope 14\n"; + EXPECT_THAT(CompileFailure(input), Eq("Expected id to start with %.")); +} + +// TODO(dneto): OpControlBarrier +// TODO(dneto): OpGroupAsyncCopy +// TODO(dneto): OpGroupWaitEvents +// TODO(dneto): OpGroupAll +// TODO(dneto): OpGroupAny +// TODO(dneto): OpGroupBroadcast +// TODO(dneto): OpGroupIAdd +// TODO(dneto): OpGroupFAdd +// TODO(dneto): OpGroupFMin +// TODO(dneto): OpGroupUMin +// TODO(dneto): OpGroupSMin +// TODO(dneto): OpGroupFMax +// TODO(dneto): OpGroupUMax +// TODO(dneto): OpGroupSMax + +using NamedMemoryBarrierTest = spvtest::TextToBinaryTest; + +TEST_F(NamedMemoryBarrierTest, OpcodeUnrecognizedInV10) { + EXPECT_THAT(CompileFailure("OpMemoryNamedBarrier %bar %scope %semantics", + SPV_ENV_UNIVERSAL_1_0), + Eq("Invalid Opcode name 'OpMemoryNamedBarrier'")); +} + +TEST_F(NamedMemoryBarrierTest, ArgumentCount) { + EXPECT_THAT(CompileFailure("OpMemoryNamedBarrier", SPV_ENV_UNIVERSAL_1_1), + Eq("Expected operand, found end of stream.")); + EXPECT_THAT( + CompileFailure("OpMemoryNamedBarrier %bar", SPV_ENV_UNIVERSAL_1_1), + Eq("Expected operand, found end of stream.")); + EXPECT_THAT( + CompileFailure("OpMemoryNamedBarrier %bar %scope", SPV_ENV_UNIVERSAL_1_1), + Eq("Expected operand, found end of stream.")); + EXPECT_THAT( + CompiledInstructions("OpMemoryNamedBarrier %bar %scope %semantics", + SPV_ENV_UNIVERSAL_1_1), + ElementsAre(spvOpcodeMake(4, SpvOpMemoryNamedBarrier), _, _, _)); + EXPECT_THAT( + CompileFailure("OpMemoryNamedBarrier %bar %scope %semantics %extra", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected '=', found end of stream.")); +} + +TEST_F(NamedMemoryBarrierTest, ArgumentTypes) { + EXPECT_THAT(CompileFailure("OpMemoryNamedBarrier 123 %scope %semantics", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected id to start with %.")); + EXPECT_THAT(CompileFailure("OpMemoryNamedBarrier %bar %scope \"semantics\"", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected id to start with %.")); +} + +using TypeNamedBarrierTest = spvtest::TextToBinaryTest; + +TEST_F(TypeNamedBarrierTest, OpcodeUnrecognizedInV10) { + EXPECT_THAT(CompileFailure("%t = OpTypeNamedBarrier", SPV_ENV_UNIVERSAL_1_0), + Eq("Invalid Opcode name 'OpTypeNamedBarrier'")); +} + +TEST_F(TypeNamedBarrierTest, ArgumentCount) { + EXPECT_THAT(CompileFailure("OpTypeNamedBarrier", SPV_ENV_UNIVERSAL_1_1), + Eq("Expected at the beginning of an instruction, " + "found 'OpTypeNamedBarrier'.")); + EXPECT_THAT( + CompiledInstructions("%t = OpTypeNamedBarrier", SPV_ENV_UNIVERSAL_1_1), + ElementsAre(spvOpcodeMake(2, SpvOpTypeNamedBarrier), _)); + EXPECT_THAT( + CompileFailure("%t = OpTypeNamedBarrier 1 2 3", SPV_ENV_UNIVERSAL_1_1), + Eq("Expected or at the beginning of an instruction, " + "found '1'.")); +} + +using NamedBarrierInitializeTest = spvtest::TextToBinaryTest; + +TEST_F(NamedBarrierInitializeTest, OpcodeUnrecognizedInV10) { + EXPECT_THAT(CompileFailure("%bar = OpNamedBarrierInitialize %type %count", + SPV_ENV_UNIVERSAL_1_0), + Eq("Invalid Opcode name 'OpNamedBarrierInitialize'")); +} + +TEST_F(NamedBarrierInitializeTest, ArgumentCount) { + EXPECT_THAT( + CompileFailure("%bar = OpNamedBarrierInitialize", SPV_ENV_UNIVERSAL_1_1), + Eq("Expected operand, found end of stream.")); + EXPECT_THAT(CompileFailure("%bar = OpNamedBarrierInitialize %ype", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected operand, found end of stream.")); + EXPECT_THAT( + CompiledInstructions("%bar = OpNamedBarrierInitialize %type %count", + SPV_ENV_UNIVERSAL_1_1), + ElementsAre(spvOpcodeMake(4, SpvOpNamedBarrierInitialize), _, _, _)); + EXPECT_THAT( + CompileFailure("%bar = OpNamedBarrierInitialize %type %count \"extra\"", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected or at the beginning of an instruction, " + "found '\"extra\"'.")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.constant_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.constant_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.constant_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.constant_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,827 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Assembler tests for instructions in the "Group Instrucions" section of the +// SPIR-V spec. + +#include "unit_spirv.h" + +#include +#include + +#include "gmock/gmock.h" +#include "test_fixture.h" + +namespace { + +using spvtest::Concatenate; +using spvtest::EnumCase; +using spvtest::MakeInstruction; +using ::testing::Eq; + +// Test Sampler Addressing Mode enum values + +using SamplerAddressingModeTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>>; + +TEST_P(SamplerAddressingModeTest, AnySamplerAddressingMode) { + const std::string input = + "%result = OpConstantSampler %type " + GetParam().name() + " 0 Nearest"; + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpConstantSampler, + {1, 2, GetParam().value(), 0, 0}))); +} + +// clang-format off +#define CASE(NAME) { SpvSamplerAddressingMode##NAME, #NAME } +INSTANTIATE_TEST_CASE_P( + TextToBinarySamplerAddressingMode, SamplerAddressingModeTest, + ::testing::ValuesIn(std::vector>{ + CASE(None), + CASE(ClampToEdge), + CASE(Clamp), + CASE(Repeat), + CASE(RepeatMirrored), + }),); +#undef CASE +// clang-format on + +TEST_F(SamplerAddressingModeTest, WrongMode) { + EXPECT_THAT(CompileFailure("%r = OpConstantSampler %t xxyyzz 0 Nearest"), + Eq("Invalid sampler addressing mode 'xxyyzz'.")); +} + +// Test Sampler Filter Mode enum values + +using SamplerFilterModeTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>>; + +TEST_P(SamplerFilterModeTest, AnySamplerFilterMode) { + const std::string input = + "%result = OpConstantSampler %type Clamp 0 " + GetParam().name(); + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpConstantSampler, + {1, 2, 2, 0, GetParam().value()}))); +} + +// clang-format off +#define CASE(NAME) { SpvSamplerFilterMode##NAME, #NAME} +INSTANTIATE_TEST_CASE_P( + TextToBinarySamplerFilterMode, SamplerFilterModeTest, + ::testing::ValuesIn(std::vector>{ + CASE(Nearest), + CASE(Linear), + }),); +#undef CASE +// clang-format on + +TEST_F(SamplerFilterModeTest, WrongMode) { + EXPECT_THAT(CompileFailure("%r = OpConstantSampler %t Clamp 0 xxyyzz"), + Eq("Invalid sampler filter mode 'xxyyzz'.")); +} + +struct ConstantTestCase { + std::string constant_type; + std::string constant_value; + std::vector expected_instructions; +}; + +using OpConstantValidTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(OpConstantValidTest, ValidTypes) { + const std::string input = "%1 = " + GetParam().constant_type + + "\n" + "%2 = OpConstant %1 " + + GetParam().constant_value + "\n"; + std::vector instructions; + EXPECT_THAT(CompiledInstructions(input), Eq(GetParam().expected_instructions)) + << " type: " << GetParam().constant_type + << " literal: " << GetParam().constant_value; +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + TextToBinaryOpConstantValid, OpConstantValidTest, + ::testing::ValuesIn(std::vector{ + // Check 16 bits + {"OpTypeInt 16 0", "0x1234", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 0x1234})})}, + {"OpTypeInt 16 0", "0x8000", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 0x8000})})}, + {"OpTypeInt 16 0", "0", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 0})})}, + {"OpTypeInt 16 0", "65535", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 65535})})}, + {"OpTypeInt 16 0", "0xffff", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 65535})})}, + {"OpTypeInt 16 1", "0x8000", // Test sign extension. + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0xffff8000})})}, + {"OpTypeInt 16 1", "-32", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), + MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-32)})})}, + {"OpTypeInt 16 1", "0", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0})})}, + {"OpTypeInt 16 1", "-0", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0})})}, + {"OpTypeInt 16 1", "-0x0", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0})})}, + {"OpTypeInt 16 1", "-32768", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), + MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-32768)})})}, + // Check 32 bits + {"OpTypeInt 32 0", "42", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 42})})}, + {"OpTypeInt 32 1", "-32", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), + MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-32)})})}, + {"OpTypeInt 32 1", "0", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0})})}, + {"OpTypeInt 32 1", "-0", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0})})}, + {"OpTypeInt 32 1", "-0x0", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0})})}, + {"OpTypeInt 32 1", "-0x001", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), + MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-1)})})}, + {"OpTypeInt 32 1", "2147483647", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0x7fffffffu})})}, + {"OpTypeInt 32 1", "-2147483648", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0x80000000u})})}, + {"OpTypeFloat 32", "1.0", + Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), + MakeInstruction(SpvOpConstant, {1, 2, 0x3f800000})})}, + {"OpTypeFloat 32", "10.0", + Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), + MakeInstruction(SpvOpConstant, {1, 2, 0x41200000})})}, + {"OpTypeFloat 32", "-0x1p+128", // -infinity + Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), + MakeInstruction(SpvOpConstant, {1, 2, 0xFF800000})})}, + {"OpTypeFloat 32", "0x1p+128", // +infinity + Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), + MakeInstruction(SpvOpConstant, {1, 2, 0x7F800000})})}, + {"OpTypeFloat 32", "-0x1.8p+128", // A -NaN + Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), + MakeInstruction(SpvOpConstant, {1, 2, 0xFFC00000})})}, + {"OpTypeFloat 32", "-0x1.0002p+128", // A +NaN + Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), + MakeInstruction(SpvOpConstant, {1, 2, 0xFF800100})})}, + // Check 48 bits + {"OpTypeInt 48 0", "0x1234", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 0x1234, 0})})}, + {"OpTypeInt 48 0", "0x800000000001", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 1, 0x00008000})})}, + {"OpTypeInt 48 1", "0x800000000000", // Test sign extension. + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0, 0xffff8000})})}, + {"OpTypeInt 48 1", "-32", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 1}), + MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-32), uint32_t(-1)})})}, + // Check 64 bits + {"OpTypeInt 64 0", "0x1234", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 0x1234, 0})})}, + {"OpTypeInt 64 0", "18446744073709551615", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 0xffffffffu, 0xffffffffu})})}, + {"OpTypeInt 64 0", "0xffffffffffffffff", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 0xffffffffu, 0xffffffffu})})}, + {"OpTypeInt 64 1", "0x1234", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0x1234, 0})})}, + {"OpTypeInt 64 1", "-42", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), + MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-42), uint32_t(-1)})})}, + {"OpTypeInt 64 1", "-0x01", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0xffffffffu, 0xffffffffu})})}, + {"OpTypeInt 64 1", "9223372036854775807", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0xffffffffu, 0x7fffffffu})})}, + {"OpTypeInt 64 1", "0x7fffffff", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0x7fffffffu, 0})})}, + }),); +// clang-format on + +// A test case for checking OpConstant with invalid literals with a leading +// minus. +struct InvalidLeadingMinusCase { + std::string type; + std::string literal; +}; + +using OpConstantInvalidLeadingMinusTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>; + +TEST_P(OpConstantInvalidLeadingMinusTest, InvalidCase) { + const std::string input = "%1 = " + GetParam().type + + "\n" + "%2 = OpConstant %1 " + + GetParam().literal; + EXPECT_THAT(CompileFailure(input), + Eq("Cannot put a negative number in an unsigned literal")); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + TextToBinaryOpConstantInvalidLeadingMinus, OpConstantInvalidLeadingMinusTest, + ::testing::ValuesIn(std::vector{ + {"OpTypeInt 16 0", "-0"}, + {"OpTypeInt 16 0", "-0x0"}, + {"OpTypeInt 16 0", "-1"}, + {"OpTypeInt 32 0", "-0"}, + {"OpTypeInt 32 0", "-0x0"}, + {"OpTypeInt 32 0", "-1"}, + {"OpTypeInt 64 0", "-0"}, + {"OpTypeInt 64 0", "-0x0"}, + {"OpTypeInt 64 0", "-1"}, + }),); +// clang-format on + +// A test case for invalid floating point literals. +struct InvalidFloatConstantCase { + uint32_t width; + std::string literal; +}; + +using OpConstantInvalidFloatConstant = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>; + +TEST_P(OpConstantInvalidFloatConstant, Samples) { + // Check both kinds of instructions that take literal floats. + for (const auto& instruction : {"OpConstant", "OpSpecConstant"}) { + std::stringstream input; + input << "%1 = OpTypeFloat " << GetParam().width << "\n" + << "%2 = " << instruction << " %1 " << GetParam().literal; + std::stringstream expected_error; + expected_error << "Invalid " << GetParam().width + << "-bit float literal: " << GetParam().literal; + EXPECT_THAT(CompileFailure(input.str()), Eq(expected_error.str())); + } +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + TextToBinaryInvalidFloatConstant, OpConstantInvalidFloatConstant, + ::testing::ValuesIn(std::vector{ + {16, "abc"}, + {16, "--1"}, + {16, "-+1"}, + {16, "+-1"}, + {16, "++1"}, + {16, "1e30"}, // Overflow is an error for 16-bit floats. + {16, "-1e30"}, + {16, "1e40"}, + {16, "-1e40"}, + {16, "1e400"}, + {16, "-1e400"}, + {32, "abc"}, + {32, "--1"}, + {32, "-+1"}, + {32, "+-1"}, + {32, "++1"}, + {32, "1e40"}, // Overflow is an error for 32-bit floats. + {32, "-1e40"}, + {32, "1e400"}, + {32, "-1e400"}, + {64, "abc"}, + {64, "--1"}, + {64, "-+1"}, + {64, "+-1"}, + {64, "++1"}, + {32, "1e400"}, // Overflow is an error for 64-bit floats. + {32, "-1e400"}, + }),); +// clang-format on + +using OpConstantInvalidTypeTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(OpConstantInvalidTypeTest, InvalidTypes) { + const std::string input = "%1 = " + GetParam() + + "\n" + "%2 = OpConstant %1 0\n"; + EXPECT_THAT( + CompileFailure(input), + Eq("Type for Constant must be a scalar floating point or integer type")); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + TextToBinaryOpConstantInvalidValidType, OpConstantInvalidTypeTest, + ::testing::ValuesIn(std::vector{ + {"OpTypeVoid", + "OpTypeBool", + "OpTypeVector %a 32", + "OpTypeMatrix %a 32", + "OpTypeImage %a 1D 0 0 0 0 Unknown", + "OpTypeSampler", + "OpTypeSampledImage %a", + "OpTypeArray %a %b", + "OpTypeRuntimeArray %a", + "OpTypeStruct %a", + "OpTypeOpaque \"Foo\"", + "OpTypePointer UniformConstant %a", + "OpTypeFunction %a %b", + "OpTypeEvent", + "OpTypeDeviceEvent", + "OpTypeReserveId", + "OpTypeQueue", + "OpTypePipe ReadOnly", + "OpTypeForwardPointer %a UniformConstant", + // At least one thing that isn't a type at all + "OpNot %a %b" + }, + }),); +// clang-format on + +using OpSpecConstantValidTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(OpSpecConstantValidTest, ValidTypes) { + const std::string input = "%1 = " + GetParam().constant_type + + "\n" + "%2 = OpSpecConstant %1 " + + GetParam().constant_value + "\n"; + std::vector instructions; + EXPECT_THAT(CompiledInstructions(input), + Eq(GetParam().expected_instructions)); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + TextToBinaryOpSpecConstantValid, OpSpecConstantValidTest, + ::testing::ValuesIn(std::vector{ + // Check 16 bits + {"OpTypeInt 16 0", "0x1234", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 0x1234})})}, + {"OpTypeInt 16 0", "0x8000", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 0x8000})})}, + {"OpTypeInt 16 1", "0x8000", // Test sign extension. + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 0xffff8000})})}, + {"OpTypeInt 16 1", "-32", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), + MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-32)})})}, + // Check 32 bits + {"OpTypeInt 32 0", "42", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 0}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 42})})}, + {"OpTypeInt 32 1", "-32", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), + MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-32)})})}, + {"OpTypeFloat 32", "1.0", + Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 0x3f800000})})}, + {"OpTypeFloat 32", "10.0", + Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 0x41200000})})}, + // Check 48 bits + {"OpTypeInt 48 0", "0x1234", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 0}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 0x1234, 0})})}, + {"OpTypeInt 48 0", "0x800000000001", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 0}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 1, 0x00008000})})}, + {"OpTypeInt 48 1", "0x800000000000", // Test sign extension. + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 1}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 0, 0xffff8000})})}, + {"OpTypeInt 48 1", "-32", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 1}), + MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-32), uint32_t(-1)})})}, + // Check 64 bits + {"OpTypeInt 64 0", "0x1234", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 0}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 0x1234, 0})})}, + {"OpTypeInt 64 1", "0x1234", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 0x1234, 0})})}, + {"OpTypeInt 64 1", "-42", + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), + MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-42), uint32_t(-1)})})}, + }),); +// clang-format on + +using OpSpecConstantInvalidTypeTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(OpSpecConstantInvalidTypeTest, InvalidTypes) { + const std::string input = "%1 = " + GetParam() + + "\n" + "%2 = OpSpecConstant %1 0\n"; + EXPECT_THAT(CompileFailure(input), + Eq("Type for SpecConstant must be a scalar floating point or " + "integer type")); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + TextToBinaryOpSpecConstantInvalidValidType, OpSpecConstantInvalidTypeTest, + ::testing::ValuesIn(std::vector{ + {"OpTypeVoid", + "OpTypeBool", + "OpTypeVector %a 32", + "OpTypeMatrix %a 32", + "OpTypeImage %a 1D 0 0 0 0 Unknown", + "OpTypeSampler", + "OpTypeSampledImage %a", + "OpTypeArray %a %b", + "OpTypeRuntimeArray %a", + "OpTypeStruct %a", + "OpTypeOpaque \"Foo\"", + "OpTypePointer UniformConstant %a", + "OpTypeFunction %a %b", + "OpTypeEvent", + "OpTypeDeviceEvent", + "OpTypeReserveId", + "OpTypeQueue", + "OpTypePipe ReadOnly", + "OpTypeForwardPointer %a UniformConstant", + // At least one thing that isn't a type at all + "OpNot %a %b" + }, + }),); +// clang-format on + +const int64_t kMaxUnsigned48Bit = (int64_t(1) << 48) - 1; +const int64_t kMaxSigned48Bit = (int64_t(1) << 47) - 1; +const int64_t kMinSigned48Bit = -kMaxSigned48Bit - 1; + +INSTANTIATE_TEST_CASE_P( + OpConstantRoundTrip, RoundTripTest, + ::testing::ValuesIn(std::vector{ + // 16 bit + "%1 = OpTypeInt 16 0\n%2 = OpConstant %1 0\n", + "%1 = OpTypeInt 16 0\n%2 = OpConstant %1 65535\n", + "%1 = OpTypeInt 16 1\n%2 = OpConstant %1 -32768\n", + "%1 = OpTypeInt 16 1\n%2 = OpConstant %1 32767\n", + "%1 = OpTypeInt 32 0\n%2 = OpConstant %1 0\n", + // 32 bit + std::string("%1 = OpTypeInt 32 0\n%2 = OpConstant %1 0\n"), + std::string("%1 = OpTypeInt 32 0\n%2 = OpConstant %1 ") + + std::to_string(std::numeric_limits::max()) + "\n", + std::string("%1 = OpTypeInt 32 1\n%2 = OpConstant %1 ") + + std::to_string(std::numeric_limits::max()) + "\n", + std::string("%1 = OpTypeInt 32 1\n%2 = OpConstant %1 ") + + std::to_string(std::numeric_limits::min()) + "\n", + // 48 bit + std::string("%1 = OpTypeInt 48 0\n%2 = OpConstant %1 0\n"), + std::string("%1 = OpTypeInt 48 0\n%2 = OpConstant %1 ") + + std::to_string(kMaxUnsigned48Bit) + "\n", + std::string("%1 = OpTypeInt 48 1\n%2 = OpConstant %1 ") + + std::to_string(kMaxSigned48Bit) + "\n", + std::string("%1 = OpTypeInt 48 1\n%2 = OpConstant %1 ") + + std::to_string(kMinSigned48Bit) + "\n", + // 64 bit + std::string("%1 = OpTypeInt 64 0\n%2 = OpConstant %1 0\n"), + std::string("%1 = OpTypeInt 64 0\n%2 = OpConstant %1 ") + + std::to_string(std::numeric_limits::max()) + "\n", + std::string("%1 = OpTypeInt 64 1\n%2 = OpConstant %1 ") + + std::to_string(std::numeric_limits::max()) + "\n", + std::string("%1 = OpTypeInt 64 1\n%2 = OpConstant %1 ") + + std::to_string(std::numeric_limits::min()) + "\n", + // 32-bit float + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 0\n", + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 13.5\n", + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -12.5\n", + // 64-bit float + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0\n", + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 1.79767e+308\n", + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -1.79767e+308\n", + }), ); + +INSTANTIATE_TEST_CASE_P( + OpConstantHalfRoundTrip, RoundTripTest, + ::testing::ValuesIn(std::vector{ + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x0p+0\n", + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x0p+0\n", + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1p+0\n", + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.1p+0\n", + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.01p-1\n", + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.8p+1\n", + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.ffcp+1\n", + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1p+0\n", + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.1p+0\n", + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.01p-1\n", + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.8p+1\n", + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.ffcp+1\n", + + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1p-16\n", // some denorms + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1p-24\n", + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1p-24\n", + + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1p+16\n", // +inf + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1p+16\n", // -inf + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.01p+16\n", // -inf + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.01p+16\n", // nan + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.11p+16\n", // nan + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.ffp+16\n", // nan + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.ffcp+16\n", // nan + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.004p+16\n", // nan + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.01p+16\n", // -nan + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.11p+16\n", // -nan + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.ffp+16\n", // -nan + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.ffcp+16\n", // -nan + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.004p+16\n", // -nan + }), ); + +// clang-format off +// (Clang-format really wants to break up these strings across lines. +INSTANTIATE_TEST_CASE_P( + OpConstantRoundTripNonFinite, RoundTripTest, + ::testing::ValuesIn(std::vector{ + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1p+128\n", // -inf + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1p+128\n", // inf + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1.8p+128\n", // -nan + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1.0002p+128\n", // -nan + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1.0018p+128\n", // -nan + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1.01ep+128\n", // -nan + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1.fffffep+128\n", // -nan + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1.8p+128\n", // +nan + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1.0002p+128\n", // +nan + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1.0018p+128\n", // +nan + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1.01ep+128\n", // +nan + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1.fffffep+128\n", // +nan + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1p+1024\n", //-inf + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1p+1024\n", //+inf + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.8p+1024\n", // -nan + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.0fp+1024\n", // -nan + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.0000000000001p+1024\n", // -nan + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.00003p+1024\n", // -nan + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.fffffffffffffp+1024\n", // -nan + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.8p+1024\n", // +nan + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.0fp+1024\n", // +nan + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.0000000000001p+1024\n", // -nan + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.00003p+1024\n", // -nan + "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.fffffffffffffp+1024\n", // -nan + }),); +// clang-format on + +INSTANTIATE_TEST_CASE_P( + OpSpecConstantRoundTrip, RoundTripTest, + ::testing::ValuesIn(std::vector{ + // 16 bit + "%1 = OpTypeInt 16 0\n%2 = OpSpecConstant %1 0\n", + "%1 = OpTypeInt 16 0\n%2 = OpSpecConstant %1 65535\n", + "%1 = OpTypeInt 16 1\n%2 = OpSpecConstant %1 -32768\n", + "%1 = OpTypeInt 16 1\n%2 = OpSpecConstant %1 32767\n", + "%1 = OpTypeInt 32 0\n%2 = OpSpecConstant %1 0\n", + // 32 bit + std::string("%1 = OpTypeInt 32 0\n%2 = OpSpecConstant %1 0\n"), + std::string("%1 = OpTypeInt 32 0\n%2 = OpSpecConstant %1 ") + + std::to_string(std::numeric_limits::max()) + "\n", + std::string("%1 = OpTypeInt 32 1\n%2 = OpSpecConstant %1 ") + + std::to_string(std::numeric_limits::max()) + "\n", + std::string("%1 = OpTypeInt 32 1\n%2 = OpSpecConstant %1 ") + + std::to_string(std::numeric_limits::min()) + "\n", + // 48 bit + std::string("%1 = OpTypeInt 48 0\n%2 = OpSpecConstant %1 0\n"), + std::string("%1 = OpTypeInt 48 0\n%2 = OpSpecConstant %1 ") + + std::to_string(kMaxUnsigned48Bit) + "\n", + std::string("%1 = OpTypeInt 48 1\n%2 = OpSpecConstant %1 ") + + std::to_string(kMaxSigned48Bit) + "\n", + std::string("%1 = OpTypeInt 48 1\n%2 = OpSpecConstant %1 ") + + std::to_string(kMinSigned48Bit) + "\n", + // 64 bit + std::string("%1 = OpTypeInt 64 0\n%2 = OpSpecConstant %1 0\n"), + std::string("%1 = OpTypeInt 64 0\n%2 = OpSpecConstant %1 ") + + std::to_string(std::numeric_limits::max()) + "\n", + std::string("%1 = OpTypeInt 64 1\n%2 = OpSpecConstant %1 ") + + std::to_string(std::numeric_limits::max()) + "\n", + std::string("%1 = OpTypeInt 64 1\n%2 = OpSpecConstant %1 ") + + std::to_string(std::numeric_limits::min()) + "\n", + // 32-bit float + "%1 = OpTypeFloat 32\n%2 = OpSpecConstant %1 0\n", + "%1 = OpTypeFloat 32\n%2 = OpSpecConstant %1 13.5\n", + "%1 = OpTypeFloat 32\n%2 = OpSpecConstant %1 -12.5\n", + // 64-bit float + "%1 = OpTypeFloat 64\n%2 = OpSpecConstant %1 0\n", + "%1 = OpTypeFloat 64\n%2 = OpSpecConstant %1 1.79767e+308\n", + "%1 = OpTypeFloat 64\n%2 = OpSpecConstant %1 -1.79767e+308\n", + }), ); + +// Test OpSpecConstantOp + +using OpSpecConstantOpTestWithIds = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>>; + +// The operands to the OpSpecConstantOp opcode are all Ids. +TEST_P(OpSpecConstantOpTestWithIds, Assembly) { + std::stringstream input; + input << "%2 = OpSpecConstantOp %1 " << GetParam().name(); + for (auto id : GetParam().operands()) input << " %" << id; + input << "\n"; + + EXPECT_THAT(CompiledInstructions(input.str()), + Eq(MakeInstruction(SpvOpSpecConstantOp, + {1, 2, uint32_t(GetParam().value())}, + GetParam().operands()))); + + // Check the disassembler as well. + EXPECT_THAT(EncodeAndDecodeSuccessfully(input.str()), input.str()); +} + +// clang-format off +#define CASE1(NAME) { SpvOp##NAME, #NAME, {3} } +#define CASE2(NAME) { SpvOp##NAME, #NAME, {3, 4} } +#define CASE3(NAME) { SpvOp##NAME, #NAME, {3, 4, 5} } +#define CASE4(NAME) { SpvOp##NAME, #NAME, {3, 4, 5, 6} } +#define CASE5(NAME) { SpvOp##NAME, #NAME, {3, 4, 5, 6, 7} } +#define CASE6(NAME) { SpvOp##NAME, #NAME, {3, 4, 5, 6, 7, 8} } +INSTANTIATE_TEST_CASE_P( + TextToBinaryOpSpecConstantOp, OpSpecConstantOpTestWithIds, + ::testing::ValuesIn(std::vector>{ + // Conversion + CASE1(SConvert), + CASE1(FConvert), + CASE1(ConvertFToS), + CASE1(ConvertSToF), + CASE1(ConvertFToU), + CASE1(ConvertUToF), + CASE1(UConvert), + CASE1(ConvertPtrToU), + CASE1(ConvertUToPtr), + CASE1(GenericCastToPtr), + CASE1(PtrCastToGeneric), + CASE1(Bitcast), + CASE1(QuantizeToF16), + // Arithmetic + CASE1(SNegate), + CASE1(Not), + CASE2(IAdd), + CASE2(ISub), + CASE2(IMul), + CASE2(UDiv), + CASE2(SDiv), + CASE2(UMod), + CASE2(SRem), + CASE2(SMod), + CASE2(ShiftRightLogical), + CASE2(ShiftRightArithmetic), + CASE2(ShiftLeftLogical), + CASE2(BitwiseOr), + CASE2(BitwiseAnd), + CASE2(BitwiseXor), + CASE1(FNegate), + CASE2(FAdd), + CASE2(FSub), + CASE2(FMul), + CASE2(FDiv), + CASE2(FRem), + CASE2(FMod), + // Composite operations use literal numbers. So they're in another test. + // Logical + CASE2(LogicalOr), + CASE2(LogicalAnd), + CASE1(LogicalNot), + CASE2(LogicalEqual), + CASE2(LogicalNotEqual), + CASE3(Select), + // Comparison + CASE2(IEqual), + CASE2(INotEqual), // Allowed in 1.0 Rev 7 + CASE2(ULessThan), + CASE2(SLessThan), + CASE2(UGreaterThan), + CASE2(SGreaterThan), + CASE2(ULessThanEqual), + CASE2(SLessThanEqual), + CASE2(UGreaterThanEqual), + CASE2(SGreaterThanEqual), + // Memory + // For AccessChain, there is a base Id, then a sequence of index Ids. + // Having no index Ids is a corner case. + CASE1(AccessChain), + CASE2(AccessChain), + CASE6(AccessChain), + CASE1(InBoundsAccessChain), + CASE2(InBoundsAccessChain), + CASE6(InBoundsAccessChain), + // PtrAccessChain also has an element Id. + CASE2(PtrAccessChain), + CASE3(PtrAccessChain), + CASE6(PtrAccessChain), + CASE2(InBoundsPtrAccessChain), + CASE3(InBoundsPtrAccessChain), + CASE6(InBoundsPtrAccessChain), + }),); +#undef CASE1 +#undef CASE2 +#undef CASE3 +#undef CASE4 +#undef CASE5 +#undef CASE6 +// clang-format on + +using OpSpecConstantOpTestWithTwoIdsThenLiteralNumbers = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>>; + +// The operands to the OpSpecConstantOp opcode are two Ids followed by a +// sequence of literal numbers. +TEST_P(OpSpecConstantOpTestWithTwoIdsThenLiteralNumbers, Assembly) { + std::stringstream input; + input << "%2 = OpSpecConstantOp %1 " << GetParam().name() << " %3 %4"; + for (auto number : GetParam().operands()) input << " " << number; + input << "\n"; + + EXPECT_THAT(CompiledInstructions(input.str()), + Eq(MakeInstruction(SpvOpSpecConstantOp, + {1, 2, uint32_t(GetParam().value()), 3, 4}, + GetParam().operands()))); + + // Check the disassembler as well. + EXPECT_THAT(EncodeAndDecodeSuccessfully(input.str()), input.str()); +} + +#define CASE(NAME) SpvOp##NAME, #NAME +INSTANTIATE_TEST_CASE_P( + TextToBinaryOpSpecConstantOp, + OpSpecConstantOpTestWithTwoIdsThenLiteralNumbers, + ::testing::ValuesIn(std::vector>{ + // For VectorShuffle, there are two vector operands, and at least + // two selector Ids. OpenCL can have up to 16-element vectors. + {CASE(VectorShuffle), {0, 0}}, + {CASE(VectorShuffle), {4, 3, 2, 1}}, + {CASE(VectorShuffle), {0, 2, 4, 6, 1, 3, 5, 7}}, + {CASE(VectorShuffle), + {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}}, + // For CompositeInsert, there is an object to insert, the target + // composite, and then literal indices. + {CASE(CompositeInsert), {0}}, + {CASE(CompositeInsert), {4, 3, 99, 1}}, + }), ); + +using OpSpecConstantOpTestWithOneIdThenLiteralNumbers = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>>; + +// The operands to the OpSpecConstantOp opcode are one Id followed by a +// sequence of literal numbers. +TEST_P(OpSpecConstantOpTestWithOneIdThenLiteralNumbers, Assembly) { + std::stringstream input; + input << "%2 = OpSpecConstantOp %1 " << GetParam().name() << " %3"; + for (auto number : GetParam().operands()) input << " " << number; + input << "\n"; + + EXPECT_THAT(CompiledInstructions(input.str()), + Eq(MakeInstruction(SpvOpSpecConstantOp, + {1, 2, uint32_t(GetParam().value()), 3}, + GetParam().operands()))); + + // Check the disassembler as well. + EXPECT_THAT(EncodeAndDecodeSuccessfully(input.str()), input.str()); +} + +#define CASE(NAME) SpvOp##NAME, #NAME +INSTANTIATE_TEST_CASE_P( + TextToBinaryOpSpecConstantOp, + OpSpecConstantOpTestWithOneIdThenLiteralNumbers, + ::testing::ValuesIn(std::vector>{ + // For CompositeExtract, the universal limit permits up to 255 literal + // indices. Let's only test a few. + {CASE(CompositeExtract), {0}}, + {CASE(CompositeExtract), {0, 99, 42, 16, 17, 12, 19}}, + }), ); + +// TODO(dneto): OpConstantTrue +// TODO(dneto): OpConstantFalse +// TODO(dneto): OpConstantComposite +// TODO(dneto): OpConstantSampler: other variations Param is 0 or 1 +// TODO(dneto): OpConstantNull +// TODO(dneto): OpSpecConstantTrue +// TODO(dneto): OpSpecConstantFalse +// TODO(dneto): OpSpecConstantComposite +// TODO(dneto): Negative tests for OpSpecConstantOp + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.control_flow_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.control_flow_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.control_flow_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.control_flow_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,395 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Assembler tests for instructions in the "Control Flow" section of the +// SPIR-V spec. + +#include +#include +#include + +#include "unit_spirv.h" + +#include "gmock/gmock.h" +#include "test_fixture.h" + +namespace { + +using spvtest::Concatenate; +using spvtest::EnumCase; +using spvtest::MakeInstruction; +using spvtest::TextToBinaryTest; +using std::get; +using std::ostringstream; +using std::tuple; +using ::testing::Combine; +using ::testing::Eq; +using ::testing::TestWithParam; +using ::testing::Values; +using ::testing::ValuesIn; + +// Test OpSelectionMerge + +using OpSelectionMergeTest = spvtest::TextToBinaryTestBase< + TestWithParam>>; + +TEST_P(OpSelectionMergeTest, AnySingleSelectionControlMask) { + const std::string input = "OpSelectionMerge %1 " + GetParam().name(); + EXPECT_THAT( + CompiledInstructions(input), + Eq(MakeInstruction(SpvOpSelectionMerge, {1, GetParam().value()}))); +} + +// clang-format off +#define CASE(VALUE,NAME) { SpvSelectionControl##VALUE, NAME} +INSTANTIATE_TEST_CASE_P(TextToBinarySelectionMerge, OpSelectionMergeTest, + ValuesIn(std::vector>{ + CASE(MaskNone, "None"), + CASE(FlattenMask, "Flatten"), + CASE(DontFlattenMask, "DontFlatten"), + }),); +#undef CASE +// clang-format on + +TEST_F(OpSelectionMergeTest, CombinedSelectionControlMask) { + const std::string input = "OpSelectionMerge %1 Flatten|DontFlatten"; + const uint32_t expected_mask = + SpvSelectionControlFlattenMask | SpvSelectionControlDontFlattenMask; + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpSelectionMerge, {1, expected_mask}))); +} + +TEST_F(OpSelectionMergeTest, WrongSelectionControl) { + // Case sensitive: "flatten" != "Flatten" and thus wrong. + EXPECT_THAT(CompileFailure("OpSelectionMerge %1 flatten|DontFlatten"), + Eq("Invalid selection control operand 'flatten|DontFlatten'.")); +} + +// Test OpLoopMerge + +using OpLoopMergeTest = spvtest::TextToBinaryTestBase< + TestWithParam>>>; + +TEST_P(OpLoopMergeTest, AnySingleLoopControlMask) { + const auto ctrl = get<1>(GetParam()); + ostringstream input; + input << "OpLoopMerge %merge %continue " << ctrl.name(); + for (auto num : ctrl.operands()) input << " " << num; + EXPECT_THAT(CompiledInstructions(input.str(), get<0>(GetParam())), + Eq(MakeInstruction(SpvOpLoopMerge, {1, 2, ctrl.value()}, + ctrl.operands()))); +} + +#define CASE(VALUE, NAME) \ + { SpvLoopControl##VALUE, NAME } +#define CASE1(VALUE, NAME, PARM) \ + { \ + SpvLoopControl##VALUE, NAME, { PARM } \ + } +INSTANTIATE_TEST_CASE_P( + TextToBinaryLoopMerge, OpLoopMergeTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector>{ + // clang-format off + CASE(MaskNone, "None"), + CASE(UnrollMask, "Unroll"), + CASE(DontUnrollMask, "DontUnroll"), + // clang-format on + })), ); + +INSTANTIATE_TEST_CASE_P( + TextToBinaryLoopMergeV11, OpLoopMergeTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector>{ + // clang-format off + CASE(DependencyInfiniteMask, "DependencyInfinite"), + CASE1(DependencyLengthMask, "DependencyLength", 234), + {SpvLoopControlUnrollMask|SpvLoopControlDependencyLengthMask, + "DependencyLength|Unroll", {33}}, + // clang-format on + })), ); +#undef CASE +#undef CASE1 + +TEST_F(OpLoopMergeTest, CombinedLoopControlMask) { + const std::string input = "OpLoopMerge %merge %continue Unroll|DontUnroll"; + const uint32_t expected_mask = + SpvLoopControlUnrollMask | SpvLoopControlDontUnrollMask; + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpLoopMerge, {1, 2, expected_mask}))); +} + +TEST_F(OpLoopMergeTest, WrongLoopControl) { + EXPECT_THAT(CompileFailure("OpLoopMerge %m %c none"), + Eq("Invalid loop control operand 'none'.")); +} + +// Test OpSwitch + +TEST_F(TextToBinaryTest, SwitchGoodZeroTargets) { + EXPECT_THAT(CompiledInstructions("OpSwitch %selector %default"), + Eq(MakeInstruction(SpvOpSwitch, {1, 2}))); +} + +TEST_F(TextToBinaryTest, SwitchGoodOneTarget) { + EXPECT_THAT(CompiledInstructions("%1 = OpTypeInt 32 0\n" + "%2 = OpConstant %1 52\n" + "OpSwitch %2 %default 12 %target0"), + Eq(Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 52}), + MakeInstruction(SpvOpSwitch, {2, 3, 12, 4})}))); +} + +TEST_F(TextToBinaryTest, SwitchGoodTwoTargets) { + EXPECT_THAT( + CompiledInstructions("%1 = OpTypeInt 32 0\n" + "%2 = OpConstant %1 52\n" + "OpSwitch %2 %default 12 %target0 42 %target1"), + Eq(Concatenate({ + MakeInstruction(SpvOpTypeInt, {1, 32, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 52}), + MakeInstruction(SpvOpSwitch, {2, 3, 12, 4, 42, 5}), + }))); +} + +TEST_F(TextToBinaryTest, SwitchBadMissingSelector) { + EXPECT_THAT(CompileFailure("OpSwitch"), + Eq("Expected operand, found end of stream.")); +} + +TEST_F(TextToBinaryTest, SwitchBadInvalidSelector) { + EXPECT_THAT(CompileFailure("OpSwitch 12"), + Eq("Expected id to start with %.")); +} + +TEST_F(TextToBinaryTest, SwitchBadMissingDefault) { + EXPECT_THAT(CompileFailure("OpSwitch %selector"), + Eq("Expected operand, found end of stream.")); +} + +TEST_F(TextToBinaryTest, SwitchBadInvalidDefault) { + EXPECT_THAT(CompileFailure("OpSwitch %selector 12"), + Eq("Expected id to start with %.")); +} + +TEST_F(TextToBinaryTest, SwitchBadInvalidLiteral) { + // The assembler recognizes "OpSwitch %selector %default" as a complete + // instruction. Then it tries to parse "%abc" as the start of a new + // instruction, but can't since it hits the end of stream. + const auto input = R"(%i32 = OpTypeInt 32 0 + %selector = OpConstant %i32 42 + OpSwitch %selector %default %abc)"; + EXPECT_THAT(CompileFailure(input), Eq("Expected '=', found end of stream.")); +} + +TEST_F(TextToBinaryTest, SwitchBadMissingTarget) { + EXPECT_THAT(CompileFailure("%1 = OpTypeInt 32 0\n" + "%2 = OpConstant %1 52\n" + "OpSwitch %2 %default 12"), + Eq("Expected operand, found end of stream.")); +} + +// A test case for an OpSwitch. +// It is also parameterized to test encodings OpConstant +// integer literals. This can capture both single and multi-word +// integer literal tests. +struct SwitchTestCase { + std::string constant_type_args; + std::string constant_value_arg; + std::string case_value_arg; + std::vector expected_instructions; +}; + +using OpSwitchValidTest = + spvtest::TextToBinaryTestBase>; + +// Tests the encoding of OpConstant literal values, and also +// the literal integer cases in an OpSwitch. This can +// test both single and multi-word integer literal encodings. +TEST_P(OpSwitchValidTest, ValidTypes) { + const std::string input = "%1 = OpTypeInt " + GetParam().constant_type_args + + "\n" + "%2 = OpConstant %1 " + + GetParam().constant_value_arg + + "\n" + "OpSwitch %2 %default " + + GetParam().case_value_arg + " %4\n"; + std::vector instructions; + EXPECT_THAT(CompiledInstructions(input), + Eq(GetParam().expected_instructions)); +} + +// Constructs a SwitchTestCase from the given integer_width, signedness, +// constant value string, and expected encoded constant. +SwitchTestCase MakeSwitchTestCase(uint32_t integer_width, + uint32_t integer_signedness, + std::string constant_str, + std::vector encoded_constant, + std::string case_value_str, + std::vector encoded_case_value) { + std::stringstream ss; + ss << integer_width << " " << integer_signedness; + return SwitchTestCase{ + ss.str(), + constant_str, + case_value_str, + {Concatenate( + {MakeInstruction(SpvOpTypeInt, + {1, integer_width, integer_signedness}), + MakeInstruction(SpvOpConstant, + Concatenate({{1, 2}, encoded_constant})), + MakeInstruction(SpvOpSwitch, + Concatenate({{2, 3}, encoded_case_value, {4}}))})}}; +} + +INSTANTIATE_TEST_CASE_P( + TextToBinaryOpSwitchValid1Word, OpSwitchValidTest, + ValuesIn(std::vector({ + MakeSwitchTestCase(32, 0, "42", {42}, "100", {100}), + MakeSwitchTestCase(32, 1, "-1", {0xffffffff}, "100", {100}), + // SPIR-V 1.0 Rev 1 clarified that for an integer narrower than 32-bits, + // its bits will appear in the lower order bits of the 32-bit word, and + // a signed integer is sign-extended. + MakeSwitchTestCase(7, 0, "127", {127}, "100", {100}), + MakeSwitchTestCase(14, 0, "99", {99}, "100", {100}), + MakeSwitchTestCase(16, 0, "65535", {65535}, "100", {100}), + MakeSwitchTestCase(16, 1, "101", {101}, "100", {100}), + // Demonstrate sign extension + MakeSwitchTestCase(16, 1, "-2", {0xfffffffe}, "100", {100}), + // Hex cases + MakeSwitchTestCase(16, 1, "0x7ffe", {0x7ffe}, "0x1234", {0x1234}), + MakeSwitchTestCase(16, 1, "0x8000", {0xffff8000}, "0x8100", + {0xffff8100}), + MakeSwitchTestCase(16, 0, "0x8000", {0x00008000}, "0x8100", {0x8100}), + })), ); + +// NB: The words LOW ORDER bits show up first. +INSTANTIATE_TEST_CASE_P( + TextToBinaryOpSwitchValid2Words, OpSwitchValidTest, + ValuesIn(std::vector({ + MakeSwitchTestCase(33, 0, "101", {101, 0}, "500", {500, 0}), + MakeSwitchTestCase(48, 1, "-1", {0xffffffff, 0xffffffff}, "900", + {900, 0}), + MakeSwitchTestCase(64, 1, "-2", {0xfffffffe, 0xffffffff}, "-5", + {0xfffffffb, uint32_t(-1)}), + // Hex cases + MakeSwitchTestCase(48, 1, "0x7fffffffffff", {0xffffffff, 0x00007fff}, + "100", {100, 0}), + MakeSwitchTestCase(48, 1, "0x800000000000", {0x00000000, 0xffff8000}, + "0x800000000000", {0x00000000, 0xffff8000}), + MakeSwitchTestCase(48, 0, "0x800000000000", {0x00000000, 0x00008000}, + "0x800000000000", {0x00000000, 0x00008000}), + MakeSwitchTestCase(63, 0, "0x500000000", {0, 5}, "12", {12, 0}), + MakeSwitchTestCase(64, 0, "0x600000000", {0, 6}, "12", {12, 0}), + MakeSwitchTestCase(64, 1, "0x700000123", {0x123, 7}, "12", {12, 0}), + })), ); + +INSTANTIATE_TEST_CASE_P( + OpSwitchRoundTripUnsignedIntegers, RoundTripTest, + ValuesIn(std::vector({ + // Unsigned 16-bit. + "%1 = OpTypeInt 16 0\n%2 = OpConstant %1 65535\nOpSwitch %2 %3\n", + // Unsigned 32-bit, three non-default cases. + "%1 = OpTypeInt 32 0\n%2 = OpConstant %1 123456\n" + "OpSwitch %2 %3 100 %4 102 %5 1000000 %6\n", + // Unsigned 48-bit, three non-default cases. + "%1 = OpTypeInt 48 0\n%2 = OpConstant %1 5000000000\n" + "OpSwitch %2 %3 100 %4 102 %5 6000000000 %6\n", + // Unsigned 64-bit, three non-default cases. + "%1 = OpTypeInt 64 0\n%2 = OpConstant %1 9223372036854775807\n" + "OpSwitch %2 %3 100 %4 102 %5 9000000000000000000 %6\n", + })), ); + +INSTANTIATE_TEST_CASE_P( + OpSwitchRoundTripSignedIntegers, RoundTripTest, + ValuesIn(std::vector{ + // Signed 16-bit, with two non-default cases + "%1 = OpTypeInt 16 1\n%2 = OpConstant %1 32767\n" + "OpSwitch %2 %3 99 %4 -102 %5\n", + "%1 = OpTypeInt 16 1\n%2 = OpConstant %1 -32768\n" + "OpSwitch %2 %3 99 %4 -102 %5\n", + // Signed 32-bit, two non-default cases. + "%1 = OpTypeInt 32 1\n%2 = OpConstant %1 -123456\n" + "OpSwitch %2 %3 100 %4 -123456 %5\n", + "%1 = OpTypeInt 32 1\n%2 = OpConstant %1 123456\n" + "OpSwitch %2 %3 100 %4 123456 %5\n", + // Signed 48-bit, three non-default cases. + "%1 = OpTypeInt 48 1\n%2 = OpConstant %1 5000000000\n" + "OpSwitch %2 %3 100 %4 -7000000000 %5 6000000000 %6\n", + "%1 = OpTypeInt 48 1\n%2 = OpConstant %1 -5000000000\n" + "OpSwitch %2 %3 100 %4 -7000000000 %5 6000000000 %6\n", + // Signed 64-bit, three non-default cases. + "%1 = OpTypeInt 64 1\n%2 = OpConstant %1 9223372036854775807\n" + "OpSwitch %2 %3 100 %4 7000000000 %5 -1000000000000000000 %6\n", + "%1 = OpTypeInt 64 1\n%2 = OpConstant %1 -9223372036854775808\n" + "OpSwitch %2 %3 100 %4 7000000000 %5 -1000000000000000000 %6\n", + }), ); + +using OpSwitchInvalidTypeTestCase = + spvtest::TextToBinaryTestBase>; + +TEST_P(OpSwitchInvalidTypeTestCase, InvalidTypes) { + const std::string input = + "%1 = " + GetParam() + + "\n" + "%3 = OpCopyObject %1 %2\n" // We only care the type of the expression + "%4 = OpSwitch %3 %default 32 %c\n"; + EXPECT_THAT(CompileFailure(input), + Eq("The selector operand for OpSwitch must be the result of an " + "instruction that generates an integer scalar")); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + TextToBinaryOpSwitchInvalidTests, OpSwitchInvalidTypeTestCase, + ValuesIn(std::vector{ + {"OpTypeVoid", + "OpTypeBool", + "OpTypeFloat 32", + "OpTypeVector %a 32", + "OpTypeMatrix %a 32", + "OpTypeImage %a 1D 0 0 0 0 Unknown", + "OpTypeSampler", + "OpTypeSampledImage %a", + "OpTypeArray %a %b", + "OpTypeRuntimeArray %a", + "OpTypeStruct %a", + "OpTypeOpaque \"Foo\"", + "OpTypePointer UniformConstant %a", + "OpTypeFunction %a %b", + "OpTypeEvent", + "OpTypeDeviceEvent", + "OpTypeReserveId", + "OpTypeQueue", + "OpTypePipe ReadOnly", + "OpTypeForwardPointer %a UniformConstant", + // At least one thing that isn't a type at all + "OpNot %a %b" + }, + }),); +// clang-format on + +// TODO(dneto): OpPhi +// TODO(dneto): OpLoopMerge +// TODO(dneto): OpLabel +// TODO(dneto): OpBranch +// TODO(dneto): OpSwitch +// TODO(dneto): OpKill +// TODO(dneto): OpReturn +// TODO(dneto): OpReturnValue +// TODO(dneto): OpUnreachable +// TODO(dneto): OpLifetimeStart +// TODO(dneto): OpLifetimeStop + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.debug_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.debug_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.debug_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.debug_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,211 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Assembler tests for instructions in the "Debug" section of the +// SPIR-V spec. + +#include "unit_spirv.h" + +#include + +#include "gmock/gmock.h" +#include "test_fixture.h" + +namespace { + +using spvtest::MakeInstruction; +using spvtest::MakeVector; +using spvtest::TextToBinaryTest; +using ::testing::Eq; + +// Test OpSource + +// A single test case for OpSource +struct LanguageCase { + uint32_t get_language_value() const { + return static_cast(language_value); + } + const char* language_name; + SpvSourceLanguage language_value; + uint32_t version; +}; + +// clang-format off +// The list of OpSource cases to use. +const LanguageCase kLanguageCases[] = { +#define CASE(NAME, VERSION) \ + { #NAME, SpvSourceLanguage##NAME, VERSION } + CASE(Unknown, 0), + CASE(Unknown, 999), + CASE(ESSL, 310), + CASE(GLSL, 450), + CASE(OpenCL_C, 120), + CASE(OpenCL_C, 200), + CASE(OpenCL_C, 210), + CASE(OpenCL_CPP, 210), + CASE(HLSL, 5), + CASE(HLSL, 6), +#undef CASE +}; +// clang-format on + +using OpSourceTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(OpSourceTest, AnyLanguage) { + const std::string input = std::string("OpSource ") + + GetParam().language_name + " " + + std::to_string(GetParam().version); + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpSource, {GetParam().get_language_value(), + GetParam().version}))); +} + +INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpSourceTest, + ::testing::ValuesIn(kLanguageCases), ); + +TEST_F(OpSourceTest, WrongLanguage) { + EXPECT_THAT(CompileFailure("OpSource xxyyzz 12345"), + Eq("Invalid source language 'xxyyzz'.")); +} + +TEST_F(TextToBinaryTest, OpSourceAcceptsOptionalFileId) { + // In the grammar, the file id is an OperandOptionalId. + const std::string input = "OpSource GLSL 450 %file_id"; + EXPECT_THAT( + CompiledInstructions(input), + Eq(MakeInstruction(SpvOpSource, {SpvSourceLanguageGLSL, 450, 1}))); +} + +TEST_F(TextToBinaryTest, OpSourceAcceptsOptionalSourceText) { + std::string fake_source = "To be or not to be"; + const std::string input = + "OpSource GLSL 450 %file_id \"" + fake_source + "\""; + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpSource, {SpvSourceLanguageGLSL, 450, 1}, + MakeVector(fake_source)))); +} + +// Test OpSourceContinued + +using OpSourceContinuedTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(OpSourceContinuedTest, AnyExtension) { + // TODO(dneto): utf-8, quoting, escaping + const std::string input = + std::string("OpSourceContinued \"") + GetParam() + "\""; + EXPECT_THAT( + CompiledInstructions(input), + Eq(MakeInstruction(SpvOpSourceContinued, MakeVector(GetParam())))); +} + +// TODO(dneto): utf-8, quoting, escaping +INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpSourceContinuedTest, + ::testing::ValuesIn(std::vector{ + "", "foo bar this and that"}), ); + +// Test OpSourceExtension + +using OpSourceExtensionTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(OpSourceExtensionTest, AnyExtension) { + // TODO(dneto): utf-8, quoting, escaping + const std::string input = + std::string("OpSourceExtension \"") + GetParam() + "\""; + EXPECT_THAT( + CompiledInstructions(input), + Eq(MakeInstruction(SpvOpSourceExtension, MakeVector(GetParam())))); +} + +// TODO(dneto): utf-8, quoting, escaping +INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpSourceExtensionTest, + ::testing::ValuesIn(std::vector{ + "", "foo bar this and that"}), ); + +TEST_F(TextToBinaryTest, OpLine) { + EXPECT_THAT(CompiledInstructions("OpLine %srcfile 42 99"), + Eq(MakeInstruction(SpvOpLine, {1, 42, 99}))); +} + +TEST_F(TextToBinaryTest, OpNoLine) { + EXPECT_THAT(CompiledInstructions("OpNoLine"), + Eq(MakeInstruction(SpvOpNoLine, {}))); +} + +using OpStringTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(OpStringTest, AnyString) { + // TODO(dneto): utf-8, quoting, escaping + const std::string input = + std::string("%result = OpString \"") + GetParam() + "\""; + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpString, {1}, MakeVector(GetParam())))); +} + +// TODO(dneto): utf-8, quoting, escaping +INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpStringTest, + ::testing::ValuesIn(std::vector{ + "", "foo bar this and that"}), ); + +using OpNameTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(OpNameTest, AnyString) { + const std::string input = + std::string("OpName %target \"") + GetParam() + "\""; + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpName, {1}, MakeVector(GetParam())))); +} + +// UTF-8, quoting, escaping, etc. are covered in the StringLiterals tests in +// BinaryToText.Literal.cpp. +INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpNameTest, + ::testing::Values("", "foo bar this and that"), ); + +using OpMemberNameTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(OpMemberNameTest, AnyString) { + // TODO(dneto): utf-8, quoting, escaping + const std::string input = + std::string("OpMemberName %type 42 \"") + GetParam() + "\""; + EXPECT_THAT( + CompiledInstructions(input), + Eq(MakeInstruction(SpvOpMemberName, {1, 42}, MakeVector(GetParam())))); +} + +// TODO(dneto): utf-8, quoting, escaping +INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpMemberNameTest, + ::testing::ValuesIn(std::vector{ + "", "foo bar this and that"}), ); + +// TODO(dneto): Parse failures? + +using OpModuleProcessedTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(OpModuleProcessedTest, AnyString) { + const std::string input = + std::string("OpModuleProcessed \"") + GetParam() + "\""; + EXPECT_THAT( + CompiledInstructions(input, SPV_ENV_UNIVERSAL_1_1), + Eq(MakeInstruction(SpvOpModuleProcessed, MakeVector(GetParam())))); +} + +INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpModuleProcessedTest, + ::testing::Values("", "foo bar this and that"), ); +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.device_side_enqueue_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.device_side_enqueue_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.device_side_enqueue_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.device_side_enqueue_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,107 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Assembler tests for instructions in the "Device-Side Enqueue Instructions" +// section of the SPIR-V spec. + +#include "unit_spirv.h" + +#include "gmock/gmock.h" +#include "test_fixture.h" + +namespace { +using spvtest::MakeInstruction; +using ::testing::Eq; + +// Test OpEnqueueKernel + +struct KernelEnqueueCase { + std::string local_size_source; + std::vector local_size_operands; +}; + +using OpEnqueueKernelGood = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(OpEnqueueKernelGood, Sample) { + const std::string input = + "%result = OpEnqueueKernel %type %queue %flags %NDRange %num_events" + " %wait_events %ret_event %invoke %param %param_size %param_align " + + GetParam().local_size_source; + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpEnqueueKernel, + {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, + GetParam().local_size_operands))); +} + +INSTANTIATE_TEST_CASE_P( + TextToBinaryTest, OpEnqueueKernelGood, + ::testing::ValuesIn(std::vector{ + // Provide IDs for pointer-to-local arguments for the + // invoked function. + // Test up to 10 such arguments. + // I (dneto) can't find a limit on the number of kernel + // arguments in OpenCL C 2.0 Rev 29, e.g. in section 6.9 + // Restrictions. + {"", {}}, + {"%l0", {13}}, + {"%l0 %l1", {13, 14}}, + {"%l0 %l1 %l2", {13, 14, 15}}, + {"%l0 %l1 %l2 %l3", {13, 14, 15, 16}}, + {"%l0 %l1 %l2 %l3 %l4", {13, 14, 15, 16, 17}}, + {"%l0 %l1 %l2 %l3 %l4 %l5", {13, 14, 15, 16, 17, 18}}, + {"%l0 %l1 %l2 %l3 %l4 %l5 %l6", {13, 14, 15, 16, 17, 18, 19}}, + {"%l0 %l1 %l2 %l3 %l4 %l5 %l6 %l7", {13, 14, 15, 16, 17, 18, 19, 20}}, + {"%l0 %l1 %l2 %l3 %l4 %l5 %l6 %l7 %l8", + {13, 14, 15, 16, 17, 18, 19, 20, 21}}, + {"%l0 %l1 %l2 %l3 %l4 %l5 %l6 %l7 %l8 %l9", + {13, 14, 15, 16, 17, 18, 19, 20, 21, 22}}, + }), ); + +// Test some bad parses of OpEnqueueKernel. For other cases, we're relying +// on the uniformity of the parsing algorithm. The following two tests, ensure +// that every required ID operand is specified, and is actually an ID operand. +using OpKernelEnqueueBad = spvtest::TextToBinaryTest; + +TEST_F(OpKernelEnqueueBad, MissingLastOperand) { + EXPECT_THAT( + CompileFailure( + "%result = OpEnqueueKernel %type %queue %flags %NDRange %num_events" + " %wait_events %ret_event %invoke %param %param_size"), + Eq("Expected operand, found end of stream.")); +} + +TEST_F(OpKernelEnqueueBad, InvalidLastOperand) { + EXPECT_THAT( + CompileFailure( + "%result = OpEnqueueKernel %type %queue %flags %NDRange %num_events" + " %wait_events %ret_event %invoke %param %param_size 42"), + Eq("Expected id to start with %.")); +} + +// TODO(dneto): OpEnqueueMarker +// TODO(dneto): OpGetKernelNDRangeSubGroupCount +// TODO(dneto): OpGetKernelNDRangeMaxSubGroupSize +// TODO(dneto): OpGetKernelWorkGroupSize +// TODO(dneto): OpGetKernelPreferredWorkGroupSizeMultiple +// TODO(dneto): OpRetainEvent +// TODO(dneto): OpReleaseEvent +// TODO(dneto): OpCreateUserEvent +// TODO(dneto): OpSetUserEventStatus +// TODO(dneto): OpCaptureEventProfilingInfo +// TODO(dneto): OpGetDefaultQueue +// TODO(dneto): OpBuildNDRange +// TODO(dneto): OpBuildNDRange + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.extension_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.extension_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.extension_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.extension_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,660 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Assembler tests for instructions in the "Extension Instruction" section +// of the SPIR-V spec. + +#include "unit_spirv.h" + +#include "gmock/gmock.h" +#include "latest_version_glsl_std_450_header.h" +#include "latest_version_opencl_std_header.h" +#include "test_fixture.h" + +namespace { + +using spvtest::Concatenate; +using spvtest::MakeInstruction; +using spvtest::MakeVector; +using spvtest::TextToBinaryTest; +using ::testing::Combine; +using ::testing::Eq; +using ::testing::Values; +using ::testing::ValuesIn; + +// Returns a generator of common Vulkan environment values to be tested. +std::vector CommonVulkanEnvs() { + return {SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, SPV_ENV_UNIVERSAL_1_2, + SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_1}; +} + +TEST_F(TextToBinaryTest, InvalidExtInstImportName) { + EXPECT_THAT(CompileFailure("%1 = OpExtInstImport \"Haskell.std\""), + Eq("Invalid extended instruction import 'Haskell.std'")); +} + +TEST_F(TextToBinaryTest, InvalidImportId) { + EXPECT_THAT(CompileFailure("%1 = OpTypeVoid\n" + "%2 = OpExtInst %1 %1"), + Eq("Invalid extended instruction import Id 2")); +} + +TEST_F(TextToBinaryTest, InvalidImportInstruction) { + const std::string input = R"(%1 = OpTypeVoid + %2 = OpExtInstImport "OpenCL.std" + %3 = OpExtInst %1 %2 not_in_the_opencl)"; + EXPECT_THAT(CompileFailure(input), + Eq("Invalid extended instruction name 'not_in_the_opencl'.")); +} + +TEST_F(TextToBinaryTest, MultiImport) { + const std::string input = R"(%2 = OpExtInstImport "OpenCL.std" + %2 = OpExtInstImport "OpenCL.std")"; + EXPECT_THAT(CompileFailure(input), + Eq("Import Id is being defined a second time")); +} + +TEST_F(TextToBinaryTest, TooManyArguments) { + const std::string input = R"(%opencl = OpExtInstImport "OpenCL.std" + %2 = OpExtInst %float %opencl cos %x %oops")"; + EXPECT_THAT(CompileFailure(input), Eq("Expected '=', found end of stream.")); +} + +TEST_F(TextToBinaryTest, ExtInstFromTwoDifferentImports) { + const std::string input = R"(%1 = OpExtInstImport "OpenCL.std" +%2 = OpExtInstImport "GLSL.std.450" +%4 = OpExtInst %3 %1 native_sqrt %5 +%7 = OpExtInst %6 %2 MatrixInverse %8 +)"; + + // Make sure it assembles correctly. + EXPECT_THAT( + CompiledInstructions(input), + Eq(Concatenate({ + MakeInstruction(SpvOpExtInstImport, {1}, MakeVector("OpenCL.std")), + MakeInstruction(SpvOpExtInstImport, {2}, MakeVector("GLSL.std.450")), + MakeInstruction( + SpvOpExtInst, + {3, 4, 1, uint32_t(OpenCLLIB::Entrypoints::Native_sqrt), 5}), + MakeInstruction(SpvOpExtInst, + {6, 7, 2, uint32_t(GLSLstd450MatrixInverse), 8}), + }))); + + // Make sure it disassembles correctly. + EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(input)); +} + +// A test case for assembling into words in an instruction. +struct AssemblyCase { + std::string input; + std::vector expected; +}; + +using ExtensionAssemblyTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>>; + +TEST_P(ExtensionAssemblyTest, Samples) { + const spv_target_env& env = std::get<0>(GetParam()); + const AssemblyCase& ac = std::get<1>(GetParam()); + + // Check that it assembles correctly. + EXPECT_THAT(CompiledInstructions(ac.input, env), Eq(ac.expected)); +} + +using ExtensionRoundTripTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>>; + +TEST_P(ExtensionRoundTripTest, Samples) { + const spv_target_env& env = std::get<0>(GetParam()); + const AssemblyCase& ac = std::get<1>(GetParam()); + + // Check that it assembles correctly. + EXPECT_THAT(CompiledInstructions(ac.input, env), Eq(ac.expected)); + + // Check round trip through the disassembler. + EXPECT_THAT(EncodeAndDecodeSuccessfully(ac.input, + SPV_BINARY_TO_TEXT_OPTION_NONE, env), + Eq(ac.input)) + << "target env: " << spvTargetEnvDescription(env) << "\n"; +} + +// SPV_KHR_shader_ballot + +INSTANTIATE_TEST_CASE_P( + SPV_KHR_shader_ballot, ExtensionRoundTripTest, + // We'll get coverage over operand tables by trying the universal + // environments, and at least one specific environment. + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_VULKAN_1_0), + ValuesIn(std::vector{ + {"OpCapability SubgroupBallotKHR\n", + MakeInstruction(SpvOpCapability, + {SpvCapabilitySubgroupBallotKHR})}, + {"%2 = OpSubgroupBallotKHR %1 %3\n", + MakeInstruction(SpvOpSubgroupBallotKHR, {1, 2, 3})}, + {"%2 = OpSubgroupFirstInvocationKHR %1 %3\n", + MakeInstruction(SpvOpSubgroupFirstInvocationKHR, {1, 2, 3})}, + {"OpDecorate %1 BuiltIn SubgroupEqMaskKHR\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, + SpvBuiltInSubgroupEqMaskKHR})}, + {"OpDecorate %1 BuiltIn SubgroupGeMaskKHR\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, + SpvBuiltInSubgroupGeMaskKHR})}, + {"OpDecorate %1 BuiltIn SubgroupGtMaskKHR\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, + SpvBuiltInSubgroupGtMaskKHR})}, + {"OpDecorate %1 BuiltIn SubgroupLeMaskKHR\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, + SpvBuiltInSubgroupLeMaskKHR})}, + {"OpDecorate %1 BuiltIn SubgroupLtMaskKHR\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, + SpvBuiltInSubgroupLtMaskKHR})}, + })), ); + +INSTANTIATE_TEST_CASE_P( + SPV_KHR_shader_ballot_vulkan_1_1, ExtensionRoundTripTest, + // In SPIR-V 1.3 and Vulkan 1.1 we can drop the KHR suffix on the + // builtin enums. + Combine(Values(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_1), + ValuesIn(std::vector{ + {"OpCapability SubgroupBallotKHR\n", + MakeInstruction(SpvOpCapability, + {SpvCapabilitySubgroupBallotKHR})}, + {"%2 = OpSubgroupBallotKHR %1 %3\n", + MakeInstruction(SpvOpSubgroupBallotKHR, {1, 2, 3})}, + {"%2 = OpSubgroupFirstInvocationKHR %1 %3\n", + MakeInstruction(SpvOpSubgroupFirstInvocationKHR, {1, 2, 3})}, + {"OpDecorate %1 BuiltIn SubgroupEqMask\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, + SpvBuiltInSubgroupEqMask})}, + {"OpDecorate %1 BuiltIn SubgroupGeMask\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, + SpvBuiltInSubgroupGeMask})}, + {"OpDecorate %1 BuiltIn SubgroupGtMask\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, + SpvBuiltInSubgroupGtMask})}, + {"OpDecorate %1 BuiltIn SubgroupLeMask\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, + SpvBuiltInSubgroupLeMask})}, + {"OpDecorate %1 BuiltIn SubgroupLtMask\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, + SpvBuiltInSubgroupLtMask})}, + })), ); + +// The old builtin names (with KHR suffix) still work in the assmebler, and +// map to the enums without the KHR. +INSTANTIATE_TEST_CASE_P( + SPV_KHR_shader_ballot_vulkan_1_1_alias_check, ExtensionAssemblyTest, + // In SPIR-V 1.3 and Vulkan 1.1 we can drop the KHR suffix on the + // builtin enums. + Combine(Values(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_1), + ValuesIn(std::vector{ + {"OpDecorate %1 BuiltIn SubgroupEqMaskKHR\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, + SpvBuiltInSubgroupEqMask})}, + {"OpDecorate %1 BuiltIn SubgroupGeMaskKHR\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, + SpvBuiltInSubgroupGeMask})}, + {"OpDecorate %1 BuiltIn SubgroupGtMaskKHR\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, + SpvBuiltInSubgroupGtMask})}, + {"OpDecorate %1 BuiltIn SubgroupLeMaskKHR\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, + SpvBuiltInSubgroupLeMask})}, + {"OpDecorate %1 BuiltIn SubgroupLtMaskKHR\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, + SpvBuiltInSubgroupLtMask})}, + })), ); + +// SPV_KHR_shader_draw_parameters + +INSTANTIATE_TEST_CASE_P( + SPV_KHR_shader_draw_parameters, ExtensionRoundTripTest, + // We'll get coverage over operand tables by trying the universal + // environments, and at least one specific environment. + Combine( + ValuesIn(CommonVulkanEnvs()), + ValuesIn(std::vector{ + {"OpCapability DrawParameters\n", + MakeInstruction(SpvOpCapability, {SpvCapabilityDrawParameters})}, + {"OpDecorate %1 BuiltIn BaseVertex\n", + MakeInstruction(SpvOpDecorate, + {1, SpvDecorationBuiltIn, SpvBuiltInBaseVertex})}, + {"OpDecorate %1 BuiltIn BaseInstance\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, + SpvBuiltInBaseInstance})}, + {"OpDecorate %1 BuiltIn DrawIndex\n", + MakeInstruction(SpvOpDecorate, + {1, SpvDecorationBuiltIn, SpvBuiltInDrawIndex})}, + })), ); + +// SPV_KHR_subgroup_vote + +INSTANTIATE_TEST_CASE_P( + SPV_KHR_subgroup_vote, ExtensionRoundTripTest, + // We'll get coverage over operand tables by trying the universal + // environments, and at least one specific environment. + Combine(ValuesIn(CommonVulkanEnvs()), + ValuesIn(std::vector{ + {"OpCapability SubgroupVoteKHR\n", + MakeInstruction(SpvOpCapability, + {SpvCapabilitySubgroupVoteKHR})}, + {"%2 = OpSubgroupAnyKHR %1 %3\n", + MakeInstruction(SpvOpSubgroupAnyKHR, {1, 2, 3})}, + {"%2 = OpSubgroupAllKHR %1 %3\n", + MakeInstruction(SpvOpSubgroupAllKHR, {1, 2, 3})}, + {"%2 = OpSubgroupAllEqualKHR %1 %3\n", + MakeInstruction(SpvOpSubgroupAllEqualKHR, {1, 2, 3})}, + })), ); + +// SPV_KHR_16bit_storage + +INSTANTIATE_TEST_CASE_P( + SPV_KHR_16bit_storage, ExtensionRoundTripTest, + // We'll get coverage over operand tables by trying the universal + // environments, and at least one specific environment. + Combine(ValuesIn(CommonVulkanEnvs()), + ValuesIn(std::vector{ + {"OpCapability StorageBuffer16BitAccess\n", + MakeInstruction(SpvOpCapability, + {SpvCapabilityStorageUniformBufferBlock16})}, + {"OpCapability StorageBuffer16BitAccess\n", + MakeInstruction(SpvOpCapability, + {SpvCapabilityStorageBuffer16BitAccess})}, + {"OpCapability StorageUniform16\n", + MakeInstruction( + SpvOpCapability, + {SpvCapabilityUniformAndStorageBuffer16BitAccess})}, + {"OpCapability StorageUniform16\n", + MakeInstruction(SpvOpCapability, + {SpvCapabilityStorageUniform16})}, + {"OpCapability StoragePushConstant16\n", + MakeInstruction(SpvOpCapability, + {SpvCapabilityStoragePushConstant16})}, + {"OpCapability StorageInputOutput16\n", + MakeInstruction(SpvOpCapability, + {SpvCapabilityStorageInputOutput16})}, + })), ); + +INSTANTIATE_TEST_CASE_P( + SPV_KHR_16bit_storage_alias_check, ExtensionAssemblyTest, + Combine(ValuesIn(CommonVulkanEnvs()), + ValuesIn(std::vector{ + // The old name maps to the new enum. + {"OpCapability StorageUniformBufferBlock16\n", + MakeInstruction(SpvOpCapability, + {SpvCapabilityStorageBuffer16BitAccess})}, + // The new name maps to the old enum. + {"OpCapability UniformAndStorageBuffer16BitAccess\n", + MakeInstruction(SpvOpCapability, + {SpvCapabilityStorageUniform16})}, + })), ); + +// SPV_KHR_device_group + +INSTANTIATE_TEST_CASE_P( + SPV_KHR_device_group, ExtensionRoundTripTest, + // We'll get coverage over operand tables by trying the universal + // environments, and at least one specific environment. + Combine(ValuesIn(CommonVulkanEnvs()), + ValuesIn(std::vector{ + {"OpCapability DeviceGroup\n", + MakeInstruction(SpvOpCapability, {SpvCapabilityDeviceGroup})}, + {"OpDecorate %1 BuiltIn DeviceIndex\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, + SpvBuiltInDeviceIndex})}, + })), ); + +// SPV_KHR_multiview + +INSTANTIATE_TEST_CASE_P( + SPV_KHR_multiview, ExtensionRoundTripTest, + // We'll get coverage over operand tables by trying the universal + // environments, and at least one specific environment. + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_VULKAN_1_0), + ValuesIn(std::vector{ + {"OpCapability MultiView\n", + MakeInstruction(SpvOpCapability, {SpvCapabilityMultiView})}, + {"OpDecorate %1 BuiltIn ViewIndex\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, + SpvBuiltInViewIndex})}, + })), ); + +// SPV_AMD_shader_explicit_vertex_parameter + +#define PREAMBLE \ + "%1 = OpExtInstImport \"SPV_AMD_shader_explicit_vertex_parameter\"\n" +INSTANTIATE_TEST_CASE_P( + SPV_AMD_shader_explicit_vertex_parameter, ExtensionRoundTripTest, + // We'll get coverage over operand tables by trying the universal + // environments, and at least one specific environment. + Combine( + Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_VULKAN_1_0), + ValuesIn(std::vector{ + {PREAMBLE "%3 = OpExtInst %2 %1 InterpolateAtVertexAMD %4 %5\n", + Concatenate( + {MakeInstruction( + SpvOpExtInstImport, {1}, + MakeVector("SPV_AMD_shader_explicit_vertex_parameter")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, 1, 4, 5})})}, + })), ); +#undef PREAMBLE + +// SPV_AMD_shader_trinary_minmax + +#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_shader_trinary_minmax\"\n" +INSTANTIATE_TEST_CASE_P( + SPV_AMD_shader_trinary_minmax, ExtensionRoundTripTest, + // We'll get coverage over operand tables by trying the universal + // environments, and at least one specific environment. + Combine( + Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_VULKAN_1_0), + ValuesIn(std::vector{ + {PREAMBLE "%3 = OpExtInst %2 %1 FMin3AMD %4 %5 %6\n", + Concatenate( + {MakeInstruction(SpvOpExtInstImport, {1}, + MakeVector("SPV_AMD_shader_trinary_minmax")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, 1, 4, 5, 6})})}, + {PREAMBLE "%3 = OpExtInst %2 %1 UMin3AMD %4 %5 %6\n", + Concatenate( + {MakeInstruction(SpvOpExtInstImport, {1}, + MakeVector("SPV_AMD_shader_trinary_minmax")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, 2, 4, 5, 6})})}, + {PREAMBLE "%3 = OpExtInst %2 %1 SMin3AMD %4 %5 %6\n", + Concatenate( + {MakeInstruction(SpvOpExtInstImport, {1}, + MakeVector("SPV_AMD_shader_trinary_minmax")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, 3, 4, 5, 6})})}, + {PREAMBLE "%3 = OpExtInst %2 %1 FMax3AMD %4 %5 %6\n", + Concatenate( + {MakeInstruction(SpvOpExtInstImport, {1}, + MakeVector("SPV_AMD_shader_trinary_minmax")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, 4, 4, 5, 6})})}, + {PREAMBLE "%3 = OpExtInst %2 %1 UMax3AMD %4 %5 %6\n", + Concatenate( + {MakeInstruction(SpvOpExtInstImport, {1}, + MakeVector("SPV_AMD_shader_trinary_minmax")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, 5, 4, 5, 6})})}, + {PREAMBLE "%3 = OpExtInst %2 %1 SMax3AMD %4 %5 %6\n", + Concatenate( + {MakeInstruction(SpvOpExtInstImport, {1}, + MakeVector("SPV_AMD_shader_trinary_minmax")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, 6, 4, 5, 6})})}, + {PREAMBLE "%3 = OpExtInst %2 %1 FMid3AMD %4 %5 %6\n", + Concatenate( + {MakeInstruction(SpvOpExtInstImport, {1}, + MakeVector("SPV_AMD_shader_trinary_minmax")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, 7, 4, 5, 6})})}, + {PREAMBLE "%3 = OpExtInst %2 %1 UMid3AMD %4 %5 %6\n", + Concatenate( + {MakeInstruction(SpvOpExtInstImport, {1}, + MakeVector("SPV_AMD_shader_trinary_minmax")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, 8, 4, 5, 6})})}, + {PREAMBLE "%3 = OpExtInst %2 %1 SMid3AMD %4 %5 %6\n", + Concatenate( + {MakeInstruction(SpvOpExtInstImport, {1}, + MakeVector("SPV_AMD_shader_trinary_minmax")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, 9, 4, 5, 6})})}, + })), ); +#undef PREAMBLE + +// SPV_AMD_gcn_shader + +#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_gcn_shader\"\n" +INSTANTIATE_TEST_CASE_P( + SPV_AMD_gcn_shader, ExtensionRoundTripTest, + // We'll get coverage over operand tables by trying the universal + // environments, and at least one specific environment. + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_VULKAN_1_0), + ValuesIn(std::vector{ + {PREAMBLE "%3 = OpExtInst %2 %1 CubeFaceIndexAMD %4\n", + Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, + MakeVector("SPV_AMD_gcn_shader")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, 1, 4})})}, + {PREAMBLE "%3 = OpExtInst %2 %1 CubeFaceCoordAMD %4\n", + Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, + MakeVector("SPV_AMD_gcn_shader")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, 2, 4})})}, + {PREAMBLE "%3 = OpExtInst %2 %1 TimeAMD\n", + Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, + MakeVector("SPV_AMD_gcn_shader")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, 3})})}, + })), ); +#undef PREAMBLE + +// SPV_AMD_shader_ballot + +#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_shader_ballot\"\n" +INSTANTIATE_TEST_CASE_P( + SPV_AMD_shader_ballot, ExtensionRoundTripTest, + // We'll get coverage over operand tables by trying the universal + // environments, and at least one specific environment. + Combine( + Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_VULKAN_1_0), + ValuesIn(std::vector{ + {PREAMBLE "%3 = OpExtInst %2 %1 SwizzleInvocationsAMD %4 %5\n", + Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, + MakeVector("SPV_AMD_shader_ballot")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, 1, 4, 5})})}, + {PREAMBLE + "%3 = OpExtInst %2 %1 SwizzleInvocationsMaskedAMD %4 %5\n", + Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, + MakeVector("SPV_AMD_shader_ballot")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, 2, 4, 5})})}, + {PREAMBLE "%3 = OpExtInst %2 %1 WriteInvocationAMD %4 %5 %6\n", + Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, + MakeVector("SPV_AMD_shader_ballot")), + MakeInstruction(SpvOpExtInst, + {2, 3, 1, 3, 4, 5, 6})})}, + {PREAMBLE "%3 = OpExtInst %2 %1 MbcntAMD %4\n", + Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, + MakeVector("SPV_AMD_shader_ballot")), + MakeInstruction(SpvOpExtInst, {2, 3, 1, 4, 4})})}, + })), ); +#undef PREAMBLE + +// SPV_KHR_variable_pointers + +INSTANTIATE_TEST_CASE_P( + SPV_KHR_variable_pointers, ExtensionRoundTripTest, + // We'll get coverage over operand tables by trying the universal + // environments, and at least one specific environment. + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_VULKAN_1_0), + ValuesIn(std::vector{ + {"OpCapability VariablePointers\n", + MakeInstruction(SpvOpCapability, + {SpvCapabilityVariablePointers})}, + {"OpCapability VariablePointersStorageBuffer\n", + MakeInstruction(SpvOpCapability, + {SpvCapabilityVariablePointersStorageBuffer})}, + })), ); + +// SPV_GOOGLE_decorate_string + +INSTANTIATE_TEST_CASE_P( + SPV_GOOGLE_decorate_string, ExtensionRoundTripTest, + Combine( + // We'll get coverage over operand tables by trying the universal + // environments, and at least one specific environment. + Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_UNIVERSAL_1_2, SPV_ENV_VULKAN_1_0), + ValuesIn(std::vector{ + {"OpDecorateStringGOOGLE %1 HlslSemanticGOOGLE \"ABC\"\n", + MakeInstruction(SpvOpDecorateStringGOOGLE, + {1, SpvDecorationHlslSemanticGOOGLE}, + MakeVector("ABC"))}, + {"OpMemberDecorateStringGOOGLE %1 3 HlslSemanticGOOGLE \"DEF\"\n", + MakeInstruction(SpvOpMemberDecorateStringGOOGLE, + {1, 3, SpvDecorationHlslSemanticGOOGLE}, + MakeVector("DEF"))}, + })), ); + +// SPV_GOOGLE_hlsl_functionality1 + +INSTANTIATE_TEST_CASE_P( + SPV_GOOGLE_hlsl_functionality1, ExtensionRoundTripTest, + Combine( + // We'll get coverage over operand tables by trying the universal + // environments, and at least one specific environment. + Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_UNIVERSAL_1_2, SPV_ENV_VULKAN_1_0), + // HlslSemanticGOOGLE is tested in SPV_GOOGLE_decorate_string, since + // they are coupled together. + ValuesIn(std::vector{ + {"OpDecorateId %1 HlslCounterBufferGOOGLE %2\n", + MakeInstruction(SpvOpDecorateId, + {1, SpvDecorationHlslCounterBufferGOOGLE, 2})}, + })), ); + +// SPV_NV_shader_subgroup_partitioned + +INSTANTIATE_TEST_CASE_P( + SPV_NV_shader_subgroup_partitioned, ExtensionRoundTripTest, + Combine( + Values(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_1), + ValuesIn(std::vector{ + {"OpExtension \"SPV_NV_shader_subgroup_partitioned\"\n", + MakeInstruction(SpvOpExtension, + MakeVector("SPV_NV_shader_subgroup_partitioned"))}, + {"OpCapability GroupNonUniformPartitionedNV\n", + MakeInstruction(SpvOpCapability, + {SpvCapabilityGroupNonUniformPartitionedNV})}, + // Check the new capability's token number + {"OpCapability GroupNonUniformPartitionedNV\n", + MakeInstruction(SpvOpCapability, {5297})}, + {"%2 = OpGroupNonUniformPartitionNV %1 %3\n", + MakeInstruction(SpvOpGroupNonUniformPartitionNV, {1, 2, 3})}, + // Check the new instruction's token number + {"%2 = OpGroupNonUniformPartitionNV %1 %3\n", + MakeInstruction(static_cast(5296), {1, 2, 3})}, + // Check the new group operations + {"%2 = OpGroupIAdd %1 %3 PartitionedReduceNV %4\n", + MakeInstruction(SpvOpGroupIAdd, + {1, 2, 3, SpvGroupOperationPartitionedReduceNV, + 4})}, + {"%2 = OpGroupIAdd %1 %3 PartitionedReduceNV %4\n", + MakeInstruction(SpvOpGroupIAdd, {1, 2, 3, 6, 4})}, + {"%2 = OpGroupIAdd %1 %3 PartitionedInclusiveScanNV %4\n", + MakeInstruction(SpvOpGroupIAdd, + {1, 2, 3, + SpvGroupOperationPartitionedInclusiveScanNV, 4})}, + {"%2 = OpGroupIAdd %1 %3 PartitionedInclusiveScanNV %4\n", + MakeInstruction(SpvOpGroupIAdd, {1, 2, 3, 7, 4})}, + {"%2 = OpGroupIAdd %1 %3 PartitionedExclusiveScanNV %4\n", + MakeInstruction(SpvOpGroupIAdd, + {1, 2, 3, + SpvGroupOperationPartitionedExclusiveScanNV, 4})}, + {"%2 = OpGroupIAdd %1 %3 PartitionedExclusiveScanNV %4\n", + MakeInstruction(SpvOpGroupIAdd, {1, 2, 3, 8, 4})}, + })), ); + +// SPV_EXT_descriptor_indexing + +INSTANTIATE_TEST_CASE_P( + SPV_EXT_descriptor_indexing, ExtensionRoundTripTest, + Combine( + Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_0, + SPV_ENV_VULKAN_1_1), + ValuesIn(std::vector{ + {"OpExtension \"SPV_EXT_descriptor_indexing\"\n", + MakeInstruction(SpvOpExtension, + MakeVector("SPV_EXT_descriptor_indexing"))}, + // Check capabilities, by name + {"OpCapability ShaderNonUniformEXT\n", + MakeInstruction(SpvOpCapability, + {SpvCapabilityShaderNonUniformEXT})}, + {"OpCapability RuntimeDescriptorArrayEXT\n", + MakeInstruction(SpvOpCapability, + {SpvCapabilityRuntimeDescriptorArrayEXT})}, + {"OpCapability InputAttachmentArrayDynamicIndexingEXT\n", + MakeInstruction( + SpvOpCapability, + {SpvCapabilityInputAttachmentArrayDynamicIndexingEXT})}, + {"OpCapability UniformTexelBufferArrayDynamicIndexingEXT\n", + MakeInstruction( + SpvOpCapability, + {SpvCapabilityUniformTexelBufferArrayDynamicIndexingEXT})}, + {"OpCapability StorageTexelBufferArrayDynamicIndexingEXT\n", + MakeInstruction( + SpvOpCapability, + {SpvCapabilityStorageTexelBufferArrayDynamicIndexingEXT})}, + {"OpCapability UniformBufferArrayNonUniformIndexingEXT\n", + MakeInstruction( + SpvOpCapability, + {SpvCapabilityUniformBufferArrayNonUniformIndexingEXT})}, + {"OpCapability SampledImageArrayNonUniformIndexingEXT\n", + MakeInstruction( + SpvOpCapability, + {SpvCapabilitySampledImageArrayNonUniformIndexingEXT})}, + {"OpCapability StorageBufferArrayNonUniformIndexingEXT\n", + MakeInstruction( + SpvOpCapability, + {SpvCapabilityStorageBufferArrayNonUniformIndexingEXT})}, + {"OpCapability StorageImageArrayNonUniformIndexingEXT\n", + MakeInstruction( + SpvOpCapability, + {SpvCapabilityStorageImageArrayNonUniformIndexingEXT})}, + {"OpCapability InputAttachmentArrayNonUniformIndexingEXT\n", + MakeInstruction( + SpvOpCapability, + {SpvCapabilityInputAttachmentArrayNonUniformIndexingEXT})}, + {"OpCapability UniformTexelBufferArrayNonUniformIndexingEXT\n", + MakeInstruction( + SpvOpCapability, + {SpvCapabilityUniformTexelBufferArrayNonUniformIndexingEXT})}, + {"OpCapability StorageTexelBufferArrayNonUniformIndexingEXT\n", + MakeInstruction( + SpvOpCapability, + {SpvCapabilityStorageTexelBufferArrayNonUniformIndexingEXT})}, + // Check capabilities, by number + {"OpCapability ShaderNonUniformEXT\n", + MakeInstruction(SpvOpCapability, {5301})}, + {"OpCapability RuntimeDescriptorArrayEXT\n", + MakeInstruction(SpvOpCapability, {5302})}, + {"OpCapability InputAttachmentArrayDynamicIndexingEXT\n", + MakeInstruction(SpvOpCapability, {5303})}, + {"OpCapability UniformTexelBufferArrayDynamicIndexingEXT\n", + MakeInstruction(SpvOpCapability, {5304})}, + {"OpCapability StorageTexelBufferArrayDynamicIndexingEXT\n", + MakeInstruction(SpvOpCapability, {5305})}, + {"OpCapability UniformBufferArrayNonUniformIndexingEXT\n", + MakeInstruction(SpvOpCapability, {5306})}, + {"OpCapability SampledImageArrayNonUniformIndexingEXT\n", + MakeInstruction(SpvOpCapability, {5307})}, + {"OpCapability StorageBufferArrayNonUniformIndexingEXT\n", + MakeInstruction(SpvOpCapability, {5308})}, + {"OpCapability StorageImageArrayNonUniformIndexingEXT\n", + MakeInstruction(SpvOpCapability, {5309})}, + {"OpCapability InputAttachmentArrayNonUniformIndexingEXT\n", + MakeInstruction(SpvOpCapability, {5310})}, + {"OpCapability UniformTexelBufferArrayNonUniformIndexingEXT\n", + MakeInstruction(SpvOpCapability, {5311})}, + {"OpCapability StorageTexelBufferArrayNonUniformIndexingEXT\n", + MakeInstruction(SpvOpCapability, {5312})}, + + // Check the decoration token + {"OpDecorate %1 NonUniformEXT\n", + MakeInstruction(SpvOpDecorate, {1, SpvDecorationNonUniformEXT})}, + {"OpDecorate %1 NonUniformEXT\n", + MakeInstruction(SpvOpDecorate, {1, 5300})}, + })), ); + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.function_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.function_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.function_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.function_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Assembler tests for instructions in the "Function" section of the +// SPIR-V spec. + +#include "unit_spirv.h" + +#include "gmock/gmock.h" +#include "test_fixture.h" + +namespace { + +using spvtest::EnumCase; +using spvtest::MakeInstruction; +using spvtest::TextToBinaryTest; +using ::testing::Eq; + +// Test OpFunction + +using OpFunctionControlTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>>; + +TEST_P(OpFunctionControlTest, AnySingleFunctionControlMask) { + const std::string input = "%result_id = OpFunction %result_type " + + GetParam().name() + " %function_type "; + EXPECT_THAT( + CompiledInstructions(input), + Eq(MakeInstruction(SpvOpFunction, {1, 2, GetParam().value(), 3}))); +} + +// clang-format off +#define CASE(VALUE,NAME) { SpvFunctionControl##VALUE, NAME } +INSTANTIATE_TEST_CASE_P(TextToBinaryFunctionTest, OpFunctionControlTest, + ::testing::ValuesIn(std::vector>{ + CASE(MaskNone, "None"), + CASE(InlineMask, "Inline"), + CASE(DontInlineMask, "DontInline"), + CASE(PureMask, "Pure"), + CASE(ConstMask, "Const"), + }),); +#undef CASE +// clang-format on + +TEST_F(OpFunctionControlTest, CombinedFunctionControlMask) { + // Sample a single combination. This ensures we've integrated + // the instruction parsing logic with spvTextParseMask. + const std::string input = + "%result_id = OpFunction %result_type Inline|Pure|Const %function_type"; + const uint32_t expected_mask = SpvFunctionControlInlineMask | + SpvFunctionControlPureMask | + SpvFunctionControlConstMask; + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpFunction, {1, 2, expected_mask, 3}))); +} + +TEST_F(OpFunctionControlTest, WrongFunctionControl) { + EXPECT_THAT(CompileFailure("%r = OpFunction %t Inline|Unroll %ft"), + Eq("Invalid function control operand 'Inline|Unroll'.")); +} + +// TODO(dneto): OpFunctionParameter +// TODO(dneto): OpFunctionEnd +// TODO(dneto): OpFunctionCall + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.group_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.group_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.group_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.group_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Assembler tests for instructions in the "Group Instrucions" section of the +// SPIR-V spec. + +#include "unit_spirv.h" + +#include "gmock/gmock.h" +#include "test_fixture.h" + +namespace { + +using spvtest::EnumCase; +using spvtest::MakeInstruction; +using ::testing::Eq; + +// Test GroupOperation enum + +using GroupOperationTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>>; + +TEST_P(GroupOperationTest, AnyGroupOperation) { + const std::string input = + "%result = OpGroupIAdd %type %scope " + GetParam().name() + " %x"; + EXPECT_THAT( + CompiledInstructions(input), + Eq(MakeInstruction(SpvOpGroupIAdd, {1, 2, 3, GetParam().value(), 4}))); +} + +// clang-format off +#define CASE(NAME) { SpvGroupOperation##NAME, #NAME} +INSTANTIATE_TEST_CASE_P(TextToBinaryGroupOperation, GroupOperationTest, + ::testing::ValuesIn(std::vector>{ + CASE(Reduce), + CASE(InclusiveScan), + CASE(ExclusiveScan), + }),); +#undef CASE +// clang-format on + +TEST_F(GroupOperationTest, WrongGroupOperation) { + EXPECT_THAT(CompileFailure("%r = OpGroupUMin %t %e xxyyzz %x"), + Eq("Invalid group operation 'xxyyzz'.")); +} + +// TODO(dneto): OpGroupAsyncCopy +// TODO(dneto): OpGroupWaitEvents +// TODO(dneto): OpGroupAll +// TODO(dneto): OpGroupAny +// TODO(dneto): OpGroupBroadcast +// TODO(dneto): OpGroupIAdd +// TODO(dneto): OpGroupFAdd +// TODO(dneto): OpGroupFMin +// TODO(dneto): OpGroupUMin +// TODO(dneto): OpGroupSMin +// TODO(dneto): OpGroupFMax +// TODO(dneto): OpGroupUMax +// TODO(dneto): OpGroupSMax + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.image_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.image_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.image_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.image_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,272 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Assembler tests for instructions in the "Image Instructions" section of +// the SPIR-V spec. + +#include "unit_spirv.h" + +#include "gmock/gmock.h" +#include "test_fixture.h" + +namespace { + +using spvtest::MakeInstruction; +using spvtest::TextToBinaryTest; +using ::testing::Eq; + +// An example case for a mask value with operands. +struct ImageOperandsCase { + std::string image_operands; + // The expected mask, followed by its operands. + std::vector expected_mask_and_operands; +}; + +// Test all kinds of image operands. + +using ImageOperandsTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(ImageOperandsTest, Sample) { + const std::string input = + "%2 = OpImageFetch %1 %3 %4" + GetParam().image_operands + "\n"; + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpImageFetch, {1, 2, 3, 4}, + GetParam().expected_mask_and_operands))); +} + +#define MASK(NAME) SpvImageOperands##NAME##Mask +INSTANTIATE_TEST_CASE_P( + TextToBinaryImageOperandsAny, ImageOperandsTest, + ::testing::ValuesIn(std::vector{ + // TODO(dneto): Rev32 adds many more values, and rearranges their + // values. + // Image operands are optional. + {"", {}}, + // Test each kind, alone. + {" Bias %5", {MASK(Bias), 5}}, + {" Lod %5", {MASK(Lod), 5}}, + {" Grad %5 %6", {MASK(Grad), 5, 6}}, + {" ConstOffset %5", {MASK(ConstOffset), 5}}, + {" Offset %5", {MASK(Offset), 5}}, + {" ConstOffsets %5", {MASK(ConstOffsets), 5}}, + {" Sample %5", {MASK(Sample), 5}}, + {" MinLod %5", {MASK(MinLod), 5}}, + }), ); +#undef MASK +#define MASK(NAME) static_cast(SpvImageOperands##NAME##Mask) +INSTANTIATE_TEST_CASE_P( + TextToBinaryImageOperandsCombination, ImageOperandsTest, + ::testing::ValuesIn(std::vector{ + // TODO(dneto): Rev32 adds many more values, and rearranges their + // values. + // Test adjacent pairs, so we can easily debug the values when it fails. + {" Bias|Lod %5 %6", {MASK(Bias) | MASK(Lod), 5, 6}}, + {" Lod|Grad %5 %6 %7", {MASK(Lod) | MASK(Grad), 5, 6, 7}}, + {" Grad|ConstOffset %5 %6 %7", + {MASK(Grad) | MASK(ConstOffset), 5, 6, 7}}, + {" ConstOffset|Offset %5 %6", {MASK(ConstOffset) | MASK(Offset), 5, 6}}, + {" Offset|ConstOffsets %5 %6", + {MASK(Offset) | MASK(ConstOffsets), 5, 6}}, + {" ConstOffsets|Sample %5 %6", + {MASK(ConstOffsets) | MASK(Sample), 5, 6}}, + // Test all masks together. + {" Bias|Lod|Grad|ConstOffset|Offset|ConstOffsets|Sample" + " %5 %6 %7 %8 %9 %10 %11 %12", + {MASK(Bias) | MASK(Lod) | MASK(Grad) | MASK(ConstOffset) | + MASK(Offset) | MASK(ConstOffsets) | MASK(Sample), + 5, 6, 7, 8, 9, 10, 11, 12}}, + // The same, but with mask value names reversed. + {" Sample|ConstOffsets|Offset|ConstOffset|Grad|Lod|Bias" + " %5 %6 %7 %8 %9 %10 %11 %12", + {MASK(Bias) | MASK(Lod) | MASK(Grad) | MASK(ConstOffset) | + MASK(Offset) | MASK(ConstOffsets) | MASK(Sample), + 5, 6, 7, 8, 9, 10, 11, 12}}}), ); +#undef MASK + +TEST_F(ImageOperandsTest, WrongOperand) { + EXPECT_THAT(CompileFailure("%r = OpImageFetch %t %i %c xxyyzz"), + Eq("Invalid image operand 'xxyyzz'.")); +} + +// Test OpImage + +using OpImageTest = TextToBinaryTest; + +TEST_F(OpImageTest, Valid) { + const std::string input = "%2 = OpImage %1 %3\n"; + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpImage, {1, 2, 3}))); + + // Test the disassembler. + EXPECT_THAT(EncodeAndDecodeSuccessfully(input), input); +} + +TEST_F(OpImageTest, InvalidTypeOperand) { + EXPECT_THAT(CompileFailure("%2 = OpImage 42"), + Eq("Expected id to start with %.")); +} + +TEST_F(OpImageTest, MissingSampledImageOperand) { + EXPECT_THAT(CompileFailure("%2 = OpImage %1"), + Eq("Expected operand, found end of stream.")); +} + +TEST_F(OpImageTest, InvalidSampledImageOperand) { + EXPECT_THAT(CompileFailure("%2 = OpImage %1 1000"), + Eq("Expected id to start with %.")); +} + +TEST_F(OpImageTest, TooManyOperands) { + // We should improve this message, to say what instruction we're trying to + // parse. + EXPECT_THAT(CompileFailure("%2 = OpImage %1 %3 %4"), // an Id + Eq("Expected '=', found end of stream.")); + + EXPECT_THAT(CompileFailure("%2 = OpImage %1 %3 99"), // a number + Eq("Expected or at the beginning of an " + "instruction, found '99'.")); + EXPECT_THAT(CompileFailure("%2 = OpImage %1 %3 \"abc\""), // a string + Eq("Expected or at the beginning of an " + "instruction, found '\"abc\"'.")); +} + +// Test OpImageSparseRead + +using OpImageSparseReadTest = TextToBinaryTest; + +TEST_F(OpImageSparseReadTest, OnlyRequiredOperands) { + const std::string input = "%2 = OpImageSparseRead %1 %3 %4\n"; + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpImageSparseRead, {1, 2, 3, 4}))); + // Test the disassembler. + EXPECT_THAT(EncodeAndDecodeSuccessfully(input), input); +} + +// Test all kinds of image operands on OpImageSparseRead + +using ImageSparseReadImageOperandsTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; + +TEST_P(ImageSparseReadImageOperandsTest, Sample) { + const std::string input = + "%2 = OpImageSparseRead %1 %3 %4" + GetParam().image_operands + "\n"; + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpImageSparseRead, {1, 2, 3, 4}, + GetParam().expected_mask_and_operands))); + // Test the disassembler. + EXPECT_THAT(EncodeAndDecodeSuccessfully(input), input); +} + +#define MASK(NAME) SpvImageOperands##NAME##Mask +INSTANTIATE_TEST_CASE_P(ImageSparseReadImageOperandsAny, + ImageSparseReadImageOperandsTest, + ::testing::ValuesIn(std::vector{ + // Image operands are optional. + {"", {}}, + // Test each kind, alone. + {" Bias %5", {MASK(Bias), 5}}, + {" Lod %5", {MASK(Lod), 5}}, + {" Grad %5 %6", {MASK(Grad), 5, 6}}, + {" ConstOffset %5", {MASK(ConstOffset), 5}}, + {" Offset %5", {MASK(Offset), 5}}, + {" ConstOffsets %5", {MASK(ConstOffsets), 5}}, + {" Sample %5", {MASK(Sample), 5}}, + {" MinLod %5", {MASK(MinLod), 5}}, + }), ); +#undef MASK +#define MASK(NAME) static_cast(SpvImageOperands##NAME##Mask) +INSTANTIATE_TEST_CASE_P( + ImageSparseReadImageOperandsCombination, ImageSparseReadImageOperandsTest, + ::testing::ValuesIn(std::vector{ + // values. + // Test adjacent pairs, so we can easily debug the values when it fails. + {" Bias|Lod %5 %6", {MASK(Bias) | MASK(Lod), 5, 6}}, + {" Lod|Grad %5 %6 %7", {MASK(Lod) | MASK(Grad), 5, 6, 7}}, + {" Grad|ConstOffset %5 %6 %7", + {MASK(Grad) | MASK(ConstOffset), 5, 6, 7}}, + {" ConstOffset|Offset %5 %6", {MASK(ConstOffset) | MASK(Offset), 5, 6}}, + {" Offset|ConstOffsets %5 %6", + {MASK(Offset) | MASK(ConstOffsets), 5, 6}}, + {" ConstOffsets|Sample %5 %6", + {MASK(ConstOffsets) | MASK(Sample), 5, 6}}, + // Test all masks together. + {" Bias|Lod|Grad|ConstOffset|Offset|ConstOffsets|Sample" + " %5 %6 %7 %8 %9 %10 %11 %12", + {MASK(Bias) | MASK(Lod) | MASK(Grad) | MASK(ConstOffset) | + MASK(Offset) | MASK(ConstOffsets) | MASK(Sample), + 5, 6, 7, 8, 9, 10, 11, 12}}, + // Don't try the masks reversed, since this is a round trip test, + // and the disassembler will sort them. + }), ); +#undef MASK + +TEST_F(OpImageSparseReadTest, InvalidTypeOperand) { + EXPECT_THAT(CompileFailure("%2 = OpImageSparseRead 42"), + Eq("Expected id to start with %.")); +} + +TEST_F(OpImageSparseReadTest, MissingImageOperand) { + EXPECT_THAT(CompileFailure("%2 = OpImageSparseRead %1"), + Eq("Expected operand, found end of stream.")); +} + +TEST_F(OpImageSparseReadTest, InvalidImageOperand) { + EXPECT_THAT(CompileFailure("%2 = OpImageSparseRead %1 1000"), + Eq("Expected id to start with %.")); +} + +TEST_F(OpImageSparseReadTest, MissingCoordinateOperand) { + EXPECT_THAT(CompileFailure("%2 = OpImageSparseRead %1 %2"), + Eq("Expected operand, found end of stream.")); +} + +TEST_F(OpImageSparseReadTest, InvalidCoordinateOperand) { + EXPECT_THAT(CompileFailure("%2 = OpImageSparseRead %1 %2 1000"), + Eq("Expected id to start with %.")); +} + +// TODO(dneto): OpSampledImage +// TODO(dneto): OpImageSampleImplicitLod +// TODO(dneto): OpImageSampleExplicitLod +// TODO(dneto): OpImageSampleDrefImplicitLod +// TODO(dneto): OpImageSampleDrefExplicitLod +// TODO(dneto): OpImageSampleProjImplicitLod +// TODO(dneto): OpImageSampleProjExplicitLod +// TODO(dneto): OpImageSampleProjDrefImplicitLod +// TODO(dneto): OpImageSampleProjDrefExplicitLod +// TODO(dneto): OpImageGather +// TODO(dneto): OpImageDrefGather +// TODO(dneto): OpImageRead +// TODO(dneto): OpImageWrite +// TODO(dneto): OpImageQueryFormat +// TODO(dneto): OpImageQueryOrder +// TODO(dneto): OpImageQuerySizeLod +// TODO(dneto): OpImageQuerySize +// TODO(dneto): OpImageQueryLod +// TODO(dneto): OpImageQueryLevels +// TODO(dneto): OpImageQuerySamples +// TODO(dneto): OpImageSparseSampleImplicitLod +// TODO(dneto): OpImageSparseSampleExplicitLod +// TODO(dneto): OpImageSparseSampleDrefImplicitLod +// TODO(dneto): OpImageSparseSampleDrefExplicitLod +// TODO(dneto): OpImageSparseSampleProjImplicitLod +// TODO(dneto): OpImageSparseSampleProjExplicitLod +// TODO(dneto): OpImageSparseSampleProjDrefImplicitLod +// TODO(dneto): OpImageSparseSampleProjDrefExplicitLod +// TODO(dneto): OpImageSparseFetch +// TODO(dneto): OpImageSparseDrefGather +// TODO(dneto): OpImageSparseTexelsResident + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.literal_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.literal_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.literal_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.literal_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,121 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Assembler tests for literal numbers and literal strings. + +#include "test_fixture.h" + +namespace { + +using spvtest::TextToBinaryTest; + +TEST_F(TextToBinaryTest, LiteralStringInPlaceOfLiteralNumber) { + EXPECT_EQ( + R"(Invalid unsigned integer literal: "I shouldn't be a string")", + CompileFailure(R"(OpSource GLSL "I shouldn't be a string")")); +} + +TEST_F(TextToBinaryTest, GarbageInPlaceOfLiteralString) { + EXPECT_EQ("Invalid literal string 'nice-source-code'.", + CompileFailure("OpSourceExtension nice-source-code")); +} + +TEST_F(TextToBinaryTest, LiteralNumberInPlaceOfLiteralString) { + EXPECT_EQ("Expected literal string, found literal number '1000'.", + CompileFailure("OpSourceExtension 1000")); +} + +TEST_F(TextToBinaryTest, LiteralFloatInPlaceOfLiteralInteger) { + EXPECT_EQ("Invalid unsigned integer literal: 10.5", + CompileFailure("OpSource GLSL 10.5")); + + EXPECT_EQ("Invalid unsigned integer literal: 0.2", + CompileFailure(R"(OpMemberName %type 0.2 "member0.2")")); + + EXPECT_EQ("Invalid unsigned integer literal: 32.42", + CompileFailure("%int = OpTypeInt 32.42 0")); + + EXPECT_EQ("Invalid unsigned integer literal: 4.5", + CompileFailure("%mat = OpTypeMatrix %vec 4.5")); + + EXPECT_EQ("Invalid unsigned integer literal: 1.5", + CompileFailure("OpExecutionMode %main LocalSize 1.5 1.6 1.7")); + + EXPECT_EQ("Invalid unsigned integer literal: 0.123", + CompileFailure("%i32 = OpTypeInt 32 1\n" + "%c = OpConstant %i32 0.123")); +} + +TEST_F(TextToBinaryTest, LiteralInt64) { + const std::string code = + "%1 = OpTypeInt 64 0\n%2 = OpConstant %1 123456789021\n"; + EXPECT_EQ(code, EncodeAndDecodeSuccessfully(code)); +} + +TEST_F(TextToBinaryTest, LiteralDouble) { + const std::string code = + "%1 = OpTypeFloat 64\n%2 = OpSpecConstant %1 3.14159265358979\n"; + EXPECT_EQ(code, EncodeAndDecodeSuccessfully(code)); +} + +TEST_F(TextToBinaryTest, LiteralStringASCIILong) { + // SPIR-V allows strings up to 65535 characters. + // Test the simple case of UTF-8 code points corresponding + // to ASCII characters. + EXPECT_EQ(65535, SPV_LIMIT_LITERAL_STRING_UTF8_CHARS_MAX); + const std::string code = + "OpSourceExtension \"" + + std::string(SPV_LIMIT_LITERAL_STRING_UTF8_CHARS_MAX, 'o') + "\"\n"; + EXPECT_EQ(code, EncodeAndDecodeSuccessfully(code)); +} + +TEST_F(TextToBinaryTest, LiteralStringUTF8LongEncodings) { + // SPIR-V allows strings up to 65535 characters. + // Test the case of many Unicode characters, each of which has + // a 4-byte UTF-8 encoding. + + // An instruction is at most 65535 words long. The first one + // contains the wordcount and opcode. So the worst case number of + // 4-byte UTF-8 characters is 65533, since we also need to + // store a terminating null character. + + // This string fits exactly into 65534 words. + const std::string good_string = + spvtest::MakeLongUTF8String(65533) + // The following single character has a 3 byte encoding, + // which fits snugly against the terminating null. + + "\xe8\x80\x80"; + + // These strings will overflow any instruction with 0 or 1 other + // arguments, respectively. + const std::string bad_0_arg_string = spvtest::MakeLongUTF8String(65534); + const std::string bad_1_arg_string = spvtest::MakeLongUTF8String(65533); + + const std::string good_code = "OpSourceExtension \"" + good_string + "\"\n"; + EXPECT_EQ(good_code, EncodeAndDecodeSuccessfully(good_code)); + + // Prove that it works on more than one instruction. + const std::string good_code_2 = "OpSourceContinued \"" + good_string + "\"\n"; + EXPECT_EQ(good_code, EncodeAndDecodeSuccessfully(good_code)); + + // Failure cases. + EXPECT_EQ("Instruction too long: more than 65535 words.", + CompileFailure("OpSourceExtension \"" + bad_0_arg_string + "\"\n")); + EXPECT_EQ("Instruction too long: more than 65535 words.", + CompileFailure("OpSourceContinued \"" + bad_0_arg_string + "\"\n")); + EXPECT_EQ("Instruction too long: more than 65535 words.", + CompileFailure("OpName %target \"" + bad_1_arg_string + "\"\n")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.memory_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.memory_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.memory_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.memory_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,108 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Assembler tests for instructions in the "Memory Instructions" section of +// the SPIR-V spec. + +#include "unit_spirv.h" + +#include + +#include "gmock/gmock.h" +#include "test_fixture.h" + +namespace { + +using spvtest::EnumCase; +using spvtest::MakeInstruction; +using spvtest::TextToBinaryTest; +using ::testing::Eq; + +// Test assembly of Memory Access masks + +using MemoryAccessTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>>; + +TEST_P(MemoryAccessTest, AnySingleMemoryAccessMask) { + std::stringstream input; + input << "OpStore %ptr %value " << GetParam().name(); + for (auto operand : GetParam().operands()) input << " " << operand; + EXPECT_THAT(CompiledInstructions(input.str()), + Eq(MakeInstruction(SpvOpStore, {1, 2, GetParam().value()}, + GetParam().operands()))); +} + +INSTANTIATE_TEST_CASE_P( + TextToBinaryMemoryAccessTest, MemoryAccessTest, + ::testing::ValuesIn(std::vector>{ + {SpvMemoryAccessMaskNone, "None", {}}, + {SpvMemoryAccessVolatileMask, "Volatile", {}}, + {SpvMemoryAccessAlignedMask, "Aligned", {16}}, + {SpvMemoryAccessNontemporalMask, "Nontemporal", {}}, + }), ); + +TEST_F(TextToBinaryTest, CombinedMemoryAccessMask) { + const std::string input = "OpStore %ptr %value Volatile|Aligned 16"; + const uint32_t expected_mask = + SpvMemoryAccessVolatileMask | SpvMemoryAccessAlignedMask; + EXPECT_THAT(expected_mask, Eq(3u)); + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpStore, {1, 2, expected_mask, 16}))); +} + +// Test Storage Class enum values + +using StorageClassTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>>; + +TEST_P(StorageClassTest, AnyStorageClass) { + const std::string input = "%1 = OpVariable %2 " + GetParam().name(); + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpVariable, {1, 2, GetParam().value()}))); +} + +// clang-format off +#define CASE(NAME) { SpvStorageClass##NAME, #NAME, {} } +INSTANTIATE_TEST_CASE_P( + TextToBinaryStorageClassTest, StorageClassTest, + ::testing::ValuesIn(std::vector>{ + CASE(UniformConstant), + CASE(Input), + CASE(Uniform), + CASE(Output), + CASE(Workgroup), + CASE(CrossWorkgroup), + CASE(Private), + CASE(Function), + CASE(Generic), + CASE(PushConstant), + CASE(AtomicCounter), + CASE(Image), + }),); +#undef CASE +// clang-format on + +// TODO(dneto): OpVariable with initializers +// TODO(dneto): OpImageTexelPointer +// TODO(dneto): OpLoad +// TODO(dneto): OpStore +// TODO(dneto): OpCopyMemory +// TODO(dneto): OpCopyMemorySized +// TODO(dneto): OpAccessChain +// TODO(dneto): OpInBoundsAccessChain +// TODO(dneto): OpPtrAccessChain +// TODO(dneto): OpArrayLength +// TODO(dneto): OpGenercPtrMemSemantics + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.misc_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.misc_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.misc_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.misc_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,56 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Assembler tests for instructions in the "Miscellaneous" section of the +// SPIR-V spec. + +#include "unit_spirv.h" + +#include "gmock/gmock.h" +#include "test_fixture.h" + +namespace { + +using SpirvVector = spvtest::TextToBinaryTest::SpirvVector; +using spvtest::MakeInstruction; +using ::testing::Eq; +using TextToBinaryMisc = spvtest::TextToBinaryTest; + +TEST_F(TextToBinaryMisc, OpNop) { + EXPECT_THAT(CompiledInstructions("OpNop"), Eq(MakeInstruction(SpvOpNop, {}))); +} + +TEST_F(TextToBinaryMisc, OpUndef) { + const SpirvVector code = CompiledInstructions(R"(%f32 = OpTypeFloat 32 + %u = OpUndef %f32)"); + const uint32_t typeID = 1; + EXPECT_THAT(code[1], Eq(typeID)); + EXPECT_THAT(Subvector(code, 3), Eq(MakeInstruction(SpvOpUndef, {typeID, 2}))); +} + +TEST_F(TextToBinaryMisc, OpWrong) { + EXPECT_THAT(CompileFailure(" OpWrong %1 %2"), + Eq("Invalid Opcode name 'OpWrong'")); +} + +TEST_F(TextToBinaryMisc, OpWrongAfterRight) { + const auto assembly = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpXYZ +)"; + EXPECT_THAT(CompileFailure(assembly), Eq("Invalid Opcode name 'OpXYZ'")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.mode_setting_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.mode_setting_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.mode_setting_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.mode_setting_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,298 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Assembler tests for instructions in the "Mode-Setting" section of the +// SPIR-V spec. + +#include "unit_spirv.h" + +#include "gmock/gmock.h" +#include "test_fixture.h" + +namespace { + +using spvtest::EnumCase; +using spvtest::MakeInstruction; +using spvtest::MakeVector; +using std::get; +using std::tuple; +using ::testing::Combine; +using ::testing::Eq; +using ::testing::TestWithParam; +using ::testing::Values; +using ::testing::ValuesIn; + +// Test OpMemoryModel + +// An example case for OpMemoryModel +struct MemoryModelCase { + uint32_t get_addressing_value() const { + return static_cast(addressing_value); + } + uint32_t get_memory_value() const { + return static_cast(memory_value); + } + SpvAddressingModel addressing_value; + std::string addressing_name; + SpvMemoryModel memory_value; + std::string memory_name; +}; + +using OpMemoryModelTest = + spvtest::TextToBinaryTestBase>; + +TEST_P(OpMemoryModelTest, AnyMemoryModelCase) { + const std::string input = "OpMemoryModel " + GetParam().addressing_name + + " " + GetParam().memory_name; + EXPECT_THAT( + CompiledInstructions(input), + Eq(MakeInstruction(SpvOpMemoryModel, {GetParam().get_addressing_value(), + GetParam().get_memory_value()}))); +} + +#define CASE(ADDRESSING, MEMORY) \ + { \ + SpvAddressingModel##ADDRESSING, #ADDRESSING, SpvMemoryModel##MEMORY, \ + #MEMORY \ + } +// clang-format off +INSTANTIATE_TEST_CASE_P(TextToBinaryMemoryModel, OpMemoryModelTest, + ValuesIn(std::vector{ + // These cases exercise each addressing model, and + // each memory model, but not necessarily in + // combination. + CASE(Logical,Simple), + CASE(Logical,GLSL450), + CASE(Physical32,OpenCL), + CASE(Physical64,OpenCL), + }),); +#undef CASE +// clang-format on + +TEST_F(OpMemoryModelTest, WrongModel) { + EXPECT_THAT(CompileFailure("OpMemoryModel xxyyzz Simple"), + Eq("Invalid addressing model 'xxyyzz'.")); + EXPECT_THAT(CompileFailure("OpMemoryModel Logical xxyyzz"), + Eq("Invalid memory model 'xxyyzz'.")); +} + +// Test OpEntryPoint + +// An example case for OpEntryPoint +struct EntryPointCase { + uint32_t get_execution_value() const { + return static_cast(execution_value); + } + SpvExecutionModel execution_value; + std::string execution_name; + std::string entry_point_name; +}; + +using OpEntryPointTest = + spvtest::TextToBinaryTestBase>; + +TEST_P(OpEntryPointTest, AnyEntryPointCase) { + // TODO(dneto): utf-8, escaping, quoting cases for entry point name. + const std::string input = "OpEntryPoint " + GetParam().execution_name + + " %1 \"" + GetParam().entry_point_name + "\""; + EXPECT_THAT( + CompiledInstructions(input), + Eq(MakeInstruction(SpvOpEntryPoint, {GetParam().get_execution_value(), 1}, + MakeVector(GetParam().entry_point_name)))); +} + +// clang-format off +#define CASE(NAME) SpvExecutionModel##NAME, #NAME +INSTANTIATE_TEST_CASE_P(TextToBinaryEntryPoint, OpEntryPointTest, + ValuesIn(std::vector{ + { CASE(Vertex), "" }, + { CASE(TessellationControl), "my tess" }, + { CASE(TessellationEvaluation), "really fancy" }, + { CASE(Geometry), "Euclid" }, + { CASE(Fragment), "FAT32" }, + { CASE(GLCompute), "cubic" }, + { CASE(Kernel), "Sanders" }, + }),); +#undef CASE +// clang-format on + +TEST_F(OpEntryPointTest, WrongModel) { + EXPECT_THAT(CompileFailure("OpEntryPoint xxyyzz %1 \"fun\""), + Eq("Invalid execution model 'xxyyzz'.")); +} + +// Test OpExecutionMode +using OpExecutionModeTest = spvtest::TextToBinaryTestBase< + TestWithParam>>>; + +TEST_P(OpExecutionModeTest, AnyExecutionMode) { + // This string should assemble, but should not validate. + std::stringstream input; + input << "OpExecutionMode %1 " << get<1>(GetParam()).name(); + for (auto operand : get<1>(GetParam()).operands()) input << " " << operand; + EXPECT_THAT( + CompiledInstructions(input.str(), get<0>(GetParam())), + Eq(MakeInstruction(SpvOpExecutionMode, {1, get<1>(GetParam()).value()}, + get<1>(GetParam()).operands()))); +} + +#define CASE(NAME) SpvExecutionMode##NAME, #NAME +INSTANTIATE_TEST_CASE_P( + TextToBinaryExecutionMode, OpExecutionModeTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector>{ + // The operand literal values are arbitrarily chosen, + // but there are the right number of them. + {CASE(Invocations), {101}}, + {CASE(SpacingEqual), {}}, + {CASE(SpacingFractionalEven), {}}, + {CASE(SpacingFractionalOdd), {}}, + {CASE(VertexOrderCw), {}}, + {CASE(VertexOrderCcw), {}}, + {CASE(PixelCenterInteger), {}}, + {CASE(OriginUpperLeft), {}}, + {CASE(OriginLowerLeft), {}}, + {CASE(EarlyFragmentTests), {}}, + {CASE(PointMode), {}}, + {CASE(Xfb), {}}, + {CASE(DepthReplacing), {}}, + {CASE(DepthGreater), {}}, + {CASE(DepthLess), {}}, + {CASE(DepthUnchanged), {}}, + {CASE(LocalSize), {64, 1, 2}}, + {CASE(LocalSizeHint), {8, 2, 4}}, + {CASE(InputPoints), {}}, + {CASE(InputLines), {}}, + {CASE(InputLinesAdjacency), {}}, + {CASE(Triangles), {}}, + {CASE(InputTrianglesAdjacency), {}}, + {CASE(Quads), {}}, + {CASE(Isolines), {}}, + {CASE(OutputVertices), {21}}, + {CASE(OutputPoints), {}}, + {CASE(OutputLineStrip), {}}, + {CASE(OutputTriangleStrip), {}}, + {CASE(VecTypeHint), {96}}, + {CASE(ContractionOff), {}}, + })), ); + +INSTANTIATE_TEST_CASE_P( + TextToBinaryExecutionModeV11, OpExecutionModeTest, + Combine(Values(SPV_ENV_UNIVERSAL_1_1), + ValuesIn(std::vector>{ + {CASE(Initializer)}, + {CASE(Finalizer)}, + {CASE(SubgroupSize), {12}}, + {CASE(SubgroupsPerWorkgroup), {64}}})), ); +#undef CASE + +TEST_F(OpExecutionModeTest, WrongMode) { + EXPECT_THAT(CompileFailure("OpExecutionMode %1 xxyyzz"), + Eq("Invalid execution mode 'xxyyzz'.")); +} + +TEST_F(OpExecutionModeTest, TooManyModes) { + EXPECT_THAT(CompileFailure("OpExecutionMode %1 Xfb PointMode"), + Eq("Expected or at the beginning of an " + "instruction, found 'PointMode'.")); +} + +// Test OpCapability + +using OpCapabilityTest = + spvtest::TextToBinaryTestBase>>; + +TEST_P(OpCapabilityTest, AnyCapability) { + const std::string input = "OpCapability " + GetParam().name(); + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpCapability, {GetParam().value()}))); +} + +// clang-format off +#define CASE(NAME) { SpvCapability##NAME, #NAME } +INSTANTIATE_TEST_CASE_P(TextToBinaryCapability, OpCapabilityTest, + ValuesIn(std::vector>{ + CASE(Matrix), + CASE(Shader), + CASE(Geometry), + CASE(Tessellation), + CASE(Addresses), + CASE(Linkage), + CASE(Kernel), + CASE(Vector16), + CASE(Float16Buffer), + CASE(Float16), + CASE(Float64), + CASE(Int64), + CASE(Int64Atomics), + CASE(ImageBasic), + CASE(ImageReadWrite), + CASE(ImageMipmap), + // Value 16 intentionally missing + CASE(Pipes), + CASE(Groups), + CASE(DeviceEnqueue), + CASE(LiteralSampler), + CASE(AtomicStorage), + CASE(Int16), + CASE(TessellationPointSize), + CASE(GeometryPointSize), + CASE(ImageGatherExtended), + // Value 26 intentionally missing + CASE(StorageImageMultisample), + CASE(UniformBufferArrayDynamicIndexing), + CASE(SampledImageArrayDynamicIndexing), + CASE(StorageBufferArrayDynamicIndexing), + CASE(StorageImageArrayDynamicIndexing), + CASE(ClipDistance), + CASE(CullDistance), + CASE(ImageCubeArray), + CASE(SampleRateShading), + CASE(ImageRect), + CASE(SampledRect), + CASE(GenericPointer), + CASE(Int8), + CASE(InputAttachment), + CASE(SparseResidency), + CASE(MinLod), + CASE(Sampled1D), + CASE(Image1D), + CASE(SampledCubeArray), + CASE(SampledBuffer), + CASE(ImageBuffer), + CASE(ImageMSArray), + CASE(StorageImageExtendedFormats), + CASE(ImageQuery), + CASE(DerivativeControl), + CASE(InterpolationFunction), + CASE(TransformFeedback), + }),); +#undef CASE +// clang-format on + +using TextToBinaryCapability = spvtest::TextToBinaryTest; + +TEST_F(TextToBinaryCapability, BadMissingCapability) { + EXPECT_THAT(CompileFailure("OpCapability"), + Eq("Expected operand, found end of stream.")); +} + +TEST_F(TextToBinaryCapability, BadInvalidCapability) { + EXPECT_THAT(CompileFailure("OpCapability 123"), + Eq("Invalid capability '123'.")); +} + +// TODO(dneto): OpExecutionMode + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.pipe_storage_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.pipe_storage_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.pipe_storage_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.pipe_storage_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,121 @@ +// Copyright (c) 2016 Google 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. + +#include "gmock/gmock.h" +#include "test_fixture.h" + +namespace { + +using ::spvtest::MakeInstruction; +using ::testing::Eq; + +using OpTypePipeStorageTest = spvtest::TextToBinaryTest; + +TEST_F(OpTypePipeStorageTest, OpcodeUnrecognizedInV10) { + EXPECT_THAT(CompileFailure("%res = OpTypePipeStorage", SPV_ENV_UNIVERSAL_1_0), + Eq("Invalid Opcode name 'OpTypePipeStorage'")); +} + +TEST_F(OpTypePipeStorageTest, ArgumentCount) { + EXPECT_THAT( + CompileFailure("OpTypePipeStorage", SPV_ENV_UNIVERSAL_1_1), + Eq("Expected at the beginning of an instruction, found " + "'OpTypePipeStorage'.")); + EXPECT_THAT( + CompiledInstructions("%res = OpTypePipeStorage", SPV_ENV_UNIVERSAL_1_1), + Eq(MakeInstruction(SpvOpTypePipeStorage, {1}))); + EXPECT_THAT(CompileFailure("%res = OpTypePipeStorage %1 %2 %3 %4 %5", + SPV_ENV_UNIVERSAL_1_1), + Eq("'=' expected after result id.")); +} + +using OpConstantPipeStorageTest = spvtest::TextToBinaryTest; + +TEST_F(OpConstantPipeStorageTest, OpcodeUnrecognizedInV10) { + EXPECT_THAT(CompileFailure("%1 = OpConstantPipeStorage %2 3 4 5", + SPV_ENV_UNIVERSAL_1_0), + Eq("Invalid Opcode name 'OpConstantPipeStorage'")); +} + +TEST_F(OpConstantPipeStorageTest, ArgumentCount) { + EXPECT_THAT( + CompileFailure("OpConstantPipeStorage", SPV_ENV_UNIVERSAL_1_1), + Eq("Expected at the beginning of an instruction, found " + "'OpConstantPipeStorage'.")); + EXPECT_THAT( + CompileFailure("%1 = OpConstantPipeStorage", SPV_ENV_UNIVERSAL_1_1), + Eq("Expected operand, found end of stream.")); + EXPECT_THAT(CompileFailure("%1 = OpConstantPipeStorage %2 3 4", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected operand, found end of stream.")); + EXPECT_THAT(CompiledInstructions("%1 = OpConstantPipeStorage %2 3 4 5", + SPV_ENV_UNIVERSAL_1_1), + Eq(MakeInstruction(SpvOpConstantPipeStorage, {1, 2, 3, 4, 5}))); + EXPECT_THAT(CompileFailure("%1 = OpConstantPipeStorage %2 3 4 5 %6 %7", + SPV_ENV_UNIVERSAL_1_1), + Eq("'=' expected after result id.")); +} + +TEST_F(OpConstantPipeStorageTest, ArgumentTypes) { + EXPECT_THAT(CompileFailure("%1 = OpConstantPipeStorage %2 %3 4 5", + SPV_ENV_UNIVERSAL_1_1), + Eq("Invalid unsigned integer literal: %3")); + EXPECT_THAT(CompileFailure("%1 = OpConstantPipeStorage %2 3 %4 5", + SPV_ENV_UNIVERSAL_1_1), + Eq("Invalid unsigned integer literal: %4")); + EXPECT_THAT(CompileFailure("%1 = OpConstantPipeStorage 2 3 4 5", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected id to start with %.")); + EXPECT_THAT(CompileFailure("%1 = OpConstantPipeStorage %2 3 4 \"ab\"", + SPV_ENV_UNIVERSAL_1_1), + Eq("Invalid unsigned integer literal: \"ab\"")); +} + +using OpCreatePipeFromPipeStorageTest = spvtest::TextToBinaryTest; + +TEST_F(OpCreatePipeFromPipeStorageTest, OpcodeUnrecognizedInV10) { + EXPECT_THAT(CompileFailure("%1 = OpCreatePipeFromPipeStorage %2 %3", + SPV_ENV_UNIVERSAL_1_0), + Eq("Invalid Opcode name 'OpCreatePipeFromPipeStorage'")); +} + +TEST_F(OpCreatePipeFromPipeStorageTest, ArgumentCount) { + EXPECT_THAT( + CompileFailure("OpCreatePipeFromPipeStorage", SPV_ENV_UNIVERSAL_1_1), + Eq("Expected at the beginning of an instruction, found " + "'OpCreatePipeFromPipeStorage'.")); + EXPECT_THAT( + CompileFailure("%1 = OpCreatePipeFromPipeStorage", SPV_ENV_UNIVERSAL_1_1), + Eq("Expected operand, found end of stream.")); + EXPECT_THAT(CompileFailure("%1 = OpCreatePipeFromPipeStorage %2 OpNop", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected operand, found next instruction instead.")); + EXPECT_THAT(CompiledInstructions("%1 = OpCreatePipeFromPipeStorage %2 %3", + SPV_ENV_UNIVERSAL_1_1), + Eq(MakeInstruction(SpvOpCreatePipeFromPipeStorage, {1, 2, 3}))); + EXPECT_THAT(CompileFailure("%1 = OpCreatePipeFromPipeStorage %2 %3 %4 %5", + SPV_ENV_UNIVERSAL_1_1), + Eq("'=' expected after result id.")); +} + +TEST_F(OpCreatePipeFromPipeStorageTest, ArgumentTypes) { + EXPECT_THAT(CompileFailure("%1 = OpCreatePipeFromPipeStorage \"\" %3", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected id to start with %.")); + EXPECT_THAT(CompileFailure("%1 = OpCreatePipeFromPipeStorage %2 3", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected id to start with %.")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.reserved_sampling_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.reserved_sampling_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.reserved_sampling_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.reserved_sampling_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,57 @@ +// Copyright (c) 2017 Google 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. + +// Validation tests for illegal instructions + +#include "unit_spirv.h" + +#include "gmock/gmock.h" +#include "test_fixture.h" + +namespace { + +using ::testing::Eq; + +using ReservedSamplingInstTest = spvtest::TextToBinaryTest; + +TEST_F(ReservedSamplingInstTest, OpImageSparseSampleProjImplicitLod) { + const std::string input = "OpImageSparseSampleProjImplicitLod %1 %2 %3\n"; + EXPECT_THAT(CompileFailure(input), + Eq("Invalid Opcode name 'OpImageSparseSampleProjImplicitLod'")); +} + +TEST_F(ReservedSamplingInstTest, OpImageSparseSampleProjExplicitLod) { + const std::string input = + "OpImageSparseSampleProjExplicitLod %1 %2 %3 Lod %4\n"; + EXPECT_THAT(CompileFailure(input), + Eq("Invalid Opcode name 'OpImageSparseSampleProjExplicitLod'")); +} + +TEST_F(ReservedSamplingInstTest, OpImageSparseSampleProjDrefImplicitLod) { + const std::string input = + "OpImageSparseSampleProjDrefImplicitLod %1 %2 %3 %4\n"; + EXPECT_THAT( + CompileFailure(input), + Eq("Invalid Opcode name 'OpImageSparseSampleProjDrefImplicitLod'")); +} + +TEST_F(ReservedSamplingInstTest, OpImageSparseSampleProjDrefExplicitLod) { + const std::string input = + "OpImageSparseSampleProjDrefExplicitLod %1 %2 %3 %4 Lod %5\n"; + EXPECT_THAT( + CompileFailure(input), + Eq("Invalid Opcode name 'OpImageSparseSampleProjDrefExplicitLod'")); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.subgroup_dispatch_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.subgroup_dispatch_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.subgroup_dispatch_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.subgroup_dispatch_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,117 @@ +// Copyright (c) 2016 Google 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. + +// Assembler tests for instructions in the "Barrier Instructions" section +// of the SPIR-V spec. + +#include "unit_spirv.h" + +#include "gmock/gmock.h" +#include "test_fixture.h" + +namespace { + +using ::spvtest::MakeInstruction; +using std::vector; +using ::testing::Eq; + +using OpGetKernelLocalSizeForSubgroupCountTest = spvtest::TextToBinaryTest; + +TEST_F(OpGetKernelLocalSizeForSubgroupCountTest, OpcodeUnrecognizedInV10) { + EXPECT_THAT( + CompileFailure("%res = OpGetKernelLocalSizeForSubgroupCount %type " + "%sgcount %invoke %param %param_size %param_align", + SPV_ENV_UNIVERSAL_1_0), + Eq("Invalid Opcode name 'OpGetKernelLocalSizeForSubgroupCount'")); +} + +TEST_F(OpGetKernelLocalSizeForSubgroupCountTest, ArgumentCount) { + EXPECT_THAT(CompileFailure("OpGetKernelLocalSizeForSubgroupCount", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected at the beginning of an instruction, " + "found 'OpGetKernelLocalSizeForSubgroupCount'.")); + EXPECT_THAT(CompileFailure("%res = OpGetKernelLocalSizeForSubgroupCount", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected operand, found end of stream.")); + EXPECT_THAT( + CompileFailure("%1 = OpGetKernelLocalSizeForSubgroupCount %2 %3 %4 %5 %6", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected operand, found end of stream.")); + EXPECT_THAT( + CompiledInstructions("%res = OpGetKernelLocalSizeForSubgroupCount %type " + "%sgcount %invoke %param %param_size %param_align", + SPV_ENV_UNIVERSAL_1_1), + Eq(MakeInstruction(SpvOpGetKernelLocalSizeForSubgroupCount, + {1, 2, 3, 4, 5, 6, 7}))); + EXPECT_THAT( + CompileFailure("%res = OpGetKernelLocalSizeForSubgroupCount %type " + "%sgcount %invoke %param %param_size %param_align %extra", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected '=', found end of stream.")); +} + +TEST_F(OpGetKernelLocalSizeForSubgroupCountTest, ArgumentTypes) { + EXPECT_THAT(CompileFailure( + "%1 = OpGetKernelLocalSizeForSubgroupCount 2 %3 %4 %5 %6 %7", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected id to start with %.")); + EXPECT_THAT( + CompileFailure( + "%1 = OpGetKernelLocalSizeForSubgroupCount %2 %3 %4 %5 %6 \"abc\"", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected id to start with %.")); +} + +using OpGetKernelMaxNumSubgroupsTest = spvtest::TextToBinaryTest; + +TEST_F(OpGetKernelMaxNumSubgroupsTest, OpcodeUnrecognizedInV10) { + EXPECT_THAT(CompileFailure("%res = OpGetKernelLocalSizeForSubgroupCount " + "%type %invoke %param %param_size %param_align", + SPV_ENV_UNIVERSAL_1_0), + Eq("Invalid Opcode name 'OpGetKernelLocalSizeForSubgroupCount'")); +} + +TEST_F(OpGetKernelMaxNumSubgroupsTest, ArgumentCount) { + EXPECT_THAT( + CompileFailure("OpGetKernelMaxNumSubgroups", SPV_ENV_UNIVERSAL_1_1), + Eq("Expected at the beginning of an instruction, found " + "'OpGetKernelMaxNumSubgroups'.")); + EXPECT_THAT(CompileFailure("%res = OpGetKernelMaxNumSubgroups", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected operand, found end of stream.")); + EXPECT_THAT(CompileFailure("%1 = OpGetKernelMaxNumSubgroups %2 %3 %4 %5", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected operand, found end of stream.")); + EXPECT_THAT( + CompiledInstructions("%res = OpGetKernelMaxNumSubgroups %type " + "%invoke %param %param_size %param_align", + SPV_ENV_UNIVERSAL_1_1), + Eq(MakeInstruction(SpvOpGetKernelMaxNumSubgroups, {1, 2, 3, 4, 5, 6}))); + EXPECT_THAT(CompileFailure("%res = OpGetKernelMaxNumSubgroups %type %invoke " + "%param %param_size %param_align %extra", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected '=', found end of stream.")); +} + +TEST_F(OpGetKernelMaxNumSubgroupsTest, ArgumentTypes) { + EXPECT_THAT(CompileFailure("%1 = OpGetKernelMaxNumSubgroups 2 %3 %4 %5 %6", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected id to start with %.")); + EXPECT_THAT( + CompileFailure("%1 = OpGetKernelMaxNumSubgroups %2 %3 %4 %5 \"abc\"", + SPV_ENV_UNIVERSAL_1_1), + Eq("Expected id to start with %.")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,269 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include +#include + +#include "gmock/gmock.h" + +#include "source/spirv_constant.h" +#include "source/util/bitutils.h" +#include "source/util/hex_float.h" +#include "test_fixture.h" +#include "unit_spirv.h" + +namespace { + +using libspirv::AssemblyContext; +using libspirv::AssemblyGrammar; +using spvtest::AutoText; +using spvtest::Concatenate; +using spvtest::MakeInstruction; +using spvtest::ScopedContext; +using spvtest::TextToBinaryTest; +using testing::Eq; +using testing::IsNull; +using testing::NotNull; + +// An mask parsing test case. +struct MaskCase { + spv_operand_type_t which_enum; + uint32_t expected_value; + const char* expression; +}; + +using GoodMaskParseTest = ::testing::TestWithParam; + +TEST_P(GoodMaskParseTest, GoodMaskExpressions) { + spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_0); + + uint32_t value; + EXPECT_EQ(SPV_SUCCESS, + AssemblyGrammar(context).parseMaskOperand( + GetParam().which_enum, GetParam().expression, &value)); + EXPECT_EQ(GetParam().expected_value, value); + + spvContextDestroy(context); +} + +INSTANTIATE_TEST_CASE_P( + ParseMask, GoodMaskParseTest, + ::testing::ValuesIn(std::vector{ + {SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, 0, "None"}, + {SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, 1, "NotNaN"}, + {SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, 2, "NotInf"}, + {SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, 3, "NotNaN|NotInf"}, + // Mask experssions are symmetric. + {SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, 3, "NotInf|NotNaN"}, + // Repeating a value has no effect. + {SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, 3, "NotInf|NotNaN|NotInf"}, + // Using 3 operands still works. + {SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, 0x13, "NotInf|NotNaN|Fast"}, + {SPV_OPERAND_TYPE_SELECTION_CONTROL, 0, "None"}, + {SPV_OPERAND_TYPE_SELECTION_CONTROL, 1, "Flatten"}, + {SPV_OPERAND_TYPE_SELECTION_CONTROL, 2, "DontFlatten"}, + // Weirdly, you can specify to flatten and don't flatten a selection. + {SPV_OPERAND_TYPE_SELECTION_CONTROL, 3, "Flatten|DontFlatten"}, + {SPV_OPERAND_TYPE_LOOP_CONTROL, 0, "None"}, + {SPV_OPERAND_TYPE_LOOP_CONTROL, 1, "Unroll"}, + {SPV_OPERAND_TYPE_LOOP_CONTROL, 2, "DontUnroll"}, + // Weirdly, you can specify to unroll and don't unroll a loop. + {SPV_OPERAND_TYPE_LOOP_CONTROL, 3, "Unroll|DontUnroll"}, + {SPV_OPERAND_TYPE_FUNCTION_CONTROL, 0, "None"}, + {SPV_OPERAND_TYPE_FUNCTION_CONTROL, 1, "Inline"}, + {SPV_OPERAND_TYPE_FUNCTION_CONTROL, 2, "DontInline"}, + {SPV_OPERAND_TYPE_FUNCTION_CONTROL, 4, "Pure"}, + {SPV_OPERAND_TYPE_FUNCTION_CONTROL, 8, "Const"}, + {SPV_OPERAND_TYPE_FUNCTION_CONTROL, 0xd, "Inline|Const|Pure"}, + }), ); + +using BadFPFastMathMaskParseTest = ::testing::TestWithParam; + +TEST_P(BadFPFastMathMaskParseTest, BadMaskExpressions) { + spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_0); + + uint32_t value; + EXPECT_NE(SPV_SUCCESS, + AssemblyGrammar(context).parseMaskOperand( + SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, GetParam(), &value)); + + spvContextDestroy(context); +} + +INSTANTIATE_TEST_CASE_P(ParseMask, BadFPFastMathMaskParseTest, + ::testing::ValuesIn(std::vector{ + nullptr, "", "NotValidEnum", "|", "NotInf|", + "|NotInf", "NotInf||NotNaN", + "Unroll" // A good word, but for the wrong enum + }), ); + +TEST_F(TextToBinaryTest, InvalidText) { + ASSERT_EQ(SPV_ERROR_INVALID_TEXT, + spvTextToBinary(ScopedContext().context, nullptr, 0, &binary, + &diagnostic)); + EXPECT_NE(nullptr, diagnostic); + EXPECT_THAT(diagnostic->error, Eq(std::string("Missing assembly text."))); +} + +TEST_F(TextToBinaryTest, InvalidPointer) { + SetText( + "OpEntryPoint Kernel 0 \"\"\nOpExecutionMode 0 LocalSizeHint 1 1 1\n"); + ASSERT_EQ(SPV_ERROR_INVALID_POINTER, + spvTextToBinary(ScopedContext().context, text.str, text.length, + nullptr, &diagnostic)); +} + +TEST_F(TextToBinaryTest, InvalidPrefix) { + EXPECT_EQ( + "Expected or at the beginning of an instruction, " + "found 'Invalid'.", + CompileFailure("Invalid")); +} + +TEST_F(TextToBinaryTest, EmptyAssemblyString) { + // An empty assembly module is valid! + // It should produce a valid module with zero instructions. + EXPECT_THAT(CompiledInstructions(""), Eq(std::vector{})); +} + +TEST_F(TextToBinaryTest, StringSpace) { + const std::string code = ("OpSourceExtension \"string with spaces\"\n"); + EXPECT_EQ(code, EncodeAndDecodeSuccessfully(code)); +} + +TEST_F(TextToBinaryTest, UnknownBeginningOfInstruction) { + EXPECT_EQ( + "Expected or at the beginning of an instruction, " + "found 'Google'.", + CompileFailure( + "\nOpSource OpenCL_C 12\nOpMemoryModel Physical64 OpenCL\nGoogle\n")); + EXPECT_EQ(4u, diagnostic->position.line + 1); + EXPECT_EQ(1u, diagnostic->position.column + 1); +} + +TEST_F(TextToBinaryTest, NoEqualSign) { + EXPECT_EQ("Expected '=', found end of stream.", + CompileFailure("\nOpSource OpenCL_C 12\n" + "OpMemoryModel Physical64 OpenCL\n%2\n")); + EXPECT_EQ(5u, diagnostic->position.line + 1); + EXPECT_EQ(1u, diagnostic->position.column + 1); +} + +TEST_F(TextToBinaryTest, NoOpCode) { + EXPECT_EQ("Expected opcode, found end of stream.", + CompileFailure("\nOpSource OpenCL_C 12\n" + "OpMemoryModel Physical64 OpenCL\n%2 =\n")); + EXPECT_EQ(5u, diagnostic->position.line + 1); + EXPECT_EQ(1u, diagnostic->position.column + 1); +} + +TEST_F(TextToBinaryTest, WrongOpCode) { + EXPECT_EQ("Invalid Opcode prefix 'Wahahaha'.", + CompileFailure("\nOpSource OpenCL_C 12\n" + "OpMemoryModel Physical64 OpenCL\n%2 = Wahahaha\n")); + EXPECT_EQ(4u, diagnostic->position.line + 1); + EXPECT_EQ(6u, diagnostic->position.column + 1); +} + +TEST_F(TextToBinaryTest, CRLF) { + const std::string input = + "%i32 = OpTypeInt 32 1\r\n%c = OpConstant %i32 123\r\n"; + EXPECT_THAT(CompiledInstructions(input), + Eq(Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 123})}))); +} + +using TextToBinaryFloatValueTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>>; + +TEST_P(TextToBinaryFloatValueTest, Samples) { + const std::string input = + "%1 = OpTypeFloat 32\n%2 = OpConstant %1 " + GetParam().first; + EXPECT_THAT(CompiledInstructions(input), + Eq(Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), + MakeInstruction(SpvOpConstant, + {1, 2, GetParam().second})}))); +} + +INSTANTIATE_TEST_CASE_P( + FloatValues, TextToBinaryFloatValueTest, + ::testing::ValuesIn(std::vector>{ + {"0.0", 0x00000000}, // +0 + {"!0x00000001", 0x00000001}, // +denorm + {"!0x00800000", 0x00800000}, // +norm + {"1.5", 0x3fc00000}, + {"!0x7f800000", 0x7f800000}, // +inf + {"!0x7f800001", 0x7f800001}, // NaN + + {"-0.0", 0x80000000}, // -0 + {"!0x80000001", 0x80000001}, // -denorm + {"!0x80800000", 0x80800000}, // -norm + {"-2.5", 0xc0200000}, + {"!0xff800000", 0xff800000}, // -inf + {"!0xff800001", 0xff800001}, // NaN + }), ); + +using TextToBinaryHalfValueTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>>; + +TEST_P(TextToBinaryHalfValueTest, Samples) { + const std::string input = + "%1 = OpTypeFloat 16\n%2 = OpConstant %1 " + GetParam().first; + EXPECT_THAT(CompiledInstructions(input), + Eq(Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 16}), + MakeInstruction(SpvOpConstant, + {1, 2, GetParam().second})}))); +} + +INSTANTIATE_TEST_CASE_P( + HalfValues, TextToBinaryHalfValueTest, + ::testing::ValuesIn(std::vector>{ + {"0.0", 0x00000000}, + {"1.0", 0x00003c00}, + {"1.000844", 0x00003c00}, // Truncate to 1.0 + {"1.000977", 0x00003c01}, // Don't have to truncate + {"1.001465", 0x00003c01}, // Truncate to 1.0000977 + {"1.5", 0x00003e00}, + {"-1.0", 0x0000bc00}, + {"2.0", 0x00004000}, + {"-2.0", 0x0000c000}, + {"0x1p1", 0x00004000}, + {"-0x1p1", 0x0000c000}, + {"0x1.8p1", 0x00004200}, + {"0x1.8p4", 0x00004e00}, + {"0x1.801p4", 0x00004e00}, + {"0x1.804p4", 0x00004e01}, + }), ); + +TEST(CreateContext, InvalidEnvironment) { + spv_target_env env; + std::memset(&env, 99, sizeof(env)); + EXPECT_THAT(spvContextCreate(env), IsNull()); +} + +TEST(CreateContext, UniversalEnvironment) { + auto c = spvContextCreate(SPV_ENV_UNIVERSAL_1_0); + EXPECT_THAT(c, NotNull()); + spvContextDestroy(c); +} + +TEST(CreateContext, VulkanEnvironment) { + auto c = spvContextCreate(SPV_ENV_VULKAN_1_0); + EXPECT_THAT(c, NotNull()); + spvContextDestroy(c); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.type_declaration_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.type_declaration_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_to_binary.type_declaration_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_to_binary.type_declaration_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,286 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Assembler tests for instructions in the "Type-Declaration" section of the +// SPIR-V spec. + +#include "unit_spirv.h" + +#include "gmock/gmock.h" +#include "test_fixture.h" + +namespace { + +using spvtest::EnumCase; +using spvtest::MakeInstruction; +using ::testing::Eq; + +// Test Dim enums via OpTypeImage + +using DimTest = + spvtest::TextToBinaryTestBase<::testing::TestWithParam>>; + +TEST_P(DimTest, AnyDim) { + const std::string input = + "%1 = OpTypeImage %2 " + GetParam().name() + " 2 3 0 4 Rgba8\n"; + EXPECT_THAT( + CompiledInstructions(input), + Eq(MakeInstruction(SpvOpTypeImage, {1, 2, GetParam().value(), 2, 3, 0, 4, + SpvImageFormatRgba8}))); + + // Check the disassembler as well. + EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(input)); +} + +// clang-format off +#define CASE(NAME) {SpvDim##NAME, #NAME} +INSTANTIATE_TEST_CASE_P( + TextToBinaryDim, DimTest, + ::testing::ValuesIn(std::vector>{ + CASE(1D), + CASE(2D), + CASE(3D), + CASE(Cube), + CASE(Rect), + CASE(Buffer), + CASE(SubpassData), + }),); +#undef CASE +// clang-format on + +TEST_F(DimTest, WrongDim) { + EXPECT_THAT(CompileFailure("%i = OpTypeImage %t xxyyzz 1 2 3 4 R8"), + Eq("Invalid dimensionality 'xxyyzz'.")); +} + +// Test ImageFormat enums via OpTypeImage + +using ImageFormatTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>>; + +TEST_P(ImageFormatTest, AnyImageFormatAndNoAccessQualifier) { + const std::string input = + "%1 = OpTypeImage %2 1D 2 3 0 4 " + GetParam().name() + "\n"; + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpTypeImage, {1, 2, SpvDim1D, 2, 3, 0, 4, + GetParam().value()}))); + // Check the disassembler as well. + EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(input)); +} + +// clang-format off +#define CASE(NAME) {SpvImageFormat##NAME, #NAME} +INSTANTIATE_TEST_CASE_P( + TextToBinaryImageFormat, ImageFormatTest, + ::testing::ValuesIn(std::vector>{ + CASE(Unknown), + CASE(Rgba32f), + CASE(Rgba16f), + CASE(R32f), + CASE(Rgba8), + CASE(Rgba8Snorm), + CASE(Rg32f), + CASE(Rg16f), + CASE(R11fG11fB10f), + CASE(R16f), + CASE(Rgba16), + CASE(Rgb10A2), + CASE(Rg16), + CASE(Rg8), + CASE(R16), + CASE(R8), + CASE(Rgba16Snorm), + CASE(Rg16Snorm), + CASE(Rg8Snorm), + CASE(R16Snorm), + CASE(R8Snorm), + CASE(Rgba32i), + CASE(Rgba16i), + CASE(Rgba8i), + CASE(R32i), + CASE(Rg32i), + CASE(Rg16i), + CASE(Rg8i), + CASE(R16i), + CASE(R8i), + CASE(Rgba32ui), + CASE(Rgba16ui), + CASE(Rgba8ui), + CASE(R32ui), + CASE(Rgb10a2ui), + CASE(Rg32ui), + CASE(Rg16ui), + CASE(Rg8ui), + CASE(R16ui), + CASE(R8ui), + }),); +#undef CASE +// clang-format on + +TEST_F(ImageFormatTest, WrongFormat) { + EXPECT_THAT(CompileFailure("%r = OpTypeImage %t 1D 2 3 0 4 xxyyzz"), + Eq("Invalid image format 'xxyyzz'.")); +} + +// Test AccessQualifier enums via OpTypeImage. +using ImageAccessQualifierTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>>; + +TEST_P(ImageAccessQualifierTest, AnyAccessQualifier) { + const std::string input = + "%1 = OpTypeImage %2 1D 2 3 0 4 Rgba8 " + GetParam().name() + "\n"; + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpTypeImage, + {1, 2, SpvDim1D, 2, 3, 0, 4, + SpvImageFormatRgba8, GetParam().value()}))); + // Check the disassembler as well. + EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(input)); +} + +// clang-format off +#define CASE(NAME) {SpvAccessQualifier##NAME, #NAME} +INSTANTIATE_TEST_CASE_P( + AccessQualifier, ImageAccessQualifierTest, + ::testing::ValuesIn(std::vector>{ + CASE(ReadOnly), + CASE(WriteOnly), + CASE(ReadWrite), + }),); +// clang-format on +#undef CASE + +// Test AccessQualifier enums via OpTypePipe. + +using OpTypePipeTest = spvtest::TextToBinaryTestBase< + ::testing::TestWithParam>>; + +TEST_P(OpTypePipeTest, AnyAccessQualifier) { + const std::string input = "%1 = OpTypePipe " + GetParam().name() + "\n"; + EXPECT_THAT(CompiledInstructions(input), + Eq(MakeInstruction(SpvOpTypePipe, {1, GetParam().value()}))); + // Check the disassembler as well. + EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(input)); +} + +// clang-format off +#define CASE(NAME) {SpvAccessQualifier##NAME, #NAME} +INSTANTIATE_TEST_CASE_P( + TextToBinaryTypePipe, OpTypePipeTest, + ::testing::ValuesIn(std::vector>{ + CASE(ReadOnly), + CASE(WriteOnly), + CASE(ReadWrite), + }),); +#undef CASE +// clang-format on + +TEST_F(OpTypePipeTest, WrongAccessQualifier) { + EXPECT_THAT(CompileFailure("%1 = OpTypePipe xxyyzz"), + Eq("Invalid access qualifier 'xxyyzz'.")); +} + +using OpTypeForwardPointerTest = spvtest::TextToBinaryTest; + +#define CASE(storage_class) \ + do { \ + EXPECT_THAT( \ + CompiledInstructions("OpTypeForwardPointer %pt " #storage_class), \ + Eq(MakeInstruction(SpvOpTypeForwardPointer, \ + {1, SpvStorageClass##storage_class}))); \ + } while (0) + +TEST_F(OpTypeForwardPointerTest, ValidStorageClass) { + CASE(UniformConstant); + CASE(Input); + CASE(Uniform); + CASE(Output); + CASE(Workgroup); + CASE(CrossWorkgroup); + CASE(Private); + CASE(Function); + CASE(Generic); + CASE(PushConstant); + CASE(AtomicCounter); + CASE(Image); + CASE(StorageBuffer); +} + +#undef CASE + +TEST_F(OpTypeForwardPointerTest, MissingType) { + EXPECT_THAT(CompileFailure("OpTypeForwardPointer"), + Eq("Expected operand, found end of stream.")); +} + +TEST_F(OpTypeForwardPointerTest, MissingClass) { + EXPECT_THAT(CompileFailure("OpTypeForwardPointer %pt"), + Eq("Expected operand, found end of stream.")); +} + +TEST_F(OpTypeForwardPointerTest, WrongClass) { + EXPECT_THAT(CompileFailure("OpTypeForwardPointer %pt xxyyzz"), + Eq("Invalid storage class 'xxyyzz'.")); +} + +using OpSizeOfTest = spvtest::TextToBinaryTest; + +TEST_F(OpSizeOfTest, OpcodeUnrecognizedInV10) { + EXPECT_THAT(CompileFailure("%1 = OpSizeOf %2 %3", SPV_ENV_UNIVERSAL_1_0), + Eq("Invalid Opcode name 'OpSizeOf'")); +} + +TEST_F(OpSizeOfTest, ArgumentCount) { + EXPECT_THAT( + CompileFailure("OpSizeOf", SPV_ENV_UNIVERSAL_1_1), + Eq("Expected at the beginning of an instruction, found " + "'OpSizeOf'.")); + EXPECT_THAT(CompileFailure("%res = OpSizeOf OpNop", SPV_ENV_UNIVERSAL_1_1), + Eq("Expected operand, found next instruction instead.")); + EXPECT_THAT( + CompiledInstructions("%1 = OpSizeOf %2 %3", SPV_ENV_UNIVERSAL_1_1), + Eq(MakeInstruction(SpvOpSizeOf, {1, 2, 3}))); + EXPECT_THAT( + CompileFailure("%1 = OpSizeOf %2 %3 44 55 ", SPV_ENV_UNIVERSAL_1_1), + Eq("Expected or at the beginning of an instruction, " + "found '44'.")); +} + +TEST_F(OpSizeOfTest, ArgumentTypes) { + EXPECT_THAT(CompileFailure("%1 = OpSizeOf 2 %3", SPV_ENV_UNIVERSAL_1_1), + Eq("Expected id to start with %.")); + EXPECT_THAT(CompileFailure("%1 = OpSizeOf %2 \"abc\"", SPV_ENV_UNIVERSAL_1_1), + Eq("Expected id to start with %.")); +} + +// TODO(dneto): OpTypeVoid +// TODO(dneto): OpTypeBool +// TODO(dneto): OpTypeInt +// TODO(dneto): OpTypeFloat +// TODO(dneto): OpTypeVector +// TODO(dneto): OpTypeMatrix +// TODO(dneto): OpTypeImage +// TODO(dneto): OpTypeSampler +// TODO(dneto): OpTypeSampledImage +// TODO(dneto): OpTypeArray +// TODO(dneto): OpTypeRuntimeArray +// TODO(dneto): OpTypeStruct +// TODO(dneto): OpTypeOpaque +// TODO(dneto): OpTypePointer +// TODO(dneto): OpTypeFunction +// TODO(dneto): OpTypeEvent +// TODO(dneto): OpTypeDeviceEvent +// TODO(dneto): OpTypeReserveId +// TODO(dneto): OpTypeQueue + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_word_get_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_word_get_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/text_word_get_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/text_word_get_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,251 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +namespace { + +using libspirv::AssemblyContext; +using spvtest::AutoText; + +#define TAB "\t" +#define NEWLINE "\n" +#define BACKSLASH R"(\)" +#define QUOTE R"(")" + +TEST(TextWordGet, NullTerminator) { + std::string word; + spv_position_t endPosition = {}; + ASSERT_EQ( + SPV_SUCCESS, + AssemblyContext(AutoText("Word"), nullptr).getWord(&word, &endPosition)); + ASSERT_EQ(4u, endPosition.column); + ASSERT_EQ(0u, endPosition.line); + ASSERT_EQ(4u, endPosition.index); + ASSERT_STREQ("Word", word.c_str()); +} + +TEST(TextWordGet, TabTerminator) { + std::string word; + spv_position_t endPosition = {}; + ASSERT_EQ(SPV_SUCCESS, AssemblyContext(AutoText("Word\t"), nullptr) + .getWord(&word, &endPosition)); + ASSERT_EQ(4u, endPosition.column); + ASSERT_EQ(0u, endPosition.line); + ASSERT_EQ(4u, endPosition.index); + ASSERT_STREQ("Word", word.c_str()); +} + +TEST(TextWordGet, SpaceTerminator) { + std::string word; + spv_position_t endPosition = {}; + ASSERT_EQ( + SPV_SUCCESS, + AssemblyContext(AutoText("Word "), nullptr).getWord(&word, &endPosition)); + ASSERT_EQ(4u, endPosition.column); + ASSERT_EQ(0u, endPosition.line); + ASSERT_EQ(4u, endPosition.index); + ASSERT_STREQ("Word", word.c_str()); +} + +TEST(TextWordGet, SemicolonTerminator) { + std::string word; + spv_position_t endPosition = {}; + ASSERT_EQ( + SPV_SUCCESS, + AssemblyContext(AutoText("Wo;rd"), nullptr).getWord(&word, &endPosition)); + ASSERT_EQ(2u, endPosition.column); + ASSERT_EQ(0u, endPosition.line); + ASSERT_EQ(2u, endPosition.index); + ASSERT_STREQ("Wo", word.c_str()); +} + +TEST(TextWordGet, NoTerminator) { + const std::string full_text = "abcdefghijklmn"; + for (size_t len = 1; len <= full_text.size(); ++len) { + std::string word; + spv_text_t text = {full_text.data(), len}; + spv_position_t endPosition = {}; + ASSERT_EQ(SPV_SUCCESS, + AssemblyContext(&text, nullptr).getWord(&word, &endPosition)); + ASSERT_EQ(0u, endPosition.line); + ASSERT_EQ(len, endPosition.column); + ASSERT_EQ(len, endPosition.index); + ASSERT_EQ(full_text.substr(0, len), word); + } +} + +TEST(TextWordGet, MultipleWords) { + AutoText input("Words in a sentence"); + AssemblyContext data(input, nullptr); + + spv_position_t endPosition = {}; + const char* words[] = {"Words", "in", "a", "sentence"}; + + std::string word; + for (uint32_t wordIndex = 0; wordIndex < 4; ++wordIndex) { + ASSERT_EQ(SPV_SUCCESS, data.getWord(&word, &endPosition)); + ASSERT_EQ(strlen(words[wordIndex]), + endPosition.column - data.position().column); + ASSERT_EQ(0u, endPosition.line); + ASSERT_EQ(strlen(words[wordIndex]), + endPosition.index - data.position().index); + ASSERT_STREQ(words[wordIndex], word.c_str()); + + data.setPosition(endPosition); + if (3 != wordIndex) { + ASSERT_EQ(SPV_SUCCESS, data.advance()); + } else { + ASSERT_EQ(SPV_END_OF_STREAM, data.advance()); + } + } +} + +TEST(TextWordGet, QuotesAreKept) { + AutoText input(R"("quotes" "around words")"); + const char* expected[] = {R"("quotes")", R"("around words")"}; + AssemblyContext data(input, nullptr); + + std::string word; + spv_position_t endPosition = {}; + ASSERT_EQ(SPV_SUCCESS, data.getWord(&word, &endPosition)); + EXPECT_EQ(8u, endPosition.column); + EXPECT_EQ(0u, endPosition.line); + EXPECT_EQ(8u, endPosition.index); + EXPECT_STREQ(expected[0], word.c_str()); + + // Move to the next word. + data.setPosition(endPosition); + data.seekForward(1); + + ASSERT_EQ(SPV_SUCCESS, data.getWord(&word, &endPosition)); + EXPECT_EQ(23u, endPosition.column); + EXPECT_EQ(0u, endPosition.line); + EXPECT_EQ(23u, endPosition.index); + EXPECT_STREQ(expected[1], word.c_str()); +} + +TEST(TextWordGet, QuotesBetweenWordsActLikeGlue) { + AutoText input(R"(quotes" "between words)"); + const char* expected[] = {R"(quotes" "between)", "words"}; + AssemblyContext data(input, nullptr); + + std::string word; + spv_position_t endPosition = {}; + ASSERT_EQ(SPV_SUCCESS, data.getWord(&word, &endPosition)); + EXPECT_EQ(16u, endPosition.column); + EXPECT_EQ(0u, endPosition.line); + EXPECT_EQ(16u, endPosition.index); + EXPECT_STREQ(expected[0], word.c_str()); + + // Move to the next word. + data.setPosition(endPosition); + data.seekForward(1); + + ASSERT_EQ(SPV_SUCCESS, data.getWord(&word, &endPosition)); + EXPECT_EQ(22u, endPosition.column); + EXPECT_EQ(0u, endPosition.line); + EXPECT_EQ(22u, endPosition.index); + EXPECT_STREQ(expected[1], word.c_str()); +} + +TEST(TextWordGet, QuotingWhitespace) { + AutoText input(QUOTE "white " NEWLINE TAB " space" QUOTE); + // Whitespace surrounded by quotes acts like glue. + std::string word; + spv_position_t endPosition = {}; + ASSERT_EQ(SPV_SUCCESS, + AssemblyContext(input, nullptr).getWord(&word, &endPosition)); + EXPECT_EQ(input.str.length(), endPosition.column); + EXPECT_EQ(0u, endPosition.line); + EXPECT_EQ(input.str.length(), endPosition.index); + EXPECT_EQ(input.str, word); +} + +TEST(TextWordGet, QuoteAlone) { + AutoText input(QUOTE); + std::string word; + spv_position_t endPosition = {}; + ASSERT_EQ(SPV_SUCCESS, + AssemblyContext(input, nullptr).getWord(&word, &endPosition)); + ASSERT_EQ(1u, endPosition.column); + ASSERT_EQ(0u, endPosition.line); + ASSERT_EQ(1u, endPosition.index); + ASSERT_STREQ(QUOTE, word.c_str()); +} + +TEST(TextWordGet, EscapeAlone) { + AutoText input(BACKSLASH); + std::string word; + spv_position_t endPosition = {}; + ASSERT_EQ(SPV_SUCCESS, + AssemblyContext(input, nullptr).getWord(&word, &endPosition)); + ASSERT_EQ(1u, endPosition.column); + ASSERT_EQ(0u, endPosition.line); + ASSERT_EQ(1u, endPosition.index); + ASSERT_STREQ(BACKSLASH, word.c_str()); +} + +TEST(TextWordGet, EscapeAtEndOfInput) { + AutoText input("word" BACKSLASH); + std::string word; + spv_position_t endPosition = {}; + ASSERT_EQ(SPV_SUCCESS, + AssemblyContext(input, nullptr).getWord(&word, &endPosition)); + ASSERT_EQ(5u, endPosition.column); + ASSERT_EQ(0u, endPosition.line); + ASSERT_EQ(5u, endPosition.index); + ASSERT_STREQ("word" BACKSLASH, word.c_str()); +} + +TEST(TextWordGet, Escaping) { + AutoText input("w" BACKSLASH QUOTE "o" BACKSLASH NEWLINE "r" BACKSLASH ";d"); + std::string word; + spv_position_t endPosition = {}; + ASSERT_EQ(SPV_SUCCESS, + AssemblyContext(input, nullptr).getWord(&word, &endPosition)); + ASSERT_EQ(10u, endPosition.column); + ASSERT_EQ(0u, endPosition.line); + ASSERT_EQ(10u, endPosition.index); + ASSERT_EQ(input.str, word); +} + +TEST(TextWordGet, EscapingEscape) { + AutoText input("word" BACKSLASH BACKSLASH " abc"); + std::string word; + spv_position_t endPosition = {}; + ASSERT_EQ(SPV_SUCCESS, + AssemblyContext(input, nullptr).getWord(&word, &endPosition)); + ASSERT_EQ(6u, endPosition.column); + ASSERT_EQ(0u, endPosition.line); + ASSERT_EQ(6u, endPosition.index); + ASSERT_STREQ("word" BACKSLASH BACKSLASH, word.c_str()); +} + +TEST(TextWordGet, CRLF) { + AutoText input("abc\r\nd"); + AssemblyContext data(input, nullptr); + std::string word; + spv_position_t pos = {}; + ASSERT_EQ(SPV_SUCCESS, data.getWord(&word, &pos)); + EXPECT_EQ(3u, pos.column); + EXPECT_STREQ("abc", word.c_str()); + data.setPosition(pos); + data.advance(); + ASSERT_EQ(SPV_SUCCESS, data.getWord(&word, &pos)); + EXPECT_EQ(1u, pos.column); + EXPECT_STREQ("d", word.c_str()); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/timer_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/timer_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/timer_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/timer_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,143 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include + +#include "gtest/gtest.h" +#include "source/util/timer.h" + +namespace { + +using ::spvutils::CumulativeTimer; +using ::spvutils::PrintTimerDescription; +using ::spvutils::ScopedTimer; +using ::spvutils::Timer; + +// A mock class to mimic Timer class for a testing purpose. It has fixed +// CPU/WALL/USR/SYS time, RSS delta, and the delta of the number of page faults. +class MockTimer : public Timer { + public: + MockTimer(std::ostream* out, bool measure_mem_usage = false) + : Timer(out, measure_mem_usage) {} + double CPUTime() override { return 0.019123; } + double WallTime() override { return 0.019723; } + double UserTime() override { return 0.012723; } + double SystemTime() override { return 0.002723; } + long RSS() const override { return 360L; } + long PageFault() const override { return 3600L; } +}; + +// This unit test checks whether the actual output of MockTimer::Report() is the +// same as fixed CPU/WALL/USR/SYS time, RSS delta, and the delta of the number +// of page faults that are returned by MockTimer. +TEST(MockTimer, DoNothing) { + std::ostringstream buf; + + PrintTimerDescription(&buf); + MockTimer timer(&buf); + timer.Start(); + + // Do nothing. + + timer.Stop(); + timer.Report("TimerTest"); + + EXPECT_EQ(0.019123, timer.CPUTime()); + EXPECT_EQ(0.019723, timer.WallTime()); + EXPECT_EQ(0.012723, timer.UserTime()); + EXPECT_EQ(0.002723, timer.SystemTime()); + EXPECT_EQ( + " PASS name CPU time WALL time USR time" + " SYS time\n TimerTest 0.02 0.02" + " 0.01 0.00\n", + buf.str()); +} + +// This unit test checks whether the ScopedTimer correctly reports +// the fixed CPU/WALL/USR/SYS time, RSS delta, and the delta of the number of +// page faults that are returned by MockTimer. +TEST(MockTimer, TestScopedTimer) { + std::ostringstream buf; + + { + ScopedTimer scopedtimer(&buf, "ScopedTimerTest"); + // Do nothing. + } + + EXPECT_EQ( + " ScopedTimerTest 0.02 0.02 0.01" + " 0.00\n", + buf.str()); +} + +// A mock class to mimic CumulativeTimer class for a testing purpose. It has +// fixed CPU/WALL/USR/SYS time, RSS delta, and the delta of the number of page +// faults for each measurement (i.e., a pair of Start() and Stop()). If the +// number of measurements increases, it increases |count_stop_| by the number of +// calling Stop() and the amount of each resource usage is proportional to +// |count_stop_|. +class MockCumulativeTimer : public CumulativeTimer { + public: + MockCumulativeTimer(std::ostream* out, bool measure_mem_usage = false) + : CumulativeTimer(out, measure_mem_usage), count_stop_(0) {} + double CPUTime() override { return count_stop_ * 0.019123; } + double WallTime() override { return count_stop_ * 0.019723; } + double UserTime() override { return count_stop_ * 0.012723; } + double SystemTime() override { return count_stop_ * 0.002723; } + long RSS() const override { return count_stop_ * 360L; } + long PageFault() const override { return count_stop_ * 3600L; } + + // Calling Stop() does nothing but just increases |count_stop_| by 1. + void Stop() override { ++count_stop_; }; + + private: + unsigned int count_stop_; +}; + +// This unit test checks whether the MockCumulativeTimer correctly reports the +// cumulative CPU/WALL/USR/SYS time, RSS delta, and the delta of the number of +// page faults whose values are fixed for each measurement (i.e., a pair of +// Start() and Stop()). +TEST(MockCumulativeTimer, DoNothing) { + CumulativeTimer* ctimer; + std::ostringstream buf; + + { + ctimer = new MockCumulativeTimer(&buf); + ctimer->Start(); + + // Do nothing. + + ctimer->Stop(); + } + + { + ctimer->Start(); + + // Do nothing. + + ctimer->Stop(); + ctimer->Report("CumulativeTimerTest"); + } + + EXPECT_EQ( + " CumulativeTimerTest 0.04 0.04 0.03" + " 0.01\n", + buf.str()); + + if (ctimer) delete ctimer; +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/unit_spirv.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/unit_spirv.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/unit_spirv.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/unit_spirv.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,53 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "unit_spirv.h" + +#include "gmock/gmock.h" +#include "test_fixture.h" + +namespace { + +using spvtest::MakeVector; +using ::testing::Eq; +using Words = std::vector; + +TEST(MakeVector, Samples) { + EXPECT_THAT(MakeVector(""), Eq(Words{0})); + EXPECT_THAT(MakeVector("a"), Eq(Words{0x0061})); + EXPECT_THAT(MakeVector("ab"), Eq(Words{0x006261})); + EXPECT_THAT(MakeVector("abc"), Eq(Words{0x00636261})); + EXPECT_THAT(MakeVector("abcd"), Eq(Words{0x64636261, 0x00})); + EXPECT_THAT(MakeVector("abcde"), Eq(Words{0x64636261, 0x0065})); +} + +TEST(WordVectorPrintTo, PreservesFlagsAndFill) { + std::stringstream s; + s << std::setw(4) << std::oct << std::setfill('x') << 8 << " "; + spvtest::PrintTo(spvtest::WordVector({10, 16}), &s); + // The octal setting and fill character should be preserved + // from before the PrintTo. + // Width is reset after each emission of a regular scalar type. + // So set it explicitly again. + s << std::setw(4) << 9; + + EXPECT_THAT(s.str(), Eq("xx10 0x0000000a 0x00000010 xx11")); +} + +TEST_P(RoundTripTest, Sample) { + EXPECT_THAT(EncodeAndDecodeSuccessfully(GetParam()), Eq(GetParam())) + << GetParam(); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/unit_spirv.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/unit_spirv.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/unit_spirv.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/unit_spirv.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,234 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_TEST_UNITSPIRV_H_ +#define LIBSPIRV_TEST_UNITSPIRV_H_ + +#include + +#include +#include + +#include "source/assembly_grammar.h" +#include "source/binary.h" +#include "source/diagnostic.h" +#include "source/enum_set.h" +#include "source/opcode.h" +#include "source/spirv_endian.h" +#include "source/text.h" +#include "source/text_handler.h" +#include "source/validate.h" +#include "spirv-tools/libspirv.h" + +#include + +#ifdef __ANDROID__ +#include +namespace std { +template +std::string to_string(const T& val) { + std::ostringstream os; + os << val; + return os.str(); +} +} // namespace std +#endif + +// Determine endianness & predicate tests on it +enum { + I32_ENDIAN_LITTLE = 0x03020100ul, + I32_ENDIAN_BIG = 0x00010203ul, +}; + +static const union { + unsigned char bytes[4]; + uint32_t value; +} o32_host_order = {{0, 1, 2, 3}}; +#define I32_ENDIAN_HOST (o32_host_order.value) + +// A namespace for utilities used in SPIR-V Tools unit tests. +namespace spvtest { + +class WordVector; + +// Emits the given word vector to the given stream. +// This function can be used by the gtest value printer. +void PrintTo(const WordVector& words, ::std::ostream* os); + +// A proxy class to allow us to easily write out vectors of SPIR-V words. +class WordVector { + public: + explicit WordVector(const std::vector& val) : value_(val) {} + explicit WordVector(const spv_binary_t& binary) + : value_(binary.code, binary.code + binary.wordCount) {} + + // Returns the underlying vector. + const std::vector& value() const { return value_; } + + // Returns the string representation of this word vector. + std::string str() const { + std::ostringstream os; + PrintTo(*this, &os); + return os.str(); + } + + private: + const std::vector value_; +}; + +inline void PrintTo(const WordVector& words, ::std::ostream* os) { + size_t count = 0; + const auto saved_flags = os->flags(); + const auto saved_fill = os->fill(); + for (uint32_t value : words.value()) { + *os << "0x" << std::setw(8) << std::setfill('0') << std::hex << value + << " "; + if (count++ % 8 == 7) { + *os << std::endl; + } + } + os->flags(saved_flags); + os->fill(saved_fill); +} + +// Returns a vector of words representing a single instruction with the +// given opcode and operand words as a vector. +inline std::vector MakeInstruction( + SpvOp opcode, const std::vector& args) { + std::vector result{ + spvOpcodeMake(uint16_t(args.size() + 1), opcode)}; + result.insert(result.end(), args.begin(), args.end()); + return result; +} + +// Returns a vector of words representing a single instruction with the +// given opcode and whose operands are the concatenation of the two given +// argument lists. +inline std::vector MakeInstruction( + SpvOp opcode, std::vector args, + const std::vector& extra_args) { + args.insert(args.end(), extra_args.begin(), extra_args.end()); + return MakeInstruction(opcode, args); +} + +// Returns the vector of words representing the concatenation +// of all input vectors. +inline std::vector Concatenate( + const std::vector>& instructions) { + std::vector result; + for (const auto& instruction : instructions) { + result.insert(result.end(), instruction.begin(), instruction.end()); + } + return result; +} + +// Encodes a string as a sequence of words, using the SPIR-V encoding. +inline std::vector MakeVector(std::string input) { + std::vector result; + uint32_t word = 0; + size_t num_bytes = input.size(); + // SPIR-V strings are null-terminated. The byte_index == num_bytes + // case is used to push the terminating null byte. + for (size_t byte_index = 0; byte_index <= num_bytes; byte_index++) { + const auto new_byte = + (byte_index < num_bytes ? uint8_t(input[byte_index]) : uint8_t(0)); + word |= (new_byte << (8 * (byte_index % sizeof(uint32_t)))); + if (3 == (byte_index % sizeof(uint32_t))) { + result.push_back(word); + word = 0; + } + } + // Emit a trailing partial word. + if ((num_bytes + 1) % sizeof(uint32_t)) { + result.push_back(word); + } + return result; +} + +// A type for easily creating spv_text_t values, with an implicit conversion to +// spv_text. +struct AutoText { + explicit AutoText(const std::string& value) + : str(value), text({str.data(), str.size()}) {} + operator spv_text() { return &text; } + std::string str; + spv_text_t text; +}; + +// An example case for an enumerated value, optionally with operands. +template +class EnumCase { + public: + EnumCase() = default; // Required by ::testing::Combine(). + EnumCase(E val, std::string enum_name, std::vector ops = {}) + : enum_value_(val), name_(enum_name), operands_(ops) {} + // Returns the enum value as a uint32_t. + uint32_t value() const { return static_cast(enum_value_); } + // Returns the name of the enumerant. + const std::string& name() const { return name_; } + // Returns a reference to the operands. + const std::vector& operands() const { return operands_; } + + private: + E enum_value_; + std::string name_; + std::vector operands_; +}; + +// Returns a string with num_4_byte_chars Unicode characters, +// each of which has a 4-byte UTF-8 encoding. +inline std::string MakeLongUTF8String(size_t num_4_byte_chars) { + // An example of a longest valid UTF-8 character. + // Be explicit about the character type because Microsoft compilers can + // otherwise interpret the character string as being over wide (16-bit) + // characters. Ideally, we would just use a C++11 UTF-8 string literal, + // but we want to support older Microsoft compilers. + const std::basic_string earth_africa("\xF0\x9F\x8C\x8D"); + EXPECT_EQ(4u, earth_africa.size()); + + std::string result; + result.reserve(num_4_byte_chars * 4); + for (size_t i = 0; i < num_4_byte_chars; i++) { + result += earth_africa; + } + EXPECT_EQ(4 * num_4_byte_chars, result.size()); + return result; +} + +// Returns a vector of all valid target environment enums. +inline std::vector AllTargetEnvironments() { + return { + SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, + SPV_ENV_OPENCL_1_2, SPV_ENV_OPENCL_EMBEDDED_1_2, + SPV_ENV_OPENCL_2_0, SPV_ENV_OPENCL_EMBEDDED_2_0, + SPV_ENV_OPENCL_2_1, SPV_ENV_OPENCL_EMBEDDED_2_1, + SPV_ENV_OPENCL_2_2, SPV_ENV_OPENCL_EMBEDDED_2_2, + SPV_ENV_VULKAN_1_0, SPV_ENV_OPENGL_4_0, + SPV_ENV_OPENGL_4_1, SPV_ENV_OPENGL_4_2, + SPV_ENV_OPENGL_4_3, SPV_ENV_OPENGL_4_5, + SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3, + SPV_ENV_VULKAN_1_1, + }; +} + +// Returns the capabilities in a CapabilitySet as an ordered vector. +inline std::vector ElementsIn( + const libspirv::CapabilitySet& capabilities) { + std::vector result; + capabilities.ForEach([&result](SpvCapability c) { result.push_back(c); }); + return result; +} + +} // namespace spvtest +#endif // LIBSPIRV_TEST_UNITSPIRV_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/util/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/util/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/util/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/util/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,18 @@ +# Copyright (c) 2017 Google 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. + +add_spvtools_unittest(TARGET util_intrusive_list + SRCS ilist_test.cpp + LIBS SPIRV-Tools-opt +) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/util/ilist_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/util/ilist_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/util/ilist_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/util/ilist_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,322 @@ +// Copyright (c) 2017 Google 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. + +#include + +#include "gmock/gmock.h" + +#include "util/ilist.h" + +namespace { + +using spvtools::utils::IntrusiveList; +using spvtools::utils::IntrusiveNodeBase; +using ::testing::ElementsAre; +using IListTest = ::testing::Test; + +class TestNode : public IntrusiveNodeBase { + public: + TestNode() : IntrusiveNodeBase() {} + int data_; +}; + +class TestList : public IntrusiveList { + public: + TestList() = default; + TestList(TestList&& that) : IntrusiveList(std::move(that)) {} + TestList& operator=(TestList&& that) { + static_cast&>(*this) = + static_cast&&>(that); + return *this; + } +}; + +// This test checks the push_back method, as well as using an iterator to +// traverse the list from begin() to end(). This implicitly test the +// PreviousNode and NextNode functions. +TEST(IListTest, PushBack) { + TestNode nodes[10]; + TestList list; + for (int i = 0; i < 10; i++) { + nodes[i].data_ = i; + list.push_back(&nodes[i]); + } + + std::vector output; + for (auto& i : list) output.push_back(i.data_); + + EXPECT_THAT(output, ElementsAre(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)); +} + +// Returns a list containing the values 0 to n-1 using the first n elements of +// nodes to build the list. +TestList BuildList(TestNode nodes[], int n) { + TestList list; + for (int i = 0; i < n; i++) { + nodes[i].data_ = i; + list.push_back(&nodes[i]); + } + return list; +} + +// Test decrementing begin() +TEST(IListTest, DecrementingBegin) { + TestNode nodes[10]; + TestList list = BuildList(nodes, 10); + EXPECT_EQ(--list.begin(), list.end()); +} + +// Test incrementing end() +TEST(IListTest, IncrementingEnd1) { + TestNode nodes[10]; + TestList list = BuildList(nodes, 10); + EXPECT_EQ((++list.end())->data_, 0); +} + +// Test incrementing end() should equal begin() +TEST(IListTest, IncrementingEnd2) { + TestNode nodes[10]; + TestList list = BuildList(nodes, 10); + EXPECT_EQ(++list.end(), list.begin()); +} + +// Test decrementing end() +TEST(IListTest, DecrementingEnd) { + TestNode nodes[10]; + TestList list = BuildList(nodes, 10); + EXPECT_EQ((--list.end())->data_, 9); +} + +// Test the move constructor for the list class. +TEST(IListTest, MoveConstructor) { + TestNode nodes[10]; + TestList list = BuildList(nodes, 10); + std::vector output; + for (auto& i : list) output.push_back(i.data_); + + EXPECT_THAT(output, ElementsAre(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)); +} + +// Using a const list so we can test the const_iterator. +TEST(IListTest, ConstIterator) { + TestNode nodes[10]; + const TestList list = BuildList(nodes, 10); + std::vector output; + for (auto& i : list) output.push_back(i.data_); + + EXPECT_THAT(output, ElementsAre(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)); +} + +// Uses the move assignement instead of the move constructor. +TEST(IListTest, MoveAssignment) { + TestNode nodes[10]; + TestList list; + list = BuildList(nodes, 10); + std::vector output; + for (auto& i : list) output.push_back(i.data_); + + EXPECT_THAT(output, ElementsAre(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)); +} + +// Test inserting a new element at the end of a list using the IntrusiveNodeBase +// "InsertAfter" function. +TEST(IListTest, InsertAfter1) { + TestNode nodes[10]; + TestList list = BuildList(nodes, 5); + + nodes[5].data_ = 5; + nodes[5].InsertAfter(&nodes[4]); + + std::vector output; + for (auto& i : list) output.push_back(i.data_); + + EXPECT_THAT(output, ElementsAre(0, 1, 2, 3, 4, 5)); +} + +// Test inserting a new element in the middle of a list using the +// IntrusiveNodeBase "InsertAfter" function. +TEST(IListTest, InsertAfter2) { + TestNode nodes[10]; + TestList list = BuildList(nodes, 5); + + nodes[5].data_ = 5; + nodes[5].InsertAfter(&nodes[2]); + + std::vector output; + for (auto& i : list) output.push_back(i.data_); + + EXPECT_THAT(output, ElementsAre(0, 1, 2, 5, 3, 4)); +} + +// Test moving an element already in the list in the middle of a list using the +// IntrusiveNodeBase "InsertAfter" function. +TEST(IListTest, MoveUsingInsertAfter1) { + TestNode nodes[10]; + TestList list = BuildList(nodes, 6); + + nodes[5].InsertAfter(&nodes[2]); + + std::vector output; + for (auto& i : list) output.push_back(i.data_); + + EXPECT_THAT(output, ElementsAre(0, 1, 2, 5, 3, 4)); +} + +// Move the element at the start of the list into the middle. +TEST(IListTest, MoveUsingInsertAfter2) { + TestNode nodes[10]; + TestList list = BuildList(nodes, 6); + + nodes[0].InsertAfter(&nodes[2]); + + std::vector output; + for (auto& i : list) output.push_back(i.data_); + + EXPECT_THAT(output, ElementsAre(1, 2, 0, 3, 4, 5)); +} + +// Move an element in the middle of the list to the end. +TEST(IListTest, MoveUsingInsertAfter3) { + TestNode nodes[10]; + TestList list = BuildList(nodes, 6); + + nodes[2].InsertAfter(&nodes[5]); + + std::vector output; + for (auto& i : list) output.push_back(i.data_); + + EXPECT_THAT(output, ElementsAre(0, 1, 3, 4, 5, 2)); +} + +// Removing an element from the middle of a list. +TEST(IListTest, Remove1) { + TestNode nodes[10]; + TestList list = BuildList(nodes, 6); + + nodes[2].RemoveFromList(); + + std::vector output; + for (auto& i : list) output.push_back(i.data_); + + EXPECT_THAT(output, ElementsAre(0, 1, 3, 4, 5)); +} + +// Removing an element from the beginning of the list. +TEST(IListTest, Remove2) { + TestNode nodes[10]; + TestList list = BuildList(nodes, 6); + + nodes[0].RemoveFromList(); + + std::vector output; + for (auto& i : list) output.push_back(i.data_); + + EXPECT_THAT(output, ElementsAre(1, 2, 3, 4, 5)); +} + +// Removing the last element of a list. +TEST(IListTest, Remove3) { + TestNode nodes[10]; + TestList list = BuildList(nodes, 6); + + nodes[5].RemoveFromList(); + + std::vector output; + for (auto& i : list) output.push_back(i.data_); + + EXPECT_THAT(output, ElementsAre(0, 1, 2, 3, 4)); +} + +// Test that operator== and operator!= work properly for the iterator class. +TEST(IListTest, IteratorEqual) { + TestNode nodes[10]; + TestList list = BuildList(nodes, 6); + + std::vector output; + for (auto i = list.begin(); i != list.end(); ++i) + for (auto j = list.begin(); j != list.end(); ++j) + if (i == j) output.push_back(i->data_); + + EXPECT_THAT(output, ElementsAre(0, 1, 2, 3, 4, 5)); +} + +// Test MoveBefore. Moving into middle of a list. +TEST(IListTest, MoveBefore1) { + TestNode nodes[10]; + TestList list1 = BuildList(nodes, 6); + TestList list2 = BuildList(nodes + 6, 3); + + TestList::iterator insertion_point = list1.begin(); + ++insertion_point; + insertion_point.MoveBefore(&list2); + + std::vector output; + for (auto i = list1.begin(); i != list1.end(); ++i) { + output.push_back(i->data_); + } + + EXPECT_THAT(output, ElementsAre(0, 0, 1, 2, 1, 2, 3, 4, 5)); +} + +// Test MoveBefore. Moving to the start of a list. +TEST(IListTest, MoveBefore2) { + TestNode nodes[10]; + TestList list1 = BuildList(nodes, 6); + TestList list2 = BuildList(nodes + 6, 3); + + TestList::iterator insertion_point = list1.begin(); + insertion_point.MoveBefore(&list2); + + std::vector output; + for (auto i = list1.begin(); i != list1.end(); ++i) { + output.push_back(i->data_); + } + + EXPECT_THAT(output, ElementsAre(0, 1, 2, 0, 1, 2, 3, 4, 5)); +} + +// Test MoveBefore. Moving to the end of a list. +TEST(IListTest, MoveBefore3) { + TestNode nodes[10]; + TestList list1 = BuildList(nodes, 6); + TestList list2 = BuildList(nodes + 6, 3); + + TestList::iterator insertion_point = list1.end(); + insertion_point.MoveBefore(&list2); + + std::vector output; + for (auto i = list1.begin(); i != list1.end(); ++i) { + output.push_back(i->data_); + } + + EXPECT_THAT(output, ElementsAre(0, 1, 2, 3, 4, 5, 0, 1, 2)); +} + +// Test MoveBefore. Moving an empty list. +TEST(IListTest, MoveBefore4) { + TestNode nodes[10]; + TestList list1 = BuildList(nodes, 6); + TestList list2; + + TestList::iterator insertion_point = list1.end(); + insertion_point.MoveBefore(&list2); + + std::vector output; + for (auto i = list1.begin(); i != list1.end(); ++i) { + output.push_back(i->data_); + } + + EXPECT_THAT(output, ElementsAre(0, 1, 2, 3, 4, 5)); +} +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,182 @@ +# Copyright (c) 2016 The Khronos Group Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set(VAL_TEST_COMMON_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/../test_fixture.h + ${CMAKE_CURRENT_SOURCE_DIR}/../unit_spirv.h + ${CMAKE_CURRENT_SOURCE_DIR}/val_fixtures.h +) + + +add_spvtools_unittest(TARGET val_capability + SRCS val_capability_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_cfg + SRCS val_cfg_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_id + SRCS val_id_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_layout + SRCS val_layout_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_ssa + SRCS val_ssa_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_storage + SRCS val_storage_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_state + SRCS val_state_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_data + SRCS val_data_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_type_unique + SRCS val_type_unique_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_arithmetics + SRCS val_arithmetics_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_composites + SRCS val_composites_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_conversion + SRCS val_conversion_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_derivatives + SRCS val_derivatives_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_logicals + SRCS val_logicals_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_bitwise + SRCS val_bitwise_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_builtins + SRCS val_builtins_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_image + SRCS val_image_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_atomics + SRCS val_atomics_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_barriers + SRCS val_barriers_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_primitives + SRCS val_primitives_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_ext_inst + SRCS val_ext_inst_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_limits + SRCS val_limits_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_validation_state + SRCS val_validation_state_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_decoration + SRCS val_decoration_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_literals + SRCS val_literals_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_extensions + SRCS val_extensions_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) + +add_spvtools_unittest(TARGET val_adjacency + SRCS val_adjacency_test.cpp + ${VAL_TEST_COMMON_SRCS} + LIBS ${SPIRV_TOOLS} +) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_adjacency_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_adjacency_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_adjacency_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_adjacency_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,285 @@ +// Copyright (c) 2018 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. + +#include +#include + +#include "gmock/gmock.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using ::testing::HasSubstr; +using ::testing::Not; + +using ValidateAdjacency = spvtest::ValidateBase; + +TEST_F(ValidateAdjacency, OpPhiBeginsModuleFail) { + const std::string module = R"( +%result = OpPhi %bool %true %true_label %false %false_label +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +%void = OpTypeVoid +%bool = OpTypeBool +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%func = OpTypeFunction %void +%main = OpFunction %void None %func +%main_entry = OpLabel +OpBranch %true_label +%true_label = OpLabel +OpBranch %false_label +%false_label = OpLabel +OpBranch %end_label +OpReturn +OpFunctionEnd +)"; + + CompileSuccessfully(module); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("ID 1 has not been defined")); +} + +TEST_F(ValidateAdjacency, OpLoopMergeEndsModuleFail) { + const std::string module = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +%void = OpTypeVoid +%func = OpTypeFunction %void +%main = OpFunction %void None %func +%main_entry = OpLabel +OpBranch %loop +%loop = OpLabel +OpLoopMerge %end %loop None +)"; + + CompileSuccessfully(module); + EXPECT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Missing OpFunctionEnd at end of module")); +} + +TEST_F(ValidateAdjacency, OpSelectionMergeEndsModuleFail) { + const std::string module = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +%void = OpTypeVoid +%func = OpTypeFunction %void +%main = OpFunction %void None %func +%main_entry = OpLabel +OpBranch %merge +%merge = OpLabel +OpSelectionMerge %merge None +)"; + + CompileSuccessfully(module); + EXPECT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Missing OpFunctionEnd at end of module")); +} + +std::string GenerateShaderCode( + const std::string& body, + const std::string& capabilities_and_extensions = "OpCapability Shader", + const std::string& execution_model = "Fragment") { + std::ostringstream ss; + ss << capabilities_and_extensions << "\n"; + ss << "OpMemoryModel Logical GLSL450\n"; + ss << "OpEntryPoint " << execution_model << " %main \"main\"\n"; + + ss << R"( +%string = OpString "" +%void = OpTypeVoid +%bool = OpTypeBool +%int = OpTypeInt 32 0 +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%zero = OpConstant %int 0 +%func = OpTypeFunction %void +%main = OpFunction %void None %func +%main_entry = OpLabel +)"; + + ss << body; + + ss << R"( +OpReturn +OpFunctionEnd)"; + + return ss.str(); +} + +TEST_F(ValidateAdjacency, OpPhiPreceededByOpLabelSuccess) { + const std::string body = R"( +OpSelectionMerge %end_label None +OpBranchConditional %true %true_label %false_label +%true_label = OpLabel +OpBranch %end_label +%false_label = OpLabel +OpBranch %end_label +%end_label = OpLabel +%line = OpLine %string 0 0 +%result = OpPhi %bool %true %true_label %false %false_label +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAdjacency, OpPhiPreceededByOpPhiSuccess) { + const std::string body = R"( +OpSelectionMerge %end_label None +OpBranchConditional %true %true_label %false_label +%true_label = OpLabel +OpBranch %end_label +%false_label = OpLabel +OpBranch %end_label +%end_label = OpLabel +%1 = OpPhi %bool %true %true_label %false %false_label +%2 = OpPhi %bool %true %true_label %false %false_label +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAdjacency, OpPhiPreceededByOpLineSuccess) { + const std::string body = R"( +OpSelectionMerge %end_label None +OpBranchConditional %true %true_label %false_label +%true_label = OpLabel +OpBranch %end_label +%false_label = OpLabel +OpBranch %end_label +%end_label = OpLabel +%line = OpLine %string 0 0 +%result = OpPhi %bool %true %true_label %false %false_label +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAdjacency, OpPhiPreceededByBadOpFail) { + const std::string body = R"( +OpSelectionMerge %end_label None +OpBranchConditional %true %true_label %false_label +%true_label = OpLabel +OpBranch %end_label +%false_label = OpLabel +OpBranch %end_label +%end_label = OpLabel +OpNop +%result = OpPhi %bool %true %true_label %false %false_label +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpPhi must appear before all non-OpPhi instructions")); +} + +TEST_F(ValidateAdjacency, OpLoopMergePreceedsOpBranchSuccess) { + const std::string body = R"( +OpBranch %loop +%loop = OpLabel +OpLoopMerge %end %loop None +OpBranch %loop +%end = OpLabel +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAdjacency, OpLoopMergePreceedsOpBranchConditionalSuccess) { + const std::string body = R"( +OpBranch %loop +%loop = OpLabel +OpLoopMerge %end %loop None +OpBranchConditional %true %loop %end +%end = OpLabel +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAdjacency, OpLoopMergePreceedsBadOpFail) { + const std::string body = R"( +OpBranch %loop +%loop = OpLabel +OpLoopMerge %end %loop None +OpNop +OpBranchConditional %true %loop %end +%end = OpLabel +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpLoopMerge must immediately precede either an " + "OpBranch or OpBranchConditional instruction.")); +} + +TEST_F(ValidateAdjacency, OpSelectionMergePreceedsOpBranchConditionalSuccess) { + const std::string body = R"( +OpSelectionMerge %end_label None +OpBranchConditional %true %true_label %false_label +%true_label = OpLabel +OpBranch %end_label +%false_label = OpLabel +OpBranch %end_label +%end_label = OpLabel +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAdjacency, OpSelectionMergePreceedsOpSwitchSuccess) { + const std::string body = R"( +OpSelectionMerge %merge None +OpSwitch %zero %merge 0 %label +%label = OpLabel +OpBranch %merge +%merge = OpLabel +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAdjacency, OpSelectionMergePreceedsBadOpFail) { + const std::string body = R"( +OpSelectionMerge %merge None +OpNop +OpSwitch %zero %merge 0 %label +%label = OpLabel +OpBranch %merge +%merge = OpLabel +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpSelectionMerge must immediately precede either an " + "OpBranchConditional or OpSwitch instruction")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_arithmetics_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_arithmetics_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_arithmetics_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_arithmetics_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1276 @@ +// Copyright (c) 2017 Google 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. + +// Tests for unique type declaration rules validator. + +#include + +#include "gmock/gmock.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using ::testing::HasSubstr; +using ::testing::Not; + +using std::string; + +using ValidateArithmetics = spvtest::ValidateBase; + +std::string GenerateCode(const std::string& main_body) { + const std::string prefix = + R"( +OpCapability Shader +OpCapability Int64 +OpCapability Float64 +OpCapability Matrix +%ext_inst = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f32 = OpTypeFloat 32 +%u32 = OpTypeInt 32 0 +%s32 = OpTypeInt 32 1 +%f64 = OpTypeFloat 64 +%u64 = OpTypeInt 64 0 +%s64 = OpTypeInt 64 1 +%boolvec2 = OpTypeVector %bool 2 +%s32vec2 = OpTypeVector %s32 2 +%u32vec2 = OpTypeVector %u32 2 +%u64vec2 = OpTypeVector %u64 2 +%f32vec2 = OpTypeVector %f32 2 +%f64vec2 = OpTypeVector %f64 2 +%boolvec3 = OpTypeVector %bool 3 +%u32vec3 = OpTypeVector %u32 3 +%u64vec3 = OpTypeVector %u64 3 +%s32vec3 = OpTypeVector %s32 3 +%f32vec3 = OpTypeVector %f32 3 +%f64vec3 = OpTypeVector %f64 3 +%boolvec4 = OpTypeVector %bool 4 +%u32vec4 = OpTypeVector %u32 4 +%u64vec4 = OpTypeVector %u64 4 +%s32vec4 = OpTypeVector %s32 4 +%f32vec4 = OpTypeVector %f32 4 +%f64vec4 = OpTypeVector %f64 4 + +%f32mat22 = OpTypeMatrix %f32vec2 2 +%f32mat23 = OpTypeMatrix %f32vec2 3 +%f32mat32 = OpTypeMatrix %f32vec3 2 +%f32mat33 = OpTypeMatrix %f32vec3 3 +%f64mat22 = OpTypeMatrix %f64vec2 2 + +%struct_f32_f32 = OpTypeStruct %f32 %f32 +%struct_u32_u32 = OpTypeStruct %u32 %u32 +%struct_u32_u32_u32 = OpTypeStruct %u32 %u32 %u32 +%struct_s32_s32 = OpTypeStruct %s32 %s32 +%struct_s32_u32 = OpTypeStruct %s32 %u32 +%struct_u32vec2_u32vec2 = OpTypeStruct %u32vec2 %u32vec2 +%struct_s32vec2_s32vec2 = OpTypeStruct %s32vec2 %s32vec2 + +%f32_0 = OpConstant %f32 0 +%f32_1 = OpConstant %f32 1 +%f32_2 = OpConstant %f32 2 +%f32_3 = OpConstant %f32 3 +%f32_4 = OpConstant %f32 4 +%f32_pi = OpConstant %f32 3.14159 + +%s32_0 = OpConstant %s32 0 +%s32_1 = OpConstant %s32 1 +%s32_2 = OpConstant %s32 2 +%s32_3 = OpConstant %s32 3 +%s32_4 = OpConstant %s32 4 +%s32_m1 = OpConstant %s32 -1 + +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u32_2 = OpConstant %u32 2 +%u32_3 = OpConstant %u32 3 +%u32_4 = OpConstant %u32 4 + +%f64_0 = OpConstant %f64 0 +%f64_1 = OpConstant %f64 1 +%f64_2 = OpConstant %f64 2 +%f64_3 = OpConstant %f64 3 +%f64_4 = OpConstant %f64 4 + +%s64_0 = OpConstant %s64 0 +%s64_1 = OpConstant %s64 1 +%s64_2 = OpConstant %s64 2 +%s64_3 = OpConstant %s64 3 +%s64_4 = OpConstant %s64 4 +%s64_m1 = OpConstant %s64 -1 + +%u64_0 = OpConstant %u64 0 +%u64_1 = OpConstant %u64 1 +%u64_2 = OpConstant %u64 2 +%u64_3 = OpConstant %u64 3 +%u64_4 = OpConstant %u64 4 + +%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 +%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 +%u32vec3_012 = OpConstantComposite %u32vec3 %u32_0 %u32_1 %u32_2 +%u32vec3_123 = OpConstantComposite %u32vec3 %u32_1 %u32_2 %u32_3 +%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 +%u32vec4_1234 = OpConstantComposite %u32vec4 %u32_1 %u32_2 %u32_3 %u32_4 + +%s32vec2_01 = OpConstantComposite %s32vec2 %s32_0 %s32_1 +%s32vec2_12 = OpConstantComposite %s32vec2 %s32_1 %s32_2 +%s32vec3_012 = OpConstantComposite %s32vec3 %s32_0 %s32_1 %s32_2 +%s32vec3_123 = OpConstantComposite %s32vec3 %s32_1 %s32_2 %s32_3 +%s32vec4_0123 = OpConstantComposite %s32vec4 %s32_0 %s32_1 %s32_2 %s32_3 +%s32vec4_1234 = OpConstantComposite %s32vec4 %s32_1 %s32_2 %s32_3 %s32_4 + +%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 +%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 +%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 +%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 +%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 +%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 + +%f64vec2_01 = OpConstantComposite %f64vec2 %f64_0 %f64_1 +%f64vec2_12 = OpConstantComposite %f64vec2 %f64_1 %f64_2 +%f64vec3_012 = OpConstantComposite %f64vec3 %f64_0 %f64_1 %f64_2 +%f64vec3_123 = OpConstantComposite %f64vec3 %f64_1 %f64_2 %f64_3 +%f64vec4_0123 = OpConstantComposite %f64vec4 %f64_0 %f64_1 %f64_2 %f64_3 +%f64vec4_1234 = OpConstantComposite %f64vec4 %f64_1 %f64_2 %f64_3 %f64_4 + +%f32mat22_1212 = OpConstantComposite %f32mat22 %f32vec2_12 %f32vec2_12 +%f32mat23_121212 = OpConstantComposite %f32mat23 %f32vec2_12 %f32vec2_12 %f32vec2_12 +%f32mat32_123123 = OpConstantComposite %f32mat32 %f32vec3_123 %f32vec3_123 +%f32mat33_123123123 = OpConstantComposite %f32mat33 %f32vec3_123 %f32vec3_123 %f32vec3_123 + +%f64mat22_1212 = OpConstantComposite %f64mat22 %f64vec2_12 %f64vec2_12 + +%main = OpFunction %void None %func +%main_entry = OpLabel)"; + + const std::string suffix = + R"( +OpReturn +OpFunctionEnd)"; + + return prefix + main_body + suffix; +} + +TEST_F(ValidateArithmetics, F32Success) { + const std::string body = R"( +%val1 = OpFMul %f32 %f32_0 %f32_1 +%val2 = OpFSub %f32 %f32_2 %f32_0 +%val3 = OpFAdd %f32 %val1 %val2 +%val4 = OpFNegate %f32 %val3 +%val5 = OpFDiv %f32 %val4 %val1 +%val6 = OpFRem %f32 %val4 %f32_2 +%val7 = OpFMod %f32 %val4 %f32_2 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, F64Success) { + const std::string body = R"( +%val1 = OpFMul %f64 %f64_0 %f64_1 +%val2 = OpFSub %f64 %f64_2 %f64_0 +%val3 = OpFAdd %f64 %val1 %val2 +%val4 = OpFNegate %f64 %val3 +%val5 = OpFDiv %f64 %val4 %val1 +%val6 = OpFRem %f64 %val4 %f64_2 +%val7 = OpFMod %f64 %val4 %f64_2 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, Int32Success) { + const std::string body = R"( +%val1 = OpIMul %u32 %s32_0 %u32_1 +%val2 = OpIMul %s32 %s32_2 %u32_1 +%val3 = OpIAdd %u32 %val1 %val2 +%val4 = OpIAdd %s32 %val1 %val2 +%val5 = OpISub %u32 %val3 %val4 +%val6 = OpISub %s32 %val4 %val3 +%val7 = OpSDiv %s32 %val4 %val3 +%val8 = OpSNegate %s32 %val7 +%val9 = OpSRem %s32 %val4 %val3 +%val10 = OpSMod %s32 %val4 %val3 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, Int64Success) { + const std::string body = R"( +%val1 = OpIMul %u64 %s64_0 %u64_1 +%val2 = OpIMul %s64 %s64_2 %u64_1 +%val3 = OpIAdd %u64 %val1 %val2 +%val4 = OpIAdd %s64 %val1 %val2 +%val5 = OpISub %u64 %val3 %val4 +%val6 = OpISub %s64 %val4 %val3 +%val7 = OpSDiv %s64 %val4 %val3 +%val8 = OpSNegate %s64 %val7 +%val9 = OpSRem %s64 %val4 %val3 +%val10 = OpSMod %s64 %val4 %val3 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, F32Vec2Success) { + const std::string body = R"( +%val1 = OpFMul %f32vec2 %f32vec2_01 %f32vec2_12 +%val2 = OpFSub %f32vec2 %f32vec2_12 %f32vec2_01 +%val3 = OpFAdd %f32vec2 %val1 %val2 +%val4 = OpFNegate %f32vec2 %val3 +%val5 = OpFDiv %f32vec2 %val4 %val1 +%val6 = OpFRem %f32vec2 %val4 %f32vec2_12 +%val7 = OpFMod %f32vec2 %val4 %f32vec2_12 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, F64Vec2Success) { + const std::string body = R"( +%val1 = OpFMul %f64vec2 %f64vec2_01 %f64vec2_12 +%val2 = OpFSub %f64vec2 %f64vec2_12 %f64vec2_01 +%val3 = OpFAdd %f64vec2 %val1 %val2 +%val4 = OpFNegate %f64vec2 %val3 +%val5 = OpFDiv %f64vec2 %val4 %val1 +%val6 = OpFRem %f64vec2 %val4 %f64vec2_12 +%val7 = OpFMod %f64vec2 %val4 %f64vec2_12 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, U32Vec2Success) { + const std::string body = R"( +%val1 = OpIMul %u32vec2 %u32vec2_01 %u32vec2_12 +%val2 = OpISub %u32vec2 %u32vec2_12 %u32vec2_01 +%val3 = OpIAdd %u32vec2 %val1 %val2 +%val4 = OpSNegate %u32vec2 %val3 +%val5 = OpSDiv %u32vec2 %val4 %val1 +%val6 = OpSRem %u32vec2 %val4 %u32vec2_12 +%val7 = OpSMod %u32vec2 %val4 %u32vec2_12 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, FNegateTypeIdU32) { + const std::string body = R"( +%val = OpFNegate %u32 %u32_0 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected floating scalar or vector type as Result Type: FNegate")); +} + +TEST_F(ValidateArithmetics, FNegateTypeIdVec2U32) { + const std::string body = R"( +%val = OpFNegate %u32vec2 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected floating scalar or vector type as Result Type: FNegate")); +} + +TEST_F(ValidateArithmetics, FNegateWrongOperand) { + const std::string body = R"( +%val = OpFNegate %f32 %u32_0 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected arithmetic operands to be of Result Type: " + "FNegate operand index 2")); +} + +TEST_F(ValidateArithmetics, FMulTypeIdU32) { + const std::string body = R"( +%val = OpFMul %u32 %u32_0 %u32_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected floating scalar or vector type as Result Type: FMul")); +} + +TEST_F(ValidateArithmetics, FMulTypeIdVec2U32) { + const std::string body = R"( +%val = OpFMul %u32vec2 %u32vec2_01 %u32vec2_12 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected floating scalar or vector type as Result Type: FMul")); +} + +TEST_F(ValidateArithmetics, FMulWrongOperand1) { + const std::string body = R"( +%val = OpFMul %f32 %u32_0 %f32_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected arithmetic operands to be of Result Type: " + "FMul operand index 2")); +} + +TEST_F(ValidateArithmetics, FMulWrongOperand2) { + const std::string body = R"( +%val = OpFMul %f32 %f32_0 %u32_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected arithmetic operands to be of Result Type: " + "FMul operand index 3")); +} + +TEST_F(ValidateArithmetics, FMulWrongVectorOperand1) { + const std::string body = R"( +%val = OpFMul %f64vec3 %f32vec3_123 %f64vec3_012 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected arithmetic operands to be of Result Type: " + "FMul operand index 2")); +} + +TEST_F(ValidateArithmetics, FMulWrongVectorOperand2) { + const std::string body = R"( +%val = OpFMul %f32vec3 %f32vec3_123 %f64vec3_012 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected arithmetic operands to be of Result Type: " + "FMul operand index 3")); +} + +TEST_F(ValidateArithmetics, IMulFloatTypeId) { + const std::string body = R"( +%val = OpIMul %f32 %u32_0 %s32_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected int scalar or vector type as Result Type: IMul")); +} + +TEST_F(ValidateArithmetics, IMulFloatOperand1) { + const std::string body = R"( +%val = OpIMul %u32 %f32_0 %s32_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected int scalar or vector type as operand: " + "IMul operand index 2")); +} + +TEST_F(ValidateArithmetics, IMulFloatOperand2) { + const std::string body = R"( +%val = OpIMul %u32 %s32_0 %f32_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected int scalar or vector type as operand: " + "IMul operand index 3")); +} + +TEST_F(ValidateArithmetics, IMulWrongBitWidthOperand1) { + const std::string body = R"( +%val = OpIMul %u64 %u32_0 %s64_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected arithmetic operands to have the same bit width " + "as Result Type: IMul operand index 2")); +} + +TEST_F(ValidateArithmetics, IMulWrongBitWidthOperand2) { + const std::string body = R"( +%val = OpIMul %u32 %u32_0 %s64_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected arithmetic operands to have the same bit width " + "as Result Type: IMul operand index 3")); +} + +TEST_F(ValidateArithmetics, IMulWrongBitWidthVector) { + const std::string body = R"( +%val = OpIMul %u64vec3 %u32vec3_012 %u32vec3_123 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected arithmetic operands to have the same bit width " + "as Result Type: IMul operand index 2")); +} + +TEST_F(ValidateArithmetics, IMulVectorScalarOperand1) { + const std::string body = R"( +%val = OpIMul %u32vec2 %u32_0 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected arithmetic operands to have the same dimension " + "as Result Type: IMul operand index 2")); +} + +TEST_F(ValidateArithmetics, IMulVectorScalarOperand2) { + const std::string body = R"( +%val = OpIMul %u32vec2 %u32vec2_01 %u32_0 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected arithmetic operands to have the same dimension " + "as Result Type: IMul operand index 3")); +} + +TEST_F(ValidateArithmetics, IMulScalarVectorOperand1) { + const std::string body = R"( +%val = OpIMul %s32 %u32vec2_01 %u32_0 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected arithmetic operands to have the same dimension " + "as Result Type: IMul operand index 2")); +} + +TEST_F(ValidateArithmetics, IMulScalarVectorOperand2) { + const std::string body = R"( +%val = OpIMul %u32 %u32_0 %s32vec2_01 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected arithmetic operands to have the same dimension " + "as Result Type: IMul operand index 3")); +} + +TEST_F(ValidateArithmetics, SNegateFloat) { + const std::string body = R"( +%val = OpSNegate %s32 %f32_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected int scalar or vector type as operand: " + "SNegate operand index 2")); +} + +TEST_F(ValidateArithmetics, UDivFloatType) { + const std::string body = R"( +%val = OpUDiv %f32 %u32_2 %u32_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected unsigned int scalar or vector type as Result Type: UDiv")); +} + +TEST_F(ValidateArithmetics, UDivSignedIntType) { + const std::string body = R"( +%val = OpUDiv %s32 %u32_2 %u32_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected unsigned int scalar or vector type as Result Type: UDiv")); +} + +TEST_F(ValidateArithmetics, UDivWrongOperand1) { + const std::string body = R"( +%val = OpUDiv %u64 %f64_2 %u64_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected arithmetic operands to be of Result Type: " + "UDiv operand index 2")); +} + +TEST_F(ValidateArithmetics, UDivWrongOperand2) { + const std::string body = R"( +%val = OpUDiv %u64 %u64_2 %u32_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected arithmetic operands to be of Result Type: " + "UDiv operand index 3")); +} + +TEST_F(ValidateArithmetics, DotSuccess) { + const std::string body = R"( +%val = OpDot %f32 %f32vec2_01 %f32vec2_12 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, DotWrongTypeId) { + const std::string body = R"( +%val = OpDot %u32 %u32vec2_01 %u32vec2_12 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected float scalar type as Result Type: Dot")); +} + +TEST_F(ValidateArithmetics, DotNotVectorTypeOperand1) { + const std::string body = R"( +%val = OpDot %f32 %f32 %f32vec2_12 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected float vector as operand: Dot operand index 2")); +} + +TEST_F(ValidateArithmetics, DotNotVectorTypeOperand2) { + const std::string body = R"( +%val = OpDot %f32 %f32vec3_012 %f32_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected float vector as operand: Dot operand index 3")); +} + +TEST_F(ValidateArithmetics, DotWrongComponentOperand1) { + const std::string body = R"( +%val = OpDot %f64 %f32vec2_01 %f64vec2_12 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected component type to be equal to Result Type: " + "Dot operand index 2")); +} + +TEST_F(ValidateArithmetics, DotWrongComponentOperand2) { + const std::string body = R"( +%val = OpDot %f32 %f32vec2_01 %f64vec2_12 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected component type to be equal to Result Type: " + "Dot operand index 3")); +} + +TEST_F(ValidateArithmetics, DotDifferentVectorSize) { + const std::string body = R"( +%val = OpDot %f32 %f32vec2_01 %f32vec3_123 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected operands to have the same number of componenets: Dot")); +} + +TEST_F(ValidateArithmetics, VectorTimesScalarSuccess) { + const std::string body = R"( +%val = OpVectorTimesScalar %f32vec2 %f32vec2_01 %f32_2 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, VectorTimesScalarWrongTypeId) { + const std::string body = R"( +%val = OpVectorTimesScalar %u32vec2 %f32vec2_01 %f32_2 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected float vector type as Result Type: " + "VectorTimesScalar")); +} + +TEST_F(ValidateArithmetics, VectorTimesScalarWrongVector) { + const std::string body = R"( +%val = OpVectorTimesScalar %f32vec2 %f32vec3_012 %f32_2 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected vector operand type to be equal to Result Type: " + "VectorTimesScalar")); +} + +TEST_F(ValidateArithmetics, VectorTimesScalarWrongScalar) { + const std::string body = R"( +%val = OpVectorTimesScalar %f32vec2 %f32vec2_01 %f64_2 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected scalar operand type to be equal to the component " + "type of the vector operand: VectorTimesScalar")); +} + +TEST_F(ValidateArithmetics, MatrixTimesScalarSuccess) { + const std::string body = R"( +%val = OpMatrixTimesScalar %f32mat22 %f32mat22_1212 %f32_2 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, MatrixTimesScalarWrongTypeId) { + const std::string body = R"( +%val = OpMatrixTimesScalar %f32vec2 %f32mat22_1212 %f32_2 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected float matrix type as Result Type: " + "MatrixTimesScalar")); +} + +TEST_F(ValidateArithmetics, MatrixTimesScalarWrongMatrix) { + const std::string body = R"( +%val = OpMatrixTimesScalar %f32mat22 %f32vec2_01 %f32_2 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected matrix operand type to be equal to Result Type: " + "MatrixTimesScalar")); +} + +TEST_F(ValidateArithmetics, MatrixTimesScalarWrongScalar) { + const std::string body = R"( +%val = OpMatrixTimesScalar %f32mat22 %f32mat22_1212 %f64_2 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected scalar operand type to be equal to the component " + "type of the matrix operand: MatrixTimesScalar")); +} + +TEST_F(ValidateArithmetics, VectorTimesMatrix2x22Success) { + const std::string body = R"( +%val = OpVectorTimesMatrix %f32vec2 %f32vec2_12 %f32mat22_1212 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, VectorTimesMatrix3x32Success) { + const std::string body = R"( +%val = OpVectorTimesMatrix %f32vec2 %f32vec3_123 %f32mat32_123123 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, VectorTimesMatrixWrongTypeId) { + const std::string body = R"( +%val = OpVectorTimesMatrix %f32mat22 %f32vec2_12 %f32mat22_1212 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected float vector type as Result Type: " + "VectorTimesMatrix")); +} + +TEST_F(ValidateArithmetics, VectorTimesMatrixNotFloatVector) { + const std::string body = R"( +%val = OpVectorTimesMatrix %f32vec2 %u32vec2_12 %f32mat22_1212 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected float vector type as left operand: " + "VectorTimesMatrix")); +} + +TEST_F(ValidateArithmetics, VectorTimesMatrixWrongVectorComponent) { + const std::string body = R"( +%val = OpVectorTimesMatrix %f32vec2 %f64vec2_12 %f32mat22_1212 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected component types of Result Type and vector to be equal: " + "VectorTimesMatrix")); +} + +TEST_F(ValidateArithmetics, VectorTimesMatrixWrongMatrix) { + const std::string body = R"( +%val = OpVectorTimesMatrix %f32vec2 %f32vec2_12 %f32vec2_12 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected float matrix type as right operand: " + "VectorTimesMatrix")); +} + +TEST_F(ValidateArithmetics, VectorTimesMatrixWrongMatrixComponent) { + const std::string body = R"( +%val = OpVectorTimesMatrix %f32vec2 %f32vec2_12 %f64mat22_1212 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected component types of Result Type and matrix to be equal: " + "VectorTimesMatrix")); +} + +TEST_F(ValidateArithmetics, VectorTimesMatrix2eq2x23Fail) { + const std::string body = R"( +%val = OpVectorTimesMatrix %f32vec2 %f32vec2_12 %f32mat23_121212 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected number of columns of the matrix to be equal to Result Type " + "vector size: VectorTimesMatrix")); +} + +TEST_F(ValidateArithmetics, VectorTimesMatrix2x32Fail) { + const std::string body = R"( +%val = OpVectorTimesMatrix %f32vec2 %f32vec2_12 %f32mat32_123123 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected number of rows of the matrix to be equal to the vector " + "operand size: VectorTimesMatrix")); +} + +TEST_F(ValidateArithmetics, MatrixTimesVector22x2Success) { + const std::string body = R"( +%val = OpMatrixTimesVector %f32vec2 %f32mat22_1212 %f32vec2_12 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, MatrixTimesVector23x3Success) { + const std::string body = R"( +%val = OpMatrixTimesVector %f32vec2 %f32mat23_121212 %f32vec3_123 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, MatrixTimesVectorWrongTypeId) { + const std::string body = R"( +%val = OpMatrixTimesVector %f32mat22 %f32mat22_1212 %f32vec2_12 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected float vector type as Result Type: " + "MatrixTimesVector")); +} + +TEST_F(ValidateArithmetics, MatrixTimesVectorWrongMatrix) { + const std::string body = R"( +%val = OpMatrixTimesVector %f32vec3 %f32vec3_123 %f32vec3_123 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected float matrix type as left operand: " + "MatrixTimesVector")); +} + +TEST_F(ValidateArithmetics, MatrixTimesVectorWrongMatrixCol) { + const std::string body = R"( +%val = OpMatrixTimesVector %f32vec3 %f32mat23_121212 %f32vec3_123 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected column type of the matrix to be equal to Result Type: " + "MatrixTimesVector")); +} + +TEST_F(ValidateArithmetics, MatrixTimesVectorWrongVector) { + const std::string body = R"( +%val = OpMatrixTimesVector %f32vec2 %f32mat22_1212 %u32vec2_12 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected float vector type as right operand: " + "MatrixTimesVector")); +} + +TEST_F(ValidateArithmetics, MatrixTimesVectorDifferentComponents) { + const std::string body = R"( +%val = OpMatrixTimesVector %f32vec2 %f32mat22_1212 %f64vec2_12 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected component types of the operands to be equal: " + "MatrixTimesVector")); +} + +TEST_F(ValidateArithmetics, MatrixTimesVector22x3Fail) { + const std::string body = R"( +%val = OpMatrixTimesVector %f32vec2 %f32mat22_1212 %f32vec3_123 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected number of columns of the matrix to be equal to the vector " + "size: MatrixTimesVector")); +} + +TEST_F(ValidateArithmetics, MatrixTimesMatrix22x22Success) { + const std::string body = R"( +%val = OpMatrixTimesMatrix %f32mat22 %f32mat22_1212 %f32mat22_1212 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, MatrixTimesMatrix23x32Success) { + const std::string body = R"( +%val = OpMatrixTimesMatrix %f32mat22 %f32mat23_121212 %f32mat32_123123 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, MatrixTimesMatrix33x33Success) { + const std::string body = R"( +%val = OpMatrixTimesMatrix %f32mat33 %f32mat33_123123123 %f32mat33_123123123 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, MatrixTimesMatrixWrongTypeId) { + const std::string body = R"( +%val = OpMatrixTimesMatrix %f32vec2 %f32mat22_1212 %f32mat22_1212 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected float matrix type as Result Type: MatrixTimesMatrix")); +} + +TEST_F(ValidateArithmetics, MatrixTimesMatrixWrongLeftOperand) { + const std::string body = R"( +%val = OpMatrixTimesMatrix %f32mat22 %f32vec2_12 %f32mat22_1212 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected float matrix type as left operand: MatrixTimesMatrix")); +} + +TEST_F(ValidateArithmetics, MatrixTimesMatrixWrongRightOperand) { + const std::string body = R"( +%val = OpMatrixTimesMatrix %f32mat22 %f32mat22_1212 %f32vec2_12 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected float matrix type as right operand: MatrixTimesMatrix")); +} + +TEST_F(ValidateArithmetics, MatrixTimesMatrix32x23Fail) { + const std::string body = R"( +%val = OpMatrixTimesMatrix %f32mat22 %f32mat32_123123 %f32mat23_121212 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected column types of Result Type and left matrix to be equal: " + "MatrixTimesMatrix")); +} + +TEST_F(ValidateArithmetics, MatrixTimesMatrixDifferentComponents) { + const std::string body = R"( +%val = OpMatrixTimesMatrix %f32mat22 %f32mat22_1212 %f64mat22_1212 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected component types of Result Type and right " + "matrix to be equal: " + "MatrixTimesMatrix")); +} + +TEST_F(ValidateArithmetics, MatrixTimesMatrix23x23Fail) { + const std::string body = R"( +%val = OpMatrixTimesMatrix %f32mat22 %f32mat23_121212 %f32mat23_121212 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected number of columns of Result Type and right " + "matrix to be equal: " + "MatrixTimesMatrix")); +} + +TEST_F(ValidateArithmetics, MatrixTimesMatrix23x22Fail) { + const std::string body = R"( +%val = OpMatrixTimesMatrix %f32mat22 %f32mat23_121212 %f32mat22_1212 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected number of columns of left matrix and number " + "of rows of right " + "matrix to be equal: MatrixTimesMatrix")); +} + +TEST_F(ValidateArithmetics, OuterProduct2x2Success) { + const std::string body = R"( +%val = OpOuterProduct %f32mat22 %f32vec2_12 %f32vec2_01 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, OuterProduct3x2Success) { + const std::string body = R"( +%val = OpOuterProduct %f32mat32 %f32vec3_123 %f32vec2_01 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, OuterProduct2x3Success) { + const std::string body = R"( +%val = OpOuterProduct %f32mat23 %f32vec2_01 %f32vec3_123 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, OuterProductWrongTypeId) { + const std::string body = R"( +%val = OpOuterProduct %f32vec2 %f32vec2_01 %f32vec3_123 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected float matrix type as Result Type: " + "OuterProduct")); +} + +TEST_F(ValidateArithmetics, OuterProductWrongLeftOperand) { + const std::string body = R"( +%val = OpOuterProduct %f32mat22 %f32vec3_123 %f32vec2_01 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected column type of Result Type to be equal to the type " + "of the left operand: OuterProduct")); +} + +TEST_F(ValidateArithmetics, OuterProductRightOperandNotFloatVector) { + const std::string body = R"( +%val = OpOuterProduct %f32mat22 %f32vec2_12 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected float vector type as right operand: OuterProduct")); +} + +TEST_F(ValidateArithmetics, OuterProductRightOperandWrongComponent) { + const std::string body = R"( +%val = OpOuterProduct %f32mat22 %f32vec2_12 %f64vec2_01 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected component types of the operands to be equal: " + "OuterProduct")); +} + +TEST_F(ValidateArithmetics, OuterProductRightOperandWrongDimension) { + const std::string body = R"( +%val = OpOuterProduct %f32mat22 %f32vec2_12 %f32vec3_123 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected number of columns of the matrix to be equal to the " + "vector size of the right operand: OuterProduct")); +} + +TEST_F(ValidateArithmetics, IAddCarrySuccess) { + const std::string body = R"( +%val1 = OpIAddCarry %struct_u32_u32 %u32_0 %u32_1 +%val2 = OpIAddCarry %struct_u32vec2_u32vec2 %u32vec2_01 %u32vec2_12 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, IAddCarryResultTypeNotStruct) { + const std::string body = R"( +%val = OpIAddCarry %u32 %u32_0 %u32_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected a struct as Result Type: IAddCarry")); +} + +TEST_F(ValidateArithmetics, IAddCarryResultTypeNotTwoMembers) { + const std::string body = R"( +%val = OpIAddCarry %struct_u32_u32_u32 %u32_0 %u32_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Result Type struct to have two members: IAddCarry")); +} + +TEST_F(ValidateArithmetics, IAddCarryResultTypeMemberNotUnsignedInt) { + const std::string body = R"( +%val = OpIAddCarry %struct_s32_s32 %s32_0 %s32_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type struct member types to be " + "unsigned integer scalar " + "or vector: IAddCarry")); +} + +TEST_F(ValidateArithmetics, IAddCarryWrongLeftOperand) { + const std::string body = R"( +%val = OpIAddCarry %struct_u32_u32 %s32_0 %u32_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected both operands to be of Result Type member " + "type: IAddCarry")); +} + +TEST_F(ValidateArithmetics, IAddCarryWrongRightOperand) { + const std::string body = R"( +%val = OpIAddCarry %struct_u32_u32 %u32_0 %s32_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected both operands to be of Result Type member " + "type: IAddCarry")); +} + +TEST_F(ValidateArithmetics, OpSMulExtendedSuccess) { + const std::string body = R"( +%val1 = OpSMulExtended %struct_u32_u32 %u32_0 %u32_1 +%val2 = OpSMulExtended %struct_s32_s32 %s32_0 %s32_1 +%val3 = OpSMulExtended %struct_u32vec2_u32vec2 %u32vec2_01 %u32vec2_12 +%val4 = OpSMulExtended %struct_s32vec2_s32vec2 %s32vec2_01 %s32vec2_12 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateArithmetics, SMulExtendedResultTypeMemberNotInt) { + const std::string body = R"( +%val = OpSMulExtended %struct_f32_f32 %f32_0 %f32_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Result Type struct member types to be integer scalar " + "or vector: SMulExtended")); +} + +TEST_F(ValidateArithmetics, SMulExtendedResultTypeMembersNotIdentical) { + const std::string body = R"( +%val = OpSMulExtended %struct_s32_u32 %s32_0 %s32_1 +)"; + + CompileSuccessfully(GenerateCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Result Type struct member types to be identical: " + "SMulExtended")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_atomics_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_atomics_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_atomics_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_atomics_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1012 @@ +// Copyright (c) 2017 Google 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. + +#include +#include + +#include "gmock/gmock.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using ::testing::HasSubstr; +using ::testing::Not; + +using ValidateAtomics = spvtest::ValidateBase; + +std::string GenerateShaderCode( + const std::string& body, + const std::string& capabilities_and_extensions = "") { + std::ostringstream ss; + ss << R"( +OpCapability Shader +OpCapability Int64 +)"; + + ss << capabilities_and_extensions; + ss << R"( +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f32 = OpTypeFloat 32 +%u32 = OpTypeInt 32 0 +%u64 = OpTypeInt 64 0 +%f32vec4 = OpTypeVector %f32 4 + +%f32_0 = OpConstant %f32 0 +%f32_1 = OpConstant %f32 1 +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u64_1 = OpConstant %u64 1 +%f32vec4_0000 = OpConstantComposite %f32vec4 %f32_0 %f32_0 %f32_0 %f32_0 + +%cross_device = OpConstant %u32 0 +%device = OpConstant %u32 1 +%workgroup = OpConstant %u32 2 +%subgroup = OpConstant %u32 3 +%invocation = OpConstant %u32 4 + +%relaxed = OpConstant %u32 0 +%acquire = OpConstant %u32 2 +%release = OpConstant %u32 4 +%acquire_release = OpConstant %u32 8 +%acquire_and_release = OpConstant %u32 6 +%sequentially_consistent = OpConstant %u32 16 +%acquire_release_uniform_workgroup = OpConstant %u32 328 + +%f32_ptr = OpTypePointer Workgroup %f32 +%f32_var = OpVariable %f32_ptr Workgroup + +%u32_ptr = OpTypePointer Workgroup %u32 +%u32_var = OpVariable %u32_ptr Workgroup + +%u64_ptr = OpTypePointer Workgroup %u64 +%u64_var = OpVariable %u64_ptr Workgroup + +%f32vec4_ptr = OpTypePointer Workgroup %f32vec4 +%f32vec4_var = OpVariable %f32vec4_ptr Workgroup + +%f32_ptr_function = OpTypePointer Function %f32 + +%main = OpFunction %void None %func +%main_entry = OpLabel +)"; + + ss << body; + + ss << R"( +OpReturn +OpFunctionEnd)"; + + return ss.str(); +} + +std::string GenerateKernelCode( + const std::string& body, + const std::string& capabilities_and_extensions = "") { + std::ostringstream ss; + ss << R"( +OpCapability Addresses +OpCapability Kernel +OpCapability Linkage +OpCapability Int64 +)"; + + ss << capabilities_and_extensions; + ss << R"( +OpMemoryModel Physical32 OpenCL +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f32 = OpTypeFloat 32 +%u32 = OpTypeInt 32 0 +%u64 = OpTypeInt 64 0 +%f32vec4 = OpTypeVector %f32 4 + +%f32_0 = OpConstant %f32 0 +%f32_1 = OpConstant %f32 1 +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u64_1 = OpConstant %u64 1 +%f32vec4_0000 = OpConstantComposite %f32vec4 %f32_0 %f32_0 %f32_0 %f32_0 + +%cross_device = OpConstant %u32 0 +%device = OpConstant %u32 1 +%workgroup = OpConstant %u32 2 +%subgroup = OpConstant %u32 3 +%invocation = OpConstant %u32 4 + +%relaxed = OpConstant %u32 0 +%acquire = OpConstant %u32 2 +%release = OpConstant %u32 4 +%acquire_release = OpConstant %u32 8 +%acquire_and_release = OpConstant %u32 6 +%sequentially_consistent = OpConstant %u32 16 +%acquire_release_uniform_workgroup = OpConstant %u32 328 +%acquire_release_atomic_counter_workgroup = OpConstant %u32 1288 + +%f32_ptr = OpTypePointer Workgroup %f32 +%f32_var = OpVariable %f32_ptr Workgroup + +%u32_ptr = OpTypePointer Workgroup %u32 +%u32_var = OpVariable %u32_ptr Workgroup + +%u64_ptr = OpTypePointer Workgroup %u64 +%u64_var = OpVariable %u64_ptr Workgroup + +%f32vec4_ptr = OpTypePointer Workgroup %f32vec4 +%f32vec4_var = OpVariable %f32vec4_ptr Workgroup + +%f32_ptr_function = OpTypePointer Function %f32 + +%main = OpFunction %void None %func +%main_entry = OpLabel +)"; + + ss << body; + + ss << R"( +OpReturn +OpFunctionEnd)"; + + return ss.str(); +} + +TEST_F(ValidateAtomics, AtomicLoadShaderSuccess) { + const std::string body = R"( +%val1 = OpAtomicLoad %u32 %u32_var %device %relaxed +%val2 = OpAtomicLoad %u32 %u32_var %workgroup %acquire +%val3 = OpAtomicLoad %u64 %u64_var %subgroup %sequentially_consistent +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAtomics, AtomicLoadKernelSuccess) { + const std::string body = R"( +%val1 = OpAtomicLoad %f32 %f32_var %device %relaxed +%val2 = OpAtomicLoad %u32 %u32_var %workgroup %sequentially_consistent +%val3 = OpAtomicLoad %u64 %u64_var %subgroup %acquire +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAtomics, AtomicLoadVulkanSuccess) { + const std::string body = R"( +%val1 = OpAtomicLoad %u32 %u32_var %device %relaxed +%val2 = OpAtomicLoad %u32 %u32_var %workgroup %acquire +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); +} + +// TODO(atgoo@github.com): the corresponding check fails Vulkan CTS, +// reenable once fixed. +TEST_F(ValidateAtomics, DISABLED_AtomicLoadVulkanSubgroup) { + const std::string body = R"( +%val1 = OpAtomicLoad %u32 %u32_var %subgroup %acquire +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicLoad: in Vulkan environment memory scope is " + "limited to Device, Workgroup and Invocation")); +} + +TEST_F(ValidateAtomics, AtomicLoadVulkanRelease) { + const std::string body = R"( +%val1 = OpAtomicLoad %u32 %u32_var %workgroup %release +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Vulkan spec disallows OpAtomicLoad with Memory Semantics " + "Release, AcquireRelease and SequentiallyConsistent")); +} + +TEST_F(ValidateAtomics, AtomicLoadVulkanAcquireRelease) { + const std::string body = R"( +%val1 = OpAtomicLoad %u32 %u32_var %workgroup %acquire_release +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Vulkan spec disallows OpAtomicLoad with Memory Semantics " + "Release, AcquireRelease and SequentiallyConsistent")); +} + +TEST_F(ValidateAtomics, AtomicLoadVulkanSequentiallyConsistent) { + const std::string body = R"( +%val1 = OpAtomicLoad %u32 %u32_var %workgroup %sequentially_consistent +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Vulkan spec disallows OpAtomicLoad with Memory Semantics " + "Release, AcquireRelease and SequentiallyConsistent")); +} + +TEST_F(ValidateAtomics, AtomicLoadShaderFloat) { + const std::string body = R"( +%val1 = OpAtomicLoad %f32 %f32_var %device %relaxed +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicLoad: " + "expected Result Type to be int scalar type")); +} + +TEST_F(ValidateAtomics, AtomicLoadVulkanInt64) { + const std::string body = R"( +%val1 = OpAtomicLoad %u64 %u64_var %device %relaxed +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicLoad: according to the Vulkan spec atomic " + "Result Type needs to be a 32-bit int scalar type")); +} + +TEST_F(ValidateAtomics, AtomicLoadWrongResultType) { + const std::string body = R"( +%val1 = OpAtomicLoad %f32vec4 %f32vec4_var %device %relaxed +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicLoad: " + "expected Result Type to be int or float scalar type")); +} + +TEST_F(ValidateAtomics, AtomicLoadWrongPointerType) { + const std::string body = R"( +%val1 = OpAtomicLoad %f32 %f32_ptr %device %relaxed +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("AtomicLoad: expected Pointer to be of type OpTypePointer")); +} + +TEST_F(ValidateAtomics, AtomicLoadWrongPointerDataType) { + const std::string body = R"( +%val1 = OpAtomicLoad %u32 %f32_var %device %relaxed +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("AtomicLoad: " + "expected Pointer to point to a value of type Result Type")); +} + +TEST_F(ValidateAtomics, AtomicLoadWrongScopeType) { + const std::string body = R"( +%val1 = OpAtomicLoad %f32 %f32_var %f32_1 %relaxed +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicLoad: expected Scope to be 32-bit int")); +} + +TEST_F(ValidateAtomics, AtomicLoadWrongMemorySemanticsType) { + const std::string body = R"( +%val1 = OpAtomicLoad %f32 %f32_var %device %u64_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("AtomicLoad: expected Memory Semantics to be 32-bit int")); +} + +TEST_F(ValidateAtomics, AtomicStoreKernelSuccess) { + const std::string body = R"( +OpAtomicStore %f32_var %device %relaxed %f32_1 +OpAtomicStore %u32_var %subgroup %release %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAtomics, AtomicStoreShaderSuccess) { + const std::string body = R"( +OpAtomicStore %u32_var %device %release %u32_1 +OpAtomicStore %u32_var %subgroup %sequentially_consistent %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAtomics, AtomicStoreVulkanSuccess) { + const std::string body = R"( +OpAtomicStore %u32_var %device %release %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); +} + +TEST_F(ValidateAtomics, AtomicStoreVulkanAcquire) { + const std::string body = R"( +OpAtomicStore %u32_var %device %acquire %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Vulkan spec disallows OpAtomicStore with Memory Semantics " + "Acquire, AcquireRelease and SequentiallyConsistent")); +} + +TEST_F(ValidateAtomics, AtomicStoreVulkanAcquireRelease) { + const std::string body = R"( +OpAtomicStore %u32_var %device %acquire_release %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Vulkan spec disallows OpAtomicStore with Memory Semantics " + "Acquire, AcquireRelease and SequentiallyConsistent")); +} + +TEST_F(ValidateAtomics, AtomicStoreVulkanSequentiallyConsistent) { + const std::string body = R"( +OpAtomicStore %u32_var %device %sequentially_consistent %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Vulkan spec disallows OpAtomicStore with Memory Semantics " + "Acquire, AcquireRelease and SequentiallyConsistent")); +} + +TEST_F(ValidateAtomics, AtomicStoreWrongPointerType) { + const std::string body = R"( +OpAtomicStore %f32_1 %device %relaxed %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("AtomicStore: expected Pointer to be of type OpTypePointer")); +} + +TEST_F(ValidateAtomics, AtomicStoreWrongPointerDataType) { + const std::string body = R"( +OpAtomicStore %f32vec4_var %device %relaxed %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("AtomicStore: " + "expected Pointer to be a pointer to int or float scalar " + "type")); +} + +TEST_F(ValidateAtomics, AtomicStoreWrongPointerStorageType) { + const std::string body = R"( +%f32_var_function = OpVariable %f32_ptr_function Function +OpAtomicStore %f32_var_function %device %relaxed %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("AtomicStore: expected Pointer Storage Class to be Uniform, " + "Workgroup, CrossWorkgroup, Generic, AtomicCounter, Image or " + "StorageBuffer")); +} + +TEST_F(ValidateAtomics, AtomicStoreWrongScopeType) { + const std::string body = R"( +OpAtomicStore %f32_var %f32_1 %relaxed %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicStore: expected Scope to be 32-bit int")); +} + +TEST_F(ValidateAtomics, AtomicStoreWrongMemorySemanticsType) { + const std::string body = R"( +OpAtomicStore %f32_var %device %f32_1 %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("AtomicStore: expected Memory Semantics to be 32-bit int")); +} + +TEST_F(ValidateAtomics, AtomicStoreWrongValueType) { + const std::string body = R"( +OpAtomicStore %f32_var %device %relaxed %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("AtomicStore: " + "expected Value type and the type pointed to by Pointer to " + "be the same")); +} + +TEST_F(ValidateAtomics, AtomicExchangeShaderSuccess) { + const std::string body = R"( +%val1 = OpAtomicStore %u32_var %device %relaxed %u32_1 +%val2 = OpAtomicExchange %u32 %u32_var %device %relaxed %u32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAtomics, AtomicExchangeKernelSuccess) { + const std::string body = R"( +OpAtomicStore %f32_var %device %relaxed %f32_1 +%val2 = OpAtomicExchange %f32 %f32_var %device %relaxed %f32_0 +%val3 = OpAtomicStore %u32_var %device %relaxed %u32_1 +%val4 = OpAtomicExchange %u32 %u32_var %device %relaxed %u32_0 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAtomics, AtomicExchangeShaderFloat) { + const std::string body = R"( +OpAtomicStore %f32_var %device %relaxed %f32_1 +%val2 = OpAtomicExchange %f32 %f32_var %device %relaxed %f32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicExchange: " + "expected Result Type to be int scalar type")); +} + +TEST_F(ValidateAtomics, AtomicExchangeWrongResultType) { + const std::string body = R"( +%val1 = OpStore %f32vec4_var %f32vec4_0000 +%val2 = OpAtomicExchange %f32vec4 %f32vec4_var %device %relaxed %f32vec4_0000 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicExchange: " + "expected Result Type to be int or float scalar type")); +} + +TEST_F(ValidateAtomics, AtomicExchangeWrongPointerType) { + const std::string body = R"( +%val2 = OpAtomicExchange %f32 %f32vec4_ptr %device %relaxed %f32vec4_0000 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "AtomicExchange: expected Pointer to be of type OpTypePointer")); +} + +TEST_F(ValidateAtomics, AtomicExchangeWrongPointerDataType) { + const std::string body = R"( +%val1 = OpStore %f32vec4_var %f32vec4_0000 +%val2 = OpAtomicExchange %f32 %f32vec4_var %device %relaxed %f32vec4_0000 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("AtomicExchange: " + "expected Pointer to point to a value of type Result Type")); +} + +TEST_F(ValidateAtomics, AtomicExchangeWrongScopeType) { + const std::string body = R"( +OpAtomicStore %f32_var %device %relaxed %f32_1 +%val2 = OpAtomicExchange %f32 %f32_var %f32_1 %relaxed %f32_0 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicExchange: expected Scope to be 32-bit int")); +} + +TEST_F(ValidateAtomics, AtomicExchangeWrongMemorySemanticsType) { + const std::string body = R"( +OpAtomicStore %f32_var %device %relaxed %f32_1 +%val2 = OpAtomicExchange %f32 %f32_var %device %f32_1 %f32_0 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("AtomicExchange: expected Memory Semantics to be 32-bit int")); +} + +TEST_F(ValidateAtomics, AtomicExchangeWrongValueType) { + const std::string body = R"( +OpAtomicStore %f32_var %device %relaxed %f32_1 +%val2 = OpAtomicExchange %f32 %f32_var %device %relaxed %u32_0 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicExchange: " + "expected Value to be of type Result Type")); +} + +TEST_F(ValidateAtomics, AtomicCompareExchangeShaderSuccess) { + const std::string body = R"( +%val1 = OpAtomicStore %u32_var %device %relaxed %u32_1 +%val2 = OpAtomicCompareExchange %u32 %u32_var %device %relaxed %relaxed %u32_0 %u32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAtomics, AtomicCompareExchangeKernelSuccess) { + const std::string body = R"( +OpAtomicStore %f32_var %device %relaxed %f32_1 +%val2 = OpAtomicCompareExchange %f32 %f32_var %device %relaxed %relaxed %f32_0 %f32_1 +%val3 = OpAtomicStore %u32_var %device %relaxed %u32_1 +%val4 = OpAtomicCompareExchange %u32 %u32_var %device %relaxed %relaxed %u32_0 %u32_0 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAtomics, AtomicCompareExchangeShaderFloat) { + const std::string body = R"( +OpAtomicStore %f32_var %device %relaxed %f32_1 +%val1 = OpAtomicCompareExchange %f32 %f32_var %device %relaxed %relaxed %f32_0 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicCompareExchange: " + "expected Result Type to be int scalar type")); +} + +TEST_F(ValidateAtomics, AtomicCompareExchangeWrongResultType) { + const std::string body = R"( +%val1 = OpStore %f32vec4_var %f32vec4_0000 +%val2 = OpAtomicCompareExchange %f32vec4 %f32vec4_var %device %relaxed %relaxed %f32vec4_0000 %f32vec4_0000 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicCompareExchange: " + "expected Result Type to be int or float scalar type")); +} + +TEST_F(ValidateAtomics, AtomicCompareExchangeWrongPointerType) { + const std::string body = R"( +%val2 = OpAtomicCompareExchange %f32 %f32vec4_ptr %device %relaxed %relaxed %f32vec4_0000 %f32vec4_0000 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicCompareExchange: expected Pointer to be of type " + "OpTypePointer")); +} + +TEST_F(ValidateAtomics, AtomicCompareExchangeWrongPointerDataType) { + const std::string body = R"( +%val1 = OpStore %f32vec4_var %f32vec4_0000 +%val2 = OpAtomicCompareExchange %f32 %f32vec4_var %device %relaxed %relaxed %f32_0 %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("AtomicCompareExchange: " + "expected Pointer to point to a value of type Result Type")); +} + +TEST_F(ValidateAtomics, AtomicCompareExchangeWrongScopeType) { + const std::string body = R"( +OpAtomicStore %f32_var %device %relaxed %f32_1 +%val2 = OpAtomicCompareExchange %f32 %f32_var %f32_1 %relaxed %relaxed %f32_0 %f32_0 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("AtomicCompareExchange: expected Scope to be 32-bit int")); +} + +TEST_F(ValidateAtomics, AtomicCompareExchangeWrongMemorySemanticsType1) { + const std::string body = R"( +OpAtomicStore %f32_var %device %relaxed %f32_1 +%val2 = OpAtomicCompareExchange %f32 %f32_var %device %f32_1 %relaxed %f32_0 %f32_0 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "AtomicCompareExchange: expected Memory Semantics to be 32-bit int")); +} + +TEST_F(ValidateAtomics, AtomicCompareExchangeWrongMemorySemanticsType2) { + const std::string body = R"( +OpAtomicStore %f32_var %device %relaxed %f32_1 +%val2 = OpAtomicCompareExchange %f32 %f32_var %device %relaxed %f32_1 %f32_0 %f32_0 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "AtomicCompareExchange: expected Memory Semantics to be 32-bit int")); +} + +TEST_F(ValidateAtomics, AtomicCompareExchangeUnequalRelease) { + const std::string body = R"( +OpAtomicStore %f32_var %device %relaxed %f32_1 +%val2 = OpAtomicCompareExchange %f32 %f32_var %device %relaxed %release %f32_0 %f32_0 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicCompareExchange: Memory Semantics Release and " + "AcquireRelease cannot be used for operand Unequal")); +} + +TEST_F(ValidateAtomics, AtomicCompareExchangeWrongValueType) { + const std::string body = R"( +OpAtomicStore %f32_var %device %relaxed %f32_1 +%val2 = OpAtomicCompareExchange %f32 %f32_var %device %relaxed %relaxed %u32_0 %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicCompareExchange: " + "expected Value to be of type Result Type")); +} + +TEST_F(ValidateAtomics, AtomicCompareExchangeWrongComparatorType) { + const std::string body = R"( +OpAtomicStore %f32_var %device %relaxed %f32_1 +%val2 = OpAtomicCompareExchange %f32 %f32_var %device %relaxed %relaxed %f32_0 %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicCompareExchange: " + "expected Comparator to be of type Result Type")); +} + +TEST_F(ValidateAtomics, AtomicCompareExchangeWeakSuccess) { + const std::string body = R"( +%val3 = OpAtomicStore %u32_var %device %relaxed %u32_1 +%val4 = OpAtomicCompareExchangeWeak %u32 %u32_var %device %relaxed %relaxed %u32_0 %u32_0 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAtomics, AtomicCompareExchangeWeakWrongResultType) { + const std::string body = R"( +OpAtomicStore %f32_var %device %relaxed %f32_1 +%val2 = OpAtomicCompareExchangeWeak %f32 %f32_var %device %relaxed %relaxed %f32_0 %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicCompareExchangeWeak: " + "expected Result Type to be int scalar type")); +} + +TEST_F(ValidateAtomics, AtomicArithmeticsSuccess) { + const std::string body = R"( +OpAtomicStore %u32_var %device %relaxed %u32_1 +%val1 = OpAtomicIIncrement %u32 %u32_var %device %acquire_release +%val2 = OpAtomicIDecrement %u32 %u32_var %device %acquire_release +%val3 = OpAtomicIAdd %u32 %u32_var %device %acquire_release %u32_1 +%val4 = OpAtomicISub %u32 %u32_var %device %acquire_release %u32_1 +%val5 = OpAtomicUMin %u32 %u32_var %device %acquire_release %u32_1 +%val6 = OpAtomicUMax %u32 %u32_var %device %acquire_release %u32_1 +%val7 = OpAtomicSMin %u32 %u32_var %device %sequentially_consistent %u32_1 +%val8 = OpAtomicSMax %u32 %u32_var %device %sequentially_consistent %u32_1 +%val9 = OpAtomicAnd %u32 %u32_var %device %sequentially_consistent %u32_1 +%val10 = OpAtomicOr %u32 %u32_var %device %sequentially_consistent %u32_1 +%val11 = OpAtomicXor %u32 %u32_var %device %sequentially_consistent %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAtomics, AtomicFlagsSuccess) { + const std::string body = R"( +OpAtomicFlagClear %u32_var %device %release +%val1 = OpAtomicFlagTestAndSet %bool %u32_var %device %relaxed +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAtomics, AtomicFlagTestAndSetWrongResultType) { + const std::string body = R"( +%val1 = OpAtomicFlagTestAndSet %u32 %u32_var %device %relaxed +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicFlagTestAndSet: " + "expected Result Type to be bool scalar type")); +} + +TEST_F(ValidateAtomics, AtomicFlagTestAndSetNotPointer) { + const std::string body = R"( +%val1 = OpAtomicFlagTestAndSet %bool %u32_1 %device %relaxed +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicFlagTestAndSet: " + "expected Pointer to be of type OpTypePointer")); +} + +TEST_F(ValidateAtomics, AtomicFlagTestAndSetNotIntPointer) { + const std::string body = R"( +%val1 = OpAtomicFlagTestAndSet %bool %f32_var %device %relaxed +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("AtomicFlagTestAndSet: " + "expected Pointer to point to a value of 32-bit int type")); +} + +TEST_F(ValidateAtomics, AtomicFlagTestAndSetNotInt32Pointer) { + const std::string body = R"( +%val1 = OpAtomicFlagTestAndSet %bool %u64_var %device %relaxed +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("AtomicFlagTestAndSet: " + "expected Pointer to point to a value of 32-bit int type")); +} + +TEST_F(ValidateAtomics, AtomicFlagTestAndSetWrongScopeType) { + const std::string body = R"( +%val1 = OpAtomicFlagTestAndSet %bool %u32_var %u64_1 %relaxed +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicFlagTestAndSet: " + "expected Scope to be 32-bit int")); +} + +TEST_F(ValidateAtomics, AtomicFlagTestAndSetWrongMemorySemanticsType) { + const std::string body = R"( +%val1 = OpAtomicFlagTestAndSet %bool %u32_var %device %u64_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicFlagTestAndSet: " + "expected Memory Semantics to be 32-bit int")); +} + +TEST_F(ValidateAtomics, AtomicFlagClearAcquire) { + const std::string body = R"( +OpAtomicFlagClear %u32_var %device %acquire +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Memory Semantics Acquire and AcquireRelease cannot be " + "used with AtomicFlagClear")); +} + +TEST_F(ValidateAtomics, AtomicFlagClearNotPointer) { + const std::string body = R"( +OpAtomicFlagClear %u32_1 %device %relaxed +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicFlagClear: " + "expected Pointer to be of type OpTypePointer")); +} + +TEST_F(ValidateAtomics, AtomicFlagClearNotIntPointer) { + const std::string body = R"( +OpAtomicFlagClear %f32_var %device %relaxed +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("AtomicFlagClear: " + "expected Pointer to point to a value of 32-bit int type")); +} + +TEST_F(ValidateAtomics, AtomicFlagClearNotInt32Pointer) { + const std::string body = R"( +OpAtomicFlagClear %u64_var %device %relaxed +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("AtomicFlagClear: " + "expected Pointer to point to a value of 32-bit int type")); +} + +TEST_F(ValidateAtomics, AtomicFlagClearWrongScopeType) { + const std::string body = R"( +OpAtomicFlagClear %u32_var %u64_1 %relaxed +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicFlagClear: expected Scope to be 32-bit int")); +} + +TEST_F(ValidateAtomics, AtomicFlagClearWrongMemorySemanticsType) { + const std::string body = R"( +OpAtomicFlagClear %u32_var %device %u64_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("AtomicFlagClear: expected Memory Semantics to be 32-bit int")); +} + +TEST_F(ValidateAtomics, AtomicIIncrementAcquireAndRelease) { + const std::string body = R"( +OpAtomicStore %u32_var %device %relaxed %u32_1 +%val1 = OpAtomicIIncrement %u32 %u32_var %device %acquire_and_release +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("AtomicIIncrement: no more than one of the following Memory " + "Semantics bits can be set at the same time: Acquire, Release, " + "AcquireRelease or SequentiallyConsistent")); +} + +TEST_F(ValidateAtomics, AtomicUniformMemorySemanticsShader) { + const std::string body = R"( +OpAtomicStore %u32_var %device %relaxed %u32_1 +%val1 = OpAtomicIIncrement %u32 %u32_var %device %acquire_release_uniform_workgroup +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateAtomics, AtomicUniformMemorySemanticsKernel) { + const std::string body = R"( +OpAtomicStore %u32_var %device %relaxed %u32_1 +%val1 = OpAtomicIIncrement %u32 %u32_var %device %acquire_release_uniform_workgroup +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicIIncrement: Memory Semantics UniformMemory " + "requires capability Shader")); +} + +TEST_F(ValidateAtomics, AtomicCounterMemorySemanticsNoCapability) { + const std::string body = R"( +OpAtomicStore %u32_var %device %relaxed %u32_1 +%val1 = OpAtomicIIncrement %u32 %u32_var %device %acquire_release_atomic_counter_workgroup +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("AtomicIIncrement: Memory Semantics UniformMemory " + "requires capability AtomicStorage")); +} + +TEST_F(ValidateAtomics, AtomicCounterMemorySemanticsWithCapability) { + const std::string body = R"( +OpAtomicStore %u32_var %device %relaxed %u32_1 +%val1 = OpAtomicIIncrement %u32 %u32_var %device %acquire_release_atomic_counter_workgroup +)"; + + CompileSuccessfully(GenerateKernelCode(body, "OpCapability AtomicStorage\n")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_barriers_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_barriers_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_barriers_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_barriers_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,612 @@ +// Copyright (c) 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include + +#include "gmock/gmock.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using ::testing::HasSubstr; +using ::testing::Not; + +using ValidateBarriers = spvtest::ValidateBase; + +std::string GenerateShaderCode( + const std::string& body, + const std::string& capabilities_and_extensions = "", + const std::string& execution_model = "GLCompute") { + std::ostringstream ss; + ss << R"( +OpCapability Shader +OpCapability Int64 +)"; + + ss << capabilities_and_extensions; + ss << "OpMemoryModel Logical GLSL450\n"; + ss << "OpEntryPoint " << execution_model << " %main \"main\"\n"; + + ss << R"( +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f32 = OpTypeFloat 32 +%u32 = OpTypeInt 32 0 +%u64 = OpTypeInt 64 0 + +%f32_0 = OpConstant %f32 0 +%f32_1 = OpConstant %f32 1 +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u32_4 = OpConstant %u32 4 +%u64_0 = OpConstant %u64 0 +%u64_1 = OpConstant %u64 1 + +%cross_device = OpConstant %u32 0 +%device = OpConstant %u32 1 +%workgroup = OpConstant %u32 2 +%subgroup = OpConstant %u32 3 +%invocation = OpConstant %u32 4 + +%none = OpConstant %u32 0 +%acquire = OpConstant %u32 2 +%release = OpConstant %u32 4 +%acquire_release = OpConstant %u32 8 +%acquire_and_release = OpConstant %u32 6 +%sequentially_consistent = OpConstant %u32 16 +%acquire_release_uniform_workgroup = OpConstant %u32 328 +%acquire_and_release_uniform = OpConstant %u32 70 +%acquire_release_subgroup = OpConstant %u32 136 +%uniform = OpConstant %u32 64 + +%main = OpFunction %void None %func +%main_entry = OpLabel +)"; + + ss << body; + + ss << R"( +OpReturn +OpFunctionEnd)"; + + return ss.str(); +} + +std::string GenerateKernelCode( + const std::string& body, + const std::string& capabilities_and_extensions = "") { + std::ostringstream ss; + ss << R"( +OpCapability Addresses +OpCapability Kernel +OpCapability Linkage +OpCapability Int64 +OpCapability NamedBarrier +)"; + + ss << capabilities_and_extensions; + ss << R"( +OpMemoryModel Physical32 OpenCL +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f32 = OpTypeFloat 32 +%u32 = OpTypeInt 32 0 +%u64 = OpTypeInt 64 0 + +%f32_0 = OpConstant %f32 0 +%f32_1 = OpConstant %f32 1 +%f32_4 = OpConstant %f32 4 +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u32_4 = OpConstant %u32 4 +%u64_0 = OpConstant %u64 0 +%u64_1 = OpConstant %u64 1 +%u64_4 = OpConstant %u64 4 + +%cross_device = OpConstant %u32 0 +%device = OpConstant %u32 1 +%workgroup = OpConstant %u32 2 +%subgroup = OpConstant %u32 3 +%invocation = OpConstant %u32 4 + +%none = OpConstant %u32 0 +%acquire = OpConstant %u32 2 +%release = OpConstant %u32 4 +%acquire_release = OpConstant %u32 8 +%acquire_and_release = OpConstant %u32 6 +%sequentially_consistent = OpConstant %u32 16 +%acquire_release_uniform_workgroup = OpConstant %u32 328 +%acquire_and_release_uniform = OpConstant %u32 70 +%uniform = OpConstant %u32 64 + +%named_barrier = OpTypeNamedBarrier + +%main = OpFunction %void None %func +%main_entry = OpLabel +)"; + + ss << body; + + ss << R"( +OpReturn +OpFunctionEnd)"; + + return ss.str(); +} + +TEST_F(ValidateBarriers, OpControlBarrierGLComputeSuccess) { + const std::string body = R"( +OpControlBarrier %device %device %none +OpControlBarrier %workgroup %workgroup %acquire +OpControlBarrier %workgroup %device %release +OpControlBarrier %cross_device %cross_device %acquire_release +OpControlBarrier %cross_device %cross_device %sequentially_consistent +OpControlBarrier %cross_device %cross_device %acquire_release_uniform_workgroup +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateBarriers, OpControlBarrierKernelSuccess) { + const std::string body = R"( +OpControlBarrier %device %device %none +OpControlBarrier %workgroup %workgroup %acquire +OpControlBarrier %workgroup %device %release +OpControlBarrier %cross_device %cross_device %acquire_release +OpControlBarrier %cross_device %cross_device %sequentially_consistent +OpControlBarrier %cross_device %cross_device %acquire_release_uniform_workgroup +)"; + + CompileSuccessfully(GenerateKernelCode(body), SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); +} + +TEST_F(ValidateBarriers, OpControlBarrierTesselationControlSuccess) { + const std::string body = R"( +OpControlBarrier %device %device %none +OpControlBarrier %workgroup %workgroup %acquire +OpControlBarrier %workgroup %device %release +OpControlBarrier %cross_device %cross_device %acquire_release +OpControlBarrier %cross_device %cross_device %sequentially_consistent +OpControlBarrier %cross_device %cross_device %acquire_release_uniform_workgroup +)"; + + CompileSuccessfully(GenerateShaderCode(body, "OpCapability Tessellation\n", + "TessellationControl")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateBarriers, OpControlBarrierVulkanSuccess) { + const std::string body = R"( +OpControlBarrier %workgroup %device %none +OpControlBarrier %workgroup %workgroup %acquire_release_uniform_workgroup +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); +} + +TEST_F(ValidateBarriers, OpControlBarrierExecutionModelFragmentSpirv12) { + const std::string body = R"( +OpControlBarrier %device %device %none +)"; + + CompileSuccessfully(GenerateShaderCode(body, "", "Fragment"), + SPV_ENV_UNIVERSAL_1_2); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_2)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpControlBarrier requires one of the following Execution " + "Models: TessellationControl, GLCompute or Kernel")); +} + +TEST_F(ValidateBarriers, OpControlBarrierExecutionModelFragmentSpirv13) { + const std::string body = R"( +OpControlBarrier %device %device %none +)"; + + CompileSuccessfully(GenerateShaderCode(body, "", "Fragment"), + SPV_ENV_UNIVERSAL_1_3); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3)); +} + +TEST_F(ValidateBarriers, OpControlBarrierFloatExecutionScope) { + const std::string body = R"( +OpControlBarrier %f32_1 %device %none +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("ControlBarrier: expected Execution Scope to be a 32-bit int")); +} + +TEST_F(ValidateBarriers, OpControlBarrierU64ExecutionScope) { + const std::string body = R"( +OpControlBarrier %u64_1 %device %none +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("ControlBarrier: expected Execution Scope to be a 32-bit int")); +} + +TEST_F(ValidateBarriers, OpControlBarrierFloatMemoryScope) { + const std::string body = R"( +OpControlBarrier %device %f32_1 %none +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("ControlBarrier: expected Memory Scope to be a 32-bit int")); +} + +TEST_F(ValidateBarriers, OpControlBarrierU64MemoryScope) { + const std::string body = R"( +OpControlBarrier %device %u64_1 %none +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("ControlBarrier: expected Memory Scope to be a 32-bit int")); +} + +TEST_F(ValidateBarriers, OpControlBarrierFloatMemorySemantics) { + const std::string body = R"( +OpControlBarrier %device %device %f32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "ControlBarrier: expected Memory Semantics to be a 32-bit int")); +} + +TEST_F(ValidateBarriers, OpControlBarrierU64MemorySemantics) { + const std::string body = R"( +OpControlBarrier %device %device %u64_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "ControlBarrier: expected Memory Semantics to be a 32-bit int")); +} + +TEST_F(ValidateBarriers, OpControlBarrierVulkanExecutionScopeDevice) { + const std::string body = R"( +OpControlBarrier %device %workgroup %none +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ControlBarrier: in Vulkan environment Execution Scope " + "is limited to Workgroup and Subgroup")); +} + +TEST_F(ValidateBarriers, OpControlBarrierVulkanMemoryScopeSubgroup) { + const std::string body = R"( +OpControlBarrier %subgroup %subgroup %none +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ControlBarrier: in Vulkan environment Memory Scope is " + "limited to Device, Workgroup and Invocation")); +} + +TEST_F(ValidateBarriers, OpControlBarrierAcquireAndRelease) { + const std::string body = R"( +OpControlBarrier %device %device %acquire_and_release_uniform +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ControlBarrier: Memory Semantics can have at most one " + "of the following bits set: Acquire, Release, " + "AcquireRelease or SequentiallyConsistent")); +} + +// TODO(atgoo@github.com): the corresponding check fails Vulkan CTS, +// reenable once fixed. +TEST_F(ValidateBarriers, DISABLED_OpControlBarrierVulkanSubgroupStorageClass) { + const std::string body = R"( +OpControlBarrier %workgroup %device %acquire_release_subgroup +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "ControlBarrier: expected Memory Semantics to include a " + "Vulkan-supported storage class if Memory Semantics is not None")); +} + +TEST_F(ValidateBarriers, OpMemoryBarrierSuccess) { + const std::string body = R"( +OpMemoryBarrier %cross_device %acquire_release_uniform_workgroup +OpMemoryBarrier %device %uniform +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateBarriers, OpMemoryBarrierKernelSuccess) { + const std::string body = R"( +OpMemoryBarrier %cross_device %acquire_release_uniform_workgroup +OpMemoryBarrier %device %uniform +)"; + + CompileSuccessfully(GenerateKernelCode(body), SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); +} + +TEST_F(ValidateBarriers, OpMemoryBarrierVulkanSuccess) { + const std::string body = R"( +OpMemoryBarrier %workgroup %acquire_release_uniform_workgroup +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); +} + +TEST_F(ValidateBarriers, OpMemoryBarrierFloatMemoryScope) { + const std::string body = R"( +OpMemoryBarrier %f32_1 %acquire_release_uniform_workgroup +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("MemoryBarrier: expected Memory Scope to be a 32-bit int")); +} + +TEST_F(ValidateBarriers, OpMemoryBarrierU64MemoryScope) { + const std::string body = R"( +OpMemoryBarrier %u64_1 %acquire_release_uniform_workgroup +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("MemoryBarrier: expected Memory Scope to be a 32-bit int")); +} + +TEST_F(ValidateBarriers, OpMemoryBarrierFloatMemorySemantics) { + const std::string body = R"( +OpMemoryBarrier %device %f32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("MemoryBarrier: expected Memory Semantics to be a 32-bit int")); +} + +TEST_F(ValidateBarriers, OpMemoryBarrierU64MemorySemantics) { + const std::string body = R"( +OpMemoryBarrier %device %u64_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("MemoryBarrier: expected Memory Semantics to be a 32-bit int")); +} + +TEST_F(ValidateBarriers, OpMemoryBarrierVulkanMemoryScopeSubgroup) { + const std::string body = R"( +OpMemoryBarrier %subgroup %acquire_release_uniform_workgroup +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("MemoryBarrier: in Vulkan environment Memory Scope is " + "limited to Device, Workgroup and Invocation")); +} + +TEST_F(ValidateBarriers, OpMemoryBarrierAcquireAndRelease) { + const std::string body = R"( +OpMemoryBarrier %device %acquire_and_release_uniform +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("MemoryBarrier: Memory Semantics can have at most one " + "of the following bits set: Acquire, Release, " + "AcquireRelease or SequentiallyConsistent")); +} + +TEST_F(ValidateBarriers, OpMemoryBarrierVulkanMemorySemanticsNone) { + const std::string body = R"( +OpMemoryBarrier %device %none +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("MemoryBarrier: Vulkan specification requires Memory Semantics " + "to have one of the following bits set: Acquire, Release, " + "AcquireRelease or SequentiallyConsistent")); +} + +TEST_F(ValidateBarriers, OpMemoryBarrierVulkanMemorySemanticsAcquire) { + const std::string body = R"( +OpMemoryBarrier %device %acquire +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("MemoryBarrier: expected Memory Semantics to include a " + "Vulkan-supported storage class")); +} + +TEST_F(ValidateBarriers, OpMemoryBarrierVulkanSubgroupStorageClass) { + const std::string body = R"( +OpMemoryBarrier %device %acquire_release_subgroup +)"; + + CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("MemoryBarrier: expected Memory Semantics to include a " + "Vulkan-supported storage class")); +} + +TEST_F(ValidateBarriers, OpNamedBarrierInitializeSuccess) { + const std::string body = R"( +%barrier = OpNamedBarrierInitialize %named_barrier %u32_4 +)"; + + CompileSuccessfully(GenerateKernelCode(body), SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); +} + +TEST_F(ValidateBarriers, OpNamedBarrierInitializeWrongResultType) { + const std::string body = R"( +%barrier = OpNamedBarrierInitialize %u32 %u32_4 +)"; + + CompileSuccessfully(GenerateKernelCode(body), SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, + ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("NamedBarrierInitialize: expected Result Type to be " + "OpTypeNamedBarrier")); +} + +TEST_F(ValidateBarriers, OpNamedBarrierInitializeFloatSubgroupCount) { + const std::string body = R"( +%barrier = OpNamedBarrierInitialize %named_barrier %f32_4 +)"; + + CompileSuccessfully(GenerateKernelCode(body), SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, + ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("NamedBarrierInitialize: expected Subgroup Count to be " + "a 32-bit int")); +} + +TEST_F(ValidateBarriers, OpNamedBarrierInitializeU64SubgroupCount) { + const std::string body = R"( +%barrier = OpNamedBarrierInitialize %named_barrier %u64_4 +)"; + + CompileSuccessfully(GenerateKernelCode(body), SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, + ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("NamedBarrierInitialize: expected Subgroup Count to be " + "a 32-bit int")); +} + +TEST_F(ValidateBarriers, OpMemoryNamedBarrierSuccess) { + const std::string body = R"( +%barrier = OpNamedBarrierInitialize %named_barrier %u32_4 +OpMemoryNamedBarrier %barrier %workgroup %acquire_release_uniform_workgroup +)"; + + CompileSuccessfully(GenerateKernelCode(body), SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); +} + +TEST_F(ValidateBarriers, OpMemoryNamedBarrierNotNamedBarrier) { + const std::string body = R"( +OpMemoryNamedBarrier %u32_1 %workgroup %acquire_release_uniform_workgroup +)"; + + CompileSuccessfully(GenerateKernelCode(body), SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, + ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("MemoryNamedBarrier: expected Named Barrier to be of " + "type OpTypeNamedBarrier")); +} + +TEST_F(ValidateBarriers, OpMemoryNamedBarrierFloatMemoryScope) { + const std::string body = R"( +%barrier = OpNamedBarrierInitialize %named_barrier %u32_4 +OpMemoryNamedBarrier %barrier %f32_1 %acquire_release_uniform_workgroup +)"; + + CompileSuccessfully(GenerateKernelCode(body), SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, + ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "MemoryNamedBarrier: expected Memory Scope to be a 32-bit int")); +} + +TEST_F(ValidateBarriers, OpMemoryNamedBarrierFloatMemorySemantics) { + const std::string body = R"( +%barrier = OpNamedBarrierInitialize %named_barrier %u32_4 +OpMemoryNamedBarrier %barrier %workgroup %f32_0 +)"; + + CompileSuccessfully(GenerateKernelCode(body), SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, + ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "MemoryNamedBarrier: expected Memory Semantics to be a 32-bit int")); +} + +TEST_F(ValidateBarriers, OpMemoryNamedBarrierAcquireAndRelease) { + const std::string body = R"( +%barrier = OpNamedBarrierInitialize %named_barrier %u32_4 +OpMemoryNamedBarrier %barrier %workgroup %acquire_and_release_uniform +)"; + + CompileSuccessfully(GenerateKernelCode(body), SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, + ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("MemoryNamedBarrier: Memory Semantics can have at most " + "one of the following bits set: Acquire, Release, " + "AcquireRelease or SequentiallyConsistent")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_bitwise_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_bitwise_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_bitwise_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_bitwise_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,544 @@ +// Copyright (c) 2017 Google 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. + +// Tests for unique type declaration rules validator. + +#include + +#include "gmock/gmock.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using ::testing::HasSubstr; +using ::testing::Not; + +using ValidateBitwise = spvtest::ValidateBase; + +std::string GenerateShaderCode( + const std::string& body, + const std::string& capabilities_and_extensions = "") { + const std::string capabilities = + R"( +OpCapability Shader +OpCapability Int64 +OpCapability Float64)"; + + const std::string after_extension_before_body = + R"( +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f32 = OpTypeFloat 32 +%u32 = OpTypeInt 32 0 +%s32 = OpTypeInt 32 1 +%f64 = OpTypeFloat 64 +%u64 = OpTypeInt 64 0 +%s64 = OpTypeInt 64 1 +%boolvec2 = OpTypeVector %bool 2 +%s32vec2 = OpTypeVector %s32 2 +%u32vec2 = OpTypeVector %u32 2 +%u64vec2 = OpTypeVector %u64 2 +%f32vec2 = OpTypeVector %f32 2 +%f64vec2 = OpTypeVector %f64 2 +%boolvec3 = OpTypeVector %bool 3 +%u32vec3 = OpTypeVector %u32 3 +%u64vec3 = OpTypeVector %u64 3 +%s32vec3 = OpTypeVector %s32 3 +%f32vec3 = OpTypeVector %f32 3 +%f64vec3 = OpTypeVector %f64 3 +%boolvec4 = OpTypeVector %bool 4 +%u32vec4 = OpTypeVector %u32 4 +%u64vec4 = OpTypeVector %u64 4 +%s32vec4 = OpTypeVector %s32 4 +%f32vec4 = OpTypeVector %f32 4 +%f64vec4 = OpTypeVector %f64 4 + +%f32_0 = OpConstant %f32 0 +%f32_1 = OpConstant %f32 1 +%f32_2 = OpConstant %f32 2 +%f32_3 = OpConstant %f32 3 +%f32_4 = OpConstant %f32 4 + +%s32_0 = OpConstant %s32 0 +%s32_1 = OpConstant %s32 1 +%s32_2 = OpConstant %s32 2 +%s32_3 = OpConstant %s32 3 +%s32_4 = OpConstant %s32 4 +%s32_m1 = OpConstant %s32 -1 + +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u32_2 = OpConstant %u32 2 +%u32_3 = OpConstant %u32 3 +%u32_4 = OpConstant %u32 4 + +%f64_0 = OpConstant %f64 0 +%f64_1 = OpConstant %f64 1 +%f64_2 = OpConstant %f64 2 +%f64_3 = OpConstant %f64 3 +%f64_4 = OpConstant %f64 4 + +%s64_0 = OpConstant %s64 0 +%s64_1 = OpConstant %s64 1 +%s64_2 = OpConstant %s64 2 +%s64_3 = OpConstant %s64 3 +%s64_4 = OpConstant %s64 4 +%s64_m1 = OpConstant %s64 -1 + +%u64_0 = OpConstant %u64 0 +%u64_1 = OpConstant %u64 1 +%u64_2 = OpConstant %u64 2 +%u64_3 = OpConstant %u64 3 +%u64_4 = OpConstant %u64 4 + +%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 +%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 +%u32vec3_012 = OpConstantComposite %u32vec3 %u32_0 %u32_1 %u32_2 +%u32vec3_123 = OpConstantComposite %u32vec3 %u32_1 %u32_2 %u32_3 +%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 +%u32vec4_1234 = OpConstantComposite %u32vec4 %u32_1 %u32_2 %u32_3 %u32_4 + +%s32vec2_01 = OpConstantComposite %s32vec2 %s32_0 %s32_1 +%s32vec2_12 = OpConstantComposite %s32vec2 %s32_1 %s32_2 +%s32vec3_012 = OpConstantComposite %s32vec3 %s32_0 %s32_1 %s32_2 +%s32vec3_123 = OpConstantComposite %s32vec3 %s32_1 %s32_2 %s32_3 +%s32vec4_0123 = OpConstantComposite %s32vec4 %s32_0 %s32_1 %s32_2 %s32_3 +%s32vec4_1234 = OpConstantComposite %s32vec4 %s32_1 %s32_2 %s32_3 %s32_4 + +%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 +%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 +%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 +%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 +%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 +%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 + +%main = OpFunction %void None %func +%main_entry = OpLabel)"; + + const std::string after_body = + R"( +OpReturn +OpFunctionEnd)"; + + return capabilities + capabilities_and_extensions + + after_extension_before_body + body + after_body; +} + +TEST_F(ValidateBitwise, ShiftAllSuccess) { + const std::string body = R"( +%val1 = OpShiftRightLogical %u64 %u64_1 %s32_2 +%val2 = OpShiftRightArithmetic %s32vec2 %s32vec2_12 %s32vec2_12 +%val3 = OpShiftLeftLogical %u32vec2 %s32vec2_12 %u32vec2_12 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateBitwise, OpShiftRightLogicalWrongResultType) { + const std::string body = R"( +%val1 = OpShiftRightLogical %bool %u64_1 %s32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected int scalar or vector type as Result Type: " + "ShiftRightLogical")); +} + +TEST_F(ValidateBitwise, OpShiftRightLogicalBaseNotInt) { + const std::string body = R"( +%val1 = OpShiftRightLogical %u32 %f32_1 %s32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Base to be int scalar or vector: ShiftRightLogical")); +} + +TEST_F(ValidateBitwise, OpShiftRightLogicalBaseWrongDimension) { + const std::string body = R"( +%val1 = OpShiftRightLogical %u32 %u32vec2_12 %s32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Base to have the same dimension as Result Type: " + "ShiftRightLogical")); +} + +TEST_F(ValidateBitwise, OpShiftRightLogicalBaseWrongBitWidth) { + const std::string body = R"( +%val1 = OpShiftRightLogical %u64 %u32_1 %s32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Base to have the same bit width as Result Type: " + "ShiftRightLogical")); +} + +TEST_F(ValidateBitwise, OpShiftRightLogicalShiftNotInt) { + const std::string body = R"( +%val1 = OpShiftRightLogical %u32 %u32_1 %f32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected Shift to be int scalar or vector: ShiftRightLogical")); +} + +TEST_F(ValidateBitwise, OpShiftRightLogicalShiftWrongDimension) { + const std::string body = R"( +%val1 = OpShiftRightLogical %u32 %u32_1 %s32vec2_12 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Shift to have the same dimension as Result Type: " + "ShiftRightLogical")); +} + +TEST_F(ValidateBitwise, LogicAllSuccess) { + const std::string body = R"( +%val1 = OpBitwiseOr %u64 %u64_1 %s64_0 +%val2 = OpBitwiseAnd %s64 %s64_1 %u64_0 +%val3 = OpBitwiseXor %s32vec2 %s32vec2_12 %u32vec2_01 +%val4 = OpNot %s32vec2 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateBitwise, OpBitwiseAndWrongResultType) { + const std::string body = R"( +%val1 = OpBitwiseAnd %bool %u64_1 %s32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected int scalar or vector type as Result Type: BitwiseAnd")); +} + +TEST_F(ValidateBitwise, OpBitwiseAndLeftNotInt) { + const std::string body = R"( +%val1 = OpBitwiseAnd %u32 %f32_1 %s32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected int scalar or vector as operand: BitwiseAnd " + "operand index 2")); +} + +TEST_F(ValidateBitwise, OpBitwiseAndRightNotInt) { + const std::string body = R"( +%val1 = OpBitwiseAnd %u32 %u32_1 %f32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected int scalar or vector as operand: BitwiseAnd " + "operand index 3")); +} + +TEST_F(ValidateBitwise, OpBitwiseAndLeftWrongDimension) { + const std::string body = R"( +%val1 = OpBitwiseAnd %u32 %u32vec2_12 %s32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected operands to have the same dimension as Result Type: " + "BitwiseAnd operand index 2")); +} + +TEST_F(ValidateBitwise, OpBitwiseAndRightWrongDimension) { + const std::string body = R"( +%val1 = OpBitwiseAnd %u32 %s32_2 %u32vec2_12 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected operands to have the same dimension as Result Type: " + "BitwiseAnd operand index 3")); +} + +TEST_F(ValidateBitwise, OpBitwiseAndLeftWrongBitWidth) { + const std::string body = R"( +%val1 = OpBitwiseAnd %u64 %u32_1 %s64_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected operands to have the same bit width as Result Type: " + "BitwiseAnd operand index 2")); +} + +TEST_F(ValidateBitwise, OpBitwiseAndRightWrongBitWidth) { + const std::string body = R"( +%val1 = OpBitwiseAnd %u64 %u64_1 %s32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected operands to have the same bit width as Result Type: " + "BitwiseAnd operand index 3")); +} + +TEST_F(ValidateBitwise, OpBitFieldInsertSuccess) { + const std::string body = R"( +%val1 = OpBitFieldInsert %u64 %u64_1 %u64_2 %s32_1 %s32_2 +%val2 = OpBitFieldInsert %s32vec2 %s32vec2_12 %s32vec2_12 %s32_1 %u32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateBitwise, OpBitFieldInsertWrongResultType) { + const std::string body = R"( +%val1 = OpBitFieldInsert %bool %u64_1 %u64_2 %s32_1 %s32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected int scalar or vector type as Result Type: BitFieldInsert")); +} + +TEST_F(ValidateBitwise, OpBitFieldInsertWrongBaseType) { + const std::string body = R"( +%val1 = OpBitFieldInsert %u64 %s64_1 %u64_2 %s32_1 %s32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected Base Type to be equal to Result Type: BitFieldInsert")); +} + +TEST_F(ValidateBitwise, OpBitFieldInsertWrongInsertType) { + const std::string body = R"( +%val1 = OpBitFieldInsert %u64 %u64_1 %s64_2 %s32_1 %s32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected Insert Type to be equal to Result Type: BitFieldInsert")); +} + +TEST_F(ValidateBitwise, OpBitFieldInsertOffsetNotInt) { + const std::string body = R"( +%val1 = OpBitFieldInsert %u64 %u64_1 %u64_2 %f32_1 %s32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Offset Type to be int scalar: BitFieldInsert")); +} + +TEST_F(ValidateBitwise, OpBitFieldInsertCountNotInt) { + const std::string body = R"( +%val1 = OpBitFieldInsert %u64 %u64_1 %u64_2 %u32_1 %f32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Count Type to be int scalar: BitFieldInsert")); +} + +TEST_F(ValidateBitwise, OpBitFieldSExtractSuccess) { + const std::string body = R"( +%val1 = OpBitFieldSExtract %u64 %u64_1 %s32_1 %s32_2 +%val2 = OpBitFieldSExtract %s32vec2 %s32vec2_12 %s32_1 %u32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateBitwise, OpBitFieldSExtractWrongResultType) { + const std::string body = R"( +%val1 = OpBitFieldSExtract %bool %u64_1 %s32_1 %s32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected int scalar or vector type as Result Type: " + "BitFieldSExtract")); +} + +TEST_F(ValidateBitwise, OpBitFieldSExtractWrongBaseType) { + const std::string body = R"( +%val1 = OpBitFieldSExtract %u64 %s64_1 %s32_1 %s32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected Base Type to be equal to Result Type: BitFieldSExtract")); +} + +TEST_F(ValidateBitwise, OpBitFieldSExtractOffsetNotInt) { + const std::string body = R"( +%val1 = OpBitFieldSExtract %u64 %u64_1 %f32_1 %s32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Offset Type to be int scalar: BitFieldSExtract")); +} + +TEST_F(ValidateBitwise, OpBitFieldSExtractCountNotInt) { + const std::string body = R"( +%val1 = OpBitFieldSExtract %u64 %u64_1 %u32_1 %f32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Count Type to be int scalar: BitFieldSExtract")); +} + +TEST_F(ValidateBitwise, OpBitReverseSuccess) { + const std::string body = R"( +%val1 = OpBitReverse %u64 %u64_1 +%val2 = OpBitReverse %s32vec2 %s32vec2_12 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateBitwise, OpBitReverseWrongResultType) { + const std::string body = R"( +%val1 = OpBitReverse %bool %u64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected int scalar or vector type as Result Type: BitReverse")); +} + +TEST_F(ValidateBitwise, OpBitReverseWrongBaseType) { + const std::string body = R"( +%val1 = OpBitReverse %u64 %s64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Base Type to be equal to Result Type: BitReverse")); +} + +TEST_F(ValidateBitwise, OpBitCountSuccess) { + const std::string body = R"( +%val1 = OpBitCount %s32 %u64_1 +%val2 = OpBitCount %u32vec2 %s32vec2_12 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateBitwise, OpBitCountWrongResultType) { + const std::string body = R"( +%val1 = OpBitCount %bool %u64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected int scalar or vector type as Result Type: BitCount")); +} + +TEST_F(ValidateBitwise, OpBitCountBaseNotInt) { + const std::string body = R"( +%val1 = OpBitCount %u32 %f64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Base Type to be int scalar or vector: BitCount")); +} + +TEST_F(ValidateBitwise, OpBitCountBaseWrongDimension) { + const std::string body = R"( +%val1 = OpBitCount %u32 %u32vec2_12 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Base dimension to be equal to Result Type dimension: " + "BitCount")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_builtins_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_builtins_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_builtins_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_builtins_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1924 @@ +// Copyright (c) 2018 Google LLC. +// +// 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. + +// Tests validation rules of GLSL.450.std and OpenCL.std extended instructions. +// Doesn't test OpenCL.std vector size 2, 3, 4, 8 or 16 rules (not supported +// by standard SPIR-V). + +#include +#include +#include +#include + +#include "gmock/gmock.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +struct TestResult { + TestResult(spv_result_t in_validation_result = SPV_SUCCESS, + const char* in_error_str = nullptr, + const char* in_error_str2 = nullptr) + : validation_result(in_validation_result), + error_str(in_error_str), + error_str2(in_error_str2) {} + spv_result_t validation_result; + const char* error_str; + const char* error_str2; +}; + +using ::testing::Combine; +using ::testing::HasSubstr; +using ::testing::Not; +using ::testing::Values; +using ::testing::ValuesIn; + +using ValidateBuiltIns = spvtest::ValidateBase; +using ValidateVulkanCombineBuiltInExecutionModelDataTypeResult = + spvtest::ValidateBase>; + +struct EntryPoint { + std::string name; + std::string execution_model; + std::string execution_modes; + std::string body; +}; + +class CodeGenerator { + public: + std::string Build() const; + + std::vector entry_points_; + std::string capabilities_; + std::string extensions_; + std::string memory_model_; + std::string before_types_; + std::string types_; + std::string after_types_; + std::string add_at_the_end_; +}; + +std::string CodeGenerator::Build() const { + std::ostringstream ss; + + ss << capabilities_; + ss << extensions_; + ss << memory_model_; + + for (const EntryPoint& entry_point : entry_points_) { + ss << "OpEntryPoint " << entry_point.execution_model << " %" + << entry_point.name << " \"" << entry_point.name << "\"\n"; + } + + for (const EntryPoint& entry_point : entry_points_) { + ss << entry_point.execution_modes << "\n"; + } + + ss << before_types_; + ss << types_; + ss << after_types_; + + for (const EntryPoint& entry_point : entry_points_) { + ss << "\n"; + ss << "%" << entry_point.name << " = OpFunction %void None %func\n"; + ss << "%" << entry_point.name << "_entry = OpLabel\n"; + ss << entry_point.body; + ss << "\nOpReturn\nOpFunctionEnd\n"; + } + + ss << add_at_the_end_; + + return ss.str(); +} + +std::string GetDefaultShaderCapabilities() { + return R"( +OpCapability Shader +OpCapability Geometry +OpCapability Tessellation +OpCapability Float64 +OpCapability Int64 +OpCapability MultiViewport +OpCapability SampleRateShading +)"; +} + +std::string GetDefaultShaderTypes() { + return R"( +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f32 = OpTypeFloat 32 +%f64 = OpTypeFloat 64 +%u32 = OpTypeInt 32 0 +%u64 = OpTypeInt 64 0 +%f32vec2 = OpTypeVector %f32 2 +%f32vec3 = OpTypeVector %f32 3 +%f32vec4 = OpTypeVector %f32 4 +%f64vec2 = OpTypeVector %f64 2 +%f64vec3 = OpTypeVector %f64 3 +%f64vec4 = OpTypeVector %f64 4 +%u32vec2 = OpTypeVector %u32 2 +%u32vec3 = OpTypeVector %u32 3 +%u64vec3 = OpTypeVector %u64 3 +%u32vec4 = OpTypeVector %u32 4 +%u64vec2 = OpTypeVector %u64 2 + +%f32_0 = OpConstant %f32 0 +%f32_1 = OpConstant %f32 1 +%f32_2 = OpConstant %f32 2 +%f32_3 = OpConstant %f32 3 +%f32_4 = OpConstant %f32 4 +%f32_h = OpConstant %f32 0.5 +%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 +%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 +%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 +%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 +%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 +%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 + +%f64_0 = OpConstant %f64 0 +%f64_1 = OpConstant %f64 1 +%f64_2 = OpConstant %f64 2 +%f64_3 = OpConstant %f64 3 +%f64vec2_01 = OpConstantComposite %f64vec2 %f64_0 %f64_1 +%f64vec3_012 = OpConstantComposite %f64vec3 %f64_0 %f64_1 %f64_2 +%f64vec4_0123 = OpConstantComposite %f64vec4 %f64_0 %f64_1 %f64_2 %f64_3 + +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u32_2 = OpConstant %u32 2 +%u32_3 = OpConstant %u32 3 +%u32_4 = OpConstant %u32 4 + +%u64_0 = OpConstant %u64 0 +%u64_1 = OpConstant %u64 1 +%u64_2 = OpConstant %u64 2 +%u64_3 = OpConstant %u64 3 + +%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 +%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 +%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 +%u64vec2_01 = OpConstantComposite %u64vec2 %u64_0 %u64_1 + +%u32arr2 = OpTypeArray %u32 %u32_2 +%u32arr3 = OpTypeArray %u32 %u32_3 +%u32arr4 = OpTypeArray %u32 %u32_4 +%u64arr2 = OpTypeArray %u64 %u32_2 +%u64arr3 = OpTypeArray %u64 %u32_3 +%u64arr4 = OpTypeArray %u64 %u32_4 +%f32arr2 = OpTypeArray %f32 %u32_2 +%f32arr3 = OpTypeArray %f32 %u32_3 +%f32arr4 = OpTypeArray %f32 %u32_4 +%f64arr2 = OpTypeArray %f64 %u32_2 +%f64arr3 = OpTypeArray %f64 %u32_3 +%f64arr4 = OpTypeArray %f64 %u32_4 +)"; +} + +CodeGenerator GetDefaultShaderCodeGenerator() { + CodeGenerator generator; + generator.capabilities_ = GetDefaultShaderCapabilities(); + generator.memory_model_ = "OpMemoryModel Logical GLSL450\n"; + generator.types_ = GetDefaultShaderTypes(); + return generator; +} + +TEST_P(ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, InMain) { + const char* const built_in = std::get<0>(GetParam()); + const char* const execution_model = std::get<1>(GetParam()); + const char* const storage_class = std::get<2>(GetParam()); + const char* const data_type = std::get<3>(GetParam()); + const TestResult& test_result = std::get<4>(GetParam()); + + CodeGenerator generator = GetDefaultShaderCodeGenerator(); + generator.before_types_ = "OpMemberDecorate %built_in_type 0 BuiltIn "; + generator.before_types_ += built_in; + generator.before_types_ += "\n"; + + std::ostringstream after_types; + after_types << "%built_in_type = OpTypeStruct " << data_type << "\n"; + after_types << "%built_in_ptr = OpTypePointer " << storage_class + << " %built_in_type\n"; + after_types << "%built_in_var = OpVariable %built_in_ptr " << storage_class + << "\n"; + after_types << "%data_ptr = OpTypePointer " << storage_class << " " + << data_type << "\n"; + generator.after_types_ = after_types.str(); + + EntryPoint entry_point; + entry_point.name = "main"; + entry_point.execution_model = execution_model; + + std::ostringstream execution_modes; + if (0 == std::strcmp(execution_model, "Fragment")) { + execution_modes << "OpExecutionMode %" << entry_point.name + << " OriginUpperLeft\n"; + } + if (0 == std::strcmp(built_in, "FragDepth")) { + execution_modes << "OpExecutionMode %" << entry_point.name + << " DepthReplacing\n"; + } + entry_point.execution_modes = execution_modes.str(); + + entry_point.body = R"( +%ptr = OpAccessChain %data_ptr %built_in_var %u32_0 +)"; + generator.entry_points_.push_back(std::move(entry_point)); + + CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(test_result.validation_result, + ValidateInstructions(SPV_ENV_VULKAN_1_0)); + if (test_result.error_str) { + EXPECT_THAT(getDiagnosticString(), HasSubstr(test_result.error_str)); + } + if (test_result.error_str2) { + EXPECT_THAT(getDiagnosticString(), HasSubstr(test_result.error_str2)); + } +} + +TEST_P(ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, InFunction) { + const char* const built_in = std::get<0>(GetParam()); + const char* const execution_model = std::get<1>(GetParam()); + const char* const storage_class = std::get<2>(GetParam()); + const char* const data_type = std::get<3>(GetParam()); + const TestResult& test_result = std::get<4>(GetParam()); + + CodeGenerator generator = GetDefaultShaderCodeGenerator(); + generator.before_types_ = "OpMemberDecorate %built_in_type 0 BuiltIn "; + generator.before_types_ += built_in; + generator.before_types_ += "\n"; + + std::ostringstream after_types; + after_types << "%built_in_type = OpTypeStruct " << data_type << "\n"; + after_types << "%built_in_ptr = OpTypePointer " << storage_class + << " %built_in_type\n"; + after_types << "%built_in_var = OpVariable %built_in_ptr " << storage_class + << "\n"; + after_types << "%data_ptr = OpTypePointer " << storage_class << " " + << data_type << "\n"; + generator.after_types_ = after_types.str(); + + EntryPoint entry_point; + entry_point.name = "main"; + entry_point.execution_model = execution_model; + + std::ostringstream execution_modes; + if (0 == std::strcmp(execution_model, "Fragment")) { + execution_modes << "OpExecutionMode %" << entry_point.name + << " OriginUpperLeft\n"; + } + if (0 == std::strcmp(built_in, "FragDepth")) { + execution_modes << "OpExecutionMode %" << entry_point.name + << " DepthReplacing\n"; + } + entry_point.execution_modes = execution_modes.str(); + + entry_point.body = R"( +%val2 = OpFunctionCall %void %foo +)"; + + generator.add_at_the_end_ = R"( +%foo = OpFunction %void None %func +%foo_entry = OpLabel +%ptr = OpAccessChain %data_ptr %built_in_var %u32_0 +OpReturn +OpFunctionEnd +)"; + generator.entry_points_.push_back(std::move(entry_point)); + + CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(test_result.validation_result, + ValidateInstructions(SPV_ENV_VULKAN_1_0)); + if (test_result.error_str) { + EXPECT_THAT(getDiagnosticString(), HasSubstr(test_result.error_str)); + } + if (test_result.error_str2) { + EXPECT_THAT(getDiagnosticString(), HasSubstr(test_result.error_str2)); + } +} + +TEST_P(ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, Variable) { + const char* const built_in = std::get<0>(GetParam()); + const char* const execution_model = std::get<1>(GetParam()); + const char* const storage_class = std::get<2>(GetParam()); + const char* const data_type = std::get<3>(GetParam()); + const TestResult& test_result = std::get<4>(GetParam()); + + CodeGenerator generator = GetDefaultShaderCodeGenerator(); + generator.before_types_ = "OpDecorate %built_in_var BuiltIn "; + generator.before_types_ += built_in; + generator.before_types_ += "\n"; + + std::ostringstream after_types; + after_types << "%built_in_ptr = OpTypePointer " << storage_class << " " + << data_type << "\n"; + after_types << "%built_in_var = OpVariable %built_in_ptr " << storage_class + << "\n"; + generator.after_types_ = after_types.str(); + + EntryPoint entry_point; + entry_point.name = "main"; + entry_point.execution_model = execution_model; + // Any kind of reference would do. + entry_point.body = R"( +%val = OpBitcast %u64 %built_in_var +)"; + + std::ostringstream execution_modes; + if (0 == std::strcmp(execution_model, "Fragment")) { + execution_modes << "OpExecutionMode %" << entry_point.name + << " OriginUpperLeft\n"; + } + if (0 == std::strcmp(built_in, "FragDepth")) { + execution_modes << "OpExecutionMode %" << entry_point.name + << " DepthReplacing\n"; + } + entry_point.execution_modes = execution_modes.str(); + + generator.entry_points_.push_back(std::move(entry_point)); + + CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(test_result.validation_result, + ValidateInstructions(SPV_ENV_VULKAN_1_0)); + if (test_result.error_str) { + EXPECT_THAT(getDiagnosticString(), HasSubstr(test_result.error_str)); + } + if (test_result.error_str2) { + EXPECT_THAT(getDiagnosticString(), HasSubstr(test_result.error_str2)); + } +} + +INSTANTIATE_TEST_CASE_P( + ClipAndCullDistanceOutputSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("ClipDistance", "CullDistance"), + Values("Vertex", "Geometry", "TessellationControl", + "TessellationEvaluation"), + Values("Output"), Values("%f32arr2", "%f32arr4"), + Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + ClipAndCullDistanceInputSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("ClipDistance", "CullDistance"), + Values("Fragment", "Geometry", "TessellationControl", + "TessellationEvaluation"), + Values("Input"), Values("%f32arr2", "%f32arr4"), + Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + ClipAndCullDistanceFragmentOutput, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("ClipDistance", "CullDistance"), Values("Fragment"), + Values("Output"), Values("%f32arr4"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "Vulkan spec doesn't allow BuiltIn ClipDistance/CullDistance " + "to be used for variables with Output storage class if " + "execution model is Fragment.", + "which is called with execution model Fragment."))), ); + +INSTANTIATE_TEST_CASE_P( + ClipAndCullDistanceVertexInput, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("ClipDistance", "CullDistance"), Values("Vertex"), + Values("Input"), Values("%f32arr4"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "Vulkan spec doesn't allow BuiltIn ClipDistance/CullDistance " + "to be used for variables with Input storage class if " + "execution model is Vertex.", + "which is called with execution model Vertex."))), ); + +INSTANTIATE_TEST_CASE_P( + ClipAndCullInvalidExecutionModel, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("ClipDistance", "CullDistance"), Values("GLCompute"), + Values("Input", "Output"), Values("%f32arr4"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "to be used only with Fragment, Vertex, TessellationControl, " + "TessellationEvaluation or Geometry execution models"))), ); + +INSTANTIATE_TEST_CASE_P( + ClipAndCullDistanceNotArray, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("ClipDistance", "CullDistance"), Values("Fragment"), + Values("Input"), Values("%f32vec2", "%f32vec4", "%f32"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit float array", + "is not an array"))), ); + +INSTANTIATE_TEST_CASE_P( + ClipAndCullDistanceNotFloatArray, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("ClipDistance", "CullDistance"), Values("Fragment"), + Values("Input"), Values("%u32arr2", "%u64arr4"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit float array", + "components are not float scalar"))), ); + +INSTANTIATE_TEST_CASE_P( + ClipAndCullDistanceNotF32Array, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("ClipDistance", "CullDistance"), Values("Fragment"), + Values("Input"), Values("%f64arr2", "%f64arr4"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit float array", + "has components with bit width 64"))), ); + +INSTANTIATE_TEST_CASE_P( + FragCoordSuccess, ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("FragCoord"), Values("Fragment"), Values("Input"), + Values("%f32vec4"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + FragCoordNotFragment, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine( + Values("FragCoord"), + Values("Vertex", "GLCompute", "Geometry", "TessellationControl", + "TessellationEvaluation"), + Values("Input"), Values("%f32vec4"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "to be used only with Fragment execution model"))), ); + +INSTANTIATE_TEST_CASE_P( + FragCoordNotInput, ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("FragCoord"), Values("Fragment"), Values("Output"), + Values("%f32vec4"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "to be only used for variables with Input storage class", + "uses storage class Output"))), ); + +INSTANTIATE_TEST_CASE_P( + FragCoordNotFloatVector, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("FragCoord"), Values("Fragment"), Values("Input"), + Values("%f32arr4", "%u32vec4"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 4-component 32-bit float vector", + "is not a float vector"))), ); + +INSTANTIATE_TEST_CASE_P( + FragCoordNotFloatVec4, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("FragCoord"), Values("Fragment"), Values("Input"), + Values("%f32vec3"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 4-component 32-bit float vector", + "has 3 components"))), ); + +INSTANTIATE_TEST_CASE_P( + FragCoordNotF32Vec4, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("FragCoord"), Values("Fragment"), Values("Input"), + Values("%f64vec4"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 4-component 32-bit float vector", + "has components with bit width 64"))), ); + +INSTANTIATE_TEST_CASE_P( + FragDepthSuccess, ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("FragDepth"), Values("Fragment"), Values("Output"), + Values("%f32"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + FragDepthNotFragment, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine( + Values("FragDepth"), + Values("Vertex", "GLCompute", "Geometry", "TessellationControl", + "TessellationEvaluation"), + Values("Output"), Values("%f32"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "to be used only with Fragment execution model"))), ); + +INSTANTIATE_TEST_CASE_P( + FragDepthNotOutput, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("FragDepth"), Values("Fragment"), Values("Input"), + Values("%f32"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "to be only used for variables with Output storage class", + "uses storage class Input"))), ); + +INSTANTIATE_TEST_CASE_P( + FragDepthNotFloatScalar, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("FragDepth"), Values("Fragment"), Values("Output"), + Values("%f32vec4", "%u32"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit float scalar", + "is not a float scalar"))), ); + +INSTANTIATE_TEST_CASE_P( + FragDepthNotF32, ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("FragDepth"), Values("Fragment"), Values("Output"), + Values("%f64"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit float scalar", + "has bit width 64"))), ); + +INSTANTIATE_TEST_CASE_P( + FrontFacingAndHelperInvocationSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("FrontFacing", "HelperInvocation"), Values("Fragment"), + Values("Input"), Values("%bool"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + FrontFacingAndHelperInvocationNotFragment, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine( + Values("FrontFacing", "HelperInvocation"), + Values("Vertex", "GLCompute", "Geometry", "TessellationControl", + "TessellationEvaluation"), + Values("Input"), Values("%bool"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "to be used only with Fragment execution model"))), ); + +INSTANTIATE_TEST_CASE_P( + FrontFacingAndHelperInvocationNotInput, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("FrontFacing", "HelperInvocation"), Values("Fragment"), + Values("Output"), Values("%bool"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "to be only used for variables with Input storage class", + "uses storage class Output"))), ); + +INSTANTIATE_TEST_CASE_P( + FrontFacingAndHelperInvocationNotBool, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("FrontFacing", "HelperInvocation"), Values("Fragment"), + Values("Input"), Values("%f32", "%u32"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a bool scalar", + "is not a bool scalar"))), ); + +INSTANTIATE_TEST_CASE_P( + ComputeShaderInputInt32Vec3Success, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("GlobalInvocationId", "LocalInvocationId", "NumWorkgroups", + "WorkgroupId"), + Values("GLCompute"), Values("Input"), Values("%u32vec3"), + Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + ComputeShaderInputInt32Vec3NotGLCompute, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("GlobalInvocationId", "LocalInvocationId", "NumWorkgroups", + "WorkgroupId"), + Values("Vertex", "Fragment", "Geometry", "TessellationControl", + "TessellationEvaluation"), + Values("Input"), Values("%u32vec3"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "to be used only with GLCompute execution model"))), ); + +INSTANTIATE_TEST_CASE_P( + ComputeShaderInputInt32Vec3NotInput, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("GlobalInvocationId", "LocalInvocationId", "NumWorkgroups", + "WorkgroupId"), + Values("GLCompute"), Values("Output"), Values("%u32vec3"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "to be only used for variables with Input storage class", + "uses storage class Output"))), ); + +INSTANTIATE_TEST_CASE_P( + ComputeShaderInputInt32Vec3NotIntVector, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("GlobalInvocationId", "LocalInvocationId", "NumWorkgroups", + "WorkgroupId"), + Values("GLCompute"), Values("Input"), + Values("%u32arr3", "%f32vec3"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 3-component 32-bit int vector", + "is not an int vector"))), ); + +INSTANTIATE_TEST_CASE_P( + ComputeShaderInputInt32Vec3NotIntVec3, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("GlobalInvocationId", "LocalInvocationId", "NumWorkgroups", + "WorkgroupId"), + Values("GLCompute"), Values("Input"), Values("%u32vec4"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 3-component 32-bit int vector", + "has 4 components"))), ); + +INSTANTIATE_TEST_CASE_P( + ComputeShaderInputInt32Vec3NotInt32Vec, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("GlobalInvocationId", "LocalInvocationId", "NumWorkgroups", + "WorkgroupId"), + Values("GLCompute"), Values("Input"), Values("%u64vec3"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 3-component 32-bit int vector", + "has components with bit width 64"))), ); + +INSTANTIATE_TEST_CASE_P( + InvocationIdSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("InvocationId"), Values("Geometry", "TessellationControl"), + Values("Input"), Values("%u32"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + InvocationIdInvalidExecutionModel, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("InvocationId"), + Values("Vertex", "Fragment", "GLCompute", "TessellationEvaluation"), + Values("Input"), Values("%u32"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "to be used only with TessellationControl or " + "Geometry execution models"))), ); + +INSTANTIATE_TEST_CASE_P( + InvocationIdNotInput, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("InvocationId"), Values("Geometry", "TessellationControl"), + Values("Output"), Values("%u32"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "to be only used for variables with Input storage class", + "uses storage class Output"))), ); + +INSTANTIATE_TEST_CASE_P( + InvocationIdNotIntScalar, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("InvocationId"), Values("Geometry", "TessellationControl"), + Values("Input"), Values("%f32", "%u32vec3"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit int scalar", + "is not an int scalar"))), ); + +INSTANTIATE_TEST_CASE_P( + InvocationIdNotInt32, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("InvocationId"), Values("Geometry", "TessellationControl"), + Values("Input"), Values("%u64"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit int scalar", + "has bit width 64"))), ); + +INSTANTIATE_TEST_CASE_P( + InstanceIndexSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("InstanceIndex"), Values("Vertex"), Values("Input"), + Values("%u32"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + InstanceIndexInvalidExecutionModel, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine( + Values("InstanceIndex"), + Values("Geometry", "Fragment", "GLCompute", "TessellationControl", + "TessellationEvaluation"), + Values("Input"), Values("%u32"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "to be used only with Vertex execution model"))), ); + +INSTANTIATE_TEST_CASE_P( + InstanceIndexNotInput, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("InstanceIndex"), Values("Vertex"), Values("Output"), + Values("%u32"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "to be only used for variables with Input storage class", + "uses storage class Output"))), ); + +INSTANTIATE_TEST_CASE_P( + InstanceIndexNotIntScalar, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("InstanceIndex"), Values("Vertex"), Values("Input"), + Values("%f32", "%u32vec3"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit int scalar", + "is not an int scalar"))), ); + +INSTANTIATE_TEST_CASE_P( + InstanceIndexNotInt32, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("InstanceIndex"), Values("Vertex"), Values("Input"), + Values("%u64"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit int scalar", + "has bit width 64"))), ); + +INSTANTIATE_TEST_CASE_P( + LayerAndViewportIndexInputSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("Layer", "ViewportIndex"), Values("Fragment"), + Values("Input"), Values("%u32"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + LayerAndViewportIndexOutputSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("Layer", "ViewportIndex"), Values("Geometry"), + Values("Output"), Values("%u32"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + LayerAndViewportIndexInvalidExecutionModel, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine( + Values("Layer", "ViewportIndex"), + Values("Vertex", "GLCompute", "TessellationControl", + "TessellationEvaluation"), + Values("Input"), Values("%u32"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "to be used only with Fragment or Geometry execution models"))), ); + +INSTANTIATE_TEST_CASE_P( + LayerAndViewportIndexFragmentNotInput, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine( + Values("Layer", "ViewportIndex"), Values("Fragment"), Values("Output"), + Values("%u32"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "Output storage class if execution model is Fragment", + "which is called with execution model Fragment"))), ); + +INSTANTIATE_TEST_CASE_P( + LayerAndViewportIndexGeometryNotOutput, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine( + Values("Layer", "ViewportIndex"), Values("Geometry"), Values("Input"), + Values("%u32"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "Input storage class if execution model is Geometry", + "which is called with execution model Geometry"))), ); + +INSTANTIATE_TEST_CASE_P( + LayerAndViewportIndexNotIntScalar, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("Layer", "ViewportIndex"), Values("Fragment"), + Values("Input"), Values("%f32", "%u32vec3"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit int scalar", + "is not an int scalar"))), ); + +INSTANTIATE_TEST_CASE_P( + LayerAndViewportIndexNotInt32, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("Layer", "ViewportIndex"), Values("Fragment"), + Values("Input"), Values("%u64"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit int scalar", + "has bit width 64"))), ); + +INSTANTIATE_TEST_CASE_P( + PatchVerticesSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PatchVertices"), + Values("TessellationEvaluation", "TessellationControl"), + Values("Input"), Values("%u32"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + PatchVerticesInvalidExecutionModel, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PatchVertices"), + Values("Vertex", "Fragment", "GLCompute", "Geometry"), + Values("Input"), Values("%u32"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "to be used only with TessellationControl or " + "TessellationEvaluation execution models"))), ); + +INSTANTIATE_TEST_CASE_P( + PatchVerticesNotInput, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PatchVertices"), + Values("TessellationEvaluation", "TessellationControl"), + Values("Output"), Values("%u32"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "to be only used for variables with Input storage class", + "uses storage class Output"))), ); + +INSTANTIATE_TEST_CASE_P( + PatchVerticesNotIntScalar, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PatchVertices"), + Values("TessellationEvaluation", "TessellationControl"), + Values("Input"), Values("%f32", "%u32vec3"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit int scalar", + "is not an int scalar"))), ); + +INSTANTIATE_TEST_CASE_P( + PatchVerticesNotInt32, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PatchVertices"), + Values("TessellationEvaluation", "TessellationControl"), + Values("Input"), Values("%u64"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit int scalar", + "has bit width 64"))), ); + +INSTANTIATE_TEST_CASE_P( + PointCoordSuccess, ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PointCoord"), Values("Fragment"), Values("Input"), + Values("%f32vec2"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + PointCoordNotFragment, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine( + Values("PointCoord"), + Values("Vertex", "GLCompute", "Geometry", "TessellationControl", + "TessellationEvaluation"), + Values("Input"), Values("%f32vec2"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "to be used only with Fragment execution model"))), ); + +INSTANTIATE_TEST_CASE_P( + PointCoordNotInput, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PointCoord"), Values("Fragment"), Values("Output"), + Values("%f32vec2"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "to be only used for variables with Input storage class", + "uses storage class Output"))), ); + +INSTANTIATE_TEST_CASE_P( + PointCoordNotFloatVector, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PointCoord"), Values("Fragment"), Values("Input"), + Values("%f32arr2", "%u32vec2"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 2-component 32-bit float vector", + "is not a float vector"))), ); + +INSTANTIATE_TEST_CASE_P( + PointCoordNotFloatVec3, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PointCoord"), Values("Fragment"), Values("Input"), + Values("%f32vec3"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 2-component 32-bit float vector", + "has 3 components"))), ); + +INSTANTIATE_TEST_CASE_P( + PointCoordNotF32Vec4, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PointCoord"), Values("Fragment"), Values("Input"), + Values("%f64vec2"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 2-component 32-bit float vector", + "has components with bit width 64"))), ); + +INSTANTIATE_TEST_CASE_P( + PointSizeOutputSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PointSize"), + Values("Vertex", "Geometry", "TessellationControl", + "TessellationEvaluation"), + Values("Output"), Values("%f32"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + PointSizeInputSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PointSize"), + Values("Geometry", "TessellationControl", "TessellationEvaluation"), + Values("Input"), Values("%f32"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + PointSizeVertexInput, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PointSize"), Values("Vertex"), Values("Input"), + Values("%f32"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "Vulkan spec doesn't allow BuiltIn PointSize " + "to be used for variables with Input storage class if " + "execution model is Vertex.", + "which is called with execution model Vertex."))), ); + +INSTANTIATE_TEST_CASE_P( + PointSizeInvalidExecutionModel, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PointSize"), Values("GLCompute", "Fragment"), + Values("Input", "Output"), Values("%f32"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "to be used only with Vertex, TessellationControl, " + "TessellationEvaluation or Geometry execution models"))), ); + +INSTANTIATE_TEST_CASE_P( + PointSizeNotFloatScalar, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PointSize"), Values("Vertex"), Values("Output"), + Values("%f32vec4", "%u32"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit float scalar", + "is not a float scalar"))), ); + +INSTANTIATE_TEST_CASE_P( + PointSizeNotF32, ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PointSize"), Values("Vertex"), Values("Output"), + Values("%f64"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit float scalar", + "has bit width 64"))), ); + +INSTANTIATE_TEST_CASE_P( + PositionOutputSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("Position"), + Values("Vertex", "Geometry", "TessellationControl", + "TessellationEvaluation"), + Values("Output"), Values("%f32vec4"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + PositionInputSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("Position"), + Values("Geometry", "TessellationControl", "TessellationEvaluation"), + Values("Input"), Values("%f32vec4"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + PositionVertexInput, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("Position"), Values("Vertex"), Values("Input"), + Values("%f32vec4"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "Vulkan spec doesn't allow BuiltIn Position " + "to be used for variables with Input storage class if " + "execution model is Vertex.", + "which is called with execution model Vertex."))), ); + +INSTANTIATE_TEST_CASE_P( + PositionInvalidExecutionModel, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("Position"), Values("GLCompute", "Fragment"), + Values("Input", "Output"), Values("%f32vec4"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "to be used only with Vertex, TessellationControl, " + "TessellationEvaluation or Geometry execution models"))), ); + +INSTANTIATE_TEST_CASE_P( + PositionNotFloatVector, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("Position"), Values("Geometry"), Values("Input"), + Values("%f32arr4", "%u32vec4"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 4-component 32-bit float vector", + "is not a float vector"))), ); + +INSTANTIATE_TEST_CASE_P( + PositionNotFloatVec4, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("Position"), Values("Geometry"), Values("Input"), + Values("%f32vec3"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 4-component 32-bit float vector", + "has 3 components"))), ); + +INSTANTIATE_TEST_CASE_P( + PositionNotF32Vec4, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("Position"), Values("Geometry"), Values("Input"), + Values("%f64vec4"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 4-component 32-bit float vector", + "has components with bit width 64"))), ); + +INSTANTIATE_TEST_CASE_P( + PrimitiveIdInputSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PrimitiveId"), + Values("Fragment", "TessellationControl", "TessellationEvaluation", + "Geometry"), + Values("Input"), Values("%u32"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + PrimitiveIdOutputSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PrimitiveId"), Values("Geometry"), Values("Output"), + Values("%u32"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + PrimitiveIdInvalidExecutionModel, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PrimitiveId"), Values("Vertex", "GLCompute"), + Values("Input"), Values("%u32"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "to be used only with Fragment, TessellationControl, " + "TessellationEvaluation or Geometry execution models"))), ); + +INSTANTIATE_TEST_CASE_P( + PrimitiveIdFragmentNotInput, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine( + Values("PrimitiveId"), Values("Fragment"), Values("Output"), + Values("%u32"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "Output storage class if execution model is Fragment", + "which is called with execution model Fragment"))), ); + +INSTANTIATE_TEST_CASE_P( + PrimitiveIdGeometryNotInput, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PrimitiveId"), + Values("TessellationControl", "TessellationEvaluation"), + Values("Output"), Values("%u32"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "Output storage class if execution model is Tessellation", + "which is called with execution model Tessellation"))), ); + +INSTANTIATE_TEST_CASE_P( + PrimitiveIdNotIntScalar, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PrimitiveId"), Values("Fragment"), Values("Input"), + Values("%f32", "%u32vec3"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit int scalar", + "is not an int scalar"))), ); + +INSTANTIATE_TEST_CASE_P( + PrimitiveIdNotInt32, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("PrimitiveId"), Values("Fragment"), Values("Input"), + Values("%u64"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit int scalar", + "has bit width 64"))), ); + +INSTANTIATE_TEST_CASE_P( + SampleIdSuccess, ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("SampleId"), Values("Fragment"), Values("Input"), + Values("%u32"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + SampleIdInvalidExecutionModel, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine( + Values("SampleId"), + Values("Vertex", "GLCompute", "Geometry", "TessellationControl", + "TessellationEvaluation"), + Values("Input"), Values("%u32"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "to be used only with Fragment execution model"))), ); + +INSTANTIATE_TEST_CASE_P( + SampleIdNotInput, ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine( + Values("SampleId"), Values("Fragment"), Values("Output"), + Values("%u32"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "Vulkan spec allows BuiltIn SampleId to be only used " + "for variables with Input storage class"))), ); + +INSTANTIATE_TEST_CASE_P( + SampleIdNotIntScalar, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("SampleId"), Values("Fragment"), Values("Input"), + Values("%f32", "%u32vec3"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit int scalar", + "is not an int scalar"))), ); + +INSTANTIATE_TEST_CASE_P( + SampleIdNotInt32, ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("SampleId"), Values("Fragment"), Values("Input"), + Values("%u64"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit int scalar", + "has bit width 64"))), ); + +INSTANTIATE_TEST_CASE_P( + SampleMaskSuccess, ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("SampleMask"), Values("Fragment"), Values("Input", "Output"), + Values("%u32arr2", "%u32arr4"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + SampleMaskInvalidExecutionModel, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine( + Values("SampleMask"), + Values("Vertex", "GLCompute", "Geometry", "TessellationControl", + "TessellationEvaluation"), + Values("Input"), Values("%u32arr2"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "to be used only with Fragment execution model"))), ); + +INSTANTIATE_TEST_CASE_P( + SampleMaskWrongStorageClass, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("SampleMask"), Values("Fragment"), Values("UniformConstant"), + Values("%u32arr2"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "Vulkan spec allows BuiltIn SampleMask to be only used for " + "variables with Input or Output storage class"))), ); + +INSTANTIATE_TEST_CASE_P( + SampleMaskNotArray, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("SampleMask"), Values("Fragment"), Values("Input"), + Values("%f32", "%u32vec3"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit int array", + "is not an array"))), ); + +INSTANTIATE_TEST_CASE_P( + SampleMaskNotIntArray, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("SampleMask"), Values("Fragment"), Values("Input"), + Values("%f32arr2"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit int array", + "components are not int scalar"))), ); + +INSTANTIATE_TEST_CASE_P( + SampleMaskNotInt32Array, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("SampleMask"), Values("Fragment"), Values("Input"), + Values("%u64arr2"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit int array", + "has components with bit width 64"))), ); + +INSTANTIATE_TEST_CASE_P( + SamplePositionSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("SamplePosition"), Values("Fragment"), Values("Input"), + Values("%f32vec2"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + SamplePositionNotFragment, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine( + Values("SamplePosition"), + Values("Vertex", "GLCompute", "Geometry", "TessellationControl", + "TessellationEvaluation"), + Values("Input"), Values("%f32vec2"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "to be used only with Fragment execution model"))), ); + +INSTANTIATE_TEST_CASE_P( + SamplePositionNotInput, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("SamplePosition"), Values("Fragment"), Values("Output"), + Values("%f32vec2"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "to be only used for variables with Input storage class", + "uses storage class Output"))), ); + +INSTANTIATE_TEST_CASE_P( + SamplePositionNotFloatVector, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("SamplePosition"), Values("Fragment"), Values("Input"), + Values("%f32arr2", "%u32vec4"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 2-component 32-bit float vector", + "is not a float vector"))), ); + +INSTANTIATE_TEST_CASE_P( + SamplePositionNotFloatVec2, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("SamplePosition"), Values("Fragment"), Values("Input"), + Values("%f32vec3"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 2-component 32-bit float vector", + "has 3 components"))), ); + +INSTANTIATE_TEST_CASE_P( + SamplePositionNotF32Vec2, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("SamplePosition"), Values("Fragment"), Values("Input"), + Values("%f64vec2"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 2-component 32-bit float vector", + "has components with bit width 64"))), ); + +INSTANTIATE_TEST_CASE_P( + TessCoordSuccess, ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessCoord"), Values("TessellationEvaluation"), + Values("Input"), Values("%f32vec3"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + TessCoordNotFragment, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine( + Values("TessCoord"), + Values("Vertex", "GLCompute", "Geometry", "TessellationControl", + "Fragment"), + Values("Input"), Values("%f32vec3"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "to be used only with TessellationEvaluation execution model"))), ); + +INSTANTIATE_TEST_CASE_P( + TessCoordNotInput, ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessCoord"), Values("Fragment"), Values("Output"), + Values("%f32vec3"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "to be only used for variables with Input storage class", + "uses storage class Output"))), ); + +INSTANTIATE_TEST_CASE_P( + TessCoordNotFloatVector, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessCoord"), Values("Fragment"), Values("Input"), + Values("%f32arr3", "%u32vec4"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 3-component 32-bit float vector", + "is not a float vector"))), ); + +INSTANTIATE_TEST_CASE_P( + TessCoordNotFloatVec3, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessCoord"), Values("Fragment"), Values("Input"), + Values("%f32vec2"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 3-component 32-bit float vector", + "has 2 components"))), ); + +INSTANTIATE_TEST_CASE_P( + TessCoordNotF32Vec3, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessCoord"), Values("Fragment"), Values("Input"), + Values("%f64vec3"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 3-component 32-bit float vector", + "has components with bit width 64"))), ); + +INSTANTIATE_TEST_CASE_P( + TessLevelOuterTeseInputSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessLevelOuter"), Values("TessellationEvaluation"), + Values("Input"), Values("%f32arr4"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + TessLevelOuterTescOutputSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessLevelOuter"), Values("TessellationControl"), + Values("Output"), Values("%f32arr4"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + TessLevelOuterInvalidExecutionModel, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessLevelOuter"), + Values("Vertex", "GLCompute", "Geometry", "Fragment"), + Values("Input"), Values("%f32arr4"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "to be used only with TessellationControl or " + "TessellationEvaluation execution models."))), ); + +INSTANTIATE_TEST_CASE_P( + TessLevelOuterOutputTese, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessLevelOuter"), Values("TessellationEvaluation"), + Values("Output"), Values("%f32arr4"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "Vulkan spec doesn't allow TessLevelOuter/TessLevelInner to be " + "used for variables with Output storage class if execution " + "model is TessellationEvaluation."))), ); + +INSTANTIATE_TEST_CASE_P( + TessLevelOuterInputTesc, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessLevelOuter"), Values("TessellationControl"), + Values("Input"), Values("%f32arr4"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "Vulkan spec doesn't allow TessLevelOuter/TessLevelInner to be " + "used for variables with Input storage class if execution " + "model is TessellationControl."))), ); + +INSTANTIATE_TEST_CASE_P( + TessLevelOuterNotArray, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessLevelOuter"), Values("TessellationEvaluation"), + Values("Input"), Values("%f32vec4", "%f32"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 4-component 32-bit float array", + "is not an array"))), ); + +INSTANTIATE_TEST_CASE_P( + TessLevelOuterNotFloatArray, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessLevelOuter"), Values("TessellationEvaluation"), + Values("Input"), Values("%u32arr4"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 4-component 32-bit float array", + "components are not float scalar"))), ); + +INSTANTIATE_TEST_CASE_P( + TessLevelOuterNotFloatArr4, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessLevelOuter"), Values("TessellationEvaluation"), + Values("Input"), Values("%f32arr3"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 4-component 32-bit float array", + "has 3 components"))), ); + +INSTANTIATE_TEST_CASE_P( + TessLevelOuterNotF32Arr4, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessLevelOuter"), Values("TessellationEvaluation"), + Values("Input"), Values("%f64arr4"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 4-component 32-bit float array", + "has components with bit width 64"))), ); + +INSTANTIATE_TEST_CASE_P( + TessLevelInnerTeseInputSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessLevelInner"), Values("TessellationEvaluation"), + Values("Input"), Values("%f32arr2"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + TessLevelInnerTescOutputSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessLevelInner"), Values("TessellationControl"), + Values("Output"), Values("%f32arr2"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + TessLevelInnerInvalidExecutionModel, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessLevelInner"), + Values("Vertex", "GLCompute", "Geometry", "Fragment"), + Values("Input"), Values("%f32arr2"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "to be used only with TessellationControl or " + "TessellationEvaluation execution models."))), ); + +INSTANTIATE_TEST_CASE_P( + TessLevelInnerOutputTese, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessLevelInner"), Values("TessellationEvaluation"), + Values("Output"), Values("%f32arr2"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "Vulkan spec doesn't allow TessLevelOuter/TessLevelInner to be " + "used for variables with Output storage class if execution " + "model is TessellationEvaluation."))), ); + +INSTANTIATE_TEST_CASE_P( + TessLevelInnerInputTesc, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessLevelInner"), Values("TessellationControl"), + Values("Input"), Values("%f32arr2"), + Values(TestResult( + SPV_ERROR_INVALID_DATA, + "Vulkan spec doesn't allow TessLevelOuter/TessLevelInner to be " + "used for variables with Input storage class if execution " + "model is TessellationControl."))), ); + +INSTANTIATE_TEST_CASE_P( + TessLevelInnerNotArray, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessLevelInner"), Values("TessellationEvaluation"), + Values("Input"), Values("%f32vec2", "%f32"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 2-component 32-bit float array", + "is not an array"))), ); + +INSTANTIATE_TEST_CASE_P( + TessLevelInnerNotFloatArray, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessLevelInner"), Values("TessellationEvaluation"), + Values("Input"), Values("%u32arr2"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 2-component 32-bit float array", + "components are not float scalar"))), ); + +INSTANTIATE_TEST_CASE_P( + TessLevelInnerNotFloatArr2, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessLevelInner"), Values("TessellationEvaluation"), + Values("Input"), Values("%f32arr3"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 2-component 32-bit float array", + "has 3 components"))), ); + +INSTANTIATE_TEST_CASE_P( + TessLevelInnerNotF32Arr2, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("TessLevelInner"), Values("TessellationEvaluation"), + Values("Input"), Values("%f64arr2"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 2-component 32-bit float array", + "has components with bit width 64"))), ); + +INSTANTIATE_TEST_CASE_P( + VertexIndexSuccess, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("VertexIndex"), Values("Vertex"), Values("Input"), + Values("%u32"), Values(TestResult())), ); + +INSTANTIATE_TEST_CASE_P( + VertexIndexInvalidExecutionModel, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine( + Values("VertexIndex"), + Values("Fragment", "GLCompute", "Geometry", "TessellationControl", + "TessellationEvaluation"), + Values("Input"), Values("%u32"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "to be used only with Vertex execution model"))), ); + +INSTANTIATE_TEST_CASE_P( + VertexIndexNotInput, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine( + Values("VertexIndex"), Values("Vertex"), Values("Output"), + Values("%u32"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "Vulkan spec allows BuiltIn VertexIndex to be only " + "used for variables with Input storage class"))), ); + +INSTANTIATE_TEST_CASE_P( + VertexIndexNotIntScalar, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("VertexIndex"), Values("Vertex"), Values("Input"), + Values("%f32", "%u32vec3"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit int scalar", + "is not an int scalar"))), ); + +INSTANTIATE_TEST_CASE_P( + VertexIndexNotInt32, + ValidateVulkanCombineBuiltInExecutionModelDataTypeResult, + Combine(Values("VertexIndex"), Values("Vertex"), Values("Input"), + Values("%u64"), + Values(TestResult(SPV_ERROR_INVALID_DATA, + "needs to be a 32-bit int scalar", + "has bit width 64"))), ); + +TEST_F(ValidateBuiltIns, WorkgroupSizeSuccess) { + CodeGenerator generator = GetDefaultShaderCodeGenerator(); + generator.before_types_ = R"( +OpDecorate %workgroup_size BuiltIn WorkgroupSize +)"; + + generator.after_types_ = R"( +%workgroup_size = OpConstantComposite %u32vec3 %u32_1 %u32_1 %u32_1 +)"; + + EntryPoint entry_point; + entry_point.name = "main"; + entry_point.execution_model = "GLCompute"; + entry_point.body = R"( +%copy = OpCopyObject %u32vec3 %workgroup_size +)"; + generator.entry_points_.push_back(std::move(entry_point)); + + CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); +} + +TEST_F(ValidateBuiltIns, WorkgroupSizeFragment) { + CodeGenerator generator = GetDefaultShaderCodeGenerator(); + generator.before_types_ = R"( +OpDecorate %workgroup_size BuiltIn WorkgroupSize +)"; + + generator.after_types_ = R"( +%workgroup_size = OpConstantComposite %u32vec3 %u32_1 %u32_1 %u32_1 +)"; + + EntryPoint entry_point; + entry_point.name = "main"; + entry_point.execution_model = "Fragment"; + entry_point.execution_modes = "OpExecutionMode %main OriginUpperLeft"; + entry_point.body = R"( +%copy = OpCopyObject %u32vec3 %workgroup_size +)"; + generator.entry_points_.push_back(std::move(entry_point)); + + CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Vulkan spec allows BuiltIn WorkgroupSize to be used " + "only with GLCompute execution model")); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("is referencing ID <2> (OpConstantComposite) which is " + "decorated with BuiltIn WorkgroupSize in function <1> " + "called with execution model Fragment")); +} + +TEST_F(ValidateBuiltIns, WorkgroupSizeNotConstant) { + CodeGenerator generator = GetDefaultShaderCodeGenerator(); + generator.before_types_ = R"( +OpDecorate %copy BuiltIn WorkgroupSize +)"; + + generator.after_types_ = R"( +%workgroup_size = OpConstantComposite %u32vec3 %u32_1 %u32_1 %u32_1 +)"; + + EntryPoint entry_point; + entry_point.name = "main"; + entry_point.execution_model = "GLCompute"; + entry_point.body = R"( +%copy = OpCopyObject %u32vec3 %workgroup_size +)"; + generator.entry_points_.push_back(std::move(entry_point)); + + CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Vulkan spec requires BuiltIn WorkgroupSize to be a " + "constant. ID <2> (OpCopyObject) is not a constant")); +} + +TEST_F(ValidateBuiltIns, WorkgroupSizeNotVector) { + CodeGenerator generator = GetDefaultShaderCodeGenerator(); + generator.before_types_ = R"( +OpDecorate %workgroup_size BuiltIn WorkgroupSize +)"; + + generator.after_types_ = R"( +%workgroup_size = OpConstant %u32 16 +)"; + + EntryPoint entry_point; + entry_point.name = "main"; + entry_point.execution_model = "GLCompute"; + entry_point.body = R"( +%copy = OpCopyObject %u32 %workgroup_size +)"; + generator.entry_points_.push_back(std::move(entry_point)); + + CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("According to the Vulkan spec BuiltIn WorkgroupSize " + "variable needs to be a 3-component 32-bit int vector. " + "ID <2> (OpConstant) is not an int vector.")); +} + +TEST_F(ValidateBuiltIns, WorkgroupSizeNotIntVector) { + CodeGenerator generator = GetDefaultShaderCodeGenerator(); + generator.before_types_ = R"( +OpDecorate %workgroup_size BuiltIn WorkgroupSize +)"; + + generator.after_types_ = R"( +%workgroup_size = OpConstantComposite %f32vec3 %f32_1 %f32_1 %f32_1 +)"; + + EntryPoint entry_point; + entry_point.name = "main"; + entry_point.execution_model = "GLCompute"; + entry_point.body = R"( +%copy = OpCopyObject %f32vec3 %workgroup_size +)"; + generator.entry_points_.push_back(std::move(entry_point)); + + CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("According to the Vulkan spec BuiltIn WorkgroupSize " + "variable needs to be a 3-component 32-bit int vector. " + "ID <2> (OpConstantComposite) is not an int vector.")); +} + +TEST_F(ValidateBuiltIns, WorkgroupSizeNotVec3) { + CodeGenerator generator = GetDefaultShaderCodeGenerator(); + generator.before_types_ = R"( +OpDecorate %workgroup_size BuiltIn WorkgroupSize +)"; + + generator.after_types_ = R"( +%workgroup_size = OpConstantComposite %u32vec2 %u32_1 %u32_1 +)"; + + EntryPoint entry_point; + entry_point.name = "main"; + entry_point.execution_model = "GLCompute"; + entry_point.body = R"( +%copy = OpCopyObject %u32vec2 %workgroup_size +)"; + generator.entry_points_.push_back(std::move(entry_point)); + + CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("According to the Vulkan spec BuiltIn WorkgroupSize " + "variable needs to be a 3-component 32-bit int vector. " + "ID <2> (OpConstantComposite) has 2 components.")); +} + +TEST_F(ValidateBuiltIns, WorkgroupSizeNotInt32Vec) { + CodeGenerator generator = GetDefaultShaderCodeGenerator(); + generator.before_types_ = R"( +OpDecorate %workgroup_size BuiltIn WorkgroupSize +)"; + + generator.after_types_ = R"( +%workgroup_size = OpConstantComposite %u64vec3 %u64_1 %u64_1 %u64_1 +)"; + + EntryPoint entry_point; + entry_point.name = "main"; + entry_point.execution_model = "GLCompute"; + entry_point.body = R"( +%copy = OpCopyObject %u64vec3 %workgroup_size +)"; + generator.entry_points_.push_back(std::move(entry_point)); + + CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("According to the Vulkan spec BuiltIn WorkgroupSize variable " + "needs to be a 3-component 32-bit int vector. ID <2> " + "(OpConstantComposite) has components with bit width 64.")); +} + +TEST_F(ValidateBuiltIns, GeometryPositionInOutSuccess) { + CodeGenerator generator = GetDefaultShaderCodeGenerator(); + + generator.before_types_ = R"( +OpMemberDecorate %input_type 0 BuiltIn Position +OpMemberDecorate %output_type 0 BuiltIn Position +)"; + + generator.after_types_ = R"( +%input_type = OpTypeStruct %f32vec4 +%input_ptr = OpTypePointer Input %input_type +%input = OpVariable %input_ptr Input +%input_f32vec4_ptr = OpTypePointer Input %f32vec4 +%output_type = OpTypeStruct %f32vec4 +%output_ptr = OpTypePointer Output %output_type +%output = OpVariable %output_ptr Output +%output_f32vec4_ptr = OpTypePointer Output %f32vec4 +)"; + + EntryPoint entry_point; + entry_point.name = "main"; + entry_point.execution_model = "Geometry"; + entry_point.body = R"( +%input_pos = OpAccessChain %input_f32vec4_ptr %input %u32_0 +%output_pos = OpAccessChain %output_f32vec4_ptr %output %u32_0 +%pos = OpLoad %f32vec4 %input_pos +OpStore %output_pos %pos +)"; + generator.entry_points_.push_back(std::move(entry_point)); + + CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); +} + +TEST_F(ValidateBuiltIns, TwoBuiltInsFirstFails) { + CodeGenerator generator = GetDefaultShaderCodeGenerator(); + + generator.before_types_ = R"( +OpMemberDecorate %input_type 0 BuiltIn FragCoord +OpMemberDecorate %output_type 0 BuiltIn Position +)"; + + generator.after_types_ = R"( +%input_type = OpTypeStruct %f32vec4 +%input_ptr = OpTypePointer Input %input_type +%input = OpVariable %input_ptr Input +%input_f32vec4_ptr = OpTypePointer Input %f32vec4 +%output_type = OpTypeStruct %f32vec4 +%output_ptr = OpTypePointer Output %output_type +%output = OpVariable %output_ptr Output +%output_f32vec4_ptr = OpTypePointer Output %f32vec4 +)"; + + EntryPoint entry_point; + entry_point.name = "main"; + entry_point.execution_model = "Geometry"; + entry_point.body = R"( +%input_pos = OpAccessChain %input_f32vec4_ptr %input %u32_0 +%output_pos = OpAccessChain %output_f32vec4_ptr %output %u32_0 +%pos = OpLoad %f32vec4 %input_pos +OpStore %output_pos %pos +)"; + generator.entry_points_.push_back(std::move(entry_point)); + + CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Vulkan spec allows BuiltIn FragCoord to be used only " + "with Fragment execution model")); +} + +TEST_F(ValidateBuiltIns, TwoBuiltInsSecondFails) { + CodeGenerator generator = GetDefaultShaderCodeGenerator(); + + generator.before_types_ = R"( +OpMemberDecorate %input_type 0 BuiltIn Position +OpMemberDecorate %output_type 0 BuiltIn FragCoord +)"; + + generator.after_types_ = R"( +%input_type = OpTypeStruct %f32vec4 +%input_ptr = OpTypePointer Input %input_type +%input = OpVariable %input_ptr Input +%input_f32vec4_ptr = OpTypePointer Input %f32vec4 +%output_type = OpTypeStruct %f32vec4 +%output_ptr = OpTypePointer Output %output_type +%output = OpVariable %output_ptr Output +%output_f32vec4_ptr = OpTypePointer Output %f32vec4 +)"; + + EntryPoint entry_point; + entry_point.name = "main"; + entry_point.execution_model = "Geometry"; + entry_point.body = R"( +%input_pos = OpAccessChain %input_f32vec4_ptr %input %u32_0 +%output_pos = OpAccessChain %output_f32vec4_ptr %output %u32_0 +%pos = OpLoad %f32vec4 %input_pos +OpStore %output_pos %pos +)"; + generator.entry_points_.push_back(std::move(entry_point)); + + CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Vulkan spec allows BuiltIn FragCoord to be only used " + "for variables with Input storage class")); +} + +TEST_F(ValidateBuiltIns, VertexPositionVariableSuccess) { + CodeGenerator generator = GetDefaultShaderCodeGenerator(); + generator.before_types_ = R"( +OpDecorate %position BuiltIn Position +)"; + + generator.after_types_ = R"( +%f32vec4_ptr_output = OpTypePointer Output %f32vec4 +%position = OpVariable %f32vec4_ptr_output Output +)"; + + EntryPoint entry_point; + entry_point.name = "main"; + entry_point.execution_model = "Vertex"; + entry_point.body = R"( +OpStore %position %f32vec4_0123 +)"; + generator.entry_points_.push_back(std::move(entry_point)); + + CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); +} + +TEST_F(ValidateBuiltIns, FragmentPositionTwoEntryPoints) { + CodeGenerator generator = GetDefaultShaderCodeGenerator(); + generator.before_types_ = R"( +OpMemberDecorate %output_type 0 BuiltIn Position +)"; + + generator.after_types_ = R"( +%output_type = OpTypeStruct %f32vec4 +%output_ptr = OpTypePointer Output %output_type +%output = OpVariable %output_ptr Output +%output_f32vec4_ptr = OpTypePointer Output %f32vec4 +)"; + + EntryPoint entry_point; + entry_point.name = "vmain"; + entry_point.execution_model = "Vertex"; + entry_point.body = R"( +%val1 = OpFunctionCall %void %foo +)"; + generator.entry_points_.push_back(std::move(entry_point)); + + entry_point.name = "fmain"; + entry_point.execution_model = "Fragment"; + entry_point.execution_modes = "OpExecutionMode %fmain OriginUpperLeft"; + entry_point.body = R"( +%val2 = OpFunctionCall %void %foo +)"; + generator.entry_points_.push_back(std::move(entry_point)); + + generator.add_at_the_end_ = R"( +%foo = OpFunction %void None %func +%foo_entry = OpLabel +%position = OpAccessChain %output_f32vec4_ptr %output %u32_0 +OpStore %position %f32vec4_0123 +OpReturn +OpFunctionEnd +)"; + + CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Vulkan spec allows BuiltIn Position to be used only " + "with Vertex, TessellationControl, " + "TessellationEvaluation or Geometry execution models")); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("called with execution model Fragment")); +} + +TEST_F(ValidateBuiltIns, FragmentFragDepthNoDepthReplacing) { + CodeGenerator generator = GetDefaultShaderCodeGenerator(); + generator.before_types_ = R"( +OpMemberDecorate %output_type 0 BuiltIn FragDepth +)"; + + generator.after_types_ = R"( +%output_type = OpTypeStruct %f32 +%output_ptr = OpTypePointer Output %output_type +%output = OpVariable %output_ptr Output +%output_f32_ptr = OpTypePointer Output %f32 +)"; + + EntryPoint entry_point; + entry_point.name = "main"; + entry_point.execution_model = "Fragment"; + entry_point.execution_modes = "OpExecutionMode %main OriginUpperLeft"; + entry_point.body = R"( +%val2 = OpFunctionCall %void %foo +)"; + generator.entry_points_.push_back(std::move(entry_point)); + + generator.add_at_the_end_ = R"( +%foo = OpFunction %void None %func +%foo_entry = OpLabel +%frag_depth = OpAccessChain %output_f32_ptr %output %u32_0 +OpStore %frag_depth %f32_1 +OpReturn +OpFunctionEnd +)"; + + CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Vulkan spec requires DepthReplacing execution mode to " + "be declared when using BuiltIn FragDepth")); +} + +TEST_F(ValidateBuiltIns, FragmentFragDepthOneMainHasDepthReplacingOtherHasnt) { + CodeGenerator generator = GetDefaultShaderCodeGenerator(); + generator.before_types_ = R"( +OpMemberDecorate %output_type 0 BuiltIn FragDepth +)"; + + generator.after_types_ = R"( +%output_type = OpTypeStruct %f32 +%output_ptr = OpTypePointer Output %output_type +%output = OpVariable %output_ptr Output +%output_f32_ptr = OpTypePointer Output %f32 +)"; + + EntryPoint entry_point; + entry_point.name = "main_d_r"; + entry_point.execution_model = "Fragment"; + entry_point.execution_modes = + "OpExecutionMode %main_d_r OriginUpperLeft\n" + "OpExecutionMode %main_d_r DepthReplacing"; + entry_point.body = R"( +%val2 = OpFunctionCall %void %foo +)"; + generator.entry_points_.push_back(std::move(entry_point)); + + entry_point.name = "main_no_d_r"; + entry_point.execution_model = "Fragment"; + entry_point.execution_modes = "OpExecutionMode %main_no_d_r OriginUpperLeft"; + entry_point.body = R"( +%val3 = OpFunctionCall %void %foo +)"; + generator.entry_points_.push_back(std::move(entry_point)); + + generator.add_at_the_end_ = R"( +%foo = OpFunction %void None %func +%foo_entry = OpLabel +%frag_depth = OpAccessChain %output_f32_ptr %output %u32_0 +OpStore %frag_depth %f32_1 +OpReturn +OpFunctionEnd +)"; + + CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_0); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Vulkan spec requires DepthReplacing execution mode to " + "be declared when using BuiltIn FragDepth")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_capability_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_capability_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_capability_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_capability_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1969 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Validation tests for Logical Layout + +#include +#include +#include +#include + +#include + +#include "source/assembly_grammar.h" +#include "test_fixture.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using spvtest::ScopedContext; +using std::get; +using std::make_pair; +using std::ostringstream; +using std::pair; +using std::string; +using std::tuple; +using std::vector; +using testing::Combine; +using testing::HasSubstr; +using testing::Values; +using testing::ValuesIn; + +// Parameter for validation test fixtures. The first string is a capability +// name that will begin the assembly under test, the second the remainder +// assembly, and the vector at the end determines whether the test expects +// success or failure. See below for details and convenience methods to access +// each one. +// +// The assembly to test is composed from a variable top line and a fixed +// remainder. The top line will be an OpCapability instruction, while the +// remainder will be some assembly text that succeeds or fails to assemble +// depending on which capability was chosen. For instance, the following will +// succeed: +// +// OpCapability Pipes ; implies Kernel +// OpLifetimeStop %1 0 ; requires Kernel +// +// and the following will fail: +// +// OpCapability Kernel +// %1 = OpTypeNamedBarrier ; requires NamedBarrier +// +// So how does the test parameter capture which capabilities should cause +// success and which shouldn't? The answer is in the last element: it's a +// vector of capabilities that make the remainder assembly succeed. So if the +// first-line capability exists in that vector, success is expected; otherwise, +// failure is expected in the tests. +// +// We will use testing::Combine() to vary the first line: when we combine +// AllCapabilities() with a single remainder assembly, we generate enough test +// cases to try the assembly with every possible capability that could be +// declared. However, Combine() only produces tuples -- it cannot produce, say, +// a struct. Therefore, this type must be a tuple. +using CapTestParameter = tuple>>; + +const string& Capability(const CapTestParameter& p) { return get<0>(p); } +const string& Remainder(const CapTestParameter& p) { return get<1>(p).first; } +const vector& MustSucceed(const CapTestParameter& p) { + return get<1>(p).second; +} + +// Creates assembly to test from p. +string MakeAssembly(const CapTestParameter& p) { + ostringstream ss; + const string& capability = Capability(p); + if (!capability.empty()) { + ss << "OpCapability " << capability << "\n"; + } + ss << Remainder(p); + return ss.str(); +} + +// Expected validation result for p. +spv_result_t ExpectedResult(const CapTestParameter& p) { + const auto& caps = MustSucceed(p); + auto found = find(begin(caps), end(caps), Capability(p)); + return (found == end(caps)) ? SPV_ERROR_INVALID_CAPABILITY : SPV_SUCCESS; +} + +// Assembles using v1.0, unless the parameter's capability requires v1.1. +using ValidateCapability = spvtest::ValidateBase; + +// Always assembles using v1.1. +using ValidateCapabilityV11 = spvtest::ValidateBase; + +// Always assembles using Vulkan 1.0. +// TODO(dneto): Refactor all these tests to scale better across environments. +using ValidateCapabilityVulkan10 = spvtest::ValidateBase; +// Always assembles using OpenGL 4.0. +using ValidateCapabilityOpenGL40 = spvtest::ValidateBase; + +TEST_F(ValidateCapability, Default) { + const char str[] = R"( + OpCapability Kernel + OpCapability Linkage + OpCapability Matrix + OpMemoryModel Logical OpenCL +%f32 = OpTypeFloat 32 +%vec3 = OpTypeVector %f32 3 +%mat33 = OpTypeMatrix %vec3 3 +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// clang-format off +const vector& AllCapabilities() { + static const auto r = new vector{ + "", + "Matrix", + "Shader", + "Geometry", + "Tessellation", + "Addresses", + "Linkage", + "Kernel", + "Vector16", + "Float16Buffer", + "Float16", + "Float64", + "Int64", + "Int64Atomics", + "ImageBasic", + "ImageReadWrite", + "ImageMipmap", + "Pipes", + "Groups", + "DeviceEnqueue", + "LiteralSampler", + "AtomicStorage", + "Int16", + "TessellationPointSize", + "GeometryPointSize", + "ImageGatherExtended", + "StorageImageMultisample", + "UniformBufferArrayDynamicIndexing", + "SampledImageArrayDynamicIndexing", + "StorageBufferArrayDynamicIndexing", + "StorageImageArrayDynamicIndexing", + "ClipDistance", + "CullDistance", + "ImageCubeArray", + "SampleRateShading", + "ImageRect", + "SampledRect", + "GenericPointer", + "Int8", + "InputAttachment", + "SparseResidency", + "MinLod", + "Sampled1D", + "Image1D", + "SampledCubeArray", + "SampledBuffer", + "ImageBuffer", + "ImageMSArray", + "StorageImageExtendedFormats", + "ImageQuery", + "DerivativeControl", + "InterpolationFunction", + "TransformFeedback", + "GeometryStreams", + "StorageImageReadWithoutFormat", + "StorageImageWriteWithoutFormat", + "MultiViewport", + "SubgroupDispatch", + "NamedBarrier", + "PipeStorage"}; + return *r; +} + +const vector& AllSpirV10Capabilities() { + static const auto r = new vector{ + "", + "Matrix", + "Shader", + "Geometry", + "Tessellation", + "Addresses", + "Linkage", + "Kernel", + "Vector16", + "Float16Buffer", + "Float16", + "Float64", + "Int64", + "Int64Atomics", + "ImageBasic", + "ImageReadWrite", + "ImageMipmap", + "Pipes", + "Groups", + "DeviceEnqueue", + "LiteralSampler", + "AtomicStorage", + "Int16", + "TessellationPointSize", + "GeometryPointSize", + "ImageGatherExtended", + "StorageImageMultisample", + "UniformBufferArrayDynamicIndexing", + "SampledImageArrayDynamicIndexing", + "StorageBufferArrayDynamicIndexing", + "StorageImageArrayDynamicIndexing", + "ClipDistance", + "CullDistance", + "ImageCubeArray", + "SampleRateShading", + "ImageRect", + "SampledRect", + "GenericPointer", + "Int8", + "InputAttachment", + "SparseResidency", + "MinLod", + "Sampled1D", + "Image1D", + "SampledCubeArray", + "SampledBuffer", + "ImageBuffer", + "ImageMSArray", + "StorageImageExtendedFormats", + "ImageQuery", + "DerivativeControl", + "InterpolationFunction", + "TransformFeedback", + "GeometryStreams", + "StorageImageReadWithoutFormat", + "StorageImageWriteWithoutFormat", + "MultiViewport"}; + return *r; +} + +const vector& AllVulkan10Capabilities() { + static const auto r = new vector{ + "", + "Matrix", + "Shader", + "InputAttachment", + "Sampled1D", + "Image1D", + "SampledBuffer", + "ImageBuffer", + "ImageQuery", + "DerivativeControl", + "Geometry", + "Tessellation", + "Float64", + "Int64", + "Int16", + "TessellationPointSize", + "GeometryPointSize", + "ImageGatherExtended", + "StorageImageMultisample", + "UniformBufferArrayDynamicIndexing", + "SampledImageArrayDynamicIndexing", + "StorageBufferArrayDynamicIndexing", + "StorageImageArrayDynamicIndexing", + "ClipDistance", + "CullDistance", + "ImageCubeArray", + "SampleRateShading", + "SparseResidency", + "MinLod", + "SampledCubeArray", + "ImageMSArray", + "StorageImageExtendedFormats", + "InterpolationFunction", + "StorageImageReadWithoutFormat", + "StorageImageWriteWithoutFormat", + "MultiViewport"}; + return *r; +} + +const vector& MatrixDependencies() { + static const auto r = new vector{ + "Matrix", + "Shader", + "Geometry", + "Tessellation", + "AtomicStorage", + "TessellationPointSize", + "GeometryPointSize", + "ImageGatherExtended", + "StorageImageMultisample", + "UniformBufferArrayDynamicIndexing", + "SampledImageArrayDynamicIndexing", + "StorageBufferArrayDynamicIndexing", + "StorageImageArrayDynamicIndexing", + "ClipDistance", + "CullDistance", + "ImageCubeArray", + "SampleRateShading", + "ImageRect", + "SampledRect", + "InputAttachment", + "SparseResidency", + "MinLod", + "SampledCubeArray", + "ImageMSArray", + "StorageImageExtendedFormats", + "ImageQuery", + "DerivativeControl", + "InterpolationFunction", + "TransformFeedback", + "GeometryStreams", + "StorageImageReadWithoutFormat", + "StorageImageWriteWithoutFormat", + "MultiViewport"}; + return *r; +} + +const vector& ShaderDependencies() { + static const auto r = new vector{ + "Shader", + "Geometry", + "Tessellation", + "AtomicStorage", + "TessellationPointSize", + "GeometryPointSize", + "ImageGatherExtended", + "StorageImageMultisample", + "UniformBufferArrayDynamicIndexing", + "SampledImageArrayDynamicIndexing", + "StorageBufferArrayDynamicIndexing", + "StorageImageArrayDynamicIndexing", + "ClipDistance", + "CullDistance", + "ImageCubeArray", + "SampleRateShading", + "ImageRect", + "SampledRect", + "InputAttachment", + "SparseResidency", + "MinLod", + "SampledCubeArray", + "ImageMSArray", + "StorageImageExtendedFormats", + "ImageQuery", + "DerivativeControl", + "InterpolationFunction", + "TransformFeedback", + "GeometryStreams", + "StorageImageReadWithoutFormat", + "StorageImageWriteWithoutFormat", + "MultiViewport"}; + return *r; +} + +const vector& TessellationDependencies() { + static const auto r = new vector{ + "Tessellation", + "TessellationPointSize"}; + return *r; +} + +const vector& GeometryDependencies() { + static const auto r = new vector{ + "Geometry", + "GeometryPointSize", + "GeometryStreams", + "MultiViewport"}; + return *r; +} + +const vector& GeometryTessellationDependencies() { + static const auto r = new vector{ + "Tessellation", + "TessellationPointSize", + "Geometry", + "GeometryPointSize", + "GeometryStreams", + "MultiViewport"}; + return *r; +} + +// Returns the names of capabilities that directly depend on Kernel, +// plus itself. +const vector& KernelDependencies() { + static const auto r = new vector{ + "Kernel", + "Vector16", + "Float16Buffer", + "ImageBasic", + "ImageReadWrite", + "ImageMipmap", + "Pipes", + "DeviceEnqueue", + "LiteralSampler", + "Int8", + "SubgroupDispatch", + "NamedBarrier", + "PipeStorage"}; + return *r; +} + +const vector& AddressesDependencies() { + static const auto r = new vector{ + "Addresses", + "GenericPointer"}; + return *r; +} + +const vector& Sampled1DDependencies() { + static const auto r = new vector{ + "Sampled1D", + "Image1D"}; + return *r; +} + +const vector& SampledRectDependencies() { + static const auto r = new vector{ + "SampledRect", + "ImageRect"}; + return *r; +} + +const vector& SampledBufferDependencies() { + static const auto r = new vector{ + "SampledBuffer", + "ImageBuffer"}; + return *r; +} + +const char kOpenCLMemoryModel[] = \ + " OpCapability Kernel" + " OpMemoryModel Logical OpenCL "; + +const char kGLSL450MemoryModel[] = \ + " OpCapability Shader" + " OpMemoryModel Logical GLSL450 "; + +const char kVoidFVoid[] = \ + " %void = OpTypeVoid" + " %void_f = OpTypeFunction %void" + " %func = OpFunction %void None %void_f" + " %label = OpLabel" + " OpReturn" + " OpFunctionEnd "; + +const char kVoidFVoid2[] = \ + " %void_f = OpTypeFunction %voidt" + " %func = OpFunction %voidt None %void_f" + " %label = OpLabel" + " OpReturn" + " OpFunctionEnd "; + +INSTANTIATE_TEST_CASE_P(ExecutionModel, ValidateCapability, + Combine( + ValuesIn(AllCapabilities()), + Values( +make_pair(string(kOpenCLMemoryModel) + + " OpEntryPoint Vertex %func \"shader\"" + + string(kVoidFVoid), ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + " OpEntryPoint TessellationControl %func \"shader\"" + + string(kVoidFVoid), TessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + " OpEntryPoint TessellationEvaluation %func \"shader\"" + + string(kVoidFVoid), TessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + " OpEntryPoint Geometry %func \"shader\"" + + string(kVoidFVoid), GeometryDependencies()), +make_pair(string(kOpenCLMemoryModel) + + " OpEntryPoint Fragment %func \"shader\"" + + string(kVoidFVoid), ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + " OpEntryPoint GLCompute %func \"shader\"" + + string(kVoidFVoid), ShaderDependencies()), +make_pair(string(kGLSL450MemoryModel) + + " OpEntryPoint Kernel %func \"shader\"" + + string(kVoidFVoid), KernelDependencies()) +)),); + +INSTANTIATE_TEST_CASE_P(AddressingAndMemoryModel, ValidateCapability, + Combine( + ValuesIn(AllCapabilities()), + Values( +make_pair(" OpCapability Shader" + " OpMemoryModel Logical Simple" + " OpEntryPoint Vertex %func \"shader\"" + + string(kVoidFVoid), AllCapabilities()), +make_pair(" OpCapability Shader" + " OpMemoryModel Logical GLSL450" + " OpEntryPoint Vertex %func \"shader\"" + + string(kVoidFVoid), AllCapabilities()), +make_pair(" OpCapability Kernel" + " OpMemoryModel Logical OpenCL" + " OpEntryPoint Kernel %func \"compute\"" + + string(kVoidFVoid), AllCapabilities()), +make_pair(" OpCapability Shader" + " OpMemoryModel Physical32 Simple" + " OpEntryPoint Vertex %func \"shader\"" + + string(kVoidFVoid), AddressesDependencies()), +make_pair(" OpCapability Shader" + " OpMemoryModel Physical32 GLSL450" + " OpEntryPoint Vertex %func \"shader\"" + + string(kVoidFVoid), AddressesDependencies()), +make_pair(" OpCapability Kernel" + " OpMemoryModel Physical32 OpenCL" + " OpEntryPoint Kernel %func \"compute\"" + + string(kVoidFVoid), AddressesDependencies()), +make_pair(" OpCapability Shader" + " OpMemoryModel Physical64 Simple" + " OpEntryPoint Vertex %func \"shader\"" + + string(kVoidFVoid), AddressesDependencies()), +make_pair(" OpCapability Shader" + " OpMemoryModel Physical64 GLSL450" + " OpEntryPoint Vertex %func \"shader\"" + + string(kVoidFVoid), AddressesDependencies()), +make_pair(" OpCapability Kernel" + " OpMemoryModel Physical64 OpenCL" + " OpEntryPoint Kernel %func \"compute\"" + + string(kVoidFVoid), AddressesDependencies()) +)),); + +INSTANTIATE_TEST_CASE_P(ExecutionMode, ValidateCapability, + Combine( + ValuesIn(AllCapabilities()), + Values( +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Geometry %func \"shader\" " + "OpExecutionMode %func Invocations 42" + + string(kVoidFVoid), GeometryDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint TessellationControl %func \"shader\" " + "OpExecutionMode %func SpacingEqual" + + string(kVoidFVoid), TessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint TessellationControl %func \"shader\" " + "OpExecutionMode %func SpacingFractionalEven" + + string(kVoidFVoid), TessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint TessellationControl %func \"shader\" " + "OpExecutionMode %func SpacingFractionalOdd" + + string(kVoidFVoid), TessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint TessellationControl %func \"shader\" " + "OpExecutionMode %func VertexOrderCw" + + string(kVoidFVoid), TessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint TessellationControl %func \"shader\" " + "OpExecutionMode %func VertexOrderCcw" + + string(kVoidFVoid), TessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Vertex %func \"shader\" " + "OpExecutionMode %func PixelCenterInteger" + + string(kVoidFVoid), ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Vertex %func \"shader\" " + "OpExecutionMode %func OriginUpperLeft" + + string(kVoidFVoid), ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Vertex %func \"shader\" " + "OpExecutionMode %func OriginLowerLeft" + + string(kVoidFVoid), ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Vertex %func \"shader\" " + "OpExecutionMode %func EarlyFragmentTests" + + string(kVoidFVoid), ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint TessellationControl %func \"shader\" " + "OpExecutionMode %func PointMode" + + string(kVoidFVoid), TessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Vertex %func \"shader\" " + "OpExecutionMode %func Xfb" + + string(kVoidFVoid), vector{"TransformFeedback"}), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Vertex %func \"shader\" " + "OpExecutionMode %func DepthReplacing" + + string(kVoidFVoid), ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Vertex %func \"shader\" " + "OpExecutionMode %func DepthGreater" + + string(kVoidFVoid), ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Vertex %func \"shader\" " + "OpExecutionMode %func DepthLess" + + string(kVoidFVoid), ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Vertex %func \"shader\" " + "OpExecutionMode %func DepthUnchanged" + + string(kVoidFVoid), ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"shader\" " + "OpExecutionMode %func LocalSize 42 42 42" + + string(kVoidFVoid), AllCapabilities()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Kernel %func \"shader\" " + "OpExecutionMode %func LocalSizeHint 42 42 42" + + string(kVoidFVoid), KernelDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Geometry %func \"shader\" " + "OpExecutionMode %func InputPoints" + + string(kVoidFVoid), GeometryDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Geometry %func \"shader\" " + "OpExecutionMode %func InputLines" + + string(kVoidFVoid), GeometryDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Geometry %func \"shader\" " + "OpExecutionMode %func InputLinesAdjacency" + + string(kVoidFVoid), GeometryDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Geometry %func \"shader\" " + "OpExecutionMode %func Triangles" + + string(kVoidFVoid), GeometryDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint TessellationControl %func \"shader\" " + "OpExecutionMode %func Triangles" + + string(kVoidFVoid), TessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Geometry %func \"shader\" " + "OpExecutionMode %func InputTrianglesAdjacency" + + string(kVoidFVoid), GeometryDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint TessellationControl %func \"shader\" " + "OpExecutionMode %func Quads" + + string(kVoidFVoid), TessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint TessellationControl %func \"shader\" " + "OpExecutionMode %func Isolines" + + string(kVoidFVoid), TessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Geometry %func \"shader\" " + "OpExecutionMode %func OutputVertices 42" + + string(kVoidFVoid), GeometryDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint TessellationControl %func \"shader\" " + "OpExecutionMode %func OutputVertices 42" + + string(kVoidFVoid), TessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Geometry %func \"shader\" " + "OpExecutionMode %func OutputPoints" + + string(kVoidFVoid), GeometryDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Geometry %func \"shader\" " + "OpExecutionMode %func OutputLineStrip" + + string(kVoidFVoid), GeometryDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Geometry %func \"shader\" " + "OpExecutionMode %func OutputTriangleStrip" + + string(kVoidFVoid), GeometryDependencies()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Kernel %func \"shader\" " + "OpExecutionMode %func VecTypeHint 2" + + string(kVoidFVoid), KernelDependencies()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Kernel %func \"shader\" " + "OpExecutionMode %func ContractionOff" + + string(kVoidFVoid), KernelDependencies()))),); + +// clang-format on + +INSTANTIATE_TEST_CASE_P( + ExecutionModeV11, ValidateCapabilityV11, + Combine(ValuesIn(AllCapabilities()), + Values(make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"shader\" " + "OpExecutionMode %func SubgroupSize 1" + + string(kVoidFVoid), + vector{"SubgroupDispatch"}), + make_pair( + string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"shader\" " + "OpExecutionMode %func SubgroupsPerWorkgroup 65535" + + string(kVoidFVoid), + vector{"SubgroupDispatch"}))), ); +// clang-format off + +INSTANTIATE_TEST_CASE_P(StorageClass, ValidateCapability, + Combine( + ValuesIn(AllCapabilities()), + Values( +make_pair(string(kGLSL450MemoryModel) + + " OpEntryPoint Vertex %func \"shader\"" + + " %intt = OpTypeInt 32 0\n" + " %ptrt = OpTypePointer UniformConstant %intt\n" + " %var = OpVariable %ptrt UniformConstant\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kOpenCLMemoryModel) + + " OpEntryPoint Kernel %func \"compute\"" + + " %intt = OpTypeInt 32 0\n" + " %ptrt = OpTypePointer Input %intt" + " %var = OpVariable %ptrt Input\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kOpenCLMemoryModel) + + " OpEntryPoint Vertex %func \"shader\"" + + " %intt = OpTypeInt 32 0\n" + " %ptrt = OpTypePointer Uniform %intt\n" + " %var = OpVariable %ptrt Uniform\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + " OpEntryPoint Vertex %func \"shader\"" + + " %intt = OpTypeInt 32 0\n" + " %ptrt = OpTypePointer Output %intt\n" + " %var = OpVariable %ptrt Output\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kGLSL450MemoryModel) + + " OpEntryPoint Vertex %func \"shader\"" + + " %intt = OpTypeInt 32 0\n" + " %ptrt = OpTypePointer Workgroup %intt\n" + " %var = OpVariable %ptrt Workgroup\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kGLSL450MemoryModel) + + " OpEntryPoint Vertex %func \"shader\"" + + " %intt = OpTypeInt 32 0\n" + " %ptrt = OpTypePointer CrossWorkgroup %intt\n" + " %var = OpVariable %ptrt CrossWorkgroup\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kOpenCLMemoryModel) + + " OpEntryPoint Kernel %func \"compute\"" + + " %intt = OpTypeInt 32 0\n" + " %ptrt = OpTypePointer Private %intt\n" + " %var = OpVariable %ptrt Private\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + " OpEntryPoint Kernel %func \"compute\"" + + " %intt = OpTypeInt 32 0\n" + " %ptrt = OpTypePointer PushConstant %intt\n" + " %var = OpVariable %ptrt PushConstant\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kGLSL450MemoryModel) + + " OpEntryPoint Vertex %func \"shader\"" + + " %intt = OpTypeInt 32 0\n" + " %ptrt = OpTypePointer AtomicCounter %intt\n" + " %var = OpVariable %ptrt AtomicCounter\n" + string(kVoidFVoid), + vector{"AtomicStorage"}), +make_pair(string(kGLSL450MemoryModel) + + " OpEntryPoint Vertex %func \"shader\"" + + " %intt = OpTypeInt 32 0\n" + " %ptrt = OpTypePointer Image %intt\n" + " %var = OpVariable %ptrt Image\n" + string(kVoidFVoid), + AllCapabilities()) +)),); + +INSTANTIATE_TEST_CASE_P(Dim, ValidateCapability, + Combine( + ValuesIn(AllCapabilities()), + Values( +make_pair(" OpCapability ImageBasic" + + string(kOpenCLMemoryModel) + + string(" OpEntryPoint Kernel %func \"compute\"") + + " %voidt = OpTypeVoid" + " %imgt = OpTypeImage %voidt 1D 0 0 0 0 Unknown" + string(kVoidFVoid2), + Sampled1DDependencies()), +make_pair(" OpCapability ImageBasic" + + string(kOpenCLMemoryModel) + + string(" OpEntryPoint Kernel %func \"compute\"") + + " %voidt = OpTypeVoid" + " %imgt = OpTypeImage %voidt 2D 0 0 0 0 Unknown" + string(kVoidFVoid2), + AllCapabilities()), +make_pair(" OpCapability ImageBasic" + + string(kOpenCLMemoryModel) + + string(" OpEntryPoint Kernel %func \"compute\"") + + " %voidt = OpTypeVoid" + " %imgt = OpTypeImage %voidt 3D 0 0 0 0 Unknown" + string(kVoidFVoid2), + AllCapabilities()), +make_pair(" OpCapability ImageBasic" + + string(kOpenCLMemoryModel) + + string(" OpEntryPoint Kernel %func \"compute\"") + + " %voidt = OpTypeVoid" + " %imgt = OpTypeImage %voidt Cube 0 0 0 0 Unknown" + string(kVoidFVoid2), + ShaderDependencies()), +make_pair(" OpCapability ImageBasic" + + string(kOpenCLMemoryModel) + + string(" OpEntryPoint Kernel %func \"compute\"") + + " %voidt = OpTypeVoid" + " %imgt = OpTypeImage %voidt Rect 0 0 0 0 Unknown" + string(kVoidFVoid2), + SampledRectDependencies()), +make_pair(" OpCapability ImageBasic" + + string(kOpenCLMemoryModel) + + string(" OpEntryPoint Kernel %func \"compute\"") + + " %voidt = OpTypeVoid" + " %imgt = OpTypeImage %voidt Buffer 0 0 0 0 Unknown" + string(kVoidFVoid2), + SampledBufferDependencies()), +make_pair(" OpCapability ImageBasic" + + string(kOpenCLMemoryModel) + + string(" OpEntryPoint Kernel %func \"compute\"") + + " %voidt = OpTypeVoid" + " %imgt = OpTypeImage %voidt SubpassData 0 0 0 2 Unknown" + string(kVoidFVoid2), + vector{"InputAttachment"}) +)),); + +// NOTE: All Sampler Address Modes require kernel capabilities but the +// OpConstantSampler requires LiteralSampler which depends on Kernel +INSTANTIATE_TEST_CASE_P(SamplerAddressingMode, ValidateCapability, + Combine( + ValuesIn(AllCapabilities()), + Values( +make_pair(string(kGLSL450MemoryModel) + + " OpEntryPoint Vertex %func \"shader\"" + " %samplert = OpTypeSampler" + " %sampler = OpConstantSampler %samplert None 1 Nearest" + + string(kVoidFVoid), + vector{"LiteralSampler"}), +make_pair(string(kGLSL450MemoryModel) + + " OpEntryPoint Vertex %func \"shader\"" + " %samplert = OpTypeSampler" + " %sampler = OpConstantSampler %samplert ClampToEdge 1 Nearest" + + string(kVoidFVoid), + vector{"LiteralSampler"}), +make_pair(string(kGLSL450MemoryModel) + + " OpEntryPoint Vertex %func \"shader\"" + " %samplert = OpTypeSampler" + " %sampler = OpConstantSampler %samplert Clamp 1 Nearest" + + string(kVoidFVoid), + vector{"LiteralSampler"}), +make_pair(string(kGLSL450MemoryModel) + + " OpEntryPoint Vertex %func \"shader\"" + " %samplert = OpTypeSampler" + " %sampler = OpConstantSampler %samplert Repeat 1 Nearest" + + string(kVoidFVoid), + vector{"LiteralSampler"}), +make_pair(string(kGLSL450MemoryModel) + + " OpEntryPoint Vertex %func \"shader\"" + " %samplert = OpTypeSampler" + " %sampler = OpConstantSampler %samplert RepeatMirrored 1 Nearest" + + string(kVoidFVoid), + vector{"LiteralSampler"}) +)),); + +//TODO(umar): Sampler Filter Mode +//TODO(umar): Image Format +//TODO(umar): Image Channel Order +//TODO(umar): Image Channel Data Type +//TODO(umar): Image Operands +//TODO(umar): FP Fast Math Mode +//TODO(umar): FP Rounding Mode +//TODO(umar): Linkage Type +//TODO(umar): Access Qualifier +//TODO(umar): Function Parameter Attribute + +INSTANTIATE_TEST_CASE_P(Decoration, ValidateCapability, + Combine( + ValuesIn(AllCapabilities()), + Values( +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt RelaxedPrecision\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt Block\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt BufferBlock\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt RowMajor\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + MatrixDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt ColMajor\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + MatrixDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt ArrayStride 1\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt MatrixStride 1\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + MatrixDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt GLSLShared\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt GLSLPacked\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + "OpDecorate %intt CPacked\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + KernelDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt NoPerspective\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt Flat\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt Patch\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + TessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt Centroid\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt Sample\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + vector{"SampleRateShading"}), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt Invariant\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt Restrict\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt Aliased\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt Volatile\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + "OpDecorate %intt Constant\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + KernelDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt Coherent\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt NonWritable\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt NonReadable\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt Uniform\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + "OpDecorate %intt SaturatedConversion\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + KernelDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt Stream 0\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + vector{"GeometryStreams"}), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt Location 0\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt Component 0\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt Index 0\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt Binding 0\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt DescriptorSet 0\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt Offset 0\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt XfbBuffer 0\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + vector{"TransformFeedback"}), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt XfbStride 0\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + vector{"TransformFeedback"}), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + "OpDecorate %intt FuncParamAttr Zext\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + KernelDependencies()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + "OpDecorate %intt FPFastMathMode Fast\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + KernelDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt LinkageAttributes \"other\" Import\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + vector{"Linkage"}), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt NoContraction\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %intt InputAttachmentIndex 0\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + vector{"InputAttachment"}), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + "OpDecorate %intt Alignment 4\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + KernelDependencies()) +)),); + +// clang-format on +INSTANTIATE_TEST_CASE_P( + DecorationSpecId, ValidateCapability, + Combine(ValuesIn(AllSpirV10Capabilities()), + Values(make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + + "OpDecorate %1 SpecId 1\n" + "%intt = OpTypeInt 32 0\n" + "%1 = OpSpecConstant %intt 0\n" + + string(kVoidFVoid), + ShaderDependencies()))), ); + +INSTANTIATE_TEST_CASE_P( + DecorationV11, ValidateCapabilityV11, + Combine(ValuesIn(AllCapabilities()), + Values(make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %p MaxByteOffset 0 " + "%i32 = OpTypeInt 32 0 " + "%pi32 = OpTypePointer Workgroup %i32 " + "%p = OpVariable %pi32 Workgroup " + + string(kVoidFVoid), + AddressesDependencies()), + // Trying to test OpDecorate here, but if this fails due to + // incorrect OpMemoryModel validation, that must also be + // fixed. + make_pair(string("OpMemoryModel Logical OpenCL " + "OpEntryPoint Kernel %func \"compute\" \n" + "OpDecorate %1 SpecId 1 " + "%intt = OpTypeInt 32 0 " + "%1 = OpSpecConstant %intt 0") + + string(kVoidFVoid), + KernelDependencies()), + make_pair(string("OpMemoryModel Logical Simple " + "OpEntryPoint Vertex %func \"shader\" \n" + "OpDecorate %1 SpecId 1 " + "%intt = OpTypeInt 32 0 " + "%1 = OpSpecConstant %intt 0") + + string(kVoidFVoid), + ShaderDependencies()))), ); +// clang-format off + +INSTANTIATE_TEST_CASE_P(BuiltIn, ValidateCapability, + Combine( + ValuesIn(AllCapabilities()), + Values( +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn Position\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +// Just mentioning PointSize, ClipDistance, or CullDistance as a BuiltIn does +// not trigger the requirement for the associated capability. +// See https://github.com/KhronosGroup/SPIRV-Tools/issues/365 +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn PointSize\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn ClipDistance\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn CullDistance\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn VertexId\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn InstanceId\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn PrimitiveId\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + GeometryTessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn InvocationId\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + GeometryTessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn Layer\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + GeometryDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn ViewportIndex\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + vector{"MultiViewport"}), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn TessLevelOuter\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + TessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn TessLevelInner\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + TessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn TessCoord\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + TessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn PatchVertices\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + TessellationDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn FragCoord\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn PointCoord\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn FrontFacing\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn SampleId\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + vector{"SampleRateShading"}), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn SamplePosition\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + vector{"SampleRateShading"}), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn SampleMask\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn FragDepth\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn HelperInvocation\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn VertexIndex\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn InstanceIndex\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn NumWorkgroups\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn WorkgroupSize\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn WorkgroupId\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn LocalInvocationId\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn GlobalInvocationId\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn LocalInvocationIndex\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + AllCapabilities()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + + "OpDecorate %intt BuiltIn WorkDim\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + KernelDependencies()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + + "OpDecorate %intt BuiltIn GlobalSize\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + KernelDependencies()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + + "OpDecorate %intt BuiltIn EnqueuedWorkgroupSize\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + KernelDependencies()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + + "OpDecorate %intt BuiltIn GlobalOffset\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + KernelDependencies()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + + "OpDecorate %intt BuiltIn GlobalLinearId\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + KernelDependencies()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + + "OpDecorate %intt BuiltIn SubgroupSize\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + KernelDependencies()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + + "OpDecorate %intt BuiltIn SubgroupMaxSize\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + KernelDependencies()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + + "OpDecorate %intt BuiltIn NumSubgroups\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + KernelDependencies()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + + "OpDecorate %intt BuiltIn NumEnqueuedSubgroups\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + KernelDependencies()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + + "OpDecorate %intt BuiltIn SubgroupId\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + KernelDependencies()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + + "OpDecorate %intt BuiltIn SubgroupLocalInvocationId\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + KernelDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn VertexIndex\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()), +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "OpDecorate %intt BuiltIn InstanceIndex\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + ShaderDependencies()) +)),); + +// Ensure that mere mention of PointSize, ClipDistance, or CullDistance as +// BuiltIns does not trigger the requirement for the associated +// capability. +// See https://github.com/KhronosGroup/SPIRV-Tools/issues/365 +INSTANTIATE_TEST_CASE_P(BuiltIn, ValidateCapabilityVulkan10, + Combine( + // All capabilities to try. + ValuesIn(AllSpirV10Capabilities()), + Values( +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + "OpMemberDecorate %block 0 BuiltIn PointSize\n" + "%f32 = OpTypeFloat 32\n" + "%block = OpTypeStruct %f32\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + // Capabilities which should succeed. + AllVulkan10Capabilities()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + "OpMemberDecorate %block 0 BuiltIn ClipDistance\n" + "%f32 = OpTypeFloat 32\n" + "%intt = OpTypeInt 32 0\n" + "%intt_4 = OpConstant %intt 4\n" + "%f32arr4 = OpTypeArray %f32 %intt_4\n" + "%block = OpTypeStruct %f32arr4\n" + string(kVoidFVoid), + AllVulkan10Capabilities()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + "OpMemberDecorate %block 0 BuiltIn CullDistance\n" + "%f32 = OpTypeFloat 32\n" + "%intt = OpTypeInt 32 0\n" + "%intt_4 = OpConstant %intt 4\n" + "%f32arr4 = OpTypeArray %f32 %intt_4\n" + "%block = OpTypeStruct %f32arr4\n" + string(kVoidFVoid), + AllVulkan10Capabilities()) +)),); + +INSTANTIATE_TEST_CASE_P(BuiltIn, ValidateCapabilityOpenGL40, + Combine( + // OpenGL 4.0 is based on SPIR-V 1.0 + ValuesIn(AllSpirV10Capabilities()), + Values( +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + + "OpDecorate %intt BuiltIn PointSize\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + AllSpirV10Capabilities()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + + "OpDecorate %intt BuiltIn ClipDistance\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + AllSpirV10Capabilities()), +make_pair(string(kGLSL450MemoryModel) + + "OpEntryPoint Vertex %func \"shader\" \n" + + "OpDecorate %intt BuiltIn CullDistance\n" + "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), + AllSpirV10Capabilities()) +)),); + +// TODO(umar): Selection Control +// TODO(umar): Loop Control +// TODO(umar): Function Control +// TODO(umar): Memory Semantics +// TODO(umar): Memory Access +// TODO(umar): Scope +// TODO(umar): Group Operation +// TODO(umar): Kernel Enqueue Flags +// TODO(umar): Kernel Profiling Flags + +INSTANTIATE_TEST_CASE_P(MatrixOp, ValidateCapability, + Combine( + ValuesIn(AllCapabilities()), + Values( +make_pair(string(kOpenCLMemoryModel) + + "OpEntryPoint Kernel %func \"compute\" \n" + + "%f32 = OpTypeFloat 32\n" + "%vec3 = OpTypeVector %f32 3\n" + "%mat33 = OpTypeMatrix %vec3 3\n" + string(kVoidFVoid), + MatrixDependencies()))),); +// clang-format on + +#if 0 +// TODO(atgoo@github.com) The following test is not valid as it generates +// invalid combinations of images, instructions and image operands. +// +// Creates assembly containing an OpImageFetch instruction using operands for +// the image-operands part. The assembly defines constants %fzero and %izero +// that can be used for operands where IDs are required. The assembly is valid, +// apart from not declaring any capabilities required by the operands. +string ImageOperandsTemplate(const string& operands) { + ostringstream ss; + // clang-format off + ss << R"( +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL + +%i32 = OpTypeInt 32 0 +%f32 = OpTypeFloat 32 +%v4i32 = OpTypeVector %i32 4 +%timg = OpTypeImage %i32 2D 0 0 0 0 Unknown +%pimg = OpTypePointer UniformConstant %timg +%tfun = OpTypeFunction %i32 + +%vimg = OpVariable %pimg UniformConstant +%izero = OpConstant %i32 0 +%fzero = OpConstant %f32 0. + +%main = OpFunction %i32 None %tfun +%lbl = OpLabel +%img = OpLoad %timg %vimg +%r1 = OpImageFetch %v4i32 %img %izero )" << operands << R"( +OpReturnValue %izero +OpFunctionEnd +)"; + // clang-format on + return ss.str(); +} + +INSTANTIATE_TEST_CASE_P( + TwoImageOperandsMask, ValidateCapability, + Combine( + ValuesIn(AllCapabilities()), + Values(make_pair(ImageOperandsTemplate("Bias|Lod %fzero %fzero"), + ShaderDependencies()), + make_pair(ImageOperandsTemplate("Lod|Offset %fzero %izero"), + vector{"ImageGatherExtended"}), + make_pair(ImageOperandsTemplate("Sample|MinLod %izero %fzero"), + vector{"MinLod"}), + make_pair(ImageOperandsTemplate("Lod|Sample %fzero %izero"), + AllCapabilities()))), ); +#endif + +// TODO(umar): Instruction capability checks + +// True if capability exists in env. +bool Exists(const std::string& capability, spv_target_env env) { + spv_operand_desc dummy; + return SPV_SUCCESS == libspirv::AssemblyGrammar(ScopedContext(env).context) + .lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, + capability.c_str(), + capability.size(), &dummy); +} + +TEST_P(ValidateCapability, Capability) { + const string capability = Capability(GetParam()); + spv_target_env env = + (capability.empty() || Exists(capability, SPV_ENV_UNIVERSAL_1_0)) + ? SPV_ENV_UNIVERSAL_1_0 + : SPV_ENV_UNIVERSAL_1_1; + const string test_code = MakeAssembly(GetParam()); + CompileSuccessfully(test_code, env); + ASSERT_EQ(ExpectedResult(GetParam()), ValidateInstructions(env)) + << "target env: " << spvTargetEnvDescription(env) << "\ntest code:\n" + << test_code; +} + +TEST_P(ValidateCapabilityV11, Capability) { + const string test_code = MakeAssembly(GetParam()); + CompileSuccessfully(test_code, SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(ExpectedResult(GetParam()), + ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)) + << test_code; +} + +TEST_P(ValidateCapabilityVulkan10, Capability) { + const string test_code = MakeAssembly(GetParam()); + CompileSuccessfully(test_code, SPV_ENV_VULKAN_1_0); + ASSERT_EQ(ExpectedResult(GetParam()), + ValidateInstructions(SPV_ENV_VULKAN_1_0)) + << test_code; +} + +TEST_P(ValidateCapabilityOpenGL40, Capability) { + const string test_code = MakeAssembly(GetParam()); + CompileSuccessfully(test_code, SPV_ENV_OPENGL_4_0); + ASSERT_EQ(ExpectedResult(GetParam()), + ValidateInstructions(SPV_ENV_OPENGL_4_0)) + << test_code; +} + +TEST_F(ValidateCapability, SemanticsIdIsAnIdNotALiteral) { + // From https://github.com/KhronosGroup/SPIRV-Tools/issues/248 + // The validator was interpreting the memory semantics ID number + // as the value to be checked rather than an ID that references + // another value to be checked. + // In this case a raw ID of 64 was mistaken to mean a literal + // semantic value of UniformMemory, which would require the Shader + // capability. + const char str[] = R"( +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL + +; %i32 has ID 1 +%i32 = OpTypeInt 32 0 +%tf = OpTypeFunction %i32 +%pi32 = OpTypePointer CrossWorkgroup %i32 +%var = OpVariable %pi32 CrossWorkgroup +%c = OpConstant %i32 100 +%scope = OpConstant %i32 1 ; Device scope + +; Fake an instruction with 64 as the result id. +; !64 = OpConstantNull %i32 +!0x3002e !1 !64 + +%f = OpFunction %i32 None %tf +%l = OpLabel +%result = OpAtomicIAdd %i32 %var %scope !64 %c +OpReturnValue %result +OpFunctionEnd +)"; + + CompileSuccessfully(str); + + // Since we are forcing usage of 64, the "id bound" in the binary header + // must be overwritten so that 64 is considered within bound. + // ID Bound is at index 3 of the binary. Set it to 65. + OverwriteAssembledBinary(3, 65); + + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateCapability, IntSignednessKernelGood) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +%i32 = OpTypeInt 32 0 +)"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateCapability, IntSignednessKernelBad) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +%i32 = OpTypeInt 32 1 +)"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("The Signedness in OpTypeInt must always be 0 when " + "Kernel capability is used.")); +} + +TEST_F(ValidateCapability, IntSignednessShaderGood) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%u32 = OpTypeInt 32 0 +%i32 = OpTypeInt 32 1 +)"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateCapability, NonVulkan10Capability) { + const std::string spirv = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%u32 = OpTypeInt 32 0 +%i32 = OpTypeInt 32 1 +)"; + CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, + ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Capability Linkage is not allowed by Vulkan 1.0")); +} + +TEST_F(ValidateCapability, Vulkan10EnabledByExtension) { + const std::string spirv = R"( +OpCapability Shader +OpCapability DrawParameters +OpExtension "SPV_KHR_shader_draw_parameters" +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %func "shader" +OpMemberDecorate %block 0 BuiltIn PointSize +%f32 = OpTypeFloat 32 +%block = OpTypeStruct %f32 +)" + string(kVoidFVoid); + + CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); +} + +TEST_F(ValidateCapability, Vulkan10NotEnabledByExtension) { + const std::string spirv = R"( +OpCapability Shader +OpCapability DrawParameters +OpMemoryModel Logical GLSL450 +OpEntryPoint Vertex %func "shader" +OpDecorate %intt BuiltIn PointSize +%intt = OpTypeInt 32 0 +)" + string(kVoidFVoid); + + CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, + ValidateInstructions(SPV_ENV_VULKAN_1_0)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Capability DrawParameters is not allowed by Vulkan 1.0")); +} + +TEST_F(ValidateCapability, NonOpenCL12FullCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability Pipes +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)"; + CompileSuccessfully(spirv, SPV_ENV_OPENCL_1_2); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, + ValidateInstructions(SPV_ENV_OPENCL_1_2)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Capability Pipes is not allowed by OpenCL 1.2 Full Profile")); +} + +TEST_F(ValidateCapability, OpenCL12FullEnabledByCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability ImageBasic +OpCapability Sampled1D +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)" + string(kVoidFVoid); + + CompileSuccessfully(spirv, SPV_ENV_OPENCL_1_2); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_OPENCL_1_2)); +} + +TEST_F(ValidateCapability, OpenCL12FullNotEnabledByCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability Sampled1D +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)" + string(kVoidFVoid); + + CompileSuccessfully(spirv, SPV_ENV_OPENCL_1_2); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, + ValidateInstructions(SPV_ENV_OPENCL_1_2)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Capability Sampled1D is not allowed by OpenCL 1.2 Full Profile")); +} + +TEST_F(ValidateCapability, NonOpenCL12EmbeddedCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability Int64 +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)"; + CompileSuccessfully(spirv, SPV_ENV_OPENCL_EMBEDDED_1_2); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, + ValidateInstructions(SPV_ENV_OPENCL_EMBEDDED_1_2)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Capability Int64 is not allowed by OpenCL 1.2 Embedded Profile")); +} + +TEST_F(ValidateCapability, OpenCL12EmbeddedEnabledByCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability ImageBasic +OpCapability Sampled1D +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)" + string(kVoidFVoid); + + CompileSuccessfully(spirv, SPV_ENV_OPENCL_EMBEDDED_1_2); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_OPENCL_EMBEDDED_1_2)); +} + +TEST_F(ValidateCapability, OpenCL12EmbeddedNotEnabledByCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability Sampled1D +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)" + string(kVoidFVoid); + + CompileSuccessfully(spirv, SPV_ENV_OPENCL_EMBEDDED_1_2); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, + ValidateInstructions(SPV_ENV_OPENCL_EMBEDDED_1_2)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Capability Sampled1D is not allowed by OpenCL 1.2 " + "Embedded Profile")); +} + +TEST_F(ValidateCapability, OpenCL20FullCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability Pipes +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)"; + CompileSuccessfully(spirv, SPV_ENV_OPENCL_2_0); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_OPENCL_2_0)); +} + +TEST_F(ValidateCapability, NonOpenCL20FullCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability Matrix +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)"; + CompileSuccessfully(spirv, SPV_ENV_OPENCL_2_0); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, + ValidateInstructions(SPV_ENV_OPENCL_2_0)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Capability Matrix is not allowed by OpenCL 2.0/2.1 Full Profile")); +} + +TEST_F(ValidateCapability, OpenCL20FullEnabledByCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability ImageBasic +OpCapability Sampled1D +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)" + string(kVoidFVoid); + + CompileSuccessfully(spirv, SPV_ENV_OPENCL_2_0); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_OPENCL_2_0)); +} + +TEST_F(ValidateCapability, OpenCL20FullNotEnabledByCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability Sampled1D +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)" + string(kVoidFVoid); + + CompileSuccessfully(spirv, SPV_ENV_OPENCL_2_0); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, + ValidateInstructions(SPV_ENV_OPENCL_2_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Capability Sampled1D is not allowed by OpenCL 2.0/2.1 " + "Full Profile")); +} + +TEST_F(ValidateCapability, NonOpenCL20EmbeddedCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability Int64 +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)"; + CompileSuccessfully(spirv, SPV_ENV_OPENCL_EMBEDDED_2_0); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, + ValidateInstructions(SPV_ENV_OPENCL_EMBEDDED_2_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Capability Int64 is not allowed by OpenCL 2.0/2.1 " + "Embedded Profile")); +} + +TEST_F(ValidateCapability, OpenCL20EmbeddedEnabledByCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability ImageBasic +OpCapability Sampled1D +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)" + string(kVoidFVoid); + + CompileSuccessfully(spirv, SPV_ENV_OPENCL_EMBEDDED_2_0); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_OPENCL_EMBEDDED_2_0)); +} + +TEST_F(ValidateCapability, OpenCL20EmbeddedNotEnabledByCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability Sampled1D +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)" + string(kVoidFVoid); + + CompileSuccessfully(spirv, SPV_ENV_OPENCL_EMBEDDED_2_0); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, + ValidateInstructions(SPV_ENV_OPENCL_EMBEDDED_2_0)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Capability Sampled1D is not allowed by OpenCL 2.0/2.1 " + "Embedded Profile")); +} + +TEST_F(ValidateCapability, OpenCL22FullCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability PipeStorage +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)"; + CompileSuccessfully(spirv, SPV_ENV_OPENCL_2_2); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_OPENCL_2_2)); +} + +TEST_F(ValidateCapability, NonOpenCL22FullCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability Matrix +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)"; + CompileSuccessfully(spirv, SPV_ENV_OPENCL_2_2); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, + ValidateInstructions(SPV_ENV_OPENCL_2_2)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Capability Matrix is not allowed by OpenCL 2.2 Full Profile")); +} + +TEST_F(ValidateCapability, OpenCL22FullEnabledByCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability ImageBasic +OpCapability Sampled1D +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)" + string(kVoidFVoid); + + CompileSuccessfully(spirv, SPV_ENV_OPENCL_2_2); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_OPENCL_2_2)); +} + +TEST_F(ValidateCapability, OpenCL22FullNotEnabledByCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability Sampled1D +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)" + string(kVoidFVoid); + + CompileSuccessfully(spirv, SPV_ENV_OPENCL_2_2); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, + ValidateInstructions(SPV_ENV_OPENCL_2_2)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Capability Sampled1D is not allowed by OpenCL 2.2 Full Profile")); +} + +TEST_F(ValidateCapability, NonOpenCL22EmbeddedCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability Int64 +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)"; + CompileSuccessfully(spirv, SPV_ENV_OPENCL_EMBEDDED_2_2); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, + ValidateInstructions(SPV_ENV_OPENCL_EMBEDDED_2_2)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Capability Int64 is not allowed by OpenCL 2.2 Embedded Profile")); +} + +TEST_F(ValidateCapability, OpenCL22EmbeddedEnabledByCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability ImageBasic +OpCapability Sampled1D +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)" + string(kVoidFVoid); + + CompileSuccessfully(spirv, SPV_ENV_OPENCL_EMBEDDED_2_2); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_OPENCL_EMBEDDED_2_2)); +} + +TEST_F(ValidateCapability, OpenCL22EmbeddedNotEnabledByCapability) { + const std::string spirv = R"( +OpCapability Kernel +OpCapability Addresses +OpCapability Linkage +OpCapability Sampled1D +OpMemoryModel Physical64 OpenCL +%u32 = OpTypeInt 32 0 +)" + string(kVoidFVoid); + + CompileSuccessfully(spirv, SPV_ENV_OPENCL_EMBEDDED_2_2); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, + ValidateInstructions(SPV_ENV_OPENCL_EMBEDDED_2_2)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Capability Sampled1D is not allowed by OpenCL 2.2 " + "Embedded Profile")); +} + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_cfg_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_cfg_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_cfg_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_cfg_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1404 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Validation tests for Control Flow Graph + +#include +#include +#include +#include +#include +#include +#include + +#include "gmock/gmock.h" + +#include "source/diagnostic.h" +#include "source/validate.h" +#include "test_fixture.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +using std::array; +using std::make_pair; +using std::pair; +using std::string; +using std::stringstream; +using std::vector; + +using ::testing::HasSubstr; +using ::testing::MatchesRegex; + +using libspirv::BasicBlock; +using libspirv::ValidationState_t; + +using ValidateCFG = spvtest::ValidateBase; +using spvtest::ScopedContext; + +namespace { + +string nameOps() { return ""; } + +template +string nameOps(pair head, Args... names) { + return "OpName %" + head.first + " \"" + head.second + "\"\n" + + nameOps(names...); +} + +template +string nameOps(string head, Args... names) { + return "OpName %" + head + " \"" + head + "\"\n" + nameOps(names...); +} + +/// This class allows the easy creation of complex control flow without writing +/// SPIR-V. This class is used in the test cases below. +class Block { + string label_; + string body_; + SpvOp type_; + vector successors_; + + public: + /// Creates a Block with a given label + /// + /// @param[in]: label the label id of the block + /// @param[in]: type the branch instruciton that ends the block + explicit Block(string label, SpvOp type = SpvOpBranch) + : label_(label), body_(), type_(type), successors_() {} + + /// Sets the instructions which will appear in the body of the block + Block& SetBody(std::string body) { + body_ = body; + return *this; + } + + Block& AppendBody(std::string body) { + body_ += body; + return *this; + } + + /// Converts the block into a SPIR-V string + operator string() { + stringstream out; + out << std::setw(8) << "%" + label_ + " = OpLabel \n"; + if (!body_.empty()) { + out << body_; + } + + switch (type_) { + case SpvOpBranchConditional: + out << "OpBranchConditional %cond "; + for (Block& b : successors_) { + out << "%" + b.label_ + " "; + } + break; + case SpvOpSwitch: { + out << "OpSwitch %one %" + successors_.front().label_; + stringstream ss; + for (size_t i = 1; i < successors_.size(); i++) { + ss << " " << i << " %" << successors_[i].label_; + } + out << ss.str(); + } break; + case SpvOpReturn: + assert(successors_.size() == 0); + out << "OpReturn\n"; + break; + case SpvOpUnreachable: + assert(successors_.size() == 0); + out << "OpUnreachable\n"; + break; + case SpvOpBranch: + assert(successors_.size() == 1); + out << "OpBranch %" + successors_.front().label_; + break; + default: + assert(1 == 0 && "Unhandled"); + } + out << "\n"; + + return out.str(); + } + friend Block& operator>>(Block& curr, vector successors); + friend Block& operator>>(Block& lhs, Block& successor); +}; + +/// Assigns the successors for the Block on the lhs +Block& operator>>(Block& lhs, vector successors) { + if (lhs.type_ == SpvOpBranchConditional) { + assert(successors.size() == 2); + } else if (lhs.type_ == SpvOpSwitch) { + assert(successors.size() > 1); + } + lhs.successors_ = successors; + return lhs; +} + +/// Assigns the successor for the Block on the lhs +Block& operator>>(Block& lhs, Block& successor) { + assert(lhs.type_ == SpvOpBranch); + lhs.successors_.push_back(successor); + return lhs; +} + +const char* header(SpvCapability cap) { + static const char* shader_header = + "OpCapability Shader\n" + "OpCapability Linkage\n" + "OpMemoryModel Logical GLSL450\n"; + + static const char* kernel_header = + "OpCapability Kernel\n" + "OpCapability Linkage\n" + "OpMemoryModel Logical OpenCL\n"; + + return (cap == SpvCapabilityShader) ? shader_header : kernel_header; +} + +const char* types_consts() { + static const char* types = + "%voidt = OpTypeVoid\n" + "%boolt = OpTypeBool\n" + "%intt = OpTypeInt 32 0\n" + "%one = OpConstant %intt 1\n" + "%two = OpConstant %intt 2\n" + "%ptrt = OpTypePointer Function %intt\n" + "%funct = OpTypeFunction %voidt\n"; + + return types; +} + +INSTANTIATE_TEST_CASE_P(StructuredControlFlow, ValidateCFG, + ::testing::Values(SpvCapabilityShader, + SpvCapabilityKernel)); + +TEST_P(ValidateCFG, LoopReachableFromEntryButNeverLeadingToReturn) { + // In this case, the loop is reachable from a node without a predecessor, + // but never reaches a node with a return. + // + // This motivates the need for the pseudo-exit node to have a node + // from a cycle in its predecessors list. Otherwise the validator's + // post-dominance calculation will go into an infinite loop. + // + // For more motivation, see + // https://github.com/KhronosGroup/SPIRV-Tools/issues/279 + string str = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + + OpName %entry "entry" + OpName %loop "loop" + OpName %exit "exit" + +%voidt = OpTypeVoid +%funct = OpTypeFunction %voidt + +%main = OpFunction %voidt None %funct +%entry = OpLabel + OpBranch %loop +%loop = OpLabel + OpLoopMerge %exit %loop None + OpBranch %loop +%exit = OpLabel + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()) << str; +} + +TEST_P(ValidateCFG, LoopUnreachableFromEntryButLeadingToReturn) { + // In this case, the loop is not reachable from a node without a + // predecessor, but eventually reaches a node with a return. + // + // This motivates the need for the pseudo-entry node to have a node + // from a cycle in its successors list. Otherwise the validator's + // dominance calculation will go into an infinite loop. + // + // For more motivation, see + // https://github.com/KhronosGroup/SPIRV-Tools/issues/279 + // Before that fix, we'd have an infinite loop when calculating + // post-dominators. + string str = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + + OpName %entry "entry" + OpName %loop "loop" + OpName %cont "cont" + OpName %exit "exit" + +%voidt = OpTypeVoid +%funct = OpTypeFunction %voidt +%boolt = OpTypeBool +%false = OpConstantFalse %boolt + +%main = OpFunction %voidt None %funct +%entry = OpLabel + OpReturn + +%loop = OpLabel + OpLoopMerge %exit %cont None + OpBranch %cont + +%cont = OpLabel + OpBranchConditional %false %loop %exit + +%exit = OpLabel + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()) + << str << getDiagnosticString(); +} + +TEST_P(ValidateCFG, Simple) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block loop("loop", SpvOpBranchConditional); + Block cont("cont"); + Block merge("merge", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) { + loop.SetBody("OpLoopMerge %merge %cont None\n"); + } + + string str = + header(GetParam()) + + nameOps("loop", "entry", "cont", "merge", make_pair("func", "Main")) + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> loop; + str += loop >> vector({cont, merge}); + str += cont >> loop; + str += merge; + str += "OpFunctionEnd\n"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateCFG, Variable) { + Block entry("entry"); + Block cont("cont"); + Block exit("exit", SpvOpReturn); + + entry.SetBody("%var = OpVariable %ptrt Function\n"); + + string str = header(GetParam()) + nameOps(make_pair("func", "Main")) + + types_consts() + " %func = OpFunction %voidt None %funct\n"; + str += entry >> cont; + str += cont >> exit; + str += exit; + str += "OpFunctionEnd\n"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateCFG, VariableNotInFirstBlockBad) { + Block entry("entry"); + Block cont("cont"); + Block exit("exit", SpvOpReturn); + + // This operation should only be performed in the entry block + cont.SetBody("%var = OpVariable %ptrt Function\n"); + + string str = header(GetParam()) + nameOps(make_pair("func", "Main")) + + types_consts() + " %func = OpFunction %voidt None %funct\n"; + + str += entry >> cont; + str += cont >> exit; + str += exit; + str += "OpFunctionEnd\n"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Variables can only be defined in the first block of a function")); +} + +TEST_P(ValidateCFG, BlockSelfLoopIsOk) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block loop("loop", SpvOpBranchConditional); + Block merge("merge", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) loop.SetBody("OpLoopMerge %merge %loop None\n"); + + string str = header(GetParam()) + + nameOps("loop", "merge", make_pair("func", "Main")) + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> loop; + // loop branches to itself, but does not trigger an error. + str += loop >> vector({merge, loop}); + str += merge; + str += "OpFunctionEnd\n"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); +} + +TEST_P(ValidateCFG, BlockAppearsBeforeDominatorBad) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block cont("cont"); + Block branch("branch", SpvOpBranchConditional); + Block merge("merge", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) branch.SetBody("OpSelectionMerge %merge None\n"); + + string str = header(GetParam()) + + nameOps("cont", "branch", make_pair("func", "Main")) + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> branch; + str += cont >> merge; // cont appears before its dominator + str += branch >> vector({cont, merge}); + str += merge; + str += "OpFunctionEnd\n"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + MatchesRegex("Block .\\[cont\\] appears in the binary " + "before its dominator .\\[branch\\]")); +} + +TEST_P(ValidateCFG, MergeBlockTargetedByMultipleHeaderBlocksBad) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block loop("loop"); + Block selection("selection", SpvOpBranchConditional); + Block merge("merge", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) loop.SetBody(" OpLoopMerge %merge %loop None\n"); + + // cannot share the same merge + if (is_shader) selection.SetBody("OpSelectionMerge %merge None\n"); + + string str = header(GetParam()) + + nameOps("merge", make_pair("func", "Main")) + types_consts() + + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> loop; + str += loop >> selection; + str += selection >> vector({loop, merge}); + str += merge; + str += "OpFunctionEnd\n"; + + CompileSuccessfully(str); + if (is_shader) { + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + MatchesRegex("Block .\\[merge\\] is already a merge block " + "for another header")); + } else { + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); + } +} + +TEST_P(ValidateCFG, MergeBlockTargetedByMultipleHeaderBlocksSelectionBad) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block loop("loop", SpvOpBranchConditional); + Block selection("selection", SpvOpBranchConditional); + Block merge("merge", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) selection.SetBody(" OpSelectionMerge %merge None\n"); + + // cannot share the same merge + if (is_shader) loop.SetBody(" OpLoopMerge %merge %loop None\n"); + + string str = header(GetParam()) + + nameOps("merge", make_pair("func", "Main")) + types_consts() + + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> selection; + str += selection >> vector({merge, loop}); + str += loop >> vector({loop, merge}); + str += merge; + str += "OpFunctionEnd\n"; + + CompileSuccessfully(str); + if (is_shader) { + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + MatchesRegex("Block .\\[merge\\] is already a merge block " + "for another header")); + } else { + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); + } +} + +TEST_P(ValidateCFG, BranchTargetFirstBlockBad) { + Block entry("entry"); + Block bad("bad"); + Block end("end", SpvOpReturn); + string str = header(GetParam()) + + nameOps("entry", "bad", make_pair("func", "Main")) + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> bad; + str += bad >> entry; // Cannot target entry block + str += end; + str += "OpFunctionEnd\n"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + MatchesRegex("First block .\\[entry\\] of function .\\[Main\\] " + "is targeted by block .\\[bad\\]")); +} + +TEST_P(ValidateCFG, BranchConditionalTrueTargetFirstBlockBad) { + Block entry("entry"); + Block bad("bad", SpvOpBranchConditional); + Block exit("exit", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + bad.SetBody(" OpLoopMerge %entry %exit None\n"); + + string str = header(GetParam()) + + nameOps("entry", "bad", make_pair("func", "Main")) + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> bad; + str += bad >> vector({entry, exit}); // cannot target entry block + str += exit; + str += "OpFunctionEnd\n"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + MatchesRegex("First block .\\[entry\\] of function .\\[Main\\] " + "is targeted by block .\\[bad\\]")); +} + +TEST_P(ValidateCFG, BranchConditionalFalseTargetFirstBlockBad) { + Block entry("entry"); + Block bad("bad", SpvOpBranchConditional); + Block t("t"); + Block merge("merge"); + Block end("end", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + bad.SetBody("OpLoopMerge %merge %cont None\n"); + + string str = header(GetParam()) + + nameOps("entry", "bad", make_pair("func", "Main")) + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> bad; + str += bad >> vector({t, entry}); + str += merge >> end; + str += end; + str += "OpFunctionEnd\n"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + MatchesRegex("First block .\\[entry\\] of function .\\[Main\\] " + "is targeted by block .\\[bad\\]")); +} + +TEST_P(ValidateCFG, SwitchTargetFirstBlockBad) { + Block entry("entry"); + Block bad("bad", SpvOpSwitch); + Block block1("block1"); + Block block2("block2"); + Block block3("block3"); + Block def("def"); // default block + Block merge("merge"); + Block end("end", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + bad.SetBody("OpSelectionMerge %merge None\n"); + + string str = header(GetParam()) + + nameOps("entry", "bad", make_pair("func", "Main")) + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> bad; + str += bad >> vector({def, block1, block2, block3, entry}); + str += def >> merge; + str += block1 >> merge; + str += block2 >> merge; + str += block3 >> merge; + str += merge >> end; + str += end; + str += "OpFunctionEnd\n"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + MatchesRegex("First block .\\[entry\\] of function .\\[Main\\] " + "is targeted by block .\\[bad\\]")); +} + +TEST_P(ValidateCFG, BranchToBlockInOtherFunctionBad) { + Block entry("entry"); + Block middle("middle", SpvOpBranchConditional); + Block end("end", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + middle.SetBody("OpSelectionMerge %end None\n"); + + Block entry2("entry2"); + Block middle2("middle2"); + Block end2("end2", SpvOpReturn); + + string str = header(GetParam()) + + nameOps("middle2", make_pair("func", "Main")) + types_consts() + + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> middle; + str += middle >> vector({end, middle2}); + str += end; + str += "OpFunctionEnd\n"; + + str += "%func2 = OpFunction %voidt None %funct\n"; + str += entry2 >> middle2; + str += middle2 >> end2; + str += end2; + str += "OpFunctionEnd\n"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + MatchesRegex("Block\\(s\\) \\{.\\[middle2\\] .\\} are referenced but not " + "defined in function .\\[Main\\]")); +} + +TEST_P(ValidateCFG, HeaderDoesntDominatesMergeBad) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block head("head", SpvOpBranchConditional); + Block f("f"); + Block merge("merge", SpvOpReturn); + + head.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + + if (is_shader) head.AppendBody("OpSelectionMerge %merge None\n"); + + string str = header(GetParam()) + + nameOps("head", "merge", make_pair("func", "Main")) + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> merge; + str += head >> vector({merge, f}); + str += f >> merge; + str += merge; + str += "OpFunctionEnd\n"; + + CompileSuccessfully(str); + if (is_shader) { + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + MatchesRegex("The selection construct with the selection header " + ".\\[head\\] does not dominate the merge block " + ".\\[merge\\]")); + } else { + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); + } +} + +TEST_P(ValidateCFG, HeaderDoesntStrictlyDominateMergeBad) { + // If a merge block is reachable, then it must be strictly dominated by + // its header block. + bool is_shader = GetParam() == SpvCapabilityShader; + Block head("head", SpvOpBranchConditional); + Block exit("exit", SpvOpReturn); + + head.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + + if (is_shader) head.AppendBody("OpSelectionMerge %head None\n"); + + string str = header(GetParam()) + + nameOps("head", "exit", make_pair("func", "Main")) + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += head >> vector({exit, exit}); + str += exit; + str += "OpFunctionEnd\n"; + + CompileSuccessfully(str); + if (is_shader) { + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + MatchesRegex("The selection construct with the selection header " + ".\\[head\\] does not strictly dominate the merge block " + ".\\[head\\]")); + } else { + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()) << str; + } +} + +TEST_P(ValidateCFG, UnreachableMerge) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block branch("branch", SpvOpBranchConditional); + Block t("t", SpvOpReturn); + Block f("f", SpvOpReturn); + Block merge("merge", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) branch.AppendBody("OpSelectionMerge %merge None\n"); + + string str = header(GetParam()) + + nameOps("branch", "merge", make_pair("func", "Main")) + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> branch; + str += branch >> vector({t, f}); + str += t; + str += f; + str += merge; + str += "OpFunctionEnd\n"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateCFG, UnreachableMergeDefinedByOpUnreachable) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block branch("branch", SpvOpBranchConditional); + Block t("t", SpvOpReturn); + Block f("f", SpvOpReturn); + Block merge("merge", SpvOpUnreachable); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) branch.AppendBody("OpSelectionMerge %merge None\n"); + + string str = header(GetParam()) + + nameOps("branch", "merge", make_pair("func", "Main")) + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> branch; + str += branch >> vector({t, f}); + str += t; + str += f; + str += merge; + str += "OpFunctionEnd\n"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateCFG, UnreachableBlock) { + Block entry("entry"); + Block unreachable("unreachable"); + Block exit("exit", SpvOpReturn); + + string str = header(GetParam()) + + nameOps("unreachable", "exit", make_pair("func", "Main")) + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> exit; + str += unreachable >> exit; + str += exit; + str += "OpFunctionEnd\n"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateCFG, UnreachableBranch) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block unreachable("unreachable", SpvOpBranchConditional); + Block unreachablechildt("unreachablechildt"); + Block unreachablechildf("unreachablechildf"); + Block merge("merge"); + Block exit("exit", SpvOpReturn); + + unreachable.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) unreachable.AppendBody("OpSelectionMerge %merge None\n"); + string str = header(GetParam()) + + nameOps("unreachable", "exit", make_pair("func", "Main")) + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> exit; + str += unreachable >> vector({unreachablechildt, unreachablechildf}); + str += unreachablechildt >> merge; + str += unreachablechildf >> merge; + str += merge >> exit; + str += exit; + str += "OpFunctionEnd\n"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateCFG, EmptyFunction) { + string str = header(GetParam()) + string(types_consts()) + + R"(%func = OpFunction %voidt None %funct + %l = OpLabel + OpReturn + OpFunctionEnd)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateCFG, SingleBlockLoop) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block loop("loop", SpvOpBranchConditional); + Block exit("exit", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) loop.AppendBody("OpLoopMerge %exit %loop None\n"); + + string str = header(GetParam()) + string(types_consts()) + + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> loop; + str += loop >> vector({loop, exit}); + str += exit; + str += "OpFunctionEnd"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateCFG, NestedLoops) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block loop1("loop1"); + Block loop1_cont_break_block("loop1_cont_break_block", + SpvOpBranchConditional); + Block loop2("loop2", SpvOpBranchConditional); + Block loop2_merge("loop2_merge"); + Block loop1_merge("loop1_merge"); + Block exit("exit", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) { + loop1.SetBody("OpLoopMerge %loop1_merge %loop2 None\n"); + loop2.SetBody("OpLoopMerge %loop2_merge %loop2 None\n"); + } + + string str = header(GetParam()) + nameOps("loop2", "loop2_merge") + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> loop1; + str += loop1 >> loop1_cont_break_block; + str += loop1_cont_break_block >> vector({loop1_merge, loop2}); + str += loop2 >> vector({loop2, loop2_merge}); + str += loop2_merge >> loop1; + str += loop1_merge >> exit; + str += exit; + str += "OpFunctionEnd"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateCFG, NestedSelection) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + const int N = 256; + vector if_blocks; + vector merge_blocks; + Block inner("inner"); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + + if_blocks.emplace_back("if0", SpvOpBranchConditional); + + if (is_shader) if_blocks[0].SetBody("OpSelectionMerge %if_merge0 None\n"); + merge_blocks.emplace_back("if_merge0", SpvOpReturn); + + for (int i = 1; i < N; i++) { + stringstream ss; + ss << i; + if_blocks.emplace_back("if" + ss.str(), SpvOpBranchConditional); + if (is_shader) + if_blocks[i].SetBody("OpSelectionMerge %if_merge" + ss.str() + " None\n"); + merge_blocks.emplace_back("if_merge" + ss.str(), SpvOpBranch); + } + string str = header(GetParam()) + string(types_consts()) + + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> if_blocks[0]; + for (int i = 0; i < N - 1; i++) { + str += if_blocks[i] >> vector({if_blocks[i + 1], merge_blocks[i]}); + } + str += if_blocks.back() >> vector({inner, merge_blocks.back()}); + str += inner >> merge_blocks.back(); + for (int i = N - 1; i > 0; i--) { + str += merge_blocks[i] >> merge_blocks[i - 1]; + } + str += merge_blocks[0]; + str += "OpFunctionEnd"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateCFG, BackEdgeBlockDoesntPostDominateContinueTargetBad) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block loop1("loop1", SpvOpBranchConditional); + Block loop2("loop2", SpvOpBranchConditional); + Block loop2_merge("loop2_merge", SpvOpBranchConditional); + Block be_block("be_block"); + Block exit("exit", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) { + loop1.SetBody("OpLoopMerge %exit %loop2_merge None\n"); + loop2.SetBody("OpLoopMerge %loop2_merge %loop2 None\n"); + } + + string str = header(GetParam()) + + nameOps("loop1", "loop2", "be_block", "loop2_merge") + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> loop1; + str += loop1 >> vector({loop2, exit}); + str += loop2 >> vector({loop2, loop2_merge}); + str += loop2_merge >> vector({be_block, exit}); + str += be_block >> loop1; + str += exit; + str += "OpFunctionEnd"; + + CompileSuccessfully(str); + if (GetParam() == SpvCapabilityShader) { + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + MatchesRegex("The continue construct with the continue target " + ".\\[loop2_merge\\] is not post dominated by the " + "back-edge block .\\[be_block\\]")); + } else { + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); + } +} + +TEST_P(ValidateCFG, BranchingToNonLoopHeaderBlockBad) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block split("split", SpvOpBranchConditional); + Block t("t"); + Block f("f"); + Block exit("exit", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) split.SetBody("OpSelectionMerge %exit None\n"); + + string str = header(GetParam()) + nameOps("split", "f") + types_consts() + + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> split; + str += split >> vector({t, f}); + str += t >> exit; + str += f >> split; + str += exit; + str += "OpFunctionEnd"; + + CompileSuccessfully(str); + if (is_shader) { + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + MatchesRegex("Back-edges \\(.\\[f\\] -> .\\[split\\]\\) can only " + "be formed between a block and a loop header.")); + } else { + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); + } +} + +TEST_P(ValidateCFG, BranchingToSameNonLoopHeaderBlockBad) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block split("split", SpvOpBranchConditional); + Block exit("exit", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) split.SetBody("OpSelectionMerge %exit None\n"); + + string str = header(GetParam()) + nameOps("split") + types_consts() + + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> split; + str += split >> vector({split, exit}); + str += exit; + str += "OpFunctionEnd"; + + CompileSuccessfully(str); + if (is_shader) { + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + MatchesRegex( + "Back-edges \\(.\\[split\\] -> .\\[split\\]\\) can only be " + "formed between a block and a loop header.")); + } else { + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); + } +} + +TEST_P(ValidateCFG, MultipleBackEdgeBlocksToLoopHeaderBad) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block loop("loop", SpvOpBranchConditional); + Block back0("back0"); + Block back1("back1"); + Block merge("merge", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) loop.SetBody("OpLoopMerge %merge %back0 None\n"); + + string str = header(GetParam()) + nameOps("loop", "back0", "back1") + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> loop; + str += loop >> vector({back0, back1}); + str += back0 >> loop; + str += back1 >> loop; + str += merge; + str += "OpFunctionEnd"; + + CompileSuccessfully(str); + if (is_shader) { + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + MatchesRegex( + "Loop header .\\[loop\\] is targeted by 2 back-edge blocks " + "but the standard requires exactly one")) + << str; + } else { + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); + } +} + +TEST_P(ValidateCFG, ContinueTargetMustBePostDominatedByBackEdge) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block loop("loop", SpvOpBranchConditional); + Block cheader("cheader", SpvOpBranchConditional); + Block be_block("be_block"); + Block merge("merge", SpvOpReturn); + Block exit("exit", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) loop.SetBody("OpLoopMerge %merge %cheader None\n"); + + string str = header(GetParam()) + nameOps("cheader", "be_block") + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> loop; + str += loop >> vector({cheader, merge}); + str += cheader >> vector({exit, be_block}); + str += exit; // Branches out of a continue construct + str += be_block >> loop; + str += merge; + str += "OpFunctionEnd"; + + CompileSuccessfully(str); + if (is_shader) { + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + MatchesRegex("The continue construct with the continue target " + ".\\[cheader\\] is not post dominated by the " + "back-edge block .\\[be_block\\]")); + } else { + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); + } +} + +TEST_P(ValidateCFG, BranchOutOfConstructToMergeBad) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block loop("loop", SpvOpBranchConditional); + Block cont("cont", SpvOpBranchConditional); + Block merge("merge", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) loop.SetBody("OpLoopMerge %merge %loop None\n"); + + string str = header(GetParam()) + nameOps("cont", "loop") + types_consts() + + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> loop; + str += loop >> vector({cont, merge}); + str += cont >> vector({loop, merge}); + str += merge; + str += "OpFunctionEnd"; + + CompileSuccessfully(str); + if (is_shader) { + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + MatchesRegex("The continue construct with the continue target " + ".\\[loop\\] is not post dominated by the " + "back-edge block .\\[cont\\]")) + << str; + } else { + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); + } +} + +TEST_P(ValidateCFG, BranchOutOfConstructBad) { + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block loop("loop", SpvOpBranchConditional); + Block cont("cont", SpvOpBranchConditional); + Block merge("merge"); + Block exit("exit", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) loop.SetBody("OpLoopMerge %merge %loop None\n"); + + string str = header(GetParam()) + nameOps("cont", "loop") + types_consts() + + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> loop; + str += loop >> vector({cont, merge}); + str += cont >> vector({loop, exit}); + str += merge >> exit; + str += exit; + str += "OpFunctionEnd"; + + CompileSuccessfully(str); + if (is_shader) { + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + MatchesRegex("The continue construct with the continue target " + ".\\[loop\\] is not post dominated by the " + "back-edge block .\\[cont\\]")); + } else { + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); + } +} + +TEST_F(ValidateCFG, OpSwitchToUnreachableBlock) { + Block entry("entry", SpvOpSwitch); + Block case0("case0"); + Block case1("case1"); + Block case2("case2"); + Block def("default", SpvOpUnreachable); + Block phi("phi", SpvOpReturn); + + string str = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %main "main" %id +OpExecutionMode %main LocalSize 1 1 1 +OpSource GLSL 430 +OpName %main "main" +OpDecorate %id BuiltIn GlobalInvocationId +%void = OpTypeVoid +%voidf = OpTypeFunction %void +%u32 = OpTypeInt 32 0 +%f32 = OpTypeFloat 32 +%uvec3 = OpTypeVector %u32 3 +%fvec3 = OpTypeVector %f32 3 +%uvec3ptr = OpTypePointer Input %uvec3 +%id = OpVariable %uvec3ptr Input +%one = OpConstant %u32 1 +%three = OpConstant %u32 3 +%main = OpFunction %void None %voidf +)"; + + entry.SetBody( + "%idval = OpLoad %uvec3 %id\n" + "%x = OpCompositeExtract %u32 %idval 0\n" + "%selector = OpUMod %u32 %x %three\n" + "OpSelectionMerge %phi None\n"); + str += entry >> vector({def, case0, case1, case2}); + str += case1 >> phi; + str += def; + str += phi; + str += case0 >> phi; + str += case2 >> phi; + str += "OpFunctionEnd"; + + CompileSuccessfully(str); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateCFG, LoopWithZeroBackEdgesBad) { + string str = R"( + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" + OpName %loop "loop" +%voidt = OpTypeVoid +%funct = OpTypeFunction %voidt +%main = OpFunction %voidt None %funct +%loop = OpLabel + OpLoopMerge %exit %exit None + OpBranch %exit +%exit = OpLabel + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + MatchesRegex("Loop header .\\[loop\\] is targeted by " + "0 back-edge blocks but the standard requires exactly " + "one")); +} + +TEST_F(ValidateCFG, LoopWithBackEdgeFromUnreachableContinueConstructGood) { + string str = R"( + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" + OpName %loop "loop" +%voidt = OpTypeVoid +%funct = OpTypeFunction %voidt +%floatt = OpTypeFloat 32 +%boolt = OpTypeBool +%one = OpConstant %floatt 1 +%two = OpConstant %floatt 2 +%main = OpFunction %voidt None %funct +%entry = OpLabel + OpBranch %loop +%loop = OpLabel + OpLoopMerge %exit %cont None + OpBranch %16 +%16 = OpLabel +%cond = OpFOrdLessThan %boolt %one %two + OpBranchConditional %cond %body %exit +%body = OpLabel + OpReturn +%cont = OpLabel ; Reachable only from OpLoopMerge ContinueTarget parameter + OpBranch %loop ; Should be considered a back-edge +%exit = OpLabel + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); +} + +TEST_P(ValidateCFG, + NestedConstructWithUnreachableMergeBlockBranchingToOuterMergeBlock) { + // Test for https://github.com/KhronosGroup/SPIRV-Tools/issues/297 + // The nested construct has an unreachable merge block. In the + // augmented CFG that merge block + // we still determine that the + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry", SpvOpBranchConditional); + Block inner_head("inner_head", SpvOpBranchConditional); + Block inner_true("inner_true", SpvOpReturn); + Block inner_false("inner_false", SpvOpReturn); + Block inner_merge("inner_merge"); + Block exit("exit", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) { + entry.AppendBody("OpSelectionMerge %exit None\n"); + inner_head.SetBody("OpSelectionMerge %inner_merge None\n"); + } + + string str = header(GetParam()) + nameOps("entry", "inner_merge", "exit") + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> vector({inner_head, exit}); + str += inner_head >> vector({inner_true, inner_false}); + str += inner_true; + str += inner_false; + str += inner_merge >> exit; + str += exit; + str += "OpFunctionEnd"; + + CompileSuccessfully(str); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); +} + +TEST_P(ValidateCFG, ContinueTargetCanBeMergeBlockForNestedStructureGood) { + // This example is valid. It shows that the validator can't just add + // an edge from the loop head to the continue target. If that edge + // is added, then the "if_merge" block is both the continue target + // for the loop and also the merge block for the nested selection, but + // then it wouldn't be dominated by "if_head", the header block for the + // nested selection. + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block loop("loop"); + Block if_head("if_head", SpvOpBranchConditional); + Block if_true("if_true"); + Block if_merge("if_merge", SpvOpBranchConditional); + Block merge("merge", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) { + loop.SetBody("OpLoopMerge %merge %if_merge None\n"); + if_head.SetBody("OpSelectionMerge %if_merge None\n"); + } + + string str = + header(GetParam()) + + nameOps("entry", "loop", "if_head", "if_true", "if_merge", "merge") + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> loop; + str += loop >> if_head; + str += if_head >> vector({if_true, if_merge}); + str += if_true >> if_merge; + str += if_merge >> vector({loop, merge}); + str += merge; + str += "OpFunctionEnd"; + + CompileSuccessfully(str); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); +} + +TEST_P(ValidateCFG, SingleLatchBlockMultipleBranchesToLoopHeader) { + // This test case ensures we allow both branches of a loop latch block + // to go back to the loop header. It still counts as a single back edge. + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block loop("loop", SpvOpBranchConditional); + Block latch("latch", SpvOpBranchConditional); + Block merge("merge", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) { + loop.SetBody("OpLoopMerge %merge %latch None\n"); + } + + string str = header(GetParam()) + nameOps("entry", "loop", "latch", "merge") + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> loop; + str += loop >> vector({latch, merge}); + str += latch >> vector({loop, loop}); // This is the key + str += merge; + str += "OpFunctionEnd"; + + CompileSuccessfully(str); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) + << str << getDiagnosticString(); +} + +TEST_P(ValidateCFG, SingleLatchBlockHeaderContinueTargetIsItselfGood) { + // This test case ensures we don't count a Continue Target from a loop + // header to itself as a self-loop when computing back edges. + // Also, it detects that there is an edge from %latch to the pseudo-exit + // node, rather than from %loop. In particular, it detects that we + // have used the *reverse* textual order of blocks when computing + // predecessor traversal roots. + bool is_shader = GetParam() == SpvCapabilityShader; + Block entry("entry"); + Block loop("loop"); + Block latch("latch"); + Block merge("merge", SpvOpReturn); + + entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); + if (is_shader) { + loop.SetBody("OpLoopMerge %merge %loop None\n"); + } + + string str = header(GetParam()) + nameOps("entry", "loop", "latch", "merge") + + types_consts() + "%func = OpFunction %voidt None %funct\n"; + + str += entry >> loop; + str += loop >> latch; + str += latch >> loop; + str += merge; + str += "OpFunctionEnd"; + + CompileSuccessfully(str); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) + << str << getDiagnosticString(); +} + +// Unit test to check the case where a basic block is the entry block of 2 +// different constructs. In this case, the basic block is the entry block of a +// continue construct as well as a selection construct. See issue# 517 for more +// details. +TEST_F(ValidateCFG, BasicBlockIsEntryBlockOfTwoConstructsGood) { + std::string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + %void = OpTypeVoid + %bool = OpTypeBool + %int = OpTypeInt 32 1 + %void_func = OpTypeFunction %void + %int_0 = OpConstant %int 0 + %testfun = OpFunction %void None %void_func + %label_1 = OpLabel + OpBranch %start + %start = OpLabel + %cond = OpSLessThan %bool %int_0 %int_0 + ; + ; Note: In this case, the "target" block is both the entry block of + ; the continue construct of the loop as well as the entry block of + ; the selection construct. + ; + OpLoopMerge %loop_merge %target None + OpBranchConditional %cond %target %loop_merge + %loop_merge = OpLabel + OpReturn + %target = OpLabel + OpSelectionMerge %selection_merge None + OpBranchConditional %cond %do_stuff %do_other_stuff + %do_other_stuff = OpLabel + OpBranch %selection_merge + %selection_merge = OpLabel + OpBranch %start + %do_stuff = OpLabel + OpBranch %selection_merge + OpFunctionEnd + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateCFG, OpReturnInNonVoidFunc) { + std::string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + %int = OpTypeInt 32 1 + %int_func = OpTypeFunction %int + %testfun = OpFunction %int None %int_func + %label_1 = OpLabel + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(spirv); + ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpReturn can only be called from a function with void return type")); +} + +/// TODO(umar): Switch instructions +/// TODO(umar): Nested CFG constructs +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_composites_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_composites_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_composites_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_composites_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1497 @@ +// Copyright (c) 2017 Google 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. + +#include +#include + +#include "gmock/gmock.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using ::testing::HasSubstr; +using ::testing::Not; + +using ValidateComposites = spvtest::ValidateBase; + +std::string GenerateShaderCode( + const std::string& body, + const std::string& capabilities_and_extensions = "", + const std::string& execution_model = "Fragment") { + std::ostringstream ss; + ss << R"( +OpCapability Shader +OpCapability Float64 +)"; + + ss << capabilities_and_extensions; + ss << "OpMemoryModel Logical GLSL450\n"; + ss << "OpEntryPoint " << execution_model << " %main \"main\"\n"; + + ss << R"( +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f32 = OpTypeFloat 32 +%f64 = OpTypeFloat 64 +%u32 = OpTypeInt 32 0 +%s32 = OpTypeInt 32 1 +%f32vec2 = OpTypeVector %f32 2 +%f32vec3 = OpTypeVector %f32 3 +%f32vec4 = OpTypeVector %f32 4 +%f64vec2 = OpTypeVector %f64 2 +%u32vec2 = OpTypeVector %u32 2 +%u32vec4 = OpTypeVector %u32 4 +%f64mat22 = OpTypeMatrix %f64vec2 2 +%f32mat22 = OpTypeMatrix %f32vec2 2 +%f32mat23 = OpTypeMatrix %f32vec2 3 +%f32mat32 = OpTypeMatrix %f32vec3 2 + +%f32_0 = OpConstant %f32 0 +%f32_1 = OpConstant %f32 1 +%f32_2 = OpConstant %f32 2 +%f32_3 = OpConstant %f32 3 +%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 +%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 +%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 + +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u32_2 = OpConstant %u32 2 +%u32_3 = OpConstant %u32 3 + +%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 +%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 + +%f32mat22_1212 = OpConstantComposite %f32mat22 %f32vec2_12 %f32vec2_12 +%f32mat23_121212 = OpConstantComposite %f32mat23 %f32vec2_12 %f32vec2_12 %f32vec2_12 + +%f32vec2arr3 = OpTypeArray %f32vec2 %u32_3 +%f32vec2rarr = OpTypeRuntimeArray %f32vec2 + +%f32u32struct = OpTypeStruct %f32 %u32 +%big_struct = OpTypeStruct %f32 %f32vec4 %f32mat23 %f32vec2arr3 %f32vec2rarr %f32u32struct + +%ptr_big_struct = OpTypePointer Uniform %big_struct +%var_big_struct = OpVariable %ptr_big_struct Uniform + +%main = OpFunction %void None %func +%main_entry = OpLabel +)"; + + ss << body; + + ss << R"( +OpReturn +OpFunctionEnd)"; + + return ss.str(); +} + +// Returns header for legacy tests taken from val_id_test.cpp. +std::string GetHeaderForTestsFromValId() { + return R"( +OpCapability Shader +OpCapability Linkage +OpCapability Addresses +OpCapability Pipes +OpCapability LiteralSampler +OpCapability DeviceEnqueue +OpCapability Vector16 +OpCapability Int8 +OpCapability Int16 +OpCapability Int64 +OpCapability Float64 +OpMemoryModel Logical GLSL450 +%void = OpTypeVoid +%void_f = OpTypeFunction %void +%int = OpTypeInt 32 0 +%float = OpTypeFloat 32 +%v3float = OpTypeVector %float 3 +%mat4x3 = OpTypeMatrix %v3float 4 +%_ptr_Private_mat4x3 = OpTypePointer Private %mat4x3 +%_ptr_Private_float = OpTypePointer Private %float +%my_matrix = OpVariable %_ptr_Private_mat4x3 Private +%my_float_var = OpVariable %_ptr_Private_float Private +%_ptr_Function_float = OpTypePointer Function %float +%int_0 = OpConstant %int 0 +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%int_3 = OpConstant %int 3 +%int_5 = OpConstant %int 5 + +; Making the following nested structures. +; +; struct S { +; bool b; +; vec4 v[5]; +; int i; +; mat4x3 m[5]; +; } +; uniform blockName { +; S s; +; bool cond; +; RunTimeArray arr; +; } + +%f32arr = OpTypeRuntimeArray %float +%bool = OpTypeBool +%v4float = OpTypeVector %float 4 +%array5_mat4x3 = OpTypeArray %mat4x3 %int_5 +%array5_vec4 = OpTypeArray %v4float %int_5 +%_ptr_Uniform_float = OpTypePointer Uniform %float +%_ptr_Function_vec4 = OpTypePointer Function %v4float +%_ptr_Uniform_vec4 = OpTypePointer Uniform %v4float +%struct_s = OpTypeStruct %bool %array5_vec4 %int %array5_mat4x3 +%struct_blockName = OpTypeStruct %struct_s %bool %f32arr +%_ptr_Uniform_blockName = OpTypePointer Uniform %struct_blockName +%_ptr_Uniform_struct_s = OpTypePointer Uniform %struct_s +%_ptr_Uniform_array5_mat4x3 = OpTypePointer Uniform %array5_mat4x3 +%_ptr_Uniform_mat4x3 = OpTypePointer Uniform %mat4x3 +%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float +%blockName_var = OpVariable %_ptr_Uniform_blockName Uniform +%spec_int = OpSpecConstant %int 2 +%func = OpFunction %void None %void_f +%my_label = OpLabel +)"; +} + +TEST_F(ValidateComposites, VectorExtractDynamicSuccess) { + const std::string body = R"( +%val1 = OpVectorExtractDynamic %f32 %f32vec4_0123 %u32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateComposites, VectorExtractDynamicWrongResultType) { + const std::string body = R"( +%val1 = OpVectorExtractDynamic %f32vec4 %f32vec4_0123 %u32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("VectorExtractDynamic: " + "expected Result Type to be a scalar type")); +} + +TEST_F(ValidateComposites, VectorExtractDynamicNotVector) { + const std::string body = R"( +%val1 = OpVectorExtractDynamic %f32 %f32mat22_1212 %u32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("VectorExtractDynamic: " + "expected Vector type to be OpTypeVector")); +} + +TEST_F(ValidateComposites, VectorExtractDynamicWrongVectorComponent) { + const std::string body = R"( +%val1 = OpVectorExtractDynamic %f32 %u32vec4_0123 %u32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("VectorExtractDynamic: " + "expected Vector component type to be equal to Result Type")); +} + +TEST_F(ValidateComposites, VectorExtractDynamicWrongIndexType) { + const std::string body = R"( +%val1 = OpVectorExtractDynamic %f32 %f32vec4_0123 %f32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("VectorExtractDynamic: " + "expected Index to be int scalar")); +} + +TEST_F(ValidateComposites, VectorInsertDynamicSuccess) { + const std::string body = R"( +%val1 = OpVectorInsertDynamic %f32vec4 %f32vec4_0123 %f32_1 %u32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateComposites, VectorInsertDynamicWrongResultType) { + const std::string body = R"( +%val1 = OpVectorInsertDynamic %f32 %f32vec4_0123 %f32_1 %u32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("VectorInsertDynamic: " + "expected Result Type to be OpTypeVector")); +} + +TEST_F(ValidateComposites, VectorInsertDynamicNotVector) { + const std::string body = R"( +%val1 = OpVectorInsertDynamic %f32vec4 %f32mat22_1212 %f32_1 %u32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("VectorInsertDynamic: " + "expected Vector type to be equal to Result Type")); +} + +TEST_F(ValidateComposites, VectorInsertDynamicWrongComponentType) { + const std::string body = R"( +%val1 = OpVectorInsertDynamic %f32vec4 %f32vec4_0123 %u32_1 %u32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("VectorInsertDynamic: " + "expected Component type to be equal to Result Type " + "component type")); +} + +TEST_F(ValidateComposites, VectorInsertDynamicWrongIndexType) { + const std::string body = R"( +%val1 = OpVectorInsertDynamic %f32vec4 %f32vec4_0123 %f32_1 %f32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("VectorInsertDynamic: " + "expected Index to be int scalar")); +} + +TEST_F(ValidateComposites, CompositeConstructNotComposite) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("CompositeConstruct: " + "expected Result Type to be a composite type")); +} + +TEST_F(ValidateComposites, CompositeConstructVectorSuccess) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32vec4 %f32vec2_12 %f32vec2_12 +%val2 = OpCompositeConstruct %f32vec4 %f32vec2_12 %f32_0 %f32_0 +%val3 = OpCompositeConstruct %f32vec4 %f32_0 %f32_0 %f32vec2_12 +%val4 = OpCompositeConstruct %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateComposites, CompositeConstructVectorOnlyOneConstituent) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32vec4 %f32vec4_0123 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("CompositeConstruct: " + "expected number of constituents to be at least 2")); +} + +TEST_F(ValidateComposites, CompositeConstructVectorWrongConsituent1) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32vec4 %f32 %f32vec2_12 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("CompositeConstruct: " + "expected Constituents to be scalars or vectors of the same " + "type as Result Type components")); +} + +TEST_F(ValidateComposites, CompositeConstructVectorWrongConsituent2) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32vec4 %f32vec2_12 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("CompositeConstruct: " + "expected Constituents to be scalars or vectors of the same " + "type as Result Type components")); +} + +TEST_F(ValidateComposites, CompositeConstructVectorWrongConsituent3) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32vec4 %f32vec2_12 %u32_0 %f32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("CompositeConstruct: " + "expected Constituents to be scalars or vectors of the same " + "type as Result Type components")); +} + +TEST_F(ValidateComposites, CompositeConstructVectorWrongComponentNumber1) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32vec4 %f32vec2_12 %f32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("CompositeConstruct: " + "expected total number of given components to be equal to the " + "size of Result Type vector")); +} + +TEST_F(ValidateComposites, CompositeConstructVectorWrongComponentNumber2) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32vec4 %f32vec2_12 %f32vec2_12 %f32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("CompositeConstruct: " + "expected total number of given components to be equal to the " + "size of Result Type vector")); +} + +TEST_F(ValidateComposites, CompositeConstructMatrixSuccess) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32mat22 %f32vec2_12 %f32vec2_12 +%val2 = OpCompositeConstruct %f32mat23 %f32vec2_12 %f32vec2_12 %f32vec2_12 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateComposites, CompositeConstructVectorWrongConsituentNumber1) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32mat22 %f32vec2_12 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("CompositeConstruct: " + "expected total number of Constituents to be equal to the " + "number of columns of Result Type matrix")); +} + +TEST_F(ValidateComposites, CompositeConstructVectorWrongConsituentNumber2) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32mat22 %f32vec2_12 %f32vec2_12 %f32vec2_12 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("CompositeConstruct: " + "expected total number of Constituents to be equal to the " + "number of columns of Result Type matrix")); +} + +TEST_F(ValidateComposites, CompositeConstructVectorWrongConsituent) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32mat22 %f32vec2_12 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("CompositeConstruct: " + "expected Constituent type to be equal to the column type " + "Result Type matrix")); +} + +TEST_F(ValidateComposites, CompositeConstructArraySuccess) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32vec2arr3 %f32vec2_12 %f32vec2_12 %f32vec2_12 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateComposites, CompositeConstructArrayWrongConsituentNumber1) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32vec2arr3 %f32vec2_12 %f32vec2_12 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("CompositeConstruct: " + "expected total number of Constituents to be equal to the " + "number of elements of Result Type array")); +} + +TEST_F(ValidateComposites, CompositeConstructArrayWrongConsituentNumber2) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32vec2arr3 %f32vec2_12 %f32vec2_12 %f32vec2_12 %f32vec2_12 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("CompositeConstruct: " + "expected total number of Constituents to be equal to the " + "number of elements of Result Type array")); +} + +TEST_F(ValidateComposites, CompositeConstructArrayWrongConsituent) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32vec2arr3 %f32vec2_12 %u32vec2_01 %f32vec2_12 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("CompositeConstruct: " + "expected Constituent type to be equal to the column type " + "Result Type array")); +} + +TEST_F(ValidateComposites, CompositeConstructStructSuccess) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32u32struct %f32_0 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateComposites, CompositeConstructStructWrongConstituentNumber1) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32u32struct %f32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("CompositeConstruct: " + "expected total number of Constituents to be equal to the " + "number of members of Result Type struct")); +} + +TEST_F(ValidateComposites, CompositeConstructStructWrongConstituentNumber2) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32u32struct %f32_0 %u32_1 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("CompositeConstruct: " + "expected total number of Constituents to be equal to the " + "number of members of Result Type struct")); +} + +TEST_F(ValidateComposites, CompositeConstructStructWrongConstituent) { + const std::string body = R"( +%val1 = OpCompositeConstruct %f32u32struct %f32_0 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("CompositeConstruct: " + "expected Constituent type to be equal to the " + "corresponding member type of Result Type struct")); +} + +TEST_F(ValidateComposites, CopyObjectSuccess) { + const std::string body = R"( +%val1 = OpCopyObject %f32 %f32_0 +%val2 = OpCopyObject %f32vec4 %f32vec4_0123 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateComposites, CopyObjectResultTypeNotType) { + const std::string body = R"( +%val1 = OpCopyObject %f32_0 %f32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("CopyObject: expected Result Type to be a type")); +} + +TEST_F(ValidateComposites, CopyObjectWrongOperandType) { + const std::string body = R"( +%val1 = OpCopyObject %f32 %u32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("CopyObject: " + "expected Result Type and Operand type to be the same")); +} + +TEST_F(ValidateComposites, TransposeSuccess) { + const std::string body = R"( +%val1 = OpTranspose %f32mat32 %f32mat23_121212 +%val2 = OpTranspose %f32mat22 %f32mat22_1212 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateComposites, TransposeResultTypeNotMatrix) { + const std::string body = R"( +%val1 = OpTranspose %f32vec4 %f32mat22_1212 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Transpose: expected Result Type to be a matrix type")); +} + +TEST_F(ValidateComposites, TransposeDifferentComponentTypes) { + const std::string body = R"( +%val1 = OpTranspose %f64mat22 %f32mat22_1212 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Transpose: " + "expected component types of Matrix and Result Type to be " + "identical")); +} + +TEST_F(ValidateComposites, TransposeIncompatibleDimensions1) { + const std::string body = R"( +%val1 = OpTranspose %f32mat23 %f32mat22_1212 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Transpose: expected number of columns and the column size " + "of Matrix to be the reverse of those of Result Type")); +} + +TEST_F(ValidateComposites, TransposeIncompatibleDimensions2) { + const std::string body = R"( +%val1 = OpTranspose %f32mat32 %f32mat22_1212 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Transpose: expected number of columns and the column size " + "of Matrix to be the reverse of those of Result Type")); +} + +TEST_F(ValidateComposites, TransposeIncompatibleDimensions3) { + const std::string body = R"( +%val1 = OpTranspose %f32mat23 %f32mat23_121212 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Transpose: expected number of columns and the column size " + "of Matrix to be the reverse of those of Result Type")); +} + +TEST_F(ValidateComposites, CompositeExtractSuccess) { + const std::string body = R"( +%val1 = OpCompositeExtract %f32 %f32vec4_0123 1 +%val2 = OpCompositeExtract %u32 %u32vec4_0123 0 +%val3 = OpCompositeExtract %f32 %f32mat22_1212 0 1 +%val4 = OpCompositeExtract %f32vec2 %f32mat22_1212 0 +%array = OpCompositeConstruct %f32vec2arr3 %f32vec2_12 %f32vec2_12 %f32vec2_12 +%val5 = OpCompositeExtract %f32vec2 %array 2 +%val6 = OpCompositeExtract %f32 %array 2 1 +%struct = OpLoad %big_struct %var_big_struct +%val7 = OpCompositeExtract %f32 %struct 0 +%val8 = OpCompositeExtract %f32vec4 %struct 1 +%val9 = OpCompositeExtract %f32 %struct 1 2 +%val10 = OpCompositeExtract %f32mat23 %struct 2 +%val11 = OpCompositeExtract %f32vec2 %struct 2 2 +%val12 = OpCompositeExtract %f32 %struct 2 2 1 +%val13 = OpCompositeExtract %f32vec2 %struct 3 2 +%val14 = OpCompositeExtract %f32 %struct 3 2 1 +%val15 = OpCompositeExtract %f32vec2 %struct 4 100 +%val16 = OpCompositeExtract %f32 %struct 4 1000 1 +%val17 = OpCompositeExtract %f32 %struct 5 0 +%val18 = OpCompositeExtract %u32 %struct 5 1 +%val19 = OpCompositeExtract %big_struct %struct +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateComposites, CompositeExtractNotObject) { + const std::string body = R"( +%val1 = OpCompositeExtract %f32 %f32vec4 1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("CompositeExtract: expected Composite to be an object " + "of composite type")); +} + +TEST_F(ValidateComposites, CompositeExtractNotComposite) { + const std::string body = R"( +%val1 = OpCompositeExtract %f32 %f32_1 0 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpCompositeExtract reached non-composite type while " + "indexes still remain to be traversed.")); +} + +TEST_F(ValidateComposites, CompositeExtractVectorOutOfBounds) { + const std::string body = R"( +%val1 = OpCompositeExtract %f32 %f32vec4_0123 4 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("CompositeExtract: vector access is out of bounds, " + "vector size is 4, but access index is 4")); +} + +TEST_F(ValidateComposites, CompositeExtractMatrixOutOfCols) { + const std::string body = R"( +%val1 = OpCompositeExtract %f32 %f32mat23_121212 3 1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("CompositeExtract: matrix access is out of bounds, " + "matrix has 3 columns, but access index is 3")); +} + +TEST_F(ValidateComposites, CompositeExtractMatrixOutOfRows) { + const std::string body = R"( +%val1 = OpCompositeExtract %f32 %f32mat23_121212 2 5 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("CompositeExtract: vector access is out of bounds, " + "vector size is 2, but access index is 5")); +} + +TEST_F(ValidateComposites, CompositeExtractArrayOutOfBounds) { + const std::string body = R"( +%array = OpCompositeConstruct %f32vec2arr3 %f32vec2_12 %f32vec2_12 %f32vec2_12 +%val1 = OpCompositeExtract %f32vec2 %array 3 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("CompositeExtract: array access is out of bounds, " + "array size is 3, but access index is 3")); +} + +TEST_F(ValidateComposites, CompositeExtractStructOutOfBounds) { + const std::string body = R"( +%struct = OpLoad %big_struct %var_big_struct +%val1 = OpCompositeExtract %f32 %struct 6 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Index is out of bounds: OpCompositeExtract can not " + "find index 6 into the structure '37'. This " + "structure has 6 members. Largest valid index is 5.")); +} + +TEST_F(ValidateComposites, CompositeExtractNestedVectorOutOfBounds) { + const std::string body = R"( +%struct = OpLoad %big_struct %var_big_struct +%val1 = OpCompositeExtract %f32 %struct 3 1 5 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("CompositeExtract: vector access is out of bounds, " + "vector size is 2, but access index is 5")); +} + +TEST_F(ValidateComposites, CompositeExtractTooManyIndices) { + const std::string body = R"( +%struct = OpLoad %big_struct %var_big_struct +%val1 = OpCompositeExtract %f32 %struct 3 1 1 2 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpCompositeExtract reached non-composite type while " + "indexes still remain to be traversed.")); +} + +TEST_F(ValidateComposites, CompositeExtractWrongType1) { + const std::string body = R"( +%struct = OpLoad %big_struct %var_big_struct +%val1 = OpCompositeExtract %f32vec2 %struct 3 1 1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpCompositeExtract result type (OpTypeVector) does not match the " + "type that results from indexing into the composite (OpTypeFloat).")); +} + +TEST_F(ValidateComposites, CompositeExtractWrongType2) { + const std::string body = R"( +%struct = OpLoad %big_struct %var_big_struct +%val1 = OpCompositeExtract %f32 %struct 3 1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpCompositeExtract result type (OpTypeFloat) does not " + "match the type that results from indexing into the " + "composite (OpTypeVector).")); +} + +TEST_F(ValidateComposites, CompositeExtractWrongType3) { + const std::string body = R"( +%struct = OpLoad %big_struct %var_big_struct +%val1 = OpCompositeExtract %f32 %struct 2 1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpCompositeExtract result type (OpTypeFloat) does not " + "match the type that results from indexing into the " + "composite (OpTypeVector).")); +} + +TEST_F(ValidateComposites, CompositeExtractWrongType4) { + const std::string body = R"( +%struct = OpLoad %big_struct %var_big_struct +%val1 = OpCompositeExtract %f32 %struct 4 1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpCompositeExtract result type (OpTypeFloat) does not " + "match the type that results from indexing into the " + "composite (OpTypeVector).")); +} + +TEST_F(ValidateComposites, CompositeExtractWrongType5) { + const std::string body = R"( +%struct = OpLoad %big_struct %var_big_struct +%val1 = OpCompositeExtract %f32 %struct 5 1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpCompositeExtract result type (OpTypeFloat) does not match the " + "type that results from indexing into the composite (OpTypeInt).")); +} + +TEST_F(ValidateComposites, CompositeInsertSuccess) { + const std::string body = R"( +%val1 = OpCompositeInsert %f32vec4 %f32_1 %f32vec4_0123 0 +%val2 = OpCompositeInsert %u32vec4 %u32_1 %u32vec4_0123 0 +%val3 = OpCompositeInsert %f32mat22 %f32_2 %f32mat22_1212 0 1 +%val4 = OpCompositeInsert %f32mat22 %f32vec2_01 %f32mat22_1212 0 +%array = OpCompositeConstruct %f32vec2arr3 %f32vec2_12 %f32vec2_12 %f32vec2_12 +%val5 = OpCompositeInsert %f32vec2arr3 %f32vec2_01 %array 2 +%val6 = OpCompositeInsert %f32vec2arr3 %f32_3 %array 2 1 +%struct = OpLoad %big_struct %var_big_struct +%val7 = OpCompositeInsert %big_struct %f32_3 %struct 0 +%val8 = OpCompositeInsert %big_struct %f32vec4_0123 %struct 1 +%val9 = OpCompositeInsert %big_struct %f32_3 %struct 1 2 +%val10 = OpCompositeInsert %big_struct %f32mat23_121212 %struct 2 +%val11 = OpCompositeInsert %big_struct %f32vec2_01 %struct 2 2 +%val12 = OpCompositeInsert %big_struct %f32_3 %struct 2 2 1 +%val13 = OpCompositeInsert %big_struct %f32vec2_01 %struct 3 2 +%val14 = OpCompositeInsert %big_struct %f32_3 %struct 3 2 1 +%val15 = OpCompositeInsert %big_struct %f32vec2_01 %struct 4 100 +%val16 = OpCompositeInsert %big_struct %f32_3 %struct 4 1000 1 +%val17 = OpCompositeInsert %big_struct %f32_3 %struct 5 0 +%val18 = OpCompositeInsert %big_struct %u32_3 %struct 5 1 +%val19 = OpCompositeInsert %big_struct %struct %struct +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateComposites, CompositeInsertResultTypeDifferentFromComposite) { + const std::string body = R"( +%val1 = OpCompositeInsert %f32 %f32_1 %f32vec4_0123 0 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("The Result Type must be the same as Composite type in " + "OpCompositeInsert yielding Result Id 5.")); +} + +TEST_F(ValidateComposites, CompositeInsertNotComposite) { + const std::string body = R"( +%val1 = OpCompositeInsert %f32 %f32_1 %f32_0 0 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpCompositeInsert reached non-composite type while " + "indexes still remain to be traversed.")); +} + +TEST_F(ValidateComposites, CompositeInsertVectorOutOfBounds) { + const std::string body = R"( +%val1 = OpCompositeInsert %f32vec4 %f32_1 %f32vec4_0123 4 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("CompositeInsert: vector access is out of bounds, " + "vector size is 4, but access index is 4")); +} + +TEST_F(ValidateComposites, CompositeInsertMatrixOutOfCols) { + const std::string body = R"( +%val1 = OpCompositeInsert %f32mat23 %f32_1 %f32mat23_121212 3 1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("CompositeInsert: matrix access is out of bounds, " + "matrix has 3 columns, but access index is 3")); +} + +TEST_F(ValidateComposites, CompositeInsertMatrixOutOfRows) { + const std::string body = R"( +%val1 = OpCompositeInsert %f32mat23 %f32_1 %f32mat23_121212 2 5 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("CompositeInsert: vector access is out of bounds, " + "vector size is 2, but access index is 5")); +} + +TEST_F(ValidateComposites, CompositeInsertArrayOutOfBounds) { + const std::string body = R"( +%array = OpCompositeConstruct %f32vec2arr3 %f32vec2_12 %f32vec2_12 %f32vec2_12 +%val1 = OpCompositeInsert %f32vec2arr3 %f32vec2_01 %array 3 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("CompositeInsert: array access is out of bounds, array " + "size is 3, but access index is 3")); +} + +TEST_F(ValidateComposites, CompositeInsertStructOutOfBounds) { + const std::string body = R"( +%struct = OpLoad %big_struct %var_big_struct +%val1 = OpCompositeInsert %big_struct %f32_1 %struct 6 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Index is out of bounds: OpCompositeInsert can not " + "find index 6 into the structure '37'. This " + "structure has 6 members. Largest valid index is 5.")); +} + +TEST_F(ValidateComposites, CompositeInsertNestedVectorOutOfBounds) { + const std::string body = R"( +%struct = OpLoad %big_struct %var_big_struct +%val1 = OpCompositeInsert %big_struct %f32_1 %struct 3 1 5 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("CompositeInsert: vector access is out of bounds, " + "vector size is 2, but access index is 5")); +} + +TEST_F(ValidateComposites, CompositeInsertTooManyIndices) { + const std::string body = R"( +%struct = OpLoad %big_struct %var_big_struct +%val1 = OpCompositeInsert %big_struct %f32_1 %struct 3 1 1 2 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpCompositeInsert reached non-composite type while " + "indexes still remain to be traversed.")); +} + +TEST_F(ValidateComposites, CompositeInsertWrongType1) { + const std::string body = R"( +%struct = OpLoad %big_struct %var_big_struct +%val1 = OpCompositeInsert %big_struct %f32vec2_01 %struct 3 1 1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("The Object type (OpTypeVector) in OpCompositeInsert " + "does not match the type that results from indexing " + "into the Composite (OpTypeFloat).")); +} + +TEST_F(ValidateComposites, CompositeInsertWrongType2) { + const std::string body = R"( +%struct = OpLoad %big_struct %var_big_struct +%val1 = OpCompositeInsert %big_struct %f32_1 %struct 3 1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("The Object type (OpTypeFloat) in OpCompositeInsert " + "does not match the type that results from indexing " + "into the Composite (OpTypeVector).")); +} + +TEST_F(ValidateComposites, CompositeInsertWrongType3) { + const std::string body = R"( +%struct = OpLoad %big_struct %var_big_struct +%val1 = OpCompositeInsert %big_struct %f32_1 %struct 2 1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("The Object type (OpTypeFloat) in OpCompositeInsert " + "does not match the type that results from indexing " + "into the Composite (OpTypeVector).")); +} + +TEST_F(ValidateComposites, CompositeInsertWrongType4) { + const std::string body = R"( +%struct = OpLoad %big_struct %var_big_struct +%val1 = OpCompositeInsert %big_struct %f32_1 %struct 4 1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("The Object type (OpTypeFloat) in OpCompositeInsert " + "does not match the type that results from indexing " + "into the Composite (OpTypeVector).")); +} + +TEST_F(ValidateComposites, CompositeInsertWrongType5) { + const std::string body = R"( +%struct = OpLoad %big_struct %var_big_struct +%val1 = OpCompositeInsert %big_struct %f32_1 %struct 5 1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("The Object type (OpTypeFloat) in OpCompositeInsert " + "does not match the type that results from indexing " + "into the Composite (OpTypeInt).")); +} + +// Tests ported from val_id_test.cpp. + +// Valid. Tests both CompositeExtract and CompositeInsert with 255 indexes. +TEST_F(ValidateComposites, CompositeExtractInsertLimitsGood) { + int depth = 255; + std::string header = GetHeaderForTestsFromValId(); + header.erase(header.find("%func")); + std::ostringstream spirv; + spirv << header << std::endl; + + // Build nested structures. Struct 'i' contains struct 'i-1' + spirv << "%s_depth_1 = OpTypeStruct %float\n"; + for (int i = 2; i <= depth; ++i) { + spirv << "%s_depth_" << i << " = OpTypeStruct %s_depth_" << i - 1 << "\n"; + } + + // Define Pointer and Variable to use for CompositeExtract/Insert. + spirv << "%_ptr_Uniform_deep_struct = OpTypePointer Uniform %s_depth_" + << depth << "\n"; + spirv << "%deep_var = OpVariable %_ptr_Uniform_deep_struct Uniform\n"; + + // Function Start + spirv << R"( + %func = OpFunction %void None %void_f + %my_label = OpLabel + )"; + + // OpCompositeExtract/Insert with 'n' indexes (n = depth) + spirv << "%deep = OpLoad %s_depth_" << depth << " %deep_var" << std::endl; + spirv << "%entry = OpCompositeExtract %float %deep"; + for (int i = 0; i < depth; ++i) { + spirv << " 0"; + } + spirv << std::endl; + spirv << "%new_composite = OpCompositeInsert %s_depth_" << depth + << " %entry %deep"; + for (int i = 0; i < depth; ++i) { + spirv << " 0"; + } + spirv << std::endl; + + // Function end + spirv << R"( + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: 256 indexes passed to OpCompositeExtract. Limit is 255. +TEST_F(ValidateComposites, CompositeExtractArgCountExceededLimitBad) { + std::ostringstream spirv; + spirv << GetHeaderForTestsFromValId() << std::endl; + spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl; + spirv << "%entry = OpCompositeExtract %float %matrix"; + for (int i = 0; i < 256; ++i) { + spirv << " 0"; + } + spirv << R"( + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("The number of indexes in OpCompositeExtract may not " + "exceed 255. Found 256 indexes.")); +} + +// Invalid: 256 indexes passed to OpCompositeInsert. Limit is 255. +TEST_F(ValidateComposites, CompositeInsertArgCountExceededLimitBad) { + std::ostringstream spirv; + spirv << GetHeaderForTestsFromValId() << std::endl; + spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl; + spirv << "%new_composite = OpCompositeInsert %mat4x3 %int_0 %matrix"; + for (int i = 0; i < 256; ++i) { + spirv << " 0"; + } + spirv << R"( + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("The number of indexes in OpCompositeInsert may not " + "exceed 255. Found 256 indexes.")); +} + +// Invalid: In OpCompositeInsert, result type must be the same as composite type +TEST_F(ValidateComposites, CompositeInsertWrongResultTypeBad) { + std::ostringstream spirv; + spirv << GetHeaderForTestsFromValId() << std::endl; + spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl; + spirv << "%float_entry = OpCompositeExtract %float %matrix 0 1" << std::endl; + spirv << "%new_composite = OpCompositeInsert %float %float_entry %matrix 0 1" + << std::endl; + spirv << R"(OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("The Result Type must be the same as Composite type")); +} + +// Valid: No Indexes were passed to OpCompositeExtract, and the Result Type is +// the same as the Base Composite type. +TEST_F(ValidateComposites, CompositeExtractNoIndexesGood) { + std::ostringstream spirv; + spirv << GetHeaderForTestsFromValId() << std::endl; + spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl; + spirv << "%float_entry = OpCompositeExtract %mat4x3 %matrix" << std::endl; + spirv << R"(OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: No Indexes were passed to OpCompositeExtract, but the Result Type is +// different from the Base Composite type. +TEST_F(ValidateComposites, CompositeExtractNoIndexesBad) { + std::ostringstream spirv; + spirv << GetHeaderForTestsFromValId() << std::endl; + spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl; + spirv << "%float_entry = OpCompositeExtract %float %matrix" << std::endl; + spirv << R"(OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpCompositeExtract result type (OpTypeFloat) does not " + "match the type that results from indexing into the " + "composite (OpTypeMatrix).")); +} + +// Valid: No Indexes were passed to OpCompositeInsert, and the type of the +// Object argument matches the Composite type. +TEST_F(ValidateComposites, CompositeInsertMissingIndexesGood) { + std::ostringstream spirv; + spirv << GetHeaderForTestsFromValId() << std::endl; + spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl; + spirv << "%matrix_2 = OpLoad %mat4x3 %my_matrix" << std::endl; + spirv << "%new_composite = OpCompositeInsert %mat4x3 %matrix_2 %matrix"; + spirv << R"( + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: No Indexes were passed to OpCompositeInsert, but the type of the +// Object argument does not match the Composite type. +TEST_F(ValidateComposites, CompositeInsertMissingIndexesBad) { + std::ostringstream spirv; + spirv << GetHeaderForTestsFromValId() << std::endl; + spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl; + spirv << "%new_composite = OpCompositeInsert %mat4x3 %int_0 %matrix"; + spirv << R"( + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("The Object type (OpTypeInt) in OpCompositeInsert does " + "not match the type that results from indexing into " + "the Composite (OpTypeMatrix).")); +} + +// Valid: Tests that we can index into Struct, Array, Matrix, and Vector! +TEST_F(ValidateComposites, CompositeExtractInsertIndexIntoAllTypesGood) { + // indexes that we are passing are: 0, 3, 1, 2, 0 + // 0 will select the struct_s within the base struct (blockName) + // 3 will select the Array that contains 5 matrices + // 1 will select the Matrix that is at index 1 of the array + // 2 will select the column (which is a vector) within the matrix at index 2 + // 0 will select the element at the index 0 of the vector. (which is a float). + std::ostringstream spirv; + spirv << GetHeaderForTestsFromValId() << R"( + %myblock = OpLoad %struct_blockName %blockName_var + %ss = OpCompositeExtract %struct_s %myblock 0 + %sa = OpCompositeExtract %array5_mat4x3 %myblock 0 3 + %sm = OpCompositeExtract %mat4x3 %myblock 0 3 1 + %sc = OpCompositeExtract %v3float %myblock 0 3 1 2 + %fl = OpCompositeExtract %float %myblock 0 3 1 2 0 + ; + ; Now let's insert back at different levels... + ; + %b1 = OpCompositeInsert %struct_blockName %ss %myblock 0 + %b2 = OpCompositeInsert %struct_blockName %sa %myblock 0 3 + %b3 = OpCompositeInsert %struct_blockName %sm %myblock 0 3 1 + %b4 = OpCompositeInsert %struct_blockName %sc %myblock 0 3 1 2 + %b5 = OpCompositeInsert %struct_blockName %fl %myblock 0 3 1 2 0 + OpReturn + OpFunctionEnd + )"; + + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid. More indexes are provided than needed for OpCompositeExtract. +TEST_F(ValidateComposites, CompositeExtractReachedScalarBad) { + // indexes that we are passing are: 0, 3, 1, 2, 0 + // 0 will select the struct_s within the base struct (blockName) + // 3 will select the Array that contains 5 matrices + // 1 will select the Matrix that is at index 1 of the array + // 2 will select the column (which is a vector) within the matrix at index 2 + // 0 will select the element at the index 0 of the vector. (which is a float). + std::ostringstream spirv; + spirv << GetHeaderForTestsFromValId() << R"( + %myblock = OpLoad %struct_blockName %blockName_var + %fl = OpCompositeExtract %float %myblock 0 3 1 2 0 1 + OpReturn + OpFunctionEnd + )"; + + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpCompositeExtract reached non-composite type while " + "indexes still remain to be traversed.")); +} + +// Invalid. More indexes are provided than needed for OpCompositeInsert. +TEST_F(ValidateComposites, CompositeInsertReachedScalarBad) { + // indexes that we are passing are: 0, 3, 1, 2, 0 + // 0 will select the struct_s within the base struct (blockName) + // 3 will select the Array that contains 5 matrices + // 1 will select the Matrix that is at index 1 of the array + // 2 will select the column (which is a vector) within the matrix at index 2 + // 0 will select the element at the index 0 of the vector. (which is a float). + std::ostringstream spirv; + spirv << GetHeaderForTestsFromValId() << R"( + %myblock = OpLoad %struct_blockName %blockName_var + %fl = OpCompositeExtract %float %myblock 0 3 1 2 0 + %b5 = OpCompositeInsert %struct_blockName %fl %myblock 0 3 1 2 0 1 + OpReturn + OpFunctionEnd + )"; + + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpCompositeInsert reached non-composite type while " + "indexes still remain to be traversed.")); +} + +// Invalid. Result type doesn't match the type we get from indexing into +// the composite. +TEST_F(ValidateComposites, + CompositeExtractResultTypeDoesntMatchIndexedTypeBad) { + // indexes that we are passing are: 0, 3, 1, 2, 0 + // 0 will select the struct_s within the base struct (blockName) + // 3 will select the Array that contains 5 matrices + // 1 will select the Matrix that is at index 1 of the array + // 2 will select the column (which is a vector) within the matrix at index 2 + // 0 will select the element at the index 0 of the vector. (which is a float). + std::ostringstream spirv; + spirv << GetHeaderForTestsFromValId() << R"( + %myblock = OpLoad %struct_blockName %blockName_var + %fl = OpCompositeExtract %int %myblock 0 3 1 2 0 + OpReturn + OpFunctionEnd + )"; + + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpCompositeExtract result type (OpTypeInt) does not " + "match the type that results from indexing into the " + "composite (OpTypeFloat).")); +} + +// Invalid. Given object type doesn't match the type we get from indexing into +// the composite. +TEST_F(ValidateComposites, CompositeInsertObjectTypeDoesntMatchIndexedTypeBad) { + // indexes that we are passing are: 0, 3, 1, 2, 0 + // 0 will select the struct_s within the base struct (blockName) + // 3 will select the Array that contains 5 matrices + // 1 will select the Matrix that is at index 1 of the array + // 2 will select the column (which is a vector) within the matrix at index 2 + // 0 will select the element at the index 0 of the vector. (which is a float). + // We are trying to insert an integer where we should be inserting a float. + std::ostringstream spirv; + spirv << GetHeaderForTestsFromValId() << R"( + %myblock = OpLoad %struct_blockName %blockName_var + %b5 = OpCompositeInsert %struct_blockName %int_0 %myblock 0 3 1 2 0 + OpReturn + OpFunctionEnd + )"; + + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("he Object type (OpTypeInt) in OpCompositeInsert does " + "not match the type that results from indexing into " + "the Composite (OpTypeFloat).")); +} + +// Invalid. Index into a struct is larger than the number of struct members. +TEST_F(ValidateComposites, CompositeExtractStructIndexOutOfBoundBad) { + // struct_blockName has 3 members (index 0,1,2). We'll try to access index 3. + std::ostringstream spirv; + spirv << GetHeaderForTestsFromValId() << R"( + %myblock = OpLoad %struct_blockName %blockName_var + %ss = OpCompositeExtract %struct_s %myblock 3 + OpReturn + OpFunctionEnd + )"; + + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Index is out of bounds: OpCompositeExtract can not " + "find index 3 into the structure '26'. This " + "structure has 3 members. Largest valid index is 2.")); +} + +// Invalid. Index into a struct is larger than the number of struct members. +TEST_F(ValidateComposites, CompositeInsertStructIndexOutOfBoundBad) { + // struct_blockName has 3 members (index 0,1,2). We'll try to access index 3. + std::ostringstream spirv; + spirv << GetHeaderForTestsFromValId() << R"( + %myblock = OpLoad %struct_blockName %blockName_var + %ss = OpCompositeExtract %struct_s %myblock 0 + %new_composite = OpCompositeInsert %struct_blockName %ss %myblock 3 + OpReturn + OpFunctionEnd + )"; + + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Index is out of bounds: OpCompositeInsert can not find " + "index 3 into the structure '26'. This structure " + "has 3 members. Largest valid index is 2.")); +} + +// #1403: Ensure that the default spec constant value is not used to check the +// extract index. +TEST_F(ValidateComposites, ExtractFromSpecConstantSizedArray) { + std::string spirv = R"( +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +OpDecorate %spec_const SpecId 1 +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%spec_const = OpSpecConstant %uint 3 +%uint_array = OpTypeArray %uint %spec_const +%undef = OpUndef %uint_array +%voidf = OpTypeFunction %void +%func = OpFunction %void None %voidf +%1 = OpLabel +%2 = OpCompositeExtract %uint %undef 4 +OpReturn +OpFunctionEnd +)"; + + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// #1403: Ensure that spec constant ops do not produce false positives. +TEST_F(ValidateComposites, ExtractFromSpecConstantOpSizedArray) { + std::string spirv = R"( +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +OpDecorate %spec_const SpecId 1 +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%const = OpConstant %uint 1 +%spec_const = OpSpecConstant %uint 3 +%spec_const_op = OpSpecConstantOp %uint IAdd %spec_const %const +%uint_array = OpTypeArray %uint %spec_const_op +%undef = OpUndef %uint_array +%voidf = OpTypeFunction %void +%func = OpFunction %void None %voidf +%1 = OpLabel +%2 = OpCompositeExtract %uint %undef 4 +OpReturn +OpFunctionEnd +)"; + + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// #1403: Ensure that the default spec constant value is not used to check the +// size of the array for a composite construct. This code has limited actual +// value as it is incorrect unless the specialization constant is assigned the +// value of 2, but it is still a valid module. +TEST_F(ValidateComposites, CompositeConstructSpecConstantSizedArray) { + std::string spirv = R"( +OpCapability Kernel +OpCapability Linkage +OpMemoryModel Logical OpenCL +OpDecorate %spec_const SpecId 1 +%void = OpTypeVoid +%uint = OpTypeInt 32 0 +%uint_0 = OpConstant %uint 0 +%spec_const = OpSpecConstant %uint 3 +%uint_array = OpTypeArray %uint %spec_const +%voidf = OpTypeFunction %void +%func = OpFunction %void None %voidf +%1 = OpLabel +%2 = OpCompositeConstruct %uint_array %uint_0 %uint_0 +OpReturn +OpFunctionEnd +)"; + + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_conversion_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_conversion_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_conversion_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_conversion_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1106 @@ +// Copyright (c) 2017 Google 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. + +// Tests for unique type declaration rules validator. + +#include + +#include "gmock/gmock.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using ::testing::HasSubstr; +using ::testing::Not; + +using ValidateConversion = spvtest::ValidateBase; + +std::string GenerateShaderCode( + const std::string& body, + const std::string& capabilities_and_extensions = "") { + const std::string capabilities = + R"( +OpCapability Shader +OpCapability Int64 +OpCapability Float64)"; + + const std::string after_extension_before_body = + R"( +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f32 = OpTypeFloat 32 +%u32 = OpTypeInt 32 0 +%s32 = OpTypeInt 32 1 +%f64 = OpTypeFloat 64 +%u64 = OpTypeInt 64 0 +%s64 = OpTypeInt 64 1 +%boolvec2 = OpTypeVector %bool 2 +%s32vec2 = OpTypeVector %s32 2 +%u32vec2 = OpTypeVector %u32 2 +%u64vec2 = OpTypeVector %u64 2 +%f32vec2 = OpTypeVector %f32 2 +%f64vec2 = OpTypeVector %f64 2 +%boolvec3 = OpTypeVector %bool 3 +%u32vec3 = OpTypeVector %u32 3 +%u64vec3 = OpTypeVector %u64 3 +%s32vec3 = OpTypeVector %s32 3 +%f32vec3 = OpTypeVector %f32 3 +%f64vec3 = OpTypeVector %f64 3 +%boolvec4 = OpTypeVector %bool 4 +%u32vec4 = OpTypeVector %u32 4 +%u64vec4 = OpTypeVector %u64 4 +%s32vec4 = OpTypeVector %s32 4 +%f32vec4 = OpTypeVector %f32 4 +%f64vec4 = OpTypeVector %f64 4 + +%f32_0 = OpConstant %f32 0 +%f32_1 = OpConstant %f32 1 +%f32_2 = OpConstant %f32 2 +%f32_3 = OpConstant %f32 3 +%f32_4 = OpConstant %f32 4 + +%s32_0 = OpConstant %s32 0 +%s32_1 = OpConstant %s32 1 +%s32_2 = OpConstant %s32 2 +%s32_3 = OpConstant %s32 3 +%s32_4 = OpConstant %s32 4 +%s32_m1 = OpConstant %s32 -1 + +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u32_2 = OpConstant %u32 2 +%u32_3 = OpConstant %u32 3 +%u32_4 = OpConstant %u32 4 + +%f64_0 = OpConstant %f64 0 +%f64_1 = OpConstant %f64 1 +%f64_2 = OpConstant %f64 2 +%f64_3 = OpConstant %f64 3 +%f64_4 = OpConstant %f64 4 + +%s64_0 = OpConstant %s64 0 +%s64_1 = OpConstant %s64 1 +%s64_2 = OpConstant %s64 2 +%s64_3 = OpConstant %s64 3 +%s64_4 = OpConstant %s64 4 +%s64_m1 = OpConstant %s64 -1 + +%u64_0 = OpConstant %u64 0 +%u64_1 = OpConstant %u64 1 +%u64_2 = OpConstant %u64 2 +%u64_3 = OpConstant %u64 3 +%u64_4 = OpConstant %u64 4 + +%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 +%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 +%u32vec3_012 = OpConstantComposite %u32vec3 %u32_0 %u32_1 %u32_2 +%u32vec3_123 = OpConstantComposite %u32vec3 %u32_1 %u32_2 %u32_3 +%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 +%u32vec4_1234 = OpConstantComposite %u32vec4 %u32_1 %u32_2 %u32_3 %u32_4 + +%s32vec2_01 = OpConstantComposite %s32vec2 %s32_0 %s32_1 +%s32vec2_12 = OpConstantComposite %s32vec2 %s32_1 %s32_2 +%s32vec3_012 = OpConstantComposite %s32vec3 %s32_0 %s32_1 %s32_2 +%s32vec3_123 = OpConstantComposite %s32vec3 %s32_1 %s32_2 %s32_3 +%s32vec4_0123 = OpConstantComposite %s32vec4 %s32_0 %s32_1 %s32_2 %s32_3 +%s32vec4_1234 = OpConstantComposite %s32vec4 %s32_1 %s32_2 %s32_3 %s32_4 + +%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 +%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 +%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 +%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 +%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 +%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 + +%f64vec2_01 = OpConstantComposite %f64vec2 %f64_0 %f64_1 +%f64vec2_12 = OpConstantComposite %f64vec2 %f64_1 %f64_2 +%f64vec3_012 = OpConstantComposite %f64vec3 %f64_0 %f64_1 %f64_2 +%f64vec3_123 = OpConstantComposite %f64vec3 %f64_1 %f64_2 %f64_3 +%f64vec4_0123 = OpConstantComposite %f64vec4 %f64_0 %f64_1 %f64_2 %f64_3 +%f64vec4_1234 = OpConstantComposite %f64vec4 %f64_1 %f64_2 %f64_3 %f64_4 + +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool + +%f32ptr_func = OpTypePointer Function %f32 + +%main = OpFunction %void None %func +%main_entry = OpLabel)"; + + const std::string after_body = + R"( +OpReturn +OpFunctionEnd)"; + + return capabilities + capabilities_and_extensions + + after_extension_before_body + body + after_body; +} + +std::string GenerateKernelCode( + const std::string& body, + const std::string& capabilities_and_extensions = "") { + const std::string capabilities = + R"( +OpCapability Addresses +OpCapability Kernel +OpCapability Linkage +OpCapability GenericPointer +OpCapability Int64 +OpCapability Float64)"; + + const std::string after_extension_before_body = + R"( +OpMemoryModel Physical32 OpenCL +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f32 = OpTypeFloat 32 +%u32 = OpTypeInt 32 0 +%f64 = OpTypeFloat 64 +%u64 = OpTypeInt 64 0 +%boolvec2 = OpTypeVector %bool 2 +%u32vec2 = OpTypeVector %u32 2 +%u64vec2 = OpTypeVector %u64 2 +%f32vec2 = OpTypeVector %f32 2 +%f64vec2 = OpTypeVector %f64 2 +%boolvec3 = OpTypeVector %bool 3 +%u32vec3 = OpTypeVector %u32 3 +%u64vec3 = OpTypeVector %u64 3 +%f32vec3 = OpTypeVector %f32 3 +%f64vec3 = OpTypeVector %f64 3 +%boolvec4 = OpTypeVector %bool 4 +%u32vec4 = OpTypeVector %u32 4 +%u64vec4 = OpTypeVector %u64 4 +%f32vec4 = OpTypeVector %f32 4 +%f64vec4 = OpTypeVector %f64 4 + +%f32_0 = OpConstant %f32 0 +%f32_1 = OpConstant %f32 1 +%f32_2 = OpConstant %f32 2 +%f32_3 = OpConstant %f32 3 +%f32_4 = OpConstant %f32 4 + +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u32_2 = OpConstant %u32 2 +%u32_3 = OpConstant %u32 3 +%u32_4 = OpConstant %u32 4 + +%f64_0 = OpConstant %f64 0 +%f64_1 = OpConstant %f64 1 +%f64_2 = OpConstant %f64 2 +%f64_3 = OpConstant %f64 3 +%f64_4 = OpConstant %f64 4 + +%u64_0 = OpConstant %u64 0 +%u64_1 = OpConstant %u64 1 +%u64_2 = OpConstant %u64 2 +%u64_3 = OpConstant %u64 3 +%u64_4 = OpConstant %u64 4 + +%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 +%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 +%u32vec3_012 = OpConstantComposite %u32vec3 %u32_0 %u32_1 %u32_2 +%u32vec3_123 = OpConstantComposite %u32vec3 %u32_1 %u32_2 %u32_3 +%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 +%u32vec4_1234 = OpConstantComposite %u32vec4 %u32_1 %u32_2 %u32_3 %u32_4 + +%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 +%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 +%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 +%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 +%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 +%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 + +%f64vec2_01 = OpConstantComposite %f64vec2 %f64_0 %f64_1 +%f64vec2_12 = OpConstantComposite %f64vec2 %f64_1 %f64_2 +%f64vec3_012 = OpConstantComposite %f64vec3 %f64_0 %f64_1 %f64_2 +%f64vec3_123 = OpConstantComposite %f64vec3 %f64_1 %f64_2 %f64_3 +%f64vec4_0123 = OpConstantComposite %f64vec4 %f64_0 %f64_1 %f64_2 %f64_3 +%f64vec4_1234 = OpConstantComposite %f64vec4 %f64_1 %f64_2 %f64_3 %f64_4 + +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool + +%f32ptr_func = OpTypePointer Function %f32 +%u32ptr_func = OpTypePointer Function %u32 +%f32ptr_gen = OpTypePointer Generic %f32 +%f32ptr_inp = OpTypePointer Input %f32 +%f32ptr_wg = OpTypePointer Workgroup %f32 +%f32ptr_cwg = OpTypePointer CrossWorkgroup %f32 + +%f32inp = OpVariable %f32ptr_inp Input + +%main = OpFunction %void None %func +%main_entry = OpLabel)"; + + const std::string after_body = + R"( +OpReturn +OpFunctionEnd)"; + + return capabilities + capabilities_and_extensions + + after_extension_before_body + body + after_body; +} + +TEST_F(ValidateConversion, ConvertFToUSuccess) { + const std::string body = R"( +%val1 = OpConvertFToU %u32 %f32_1 +%val2 = OpConvertFToU %u32 %f64_0 +%val3 = OpConvertFToU %u32vec2 %f32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateConversion, ConvertFToUWrongResultType) { + const std::string body = R"( +%val = OpConvertFToU %s32 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected unsigned int scalar or vector type as Result " + "Type: ConvertFToU")); +} + +TEST_F(ValidateConversion, ConvertFToUWrongInputType) { + const std::string body = R"( +%val = OpConvertFToU %u32 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected input to be float scalar or vector: ConvertFToU")); +} + +TEST_F(ValidateConversion, ConvertFToUDifferentDimension) { + const std::string body = R"( +%val = OpConvertFToU %u32 %f32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to have the same dimension as Result " + "Type: ConvertFToU")); +} + +TEST_F(ValidateConversion, ConvertFToSSuccess) { + const std::string body = R"( +%val1 = OpConvertFToS %s32 %f32_1 +%val2 = OpConvertFToS %u32 %f64_0 +%val3 = OpConvertFToS %s32vec2 %f32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateConversion, ConvertFToSWrongResultType) { + const std::string body = R"( +%val = OpConvertFToS %bool %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected int scalar or vector type as Result Type: ConvertFToS")); +} + +TEST_F(ValidateConversion, ConvertFToSWrongInputType) { + const std::string body = R"( +%val = OpConvertFToS %s32 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected input to be float scalar or vector: ConvertFToS")); +} + +TEST_F(ValidateConversion, ConvertFToSDifferentDimension) { + const std::string body = R"( +%val = OpConvertFToS %u32 %f32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to have the same dimension as Result " + "Type: ConvertFToS")); +} + +TEST_F(ValidateConversion, ConvertSToFSuccess) { + const std::string body = R"( +%val1 = OpConvertSToF %f32 %u32_1 +%val2 = OpConvertSToF %f32 %s64_0 +%val3 = OpConvertSToF %f32vec2 %s32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateConversion, ConvertSToFWrongResultType) { + const std::string body = R"( +%val = OpConvertSToF %u32 %s32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected float scalar or vector type as Result Type: ConvertSToF")); +} + +TEST_F(ValidateConversion, ConvertSToFWrongInputType) { + const std::string body = R"( +%val = OpConvertSToF %f32 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected input to be int scalar or vector: ConvertSToF")); +} + +TEST_F(ValidateConversion, ConvertSToFDifferentDimension) { + const std::string body = R"( +%val = OpConvertSToF %f32 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to have the same dimension as Result " + "Type: ConvertSToF")); +} + +TEST_F(ValidateConversion, UConvertSuccess) { + const std::string body = R"( +%val1 = OpUConvert %u32 %u64_1 +%val2 = OpUConvert %u64 %s32_0 +%val3 = OpUConvert %u64vec2 %s32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateConversion, UConvertWrongResultType) { + const std::string body = R"( +%val = OpUConvert %s32 %s32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected unsigned int scalar or vector type as Result " + "Type: UConvert")); +} + +TEST_F(ValidateConversion, UConvertWrongInputType) { + const std::string body = R"( +%val = OpUConvert %u32 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to be int scalar or vector: UConvert")); +} + +TEST_F(ValidateConversion, UConvertDifferentDimension) { + const std::string body = R"( +%val = OpUConvert %u32 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to have the same dimension as Result " + "Type: UConvert")); +} + +TEST_F(ValidateConversion, UConvertSameBitWidth) { + const std::string body = R"( +%val = OpUConvert %u32 %s32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to have different bit width from " + "Result Type: UConvert")); +} + +TEST_F(ValidateConversion, SConvertSuccess) { + const std::string body = R"( +%val1 = OpSConvert %s32 %u64_1 +%val2 = OpSConvert %s64 %s32_0 +%val3 = OpSConvert %u64vec2 %s32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateConversion, SConvertWrongResultType) { + const std::string body = R"( +%val = OpSConvert %f32 %s32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected int scalar or vector type as Result Type: SConvert")); +} + +TEST_F(ValidateConversion, SConvertWrongInputType) { + const std::string body = R"( +%val = OpSConvert %u32 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to be int scalar or vector: SConvert")); +} + +TEST_F(ValidateConversion, SConvertDifferentDimension) { + const std::string body = R"( +%val = OpSConvert %s32 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to have the same dimension as Result " + "Type: SConvert")); +} + +TEST_F(ValidateConversion, SConvertSameBitWidth) { + const std::string body = R"( +%val = OpSConvert %u32 %s32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to have different bit width from " + "Result Type: SConvert")); +} + +TEST_F(ValidateConversion, FConvertSuccess) { + const std::string body = R"( +%val1 = OpFConvert %f32 %f64_1 +%val2 = OpFConvert %f64 %f32_0 +%val3 = OpFConvert %f64vec2 %f32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateConversion, FConvertWrongResultType) { + const std::string body = R"( +%val = OpFConvert %u32 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected float scalar or vector type as Result Type: FConvert")); +} + +TEST_F(ValidateConversion, FConvertWrongInputType) { + const std::string body = R"( +%val = OpFConvert %f32 %u64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected input to be float scalar or vector: FConvert")); +} + +TEST_F(ValidateConversion, FConvertDifferentDimension) { + const std::string body = R"( +%val = OpFConvert %f64 %f32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to have the same dimension as Result " + "Type: FConvert")); +} + +TEST_F(ValidateConversion, FConvertSameBitWidth) { + const std::string body = R"( +%val = OpFConvert %f32 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to have different bit width from " + "Result Type: FConvert")); +} + +TEST_F(ValidateConversion, QuantizeToF16Success) { + const std::string body = R"( +%val1 = OpQuantizeToF16 %f32 %f32_1 +%val2 = OpQuantizeToF16 %f32 %f32_0 +%val3 = OpQuantizeToF16 %f32vec2 %f32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateConversion, QuantizeToF16WrongResultType) { + const std::string body = R"( +%val = OpQuantizeToF16 %u32 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected 32-bit float scalar or vector type as Result Type: " + "QuantizeToF16")); +} + +TEST_F(ValidateConversion, QuantizeToF16WrongResultTypeBitWidth) { + const std::string body = R"( +%val = OpQuantizeToF16 %u64 %f64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected 32-bit float scalar or vector type as Result Type: " + "QuantizeToF16")); +} + +TEST_F(ValidateConversion, QuantizeToF16WrongInputType) { + const std::string body = R"( +%val = OpQuantizeToF16 %f32 %f64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected input type to be equal to Result Type: QuantizeToF16")); +} + +TEST_F(ValidateConversion, ConvertPtrToUSuccess) { + const std::string body = R"( +%ptr = OpVariable %f32ptr_func Function +%val1 = OpConvertPtrToU %u32 %ptr +%val2 = OpConvertPtrToU %u64 %ptr +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateConversion, ConvertPtrToUWrongResultType) { + const std::string body = R"( +%ptr = OpVariable %f32ptr_func Function +%val = OpConvertPtrToU %f32 %ptr +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected unsigned int scalar type as Result Type: " + "ConvertPtrToU")); +} + +TEST_F(ValidateConversion, ConvertPtrToUNotPointer) { + const std::string body = R"( +%val = OpConvertPtrToU %u32 %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to be a pointer: ConvertPtrToU")); +} + +TEST_F(ValidateConversion, SatConvertSToUSuccess) { + const std::string body = R"( +%val1 = OpSatConvertSToU %u32 %u64_2 +%val2 = OpSatConvertSToU %u64 %u32_1 +%val3 = OpSatConvertSToU %u64vec2 %u32vec2_12 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateConversion, SatConvertSToUWrongResultType) { + const std::string body = R"( +%val = OpSatConvertSToU %f32 %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected int scalar or vector type as Result Type: " + "SatConvertSToU")); +} + +TEST_F(ValidateConversion, SatConvertSToUWrongInputType) { + const std::string body = R"( +%val = OpSatConvertSToU %u32 %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected int scalar or vector as input: SatConvertSToU")); +} + +TEST_F(ValidateConversion, SatConvertSToUDifferentDimension) { + const std::string body = R"( +%val = OpSatConvertSToU %u32 %u32vec2_12 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected input to have the same dimension as Result Type: " + "SatConvertSToU")); +} + +TEST_F(ValidateConversion, ConvertUToPtrSuccess) { + const std::string body = R"( +%val1 = OpConvertUToPtr %f32ptr_func %u32_1 +%val2 = OpConvertUToPtr %f32ptr_func %u64_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateConversion, ConvertUToPtrWrongResultType) { + const std::string body = R"( +%val = OpConvertUToPtr %f32 %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to be a pointer: ConvertUToPtr")); +} + +TEST_F(ValidateConversion, ConvertUToPtrNotInt) { + const std::string body = R"( +%val = OpConvertUToPtr %f32ptr_func %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected int scalar as input: ConvertUToPtr")); +} + +TEST_F(ValidateConversion, ConvertUToPtrNotIntScalar) { + const std::string body = R"( +%val = OpConvertUToPtr %f32ptr_func %u32vec2_12 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected int scalar as input: ConvertUToPtr")); +} + +TEST_F(ValidateConversion, PtrCastToGenericSuccess) { + const std::string body = R"( +%ptr_func = OpVariable %f32ptr_func Function +%val = OpPtrCastToGeneric %f32ptr_gen %ptr_func +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateConversion, PtrCastToGenericWrongResultType) { + const std::string body = R"( +%ptr_func = OpVariable %f32ptr_func Function +%val = OpPtrCastToGeneric %f32 %ptr_func +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Result Type to be a pointer: PtrCastToGeneric")); +} + +TEST_F(ValidateConversion, PtrCastToGenericWrongResultStorageClass) { + const std::string body = R"( +%ptr_func = OpVariable %f32ptr_func Function +%val = OpPtrCastToGeneric %f32ptr_func %ptr_func +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to have storage class Generic: " + "PtrCastToGeneric")); +} + +TEST_F(ValidateConversion, PtrCastToGenericWrongInputType) { + const std::string body = R"( +%ptr_func = OpVariable %f32ptr_func Function +%val = OpPtrCastToGeneric %f32ptr_gen %f32 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to be a pointer: PtrCastToGeneric")); +} + +TEST_F(ValidateConversion, PtrCastToGenericWrongInputStorageClass) { + const std::string body = R"( +%val = OpPtrCastToGeneric %f32ptr_gen %f32inp +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to have storage class Workgroup, " + "CrossWorkgroup or Function: PtrCastToGeneric")); +} + +TEST_F(ValidateConversion, PtrCastToGenericPointToDifferentType) { + const std::string body = R"( +%ptr_func = OpVariable %u32ptr_func Function +%val = OpPtrCastToGeneric %f32ptr_gen %ptr_func +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected input and Result Type to point to the same type: " + "PtrCastToGeneric")); +} + +TEST_F(ValidateConversion, GenericCastToPtrSuccess) { + const std::string body = R"( +%ptr_func = OpVariable %f32ptr_func Function +%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func +%ptr_func2 = OpGenericCastToPtr %f32ptr_func %ptr_gen +%ptr_wg = OpGenericCastToPtr %f32ptr_wg %ptr_gen +%ptr_cwg = OpGenericCastToPtr %f32ptr_cwg %ptr_gen +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateConversion, GenericCastToPtrWrongResultType) { + const std::string body = R"( +%ptr_func = OpVariable %f32ptr_func Function +%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func +%ptr_func2 = OpGenericCastToPtr %f32 %ptr_gen +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Result Type to be a pointer: GenericCastToPtr")); +} + +TEST_F(ValidateConversion, GenericCastToPtrWrongResultStorageClass) { + const std::string body = R"( +%ptr_func = OpVariable %f32ptr_func Function +%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func +%ptr_func2 = OpGenericCastToPtr %f32ptr_gen %ptr_gen +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to have storage class Workgroup, " + "CrossWorkgroup or Function: GenericCastToPtr")); +} + +TEST_F(ValidateConversion, GenericCastToPtrWrongInputType) { + const std::string body = R"( +%ptr_func = OpVariable %f32ptr_func Function +%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func +%ptr_func2 = OpGenericCastToPtr %f32ptr_func %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to be a pointer: GenericCastToPtr")); +} + +TEST_F(ValidateConversion, GenericCastToPtrWrongInputStorageClass) { + const std::string body = R"( +%ptr_func = OpVariable %f32ptr_func Function +%ptr_func2 = OpGenericCastToPtr %f32ptr_func %ptr_func +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to have storage class Generic: " + "GenericCastToPtr")); +} + +TEST_F(ValidateConversion, GenericCastToPtrPointToDifferentType) { + const std::string body = R"( +%ptr_func = OpVariable %f32ptr_func Function +%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func +%ptr_func2 = OpGenericCastToPtr %u32ptr_func %ptr_gen +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected input and Result Type to point to the same type: " + "GenericCastToPtr")); +} + +TEST_F(ValidateConversion, GenericCastToPtrExplicitSuccess) { + const std::string body = R"( +%ptr_func = OpVariable %f32ptr_func Function +%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func +%ptr_func2 = OpGenericCastToPtrExplicit %f32ptr_func %ptr_gen Function +%ptr_wg = OpGenericCastToPtrExplicit %f32ptr_wg %ptr_gen Workgroup +%ptr_cwg = OpGenericCastToPtrExplicit %f32ptr_cwg %ptr_gen CrossWorkgroup +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateConversion, GenericCastToPtrExplicitWrongResultType) { + const std::string body = R"( +%ptr_func = OpVariable %f32ptr_func Function +%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func +%ptr_func2 = OpGenericCastToPtrExplicit %f32 %ptr_gen Function +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected Result Type to be a pointer: GenericCastToPtrExplicit")); +} + +TEST_F(ValidateConversion, GenericCastToPtrExplicitResultStorageClassDiffers) { + const std::string body = R"( +%ptr_func = OpVariable %f32ptr_func Function +%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func +%ptr_func2 = OpGenericCastToPtrExplicit %f32ptr_func %ptr_gen Workgroup +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to be of target storage class: " + "GenericCastToPtrExplicit")); +} + +TEST_F(ValidateConversion, GenericCastToPtrExplicitWrongResultStorageClass) { + const std::string body = R"( +%ptr_func = OpVariable %f32ptr_func Function +%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func +%ptr_func2 = OpGenericCastToPtrExplicit %f32ptr_gen %ptr_gen Generic +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected target storage class to be Workgroup, " + "CrossWorkgroup or Function: GenericCastToPtrExplicit")); +} + +TEST_F(ValidateConversion, GenericCastToPtrExplicitWrongInputType) { + const std::string body = R"( +%ptr_func = OpVariable %f32ptr_func Function +%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func +%ptr_func2 = OpGenericCastToPtrExplicit %f32ptr_func %f32_1 Function +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected input to be a pointer: GenericCastToPtrExplicit")); +} + +TEST_F(ValidateConversion, GenericCastToPtrExplicitWrongInputStorageClass) { + const std::string body = R"( +%ptr_func = OpVariable %f32ptr_func Function +%ptr_func2 = OpGenericCastToPtrExplicit %f32ptr_func %ptr_func Function +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to have storage class Generic: " + "GenericCastToPtrExplicit")); +} + +TEST_F(ValidateConversion, GenericCastToPtrExplicitPointToDifferentType) { + const std::string body = R"( +%ptr_func = OpVariable %f32ptr_func Function +%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func +%ptr_func2 = OpGenericCastToPtrExplicit %u32ptr_func %ptr_gen Function +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected input and Result Type to point to the same type: " + "GenericCastToPtrExplicit")); +} + +TEST_F(ValidateConversion, BitcastSuccess) { + const std::string body = R"( +%ptr = OpVariable %f32ptr_func Function +%val1 = OpBitcast %u32 %ptr +%val2 = OpBitcast %u64 %ptr +%val3 = OpBitcast %f32ptr_func %u32_1 +%val4 = OpBitcast %f32ptr_wg %u64_1 +%val5 = OpBitcast %f32 %u32_1 +%val6 = OpBitcast %f32vec2 %u32vec2_12 +%val7 = OpBitcast %f32vec2 %u64_1 +%val8 = OpBitcast %f64 %u32vec2_12 +%val9 = OpBitcast %f32vec4 %f64vec2_12 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateConversion, BitcastInputHasNoType) { + const std::string body = R"( +%val = OpBitcast %u32 %f32 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to have a type: Bitcast")); +} + +TEST_F(ValidateConversion, BitcastWrongResultType) { + const std::string body = R"( +%val = OpBitcast %bool %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Result Type to be a pointer or int or float vector " + "or scalar type: Bitcast")); +} + +TEST_F(ValidateConversion, BitcastWrongInputType) { + const std::string body = R"( +%val = OpBitcast %u32 %true +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected input to be a pointer or int or float vector " + "or scalar: Bitcast")); +} + +TEST_F(ValidateConversion, BitcastPtrWrongInputType) { + const std::string body = R"( +%val = OpBitcast %u32ptr_func %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected input to be a pointer or int scalar if Result Type " + "is pointer: Bitcast")); +} + +TEST_F(ValidateConversion, BitcastPtrWrongResultType) { + const std::string body = R"( +%val = OpBitcast %f32 %f32inp +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Pointer can only be converted to another pointer or int scalar: " + "Bitcast")); +} + +TEST_F(ValidateConversion, BitcastDifferentTotalBitWidth) { + const std::string body = R"( +%val = OpBitcast %f32 %u64_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected input to have the same total bit width as Result Type: " + "Bitcast")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_data_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_data_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_data_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_data_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,595 @@ +// Copyright (c) 2016 Google 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. + +// Validation tests for Data Rules. + +#include +#include +#include + +#include "gmock/gmock.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using ::testing::HasSubstr; +using ::testing::MatchesRegex; + +using std::pair; +using std::string; +using std::stringstream; + +using ValidateData = spvtest::ValidateBase>; + +string HeaderWith(std::string cap) { + return std::string("OpCapability Shader OpCapability Linkage OpCapability ") + + cap + " OpMemoryModel Logical GLSL450 "; +} + +string header = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 +)"; +string header_with_addresses = R"( + OpCapability Addresses + OpCapability Kernel + OpCapability GenericPointer + OpCapability Linkage + OpMemoryModel Physical32 OpenCL +)"; +string header_with_vec16_cap = R"( + OpCapability Shader + OpCapability Vector16 + OpCapability Linkage + OpMemoryModel Logical GLSL450 +)"; +string header_with_int8 = R"( + OpCapability Shader + OpCapability Linkage + OpCapability Int8 + OpMemoryModel Logical GLSL450 +)"; +string header_with_int16 = R"( + OpCapability Shader + OpCapability Linkage + OpCapability Int16 + OpMemoryModel Logical GLSL450 +)"; +string header_with_int64 = R"( + OpCapability Shader + OpCapability Linkage + OpCapability Int64 + OpMemoryModel Logical GLSL450 +)"; +string header_with_float16 = R"( + OpCapability Shader + OpCapability Linkage + OpCapability Float16 + OpMemoryModel Logical GLSL450 +)"; +string header_with_float16_buffer = R"( + OpCapability Shader + OpCapability Linkage + OpCapability Float16Buffer + OpMemoryModel Logical GLSL450 +)"; +string header_with_float64 = R"( + OpCapability Shader + OpCapability Linkage + OpCapability Float64 + OpMemoryModel Logical GLSL450 +)"; + +string invalid_comp_error = "Illegal number of components"; +string missing_cap_error = "requires the Vector16 capability"; +string missing_int8_cap_error = "requires the Int8 capability"; +string missing_int16_cap_error = + "requires the Int16 capability," + " or an extension that explicitly enables 16-bit integers."; +string missing_int64_cap_error = "requires the Int64 capability"; +string missing_float16_cap_error = + "requires the Float16 or Float16Buffer capability," + " or an extension that explicitly enables 16-bit floating point."; +string missing_float64_cap_error = "requires the Float64 capability"; +string invalid_num_bits_error = "Invalid number of bits"; + +TEST_F(ValidateData, vec0) { + string str = header + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 0 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(invalid_comp_error)); +} + +TEST_F(ValidateData, vec1) { + string str = header + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 1 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(invalid_comp_error)); +} + +TEST_F(ValidateData, vec2) { + string str = header + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 2 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, vec3) { + string str = header + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 3 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, vec4) { + string str = header + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 4 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, vec5) { + string str = header + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 5 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(invalid_comp_error)); +} + +TEST_F(ValidateData, vec8) { + string str = header + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 8 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(missing_cap_error)); +} + +TEST_F(ValidateData, vec8_with_capability) { + string str = header_with_vec16_cap + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 8 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, vec16) { + string str = header + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 8 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(missing_cap_error)); +} + +TEST_F(ValidateData, vec16_with_capability) { + string str = header_with_vec16_cap + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 16 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, vec15) { + string str = header + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 15 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(invalid_comp_error)); +} + +TEST_F(ValidateData, int8_good) { + string str = header_with_int8 + "%2 = OpTypeInt 8 0"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, int8_bad) { + string str = header + "%2 = OpTypeInt 8 1"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(missing_int8_cap_error)); +} + +TEST_F(ValidateData, int16_good) { + string str = header_with_int16 + "%2 = OpTypeInt 16 1"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, storage_uniform_buffer_block_16_good) { + string str = HeaderWith( + "StorageUniformBufferBlock16 " + "OpExtension \"SPV_KHR_16bit_storage\"") + + "%2 = OpTypeInt 16 1 %3 = OpTypeFloat 16"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, storage_uniform_16_good) { + string str = + HeaderWith("StorageUniform16 OpExtension \"SPV_KHR_16bit_storage\"") + + "%2 = OpTypeInt 16 1 %3 = OpTypeFloat 16"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, storage_push_constant_16_good) { + string str = HeaderWith( + "StoragePushConstant16 " + "OpExtension \"SPV_KHR_16bit_storage\"") + + "%2 = OpTypeInt 16 1 %3 = OpTypeFloat 16"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, storage_input_output_16_good) { + string str = HeaderWith( + "StorageInputOutput16 " + "OpExtension \"SPV_KHR_16bit_storage\"") + + "%2 = OpTypeInt 16 1 %3 = OpTypeFloat 16"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, int16_bad) { + string str = header + "%2 = OpTypeInt 16 1"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(missing_int16_cap_error)); +} + +TEST_F(ValidateData, int64_good) { + string str = header_with_int64 + "%2 = OpTypeInt 64 1"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, int64_bad) { + string str = header + "%2 = OpTypeInt 64 1"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(missing_int64_cap_error)); +} + +// Number of bits in an integer may be only one of: {8,16,32,64} +TEST_F(ValidateData, int_invalid_num_bits) { + string str = header + "%2 = OpTypeInt 48 1"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(invalid_num_bits_error)); +} + +TEST_F(ValidateData, float16_good) { + string str = header_with_float16 + "%2 = OpTypeFloat 16"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, float16_buffer_good) { + string str = header_with_float16_buffer + "%2 = OpTypeFloat 16"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, float16_bad) { + string str = header + "%2 = OpTypeFloat 16"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(missing_float16_cap_error)); +} + +TEST_F(ValidateData, float64_good) { + string str = header_with_float64 + "%2 = OpTypeFloat 64"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, float64_bad) { + string str = header + "%2 = OpTypeFloat 64"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(missing_float64_cap_error)); +} + +// Number of bits in a float may be only one of: {16,32,64} +TEST_F(ValidateData, float_invalid_num_bits) { + string str = header + "%2 = OpTypeFloat 48"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(invalid_num_bits_error)); +} + +TEST_F(ValidateData, matrix_data_type_float) { + string str = header + R"( +%f32 = OpTypeFloat 32 +%vec3 = OpTypeVector %f32 3 +%mat33 = OpTypeMatrix %vec3 3 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, matrix_bad_column_type) { + string str = header + R"( +%f32 = OpTypeFloat 32 +%mat33 = OpTypeMatrix %f32 3 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Columns in a matrix must be of type vector")); +} + +TEST_F(ValidateData, matrix_data_type_int) { + string str = header + R"( +%int32 = OpTypeInt 32 1 +%vec3 = OpTypeVector %int32 3 +%mat33 = OpTypeMatrix %vec3 3 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("can only be parameterized with floating-point types")); +} + +TEST_F(ValidateData, matrix_data_type_bool) { + string str = header + R"( +%boolt = OpTypeBool +%vec3 = OpTypeVector %boolt 3 +%mat33 = OpTypeMatrix %vec3 3 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("can only be parameterized with floating-point types")); +} + +TEST_F(ValidateData, matrix_with_0_columns) { + string str = header + R"( +%f32 = OpTypeFloat 32 +%vec3 = OpTypeVector %f32 3 +%mat33 = OpTypeMatrix %vec3 0 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("can only be parameterized as having only 2, 3, or 4 columns")); +} + +TEST_F(ValidateData, matrix_with_1_column) { + string str = header + R"( +%f32 = OpTypeFloat 32 +%vec3 = OpTypeVector %f32 3 +%mat33 = OpTypeMatrix %vec3 1 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("can only be parameterized as having only 2, 3, or 4 columns")); +} + +TEST_F(ValidateData, matrix_with_2_columns) { + string str = header + R"( +%f32 = OpTypeFloat 32 +%vec3 = OpTypeVector %f32 3 +%mat33 = OpTypeMatrix %vec3 2 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, matrix_with_3_columns) { + string str = header + R"( +%f32 = OpTypeFloat 32 +%vec3 = OpTypeVector %f32 3 +%mat33 = OpTypeMatrix %vec3 3 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, matrix_with_4_columns) { + string str = header + R"( +%f32 = OpTypeFloat 32 +%vec3 = OpTypeVector %f32 3 +%mat33 = OpTypeMatrix %vec3 4 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, matrix_with_5_column) { + string str = header + R"( +%f32 = OpTypeFloat 32 +%vec3 = OpTypeVector %f32 3 +%mat33 = OpTypeMatrix %vec3 5 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("can only be parameterized as having only 2, 3, or 4 columns")); +} + +TEST_F(ValidateData, specialize_int) { + string str = header + R"( +%i32 = OpTypeInt 32 1 +%len = OpSpecConstant %i32 2)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, specialize_float) { + string str = header + R"( +%f32 = OpTypeFloat 32 +%len = OpSpecConstant %f32 2)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, specialize_boolean) { + string str = header + R"( +%2 = OpTypeBool +%3 = OpSpecConstantTrue %2 +%4 = OpSpecConstantFalse %2)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, specialize_boolean_to_int) { + string str = header + R"( +%2 = OpTypeInt 32 1 +%3 = OpSpecConstantTrue %2 +%4 = OpSpecConstantFalse %2)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Specialization constant must be a boolean")); +} + +TEST_F(ValidateData, missing_forward_pointer_decl) { + string str = header_with_addresses + R"( +%uintt = OpTypeInt 32 0 +%3 = OpTypeStruct %fwd_ptrt %uintt +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("must first be declared using OpTypeForwardPointer")); +} + +TEST_F(ValidateData, forward_pointer_missing_definition) { + string str = header_with_addresses + R"( +OpTypeForwardPointer %_ptr_Generic_struct_A Generic +%uintt = OpTypeInt 32 0 +%struct_B = OpTypeStruct %uintt %_ptr_Generic_struct_A +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("forward referenced IDs have not been defined")); +} + +TEST_F(ValidateData, forward_ref_bad_type) { + string str = header_with_addresses + R"( +OpTypeForwardPointer %_ptr_Generic_struct_A Generic +%uintt = OpTypeInt 32 0 +%struct_B = OpTypeStruct %uintt %_ptr_Generic_struct_A +%_ptr_Generic_struct_A = OpTypeFloat 32 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Found a forward reference to a non-pointer type in " + "OpTypeStruct instruction.")); +} + +TEST_F(ValidateData, forward_ref_points_to_non_struct) { + string str = header_with_addresses + R"( +OpTypeForwardPointer %_ptr_Generic_struct_A Generic +%uintt = OpTypeInt 32 0 +%struct_B = OpTypeStruct %uintt %_ptr_Generic_struct_A +%_ptr_Generic_struct_A = OpTypePointer Generic %uintt +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("A forward reference operand in an OpTypeStruct must " + "be an OpTypePointer that points to an OpTypeStruct. " + "Found OpTypePointer that points to OpTypeInt.")); +} + +TEST_F(ValidateData, struct_forward_pointer_good) { + string str = header_with_addresses + R"( +OpTypeForwardPointer %_ptr_Generic_struct_A Generic +%uintt = OpTypeInt 32 0 +%struct_B = OpTypeStruct %uintt %_ptr_Generic_struct_A +%struct_C = OpTypeStruct %uintt %struct_B +%struct_A = OpTypeStruct %uintt %struct_C +%_ptr_Generic_struct_A = OpTypePointer Generic %struct_C +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateData, ext_16bit_storage_caps_allow_free_fp_rounding_mode) { + for (const char* cap : {"StorageUniform16", "StorageUniformBufferBlock16", + "StoragePushConstant16", "StorageInputOutput16"}) { + for (const char* mode : {"RTE", "RTZ", "RTP", "RTN"}) { + string str = string(R"( + OpCapability Shader + OpCapability Linkage + OpCapability )") + + cap + R"( + OpExtension "SPV_KHR_16bit_storage" + OpMemoryModel Logical GLSL450 + OpDecorate %2 FPRoundingMode )" + + mode + R"( + %1 = OpTypeFloat 32 + %2 = OpConstant %1 1.25 + )"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); + } + } +} + +TEST_F(ValidateData, vulkan_disallow_free_fp_rounding_mode) { + for (const char* mode : {"RTE", "RTZ"}) { + for (const auto env : {SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_1}) { + string str = string(R"( + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpDecorate %2 FPRoundingMode )") + + mode + R"( + %1 = OpTypeFloat 32 + %2 = OpConstant %1 1.25 + )"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_CAPABILITY, ValidateInstructions(env)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Operand 2 of Decorate requires one of these capabilities: " + "StorageBuffer16BitAccess StorageUniform16 " + "StoragePushConstant16 StorageInputOutput16")); + } + } +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_decoration_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_decoration_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_decoration_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_decoration_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,551 @@ +// Copyright (c) 2017 Google 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. + +// Common validation fixtures for unit tests + +#include "gmock/gmock.h" +#include "source/val/decoration.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using ::testing::Eq; +using ::testing::HasSubstr; +using libspirv::Decoration; +using std::string; +using std::vector; + +using ValidateDecorations = spvtest::ValidateBase; + +TEST_F(ValidateDecorations, ValidateOpDecorateRegistration) { + string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpDecorate %1 ArrayStride 4 + OpDecorate %1 Uniform + %2 = OpTypeFloat 32 + %1 = OpTypeRuntimeArray %2 + ; Since %1 is used first in Decoration, it gets id 1. +)"; + const uint32_t id = 1; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); + // Must have 2 decorations. + EXPECT_THAT(vstate_->id_decorations(id), + Eq(vector{Decoration(SpvDecorationArrayStride, {4}), + Decoration(SpvDecorationUniform)})); +} + +TEST_F(ValidateDecorations, ValidateOpMemberDecorateRegistration) { + string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpDecorate %_arr_double_uint_6 ArrayStride 4 + OpMemberDecorate %_struct_115 2 NonReadable + OpMemberDecorate %_struct_115 2 Offset 2 + OpDecorate %_struct_115 BufferBlock + %float = OpTypeFloat 32 + %uint = OpTypeInt 32 0 + %uint_6 = OpConstant %uint 6 + %_arr_double_uint_6 = OpTypeArray %float %uint_6 + %_struct_115 = OpTypeStruct %float %float %_arr_double_uint_6 +)"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); + + // The array must have 1 decoration. + const uint32_t arr_id = 1; + EXPECT_THAT( + vstate_->id_decorations(arr_id), + Eq(vector{Decoration(SpvDecorationArrayStride, {4})})); + + // The struct must have 3 decorations. + const uint32_t struct_id = 2; + EXPECT_THAT(vstate_->id_decorations(struct_id), + Eq(vector{Decoration(SpvDecorationNonReadable, {}, 2), + Decoration(SpvDecorationOffset, {2}, 2), + Decoration(SpvDecorationBufferBlock)})); +} + +TEST_F(ValidateDecorations, ValidateGroupDecorateRegistration) { + string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpDecorate %1 DescriptorSet 0 + OpDecorate %1 NonWritable + OpDecorate %1 Restrict + %1 = OpDecorationGroup + OpGroupDecorate %1 %2 %3 + OpGroupDecorate %1 %4 + %float = OpTypeFloat 32 +%_runtimearr_float = OpTypeRuntimeArray %float + %_struct_9 = OpTypeStruct %_runtimearr_float +%_ptr_Uniform__struct_9 = OpTypePointer Uniform %_struct_9 + %2 = OpVariable %_ptr_Uniform__struct_9 Uniform + %_struct_10 = OpTypeStruct %_runtimearr_float +%_ptr_Uniform__struct_10 = OpTypePointer Uniform %_struct_10 + %3 = OpVariable %_ptr_Uniform__struct_10 Uniform + %_struct_11 = OpTypeStruct %_runtimearr_float +%_ptr_Uniform__struct_11 = OpTypePointer Uniform %_struct_11 + %4 = OpVariable %_ptr_Uniform__struct_11 Uniform + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); + + // Decoration group has 3 decorations. + auto expected_decorations = vector{ + Decoration(SpvDecorationDescriptorSet, {0}), + Decoration(SpvDecorationNonWritable), Decoration(SpvDecorationRestrict)}; + + // Decoration group is applied to id 1, 2, 3, and 4. Note that id 1 (which is + // the decoration group id) also has all the decorations. + EXPECT_THAT(vstate_->id_decorations(1), Eq(expected_decorations)); + EXPECT_THAT(vstate_->id_decorations(2), Eq(expected_decorations)); + EXPECT_THAT(vstate_->id_decorations(3), Eq(expected_decorations)); + EXPECT_THAT(vstate_->id_decorations(4), Eq(expected_decorations)); +} + +TEST_F(ValidateDecorations, ValidateGroupMemberDecorateRegistration) { + string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpDecorate %1 Offset 3 + %1 = OpDecorationGroup + OpGroupMemberDecorate %1 %_struct_1 3 %_struct_2 3 %_struct_3 3 + %float = OpTypeFloat 32 +%_runtimearr = OpTypeRuntimeArray %float + %_struct_1 = OpTypeStruct %float %float %float %_runtimearr + %_struct_2 = OpTypeStruct %float %float %float %_runtimearr + %_struct_3 = OpTypeStruct %float %float %float %_runtimearr + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); + // Decoration group has 1 decoration. + auto expected_decorations = + vector{Decoration(SpvDecorationOffset, {3}, 3)}; + + // Decoration group is applied to id 2, 3, and 4. + EXPECT_THAT(vstate_->id_decorations(2), Eq(expected_decorations)); + EXPECT_THAT(vstate_->id_decorations(3), Eq(expected_decorations)); + EXPECT_THAT(vstate_->id_decorations(4), Eq(expected_decorations)); +} + +TEST_F(ValidateDecorations, LinkageImportUsedForInitializedVariableBad) { + string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpDecorate %target LinkageAttributes "link_ptr" Import + %float = OpTypeFloat 32 + %_ptr_float = OpTypePointer Uniform %float + %zero = OpConstantNull %float + %target = OpVariable %_ptr_float Uniform %zero + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateAndRetrieveValidationState()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("A module-scope OpVariable with initialization value " + "cannot be marked with the Import Linkage Type.")); +} +TEST_F(ValidateDecorations, LinkageExportUsedForInitializedVariableGood) { + string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpDecorate %target LinkageAttributes "link_ptr" Export + %float = OpTypeFloat 32 + %_ptr_float = OpTypePointer Uniform %float + %zero = OpConstantNull %float + %target = OpVariable %_ptr_float Uniform %zero + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); +} + +TEST_F(ValidateDecorations, StructAllMembersHaveBuiltInDecorationsGood) { + string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpMemberDecorate %_struct_1 0 BuiltIn Position + OpMemberDecorate %_struct_1 1 BuiltIn Position + OpMemberDecorate %_struct_1 2 BuiltIn Position + OpMemberDecorate %_struct_1 3 BuiltIn Position + %float = OpTypeFloat 32 +%_runtimearr = OpTypeRuntimeArray %float + %_struct_1 = OpTypeStruct %float %float %float %_runtimearr + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); +} + +TEST_F(ValidateDecorations, MixedBuiltInDecorationsBad) { + string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpMemberDecorate %_struct_1 0 BuiltIn Position + OpMemberDecorate %_struct_1 1 BuiltIn Position + %float = OpTypeFloat 32 +%_runtimearr = OpTypeRuntimeArray %float + %_struct_1 = OpTypeStruct %float %float %float %_runtimearr + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateAndRetrieveValidationState()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("When BuiltIn decoration is applied to a structure-type " + "member, all members of that structure type must also be " + "decorated with BuiltIn (No allowed mixing of built-in " + "variables and non-built-in variables within a single " + "structure). Structure id 1 does not meet this requirement.")); +} + +TEST_F(ValidateDecorations, StructContainsBuiltInStructBad) { + string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpMemberDecorate %_struct_1 0 BuiltIn Position + OpMemberDecorate %_struct_1 1 BuiltIn Position + OpMemberDecorate %_struct_1 2 BuiltIn Position + OpMemberDecorate %_struct_1 3 BuiltIn Position + %float = OpTypeFloat 32 +%_runtimearr = OpTypeRuntimeArray %float + %_struct_1 = OpTypeStruct %float %float %float %_runtimearr + %_struct_2 = OpTypeStruct %_struct_1 + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateAndRetrieveValidationState()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Structure 1 contains members with BuiltIn " + "decoration. Therefore this structure may not be " + "contained as a member of another structure type. " + "Structure 4 contains structure 1.")); +} + +TEST_F(ValidateDecorations, StructContainsNonBuiltInStructGood) { + string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + %float = OpTypeFloat 32 + %_struct_1 = OpTypeStruct %float + %_struct_2 = OpTypeStruct %_struct_1 + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); +} + +TEST_F(ValidateDecorations, MultipleBuiltInObjectsConsumedByOpEntryPointBad) { + string spirv = R"( + OpCapability Shader + OpCapability Geometry + OpMemoryModel Logical GLSL450 + OpEntryPoint Geometry %main "main" %in_1 %in_2 + OpMemberDecorate %struct_1 0 BuiltIn InvocationId + OpMemberDecorate %struct_2 0 BuiltIn Position + %int = OpTypeInt 32 1 + %void = OpTypeVoid + %func = OpTypeFunction %void + %float = OpTypeFloat 32 + %struct_1 = OpTypeStruct %int + %struct_2 = OpTypeStruct %float +%ptr_builtin_1 = OpTypePointer Input %struct_1 +%ptr_builtin_2 = OpTypePointer Input %struct_2 +%in_1 = OpVariable %ptr_builtin_1 Input +%in_2 = OpVariable %ptr_builtin_2 Input + %main = OpFunction %void None %func + %5 = OpLabel + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateAndRetrieveValidationState()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("There must be at most one object per Storage Class " + "that can contain a structure type containing members " + "decorated with BuiltIn, consumed per entry-point.")); +} + +TEST_F(ValidateDecorations, + OneBuiltInObjectPerStorageClassConsumedByOpEntryPointGood) { + string spirv = R"( + OpCapability Shader + OpCapability Geometry + OpMemoryModel Logical GLSL450 + OpEntryPoint Geometry %main "main" %in_1 %out_1 + OpMemberDecorate %struct_1 0 BuiltIn InvocationId + OpMemberDecorate %struct_2 0 BuiltIn Position + %int = OpTypeInt 32 1 + %void = OpTypeVoid + %func = OpTypeFunction %void + %float = OpTypeFloat 32 + %struct_1 = OpTypeStruct %int + %struct_2 = OpTypeStruct %float +%ptr_builtin_1 = OpTypePointer Input %struct_1 +%ptr_builtin_2 = OpTypePointer Output %struct_2 +%in_1 = OpVariable %ptr_builtin_1 Input +%out_1 = OpVariable %ptr_builtin_2 Output + %main = OpFunction %void None %func + %5 = OpLabel + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); +} + +TEST_F(ValidateDecorations, NoBuiltInObjectsConsumedByOpEntryPointGood) { + string spirv = R"( + OpCapability Shader + OpCapability Geometry + OpMemoryModel Logical GLSL450 + OpEntryPoint Geometry %main "main" %in_1 %out_1 + %int = OpTypeInt 32 1 + %void = OpTypeVoid + %func = OpTypeFunction %void + %float = OpTypeFloat 32 + %struct_1 = OpTypeStruct %int + %struct_2 = OpTypeStruct %float +%ptr_builtin_1 = OpTypePointer Input %struct_1 +%ptr_builtin_2 = OpTypePointer Output %struct_2 +%in_1 = OpVariable %ptr_builtin_1 Input +%out_1 = OpVariable %ptr_builtin_2 Output + %main = OpFunction %void None %func + %5 = OpLabel + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); +} + +TEST_F(ValidateDecorations, EntryPointFunctionHasLinkageAttributeBad) { + string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %main "main" + OpDecorate %main LinkageAttributes "import_main" Import +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%main = OpFunction %1 None %2 +%4 = OpLabel + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("The LinkageAttributes Decoration (Linkage name: import_main) " + "cannot be applied to function id 1 because it is targeted by " + "an OpEntryPoint instruction.")); +} + +TEST_F(ValidateDecorations, FunctionDeclarationWithoutImportLinkageBad) { + string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + %void = OpTypeVoid + %func = OpTypeFunction %void + %main = OpFunction %void None %func + OpFunctionEnd + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateAndRetrieveValidationState()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Function declaration (id 3) must have a LinkageAttributes " + "decoration with the Import Linkage type.")); +} + +TEST_F(ValidateDecorations, FunctionDeclarationWithImportLinkageGood) { + string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpDecorate %main LinkageAttributes "link_fn" Import + %void = OpTypeVoid + %func = OpTypeFunction %void + %main = OpFunction %void None %func + OpFunctionEnd + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); +} + +TEST_F(ValidateDecorations, FunctionDeclarationWithExportLinkageBad) { + string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpDecorate %main LinkageAttributes "link_fn" Export + %void = OpTypeVoid + %func = OpTypeFunction %void + %main = OpFunction %void None %func + OpFunctionEnd + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateAndRetrieveValidationState()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Function declaration (id 1) must have a LinkageAttributes " + "decoration with the Import Linkage type.")); +} + +TEST_F(ValidateDecorations, FunctionDefinitionWithImportLinkageBad) { + string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpDecorate %main LinkageAttributes "link_fn" Import + %void = OpTypeVoid + %func = OpTypeFunction %void + %main = OpFunction %void None %func + %label = OpLabel + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateAndRetrieveValidationState()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Function definition (id 1) may not be decorated with " + "Import Linkage type.")); +} + +TEST_F(ValidateDecorations, FunctionDefinitionWithoutImportLinkageGood) { + string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + %void = OpTypeVoid + %func = OpTypeFunction %void + %main = OpFunction %void None %func + %label = OpLabel + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); +} + +TEST_F(ValidateDecorations, BuiltinVariablesGoodVulkan) { + const spv_target_env env = SPV_ENV_VULKAN_1_0; + std::string spirv = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %gl_FragCoord %_entryPointOutput +OpExecutionMode %main OriginUpperLeft +OpSource HLSL 500 +OpDecorate %gl_FragCoord BuiltIn FragCoord +OpDecorate %_entryPointOutput Location 0 +%void = OpTypeVoid +%3 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%float_0 = OpConstant %float 0 +%14 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%gl_FragCoord = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_entryPointOutput = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %3 +%5 = OpLabel +OpStore %_entryPointOutput %14 +OpReturn +OpFunctionEnd +)"; + + CompileSuccessfully(spirv, env); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState(env)); +} + +TEST_F(ValidateDecorations, BuiltinVariablesWithLocationDecorationVulkan) { + const spv_target_env env = SPV_ENV_VULKAN_1_0; + std::string spirv = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %gl_FragCoord %_entryPointOutput +OpExecutionMode %main OriginUpperLeft +OpSource HLSL 500 +OpDecorate %gl_FragCoord BuiltIn FragCoord +OpDecorate %gl_FragCoord Location 0 +OpDecorate %_entryPointOutput Location 0 +%void = OpTypeVoid +%3 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%float_0 = OpConstant %float 0 +%14 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%gl_FragCoord = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_entryPointOutput = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %3 +%5 = OpLabel +OpStore %_entryPointOutput %14 +OpReturn +OpFunctionEnd +)"; + + CompileSuccessfully(spirv, env); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateAndRetrieveValidationState(env)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("A BuiltIn variable (id 2) cannot have any Location or " + "Component decorations")); +} +TEST_F(ValidateDecorations, BuiltinVariablesWithComponentDecorationVulkan) { + const spv_target_env env = SPV_ENV_VULKAN_1_0; + std::string spirv = R"( +OpCapability Shader +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" %gl_FragCoord %_entryPointOutput +OpExecutionMode %main OriginUpperLeft +OpSource HLSL 500 +OpDecorate %gl_FragCoord BuiltIn FragCoord +OpDecorate %gl_FragCoord Component 0 +OpDecorate %_entryPointOutput Location 0 +%void = OpTypeVoid +%3 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v4float = OpTypeVector %float 4 +%float_0 = OpConstant %float 0 +%14 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%_ptr_Input_v4float = OpTypePointer Input %v4float +%gl_FragCoord = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_entryPointOutput = OpVariable %_ptr_Output_v4float Output +%main = OpFunction %void None %3 +%5 = OpLabel +OpStore %_entryPointOutput %14 +OpReturn +OpFunctionEnd +)"; + + CompileSuccessfully(spirv, env); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateAndRetrieveValidationState(env)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("A BuiltIn variable (id 2) cannot have any Location or " + "Component decorations")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_derivatives_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_derivatives_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_derivatives_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_derivatives_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,148 @@ +// Copyright (c) 2017 Google 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. + +#include +#include + +#include "gmock/gmock.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using ::testing::HasSubstr; +using ::testing::Not; + +using ValidateDerivatives = spvtest::ValidateBase; + +std::string GenerateShaderCode( + const std::string& body, + const std::string& capabilities_and_extensions = "", + const std::string& execution_model = "Fragment") { + std::stringstream ss; + ss << R"( +OpCapability Shader +OpCapability DerivativeControl +)"; + + ss << capabilities_and_extensions; + ss << "OpMemoryModel Logical GLSL450\n"; + ss << "OpEntryPoint " << execution_model << " %main \"main\"\n"; + + ss << R"( +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f32 = OpTypeFloat 32 +%u32 = OpTypeInt 32 0 +%s32 = OpTypeInt 32 1 +%f32vec4 = OpTypeVector %f32 4 + +%f32_ptr_input = OpTypePointer Input %f32 +%f32_var_input = OpVariable %f32_ptr_input Input + +%f32vec4_ptr_input = OpTypePointer Input %f32vec4 +%f32vec4_var_input = OpVariable %f32vec4_ptr_input Input + +%main = OpFunction %void None %func +%main_entry = OpLabel +)"; + + ss << body; + + ss << R"( +OpReturn +OpFunctionEnd)"; + + return ss.str(); +} + +TEST_F(ValidateDerivatives, ScalarSuccess) { + const std::string body = R"( +%f32_var = OpLoad %f32 %f32_var_input +%val1 = OpDPdx %f32 %f32_var +%val2 = OpDPdy %f32 %f32_var +%val3 = OpFwidth %f32 %f32_var +%val4 = OpDPdxFine %f32 %f32_var +%val5 = OpDPdyFine %f32 %f32_var +%val6 = OpFwidthFine %f32 %f32_var +%val7 = OpDPdxCoarse %f32 %f32_var +%val8 = OpDPdyCoarse %f32 %f32_var +%val9 = OpFwidthCoarse %f32 %f32_var +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateDerivatives, VectorSuccess) { + const std::string body = R"( +%f32vec4_var = OpLoad %f32vec4 %f32vec4_var_input +%val1 = OpDPdx %f32vec4 %f32vec4_var +%val2 = OpDPdy %f32vec4 %f32vec4_var +%val3 = OpFwidth %f32vec4 %f32vec4_var +%val4 = OpDPdxFine %f32vec4 %f32vec4_var +%val5 = OpDPdyFine %f32vec4 %f32vec4_var +%val6 = OpFwidthFine %f32vec4 %f32vec4_var +%val7 = OpDPdxCoarse %f32vec4 %f32vec4_var +%val8 = OpDPdyCoarse %f32vec4 %f32vec4_var +%val9 = OpFwidthCoarse %f32vec4 %f32vec4_var +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateDerivatives, OpDPdxWrongResultType) { + const std::string body = R"( +%f32_var = OpLoad %f32 %f32_var_input +%val1 = OpDPdx %u32 %f32vec4 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Result Type to be float scalar or vector type: " + "DPdx")); +} + +TEST_F(ValidateDerivatives, OpDPdxWrongPType) { + const std::string body = R"( +%f32vec4_var = OpLoad %f32vec4 %f32vec4_var_input +%val1 = OpDPdx %f32 %f32vec4_var +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected P type and Result Type to be the same: " + "DPdx")); +} + +TEST_F(ValidateDerivatives, OpDPdxWrongExecutionModel) { + const std::string body = R"( +%f32vec4_var = OpLoad %f32vec4 %f32vec4_var_input +%val1 = OpDPdx %f32vec4 %f32vec4_var +)"; + + CompileSuccessfully(GenerateShaderCode(body, "", "Vertex").c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Derivative instructions require Fragment execution model: DPdx")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_extensions_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_extensions_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_extensions_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_extensions_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,319 @@ +// Copyright (c) 2017 Google 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. + +// Tests for OpExtension validator rules. + +#include + +#include "enum_string_mapping.h" +#include "extensions.h" +#include "gmock/gmock.h" +#include "spirv_target_env.h" +#include "test_fixture.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using ::libspirv::Extension; + +using ::testing::HasSubstr; +using ::testing::Not; +using ::testing::Values; +using ::testing::ValuesIn; + +using std::string; + +using ValidateKnownExtensions = spvtest::ValidateBase; +using ValidateUnknownExtensions = spvtest::ValidateBase; +using ValidateExtensionCapabilities = spvtest::ValidateBase; + +// Returns expected error string if |extension| is not recognized. +string GetErrorString(const std::string& extension) { + return "Found unrecognized extension " + extension; +} + +INSTANTIATE_TEST_CASE_P( + ExpectSuccess, ValidateKnownExtensions, + Values( + // Match the order as published on the SPIR-V Registry. + "SPV_AMD_shader_explicit_vertex_parameter", + "SPV_AMD_shader_trinary_minmax", "SPV_AMD_gcn_shader", + "SPV_KHR_shader_ballot", "SPV_AMD_shader_ballot", + "SPV_AMD_gpu_shader_half_float", "SPV_KHR_shader_draw_parameters", + "SPV_KHR_subgroup_vote", "SPV_KHR_16bit_storage", + "SPV_KHR_device_group", "SPV_KHR_multiview", + "SPV_NVX_multiview_per_view_attributes", "SPV_NV_viewport_array2", + "SPV_NV_stereo_view_rendering", "SPV_NV_sample_mask_override_coverage", + "SPV_NV_geometry_shader_passthrough", "SPV_AMD_texture_gather_bias_lod", + "SPV_KHR_storage_buffer_storage_class", "SPV_KHR_variable_pointers", + "SPV_AMD_gpu_shader_int16", "SPV_KHR_post_depth_coverage", + "SPV_KHR_shader_atomic_counter_ops", "SPV_EXT_shader_stencil_export", + "SPV_EXT_shader_viewport_index_layer", + "SPV_AMD_shader_image_load_store_lod", "SPV_AMD_shader_fragment_mask", + "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1", + "SPV_NV_shader_subgroup_partitioned", "SPV_EXT_descriptor_indexing")); + +INSTANTIATE_TEST_CASE_P(FailSilently, ValidateUnknownExtensions, + Values("ERROR_unknown_extension", "SPV_KHR_", + "SPV_KHR_shader_ballot_ERROR")); + +TEST_P(ValidateKnownExtensions, ExpectSuccess) { + const std::string extension = GetParam(); + const string str = + "OpCapability Shader\nOpCapability Linkage\nOpExtension \"" + extension + + "\"\nOpMemoryModel Logical GLSL450"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), Not(HasSubstr(GetErrorString(extension)))); +} + +TEST_P(ValidateUnknownExtensions, FailSilently) { + const std::string extension = GetParam(); + const string str = + "OpCapability Shader\nOpCapability Linkage\nOpExtension \"" + extension + + "\"\nOpMemoryModel Logical GLSL450"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(extension))); +} + +TEST_F(ValidateExtensionCapabilities, DeclCapabilitySuccess) { + const string str = + "OpCapability Shader\nOpCapability Linkage\nOpCapability DeviceGroup\n" + "OpExtension \"SPV_KHR_device_group\"" + "\nOpMemoryModel Logical GLSL450"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtensionCapabilities, DeclCapabilityFailure) { + const string str = + "OpCapability Shader\nOpCapability Linkage\nOpCapability DeviceGroup\n" + "\nOpMemoryModel Logical GLSL450"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_ERROR_MISSING_EXTENSION, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("1st operand of Capability")); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("requires one of these extensions")); + EXPECT_THAT(getDiagnosticString(), HasSubstr("SPV_KHR_device_group")); +} + +using ValidateAMDShaderBallotCapabilities = spvtest::ValidateBase; + +// Returns a vector of strings for the prefix of a SPIR-V assembly shader +// that can use the group instructions introduced by SPV_AMD_shader_ballot. +std::vector ShaderPartsForAMDShaderBallot() { + return std::vector{R"( + OpCapability Shader + OpCapability Linkage + )", + R"( + OpMemoryModel Logical GLSL450 + %float = OpTypeFloat 32 + %uint = OpTypeInt 32 0 + %int = OpTypeInt 32 1 + %scope = OpConstant %uint 3 + %uint_const = OpConstant %uint 42 + %int_const = OpConstant %uint 45 + %float_const = OpConstant %float 3.5 + + %void = OpTypeVoid + %fn_ty = OpTypeFunction %void + %fn = OpFunction %void None %fn_ty + %entry = OpLabel + )"}; +} + +// Returns a list of SPIR-V assembly strings, where each uses only types +// and IDs that can fit with a shader made from parts from the result +// of ShaderPartsForAMDShaderBallot. +std::vector AMDShaderBallotGroupInstructions() { + return std::vector{ + "%iadd_reduce = OpGroupIAddNonUniformAMD %uint %scope Reduce %uint_const", + "%iadd_iscan = OpGroupIAddNonUniformAMD %uint %scope InclusiveScan " + "%uint_const", + "%iadd_escan = OpGroupIAddNonUniformAMD %uint %scope ExclusiveScan " + "%uint_const", + + "%fadd_reduce = OpGroupFAddNonUniformAMD %float %scope Reduce " + "%float_const", + "%fadd_iscan = OpGroupFAddNonUniformAMD %float %scope InclusiveScan " + "%float_const", + "%fadd_escan = OpGroupFAddNonUniformAMD %float %scope ExclusiveScan " + "%float_const", + + "%fmin_reduce = OpGroupFMinNonUniformAMD %float %scope Reduce " + "%float_const", + "%fmin_iscan = OpGroupFMinNonUniformAMD %float %scope InclusiveScan " + "%float_const", + "%fmin_escan = OpGroupFMinNonUniformAMD %float %scope ExclusiveScan " + "%float_const", + + "%umin_reduce = OpGroupUMinNonUniformAMD %uint %scope Reduce %uint_const", + "%umin_iscan = OpGroupUMinNonUniformAMD %uint %scope InclusiveScan " + "%uint_const", + "%umin_escan = OpGroupUMinNonUniformAMD %uint %scope ExclusiveScan " + "%uint_const", + + "%smin_reduce = OpGroupUMinNonUniformAMD %int %scope Reduce %int_const", + "%smin_iscan = OpGroupUMinNonUniformAMD %int %scope InclusiveScan " + "%int_const", + "%smin_escan = OpGroupUMinNonUniformAMD %int %scope ExclusiveScan " + "%int_const", + + "%fmax_reduce = OpGroupFMaxNonUniformAMD %float %scope Reduce " + "%float_const", + "%fmax_iscan = OpGroupFMaxNonUniformAMD %float %scope InclusiveScan " + "%float_const", + "%fmax_escan = OpGroupFMaxNonUniformAMD %float %scope ExclusiveScan " + "%float_const", + + "%umax_reduce = OpGroupUMaxNonUniformAMD %uint %scope Reduce %uint_const", + "%umax_iscan = OpGroupUMaxNonUniformAMD %uint %scope InclusiveScan " + "%uint_const", + "%umax_escan = OpGroupUMaxNonUniformAMD %uint %scope ExclusiveScan " + "%uint_const", + + "%smax_reduce = OpGroupUMaxNonUniformAMD %int %scope Reduce %int_const", + "%smax_iscan = OpGroupUMaxNonUniformAMD %int %scope InclusiveScan " + "%int_const", + "%smax_escan = OpGroupUMaxNonUniformAMD %int %scope ExclusiveScan " + "%int_const"}; +} + +TEST_P(ValidateAMDShaderBallotCapabilities, ExpectSuccess) { + // Succeed because the module specifies the SPV_AMD_shader_ballot extension. + auto parts = ShaderPartsForAMDShaderBallot(); + + const string assembly = parts[0] + "OpExtension \"SPV_AMD_shader_ballot\"\n" + + parts[1] + GetParam() + "\nOpReturn OpFunctionEnd"; + + CompileSuccessfully(assembly.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); +} + +INSTANTIATE_TEST_CASE_P(ExpectSuccess, ValidateAMDShaderBallotCapabilities, + ValuesIn(AMDShaderBallotGroupInstructions())); + +TEST_P(ValidateAMDShaderBallotCapabilities, ExpectFailure) { + // Fail because the module does not specify the SPV_AMD_shader_ballot + // extension. + auto parts = ShaderPartsForAMDShaderBallot(); + + const string assembly = + parts[0] + parts[1] + GetParam() + "\nOpReturn OpFunctionEnd"; + + CompileSuccessfully(assembly.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, ValidateInstructions()); + + // Make sure we get an appropriate error message. + // Find just the opcode name, skipping over the "Op" part. + auto prefix_with_opcode = GetParam().substr(GetParam().find("Group")); + auto opcode = prefix_with_opcode.substr(0, prefix_with_opcode.find(' ')); + EXPECT_THAT(getDiagnosticString(), + HasSubstr(string("Opcode " + opcode + + " requires one of these capabilities: Groups"))); +} + +INSTANTIATE_TEST_CASE_P(ExpectFailure, ValidateAMDShaderBallotCapabilities, + ValuesIn(AMDShaderBallotGroupInstructions())); + +struct ExtIntoCoreCase { + const char* ext; + const char* cap; + const char* builtin; + spv_target_env env; + bool success; +}; + +using ValidateExtIntoCore = spvtest::ValidateBase; + +// Make sure that we don't panic about missing extensions for using +// functionalities that introduced in extensions but became core SPIR-V later. + +TEST_P(ValidateExtIntoCore, DoNotAskForExtensionInLaterVersion) { + const string code = string(R"( + OpCapability Shader + OpCapability )") + + GetParam().cap + R"( + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" %builtin + OpDecorate %builtin BuiltIn )" + GetParam().builtin + R"( + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int + %builtin = OpVariable %_ptr_Input_int Input + %main = OpFunction %void None %3 + %5 = OpLabel + %18 = OpLoad %int %builtin + OpReturn + OpFunctionEnd)"; + + CompileSuccessfully(code.c_str(), GetParam().env); + if (GetParam().success) { + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(GetParam().env)); + } else { + ASSERT_NE(SPV_SUCCESS, ValidateInstructions(GetParam().env)); + const string message = getDiagnosticString(); + if (spvIsVulkanEnv(GetParam().env)) { + EXPECT_THAT(message, HasSubstr(string(GetParam().cap) + + " is not allowed by Vulkan")); + EXPECT_THAT(message, HasSubstr(string("or requires extension"))); + } else { + EXPECT_THAT(message, + HasSubstr(string("requires one of these extensions: ") + + GetParam().ext)); + } + } +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + KHR_extensions, ValidateExtIntoCore, + ValuesIn(std::vector{ + // SPV_KHR_shader_draw_parameters became core SPIR-V 1.3 + {"SPV_KHR_shader_draw_parameters", "DrawParameters", "BaseVertex", SPV_ENV_UNIVERSAL_1_3, true}, + {"SPV_KHR_shader_draw_parameters", "DrawParameters", "BaseVertex", SPV_ENV_UNIVERSAL_1_2, false}, + {"SPV_KHR_shader_draw_parameters", "DrawParameters", "BaseVertex", SPV_ENV_UNIVERSAL_1_1, false}, + {"SPV_KHR_shader_draw_parameters", "DrawParameters", "BaseVertex", SPV_ENV_UNIVERSAL_1_0, false}, + {"SPV_KHR_shader_draw_parameters", "DrawParameters", "BaseVertex", SPV_ENV_VULKAN_1_1, true}, + {"SPV_KHR_shader_draw_parameters", "DrawParameters", "BaseVertex", SPV_ENV_VULKAN_1_0, false}, + + {"SPV_KHR_shader_draw_parameters", "DrawParameters", "BaseInstance", SPV_ENV_UNIVERSAL_1_3, true}, + {"SPV_KHR_shader_draw_parameters", "DrawParameters", "BaseInstance", SPV_ENV_VULKAN_1_0, false}, + + {"SPV_KHR_shader_draw_parameters", "DrawParameters", "DrawIndex", SPV_ENV_UNIVERSAL_1_3, true}, + {"SPV_KHR_shader_draw_parameters", "DrawParameters", "DrawIndex", SPV_ENV_UNIVERSAL_1_1, false}, + + // SPV_KHR_multiview became core SPIR-V 1.3 + {"SPV_KHR_multiview", "MultiView", "ViewIndex", SPV_ENV_UNIVERSAL_1_3, true}, + {"SPV_KHR_multiview", "MultiView", "ViewIndex", SPV_ENV_UNIVERSAL_1_2, false}, + {"SPV_KHR_multiview", "MultiView", "ViewIndex", SPV_ENV_UNIVERSAL_1_1, false}, + {"SPV_KHR_multiview", "MultiView", "ViewIndex", SPV_ENV_UNIVERSAL_1_0, false}, + {"SPV_KHR_multiview", "MultiView", "ViewIndex", SPV_ENV_VULKAN_1_1, true}, + {"SPV_KHR_multiview", "MultiView", "ViewIndex", SPV_ENV_VULKAN_1_0, false}, + + // SPV_KHR_device_group became core SPIR-V 1.3 + {"SPV_KHR_device_group", "DeviceGroup", "DeviceIndex", SPV_ENV_UNIVERSAL_1_3, true}, + {"SPV_KHR_device_group", "DeviceGroup", "DeviceIndex", SPV_ENV_UNIVERSAL_1_2, false}, + {"SPV_KHR_device_group", "DeviceGroup", "DeviceIndex", SPV_ENV_UNIVERSAL_1_1, false}, + {"SPV_KHR_device_group", "DeviceGroup", "DeviceIndex", SPV_ENV_UNIVERSAL_1_0, false}, + {"SPV_KHR_device_group", "DeviceGroup", "DeviceIndex", SPV_ENV_VULKAN_1_1, true}, + {"SPV_KHR_device_group", "DeviceGroup", "DeviceIndex", SPV_ENV_VULKAN_1_0, false}, + })); +// clang-format on + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_ext_inst_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_ext_inst_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_ext_inst_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_ext_inst_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,5761 @@ +// Copyright (c) 2017 Google 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. + +// Tests validation rules of GLSL.450.std and OpenCL.std extended instructions. +// Doesn't test OpenCL.std vector size 2, 3, 4, 8 or 16 rules (not supported +// by standard SPIR-V). + +#include +#include + +#include "gmock/gmock.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using ::testing::HasSubstr; +using ::testing::Not; + +using ValidateExtInst = spvtest::ValidateBase; +using ValidateGlslStd450SqrtLike = spvtest::ValidateBase; +using ValidateGlslStd450FMinLike = spvtest::ValidateBase; +using ValidateGlslStd450FClampLike = spvtest::ValidateBase; +using ValidateGlslStd450SAbsLike = spvtest::ValidateBase; +using ValidateGlslStd450UMinLike = spvtest::ValidateBase; +using ValidateGlslStd450UClampLike = spvtest::ValidateBase; +using ValidateGlslStd450SinLike = spvtest::ValidateBase; +using ValidateGlslStd450PowLike = spvtest::ValidateBase; +using ValidateGlslStd450Pack = spvtest::ValidateBase; +using ValidateGlslStd450Unpack = spvtest::ValidateBase; +using ValidateOpenCLStdSqrtLike = spvtest::ValidateBase; +using ValidateOpenCLStdFMinLike = spvtest::ValidateBase; +using ValidateOpenCLStdFClampLike = spvtest::ValidateBase; +using ValidateOpenCLStdSAbsLike = spvtest::ValidateBase; +using ValidateOpenCLStdUMinLike = spvtest::ValidateBase; +using ValidateOpenCLStdUClampLike = spvtest::ValidateBase; +using ValidateOpenCLStdUMul24Like = spvtest::ValidateBase; +using ValidateOpenCLStdUMad24Like = spvtest::ValidateBase; +using ValidateOpenCLStdLengthLike = spvtest::ValidateBase; +using ValidateOpenCLStdDistanceLike = spvtest::ValidateBase; +using ValidateOpenCLStdNormalizeLike = spvtest::ValidateBase; +using ValidateOpenCLStdVStoreHalfLike = spvtest::ValidateBase; +using ValidateOpenCLStdVLoadHalfLike = spvtest::ValidateBase; +using ValidateOpenCLStdFractLike = spvtest::ValidateBase; +using ValidateOpenCLStdFrexpLike = spvtest::ValidateBase; +using ValidateOpenCLStdLdexpLike = spvtest::ValidateBase; +using ValidateOpenCLStdUpsampleLike = spvtest::ValidateBase; + +// Returns number of components in Pack/Unpack extended instructions. +// |ext_inst_name| is expected to be of the format "PackHalf2x16". +// Number of components is assumed to be single-digit. +uint32_t GetPackedNumComponents(const std::string& ext_inst_name) { + const size_t x_index = ext_inst_name.find_last_of('x'); + const std::string num_components_str = + ext_inst_name.substr(x_index - 1, x_index); + return uint32_t(std::stoul(num_components_str)); +} + +// Returns packed bit width in Pack/Unpack extended instructions. +// |ext_inst_name| is expected to be of the format "PackHalf2x16". +uint32_t GetPackedBitWidth(const std::string& ext_inst_name) { + const size_t x_index = ext_inst_name.find_last_of('x'); + const std::string packed_bit_width_str = ext_inst_name.substr(x_index + 1); + return uint32_t(std::stoul(packed_bit_width_str)); +} + +std::string GenerateShaderCode( + const std::string& body, + const std::string& capabilities_and_extensions = "", + const std::string& execution_model = "Fragment") { + std::ostringstream ss; + ss << R"( +OpCapability Shader +OpCapability Float16 +OpCapability Float64 +OpCapability Int16 +OpCapability Int64 +)"; + + ss << capabilities_and_extensions; + ss << "%extinst = OpExtInstImport \"GLSL.std.450\"\n"; + ss << "OpMemoryModel Logical GLSL450\n"; + ss << "OpEntryPoint " << execution_model << " %main \"main\"\n"; + + ss << R"( +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f16 = OpTypeFloat 16 +%f32 = OpTypeFloat 32 +%f64 = OpTypeFloat 64 +%u32 = OpTypeInt 32 0 +%s32 = OpTypeInt 32 1 +%u64 = OpTypeInt 64 0 +%s64 = OpTypeInt 64 1 +%u16 = OpTypeInt 16 0 +%s16 = OpTypeInt 16 1 +%f32vec2 = OpTypeVector %f32 2 +%f32vec3 = OpTypeVector %f32 3 +%f32vec4 = OpTypeVector %f32 4 +%f64vec2 = OpTypeVector %f64 2 +%f64vec3 = OpTypeVector %f64 3 +%f64vec4 = OpTypeVector %f64 4 +%u32vec2 = OpTypeVector %u32 2 +%u32vec3 = OpTypeVector %u32 3 +%s32vec2 = OpTypeVector %s32 2 +%u32vec4 = OpTypeVector %u32 4 +%s32vec4 = OpTypeVector %s32 4 +%u64vec2 = OpTypeVector %u64 2 +%s64vec2 = OpTypeVector %s64 2 +%f64mat22 = OpTypeMatrix %f64vec2 2 +%f32mat22 = OpTypeMatrix %f32vec2 2 +%f32mat23 = OpTypeMatrix %f32vec2 3 +%f32mat32 = OpTypeMatrix %f32vec3 2 +%f32mat33 = OpTypeMatrix %f32vec3 3 + +%f32_0 = OpConstant %f32 0 +%f32_1 = OpConstant %f32 1 +%f32_2 = OpConstant %f32 2 +%f32_3 = OpConstant %f32 3 +%f32_4 = OpConstant %f32 4 +%f32_h = OpConstant %f32 0.5 +%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 +%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 +%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 +%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 +%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 +%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 + +%f64_0 = OpConstant %f64 0 +%f64_1 = OpConstant %f64 1 +%f64_2 = OpConstant %f64 2 +%f64_3 = OpConstant %f64 3 +%f64vec2_01 = OpConstantComposite %f64vec2 %f64_0 %f64_1 +%f64vec3_012 = OpConstantComposite %f64vec3 %f64_0 %f64_1 %f64_2 +%f64vec4_0123 = OpConstantComposite %f64vec4 %f64_0 %f64_1 %f64_2 %f64_3 + +%f16_0 = OpConstant %f16 0 +%f16_1 = OpConstant %f16 1 + +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u32_2 = OpConstant %u32 2 +%u32_3 = OpConstant %u32 3 + +%s32_0 = OpConstant %s32 0 +%s32_1 = OpConstant %s32 1 +%s32_2 = OpConstant %s32 2 +%s32_3 = OpConstant %s32 3 + +%u64_0 = OpConstant %u64 0 +%u64_1 = OpConstant %u64 1 +%u64_2 = OpConstant %u64 2 +%u64_3 = OpConstant %u64 3 + +%s64_0 = OpConstant %s64 0 +%s64_1 = OpConstant %s64 1 +%s64_2 = OpConstant %s64 2 +%s64_3 = OpConstant %s64 3 + +%s32vec2_01 = OpConstantComposite %s32vec2 %s32_0 %s32_1 +%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 + +%s32vec2_12 = OpConstantComposite %s32vec2 %s32_1 %s32_2 +%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 + +%s32vec4_0123 = OpConstantComposite %s32vec4 %s32_0 %s32_1 %s32_2 %s32_3 +%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 + +%s64vec2_01 = OpConstantComposite %s64vec2 %s64_0 %s64_1 +%u64vec2_01 = OpConstantComposite %u64vec2 %u64_0 %u64_1 + +%f32mat22_1212 = OpConstantComposite %f32mat22 %f32vec2_12 %f32vec2_12 +%f32mat23_121212 = OpConstantComposite %f32mat23 %f32vec2_12 %f32vec2_12 %f32vec2_12 + +%f32_ptr_output = OpTypePointer Output %f32 +%f32vec2_ptr_output = OpTypePointer Output %f32vec2 + +%u32_ptr_output = OpTypePointer Output %u32 +%u32vec2_ptr_output = OpTypePointer Output %u32vec2 + +%u64_ptr_output = OpTypePointer Output %u64 + +%f32_output = OpVariable %f32_ptr_output Output +%f32vec2_output = OpVariable %f32vec2_ptr_output Output + +%u32_output = OpVariable %u32_ptr_output Output +%u32vec2_output = OpVariable %u32vec2_ptr_output Output + +%u64_output = OpVariable %u64_ptr_output Output + +%f32_ptr_input = OpTypePointer Input %f32 +%f32vec2_ptr_input = OpTypePointer Input %f32vec2 + +%u32_ptr_input = OpTypePointer Input %u32 +%u32vec2_ptr_input = OpTypePointer Input %u32vec2 + +%u64_ptr_input = OpTypePointer Input %u64 + +%f32_input = OpVariable %f32_ptr_input Input +%f32vec2_input = OpVariable %f32vec2_ptr_input Input + +%u32_input = OpVariable %u32_ptr_input Input +%u32vec2_input = OpVariable %u32vec2_ptr_input Input + +%u64_input = OpVariable %u64_ptr_input Input + +%struct_f32_f32 = OpTypeStruct %f32 %f32 +%struct_f32_f32_f32 = OpTypeStruct %f32 %f32 %f32 +%struct_f32_u32 = OpTypeStruct %f32 %u32 +%struct_f32_u32_f32 = OpTypeStruct %f32 %u32 %f32 +%struct_u32_f32 = OpTypeStruct %u32 %f32 +%struct_u32_u32 = OpTypeStruct %u32 %u32 +%struct_f32_f64 = OpTypeStruct %f32 %f64 +%struct_f32vec2_f32vec2 = OpTypeStruct %f32vec2 %f32vec2 +%struct_f32vec2_u32vec2 = OpTypeStruct %f32vec2 %u32vec2 + +%main = OpFunction %void None %func +%main_entry = OpLabel +)"; + + ss << body; + + ss << R"( +OpReturn +OpFunctionEnd)"; + + return ss.str(); +} + +std::string GenerateKernelCode( + const std::string& body, + const std::string& capabilities_and_extensions = "", + const std::string& memory_model = "Physical32") { + std::ostringstream ss; + ss << R"( +OpCapability Addresses +OpCapability Kernel +OpCapability Linkage +OpCapability GenericPointer +OpCapability Int8 +OpCapability Int16 +OpCapability Int64 +OpCapability Float16 +OpCapability Float64 +OpCapability Vector16 +OpCapability Matrix +)"; + + ss << capabilities_and_extensions; + ss << "%extinst = OpExtInstImport \"OpenCL.std\"\n"; + ss << "OpMemoryModel " << memory_model << " OpenCL\n"; + + ss << R"( +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f16 = OpTypeFloat 16 +%f32 = OpTypeFloat 32 +%f64 = OpTypeFloat 64 +%u32 = OpTypeInt 32 0 +%u64 = OpTypeInt 64 0 +%u16 = OpTypeInt 16 0 +%u8 = OpTypeInt 8 0 +%f32vec2 = OpTypeVector %f32 2 +%f32vec3 = OpTypeVector %f32 3 +%f32vec4 = OpTypeVector %f32 4 +%f32vec8 = OpTypeVector %f32 8 +%f16vec8 = OpTypeVector %f16 8 +%f32vec16 = OpTypeVector %f32 16 +%f64vec2 = OpTypeVector %f64 2 +%f64vec3 = OpTypeVector %f64 3 +%f64vec4 = OpTypeVector %f64 4 +%u32vec2 = OpTypeVector %u32 2 +%u32vec3 = OpTypeVector %u32 3 +%u32vec4 = OpTypeVector %u32 4 +%u32vec8 = OpTypeVector %u32 8 +%u64vec2 = OpTypeVector %u64 2 +%f64mat22 = OpTypeMatrix %f64vec2 2 +%f32mat22 = OpTypeMatrix %f32vec2 2 +%f32mat23 = OpTypeMatrix %f32vec2 3 +%f32mat32 = OpTypeMatrix %f32vec3 2 +%f32mat33 = OpTypeMatrix %f32vec3 3 + +%f32_0 = OpConstant %f32 0 +%f32_1 = OpConstant %f32 1 +%f32_2 = OpConstant %f32 2 +%f32_3 = OpConstant %f32 3 +%f32_4 = OpConstant %f32 4 +%f32_h = OpConstant %f32 0.5 +%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 +%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 +%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 +%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 +%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 +%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 +%f32vec8_01010101 = OpConstantComposite %f32vec8 %f32_0 %f32_1 %f32_0 %f32_1 %f32_0 %f32_1 %f32_0 %f32_1 + +%f64_0 = OpConstant %f64 0 +%f64_1 = OpConstant %f64 1 +%f64_2 = OpConstant %f64 2 +%f64_3 = OpConstant %f64 3 +%f64vec2_01 = OpConstantComposite %f64vec2 %f64_0 %f64_1 +%f64vec3_012 = OpConstantComposite %f64vec3 %f64_0 %f64_1 %f64_2 +%f64vec4_0123 = OpConstantComposite %f64vec4 %f64_0 %f64_1 %f64_2 %f64_3 + +%f16_0 = OpConstant %f16 0 +%f16_1 = OpConstant %f16 1 + +%u8_0 = OpConstant %u8 0 +%u8_1 = OpConstant %u8 1 +%u8_2 = OpConstant %u8 2 +%u8_3 = OpConstant %u8 3 + +%u16_0 = OpConstant %u16 0 +%u16_1 = OpConstant %u16 1 +%u16_2 = OpConstant %u16 2 +%u16_3 = OpConstant %u16 3 + +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u32_2 = OpConstant %u32 2 +%u32_3 = OpConstant %u32 3 +%u32_256 = OpConstant %u32 256 + +%u64_0 = OpConstant %u64 0 +%u64_1 = OpConstant %u64 1 +%u64_2 = OpConstant %u64 2 +%u64_3 = OpConstant %u64 3 +%u64_256 = OpConstant %u64 256 + +%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 +%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 +%u32vec3_012 = OpConstantComposite %u32vec3 %u32_0 %u32_1 %u32_2 +%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 + +%u64vec2_01 = OpConstantComposite %u64vec2 %u64_0 %u64_1 + +%f32mat22_1212 = OpConstantComposite %f32mat22 %f32vec2_12 %f32vec2_12 +%f32mat23_121212 = OpConstantComposite %f32mat23 %f32vec2_12 %f32vec2_12 %f32vec2_12 + +%struct_f32_f32 = OpTypeStruct %f32 %f32 +%struct_f32_f32_f32 = OpTypeStruct %f32 %f32 %f32 +%struct_f32_u32 = OpTypeStruct %f32 %u32 +%struct_f32_u32_f32 = OpTypeStruct %f32 %u32 %f32 +%struct_u32_f32 = OpTypeStruct %u32 %f32 +%struct_u32_u32 = OpTypeStruct %u32 %u32 +%struct_f32_f64 = OpTypeStruct %f32 %f64 +%struct_f32vec2_f32vec2 = OpTypeStruct %f32vec2 %f32vec2 +%struct_f32vec2_u32vec2 = OpTypeStruct %f32vec2 %u32vec2 + +%f16vec8_ptr_workgroup = OpTypePointer Workgroup %f16vec8 +%f16vec8_workgroup = OpVariable %f16vec8_ptr_workgroup Workgroup +%f16_ptr_workgroup = OpTypePointer Workgroup %f16 + +%u32vec8_ptr_workgroup = OpTypePointer Workgroup %u32vec8 +%u32vec8_workgroup = OpVariable %u32vec8_ptr_workgroup Workgroup +%u32_ptr_workgroup = OpTypePointer Workgroup %u32 + +%f32vec8_ptr_workgroup = OpTypePointer Workgroup %f32vec8 +%f32vec8_workgroup = OpVariable %f32vec8_ptr_workgroup Workgroup +%f32_ptr_workgroup = OpTypePointer Workgroup %f32 + +%u32arr = OpTypeArray %u32 %u32_256 +%u32arr_ptr_cross_workgroup = OpTypePointer CrossWorkgroup %u32arr +%u32arr_cross_workgroup = OpVariable %u32arr_ptr_cross_workgroup CrossWorkgroup +%u32_ptr_cross_workgroup = OpTypePointer CrossWorkgroup %u32 + +%f32arr = OpTypeArray %f32 %u32_256 +%f32arr_ptr_cross_workgroup = OpTypePointer CrossWorkgroup %f32arr +%f32arr_cross_workgroup = OpVariable %f32arr_ptr_cross_workgroup CrossWorkgroup +%f32_ptr_cross_workgroup = OpTypePointer CrossWorkgroup %f32 + +%f32vec2arr = OpTypeArray %f32vec2 %u32_256 +%f32vec2arr_ptr_cross_workgroup = OpTypePointer CrossWorkgroup %f32vec2arr +%f32vec2arr_cross_workgroup = OpVariable %f32vec2arr_ptr_cross_workgroup CrossWorkgroup +%f32vec2_ptr_cross_workgroup = OpTypePointer CrossWorkgroup %f32vec2 + +%struct_arr = OpTypeArray %struct_f32_f32 %u32_256 +%struct_arr_ptr_cross_workgroup = OpTypePointer CrossWorkgroup %struct_arr +%struct_arr_cross_workgroup = OpVariable %struct_arr_ptr_cross_workgroup CrossWorkgroup +%struct_ptr_cross_workgroup = OpTypePointer CrossWorkgroup %struct_f32_f32 + +%f16vec8_ptr_uniform_constant = OpTypePointer UniformConstant %f16vec8 +%f16vec8_uniform_constant = OpVariable %f16vec8_ptr_uniform_constant UniformConstant +%f16_ptr_uniform_constant = OpTypePointer UniformConstant %f16 + +%u32vec8_ptr_uniform_constant = OpTypePointer UniformConstant %u32vec8 +%u32vec8_uniform_constant = OpVariable %u32vec8_ptr_uniform_constant UniformConstant +%u32_ptr_uniform_constant = OpTypePointer UniformConstant %u32 + +%f32vec8_ptr_uniform_constant = OpTypePointer UniformConstant %f32vec8 +%f32vec8_uniform_constant = OpVariable %f32vec8_ptr_uniform_constant UniformConstant +%f32_ptr_uniform_constant = OpTypePointer UniformConstant %f32 + +%f16vec8_ptr_input = OpTypePointer Input %f16vec8 +%f16vec8_input = OpVariable %f16vec8_ptr_input Input +%f16_ptr_input = OpTypePointer Input %f16 + +%f32_ptr_generic = OpTypePointer Generic %f32 +%u32_ptr_generic = OpTypePointer Generic %u32 + +%f32_ptr_function = OpTypePointer Function %f32 +%f32vec2_ptr_function = OpTypePointer Function %f32vec2 +%u32_ptr_function = OpTypePointer Function %u32 +%u64_ptr_function = OpTypePointer Function %u64 +%u32vec2_ptr_function = OpTypePointer Function %u32vec2 + +%u8arr = OpTypeArray %u8 %u32_256 +%u8arr_ptr_uniform_constant = OpTypePointer UniformConstant %u8arr +%u8arr_uniform_constant = OpVariable %u8arr_ptr_uniform_constant UniformConstant +%u8_ptr_uniform_constant = OpTypePointer UniformConstant %u8 +%u8_ptr_generic = OpTypePointer Generic %u8 + +%main = OpFunction %void None %func +%main_entry = OpLabel +)"; + + ss << body; + + ss << R"( +OpReturn +OpFunctionEnd)"; + + return ss.str(); +} + +TEST_P(ValidateGlslStd450SqrtLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name << " %f32_0\n"; + ss << "%val2 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %f32vec2_01\n"; + ss << "%val3 = OpExtInst %f64 %extinst " << ext_inst_name << " %f64_0\n"; + CompileSuccessfully(GenerateShaderCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateGlslStd450SqrtLike, IntResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + " %f32_0\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected Result Type to be a float scalar " + "or vector type")); +} + +TEST_P(ValidateGlslStd450SqrtLike, IntOperand) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + " %u32_0\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected types of all operands to be equal to " + "Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllSqrtLike, ValidateGlslStd450SqrtLike, + ::testing::ValuesIn(std::vector{ + "Round", + "RoundEven", + "FAbs", + "Trunc", + "FSign", + "Floor", + "Ceil", + "Fract", + "Sqrt", + "InverseSqrt", + "Normalize", + }), ); + +TEST_P(ValidateGlslStd450FMinLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32_0 %f32_1\n"; + ss << "%val2 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %f32vec2_01 %f32vec2_12\n"; + ss << "%val3 = OpExtInst %f64 %extinst " << ext_inst_name + << " %f64_0 %f64_0\n"; + CompileSuccessfully(GenerateShaderCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateGlslStd450FMinLike, IntResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + " %f32_0 %f32_1\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected Result Type to be a float scalar " + "or vector type")); +} + +TEST_P(ValidateGlslStd450FMinLike, IntOperand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + " %u32_0 %f32_1\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected types of all operands to be equal to " + "Result Type")); +} + +TEST_P(ValidateGlslStd450FMinLike, IntOperand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + " %f32_0 %u32_1\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected types of all operands to be equal to " + "Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllFMinLike, ValidateGlslStd450FMinLike, + ::testing::ValuesIn(std::vector{ + "FMin", + "FMax", + "Step", + "Reflect", + "NMin", + "NMax", + }), ); + +TEST_P(ValidateGlslStd450FClampLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32_0 %f32_1 %f32_2\n"; + ss << "%val2 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %f32vec2_01 %f32vec2_01 %f32vec2_12\n"; + ss << "%val3 = OpExtInst %f64 %extinst " << ext_inst_name + << " %f64_0 %f64_0 %f64_1\n"; + CompileSuccessfully(GenerateShaderCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateGlslStd450FClampLike, IntResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + + " %f32_0 %f32_1 %f32_2\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected Result Type to be a float scalar " + "or vector type")); +} + +TEST_P(ValidateGlslStd450FClampLike, IntOperand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + + " %u32_0 %f32_0 %f32_1\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected types of all operands to be equal to " + "Result Type")); +} + +TEST_P(ValidateGlslStd450FClampLike, IntOperand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + + " %f32_0 %u32_0 %f32_1\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected types of all operands to be equal to " + "Result Type")); +} + +TEST_P(ValidateGlslStd450FClampLike, IntOperand3) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + + " %f32_1 %f32_0 %u32_2\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected types of all operands to be equal to " + "Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllFClampLike, ValidateGlslStd450FClampLike, + ::testing::ValuesIn(std::vector{ + "FClamp", + "FMix", + "SmoothStep", + "Fma", + "FaceForward", + "NClamp", + }), ); + +TEST_P(ValidateGlslStd450SAbsLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %s32 %extinst " << ext_inst_name << " %u32_1\n"; + ss << "%val2 = OpExtInst %s32 %extinst " << ext_inst_name << " %s32_1\n"; + ss << "%val3 = OpExtInst %u32 %extinst " << ext_inst_name << " %u32_1\n"; + ss << "%val4 = OpExtInst %u32 %extinst " << ext_inst_name << " %s32_1\n"; + ss << "%val5 = OpExtInst %s32vec2 %extinst " << ext_inst_name + << " %s32vec2_01\n"; + ss << "%val6 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01\n"; + ss << "%val7 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %s32vec2_01\n"; + ss << "%val8 = OpExtInst %s32vec2 %extinst " << ext_inst_name + << " %u32vec2_01\n"; + CompileSuccessfully(GenerateShaderCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateGlslStd450SAbsLike, FloatResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + " %u32_0\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected Result Type to be an int scalar " + "or vector type")); +} + +TEST_P(ValidateGlslStd450SAbsLike, FloatOperand) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %s32 %extinst " + ext_inst_name + " %f32_0\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected all operands to be int scalars or " + "vectors")); +} + +TEST_P(ValidateGlslStd450SAbsLike, WrongDimOperand) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %s32 %extinst " + ext_inst_name + " %s32vec2_01\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected all operands to have the same dimension as " + "Result Type")); +} + +TEST_P(ValidateGlslStd450SAbsLike, WrongBitWidthOperand) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %s64 %extinst " + ext_inst_name + " %s32_0\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected all operands to have the same bit width as " + "Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllSAbsLike, ValidateGlslStd450SAbsLike, + ::testing::ValuesIn(std::vector{ + "SAbs", + "SSign", + "FindILsb", + "FindUMsb", + "FindSMsb", + }), ); + +TEST_F(ValidateExtInst, FindUMsbNot32Bit) { + const std::string body = R"( +%val1 = OpExtInst %s64 %extinst FindUMsb %u64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 FindUMsb: this instruction is currently " + "limited to 32-bit width components")); +} + +TEST_F(ValidateExtInst, FindSMsbNot32Bit) { + const std::string body = R"( +%val1 = OpExtInst %s64 %extinst FindSMsb %u64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 FindSMsb: this instruction is currently " + "limited to 32-bit width components")); +} + +TEST_P(ValidateGlslStd450UMinLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %s32 %extinst " << ext_inst_name + << " %u32_1 %s32_2\n"; + ss << "%val2 = OpExtInst %s32 %extinst " << ext_inst_name + << " %s32_1 %u32_2\n"; + ss << "%val3 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u32_1 %s32_2\n"; + ss << "%val4 = OpExtInst %u32 %extinst " << ext_inst_name + << " %s32_1 %u32_2\n"; + ss << "%val5 = OpExtInst %s32vec2 %extinst " << ext_inst_name + << " %s32vec2_01 %u32vec2_01\n"; + ss << "%val6 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %s32vec2_01\n"; + ss << "%val7 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %s32vec2_01 %u32vec2_01\n"; + ss << "%val8 = OpExtInst %s32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %s32vec2_01\n"; + ss << "%val9 = OpExtInst %s64 %extinst " << ext_inst_name + << " %u64_1 %s64_0\n"; + CompileSuccessfully(GenerateShaderCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateGlslStd450UMinLike, FloatResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + " %u32_0 %u32_0\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected Result Type to be an int scalar " + "or vector type")); +} + +TEST_P(ValidateGlslStd450UMinLike, FloatOperand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %s32 %extinst " + ext_inst_name + " %f32_0 %u32_0\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected all operands to be int scalars or " + "vectors")); +} + +TEST_P(ValidateGlslStd450UMinLike, FloatOperand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %s32 %extinst " + ext_inst_name + " %u32_0 %f32_0\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected all operands to be int scalars or " + "vectors")); +} + +TEST_P(ValidateGlslStd450UMinLike, WrongDimOperand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %s32 %extinst " + ext_inst_name + + " %s32vec2_01 %s32_0\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected all operands to have the same dimension as " + "Result Type")); +} + +TEST_P(ValidateGlslStd450UMinLike, WrongDimOperand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %s32 %extinst " + ext_inst_name + + " %s32_0 %s32vec2_01\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected all operands to have the same dimension as " + "Result Type")); +} + +TEST_P(ValidateGlslStd450UMinLike, WrongBitWidthOperand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %s64 %extinst " + ext_inst_name + " %s32_0 %s64_0\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected all operands to have the same bit width as " + "Result Type")); +} + +TEST_P(ValidateGlslStd450UMinLike, WrongBitWidthOperand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %s64 %extinst " + ext_inst_name + " %s64_0 %s32_0\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected all operands to have the same bit width as " + "Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllUMinLike, ValidateGlslStd450UMinLike, + ::testing::ValuesIn(std::vector{ + "UMin", + "SMin", + "UMax", + "SMax", + }), ); + +TEST_P(ValidateGlslStd450UClampLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %s32 %extinst " << ext_inst_name + << " %s32_0 %u32_1 %s32_2\n"; + ss << "%val2 = OpExtInst %s32 %extinst " << ext_inst_name + << " %u32_0 %s32_1 %u32_2\n"; + ss << "%val3 = OpExtInst %u32 %extinst " << ext_inst_name + << " %s32_0 %u32_1 %s32_2\n"; + ss << "%val4 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u32_0 %s32_1 %u32_2\n"; + ss << "%val5 = OpExtInst %s32vec2 %extinst " << ext_inst_name + << " %s32vec2_01 %u32vec2_01 %u32vec2_12\n"; + ss << "%val6 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %s32vec2_01 %s32vec2_12\n"; + ss << "%val7 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %s32vec2_01 %u32vec2_01 %u32vec2_12\n"; + ss << "%val8 = OpExtInst %s32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %s32vec2_01 %s32vec2_12\n"; + ss << "%val9 = OpExtInst %s64 %extinst " << ext_inst_name + << " %u64_1 %s64_0 %s64_1\n"; + CompileSuccessfully(GenerateShaderCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateGlslStd450UClampLike, FloatResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + + " %u32_0 %u32_0 %u32_1\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected Result Type to be an int scalar " + "or vector type")); +} + +TEST_P(ValidateGlslStd450UClampLike, FloatOperand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %s32 %extinst " + ext_inst_name + + " %f32_0 %u32_0 %u32_1\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected all operands to be int scalars or " + "vectors")); +} + +TEST_P(ValidateGlslStd450UClampLike, FloatOperand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %s32 %extinst " + ext_inst_name + + " %u32_0 %f32_0 %u32_1\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected all operands to be int scalars or " + "vectors")); +} + +TEST_P(ValidateGlslStd450UClampLike, FloatOperand3) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %s32 %extinst " + ext_inst_name + + " %u32_0 %u32_0 %f32_1\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected all operands to be int scalars or " + "vectors")); +} + +TEST_P(ValidateGlslStd450UClampLike, WrongDimOperand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %s32 %extinst " + ext_inst_name + + " %s32vec2_01 %s32_0 %u32_1\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected all operands to have the same dimension as " + "Result Type")); +} + +TEST_P(ValidateGlslStd450UClampLike, WrongDimOperand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %s32 %extinst " + ext_inst_name + + " %s32_0 %s32vec2_01 %u32_1\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected all operands to have the same dimension as " + "Result Type")); +} + +TEST_P(ValidateGlslStd450UClampLike, WrongDimOperand3) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %s32 %extinst " + ext_inst_name + + " %s32_0 %u32_1 %s32vec2_01\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected all operands to have the same dimension as " + "Result Type")); +} + +TEST_P(ValidateGlslStd450UClampLike, WrongBitWidthOperand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %s64 %extinst " + ext_inst_name + + " %s32_0 %s64_0 %s64_1\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected all operands to have the same bit width as " + "Result Type")); +} + +TEST_P(ValidateGlslStd450UClampLike, WrongBitWidthOperand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %s64 %extinst " + ext_inst_name + + " %s64_0 %s32_0 %s64_1\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected all operands to have the same bit width as " + "Result Type")); +} + +TEST_P(ValidateGlslStd450UClampLike, WrongBitWidthOperand3) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %s64 %extinst " + ext_inst_name + + " %s64_0 %s64_0 %s32_1\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected all operands to have the same bit width as " + "Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllUClampLike, ValidateGlslStd450UClampLike, + ::testing::ValuesIn(std::vector{ + "UClamp", + "SClamp", + }), ); + +TEST_P(ValidateGlslStd450SinLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name << " %f32_0\n"; + ss << "%val2 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %f32vec2_01\n"; + CompileSuccessfully(GenerateShaderCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateGlslStd450SinLike, IntResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + " %f32_0\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected Result Type to be a 16 or 32-bit scalar " + "or vector float type")); +} + +TEST_P(ValidateGlslStd450SinLike, F64ResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f64 %extinst " + ext_inst_name + " %f32_0\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected Result Type to be a 16 or 32-bit scalar " + "or vector float type")); +} + +TEST_P(ValidateGlslStd450SinLike, IntOperand) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + " %u32_0\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected types of all operands to be equal to " + "Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllSinLike, ValidateGlslStd450SinLike, + ::testing::ValuesIn(std::vector{ + "Radians", + "Degrees", + "Sin", + "Cos", + "Tan", + "Asin", + "Acos", + "Atan", + "Sinh", + "Cosh", + "Tanh", + "Asinh", + "Acosh", + "Atanh", + "Exp", + "Exp2", + "Log", + "Log2", + }), ); + +TEST_P(ValidateGlslStd450PowLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32_1 %f32_1\n"; + ss << "%val2 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %f32vec2_01 %f32vec2_12\n"; + CompileSuccessfully(GenerateShaderCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateGlslStd450PowLike, IntResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + " %f32_1 %f32_0\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected Result Type to be a 16 or 32-bit scalar " + "or vector float type")); +} + +TEST_P(ValidateGlslStd450PowLike, F64ResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f64 %extinst " + ext_inst_name + " %f32_1 %f32_0\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected Result Type to be a 16 or 32-bit scalar " + "or vector float type")); +} + +TEST_P(ValidateGlslStd450PowLike, IntOperand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + " %u32_0 %f32_1\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected types of all operands to be equal to " + "Result Type")); +} + +TEST_P(ValidateGlslStd450PowLike, IntOperand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + " %f32_0 %u32_1\n"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 " + ext_inst_name + + ": expected types of all operands to be equal to " + "Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllPowLike, ValidateGlslStd450PowLike, + ::testing::ValuesIn(std::vector{ + "Atan2", + "Pow", + }), ); + +TEST_F(ValidateExtInst, GlslStd450DeterminantSuccess) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Determinant %f32mat22_1212 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, GlslStd450DeterminantIncompatibleResultType) { + const std::string body = R"( +%val1 = OpExtInst %f64 %extinst Determinant %f32mat22_1212 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Determinant: " + "expected operand X component type to be equal to " + "Result Type")); +} + +TEST_F(ValidateExtInst, GlslStd450DeterminantNotMatrix) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Determinant %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Determinant: " + "expected operand X to be a square matrix")); +} + +TEST_F(ValidateExtInst, GlslStd450DeterminantMatrixNotSquare) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Determinant %f32mat23_121212 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Determinant: " + "expected operand X to be a square matrix")); +} + +TEST_F(ValidateExtInst, GlslStd450MatrixInverseSuccess) { + const std::string body = R"( +%val1 = OpExtInst %f32mat22 %extinst MatrixInverse %f32mat22_1212 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, GlslStd450MatrixInverseIncompatibleResultType) { + const std::string body = R"( +%val1 = OpExtInst %f32mat33 %extinst MatrixInverse %f32mat22_1212 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 MatrixInverse: " + "expected operand X type to be equal to " + "Result Type")); +} + +TEST_F(ValidateExtInst, GlslStd450MatrixInverseNotMatrix) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst MatrixInverse %f32mat22_1212 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 MatrixInverse: " + "expected Result Type to be a square matrix")); +} + +TEST_F(ValidateExtInst, GlslStd450MatrixInverseMatrixNotSquare) { + const std::string body = R"( +%val1 = OpExtInst %f32mat23 %extinst MatrixInverse %f32mat23_121212 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 MatrixInverse: " + "expected Result Type to be a square matrix")); +} + +TEST_F(ValidateExtInst, GlslStd450ModfSuccess) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Modf %f32_h %f32_output +%val2 = OpExtInst %f32vec2 %extinst Modf %f32vec2_01 %f32vec2_output +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, GlslStd450ModfIntResultType) { + const std::string body = R"( +%val1 = OpExtInst %u32 %extinst Modf %f32_h %f32_output +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Modf: " + "expected Result Type to be a scalar or vector " + "float type")); +} + +TEST_F(ValidateExtInst, GlslStd450ModfXNotOfResultType) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Modf %f64_0 %f32_output +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Modf: " + "expected operand X type to be equal to Result Type")); +} + +TEST_F(ValidateExtInst, GlslStd450ModfINotPointer) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Modf %f32_h %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Modf: " + "expected operand I to be a pointer")); +} + +TEST_F(ValidateExtInst, GlslStd450ModfIDataNotOfResultType) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Modf %f32_h %f32vec2_output +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Modf: " + "expected operand I data type to be equal to " + "Result Type")); +} + +TEST_F(ValidateExtInst, GlslStd450ModfStructSuccess) { + const std::string body = R"( +%val1 = OpExtInst %struct_f32_f32 %extinst ModfStruct %f32_h +%val2 = OpExtInst %struct_f32vec2_f32vec2 %extinst ModfStruct %f32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, GlslStd450ModfStructResultTypeNotStruct) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst ModfStruct %f32_h +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 ModfStruct: " + "expected Result Type to be a struct with two " + "identical scalar or vector float type members")); +} + +TEST_F(ValidateExtInst, GlslStd450ModfStructResultTypeStructWrongSize) { + const std::string body = R"( +%val1 = OpExtInst %struct_f32_f32_f32 %extinst ModfStruct %f32_h +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 ModfStruct: " + "expected Result Type to be a struct with two " + "identical scalar or vector float type members")); +} + +TEST_F(ValidateExtInst, GlslStd450ModfStructResultTypeStructWrongFirstMember) { + const std::string body = R"( +%val1 = OpExtInst %struct_u32_f32 %extinst ModfStruct %f32_h +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 ModfStruct: " + "expected Result Type to be a struct with two " + "identical scalar or vector float type members")); +} + +TEST_F(ValidateExtInst, GlslStd450ModfStructResultTypeStructMembersNotEqual) { + const std::string body = R"( +%val1 = OpExtInst %struct_f32_f64 %extinst ModfStruct %f32_h +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 ModfStruct: " + "expected Result Type to be a struct with two " + "identical scalar or vector float type members")); +} + +TEST_F(ValidateExtInst, GlslStd450ModfStructXWrongType) { + const std::string body = R"( +%val1 = OpExtInst %struct_f32_f32 %extinst ModfStruct %f64_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 ModfStruct: " + "expected operand X type to be equal to members of " + "Result Type struct")); +} + +TEST_F(ValidateExtInst, GlslStd450FrexpSuccess) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Frexp %f32_h %u32_output +%val2 = OpExtInst %f32vec2 %extinst Frexp %f32vec2_01 %u32vec2_output +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, GlslStd450FrexpIntResultType) { + const std::string body = R"( +%val1 = OpExtInst %u32 %extinst Frexp %f32_h %u32_output +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Frexp: " + "expected Result Type to be a scalar or vector " + "float type")); +} + +TEST_F(ValidateExtInst, GlslStd450FrexpWrongXType) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Frexp %u32_1 %u32_output +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Frexp: " + "expected operand X type to be equal to Result Type")); +} + +TEST_F(ValidateExtInst, GlslStd450FrexpExpNotPointer) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Frexp %f32_1 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Frexp: " + "expected operand Exp to be a pointer")); +} + +TEST_F(ValidateExtInst, GlslStd450FrexpExpNotInt32Pointer) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Frexp %f32_1 %f32_output +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Frexp: " + "expected operand Exp data type to be a 32-bit int " + "scalar or vector type")); +} + +TEST_F(ValidateExtInst, GlslStd450FrexpExpWrongComponentNumber) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst Frexp %f32vec2_01 %u32_output +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Frexp: " + "expected operand Exp data type to have the same " + "component number as Result Type")); +} + +TEST_F(ValidateExtInst, GlslStd450LdexpSuccess) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Ldexp %f32_h %u32_2 +%val2 = OpExtInst %f32vec2 %extinst Ldexp %f32vec2_01 %u32vec2_12 +%val3 = OpExtInst %f32 %extinst Ldexp %f32_h %u64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, GlslStd450LdexpIntResultType) { + const std::string body = R"( +%val1 = OpExtInst %u32 %extinst Ldexp %f32_h %u32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Ldexp: " + "expected Result Type to be a scalar or vector " + "float type")); +} + +TEST_F(ValidateExtInst, GlslStd450LdexpWrongXType) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Ldexp %u32_1 %u32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Ldexp: " + "expected operand X type to be equal to Result Type")); +} + +TEST_F(ValidateExtInst, GlslStd450LdexpFloatExp) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Ldexp %f32_1 %f32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Ldexp: " + "expected operand Exp to be a 32-bit int scalar " + "or vector type")); +} + +TEST_F(ValidateExtInst, GlslStd450LdexpExpWrongSize) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst Ldexp %f32vec2_12 %u32_2 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Ldexp: " + "expected operand Exp to have the same component " + "number as Result Type")); +} + +TEST_F(ValidateExtInst, GlslStd450FrexpStructSuccess) { + const std::string body = R"( +%val1 = OpExtInst %struct_f32_u32 %extinst FrexpStruct %f32_h +%val2 = OpExtInst %struct_f32vec2_u32vec2 %extinst FrexpStruct %f32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, GlslStd450FrexpStructResultTypeNotStruct) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst FrexpStruct %f32_h +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 FrexpStruct: " + "expected Result Type to be a struct with two members, " + "first member a float scalar or vector, second member " + "a 32-bit int scalar or vector with the same number of " + "components as the first member")); +} + +TEST_F(ValidateExtInst, GlslStd450FrexpStructResultTypeStructWrongSize) { + const std::string body = R"( +%val1 = OpExtInst %struct_f32_u32_f32 %extinst FrexpStruct %f32_h +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 FrexpStruct: " + "expected Result Type to be a struct with two members, " + "first member a float scalar or vector, second member " + "a 32-bit int scalar or vector with the same number of " + "components as the first member")); +} + +TEST_F(ValidateExtInst, GlslStd450FrexpStructResultTypeStructWrongMember1) { + const std::string body = R"( +%val1 = OpExtInst %struct_u32_u32 %extinst FrexpStruct %f32_h +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 FrexpStruct: " + "expected Result Type to be a struct with two members, " + "first member a float scalar or vector, second member " + "a 32-bit int scalar or vector with the same number of " + "components as the first member")); +} + +TEST_F(ValidateExtInst, GlslStd450FrexpStructResultTypeStructWrongMember2) { + const std::string body = R"( +%val1 = OpExtInst %struct_f32_f32 %extinst FrexpStruct %f32_h +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 FrexpStruct: " + "expected Result Type to be a struct with two members, " + "first member a float scalar or vector, second member " + "a 32-bit int scalar or vector with the same number of " + "components as the first member")); +} + +TEST_F(ValidateExtInst, GlslStd450FrexpStructXWrongType) { + const std::string body = R"( +%val1 = OpExtInst %struct_f32_u32 %extinst FrexpStruct %f64_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 FrexpStruct: " + "expected operand X type to be equal to the first " + "member of Result Type struct")); +} + +TEST_P(ValidateGlslStd450Pack, Success) { + const std::string ext_inst_name = GetParam(); + const uint32_t num_components = GetPackedNumComponents(ext_inst_name); + const uint32_t packed_bit_width = GetPackedBitWidth(ext_inst_name); + const uint32_t total_bit_width = num_components * packed_bit_width; + const std::string vec_str = + num_components == 2 ? " %f32vec2_01\n" : " %f32vec4_0123\n"; + + std::ostringstream body; + body << "%val1 = OpExtInst %u" << total_bit_width << " %extinst " + << ext_inst_name << vec_str; + body << "%val2 = OpExtInst %s" << total_bit_width << " %extinst " + << ext_inst_name << vec_str; + CompileSuccessfully(GenerateShaderCode(body.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateGlslStd450Pack, Float32ResultType) { + const std::string ext_inst_name = GetParam(); + const uint32_t num_components = GetPackedNumComponents(ext_inst_name); + const uint32_t packed_bit_width = GetPackedBitWidth(ext_inst_name); + const uint32_t total_bit_width = num_components * packed_bit_width; + const std::string vec_str = + num_components == 2 ? " %f32vec2_01\n" : " %f32vec4_0123\n"; + + std::ostringstream body; + body << "%val1 = OpExtInst %f" << total_bit_width << " %extinst " + << ext_inst_name << vec_str; + + std::ostringstream expected; + expected << "GLSL.std.450 " << ext_inst_name + << ": expected Result Type to be " << total_bit_width + << "-bit int scalar type"; + + CompileSuccessfully(GenerateShaderCode(body.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str())); +} + +TEST_P(ValidateGlslStd450Pack, Int16ResultType) { + const std::string ext_inst_name = GetParam(); + const uint32_t num_components = GetPackedNumComponents(ext_inst_name); + const uint32_t packed_bit_width = GetPackedBitWidth(ext_inst_name); + const uint32_t total_bit_width = num_components * packed_bit_width; + const std::string vec_str = + num_components == 2 ? " %f32vec2_01\n" : " %f32vec4_0123\n"; + + std::ostringstream body; + body << "%val1 = OpExtInst %u16 %extinst " << ext_inst_name << vec_str; + + std::ostringstream expected; + expected << "GLSL.std.450 " << ext_inst_name + << ": expected Result Type to be " << total_bit_width + << "-bit int scalar type"; + + CompileSuccessfully(GenerateShaderCode(body.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str())); +} + +TEST_P(ValidateGlslStd450Pack, VNotVector) { + const std::string ext_inst_name = GetParam(); + const uint32_t num_components = GetPackedNumComponents(ext_inst_name); + const uint32_t packed_bit_width = GetPackedBitWidth(ext_inst_name); + const uint32_t total_bit_width = num_components * packed_bit_width; + + std::ostringstream body; + body << "%val1 = OpExtInst %u" << total_bit_width << " %extinst " + << ext_inst_name << " %f32_1\n"; + + std::ostringstream expected; + expected << "GLSL.std.450 " << ext_inst_name + << ": expected operand V to be a 32-bit float vector of size " + << num_components; + + CompileSuccessfully(GenerateShaderCode(body.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str())); +} + +TEST_P(ValidateGlslStd450Pack, VNotFloatVector) { + const std::string ext_inst_name = GetParam(); + const uint32_t num_components = GetPackedNumComponents(ext_inst_name); + const uint32_t packed_bit_width = GetPackedBitWidth(ext_inst_name); + const uint32_t total_bit_width = num_components * packed_bit_width; + const std::string vec_str = + num_components == 2 ? " %u32vec2_01\n" : " %u32vec4_0123\n"; + + std::ostringstream body; + body << "%val1 = OpExtInst %u" << total_bit_width << " %extinst " + << ext_inst_name << vec_str; + + std::ostringstream expected; + expected << "GLSL.std.450 " << ext_inst_name + << ": expected operand V to be a 32-bit float vector of size " + << num_components; + + CompileSuccessfully(GenerateShaderCode(body.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str())); +} + +TEST_P(ValidateGlslStd450Pack, VNotFloat32Vector) { + const std::string ext_inst_name = GetParam(); + const uint32_t num_components = GetPackedNumComponents(ext_inst_name); + const uint32_t packed_bit_width = GetPackedBitWidth(ext_inst_name); + const uint32_t total_bit_width = num_components * packed_bit_width; + const std::string vec_str = + num_components == 2 ? " %f64vec2_01\n" : " %f64vec4_0123\n"; + + std::ostringstream body; + body << "%val1 = OpExtInst %u" << total_bit_width << " %extinst " + << ext_inst_name << vec_str; + + std::ostringstream expected; + expected << "GLSL.std.450 " << ext_inst_name + << ": expected operand V to be a 32-bit float vector of size " + << num_components; + + CompileSuccessfully(GenerateShaderCode(body.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str())); +} + +TEST_P(ValidateGlslStd450Pack, VWrongSizeVector) { + const std::string ext_inst_name = GetParam(); + const uint32_t num_components = GetPackedNumComponents(ext_inst_name); + const uint32_t packed_bit_width = GetPackedBitWidth(ext_inst_name); + const uint32_t total_bit_width = num_components * packed_bit_width; + const std::string vec_str = + num_components == 4 ? " %f32vec2_01\n" : " %f32vec4_0123\n"; + + std::ostringstream body; + body << "%val1 = OpExtInst %u" << total_bit_width << " %extinst " + << ext_inst_name << vec_str; + + std::ostringstream expected; + expected << "GLSL.std.450 " << ext_inst_name + << ": expected operand V to be a 32-bit float vector of size " + << num_components; + + CompileSuccessfully(GenerateShaderCode(body.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str())); +} + +INSTANTIATE_TEST_CASE_P(AllPack, ValidateGlslStd450Pack, + ::testing::ValuesIn(std::vector{ + "PackSnorm4x8", + "PackUnorm4x8", + "PackSnorm2x16", + "PackUnorm2x16", + "PackHalf2x16", + }), ); + +TEST_F(ValidateExtInst, PackDouble2x32Success) { + const std::string body = R"( +%val1 = OpExtInst %f64 %extinst PackDouble2x32 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, PackDouble2x32Float32ResultType) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst PackDouble2x32 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 PackDouble2x32: expected Result Type to " + "be 64-bit float scalar type")); +} + +TEST_F(ValidateExtInst, PackDouble2x32Int64ResultType) { + const std::string body = R"( +%val1 = OpExtInst %u64 %extinst PackDouble2x32 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 PackDouble2x32: expected Result Type to " + "be 64-bit float scalar type")); +} + +TEST_F(ValidateExtInst, PackDouble2x32VNotVector) { + const std::string body = R"( +%val1 = OpExtInst %f64 %extinst PackDouble2x32 %u64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 PackDouble2x32: expected operand V to be " + "a 32-bit int vector of size 2")); +} + +TEST_F(ValidateExtInst, PackDouble2x32VNotIntVector) { + const std::string body = R"( +%val1 = OpExtInst %f64 %extinst PackDouble2x32 %f32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 PackDouble2x32: expected operand V to be " + "a 32-bit int vector of size 2")); +} + +TEST_F(ValidateExtInst, PackDouble2x32VNotInt32Vector) { + const std::string body = R"( +%val1 = OpExtInst %f64 %extinst PackDouble2x32 %u64vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 PackDouble2x32: expected operand V to be " + "a 32-bit int vector of size 2")); +} + +TEST_F(ValidateExtInst, PackDouble2x32VWrongSize) { + const std::string body = R"( +%val1 = OpExtInst %f64 %extinst PackDouble2x32 %u32vec4_0123 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 PackDouble2x32: expected operand V to be " + "a 32-bit int vector of size 2")); +} + +TEST_P(ValidateGlslStd450Unpack, Success) { + const std::string ext_inst_name = GetParam(); + const uint32_t num_components = GetPackedNumComponents(ext_inst_name); + const uint32_t packed_bit_width = GetPackedBitWidth(ext_inst_name); + const uint32_t total_bit_width = num_components * packed_bit_width; + const std::string result_type_str = + num_components == 2 ? "%f32vec2" : " %f32vec4"; + + std::ostringstream body; + body << "%val1 = OpExtInst " << result_type_str << " %extinst " + << ext_inst_name << " %u" << total_bit_width << "_1\n"; + body << "%val2 = OpExtInst " << result_type_str << " %extinst " + << ext_inst_name << " %s" << total_bit_width << "_1\n"; + CompileSuccessfully(GenerateShaderCode(body.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateGlslStd450Unpack, ResultTypeNotVector) { + const std::string ext_inst_name = GetParam(); + const uint32_t num_components = GetPackedNumComponents(ext_inst_name); + const uint32_t packed_bit_width = GetPackedBitWidth(ext_inst_name); + const uint32_t total_bit_width = num_components * packed_bit_width; + const std::string result_type_str = "%f32"; + + std::ostringstream body; + body << "%val1 = OpExtInst " << result_type_str << " %extinst " + << ext_inst_name << " %u" << total_bit_width << "_1\n"; + + std::ostringstream expected; + expected << "GLSL.std.450 " << ext_inst_name + << ": expected Result Type to be a 32-bit float vector of size " + << num_components; + + CompileSuccessfully(GenerateShaderCode(body.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str())); +} + +TEST_P(ValidateGlslStd450Unpack, ResultTypeNotFloatVector) { + const std::string ext_inst_name = GetParam(); + const uint32_t num_components = GetPackedNumComponents(ext_inst_name); + const uint32_t packed_bit_width = GetPackedBitWidth(ext_inst_name); + const uint32_t total_bit_width = num_components * packed_bit_width; + const std::string result_type_str = + num_components == 2 ? "%u32vec2" : " %u32vec4"; + + std::ostringstream body; + body << "%val1 = OpExtInst " << result_type_str << " %extinst " + << ext_inst_name << " %u" << total_bit_width << "_1\n"; + + std::ostringstream expected; + expected << "GLSL.std.450 " << ext_inst_name + << ": expected Result Type to be a 32-bit float vector of size " + << num_components; + + CompileSuccessfully(GenerateShaderCode(body.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str())); +} + +TEST_P(ValidateGlslStd450Unpack, ResultTypeNotFloat32Vector) { + const std::string ext_inst_name = GetParam(); + const uint32_t num_components = GetPackedNumComponents(ext_inst_name); + const uint32_t packed_bit_width = GetPackedBitWidth(ext_inst_name); + const uint32_t total_bit_width = num_components * packed_bit_width; + const std::string result_type_str = + num_components == 2 ? "%f64vec2" : " %f64vec4"; + + std::ostringstream body; + body << "%val1 = OpExtInst " << result_type_str << " %extinst " + << ext_inst_name << " %u" << total_bit_width << "_1\n"; + + std::ostringstream expected; + expected << "GLSL.std.450 " << ext_inst_name + << ": expected Result Type to be a 32-bit float vector of size " + << num_components; + + CompileSuccessfully(GenerateShaderCode(body.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str())); +} + +TEST_P(ValidateGlslStd450Unpack, ResultTypeWrongSize) { + const std::string ext_inst_name = GetParam(); + const uint32_t num_components = GetPackedNumComponents(ext_inst_name); + const uint32_t packed_bit_width = GetPackedBitWidth(ext_inst_name); + const uint32_t total_bit_width = num_components * packed_bit_width; + const std::string result_type_str = + num_components == 4 ? "%f32vec2" : " %f32vec4"; + + std::ostringstream body; + body << "%val1 = OpExtInst " << result_type_str << " %extinst " + << ext_inst_name << " %u" << total_bit_width << "_1\n"; + + std::ostringstream expected; + expected << "GLSL.std.450 " << ext_inst_name + << ": expected Result Type to be a 32-bit float vector of size " + << num_components; + + CompileSuccessfully(GenerateShaderCode(body.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str())); +} + +TEST_P(ValidateGlslStd450Unpack, ResultPNotInt) { + const std::string ext_inst_name = GetParam(); + const uint32_t num_components = GetPackedNumComponents(ext_inst_name); + const uint32_t packed_bit_width = GetPackedBitWidth(ext_inst_name); + const uint32_t total_bit_width = num_components * packed_bit_width; + const std::string result_type_str = + num_components == 2 ? "%f32vec2" : " %f32vec4"; + + std::ostringstream body; + body << "%val1 = OpExtInst " << result_type_str << " %extinst " + << ext_inst_name << " %f" << total_bit_width << "_1\n"; + + std::ostringstream expected; + expected << "GLSL.std.450 " << ext_inst_name + << ": expected operand P to be a " << total_bit_width + << "-bit int scalar"; + + CompileSuccessfully(GenerateShaderCode(body.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str())); +} + +TEST_P(ValidateGlslStd450Unpack, ResultPWrongBitWidth) { + const std::string ext_inst_name = GetParam(); + const uint32_t num_components = GetPackedNumComponents(ext_inst_name); + const uint32_t packed_bit_width = GetPackedBitWidth(ext_inst_name); + const uint32_t total_bit_width = num_components * packed_bit_width; + const uint32_t wrong_bit_width = total_bit_width == 32 ? 64 : 32; + const std::string result_type_str = + num_components == 2 ? "%f32vec2" : " %f32vec4"; + + std::ostringstream body; + body << "%val1 = OpExtInst " << result_type_str << " %extinst " + << ext_inst_name << " %u" << wrong_bit_width << "_1\n"; + + std::ostringstream expected; + expected << "GLSL.std.450 " << ext_inst_name + << ": expected operand P to be a " << total_bit_width + << "-bit int scalar"; + + CompileSuccessfully(GenerateShaderCode(body.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str())); +} + +INSTANTIATE_TEST_CASE_P(AllUnpack, ValidateGlslStd450Unpack, + ::testing::ValuesIn(std::vector{ + "UnpackSnorm4x8", + "UnpackUnorm4x8", + "UnpackSnorm2x16", + "UnpackUnorm2x16", + "UnpackHalf2x16", + }), ); + +TEST_F(ValidateExtInst, UnpackDouble2x32Success) { + const std::string body = R"( +%val1 = OpExtInst %u32vec2 %extinst UnpackDouble2x32 %f64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, UnpackDouble2x32ResultTypeNotVector) { + const std::string body = R"( +%val1 = OpExtInst %u64 %extinst UnpackDouble2x32 %f64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 UnpackDouble2x32: expected Result Type " + "to be a 32-bit int vector of size 2")); +} + +TEST_F(ValidateExtInst, UnpackDouble2x32ResultTypeNotIntVector) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst UnpackDouble2x32 %f64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 UnpackDouble2x32: expected Result Type " + "to be a 32-bit int vector of size 2")); +} + +TEST_F(ValidateExtInst, UnpackDouble2x32ResultTypeNotInt32Vector) { + const std::string body = R"( +%val1 = OpExtInst %u64vec2 %extinst UnpackDouble2x32 %f64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 UnpackDouble2x32: expected Result Type " + "to be a 32-bit int vector of size 2")); +} + +TEST_F(ValidateExtInst, UnpackDouble2x32ResultTypeWrongSize) { + const std::string body = R"( +%val1 = OpExtInst %u32vec4 %extinst UnpackDouble2x32 %f64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 UnpackDouble2x32: expected Result Type " + "to be a 32-bit int vector of size 2")); +} + +TEST_F(ValidateExtInst, UnpackDouble2x32VNotFloat) { + const std::string body = R"( +%val1 = OpExtInst %u32vec2 %extinst UnpackDouble2x32 %u64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 UnpackDouble2x32: expected operand V to " + "be a 64-bit float scalar")); +} + +TEST_F(ValidateExtInst, UnpackDouble2x32VNotFloat64) { + const std::string body = R"( +%val1 = OpExtInst %u32vec2 %extinst UnpackDouble2x32 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 UnpackDouble2x32: expected operand V to " + "be a 64-bit float scalar")); +} + +TEST_F(ValidateExtInst, GlslStd450LengthSuccess) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Length %f32_1 +%val2 = OpExtInst %f32 %extinst Length %f32vec2_01 +%val3 = OpExtInst %f32 %extinst Length %f32vec4_0123 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, GlslStd450LengthIntResultType) { + const std::string body = R"( +%val1 = OpExtInst %u32 %extinst Length %f32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Length: " + "expected Result Type to be a float scalar type")); +} + +TEST_F(ValidateExtInst, GlslStd450LengthIntX) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Length %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Length: " + "expected operand X to be of float scalar or " + "vector type")); +} + +TEST_F(ValidateExtInst, GlslStd450LengthDifferentType) { + const std::string body = R"( +%val1 = OpExtInst %f64 %extinst Length %f32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Length: " + "expected operand X component type to be equal to " + "Result Type")); +} + +TEST_F(ValidateExtInst, GlslStd450DistanceSuccess) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Distance %f32_0 %f32_1 +%val2 = OpExtInst %f32 %extinst Distance %f32vec2_01 %f32vec2_12 +%val3 = OpExtInst %f32 %extinst Distance %f32vec4_0123 %f32vec4_1234 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, GlslStd450DistanceIntResultType) { + const std::string body = R"( +%val1 = OpExtInst %u32 %extinst Distance %f32vec2_01 %f32vec2_12 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Distance: " + "expected Result Type to be a float scalar type")); +} + +TEST_F(ValidateExtInst, GlslStd450DistanceIntP0) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Distance %u32_0 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Distance: " + "expected operand P0 to be of float scalar or " + "vector type")); +} + +TEST_F(ValidateExtInst, GlslStd450DistanceF64VectorP0) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Distance %f64vec2_01 %f32vec2_12 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Distance: " + "expected operand P0 component type to be equal to " + "Result Type")); +} + +TEST_F(ValidateExtInst, GlslStd450DistanceIntP1) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Distance %f32_0 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Distance: " + "expected operand P1 to be of float scalar or " + "vector type")); +} + +TEST_F(ValidateExtInst, GlslStd450DistanceF64VectorP1) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Distance %f32vec2_12 %f64vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Distance: " + "expected operand P1 component type to be equal to " + "Result Type")); +} + +TEST_F(ValidateExtInst, GlslStd450DistanceDifferentSize) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Distance %f32vec2_01 %f32vec4_0123 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Distance: " + "expected operands P0 and P1 to have the same number " + "of components")); +} + +TEST_F(ValidateExtInst, GlslStd450CrossSuccess) { + const std::string body = R"( +%val1 = OpExtInst %f32vec3 %extinst Cross %f32vec3_012 %f32vec3_123 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, GlslStd450CrossIntVectorResultType) { + const std::string body = R"( +%val1 = OpExtInst %u32vec3 %extinst Cross %f32vec3_012 %f32vec3_123 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Cross: " + "expected Result Type to be a float vector type")); +} + +TEST_F(ValidateExtInst, GlslStd450CrossResultTypeWrongSize) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst Cross %f32vec3_012 %f32vec3_123 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Cross: " + "expected Result Type to have 3 components")); +} + +TEST_F(ValidateExtInst, GlslStd450CrossXWrongType) { + const std::string body = R"( +%val1 = OpExtInst %f32vec3 %extinst Cross %f64vec3_012 %f32vec3_123 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Cross: " + "expected operand X type to be equal to Result Type")); +} + +TEST_F(ValidateExtInst, GlslStd450CrossYWrongType) { + const std::string body = R"( +%val1 = OpExtInst %f32vec3 %extinst Cross %f32vec3_123 %f64vec3_012 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Cross: " + "expected operand Y type to be equal to Result Type")); +} + +TEST_F(ValidateExtInst, GlslStd450RefractSuccess) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst Refract %f32_1 %f32_1 %f32_1 +%val2 = OpExtInst %f32vec2 %extinst Refract %f32vec2_01 %f32vec2_01 %f16_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, GlslStd450RefractIntVectorResultType) { + const std::string body = R"( +%val1 = OpExtInst %u32vec2 %extinst Refract %f32vec2_01 %f32vec2_01 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Refract: " + "expected Result Type to be a float scalar or " + "vector type")); +} + +TEST_F(ValidateExtInst, GlslStd450RefractIntVectorI) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst Refract %u32vec2_01 %f32vec2_01 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Refract: " + "expected operand I to be of type equal to " + "Result Type")); +} + +TEST_F(ValidateExtInst, GlslStd450RefractIntVectorN) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst Refract %f32vec2_01 %u32vec2_01 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Refract: " + "expected operand N to be of type equal to " + "Result Type")); +} + +TEST_F(ValidateExtInst, GlslStd450RefractIntEta) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst Refract %f32vec2_01 %f32vec2_01 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Refract: " + "expected operand Eta to be a 16 or 32-bit " + "float scalar")); +} + +TEST_F(ValidateExtInst, GlslStd450RefractFloat64Eta) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst Refract %f32vec2_01 %f32vec2_01 %f64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 Refract: " + "expected operand Eta to be a 16 or 32-bit " + "float scalar")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtCentroidSuccess) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtCentroid %f32_input +%val2 = OpExtInst %f32vec2 %extinst InterpolateAtCentroid %f32vec2_input +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtCentroidNoCapability) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtCentroid %f32_input +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_CAPABILITY, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtCentroid requires " + "capability InterpolationFunction")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtCentroidIntResultType) { + const std::string body = R"( +%val1 = OpExtInst %u32 %extinst InterpolateAtCentroid %f32_input +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtCentroid: " + "expected Result Type to be a 32-bit float scalar " + "or vector type")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtCentroidF64ResultType) { + const std::string body = R"( +%val1 = OpExtInst %f64 %extinst InterpolateAtCentroid %f32_input +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtCentroid: " + "expected Result Type to be a 32-bit float scalar " + "or vector type")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtCentroidNotPointer) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtCentroid %f32_1 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtCentroid: " + "expected Interpolant to be a pointer")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtCentroidWrongDataType) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtCentroid %f32vec2_input +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtCentroid: " + "expected Interpolant data type to be equal to " + "Result Type")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtCentroidWrongStorageClass) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtCentroid %f32_output +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtCentroid: " + "expected Interpolant storage class to be Input")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtCentroidWrongExecutionModel) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtCentroid %f32_input +)"; + + CompileSuccessfully(GenerateShaderCode( + body, "OpCapability InterpolationFunction\n", "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtCentroid requires " + "Fragment execution model")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtSampleSuccess) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtSample %f32_input %u32_1 +%val2 = OpExtInst %f32vec2 %extinst InterpolateAtSample %f32vec2_input %u32_1 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtSampleNoCapability) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtSample %f32_input %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_CAPABILITY, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtSample requires " + "capability InterpolationFunction")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtSampleIntResultType) { + const std::string body = R"( +%val1 = OpExtInst %u32 %extinst InterpolateAtSample %f32_input %u32_1 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtSample: " + "expected Result Type to be a 32-bit float scalar " + "or vector type")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtSampleF64ResultType) { + const std::string body = R"( +%val1 = OpExtInst %f64 %extinst InterpolateAtSample %f32_input %u32_1 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtSample: " + "expected Result Type to be a 32-bit float scalar " + "or vector type")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtSampleNotPointer) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtSample %f32_1 %u32_1 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtSample: " + "expected Interpolant to be a pointer")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtSampleWrongDataType) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtSample %f32vec2_input %u32_1 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtSample: " + "expected Interpolant data type to be equal to " + "Result Type")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtSampleWrongStorageClass) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtSample %f32_output %u32_1 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtSample: " + "expected Interpolant storage class to be Input")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtSampleFloatSample) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtSample %f32_input %f32_1 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtSample: " + "expected Sample to be 32-bit integer")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtSampleU64Sample) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtSample %f32_input %u64_1 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtSample: " + "expected Sample to be 32-bit integer")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtSampleWrongExecutionModel) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtSample %f32_input %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode( + body, "OpCapability InterpolationFunction\n", "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtSample requires " + "Fragment execution model")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtOffsetSuccess) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtOffset %f32_input %f32vec2_01 +%val2 = OpExtInst %f32vec2 %extinst InterpolateAtOffset %f32vec2_input %f32vec2_01 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtOffsetNoCapability) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtOffset %f32_input %f32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_CAPABILITY, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtOffset requires " + "capability InterpolationFunction")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtOffsetIntResultType) { + const std::string body = R"( +%val1 = OpExtInst %u32 %extinst InterpolateAtOffset %f32_input %f32vec2_01 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtOffset: " + "expected Result Type to be a 32-bit float scalar " + "or vector type")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtOffsetF64ResultType) { + const std::string body = R"( +%val1 = OpExtInst %f64 %extinst InterpolateAtOffset %f32_input %f32vec2_01 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtOffset: " + "expected Result Type to be a 32-bit float scalar " + "or vector type")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtOffsetNotPointer) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtOffset %f32_1 %f32vec2_01 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtOffset: " + "expected Interpolant to be a pointer")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtOffsetWrongDataType) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtOffset %f32vec2_input %f32vec2_01 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtOffset: " + "expected Interpolant data type to be equal to " + "Result Type")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtOffsetWrongStorageClass) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtOffset %f32_output %f32vec2_01 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtOffset: " + "expected Interpolant storage class to be Input")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtOffsetOffsetNotVector) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtOffset %f32_input %f32_0 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtOffset: " + "expected Offset to be a vector of 2 32-bit floats")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtOffsetOffsetNotVector2) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtOffset %f32_input %f32vec3_012 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtOffset: " + "expected Offset to be a vector of 2 32-bit floats")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtOffsetOffsetNotFloatVector) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtOffset %f32_input %u32vec2_01 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtOffset: " + "expected Offset to be a vector of 2 32-bit floats")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtOffsetOffsetNotFloat32Vector) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtOffset %f32_input %f64vec2_01 +)"; + + CompileSuccessfully( + GenerateShaderCode(body, "OpCapability InterpolationFunction\n")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtOffset: " + "expected Offset to be a vector of 2 32-bit floats")); +} + +TEST_F(ValidateExtInst, GlslStd450InterpolateAtOffsetWrongExecutionModel) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst InterpolateAtOffset %f32_input %f32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode( + body, "OpCapability InterpolationFunction\n", "Vertex")); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("GLSL.std.450 InterpolateAtOffset requires " + "Fragment execution model")); +} + +TEST_P(ValidateOpenCLStdSqrtLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name << " %f32_0\n"; + ss << "%val2 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %f32vec2_01\n"; + ss << "%val3 = OpExtInst %f32vec4 %extinst " << ext_inst_name + << " %f32vec4_0123\n"; + ss << "%val4 = OpExtInst %f64 %extinst " << ext_inst_name << " %f64_0\n"; + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdSqrtLike, IntResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + " %f32_0\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected Result Type to be a float scalar " + "or vector type")); +} + +TEST_P(ValidateOpenCLStdSqrtLike, IntOperand) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + " %u32_0\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to " + "Result Type")); +} + +INSTANTIATE_TEST_CASE_P( + AllSqrtLike, ValidateOpenCLStdSqrtLike, + ::testing::ValuesIn(std::vector{ + "acos", "acosh", "acospi", "asin", + "asinh", "asinpi", "atan", "atanh", + "atanpi", "cbrt", "ceil", "cos", + "cosh", "cospi", "erfc", "erf", + "exp", "exp2", "exp10", "expm1", + "fabs", "floor", "log", "log2", + "log10", "log1p", "logb", "rint", + "round", "rsqrt", "sin", "sinh", + "sinpi", "sqrt", "tan", "tanh", + "tanpi", "tgamma", "trunc", "half_cos", + "half_exp", "half_exp2", "half_exp10", "half_log", + "half_log2", "half_log10", "half_recip", "half_rsqrt", + "half_sin", "half_sqrt", "half_tan", "lgamma", + "native_cos", "native_exp", "native_exp2", "native_exp10", + "native_log", "native_log2", "native_log10", "native_recip", + "native_rsqrt", "native_sin", "native_sqrt", "native_tan", + "degrees", "radians", "sign", + }), ); + +TEST_P(ValidateOpenCLStdFMinLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32_0 %f32_1\n"; + ss << "%val2 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %f32vec2_01 %f32vec2_12\n"; + ss << "%val3 = OpExtInst %f64 %extinst " << ext_inst_name + << " %f64_0 %f64_0\n"; + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdFMinLike, IntResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + " %f32_0 %f32_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected Result Type to be a float scalar " + "or vector type")); +} + +TEST_P(ValidateOpenCLStdFMinLike, IntOperand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + " %u32_0 %f32_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to " + "Result Type")); +} + +TEST_P(ValidateOpenCLStdFMinLike, IntOperand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + " %f32_0 %u32_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to " + "Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllFMinLike, ValidateOpenCLStdFMinLike, + ::testing::ValuesIn(std::vector{ + "atan2", "atan2pi", "copysign", + "fdim", "fmax", "fmin", + "fmod", "maxmag", "minmag", + "hypot", "nextafter", "pow", + "powr", "remainder", "half_divide", + "half_powr", "native_divide", "native_powr", + "step", "fmax_common", "fmin_common", + }), ); + +TEST_P(ValidateOpenCLStdFClampLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32_0 %f32_1 %f32_2\n"; + ss << "%val2 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %f32vec2_01 %f32vec2_01 %f32vec2_12\n"; + ss << "%val3 = OpExtInst %f64 %extinst " << ext_inst_name + << " %f64_0 %f64_0 %f64_1\n"; + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdFClampLike, IntResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + + " %f32_0 %f32_1 %f32_2\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected Result Type to be a float scalar " + "or vector type")); +} + +TEST_P(ValidateOpenCLStdFClampLike, IntOperand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + + " %u32_0 %f32_0 %f32_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to " + "Result Type")); +} + +TEST_P(ValidateOpenCLStdFClampLike, IntOperand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + + " %f32_0 %u32_0 %f32_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to " + "Result Type")); +} + +TEST_P(ValidateOpenCLStdFClampLike, IntOperand3) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + + " %f32_1 %f32_0 %u32_2\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to " + "Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllFClampLike, ValidateOpenCLStdFClampLike, + ::testing::ValuesIn(std::vector{ + "fma", + "mad", + "fclamp", + "mix", + "smoothstep", + }), ); + +TEST_P(ValidateOpenCLStdSAbsLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %u32 %extinst " << ext_inst_name << " %u32_1\n"; + ss << "%val2 = OpExtInst %u32 %extinst " << ext_inst_name << " %u32_1\n"; + ss << "%val3 = OpExtInst %u32 %extinst " << ext_inst_name << " %u32_1\n"; + ss << "%val4 = OpExtInst %u32 %extinst " << ext_inst_name << " %u32_1\n"; + ss << "%val5 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01\n"; + ss << "%val6 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01\n"; + ss << "%val7 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01\n"; + ss << "%val8 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01\n"; + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdSAbsLike, FloatResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + " %u32_0\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected Result Type to be an int scalar " + "or vector type")); +} + +TEST_P(ValidateOpenCLStdSAbsLike, FloatOperand) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + " %f32_0\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdSAbsLike, U64Operand) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + " %u64_0\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllSAbsLike, ValidateOpenCLStdSAbsLike, + ::testing::ValuesIn(std::vector{ + "s_abs", + "clz", + "ctz", + "popcount", + "u_abs", + }), ); + +TEST_P(ValidateOpenCLStdUMinLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u32_1 %u32_2\n"; + ss << "%val2 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u32_1 %u32_2\n"; + ss << "%val3 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u32_1 %u32_2\n"; + ss << "%val4 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u32_1 %u32_2\n"; + ss << "%val5 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %u32vec2_01\n"; + ss << "%val6 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %u32vec2_01\n"; + ss << "%val7 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %u32vec2_01\n"; + ss << "%val8 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %u32vec2_01\n"; + ss << "%val9 = OpExtInst %u64 %extinst " << ext_inst_name + << " %u64_1 %u64_0\n"; + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdUMinLike, FloatResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + " %u32_0 %u32_0\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected Result Type to be an int scalar " + "or vector type")); +} + +TEST_P(ValidateOpenCLStdUMinLike, FloatOperand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + " %f32_0 %u32_0\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdUMinLike, FloatOperand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + " %u32_0 %f32_0\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdUMinLike, U64Operand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + " %u64_0 %u32_0\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdUMinLike, U64Operand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + " %u32_0 %u64_0\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllUMinLike, ValidateOpenCLStdUMinLike, + ::testing::ValuesIn(std::vector{ + "s_max", + "u_max", + "s_min", + "u_min", + "s_abs_diff", + "s_add_sat", + "u_add_sat", + "s_mul_hi", + "rotate", + "s_sub_sat", + "u_sub_sat", + "s_hadd", + "u_hadd", + "s_rhadd", + "u_rhadd", + "u_abs_diff", + "u_mul_hi", + }), ); + +TEST_P(ValidateOpenCLStdUClampLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u32_0 %u32_1 %u32_2\n"; + ss << "%val2 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u32_0 %u32_1 %u32_2\n"; + ss << "%val3 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u32_0 %u32_1 %u32_2\n"; + ss << "%val4 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u32_0 %u32_1 %u32_2\n"; + ss << "%val5 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %u32vec2_01 %u32vec2_12\n"; + ss << "%val6 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %u32vec2_01 %u32vec2_12\n"; + ss << "%val7 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %u32vec2_01 %u32vec2_12\n"; + ss << "%val8 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %u32vec2_01 %u32vec2_12\n"; + ss << "%val9 = OpExtInst %u64 %extinst " << ext_inst_name + << " %u64_1 %u64_0 %u64_1\n"; + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdUClampLike, FloatResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + + " %u32_0 %u32_0 %u32_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected Result Type to be an int scalar " + "or vector type")); +} + +TEST_P(ValidateOpenCLStdUClampLike, FloatOperand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + + " %f32_0 %u32_0 %u32_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdUClampLike, FloatOperand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + + " %u32_0 %f32_0 %u32_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdUClampLike, FloatOperand3) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + + " %u32_0 %u32_0 %f32_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdUClampLike, U64Operand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + + " %f32_0 %u32_0 %u64_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdUClampLike, U64Operand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + + " %u32_0 %f32_0 %u64_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdUClampLike, U64Operand3) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + + " %u32_0 %u32_0 %u64_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllUClampLike, ValidateOpenCLStdUClampLike, + ::testing::ValuesIn(std::vector{ + "s_clamp", + "u_clamp", + "s_mad_hi", + "u_mad_sat", + "s_mad_sat", + "u_mad_hi", + }), ); + +// ------------------------------------------------------------- +TEST_P(ValidateOpenCLStdUMul24Like, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u32_1 %u32_2\n"; + ss << "%val2 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u32_1 %u32_2\n"; + ss << "%val3 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u32_1 %u32_2\n"; + ss << "%val4 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u32_1 %u32_2\n"; + ss << "%val5 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %u32vec2_01\n"; + ss << "%val6 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %u32vec2_01\n"; + ss << "%val7 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %u32vec2_01\n"; + ss << "%val8 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %u32vec2_01\n"; + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdUMul24Like, FloatResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + " %u32_0 %u32_0\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std " + ext_inst_name + + ": expected Result Type to be a 32-bit int scalar or vector type")); +} + +TEST_P(ValidateOpenCLStdUMul24Like, U64ResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u64 %extinst " + ext_inst_name + " %u64_0 %u64\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std " + ext_inst_name + + ": expected Result Type to be a 32-bit int scalar or vector type")); +} + +TEST_P(ValidateOpenCLStdUMul24Like, FloatOperand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + " %f32_0 %u32_0\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdUMul24Like, FloatOperand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + " %u32_0 %f32_0\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdUMul24Like, U64Operand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + " %u64_0 %u32_0\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdUMul24Like, U64Operand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + " %u32_0 %u64_0\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllUMul24Like, ValidateOpenCLStdUMul24Like, + ::testing::ValuesIn(std::vector{ + "s_mul24", + "u_mul24", + }), ); + +TEST_P(ValidateOpenCLStdUMad24Like, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u32_0 %u32_1 %u32_2\n"; + ss << "%val2 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u32_0 %u32_1 %u32_2\n"; + ss << "%val3 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u32_0 %u32_1 %u32_2\n"; + ss << "%val4 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u32_0 %u32_1 %u32_2\n"; + ss << "%val5 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %u32vec2_01 %u32vec2_12\n"; + ss << "%val6 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %u32vec2_01 %u32vec2_12\n"; + ss << "%val7 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %u32vec2_01 %u32vec2_12\n"; + ss << "%val8 = OpExtInst %u32vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %u32vec2_01 %u32vec2_12\n"; + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdUMad24Like, FloatResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + + " %u32_0 %u32_0 %u32_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std " + ext_inst_name + + ": expected Result Type to be a 32-bit int scalar or vector type")); +} + +TEST_P(ValidateOpenCLStdUMad24Like, U64ResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %u64 %extinst " + ext_inst_name + + " %u64_0 %u64_0 %u64_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std " + ext_inst_name + + ": expected Result Type to be a 32-bit int scalar or vector type")); +} + +TEST_P(ValidateOpenCLStdUMad24Like, FloatOperand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + + " %f32_0 %u32_0 %u32_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdUMad24Like, FloatOperand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + + " %u32_0 %f32_0 %u32_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdUMad24Like, FloatOperand3) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + + " %u32_0 %u32_0 %f32_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdUMad24Like, U64Operand1) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + + " %f32_0 %u32_0 %u64_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdUMad24Like, U64Operand2) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + + " %u32_0 %f32_0 %u64_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdUMad24Like, U64Operand3) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + + " %u32_0 %u32_0 %u64_1\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected types of all operands to be equal to Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllUMad24Like, ValidateOpenCLStdUMad24Like, + ::testing::ValuesIn(std::vector{ + "s_mad24", + "u_mad24", + }), ); + +TEST_F(ValidateExtInst, OpenCLStdCrossSuccess) { + const std::string body = R"( +%val1 = OpExtInst %f32vec3 %extinst cross %f32vec3_012 %f32vec3_123 +%val2 = OpExtInst %f32vec4 %extinst cross %f32vec4_0123 %f32vec4_0123 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, OpenCLStdCrossIntVectorResultType) { + const std::string body = R"( +%val1 = OpExtInst %u32vec3 %extinst cross %f32vec3_012 %f32vec3_123 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std cross: " + "expected Result Type to be a float vector type")); +} + +TEST_F(ValidateExtInst, OpenCLStdCrossResultTypeWrongSize) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst cross %f32vec3_012 %f32vec3_123 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std cross: " + "expected Result Type to have 3 or 4 components")); +} + +TEST_F(ValidateExtInst, OpenCLStdCrossXWrongType) { + const std::string body = R"( +%val1 = OpExtInst %f32vec3 %extinst cross %f64vec3_012 %f32vec3_123 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std cross: " + "expected operand X type to be equal to Result Type")); +} + +TEST_F(ValidateExtInst, OpenCLStdCrossYWrongType) { + const std::string body = R"( +%val1 = OpExtInst %f32vec3 %extinst cross %f32vec3_123 %f64vec3_012 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std cross: " + "expected operand Y type to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdLengthLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name << " %f32vec2_01\n"; + ss << "%val2 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32vec4_0123\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdLengthLike, IntResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + " %f32vec2_01\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": " + "expected Result Type to be a float scalar type")); +} + +TEST_P(ValidateOpenCLStdLengthLike, IntX) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + " %u32vec2_01\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": " + "expected operand P to be a float scalar or vector")); +} + +TEST_P(ValidateOpenCLStdLengthLike, VectorTooBig) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + + " %f32vec8_01010101\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": " + "expected operand P to have no more than 4 components")); +} + +TEST_P(ValidateOpenCLStdLengthLike, DifferentType) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f64 %extinst " + ext_inst_name + " %f32vec2_01\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": " + "expected operand P component type to be equal to " + "Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllLengthLike, ValidateOpenCLStdLengthLike, + ::testing::ValuesIn(std::vector{ + "length", + "fast_length", + }), ); + +TEST_P(ValidateOpenCLStdDistanceLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32vec2_01 %f32vec2_01\n"; + ss << "%val2 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32vec4_0123 %f32vec4_1234\n"; + ss << "%val3 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32_0 %f32_1\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdDistanceLike, IntResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + + " %f32vec2_01 %f32vec2_12\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": " + "expected Result Type to be a float scalar type")); +} + +TEST_P(ValidateOpenCLStdDistanceLike, IntP0) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + + " %u32vec2_01 %f32vec2_12\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": " + "expected operand P0 to be of float scalar or vector type")); +} + +TEST_P(ValidateOpenCLStdDistanceLike, VectorTooBig) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + + " %f32vec8_01010101 %f32vec8_01010101\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": " + "expected operand P0 to have no more than 4 components")); +} + +TEST_P(ValidateOpenCLStdDistanceLike, F64P0) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %f32 %extinst " + ext_inst_name + + " %f64vec2_01 %f32vec2_12\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std " + ext_inst_name + + ": " + "expected operand P0 component type to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdDistanceLike, DifferentOperands) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %f64 %extinst " + ext_inst_name + + " %f64vec2_01 %f32vec2_12\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": " + "expected operands P0 and P1 to be of the same type")); +} + +INSTANTIATE_TEST_CASE_P(AllDistanceLike, ValidateOpenCLStdDistanceLike, + ::testing::ValuesIn(std::vector{ + "distance", + "fast_distance", + }), ); + +TEST_P(ValidateOpenCLStdNormalizeLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %f32vec2_01\n"; + ss << "%val2 = OpExtInst %f32vec4 %extinst " << ext_inst_name + << " %f32vec4_0123\n"; + ss << "%val3 = OpExtInst %f32 %extinst " << ext_inst_name << " %f32_2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdNormalizeLike, IntResultType) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %u32 %extinst " + ext_inst_name + " %f32_2\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": " + "expected Result Type to be a float scalar or vector type")); +} + +TEST_P(ValidateOpenCLStdNormalizeLike, VectorTooBig) { + const std::string ext_inst_name = GetParam(); + const std::string body = "%val1 = OpExtInst %f32vec8 %extinst " + + ext_inst_name + " %f32vec8_01010101\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": " + "expected Result Type to have no more than 4 components")); +} + +TEST_P(ValidateOpenCLStdNormalizeLike, DifferentType) { + const std::string ext_inst_name = GetParam(); + const std::string body = + "%val1 = OpExtInst %f64vec2 %extinst " + ext_inst_name + " %f32vec2_01\n"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": " + "expected operand P type to be equal to Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllNormalizeLike, ValidateOpenCLStdNormalizeLike, + ::testing::ValuesIn(std::vector{ + "normalize", + "fast_normalize", + }), ); + +TEST_F(ValidateExtInst, OpenCLStdBitselectSuccess) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst bitselect %f32_2 %f32_1 %f32_1 +%val2 = OpExtInst %f32vec4 %extinst bitselect %f32vec4_0123 %f32vec4_1234 %f32vec4_0123 +%val3 = OpExtInst %u32 %extinst bitselect %u32_2 %u32_1 %u32_1 +%val4 = OpExtInst %u32vec4 %extinst bitselect %u32vec4_0123 %u32vec4_0123 %u32vec4_0123 +%val5 = OpExtInst %u64 %extinst bitselect %u64_2 %u64_1 %u64_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, OpenCLStdBitselectWrongResultType) { + const std::string body = R"( +%val3 = OpExtInst %struct_f32_f32 %extinst bitselect %u32_2 %u32_1 %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std bitselect: " + "expected Result Type to be an int or float scalar or vector type")); +} + +TEST_F(ValidateExtInst, OpenCLStdBitselectAWrongType) { + const std::string body = R"( +%val3 = OpExtInst %u32 %extinst bitselect %f32_2 %u32_1 %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std bitselect: " + "expected types of all operands to be equal to Result Type")); +} + +TEST_F(ValidateExtInst, OpenCLStdBitselectBWrongType) { + const std::string body = R"( +%val3 = OpExtInst %u32 %extinst bitselect %u32_2 %f32_1 %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std bitselect: " + "expected types of all operands to be equal to Result Type")); +} + +TEST_F(ValidateExtInst, OpenCLStdBitselectCWrongType) { + const std::string body = R"( +%val3 = OpExtInst %u32 %extinst bitselect %u32_2 %u32_1 %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std bitselect: " + "expected types of all operands to be equal to Result Type")); +} + +TEST_F(ValidateExtInst, OpenCLStdSelectSuccess) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst select %f32_2 %f32_1 %u32_1 +%val2 = OpExtInst %f32vec4 %extinst select %f32vec4_0123 %f32vec4_1234 %u32vec4_0123 +%val3 = OpExtInst %u32 %extinst select %u32_2 %u32_1 %u32_1 +%val4 = OpExtInst %u32vec4 %extinst select %u32vec4_0123 %u32vec4_0123 %u32vec4_0123 +%val5 = OpExtInst %u64 %extinst select %u64_2 %u64_1 %u64_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, OpenCLStdSelectWrongResultType) { + const std::string body = R"( +%val3 = OpExtInst %struct_f32_f32 %extinst select %u32_2 %u32_1 %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std select: " + "expected Result Type to be an int or float scalar or vector type")); +} + +TEST_F(ValidateExtInst, OpenCLStdSelectAWrongType) { + const std::string body = R"( +%val3 = OpExtInst %u32 %extinst select %f32_2 %u32_1 %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std select: " + "expected operand A type to be equal to Result Type")); +} + +TEST_F(ValidateExtInst, OpenCLStdSelectBWrongType) { + const std::string body = R"( +%val3 = OpExtInst %u32 %extinst select %u32_2 %f32_1 %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std select: " + "expected operand B type to be equal to Result Type")); +} + +TEST_F(ValidateExtInst, OpenCLStdSelectCWrongType) { + const std::string body = R"( +%val3 = OpExtInst %f32 %extinst select %f32_2 %f32_1 %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std select: " + "expected operand C to be an int scalar or vector")); +} + +TEST_F(ValidateExtInst, OpenCLStdSelectCWrongComponentNumber) { + const std::string body = R"( +%val3 = OpExtInst %f32vec2 %extinst select %f32vec2_12 %f32vec2_01 %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std select: " + "expected operand C to have the same number of " + "components as Result Type")); +} + +TEST_F(ValidateExtInst, OpenCLStdSelectCWrongBitWidth) { + const std::string body = R"( +%val3 = OpExtInst %f32vec2 %extinst select %f32vec2_12 %f32vec2_01 %u64vec2_01 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std select: " + "expected operand C to have the same bit width as Result Type")); +} + +TEST_P(ValidateOpenCLStdVStoreHalfLike, SuccessPhysical32) { + const std::string ext_inst_name = GetParam(); + const std::string rounding_mode = + ext_inst_name.substr(ext_inst_name.length() - 2) == "_r" ? " RTE" : ""; + + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_workgroup %f16vec8_workgroup %u32_1\n"; + if (std::string::npos == ext_inst_name.find("halfn")) { + ss << "%val1 = OpExtInst %void %extinst " << ext_inst_name + << " %f32_1 %u32_1 %ptr" << rounding_mode << "\n"; + ss << "%val2 = OpExtInst %void %extinst " << ext_inst_name + << " %f64_0 %u32_2 %ptr" << rounding_mode << "\n"; + } else { + ss << "%val1 = OpExtInst %void %extinst " << ext_inst_name + << " %f32vec2_01 %u32_1 %ptr" << rounding_mode << "\n"; + ss << "%val2 = OpExtInst %void %extinst " << ext_inst_name + << " %f32vec4_0123 %u32_0 %ptr" << rounding_mode << "\n"; + ss << "%val3 = OpExtInst %void %extinst " << ext_inst_name + << " %f64vec2_01 %u32_2 %ptr" << rounding_mode << "\n"; + } + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdVStoreHalfLike, SuccessPhysical64) { + const std::string ext_inst_name = GetParam(); + const std::string rounding_mode = + ext_inst_name.substr(ext_inst_name.length() - 2) == "_r" ? " RTE" : ""; + + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_workgroup %f16vec8_workgroup %u32_1\n"; + if (std::string::npos == ext_inst_name.find("halfn")) { + ss << "%val1 = OpExtInst %void %extinst " << ext_inst_name + << " %f32_1 %u64_1 %ptr" << rounding_mode << "\n"; + ss << "%val2 = OpExtInst %void %extinst " << ext_inst_name + << " %f64_0 %u64_2 %ptr" << rounding_mode << "\n"; + } else { + ss << "%val1 = OpExtInst %void %extinst " << ext_inst_name + << " %f32vec2_01 %u64_1 %ptr" << rounding_mode << "\n"; + ss << "%val2 = OpExtInst %void %extinst " << ext_inst_name + << " %f32vec4_0123 %u64_0 %ptr" << rounding_mode << "\n"; + ss << "%val3 = OpExtInst %void %extinst " << ext_inst_name + << " %f64vec2_01 %u64_2 %ptr" << rounding_mode << "\n"; + } + + CompileSuccessfully(GenerateKernelCode(ss.str(), "", "Physical64")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdVStoreHalfLike, NonVoidResultType) { + const std::string ext_inst_name = GetParam(); + const std::string rounding_mode = + ext_inst_name.substr(ext_inst_name.length() - 2) == "_r" ? " RTE" : ""; + + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_workgroup %f16vec8_workgroup %u32_1\n"; + if (std::string::npos == ext_inst_name.find("halfn")) { + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32_1 %u32_1 %ptr" << rounding_mode << "\n"; + } else { + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32vec2_01 %u32_1 %ptr" << rounding_mode << "\n"; + } + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected Result Type to be void")); +} + +TEST_P(ValidateOpenCLStdVStoreHalfLike, WrongDataType) { + const std::string ext_inst_name = GetParam(); + const std::string rounding_mode = + ext_inst_name.substr(ext_inst_name.length() - 2) == "_r" ? " RTE" : ""; + + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_workgroup %f16vec8_workgroup %u32_1\n"; + if (std::string::npos == ext_inst_name.find("halfn")) { + ss << "%val1 = OpExtInst %void %extinst " << ext_inst_name + << " %f64vec2_01 %u32_1 %ptr" << rounding_mode << "\n"; + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected Data to be a 32 or 64-bit float scalar")); + } else { + ss << "%val1 = OpExtInst %void %extinst " << ext_inst_name + << " %f64_0 %u32_1 %ptr" << rounding_mode << "\n"; + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected Data to be a 32 or 64-bit float vector")); + } +} + +TEST_P(ValidateOpenCLStdVStoreHalfLike, AddressingModelLogical) { + const std::string ext_inst_name = GetParam(); + const std::string rounding_mode = + ext_inst_name.substr(ext_inst_name.length() - 2) == "_r" ? " RTE" : ""; + + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_workgroup %f16vec8_workgroup %u32_1\n"; + if (std::string::npos == ext_inst_name.find("halfn")) { + ss << "%val1 = OpExtInst %void %extinst " << ext_inst_name + << " %f32_0 %u32_1 %ptr" << rounding_mode << "\n"; + } else { + ss << "%val1 = OpExtInst %void %extinst " << ext_inst_name + << " %f32vec2_01 %u32_1 %ptr" << rounding_mode << "\n"; + } + + CompileSuccessfully(GenerateKernelCode(ss.str(), "", "Logical")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + " can only be used with physical addressing models")); +} + +TEST_P(ValidateOpenCLStdVStoreHalfLike, OffsetNotSizeT) { + const std::string ext_inst_name = GetParam(); + const std::string rounding_mode = + ext_inst_name.substr(ext_inst_name.length() - 2) == "_r" ? " RTE" : ""; + + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_workgroup %f16vec8_workgroup %u32_1\n"; + if (std::string::npos == ext_inst_name.find("halfn")) { + ss << "%val1 = OpExtInst %void %extinst " << ext_inst_name + << " %f32_0 %u32_1 %ptr" << rounding_mode << "\n"; + } else { + ss << "%val1 = OpExtInst %void %extinst " << ext_inst_name + << " %f32vec2_01 %u32_1 %ptr" << rounding_mode << "\n"; + } + + CompileSuccessfully(GenerateKernelCode(ss.str(), "", "Physical64")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": " + "expected operand Offset to be of type size_t (64-bit integer " + "for the addressing model used in the module)")); +} + +TEST_P(ValidateOpenCLStdVStoreHalfLike, PNotPointer) { + const std::string ext_inst_name = GetParam(); + const std::string rounding_mode = + ext_inst_name.substr(ext_inst_name.length() - 2) == "_r" ? " RTE" : ""; + + std::ostringstream ss; + if (std::string::npos == ext_inst_name.find("halfn")) { + ss << "%val1 = OpExtInst %void %extinst " << ext_inst_name + << " %f32_0 %u32_1 %f16_ptr_workgroup" << rounding_mode << "\n"; + } else { + ss << "%val1 = OpExtInst %void %extinst " << ext_inst_name + << " %f32vec2_01 %u32_1 %f16_ptr_workgroup" << rounding_mode << "\n"; + } + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected operand P to be a pointer")); +} + +TEST_P(ValidateOpenCLStdVStoreHalfLike, ConstPointer) { + const std::string ext_inst_name = GetParam(); + const std::string rounding_mode = + ext_inst_name.substr(ext_inst_name.length() - 2) == "_r" ? " RTE" : ""; + + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_uniform_constant " + "%f16vec8_uniform_constant %u32_1\n"; + if (std::string::npos == ext_inst_name.find("halfn")) { + ss << "%val1 = OpExtInst %void %extinst " << ext_inst_name + << " %f32_0 %u32_1 %ptr" << rounding_mode << "\n"; + } else { + ss << "%val1 = OpExtInst %void %extinst " << ext_inst_name + << " %f32vec2_01 %u32_1 %ptr" << rounding_mode << "\n"; + } + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected operand P storage class to be Generic, " + "CrossWorkgroup, Workgroup or Function")); +} + +TEST_P(ValidateOpenCLStdVStoreHalfLike, PDataTypeInt) { + const std::string ext_inst_name = GetParam(); + const std::string rounding_mode = + ext_inst_name.substr(ext_inst_name.length() - 2) == "_r" ? " RTE" : ""; + + std::ostringstream ss; + ss << "%ptr = OpAccessChain %u32_ptr_workgroup %u32vec8_workgroup %u32_1\n"; + if (std::string::npos == ext_inst_name.find("halfn")) { + ss << "%val1 = OpExtInst %void %extinst " << ext_inst_name + << " %f32_0 %u32_1 %ptr" << rounding_mode << "\n"; + } else { + ss << "%val1 = OpExtInst %void %extinst " << ext_inst_name + << " %f32vec2_01 %u32_1 %ptr" << rounding_mode << "\n"; + } + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected operand P data type to be 16-bit float scalar")); +} + +TEST_P(ValidateOpenCLStdVStoreHalfLike, PDataTypeFloat32) { + const std::string ext_inst_name = GetParam(); + const std::string rounding_mode = + ext_inst_name.substr(ext_inst_name.length() - 2) == "_r" ? " RTE" : ""; + + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f32_ptr_workgroup %f32vec8_workgroup %u32_1\n"; + if (std::string::npos == ext_inst_name.find("halfn")) { + ss << "%val1 = OpExtInst %void %extinst " << ext_inst_name + << " %f32_0 %u32_1 %ptr" << rounding_mode << "\n"; + } else { + ss << "%val1 = OpExtInst %void %extinst " << ext_inst_name + << " %f32vec2_01 %u32_1 %ptr" << rounding_mode << "\n"; + } + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected operand P data type to be 16-bit float scalar")); +} + +INSTANTIATE_TEST_CASE_P(AllVStoreHalfLike, ValidateOpenCLStdVStoreHalfLike, + ::testing::ValuesIn(std::vector{ + "vstore_half", + "vstore_half_r", + "vstore_halfn", + "vstore_halfn_r", + "vstorea_halfn", + "vstorea_halfn_r", + }), ); + +TEST_P(ValidateOpenCLStdVLoadHalfLike, SuccessPhysical32) { + const std::string ext_inst_name = GetParam(); + + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_workgroup %f16vec8_workgroup %u32_1\n"; + ss << "%val1 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %u32_1 %ptr 2\n"; + ss << "%val2 = OpExtInst %f32vec3 %extinst " << ext_inst_name + << " %u32_1 %ptr 3\n"; + ss << "%val3 = OpExtInst %f32vec4 %extinst " << ext_inst_name + << " %u32_1 %ptr 4\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdVLoadHalfLike, SuccessPhysical64) { + const std::string ext_inst_name = GetParam(); + + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_workgroup %f16vec8_workgroup %u32_1\n"; + ss << "%val1 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %u64_1 %ptr 2\n"; + ss << "%val2 = OpExtInst %f32vec3 %extinst " << ext_inst_name + << " %u64_1 %ptr 3\n"; + ss << "%val3 = OpExtInst %f32vec4 %extinst " << ext_inst_name + << " %u64_1 %ptr 4\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str(), "", "Physical64")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdVLoadHalfLike, ResultTypeNotFloatVector) { + const std::string ext_inst_name = GetParam(); + + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_workgroup %f16vec8_workgroup %u32_1\n"; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %u32_1 %ptr 1\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected Result Type to be a float vector type")); +} + +TEST_P(ValidateOpenCLStdVLoadHalfLike, AddressingModelLogical) { + const std::string ext_inst_name = GetParam(); + + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_workgroup %f16vec8_workgroup %u32_1\n"; + ss << "%val1 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %u32_1 %ptr 2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str(), "", "Logical")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + " can only be used with physical addressing models")); +} + +TEST_P(ValidateOpenCLStdVLoadHalfLike, OffsetNotSizeT) { + const std::string ext_inst_name = GetParam(); + + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_workgroup %f16vec8_workgroup %u32_1\n"; + ss << "%val1 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %u64_1 %ptr 2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected operand Offset to be of type size_t (32-bit " + "integer for the addressing model used in the module)")); +} + +TEST_P(ValidateOpenCLStdVLoadHalfLike, PNotPointer) { + const std::string ext_inst_name = GetParam(); + + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %u32_1 %f16_ptr_workgroup 2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected operand P to be a pointer")); +} + +TEST_P(ValidateOpenCLStdVLoadHalfLike, OffsetWrongStorageType) { + const std::string ext_inst_name = GetParam(); + + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_input %f16vec8_input %u32_1\n"; + ss << "%val1 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %u32_1 %ptr 2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected operand P storage class to be UniformConstant, " + "Generic, CrossWorkgroup, Workgroup or Function")); +} + +TEST_P(ValidateOpenCLStdVLoadHalfLike, PDataTypeInt) { + const std::string ext_inst_name = GetParam(); + + std::ostringstream ss; + ss << "%ptr = OpAccessChain %u32_ptr_workgroup %u32vec8_workgroup %u32_1\n"; + ss << "%val1 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %u32_1 %ptr 2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected operand P data type to be 16-bit float scalar")); +} + +TEST_P(ValidateOpenCLStdVLoadHalfLike, PDataTypeFloat32) { + const std::string ext_inst_name = GetParam(); + + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f32_ptr_workgroup %f32vec8_workgroup %u32_1\n"; + ss << "%val1 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %u32_1 %ptr 2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected operand P data type to be 16-bit float scalar")); +} + +TEST_P(ValidateOpenCLStdVLoadHalfLike, WrongN) { + const std::string ext_inst_name = GetParam(); + + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_workgroup %f16vec8_workgroup %u32_1\n"; + ss << "%val1 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %u32_1 %ptr 3\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected literal N to be equal to the number of " + "components of Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllVLoadHalfLike, ValidateOpenCLStdVLoadHalfLike, + ::testing::ValuesIn(std::vector{ + "vload_halfn", + "vloada_halfn", + }), ); + +TEST_F(ValidateExtInst, VLoadNSuccessFloatPhysical32) { + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f32_ptr_uniform_constant " + "%f32vec8_uniform_constant %u32_1\n"; + ss << "%val1 = OpExtInst %f32vec2 %extinst vloadn %u32_1 %ptr 2\n"; + ss << "%val2 = OpExtInst %f32vec3 %extinst vloadn %u32_1 %ptr 3\n"; + ss << "%val3 = OpExtInst %f32vec4 %extinst vloadn %u32_1 %ptr 4\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, VLoadNSuccessIntPhysical32) { + std::ostringstream ss; + ss << "%ptr = OpAccessChain %u32_ptr_uniform_constant " + "%u32vec8_uniform_constant %u32_1\n"; + ss << "%val1 = OpExtInst %u32vec2 %extinst vloadn %u32_1 %ptr 2\n"; + ss << "%val2 = OpExtInst %u32vec3 %extinst vloadn %u32_1 %ptr 3\n"; + ss << "%val3 = OpExtInst %u32vec4 %extinst vloadn %u32_1 %ptr 4\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, VLoadNSuccessFloatPhysical64) { + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f32_ptr_uniform_constant " + "%f32vec8_uniform_constant %u32_1\n"; + ss << "%val1 = OpExtInst %f32vec2 %extinst vloadn %u64_1 %ptr 2\n"; + ss << "%val2 = OpExtInst %f32vec3 %extinst vloadn %u64_1 %ptr 3\n"; + ss << "%val3 = OpExtInst %f32vec4 %extinst vloadn %u64_1 %ptr 4\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str(), "", "Physical64")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, VLoadNSuccessIntPhysical64) { + std::ostringstream ss; + ss << "%ptr = OpAccessChain %u32_ptr_uniform_constant " + "%u32vec8_uniform_constant %u32_1\n"; + ss << "%val1 = OpExtInst %u32vec2 %extinst vloadn %u64_1 %ptr 2\n"; + ss << "%val2 = OpExtInst %u32vec3 %extinst vloadn %u64_1 %ptr 3\n"; + ss << "%val3 = OpExtInst %u32vec4 %extinst vloadn %u64_1 %ptr 4\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str(), "", "Physical64")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, VLoadNWrongResultType) { + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f32_ptr_uniform_constant " + "%f32vec8_uniform_constant %u32_1\n"; + ss << "%val1 = OpExtInst %f32 %extinst vloadn %u32_1 %ptr 2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std vloadn: " + "expected Result Type to be an int or float vector type")); +} + +TEST_F(ValidateExtInst, VLoadNAddressingModelLogical) { + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f32_ptr_uniform_constant " + "%f32vec8_uniform_constant %u32_1\n"; + ss << "%val1 = OpExtInst %f32vec2 %extinst vloadn %u32_1 %ptr 2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str(), "", "Logical")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std vloadn can only be used with physical " + "addressing models")); +} + +TEST_F(ValidateExtInst, VLoadNOffsetNotSizeT) { + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f32_ptr_uniform_constant " + "%f32vec8_uniform_constant %u32_1\n"; + ss << "%val1 = OpExtInst %f32vec2 %extinst vloadn %u64_1 %ptr 2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std vloadn: expected operand Offset to be of type size_t " + "(32-bit integer for the addressing model used in the module)")); +} + +TEST_F(ValidateExtInst, VLoadNPNotPointer) { + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32vec2 %extinst vloadn %u32_1 " + "%f32_ptr_uniform_constant 2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std vloadn: expected operand P to be a pointer")); +} + +TEST_F(ValidateExtInst, VLoadNWrongStorageClass) { + std::ostringstream ss; + ss << "%ptr = OpAccessChain %u32_ptr_workgroup %u32vec8_workgroup %u32_1\n"; + ss << "%val1 = OpExtInst %u32vec2 %extinst vloadn %u32_1 %ptr 2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std vloadn: expected operand P storage class " + "to be UniformConstant or Generic")); +} + +TEST_F(ValidateExtInst, VLoadNWrongComponentType) { + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f32_ptr_uniform_constant " + "%f32vec8_uniform_constant %u32_1\n"; + ss << "%val1 = OpExtInst %u32vec2 %extinst vloadn %u32_1 %ptr 2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std vloadn: expected operand P data type to be " + "equal to component type of Result Type")); +} + +TEST_F(ValidateExtInst, VLoadNWrongN) { + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f32_ptr_uniform_constant " + "%f32vec8_uniform_constant %u32_1\n"; + ss << "%val1 = OpExtInst %f32vec2 %extinst vloadn %u32_1 %ptr 3\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std vloadn: expected literal N to be equal to " + "the number of components of Result Type")); +} + +TEST_F(ValidateExtInst, VLoadHalfSuccessPhysical32) { + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_uniform_constant " + "%f16vec8_uniform_constant %u32_1\n"; + ss << "%val1 = OpExtInst %f32 %extinst vload_half %u32_1 %ptr\n"; + ss << "%val2 = OpExtInst %f64 %extinst vload_half %u32_1 %ptr\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, VLoadHalfSuccessPhysical64) { + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_uniform_constant " + "%f16vec8_uniform_constant %u32_1\n"; + ss << "%val1 = OpExtInst %f32 %extinst vload_half %u64_1 %ptr\n"; + ss << "%val2 = OpExtInst %f64 %extinst vload_half %u64_1 %ptr\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str(), "", "Physical64")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, VLoadHalfWrongResultType) { + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_uniform_constant " + "%f16vec8_uniform_constant %u32_1\n"; + ss << "%val1 = OpExtInst %u32 %extinst vload_half %u32_1 %ptr\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std vload_half: " + "expected Result Type to be a float scalar type")); +} + +TEST_F(ValidateExtInst, VLoadHalfAddressingModelLogical) { + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_uniform_constant " + "%f16vec8_uniform_constant %u32_1\n"; + ss << "%val1 = OpExtInst %f32 %extinst vload_half %u32_1 %ptr\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str(), "", "Logical")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std vload_half can only be used with physical " + "addressing models")); +} + +TEST_F(ValidateExtInst, VLoadHalfOffsetNotSizeT) { + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_uniform_constant " + "%f16vec8_uniform_constant %u32_1\n"; + ss << "%val1 = OpExtInst %f32 %extinst vload_half %u64_1 %ptr\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std vload_half: expected operand Offset to be of type size_t " + "(32-bit integer for the addressing model used in the module)")); +} + +TEST_F(ValidateExtInst, VLoadHalfPNotPointer) { + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32 %extinst vload_half %u32_1 " + "%f16_ptr_uniform_constant\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std vload_half: expected operand P to be a pointer")); +} + +TEST_F(ValidateExtInst, VLoadHalfWrongStorageClass) { + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f16_ptr_input %f16vec8_input %u32_1\n"; + ss << "%val1 = OpExtInst %f32 %extinst vload_half %u32_1 %ptr\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std vload_half: expected operand P storage class to be " + "UniformConstant, Generic, CrossWorkgroup, Workgroup or Function")); +} + +TEST_F(ValidateExtInst, VLoadHalfPDataTypeInt) { + std::ostringstream ss; + ss << "%ptr = OpAccessChain %u32_ptr_uniform_constant " + "%u32vec8_uniform_constant %u32_1\n"; + ss << "%val1 = OpExtInst %f32 %extinst vload_half %u32_1 %ptr\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std vload_half: expected operand P data type " + "to be 16-bit float scalar")); +} + +TEST_F(ValidateExtInst, VLoadHalfPDataTypeFloat32) { + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f32_ptr_uniform_constant " + "%f32vec8_uniform_constant %u32_1\n"; + ss << "%val1 = OpExtInst %f32 %extinst vload_half %u32_1 %ptr\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std vload_half: expected operand P data type " + "to be 16-bit float scalar")); +} + +TEST_F(ValidateExtInst, VStoreNSuccessFloatPhysical32) { + std::ostringstream ss; + ss << "%ptr_w = OpAccessChain %f32_ptr_workgroup %f32vec8_workgroup %u32_1\n"; + ss << "%ptr_g = OpPtrCastToGeneric %f32_ptr_generic %ptr_w\n"; + ss << "%val1 = OpExtInst %void %extinst vstoren %f32vec2_01 %u32_1 %ptr_g\n"; + ss << "%val2 = OpExtInst %void %extinst vstoren %f32vec4_0123 %u32_1 " + "%ptr_g\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, VStoreNSuccessFloatPhysical64) { + std::ostringstream ss; + ss << "%ptr_w = OpAccessChain %f32_ptr_workgroup %f32vec8_workgroup %u32_1\n"; + ss << "%ptr_g = OpPtrCastToGeneric %f32_ptr_generic %ptr_w\n"; + ss << "%val1 = OpExtInst %void %extinst vstoren %f32vec2_01 %u64_1 %ptr_g\n"; + ss << "%val2 = OpExtInst %void %extinst vstoren %f32vec4_0123 %u64_1 " + "%ptr_g\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str(), "", "Physical64")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, VStoreNSuccessIntPhysical32) { + std::ostringstream ss; + ss << "%ptr_w = OpAccessChain %u32_ptr_workgroup %u32vec8_workgroup %u32_1\n"; + ss << "%ptr_g = OpPtrCastToGeneric %u32_ptr_generic %ptr_w\n"; + ss << "%val1 = OpExtInst %void %extinst vstoren %u32vec2_01 %u32_1 %ptr_g\n"; + ss << "%val2 = OpExtInst %void %extinst vstoren %u32vec4_0123 %u32_1 " + "%ptr_g\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, VStoreNSuccessIntPhysical64) { + std::ostringstream ss; + ss << "%ptr_w = OpAccessChain %u32_ptr_workgroup %u32vec8_workgroup %u32_1\n"; + ss << "%ptr_g = OpPtrCastToGeneric %u32_ptr_generic %ptr_w\n"; + ss << "%val1 = OpExtInst %void %extinst vstoren %u32vec2_01 %u64_1 %ptr_g\n"; + ss << "%val2 = OpExtInst %void %extinst vstoren %u32vec4_0123 %u64_1 " + "%ptr_g\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str(), "", "Physical64")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, VStoreNResultTypeNotVoid) { + std::ostringstream ss; + ss << "%ptr_w = OpAccessChain %f32_ptr_workgroup %f32vec8_workgroup %u32_1\n"; + ss << "%ptr_g = OpPtrCastToGeneric %f32_ptr_generic %ptr_w\n"; + ss << "%val1 = OpExtInst %f32 %extinst vstoren %f32vec2_01 %u32_1 %ptr_g\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std vstoren: expected Result Type to be void")); +} + +TEST_F(ValidateExtInst, VStoreNDataWrongType) { + std::ostringstream ss; + ss << "%ptr_w = OpAccessChain %f32_ptr_workgroup %f32vec8_workgroup %u32_1\n"; + ss << "%ptr_g = OpPtrCastToGeneric %f32_ptr_generic %ptr_w\n"; + ss << "%val1 = OpExtInst %void %extinst vstoren %f32_1 %u32_1 %ptr_g\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std vstoren: expected Data to be an int or float vector")); +} + +TEST_F(ValidateExtInst, VStoreNAddressingModelLogical) { + std::ostringstream ss; + ss << "%ptr_w = OpAccessChain %f32_ptr_workgroup %f32vec8_workgroup %u32_1\n"; + ss << "%ptr_g = OpPtrCastToGeneric %f32_ptr_generic %ptr_w\n"; + ss << "%val1 = OpExtInst %void %extinst vstoren %f32vec2_01 %u32_1 %ptr_g\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str(), "", "Logical")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std vstoren can only be used with physical " + "addressing models")); +} + +TEST_F(ValidateExtInst, VStoreNOffsetNotSizeT) { + std::ostringstream ss; + ss << "%ptr_w = OpAccessChain %f32_ptr_workgroup %f32vec8_workgroup %u32_1\n"; + ss << "%ptr_g = OpPtrCastToGeneric %f32_ptr_generic %ptr_w\n"; + ss << "%val1 = OpExtInst %void %extinst vstoren %f32vec2_01 %u32_1 %ptr_g\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str(), "", "Physical64")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std vstoren: expected operand Offset to be of type size_t " + "(64-bit integer for the addressing model used in the module)")); +} + +TEST_F(ValidateExtInst, VStoreNPNotPointer) { + std::ostringstream ss; + ss << "%val1 = OpExtInst %void %extinst vstoren %f32vec2_01 %u32_1 " + "%f32_ptr_generic\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std vstoren: expected operand P to be a pointer")); +} + +TEST_F(ValidateExtInst, VStoreNPNotGeneric) { + std::ostringstream ss; + ss << "%ptr_w = OpAccessChain %f32_ptr_workgroup %f32vec8_workgroup %u32_1\n"; + ss << "%val1 = OpExtInst %void %extinst vstoren %f32vec2_01 %u32_1 %ptr_w\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std vstoren: expected operand P storage class " + "to be Generic")); +} + +TEST_F(ValidateExtInst, VStorePWrongDataType) { + std::ostringstream ss; + ss << "%ptr_w = OpAccessChain %f32_ptr_workgroup %f32vec8_workgroup %u32_1\n"; + ss << "%ptr_g = OpPtrCastToGeneric %f32_ptr_generic %ptr_w\n"; + ss << "%val1 = OpExtInst %void %extinst vstoren %u32vec2_01 %u32_1 %ptr_g\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std vstoren: expected operand P data type to " + "be equal to the type of operand Data components")); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffleSuccess) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst shuffle %f32vec4_0123 %u32vec2_01 +%val2 = OpExtInst %f32vec4 %extinst shuffle %f32vec4_0123 %u32vec4_0123 +%val3 = OpExtInst %u32vec2 %extinst shuffle %u32vec4_0123 %u32vec2_01 +%val4 = OpExtInst %u32vec4 %extinst shuffle %u32vec4_0123 %u32vec4_0123 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffleWrongResultType) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst shuffle %f32vec4_0123 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std shuffle: " + "expected Result Type to be an int or float vector type")); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffleResultTypeInvalidNumComponents) { + const std::string body = R"( +%val1 = OpExtInst %f32vec3 %extinst shuffle %f32vec4_0123 %u32vec3_012 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std shuffle: " + "expected Result Type to have 2, 4, 8 or 16 components")); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffleXWrongType) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst shuffle %f32_0 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std shuffle: " + "expected operand X to be an int or float vector")); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffleXInvalidNumComponents) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst shuffle %f32vec3_012 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std shuffle: " + "expected operand X to have 2, 4, 8 or 16 components")); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffleXInvalidComponentType) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst shuffle %f64vec4_0123 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std shuffle: " + "expected operand X and Result Type to have equal component types")); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffleShuffleMaskNotIntVector) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst shuffle %f32vec4_0123 %f32vec2_01 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std shuffle: " + "expected operand Shuffle Mask to be an int vector")); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffleShuffleMaskInvalidNumComponents) { + const std::string body = R"( +%val1 = OpExtInst %f32vec4 %extinst shuffle %f32vec4_0123 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std shuffle: " + "expected operand Shuffle Mask to have the same number " + "of components as Result Type")); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffleShuffleMaskInvalidBitWidth) { + const std::string body = R"( +%val1 = OpExtInst %f64vec2 %extinst shuffle %f64vec4_0123 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std shuffle: " + "expected operand Shuffle Mask components to have the " + "same bit width as Result Type components")); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffle2Success) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst shuffle2 %f32vec4_0123 %f32vec4_0123 %u32vec2_01 +%val2 = OpExtInst %f32vec4 %extinst shuffle2 %f32vec4_0123 %f32vec4_0123 %u32vec4_0123 +%val3 = OpExtInst %u32vec2 %extinst shuffle2 %u32vec4_0123 %u32vec4_0123 %u32vec2_01 +%val4 = OpExtInst %u32vec4 %extinst shuffle2 %u32vec4_0123 %u32vec4_0123 %u32vec4_0123 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffle2WrongResultType) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst shuffle2 %f32vec4_0123 %f32vec4_0123 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std shuffle2: " + "expected Result Type to be an int or float vector type")); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffle2ResultTypeInvalidNumComponents) { + const std::string body = R"( +%val1 = OpExtInst %f32vec3 %extinst shuffle2 %f32vec4_0123 %f32vec4_0123 %u32vec3_012 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std shuffle2: " + "expected Result Type to have 2, 4, 8 or 16 components")); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffle2XWrongType) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst shuffle2 %f32_0 %f32_0 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std shuffle2: " + "expected operand X to be an int or float vector")); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffle2YTypeDifferentFromX) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst shuffle2 %f32vec2_01 %f32vec4_0123 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std shuffle2: " + "expected operands X and Y to be of the same type")); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffle2XInvalidNumComponents) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst shuffle2 %f32vec3_012 %f32vec3_012 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std shuffle2: " + "expected operand X to have 2, 4, 8 or 16 components")); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffle2XInvalidComponentType) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst shuffle2 %f64vec4_0123 %f64vec4_0123 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std shuffle2: " + "expected operand X and Result Type to have equal component types")); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffle2ShuffleMaskNotIntVector) { + const std::string body = R"( +%val1 = OpExtInst %f32vec2 %extinst shuffle2 %f32vec4_0123 %f32vec4_0123 %f32vec2_01 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std shuffle2: " + "expected operand Shuffle Mask to be an int vector")); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffle2ShuffleMaskInvalidNumComponents) { + const std::string body = R"( +%val1 = OpExtInst %f32vec4 %extinst shuffle2 %f32vec4_0123 %f32vec4_0123 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std shuffle2: " + "expected operand Shuffle Mask to have the same number " + "of components as Result Type")); +} + +TEST_F(ValidateExtInst, OpenCLStdShuffle2ShuffleMaskInvalidBitWidth) { + const std::string body = R"( +%val1 = OpExtInst %f64vec2 %extinst shuffle2 %f64vec4_0123 %f64vec4_0123 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std shuffle2: " + "expected operand Shuffle Mask components to have the " + "same bit width as Result Type components")); +} + +TEST_F(ValidateExtInst, OpenCLStdPrintfSuccess) { + const std::string body = R"( +%format = OpAccessChain %u8_ptr_uniform_constant %u8arr_uniform_constant %u32_0 +%val1 = OpExtInst %u32 %extinst printf %format %u32_0 %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, OpenCLStdPrintfBoolResultType) { + const std::string body = R"( +%format = OpAccessChain %u8_ptr_uniform_constant %u8arr_uniform_constant %u32_0 +%val1 = OpExtInst %bool %extinst printf %format %u32_0 %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std printf: expected Result Type to be a 32-bit int type")); +} + +TEST_F(ValidateExtInst, OpenCLStdPrintfU64ResultType) { + const std::string body = R"( +%format = OpAccessChain %u8_ptr_uniform_constant %u8arr_uniform_constant %u32_0 +%val1 = OpExtInst %u64 %extinst printf %format %u32_0 %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std printf: expected Result Type to be a 32-bit int type")); +} + +TEST_F(ValidateExtInst, OpenCLStdPrintfFormatNotPointer) { + const std::string body = R"( +%val1 = OpExtInst %u32 %extinst printf %u8_ptr_uniform_constant %u32_0 %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std printf: expected operand Format to be a pointer")); +} + +TEST_F(ValidateExtInst, OpenCLStdPrintfFormatNotUniformConstStorageClass) { + const std::string body = R"( +%format_const = OpAccessChain %u8_ptr_uniform_constant %u8arr_uniform_constant %u32_0 +%format = OpBitcast %u8_ptr_generic %format_const +%val1 = OpExtInst %u32 %extinst printf %format %u32_0 %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std printf: expected Format storage class to " + "be UniformConstant")); +} + +TEST_F(ValidateExtInst, OpenCLStdPrintfFormatNotU8Pointer) { + const std::string body = R"( +%format = OpAccessChain %u32_ptr_uniform_constant %u32vec8_uniform_constant %u32_0 +%val1 = OpExtInst %u32 %extinst printf %format %u32_0 %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std printf: expected Format data type to be 8-bit int")); +} + +TEST_F(ValidateExtInst, OpenCLStdPrefetchU32Success) { + const std::string body = R"( +%ptr = OpAccessChain %u32_ptr_cross_workgroup %u32arr_cross_workgroup %u32_0 +%val1 = OpExtInst %void %extinst prefetch %ptr %u32_256 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, OpenCLStdPrefetchU32Physical64Success) { + const std::string body = R"( +%ptr = OpAccessChain %u32_ptr_cross_workgroup %u32arr_cross_workgroup %u32_0 +%val1 = OpExtInst %void %extinst prefetch %ptr %u64_256 +)"; + + CompileSuccessfully(GenerateKernelCode(body, "", "Physical64")); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, OpenCLStdPrefetchF32Success) { + const std::string body = R"( +%ptr = OpAccessChain %f32_ptr_cross_workgroup %f32arr_cross_workgroup %u32_0 +%val1 = OpExtInst %void %extinst prefetch %ptr %u32_256 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, OpenCLStdPrefetchF32Vec2Success) { + const std::string body = R"( +%ptr = OpAccessChain %f32vec2_ptr_cross_workgroup %f32vec2arr_cross_workgroup %u32_0 +%val1 = OpExtInst %void %extinst prefetch %ptr %u32_256 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, OpenCLStdPrefetchResultTypeNotVoid) { + const std::string body = R"( +%ptr = OpAccessChain %u32_ptr_cross_workgroup %u32arr_cross_workgroup %u32_0 +%val1 = OpExtInst %u32 %extinst prefetch %ptr %u32_256 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std prefetch: expected Result Type to be void")); +} + +TEST_F(ValidateExtInst, OpenCLStdPrefetchPtrNotPointer) { + const std::string body = R"( +%val1 = OpExtInst %void %extinst prefetch %u32_ptr_cross_workgroup %u32_256 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std prefetch: expected operand Ptr to be a pointer")); +} + +TEST_F(ValidateExtInst, OpenCLStdPrefetchPtrNotCrossWorkgroup) { + const std::string body = R"( +%ptr = OpAccessChain %u8_ptr_uniform_constant %u8arr_uniform_constant %u32_0 +%val1 = OpExtInst %void %extinst prefetch %ptr %u32_256 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std prefetch: expected operand Ptr storage " + "class to be CrossWorkgroup")); +} + +TEST_F(ValidateExtInst, OpenCLStdPrefetchInvalidDataType) { + const std::string body = R"( +%ptr = OpAccessChain %struct_ptr_cross_workgroup %struct_arr_cross_workgroup %u32_0 +%val1 = OpExtInst %void %extinst prefetch %ptr %u32_256 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std prefetch: expected Ptr data type to be int " + "or float scalar or vector")); +} + +TEST_F(ValidateExtInst, OpenCLStdPrefetchAddressingModelLogical) { + const std::string body = R"( +%ptr = OpAccessChain %u32_ptr_cross_workgroup %u32arr_cross_workgroup %u32_0 +%val1 = OpExtInst %void %extinst prefetch %ptr %u32_256 +)"; + + CompileSuccessfully(GenerateKernelCode(body, "", "Logical")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std prefetch can only be used with physical " + "addressing models")); +} + +TEST_F(ValidateExtInst, OpenCLStdPrefetchNumElementsNotSizeT) { + const std::string body = R"( +%ptr = OpAccessChain %f32_ptr_cross_workgroup %f32arr_cross_workgroup %u32_0 +%val1 = OpExtInst %void %extinst prefetch %ptr %u32_256 +)"; + + CompileSuccessfully(GenerateKernelCode(body, "", "Physical64")); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std prefetch: expected operand Num Elements to " + "be of type size_t (64-bit integer for the addressing " + "model used in the module)")); +} + +TEST_P(ValidateOpenCLStdFractLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%var_f32 = OpVariable %f32_ptr_function Function\n"; + ss << "%var_f32vec2 = OpVariable %f32vec2_ptr_function Function\n"; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32_0 %var_f32\n"; + ss << "%val2 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %f32vec2_01 %var_f32vec2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdFractLike, IntResultType) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%var_f32 = OpVariable %f32_ptr_function Function\n"; + ss << "%val1 = OpExtInst %u32 %extinst " << ext_inst_name + << " %f32_0 %var_f32\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected Result Type to be a float scalar or vector type")); +} + +TEST_P(ValidateOpenCLStdFractLike, XWrongType) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%var_f32 = OpVariable %f32_ptr_function Function\n"; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f64_0 %var_f32\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected type of operand X to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdFractLike, NotPointer) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%var_f32 = OpVariable %f32_ptr_function Function\n"; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32_0 %f32_1\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected the last operand to be a pointer")); +} + +TEST_P(ValidateOpenCLStdFractLike, PointerInvalidStorageClass) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f32_ptr_uniform_constant " + "%f32vec8_uniform_constant %u32_1\n"; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name << " %f32_0 %ptr\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected storage class of the pointer to be " + "Generic, CrossWorkgroup, Workgroup or Function")); +} + +TEST_P(ValidateOpenCLStdFractLike, PointerWrongDataType) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%var_u32 = OpVariable %u32_ptr_function Function\n"; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32_0 %var_u32\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std " + ext_inst_name + + ": expected data type of the pointer to be equal to Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllFractLike, ValidateOpenCLStdFractLike, + ::testing::ValuesIn(std::vector{ + "fract", + "modf", + "sincos", + }), ); + +TEST_F(ValidateExtInst, OpenCLStdRemquoSuccess) { + const std::string body = R"( +%var_f32 = OpVariable %f32_ptr_function Function +%var_f32vec2 = OpVariable %f32vec2_ptr_function Function +%val1 = OpExtInst %f32 %extinst remquo %f32_3 %f32_2 %var_f32 +%val2 = OpExtInst %f32vec2 %extinst remquo %f32vec2_01 %f32vec2_12 %var_f32vec2 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, OpenCLStdRemquoIntResultType) { + const std::string body = R"( +%var_f32 = OpVariable %f32_ptr_function Function +%val1 = OpExtInst %u32 %extinst remquo %f32_3 %f32_2 %var_f32 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std remquo: " + "expected Result Type to be a float scalar or vector type")); +} + +TEST_F(ValidateExtInst, OpenCLStdRemquoXWrongType) { + const std::string body = R"( +%var_f32 = OpVariable %f32_ptr_function Function +%val1 = OpExtInst %f32 %extinst remquo %u32_3 %f32_2 %var_f32 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std remquo: " + "expected type of operand X to be equal to Result Type")); +} + +TEST_F(ValidateExtInst, OpenCLStdRemquoYWrongType) { + const std::string body = R"( +%var_f32 = OpVariable %f32_ptr_function Function +%val1 = OpExtInst %f32 %extinst remquo %f32_3 %u32_2 %var_f32 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std remquo: " + "expected type of operand Y to be equal to Result Type")); +} + +TEST_F(ValidateExtInst, OpenCLStdRemquoNotPointer) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst remquo %f32_3 %f32_2 %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std remquo: " + "expected the last operand to be a pointer")); +} + +TEST_F(ValidateExtInst, OpenCLStdRemquoPointerWrongStorageClass) { + const std::string body = R"( +%ptr = OpAccessChain %f32_ptr_uniform_constant %f32vec8_uniform_constant %u32_1 +%val1 = OpExtInst %f32 %extinst remquo %f32_3 %f32_2 %ptr +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std remquo: " + "expected storage class of the pointer to be Generic, " + "CrossWorkgroup, Workgroup or Function")); +} + +TEST_F(ValidateExtInst, OpenCLStdRemquoPointerWrongDataType) { + const std::string body = R"( +%var_u32 = OpVariable %u32_ptr_function Function +%val1 = OpExtInst %f32 %extinst remquo %f32_3 %f32_2 %var_u32 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std remquo: " + "expected data type of the pointer to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdFrexpLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%var_u32 = OpVariable %u32_ptr_function Function\n"; + ss << "%var_u32vec2 = OpVariable %u32vec2_ptr_function Function\n"; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32_0 %var_u32\n"; + ss << "%val2 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %f32vec2_01 %var_u32vec2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdFrexpLike, IntResultType) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%var_u32 = OpVariable %u32_ptr_function Function\n"; + ss << "%val1 = OpExtInst %u32 %extinst " << ext_inst_name + << " %f32_0 %var_u32\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected Result Type to be a float scalar or vector type")); +} + +TEST_P(ValidateOpenCLStdFrexpLike, XWrongType) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%var_u32 = OpVariable %u32_ptr_function Function\n"; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f64_0 %var_u32\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected type of operand X to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdFrexpLike, NotPointer) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32_0 %u32_1\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected the last operand to be a pointer")); +} + +TEST_P(ValidateOpenCLStdFrexpLike, PointerInvalidStorageClass) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%ptr = OpAccessChain %f32_ptr_uniform_constant " + "%f32vec8_uniform_constant %u32_1\n"; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name << " %f32_0 %ptr\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected storage class of the pointer to be " + "Generic, CrossWorkgroup, Workgroup or Function")); +} + +TEST_P(ValidateOpenCLStdFrexpLike, PointerDataTypeFloat) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%var_f32 = OpVariable %f32_ptr_function Function\n"; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32_0 %var_f32\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected data type of the pointer to be a 32-bit " + "int scalar or vector type")); +} + +TEST_P(ValidateOpenCLStdFrexpLike, PointerDataTypeU64) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%var_u64 = OpVariable %u64_ptr_function Function\n"; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32_0 %var_u64\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected data type of the pointer to be a 32-bit " + "int scalar or vector type")); +} + +TEST_P(ValidateOpenCLStdFrexpLike, PointerDataTypeDiffSize) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%var_u32 = OpVariable %u32_ptr_function Function\n"; + ss << "%val1 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %f32vec2_01 %var_u32\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected data type of the pointer to have the same " + "number of components as Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllFrexpLike, ValidateOpenCLStdFrexpLike, + ::testing::ValuesIn(std::vector{ + "frexp", + "lgamma_r", + }), ); + +TEST_F(ValidateExtInst, OpenCLStdIlogbSuccess) { + const std::string body = R"( +%val1 = OpExtInst %u32 %extinst ilogb %f32_3 +%val2 = OpExtInst %u32vec2 %extinst ilogb %f32vec2_12 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, OpenCLStdIlogbFloatResultType) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst ilogb %f32_3 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std ilogb: " + "expected Result Type to be a 32-bit int scalar or vector type")); +} + +TEST_F(ValidateExtInst, OpenCLStdIlogbIntX) { + const std::string body = R"( +%val1 = OpExtInst %u32 %extinst ilogb %u32_3 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std ilogb: " + "expected operand X to be a float scalar or vector")); +} + +TEST_F(ValidateExtInst, OpenCLStdIlogbDiffSize) { + const std::string body = R"( +%val2 = OpExtInst %u32vec2 %extinst ilogb %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std ilogb: " + "expected operand X to have the same number of " + "components as Result Type")); +} + +TEST_F(ValidateExtInst, OpenCLStdNanSuccess) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst nan %u32_3 +%val2 = OpExtInst %f32vec2 %extinst nan %u32vec2_12 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateExtInst, OpenCLStdNanIntResultType) { + const std::string body = R"( +%val1 = OpExtInst %u32 %extinst nan %u32_3 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std nan: " + "expected Result Type to be a float scalar or vector type")); +} + +TEST_F(ValidateExtInst, OpenCLStdNanFloatNancode) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst nan %f32_3 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std nan: " + "expected Nancode to be an int scalar or vector type")); +} + +TEST_F(ValidateExtInst, OpenCLStdNanFloatDiffSize) { + const std::string body = R"( +%val1 = OpExtInst %f32 %extinst nan %u32vec2_12 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std nan: " + "expected Nancode to have the same number of " + "components as Result Type")); +} + +TEST_F(ValidateExtInst, OpenCLStdNanFloatDiffBitWidth) { + const std::string body = R"( +%val1 = OpExtInst %f64 %extinst nan %u32_2 +)"; + + CompileSuccessfully(GenerateKernelCode(body)); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std nan: " + "expected Nancode to have the same bit width as Result Type")); +} + +TEST_P(ValidateOpenCLStdLdexpLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32_0 %u32_1\n"; + ss << "%val2 = OpExtInst %f32vec2 %extinst " << ext_inst_name + << " %f32vec2_12 %u32vec2_12\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdLdexpLike, IntResultType) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %u32 %extinst " << ext_inst_name + << " %f32_0 %u32_1\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected Result Type to be a float scalar or vector type")); +} + +TEST_P(ValidateOpenCLStdLdexpLike, XWrongType) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %u32_0 %u32_1\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected type of operand X to be equal to Result Type")); +} + +TEST_P(ValidateOpenCLStdLdexpLike, ExponentNotInt) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32_0 %f32_1\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected the exponent to be a 32-bit int scalar or vector")); +} + +TEST_P(ValidateOpenCLStdLdexpLike, ExponentNotInt32) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32_0 %u64_1\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected the exponent to be a 32-bit int scalar or vector")); +} + +TEST_P(ValidateOpenCLStdLdexpLike, ExponentWrongSize) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %f32 %extinst " << ext_inst_name + << " %f32_0 %u32vec2_01\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected the exponent to have the same number of " + "components as Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllLdexpLike, ValidateOpenCLStdLdexpLike, + ::testing::ValuesIn(std::vector{ + "ldexp", + "pown", + "rootn", + }), ); + +TEST_P(ValidateOpenCLStdUpsampleLike, Success) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %u16 %extinst " << ext_inst_name << " %u8_1 %u8_2\n"; + ss << "%val2 = OpExtInst %u32 %extinst " << ext_inst_name + << " %u16_1 %u16_2\n"; + ss << "%val3 = OpExtInst %u64 %extinst " << ext_inst_name + << " %u32_1 %u32_2\n"; + ss << "%val4 = OpExtInst %u64vec2 %extinst " << ext_inst_name + << " %u32vec2_01 %u32vec2_01\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateOpenCLStdUpsampleLike, FloatResultType) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %f64 %extinst " << ext_inst_name + << " %u32_1 %u32_2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected Result Type to be an int scalar or vector type")); +} + +TEST_P(ValidateOpenCLStdUpsampleLike, InvalidResultTypeBitWidth) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %u8 %extinst " << ext_inst_name << " %u8_1 %u8_2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpenCL.std " + ext_inst_name + + ": expected bit width of Result Type components to be 16, 32 or 64")); +} + +TEST_P(ValidateOpenCLStdUpsampleLike, LoHiDiffType) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %u64 %extinst " << ext_inst_name + << " %u32_1 %u16_2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected Hi and Lo operands to have the same type")); +} + +TEST_P(ValidateOpenCLStdUpsampleLike, DiffNumberOfComponents) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %u64vec2 %extinst " << ext_inst_name + << " %u32_1 %u32_2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected Hi and Lo operands to have the same number " + "of components as Result Type")); +} + +TEST_P(ValidateOpenCLStdUpsampleLike, HiLoWrongBitWidth) { + const std::string ext_inst_name = GetParam(); + std::ostringstream ss; + ss << "%val1 = OpExtInst %u64 %extinst " << ext_inst_name + << " %u16_1 %u16_2\n"; + + CompileSuccessfully(GenerateKernelCode(ss.str())); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpenCL.std " + ext_inst_name + + ": expected bit width of components of Hi and Lo operands to " + "be half of the bit width of components of Result Type")); +} + +INSTANTIATE_TEST_CASE_P(AllUpsampleLike, ValidateOpenCLStdUpsampleLike, + ::testing::ValuesIn(std::vector{ + "u_upsample", + "s_upsample", + }), ); + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_fixtures.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_fixtures.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_fixtures.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_fixtures.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,138 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Common validation fixtures for unit tests + +#ifndef LIBSPIRV_TEST_VALIDATE_FIXTURES_H_ +#define LIBSPIRV_TEST_VALIDATE_FIXTURES_H_ + +#include "source/val/validation_state.h" +#include "test_fixture.h" +#include "unit_spirv.h" + +namespace spvtest { + +template +class ValidateBase : public ::testing::Test, + public ::testing::WithParamInterface { + public: + ValidateBase(); + + virtual void TearDown(); + + // Returns the a spv_const_binary struct + spv_const_binary get_const_binary(); + + void CompileSuccessfully(std::string code, + spv_target_env env = SPV_ENV_UNIVERSAL_1_0); + + // Overwrites the word at index 'index' with the given word. + // For testing purposes, it is often useful to be able to manipulate the + // assembled binary before running the validator on it. + // This function overwrites the word at the given index with a new word. + void OverwriteAssembledBinary(uint32_t index, uint32_t word); + + // Performs validation on the SPIR-V code and compares the result of the + // spvValidate function + spv_result_t ValidateInstructions(spv_target_env env = SPV_ENV_UNIVERSAL_1_0); + + // Performs validation. Returns the status and stores validation state into + // the vstate_ member. + spv_result_t ValidateAndRetrieveValidationState( + spv_target_env env = SPV_ENV_UNIVERSAL_1_0); + + std::string getDiagnosticString(); + spv_position_t getErrorPosition(); + spv_validator_options getValidatorOptions(); + + spv_binary binary_; + spv_diagnostic diagnostic_; + spv_validator_options options_; + std::unique_ptr vstate_; +}; + +template +ValidateBase::ValidateBase() : binary_(), diagnostic_() { + // Initialize to default command line options. Different tests can then + // specialize specific options as necessary. + options_ = spvValidatorOptionsCreate(); +} + +template +spv_const_binary ValidateBase::get_const_binary() { + return spv_const_binary(binary_); +} + +template +void ValidateBase::TearDown() { + if (diagnostic_) { + spvDiagnosticPrint(diagnostic_); + } + spvDiagnosticDestroy(diagnostic_); + spvBinaryDestroy(binary_); + spvValidatorOptionsDestroy(options_); +} + +template +void ValidateBase::CompileSuccessfully(std::string code, + spv_target_env env) { + spv_diagnostic diagnostic = nullptr; + ASSERT_EQ(SPV_SUCCESS, + spvTextToBinary(ScopedContext(env).context, code.c_str(), + code.size(), &binary_, &diagnostic)) + << "ERROR: " << diagnostic->error + << "\nSPIR-V could not be compiled into binary:\n" + << code; +} + +template +void ValidateBase::OverwriteAssembledBinary(uint32_t index, uint32_t word) { + ASSERT_TRUE(index < binary_->wordCount) + << "OverwriteAssembledBinary: The given index is larger than the binary " + "word count."; + binary_->code[index] = word; +} + +template +spv_result_t ValidateBase::ValidateInstructions(spv_target_env env) { + return spvValidateWithOptions(ScopedContext(env).context, options_, + get_const_binary(), &diagnostic_); +} + +template +spv_result_t ValidateBase::ValidateAndRetrieveValidationState( + spv_target_env env) { + return spvtools::ValidateBinaryAndKeepValidationState( + ScopedContext(env).context, options_, get_const_binary()->code, + get_const_binary()->wordCount, &diagnostic_, &vstate_); +} + +template +std::string ValidateBase::getDiagnosticString() { + return diagnostic_ == nullptr ? std::string() + : std::string(diagnostic_->error); +} + +template +spv_validator_options ValidateBase::getValidatorOptions() { + return options_; +} + +template +spv_position_t ValidateBase::getErrorPosition() { + return diagnostic_ == nullptr ? spv_position_t() : diagnostic_->position; +} + +} // namespace spvtest +#endif diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_id_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_id_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_id_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_id_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,4766 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include + +#include "gmock/gmock.h" +#include "test_fixture.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +// NOTE: The tests in this file are ONLY testing ID usage, there for the input +// SPIR-V does not follow the logical layout rules from the spec in all cases in +// order to makes the tests smaller. Validation of the whole module is handled +// in stages, ID validation is only one of these stages. All validation stages +// are stand alone. + +namespace { + +using spvtest::ScopedContext; +using std::ostringstream; +using std::string; +using std::vector; +using ::testing::HasSubstr; +using ::testing::ValuesIn; + +using ValidateIdWithMessage = spvtest::ValidateBase; + +string kGLSL450MemoryModel = R"( + OpCapability Shader + OpCapability Linkage + OpCapability Addresses + OpCapability Pipes + OpCapability LiteralSampler + OpCapability DeviceEnqueue + OpCapability Vector16 + OpCapability Int8 + OpCapability Int16 + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Logical GLSL450 +)"; + +string kOpenCLMemoryModel32 = R"( + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel +%1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL +)"; + +string kOpenCLMemoryModel64 = R"( + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 +%1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL +)"; + +string sampledImageSetup = R"( + %void = OpTypeVoid + %typeFuncVoid = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %image_type = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_img = OpTypePointer UniformConstant %image_type + %tex = OpVariable %_ptr_UniformConstant_img UniformConstant + %sampler_type = OpTypeSampler +%_ptr_UniformConstant_sam = OpTypePointer UniformConstant %sampler_type + %s = OpVariable %_ptr_UniformConstant_sam UniformConstant + %sampled_image_type = OpTypeSampledImage %image_type + %v2float = OpTypeVector %float 2 + %float_1 = OpConstant %float 1 + %float_2 = OpConstant %float 2 + %const_vec_1_1 = OpConstantComposite %v2float %float_1 %float_1 + %const_vec_2_2 = OpConstantComposite %v2float %float_2 %float_2 + %bool_type = OpTypeBool + %spec_true = OpSpecConstantTrue %bool_type + %main = OpFunction %void None %typeFuncVoid + %label_1 = OpLabel + %image_inst = OpLoad %image_type %tex + %sampler_inst = OpLoad %sampler_type %s +)"; + +string BranchConditionalSetup = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 140 + OpName %main "main" + + ; type definitions + %bool = OpTypeBool + %uint = OpTypeInt 32 0 + %int = OpTypeInt 32 1 + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + + ; constants + %i0 = OpConstant %int 0 + %i1 = OpConstant %int 1 + %f0 = OpConstant %float 0 + %f1 = OpConstant %float 1 + + + ; main function header + %void = OpTypeVoid + %voidfunc = OpTypeFunction %void + %main = OpFunction %void None %voidfunc + %lmain = OpLabel +)"; + +string BranchConditionalTail = R"( + %target_t = OpLabel + OpNop + OpBranch %end + %target_f = OpLabel + OpNop + OpBranch %end + + %end = OpLabel + + OpReturn + OpFunctionEnd +)"; + +// TODO: OpUndef + +TEST_F(ValidateIdWithMessage, OpName) { + string spirv = kGLSL450MemoryModel + R"( + OpName %2 "name" +%1 = OpTypeInt 32 0 +%2 = OpTypePointer UniformConstant %1 +%3 = OpVariable %2 UniformConstant)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpMemberNameGood) { + string spirv = kGLSL450MemoryModel + R"( + OpMemberName %2 0 "foo" +%1 = OpTypeInt 32 0 +%2 = OpTypeStruct %1)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpMemberNameTypeBad) { + string spirv = kGLSL450MemoryModel + R"( + OpMemberName %1 0 "foo" +%1 = OpTypeInt 32 0)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpMemberName Type '1' is not a struct type.")); +} +TEST_F(ValidateIdWithMessage, OpMemberNameMemberBad) { + string spirv = kGLSL450MemoryModel + R"( + OpMemberName %1 1 "foo" +%2 = OpTypeInt 32 0 +%1 = OpTypeStruct %2)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpMemberName Member '1' index is larger than " + "Type '1's member count.")); +} + +TEST_F(ValidateIdWithMessage, OpLineGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpString "/path/to/source.file" + OpLine %1 0 0 +%2 = OpTypeInt 32 0 +%3 = OpTypePointer Input %2 +%4 = OpVariable %3 Input)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpLineFileBad) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeInt 32 0 + OpLine %1 0 0 + )"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpLine Target '1' is not an OpString.")); +} + +TEST_F(ValidateIdWithMessage, OpDecorateGood) { + string spirv = kGLSL450MemoryModel + R"( + OpDecorate %2 GLSLShared +%1 = OpTypeInt 64 0 +%2 = OpTypeStruct %1 %1)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpDecorateBad) { + string spirv = kGLSL450MemoryModel + R"( +OpDecorate %1 GLSLShared)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("forward referenced IDs have not been defined")); +} + +TEST_F(ValidateIdWithMessage, OpMemberDecorateGood) { + string spirv = kGLSL450MemoryModel + R"( + OpMemberDecorate %2 0 Uniform +%1 = OpTypeInt 32 0 +%2 = OpTypeStruct %1 %1)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpMemberDecorateBad) { + string spirv = kGLSL450MemoryModel + R"( + OpMemberDecorate %1 0 Uniform +%1 = OpTypeInt 32 0)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpMemberDecorate Structure type '1' is not a struct type.")); +} +TEST_F(ValidateIdWithMessage, OpMemberDecorateMemberBad) { + string spirv = kGLSL450MemoryModel + R"( + OpMemberDecorate %1 3 Uniform +%int = OpTypeInt 32 0 +%1 = OpTypeStruct %int %int)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Index 3 provided in OpMemberDecorate for struct " + "1 is out of bounds. The structure has 2 members. " + "Largest valid index is 1.")); +} + +TEST_F(ValidateIdWithMessage, OpGroupDecorateGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpDecorationGroup + OpDecorate %1 Uniform + OpDecorate %1 GLSLShared + OpGroupDecorate %1 %3 %4 +%2 = OpTypeInt 32 0 +%3 = OpConstant %2 42 +%4 = OpConstant %2 23)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpDecorationGroupBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpDecorationGroup + OpDecorate %1 Uniform + OpDecorate %1 GLSLShared + OpMemberDecorate %1 0 Constant + )"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Result id of OpDecorationGroup can only " + "be targeted by OpName, OpGroupDecorate, " + "OpDecorate, and OpGroupMemberDecorate")); +} +TEST_F(ValidateIdWithMessage, OpGroupDecorateDecorationGroupBad) { + string spirv = R"( + OpCapability Shader + OpCapability Linkage + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpGroupDecorate %1 %2 %3 +%2 = OpTypeInt 32 0 +%3 = OpConstant %2 42)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpGroupDecorate Decoration group '1' is not a " + "decoration group.")); +} +TEST_F(ValidateIdWithMessage, OpGroupDecorateTargetBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpDecorationGroup + OpDecorate %1 Uniform + OpDecorate %1 GLSLShared + OpGroupDecorate %1 %3 +%2 = OpTypeInt 32 0)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("forward referenced IDs have not been defined")); +} +TEST_F(ValidateIdWithMessage, OpGroupMemberDecorateDecorationGroupBad) { + string spirv = R"( + OpCapability Shader + OpCapability Linkage + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpGroupMemberDecorate %1 %2 0 +%2 = OpTypeInt 32 0)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpGroupMemberDecorate Decoration group '1' is " + "not a decoration group.")); +} +TEST_F(ValidateIdWithMessage, OpGroupMemberDecorateIdNotStructBad) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpDecorationGroup + OpGroupMemberDecorate %1 %2 0 +%2 = OpTypeInt 32 0)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpGroupMemberDecorate Structure type '2' is not " + "a struct type.")); +} +TEST_F(ValidateIdWithMessage, OpGroupMemberDecorateIndexOutOfBoundBad) { + string spirv = kGLSL450MemoryModel + R"( + OpDecorate %1 Offset 0 + %1 = OpDecorationGroup + OpGroupMemberDecorate %1 %struct 3 +%float = OpTypeFloat 32 +%struct = OpTypeStruct %float %float %float +)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Index 3 provided in OpGroupMemberDecorate for struct " + " 2 is out of bounds. The structure has 3 members. " + "Largest valid index is 2.")); +} + +// TODO: OpExtInst + +TEST_F(ValidateIdWithMessage, OpEntryPointGood) { + string spirv = kGLSL450MemoryModel + R"( + OpEntryPoint GLCompute %3 "" +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpFunction %1 None %2 +%4 = OpLabel + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpEntryPointFunctionBad) { + string spirv = kGLSL450MemoryModel + R"( + OpEntryPoint GLCompute %1 "" +%1 = OpTypeVoid)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpEntryPoint Entry Point '1' is not a function.")); +} +TEST_F(ValidateIdWithMessage, OpEntryPointParameterCountBad) { + string spirv = kGLSL450MemoryModel + R"( + OpEntryPoint GLCompute %3 "" +%1 = OpTypeVoid +%2 = OpTypeFunction %1 %1 +%3 = OpFunction %1 None %2 +%4 = OpLabel + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpEntryPoint Entry Point '1's function parameter " + "count is not zero")); +} +TEST_F(ValidateIdWithMessage, OpEntryPointReturnTypeBad) { + string spirv = kGLSL450MemoryModel + R"( + OpEntryPoint GLCompute %3 "" +%1 = OpTypeInt 32 0 +%ret = OpConstant %1 0 +%2 = OpTypeFunction %1 +%3 = OpFunction %1 None %2 +%4 = OpLabel + OpReturnValue %ret + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpEntryPoint Entry Point '1's function return " + "type is not void.")); +} + +TEST_F(ValidateIdWithMessage, OpEntryPointInterfaceIsNotVariableTypeBad) { + string spirv = R"( + OpCapability Shader + OpCapability Geometry + OpMemoryModel Logical GLSL450 + OpEntryPoint Geometry %main "main" %ptr_builtin_1 + OpMemberDecorate %struct_1 0 BuiltIn InvocationId + %int = OpTypeInt 32 1 + %void = OpTypeVoid + %func = OpTypeFunction %void + %struct_1 = OpTypeStruct %int +%ptr_builtin_1 = OpTypePointer Input %struct_1 + %main = OpFunction %void None %func + %5 = OpLabel + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Interfaces passed to OpEntryPoint must be of type " + "OpTypeVariable. Found OpTypePointer.")); +} + +TEST_F(ValidateIdWithMessage, OpEntryPointInterfaceStorageClassBad) { + string spirv = R"( + OpCapability Shader + OpCapability Geometry + OpMemoryModel Logical GLSL450 + OpEntryPoint Geometry %main "main" %in_1 + OpMemberDecorate %struct_1 0 BuiltIn InvocationId + %int = OpTypeInt 32 1 + %void = OpTypeVoid + %func = OpTypeFunction %void + %struct_1 = OpTypeStruct %int +%ptr_builtin_1 = OpTypePointer Uniform %struct_1 + %in_1 = OpVariable %ptr_builtin_1 Uniform + %main = OpFunction %void None %func + %5 = OpLabel + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpEntryPoint interfaces must be OpVariables with " + "Storage Class of Input(1) or Output(3). Found Storage " + "Class 2 for Entry Point id 1.")); +} + +TEST_F(ValidateIdWithMessage, OpExecutionModeGood) { + string spirv = kGLSL450MemoryModel + R"( + OpEntryPoint GLCompute %3 "" + OpExecutionMode %3 LocalSize 1 1 1 +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpFunction %1 None %2 +%4 = OpLabel + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpExecutionModeEntryPointMissing) { + string spirv = kGLSL450MemoryModel + R"( + OpExecutionMode %3 LocalSize 1 1 1 +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpFunction %1 None %2 +%4 = OpLabel + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpExecutionMode Entry Point '1' is not the Entry " + "Point operand of an OpEntryPoint.")); +} + +TEST_F(ValidateIdWithMessage, OpExecutionModeEntryPointBad) { + string spirv = kGLSL450MemoryModel + R"( + OpEntryPoint GLCompute %3 "" %a + OpExecutionMode %a LocalSize 1 1 1 +%void = OpTypeVoid +%ptr = OpTypePointer Input %void +%a = OpVariable %ptr Input +%2 = OpTypeFunction %void +%3 = OpFunction %void None %2 +%4 = OpLabel + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpExecutionMode Entry Point '2' is not the Entry " + "Point operand of an OpEntryPoint.")); +} + +TEST_F(ValidateIdWithMessage, OpTypeVectorFloat) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 4)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpTypeVectorInt) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeVector %1 4)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpTypeVectorUInt) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 64 0 +%2 = OpTypeVector %1 4)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpTypeVectorBool) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeBool +%2 = OpTypeVector %1 4)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpTypeVectorComponentTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeFloat 32 +%2 = OpTypePointer UniformConstant %1 +%3 = OpTypeVector %2 4)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpTypeVector Component Type '2' is not a scalar type.")); +} + +TEST_F(ValidateIdWithMessage, OpTypeMatrixGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 2 +%3 = OpTypeMatrix %2 3)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpTypeMatrixColumnTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeMatrix %1 3)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Columns in a matrix must be of type vector.")); +} + +TEST_F(ValidateIdWithMessage, OpTypeSamplerGood) { + // In Rev31, OpTypeSampler takes no arguments. + string spirv = kGLSL450MemoryModel + R"( +%s = OpTypeSampler)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpTypeArrayGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpConstant %1 1 +%3 = OpTypeArray %1 %2)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpTypeArrayElementTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpConstant %1 1 +%3 = OpTypeArray %2 %2)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpTypeArray Element Type '2' is not a type.")); +} + +// Signed or unsigned. +enum Signed { kSigned, kUnsigned }; + +// Creates an assembly snippet declaring OpTypeArray with the given length. +string MakeArrayLength(const string& len, Signed isSigned, int width) { + ostringstream ss; + ss << R"( + OpCapability Shader + OpCapability Linkage + OpCapability Int16 + OpCapability Int64 + )"; + ss << "OpMemoryModel Logical GLSL450\n"; + ss << " %t = OpTypeInt " << width << (isSigned == kSigned ? " 1" : " 0"); + ss << " %l = OpConstant %t " << len; + ss << " %a = OpTypeArray %t %l"; + return ss.str(); +} + +// Tests OpTypeArray. Parameter is the width (in bits) of the array-length's +// type. +class OpTypeArrayLengthTest + : public spvtest::TextToBinaryTestBase<::testing::TestWithParam> { + protected: + OpTypeArrayLengthTest() + : position_(spv_position_t{0, 0, 0}), + diagnostic_(spvDiagnosticCreate(&position_, "")) {} + + ~OpTypeArrayLengthTest() { spvDiagnosticDestroy(diagnostic_); } + + // Runs spvValidate() on v, printing any errors via spvDiagnosticPrint(). + spv_result_t Val(const SpirvVector& v, const std::string& expected_err = "") { + spv_const_binary_t cbinary{v.data(), v.size()}; + const auto status = + spvValidate(ScopedContext().context, &cbinary, &diagnostic_); + if (status != SPV_SUCCESS) { + spvDiagnosticPrint(diagnostic_); + EXPECT_THAT(std::string(diagnostic_->error), HasSubstr(expected_err)); + } + return status; + } + + private: + spv_position_t position_; // For creating diagnostic_. + spv_diagnostic diagnostic_; +}; + +TEST_P(OpTypeArrayLengthTest, LengthPositive) { + const int width = GetParam(); + EXPECT_EQ(SPV_SUCCESS, + Val(CompileSuccessfully(MakeArrayLength("1", kSigned, width)))); + EXPECT_EQ(SPV_SUCCESS, + Val(CompileSuccessfully(MakeArrayLength("1", kUnsigned, width)))); + EXPECT_EQ(SPV_SUCCESS, + Val(CompileSuccessfully(MakeArrayLength("2", kSigned, width)))); + EXPECT_EQ(SPV_SUCCESS, + Val(CompileSuccessfully(MakeArrayLength("2", kUnsigned, width)))); + EXPECT_EQ(SPV_SUCCESS, + Val(CompileSuccessfully(MakeArrayLength("55", kSigned, width)))); + EXPECT_EQ(SPV_SUCCESS, + Val(CompileSuccessfully(MakeArrayLength("55", kUnsigned, width)))); + const string fpad(width / 4 - 1, 'F'); + EXPECT_EQ( + SPV_SUCCESS, + Val(CompileSuccessfully(MakeArrayLength("0x7" + fpad, kSigned, width)))); + EXPECT_EQ(SPV_SUCCESS, Val(CompileSuccessfully( + MakeArrayLength("0xF" + fpad, kUnsigned, width)))); +} + +TEST_P(OpTypeArrayLengthTest, LengthZero) { + const int width = GetParam(); + EXPECT_EQ( + SPV_ERROR_INVALID_ID, + Val(CompileSuccessfully(MakeArrayLength("0", kSigned, width)), + "OpTypeArray Length '2' default value must be at least 1.")); + EXPECT_EQ( + SPV_ERROR_INVALID_ID, + Val(CompileSuccessfully(MakeArrayLength("0", kUnsigned, width)), + "OpTypeArray Length '2' default value must be at least 1.")); +} + +TEST_P(OpTypeArrayLengthTest, LengthNegative) { + const int width = GetParam(); + EXPECT_EQ( + SPV_ERROR_INVALID_ID, + Val(CompileSuccessfully(MakeArrayLength("-1", kSigned, width)), + "OpTypeArray Length '2' default value must be at least 1.")); + EXPECT_EQ( + SPV_ERROR_INVALID_ID, + Val(CompileSuccessfully(MakeArrayLength("-2", kSigned, width)), + "OpTypeArray Length '2' default value must be at least 1.")); + EXPECT_EQ( + SPV_ERROR_INVALID_ID, + Val(CompileSuccessfully(MakeArrayLength("-123", kSigned, width)), + "OpTypeArray Length '2' default value must be at least 1.")); + const string neg_max = "0x8" + string(width / 4 - 1, '0'); + EXPECT_EQ( + SPV_ERROR_INVALID_ID, + Val(CompileSuccessfully(MakeArrayLength(neg_max, kSigned, width)), + "OpTypeArray Length '2' default value must be at least 1.")); +} + +// The only valid widths for integers are 8, 16, 32, and 64. +// Since the Int8 capability requires the Kernel capability, and the Kernel +// capability prohibits usage of signed integers, we can skip 8-bit integers +// here since the purpose of these tests is to check the validity of +// OpTypeArray, not OpTypeInt. +INSTANTIATE_TEST_CASE_P(Widths, OpTypeArrayLengthTest, + ValuesIn(vector{16, 32, 64})); + +TEST_F(ValidateIdWithMessage, OpTypeArrayLengthNull) { + string spirv = kGLSL450MemoryModel + R"( +%i32 = OpTypeInt 32 0 +%len = OpConstantNull %i32 +%ary = OpTypeArray %i32 %len)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpTypeArray Length '2' default value must be at least 1.")); +} + +TEST_F(ValidateIdWithMessage, OpTypeArrayLengthSpecConst) { + string spirv = kGLSL450MemoryModel + R"( +%i32 = OpTypeInt 32 0 +%len = OpSpecConstant %i32 2 +%ary = OpTypeArray %i32 %len)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpTypeArrayLengthSpecConstOp) { + string spirv = kGLSL450MemoryModel + R"( +%i32 = OpTypeInt 32 0 +%c1 = OpConstant %i32 1 +%c2 = OpConstant %i32 2 +%len = OpSpecConstantOp %i32 IAdd %c1 %c2 +%ary = OpTypeArray %i32 %len)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpTypeRuntimeArrayGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeRuntimeArray %1)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpTypeRuntimeArrayBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpConstant %1 0 +%3 = OpTypeRuntimeArray %2)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpTypeRuntimeArray Element Type '2' is not a type.")); +} +// TODO: Object of this type can only be created with OpVariable using the +// Unifrom Storage Class + +TEST_F(ValidateIdWithMessage, OpTypeStructGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeFloat 64 +%3 = OpTypePointer Input %1 +%4 = OpTypeStruct %1 %2 %3)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpTypeStructMemberTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeFloat 64 +%3 = OpConstant %2 0.0 +%4 = OpTypeStruct %1 %2 %3)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpTypeStruct Member Type '3' is not a type.")); +} + +TEST_F(ValidateIdWithMessage, OpTypePointerGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypePointer Input %1)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpTypePointerBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpConstant %1 0 +%3 = OpTypePointer Input %2)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpTypePointer Type '2' is not a type.")); +} + +TEST_F(ValidateIdWithMessage, OpTypeFunctionGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeFunction %1)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpTypeFunctionReturnTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpConstant %1 0 +%3 = OpTypeFunction %2)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpTypeFunction Return Type '2' is not a type.")); +} +TEST_F(ValidateIdWithMessage, OpTypeFunctionParameterBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpConstant %2 0 +%4 = OpTypeFunction %1 %2 %3)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpTypeFunction Parameter Type '3' is not a type.")); +} + +TEST_F(ValidateIdWithMessage, OpTypePipeGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 16 +%3 = OpTypePipe ReadOnly)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpConstantTrueGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeBool +%2 = OpConstantTrue %1)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpConstantTrueBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpConstantTrue %1)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpConstantTrue Result Type '1' is not a boolean type.")); +} + +TEST_F(ValidateIdWithMessage, OpConstantFalseGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeBool +%2 = OpConstantTrue %1)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpConstantFalseBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpConstantFalse %1)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpConstantFalse Result Type '1' is not a boolean type.")); +} + +TEST_F(ValidateIdWithMessage, OpConstantGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpConstant %1 1)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpConstantBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpConstant !1 !0)"; + // The expected failure code is implementation dependent (currently + // INVALID_BINARY because the binary parser catches these cases) and may + // change over time, but this must always fail. + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpConstantCompositeVectorGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 4 +%3 = OpConstant %1 3.14 +%4 = OpConstantComposite %2 %3 %3 %3 %3)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpConstantCompositeVectorWithUndefGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 4 +%3 = OpConstant %1 3.14 +%9 = OpUndef %1 +%4 = OpConstantComposite %2 %3 %3 %3 %9)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpConstantCompositeVectorResultTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 4 +%3 = OpConstant %1 3.14 +%4 = OpConstantComposite %1 %3 %3 %3 %3)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpConstantComposite Result Type '1' is not a composite type.")); +} +TEST_F(ValidateIdWithMessage, OpConstantCompositeVectorConstituentTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 4 +%4 = OpTypeInt 32 0 +%3 = OpConstant %1 3.14 +%5 = OpConstant %4 42 ; bad type for constant value +%6 = OpConstantComposite %2 %3 %5 %3 %3)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpConstantComposite Constituent '5's type does not match " + "Result Type '2's vector element type.")); +} +TEST_F(ValidateIdWithMessage, + OpConstantCompositeVectorConstituentUndefTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 4 +%4 = OpTypeInt 32 0 +%3 = OpConstant %1 3.14 +%5 = OpUndef %4 ; bad type for undef value +%6 = OpConstantComposite %2 %3 %5 %3 %3)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpConstantComposite Constituent '5's type does not match " + "Result Type '2's vector element type.")); +} +TEST_F(ValidateIdWithMessage, OpConstantCompositeMatrixGood) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeFloat 32 + %2 = OpTypeVector %1 4 + %3 = OpTypeMatrix %2 4 + %4 = OpConstant %1 1.0 + %5 = OpConstant %1 0.0 + %6 = OpConstantComposite %2 %4 %5 %5 %5 + %7 = OpConstantComposite %2 %5 %4 %5 %5 + %8 = OpConstantComposite %2 %5 %5 %4 %5 + %9 = OpConstantComposite %2 %5 %5 %5 %4 +%10 = OpConstantComposite %3 %6 %7 %8 %9)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpConstantCompositeMatrixUndefGood) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeFloat 32 + %2 = OpTypeVector %1 4 + %3 = OpTypeMatrix %2 4 + %4 = OpConstant %1 1.0 + %5 = OpConstant %1 0.0 + %6 = OpConstantComposite %2 %4 %5 %5 %5 + %7 = OpConstantComposite %2 %5 %4 %5 %5 + %8 = OpConstantComposite %2 %5 %5 %4 %5 + %9 = OpUndef %2 +%10 = OpConstantComposite %3 %6 %7 %8 %9)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpConstantCompositeMatrixConstituentTypeBad) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeFloat 32 + %2 = OpTypeVector %1 4 +%11 = OpTypeVector %1 3 + %3 = OpTypeMatrix %2 4 + %4 = OpConstant %1 1.0 + %5 = OpConstant %1 0.0 + %6 = OpConstantComposite %2 %4 %5 %5 %5 + %7 = OpConstantComposite %2 %5 %4 %5 %5 + %8 = OpConstantComposite %2 %5 %5 %4 %5 + %9 = OpConstantComposite %11 %5 %5 %5 +%10 = OpConstantComposite %3 %6 %7 %8 %9)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpConstantComposite Constituent '10' vector " + "component count does not match Result Type '4's " + "vector component count.")); +} +TEST_F(ValidateIdWithMessage, + OpConstantCompositeMatrixConstituentUndefTypeBad) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeFloat 32 + %2 = OpTypeVector %1 4 +%11 = OpTypeVector %1 3 + %3 = OpTypeMatrix %2 4 + %4 = OpConstant %1 1.0 + %5 = OpConstant %1 0.0 + %6 = OpConstantComposite %2 %4 %5 %5 %5 + %7 = OpConstantComposite %2 %5 %4 %5 %5 + %8 = OpConstantComposite %2 %5 %5 %4 %5 + %9 = OpUndef %11 +%10 = OpConstantComposite %3 %6 %7 %8 %9)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpConstantComposite Constituent '10' vector " + "component count does not match Result Type '4's " + "vector component count.")); +} +TEST_F(ValidateIdWithMessage, OpConstantCompositeMatrixColumnTypeBad) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeInt 32 0 + %2 = OpTypeFloat 32 + %3 = OpTypeVector %1 2 + %4 = OpTypeVector %3 2 + %5 = OpTypeMatrix %2 2 + %6 = OpConstant %1 42 + %7 = OpConstant %2 3.14 + %8 = OpConstantComposite %3 %6 %6 + %9 = OpConstantComposite %4 %7 %7 +%10 = OpConstantComposite %5 %8 %9)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Columns in a matrix must be of type vector.")); +} +TEST_F(ValidateIdWithMessage, OpConstantCompositeArrayGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpConstant %1 4 +%3 = OpTypeArray %1 %2 +%4 = OpConstantComposite %3 %2 %2 %2 %2)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpConstantCompositeArrayWithUndefGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpConstant %1 4 +%9 = OpUndef %1 +%3 = OpTypeArray %1 %2 +%4 = OpConstantComposite %3 %2 %2 %2 %9)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpConstantCompositeArrayConstConstituentBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpConstant %1 4 +%3 = OpTypeArray %1 %2 +%4 = OpConstantComposite %3 %2 %2 %2 %1)"; // Uses a type as operand + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpConstantComposite Constituent '1' is not a " + "constant or undef.")); +} +TEST_F(ValidateIdWithMessage, OpConstantCompositeArrayConstituentTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpConstant %1 4 +%3 = OpTypeArray %1 %2 +%5 = OpTypeFloat 32 +%6 = OpConstant %5 3.14 ; bad type for const value +%4 = OpConstantComposite %3 %2 %2 %2 %6)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpConstantComposite Constituent '5's type does " + "not match Result Type '3's array element type.")); +} +TEST_F(ValidateIdWithMessage, OpConstantCompositeArrayConstituentUndefTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpConstant %1 4 +%3 = OpTypeArray %1 %2 +%5 = OpTypeFloat 32 +%6 = OpUndef %5 ; bad type for undef +%4 = OpConstantComposite %3 %2 %2 %2 %6)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpConstantComposite Constituent '5's type does " + "not match Result Type '3's array element type.")); +} +TEST_F(ValidateIdWithMessage, OpConstantCompositeStructGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeInt 64 0 +%3 = OpTypeStruct %1 %1 %2 +%4 = OpConstant %1 42 +%5 = OpConstant %2 4300000000 +%6 = OpConstantComposite %3 %4 %4 %5)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpConstantCompositeStructUndefGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeInt 64 0 +%3 = OpTypeStruct %1 %1 %2 +%4 = OpConstant %1 42 +%5 = OpUndef %2 +%6 = OpConstantComposite %3 %4 %4 %5)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpConstantCompositeStructMemberTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeInt 64 0 +%3 = OpTypeStruct %1 %1 %2 +%4 = OpConstant %1 42 +%5 = OpConstant %2 4300000000 +%6 = OpConstantComposite %3 %4 %5 %4)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpConstantComposite Constituent '5' type does " + "not match the Result Type '3's member type.")); +} + +TEST_F(ValidateIdWithMessage, OpConstantCompositeStructMemberUndefTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeInt 64 0 +%3 = OpTypeStruct %1 %1 %2 +%4 = OpConstant %1 42 +%5 = OpUndef %2 +%6 = OpConstantComposite %3 %4 %5 %4)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpConstantComposite Constituent '5' type does " + "not match the Result Type '3's member type.")); +} + +TEST_F(ValidateIdWithMessage, OpConstantSamplerGood) { + string spirv = kGLSL450MemoryModel + R"( +%float = OpTypeFloat 32 +%samplerType = OpTypeSampler +%3 = OpConstantSampler %samplerType ClampToEdge 0 Nearest)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpConstantSamplerResultTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeFloat 32 +%2 = OpConstantSampler %1 Clamp 0 Nearest)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpConstantSampler Result Type '1' is not a sampler type.")); +} + +TEST_F(ValidateIdWithMessage, OpConstantNullGood) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeBool + %2 = OpConstantNull %1 + %3 = OpTypeInt 32 0 + %4 = OpConstantNull %3 + %5 = OpTypeFloat 32 + %6 = OpConstantNull %5 + %7 = OpTypePointer UniformConstant %3 + %8 = OpConstantNull %7 + %9 = OpTypeEvent +%10 = OpConstantNull %9 +%11 = OpTypeDeviceEvent +%12 = OpConstantNull %11 +%13 = OpTypeReserveId +%14 = OpConstantNull %13 +%15 = OpTypeQueue +%16 = OpConstantNull %15 +%17 = OpTypeVector %5 2 +%18 = OpConstantNull %17 +%19 = OpTypeMatrix %17 2 +%20 = OpConstantNull %19 +%25 = OpConstant %3 8 +%21 = OpTypeArray %3 %25 +%22 = OpConstantNull %21 +%23 = OpTypeStruct %3 %5 %1 +%24 = OpConstantNull %23 +%26 = OpTypeArray %17 %25 +%27 = OpConstantNull %26 +%28 = OpTypeStruct %7 %26 %26 %1 +%29 = OpConstantNull %28 +)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpConstantNullBasicBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpConstantNull %1)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpConstantNull Result Type '1' cannot have a null value.")); +} + +TEST_F(ValidateIdWithMessage, OpConstantNullArrayBad) { + string spirv = kGLSL450MemoryModel + R"( +%2 = OpTypeInt 32 0 +%3 = OpTypeSampler +%4 = OpConstant %2 4 +%5 = OpTypeArray %3 %4 +%6 = OpConstantNull %5)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpConstantNull Result Type '4' cannot have a null value.")); +} + +TEST_F(ValidateIdWithMessage, OpConstantNullStructBad) { + string spirv = kGLSL450MemoryModel + R"( +%2 = OpTypeSampler +%3 = OpTypeStruct %2 %2 +%4 = OpConstantNull %3)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpConstantNull Result Type '2' cannot have a null value.")); +} + +TEST_F(ValidateIdWithMessage, OpConstantNullRuntimeArrayBad) { + string spirv = kGLSL450MemoryModel + R"( +%bool = OpTypeBool +%array = OpTypeRuntimeArray %bool +%null = OpConstantNull %array)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpConstantNull Result Type '2' cannot have a null value.")); +} + +TEST_F(ValidateIdWithMessage, OpSpecConstantTrueGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeBool +%2 = OpSpecConstantTrue %1)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpSpecConstantTrueBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpSpecConstantTrue %1)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Specialization constant must be a boolean type.")); +} + +TEST_F(ValidateIdWithMessage, OpSpecConstantFalseGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeBool +%2 = OpSpecConstantFalse %1)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpSpecConstantFalseBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpSpecConstantFalse %1)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Specialization constant must be a boolean type.")); +} + +TEST_F(ValidateIdWithMessage, OpSpecConstantGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeFloat 32 +%2 = OpSpecConstant %1 42)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpSpecConstantBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpSpecConstant !1 !4)"; + // The expected failure code is implementation dependent (currently + // INVALID_BINARY because the binary parser catches these cases) and may + // change over time, but this must always fail. + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Type Id 1 is not a scalar numeric type")); +} + +// Valid: SpecConstantComposite specializes to a vector. +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeVectorGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 4 +%3 = OpSpecConstant %1 3.14 +%4 = OpConstant %1 3.14 +%5 = OpSpecConstantComposite %2 %3 %3 %4 %4)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Valid: Vector of floats and Undefs. +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeVectorWithUndefGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 4 +%3 = OpSpecConstant %1 3.14 +%5 = OpConstant %1 3.14 +%9 = OpUndef %1 +%4 = OpSpecConstantComposite %2 %3 %5 %3 %9)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: result type is float. +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeVectorResultTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 4 +%3 = OpSpecConstant %1 3.14 +%4 = OpSpecConstantComposite %1 %3 %3 %3 %3)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("is not a composite type")); +} + +// Invalid: Vector contains a mix of Int and Float. +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeVectorConstituentTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 4 +%4 = OpTypeInt 32 0 +%3 = OpSpecConstant %1 3.14 +%5 = OpConstant %4 42 ; bad type for constant value +%6 = OpSpecConstantComposite %2 %3 %5 %3 %3)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpSpecConstantComposite Constituent '5's type " + "does not match Result Type '2's vector element " + "type.")); +} + +// Invalid: Constituent is not a constant +TEST_F(ValidateIdWithMessage, + OpSpecConstantCompositeVectorConstituentNotConstantBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 4 +%3 = OpTypeInt 32 0 +%4 = OpSpecConstant %1 3.14 +%6 = OpSpecConstantComposite %2 %3 %4 %4 %4)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpSpecConstantComposite Constituent '3' is not a " + "constant or undef.")); +} + +// Invalid: Vector contains a mix of Undef-int and Float. +TEST_F(ValidateIdWithMessage, + OpSpecConstantCompositeVectorConstituentUndefTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 4 +%4 = OpTypeInt 32 0 +%3 = OpSpecConstant %1 3.14 +%5 = OpUndef %4 ; bad type for undef value +%6 = OpSpecConstantComposite %2 %3 %5 %3 %3)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpSpecConstantComposite Constituent '5's type " + "does not match Result Type '2's vector element " + "type.")); +} + +// Invalid: Vector expects 3 components, but 4 specified. +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeVectorNumComponentsBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeFloat 32 +%2 = OpTypeVector %1 3 +%3 = OpConstant %1 3.14 +%5 = OpSpecConstant %1 4.0 +%6 = OpSpecConstantComposite %2 %3 %5 %3 %3)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpSpecConstantComposite Constituent count does " + "not match Result Type '2's vector component " + "count.")); +} + +// Valid: 4x4 matrix of floats +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeMatrixGood) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeFloat 32 + %2 = OpTypeVector %1 4 + %3 = OpTypeMatrix %2 4 + %4 = OpConstant %1 1.0 + %5 = OpSpecConstant %1 0.0 + %6 = OpSpecConstantComposite %2 %4 %5 %5 %5 + %7 = OpSpecConstantComposite %2 %5 %4 %5 %5 + %8 = OpSpecConstantComposite %2 %5 %5 %4 %5 + %9 = OpSpecConstantComposite %2 %5 %5 %5 %4 +%10 = OpSpecConstantComposite %3 %6 %7 %8 %9)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Valid: Matrix in which one column is Undef +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeMatrixUndefGood) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeFloat 32 + %2 = OpTypeVector %1 4 + %3 = OpTypeMatrix %2 4 + %4 = OpConstant %1 1.0 + %5 = OpSpecConstant %1 0.0 + %6 = OpSpecConstantComposite %2 %4 %5 %5 %5 + %7 = OpSpecConstantComposite %2 %5 %4 %5 %5 + %8 = OpSpecConstantComposite %2 %5 %5 %4 %5 + %9 = OpUndef %2 +%10 = OpSpecConstantComposite %3 %6 %7 %8 %9)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: Matrix in which the sizes of column vectors are not equal. +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeMatrixConstituentTypeBad) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeFloat 32 + %2 = OpTypeVector %1 4 + %3 = OpTypeVector %1 3 + %4 = OpTypeMatrix %2 4 + %5 = OpSpecConstant %1 1.0 + %6 = OpConstant %1 0.0 + %7 = OpSpecConstantComposite %2 %5 %6 %6 %6 + %8 = OpSpecConstantComposite %2 %6 %5 %6 %6 + %9 = OpSpecConstantComposite %2 %6 %6 %5 %6 + %10 = OpSpecConstantComposite %3 %6 %6 %6 +%11 = OpSpecConstantComposite %4 %7 %8 %9 %10)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpSpecConstantComposite Constituent '10' vector " + "component count does not match Result Type '4's " + "vector component count.")); +} + +// Invalid: Matrix type expects 4 columns but only 3 specified. +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeMatrixNumColsBad) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeFloat 32 + %2 = OpTypeVector %1 4 + %3 = OpTypeMatrix %2 4 + %4 = OpSpecConstant %1 1.0 + %5 = OpConstant %1 0.0 + %6 = OpSpecConstantComposite %2 %4 %5 %5 %5 + %7 = OpSpecConstantComposite %2 %5 %4 %5 %5 + %8 = OpSpecConstantComposite %2 %5 %5 %4 %5 +%10 = OpSpecConstantComposite %3 %6 %7 %8)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpSpecConstantComposite Constituent count does " + "not match Result Type '3's matrix column count.")); +} + +// Invalid: Composite contains a non-const/undef component +TEST_F(ValidateIdWithMessage, + OpSpecConstantCompositeMatrixConstituentNotConstBad) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeFloat 32 + %2 = OpConstant %1 0.0 + %3 = OpTypeVector %1 4 + %4 = OpTypeMatrix %3 4 + %5 = OpSpecConstantComposite %3 %2 %2 %2 %2 + %6 = OpSpecConstantComposite %4 %5 %5 %5 %1)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpSpecConstantComposite Constituent '1' is not a " + "constant composite or undef.")); +} + +// Invalid: Composite contains a column that is *not* a vector (it's an array) +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeMatrixColTypeBad) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeFloat 32 + %2 = OpTypeInt 32 0 + %3 = OpSpecConstant %2 4 + %4 = OpConstant %1 0.0 + %5 = OpTypeVector %1 4 + %6 = OpTypeArray %2 %3 + %7 = OpTypeMatrix %5 4 + %8 = OpSpecConstantComposite %6 %3 %3 %3 %3 + %9 = OpSpecConstantComposite %5 %4 %4 %4 %4 + %10 = OpSpecConstantComposite %7 %9 %9 %9 %8)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpSpecConstantComposite Constituent '8' type " + "does not match Result Type '7's matrix column " + "type.")); +} + +// Invalid: Matrix with an Undef column of the wrong size. +TEST_F(ValidateIdWithMessage, + OpSpecConstantCompositeMatrixConstituentUndefTypeBad) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeFloat 32 + %2 = OpTypeVector %1 4 + %3 = OpTypeVector %1 3 + %4 = OpTypeMatrix %2 4 + %5 = OpSpecConstant %1 1.0 + %6 = OpSpecConstant %1 0.0 + %7 = OpSpecConstantComposite %2 %5 %6 %6 %6 + %8 = OpSpecConstantComposite %2 %6 %5 %6 %6 + %9 = OpSpecConstantComposite %2 %6 %6 %5 %6 + %10 = OpUndef %3 + %11 = OpSpecConstantComposite %4 %7 %8 %9 %10)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpSpecConstantComposite Constituent '10' vector " + "component count does not match Result Type '4's " + "vector component count.")); +} + +// Invalid: Matrix in which some columns are Int and some are Float. +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeMatrixColumnTypeBad) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeInt 32 0 + %2 = OpTypeFloat 32 + %3 = OpTypeVector %1 2 + %4 = OpTypeVector %2 2 + %5 = OpTypeMatrix %4 2 + %6 = OpSpecConstant %1 42 + %7 = OpConstant %2 3.14 + %8 = OpSpecConstantComposite %3 %6 %6 + %9 = OpSpecConstantComposite %4 %7 %7 +%10 = OpSpecConstantComposite %5 %8 %9)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpSpecConstantComposite Constituent '8' " + "component type does not match Result Type '5's " + "matrix column component type.")); +} + +// Valid: Array of integers +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeArrayGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpSpecConstant %1 4 +%5 = OpConstant %1 5 +%3 = OpTypeArray %1 %2 +%6 = OpTypeArray %1 %5 +%4 = OpSpecConstantComposite %3 %2 %2 %2 %2 +%7 = OpSpecConstantComposite %3 %5 %5 %5 %5)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: Expecting an array of 4 components, but 3 specified. +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeArrayNumComponentsBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpSpecConstant %1 4 +%3 = OpTypeArray %1 %2 +%4 = OpSpecConstantComposite %3 %2 %2 %2)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpSpecConstantComposite Constituent count does not " + "match Result Type '3's array length.")); +} + +// Valid: Array of Integers and Undef-int +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeArrayWithUndefGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpSpecConstant %1 4 +%9 = OpUndef %1 +%3 = OpTypeArray %1 %2 +%4 = OpSpecConstantComposite %3 %2 %2 %2 %9)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: Array uses a type as operand. +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeArrayConstConstituentBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpConstant %1 4 +%3 = OpTypeArray %1 %2 +%4 = OpSpecConstantComposite %3 %2 %2 %2 %1)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpSpecConstantComposite Constituent '1' is not a " + "constant or undef.")); +} + +// Invalid: Array has a mix of Int and Float components. +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeArrayConstituentTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpConstant %1 4 +%3 = OpTypeArray %1 %2 +%4 = OpTypeFloat 32 +%5 = OpSpecConstant %4 3.14 ; bad type for const value +%6 = OpSpecConstantComposite %3 %2 %2 %2 %5)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpSpecConstantComposite Constituent '5's type " + "does not match Result Type '3's array element " + "type.")); +} + +// Invalid: Array has a mix of Int and Undef-float. +TEST_F(ValidateIdWithMessage, + OpSpecConstantCompositeArrayConstituentUndefTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpSpecConstant %1 4 +%3 = OpTypeArray %1 %2 +%5 = OpTypeFloat 32 +%6 = OpUndef %5 ; bad type for undef +%4 = OpSpecConstantComposite %3 %2 %2 %2 %6)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpSpecConstantComposite Constituent '5's type " + "does not match Result Type '3's array element " + "type.")); +} + +// Valid: Struct of {Int32,Int32,Int64}. +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeStructGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeInt 64 0 +%3 = OpTypeStruct %1 %1 %2 +%4 = OpConstant %1 42 +%5 = OpSpecConstant %2 4300000000 +%6 = OpSpecConstantComposite %3 %4 %4 %5)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: missing one int32 struct member. +TEST_F(ValidateIdWithMessage, + OpSpecConstantCompositeStructMissingComponentBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%3 = OpTypeStruct %1 %1 %1 +%4 = OpConstant %1 42 +%5 = OpSpecConstant %1 430 +%6 = OpSpecConstantComposite %3 %4 %5)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpSpecConstantComposite Constituent '2' count " + "does not match Result Type '2's struct member " + "count.")); +} + +// Valid: Struct uses Undef-int64. +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeStructUndefGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeInt 64 0 +%3 = OpTypeStruct %1 %1 %2 +%4 = OpSpecConstant %1 42 +%5 = OpUndef %2 +%6 = OpSpecConstantComposite %3 %4 %4 %5)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: Composite contains non-const/undef component. +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeStructNonConstBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeInt 64 0 +%3 = OpTypeStruct %1 %1 %2 +%4 = OpSpecConstant %1 42 +%5 = OpUndef %2 +%6 = OpSpecConstantComposite %3 %4 %1 %5)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpSpecConstantComposite Constituent '1' is not a " + "constant or undef.")); +} + +// Invalid: Struct component type does not match expected specialization type. +// Second component was expected to be Int32, but got Int64. +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeStructMemberTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeInt 64 0 +%3 = OpTypeStruct %1 %1 %2 +%4 = OpConstant %1 42 +%5 = OpSpecConstant %2 4300000000 +%6 = OpSpecConstantComposite %3 %4 %5 %4)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpSpecConstantComposite Constituent '5' type " + "does not match the Result Type '3's member " + "type.")); +} + +// Invalid: Undef-int64 used when Int32 was expected. +TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeStructMemberUndefTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeInt 64 0 +%3 = OpTypeStruct %1 %1 %2 +%4 = OpSpecConstant %1 42 +%5 = OpUndef %2 +%6 = OpSpecConstantComposite %3 %4 %5 %4)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpSpecConstantComposite Constituent '5' type " + "does not match the Result Type '3's member " + "type.")); +} + +// TODO: OpSpecConstantOp + +TEST_F(ValidateIdWithMessage, OpVariableGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypePointer Input %1 +%3 = OpVariable %2 Input)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpVariableInitializerConstantGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypePointer Input %1 +%3 = OpConstant %1 42 +%4 = OpVariable %2 Input %3)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpVariableInitializerGlobalVariableGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypePointer Uniform %1 +%3 = OpVariable %2 Uniform +%4 = OpTypePointer Uniform %2 ; pointer to pointer +%5 = OpVariable %4 Uniform %3)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +// TODO: Positive test OpVariable with OpConstantNull of OpTypePointer +TEST_F(ValidateIdWithMessage, OpVariableResultTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpVariable %1 Input)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpVariable Result Type '1' is not a pointer type.")); +} +TEST_F(ValidateIdWithMessage, OpVariableInitializerIsTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypePointer Input %1 +%3 = OpVariable %2 Input %2)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpVariable Initializer '2' is not a constant or " + "module-scope variable")); +} + +TEST_F(ValidateIdWithMessage, OpVariableInitializerIsFunctionVarBad) { + string spirv = kGLSL450MemoryModel + R"( +%int = OpTypeInt 32 0 +%ptrint = OpTypePointer Function %int +%ptrptrint = OpTypePointer Function %ptrint +%void = OpTypeVoid +%fnty = OpTypeFunction %void +%main = OpFunction %void None %fnty +%entry = OpLabel +%var = OpVariable %ptrint Function +%varinit = OpVariable %ptrptrint Function %var ; Can't initialize function variable. +OpReturn +OpFunctionEnd +)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpVariable Initializer '8' is not a constant or " + "module-scope variable")); +} + +TEST_F(ValidateIdWithMessage, OpVariableInitializerIsModuleVarGood) { + string spirv = kGLSL450MemoryModel + R"( +%int = OpTypeInt 32 0 +%ptrint = OpTypePointer Uniform %int +%mvar = OpVariable %ptrint Uniform +%ptrptrint = OpTypePointer Function %ptrint +%void = OpTypeVoid +%fnty = OpTypeFunction %void +%main = OpFunction %void None %fnty +%entry = OpLabel +%goodvar = OpVariable %ptrptrint Function %mvar ; This is ok +OpReturn +OpFunctionEnd +)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpLoadGood) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeVoid + %2 = OpTypeInt 32 0 + %3 = OpTypePointer UniformConstant %2 + %4 = OpTypeFunction %1 + %5 = OpVariable %3 UniformConstant + %6 = OpFunction %1 None %4 + %7 = OpLabel + %8 = OpLoad %2 %5 + %9 = OpReturn +%10 = OpFunctionEnd +)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// TODO: Add tests that exercise VariablePointersStorageBuffer instead of +// VariablePointers. +void createVariablePointerSpirvProgram(std::ostringstream* spirv, + std::string result_strategy, + bool use_varptr_cap, + bool add_helper_function) { + *spirv << "OpCapability Shader "; + if (use_varptr_cap) { + *spirv << "OpCapability VariablePointers "; + *spirv << "OpExtension \"SPV_KHR_variable_pointers\" "; + } + *spirv << R"( + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %main "main" + %void = OpTypeVoid + %voidf = OpTypeFunction %void + %bool = OpTypeBool + %i32 = OpTypeInt 32 1 + %f32 = OpTypeFloat 32 + %f32ptr = OpTypePointer Uniform %f32 + %i = OpConstant %i32 1 + %zero = OpConstant %i32 0 + %float_1 = OpConstant %f32 1.0 + %ptr1 = OpVariable %f32ptr Uniform + %ptr2 = OpVariable %f32ptr Uniform + )"; + if (add_helper_function) { + *spirv << R"( + ; //////////////////////////////////////////////////////////// + ;;;; Function that returns a pointer + ; //////////////////////////////////////////////////////////// + %selector_func_type = OpTypeFunction %f32ptr %bool %f32ptr %f32ptr + %choose_input_func = OpFunction %f32ptr None %selector_func_type + %is_neg_param = OpFunctionParameter %bool + %first_ptr_param = OpFunctionParameter %f32ptr + %second_ptr_param = OpFunctionParameter %f32ptr + %selector_func_begin = OpLabel + %result_ptr = OpSelect %f32ptr %is_neg_param %first_ptr_param %second_ptr_param + OpReturnValue %result_ptr + OpFunctionEnd + )"; + } + *spirv << R"( + %main = OpFunction %void None %voidf + %label = OpLabel + )"; + *spirv << result_strategy; + *spirv << R"( + OpReturn + OpFunctionEnd + )"; +} + +// With the VariablePointer Capability, OpLoad should allow loading a +// VaiablePointer. In this test the variable pointer is obtained by an OpSelect +TEST_F(ValidateIdWithMessage, OpLoadVarPtrOpSelectGood) { + std::string result_strategy = R"( + %isneg = OpSLessThan %bool %i %zero + %varptr = OpSelect %f32ptr %isneg %ptr1 %ptr2 + %result = OpLoad %f32 %varptr + )"; + + std::ostringstream spirv; + createVariablePointerSpirvProgram(&spirv, result_strategy, + true /* Add VariablePointers Capability? */, + false /* Use Helper Function? */); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Without the VariablePointers Capability, OpLoad will not allow loading +// through a variable pointer. +// Disabled since using OpSelect with pointers without VariablePointers will +// fail LogicalsPass. +TEST_F(ValidateIdWithMessage, DISABLED_OpLoadVarPtrOpSelectBad) { + std::string result_strategy = R"( + %isneg = OpSLessThan %bool %i %zero + %varptr = OpSelect %f32ptr %isneg %ptr1 %ptr2 + %result = OpLoad %f32 %varptr + )"; + + std::ostringstream spirv; + createVariablePointerSpirvProgram(&spirv, result_strategy, + false /* Add VariablePointers Capability?*/, + false /* Use Helper Function? */); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("is not a logical pointer.")); +} + +// With the VariablePointer Capability, OpLoad should allow loading a +// VaiablePointer. In this test the variable pointer is obtained by an OpPhi +TEST_F(ValidateIdWithMessage, OpLoadVarPtrOpPhiGood) { + std::string result_strategy = R"( + %is_neg = OpSLessThan %bool %i %zero + OpSelectionMerge %end_label None + OpBranchConditional %is_neg %take_ptr_1 %take_ptr_2 + %take_ptr_1 = OpLabel + OpBranch %end_label + %take_ptr_2 = OpLabel + OpBranch %end_label + %end_label = OpLabel + %varptr = OpPhi %f32ptr %ptr1 %take_ptr_1 %ptr2 %take_ptr_2 + %result = OpLoad %f32 %varptr + )"; + + std::ostringstream spirv; + createVariablePointerSpirvProgram(&spirv, result_strategy, + true /* Add VariablePointers Capability?*/, + false /* Use Helper Function? */); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Without the VariablePointers Capability, OpLoad will not allow loading +// through a variable pointer. +TEST_F(ValidateIdWithMessage, OpLoadVarPtrOpPhiBad) { + std::string result_strategy = R"( + %is_neg = OpSLessThan %bool %i %zero + OpSelectionMerge %end_label None + OpBranchConditional %is_neg %take_ptr_1 %take_ptr_2 + %take_ptr_1 = OpLabel + OpBranch %end_label + %take_ptr_2 = OpLabel + OpBranch %end_label + %end_label = OpLabel + %varptr = OpPhi %f32ptr %ptr1 %take_ptr_1 %ptr2 %take_ptr_2 + %result = OpLoad %f32 %varptr + )"; + + std::ostringstream spirv; + createVariablePointerSpirvProgram(&spirv, result_strategy, + false /* Add VariablePointers Capability?*/, + false /* Use Helper Function? */); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("is not a logical pointer")); +} + +// With the VariablePointer Capability, OpLoad should allow loading through a +// VaiablePointer. In this test the variable pointer is obtained from an +// OpFunctionCall (return value from a function) +TEST_F(ValidateIdWithMessage, OpLoadVarPtrOpFunctionCallGood) { + std::ostringstream spirv; + std::string result_strategy = R"( + %isneg = OpSLessThan %bool %i %zero + %varptr = OpFunctionCall %f32ptr %choose_input_func %isneg %ptr1 %ptr2 + %result = OpLoad %f32 %varptr + )"; + + createVariablePointerSpirvProgram(&spirv, result_strategy, + true /* Add VariablePointers Capability?*/, + true /* Use Helper Function? */); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpLoadResultTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypePointer UniformConstant %2 +%4 = OpTypeFunction %1 +%5 = OpVariable %3 UniformConstant +%6 = OpFunction %1 None %4 +%7 = OpLabel +%8 = OpLoad %3 %5 + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpLoad Result Type '3' does not match Pointer " + " '5's type.")); +} + +TEST_F(ValidateIdWithMessage, OpLoadPointerBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypePointer UniformConstant %2 +%4 = OpTypeFunction %1 +%5 = OpFunction %1 None %4 +%6 = OpLabel +%7 = OpLoad %2 %8 + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + // Prove that SSA checks trigger for a bad Id value. + // The next test case show the not-a-logical-pointer case. + EXPECT_THAT(getDiagnosticString(), HasSubstr("ID 8 has not been defined")); +} + +// Disabled as bitcasting type to object is now not valid. +TEST_F(ValidateIdWithMessage, DISABLED_OpLoadLogicalPointerBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeFloat 32 +%4 = OpTypePointer UniformConstant %2 +%5 = OpTypePointer UniformConstant %3 +%6 = OpTypeFunction %1 +%7 = OpFunction %1 None %6 +%8 = OpLabel +%9 = OpBitcast %5 %4 ; Not valid in logical addressing +%10 = OpLoad %3 %9 ; Should trigger message + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + // Once we start checking bitcasts, we might catch that + // as the error first, instead of catching it here. + // I don't know if it's possible to generate a bad case + // if/when the validator is complete. + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpLoad Pointer '9' is not a logical pointer.")); +} + +TEST_F(ValidateIdWithMessage, OpStoreGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypePointer Uniform %2 +%4 = OpTypeFunction %1 +%5 = OpConstant %2 42 +%6 = OpVariable %3 UniformConstant +%7 = OpFunction %1 None %4 +%8 = OpLabel + OpStore %6 %5 + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpStorePointerBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypePointer UniformConstant %2 +%4 = OpTypeFunction %1 +%5 = OpConstant %2 42 +%6 = OpVariable %3 UniformConstant +%7 = OpFunction %1 None %4 +%8 = OpLabel + OpStore %3 %5 + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpStore Pointer '3' is not a logical pointer.")); +} + +// Disabled as bitcasting type to object is now not valid. +TEST_F(ValidateIdWithMessage, DISABLED_OpStoreLogicalPointerBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeFloat 32 +%4 = OpTypePointer UniformConstant %2 +%5 = OpTypePointer UniformConstant %3 +%6 = OpTypeFunction %1 +%7 = OpConstantNull %5 +%8 = OpFunction %1 None %6 +%9 = OpLabel +%10 = OpBitcast %5 %4 ; Not valid in logical addressing +%11 = OpStore %10 %7 ; Should trigger message + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpStore Pointer '10' is not a logical pointer.")); +} + +// Without the VariablePointer Capability, OpStore should may not store +// through a variable pointer. +// Disabled since using OpSelect with pointers without VariablePointers will +// fail LogicalsPass. +TEST_F(ValidateIdWithMessage, DISABLED_OpStoreVarPtrBad) { + std::string result_strategy = R"( + %isneg = OpSLessThan %bool %i %zero + %varptr = OpSelect %f32ptr %isneg %ptr1 %ptr2 + OpStore %varptr %float_1 + )"; + + std::ostringstream spirv; + createVariablePointerSpirvProgram( + &spirv, result_strategy, false /* Add VariablePointers Capability? */, + false /* Use Helper Function? */); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("is not a logical pointer.")); +} + +// With the VariablePointer Capability, OpStore should allow storing through a +// variable pointer. +TEST_F(ValidateIdWithMessage, OpStoreVarPtrGood) { + std::string result_strategy = R"( + %isneg = OpSLessThan %bool %i %zero + %varptr = OpSelect %f32ptr %isneg %ptr1 %ptr2 + OpStore %varptr %float_1 + )"; + + std::ostringstream spirv; + createVariablePointerSpirvProgram(&spirv, result_strategy, + true /* Add VariablePointers Capability? */, + false /* Use Helper Function? */); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpStoreObjectGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypePointer Uniform %2 +%4 = OpTypeFunction %1 +%5 = OpConstant %2 42 +%6 = OpVariable %3 UniformConstant +%7 = OpFunction %1 None %4 +%8 = OpLabel + OpStore %6 %7 + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpStore Object '7's type is void.")); +} +TEST_F(ValidateIdWithMessage, OpStoreTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%9 = OpTypeFloat 32 +%3 = OpTypePointer Uniform %2 +%4 = OpTypeFunction %1 +%5 = OpConstant %9 3.14 +%6 = OpVariable %3 UniformConstant +%7 = OpFunction %1 None %4 +%8 = OpLabel + OpStore %6 %5 + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpStore Pointer '7's type does not match Object " + " '6's type.")); +} + +// The next series of test check test a relaxation of the rules for stores to +// structs. The first test checks that we get a failure when the option is not +// set to relax the rule. +// TODO: Add tests for layout compatible arrays and matricies when the validator +// relaxes the rules for them as well. Also need test to check for layout +// decorations specific to those types. +TEST_F(ValidateIdWithMessage, OpStoreTypeBadStruct) { + string spirv = kGLSL450MemoryModel + R"( + OpMemberDecorate %1 0 Offset 0 + OpMemberDecorate %1 1 Offset 4 + OpMemberDecorate %2 0 Offset 0 + OpMemberDecorate %2 1 Offset 4 +%3 = OpTypeVoid +%4 = OpTypeFloat 32 +%1 = OpTypeStruct %4 %4 +%5 = OpTypePointer Uniform %1 +%2 = OpTypeStruct %4 %4 +%6 = OpTypeFunction %3 +%7 = OpConstant %4 3.14 +%8 = OpVariable %5 Uniform +%9 = OpFunction %3 None %6 +%10 = OpLabel +%11 = OpCompositeConstruct %2 %7 %7 + OpStore %8 %11 + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpStore Pointer '8's type does not match Object " + " '11's type.")); +} + +// Same code as the last test. The difference is that we relax the rule. +// Because the structs %3 and %5 are defined the same way. +TEST_F(ValidateIdWithMessage, OpStoreTypeRelaxedStruct) { + string spirv = kGLSL450MemoryModel + R"( + OpMemberDecorate %1 0 Offset 0 + OpMemberDecorate %1 1 Offset 4 + OpMemberDecorate %2 0 Offset 0 + OpMemberDecorate %2 1 Offset 4 +%3 = OpTypeVoid +%4 = OpTypeFloat 32 +%1 = OpTypeStruct %4 %4 +%5 = OpTypePointer Uniform %1 +%2 = OpTypeStruct %4 %4 +%6 = OpTypeFunction %3 +%7 = OpConstant %4 3.14 +%8 = OpVariable %5 Uniform +%9 = OpFunction %3 None %6 +%10 = OpLabel +%11 = OpCompositeConstruct %2 %7 %7 + OpStore %8 %11 + OpReturn + OpFunctionEnd)"; + spvValidatorOptionsSetRelaxStoreStruct(options_, true); + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Same code as the last test excect for an extra decoration on one of the +// members. With the relaxed rules, the code is still valid. +TEST_F(ValidateIdWithMessage, OpStoreTypeRelaxedStructWithExtraDecoration) { + string spirv = kGLSL450MemoryModel + R"( + OpMemberDecorate %1 0 Offset 0 + OpMemberDecorate %1 1 Offset 4 + OpMemberDecorate %1 0 RelaxedPrecision + OpMemberDecorate %2 0 Offset 0 + OpMemberDecorate %2 1 Offset 4 +%3 = OpTypeVoid +%4 = OpTypeFloat 32 +%1 = OpTypeStruct %4 %4 +%5 = OpTypePointer Uniform %1 +%2 = OpTypeStruct %4 %4 +%6 = OpTypeFunction %3 +%7 = OpConstant %4 3.14 +%8 = OpVariable %5 Uniform +%9 = OpFunction %3 None %6 +%10 = OpLabel +%11 = OpCompositeConstruct %2 %7 %7 + OpStore %8 %11 + OpReturn + OpFunctionEnd)"; + spvValidatorOptionsSetRelaxStoreStruct(options_, true); + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// This test check that we recursively traverse the struct to check if they are +// interchangable. +TEST_F(ValidateIdWithMessage, OpStoreTypeRelaxedNestedStruct) { + string spirv = kGLSL450MemoryModel + R"( + OpMemberDecorate %1 0 Offset 0 + OpMemberDecorate %1 1 Offset 4 + OpMemberDecorate %2 0 Offset 0 + OpMemberDecorate %2 1 Offset 8 + OpMemberDecorate %3 0 Offset 0 + OpMemberDecorate %3 1 Offset 4 + OpMemberDecorate %4 0 Offset 0 + OpMemberDecorate %4 1 Offset 8 +%5 = OpTypeVoid +%6 = OpTypeInt 32 0 +%7 = OpTypeFloat 32 +%1 = OpTypeStruct %7 %6 +%2 = OpTypeStruct %1 %1 +%8 = OpTypePointer Uniform %2 +%3 = OpTypeStruct %7 %6 +%4 = OpTypeStruct %3 %3 +%9 = OpTypeFunction %5 +%10 = OpConstant %6 7 +%11 = OpConstant %7 3.14 +%12 = OpConstantComposite %3 %11 %10 +%13 = OpVariable %8 Uniform +%14 = OpFunction %5 None %9 +%15 = OpLabel +%16 = OpCompositeConstruct %4 %12 %12 + OpStore %13 %16 + OpReturn + OpFunctionEnd)"; + spvValidatorOptionsSetRelaxStoreStruct(options_, true); + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// This test check that the even with the relaxed rules an error is identified +// if the members of the struct are in a different order. +TEST_F(ValidateIdWithMessage, OpStoreTypeBadRelaxedStruct1) { + string spirv = kGLSL450MemoryModel + R"( + OpMemberDecorate %1 0 Offset 0 + OpMemberDecorate %1 1 Offset 4 + OpMemberDecorate %2 0 Offset 0 + OpMemberDecorate %2 1 Offset 8 + OpMemberDecorate %3 0 Offset 0 + OpMemberDecorate %3 1 Offset 4 + OpMemberDecorate %4 0 Offset 0 + OpMemberDecorate %4 1 Offset 8 +%5 = OpTypeVoid +%6 = OpTypeInt 32 0 +%7 = OpTypeFloat 32 +%1 = OpTypeStruct %6 %7 +%2 = OpTypeStruct %1 %1 +%8 = OpTypePointer Uniform %2 +%3 = OpTypeStruct %7 %6 +%4 = OpTypeStruct %3 %3 +%9 = OpTypeFunction %5 +%10 = OpConstant %6 7 +%11 = OpConstant %7 3.14 +%12 = OpConstantComposite %3 %11 %10 +%13 = OpVariable %8 Uniform +%14 = OpFunction %5 None %9 +%15 = OpLabel +%16 = OpCompositeConstruct %4 %12 %12 + OpStore %13 %16 + OpReturn + OpFunctionEnd)"; + spvValidatorOptionsSetRelaxStoreStruct(options_, true); + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpStore Pointer '13's layout does not match Object " + " '16's layout.")); +} + +// This test check that the even with the relaxed rules an error is identified +// if the members of the struct are at different offsets. +TEST_F(ValidateIdWithMessage, OpStoreTypeBadRelaxedStruct2) { + string spirv = kGLSL450MemoryModel + R"( + OpMemberDecorate %1 0 Offset 4 + OpMemberDecorate %1 1 Offset 0 + OpMemberDecorate %2 0 Offset 0 + OpMemberDecorate %2 1 Offset 8 + OpMemberDecorate %3 0 Offset 0 + OpMemberDecorate %3 1 Offset 4 + OpMemberDecorate %4 0 Offset 0 + OpMemberDecorate %4 1 Offset 8 +%5 = OpTypeVoid +%6 = OpTypeInt 32 0 +%7 = OpTypeFloat 32 +%1 = OpTypeStruct %7 %6 +%2 = OpTypeStruct %1 %1 +%8 = OpTypePointer Uniform %2 +%3 = OpTypeStruct %7 %6 +%4 = OpTypeStruct %3 %3 +%9 = OpTypeFunction %5 +%10 = OpConstant %6 7 +%11 = OpConstant %7 3.14 +%12 = OpConstantComposite %3 %11 %10 +%13 = OpVariable %8 Uniform +%14 = OpFunction %5 None %9 +%15 = OpLabel +%16 = OpCompositeConstruct %4 %12 %12 + OpStore %13 %16 + OpReturn + OpFunctionEnd)"; + spvValidatorOptionsSetRelaxStoreStruct(options_, true); + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpStore Pointer '13's layout does not match Object " + " '16's layout.")); +} + +TEST_F(ValidateIdWithMessage, OpStoreTypeRelaxedLogicalPointerReturnPointer) { + const string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 +%1 = OpTypeInt 32 1 +%2 = OpTypePointer Function %1 +%3 = OpTypeFunction %2 %2 +%4 = OpFunction %2 None %3 +%5 = OpFunctionParameter %2 +%6 = OpLabel + OpReturnValue %5 + OpFunctionEnd)"; + + spvValidatorOptionsSetRelaxLogicalPointer(options_, true); + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpStoreTypeRelaxedLogicalPointerAllocPointer) { + const string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + %1 = OpTypeVoid + %2 = OpTypeInt 32 1 + %3 = OpTypeFunction %1 ; void(void) + %4 = OpTypePointer Uniform %2 ; int* + %5 = OpTypePointer Private %4 ; int** (Private) + %6 = OpTypePointer Function %4 ; int** (Function) + %7 = OpVariable %5 Private + %8 = OpFunction %1 None %3 + %9 = OpLabel +%10 = OpVariable %6 Function + OpReturn + OpFunctionEnd)"; + + spvValidatorOptionsSetRelaxLogicalPointer(options_, true); + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpStoreVoid) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypePointer Uniform %2 +%4 = OpTypeFunction %1 +%6 = OpVariable %3 UniformConstant +%7 = OpFunction %1 None %4 +%8 = OpLabel +%9 = OpFunctionCall %1 %7 + OpStore %6 %9 + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpStore Object '8's type is void.")); +} + +TEST_F(ValidateIdWithMessage, OpStoreLabel) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypePointer Uniform %2 +%4 = OpTypeFunction %1 +%6 = OpVariable %3 UniformConstant +%7 = OpFunction %1 None %4 +%8 = OpLabel + OpStore %6 %8 + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpStore Object '7' is not an object.")); +} + +// TODO: enable when this bug is fixed: +// https://cvs.khronos.org/bugzilla/show_bug.cgi?id=15404 +TEST_F(ValidateIdWithMessage, DISABLED_OpStoreFunction) { + string spirv = kGLSL450MemoryModel + R"( +%2 = OpTypeInt 32 0 +%3 = OpTypePointer UniformConstant %2 +%4 = OpTypeFunction %2 +%5 = OpConstant %2 123 +%6 = OpVariable %3 UniformConstant +%7 = OpFunction %2 None %4 +%8 = OpLabel + OpStore %6 %7 + OpReturnValue %5 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpStoreBuiltin) { + string spirv = R"( + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %main "main" %gl_GlobalInvocationID + OpExecutionMode %main LocalSize 1 1 1 + OpSource GLSL 450 + OpName %main "main" + + OpName %gl_GlobalInvocationID "gl_GlobalInvocationID" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + + %int = OpTypeInt 32 1 + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + + %zero = OpConstant %uint 0 + %v3uint_000 = OpConstantComposite %v3uint %zero %zero %zero + + %void = OpTypeVoid + %voidfunc = OpTypeFunction %void + %main = OpFunction %void None %voidfunc + %lmain = OpLabel + + OpStore %gl_GlobalInvocationID %v3uint_000 + + OpReturn + OpFunctionEnd + )"; + + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("storage class is read-only")); +} + +TEST_F(ValidateIdWithMessage, OpCopyMemoryGood) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeVoid + %2 = OpTypeInt 32 0 + %3 = OpTypePointer UniformConstant %2 + %4 = OpConstant %2 42 + %5 = OpVariable %3 UniformConstant %4 + %6 = OpTypePointer Function %2 + %7 = OpTypeFunction %1 + %8 = OpFunction %1 None %7 + %9 = OpLabel +%10 = OpVariable %6 Function + OpCopyMemory %10 %5 None + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpCopyMemoryBad) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeVoid + %2 = OpTypeInt 32 0 + %3 = OpTypePointer UniformConstant %2 + %4 = OpConstant %2 42 + %5 = OpVariable %3 UniformConstant %4 +%11 = OpTypeFloat 32 + %6 = OpTypePointer Function %11 + %7 = OpTypeFunction %1 + %8 = OpFunction %1 None %7 + %9 = OpLabel +%10 = OpVariable %6 Function + OpCopyMemory %10 %5 None + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpCopyMemory Target '5's type does not match " + "Source '2's type.")); +} + +// TODO: OpCopyMemorySized +TEST_F(ValidateIdWithMessage, OpCopyMemorySizedGood) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeVoid + %2 = OpTypeInt 32 0 + %3 = OpTypePointer UniformConstant %2 + %4 = OpTypePointer Function %2 + %5 = OpConstant %2 4 + %6 = OpVariable %3 UniformConstant %5 + %7 = OpTypeFunction %1 + %8 = OpFunction %1 None %7 + %9 = OpLabel +%10 = OpVariable %4 Function + OpCopyMemorySized %10 %6 %5 None + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpCopyMemorySizedTargetBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypePointer UniformConstant %2 +%4 = OpTypePointer Function %2 +%5 = OpConstant %2 4 +%6 = OpVariable %3 UniformConstant %5 +%7 = OpTypeFunction %1 +%8 = OpFunction %1 None %7 +%9 = OpLabel + OpCopyMemorySized %9 %6 %5 None + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpCopyMemorySized Target '9' is not a pointer.")); +} +TEST_F(ValidateIdWithMessage, OpCopyMemorySizedSourceBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypePointer UniformConstant %2 +%4 = OpTypePointer Function %2 +%5 = OpConstant %2 4 +%6 = OpTypeFunction %1 +%7 = OpFunction %1 None %6 +%8 = OpLabel +%9 = OpVariable %4 Function + OpCopyMemorySized %9 %6 %5 None + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpCopyMemorySized Source '6' is not a pointer.")); +} +TEST_F(ValidateIdWithMessage, OpCopyMemorySizedSizeBad) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeVoid + %2 = OpTypeInt 32 0 + %3 = OpTypePointer UniformConstant %2 + %4 = OpTypePointer Function %2 + %5 = OpConstant %2 4 + %6 = OpVariable %3 UniformConstant %5 + %7 = OpTypeFunction %1 + %8 = OpFunction %1 None %7 + %9 = OpLabel +%10 = OpVariable %4 Function + OpCopyMemorySized %10 %6 %6 None + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpCopyMemorySized Size '6's variable type is not " + "an integer type.")); +} +TEST_F(ValidateIdWithMessage, OpCopyMemorySizedSizeTypeBad) { + string spirv = kGLSL450MemoryModel + R"( + %1 = OpTypeVoid + %2 = OpTypeInt 32 0 + %3 = OpTypePointer UniformConstant %2 + %4 = OpTypePointer Function %2 + %5 = OpConstant %2 4 + %6 = OpVariable %3 UniformConstant %5 + %7 = OpTypeFunction %1 +%11 = OpTypeFloat 32 +%12 = OpConstant %11 1.0 + %8 = OpFunction %1 None %7 + %9 = OpLabel +%10 = OpVariable %4 Function + OpCopyMemorySized %10 %6 %12 None + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "OpCopyMemorySized Size '9's type is not an integer type.")); +} + +const char kDeeplyNestedStructureSetup[] = R"( +%void = OpTypeVoid +%void_f = OpTypeFunction %void +%int = OpTypeInt 32 0 +%float = OpTypeFloat 32 +%v3float = OpTypeVector %float 3 +%mat4x3 = OpTypeMatrix %v3float 4 +%_ptr_Private_mat4x3 = OpTypePointer Private %mat4x3 +%_ptr_Private_float = OpTypePointer Private %float +%my_matrix = OpVariable %_ptr_Private_mat4x3 Private +%my_float_var = OpVariable %_ptr_Private_float Private +%_ptr_Function_float = OpTypePointer Function %float +%int_0 = OpConstant %int 0 +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%int_3 = OpConstant %int 3 +%int_5 = OpConstant %int 5 + +; Making the following nested structures. +; +; struct S { +; bool b; +; vec4 v[5]; +; int i; +; mat4x3 m[5]; +; } +; uniform blockName { +; S s; +; bool cond; +; RunTimeArray arr; +; } + +%f32arr = OpTypeRuntimeArray %float +%bool = OpTypeBool +%v4float = OpTypeVector %float 4 +%array5_mat4x3 = OpTypeArray %mat4x3 %int_5 +%array5_vec4 = OpTypeArray %v4float %int_5 +%_ptr_Uniform_float = OpTypePointer Uniform %float +%_ptr_Function_vec4 = OpTypePointer Function %v4float +%_ptr_Uniform_vec4 = OpTypePointer Uniform %v4float +%struct_s = OpTypeStruct %bool %array5_vec4 %int %array5_mat4x3 +%struct_blockName = OpTypeStruct %struct_s %bool %f32arr +%_ptr_Uniform_blockName = OpTypePointer Uniform %struct_blockName +%_ptr_Uniform_struct_s = OpTypePointer Uniform %struct_s +%_ptr_Uniform_array5_mat4x3 = OpTypePointer Uniform %array5_mat4x3 +%_ptr_Uniform_mat4x3 = OpTypePointer Uniform %mat4x3 +%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float +%blockName_var = OpVariable %_ptr_Uniform_blockName Uniform +%spec_int = OpSpecConstant %int 2 +%func = OpFunction %void None %void_f +%my_label = OpLabel +)"; + +// In what follows, Access Chain Instruction refers to one of the following: +// OpAccessChain, OpInBoundsAccessChain, OpPtrAccessChain, and +// OpInBoundsPtrAccessChain +using AccessChainInstructionTest = spvtest::ValidateBase; + +// Determines whether the access chain instruction requires the 'element id' +// argument. +bool AccessChainRequiresElemId(const std::string& instr) { + return (instr == "OpPtrAccessChain" || instr == "OpInBoundsPtrAccessChain"); +} + +// Valid: Access a float in a matrix using an access chain instruction. +TEST_P(AccessChainInstructionTest, AccessChainGood) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; + string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + + "%float_entry = " + instr + + R"( %_ptr_Private_float %my_matrix )" + elem + + R"(%int_0 %int_1 + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid. The result type of an access chain instruction must be a pointer. +TEST_P(AccessChainInstructionTest, AccessChainResultTypeBad) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; + string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( +%float_entry = )" + + instr + R"( %float %my_matrix )" + elem + R"(%int_0 %int_1 +OpReturn +OpFunctionEnd + )"; + + const std::string expected_err = "The Result Type of " + instr + + " '36' must be " + "OpTypePointer. Found OpTypeFloat."; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); +} + +// Invalid. The base type of an access chain instruction must be a pointer. +TEST_P(AccessChainInstructionTest, AccessChainBaseTypeVoidBad) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; + string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( +%float_entry = )" + + instr + " %_ptr_Private_float %void " + elem + + R"(%int_0 %int_1 +OpReturn +OpFunctionEnd + )"; + const std::string expected_err = "The Base '1' in " + instr + + " instruction must " + "be a pointer."; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); +} + +// Invalid. The base type of an access chain instruction must be a pointer. +TEST_P(AccessChainInstructionTest, AccessChainBaseTypeNonPtrVariableBad) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; + string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( +%entry = )" + + instr + + R"( %_ptr_Private_float %_ptr_Private_float )" + elem + + R"(%int_0 %int_1 +OpReturn +OpFunctionEnd + )"; + const std::string expected_err = "The Base '8' in " + instr + + " instruction must " + "be a pointer."; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); +} + +// Invalid: The storage class of Base and Result do not match. +TEST_P(AccessChainInstructionTest, + AccessChainResultAndBaseStorageClassDoesntMatchBad) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; + string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( +%entry = )" + + instr + + R"( %_ptr_Function_float %my_matrix )" + elem + + R"(%int_0 %int_1 +OpReturn +OpFunctionEnd + )"; + const std::string expected_err = + "The result pointer storage class and base pointer storage class in " + + instr + " do not match."; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); +} + +// Invalid. The base type of an access chain instruction must point to a +// composite object. +TEST_P(AccessChainInstructionTest, + AccessChainBasePtrNotPointingToCompositeBad) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; + string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( +%entry = )" + + instr + + R"( %_ptr_Private_float %my_float_var )" + elem + R"(%int_0 +OpReturn +OpFunctionEnd + )"; + const std::string expected_err = instr + + " reached non-composite type while " + "indexes still remain to be traversed."; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); +} + +// Valid. No Indexes were passed to the access chain instruction. The Result +// Type is the same as the Base type. +TEST_P(AccessChainInstructionTest, AccessChainNoIndexesGood) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; + string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( +%entry = )" + + instr + + R"( %_ptr_Private_float %my_float_var )" + elem + R"( +OpReturn +OpFunctionEnd + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid. No Indexes were passed to the access chain instruction, but the +// Result Type is different from the Base type. +TEST_P(AccessChainInstructionTest, AccessChainNoIndexesBad) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; + string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( +%entry = )" + + instr + + R"( %_ptr_Private_mat4x3 %my_float_var )" + elem + R"( +OpReturn +OpFunctionEnd + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("result type (OpTypeMatrix) does not match the type that " + "results from indexing into the base (OpTypeFloat).")); +} + +// Valid: 255 indexes passed to the access chain instruction. Limit is 255. +TEST_P(AccessChainInstructionTest, AccessChainTooManyIndexesGood) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? " %int_0 " : ""; + int depth = 255; + std::string header = kGLSL450MemoryModel + kDeeplyNestedStructureSetup; + header.erase(header.find("%func")); + std::ostringstream spirv; + spirv << header << "\n"; + + // Build nested structures. Struct 'i' contains struct 'i-1' + spirv << "%s_depth_1 = OpTypeStruct %float\n"; + for (int i = 2; i <= depth; ++i) { + spirv << "%s_depth_" << i << " = OpTypeStruct %s_depth_" << i - 1 << "\n"; + } + + // Define Pointer and Variable to use for the AccessChain instruction. + spirv << "%_ptr_Uniform_deep_struct = OpTypePointer Uniform %s_depth_" + << depth << "\n"; + spirv << "%deep_var = OpVariable %_ptr_Uniform_deep_struct Uniform\n"; + + // Function Start + spirv << R"( + %func = OpFunction %void None %void_f + %my_label = OpLabel + )"; + + // AccessChain with 'n' indexes (n = depth) + spirv << "%entry = " << instr << " %_ptr_Uniform_float %deep_var" << elem; + for (int i = 0; i < depth; ++i) { + spirv << " %int_0"; + } + + // Function end + spirv << R"( + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: 256 indexes passed to the access chain instruction. Limit is 255. +TEST_P(AccessChainInstructionTest, AccessChainTooManyIndexesBad) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? " %int_0 " : ""; + std::ostringstream spirv; + spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup; + spirv << "%entry = " << instr << " %_ptr_Private_float %my_matrix" << elem; + for (int i = 0; i < 256; ++i) { + spirv << " %int_0"; + } + spirv << R"( + OpReturn + OpFunctionEnd + )"; + const std::string expected_err = "The number of indexes in " + instr + + " may not exceed 255. Found 256 indexes."; + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); +} + +// Valid: 10 indexes passed to the access chain instruction. (Custom limit: 10) +TEST_P(AccessChainInstructionTest, CustomizedAccessChainTooManyIndexesGood) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? " %int_0 " : ""; + int depth = 10; + std::string header = kGLSL450MemoryModel + kDeeplyNestedStructureSetup; + header.erase(header.find("%func")); + std::ostringstream spirv; + spirv << header << "\n"; + + // Build nested structures. Struct 'i' contains struct 'i-1' + spirv << "%s_depth_1 = OpTypeStruct %float\n"; + for (int i = 2; i <= depth; ++i) { + spirv << "%s_depth_" << i << " = OpTypeStruct %s_depth_" << i - 1 << "\n"; + } + + // Define Pointer and Variable to use for the AccessChain instruction. + spirv << "%_ptr_Uniform_deep_struct = OpTypePointer Uniform %s_depth_" + << depth << "\n"; + spirv << "%deep_var = OpVariable %_ptr_Uniform_deep_struct Uniform\n"; + + // Function Start + spirv << R"( + %func = OpFunction %void None %void_f + %my_label = OpLabel + )"; + + // AccessChain with 'n' indexes (n = depth) + spirv << "%entry = " << instr << " %_ptr_Uniform_float %deep_var" << elem; + for (int i = 0; i < depth; ++i) { + spirv << " %int_0"; + } + + // Function end + spirv << R"( + OpReturn + OpFunctionEnd + )"; + + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_access_chain_indexes, 10u); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: 11 indexes passed to the access chain instruction. Custom Limit:10 +TEST_P(AccessChainInstructionTest, CustomizedAccessChainTooManyIndexesBad) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? " %int_0 " : ""; + std::ostringstream spirv; + spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup; + spirv << "%entry = " << instr << " %_ptr_Private_float %my_matrix" << elem; + for (int i = 0; i < 11; ++i) { + spirv << " %int_0"; + } + spirv << R"( + OpReturn + OpFunctionEnd + )"; + const std::string expected_err = "The number of indexes in " + instr + + " may not exceed 10. Found 11 indexes."; + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_access_chain_indexes, 10u); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); +} + +// Invalid: Index passed to the access chain instruction is float (must be +// integer). +TEST_P(AccessChainInstructionTest, AccessChainUndefinedIndexBad) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; + string spirv = + kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( +%entry = )" + instr + + R"( %_ptr_Private_float %my_matrix )" + elem + R"(%float %int_1 +OpReturn +OpFunctionEnd + )"; + const std::string expected_err = + "Indexes passed to " + instr + " must be of type integer."; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); +} + +// Invalid: The index argument that indexes into a struct must be of type +// OpConstant. +TEST_P(AccessChainInstructionTest, AccessChainStructIndexNotConstantBad) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; + string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( +%f = )" + + instr + R"( %_ptr_Uniform_float %blockName_var )" + elem + + R"(%int_0 %spec_int %int_2 +OpReturn +OpFunctionEnd + )"; + const std::string expected_err = + "The passed to " + instr + + " to index into a structure must be an OpConstant."; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); +} + +// Invalid: Indexing up to a vec4 granularity, but result type expected float. +TEST_P(AccessChainInstructionTest, + AccessChainStructResultTypeDoesntMatchIndexedTypeBad) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; + string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( +%entry = )" + + instr + + R"( %_ptr_Uniform_float %blockName_var )" + elem + + R"(%int_0 %int_1 %int_2 +OpReturn +OpFunctionEnd + )"; + const std::string expected_err = instr + + " result type (OpTypeFloat) does not match " + "the type that results from indexing into " + "the base (OpTypeVector)."; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); +} + +// Invalid: Reach non-composite type (bool) when unused indexes remain. +TEST_P(AccessChainInstructionTest, AccessChainStructTooManyIndexesBad) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; + string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( +%entry = )" + + instr + + R"( %_ptr_Uniform_float %blockName_var )" + elem + + R"(%int_0 %int_2 %int_2 +OpReturn +OpFunctionEnd + )"; + const std::string expected_err = instr + + " reached non-composite type while " + "indexes still remain to be traversed."; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); +} + +// Invalid: Trying to find index 3 of the struct that has only 3 members. +TEST_P(AccessChainInstructionTest, AccessChainStructIndexOutOfBoundBad) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; + string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( +%entry = )" + + instr + + R"( %_ptr_Uniform_float %blockName_var )" + elem + + R"(%int_3 %int_2 %int_2 +OpReturn +OpFunctionEnd + )"; + const std::string expected_err = "Index is out of bounds: " + instr + + " can not find index 3 into the structure " + " '26'. This structure has 3 members. " + "Largest valid index is 2."; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); +} + +// Valid: Tests that we can index into Struct, Array, Matrix, and Vector! +TEST_P(AccessChainInstructionTest, AccessChainIndexIntoAllTypesGood) { + // indexes that we are passing are: 0, 3, 1, 2, 0 + // 0 will select the struct_s within the base struct (blockName) + // 3 will select the Array that contains 5 matrices + // 1 will select the Matrix that is at index 1 of the array + // 2 will select the column (which is a vector) within the matrix at index 2 + // 0 will select the element at the index 0 of the vector. (which is a float). + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; + ostringstream spirv; + spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup << std::endl; + spirv << "%ss = " << instr << " %_ptr_Uniform_struct_s %blockName_var " + << elem << "%int_0" << std::endl; + spirv << "%sa = " << instr << " %_ptr_Uniform_array5_mat4x3 %blockName_var " + << elem << "%int_0 %int_3" << std::endl; + spirv << "%sm = " << instr << " %_ptr_Uniform_mat4x3 %blockName_var " << elem + << "%int_0 %int_3 %int_1" << std::endl; + spirv << "%sc = " << instr << " %_ptr_Uniform_v3float %blockName_var " << elem + << "%int_0 %int_3 %int_1 %int_2" << std::endl; + spirv << "%entry = " << instr << " %_ptr_Uniform_float %blockName_var " + << elem << "%int_0 %int_3 %int_1 %int_2 %int_0" << std::endl; + spirv << R"( +OpReturn +OpFunctionEnd + )"; + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Valid: Access an element of OpTypeRuntimeArray. +TEST_P(AccessChainInstructionTest, AccessChainIndexIntoRuntimeArrayGood) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; + string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( +%runtime_arr_entry = )" + + instr + + R"( %_ptr_Uniform_float %blockName_var )" + elem + + R"(%int_2 %int_0 +OpReturn +OpFunctionEnd + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: Unused index when accessing OpTypeRuntimeArray. +TEST_P(AccessChainInstructionTest, AccessChainIndexIntoRuntimeArrayBad) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; + string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( +%runtime_arr_entry = )" + + instr + + R"( %_ptr_Uniform_float %blockName_var )" + elem + + R"(%int_2 %int_0 %int_1 +OpReturn +OpFunctionEnd + )"; + const std::string expected_err = + instr + + " reached non-composite type while indexes still remain to be traversed."; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); +} + +// Invalid: Reached scalar type before arguments to the access chain instruction +// finished. +TEST_P(AccessChainInstructionTest, AccessChainMatrixMoreArgsThanNeededBad) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; + string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( +%entry = )" + + instr + + R"( %_ptr_Private_float %my_matrix )" + elem + + R"(%int_0 %int_1 %int_0 +OpReturn +OpFunctionEnd + )"; + const std::string expected_err = instr + + " reached non-composite type while " + "indexes still remain to be traversed."; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); +} + +// Invalid: The result type and the type indexed into do not match. +TEST_P(AccessChainInstructionTest, + AccessChainResultTypeDoesntMatchIndexedTypeBad) { + const std::string instr = GetParam(); + const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; + string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( +%entry = )" + + instr + + R"( %_ptr_Private_mat4x3 %my_matrix )" + elem + + R"(%int_0 %int_1 +OpReturn +OpFunctionEnd + )"; + const std::string expected_err = instr + + " result type (OpTypeMatrix) does not match " + "the type that results from indexing into " + "the base (OpTypeFloat)."; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); +} + +// Run tests for Access Chain Instructions. +INSTANTIATE_TEST_CASE_P( + CheckAccessChainInstructions, AccessChainInstructionTest, + ::testing::Values("OpAccessChain", "OpInBoundsAccessChain", + "OpPtrAccessChain", "OpInBoundsPtrAccessChain")); + +// TODO: OpArrayLength +// TODO: OpImagePointer +// TODO: OpGenericPtrMemSemantics + +TEST_F(ValidateIdWithMessage, OpFunctionGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeFunction %1 %2 %2 +%4 = OpFunction %1 None %3 +%5 = OpLabel + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpFunctionResultTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpConstant %2 42 +%4 = OpTypeFunction %1 %2 %2 +%5 = OpFunction %2 None %4 +%6 = OpLabel + OpReturnValue %3 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpFunction Result Type '2' does not match the " + "Function Type '2's return type.")); +} +TEST_F(ValidateIdWithMessage, OpReturnValueTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeFloat 32 +%3 = OpConstant %2 0 +%4 = OpTypeFunction %1 +%5 = OpFunction %1 None %4 +%6 = OpLabel + OpReturnValue %3 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpReturnValue Value '3's type does not match " + "OpFunction's return type.")); +} +TEST_F(ValidateIdWithMessage, OpFunctionFunctionTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%4 = OpFunction %1 None %2 +%5 = OpLabel + OpReturn +OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpFunction Function Type '2' is not a function type.")); +} + +TEST_F(ValidateIdWithMessage, OpFunctionParameterGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeFunction %1 %2 +%4 = OpFunction %1 None %3 +%5 = OpFunctionParameter %2 +%6 = OpLabel + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpFunctionParameterMultipleGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeFunction %1 %2 %2 +%4 = OpFunction %1 None %3 +%5 = OpFunctionParameter %2 +%6 = OpFunctionParameter %2 +%7 = OpLabel + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpFunctionParameterResultTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeFunction %1 %2 +%4 = OpFunction %1 None %3 +%5 = OpFunctionParameter %1 +%6 = OpLabel + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpFunctionParameter Result Type '1' does not match the " + "OpTypeFunction parameter type of the same index.")); +} + +TEST_F(ValidateIdWithMessage, OpFunctionCallGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeFunction %2 %2 +%4 = OpTypeFunction %1 +%5 = OpConstant %2 42 ;21 + +%6 = OpFunction %2 None %3 +%7 = OpFunctionParameter %2 +%8 = OpLabel + OpReturnValue %7 + OpFunctionEnd + +%10 = OpFunction %1 None %4 +%11 = OpLabel +%12 = OpFunctionCall %2 %6 %5 + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpFunctionCallResultTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeFunction %2 %2 +%4 = OpTypeFunction %1 +%5 = OpConstant %2 42 ;21 + +%6 = OpFunction %2 None %3 +%7 = OpFunctionParameter %2 +%8 = OpLabel +%9 = OpIAdd %2 %7 %7 + OpReturnValue %9 + OpFunctionEnd + +%10 = OpFunction %1 None %4 +%11 = OpLabel +%12 = OpFunctionCall %1 %6 %5 + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpFunctionCall Result Type '1's type does not " + "match Function '2's return type.")); +} +TEST_F(ValidateIdWithMessage, OpFunctionCallFunctionBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeFunction %2 %2 +%4 = OpTypeFunction %1 +%5 = OpConstant %2 42 ;21 + +%10 = OpFunction %1 None %4 +%11 = OpLabel +%12 = OpFunctionCall %2 %5 %5 + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpFunctionCall Function '5' is not a function.")); +} +TEST_F(ValidateIdWithMessage, OpFunctionCallArgumentTypeBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeFunction %2 %2 +%4 = OpTypeFunction %1 +%5 = OpConstant %2 42 + +%13 = OpTypeFloat 32 +%14 = OpConstant %13 3.14 + +%6 = OpFunction %2 None %3 +%7 = OpFunctionParameter %2 +%8 = OpLabel +%9 = OpIAdd %2 %7 %7 + OpReturnValue %9 + OpFunctionEnd + +%10 = OpFunction %1 None %4 +%11 = OpLabel +%12 = OpFunctionCall %2 %6 %14 + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpFunctionCall Argument '7's type does not match " + "Function '2's parameter type.")); +} + +// Valid: OpSampledImage result is used in the same block by +// OpImageSampleImplictLod +TEST_F(ValidateIdWithMessage, OpSampledImageGood) { + string spirv = kGLSL450MemoryModel + sampledImageSetup + R"( +%smpld_img = OpSampledImage %sampled_image_type %image_inst %sampler_inst +%si_lod = OpImageSampleImplicitLod %v4float %smpld_img %const_vec_1_1 + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: OpSampledImage result is defined in one block and used in a +// different block. +TEST_F(ValidateIdWithMessage, OpSampledImageUsedInDifferentBlockBad) { + string spirv = kGLSL450MemoryModel + sampledImageSetup + R"( +%smpld_img = OpSampledImage %sampled_image_type %image_inst %sampler_inst +OpBranch %label_2 +%label_2 = OpLabel +%si_lod = OpImageSampleImplicitLod %v4float %smpld_img %const_vec_1_1 +OpReturn +OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("All OpSampledImage instructions must be in the same block in " + "which their Result are consumed. OpSampledImage Result " + "Type '23' has a consumer in a different basic block. The " + "consumer instruction is '25'.")); +} + +// Invalid: OpSampledImage result is used by OpSelect +// Note: According to the Spec, OpSelect parameters must be either a scalar or a +// vector. Therefore, OpTypeSampledImage is an illegal parameter for OpSelect. +// However, the OpSelect validation does not catch this today. Therefore, it is +// caught by the OpSampledImage validation. If the OpSelect validation code is +// updated, the error message for this test may change. +// +// Disabled since OpSelect catches this now. +TEST_F(ValidateIdWithMessage, DISABLED_OpSampledImageUsedInOpSelectBad) { + string spirv = kGLSL450MemoryModel + sampledImageSetup + R"( +%smpld_img = OpSampledImage %sampled_image_type %image_inst %sampler_inst +%select_img = OpSelect %sampled_image_type %spec_true %smpld_img %smpld_img +OpReturn +OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Result from OpSampledImage instruction must not " + "appear as operands of OpSelect. Found result " + "'23' as an operand of '24'.")); +} + +// Valid: Get a float in a matrix using CompositeExtract. +// Valid: Insert float into a matrix using CompositeInsert. +TEST_F(ValidateIdWithMessage, CompositeExtractInsertGood) { + ostringstream spirv; + spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup << std::endl; + spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl; + spirv << "%float_entry = OpCompositeExtract %float %matrix 0 1" << std::endl; + + // To test CompositeInsert, insert the object back in after extraction. + spirv << "%new_composite = OpCompositeInsert %mat4x3 %float_entry %matrix 0 1" + << std::endl; + spirv << R"(OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +#if 0 +TEST_F(ValidateIdWithMessage, OpFunctionCallArgumentCountBar) { + const char *spirv = R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeFunction %2 %2 +%4 = OpTypeFunction %1 +%5 = OpConstant %2 42 ;21 + +%6 = OpFunction %2 None %3 +%7 = OpFunctionParameter %2 +%8 = OpLabel +%9 = OpLoad %2 %7 + OpReturnValue %9 + OpFunctionEnd + +%10 = OpFunction %1 None %4 +%11 = OpLabel + OpReturn +%12 = OpFunctionCall %2 %6 %5 + OpFunctionEnd)"; + CHECK(spirv, SPV_ERROR_INVALID_ID); +} +#endif + +// TODO: The many things that changed with how images are used. +// TODO: OpTextureSample +// TODO: OpTextureSampleDref +// TODO: OpTextureSampleLod +// TODO: OpTextureSampleProj +// TODO: OpTextureSampleGrad +// TODO: OpTextureSampleOffset +// TODO: OpTextureSampleProjLod +// TODO: OpTextureSampleProjGrad +// TODO: OpTextureSampleLodOffset +// TODO: OpTextureSampleProjOffset +// TODO: OpTextureSampleGradOffset +// TODO: OpTextureSampleProjLodOffset +// TODO: OpTextureSampleProjGradOffset +// TODO: OpTextureFetchTexelLod +// TODO: OpTextureFetchTexelOffset +// TODO: OpTextureFetchSample +// TODO: OpTextureFetchTexel +// TODO: OpTextureGather +// TODO: OpTextureGatherOffset +// TODO: OpTextureGatherOffsets +// TODO: OpTextureQuerySizeLod +// TODO: OpTextureQuerySize +// TODO: OpTextureQueryLevels +// TODO: OpTextureQuerySamples +// TODO: OpConvertUToF +// TODO: OpConvertFToS +// TODO: OpConvertSToF +// TODO: OpConvertUToF +// TODO: OpUConvert +// TODO: OpSConvert +// TODO: OpFConvert +// TODO: OpConvertPtrToU +// TODO: OpConvertUToPtr +// TODO: OpPtrCastToGeneric +// TODO: OpGenericCastToPtr +// TODO: OpBitcast +// TODO: OpGenericCastToPtrExplicit +// TODO: OpSatConvertSToU +// TODO: OpSatConvertUToS +// TODO: OpVectorExtractDynamic +// TODO: OpVectorInsertDynamic + +TEST_F(ValidateIdWithMessage, OpVectorShuffleIntGood) { + string spirv = kGLSL450MemoryModel + R"( +%int = OpTypeInt 32 0 +%ivec3 = OpTypeVector %int 3 +%ivec4 = OpTypeVector %int 4 +%ptr_ivec3 = OpTypePointer Function %ivec3 +%undef = OpUndef %ivec4 +%int_42 = OpConstant %int 42 +%int_0 = OpConstant %int 0 +%int_2 = OpConstant %int 2 +%1 = OpConstantComposite %ivec3 %int_42 %int_0 %int_2 +%2 = OpTypeFunction %ivec3 +%3 = OpFunction %ivec3 None %2 +%4 = OpLabel +%var = OpVariable %ptr_ivec3 Function %1 +%5 = OpLoad %ivec3 %var +%6 = OpVectorShuffle %ivec3 %5 %undef 2 1 0 + OpReturnValue %6 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpVectorShuffleFloatGood) { + string spirv = kGLSL450MemoryModel + R"( +%float = OpTypeFloat 32 +%vec2 = OpTypeVector %float 2 +%vec3 = OpTypeVector %float 3 +%vec4 = OpTypeVector %float 4 +%ptr_vec2 = OpTypePointer Function %vec2 +%ptr_vec3 = OpTypePointer Function %vec3 +%float_1 = OpConstant %float 1 +%float_2 = OpConstant %float 2 +%1 = OpConstantComposite %vec2 %float_2 %float_1 +%2 = OpConstantComposite %vec3 %float_1 %float_2 %float_2 +%3 = OpTypeFunction %vec4 +%4 = OpFunction %vec4 None %3 +%5 = OpLabel +%var = OpVariable %ptr_vec2 Function %1 +%var2 = OpVariable %ptr_vec3 Function %2 +%6 = OpLoad %vec2 %var +%7 = OpLoad %vec3 %var2 +%8 = OpVectorShuffle %vec4 %6 %7 4 3 1 0xffffffff + OpReturnValue %8 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpVectorShuffleScalarResultType) { + string spirv = kGLSL450MemoryModel + R"( +%float = OpTypeFloat 32 +%vec2 = OpTypeVector %float 2 +%ptr_vec2 = OpTypePointer Function %vec2 +%float_1 = OpConstant %float 1 +%float_2 = OpConstant %float 2 +%1 = OpConstantComposite %vec2 %float_2 %float_1 +%2 = OpTypeFunction %float +%3 = OpFunction %float None %2 +%4 = OpLabel +%var = OpVariable %ptr_vec2 Function %1 +%5 = OpLoad %vec2 %var +%6 = OpVectorShuffle %float %5 %5 0 + OpReturnValue %6 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Result Type of OpVectorShuffle must be OpTypeVector.")); +} + +TEST_F(ValidateIdWithMessage, OpVectorShuffleComponentCount) { + string spirv = kGLSL450MemoryModel + R"( +%int = OpTypeInt 32 0 +%ivec3 = OpTypeVector %int 3 +%ptr_ivec3 = OpTypePointer Function %ivec3 +%int_42 = OpConstant %int 42 +%int_0 = OpConstant %int 0 +%int_2 = OpConstant %int 2 +%1 = OpConstantComposite %ivec3 %int_42 %int_0 %int_2 +%2 = OpTypeFunction %ivec3 +%3 = OpFunction %ivec3 None %2 +%4 = OpLabel +%var = OpVariable %ptr_ivec3 Function %1 +%5 = OpLoad %ivec3 %var +%6 = OpVectorShuffle %ivec3 %5 %5 0 1 + OpReturnValue %6 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpVectorShuffle component literals count does not match " + "Result Type '2's vector component count.")); +} + +TEST_F(ValidateIdWithMessage, OpVectorShuffleVector1Type) { + string spirv = kGLSL450MemoryModel + R"( +%int = OpTypeInt 32 0 +%ivec2 = OpTypeVector %int 2 +%ptr_int = OpTypePointer Function %int +%undef = OpUndef %ivec2 +%int_42 = OpConstant %int 42 +%2 = OpTypeFunction %ivec2 +%3 = OpFunction %ivec2 None %2 +%4 = OpLabel +%var = OpVariable %ptr_int Function %int_42 +%5 = OpLoad %int %var +%6 = OpVectorShuffle %ivec2 %5 %undef 0 0 + OpReturnValue %6 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("The type of Vector 1 must be OpTypeVector.")); +} + +TEST_F(ValidateIdWithMessage, OpVectorShuffleVector2Type) { + string spirv = kGLSL450MemoryModel + R"( +%int = OpTypeInt 32 0 +%ivec2 = OpTypeVector %int 2 +%ptr_ivec2 = OpTypePointer Function %ivec2 +%undef = OpUndef %int +%int_42 = OpConstant %int 42 +%1 = OpConstantComposite %ivec2 %int_42 %int_42 +%2 = OpTypeFunction %ivec2 +%3 = OpFunction %ivec2 None %2 +%4 = OpLabel +%var = OpVariable %ptr_ivec2 Function %1 +%5 = OpLoad %ivec2 %var +%6 = OpVectorShuffle %ivec2 %5 %undef 0 1 + OpReturnValue %6 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("The type of Vector 2 must be OpTypeVector.")); +} + +TEST_F(ValidateIdWithMessage, OpVectorShuffleVector1ComponentType) { + string spirv = kGLSL450MemoryModel + R"( +%int = OpTypeInt 32 0 +%ivec3 = OpTypeVector %int 3 +%ptr_ivec3 = OpTypePointer Function %ivec3 +%int_42 = OpConstant %int 42 +%int_0 = OpConstant %int 0 +%int_2 = OpConstant %int 2 +%float = OpTypeFloat 32 +%vec3 = OpTypeVector %float 3 +%vec4 = OpTypeVector %float 4 +%ptr_vec3 = OpTypePointer Function %vec3 +%float_1 = OpConstant %float 1 +%float_2 = OpConstant %float 2 +%1 = OpConstantComposite %ivec3 %int_42 %int_0 %int_2 +%2 = OpConstantComposite %vec3 %float_1 %float_2 %float_2 +%3 = OpTypeFunction %vec4 +%4 = OpFunction %vec4 None %3 +%5 = OpLabel +%var = OpVariable %ptr_ivec3 Function %1 +%var2 = OpVariable %ptr_vec3 Function %2 +%6 = OpLoad %ivec3 %var +%7 = OpLoad %vec3 %var2 +%8 = OpVectorShuffle %vec4 %6 %7 4 3 1 0 + OpReturnValue %8 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("The Component Type of Vector 1 must be the same as " + "ResultType.")); +} + +TEST_F(ValidateIdWithMessage, OpVectorShuffleVector2ComponentType) { + string spirv = kGLSL450MemoryModel + R"( +%int = OpTypeInt 32 0 +%ivec3 = OpTypeVector %int 3 +%ptr_ivec3 = OpTypePointer Function %ivec3 +%int_42 = OpConstant %int 42 +%int_0 = OpConstant %int 0 +%int_2 = OpConstant %int 2 +%float = OpTypeFloat 32 +%vec3 = OpTypeVector %float 3 +%vec4 = OpTypeVector %float 4 +%ptr_vec3 = OpTypePointer Function %vec3 +%float_1 = OpConstant %float 1 +%float_2 = OpConstant %float 2 +%1 = OpConstantComposite %ivec3 %int_42 %int_0 %int_2 +%2 = OpConstantComposite %vec3 %float_1 %float_2 %float_2 +%3 = OpTypeFunction %vec4 +%4 = OpFunction %vec4 None %3 +%5 = OpLabel +%var = OpVariable %ptr_ivec3 Function %1 +%var2 = OpVariable %ptr_vec3 Function %2 +%6 = OpLoad %vec3 %var2 +%7 = OpLoad %ivec3 %var +%8 = OpVectorShuffle %vec4 %6 %7 4 3 1 0 + OpReturnValue %8 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("The Component Type of Vector 2 must be the same as " + "ResultType.")); +} + +TEST_F(ValidateIdWithMessage, OpVectorShuffleLiterals) { + string spirv = kGLSL450MemoryModel + R"( +%float = OpTypeFloat 32 +%vec2 = OpTypeVector %float 2 +%vec3 = OpTypeVector %float 3 +%vec4 = OpTypeVector %float 4 +%ptr_vec2 = OpTypePointer Function %vec2 +%ptr_vec3 = OpTypePointer Function %vec3 +%float_1 = OpConstant %float 1 +%float_2 = OpConstant %float 2 +%1 = OpConstantComposite %vec2 %float_2 %float_1 +%2 = OpConstantComposite %vec3 %float_1 %float_2 %float_2 +%3 = OpTypeFunction %vec4 +%4 = OpFunction %vec4 None %3 +%5 = OpLabel +%var = OpVariable %ptr_vec2 Function %1 +%var2 = OpVariable %ptr_vec3 Function %2 +%6 = OpLoad %vec2 %var +%7 = OpLoad %vec3 %var2 +%8 = OpVectorShuffle %vec4 %6 %7 0 5 2 6 + OpReturnValue %8 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Component literal value 5 is greater than 4.")); +} + +// TODO: OpCompositeConstruct +// TODO: OpCompositeExtract +// TODO: OpCompositeInsert +// TODO: OpCopyObject +// TODO: OpTranspose +// TODO: OpSNegate +// TODO: OpFNegate +// TODO: OpNot +// TODO: OpIAdd +// TODO: OpFAdd +// TODO: OpISub +// TODO: OpFSub +// TODO: OpIMul +// TODO: OpFMul +// TODO: OpUDiv +// TODO: OpSDiv +// TODO: OpFDiv +// TODO: OpUMod +// TODO: OpSRem +// TODO: OpSMod +// TODO: OpFRem +// TODO: OpFMod +// TODO: OpVectorTimesScalar +// TODO: OpMatrixTimesScalar +// TODO: OpVectorTimesMatrix +// TODO: OpMatrixTimesVector +// TODO: OpMatrixTimesMatrix +// TODO: OpOuterProduct +// TODO: OpDot +// TODO: OpShiftRightLogical +// TODO: OpShiftRightArithmetic +// TODO: OpShiftLeftLogical +// TODO: OpBitwiseOr +// TODO: OpBitwiseXor +// TODO: OpBitwiseAnd +// TODO: OpAny +// TODO: OpAll +// TODO: OpIsNan +// TODO: OpIsInf +// TODO: OpIsFinite +// TODO: OpIsNormal +// TODO: OpSignBitSet +// TODO: OpLessOrGreater +// TODO: OpOrdered +// TODO: OpUnordered +// TODO: OpLogicalOr +// TODO: OpLogicalXor +// TODO: OpLogicalAnd +// TODO: OpSelect +// TODO: OpIEqual +// TODO: OpFOrdEqual +// TODO: OpFUnordEqual +// TODO: OpINotEqual +// TODO: OpFOrdNotEqual +// TODO: OpFUnordNotEqual +// TODO: OpULessThan +// TODO: OpSLessThan +// TODO: OpFOrdLessThan +// TODO: OpFUnordLessThan +// TODO: OpUGreaterThan +// TODO: OpSGreaterThan +// TODO: OpFOrdGreaterThan +// TODO: OpFUnordGreaterThan +// TODO: OpULessThanEqual +// TODO: OpSLessThanEqual +// TODO: OpFOrdLessThanEqual +// TODO: OpFUnordLessThanEqual +// TODO: OpUGreaterThanEqual +// TODO: OpSGreaterThanEqual +// TODO: OpFOrdGreaterThanEqual +// TODO: OpFUnordGreaterThanEqual +// TODO: OpDPdx +// TODO: OpDPdy +// TODO: OpFWidth +// TODO: OpDPdxFine +// TODO: OpDPdyFine +// TODO: OpFwidthFine +// TODO: OpDPdxCoarse +// TODO: OpDPdyCoarse +// TODO: OpFwidthCoarse +// TODO: OpLoopMerge +// TODO: OpSelectionMerge +// TODO: OpBranch + +TEST_F(ValidateIdWithMessage, OpPhiNotAType) { + string spirv = kOpenCLMemoryModel32 + R"( +%2 = OpTypeBool +%3 = OpConstantTrue %2 +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpFunction %4 None %5 +%7 = OpLabel +OpBranch %8 +%8 = OpLabel +%9 = OpPhi %3 %3 %7 +OpReturn +OpFunctionEnd + )"; + + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpPhi's type 3 is not a type instruction.")); +} + +TEST_F(ValidateIdWithMessage, OpPhiSamePredecessor) { + string spirv = kOpenCLMemoryModel32 + R"( +%2 = OpTypeBool +%3 = OpConstantTrue %2 +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpFunction %4 None %5 +%7 = OpLabel +OpBranchConditional %3 %8 %8 +%8 = OpLabel +%9 = OpPhi %2 %3 %7 +OpReturn +OpFunctionEnd + )"; + + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpPhiOddArgumentNumber) { + string spirv = kOpenCLMemoryModel32 + R"( +%2 = OpTypeBool +%3 = OpConstantTrue %2 +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpFunction %4 None %5 +%7 = OpLabel +OpBranch %8 +%8 = OpLabel +%9 = OpPhi %2 %3 +OpReturn +OpFunctionEnd + )"; + + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpPhi does not have an equal number of incoming " + "values and basic blocks.")); +} + +TEST_F(ValidateIdWithMessage, OpPhiTooFewPredecessors) { + string spirv = kOpenCLMemoryModel32 + R"( +%2 = OpTypeBool +%3 = OpConstantTrue %2 +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpFunction %4 None %5 +%7 = OpLabel +OpBranch %8 +%8 = OpLabel +%9 = OpPhi %2 +OpReturn +OpFunctionEnd + )"; + + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpPhi's number of incoming blocks (0) does not match " + "block's predecessor count (1).")); +} + +TEST_F(ValidateIdWithMessage, OpPhiTooManyPredecessors) { + string spirv = kOpenCLMemoryModel32 + R"( +%2 = OpTypeBool +%3 = OpConstantTrue %2 +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpFunction %4 None %5 +%7 = OpLabel +OpBranch %8 +%9 = OpLabel +OpReturn +%8 = OpLabel +%10 = OpPhi %2 %3 %7 %3 %9 +OpReturn +OpFunctionEnd + )"; + + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpPhi's number of incoming blocks (2) does not match " + "block's predecessor count (1).")); +} + +TEST_F(ValidateIdWithMessage, OpPhiMismatchedTypes) { + string spirv = kOpenCLMemoryModel32 + R"( +%2 = OpTypeBool +%3 = OpConstantTrue %2 +%4 = OpTypeVoid +%5 = OpTypeInt 32 0 +%6 = OpConstant %5 0 +%7 = OpTypeFunction %4 +%8 = OpFunction %4 None %7 +%9 = OpLabel +OpBranchConditional %3 %10 %11 +%11 = OpLabel +OpBranch %10 +%10 = OpLabel +%12 = OpPhi %2 %3 %9 %6 %11 +OpReturn +OpFunctionEnd + )"; + + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpPhi's result type 2 does not match incoming " + "value 6 type 5.")); +} + +TEST_F(ValidateIdWithMessage, OpPhiPredecessorNotABlock) { + string spirv = kOpenCLMemoryModel32 + R"( +%2 = OpTypeBool +%3 = OpConstantTrue %2 +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpFunction %4 None %5 +%7 = OpLabel +OpBranchConditional %3 %8 %9 +%9 = OpLabel +OpBranch %11 +%11 = OpLabel +OpBranch %8 +%8 = OpLabel +%10 = OpPhi %2 %3 %7 %3 %3 +OpReturn +OpFunctionEnd + )"; + + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpPhi's incoming basic block 3 is not an OpLabel.")); +} + +TEST_F(ValidateIdWithMessage, OpPhiNotAPredecessor) { + string spirv = kOpenCLMemoryModel32 + R"( +%2 = OpTypeBool +%3 = OpConstantTrue %2 +%4 = OpTypeVoid +%5 = OpTypeFunction %4 +%6 = OpFunction %4 None %5 +%7 = OpLabel +OpBranchConditional %3 %8 %9 +%9 = OpLabel +OpBranch %11 +%11 = OpLabel +OpBranch %8 +%8 = OpLabel +%10 = OpPhi %2 %3 %7 %3 %9 +OpReturn +OpFunctionEnd + )"; + + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpPhi's incoming basic block 9 is not a " + "predecessor of 8.")); +} + +TEST_F(ValidateIdWithMessage, OpBranchConditionalGood) { + string spirv = BranchConditionalSetup + R"( + %branch_cond = OpINotEqual %bool %i0 %i1 + OpSelectionMerge %end None + OpBranchConditional %branch_cond %target_t %target_f + )" + BranchConditionalTail; + + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); +} + +TEST_F(ValidateIdWithMessage, OpBranchConditionalWithWeightsGood) { + string spirv = BranchConditionalSetup + R"( + %branch_cond = OpINotEqual %bool %i0 %i1 + OpSelectionMerge %end None + OpBranchConditional %branch_cond %target_t %target_f 1 1 + )" + BranchConditionalTail; + + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); +} + +TEST_F(ValidateIdWithMessage, OpBranchConditional_CondIsScalarInt) { + string spirv = BranchConditionalSetup + R"( + OpSelectionMerge %end None + OpBranchConditional %i0 %target_t %target_f + )" + BranchConditionalTail; + + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Condition operand for OpBranchConditional must be of boolean type")); +} + +TEST_F(ValidateIdWithMessage, OpBranchConditional_TrueTargetIsNotLabel) { + string spirv = BranchConditionalSetup + R"( + OpSelectionMerge %end None + OpBranchConditional %i0 %i0 %target_f + )" + BranchConditionalTail; + + CompileSuccessfully(spirv.c_str()); + // EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + // EXPECT_THAT( + // getDiagnosticString(), + // HasSubstr("The 'True Label' operand for OpBranchConditional must be the + // ID of an OpLabel instruction")); + + // xxxnsubtil: this is actually caught by the ID validation instead + EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("are referenced but not defined in function")); +} + +TEST_F(ValidateIdWithMessage, OpBranchConditional_FalseTargetIsNotLabel) { + string spirv = BranchConditionalSetup + R"( + OpSelectionMerge %end None + OpBranchConditional %i0 %target_t %i0 + )" + BranchConditionalTail; + + CompileSuccessfully(spirv.c_str()); + // EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + // EXPECT_THAT( + // getDiagnosticString(), + // HasSubstr("The 'False Label' operand for OpBranchConditional must be + // the ID of an OpLabel instruction")); + + // xxxnsubtil: this is actually caught by the ID validation + EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("are referenced but not defined in function")); +} + +TEST_F(ValidateIdWithMessage, OpBranchConditional_NotEnoughWeights) { + string spirv = BranchConditionalSetup + R"( + %branch_cond = OpINotEqual %bool %i0 %i1 + OpSelectionMerge %end None + OpBranchConditional %branch_cond %target_t %target_f 1 + )" + BranchConditionalTail; + + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpBranchConditional requires either 3 or 5 parameters")); +} + +TEST_F(ValidateIdWithMessage, OpBranchConditional_TooManyWeights) { + string spirv = BranchConditionalSetup + R"( + %branch_cond = OpINotEqual %bool %i0 %i1 + OpSelectionMerge %end None + OpBranchConditional %branch_cond %target_t %target_f 1 2 3 + )" + BranchConditionalTail; + + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpBranchConditional requires either 3 or 5 parameters")); +} + +// TODO: OpSwitch + +TEST_F(ValidateIdWithMessage, OpReturnValueConstantGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeFunction %2 +%4 = OpConstant %2 42 +%5 = OpFunction %2 None %3 +%6 = OpLabel + OpReturnValue %4 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpReturnValueVariableGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 ;10 +%3 = OpTypeFunction %2 +%8 = OpTypePointer Function %2 ;18 +%4 = OpConstant %2 42 ;22 +%5 = OpFunction %2 None %3 ;27 +%6 = OpLabel ;29 +%7 = OpVariable %8 Function %4 ;34 +%9 = OpLoad %2 %7 + OpReturnValue %9 ;36 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpReturnValueExpressionGood) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeFunction %2 +%4 = OpConstant %2 42 +%5 = OpFunction %2 None %3 +%6 = OpLabel +%7 = OpIAdd %2 %4 %4 + OpReturnValue %7 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpReturnValueIsType) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeFunction %2 +%5 = OpFunction %2 None %3 +%6 = OpLabel + OpReturnValue %1 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpReturnValue Value '1' does not represent a value.")); +} + +TEST_F(ValidateIdWithMessage, OpReturnValueIsLabel) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeFunction %2 +%5 = OpFunction %2 None %3 +%6 = OpLabel + OpReturnValue %6 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpReturnValue Value '5' does not represent a value.")); +} + +TEST_F(ValidateIdWithMessage, OpReturnValueIsVoid) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeFunction %1 +%5 = OpFunction %1 None %3 +%6 = OpLabel +%7 = OpFunctionCall %1 %5 + OpReturnValue %7 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpReturnValue value's type '1' is missing or void.")); +} + +TEST_F(ValidateIdWithMessage, OpReturnValueIsVariableInPhysical) { + // It's valid to return a pointer in a physical addressing model. + string spirv = kGLSL450MemoryModel + R"( + OpMemoryModel Physical32 OpenCL +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypePointer Private %2 +%4 = OpTypeFunction %3 +%5 = OpFunction %3 None %4 +%6 = OpLabel +%7 = OpVariable %3 Function + OpReturnValue %7 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpReturnValueIsVariableInLogical) { + // It's invalid to return a pointer in a physical addressing model. + string spirv = kGLSL450MemoryModel + R"( + OpMemoryModel Logical GLSL450 +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypePointer Private %2 +%4 = OpTypeFunction %3 +%5 = OpFunction %3 None %4 +%6 = OpLabel +%7 = OpVariable %3 Function + OpReturnValue %7 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpReturnValue value's type '3' is a pointer, " + "which is invalid in the Logical addressing model.")); +} + +// With the VariablePointer Capability, the return value of a function is +// allowed to be a pointer. +TEST_F(ValidateIdWithMessage, OpReturnValueVarPtrGood) { + std::ostringstream spirv; + createVariablePointerSpirvProgram(&spirv, + "" /* Instructions to add to "main" */, + true /* Add VariablePointers Capability?*/, + true /* Use Helper Function? */); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Without the VariablePointer Capability, the return value of a function is +// *not* allowed to be a pointer. +// Disabled since using OpSelect with pointers without VariablePointers will +// fail LogicalsPass. +TEST_F(ValidateIdWithMessage, DISABLED_OpReturnValueVarPtrBad) { + std::ostringstream spirv; + createVariablePointerSpirvProgram(&spirv, + "" /* Instructions to add to "main" */, + false /* Add VariablePointers Capability?*/, + true /* Use Helper Function? */); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpReturnValue value's type '7' is a pointer, " + "which is invalid in the Logical addressing model.")); +} + +// TODO: enable when this bug is fixed: +// https://cvs.khronos.org/bugzilla/show_bug.cgi?id=15404 +TEST_F(ValidateIdWithMessage, DISABLED_OpReturnValueIsFunction) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeInt 32 0 +%3 = OpTypeFunction %2 +%5 = OpFunction %2 None %3 +%6 = OpLabel + OpReturnValue %5 + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, UndefinedTypeId) { + string spirv = kGLSL450MemoryModel + R"( +%s = OpTypeStruct %i32 +)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Forward reference operands in an OpTypeStruct must " + "first be declared using OpTypeForwardPointer.")); +} + +TEST_F(ValidateIdWithMessage, UndefinedIdScope) { + string spirv = kGLSL450MemoryModel + R"( +%u32 = OpTypeInt 32 0 +%memsem = OpConstant %u32 0 +%void = OpTypeVoid +%void_f = OpTypeFunction %void +%f = OpFunction %void None %void_f +%l = OpLabel + OpMemoryBarrier %undef %memsem + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("ID 7 has not been defined")); +} + +TEST_F(ValidateIdWithMessage, UndefinedIdMemSem) { + string spirv = kGLSL450MemoryModel + R"( +%u32 = OpTypeInt 32 0 +%scope = OpConstant %u32 0 +%void = OpTypeVoid +%void_f = OpTypeFunction %void +%f = OpFunction %void None %void_f +%l = OpLabel + OpMemoryBarrier %scope %undef + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("ID 7 has not been defined")); +} + +TEST_F(ValidateIdWithMessage, + KernelOpEntryPointAndOpInBoundsPtrAccessChainGood) { + string spirv = kOpenCLMemoryModel32 + R"( + OpEntryPoint Kernel %2 "simple_kernel" + OpSource OpenCL_C 200000 + OpDecorate %3 BuiltIn GlobalInvocationId + OpDecorate %3 Constant + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %3 LinkageAttributes "__spirv_GlobalInvocationId" Import + %5 = OpTypeInt 32 0 + %6 = OpTypeVector %5 3 + %7 = OpTypePointer UniformConstant %6 + %3 = OpVariable %7 UniformConstant + %8 = OpTypeVoid + %9 = OpTypeStruct %5 +%10 = OpTypePointer CrossWorkgroup %9 +%11 = OpTypeFunction %8 %10 +%12 = OpConstant %5 0 +%13 = OpTypePointer CrossWorkgroup %5 +%14 = OpConstant %5 42 + %2 = OpFunction %8 None %11 + %4 = OpFunctionParameter %10 +%15 = OpLabel +%16 = OpLoad %6 %3 Aligned 0 +%17 = OpCompositeExtract %5 %16 0 +%18 = OpInBoundsPtrAccessChain %13 %4 %17 %12 + OpStore %18 %14 Aligned 4 + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpPtrAccessChainGood) { + string spirv = kOpenCLMemoryModel64 + R"( + OpEntryPoint Kernel %2 "another_kernel" + OpSource OpenCL_C 200000 + OpDecorate %3 BuiltIn GlobalInvocationId + OpDecorate %3 Constant + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %3 LinkageAttributes "__spirv_GlobalInvocationId" Import + %5 = OpTypeInt 64 0 + %6 = OpTypeVector %5 3 + %7 = OpTypePointer UniformConstant %6 + %3 = OpVariable %7 UniformConstant + %8 = OpTypeVoid + %9 = OpTypeInt 32 0 +%10 = OpTypeStruct %9 +%11 = OpTypePointer CrossWorkgroup %10 +%12 = OpTypeFunction %8 %11 +%13 = OpConstant %5 4294967295 +%14 = OpConstant %9 0 +%15 = OpTypePointer CrossWorkgroup %9 +%16 = OpConstant %9 42 + %2 = OpFunction %8 None %12 + %4 = OpFunctionParameter %11 +%17 = OpLabel +%18 = OpLoad %6 %3 Aligned 0 +%19 = OpCompositeExtract %5 %18 0 +%20 = OpBitwiseAnd %5 %19 %13 +%21 = OpPtrAccessChain %15 %4 %20 %14 + OpStore %21 %16 Aligned 4 + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateIdWithMessage, OpLoadBitcastPointerGood) { + string spirv = kOpenCLMemoryModel64 + R"( +%2 = OpTypeVoid +%3 = OpTypeInt 32 0 +%4 = OpTypeFloat 32 +%5 = OpTypePointer UniformConstant %3 +%6 = OpTypePointer UniformConstant %4 +%7 = OpVariable %5 UniformConstant +%8 = OpTypeFunction %2 +%9 = OpFunction %2 None %8 +%10 = OpLabel +%11 = OpBitcast %6 %7 +%12 = OpLoad %4 %11 + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpLoadBitcastNonPointerBad) { + string spirv = kOpenCLMemoryModel64 + R"( +%2 = OpTypeVoid +%3 = OpTypeInt 32 0 +%4 = OpTypeFloat 32 +%5 = OpTypePointer UniformConstant %3 +%6 = OpTypeFunction %2 +%7 = OpVariable %5 UniformConstant +%8 = OpFunction %2 None %6 +%9 = OpLabel +%10 = OpLoad %3 %7 +%11 = OpBitcast %4 %10 +%12 = OpLoad %3 %11 + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpLoad type for pointer '11' is not a pointer type.")); +} +TEST_F(ValidateIdWithMessage, OpStoreBitcastPointerGood) { + string spirv = kOpenCLMemoryModel64 + R"( +%2 = OpTypeVoid +%3 = OpTypeInt 32 0 +%4 = OpTypeFloat 32 +%5 = OpTypePointer Function %3 +%6 = OpTypePointer Function %4 +%7 = OpTypeFunction %2 +%8 = OpConstant %3 42 +%9 = OpFunction %2 None %7 +%10 = OpLabel +%11 = OpVariable %6 Function +%12 = OpBitcast %5 %11 + OpStore %12 %8 + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} +TEST_F(ValidateIdWithMessage, OpStoreBitcastNonPointerBad) { + string spirv = kOpenCLMemoryModel64 + R"( +%2 = OpTypeVoid +%3 = OpTypeInt 32 0 +%4 = OpTypeFloat 32 +%5 = OpTypePointer Function %4 +%6 = OpTypeFunction %2 +%7 = OpConstant %4 42 +%8 = OpFunction %2 None %6 +%9 = OpLabel +%10 = OpVariable %5 Function +%11 = OpBitcast %3 %7 + OpStore %11 %7 + OpReturn + OpFunctionEnd)"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpStore type for pointer '11' is not a pointer type.")); +} + +// Result resulting from an instruction within a function may not be used +// outside that function. +TEST_F(ValidateIdWithMessage, ResultIdUsedOutsideOfFunctionBad) { + string spirv = kGLSL450MemoryModel + R"( +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpTypeInt 32 0 +%4 = OpTypePointer Function %3 +%5 = OpFunction %1 None %2 +%6 = OpLabel +%7 = OpVariable %4 Function +OpReturn +OpFunctionEnd +%8 = OpFunction %1 None %2 +%9 = OpLabel +%10 = OpLoad %3 %7 +OpReturn +OpFunctionEnd + )"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "ID 7 defined in block 6 does not dominate its use in block 9")); +} + +TEST_F(ValidateIdWithMessage, SpecIdTargetNotSpecializationConstant) { + string spirv = kGLSL450MemoryModel + R"( +OpDecorate %1 SpecId 200 +%void = OpTypeVoid +%2 = OpTypeFunction %void +%int = OpTypeInt 32 0 +%1 = OpConstant %int 3 +%main = OpFunction %1 None %2 +%4 = OpLabel +OpReturnValue %1 +OpFunctionEnd + )"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpDecorate SpectId decoration target '1' is not a " + "scalar specialization constant.")); +} + +TEST_F(ValidateIdWithMessage, SpecIdTargetOpSpecConstantOpBad) { + string spirv = kGLSL450MemoryModel + R"( +OpDecorate %1 SpecId 200 +%void = OpTypeVoid +%2 = OpTypeFunction %void +%int = OpTypeInt 32 0 +%3 = OpConstant %int 1 +%4 = OpConstant %int 2 +%1 = OpSpecConstantOp %int IAdd %3 %4 +%main = OpFunction %1 None %2 +%6 = OpLabel +OpReturnValue %3 +OpFunctionEnd + )"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpDecorate SpectId decoration target '1' is not a " + "scalar specialization constant.")); +} + +TEST_F(ValidateIdWithMessage, SpecIdTargetOpSpecConstantCompositeBad) { + string spirv = kGLSL450MemoryModel + R"( +OpDecorate %1 SpecId 200 +%void = OpTypeVoid +%2 = OpTypeFunction %void +%int = OpTypeInt 32 0 +%3 = OpConstant %int 1 +%1 = OpSpecConstantComposite %int +%main = OpFunction %1 None %2 +%4 = OpLabel +OpReturnValue %3 +OpFunctionEnd + )"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("OpDecorate SpectId decoration target '1' is not a " + "scalar specialization constant.")); +} + +TEST_F(ValidateIdWithMessage, SpecIdTargetGood) { + string spirv = kGLSL450MemoryModel + R"( +OpDecorate %3 SpecId 200 +OpDecorate %4 SpecId 201 +OpDecorate %5 SpecId 202 +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%int = OpTypeInt 32 0 +%bool = OpTypeBool +%3 = OpSpecConstant %int 3 +%4 = OpSpecConstantTrue %bool +%5 = OpSpecConstantFalse %bool +%main = OpFunction %1 None %2 +%6 = OpLabel +OpReturn +OpFunctionEnd + )"; + CompileSuccessfully(spirv.c_str()); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); +} + +// TODO: OpLifetimeStart +// TODO: OpLifetimeStop +// TODO: OpAtomicInit +// TODO: OpAtomicLoad +// TODO: OpAtomicStore +// TODO: OpAtomicExchange +// TODO: OpAtomicCompareExchange +// TODO: OpAtomicCompareExchangeWeak +// TODO: OpAtomicIIncrement +// TODO: OpAtomicIDecrement +// TODO: OpAtomicIAdd +// TODO: OpAtomicISub +// TODO: OpAtomicUMin +// TODO: OpAtomicUMax +// TODO: OpAtomicAnd +// TODO: OpAtomicOr +// TODO: OpAtomicXor +// TODO: OpAtomicIMin +// TODO: OpAtomicIMax +// TODO: OpEmitStreamVertex +// TODO: OpEndStreamPrimitive +// TODO: OpAsyncGroupCopy +// TODO: OpWaitGroupEvents +// TODO: OpGroupAll +// TODO: OpGroupAny +// TODO: OpGroupBroadcast +// TODO: OpGroupIAdd +// TODO: OpGroupFAdd +// TODO: OpGroupFMin +// TODO: OpGroupUMin +// TODO: OpGroupSMin +// TODO: OpGroupFMax +// TODO: OpGroupUMax +// TODO: OpGroupSMax +// TODO: OpEnqueueMarker +// TODO: OpEnqueueKernel +// TODO: OpGetKernelNDrangeSubGroupCount +// TODO: OpGetKernelNDrangeMaxSubGroupSize +// TODO: OpGetKernelWorkGroupSize +// TODO: OpGetKernelPreferredWorkGroupSizeMultiple +// TODO: OpRetainEvent +// TODO: OpReleaseEvent +// TODO: OpCreateUserEvent +// TODO: OpIsValidEvent +// TODO: OpSetUserEventStatus +// TODO: OpCaptureEventProfilingInfo +// TODO: OpGetDefaultQueue +// TODO: OpBuildNDRange +// TODO: OpReadPipe +// TODO: OpWritePipe +// TODO: OpReservedReadPipe +// TODO: OpReservedWritePipe +// TODO: OpReserveReadPipePackets +// TODO: OpReserveWritePipePackets +// TODO: OpCommitReadPipe +// TODO: OpCommitWritePipe +// TODO: OpIsValidReserveId +// TODO: OpGetNumPipePackets +// TODO: OpGetMaxPipePackets +// TODO: OpGroupReserveReadPipePackets +// TODO: OpGroupReserveWritePipePackets +// TODO: OpGroupCommitReadPipe +// TODO: OpGroupCommitWritePipe + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_image_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_image_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_image_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_image_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,4029 @@ +// Copyright (c) 2017 Google 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. + +// Tests for unique type declaration rules validator. + +#include +#include + +#include "gmock/gmock.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using ::testing::HasSubstr; +using ::testing::Not; + +using ValidateImage = spvtest::ValidateBase; + +std::string GenerateShaderCode( + const std::string& body, + const std::string& capabilities_and_extensions = "", + const std::string& execution_model = "Fragment", + const spv_target_env env = SPV_ENV_UNIVERSAL_1_0) { + std::ostringstream ss; + ss << R"( +OpCapability Shader +OpCapability InputAttachment +OpCapability ImageGatherExtended +OpCapability MinLod +OpCapability Sampled1D +OpCapability ImageQuery +OpCapability Int64 +OpCapability Float64 +OpCapability SparseResidency +)"; + + if (env == SPV_ENV_UNIVERSAL_1_0) { + ss << "OpCapability SampledRect\n"; + } + + ss << capabilities_and_extensions; + ss << "OpMemoryModel Logical GLSL450\n"; + ss << "OpEntryPoint " << execution_model << " %main \"main\"\n"; + + ss << R"( +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f32 = OpTypeFloat 32 +%f64 = OpTypeFloat 64 +%u32 = OpTypeInt 32 0 +%s32 = OpTypeInt 32 1 +%u64 = OpTypeInt 64 0 +%s32vec2 = OpTypeVector %s32 2 +%u32vec2 = OpTypeVector %u32 2 +%f32vec2 = OpTypeVector %f32 2 +%u32vec3 = OpTypeVector %u32 3 +%s32vec3 = OpTypeVector %s32 3 +%f32vec3 = OpTypeVector %f32 3 +%u32vec4 = OpTypeVector %u32 4 +%s32vec4 = OpTypeVector %s32 4 +%f32vec4 = OpTypeVector %f32 4 + +%f32_0 = OpConstant %f32 0 +%f32_1 = OpConstant %f32 1 +%f32_0_5 = OpConstant %f32 0.5 +%f32_0_25 = OpConstant %f32 0.25 +%f32_0_75 = OpConstant %f32 0.75 + +%f64_0 = OpConstant %f64 0 +%f64_1 = OpConstant %f64 1 + +%s32_0 = OpConstant %s32 0 +%s32_1 = OpConstant %s32 1 +%s32_2 = OpConstant %s32 2 +%s32_3 = OpConstant %s32 3 +%s32_4 = OpConstant %s32 4 +%s32_m1 = OpConstant %s32 -1 + +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u32_2 = OpConstant %u32 2 +%u32_3 = OpConstant %u32 3 +%u32_4 = OpConstant %u32 4 + +%u64_0 = OpConstant %u64 0 + +%u32vec2arr4 = OpTypeArray %u32vec2 %u32_4 +%u32vec2arr3 = OpTypeArray %u32vec2 %u32_3 +%u32arr4 = OpTypeArray %u32 %u32_4 +%u32vec3arr4 = OpTypeArray %u32vec3 %u32_4 + +%struct_u32_f32vec4 = OpTypeStruct %u32 %f32vec4 +%struct_u64_f32vec4 = OpTypeStruct %u64 %f32vec4 +%struct_u32_u32vec4 = OpTypeStruct %u32 %u32vec4 +%struct_u32_f32vec3 = OpTypeStruct %u32 %f32vec3 +%struct_f32_f32vec4 = OpTypeStruct %f32 %f32vec4 +%struct_u32_u32 = OpTypeStruct %u32 %u32 +%struct_f32_f32 = OpTypeStruct %f32 %f32 +%struct_u32 = OpTypeStruct %u32 +%struct_u32_f32_u32 = OpTypeStruct %u32 %f32 %u32 +%struct_u32_f32vec4_u32 = OpTypeStruct %u32 %f32vec4 %u32 +%struct_u32_u32arr4 = OpTypeStruct %u32 %u32arr4 + +%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 +%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 +%u32vec3_012 = OpConstantComposite %u32vec3 %u32_0 %u32_1 %u32_2 +%u32vec3_123 = OpConstantComposite %u32vec3 %u32_1 %u32_2 %u32_3 +%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 +%u32vec4_1234 = OpConstantComposite %u32vec4 %u32_1 %u32_2 %u32_3 %u32_4 + +%s32vec2_01 = OpConstantComposite %s32vec2 %s32_0 %s32_1 +%s32vec2_12 = OpConstantComposite %s32vec2 %s32_1 %s32_2 +%s32vec3_012 = OpConstantComposite %s32vec3 %s32_0 %s32_1 %s32_2 +%s32vec3_123 = OpConstantComposite %s32vec3 %s32_1 %s32_2 %s32_3 +%s32vec4_0123 = OpConstantComposite %s32vec4 %s32_0 %s32_1 %s32_2 %s32_3 +%s32vec4_1234 = OpConstantComposite %s32vec4 %s32_1 %s32_2 %s32_3 %s32_4 + +%f32vec2_00 = OpConstantComposite %f32vec2 %f32_0 %f32_0 +%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 +%f32vec2_10 = OpConstantComposite %f32vec2 %f32_1 %f32_0 +%f32vec2_11 = OpConstantComposite %f32vec2 %f32_1 %f32_1 +%f32vec2_hh = OpConstantComposite %f32vec2 %f32_0_5 %f32_0_5 + +%f32vec3_000 = OpConstantComposite %f32vec3 %f32_0 %f32_0 %f32_0 +%f32vec3_hhh = OpConstantComposite %f32vec3 %f32_0_5 %f32_0_5 %f32_0_5 + +%f32vec4_0000 = OpConstantComposite %f32vec4 %f32_0 %f32_0 %f32_0 %f32_0 + +%const_offsets = OpConstantComposite %u32vec2arr4 %u32vec2_01 %u32vec2_12 %u32vec2_01 %u32vec2_12 +%const_offsets3x2 = OpConstantComposite %u32vec2arr3 %u32vec2_01 %u32vec2_12 %u32vec2_01 +%const_offsets4xu = OpConstantComposite %u32arr4 %u32_0 %u32_0 %u32_0 %u32_0 +%const_offsets4x3 = OpConstantComposite %u32vec3arr4 %u32vec3_012 %u32vec3_012 %u32vec3_012 %u32vec3_012 + +%type_image_f32_1d_0001 = OpTypeImage %f32 1D 0 0 0 1 Unknown +%ptr_image_f32_1d_0001 = OpTypePointer UniformConstant %type_image_f32_1d_0001 +%uniform_image_f32_1d_0001 = OpVariable %ptr_image_f32_1d_0001 UniformConstant +%type_sampled_image_f32_1d_0001 = OpTypeSampledImage %type_image_f32_1d_0001 + +%type_image_f32_1d_0002_rgba32f = OpTypeImage %f32 1D 0 0 0 2 Rgba32f +%ptr_image_f32_1d_0002_rgba32f = OpTypePointer UniformConstant %type_image_f32_1d_0002_rgba32f +%uniform_image_f32_1d_0002_rgba32f = OpVariable %ptr_image_f32_1d_0002_rgba32f UniformConstant +%type_sampled_image_f32_1d_0002_rgba32f = OpTypeSampledImage %type_image_f32_1d_0002_rgba32f + +%type_image_f32_2d_0001 = OpTypeImage %f32 2D 0 0 0 1 Unknown +%ptr_image_f32_2d_0001 = OpTypePointer UniformConstant %type_image_f32_2d_0001 +%uniform_image_f32_2d_0001 = OpVariable %ptr_image_f32_2d_0001 UniformConstant +%type_sampled_image_f32_2d_0001 = OpTypeSampledImage %type_image_f32_2d_0001 + +%type_image_f32_2d_0010 = OpTypeImage %f32 2D 0 0 1 0 Unknown +%ptr_image_f32_2d_0010 = OpTypePointer UniformConstant %type_image_f32_2d_0010 +%uniform_image_f32_2d_0010 = OpVariable %ptr_image_f32_2d_0010 UniformConstant +%type_sampled_image_f32_2d_0010 = OpTypeSampledImage %type_image_f32_2d_0010 + +%type_image_u32_2d_0001 = OpTypeImage %u32 2D 0 0 0 1 Unknown +%ptr_image_u32_2d_0001 = OpTypePointer UniformConstant %type_image_u32_2d_0001 +%uniform_image_u32_2d_0001 = OpVariable %ptr_image_u32_2d_0001 UniformConstant +%type_sampled_image_u32_2d_0001 = OpTypeSampledImage %type_image_u32_2d_0001 + +%type_image_u32_2d_0000 = OpTypeImage %u32 2D 0 0 0 0 Unknown +%ptr_image_u32_2d_0000 = OpTypePointer UniformConstant %type_image_u32_2d_0000 +%uniform_image_u32_2d_0000 = OpVariable %ptr_image_u32_2d_0000 UniformConstant +%type_sampled_image_u32_2d_0000 = OpTypeSampledImage %type_image_u32_2d_0000 + +%type_image_s32_3d_0001 = OpTypeImage %s32 3D 0 0 0 1 Unknown +%ptr_image_s32_3d_0001 = OpTypePointer UniformConstant %type_image_s32_3d_0001 +%uniform_image_s32_3d_0001 = OpVariable %ptr_image_s32_3d_0001 UniformConstant +%type_sampled_image_s32_3d_0001 = OpTypeSampledImage %type_image_s32_3d_0001 + +%type_image_f32_2d_0002 = OpTypeImage %f32 2D 0 0 0 2 Unknown +%ptr_image_f32_2d_0002 = OpTypePointer UniformConstant %type_image_f32_2d_0002 +%uniform_image_f32_2d_0002 = OpVariable %ptr_image_f32_2d_0002 UniformConstant +%type_sampled_image_f32_2d_0002 = OpTypeSampledImage %type_image_f32_2d_0002 + +%type_image_f32_spd_0002 = OpTypeImage %f32 SubpassData 0 0 0 2 Unknown +%ptr_image_f32_spd_0002 = OpTypePointer UniformConstant %type_image_f32_spd_0002 +%uniform_image_f32_spd_0002 = OpVariable %ptr_image_f32_spd_0002 UniformConstant +%type_sampled_image_f32_spd_0002 = OpTypeSampledImage %type_image_f32_spd_0002 + +%type_image_f32_3d_0111 = OpTypeImage %f32 3D 0 1 1 1 Unknown +%ptr_image_f32_3d_0111 = OpTypePointer UniformConstant %type_image_f32_3d_0111 +%uniform_image_f32_3d_0111 = OpVariable %ptr_image_f32_3d_0111 UniformConstant +%type_sampled_image_f32_3d_0111 = OpTypeSampledImage %type_image_f32_3d_0111 + +%type_image_f32_cube_0101 = OpTypeImage %f32 Cube 0 1 0 1 Unknown +%ptr_image_f32_cube_0101 = OpTypePointer UniformConstant %type_image_f32_cube_0101 +%uniform_image_f32_cube_0101 = OpVariable %ptr_image_f32_cube_0101 UniformConstant +%type_sampled_image_f32_cube_0101 = OpTypeSampledImage %type_image_f32_cube_0101 + +%type_image_f32_cube_0102_rgba32f = OpTypeImage %f32 Cube 0 1 0 2 Rgba32f +%ptr_image_f32_cube_0102_rgba32f = OpTypePointer UniformConstant %type_image_f32_cube_0102_rgba32f +%uniform_image_f32_cube_0102_rgba32f = OpVariable %ptr_image_f32_cube_0102_rgba32f UniformConstant +%type_sampled_image_f32_cube_0102_rgba32f = OpTypeSampledImage %type_image_f32_cube_0102_rgba32f + +%type_sampler = OpTypeSampler +%ptr_sampler = OpTypePointer UniformConstant %type_sampler +%uniform_sampler = OpVariable %ptr_sampler UniformConstant +)"; + + if (env == SPV_ENV_UNIVERSAL_1_0) { + ss << R"( +%type_image_void_2d_0001 = OpTypeImage %void 2D 0 0 0 1 Unknown +%ptr_image_void_2d_0001 = OpTypePointer UniformConstant %type_image_void_2d_0001 +%uniform_image_void_2d_0001 = OpVariable %ptr_image_void_2d_0001 UniformConstant +%type_sampled_image_void_2d_0001 = OpTypeSampledImage %type_image_void_2d_0001 + +%type_image_void_2d_0002 = OpTypeImage %void 2D 0 0 0 2 Unknown +%ptr_image_void_2d_0002 = OpTypePointer UniformConstant %type_image_void_2d_0002 +%uniform_image_void_2d_0002 = OpVariable %ptr_image_void_2d_0002 UniformConstant +%type_sampled_image_void_2d_0002 = OpTypeSampledImage %type_image_void_2d_0002 + +%type_image_f32_rect_0001 = OpTypeImage %f32 Rect 0 0 0 1 Unknown +%ptr_image_f32_rect_0001 = OpTypePointer UniformConstant %type_image_f32_rect_0001 +%uniform_image_f32_rect_0001 = OpVariable %ptr_image_f32_rect_0001 UniformConstant +%type_sampled_image_f32_rect_0001 = OpTypeSampledImage %type_image_f32_rect_0001 +)"; + } + + ss << R"( +%main = OpFunction %void None %func +%main_entry = OpLabel +)"; + + ss << body; + + ss << R"( +OpReturn +OpFunctionEnd)"; + + return ss.str(); +} + +std::string GenerateKernelCode( + const std::string& body, + const std::string& capabilities_and_extensions = "") { + std::ostringstream ss; + ss << R"( +OpCapability Addresses +OpCapability Kernel +OpCapability Linkage +OpCapability ImageQuery +OpCapability ImageGatherExtended +OpCapability InputAttachment +OpCapability SampledRect +)"; + + ss << capabilities_and_extensions; + ss << R"( +OpMemoryModel Physical32 OpenCL +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f32 = OpTypeFloat 32 +%u32 = OpTypeInt 32 0 +%u32vec2 = OpTypeVector %u32 2 +%f32vec2 = OpTypeVector %f32 2 +%u32vec3 = OpTypeVector %u32 3 +%f32vec3 = OpTypeVector %f32 3 +%u32vec4 = OpTypeVector %u32 4 +%f32vec4 = OpTypeVector %f32 4 + +%f32_0 = OpConstant %f32 0 +%f32_1 = OpConstant %f32 1 +%f32_0_5 = OpConstant %f32 0.5 +%f32_0_25 = OpConstant %f32 0.25 +%f32_0_75 = OpConstant %f32 0.75 + +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u32_2 = OpConstant %u32 2 +%u32_3 = OpConstant %u32 3 +%u32_4 = OpConstant %u32 4 + +%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 +%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 +%u32vec3_012 = OpConstantComposite %u32vec3 %u32_0 %u32_1 %u32_2 +%u32vec3_123 = OpConstantComposite %u32vec3 %u32_1 %u32_2 %u32_3 +%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 +%u32vec4_1234 = OpConstantComposite %u32vec4 %u32_1 %u32_2 %u32_3 %u32_4 + +%f32vec2_00 = OpConstantComposite %f32vec2 %f32_0 %f32_0 +%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 +%f32vec2_10 = OpConstantComposite %f32vec2 %f32_1 %f32_0 +%f32vec2_11 = OpConstantComposite %f32vec2 %f32_1 %f32_1 +%f32vec2_hh = OpConstantComposite %f32vec2 %f32_0_5 %f32_0_5 + +%f32vec3_000 = OpConstantComposite %f32vec3 %f32_0 %f32_0 %f32_0 +%f32vec3_hhh = OpConstantComposite %f32vec3 %f32_0_5 %f32_0_5 %f32_0_5 + +%f32vec4_0000 = OpConstantComposite %f32vec4 %f32_0 %f32_0 %f32_0 %f32_0 + +%type_image_f32_2d_0001 = OpTypeImage %f32 2D 0 0 0 1 Unknown +%ptr_image_f32_2d_0001 = OpTypePointer UniformConstant %type_image_f32_2d_0001 +%uniform_image_f32_2d_0001 = OpVariable %ptr_image_f32_2d_0001 UniformConstant +%type_sampled_image_f32_2d_0001 = OpTypeSampledImage %type_image_f32_2d_0001 + +%type_image_f32_2d_0010 = OpTypeImage %f32 2D 0 0 1 0 Unknown +%ptr_image_f32_2d_0010 = OpTypePointer UniformConstant %type_image_f32_2d_0010 +%uniform_image_f32_2d_0010 = OpVariable %ptr_image_f32_2d_0010 UniformConstant +%type_sampled_image_f32_2d_0010 = OpTypeSampledImage %type_image_f32_2d_0010 + +%type_image_f32_3d_0010 = OpTypeImage %f32 3D 0 0 1 0 Unknown +%ptr_image_f32_3d_0010 = OpTypePointer UniformConstant %type_image_f32_3d_0010 +%uniform_image_f32_3d_0010 = OpVariable %ptr_image_f32_3d_0010 UniformConstant +%type_sampled_image_f32_3d_0010 = OpTypeSampledImage %type_image_f32_3d_0010 + +%type_image_f32_rect_0001 = OpTypeImage %f32 Rect 0 0 0 1 Unknown +%ptr_image_f32_rect_0001 = OpTypePointer UniformConstant %type_image_f32_rect_0001 +%uniform_image_f32_rect_0001 = OpVariable %ptr_image_f32_rect_0001 UniformConstant +%type_sampled_image_f32_rect_0001 = OpTypeSampledImage %type_image_f32_rect_0001 + +%type_sampler = OpTypeSampler +%ptr_sampler = OpTypePointer UniformConstant %type_sampler +%uniform_sampler = OpVariable %ptr_sampler UniformConstant + +%main = OpFunction %void None %func +%main_entry = OpLabel +)"; + + ss << body; + ss << R"( +OpReturn +OpFunctionEnd)"; + + return ss.str(); +} + +std::string GetShaderHeader( + const std::string& capabilities_and_extensions = "") { + std::ostringstream ss; + ss << R"( +OpCapability Shader +OpCapability Int64 +)"; + + ss << capabilities_and_extensions; + + ss << R"( +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f32 = OpTypeFloat 32 +%u32 = OpTypeInt 32 0 +%u64 = OpTypeInt 64 0 +%s32 = OpTypeInt 32 1 +)"; + + return ss.str(); +} + +TEST_F(ValidateImage, TypeImageWrongSampledType) { + const std::string code = GetShaderHeader() + R"( +%img_type = OpTypeImage %bool 2D 0 0 0 1 Unknown +)"; + + CompileSuccessfully(code.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("TypeImage: expected Sampled Type to be either void or " + "numerical scalar " + "type")); +} + +TEST_F(ValidateImage, TypeImageVoidSampledTypeVulkan) { + const std::string code = GetShaderHeader() + R"( +%img_type = OpTypeImage %void 2D 0 0 0 1 Unknown +)"; + + const spv_target_env env = SPV_ENV_VULKAN_1_0; + CompileSuccessfully(code, env); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(env)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("TypeImage: expected Sampled Type to be a 32-bit int " + "or float scalar type for Vulkan environment")); +} + +TEST_F(ValidateImage, TypeImageU64SampledTypeVulkan) { + const std::string code = GetShaderHeader() + R"( +%img_type = OpTypeImage %u64 2D 0 0 0 1 Unknown +)"; + + const spv_target_env env = SPV_ENV_VULKAN_1_0; + CompileSuccessfully(code, env); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(env)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("TypeImage: expected Sampled Type to be a 32-bit int " + "or float scalar type for Vulkan environment")); +} + +TEST_F(ValidateImage, TypeImageWrongDepth) { + const std::string code = GetShaderHeader() + R"( +%img_type = OpTypeImage %f32 2D 3 0 0 1 Unknown +)"; + + CompileSuccessfully(code.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("TypeImage: invalid Depth 3 (must be 0, 1 or 2)")); +} + +TEST_F(ValidateImage, TypeImageWrongArrayed) { + const std::string code = GetShaderHeader() + R"( +%img_type = OpTypeImage %f32 2D 0 2 0 1 Unknown +)"; + + CompileSuccessfully(code.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("TypeImage: invalid Arrayed 2 (must be 0 or 1)")); +} + +TEST_F(ValidateImage, TypeImageWrongMS) { + const std::string code = GetShaderHeader() + R"( +%img_type = OpTypeImage %f32 2D 0 0 2 1 Unknown +)"; + + CompileSuccessfully(code.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("TypeImage: invalid MS 2 (must be 0 or 1)")); +} + +TEST_F(ValidateImage, TypeImageWrongSampled) { + const std::string code = GetShaderHeader() + R"( +%img_type = OpTypeImage %f32 2D 0 0 0 3 Unknown +)"; + + CompileSuccessfully(code.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("TypeImage: invalid Sampled 3 (must be 0, 1 or 2)")); +} + +TEST_F(ValidateImage, TypeImageWrongSampledForSubpassData) { + const std::string code = GetShaderHeader("OpCapability InputAttachment\n") + + R"( +%img_type = OpTypeImage %f32 SubpassData 0 0 0 1 Unknown +)"; + + CompileSuccessfully(code.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("TypeImage: Dim SubpassData requires Sampled to be 2")); +} + +TEST_F(ValidateImage, TypeImageWrongFormatForSubpassData) { + const std::string code = GetShaderHeader("OpCapability InputAttachment\n") + + R"( +%img_type = OpTypeImage %f32 SubpassData 0 0 0 2 Rgba32f +)"; + + CompileSuccessfully(code.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("TypeImage: Dim SubpassData requires format Unknown")); +} + +TEST_F(ValidateImage, TypeSampledImageNotImage) { + const std::string code = GetShaderHeader() + R"( +%simg_type = OpTypeSampledImage %f32 +)"; + + CompileSuccessfully(code.c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("TypeSampledImage: expected Image to be of type OpTypeImage")); +} + +TEST_F(ValidateImage, SampledImageSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampledImageVulkanSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +)"; + + const spv_target_env env = SPV_ENV_VULKAN_1_0; + CompileSuccessfully(GenerateShaderCode(body, "", "Fragment", env), env); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(env)); +} + +TEST_F(ValidateImage, SampledImageWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_image_f32_2d_0001 %img %sampler +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Result Type to be OpTypeSampledImage: SampledImage")); +} + +TEST_F(ValidateImage, SampledImageNotImage) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg1 = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%simg2 = OpSampledImage %type_sampled_image_f32_2d_0001 %simg1 %sampler +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image to be of type OpTypeImage: SampledImage")); +} + +TEST_F(ValidateImage, SampledImageImageNotForSampling) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0002 %uniform_image_f32_2d_0002 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0002 %img %sampler +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected Image 'Sampled' parameter to be 0 or 1: SampledImage")); +} + +TEST_F(ValidateImage, SampledImageVulkanUnknownSampled) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0000 %uniform_image_u32_2d_0000 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_u32_2d_0000 %img %sampler +)"; + + const spv_target_env env = SPV_ENV_VULKAN_1_0; + CompileSuccessfully(GenerateShaderCode(body, "", "Fragment", env), env); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(env)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image 'Sampled' parameter to be 1 for Vulkan " + "environment: SampledImage")); +} + +TEST_F(ValidateImage, SampledImageNotSampler) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %img +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Sampler to be of type OpTypeSampler: SampledImage")); +} + +TEST_F(ValidateImage, SampleImplicitLodSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec2_hh +%res2 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec2_hh Bias %f32_0_25 +%res4 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec2_hh ConstOffset %s32vec2_01 +%res5 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec2_hh Offset %s32vec2_01 +%res6 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec2_hh MinLod %f32_0_5 +%res7 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec2_hh Bias|Offset|MinLod %f32_0_25 %s32vec2_01 %f32_0_5 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampleImplicitLodWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleImplicitLod %f32 %simg %f32vec2_hh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to be int or float vector type: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLodWrongNumComponentsResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleImplicitLod %f32vec3 %simg %f32vec2_hh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to have 4 components: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLodNotSampledImage) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageSampleImplicitLod %f32vec4 %img %f32vec2_hh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Sampled Image to be of type OpTypeSampledImage: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLodWrongSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleImplicitLod %u32vec4 %simg %f32vec2_00 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as " + "Result Type components: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLodVoidSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_void_2d_0001 %uniform_image_void_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_void_2d_0001 %img %sampler +%res1 = OpImageSampleImplicitLod %u32vec4 %simg %f32vec2_00 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampleImplicitLodWrongCoordinateType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleImplicitLod %f32vec4 %simg %img +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to be float scalar or vector: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLodCoordinateSizeTooSmall) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleImplicitLod %f32vec4 %simg %f32_0_5 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to have at least 2 components, " + "but given only 1: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleExplicitLodSuccessShader) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec4_0000 Lod %f32_1 +%res2 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec2_hh Grad %f32vec2_10 %f32vec2_01 +%res3 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec2_hh ConstOffset %s32vec2_01 +%res4 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec3_hhh Offset %s32vec2_01 +%res5 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec2_hh Grad|Offset|MinLod %f32vec2_10 %f32vec2_01 %s32vec2_01 %f32_0_5 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampleExplicitLodSuccessKernel) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleExplicitLod %f32vec4 %simg %u32vec4_0123 Lod %f32_1 +%res2 = OpImageSampleExplicitLod %f32vec4 %simg %u32vec2_01 Grad %f32vec2_10 %f32vec2_01 +%res3 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec2_hh ConstOffset %u32vec2_01 +%res4 = OpImageSampleExplicitLod %f32vec4 %simg %u32vec2_01 Offset %u32vec2_01 +%res5 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec2_hh Grad|Offset %f32vec2_10 %f32vec2_01 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampleExplicitLodSuccessCubeArrayed) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_cube_0101 %img %sampler +%res1 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec4_0000 Grad %f32vec3_hhh %f32vec3_hhh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampleExplicitLodWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleExplicitLod %f32 %simg %f32vec2_hh Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to be int or float vector type: " + "ImageSampleExplicitLod")); +} + +TEST_F(ValidateImage, SampleExplicitLodWrongNumComponentsResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleExplicitLod %f32vec3 %simg %f32vec2_hh Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to have 4 components: " + "ImageSampleExplicitLod")); +} + +TEST_F(ValidateImage, SampleExplicitLodNotSampledImage) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageSampleExplicitLod %f32vec4 %img %f32vec2_hh Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Sampled Image to be of type OpTypeSampledImage: " + "ImageSampleExplicitLod")); +} + +TEST_F(ValidateImage, SampleExplicitLodWrongSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleExplicitLod %u32vec4 %simg %f32vec2_00 Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as " + "Result Type components: " + "ImageSampleExplicitLod")); +} + +TEST_F(ValidateImage, SampleExplicitLodVoidSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_void_2d_0001 %uniform_image_void_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_void_2d_0001 %img %sampler +%res1 = OpImageSampleExplicitLod %u32vec4 %simg %f32vec2_00 Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampleExplicitLodWrongCoordinateType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleExplicitLod %f32vec4 %simg %img Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to be float scalar or vector: " + "ImageSampleExplicitLod")); +} + +TEST_F(ValidateImage, SampleExplicitLodCoordinateSizeTooSmall) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleExplicitLod %f32vec4 %simg %f32_0_5 Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to have at least 2 components, " + "but given only 1: " + "ImageSampleExplicitLod")); +} + +TEST_F(ValidateImage, SampleExplicitLodBias) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec2_00 Bias|Lod %f32_1 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Image Operand Bias can only be used with ImplicitLod opcodes: " + "ImageSampleExplicitLod")); +} + +TEST_F(ValidateImage, LodAndGrad) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec2_00 Lod|Grad %f32_1 %f32vec2_hh %f32vec2_hh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Image Operand bits Lod and Grad cannot be set at the same time: " + "ImageSampleExplicitLod")); +} + +TEST_F(ValidateImage, ImplicitLodWithLod) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res2 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec2_hh Lod %f32_0_5 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Image Operand Lod can only be used with ExplicitLod opcodes " + "and OpImageFetch: ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, LodWrongType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec2_00 Lod %f32vec2_hh)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image Operand Lod to be float scalar when " + "used with ExplicitLod: ImageSampleExplicitLod")); +} + +TEST_F(ValidateImage, LodWrongDim) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_rect_0001 %img %sampler +%res1 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec2_00 Lod %f32_0)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Image Operand Lod requires 'Dim' parameter to be 1D, " + "2D, 3D or Cube: " + "ImageSampleExplicitLod")); +} + +TEST_F(ValidateImage, LodMultisampled) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0010 %uniform_image_f32_2d_0010 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0010 %img %sampler +%res1 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec2_00 Lod %f32_0)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Image Operand Lod requires 'MS' parameter to be 0: " + "ImageSampleExplicitLod")); +} + +TEST_F(ValidateImage, MinLodIncompatible) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec2_00 Lod|MinLod %f32_0 %f32_0)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Image Operand MinLod can only be used with ImplicitLod opcodes or " + "together with Image Operand Grad: ImageSampleExplicitLod")); +} + +TEST_F(ValidateImage, ImplicitLodWithGrad) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res2 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec2_hh Grad %f32vec2_hh %f32vec2_hh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Image Operand Grad can only be used with ExplicitLod opcodes: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLod3DArrayedMultisampledSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_3d_0111 %uniform_image_f32_3d_0111 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_3d_0111 %img %sampler +%res1 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 +%res2 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 ConstOffset %s32vec3_012 +%res3 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 Offset %s32vec3_012 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampleImplicitLodCubeArrayedSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_cube_0101 %img %sampler +%res1 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 +%res2 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 Bias %f32_0_25 +%res4 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 MinLod %f32_0_5 +%res5 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 Bias|MinLod %f32_0_25 %f32_0_5 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampleImplicitLodBiasWrongType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res2 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec2_hh Bias %u32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image Operand Bias to be float scalar: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLodBiasWrongDim) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_rect_0001 %img %sampler +%res2 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec2_hh Bias %f32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Image Operand Bias requires 'Dim' parameter to be 1D, " + "2D, 3D or Cube: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLodBiasMultisampled) { + const std::string body = R"( +%img = OpLoad %type_image_f32_3d_0111 %uniform_image_f32_3d_0111 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_3d_0111 %img %sampler +%res1 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 Bias %f32_0_25 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Image Operand Bias requires 'MS' parameter to be 0: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleExplicitLodGradDxWrongType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_cube_0101 %img %sampler +%res1 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec4_0000 Grad %s32vec3_012 %f32vec3_hhh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected both Image Operand Grad ids to be float " + "scalars or vectors: " + "ImageSampleExplicitLod")); +} + +TEST_F(ValidateImage, SampleExplicitLodGradDyWrongType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_cube_0101 %img %sampler +%res1 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec4_0000 Grad %f32vec3_hhh %s32vec3_012 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected both Image Operand Grad ids to be float " + "scalars or vectors: " + "ImageSampleExplicitLod")); +} + +TEST_F(ValidateImage, SampleExplicitLodGradDxWrongSize) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_cube_0101 %img %sampler +%res1 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec4_0000 Grad %f32vec2_00 %f32vec3_hhh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected Image Operand Grad dx to have 3 components, but given 2: " + "ImageSampleExplicitLod")); +} + +TEST_F(ValidateImage, SampleExplicitLodGradDyWrongSize) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_cube_0101 %img %sampler +%res1 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec4_0000 Grad %f32vec3_hhh %f32vec2_00 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected Image Operand Grad dy to have 3 components, but given 2: " + "ImageSampleExplicitLod")); +} + +TEST_F(ValidateImage, SampleExplicitLodGradMultisampled) { + const std::string body = R"( +%img = OpLoad %type_image_f32_3d_0111 %uniform_image_f32_3d_0111 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_3d_0111 %img %sampler +%res1 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec4_0000 Grad %f32vec3_000 %f32vec3_000 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Image Operand Grad requires 'MS' parameter to be 0: " + "ImageSampleExplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLodConstOffsetCubeDim) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_cube_0101 %img %sampler +%res4 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 ConstOffset %s32vec3_012 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Image Operand ConstOffset cannot be used with Cube Image 'Dim': " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLodConstOffsetWrongType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_3d_0111 %uniform_image_f32_3d_0111 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_3d_0111 %img %sampler +%res4 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 ConstOffset %f32vec3_000 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected Image Operand ConstOffset to be int scalar or vector: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLodConstOffsetWrongSize) { + const std::string body = R"( +%img = OpLoad %type_image_f32_3d_0111 %uniform_image_f32_3d_0111 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_3d_0111 %img %sampler +%res4 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 ConstOffset %s32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image Operand ConstOffset to have 3 " + "components, but given 2: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLodConstOffsetNotConst) { + const std::string body = R"( +%img = OpLoad %type_image_f32_3d_0111 %uniform_image_f32_3d_0111 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_3d_0111 %img %sampler +%offset = OpSNegate %s32vec3 %s32vec3_012 +%res4 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 ConstOffset %offset +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image Operand ConstOffset to be a const object: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLodOffsetCubeDim) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_cube_0101 %img %sampler +%res4 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 Offset %s32vec3_012 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Image Operand Offset cannot be used with Cube Image 'Dim': " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLodOffsetWrongType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_3d_0111 %uniform_image_f32_3d_0111 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_3d_0111 %img %sampler +%res4 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 Offset %f32vec3_000 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image Operand Offset to be int scalar or vector: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLodOffsetWrongSize) { + const std::string body = R"( +%img = OpLoad %type_image_f32_3d_0111 %uniform_image_f32_3d_0111 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_3d_0111 %img %sampler +%res4 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 Offset %s32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected Image Operand Offset to have 3 components, but given 2: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLodMoreThanOneOffset) { + const std::string body = R"( +%img = OpLoad %type_image_f32_3d_0111 %uniform_image_f32_3d_0111 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_3d_0111 %img %sampler +%res4 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 ConstOffset|Offset %s32vec3_012 %s32vec3_012 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Image Operands Offset, ConstOffset, ConstOffsets " + "cannot be used together: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLodMinLodWrongType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_cube_0101 %img %sampler +%res1 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 MinLod %s32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image Operand MinLod to be float scalar: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLodMinLodWrongDim) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_rect_0001 %img %sampler +%res2 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec2_hh MinLod %f32_0_25 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Image Operand MinLod requires 'Dim' parameter to be " + "1D, 2D, 3D or Cube: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleImplicitLodMinLodMultisampled) { + const std::string body = R"( +%img = OpLoad %type_image_f32_3d_0111 %uniform_image_f32_3d_0111 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_3d_0111 %img %sampler +%res1 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 MinLod %f32_0_25 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Image Operand MinLod requires 'MS' parameter to be 0: " + "ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, SampleProjExplicitLodSuccess2D) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleProjExplicitLod %f32vec4 %simg %f32vec3_hhh Lod %f32_1 +%res3 = OpImageSampleProjExplicitLod %f32vec4 %simg %f32vec3_hhh Grad %f32vec2_10 %f32vec2_01 +%res4 = OpImageSampleProjExplicitLod %f32vec4 %simg %f32vec3_hhh ConstOffset %s32vec2_01 +%res5 = OpImageSampleProjExplicitLod %f32vec4 %simg %f32vec3_hhh Offset %s32vec2_01 +%res7 = OpImageSampleProjExplicitLod %f32vec4 %simg %f32vec3_hhh Grad|Offset %f32vec2_10 %f32vec2_01 %s32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampleProjExplicitLodSuccessRect) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_rect_0001 %img %sampler +%res1 = OpImageSampleProjExplicitLod %f32vec4 %simg %f32vec3_hhh Grad %f32vec2_10 %f32vec2_01 +%res2 = OpImageSampleProjExplicitLod %f32vec4 %simg %f32vec3_hhh Grad|Offset %f32vec2_10 %f32vec2_01 %s32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampleProjExplicitLodWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleProjExplicitLod %f32 %simg %f32vec3_hhh Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to be int or float vector type: " + "ImageSampleProjExplicitLod")); +} + +TEST_F(ValidateImage, SampleProjExplicitLodWrongNumComponentsResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleProjExplicitLod %f32vec3 %simg %f32vec3_hhh Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to have 4 components: " + "ImageSampleProjExplicitLod")); +} + +TEST_F(ValidateImage, SampleProjExplicitLodNotSampledImage) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageSampleProjExplicitLod %f32vec4 %img %f32vec3_hhh Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Sampled Image to be of type OpTypeSampledImage: " + "ImageSampleProjExplicitLod")); +} + +TEST_F(ValidateImage, SampleProjExplicitLodWrongSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleProjExplicitLod %u32vec4 %simg %f32vec3_hhh Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as " + "Result Type components: " + "ImageSampleProjExplicitLod")); +} + +TEST_F(ValidateImage, SampleProjExplicitLodVoidSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_void_2d_0001 %uniform_image_void_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_void_2d_0001 %img %sampler +%res1 = OpImageSampleProjExplicitLod %u32vec4 %simg %f32vec3_hhh Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampleProjExplicitLodWrongCoordinateType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleProjExplicitLod %f32vec4 %simg %img Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to be float scalar or vector: " + "ImageSampleProjExplicitLod")); +} + +TEST_F(ValidateImage, SampleProjExplicitLodCoordinateSizeTooSmall) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleProjExplicitLod %f32vec4 %simg %f32vec2_hh Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to have at least 3 components, " + "but given only 2: " + "ImageSampleProjExplicitLod")); +} + +TEST_F(ValidateImage, SampleProjImplicitLodSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleProjImplicitLod %f32vec4 %simg %f32vec3_hhh +%res2 = OpImageSampleProjImplicitLod %f32vec4 %simg %f32vec3_hhh Bias %f32_0_25 +%res4 = OpImageSampleProjImplicitLod %f32vec4 %simg %f32vec3_hhh ConstOffset %s32vec2_01 +%res5 = OpImageSampleProjImplicitLod %f32vec4 %simg %f32vec3_hhh Offset %s32vec2_01 +%res6 = OpImageSampleProjImplicitLod %f32vec4 %simg %f32vec3_hhh MinLod %f32_0_5 +%res7 = OpImageSampleProjImplicitLod %f32vec4 %simg %f32vec3_hhh Bias|Offset|MinLod %f32_0_25 %s32vec2_01 %f32_0_5 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampleProjImplicitLodWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleProjImplicitLod %f32 %simg %f32vec3_hhh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to be int or float vector type: " + "ImageSampleProjImplicitLod")); +} + +TEST_F(ValidateImage, SampleProjImplicitLodWrongNumComponentsResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleProjImplicitLod %f32vec3 %simg %f32vec3_hhh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to have 4 components: " + "ImageSampleProjImplicitLod")); +} + +TEST_F(ValidateImage, SampleProjImplicitLodNotSampledImage) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageSampleProjImplicitLod %f32vec4 %img %f32vec3_hhh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Sampled Image to be of type OpTypeSampledImage: " + "ImageSampleProjImplicitLod")); +} + +TEST_F(ValidateImage, SampleProjImplicitLodWrongSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleProjImplicitLod %u32vec4 %simg %f32vec3_hhh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as " + "Result Type components: " + "ImageSampleProjImplicitLod")); +} + +TEST_F(ValidateImage, SampleProjImplicitLodVoidSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_void_2d_0001 %uniform_image_void_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_void_2d_0001 %img %sampler +%res1 = OpImageSampleProjImplicitLod %u32vec4 %simg %f32vec3_hhh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampleProjImplicitLodWrongCoordinateType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleProjImplicitLod %f32vec4 %simg %img +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to be float scalar or vector: " + "ImageSampleProjImplicitLod")); +} + +TEST_F(ValidateImage, SampleProjImplicitLodCoordinateSizeTooSmall) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleProjImplicitLod %f32vec4 %simg %f32vec2_hh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to have at least 3 components, " + "but given only 2: " + "ImageSampleProjImplicitLod")); +} + +TEST_F(ValidateImage, SampleDrefImplicitLodSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0001 %uniform_image_u32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_u32_2d_0001 %img %sampler +%res1 = OpImageSampleDrefImplicitLod %u32 %simg %f32vec2_hh %f32_1 +%res2 = OpImageSampleDrefImplicitLod %u32 %simg %f32vec2_hh %f32_1 Bias %f32_0_25 +%res4 = OpImageSampleDrefImplicitLod %u32 %simg %f32vec2_hh %f32_1 ConstOffset %s32vec2_01 +%res5 = OpImageSampleDrefImplicitLod %u32 %simg %f32vec2_hh %f32_1 Offset %s32vec2_01 +%res6 = OpImageSampleDrefImplicitLod %u32 %simg %f32vec2_hh %f32_1 MinLod %f32_0_5 +%res7 = OpImageSampleDrefImplicitLod %u32 %simg %f32vec2_hh %f32_1 Bias|Offset|MinLod %f32_0_25 %s32vec2_01 %f32_0_5 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampleDrefImplicitLodWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_void_2d_0001 %uniform_image_void_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_void_2d_0001 %img %sampler +%res1 = OpImageSampleDrefImplicitLod %void %simg %f32vec2_hh %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to be int or float scalar type: " + "ImageSampleDrefImplicitLod")); +} + +TEST_F(ValidateImage, SampleDrefImplicitLodNotSampledImage) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0001 %uniform_image_u32_2d_0001 +%res1 = OpImageSampleDrefImplicitLod %u32 %img %f32vec2_hh %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Sampled Image to be of type OpTypeSampledImage: " + "ImageSampleDrefImplicitLod")); +} + +TEST_F(ValidateImage, SampleDrefImplicitLodWrongSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0001 %uniform_image_u32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_u32_2d_0001 %img %sampler +%res1 = OpImageSampleDrefImplicitLod %f32 %simg %f32vec2_00 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as Result Type: " + "ImageSampleDrefImplicitLod")); +} + +TEST_F(ValidateImage, SampleDrefImplicitLodVoidSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_void_2d_0001 %uniform_image_void_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_void_2d_0001 %img %sampler +%res1 = OpImageSampleDrefImplicitLod %u32 %simg %f32vec2_00 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as Result Type: " + "ImageSampleDrefImplicitLod")); +} + +TEST_F(ValidateImage, SampleDrefImplicitLodWrongCoordinateType) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0001 %uniform_image_u32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_u32_2d_0001 %img %sampler +%res1 = OpImageSampleDrefImplicitLod %u32 %simg %img %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to be float scalar or vector: " + "ImageSampleDrefImplicitLod")); +} + +TEST_F(ValidateImage, SampleDrefImplicitLodCoordinateSizeTooSmall) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleDrefImplicitLod %f32 %simg %f32_0_5 %f32_0_5 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to have at least 2 components, " + "but given only 1: " + "ImageSampleDrefImplicitLod")); +} + +TEST_F(ValidateImage, SampleDrefImplicitLodWrongDrefType) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0001 %uniform_image_u32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_u32_2d_0001 %img %sampler +%res1 = OpImageSampleDrefImplicitLod %u32 %simg %f32vec2_00 %f64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSampleDrefImplicitLod: " + "Expected Dref to be of 32-bit float type")); +} + +TEST_F(ValidateImage, SampleDrefExplicitLodSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_s32_3d_0001 %uniform_image_s32_3d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_s32_3d_0001 %img %sampler +%res1 = OpImageSampleDrefExplicitLod %s32 %simg %f32vec4_0000 %f32_1 Lod %f32_1 +%res3 = OpImageSampleDrefExplicitLod %s32 %simg %f32vec3_hhh %f32_1 Grad %f32vec3_hhh %f32vec3_hhh +%res4 = OpImageSampleDrefExplicitLod %s32 %simg %f32vec3_hhh %f32_1 ConstOffset %s32vec3_012 +%res5 = OpImageSampleDrefExplicitLod %s32 %simg %f32vec4_0000 %f32_1 Offset %s32vec3_012 +%res7 = OpImageSampleDrefExplicitLod %s32 %simg %f32vec3_hhh %f32_1 Grad|Offset %f32vec3_hhh %f32vec3_hhh %s32vec3_012 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampleDrefExplicitLodWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_s32_3d_0001 %uniform_image_s32_3d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_s32_3d_0001 %img %sampler +%res1 = OpImageSampleDrefExplicitLod %bool %simg %f32vec3_hhh %s32_1 Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to be int or float scalar type: " + "ImageSampleDrefExplicitLod")); +} + +TEST_F(ValidateImage, SampleDrefExplicitLodNotSampledImage) { + const std::string body = R"( +%img = OpLoad %type_image_s32_3d_0001 %uniform_image_s32_3d_0001 +%res1 = OpImageSampleDrefExplicitLod %s32 %img %f32vec3_hhh %s32_1 Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Sampled Image to be of type OpTypeSampledImage: " + "ImageSampleDrefExplicitLod")); +} + +TEST_F(ValidateImage, SampleDrefExplicitLodWrongSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_s32_3d_0001 %uniform_image_s32_3d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_s32_3d_0001 %img %sampler +%res1 = OpImageSampleDrefExplicitLod %f32 %simg %f32vec3_hhh %s32_1 Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as Result Type: " + "ImageSampleDrefExplicitLod")); +} + +TEST_F(ValidateImage, SampleDrefExplicitLodVoidSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_void_2d_0001 %uniform_image_void_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_void_2d_0001 %img %sampler +%res1 = OpImageSampleDrefExplicitLod %u32 %simg %f32vec2_00 %s32_1 Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as Result Type: " + "ImageSampleDrefExplicitLod")); +} + +TEST_F(ValidateImage, SampleDrefExplicitLodWrongCoordinateType) { + const std::string body = R"( +%img = OpLoad %type_image_s32_3d_0001 %uniform_image_s32_3d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_s32_3d_0001 %img %sampler +%res1 = OpImageSampleDrefExplicitLod %s32 %simg %img %s32_1 Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to be float scalar or vector: " + "ImageSampleDrefExplicitLod")); +} + +TEST_F(ValidateImage, SampleDrefExplicitLodCoordinateSizeTooSmall) { + const std::string body = R"( +%img = OpLoad %type_image_s32_3d_0001 %uniform_image_s32_3d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_s32_3d_0001 %img %sampler +%res1 = OpImageSampleDrefExplicitLod %s32 %simg %f32vec2_hh %s32_1 Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to have at least 3 components, " + "but given only 2: " + "ImageSampleDrefExplicitLod")); +} + +TEST_F(ValidateImage, SampleDrefExplicitLodWrongDrefType) { + const std::string body = R"( +%img = OpLoad %type_image_s32_3d_0001 %uniform_image_s32_3d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_s32_3d_0001 %img %sampler +%res1 = OpImageSampleDrefExplicitLod %s32 %simg %f32vec3_hhh %u32_1 Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSampleDrefExplicitLod: " + "Expected Dref to be of 32-bit float type")); +} + +TEST_F(ValidateImage, SampleProjDrefImplicitLodSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleProjDrefImplicitLod %f32 %simg %f32vec3_hhh %f32_0_5 +%res2 = OpImageSampleProjDrefImplicitLod %f32 %simg %f32vec3_hhh %f32_0_5 Bias %f32_0_25 +%res4 = OpImageSampleProjDrefImplicitLod %f32 %simg %f32vec3_hhh %f32_0_5 ConstOffset %s32vec2_01 +%res5 = OpImageSampleProjDrefImplicitLod %f32 %simg %f32vec3_hhh %f32_0_5 Offset %s32vec2_01 +%res6 = OpImageSampleProjDrefImplicitLod %f32 %simg %f32vec3_hhh %f32_0_5 MinLod %f32_0_5 +%res7 = OpImageSampleProjDrefImplicitLod %f32 %simg %f32vec3_hhh %f32_0_5 Bias|Offset|MinLod %f32_0_25 %s32vec2_01 %f32_0_5 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampleProjDrefImplicitLodWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleProjDrefImplicitLod %void %simg %f32vec3_hhh %f32_0_5 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to be int or float scalar type: " + "ImageSampleProjDrefImplicitLod")); +} + +TEST_F(ValidateImage, SampleProjDrefImplicitLodNotSampledImage) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageSampleProjDrefImplicitLod %f32 %img %f32vec3_hhh %f32_0_5 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Sampled Image to be of type OpTypeSampledImage: " + "ImageSampleProjDrefImplicitLod")); +} + +TEST_F(ValidateImage, SampleProjDrefImplicitLodWrongSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleProjDrefImplicitLod %u32 %simg %f32vec3_hhh %f32_0_5 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as Result Type: " + "ImageSampleProjDrefImplicitLod")); +} + +TEST_F(ValidateImage, SampleProjDrefImplicitLodVoidSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_void_2d_0001 %uniform_image_void_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_void_2d_0001 %img %sampler +%res1 = OpImageSampleProjDrefImplicitLod %u32 %simg %f32vec3_hhh %f32_0_5 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as Result Type: " + "ImageSampleProjDrefImplicitLod")); +} + +TEST_F(ValidateImage, SampleProjDrefImplicitLodWrongCoordinateType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleProjDrefImplicitLod %f32 %simg %img %f32_0_5 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to be float scalar or vector: " + "ImageSampleProjDrefImplicitLod")); +} + +TEST_F(ValidateImage, SampleProjDrefImplicitLodCoordinateSizeTooSmall) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleProjDrefImplicitLod %f32 %simg %f32vec2_hh %f32_0_5 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to have at least 3 components, " + "but given only 2: " + "ImageSampleProjDrefImplicitLod")); +} + +TEST_F(ValidateImage, SampleProjDrefImplicitLodWrongDrefType) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0001 %uniform_image_u32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_u32_2d_0001 %img %sampler +%res1 = OpImageSampleProjDrefImplicitLod %u32 %simg %f32vec3_hhh %f32vec4_0000 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSampleProjDrefImplicitLod: " + "Expected Dref to be of 32-bit float type")); +} + +TEST_F(ValidateImage, SampleProjDrefExplicitLodSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_1d_0001 %uniform_image_f32_1d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_1d_0001 %img %sampler +%res1 = OpImageSampleProjDrefExplicitLod %f32 %simg %f32vec2_hh %f32_0_5 Lod %f32_1 +%res2 = OpImageSampleProjDrefExplicitLod %f32 %simg %f32vec3_hhh %f32_0_5 Grad %f32_0_5 %f32_0_5 +%res3 = OpImageSampleProjDrefExplicitLod %f32 %simg %f32vec2_hh %f32_0_5 ConstOffset %s32_1 +%res4 = OpImageSampleProjDrefExplicitLod %f32 %simg %f32vec2_hh %f32_0_5 Offset %s32_1 +%res5 = OpImageSampleProjDrefExplicitLod %f32 %simg %f32vec2_hh %f32_0_5 Grad|Offset %f32_0_5 %f32_0_5 %s32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampleProjDrefExplicitLodWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_1d_0001 %uniform_image_f32_1d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_1d_0001 %img %sampler +%res1 = OpImageSampleProjDrefExplicitLod %bool %simg %f32vec2_hh %f32_0_5 Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to be int or float scalar type: " + "ImageSampleProjDrefExplicitLod")); +} + +TEST_F(ValidateImage, SampleProjDrefExplicitLodNotSampledImage) { + const std::string body = R"( +%img = OpLoad %type_image_f32_1d_0001 %uniform_image_f32_1d_0001 +%res1 = OpImageSampleProjDrefExplicitLod %f32 %img %f32vec2_hh %f32_0_5 Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Sampled Image to be of type OpTypeSampledImage: " + "ImageSampleProjDrefExplicitLod")); +} + +TEST_F(ValidateImage, SampleProjDrefExplicitLodWrongSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_1d_0001 %uniform_image_f32_1d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_1d_0001 %img %sampler +%res1 = OpImageSampleProjDrefExplicitLod %u32 %simg %f32vec2_hh %f32_0_5 Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as Result Type: " + "ImageSampleProjDrefExplicitLod")); +} + +TEST_F(ValidateImage, SampleProjDrefExplicitLodVoidSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_void_2d_0001 %uniform_image_void_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_void_2d_0001 %img %sampler +%res1 = OpImageSampleProjDrefExplicitLod %u32 %simg %f32vec3_hhh %f32_0_5 Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as Result Type: " + "ImageSampleProjDrefExplicitLod")); +} + +TEST_F(ValidateImage, SampleProjDrefExplicitLodWrongCoordinateType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_1d_0001 %uniform_image_f32_1d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_1d_0001 %img %sampler +%res1 = OpImageSampleProjDrefExplicitLod %f32 %simg %img %f32_0_5 Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to be float scalar or vector: " + "ImageSampleProjDrefExplicitLod")); +} + +TEST_F(ValidateImage, SampleProjDrefExplicitLodCoordinateSizeTooSmall) { + const std::string body = R"( +%img = OpLoad %type_image_f32_1d_0001 %uniform_image_f32_1d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_1d_0001 %img %sampler +%res1 = OpImageSampleProjDrefExplicitLod %f32 %simg %f32_0_5 %f32_0_5 Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to have at least 2 components, " + "but given only 1: " + "ImageSampleProjDrefExplicitLod")); +} + +TEST_F(ValidateImage, FetchSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%res1 = OpImageFetch %f32vec4 %img %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, FetchWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%res1 = OpImageFetch %f32 %img %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to be int or float vector type: " + "ImageFetch")); +} + +TEST_F(ValidateImage, FetchWrongNumComponentsResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%res1 = OpImageFetch %f32vec3 %img %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Result Type to have 4 components: ImageFetch")); +} + +TEST_F(ValidateImage, FetchNotImage) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageFetch %f32vec4 %simg %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image to be of type OpTypeImage: ImageFetch")); +} + +TEST_F(ValidateImage, FetchNotSampled) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0000 %uniform_image_u32_2d_0000 +%res1 = OpImageFetch %u32vec4 %img %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image 'Sampled' parameter to be 1: ImageFetch")); +} + +TEST_F(ValidateImage, FetchCube) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%res1 = OpImageFetch %f32vec4 %img %u32vec3_012 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Image 'Dim' cannot be Cube: ImageFetch")); +} + +TEST_F(ValidateImage, FetchWrongSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%res1 = OpImageFetch %u32vec4 %img %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as " + "Result Type components: " + "ImageFetch")); +} + +TEST_F(ValidateImage, FetchVoidSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_void_2d_0001 %uniform_image_void_2d_0001 +%res1 = OpImageFetch %f32vec4 %img %u32vec2_01 +%res2 = OpImageFetch %u32vec4 %img %u32vec2_01 +%res3 = OpImageFetch %s32vec4 %img %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, FetchWrongCoordinateType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%res1 = OpImageFetch %f32vec4 %img %f32vec2_00 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to be int scalar or vector: " + "ImageFetch")); +} + +TEST_F(ValidateImage, FetchCoordinateSizeTooSmall) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%res1 = OpImageFetch %f32vec4 %img %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to have at least 2 components, " + "but given only 1: " + "ImageFetch")); +} + +TEST_F(ValidateImage, FetchLodNotInt) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageFetch %f32vec4 %img %u32vec2_01 Lod %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image Operand Lod to be int scalar when used " + "with OpImageFetch")); +} + +TEST_F(ValidateImage, GatherSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageGather %f32vec4 %simg %f32vec4_0000 %u32_1 +%res2 = OpImageGather %f32vec4 %simg %f32vec4_0000 %u32_1 ConstOffsets %const_offsets +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, GatherWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_cube_0101 %img %sampler +%res1 = OpImageGather %f32 %simg %f32vec4_0000 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to be int or float vector type: " + "ImageGather")); +} + +TEST_F(ValidateImage, GatherWrongNumComponentsResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_cube_0101 %img %sampler +%res1 = OpImageGather %f32vec3 %simg %f32vec4_0000 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to have 4 components: " + "ImageGather")); +} + +TEST_F(ValidateImage, GatherNotSampledImage) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%res1 = OpImageGather %f32vec4 %img %f32vec4_0000 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Sampled Image to be of type OpTypeSampledImage: " + "ImageGather")); +} + +TEST_F(ValidateImage, GatherWrongSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_cube_0101 %img %sampler +%res1 = OpImageGather %u32vec4 %simg %f32vec4_0000 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as " + "Result Type components: " + "ImageGather")); +} + +TEST_F(ValidateImage, GatherVoidSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_void_2d_0001 %uniform_image_void_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_void_2d_0001 %img %sampler +%res1 = OpImageGather %u32vec4 %simg %f32vec2_00 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, GatherWrongCoordinateType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_cube_0101 %img %sampler +%res1 = OpImageGather %f32vec4 %simg %u32vec4_0123 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to be float scalar or vector: " + "ImageGather")); +} + +TEST_F(ValidateImage, GatherCoordinateSizeTooSmall) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_cube_0101 %img %sampler +%res1 = OpImageGather %f32vec4 %simg %f32_0_5 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to have at least 4 components, " + "but given only 1: " + "ImageGather")); +} + +TEST_F(ValidateImage, GatherWrongComponentType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_cube_0101 %img %sampler +%res1 = OpImageGather %f32vec4 %simg %f32vec4_0000 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Component to be 32-bit int scalar: " + "ImageGather")); +} + +TEST_F(ValidateImage, GatherComponentNot32Bit) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_cube_0101 %img %sampler +%res1 = OpImageGather %f32vec4 %simg %f32vec4_0000 %u64_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Component to be 32-bit int scalar: " + "ImageGather")); +} + +TEST_F(ValidateImage, GatherDimCube) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_cube_0101 %img %sampler +%res1 = OpImageGather %f32vec4 %simg %f32vec4_0000 %u32_1 ConstOffsets %const_offsets +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Image Operand ConstOffsets cannot be used with Cube Image 'Dim': " + "ImageGather")); +} + +TEST_F(ValidateImage, GatherConstOffsetsNotArray) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageGather %f32vec4 %simg %f32vec4_0000 %u32_1 ConstOffsets %u32vec4_0123 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image Operand ConstOffsets to be an array of size 4: " + "ImageGather")); +} + +TEST_F(ValidateImage, GatherConstOffsetsArrayWrongSize) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageGather %f32vec4 %simg %f32vec4_0000 %u32_1 ConstOffsets %const_offsets3x2 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image Operand ConstOffsets to be an array of size 4: " + "ImageGather")); +} + +TEST_F(ValidateImage, GatherConstOffsetsArrayNotVector) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageGather %f32vec4 %simg %f32vec4_0000 %u32_1 ConstOffsets %const_offsets4xu +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image Operand ConstOffsets array componenets " + "to be int vectors " + "of size 2: ImageGather")); +} + +TEST_F(ValidateImage, GatherConstOffsetsArrayVectorWrongSize) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageGather %f32vec4 %simg %f32vec4_0000 %u32_1 ConstOffsets %const_offsets4x3 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image Operand ConstOffsets array componenets " + "to be int vectors " + "of size 2: ImageGather")); +} + +TEST_F(ValidateImage, GatherConstOffsetsArrayNotConst) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%offsets = OpUndef %u32vec2arr4 +%res1 = OpImageGather %f32vec4 %simg %f32vec4_0000 %u32_1 ConstOffsets %offsets +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image Operand ConstOffsets to be a const object: " + "ImageGather")); +} + +TEST_F(ValidateImage, NotGatherWithConstOffsets) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res2 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec2_hh ConstOffsets %const_offsets +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Image Operand ConstOffsets can only be used with OpImageGather " + "and OpImageDrefGather: ImageSampleImplicitLod")); +} + +TEST_F(ValidateImage, DrefGatherSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageDrefGather %f32vec4 %simg %f32vec4_0000 %f32_0_5 +%res2 = OpImageDrefGather %f32vec4 %simg %f32vec4_0000 %f32_0_5 ConstOffsets %const_offsets +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, DrefGatherVoidSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_void_2d_0001 %uniform_image_void_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_void_2d_0001 %img %sampler +%res1 = OpImageDrefGather %u32vec4 %simg %f32vec2_00 %f32_0_5 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as " + "Result Type components: " + "ImageDrefGather")); +} + +TEST_F(ValidateImage, DrefGatherWrongDrefType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0101 %uniform_image_f32_cube_0101 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_cube_0101 %img %sampler +%res1 = OpImageDrefGather %f32vec4 %simg %f32vec4_0000 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageDrefGather: " + "Expected Dref to be of 32-bit float type")); +} + +TEST_F(ValidateImage, ReadSuccess1) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0000 %uniform_image_u32_2d_0000 +%res1 = OpImageRead %u32vec4 %img %u32vec2_01 +)"; + + const std::string extra = "\nOpCapability StorageImageReadWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, ReadSuccess2) { + const std::string body = R"( +%img = OpLoad %type_image_f32_1d_0002_rgba32f %uniform_image_f32_1d_0002_rgba32f +%res1 = OpImageRead %f32vec4 %img %u32vec2_01 +)"; + + const std::string extra = "\nOpCapability Image1D\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, ReadSuccess3) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0102_rgba32f %uniform_image_f32_cube_0102_rgba32f +%res1 = OpImageRead %f32vec4 %img %u32vec3_012 +)"; + + const std::string extra = "\nOpCapability ImageCubeArray\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, ReadSuccess4) { + const std::string body = R"( +%img = OpLoad %type_image_f32_spd_0002 %uniform_image_f32_spd_0002 +%res1 = OpImageRead %f32vec4 %img %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, ReadNeedCapabilityStorageImageReadWithoutFormat) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0000 %uniform_image_u32_2d_0000 +%res1 = OpImageRead %u32vec4 %img %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Capability StorageImageReadWithoutFormat is required " + "to read storage " + "image: ImageRead")); +} + +TEST_F(ValidateImage, ReadNeedCapabilityImage1D) { + const std::string body = R"( +%img = OpLoad %type_image_f32_1d_0002_rgba32f %uniform_image_f32_1d_0002_rgba32f +%res1 = OpImageRead %f32vec4 %img %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Capability Image1D is required to access storage image: ImageRead")); +} + +TEST_F(ValidateImage, ReadNeedCapabilityImageCubeArray) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0102_rgba32f %uniform_image_f32_cube_0102_rgba32f +%res1 = OpImageRead %f32vec4 %img %u32vec3_012 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Capability ImageCubeArray is required to access storage image: " + "ImageRead")); +} + +// TODO(atgoo@github.com) Disabled until the spec is clarified. +TEST_F(ValidateImage, DISABLED_ReadWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0000 %uniform_image_u32_2d_0000 +%res1 = OpImageRead %f32 %img %u32vec2_01 +)"; + + const std::string extra = "\nOpCapability StorageImageReadWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected Result Type to be int or float vector type: ImageRead")); +} + +// TODO(atgoo@github.com) Disabled until the spec is clarified. +TEST_F(ValidateImage, DISABLED_ReadWrongNumComponentsResultType) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0000 %uniform_image_u32_2d_0000 +%res1 = OpImageRead %f32vec3 %img %u32vec2_01 +)"; + + const std::string extra = "\nOpCapability StorageImageReadWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Result Type to have 4 components: ImageRead")); +} + +TEST_F(ValidateImage, ReadNotImage) { + const std::string body = R"( +%sampler = OpLoad %type_sampler %uniform_sampler +%res1 = OpImageRead %f32vec4 %sampler %u32vec2_01 +)"; + + const std::string extra = "\nOpCapability StorageImageReadWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image to be of type OpTypeImage: ImageRead")); +} + +TEST_F(ValidateImage, ReadImageSampled) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageRead %f32vec4 %img %u32vec2_01 +)"; + + const std::string extra = "\nOpCapability StorageImageReadWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image 'Sampled' parameter to be 0 or 2: ImageRead")); +} + +TEST_F(ValidateImage, ReadWrongSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0000 %uniform_image_u32_2d_0000 +%res1 = OpImageRead %f32vec4 %img %u32vec2_01 +)"; + + const std::string extra = "\nOpCapability StorageImageReadWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as " + "Result Type components: " + "ImageRead")); +} + +TEST_F(ValidateImage, ReadVoidSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_void_2d_0002 %uniform_image_void_2d_0002 +%res1 = OpImageRead %f32vec4 %img %u32vec2_01 +%res2 = OpImageRead %u32vec4 %img %u32vec2_01 +%res3 = OpImageRead %s32vec4 %img %u32vec2_01 +)"; + + const std::string extra = "\nOpCapability StorageImageReadWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, ReadWrongCoordinateType) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0000 %uniform_image_u32_2d_0000 +%res1 = OpImageRead %u32vec4 %img %f32vec2_00 +)"; + + const std::string extra = "\nOpCapability StorageImageReadWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Coordinate to be int scalar or vector: ImageRead")); +} + +TEST_F(ValidateImage, ReadCoordinateSizeTooSmall) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0000 %uniform_image_u32_2d_0000 +%res1 = OpImageRead %u32vec4 %img %u32_1 +)"; + + const std::string extra = "\nOpCapability StorageImageReadWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to have at least 2 components, " + "but given only 1: " + "ImageRead")); +} + +TEST_F(ValidateImage, WriteSuccess1) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0000 %uniform_image_u32_2d_0000 +%res1 = OpImageWrite %img %u32vec2_01 %u32vec4_0123 +)"; + + const std::string extra = "\nOpCapability StorageImageWriteWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, WriteSuccess2) { + const std::string body = R"( +%img = OpLoad %type_image_f32_1d_0002_rgba32f %uniform_image_f32_1d_0002_rgba32f +%res1 = OpImageWrite %img %u32_1 %f32vec4_0000 +)"; + + const std::string extra = "\nOpCapability Image1D\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, WriteSuccess3) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0102_rgba32f %uniform_image_f32_cube_0102_rgba32f +%res1 = OpImageWrite %img %u32vec3_012 %f32vec4_0000 +)"; + + const std::string extra = "\nOpCapability ImageCubeArray\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, WriteSuccess4) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0010 %uniform_image_f32_2d_0010 +;TODO(atgoo@github.com) Is it legal to write to MS image without sample index? +%res1 = OpImageWrite %img %u32vec2_01 %f32vec4_0000 +%res2 = OpImageWrite %img %u32vec2_01 %f32vec4_0000 Sample %u32_1 +)"; + + const std::string extra = "\nOpCapability StorageImageWriteWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, WriteSubpassData) { + const std::string body = R"( +%img = OpLoad %type_image_f32_spd_0002 %uniform_image_f32_spd_0002 +%res1 = OpImageWrite %img %u32vec2_01 %f32vec4_0000 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Image 'Dim' cannot be SubpassData: ImageWrite")); +} + +TEST_F(ValidateImage, WriteNeedCapabilityStorageImageWriteWithoutFormat) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0000 %uniform_image_u32_2d_0000 +%res1 = OpImageWrite %img %u32vec2_01 %u32vec4_0123 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Capability StorageImageWriteWithoutFormat is required to write to " + "storage image: ImageWrite")); +} + +TEST_F(ValidateImage, WriteNeedCapabilityImage1D) { + const std::string body = R"( +%img = OpLoad %type_image_f32_1d_0002_rgba32f %uniform_image_f32_1d_0002_rgba32f +%res1 = OpImageWrite %img %u32vec2_01 %f32vec4_0000 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Capability Image1D is required to access storage " + "image: ImageWrite")); +} + +TEST_F(ValidateImage, WriteNeedCapabilityImageCubeArray) { + const std::string body = R"( +%img = OpLoad %type_image_f32_cube_0102_rgba32f %uniform_image_f32_cube_0102_rgba32f +%res1 = OpImageWrite %img %u32vec3_012 %f32vec4_0000 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Capability ImageCubeArray is required to access storage image: " + "ImageWrite")); +} + +TEST_F(ValidateImage, WriteNotImage) { + const std::string body = R"( +%sampler = OpLoad %type_sampler %uniform_sampler +%res1 = OpImageWrite %sampler %u32vec2_01 %f32vec4_0000 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image to be of type OpTypeImage: ImageWrite")); +} + +TEST_F(ValidateImage, WriteImageSampled) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageWrite %img %u32vec2_01 %f32vec4_0000 +)"; + + const std::string extra = "\nOpCapability StorageImageWriteWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image 'Sampled' parameter to be 0 or 2: ImageWrite")); +} + +TEST_F(ValidateImage, WriteWrongCoordinateType) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0000 %uniform_image_u32_2d_0000 +%res1 = OpImageWrite %img %f32vec2_00 %u32vec4_0123 +)"; + + const std::string extra = "\nOpCapability StorageImageWriteWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Coordinate to be int scalar or vector: ImageWrite")); +} + +TEST_F(ValidateImage, WriteCoordinateSizeTooSmall) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0000 %uniform_image_u32_2d_0000 +%res1 = OpImageWrite %img %u32_1 %u32vec4_0123 +)"; + + const std::string extra = "\nOpCapability StorageImageWriteWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to have at least 2 components, " + "but given only 1: " + "ImageWrite")); +} + +TEST_F(ValidateImage, WriteTexelWrongType) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0000 %uniform_image_u32_2d_0000 +%res1 = OpImageWrite %img %u32vec2_01 %img +)"; + + const std::string extra = "\nOpCapability StorageImageWriteWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected Texel to be int or float vector or scalar: ImageWrite")); +} + +TEST_F(ValidateImage, DISABLED_WriteTexelNotVector4) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0000 %uniform_image_u32_2d_0000 +%res1 = OpImageWrite %img %u32vec2_01 %u32vec3_012 +)"; + + const std::string extra = "\nOpCapability StorageImageWriteWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Texel to have 4 components: ImageWrite")); +} + +TEST_F(ValidateImage, WriteTexelWrongComponentType) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0000 %uniform_image_u32_2d_0000 +%res1 = OpImageWrite %img %u32vec2_01 %f32vec4_0000 +)"; + + const std::string extra = "\nOpCapability StorageImageWriteWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected Image 'Sampled Type' to be the same as Texel components: " + "ImageWrite")); +} + +TEST_F(ValidateImage, WriteSampleNotInteger) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0010 %uniform_image_f32_2d_0010 +%res1 = OpImageWrite %img %u32vec2_01 %f32vec4_0000 Sample %f32_1 +)"; + + const std::string extra = "\nOpCapability StorageImageWriteWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image Operand Sample to be int scalar: " + "ImageWrite")); +} + +TEST_F(ValidateImage, SampleNotMultisampled) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0002 %uniform_image_f32_2d_0002 +%res2 = OpImageWrite %img %u32vec2_01 %f32vec4_0000 Sample %u32_1 +)"; + + const std::string extra = "\nOpCapability StorageImageWriteWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Image Operand Sample requires non-zero 'MS' parameter: ImageWrite")); +} + +TEST_F(ValidateImage, SampleWrongOpcode) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0010 %uniform_image_f32_2d_0010 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0010 %img %sampler +%res1 = OpImageSampleExplicitLod %f32vec4 %simg %f32vec2_00 Sample %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Image Operand Sample can only be used with " + "OpImageFetch, OpImageRead, OpImageWrite, " + "OpImageSparseFetch and OpImageSparseRead: " + "ImageSampleExplicitLod")); +} + +TEST_F(ValidateImage, SampleImageToImageSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%img2 = OpImage %type_image_f32_2d_0001 %simg +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SampleImageToImageWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%img2 = OpImage %type_sampled_image_f32_2d_0001 %simg +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to be OpTypeImage: Image")); +} + +TEST_F(ValidateImage, SampleImageToImageNotSampledImage) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%img2 = OpImage %type_image_f32_2d_0001 %img +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected Sample Image to be of type OpTypeSampleImage: Image")); +} + +TEST_F(ValidateImage, SampleImageToImageNotTheSameImageType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%img2 = OpImage %type_image_f32_2d_0002 %simg +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Sample Image image type to be equal to " + "Result Type: Image")); +} + +TEST_F(ValidateImage, QueryFormatSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageQueryFormat %u32 %img +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, QueryFormatWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageQueryFormat %bool %img +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected Result Type to be int scalar type: ImageQueryFormat")); +} + +TEST_F(ValidateImage, QueryFormatNotImage) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageQueryFormat %u32 %simg +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected operand to be of type OpTypeImage: ImageQueryFormat")); +} + +TEST_F(ValidateImage, QueryOrderSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageQueryOrder %u32 %img +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, QueryOrderWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageQueryOrder %bool %img +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Result Type to be int scalar type: ImageQueryOrder")); +} + +TEST_F(ValidateImage, QueryOrderNotImage) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageQueryOrder %u32 %simg +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected operand to be of type OpTypeImage: ImageQueryOrder")); +} + +TEST_F(ValidateImage, QuerySizeLodSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageQuerySizeLod %u32vec2 %img %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, QuerySizeLodWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageQuerySizeLod %f32vec2 %img %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to be int scalar or vector type: " + "ImageQuerySizeLod")); +} + +TEST_F(ValidateImage, QuerySizeLodResultTypeWrongSize) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageQuerySizeLod %u32 %img %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Result Type has 1 components, but 2 expected: ImageQuerySizeLod")); +} + +TEST_F(ValidateImage, QuerySizeLodNotImage) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageQuerySizeLod %u32vec2 %simg %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image to be of type OpTypeImage: ImageQuerySizeLod")); +} + +TEST_F(ValidateImage, QuerySizeLodWrongImageDim) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%res1 = OpImageQuerySizeLod %u32vec2 %img %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Image 'Dim' must be 1D, 2D, 3D or Cube: ImageQuerySizeLod")); +} + +TEST_F(ValidateImage, QuerySizeLodMultisampled) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0010 %uniform_image_f32_2d_0010 +%res1 = OpImageQuerySizeLod %u32vec2 %img %u32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Image 'MS' must be 0: ImageQuerySizeLod")); +} + +TEST_F(ValidateImage, QuerySizeLodWrongLodType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageQuerySizeLod %u32vec2 %img %f32_0 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Level of Detail to be int scalar: " + "ImageQuerySizeLod")); +} + +TEST_F(ValidateImage, QuerySizeSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageQuerySize %u32vec2 %img +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, QuerySizeWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageQuerySize %f32vec2 %img +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type to be int scalar or vector type: " + "ImageQuerySize")); +} + +TEST_F(ValidateImage, QuerySizeNotImage) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageQuerySize %u32vec2 %simg +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image to be of type OpTypeImage: ImageQuerySize")); +} + +// TODO(atgoo@github.com) Add more tests for OpQuerySize. + +TEST_F(ValidateImage, QueryLodSuccessKernel) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageQueryLod %f32vec2 %simg %f32vec2_hh +%res2 = OpImageQueryLod %f32vec2 %simg %u32vec2_01 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, QueryLodSuccessShader) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageQueryLod %f32vec2 %simg %f32vec2_hh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, QueryLodWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageQueryLod %u32vec2 %simg %f32vec2_hh +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Result Type to be float vector type: ImageQueryLod")); +} + +TEST_F(ValidateImage, QueryLodResultTypeWrongSize) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageQueryLod %f32vec3 %simg %f32vec2_hh +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Result Type to have 2 components: ImageQueryLod")); +} + +TEST_F(ValidateImage, QueryLodNotSampledImage) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageQueryLod %f32vec2 %img %f32vec2_hh +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image operand to be of type OpTypeSampledImage: " + "ImageQueryLod")); +} + +TEST_F(ValidateImage, QueryLodWrongDim) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_rect_0001 %img %sampler +%res1 = OpImageQueryLod %f32vec2 %simg %f32vec2_hh +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Image 'Dim' must be 1D, 2D, 3D or Cube: ImageQueryLod")); +} + +TEST_F(ValidateImage, QueryLodWrongCoordinateType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageQueryLod %f32vec2 %simg %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected Coordinate to be float scalar or vector: ImageQueryLod")); +} + +TEST_F(ValidateImage, QueryLodCoordinateSizeTooSmall) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageQueryLod %f32vec2 %simg %f32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Coordinate to have at least 2 components, " + "but given only 1: " + "ImageQueryLod")); +} + +TEST_F(ValidateImage, QueryLevelsSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageQueryLevels %u32 %img +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, QueryLevelsWrongResultType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageQueryLevels %f32 %img +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected Result Type to be int scalar type: ImageQueryLevels")); +} + +TEST_F(ValidateImage, QueryLevelsNotImage) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageQueryLevels %u32 %simg +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected Image to be of type OpTypeImage: ImageQueryLevels")); +} + +TEST_F(ValidateImage, QueryLevelsWrongDim) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%res1 = OpImageQueryLevels %u32 %img +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Image 'Dim' must be 1D, 2D, 3D or Cube: ImageQueryLevels")); +} + +TEST_F(ValidateImage, QuerySamplesSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0010 %uniform_image_f32_2d_0010 +%res1 = OpImageQuerySamples %u32 %img +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, QuerySamplesNot2D) { + const std::string body = R"( +%img = OpLoad %type_image_f32_3d_0010 %uniform_image_f32_3d_0010 +%res1 = OpImageQuerySamples %u32 %img +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Image 'Dim' must be 2D: ImageQuerySamples")); +} + +TEST_F(ValidateImage, QuerySamplesNotMultisampled) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%res1 = OpImageQuerySamples %u32 %img +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Image 'MS' must be 1: ImageQuerySamples")); +} + +TEST_F(ValidateImage, QueryLodWrongExecutionModel) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageQueryLod %f32vec2 %simg %f32vec2_hh +)"; + + CompileSuccessfully(GenerateShaderCode(body, "", "Vertex").c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpImageQueryLod requires Fragment execution model")); +} + +TEST_F(ValidateImage, QueryLodWrongExecutionModelWithFunc) { + const std::string body = R"( +%call_ret = OpFunctionCall %void %my_func +OpReturn +OpFunctionEnd +%my_func = OpFunction %void None %func +%my_func_entry = OpLabel +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageQueryLod %f32vec2 %simg %f32vec2_hh +)"; + + CompileSuccessfully(GenerateShaderCode(body, "", "Vertex").c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpImageQueryLod requires Fragment execution model")); +} + +TEST_F(ValidateImage, ImplicitLodWrongExecutionModel) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec2_hh +)"; + + CompileSuccessfully(GenerateShaderCode(body, "", "Vertex").c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("ImplicitLod instructions require Fragment execution model")); +} + +TEST_F(ValidateImage, ReadSubpassDataWrongExecutionModel) { + const std::string body = R"( +%img = OpLoad %type_image_f32_spd_0002 %uniform_image_f32_spd_0002 +%res1 = OpImageRead %f32vec4 %img %u32vec2_01 +)"; + + const std::string extra = "\nOpCapability StorageImageReadWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra, "Vertex").c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Dim SubpassData requires Fragment execution model: ImageRead")); +} + +TEST_F(ValidateImage, SparseSampleImplicitLodSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseSampleImplicitLod %struct_u32_f32vec4 %simg %f32vec2_hh +%res2 = OpImageSparseSampleImplicitLod %struct_u32_f32vec4 %simg %f32vec2_hh Bias %f32_0_25 +%res4 = OpImageSparseSampleImplicitLod %struct_u32_f32vec4 %simg %f32vec2_hh ConstOffset %s32vec2_01 +%res5 = OpImageSparseSampleImplicitLod %struct_u32_f32vec4 %simg %f32vec2_hh Offset %s32vec2_01 +%res6 = OpImageSparseSampleImplicitLod %struct_u32_f32vec4 %simg %f32vec2_hh MinLod %f32_0_5 +%res7 = OpImageSparseSampleImplicitLod %struct_u64_f32vec4 %simg %f32vec2_hh Bias|Offset|MinLod %f32_0_25 %s32vec2_01 %f32_0_5 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SparseSampleImplicitLodResultTypeNotStruct) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseSampleImplicitLod %f32 %simg %f32vec2_hh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSparseSampleImplicitLod: " + "expected Result Type to be OpTypeStruct")); +} + +TEST_F(ValidateImage, SparseSampleImplicitLodResultTypeNotTwoMembers1) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseSampleImplicitLod %struct_u32 %simg %f32vec2_hh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSparseSampleImplicitLod: expected Result Type " + "to be a struct containing an int scalar and a texel")); +} + +TEST_F(ValidateImage, SparseSampleImplicitLodResultTypeNotTwoMembers2) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseSampleImplicitLod %struct_u32_f32vec4_u32 %simg %f32vec2_hh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSparseSampleImplicitLod: expected Result Type " + "to be a struct containing an int scalar and a texel")); +} + +TEST_F(ValidateImage, SparseSampleImplicitLodResultTypeFirstMemberNotInt) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseSampleImplicitLod %struct_f32_f32vec4 %simg %f32vec2_hh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSparseSampleImplicitLod: expected Result Type " + "to be a struct containing an int scalar and a texel")); +} + +TEST_F(ValidateImage, SparseSampleImplicitLodResultTypeTexelNotVector) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseSampleImplicitLod %struct_u32_u32 %simg %f32vec2_hh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type's second member to be int or " + "float vector type: ImageSparseSampleImplicitLod")); +} + +TEST_F(ValidateImage, SparseSampleImplicitLodWrongNumComponentsTexel) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseSampleImplicitLod %struct_u32_f32vec3 %simg %f32vec2_hh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type's second member to have 4 " + "components: ImageSparseSampleImplicitLod")); +} + +TEST_F(ValidateImage, SparseSampleImplicitLodWrongComponentTypeTexel) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseSampleImplicitLod %struct_u32_u32vec4 %simg %f32vec2_hh +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as " + "Result Type's second member components: " + "ImageSparseSampleImplicitLod")); +} + +TEST_F(ValidateImage, SparseSampleDrefImplicitLodSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_u32_2d_0001 %uniform_image_u32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_u32_2d_0001 %img %sampler +%res1 = OpImageSparseSampleDrefImplicitLod %struct_u32_u32 %simg %f32vec2_hh %f32_1 +%res2 = OpImageSparseSampleDrefImplicitLod %struct_u32_u32 %simg %f32vec2_hh %f32_1 Bias %f32_0_25 +%res4 = OpImageSparseSampleDrefImplicitLod %struct_u32_u32 %simg %f32vec2_hh %f32_1 ConstOffset %s32vec2_01 +%res5 = OpImageSparseSampleDrefImplicitLod %struct_u32_u32 %simg %f32vec2_hh %f32_1 Offset %s32vec2_01 +%res6 = OpImageSparseSampleDrefImplicitLod %struct_u32_u32 %simg %f32vec2_hh %f32_1 MinLod %f32_0_5 +%res7 = OpImageSparseSampleDrefImplicitLod %struct_u32_u32 %simg %f32vec2_hh %f32_1 Bias|Offset|MinLod %f32_0_25 %s32vec2_01 %f32_0_5 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SparseSampleDrefImplicitLodResultTypeNotStruct) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseSampleDrefImplicitLod %f32 %simg %f32vec2_hh %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSparseSampleDrefImplicitLod: " + "expected Result Type to be OpTypeStruct")); +} + +TEST_F(ValidateImage, SparseSampleDrefImplicitLodResultTypeNotTwoMembers1) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseSampleDrefImplicitLod %struct_u32 %simg %f32vec2_hh %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("ImageSparseSampleDrefImplicitLod: expected Result Type " + "to be a struct containing an int scalar and a texel")); +} + +TEST_F(ValidateImage, SparseSampleDrefImplicitLodResultTypeNotTwoMembers2) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseSampleDrefImplicitLod %struct_u32_f32_u32 %simg %f32vec2_hh %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("ImageSparseSampleDrefImplicitLod: expected Result Type " + "to be a struct containing an int scalar and a texel")); +} + +TEST_F(ValidateImage, SparseSampleDrefImplicitLodResultTypeFirstMemberNotInt) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseSampleDrefImplicitLod %struct_f32_f32 %simg %f32vec2_hh %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("ImageSparseSampleDrefImplicitLod: expected Result Type " + "to be a struct containing an int scalar and a texel")); +} + +TEST_F(ValidateImage, SparseSampleDrefImplicitLodDifferentSampledType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseSampleDrefImplicitLod %struct_u32_u32 %simg %f32vec2_hh %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as " + "Result Type's second member: " + "ImageSparseSampleDrefImplicitLod")); +} + +TEST_F(ValidateImage, SparseFetchSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%res1 = OpImageSparseFetch %struct_u32_f32vec4 %img %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SparseFetchResultTypeNotStruct) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%res1 = OpImageSparseFetch %f32 %img %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSparseFetch: " + "expected Result Type to be OpTypeStruct")); +} + +TEST_F(ValidateImage, SparseFetchResultTypeNotTwoMembers1) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%res1 = OpImageSparseFetch %struct_u32 %img %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSparseFetch: expected Result Type " + "to be a struct containing an int scalar and a texel")); +} + +TEST_F(ValidateImage, SparseFetchResultTypeNotTwoMembers2) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%res1 = OpImageSparseFetch %struct_u32_f32vec4_u32 %img %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSparseFetch: expected Result Type " + "to be a struct containing an int scalar and a texel")); +} + +TEST_F(ValidateImage, SparseFetchResultTypeFirstMemberNotInt) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%res1 = OpImageSparseFetch %struct_f32_f32vec4 %img %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSparseFetch: expected Result Type " + "to be a struct containing an int scalar and a texel")); +} + +TEST_F(ValidateImage, SparseFetchResultTypeTexelNotVector) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%res1 = OpImageSparseFetch %struct_u32_u32 %img %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type's second member to be int or " + "float vector type: ImageSparseFetch")); +} + +TEST_F(ValidateImage, SparseFetchWrongNumComponentsTexel) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%res1 = OpImageSparseFetch %struct_u32_f32vec3 %img %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type's second member to have 4 " + "components: ImageSparseFetch")); +} + +TEST_F(ValidateImage, SparseFetchWrongComponentTypeTexel) { + const std::string body = R"( +%img = OpLoad %type_image_f32_rect_0001 %uniform_image_f32_rect_0001 +%res1 = OpImageSparseFetch %struct_u32_u32vec4 %img %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as " + "Result Type's second member components: " + "ImageSparseFetch")); +} + +TEST_F(ValidateImage, SparseReadSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0002 %uniform_image_f32_2d_0002 +%res1 = OpImageSparseRead %struct_u32_f32vec4 %img %u32vec2_01 +)"; + + const std::string extra = "\nOpCapability StorageImageReadWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SparseReadResultTypeNotStruct) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0002 %uniform_image_f32_2d_0002 +%res1 = OpImageSparseRead %f32 %img %u32vec2_01 +)"; + + const std::string extra = "\nOpCapability StorageImageReadWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSparseRead: " + "expected Result Type to be OpTypeStruct")); +} + +TEST_F(ValidateImage, SparseReadResultTypeNotTwoMembers1) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0002 %uniform_image_f32_2d_0002 +%res1 = OpImageSparseRead %struct_u32 %img %u32vec2_01 +)"; + + const std::string extra = "\nOpCapability StorageImageReadWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSparseRead: expected Result Type " + "to be a struct containing an int scalar and a texel")); +} + +TEST_F(ValidateImage, SparseReadResultTypeNotTwoMembers2) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0002 %uniform_image_f32_2d_0002 +%res1 = OpImageSparseRead %struct_u32_f32vec4_u32 %img %u32vec2_01 +)"; + + const std::string extra = "\nOpCapability StorageImageReadWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSparseRead: expected Result Type " + "to be a struct containing an int scalar and a texel")); +} + +TEST_F(ValidateImage, SparseReadResultTypeFirstMemberNotInt) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0002 %uniform_image_f32_2d_0002 +%res1 = OpImageSparseRead %struct_f32_f32vec4 %img %u32vec2_01 +)"; + + const std::string extra = "\nOpCapability StorageImageReadWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSparseRead: expected Result Type " + "to be a struct containing an int scalar and a texel")); +} + +TEST_F(ValidateImage, SparseReadResultTypeTexelWrongType) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0002 %uniform_image_f32_2d_0002 +%res1 = OpImageSparseRead %struct_u32_u32arr4 %img %u32vec2_01 +)"; + + const std::string extra = "\nOpCapability StorageImageReadWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type's second member to be int or " + "float scalar or vector type: ImageSparseRead")); +} + +TEST_F(ValidateImage, SparseReadWrongComponentTypeTexel) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0002 %uniform_image_f32_2d_0002 +%res1 = OpImageSparseRead %struct_u32_u32vec4 %img %u32vec2_01 +)"; + + const std::string extra = "\nOpCapability StorageImageReadWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as " + "Result Type's second member components: " + "ImageSparseRead")); +} + +TEST_F(ValidateImage, SparseReadSubpassDataNotAllowed) { + const std::string body = R"( +%img = OpLoad %type_image_f32_spd_0002 %uniform_image_f32_spd_0002 +%res1 = OpImageSparseRead %struct_u32_f32vec4 %img %u32vec2_01 +)"; + + const std::string extra = "\nOpCapability StorageImageReadWithoutFormat\n"; + CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment").c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Image Dim SubpassData cannot be used with ImageSparseRead")); +} + +TEST_F(ValidateImage, SparseGatherSuccess) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseGather %struct_u32_f32vec4 %simg %f32vec4_0000 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SparseGatherResultTypeNotStruct) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseGather %f32 %simg %f32vec2_hh %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSparseGather: " + "expected Result Type to be OpTypeStruct")); +} + +TEST_F(ValidateImage, SparseGatherResultTypeNotTwoMembers1) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseGather %struct_u32 %simg %f32vec2_hh %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSparseGather: expected Result Type " + "to be a struct containing an int scalar and a texel")); +} + +TEST_F(ValidateImage, SparseGatherResultTypeNotTwoMembers2) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseGather %struct_u32_f32vec4_u32 %simg %f32vec2_hh %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSparseGather: expected Result Type " + "to be a struct containing an int scalar and a texel")); +} + +TEST_F(ValidateImage, SparseGatherResultTypeFirstMemberNotInt) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseGather %struct_f32_f32vec4 %simg %f32vec2_hh %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSparseGather: expected Result Type " + "to be a struct containing an int scalar and a texel")); +} + +TEST_F(ValidateImage, SparseGatherResultTypeTexelNotVector) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseGather %struct_u32_u32 %simg %f32vec2_hh %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type's second member to be int or " + "float vector type: ImageSparseGather")); +} + +TEST_F(ValidateImage, SparseGatherWrongNumComponentsTexel) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseGather %struct_u32_f32vec3 %simg %f32vec2_hh %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Result Type's second member to have 4 " + "components: ImageSparseGather")); +} + +TEST_F(ValidateImage, SparseGatherWrongComponentTypeTexel) { + const std::string body = R"( +%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001 +%sampler = OpLoad %type_sampler %uniform_sampler +%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler +%res1 = OpImageSparseGather %struct_u32_u32vec4 %simg %f32vec2_hh %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected Image 'Sampled Type' to be the same as " + "Result Type's second member components: " + "ImageSparseGather")); +} + +TEST_F(ValidateImage, SparseTexelsResidentSuccess) { + const std::string body = R"( +%res1 = OpImageSparseTexelsResident %bool %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateImage, SparseTexelsResidentResultTypeNotBool) { + const std::string body = R"( +%res1 = OpImageSparseTexelsResident %u32 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("ImageSparseTexelsResident: " + "expected Result Type to be bool scalar type")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_layout_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_layout_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_layout_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_layout_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,612 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Validation tests for Logical Layout + +#include +#include +#include +#include + +#include "gmock/gmock.h" +#include "source/diagnostic.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +using std::function; +using std::ostream; +using std::ostream_iterator; +using std::pair; +using std::string; +using std::stringstream; +using std::tie; +using std::tuple; +using std::vector; + +using libspirv::spvResultToString; +using ::testing::Eq; +using ::testing::HasSubstr; +using ::testing::StrEq; + +using pred_type = function; +using ValidateLayout = + spvtest::ValidateBase>>; + +namespace { + +// returns true if order is equal to VAL +template +spv_result_t Equals(int order) { + return order == VAL ? SPV_SUCCESS : RET; +} + +// returns true if order is between MIN and MAX(inclusive) +template +struct Range { + explicit Range(bool inverse = false) : inverse_(inverse) {} + spv_result_t operator()(int order) { + return (inverse_ ^ (order >= MIN && order <= MAX)) ? SPV_SUCCESS : RET; + } + + private: + bool inverse_; +}; + +template +spv_result_t InvalidSet(int order) { + for (spv_result_t val : {T(true)(order)...}) + if (val != SPV_SUCCESS) return val; + return SPV_SUCCESS; +} + +// SPIRV source used to test the logical layout +const vector& getInstructions() { + // clang-format off + static const vector instructions = { + "OpCapability Shader", + "OpExtension \"TestExtension\"", + "%inst = OpExtInstImport \"GLSL.std.450\"", + "OpMemoryModel Logical GLSL450", + "OpEntryPoint GLCompute %func \"\"", + "OpExecutionMode %func LocalSize 1 1 1", + "%str = OpString \"Test String\"", + "%str2 = OpString \"blabla\"", + "OpSource GLSL 450 %str \"uniform vec3 var = vec3(4.0);\"", + "OpSourceContinued \"void main(){return;}\"", + "OpSourceExtension \"Test extension\"", + "OpName %func \"MyFunction\"", + "OpMemberName %struct 1 \"my_member\"", + "OpDecorate %dgrp RowMajor", + "OpMemberDecorate %struct 1 RowMajor", + "%dgrp = OpDecorationGroup", + "OpGroupDecorate %dgrp %mat33 %mat44", + "%intt = OpTypeInt 32 1", + "%floatt = OpTypeFloat 32", + "%voidt = OpTypeVoid", + "%boolt = OpTypeBool", + "%vec4 = OpTypeVector %floatt 4", + "%vec3 = OpTypeVector %floatt 3", + "%mat33 = OpTypeMatrix %vec3 3", + "%mat44 = OpTypeMatrix %vec4 4", + "%struct = OpTypeStruct %intt %mat33", + "%vfunct = OpTypeFunction %voidt", + "%viifunct = OpTypeFunction %voidt %intt %intt", + "%one = OpConstant %intt 1", + // TODO(umar): OpConstant fails because the type is not defined + // TODO(umar): OpGroupMemberDecorate + "OpLine %str 3 4", + "OpNoLine", + "%func = OpFunction %voidt None %vfunct", + "%l = OpLabel", + "OpReturn ; %func return", + "OpFunctionEnd ; %func end", + "%func2 = OpFunction %voidt None %viifunct", + "%funcp1 = OpFunctionParameter %intt", + "%funcp2 = OpFunctionParameter %intt", + "%fLabel = OpLabel", + "OpNop", + "OpReturn ; %func2 return", + "OpFunctionEnd" + }; + return instructions; +} + +static const int kRangeEnd = 1000; +pred_type All = Range<0, kRangeEnd>(); + +INSTANTIATE_TEST_CASE_P(InstructionsOrder, + ValidateLayout, + ::testing::Combine(::testing::Range((int)0, (int)getInstructions().size()), + // Note: Because of ID dependencies between instructions, some instructions + // are not free to be placed anywhere without triggering an non-layout + // validation error. Therefore, "Lines to compile" for some instructions + // are not "All" in the below. + // + // | Instruction | Line(s) valid | Lines to compile + ::testing::Values( make_tuple(string("OpCapability") , Equals<0> , Range<0, 2>()) + , make_tuple(string("OpExtension") , Equals<1> , All) + , make_tuple(string("OpExtInstImport") , Equals<2> , All) + , make_tuple(string("OpMemoryModel") , Equals<3> , Range<1, kRangeEnd>()) + , make_tuple(string("OpEntryPoint") , Equals<4> , All) + , make_tuple(string("OpExecutionMode") , Equals<5> , All) + , make_tuple(string("OpSource ") , Range<6, 10>() , Range<7, kRangeEnd>()) + , make_tuple(string("OpSourceContinued ") , Range<6, 10>() , All) + , make_tuple(string("OpSourceExtension ") , Range<6, 10>() , All) + , make_tuple(string("%str2 = OpString ") , Range<6, 10>() , All) + , make_tuple(string("OpName ") , Range<11, 12>() , All) + , make_tuple(string("OpMemberName ") , Range<11, 12>() , All) + , make_tuple(string("OpDecorate ") , Range<13, 16>() , All) + , make_tuple(string("OpMemberDecorate ") , Range<13, 16>() , All) + , make_tuple(string("OpGroupDecorate ") , Range<13, 16>() , Range<16, kRangeEnd>()) + , make_tuple(string("OpDecorationGroup") , Range<13, 16>() , Range<0, 15>()) + , make_tuple(string("OpTypeBool") , Range<17, 30>() , All) + , make_tuple(string("OpTypeVoid") , Range<17, 30>() , Range<0, 25>()) + , make_tuple(string("OpTypeFloat") , Range<17, 30>() , Range<0,20>()) + , make_tuple(string("OpTypeInt") , Range<17, 30>() , Range<0, 20>()) + , make_tuple(string("OpTypeVector %floatt 4") , Range<17, 30>() , Range<19, 23>()) + , make_tuple(string("OpTypeMatrix %vec4 4") , Range<17, 30>() , Range<22, kRangeEnd>()) + , make_tuple(string("OpTypeStruct") , Range<17, 30>() , Range<24, kRangeEnd>()) + , make_tuple(string("%vfunct = OpTypeFunction"), Range<17, 30>() , Range<20, 30>()) + , make_tuple(string("OpConstant") , Range<17, 30>() , Range<20, kRangeEnd>()) + , make_tuple(string("OpLine ") , Range<17, kRangeEnd>() , Range<7, kRangeEnd>()) + , make_tuple(string("OpNoLine") , Range<17, kRangeEnd>() , All) + , make_tuple(string("%fLabel = OpLabel") , Equals<38> , All) + , make_tuple(string("OpNop") , Equals<39> , Range<39,kRangeEnd>()) + , make_tuple(string("OpReturn ; %func2 return") , Equals<40> , All) + )),); +// clang-format on + +// Creates a new vector which removes the string if the substr is found in the +// instructions vector and reinserts it in the location specified by order. +// NOTE: This will not work correctly if there are two instances of substr in +// instructions +vector GenerateCode(string substr, int order) { + vector code(getInstructions().size()); + vector inst(1); + partition_copy(begin(getInstructions()), end(getInstructions()), begin(code), + begin(inst), [=](const string& str) { + return string::npos == str.find(substr); + }); + + code.insert(begin(code) + order, inst.front()); + return code; +} + +// This test will check the logical layout of a binary by removing each +// instruction in the pair of the INSTANTIATE_TEST_CASE_P call and moving it in +// the SPIRV source formed by combining the vector "instructions". +TEST_P(ValidateLayout, Layout) { + int order; + string instruction; + pred_type pred; + pred_type test_pred; // Predicate to determine if the test should be build + tuple testCase; + + tie(order, testCase) = GetParam(); + tie(instruction, pred, test_pred) = testCase; + + // Skip test which break the code generation + if (test_pred(order)) return; + + vector code = GenerateCode(instruction, order); + + stringstream ss; + copy(begin(code), end(code), ostream_iterator(ss, "\n")); + + // printf("code: \n%s\n", ss.str().c_str()); + CompileSuccessfully(ss.str()); + spv_result_t result; + // clang-format off + ASSERT_EQ(pred(order), result = ValidateInstructions()) + << "Actual: " << spvResultToString(result) + << "\nExpected: " << spvResultToString(pred(order)) + << "\nOrder: " << order + << "\nInstruction: " << instruction + << "\nCode: \n" << ss.str(); + // clang-format on +} + +TEST_F(ValidateLayout, MemoryModelMissing) { + string str = R"( + OpCapability Matrix + OpExtension "TestExtension" + %inst = OpExtInstImport "GLSL.std.450" + OpEntryPoint GLCompute %func "" + OpExecutionMode %func LocalSize 1 1 1 + )"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "EntryPoint cannot appear before the memory model instruction")); +} + +TEST_F(ValidateLayout, FunctionDefinitionBeforeDeclarationBad) { + char str[] = R"( + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpDecorate %var Restrict +%intt = OpTypeInt 32 1 +%voidt = OpTypeVoid +%vfunct = OpTypeFunction %voidt +%vifunct = OpTypeFunction %voidt %intt +%ptrt = OpTypePointer Function %intt +%func = OpFunction %voidt None %vfunct +%funcl = OpLabel + OpNop + OpReturn + OpFunctionEnd +%func2 = OpFunction %voidt None %vifunct ; must appear before definition +%func2p = OpFunctionParameter %intt + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Function declarations must appear before function definitions.")); +} + +// TODO(umar): Passes but gives incorrect error message. Should be fixed after +// type checking +TEST_F(ValidateLayout, LabelBeforeFunctionParameterBad) { + char str[] = R"( + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpDecorate %var Restrict +%intt = OpTypeInt 32 1 +%voidt = OpTypeVoid +%vfunct = OpTypeFunction %voidt +%vifunct = OpTypeFunction %voidt %intt +%ptrt = OpTypePointer Function %intt +%func = OpFunction %voidt None %vifunct +%funcl = OpLabel ; Label appears before function parameter +%func2p = OpFunctionParameter %intt + OpNop + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Function parameters must only appear immediately " + "after the function definition")); +} + +TEST_F(ValidateLayout, FuncParameterNotImmediatlyAfterFuncBad) { + char str[] = R"( + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpDecorate %var Restrict +%intt = OpTypeInt 32 1 +%voidt = OpTypeVoid +%vfunct = OpTypeFunction %voidt +%vifunct = OpTypeFunction %voidt %intt +%ptrt = OpTypePointer Function %intt +%func = OpFunction %voidt None %vifunct +%funcl = OpLabel + OpNop + OpBranch %next +%func2p = OpFunctionParameter %intt ;FunctionParameter appears in a function but not immediately afterwards +%next = OpLabel + OpNop + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Function parameters must only appear immediately " + "after the function definition")); +} + +TEST_F(ValidateLayout, OpUndefCanAppearInTypeDeclarationSection) { + string str = R"( + OpCapability Kernel + OpCapability Linkage + OpMemoryModel Logical OpenCL +%voidt = OpTypeVoid +%uintt = OpTypeInt 32 0 +%funct = OpTypeFunction %voidt +%udef = OpUndef %uintt +%func = OpFunction %voidt None %funct +%entry = OpLabel + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateLayout, OpUndefCanAppearInBlock) { + string str = R"( + OpCapability Kernel + OpCapability Linkage + OpMemoryModel Logical OpenCL +%voidt = OpTypeVoid +%uintt = OpTypeInt 32 0 +%funct = OpTypeFunction %voidt +%func = OpFunction %voidt None %funct +%entry = OpLabel +%udef = OpUndef %uintt + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateLayout, MissingFunctionEndForFunctionWithBody) { + const auto s = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%void = OpTypeVoid +%tf = OpTypeFunction %void +%f = OpFunction %void None %tf +%l = OpLabel +OpReturn +)"; + + CompileSuccessfully(s); + ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + StrEq("Missing OpFunctionEnd at end of module.")); +} + +TEST_F(ValidateLayout, MissingFunctionEndForFunctionPrototype) { + const auto s = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%void = OpTypeVoid +%tf = OpTypeFunction %void +%f = OpFunction %void None %tf +)"; + + CompileSuccessfully(s); + ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + StrEq("Missing OpFunctionEnd at end of module.")); +} + +using ValidateOpFunctionParameter = spvtest::ValidateBase; + +TEST_F(ValidateOpFunctionParameter, OpLineBetweenParameters) { + const auto s = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%foo_frag = OpString "foo.frag" +%i32 = OpTypeInt 32 1 +%tf = OpTypeFunction %i32 %i32 %i32 +%c = OpConstant %i32 123 +%f = OpFunction %i32 None %tf +OpLine %foo_frag 1 1 +%p1 = OpFunctionParameter %i32 +OpNoLine +%p2 = OpFunctionParameter %i32 +%l = OpLabel +OpReturnValue %c +OpFunctionEnd +)"; + CompileSuccessfully(s); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateOpFunctionParameter, TooManyParameters) { + const auto s = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%i32 = OpTypeInt 32 1 +%tf = OpTypeFunction %i32 %i32 %i32 +%c = OpConstant %i32 123 +%f = OpFunction %i32 None %tf +%p1 = OpFunctionParameter %i32 +%p2 = OpFunctionParameter %i32 +%xp3 = OpFunctionParameter %i32 +%xp4 = OpFunctionParameter %i32 +%xp5 = OpFunctionParameter %i32 +%xp6 = OpFunctionParameter %i32 +%xp7 = OpFunctionParameter %i32 +%l = OpLabel +OpReturnValue %c +OpFunctionEnd +)"; + CompileSuccessfully(s); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); +} + +using ValidateEntryPoint = spvtest::ValidateBase; + +// Tests that not having OpEntryPoint causes an error. +TEST_F(ValidateEntryPoint, NoEntryPointBad) { + std::string spirv = R"( + OpCapability Shader + OpMemoryModel Logical GLSL450)"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("No OpEntryPoint instruction was found. This is only " + "allowed if the Linkage capability is being used.")); +} + +// Invalid. A function may not be a target of both OpEntryPoint and +// OpFunctionCall. +TEST_F(ValidateEntryPoint, FunctionIsTargetOfEntryPointAndFunctionCallBad) { + std::string spirv = R"( + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %foo "foo" +%voidt = OpTypeVoid +%funct = OpTypeFunction %voidt +%foo = OpFunction %voidt None %funct +%entry = OpLabel +%recurse = OpFunctionCall %voidt %foo + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("A function (1) may not be targeted by both an OpEntryPoint " + "instruction and an OpFunctionCall instruction.")); +} + +// Valid. Module with a function but no entry point is valid when Linkage +// Capability is used. +TEST_F(ValidateEntryPoint, NoEntryPointWithLinkageCapGood) { + std::string spirv = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 +%voidt = OpTypeVoid +%funct = OpTypeFunction %voidt +%foo = OpFunction %voidt None %funct +%entry = OpLabel + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateLayout, ModuleProcessedInvalidIn10) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpName %void "void" + OpModuleProcessed "this is ok in 1.1 and later" + OpDecorate %void Volatile ; bogus, but makes the example short +%void = OpTypeVoid +)"; + + CompileSuccessfully(str, SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(SPV_ERROR_INVALID_BINARY, + ValidateInstructions(SPV_ENV_UNIVERSAL_1_0)); + // In a 1.0 environment the binary parse fails before we even get to + // validation. This occurs no matter where the OpModuleProcessed is placed. + EXPECT_THAT(getDiagnosticString(), HasSubstr("Invalid opcode: 330")); +} + +TEST_F(ValidateLayout, ModuleProcessedValidIn11) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpName %void "void" + OpModuleProcessed "this is ok in 1.1 and later" + OpDecorate %void Volatile ; bogus, but makes the example short +%void = OpTypeVoid +)"; + + CompileSuccessfully(str, SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); + EXPECT_THAT(getDiagnosticString(), Eq("")); +} + +TEST_F(ValidateLayout, ModuleProcessedBeforeLastNameIsTooEarly) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpModuleProcessed "this is too early" + OpName %void "void" +%void = OpTypeVoid +)"; + + CompileSuccessfully(str, SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, + ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); + // By the mechanics of the validator, we assume ModuleProcessed is in the + // right spot, but then that OpName is in the wrong spot. + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Name cannot appear in a function declaration")); +} + +TEST_F(ValidateLayout, ModuleProcessedInvalidAfterFirstAnnotation) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpDecorate %void Volatile ; this is bogus, but keeps the example short + OpModuleProcessed "this is too late" +%void = OpTypeVoid +)"; + + CompileSuccessfully(str, SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, + ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("ModuleProcessed cannot appear in a function declaration")); +} + +TEST_F(ValidateLayout, ModuleProcessedInvalidInFunctionBeforeLabel) { + char str[] = R"( + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %main "main" +%void = OpTypeVoid +%voidfn = OpTypeFunction %void +%main = OpFunction %void None %voidfn + OpModuleProcessed "this is too late, in function before label" +%entry = OpLabel + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str, SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, + ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("ModuleProcessed cannot appear in a function declaration")); +} + +TEST_F(ValidateLayout, ModuleProcessedInvalidInBasicBlock) { + char str[] = R"( + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %main "main" +%void = OpTypeVoid +%voidfn = OpTypeFunction %void +%main = OpFunction %void None %voidfn +%entry = OpLabel + OpModuleProcessed "this is too late, in basic block" + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str, SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, + ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("ModuleProcessed cannot appear in a function declaration")); +} + +// TODO(umar): Test optional instructions +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_limits_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_limits_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_limits_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_limits_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,706 @@ +// Copyright (c) 2016 Google 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. + +// Validation tests for Universal Limits. (Section 2.17 of the SPIR-V Spec) + +#include +#include +#include + +#include "gmock/gmock.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using std::string; +using ::testing::HasSubstr; +using ::testing::MatchesRegex; + +using ValidateLimits = spvtest::ValidateBase; + +string header = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 +)"; + +TEST_F(ValidateLimits, IdLargerThanBoundBad) { + string str = header + R"( +; %i32 has ID 1 +%i32 = OpTypeInt 32 1 +%c = OpConstant %i32 100 + +; Fake an instruction with 64 as the result id. +; !64 = OpConstantNull %i32 +!0x3002e !1 !64 +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Result '64' must be less than the ID bound '3'.")); +} + +TEST_F(ValidateLimits, IdEqualToBoundBad) { + string str = header + R"( +; %i32 has ID 1 +%i32 = OpTypeInt 32 1 +%c = OpConstant %i32 100 + +; Fake an instruction with 64 as the result id. +; !64 = OpConstantNull %i32 +!0x3002e !1 !64 +)"; + + CompileSuccessfully(str); + + // The largest ID used in this program is 64. Let's overwrite the ID bound in + // the header to be 64. This should result in an error because all IDs must + // satisfy: 0 < id < bound. + OverwriteAssembledBinary(3, 64); + + ASSERT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Result '64' must be less than the ID bound '64'.")); +} + +TEST_F(ValidateLimits, StructNumMembersGood) { + std::ostringstream spirv; + spirv << header << R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeStruct)"; + for (int i = 0; i < 16383; ++i) { + spirv << " %1"; + } + CompileSuccessfully(spirv.str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateLimits, StructNumMembersExceededBad) { + std::ostringstream spirv; + spirv << header << R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeStruct)"; + for (int i = 0; i < 16384; ++i) { + spirv << " %1"; + } + CompileSuccessfully(spirv.str()); + ASSERT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Number of OpTypeStruct members (16384) has exceeded " + "the limit (16383).")); +} + +TEST_F(ValidateLimits, CustomizedStructNumMembersGood) { + std::ostringstream spirv; + spirv << header << R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeStruct)"; + for (int i = 0; i < 32000; ++i) { + spirv << " %1"; + } + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_struct_members, 32000u); + CompileSuccessfully(spirv.str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateLimits, CustomizedStructNumMembersBad) { + std::ostringstream spirv; + spirv << header << R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeStruct)"; + for (int i = 0; i < 32001; ++i) { + spirv << " %1"; + } + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_struct_members, 32000u); + CompileSuccessfully(spirv.str()); + ASSERT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Number of OpTypeStruct members (32001) has exceeded " + "the limit (32000).")); +} + +// Valid: Switch statement has 16,383 branches. +TEST_F(ValidateLimits, SwitchNumBranchesGood) { + std::ostringstream spirv; + spirv << header << R"( +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpTypeInt 32 0 +%4 = OpConstant %3 1234 +%5 = OpFunction %1 None %2 +%7 = OpLabel +%8 = OpIAdd %3 %4 %4 +%9 = OpSwitch %4 %10)"; + + // Now add the (literal, label) pairs + for (int i = 0; i < 16383; ++i) { + spirv << " 1 %10"; + } + + spirv << R"( +%10 = OpLabel +OpReturn +OpFunctionEnd + )"; + + CompileSuccessfully(spirv.str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: Switch statement has 16,384 branches. +TEST_F(ValidateLimits, SwitchNumBranchesBad) { + std::ostringstream spirv; + spirv << header << R"( +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpTypeInt 32 0 +%4 = OpConstant %3 1234 +%5 = OpFunction %1 None %2 +%7 = OpLabel +%8 = OpIAdd %3 %4 %4 +%9 = OpSwitch %4 %10)"; + + // Now add the (literal, label) pairs + for (int i = 0; i < 16384; ++i) { + spirv << " 1 %10"; + } + + spirv << R"( +%10 = OpLabel +OpReturn +OpFunctionEnd + )"; + + CompileSuccessfully(spirv.str()); + ASSERT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Number of (literal, label) pairs in OpSwitch (16384) " + "exceeds the limit (16383).")); +} + +// Valid: Switch statement has 10 branches (limit is 10) +TEST_F(ValidateLimits, CustomizedSwitchNumBranchesGood) { + std::ostringstream spirv; + spirv << header << R"( +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpTypeInt 32 0 +%4 = OpConstant %3 1234 +%5 = OpFunction %1 None %2 +%7 = OpLabel +%8 = OpIAdd %3 %4 %4 +%9 = OpSwitch %4 %10)"; + + // Now add the (literal, label) pairs + for (int i = 0; i < 10; ++i) { + spirv << " 1 %10"; + } + + spirv << R"( +%10 = OpLabel +OpReturn +OpFunctionEnd + )"; + + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_switch_branches, 10u); + CompileSuccessfully(spirv.str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: Switch statement has 11 branches (limit is 10) +TEST_F(ValidateLimits, CustomizedSwitchNumBranchesBad) { + std::ostringstream spirv; + spirv << header << R"( +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpTypeInt 32 0 +%4 = OpConstant %3 1234 +%5 = OpFunction %1 None %2 +%7 = OpLabel +%8 = OpIAdd %3 %4 %4 +%9 = OpSwitch %4 %10)"; + + // Now add the (literal, label) pairs + for (int i = 0; i < 11; ++i) { + spirv << " 1 %10"; + } + + spirv << R"( +%10 = OpLabel +OpReturn +OpFunctionEnd + )"; + + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_switch_branches, 10u); + CompileSuccessfully(spirv.str()); + ASSERT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Number of (literal, label) pairs in OpSwitch (11) " + "exceeds the limit (10).")); +} + +// Valid: OpTypeFunction with 255 arguments. +TEST_F(ValidateLimits, OpTypeFunctionGood) { + int num_args = 255; + std::ostringstream spirv; + spirv << header << R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeFunction %1)"; + // add parameters + for (int i = 0; i < num_args; ++i) { + spirv << " %1"; + } + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: OpTypeFunction with 256 arguments. (limit is 255 according to the +// spec Universal Limits (2.17). +TEST_F(ValidateLimits, OpTypeFunctionBad) { + int num_args = 256; + std::ostringstream spirv; + spirv << header << R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeFunction %1)"; + for (int i = 0; i < num_args; ++i) { + spirv << " %1"; + } + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpTypeFunction may not take more than 255 arguments. " + "OpTypeFunction '2' has 256 arguments.")); +} + +// Valid: OpTypeFunction with 100 arguments (Custom limit: 100) +TEST_F(ValidateLimits, CustomizedOpTypeFunctionGood) { + int num_args = 100; + std::ostringstream spirv; + spirv << header << R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeFunction %1)"; + // add parameters + for (int i = 0; i < num_args; ++i) { + spirv << " %1"; + } + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_function_args, 100u); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: OpTypeFunction with 101 arguments. (Custom limit: 100) +TEST_F(ValidateLimits, CustomizedOpTypeFunctionBad) { + int num_args = 101; + std::ostringstream spirv; + spirv << header << R"( +%1 = OpTypeInt 32 0 +%2 = OpTypeFunction %1)"; + for (int i = 0; i < num_args; ++i) { + spirv << " %1"; + } + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_function_args, 100u); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpTypeFunction may not take more than 100 arguments. " + "OpTypeFunction '2' has 101 arguments.")); +} + +// Valid: module has 65,535 global variables. +TEST_F(ValidateLimits, NumGlobalVarsGood) { + int num_globals = 65535; + std::ostringstream spirv; + spirv << header << R"( + %int = OpTypeInt 32 0 +%_ptr_int = OpTypePointer Input %int + )"; + + for (int i = 0; i < num_globals; ++i) { + spirv << "%var_" << i << " = OpVariable %_ptr_int Input\n"; + } + + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: module has 65,536 global variables (limit is 65,535). +TEST_F(ValidateLimits, NumGlobalVarsBad) { + int num_globals = 65536; + std::ostringstream spirv; + spirv << header << R"( + %int = OpTypeInt 32 0 +%_ptr_int = OpTypePointer Input %int + )"; + + for (int i = 0; i < num_globals; ++i) { + spirv << "%var_" << i << " = OpVariable %_ptr_int Input\n"; + } + + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Number of Global Variables (Storage Class other than " + "'Function') exceeded the valid limit (65535).")); +} + +// Valid: module has 50 global variables (limit is 50) +TEST_F(ValidateLimits, CustomizedNumGlobalVarsGood) { + int num_globals = 50; + std::ostringstream spirv; + spirv << header << R"( + %int = OpTypeInt 32 0 +%_ptr_int = OpTypePointer Input %int + )"; + + for (int i = 0; i < num_globals; ++i) { + spirv << "%var_" << i << " = OpVariable %_ptr_int Input\n"; + } + + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_global_variables, 50u); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: module has 51 global variables (limit is 50). +TEST_F(ValidateLimits, CustomizedNumGlobalVarsBad) { + int num_globals = 51; + std::ostringstream spirv; + spirv << header << R"( + %int = OpTypeInt 32 0 +%_ptr_int = OpTypePointer Input %int + )"; + + for (int i = 0; i < num_globals; ++i) { + spirv << "%var_" << i << " = OpVariable %_ptr_int Input\n"; + } + + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_global_variables, 50u); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Number of Global Variables (Storage Class other than " + "'Function') exceeded the valid limit (50).")); +} + +// Valid: module has 524,287 local variables. +TEST_F(ValidateLimits, NumLocalVarsGood) { + int num_locals = 524287; + std::ostringstream spirv; + spirv << header << R"( + %int = OpTypeInt 32 0 + %_ptr_int = OpTypePointer Function %int + %voidt = OpTypeVoid + %funct = OpTypeFunction %voidt + %main = OpFunction %voidt None %funct + %entry = OpLabel + )"; + + for (int i = 0; i < num_locals; ++i) { + spirv << "%var_" << i << " = OpVariable %_ptr_int Function\n"; + } + + spirv << R"( + OpReturn + OpFunctionEnd + )"; + + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: module has 524,288 local variables (limit is 524,287). +TEST_F(ValidateLimits, NumLocalVarsBad) { + int num_locals = 524288; + std::ostringstream spirv; + spirv << header << R"( + %int = OpTypeInt 32 0 + %_ptr_int = OpTypePointer Function %int + %voidt = OpTypeVoid + %funct = OpTypeFunction %voidt + %main = OpFunction %voidt None %funct + %entry = OpLabel + )"; + + for (int i = 0; i < num_locals; ++i) { + spirv << "%var_" << i << " = OpVariable %_ptr_int Function\n"; + } + + spirv << R"( + OpReturn + OpFunctionEnd + )"; + + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Number of local variables ('Function' Storage Class) " + "exceeded the valid limit (524287).")); +} + +// Valid: module has 100 local variables (limit is 100). +TEST_F(ValidateLimits, CustomizedNumLocalVarsGood) { + int num_locals = 100; + std::ostringstream spirv; + spirv << header << R"( + %int = OpTypeInt 32 0 + %_ptr_int = OpTypePointer Function %int + %voidt = OpTypeVoid + %funct = OpTypeFunction %voidt + %main = OpFunction %voidt None %funct + %entry = OpLabel + )"; + + for (int i = 0; i < num_locals; ++i) { + spirv << "%var_" << i << " = OpVariable %_ptr_int Function\n"; + } + + spirv << R"( + OpReturn + OpFunctionEnd + )"; + + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_local_variables, 100u); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: module has 101 local variables (limit is 100). +TEST_F(ValidateLimits, CustomizedNumLocalVarsBad) { + int num_locals = 101; + std::ostringstream spirv; + spirv << header << R"( + %int = OpTypeInt 32 0 + %_ptr_int = OpTypePointer Function %int + %voidt = OpTypeVoid + %funct = OpTypeFunction %voidt + %main = OpFunction %voidt None %funct + %entry = OpLabel + )"; + + for (int i = 0; i < num_locals; ++i) { + spirv << "%var_" << i << " = OpVariable %_ptr_int Function\n"; + } + + spirv << R"( + OpReturn + OpFunctionEnd + )"; + + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_local_variables, 100u); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Number of local variables ('Function' Storage Class) " + "exceeded the valid limit (100).")); +} + +// Valid: Structure nesting depth of 255. +TEST_F(ValidateLimits, StructNestingDepthGood) { + std::ostringstream spirv; + spirv << header << R"( + %int = OpTypeInt 32 0 + %s_depth_1 = OpTypeStruct %int + )"; + for (auto i = 2; i <= 255; ++i) { + spirv << "%s_depth_" << i << " = OpTypeStruct %int %s_depth_" << i - 1; + spirv << "\n"; + } + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: Structure nesting depth of 256. +TEST_F(ValidateLimits, StructNestingDepthBad) { + std::ostringstream spirv; + spirv << header << R"( + %int = OpTypeInt 32 0 + %s_depth_1 = OpTypeStruct %int + )"; + for (auto i = 2; i <= 256; ++i) { + spirv << "%s_depth_" << i << " = OpTypeStruct %int %s_depth_" << i - 1; + spirv << "\n"; + } + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Structure Nesting Depth may not be larger than 255. Found 256.")); +} + +// Valid: Structure nesting depth of 100 (limit is 100). +TEST_F(ValidateLimits, CustomizedStructNestingDepthGood) { + std::ostringstream spirv; + spirv << header << R"( + %int = OpTypeInt 32 0 + %s_depth_1 = OpTypeStruct %int + )"; + for (auto i = 2; i <= 100; ++i) { + spirv << "%s_depth_" << i << " = OpTypeStruct %int %s_depth_" << i - 1; + spirv << "\n"; + } + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_struct_depth, 100u); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: Structure nesting depth of 101 (limit is 100). +TEST_F(ValidateLimits, CustomizedStructNestingDepthBad) { + std::ostringstream spirv; + spirv << header << R"( + %int = OpTypeInt 32 0 + %s_depth_1 = OpTypeStruct %int + )"; + for (auto i = 2; i <= 101; ++i) { + spirv << "%s_depth_" << i << " = OpTypeStruct %int %s_depth_" << i - 1; + spirv << "\n"; + } + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_struct_depth, 100u); + CompileSuccessfully(spirv.str()); + EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Structure Nesting Depth may not be larger than 100. Found 101.")); +} + +// clang-format off +// Generates an SPIRV program with the given control flow nesting depth +void GenerateSpirvProgramWithCfgNestingDepth(std::string& str, int depth) { + std::ostringstream spirv; + spirv << header << R"( + %void = OpTypeVoid + %3 = OpTypeFunction %void + %bool = OpTypeBool + %12 = OpConstantTrue %bool + %main = OpFunction %void None %3 + %5 = OpLabel + OpBranch %6 + %6 = OpLabel + OpLoopMerge %8 %9 None + OpBranch %10 + %10 = OpLabel + OpBranchConditional %12 %7 %8 + %7 = OpLabel + )"; + int first_id = 13; + int last_id = 14; + // We already have 1 level of nesting due to the Loop. + int num_if_conditions = depth-1; + int largest_index = first_id + 2*num_if_conditions - 2; + for (int i = first_id; i <= largest_index; i = i + 2) { + spirv << "OpSelectionMerge %" << i+1 << " None" << "\n"; + spirv << "OpBranchConditional %12 " << "%" << i << " %" << i+1 << "\n"; + spirv << "%" << i << " = OpLabel" << "\n"; + } + spirv << "OpBranch %9" << "\n"; + + for (int i = largest_index+1; i > last_id; i = i - 2) { + spirv << "%" << i << " = OpLabel" << "\n"; + spirv << "OpBranch %" << i-2 << "\n"; + } + spirv << "%" << last_id << " = OpLabel" << "\n"; + spirv << "OpBranch %9" << "\n"; + spirv << R"( + %9 = OpLabel + OpBranch %6 + %8 = OpLabel + OpReturn + OpFunctionEnd + )"; + str = spirv.str(); +} +// clang-format on + +// Valid: Control Flow Nesting depth is 1023. +TEST_F(ValidateLimits, ControlFlowDepthGood) { + std::string spirv; + GenerateSpirvProgramWithCfgNestingDepth(spirv, 1023); + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: Control Flow Nesting depth is 1024. (limit is 1023). +TEST_F(ValidateLimits, ControlFlowDepthBad) { + std::string spirv; + GenerateSpirvProgramWithCfgNestingDepth(spirv, 1024); + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Maximum Control Flow nesting depth exceeded.")); +} + +// Valid: Control Flow Nesting depth is 10 (custom limit: 10). +TEST_F(ValidateLimits, CustomizedControlFlowDepthGood) { + std::string spirv; + GenerateSpirvProgramWithCfgNestingDepth(spirv, 10); + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_control_flow_nesting_depth, 10u); + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// Invalid: Control Flow Nesting depth is 11. (custom limit: 10). +TEST_F(ValidateLimits, CustomizedControlFlowDepthBad) { + std::string spirv; + GenerateSpirvProgramWithCfgNestingDepth(spirv, 11); + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_control_flow_nesting_depth, 10u); + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Maximum Control Flow nesting depth exceeded.")); +} + +// Valid. The purpose here is to test the CFG depth calculation code when a loop +// continue target is the loop iteself. It also exercises the case where a loop +// is unreachable. +TEST_F(ValidateLimits, ControlFlowNoEntryToLoopGood) { + string str = header + R"( + OpName %entry "entry" + OpName %loop "loop" + OpName %exit "exit" +%voidt = OpTypeVoid +%funct = OpTypeFunction %voidt +%main = OpFunction %voidt None %funct +%entry = OpLabel + OpBranch %exit +%loop = OpLabel + OpLoopMerge %loop %loop None + OpBranch %loop +%exit = OpLabel + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(str); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_literals_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_literals_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_literals_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_literals_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,138 @@ +// Copyright (c) 2017 Google 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. + +// Validation tests for ilegal literals + +#include +#include + +#include "gmock/gmock.h" +#include "val_fixtures.h" + +using ::testing::HasSubstr; + +using ValidateLiterals = spvtest::ValidateBase; +using ValidateLiteralsShader = spvtest::ValidateBase; +using ValidateLiteralsKernel = spvtest::ValidateBase; + +namespace { + +std::string GenerateShaderCode() { + std::string str = R"( + OpCapability Shader + OpCapability Linkage + OpCapability Int16 + OpCapability Int64 + OpCapability Float16 + OpCapability Float64 + OpMemoryModel Logical GLSL450 +%int16 = OpTypeInt 16 1 +%uint16 = OpTypeInt 16 0 +%int32 = OpTypeInt 32 1 +%uint32 = OpTypeInt 32 0 +%int64 = OpTypeInt 64 1 +%uint64 = OpTypeInt 64 0 +%half = OpTypeFloat 16 +%float = OpTypeFloat 32 +%double = OpTypeFloat 64 +%10 = OpTypeVoid + )"; + return str; +} + +std::string GenerateKernelCode() { + std::string str = R"( + OpCapability Kernel + OpCapability Addresses + OpCapability Linkage + OpCapability Int8 + OpMemoryModel Physical64 OpenCL +%uint8 = OpTypeInt 8 0 + )"; + return str; +} + +TEST_F(ValidateLiterals, LiteralsShaderGood) { + std::string str = GenerateShaderCode() + R"( +%11 = OpConstant %int16 !0x00007FFF +%12 = OpConstant %int16 !0xFFFF8000 +%13 = OpConstant %int16 !0xFFFFABCD +%14 = OpConstant %uint16 !0x0000ABCD +%15 = OpConstant %int16 -32768 +%16 = OpConstant %uint16 65535 +%17 = OpConstant %int32 -2147483648 +%18 = OpConstant %uint32 4294967295 +%19 = OpConstant %int64 -9223372036854775808 +%20 = OpConstant %uint64 18446744073709551615 +%21 = OpConstant %half !0x0000FFFF +%22 = OpConstant %float !0xFFFFFFFF +%23 = OpConstant %double !0xFFFFFFFF !0xFFFFFFFF + )"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateLiteralsShader, LiteralsShaderBad) { + std::string str = GenerateShaderCode() + GetParam(); + std::string inst_id = "11"; + CompileSuccessfully(str); + EXPECT_EQ(SPV_ERROR_INVALID_VALUE, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("The high-order bits of a literal number in instruction " + + inst_id + + " must be 0 for a floating-point type, " + "or 0 for an integer type with Signedness of 0, " + "or sign extended when Signedness is 1")); +} + +INSTANTIATE_TEST_CASE_P( + LiteralsShaderCases, ValidateLiteralsShader, + ::testing::Values("%11 = OpConstant %int16 !0xFFFF0000", // Sign bit is 0 + "%11 = OpConstant %int16 !0x00008000", // Sign bit is 1 + "%11 = OpConstant %int16 !0xABCD8000", // Sign bit is 1 + "%11 = OpConstant %int16 !0xABCD0000", + "%11 = OpConstant %uint16 !0xABCD0000", + "%11 = OpConstant %half !0xABCD0000", + "%11 = OpConstant %half !0x00010000")); + +TEST_F(ValidateLiterals, LiteralsKernelGood) { + std::string str = GenerateKernelCode() + R"( +%4 = OpConstant %uint8 !0x000000AB +%6 = OpConstant %uint8 255 + )"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateLiteralsKernel, LiteralsKernelBad) { + std::string str = GenerateKernelCode() + GetParam(); + std::string inst_id = "2"; + CompileSuccessfully(str); + EXPECT_EQ(SPV_ERROR_INVALID_VALUE, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("The high-order bits of a literal number in instruction " + + inst_id + + " must be 0 for a floating-point type, " + "or 0 for an integer type with Signedness of 0, " + "or sign extended when Signedness is 1")); +} + +INSTANTIATE_TEST_CASE_P( + LiteralsKernelCases, ValidateLiteralsKernel, + ::testing::Values("%2 = OpConstant %uint8 !0xABCDEF00", + "%2 = OpConstant %uint8 !0xABCDEFFF")); + +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_logicals_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_logicals_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_logicals_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_logicals_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,919 @@ +// Copyright (c) 2017 Google 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. + +// Tests for unique type declaration rules validator. + +#include + +#include "gmock/gmock.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using ::testing::HasSubstr; +using ::testing::Not; + +using ValidateLogicals = spvtest::ValidateBase; + +std::string GenerateShaderCode( + const std::string& body, + const std::string& capabilities_and_extensions = "") { + const std::string capabilities = + R"( +OpCapability Shader +OpCapability Int64 +OpCapability Float64)"; + + const std::string after_extension_before_body = + R"( +%ext_inst = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint Fragment %main "main" +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f32 = OpTypeFloat 32 +%u32 = OpTypeInt 32 0 +%s32 = OpTypeInt 32 1 +%f64 = OpTypeFloat 64 +%u64 = OpTypeInt 64 0 +%s64 = OpTypeInt 64 1 +%boolvec2 = OpTypeVector %bool 2 +%s32vec2 = OpTypeVector %s32 2 +%u32vec2 = OpTypeVector %u32 2 +%u64vec2 = OpTypeVector %u64 2 +%f32vec2 = OpTypeVector %f32 2 +%f64vec2 = OpTypeVector %f64 2 +%boolvec3 = OpTypeVector %bool 3 +%u32vec3 = OpTypeVector %u32 3 +%u64vec3 = OpTypeVector %u64 3 +%s32vec3 = OpTypeVector %s32 3 +%f32vec3 = OpTypeVector %f32 3 +%f64vec3 = OpTypeVector %f64 3 +%boolvec4 = OpTypeVector %bool 4 +%u32vec4 = OpTypeVector %u32 4 +%u64vec4 = OpTypeVector %u64 4 +%s32vec4 = OpTypeVector %s32 4 +%f32vec4 = OpTypeVector %f32 4 +%f64vec4 = OpTypeVector %f64 4 + +%f32_0 = OpConstant %f32 0 +%f32_1 = OpConstant %f32 1 +%f32_2 = OpConstant %f32 2 +%f32_3 = OpConstant %f32 3 +%f32_4 = OpConstant %f32 4 + +%s32_0 = OpConstant %s32 0 +%s32_1 = OpConstant %s32 1 +%s32_2 = OpConstant %s32 2 +%s32_3 = OpConstant %s32 3 +%s32_4 = OpConstant %s32 4 +%s32_m1 = OpConstant %s32 -1 + +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u32_2 = OpConstant %u32 2 +%u32_3 = OpConstant %u32 3 +%u32_4 = OpConstant %u32 4 + +%f64_0 = OpConstant %f64 0 +%f64_1 = OpConstant %f64 1 +%f64_2 = OpConstant %f64 2 +%f64_3 = OpConstant %f64 3 +%f64_4 = OpConstant %f64 4 + +%s64_0 = OpConstant %s64 0 +%s64_1 = OpConstant %s64 1 +%s64_2 = OpConstant %s64 2 +%s64_3 = OpConstant %s64 3 +%s64_4 = OpConstant %s64 4 +%s64_m1 = OpConstant %s64 -1 + +%u64_0 = OpConstant %u64 0 +%u64_1 = OpConstant %u64 1 +%u64_2 = OpConstant %u64 2 +%u64_3 = OpConstant %u64 3 +%u64_4 = OpConstant %u64 4 + +%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 +%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 +%u32vec3_012 = OpConstantComposite %u32vec3 %u32_0 %u32_1 %u32_2 +%u32vec3_123 = OpConstantComposite %u32vec3 %u32_1 %u32_2 %u32_3 +%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 +%u32vec4_1234 = OpConstantComposite %u32vec4 %u32_1 %u32_2 %u32_3 %u32_4 + +%s32vec2_01 = OpConstantComposite %s32vec2 %s32_0 %s32_1 +%s32vec2_12 = OpConstantComposite %s32vec2 %s32_1 %s32_2 +%s32vec3_012 = OpConstantComposite %s32vec3 %s32_0 %s32_1 %s32_2 +%s32vec3_123 = OpConstantComposite %s32vec3 %s32_1 %s32_2 %s32_3 +%s32vec4_0123 = OpConstantComposite %s32vec4 %s32_0 %s32_1 %s32_2 %s32_3 +%s32vec4_1234 = OpConstantComposite %s32vec4 %s32_1 %s32_2 %s32_3 %s32_4 + +%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 +%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 +%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 +%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 +%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 +%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 + +%f64vec2_01 = OpConstantComposite %f64vec2 %f64_0 %f64_1 +%f64vec2_12 = OpConstantComposite %f64vec2 %f64_1 %f64_2 +%f64vec3_012 = OpConstantComposite %f64vec3 %f64_0 %f64_1 %f64_2 +%f64vec3_123 = OpConstantComposite %f64vec3 %f64_1 %f64_2 %f64_3 +%f64vec4_0123 = OpConstantComposite %f64vec4 %f64_0 %f64_1 %f64_2 %f64_3 +%f64vec4_1234 = OpConstantComposite %f64vec4 %f64_1 %f64_2 %f64_3 %f64_4 + +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%boolvec2_tf = OpConstantComposite %boolvec2 %true %false +%boolvec3_tft = OpConstantComposite %boolvec3 %true %false %true +%boolvec4_tftf = OpConstantComposite %boolvec4 %true %false %true %false + +%f32vec4ptr = OpTypePointer Function %f32vec4 + +%main = OpFunction %void None %func +%main_entry = OpLabel)"; + + const std::string after_body = + R"( +OpReturn +OpFunctionEnd)"; + + return capabilities + capabilities_and_extensions + + after_extension_before_body + body + after_body; +} + +std::string GenerateKernelCode( + const std::string& body, + const std::string& capabilities_and_extensions = "") { + const std::string capabilities = + R"( +OpCapability Addresses +OpCapability Kernel +OpCapability Linkage +OpCapability Int64 +OpCapability Float64)"; + + const std::string after_extension_before_body = + R"( +OpMemoryModel Physical32 OpenCL +%void = OpTypeVoid +%func = OpTypeFunction %void +%bool = OpTypeBool +%f32 = OpTypeFloat 32 +%u32 = OpTypeInt 32 0 +%f64 = OpTypeFloat 64 +%u64 = OpTypeInt 64 0 +%boolvec2 = OpTypeVector %bool 2 +%u32vec2 = OpTypeVector %u32 2 +%u64vec2 = OpTypeVector %u64 2 +%f32vec2 = OpTypeVector %f32 2 +%f64vec2 = OpTypeVector %f64 2 +%boolvec3 = OpTypeVector %bool 3 +%u32vec3 = OpTypeVector %u32 3 +%u64vec3 = OpTypeVector %u64 3 +%f32vec3 = OpTypeVector %f32 3 +%f64vec3 = OpTypeVector %f64 3 +%boolvec4 = OpTypeVector %bool 4 +%u32vec4 = OpTypeVector %u32 4 +%u64vec4 = OpTypeVector %u64 4 +%f32vec4 = OpTypeVector %f32 4 +%f64vec4 = OpTypeVector %f64 4 + +%f32_0 = OpConstant %f32 0 +%f32_1 = OpConstant %f32 1 +%f32_2 = OpConstant %f32 2 +%f32_3 = OpConstant %f32 3 +%f32_4 = OpConstant %f32 4 + +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u32_2 = OpConstant %u32 2 +%u32_3 = OpConstant %u32 3 +%u32_4 = OpConstant %u32 4 + +%f64_0 = OpConstant %f64 0 +%f64_1 = OpConstant %f64 1 +%f64_2 = OpConstant %f64 2 +%f64_3 = OpConstant %f64 3 +%f64_4 = OpConstant %f64 4 + +%u64_0 = OpConstant %u64 0 +%u64_1 = OpConstant %u64 1 +%u64_2 = OpConstant %u64 2 +%u64_3 = OpConstant %u64 3 +%u64_4 = OpConstant %u64 4 + +%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 +%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 +%u32vec3_012 = OpConstantComposite %u32vec3 %u32_0 %u32_1 %u32_2 +%u32vec3_123 = OpConstantComposite %u32vec3 %u32_1 %u32_2 %u32_3 +%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 +%u32vec4_1234 = OpConstantComposite %u32vec4 %u32_1 %u32_2 %u32_3 %u32_4 + +%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 +%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 +%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 +%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 +%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 +%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 + +%f64vec2_01 = OpConstantComposite %f64vec2 %f64_0 %f64_1 +%f64vec2_12 = OpConstantComposite %f64vec2 %f64_1 %f64_2 +%f64vec3_012 = OpConstantComposite %f64vec3 %f64_0 %f64_1 %f64_2 +%f64vec3_123 = OpConstantComposite %f64vec3 %f64_1 %f64_2 %f64_3 +%f64vec4_0123 = OpConstantComposite %f64vec4 %f64_0 %f64_1 %f64_2 %f64_3 +%f64vec4_1234 = OpConstantComposite %f64vec4 %f64_1 %f64_2 %f64_3 %f64_4 + +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%boolvec2_tf = OpConstantComposite %boolvec2 %true %false +%boolvec3_tft = OpConstantComposite %boolvec3 %true %false %true +%boolvec4_tftf = OpConstantComposite %boolvec4 %true %false %true %false + +%f32vec4ptr = OpTypePointer Function %f32vec4 + +%main = OpFunction %void None %func +%main_entry = OpLabel)"; + + const std::string after_body = + R"( +OpReturn +OpFunctionEnd)"; + + return capabilities + capabilities_and_extensions + + after_extension_before_body + body + after_body; +} + +TEST_F(ValidateLogicals, OpAnySuccess) { + const std::string body = R"( +%val1 = OpAny %bool %boolvec2_tf +%val2 = OpAny %bool %boolvec3_tft +%val3 = OpAny %bool %boolvec4_tftf +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateLogicals, OpAnyWrongTypeId) { + const std::string body = R"( +%val = OpAny %u32 %boolvec2_tf +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected bool scalar type as Result Type: Any")); +} + +TEST_F(ValidateLogicals, OpAnyWrongOperand) { + const std::string body = R"( +%val = OpAny %bool %u32vec3_123 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected operand to be vector bool: Any")); +} + +TEST_F(ValidateLogicals, OpIsNanSuccess) { + const std::string body = R"( +%val1 = OpIsNan %bool %f32_1 +%val2 = OpIsNan %bool %f64_0 +%val3 = OpIsNan %boolvec2 %f32vec2_12 +%val4 = OpIsNan %boolvec3 %f32vec3_123 +%val5 = OpIsNan %boolvec4 %f32vec4_1234 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateLogicals, OpIsNanWrongTypeId) { + const std::string body = R"( +%val1 = OpIsNan %u32 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected bool scalar or vector type as Result Type: IsNan")); +} + +TEST_F(ValidateLogicals, OpIsNanOperandNotFloat) { + const std::string body = R"( +%val1 = OpIsNan %bool %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected operand to be scalar or vector float: IsNan")); +} + +TEST_F(ValidateLogicals, OpIsNanOperandWrongSize) { + const std::string body = R"( +%val1 = OpIsNan %bool %f32vec2_12 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected vector sizes of Result Type and the operand to be equal: " + "IsNan")); +} + +TEST_F(ValidateLogicals, OpLessOrGreaterSuccess) { + const std::string body = R"( +%val1 = OpLessOrGreater %bool %f32_0 %f32_1 +%val2 = OpLessOrGreater %bool %f64_0 %f64_0 +%val3 = OpLessOrGreater %boolvec2 %f32vec2_12 %f32vec2_12 +%val4 = OpLessOrGreater %boolvec3 %f32vec3_123 %f32vec3_123 +%val5 = OpLessOrGreater %boolvec4 %f32vec4_1234 %f32vec4_1234 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateLogicals, OpLessOrGreaterWrongTypeId) { + const std::string body = R"( +%val1 = OpLessOrGreater %u32 %f32_1 %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected bool scalar or vector type as Result Type: LessOrGreater")); +} + +TEST_F(ValidateLogicals, OpLessOrGreaterLeftOperandNotFloat) { + const std::string body = R"( +%val1 = OpLessOrGreater %bool %u32_1 %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected operands to be scalar or vector float: LessOrGreater")); +} + +TEST_F(ValidateLogicals, OpLessOrGreaterLeftOperandWrongSize) { + const std::string body = R"( +%val1 = OpLessOrGreater %bool %f32vec2_12 %f32_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected vector sizes of Result Type and the operands to be equal: " + "LessOrGreater")); +} + +TEST_F(ValidateLogicals, OpLessOrGreaterOperandsDifferentType) { + const std::string body = R"( +%val1 = OpLessOrGreater %bool %f32_1 %f64_1 +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected left and right operands to have the same type: " + "LessOrGreater")); +} + +TEST_F(ValidateLogicals, OpFOrdEqualSuccess) { + const std::string body = R"( +%val1 = OpFOrdEqual %bool %f32_0 %f32_1 +%val2 = OpFOrdEqual %bool %f64_0 %f64_0 +%val3 = OpFOrdEqual %boolvec2 %f32vec2_12 %f32vec2_12 +%val4 = OpFOrdEqual %boolvec3 %f32vec3_123 %f32vec3_123 +%val5 = OpFOrdEqual %boolvec4 %f32vec4_1234 %f32vec4_1234 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateLogicals, OpFOrdEqualWrongTypeId) { + const std::string body = R"( +%val1 = OpFOrdEqual %u32 %f32_1 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected bool scalar or vector type as Result Type: FOrdEqual")); +} + +TEST_F(ValidateLogicals, OpFOrdEqualLeftOperandNotFloat) { + const std::string body = R"( +%val1 = OpFOrdEqual %bool %u32_1 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected operands to be scalar or vector float: FOrdEqual")); +} + +TEST_F(ValidateLogicals, OpFOrdEqualLeftOperandWrongSize) { + const std::string body = R"( +%val1 = OpFOrdEqual %bool %f32vec2_12 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected vector sizes of Result Type and the operands to be equal: " + "FOrdEqual")); +} + +TEST_F(ValidateLogicals, OpFOrdEqualOperandsDifferentType) { + const std::string body = R"( +%val1 = OpFOrdEqual %bool %f32_1 %f64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected left and right operands to have the same type: " + "FOrdEqual")); +} + +TEST_F(ValidateLogicals, OpLogicalEqualSuccess) { + const std::string body = R"( +%val1 = OpLogicalEqual %bool %true %false +%val2 = OpLogicalEqual %boolvec2 %boolvec2_tf %boolvec2_tf +%val3 = OpLogicalEqual %boolvec3 %boolvec3_tft %boolvec3_tft +%val4 = OpLogicalEqual %boolvec4 %boolvec4_tftf %boolvec4_tftf +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateLogicals, OpLogicalEqualWrongTypeId) { + const std::string body = R"( +%val1 = OpLogicalEqual %u32 %true %false +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected bool scalar or vector type as Result Type: LogicalEqual")); +} + +TEST_F(ValidateLogicals, OpLogicalEqualWrongLeftOperand) { + const std::string body = R"( +%val1 = OpLogicalEqual %bool %boolvec2_tf %false +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected both operands to be of Result Type: LogicalEqual")); +} + +TEST_F(ValidateLogicals, OpLogicalEqualWrongRightOperand) { + const std::string body = R"( +%val1 = OpLogicalEqual %boolvec2 %boolvec2_tf %false +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected both operands to be of Result Type: LogicalEqual")); +} + +TEST_F(ValidateLogicals, OpLogicalNotSuccess) { + const std::string body = R"( +%val1 = OpLogicalNot %bool %true +%val2 = OpLogicalNot %boolvec2 %boolvec2_tf +%val3 = OpLogicalNot %boolvec3 %boolvec3_tft +%val4 = OpLogicalNot %boolvec4 %boolvec4_tftf +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateLogicals, OpLogicalNotWrongTypeId) { + const std::string body = R"( +%val1 = OpLogicalNot %u32 %true +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected bool scalar or vector type as Result Type: LogicalNot")); +} + +TEST_F(ValidateLogicals, OpLogicalNotWrongOperand) { + const std::string body = R"( +%val1 = OpLogicalNot %bool %boolvec2_tf +)"; + + CompileSuccessfully(GenerateKernelCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected operand to be of Result Type: LogicalNot")); +} + +TEST_F(ValidateLogicals, OpSelectSuccess) { + const std::string body = R"( +%val1 = OpSelect %u32 %true %u32_0 %u32_1 +%val2 = OpSelect %f32 %true %f32_0 %f32_1 +%val3 = OpSelect %f64 %true %f64_0 %f64_1 +%val4 = OpSelect %f32vec2 %boolvec2_tf %f32vec2_01 %f32vec2_12 +%val5 = OpSelect %f32vec4 %boolvec4_tftf %f32vec4_0123 %f32vec4_1234 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateLogicals, OpSelectWrongTypeId) { + const std::string body = R"( +%val1 = OpSelect %void %true %u32_0 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected scalar or vector type as Result Type: Select")); +} + +TEST_F(ValidateLogicals, OpSelectPointerNoCapability) { + const std::string body = R"( +%x = OpVariable %f32vec4ptr Function +%y = OpVariable %f32vec4ptr Function +OpStore %x %f32vec4_0123 +OpStore %y %f32vec4_1234 +%val1 = OpSelect %f32vec4ptr %true %x %y +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Using pointers with OpSelect requires capability VariablePointers " + "or VariablePointersStorageBuffer")); +} + +TEST_F(ValidateLogicals, OpSelectPointerWithCapability1) { + const std::string body = R"( +%x = OpVariable %f32vec4ptr Function +%y = OpVariable %f32vec4ptr Function +OpStore %x %f32vec4_0123 +OpStore %y %f32vec4_1234 +%val1 = OpSelect %f32vec4ptr %true %x %y +)"; + + const std::string extra_cap_ext = R"( +OpCapability VariablePointers +OpExtension "SPV_KHR_variable_pointers" +)"; + + CompileSuccessfully(GenerateShaderCode(body, extra_cap_ext).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateLogicals, OpSelectPointerWithCapability2) { + const std::string body = R"( +%x = OpVariable %f32vec4ptr Function +%y = OpVariable %f32vec4ptr Function +OpStore %x %f32vec4_0123 +OpStore %y %f32vec4_1234 +%val1 = OpSelect %f32vec4ptr %true %x %y +)"; + + const std::string extra_cap_ext = R"( +OpCapability VariablePointersStorageBuffer +OpExtension "SPV_KHR_variable_pointers" +)"; + + CompileSuccessfully(GenerateShaderCode(body, extra_cap_ext).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateLogicals, OpSelectWrongCondition) { + const std::string body = R"( +%val1 = OpSelect %u32 %u32_1 %u32_0 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected bool scalar or vector type as condition: Select")); +} + +TEST_F(ValidateLogicals, OpSelectWrongConditionDimension) { + const std::string body = R"( +%val1 = OpSelect %u32vec2 %true %u32vec2_01 %u32vec2_12 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected vector sizes of Result Type and the condition to be equal: " + "Select")); +} + +TEST_F(ValidateLogicals, OpSelectWrongLeftObject) { + const std::string body = R"( +%val1 = OpSelect %bool %true %u32vec2_01 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected both objects to be of Result Type: Select")); +} + +TEST_F(ValidateLogicals, OpSelectWrongRightObject) { + const std::string body = R"( +%val1 = OpSelect %bool %true %u32_1 %u32vec2_01 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected both objects to be of Result Type: Select")); +} + +TEST_F(ValidateLogicals, OpIEqualSuccess) { + const std::string body = R"( +%val1 = OpIEqual %bool %u32_0 %s32_1 +%val2 = OpIEqual %bool %s64_0 %u64_0 +%val3 = OpIEqual %boolvec2 %s32vec2_12 %u32vec2_12 +%val4 = OpIEqual %boolvec3 %s32vec3_123 %u32vec3_123 +%val5 = OpIEqual %boolvec4 %s32vec4_1234 %u32vec4_1234 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateLogicals, OpIEqualWrongTypeId) { + const std::string body = R"( +%val1 = OpIEqual %u32 %s32_1 %s32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected bool scalar or vector type as Result Type: IEqual")); +} + +TEST_F(ValidateLogicals, OpIEqualLeftOperandNotInt) { + const std::string body = R"( +%val1 = OpIEqual %bool %f32_1 %s32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected operands to be scalar or vector int: IEqual")); +} + +TEST_F(ValidateLogicals, OpIEqualLeftOperandWrongSize) { + const std::string body = R"( +%val1 = OpIEqual %bool %s32vec2_12 %s32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected vector sizes of Result Type and the operands to be equal: " + "IEqual")); +} + +TEST_F(ValidateLogicals, OpIEqualRightOperandNotInt) { + const std::string body = R"( +%val1 = OpIEqual %bool %u32_1 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected operands to be scalar or vector int: IEqual")); +} + +TEST_F(ValidateLogicals, OpIEqualDifferentBitWidth) { + const std::string body = R"( +%val1 = OpIEqual %bool %u32_1 %u64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected both operands to have the same component bit " + "width: IEqual")); +} + +TEST_F(ValidateLogicals, OpUGreaterThanSuccess) { + const std::string body = R"( +%val1 = OpUGreaterThan %bool %u32_0 %u32_1 +%val2 = OpUGreaterThan %bool %s32_0 %u32_1 +%val3 = OpUGreaterThan %bool %u64_0 %u64_0 +%val4 = OpUGreaterThan %bool %u64_0 %s64_0 +%val5 = OpUGreaterThan %boolvec2 %u32vec2_12 %u32vec2_12 +%val6 = OpUGreaterThan %boolvec3 %s32vec3_123 %u32vec3_123 +%val7 = OpUGreaterThan %boolvec4 %u32vec4_1234 %u32vec4_1234 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateLogicals, OpUGreaterThanWrongTypeId) { + const std::string body = R"( +%val1 = OpUGreaterThan %u32 %u32_1 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected bool scalar or vector type as Result Type: UGreaterThan")); +} + +TEST_F(ValidateLogicals, OpUGreaterThanLeftOperandNotInt) { + const std::string body = R"( +%val1 = OpUGreaterThan %bool %f32_1 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected operands to be scalar or vector int: UGreaterThan")); +} + +TEST_F(ValidateLogicals, OpUGreaterThanLeftOperandWrongSize) { + const std::string body = R"( +%val1 = OpUGreaterThan %bool %u32vec2_12 %u32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected vector sizes of Result Type and the operands to be equal: " + "UGreaterThan")); +} + +TEST_F(ValidateLogicals, OpUGreaterThanRightOperandNotInt) { + const std::string body = R"( +%val1 = OpUGreaterThan %bool %u32_1 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected operands to be scalar or vector int: UGreaterThan")); +} + +TEST_F(ValidateLogicals, OpUGreaterThanDifferentBitWidth) { + const std::string body = R"( +%val1 = OpUGreaterThan %bool %u32_1 %u64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected both operands to have the same component bit width: " + "UGreaterThan")); +} + +TEST_F(ValidateLogicals, OpSGreaterThanSuccess) { + const std::string body = R"( +%val1 = OpSGreaterThan %bool %s32_0 %s32_1 +%val2 = OpSGreaterThan %bool %u32_0 %s32_1 +%val3 = OpSGreaterThan %bool %s64_0 %s64_0 +%val4 = OpSGreaterThan %bool %s64_0 %u64_0 +%val5 = OpSGreaterThan %boolvec2 %s32vec2_12 %s32vec2_12 +%val6 = OpSGreaterThan %boolvec3 %s32vec3_123 %u32vec3_123 +%val7 = OpSGreaterThan %boolvec4 %s32vec4_1234 %s32vec4_1234 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateLogicals, OpSGreaterThanWrongTypeId) { + const std::string body = R"( +%val1 = OpSGreaterThan %s32 %s32_1 %s32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected bool scalar or vector type as Result Type: SGreaterThan")); +} + +TEST_F(ValidateLogicals, OpSGreaterThanLeftOperandNotInt) { + const std::string body = R"( +%val1 = OpSGreaterThan %bool %f32_1 %s32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected operands to be scalar or vector int: SGreaterThan")); +} + +TEST_F(ValidateLogicals, OpSGreaterThanLeftOperandWrongSize) { + const std::string body = R"( +%val1 = OpSGreaterThan %bool %s32vec2_12 %s32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Expected vector sizes of Result Type and the operands to be equal: " + "SGreaterThan")); +} + +TEST_F(ValidateLogicals, OpSGreaterThanRightOperandNotInt) { + const std::string body = R"( +%val1 = OpSGreaterThan %bool %s32_1 %f32_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("Expected operands to be scalar or vector int: SGreaterThan")); +} + +TEST_F(ValidateLogicals, OpSGreaterThanDifferentBitWidth) { + const std::string body = R"( +%val1 = OpSGreaterThan %bool %s32_1 %s64_1 +)"; + + CompileSuccessfully(GenerateShaderCode(body).c_str()); + ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Expected both operands to have the same component bit " + "width: SGreaterThan")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_primitives_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_primitives_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_primitives_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_primitives_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,313 @@ +// Copyright (c) 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. + +#include +#include + +#include "gmock/gmock.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using ::testing::HasSubstr; +using ::testing::Not; + +using ValidatePrimitives = spvtest::ValidateBase; + +std::string GenerateShaderCode( + const std::string& body, + const std::string& capabilities_and_extensions = + "OpCapability GeometryStreams", + const std::string& execution_model = "Geometry") { + std::ostringstream ss; + ss << capabilities_and_extensions << "\n"; + ss << "OpMemoryModel Logical GLSL450\n"; + ss << "OpEntryPoint " << execution_model << " %main \"main\"\n"; + + ss << R"( +%void = OpTypeVoid +%func = OpTypeFunction %void +%f32 = OpTypeFloat 32 +%u32 = OpTypeInt 32 0 +%u32vec4 = OpTypeVector %u32 4 + +%f32_0 = OpConstant %f32 0 +%u32_0 = OpConstant %u32 0 +%u32_1 = OpConstant %u32 1 +%u32_2 = OpConstant %u32 2 +%u32_3 = OpConstant %u32 3 +%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 + +%main = OpFunction %void None %func +%main_entry = OpLabel +)"; + + ss << body; + + ss << R"( +OpReturn +OpFunctionEnd)"; + + return ss.str(); +} + +// Returns SPIR-V assembly fragment representing a function call, +// the end of the callee body, and the preamble and body of the called +// function with the given body, but missing the final return and +// function-end. The result is of the form where it can be used in the +// |body| argument to GenerateShaderCode. +std::string CallAndCallee(const std::string& body) { + std::ostringstream ss; + ss << R"( +%dummy = OpFunctionCall %void %foo +OpReturn +OpFunctionEnd + +%foo = OpFunction %void None %func +%foo_entry = OpLabel +)"; + + ss << body; + + return ss.str(); +} + +// OpEmitVertex doesn't have any parameters, so other validation +// is handled by the binary parser, and generic dominance checks. +TEST_F(ValidatePrimitives, EmitVertexSuccess) { + CompileSuccessfully( + GenerateShaderCode("OpEmitVertex", "OpCapability Geometry")); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidatePrimitives, EmitVertexFailMissingCapability) { + CompileSuccessfully( + GenerateShaderCode("OpEmitVertex", "OpCapability Shader", "Vertex")); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Opcode EmitVertex requires one of these capabilities: Geometry")); +} + +TEST_F(ValidatePrimitives, EmitVertexFailWrongExecutionMode) { + CompileSuccessfully( + GenerateShaderCode("OpEmitVertex", "OpCapability Geometry", "Vertex")); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("EmitVertex instructions require Geometry execution model")); +} + +TEST_F(ValidatePrimitives, EmitVertexFailWrongExecutionModeNestedFunction) { + CompileSuccessfully(GenerateShaderCode(CallAndCallee("OpEmitVertex"), + "OpCapability Geometry", "Vertex")); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("EmitVertex instructions require Geometry execution model")); +} + +// OpEndPrimitive doesn't have any parameters, so other validation +// is handled by the binary parser, and generic dominance checks. +TEST_F(ValidatePrimitives, EndPrimitiveSuccess) { + CompileSuccessfully( + GenerateShaderCode("OpEndPrimitive", "OpCapability Geometry")); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidatePrimitives, EndPrimitiveFailMissingCapability) { + CompileSuccessfully( + GenerateShaderCode("OpEndPrimitive", "OpCapability Shader", "Vertex")); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "Opcode EndPrimitive requires one of these capabilities: Geometry")); +} + +TEST_F(ValidatePrimitives, EndPrimitiveFailWrongExecutionMode) { + CompileSuccessfully( + GenerateShaderCode("OpEndPrimitive", "OpCapability Geometry", "Vertex")); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("EndPrimitive instructions require Geometry execution model")); +} + +TEST_F(ValidatePrimitives, EndPrimitiveFailWrongExecutionModeNestedFunction) { + CompileSuccessfully(GenerateShaderCode(CallAndCallee("OpEndPrimitive"), + "OpCapability Geometry", "Vertex")); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr("EndPrimitive instructions require Geometry execution model")); +} + +TEST_F(ValidatePrimitives, EmitStreamVertexSuccess) { + const std::string body = R"( +OpEmitStreamVertex %u32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidatePrimitives, EmitStreamVertexFailMissingCapability) { + CompileSuccessfully(GenerateShaderCode("OpEmitStreamVertex %u32_0", + "OpCapability Shader", "Vertex")); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Opcode EmitStreamVertex requires one of these " + "capabilities: GeometryStreams")); +} + +TEST_F(ValidatePrimitives, EmitStreamVertexFailWrongExecutionMode) { + CompileSuccessfully(GenerateShaderCode( + "OpEmitStreamVertex %u32_0", "OpCapability GeometryStreams", "Vertex")); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "EmitStreamVertex instructions require Geometry execution model")); +} + +TEST_F(ValidatePrimitives, + EmitStreamVertexFailWrongExecutionModeNestedFunction) { + CompileSuccessfully( + GenerateShaderCode(CallAndCallee("OpEmitStreamVertex %u32_0"), + "OpCapability GeometryStreams", "Vertex")); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "EmitStreamVertex instructions require Geometry execution model")); +} + +TEST_F(ValidatePrimitives, EmitStreamVertexNonInt) { + const std::string body = R"( +OpEmitStreamVertex %f32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("EmitStreamVertex: " + "expected Stream to be int scalar")); +} + +TEST_F(ValidatePrimitives, EmitStreamVertexNonScalar) { + const std::string body = R"( +OpEmitStreamVertex %u32vec4_0123 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("EmitStreamVertex: " + "expected Stream to be int scalar")); +} + +TEST_F(ValidatePrimitives, EmitStreamVertexNonConstant) { + const std::string body = R"( +%val1 = OpIAdd %u32 %u32_0 %u32_1 +OpEmitStreamVertex %val1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("EmitStreamVertex: " + "expected Stream to be constant instruction")); +} + +TEST_F(ValidatePrimitives, EndStreamPrimitiveSuccess) { + const std::string body = R"( +OpEndStreamPrimitive %u32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidatePrimitives, EndStreamPrimitiveFailMissingCapability) { + CompileSuccessfully(GenerateShaderCode("OpEndStreamPrimitive %u32_0", + "OpCapability Shader", "Vertex")); + EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Opcode EndStreamPrimitive requires one of these " + "capabilities: GeometryStreams")); +} + +TEST_F(ValidatePrimitives, EndStreamPrimitiveFailWrongExecutionMode) { + CompileSuccessfully(GenerateShaderCode( + "OpEndStreamPrimitive %u32_0", "OpCapability GeometryStreams", "Vertex")); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "EndStreamPrimitive instructions require Geometry execution model")); +} + +TEST_F(ValidatePrimitives, + EndStreamPrimitiveFailWrongExecutionModeNestedFunction) { + CompileSuccessfully( + GenerateShaderCode(CallAndCallee("OpEndStreamPrimitive %u32_0"), + "OpCapability GeometryStreams", "Vertex")); + EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "EndStreamPrimitive instructions require Geometry execution model")); +} + +TEST_F(ValidatePrimitives, EndStreamPrimitiveNonInt) { + const std::string body = R"( +OpEndStreamPrimitive %f32_0 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("EndStreamPrimitive: " + "expected Stream to be int scalar")); +} + +TEST_F(ValidatePrimitives, EndStreamPrimitiveNonScalar) { + const std::string body = R"( +OpEndStreamPrimitive %u32vec4_0123 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("EndStreamPrimitive: " + "expected Stream to be int scalar")); +} + +TEST_F(ValidatePrimitives, EndStreamPrimitiveNonConstant) { + const std::string body = R"( +%val1 = OpIAdd %u32 %u32_0 %u32_1 +OpEndStreamPrimitive %val1 +)"; + + CompileSuccessfully(GenerateShaderCode(body)); + EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("EndStreamPrimitive: " + "expected Stream to be constant instruction")); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_ssa_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_ssa_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_ssa_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_ssa_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,1435 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Validation tests for SSA + +#include +#include +#include + +#include "gmock/gmock.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +using ::testing::HasSubstr; +using ::testing::MatchesRegex; + +using std::pair; +using std::string; +using std::stringstream; + +namespace { +using ValidateSSA = spvtest::ValidateBase>; + +TEST_F(ValidateSSA, Default) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %3 "" + OpExecutionMode %3 LocalSize 1 1 1 +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpFunction %1 None %2 +%4 = OpLabel + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateSSA, IdUndefinedBad) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpName %missing "missing" +%voidt = OpTypeVoid +%vfunct = OpTypeFunction %voidt +%func = OpFunction %vfunct None %missing +%flabel = OpLabel + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); +} + +TEST_F(ValidateSSA, IdRedefinedBad) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpName %2 "redefined" +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%2 = OpFunction %1 None %2 +%4 = OpLabel + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); +} + +TEST_F(ValidateSSA, DominateUsageBad) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpName %1 "not_dominant" +%2 = OpTypeFunction %1 ; uses %1 before it's definition +%1 = OpTypeVoid +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("not_dominant")); +} + +TEST_F(ValidateSSA, DominateUsageWithinBlockBad) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpName %bad "bad" +%voidt = OpTypeVoid +%funct = OpTypeFunction %voidt +%uintt = OpTypeInt 32 0 +%one = OpConstant %uintt 1 +%func = OpFunction %voidt None %funct +%entry = OpLabel +%sum = OpIAdd %uintt %one %bad +%bad = OpCopyObject %uintt %sum + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + MatchesRegex("ID .\\[bad\\] has not been defined")); +} + +TEST_F(ValidateSSA, DominateUsageSameInstructionBad) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpName %sum "sum" +%voidt = OpTypeVoid +%funct = OpTypeFunction %voidt +%uintt = OpTypeInt 32 0 +%one = OpConstant %uintt 1 +%func = OpFunction %voidt None %funct +%entry = OpLabel +%sum = OpIAdd %uintt %one %sum + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + MatchesRegex("ID .\\[sum\\] has not been defined")); +} + +TEST_F(ValidateSSA, ForwardNameGood) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpName %3 "main" +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%3 = OpFunction %1 None %2 +%4 = OpLabel + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateSSA, ForwardNameMissingTargetBad) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpName %5 "main" ; Target never defined +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("main")); +} + +TEST_F(ValidateSSA, ForwardMemberNameGood) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpMemberName %struct 0 "value" + OpMemberName %struct 1 "size" +%intt = OpTypeInt 32 1 +%uintt = OpTypeInt 32 0 +%struct = OpTypeStruct %intt %uintt +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateSSA, ForwardMemberNameMissingTargetBad) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpMemberName %struct 0 "value" + OpMemberName %bad 1 "size" ; Target is not defined +%intt = OpTypeInt 32 1 +%uintt = OpTypeInt 32 0 +%struct = OpTypeStruct %intt %uintt +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("size")); +} + +TEST_F(ValidateSSA, ForwardDecorateGood) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpDecorate %var Restrict +%intt = OpTypeInt 32 1 +%ptrt = OpTypePointer UniformConstant %intt +%var = OpVariable %ptrt UniformConstant +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateSSA, ForwardDecorateInvalidIDBad) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpName %missing "missing" + OpDecorate %missing Restrict ;Missing ID +%voidt = OpTypeVoid +%intt = OpTypeInt 32 1 +%ptrt = OpTypePointer UniformConstant %intt +%var = OpVariable %ptrt UniformConstant +%2 = OpTypeFunction %voidt +%3 = OpFunction %voidt None %2 +%4 = OpLabel + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); +} + +TEST_F(ValidateSSA, ForwardMemberDecorateGood) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpMemberDecorate %struct 1 RowMajor +%intt = OpTypeInt 32 1 +%f32 = OpTypeFloat 32 +%vec3 = OpTypeVector %f32 3 +%mat33 = OpTypeMatrix %vec3 3 +%struct = OpTypeStruct %intt %mat33 +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateSSA, ForwardMemberDecorateInvalidIdBad) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpName %missing "missing" + OpMemberDecorate %missing 1 RowMajor ; Target not defined +%intt = OpTypeInt 32 1 +%f32 = OpTypeFloat 32 +%vec3 = OpTypeVector %f32 3 +%mat33 = OpTypeMatrix %vec3 3 +%struct = OpTypeStruct %intt %mat33 +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); +} + +TEST_F(ValidateSSA, ForwardGroupDecorateGood) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpDecorate %dgrp RowMajor +%dgrp = OpDecorationGroup + OpGroupDecorate %dgrp %mat33 %mat44 +%f32 = OpTypeFloat 32 +%vec3 = OpTypeVector %f32 3 +%vec4 = OpTypeVector %f32 4 +%mat33 = OpTypeMatrix %vec3 3 +%mat44 = OpTypeMatrix %vec4 4 +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateSSA, ForwardGroupDecorateMissingGroupBad) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpName %missing "missing" + OpDecorate %dgrp RowMajor +%dgrp = OpDecorationGroup + OpGroupDecorate %missing %mat33 %mat44 ; Target not defined +%intt = OpTypeInt 32 1 +%vec3 = OpTypeVector %intt 3 +%vec4 = OpTypeVector %intt 4 +%mat33 = OpTypeMatrix %vec3 3 +%mat44 = OpTypeMatrix %vec4 4 +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); +} + +TEST_F(ValidateSSA, ForwardGroupDecorateMissingTargetBad) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpName %missing "missing" + OpDecorate %dgrp RowMajor +%dgrp = OpDecorationGroup + OpGroupDecorate %dgrp %missing %mat44 ; Target not defined +%f32 = OpTypeFloat 32 +%vec3 = OpTypeVector %f32 3 +%vec4 = OpTypeVector %f32 4 +%mat33 = OpTypeMatrix %vec3 3 +%mat44 = OpTypeMatrix %vec4 4 +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); +} + +TEST_F(ValidateSSA, ForwardGroupDecorateDecorationGroupDominateBad) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpName %dgrp "group" + OpDecorate %dgrp RowMajor + OpGroupDecorate %dgrp %mat33 %mat44 ; Decoration group does not dominate usage +%dgrp = OpDecorationGroup +%intt = OpTypeInt 32 1 +%vec3 = OpTypeVector %intt 3 +%vec4 = OpTypeVector %intt 4 +%mat33 = OpTypeMatrix %vec3 3 +%mat44 = OpTypeMatrix %vec4 4 +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("group")); +} + +TEST_F(ValidateSSA, ForwardDecorateInvalidIdBad) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpName %missing "missing" + OpDecorate %missing Restrict ; Missing target +%voidt = OpTypeVoid +%intt = OpTypeInt 32 1 +%ptrt = OpTypePointer UniformConstant %intt +%var = OpVariable %ptrt UniformConstant +%2 = OpTypeFunction %voidt +%3 = OpFunction %voidt None %2 +%4 = OpLabel + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); +} + +TEST_F(ValidateSSA, FunctionCallGood) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 +%1 = OpTypeVoid +%2 = OpTypeInt 32 1 +%3 = OpTypeInt 32 0 +%4 = OpTypeFunction %1 +%8 = OpTypeFunction %1 %2 %3 +%four = OpConstant %2 4 +%five = OpConstant %3 5 +%9 = OpFunction %1 None %8 +%10 = OpFunctionParameter %2 +%11 = OpFunctionParameter %3 +%12 = OpLabel + OpReturn + OpFunctionEnd +%5 = OpFunction %1 None %4 +%6 = OpLabel +%7 = OpFunctionCall %1 %9 %four %five + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateSSA, ForwardFunctionCallGood) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 +%1 = OpTypeVoid +%2 = OpTypeInt 32 1 +%3 = OpTypeInt 32 0 +%four = OpConstant %2 4 +%five = OpConstant %3 5 +%8 = OpTypeFunction %1 %2 %3 +%4 = OpTypeFunction %1 +%5 = OpFunction %1 None %4 +%6 = OpLabel +%7 = OpFunctionCall %1 %9 %four %five + OpReturn + OpFunctionEnd +%9 = OpFunction %1 None %8 +%10 = OpFunctionParameter %2 +%11 = OpFunctionParameter %3 +%12 = OpLabel + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateSSA, ForwardBranchConditionalGood) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 +%voidt = OpTypeVoid +%boolt = OpTypeBool +%vfunct = OpTypeFunction %voidt +%true = OpConstantTrue %boolt +%main = OpFunction %voidt None %vfunct +%mainl = OpLabel + OpSelectionMerge %endl None + OpBranchConditional %true %truel %falsel +%truel = OpLabel + OpNop + OpBranch %endl +%falsel = OpLabel + OpNop + OpBranch %endl +%endl = OpLabel + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateSSA, ForwardBranchConditionalWithWeightsGood) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 +%voidt = OpTypeVoid +%boolt = OpTypeBool +%vfunct = OpTypeFunction %voidt +%true = OpConstantTrue %boolt +%main = OpFunction %voidt None %vfunct +%mainl = OpLabel + OpSelectionMerge %endl None + OpBranchConditional %true %truel %falsel 1 9 +%truel = OpLabel + OpNop + OpBranch %endl +%falsel = OpLabel + OpNop + OpBranch %endl +%endl = OpLabel + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateSSA, ForwardBranchConditionalNonDominantConditionBad) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpName %tcpy "conditional" +%voidt = OpTypeVoid +%boolt = OpTypeBool +%vfunct = OpTypeFunction %voidt +%true = OpConstantTrue %boolt +%main = OpFunction %voidt None %vfunct +%mainl = OpLabel + OpSelectionMerge %endl None + OpBranchConditional %tcpy %truel %falsel ; +%truel = OpLabel + OpNop + OpBranch %endl +%falsel = OpLabel + OpNop + OpBranch %endl +%endl = OpLabel +%tcpy = OpCopyObject %boolt %true + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("conditional")); +} + +TEST_F(ValidateSSA, ForwardBranchConditionalMissingTargetBad) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 + OpName %missing "missing" +%voidt = OpTypeVoid +%boolt = OpTypeBool +%vfunct = OpTypeFunction %voidt +%true = OpConstantTrue %boolt +%main = OpFunction %voidt None %vfunct +%mainl = OpLabel + OpSelectionMerge %endl None + OpBranchConditional %true %missing %falsel +%truel = OpLabel + OpNop + OpBranch %endl +%falsel = OpLabel + OpNop + OpBranch %endl +%endl = OpLabel + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); +} + +// Since Int8 requires the Kernel capability, the signedness of int types may +// not be "1". +const string kHeader = R"( +OpCapability Int8 +OpCapability DeviceEnqueue +OpCapability Linkage +OpMemoryModel Logical OpenCL +)"; + +const string kBasicTypes = R"( +%voidt = OpTypeVoid +%boolt = OpTypeBool +%int8t = OpTypeInt 8 0 +%uintt = OpTypeInt 32 0 +%vfunct = OpTypeFunction %voidt +%intptrt = OpTypePointer UniformConstant %uintt +%zero = OpConstant %uintt 0 +%one = OpConstant %uintt 1 +%ten = OpConstant %uintt 10 +%false = OpConstantFalse %boolt +)"; + +const string kKernelTypesAndConstants = R"( +%queuet = OpTypeQueue + +%three = OpConstant %uintt 3 +%arr3t = OpTypeArray %uintt %three +%ndt = OpTypeStruct %uintt %arr3t %arr3t %arr3t + +%eventt = OpTypeEvent + +%offset = OpConstant %uintt 0 +%local = OpConstant %uintt 1 +%gl = OpConstant %uintt 1 + +%nevent = OpConstant %uintt 0 +%event = OpConstantNull %eventt + +%firstp = OpConstant %int8t 0 +%psize = OpConstant %uintt 0 +%palign = OpConstant %uintt 32 +%lsize = OpConstant %uintt 1 +%flags = OpConstant %uintt 0 ; NoWait + +%kfunct = OpTypeFunction %voidt %intptrt +)"; + +const string kKernelSetup = R"( +%dqueue = OpGetDefaultQueue %queuet +%ndval = OpBuildNDRange %ndt %gl %local %offset +%revent = OpUndef %eventt + +)"; + +const string kKernelDefinition = R"( +%kfunc = OpFunction %voidt None %kfunct +%iparam = OpFunctionParameter %intptrt +%kfuncl = OpLabel + OpNop + OpReturn + OpFunctionEnd +)"; + +TEST_F(ValidateSSA, EnqueueKernelGood) { + string str = kHeader + kBasicTypes + kKernelTypesAndConstants + + kKernelDefinition + R"( + %main = OpFunction %voidt None %vfunct + %mainl = OpLabel + )" + kKernelSetup + R"( + %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent + %event %revent %kfunc %firstp %psize + %palign %lsize + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateSSA, ForwardEnqueueKernelGood) { + string str = kHeader + kBasicTypes + kKernelTypesAndConstants + R"( + %main = OpFunction %voidt None %vfunct + %mainl = OpLabel + )" + + kKernelSetup + R"( + %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent + %event %revent %kfunc %firstp %psize + %palign %lsize + OpReturn + OpFunctionEnd + )" + kKernelDefinition; + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateSSA, EnqueueMissingFunctionBad) { + string str = kHeader + "OpName %kfunc \"kfunc\"" + kBasicTypes + + kKernelTypesAndConstants + R"( + %main = OpFunction %voidt None %vfunct + %mainl = OpLabel + )" + kKernelSetup + R"( + %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent + %event %revent %kfunc %firstp %psize + %palign %lsize + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("kfunc")); +} + +string forwardKernelNonDominantParameterBaseCode(string name = string()) { + string op_name; + if (name.empty()) { + op_name = ""; + } else { + op_name = "\nOpName %" + name + " \"" + name + "\"\n"; + } + string out = kHeader + op_name + kBasicTypes + kKernelTypesAndConstants + + kKernelDefinition + + R"( + %main = OpFunction %voidt None %vfunct + %mainl = OpLabel + )" + + kKernelSetup; + return out; +} + +TEST_F(ValidateSSA, ForwardEnqueueKernelMissingParameter1Bad) { + string str = forwardKernelNonDominantParameterBaseCode("missing") + R"( + %err = OpEnqueueKernel %missing %dqueue %flags %ndval + %nevent %event %revent %kfunc %firstp + %psize %palign %lsize + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); +} + +TEST_F(ValidateSSA, ForwardEnqueueKernelNonDominantParameter2Bad) { + string str = forwardKernelNonDominantParameterBaseCode("dqueue2") + R"( + %err = OpEnqueueKernel %uintt %dqueue2 %flags %ndval + %nevent %event %revent %kfunc + %firstp %psize %palign %lsize + %dqueue2 = OpGetDefaultQueue %queuet + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("dqueue2")); +} + +TEST_F(ValidateSSA, ForwardEnqueueKernelNonDominantParameter3Bad) { + string str = forwardKernelNonDominantParameterBaseCode("ndval2") + R"( + %err = OpEnqueueKernel %uintt %dqueue %flags %ndval2 + %nevent %event %revent %kfunc %firstp + %psize %palign %lsize + %ndval2 = OpBuildNDRange %ndt %gl %local %offset + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("ndval2")); +} + +TEST_F(ValidateSSA, ForwardEnqueueKernelNonDominantParameter4Bad) { + string str = forwardKernelNonDominantParameterBaseCode("nevent2") + R"( + %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent2 + %event %revent %kfunc %firstp %psize + %palign %lsize + %nevent2 = OpCopyObject %uintt %nevent + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("nevent2")); +} + +TEST_F(ValidateSSA, ForwardEnqueueKernelNonDominantParameter5Bad) { + string str = forwardKernelNonDominantParameterBaseCode("event2") + R"( + %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent + %event2 %revent %kfunc %firstp %psize + %palign %lsize + %event2 = OpCopyObject %eventt %event + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("event2")); +} + +TEST_F(ValidateSSA, ForwardEnqueueKernelNonDominantParameter6Bad) { + string str = forwardKernelNonDominantParameterBaseCode("revent2") + R"( + %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent + %event %revent2 %kfunc %firstp %psize + %palign %lsize + %revent2 = OpCopyObject %eventt %revent + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("revent2")); +} + +TEST_F(ValidateSSA, ForwardEnqueueKernelNonDominantParameter8Bad) { + string str = forwardKernelNonDominantParameterBaseCode("firstp2") + R"( + %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent + %event %revent %kfunc %firstp2 %psize + %palign %lsize + %firstp2 = OpCopyObject %int8t %firstp + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("firstp2")); +} + +TEST_F(ValidateSSA, ForwardEnqueueKernelNonDominantParameter9Bad) { + string str = forwardKernelNonDominantParameterBaseCode("psize2") + R"( + %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent + %event %revent %kfunc %firstp %psize2 + %palign %lsize + %psize2 = OpCopyObject %uintt %psize + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("psize2")); +} + +TEST_F(ValidateSSA, ForwardEnqueueKernelNonDominantParameter10Bad) { + string str = forwardKernelNonDominantParameterBaseCode("palign2") + R"( + %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent + %event %revent %kfunc %firstp %psize + %palign2 %lsize + %palign2 = OpCopyObject %uintt %palign + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("palign2")); +} + +TEST_F(ValidateSSA, ForwardEnqueueKernelNonDominantParameter11Bad) { + string str = forwardKernelNonDominantParameterBaseCode("lsize2") + R"( + %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent + %event %revent %kfunc %firstp %psize + %palign %lsize2 + %lsize2 = OpCopyObject %uintt %lsize + OpReturn + OpFunctionEnd + )"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("lsize2")); +} + +static const bool kWithNDrange = true; +static const bool kNoNDrange = false; +pair cases[] = { + {"OpGetKernelNDrangeSubGroupCount", kWithNDrange}, + {"OpGetKernelNDrangeMaxSubGroupSize", kWithNDrange}, + {"OpGetKernelWorkGroupSize", kNoNDrange}, + {"OpGetKernelPreferredWorkGroupSizeMultiple", kNoNDrange}}; + +INSTANTIATE_TEST_CASE_P(KernelArgs, ValidateSSA, ::testing::ValuesIn(cases), ); + +static const string return_instructions = R"( + OpReturn + OpFunctionEnd +)"; + +TEST_P(ValidateSSA, GetKernelGood) { + string instruction = GetParam().first; + bool with_ndrange = GetParam().second; + string ndrange_param = with_ndrange ? " %ndval " : " "; + + stringstream ss; + // clang-format off + ss << forwardKernelNonDominantParameterBaseCode() + " %numsg = " + << instruction + " %uintt" + ndrange_param + "%kfunc %firstp %psize %palign" + << return_instructions; + // clang-format on + + CompileSuccessfully(ss.str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateSSA, ForwardGetKernelGood) { + string instruction = GetParam().first; + bool with_ndrange = GetParam().second; + string ndrange_param = with_ndrange ? " %ndval " : " "; + + // clang-format off + string str = kHeader + kBasicTypes + kKernelTypesAndConstants + + R"( + %main = OpFunction %voidt None %vfunct + %mainl = OpLabel + )" + + kKernelSetup + " %numsg = " + + instruction + " %uintt" + ndrange_param + "%kfunc %firstp %psize %palign" + + return_instructions + kKernelDefinition; + // clang-format on + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_P(ValidateSSA, ForwardGetKernelMissingDefinitionBad) { + string instruction = GetParam().first; + bool with_ndrange = GetParam().second; + string ndrange_param = with_ndrange ? " %ndval " : " "; + + stringstream ss; + // clang-format off + ss << forwardKernelNonDominantParameterBaseCode("missing") + " %numsg = " + << instruction + " %uintt" + ndrange_param + "%missing %firstp %psize %palign" + << return_instructions; + // clang-format on + + CompileSuccessfully(ss.str()); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); +} + +TEST_P(ValidateSSA, ForwardGetKernelNDrangeSubGroupCountMissingParameter1Bad) { + string instruction = GetParam().first; + bool with_ndrange = GetParam().second; + string ndrange_param = with_ndrange ? " %ndval " : " "; + + stringstream ss; + // clang-format off + ss << forwardKernelNonDominantParameterBaseCode("missing") + " %numsg = " + << instruction + " %missing" + ndrange_param + "%kfunc %firstp %psize %palign" + << return_instructions; + // clang-format on + + CompileSuccessfully(ss.str()); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); +} + +TEST_P(ValidateSSA, + ForwardGetKernelNDrangeSubGroupCountNonDominantParameter2Bad) { + string instruction = GetParam().first; + bool with_ndrange = GetParam().second; + string ndrange_param = with_ndrange ? " %ndval2 " : " "; + + stringstream ss; + // clang-format off + ss << forwardKernelNonDominantParameterBaseCode("ndval2") + " %numsg = " + << instruction + " %uintt" + ndrange_param + "%kfunc %firstp %psize %palign" + << "\n %ndval2 = OpBuildNDRange %ndt %gl %local %offset" + << return_instructions; + // clang-format on + + if (GetParam().second) { + CompileSuccessfully(ss.str()); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("ndval2")); + } +} + +TEST_P(ValidateSSA, + ForwardGetKernelNDrangeSubGroupCountNonDominantParameter4Bad) { + string instruction = GetParam().first; + bool with_ndrange = GetParam().second; + string ndrange_param = with_ndrange ? " %ndval " : " "; + + stringstream ss; + // clang-format off + ss << forwardKernelNonDominantParameterBaseCode("firstp2") + " %numsg = " + << instruction + " %uintt" + ndrange_param + "%kfunc %firstp2 %psize %palign" + << "\n %firstp2 = OpCopyObject %int8t %firstp" + << return_instructions; + // clang-format on + + CompileSuccessfully(ss.str()); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("firstp2")); +} + +TEST_P(ValidateSSA, + ForwardGetKernelNDrangeSubGroupCountNonDominantParameter5Bad) { + string instruction = GetParam().first; + bool with_ndrange = GetParam().second; + string ndrange_param = with_ndrange ? " %ndval " : " "; + + stringstream ss; + // clang-format off + ss << forwardKernelNonDominantParameterBaseCode("psize2") + " %numsg = " + << instruction + " %uintt" + ndrange_param + "%kfunc %firstp %psize2 %palign" + << "\n %psize2 = OpCopyObject %uintt %psize" + << return_instructions; + // clang-format on + + CompileSuccessfully(ss.str()); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("psize2")); +} + +TEST_P(ValidateSSA, + ForwardGetKernelNDrangeSubGroupCountNonDominantParameter6Bad) { + string instruction = GetParam().first; + bool with_ndrange = GetParam().second; + string ndrange_param = with_ndrange ? " %ndval " : " "; + + stringstream ss; + // clang-format off + ss << forwardKernelNonDominantParameterBaseCode("palign2") + " %numsg = " + << instruction + " %uintt" + ndrange_param + "%kfunc %firstp %psize %palign2" + << "\n %palign2 = OpCopyObject %uintt %palign" + << return_instructions; + // clang-format on + + if (GetParam().second) { + CompileSuccessfully(ss.str()); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("palign2")); + } +} + +TEST_F(ValidateSSA, PhiGood) { + string str = kHeader + kBasicTypes + + R"( +%func = OpFunction %voidt None %vfunct +%preheader = OpLabel +%init = OpCopyObject %uintt %zero + OpBranch %loop +%loop = OpLabel +%i = OpPhi %uintt %init %preheader %loopi %loop +%loopi = OpIAdd %uintt %i %one + OpNop +%cond = OpSLessThan %boolt %i %ten + OpLoopMerge %endl %loop None + OpBranchConditional %cond %loop %endl +%endl = OpLabel + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateSSA, PhiMissingTypeBad) { + string str = kHeader + "OpName %missing \"missing\"" + kBasicTypes + + R"( +%func = OpFunction %voidt None %vfunct +%preheader = OpLabel +%init = OpCopyObject %uintt %zero + OpBranch %loop +%loop = OpLabel +%i = OpPhi %missing %init %preheader %loopi %loop +%loopi = OpIAdd %uintt %i %one + OpNop +%cond = OpSLessThan %boolt %i %ten + OpLoopMerge %endl %loop None + OpBranchConditional %cond %loop %endl +%endl = OpLabel + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); +} + +TEST_F(ValidateSSA, PhiMissingIdBad) { + string str = kHeader + "OpName %missing \"missing\"" + kBasicTypes + + R"( +%func = OpFunction %voidt None %vfunct +%preheader = OpLabel +%init = OpCopyObject %uintt %zero + OpBranch %loop +%loop = OpLabel +%i = OpPhi %uintt %missing %preheader %loopi %loop +%loopi = OpIAdd %uintt %i %one + OpNop +%cond = OpSLessThan %boolt %i %ten + OpLoopMerge %endl %loop None + OpBranchConditional %cond %loop %endl +%endl = OpLabel + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); +} + +TEST_F(ValidateSSA, PhiMissingLabelBad) { + string str = kHeader + "OpName %missing \"missing\"" + kBasicTypes + + R"( +%func = OpFunction %voidt None %vfunct +%preheader = OpLabel +%init = OpCopyObject %uintt %zero + OpBranch %loop +%loop = OpLabel +%i = OpPhi %uintt %init %missing %loopi %loop +%loopi = OpIAdd %uintt %i %one + OpNop +%cond = OpSLessThan %boolt %i %ten + OpLoopMerge %endl %loop None + OpBranchConditional %cond %loop %endl +%endl = OpLabel + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); +} + +TEST_F(ValidateSSA, IdDominatesItsUseGood) { + string str = kHeader + kBasicTypes + + R"( +%func = OpFunction %voidt None %vfunct +%entry = OpLabel +%cond = OpSLessThan %boolt %one %ten +%eleven = OpIAdd %uintt %one %ten + OpSelectionMerge %merge None + OpBranchConditional %cond %t %f +%t = OpLabel +%twelve = OpIAdd %uintt %eleven %one + OpBranch %merge +%f = OpLabel +%twentytwo = OpIAdd %uintt %eleven %ten + OpBranch %merge +%merge = OpLabel + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateSSA, IdDoesNotDominateItsUseBad) { + string str = kHeader + + "OpName %eleven \"eleven\"\n" + "OpName %true_block \"true_block\"\n" + "OpName %false_block \"false_block\"" + + kBasicTypes + + R"( +%func = OpFunction %voidt None %vfunct +%entry = OpLabel +%cond = OpSLessThan %boolt %one %ten + OpSelectionMerge %merge None + OpBranchConditional %cond %true_block %false_block +%true_block = OpLabel +%eleven = OpIAdd %uintt %one %ten +%twelve = OpIAdd %uintt %eleven %one + OpBranch %merge +%false_block = OpLabel +%twentytwo = OpIAdd %uintt %eleven %ten + OpBranch %merge +%merge = OpLabel + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + MatchesRegex("ID .\\[eleven\\] defined in block .\\[true_block\\] does " + "not dominate its use in block .\\[false_block\\]")); +} + +TEST_F(ValidateSSA, PhiUseDoesntDominateDefinitionGood) { + string str = kHeader + kBasicTypes + + R"( +%func = OpFunction %voidt None %vfunct +%entry = OpLabel +%var_one = OpVariable %intptrt Function %one +%one_val = OpLoad %uintt %var_one + OpBranch %loop +%loop = OpLabel +%i = OpPhi %uintt %one_val %entry %inew %cont +%cond = OpSLessThan %boolt %one %ten + OpLoopMerge %merge %cont None + OpBranchConditional %cond %body %merge +%body = OpLabel + OpBranch %cont +%cont = OpLabel +%inew = OpIAdd %uintt %i %one + OpBranch %loop +%merge = OpLabel + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateSSA, + PhiUseDoesntDominateUseOfPhiOperandUsedBeforeDefinitionBad) { + string str = kHeader + "OpName %inew \"inew\"" + kBasicTypes + + R"( +%func = OpFunction %voidt None %vfunct +%entry = OpLabel +%var_one = OpVariable %intptrt Function %one +%one_val = OpLoad %uintt %var_one + OpBranch %loop +%loop = OpLabel +%i = OpPhi %uintt %one_val %entry %inew %cont +%bad = OpIAdd %uintt %inew %one +%cond = OpSLessThan %boolt %one %ten + OpLoopMerge %merge %cont None + OpBranchConditional %cond %body %merge +%body = OpLabel + OpBranch %cont +%cont = OpLabel +%inew = OpIAdd %uintt %i %one + OpBranch %loop +%merge = OpLabel + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + MatchesRegex("ID .\\[inew\\] has not been defined")); +} + +TEST_F(ValidateSSA, PhiUseMayComeFromNonDominatingBlockGood) { + string str = kHeader + "OpName %if_true \"if_true\"\n" + + "OpName %exit \"exit\"\n" + "OpName %copy \"copy\"\n" + + kBasicTypes + + R"( +%func = OpFunction %voidt None %vfunct +%entry = OpLabel + OpBranchConditional %false %if_true %exit + +%if_true = OpLabel +%copy = OpCopyObject %boolt %false + OpBranch %exit + +; The use of %copy here is ok, even though it was defined +; in a block that does not dominate %exit. That's the point +; of an OpPhi. +%exit = OpLabel +%value = OpPhi %boolt %false %entry %copy %if_true + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); +} + +TEST_F(ValidateSSA, PhiUsesItsOwnDefinitionGood) { + // See https://github.com/KhronosGroup/SPIRV-Tools/issues/415 + // + // Non-phi instructions can't use their own definitions, as + // already checked in test DominateUsageSameInstructionBad. + string str = kHeader + "OpName %loop \"loop\"\n" + + "OpName %value \"value\"\n" + kBasicTypes + + R"( +%func = OpFunction %voidt None %vfunct +%entry = OpLabel + OpBranch %loop + +%loop = OpLabel +%value = OpPhi %boolt %false %entry %value %loop + OpBranch %loop + + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); +} + +TEST_F(ValidateSSA, PhiVariableDefNotDominatedByParentBlockBad) { + string str = kHeader + "OpName %if_true \"if_true\"\n" + + "OpName %if_false \"if_false\"\n" + "OpName %exit \"exit\"\n" + + "OpName %value \"phi\"\n" + "OpName %true_copy \"true_copy\"\n" + + "OpName %false_copy \"false_copy\"\n" + kBasicTypes + + R"( +%func = OpFunction %voidt None %vfunct +%entry = OpLabel + OpBranchConditional %false %if_true %if_false + +%if_true = OpLabel +%true_copy = OpCopyObject %boolt %false + OpBranch %exit + +%if_false = OpLabel +%false_copy = OpCopyObject %boolt %false + OpBranch %exit + +; The (variable,Id) pairs are swapped. +%exit = OpLabel +%value = OpPhi %boolt %true_copy %if_false %false_copy %if_true + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + MatchesRegex("In OpPhi instruction .\\[phi\\], ID .\\[true_copy\\] " + "definition does not dominate its parent .\\[if_false\\]")); +} + +TEST_F(ValidateSSA, PhiVariableDefDominatesButNotDefinedInParentBlock) { + string str = kHeader + "OpName %if_true \"if_true\"\n" + kBasicTypes + + R"( +%func = OpFunction %voidt None %vfunct +%entry = OpLabel + OpBranchConditional %false %if_true %if_false + +%if_true = OpLabel +%true_copy = OpCopyObject %boolt %false + OpBranch %if_tnext +%if_tnext = OpLabel + OpBranch %exit + +%if_false = OpLabel +%false_copy = OpCopyObject %boolt %false + OpBranch %if_fnext +%if_fnext = OpLabel + OpBranch %exit + +%exit = OpLabel +%value = OpPhi %boolt %true_copy %if_tnext %false_copy %if_fnext + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateSSA, + DominanceCheckIgnoresUsesInUnreachableBlocksDefInBlockGood) { + string str = kHeader + kBasicTypes + + R"( +%func = OpFunction %voidt None %vfunct +%entry = OpLabel +%def = OpCopyObject %boolt %false + OpReturn + +%unreach = OpLabel +%use = OpCopyObject %boolt %def + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); +} + +TEST_F(ValidateSSA, PhiVariableUnreachableDefNotInParentBlock) { + string str = kHeader + "OpName %unreachable \"unreachable\"\n" + kBasicTypes + + R"( +%func = OpFunction %voidt None %vfunct +%entry = OpLabel + OpBranch %if_false + +%unreachable = OpLabel +%copy = OpCopyObject %boolt %false + OpBranch %if_tnext +%if_tnext = OpLabel + OpBranch %exit + +%if_false = OpLabel +%false_copy = OpCopyObject %boolt %false + OpBranch %if_fnext +%if_fnext = OpLabel + OpBranch %exit + +%exit = OpLabel +%value = OpPhi %boolt %copy %if_tnext %false_copy %if_fnext + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateSSA, + DominanceCheckIgnoresUsesInUnreachableBlocksDefIsParamGood) { + string str = kHeader + kBasicTypes + + R"( +%void_fn_int = OpTypeFunction %voidt %uintt +%func = OpFunction %voidt None %void_fn_int +%int_param = OpFunctionParameter %uintt +%entry = OpLabel + OpReturn + +%unreach = OpLabel +%use = OpCopyObject %uintt %int_param + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); +} + +TEST_F(ValidateSSA, UseFunctionParameterFromOtherFunctionBad) { + string str = kHeader + + "OpName %first \"first\"\n" + "OpName %func \"func\"\n" + + "OpName %func2 \"func2\"\n" + kBasicTypes + + R"( +%viifunct = OpTypeFunction %voidt %uintt %uintt +%func = OpFunction %voidt None %viifunct +%first = OpFunctionParameter %uintt +%second = OpFunctionParameter %uintt + OpFunctionEnd +%func2 = OpFunction %voidt None %viifunct +%first2 = OpFunctionParameter %uintt +%second2 = OpFunctionParameter %uintt +%entry2 = OpLabel +%baduse = OpIAdd %uintt %first %first2 + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); + EXPECT_THAT( + getDiagnosticString(), + MatchesRegex("ID .\\[first\\] used in function .\\[func2\\] is used " + "outside of it's defining function .\\[func\\]")); +} + +TEST_F(ValidateSSA, TypeForwardPointerForwardReference) { + // See https://github.com/KhronosGroup/SPIRV-Tools/issues/429 + // + // ForwardPointers can references instructions that have not been defined + string str = R"( + OpCapability Kernel + OpCapability Addresses + OpCapability Linkage + OpMemoryModel Logical OpenCL + OpName %intptrt "intptrt" + OpTypeForwardPointer %intptrt UniformConstant + %uint = OpTypeInt 32 0 + %intptrt = OpTypePointer UniformConstant %uint +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateSSA, TypeStructForwardReference) { + string str = R"( + OpCapability Kernel + OpCapability Addresses + OpCapability Linkage + OpMemoryModel Logical OpenCL + OpName %structptr "structptr" + OpTypeForwardPointer %structptr UniformConstant + %uint = OpTypeInt 32 0 + %structt1 = OpTypeStruct %structptr %uint + %structt2 = OpTypeStruct %uint %structptr + %structt3 = OpTypeStruct %uint %uint %structptr + %structt4 = OpTypeStruct %uint %uint %uint %structptr + %structptr = OpTypePointer UniformConstant %structt1 +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// TODO(umar): OpGroupMemberDecorate +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_state_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_state_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_state_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_state_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,136 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// Copyright (c) 2016 Google 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. + +// Unit tests for ValidationState_t. + +#include + +#include "gtest/gtest.h" +#include "latest_version_spirv_header.h" + +#include "enum_set.h" +#include "extensions.h" +#include "spirv_validator_options.h" +#include "val/construct.h" +#include "val/function.h" +#include "val/validation_state.h" +#include "validate.h" + +namespace { +using libspirv::CapabilitySet; +using libspirv::Extension; +using libspirv::ExtensionSet; +using libspirv::ValidationState_t; +using std::vector; + +// A test with a ValidationState_t member transparently. +class ValidationStateTest : public testing::Test { + public: + ValidationStateTest() + : context_(spvContextCreate(SPV_ENV_UNIVERSAL_1_0)), + options_(spvValidatorOptionsCreate()), + state_(context_, options_) {} + + ~ValidationStateTest() { + spvContextDestroy(context_); + spvValidatorOptionsDestroy(options_); + } + + protected: + spv_context context_; + spv_validator_options options_; + ValidationState_t state_; +}; + +// A test of ValidationState_t::HasAnyOfCapabilities(). +using ValidationState_HasAnyOfCapabilities = ValidationStateTest; + +TEST_F(ValidationState_HasAnyOfCapabilities, EmptyMask) { + EXPECT_TRUE(state_.HasAnyOfCapabilities({})); + state_.RegisterCapability(SpvCapabilityMatrix); + EXPECT_TRUE(state_.HasAnyOfCapabilities({})); + state_.RegisterCapability(SpvCapabilityImageMipmap); + EXPECT_TRUE(state_.HasAnyOfCapabilities({})); + state_.RegisterCapability(SpvCapabilityPipes); + EXPECT_TRUE(state_.HasAnyOfCapabilities({})); + state_.RegisterCapability(SpvCapabilityStorageImageArrayDynamicIndexing); + EXPECT_TRUE(state_.HasAnyOfCapabilities({})); + state_.RegisterCapability(SpvCapabilityClipDistance); + EXPECT_TRUE(state_.HasAnyOfCapabilities({})); + state_.RegisterCapability(SpvCapabilityStorageImageWriteWithoutFormat); + EXPECT_TRUE(state_.HasAnyOfCapabilities({})); +} + +TEST_F(ValidationState_HasAnyOfCapabilities, SingleCapMask) { + EXPECT_FALSE(state_.HasAnyOfCapabilities({SpvCapabilityMatrix})); + EXPECT_FALSE(state_.HasAnyOfCapabilities({SpvCapabilityImageMipmap})); + state_.RegisterCapability(SpvCapabilityMatrix); + EXPECT_TRUE(state_.HasAnyOfCapabilities({SpvCapabilityMatrix})); + EXPECT_FALSE(state_.HasAnyOfCapabilities({SpvCapabilityImageMipmap})); + state_.RegisterCapability(SpvCapabilityImageMipmap); + EXPECT_TRUE(state_.HasAnyOfCapabilities({SpvCapabilityMatrix})); + EXPECT_TRUE(state_.HasAnyOfCapabilities({SpvCapabilityImageMipmap})); +} + +TEST_F(ValidationState_HasAnyOfCapabilities, MultiCapMask) { + const auto set1 = + CapabilitySet{SpvCapabilitySampledRect, SpvCapabilityImageBuffer}; + const auto set2 = CapabilitySet{SpvCapabilityStorageImageWriteWithoutFormat, + SpvCapabilityStorageImageReadWithoutFormat, + SpvCapabilityGeometryStreams}; + EXPECT_FALSE(state_.HasAnyOfCapabilities(set1)); + EXPECT_FALSE(state_.HasAnyOfCapabilities(set2)); + state_.RegisterCapability(SpvCapabilityImageBuffer); + EXPECT_TRUE(state_.HasAnyOfCapabilities(set1)); + EXPECT_FALSE(state_.HasAnyOfCapabilities(set2)); +} + +// A test of ValidationState_t::HasAnyOfExtensions(). +using ValidationState_HasAnyOfExtensions = ValidationStateTest; + +TEST_F(ValidationState_HasAnyOfExtensions, EmptyMask) { + EXPECT_TRUE(state_.HasAnyOfExtensions({})); + state_.RegisterExtension(Extension::kSPV_KHR_shader_ballot); + EXPECT_TRUE(state_.HasAnyOfExtensions({})); + state_.RegisterExtension(Extension::kSPV_KHR_16bit_storage); + EXPECT_TRUE(state_.HasAnyOfExtensions({})); + state_.RegisterExtension(Extension::kSPV_NV_viewport_array2); + EXPECT_TRUE(state_.HasAnyOfExtensions({})); +} + +TEST_F(ValidationState_HasAnyOfExtensions, SingleCapMask) { + EXPECT_FALSE(state_.HasAnyOfExtensions({Extension::kSPV_KHR_shader_ballot})); + EXPECT_FALSE(state_.HasAnyOfExtensions({Extension::kSPV_KHR_16bit_storage})); + state_.RegisterExtension(Extension::kSPV_KHR_shader_ballot); + EXPECT_TRUE(state_.HasAnyOfExtensions({Extension::kSPV_KHR_shader_ballot})); + EXPECT_FALSE(state_.HasAnyOfExtensions({Extension::kSPV_KHR_16bit_storage})); + state_.RegisterExtension(Extension::kSPV_KHR_16bit_storage); + EXPECT_TRUE(state_.HasAnyOfExtensions({Extension::kSPV_KHR_shader_ballot})); + EXPECT_TRUE(state_.HasAnyOfExtensions({Extension::kSPV_KHR_16bit_storage})); +} + +TEST_F(ValidationState_HasAnyOfExtensions, MultiCapMask) { + const auto set1 = ExtensionSet{Extension::kSPV_KHR_multiview, + Extension::kSPV_KHR_16bit_storage}; + const auto set2 = ExtensionSet{Extension::kSPV_KHR_shader_draw_parameters, + Extension::kSPV_NV_stereo_view_rendering, + Extension::kSPV_KHR_shader_ballot}; + EXPECT_FALSE(state_.HasAnyOfExtensions(set1)); + EXPECT_FALSE(state_.HasAnyOfExtensions(set2)); + state_.RegisterExtension(Extension::kSPV_KHR_multiview); + EXPECT_TRUE(state_.HasAnyOfExtensions(set1)); + EXPECT_FALSE(state_.HasAnyOfExtensions(set2)); +} +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_storage_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_storage_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_storage_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_storage_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,178 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Validation tests for OpVariable storage class + +#include +#include +#include + +#include "gmock/gmock.h" +#include "val_fixtures.h" + +using ::testing::HasSubstr; + +using ValidateStorage = spvtest::ValidateBase; + +namespace { + +TEST_F(ValidateStorage, FunctionStorageInsideFunction) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 +%intt = OpTypeInt 32 1 +%voidt = OpTypeVoid +%vfunct = OpTypeFunction %voidt +%ptrt = OpTypePointer Function %intt +%func = OpFunction %voidt None %vfunct +%funcl = OpLabel +%var = OpVariable %ptrt Function + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateStorage, FunctionStorageOutsideFunction) { + char str[] = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 +%intt = OpTypeInt 32 1 +%voidt = OpTypeVoid +%vfunct = OpTypeFunction %voidt +%ptrt = OpTypePointer Function %intt +%var = OpVariable %ptrt Function +%func = OpFunction %voidt None %vfunct +%funcl = OpLabel + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("Variables can not have a function[7] storage class " + "outside of a function")); +} + +TEST_F(ValidateStorage, OtherStorageOutsideFunction) { + char str[] = R"( + OpCapability Shader + OpCapability Kernel + OpCapability AtomicStorage + OpCapability Linkage + OpMemoryModel Logical GLSL450 +%intt = OpTypeInt 32 0 +%voidt = OpTypeVoid +%vfunct = OpTypeFunction %voidt +%ptrt = OpTypePointer Function %intt +%unicon = OpVariable %ptrt UniformConstant +%input = OpVariable %ptrt Input +%unif = OpVariable %ptrt Uniform +%output = OpVariable %ptrt Output +%wgroup = OpVariable %ptrt Workgroup +%xwgrp = OpVariable %ptrt CrossWorkgroup +%priv = OpVariable %ptrt Private +%pushco = OpVariable %ptrt PushConstant +%atomct = OpVariable %ptrt AtomicCounter +%image = OpVariable %ptrt Image +%func = OpFunction %voidt None %vfunct +%funcl = OpLabel + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(str); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +// clang-format off +TEST_P(ValidateStorage, OtherStorageInsideFunction) { + std::stringstream ss; + ss << R"( + OpCapability Shader + OpCapability Kernel + OpCapability AtomicStorage + OpCapability Linkage + OpMemoryModel Logical GLSL450 +%intt = OpTypeInt 32 0 +%voidt = OpTypeVoid +%vfunct = OpTypeFunction %voidt +%ptrt = OpTypePointer Function %intt +%func = OpFunction %voidt None %vfunct +%funcl = OpLabel +%var = OpVariable %ptrt )" << GetParam() << R"( + OpReturn + OpFunctionEnd +)"; + + CompileSuccessfully(ss.str()); + ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr( + "Variables must have a function[7] storage class inside of a function")); +} + +INSTANTIATE_TEST_CASE_P(MatrixOp, ValidateStorage, + ::testing::Values( + "Input", + "Uniform", + "Output", + "Workgroup", + "CrossWorkgroup", + "Private", + "PushConstant", + "AtomicCounter", + "Image"),); +// clang-format on + +TEST_F(ValidateStorage, GenericVariableOutsideFunction) { + const auto str = R"( + OpCapability Kernel + OpCapability Linkage + OpMemoryModel Logical OpenCL +%intt = OpTypeInt 32 0 +%ptrt = OpTypePointer Function %intt +%var = OpVariable %ptrt Generic +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpVariable storage class cannot be Generic")); +} + +TEST_F(ValidateStorage, GenericVariableInsideFunction) { + const auto str = R"( + OpCapability Shader + OpCapability Linkage + OpMemoryModel Logical GLSL450 +%intt = OpTypeInt 32 1 +%voidt = OpTypeVoid +%vfunct = OpTypeFunction %voidt +%ptrt = OpTypePointer Function %intt +%func = OpFunction %voidt None %vfunct +%funcl = OpLabel +%var = OpVariable %ptrt Generic + OpReturn + OpFunctionEnd +)"; + CompileSuccessfully(str); + ASSERT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("OpVariable storage class cannot be Generic")); +} +} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_type_unique_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_type_unique_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_type_unique_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_type_unique_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,269 @@ +// Copyright (c) 2017 Google 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. + +// Tests for unique type declaration rules validator. + +#include + +#include "gmock/gmock.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using ::testing::HasSubstr; +using ::testing::Not; + +using std::string; + +using ValidateTypeUnique = spvtest::ValidateBase; + +const spv_result_t kDuplicateTypeError = SPV_ERROR_INVALID_DATA; + +const string& GetHeader() { + static const string header = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%floatt = OpTypeFloat 32 +%vec2t = OpTypeVector %floatt 2 +%vec3t = OpTypeVector %floatt 3 +%vec4t = OpTypeVector %floatt 4 +%mat22t = OpTypeMatrix %vec2t 2 +%mat33t = OpTypeMatrix %vec3t 3 +%mat44t = OpTypeMatrix %vec4t 4 +%intt = OpTypeInt 32 1 +%uintt = OpTypeInt 32 0 +%num3 = OpConstant %uintt 3 +%const3 = OpConstant %uintt 3 +%val3 = OpConstant %uintt 3 +%array = OpTypeArray %vec3t %num3 +%struct = OpTypeStruct %floatt %floatt %vec3t +%boolt = OpTypeBool +%array2 = OpTypeArray %vec3t %num3 +%voidt = OpTypeVoid +%vfunct = OpTypeFunction %voidt +%struct2 = OpTypeStruct %floatt %floatt %vec3t +%false = OpConstantFalse %boolt +%true = OpConstantTrue %boolt +%runtime_arrayt = OpTypeRuntimeArray %floatt +%runtime_arrayt2 = OpTypeRuntimeArray %floatt +)"; + + return header; +} + +const string& GetBody() { + static const string body = R"( +%main = OpFunction %voidt None %vfunct +%mainl = OpLabel +%a = OpIAdd %uintt %const3 %val3 +%b = OpIAdd %uintt %const3 %val3 +OpSelectionMerge %endl None +OpBranchConditional %true %truel %falsel +%truel = OpLabel +%add1 = OpIAdd %uintt %a %b +%add2 = OpIAdd %uintt %a %b +OpBranch %endl +%falsel = OpLabel +%sub1 = OpISub %uintt %a %b +%sub2 = OpISub %uintt %a %b +OpBranch %endl +%endl = OpLabel +OpReturn +OpFunctionEnd +)"; + + return body; +} + +// Returns expected error string if |opcode| produces a duplicate type +// declaration. +string GetErrorString(SpvOp opcode) { + return "Duplicate non-aggregate type declarations are not allowed. Opcode: " + + std::string(spvOpcodeString(opcode)); +} + +TEST_F(ValidateTypeUnique, success) { + string str = GetHeader() + GetBody(); + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateTypeUnique, duplicate_void) { + string str = GetHeader() + R"( +%boolt2 = OpTypeVoid +)" + GetBody(); + CompileSuccessfully(str.c_str()); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeVoid))); +} + +TEST_F(ValidateTypeUnique, duplicate_bool) { + string str = GetHeader() + R"( +%boolt2 = OpTypeBool +)" + GetBody(); + CompileSuccessfully(str.c_str()); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeBool))); +} + +TEST_F(ValidateTypeUnique, duplicate_int) { + string str = GetHeader() + R"( +%uintt2 = OpTypeInt 32 0 +)" + GetBody(); + CompileSuccessfully(str.c_str()); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeInt))); +} + +TEST_F(ValidateTypeUnique, duplicate_float) { + string str = GetHeader() + R"( +%floatt2 = OpTypeFloat 32 +)" + GetBody(); + CompileSuccessfully(str.c_str()); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeFloat))); +} + +TEST_F(ValidateTypeUnique, duplicate_vec3) { + string str = GetHeader() + R"( +%vec3t2 = OpTypeVector %floatt 3 +)" + GetBody(); + CompileSuccessfully(str.c_str()); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr(GetErrorString(SpvOpTypeVector))); +} + +TEST_F(ValidateTypeUnique, duplicate_mat33) { + string str = GetHeader() + R"( +%mat33t2 = OpTypeMatrix %vec3t 3 +)" + GetBody(); + CompileSuccessfully(str.c_str()); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr(GetErrorString(SpvOpTypeMatrix))); +} + +TEST_F(ValidateTypeUnique, duplicate_vfunc) { + string str = GetHeader() + R"( +%vfunct2 = OpTypeFunction %voidt +)" + GetBody(); + CompileSuccessfully(str.c_str()); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr(GetErrorString(SpvOpTypeFunction))); +} + +TEST_F(ValidateTypeUnique, duplicate_pipe_storage) { + string str = R"( +OpCapability Addresses +OpCapability Kernel +OpCapability Linkage +OpCapability Pipes +OpCapability PipeStorage +OpMemoryModel Physical32 OpenCL +%ps = OpTypePipeStorage +%ps2 = OpTypePipeStorage +)"; + CompileSuccessfully(str.c_str(), SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr(GetErrorString(SpvOpTypePipeStorage))); +} + +TEST_F(ValidateTypeUnique, duplicate_named_barrier) { + string str = R"( +OpCapability Addresses +OpCapability Kernel +OpCapability Linkage +OpCapability NamedBarrier +OpMemoryModel Physical32 OpenCL +%nb = OpTypeNamedBarrier +%nb2 = OpTypeNamedBarrier +)"; + CompileSuccessfully(str.c_str(), SPV_ENV_UNIVERSAL_1_1); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr(GetErrorString(SpvOpTypeNamedBarrier))); +} + +TEST_F(ValidateTypeUnique, duplicate_forward_pointer) { + string str = R"( +OpCapability Addresses +OpCapability Kernel +OpCapability GenericPointer +OpCapability Linkage +OpMemoryModel Physical32 OpenCL +OpTypeForwardPointer %ptr Generic +OpTypeForwardPointer %ptr2 Generic +%intt = OpTypeInt 32 0 +%floatt = OpTypeFloat 32 +%ptr = OpTypePointer Generic %intt +%ptr2 = OpTypePointer Generic %floatt +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); +} + +TEST_F(ValidateTypeUnique, duplicate_void_with_extension) { + string str = R"( +OpCapability Addresses +OpCapability Kernel +OpCapability Linkage +OpCapability Pipes +OpExtension "SPV_VALIDATOR_ignore_type_decl_unique" +OpMemoryModel Physical32 OpenCL +%voidt = OpTypeVoid +%voidt2 = OpTypeVoid +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + Not(HasSubstr(GetErrorString(SpvOpTypeVoid)))); +} + +TEST_F(ValidateTypeUnique, DuplicatePointerTypesNoExtension) { + string str = R"( +OpCapability Shader +OpCapability Linkage +OpMemoryModel Logical GLSL450 +%u32 = OpTypeInt 32 0 +%ptr1 = OpTypePointer Input %u32 +%ptr2 = OpTypePointer Input %u32 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + HasSubstr(GetErrorString(SpvOpTypePointer))); +} + +TEST_F(ValidateTypeUnique, DuplicatePointerTypesWithExtension) { + string str = R"( +OpCapability Shader +OpCapability Linkage +OpExtension "SPV_KHR_variable_pointers" +OpMemoryModel Logical GLSL450 +%u32 = OpTypeInt 32 0 +%ptr1 = OpTypePointer Input %u32 +%ptr2 = OpTypePointer Input %u32 +)"; + CompileSuccessfully(str.c_str()); + ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); + EXPECT_THAT(getDiagnosticString(), + Not(HasSubstr(GetErrorString(SpvOpTypePointer)))); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_validation_state_test.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_validation_state_test.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/test/val/val_validation_state_test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/test/val/val_validation_state_test.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,155 @@ +// Copyright (c) 2016 Google 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. + +// Basic tests for the ValidationState_t datastructure. + +#include + +#include "gmock/gmock.h" +#include "spirv_validator_options.h" +#include "unit_spirv.h" +#include "val_fixtures.h" + +namespace { + +using std::string; +using ::testing::HasSubstr; + +using ValidationStateTest = spvtest::ValidateBase; + +const char header[] = + " OpCapability Shader" + " OpCapability Linkage" + " OpMemoryModel Logical GLSL450 "; + +const char kVoidFVoid[] = + " %void = OpTypeVoid" + " %void_f = OpTypeFunction %void" + " %func = OpFunction %void None %void_f" + " %label = OpLabel" + " OpReturn" + " OpFunctionEnd "; + +// Tests that the instruction count in ValidationState is correct. +TEST_F(ValidationStateTest, CheckNumInstructions) { + string spirv = string(header) + "%int = OpTypeInt 32 0"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); + EXPECT_EQ(size_t(4), vstate_->ordered_instructions().size()); +} + +// Tests that the number of global variables in ValidationState is correct. +TEST_F(ValidationStateTest, CheckNumGlobalVars) { + string spirv = string(header) + R"( + %int = OpTypeInt 32 0 +%_ptr_int = OpTypePointer Input %int + %var_1 = OpVariable %_ptr_int Input + %var_2 = OpVariable %_ptr_int Input + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); + EXPECT_EQ(unsigned(2), vstate_->num_global_vars()); +} + +// Tests that the number of local variables in ValidationState is correct. +TEST_F(ValidationStateTest, CheckNumLocalVars) { + string spirv = string(header) + R"( + %int = OpTypeInt 32 0 + %_ptr_int = OpTypePointer Function %int + %voidt = OpTypeVoid + %funct = OpTypeFunction %voidt + %main = OpFunction %voidt None %funct + %entry = OpLabel + %var_1 = OpVariable %_ptr_int Function + %var_2 = OpVariable %_ptr_int Function + %var_3 = OpVariable %_ptr_int Function + OpReturn + OpFunctionEnd + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); + EXPECT_EQ(unsigned(3), vstate_->num_local_vars()); +} + +// Tests that the "id bound" in ValidationState is correct. +TEST_F(ValidationStateTest, CheckIdBound) { + string spirv = string(header) + R"( + %int = OpTypeInt 32 0 + %voidt = OpTypeVoid + )"; + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); + EXPECT_EQ(unsigned(3), vstate_->getIdBound()); +} + +// Tests that the entry_points in ValidationState is correct. +TEST_F(ValidationStateTest, CheckEntryPoints) { + string spirv = string(header) + " OpEntryPoint Vertex %func \"shader\"" + + string(kVoidFVoid); + CompileSuccessfully(spirv); + EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); + EXPECT_EQ(size_t(1), vstate_->entry_points().size()); + EXPECT_EQ(SpvOpFunction, + vstate_->FindDef(vstate_->entry_points()[0])->opcode()); +} + +TEST_F(ValidationStateTest, CheckStructMemberLimitOption) { + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_struct_members, 32000u); + EXPECT_EQ(32000u, options_->universal_limits_.max_struct_members); +} + +TEST_F(ValidationStateTest, CheckNumGlobalVarsLimitOption) { + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_global_variables, 100u); + EXPECT_EQ(100u, options_->universal_limits_.max_global_variables); +} + +TEST_F(ValidationStateTest, CheckNumLocalVarsLimitOption) { + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_local_variables, 100u); + EXPECT_EQ(100u, options_->universal_limits_.max_local_variables); +} + +TEST_F(ValidationStateTest, CheckStructDepthLimitOption) { + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_struct_depth, 100u); + EXPECT_EQ(100u, options_->universal_limits_.max_struct_depth); +} + +TEST_F(ValidationStateTest, CheckSwitchBranchesLimitOption) { + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_switch_branches, 100u); + EXPECT_EQ(100u, options_->universal_limits_.max_switch_branches); +} + +TEST_F(ValidationStateTest, CheckFunctionArgsLimitOption) { + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_function_args, 100u); + EXPECT_EQ(100u, options_->universal_limits_.max_function_args); +} + +TEST_F(ValidationStateTest, CheckCFGDepthLimitOption) { + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_control_flow_nesting_depth, 100u); + EXPECT_EQ(100u, options_->universal_limits_.max_control_flow_nesting_depth); +} + +TEST_F(ValidationStateTest, CheckAccessChainIndexesLimitOption) { + spvValidatorOptionsSetUniversalLimit( + options_, spv_validator_limit_max_access_chain_indexes, 100u); + EXPECT_EQ(100u, options_->universal_limits_.max_access_chain_indexes); +} + +} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/as/as.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/as/as.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/as/as.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/as/as.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,154 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include + +#include "source/spirv_target_env.h" +#include "spirv-tools/libspirv.h" +#include "tools/io.h" + +void print_usage(char* argv0) { + printf( + R"(%s - Create a SPIR-V binary module from SPIR-V assembly text + +Usage: %s [options] [] + +The SPIR-V assembly text is read from . If no file is specified, +or if the filename is "-", then the binary is read from standard input. +The SPIR-V binary module is written to file "out.spv", unless the -o option +is used. + +Options: + + -h, --help Print this help. + + -o Set the output filename. Use '-' to mean stdout. + --version Display assembler version information. + --preserve-numeric-ids + Numeric IDs in the binary will have the same values as in the + source. Non-numeric IDs are allocated by filling in the gaps, + starting with 1 and going up. + --target-env {vulkan1.0|vulkan1.1|spv1.0|spv1.1|spv1.2|spv1.3} + Use Vulkan 1.0, Vulkan 1.1, SPIR-V 1.0, SPIR-V 1.1, + SPIR-V 1.2, or SPIR-V 1.3 +)", + argv0, argv0); +} + +static const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_3; + +int main(int argc, char** argv) { + const char* inFile = nullptr; + const char* outFile = nullptr; + uint32_t options = 0; + spv_target_env target_env = kDefaultEnvironment; + for (int argi = 1; argi < argc; ++argi) { + if ('-' == argv[argi][0]) { + switch (argv[argi][1]) { + case 'h': { + print_usage(argv[0]); + return 0; + } + case 'o': { + if (!outFile && argi + 1 < argc) { + outFile = argv[++argi]; + } else { + print_usage(argv[0]); + return 1; + } + } break; + case 0: { + // Setting a filename of "-" to indicate stdin. + if (!inFile) { + inFile = argv[argi]; + } else { + fprintf(stderr, "error: More than one input file specified\n"); + return 1; + } + } break; + case '-': { + // Long options + if (0 == strcmp(argv[argi], "--version")) { + printf("%s\n", spvSoftwareVersionDetailsString()); + printf("Target: %s\n", + spvTargetEnvDescription(kDefaultEnvironment)); + return 0; + } else if (0 == strcmp(argv[argi], "--help")) { + print_usage(argv[0]); + return 0; + } else if (0 == strcmp(argv[argi], "--preserve-numeric-ids")) { + options |= SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS; + } else if (0 == strcmp(argv[argi], "--target-env")) { + if (argi + 1 < argc) { + const auto env_str = argv[++argi]; + if (!spvParseTargetEnv(env_str, &target_env)) { + fprintf(stderr, "error: Unrecognized target env: %s\n", + env_str); + return 1; + } + } else { + fprintf(stderr, "error: Missing argument to --target-env\n"); + return 1; + } + } else { + fprintf(stderr, "error: Unrecognized option: %s\n\n", argv[argi]); + print_usage(argv[0]); + return 1; + } + } break; + default: + fprintf(stderr, "error: Unrecognized option: %s\n\n", argv[argi]); + print_usage(argv[0]); + return 1; + } + } else { + if (!inFile) { + inFile = argv[argi]; + } else { + fprintf(stderr, "error: More than one input file specified\n"); + return 1; + } + } + } + + if (!outFile) { + outFile = "out.spv"; + } + + std::vector contents; + if (!ReadFile(inFile, "r", &contents)) return 1; + + spv_binary binary; + spv_diagnostic diagnostic = nullptr; + spv_context context = spvContextCreate(target_env); + spv_result_t error = spvTextToBinaryWithOptions( + context, contents.data(), contents.size(), options, &binary, &diagnostic); + spvContextDestroy(context); + if (error) { + spvDiagnosticPrint(diagnostic); + spvDiagnosticDestroy(diagnostic); + return error; + } + + if (!WriteFile(outFile, "wb", binary->code, binary->wordCount)) { + spvBinaryDestroy(binary); + return 1; + } + + spvBinaryDestroy(binary); + + return 0; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/cfg/bin_to_dot.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/cfg/bin_to_dot.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/cfg/bin_to_dot.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/cfg/bin_to_dot.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,187 @@ +// Copyright (c) 2016 Google 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. + +#include "bin_to_dot.h" + +#include +#include +#include +#include + +#include "assembly_grammar.h" +#include "name_mapper.h" + +namespace { + +const char* kMergeStyle = "style=dashed"; +const char* kContinueStyle = "style=dotted"; + +// A DotConverter can be used to dump the GraphViz "dot" graph for +// a SPIR-V module. +class DotConverter { + public: + DotConverter(libspirv::NameMapper name_mapper, std::iostream* out) + : name_mapper_(std::move(name_mapper)), out_(*out) {} + + // Emits the graph preamble. + void Begin() const { + out_ << "digraph {\n"; + // Emit a simple legend + out_ << "legend_merge_src [shape=plaintext, label=\"\"];\n" + << "legend_merge_dest [shape=plaintext, label=\"\"];\n" + << "legend_merge_src -> legend_merge_dest [label=\" merge\"," + << kMergeStyle << "];\n" + << "legend_continue_src [shape=plaintext, label=\"\"];\n" + << "legend_continue_dest [shape=plaintext, label=\"\"];\n" + << "legend_continue_src -> legend_continue_dest [label=\" continue\"," + << kContinueStyle << "];\n"; + } + // Emits the graph postamble. + void End() const { out_ << "}\n"; } + + // Emits the Dot commands for the given instruction. + spv_result_t HandleInstruction(const spv_parsed_instruction_t& inst); + + private: + // Ends processing for the current block, emitting its dot code. + void FlushBlock(const std::vector& successors); + + // The ID of the current functio, or 0 if outside of a function. + uint32_t current_function_id_ = 0; + + // The ID of the current basic block, or 0 if outside of a block. + uint32_t current_block_id_ = 0; + + // Have we completed processing for the entry block to this fuction? + bool seen_function_entry_block_ = false; + + // The Id of the merge block for this block if it exists, or 0 otherwise. + uint32_t merge_ = 0; + // The Id of the continue target block for this block if it exists, or 0 + // otherwise. + uint32_t continue_target_ = 0; + + // An object for mapping Ids to names. + libspirv::NameMapper name_mapper_; + + // The output stream. + std::ostream& out_; +}; + +spv_result_t DotConverter::HandleInstruction( + const spv_parsed_instruction_t& inst) { + switch (inst.opcode) { + case SpvOpFunction: + current_function_id_ = inst.result_id; + seen_function_entry_block_ = false; + break; + case SpvOpFunctionEnd: + current_function_id_ = 0; + break; + + case SpvOpLabel: + current_block_id_ = inst.result_id; + break; + + case SpvOpBranch: + FlushBlock({inst.words[1]}); + break; + case SpvOpBranchConditional: + FlushBlock({inst.words[2], inst.words[3]}); + break; + case SpvOpSwitch: { + std::vector successors{inst.words[2]}; + for (size_t i = 3; i < inst.num_operands; i += 2) { + successors.push_back(inst.words[inst.operands[i].offset]); + } + FlushBlock(successors); + } break; + + case SpvOpKill: + case SpvOpReturn: + case SpvOpUnreachable: + case SpvOpReturnValue: + FlushBlock({}); + break; + + case SpvOpLoopMerge: + merge_ = inst.words[1]; + continue_target_ = inst.words[2]; + break; + case SpvOpSelectionMerge: + merge_ = inst.words[1]; + break; + default: + break; + } + return SPV_SUCCESS; +} + +void DotConverter::FlushBlock(const std::vector& successors) { + out_ << current_block_id_; + if (!seen_function_entry_block_) { + out_ << " [label=\"" << name_mapper_(current_block_id_) << "\nFn " + << name_mapper_(current_function_id_) << " entry\", shape=box];\n"; + } else { + out_ << " [label=\"" << name_mapper_(current_block_id_) << "\"];\n"; + } + + for (auto successor : successors) { + out_ << current_block_id_ << " -> " << successor << ";\n"; + } + + if (merge_) { + out_ << current_block_id_ << " -> " << merge_ << " [" << kMergeStyle + << "];\n"; + } + if (continue_target_) { + out_ << current_block_id_ << " -> " << continue_target_ << " [" + << kContinueStyle << "];\n"; + } + + // Reset the book-keeping for a block. + seen_function_entry_block_ = true; + merge_ = 0; + continue_target_ = 0; +} + +spv_result_t HandleInstruction( + void* user_data, const spv_parsed_instruction_t* parsed_instruction) { + assert(user_data); + auto converter = static_cast(user_data); + return converter->HandleInstruction(*parsed_instruction); +} + +} // anonymous namespace + +spv_result_t BinaryToDot(const spv_const_context context, const uint32_t* words, + size_t num_words, std::iostream* out, + spv_diagnostic* diagnostic) { + // Invalid arguments return error codes, but don't necessarily generate + // diagnostics. These are programmer errors, not user errors. + if (!diagnostic) return SPV_ERROR_INVALID_DIAGNOSTIC; + const libspirv::AssemblyGrammar grammar(context); + if (!grammar.isValid()) return SPV_ERROR_INVALID_TABLE; + + libspirv::FriendlyNameMapper friendly_mapper(context, words, num_words); + DotConverter converter(friendly_mapper.GetNameMapper(), out); + converter.Begin(); + if (auto error = spvBinaryParse(context, &converter, words, num_words, + nullptr, HandleInstruction, diagnostic)) { + return error; + } + converter.End(); + + return SPV_SUCCESS; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/cfg/bin_to_dot.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/cfg/bin_to_dot.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/cfg/bin_to_dot.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/cfg/bin_to_dot.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,27 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef BIN_TO_DOT_H_ +#define BIN_TO_DOT_H_ + +#include +#include "spirv-tools/libspirv.h" + +// Dumps the control flow graph for the given module to the output stream. +// Returns SPV_SUCCESS on succes. +spv_result_t BinaryToDot(const spv_const_context context, const uint32_t* words, + size_t num_words, std::iostream* out, + spv_diagnostic* diagnostic); + +#endif // BIN_TO_DOT_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/cfg/cfg.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/cfg/cfg.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/cfg/cfg.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/cfg/cfg.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,128 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include +#include +#include + +#include "spirv-tools/libspirv.h" +#include "tools/io.h" + +#include "bin_to_dot.h" + +// Prints a program usage message to stdout. +static void print_usage(const char* argv0) { + printf( + R"(%s - Show the control flow graph in GraphiViz "dot" form. EXPERIMENTAL + +Usage: %s [options] [] + +The SPIR-V binary is read from . If no file is specified, +or if the filename is "-", then the binary is read from standard input. + +Options: + + -h, --help Print this help. + --version Display version information. + + -o Set the output filename. + Output goes to standard output if this option is + not specified, or if the filename is "-". +)", + argv0, argv0); +} + +static const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_2; + +int main(int argc, char** argv) { + const char* inFile = nullptr; + const char* outFile = nullptr; // Stays nullptr if printing to stdout. + + for (int argi = 1; argi < argc; ++argi) { + if ('-' == argv[argi][0]) { + switch (argv[argi][1]) { + case 'h': + print_usage(argv[0]); + return 0; + case 'o': { + if (!outFile && argi + 1 < argc) { + outFile = argv[++argi]; + } else { + print_usage(argv[0]); + return 1; + } + } break; + case '-': { + // Long options + if (0 == strcmp(argv[argi], "--help")) { + print_usage(argv[0]); + return 0; + } else if (0 == strcmp(argv[argi], "--version")) { + printf("%s EXPERIMENTAL\n", spvSoftwareVersionDetailsString()); + printf("Target: %s\n", + spvTargetEnvDescription(kDefaultEnvironment)); + return 0; + } else { + print_usage(argv[0]); + return 1; + } + } break; + case 0: { + // Setting a filename of "-" to indicate stdin. + if (!inFile) { + inFile = argv[argi]; + } else { + fprintf(stderr, "error: More than one input file specified\n"); + return 1; + } + } break; + default: + print_usage(argv[0]); + return 1; + } + } else { + if (!inFile) { + inFile = argv[argi]; + } else { + fprintf(stderr, "error: More than one input file specified\n"); + return 1; + } + } + } + + // Read the input binary. + std::vector contents; + if (!ReadFile(inFile, "rb", &contents)) return 1; + spv_context context = spvContextCreate(kDefaultEnvironment); + spv_diagnostic diagnostic = nullptr; + + std::stringstream ss; + auto error = + BinaryToDot(context, contents.data(), contents.size(), &ss, &diagnostic); + if (error) { + spvDiagnosticPrint(diagnostic); + spvDiagnosticDestroy(diagnostic); + spvContextDestroy(context); + return error; + } + std::string str = ss.str(); + WriteFile(outFile, "w", str.data(), str.size()); + + spvDiagnosticDestroy(diagnostic); + spvContextDestroy(context); + + return 0; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,80 @@ +# Copyright (c) 2015-2016 The Khronos Group Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +add_subdirectory(lesspipe) +add_subdirectory(emacs) + +# Add a SPIR-V Tools command line tool. Signature: +# add_spvtools_tool( +# TARGET target_name +# SRCS src_file1.cpp src_file2.cpp +# LIBS lib_target1 lib_target2 +# ) +function(add_spvtools_tool) + set(one_value_args TARGET) + set(multi_value_args SRCS LIBS) + cmake_parse_arguments( + ARG "" "${one_value_args}" "${multi_value_args}" ${ARGN}) + + add_executable(${ARG_TARGET} ${ARG_SRCS}) + spvtools_default_compile_options(${ARG_TARGET}) + target_link_libraries(${ARG_TARGET} PRIVATE ${ARG_LIBS}) + target_include_directories(${ARG_TARGET} PRIVATE + ${spirv-tools_SOURCE_DIR} + ${spirv-tools_BINARY_DIR} + ) + set_property(TARGET ${ARG_TARGET} PROPERTY FOLDER "SPIRV-Tools executables") +endfunction() + +if (NOT ${SPIRV_SKIP_EXECUTABLES}) + add_spvtools_tool(TARGET spirv-as SRCS as/as.cpp LIBS ${SPIRV_TOOLS}) + add_spvtools_tool(TARGET spirv-dis SRCS dis/dis.cpp LIBS ${SPIRV_TOOLS}) + add_spvtools_tool(TARGET spirv-val SRCS val/val.cpp LIBS ${SPIRV_TOOLS}) + add_spvtools_tool(TARGET spirv-opt SRCS opt/opt.cpp LIBS SPIRV-Tools-opt ${SPIRV_TOOLS}) + add_spvtools_tool(TARGET spirv-link SRCS link/linker.cpp LIBS SPIRV-Tools-link ${SPIRV_TOOLS}) + add_spvtools_tool(TARGET spirv-stats + SRCS stats/stats.cpp + stats/stats_analyzer.cpp + LIBS ${SPIRV_TOOLS}) + add_spvtools_tool(TARGET spirv-cfg + SRCS cfg/cfg.cpp + cfg/bin_to_dot.h + cfg/bin_to_dot.cpp + LIBS ${SPIRV_TOOLS}) + target_include_directories(spirv-cfg PRIVATE ${spirv-tools_SOURCE_DIR} + ${SPIRV_HEADER_INCLUDE_DIR}) + target_include_directories(spirv-stats PRIVATE ${spirv-tools_SOURCE_DIR} + ${SPIRV_HEADER_INCLUDE_DIR}) + + set(SPIRV_INSTALL_TARGETS spirv-as spirv-dis spirv-val spirv-opt spirv-stats + spirv-cfg spirv-link) + + if(SPIRV_BUILD_COMPRESSION) + add_spvtools_tool(TARGET spirv-markv + SRCS comp/markv.cpp + comp/markv_model_factory.cpp + comp/markv_model_shader.cpp + LIBS SPIRV-Tools-comp SPIRV-Tools-opt ${SPIRV_TOOLS}) + target_include_directories(spirv-markv PRIVATE ${spirv-tools_SOURCE_DIR} + ${SPIRV_HEADER_INCLUDE_DIR}) + set(SPIRV_INSTALL_TARGETS ${SPIRV_INSTALL_TARGETS} spirv-markv) + endif(SPIRV_BUILD_COMPRESSION) + + if(ENABLE_SPIRV_TOOLS_INSTALL) + install(TARGETS ${SPIRV_INSTALL_TARGETS} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif(ENABLE_SPIRV_TOOLS_INSTALL) +endif() diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/comp/markv.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/comp/markv.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/comp/markv.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/comp/markv.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,382 @@ +// Copyright (c) 2017 Google 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. + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "markv_model_factory.h" +#include "source/comp/markv.h" +#include "source/spirv_target_env.h" +#include "source/table.h" +#include "spirv-tools/optimizer.hpp" +#include "tools/io.h" + +namespace { + +const auto kSpvEnv = SPV_ENV_UNIVERSAL_1_2; + +enum Task { + kNoTask = 0, + kEncode, + kDecode, + kTest, +}; + +struct ScopedContext { + ScopedContext(spv_target_env env) : context(spvContextCreate(env)) {} + ~ScopedContext() { spvContextDestroy(context); } + spv_context context; +}; + +void print_usage(char* argv0) { + printf( + R"(%s - Encodes or decodes a SPIR-V binary to or from a MARK-V binary. + +USAGE: %s [e|d|t] [options] [] + +The input binary is read from . If no file is specified, +or if the filename is "-", then the binary is read from standard input. + +If no output is specified then the output is printed to stdout in a human +readable format. + +WIP: MARK-V codec is in early stages of development. At the moment it only +can encode and decode some SPIR-V files and only if exacly the same build of +software is used (is doesn't write or handle version numbers yet). + +Tasks: + e Encode SPIR-V to MARK-V. + d Decode MARK-V to SPIR-V. + t Test the codec by first encoding the given SPIR-V file to + MARK-V, then decoding it back to SPIR-V and comparing results. + +Options: + -h, --help Print this help. + --comments Write codec comments to stderr. + --version Display MARK-V codec version. + --validate Validate SPIR-V while encoding or decoding. + --model= + Compression model, possible values: + shader_lite - fast, poor compression ratio + shader_mid - balanced + shader_max - best compression ratio + Default: shader_lite + + -o Set the output filename. + Output goes to standard output if this option is + not specified, or if the filename is "-". + Not needed for 't' task (testing). +)", + argv0, argv0); +} + +void DiagnosticsMessageHandler(spv_message_level_t level, const char*, + const spv_position_t& position, + const char* message) { + switch (level) { + case SPV_MSG_FATAL: + case SPV_MSG_INTERNAL_ERROR: + case SPV_MSG_ERROR: + std::cerr << "error: " << position.index << ": " << message << std::endl; + break; + case SPV_MSG_WARNING: + std::cerr << "warning: " << position.index << ": " << message + << std::endl; + break; + case SPV_MSG_INFO: + std::cerr << "info: " << position.index << ": " << message << std::endl; + break; + default: + break; + } +} + +} // namespace + +int main(int argc, char** argv) { + const char* input_filename = nullptr; + const char* output_filename = nullptr; + + Task task = kNoTask; + + if (argc < 3) { + print_usage(argv[0]); + return 0; + } + + const char* task_char = argv[1]; + if (0 == strcmp("e", task_char)) { + task = kEncode; + } else if (0 == strcmp("d", task_char)) { + task = kDecode; + } else if (0 == strcmp("t", task_char)) { + task = kTest; + } + + if (task == kNoTask) { + print_usage(argv[0]); + return 1; + } + + bool want_comments = false; + bool validate_spirv_binary = false; + + spvtools::MarkvModelType model_type = spvtools::kMarkvModelUnknown; + + for (int argi = 2; argi < argc; ++argi) { + if ('-' == argv[argi][0]) { + switch (argv[argi][1]) { + case 'h': + print_usage(argv[0]); + return 0; + case 'o': { + if (!output_filename && argi + 1 < argc && + (task == kEncode || task == kDecode)) { + output_filename = argv[++argi]; + } else { + print_usage(argv[0]); + return 1; + } + } break; + case '-': { + if (0 == strcmp(argv[argi], "--help")) { + print_usage(argv[0]); + return 0; + } else if (0 == strcmp(argv[argi], "--comments")) { + want_comments = true; + } else if (0 == strcmp(argv[argi], "--version")) { + fprintf(stderr, "error: Not implemented\n"); + return 1; + } else if (0 == strcmp(argv[argi], "--validate")) { + validate_spirv_binary = true; + } else if (0 == strcmp(argv[argi], "--model=shader_lite")) { + if (model_type != spvtools::kMarkvModelUnknown) + fprintf(stderr, "error: More than one model specified\n"); + model_type = spvtools::kMarkvModelShaderLite; + } else if (0 == strcmp(argv[argi], "--model=shader_mid")) { + if (model_type != spvtools::kMarkvModelUnknown) + fprintf(stderr, "error: More than one model specified\n"); + model_type = spvtools::kMarkvModelShaderMid; + } else if (0 == strcmp(argv[argi], "--model=shader_max")) { + if (model_type != spvtools::kMarkvModelUnknown) + fprintf(stderr, "error: More than one model specified\n"); + model_type = spvtools::kMarkvModelShaderMax; + } else { + print_usage(argv[0]); + return 1; + } + } break; + case '\0': { + // Setting a filename of "-" to indicate stdin. + if (!input_filename) { + input_filename = argv[argi]; + } else { + fprintf(stderr, "error: More than one input file specified\n"); + return 1; + } + } break; + default: + print_usage(argv[0]); + return 1; + } + } else { + if (!input_filename) { + input_filename = argv[argi]; + } else { + fprintf(stderr, "error: More than one input file specified\n"); + return 1; + } + } + } + + if (model_type == spvtools::kMarkvModelUnknown) + model_type = spvtools::kMarkvModelShaderLite; + + const auto no_comments = spvtools::MarkvLogConsumer(); + const auto output_to_stderr = [](const std::string& str) { + std::cerr << str; + }; + + ScopedContext ctx(kSpvEnv); + + std::unique_ptr model = + spvtools::CreateMarkvModel(model_type); + + std::vector spirv; + std::vector markv; + + spvtools::MarkvCodecOptions options; + options.validate_spirv_binary = validate_spirv_binary; + + if (task == kEncode) { + if (!ReadFile(input_filename, "rb", &spirv)) return 1; + assert(!spirv.empty()); + + if (SPV_SUCCESS != + spvtools::SpirvToMarkv(ctx.context, spirv, options, *model, + DiagnosticsMessageHandler, + want_comments ? output_to_stderr : no_comments, + spvtools::MarkvDebugConsumer(), &markv)) { + std::cerr << "error: Failed to encode " << input_filename << " to MARK-V " + << std::endl; + return 1; + } + + if (!WriteFile(output_filename, "wb", markv.data(), markv.size())) + return 1; + } else if (task == kDecode) { + if (!ReadFile(input_filename, "rb", &markv)) return 1; + assert(!markv.empty()); + + if (SPV_SUCCESS != + spvtools::MarkvToSpirv(ctx.context, markv, options, *model, + DiagnosticsMessageHandler, + want_comments ? output_to_stderr : no_comments, + spvtools::MarkvDebugConsumer(), &spirv)) { + std::cerr << "error: Failed to decode " << input_filename << " to SPIR-V " + << std::endl; + return 1; + } + + if (!WriteFile(output_filename, "wb", spirv.data(), spirv.size())) + return 1; + } else if (task == kTest) { + if (!ReadFile(input_filename, "rb", &spirv)) return 1; + assert(!spirv.empty()); + + std::vector spirv_before; + spvtools::Optimizer optimizer(kSpvEnv); + optimizer.RegisterPass(spvtools::CreateCompactIdsPass()); + if (!optimizer.Run(spirv.data(), spirv.size(), &spirv_before)) { + std::cerr << "error: Optimizer failure on: " << input_filename + << std::endl; + } + + std::vector encoder_instruction_bits; + std::vector encoder_instruction_comments; + std::vector> encoder_instruction_words; + std::vector decoder_instruction_bits; + std::vector decoder_instruction_comments; + std::vector> decoder_instruction_words; + + const auto encoder_debug_consumer = [&](const std::vector& words, + const std::string& bits, + const std::string& comment) { + encoder_instruction_words.push_back(words); + encoder_instruction_bits.push_back(bits); + encoder_instruction_comments.push_back(comment); + return true; + }; + + if (SPV_SUCCESS != + spvtools::SpirvToMarkv(ctx.context, spirv_before, options, *model, + DiagnosticsMessageHandler, + want_comments ? output_to_stderr : no_comments, + encoder_debug_consumer, &markv)) { + std::cerr << "error: Failed to encode " << input_filename << " to MARK-V " + << std::endl; + return 1; + } + + const auto write_bug_report = [&]() { + for (size_t inst_index = 0; inst_index < decoder_instruction_words.size(); + ++inst_index) { + std::cerr << "\nInstruction #" << inst_index << std::endl; + std::cerr << "\nEncoder words: "; + for (uint32_t word : encoder_instruction_words[inst_index]) + std::cerr << word << " "; + std::cerr << "\nDecoder words: "; + for (uint32_t word : decoder_instruction_words[inst_index]) + std::cerr << word << " "; + std::cerr << std::endl; + + std::cerr << "\nEncoder bits: " << encoder_instruction_bits[inst_index]; + std::cerr << "\nDecoder bits: " << decoder_instruction_bits[inst_index]; + std::cerr << std::endl; + + std::cerr << "\nEncoder comments:\n" + << encoder_instruction_comments[inst_index]; + std::cerr << "Decoder comments:\n" + << decoder_instruction_comments[inst_index]; + std::cerr << std::endl; + } + }; + + const auto decoder_debug_consumer = [&](const std::vector& words, + const std::string& bits, + const std::string& comment) { + const size_t inst_index = decoder_instruction_words.size(); + if (inst_index >= encoder_instruction_words.size()) { + write_bug_report(); + std::cerr << "error: Decoder has more instructions than encoder: " + << input_filename << std::endl; + return false; + } + + decoder_instruction_words.push_back(words); + decoder_instruction_bits.push_back(bits); + decoder_instruction_comments.push_back(comment); + + if (encoder_instruction_words[inst_index] != + decoder_instruction_words[inst_index]) { + write_bug_report(); + std::cerr << "error: Words of the last decoded instruction differ from " + "reference: " + << input_filename << std::endl; + return false; + } + + if (encoder_instruction_bits[inst_index] != + decoder_instruction_bits[inst_index]) { + write_bug_report(); + std::cerr << "error: Bits of the last decoded instruction differ from " + "reference: " + << input_filename << std::endl; + return false; + } + return true; + }; + + std::vector spirv_after; + const spv_result_t decoding_result = spvtools::MarkvToSpirv( + ctx.context, markv, options, *model, DiagnosticsMessageHandler, + want_comments ? output_to_stderr : no_comments, decoder_debug_consumer, + &spirv_after); + + if (decoding_result == SPV_REQUESTED_TERMINATION) { + std::cerr << "error: Decoding interrupted by the debugger: " + << input_filename << std::endl; + return 1; + } + + if (decoding_result != SPV_SUCCESS) { + std::cerr << "error: Failed to decode encoded " << input_filename + << " back to SPIR-V " << std::endl; + return 1; + } + + assert(spirv_before.size() == spirv_after.size()); + assert(std::mismatch(std::next(spirv_before.begin(), 5), spirv_before.end(), + std::next(spirv_after.begin(), 5)) == + std::make_pair(spirv_before.end(), spirv_after.end())); + } + + return 0; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/comp/markv_model_factory.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/comp/markv_model_factory.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/comp/markv_model_factory.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/comp/markv_model_factory.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,47 @@ +// Copyright (c) 2017 Google 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. + +#include "markv_model_factory.h" + +#include "markv_model_shader.h" + +namespace spvtools { + +std::unique_ptr CreateMarkvModel(MarkvModelType type) { + std::unique_ptr model; + switch (type) { + case kMarkvModelShaderLite: { + model.reset(new MarkvModelShaderLite()); + break; + } + case kMarkvModelShaderMid: { + model.reset(new MarkvModelShaderMid()); + break; + } + case kMarkvModelShaderMax: { + model.reset(new MarkvModelShaderMax()); + break; + } + case kMarkvModelUnknown: { + assert(0 && "kMarkvModelUnknown supplied to CreateMarkvModel"); + return model; + } + } + + model->SetModelType(static_cast(type)); + + return model; +} + +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/comp/markv_model_factory.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/comp/markv_model_factory.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/comp/markv_model_factory.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/comp/markv_model_factory.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,35 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SPIRV_TOOLS_COMP_MARKV_MODEL_FACTORY_H_ +#define SPIRV_TOOLS_COMP_MARKV_MODEL_FACTORY_H_ + +#include + +#include "source/comp/markv_model.h" + +namespace spvtools { + +enum MarkvModelType { + kMarkvModelUnknown = 0, + kMarkvModelShaderLite, + kMarkvModelShaderMid, + kMarkvModelShaderMax, +}; + +std::unique_ptr CreateMarkvModel(MarkvModelType type); + +} // namespace spvtools + +#endif // SPIRV_TOOLS_COMP_MARKV_MODEL_FACTORY_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/comp/markv_model_shader.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/comp/markv_model_shader.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/comp/markv_model_shader.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/comp/markv_model_shader.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,100 @@ +// Copyright (c) 2017 Google 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. + +#include "markv_model_shader.h" + +#include +#include +#include +#include +#include +#include + +using spvutils::HuffmanCodec; + +namespace spvtools { + +namespace { + +// Signals that the value is not in the coding scheme and a fallback method +// needs to be used. +const uint64_t kMarkvNoneOfTheAbove = MarkvModel::GetMarkvNoneOfTheAbove(); + +inline uint32_t CombineOpcodeAndNumOperands(uint32_t opcode, + uint32_t num_operands) { + return opcode | (num_operands << 16); +} + +// The following file contains autogenerated statistical coding rules. +// Can be generated by running spirv-stats on representative corpus of shaders +// with flags: +// --codegen_opcode_and_num_operands_hist +// --codegen_opcode_and_num_operands_markov_huffman_codecs +// --codegen_literal_string_huffman_codecs +// --codegen_non_id_word_huffman_codecs +// --codegen_id_descriptor_huffman_codecs +// +// Example: +// find -type f -print0 | xargs -0 -s 2000000 +// ~/SPIRV-Tools/build/tools/spirv-stats -v +// --codegen_opcode_and_num_operands_hist +// --codegen_opcode_and_num_operands_markov_huffman_codecs +// --codegen_literal_string_huffman_codecs --codegen_non_id_word_huffman_codecs +// --codegen_id_descriptor_huffman_codecs -o +// ~/SPIRV-Tools/source/comp/markv_autogen.inc +#include "markv_model_shader_default_autogen.inc" + +} // namespace + +MarkvModelShaderLite::MarkvModelShaderLite() { + const uint16_t kVersionNumber = 1; + SetModelVersion(kVersionNumber); + + opcode_and_num_operands_huffman_codec_.reset( + new HuffmanCodec(GetOpcodeAndNumOperandsHist())); + + id_fallback_strategy_ = IdFallbackStrategy::kShortDescriptor; +} + +MarkvModelShaderMid::MarkvModelShaderMid() { + const uint16_t kVersionNumber = 1; + SetModelVersion(kVersionNumber); + + opcode_and_num_operands_huffman_codec_.reset( + new HuffmanCodec(GetOpcodeAndNumOperandsHist())); + non_id_word_huffman_codecs_ = GetNonIdWordHuffmanCodecs(); + id_descriptor_huffman_codecs_ = GetIdDescriptorHuffmanCodecs(); + descriptors_with_coding_scheme_ = GetDescriptorsWithCodingScheme(); + literal_string_huffman_codecs_ = GetLiteralStringHuffmanCodecs(); + + id_fallback_strategy_ = IdFallbackStrategy::kShortDescriptor; +} + +MarkvModelShaderMax::MarkvModelShaderMax() { + const uint16_t kVersionNumber = 1; + SetModelVersion(kVersionNumber); + + opcode_and_num_operands_huffman_codec_.reset( + new HuffmanCodec(GetOpcodeAndNumOperandsHist())); + opcode_and_num_operands_markov_huffman_codecs_ = + GetOpcodeAndNumOperandsMarkovHuffmanCodecs(); + non_id_word_huffman_codecs_ = GetNonIdWordHuffmanCodecs(); + id_descriptor_huffman_codecs_ = GetIdDescriptorHuffmanCodecs(); + descriptors_with_coding_scheme_ = GetDescriptorsWithCodingScheme(); + literal_string_huffman_codecs_ = GetLiteralStringHuffmanCodecs(); + + id_fallback_strategy_ = IdFallbackStrategy::kRuleBased; +} + +} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/comp/markv_model_shader_default_autogen.inc vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/comp/markv_model_shader_default_autogen.inc --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/comp/markv_model_shader_default_autogen.inc 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/comp/markv_model_shader_default_autogen.inc 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,14519 @@ + +std::map GetOpcodeAndNumOperandsHist() { + return std::map({ + { CombineOpcodeAndNumOperands(SpvOpExtInst, 7), 158282 }, + { CombineOpcodeAndNumOperands(SpvOpDot, 4), 151035 }, + { CombineOpcodeAndNumOperands(SpvOpVectorShuffle, 6), 183292 }, + { CombineOpcodeAndNumOperands(SpvOpImageSampleImplicitLod, 4), 126492 }, + { CombineOpcodeAndNumOperands(SpvOpExecutionMode, 2), 13311 }, + { CombineOpcodeAndNumOperands(SpvOpFNegate, 3), 29952 }, + { CombineOpcodeAndNumOperands(SpvOpExtInst, 5), 106847 }, + { CombineOpcodeAndNumOperands(SpvOpImageSampleExplicitLod, 7), 26350 }, + { CombineOpcodeAndNumOperands(SpvOpImageSampleExplicitLod, 6), 28186 }, + { CombineOpcodeAndNumOperands(SpvOpFDiv, 4), 41635 }, + { CombineOpcodeAndNumOperands(SpvOpFMul, 4), 412786 }, + { CombineOpcodeAndNumOperands(SpvOpFunction, 4), 62905 }, + { CombineOpcodeAndNumOperands(SpvOpVectorShuffle, 8), 118614 }, + { CombineOpcodeAndNumOperands(SpvOpDecorate, 2), 100735 }, + { CombineOpcodeAndNumOperands(SpvOpReturnValue, 1), 40852 }, + { CombineOpcodeAndNumOperands(SpvOpVectorTimesScalar, 4), 157091 }, + { CombineOpcodeAndNumOperands(SpvOpExtInst, 6), 122100 }, + { CombineOpcodeAndNumOperands(SpvOpAccessChain, 5), 82930 }, + { CombineOpcodeAndNumOperands(SpvOpFSub, 4), 161019 }, + { CombineOpcodeAndNumOperands(SpvOpConstant, 3), 466014 }, + { CombineOpcodeAndNumOperands(SpvOpCompositeExtract, 5), 107126 }, + { CombineOpcodeAndNumOperands(SpvOpTypeImage, 8), 34775 }, + { CombineOpcodeAndNumOperands(SpvOpImageSampleDrefExplicitLod, 7), 26146 }, + { CombineOpcodeAndNumOperands(SpvOpMemoryModel, 2), 18879 }, + { CombineOpcodeAndNumOperands(SpvOpDecorate, 3), 485251 }, + { CombineOpcodeAndNumOperands(SpvOpCompositeConstruct, 4), 78011 }, + { CombineOpcodeAndNumOperands(SpvOpTypeFloat, 2), 18879 }, + { CombineOpcodeAndNumOperands(SpvOpVectorTimesMatrix, 4), 15848 }, + { CombineOpcodeAndNumOperands(SpvOpTypeVector, 3), 69404 }, + { CombineOpcodeAndNumOperands(SpvOpTypeFunction, 3), 19998 }, + { CombineOpcodeAndNumOperands(SpvOpConstantComposite, 6), 40228 }, + { CombineOpcodeAndNumOperands(SpvOpCapability, 1), 22510 }, + { CombineOpcodeAndNumOperands(SpvOpTypeArray, 3), 37585 }, + { CombineOpcodeAndNumOperands(SpvOpTypeInt, 3), 30454 }, + { CombineOpcodeAndNumOperands(SpvOpFunctionCall, 4), 29021 }, + { CombineOpcodeAndNumOperands(SpvOpFAdd, 4), 342237 }, + { CombineOpcodeAndNumOperands(SpvOpTypeMatrix, 3), 24449 }, + { CombineOpcodeAndNumOperands(SpvOpLabel, 1), 129408 }, + { CombineOpcodeAndNumOperands(SpvOpTypePointer, 3), 246535 }, + { CombineOpcodeAndNumOperands(SpvOpAccessChain, 4), 503456 }, + { CombineOpcodeAndNumOperands(SpvOpTypeFunction, 2), 19779 }, + { CombineOpcodeAndNumOperands(SpvOpBranchConditional, 3), 24139 }, + { CombineOpcodeAndNumOperands(SpvOpVariable, 3), 697946 }, + { CombineOpcodeAndNumOperands(SpvOpConstantComposite, 5), 55769 }, + { CombineOpcodeAndNumOperands(SpvOpTypeVoid, 1), 18879 }, + { CombineOpcodeAndNumOperands(SpvOpCompositeConstruct, 6), 145508 }, + { CombineOpcodeAndNumOperands(SpvOpFunctionParameter, 2), 85583 }, + { CombineOpcodeAndNumOperands(SpvOpTypeSampledImage, 2), 34775 }, + { CombineOpcodeAndNumOperands(SpvOpConstantComposite, 4), 66362 }, + { CombineOpcodeAndNumOperands(SpvOpLoad, 3), 1272902 }, + { CombineOpcodeAndNumOperands(SpvOpReturn, 0), 22122 }, + { CombineOpcodeAndNumOperands(SpvOpCompositeExtract, 4), 861008 }, + { CombineOpcodeAndNumOperands(SpvOpFunctionEnd, 0), 62905 }, + { CombineOpcodeAndNumOperands(SpvOpExtInstImport, 2), 18879 }, + { CombineOpcodeAndNumOperands(SpvOpSelectionMerge, 2), 22009 }, + { CombineOpcodeAndNumOperands(SpvOpBranch, 1), 38275 }, + { CombineOpcodeAndNumOperands(SpvOpTypeBool, 1), 12208 }, + { CombineOpcodeAndNumOperands(SpvOpSampledImage, 4), 95518 }, + { CombineOpcodeAndNumOperands(SpvOpMemberDecorate, 3), 94887 }, + { CombineOpcodeAndNumOperands(SpvOpMemberDecorate, 4), 1942215 }, + { CombineOpcodeAndNumOperands(SpvOpCompositeConstruct, 5), 205266 }, + { CombineOpcodeAndNumOperands(SpvOpUndef, 2), 22157 }, + { CombineOpcodeAndNumOperands(SpvOpCompositeInsert, 5), 142749 }, + { CombineOpcodeAndNumOperands(SpvOpCompositeInsert, 6), 24420 }, + { CombineOpcodeAndNumOperands(SpvOpCompositeExtract, 6), 16896 }, + { CombineOpcodeAndNumOperands(SpvOpStore, 2), 604982 }, + { CombineOpcodeAndNumOperands(SpvOpIAdd, 4), 14471 }, + { CombineOpcodeAndNumOperands(SpvOpVectorShuffle, 7), 269658 }, + { kMarkvNoneOfTheAbove, 399895 }, + }); +} + +std::map>> +GetOpcodeAndNumOperandsMarkovHuffmanCodecs() { + std::map>> codecs; + { + std::unique_ptr> codec(new HuffmanCodec(35, { + {0, 0, 0}, + {65790, 0, 0}, + {131134, 0, 0}, + {196669, 0, 0}, + {262209, 0, 0}, + {262221, 0, 0}, + {262225, 0, 0}, + {262230, 0, 0}, + {262273, 0, 0}, + {262277, 0, 0}, + {262286, 0, 0}, + {327745, 0, 0}, + {327761, 0, 0}, + {327762, 0, 0}, + {393295, 0, 0}, + {393304, 0, 0}, + {458831, 0, 0}, + {458840, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 11, 8}, + {0, 12, 19}, + {0, 18, 20}, + {0, 5, 21}, + {0, 15, 7}, + {0, 10, 1}, + {0, 23, 22}, + {0, 14, 24}, + {0, 6, 4}, + {0, 2, 17}, + {0, 13, 25}, + {0, 9, 26}, + {0, 28, 27}, + {0, 3, 29}, + {0, 30, 16}, + {0, 32, 31}, + {0, 34, 33}, + })); + + codecs.emplace(SpvOpImageSampleExplicitLod, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(55, { + {0, 0, 0}, + {65785, 0, 0}, + {65790, 0, 0}, + {131134, 0, 0}, + {196669, 0, 0}, + {196735, 0, 0}, + {262201, 0, 0}, + {262209, 0, 0}, + {262224, 0, 0}, + {262225, 0, 0}, + {262231, 0, 0}, + {262273, 0, 0}, + {262275, 0, 0}, + {262277, 0, 0}, + {262280, 0, 0}, + {262286, 0, 0}, + {327692, 0, 0}, + {327745, 0, 0}, + {327760, 0, 0}, + {327762, 0, 0}, + {393228, 0, 0}, + {393295, 0, 0}, + {393296, 0, 0}, + {393303, 0, 0}, + {393304, 0, 0}, + {458764, 0, 0}, + {458831, 0, 0}, + {524367, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 14, 5}, + {0, 29, 17}, + {0, 1, 30}, + {0, 10, 20}, + {0, 32, 31}, + {0, 33, 2}, + {0, 34, 23}, + {0, 8, 35}, + {0, 6, 36}, + {0, 19, 22}, + {0, 28, 25}, + {0, 38, 37}, + {0, 13, 39}, + {0, 40, 24}, + {0, 27, 21}, + {0, 26, 41}, + {0, 42, 12}, + {0, 15, 43}, + {0, 44, 18}, + {0, 45, 3}, + {0, 11, 7}, + {0, 16, 46}, + {0, 47, 9}, + {0, 4, 48}, + {0, 50, 49}, + {0, 52, 51}, + {0, 54, 53}, + })); + + codecs.emplace(SpvOpFDiv, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(19, { + {0, 0, 0}, + {196669, 0, 0}, + {262209, 0, 0}, + {262224, 0, 0}, + {262225, 0, 0}, + {262231, 0, 0}, + {262286, 0, 0}, + {393295, 0, 0}, + {393304, 0, 0}, + {458840, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 8, 10}, + {0, 11, 3}, + {0, 2, 9}, + {0, 4, 1}, + {0, 5, 6}, + {0, 13, 12}, + {0, 15, 14}, + {0, 16, 7}, + {0, 18, 17}, + })); + + codecs.emplace(SpvOpSampledImage, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(67, { + {0, 0, 0}, + {65785, 0, 0}, + {65790, 0, 0}, + {131134, 0, 0}, + {131319, 0, 0}, + {196669, 0, 0}, + {196735, 0, 0}, + {262209, 0, 0}, + {262224, 0, 0}, + {262225, 0, 0}, + {262231, 0, 0}, + {262272, 0, 0}, + {262273, 0, 0}, + {262275, 0, 0}, + {262277, 0, 0}, + {262280, 0, 0}, + {262285, 0, 0}, + {262286, 0, 0}, + {262292, 0, 0}, + {327692, 0, 0}, + {327745, 0, 0}, + {327760, 0, 0}, + {327761, 0, 0}, + {327762, 0, 0}, + {393228, 0, 0}, + {393281, 0, 0}, + {393295, 0, 0}, + {393296, 0, 0}, + {393297, 0, 0}, + {393298, 0, 0}, + {393304, 0, 0}, + {458764, 0, 0}, + {458831, 0, 0}, + {524367, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 10}, + {0, 30, 35}, + {0, 1, 36}, + {0, 11, 37}, + {0, 38, 6}, + {0, 16, 39}, + {0, 15, 40}, + {0, 25, 2}, + {0, 41, 20}, + {0, 26, 19}, + {0, 42, 29}, + {0, 28, 22}, + {0, 23, 34}, + {0, 44, 43}, + {0, 17, 45}, + {0, 24, 27}, + {0, 18, 33}, + {0, 47, 46}, + {0, 8, 48}, + {0, 50, 49}, + {0, 32, 51}, + {0, 31, 52}, + {0, 53, 21}, + {0, 54, 13}, + {0, 3, 55}, + {0, 7, 14}, + {0, 57, 56}, + {0, 58, 5}, + {0, 59, 9}, + {0, 61, 60}, + {0, 63, 62}, + {0, 64, 12}, + {0, 66, 65}, + })); + + codecs.emplace(SpvOpFMul, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(79, { + {0, 0, 0}, + {65785, 0, 0}, + {65790, 0, 0}, + {131134, 0, 0}, + {196669, 0, 0}, + {196735, 0, 0}, + {262201, 0, 0}, + {262209, 0, 0}, + {262224, 0, 0}, + {262225, 0, 0}, + {262230, 0, 0}, + {262231, 0, 0}, + {262272, 0, 0}, + {262273, 0, 0}, + {262275, 0, 0}, + {262277, 0, 0}, + {262280, 0, 0}, + {262286, 0, 0}, + {262288, 0, 0}, + {262292, 0, 0}, + {262328, 0, 0}, + {262334, 0, 0}, + {327692, 0, 0}, + {327737, 0, 0}, + {327745, 0, 0}, + {327760, 0, 0}, + {327761, 0, 0}, + {327762, 0, 0}, + {393228, 0, 0}, + {393281, 0, 0}, + {393295, 0, 0}, + {393296, 0, 0}, + {393297, 0, 0}, + {393303, 0, 0}, + {393304, 0, 0}, + {458764, 0, 0}, + {458831, 0, 0}, + {458840, 0, 0}, + {524345, 0, 0}, + {524367, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 38, 33}, + {0, 18, 41}, + {0, 42, 23}, + {0, 43, 6}, + {0, 34, 44}, + {0, 1, 45}, + {0, 31, 14}, + {0, 47, 46}, + {0, 48, 2}, + {0, 12, 21}, + {0, 49, 30}, + {0, 37, 50}, + {0, 51, 20}, + {0, 5, 24}, + {0, 40, 16}, + {0, 29, 13}, + {0, 26, 52}, + {0, 53, 17}, + {0, 36, 54}, + {0, 55, 28}, + {0, 57, 56}, + {0, 19, 25}, + {0, 39, 8}, + {0, 32, 58}, + {0, 59, 27}, + {0, 22, 10}, + {0, 35, 60}, + {0, 62, 61}, + {0, 63, 7}, + {0, 65, 64}, + {0, 4, 66}, + {0, 68, 67}, + {0, 11, 3}, + {0, 15, 69}, + {0, 9, 70}, + {0, 72, 71}, + {0, 74, 73}, + {0, 76, 75}, + {0, 78, 77}, + })); + + codecs.emplace(SpvOpFAdd, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(55, { + {0, 0, 0}, + {65556, 0, 0}, + {65562, 0, 0}, + {131073, 0, 0}, + {131094, 0, 0}, + {131105, 0, 0}, + {196629, 0, 0}, + {196631, 0, 0}, + {196632, 0, 0}, + {196636, 0, 0}, + {196640, 0, 0}, + {196641, 0, 0}, + {196651, 0, 0}, + {196667, 0, 0}, + {262177, 0, 0}, + {262188, 0, 0}, + {262198, 0, 0}, + {327713, 0, 0}, + {327724, 0, 0}, + {393249, 0, 0}, + {393260, 0, 0}, + {458785, 0, 0}, + {524313, 0, 0}, + {524321, 0, 0}, + {589857, 0, 0}, + {655393, 0, 0}, + {720929, 0, 0}, + {852001, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 26, 24}, + {0, 29, 27}, + {0, 4, 30}, + {0, 21, 9}, + {0, 31, 20}, + {0, 33, 32}, + {0, 34, 3}, + {0, 8, 35}, + {0, 36, 5}, + {0, 23, 16}, + {0, 38, 37}, + {0, 25, 2}, + {0, 39, 1}, + {0, 17, 40}, + {0, 41, 15}, + {0, 18, 42}, + {0, 43, 6}, + {0, 44, 14}, + {0, 28, 19}, + {0, 7, 45}, + {0, 46, 22}, + {0, 48, 47}, + {0, 49, 11}, + {0, 51, 50}, + {0, 12, 10}, + {0, 53, 52}, + {0, 13, 54}, + })); + + codecs.emplace(SpvOpTypePointer, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(57, { + {0, 0, 0}, + {65785, 0, 0}, + {65790, 0, 0}, + {131134, 0, 0}, + {196669, 0, 0}, + {196735, 0, 0}, + {262209, 0, 0}, + {262224, 0, 0}, + {262225, 0, 0}, + {262272, 0, 0}, + {262273, 0, 0}, + {262275, 0, 0}, + {262277, 0, 0}, + {262280, 0, 0}, + {262286, 0, 0}, + {262292, 0, 0}, + {262328, 0, 0}, + {327692, 0, 0}, + {327745, 0, 0}, + {327760, 0, 0}, + {327761, 0, 0}, + {327762, 0, 0}, + {393228, 0, 0}, + {393273, 0, 0}, + {393295, 0, 0}, + {393296, 0, 0}, + {458764, 0, 0}, + {458831, 0, 0}, + {524367, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 9, 23}, + {0, 1, 30}, + {0, 5, 31}, + {0, 32, 28}, + {0, 33, 25}, + {0, 34, 29}, + {0, 18, 24}, + {0, 27, 16}, + {0, 7, 13}, + {0, 14, 35}, + {0, 20, 10}, + {0, 36, 21}, + {0, 2, 37}, + {0, 38, 3}, + {0, 39, 22}, + {0, 40, 19}, + {0, 41, 11}, + {0, 6, 4}, + {0, 12, 42}, + {0, 43, 8}, + {0, 15, 26}, + {0, 45, 44}, + {0, 47, 46}, + {0, 48, 17}, + {0, 50, 49}, + {0, 52, 51}, + {0, 54, 53}, + {0, 56, 55}, + })); + + codecs.emplace(SpvOpFSub, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(13, { + {0, 0, 0}, + {65785, 0, 0}, + {131134, 0, 0}, + {196719, 0, 0}, + {262209, 0, 0}, + {262276, 0, 0}, + {327745, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 7, 4}, + {0, 2, 8}, + {0, 1, 9}, + {0, 5, 10}, + {0, 3, 6}, + {0, 12, 11}, + })); + + codecs.emplace(SpvOpIAdd, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(83, { + {0, 0, 0}, + {65785, 0, 0}, + {65790, 0, 0}, + {131134, 0, 0}, + {131319, 0, 0}, + {196669, 0, 0}, + {196732, 0, 0}, + {196735, 0, 0}, + {262209, 0, 0}, + {262221, 0, 0}, + {262224, 0, 0}, + {262225, 0, 0}, + {262230, 0, 0}, + {262231, 0, 0}, + {262273, 0, 0}, + {262275, 0, 0}, + {262277, 0, 0}, + {262280, 0, 0}, + {262286, 0, 0}, + {262288, 0, 0}, + {262292, 0, 0}, + {262328, 0, 0}, + {262334, 0, 0}, + {262340, 0, 0}, + {327692, 0, 0}, + {327737, 0, 0}, + {327745, 0, 0}, + {327760, 0, 0}, + {327761, 0, 0}, + {327762, 0, 0}, + {393228, 0, 0}, + {393273, 0, 0}, + {393295, 0, 0}, + {393296, 0, 0}, + {393297, 0, 0}, + {393298, 0, 0}, + {393304, 0, 0}, + {458764, 0, 0}, + {458831, 0, 0}, + {458840, 0, 0}, + {458842, 0, 0}, + {524367, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 25, 2}, + {0, 31, 43}, + {0, 4, 44}, + {0, 26, 45}, + {0, 39, 46}, + {0, 34, 36}, + {0, 19, 47}, + {0, 6, 48}, + {0, 35, 9}, + {0, 12, 29}, + {0, 21, 49}, + {0, 22, 13}, + {0, 17, 50}, + {0, 23, 51}, + {0, 52, 7}, + {0, 37, 1}, + {0, 53, 3}, + {0, 54, 24}, + {0, 56, 55}, + {0, 32, 57}, + {0, 59, 58}, + {0, 42, 10}, + {0, 60, 8}, + {0, 5, 41}, + {0, 61, 20}, + {0, 62, 38}, + {0, 64, 63}, + {0, 40, 65}, + {0, 66, 18}, + {0, 15, 28}, + {0, 14, 67}, + {0, 68, 30}, + {0, 70, 69}, + {0, 72, 71}, + {0, 73, 27}, + {0, 16, 74}, + {0, 75, 33}, + {0, 77, 76}, + {0, 79, 78}, + {0, 81, 80}, + {0, 82, 11}, + })); + + codecs.emplace(SpvOpCompositeExtract, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(29, { + {0, 0, 0}, + {65790, 0, 0}, + {131134, 0, 0}, + {196669, 0, 0}, + {262209, 0, 0}, + {262225, 0, 0}, + {262273, 0, 0}, + {262288, 0, 0}, + {262292, 0, 0}, + {327692, 0, 0}, + {327761, 0, 0}, + {327762, 0, 0}, + {393295, 0, 0}, + {458831, 0, 0}, + {524367, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 10, 6}, + {0, 16, 13}, + {0, 7, 17}, + {0, 15, 18}, + {0, 19, 12}, + {0, 20, 14}, + {0, 1, 4}, + {0, 22, 21}, + {0, 11, 8}, + {0, 2, 5}, + {0, 9, 23}, + {0, 3, 24}, + {0, 26, 25}, + {0, 28, 27}, + })); + + codecs.emplace(SpvOpVectorTimesMatrix, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {65784, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(SpvOpBranch, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {262198, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(SpvOpFunctionEnd, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {65784, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(SpvOpBranchConditional, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(53, { + {0, 0, 0}, + {65785, 0, 0}, + {65790, 0, 0}, + {131134, 0, 0}, + {131319, 0, 0}, + {196665, 0, 0}, + {196669, 0, 0}, + {196735, 0, 0}, + {262201, 0, 0}, + {262209, 0, 0}, + {262224, 0, 0}, + {262225, 0, 0}, + {262231, 0, 0}, + {262273, 0, 0}, + {262275, 0, 0}, + {262277, 0, 0}, + {262280, 0, 0}, + {262286, 0, 0}, + {262288, 0, 0}, + {262292, 0, 0}, + {327692, 0, 0}, + {327745, 0, 0}, + {327760, 0, 0}, + {393228, 0, 0}, + {393295, 0, 0}, + {458764, 0, 0}, + {458831, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 25, 16}, + {0, 21, 28}, + {0, 18, 23}, + {0, 4, 29}, + {0, 10, 5}, + {0, 1, 30}, + {0, 32, 31}, + {0, 22, 33}, + {0, 34, 8}, + {0, 35, 15}, + {0, 13, 36}, + {0, 26, 17}, + {0, 38, 37}, + {0, 39, 11}, + {0, 40, 14}, + {0, 12, 27}, + {0, 19, 41}, + {0, 24, 42}, + {0, 44, 43}, + {0, 45, 7}, + {0, 20, 46}, + {0, 9, 47}, + {0, 48, 2}, + {0, 50, 49}, + {0, 6, 3}, + {0, 52, 51}, + })); + + codecs.emplace(SpvOpFunctionCall, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(71, { + {0, 0, 0}, + {65556, 0, 0}, + {65562, 0, 0}, + {131073, 0, 0}, + {131094, 0, 0}, + {131099, 0, 0}, + {131134, 0, 0}, + {196629, 0, 0}, + {196631, 0, 0}, + {196632, 0, 0}, + {196636, 0, 0}, + {196640, 0, 0}, + {196651, 0, 0}, + {196665, 0, 0}, + {196667, 0, 0}, + {196669, 0, 0}, + {262188, 0, 0}, + {262198, 0, 0}, + {262201, 0, 0}, + {262209, 0, 0}, + {262225, 0, 0}, + {262275, 0, 0}, + {262280, 0, 0}, + {262292, 0, 0}, + {327692, 0, 0}, + {327724, 0, 0}, + {327737, 0, 0}, + {327745, 0, 0}, + {393228, 0, 0}, + {393260, 0, 0}, + {393273, 0, 0}, + {393295, 0, 0}, + {393296, 0, 0}, + {458831, 0, 0}, + {524313, 0, 0}, + {524367, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 22, 4}, + {0, 32, 23}, + {0, 37, 30}, + {0, 21, 38}, + {0, 39, 31}, + {0, 41, 40}, + {0, 13, 42}, + {0, 43, 26}, + {0, 10, 44}, + {0, 28, 45}, + {0, 35, 18}, + {0, 20, 46}, + {0, 33, 47}, + {0, 24, 48}, + {0, 6, 49}, + {0, 3, 50}, + {0, 16, 51}, + {0, 27, 52}, + {0, 53, 1}, + {0, 9, 17}, + {0, 29, 54}, + {0, 19, 2}, + {0, 8, 36}, + {0, 55, 34}, + {0, 25, 56}, + {0, 7, 57}, + {0, 5, 58}, + {0, 60, 59}, + {0, 61, 15}, + {0, 63, 62}, + {0, 65, 64}, + {0, 66, 11}, + {0, 12, 67}, + {0, 69, 68}, + {0, 14, 70}, + })); + + codecs.emplace(SpvOpVariable, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {131134, 0, 0}, + {196669, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 3}, + {0, 2, 4}, + })); + + codecs.emplace(SpvOpAccessChain, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(73, { + {0, 0, 0}, + {252, 0, 0}, + {253, 0, 0}, + {65785, 0, 0}, + {65790, 0, 0}, + {131073, 0, 0}, + {131134, 0, 0}, + {131319, 0, 0}, + {196665, 0, 0}, + {196667, 0, 0}, + {196669, 0, 0}, + {196735, 0, 0}, + {196854, 0, 0}, + {262201, 0, 0}, + {262209, 0, 0}, + {262221, 0, 0}, + {262225, 0, 0}, + {262272, 0, 0}, + {262273, 0, 0}, + {262275, 0, 0}, + {262276, 0, 0}, + {262277, 0, 0}, + {262280, 0, 0}, + {262286, 0, 0}, + {262292, 0, 0}, + {262321, 0, 0}, + {327692, 0, 0}, + {327745, 0, 0}, + {327761, 0, 0}, + {327762, 0, 0}, + {393228, 0, 0}, + {393295, 0, 0}, + {393296, 0, 0}, + {393298, 0, 0}, + {393461, 0, 0}, + {458831, 0, 0}, + {524367, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 28, 5}, + {0, 30, 8}, + {0, 13, 38}, + {0, 40, 39}, + {0, 41, 26}, + {0, 42, 19}, + {0, 43, 29}, + {0, 23, 44}, + {0, 36, 32}, + {0, 45, 22}, + {0, 2, 46}, + {0, 21, 20}, + {0, 48, 47}, + {0, 33, 49}, + {0, 4, 50}, + {0, 51, 24}, + {0, 18, 11}, + {0, 52, 12}, + {0, 25, 15}, + {0, 53, 17}, + {0, 37, 54}, + {0, 55, 35}, + {0, 7, 27}, + {0, 57, 56}, + {0, 58, 31}, + {0, 6, 59}, + {0, 1, 60}, + {0, 62, 61}, + {0, 63, 14}, + {0, 3, 16}, + {0, 34, 64}, + {0, 66, 65}, + {0, 68, 67}, + {0, 70, 69}, + {0, 10, 9}, + {0, 72, 71}, + })); + + codecs.emplace(SpvOpLabel, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {56, 0, 0}, + {65784, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 2}, + {0, 1, 4}, + })); + + codecs.emplace(SpvOpReturn, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {65784, 0, 0}, + {131127, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 3}, + {0, 2, 4}, + })); + + codecs.emplace(SpvOpFunction, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(31, { + {0, 0, 0}, + {65556, 0, 0}, + {196629, 0, 0}, + {196631, 0, 0}, + {196632, 0, 0}, + {196636, 0, 0}, + {196640, 0, 0}, + {196641, 0, 0}, + {196651, 0, 0}, + {196667, 0, 0}, + {262177, 0, 0}, + {262188, 0, 0}, + {262198, 0, 0}, + {327713, 0, 0}, + {393260, 0, 0}, + {524313, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 12, 1}, + {0, 13, 5}, + {0, 18, 17}, + {0, 7, 19}, + {0, 9, 20}, + {0, 16, 21}, + {0, 15, 10}, + {0, 22, 4}, + {0, 24, 23}, + {0, 25, 14}, + {0, 8, 11}, + {0, 2, 26}, + {0, 28, 27}, + {0, 3, 6}, + {0, 30, 29}, + })); + + codecs.emplace(SpvOpTypeVector, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {65784, 0, 0}, + {131127, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 3}, + {0, 4, 1}, + })); + + codecs.emplace(SpvOpFunctionParameter, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {56, 0, 0}, + {65784, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 2}, + {0, 1, 4}, + })); + + codecs.emplace(SpvOpReturnValue, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {131105, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(SpvOpTypeVoid, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(89, { + {0, 0, 0}, + {253, 0, 0}, + {65785, 0, 0}, + {65790, 0, 0}, + {131134, 0, 0}, + {131319, 0, 0}, + {196665, 0, 0}, + {196669, 0, 0}, + {196735, 0, 0}, + {262201, 0, 0}, + {262209, 0, 0}, + {262224, 0, 0}, + {262225, 0, 0}, + {262272, 0, 0}, + {262273, 0, 0}, + {262275, 0, 0}, + {262277, 0, 0}, + {262280, 0, 0}, + {262286, 0, 0}, + {262288, 0, 0}, + {262292, 0, 0}, + {327692, 0, 0}, + {327737, 0, 0}, + {327745, 0, 0}, + {327760, 0, 0}, + {327761, 0, 0}, + {327762, 0, 0}, + {393228, 0, 0}, + {393273, 0, 0}, + {393281, 0, 0}, + {393295, 0, 0}, + {393296, 0, 0}, + {458764, 0, 0}, + {458809, 0, 0}, + {458831, 0, 0}, + {524345, 0, 0}, + {524367, 0, 0}, + {589881, 0, 0}, + {655417, 0, 0}, + {720953, 0, 0}, + {786489, 0, 0}, + {852025, 0, 0}, + {917561, 0, 0}, + {983097, 0, 0}, + {1114169, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 40, 32}, + {0, 46, 29}, + {0, 38, 27}, + {0, 20, 47}, + {0, 49, 48}, + {0, 50, 44}, + {0, 51, 43}, + {0, 14, 5}, + {0, 42, 52}, + {0, 13, 19}, + {0, 3, 26}, + {0, 54, 53}, + {0, 56, 55}, + {0, 57, 6}, + {0, 39, 37}, + {0, 15, 58}, + {0, 18, 31}, + {0, 59, 21}, + {0, 60, 17}, + {0, 61, 41}, + {0, 62, 24}, + {0, 34, 63}, + {0, 35, 64}, + {0, 65, 8}, + {0, 66, 36}, + {0, 67, 30}, + {0, 16, 11}, + {0, 69, 68}, + {0, 70, 28}, + {0, 22, 71}, + {0, 33, 72}, + {0, 45, 73}, + {0, 75, 74}, + {0, 77, 76}, + {0, 78, 12}, + {0, 1, 2}, + {0, 9, 79}, + {0, 25, 80}, + {0, 23, 81}, + {0, 4, 82}, + {0, 84, 83}, + {0, 86, 85}, + {0, 7, 10}, + {0, 88, 87}, + })); + + codecs.emplace(SpvOpStore, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(13, { + {0, 0, 0}, + {131075, 0, 0}, + {131088, 0, 0}, + {131143, 0, 0}, + {196624, 0, 0}, + {196679, 0, 0}, + {262216, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 4}, + {0, 1, 8}, + {0, 7, 9}, + {0, 6, 10}, + {0, 5, 11}, + {0, 2, 12}, + })); + + codecs.emplace(SpvOpEntryPoint, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(97, { + {0, 0, 0}, + {65785, 0, 0}, + {65790, 0, 0}, + {131134, 0, 0}, + {131319, 0, 0}, + {196665, 0, 0}, + {196669, 0, 0}, + {196732, 0, 0}, + {196735, 0, 0}, + {262201, 0, 0}, + {262209, 0, 0}, + {262224, 0, 0}, + {262225, 0, 0}, + {262230, 0, 0}, + {262231, 0, 0}, + {262272, 0, 0}, + {262273, 0, 0}, + {262275, 0, 0}, + {262276, 0, 0}, + {262277, 0, 0}, + {262280, 0, 0}, + {262286, 0, 0}, + {262288, 0, 0}, + {262292, 0, 0}, + {262326, 0, 0}, + {262328, 0, 0}, + {262330, 0, 0}, + {327692, 0, 0}, + {327737, 0, 0}, + {327745, 0, 0}, + {327760, 0, 0}, + {327761, 0, 0}, + {327762, 0, 0}, + {393228, 0, 0}, + {393273, 0, 0}, + {393281, 0, 0}, + {393295, 0, 0}, + {393296, 0, 0}, + {393297, 0, 0}, + {393304, 0, 0}, + {458764, 0, 0}, + {458809, 0, 0}, + {458817, 0, 0}, + {458831, 0, 0}, + {458840, 0, 0}, + {524345, 0, 0}, + {524367, 0, 0}, + {589881, 0, 0}, + {720953, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 42, 47}, + {0, 48, 50}, + {0, 45, 51}, + {0, 34, 52}, + {0, 53, 41}, + {0, 1, 54}, + {0, 55, 5}, + {0, 15, 4}, + {0, 56, 35}, + {0, 26, 24}, + {0, 18, 28}, + {0, 57, 38}, + {0, 59, 58}, + {0, 60, 25}, + {0, 20, 9}, + {0, 7, 61}, + {0, 62, 22}, + {0, 11, 31}, + {0, 63, 8}, + {0, 64, 40}, + {0, 66, 65}, + {0, 27, 44}, + {0, 29, 67}, + {0, 68, 39}, + {0, 69, 2}, + {0, 37, 49}, + {0, 71, 70}, + {0, 30, 72}, + {0, 73, 17}, + {0, 33, 74}, + {0, 23, 14}, + {0, 32, 75}, + {0, 21, 76}, + {0, 77, 16}, + {0, 46, 78}, + {0, 13, 79}, + {0, 80, 12}, + {0, 19, 81}, + {0, 43, 36}, + {0, 83, 82}, + {0, 10, 84}, + {0, 85, 3}, + {0, 6, 86}, + {0, 88, 87}, + {0, 90, 89}, + {0, 92, 91}, + {0, 94, 93}, + {0, 96, 95}, + })); + + codecs.emplace(SpvOpLoad, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(47, { + {0, 0, 0}, + {262159, 0, 0}, + {327695, 0, 0}, + {393231, 0, 0}, + {458767, 0, 0}, + {524303, 0, 0}, + {589839, 0, 0}, + {655375, 0, 0}, + {720911, 0, 0}, + {786447, 0, 0}, + {851983, 0, 0}, + {917519, 0, 0}, + {983055, 0, 0}, + {1048591, 0, 0}, + {1114127, 0, 0}, + {1179663, 0, 0}, + {1245199, 0, 0}, + {1310735, 0, 0}, + {1376271, 0, 0}, + {1441807, 0, 0}, + {1507343, 0, 0}, + {1572879, 0, 0}, + {1638415, 0, 0}, + {1703951, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 23}, + {0, 22, 25}, + {0, 21, 26}, + {0, 6, 20}, + {0, 19, 27}, + {0, 29, 28}, + {0, 24, 18}, + {0, 30, 13}, + {0, 31, 14}, + {0, 32, 7}, + {0, 17, 15}, + {0, 33, 2}, + {0, 34, 8}, + {0, 16, 12}, + {0, 35, 3}, + {0, 36, 5}, + {0, 9, 37}, + {0, 39, 38}, + {0, 11, 40}, + {0, 4, 10}, + {0, 42, 41}, + {0, 44, 43}, + {0, 46, 45}, + })); + + codecs.emplace(SpvOpMemoryModel, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {196631, 0, 0}, + {196640, 0, 0}, + {196641, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 3}, + {0, 4, 5}, + {0, 1, 6}, + })); + + codecs.emplace(SpvOpTypeFloat, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(69, { + {0, 0, 0}, + {65790, 0, 0}, + {131134, 0, 0}, + {196669, 0, 0}, + {196735, 0, 0}, + {262201, 0, 0}, + {262209, 0, 0}, + {262224, 0, 0}, + {262225, 0, 0}, + {262231, 0, 0}, + {262272, 0, 0}, + {262273, 0, 0}, + {262275, 0, 0}, + {262277, 0, 0}, + {262280, 0, 0}, + {262286, 0, 0}, + {262288, 0, 0}, + {262289, 0, 0}, + {262292, 0, 0}, + {327692, 0, 0}, + {327745, 0, 0}, + {327760, 0, 0}, + {327761, 0, 0}, + {327762, 0, 0}, + {327849, 0, 0}, + {393228, 0, 0}, + {393281, 0, 0}, + {393295, 0, 0}, + {393296, 0, 0}, + {393304, 0, 0}, + {458764, 0, 0}, + {458809, 0, 0}, + {458831, 0, 0}, + {524345, 0, 0}, + {524367, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 33, 10}, + {0, 31, 36}, + {0, 26, 37}, + {0, 5, 38}, + {0, 20, 39}, + {0, 22, 40}, + {0, 24, 25}, + {0, 15, 41}, + {0, 9, 17}, + {0, 1, 42}, + {0, 4, 43}, + {0, 35, 44}, + {0, 34, 45}, + {0, 19, 46}, + {0, 7, 29}, + {0, 16, 47}, + {0, 48, 32}, + {0, 49, 27}, + {0, 11, 14}, + {0, 18, 28}, + {0, 23, 50}, + {0, 51, 12}, + {0, 52, 21}, + {0, 6, 53}, + {0, 55, 54}, + {0, 57, 56}, + {0, 3, 58}, + {0, 13, 59}, + {0, 60, 8}, + {0, 30, 61}, + {0, 62, 2}, + {0, 64, 63}, + {0, 66, 65}, + {0, 68, 67}, + })); + + codecs.emplace(SpvOpCompositeConstruct, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(39, { + {0, 0, 0}, + {65556, 0, 0}, + {131094, 0, 0}, + {131105, 0, 0}, + {196629, 0, 0}, + {196631, 0, 0}, + {196632, 0, 0}, + {196640, 0, 0}, + {196641, 0, 0}, + {262177, 0, 0}, + {327713, 0, 0}, + {393249, 0, 0}, + {458785, 0, 0}, + {524313, 0, 0}, + {524321, 0, 0}, + {589857, 0, 0}, + {655393, 0, 0}, + {786465, 0, 0}, + {917537, 0, 0}, + {1048609, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 19, 18}, + {0, 21, 15}, + {0, 1, 22}, + {0, 16, 23}, + {0, 14, 24}, + {0, 20, 25}, + {0, 13, 17}, + {0, 3, 26}, + {0, 6, 11}, + {0, 27, 12}, + {0, 4, 28}, + {0, 29, 10}, + {0, 9, 30}, + {0, 7, 31}, + {0, 33, 32}, + {0, 34, 5}, + {0, 8, 35}, + {0, 2, 36}, + {0, 38, 37}, + })); + + codecs.emplace(SpvOpTypeFunction, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {131086, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(SpvOpExtInstImport, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {131099, 0, 0}, + {196640, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 3}, + {0, 1, 4}, + })); + + codecs.emplace(SpvOpTypeImage, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {131143, 0, 0}, + {196679, 0, 0}, + {196680, 0, 0}, + {262216, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 5, 2}, + {0, 3, 6}, + {0, 7, 1}, + {0, 4, 8}, + })); + + codecs.emplace(SpvOpMemberDecorate, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {65553, 0, 0}, + {131083, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 3}, + {0, 2, 4}, + })); + + codecs.emplace(SpvOpCapability, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(17, { + {0, 0, 0}, + {196629, 0, 0}, + {196631, 0, 0}, + {196632, 0, 0}, + {196640, 0, 0}, + {196651, 0, 0}, + {196667, 0, 0}, + {327713, 0, 0}, + {458785, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 7, 8}, + {0, 1, 10}, + {0, 6, 11}, + {0, 9, 12}, + {0, 4, 13}, + {0, 3, 14}, + {0, 15, 2}, + {0, 5, 16}, + })); + + codecs.emplace(SpvOpTypeInt, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(29, { + {0, 0, 0}, + {65556, 0, 0}, + {131073, 0, 0}, + {196629, 0, 0}, + {196631, 0, 0}, + {196632, 0, 0}, + {196636, 0, 0}, + {196640, 0, 0}, + {196651, 0, 0}, + {196667, 0, 0}, + {262188, 0, 0}, + {262198, 0, 0}, + {327724, 0, 0}, + {393260, 0, 0}, + {524313, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 6}, + {0, 16, 3}, + {0, 11, 17}, + {0, 5, 18}, + {0, 15, 19}, + {0, 13, 20}, + {0, 1, 4}, + {0, 12, 21}, + {0, 7, 22}, + {0, 14, 23}, + {0, 24, 10}, + {0, 25, 9}, + {0, 27, 26}, + {0, 8, 28}, + })); + + codecs.emplace(SpvOpConstantComposite, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(15, { + {0, 0, 0}, + {65556, 0, 0}, + {196631, 0, 0}, + {196640, 0, 0}, + {196651, 0, 0}, + {196667, 0, 0}, + {327724, 0, 0}, + {393260, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 6, 7}, + {0, 1, 9}, + {0, 10, 8}, + {0, 2, 11}, + {0, 5, 12}, + {0, 13, 4}, + {0, 3, 14}, + })); + + codecs.emplace(SpvOpTypeSampledImage, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(21, { + {0, 0, 0}, + {131073, 0, 0}, + {196629, 0, 0}, + {196631, 0, 0}, + {196632, 0, 0}, + {196636, 0, 0}, + {196640, 0, 0}, + {196641, 0, 0}, + {196651, 0, 0}, + {196667, 0, 0}, + {262198, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 5}, + {0, 11, 12}, + {0, 8, 13}, + {0, 7, 14}, + {0, 4, 10}, + {0, 9, 2}, + {0, 16, 15}, + {0, 1, 17}, + {0, 19, 18}, + {0, 6, 20}, + })); + + codecs.emplace(SpvOpTypeStruct, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(49, { + {0, 0, 0}, + {65785, 0, 0}, + {65790, 0, 0}, + {131134, 0, 0}, + {196669, 0, 0}, + {196735, 0, 0}, + {262201, 0, 0}, + {262209, 0, 0}, + {262224, 0, 0}, + {262225, 0, 0}, + {262272, 0, 0}, + {262273, 0, 0}, + {262275, 0, 0}, + {262277, 0, 0}, + {262286, 0, 0}, + {262292, 0, 0}, + {327692, 0, 0}, + {327745, 0, 0}, + {327760, 0, 0}, + {327762, 0, 0}, + {393228, 0, 0}, + {393295, 0, 0}, + {393296, 0, 0}, + {458764, 0, 0}, + {458831, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 20, 12}, + {0, 26, 24}, + {0, 21, 27}, + {0, 28, 16}, + {0, 10, 8}, + {0, 30, 29}, + {0, 31, 17}, + {0, 32, 13}, + {0, 25, 6}, + {0, 1, 33}, + {0, 14, 11}, + {0, 3, 34}, + {0, 18, 35}, + {0, 37, 36}, + {0, 23, 5}, + {0, 38, 2}, + {0, 39, 7}, + {0, 4, 9}, + {0, 40, 19}, + {0, 42, 41}, + {0, 43, 22}, + {0, 45, 44}, + {0, 46, 15}, + {0, 48, 47}, + })); + + codecs.emplace(SpvOpFNegate, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(11, { + {0, 0, 0}, + {65555, 0, 0}, + {131143, 0, 0}, + {196679, 0, 0}, + {196680, 0, 0}, + {262216, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 6}, + {0, 1, 2}, + {0, 8, 7}, + {0, 5, 9}, + {0, 3, 10}, + })); + + codecs.emplace(SpvOpDecorate, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(25, { + {0, 0, 0}, + {65562, 0, 0}, + {196629, 0, 0}, + {196631, 0, 0}, + {196632, 0, 0}, + {196636, 0, 0}, + {196640, 0, 0}, + {196641, 0, 0}, + {196651, 0, 0}, + {196667, 0, 0}, + {262177, 0, 0}, + {262198, 0, 0}, + {327713, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 12, 11}, + {0, 9, 14}, + {0, 10, 15}, + {0, 13, 16}, + {0, 4, 17}, + {0, 2, 1}, + {0, 18, 7}, + {0, 20, 19}, + {0, 21, 3}, + {0, 22, 6}, + {0, 5, 8}, + {0, 24, 23}, + })); + + codecs.emplace(SpvOpTypeMatrix, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(31, { + {0, 0, 0}, + {65556, 0, 0}, + {131073, 0, 0}, + {131094, 0, 0}, + {196629, 0, 0}, + {196631, 0, 0}, + {196632, 0, 0}, + {196636, 0, 0}, + {196640, 0, 0}, + {196651, 0, 0}, + {196667, 0, 0}, + {262188, 0, 0}, + {262198, 0, 0}, + {327724, 0, 0}, + {393260, 0, 0}, + {524313, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 12, 2}, + {0, 17, 3}, + {0, 5, 18}, + {0, 1, 19}, + {0, 16, 4}, + {0, 21, 20}, + {0, 6, 15}, + {0, 7, 22}, + {0, 24, 23}, + {0, 13, 14}, + {0, 25, 8}, + {0, 26, 11}, + {0, 27, 10}, + {0, 29, 28}, + {0, 30, 9}, + })); + + codecs.emplace(SpvOpConstant, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(33, { + {0, 0, 0}, + {131113, 0, 0}, + {196629, 0, 0}, + {196631, 0, 0}, + {196632, 0, 0}, + {196640, 0, 0}, + {196641, 0, 0}, + {196651, 0, 0}, + {196667, 0, 0}, + {262188, 0, 0}, + {262198, 0, 0}, + {327713, 0, 0}, + {327724, 0, 0}, + {393249, 0, 0}, + {393260, 0, 0}, + {524313, 0, 0}, + {524321, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 6, 4}, + {0, 13, 11}, + {0, 16, 15}, + {0, 18, 10}, + {0, 20, 19}, + {0, 21, 2}, + {0, 23, 22}, + {0, 8, 24}, + {0, 9, 25}, + {0, 17, 26}, + {0, 14, 27}, + {0, 12, 28}, + {0, 1, 3}, + {0, 5, 29}, + {0, 30, 7}, + {0, 32, 31}, + })); + + codecs.emplace(SpvOpTypeBool, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(11, { + {0, 0, 0}, + {196636, 0, 0}, + {196640, 0, 0}, + {196651, 0, 0}, + {196667, 0, 0}, + {524313, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 5}, + {0, 3, 7}, + {0, 2, 8}, + {0, 6, 9}, + {0, 1, 10}, + })); + + codecs.emplace(SpvOpTypeArray, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(67, { + {0, 0, 0}, + {65785, 0, 0}, + {65790, 0, 0}, + {131134, 0, 0}, + {131319, 0, 0}, + {196669, 0, 0}, + {196735, 0, 0}, + {262201, 0, 0}, + {262209, 0, 0}, + {262224, 0, 0}, + {262225, 0, 0}, + {262231, 0, 0}, + {262272, 0, 0}, + {262273, 0, 0}, + {262275, 0, 0}, + {262277, 0, 0}, + {262280, 0, 0}, + {262286, 0, 0}, + {262292, 0, 0}, + {262334, 0, 0}, + {327692, 0, 0}, + {327737, 0, 0}, + {327745, 0, 0}, + {327760, 0, 0}, + {327761, 0, 0}, + {327762, 0, 0}, + {393228, 0, 0}, + {393273, 0, 0}, + {393281, 0, 0}, + {393295, 0, 0}, + {393296, 0, 0}, + {458764, 0, 0}, + {458831, 0, 0}, + {524367, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 7, 27}, + {0, 11, 28}, + {0, 35, 21}, + {0, 36, 1}, + {0, 4, 37}, + {0, 39, 38}, + {0, 40, 30}, + {0, 41, 12}, + {0, 19, 42}, + {0, 13, 43}, + {0, 16, 44}, + {0, 45, 22}, + {0, 34, 18}, + {0, 29, 24}, + {0, 46, 25}, + {0, 6, 2}, + {0, 9, 31}, + {0, 17, 47}, + {0, 49, 48}, + {0, 50, 33}, + {0, 51, 26}, + {0, 20, 52}, + {0, 32, 53}, + {0, 3, 54}, + {0, 15, 14}, + {0, 23, 55}, + {0, 8, 56}, + {0, 58, 57}, + {0, 10, 59}, + {0, 5, 60}, + {0, 62, 61}, + {0, 64, 63}, + {0, 66, 65}, + })); + + codecs.emplace(SpvOpExtInst, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(57, { + {0, 0, 0}, + {65790, 0, 0}, + {131134, 0, 0}, + {196665, 0, 0}, + {196669, 0, 0}, + {196718, 0, 0}, + {262201, 0, 0}, + {262209, 0, 0}, + {262224, 0, 0}, + {262225, 0, 0}, + {262231, 0, 0}, + {262273, 0, 0}, + {262275, 0, 0}, + {262277, 0, 0}, + {262280, 0, 0}, + {262286, 0, 0}, + {262292, 0, 0}, + {327692, 0, 0}, + {327745, 0, 0}, + {327760, 0, 0}, + {327762, 0, 0}, + {393228, 0, 0}, + {393273, 0, 0}, + {393295, 0, 0}, + {393296, 0, 0}, + {393303, 0, 0}, + {458764, 0, 0}, + {458831, 0, 0}, + {524367, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 18, 6}, + {0, 30, 22}, + {0, 31, 25}, + {0, 10, 32}, + {0, 21, 33}, + {0, 3, 34}, + {0, 35, 5}, + {0, 23, 36}, + {0, 14, 17}, + {0, 37, 26}, + {0, 1, 38}, + {0, 29, 39}, + {0, 13, 40}, + {0, 41, 19}, + {0, 28, 20}, + {0, 16, 42}, + {0, 27, 43}, + {0, 8, 24}, + {0, 7, 44}, + {0, 9, 45}, + {0, 15, 46}, + {0, 12, 47}, + {0, 48, 2}, + {0, 4, 49}, + {0, 51, 50}, + {0, 11, 52}, + {0, 54, 53}, + {0, 56, 55}, + })); + + codecs.emplace(SpvOpVectorTimesScalar, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(67, { + {0, 0, 0}, + {65785, 0, 0}, + {65790, 0, 0}, + {131134, 0, 0}, + {196669, 0, 0}, + {196735, 0, 0}, + {262201, 0, 0}, + {262209, 0, 0}, + {262224, 0, 0}, + {262225, 0, 0}, + {262230, 0, 0}, + {262231, 0, 0}, + {262272, 0, 0}, + {262273, 0, 0}, + {262275, 0, 0}, + {262277, 0, 0}, + {262280, 0, 0}, + {262286, 0, 0}, + {262292, 0, 0}, + {327692, 0, 0}, + {327737, 0, 0}, + {327745, 0, 0}, + {327760, 0, 0}, + {327761, 0, 0}, + {327762, 0, 0}, + {393228, 0, 0}, + {393273, 0, 0}, + {393295, 0, 0}, + {393296, 0, 0}, + {393303, 0, 0}, + {393304, 0, 0}, + {458764, 0, 0}, + {458831, 0, 0}, + {524367, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 26, 29}, + {0, 20, 35}, + {0, 12, 36}, + {0, 6, 37}, + {0, 38, 28}, + {0, 30, 5}, + {0, 8, 39}, + {0, 2, 40}, + {0, 41, 21}, + {0, 1, 10}, + {0, 43, 42}, + {0, 23, 16}, + {0, 44, 33}, + {0, 34, 31}, + {0, 14, 45}, + {0, 19, 46}, + {0, 25, 47}, + {0, 49, 48}, + {0, 27, 22}, + {0, 7, 50}, + {0, 17, 32}, + {0, 18, 51}, + {0, 24, 52}, + {0, 54, 53}, + {0, 55, 9}, + {0, 56, 11}, + {0, 57, 4}, + {0, 15, 58}, + {0, 59, 13}, + {0, 60, 3}, + {0, 62, 61}, + {0, 64, 63}, + {0, 66, 65}, + })); + + codecs.emplace(SpvOpVectorShuffle, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(33, { + {0, 0, 0}, + {65790, 0, 0}, + {131134, 0, 0}, + {196669, 0, 0}, + {262201, 0, 0}, + {262209, 0, 0}, + {262225, 0, 0}, + {262231, 0, 0}, + {262273, 0, 0}, + {262277, 0, 0}, + {262286, 0, 0}, + {262292, 0, 0}, + {327745, 0, 0}, + {393281, 0, 0}, + {393295, 0, 0}, + {393296, 0, 0}, + {458831, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 13, 12}, + {0, 1, 18}, + {0, 19, 11}, + {0, 9, 20}, + {0, 10, 21}, + {0, 22, 15}, + {0, 23, 8}, + {0, 4, 24}, + {0, 25, 7}, + {0, 17, 26}, + {0, 5, 27}, + {0, 14, 3}, + {0, 29, 28}, + {0, 30, 2}, + {0, 6, 31}, + {0, 32, 16}, + })); + + codecs.emplace(SpvOpImageSampleImplicitLod, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(55, { + {0, 0, 0}, + {65785, 0, 0}, + {65790, 0, 0}, + {131134, 0, 0}, + {196669, 0, 0}, + {196735, 0, 0}, + {196817, 0, 0}, + {262209, 0, 0}, + {262224, 0, 0}, + {262225, 0, 0}, + {262273, 0, 0}, + {262275, 0, 0}, + {262277, 0, 0}, + {262280, 0, 0}, + {262286, 0, 0}, + {262292, 0, 0}, + {327692, 0, 0}, + {327745, 0, 0}, + {327760, 0, 0}, + {327761, 0, 0}, + {327762, 0, 0}, + {393228, 0, 0}, + {393281, 0, 0}, + {393295, 0, 0}, + {393296, 0, 0}, + {393298, 0, 0}, + {458764, 0, 0}, + {458831, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 5, 2}, + {0, 22, 29}, + {0, 30, 1}, + {0, 6, 31}, + {0, 9, 32}, + {0, 28, 3}, + {0, 27, 33}, + {0, 20, 16}, + {0, 34, 8}, + {0, 10, 35}, + {0, 4, 36}, + {0, 24, 23}, + {0, 21, 13}, + {0, 7, 37}, + {0, 38, 14}, + {0, 25, 39}, + {0, 17, 11}, + {0, 12, 19}, + {0, 41, 40}, + {0, 42, 18}, + {0, 15, 43}, + {0, 45, 44}, + {0, 47, 46}, + {0, 26, 48}, + {0, 50, 49}, + {0, 52, 51}, + {0, 54, 53}, + })); + + codecs.emplace(SpvOpDot, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(11, { + {0, 0, 0}, + {131075, 0, 0}, + {131088, 0, 0}, + {196624, 0, 0}, + {196679, 0, 0}, + {262216, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 5, 3}, + {0, 2, 7}, + {0, 1, 8}, + {0, 6, 9}, + {0, 4, 10}, + })); + + codecs.emplace(SpvOpExecutionMode, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {196858, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(SpvOpSelectionMerge, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(23, { + {0, 0, 0}, + {131134, 0, 0}, + {196669, 0, 0}, + {262209, 0, 0}, + {262224, 0, 0}, + {262225, 0, 0}, + {262277, 0, 0}, + {327745, 0, 0}, + {327761, 0, 0}, + {327762, 0, 0}, + {393295, 0, 0}, + {393296, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 12}, + {0, 7, 13}, + {0, 5, 1}, + {0, 4, 10}, + {0, 14, 6}, + {0, 16, 15}, + {0, 17, 11}, + {0, 3, 8}, + {0, 19, 18}, + {0, 9, 20}, + {0, 22, 21}, + })); + + codecs.emplace(SpvOpImageSampleDrefExplicitLod, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {65790, 0, 0}, + {131073, 0, 0}, + {262198, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 1}, + {0, 3, 5}, + {0, 2, 6}, + })); + + codecs.emplace(SpvOpUndef, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(59, { + {0, 0, 0}, + {65785, 0, 0}, + {131134, 0, 0}, + {131319, 0, 0}, + {196669, 0, 0}, + {196735, 0, 0}, + {262209, 0, 0}, + {262221, 0, 0}, + {262224, 0, 0}, + {262225, 0, 0}, + {262230, 0, 0}, + {262273, 0, 0}, + {262275, 0, 0}, + {262277, 0, 0}, + {262280, 0, 0}, + {262286, 0, 0}, + {262288, 0, 0}, + {262292, 0, 0}, + {262334, 0, 0}, + {327692, 0, 0}, + {327760, 0, 0}, + {327761, 0, 0}, + {327762, 0, 0}, + {393228, 0, 0}, + {393295, 0, 0}, + {393296, 0, 0}, + {393298, 0, 0}, + {458764, 0, 0}, + {458831, 0, 0}, + {524367, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 17, 3}, + {0, 5, 31}, + {0, 11, 32}, + {0, 33, 12}, + {0, 34, 20}, + {0, 16, 27}, + {0, 35, 23}, + {0, 37, 36}, + {0, 14, 18}, + {0, 39, 38}, + {0, 7, 30}, + {0, 8, 25}, + {0, 40, 15}, + {0, 13, 2}, + {0, 1, 29}, + {0, 19, 41}, + {0, 43, 42}, + {0, 28, 44}, + {0, 46, 45}, + {0, 22, 21}, + {0, 47, 24}, + {0, 48, 26}, + {0, 10, 6}, + {0, 50, 49}, + {0, 52, 51}, + {0, 54, 53}, + {0, 4, 9}, + {0, 56, 55}, + {0, 58, 57}, + })); + + codecs.emplace(SpvOpCompositeInsert, std::move(codec)); + } + + return codecs; +} + +std::map>> +GetLiteralStringHuffmanCodecs() { + std::map>> codecs; + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {"", 0, 0}, + {"MainPs", 0, 0}, + {"MainVs", 0, 0}, + {"kMarkvNoneOfTheAbove", 0, 0}, + {"main", 0, 0}, + {"", 2, 3}, + {"", 1, 5}, + {"", 4, 6}, + })); + + codecs.emplace(SpvOpEntryPoint, std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {"", 0, 0}, + {"GLSL.std.450", 0, 0}, + {"kMarkvNoneOfTheAbove", 0, 0}, + {"", 1, 2}, + })); + + codecs.emplace(SpvOpExtInstImport, std::move(codec)); + } + + return codecs; +} + +std::map, std::unique_ptr>> +GetNonIdWordHuffmanCodecs() { + std::map, std::unique_ptr>> codecs; + { + std::unique_ptr> codec(new HuffmanCodec(33, { + {0, 0, 0}, + {4, 0, 0}, + {8, 0, 0}, + {10, 0, 0}, + {26, 0, 0}, + {29, 0, 0}, + {31, 0, 0}, + {37, 0, 0}, + {40, 0, 0}, + {43, 0, 0}, + {46, 0, 0}, + {49, 0, 0}, + {66, 0, 0}, + {67, 0, 0}, + {68, 0, 0}, + {69, 0, 0}, + {71, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 12, 5}, + {0, 18, 13}, + {0, 3, 7}, + {0, 19, 11}, + {0, 20, 16}, + {0, 14, 17}, + {0, 21, 1}, + {0, 2, 6}, + {0, 23, 22}, + {0, 4, 24}, + {0, 26, 25}, + {0, 28, 27}, + {0, 10, 15}, + {0, 8, 9}, + {0, 30, 29}, + {0, 32, 31}, + })); + + codecs.emplace(std::pair(SpvOpExtInst, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {0, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpMemoryModel, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {1, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpMemoryModel, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {0, 0, 0}, + {4, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 3}, + {0, 2, 4}, + })); + + codecs.emplace(std::pair(SpvOpEntryPoint, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {7, 0, 0}, + {8, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 2}, + {0, 1, 4}, + })); + + codecs.emplace(std::pair(SpvOpExecutionMode, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(11, { + {0, 0, 0}, + {1, 0, 0}, + {2, 0, 0}, + {3, 0, 0}, + {4, 0, 0}, + {18, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 2}, + {0, 6, 5}, + {0, 7, 1}, + {0, 3, 8}, + {0, 10, 9}, + })); + + codecs.emplace(std::pair(SpvOpExecutionMode, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {1, 0, 0}, + {32, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 3}, + {0, 1, 4}, + })); + + codecs.emplace(std::pair(SpvOpCapability, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {32, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeInt, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {0, 0, 0}, + {1, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 3}, + {0, 1, 4}, + })); + + codecs.emplace(std::pair(SpvOpTypeInt, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {32, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeFloat, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {2, 0, 0}, + {3, 0, 0}, + {4, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 4}, + {0, 1, 5}, + {0, 6, 3}, + })); + + codecs.emplace(std::pair(SpvOpTypeVector, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {2, 0, 0}, + {3, 0, 0}, + {4, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 4}, + {0, 2, 5}, + {0, 3, 6}, + })); + + codecs.emplace(std::pair(SpvOpTypeMatrix, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {1, 0, 0}, + {2, 0, 0}, + {3, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 4}, + {0, 2, 5}, + {0, 1, 6}, + })); + + codecs.emplace(std::pair(SpvOpTypeImage, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {0, 0, 0}, + {1, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 3}, + {0, 1, 4}, + })); + + codecs.emplace(std::pair(SpvOpTypeImage, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {0, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeImage, 4), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {0, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeImage, 5), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {1, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeImage, 6), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {0, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeImage, 7), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(13, { + {0, 0, 0}, + {0, 0, 0}, + {1, 0, 0}, + {2, 0, 0}, + {3, 0, 0}, + {6, 0, 0}, + {7, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 5, 7}, + {0, 6, 8}, + {0, 1, 4}, + {0, 2, 9}, + {0, 10, 3}, + {0, 12, 11}, + })); + + codecs.emplace(std::pair(SpvOpTypePointer, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(173, { + {0, 0, 0}, + {0, 0, 0}, + {1, 0, 0}, + {2, 0, 0}, + {3, 0, 0}, + {4, 0, 0}, + {5, 0, 0}, + {6, 0, 0}, + {7, 0, 0}, + {8, 0, 0}, + {9, 0, 0}, + {10, 0, 0}, + {11, 0, 0}, + {12, 0, 0}, + {13, 0, 0}, + {14, 0, 0}, + {15, 0, 0}, + {16, 0, 0}, + {17, 0, 0}, + {18, 0, 0}, + {19, 0, 0}, + {20, 0, 0}, + {21, 0, 0}, + {22, 0, 0}, + {23, 0, 0}, + {24, 0, 0}, + {26, 0, 0}, + {27, 0, 0}, + {28, 0, 0}, + {29, 0, 0}, + {30, 0, 0}, + {31, 0, 0}, + {32, 0, 0}, + {256, 0, 0}, + {507307272, 0, 0}, + {864026611, 0, 0}, + {981668463, 0, 0}, + {997553156, 0, 0}, + {1014330372, 0, 0}, + {1020708227, 0, 0}, + {1028443341, 0, 0}, + {1032953056, 0, 0}, + {1033463938, 0, 0}, + {1033463943, 0, 0}, + {1039998884, 0, 0}, + {1039998950, 0, 0}, + {1040187392, 0, 0}, + {1042401985, 0, 0}, + {1044220635, 0, 0}, + {1045622707, 0, 0}, + {1045622740, 0, 0}, + {1048576000, 0, 0}, + {1053609165, 0, 0}, + {1053790359, 0, 0}, + {1054448026, 0, 0}, + {1055437881, 0, 0}, + {1056300230, 0, 0}, + {1056964608, 0, 0}, + {1058056805, 0, 0}, + {1059286575, 0, 0}, + {1061158912, 0, 0}, + {1061997773, 0, 0}, + {1064514355, 0, 0}, + {1064854933, 0, 0}, + {1065353216, 0, 0}, + {1069547520, 0, 0}, + {1073741824, 0, 0}, + {1077936128, 0, 0}, + {1082130432, 0, 0}, + {1091567616, 0, 0}, + {1115422720, 0, 0}, + {1124073472, 0, 0}, + {1132396544, 0, 0}, + {1140850688, 0, 0}, + {1199562752, 0, 0}, + {3179067684, 0, 0}, + {3180973575, 0, 0}, + {3182651297, 0, 0}, + {3196448879, 0, 0}, + {3204448256, 0, 0}, + {3204993516, 0, 0}, + {3205248529, 0, 0}, + {3207137644, 0, 0}, + {3208642560, 0, 0}, + {3211081967, 0, 0}, + {3212836864, 0, 0}, + {3332128768, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 38, 37}, + {0, 42, 39}, + {0, 49, 44}, + {0, 45, 43}, + {0, 26, 50}, + {0, 46, 73}, + {0, 35, 28}, + {0, 32, 65}, + {0, 83, 40}, + {0, 60, 62}, + {0, 27, 54}, + {0, 79, 67}, + {0, 31, 74}, + {0, 51, 12}, + {0, 70, 30}, + {0, 15, 16}, + {0, 88, 25}, + {0, 90, 89}, + {0, 34, 71}, + {0, 72, 29}, + {0, 92, 91}, + {0, 14, 33}, + {0, 94, 93}, + {0, 22, 23}, + {0, 21, 95}, + {0, 19, 24}, + {0, 96, 13}, + {0, 47, 41}, + {0, 53, 48}, + {0, 58, 56}, + {0, 63, 59}, + {0, 76, 75}, + {0, 78, 77}, + {0, 81, 80}, + {0, 84, 82}, + {0, 52, 20}, + {0, 97, 69}, + {0, 99, 98}, + {0, 18, 10}, + {0, 68, 61}, + {0, 17, 100}, + {0, 102, 101}, + {0, 11, 36}, + {0, 104, 103}, + {0, 86, 105}, + {0, 107, 106}, + {0, 109, 108}, + {0, 110, 9}, + {0, 8, 111}, + {0, 113, 112}, + {0, 115, 114}, + {0, 117, 116}, + {0, 119, 118}, + {0, 121, 120}, + {0, 123, 122}, + {0, 125, 124}, + {0, 126, 7}, + {0, 127, 85}, + {0, 6, 128}, + {0, 129, 55}, + {0, 130, 5}, + {0, 132, 131}, + {0, 134, 133}, + {0, 136, 135}, + {0, 137, 66}, + {0, 139, 138}, + {0, 141, 140}, + {0, 143, 142}, + {0, 145, 144}, + {0, 146, 57}, + {0, 147, 64}, + {0, 148, 4}, + {0, 149, 2}, + {0, 151, 150}, + {0, 152, 3}, + {0, 154, 153}, + {0, 156, 155}, + {0, 158, 157}, + {0, 159, 1}, + {0, 160, 87}, + {0, 162, 161}, + {0, 164, 163}, + {0, 166, 165}, + {0, 168, 167}, + {0, 170, 169}, + {0, 172, 171}, + })); + + codecs.emplace(std::pair(SpvOpConstant, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {0, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpFunction, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(13, { + {0, 0, 0}, + {0, 0, 0}, + {1, 0, 0}, + {2, 0, 0}, + {3, 0, 0}, + {6, 0, 0}, + {7, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 7}, + {0, 4, 8}, + {0, 9, 2}, + {0, 1, 5}, + {0, 10, 6}, + {0, 12, 11}, + })); + + codecs.emplace(std::pair(SpvOpVariable, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(15, { + {0, 0, 0}, + {0, 0, 0}, + {2, 0, 0}, + {6, 0, 0}, + {11, 0, 0}, + {30, 0, 0}, + {33, 0, 0}, + {34, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 8}, + {0, 9, 1}, + {0, 3, 10}, + {0, 6, 11}, + {0, 12, 2}, + {0, 7, 5}, + {0, 14, 13}, + })); + + codecs.emplace(std::pair(SpvOpDecorate, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(37, { + {0, 0, 0}, + {0, 0, 0}, + {1, 0, 0}, + {2, 0, 0}, + {3, 0, 0}, + {4, 0, 0}, + {5, 0, 0}, + {6, 0, 0}, + {7, 0, 0}, + {8, 0, 0}, + {9, 0, 0}, + {10, 0, 0}, + {12, 0, 0}, + {13, 0, 0}, + {14, 0, 0}, + {15, 0, 0}, + {16, 0, 0}, + {18, 0, 0}, + {64, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 17, 11}, + {0, 10, 13}, + {0, 12, 14}, + {0, 21, 20}, + {0, 9, 22}, + {0, 19, 15}, + {0, 8, 23}, + {0, 18, 24}, + {0, 25, 7}, + {0, 5, 6}, + {0, 26, 16}, + {0, 27, 4}, + {0, 28, 3}, + {0, 30, 29}, + {0, 31, 2}, + {0, 33, 32}, + {0, 35, 34}, + {0, 1, 36}, + })); + + codecs.emplace(std::pair(SpvOpDecorate, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(79, { + {0, 0, 0}, + {0, 0, 0}, + {1, 0, 0}, + {2, 0, 0}, + {3, 0, 0}, + {4, 0, 0}, + {5, 0, 0}, + {6, 0, 0}, + {7, 0, 0}, + {8, 0, 0}, + {9, 0, 0}, + {10, 0, 0}, + {11, 0, 0}, + {12, 0, 0}, + {13, 0, 0}, + {14, 0, 0}, + {15, 0, 0}, + {16, 0, 0}, + {17, 0, 0}, + {18, 0, 0}, + {19, 0, 0}, + {20, 0, 0}, + {21, 0, 0}, + {22, 0, 0}, + {23, 0, 0}, + {24, 0, 0}, + {25, 0, 0}, + {26, 0, 0}, + {27, 0, 0}, + {28, 0, 0}, + {29, 0, 0}, + {30, 0, 0}, + {31, 0, 0}, + {32, 0, 0}, + {33, 0, 0}, + {34, 0, 0}, + {35, 0, 0}, + {36, 0, 0}, + {37, 0, 0}, + {38, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 39, 37}, + {0, 40, 36}, + {0, 34, 35}, + {0, 32, 33}, + {0, 30, 31}, + {0, 27, 29}, + {0, 26, 28}, + {0, 42, 41}, + {0, 23, 25}, + {0, 38, 22}, + {0, 44, 43}, + {0, 46, 45}, + {0, 21, 47}, + {0, 19, 20}, + {0, 17, 18}, + {0, 14, 15}, + {0, 12, 10}, + {0, 16, 13}, + {0, 9, 11}, + {0, 7, 8}, + {0, 6, 5}, + {0, 24, 48}, + {0, 50, 49}, + {0, 3, 4}, + {0, 51, 2}, + {0, 1, 52}, + {0, 54, 53}, + {0, 56, 55}, + {0, 58, 57}, + {0, 60, 59}, + {0, 62, 61}, + {0, 64, 63}, + {0, 66, 65}, + {0, 68, 67}, + {0, 70, 69}, + {0, 72, 71}, + {0, 74, 73}, + {0, 76, 75}, + {0, 78, 77}, + })); + + codecs.emplace(std::pair(SpvOpMemberDecorate, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {4, 0, 0}, + {7, 0, 0}, + {35, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 4}, + {0, 5, 2}, + {0, 3, 6}, + })); + + codecs.emplace(std::pair(SpvOpMemberDecorate, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(149, { + {0, 0, 0}, + {0, 0, 0}, + {16, 0, 0}, + {28, 0, 0}, + {32, 0, 0}, + {36, 0, 0}, + {40, 0, 0}, + {44, 0, 0}, + {48, 0, 0}, + {60, 0, 0}, + {64, 0, 0}, + {76, 0, 0}, + {80, 0, 0}, + {84, 0, 0}, + {88, 0, 0}, + {92, 0, 0}, + {96, 0, 0}, + {100, 0, 0}, + {108, 0, 0}, + {112, 0, 0}, + {120, 0, 0}, + {124, 0, 0}, + {128, 0, 0}, + {132, 0, 0}, + {136, 0, 0}, + {140, 0, 0}, + {144, 0, 0}, + {148, 0, 0}, + {152, 0, 0}, + {156, 0, 0}, + {160, 0, 0}, + {172, 0, 0}, + {176, 0, 0}, + {192, 0, 0}, + {204, 0, 0}, + {208, 0, 0}, + {224, 0, 0}, + {236, 0, 0}, + {240, 0, 0}, + {248, 0, 0}, + {256, 0, 0}, + {272, 0, 0}, + {288, 0, 0}, + {292, 0, 0}, + {296, 0, 0}, + {300, 0, 0}, + {304, 0, 0}, + {316, 0, 0}, + {320, 0, 0}, + {332, 0, 0}, + {336, 0, 0}, + {348, 0, 0}, + {352, 0, 0}, + {364, 0, 0}, + {368, 0, 0}, + {372, 0, 0}, + {376, 0, 0}, + {384, 0, 0}, + {392, 0, 0}, + {400, 0, 0}, + {416, 0, 0}, + {424, 0, 0}, + {432, 0, 0}, + {448, 0, 0}, + {460, 0, 0}, + {464, 0, 0}, + {468, 0, 0}, + {472, 0, 0}, + {476, 0, 0}, + {480, 0, 0}, + {488, 0, 0}, + {492, 0, 0}, + {496, 0, 0}, + {512, 0, 0}, + {640, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 14, 17}, + {0, 37, 31}, + {0, 21, 39}, + {0, 24, 23}, + {0, 5, 13}, + {0, 38, 76}, + {0, 51, 77}, + {0, 55, 53}, + {0, 58, 56}, + {0, 64, 61}, + {0, 67, 66}, + {0, 70, 68}, + {0, 54, 71}, + {0, 62, 60}, + {0, 65, 63}, + {0, 73, 72}, + {0, 59, 57}, + {0, 52, 74}, + {0, 50, 69}, + {0, 49, 47}, + {0, 48, 46}, + {0, 45, 43}, + {0, 42, 44}, + {0, 78, 41}, + {0, 20, 18}, + {0, 80, 79}, + {0, 15, 27}, + {0, 7, 34}, + {0, 81, 6}, + {0, 28, 3}, + {0, 35, 82}, + {0, 9, 36}, + {0, 84, 83}, + {0, 86, 85}, + {0, 88, 87}, + {0, 90, 89}, + {0, 92, 91}, + {0, 94, 93}, + {0, 96, 95}, + {0, 98, 97}, + {0, 11, 29}, + {0, 99, 25}, + {0, 100, 40}, + {0, 102, 101}, + {0, 26, 32}, + {0, 19, 30}, + {0, 16, 12}, + {0, 4, 8}, + {0, 104, 103}, + {0, 106, 105}, + {0, 33, 107}, + {0, 109, 108}, + {0, 111, 110}, + {0, 22, 112}, + {0, 113, 10}, + {0, 115, 114}, + {0, 75, 116}, + {0, 118, 117}, + {0, 119, 1}, + {0, 121, 120}, + {0, 123, 122}, + {0, 125, 124}, + {0, 127, 126}, + {0, 129, 128}, + {0, 131, 130}, + {0, 132, 2}, + {0, 134, 133}, + {0, 136, 135}, + {0, 138, 137}, + {0, 140, 139}, + {0, 142, 141}, + {0, 144, 143}, + {0, 146, 145}, + {0, 148, 147}, + })); + + codecs.emplace(std::pair(SpvOpMemberDecorate, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(11, { + {0, 0, 0}, + {0, 0, 0}, + {1, 0, 0}, + {2, 0, 0}, + {3, 0, 0}, + {4, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 6}, + {0, 4, 7}, + {0, 8, 3}, + {0, 9, 5}, + {0, 1, 10}, + })); + + codecs.emplace(std::pair(SpvOpVectorShuffle, 4), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(13, { + {0, 0, 0}, + {0, 0, 0}, + {1, 0, 0}, + {2, 0, 0}, + {3, 0, 0}, + {4, 0, 0}, + {5, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 7}, + {0, 8, 5}, + {0, 9, 1}, + {0, 4, 10}, + {0, 11, 6}, + {0, 2, 12}, + })); + + codecs.emplace(std::pair(SpvOpVectorShuffle, 5), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(15, { + {0, 0, 0}, + {0, 0, 0}, + {1, 0, 0}, + {2, 0, 0}, + {3, 0, 0}, + {4, 0, 0}, + {5, 0, 0}, + {6, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 6, 8}, + {0, 5, 2}, + {0, 10, 9}, + {0, 1, 4}, + {0, 12, 11}, + {0, 7, 13}, + {0, 3, 14}, + })); + + codecs.emplace(std::pair(SpvOpVectorShuffle, 6), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(15, { + {0, 0, 0}, + {0, 0, 0}, + {1, 0, 0}, + {2, 0, 0}, + {3, 0, 0}, + {4, 0, 0}, + {5, 0, 0}, + {6, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 8, 5}, + {0, 9, 7}, + {0, 10, 3}, + {0, 11, 2}, + {0, 6, 1}, + {0, 13, 12}, + {0, 4, 14}, + })); + + codecs.emplace(std::pair(SpvOpVectorShuffle, 7), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(61, { + {0, 0, 0}, + {0, 0, 0}, + {1, 0, 0}, + {2, 0, 0}, + {3, 0, 0}, + {4, 0, 0}, + {5, 0, 0}, + {6, 0, 0}, + {7, 0, 0}, + {8, 0, 0}, + {9, 0, 0}, + {10, 0, 0}, + {11, 0, 0}, + {12, 0, 0}, + {13, 0, 0}, + {14, 0, 0}, + {15, 0, 0}, + {16, 0, 0}, + {17, 0, 0}, + {18, 0, 0}, + {19, 0, 0}, + {20, 0, 0}, + {21, 0, 0}, + {22, 0, 0}, + {23, 0, 0}, + {24, 0, 0}, + {27, 0, 0}, + {28, 0, 0}, + {29, 0, 0}, + {30, 0, 0}, + {31, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 30, 16}, + {0, 26, 27}, + {0, 29, 28}, + {0, 18, 22}, + {0, 12, 19}, + {0, 15, 20}, + {0, 14, 23}, + {0, 32, 7}, + {0, 8, 21}, + {0, 11, 33}, + {0, 17, 34}, + {0, 25, 13}, + {0, 36, 35}, + {0, 9, 10}, + {0, 38, 37}, + {0, 39, 31}, + {0, 5, 40}, + {0, 42, 41}, + {0, 44, 43}, + {0, 6, 45}, + {0, 46, 24}, + {0, 48, 47}, + {0, 50, 49}, + {0, 52, 51}, + {0, 54, 53}, + {0, 55, 4}, + {0, 56, 3}, + {0, 57, 2}, + {0, 58, 1}, + {0, 60, 59}, + })); + + codecs.emplace(std::pair(SpvOpCompositeExtract, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(63, { + {0, 0, 0}, + {0, 0, 0}, + {1, 0, 0}, + {2, 0, 0}, + {3, 0, 0}, + {4, 0, 0}, + {5, 0, 0}, + {6, 0, 0}, + {7, 0, 0}, + {8, 0, 0}, + {9, 0, 0}, + {10, 0, 0}, + {11, 0, 0}, + {12, 0, 0}, + {13, 0, 0}, + {29, 0, 0}, + {30, 0, 0}, + {31, 0, 0}, + {32, 0, 0}, + {33, 0, 0}, + {34, 0, 0}, + {35, 0, 0}, + {36, 0, 0}, + {37, 0, 0}, + {38, 0, 0}, + {39, 0, 0}, + {40, 0, 0}, + {41, 0, 0}, + {42, 0, 0}, + {43, 0, 0}, + {44, 0, 0}, + {45, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 13, 14}, + {0, 12, 9}, + {0, 11, 25}, + {0, 27, 26}, + {0, 29, 28}, + {0, 31, 30}, + {0, 23, 22}, + {0, 10, 24}, + {0, 8, 21}, + {0, 17, 7}, + {0, 19, 18}, + {0, 15, 20}, + {0, 6, 16}, + {0, 5, 33}, + {0, 35, 34}, + {0, 37, 36}, + {0, 39, 38}, + {0, 41, 40}, + {0, 43, 42}, + {0, 45, 44}, + {0, 47, 46}, + {0, 49, 48}, + {0, 51, 50}, + {0, 32, 52}, + {0, 54, 53}, + {0, 56, 55}, + {0, 58, 57}, + {0, 3, 2}, + {0, 59, 4}, + {0, 60, 1}, + {0, 62, 61}, + })); + + codecs.emplace(std::pair(SpvOpCompositeExtract, 4), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {0, 0, 0}, + {1, 0, 0}, + {2, 0, 0}, + {3, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 5}, + {0, 3, 2}, + {0, 6, 4}, + {0, 8, 7}, + })); + + codecs.emplace(std::pair(SpvOpCompositeExtract, 5), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(23, { + {0, 0, 0}, + {0, 0, 0}, + {1, 0, 0}, + {2, 0, 0}, + {3, 0, 0}, + {4, 0, 0}, + {5, 0, 0}, + {6, 0, 0}, + {7, 0, 0}, + {8, 0, 0}, + {9, 0, 0}, + {10, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 12, 11}, + {0, 10, 13}, + {0, 9, 14}, + {0, 7, 5}, + {0, 8, 6}, + {0, 4, 15}, + {0, 17, 16}, + {0, 18, 3}, + {0, 19, 2}, + {0, 20, 1}, + {0, 22, 21}, + })); + + codecs.emplace(std::pair(SpvOpCompositeInsert, 4), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {0, 0, 0}, + {1, 0, 0}, + {2, 0, 0}, + {3, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 5}, + {0, 2, 6}, + {0, 7, 1}, + {0, 4, 8}, + })); + + codecs.emplace(std::pair(SpvOpCompositeInsert, 5), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {1, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpImageSampleImplicitLod, 4), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {2, 0, 0}, + {10, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 3}, + {0, 1, 4}, + })); + + codecs.emplace(std::pair(SpvOpImageSampleExplicitLod, 4), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {2, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpImageSampleDrefExplicitLod, 5), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {0, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpSelectionMerge, 1), std::move(codec)); + } + + return codecs; +} + +std::map, std::unique_ptr>> +GetIdDescriptorHuffmanCodecs() { + std::map, std::unique_ptr>> codecs; + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 5}, + {0, 4, 6}, + {0, 1, 7}, + {0, 2, 8}, + })); + + codecs.emplace(std::pair(SpvOpExtInst, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(63, { + {0, 0, 0}, + {34183582, 0, 0}, + {223800276, 0, 0}, + {295018543, 0, 0}, + {439764402, 0, 0}, + {443558693, 0, 0}, + {583624926, 0, 0}, + {599185303, 0, 0}, + {779021139, 0, 0}, + {1015552308, 0, 0}, + {1027242654, 0, 0}, + {1077859090, 0, 0}, + {1104362365, 0, 0}, + {1132589448, 0, 0}, + {1236389532, 0, 0}, + {1739837626, 0, 0}, + {1955104493, 0, 0}, + {2161102232, 0, 0}, + {2197874825, 0, 0}, + {2217833278, 0, 0}, + {2244470522, 0, 0}, + {2532518896, 0, 0}, + {2789375411, 0, 0}, + {3061690214, 0, 0}, + {3287039847, 0, 0}, + {3357301402, 0, 0}, + {3365041621, 0, 0}, + {3510257966, 0, 0}, + {3534235309, 0, 0}, + {4018237905, 0, 0}, + {4145966869, 0, 0}, + {4272200782, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 10, 19}, + {0, 6, 1}, + {0, 26, 13}, + {0, 2, 11}, + {0, 15, 22}, + {0, 23, 18}, + {0, 4, 27}, + {0, 28, 12}, + {0, 3, 30}, + {0, 9, 7}, + {0, 20, 14}, + {0, 29, 16}, + {0, 21, 8}, + {0, 34, 33}, + {0, 36, 35}, + {0, 31, 25}, + {0, 37, 24}, + {0, 39, 38}, + {0, 41, 40}, + {0, 43, 42}, + {0, 45, 44}, + {0, 17, 5}, + {0, 47, 46}, + {0, 49, 48}, + {0, 51, 50}, + {0, 53, 52}, + {0, 55, 54}, + {0, 57, 56}, + {0, 59, 58}, + {0, 61, 60}, + {0, 32, 62}, + })); + + codecs.emplace(std::pair(SpvOpExtInst, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {4228502127, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpExtInst, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(113, { + {0, 0, 0}, + {50998433, 0, 0}, + {139011596, 0, 0}, + {181902171, 0, 0}, + {296981500, 0, 0}, + {321630747, 0, 0}, + {416853049, 0, 0}, + {464259778, 0, 0}, + {615982737, 0, 0}, + {669982125, 0, 0}, + {759277550, 0, 0}, + {810488476, 0, 0}, + {870594305, 0, 0}, + {922996215, 0, 0}, + {969500141, 0, 0}, + {1015552308, 0, 0}, + {1139547465, 0, 0}, + {1203545131, 0, 0}, + {1220643281, 0, 0}, + {1220749418, 0, 0}, + {1367301635, 0, 0}, + {1395923345, 0, 0}, + {1554194368, 0, 0}, + {1742737136, 0, 0}, + {1755648697, 0, 0}, + {1962162282, 0, 0}, + {1964254745, 0, 0}, + {2055836767, 0, 0}, + {2096388952, 0, 0}, + {2124837447, 0, 0}, + {2161102232, 0, 0}, + {2321729979, 0, 0}, + {2346547796, 0, 0}, + {2399809085, 0, 0}, + {2432827426, 0, 0}, + {2455417440, 0, 0}, + {2572638469, 0, 0}, + {2614879967, 0, 0}, + {2855506940, 0, 0}, + {2919796598, 0, 0}, + {2970183398, 0, 0}, + {2976066508, 0, 0}, + {3044188332, 0, 0}, + {3061690214, 0, 0}, + {3091876332, 0, 0}, + {3104643263, 0, 0}, + {3107165180, 0, 0}, + {3187066832, 0, 0}, + {3413713311, 0, 0}, + {3487022798, 0, 0}, + {3602693817, 0, 0}, + {3678875745, 0, 0}, + {3701632935, 0, 0}, + {3829325073, 0, 0}, + {4040340620, 0, 0}, + {4174489262, 0, 0}, + {4272200782, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 33, 7}, + {0, 13, 34}, + {0, 21, 18}, + {0, 53, 22}, + {0, 39, 1}, + {0, 14, 9}, + {0, 43, 26}, + {0, 51, 35}, + {0, 19, 6}, + {0, 15, 25}, + {0, 55, 29}, + {0, 32, 3}, + {0, 27, 44}, + {0, 10, 46}, + {0, 45, 24}, + {0, 36, 40}, + {0, 47, 8}, + {0, 48, 54}, + {0, 58, 5}, + {0, 60, 59}, + {0, 30, 61}, + {0, 62, 56}, + {0, 64, 63}, + {0, 41, 50}, + {0, 66, 65}, + {0, 68, 67}, + {0, 70, 69}, + {0, 37, 31}, + {0, 4, 17}, + {0, 16, 20}, + {0, 72, 71}, + {0, 73, 52}, + {0, 49, 12}, + {0, 75, 74}, + {0, 76, 11}, + {0, 23, 42}, + {0, 78, 77}, + {0, 80, 79}, + {0, 82, 81}, + {0, 84, 83}, + {0, 85, 28}, + {0, 87, 86}, + {0, 89, 88}, + {0, 91, 90}, + {0, 93, 92}, + {0, 94, 2}, + {0, 96, 95}, + {0, 98, 97}, + {0, 100, 99}, + {0, 102, 101}, + {0, 38, 103}, + {0, 105, 104}, + {0, 107, 106}, + {0, 109, 108}, + {0, 111, 110}, + {0, 57, 112}, + })); + + codecs.emplace(std::pair(SpvOpExtInst, 4), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(127, { + {0, 0, 0}, + {72782198, 0, 0}, + {139011596, 0, 0}, + {296981500, 0, 0}, + {300939750, 0, 0}, + {401211099, 0, 0}, + {429277936, 0, 0}, + {505940164, 0, 0}, + {538168945, 0, 0}, + {603915804, 0, 0}, + {688216667, 0, 0}, + {706016261, 0, 0}, + {790502615, 0, 0}, + {810488476, 0, 0}, + {993150979, 0, 0}, + {1203545131, 0, 0}, + {1206726575, 0, 0}, + {1265796414, 0, 0}, + {1314843976, 0, 0}, + {1367301635, 0, 0}, + {1378082995, 0, 0}, + {1410311776, 0, 0}, + {1443829854, 0, 0}, + {1448448666, 0, 0}, + {1468919488, 0, 0}, + {1496351055, 0, 0}, + {1619778288, 0, 0}, + {1684282922, 0, 0}, + {1848784182, 0, 0}, + {1901166356, 0, 0}, + {2095546797, 0, 0}, + {2096388952, 0, 0}, + {2162986400, 0, 0}, + {2197874825, 0, 0}, + {2246405597, 0, 0}, + {2250225826, 0, 0}, + {2282454607, 0, 0}, + {2328748202, 0, 0}, + {2348201466, 0, 0}, + {2597020383, 0, 0}, + {2633682514, 0, 0}, + {2817335337, 0, 0}, + {2855506940, 0, 0}, + {2936040203, 0, 0}, + {2955375511, 0, 0}, + {3122368657, 0, 0}, + {3154597438, 0, 0}, + {3184381405, 0, 0}, + {3187066832, 0, 0}, + {3233393284, 0, 0}, + {3251128023, 0, 0}, + {3260309823, 0, 0}, + {3441531391, 0, 0}, + {3496407048, 0, 0}, + {3582002820, 0, 0}, + {3647586740, 0, 0}, + {3653838348, 0, 0}, + {3730093054, 0, 0}, + {3759072440, 0, 0}, + {3928764629, 0, 0}, + {3969279737, 0, 0}, + {3994511488, 0, 0}, + {4026740269, 0, 0}, + {4274214049, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 43, 23}, + {0, 5, 24}, + {0, 9, 8}, + {0, 36, 21}, + {0, 13, 46}, + {0, 7, 12}, + {0, 35, 20}, + {0, 61, 59}, + {0, 22, 29}, + {0, 38, 62}, + {0, 56, 45}, + {0, 6, 48}, + {0, 33, 30}, + {0, 14, 58}, + {0, 34, 28}, + {0, 51, 40}, + {0, 63, 55}, + {0, 25, 16}, + {0, 17, 11}, + {0, 53, 52}, + {0, 65, 27}, + {0, 39, 41}, + {0, 67, 66}, + {0, 69, 68}, + {0, 10, 4}, + {0, 37, 18}, + {0, 60, 47}, + {0, 1, 32}, + {0, 71, 70}, + {0, 73, 72}, + {0, 57, 26}, + {0, 74, 31}, + {0, 76, 75}, + {0, 77, 44}, + {0, 78, 15}, + {0, 79, 54}, + {0, 81, 80}, + {0, 82, 49}, + {0, 84, 83}, + {0, 86, 85}, + {0, 88, 87}, + {0, 89, 19}, + {0, 91, 90}, + {0, 93, 92}, + {0, 95, 94}, + {0, 2, 96}, + {0, 98, 97}, + {0, 100, 99}, + {0, 102, 101}, + {0, 104, 103}, + {0, 106, 105}, + {0, 3, 107}, + {0, 109, 108}, + {0, 111, 110}, + {0, 113, 112}, + {0, 114, 50}, + {0, 116, 115}, + {0, 118, 117}, + {0, 120, 119}, + {0, 122, 121}, + {0, 124, 123}, + {0, 64, 42}, + {0, 126, 125}, + })); + + codecs.emplace(std::pair(SpvOpExtInst, 5), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(93, { + {0, 0, 0}, + {99347751, 0, 0}, + {102542696, 0, 0}, + {107497541, 0, 0}, + {112452386, 0, 0}, + {139011596, 0, 0}, + {296981500, 0, 0}, + {429277936, 0, 0}, + {451957774, 0, 0}, + {508217552, 0, 0}, + {573901046, 0, 0}, + {774727851, 0, 0}, + {801484894, 0, 0}, + {920604853, 0, 0}, + {925559698, 0, 0}, + {1022915255, 0, 0}, + {1209418480, 0, 0}, + {1287937401, 0, 0}, + {1319785741, 0, 0}, + {1392080469, 0, 0}, + {1538342947, 0, 0}, + {1541020250, 0, 0}, + {1587209598, 0, 0}, + {1594733696, 0, 0}, + {1631434666, 0, 0}, + {1636389511, 0, 0}, + {1684282922, 0, 0}, + {1859128680, 0, 0}, + {1901166356, 0, 0}, + {2004567202, 0, 0}, + {2119793999, 0, 0}, + {2280400314, 0, 0}, + {2538917932, 0, 0}, + {2677264274, 0, 0}, + {2683080096, 0, 0}, + {2854085372, 0, 0}, + {2879917501, 0, 0}, + {3059119137, 0, 0}, + {3174324790, 0, 0}, + {3194725903, 0, 0}, + {3358097187, 0, 0}, + {3547456240, 0, 0}, + {3614752756, 0, 0}, + {3753486980, 0, 0}, + {3811268385, 0, 0}, + {3953733490, 0, 0}, + {3990925720, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 23, 22}, + {0, 36, 31}, + {0, 17, 40}, + {0, 27, 19}, + {0, 35, 33}, + {0, 30, 38}, + {0, 42, 39}, + {0, 46, 32}, + {0, 13, 12}, + {0, 44, 14}, + {0, 29, 11}, + {0, 10, 18}, + {0, 15, 37}, + {0, 1, 4}, + {0, 45, 2}, + {0, 21, 28}, + {0, 8, 5}, + {0, 49, 48}, + {0, 51, 50}, + {0, 53, 52}, + {0, 54, 16}, + {0, 55, 25}, + {0, 56, 3}, + {0, 58, 57}, + {0, 59, 26}, + {0, 20, 7}, + {0, 61, 60}, + {0, 62, 24}, + {0, 41, 63}, + {0, 65, 64}, + {0, 9, 34}, + {0, 67, 66}, + {0, 69, 68}, + {0, 71, 70}, + {0, 73, 72}, + {0, 75, 74}, + {0, 76, 43}, + {0, 78, 77}, + {0, 80, 79}, + {0, 82, 81}, + {0, 84, 83}, + {0, 86, 85}, + {0, 88, 87}, + {0, 90, 89}, + {0, 47, 91}, + {0, 92, 6}, + })); + + codecs.emplace(std::pair(SpvOpExtInst, 6), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(15, { + {0, 0, 0}, + {166253838, 0, 0}, + {679771963, 0, 0}, + {1247793383, 0, 0}, + {2261697609, 0, 0}, + {2263349224, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 8}, + {0, 9, 1}, + {0, 3, 5}, + {0, 11, 10}, + {0, 2, 12}, + {0, 7, 6}, + {0, 14, 13}, + })); + + codecs.emplace(std::pair(SpvOpTypeVector, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {789872778, 0, 0}, + {1415510495, 0, 0}, + {1951208733, 0, 0}, + {2430404313, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 5}, + {0, 4, 6}, + {0, 7, 1}, + {0, 3, 8}, + })); + + codecs.emplace(std::pair(SpvOpTypeVector, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(15, { + {0, 0, 0}, + {1389644742, 0, 0}, + {3232633974, 0, 0}, + {3278176820, 0, 0}, + {3648138580, 0, 0}, + {3687777340, 0, 0}, + {3694383800, 0, 0}, + {3697687030, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 5, 4}, + {0, 9, 6}, + {0, 10, 8}, + {0, 2, 11}, + {0, 12, 3}, + {0, 1, 13}, + {0, 14, 7}, + })); + + codecs.emplace(std::pair(SpvOpTypeArray, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {1951208733, 0, 0}, + {2160380860, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 4}, + {0, 2, 5}, + {0, 3, 6}, + })); + + codecs.emplace(std::pair(SpvOpTypeArray, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(13, { + {0, 0, 0}, + {144116905, 0, 0}, + {827246872, 0, 0}, + {1545298048, 0, 0}, + {2715370488, 0, 0}, + {2798552666, 0, 0}, + {3812456892, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 3}, + {0, 8, 6}, + {0, 9, 7}, + {0, 1, 10}, + {0, 11, 4}, + {0, 5, 12}, + })); + + codecs.emplace(std::pair(SpvOpTypeArray, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(67, { + {0, 0, 0}, + {40653745, 0, 0}, + {119981689, 0, 0}, + {153085016, 0, 0}, + {451382997, 0, 0}, + {545678922, 0, 0}, + {899570100, 0, 0}, + {929101967, 0, 0}, + {1070791291, 0, 0}, + {1100599986, 0, 0}, + {1103903216, 0, 0}, + {1154919607, 0, 0}, + {1199157863, 0, 0}, + {1258105452, 0, 0}, + {1369578001, 0, 0}, + {1372881231, 0, 0}, + {1674803691, 0, 0}, + {1677700667, 0, 0}, + {1989520052, 0, 0}, + {2593884753, 0, 0}, + {2664825925, 0, 0}, + {2924146124, 0, 0}, + {2926633629, 0, 0}, + {3249265647, 0, 0}, + {3345288309, 0, 0}, + {3410158390, 0, 0}, + {3489360962, 0, 0}, + {3495967422, 0, 0}, + {3504981554, 0, 0}, + {3705139860, 0, 0}, + {3822983876, 0, 0}, + {4141567741, 0, 0}, + {4234287173, 0, 0}, + {4240893633, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 15, 23}, + {0, 20, 17}, + {0, 32, 22}, + {0, 19, 12}, + {0, 13, 3}, + {0, 30, 27}, + {0, 4, 35}, + {0, 24, 36}, + {0, 31, 37}, + {0, 33, 38}, + {0, 39, 7}, + {0, 6, 40}, + {0, 41, 29}, + {0, 14, 42}, + {0, 43, 28}, + {0, 10, 44}, + {0, 45, 18}, + {0, 26, 46}, + {0, 5, 47}, + {0, 48, 2}, + {0, 49, 9}, + {0, 50, 16}, + {0, 34, 25}, + {0, 52, 51}, + {0, 54, 53}, + {0, 56, 55}, + {0, 58, 57}, + {0, 60, 59}, + {0, 8, 21}, + {0, 1, 11}, + {0, 62, 61}, + {0, 64, 63}, + {0, 66, 65}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(11, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2160380860, 0, 0}, + {3278176820, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 6}, + {0, 2, 7}, + {0, 3, 8}, + {0, 9, 1}, + {0, 5, 10}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(13, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2160380860, 0, 0}, + {2320303498, 0, 0}, + {3232633974, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 5, 7}, + {0, 2, 8}, + {0, 4, 9}, + {0, 10, 3}, + {0, 1, 6}, + {0, 12, 11}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(11, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2160380860, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 5, 6}, + {0, 1, 7}, + {0, 3, 4}, + {0, 8, 2}, + {0, 10, 9}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(11, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2160380860, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 6}, + {0, 3, 7}, + {0, 5, 4}, + {0, 8, 1}, + {0, 10, 9}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 4), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2263349224, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 5}, + {0, 1, 6}, + {0, 2, 7}, + {0, 8, 4}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 5), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 5}, + {0, 1, 6}, + {0, 2, 7}, + {0, 8, 4}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 6), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 5}, + {0, 4, 6}, + {0, 7, 1}, + {0, 2, 8}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 7), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 5}, + {0, 1, 6}, + {0, 7, 4}, + {0, 2, 8}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 8), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 4}, + {0, 3, 5}, + {0, 1, 6}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 9), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 5, 3}, + {0, 1, 6}, + {0, 4, 7}, + {0, 8, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 10), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 5}, + {0, 1, 6}, + {0, 7, 4}, + {0, 8, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 11), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 3}, + {0, 4, 1}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 12), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 4}, + {0, 1, 5}, + {0, 2, 6}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 13), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 5}, + {0, 3, 6}, + {0, 7, 1}, + {0, 8, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 14), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 4}, + {0, 5, 3}, + {0, 6, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 15), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 4}, + {0, 2, 5}, + {0, 1, 6}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 16), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 5}, + {0, 4, 6}, + {0, 7, 1}, + {0, 8, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 17), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 4}, + {0, 1, 5}, + {0, 2, 6}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 18), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 4}, + {0, 3, 5}, + {0, 2, 6}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 19), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 4}, + {0, 1, 5}, + {0, 2, 6}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 20), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 4}, + {0, 2, 5}, + {0, 3, 6}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 21), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 5, 1}, + {0, 2, 6}, + {0, 3, 7}, + {0, 8, 4}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 22), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 5}, + {0, 2, 6}, + {0, 4, 7}, + {0, 8, 3}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 23), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(11, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2160380860, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 6, 4}, + {0, 1, 7}, + {0, 2, 8}, + {0, 3, 9}, + {0, 10, 5}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 24), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 5}, + {0, 2, 6}, + {0, 4, 7}, + {0, 8, 3}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 25), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 4}, + {0, 2, 5}, + {0, 3, 6}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 26), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 4}, + {0, 2, 5}, + {0, 3, 6}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 27), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 3}, + {0, 1, 4}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 28), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 3}, + {0, 2, 4}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 29), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 3}, + {0, 2, 4}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 30), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 3}, + {0, 1, 5}, + {0, 2, 6}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 31), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 4}, + {0, 1, 5}, + {0, 2, 6}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 32), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 3}, + {0, 1, 4}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 33), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 3}, + {0, 2, 4}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 34), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 3}, + {0, 1, 4}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 35), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 3}, + {0, 1, 4}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 36), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {679771963, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 37), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {1389644742, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 38), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {3697687030, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 39), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {2320303498, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 40), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {2320303498, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 41), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {679771963, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 42), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {679771963, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 43), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {679771963, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 44), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {679771963, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 45), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {679771963, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 46), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {679771963, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 47), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {679771963, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 48), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {679771963, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 49), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {679771963, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 50), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {679771963, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpTypeStruct, 51), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(101, { + {0, 0, 0}, + {85880059, 0, 0}, + {135486769, 0, 0}, + {304448521, 0, 0}, + {436416061, 0, 0}, + {440421571, 0, 0}, + {450406196, 0, 0}, + {503094540, 0, 0}, + {543621065, 0, 0}, + {626892406, 0, 0}, + {628544021, 0, 0}, + {827698488, 0, 0}, + {869050696, 0, 0}, + {907126242, 0, 0}, + {908777857, 0, 0}, + {910429472, 0, 0}, + {1113409935, 0, 0}, + {1294403159, 0, 0}, + {1296054774, 0, 0}, + {1297706389, 0, 0}, + {1322549027, 0, 0}, + {1784441183, 0, 0}, + {2080953106, 0, 0}, + {2194691858, 0, 0}, + {2448331885, 0, 0}, + {2466255445, 0, 0}, + {2468230023, 0, 0}, + {2547657777, 0, 0}, + {2549309392, 0, 0}, + {2550961007, 0, 0}, + {2894051250, 0, 0}, + {2929019254, 0, 0}, + {2934934694, 0, 0}, + {2936586309, 0, 0}, + {2938237924, 0, 0}, + {3077271274, 0, 0}, + {3092528578, 0, 0}, + {3094180193, 0, 0}, + {3094857332, 0, 0}, + {3095831808, 0, 0}, + {3183924418, 0, 0}, + {3207966516, 0, 0}, + {3282979782, 0, 0}, + {3433956341, 0, 0}, + {3561562003, 0, 0}, + {3563213618, 0, 0}, + {3564865233, 0, 0}, + {3585511591, 0, 0}, + {4028622909, 0, 0}, + {4039938779, 0, 0}, + {4050155669, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 16, 25}, + {0, 50, 1}, + {0, 42, 35}, + {0, 31, 41}, + {0, 4, 43}, + {0, 9, 10}, + {0, 3, 30}, + {0, 52, 47}, + {0, 12, 53}, + {0, 55, 54}, + {0, 36, 56}, + {0, 49, 57}, + {0, 6, 58}, + {0, 34, 33}, + {0, 59, 26}, + {0, 21, 32}, + {0, 60, 15}, + {0, 24, 61}, + {0, 62, 38}, + {0, 22, 2}, + {0, 37, 7}, + {0, 63, 46}, + {0, 14, 13}, + {0, 64, 5}, + {0, 65, 45}, + {0, 66, 19}, + {0, 18, 67}, + {0, 17, 20}, + {0, 68, 11}, + {0, 8, 69}, + {0, 70, 39}, + {0, 72, 71}, + {0, 74, 73}, + {0, 40, 75}, + {0, 76, 23}, + {0, 78, 77}, + {0, 29, 79}, + {0, 28, 80}, + {0, 27, 48}, + {0, 82, 81}, + {0, 51, 83}, + {0, 84, 44}, + {0, 86, 85}, + {0, 88, 87}, + {0, 90, 89}, + {0, 92, 91}, + {0, 94, 93}, + {0, 96, 95}, + {0, 98, 97}, + {0, 100, 99}, + })); + + codecs.emplace(std::pair(SpvOpTypePointer, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(65, { + {0, 0, 0}, + {119981689, 0, 0}, + {162255877, 0, 0}, + {451382997, 0, 0}, + {545678922, 0, 0}, + {679771963, 0, 0}, + {789872778, 0, 0}, + {1100599986, 0, 0}, + {1103903216, 0, 0}, + {1154919607, 0, 0}, + {1343794461, 0, 0}, + {1415510495, 0, 0}, + {1674803691, 0, 0}, + {1951208733, 0, 0}, + {1989520052, 0, 0}, + {2160380860, 0, 0}, + {2263349224, 0, 0}, + {2320303498, 0, 0}, + {2924146124, 0, 0}, + {2984325996, 0, 0}, + {3334207724, 0, 0}, + {3345288309, 0, 0}, + {3410158390, 0, 0}, + {3489360962, 0, 0}, + {3495967422, 0, 0}, + {3504981554, 0, 0}, + {3800912395, 0, 0}, + {3802564010, 0, 0}, + {3866587616, 0, 0}, + {3868239231, 0, 0}, + {3869890846, 0, 0}, + {3998230222, 0, 0}, + {4240893633, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 3}, + {0, 6, 24}, + {0, 11, 7}, + {0, 32, 21}, + {0, 27, 34}, + {0, 35, 25}, + {0, 36, 8}, + {0, 26, 31}, + {0, 14, 15}, + {0, 28, 37}, + {0, 1, 23}, + {0, 39, 38}, + {0, 12, 40}, + {0, 22, 41}, + {0, 10, 16}, + {0, 43, 42}, + {0, 29, 44}, + {0, 2, 45}, + {0, 46, 19}, + {0, 48, 47}, + {0, 18, 49}, + {0, 50, 30}, + {0, 9, 33}, + {0, 52, 51}, + {0, 54, 53}, + {0, 13, 55}, + {0, 17, 56}, + {0, 5, 57}, + {0, 59, 58}, + {0, 60, 20}, + {0, 62, 61}, + {0, 64, 63}, + })); + + codecs.emplace(std::pair(SpvOpTypePointer, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(99, { + {0, 0, 0}, + {75986790, 0, 0}, + {95470391, 0, 0}, + {170378107, 0, 0}, + {172029722, 0, 0}, + {204234270, 0, 0}, + {205885885, 0, 0}, + {244668133, 0, 0}, + {265778447, 0, 0}, + {616435646, 0, 0}, + {618087261, 0, 0}, + {753954113, 0, 0}, + {1000070091, 0, 0}, + {1308462133, 0, 0}, + {1671139745, 0, 0}, + {1774874546, 0, 0}, + {1776526161, 0, 0}, + {1887808856, 0, 0}, + {1889460471, 0, 0}, + {1917966999, 0, 0}, + {2044728014, 0, 0}, + {2192810893, 0, 0}, + {2293247016, 0, 0}, + {2503194620, 0, 0}, + {2605012269, 0, 0}, + {2608484640, 0, 0}, + {2615111110, 0, 0}, + {2668769415, 0, 0}, + {2759951687, 0, 0}, + {2761603302, 0, 0}, + {2856623532, 0, 0}, + {2945369269, 0, 0}, + {2956189845, 0, 0}, + {3085119011, 0, 0}, + {3367313400, 0, 0}, + {3447882276, 0, 0}, + {3633746133, 0, 0}, + {3635397748, 0, 0}, + {3710645347, 0, 0}, + {3712296962, 0, 0}, + {3715846592, 0, 0}, + {3727494858, 0, 0}, + {3747079365, 0, 0}, + {3748965853, 0, 0}, + {3750617468, 0, 0}, + {4018820793, 0, 0}, + {4022124023, 0, 0}, + {4024173916, 0, 0}, + {4215670524, 0, 0}, + {4217322139, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 10, 9}, + {0, 31, 24}, + {0, 40, 13}, + {0, 45, 33}, + {0, 34, 46}, + {0, 43, 38}, + {0, 44, 15}, + {0, 11, 30}, + {0, 21, 6}, + {0, 47, 3}, + {0, 51, 16}, + {0, 14, 52}, + {0, 8, 53}, + {0, 35, 5}, + {0, 55, 54}, + {0, 56, 26}, + {0, 20, 57}, + {0, 39, 19}, + {0, 59, 58}, + {0, 61, 60}, + {0, 4, 62}, + {0, 2, 63}, + {0, 25, 7}, + {0, 64, 27}, + {0, 12, 22}, + {0, 65, 48}, + {0, 41, 42}, + {0, 17, 23}, + {0, 49, 66}, + {0, 68, 67}, + {0, 70, 69}, + {0, 72, 71}, + {0, 74, 73}, + {0, 18, 75}, + {0, 37, 32}, + {0, 76, 36}, + {0, 78, 77}, + {0, 79, 28}, + {0, 81, 80}, + {0, 82, 29}, + {0, 84, 83}, + {0, 86, 85}, + {0, 88, 87}, + {0, 90, 89}, + {0, 91, 50}, + {0, 93, 92}, + {0, 95, 94}, + {0, 1, 96}, + {0, 98, 97}, + })); + + codecs.emplace(std::pair(SpvOpTypeFunction, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(27, { + {0, 0, 0}, + {545678922, 0, 0}, + {679771963, 0, 0}, + {899570100, 0, 0}, + {929101967, 0, 0}, + {1100599986, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3056042030, 0, 0}, + {3334207724, 0, 0}, + {3357250579, 0, 0}, + {3705139860, 0, 0}, + {3800912395, 0, 0}, + {3802564010, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 5, 3}, + {0, 10, 13}, + {0, 4, 15}, + {0, 16, 11}, + {0, 17, 1}, + {0, 14, 12}, + {0, 19, 18}, + {0, 21, 20}, + {0, 7, 6}, + {0, 9, 22}, + {0, 24, 23}, + {0, 25, 2}, + {0, 26, 8}, + })); + + codecs.emplace(std::pair(SpvOpTypeFunction, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(57, { + {0, 0, 0}, + {283209196, 0, 0}, + {436416061, 0, 0}, + {679771963, 0, 0}, + {789872778, 0, 0}, + {815757910, 0, 0}, + {827698488, 0, 0}, + {1164221089, 0, 0}, + {1294403159, 0, 0}, + {1296054774, 0, 0}, + {1297706389, 0, 0}, + {1525861001, 0, 0}, + {1579585816, 0, 0}, + {1675764636, 0, 0}, + {1824016656, 0, 0}, + {1951208733, 0, 0}, + {1991787192, 0, 0}, + {2180701723, 0, 0}, + {2194691858, 0, 0}, + {2320303498, 0, 0}, + {2881886868, 0, 0}, + {2926633629, 0, 0}, + {3249265647, 0, 0}, + {3334207724, 0, 0}, + {3472123498, 0, 0}, + {3674863070, 0, 0}, + {4050155669, 0, 0}, + {4141567741, 0, 0}, + {4155122613, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 24, 7}, + {0, 17, 1}, + {0, 4, 15}, + {0, 11, 16}, + {0, 28, 30}, + {0, 25, 20}, + {0, 14, 31}, + {0, 32, 26}, + {0, 12, 5}, + {0, 2, 22}, + {0, 33, 13}, + {0, 35, 34}, + {0, 37, 36}, + {0, 39, 38}, + {0, 40, 21}, + {0, 29, 18}, + {0, 27, 41}, + {0, 43, 42}, + {0, 19, 44}, + {0, 45, 23}, + {0, 6, 3}, + {0, 47, 46}, + {0, 49, 48}, + {0, 51, 50}, + {0, 10, 8}, + {0, 53, 52}, + {0, 9, 54}, + {0, 56, 55}, + })); + + codecs.emplace(std::pair(SpvOpTypeFunction, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(17, { + {0, 0, 0}, + {679771963, 0, 0}, + {827698488, 0, 0}, + {1294403159, 0, 0}, + {1296054774, 0, 0}, + {1297706389, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 8, 9}, + {0, 10, 6}, + {0, 1, 5}, + {0, 11, 3}, + {0, 12, 7}, + {0, 13, 2}, + {0, 15, 14}, + {0, 16, 4}, + })); + + codecs.emplace(std::pair(SpvOpTypeFunction, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(17, { + {0, 0, 0}, + {679771963, 0, 0}, + {827698488, 0, 0}, + {1294403159, 0, 0}, + {1296054774, 0, 0}, + {1951208733, 0, 0}, + {2194691858, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 8, 5}, + {0, 10, 9}, + {0, 11, 6}, + {0, 7, 12}, + {0, 1, 3}, + {0, 2, 13}, + {0, 15, 14}, + {0, 4, 16}, + })); + + codecs.emplace(std::pair(SpvOpTypeFunction, 4), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(11, { + {0, 0, 0}, + {827698488, 0, 0}, + {1294403159, 0, 0}, + {1296054774, 0, 0}, + {1297706389, 0, 0}, + {1951208733, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 6}, + {0, 5, 7}, + {0, 2, 8}, + {0, 1, 9}, + {0, 10, 3}, + })); + + codecs.emplace(std::pair(SpvOpTypeFunction, 5), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(11, { + {0, 0, 0}, + {827698488, 0, 0}, + {1294403159, 0, 0}, + {1296054774, 0, 0}, + {1951208733, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 6}, + {0, 4, 7}, + {0, 8, 5}, + {0, 3, 9}, + {0, 1, 10}, + })); + + codecs.emplace(std::pair(SpvOpTypeFunction, 6), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {789872778, 0, 0}, + {827698488, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 5, 1}, + {0, 4, 6}, + {0, 3, 7}, + {0, 2, 8}, + })); + + codecs.emplace(std::pair(SpvOpTypeFunction, 7), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {543621065, 0, 0}, + {827698488, 0, 0}, + {1951208733, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 4}, + {0, 1, 5}, + {0, 2, 6}, + })); + + codecs.emplace(std::pair(SpvOpTypeFunction, 8), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {827698488, 0, 0}, + {1951208733, 0, 0}, + {3095831808, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 4}, + {0, 3, 5}, + {0, 1, 6}, + })); + + codecs.emplace(std::pair(SpvOpTypeFunction, 9), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {1296054774, 0, 0}, + {1951208733, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 2}, + {0, 1, 4}, + })); + + codecs.emplace(std::pair(SpvOpTypeFunction, 10), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {1296054774, 0, 0}, + {2320303498, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 2}, + {0, 1, 4}, + })); + + codecs.emplace(std::pair(SpvOpTypeFunction, 11), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {789872778, 0, 0}, + {1951208733, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 2}, + {0, 4, 1}, + })); + + codecs.emplace(std::pair(SpvOpTypeFunction, 12), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {789872778, 0, 0}, + {1951208733, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 1}, + {0, 4, 3}, + })); + + codecs.emplace(std::pair(SpvOpTypeFunction, 13), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {1951208733, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 1}, + })); + + codecs.emplace(std::pair(SpvOpTypeFunction, 14), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {1951208733, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 1}, + })); + + codecs.emplace(std::pair(SpvOpTypeFunction, 15), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {789872778, 0, 0}, + {1951208733, 0, 0}, + {2430404313, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 4}, + {0, 1, 5}, + {0, 2, 6}, + })); + + codecs.emplace(std::pair(SpvOpConstant, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(183, { + {0, 0, 0}, + {51041423, 0, 0}, + {52882140, 0, 0}, + {72782198, 0, 0}, + {142465290, 0, 0}, + {144116905, 0, 0}, + {158160339, 0, 0}, + {169135842, 0, 0}, + {210116709, 0, 0}, + {290391815, 0, 0}, + {296981500, 0, 0}, + {385229009, 0, 0}, + {438318340, 0, 0}, + {529742207, 0, 0}, + {628331516, 0, 0}, + {677668732, 0, 0}, + {778500192, 0, 0}, + {825595257, 0, 0}, + {910398460, 0, 0}, + {917019124, 0, 0}, + {959681532, 0, 0}, + {1031290113, 0, 0}, + {1039111164, 0, 0}, + {1064945649, 0, 0}, + {1087394637, 0, 0}, + {1092948665, 0, 0}, + {1156369516, 0, 0}, + {1158021131, 0, 0}, + {1172110445, 0, 0}, + {1304296041, 0, 0}, + {1400019344, 0, 0}, + {1450415100, 0, 0}, + {1452222566, 0, 0}, + {1543646433, 0, 0}, + {1543672828, 0, 0}, + {1612361408, 0, 0}, + {1622381564, 0, 0}, + {1691572958, 0, 0}, + {1755648697, 0, 0}, + {1782996825, 0, 0}, + {1784648440, 0, 0}, + {1930923350, 0, 0}, + {1939359710, 0, 0}, + {1971252067, 0, 0}, + {1979847999, 0, 0}, + {2078849875, 0, 0}, + {2113115132, 0, 0}, + {2135340676, 0, 0}, + {2170273742, 0, 0}, + {2268204687, 0, 0}, + {2285081596, 0, 0}, + {2318200267, 0, 0}, + {2321729979, 0, 0}, + {2326636627, 0, 0}, + {2444465148, 0, 0}, + {2466126792, 0, 0}, + {2490492987, 0, 0}, + {2524697596, 0, 0}, + {2557550659, 0, 0}, + {2678954464, 0, 0}, + {2705477184, 0, 0}, + {2715370488, 0, 0}, + {2732195517, 0, 0}, + {2775815164, 0, 0}, + {2796901051, 0, 0}, + {2798552666, 0, 0}, + {2855506940, 0, 0}, + {2860348412, 0, 0}, + {2922615804, 0, 0}, + {2937761472, 0, 0}, + {2944827576, 0, 0}, + {3092754101, 0, 0}, + {3107165180, 0, 0}, + {3168953855, 0, 0}, + {3184177968, 0, 0}, + {3202349435, 0, 0}, + {3266548732, 0, 0}, + {3332104493, 0, 0}, + {3362723943, 0, 0}, + {3571454885, 0, 0}, + {3712763835, 0, 0}, + {3743748793, 0, 0}, + {3810805277, 0, 0}, + {3912967080, 0, 0}, + {3929248764, 0, 0}, + {3958731802, 0, 0}, + {3997952447, 0, 0}, + {4016096296, 0, 0}, + {4106658327, 0, 0}, + {4172568578, 0, 0}, + {4198082194, 0, 0}, + {4248015868, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 35, 16}, + {0, 49, 42}, + {0, 86, 69}, + {0, 53, 30}, + {0, 45, 89}, + {0, 50, 68}, + {0, 73, 71}, + {0, 17, 46}, + {0, 14, 81}, + {0, 63, 44}, + {0, 12, 3}, + {0, 72, 31}, + {0, 55, 67}, + {0, 36, 19}, + {0, 22, 88}, + {0, 9, 70}, + {0, 93, 23}, + {0, 95, 94}, + {0, 47, 91}, + {0, 34, 32}, + {0, 97, 96}, + {0, 41, 61}, + {0, 99, 98}, + {0, 37, 1}, + {0, 77, 100}, + {0, 51, 60}, + {0, 101, 79}, + {0, 6, 2}, + {0, 11, 7}, + {0, 24, 21}, + {0, 43, 28}, + {0, 59, 56}, + {0, 75, 62}, + {0, 80, 78}, + {0, 87, 83}, + {0, 18, 15}, + {0, 102, 38}, + {0, 104, 103}, + {0, 85, 90}, + {0, 76, 25}, + {0, 29, 105}, + {0, 107, 106}, + {0, 58, 52}, + {0, 109, 108}, + {0, 57, 110}, + {0, 112, 111}, + {0, 114, 113}, + {0, 115, 33}, + {0, 74, 116}, + {0, 118, 117}, + {0, 120, 119}, + {0, 122, 121}, + {0, 124, 123}, + {0, 126, 125}, + {0, 128, 127}, + {0, 130, 129}, + {0, 131, 13}, + {0, 54, 27}, + {0, 133, 132}, + {0, 48, 40}, + {0, 5, 8}, + {0, 82, 134}, + {0, 26, 135}, + {0, 39, 4}, + {0, 136, 64}, + {0, 138, 137}, + {0, 140, 139}, + {0, 84, 141}, + {0, 143, 142}, + {0, 145, 144}, + {0, 147, 146}, + {0, 149, 148}, + {0, 20, 150}, + {0, 65, 151}, + {0, 66, 152}, + {0, 153, 10}, + {0, 155, 154}, + {0, 157, 156}, + {0, 159, 158}, + {0, 161, 160}, + {0, 163, 162}, + {0, 165, 164}, + {0, 167, 166}, + {0, 169, 168}, + {0, 170, 92}, + {0, 172, 171}, + {0, 174, 173}, + {0, 176, 175}, + {0, 178, 177}, + {0, 180, 179}, + {0, 182, 181}, + })); + + codecs.emplace(std::pair(SpvOpConstant, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {679771963, 0, 0}, + {1247793383, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 5}, + {0, 4, 6}, + {0, 1, 3}, + {0, 8, 7}, + })); + + codecs.emplace(std::pair(SpvOpConstantComposite, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(83, { + {0, 0, 0}, + {15502752, 0, 0}, + {46736908, 0, 0}, + {139011596, 0, 0}, + {149720480, 0, 0}, + {249378857, 0, 0}, + {251209228, 0, 0}, + {503145996, 0, 0}, + {836581417, 0, 0}, + {882718761, 0, 0}, + {1289566249, 0, 0}, + {1325348861, 0, 0}, + {1558001705, 0, 0}, + {1646147798, 0, 0}, + {1679946323, 0, 0}, + {1766401548, 0, 0}, + {1992893964, 0, 0}, + {2123388694, 0, 0}, + {2162986400, 0, 0}, + {2580096524, 0, 0}, + {2598189097, 0, 0}, + {2683080096, 0, 0}, + {2698156268, 0, 0}, + {2763960513, 0, 0}, + {3015046341, 0, 0}, + {3133016299, 0, 0}, + {3251128023, 0, 0}, + {3504158761, 0, 0}, + {3535289452, 0, 0}, + {3536941067, 0, 0}, + {3538592682, 0, 0}, + {3540244297, 0, 0}, + {3541895912, 0, 0}, + {3570219049, 0, 0}, + {3653838348, 0, 0}, + {3764205609, 0, 0}, + {3882634684, 0, 0}, + {3913885196, 0, 0}, + {3982047273, 0, 0}, + {4024252457, 0, 0}, + {4243119782, 0, 0}, + {4255182614, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 8, 4}, + {0, 39, 2}, + {0, 38, 10}, + {0, 29, 41}, + {0, 23, 28}, + {0, 9, 24}, + {0, 44, 43}, + {0, 45, 6}, + {0, 20, 12}, + {0, 18, 33}, + {0, 19, 16}, + {0, 7, 46}, + {0, 48, 47}, + {0, 5, 49}, + {0, 13, 11}, + {0, 17, 14}, + {0, 25, 22}, + {0, 40, 36}, + {0, 1, 50}, + {0, 31, 30}, + {0, 51, 32}, + {0, 42, 52}, + {0, 54, 53}, + {0, 55, 15}, + {0, 37, 56}, + {0, 57, 34}, + {0, 59, 58}, + {0, 61, 60}, + {0, 35, 21}, + {0, 62, 26}, + {0, 64, 63}, + {0, 65, 27}, + {0, 3, 66}, + {0, 68, 67}, + {0, 70, 69}, + {0, 72, 71}, + {0, 74, 73}, + {0, 76, 75}, + {0, 78, 77}, + {0, 80, 79}, + {0, 82, 81}, + })); + + codecs.emplace(std::pair(SpvOpConstantComposite, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(65, { + {0, 0, 0}, + {142465290, 0, 0}, + {158160339, 0, 0}, + {169135842, 0, 0}, + {210116709, 0, 0}, + {296981500, 0, 0}, + {615748604, 0, 0}, + {910398460, 0, 0}, + {959681532, 0, 0}, + {1039111164, 0, 0}, + {1087394637, 0, 0}, + {1156369516, 0, 0}, + {1450415100, 0, 0}, + {1543672828, 0, 0}, + {2100532220, 0, 0}, + {2170273742, 0, 0}, + {2285081596, 0, 0}, + {2326636627, 0, 0}, + {2444465148, 0, 0}, + {2732195517, 0, 0}, + {2763232252, 0, 0}, + {2796901051, 0, 0}, + {2855506940, 0, 0}, + {2922615804, 0, 0}, + {2937761472, 0, 0}, + {3202349435, 0, 0}, + {3362723943, 0, 0}, + {3712763835, 0, 0}, + {3810805277, 0, 0}, + {3929248764, 0, 0}, + {4016096296, 0, 0}, + {4172568578, 0, 0}, + {4248015868, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 12, 23}, + {0, 13, 6}, + {0, 20, 14}, + {0, 15, 24}, + {0, 17, 28}, + {0, 16, 31}, + {0, 7, 34}, + {0, 9, 32}, + {0, 36, 35}, + {0, 38, 37}, + {0, 40, 39}, + {0, 2, 8}, + {0, 10, 3}, + {0, 25, 19}, + {0, 27, 26}, + {0, 33, 30}, + {0, 11, 41}, + {0, 1, 21}, + {0, 18, 42}, + {0, 44, 43}, + {0, 46, 45}, + {0, 48, 47}, + {0, 29, 49}, + {0, 4, 50}, + {0, 52, 51}, + {0, 54, 53}, + {0, 56, 55}, + {0, 58, 57}, + {0, 59, 5}, + {0, 61, 60}, + {0, 62, 22}, + {0, 64, 63}, + })); + + codecs.emplace(std::pair(SpvOpConstantComposite, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(57, { + {0, 0, 0}, + {52882140, 0, 0}, + {210116709, 0, 0}, + {296981500, 0, 0}, + {385229009, 0, 0}, + {615748604, 0, 0}, + {910398460, 0, 0}, + {959681532, 0, 0}, + {1031290113, 0, 0}, + {1039111164, 0, 0}, + {1172110445, 0, 0}, + {1450415100, 0, 0}, + {1543672828, 0, 0}, + {1622381564, 0, 0}, + {1782996825, 0, 0}, + {1971252067, 0, 0}, + {2100532220, 0, 0}, + {2268204687, 0, 0}, + {2326636627, 0, 0}, + {2444465148, 0, 0}, + {2490492987, 0, 0}, + {2678954464, 0, 0}, + {2763232252, 0, 0}, + {2855506940, 0, 0}, + {2922615804, 0, 0}, + {3912967080, 0, 0}, + {3929248764, 0, 0}, + {4172568578, 0, 0}, + {4248015868, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 11, 24}, + {0, 12, 5}, + {0, 22, 16}, + {0, 18, 17}, + {0, 30, 27}, + {0, 6, 13}, + {0, 9, 28}, + {0, 32, 31}, + {0, 34, 33}, + {0, 7, 35}, + {0, 4, 1}, + {0, 10, 8}, + {0, 20, 15}, + {0, 25, 21}, + {0, 36, 29}, + {0, 19, 37}, + {0, 39, 38}, + {0, 41, 40}, + {0, 43, 42}, + {0, 26, 44}, + {0, 45, 2}, + {0, 47, 46}, + {0, 49, 48}, + {0, 50, 14}, + {0, 51, 3}, + {0, 53, 52}, + {0, 54, 23}, + {0, 56, 55}, + })); + + codecs.emplace(std::pair(SpvOpConstantComposite, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(39, { + {0, 0, 0}, + {210116709, 0, 0}, + {296981500, 0, 0}, + {615748604, 0, 0}, + {910398460, 0, 0}, + {959681532, 0, 0}, + {1039111164, 0, 0}, + {1092948665, 0, 0}, + {1450415100, 0, 0}, + {1543672828, 0, 0}, + {1612361408, 0, 0}, + {2100532220, 0, 0}, + {2326636627, 0, 0}, + {2444465148, 0, 0}, + {2524697596, 0, 0}, + {2763232252, 0, 0}, + {2855506940, 0, 0}, + {3929248764, 0, 0}, + {4172568578, 0, 0}, + {4248015868, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 8, 7}, + {0, 9, 3}, + {0, 15, 11}, + {0, 10, 21}, + {0, 18, 12}, + {0, 4, 20}, + {0, 22, 19}, + {0, 23, 6}, + {0, 14, 24}, + {0, 5, 25}, + {0, 27, 26}, + {0, 28, 17}, + {0, 30, 29}, + {0, 31, 13}, + {0, 1, 32}, + {0, 34, 33}, + {0, 16, 35}, + {0, 2, 36}, + {0, 38, 37}, + })); + + codecs.emplace(std::pair(SpvOpConstantComposite, 4), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(35, { + {0, 0, 0}, + {296981500, 0, 0}, + {615748604, 0, 0}, + {673708384, 0, 0}, + {959681532, 0, 0}, + {1039111164, 0, 0}, + {1450415100, 0, 0}, + {1543672828, 0, 0}, + {1939359710, 0, 0}, + {2100532220, 0, 0}, + {2113115132, 0, 0}, + {2326636627, 0, 0}, + {2444465148, 0, 0}, + {2763232252, 0, 0}, + {2855506940, 0, 0}, + {3929248764, 0, 0}, + {4172568578, 0, 0}, + {4248015868, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 18, 3}, + {0, 6, 19}, + {0, 12, 4}, + {0, 17, 2}, + {0, 9, 7}, + {0, 20, 13}, + {0, 11, 8}, + {0, 10, 16}, + {0, 21, 15}, + {0, 5, 22}, + {0, 24, 23}, + {0, 26, 25}, + {0, 28, 27}, + {0, 29, 1}, + {0, 31, 30}, + {0, 33, 32}, + {0, 34, 14}, + })); + + codecs.emplace(std::pair(SpvOpConstantComposite, 5), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(23, { + {0, 0, 0}, + {545678922, 0, 0}, + {679771963, 0, 0}, + {929101967, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3056042030, 0, 0}, + {3334207724, 0, 0}, + {3357250579, 0, 0}, + {3705139860, 0, 0}, + {3800912395, 0, 0}, + {3802564010, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 8, 11}, + {0, 9, 3}, + {0, 1, 13}, + {0, 14, 10}, + {0, 12, 15}, + {0, 17, 16}, + {0, 18, 4}, + {0, 7, 5}, + {0, 20, 19}, + {0, 2, 21}, + {0, 22, 6}, + })); + + codecs.emplace(std::pair(SpvOpFunction, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(89, { + {0, 0, 0}, + {35240468, 0, 0}, + {123060826, 0, 0}, + {184634770, 0, 0}, + {359054425, 0, 0}, + {459968607, 0, 0}, + {619875033, 0, 0}, + {904486530, 0, 0}, + {945128292, 0, 0}, + {950731750, 0, 0}, + {1058429216, 0, 0}, + {1182296898, 0, 0}, + {1238120570, 0, 0}, + {1429389803, 0, 0}, + {1652168174, 0, 0}, + {1717510093, 0, 0}, + {1766422419, 0, 0}, + {1775308984, 0, 0}, + {1776629361, 0, 0}, + {1824526196, 0, 0}, + {1957265068, 0, 0}, + {1998433745, 0, 0}, + {2055664760, 0, 0}, + {2303184249, 0, 0}, + {2451531615, 0, 0}, + {2507457870, 0, 0}, + {2550501832, 0, 0}, + {2590402790, 0, 0}, + {2649103430, 0, 0}, + {2780190687, 0, 0}, + {2831059514, 0, 0}, + {3167253437, 0, 0}, + {3269075805, 0, 0}, + {3323202731, 0, 0}, + {3361419439, 0, 0}, + {3464197236, 0, 0}, + {3472029049, 0, 0}, + {3518630848, 0, 0}, + {3604842236, 0, 0}, + {3653985133, 0, 0}, + {4091916710, 0, 0}, + {4121643374, 0, 0}, + {4185590212, 0, 0}, + {4233562270, 0, 0}, + {4235213885, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 6, 40}, + {0, 14, 31}, + {0, 7, 9}, + {0, 29, 27}, + {0, 18, 44}, + {0, 8, 5}, + {0, 10, 3}, + {0, 41, 37}, + {0, 42, 35}, + {0, 2, 1}, + {0, 47, 46}, + {0, 48, 4}, + {0, 11, 49}, + {0, 50, 36}, + {0, 19, 51}, + {0, 53, 52}, + {0, 55, 54}, + {0, 15, 12}, + {0, 26, 16}, + {0, 56, 21}, + {0, 25, 33}, + {0, 43, 24}, + {0, 57, 39}, + {0, 59, 58}, + {0, 61, 60}, + {0, 62, 34}, + {0, 64, 63}, + {0, 17, 30}, + {0, 66, 65}, + {0, 20, 67}, + {0, 13, 68}, + {0, 28, 69}, + {0, 70, 32}, + {0, 72, 71}, + {0, 73, 22}, + {0, 75, 74}, + {0, 77, 76}, + {0, 79, 78}, + {0, 80, 23}, + {0, 45, 81}, + {0, 83, 82}, + {0, 85, 84}, + {0, 38, 86}, + {0, 88, 87}, + })); + + codecs.emplace(std::pair(SpvOpFunction, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(87, { + {0, 0, 0}, + {75986790, 0, 0}, + {95470391, 0, 0}, + {170378107, 0, 0}, + {172029722, 0, 0}, + {204234270, 0, 0}, + {205885885, 0, 0}, + {244668133, 0, 0}, + {265778447, 0, 0}, + {753954113, 0, 0}, + {1000070091, 0, 0}, + {1671139745, 0, 0}, + {1774874546, 0, 0}, + {1776526161, 0, 0}, + {1887808856, 0, 0}, + {1889460471, 0, 0}, + {1917966999, 0, 0}, + {2044728014, 0, 0}, + {2192810893, 0, 0}, + {2293247016, 0, 0}, + {2503194620, 0, 0}, + {2608484640, 0, 0}, + {2615111110, 0, 0}, + {2668769415, 0, 0}, + {2759951687, 0, 0}, + {2761603302, 0, 0}, + {2856623532, 0, 0}, + {2956189845, 0, 0}, + {3085119011, 0, 0}, + {3367313400, 0, 0}, + {3447882276, 0, 0}, + {3633746133, 0, 0}, + {3635397748, 0, 0}, + {3710645347, 0, 0}, + {3712296962, 0, 0}, + {3727494858, 0, 0}, + {3747079365, 0, 0}, + {3748965853, 0, 0}, + {3750617468, 0, 0}, + {4018820793, 0, 0}, + {4022124023, 0, 0}, + {4024173916, 0, 0}, + {4215670524, 0, 0}, + {4217322139, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 39, 28}, + {0, 29, 40}, + {0, 37, 33}, + {0, 38, 12}, + {0, 9, 26}, + {0, 18, 6}, + {0, 41, 3}, + {0, 11, 13}, + {0, 5, 8}, + {0, 45, 30}, + {0, 22, 46}, + {0, 48, 47}, + {0, 16, 17}, + {0, 34, 49}, + {0, 51, 50}, + {0, 53, 52}, + {0, 7, 2}, + {0, 23, 21}, + {0, 54, 10}, + {0, 20, 36}, + {0, 55, 35}, + {0, 56, 4}, + {0, 43, 57}, + {0, 59, 58}, + {0, 60, 42}, + {0, 62, 61}, + {0, 63, 15}, + {0, 64, 31}, + {0, 14, 65}, + {0, 66, 24}, + {0, 67, 32}, + {0, 68, 19}, + {0, 70, 69}, + {0, 71, 27}, + {0, 73, 72}, + {0, 75, 74}, + {0, 77, 76}, + {0, 78, 25}, + {0, 44, 79}, + {0, 81, 80}, + {0, 83, 82}, + {0, 1, 84}, + {0, 86, 85}, + })); + + codecs.emplace(std::pair(SpvOpFunction, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(41, { + {0, 0, 0}, + {436416061, 0, 0}, + {543621065, 0, 0}, + {679771963, 0, 0}, + {815757910, 0, 0}, + {827698488, 0, 0}, + {1294403159, 0, 0}, + {1296054774, 0, 0}, + {1297706389, 0, 0}, + {1579585816, 0, 0}, + {1675764636, 0, 0}, + {1824016656, 0, 0}, + {1951208733, 0, 0}, + {2194691858, 0, 0}, + {2320303498, 0, 0}, + {2926633629, 0, 0}, + {3095831808, 0, 0}, + {3249265647, 0, 0}, + {3334207724, 0, 0}, + {4050155669, 0, 0}, + {4141567741, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 11}, + {0, 19, 16}, + {0, 9, 4}, + {0, 1, 17}, + {0, 22, 10}, + {0, 24, 23}, + {0, 15, 25}, + {0, 13, 26}, + {0, 27, 20}, + {0, 12, 28}, + {0, 30, 29}, + {0, 31, 18}, + {0, 3, 21}, + {0, 32, 14}, + {0, 34, 33}, + {0, 35, 8}, + {0, 5, 6}, + {0, 37, 36}, + {0, 39, 38}, + {0, 40, 7}, + })); + + codecs.emplace(std::pair(SpvOpFunctionParameter, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(41, { + {0, 0, 0}, + {522971108, 0, 0}, + {615341051, 0, 0}, + {718301639, 0, 0}, + {985750227, 0, 0}, + {1395113939, 0, 0}, + {1510333659, 0, 0}, + {1642805350, 0, 0}, + {1846856260, 0, 0}, + {1957218950, 0, 0}, + {1977038330, 0, 0}, + {1978689945, 0, 0}, + {1980341560, 0, 0}, + {2262220987, 0, 0}, + {2674422363, 0, 0}, + {3197739982, 0, 0}, + {3465954368, 0, 0}, + {3941049054, 0, 0}, + {3945795573, 0, 0}, + {4080527786, 0, 0}, + {4154758669, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 17}, + {0, 4, 15}, + {0, 8, 7}, + {0, 2, 20}, + {0, 22, 19}, + {0, 24, 23}, + {0, 14, 25}, + {0, 16, 26}, + {0, 27, 13}, + {0, 6, 28}, + {0, 30, 29}, + {0, 31, 10}, + {0, 11, 21}, + {0, 32, 12}, + {0, 34, 33}, + {0, 35, 5}, + {0, 9, 18}, + {0, 37, 36}, + {0, 39, 38}, + {0, 40, 1}, + })); + + codecs.emplace(std::pair(SpvOpFunctionParameter, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(27, { + {0, 0, 0}, + {545678922, 0, 0}, + {679771963, 0, 0}, + {899570100, 0, 0}, + {929101967, 0, 0}, + {1100599986, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3056042030, 0, 0}, + {3334207724, 0, 0}, + {3357250579, 0, 0}, + {3705139860, 0, 0}, + {3800912395, 0, 0}, + {3802564010, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 5, 3}, + {0, 10, 13}, + {0, 4, 15}, + {0, 16, 11}, + {0, 17, 1}, + {0, 14, 12}, + {0, 19, 18}, + {0, 21, 20}, + {0, 22, 8}, + {0, 7, 6}, + {0, 23, 9}, + {0, 25, 24}, + {0, 26, 2}, + })); + + codecs.emplace(std::pair(SpvOpFunctionCall, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(115, { + {0, 0, 0}, + {57149555, 0, 0}, + {86116519, 0, 0}, + {168339452, 0, 0}, + {181902171, 0, 0}, + {284226441, 0, 0}, + {314809953, 0, 0}, + {330249537, 0, 0}, + {527665290, 0, 0}, + {545363837, 0, 0}, + {707478563, 0, 0}, + {740921498, 0, 0}, + {807276090, 0, 0}, + {824323032, 0, 0}, + {835458563, 0, 0}, + {1162127370, 0, 0}, + {1245448751, 0, 0}, + {1277245109, 0, 0}, + {1375043498, 0, 0}, + {1380991098, 0, 0}, + {1603937321, 0, 0}, + {1708264968, 0, 0}, + {1717555224, 0, 0}, + {1765126703, 0, 0}, + {1838993983, 0, 0}, + {1949856502, 0, 0}, + {2108571893, 0, 0}, + {2110223508, 0, 0}, + {2293637521, 0, 0}, + {2377112119, 0, 0}, + {2378763734, 0, 0}, + {2512398201, 0, 0}, + {2516325050, 0, 0}, + {2645135839, 0, 0}, + {2708915136, 0, 0}, + {2894979602, 0, 0}, + {2903897222, 0, 0}, + {2976581453, 0, 0}, + {3054834317, 0, 0}, + {3075866530, 0, 0}, + {3085157904, 0, 0}, + {3242843022, 0, 0}, + {3266028549, 0, 0}, + {3296691317, 0, 0}, + {3299488628, 0, 0}, + {3322500634, 0, 0}, + {3345707173, 0, 0}, + {3536390697, 0, 0}, + {3584683259, 0, 0}, + {3647606635, 0, 0}, + {3760372982, 0, 0}, + {3823959661, 0, 0}, + {3839389658, 0, 0}, + {4124281183, 0, 0}, + {4130950286, 0, 0}, + {4169878842, 0, 0}, + {4174489262, 0, 0}, + {4237497041, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 17, 23}, + {0, 37, 8}, + {0, 45, 39}, + {0, 41, 14}, + {0, 48, 43}, + {0, 40, 31}, + {0, 19, 29}, + {0, 53, 26}, + {0, 10, 5}, + {0, 50, 24}, + {0, 27, 3}, + {0, 59, 32}, + {0, 51, 18}, + {0, 52, 55}, + {0, 60, 57}, + {0, 62, 61}, + {0, 36, 33}, + {0, 64, 63}, + {0, 65, 22}, + {0, 66, 46}, + {0, 6, 67}, + {0, 68, 13}, + {0, 21, 44}, + {0, 1, 69}, + {0, 30, 11}, + {0, 71, 70}, + {0, 12, 72}, + {0, 74, 73}, + {0, 76, 75}, + {0, 16, 2}, + {0, 49, 35}, + {0, 77, 9}, + {0, 42, 28}, + {0, 15, 78}, + {0, 80, 79}, + {0, 82, 81}, + {0, 47, 83}, + {0, 85, 84}, + {0, 87, 86}, + {0, 89, 88}, + {0, 20, 38}, + {0, 54, 90}, + {0, 34, 91}, + {0, 93, 92}, + {0, 25, 94}, + {0, 95, 7}, + {0, 97, 96}, + {0, 56, 98}, + {0, 100, 99}, + {0, 102, 101}, + {0, 104, 103}, + {0, 4, 105}, + {0, 107, 106}, + {0, 58, 108}, + {0, 110, 109}, + {0, 112, 111}, + {0, 114, 113}, + })); + + codecs.emplace(std::pair(SpvOpFunctionCall, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(81, { + {0, 0, 0}, + {35240468, 0, 0}, + {36096192, 0, 0}, + {123060826, 0, 0}, + {184634770, 0, 0}, + {459968607, 0, 0}, + {619875033, 0, 0}, + {950731750, 0, 0}, + {1058429216, 0, 0}, + {1182296898, 0, 0}, + {1238120570, 0, 0}, + {1271484400, 0, 0}, + {1429389803, 0, 0}, + {1717510093, 0, 0}, + {1766422419, 0, 0}, + {1775308984, 0, 0}, + {1817271123, 0, 0}, + {1917336504, 0, 0}, + {1957265068, 0, 0}, + {1998433745, 0, 0}, + {2055664760, 0, 0}, + {2303184249, 0, 0}, + {2308565678, 0, 0}, + {2451531615, 0, 0}, + {2496297824, 0, 0}, + {2507457870, 0, 0}, + {2550501832, 0, 0}, + {2590402790, 0, 0}, + {2649103430, 0, 0}, + {2831059514, 0, 0}, + {2836440943, 0, 0}, + {3269075805, 0, 0}, + {3361419439, 0, 0}, + {3457269042, 0, 0}, + {3464197236, 0, 0}, + {3472029049, 0, 0}, + {3518630848, 0, 0}, + {3587381650, 0, 0}, + {3653985133, 0, 0}, + {4185590212, 0, 0}, + {4233562270, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 40, 37}, + {0, 22, 30}, + {0, 2, 7}, + {0, 24, 11}, + {0, 16, 33}, + {0, 6, 34}, + {0, 42, 27}, + {0, 5, 43}, + {0, 4, 44}, + {0, 36, 8}, + {0, 39, 45}, + {0, 46, 1}, + {0, 3, 47}, + {0, 48, 23}, + {0, 49, 9}, + {0, 50, 35}, + {0, 52, 51}, + {0, 32, 53}, + {0, 13, 10}, + {0, 26, 14}, + {0, 19, 54}, + {0, 55, 25}, + {0, 56, 38}, + {0, 17, 57}, + {0, 59, 58}, + {0, 61, 60}, + {0, 62, 29}, + {0, 12, 15}, + {0, 18, 63}, + {0, 28, 64}, + {0, 65, 31}, + {0, 67, 66}, + {0, 20, 41}, + {0, 69, 68}, + {0, 71, 70}, + {0, 21, 72}, + {0, 74, 73}, + {0, 76, 75}, + {0, 78, 77}, + {0, 80, 79}, + })); + + codecs.emplace(std::pair(SpvOpFunctionCall, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(61, { + {0, 0, 0}, + {37459569, 0, 0}, + {162167595, 0, 0}, + {535067202, 0, 0}, + {701281393, 0, 0}, + {837715723, 0, 0}, + {1320550031, 0, 0}, + {1630583316, 0, 0}, + {1913735398, 0, 0}, + {1918481917, 0, 0}, + {1955871800, 0, 0}, + {1977038330, 0, 0}, + {2053214130, 0, 0}, + {2443959748, 0, 0}, + {2564745684, 0, 0}, + {2622612602, 0, 0}, + {2677252364, 0, 0}, + {2736026107, 0, 0}, + {2790624748, 0, 0}, + {2882994691, 0, 0}, + {2888125966, 0, 0}, + {2970183398, 0, 0}, + {3253403867, 0, 0}, + {3427283542, 0, 0}, + {3570411982, 0, 0}, + {3619787319, 0, 0}, + {3662767579, 0, 0}, + {3884846406, 0, 0}, + {3910458990, 0, 0}, + {3927915220, 0, 0}, + {4224872590, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 5, 20}, + {0, 6, 25}, + {0, 23, 3}, + {0, 2, 4}, + {0, 14, 17}, + {0, 11, 8}, + {0, 27, 10}, + {0, 19, 28}, + {0, 12, 16}, + {0, 33, 32}, + {0, 35, 34}, + {0, 37, 36}, + {0, 39, 38}, + {0, 40, 15}, + {0, 41, 7}, + {0, 1, 21}, + {0, 24, 13}, + {0, 29, 42}, + {0, 44, 43}, + {0, 22, 45}, + {0, 47, 46}, + {0, 49, 48}, + {0, 50, 30}, + {0, 31, 51}, + {0, 53, 52}, + {0, 55, 54}, + {0, 56, 9}, + {0, 57, 26}, + {0, 59, 58}, + {0, 60, 18}, + })); + + codecs.emplace(std::pair(SpvOpFunctionCall, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(39, { + {0, 0, 0}, + {744062262, 0, 0}, + {810488476, 0, 0}, + {1040775722, 0, 0}, + {1280126114, 0, 0}, + {1367301635, 0, 0}, + {1684282922, 0, 0}, + {1918481917, 0, 0}, + {1978689945, 0, 0}, + {1980341560, 0, 0}, + {2443959748, 0, 0}, + {2629265310, 0, 0}, + {2790624748, 0, 0}, + {2970183398, 0, 0}, + {3044188332, 0, 0}, + {3496407048, 0, 0}, + {3662767579, 0, 0}, + {3887377256, 0, 0}, + {3971481069, 0, 0}, + {4224872590, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 2}, + {0, 18, 15}, + {0, 21, 6}, + {0, 13, 11}, + {0, 4, 22}, + {0, 14, 1}, + {0, 24, 23}, + {0, 25, 8}, + {0, 27, 26}, + {0, 20, 17}, + {0, 5, 28}, + {0, 29, 9}, + {0, 16, 10}, + {0, 31, 30}, + {0, 32, 7}, + {0, 19, 33}, + {0, 35, 34}, + {0, 37, 36}, + {0, 38, 12}, + })); + + codecs.emplace(std::pair(SpvOpFunctionCall, 4), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(27, { + {0, 0, 0}, + {37459569, 0, 0}, + {837715723, 0, 0}, + {1352628475, 0, 0}, + {1918481917, 0, 0}, + {1978689945, 0, 0}, + {1980341560, 0, 0}, + {2096388952, 0, 0}, + {2622612602, 0, 0}, + {2790624748, 0, 0}, + {2970183398, 0, 0}, + {3510682541, 0, 0}, + {3783543823, 0, 0}, + {4224872590, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 7, 11}, + {0, 2, 8}, + {0, 15, 12}, + {0, 1, 3}, + {0, 16, 6}, + {0, 18, 17}, + {0, 19, 14}, + {0, 20, 5}, + {0, 10, 21}, + {0, 22, 4}, + {0, 23, 13}, + {0, 25, 24}, + {0, 9, 26}, + })); + + codecs.emplace(std::pair(SpvOpFunctionCall, 5), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(13, { + {0, 0, 0}, + {1510333659, 0, 0}, + {1684282922, 0, 0}, + {1918481917, 0, 0}, + {2790624748, 0, 0}, + {3662767579, 0, 0}, + {4224872590, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 5, 1}, + {0, 8, 2}, + {0, 9, 7}, + {0, 3, 10}, + {0, 6, 11}, + {0, 4, 12}, + })); + + codecs.emplace(std::pair(SpvOpFunctionCall, 6), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(27, { + {0, 0, 0}, + {161668409, 0, 0}, + {188347929, 0, 0}, + {653708953, 0, 0}, + {976111724, 0, 0}, + {1510333659, 0, 0}, + {1918481917, 0, 0}, + {2790624748, 0, 0}, + {3033873113, 0, 0}, + {3499234137, 0, 0}, + {3525913657, 0, 0}, + {3552593177, 0, 0}, + {3570411982, 0, 0}, + {4224872590, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 8, 3}, + {0, 2, 9}, + {0, 10, 11}, + {0, 15, 1}, + {0, 17, 16}, + {0, 19, 18}, + {0, 5, 4}, + {0, 20, 6}, + {0, 12, 21}, + {0, 14, 22}, + {0, 24, 23}, + {0, 7, 25}, + {0, 13, 26}, + })); + + codecs.emplace(std::pair(SpvOpFunctionCall, 7), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(31, { + {0, 0, 0}, + {226836633, 0, 0}, + {296981500, 0, 0}, + {718877177, 0, 0}, + {745556697, 0, 0}, + {798915737, 0, 0}, + {1510333659, 0, 0}, + {1684282922, 0, 0}, + {2444465148, 0, 0}, + {2713718873, 0, 0}, + {3495546641, 0, 0}, + {3564402361, 0, 0}, + {4056442905, 0, 0}, + {4083122425, 0, 0}, + {4123141705, 0, 0}, + {4224872590, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 14, 4}, + {0, 5, 3}, + {0, 9, 8}, + {0, 13, 12}, + {0, 1, 11}, + {0, 18, 17}, + {0, 2, 19}, + {0, 21, 20}, + {0, 23, 22}, + {0, 25, 24}, + {0, 26, 7}, + {0, 27, 16}, + {0, 10, 6}, + {0, 29, 28}, + {0, 15, 30}, + })); + + codecs.emplace(std::pair(SpvOpFunctionCall, 8), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(35, { + {0, 0, 0}, + {161668409, 0, 0}, + {188347929, 0, 0}, + {215027449, 0, 0}, + {296981500, 0, 0}, + {653708953, 0, 0}, + {680388473, 0, 0}, + {1119069977, 0, 0}, + {1510333659, 0, 0}, + {1584774136, 0, 0}, + {2049792025, 0, 0}, + {2444465148, 0, 0}, + {2568512089, 0, 0}, + {3033873113, 0, 0}, + {3499234137, 0, 0}, + {3525913657, 0, 0}, + {3552593177, 0, 0}, + {4224872590, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 7, 6}, + {0, 10, 12}, + {0, 4, 3}, + {0, 16, 11}, + {0, 19, 14}, + {0, 5, 2}, + {0, 20, 13}, + {0, 21, 15}, + {0, 1, 22}, + {0, 24, 23}, + {0, 26, 25}, + {0, 28, 27}, + {0, 18, 29}, + {0, 8, 30}, + {0, 32, 31}, + {0, 9, 33}, + {0, 17, 34}, + })); + + codecs.emplace(std::pair(SpvOpFunctionCall, 9), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(25, { + {0, 0, 0}, + {825595257, 0, 0}, + {1064945649, 0, 0}, + {1290956281, 0, 0}, + {1510333659, 0, 0}, + {2096388952, 0, 0}, + {2248357849, 0, 0}, + {2713718873, 0, 0}, + {3187066832, 0, 0}, + {3205759417, 0, 0}, + {4064212479, 0, 0}, + {4163160985, 0, 0}, + {4224872590, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 8, 3}, + {0, 2, 9}, + {0, 7, 6}, + {0, 5, 14}, + {0, 16, 15}, + {0, 17, 11}, + {0, 19, 18}, + {0, 20, 1}, + {0, 4, 13}, + {0, 22, 21}, + {0, 10, 23}, + {0, 12, 24}, + })); + + codecs.emplace(std::pair(SpvOpFunctionCall, 10), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(27, { + {0, 0, 0}, + {123108003, 0, 0}, + {296981500, 0, 0}, + {595410904, 0, 0}, + {1466938734, 0, 0}, + {1503477720, 0, 0}, + {1816558243, 0, 0}, + {1990431740, 0, 0}, + {2724625059, 0, 0}, + {2790624748, 0, 0}, + {2812498065, 0, 0}, + {3160388974, 0, 0}, + {3745223676, 0, 0}, + {3982311384, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 5, 13}, + {0, 8, 1}, + {0, 12, 11}, + {0, 15, 3}, + {0, 6, 4}, + {0, 16, 7}, + {0, 17, 14}, + {0, 18, 2}, + {0, 19, 10}, + {0, 21, 20}, + {0, 23, 22}, + {0, 25, 24}, + {0, 9, 26}, + })); + + codecs.emplace(std::pair(SpvOpFunctionCall, 11), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(25, { + {0, 0, 0}, + {94145952, 0, 0}, + {1054641568, 0, 0}, + {1269075360, 0, 0}, + {1675922848, 0, 0}, + {2038205856, 0, 0}, + {2433519008, 0, 0}, + {2636942752, 0, 0}, + {2790624748, 0, 0}, + {2840366496, 0, 0}, + {2851900832, 0, 0}, + {2964622752, 0, 0}, + {3654061472, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 7, 1}, + {0, 12, 6}, + {0, 14, 10}, + {0, 13, 4}, + {0, 11, 15}, + {0, 3, 16}, + {0, 2, 17}, + {0, 18, 5}, + {0, 9, 19}, + {0, 21, 20}, + {0, 23, 22}, + {0, 8, 24}, + })); + + codecs.emplace(std::pair(SpvOpFunctionCall, 12), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(45, { + {0, 0, 0}, + {107544081, 0, 0}, + {125015036, 0, 0}, + {586244865, 0, 0}, + {1033081852, 0, 0}, + {1064945649, 0, 0}, + {1155765244, 0, 0}, + {1304296041, 0, 0}, + {1543646433, 0, 0}, + {1782996825, 0, 0}, + {1941148668, 0, 0}, + {2002490364, 0, 0}, + {2022347217, 0, 0}, + {2063832060, 0, 0}, + {2487708241, 0, 0}, + {2726532092, 0, 0}, + {2849215484, 0, 0}, + {2966409025, 0, 0}, + {3445109809, 0, 0}, + {3458449569, 0, 0}, + {3634598908, 0, 0}, + {3695940604, 0, 0}, + {3923810593, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 7, 2}, + {0, 14, 13}, + {0, 1, 23}, + {0, 6, 5}, + {0, 16, 15}, + {0, 24, 17}, + {0, 12, 25}, + {0, 22, 18}, + {0, 10, 26}, + {0, 28, 27}, + {0, 21, 29}, + {0, 31, 30}, + {0, 9, 8}, + {0, 11, 32}, + {0, 33, 19}, + {0, 3, 34}, + {0, 36, 35}, + {0, 38, 37}, + {0, 20, 39}, + {0, 41, 40}, + {0, 42, 4}, + {0, 44, 43}, + })); + + codecs.emplace(std::pair(SpvOpFunctionCall, 13), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(23, { + {0, 0, 0}, + {247698428, 0, 0}, + {309040124, 0, 0}, + {333554713, 0, 0}, + {572905105, 0, 0}, + {1033081852, 0, 0}, + {2002490364, 0, 0}, + {2009007457, 0, 0}, + {2487708241, 0, 0}, + {3634598908, 0, 0}, + {3695940604, 0, 0}, + {3923810593, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 6, 1}, + {0, 9, 7}, + {0, 5, 12}, + {0, 14, 13}, + {0, 15, 8}, + {0, 3, 16}, + {0, 17, 11}, + {0, 10, 4}, + {0, 2, 18}, + {0, 20, 19}, + {0, 22, 21}, + })); + + codecs.emplace(std::pair(SpvOpFunctionCall, 14), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(11, { + {0, 0, 0}, + {247698428, 0, 0}, + {1033081852, 0, 0}, + {2002490364, 0, 0}, + {2910557180, 0, 0}, + {3757282300, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 6, 4}, + {0, 7, 3}, + {0, 2, 8}, + {0, 1, 5}, + {0, 10, 9}, + })); + + codecs.emplace(std::pair(SpvOpFunctionCall, 15), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {1033081852, 0, 0}, + {1094423548, 0, 0}, + {2002490364, 0, 0}, + {3757282300, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 5}, + {0, 6, 2}, + {0, 4, 7}, + {0, 8, 1}, + })); + + codecs.emplace(std::pair(SpvOpFunctionCall, 16), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(57, { + {0, 0, 0}, + {135486769, 0, 0}, + {450406196, 0, 0}, + {503094540, 0, 0}, + {543621065, 0, 0}, + {827698488, 0, 0}, + {1294403159, 0, 0}, + {1296054774, 0, 0}, + {1297706389, 0, 0}, + {1322549027, 0, 0}, + {1784441183, 0, 0}, + {2194691858, 0, 0}, + {2448331885, 0, 0}, + {2468230023, 0, 0}, + {2547657777, 0, 0}, + {2549309392, 0, 0}, + {2550961007, 0, 0}, + {2934934694, 0, 0}, + {2936586309, 0, 0}, + {2938237924, 0, 0}, + {3094180193, 0, 0}, + {3095831808, 0, 0}, + {3183924418, 0, 0}, + {3561562003, 0, 0}, + {3563213618, 0, 0}, + {3564865233, 0, 0}, + {4028622909, 0, 0}, + {4039938779, 0, 0}, + {4050155669, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 27, 28}, + {0, 10, 2}, + {0, 25, 24}, + {0, 1, 12}, + {0, 30, 3}, + {0, 20, 31}, + {0, 9, 32}, + {0, 34, 33}, + {0, 35, 22}, + {0, 26, 15}, + {0, 19, 36}, + {0, 18, 37}, + {0, 38, 16}, + {0, 39, 8}, + {0, 5, 40}, + {0, 6, 41}, + {0, 21, 42}, + {0, 11, 29}, + {0, 4, 43}, + {0, 13, 23}, + {0, 14, 17}, + {0, 7, 44}, + {0, 46, 45}, + {0, 48, 47}, + {0, 50, 49}, + {0, 52, 51}, + {0, 54, 53}, + {0, 56, 55}, + })); + + codecs.emplace(std::pair(SpvOpVariable, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(57, { + {0, 0, 0}, + {37459569, 0, 0}, + {112745085, 0, 0}, + {137840602, 0, 0}, + {565334834, 0, 0}, + {625975427, 0, 0}, + {630964591, 0, 0}, + {680016782, 0, 0}, + {769422756, 0, 0}, + {1009983433, 0, 0}, + {1093210099, 0, 0}, + {1572088444, 0, 0}, + {1584774136, 0, 0}, + {1641565587, 0, 0}, + {1918481917, 0, 0}, + {2190437442, 0, 0}, + {2790624748, 0, 0}, + {3085467405, 0, 0}, + {3181646225, 0, 0}, + {3192069648, 0, 0}, + {3253403867, 0, 0}, + {3390051757, 0, 0}, + {3560665067, 0, 0}, + {3662767579, 0, 0}, + {4053789056, 0, 0}, + {4064212479, 0, 0}, + {4192247221, 0, 0}, + {4224872590, 0, 0}, + {4290024976, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 20}, + {0, 28, 10}, + {0, 13, 8}, + {0, 15, 17}, + {0, 30, 21}, + {0, 19, 31}, + {0, 4, 32}, + {0, 34, 33}, + {0, 35, 5}, + {0, 7, 24}, + {0, 9, 36}, + {0, 3, 37}, + {0, 38, 6}, + {0, 39, 23}, + {0, 27, 40}, + {0, 14, 41}, + {0, 25, 42}, + {0, 1, 29}, + {0, 12, 43}, + {0, 11, 26}, + {0, 18, 22}, + {0, 16, 44}, + {0, 46, 45}, + {0, 48, 47}, + {0, 50, 49}, + {0, 52, 51}, + {0, 54, 53}, + {0, 56, 55}, + })); + + codecs.emplace(std::pair(SpvOpVariable, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(27, { + {0, 0, 0}, + {162255877, 0, 0}, + {679771963, 0, 0}, + {789872778, 0, 0}, + {1154919607, 0, 0}, + {1343794461, 0, 0}, + {1951208733, 0, 0}, + {2263349224, 0, 0}, + {2320303498, 0, 0}, + {2924146124, 0, 0}, + {2984325996, 0, 0}, + {3334207724, 0, 0}, + {3868239231, 0, 0}, + {3869890846, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 5, 3}, + {0, 9, 7}, + {0, 12, 4}, + {0, 16, 15}, + {0, 18, 17}, + {0, 14, 19}, + {0, 13, 10}, + {0, 20, 1}, + {0, 21, 8}, + {0, 2, 22}, + {0, 11, 23}, + {0, 6, 24}, + {0, 26, 25}, + })); + + codecs.emplace(std::pair(SpvOpLoad, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(83, { + {0, 0, 0}, + {169674806, 0, 0}, + {269823086, 0, 0}, + {408465899, 0, 0}, + {451264926, 0, 0}, + {543558236, 0, 0}, + {810488476, 0, 0}, + {850497536, 0, 0}, + {870594305, 0, 0}, + {883854656, 0, 0}, + {1033363654, 0, 0}, + {1069781886, 0, 0}, + {1141965917, 0, 0}, + {1323407757, 0, 0}, + {1570165302, 0, 0}, + {1684282922, 0, 0}, + {1742737136, 0, 0}, + {1901166356, 0, 0}, + {1949759310, 0, 0}, + {2043873558, 0, 0}, + {2087004702, 0, 0}, + {2096388952, 0, 0}, + {2157103435, 0, 0}, + {2219733501, 0, 0}, + {2356768706, 0, 0}, + {2443959748, 0, 0}, + {2517964682, 0, 0}, + {2614879967, 0, 0}, + {2622612602, 0, 0}, + {2660843182, 0, 0}, + {2959147533, 0, 0}, + {2970183398, 0, 0}, + {3044188332, 0, 0}, + {3091876332, 0, 0}, + {3187066832, 0, 0}, + {3244209297, 0, 0}, + {3487022798, 0, 0}, + {3496407048, 0, 0}, + {3570411982, 0, 0}, + {3692647551, 0, 0}, + {3713290482, 0, 0}, + {3831290364, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 1}, + {0, 35, 13}, + {0, 25, 11}, + {0, 7, 10}, + {0, 19, 36}, + {0, 43, 27}, + {0, 16, 29}, + {0, 22, 3}, + {0, 41, 30}, + {0, 44, 12}, + {0, 2, 24}, + {0, 40, 32}, + {0, 23, 45}, + {0, 46, 39}, + {0, 17, 33}, + {0, 48, 47}, + {0, 8, 49}, + {0, 51, 50}, + {0, 52, 20}, + {0, 53, 14}, + {0, 31, 54}, + {0, 15, 55}, + {0, 57, 56}, + {0, 59, 58}, + {0, 6, 26}, + {0, 61, 60}, + {0, 34, 62}, + {0, 64, 63}, + {0, 5, 37}, + {0, 9, 65}, + {0, 18, 28}, + {0, 66, 38}, + {0, 68, 67}, + {0, 69, 21}, + {0, 71, 70}, + {0, 73, 72}, + {0, 75, 74}, + {0, 77, 76}, + {0, 79, 78}, + {0, 80, 42}, + {0, 82, 81}, + })); + + codecs.emplace(std::pair(SpvOpLoad, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(83, { + {0, 0, 0}, + {28782128, 0, 0}, + {30433743, 0, 0}, + {37459569, 0, 0}, + {137840602, 0, 0}, + {522971108, 0, 0}, + {565334834, 0, 0}, + {625975427, 0, 0}, + {630964591, 0, 0}, + {680016782, 0, 0}, + {1009983433, 0, 0}, + {1079999262, 0, 0}, + {1395113939, 0, 0}, + {1572088444, 0, 0}, + {1584774136, 0, 0}, + {1649426421, 0, 0}, + {1918481917, 0, 0}, + {1957218950, 0, 0}, + {2311941439, 0, 0}, + {2313593054, 0, 0}, + {2790624748, 0, 0}, + {2838165089, 0, 0}, + {2839816704, 0, 0}, + {2841468319, 0, 0}, + {3085467405, 0, 0}, + {3181646225, 0, 0}, + {3192069648, 0, 0}, + {3253403867, 0, 0}, + {3364388739, 0, 0}, + {3366040354, 0, 0}, + {3367691969, 0, 0}, + {3369343584, 0, 0}, + {3560665067, 0, 0}, + {3662767579, 0, 0}, + {3945795573, 0, 0}, + {4053789056, 0, 0}, + {4064212479, 0, 0}, + {4224872590, 0, 0}, + {4239834800, 0, 0}, + {4241486415, 0, 0}, + {4243138030, 0, 0}, + {4244789645, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 27}, + {0, 15, 2}, + {0, 10, 26}, + {0, 7, 24}, + {0, 9, 31}, + {0, 43, 30}, + {0, 29, 12}, + {0, 11, 41}, + {0, 40, 39}, + {0, 44, 23}, + {0, 22, 6}, + {0, 34, 35}, + {0, 18, 45}, + {0, 46, 21}, + {0, 17, 19}, + {0, 48, 47}, + {0, 28, 49}, + {0, 51, 50}, + {0, 52, 38}, + {0, 53, 33}, + {0, 4, 54}, + {0, 13, 55}, + {0, 57, 56}, + {0, 59, 58}, + {0, 37, 8}, + {0, 61, 60}, + {0, 5, 62}, + {0, 64, 63}, + {0, 36, 32}, + {0, 3, 65}, + {0, 14, 16}, + {0, 66, 25}, + {0, 68, 67}, + {0, 69, 20}, + {0, 71, 70}, + {0, 73, 72}, + {0, 75, 74}, + {0, 77, 76}, + {0, 79, 78}, + {0, 80, 42}, + {0, 82, 81}, + })); + + codecs.emplace(std::pair(SpvOpLoad, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(49, { + {0, 0, 0}, + {137840602, 0, 0}, + {522971108, 0, 0}, + {769422756, 0, 0}, + {1009983433, 0, 0}, + {1079999262, 0, 0}, + {1558345254, 0, 0}, + {1572088444, 0, 0}, + {1641565587, 0, 0}, + {1918481917, 0, 0}, + {2311941439, 0, 0}, + {2313593054, 0, 0}, + {2790624748, 0, 0}, + {2838165089, 0, 0}, + {2994529201, 0, 0}, + {2996180816, 0, 0}, + {2997832431, 0, 0}, + {3027538652, 0, 0}, + {3253403867, 0, 0}, + {3364388739, 0, 0}, + {3560665067, 0, 0}, + {3662767579, 0, 0}, + {3945795573, 0, 0}, + {4192247221, 0, 0}, + {4224872590, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 14, 17}, + {0, 16, 15}, + {0, 13, 11}, + {0, 10, 3}, + {0, 22, 18}, + {0, 6, 8}, + {0, 19, 2}, + {0, 27, 26}, + {0, 28, 5}, + {0, 30, 29}, + {0, 32, 31}, + {0, 34, 33}, + {0, 4, 35}, + {0, 37, 36}, + {0, 21, 1}, + {0, 39, 38}, + {0, 40, 24}, + {0, 7, 23}, + {0, 20, 9}, + {0, 42, 41}, + {0, 43, 25}, + {0, 44, 12}, + {0, 46, 45}, + {0, 48, 47}, + })); + + codecs.emplace(std::pair(SpvOpStore, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(59, { + {0, 0, 0}, + {139011596, 0, 0}, + {177111659, 0, 0}, + {296981500, 0, 0}, + {408465899, 0, 0}, + {495107308, 0, 0}, + {810488476, 0, 0}, + {870594305, 0, 0}, + {1367301635, 0, 0}, + {1901166356, 0, 0}, + {2055836767, 0, 0}, + {2087004702, 0, 0}, + {2096388952, 0, 0}, + {2204920111, 0, 0}, + {2517964682, 0, 0}, + {2622612602, 0, 0}, + {2660843182, 0, 0}, + {2842919847, 0, 0}, + {2855506940, 0, 0}, + {2959147533, 0, 0}, + {3044188332, 0, 0}, + {3187066832, 0, 0}, + {3504158761, 0, 0}, + {3570411982, 0, 0}, + {3619787319, 0, 0}, + {3653838348, 0, 0}, + {3692647551, 0, 0}, + {3764205609, 0, 0}, + {3831290364, 0, 0}, + {3913885196, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 20, 29}, + {0, 25, 8}, + {0, 5, 1}, + {0, 24, 26}, + {0, 14, 9}, + {0, 27, 16}, + {0, 31, 7}, + {0, 33, 32}, + {0, 17, 34}, + {0, 35, 13}, + {0, 22, 6}, + {0, 3, 2}, + {0, 23, 36}, + {0, 28, 37}, + {0, 19, 4}, + {0, 38, 10}, + {0, 39, 15}, + {0, 40, 18}, + {0, 42, 41}, + {0, 43, 12}, + {0, 44, 21}, + {0, 45, 11}, + {0, 47, 46}, + {0, 49, 48}, + {0, 51, 50}, + {0, 53, 52}, + {0, 55, 54}, + {0, 57, 56}, + {0, 30, 58}, + })); + + codecs.emplace(std::pair(SpvOpStore, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(35, { + {0, 0, 0}, + {440421571, 0, 0}, + {827698488, 0, 0}, + {907126242, 0, 0}, + {908777857, 0, 0}, + {910429472, 0, 0}, + {1294403159, 0, 0}, + {1296054774, 0, 0}, + {1297706389, 0, 0}, + {2080953106, 0, 0}, + {2468230023, 0, 0}, + {2547657777, 0, 0}, + {2549309392, 0, 0}, + {2550961007, 0, 0}, + {3094857332, 0, 0}, + {3561562003, 0, 0}, + {3563213618, 0, 0}, + {3564865233, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 16, 12}, + {0, 17, 13}, + {0, 14, 19}, + {0, 18, 20}, + {0, 5, 21}, + {0, 11, 7}, + {0, 15, 22}, + {0, 9, 8}, + {0, 24, 23}, + {0, 25, 4}, + {0, 27, 26}, + {0, 28, 3}, + {0, 29, 10}, + {0, 6, 1}, + {0, 31, 30}, + {0, 32, 2}, + {0, 34, 33}, + })); + + codecs.emplace(std::pair(SpvOpAccessChain, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(99, { + {0, 0, 0}, + {27130513, 0, 0}, + {28782128, 0, 0}, + {30433743, 0, 0}, + {32085358, 0, 0}, + {155458798, 0, 0}, + {157110413, 0, 0}, + {163402553, 0, 0}, + {165054168, 0, 0}, + {213642219, 0, 0}, + {215293834, 0, 0}, + {216945449, 0, 0}, + {221900294, 0, 0}, + {545986953, 0, 0}, + {979993429, 0, 0}, + {1079999262, 0, 0}, + {1302400505, 0, 0}, + {1313182965, 0, 0}, + {1314834580, 0, 0}, + {1315613425, 0, 0}, + {1317265040, 0, 0}, + {1558345254, 0, 0}, + {1649426421, 0, 0}, + {2311941439, 0, 0}, + {2313593054, 0, 0}, + {2602027658, 0, 0}, + {2838165089, 0, 0}, + {2839816704, 0, 0}, + {2841468319, 0, 0}, + {2863084840, 0, 0}, + {2994529201, 0, 0}, + {2996180816, 0, 0}, + {2997832431, 0, 0}, + {3027538652, 0, 0}, + {3187387500, 0, 0}, + {3189039115, 0, 0}, + {3364388739, 0, 0}, + {3366040354, 0, 0}, + {3367691969, 0, 0}, + {3369343584, 0, 0}, + {3716914380, 0, 0}, + {3928842969, 0, 0}, + {3930494584, 0, 0}, + {3932146199, 0, 0}, + {3945482286, 0, 0}, + {4105051793, 0, 0}, + {4239834800, 0, 0}, + {4241486415, 0, 0}, + {4243138030, 0, 0}, + {4244789645, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 29, 10}, + {0, 17, 18}, + {0, 13, 14}, + {0, 44, 25}, + {0, 8, 7}, + {0, 20, 11}, + {0, 33, 19}, + {0, 6, 45}, + {0, 42, 43}, + {0, 40, 5}, + {0, 9, 16}, + {0, 1, 4}, + {0, 35, 34}, + {0, 12, 21}, + {0, 52, 51}, + {0, 31, 30}, + {0, 41, 32}, + {0, 54, 53}, + {0, 55, 2}, + {0, 3, 56}, + {0, 58, 57}, + {0, 60, 59}, + {0, 61, 22}, + {0, 63, 62}, + {0, 65, 64}, + {0, 67, 66}, + {0, 39, 68}, + {0, 38, 69}, + {0, 47, 70}, + {0, 49, 71}, + {0, 28, 48}, + {0, 37, 15}, + {0, 73, 72}, + {0, 74, 27}, + {0, 23, 75}, + {0, 76, 26}, + {0, 24, 77}, + {0, 79, 78}, + {0, 81, 80}, + {0, 82, 46}, + {0, 36, 83}, + {0, 85, 84}, + {0, 87, 86}, + {0, 89, 88}, + {0, 91, 90}, + {0, 93, 92}, + {0, 95, 94}, + {0, 97, 96}, + {0, 50, 98}, + })); + + codecs.emplace(std::pair(SpvOpAccessChain, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(101, { + {0, 0, 0}, + {112745085, 0, 0}, + {116376005, 0, 0}, + {137840602, 0, 0}, + {400248103, 0, 0}, + {406044930, 0, 0}, + {468372467, 0, 0}, + {522971108, 0, 0}, + {615341051, 0, 0}, + {625975427, 0, 0}, + {630964591, 0, 0}, + {680016782, 0, 0}, + {763027711, 0, 0}, + {977312655, 0, 0}, + {1009983433, 0, 0}, + {1062250709, 0, 0}, + {1395113939, 0, 0}, + {1410849099, 0, 0}, + {1642805350, 0, 0}, + {1692932387, 0, 0}, + {1698730948, 0, 0}, + {1827244161, 0, 0}, + {1918481917, 0, 0}, + {2096472894, 0, 0}, + {2190437442, 0, 0}, + {2299842241, 0, 0}, + {2433358586, 0, 0}, + {2593325766, 0, 0}, + {2785441472, 0, 0}, + {2790624748, 0, 0}, + {2879917723, 0, 0}, + {2882994691, 0, 0}, + {2902069960, 0, 0}, + {3090408469, 0, 0}, + {3181646225, 0, 0}, + {3255947500, 0, 0}, + {3263901372, 0, 0}, + {3268751013, 0, 0}, + {3347863687, 0, 0}, + {3390051757, 0, 0}, + {3560665067, 0, 0}, + {3617689692, 0, 0}, + {3662767579, 0, 0}, + {3717523241, 0, 0}, + {3854557817, 0, 0}, + {3910458990, 0, 0}, + {3941049054, 0, 0}, + {3945795573, 0, 0}, + {4080527786, 0, 0}, + {4101009465, 0, 0}, + {4290024976, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 32, 44}, + {0, 41, 26}, + {0, 16, 10}, + {0, 27, 45}, + {0, 25, 38}, + {0, 12, 18}, + {0, 6, 35}, + {0, 46, 23}, + {0, 20, 37}, + {0, 52, 19}, + {0, 53, 21}, + {0, 54, 48}, + {0, 33, 55}, + {0, 3, 8}, + {0, 28, 56}, + {0, 13, 57}, + {0, 59, 58}, + {0, 1, 49}, + {0, 47, 60}, + {0, 61, 14}, + {0, 63, 62}, + {0, 64, 43}, + {0, 7, 4}, + {0, 65, 15}, + {0, 67, 66}, + {0, 68, 17}, + {0, 36, 2}, + {0, 30, 69}, + {0, 71, 70}, + {0, 34, 5}, + {0, 73, 72}, + {0, 75, 74}, + {0, 77, 76}, + {0, 24, 78}, + {0, 39, 31}, + {0, 80, 79}, + {0, 9, 11}, + {0, 42, 81}, + {0, 83, 82}, + {0, 29, 50}, + {0, 84, 51}, + {0, 86, 85}, + {0, 22, 40}, + {0, 88, 87}, + {0, 90, 89}, + {0, 92, 91}, + {0, 94, 93}, + {0, 96, 95}, + {0, 98, 97}, + {0, 100, 99}, + })); + + codecs.emplace(std::pair(SpvOpAccessChain, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(69, { + {0, 0, 0}, + {51041423, 0, 0}, + {142465290, 0, 0}, + {144116905, 0, 0}, + {290391815, 0, 0}, + {438318340, 0, 0}, + {529742207, 0, 0}, + {677668732, 0, 0}, + {917019124, 0, 0}, + {1064945649, 0, 0}, + {1156369516, 0, 0}, + {1158021131, 0, 0}, + {1304296041, 0, 0}, + {1452222566, 0, 0}, + {1543646433, 0, 0}, + {1691572958, 0, 0}, + {1782996825, 0, 0}, + {1784648440, 0, 0}, + {1930923350, 0, 0}, + {2170273742, 0, 0}, + {2318200267, 0, 0}, + {2466126792, 0, 0}, + {2557550659, 0, 0}, + {2705477184, 0, 0}, + {2796901051, 0, 0}, + {2798552666, 0, 0}, + {2944827576, 0, 0}, + {3092754101, 0, 0}, + {3184177968, 0, 0}, + {3332104493, 0, 0}, + {3571454885, 0, 0}, + {3810805277, 0, 0}, + {3958731802, 0, 0}, + {4106658327, 0, 0}, + {4198082194, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 27, 33}, + {0, 21, 5}, + {0, 26, 13}, + {0, 20, 8}, + {0, 15, 7}, + {0, 37, 36}, + {0, 32, 29}, + {0, 38, 4}, + {0, 30, 1}, + {0, 9, 12}, + {0, 39, 18}, + {0, 22, 40}, + {0, 42, 41}, + {0, 44, 43}, + {0, 45, 35}, + {0, 46, 34}, + {0, 6, 14}, + {0, 28, 23}, + {0, 48, 47}, + {0, 49, 31}, + {0, 51, 50}, + {0, 19, 24}, + {0, 52, 10}, + {0, 2, 53}, + {0, 55, 54}, + {0, 25, 56}, + {0, 11, 57}, + {0, 59, 58}, + {0, 3, 17}, + {0, 61, 60}, + {0, 16, 62}, + {0, 64, 63}, + {0, 66, 65}, + {0, 68, 67}, + })); + + codecs.emplace(std::pair(SpvOpAccessChain, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(85, { + {0, 0, 0}, + {142465290, 0, 0}, + {144116905, 0, 0}, + {198967948, 0, 0}, + {290391815, 0, 0}, + {529742207, 0, 0}, + {586244865, 0, 0}, + {677668732, 0, 0}, + {825595257, 0, 0}, + {917019124, 0, 0}, + {973521782, 0, 0}, + {1064945649, 0, 0}, + {1156369516, 0, 0}, + {1158021131, 0, 0}, + {1212872174, 0, 0}, + {1304296041, 0, 0}, + {1452222566, 0, 0}, + {1543646433, 0, 0}, + {1600149091, 0, 0}, + {1782996825, 0, 0}, + {1784648440, 0, 0}, + {1839499483, 0, 0}, + {1930923350, 0, 0}, + {2170273742, 0, 0}, + {2226776400, 0, 0}, + {2318200267, 0, 0}, + {2466126792, 0, 0}, + {2557550659, 0, 0}, + {2614053317, 0, 0}, + {2796901051, 0, 0}, + {2798552666, 0, 0}, + {2853403709, 0, 0}, + {2944827576, 0, 0}, + {3184177968, 0, 0}, + {3240680626, 0, 0}, + {3480031018, 0, 0}, + {3571454885, 0, 0}, + {3810805277, 0, 0}, + {3867307935, 0, 0}, + {3958731802, 0, 0}, + {4106658327, 0, 0}, + {4198082194, 0, 0}, + {4254584852, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 7, 11}, + {0, 15, 4}, + {0, 32, 25}, + {0, 44, 39}, + {0, 36, 22}, + {0, 45, 17}, + {0, 24, 46}, + {0, 10, 9}, + {0, 6, 27}, + {0, 28, 18}, + {0, 42, 34}, + {0, 31, 14}, + {0, 41, 38}, + {0, 26, 3}, + {0, 47, 33}, + {0, 21, 8}, + {0, 5, 35}, + {0, 40, 16}, + {0, 37, 23}, + {0, 49, 48}, + {0, 51, 50}, + {0, 53, 52}, + {0, 55, 54}, + {0, 57, 56}, + {0, 59, 58}, + {0, 61, 60}, + {0, 63, 62}, + {0, 65, 64}, + {0, 67, 66}, + {0, 68, 12}, + {0, 29, 69}, + {0, 70, 1}, + {0, 30, 2}, + {0, 43, 71}, + {0, 73, 72}, + {0, 74, 20}, + {0, 75, 19}, + {0, 77, 76}, + {0, 13, 78}, + {0, 80, 79}, + {0, 82, 81}, + {0, 84, 83}, + })); + + codecs.emplace(std::pair(SpvOpAccessChain, 4), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {144116905, 0, 0}, + {1158021131, 0, 0}, + {1784648440, 0, 0}, + {2798552666, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 5}, + {0, 4, 2}, + {0, 6, 3}, + {0, 8, 7}, + })); + + codecs.emplace(std::pair(SpvOpAccessChain, 5), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(5, { + {0, 0, 0}, + {142465290, 0, 0}, + {1782996825, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 1}, + {0, 4, 3}, + })); + + codecs.emplace(std::pair(SpvOpAccessChain, 6), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {679771963, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 4}, + {0, 2, 5}, + {0, 6, 1}, + })); + + codecs.emplace(std::pair(SpvOpVectorShuffle, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(59, { + {0, 0, 0}, + {177111659, 0, 0}, + {413918748, 0, 0}, + {529383565, 0, 0}, + {646282397, 0, 0}, + {837715723, 0, 0}, + {1019457583, 0, 0}, + {1022544883, 0, 0}, + {1054461787, 0, 0}, + {1097775533, 0, 0}, + {1136775085, 0, 0}, + {1191015885, 0, 0}, + {1196280518, 0, 0}, + {1203545131, 0, 0}, + {1352628475, 0, 0}, + {1367301635, 0, 0}, + {1918742169, 0, 0}, + {1922045399, 0, 0}, + {2055836767, 0, 0}, + {2183547611, 0, 0}, + {2204920111, 0, 0}, + {2358141757, 0, 0}, + {2572638469, 0, 0}, + {2597020383, 0, 0}, + {2842919847, 0, 0}, + {3619787319, 0, 0}, + {3701632935, 0, 0}, + {3783543823, 0, 0}, + {4245257809, 0, 0}, + {4265894873, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 11, 23}, + {0, 12, 2}, + {0, 9, 7}, + {0, 21, 19}, + {0, 4, 29}, + {0, 10, 28}, + {0, 17, 16}, + {0, 27, 3}, + {0, 32, 31}, + {0, 33, 22}, + {0, 6, 34}, + {0, 35, 8}, + {0, 36, 24}, + {0, 38, 37}, + {0, 1, 14}, + {0, 39, 20}, + {0, 5, 40}, + {0, 42, 41}, + {0, 43, 26}, + {0, 45, 44}, + {0, 47, 46}, + {0, 48, 18}, + {0, 15, 49}, + {0, 50, 25}, + {0, 51, 13}, + {0, 53, 52}, + {0, 55, 54}, + {0, 57, 56}, + {0, 30, 58}, + })); + + codecs.emplace(std::pair(SpvOpVectorShuffle, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(59, { + {0, 0, 0}, + {236660303, 0, 0}, + {342159236, 0, 0}, + {371428004, 0, 0}, + {373079619, 0, 0}, + {488500848, 0, 0}, + {495107308, 0, 0}, + {864295921, 0, 0}, + {1071164424, 0, 0}, + {1136911283, 0, 0}, + {1178317551, 0, 0}, + {1510422521, 0, 0}, + {1570165302, 0, 0}, + {1822823090, 0, 0}, + {1858116930, 0, 0}, + {1977038330, 0, 0}, + {2096388952, 0, 0}, + {2157103435, 0, 0}, + {2231688008, 0, 0}, + {2604576561, 0, 0}, + {2622612602, 0, 0}, + {2771938750, 0, 0}, + {2777172031, 0, 0}, + {2996594997, 0, 0}, + {3187066832, 0, 0}, + {3496407048, 0, 0}, + {3570411982, 0, 0}, + {3609540589, 0, 0}, + {3713290482, 0, 0}, + {3797761273, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 18, 8}, + {0, 27, 9}, + {0, 21, 10}, + {0, 14, 24}, + {0, 12, 19}, + {0, 11, 15}, + {0, 23, 2}, + {0, 7, 13}, + {0, 31, 22}, + {0, 32, 4}, + {0, 33, 29}, + {0, 34, 1}, + {0, 35, 3}, + {0, 37, 36}, + {0, 38, 28}, + {0, 39, 5}, + {0, 41, 40}, + {0, 42, 17}, + {0, 16, 43}, + {0, 45, 44}, + {0, 46, 6}, + {0, 48, 47}, + {0, 50, 49}, + {0, 52, 51}, + {0, 25, 53}, + {0, 54, 20}, + {0, 55, 26}, + {0, 57, 56}, + {0, 30, 58}, + })); + + codecs.emplace(std::pair(SpvOpVectorShuffle, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(47, { + {0, 0, 0}, + {236660303, 0, 0}, + {342159236, 0, 0}, + {488500848, 0, 0}, + {495107308, 0, 0}, + {864295921, 0, 0}, + {1178317551, 0, 0}, + {1510422521, 0, 0}, + {1570165302, 0, 0}, + {1858116930, 0, 0}, + {1977038330, 0, 0}, + {2096388952, 0, 0}, + {2157103435, 0, 0}, + {2231688008, 0, 0}, + {2604576561, 0, 0}, + {2622612602, 0, 0}, + {2771938750, 0, 0}, + {2777172031, 0, 0}, + {2996594997, 0, 0}, + {3496407048, 0, 0}, + {3570411982, 0, 0}, + {3609540589, 0, 0}, + {3713290482, 0, 0}, + {3797761273, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 21, 13}, + {0, 16, 6}, + {0, 14, 9}, + {0, 7, 10}, + {0, 18, 2}, + {0, 17, 5}, + {0, 25, 8}, + {0, 22, 12}, + {0, 26, 23}, + {0, 27, 1}, + {0, 28, 3}, + {0, 30, 29}, + {0, 32, 31}, + {0, 34, 33}, + {0, 35, 11}, + {0, 36, 4}, + {0, 38, 37}, + {0, 40, 39}, + {0, 41, 15}, + {0, 42, 19}, + {0, 20, 43}, + {0, 45, 44}, + {0, 24, 46}, + })); + + codecs.emplace(std::pair(SpvOpVectorShuffle, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(15, { + {0, 0, 0}, + {679771963, 0, 0}, + {1146476634, 0, 0}, + {2160380860, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {3800912395, 0, 0}, + {3802564010, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 3}, + {0, 9, 6}, + {0, 8, 7}, + {0, 11, 10}, + {0, 4, 12}, + {0, 5, 13}, + {0, 14, 1}, + })); + + codecs.emplace(std::pair(SpvOpCompositeConstruct, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(79, { + {0, 0, 0}, + {107497541, 0, 0}, + {289648234, 0, 0}, + {348584153, 0, 0}, + {369686787, 0, 0}, + {429277936, 0, 0}, + {449954059, 0, 0}, + {508217552, 0, 0}, + {742917749, 0, 0}, + {1032593647, 0, 0}, + {1158929937, 0, 0}, + {1209418480, 0, 0}, + {1319785741, 0, 0}, + {1321616112, 0, 0}, + {1417363940, 0, 0}, + {1541020250, 0, 0}, + {1564342316, 0, 0}, + {1578775276, 0, 0}, + {1631434666, 0, 0}, + {1636389511, 0, 0}, + {2012838864, 0, 0}, + {2262137600, 0, 0}, + {2281956980, 0, 0}, + {2359973133, 0, 0}, + {2464905186, 0, 0}, + {2613179511, 0, 0}, + {2621255555, 0, 0}, + {2817335337, 0, 0}, + {2881302403, 0, 0}, + {3063300848, 0, 0}, + {3151638847, 0, 0}, + {3233393284, 0, 0}, + {3323682385, 0, 0}, + {3337532056, 0, 0}, + {3456899824, 0, 0}, + {3547456240, 0, 0}, + {3675926744, 0, 0}, + {3753486980, 0, 0}, + {3931641900, 0, 0}, + {3970432934, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 25, 1}, + {0, 6, 4}, + {0, 8, 19}, + {0, 39, 24}, + {0, 3, 2}, + {0, 34, 14}, + {0, 10, 9}, + {0, 18, 38}, + {0, 32, 15}, + {0, 27, 16}, + {0, 28, 35}, + {0, 13, 26}, + {0, 20, 23}, + {0, 21, 11}, + {0, 36, 33}, + {0, 5, 22}, + {0, 42, 41}, + {0, 43, 29}, + {0, 45, 44}, + {0, 7, 46}, + {0, 48, 47}, + {0, 30, 31}, + {0, 50, 49}, + {0, 52, 51}, + {0, 54, 53}, + {0, 55, 17}, + {0, 57, 56}, + {0, 59, 58}, + {0, 61, 60}, + {0, 62, 12}, + {0, 64, 63}, + {0, 66, 65}, + {0, 67, 37}, + {0, 69, 68}, + {0, 71, 70}, + {0, 73, 72}, + {0, 75, 74}, + {0, 77, 76}, + {0, 40, 78}, + })); + + codecs.emplace(std::pair(SpvOpCompositeConstruct, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(87, { + {0, 0, 0}, + {153013225, 0, 0}, + {296836635, 0, 0}, + {296981500, 0, 0}, + {778500192, 0, 0}, + {810488476, 0, 0}, + {848380423, 0, 0}, + {900522183, 0, 0}, + {910398460, 0, 0}, + {959681532, 0, 0}, + {1141965917, 0, 0}, + {1287304304, 0, 0}, + {1323407757, 0, 0}, + {1417363940, 0, 0}, + {1471851763, 0, 0}, + {1526654696, 0, 0}, + {1654776395, 0, 0}, + {1684282922, 0, 0}, + {1739837626, 0, 0}, + {1791352211, 0, 0}, + {2195550588, 0, 0}, + {2319227476, 0, 0}, + {2491124112, 0, 0}, + {2789375411, 0, 0}, + {2807448986, 0, 0}, + {2817579280, 0, 0}, + {2835131395, 0, 0}, + {2847102741, 0, 0}, + {2855506940, 0, 0}, + {2860348412, 0, 0}, + {3079287749, 0, 0}, + {3091876332, 0, 0}, + {3168953855, 0, 0}, + {3374978006, 0, 0}, + {3399062057, 0, 0}, + {3510257966, 0, 0}, + {3554463148, 0, 0}, + {3579593979, 0, 0}, + {3757851979, 0, 0}, + {3759503594, 0, 0}, + {3761155209, 0, 0}, + {3762806824, 0, 0}, + {3902853271, 0, 0}, + {4140081844, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 38, 42}, + {0, 14, 23}, + {0, 26, 18}, + {0, 39, 35}, + {0, 6, 40}, + {0, 16, 13}, + {0, 33, 34}, + {0, 12, 4}, + {0, 27, 41}, + {0, 25, 21}, + {0, 24, 1}, + {0, 37, 19}, + {0, 32, 22}, + {0, 2, 8}, + {0, 20, 17}, + {0, 43, 36}, + {0, 29, 15}, + {0, 46, 45}, + {0, 48, 47}, + {0, 50, 49}, + {0, 52, 51}, + {0, 54, 53}, + {0, 7, 55}, + {0, 56, 30}, + {0, 57, 5}, + {0, 59, 58}, + {0, 60, 11}, + {0, 9, 61}, + {0, 63, 62}, + {0, 65, 64}, + {0, 66, 31}, + {0, 68, 67}, + {0, 10, 69}, + {0, 71, 70}, + {0, 28, 72}, + {0, 74, 73}, + {0, 76, 75}, + {0, 78, 77}, + {0, 79, 3}, + {0, 81, 80}, + {0, 83, 82}, + {0, 85, 84}, + {0, 44, 86}, + })); + + codecs.emplace(std::pair(SpvOpCompositeConstruct, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(81, { + {0, 0, 0}, + {14244860, 0, 0}, + {150820676, 0, 0}, + {153013225, 0, 0}, + {269823086, 0, 0}, + {289648234, 0, 0}, + {296981500, 0, 0}, + {678695941, 0, 0}, + {810488476, 0, 0}, + {850592577, 0, 0}, + {870594305, 0, 0}, + {910398460, 0, 0}, + {959681532, 0, 0}, + {1206571206, 0, 0}, + {1287304304, 0, 0}, + {1323407757, 0, 0}, + {1471851763, 0, 0}, + {1526654696, 0, 0}, + {1684282922, 0, 0}, + {1734446471, 0, 0}, + {1758530522, 0, 0}, + {2117320444, 0, 0}, + {2118972059, 0, 0}, + {2120623674, 0, 0}, + {2122275289, 0, 0}, + {2219733501, 0, 0}, + {2262321736, 0, 0}, + {2807448986, 0, 0}, + {2817579280, 0, 0}, + {2835131395, 0, 0}, + {2855506940, 0, 0}, + {2860348412, 0, 0}, + {2951272396, 0, 0}, + {3079287749, 0, 0}, + {3168953855, 0, 0}, + {3502816184, 0, 0}, + {3510257966, 0, 0}, + {3554463148, 0, 0}, + {3997952447, 0, 0}, + {4140081844, 0, 0}, + {4182141402, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 21, 26}, + {0, 29, 16}, + {0, 22, 36}, + {0, 1, 23}, + {0, 20, 5}, + {0, 19, 35}, + {0, 10, 38}, + {0, 13, 24}, + {0, 28, 7}, + {0, 27, 3}, + {0, 40, 2}, + {0, 34, 9}, + {0, 32, 11}, + {0, 33, 18}, + {0, 39, 37}, + {0, 31, 17}, + {0, 43, 42}, + {0, 45, 44}, + {0, 47, 46}, + {0, 49, 48}, + {0, 51, 50}, + {0, 8, 52}, + {0, 15, 53}, + {0, 55, 54}, + {0, 56, 14}, + {0, 58, 57}, + {0, 60, 59}, + {0, 61, 25}, + {0, 63, 62}, + {0, 4, 64}, + {0, 66, 65}, + {0, 68, 67}, + {0, 70, 69}, + {0, 71, 12}, + {0, 6, 72}, + {0, 30, 73}, + {0, 75, 74}, + {0, 77, 76}, + {0, 79, 78}, + {0, 41, 80}, + })); + + codecs.emplace(std::pair(SpvOpCompositeConstruct, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(111, { + {0, 0, 0}, + {34183582, 0, 0}, + {93914936, 0, 0}, + {94303122, 0, 0}, + {117998987, 0, 0}, + {153013225, 0, 0}, + {296981500, 0, 0}, + {451264926, 0, 0}, + {473485679, 0, 0}, + {476788909, 0, 0}, + {478440524, 0, 0}, + {480092139, 0, 0}, + {481743754, 0, 0}, + {810488476, 0, 0}, + {871966503, 0, 0}, + {910398460, 0, 0}, + {918189168, 0, 0}, + {933769938, 0, 0}, + {959681532, 0, 0}, + {1149665466, 0, 0}, + {1166917451, 0, 0}, + {1227221002, 0, 0}, + {1310740861, 0, 0}, + {1323407757, 0, 0}, + {1341516288, 0, 0}, + {1373166395, 0, 0}, + {1445161581, 0, 0}, + {1461645203, 0, 0}, + {1471851763, 0, 0}, + {1526654696, 0, 0}, + {1561718045, 0, 0}, + {1593584949, 0, 0}, + {1684282922, 0, 0}, + {1800404122, 0, 0}, + {1862284649, 0, 0}, + {2213411495, 0, 0}, + {2668680621, 0, 0}, + {2805256437, 0, 0}, + {2807448986, 0, 0}, + {2835131395, 0, 0}, + {2855506940, 0, 0}, + {2860348412, 0, 0}, + {3000904950, 0, 0}, + {3107413701, 0, 0}, + {3168953855, 0, 0}, + {3333131702, 0, 0}, + {3365041621, 0, 0}, + {3456899824, 0, 0}, + {3505028338, 0, 0}, + {3510257966, 0, 0}, + {3554463148, 0, 0}, + {3606320646, 0, 0}, + {3692647551, 0, 0}, + {3861006967, 0, 0}, + {4126287524, 0, 0}, + {4140081844, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 14, 33}, + {0, 35, 25}, + {0, 27, 17}, + {0, 8, 20}, + {0, 3, 54}, + {0, 1, 19}, + {0, 10, 46}, + {0, 11, 9}, + {0, 39, 28}, + {0, 53, 49}, + {0, 12, 2}, + {0, 34, 4}, + {0, 47, 36}, + {0, 23, 45}, + {0, 5, 37}, + {0, 24, 38}, + {0, 43, 26}, + {0, 48, 51}, + {0, 44, 32}, + {0, 15, 16}, + {0, 57, 22}, + {0, 55, 50}, + {0, 29, 58}, + {0, 60, 59}, + {0, 41, 61}, + {0, 63, 62}, + {0, 65, 64}, + {0, 67, 66}, + {0, 69, 68}, + {0, 13, 70}, + {0, 71, 7}, + {0, 42, 31}, + {0, 73, 72}, + {0, 75, 74}, + {0, 21, 30}, + {0, 77, 76}, + {0, 79, 78}, + {0, 81, 80}, + {0, 82, 18}, + {0, 84, 83}, + {0, 86, 85}, + {0, 88, 87}, + {0, 90, 89}, + {0, 52, 91}, + {0, 6, 92}, + {0, 94, 93}, + {0, 96, 95}, + {0, 98, 97}, + {0, 99, 40}, + {0, 101, 100}, + {0, 103, 102}, + {0, 105, 104}, + {0, 107, 106}, + {0, 109, 108}, + {0, 56, 110}, + })); + + codecs.emplace(std::pair(SpvOpCompositeConstruct, 4), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(155, { + {0, 0, 0}, + {18776483, 0, 0}, + {37009196, 0, 0}, + {277023757, 0, 0}, + {296981500, 0, 0}, + {348988933, 0, 0}, + {451264926, 0, 0}, + {564884461, 0, 0}, + {804899022, 0, 0}, + {810488476, 0, 0}, + {870594305, 0, 0}, + {876864198, 0, 0}, + {900522183, 0, 0}, + {928261291, 0, 0}, + {959681532, 0, 0}, + {1164724902, 0, 0}, + {1323407757, 0, 0}, + {1332774287, 0, 0}, + {1404739463, 0, 0}, + {1447712361, 0, 0}, + {1450415100, 0, 0}, + {1513770932, 0, 0}, + {1620634991, 0, 0}, + {1692600167, 0, 0}, + {1860649552, 0, 0}, + {1932614728, 0, 0}, + {2087004702, 0, 0}, + {2148510256, 0, 0}, + {2220475432, 0, 0}, + {2388524817, 0, 0}, + {2460489993, 0, 0}, + {2676385521, 0, 0}, + {2748350697, 0, 0}, + {2855506940, 0, 0}, + {2860348412, 0, 0}, + {2916400082, 0, 0}, + {2988365258, 0, 0}, + {3061856840, 0, 0}, + {3063508455, 0, 0}, + {3065160070, 0, 0}, + {3066811685, 0, 0}, + {3068463300, 0, 0}, + {3070114915, 0, 0}, + {3071766530, 0, 0}, + {3073418145, 0, 0}, + {3075069760, 0, 0}, + {3076721375, 0, 0}, + {3078372990, 0, 0}, + {3080024605, 0, 0}, + {3081676220, 0, 0}, + {3083327835, 0, 0}, + {3084979450, 0, 0}, + {3086631065, 0, 0}, + {3088282680, 0, 0}, + {3114708520, 0, 0}, + {3116360135, 0, 0}, + {3118011750, 0, 0}, + {3119663365, 0, 0}, + {3121314980, 0, 0}, + {3124618210, 0, 0}, + {3126269825, 0, 0}, + {3127921440, 0, 0}, + {3129573055, 0, 0}, + {3131224670, 0, 0}, + {3132876285, 0, 0}, + {3134527900, 0, 0}, + {3136179515, 0, 0}, + {3204260786, 0, 0}, + {3264086791, 0, 0}, + {3276225962, 0, 0}, + {3444275347, 0, 0}, + {3516240523, 0, 0}, + {3588205699, 0, 0}, + {3732136051, 0, 0}, + {3804101227, 0, 0}, + {3874089391, 0, 0}, + {4044115788, 0, 0}, + {4116080964, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 45, 43}, + {0, 3, 46}, + {0, 71, 36}, + {0, 44, 34}, + {0, 76, 54}, + {0, 73, 55}, + {0, 57, 67}, + {0, 51, 56}, + {0, 31, 27}, + {0, 38, 37}, + {0, 40, 39}, + {0, 42, 41}, + {0, 49, 47}, + {0, 35, 50}, + {0, 21, 70}, + {0, 19, 5}, + {0, 8, 58}, + {0, 17, 11}, + {0, 24, 18}, + {0, 30, 29}, + {0, 52, 9}, + {0, 77, 22}, + {0, 62, 48}, + {0, 25, 53}, + {0, 20, 59}, + {0, 26, 60}, + {0, 72, 6}, + {0, 79, 69}, + {0, 80, 7}, + {0, 81, 2}, + {0, 12, 13}, + {0, 82, 68}, + {0, 65, 61}, + {0, 74, 63}, + {0, 23, 83}, + {0, 64, 10}, + {0, 84, 32}, + {0, 66, 28}, + {0, 15, 85}, + {0, 86, 16}, + {0, 88, 87}, + {0, 90, 89}, + {0, 92, 91}, + {0, 1, 93}, + {0, 95, 94}, + {0, 97, 96}, + {0, 99, 98}, + {0, 100, 75}, + {0, 102, 101}, + {0, 104, 103}, + {0, 106, 105}, + {0, 107, 14}, + {0, 109, 108}, + {0, 111, 110}, + {0, 113, 112}, + {0, 115, 114}, + {0, 117, 116}, + {0, 119, 118}, + {0, 121, 120}, + {0, 123, 122}, + {0, 125, 124}, + {0, 127, 126}, + {0, 129, 128}, + {0, 131, 130}, + {0, 133, 132}, + {0, 135, 134}, + {0, 137, 136}, + {0, 139, 138}, + {0, 141, 140}, + {0, 143, 142}, + {0, 145, 144}, + {0, 147, 146}, + {0, 33, 148}, + {0, 4, 149}, + {0, 78, 150}, + {0, 152, 151}, + {0, 154, 153}, + })); + + codecs.emplace(std::pair(SpvOpCompositeConstruct, 5), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(11, { + {0, 0, 0}, + {679771963, 0, 0}, + {789872778, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 6, 2}, + {0, 4, 7}, + {0, 1, 8}, + {0, 9, 5}, + {0, 3, 10}, + })); + + codecs.emplace(std::pair(SpvOpCompositeExtract, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(49, { + {0, 0, 0}, + {126463145, 0, 0}, + {171307615, 0, 0}, + {342159236, 0, 0}, + {354479447, 0, 0}, + {593829839, 0, 0}, + {743407979, 0, 0}, + {898191441, 0, 0}, + {900522183, 0, 0}, + {1265796414, 0, 0}, + {1287304304, 0, 0}, + {1356063462, 0, 0}, + {1368383673, 0, 0}, + {1526654696, 0, 0}, + {1766994680, 0, 0}, + {1793544760, 0, 0}, + {1811839150, 0, 0}, + {2234361374, 0, 0}, + {2279700640, 0, 0}, + {2383939514, 0, 0}, + {2780898906, 0, 0}, + {2996594997, 0, 0}, + {3413713311, 0, 0}, + {3554463148, 0, 0}, + {3635542517, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 11, 15}, + {0, 20, 14}, + {0, 7, 18}, + {0, 6, 1}, + {0, 12, 10}, + {0, 23, 19}, + {0, 13, 5}, + {0, 24, 17}, + {0, 21, 3}, + {0, 22, 16}, + {0, 26, 2}, + {0, 27, 8}, + {0, 4, 28}, + {0, 29, 9}, + {0, 31, 30}, + {0, 33, 32}, + {0, 35, 34}, + {0, 37, 36}, + {0, 39, 38}, + {0, 41, 40}, + {0, 43, 42}, + {0, 45, 44}, + {0, 47, 46}, + {0, 25, 48}, + })); + + codecs.emplace(std::pair(SpvOpCompositeExtract, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(153, { + {0, 0, 0}, + {13107491, 0, 0}, + {257136089, 0, 0}, + {293528591, 0, 0}, + {321459212, 0, 0}, + {425022309, 0, 0}, + {490769168, 0, 0}, + {495107308, 0, 0}, + {517919178, 0, 0}, + {617312262, 0, 0}, + {708736129, 0, 0}, + {753756604, 0, 0}, + {765238787, 0, 0}, + {796985462, 0, 0}, + {819503463, 0, 0}, + {850497536, 0, 0}, + {948086521, 0, 0}, + {1004589179, 0, 0}, + {1120149824, 0, 0}, + {1165671422, 0, 0}, + {1203545131, 0, 0}, + {1297165140, 0, 0}, + {1335363438, 0, 0}, + {1351676723, 0, 0}, + {1391866096, 0, 0}, + {1584369690, 0, 0}, + {1631216488, 0, 0}, + {1691646294, 0, 0}, + {1779143013, 0, 0}, + {1858116930, 0, 0}, + {1890300748, 0, 0}, + {1915438939, 0, 0}, + {1918742169, 0, 0}, + {1922045399, 0, 0}, + {1961990747, 0, 0}, + {2037710159, 0, 0}, + {2037814253, 0, 0}, + {2043873558, 0, 0}, + {2096388952, 0, 0}, + {2169307971, 0, 0}, + {2257843797, 0, 0}, + {2262220987, 0, 0}, + {2338272340, 0, 0}, + {2405770322, 0, 0}, + {2498042266, 0, 0}, + {2563789125, 0, 0}, + {2588618056, 0, 0}, + {2645120714, 0, 0}, + {2864863800, 0, 0}, + {2909957084, 0, 0}, + {2975894973, 0, 0}, + {3041450802, 0, 0}, + {3151638847, 0, 0}, + {3187066832, 0, 0}, + {3244716568, 0, 0}, + {3271748023, 0, 0}, + {3304438238, 0, 0}, + {3312467582, 0, 0}, + {3325419312, 0, 0}, + {3370185097, 0, 0}, + {3419674548, 0, 0}, + {3435931956, 0, 0}, + {3504158761, 0, 0}, + {3602522282, 0, 0}, + {3653059026, 0, 0}, + {3716353056, 0, 0}, + {3782099915, 0, 0}, + {3838648480, 0, 0}, + {3847846774, 0, 0}, + {3913593633, 0, 0}, + {3989799199, 0, 0}, + {3997038726, 0, 0}, + {4046301857, 0, 0}, + {4092654294, 0, 0}, + {4176581069, 0, 0}, + {4242327928, 0, 0}, + {4285652249, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 74, 38}, + {0, 12, 56}, + {0, 28, 24}, + {0, 60, 43}, + {0, 65, 72}, + {0, 18, 2}, + {0, 52, 3}, + {0, 19, 10}, + {0, 49, 36}, + {0, 67, 66}, + {0, 41, 17}, + {0, 53, 11}, + {0, 29, 68}, + {0, 26, 55}, + {0, 70, 76}, + {0, 73, 47}, + {0, 51, 22}, + {0, 39, 21}, + {0, 5, 9}, + {0, 40, 48}, + {0, 59, 44}, + {0, 6, 69}, + {0, 32, 31}, + {0, 4, 33}, + {0, 13, 54}, + {0, 14, 50}, + {0, 35, 75}, + {0, 58, 23}, + {0, 16, 34}, + {0, 27, 63}, + {0, 45, 61}, + {0, 20, 46}, + {0, 71, 1}, + {0, 79, 78}, + {0, 81, 80}, + {0, 83, 82}, + {0, 84, 8}, + {0, 86, 85}, + {0, 88, 87}, + {0, 90, 89}, + {0, 92, 91}, + {0, 94, 93}, + {0, 96, 95}, + {0, 98, 97}, + {0, 64, 99}, + {0, 101, 100}, + {0, 103, 102}, + {0, 105, 104}, + {0, 106, 62}, + {0, 108, 107}, + {0, 110, 109}, + {0, 7, 111}, + {0, 113, 112}, + {0, 115, 114}, + {0, 117, 116}, + {0, 119, 118}, + {0, 121, 120}, + {0, 123, 122}, + {0, 30, 124}, + {0, 126, 125}, + {0, 128, 127}, + {0, 130, 129}, + {0, 132, 131}, + {0, 134, 133}, + {0, 135, 25}, + {0, 57, 136}, + {0, 138, 137}, + {0, 42, 139}, + {0, 37, 140}, + {0, 142, 141}, + {0, 143, 15}, + {0, 145, 144}, + {0, 147, 146}, + {0, 149, 148}, + {0, 151, 150}, + {0, 152, 77}, + })); + + codecs.emplace(std::pair(SpvOpCompositeExtract, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(47, { + {0, 0, 0}, + {545678922, 0, 0}, + {630592085, 0, 0}, + {679771963, 0, 0}, + {899570100, 0, 0}, + {906176560, 0, 0}, + {929101967, 0, 0}, + {1100599986, 0, 0}, + {1103903216, 0, 0}, + {1107206446, 0, 0}, + {1369578001, 0, 0}, + {1372881231, 0, 0}, + {2320303498, 0, 0}, + {2926633629, 0, 0}, + {3249265647, 0, 0}, + {3334207724, 0, 0}, + {3486057732, 0, 0}, + {3674863070, 0, 0}, + {3705139860, 0, 0}, + {3800912395, 0, 0}, + {3802564010, 0, 0}, + {3822983876, 0, 0}, + {4141567741, 0, 0}, + {4292991777, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 9, 17}, + {0, 20, 11}, + {0, 25, 5}, + {0, 2, 14}, + {0, 23, 13}, + {0, 16, 26}, + {0, 27, 24}, + {0, 28, 8}, + {0, 29, 18}, + {0, 22, 30}, + {0, 6, 31}, + {0, 21, 32}, + {0, 3, 33}, + {0, 35, 34}, + {0, 1, 12}, + {0, 10, 36}, + {0, 37, 19}, + {0, 4, 15}, + {0, 39, 38}, + {0, 7, 40}, + {0, 42, 41}, + {0, 44, 43}, + {0, 46, 45}, + })); + + codecs.emplace(std::pair(SpvOpCompositeInsert, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(103, { + {0, 0, 0}, + {125792961, 0, 0}, + {132755933, 0, 0}, + {156014509, 0, 0}, + {436066778, 0, 0}, + {463084678, 0, 0}, + {531559080, 0, 0}, + {565233904, 0, 0}, + {578132535, 0, 0}, + {600906020, 0, 0}, + {602222721, 0, 0}, + {694743357, 0, 0}, + {760554870, 0, 0}, + {996663016, 0, 0}, + {1022309772, 0, 0}, + {1351676723, 0, 0}, + {1496901698, 0, 0}, + {1502470404, 0, 0}, + {1522901980, 0, 0}, + {1548254487, 0, 0}, + {1637661947, 0, 0}, + {1788504755, 0, 0}, + {2092468906, 0, 0}, + {2094647776, 0, 0}, + {2127660080, 0, 0}, + {2213946343, 0, 0}, + {2225172640, 0, 0}, + {2259467579, 0, 0}, + {2263866576, 0, 0}, + {2600961503, 0, 0}, + {2727022058, 0, 0}, + {2752967311, 0, 0}, + {2864705739, 0, 0}, + {3021406120, 0, 0}, + {3044723416, 0, 0}, + {3052439312, 0, 0}, + {3136865519, 0, 0}, + {3297860332, 0, 0}, + {3352361837, 0, 0}, + {3670298840, 0, 0}, + {3712946115, 0, 0}, + {3732709413, 0, 0}, + {3764662384, 0, 0}, + {3788324110, 0, 0}, + {3928555688, 0, 0}, + {4083347580, 0, 0}, + {4098876453, 0, 0}, + {4147239510, 0, 0}, + {4199470013, 0, 0}, + {4211577142, 0, 0}, + {4218799564, 0, 0}, + {4290374884, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 2}, + {0, 9, 8}, + {0, 17, 10}, + {0, 20, 18}, + {0, 22, 21}, + {0, 26, 23}, + {0, 31, 29}, + {0, 35, 34}, + {0, 45, 36}, + {0, 5, 3}, + {0, 12, 6}, + {0, 15, 14}, + {0, 25, 19}, + {0, 28, 27}, + {0, 38, 33}, + {0, 43, 39}, + {0, 47, 46}, + {0, 50, 49}, + {0, 7, 51}, + {0, 1, 48}, + {0, 37, 24}, + {0, 44, 42}, + {0, 13, 11}, + {0, 41, 40}, + {0, 54, 53}, + {0, 56, 55}, + {0, 58, 57}, + {0, 60, 59}, + {0, 62, 61}, + {0, 64, 63}, + {0, 66, 65}, + {0, 68, 67}, + {0, 70, 69}, + {0, 72, 71}, + {0, 30, 16}, + {0, 73, 32}, + {0, 75, 74}, + {0, 77, 76}, + {0, 79, 78}, + {0, 81, 80}, + {0, 83, 82}, + {0, 85, 84}, + {0, 87, 86}, + {0, 89, 88}, + {0, 91, 90}, + {0, 93, 92}, + {0, 95, 94}, + {0, 97, 96}, + {0, 99, 98}, + {0, 101, 100}, + {0, 52, 102}, + })); + + codecs.emplace(std::pair(SpvOpCompositeInsert, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(93, { + {0, 0, 0}, + {17185761, 0, 0}, + {117250846, 0, 0}, + {296981500, 0, 0}, + {330388453, 0, 0}, + {346929928, 0, 0}, + {533021259, 0, 0}, + {564302770, 0, 0}, + {680157484, 0, 0}, + {721450866, 0, 0}, + {798549062, 0, 0}, + {853200279, 0, 0}, + {864295921, 0, 0}, + {900522183, 0, 0}, + {973908139, 0, 0}, + {983243705, 0, 0}, + {1033363654, 0, 0}, + {1037370721, 0, 0}, + {1464587427, 0, 0}, + {1670691893, 0, 0}, + {1686512349, 0, 0}, + {1849065716, 0, 0}, + {1917602962, 0, 0}, + {1965902997, 0, 0}, + {2121980967, 0, 0}, + {2311072371, 0, 0}, + {2339901602, 0, 0}, + {2517964682, 0, 0}, + {2542834724, 0, 0}, + {2558655180, 0, 0}, + {2736881867, 0, 0}, + {2855506940, 0, 0}, + {2888753905, 0, 0}, + {2950446516, 0, 0}, + {3044188332, 0, 0}, + {3079287749, 0, 0}, + {3153451899, 0, 0}, + {3214537066, 0, 0}, + {3234673086, 0, 0}, + {3349230696, 0, 0}, + {3504158761, 0, 0}, + {3570411982, 0, 0}, + {3652695478, 0, 0}, + {3764205609, 0, 0}, + {3940720663, 0, 0}, + {4180570743, 0, 0}, + {4221373527, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 24, 18}, + {0, 4, 2}, + {0, 15, 14}, + {0, 21, 20}, + {0, 29, 26}, + {0, 42, 36}, + {0, 7, 45}, + {0, 37, 9}, + {0, 8, 5}, + {0, 32, 11}, + {0, 39, 38}, + {0, 12, 10}, + {0, 28, 19}, + {0, 1, 46}, + {0, 17, 6}, + {0, 30, 23}, + {0, 44, 33}, + {0, 35, 13}, + {0, 16, 48}, + {0, 50, 49}, + {0, 52, 51}, + {0, 54, 53}, + {0, 55, 40}, + {0, 57, 56}, + {0, 59, 58}, + {0, 61, 60}, + {0, 25, 22}, + {0, 63, 62}, + {0, 3, 64}, + {0, 66, 65}, + {0, 68, 67}, + {0, 70, 69}, + {0, 34, 71}, + {0, 73, 72}, + {0, 75, 74}, + {0, 77, 76}, + {0, 27, 43}, + {0, 79, 78}, + {0, 81, 80}, + {0, 83, 82}, + {0, 84, 31}, + {0, 86, 85}, + {0, 41, 87}, + {0, 89, 88}, + {0, 91, 90}, + {0, 47, 92}, + })); + + codecs.emplace(std::pair(SpvOpCompositeInsert, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(115, { + {0, 0, 0}, + {132755933, 0, 0}, + {156014509, 0, 0}, + {255227811, 0, 0}, + {371186900, 0, 0}, + {371428004, 0, 0}, + {374731234, 0, 0}, + {531559080, 0, 0}, + {565233904, 0, 0}, + {578132535, 0, 0}, + {591140762, 0, 0}, + {600906020, 0, 0}, + {602222721, 0, 0}, + {656610661, 0, 0}, + {760554870, 0, 0}, + {996663016, 0, 0}, + {1022309772, 0, 0}, + {1496901698, 0, 0}, + {1502470404, 0, 0}, + {1522901980, 0, 0}, + {1536350567, 0, 0}, + {1543280290, 0, 0}, + {1548254487, 0, 0}, + {1788504755, 0, 0}, + {2064733527, 0, 0}, + {2092468906, 0, 0}, + {2094647776, 0, 0}, + {2162986400, 0, 0}, + {2225172640, 0, 0}, + {2259467579, 0, 0}, + {2263866576, 0, 0}, + {2360004627, 0, 0}, + {2507709226, 0, 0}, + {2600961503, 0, 0}, + {2727022058, 0, 0}, + {2752967311, 0, 0}, + {2864705739, 0, 0}, + {3021406120, 0, 0}, + {3052439312, 0, 0}, + {3136865519, 0, 0}, + {3297860332, 0, 0}, + {3352361837, 0, 0}, + {3598957382, 0, 0}, + {3619787319, 0, 0}, + {3655201337, 0, 0}, + {3670298840, 0, 0}, + {3774892253, 0, 0}, + {3788324110, 0, 0}, + {3808408202, 0, 0}, + {3951925872, 0, 0}, + {3952316364, 0, 0}, + {4098876453, 0, 0}, + {4147239510, 0, 0}, + {4199470013, 0, 0}, + {4211577142, 0, 0}, + {4217306348, 0, 0}, + {4218799564, 0, 0}, + {4290374884, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 6, 43}, + {0, 4, 1}, + {0, 11, 9}, + {0, 13, 12}, + {0, 19, 18}, + {0, 25, 23}, + {0, 28, 26}, + {0, 35, 33}, + {0, 39, 38}, + {0, 2, 49}, + {0, 7, 3}, + {0, 16, 14}, + {0, 29, 22}, + {0, 37, 30}, + {0, 45, 41}, + {0, 51, 47}, + {0, 54, 52}, + {0, 57, 56}, + {0, 53, 8}, + {0, 32, 10}, + {0, 42, 40}, + {0, 24, 46}, + {0, 15, 50}, + {0, 55, 20}, + {0, 59, 44}, + {0, 61, 60}, + {0, 63, 62}, + {0, 65, 64}, + {0, 67, 66}, + {0, 69, 68}, + {0, 71, 70}, + {0, 73, 72}, + {0, 75, 74}, + {0, 77, 76}, + {0, 31, 17}, + {0, 36, 34}, + {0, 79, 78}, + {0, 81, 80}, + {0, 27, 82}, + {0, 5, 21}, + {0, 48, 83}, + {0, 85, 84}, + {0, 87, 86}, + {0, 89, 88}, + {0, 91, 90}, + {0, 93, 92}, + {0, 95, 94}, + {0, 97, 96}, + {0, 99, 98}, + {0, 101, 100}, + {0, 103, 102}, + {0, 105, 104}, + {0, 107, 106}, + {0, 109, 108}, + {0, 111, 110}, + {0, 113, 112}, + {0, 58, 114}, + })); + + codecs.emplace(std::pair(SpvOpCompositeInsert, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {3866587616, 0, 0}, + {3868239231, 0, 0}, + {3869890846, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 4}, + {0, 2, 5}, + {0, 3, 6}, + })); + + codecs.emplace(std::pair(SpvOpSampledImage, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {1164218401, 0, 0}, + {2036361232, 0, 0}, + {2637132451, 0, 0}, + {3237903670, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 5}, + {0, 3, 6}, + {0, 1, 7}, + {0, 2, 8}, + })); + + codecs.emplace(std::pair(SpvOpSampledImage, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {543558236, 0, 0}, + {1069781886, 0, 0}, + {1596005536, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 4}, + {0, 2, 5}, + {0, 1, 6}, + })); + + codecs.emplace(std::pair(SpvOpSampledImage, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {1949759310, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpSampledImage, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpImageSampleImplicitLod, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(87, { + {0, 0, 0}, + {236660303, 0, 0}, + {347505241, 0, 0}, + {426360862, 0, 0}, + {439998433, 0, 0}, + {488500848, 0, 0}, + {495107308, 0, 0}, + {868652905, 0, 0}, + {1191735827, 0, 0}, + {1265998516, 0, 0}, + {1309728002, 0, 0}, + {1365842164, 0, 0}, + {1396344138, 0, 0}, + {1508074873, 0, 0}, + {1553476262, 0, 0}, + {1642818143, 0, 0}, + {1851510470, 0, 0}, + {1858116930, 0, 0}, + {1863199739, 0, 0}, + {1979978194, 0, 0}, + {1986584654, 0, 0}, + {2092100514, 0, 0}, + {2098706974, 0, 0}, + {2231688008, 0, 0}, + {2232491275, 0, 0}, + {2329992200, 0, 0}, + {2637935122, 0, 0}, + {2693892518, 0, 0}, + {2759250216, 0, 0}, + {2839765116, 0, 0}, + {2855895374, 0, 0}, + {2913136690, 0, 0}, + {3012980338, 0, 0}, + {3327770644, 0, 0}, + {3362344229, 0, 0}, + {3398925952, 0, 0}, + {3448018532, 0, 0}, + {3457985288, 0, 0}, + {3566035349, 0, 0}, + {3657635382, 0, 0}, + {3702405475, 0, 0}, + {3757479030, 0, 0}, + {3797204453, 0, 0}, + {4291477370, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 32, 28}, + {0, 9, 35}, + {0, 31, 11}, + {0, 10, 30}, + {0, 25, 21}, + {0, 40, 2}, + {0, 15, 19}, + {0, 24, 36}, + {0, 42, 4}, + {0, 18, 16}, + {0, 29, 26}, + {0, 43, 7}, + {0, 45, 8}, + {0, 37, 13}, + {0, 47, 46}, + {0, 48, 33}, + {0, 49, 14}, + {0, 3, 22}, + {0, 50, 12}, + {0, 41, 39}, + {0, 51, 34}, + {0, 52, 20}, + {0, 54, 53}, + {0, 56, 55}, + {0, 58, 57}, + {0, 60, 59}, + {0, 61, 23}, + {0, 63, 62}, + {0, 65, 64}, + {0, 27, 66}, + {0, 67, 38}, + {0, 68, 17}, + {0, 70, 69}, + {0, 72, 71}, + {0, 74, 73}, + {0, 76, 75}, + {0, 5, 77}, + {0, 78, 1}, + {0, 80, 79}, + {0, 82, 81}, + {0, 83, 6}, + {0, 85, 84}, + {0, 44, 86}, + })); + + codecs.emplace(std::pair(SpvOpImageSampleImplicitLod, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(15, { + {0, 0, 0}, + {883854656, 0, 0}, + {1962971231, 0, 0}, + {2036361232, 0, 0}, + {2356768706, 0, 0}, + {2637132451, 0, 0}, + {3237903670, 0, 0}, + {3829682756, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 8, 2}, + {0, 6, 9}, + {0, 10, 7}, + {0, 4, 5}, + {0, 12, 11}, + {0, 3, 13}, + {0, 14, 1}, + })); + + codecs.emplace(std::pair(SpvOpImageSampleImplicitLod, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(87, { + {0, 0, 0}, + {150685616, 0, 0}, + {255302575, 0, 0}, + {414620710, 0, 0}, + {557400685, 0, 0}, + {575205902, 0, 0}, + {618761615, 0, 0}, + {646282397, 0, 0}, + {686024761, 0, 0}, + {740921498, 0, 0}, + {921246433, 0, 0}, + {1057578789, 0, 0}, + {1162127370, 0, 0}, + {1329499601, 0, 0}, + {1352628475, 0, 0}, + {1502028603, 0, 0}, + {1519723107, 0, 0}, + {1543798545, 0, 0}, + {1545450160, 0, 0}, + {1570165302, 0, 0}, + {1600392975, 0, 0}, + {1641415225, 0, 0}, + {2204920111, 0, 0}, + {2257971049, 0, 0}, + {2276405827, 0, 0}, + {2339018837, 0, 0}, + {2340670452, 0, 0}, + {2517964682, 0, 0}, + {2532518896, 0, 0}, + {2674090849, 0, 0}, + {2754074729, 0, 0}, + {2804281092, 0, 0}, + {2816338013, 0, 0}, + {2841008029, 0, 0}, + {3234673086, 0, 0}, + {3249261197, 0, 0}, + {3619787319, 0, 0}, + {3627739127, 0, 0}, + {3669223677, 0, 0}, + {3787567939, 0, 0}, + {3898287302, 0, 0}, + {4142016703, 0, 0}, + {4237092412, 0, 0}, + {4285779501, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 16, 15}, + {0, 2, 33}, + {0, 41, 35}, + {0, 32, 30}, + {0, 39, 38}, + {0, 5, 1}, + {0, 9, 43}, + {0, 40, 22}, + {0, 29, 12}, + {0, 4, 3}, + {0, 25, 37}, + {0, 34, 26}, + {0, 45, 19}, + {0, 31, 24}, + {0, 47, 46}, + {0, 48, 20}, + {0, 49, 6}, + {0, 8, 21}, + {0, 50, 11}, + {0, 13, 10}, + {0, 51, 42}, + {0, 52, 23}, + {0, 54, 53}, + {0, 56, 55}, + {0, 58, 57}, + {0, 60, 59}, + {0, 61, 28}, + {0, 63, 62}, + {0, 65, 64}, + {0, 17, 66}, + {0, 67, 18}, + {0, 68, 7}, + {0, 70, 69}, + {0, 72, 71}, + {0, 74, 73}, + {0, 76, 75}, + {0, 14, 77}, + {0, 78, 27}, + {0, 80, 79}, + {0, 82, 81}, + {0, 83, 36}, + {0, 85, 84}, + {0, 44, 86}, + })); + + codecs.emplace(std::pair(SpvOpImageSampleImplicitLod, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {2855506940, 0, 0}, + {3266548732, 0, 0}, + {3732640764, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 1}, + {0, 5, 4}, + {0, 3, 6}, + })); + + codecs.emplace(std::pair(SpvOpImageSampleImplicitLod, 5), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpImageSampleExplicitLod, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(139, { + {0, 0, 0}, + {27177503, 0, 0}, + {30663912, 0, 0}, + {151672195, 0, 0}, + {162608772, 0, 0}, + {180913835, 0, 0}, + {371621315, 0, 0}, + {414444763, 0, 0}, + {421602934, 0, 0}, + {443347828, 0, 0}, + {458937500, 0, 0}, + {587888644, 0, 0}, + {601656217, 0, 0}, + {665789406, 0, 0}, + {712168842, 0, 0}, + {730943059, 0, 0}, + {750870327, 0, 0}, + {875212982, 0, 0}, + {899320334, 0, 0}, + {973908139, 0, 0}, + {989813600, 0, 0}, + {1057606514, 0, 0}, + {1171541710, 0, 0}, + {1243764146, 0, 0}, + {1310404265, 0, 0}, + {1366337101, 0, 0}, + {1443547269, 0, 0}, + {1472185378, 0, 0}, + {1473799048, 0, 0}, + {1543935193, 0, 0}, + {1572834111, 0, 0}, + {1623013158, 0, 0}, + {1686512349, 0, 0}, + {1705716306, 0, 0}, + {1747355813, 0, 0}, + {1755165354, 0, 0}, + {1781864804, 0, 0}, + {1916983087, 0, 0}, + {1941403425, 0, 0}, + {2023008475, 0, 0}, + {2043684541, 0, 0}, + {2274226560, 0, 0}, + {2285438321, 0, 0}, + {2315690100, 0, 0}, + {2344328209, 0, 0}, + {2414725163, 0, 0}, + {2493146691, 0, 0}, + {2495155989, 0, 0}, + {2558655180, 0, 0}, + {2577859137, 0, 0}, + {2857814560, 0, 0}, + {2895151306, 0, 0}, + {2986830770, 0, 0}, + {3006548167, 0, 0}, + {3127329373, 0, 0}, + {3157581152, 0, 0}, + {3216471040, 0, 0}, + {3296722158, 0, 0}, + {3367298820, 0, 0}, + {3376009661, 0, 0}, + {3450001968, 0, 0}, + {3526837441, 0, 0}, + {3609540589, 0, 0}, + {3743398113, 0, 0}, + {3858973601, 0, 0}, + {3953984401, 0, 0}, + {3999472204, 0, 0}, + {4088613871, 0, 0}, + {4184019303, 0, 0}, + {4258229445, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 31, 16}, + {0, 58, 47}, + {0, 21, 61}, + {0, 6, 14}, + {0, 65, 23}, + {0, 35, 5}, + {0, 2, 7}, + {0, 10, 25}, + {0, 40, 22}, + {0, 9, 50}, + {0, 20, 11}, + {0, 38, 36}, + {0, 13, 12}, + {0, 67, 28}, + {0, 71, 68}, + {0, 73, 72}, + {0, 3, 29}, + {0, 27, 8}, + {0, 44, 37}, + {0, 74, 63}, + {0, 76, 75}, + {0, 18, 1}, + {0, 78, 77}, + {0, 80, 79}, + {0, 82, 81}, + {0, 26, 15}, + {0, 83, 43}, + {0, 85, 84}, + {0, 19, 86}, + {0, 48, 32}, + {0, 33, 46}, + {0, 87, 49}, + {0, 89, 88}, + {0, 91, 90}, + {0, 41, 30}, + {0, 52, 42}, + {0, 64, 55}, + {0, 92, 53}, + {0, 94, 93}, + {0, 51, 39}, + {0, 45, 95}, + {0, 66, 54}, + {0, 97, 96}, + {0, 57, 98}, + {0, 99, 69}, + {0, 101, 100}, + {0, 56, 102}, + {0, 4, 59}, + {0, 34, 17}, + {0, 103, 24}, + {0, 105, 104}, + {0, 107, 106}, + {0, 109, 108}, + {0, 60, 110}, + {0, 111, 62}, + {0, 113, 112}, + {0, 115, 114}, + {0, 117, 116}, + {0, 119, 118}, + {0, 121, 120}, + {0, 123, 122}, + {0, 125, 124}, + {0, 127, 126}, + {0, 129, 128}, + {0, 70, 130}, + {0, 132, 131}, + {0, 134, 133}, + {0, 136, 135}, + {0, 138, 137}, + })); + + codecs.emplace(std::pair(SpvOpImageSampleExplicitLod, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(11, { + {0, 0, 0}, + {883854656, 0, 0}, + {1962971231, 0, 0}, + {2036361232, 0, 0}, + {2366506734, 0, 0}, + {3829682756, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 2}, + {0, 6, 7}, + {0, 8, 5}, + {0, 3, 9}, + {0, 1, 10}, + })); + + codecs.emplace(std::pair(SpvOpImageSampleExplicitLod, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(73, { + {0, 0, 0}, + {178571546, 0, 0}, + {223310468, 0, 0}, + {388034151, 0, 0}, + {449954059, 0, 0}, + {694743357, 0, 0}, + {797415788, 0, 0}, + {835638766, 0, 0}, + {1002144380, 0, 0}, + {1221183390, 0, 0}, + {1570165302, 0, 0}, + {1663234329, 0, 0}, + {1750829822, 0, 0}, + {1894133125, 0, 0}, + {1967643923, 0, 0}, + {1980341560, 0, 0}, + {2278706468, 0, 0}, + {2326990117, 0, 0}, + {2464905186, 0, 0}, + {2511346984, 0, 0}, + {2517964682, 0, 0}, + {2616085763, 0, 0}, + {2710583246, 0, 0}, + {2745872368, 0, 0}, + {2924263085, 0, 0}, + {3027500544, 0, 0}, + {3044723416, 0, 0}, + {3202324433, 0, 0}, + {3289213933, 0, 0}, + {3323682385, 0, 0}, + {3366848728, 0, 0}, + {3417583519, 0, 0}, + {3732916270, 0, 0}, + {3787909072, 0, 0}, + {3877813395, 0, 0}, + {4028028350, 0, 0}, + {4178218543, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 36, 31}, + {0, 15, 3}, + {0, 17, 1}, + {0, 24, 12}, + {0, 35, 34}, + {0, 28, 27}, + {0, 21, 38}, + {0, 6, 13}, + {0, 14, 7}, + {0, 39, 25}, + {0, 40, 30}, + {0, 42, 41}, + {0, 32, 43}, + {0, 23, 9}, + {0, 11, 44}, + {0, 45, 22}, + {0, 47, 46}, + {0, 2, 16}, + {0, 49, 48}, + {0, 4, 50}, + {0, 51, 18}, + {0, 53, 52}, + {0, 33, 54}, + {0, 26, 55}, + {0, 57, 56}, + {0, 5, 58}, + {0, 59, 8}, + {0, 19, 60}, + {0, 10, 61}, + {0, 29, 62}, + {0, 37, 63}, + {0, 65, 64}, + {0, 67, 66}, + {0, 20, 68}, + {0, 70, 69}, + {0, 72, 71}, + })); + + codecs.emplace(std::pair(SpvOpImageSampleExplicitLod, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {2855506940, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpImageSampleExplicitLod, 5), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(13, { + {0, 0, 0}, + {3533637837, 0, 0}, + {3535289452, 0, 0}, + {3536941067, 0, 0}, + {3538592682, 0, 0}, + {3540244297, 0, 0}, + {3541895912, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 7}, + {0, 2, 8}, + {0, 9, 3}, + {0, 4, 10}, + {0, 5, 11}, + {0, 12, 6}, + })); + + codecs.emplace(std::pair(SpvOpImageSampleExplicitLod, 6), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 5}, + {0, 2, 6}, + {0, 1, 3}, + {0, 8, 7}, + })); + + codecs.emplace(std::pair(SpvOpFAdd, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(45, { + {0, 0, 0}, + {328661377, 0, 0}, + {464259778, 0, 0}, + {920941800, 0, 0}, + {969500141, 0, 0}, + {1449907751, 0, 0}, + {1451831482, 0, 0}, + {1543798545, 0, 0}, + {1545450160, 0, 0}, + {1626224034, 0, 0}, + {1669930486, 0, 0}, + {1770165905, 0, 0}, + {2278571792, 0, 0}, + {2432827426, 0, 0}, + {2656211099, 0, 0}, + {2736844435, 0, 0}, + {2870852215, 0, 0}, + {2919626325, 0, 0}, + {2923708820, 0, 0}, + {3325419312, 0, 0}, + {3678875745, 0, 0}, + {4182141402, 0, 0}, + {4241374559, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 2, 6}, + {0, 9, 13}, + {0, 5, 15}, + {0, 4, 11}, + {0, 20, 22}, + {0, 10, 1}, + {0, 18, 14}, + {0, 16, 3}, + {0, 12, 21}, + {0, 8, 7}, + {0, 24, 17}, + {0, 19, 25}, + {0, 27, 26}, + {0, 29, 28}, + {0, 31, 30}, + {0, 33, 32}, + {0, 35, 34}, + {0, 37, 36}, + {0, 39, 38}, + {0, 41, 40}, + {0, 43, 42}, + {0, 23, 44}, + })); + + codecs.emplace(std::pair(SpvOpFAdd, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(89, { + {0, 0, 0}, + {135920445, 0, 0}, + {176166202, 0, 0}, + {294390719, 0, 0}, + {296981500, 0, 0}, + {743407979, 0, 0}, + {810488476, 0, 0}, + {837715723, 0, 0}, + {885020215, 0, 0}, + {922996215, 0, 0}, + {959681532, 0, 0}, + {963902061, 0, 0}, + {1136775085, 0, 0}, + {1189681639, 0, 0}, + {1203545131, 0, 0}, + {1297294717, 0, 0}, + {1317058015, 0, 0}, + {1352397672, 0, 0}, + {1367301635, 0, 0}, + {1412908157, 0, 0}, + {1570165302, 0, 0}, + {1763758554, 0, 0}, + {1791427568, 0, 0}, + {1992893964, 0, 0}, + {2013867381, 0, 0}, + {2096388952, 0, 0}, + {2219733501, 0, 0}, + {2383939514, 0, 0}, + {2517964682, 0, 0}, + {2555315060, 0, 0}, + {2572638469, 0, 0}, + {2762094724, 0, 0}, + {2770161927, 0, 0}, + {2855506940, 0, 0}, + {3044188332, 0, 0}, + {3187066832, 0, 0}, + {3319278167, 0, 0}, + {3653838348, 0, 0}, + {3675926744, 0, 0}, + {3701632935, 0, 0}, + {3712946115, 0, 0}, + {3732709413, 0, 0}, + {3743748793, 0, 0}, + {3783543823, 0, 0}, + {3930727258, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 15, 12}, + {0, 38, 16}, + {0, 41, 40}, + {0, 1, 33}, + {0, 21, 34}, + {0, 9, 2}, + {0, 24, 7}, + {0, 39, 44}, + {0, 29, 22}, + {0, 17, 19}, + {0, 36, 32}, + {0, 26, 18}, + {0, 30, 3}, + {0, 11, 8}, + {0, 42, 35}, + {0, 46, 31}, + {0, 27, 5}, + {0, 48, 47}, + {0, 28, 49}, + {0, 51, 50}, + {0, 52, 23}, + {0, 54, 53}, + {0, 13, 14}, + {0, 6, 55}, + {0, 57, 56}, + {0, 59, 58}, + {0, 60, 43}, + {0, 62, 61}, + {0, 37, 63}, + {0, 65, 64}, + {0, 67, 66}, + {0, 69, 68}, + {0, 70, 4}, + {0, 10, 71}, + {0, 72, 20}, + {0, 74, 73}, + {0, 76, 75}, + {0, 78, 77}, + {0, 80, 79}, + {0, 81, 25}, + {0, 83, 82}, + {0, 85, 84}, + {0, 87, 86}, + {0, 45, 88}, + })); + + codecs.emplace(std::pair(SpvOpFAdd, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(103, { + {0, 0, 0}, + {126463145, 0, 0}, + {220008971, 0, 0}, + {246375791, 0, 0}, + {503145996, 0, 0}, + {628331516, 0, 0}, + {643418617, 0, 0}, + {743407979, 0, 0}, + {837715723, 0, 0}, + {858902117, 0, 0}, + {870594305, 0, 0}, + {939671928, 0, 0}, + {959681532, 0, 0}, + {1051471757, 0, 0}, + {1092948665, 0, 0}, + {1097775533, 0, 0}, + {1136775085, 0, 0}, + {1140367371, 0, 0}, + {1332643570, 0, 0}, + {1367301635, 0, 0}, + {1558001705, 0, 0}, + {1684282922, 0, 0}, + {2096388952, 0, 0}, + {2183547611, 0, 0}, + {2219733501, 0, 0}, + {2358141757, 0, 0}, + {2359973133, 0, 0}, + {2383939514, 0, 0}, + {2444465148, 0, 0}, + {2517964682, 0, 0}, + {2567901801, 0, 0}, + {2598189097, 0, 0}, + {2655147757, 0, 0}, + {2683080096, 0, 0}, + {2705434194, 0, 0}, + {2738307068, 0, 0}, + {2780898906, 0, 0}, + {3030911670, 0, 0}, + {3032677281, 0, 0}, + {3063300848, 0, 0}, + {3277199633, 0, 0}, + {3289969989, 0, 0}, + {3401762422, 0, 0}, + {3436143898, 0, 0}, + {3560552546, 0, 0}, + {3656163446, 0, 0}, + {3675926744, 0, 0}, + {3701632935, 0, 0}, + {3743748793, 0, 0}, + {3752211294, 0, 0}, + {3794803132, 0, 0}, + {4241374559, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 21}, + {0, 17, 11}, + {0, 36, 35}, + {0, 46, 45}, + {0, 50, 49}, + {0, 9, 3}, + {0, 20, 47}, + {0, 37, 31}, + {0, 2, 34}, + {0, 40, 13}, + {0, 51, 32}, + {0, 41, 10}, + {0, 38, 19}, + {0, 18, 44}, + {0, 43, 16}, + {0, 48, 24}, + {0, 26, 5}, + {0, 53, 8}, + {0, 15, 7}, + {0, 25, 23}, + {0, 54, 27}, + {0, 56, 55}, + {0, 58, 57}, + {0, 60, 59}, + {0, 39, 42}, + {0, 62, 61}, + {0, 30, 63}, + {0, 4, 64}, + {0, 65, 28}, + {0, 66, 22}, + {0, 68, 67}, + {0, 69, 14}, + {0, 70, 33}, + {0, 71, 6}, + {0, 73, 72}, + {0, 75, 74}, + {0, 29, 76}, + {0, 78, 77}, + {0, 80, 79}, + {0, 82, 81}, + {0, 84, 83}, + {0, 86, 85}, + {0, 88, 87}, + {0, 90, 89}, + {0, 91, 12}, + {0, 93, 92}, + {0, 95, 94}, + {0, 97, 96}, + {0, 99, 98}, + {0, 101, 100}, + {0, 52, 102}, + })); + + codecs.emplace(std::pair(SpvOpFAdd, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 5}, + {0, 4, 6}, + {0, 1, 7}, + {0, 2, 8}, + })); + + codecs.emplace(std::pair(SpvOpFSub, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(159, { + {0, 0, 0}, + {50385656, 0, 0}, + {117250846, 0, 0}, + {171494987, 0, 0}, + {195244192, 0, 0}, + {210754155, 0, 0}, + {265392489, 0, 0}, + {333855951, 0, 0}, + {416853049, 0, 0}, + {529068443, 0, 0}, + {533021259, 0, 0}, + {615982737, 0, 0}, + {660038281, 0, 0}, + {663341511, 0, 0}, + {669812542, 0, 0}, + {716890919, 0, 0}, + {1081536219, 0, 0}, + {1119744229, 0, 0}, + {1123617794, 0, 0}, + {1139547465, 0, 0}, + {1162789888, 0, 0}, + {1178317551, 0, 0}, + {1190147516, 0, 0}, + {1193734351, 0, 0}, + {1215030156, 0, 0}, + {1220749418, 0, 0}, + {1318479490, 0, 0}, + {1461398554, 0, 0}, + {1486207619, 0, 0}, + {1551372768, 0, 0}, + {1763758554, 0, 0}, + {1797960910, 0, 0}, + {1850331254, 0, 0}, + {1894417995, 0, 0}, + {1964254745, 0, 0}, + {1965902997, 0, 0}, + {1989327599, 0, 0}, + {2095027856, 0, 0}, + {2123683379, 0, 0}, + {2124837447, 0, 0}, + {2137526937, 0, 0}, + {2269114589, 0, 0}, + {2269130237, 0, 0}, + {2330636993, 0, 0}, + {2481746922, 0, 0}, + {2503770904, 0, 0}, + {2589449658, 0, 0}, + {2603020391, 0, 0}, + {2604576561, 0, 0}, + {2795773560, 0, 0}, + {2835131395, 0, 0}, + {2852854788, 0, 0}, + {2890638791, 0, 0}, + {2895413148, 0, 0}, + {2950446516, 0, 0}, + {2963744582, 0, 0}, + {3079287749, 0, 0}, + {3088785099, 0, 0}, + {3280064277, 0, 0}, + {3335250889, 0, 0}, + {3510242586, 0, 0}, + {3517169445, 0, 0}, + {3518703473, 0, 0}, + {3536471583, 0, 0}, + {3579593979, 0, 0}, + {3591222197, 0, 0}, + {3673811979, 0, 0}, + {3727034815, 0, 0}, + {3730093054, 0, 0}, + {3898287302, 0, 0}, + {3944781937, 0, 0}, + {3950980241, 0, 0}, + {4033586023, 0, 0}, + {4041974454, 0, 0}, + {4052965752, 0, 0}, + {4083161638, 0, 0}, + {4167600590, 0, 0}, + {4185661467, 0, 0}, + {4237092412, 0, 0}, + {4244540017, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 44, 18}, + {0, 69, 57}, + {0, 24, 16}, + {0, 79, 5}, + {0, 59, 4}, + {0, 76, 40}, + {0, 53, 45}, + {0, 14, 2}, + {0, 62, 61}, + {0, 33, 75}, + {0, 38, 37}, + {0, 42, 58}, + {0, 66, 47}, + {0, 63, 67}, + {0, 1, 7}, + {0, 10, 3}, + {0, 13, 12}, + {0, 23, 22}, + {0, 32, 28}, + {0, 36, 35}, + {0, 72, 49}, + {0, 74, 73}, + {0, 77, 55}, + {0, 27, 41}, + {0, 31, 15}, + {0, 6, 54}, + {0, 78, 17}, + {0, 81, 56}, + {0, 83, 82}, + {0, 85, 84}, + {0, 48, 30}, + {0, 71, 60}, + {0, 65, 51}, + {0, 87, 86}, + {0, 50, 34}, + {0, 89, 88}, + {0, 90, 9}, + {0, 25, 8}, + {0, 92, 91}, + {0, 93, 26}, + {0, 95, 94}, + {0, 52, 39}, + {0, 29, 20}, + {0, 97, 96}, + {0, 99, 98}, + {0, 101, 100}, + {0, 64, 102}, + {0, 104, 103}, + {0, 106, 105}, + {0, 21, 107}, + {0, 108, 68}, + {0, 109, 46}, + {0, 110, 11}, + {0, 112, 111}, + {0, 114, 113}, + {0, 116, 115}, + {0, 117, 70}, + {0, 43, 118}, + {0, 120, 119}, + {0, 122, 121}, + {0, 124, 123}, + {0, 126, 125}, + {0, 128, 127}, + {0, 129, 19}, + {0, 131, 130}, + {0, 133, 132}, + {0, 135, 134}, + {0, 137, 136}, + {0, 139, 138}, + {0, 141, 140}, + {0, 143, 142}, + {0, 145, 144}, + {0, 147, 146}, + {0, 149, 148}, + {0, 151, 150}, + {0, 153, 152}, + {0, 155, 154}, + {0, 157, 156}, + {0, 158, 80}, + })); + + codecs.emplace(std::pair(SpvOpFSub, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(103, { + {0, 0, 0}, + {50998433, 0, 0}, + {171494987, 0, 0}, + {249378857, 0, 0}, + {296981500, 0, 0}, + {508007510, 0, 0}, + {610429940, 0, 0}, + {660038281, 0, 0}, + {663341511, 0, 0}, + {836581417, 0, 0}, + {1027242654, 0, 0}, + {1167160774, 0, 0}, + {1191015885, 0, 0}, + {1200870684, 0, 0}, + {1203545131, 0, 0}, + {1265796414, 0, 0}, + {1319785741, 0, 0}, + {1669959736, 0, 0}, + {1684282922, 0, 0}, + {1752686878, 0, 0}, + {1850331254, 0, 0}, + {1901166356, 0, 0}, + {1906988301, 0, 0}, + {2055836767, 0, 0}, + {2095027856, 0, 0}, + {2096388952, 0, 0}, + {2144962711, 0, 0}, + {2217833278, 0, 0}, + {2500819054, 0, 0}, + {2525173102, 0, 0}, + {2575525651, 0, 0}, + {2660843182, 0, 0}, + {2855506940, 0, 0}, + {2918750759, 0, 0}, + {2919787747, 0, 0}, + {3091876332, 0, 0}, + {3187066832, 0, 0}, + {3244209297, 0, 0}, + {3423702268, 0, 0}, + {3508792859, 0, 0}, + {3548535223, 0, 0}, + {3619787319, 0, 0}, + {3653838348, 0, 0}, + {3692647551, 0, 0}, + {3713290482, 0, 0}, + {3753486980, 0, 0}, + {3783756895, 0, 0}, + {3797961332, 0, 0}, + {3836822275, 0, 0}, + {4043078107, 0, 0}, + {4052965752, 0, 0}, + {4091394002, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 31, 49}, + {0, 24, 19}, + {0, 46, 45}, + {0, 6, 48}, + {0, 12, 33}, + {0, 17, 21}, + {0, 43, 11}, + {0, 7, 2}, + {0, 9, 8}, + {0, 28, 13}, + {0, 44, 38}, + {0, 30, 50}, + {0, 26, 22}, + {0, 29, 51}, + {0, 34, 37}, + {0, 53, 40}, + {0, 23, 54}, + {0, 55, 25}, + {0, 27, 18}, + {0, 1, 10}, + {0, 57, 56}, + {0, 59, 58}, + {0, 5, 47}, + {0, 60, 20}, + {0, 62, 61}, + {0, 64, 63}, + {0, 66, 65}, + {0, 67, 39}, + {0, 69, 68}, + {0, 16, 70}, + {0, 3, 71}, + {0, 73, 72}, + {0, 41, 15}, + {0, 35, 74}, + {0, 76, 75}, + {0, 78, 77}, + {0, 36, 79}, + {0, 81, 80}, + {0, 83, 82}, + {0, 14, 84}, + {0, 86, 85}, + {0, 88, 87}, + {0, 32, 89}, + {0, 42, 90}, + {0, 92, 91}, + {0, 94, 93}, + {0, 96, 95}, + {0, 98, 97}, + {0, 52, 99}, + {0, 100, 4}, + {0, 102, 101}, + })); + + codecs.emplace(std::pair(SpvOpFSub, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(157, { + {0, 0, 0}, + {49456560, 0, 0}, + {170690025, 0, 0}, + {243178923, 0, 0}, + {295017943, 0, 0}, + {296981500, 0, 0}, + {330249537, 0, 0}, + {435256475, 0, 0}, + {443558693, 0, 0}, + {456043370, 0, 0}, + {470277359, 0, 0}, + {592180731, 0, 0}, + {663258455, 0, 0}, + {706238670, 0, 0}, + {810488476, 0, 0}, + {870594305, 0, 0}, + {877895868, 0, 0}, + {900522183, 0, 0}, + {1077859090, 0, 0}, + {1082941229, 0, 0}, + {1104362365, 0, 0}, + {1132589448, 0, 0}, + {1173092699, 0, 0}, + {1203545131, 0, 0}, + {1265796414, 0, 0}, + {1278818058, 0, 0}, + {1285705317, 0, 0}, + {1319785741, 0, 0}, + {1382106590, 0, 0}, + {1461897718, 0, 0}, + {1474506522, 0, 0}, + {1530183840, 0, 0}, + {1558001705, 0, 0}, + {1558990974, 0, 0}, + {1616846013, 0, 0}, + {1633850097, 0, 0}, + {1684282922, 0, 0}, + {1725011064, 0, 0}, + {1767704813, 0, 0}, + {1923453688, 0, 0}, + {1941148668, 0, 0}, + {1955104493, 0, 0}, + {2022961611, 0, 0}, + {2162274327, 0, 0}, + {2212501241, 0, 0}, + {2219733501, 0, 0}, + {2234361374, 0, 0}, + {2272221101, 0, 0}, + {2305269460, 0, 0}, + {2488410748, 0, 0}, + {2566666743, 0, 0}, + {2598189097, 0, 0}, + {2775815164, 0, 0}, + {2793529873, 0, 0}, + {2844616706, 0, 0}, + {2970183398, 0, 0}, + {3103302036, 0, 0}, + {3110479131, 0, 0}, + {3115038057, 0, 0}, + {3116932970, 0, 0}, + {3152745753, 0, 0}, + {3187066832, 0, 0}, + {3244209297, 0, 0}, + {3383007207, 0, 0}, + {3392887901, 0, 0}, + {3508792859, 0, 0}, + {3737376990, 0, 0}, + {3753486980, 0, 0}, + {3765247327, 0, 0}, + {3817149113, 0, 0}, + {3839047923, 0, 0}, + {3886529747, 0, 0}, + {4044928561, 0, 0}, + {4061558677, 0, 0}, + {4069720347, 0, 0}, + {4069810315, 0, 0}, + {4128942283, 0, 0}, + {4164704452, 0, 0}, + {4273793488, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 74, 47}, + {0, 34, 33}, + {0, 36, 14}, + {0, 61, 48}, + {0, 13, 31}, + {0, 39, 25}, + {0, 37, 29}, + {0, 65, 54}, + {0, 4, 73}, + {0, 38, 10}, + {0, 15, 43}, + {0, 6, 35}, + {0, 9, 16}, + {0, 30, 19}, + {0, 49, 44}, + {0, 57, 53}, + {0, 60, 58}, + {0, 72, 66}, + {0, 59, 76}, + {0, 1, 68}, + {0, 70, 42}, + {0, 63, 3}, + {0, 28, 69}, + {0, 17, 55}, + {0, 45, 64}, + {0, 81, 80}, + {0, 7, 82}, + {0, 12, 11}, + {0, 21, 50}, + {0, 83, 18}, + {0, 22, 84}, + {0, 85, 26}, + {0, 20, 86}, + {0, 87, 40}, + {0, 56, 88}, + {0, 90, 89}, + {0, 92, 91}, + {0, 93, 2}, + {0, 95, 94}, + {0, 97, 96}, + {0, 98, 41}, + {0, 100, 99}, + {0, 101, 52}, + {0, 103, 102}, + {0, 77, 71}, + {0, 104, 78}, + {0, 105, 46}, + {0, 32, 8}, + {0, 106, 51}, + {0, 108, 107}, + {0, 23, 109}, + {0, 110, 27}, + {0, 112, 111}, + {0, 113, 75}, + {0, 115, 114}, + {0, 117, 116}, + {0, 119, 118}, + {0, 121, 120}, + {0, 123, 122}, + {0, 124, 62}, + {0, 126, 125}, + {0, 128, 127}, + {0, 67, 129}, + {0, 131, 130}, + {0, 5, 132}, + {0, 134, 133}, + {0, 136, 135}, + {0, 138, 137}, + {0, 139, 24}, + {0, 141, 140}, + {0, 143, 142}, + {0, 145, 144}, + {0, 147, 146}, + {0, 149, 148}, + {0, 151, 150}, + {0, 153, 152}, + {0, 79, 154}, + {0, 156, 155}, + })); + + codecs.emplace(std::pair(SpvOpFSub, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 5}, + {0, 3, 6}, + {0, 1, 7}, + {0, 8, 2}, + })); + + codecs.emplace(std::pair(SpvOpFMul, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(41, { + {0, 0, 0}, + {342197850, 0, 0}, + {885020215, 0, 0}, + {963902061, 0, 0}, + {1041368449, 0, 0}, + {1352397672, 0, 0}, + {1791427568, 0, 0}, + {2013867381, 0, 0}, + {2513230733, 0, 0}, + {2555315060, 0, 0}, + {2562485583, 0, 0}, + {2567901801, 0, 0}, + {2655147757, 0, 0}, + {2680283743, 0, 0}, + {2752766693, 0, 0}, + {2806716850, 0, 0}, + {3030911670, 0, 0}, + {3401762422, 0, 0}, + {3697738938, 0, 0}, + {4164704452, 0, 0}, + {4273793488, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 14, 10}, + {0, 7, 16}, + {0, 1, 15}, + {0, 9, 6}, + {0, 4, 12}, + {0, 18, 5}, + {0, 13, 2}, + {0, 19, 3}, + {0, 17, 20}, + {0, 23, 22}, + {0, 24, 8}, + {0, 26, 25}, + {0, 27, 11}, + {0, 29, 28}, + {0, 31, 30}, + {0, 33, 32}, + {0, 35, 34}, + {0, 37, 36}, + {0, 39, 38}, + {0, 21, 40}, + })); + + codecs.emplace(std::pair(SpvOpFMul, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(129, { + {0, 0, 0}, + {126463145, 0, 0}, + {129135650, 0, 0}, + {200922300, 0, 0}, + {328661377, 0, 0}, + {354479447, 0, 0}, + {360730278, 0, 0}, + {451264926, 0, 0}, + {529068443, 0, 0}, + {593829839, 0, 0}, + {742917749, 0, 0}, + {761731755, 0, 0}, + {810488476, 0, 0}, + {870594305, 0, 0}, + {894529125, 0, 0}, + {959681532, 0, 0}, + {1054461787, 0, 0}, + {1077859090, 0, 0}, + {1086964761, 0, 0}, + {1158929937, 0, 0}, + {1168927492, 0, 0}, + {1196280518, 0, 0}, + {1203545131, 0, 0}, + {1367301635, 0, 0}, + {1508550646, 0, 0}, + {1618544981, 0, 0}, + {1661163736, 0, 0}, + {1684282922, 0, 0}, + {1766994680, 0, 0}, + {1830851200, 0, 0}, + {1901166356, 0, 0}, + {1955104493, 0, 0}, + {2055836767, 0, 0}, + {2096388952, 0, 0}, + {2100052708, 0, 0}, + {2161102232, 0, 0}, + {2197904616, 0, 0}, + {2262137600, 0, 0}, + {2278571792, 0, 0}, + {2281956980, 0, 0}, + {2438466459, 0, 0}, + {2443959748, 0, 0}, + {2517964682, 0, 0}, + {2557754096, 0, 0}, + {2622612602, 0, 0}, + {2660843182, 0, 0}, + {2736844435, 0, 0}, + {2780898906, 0, 0}, + {3044188332, 0, 0}, + {3059119137, 0, 0}, + {3194725903, 0, 0}, + {3270430997, 0, 0}, + {3337532056, 0, 0}, + {3407526215, 0, 0}, + {3496407048, 0, 0}, + {3504158761, 0, 0}, + {3534518722, 0, 0}, + {3570411982, 0, 0}, + {3701632935, 0, 0}, + {3929248764, 0, 0}, + {3944781937, 0, 0}, + {3970432934, 0, 0}, + {4008405264, 0, 0}, + {4245257809, 0, 0}, + {4253051659, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 6, 26}, + {0, 46, 24}, + {0, 64, 50}, + {0, 7, 17}, + {0, 40, 57}, + {0, 56, 49}, + {0, 34, 10}, + {0, 32, 61}, + {0, 36, 44}, + {0, 8, 43}, + {0, 4, 18}, + {0, 25, 23}, + {0, 9, 54}, + {0, 45, 41}, + {0, 13, 21}, + {0, 47, 31}, + {0, 39, 53}, + {0, 11, 3}, + {0, 29, 20}, + {0, 38, 58}, + {0, 37, 14}, + {0, 66, 52}, + {0, 67, 35}, + {0, 48, 68}, + {0, 1, 69}, + {0, 70, 28}, + {0, 27, 63}, + {0, 72, 71}, + {0, 74, 73}, + {0, 75, 60}, + {0, 77, 76}, + {0, 5, 51}, + {0, 15, 78}, + {0, 30, 79}, + {0, 55, 80}, + {0, 42, 81}, + {0, 83, 82}, + {0, 85, 84}, + {0, 86, 2}, + {0, 19, 16}, + {0, 87, 59}, + {0, 62, 88}, + {0, 90, 89}, + {0, 22, 91}, + {0, 93, 92}, + {0, 95, 94}, + {0, 97, 96}, + {0, 99, 98}, + {0, 101, 100}, + {0, 12, 102}, + {0, 104, 103}, + {0, 33, 105}, + {0, 107, 106}, + {0, 109, 108}, + {0, 111, 110}, + {0, 113, 112}, + {0, 115, 114}, + {0, 117, 116}, + {0, 119, 118}, + {0, 121, 120}, + {0, 123, 122}, + {0, 125, 124}, + {0, 127, 126}, + {0, 65, 128}, + })); + + codecs.emplace(std::pair(SpvOpFMul, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(127, { + {0, 0, 0}, + {13319433, 0, 0}, + {15502752, 0, 0}, + {162608772, 0, 0}, + {171307615, 0, 0}, + {296981500, 0, 0}, + {354479447, 0, 0}, + {413918748, 0, 0}, + {443490822, 0, 0}, + {487719832, 0, 0}, + {593829839, 0, 0}, + {615982737, 0, 0}, + {703543228, 0, 0}, + {810488476, 0, 0}, + {870594305, 0, 0}, + {875212982, 0, 0}, + {959681532, 0, 0}, + {1019457583, 0, 0}, + {1203545131, 0, 0}, + {1278448636, 0, 0}, + {1325348861, 0, 0}, + {1368383673, 0, 0}, + {1400019344, 0, 0}, + {1646147798, 0, 0}, + {1679946323, 0, 0}, + {1684282922, 0, 0}, + {1747355813, 0, 0}, + {1755648697, 0, 0}, + {1793544760, 0, 0}, + {1811839150, 0, 0}, + {1901166356, 0, 0}, + {1947620272, 0, 0}, + {1992893964, 0, 0}, + {2042001863, 0, 0}, + {2096388952, 0, 0}, + {2123388694, 0, 0}, + {2128251367, 0, 0}, + {2130747644, 0, 0}, + {2135340676, 0, 0}, + {2161102232, 0, 0}, + {2443959748, 0, 0}, + {2513230733, 0, 0}, + {2557754096, 0, 0}, + {2580096524, 0, 0}, + {2589449658, 0, 0}, + {2614879967, 0, 0}, + {2698156268, 0, 0}, + {2970183398, 0, 0}, + {3002890475, 0, 0}, + {3133016299, 0, 0}, + {3142155593, 0, 0}, + {3187066832, 0, 0}, + {3266548732, 0, 0}, + {3287039847, 0, 0}, + {3357301402, 0, 0}, + {3413713311, 0, 0}, + {3434076295, 0, 0}, + {3496407048, 0, 0}, + {3504158761, 0, 0}, + {3882634684, 0, 0}, + {3929248764, 0, 0}, + {3987079331, 0, 0}, + {4076840151, 0, 0}, + {4243119782, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 31, 8}, + {0, 14, 56}, + {0, 7, 12}, + {0, 9, 30}, + {0, 42, 36}, + {0, 19, 11}, + {0, 22, 40}, + {0, 15, 3}, + {0, 57, 26}, + {0, 58, 61}, + {0, 55, 51}, + {0, 48, 34}, + {0, 20, 1}, + {0, 24, 23}, + {0, 46, 35}, + {0, 59, 49}, + {0, 21, 63}, + {0, 62, 44}, + {0, 6, 50}, + {0, 28, 18}, + {0, 66, 65}, + {0, 41, 32}, + {0, 39, 54}, + {0, 53, 67}, + {0, 68, 37}, + {0, 33, 69}, + {0, 43, 70}, + {0, 71, 38}, + {0, 72, 27}, + {0, 13, 47}, + {0, 45, 73}, + {0, 75, 74}, + {0, 76, 5}, + {0, 77, 17}, + {0, 79, 78}, + {0, 52, 80}, + {0, 2, 81}, + {0, 83, 82}, + {0, 85, 84}, + {0, 87, 86}, + {0, 4, 88}, + {0, 16, 29}, + {0, 90, 89}, + {0, 92, 91}, + {0, 94, 93}, + {0, 60, 95}, + {0, 97, 96}, + {0, 98, 10}, + {0, 25, 99}, + {0, 101, 100}, + {0, 103, 102}, + {0, 105, 104}, + {0, 107, 106}, + {0, 109, 108}, + {0, 111, 110}, + {0, 113, 112}, + {0, 115, 114}, + {0, 117, 116}, + {0, 119, 118}, + {0, 121, 120}, + {0, 123, 122}, + {0, 125, 124}, + {0, 64, 126}, + })); + + codecs.emplace(std::pair(SpvOpFMul, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(9, { + {0, 0, 0}, + {679771963, 0, 0}, + {1951208733, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 4, 5}, + {0, 3, 6}, + {0, 7, 1}, + {0, 2, 8}, + })); + + codecs.emplace(std::pair(SpvOpFDiv, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(153, { + {0, 0, 0}, + {10142671, 0, 0}, + {27865391, 0, 0}, + {29517006, 0, 0}, + {41739659, 0, 0}, + {97231530, 0, 0}, + {171334650, 0, 0}, + {200553094, 0, 0}, + {257136089, 0, 0}, + {294390719, 0, 0}, + {375530199, 0, 0}, + {380957745, 0, 0}, + {388034151, 0, 0}, + {455591063, 0, 0}, + {462664429, 0, 0}, + {491456522, 0, 0}, + {502863753, 0, 0}, + {626480004, 0, 0}, + {643418617, 0, 0}, + {651464351, 0, 0}, + {701281393, 0, 0}, + {744817486, 0, 0}, + {783918780, 0, 0}, + {862784766, 0, 0}, + {930804377, 0, 0}, + {952536201, 0, 0}, + {955476870, 0, 0}, + {1043738701, 0, 0}, + {1047011733, 0, 0}, + {1080545747, 0, 0}, + {1137442027, 0, 0}, + {1235468610, 0, 0}, + {1412908157, 0, 0}, + {1431749301, 0, 0}, + {1434223270, 0, 0}, + {1440646342, 0, 0}, + {1508570930, 0, 0}, + {1510422521, 0, 0}, + {1548121999, 0, 0}, + {1582841441, 0, 0}, + {1612225949, 0, 0}, + {1665981878, 0, 0}, + {1680746207, 0, 0}, + {1696076631, 0, 0}, + {1702168830, 0, 0}, + {1761469971, 0, 0}, + {1799299383, 0, 0}, + {1910240213, 0, 0}, + {1917451875, 0, 0}, + {1945006185, 0, 0}, + {1998444837, 0, 0}, + {2045285083, 0, 0}, + {2217966239, 0, 0}, + {2279273489, 0, 0}, + {2289803479, 0, 0}, + {2348676810, 0, 0}, + {2353194283, 0, 0}, + {2403632109, 0, 0}, + {2409539315, 0, 0}, + {2414984922, 0, 0}, + {2477389837, 0, 0}, + {2524531022, 0, 0}, + {2573160348, 0, 0}, + {2639720559, 0, 0}, + {2773229577, 0, 0}, + {2796513469, 0, 0}, + {2881225774, 0, 0}, + {2890570341, 0, 0}, + {2952850186, 0, 0}, + {3023287679, 0, 0}, + {3118548424, 0, 0}, + {3877813395, 0, 0}, + {3931288033, 0, 0}, + {3972309363, 0, 0}, + {4117704995, 0, 0}, + {4140081844, 0, 0}, + {4258414038, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 74, 53}, + {0, 58, 52}, + {0, 65, 60}, + {0, 41, 5}, + {0, 1, 67}, + {0, 24, 28}, + {0, 27, 26}, + {0, 55, 31}, + {0, 36, 61}, + {0, 13, 49}, + {0, 56, 48}, + {0, 16, 64}, + {0, 76, 42}, + {0, 45, 29}, + {0, 23, 6}, + {0, 72, 12}, + {0, 35, 19}, + {0, 20, 7}, + {0, 21, 46}, + {0, 71, 78}, + {0, 80, 79}, + {0, 47, 17}, + {0, 81, 70}, + {0, 34, 25}, + {0, 83, 82}, + {0, 85, 84}, + {0, 37, 86}, + {0, 87, 73}, + {0, 10, 4}, + {0, 40, 30}, + {0, 88, 57}, + {0, 54, 89}, + {0, 50, 90}, + {0, 11, 91}, + {0, 39, 15}, + {0, 59, 44}, + {0, 92, 66}, + {0, 69, 93}, + {0, 95, 94}, + {0, 14, 96}, + {0, 98, 97}, + {0, 62, 51}, + {0, 100, 99}, + {0, 102, 101}, + {0, 104, 103}, + {0, 32, 43}, + {0, 105, 38}, + {0, 107, 106}, + {0, 109, 108}, + {0, 22, 9}, + {0, 33, 110}, + {0, 2, 111}, + {0, 112, 3}, + {0, 114, 113}, + {0, 116, 115}, + {0, 68, 63}, + {0, 118, 117}, + {0, 120, 119}, + {0, 121, 8}, + {0, 123, 122}, + {0, 125, 124}, + {0, 127, 126}, + {0, 129, 128}, + {0, 131, 130}, + {0, 133, 132}, + {0, 75, 18}, + {0, 135, 134}, + {0, 137, 136}, + {0, 139, 138}, + {0, 141, 140}, + {0, 143, 142}, + {0, 145, 144}, + {0, 147, 146}, + {0, 149, 148}, + {0, 150, 77}, + {0, 152, 151}, + })); + + codecs.emplace(std::pair(SpvOpFDiv, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(131, { + {0, 0, 0}, + {5908395, 0, 0}, + {139011596, 0, 0}, + {296981500, 0, 0}, + {342615870, 0, 0}, + {370232173, 0, 0}, + {492958971, 0, 0}, + {528662843, 0, 0}, + {551924251, 0, 0}, + {604894932, 0, 0}, + {610429940, 0, 0}, + {780957373, 0, 0}, + {810488476, 0, 0}, + {872544165, 0, 0}, + {878733439, 0, 0}, + {918849409, 0, 0}, + {959681532, 0, 0}, + {1013756921, 0, 0}, + {1038982109, 0, 0}, + {1081611718, 0, 0}, + {1125913837, 0, 0}, + {1209418480, 0, 0}, + {1318081294, 0, 0}, + {1367301635, 0, 0}, + {1417425499, 0, 0}, + {1625742020, 0, 0}, + {1684282922, 0, 0}, + {1746004874, 0, 0}, + {1758287856, 0, 0}, + {1777640493, 0, 0}, + {2066323109, 0, 0}, + {2094550054, 0, 0}, + {2096388952, 0, 0}, + {2144962711, 0, 0}, + {2434845539, 0, 0}, + {2480811229, 0, 0}, + {2552825357, 0, 0}, + {2636946065, 0, 0}, + {2651956495, 0, 0}, + {2669086217, 0, 0}, + {2680819379, 0, 0}, + {2709694527, 0, 0}, + {2715304020, 0, 0}, + {2790648021, 0, 0}, + {2802261839, 0, 0}, + {2806296851, 0, 0}, + {2864543087, 0, 0}, + {2952260510, 0, 0}, + {2963184673, 0, 0}, + {3091876332, 0, 0}, + {3098991995, 0, 0}, + {3131890669, 0, 0}, + {3138977758, 0, 0}, + {3198541202, 0, 0}, + {3260579369, 0, 0}, + {3263841912, 0, 0}, + {3335250889, 0, 0}, + {3345856521, 0, 0}, + {3381478137, 0, 0}, + {3489269251, 0, 0}, + {3510242586, 0, 0}, + {3820814597, 0, 0}, + {3900859293, 0, 0}, + {4041974454, 0, 0}, + {4244540017, 0, 0}, + {4265894873, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 15, 52}, + {0, 20, 18}, + {0, 39, 29}, + {0, 9, 43}, + {0, 22, 13}, + {0, 46, 27}, + {0, 51, 48}, + {0, 19, 57}, + {0, 34, 24}, + {0, 64, 59}, + {0, 5, 7}, + {0, 38, 37}, + {0, 45, 47}, + {0, 2, 56}, + {0, 67, 8}, + {0, 17, 68}, + {0, 69, 61}, + {0, 70, 6}, + {0, 55, 54}, + {0, 72, 71}, + {0, 4, 73}, + {0, 74, 40}, + {0, 30, 11}, + {0, 42, 36}, + {0, 75, 58}, + {0, 31, 76}, + {0, 1, 77}, + {0, 44, 14}, + {0, 78, 50}, + {0, 79, 23}, + {0, 26, 80}, + {0, 81, 12}, + {0, 83, 82}, + {0, 84, 21}, + {0, 32, 85}, + {0, 87, 86}, + {0, 35, 10}, + {0, 88, 62}, + {0, 90, 89}, + {0, 41, 91}, + {0, 92, 53}, + {0, 93, 63}, + {0, 95, 94}, + {0, 33, 96}, + {0, 98, 97}, + {0, 99, 3}, + {0, 100, 28}, + {0, 101, 49}, + {0, 102, 60}, + {0, 104, 103}, + {0, 106, 105}, + {0, 108, 107}, + {0, 110, 109}, + {0, 65, 111}, + {0, 25, 112}, + {0, 114, 113}, + {0, 116, 115}, + {0, 117, 16}, + {0, 119, 118}, + {0, 121, 120}, + {0, 123, 122}, + {0, 125, 124}, + {0, 127, 126}, + {0, 128, 66}, + {0, 130, 129}, + })); + + codecs.emplace(std::pair(SpvOpFDiv, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(95, { + {0, 0, 0}, + {116093251, 0, 0}, + {149720480, 0, 0}, + {183103444, 0, 0}, + {251209228, 0, 0}, + {296981500, 0, 0}, + {357505993, 0, 0}, + {394654115, 0, 0}, + {410274915, 0, 0}, + {452208841, 0, 0}, + {788046331, 0, 0}, + {797934924, 0, 0}, + {810488476, 0, 0}, + {1144188012, 0, 0}, + {1220127364, 0, 0}, + {1321616112, 0, 0}, + {1324351672, 0, 0}, + {1348149915, 0, 0}, + {1459457331, 0, 0}, + {1465623797, 0, 0}, + {1531216990, 0, 0}, + {1543672828, 0, 0}, + {1578775276, 0, 0}, + {1738815671, 0, 0}, + {1904128160, 0, 0}, + {2071351379, 0, 0}, + {2119793999, 0, 0}, + {2274779301, 0, 0}, + {2291766425, 0, 0}, + {2357410109, 0, 0}, + {2438466459, 0, 0}, + {2496463830, 0, 0}, + {2630220147, 0, 0}, + {2682510803, 0, 0}, + {3047649911, 0, 0}, + {3085703811, 0, 0}, + {3235459678, 0, 0}, + {3261703164, 0, 0}, + {3331487616, 0, 0}, + {3462674048, 0, 0}, + {3570219049, 0, 0}, + {3585315836, 0, 0}, + {3602108619, 0, 0}, + {3724004880, 0, 0}, + {3931641900, 0, 0}, + {3955205564, 0, 0}, + {4073492988, 0, 0}, + {4127308103, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 24, 37}, + {0, 13, 38}, + {0, 17, 39}, + {0, 35, 23}, + {0, 18, 36}, + {0, 46, 19}, + {0, 20, 33}, + {0, 47, 6}, + {0, 1, 45}, + {0, 3, 27}, + {0, 8, 49}, + {0, 50, 29}, + {0, 10, 51}, + {0, 43, 31}, + {0, 53, 52}, + {0, 54, 26}, + {0, 7, 55}, + {0, 56, 32}, + {0, 57, 41}, + {0, 59, 58}, + {0, 61, 60}, + {0, 63, 62}, + {0, 64, 25}, + {0, 2, 34}, + {0, 65, 14}, + {0, 67, 66}, + {0, 12, 21}, + {0, 9, 68}, + {0, 69, 16}, + {0, 71, 70}, + {0, 72, 44}, + {0, 11, 73}, + {0, 74, 30}, + {0, 4, 75}, + {0, 28, 15}, + {0, 76, 42}, + {0, 5, 77}, + {0, 78, 40}, + {0, 80, 79}, + {0, 82, 81}, + {0, 22, 83}, + {0, 85, 84}, + {0, 86, 48}, + {0, 88, 87}, + {0, 90, 89}, + {0, 92, 91}, + {0, 94, 93}, + })); + + codecs.emplace(std::pair(SpvOpFDiv, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(7, { + {0, 0, 0}, + {679771963, 0, 0}, + {2320303498, 0, 0}, + {3334207724, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 3, 4}, + {0, 2, 5}, + {0, 1, 6}, + })); + + codecs.emplace(std::pair(SpvOpVectorTimesScalar, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(121, { + {0, 0, 0}, + {14113753, 0, 0}, + {102358168, 0, 0}, + {179458548, 0, 0}, + {330388453, 0, 0}, + {386525753, 0, 0}, + {470277359, 0, 0}, + {497658126, 0, 0}, + {508007510, 0, 0}, + {815034111, 0, 0}, + {826214242, 0, 0}, + {849867303, 0, 0}, + {885645401, 0, 0}, + {939415664, 0, 0}, + {968885186, 0, 0}, + {1105835505, 0, 0}, + {1159301677, 0, 0}, + {1461897718, 0, 0}, + {1482251215, 0, 0}, + {1486206763, 0, 0}, + {1527762373, 0, 0}, + {1558990974, 0, 0}, + {1618754372, 0, 0}, + {1669959736, 0, 0}, + {1752686878, 0, 0}, + {2004567202, 0, 0}, + {2055637638, 0, 0}, + {2113506324, 0, 0}, + {2154320787, 0, 0}, + {2162274327, 0, 0}, + {2306141594, 0, 0}, + {2345566651, 0, 0}, + {2457690657, 0, 0}, + {2473053808, 0, 0}, + {2500422644, 0, 0}, + {2504802016, 0, 0}, + {2506771164, 0, 0}, + {2793529873, 0, 0}, + {2801333547, 0, 0}, + {2879050471, 0, 0}, + {3032677281, 0, 0}, + {3045470312, 0, 0}, + {3181546731, 0, 0}, + {3240977890, 0, 0}, + {3262572726, 0, 0}, + {3307100165, 0, 0}, + {3425841570, 0, 0}, + {3560552546, 0, 0}, + {3641833815, 0, 0}, + {3652695478, 0, 0}, + {3782362128, 0, 0}, + {3797961332, 0, 0}, + {3837583704, 0, 0}, + {3886529747, 0, 0}, + {3907920335, 0, 0}, + {4043078107, 0, 0}, + {4044928561, 0, 0}, + {4069720347, 0, 0}, + {4180570743, 0, 0}, + {4245743275, 0, 0}, + {4285201458, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 44, 28}, + {0, 13, 45}, + {0, 19, 15}, + {0, 32, 31}, + {0, 43, 42}, + {0, 16, 52}, + {0, 33, 22}, + {0, 57, 55}, + {0, 24, 21}, + {0, 2, 59}, + {0, 10, 3}, + {0, 18, 12}, + {0, 41, 39}, + {0, 60, 46}, + {0, 4, 25}, + {0, 58, 49}, + {0, 14, 1}, + {0, 27, 17}, + {0, 50, 36}, + {0, 23, 54}, + {0, 5, 30}, + {0, 11, 7}, + {0, 38, 29}, + {0, 37, 8}, + {0, 48, 56}, + {0, 20, 6}, + {0, 34, 26}, + {0, 63, 62}, + {0, 65, 64}, + {0, 67, 66}, + {0, 69, 68}, + {0, 71, 70}, + {0, 73, 72}, + {0, 75, 74}, + {0, 9, 76}, + {0, 78, 77}, + {0, 80, 79}, + {0, 82, 81}, + {0, 84, 83}, + {0, 40, 35}, + {0, 85, 47}, + {0, 86, 51}, + {0, 88, 87}, + {0, 90, 89}, + {0, 53, 91}, + {0, 93, 92}, + {0, 95, 94}, + {0, 97, 96}, + {0, 99, 98}, + {0, 101, 100}, + {0, 103, 102}, + {0, 105, 104}, + {0, 107, 106}, + {0, 109, 108}, + {0, 111, 110}, + {0, 113, 112}, + {0, 115, 114}, + {0, 117, 116}, + {0, 119, 118}, + {0, 61, 120}, + })); + + codecs.emplace(std::pair(SpvOpVectorTimesScalar, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(127, { + {0, 0, 0}, + {100979271, 0, 0}, + {269576093, 0, 0}, + {314809953, 0, 0}, + {354479447, 0, 0}, + {497658126, 0, 0}, + {882718761, 0, 0}, + {968885186, 0, 0}, + {973908139, 0, 0}, + {1019457583, 0, 0}, + {1191015885, 0, 0}, + {1266262705, 0, 0}, + {1310404265, 0, 0}, + {1325348861, 0, 0}, + {1367301635, 0, 0}, + {1368383673, 0, 0}, + {1570165302, 0, 0}, + {1618544981, 0, 0}, + {1646147798, 0, 0}, + {1674464100, 0, 0}, + {1679946323, 0, 0}, + {1686512349, 0, 0}, + {1766401548, 0, 0}, + {1774052499, 0, 0}, + {1788301425, 0, 0}, + {2023008475, 0, 0}, + {2055836767, 0, 0}, + {2096388952, 0, 0}, + {2123388694, 0, 0}, + {2129301998, 0, 0}, + {2212501241, 0, 0}, + {2274226560, 0, 0}, + {2362972044, 0, 0}, + {2378763734, 0, 0}, + {2506771164, 0, 0}, + {2558655180, 0, 0}, + {2622612602, 0, 0}, + {2660843182, 0, 0}, + {2698156268, 0, 0}, + {2801333547, 0, 0}, + {2850246066, 0, 0}, + {2895151306, 0, 0}, + {2970183398, 0, 0}, + {2986830770, 0, 0}, + {3001444829, 0, 0}, + {3133016299, 0, 0}, + {3152745753, 0, 0}, + {3187066832, 0, 0}, + {3261122899, 0, 0}, + {3496407048, 0, 0}, + {3513669836, 0, 0}, + {3536390697, 0, 0}, + {3570411982, 0, 0}, + {3653838348, 0, 0}, + {3713290482, 0, 0}, + {3858973601, 0, 0}, + {3873587660, 0, 0}, + {3877583949, 0, 0}, + {3882634684, 0, 0}, + {3907920335, 0, 0}, + {3997432565, 0, 0}, + {4169226615, 0, 0}, + {4219766939, 0, 0}, + {4243119782, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 25, 12}, + {0, 41, 29}, + {0, 56, 44}, + {0, 1, 3}, + {0, 48, 24}, + {0, 33, 60}, + {0, 8, 50}, + {0, 35, 21}, + {0, 11, 7}, + {0, 34, 23}, + {0, 59, 57}, + {0, 10, 62}, + {0, 40, 2}, + {0, 5, 49}, + {0, 39, 17}, + {0, 9, 61}, + {0, 30, 6}, + {0, 19, 46}, + {0, 53, 54}, + {0, 31, 52}, + {0, 55, 43}, + {0, 66, 65}, + {0, 16, 67}, + {0, 51, 68}, + {0, 70, 69}, + {0, 26, 36}, + {0, 72, 71}, + {0, 74, 73}, + {0, 76, 75}, + {0, 78, 77}, + {0, 80, 79}, + {0, 82, 81}, + {0, 37, 83}, + {0, 85, 84}, + {0, 13, 86}, + {0, 20, 18}, + {0, 38, 28}, + {0, 58, 45}, + {0, 87, 63}, + {0, 15, 88}, + {0, 32, 22}, + {0, 89, 4}, + {0, 90, 14}, + {0, 91, 42}, + {0, 93, 92}, + {0, 95, 94}, + {0, 97, 96}, + {0, 99, 98}, + {0, 101, 100}, + {0, 103, 102}, + {0, 105, 104}, + {0, 107, 106}, + {0, 109, 108}, + {0, 111, 110}, + {0, 113, 112}, + {0, 115, 114}, + {0, 27, 47}, + {0, 117, 116}, + {0, 119, 118}, + {0, 121, 120}, + {0, 123, 122}, + {0, 125, 124}, + {0, 126, 64}, + })); + + codecs.emplace(std::pair(SpvOpVectorTimesScalar, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(137, { + {0, 0, 0}, + {11698369, 0, 0}, + {146392076, 0, 0}, + {151810803, 0, 0}, + {223800276, 0, 0}, + {227103506, 0, 0}, + {253329281, 0, 0}, + {346929928, 0, 0}, + {461040879, 0, 0}, + {629859130, 0, 0}, + {680157484, 0, 0}, + {783918780, 0, 0}, + {810488476, 0, 0}, + {824323032, 0, 0}, + {870594305, 0, 0}, + {959681532, 0, 0}, + {975807626, 0, 0}, + {1081642571, 0, 0}, + {1084574846, 0, 0}, + {1094817798, 0, 0}, + {1141965917, 0, 0}, + {1164137269, 0, 0}, + {1166917451, 0, 0}, + {1204787336, 0, 0}, + {1232501371, 0, 0}, + {1318479490, 0, 0}, + {1369818198, 0, 0}, + {1372785527, 0, 0}, + {1526654696, 0, 0}, + {1543672828, 0, 0}, + {1548121999, 0, 0}, + {1635292159, 0, 0}, + {1641070431, 0, 0}, + {1684282922, 0, 0}, + {1767704813, 0, 0}, + {1781765116, 0, 0}, + {1838763297, 0, 0}, + {1901166356, 0, 0}, + {1904846533, 0, 0}, + {2011183308, 0, 0}, + {2032069771, 0, 0}, + {2071351379, 0, 0}, + {2087004702, 0, 0}, + {2244928358, 0, 0}, + {2314864456, 0, 0}, + {2374216296, 0, 0}, + {2394332122, 0, 0}, + {2443610186, 0, 0}, + {2524697596, 0, 0}, + {2526961521, 0, 0}, + {2568098594, 0, 0}, + {2807907995, 0, 0}, + {3103302036, 0, 0}, + {3117071189, 0, 0}, + {3188115516, 0, 0}, + {3417584874, 0, 0}, + {3554463148, 0, 0}, + {3561482820, 0, 0}, + {3691770462, 0, 0}, + {3729929345, 0, 0}, + {3733675151, 0, 0}, + {3831290364, 0, 0}, + {3866493821, 0, 0}, + {3929248764, 0, 0}, + {4060703604, 0, 0}, + {4092487128, 0, 0}, + {4167600590, 0, 0}, + {4214779116, 0, 0}, + {4248015868, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 36, 13}, + {0, 49, 60}, + {0, 51, 9}, + {0, 3, 62}, + {0, 67, 41}, + {0, 4, 31}, + {0, 66, 5}, + {0, 55, 32}, + {0, 2, 1}, + {0, 30, 16}, + {0, 7, 38}, + {0, 19, 10}, + {0, 34, 20}, + {0, 45, 46}, + {0, 22, 11}, + {0, 25, 23}, + {0, 40, 39}, + {0, 21, 57}, + {0, 6, 35}, + {0, 61, 8}, + {0, 52, 26}, + {0, 70, 59}, + {0, 71, 14}, + {0, 68, 47}, + {0, 73, 72}, + {0, 29, 74}, + {0, 76, 75}, + {0, 77, 17}, + {0, 79, 78}, + {0, 81, 80}, + {0, 82, 18}, + {0, 83, 42}, + {0, 85, 84}, + {0, 87, 86}, + {0, 27, 37}, + {0, 53, 43}, + {0, 89, 88}, + {0, 64, 54}, + {0, 90, 65}, + {0, 92, 91}, + {0, 58, 93}, + {0, 56, 48}, + {0, 94, 28}, + {0, 96, 95}, + {0, 98, 97}, + {0, 44, 99}, + {0, 101, 100}, + {0, 15, 12}, + {0, 103, 102}, + {0, 104, 33}, + {0, 106, 105}, + {0, 108, 107}, + {0, 24, 109}, + {0, 111, 110}, + {0, 113, 112}, + {0, 114, 50}, + {0, 116, 115}, + {0, 118, 117}, + {0, 120, 119}, + {0, 122, 121}, + {0, 124, 123}, + {0, 126, 125}, + {0, 128, 127}, + {0, 129, 63}, + {0, 131, 130}, + {0, 133, 132}, + {0, 135, 134}, + {0, 136, 69}, + })); + + codecs.emplace(std::pair(SpvOpVectorTimesScalar, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {1951208733, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpDot, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(97, { + {0, 0, 0}, + {78001013, 0, 0}, + {170690025, 0, 0}, + {206688607, 0, 0}, + {443490822, 0, 0}, + {461476226, 0, 0}, + {537830163, 0, 0}, + {669982125, 0, 0}, + {790502615, 0, 0}, + {805072272, 0, 0}, + {1173092699, 0, 0}, + {1220643281, 0, 0}, + {1448448666, 0, 0}, + {1466804584, 0, 0}, + {1473411044, 0, 0}, + {1515695460, 0, 0}, + {1587730355, 0, 0}, + {1625742020, 0, 0}, + {2071351379, 0, 0}, + {2250055803, 0, 0}, + {2291766425, 0, 0}, + {2416108131, 0, 0}, + {2427834344, 0, 0}, + {2436009347, 0, 0}, + {2455417440, 0, 0}, + {2480811229, 0, 0}, + {2654325647, 0, 0}, + {2919796598, 0, 0}, + {3047649911, 0, 0}, + {3088511797, 0, 0}, + {3104643263, 0, 0}, + {3198541202, 0, 0}, + {3204986803, 0, 0}, + {3272233597, 0, 0}, + {3383007207, 0, 0}, + {3602108619, 0, 0}, + {3622349409, 0, 0}, + {3714664910, 0, 0}, + {3717942504, 0, 0}, + {3732000233, 0, 0}, + {3759072440, 0, 0}, + {3765247327, 0, 0}, + {3805423332, 0, 0}, + {3829325073, 0, 0}, + {3866493821, 0, 0}, + {4058280485, 0, 0}, + {4061558677, 0, 0}, + {4148979936, 0, 0}, + {4155586396, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 13, 38}, + {0, 39, 14}, + {0, 44, 9}, + {0, 48, 47}, + {0, 23, 15}, + {0, 33, 25}, + {0, 1, 42}, + {0, 5, 46}, + {0, 31, 3}, + {0, 36, 28}, + {0, 16, 12}, + {0, 32, 22}, + {0, 41, 21}, + {0, 6, 50}, + {0, 51, 29}, + {0, 45, 34}, + {0, 37, 8}, + {0, 19, 52}, + {0, 11, 4}, + {0, 43, 40}, + {0, 27, 53}, + {0, 54, 10}, + {0, 24, 55}, + {0, 57, 56}, + {0, 58, 26}, + {0, 2, 59}, + {0, 61, 60}, + {0, 63, 62}, + {0, 65, 64}, + {0, 20, 66}, + {0, 30, 35}, + {0, 67, 17}, + {0, 68, 7}, + {0, 70, 69}, + {0, 71, 18}, + {0, 73, 72}, + {0, 75, 74}, + {0, 77, 76}, + {0, 79, 78}, + {0, 81, 80}, + {0, 83, 82}, + {0, 85, 84}, + {0, 87, 86}, + {0, 89, 88}, + {0, 91, 90}, + {0, 93, 92}, + {0, 95, 94}, + {0, 49, 96}, + })); + + codecs.emplace(std::pair(SpvOpDot, 1), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(117, { + {0, 0, 0}, + {50385656, 0, 0}, + {181902171, 0, 0}, + {560078433, 0, 0}, + {615982737, 0, 0}, + {674428451, 0, 0}, + {837715723, 0, 0}, + {886972033, 0, 0}, + {900101778, 0, 0}, + {983299427, 0, 0}, + {1237148906, 0, 0}, + {1364157225, 0, 0}, + {1367301635, 0, 0}, + {1380160211, 0, 0}, + {1451831482, 0, 0}, + {1499923635, 0, 0}, + {1570165302, 0, 0}, + {1735295265, 0, 0}, + {1766401548, 0, 0}, + {1796311149, 0, 0}, + {1826456251, 0, 0}, + {1839669171, 0, 0}, + {2012838864, 0, 0}, + {2024071551, 0, 0}, + {2096388952, 0, 0}, + {2161102232, 0, 0}, + {2197874825, 0, 0}, + {2279700640, 0, 0}, + {2289183712, 0, 0}, + {2351620600, 0, 0}, + {2362972044, 0, 0}, + {2472176885, 0, 0}, + {2477434291, 0, 0}, + {2530899578, 0, 0}, + {2531826164, 0, 0}, + {2558133383, 0, 0}, + {2589449658, 0, 0}, + {2621255555, 0, 0}, + {2622612602, 0, 0}, + {2872580757, 0, 0}, + {2881302403, 0, 0}, + {2891091137, 0, 0}, + {2923708820, 0, 0}, + {2936040203, 0, 0}, + {2970183398, 0, 0}, + {3187066832, 0, 0}, + {3224952074, 0, 0}, + {3244383472, 0, 0}, + {3261122899, 0, 0}, + {3362830643, 0, 0}, + {3538158875, 0, 0}, + {3635542517, 0, 0}, + {3682213068, 0, 0}, + {3721902098, 0, 0}, + {3826846522, 0, 0}, + {3877583949, 0, 0}, + {3997432565, 0, 0}, + {4093615095, 0, 0}, + {4106828015, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 52, 28}, + {0, 33, 20}, + {0, 46, 57}, + {0, 47, 54}, + {0, 21, 17}, + {0, 31, 58}, + {0, 12, 53}, + {0, 29, 3}, + {0, 35, 34}, + {0, 48, 41}, + {0, 8, 5}, + {0, 7, 55}, + {0, 37, 32}, + {0, 60, 38}, + {0, 61, 16}, + {0, 14, 62}, + {0, 23, 63}, + {0, 13, 19}, + {0, 64, 9}, + {0, 65, 39}, + {0, 2, 66}, + {0, 67, 42}, + {0, 69, 68}, + {0, 25, 70}, + {0, 1, 49}, + {0, 6, 71}, + {0, 72, 15}, + {0, 73, 11}, + {0, 75, 74}, + {0, 77, 76}, + {0, 4, 78}, + {0, 56, 50}, + {0, 80, 79}, + {0, 10, 81}, + {0, 83, 82}, + {0, 85, 84}, + {0, 86, 27}, + {0, 43, 40}, + {0, 88, 87}, + {0, 44, 24}, + {0, 30, 89}, + {0, 51, 36}, + {0, 45, 90}, + {0, 18, 91}, + {0, 93, 92}, + {0, 22, 94}, + {0, 26, 95}, + {0, 97, 96}, + {0, 99, 98}, + {0, 101, 100}, + {0, 103, 102}, + {0, 105, 104}, + {0, 107, 106}, + {0, 109, 108}, + {0, 111, 110}, + {0, 113, 112}, + {0, 59, 114}, + {0, 116, 115}, + })); + + codecs.emplace(std::pair(SpvOpDot, 2), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(179, { + {0, 0, 0}, + {27177503, 0, 0}, + {50385656, 0, 0}, + {129748122, 0, 0}, + {139011596, 0, 0}, + {162608772, 0, 0}, + {181902171, 0, 0}, + {225200779, 0, 0}, + {342159236, 0, 0}, + {386293029, 0, 0}, + {429023543, 0, 0}, + {443558693, 0, 0}, + {504514034, 0, 0}, + {615982737, 0, 0}, + {669812542, 0, 0}, + {674428451, 0, 0}, + {837715723, 0, 0}, + {861753115, 0, 0}, + {875212982, 0, 0}, + {876867882, 0, 0}, + {899320334, 0, 0}, + {900101778, 0, 0}, + {938517572, 0, 0}, + {1347339159, 0, 0}, + {1356063462, 0, 0}, + {1373856501, 0, 0}, + {1376656865, 0, 0}, + {1451831482, 0, 0}, + {1522979646, 0, 0}, + {1548491889, 0, 0}, + {1570165302, 0, 0}, + {1735295265, 0, 0}, + {1747355813, 0, 0}, + {1766401548, 0, 0}, + {1871105284, 0, 0}, + {1918742169, 0, 0}, + {1922045399, 0, 0}, + {1978689945, 0, 0}, + {2024071551, 0, 0}, + {2059975069, 0, 0}, + {2076833303, 0, 0}, + {2096388952, 0, 0}, + {2181030375, 0, 0}, + {2197874825, 0, 0}, + {2362972044, 0, 0}, + {2414725163, 0, 0}, + {2517964682, 0, 0}, + {2564745684, 0, 0}, + {2577387676, 0, 0}, + {2589449658, 0, 0}, + {2604242419, 0, 0}, + {2683080096, 0, 0}, + {2696349144, 0, 0}, + {2763960513, 0, 0}, + {2817823941, 0, 0}, + {2852854788, 0, 0}, + {2891091137, 0, 0}, + {2919626325, 0, 0}, + {2923708820, 0, 0}, + {2936040203, 0, 0}, + {2963744582, 0, 0}, + {2970183398, 0, 0}, + {2984459037, 0, 0}, + {2996594997, 0, 0}, + {3015046341, 0, 0}, + {3055195668, 0, 0}, + {3127329373, 0, 0}, + {3187066832, 0, 0}, + {3193597927, 0, 0}, + {3200890815, 0, 0}, + {3224258475, 0, 0}, + {3224480461, 0, 0}, + {3261122899, 0, 0}, + {3609540589, 0, 0}, + {3619404941, 0, 0}, + {3619626927, 0, 0}, + {3727034815, 0, 0}, + {3742724777, 0, 0}, + {3742946763, 0, 0}, + {3836179806, 0, 0}, + {3913885196, 0, 0}, + {3927338499, 0, 0}, + {3927466635, 0, 0}, + {3997432565, 0, 0}, + {3999472204, 0, 0}, + {4010499223, 0, 0}, + {4032662899, 0, 0}, + {4110915453, 0, 0}, + {4145966869, 0, 0}, + {4228303141, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 23, 87}, + {0, 9, 28}, + {0, 42, 17}, + {0, 74, 70}, + {0, 86, 77}, + {0, 18, 5}, + {0, 31, 32}, + {0, 34, 3}, + {0, 38, 68}, + {0, 50, 29}, + {0, 72, 62}, + {0, 21, 15}, + {0, 14, 54}, + {0, 56, 22}, + {0, 48, 88}, + {0, 2, 76}, + {0, 6, 47}, + {0, 26, 79}, + {0, 65, 12}, + {0, 37, 81}, + {0, 91, 60}, + {0, 30, 92}, + {0, 25, 7}, + {0, 45, 40}, + {0, 66, 52}, + {0, 71, 69}, + {0, 78, 75}, + {0, 84, 82}, + {0, 94, 93}, + {0, 27, 95}, + {0, 97, 96}, + {0, 99, 98}, + {0, 100, 39}, + {0, 55, 101}, + {0, 58, 102}, + {0, 89, 103}, + {0, 35, 11}, + {0, 104, 36}, + {0, 53, 10}, + {0, 1, 64}, + {0, 73, 20}, + {0, 105, 13}, + {0, 107, 106}, + {0, 8, 16}, + {0, 24, 19}, + {0, 85, 63}, + {0, 109, 108}, + {0, 111, 110}, + {0, 4, 112}, + {0, 114, 113}, + {0, 116, 115}, + {0, 118, 117}, + {0, 83, 119}, + {0, 121, 120}, + {0, 123, 122}, + {0, 49, 44}, + {0, 124, 57}, + {0, 125, 59}, + {0, 126, 67}, + {0, 128, 127}, + {0, 130, 129}, + {0, 132, 131}, + {0, 134, 133}, + {0, 135, 51}, + {0, 137, 136}, + {0, 138, 61}, + {0, 43, 41}, + {0, 140, 139}, + {0, 142, 141}, + {0, 144, 143}, + {0, 146, 145}, + {0, 148, 147}, + {0, 149, 33}, + {0, 80, 150}, + {0, 152, 151}, + {0, 154, 153}, + {0, 156, 155}, + {0, 158, 157}, + {0, 160, 159}, + {0, 162, 161}, + {0, 164, 163}, + {0, 166, 165}, + {0, 168, 167}, + {0, 46, 169}, + {0, 171, 170}, + {0, 90, 172}, + {0, 174, 173}, + {0, 176, 175}, + {0, 178, 177}, + })); + + codecs.emplace(std::pair(SpvOpDot, 3), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {1036475267, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpLabel, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(3, { + {0, 0, 0}, + {1036475267, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 1, 2}, + })); + + codecs.emplace(std::pair(SpvOpBranch, 0), std::move(codec)); + } + + { + std::unique_ptr> codec(new HuffmanCodec(119, { + {0, 0, 0}, + {57149555, 0, 0}, + {139011596, 0, 0}, + {255835594, 0, 0}, + {330249537, 0, 0}, + {388686774, 0, 0}, + {508217552, 0, 0}, + {550831114, 0, 0}, + {559246409, 0, 0}, + {599185303, 0, 0}, + {649208064, 0, 0}, + {679061455, 0, 0}, + {810488476, 0, 0}, + {951841533, 0, 0}, + {1008886329, 0, 0}, + {1022544883, 0, 0}, + {1215030156, 0, 0}, + {1305703280, 0, 0}, + {1367301635, 0, 0}, + {1453447304, 0, 0}, + {1487177499, 0, 0}, + {1603937321, 0, 0}, + {1617826947, 0, 0}, + {1643868273, 0, 0}, + {1672607981, 0, 0}, + {1681941034, 0, 0}, + {1755165354, 0, 0}, + {1781864804, 0, 0}, + {1795715718, 0, 0}, + {1977038330, 0, 0}, + {2096388952, 0, 0}, + {2204920111, 0, 0}, + {2244470522, 0, 0}, + {2330636993, 0, 0}, + {2400601988, 0, 0}, + {2424848261, 0, 0}, + {2603020391, 0, 0}, + {2622612602, 0, 0}, + {2645135839, 0, 0}, + {2660843182, 0, 0}, + {2708915136, 0, 0}, + {2724166585, 0, 0}, + {2728667725, 0, 0}, + {2890638791, 0, 0}, + {2901034693, 0, 0}, + {2941648648, 0, 0}, + {2970183398, 0, 0}, + {2998120306, 0, 0}, + {3123244280, 0, 0}, + {3187066832, 0, 0}, + {3209399506, 0, 0}, + {3230260738, 0, 0}, + {3344189994, 0, 0}, + {3345707173, 0, 0}, + {3367298820, 0, 0}, + {3397078357, 0, 0}, + {3569736966, 0, 0}, + {3816961131, 0, 0}, + {4091670162, 0, 0}, + {4237497041, 0, 0}, + {1111111111111111111, 0, 0}, + {0, 17, 44}, + {0, 25, 20}, + {0, 29, 34}, + {0, 18, 2}, + {0, 54, 49}, + {0, 28, 7}, + {0, 47, 52}, + {0, 23, 56}, + {0, 55, 26}, + {0, 24, 61}, + {0, 13, 62}, + {0, 63, 45}, + {0, 27, 15}, + {0, 64, 8}, + {0, 65, 59}, + {0, 35, 22}, + {0, 53, 38}, + {0, 58, 51}, + {0, 11, 66}, + {0, 10, 3}, + {0, 46, 67}, + {0, 69, 68}, + {0, 1, 50}, + {0, 42, 19}, + {0, 70, 6}, + {0, 31, 71}, + {0, 16, 72}, + {0, 74, 73}, + {0, 76, 75}, + {0, 78, 77}, + {0, 79, 4}, + {0, 5, 37}, + {0, 14, 36}, + {0, 80, 57}, + {0, 81, 48}, + {0, 83, 82}, + {0, 39, 84}, + {0, 86, 85}, + {0, 40, 87}, + {0, 89, 88}, + {0, 91, 90}, + {0, 93, 92}, + {0, 21, 9}, + {0, 41, 32}, + {0, 12, 43}, + {0, 95, 94}, + {0, 97, 96}, + {0, 99, 98}, + {0, 100, 33}, + {0, 60, 101}, + {0, 103, 102}, + {0, 105, 104}, + {0, 107, 106}, + {0, 109, 108}, + {0, 110, 30}, + {0, 112, 111}, + {0, 114, 113}, + {0, 116, 115}, + {0, 118, 117}, + })); + + codecs.emplace(std::pair(SpvOpReturnValue, 0), std::move(codec)); + } + + return codecs; +} + +std::unordered_set GetDescriptorsWithCodingScheme() { + std::unordered_set descriptors_with_coding_scheme = { + 3816961131, + 3569736966, + 3397078357, + 3344189994, + 3230260738, + 2941648648, + 2901034693, + 2728667725, + 2400601988, + 1795715718, + 1681941034, + 1487177499, + 1453447304, + 679061455, + 649208064, + 559246409, + 388686774, + 4228303141, + 4110915453, + 4010499223, + 3927466635, + 3927338499, + 3836179806, + 3742724777, + 3619404941, + 3224480461, + 3224258475, + 3200890815, + 3742946763, + 3193597927, + 2604242419, + 2577387676, + 2181030375, + 1376656865, + 1347339159, + 938517572, + 876867882, + 429023543, + 129748122, + 4106828015, + 4093615095, + 3826846522, + 3721902098, + 3244383472, + 2891091137, + 2872580757, + 2558133383, + 2477434291, + 1839669171, + 2059975069, + 1735295265, + 1364157225, + 1237148906, + 886972033, + 674428451, + 4148979936, + 3805423332, + 3732000233, + 3717942504, + 3714664910, + 3622349409, + 3272233597, + 3204986803, + 3088511797, + 1672607981, + 2416108131, + 2250055803, + 1796311149, + 1515695460, + 537830163, + 461476226, + 206688607, + 78001013, + 3866493821, + 3417584874, + 3188115516, + 2526961521, + 2443610186, + 2394332122, + 2374216296, + 2032069771, + 2011183308, + 1904846533, + 1641070431, + 1635292159, + 1372785527, + 1369818198, + 1204787336, + 1826456251, + 1164137269, + 1081642571, + 629859130, + 253329281, + 227103506, + 11698369, + 4219766939, + 4169226615, + 3997432565, + 3873587660, + 3513669836, + 3261122899, + 2129301998, + 1774052499, + 1266262705, + 4285201458, + 4245743275, + 3907920335, + 3837583704, + 3641833815, + 3307100165, + 1232501371, + 3262572726, + 3045470312, + 2879050471, + 2801333547, + 2506771164, + 2504802016, + 2500422644, + 2473053808, + 2457690657, + 2345566651, + 2306141594, + 2154320787, + 2055637638, + 1527762373, + 1486206763, + 1159301677, + 1105835505, + 968885186, + 885645401, + 849867303, + 815034111, + 497658126, + 386525753, + 179458548, + 102358168, + 4127308103, + 4073492988, + 1473411044, + 805072272, + 3724004880, + 3602108619, + 3585315836, + 3331487616, + 3261703164, + 3235459678, + 3085703811, + 3047649911, + 2357410109, + 2291766425, + 2071351379, + 1904128160, + 1738815671, + 1531216990, + 1465623797, + 1324351672, + 1220127364, + 1144188012, + 183103444, + 116093251, + 3900859293, + 3345856521, + 3691770462, + 3263841912, + 3198541202, + 3098991995, + 3682213068, + 2963184673, + 2864543087, + 2802261839, + 2790648021, + 900101778, + 2715304020, + 100979271, + 2709694527, + 2669086217, + 2531826164, + 2651956495, + 2552825357, + 2480811229, + 3138977758, + 2434845539, + 2066323109, + 1777640493, + 1758287856, + 1746004874, + 3945482286, + 3932146199, + 3129573055, + 3126269825, + 3716914380, + 985750227, + 1543672828, + 3189039115, + 1839499483, + 2696349144, + 1536350567, + 3971481069, + 3001444829, + 4028622909, + 215293834, + 213642219, + 153085016, + 1189681639, + 165054168, + 29517006, + 2614879967, + 27865391, + 1649426421, + 4239834800, + 1947620272, + 28782128, + 3207966516, + 3713290482, + 2042001863, + 2724166585, + 2356768706, + 1793544760, + 4092654294, + 2157103435, + 2087004702, + 2043873558, + 27177503, + 1033363654, + 4214779116, + 408465899, + 451264926, + 2377112119, + 1182296898, + 760554870, + 3566035349, + 2630220147, + 4192247221, + 1572088444, + 3538592682, + 769422756, + 1674803691, + 630964591, + 3458449569, + 565334834, + 137840602, + 3955205564, + 2009007457, + 1258105452, + 333554713, + 3923810593, + 126463145, + 3445109809, + 2966409025, + 2849215484, + 1910240213, + 3131890669, + 586244865, + 2320303498, + 3116932970, + 1317265040, + 2812498065, + 1466938734, + 4064212479, + 2613179511, + 2095546797, + 1671139745, + 2568512089, + 3695940604, + 1119069977, + 215027449, + 4123141705, + 3495546641, + 1978689945, + 3202324433, + 3783543823, + 2674422363, + 1352628475, + 1290956281, + 1894417995, + 740921498, + 4211577142, + 1033081852, + 3884846406, + 3253403867, + 2790624748, + 2538917932, + 2144962711, + 3323202731, + 4290024976, + 2564745684, + 2963744582, + 2443959748, + 354479447, + 750870327, + 1918481917, + 4032662899, + 3587381650, + 2414725163, + 1081611718, + 1625742020, + 2308565678, + 1871105284, + 2807907995, + 2121980967, + 1054641568, + 413918748, + 1917336504, + 1816558243, + 4130950286, + 1522979646, + 1669959736, + 1320550031, + 3104643263, + 3823959661, + 3525913657, + 3584683259, + 2918750759, + 3536390697, + 94303122, + 3296691317, + 801484894, + 2496463830, + 3266028549, + 3085157904, + 973908139, + 3787909072, + 3107413701, + 2378763734, + 920604853, + 2516325050, + 1838993983, + 1603937321, + 3183924418, + 1945006185, + 3982311384, + 2682510803, + 680388473, + 979993429, + 2405770322, + 461040879, + 2817579280, + 14113753, + 2894979602, + 168339452, + 951841533, + 4154758669, + 2637132451, + 3877583949, + 1949856502, + 922996215, + 3941049054, + 4182141402, + 2262220987, + 1957218950, + 2094550054, + 1846856260, + 3499234137, + 3086631065, + 3054834317, + 593829839, + 522971108, + 1162127370, + 4233562270, + 2780190687, + 1558345254, + 3716353056, + 3518630848, + 1158929937, + 2038205856, + 86116519, + 4185661467, + 975807626, + 3910458990, + 4124281183, + 3361419439, + 171334650, + 2590402790, + 2890570341, + 2303184249, + 385229009, + 1998433745, + 1717510093, + 4022124023, + 1429389803, + 945128292, + 904486530, + 3869890846, + 619875033, + 459968607, + 3743748793, + 359054425, + 1417363940, + 3653985133, + 255835594, + 1047011733, + 2763232252, + 1329499601, + 328661377, + 2162274327, + 2100532220, + 4255182614, + 4243119782, + 3982047273, + 4053789056, + 401211099, + 950731750, + 1319785741, + 32085358, + 3882634684, + 3117071189, + 3554463148, + 3570219049, + 3535289452, + 2314864456, + 3913885196, + 2763960513, + 1079999262, + 27130513, + 3033873113, + 2976581453, + 2598189097, + 595410904, + 1572834111, + 13319433, + 1084574846, + 2123388694, + 560078433, + 1679946323, + 3518703473, + 184634770, + 296981500, + 1646147798, + 455591063, + 1325348861, + 3224952074, + 1027242654, + 2281956980, + 4221373527, + 1289566249, + 4044928561, + 882718761, + 1510333659, + 836581417, + 1901166356, + 2276405827, + 4052965752, + 1155765244, + 503145996, + 251209228, + 495107308, + 3944781937, + 37459569, + 4248015868, + 4198082194, + 1302400505, + 4106658327, + 680016782, + 2319227476, + 2738307068, + 3929248764, + 2850246066, + 1824526196, + 3912967080, + 3044723416, + 3133016299, + 2517964682, + 3647586740, + 3653838348, + 929101967, + 3571454885, + 2806296851, + 977312655, + 646282397, + 3448018532, + 824323032, + 204234270, + 1579585816, + 3712763835, + 1212872174, + 3953984401, + 3168953855, + 2944827576, + 1582841441, + 2796901051, + 3323682385, + 1317058015, + 2557550659, + 1620634991, + 2986830770, + 2490492987, + 1817271123, + 40653745, + 1696076631, + 2466126792, + 4169878842, + 3251128023, + 2444465148, + 678695941, + 2481746922, + 2836440943, + 774727851, + 2246405597, + 4028028350, + 2524697596, + 1977038330, + 2817823941, + 2219733501, + 688216667, + 3634598908, + 3232633974, + 2724625059, + 3269075805, + 3732640764, + 2263349224, + 1680746207, + 2414984922, + 2507457870, + 50998433, + 3092528578, + 3712946115, + 1543935193, + 807276090, + 1221183390, + 172029722, + 2122275289, + 3990925720, + 2261697609, + 2736881867, + 295017943, + 3278176820, + 3748965853, + 3174324790, + 1103903216, + 3184177968, + 1113409935, + 2299842241, + 2162986400, + 1538342947, + 4056442905, + 1631434666, + 205885885, + 1594733696, + 1955104493, + 1022309772, + 3820814597, + 993150979, + 1209418480, + 1784441183, + 3958731802, + 2250225826, + 3065160070, + 2024071551, + 107497541, + 628544021, + 2732195517, + 4241486415, + 3969279737, + 870594305, + 2916400082, + 1193734351, + 3202349435, + 3831290364, + 3282979782, + 3928764629, + 1308462133, + 3216471040, + 2433519008, + 2022961611, + 3604842236, + 3374978006, + 2855895374, + 3496407048, + 1482251215, + 3994511488, + 2997832431, + 1132589448, + 1348149915, + 2092468906, + 2451531615, + 779021139, + 3730093054, + 3413713311, + 1022915255, + 2204920111, + 2660843182, + 1080545747, + 1642805350, + 1766422419, + 4141567741, + 1558990974, + 4185590212, + 2841468319, + 701281393, + 3325419312, + 451957774, + 357505993, + 1156369516, + 3187387500, + 2259467579, + 2678954464, + 3154597438, + 543558236, + 2359973133, + 1990431740, + 2705477184, + 1041368449, + 3122368657, + 3181646225, + 1094423548, + 2955375511, + 2888125966, + 153013225, + 2936040203, + 1758530522, + 573901046, + 3030911670, + 1675922848, + 4235213885, + 4091916710, + 2633682514, + 4254584852, + 2328748202, + 3357301402, + 3877813395, + 2004567202, + 2496297824, + 3334207724, + 1600149091, + 293528591, + 1782996825, + 3757282300, + 1107206446, + 1092948665, + 1797960910, + 1206726575, + 1496351055, + 3021406120, + 99347751, + 3797204453, + 1468919488, + 797415788, + 1314843976, + 2934934694, + 490769168, + 1474506522, + 3811268385, + 864295921, + 3081676220, + 151810803, + 2588618056, + 2998120306, + 416853049, + 3495967422, + 3233393284, + 508007510, + 759277550, + 1971252067, + 869050696, + 810488476, + 745556697, + 789872778, + 3362723943, + 1617826947, + 3260309823, + 2197904616, + 1199157863, + 1643868273, + 2430404313, + 321630747, + 2503194620, + 3194725903, + 2881225774, + 3997952447, + 1389644742, + 2713718873, + 3585511591, + 1684282922, + 3366848728, + 284226441, + 1541020250, + 4018237905, + 1369578001, + 2424848261, + 2654325647, + 1626224034, + 1081536219, + 309040124, + 123060826, + 3997038726, + 1670691893, + 1543280290, + 443347828, + 1776629361, + 3118548424, + 478440524, + 679771963, + 3729929345, + 4244789645, + 2366506734, + 2838165089, + 1619778288, + 1313182965, + 3240680626, + 1323407757, + 883854656, + 2194691858, + 15502752, + 3760372982, + 1366337101, + 3656163446, + 295018543, + 825595257, + 57149555, + 2563789125, + 2353194283, + 2636942752, + 4026740269, + 3570411982, + 123108003, + 3782362128, + 1280126114, + 1410849099, + 4228502127, + 3609540589, + 3365041621, + 269823086, + 348988933, + 1636389511, + 2936586309, + 2761603302, + 2318200267, + 449954059, + 2895413148, + 1755165354, + 4274214049, + 778500192, + 3345707173, + 3732136051, + 721450866, + 1600392975, + 2466255445, + 4050155669, + 3541895912, + 1139547465, + 394654115, + 1380991098, + 3516240523, + 2234361374, + 1094817798, + 744817486, + 3564402361, + 1452222566, + 1851510470, + 3619787319, + 4265894873, + 216945449, + 3061690214, + 2910557180, + 255227811, + 4167600590, + 1587209598, + 3157581152, + 3184381405, + 2572638469, + 615748604, + 2532518896, + 1774874546, + 599185303, + 1561718045, + 1742737136, + 1674464100, + 3136865519, + 706016261, + 2793529873, + 3504981554, + 4155122613, + 2080953106, + 1104362365, + 2879917501, + 850497536, + 1392080469, + 1287937401, + 718877177, + 1917966999, + 1822823090, + 3701632935, + 3591222197, + 2817335337, + 1941148668, + 3110479131, + 3289213933, + 583624926, + 468372467, + 1633850097, + 2110223508, + 898191441, + 112745085, + 4018820793, + 3085119011, + 2919626325, + 3094857332, + 2348201466, + 2192810893, + 4163160985, + 1269075360, + 3952316364, + 2881886868, + 439764402, + 1584774136, + 169674806, + 3759072440, + 102542696, + 2996180816, + 804899022, + 1015552308, + 963902061, + 3504158761, + 2002490364, + 2806716850, + 265778447, + 4083122425, + 181902171, + 1238120570, + 75986790, + 1265796414, + 899570100, + 2988365258, + 3655201337, + 3654061472, + 3061856840, + 1077859090, + 615341051, + 3678875745, + 3349230696, + 3647606635, + 2549309392, + 1508570930, + 1766401548, + 1448448666, + 1499923635, + 2882994691, + 3674863070, + 3056042030, + 4240893633, + 1395113939, + 2964622752, + 1951208733, + 3536941067, + 4176581069, + 1203545131, + 3092754101, + 246375791, + 2736026107, + 1069781886, + 3687777340, + 1564342316, + 535067202, + 1395923345, + 3240977890, + 1447712361, + 2602027658, + 718301639, + 3123244280, + 1032593647, + 2840366496, + 2680819379, + 3839389658, + 277023757, + 1172110445, + 1755648697, + 2472176885, + 223800276, + 625975427, + 976111724, + 4145966869, + 2789375411, + 618087261, + 249378857, + 4058280485, + 827698488, + 1558001705, + 3561482820, + 2562485583, + 4243138030, + 615982737, + 1220643281, + 150685616, + 3091876332, + 1040775722, + 669982125, + 4116080964, + 3582002820, + 910398460, + 1036475267, + 3800912395, + 146392076, + 1686512349, + 2326636627, + 2839816704, + 3502816184, + 226836633, + 3953733490, + 257136089, + 819503463, + 2863084840, + 1949759310, + 210754155, + 1367301635, + 3822983876, + 4273793488, + 3635397748, + 3930494584, + 3127921440, + 3167253437, + 3868239231, + 1859128680, + 3480031018, + 3810805277, + 2677252364, + 156014509, + 3627739127, + 2321729979, + 1146476634, + 4039938779, + 1964254745, + 2055836767, + 119981689, + 2629265310, + 2448331885, + 3737376990, + 144116905, + 2272221101, + 2197874825, + 1277245109, + 2503770904, + 360730278, + 3489360962, + 1166917451, + 707478563, + 4155586396, + 162255877, + 347505241, + 4215670524, + 3187066832, + 2399809085, + 2754074729, + 4060703604, + 628331516, + 1304296041, + 616435646, + 4080527786, + 1443829854, + 2512398201, + 708736129, + 13107491, + 3794803132, + 2049792025, + 2455417440, + 3367313400, + 3357250579, + 3694383800, + 2339901602, + 3242843022, + 2282454607, + 1243764146, + 835458563, + 1297706389, + 464259778, + 1766994680, + 1294403159, + 2568098594, + 3107165180, + 4040340620, + 3352361837, + 1031290113, + 2903897222, + 1677700667, + 3160388974, + 107544081, + 3044188332, + 2285081596, + 2835131395, + 2984459037, + 4174489262, + 1236389532, + 2938237924, + 321459212, + 3407526215, + 300939750, + 3441531391, + 2909957084, + 3192069648, + 1849065716, + 2524531022, + 505940164, + 4121643374, + 3774892253, + 3197739982, + 2161102232, + 2715370488, + 1992893964, + 1781864804, + 587888644, + 1039111164, + 4237497041, + 451382997, + 969500141, + 1415510495, + 3743398113, + 3027538652, + 2525173102, + 1708264968, + 3366040354, + 1100599986, + 188347929, + 2597020383, + 2705434194, + 2593884753, + 3472123498, + 2975894973, + 3152745753, + 1154919607, + 1930923350, + 3287039847, + 1372881231, + 2280400314, + 3369343584, + 2351620600, + 2645135839, + 2752766693, + 1471851763, + 1989520052, + 1141965917, + 1503477720, + 653708953, + 1765126703, + 2432827426, + 95470391, + 2567901801, + 2589449658, + 4218799564, + 3249265647, + 3673811979, + 210116709, + 1593584949, + 1791352211, + 3457985288, + 3345288309, + 531559080, + 2491124112, + 3410158390, + 4224872590, + 3705139860, + 162608772, + 4258229445, + 925559698, + 3928842969, + 4253051659, + 3633746133, + 3867307935, + 3560665067, + 798915737, + 2945369269, + 2677264274, + 2278571792, + 177111659, + 85880059, + 1297165140, + 1630583316, + 2232491275, + 1848784182, + 2487708241, + 626480004, + 3427283542, + 2108571893, + 304448521, + 3332104493, + 2244470522, + 436416061, + 221900294, + 1502470404, + 3552593177, + 440421571, + 450406196, + 503094540, + 3836822275, + 2708915136, + 3750617468, + 1119744229, + 3614752756, + 921246433, + 2285438321, + 626892406, + 2362972044, + 72782198, + 2929019254, + 2795773560, + 907126242, + 155458798, + 2798552666, + 1404739463, + 4285652249, + 1998444837, + 908777857, + 872544165, + 910429472, + 135486769, + 3457269042, + 426360862, + 1725011064, + 296836635, + 1322549027, + 2044728014, + 1530183840, + 529742207, + 4272200782, + 1341516288, + 2608484640, + 41739659, + 3260579369, + 2745872368, + 2894051250, + 862784766, + 3077271274, + 3094180193, + 3619626927, + 3745223676, + 2976066508, + 2854085372, + 2959147533, + 3266548732, + 1776526161, + 3712296962, + 1955871800, + 2580096524, + 2507709226, + 3564865233, + 948086521, + 1548254487, + 142465290, + 1472185378, + 1459457331, + 2274226560, + 3153451899, + 492958971, + 3563213618, + 1285705317, + 410274915, + 3710645347, + 1309728002, + 2119793999, + 1343794461, + 4024173916, + 2383939514, + 955476870, + 2698156268, + 35240468, + 2655147757, + 3764205609, + 3802564010, + 170690025, + 2311941439, + 3181546731, + 3866587616, + 3648138580, + 93914936, + 170378107, + 2120623674, + 1064945649, + 1618754372, + 244668133, + 247698428, + 3669223677, + 470277359, + 1781765116, + 1691572958, + 1373856501, + 2668769415, + 1087394637, + 1009983433, + 2180701723, + 4008405264, + 2831059514, + 2645120714, + 2649103430, + 2664825925, + 790502615, + 1739837626, + 2293247016, + 1784648440, + 1887808856, + 1788504755, + 112452386, + 1979978194, + 3462674048, + 2170273742, + 538168945, + 753954113, + 374731234, + 3715846592, + 1962971231, + 1860649552, + 1378082995, + 665789406, + 1717555224, + 139011596, + 1375043498, + 1618544981, + 1889460471, + 2262321736, + 1788301425, + 1652168174, + 2668680621, + 2636946065, + 2856623532, + 2759951687, + 959681532, + 3209399506, + 3055195668, + 1227221002, + 508217552, + 3289969989, + 243178923, + 2956189845, + 3075866530, + 2274779301, + 3940720663, + 3998230222, + 1178317551, + 4016096296, + 1545450160, + 2842919847, + 314809953, + 2952850186, + 3747079365, + 4147239510, + 169135842, + 1332643570, + 2994529201, + 973521782, + 1584369690, + 1043738701, + 2851900832, + 290391815, + 283209196, + 2468230023, + 1164221089, + 1991787192, + 3358097187, + 51041423, + 52882140, + 2339018837, + 2053214130, + 3757479030, + 158160339, + 853200279, + 1986584654, + 438318340, + 827246872, + 3299488628, + 2924263085, + 3472029049, + 2736844435, + 677668732, + 604894932, + 1158021131, + 1400019344, + 2268204687, + 1450415100, + 3854557817, + 1543646433, + 1278448636, + 342615870, + 1554194368, + 3080024605, + 3423702268, + 1675764636, + 1622381564, + 2078849875, + 2113115132, + 1380160211, + 3132876285, + 125015036, + 269576093, + 94145952, + 2777172031, + 2683080096, + 3812456892, + 488500848, + 3270430997, + 2895151306, + 116376005, + 400248103, + 406044930, + 1616846013, + 10142671, + 763027711, + 225200779, + 1062250709, + 2013867381, + 2113506324, + 1692932387, + 1827244161, + 3124618210, + 2096472894, + 2924146124, + 2128251367, + 2433358586, + 1939359710, + 2593325766, + 2879917723, + 694743357, + 2902069960, + 220008971, + 3090408469, + 917019124, + 1705716306, + 3263901372, + 3347863687, + 3447882276, + 1661163736, + 3617689692, + 3928555688, + 1057578789, + 435256475, + 4101009465, + 1941403425, + 198967948, + 3733675151, + 2043684541, + 3517169445, + 2226776400, + 2853403709, + 529383565, + 2807448986, + 4234287173, + 1019457583, + 1022544883, + 2493146691, + 1054461787, + 1008886329, + 1136775085, + 1191015885, + 1196280518, + 1979847999, + 50385656, + 1918742169, + 3999472204, + 3697687030, + 2220475432, + 2358141757, + 2360004627, + 4245257809, + 236660303, + 429277936, + 342159236, + 2622612602, + 371428004, + 373079619, + 643418617, + 2095027856, + 1071164424, + 1136911283, + 1548491889, + 2169307971, + 375530199, + 1510422521, + 3151638847, + 1698730948, + 2231688008, + 2604576561, + 2771938750, + 2996594997, + 289648234, + 348584153, + 2748350697, + 2926633629, + 2123683379, + 369686787, + 742917749, + 3538158875, + 2937761472, + 1545298048, + 1321616112, + 2855506940, + 900522183, + 1578775276, + 2217833278, + 2012838864, + 3753486980, + 2839765116, + 2464905186, + 2621255555, + 1305703280, + 861753115, + 3319278167, + 3063300848, + 149720480, + 1082941229, + 3337532056, + 2248357849, + 3675926744, + 1508550646, + 2289803479, + 3456899824, + 3931641900, + 3970432934, + 3419674548, + 1093210099, + 456043370, + 848380423, + 1287304304, + 1526654696, + 2055664760, + 1373166395, + 4291477370, + 2195550588, + 2847102741, + 3399062057, + 1641565587, + 2888753905, + 3579593979, + 3653059026, + 3757851979, + 2922615804, + 2919796598, + 1553476262, + 2566666743, + 3759503594, + 550831114, + 3761155209, + 3762806824, + 3902853271, + 4140081844, + 14244860, + 3847846774, + 150820676, + 1278818058, + 850592577, + 1206571206, + 1734446471, + 2117320444, + 1382106590, + 2436009347, + 2118972059, + 2951272396, + 36096192, + 117998987, + 473485679, + 2244928358, + 476788909, + 3489269251, + 610429940, + 480092139, + 481743754, + 871966503, + 918189168, + 601656217, + 933769938, + 939671928, + 1799299383, + 3312467582, + 1149665466, + 3006548167, + 1310740861, + 3602693817, + 1461645203, + 3367691969, + 1800404122, + 3486057732, + 1862284649, + 2076833303, + 2213411495, + 2805256437, + 3927915220, + 3000904950, + 2094647776, + 3333131702, + 1315613425, + 3752211294, + 603915804, + 3505028338, + 663258455, + 3322500634, + 1612225949, + 3606320646, + 157110413, + 1352397672, + 3861006967, + 452208841, + 18776483, + 1058429216, + 37009196, + 564884461, + 876864198, + 2952260510, + 2860348412, + 928261291, + 1164724902, + 2775815164, + 1332774287, + 780957373, + 939415664, + 1513770932, + 788046331, + 1692600167, + 4069810315, + 673708384, + 4024252457, + 1932614728, + 2148510256, + 3131224670, + 2388524817, + 2460489993, + 2676385521, + 826214242, + 3692647551, + 3063508455, + 3071766530, + 2063832060, + 1525861001, + 3073418145, + 837715723, + 3075069760, + 3076721375, + 3078372990, + 983243705, + 3083327835, + 171307615, + 1824016656, + 3084979450, + 1310404265, + 1775308984, + 3114708520, + 3116360135, + 3121314980, + 3134527900, + 1691646294, + 2804281092, + 97231530, + 3136179515, + 3204260786, + 3276225962, + 1220749418, + 3588205699, + 3874089391, + 4044115788, + 3268751013, + 743407979, + 166253838, + 1356063462, + 1368383673, + 2279700640, + 2130747644, + 3945795573, + 2780898906, + 3635542517, + 425022309, + 517919178, + 4061558677, + 2190437442, + 543621065, + 753756604, + 2500819054, + 1004589179, + 1165671422, + 30433743, + 3444275347, + 1335363438, + 1913735398, + 1265998516, + 3829325073, + 3662767579, + 463084678, + 1351676723, + 1391866096, + 3398925952, + 1631216488, + 815757910, + 1915438939, + 2427834344, + 1445161581, + 1890300748, + 2864863800, + 1961990747, + 575205902, + 2037710159, + 2037814253, + 617312262, + 3732916270, + 783918780, + 2257843797, + 2096388952, + 2338272340, + 1434223270, + 578132535, + 1980341560, + 1002144380, + 3244716568, + 4258414038, + 3271748023, + 3304438238, + 3717523241, + 3370185097, + 3435931956, + 1957265068, + 3602522282, + 2547657777, + 439998433, + 3838648480, + 3913593633, + 3989799199, + 906176560, + 1894133125, + 4046301857, + 4242327928, + 630592085, + 2693892518, + 4292991777, + 545678922, + 125792961, + 3015046341, + 132755933, + 2615111110, + 1570165302, + 1440646342, + 436066778, + 565233904, + 600906020, + 602222721, + 3951925872, + 1496901698, + 1522901980, + 2785441472, + 3041450802, + 1637661947, + 2127660080, + 3487022798, + 2269114589, + 1314834580, + 2315690100, + 3817149113, + 4091670162, + 1431749301, + 1858116930, + 2213946343, + 2225172640, + 2263866576, + 2727022058, + 2752967311, + 2864705739, + 3052439312, + 3510257966, + 2614053317, + 3297860332, + 3670298840, + 3732709413, + 3788324110, + 4098876453, + 4290374884, + 1623013158, + 3381478137, + 17185761, + 3931288033, + 2890638791, + 330388453, + 346929928, + 2022347217, + 4083347580, + 533021259, + 564302770, + 1917602962, + 680157484, + 3264086791, + 3727034815, + 798549062, + 3068463300, + 669812542, + 1965902997, + 2311072371, + 3079287749, + 2542834724, + 1587730355, + 2558655180, + 1838763297, + 4172568578, + 2160380860, + 2950446516, + 1830851200, + 3214537066, + 3234673086, + 3652695478, + 3103302036, + 3465954368, + 4180570743, + 3534518722, + 371186900, + 4091394002, + 1013756921, + 443558693, + 591140762, + 656610661, + 2064733527, + 3808408202, + 983299427, + 4217306348, + 1164218401, + 2036361232, + 3237903670, + 2970183398, + 2293637521, + 135920445, + 1596005536, + 868652905, + 1191735827, + 3987079331, + 1365842164, + 1508074873, + 1642818143, + 3436143898, + 4105051793, + 1863199739, + 3425841570, + 1070791291, + 2135340676, + 2639720559, + 3364388739, + 3797761273, + 2092100514, + 2098706974, + 2329992200, + 414444763, + 2759250216, + 2913136690, + 3012980338, + 3327770644, + 4128942283, + 3362344229, + 161668409, + 3401762422, + 2852854788, + 4237092412, + 1245448751, + 3702405475, + 918849409, + 3829682756, + 1612361408, + 255302575, + 414620710, + 386293029, + 618761615, + 686024761, + 744062262, + 1502028603, + 1543798545, + 1641415225, + 1548121999, + 2257971049, + 2124837447, + 878733439, + 2340670452, + 2674090849, + 3118011750, + 2816338013, + 178571546, + 2841008029, + 3249261197, + 370232173, + 4092487128, + 3787567939, + 3898287302, + 4142016703, + 4285779501, + 30663912, + 151672195, + 180913835, + 3534235309, + 34183582, + 4083161638, + 651464351, + 1410311776, + 371621315, + 421602934, + 458937500, + 2710583246, + 712168842, + 730943059, + 1519723107, + 875212982, + 1247793383, + 4217322139, + 989813600, + 1057606514, + 3764662384, + 1443547269, + 3066811685, + 3598957382, + 1791427568, + 1171541710, + 3930727258, + 1473799048, + 1296054774, + 1747355813, + 765238787, + 2023008475, + 1190147516, + 2344328209, + 2495155989, + 2577859137, + 2857814560, + 3127329373, + 3296722158, + 2773229577, + 3376009661, + 3450001968, + 920941800, + 3526837441, + 3858973601, + 1702168830, + 4088613871, + 1464587427, + 223310468, + 388034151, + 2346547796, + 1663234329, + 1750829822, + 1967643923, + 2881302403, + 2278706468, + 2326990117, + 2511346984, + 3088785099, + 2616085763, + 3027500544, + 3417583519, + 4178218543, + 1412908157, + 797934924, + 3533637837, + 1449907751, + 3362830643, + 1451831482, + 2637935122, + 3070114915, + 3023287679, + 551924251, + 1669930486, + 46736908, + 2870852215, + 1120149824, + 2923708820, + 3887377256, + 3464197236, + 4241374559, + 527665290, + 996663016, + 885020215, + 1763758554, + 3059119137, + 2555315060, + 2762094724, + 2530899578, + 2770161927, + 2262137600, + 3547456240, + 858902117, + 1140367371, + 1215030156, + 443490822, + 294390719, + 3032677281, + 1917451875, + 4184019303, + 3277199633, + 1271484400, + 1297294717, + 3560552546, + 171494987, + 195244192, + 3002890475, + 1811839150, + 265392489, + 1461398554, + 3205759417, + 333855951, + 529068443, + 660038281, + 557400685, + 663341511, + 930804377, + 1922045399, + 716890919, + 162167595, + 1654776395, + 1779143013, + 1123617794, + 2984325996, + 1162789888, + 1318479490, + 1235468610, + 3561562003, + 1486207619, + 1551372768, + 1850331254, + 3255947500, + 1037370721, + 1989327599, + 2137526937, + 835638766, + 2269130237, + 1962162282, + 3244209297, + 2330636993, + 3095831808, + 1396344138, + 2603020391, + 3434076295, + 3280064277, + 2656211099, + 3335250889, + 2550961007, + 3510242586, + 3536471583, + 3950980241, + 4033586023, + 117250846, + 3088282680, + 4041974454, + 4244540017, + 1167160774, + 899320334, + 1200870684, + 1752686878, + 1906988301, + 3804101227, + 2575525651, + 2919787747, + 3508792859, + 3548535223, + 3783756895, + 3797961332, + 4043078107, + 3115038057, + 2313593054, + 49456560, + 592180731, + 1051471757, + 1097775533, + 706238670, + 877895868, + 1173092699, + 1461897718, + 1767704813, + 1770165905, + 1923453688, + 2212501241, + 2305269460, + 2488410748, + 3782099915, + 2844616706, + 3383007207, + 3392887901, + 504514034, + 3765247327, + 1000070091, + 3727494858, + 3657635382, + 3839047923, + 3886529747, + 4069720347, + 4164704452, + 342197850, + 3540244297, + 2513230733, + 4117704995, + 3367298820, + 2680283743, + 3119663365, + 3697738938, + 545363837, + 163402553, + 5908395, + 129135650, + 2289183712, + 200922300, + 761731755, + 894529125, + 1086964761, + 1168927492, + 2100052708, + 2438466459, + 3390051757, + 2498042266, + 2557754096, + 2600961503, + 487719832, + 703543228, + 2726532092, + 4199470013, + 3142155593, + 2550501832, + 4076840151, + 200553094, + 380957745, + 572905105, + 462664429, + 1466804584, + 330249537, + 2605012269, + 491456522, + 4126287524, + 502863753, + 952536201, + 3510682541, + 1137442027, + 1665981878, + 1761469971, + 3085467405, + 2045285083, + 796985462, + 3433956341, + 2217966239, + 2183547611, + 2279273489, + 1916983087, + 2348676810, + 2403632109, + 2409539315, + 545986953, + 176166202, + 2477389837, + 2573160348, + 2796513469, + 3972309363, + 528662843, + 1038982109, + 1125913837, + 1318081294, + 1417425499, + }; + return descriptors_with_coding_scheme; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/comp/markv_model_shader.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/comp/markv_model_shader.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/comp/markv_model_shader.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/comp/markv_model_shader.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,45 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SPIRV_TOOLS_MARKV_MODEL_SHADER_H_ +#define SPIRV_TOOLS_MARKV_MODEL_SHADER_H_ + +#include "source/comp/markv_model.h" + +namespace spvtools { + +// MARK-V shader compression model, which only uses fast and lightweight +// algorithms, which do not require training and are not heavily dependent on +// SPIR-V grammar. Compression ratio is worse than by other models. +class MarkvModelShaderLite : public MarkvModel { + public: + MarkvModelShaderLite(); +}; + +// MARK-V shader compression model with balanced compression ratio and runtime +// performance. +class MarkvModelShaderMid : public MarkvModel { + public: + MarkvModelShaderMid(); +}; + +// MARK-V shader compression model designed for maximum compression. +class MarkvModelShaderMax : public MarkvModel { + public: + MarkvModelShaderMax(); +}; + +} // namespace spvtools + +#endif // SPIRV_TOOLS_MARKV_MODEL_SHADER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/dis/dis.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/dis/dis.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/dis/dis.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/dis/dis.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,209 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) +#include // Need fileno +#include +#endif + +#include +#include +#include +#include + +#include "spirv-tools/libspirv.h" +#include "tools/io.h" + +static void print_usage(char* argv0) { + printf( + R"(%s - Disassemble a SPIR-V binary module + +Usage: %s [options] [] + +The SPIR-V binary is read from . If no file is specified, +or if the filename is "-", then the binary is read from standard input. + +Options: + + -h, --help Print this help. + --version Display disassembler version information. + + -o Set the output filename. + Output goes to standard output if this option is + not specified, or if the filename is "-". + + --color Force color output. The default when printing to a terminal. + Overrides a previous --no-color option. + --no-color Don't print in color. Overrides a previous --color option. + The default when output goes to something other than a + terminal (e.g. a file, a pipe, or a shell redirection). + + --no-indent Don't indent instructions. + + --no-header Don't output the header as leading comments. + + --raw-id Show raw Id values instead of friendly names. + + --offsets Show byte offsets for each instruction. +)", + argv0, argv0); +} + +static const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_3; + +int main(int argc, char** argv) { + const char* inFile = nullptr; + const char* outFile = nullptr; + + bool color_is_possible = +#if SPIRV_COLOR_TERMINAL + true; +#else + false; +#endif + bool force_color = false; + bool force_no_color = false; + + bool allow_indent = true; + bool show_byte_offsets = false; + bool no_header = false; + bool friendly_names = true; + + for (int argi = 1; argi < argc; ++argi) { + if ('-' == argv[argi][0]) { + switch (argv[argi][1]) { + case 'h': + print_usage(argv[0]); + return 0; + case 'o': { + if (!outFile && argi + 1 < argc) { + outFile = argv[++argi]; + } else { + print_usage(argv[0]); + return 1; + } + } break; + case '-': { + // Long options + if (0 == strcmp(argv[argi], "--no-color")) { + force_no_color = true; + force_color = false; + } else if (0 == strcmp(argv[argi], "--color")) { + force_no_color = false; + force_color = true; + } else if (0 == strcmp(argv[argi], "--no-indent")) { + allow_indent = false; + } else if (0 == strcmp(argv[argi], "--offsets")) { + show_byte_offsets = true; + } else if (0 == strcmp(argv[argi], "--no-header")) { + no_header = true; + } else if (0 == strcmp(argv[argi], "--raw-id")) { + friendly_names = false; + } else if (0 == strcmp(argv[argi], "--help")) { + print_usage(argv[0]); + return 0; + } else if (0 == strcmp(argv[argi], "--version")) { + printf("%s\n", spvSoftwareVersionDetailsString()); + printf("Target: %s\n", + spvTargetEnvDescription(kDefaultEnvironment)); + return 0; + } else { + print_usage(argv[0]); + return 1; + } + } break; + case 0: { + // Setting a filename of "-" to indicate stdin. + if (!inFile) { + inFile = argv[argi]; + } else { + fprintf(stderr, "error: More than one input file specified\n"); + return 1; + } + } break; + default: + print_usage(argv[0]); + return 1; + } + } else { + if (!inFile) { + inFile = argv[argi]; + } else { + fprintf(stderr, "error: More than one input file specified\n"); + return 1; + } + } + } + + uint32_t options = SPV_BINARY_TO_TEXT_OPTION_NONE; + + if (allow_indent) options |= SPV_BINARY_TO_TEXT_OPTION_INDENT; + + if (show_byte_offsets) options |= SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET; + + if (no_header) options |= SPV_BINARY_TO_TEXT_OPTION_NO_HEADER; + + if (friendly_names) options |= SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES; + + if (!outFile || (0 == strcmp("-", outFile))) { + // Print to standard output. + options |= SPV_BINARY_TO_TEXT_OPTION_PRINT; + + if (color_is_possible && !force_no_color) { + bool output_is_tty = true; +#if defined(_POSIX_VERSION) + output_is_tty = isatty(fileno(stdout)); +#endif + if (output_is_tty || force_color) { + options |= SPV_BINARY_TO_TEXT_OPTION_COLOR; + } + } + } + + // Read the input binary. + std::vector contents; + if (!ReadFile(inFile, "rb", &contents)) return 1; + + // If printing to standard output, then spvBinaryToText should + // do the printing. In particular, colour printing on Windows is + // controlled by modifying console objects synchronously while + // outputting to the stream rather than by injecting escape codes + // into the output stream. + // If the printing option is off, then save the text in memory, so + // it can be emitted later in this function. + const bool print_to_stdout = SPV_BINARY_TO_TEXT_OPTION_PRINT & options; + spv_text text = nullptr; + spv_text* textOrNull = print_to_stdout ? nullptr : &text; + spv_diagnostic diagnostic = nullptr; + spv_context context = spvContextCreate(kDefaultEnvironment); + spv_result_t error = + spvBinaryToText(context, contents.data(), contents.size(), options, + textOrNull, &diagnostic); + spvContextDestroy(context); + if (error) { + spvDiagnosticPrint(diagnostic); + spvDiagnosticDestroy(diagnostic); + return error; + } + + if (!print_to_stdout) { + if (!WriteFile(outFile, "w", text->str, text->length)) { + spvTextDestroy(text); + return 1; + } + } + spvTextDestroy(text); + + return 0; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/emacs/50spirv-tools.el vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/emacs/50spirv-tools.el --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/emacs/50spirv-tools.el 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/emacs/50spirv-tools.el 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,40 @@ +;; Copyright (c) 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. + +;; Upon loading a file with the .spv extension into emacs, the file +;; will be disassembled using spirv-dis, and the result colorized with +;; asm-mode in emacs. The file may be edited within the constraints +;; of validity, and when re-saved will be re-assembled using spirv-as. + +;; Note that symbol IDs are not preserved through a load/edit/save operation. +;; This may change if the ability is added to spirv-as. + +;; It is required that those tools be in your PATH. If that is not the case +;; when starting emacs, the path can be modified as in this example: +;; (setenv "PATH" (concat (getenv "PATH") ":/path/to/spirv/tools")) +;; +;; See https://github.com/KhronosGroup/SPIRV-Tools/issues/359 + +(require 'jka-compr) +(require 'asm-mode) + +(add-to-list 'jka-compr-compression-info-list + '["\\.spv\\'" + "Assembling SPIRV" "spirv-as" ("-o" "-") + "Disassembling SPIRV" "spirv-dis" ("--no-color" "--raw-id") + t nil "\003\002\043\007"]) + +(add-to-list 'auto-mode-alist '("\\.spv\\'" . asm-mode)) + +(jka-compr-update) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/emacs/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/emacs/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/emacs/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/emacs/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,48 @@ +# Copyright (c) 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. + +# Install a script for use with the auto-compression feature of emacs(1). +# Upon loading a file with the .spv extension, the file will be disassembled +# using spirv-dis, and the result colorized with asm-mode in emacs. The file +# may be edited within the constraints of validity, and when re-saved will be +# re-assembled using spirv-as. + +# It is required that those tools be in your PATH. If that is not the case +# when starting emacs, the path can be modified as in this example: +# (setenv "PATH" (concat (getenv "PATH") ":/path/to/spirv/tools")) +# +# See https://github.com/KhronosGroup/SPIRV-Tools/issues/359 + +# This is an absolute directory, and ignores CMAKE_INSTALL_PREFIX, or +# it will not be found by emacs upon startup. It is only installed if +# both of the following are true: +# 1. SPIRV_TOOLS_INSTALL_EMACS_HELPERS is defined +# 2. The directory /etc/emacs/site-start.d already exists at the time of +# cmake invocation (not at the time of make install). This is +# typically true if emacs is installed on the system. + +# Note that symbol IDs are not preserved through a load/edit/save operation. +# This may change if the ability is added to spirv-as. + +option(SPIRV_TOOLS_INSTALL_EMACS_HELPERS + "Install Emacs helper to disassemble/assemble SPIR-V binaries on file load/save." + ${SPIRV_TOOLS_INSTALL_EMACS_HELPERS}) +if (${SPIRV_TOOLS_INSTALL_EMACS_HELPERS}) + if(EXISTS /etc/emacs/site-start.d) + if(ENABLE_SPIRV_TOOLS_INSTALL) + install(FILES 50spirv-tools.el DESTINATION /etc/emacs/site-start.d) + endif(ENABLE_SPIRV_TOOLS_INSTALL) + endif() +endif() + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/io.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/io.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/io.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/io.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright (c) 2016 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_TOOLS_IO_H_ +#define LIBSPIRV_TOOLS_IO_H_ + +#include +#include +#include + +// Appends the content from the file named as |filename| to |data|, assuming +// each element in the file is of type |T|. The file is opened with the given +// |mode|. If |filename| is nullptr or "-", reads from the standard input. If +// any error occurs, writes error messages to standard error and returns false. +template +bool ReadFile(const char* filename, const char* mode, std::vector* data) { + const int buf_size = 1024; + const bool use_file = filename && strcmp("-", filename); + if (FILE* fp = (use_file ? fopen(filename, mode) : stdin)) { + T buf[buf_size]; + while (size_t len = fread(buf, sizeof(T), buf_size, fp)) { + data->insert(data->end(), buf, buf + len); + } + if (ftell(fp) == -1L) { + if (ferror(fp)) { + fprintf(stderr, "error: error reading file '%s'\n", filename); + return false; + } + } else { + if (sizeof(T) != 1 && (ftell(fp) % sizeof(T))) { + fprintf(stderr, "error: corrupted word found in file '%s'\n", filename); + return false; + } + } + if (use_file) fclose(fp); + } else { + fprintf(stderr, "error: file does not exist '%s'\n", filename); + return false; + } + return true; +} + +// Writes the given |data| into the file named as |filename| using the given +// |mode|, assuming |data| is an array of |count| elements of type |T|. If +// |filename| is nullptr or "-", writes to standard output. If any error occurs, +// returns false and outputs error message to standard error. +template +bool WriteFile(const char* filename, const char* mode, const T* data, + size_t count) { + const bool use_stdout = + !filename || (filename[0] == '-' && filename[1] == '\0'); + if (FILE* fp = (use_stdout ? stdout : fopen(filename, mode))) { + size_t written = fwrite(data, sizeof(T), count, fp); + if (count != written) { + fprintf(stderr, "error: could not write to file '%s'\n", filename); + return false; + } + if (!use_stdout) fclose(fp); + } else { + fprintf(stderr, "error: could not open file '%s'\n", filename); + return false; + } + return true; +} + +#endif // LIBSPIRV_TOOLS_IO_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/lesspipe/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/lesspipe/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/lesspipe/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/lesspipe/CMakeLists.txt 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,28 @@ +# Copyright (c) 2016 Google 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. + +# Install a script for use with the LESSOPEN of less(1). +# For example, after installation into /usr/local do: +# export LESSOPEN='|/usr/local/bin "%s"' +# less -R foo.spv +# +# See https://github.com/KhronosGroup/SPIRV-Tools/issues/359 + +# The script will be installed with everyone having read and execute +# permissions. +# We have a .sh extension because Windows users often configure +# executable settings via filename extension. +if(ENABLE_SPIRV_TOOLS_INSTALL) + install(PROGRAMS spirv-lesspipe.sh DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif(ENABLE_SPIRV_TOOLS_INSTALL) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/lesspipe/spirv-lesspipe.sh vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/lesspipe/spirv-lesspipe.sh --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/lesspipe/spirv-lesspipe.sh 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/lesspipe/spirv-lesspipe.sh 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,27 @@ +#!/bin/bash +# Copyright (c) 2016 The Khronos Group Inc. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A script for automatically disassembling a .spv file +# for less(1). This assumes spirv-dis is on our PATH. +# +# See https://github.com/KhronosGroup/SPIRV-Tools/issues/359 + +case "$1" in + *.spv) spirv-dis "$@" 2>/dev/null;; + *) exit 1;; +esac + +exit $? + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/link/linker.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/link/linker.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/link/linker.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/link/linker.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,159 @@ +// Copyright (c) 2017 Pierre Moreau +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include + +#include "source/spirv_target_env.h" +#include "source/table.h" +#include "spirv-tools/libspirv.hpp" +#include "spirv-tools/linker.hpp" +#include "tools/io.h" + +void print_usage(char* argv0) { + printf( + R"(%s - Link SPIR-V binary files together. + +USAGE: %s [options] [ ...] + +The SPIR-V binaries are read from the different . + +NOTE: The linker is a work in progress. + +Options: + -h, --help Print this help. + -o Name of the resulting linked SPIR-V binary. + --create-library Link the binaries into a library, keeping all exported symbols. + --allow-partial-linkage Allow partial linkage by accepting imported symbols to be unresolved. + --verify-ids Verify that IDs in the resulting modules are truly unique. + --version Display linker version information + --target-env {vulkan1.0|spv1.0|spv1.1|spv1.2|opencl2.1|opencl2.2} + Use Vulkan1.0/SPIR-V1.0/SPIR-V1.1/SPIR-V1.2/OpenCL-2.1/OpenCL2.2 validation rules. +)", + argv0, argv0); +} + +int main(int argc, char** argv) { + std::vector inFiles; + const char* outFile = nullptr; + spv_target_env target_env = SPV_ENV_UNIVERSAL_1_0; + spvtools::LinkerOptions options; + bool continue_processing = true; + int return_code = 0; + + for (int argi = 1; continue_processing && argi < argc; ++argi) { + const char* cur_arg = argv[argi]; + if ('-' == cur_arg[0]) { + if (0 == strcmp(cur_arg, "-o")) { + if (argi + 1 < argc) { + if (!outFile) { + outFile = argv[++argi]; + } else { + fprintf(stderr, "error: More than one output file specified\n"); + continue_processing = false; + return_code = 1; + } + } else { + fprintf(stderr, "error: Missing argument to %s\n", cur_arg); + continue_processing = false; + return_code = 1; + } + } else if (0 == strcmp(cur_arg, "--create-library")) { + options.SetCreateLibrary(true); + } else if (0 == strcmp(cur_arg, "--verify-ids")) { + options.SetVerifyIds(true); + } else if (0 == strcmp(cur_arg, "--allow-partial-linkage")) { + options.SetAllowPartialLinkage(true); + } else if (0 == strcmp(cur_arg, "--version")) { + printf("%s\n", spvSoftwareVersionDetailsString()); + // TODO(dneto): Add OpenCL 2.2 at least. + printf("Targets:\n %s\n %s\n %s\n", + spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_1), + spvTargetEnvDescription(SPV_ENV_VULKAN_1_0), + spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_2)); + continue_processing = false; + return_code = 0; + } else if (0 == strcmp(cur_arg, "--help") || 0 == strcmp(cur_arg, "-h")) { + print_usage(argv[0]); + continue_processing = false; + return_code = 0; + } else if (0 == strcmp(cur_arg, "--target-env")) { + if (argi + 1 < argc) { + const auto env_str = argv[++argi]; + if (!spvParseTargetEnv(env_str, &target_env)) { + fprintf(stderr, "error: Unrecognized target env: %s\n", env_str); + continue_processing = false; + return_code = 1; + } + } else { + fprintf(stderr, "error: Missing argument to --target-env\n"); + continue_processing = false; + return_code = 1; + } + } + } else { + inFiles.push_back(cur_arg); + } + } + + // Exit if command line parsing was not successful. + if (!continue_processing) { + return return_code; + } + + if (inFiles.empty()) { + fprintf(stderr, "error: No input file specified\n"); + return 1; + } + + std::vector> contents(inFiles.size()); + for (size_t i = 0u; i < inFiles.size(); ++i) { + if (!ReadFile(inFiles[i], "rb", &contents[i])) return 1; + } + + const spvtools::MessageConsumer consumer = [](spv_message_level_t level, + const char*, + const spv_position_t& position, + const char* message) { + switch (level) { + case SPV_MSG_FATAL: + case SPV_MSG_INTERNAL_ERROR: + case SPV_MSG_ERROR: + std::cerr << "error: " << position.index << ": " << message + << std::endl; + break; + case SPV_MSG_WARNING: + std::cout << "warning: " << position.index << ": " << message + << std::endl; + break; + case SPV_MSG_INFO: + std::cout << "info: " << position.index << ": " << message << std::endl; + break; + default: + break; + } + }; + spvtools::Context context(target_env); + context.SetMessageConsumer(consumer); + + std::vector linkingResult; + spv_result_t status = Link(context, contents, &linkingResult, options); + + if (!WriteFile(outFile, "wb", linkingResult.data(), + linkingResult.size())) + return 1; + + return status == SPV_SUCCESS ? 0 : 1; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/opt/opt.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/opt/opt.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/opt/opt.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/opt/opt.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,653 @@ +// Copyright (c) 2016 Google 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. + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "opt/set_spec_constant_default_value_pass.h" +#include "spirv-tools/optimizer.hpp" + +#include "message.h" +#include "tools/io.h" + +using namespace spvtools; + +namespace { + +// Status and actions to perform after parsing command-line arguments. +enum OptActions { OPT_CONTINUE, OPT_STOP }; + +struct OptStatus { + OptActions action; + int code; +}; + +std::string GetListOfPassesAsString(const spvtools::Optimizer& optimizer) { + std::stringstream ss; + for (const auto& name : optimizer.GetPassNames()) { + ss << "\n\t\t" << name; + } + return ss.str(); +} + +const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_3; + +std::string GetLegalizationPasses() { + spvtools::Optimizer optimizer(kDefaultEnvironment); + optimizer.RegisterLegalizationPasses(); + return GetListOfPassesAsString(optimizer); +} + +std::string GetOptimizationPasses() { + spvtools::Optimizer optimizer(kDefaultEnvironment); + optimizer.RegisterPerformancePasses(); + return GetListOfPassesAsString(optimizer); +} + +std::string GetSizePasses() { + spvtools::Optimizer optimizer(kDefaultEnvironment); + optimizer.RegisterSizePasses(); + return GetListOfPassesAsString(optimizer); +} + +void PrintUsage(const char* program) { + // NOTE: Please maintain flags in lexicographical order. + printf( + R"(%s - Optimize a SPIR-V binary file. + +USAGE: %s [options] [] -o + +The SPIR-V binary is read from . If no file is specified, +or if is "-", then the binary is read from standard input. +if is "-", then the optimized output is written to +standard output. + +NOTE: The optimizer is a work in progress. + +Options (in lexicographical order): + --ccp + Apply the conditional constant propagation transform. This will + propagate constant values throughout the program, and simplify + expressions and conditional jumps with known predicate + values. Performed on entry point call tree functions and + exported functions. + --cfg-cleanup + Cleanup the control flow graph. This will remove any unnecessary + code from the CFG like unreachable code. Performed on entry + point call tree functions and exported functions. + --compact-ids + Remap result ids to a compact range starting from %%1 and without + any gaps. + --convert-local-access-chains + Convert constant index access chain loads/stores into + equivalent load/stores with inserts and extracts. Performed + on function scope variables referenced only with load, store, + and constant index access chains in entry point call tree + functions. + --copy-propagate-arrays + Does propagation of memory references when an array is a copy of + another. It will only propagate an array if the source is never + written to, and the only store to the target is the copy. + --eliminate-common-uniform + Perform load/load elimination for duplicate uniform values. + Converts any constant index access chain uniform loads into + its equivalent load and extract. Some loads will be moved + to facilitate sharing. Performed only on entry point + call tree functions. + --eliminate-dead-branches + Convert conditional branches with constant condition to the + indicated unconditional brranch. Delete all resulting dead + code. Performed only on entry point call tree functions. + --eliminate-dead-code-aggressive + Delete instructions which do not contribute to a function's + output. Performed only on entry point call tree functions. + --eliminate-dead-const + Eliminate dead constants. + --eliminate-dead-functions + Deletes functions that cannot be reached from entry points or + exported functions. + --eliminate-dead-insert + Deletes unreferenced inserts into composites, most notably + unused stores to vector components, that are not removed by + aggressive dead code elimination. + --eliminate-dead-variables + Deletes module scope variables that are not referenced. + --eliminate-insert-extract + Replace extract from a sequence of inserts with the + corresponding value. Performed only on entry point call tree + functions. + --eliminate-local-multi-store + Replace stores and loads of function scope variables that are + stored multiple times. Performed on variables referenceed only + with loads and stores. Performed only on entry point call tree + functions. + --eliminate-local-single-block + Perform single-block store/load and load/load elimination. + Performed only on function scope variables in entry point + call tree functions. + --eliminate-local-single-store + Replace stores and loads of function scope variables that are + only stored once. Performed on variables referenceed only with + loads and stores. Performed only on entry point call tree + functions. + --flatten-decorations + Replace decoration groups with repeated OpDecorate and + OpMemberDecorate instructions. + --fold-spec-const-op-composite + Fold the spec constants defined by OpSpecConstantOp or + OpSpecConstantComposite instructions to front-end constants + when possible. + --freeze-spec-const + Freeze the values of specialization constants to their default + values. + --if-conversion + Convert if-then-else like assignments into OpSelect. + --inline-entry-points-exhaustive + Exhaustively inline all function calls in entry point call tree + functions. Currently does not inline calls to functions with + early return in a loop. + --legalize-hlsl + Runs a series of optimizations that attempts to take SPIR-V + generated by and HLSL front-end and generate legal Vulkan SPIR-V. + The optimizations are: + %s + + Note this does not guarantee legal code. This option implies + --skip-validation. + --local-redundancy-elimination + Looks for instructions in the same basic block that compute the + same value, and deletes the redundant ones. + --loop-unroll + Fully unrolls loops marked with the Unroll flag + --loop-unroll-partial + Partially unrolls loops marked with the Unroll flag. Takes an + additional non-0 integer argument to set the unroll factor, or + how many times a loop body should be duplicated + --merge-blocks + Join two blocks into a single block if the second has the + first as its only predecessor. Performed only on entry point + call tree functions. + --merge-return + Changes functions that have multiple return statements so they + have a single return statement. + + For structured control flow it is assumed that the only + unreachable blocks in the function are trivial merge and continue + blocks. + + A trivial merge block contains the label and an OpUnreachable + instructions, nothing else. A trivial continue block contain a + label and an OpBranch to the header, nothing else. + + These conditions are guaranteed to be met after running + dead-branch elimination. + --loop-unswitch + Hoists loop-invariant conditionals out of loops by duplicating + the loop on each branch of the conditional and adjusting each + copy of the loop. + -O + Optimize for performance. Apply a sequence of transformations + in an attempt to improve the performance of the generated + code. For this version of the optimizer, this flag is equivalent + to specifying the following optimization code names: + %s + -Os + Optimize for size. Apply a sequence of transformations in an + attempt to minimize the size of the generated code. For this + version of the optimizer, this flag is equivalent to specifying + the following optimization code names: + %s + + NOTE: The specific transformations done by -O and -Os change + from release to release. + -Oconfig= + Apply the sequence of transformations indicated in . + This file contains a sequence of strings separated by whitespace + (tabs, newlines or blanks). Each string is one of the flags + accepted by spirv-opt. Optimizations will be applied in the + sequence they appear in the file. This is equivalent to + specifying all the flags on the command line. For example, + given the file opts.cfg with the content: + + --inline-entry-points-exhaustive + --eliminate-dead-code-aggressive + + The following two invocations to spirv-opt are equivalent: + + $ spirv-opt -Oconfig=opts.cfg program.spv + + $ spirv-opt --inline-entry-points-exhaustive \ + --eliminate-dead-code-aggressive program.spv + + Lines starting with the character '#' in the configuration + file indicate a comment and will be ignored. + + The -O, -Os, and -Oconfig flags act as macros. Using one of them + is equivalent to explicitly inserting the underlying flags at + that position in the command line. For example, the invocation + 'spirv-opt --merge-blocks -O ...' applies the transformation + --merge-blocks followed by all the transformations implied by + -O. + --print-all + Print SPIR-V assembly to standard error output before each pass + and after the last pass. + --private-to-local + Change the scope of private variables that are used in a single + function to that function. + --remove-duplicates + Removes duplicate types, decorations, capabilities and extension + instructions. + --redundancy-elimination + Looks for instructions in the same function that compute the + same value, and deletes the redundant ones. + --relax-struct-store + Allow store from one struct type to a different type with + compatible layout and members. This option is forwarded to the + validator. + --replace-invalid-opcode + Replaces instructions whose opcode is valid for shader modules, + but not for the current shader stage. To have an effect, all + entry points must have the same execution model. + --ssa-rewrite + Replace loads and stores to function local variables with + operations on SSA IDs. + --scalar-replacement + Replace aggregate function scope variables that are only accessed + via their elements with new function variables representing each + element. + --set-spec-const-default-value ": ..." + Set the default values of the specialization constants with + : pairs specified in a double-quoted + string. : pairs must be separated by + blank spaces, and in each pair, spec id and default value must + be separated with colon ':' without any blank spaces in between. + e.g.: --set-spec-const-default-value "1:100 2:400" + --simplify-instructions + Will simplify all instructions in the function as much as + possible. + --skip-validation + Will not validate the SPIR-V before optimizing. If the SPIR-V + is invalid, the optimizer may fail or generate incorrect code. + This options should be used rarely, and with caution. + --strength-reduction + Replaces instructions with equivalent and less expensive ones. + --strip-debug + Remove all debug instructions. + --strip-reflect + Remove all reflection information. For now, this covers + reflection information defined by SPV_GOOGLE_hlsl_functionality1. + --time-report + Print the resource utilization of each pass (e.g., CPU time, + RSS) to standard error output. Currently it supports only Unix + systems. This option is the same as -ftime-report in GCC. It + prints CPU/WALL/USR/SYS time (and RSS if possible), but note that + USR/SYS time are returned by getrusage() and can have a small + error. + --workaround-1209 + Rewrites instructions for which there are known driver bugs to + avoid triggering those bugs. + Current workarounds: Avoid OpUnreachable in loops. + --unify-const + Remove the duplicated constants. + -h, --help + Print this help. + --version + Display optimizer version information. +)", + program, program, GetLegalizationPasses().c_str(), + GetOptimizationPasses().c_str(), GetSizePasses().c_str()); +} + +// Reads command-line flags the file specified in |oconfig_flag|. This string +// is assumed to have the form "-Oconfig=FILENAME". This function parses the +// string and extracts the file name after the '=' sign. +// +// Flags found in |FILENAME| are pushed at the end of the vector |file_flags|. +// +// This function returns true on success, false on failure. +bool ReadFlagsFromFile(const char* oconfig_flag, + std::vector* file_flags) { + const char* fname = strchr(oconfig_flag, '='); + if (fname == nullptr || fname[0] != '=') { + fprintf(stderr, "error: Invalid -Oconfig flag %s\n", oconfig_flag); + return false; + } + fname++; + + std::ifstream input_file; + input_file.open(fname); + if (input_file.fail()) { + fprintf(stderr, "error: Could not open file '%s'\n", fname); + return false; + } + + while (!input_file.eof()) { + std::string flag; + input_file >> flag; + if (flag.length() > 0 && flag[0] != '#') { + file_flags->push_back(flag); + } + } + + return true; +} + +OptStatus ParseFlags(int argc, const char** argv, Optimizer* optimizer, + const char** in_file, const char** out_file, + spv_validator_options options, bool* skip_validator); + +// Parses and handles the -Oconfig flag. |prog_name| contains the name of +// the spirv-opt binary (used to build a new argv vector for the recursive +// invocation to ParseFlags). |opt_flag| contains the -Oconfig=FILENAME flag. +// |optimizer|, |in_file| and |out_file| are as in ParseFlags. +// +// This returns the same OptStatus instance returned by ParseFlags. +OptStatus ParseOconfigFlag(const char* prog_name, const char* opt_flag, + Optimizer* optimizer, const char** in_file, + const char** out_file) { + std::vector flags; + flags.push_back(prog_name); + + std::vector file_flags; + if (!ReadFlagsFromFile(opt_flag, &file_flags)) { + fprintf(stderr, + "error: Could not read optimizer flags from configuration file\n"); + return {OPT_STOP, 1}; + } + flags.insert(flags.end(), file_flags.begin(), file_flags.end()); + + const char** new_argv = new const char*[flags.size()]; + for (size_t i = 0; i < flags.size(); i++) { + if (flags[i].find("-Oconfig=") != std::string::npos) { + fprintf(stderr, + "error: Flag -Oconfig= may not be used inside the configuration " + "file\n"); + return {OPT_STOP, 1}; + } + new_argv[i] = flags[i].c_str(); + } + + bool skip_validator = false; + return ParseFlags(static_cast(flags.size()), new_argv, optimizer, + in_file, out_file, nullptr, &skip_validator); +} + +OptStatus ParseLoopUnrollPartialArg(int argc, const char** argv, int argi, + Optimizer* optimizer) { + if (argi < argc) { + int factor = atoi(argv[argi]); + if (factor != 0) { + optimizer->RegisterPass(CreateLoopUnrollPass(false, factor)); + return {OPT_CONTINUE, 0}; + } + } + fprintf(stderr, + "error: --loop-unroll-partial must be followed by a non-0 " + "integer\n"); + return {OPT_STOP, 1}; +} + +// Parses command-line flags. |argc| contains the number of command-line flags. +// |argv| points to an array of strings holding the flags. |optimizer| is the +// Optimizer instance used to optimize the program. +// +// On return, this function stores the name of the input program in |in_file|. +// The name of the output file in |out_file|. The return value indicates whether +// optimization should continue and a status code indicating an error or +// success. +OptStatus ParseFlags(int argc, const char** argv, Optimizer* optimizer, + const char** in_file, const char** out_file, + spv_validator_options options, bool* skip_validator) { + for (int argi = 1; argi < argc; ++argi) { + const char* cur_arg = argv[argi]; + if ('-' == cur_arg[0]) { + if (0 == strcmp(cur_arg, "--version")) { + printf("%s\n", spvSoftwareVersionDetailsString()); + return {OPT_STOP, 0}; + } else if (0 == strcmp(cur_arg, "--help") || 0 == strcmp(cur_arg, "-h")) { + PrintUsage(argv[0]); + return {OPT_STOP, 0}; + } else if (0 == strcmp(cur_arg, "-o")) { + if (!*out_file && argi + 1 < argc) { + *out_file = argv[++argi]; + } else { + PrintUsage(argv[0]); + return {OPT_STOP, 1}; + } + } else if (0 == strcmp(cur_arg, "--strip-debug")) { + optimizer->RegisterPass(CreateStripDebugInfoPass()); + } else if (0 == strcmp(cur_arg, "--strip-reflect")) { + optimizer->RegisterPass(CreateStripReflectInfoPass()); + } else if (0 == strcmp(cur_arg, "--set-spec-const-default-value")) { + if (++argi < argc) { + auto spec_ids_vals = + opt::SetSpecConstantDefaultValuePass::ParseDefaultValuesString( + argv[argi]); + if (!spec_ids_vals) { + fprintf(stderr, + "error: Invalid argument for " + "--set-spec-const-default-value: %s\n", + argv[argi]); + return {OPT_STOP, 1}; + } + optimizer->RegisterPass( + CreateSetSpecConstantDefaultValuePass(std::move(*spec_ids_vals))); + } else { + fprintf( + stderr, + "error: Expected a string of : pairs."); + return {OPT_STOP, 1}; + } + } else if (0 == strcmp(cur_arg, "--if-conversion")) { + optimizer->RegisterPass(CreateIfConversionPass()); + } else if (0 == strcmp(cur_arg, "--freeze-spec-const")) { + optimizer->RegisterPass(CreateFreezeSpecConstantValuePass()); + } else if (0 == strcmp(cur_arg, "--inline-entry-points-exhaustive")) { + optimizer->RegisterPass(CreateInlineExhaustivePass()); + } else if (0 == strcmp(cur_arg, "--inline-entry-points-opaque")) { + optimizer->RegisterPass(CreateInlineOpaquePass()); + } else if (0 == strcmp(cur_arg, "--convert-local-access-chains")) { + optimizer->RegisterPass(CreateLocalAccessChainConvertPass()); + } else if (0 == strcmp(cur_arg, "--eliminate-dead-code-aggressive")) { + optimizer->RegisterPass(CreateAggressiveDCEPass()); + } else if (0 == strcmp(cur_arg, "--eliminate-insert-extract")) { + optimizer->RegisterPass(CreateInsertExtractElimPass()); + } else if (0 == strcmp(cur_arg, "--eliminate-local-single-block")) { + optimizer->RegisterPass(CreateLocalSingleBlockLoadStoreElimPass()); + } else if (0 == strcmp(cur_arg, "--eliminate-local-single-store")) { + optimizer->RegisterPass(CreateLocalSingleStoreElimPass()); + } else if (0 == strcmp(cur_arg, "--merge-blocks")) { + optimizer->RegisterPass(CreateBlockMergePass()); + } else if (0 == strcmp(cur_arg, "--merge-return")) { + optimizer->RegisterPass(CreateMergeReturnPass()); + } else if (0 == strcmp(cur_arg, "--eliminate-dead-branches")) { + optimizer->RegisterPass(CreateDeadBranchElimPass()); + } else if (0 == strcmp(cur_arg, "--eliminate-dead-functions")) { + optimizer->RegisterPass(CreateEliminateDeadFunctionsPass()); + } else if (0 == strcmp(cur_arg, "--eliminate-local-multi-store")) { + optimizer->RegisterPass(CreateLocalMultiStoreElimPass()); + } else if (0 == strcmp(cur_arg, "--eliminate-common-uniform")) { + optimizer->RegisterPass(CreateCommonUniformElimPass()); + } else if (0 == strcmp(cur_arg, "--eliminate-dead-const")) { + optimizer->RegisterPass(CreateEliminateDeadConstantPass()); + } else if (0 == strcmp(cur_arg, "--eliminate-dead-inserts")) { + optimizer->RegisterPass(CreateDeadInsertElimPass()); + } else if (0 == strcmp(cur_arg, "--eliminate-dead-variables")) { + optimizer->RegisterPass(CreateDeadVariableEliminationPass()); + } else if (0 == strcmp(cur_arg, "--fold-spec-const-op-composite")) { + optimizer->RegisterPass(CreateFoldSpecConstantOpAndCompositePass()); + } else if (0 == strcmp(cur_arg, "--loop-unswitch")) { + optimizer->RegisterPass(CreateLoopUnswitchPass()); + } else if (0 == strcmp(cur_arg, "--scalar-replacement")) { + optimizer->RegisterPass(CreateScalarReplacementPass()); + } else if (0 == strcmp(cur_arg, "--strength-reduction")) { + optimizer->RegisterPass(CreateStrengthReductionPass()); + } else if (0 == strcmp(cur_arg, "--unify-const")) { + optimizer->RegisterPass(CreateUnifyConstantPass()); + } else if (0 == strcmp(cur_arg, "--flatten-decorations")) { + optimizer->RegisterPass(CreateFlattenDecorationPass()); + } else if (0 == strcmp(cur_arg, "--compact-ids")) { + optimizer->RegisterPass(CreateCompactIdsPass()); + } else if (0 == strcmp(cur_arg, "--cfg-cleanup")) { + optimizer->RegisterPass(CreateCFGCleanupPass()); + } else if (0 == strcmp(cur_arg, "--local-redundancy-elimination")) { + optimizer->RegisterPass(CreateLocalRedundancyEliminationPass()); + } else if (0 == strcmp(cur_arg, "--loop-invariant-code-motion")) { + optimizer->RegisterPass(CreateLoopInvariantCodeMotionPass()); + } else if (0 == strcmp(cur_arg, "--redundancy-elimination")) { + optimizer->RegisterPass(CreateRedundancyEliminationPass()); + } else if (0 == strcmp(cur_arg, "--private-to-local")) { + optimizer->RegisterPass(CreatePrivateToLocalPass()); + } else if (0 == strcmp(cur_arg, "--remove-duplicates")) { + optimizer->RegisterPass(CreateRemoveDuplicatesPass()); + } else if (0 == strcmp(cur_arg, "--workaround-1209")) { + optimizer->RegisterPass(CreateWorkaround1209Pass()); + } else if (0 == strcmp(cur_arg, "--relax-struct-store")) { + options->relax_struct_store = true; + } else if (0 == strcmp(cur_arg, "--replace-invalid-opcode")) { + optimizer->RegisterPass(CreateReplaceInvalidOpcodePass()); + } else if (0 == strcmp(cur_arg, "--simplify-instructions")) { + optimizer->RegisterPass(CreateSimplificationPass()); + } else if (0 == strcmp(cur_arg, "--ssa-rewrite")) { + optimizer->RegisterPass(CreateSSARewritePass()); + } else if (0 == strcmp(cur_arg, "--copy-propagate-arrays")) { + optimizer->RegisterPass(CreateCopyPropagateArraysPass()); + } else if (0 == strcmp(cur_arg, "--loop-unroll")) { + optimizer->RegisterPass(CreateLoopUnrollPass(true)); + } else if (0 == strcmp(cur_arg, "--loop-unroll-partial")) { + OptStatus status = + ParseLoopUnrollPartialArg(argc, argv, ++argi, optimizer); + if (status.action != OPT_CONTINUE) { + return status; + } + } else if (0 == strcmp(cur_arg, "--skip-validation")) { + *skip_validator = true; + } else if (0 == strcmp(cur_arg, "-O")) { + optimizer->RegisterPerformancePasses(); + } else if (0 == strcmp(cur_arg, "-Os")) { + optimizer->RegisterSizePasses(); + } else if (0 == strcmp(cur_arg, "--legalize-hlsl")) { + *skip_validator = true; + optimizer->RegisterLegalizationPasses(); + } else if (0 == strncmp(cur_arg, "-Oconfig=", sizeof("-Oconfig=") - 1)) { + OptStatus status = + ParseOconfigFlag(argv[0], cur_arg, optimizer, in_file, out_file); + if (status.action != OPT_CONTINUE) { + return status; + } + } else if (0 == strcmp(cur_arg, "--ccp")) { + optimizer->RegisterPass(CreateCCPPass()); + } else if (0 == strcmp(cur_arg, "--print-all")) { + optimizer->SetPrintAll(&std::cerr); + } else if (0 == strcmp(cur_arg, "--time-report")) { + optimizer->SetTimeReport(&std::cerr); + } else if ('\0' == cur_arg[1]) { + // Setting a filename of "-" to indicate stdin. + if (!*in_file) { + *in_file = cur_arg; + } else { + fprintf(stderr, "error: More than one input file specified\n"); + return {OPT_STOP, 1}; + } + } else { + fprintf( + stderr, + "error: Unknown flag '%s'. Use --help for a list of valid flags\n", + cur_arg); + return {OPT_STOP, 1}; + } + } else { + if (!*in_file) { + *in_file = cur_arg; + } else { + fprintf(stderr, "error: More than one input file specified\n"); + return {OPT_STOP, 1}; + } + } + } + + return {OPT_CONTINUE, 0}; +} + +} // namespace + +int main(int argc, const char** argv) { + const char* in_file = nullptr; + const char* out_file = nullptr; + bool skip_validator = false; + + spv_target_env target_env = kDefaultEnvironment; + spv_validator_options options = spvValidatorOptionsCreate(); + + spvtools::Optimizer optimizer(target_env); + optimizer.SetMessageConsumer([](spv_message_level_t level, const char* source, + const spv_position_t& position, + const char* message) { + std::cerr << StringifyMessage(level, source, position, message) + << std::endl; + }); + + OptStatus status = ParseFlags(argc, argv, &optimizer, &in_file, &out_file, + options, &skip_validator); + + if (status.action == OPT_STOP) { + return status.code; + } + + if (out_file == nullptr) { + fprintf(stderr, "error: -o required\n"); + return 1; + } + + std::vector binary; + if (!ReadFile(in_file, "rb", &binary)) { + return 1; + } + + if (!skip_validator) { + // Let's do validation first. + spv_context context = spvContextCreate(target_env); + spv_diagnostic diagnostic = nullptr; + spv_const_binary_t binary_struct = {binary.data(), binary.size()}; + spv_result_t error = + spvValidateWithOptions(context, options, &binary_struct, &diagnostic); + if (error) { + spvDiagnosticPrint(diagnostic); + spvDiagnosticDestroy(diagnostic); + spvValidatorOptionsDestroy(options); + spvContextDestroy(context); + return error; + } + spvDiagnosticDestroy(diagnostic); + spvValidatorOptionsDestroy(options); + spvContextDestroy(context); + } + + // By using the same vector as input and output, we save time in the case + // that there was no change. + bool ok = optimizer.Run(binary.data(), binary.size(), &binary); + + if (!WriteFile(out_file, "wb", binary.data(), binary.size())) { + return 1; + } + + return ok ? 0 : 1; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/stats/stats_analyzer.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/stats/stats_analyzer.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/stats/stats_analyzer.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/stats/stats_analyzer.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,874 @@ +// Copyright (c) 2017 Google 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. + +#include "stats_analyzer.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "latest_version_spirv_header.h" +#include "source/comp/markv_model.h" +#include "source/enum_string_mapping.h" +#include "source/opcode.h" +#include "source/operand.h" +#include "source/spirv_constant.h" +#include "source/util/huffman_codec.h" + +using libspirv::SpirvStats; +using spvutils::HuffmanCodec; + +namespace { + +// Signals that the value is not in the coding scheme and a fallback method +// needs to be used. +const uint64_t kMarkvNoneOfTheAbove = + spvtools::MarkvModel::GetMarkvNoneOfTheAbove(); + +inline uint32_t CombineOpcodeAndNumOperands(uint32_t opcode, + uint32_t num_operands) { + return opcode | (num_operands << 16); +} + +// Returns all SPIR-V v1.2 opcodes. +std::vector GetAllOpcodes() { + return std::vector({ + SpvOpNop, + SpvOpUndef, + SpvOpSourceContinued, + SpvOpSource, + SpvOpSourceExtension, + SpvOpName, + SpvOpMemberName, + SpvOpString, + SpvOpLine, + SpvOpExtension, + SpvOpExtInstImport, + SpvOpExtInst, + SpvOpMemoryModel, + SpvOpEntryPoint, + SpvOpExecutionMode, + SpvOpCapability, + SpvOpTypeVoid, + SpvOpTypeBool, + SpvOpTypeInt, + SpvOpTypeFloat, + SpvOpTypeVector, + SpvOpTypeMatrix, + SpvOpTypeImage, + SpvOpTypeSampler, + SpvOpTypeSampledImage, + SpvOpTypeArray, + SpvOpTypeRuntimeArray, + SpvOpTypeStruct, + SpvOpTypeOpaque, + SpvOpTypePointer, + SpvOpTypeFunction, + SpvOpTypeEvent, + SpvOpTypeDeviceEvent, + SpvOpTypeReserveId, + SpvOpTypeQueue, + SpvOpTypePipe, + SpvOpTypeForwardPointer, + SpvOpConstantTrue, + SpvOpConstantFalse, + SpvOpConstant, + SpvOpConstantComposite, + SpvOpConstantSampler, + SpvOpConstantNull, + SpvOpSpecConstantTrue, + SpvOpSpecConstantFalse, + SpvOpSpecConstant, + SpvOpSpecConstantComposite, + SpvOpSpecConstantOp, + SpvOpFunction, + SpvOpFunctionParameter, + SpvOpFunctionEnd, + SpvOpFunctionCall, + SpvOpVariable, + SpvOpImageTexelPointer, + SpvOpLoad, + SpvOpStore, + SpvOpCopyMemory, + SpvOpCopyMemorySized, + SpvOpAccessChain, + SpvOpInBoundsAccessChain, + SpvOpPtrAccessChain, + SpvOpArrayLength, + SpvOpGenericPtrMemSemantics, + SpvOpInBoundsPtrAccessChain, + SpvOpDecorate, + SpvOpMemberDecorate, + SpvOpDecorationGroup, + SpvOpGroupDecorate, + SpvOpGroupMemberDecorate, + SpvOpVectorExtractDynamic, + SpvOpVectorInsertDynamic, + SpvOpVectorShuffle, + SpvOpCompositeConstruct, + SpvOpCompositeExtract, + SpvOpCompositeInsert, + SpvOpCopyObject, + SpvOpTranspose, + SpvOpSampledImage, + SpvOpImageSampleImplicitLod, + SpvOpImageSampleExplicitLod, + SpvOpImageSampleDrefImplicitLod, + SpvOpImageSampleDrefExplicitLod, + SpvOpImageSampleProjImplicitLod, + SpvOpImageSampleProjExplicitLod, + SpvOpImageSampleProjDrefImplicitLod, + SpvOpImageSampleProjDrefExplicitLod, + SpvOpImageFetch, + SpvOpImageGather, + SpvOpImageDrefGather, + SpvOpImageRead, + SpvOpImageWrite, + SpvOpImage, + SpvOpImageQueryFormat, + SpvOpImageQueryOrder, + SpvOpImageQuerySizeLod, + SpvOpImageQuerySize, + SpvOpImageQueryLod, + SpvOpImageQueryLevels, + SpvOpImageQuerySamples, + SpvOpConvertFToU, + SpvOpConvertFToS, + SpvOpConvertSToF, + SpvOpConvertUToF, + SpvOpUConvert, + SpvOpSConvert, + SpvOpFConvert, + SpvOpQuantizeToF16, + SpvOpConvertPtrToU, + SpvOpSatConvertSToU, + SpvOpSatConvertUToS, + SpvOpConvertUToPtr, + SpvOpPtrCastToGeneric, + SpvOpGenericCastToPtr, + SpvOpGenericCastToPtrExplicit, + SpvOpBitcast, + SpvOpSNegate, + SpvOpFNegate, + SpvOpIAdd, + SpvOpFAdd, + SpvOpISub, + SpvOpFSub, + SpvOpIMul, + SpvOpFMul, + SpvOpUDiv, + SpvOpSDiv, + SpvOpFDiv, + SpvOpUMod, + SpvOpSRem, + SpvOpSMod, + SpvOpFRem, + SpvOpFMod, + SpvOpVectorTimesScalar, + SpvOpMatrixTimesScalar, + SpvOpVectorTimesMatrix, + SpvOpMatrixTimesVector, + SpvOpMatrixTimesMatrix, + SpvOpOuterProduct, + SpvOpDot, + SpvOpIAddCarry, + SpvOpISubBorrow, + SpvOpUMulExtended, + SpvOpSMulExtended, + SpvOpAny, + SpvOpAll, + SpvOpIsNan, + SpvOpIsInf, + SpvOpIsFinite, + SpvOpIsNormal, + SpvOpSignBitSet, + SpvOpLessOrGreater, + SpvOpOrdered, + SpvOpUnordered, + SpvOpLogicalEqual, + SpvOpLogicalNotEqual, + SpvOpLogicalOr, + SpvOpLogicalAnd, + SpvOpLogicalNot, + SpvOpSelect, + SpvOpIEqual, + SpvOpINotEqual, + SpvOpUGreaterThan, + SpvOpSGreaterThan, + SpvOpUGreaterThanEqual, + SpvOpSGreaterThanEqual, + SpvOpULessThan, + SpvOpSLessThan, + SpvOpULessThanEqual, + SpvOpSLessThanEqual, + SpvOpFOrdEqual, + SpvOpFUnordEqual, + SpvOpFOrdNotEqual, + SpvOpFUnordNotEqual, + SpvOpFOrdLessThan, + SpvOpFUnordLessThan, + SpvOpFOrdGreaterThan, + SpvOpFUnordGreaterThan, + SpvOpFOrdLessThanEqual, + SpvOpFUnordLessThanEqual, + SpvOpFOrdGreaterThanEqual, + SpvOpFUnordGreaterThanEqual, + SpvOpShiftRightLogical, + SpvOpShiftRightArithmetic, + SpvOpShiftLeftLogical, + SpvOpBitwiseOr, + SpvOpBitwiseXor, + SpvOpBitwiseAnd, + SpvOpNot, + SpvOpBitFieldInsert, + SpvOpBitFieldSExtract, + SpvOpBitFieldUExtract, + SpvOpBitReverse, + SpvOpBitCount, + SpvOpDPdx, + SpvOpDPdy, + SpvOpFwidth, + SpvOpDPdxFine, + SpvOpDPdyFine, + SpvOpFwidthFine, + SpvOpDPdxCoarse, + SpvOpDPdyCoarse, + SpvOpFwidthCoarse, + SpvOpEmitVertex, + SpvOpEndPrimitive, + SpvOpEmitStreamVertex, + SpvOpEndStreamPrimitive, + SpvOpControlBarrier, + SpvOpMemoryBarrier, + SpvOpAtomicLoad, + SpvOpAtomicStore, + SpvOpAtomicExchange, + SpvOpAtomicCompareExchange, + SpvOpAtomicCompareExchangeWeak, + SpvOpAtomicIIncrement, + SpvOpAtomicIDecrement, + SpvOpAtomicIAdd, + SpvOpAtomicISub, + SpvOpAtomicSMin, + SpvOpAtomicUMin, + SpvOpAtomicSMax, + SpvOpAtomicUMax, + SpvOpAtomicAnd, + SpvOpAtomicOr, + SpvOpAtomicXor, + SpvOpPhi, + SpvOpLoopMerge, + SpvOpSelectionMerge, + SpvOpLabel, + SpvOpBranch, + SpvOpBranchConditional, + SpvOpSwitch, + SpvOpKill, + SpvOpReturn, + SpvOpReturnValue, + SpvOpUnreachable, + SpvOpLifetimeStart, + SpvOpLifetimeStop, + SpvOpGroupAsyncCopy, + SpvOpGroupWaitEvents, + SpvOpGroupAll, + SpvOpGroupAny, + SpvOpGroupBroadcast, + SpvOpGroupIAdd, + SpvOpGroupFAdd, + SpvOpGroupFMin, + SpvOpGroupUMin, + SpvOpGroupSMin, + SpvOpGroupFMax, + SpvOpGroupUMax, + SpvOpGroupSMax, + SpvOpReadPipe, + SpvOpWritePipe, + SpvOpReservedReadPipe, + SpvOpReservedWritePipe, + SpvOpReserveReadPipePackets, + SpvOpReserveWritePipePackets, + SpvOpCommitReadPipe, + SpvOpCommitWritePipe, + SpvOpIsValidReserveId, + SpvOpGetNumPipePackets, + SpvOpGetMaxPipePackets, + SpvOpGroupReserveReadPipePackets, + SpvOpGroupReserveWritePipePackets, + SpvOpGroupCommitReadPipe, + SpvOpGroupCommitWritePipe, + SpvOpEnqueueMarker, + SpvOpEnqueueKernel, + SpvOpGetKernelNDrangeSubGroupCount, + SpvOpGetKernelNDrangeMaxSubGroupSize, + SpvOpGetKernelWorkGroupSize, + SpvOpGetKernelPreferredWorkGroupSizeMultiple, + SpvOpRetainEvent, + SpvOpReleaseEvent, + SpvOpCreateUserEvent, + SpvOpIsValidEvent, + SpvOpSetUserEventStatus, + SpvOpCaptureEventProfilingInfo, + SpvOpGetDefaultQueue, + SpvOpBuildNDRange, + SpvOpImageSparseSampleImplicitLod, + SpvOpImageSparseSampleExplicitLod, + SpvOpImageSparseSampleDrefImplicitLod, + SpvOpImageSparseSampleDrefExplicitLod, + SpvOpImageSparseSampleProjImplicitLod, + SpvOpImageSparseSampleProjExplicitLod, + SpvOpImageSparseSampleProjDrefImplicitLod, + SpvOpImageSparseSampleProjDrefExplicitLod, + SpvOpImageSparseFetch, + SpvOpImageSparseGather, + SpvOpImageSparseDrefGather, + SpvOpImageSparseTexelsResident, + SpvOpNoLine, + SpvOpAtomicFlagTestAndSet, + SpvOpAtomicFlagClear, + SpvOpImageSparseRead, + SpvOpSizeOf, + SpvOpTypePipeStorage, + SpvOpConstantPipeStorage, + SpvOpCreatePipeFromPipeStorage, + SpvOpGetKernelLocalSizeForSubgroupCount, + SpvOpGetKernelMaxNumSubgroups, + SpvOpTypeNamedBarrier, + SpvOpNamedBarrierInitialize, + SpvOpMemoryNamedBarrier, + SpvOpModuleProcessed, + SpvOpExecutionModeId, + SpvOpDecorateId, + SpvOpSubgroupBallotKHR, + SpvOpSubgroupFirstInvocationKHR, + SpvOpSubgroupAllKHR, + SpvOpSubgroupAnyKHR, + SpvOpSubgroupAllEqualKHR, + SpvOpSubgroupReadInvocationKHR, + }); +} + +std::string GetVersionString(uint32_t word) { + std::stringstream ss; + ss << "Version " << SPV_SPIRV_VERSION_MAJOR_PART(word) << "." + << SPV_SPIRV_VERSION_MINOR_PART(word); + return ss.str(); +} + +std::string GetGeneratorString(uint32_t word) { + return spvGeneratorStr(SPV_GENERATOR_TOOL_PART(word)); +} + +std::string GetOpcodeString(uint32_t word) { + return spvOpcodeString(static_cast(word)); +} + +std::string GetCapabilityString(uint32_t word) { + return libspirv::CapabilityToString(static_cast(word)); +} + +template +std::string KeyIsLabel(T key) { + std::stringstream ss; + ss << key; + return ss.str(); +} + +template +std::unordered_map GetRecall( + const std::unordered_map& hist, uint64_t total) { + std::unordered_map freq; + for (const auto& pair : hist) { + const double frequency = + static_cast(pair.second) / static_cast(total); + freq.emplace(pair.first, frequency); + } + return freq; +} + +template +std::unordered_map GetPrevalence( + const std::unordered_map& hist) { + uint64_t total = 0; + for (const auto& pair : hist) { + total += pair.second; + } + + return GetRecall(hist, total); +} + +// Writes |freq| to |out| sorted by frequency in the following format: +// LABEL3 70% +// LABEL1 20% +// LABEL2 10% +// |label_from_key| is used to convert |Key| to label. +template +void WriteFreq(std::ostream& out, const std::unordered_map& freq, + std::string (*label_from_key)(Key), double threshold = 0.001) { + std::vector> sorted_freq(freq.begin(), freq.end()); + std::sort(sorted_freq.begin(), sorted_freq.end(), + [](const std::pair& left, + const std::pair& right) { + return left.second > right.second; + }); + + for (const auto& pair : sorted_freq) { + if (pair.second < threshold) break; + out << label_from_key(pair.first) << " " << pair.second * 100.0 << "%" + << std::endl; + } +} + +// Writes |hist| to |out| sorted by count in the following format: +// LABEL3 100 +// LABEL1 50 +// LABEL2 10 +// |label_from_key| is used to convert |Key| to label. +template +void WriteHist(std::ostream& out, const std::unordered_map& hist, + std::string (*label_from_key)(Key)) { + std::vector> sorted_hist(hist.begin(), hist.end()); + std::sort(sorted_hist.begin(), sorted_hist.end(), + [](const std::pair& left, + const std::pair& right) { + return left.second > right.second; + }); + + for (const auto& pair : sorted_hist) { + out << label_from_key(pair.first) << " " << pair.second << std::endl; + } +} + +} // namespace + +StatsAnalyzer::StatsAnalyzer(const SpirvStats& stats) : stats_(stats) { + num_modules_ = 0; + for (const auto& pair : stats_.version_hist) { + num_modules_ += pair.second; + } + + version_freq_ = GetRecall(stats_.version_hist, num_modules_); + generator_freq_ = GetRecall(stats_.generator_hist, num_modules_); + capability_freq_ = GetRecall(stats_.capability_hist, num_modules_); + extension_freq_ = GetRecall(stats_.extension_hist, num_modules_); + opcode_freq_ = GetPrevalence(stats_.opcode_hist); +} + +void StatsAnalyzer::WriteVersion(std::ostream& out) { + WriteFreq(out, version_freq_, GetVersionString); +} + +void StatsAnalyzer::WriteGenerator(std::ostream& out) { + WriteFreq(out, generator_freq_, GetGeneratorString); +} + +void StatsAnalyzer::WriteCapability(std::ostream& out) { + WriteFreq(out, capability_freq_, GetCapabilityString); +} + +void StatsAnalyzer::WriteExtension(std::ostream& out) { + WriteFreq(out, extension_freq_, KeyIsLabel); +} + +void StatsAnalyzer::WriteOpcode(std::ostream& out) { + out << "Total unique opcodes used: " << opcode_freq_.size() << std::endl; + WriteFreq(out, opcode_freq_, GetOpcodeString); +} + +void StatsAnalyzer::WriteConstantLiterals(std::ostream& out) { + out << "Constant literals" << std::endl; + + out << "Float 32" << std::endl; + WriteFreq(out, GetPrevalence(stats_.f32_constant_hist), KeyIsLabel); + + out << std::endl << "Float 64" << std::endl; + WriteFreq(out, GetPrevalence(stats_.f64_constant_hist), KeyIsLabel); + + out << std::endl << "Unsigned int 16" << std::endl; + WriteFreq(out, GetPrevalence(stats_.u16_constant_hist), KeyIsLabel); + + out << std::endl << "Signed int 16" << std::endl; + WriteFreq(out, GetPrevalence(stats_.s16_constant_hist), KeyIsLabel); + + out << std::endl << "Unsigned int 32" << std::endl; + WriteFreq(out, GetPrevalence(stats_.u32_constant_hist), KeyIsLabel); + + out << std::endl << "Signed int 32" << std::endl; + WriteFreq(out, GetPrevalence(stats_.s32_constant_hist), KeyIsLabel); + + out << std::endl << "Unsigned int 64" << std::endl; + WriteFreq(out, GetPrevalence(stats_.u64_constant_hist), KeyIsLabel); + + out << std::endl << "Signed int 64" << std::endl; + WriteFreq(out, GetPrevalence(stats_.s64_constant_hist), KeyIsLabel); +} + +void StatsAnalyzer::WriteOpcodeMarkov(std::ostream& out) { + if (stats_.opcode_markov_hist.empty()) return; + + const std::unordered_map>& + cue_to_hist = stats_.opcode_markov_hist[0]; + + // Sort by prevalence of the opcodes in opcode_freq_ (descending). + std::vector>> + sorted_cue_to_hist(cue_to_hist.begin(), cue_to_hist.end()); + std::sort( + sorted_cue_to_hist.begin(), sorted_cue_to_hist.end(), + [this](const std::pair>& + left, + const std::pair>& + right) { + const double lf = opcode_freq_[left.first]; + const double rf = opcode_freq_[right.first]; + if (lf == rf) return right.first > left.first; + return lf > rf; + }); + + for (const auto& kv : sorted_cue_to_hist) { + const uint32_t cue = kv.first; + const double kFrequentEnoughToAnalyze = 0.0001; + if (opcode_freq_[cue] < kFrequentEnoughToAnalyze) continue; + + const std::unordered_map& hist = kv.second; + + uint32_t total = 0; + for (const auto& pair : hist) { + total += pair.second; + } + + std::vector> sorted_hist(hist.begin(), + hist.end()); + std::sort(sorted_hist.begin(), sorted_hist.end(), + [](const std::pair& left, + const std::pair& right) { + if (left.second == right.second) + return right.first > left.first; + return left.second > right.second; + }); + + for (const auto& pair : sorted_hist) { + const double prior = opcode_freq_[pair.first]; + const double posterior = + static_cast(pair.second) / static_cast(total); + out << GetOpcodeString(cue) << " -> " << GetOpcodeString(pair.first) + << " " << posterior * 100 << "% (base rate " << prior * 100 + << "%, pair occurrences " << pair.second << ")" << std::endl; + } + } +} + +void StatsAnalyzer::WriteCodegenOpcodeHist(std::ostream& out) { + auto all_opcodes = GetAllOpcodes(); + + // uint64_t is used because kMarkvNoneOfTheAbove is outside of uint32_t range. + out << "std::map GetOpcodeHist() {\n" + << " return std::map({\n"; + + uint32_t total = 0; + for (const auto& kv : stats_.opcode_hist) { + total += kv.second; + } + + for (uint32_t opcode : all_opcodes) { + const auto it = stats_.opcode_hist.find(opcode); + const uint32_t count = it == stats_.opcode_hist.end() ? 0 : it->second; + const double kMaxValue = 1000.0; + uint32_t value = uint32_t(kMaxValue * double(count) / double(total)); + if (value == 0) value = 1; + out << " { SpvOp" << GetOpcodeString(opcode) << ", " << value << " },\n"; + } + + // Add kMarkvNoneOfTheAbove as a signal for unknown opcode. + out << " { kMarkvNoneOfTheAbove, " << 10 << " },\n"; + out << " });\n}\n"; +} + +void StatsAnalyzer::WriteCodegenOpcodeAndNumOperandsHist(std::ostream& out) { + out << "std::map GetOpcodeAndNumOperandsHist() {\n" + << " return std::map({\n"; + + uint32_t total = 0; + for (const auto& kv : stats_.opcode_and_num_operands_hist) { + total += kv.second; + } + + uint32_t left_out = 0; + + for (const auto& kv : stats_.opcode_and_num_operands_hist) { + const uint32_t count = kv.second; + const double kFrequentEnoughToAnalyze = 0.001; + const uint32_t opcode_and_num_operands = kv.first; + const uint32_t opcode = opcode_and_num_operands & 0xFFFF; + const uint32_t num_operands = opcode_and_num_operands >> 16; + + if (opcode == SpvOpTypeStruct || + double(count) / double(total) < kFrequentEnoughToAnalyze) { + left_out += count; + continue; + } + + out << " { CombineOpcodeAndNumOperands(SpvOp" + << spvOpcodeString(SpvOp(opcode)) << ", " << num_operands << "), " + << count << " },\n"; + } + + // Heuristic. + const uint32_t none_of_the_above = std::max(1, int(left_out + total * 0.01)); + out << " { kMarkvNoneOfTheAbove, " << none_of_the_above << " },\n"; + out << " });\n}\n"; +} + +void StatsAnalyzer::WriteCodegenOpcodeAndNumOperandsMarkovHuffmanCodecs( + std::ostream& out) { + out << "std::map>>\n" + << "GetOpcodeAndNumOperandsMarkovHuffmanCodecs() {\n" + << " std::map>> " + << "codecs;\n"; + + for (const auto& kv : stats_.opcode_and_num_operands_markov_hist) { + const uint32_t prev_opcode = kv.first; + const double kFrequentEnoughToAnalyze = 0.001; + if (opcode_freq_[prev_opcode] < kFrequentEnoughToAnalyze) continue; + + const std::unordered_map& hist = kv.second; + + uint32_t total = 0; + for (const auto& pair : hist) { + total += pair.second; + } + + uint32_t left_out = 0; + + std::map processed_hist; + for (const auto& pair : hist) { + const uint32_t opcode_and_num_operands = pair.first; + const uint32_t opcode = opcode_and_num_operands & 0xFFFF; + + if (opcode == SpvOpTypeStruct) continue; + + const uint32_t num_operands = opcode_and_num_operands >> 16; + const uint32_t count = pair.second; + const double posterior_freq = double(count) / double(total); + + if (opcode_freq_[opcode] < kFrequentEnoughToAnalyze && + posterior_freq < kFrequentEnoughToAnalyze) { + left_out += count; + continue; + } + processed_hist.emplace(CombineOpcodeAndNumOperands(opcode, num_operands), + count); + } + + // Heuristic. + processed_hist.emplace(kMarkvNoneOfTheAbove, + std::max(1, int(left_out + total * 0.01))); + + HuffmanCodec codec(processed_hist); + + out << " {\n"; + out << " std::unique_ptr> " + << "codec(new HuffmanCodec"; + out << codec.SerializeToText(4); + out << ");\n" << std::endl; + out << " codecs.emplace(SpvOp" << GetOpcodeString(prev_opcode) + << ", std::move(codec));\n"; + out << " }\n\n"; + } + + out << " return codecs;\n}\n"; +} + +void StatsAnalyzer::WriteCodegenLiteralStringHuffmanCodecs(std::ostream& out) { + out << "std::map>>\n" + << "GetLiteralStringHuffmanCodecs() {\n" + << " std::map>> " + << "codecs;\n"; + + for (const auto& kv : stats_.literal_strings_hist) { + const uint32_t opcode = kv.first; + + if (opcode == SpvOpName || opcode == SpvOpMemberName) continue; + + const double kOpcodeFrequentEnoughToAnalyze = 0.001; + if (opcode_freq_[opcode] < kOpcodeFrequentEnoughToAnalyze) continue; + + const std::unordered_map& hist = kv.second; + + uint32_t total = 0; + for (const auto& pair : hist) { + total += pair.second; + } + + uint32_t left_out = 0; + + std::map processed_hist; + for (const auto& pair : hist) { + const uint32_t count = pair.second; + const double freq = double(count) / double(total); + const double kStringFrequentEnoughToAnalyze = 0.001; + if (freq < kStringFrequentEnoughToAnalyze) { + left_out += count; + continue; + } + processed_hist.emplace(pair.first, count); + } + + // Heuristic. + processed_hist.emplace("kMarkvNoneOfTheAbove", + std::max(1, int(left_out + total * 0.01))); + + HuffmanCodec codec(processed_hist); + + out << " {\n"; + out << " std::unique_ptr> " + << "codec(new HuffmanCodec"; + out << codec.SerializeToText(4); + out << ");\n" << std::endl; + out << " codecs.emplace(SpvOp" << spvOpcodeString(SpvOp(opcode)) + << ", std::move(codec));\n"; + out << " }\n\n"; + } + + out << " return codecs;\n}\n"; +} + +void StatsAnalyzer::WriteCodegenNonIdWordHuffmanCodecs(std::ostream& out) { + out << "std::map, " + << "std::unique_ptr>>\n" + << "GetNonIdWordHuffmanCodecs() {\n" + << " std::map, " + << "std::unique_ptr>> codecs;\n"; + + for (const auto& kv : stats_.operand_slot_non_id_words_hist) { + const auto& opcode_and_index = kv.first; + const uint32_t opcode = opcode_and_index.first; + const uint32_t index = opcode_and_index.second; + + const double kOpcodeFrequentEnoughToAnalyze = 0.001; + if (opcode_freq_[opcode] < kOpcodeFrequentEnoughToAnalyze) continue; + + const std::map& hist = kv.second; + + uint32_t total = 0; + for (const auto& pair : hist) { + total += pair.second; + } + + uint32_t left_out = 0; + + std::map processed_hist; + for (const auto& pair : hist) { + const uint32_t word = pair.first; + const uint32_t count = pair.second; + const double freq = double(count) / double(total); + const double kWordFrequentEnoughToAnalyze = 0.003; + if (freq < kWordFrequentEnoughToAnalyze) { + left_out += count; + continue; + } + processed_hist.emplace(word, count); + } + + // Heuristic. + processed_hist.emplace(kMarkvNoneOfTheAbove, + std::max(1, int(left_out + total * 0.01))); + + HuffmanCodec codec(processed_hist); + + out << " {\n"; + out << " std::unique_ptr> " + << "codec(new HuffmanCodec"; + out << codec.SerializeToText(4); + out << ");\n" << std::endl; + out << " codecs.emplace(std::pair(SpvOp" + << spvOpcodeString(SpvOp(opcode)) << ", " << index + << "), std::move(codec));\n"; + out << " }\n\n"; + } + + out << " return codecs;\n}\n"; +} + +void StatsAnalyzer::WriteCodegenIdDescriptorHuffmanCodecs(std::ostream& out) { + out << "std::map, " + << "std::unique_ptr>>\n" + << "GetIdDescriptorHuffmanCodecs() {\n" + << " std::map, " + << "std::unique_ptr>> codecs;\n"; + + std::unordered_set descriptors_with_coding_scheme; + + for (const auto& kv : stats_.operand_slot_id_descriptor_hist) { + const auto& opcode_and_index = kv.first; + const uint32_t opcode = opcode_and_index.first; + const uint32_t index = opcode_and_index.second; + + const double kOpcodeFrequentEnoughToAnalyze = 0.003; + if (opcode_freq_[opcode] < kOpcodeFrequentEnoughToAnalyze) continue; + + const std::map& hist = kv.second; + + uint32_t total = 0; + for (const auto& pair : hist) { + total += pair.second; + } + + uint32_t left_out = 0; + + std::map processed_hist; + for (const auto& pair : hist) { + const uint32_t descriptor = pair.first; + const uint32_t count = pair.second; + const double freq = double(count) / double(total); + const double kDescriptorFrequentEnoughToAnalyze = 0.003; + if (freq < kDescriptorFrequentEnoughToAnalyze) { + left_out += count; + continue; + } + processed_hist.emplace(descriptor, count); + descriptors_with_coding_scheme.insert(descriptor); + } + + // Heuristic. + processed_hist.emplace(kMarkvNoneOfTheAbove, + std::max(1, int(left_out + total * 0.01))); + + HuffmanCodec codec(processed_hist); + + out << " {\n"; + out << " std::unique_ptr> " + << "codec(new HuffmanCodec"; + out << codec.SerializeToText(4); + out << ");\n" << std::endl; + out << " codecs.emplace(std::pair(SpvOp" + << spvOpcodeString(SpvOp(opcode)) << ", " << index + << "), std::move(codec));\n"; + out << " }\n\n"; + } + + out << " return codecs;\n}\n"; + + out << "\nstd::unordered_set GetDescriptorsWithCodingScheme() {\n" + << " std::unordered_set descriptors_with_coding_scheme = {\n"; + for (uint32_t descriptor : descriptors_with_coding_scheme) { + out << " " << descriptor << ",\n"; + } + out << " };\n"; + out << " return descriptors_with_coding_scheme;\n}\n"; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/stats/stats_analyzer.h vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/stats/stats_analyzer.h --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/stats/stats_analyzer.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/stats/stats_analyzer.h 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,80 @@ +// Copyright (c) 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_TOOLS_STATS_STATS_ANALYZER_H_ +#define LIBSPIRV_TOOLS_STATS_STATS_ANALYZER_H_ + +#include + +#include "source/spirv_stats.h" + +class StatsAnalyzer { + public: + explicit StatsAnalyzer(const libspirv::SpirvStats& stats); + + // Writes respective histograms to |out|. + void WriteVersion(std::ostream& out); + void WriteGenerator(std::ostream& out); + void WriteCapability(std::ostream& out); + void WriteExtension(std::ostream& out); + void WriteOpcode(std::ostream& out); + void WriteConstantLiterals(std::ostream& out); + + // Writes first order Markov analysis to |out|. + // stats_.opcode_markov_hist needs to contain raw data for at least one + // level. + void WriteOpcodeMarkov(std::ostream& out); + + // Writes C++ code containing a function returning opcode histogram. + void WriteCodegenOpcodeHist(std::ostream& out); + + // Writes C++ code containing a function returning opcode_and_num_operands + // histogram. + void WriteCodegenOpcodeAndNumOperandsHist(std::ostream& out); + + // Writes C++ code containing a function returning a map of Huffman codecs + // for opcode_and_num_operands. Each Huffman codec is created for a specific + // previous opcode. + // TODO(atgoo@github.com) Write code which would contain pregenerated Huffman + // codecs, instead of code which would generate them every time. + void WriteCodegenOpcodeAndNumOperandsMarkovHuffmanCodecs(std::ostream& out); + + // Writes C++ code containing a function returning a map of Huffman codecs + // for literal strings. Each Huffman codec is created for a specific opcode. + // I.e. OpExtension and OpExtInstImport would use different codecs. + void WriteCodegenLiteralStringHuffmanCodecs(std::ostream& out); + + // Writes C++ code containing a function returning a map of Huffman codecs + // for single-word non-id operands. Each Huffman codec is created for a + // specific operand slot (opcode and operand number). + void WriteCodegenNonIdWordHuffmanCodecs(std::ostream& out); + + // Writes C++ code containing a function returning a map of Huffman codecs + // for common id descriptors. Each Huffman codec is created for a + // specific operand slot (opcode and operand number). + void WriteCodegenIdDescriptorHuffmanCodecs(std::ostream& out); + + private: + const libspirv::SpirvStats& stats_; + + uint32_t num_modules_; + + std::unordered_map version_freq_; + std::unordered_map generator_freq_; + std::unordered_map capability_freq_; + std::unordered_map extension_freq_; + std::unordered_map opcode_freq_; +}; + +#endif // LIBSPIRV_TOOLS_STATS_STATS_ANALYZER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/stats/stats.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/stats/stats.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/stats/stats.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/stats/stats.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,273 @@ +// Copyright (c) 2017 Google 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. + +#include +#include +#include +#include +#include + +#include "source/spirv_stats.h" +#include "source/table.h" +#include "spirv-tools/libspirv.h" +#include "stats_analyzer.h" +#include "tools/io.h" + +using libspirv::SpirvStats; + +namespace { + +struct ScopedContext { + ScopedContext(spv_target_env env) : context(spvContextCreate(env)) {} + ~ScopedContext() { spvContextDestroy(context); } + spv_context context; +}; + +void PrintUsage(char* argv0) { + printf( + R"(%s - Collect statistics from one or more SPIR-V binary file(s). + +USAGE: %s [options] [] + +TIP: In order to collect statistics from all .spv files under current dir use +find . -name "*.spv" -print0 | xargs -0 -s 2000000 %s + +Options: + -h, --help + Print this help. + + -v, --verbose + Print additional info to stderr. + + --codegen_opcode_hist + Output generated C++ code for opcode histogram. + This flag disables non-C++ output. + + --codegen_opcode_and_num_operands_hist + Output generated C++ code for opcode_and_num_operands + histogram. + This flag disables non-C++ output. + + --codegen_opcode_and_num_operands_markov_huffman_codecs + Output generated C++ code for Huffman codecs of + opcode_and_num_operands Markov chain. + This flag disables non-C++ output. + + --codegen_literal_string_huffman_codecs + Output generated C++ code for Huffman codecs for + literal strings. + This flag disables non-C++ output. + + --codegen_non_id_word_huffman_codecs + Output generated C++ code for Huffman codecs for + single-word non-id slots. + This flag disables non-C++ output. + + --codegen_id_descriptor_huffman_codecs + Output generated C++ code for Huffman codecs for + common id descriptors. + This flag disables non-C++ output. +)", + argv0, argv0, argv0); +} + +void DiagnosticsMessageHandler(spv_message_level_t level, const char*, + const spv_position_t& position, + const char* message) { + switch (level) { + case SPV_MSG_FATAL: + case SPV_MSG_INTERNAL_ERROR: + case SPV_MSG_ERROR: + std::cerr << "error: " << position.index << ": " << message << std::endl; + break; + case SPV_MSG_WARNING: + std::cout << "warning: " << position.index << ": " << message + << std::endl; + break; + case SPV_MSG_INFO: + std::cout << "info: " << position.index << ": " << message << std::endl; + break; + default: + break; + } +} + +} // namespace + +int main(int argc, char** argv) { + bool continue_processing = true; + int return_code = 0; + + bool expect_output_path = false; + bool verbose = false; + bool export_text = true; + bool codegen_opcode_hist = false; + bool codegen_opcode_and_num_operands_hist = false; + bool codegen_opcode_and_num_operands_markov_huffman_codecs = false; + bool codegen_literal_string_huffman_codecs = false; + bool codegen_non_id_word_huffman_codecs = false; + bool codegen_id_descriptor_huffman_codecs = false; + + std::vector paths; + const char* output_path = nullptr; + + for (int argi = 1; continue_processing && argi < argc; ++argi) { + const char* cur_arg = argv[argi]; + if ('-' == cur_arg[0]) { + if (0 == strcmp(cur_arg, "--help") || 0 == strcmp(cur_arg, "-h")) { + PrintUsage(argv[0]); + continue_processing = false; + return_code = 0; + } else if (0 == strcmp(cur_arg, "--codegen_opcode_hist")) { + codegen_opcode_hist = true; + export_text = false; + } else if (0 == + strcmp(cur_arg, "--codegen_opcode_and_num_operands_hist")) { + codegen_opcode_and_num_operands_hist = true; + export_text = false; + } else if (strcmp( + "--codegen_opcode_and_num_operands_markov_huffman_codecs", + cur_arg) == 0) { + codegen_opcode_and_num_operands_markov_huffman_codecs = true; + export_text = false; + } else if (0 == + strcmp(cur_arg, "--codegen_literal_string_huffman_codecs")) { + codegen_literal_string_huffman_codecs = true; + export_text = false; + } else if (0 == strcmp(cur_arg, "--codegen_non_id_word_huffman_codecs")) { + codegen_non_id_word_huffman_codecs = true; + export_text = false; + } else if (0 == + strcmp(cur_arg, "--codegen_id_descriptor_huffman_codecs")) { + codegen_id_descriptor_huffman_codecs = true; + export_text = false; + } else if (0 == strcmp(cur_arg, "--verbose") || + 0 == strcmp(cur_arg, "-v")) { + verbose = true; + } else if (0 == strcmp(cur_arg, "--output") || + 0 == strcmp(cur_arg, "-o")) { + expect_output_path = true; + } else { + PrintUsage(argv[0]); + continue_processing = false; + return_code = 1; + } + } else { + if (expect_output_path) { + output_path = cur_arg; + expect_output_path = false; + } else { + paths.push_back(cur_arg); + } + } + } + + // Exit if command line parsing was not successful. + if (!continue_processing) { + return return_code; + } + + std::cerr << "Processing " << paths.size() << " files..." << std::endl; + + ScopedContext ctx(SPV_ENV_UNIVERSAL_1_1); + libspirv::SetContextMessageConsumer(ctx.context, DiagnosticsMessageHandler); + + libspirv::SpirvStats stats; + stats.opcode_markov_hist.resize(1); + + for (size_t index = 0; index < paths.size(); ++index) { + const size_t kMilestonePeriod = 1000; + if (verbose) { + if (index % kMilestonePeriod == kMilestonePeriod - 1) + std::cerr << "Processed " << index + 1 << " files..." << std::endl; + } + + const char* path = paths[index]; + std::vector contents; + if (!ReadFile(path, "rb", &contents)) return 1; + + if (SPV_SUCCESS != libspirv::AggregateStats(*ctx.context, contents.data(), + contents.size(), nullptr, + &stats)) { + std::cerr << "error: Failed to aggregate stats for " << path << std::endl; + return 1; + } + } + + StatsAnalyzer analyzer(stats); + + std::ofstream fout; + if (output_path) { + fout.open(output_path); + if (!fout.is_open()) { + std::cerr << "error: Failed to open " << output_path << std::endl; + return 1; + } + } + + std::ostream& out = fout.is_open() ? fout : std::cout; + + if (export_text) { + out << std::endl; + analyzer.WriteVersion(out); + analyzer.WriteGenerator(out); + + out << std::endl; + analyzer.WriteCapability(out); + + out << std::endl; + analyzer.WriteExtension(out); + + out << std::endl; + analyzer.WriteOpcode(out); + + out << std::endl; + analyzer.WriteOpcodeMarkov(out); + + out << std::endl; + analyzer.WriteConstantLiterals(out); + } + + if (codegen_opcode_hist) { + out << std::endl; + analyzer.WriteCodegenOpcodeHist(out); + } + + if (codegen_opcode_and_num_operands_hist) { + out << std::endl; + analyzer.WriteCodegenOpcodeAndNumOperandsHist(out); + } + + if (codegen_opcode_and_num_operands_markov_huffman_codecs) { + out << std::endl; + analyzer.WriteCodegenOpcodeAndNumOperandsMarkovHuffmanCodecs(out); + } + + if (codegen_literal_string_huffman_codecs) { + out << std::endl; + analyzer.WriteCodegenLiteralStringHuffmanCodecs(out); + } + + if (codegen_non_id_word_huffman_codecs) { + out << std::endl; + analyzer.WriteCodegenNonIdWordHuffmanCodecs(out); + } + + if (codegen_id_descriptor_huffman_codecs) { + out << std::endl; + analyzer.WriteCodegenIdDescriptorHuffmanCodecs(out); + } + + return 0; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/val/val.cpp vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/val/val.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/tools/val/val.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/tools/val/val.cpp 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,183 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include +#include +#include + +#include "source/spirv_target_env.h" +#include "source/spirv_validator_options.h" +#include "spirv-tools/libspirv.hpp" +#include "tools/io.h" + +void print_usage(char* argv0) { + printf( + R"(%s - Validate a SPIR-V binary file. + +USAGE: %s [options] [] + +The SPIR-V binary is read from . If no file is specified, +or if the filename is "-", then the binary is read from standard input. + +NOTE: The validator is a work in progress. + +Options: + -h, --help Print this help. + --max-struct-members + --max-struct-depth + --max-local-variables + --max-global-variables + --max-switch-branches + --max-function-args + --max-control-flow-nesting-depth + --max-access-chain-indexes + --relax-logcial-pointer Allow allocating an object of a pointer type and returning + a pointer value from a function in logical addressing mode + --relax-struct-store Allow store from one struct type to a + different type with compatible layout and + members. + --version Display validator version information. + --target-env {vulkan1.0|spv1.0|spv1.1|spv1.2} + Use Vulkan1.0/SPIR-V1.0/SPIR-V1.1/SPIR-V1.2 validation rules. +)", + argv0, argv0); +} + +int main(int argc, char** argv) { + const char* inFile = nullptr; + spv_target_env target_env = SPV_ENV_UNIVERSAL_1_3; + spvtools::ValidatorOptions options; + bool continue_processing = true; + int return_code = 0; + + for (int argi = 1; continue_processing && argi < argc; ++argi) { + const char* cur_arg = argv[argi]; + if ('-' == cur_arg[0]) { + if (0 == strncmp(cur_arg, "--max-", 6)) { + if (argi + 1 < argc) { + spv_validator_limit limit_type; + if (spvParseUniversalLimitsOptions(cur_arg, &limit_type)) { + uint32_t limit = 0; + if (sscanf(argv[++argi], "%u", &limit)) { + options.SetUniversalLimit(limit_type, limit); + } else { + fprintf(stderr, "error: missing argument to %s\n", cur_arg); + continue_processing = false; + return_code = 1; + } + } else { + fprintf(stderr, "error: unrecognized option: %s\n", cur_arg); + continue_processing = false; + return_code = 1; + } + } else { + fprintf(stderr, "error: Missing argument to %s\n", cur_arg); + continue_processing = false; + return_code = 1; + } + } else if (0 == strcmp(cur_arg, "--version")) { + printf("%s\n", spvSoftwareVersionDetailsString()); + printf("Targets:\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n", + spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_0), + spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_1), + spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_2), + spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_3), + spvTargetEnvDescription(SPV_ENV_OPENCL_2_2), + spvTargetEnvDescription(SPV_ENV_VULKAN_1_0), + spvTargetEnvDescription(SPV_ENV_VULKAN_1_1)); + continue_processing = false; + return_code = 0; + } else if (0 == strcmp(cur_arg, "--help") || 0 == strcmp(cur_arg, "-h")) { + print_usage(argv[0]); + continue_processing = false; + return_code = 0; + } else if (0 == strcmp(cur_arg, "--target-env")) { + if (argi + 1 < argc) { + const auto env_str = argv[++argi]; + if (!spvParseTargetEnv(env_str, &target_env)) { + fprintf(stderr, "error: Unrecognized target env: %s\n", env_str); + continue_processing = false; + return_code = 1; + } + } else { + fprintf(stderr, "error: Missing argument to --target-env\n"); + continue_processing = false; + return_code = 1; + } + } else if (0 == strcmp(cur_arg, "--relax-logical-pointer")) { + options.SetRelaxLogicalPointer(true); + } else if (0 == strcmp(cur_arg, "--relax-struct-store")) { + options.SetRelaxStructStore(true); + } else if (0 == cur_arg[1]) { + // Setting a filename of "-" to indicate stdin. + if (!inFile) { + inFile = cur_arg; + } else { + fprintf(stderr, "error: More than one input file specified\n"); + continue_processing = false; + return_code = 1; + } + } else { + print_usage(argv[0]); + continue_processing = false; + return_code = 1; + } + } else { + if (!inFile) { + inFile = cur_arg; + } else { + fprintf(stderr, "error: More than one input file specified\n"); + continue_processing = false; + return_code = 1; + } + } + } + + // Exit if command line parsing was not successful. + if (!continue_processing) { + return return_code; + } + + std::vector contents; + if (!ReadFile(inFile, "rb", &contents)) return 1; + + spvtools::SpirvTools tools(target_env); + tools.SetMessageConsumer([](spv_message_level_t level, const char*, + const spv_position_t& position, + const char* message) { + switch (level) { + case SPV_MSG_FATAL: + case SPV_MSG_INTERNAL_ERROR: + case SPV_MSG_ERROR: + std::cerr << "error: " << position.index << ": " << message + << std::endl; + break; + case SPV_MSG_WARNING: + std::cout << "warning: " << position.index << ": " << message + << std::endl; + break; + case SPV_MSG_INFO: + std::cout << "info: " << position.index << ": " << message << std::endl; + break; + default: + break; + } + }); + + bool succeed = tools.Validate(contents.data(), contents.size(), options); + + return !succeed; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/.travis.yml vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/.travis.yml --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/.travis.yml 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/.travis.yml 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,133 @@ +# Linux Build Configuration for Travis + +language: cpp + +os: + - linux + - osx + +# Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment. +dist: trusty +sudo: false + +env: + global: + - secure: IoR/Xe9E+NnLAeI23WrmUsGQn5rocz+XRYUk+BbaoKiIRYm4q72GKyypRoOGLu7wImOXFSvnN/dpdnqIpx4W0NfsSvNdlXyhDy+wvT1kzTt77dJGnkGZTZ2SBOtC9AECLy4sqM9HG0rYRR6WfXcnP2GlrE5f2aF07aISQbOUsQMvyyhtCmVAzIigK1zIUto5I0pNenvo/Y+ur+mEvTh+FtaoDIGepCbZlCc+OxqRXwXNlI7mDXbzLPmTB1FWTGsrZdRX8czF9tN9Y+T79DQjB4Lcyyeow8yU9NBVlgzZJcp1xI0UIskRT8gVrXmBYL2dMeHnDQuhxjEg9n7jfr3ptA9rgwMaSsgdaLwuBXgtPuqVgUYDpE1cP8WI8q38MXX0I6psTs/WHu+z+5UwfjzpPOHmGdVt48o8ymFTapvD5Cf1+uJyk73QkyStnPIdBF1N9Yx5sD7HN28K6/Ro12sCCePHUZ9Uz1DdZI6XxkgCNKNwao0csAyvODxD6Ee43mkExtviB8BJY5jWLIMTdGhgEGH2sRqils8IDW0p8AOTPM4UC7iA7hdg3pA+XMvBHvP9ixsY7tuB+yR2AfnFaSw2DVbwI5GgFdFMNHXYuL+9V9Wuh3keBKYQT/Hy1YvxjQ/t9UouYHqEsyVFUl3R4lEAM9+qSRsRu+EKmcSO2QtCsWc= + matrix: + # Each line is a set of environment variables set before a build. + # Thus each line represents a different build configuration. + - BUILD_TYPE=RelWithDebInfo + - BUILD_TYPE=Debug + +compiler: + - clang + - gcc + +matrix: + fast_finish: true + include: + # Additional build using Android NDK with android-cmake + - env: BUILD_ANDROID_CMAKE=ON + # Additional build using Android NDK with Android.mk + - env: BUILD_ANDROID_MK=ON + # Additional check over format + - env: CHECK_FORMAT=ON + exclude: + # Skip GCC builds on macOS. + - os: osx + compiler: gcc + +cache: + apt: true + +git: + depth: 1 + +branches: + only: + - master + +before_install: + - if [[ "$BUILD_ANDROID_CMAKE" == "ON" ]] || [[ "$BUILD_ANDROID_MK" == "ON" ]]; then + git clone --depth=1 https://github.com/urho3d/android-ndk.git $HOME/android-ndk; + export ANDROID_NDK=$HOME/android-ndk; + git clone --depth=1 https://github.com/taka-no-me/android-cmake.git $HOME/android-cmake; + export TOOLCHAIN_PATH=$HOME/android-cmake/android.toolchain.cmake; + fi + - if [[ "$CHECK_FORMAT" == "ON" ]]; then + curl -L http://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py -o utils/clang-format-diff.py; + fi + +before_script: + - git clone --depth=1 https://github.com/KhronosGroup/SPIRV-Headers external/spirv-headers + - git clone --depth=1 https://github.com/google/googletest external/googletest + - git clone --depth=1 https://github.com/google/effcee external/effcee + - git clone --depth=1 https://github.com/google/re2 external/re2 + +script: + # Due to the limitation of Travis platform, we cannot start too many concurrent jobs. + # Otherwise GCC will panic with internal error, possibility because of memory issues. + # ctest with the current tests doesn't profit from using more than 4 threads. + - export NPROC=4 + - mkdir build && cd build + - if [[ "$BUILD_ANDROID_MK" == "ON" ]]; then + export BUILD_DIR=$(pwd); + mkdir ${BUILD_DIR}/libs; + mkdir ${BUILD_DIR}/app; + $ANDROID_NDK/ndk-build -C ../android_test NDK_PROJECT_PATH=. + NDK_LIBS_OUT=${BUILD_DIR}/libs + NDK_APP_OUT=${BUILD_DIR}/app -j${NPROC}; + elif [[ "$BUILD_ANDROID_CMAKE" == "ON" ]]; then + cmake -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_PATH} + -DANDROID_NATIVE_API_LEVEL=android-9 + -DCMAKE_BUILD_TYPE=Release + -DANDROID_ABI="armeabi-v7a with NEON" + -DSPIRV_BUILD_COMPRESSION=ON + -DSPIRV_SKIP_TESTS=ON ..; + make -j${NPROC}; + elif [[ "$CHECK_FORMAT" == "ON" ]]; then + cd ..; + ./utils/check_code_format.sh; + else + cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSPIRV_BUILD_COMPRESSION=ON -DCMAKE_INSTALL_PREFIX=install ..; + make -j${NPROC} install; + ctest -j${NPROC} --output-on-failure --timeout 300; + fi + +after_success: + # Create tarball for deployment + - if [[ "${CC}" == "clang" && "${BUILD_ANDROID_MK}" != "ON" && "${BUILD_ANDROID_CMAKE}" != "ON" && "${CHECK_FORMAT}" != "ON" ]]; then + cd install; + export TARBALL=SPIRV-Tools-master-${TRAVIS_OS_NAME}-${BUILD_TYPE}.zip; + find . -print | zip -@ ${TARBALL}; + fi + +before_deploy: + # Tag the current master top of the tree as "master-tot". + # Travis CI relies on the tag name to push to the correct release. + - git config --global user.name "Travis CI" + - git config --global user.email "builds@travis-ci.org" + - git tag -f master-tot + - git push -q -f https://${spirvtoken}@github.com/KhronosGroup/SPIRV-Tools --tags + +deploy: + provider: releases + api_key: ${spirvtoken} + on: + branch: master + condition: ${CC} == clang && ${BUILD_ANDROID_MK} != ON && ${BUILD_ANDROID_CMAKE} != ON && ${CHECK_FORMAT} != ON + file: ${TARBALL} + skip_cleanup: true + overwrite: true + +notifications: + email: + recipients: + - andreyt@google.com + - antiagainst@google.com + - awoloszyn@google.com + - dneto@google.com + - ehsann@google.com + - qining@google.com + on_success: change + on_failure: always diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/utils/check_code_format.sh vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/utils/check_code_format.sh --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/utils/check_code_format.sh 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/utils/check_code_format.sh 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,37 @@ +#!/bin/bash +# Copyright (c) 2017 Google 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. +# +# Script to determine if source code in Pull Request is properly formatted. +# Exits with non 0 exit code if formatting is needed. +# +# This script assumes to be invoked at the project root directory. + +FILES_TO_CHECK=$(git diff --name-only master | grep -E ".*\.(cpp|cc|c\+\+|cxx|c|h|hpp)$") + +if [ -z "${FILES_TO_CHECK}" ]; then + echo "No source code to check for formatting." + exit 0 +fi + +FORMAT_DIFF=$(git diff -U0 master -- ${FILES_TO_CHECK} | python ./utils/clang-format-diff.py -p1 -style=file) + +if [ -z "${FORMAT_DIFF}" ]; then + echo "All source code in PR properly formatted." + exit 0 +else + echo "Found formatting errors!" + echo "${FORMAT_DIFF}" + exit 1 +fi diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/utils/check_copyright.py vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/utils/check_copyright.py --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/utils/check_copyright.py 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/utils/check_copyright.py 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,222 @@ +#!/usr/bin/env python +# Copyright (c) 2016 Google 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. +"""Checks for copyright notices in all the files that need them under the +current directory. Optionally insert them. When inserting, replaces +an MIT or Khronos free use license with Apache 2. +""" +from __future__ import print_function + +import argparse +import fileinput +import fnmatch +import inspect +import os +import re +import sys + +# List of designated copyright owners. +AUTHORS = ['The Khronos Group Inc.', + 'LunarG Inc.', + 'Google Inc.', + 'Google LLC', + 'Pierre Moreau'] +CURRENT_YEAR='2018' + +YEARS = '(2014-2016|2015-2016|2016|2016-2017|2017|2018)' +COPYRIGHT_RE = re.compile( + 'Copyright \(c\) {} ({})'.format(YEARS, '|'.join(AUTHORS))) + +MIT_BEGIN_RE = re.compile('Permission is hereby granted, ' + 'free of charge, to any person obtaining a') +MIT_END_RE = re.compile('MATERIALS OR THE USE OR OTHER DEALINGS IN ' + 'THE MATERIALS.') +APACHE2_BEGIN_RE = re.compile('Licensed under the Apache License, ' + 'Version 2.0 \(the "License"\);') +APACHE2_END_RE = re.compile('limitations under the License.') + +LICENSED = """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.""" +LICENSED_LEN = 10 # Number of lines in LICENSED + + +def find(top, filename_glob, skip_glob_dir_list, skip_glob_files_list): + """Returns files in the tree rooted at top matching filename_glob but not + in directories matching skip_glob_dir_list nor files matching + skip_glob_dir_list.""" + + file_list = [] + for path, dirs, files in os.walk(top): + for glob in skip_glob_dir_list: + for match in fnmatch.filter(dirs, glob): + dirs.remove(match) + for filename in fnmatch.filter(files, filename_glob): + full_file = os.path.join(path, filename) + if full_file not in skip_glob_files_list: + file_list.append(full_file) + return file_list + + +def filtered_descendants(glob): + """Returns glob-matching filenames under the current directory, but skips + some irrelevant paths.""" + return find('.', glob, ['third_party', 'external', 'CompilerIdCXX', + 'build*', 'out*'], ['./utils/clang-format-diff.py']) + + +def skip(line): + """Returns true if line is all whitespace or shebang.""" + stripped = line.lstrip() + return stripped == '' or stripped.startswith('#!') + + +def comment(text, prefix): + """Returns commented-out text. + + Each line of text will be prefixed by prefix and a space character. Any + trailing whitespace will be trimmed. + """ + accum = ['{} {}'.format(prefix, line).rstrip() for line in text.split('\n')] + return '\n'.join(accum) + + +def insert_copyright(author, glob, comment_prefix): + """Finds all glob-matching files under the current directory and inserts the + copyright message, and license notice. An MIT license or Khronos free + use license (modified MIT) is replaced with an Apache 2 license. + + The copyright message goes into the first non-whitespace, non-shebang line + in a file. The license notice follows it. Both are prefixed on each line + by comment_prefix and a space. + """ + + copyright = comment('Copyright (c) {} {}'.format(CURRENT_YEAR, author), + comment_prefix) + '\n\n' + licensed = comment(LICENSED, comment_prefix) + '\n\n' + for file in filtered_descendants(glob): + # Parsing states are: + # 0 Initial: Have not seen a copyright declaration. + # 1 Seen a copyright line and no other interesting lines + # 2 In the middle of an MIT or Khronos free use license + # 9 Exited any of the above + state = 0 + update_file = False + for line in fileinput.input(file, inplace=1): + emit = True + if state is 0: + if COPYRIGHT_RE.search(line): + state = 1 + elif skip(line): + pass + else: + # Didn't see a copyright. Inject copyright and license. + sys.stdout.write(copyright) + sys.stdout.write(licensed) + # Assume there isn't a previous license notice. + state = 1 + elif state is 1: + if MIT_BEGIN_RE.search(line): + state = 2 + emit = False + elif APACHE2_BEGIN_RE.search(line): + # Assume an Apache license is preceded by a copyright + # notice. So just emit it like the rest of the file. + state = 9 + elif state is 2: + # Replace the MIT license with Apache 2 + emit = False + if MIT_END_RE.search(line): + state = 9 + sys.stdout.write(licensed) + if emit: + sys.stdout.write(line) + + +def alert_if_no_copyright(glob, comment_prefix): + """Prints names of all files missing either a copyright or Apache 2 license. + + Finds all glob-matching files under the current directory and checks if they + contain the copyright message and license notice. Prints the names of all the + files that don't meet both criteria. + + Returns the total number of file names printed. + """ + printed_count = 0 + for file in filtered_descendants(glob): + has_copyright = False + has_apache2 = False + line_num = 0 + apache_expected_end = 0 + with open(file) as contents: + for line in contents: + line_num += 1 + if COPYRIGHT_RE.search(line): + has_copyright = True + if APACHE2_BEGIN_RE.search(line): + apache_expected_end = line_num + LICENSED_LEN + if (line_num is apache_expected_end) and APACHE2_END_RE.search(line): + has_apache2 = True + if not (has_copyright and has_apache2): + message = file + if not has_copyright: + message += ' has no copyright' + if not has_apache2: + message += ' has no Apache 2 license notice' + print(message) + printed_count += 1 + return printed_count + + +class ArgParser(argparse.ArgumentParser): + def __init__(self): + super(ArgParser, self).__init__( + description=inspect.getdoc(sys.modules[__name__])) + self.add_argument('--update', dest='author', action='store', + help='For files missing a copyright notice, insert ' + 'one for the given author, and add a license ' + 'notice. The author must be in the AUTHORS ' + 'list in the script.') + + +def main(): + glob_comment_pairs = [('*.h', '//'), ('*.hpp', '//'), ('*.sh', '#'), + ('*.py', '#'), ('*.cpp', '//'), + ('CMakeLists.txt', '#')] + argparser = ArgParser() + args = argparser.parse_args() + + if args.author: + if args.author not in AUTHORS: + print('error: --update argument must be in the AUTHORS list in ' + 'check_copyright.py: {}'.format(AUTHORS)) + sys.exit(1) + for pair in glob_comment_pairs: + insert_copyright(args.author, *pair) + sys.exit(0) + else: + count = sum([alert_if_no_copyright(*p) for p in glob_comment_pairs]) + sys.exit(count > 0) + + +if __name__ == '__main__': + main() diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/utils/check_symbol_exports.py vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/utils/check_symbol_exports.py --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/utils/check_symbol_exports.py 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/utils/check_symbol_exports.py 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,92 @@ +#!/usr/bin/env python +# Copyright (c) 2017 Google 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. +"""Checks names of global exports from a library.""" + +from __future__ import print_function + +import os.path +import re +import subprocess +import sys + + +PROG = 'check_symbol_exports' + + +def command_output(cmd, directory): + """Runs a command in a directory and returns its standard output stream. + + Captures the standard error stream. + + Raises a RuntimeError if the command fails to launch or otherwise fails. + """ + p = subprocess.Popen(cmd, + cwd=directory, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + (stdout, _) = p.communicate() + if p.returncode != 0: + raise RuntimeError('Failed to run %s in %s' % (cmd, directory)) + return stdout + + +def check_library(library): + """Scans the given library file for global exports. If all such + exports are namespaced or begin with spv (in either C or C++ styles) + then return 0. Otherwise emit a message and return 1.""" + + # The pattern for a global symbol record + symbol_pattern = re.compile(r'^[0-aA-Fa-f]+ g *F \.text.*[0-9A-Fa-f]+ +(.*)') + + # Ok patterns are as follows, assuming Itanium name mangling: + # spv[A-Z] : extern "C" symbol starting with spv + # _ZN : something in a namespace + # _Z[0-9]+spv[A-Z_] : C++ symbol starting with spv[A-Z_] + symbol_ok_pattern = re.compile(r'^(spv[A-Z]|_ZN|_Z[0-9]+spv[A-Z_])') + seen = set() + result = 0 + for line in command_output(['objdump', '-t', library], '.').split('\n'): + match = symbol_pattern.search(line) + if match: + symbol = match.group(1) + if symbol not in seen: + seen.add(symbol) + #print("look at '{}'".format(symbol)) + if not symbol_ok_pattern.match(symbol): + print('{}: error: Unescaped exported symbol: {}'.format(PROG, symbol)) + result = 1 + return result + + +def main(): + import argparse + parser = argparse.ArgumentParser(description='Check global names exported from a library') + parser.add_argument('library', help='The static library to examine') + args = parser.parse_args() + + if not os.path.isfile(args.library): + print('{}: error: {} does not exist'.format(PROG, args.library)) + sys.exit(1) + + if os.name is 'posix': + status = check_library(args.library) + sys.exit(status) + else: + print('Passing test since not on Posix') + sys.exit(0) + + +if __name__ == '__main__': + main() diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/utils/generate_grammar_tables.py vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/utils/generate_grammar_tables.py --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/utils/generate_grammar_tables.py 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/utils/generate_grammar_tables.py 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,749 @@ +#!/usr/bin/env python +# Copyright (c) 2016 Google 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. +"""Generates various info tables from SPIR-V JSON grammar.""" + +from __future__ import print_function + +import errno +import json +import os.path +import re + +# Prefix for all C variables generated by this script. +PYGEN_VARIABLE_PREFIX = 'pygen_variable' + +# Extensions to recognize, but which don't necessarily come from the SPIR-V +# core or KHR grammar files. Get this list from the SPIR-V registery web page. +# NOTE: Only put things on this list if it is not in those grammar files. +EXTENSIONS_FROM_SPIRV_REGISTRY_AND_NOT_FROM_GRAMMARS = """ +SPV_AMD_gcn_shader +SPV_AMD_gpu_shader_half_float +SPV_AMD_gpu_shader_int16 +SPV_AMD_shader_trinary_minmax +""" + + +def make_path_to_file(f): + """Makes all ancestor directories to the given file, if they + don't yet exist. + + Arguments: + f: The file whose ancestor directories are to be created. + """ + dir = os.path.dirname(os.path.abspath(f)) + try: + os.makedirs(dir) + except OSError as e: + if e.errno == errno.EEXIST and os.path.isdir(dir): + pass + else: + raise + + +def convert_min_required_version(version): + """Converts the minimal required SPIR-V version encoded in the + grammar to the symbol in SPIRV-Tools""" + if version is None: + return 'SPV_SPIRV_VERSION_WORD(1, 0)' + if version == 'None': + return '0xffffffffu' + return 'SPV_SPIRV_VERSION_WORD({})'.format(version.replace('.', ',')) + + +def compose_capability_list(caps): + """Returns a string containing a braced list of capabilities as enums. + + Arguments: + - caps: a sequence of capability names + + Returns: + a string containing the braced list of SpvCapability* enums named by caps. + """ + return "{" + ", ".join(['SpvCapability{}'.format(c) for c in caps]) + "}" + + +def get_capability_array_name(caps): + """Returns the name of the array containing all the given capabilities. + + Args: + - caps: a sequence of capability names + """ + if not caps: + return 'nullptr' + return '{}_caps_{}'.format(PYGEN_VARIABLE_PREFIX, ''.join(caps)) + + +def generate_capability_arrays(caps): + """Returns the arrays of capabilities. + + Arguments: + - caps: a sequence of sequence of capability names + """ + caps = sorted(set([tuple(c) for c in caps if c])) + arrays = [ + 'static const SpvCapability {}[] = {};'.format( + get_capability_array_name(c), compose_capability_list(c)) + for c in caps] + return '\n'.join(arrays) + + +def compose_extension_list(exts): + """Returns a string containing a braced list of extensions as enums. + + Arguments: + - exts: a sequence of extension names + + Returns: + a string containing the braced list of extensions named by exts. + """ + return "{" + ", ".join( + ['libspirv::Extension::k{}'.format(e) for e in exts]) + "}" + + +def get_extension_array_name(extensions): + """Returns the name of the array containing all the given extensions. + + Args: + - extensions: a sequence of extension names + """ + if not extensions: + return 'nullptr' + else: + return '{}_exts_{}'.format( + PYGEN_VARIABLE_PREFIX, ''.join(extensions)) + + +def generate_extension_arrays(extensions): + """Returns the arrays of extensions. + + Arguments: + - caps: a sequence of sequence of extension names + """ + extensions = sorted(set([tuple(e) for e in extensions if e])) + arrays = [ + 'static const libspirv::Extension {}[] = {};'.format( + get_extension_array_name(e), compose_extension_list(e)) + for e in extensions] + return '\n'.join(arrays) + + +def convert_operand_kind(operand_tuple): + """Returns the corresponding operand type used in spirv-tools for + the given operand kind and quantifier used in the JSON grammar. + + Arguments: + - operand_tuple: a tuple of two elements: + - operand kind: used in the JSON grammar + - quantifier: '', '?', or '*' + + Returns: + a string of the enumerant name in spv_operand_type_t + """ + kind, quantifier = operand_tuple + # The following cases are where we differ between the JSON grammar and + # spirv-tools. + if kind == 'IdResultType': + kind = 'TypeId' + elif kind == 'IdResult': + kind = 'ResultId' + elif kind == 'IdMemorySemantics' or kind == 'MemorySemantics': + kind = 'MemorySemanticsId' + elif kind == 'IdScope' or kind == 'Scope': + kind = 'ScopeId' + elif kind == 'IdRef': + kind = 'Id' + + elif kind == 'ImageOperands': + kind = 'Image' + elif kind == 'Dim': + kind = 'Dimensionality' + elif kind == 'ImageFormat': + kind = 'SamplerImageFormat' + elif kind == 'KernelEnqueueFlags': + kind = 'KernelEnqFlags' + + elif kind == 'LiteralExtInstInteger': + kind = 'ExtensionInstructionNumber' + elif kind == 'LiteralSpecConstantOpInteger': + kind = 'SpecConstantOpNumber' + elif kind == 'LiteralContextDependentNumber': + kind = 'TypedLiteralNumber' + + elif kind == 'PairLiteralIntegerIdRef': + kind = 'LiteralIntegerId' + elif kind == 'PairIdRefLiteralInteger': + kind = 'IdLiteralInteger' + elif kind == 'PairIdRefIdRef': # Used by OpPhi in the grammar + kind = 'Id' + + if kind == 'FPRoundingMode': + kind = 'FpRoundingMode' + elif kind == 'FPFastMathMode': + kind = 'FpFastMathMode' + + if quantifier == '?': + kind = 'Optional{}'.format(kind) + elif quantifier == '*': + kind = 'Variable{}'.format(kind) + + return 'SPV_OPERAND_TYPE_{}'.format( + re.sub(r'([a-z])([A-Z])', r'\1_\2', kind).upper()) + + +class InstInitializer(object): + """Instances holds a SPIR-V instruction suitable for printing as + the initializer for spv_opcode_desc_t.""" + + def __init__(self, opname, caps, exts, operands, version): + """Initialization. + + Arguments: + - opname: opcode name (with the 'Op' prefix) + - caps: a sequence of capability names required by this opcode + - exts: a sequence of names of extensions enabling this enumerant + - operands: a sequence of (operand-kind, operand-quantifier) tuples + - version: minimal SPIR-V version required for this opcode + """ + + assert opname.startswith('Op') + self.opname = opname[2:] # Remove the "Op" prefix. + self.num_caps = len(caps) + self.caps_mask = get_capability_array_name(caps) + self.num_exts = len(exts) + self.exts = get_extension_array_name(exts) + self.operands = [convert_operand_kind(o) for o in operands] + + self.fix_syntax() + + operands = [o[0] for o in operands] + self.ref_type_id = 'IdResultType' in operands + self.def_result_id = 'IdResult' in operands + + self.version = convert_min_required_version(version) + + def fix_syntax(self): + """Fix an instruction's syntax, adjusting for differences between + the officially released grammar and how SPIRV-Tools uses the grammar. + + Fixes: + - ExtInst should not end with SPV_OPERAND_VARIABLE_ID. + https://github.com/KhronosGroup/SPIRV-Tools/issues/233 + """ + if (self.opname == 'ExtInst' + and self.operands[-1] == 'SPV_OPERAND_TYPE_VARIABLE_ID'): + self.operands.pop() + + def __str__(self): + template = ['{{"{opname}"', 'SpvOp{opname}', + '{num_caps}', '{caps_mask}', + '{num_operands}', '{{{operands}}}', + '{def_result_id}', '{ref_type_id}', + '{num_exts}', '{exts}', + '{min_version}}}'] + return ', '.join(template).format( + opname=self.opname, + num_caps=self.num_caps, + caps_mask=self.caps_mask, + num_operands=len(self.operands), + operands=', '.join(self.operands), + def_result_id=(1 if self.def_result_id else 0), + ref_type_id=(1 if self.ref_type_id else 0), + num_exts=self.num_exts, + exts=self.exts, + min_version=self.version) + + +class ExtInstInitializer(object): + """Instances holds a SPIR-V extended instruction suitable for printing as + the initializer for spv_ext_inst_desc_t.""" + + def __init__(self, opname, opcode, caps, operands): + """Initialization. + + Arguments: + - opname: opcode name + - opcode: enumerant value for this opcode + - caps: a sequence of capability names required by this opcode + - operands: a sequence of (operand-kind, operand-quantifier) tuples + """ + self.opname = opname + self.opcode = opcode + self.num_caps = len(caps) + self.caps_mask = get_capability_array_name(caps) + self.operands = [convert_operand_kind(o) for o in operands] + self.operands.append('SPV_OPERAND_TYPE_NONE') + + def __str__(self): + template = ['{{"{opname}"', '{opcode}', '{num_caps}', '{caps_mask}', + '{{{operands}}}}}'] + return ', '.join(template).format( + opname=self.opname, + opcode=self.opcode, + num_caps=self.num_caps, + caps_mask=self.caps_mask, + operands=', '.join(self.operands)) + + +def generate_instruction(inst, is_ext_inst): + """Returns the C initializer for the given SPIR-V instruction. + + Arguments: + - inst: a dict containing information about a SPIR-V instruction + - is_ext_inst: a bool indicating whether |inst| is an extended + instruction. + + Returns: + a string containing the C initializer for spv_opcode_desc_t or + spv_ext_inst_desc_t + """ + opname = inst.get('opname') + opcode = inst.get('opcode') + caps = inst.get('capabilities', []) + exts = inst.get('extensions', []) + operands = inst.get('operands', {}) + operands = [(o['kind'], o.get('quantifier', '')) for o in operands] + min_version = inst.get('version', None) + + assert opname is not None + + if is_ext_inst: + return str(ExtInstInitializer(opname, opcode, caps, operands)) + else: + return str(InstInitializer(opname, caps, exts, operands, min_version)) + + +def generate_instruction_table(inst_table): + """Returns the info table containing all SPIR-V instructions, + sorted by opcode, and prefixed by capability arrays. + + Note: + - the built-in sorted() function is guaranteed to be stable. + https://docs.python.org/3/library/functions.html#sorted + + Arguments: + - inst_table: a list containing all SPIR-V instructions. + """ + inst_table = sorted(inst_table, key=lambda k: (k['opcode'], k['opname'])) + + caps_arrays = generate_capability_arrays( + [inst.get('capabilities', []) for inst in inst_table]) + exts_arrays = generate_extension_arrays( + [inst.get('extensions', []) for inst in inst_table]) + + insts = [generate_instruction(inst, False) for inst in inst_table] + insts = ['static const spv_opcode_desc_t kOpcodeTableEntries[] = {{\n' + ' {}\n}};'.format(',\n '.join(insts))] + + return '{}\n\n{}\n\n{}'.format(caps_arrays, exts_arrays, '\n'.join(insts)) + + +def generate_extended_instruction_table(inst_table, set_name): + """Returns the info table containing all SPIR-V extended instructions, + sorted by opcode, and prefixed by capability arrays. + + Arguments: + - inst_table: a list containing all SPIR-V instructions. + - set_name: the name of the extended instruction set. + """ + inst_table = sorted(inst_table, key=lambda k: k['opcode']) + caps = [inst.get('capabilities', []) for inst in inst_table] + caps_arrays = generate_capability_arrays(caps) + insts = [generate_instruction(inst, True) for inst in inst_table] + insts = ['static const spv_ext_inst_desc_t {}_entries[] = {{\n' + ' {}\n}};'.format(set_name, ',\n '.join(insts))] + + return '{}\n\n{}'.format(caps_arrays, '\n'.join(insts)) + + +class EnumerantInitializer(object): + """Prints an enumerant as the initializer for spv_operand_desc_t.""" + + def __init__(self, enumerant, value, caps, exts, parameters, version): + """Initialization. + + Arguments: + - enumerant: enumerant name + - value: enumerant value + - caps: a sequence of capability names required by this enumerant + - exts: a sequence of names of extensions enabling this enumerant + - parameters: a sequence of (operand-kind, operand-quantifier) tuples + - version: minimal SPIR-V version required for this opcode + """ + self.enumerant = enumerant + self.value = value + self.num_caps = len(caps) + self.caps = get_capability_array_name(caps) + self.num_exts = len(exts) + self.exts = get_extension_array_name(exts) + self.parameters = [convert_operand_kind(p) for p in parameters] + self.version = convert_min_required_version(version) + + def __str__(self): + template = ['{{"{enumerant}"', '{value}', '{num_caps}', + '{caps}', '{num_exts}', '{exts}', + '{{{parameters}}}', '{min_version}}}'] + return ', '.join(template).format( + enumerant=self.enumerant, + value=self.value, + num_caps=self.num_caps, + caps=self.caps, + num_exts=self.num_exts, + exts=self.exts, + parameters=', '.join(self.parameters), + min_version=self.version) + + +def generate_enum_operand_kind_entry(entry): + """Returns the C initializer for the given operand enum entry. + + Arguments: + - entry: a dict containing information about an enum entry + + Returns: + a string containing the C initializer for spv_operand_desc_t + """ + enumerant = entry.get('enumerant') + value = entry.get('value') + caps = entry.get('capabilities', []) + exts = entry.get('extensions', []) + params = entry.get('parameters', []) + params = [p.get('kind') for p in params] + params = zip(params, [''] * len(params)) + version = entry.get('version', None) + + assert enumerant is not None + assert value is not None + + return str(EnumerantInitializer( + enumerant, value, caps, exts, params, version)) + + +def generate_enum_operand_kind(enum): + """Returns the C definition for the given operand kind.""" + kind = enum.get('kind') + assert kind is not None + + # Sort all enumerants first according to their values and then + # their names so that the symbols with the same values are + # grouped together. + if enum.get('category') == 'ValueEnum': + functor = lambda k: (k['value'], k['enumerant']) + else: + functor = lambda k: (int(k['value'], 16), k['enumerant']) + entries = sorted(enum.get('enumerants', []), key=functor) + + name = '{}_{}Entries'.format(PYGEN_VARIABLE_PREFIX, kind) + entries = [' {}'.format(generate_enum_operand_kind_entry(e)) + for e in entries] + + template = ['static const spv_operand_desc_t {name}[] = {{', + '{entries}', '}};'] + entries = '\n'.join(template).format( + name=name, + entries=',\n'.join(entries)) + + return kind, name, entries + + +def generate_operand_kind_table(enums): + """Returns the info table containing all SPIR-V operand kinds.""" + # We only need to output info tables for those operand kinds that are enums. + enums = [e for e in enums if e.get('category') in ['ValueEnum', 'BitEnum']] + + caps = [entry.get('capabilities', []) + for enum in enums + for entry in enum.get('enumerants', [])] + caps_arrays = generate_capability_arrays(caps) + + exts = [entry.get('extensions', []) + for enum in enums + for entry in enum.get('enumerants', [])] + exts_arrays = generate_extension_arrays(exts) + + enums = [generate_enum_operand_kind(e) for e in enums] + # We have three operand kinds that requires their optional counterpart to + # exist in the operand info table. + three_optional_enums = ['ImageOperands', 'AccessQualifier', 'MemoryAccess'] + three_optional_enums = [e for e in enums if e[0] in three_optional_enums] + enums.extend(three_optional_enums) + + enum_kinds, enum_names, enum_entries = zip(*enums) + # Mark the last three as optional ones. + enum_quantifiers = [''] * (len(enums) - 3) + ['?'] * 3 + # And we don't want redefinition of them. + enum_entries = enum_entries[:-3] + enum_kinds = [convert_operand_kind(e) + for e in zip(enum_kinds, enum_quantifiers)] + table_entries = zip(enum_kinds, enum_names, enum_names) + table_entries = [' {{{}, ARRAY_SIZE({}), {}}}'.format(*e) + for e in table_entries] + + template = [ + 'static const spv_operand_desc_group_t {p}_OperandInfoTable[] = {{', + '{enums}', '}};'] + table = '\n'.join(template).format( + p=PYGEN_VARIABLE_PREFIX, enums=',\n'.join(table_entries)) + + return '\n\n'.join((caps_arrays,) + (exts_arrays,) + enum_entries + (table,)) + + +def get_extension_list(instructions, operand_kinds): + """Returns extensions as an alphabetically sorted list of strings.""" + + things_with_an_extensions_field = [item for item in instructions] + + enumerants = sum([item.get('enumerants', []) for item in operand_kinds], []) + + things_with_an_extensions_field.extend(enumerants) + + extensions = sum([item.get('extensions', []) + for item in things_with_an_extensions_field + if item.get('extensions')], []) + + for item in EXTENSIONS_FROM_SPIRV_REGISTRY_AND_NOT_FROM_GRAMMARS.split(): + # If it's already listed in a grammar, then don't put it in the + # special exceptions list. + assert item not in extensions, "Extension %s is already in a grammar file" % item + + extensions.extend(EXTENSIONS_FROM_SPIRV_REGISTRY_AND_NOT_FROM_GRAMMARS.split()) + + # Validator would ignore type declaration unique check. Should only be used + # for legacy autogenerated test files containing multiple instances of the + # same type declaration, if fixing the test by other methods is too + # difficult. Shouldn't be used for any other reasons. + extensions.append('SPV_VALIDATOR_ignore_type_decl_unique') + + return sorted(set(extensions)) + + +def get_capabilities(operand_kinds): + """Returns capabilities as a list of JSON objects, in order of + appearance. + """ + enumerants = sum([item.get('enumerants', []) for item in operand_kinds + if item.get('kind') in ['Capability']], []) + return enumerants + + +def generate_extension_enum(extensions): + """Returns enumeration containing extensions declared in the grammar.""" + return ',\n'.join(['k' + extension for extension in extensions]) + + +def generate_extension_to_string_mapping(extensions): + """Returns mapping function from extensions to corresponding strings.""" + function = 'const char* ExtensionToString(Extension extension) {\n' + function += ' switch (extension) {\n' + template = ' case Extension::k{extension}:\n' \ + ' return "{extension}";\n' + function += ''.join([template.format(extension=extension) + for extension in extensions]) + function += ' };\n\n return "";\n}' + return function + + +def generate_string_to_extension_mapping(extensions): + """Returns mapping function from strings to corresponding extensions.""" + + function = ''' + bool GetExtensionFromString(const char* str, Extension* extension) {{ + static const char* known_ext_strs[] = {{ {strs} }}; + static const Extension known_ext_ids[] = {{ {ids} }}; + const auto b = std::begin(known_ext_strs); + const auto e = std::end(known_ext_strs); + const auto found = std::equal_range( + b, e, str, [](const char* str1, const char* str2) {{ + return std::strcmp(str1, str2) < 0; + }}); + if (found.first == e || found.first == found.second) return false; + + *extension = known_ext_ids[found.first - b]; + return true; + }} + '''.format(strs=', '.join(['"{}"'.format(e) for e in extensions]), + ids=', '.join(['Extension::k{}'.format(e) for e in extensions])) + + return function + + +def generate_capability_to_string_mapping(operand_kinds): + """Returns mapping function from capabilities to corresponding strings. + We take care to avoid emitting duplicate values. + """ + function = 'const char* CapabilityToString(SpvCapability capability) {\n' + function += ' switch (capability) {\n' + template = ' case SpvCapability{capability}:\n' \ + ' return "{capability}";\n' + emitted = set() # The values of capabilities we already have emitted + for capability in get_capabilities(operand_kinds): + value = capability.get('value') + if value not in emitted: + emitted.add(value) + function += template.format(capability=capability.get('enumerant')) + function += ' case SpvCapabilityMax:\n' \ + ' assert(0 && "Attempting to convert SpvCapabilityMax to string");\n' \ + ' return "";\n' + function += ' };\n\n return "";\n}' + return function + + +def generate_all_string_enum_mappings(extensions, operand_kinds): + """Returns all string-to-enum / enum-to-string mapping tables.""" + tables = [] + tables.append(generate_extension_to_string_mapping(extensions)) + tables.append(generate_string_to_extension_mapping(extensions)) + tables.append(generate_capability_to_string_mapping(operand_kinds)) + return '\n\n'.join(tables) + + +def main(): + import argparse + parser = argparse.ArgumentParser(description='Generate SPIR-V info tables') + + parser.add_argument('--spirv-core-grammar', metavar='', + type=str, required=False, + help='input JSON grammar file for core SPIR-V ' + 'instructions') + parser.add_argument('--extinst-debuginfo-grammar', metavar='', + type=str, required=False, default=None, + help='input JSON grammar file for DebugInfo extended ' + 'instruction set') + parser.add_argument('--extinst-glsl-grammar', metavar='', + type=str, required=False, default=None, + help='input JSON grammar file for GLSL extended ' + 'instruction set') + parser.add_argument('--extinst-opencl-grammar', metavar='', + type=str, required=False, default=None, + help='input JSON grammar file for OpenCL extended ' + 'instruction set') + + parser.add_argument('--core-insts-output', metavar='', + type=str, required=False, default=None, + help='output file for core SPIR-V instructions') + parser.add_argument('--glsl-insts-output', metavar='', + type=str, required=False, default=None, + help='output file for GLSL extended instruction set') + parser.add_argument('--opencl-insts-output', metavar='', + type=str, required=False, default=None, + help='output file for OpenCL extended instruction set') + parser.add_argument('--operand-kinds-output', metavar='', + type=str, required=False, default=None, + help='output file for operand kinds') + parser.add_argument('--extension-enum-output', metavar='', + type=str, required=False, default=None, + help='output file for extension enumeration') + parser.add_argument('--enum-string-mapping-output', metavar='', + type=str, required=False, default=None, + help='output file for enum-string mappings') + parser.add_argument('--extinst-vendor-grammar', metavar='', + type=str, required=False, default=None, + help='input JSON grammar file for vendor extended ' + 'instruction set'), + parser.add_argument('--vendor-insts-output', metavar='', + type=str, required=False, default=None, + help='output file for vendor extended instruction set') + args = parser.parse_args() + + if (args.core_insts_output is None) != \ + (args.operand_kinds_output is None): + print('error: --core-insts-output and --operand-kinds-output ' + 'should be specified together.') + exit(1) + if args.operand_kinds_output and not (args.spirv_core_grammar and args.extinst_debuginfo_grammar): + print('error: --operand-kinds-output requires --spirv-core-grammar ' + 'and --exinst-debuginfo-grammar') + exit(1) + if (args.glsl_insts_output is None) != \ + (args.extinst_glsl_grammar is None): + print('error: --glsl-insts-output and --extinst-glsl-grammar ' + 'should be specified together.') + exit(1) + if (args.opencl_insts_output is None) != \ + (args.extinst_opencl_grammar is None): + print('error: --opencl-insts-output and --extinst-opencl-grammar ' + 'should be specified together.') + exit(1) + if (args.vendor_insts_output is None) != \ + (args.extinst_vendor_grammar is None): + print('error: --vendor-insts-output and ' + '--extinst-vendor-grammar should be specified together.') + exit(1) + if all([args.core_insts_output is None, + args.glsl_insts_output is None, + args.opencl_insts_output is None, + args.vendor_insts_output is None, + args.extension_enum_output is None, + args.enum_string_mapping_output is None]): + print('error: at least one output should be specified.') + exit(1) + + if args.spirv_core_grammar is not None: + with open(args.spirv_core_grammar) as json_file: + core_grammar = json.loads(json_file.read()) + with open(args.extinst_debuginfo_grammar) as debuginfo_json_file: + debuginfo_grammar = json.loads(debuginfo_json_file.read()) + instructions = [] + instructions.extend(core_grammar['instructions']) + instructions.extend(debuginfo_grammar['instructions']) + operand_kinds = [] + operand_kinds.extend(core_grammar['operand_kinds']) + operand_kinds.extend(debuginfo_grammar['operand_kinds']) + extensions = get_extension_list(instructions, operand_kinds) + if args.core_insts_output is not None: + make_path_to_file(args.core_insts_output) + make_path_to_file(args.operand_kinds_output) + print(generate_instruction_table(core_grammar['instructions']), + file=open(args.core_insts_output, 'w')) + print(generate_operand_kind_table(operand_kinds), + file=open(args.operand_kinds_output, 'w')) + if args.extension_enum_output is not None: + make_path_to_file(args.extension_enum_output) + print(generate_extension_enum(extensions), + file=open(args.extension_enum_output, 'w')) + if args.enum_string_mapping_output is not None: + make_path_to_file(args.enum_string_mapping_output) + print(generate_all_string_enum_mappings(extensions, operand_kinds), + file=open(args.enum_string_mapping_output, 'w')) + + if args.extinst_glsl_grammar is not None: + with open(args.extinst_glsl_grammar) as json_file: + grammar = json.loads(json_file.read()) + make_path_to_file(args.glsl_insts_output) + print(generate_extended_instruction_table( + grammar['instructions'], "glsl"), + file=open(args.glsl_insts_output, 'w')) + + if args.extinst_opencl_grammar is not None: + with open(args.extinst_opencl_grammar) as json_file: + grammar = json.loads(json_file.read()) + make_path_to_file(args.opencl_insts_output) + print(generate_extended_instruction_table( + grammar['instructions'], "opencl"), + file=open(args.opencl_insts_output, 'w')) + + if args.extinst_vendor_grammar is not None: + with open(args.extinst_vendor_grammar) as json_file: + grammar = json.loads(json_file.read()) + make_path_to_file(args.vendor_insts_output) + name = args.extinst_vendor_grammar + start = name.find("extinst.") + len("extinst.") + name = name[start:-len(".grammar.json")].replace("-", "_") + print(generate_extended_instruction_table( + grammar['instructions'], name), + file=open(args.vendor_insts_output, 'w')) + + +if __name__ == '__main__': + main() diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/utils/generate_language_headers.py vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/utils/generate_language_headers.py --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/utils/generate_language_headers.py 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/utils/generate_language_headers.py 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,188 @@ +#!/usr/bin/env python +# Copyright (c) 2017 Google 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. +"""Generates language headers from a JSON grammar file""" + +from __future__ import print_function + +import errno +import json +import os.path +import re + + +def make_path_to_file(f): + """Makes all ancestor directories to the given file, if they + don't yet exist. + + Arguments: + f: The file whose ancestor directories are to be created. + """ + dir = os.path.dirname(os.path.abspath(f)) + try: + os.makedirs(dir) + except OSError as e: + if e.errno == errno.EEXIST and os.path.isdir(dir): + pass + else: + raise + +class ExtInstGrammar: + """The grammar for an extended instruction set""" + + def __init__(self, name, copyright, instructions, operand_kinds, version = None, revision = None): + self.name = name + self.copyright = copyright + self.instructions = instructions + self.operand_kinds = operand_kinds + self.version = version + self.revision = revision + + +class LangGenerator: + """A language-specific generator""" + + def __init__(self): + self.upper_case_initial = re.compile('^[A-Z]') + pass + + def comment_prefix(self): + return "" + + def namespace_prefix(self): + return "" + + def uses_guards(self): + return False + + def cpp_guard_preamble(self): + return "" + + def cpp_guard_postamble(self): + return "" + + def enum_value(self, prefix, name, value): + if self.upper_case_initial.match(name): + use_name = name + else: + use_name = '_' + name + + return " {}{} = {},".format(prefix, use_name, value) + + def generate(self, grammar): + """Returns a string that is the language-specific header for the given grammar""" + + parts = [] + if grammar.copyright: + parts.extend(["{}{}".format(self.comment_prefix(), f) for f in grammar.copyright]) + parts.append('') + + guard = 'SPIRV_EXTINST_{}_H_'.format(grammar.name) + if self.uses_guards: + parts.append('#ifndef {}'.format(guard)) + parts.append('#define {}'.format(guard)) + parts.append('') + + parts.append(self.cpp_guard_preamble()) + + if grammar.version: + parts.append(self.const_definition(grammar.name, 'Version', grammar.version)) + + if grammar.revision is not None: + parts.append(self.const_definition(grammar.name, 'Revision', grammar.revision)) + + parts.append('') + + if grammar.instructions: + parts.append(self.enum_prefix(grammar.name, 'Instructions')) + for inst in grammar.instructions: + parts.append(self.enum_value(grammar.name, inst['opname'], inst['opcode'])) + parts.append(self.enum_end(grammar.name, 'Instructions')) + parts.append('') + + if grammar.operand_kinds: + for kind in grammar.operand_kinds: + parts.append(self.enum_prefix(grammar.name, kind['kind'])) + for e in kind['enumerants']: + parts.append(self.enum_value(grammar.name, e['enumerant'], e['value'])) + parts.append(self.enum_end(grammar.name, kind['kind'])) + parts.append('') + + parts.append(self.cpp_guard_postamble()) + + if self.uses_guards: + parts.append('#endif // {}'.format(guard)) + + return '\n'.join(parts) + + +class CLikeGenerator(LangGenerator): + def uses_guards(self): + return True + + def comment_prefix(self): + return "// " + + def const_definition(self, prefix, var, value): + # Use an anonymous enum. Don't use a static const int variable because + # that can bloat binary size. + return 'enum {0} {1}{2} = {3}, {1}{2}_BitWidthPadding = 0x7fffffff {4};'.format( + '{', prefix, var, value, '}') + + def enum_prefix(self, prefix, name): + return 'enum {}{} {}'.format(prefix, name, '{') + + def enum_end(self, prefix, enum): + return ' {}{}Max = 0x7ffffff\n{};\n'.format(prefix, enum, '}') + + def cpp_guard_preamble(self): + return '#ifdef __cplusplus\nextern "C" {\n#endif\n' + + def cpp_guard_postamble(self): + return '#ifdef __cplusplus\n}\n#endif\n' + + +class CGenerator(CLikeGenerator): + pass + + +def main(): + import argparse + parser = argparse.ArgumentParser(description='Generate language headers from a JSON grammar') + + parser.add_argument('--extinst-name', + type=str, required=True, + help='The name to use in tokens') + parser.add_argument('--extinst-grammar', metavar='', + type=str, required=True, + help='input JSON grammar file for extended instruction set') + parser.add_argument('--extinst-output-base', metavar='', + type=str, required=True, + help='Basename of the language-specific output file.') + args = parser.parse_args() + + with open(args.extinst_grammar) as json_file: + grammar_json = json.loads(json_file.read()) + grammar = ExtInstGrammar(name = args.extinst_name, + copyright = grammar_json['copyright'], + instructions = grammar_json['instructions'], + operand_kinds = grammar_json['operand_kinds'], + version = grammar_json['version'], + revision = grammar_json['revision']) + make_path_to_file(args.extinst_output_base) + print(CGenerator().generate(grammar), file=open(args.extinst_output_base + '.h', 'w')) + + +if __name__ == '__main__': + main() diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/utils/generate_registry_tables.py vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/utils/generate_registry_tables.py --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/utils/generate_registry_tables.py 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/utils/generate_registry_tables.py 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,72 @@ +#!/usr/bin/env python +# Copyright (c) 2016 Google 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. +"""Generates the vendor tool table from the SPIR-V XML registry.""" + +from __future__ import print_function + +import distutils.dir_util +import os.path +import xml.etree.ElementTree + + +def generate_vendor_table(registry): + """Returns a list of C style initializers for the registered vendors + and their tools. + + Args: + registry: The SPIR-V XMLregistry as an xml.ElementTree + """ + + lines = [] + for ids in registry.iter('ids'): + if 'vendor' == ids.attrib['type']: + for an_id in ids.iter('id'): + value = an_id.attrib['value'] + vendor = an_id.attrib['vendor'] + if 'tool' in an_id.attrib: + tool = an_id.attrib['tool'] + vendor_tool = vendor + ' ' + tool + else: + tool = '' + vendor_tool = vendor + line = '{' + '{}, "{}", "{}", "{}"'.format(value, + vendor, + tool, + vendor_tool) + '},' + lines.append(line) + return '\n'.join(lines) + + +def main(): + import argparse + parser = argparse.ArgumentParser(description= + 'Generate tables from SPIR-V XML registry') + parser.add_argument('--xml', metavar='', + type=str, required=True, + help='SPIR-V XML Registry file') + parser.add_argument('--generator-output', metavar='', + type=str, required=True, + help='output file for SPIR-V generators table') + args = parser.parse_args() + + with open(args.xml) as xml_in: + registry = xml.etree.ElementTree.fromstring(xml_in.read()) + + distutils.dir_util.mkpath(os.path.dirname(args.generator_output)) + print(generate_vendor_table(registry), file=open(args.generator_output, 'w')) + + +if __name__ == '__main__': + main() diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/utils/generate_vim_syntax.py vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/utils/generate_vim_syntax.py --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/utils/generate_vim_syntax.py 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/utils/generate_vim_syntax.py 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,207 @@ +#!/usr/bin/env python +# Copyright (c) 2016 Google 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. +"""Generates Vim syntax rules for SPIR-V assembly (.spvasm) files""" + +from __future__ import print_function + +import json + +PREAMBLE="""" Vim syntax file +" Language: spvasm +" Generated by SPIRV-Tools + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +syn case match +""" + +POSTAMBLE=""" + +syntax keyword spvasmTodo TODO FIXME contained + +syn match spvasmIdNumber /%\d\+\>/ + +" The assembler treats the leading minus sign as part of the number token. +" This applies to integers, and to floats below. +syn match spvasmNumber /-\?\<\d\+\>/ + +" Floating point literals. +" In general, C++ requires at least digit in the mantissa, and the +" floating point is optional. This applies to both the regular decimal float +" case and the hex float case. + +" First case: digits before the optional decimal, no trailing digits. +syn match spvasmFloat /-\?\d\+\.\?\(e[+-]\d\+\)\?/ +" Second case: optional digits before decimal, trailing digits +syn match spvasmFloat /-\?\d*\.\d\+\(e[+-]\d\+\)\?/ + +" First case: hex digits before the optional decimal, no trailing hex digits. +syn match spvasmFloat /-\?0[xX]\\x\+\.\?p[-+]\d\+/ +" Second case: optional hex digits before decimal, trailing hex digits +syn match spvasmFloat /-\?0[xX]\\x*\.\\x\+p[-+]\d\+/ + +syn match spvasmComment /;.*$/ contains=spvasmTodo +syn region spvasmString start=/"/ skip=/\\\\"/ end=/"/ +syn match spvasmId /%[a-zA-Z_][a-zA-Z_0-9]*/ + +" Highlight unknown constants and statements as errors +syn match spvasmError /[a-zA-Z][a-zA-Z_0-9]*/ + + +if version >= 508 || !exists("did_c_syn_inits") + if version < 508 + let did_c_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + HiLink spvasmStatement Statement + HiLink spvasmNumber Number + HiLink spvasmComment Comment + HiLink spvasmString String + HiLink spvasmFloat Float + HiLink spvasmConstant Constant + HiLink spvasmIdNumber Identifier + HiLink spvasmId Identifier + HiLink spvasmTodo Todo + + delcommand HiLink +endif + +let b:current_syntax = "spvasm" +""" + +# This list is taken from the description of OpSpecConstantOp in SPIR-V 1.1. +# TODO(dneto): Propose that this information be embedded in the grammar file. +SPEC_CONSTANT_OP_OPCODES = """ + OpSConvert, OpFConvert + OpSNegate, OpNot + OpIAdd, OpISub + OpIMul, OpUDiv, OpSDiv, OpUMod, OpSRem, OpSMod + OpShiftRightLogical, OpShiftRightArithmetic, OpShiftLeftLogical + OpBitwiseOr, OpBitwiseXor, OpBitwiseAnd + OpVectorShuffle, OpCompositeExtract, OpCompositeInsert + OpLogicalOr, OpLogicalAnd, OpLogicalNot, + OpLogicalEqual, OpLogicalNotEqual + OpSelect + OpIEqual, OpINotEqual + OpULessThan, OpSLessThan + OpUGreaterThan, OpSGreaterThan + OpULessThanEqual, OpSLessThanEqual + OpUGreaterThanEqual, OpSGreaterThanEqual + + OpQuantizeToF16 + + OpConvertFToS, OpConvertSToF + OpConvertFToU, OpConvertUToF + OpUConvert + OpConvertPtrToU, OpConvertUToPtr + OpGenericCastToPtr, OpPtrCastToGeneric + OpBitcast + OpFNegate + OpFAdd, OpFSub + OpFMul, OpFDiv + OpFRem, OpFMod + OpAccessChain, OpInBoundsAccessChain + OpPtrAccessChain, OpInBoundsPtrAccessChain""" + + +def EmitAsStatement(name): + """Emits the given name as a statement token""" + print('syn keyword spvasmStatement', name) + + +def EmitAsEnumerant(name): + """Emits the given name as an named operand token""" + print('syn keyword spvasmConstant', name) + + +def main(): + """Parses arguments, then generates the Vim syntax rules for SPIR-V assembly + on stdout.""" + import argparse + parser = argparse.ArgumentParser(description='Generate SPIR-V info tables') + parser.add_argument('--spirv-core-grammar', metavar='', + type=str, required=True, + help='input JSON grammar file for core SPIR-V ' + 'instructions') + parser.add_argument('--extinst-glsl-grammar', metavar='', + type=str, required=False, default=None, + help='input JSON grammar file for GLSL extended ' + 'instruction set') + parser.add_argument('--extinst-opencl-grammar', metavar='', + type=str, required=False, default=None, + help='input JSON grammar file for OpenGL extended ' + 'instruction set') + parser.add_argument('--extinst-debuginfo-grammar', metavar='', + type=str, required=False, default=None, + help='input JSON grammar file for DebugInfo extended ' + 'instruction set') + args = parser.parse_args() + + # Generate the syntax rules. + print(PREAMBLE) + + core = json.loads(open(args.spirv_core_grammar).read()) + print('\n" Core instructions') + for inst in core["instructions"]: + EmitAsStatement(inst['opname']) + print('\n" Core operand enums') + for operand_kind in core["operand_kinds"]: + if 'enumerants' in operand_kind: + for e in operand_kind['enumerants']: + EmitAsEnumerant(e['enumerant']) + + if args.extinst_glsl_grammar is not None: + print('\n" GLSL.std.450 extended instructions') + glsl = json.loads(open(args.extinst_glsl_grammar).read()) + # These opcodes are really enumerant operands for the OpExtInst + # instruction. + for inst in glsl["instructions"]: + EmitAsEnumerant(inst['opname']) + + if args.extinst_opencl_grammar is not None: + print('\n" OpenCL.std extended instructions') + opencl = json.loads(open(args.extinst_opencl_grammar).read()) + for inst in opencl["instructions"]: + EmitAsEnumerant(inst['opname']) + + if args.extinst_debuginfo_grammar is not None: + print('\n" DebugInfo extended instructions') + debuginfo = json.loads(open(args.extinst_debuginfo_grammar).read()) + for inst in debuginfo["instructions"]: + EmitAsEnumerant(inst['opname']) + print('\n" DebugInfo operand enums') + for operand_kind in debuginfo["operand_kinds"]: + if 'enumerants' in operand_kind: + for e in operand_kind['enumerants']: + EmitAsEnumerant(e['enumerant']) + + print('\n" OpSpecConstantOp opcodes') + for word in SPEC_CONSTANT_OP_OPCODES.split(' '): + stripped = word.strip('\n,') + if stripped != "": + # Treat as an enumerant, but without the leading "Op" + EmitAsEnumerant(stripped[2:]) + print(POSTAMBLE) + + +if __name__ == '__main__': + main() diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/utils/update_build_version.py vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/utils/update_build_version.py --- vulkan-1.0.65.2+dfsg1/external/glslang/External/spirv-tools/utils/update_build_version.py 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/External/spirv-tools/utils/update_build_version.py 2018-04-27 11:46:32.000000000 +0000 @@ -0,0 +1,150 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 Google 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. + +# Updates an output file with version info unless the new content is the same +# as the existing content. +# +# Args: +# +# The output file will contain a line of text consisting of two C source syntax +# string literals separated by a comma: +# - The software version deduced from the CHANGES file in the given directory. +# - A longer string with the project name, the software version number, and +# git commit information for the directory. The commit information +# is the output of "git describe" if that succeeds, or "git rev-parse HEAD" +# if that succeeds, or otherwise a message containing the phrase +# "unknown hash". +# The string contents are escaped as necessary. + +from __future__ import print_function + +import datetime +import errno +import os +import os.path +import re +import subprocess +import sys +import time + + +def mkdir_p(directory): + """Make the directory, and all its ancestors as required. Any of the + directories are allowed to already exist.""" + + if directory == "": + # We're being asked to make the current directory. + return + + try: + os.makedirs(directory) + except OSError as e: + if e.errno == errno.EEXIST and os.path.isdir(directory): + pass + else: + raise + + +def command_output(cmd, directory): + """Runs a command in a directory and returns its standard output stream. + + Captures the standard error stream. + + Raises a RuntimeError if the command fails to launch or otherwise fails. + """ + p = subprocess.Popen(cmd, + cwd=directory, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + (stdout, _) = p.communicate() + if p.returncode != 0: + raise RuntimeError('Failed to run %s in %s' % (cmd, directory)) + return stdout + + +def deduce_software_version(directory): + """Returns a software version number parsed from the CHANGES file + in the given directory. + + The CHANGES file describes most recent versions first. + """ + + # Match the first well-formed version-and-date line. + # Allow trailing whitespace in the checked-out source code has + # unexpected carriage returns on a linefeed-only system such as + # Linux. + pattern = re.compile(r'^(v\d+\.\d+(-dev)?) \d\d\d\d-\d\d-\d\d\s*$') + changes_file = os.path.join(directory, 'CHANGES') + with open(changes_file, mode='rU') as f: + for line in f.readlines(): + match = pattern.match(line) + if match: + return match.group(1) + raise Exception('No version number found in {}'.format(changes_file)) + + +def describe(directory): + """Returns a string describing the current Git HEAD version as descriptively + as possible. + + Runs 'git describe', or alternately 'git rev-parse HEAD', in directory. If + successful, returns the output; otherwise returns 'unknown hash, '.""" + try: + # decode() is needed here for Python3 compatibility. In Python2, + # str and bytes are the same type, but not in Python3. + # Popen.communicate() returns a bytes instance, which needs to be + # decoded into text data first in Python3. And this decode() won't + # hurt Python2. + return command_output(['git', 'describe'], directory).rstrip().decode() + except: + try: + return command_output( + ['git', 'rev-parse', 'HEAD'], directory).rstrip().decode() + except: + # This is the fallback case where git gives us no information, + # e.g. because the source tree might not be in a git tree. + # In this case, usually use a timestamp. However, to ensure + # reproducible builds, allow the builder to override the wall + # clock time with enviornment variable SOURCE_DATE_EPOCH + # containing a (presumably) fixed timestamp. + timestamp = int(os.environ.get('SOURCE_DATE_EPOCH', time.time())) + formatted = datetime.date.fromtimestamp(timestamp).isoformat() + return 'unknown hash, {}'.format(formatted) + + +def main(): + if len(sys.argv) != 3: + print('usage: {} '.format(sys.argv[0])) + sys.exit(1) + + output_file = sys.argv[2] + mkdir_p(os.path.dirname(output_file)) + + software_version = deduce_software_version(sys.argv[1]) + new_content = '"{}", "SPIRV-Tools {} {}"\n'.format( + software_version, software_version, + describe(sys.argv[1]).replace('"', '\\"')) + + if os.path.isfile(output_file): + with open(output_file, 'r') as f: + if new_content == f.read(): + return + + with open(output_file, 'w') as f: + f.write(new_content) + +if __name__ == '__main__': + main() diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/.gitattributes vulkan-1.1.73+dfsg/external/glslang/.gitattributes --- vulkan-1.0.65.2+dfsg1/external/glslang/.gitattributes 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/.gitattributes 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -# test files have a mix of lf/crlf, and that's a good thing, for testing, don't mess with it -# bash scripts need lines ending with lf, and that's correct for Windows too, e.g., under Cygwin -# (scripts often don't have a suffix) -* -text -*.sh text eof=lf - -# txt files should be native and normalized -*.txt text - -# source code can be native and normalized, but simpler if lf everywhere; will try that way -*.h text eof=lf -*.c text eof=lf -*.cpp text eof=lf -*.y text eof=lf -*.out text eof=lf -*.conf text eof=lf -*.err text eof=lf diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/glslang/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/CMakeLists.txt 2018-04-27 11:46:26.000000000 +0000 @@ -9,6 +9,7 @@ set(SOURCES MachineIndependent/glslang.y MachineIndependent/glslang_tab.cpp + MachineIndependent/attribute.cpp MachineIndependent/Constant.cpp MachineIndependent/iomapper.cpp MachineIndependent/InfoSink.cpp @@ -51,6 +52,7 @@ Include/revision.h Include/ShHandle.h Include/Types.h + MachineIndependent/attribute.h MachineIndependent/glslang_tab.cpp.h MachineIndependent/gl_types.h MachineIndependent/Initialize.h @@ -78,10 +80,15 @@ # WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) # set(BISON_GLSLParser_OUTPUT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp) -add_library(glslang STATIC ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${HEADERS}) +add_library(glslang ${LIB_TYPE} ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${HEADERS}) set_property(TARGET glslang PROPERTY FOLDER glslang) set_property(TARGET glslang PROPERTY POSITION_INDEPENDENT_CODE ON) target_link_libraries(glslang OGLCompiler OSDependent) + +if(WIN32 AND BUILD_SHARED_LIBS) + set_target_properties(glslang PROPERTIES PREFIX "") +endif() + if(ENABLE_HLSL) target_link_libraries(glslang HLSL) endif() diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/arrays.h vulkan-1.1.73+dfsg/external/glslang/glslang/Include/arrays.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/arrays.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/Include/arrays.h 2018-04-27 11:46:26.000000000 +0000 @@ -41,6 +41,8 @@ #ifndef _ARRAYS_INCLUDED #define _ARRAYS_INCLUDED +#include + namespace glslang { // This is used to mean there is no size yet (unsized), it is waiting to get a size from somewhere else. @@ -130,10 +132,10 @@ sizes->push_back(pair); } - void push_front(const TSmallArrayVector& newDims) + void push_back(const TSmallArrayVector& newDims) { alloc(); - sizes->insert(sizes->begin(), newDims.sizes->begin(), newDims.sizes->end()); + sizes->insert(sizes->end(), newDims.sizes->begin(), newDims.sizes->end()); } void pop_front() @@ -220,12 +222,13 @@ struct TArraySizes { POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) - TArraySizes() : implicitArraySize(1) { } + TArraySizes() : implicitArraySize(1), variablyIndexed(false) { } // For breaking into two non-shared copies, independently modifiable. TArraySizes& operator=(const TArraySizes& from) { implicitArraySize = from.implicitArraySize; + variablyIndexed = from.variablyIndexed; sizes = from.sizes; return *this; @@ -252,10 +255,11 @@ void addInnerSize(int s) { addInnerSize((unsigned)s, nullptr); } void addInnerSize(int s, TIntermTyped* n) { sizes.push_back((unsigned)s, n); } void addInnerSize(TArraySize pair) { sizes.push_back(pair.size, pair.node); } + void addInnerSizes(const TArraySizes& s) { sizes.push_back(s.sizes); } void changeOuterSize(int s) { sizes.changeFront((unsigned)s); } - int getImplicitSize() const { return (int)implicitArraySize; } - void setImplicitSize(int s) { implicitArraySize = s; } - bool isInnerImplicit() const + int getImplicitSize() const { return implicitArraySize; } + void updateImplicitSize(int s) { implicitArraySize = std::max(implicitArraySize, s); } + bool isInnerUnsized() const { for (int d = 1; d < sizes.size(); ++d) { if (sizes.getDimSize(d) == (unsigned)UnsizedArraySize) @@ -264,6 +268,15 @@ return false; } + bool clearInnerUnsized() + { + for (int d = 1; d < sizes.size(); ++d) { + if (sizes.getDimSize(d) == (unsigned)UnsizedArraySize) + setDimSize(d, 1); + } + + return false; + } bool isInnerSpecialization() const { for (int d = 1; d < sizes.size(); ++d) { @@ -278,8 +291,8 @@ return sizes.getDimNode(0) != nullptr; } - bool isImplicit() const { return getOuterSize() == UnsizedArraySize || isInnerImplicit(); } - void addOuterSizes(const TArraySizes& s) { sizes.push_front(s.sizes); } + bool hasUnsized() const { return getOuterSize() == UnsizedArraySize || isInnerUnsized(); } + bool isSized() const { return getOuterSize() != UnsizedArraySize; } void dereference() { sizes.pop_front(); } void copyDereferenced(const TArraySizes& rhs) { @@ -302,6 +315,9 @@ return true; } + void setVariablyIndexed() { variablyIndexed = true; } + bool isVariablyIndexed() const { return variablyIndexed; } + bool operator==(const TArraySizes& rhs) { return sizes == rhs.sizes; } bool operator!=(const TArraySizes& rhs) { return sizes != rhs.sizes; } @@ -310,9 +326,12 @@ TArraySizes(const TArraySizes&); - // for tracking maximum referenced index, before an explicit size is given - // applies only to the outer-most dimension + // For tracking maximum referenced compile-time constant index. + // Applies only to the outer-most dimension. Potentially becomes + // the implicit size of the array, if not variably indexed and + // otherwise legal. int implicitArraySize; + bool variablyIndexed; // true if array is indexed with a non compile-time constant }; } // end namespace glslang diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/BaseTypes.h vulkan-1.1.73+dfsg/external/glslang/glslang/Include/BaseTypes.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/BaseTypes.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/Include/BaseTypes.h 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -46,17 +47,15 @@ EbtVoid, EbtFloat, EbtDouble, -#ifdef AMD_EXTENSIONS EbtFloat16, -#endif + EbtInt8, + EbtUint8, + EbtInt16, + EbtUint16, EbtInt, EbtUint, EbtInt64, EbtUint64, -#ifdef AMD_EXTENSIONS - EbtInt16, - EbtUint16, -#endif EbtBool, EbtAtomicUint, EbtSampler, @@ -141,6 +140,8 @@ EbvLocalInvocationId, EbvGlobalInvocationId, EbvLocalInvocationIndex, + EbvNumSubgroups, + EbvSubgroupID, EbvSubGroupSize, EbvSubGroupInvocation, EbvSubGroupEqMask, @@ -148,6 +149,13 @@ EbvSubGroupGtMask, EbvSubGroupLeMask, EbvSubGroupLtMask, + EbvSubgroupSize2, + EbvSubgroupInvocation2, + EbvSubgroupEqMask2, + EbvSubgroupGeMask2, + EbvSubgroupGtMask2, + EbvSubgroupLeMask2, + EbvSubgroupLtMask2, EbvVertexId, EbvInstanceId, EbvVertexIndex, @@ -218,6 +226,7 @@ EbvSecondaryViewportMaskNV, EbvPositionPerViewNV, EbvViewportMaskPerViewNV, + EbvFragFullyCoveredNV, #endif // HLSL built-ins that live only temporarily, until they get remapped @@ -355,6 +364,7 @@ case EbvSecondaryViewportMaskNV: return "SecondaryViewportMaskNV"; case EbvPositionPerViewNV: return "PositionPerViewNV"; case EbvViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; + case EbvFragFullyCoveredNV: return "FragFullyCoveredNV"; #endif default: return "unknown built-in variable"; } @@ -371,7 +381,7 @@ __inline const char* GetPrecisionQualifierString(TPrecisionQualifier p) { - switch(p) { + switch (p) { case EpqNone: return ""; break; case EpqLow: return "lowp"; break; case EpqMedium: return "mediump"; break; @@ -380,6 +390,75 @@ } } +__inline bool isTypeSignedInt(TBasicType type) +{ + switch (type) { + case EbtInt8: + case EbtInt16: + case EbtInt: + case EbtInt64: + return true; + default: + return false; + } +} + +__inline bool isTypeUnsignedInt(TBasicType type) +{ + switch (type) { + case EbtUint8: + case EbtUint16: + case EbtUint: + case EbtUint64: + return true; + default: + return false; + } +} + +__inline bool isTypeInt(TBasicType type) +{ + return isTypeSignedInt(type) || isTypeUnsignedInt(type); +} + +__inline bool isTypeFloat(TBasicType type) +{ + switch (type) { + case EbtFloat: + case EbtDouble: + case EbtFloat16: + return true; + default: + return false; + } +} + +__inline int getTypeRank(TBasicType type) { + int res = -1; + switch(type) { + case EbtInt8: + case EbtUint8: + res = 0; + break; + case EbtInt16: + case EbtUint16: + res = 1; + break; + case EbtInt: + case EbtUint: + res = 2; + break; + case EbtInt64: + case EbtUint64: + res = 3; + break; + default: + assert(false); + break; + } + return res; +} + } // end namespace glslang #endif // _BASICTYPES_INCLUDED_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/Common.h vulkan-1.1.73+dfsg/external/glslang/glslang/Include/Common.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/Common.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/Include/Common.h 2018-04-27 11:46:26.000000000 +0000 @@ -37,9 +37,24 @@ #ifndef _COMMON_INCLUDED_ #define _COMMON_INCLUDED_ + +#if defined(__ANDROID__) || _MSC_VER < 1700 +#include +namespace std { +template +std::string to_string(const T& val) { + std::ostringstream os; + os << val; + return os.str(); +} +} +#endif + #if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) || defined MINGW_HAS_SECURE_API #include + #ifndef snprintf #define snprintf sprintf_s + #endif #define safe_vsprintf(buf,max,format,args) vsnprintf_s((buf), (max), (max), (format), (args)) #elif defined (solaris) #define safe_vsprintf(buf,max,format,args) vsnprintf((buf), (max), (format), (args)) @@ -51,31 +66,20 @@ #define UINT_PTR uintptr_t #endif -#if defined(__ANDROID__) || _MSC_VER < 1700 -#include -namespace std { -template -std::string to_string(const T& val) { - std::ostringstream os; - os << val; - return os.str(); -} -} -#endif - #if defined(_MSC_VER) && _MSC_VER < 1800 -inline long long int strtoll (const char* str, char** endptr, int base) -{ - return _strtoi64(str, endptr, base); -} -inline unsigned long long int strtoull (const char* str, char** endptr, int base) -{ - return _strtoui64(str, endptr, base); -} -inline long long int atoll (const char* str) -{ - return strtoll(str, NULL, 10); -} + #include + inline long long int strtoll (const char* str, char** endptr, int base) + { + return _strtoi64(str, endptr, base); + } + inline unsigned long long int strtoull (const char* str, char** endptr, int base) + { + return _strtoui64(str, endptr, base); + } + inline long long int atoll (const char* str) + { + return strtoll(str, NULL, 10); + } #endif #if defined(_MSC_VER) @@ -155,7 +159,7 @@ return new(memory) TString(s); } -template inline T* NewPoolObject(T) +template inline T* NewPoolObject(T*) { return new(GetThreadPoolAllocator().allocate(sizeof(T))) T; } @@ -240,7 +244,10 @@ int column; }; -typedef TMap TPragmaTable; +class TPragmaTable : public TMap { +public: + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) +}; const int MaxTokenLength = 1024; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/ConstantUnion.h vulkan-1.1.73+dfsg/external/glslang/glslang/Include/ConstantUnion.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/ConstantUnion.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/Include/ConstantUnion.h 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -37,6 +38,9 @@ #ifndef _CONSTANT_UNION_INCLUDED_ #define _CONSTANT_UNION_INCLUDED_ +#include "../Include/Common.h" +#include "../Include/BaseTypes.h" + namespace glslang { class TConstUnion { @@ -45,6 +49,30 @@ TConstUnion() : iConst(0), type(EbtInt) { } + void setI8Const(signed char i) + { + i8Const = i; + type = EbtInt8; + } + + void setU8Const(unsigned char u) + { + u8Const = u; + type = EbtUint8; + } + + void setI16Const(signed short i) + { + i16Const = i; + type = EbtInt16; + } + + void setU16Const(unsigned short u) + { + u16Const = u; + type = EbtUint16; + } + void setIConst(int i) { iConst = i; @@ -87,6 +115,10 @@ type = EbtString; } + signed char getI8Const() const { return i8Const; } + unsigned char getU8Const() const { return u8Const; } + signed short getI16Const() const { return i16Const; } + unsigned short getU16Const() const { return u16Const; } int getIConst() const { return iConst; } unsigned int getUConst() const { return uConst; } long long getI64Const() const { return i64Const; } @@ -95,6 +127,38 @@ bool getBConst() const { return bConst; } const TString* getSConst() const { return sConst; } + bool operator==(const signed char i) const + { + if (i == i8Const) + return true; + + return false; + } + + bool operator==(const unsigned char u) const + { + if (u == u8Const) + return true; + + return false; + } + + bool operator==(const signed short i) const + { + if (i == i16Const) + return true; + + return false; + } + + bool operator==(const unsigned short u) const + { + if (u == u16Const) + return true; + + return false; + } + bool operator==(const int i) const { if (i == iConst) @@ -149,6 +213,26 @@ return false; switch (type) { + case EbtInt16: + if (constant.i16Const == i16Const) + return true; + + break; + case EbtUint16: + if (constant.u16Const == u16Const) + return true; + + break; + case EbtInt8: + if (constant.i8Const == i8Const) + return true; + + break; + case EbtUint8: + if (constant.u8Const == u8Const) + return true; + + break; case EbtInt: if (constant.iConst == iConst) return true; @@ -186,6 +270,26 @@ return false; } + bool operator!=(const signed char i) const + { + return !operator==(i); + } + + bool operator!=(const unsigned char u) const + { + return !operator==(u); + } + + bool operator!=(const signed short i) const + { + return !operator==(i); + } + + bool operator!=(const unsigned short u) const + { + return !operator==(u); + } + bool operator!=(const int i) const { return !operator==(i); @@ -225,6 +329,26 @@ { assert(type == constant.type); switch (type) { + case EbtInt8: + if (i8Const > constant.i8Const) + return true; + + return false; + case EbtUint8: + if (u8Const > constant.u8Const) + return true; + + return false; + case EbtInt16: + if (i16Const > constant.i16Const) + return true; + + return false; + case EbtUint16: + if (u16Const > constant.u16Const) + return true; + + return false; case EbtInt: if (iConst > constant.iConst) return true; @@ -260,6 +384,26 @@ { assert(type == constant.type); switch (type) { + case EbtInt8: + if (i8Const < constant.i8Const) + return true; + + return false; + case EbtUint8: + if (u8Const < constant.u8Const) + return true; + + return false; + case EbtInt16: + if (i16Const < constant.i16Const) + return true; + + return false; + case EbtUint16: + if (u16Const < constant.u16Const) + return true; + + return false; case EbtInt: if (iConst < constant.iConst) return true; @@ -296,9 +440,13 @@ TConstUnion returnValue; assert(type == constant.type); switch (type) { - case EbtInt: returnValue.setIConst(iConst + constant.iConst); break; - case EbtInt64: returnValue.setI64Const(i64Const + constant.i64Const); break; - case EbtUint: returnValue.setUConst(uConst + constant.uConst); break; + case EbtInt8: returnValue.setI8Const(i8Const + constant.i8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const + constant.i16Const); break; + case EbtInt: returnValue.setIConst(iConst + constant.iConst); break; + case EbtInt64: returnValue.setI64Const(i64Const + constant.i64Const); break; + case EbtUint8: returnValue.setU8Const(u8Const + constant.u8Const); break; + case EbtUint16: returnValue.setU16Const(u16Const + constant.u16Const); break; + case EbtUint: returnValue.setUConst(uConst + constant.uConst); break; case EbtUint64: returnValue.setU64Const(u64Const + constant.u64Const); break; case EbtDouble: returnValue.setDConst(dConst + constant.dConst); break; default: assert(false && "Default missing"); @@ -312,9 +460,13 @@ TConstUnion returnValue; assert(type == constant.type); switch (type) { - case EbtInt: returnValue.setIConst(iConst - constant.iConst); break; - case EbtInt64: returnValue.setI64Const(i64Const - constant.i64Const); break; - case EbtUint: returnValue.setUConst(uConst - constant.uConst); break; + case EbtInt8: returnValue.setI8Const(i8Const - constant.i8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const - constant.i16Const); break; + case EbtInt: returnValue.setIConst(iConst - constant.iConst); break; + case EbtInt64: returnValue.setI64Const(i64Const - constant.i64Const); break; + case EbtUint8: returnValue.setU8Const(u8Const - constant.u8Const); break; + case EbtUint16: returnValue.setU16Const(u16Const - constant.u16Const); break; + case EbtUint: returnValue.setUConst(uConst - constant.uConst); break; case EbtUint64: returnValue.setU64Const(u64Const - constant.u64Const); break; case EbtDouble: returnValue.setDConst(dConst - constant.dConst); break; default: assert(false && "Default missing"); @@ -328,9 +480,13 @@ TConstUnion returnValue; assert(type == constant.type); switch (type) { - case EbtInt: returnValue.setIConst(iConst * constant.iConst); break; - case EbtInt64: returnValue.setI64Const(i64Const * constant.i64Const); break; - case EbtUint: returnValue.setUConst(uConst * constant.uConst); break; + case EbtInt8: returnValue.setI8Const(i8Const * constant.i8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const * constant.i16Const); break; + case EbtInt: returnValue.setIConst(iConst * constant.iConst); break; + case EbtInt64: returnValue.setI64Const(i64Const * constant.i64Const); break; + case EbtUint8: returnValue.setU8Const(u8Const * constant.u8Const); break; + case EbtUint16: returnValue.setU16Const(u16Const * constant.u16Const); break; + case EbtUint: returnValue.setUConst(uConst * constant.uConst); break; case EbtUint64: returnValue.setU64Const(u64Const * constant.u64Const); break; case EbtDouble: returnValue.setDConst(dConst * constant.dConst); break; default: assert(false && "Default missing"); @@ -344,9 +500,13 @@ TConstUnion returnValue; assert(type == constant.type); switch (type) { - case EbtInt: returnValue.setIConst(iConst % constant.iConst); break; - case EbtInt64: returnValue.setI64Const(i64Const % constant.i64Const); break; - case EbtUint: returnValue.setUConst(uConst % constant.uConst); break; + case EbtInt8: returnValue.setI8Const(i8Const % constant.i8Const); break; + case EbtInt16: returnValue.setI8Const(i8Const % constant.i16Const); break; + case EbtInt: returnValue.setIConst(iConst % constant.iConst); break; + case EbtInt64: returnValue.setI64Const(i64Const % constant.i64Const); break; + case EbtUint8: returnValue.setU8Const(u8Const % constant.u8Const); break; + case EbtUint16: returnValue.setU16Const(u16Const % constant.u16Const); break; + case EbtUint: returnValue.setUConst(uConst % constant.uConst); break; case EbtUint64: returnValue.setU64Const(u64Const % constant.u64Const); break; default: assert(false && "Default missing"); } @@ -358,8 +518,64 @@ { TConstUnion returnValue; switch (type) { + case EbtInt8: + switch (constant.type) { + case EbtInt8: returnValue.setI8Const(i8Const >> constant.i8Const); break; + case EbtUint8: returnValue.setI8Const(i8Const >> constant.u8Const); break; + case EbtInt16: returnValue.setI8Const(i8Const >> constant.i16Const); break; + case EbtUint16: returnValue.setI8Const(i8Const >> constant.u16Const); break; + case EbtInt: returnValue.setI8Const(i8Const >> constant.iConst); break; + case EbtUint: returnValue.setI8Const(i8Const >> constant.uConst); break; + case EbtInt64: returnValue.setI8Const(i8Const >> constant.i64Const); break; + case EbtUint64: returnValue.setI8Const(i8Const >> constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtUint8: + switch (constant.type) { + case EbtInt8: returnValue.setU8Const(u8Const >> constant.i8Const); break; + case EbtUint8: returnValue.setU8Const(u8Const >> constant.u8Const); break; + case EbtInt16: returnValue.setU8Const(u8Const >> constant.i16Const); break; + case EbtUint16: returnValue.setU8Const(u8Const >> constant.u16Const); break; + case EbtInt: returnValue.setU8Const(u8Const >> constant.iConst); break; + case EbtUint: returnValue.setU8Const(u8Const >> constant.uConst); break; + case EbtInt64: returnValue.setU8Const(u8Const >> constant.i64Const); break; + case EbtUint64: returnValue.setU8Const(u8Const >> constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtInt16: + switch (constant.type) { + case EbtInt8: returnValue.setI16Const(i16Const >> constant.i8Const); break; + case EbtUint8: returnValue.setI16Const(i16Const >> constant.u8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const >> constant.i16Const); break; + case EbtUint16: returnValue.setI16Const(i16Const >> constant.u16Const); break; + case EbtInt: returnValue.setI16Const(i16Const >> constant.iConst); break; + case EbtUint: returnValue.setI16Const(i16Const >> constant.uConst); break; + case EbtInt64: returnValue.setI16Const(i16Const >> constant.i64Const); break; + case EbtUint64: returnValue.setI16Const(i16Const >> constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtUint16: + switch (constant.type) { + case EbtInt8: returnValue.setU16Const(u16Const >> constant.i8Const); break; + case EbtUint8: returnValue.setU16Const(u16Const >> constant.u8Const); break; + case EbtInt16: returnValue.setU16Const(u16Const >> constant.i16Const); break; + case EbtUint16: returnValue.setU16Const(u16Const >> constant.u16Const); break; + case EbtInt: returnValue.setU16Const(u16Const >> constant.iConst); break; + case EbtUint: returnValue.setU16Const(u16Const >> constant.uConst); break; + case EbtInt64: returnValue.setU16Const(u16Const >> constant.i64Const); break; + case EbtUint64: returnValue.setU16Const(u16Const >> constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; case EbtInt: switch (constant.type) { + case EbtInt8: returnValue.setIConst(iConst >> constant.i8Const); break; + case EbtUint8: returnValue.setIConst(iConst >> constant.u8Const); break; + case EbtInt16: returnValue.setIConst(iConst >> constant.i16Const); break; + case EbtUint16: returnValue.setIConst(iConst >> constant.u16Const); break; case EbtInt: returnValue.setIConst(iConst >> constant.iConst); break; case EbtUint: returnValue.setIConst(iConst >> constant.uConst); break; case EbtInt64: returnValue.setIConst(iConst >> constant.i64Const); break; @@ -369,6 +585,10 @@ break; case EbtUint: switch (constant.type) { + case EbtInt8: returnValue.setUConst(uConst >> constant.i8Const); break; + case EbtUint8: returnValue.setUConst(uConst >> constant.u8Const); break; + case EbtInt16: returnValue.setUConst(uConst >> constant.i16Const); break; + case EbtUint16: returnValue.setUConst(uConst >> constant.u16Const); break; case EbtInt: returnValue.setUConst(uConst >> constant.iConst); break; case EbtUint: returnValue.setUConst(uConst >> constant.uConst); break; case EbtInt64: returnValue.setUConst(uConst >> constant.i64Const); break; @@ -378,6 +598,10 @@ break; case EbtInt64: switch (constant.type) { + case EbtInt8: returnValue.setI64Const(i64Const >> constant.i8Const); break; + case EbtUint8: returnValue.setI64Const(i64Const >> constant.u8Const); break; + case EbtInt16: returnValue.setI64Const(i64Const >> constant.i16Const); break; + case EbtUint16: returnValue.setI64Const(i64Const >> constant.u16Const); break; case EbtInt: returnValue.setI64Const(i64Const >> constant.iConst); break; case EbtUint: returnValue.setI64Const(i64Const >> constant.uConst); break; case EbtInt64: returnValue.setI64Const(i64Const >> constant.i64Const); break; @@ -387,6 +611,10 @@ break; case EbtUint64: switch (constant.type) { + case EbtInt8: returnValue.setU64Const(u64Const >> constant.i8Const); break; + case EbtUint8: returnValue.setU64Const(u64Const >> constant.u8Const); break; + case EbtInt16: returnValue.setU64Const(u64Const >> constant.i16Const); break; + case EbtUint16: returnValue.setU64Const(u64Const >> constant.u16Const); break; case EbtInt: returnValue.setU64Const(u64Const >> constant.iConst); break; case EbtUint: returnValue.setU64Const(u64Const >> constant.uConst); break; case EbtInt64: returnValue.setU64Const(u64Const >> constant.i64Const); break; @@ -404,8 +632,64 @@ { TConstUnion returnValue; switch (type) { + case EbtInt8: + switch (constant.type) { + case EbtInt8: returnValue.setI8Const(i8Const << constant.i8Const); break; + case EbtUint8: returnValue.setI8Const(i8Const << constant.u8Const); break; + case EbtInt16: returnValue.setI8Const(i8Const << constant.i16Const); break; + case EbtUint16: returnValue.setI8Const(i8Const << constant.u16Const); break; + case EbtInt: returnValue.setI8Const(i8Const << constant.iConst); break; + case EbtUint: returnValue.setI8Const(i8Const << constant.uConst); break; + case EbtInt64: returnValue.setI8Const(i8Const << constant.i64Const); break; + case EbtUint64: returnValue.setI8Const(i8Const << constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtUint8: + switch (constant.type) { + case EbtInt8: returnValue.setU8Const(u8Const << constant.i8Const); break; + case EbtUint8: returnValue.setU8Const(u8Const << constant.u8Const); break; + case EbtInt16: returnValue.setU8Const(u8Const << constant.i16Const); break; + case EbtUint16: returnValue.setU8Const(u8Const << constant.u16Const); break; + case EbtInt: returnValue.setU8Const(u8Const << constant.iConst); break; + case EbtUint: returnValue.setU8Const(u8Const << constant.uConst); break; + case EbtInt64: returnValue.setU8Const(u8Const << constant.i64Const); break; + case EbtUint64: returnValue.setU8Const(u8Const << constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtInt16: + switch (constant.type) { + case EbtInt8: returnValue.setI16Const(i16Const << constant.i8Const); break; + case EbtUint8: returnValue.setI16Const(i16Const << constant.u8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const << constant.i16Const); break; + case EbtUint16: returnValue.setI16Const(i16Const << constant.u16Const); break; + case EbtInt: returnValue.setI16Const(i16Const << constant.iConst); break; + case EbtUint: returnValue.setI16Const(i16Const << constant.uConst); break; + case EbtInt64: returnValue.setI16Const(i16Const << constant.i64Const); break; + case EbtUint64: returnValue.setI16Const(i16Const << constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtUint16: + switch (constant.type) { + case EbtInt8: returnValue.setU16Const(u16Const << constant.i8Const); break; + case EbtUint8: returnValue.setU16Const(u16Const << constant.u8Const); break; + case EbtInt16: returnValue.setU16Const(u16Const << constant.i16Const); break; + case EbtUint16: returnValue.setU16Const(u16Const << constant.u16Const); break; + case EbtInt: returnValue.setU16Const(u16Const << constant.iConst); break; + case EbtUint: returnValue.setU16Const(u16Const << constant.uConst); break; + case EbtInt64: returnValue.setU16Const(u16Const << constant.i64Const); break; + case EbtUint64: returnValue.setU16Const(u16Const << constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; case EbtInt: switch (constant.type) { + case EbtInt8: returnValue.setIConst(iConst << constant.i8Const); break; + case EbtUint8: returnValue.setIConst(iConst << constant.u8Const); break; + case EbtInt16: returnValue.setIConst(iConst << constant.i16Const); break; + case EbtUint16: returnValue.setIConst(iConst << constant.u16Const); break; case EbtInt: returnValue.setIConst(iConst << constant.iConst); break; case EbtUint: returnValue.setIConst(iConst << constant.uConst); break; case EbtInt64: returnValue.setIConst(iConst << constant.i64Const); break; @@ -415,6 +699,10 @@ break; case EbtUint: switch (constant.type) { + case EbtInt8: returnValue.setUConst(uConst << constant.i8Const); break; + case EbtUint8: returnValue.setUConst(uConst << constant.u8Const); break; + case EbtInt16: returnValue.setUConst(uConst << constant.i16Const); break; + case EbtUint16: returnValue.setUConst(uConst << constant.u16Const); break; case EbtInt: returnValue.setUConst(uConst << constant.iConst); break; case EbtUint: returnValue.setUConst(uConst << constant.uConst); break; case EbtInt64: returnValue.setUConst(uConst << constant.i64Const); break; @@ -422,8 +710,12 @@ default: assert(false && "Default missing"); } break; - case EbtInt64: + case EbtInt64: switch (constant.type) { + case EbtInt8: returnValue.setI64Const(i64Const << constant.i8Const); break; + case EbtUint8: returnValue.setI64Const(i64Const << constant.u8Const); break; + case EbtInt16: returnValue.setI64Const(i64Const << constant.i16Const); break; + case EbtUint16: returnValue.setI64Const(i64Const << constant.u16Const); break; case EbtInt: returnValue.setI64Const(i64Const << constant.iConst); break; case EbtUint: returnValue.setI64Const(i64Const << constant.uConst); break; case EbtInt64: returnValue.setI64Const(i64Const << constant.i64Const); break; @@ -433,6 +725,10 @@ break; case EbtUint64: switch (constant.type) { + case EbtInt8: returnValue.setU64Const(u64Const << constant.i8Const); break; + case EbtUint8: returnValue.setU64Const(u64Const << constant.u8Const); break; + case EbtInt16: returnValue.setU64Const(u64Const << constant.i16Const); break; + case EbtUint16: returnValue.setU64Const(u64Const << constant.u16Const); break; case EbtInt: returnValue.setU64Const(u64Const << constant.iConst); break; case EbtUint: returnValue.setU64Const(u64Const << constant.uConst); break; case EbtInt64: returnValue.setU64Const(u64Const << constant.i64Const); break; @@ -451,8 +747,12 @@ TConstUnion returnValue; assert(type == constant.type); switch (type) { - case EbtInt: returnValue.setIConst(iConst & constant.iConst); break; - case EbtUint: returnValue.setUConst(uConst & constant.uConst); break; + case EbtInt8: returnValue.setI8Const(i8Const & constant.i8Const); break; + case EbtUint8: returnValue.setU8Const(u8Const & constant.u8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const & constant.i16Const); break; + case EbtUint16: returnValue.setU16Const(u16Const & constant.u16Const); break; + case EbtInt: returnValue.setIConst(iConst & constant.iConst); break; + case EbtUint: returnValue.setUConst(uConst & constant.uConst); break; case EbtInt64: returnValue.setI64Const(i64Const & constant.i64Const); break; case EbtUint64: returnValue.setU64Const(u64Const & constant.u64Const); break; default: assert(false && "Default missing"); @@ -466,8 +766,12 @@ TConstUnion returnValue; assert(type == constant.type); switch (type) { - case EbtInt: returnValue.setIConst(iConst | constant.iConst); break; - case EbtUint: returnValue.setUConst(uConst | constant.uConst); break; + case EbtInt8: returnValue.setI8Const(i8Const | constant.i8Const); break; + case EbtUint8: returnValue.setU8Const(u8Const | constant.u8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const | constant.i16Const); break; + case EbtUint16: returnValue.setU16Const(u16Const | constant.u16Const); break; + case EbtInt: returnValue.setIConst(iConst | constant.iConst); break; + case EbtUint: returnValue.setUConst(uConst | constant.uConst); break; case EbtInt64: returnValue.setI64Const(i64Const | constant.i64Const); break; case EbtUint64: returnValue.setU64Const(u64Const | constant.u64Const); break; default: assert(false && "Default missing"); @@ -481,8 +785,12 @@ TConstUnion returnValue; assert(type == constant.type); switch (type) { - case EbtInt: returnValue.setIConst(iConst ^ constant.iConst); break; - case EbtUint: returnValue.setUConst(uConst ^ constant.uConst); break; + case EbtInt8: returnValue.setI8Const(i8Const ^ constant.i8Const); break; + case EbtUint8: returnValue.setU8Const(u8Const ^ constant.u8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const ^ constant.i16Const); break; + case EbtUint16: returnValue.setU16Const(u16Const ^ constant.u16Const); break; + case EbtInt: returnValue.setIConst(iConst ^ constant.iConst); break; + case EbtUint: returnValue.setUConst(uConst ^ constant.uConst); break; case EbtInt64: returnValue.setI64Const(i64Const ^ constant.i64Const); break; case EbtUint64: returnValue.setU64Const(u64Const ^ constant.u64Const); break; default: assert(false && "Default missing"); @@ -495,8 +803,12 @@ { TConstUnion returnValue; switch (type) { - case EbtInt: returnValue.setIConst(~iConst); break; - case EbtUint: returnValue.setUConst(~uConst); break; + case EbtInt8: returnValue.setI8Const(~i8Const); break; + case EbtUint8: returnValue.setU8Const(~u8Const); break; + case EbtInt16: returnValue.setI16Const(~i16Const); break; + case EbtUint16: returnValue.setU16Const(~u16Const); break; + case EbtInt: returnValue.setIConst(~iConst); break; + case EbtUint: returnValue.setUConst(~uConst); break; case EbtInt64: returnValue.setI64Const(~i64Const); break; case EbtUint64: returnValue.setU64Const(~u64Const); break; default: assert(false && "Default missing"); @@ -533,6 +845,10 @@ private: union { + signed char i8Const; // used for i8vec, scalar int8s + unsigned char u8Const; // used for u8vec, scalar uint8s + signed short i16Const; // used for i16vec, scalar int16s + unsigned short u16Const; // used for u16vec, scalar uint16s int iConst; // used for ivec, scalar ints unsigned int uConst; // used for uvec, scalar uints long long i64Const; // used for i64vec, scalar int64s @@ -594,9 +910,6 @@ if (! unionArray || ! rhs.unionArray) return false; - - if (! unionArray || ! rhs.unionArray) - return false; return *unionArray == *rhs.unionArray; } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/InitializeGlobals.h vulkan-1.1.73+dfsg/external/glslang/glslang/Include/InitializeGlobals.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/InitializeGlobals.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/Include/InitializeGlobals.h 2018-04-27 11:46:26.000000000 +0000 @@ -37,10 +37,7 @@ namespace glslang { -void InitializeMemoryPools(); -void FreeGlobalPools(); bool InitializePoolIndex(); -void FreePoolIndex(); } // end namespace glslang diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/intermediate.h vulkan-1.1.73+dfsg/external/glslang/glslang/Include/intermediate.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/intermediate.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/Include/intermediate.h 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2016 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -46,7 +47,7 @@ #ifndef __INTERMEDIATE_H #define __INTERMEDIATE_H -#if _MSC_VER >= 1900 +#if defined(_MSC_VER) && _MSC_VER >= 1900 #pragma warning(disable : 4464) // relative include path contains '..' #pragma warning(disable : 5026) // 'glslang::TIntermUnary': move constructor was implicitly defined as deleted #endif @@ -84,100 +85,189 @@ EOpPreIncrement, EOpPreDecrement, + // (u)int* -> bool + EOpConvInt8ToBool, + EOpConvUint8ToBool, + EOpConvInt16ToBool, + EOpConvUint16ToBool, EOpConvIntToBool, EOpConvUintToBool, - EOpConvFloatToBool, - EOpConvDoubleToBool, EOpConvInt64ToBool, EOpConvUint64ToBool, - EOpConvBoolToFloat, - EOpConvIntToFloat, - EOpConvUintToFloat, - EOpConvDoubleToFloat, - EOpConvInt64ToFloat, - EOpConvUint64ToFloat, - EOpConvUintToInt, - EOpConvFloatToInt, + + // float* -> bool + EOpConvFloat16ToBool, + EOpConvFloatToBool, + EOpConvDoubleToBool, + + // bool -> (u)int* + EOpConvBoolToInt8, + EOpConvBoolToUint8, + EOpConvBoolToInt16, + EOpConvBoolToUint16, EOpConvBoolToInt, - EOpConvDoubleToInt, - EOpConvInt64ToInt, - EOpConvUint64ToInt, - EOpConvIntToUint, - EOpConvFloatToUint, EOpConvBoolToUint, - EOpConvDoubleToUint, - EOpConvInt64ToUint, - EOpConvUint64ToUint, - EOpConvIntToDouble, - EOpConvUintToDouble, - EOpConvFloatToDouble, - EOpConvBoolToDouble, - EOpConvInt64ToDouble, - EOpConvUint64ToDouble, EOpConvBoolToInt64, - EOpConvIntToInt64, - EOpConvUintToInt64, - EOpConvFloatToInt64, - EOpConvDoubleToInt64, - EOpConvUint64ToInt64, EOpConvBoolToUint64, + + // bool -> float* + EOpConvBoolToFloat16, + EOpConvBoolToFloat, + EOpConvBoolToDouble, + + // int8_t -> (u)int* + EOpConvInt8ToInt16, + EOpConvInt8ToInt, + EOpConvInt8ToInt64, + EOpConvInt8ToUint8, + EOpConvInt8ToUint16, + EOpConvInt8ToUint, + EOpConvInt8ToUint64, + + // uint8_t -> (u)int* + EOpConvUint8ToInt8, + EOpConvUint8ToInt16, + EOpConvUint8ToInt, + EOpConvUint8ToInt64, + EOpConvUint8ToUint16, + EOpConvUint8ToUint, + EOpConvUint8ToUint64, + + // int8_t -> float* + EOpConvInt8ToFloat16, + EOpConvInt8ToFloat, + EOpConvInt8ToDouble, + + // uint8_t -> float* + EOpConvUint8ToFloat16, + EOpConvUint8ToFloat, + EOpConvUint8ToDouble, + + // int16_t -> (u)int* + EOpConvInt16ToInt8, + EOpConvInt16ToInt, + EOpConvInt16ToInt64, + EOpConvInt16ToUint8, + EOpConvInt16ToUint16, + EOpConvInt16ToUint, + EOpConvInt16ToUint64, + + // uint16_t -> (u)int* + EOpConvUint16ToInt8, + EOpConvUint16ToInt16, + EOpConvUint16ToInt, + EOpConvUint16ToInt64, + EOpConvUint16ToUint8, + EOpConvUint16ToUint, + EOpConvUint16ToUint64, + + // int16_t -> float* + EOpConvInt16ToFloat16, + EOpConvInt16ToFloat, + EOpConvInt16ToDouble, + + // uint16_t -> float* + EOpConvUint16ToFloat16, + EOpConvUint16ToFloat, + EOpConvUint16ToDouble, + + // int32_t -> (u)int* + EOpConvIntToInt8, + EOpConvIntToInt16, + EOpConvIntToInt64, + EOpConvIntToUint8, + EOpConvIntToUint16, + EOpConvIntToUint, EOpConvIntToUint64, + + // uint32_t -> (u)int* + EOpConvUintToInt8, + EOpConvUintToInt16, + EOpConvUintToInt, + EOpConvUintToInt64, + EOpConvUintToUint8, + EOpConvUintToUint16, EOpConvUintToUint64, - EOpConvFloatToUint64, - EOpConvDoubleToUint64, - EOpConvInt64ToUint64, -#ifdef AMD_EXTENSIONS - EOpConvBoolToFloat16, + + // int32_t -> float* EOpConvIntToFloat16, + EOpConvIntToFloat, + EOpConvIntToDouble, + + // uint32_t -> float* EOpConvUintToFloat16, - EOpConvFloatToFloat16, - EOpConvDoubleToFloat16, + EOpConvUintToFloat, + EOpConvUintToDouble, + + // int64_t -> (u)int* + EOpConvInt64ToInt8, + EOpConvInt64ToInt16, + EOpConvInt64ToInt, + EOpConvInt64ToUint8, + EOpConvInt64ToUint16, + EOpConvInt64ToUint, + EOpConvInt64ToUint64, + + // uint64_t -> (u)int* + EOpConvUint64ToInt8, + EOpConvUint64ToInt16, + EOpConvUint64ToInt, + EOpConvUint64ToInt64, + EOpConvUint64ToUint8, + EOpConvUint64ToUint16, + EOpConvUint64ToUint, + + // int64_t -> float* EOpConvInt64ToFloat16, + EOpConvInt64ToFloat, + EOpConvInt64ToDouble, + + // uint64_t -> float* EOpConvUint64ToFloat16, - EOpConvFloat16ToBool, + EOpConvUint64ToFloat, + EOpConvUint64ToDouble, + + // float16_t -> (u)int* + EOpConvFloat16ToInt8, + EOpConvFloat16ToInt16, EOpConvFloat16ToInt, + EOpConvFloat16ToInt64, + EOpConvFloat16ToUint8, + EOpConvFloat16ToUint16, EOpConvFloat16ToUint, + EOpConvFloat16ToUint64, + + // float16_t -> float* EOpConvFloat16ToFloat, EOpConvFloat16ToDouble, - EOpConvFloat16ToInt64, - EOpConvFloat16ToUint64, - EOpConvBoolToInt16, - EOpConvIntToInt16, - EOpConvUintToInt16, + // float -> (u)int* + EOpConvFloatToInt8, EOpConvFloatToInt16, - EOpConvDoubleToInt16, - EOpConvFloat16ToInt16, - EOpConvInt64ToInt16, - EOpConvUint64ToInt16, - EOpConvUint16ToInt16, - EOpConvInt16ToBool, - EOpConvInt16ToInt, - EOpConvInt16ToUint, - EOpConvInt16ToFloat, - EOpConvInt16ToDouble, - EOpConvInt16ToFloat16, - EOpConvInt16ToInt64, - EOpConvInt16ToUint64, - - EOpConvBoolToUint16, - EOpConvIntToUint16, - EOpConvUintToUint16, + EOpConvFloatToInt, + EOpConvFloatToInt64, + EOpConvFloatToUint8, EOpConvFloatToUint16, + EOpConvFloatToUint, + EOpConvFloatToUint64, + + // float -> float* + EOpConvFloatToFloat16, + EOpConvFloatToDouble, + + // float64 _t-> (u)int* + EOpConvDoubleToInt8, + EOpConvDoubleToInt16, + EOpConvDoubleToInt, + EOpConvDoubleToInt64, + EOpConvDoubleToUint8, EOpConvDoubleToUint16, - EOpConvFloat16ToUint16, - EOpConvInt64ToUint16, - EOpConvUint64ToUint16, - EOpConvInt16ToUint16, - EOpConvUint16ToBool, - EOpConvUint16ToInt, - EOpConvUint16ToUint, - EOpConvUint16ToFloat, - EOpConvUint16ToDouble, - EOpConvUint16ToFloat16, - EOpConvUint16ToInt64, - EOpConvUint16ToUint64, -#endif + EOpConvDoubleToUint, + EOpConvDoubleToUint64, + + // float64_t -> float* + EOpConvDoubleToFloat16, + EOpConvDoubleToFloat, // // binary operations @@ -280,12 +370,10 @@ EOpDoubleBitsToUint64, EOpInt64BitsToDouble, EOpUint64BitsToDouble, -#ifdef AMD_EXTENSIONS EOpFloat16BitsToInt16, EOpFloat16BitsToUint16, EOpInt16BitsToFloat16, EOpUint16BitsToFloat16, -#endif EOpPackSnorm2x16, EOpUnpackSnorm2x16, EOpPackUnorm2x16, @@ -302,7 +390,6 @@ EOpUnpackInt2x32, EOpPackUint2x32, EOpUnpackUint2x32, -#ifdef AMD_EXTENSIONS EOpPackFloat2x16, EOpUnpackFloat2x16, EOpPackInt2x16, @@ -313,7 +400,12 @@ EOpUnpackInt4x16, EOpPackUint4x16, EOpUnpackUint4x16, -#endif + EOpPack16, + EOpPack32, + EOpPack64, + EOpUnpack32, + EOpUnpack16, + EOpUnpack8, EOpLength, EOpDistance, @@ -379,6 +471,90 @@ EOpAllInvocations, EOpAllInvocationsEqual, + EOpSubgroupGuardStart, + EOpSubgroupBarrier, + EOpSubgroupMemoryBarrier, + EOpSubgroupMemoryBarrierBuffer, + EOpSubgroupMemoryBarrierImage, + EOpSubgroupMemoryBarrierShared, // compute only + EOpSubgroupElect, + EOpSubgroupAll, + EOpSubgroupAny, + EOpSubgroupAllEqual, + EOpSubgroupBroadcast, + EOpSubgroupBroadcastFirst, + EOpSubgroupBallot, + EOpSubgroupInverseBallot, + EOpSubgroupBallotBitExtract, + EOpSubgroupBallotBitCount, + EOpSubgroupBallotInclusiveBitCount, + EOpSubgroupBallotExclusiveBitCount, + EOpSubgroupBallotFindLSB, + EOpSubgroupBallotFindMSB, + EOpSubgroupShuffle, + EOpSubgroupShuffleXor, + EOpSubgroupShuffleUp, + EOpSubgroupShuffleDown, + EOpSubgroupAdd, + EOpSubgroupMul, + EOpSubgroupMin, + EOpSubgroupMax, + EOpSubgroupAnd, + EOpSubgroupOr, + EOpSubgroupXor, + EOpSubgroupInclusiveAdd, + EOpSubgroupInclusiveMul, + EOpSubgroupInclusiveMin, + EOpSubgroupInclusiveMax, + EOpSubgroupInclusiveAnd, + EOpSubgroupInclusiveOr, + EOpSubgroupInclusiveXor, + EOpSubgroupExclusiveAdd, + EOpSubgroupExclusiveMul, + EOpSubgroupExclusiveMin, + EOpSubgroupExclusiveMax, + EOpSubgroupExclusiveAnd, + EOpSubgroupExclusiveOr, + EOpSubgroupExclusiveXor, + EOpSubgroupClusteredAdd, + EOpSubgroupClusteredMul, + EOpSubgroupClusteredMin, + EOpSubgroupClusteredMax, + EOpSubgroupClusteredAnd, + EOpSubgroupClusteredOr, + EOpSubgroupClusteredXor, + EOpSubgroupQuadBroadcast, + EOpSubgroupQuadSwapHorizontal, + EOpSubgroupQuadSwapVertical, + EOpSubgroupQuadSwapDiagonal, + +#ifdef NV_EXTENSIONS + EOpSubgroupPartition, + EOpSubgroupPartitionedAdd, + EOpSubgroupPartitionedMul, + EOpSubgroupPartitionedMin, + EOpSubgroupPartitionedMax, + EOpSubgroupPartitionedAnd, + EOpSubgroupPartitionedOr, + EOpSubgroupPartitionedXor, + EOpSubgroupPartitionedInclusiveAdd, + EOpSubgroupPartitionedInclusiveMul, + EOpSubgroupPartitionedInclusiveMin, + EOpSubgroupPartitionedInclusiveMax, + EOpSubgroupPartitionedInclusiveAnd, + EOpSubgroupPartitionedInclusiveOr, + EOpSubgroupPartitionedInclusiveXor, + EOpSubgroupPartitionedExclusiveAdd, + EOpSubgroupPartitionedExclusiveMul, + EOpSubgroupPartitionedExclusiveMin, + EOpSubgroupPartitionedExclusiveMax, + EOpSubgroupPartitionedExclusiveAnd, + EOpSubgroupPartitionedExclusiveOr, + EOpSubgroupPartitionedExclusiveXor, +#endif + + EOpSubgroupGuardStop, + #ifdef AMD_EXTENSIONS EOpMinInvocations, EOpMaxInvocations, @@ -451,32 +627,36 @@ EOpConstructGuardStart, EOpConstructInt, // these first scalar forms also identify what implicit conversion is needed EOpConstructUint, - EOpConstructInt64, - EOpConstructUint64, -#ifdef AMD_EXTENSIONS + EOpConstructInt8, + EOpConstructUint8, EOpConstructInt16, EOpConstructUint16, -#endif + EOpConstructInt64, + EOpConstructUint64, EOpConstructBool, EOpConstructFloat, EOpConstructDouble, -#ifdef AMD_EXTENSIONS - EOpConstructFloat16, -#endif EOpConstructVec2, EOpConstructVec3, EOpConstructVec4, EOpConstructDVec2, EOpConstructDVec3, EOpConstructDVec4, -#ifdef AMD_EXTENSIONS - EOpConstructF16Vec2, - EOpConstructF16Vec3, - EOpConstructF16Vec4, -#endif EOpConstructBVec2, EOpConstructBVec3, EOpConstructBVec4, + EOpConstructI8Vec2, + EOpConstructI8Vec3, + EOpConstructI8Vec4, + EOpConstructU8Vec2, + EOpConstructU8Vec3, + EOpConstructU8Vec4, + EOpConstructI16Vec2, + EOpConstructI16Vec3, + EOpConstructI16Vec4, + EOpConstructU16Vec2, + EOpConstructU16Vec3, + EOpConstructU16Vec4, EOpConstructIVec2, EOpConstructIVec3, EOpConstructIVec4, @@ -489,14 +669,6 @@ EOpConstructU64Vec2, EOpConstructU64Vec3, EOpConstructU64Vec4, -#ifdef AMD_EXTENSIONS - EOpConstructI16Vec2, - EOpConstructI16Vec3, - EOpConstructI16Vec4, - EOpConstructU16Vec2, - EOpConstructU16Vec3, - EOpConstructU16Vec4, -#endif EOpConstructMat2x2, EOpConstructMat2x3, EOpConstructMat2x4, @@ -542,7 +714,10 @@ EOpConstructBMat4x2, EOpConstructBMat4x3, EOpConstructBMat4x4, -#ifdef AMD_EXTENSIONS + EOpConstructFloat16, + EOpConstructF16Vec2, + EOpConstructF16Vec3, + EOpConstructF16Vec4, EOpConstructF16Mat2x2, EOpConstructF16Mat2x3, EOpConstructF16Mat2x4, @@ -552,9 +727,9 @@ EOpConstructF16Mat4x2, EOpConstructF16Mat4x3, EOpConstructF16Mat4x4, -#endif EOpConstructStruct, EOpConstructTextureSampler, + EOpConstructNonuniform, // expected to be transformed away, not present in final AST EOpConstructGuardEnd, // @@ -581,7 +756,11 @@ // Array operators // - EOpArrayLength, // "Array" distinguishes from length(v) built-in function, but it applies to vectors and matrices as well. + // Can apply to arrays, vectors, or matrices. + // Can be decomposed to a constant at compile time, but this does not always happen, + // due to link-time effects. So, consumer can expect either a link-time sized or + // run-time sized array. + EOpArrayLength, // // Image operations @@ -722,7 +901,8 @@ EOpInterlockedOr, // ... EOpInterlockedXor, // ... EOpAllMemoryBarrierWithGroupSync, // memory barriers without non-hlsl AST equivalents - EOpGroupMemoryBarrierWithGroupSync, // ... + EOpDeviceMemoryBarrier, // ... + EOpDeviceMemoryBarrierWithGroupSync, // ... EOpWorkgroupMemoryBarrier, // ... EOpWorkgroupMemoryBarrierWithGroupSync, // ... EOpEvaluateAttributeSnapped, // InterpolateAtOffset with int position on 16x16 grid @@ -776,6 +956,12 @@ // matrix EOpMatrixSwizzle, // select multiple matrix components (non-column) + + // SM6 wave ops + EOpWaveGetLaneCount, // Will decompose to gl_SubgroupSize. + EOpWaveGetLaneIndex, // Will decompose to gl_SubgroupInvocationID. + EOpWaveActiveCountBits, // Will decompose to subgroupBallotBitCount(subgroupBallot()). + EOpWavePrefixCountBits, // Will decompose to subgroupBallotInclusiveBitCount(subgroupBallot()). }; class TIntermTraverser; @@ -818,7 +1004,7 @@ virtual glslang::TIntermMethod* getAsMethodNode() { return 0; } virtual glslang::TIntermSymbol* getAsSymbolNode() { return 0; } virtual glslang::TIntermBranch* getAsBranchNode() { return 0; } - virtual glslang::TIntermLoop* getAsLoopNode() { return 0; } + virtual glslang::TIntermLoop* getAsLoopNode() { return 0; } virtual const glslang::TIntermTyped* getAsTyped() const { return 0; } virtual const glslang::TIntermOperator* getAsOperator() const { return 0; } @@ -831,7 +1017,7 @@ virtual const glslang::TIntermMethod* getAsMethodNode() const { return 0; } virtual const glslang::TIntermSymbol* getAsSymbolNode() const { return 0; } virtual const glslang::TIntermBranch* getAsBranchNode() const { return 0; } - virtual const glslang::TIntermLoop* getAsLoopNode() const { return 0; } + virtual const glslang::TIntermLoop* getAsLoopNode() const { return 0; } virtual ~TIntermNode() { } protected: @@ -885,24 +1071,6 @@ }; // -// Selection control hints -// -enum TSelectionControl { - ESelectionControlNone, - ESelectionControlFlatten, - ESelectionControlDontFlatten, -}; - -// -// Loop control hints -// -enum TLoopControl { - ELoopControlNone, - ELoopControlUnroll, - ELoopControlDontUnroll, -}; - -// // Handle for, do-while, and while loops. // class TIntermLoop : public TIntermNode { @@ -912,26 +1080,36 @@ test(aTest), terminal(aTerminal), first(testFirst), - control(ELoopControlNone) + unroll(false), + dontUnroll(false), + dependency(0) { } - virtual TIntermLoop* getAsLoopNode() { return this; } - virtual const TIntermLoop* getAsLoopNode() const { return this; } + virtual TIntermLoop* getAsLoopNode() { return this; } + virtual const TIntermLoop* getAsLoopNode() const { return this; } virtual void traverse(TIntermTraverser*); TIntermNode* getBody() const { return body; } TIntermTyped* getTest() const { return test; } TIntermTyped* getTerminal() const { return terminal; } bool testFirst() const { return first; } - void setLoopControl(TLoopControl c) { control = c; } - TLoopControl getLoopControl() const { return control; } + void setUnroll() { unroll = true; } + void setDontUnroll() { dontUnroll = true; } + bool getUnroll() const { return unroll; } + bool getDontUnroll() const { return dontUnroll; } + + static const unsigned int dependencyInfinite = 0xFFFFFFFF; + void setLoopDependency(int d) { dependency = d; } + int getLoopDependency() const { return dependency; } protected: TIntermNode* body; // code to loop over TIntermTyped* test; // exit condition associated with loop, could be 0 for 'for' loops TIntermTyped* terminal; // exists for for-loops bool first; // true for while and for, not for do-while - TLoopControl control; // loop control hint + bool unroll; // true if unroll requested + bool dontUnroll; // true if request to not unroll + unsigned int dependency; // loop dependency hint; 0 means not set or unknown }; // @@ -1303,8 +1481,8 @@ // class TIntermAggregate : public TIntermOperator { public: - TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(0) { } - TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(0) { } + TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(nullptr) { } + TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(nullptr) { } ~TIntermAggregate() { delete pragmaTable; } virtual TIntermAggregate* getAsAggregate() { return this; } virtual const TIntermAggregate* getAsAggregate() const { return this; } @@ -1322,7 +1500,7 @@ void setDebug(bool d) { debug = d; } bool getOptimize() const { return optimize; } bool getDebug() const { return debug; } - void addToPragmaTable(const TPragmaTable& pTable); + void setPragmaTable(const TPragmaTable& pTable); const TPragmaTable& getPragmaTable() const { return *pragmaTable; } protected: TIntermAggregate(const TIntermAggregate&); // disallow copy constructor @@ -1342,22 +1520,35 @@ class TIntermSelection : public TIntermTyped { public: TIntermSelection(TIntermTyped* cond, TIntermNode* trueB, TIntermNode* falseB) : - TIntermTyped(EbtVoid), condition(cond), trueBlock(trueB), falseBlock(falseB), control(ESelectionControlNone) {} + TIntermTyped(EbtVoid), condition(cond), trueBlock(trueB), falseBlock(falseB), + shortCircuit(true), + flatten(false), dontFlatten(false) {} TIntermSelection(TIntermTyped* cond, TIntermNode* trueB, TIntermNode* falseB, const TType& type) : - TIntermTyped(type), condition(cond), trueBlock(trueB), falseBlock(falseB), control(ESelectionControlNone) {} + TIntermTyped(type), condition(cond), trueBlock(trueB), falseBlock(falseB), + shortCircuit(true), + flatten(false), dontFlatten(false) {} virtual void traverse(TIntermTraverser*); virtual TIntermTyped* getCondition() const { return condition; } virtual TIntermNode* getTrueBlock() const { return trueBlock; } virtual TIntermNode* getFalseBlock() const { return falseBlock; } virtual TIntermSelection* getAsSelectionNode() { return this; } virtual const TIntermSelection* getAsSelectionNode() const { return this; } - void setSelectionControl(TSelectionControl c) { control = c; } - TSelectionControl getSelectionControl() const { return control; } + + void setNoShortCircuit() { shortCircuit = false; } + bool getShortCircuit() const { return shortCircuit; } + + void setFlatten() { flatten = true; } + void setDontFlatten() { dontFlatten = true; } + bool getFlatten() const { return flatten; } + bool getDontFlatten() const { return dontFlatten; } + protected: TIntermTyped* condition; TIntermNode* trueBlock; TIntermNode* falseBlock; - TSelectionControl control; // selection control hint + bool shortCircuit; // normally all if-then-else and all GLSL ?: short-circuit, but HLSL ?: does not + bool flatten; // true if flatten requested + bool dontFlatten; // true if requested to not flatten }; // @@ -1368,18 +1559,24 @@ // class TIntermSwitch : public TIntermNode { public: - TIntermSwitch(TIntermTyped* cond, TIntermAggregate* b) : condition(cond), body(b), control(ESelectionControlNone) { } + TIntermSwitch(TIntermTyped* cond, TIntermAggregate* b) : condition(cond), body(b), + flatten(false), dontFlatten(false) {} virtual void traverse(TIntermTraverser*); virtual TIntermNode* getCondition() const { return condition; } virtual TIntermAggregate* getBody() const { return body; } virtual TIntermSwitch* getAsSwitchNode() { return this; } virtual const TIntermSwitch* getAsSwitchNode() const { return this; } - void setSelectionControl(TSelectionControl c) { control = c; } - TSelectionControl getSelectionControl() const { return control; } + + void setFlatten() { flatten = true; } + void setDontFlatten() { dontFlatten = true; } + bool getFlatten() const { return flatten; } + bool getDontFlatten() const { return dontFlatten; } + protected: TIntermTyped* condition; TIntermAggregate* body; - TSelectionControl control; // selection control hint + bool flatten; // true if flatten requested + bool dontFlatten; // true if requested to not flatten }; enum TVisit diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/PoolAlloc.h vulkan-1.1.73+dfsg/external/glslang/glslang/Include/PoolAlloc.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/PoolAlloc.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/Include/PoolAlloc.h 2018-04-27 11:46:26.000000000 +0000 @@ -250,15 +250,8 @@ // different times. But a simple use is to have a global pop // with everyone using the same global allocator. // -typedef TPoolAllocator* PoolAllocatorPointer; extern TPoolAllocator& GetThreadPoolAllocator(); - -struct TThreadMemoryPools -{ - TPoolAllocator* threadPoolAllocator; -}; - -void SetThreadPoolAllocator(TPoolAllocator& poolAllocator); +void SetThreadPoolAllocator(TPoolAllocator* poolAllocator); // // This STL compatible allocator is intended to be used as the allocator diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/revision.h vulkan-1.1.73+dfsg/external/glslang/glslang/Include/revision.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/revision.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/Include/revision.h 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,3 @@ // This header is generated by the make-revision script. -// For the version, it uses the latest git tag followed by the number of commits. -// For the date, it uses the current date (when then script is run). -#define GLSLANG_REVISION "Overload400-PrecQual.2000" -#define GLSLANG_DATE "12-Apr-2017" +#define GLSLANG_PATCH_LEVEL 2705 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/ShHandle.h vulkan-1.1.73+dfsg/external/glslang/glslang/Include/ShHandle.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/ShHandle.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/Include/ShHandle.h 2018-04-27 11:46:26.000000000 +0000 @@ -56,11 +56,14 @@ // class TShHandleBase { public: - TShHandleBase() { } - virtual ~TShHandleBase() { } + TShHandleBase() { pool = new glslang::TPoolAllocator; } + virtual ~TShHandleBase() { delete pool; } virtual TCompiler* getAsCompiler() { return 0; } virtual TLinker* getAsLinker() { return 0; } virtual TUniformMap* getAsUniformMap() { return 0; } + virtual glslang::TPoolAllocator* getPool() const { return pool; } +private: + glslang::TPoolAllocator* pool; }; // diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/Types.h vulkan-1.1.73+dfsg/external/glslang/glslang/Include/Types.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Include/Types.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/Include/Types.h 2018-04-27 11:46:26.000000000 +0000 @@ -2,6 +2,7 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2016 LunarG, Inc. // Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -204,9 +205,18 @@ } switch (type) { - case EbtFloat: break; - case EbtInt: s.append("i"); break; - case EbtUint: s.append("u"); break; + case EbtFloat: break; +#ifdef AMD_EXTENSIONS + case EbtFloat16: s.append("f16"); break; +#endif + case EbtInt8: s.append("i8"); break; + case EbtUint16: s.append("u8"); break; + case EbtInt16: s.append("i16"); break; + case EbtUint8: s.append("u16"); break; + case EbtInt: s.append("i"); break; + case EbtUint: s.append("u"); break; + case EbtInt64: s.append("i64"); break; + case EbtUint64: s.append("u64"); break; default: break; // some compilers want this } if (image) { @@ -427,6 +437,7 @@ clearInterstage(); clearMemory(); specConstant = false; + nonUniform = false; clearLayout(); } @@ -460,7 +471,7 @@ // Drop just the storage qualification, which perhaps should // never be done, as it is fundamentally inconsistent, but need to // explore what downstream consumers need. - // E.g., in a deference, it is an inconsistency between: + // E.g., in a dereference, it is an inconsistency between: // A) partially dereferenced resource is still in the storage class it started in // B) partially dereferenced resource is a new temporary object // If A, then nothing should change, if B, then everything should change, but this is half way. @@ -468,6 +479,7 @@ { storage = EvqTemporary; specConstant = false; + nonUniform = false; } const char* semanticName; @@ -492,6 +504,7 @@ bool readonly : 1; bool writeonly : 1; bool specConstant : 1; // having a constant_id is not sufficient: expressions have no id, but are still specConstant + bool nonUniform : 1; bool isMemory() const { @@ -505,6 +518,12 @@ return flat || smooth || nopersp; #endif } +#ifdef AMD_EXTENSIONS + bool isExplicitInterpolation() const + { + return explicitInterp; + } +#endif bool isAuxiliary() const { return centroid || patch || sample; @@ -650,15 +669,19 @@ layoutXfbOffset = layoutXfbOffsetEnd; } - bool hasLayout() const + bool hasNonXfbLayout() const { return hasUniformLayout() || hasAnyLocation() || hasStream() || - hasXfb() || hasFormat() || layoutPushConstant; } + bool hasLayout() const + { + return hasNonXfbLayout() || + hasXfb(); + } TLayoutMatrix layoutMatrix : 3; TLayoutPacking layoutPacking : 4; int layoutOffset; @@ -813,6 +836,10 @@ // true front-end constant. return specConstant; } + bool isNonUniform() const + { + return nonUniform; + } bool isFrontEndConstant() const { // True if the front-end knows the final constant value. @@ -1152,6 +1179,7 @@ sampler.clear(); qualifier.clear(); qualifier.storage = q; + assert(!(isMatrix() && vectorSize != 0)); // prevent vectorSize != 0 on matrices } // for explicit precision qualifier TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0, @@ -1164,6 +1192,7 @@ qualifier.storage = q; qualifier.precision = p; assert(p >= EpqNone && p <= EpqHigh); + assert(!(isMatrix() && vectorSize != 0)); // prevent vectorSize != 0 on matrices } // for turning a TPublicType into a TType, using a shallow copy explicit TType(const TPublicType& p) : @@ -1293,31 +1322,9 @@ void makeVector() { vector1 = true; } - // Merge type from parent, where a parentType is at the beginning of a declaration, - // establishing some characteristics for all subsequent names, while this type - // is on the individual names. - void mergeType(const TPublicType& parentType) - { - // arrayness is currently the only child aspect that has to be preserved - basicType = parentType.basicType; - vectorSize = parentType.vectorSize; - matrixCols = parentType.matrixCols; - matrixRows = parentType.matrixRows; - vector1 = false; // TPublicType is only GLSL which so far has no vec1 - qualifier = parentType.qualifier; - sampler = parentType.sampler; - if (parentType.arraySizes) - newArraySizes(*parentType.arraySizes); - if (parentType.userDef) { - structure = parentType.userDef->getWritableStruct(); - setTypeName(parentType.userDef->getTypeName()); - } - } - virtual void hideMember() { basicType = EbtVoid; vectorSize = 1; } virtual bool hiddenMember() const { return basicType == EbtVoid; } - virtual void setTypeName(const TString& n) { typeName = NewPoolTString(n.c_str()); } virtual void setFieldName(const TString& n) { fieldName = NewPoolTString(n.c_str()); } virtual const TString& getTypeName() const { @@ -1347,33 +1354,31 @@ virtual bool isArrayOfArrays() const { return arraySizes != nullptr && arraySizes->getNumDims() > 1; } virtual int getImplicitArraySize() const { return arraySizes->getImplicitSize(); } virtual const TArraySizes* getArraySizes() const { return arraySizes; } - virtual TArraySizes& getArraySizes() { assert(arraySizes != nullptr); return *arraySizes; } + virtual TArraySizes* getArraySizes() { return arraySizes; } virtual bool isScalar() const { return ! isVector() && ! isMatrix() && ! isStruct() && ! isArray(); } virtual bool isScalarOrVec1() const { return isScalar() || vector1; } virtual bool isVector() const { return vectorSize > 1 || vector1; } virtual bool isMatrix() const { return matrixCols ? true : false; } virtual bool isArray() const { return arraySizes != nullptr; } - virtual bool isExplicitlySizedArray() const { return isArray() && getOuterArraySize() != UnsizedArraySize; } - virtual bool isImplicitlySizedArray() const { return isArray() && getOuterArraySize() == UnsizedArraySize && qualifier.storage != EvqBuffer; } - virtual bool isRuntimeSizedArray() const { return isArray() && getOuterArraySize() == UnsizedArraySize && qualifier.storage == EvqBuffer; } + virtual bool isSizedArray() const { return isArray() && arraySizes->isSized(); } + virtual bool isUnsizedArray() const { return isArray() && !arraySizes->isSized(); } + virtual bool isArrayVariablyIndexed() const { assert(isArray()); return arraySizes->isVariablyIndexed(); } + virtual void setArrayVariablyIndexed() { assert(isArray()); arraySizes->setVariablyIndexed(); } + virtual void updateImplicitArraySize(int size) { assert(isArray()); arraySizes->updateImplicitSize(size); } virtual bool isStruct() const { return structure != nullptr; } -#ifdef AMD_EXTENSIONS virtual bool isFloatingDomain() const { return basicType == EbtFloat || basicType == EbtDouble || basicType == EbtFloat16; } -#else - virtual bool isFloatingDomain() const { return basicType == EbtFloat || basicType == EbtDouble; } -#endif virtual bool isIntegerDomain() const { switch (basicType) { + case EbtInt8: + case EbtUint8: + case EbtInt16: + case EbtUint16: case EbtInt: case EbtUint: case EbtInt64: case EbtUint64: -#ifdef AMD_EXTENSIONS - case EbtInt16: - case EbtUint16: -#endif case EbtAtomicUint: return true; default: @@ -1385,11 +1390,12 @@ virtual bool isBuiltIn() const { return getQualifier().builtIn != EbvNone; } // "Image" is a superset of "Subpass" - virtual bool isImage() const { return basicType == EbtSampler && getSampler().isImage(); } + virtual bool isImage() const { return basicType == EbtSampler && getSampler().isImage(); } virtual bool isSubpass() const { return basicType == EbtSampler && getSampler().isSubpass(); } + virtual bool isTexture() const { return basicType == EbtSampler && getSampler().isTexture(); } // return true if this type contains any subtype which satisfies the given predicate. - template + template bool contains(P predicate) const { if (predicate(this)) @@ -1418,10 +1424,10 @@ return contains([this](const TType* t) { return t != this && t->isStruct(); } ); } - // Recursively check the structure for any implicitly-sized arrays, needed for triggering a copyUp(). - virtual bool containsImplicitlySizedArray() const + // Recursively check the structure for any unsized arrays, needed for triggering a copyUp(). + virtual bool containsUnsizedArray() const { - return contains([](const TType* t) { return t->isImplicitlySizedArray(); } ); + return contains([](const TType* t) { return t->isUnsizedArray(); } ); } virtual bool containsOpaque() const @@ -1442,17 +1448,15 @@ case EbtVoid: case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif + case EbtInt8: + case EbtUint8: + case EbtInt16: + case EbtUint16: case EbtInt: case EbtUint: case EbtInt64: case EbtUint64: -#ifdef AMD_EXTENSIONS - case EbtInt16: - case EbtUint16: -#endif case EbtBool: return true; default: @@ -1487,34 +1491,51 @@ assert(type.arraySizes != nullptr); *arraySizes = *type.arraySizes; } - void newArraySizes(const TArraySizes& s) + void copyArraySizes(const TArraySizes& s) { // For setting a fresh new set of array sizes, not yet worrying about sharing. arraySizes = new TArraySizes; *arraySizes = s; } - void clearArraySizes() + void transferArraySizes(TArraySizes* s) { - arraySizes = 0; + // For setting an already allocated set of sizes that this type can use + // (no copy made). + arraySizes = s; } - void addArrayOuterSizes(const TArraySizes& s) + void clearArraySizes() { - if (arraySizes == nullptr) - newArraySizes(s); - else - arraySizes->addOuterSizes(s); + arraySizes = nullptr; + } + + // Add inner array sizes, to any existing sizes, via copy; the + // sizes passed in can still be reused for other purposes. + void copyArrayInnerSizes(const TArraySizes* s) + { + if (s != nullptr) { + if (arraySizes == nullptr) + copyArraySizes(*s); + else + arraySizes->addInnerSizes(*s); + } } void changeOuterArraySize(int s) { arraySizes->changeOuterSize(s); } - void setImplicitArraySize(int s) { arraySizes->setImplicitSize(s); } - // Recursively make the implicit array size the explicit array size, through the type tree. - void adoptImplicitArraySizes() + // Recursively make the implicit array size the explicit array size. + // Expicit arrays are compile-time or link-time sized, never run-time sized. + // Sometimes, policy calls for an array to be run-time sized even if it was + // never variably indexed: Don't turn a 'skipNonvariablyIndexed' array into + // an explicit array. + void adoptImplicitArraySizes(bool skipNonvariablyIndexed) { - if (isImplicitlySizedArray()) + if (isUnsizedArray() && !(skipNonvariablyIndexed || isArrayVariablyIndexed())) changeOuterArraySize(getImplicitArraySize()); - if (isStruct()) { - for (int i = 0; i < (int)structure->size(); ++i) - (*structure)[i].type->adoptImplicitArraySizes(); + if (isStruct() && structure->size() > 0) { + int lastMember = (int)structure->size() - 1; + for (int i = 0; i < lastMember; ++i) + (*structure)[i].type->adoptImplicitArraySizes(false); + // implement the "last member of an SSBO" policy + (*structure)[lastMember].type->adoptImplicitArraySizes(getQualifier().storage == EvqBuffer); } } @@ -1529,17 +1550,15 @@ case EbtVoid: return "void"; case EbtFloat: return "float"; case EbtDouble: return "double"; -#ifdef AMD_EXTENSIONS case EbtFloat16: return "float16_t"; -#endif + case EbtInt8: return "int8_t"; + case EbtUint8: return "uint8_t"; + case EbtInt16: return "int16_t"; + case EbtUint16: return "uint16_t"; case EbtInt: return "int"; case EbtUint: return "uint"; case EbtInt64: return "int64_t"; case EbtUint64: return "uint64_t"; -#ifdef AMD_EXTENSIONS - case EbtInt16: return "int16_t"; - case EbtUint16: return "uint16_t"; -#endif case EbtBool: return "bool"; case EbtAtomicUint: return "atomic_uint"; case EbtSampler: return "sampler/image"; @@ -1678,16 +1697,26 @@ appendStr(" writeonly"); if (qualifier.specConstant) appendStr(" specialization-constant"); + if (qualifier.nonUniform) + appendStr(" nonuniform"); appendStr(" "); appendStr(getStorageQualifierString()); if (isArray()) { for(int i = 0; i < (int)arraySizes->getNumDims(); ++i) { int size = arraySizes->getDimSize(i); - if (size == 0) - appendStr(" implicitly-sized array of"); + if (size == UnsizedArraySize && i == 0 && arraySizes->isVariablyIndexed()) + appendStr(" runtime-sized array of"); else { - appendStr(" "); - appendInt(arraySizes->getDimSize(i)); + if (size == UnsizedArraySize) { + appendStr(" unsized"); + if (i == 0) { + appendStr(" "); + appendInt(arraySizes->getImplicitSize()); + } + } else { + appendStr(" "); + appendInt(arraySizes->getDimSize(i)); + } appendStr("-element array of"); } } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/attribute.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/attribute.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/attribute.cpp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/attribute.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,257 @@ +// +// Copyright (C) 2017 LunarG, Inc. +// Copyright (C) 2018 Google, Inc. +// +// 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 Google, Inc., 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 HOLDERS 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. +// + +#include "attribute.h" +#include "../Include/intermediate.h" +#include "ParseHelper.h" + +namespace glslang { + +// extract integers out of attribute arguments stored in attribute aggregate +bool TAttributeArgs::getInt(int& value, int argNum) const +{ + const TConstUnion* intConst = getConstUnion(EbtInt, argNum); + + if (intConst == nullptr) + return false; + + value = intConst->getIConst(); + return true; +} + +// extract strings out of attribute arguments stored in attribute aggregate. +// convert to lower case if converToLower is true (for case-insensitive compare convenience) +bool TAttributeArgs::getString(TString& value, int argNum, bool convertToLower) const +{ + const TConstUnion* stringConst = getConstUnion(EbtString, argNum); + + if (stringConst == nullptr) + return false; + + value = *stringConst->getSConst(); + + // Convenience. + if (convertToLower) + std::transform(value.begin(), value.end(), value.begin(), ::tolower); + + return true; +} + +// How many arguments were supplied? +int TAttributeArgs::size() const +{ + return args == nullptr ? 0 : (int)args->getSequence().size(); +} + +// Helper to get attribute const union. Returns nullptr on failure. +const TConstUnion* TAttributeArgs::getConstUnion(TBasicType basicType, int argNum) const +{ + if (args == nullptr) + return nullptr; + + if (argNum >= (int)args->getSequence().size()) + return nullptr; + + const TConstUnion* constVal = &args->getSequence()[argNum]->getAsConstantUnion()->getConstArray()[0]; + if (constVal == nullptr || constVal->getType() != basicType) + return nullptr; + + return constVal; +} + +// Implementation of TParseContext parts of attributes +TAttributeType TParseContext::attributeFromName(const TString& name) const +{ + if (name == "branch" || name == "dont_flatten") + return EatBranch; + else if (name == "flatten") + return EatFlatten; + else if (name == "unroll") + return EatUnroll; + else if (name == "loop" || name == "dont_unroll") + return EatLoop; + else if (name == "dependency_infinite") + return EatDependencyInfinite; + else if (name == "dependency_length") + return EatDependencyLength; + else + return EatNone; +} + +// Make an initial leaf for the grammar from a no-argument attribute +TAttributes* TParseContext::makeAttributes(const TString& identifier) const +{ + TAttributes *attributes = nullptr; + attributes = NewPoolObject(attributes); + TAttributeArgs args = { attributeFromName(identifier), nullptr }; + attributes->push_back(args); + return attributes; +} + +// Make an initial leaf for the grammar from a one-argument attribute +TAttributes* TParseContext::makeAttributes(const TString& identifier, TIntermNode* node) const +{ + TAttributes *attributes = nullptr; + attributes = NewPoolObject(attributes); + + // for now, node is always a simple single expression, but other code expects + // a list, so make it so + TIntermAggregate* agg = intermediate.makeAggregate(node); + TAttributeArgs args = { attributeFromName(identifier), agg }; + attributes->push_back(args); + return attributes; +} + +// Merge two sets of attributes into a single set. +// The second argument is destructively consumed. +TAttributes* TParseContext::mergeAttributes(TAttributes* attr1, TAttributes* attr2) const +{ + attr1->splice(attr1->end(), *attr2); + return attr1; +} + +// +// Selection attributes +// +void TParseContext::handleSelectionAttributes(const TAttributes& attributes, TIntermNode* node) +{ + TIntermSelection* selection = node->getAsSelectionNode(); + if (selection == nullptr) + return; + + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + if (it->size() > 0) { + warn(node->getLoc(), "attribute with arguments not recognized, skipping", "", ""); + continue; + } + + switch (it->name) { + case EatFlatten: + selection->setFlatten(); + break; + case EatBranch: + selection->setDontFlatten(); + break; + default: + warn(node->getLoc(), "attribute does not apply to a selection", "", ""); + break; + } + } +} + +// +// Switch attributes +// +void TParseContext::handleSwitchAttributes(const TAttributes& attributes, TIntermNode* node) +{ + TIntermSwitch* selection = node->getAsSwitchNode(); + if (selection == nullptr) + return; + + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + if (it->size() > 0) { + warn(node->getLoc(), "attribute with arguments not recognized, skipping", "", ""); + continue; + } + + switch (it->name) { + case EatFlatten: + selection->setFlatten(); + break; + case EatBranch: + selection->setDontFlatten(); + break; + default: + warn(node->getLoc(), "attribute does not apply to a switch", "", ""); + break; + } + } +} + +// +// Loop attributes +// +void TParseContext::handleLoopAttributes(const TAttributes& attributes, TIntermNode* node) +{ + TIntermLoop* loop = node->getAsLoopNode(); + if (loop == nullptr) { + // the actual loop might be part of a sequence + TIntermAggregate* agg = node->getAsAggregate(); + if (agg == nullptr) + return; + for (auto it = agg->getSequence().begin(); it != agg->getSequence().end(); ++it) { + loop = (*it)->getAsLoopNode(); + if (loop != nullptr) + break; + } + if (loop == nullptr) + return; + } + + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + if (it->name != EatDependencyLength && it->size() > 0) { + warn(node->getLoc(), "attribute with arguments not recognized, skipping", "", ""); + continue; + } + + int value; + switch (it->name) { + case EatUnroll: + loop->setUnroll(); + break; + case EatLoop: + loop->setDontUnroll(); + break; + case EatDependencyInfinite: + loop->setLoopDependency(TIntermLoop::dependencyInfinite); + break; + case EatDependencyLength: + if (it->size() == 1 && it->getInt(value)) { + if (value <= 0) + error(node->getLoc(), "must be positive", "dependency_length", ""); + loop->setLoopDependency(value); + } else + warn(node->getLoc(), "expected a single integer argument", "dependency_length", ""); + break; + default: + warn(node->getLoc(), "attribute does not apply to a loop", "", ""); + break; + } + } +} + + +} // end namespace glslang diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/attribute.h vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/attribute.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/attribute.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/attribute.h 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,102 @@ +// +// Copyright (C) 2017 LunarG, Inc. +// Copyright (C) 2018 Google, Inc. +// +// 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 3Dlabs Inc. Ltd. 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 HOLDERS 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. +// + +#ifndef _ATTRIBUTE_INCLUDED_ +#define _ATTRIBUTE_INCLUDED_ + +#include "../Include/Common.h" +#include "../Include/ConstantUnion.h" + +namespace glslang { + + enum TAttributeType { + EatNone, + EatAllow_uav_condition, + EatBranch, + EatCall, + EatDomain, + EatEarlyDepthStencil, + EatFastOpt, + EatFlatten, + EatForceCase, + EatInstance, + EatMaxTessFactor, + EatNumThreads, + EatMaxVertexCount, + EatOutputControlPoints, + EatOutputTopology, + EatPartitioning, + EatPatchConstantFunc, + EatPatchSize, + EatUnroll, + EatLoop, + EatBinding, + EatGlobalBinding, + EatLocation, + EatInputAttachment, + EatBuiltIn, + EatPushConstant, + EatConstantId, + EatDependencyInfinite, + EatDependencyLength + }; + + class TIntermAggregate; + + struct TAttributeArgs { + TAttributeType name; + const TIntermAggregate* args; + + // Obtain attribute as integer + // Return false if it cannot be obtained + bool getInt(int& value, int argNum = 0) const; + + // Obtain attribute as string, with optional to-lower transform + // Return false if it cannot be obtained + bool getString(TString& value, int argNum = 0, bool convertToLower = true) const; + + // How many arguments were provided to the attribute? + int size() const; + + protected: + const TConstUnion* getConstUnion(TBasicType basicType, int argNum) const; + }; + + typedef TList TAttributes; + +} // end namespace glslang + +#endif // _ATTRIBUTE_INCLUDED_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/Constant.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/Constant.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/Constant.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/Constant.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -177,11 +178,40 @@ switch (getType().getBasicType()) { case EbtDouble: case EbtFloat: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif newConstArray[i].setDConst(leftUnionArray[i].getDConst() / rightUnionArray[i].getDConst()); break; + case EbtInt8: + if (rightUnionArray[i] == 0) + newConstArray[i].setI8Const(0x7F); + else if (rightUnionArray[i].getI8Const() == -1 && leftUnionArray[i].getI8Const() == (signed char)0x80) + newConstArray[i].setI8Const((signed char)0x80); + else + newConstArray[i].setI8Const(leftUnionArray[i].getI8Const() / rightUnionArray[i].getI8Const()); + break; + + case EbtUint8: + if (rightUnionArray[i] == 0) { + newConstArray[i].setU8Const(0xFF); + } else + newConstArray[i].setU8Const(leftUnionArray[i].getU8Const() / rightUnionArray[i].getU8Const()); + break; + + case EbtInt16: + if (rightUnionArray[i] == 0) + newConstArray[i].setI16Const(0x7FFF); + else if (rightUnionArray[i].getI16Const() == -1 && leftUnionArray[i].getI16Const() == (signed short)0x8000) + newConstArray[i].setI16Const(short(0x8000)); + else + newConstArray[i].setI16Const(leftUnionArray[i].getI16Const() / rightUnionArray[i].getI16Const()); + break; + + case EbtUint16: + if (rightUnionArray[i] == 0) { + newConstArray[i].setU16Const(0xFFFF); + } else + newConstArray[i].setU16Const(leftUnionArray[i].getU16Const() / rightUnionArray[i].getU16Const()); + break; case EbtInt: if (rightUnionArray[i] == 0) @@ -214,23 +244,6 @@ } else newConstArray[i].setU64Const(leftUnionArray[i].getU64Const() / rightUnionArray[i].getU64Const()); break; -#ifdef AMD_EXTENSIONS - case EbtInt16: - if (rightUnionArray[i] == 0) - newConstArray[i].setIConst(0x7FFF); - else if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == (int)0x8000) - newConstArray[i].setIConst(0x8000); - else - newConstArray[i].setIConst(leftUnionArray[i].getIConst() / rightUnionArray[i].getIConst()); - break; - - case EbtUint16: - if (rightUnionArray[i] == 0) { - newConstArray[i].setUConst(0xFFFFu); - } else - newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst()); - break; -#endif default: return 0; } @@ -411,6 +424,12 @@ resultSize = 2; break; + case EOpPack16: + case EOpPack32: + case EOpPack64: + case EOpUnpack32: + case EOpUnpack16: + case EOpUnpack8: case EOpNormalize: componentWise = false; resultSize = objectSize; @@ -469,6 +488,12 @@ case EOpPackSnorm2x16: case EOpPackUnorm2x16: case EOpPackHalf2x16: + case EOpPack16: + case EOpPack32: + case EOpPack64: + case EOpUnpack32: + case EOpUnpack16: + case EOpUnpack8: case EOpUnpackSnorm2x16: case EOpUnpackUnorm2x16: @@ -494,17 +519,13 @@ case EOpNegative: switch (getType().getBasicType()) { case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif case EbtFloat: newConstArray[i].setDConst(-unionArray[i].getDConst()); break; -#ifdef AMD_EXTENSIONS - case EbtInt16: -#endif + case EbtInt8: newConstArray[i].setI8Const(-unionArray[i].getI8Const()); break; + case EbtUint8: newConstArray[i].setU8Const(static_cast(-static_cast(unionArray[i].getU8Const()))); break; + case EbtInt16: newConstArray[i].setI16Const(-unionArray[i].getI16Const()); break; + case EbtUint16:newConstArray[i].setU16Const(static_cast(-static_cast(unionArray[i].getU16Const()))); break; case EbtInt: newConstArray[i].setIConst(-unionArray[i].getIConst()); break; -#ifdef AMD_EXTENSIONS - case EbtUint16: -#endif case EbtUint: newConstArray[i].setUConst(static_cast(-static_cast(unionArray[i].getUConst()))); break; case EbtInt64: newConstArray[i].setI64Const(-unionArray[i].getI64Const()); break; case EbtUint64: newConstArray[i].setU64Const(static_cast(-static_cast(unionArray[i].getU64Const()))); break; @@ -659,13 +680,10 @@ case EOpDoubleBitsToUint64: case EOpInt64BitsToDouble: case EOpUint64BitsToDouble: -#ifdef AMD_EXTENSIONS case EOpFloat16BitsToInt16: case EOpFloat16BitsToUint16: case EOpInt16BitsToFloat16: case EOpUint16BitsToFloat16: -#endif - default: return 0; } @@ -749,20 +767,6 @@ for (unsigned int arg = 0; arg < children.size(); ++arg) childConstUnions.push_back(children[arg]->getAsConstantUnion()->getConstArray()); - // Second, do the actual folding - - bool isFloatingPoint = children[0]->getAsTyped()->getBasicType() == EbtFloat || -#ifdef AMD_EXTENSIONS - children[0]->getAsTyped()->getBasicType() == EbtFloat16 || -#endif - children[0]->getAsTyped()->getBasicType() == EbtDouble; - bool isSigned = children[0]->getAsTyped()->getBasicType() == EbtInt || -#ifdef AMD_EXTENSIONS - children[0]->getAsTyped()->getBasicType() == EbtInt16 || -#endif - children[0]->getAsTyped()->getBasicType() == EbtInt64; - bool isInt64 = children[0]->getAsTyped()->getBasicType() == EbtInt64 || - children[0]->getAsTyped()->getBasicType() == EbtUint64; if (componentwise) { for (int comp = 0; comp < objectSize; comp++) { @@ -783,53 +787,114 @@ newConstArray[comp].setDConst(pow(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst())); break; case EOpMin: - if (isFloatingPoint) + switch(children[0]->getAsTyped()->getBasicType()) { + case EbtFloat16: + case EbtFloat: + case EbtDouble: newConstArray[comp].setDConst(std::min(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst())); - else if (isSigned) { - if (isInt64) - newConstArray[comp].setI64Const(std::min(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const())); - else - newConstArray[comp].setIConst(std::min(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst())); - } else { - if (isInt64) - newConstArray[comp].setU64Const(std::min(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const())); - else - newConstArray[comp].setUConst(std::min(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst())); + break; + case EbtInt8: + newConstArray[comp].setI8Const(std::min(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const())); + break; + case EbtUint8: + newConstArray[comp].setU8Const(std::min(childConstUnions[0][arg0comp].getU8Const(), childConstUnions[1][arg1comp].getU8Const())); + break; + case EbtInt16: + newConstArray[comp].setI16Const(std::min(childConstUnions[0][arg0comp].getI16Const(), childConstUnions[1][arg1comp].getI16Const())); + break; + case EbtUint16: + newConstArray[comp].setU16Const(std::min(childConstUnions[0][arg0comp].getU16Const(), childConstUnions[1][arg1comp].getU16Const())); + break; + case EbtInt: + newConstArray[comp].setIConst(std::min(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst())); + break; + case EbtUint: + newConstArray[comp].setUConst(std::min(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst())); + break; + case EbtInt64: + newConstArray[comp].setI64Const(std::min(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const())); + break; + case EbtUint64: + newConstArray[comp].setU64Const(std::min(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const())); + break; + default: assert(false && "Default missing"); } break; case EOpMax: - if (isFloatingPoint) + switch(children[0]->getAsTyped()->getBasicType()) { + case EbtFloat16: + case EbtFloat: + case EbtDouble: newConstArray[comp].setDConst(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst())); - else if (isSigned) { - if (isInt64) - newConstArray[comp].setI64Const(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const())); - else - newConstArray[comp].setIConst(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst())); - } else { - if (isInt64) - newConstArray[comp].setU64Const(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const())); - else - newConstArray[comp].setUConst(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst())); + break; + case EbtInt8: + newConstArray[comp].setI8Const(std::max(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const())); + break; + case EbtUint8: + newConstArray[comp].setU8Const(std::max(childConstUnions[0][arg0comp].getU8Const(), childConstUnions[1][arg1comp].getU8Const())); + break; + case EbtInt16: + newConstArray[comp].setI16Const(std::max(childConstUnions[0][arg0comp].getI16Const(), childConstUnions[1][arg1comp].getI16Const())); + break; + case EbtUint16: + newConstArray[comp].setU16Const(std::max(childConstUnions[0][arg0comp].getU16Const(), childConstUnions[1][arg1comp].getU16Const())); + break; + case EbtInt: + newConstArray[comp].setIConst(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst())); + break; + case EbtUint: + newConstArray[comp].setUConst(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst())); + break; + case EbtInt64: + newConstArray[comp].setI64Const(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const())); + break; + case EbtUint64: + newConstArray[comp].setU64Const(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const())); + break; + default: assert(false && "Default missing"); } break; case EOpClamp: - if (isFloatingPoint) + switch(children[0]->getAsTyped()->getBasicType()) { + case EbtFloat16: + case EbtFloat: + case EbtDouble: newConstArray[comp].setDConst(std::min(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()), childConstUnions[2][arg2comp].getDConst())); - else if (isSigned) { - if (isInt64) - newConstArray[comp].setI64Const(std::min(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()), - childConstUnions[2][arg2comp].getI64Const())); - else - newConstArray[comp].setIConst(std::min(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()), + break; + case EbtInt8: + newConstArray[comp].setI8Const(std::min(std::max(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()), + childConstUnions[2][arg2comp].getI8Const())); + break; + case EbtUint8: + newConstArray[comp].setU8Const(std::min(std::max(childConstUnions[0][arg0comp].getU8Const(), childConstUnions[1][arg1comp].getU8Const()), + childConstUnions[2][arg2comp].getU8Const())); + break; + case EbtInt16: + newConstArray[comp].setI16Const(std::min(std::max(childConstUnions[0][arg0comp].getI16Const(), childConstUnions[1][arg1comp].getI16Const()), + childConstUnions[2][arg2comp].getI16Const())); + break; + case EbtUint16: + newConstArray[comp].setU16Const(std::min(std::max(childConstUnions[0][arg0comp].getU16Const(), childConstUnions[1][arg1comp].getU16Const()), + childConstUnions[2][arg2comp].getU16Const())); + break; + case EbtInt: + newConstArray[comp].setIConst(std::min(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()), childConstUnions[2][arg2comp].getIConst())); - } else { - if (isInt64) - newConstArray[comp].setU64Const(std::min(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()), - childConstUnions[2][arg2comp].getU64Const())); - else - newConstArray[comp].setUConst(std::min(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()), + break; + case EbtUint: + newConstArray[comp].setUConst(std::min(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()), childConstUnions[2][arg2comp].getUConst())); + break; + case EbtInt64: + newConstArray[comp].setI64Const(std::min(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()), + childConstUnions[2][arg2comp].getI64Const())); + break; + case EbtUint64: + newConstArray[comp].setU64Const(std::min(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()), + childConstUnions[2][arg2comp].getU64Const())); + break; + default: assert(false && "Default missing"); } break; case EOpLessThan: diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/glslang_tab.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/glslang_tab.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/glslang_tab.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/glslang_tab.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -62,7 +62,7 @@ /* Copy the first part of user declarations. */ -#line 41 "MachineIndependent/glslang.y" /* yacc.c:339 */ +#line 42 "MachineIndependent/glslang.y" /* yacc.c:339 */ /* Based on: @@ -83,11 +83,12 @@ #include "SymbolTable.h" #include "ParseHelper.h" #include "../Public/ShaderLang.h" +#include "attribute.h" using namespace glslang; -#line 91 "MachineIndependent/glslang_tab.cpp" /* yacc.c:339 */ +#line 92 "MachineIndependent/glslang_tab.cpp" /* yacc.c:339 */ # ifndef YY_NULL # if defined __cplusplus && 201103L <= __cplusplus @@ -124,299 +125,392 @@ { ATTRIBUTE = 258, VARYING = 259, - CONST = 260, - BOOL = 261, - FLOAT = 262, + FLOAT16_T = 260, + FLOAT = 261, + FLOAT32_T = 262, DOUBLE = 263, - INT = 264, - UINT = 265, - INT64_T = 266, - UINT64_T = 267, - INT16_T = 268, - UINT16_T = 269, - FLOAT16_T = 270, - BREAK = 271, - CONTINUE = 272, - DO = 273, - ELSE = 274, - FOR = 275, - IF = 276, - DISCARD = 277, - RETURN = 278, - SWITCH = 279, - CASE = 280, - DEFAULT = 281, - SUBROUTINE = 282, - BVEC2 = 283, - BVEC3 = 284, - BVEC4 = 285, - IVEC2 = 286, - IVEC3 = 287, - IVEC4 = 288, - I64VEC2 = 289, - I64VEC3 = 290, - I64VEC4 = 291, - UVEC2 = 292, - UVEC3 = 293, - UVEC4 = 294, - U64VEC2 = 295, - U64VEC3 = 296, - U64VEC4 = 297, - VEC2 = 298, - VEC3 = 299, - VEC4 = 300, - MAT2 = 301, - MAT3 = 302, - MAT4 = 303, - CENTROID = 304, - IN = 305, - OUT = 306, - INOUT = 307, - UNIFORM = 308, - PATCH = 309, - SAMPLE = 310, - BUFFER = 311, - SHARED = 312, - COHERENT = 313, - VOLATILE = 314, - RESTRICT = 315, - READONLY = 316, - WRITEONLY = 317, - DVEC2 = 318, - DVEC3 = 319, - DVEC4 = 320, - DMAT2 = 321, - DMAT3 = 322, - DMAT4 = 323, - F16VEC2 = 324, - F16VEC3 = 325, - F16VEC4 = 326, - F16MAT2 = 327, - F16MAT3 = 328, - F16MAT4 = 329, - I16VEC2 = 330, - I16VEC3 = 331, - I16VEC4 = 332, - U16VEC2 = 333, - U16VEC3 = 334, - U16VEC4 = 335, - NOPERSPECTIVE = 336, - FLAT = 337, - SMOOTH = 338, - LAYOUT = 339, - __EXPLICITINTERPAMD = 340, - MAT2X2 = 341, - MAT2X3 = 342, - MAT2X4 = 343, - MAT3X2 = 344, - MAT3X3 = 345, - MAT3X4 = 346, - MAT4X2 = 347, - MAT4X3 = 348, - MAT4X4 = 349, - DMAT2X2 = 350, - DMAT2X3 = 351, - DMAT2X4 = 352, - DMAT3X2 = 353, - DMAT3X3 = 354, - DMAT3X4 = 355, - DMAT4X2 = 356, - DMAT4X3 = 357, - DMAT4X4 = 358, - F16MAT2X2 = 359, - F16MAT2X3 = 360, - F16MAT2X4 = 361, - F16MAT3X2 = 362, - F16MAT3X3 = 363, - F16MAT3X4 = 364, - F16MAT4X2 = 365, - F16MAT4X3 = 366, - F16MAT4X4 = 367, - ATOMIC_UINT = 368, - SAMPLER1D = 369, - SAMPLER2D = 370, - SAMPLER3D = 371, - SAMPLERCUBE = 372, - SAMPLER1DSHADOW = 373, - SAMPLER2DSHADOW = 374, - SAMPLERCUBESHADOW = 375, - SAMPLER1DARRAY = 376, - SAMPLER2DARRAY = 377, - SAMPLER1DARRAYSHADOW = 378, - SAMPLER2DARRAYSHADOW = 379, - ISAMPLER1D = 380, - ISAMPLER2D = 381, - ISAMPLER3D = 382, - ISAMPLERCUBE = 383, - ISAMPLER1DARRAY = 384, - ISAMPLER2DARRAY = 385, - USAMPLER1D = 386, - USAMPLER2D = 387, - USAMPLER3D = 388, - USAMPLERCUBE = 389, - USAMPLER1DARRAY = 390, - USAMPLER2DARRAY = 391, - SAMPLER2DRECT = 392, - SAMPLER2DRECTSHADOW = 393, - ISAMPLER2DRECT = 394, - USAMPLER2DRECT = 395, - SAMPLERBUFFER = 396, - ISAMPLERBUFFER = 397, - USAMPLERBUFFER = 398, - SAMPLERCUBEARRAY = 399, - SAMPLERCUBEARRAYSHADOW = 400, - ISAMPLERCUBEARRAY = 401, - USAMPLERCUBEARRAY = 402, - SAMPLER2DMS = 403, - ISAMPLER2DMS = 404, - USAMPLER2DMS = 405, - SAMPLER2DMSARRAY = 406, - ISAMPLER2DMSARRAY = 407, - USAMPLER2DMSARRAY = 408, - SAMPLEREXTERNALOES = 409, - SAMPLER = 410, - SAMPLERSHADOW = 411, - TEXTURE1D = 412, - TEXTURE2D = 413, - TEXTURE3D = 414, - TEXTURECUBE = 415, - TEXTURE1DARRAY = 416, - TEXTURE2DARRAY = 417, - ITEXTURE1D = 418, - ITEXTURE2D = 419, - ITEXTURE3D = 420, - ITEXTURECUBE = 421, - ITEXTURE1DARRAY = 422, - ITEXTURE2DARRAY = 423, - UTEXTURE1D = 424, - UTEXTURE2D = 425, - UTEXTURE3D = 426, - UTEXTURECUBE = 427, - UTEXTURE1DARRAY = 428, - UTEXTURE2DARRAY = 429, - TEXTURE2DRECT = 430, - ITEXTURE2DRECT = 431, - UTEXTURE2DRECT = 432, - TEXTUREBUFFER = 433, - ITEXTUREBUFFER = 434, - UTEXTUREBUFFER = 435, - TEXTURECUBEARRAY = 436, - ITEXTURECUBEARRAY = 437, - UTEXTURECUBEARRAY = 438, - TEXTURE2DMS = 439, - ITEXTURE2DMS = 440, - UTEXTURE2DMS = 441, - TEXTURE2DMSARRAY = 442, - ITEXTURE2DMSARRAY = 443, - UTEXTURE2DMSARRAY = 444, - SUBPASSINPUT = 445, - SUBPASSINPUTMS = 446, - ISUBPASSINPUT = 447, - ISUBPASSINPUTMS = 448, - USUBPASSINPUT = 449, - USUBPASSINPUTMS = 450, - IMAGE1D = 451, - IIMAGE1D = 452, - UIMAGE1D = 453, - IMAGE2D = 454, - IIMAGE2D = 455, - UIMAGE2D = 456, - IMAGE3D = 457, - IIMAGE3D = 458, - UIMAGE3D = 459, - IMAGE2DRECT = 460, - IIMAGE2DRECT = 461, - UIMAGE2DRECT = 462, - IMAGECUBE = 463, - IIMAGECUBE = 464, - UIMAGECUBE = 465, - IMAGEBUFFER = 466, - IIMAGEBUFFER = 467, - UIMAGEBUFFER = 468, - IMAGE1DARRAY = 469, - IIMAGE1DARRAY = 470, - UIMAGE1DARRAY = 471, - IMAGE2DARRAY = 472, - IIMAGE2DARRAY = 473, - UIMAGE2DARRAY = 474, - IMAGECUBEARRAY = 475, - IIMAGECUBEARRAY = 476, - UIMAGECUBEARRAY = 477, - IMAGE2DMS = 478, - IIMAGE2DMS = 479, - UIMAGE2DMS = 480, - IMAGE2DMSARRAY = 481, - IIMAGE2DMSARRAY = 482, - UIMAGE2DMSARRAY = 483, - STRUCT = 484, - VOID = 485, - WHILE = 486, - IDENTIFIER = 487, - TYPE_NAME = 488, - FLOATCONSTANT = 489, - DOUBLECONSTANT = 490, - INTCONSTANT = 491, - UINTCONSTANT = 492, - INT64CONSTANT = 493, - UINT64CONSTANT = 494, - INT16CONSTANT = 495, - UINT16CONSTANT = 496, - BOOLCONSTANT = 497, - FLOAT16CONSTANT = 498, - LEFT_OP = 499, - RIGHT_OP = 500, - INC_OP = 501, - DEC_OP = 502, - LE_OP = 503, - GE_OP = 504, - EQ_OP = 505, - NE_OP = 506, - AND_OP = 507, - OR_OP = 508, - XOR_OP = 509, - MUL_ASSIGN = 510, - DIV_ASSIGN = 511, - ADD_ASSIGN = 512, - MOD_ASSIGN = 513, - LEFT_ASSIGN = 514, - RIGHT_ASSIGN = 515, - AND_ASSIGN = 516, - XOR_ASSIGN = 517, - OR_ASSIGN = 518, - SUB_ASSIGN = 519, - LEFT_PAREN = 520, - RIGHT_PAREN = 521, - LEFT_BRACKET = 522, - RIGHT_BRACKET = 523, - LEFT_BRACE = 524, - RIGHT_BRACE = 525, - DOT = 526, - COMMA = 527, - COLON = 528, - EQUAL = 529, - SEMICOLON = 530, - BANG = 531, - DASH = 532, - TILDE = 533, - PLUS = 534, - STAR = 535, - SLASH = 536, - PERCENT = 537, - LEFT_ANGLE = 538, - RIGHT_ANGLE = 539, - VERTICAL_BAR = 540, - CARET = 541, - AMPERSAND = 542, - QUESTION = 543, - INVARIANT = 544, - PRECISE = 545, - HIGH_PRECISION = 546, - MEDIUM_PRECISION = 547, - LOW_PRECISION = 548, - PRECISION = 549, - PACKED = 550, - RESOURCE = 551, - SUPERP = 552 + FLOAT64_T = 264, + CONST = 265, + BOOL = 266, + INT = 267, + UINT = 268, + INT64_T = 269, + UINT64_T = 270, + INT32_T = 271, + UINT32_T = 272, + INT16_T = 273, + UINT16_T = 274, + INT8_T = 275, + UINT8_T = 276, + BREAK = 277, + CONTINUE = 278, + DO = 279, + ELSE = 280, + FOR = 281, + IF = 282, + DISCARD = 283, + RETURN = 284, + SWITCH = 285, + CASE = 286, + DEFAULT = 287, + SUBROUTINE = 288, + BVEC2 = 289, + BVEC3 = 290, + BVEC4 = 291, + IVEC2 = 292, + IVEC3 = 293, + IVEC4 = 294, + UVEC2 = 295, + UVEC3 = 296, + UVEC4 = 297, + I64VEC2 = 298, + I64VEC3 = 299, + I64VEC4 = 300, + U64VEC2 = 301, + U64VEC3 = 302, + U64VEC4 = 303, + I32VEC2 = 304, + I32VEC3 = 305, + I32VEC4 = 306, + U32VEC2 = 307, + U32VEC3 = 308, + U32VEC4 = 309, + I16VEC2 = 310, + I16VEC3 = 311, + I16VEC4 = 312, + U16VEC2 = 313, + U16VEC3 = 314, + U16VEC4 = 315, + I8VEC2 = 316, + I8VEC3 = 317, + I8VEC4 = 318, + U8VEC2 = 319, + U8VEC3 = 320, + U8VEC4 = 321, + VEC2 = 322, + VEC3 = 323, + VEC4 = 324, + MAT2 = 325, + MAT3 = 326, + MAT4 = 327, + CENTROID = 328, + IN = 329, + OUT = 330, + INOUT = 331, + UNIFORM = 332, + PATCH = 333, + SAMPLE = 334, + BUFFER = 335, + SHARED = 336, + NONUNIFORM = 337, + COHERENT = 338, + VOLATILE = 339, + RESTRICT = 340, + READONLY = 341, + WRITEONLY = 342, + DVEC2 = 343, + DVEC3 = 344, + DVEC4 = 345, + DMAT2 = 346, + DMAT3 = 347, + DMAT4 = 348, + F16VEC2 = 349, + F16VEC3 = 350, + F16VEC4 = 351, + F16MAT2 = 352, + F16MAT3 = 353, + F16MAT4 = 354, + F32VEC2 = 355, + F32VEC3 = 356, + F32VEC4 = 357, + F32MAT2 = 358, + F32MAT3 = 359, + F32MAT4 = 360, + F64VEC2 = 361, + F64VEC3 = 362, + F64VEC4 = 363, + F64MAT2 = 364, + F64MAT3 = 365, + F64MAT4 = 366, + NOPERSPECTIVE = 367, + FLAT = 368, + SMOOTH = 369, + LAYOUT = 370, + __EXPLICITINTERPAMD = 371, + MAT2X2 = 372, + MAT2X3 = 373, + MAT2X4 = 374, + MAT3X2 = 375, + MAT3X3 = 376, + MAT3X4 = 377, + MAT4X2 = 378, + MAT4X3 = 379, + MAT4X4 = 380, + DMAT2X2 = 381, + DMAT2X3 = 382, + DMAT2X4 = 383, + DMAT3X2 = 384, + DMAT3X3 = 385, + DMAT3X4 = 386, + DMAT4X2 = 387, + DMAT4X3 = 388, + DMAT4X4 = 389, + F16MAT2X2 = 390, + F16MAT2X3 = 391, + F16MAT2X4 = 392, + F16MAT3X2 = 393, + F16MAT3X3 = 394, + F16MAT3X4 = 395, + F16MAT4X2 = 396, + F16MAT4X3 = 397, + F16MAT4X4 = 398, + F32MAT2X2 = 399, + F32MAT2X3 = 400, + F32MAT2X4 = 401, + F32MAT3X2 = 402, + F32MAT3X3 = 403, + F32MAT3X4 = 404, + F32MAT4X2 = 405, + F32MAT4X3 = 406, + F32MAT4X4 = 407, + F64MAT2X2 = 408, + F64MAT2X3 = 409, + F64MAT2X4 = 410, + F64MAT3X2 = 411, + F64MAT3X3 = 412, + F64MAT3X4 = 413, + F64MAT4X2 = 414, + F64MAT4X3 = 415, + F64MAT4X4 = 416, + ATOMIC_UINT = 417, + SAMPLER1D = 418, + SAMPLER2D = 419, + SAMPLER3D = 420, + SAMPLERCUBE = 421, + SAMPLER1DSHADOW = 422, + SAMPLER2DSHADOW = 423, + SAMPLERCUBESHADOW = 424, + SAMPLER1DARRAY = 425, + SAMPLER2DARRAY = 426, + SAMPLER1DARRAYSHADOW = 427, + SAMPLER2DARRAYSHADOW = 428, + ISAMPLER1D = 429, + ISAMPLER2D = 430, + ISAMPLER3D = 431, + ISAMPLERCUBE = 432, + ISAMPLER1DARRAY = 433, + ISAMPLER2DARRAY = 434, + USAMPLER1D = 435, + USAMPLER2D = 436, + USAMPLER3D = 437, + USAMPLERCUBE = 438, + USAMPLER1DARRAY = 439, + USAMPLER2DARRAY = 440, + SAMPLER2DRECT = 441, + SAMPLER2DRECTSHADOW = 442, + ISAMPLER2DRECT = 443, + USAMPLER2DRECT = 444, + SAMPLERBUFFER = 445, + ISAMPLERBUFFER = 446, + USAMPLERBUFFER = 447, + SAMPLERCUBEARRAY = 448, + SAMPLERCUBEARRAYSHADOW = 449, + ISAMPLERCUBEARRAY = 450, + USAMPLERCUBEARRAY = 451, + SAMPLER2DMS = 452, + ISAMPLER2DMS = 453, + USAMPLER2DMS = 454, + SAMPLER2DMSARRAY = 455, + ISAMPLER2DMSARRAY = 456, + USAMPLER2DMSARRAY = 457, + SAMPLEREXTERNALOES = 458, + F16SAMPLER1D = 459, + F16SAMPLER2D = 460, + F16SAMPLER3D = 461, + F16SAMPLER2DRECT = 462, + F16SAMPLERCUBE = 463, + F16SAMPLER1DARRAY = 464, + F16SAMPLER2DARRAY = 465, + F16SAMPLERCUBEARRAY = 466, + F16SAMPLERBUFFER = 467, + F16SAMPLER2DMS = 468, + F16SAMPLER2DMSARRAY = 469, + F16SAMPLER1DSHADOW = 470, + F16SAMPLER2DSHADOW = 471, + F16SAMPLER1DARRAYSHADOW = 472, + F16SAMPLER2DARRAYSHADOW = 473, + F16SAMPLER2DRECTSHADOW = 474, + F16SAMPLERCUBESHADOW = 475, + F16SAMPLERCUBEARRAYSHADOW = 476, + SAMPLER = 477, + SAMPLERSHADOW = 478, + TEXTURE1D = 479, + TEXTURE2D = 480, + TEXTURE3D = 481, + TEXTURECUBE = 482, + TEXTURE1DARRAY = 483, + TEXTURE2DARRAY = 484, + ITEXTURE1D = 485, + ITEXTURE2D = 486, + ITEXTURE3D = 487, + ITEXTURECUBE = 488, + ITEXTURE1DARRAY = 489, + ITEXTURE2DARRAY = 490, + UTEXTURE1D = 491, + UTEXTURE2D = 492, + UTEXTURE3D = 493, + UTEXTURECUBE = 494, + UTEXTURE1DARRAY = 495, + UTEXTURE2DARRAY = 496, + TEXTURE2DRECT = 497, + ITEXTURE2DRECT = 498, + UTEXTURE2DRECT = 499, + TEXTUREBUFFER = 500, + ITEXTUREBUFFER = 501, + UTEXTUREBUFFER = 502, + TEXTURECUBEARRAY = 503, + ITEXTURECUBEARRAY = 504, + UTEXTURECUBEARRAY = 505, + TEXTURE2DMS = 506, + ITEXTURE2DMS = 507, + UTEXTURE2DMS = 508, + TEXTURE2DMSARRAY = 509, + ITEXTURE2DMSARRAY = 510, + UTEXTURE2DMSARRAY = 511, + F16TEXTURE1D = 512, + F16TEXTURE2D = 513, + F16TEXTURE3D = 514, + F16TEXTURE2DRECT = 515, + F16TEXTURECUBE = 516, + F16TEXTURE1DARRAY = 517, + F16TEXTURE2DARRAY = 518, + F16TEXTURECUBEARRAY = 519, + F16TEXTUREBUFFER = 520, + F16TEXTURE2DMS = 521, + F16TEXTURE2DMSARRAY = 522, + SUBPASSINPUT = 523, + SUBPASSINPUTMS = 524, + ISUBPASSINPUT = 525, + ISUBPASSINPUTMS = 526, + USUBPASSINPUT = 527, + USUBPASSINPUTMS = 528, + F16SUBPASSINPUT = 529, + F16SUBPASSINPUTMS = 530, + IMAGE1D = 531, + IIMAGE1D = 532, + UIMAGE1D = 533, + IMAGE2D = 534, + IIMAGE2D = 535, + UIMAGE2D = 536, + IMAGE3D = 537, + IIMAGE3D = 538, + UIMAGE3D = 539, + IMAGE2DRECT = 540, + IIMAGE2DRECT = 541, + UIMAGE2DRECT = 542, + IMAGECUBE = 543, + IIMAGECUBE = 544, + UIMAGECUBE = 545, + IMAGEBUFFER = 546, + IIMAGEBUFFER = 547, + UIMAGEBUFFER = 548, + IMAGE1DARRAY = 549, + IIMAGE1DARRAY = 550, + UIMAGE1DARRAY = 551, + IMAGE2DARRAY = 552, + IIMAGE2DARRAY = 553, + UIMAGE2DARRAY = 554, + IMAGECUBEARRAY = 555, + IIMAGECUBEARRAY = 556, + UIMAGECUBEARRAY = 557, + IMAGE2DMS = 558, + IIMAGE2DMS = 559, + UIMAGE2DMS = 560, + IMAGE2DMSARRAY = 561, + IIMAGE2DMSARRAY = 562, + UIMAGE2DMSARRAY = 563, + F16IMAGE1D = 564, + F16IMAGE2D = 565, + F16IMAGE3D = 566, + F16IMAGE2DRECT = 567, + F16IMAGECUBE = 568, + F16IMAGE1DARRAY = 569, + F16IMAGE2DARRAY = 570, + F16IMAGECUBEARRAY = 571, + F16IMAGEBUFFER = 572, + F16IMAGE2DMS = 573, + F16IMAGE2DMSARRAY = 574, + STRUCT = 575, + VOID = 576, + WHILE = 577, + IDENTIFIER = 578, + TYPE_NAME = 579, + FLOATCONSTANT = 580, + DOUBLECONSTANT = 581, + INT16CONSTANT = 582, + UINT16CONSTANT = 583, + INT32CONSTANT = 584, + UINT32CONSTANT = 585, + INTCONSTANT = 586, + UINTCONSTANT = 587, + INT64CONSTANT = 588, + UINT64CONSTANT = 589, + BOOLCONSTANT = 590, + FLOAT16CONSTANT = 591, + LEFT_OP = 592, + RIGHT_OP = 593, + INC_OP = 594, + DEC_OP = 595, + LE_OP = 596, + GE_OP = 597, + EQ_OP = 598, + NE_OP = 599, + AND_OP = 600, + OR_OP = 601, + XOR_OP = 602, + MUL_ASSIGN = 603, + DIV_ASSIGN = 604, + ADD_ASSIGN = 605, + MOD_ASSIGN = 606, + LEFT_ASSIGN = 607, + RIGHT_ASSIGN = 608, + AND_ASSIGN = 609, + XOR_ASSIGN = 610, + OR_ASSIGN = 611, + SUB_ASSIGN = 612, + LEFT_PAREN = 613, + RIGHT_PAREN = 614, + LEFT_BRACKET = 615, + RIGHT_BRACKET = 616, + LEFT_BRACE = 617, + RIGHT_BRACE = 618, + DOT = 619, + COMMA = 620, + COLON = 621, + EQUAL = 622, + SEMICOLON = 623, + BANG = 624, + DASH = 625, + TILDE = 626, + PLUS = 627, + STAR = 628, + SLASH = 629, + PERCENT = 630, + LEFT_ANGLE = 631, + RIGHT_ANGLE = 632, + VERTICAL_BAR = 633, + CARET = 634, + AMPERSAND = 635, + QUESTION = 636, + INVARIANT = 637, + PRECISE = 638, + HIGH_PRECISION = 639, + MEDIUM_PRECISION = 640, + LOW_PRECISION = 641, + PRECISION = 642, + PACKED = 643, + RESOURCE = 644, + SUPERP = 645 }; #endif @@ -425,7 +519,7 @@ typedef union YYSTYPE YYSTYPE; union YYSTYPE { -#line 68 "MachineIndependent/glslang.y" /* yacc.c:355 */ +#line 70 "MachineIndependent/glslang.y" /* yacc.c:355 */ struct { glslang::TSourceLoc loc; @@ -447,6 +541,7 @@ TIntermNode* intermNode; glslang::TIntermNodePair nodePair; glslang::TIntermTyped* intermTypedNode; + glslang::TAttributes* attributes; }; union { glslang::TPublicType type; @@ -459,7 +554,7 @@ }; } interm; -#line 463 "MachineIndependent/glslang_tab.cpp" /* yacc.c:355 */ +#line 558 "MachineIndependent/glslang_tab.cpp" /* yacc.c:355 */ }; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 @@ -472,7 +567,7 @@ #endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */ /* Copy the second part of user declarations. */ -#line 102 "MachineIndependent/glslang.y" /* yacc.c:358 */ +#line 105 "MachineIndependent/glslang.y" /* yacc.c:358 */ /* windows only pragma */ @@ -488,7 +583,7 @@ extern int yylex(YYSTYPE*, TParseContext&); -#line 492 "MachineIndependent/glslang_tab.cpp" /* yacc.c:358 */ +#line 587 "MachineIndependent/glslang_tab.cpp" /* yacc.c:358 */ #ifdef short # undef short @@ -709,23 +804,23 @@ #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 274 +#define YYFINAL 366 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 6614 +#define YYLAST 8949 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 298 +#define YYNTOKENS 391 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 100 +#define YYNNTS 107 /* YYNRULES -- Number of rules. */ -#define YYNRULES 450 +#define YYNRULES 556 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 582 +#define YYNSTATES 697 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 552 +#define YYMAXUTOK 645 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -789,59 +884,78 @@ 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297 + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 388, 389, 390 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 253, 253, 259, 262, 265, 269, 273, 277, 283, - 289, 292, 296, 302, 305, 313, 316, 319, 322, 325, - 330, 338, 345, 352, 358, 362, 369, 372, 378, 385, - 395, 403, 408, 438, 444, 448, 452, 472, 473, 474, - 475, 481, 482, 487, 492, 501, 502, 507, 515, 516, - 522, 531, 532, 537, 542, 547, 555, 556, 564, 575, - 576, 585, 586, 595, 596, 605, 606, 614, 615, 623, - 624, 632, 633, 633, 651, 652, 667, 671, 675, 679, - 684, 688, 692, 696, 700, 704, 708, 715, 718, 729, - 736, 741, 746, 754, 758, 762, 766, 771, 776, 785, - 785, 796, 800, 807, 814, 817, 824, 832, 852, 875, - 890, 913, 924, 934, 944, 954, 963, 966, 970, 974, - 979, 987, 992, 997, 1002, 1007, 1016, 1027, 1054, 1063, - 1070, 1077, 1084, 1096, 1102, 1105, 1112, 1116, 1120, 1128, - 1137, 1140, 1151, 1154, 1157, 1161, 1165, 1169, 1176, 1180, - 1192, 1206, 1211, 1217, 1223, 1230, 1236, 1241, 1246, 1251, - 1259, 1263, 1267, 1271, 1275, 1279, 1285, 1294, 1297, 1305, - 1309, 1318, 1323, 1331, 1335, 1345, 1349, 1353, 1358, 1365, - 1369, 1374, 1379, 1384, 1391, 1398, 1402, 1407, 1412, 1417, - 1423, 1429, 1435, 1443, 1451, 1459, 1464, 1469, 1474, 1479, - 1484, 1489, 1495, 1501, 1507, 1515, 1523, 1531, 1537, 1543, - 1549, 1555, 1561, 1567, 1575, 1583, 1591, 1596, 1601, 1606, - 1611, 1616, 1621, 1626, 1631, 1636, 1641, 1646, 1651, 1657, - 1663, 1669, 1675, 1681, 1687, 1693, 1699, 1705, 1711, 1717, - 1723, 1731, 1739, 1747, 1755, 1763, 1771, 1779, 1787, 1795, - 1803, 1811, 1819, 1824, 1829, 1834, 1839, 1844, 1849, 1854, - 1859, 1864, 1869, 1874, 1879, 1884, 1889, 1894, 1899, 1904, - 1909, 1914, 1919, 1924, 1929, 1934, 1939, 1944, 1949, 1954, - 1959, 1964, 1969, 1974, 1979, 1984, 1989, 1994, 1999, 2004, - 2009, 2014, 2019, 2024, 2029, 2034, 2039, 2044, 2049, 2054, - 2059, 2064, 2069, 2074, 2079, 2084, 2089, 2094, 2099, 2104, - 2109, 2114, 2119, 2124, 2129, 2134, 2139, 2144, 2149, 2154, - 2159, 2164, 2169, 2174, 2179, 2184, 2189, 2194, 2199, 2204, - 2209, 2214, 2219, 2224, 2229, 2234, 2239, 2244, 2249, 2254, - 2259, 2264, 2269, 2274, 2279, 2284, 2289, 2294, 2299, 2304, - 2309, 2314, 2319, 2324, 2329, 2334, 2339, 2344, 2349, 2354, - 2359, 2364, 2370, 2376, 2382, 2388, 2394, 2400, 2406, 2411, - 2427, 2432, 2437, 2445, 2445, 2456, 2456, 2466, 2469, 2482, - 2500, 2524, 2528, 2534, 2539, 2550, 2553, 2559, 2568, 2571, - 2577, 2581, 2582, 2588, 2589, 2590, 2591, 2592, 2593, 2594, - 2598, 2599, 2603, 2599, 2615, 2616, 2620, 2620, 2627, 2627, - 2641, 2644, 2652, 2660, 2671, 2672, 2676, 2683, 2687, 2695, - 2699, 2712, 2712, 2732, 2735, 2741, 2753, 2765, 2765, 2780, - 2780, 2796, 2796, 2817, 2820, 2826, 2829, 2835, 2839, 2846, - 2851, 2856, 2863, 2866, 2875, 2879, 2888, 2891, 2894, 2902, - 2902 + 0, 293, 293, 299, 302, 306, 310, 313, 317, 321, + 325, 329, 333, 336, 340, 344, 347, 355, 358, 361, + 364, 367, 372, 380, 387, 394, 400, 404, 411, 414, + 420, 427, 437, 445, 450, 477, 485, 491, 495, 499, + 519, 520, 521, 522, 528, 529, 534, 539, 548, 549, + 554, 562, 563, 569, 578, 579, 584, 589, 594, 602, + 603, 611, 622, 623, 632, 633, 642, 643, 652, 653, + 661, 662, 670, 671, 679, 680, 680, 698, 699, 714, + 718, 722, 726, 731, 735, 739, 743, 747, 751, 755, + 762, 765, 776, 783, 788, 793, 801, 805, 809, 813, + 818, 823, 832, 832, 843, 847, 854, 861, 864, 871, + 879, 899, 922, 937, 962, 973, 983, 993, 1003, 1012, + 1015, 1019, 1023, 1028, 1036, 1041, 1046, 1051, 1056, 1065, + 1076, 1103, 1112, 1119, 1126, 1137, 1149, 1155, 1158, 1165, + 1169, 1173, 1181, 1190, 1193, 1204, 1207, 1210, 1214, 1218, + 1222, 1226, 1232, 1236, 1248, 1262, 1267, 1273, 1279, 1286, + 1292, 1297, 1302, 1307, 1315, 1319, 1323, 1327, 1331, 1335, + 1341, 1350, 1357, 1360, 1368, 1372, 1381, 1386, 1394, 1398, + 1408, 1412, 1416, 1421, 1426, 1431, 1436, 1440, 1445, 1450, + 1455, 1460, 1465, 1470, 1475, 1480, 1485, 1489, 1494, 1499, + 1504, 1510, 1516, 1522, 1528, 1534, 1540, 1546, 1552, 1558, + 1564, 1570, 1576, 1581, 1586, 1591, 1596, 1601, 1606, 1612, + 1618, 1624, 1630, 1636, 1642, 1648, 1654, 1660, 1666, 1672, + 1678, 1684, 1690, 1696, 1702, 1708, 1714, 1720, 1726, 1732, + 1738, 1744, 1750, 1756, 1762, 1768, 1773, 1778, 1783, 1788, + 1793, 1798, 1803, 1808, 1813, 1818, 1823, 1828, 1834, 1840, + 1846, 1852, 1858, 1864, 1870, 1876, 1882, 1888, 1894, 1900, + 1906, 1912, 1918, 1924, 1930, 1936, 1942, 1948, 1954, 1960, + 1966, 1972, 1978, 1984, 1990, 1996, 2002, 2008, 2014, 2020, + 2026, 2032, 2038, 2044, 2050, 2056, 2062, 2068, 2074, 2080, + 2086, 2092, 2098, 2104, 2110, 2116, 2121, 2126, 2131, 2136, + 2141, 2146, 2151, 2156, 2161, 2166, 2171, 2176, 2181, 2186, + 2194, 2202, 2210, 2218, 2226, 2234, 2242, 2250, 2258, 2266, + 2274, 2282, 2290, 2295, 2300, 2305, 2310, 2315, 2320, 2325, + 2330, 2335, 2340, 2345, 2350, 2355, 2360, 2365, 2370, 2378, + 2386, 2391, 2396, 2401, 2409, 2414, 2419, 2424, 2432, 2437, + 2442, 2447, 2455, 2460, 2465, 2470, 2475, 2480, 2488, 2493, + 2501, 2506, 2514, 2519, 2527, 2532, 2540, 2545, 2553, 2558, + 2566, 2571, 2576, 2581, 2586, 2591, 2596, 2601, 2606, 2611, + 2616, 2621, 2626, 2631, 2636, 2641, 2649, 2654, 2659, 2664, + 2672, 2677, 2682, 2687, 2695, 2700, 2705, 2710, 2718, 2723, + 2728, 2733, 2741, 2746, 2751, 2756, 2764, 2769, 2774, 2779, + 2787, 2792, 2797, 2802, 2810, 2815, 2820, 2825, 2833, 2838, + 2843, 2848, 2856, 2861, 2866, 2871, 2879, 2884, 2889, 2894, + 2902, 2907, 2912, 2917, 2925, 2930, 2935, 2940, 2948, 2953, + 2958, 2963, 2971, 2976, 2981, 2987, 2993, 2999, 3008, 3017, + 3023, 3029, 3035, 3041, 3046, 3062, 3067, 3072, 3080, 3080, + 3091, 3091, 3101, 3104, 3117, 3139, 3166, 3170, 3176, 3181, + 3192, 3195, 3201, 3210, 3213, 3219, 3223, 3224, 3230, 3231, + 3232, 3233, 3234, 3235, 3236, 3240, 3241, 3245, 3241, 3257, + 3258, 3262, 3262, 3269, 3269, 3283, 3286, 3294, 3302, 3313, + 3314, 3318, 3321, 3327, 3334, 3338, 3346, 3350, 3363, 3366, + 3372, 3372, 3392, 3395, 3401, 3413, 3425, 3428, 3434, 3434, + 3449, 3449, 3465, 3465, 3486, 3489, 3495, 3498, 3504, 3508, + 3515, 3520, 3525, 3532, 3535, 3544, 3548, 3557, 3560, 3563, + 3571, 3571, 3593, 3599, 3602, 3607, 3610 }; #endif @@ -850,25 +964,34 @@ First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "ATTRIBUTE", "VARYING", "CONST", "BOOL", - "FLOAT", "DOUBLE", "INT", "UINT", "INT64_T", "UINT64_T", "INT16_T", - "UINT16_T", "FLOAT16_T", "BREAK", "CONTINUE", "DO", "ELSE", "FOR", "IF", - "DISCARD", "RETURN", "SWITCH", "CASE", "DEFAULT", "SUBROUTINE", "BVEC2", - "BVEC3", "BVEC4", "IVEC2", "IVEC3", "IVEC4", "I64VEC2", "I64VEC3", - "I64VEC4", "UVEC2", "UVEC3", "UVEC4", "U64VEC2", "U64VEC3", "U64VEC4", - "VEC2", "VEC3", "VEC4", "MAT2", "MAT3", "MAT4", "CENTROID", "IN", "OUT", - "INOUT", "UNIFORM", "PATCH", "SAMPLE", "BUFFER", "SHARED", "COHERENT", - "VOLATILE", "RESTRICT", "READONLY", "WRITEONLY", "DVEC2", "DVEC3", - "DVEC4", "DMAT2", "DMAT3", "DMAT4", "F16VEC2", "F16VEC3", "F16VEC4", - "F16MAT2", "F16MAT3", "F16MAT4", "I16VEC2", "I16VEC3", "I16VEC4", - "U16VEC2", "U16VEC3", "U16VEC4", "NOPERSPECTIVE", "FLAT", "SMOOTH", - "LAYOUT", "__EXPLICITINTERPAMD", "MAT2X2", "MAT2X3", "MAT2X4", "MAT3X2", - "MAT3X3", "MAT3X4", "MAT4X2", "MAT4X3", "MAT4X4", "DMAT2X2", "DMAT2X3", - "DMAT2X4", "DMAT3X2", "DMAT3X3", "DMAT3X4", "DMAT4X2", "DMAT4X3", - "DMAT4X4", "F16MAT2X2", "F16MAT2X3", "F16MAT2X4", "F16MAT3X2", - "F16MAT3X3", "F16MAT3X4", "F16MAT4X2", "F16MAT4X3", "F16MAT4X4", - "ATOMIC_UINT", "SAMPLER1D", "SAMPLER2D", "SAMPLER3D", "SAMPLERCUBE", - "SAMPLER1DSHADOW", "SAMPLER2DSHADOW", "SAMPLERCUBESHADOW", + "$end", "error", "$undefined", "ATTRIBUTE", "VARYING", "FLOAT16_T", + "FLOAT", "FLOAT32_T", "DOUBLE", "FLOAT64_T", "CONST", "BOOL", "INT", + "UINT", "INT64_T", "UINT64_T", "INT32_T", "UINT32_T", "INT16_T", + "UINT16_T", "INT8_T", "UINT8_T", "BREAK", "CONTINUE", "DO", "ELSE", + "FOR", "IF", "DISCARD", "RETURN", "SWITCH", "CASE", "DEFAULT", + "SUBROUTINE", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3", "IVEC4", + "UVEC2", "UVEC3", "UVEC4", "I64VEC2", "I64VEC3", "I64VEC4", "U64VEC2", + "U64VEC3", "U64VEC4", "I32VEC2", "I32VEC3", "I32VEC4", "U32VEC2", + "U32VEC3", "U32VEC4", "I16VEC2", "I16VEC3", "I16VEC4", "U16VEC2", + "U16VEC3", "U16VEC4", "I8VEC2", "I8VEC3", "I8VEC4", "U8VEC2", "U8VEC3", + "U8VEC4", "VEC2", "VEC3", "VEC4", "MAT2", "MAT3", "MAT4", "CENTROID", + "IN", "OUT", "INOUT", "UNIFORM", "PATCH", "SAMPLE", "BUFFER", "SHARED", + "NONUNIFORM", "COHERENT", "VOLATILE", "RESTRICT", "READONLY", + "WRITEONLY", "DVEC2", "DVEC3", "DVEC4", "DMAT2", "DMAT3", "DMAT4", + "F16VEC2", "F16VEC3", "F16VEC4", "F16MAT2", "F16MAT3", "F16MAT4", + "F32VEC2", "F32VEC3", "F32VEC4", "F32MAT2", "F32MAT3", "F32MAT4", + "F64VEC2", "F64VEC3", "F64VEC4", "F64MAT2", "F64MAT3", "F64MAT4", + "NOPERSPECTIVE", "FLAT", "SMOOTH", "LAYOUT", "__EXPLICITINTERPAMD", + "MAT2X2", "MAT2X3", "MAT2X4", "MAT3X2", "MAT3X3", "MAT3X4", "MAT4X2", + "MAT4X3", "MAT4X4", "DMAT2X2", "DMAT2X3", "DMAT2X4", "DMAT3X2", + "DMAT3X3", "DMAT3X4", "DMAT4X2", "DMAT4X3", "DMAT4X4", "F16MAT2X2", + "F16MAT2X3", "F16MAT2X4", "F16MAT3X2", "F16MAT3X3", "F16MAT3X4", + "F16MAT4X2", "F16MAT4X3", "F16MAT4X4", "F32MAT2X2", "F32MAT2X3", + "F32MAT2X4", "F32MAT3X2", "F32MAT3X3", "F32MAT3X4", "F32MAT4X2", + "F32MAT4X3", "F32MAT4X4", "F64MAT2X2", "F64MAT2X3", "F64MAT2X4", + "F64MAT3X2", "F64MAT3X3", "F64MAT3X4", "F64MAT4X2", "F64MAT4X3", + "F64MAT4X4", "ATOMIC_UINT", "SAMPLER1D", "SAMPLER2D", "SAMPLER3D", + "SAMPLERCUBE", "SAMPLER1DSHADOW", "SAMPLER2DSHADOW", "SAMPLERCUBESHADOW", "SAMPLER1DARRAY", "SAMPLER2DARRAY", "SAMPLER1DARRAYSHADOW", "SAMPLER2DARRAYSHADOW", "ISAMPLER1D", "ISAMPLER2D", "ISAMPLER3D", "ISAMPLERCUBE", "ISAMPLER1DARRAY", "ISAMPLER2DARRAY", "USAMPLER1D", @@ -878,27 +1001,41 @@ "USAMPLERBUFFER", "SAMPLERCUBEARRAY", "SAMPLERCUBEARRAYSHADOW", "ISAMPLERCUBEARRAY", "USAMPLERCUBEARRAY", "SAMPLER2DMS", "ISAMPLER2DMS", "USAMPLER2DMS", "SAMPLER2DMSARRAY", "ISAMPLER2DMSARRAY", - "USAMPLER2DMSARRAY", "SAMPLEREXTERNALOES", "SAMPLER", "SAMPLERSHADOW", - "TEXTURE1D", "TEXTURE2D", "TEXTURE3D", "TEXTURECUBE", "TEXTURE1DARRAY", - "TEXTURE2DARRAY", "ITEXTURE1D", "ITEXTURE2D", "ITEXTURE3D", - "ITEXTURECUBE", "ITEXTURE1DARRAY", "ITEXTURE2DARRAY", "UTEXTURE1D", - "UTEXTURE2D", "UTEXTURE3D", "UTEXTURECUBE", "UTEXTURE1DARRAY", - "UTEXTURE2DARRAY", "TEXTURE2DRECT", "ITEXTURE2DRECT", "UTEXTURE2DRECT", - "TEXTUREBUFFER", "ITEXTUREBUFFER", "UTEXTUREBUFFER", "TEXTURECUBEARRAY", - "ITEXTURECUBEARRAY", "UTEXTURECUBEARRAY", "TEXTURE2DMS", "ITEXTURE2DMS", - "UTEXTURE2DMS", "TEXTURE2DMSARRAY", "ITEXTURE2DMSARRAY", - "UTEXTURE2DMSARRAY", "SUBPASSINPUT", "SUBPASSINPUTMS", "ISUBPASSINPUT", - "ISUBPASSINPUTMS", "USUBPASSINPUT", "USUBPASSINPUTMS", "IMAGE1D", - "IIMAGE1D", "UIMAGE1D", "IMAGE2D", "IIMAGE2D", "UIMAGE2D", "IMAGE3D", - "IIMAGE3D", "UIMAGE3D", "IMAGE2DRECT", "IIMAGE2DRECT", "UIMAGE2DRECT", - "IMAGECUBE", "IIMAGECUBE", "UIMAGECUBE", "IMAGEBUFFER", "IIMAGEBUFFER", - "UIMAGEBUFFER", "IMAGE1DARRAY", "IIMAGE1DARRAY", "UIMAGE1DARRAY", - "IMAGE2DARRAY", "IIMAGE2DARRAY", "UIMAGE2DARRAY", "IMAGECUBEARRAY", - "IIMAGECUBEARRAY", "UIMAGECUBEARRAY", "IMAGE2DMS", "IIMAGE2DMS", - "UIMAGE2DMS", "IMAGE2DMSARRAY", "IIMAGE2DMSARRAY", "UIMAGE2DMSARRAY", - "STRUCT", "VOID", "WHILE", "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT", - "DOUBLECONSTANT", "INTCONSTANT", "UINTCONSTANT", "INT64CONSTANT", - "UINT64CONSTANT", "INT16CONSTANT", "UINT16CONSTANT", "BOOLCONSTANT", + "USAMPLER2DMSARRAY", "SAMPLEREXTERNALOES", "F16SAMPLER1D", + "F16SAMPLER2D", "F16SAMPLER3D", "F16SAMPLER2DRECT", "F16SAMPLERCUBE", + "F16SAMPLER1DARRAY", "F16SAMPLER2DARRAY", "F16SAMPLERCUBEARRAY", + "F16SAMPLERBUFFER", "F16SAMPLER2DMS", "F16SAMPLER2DMSARRAY", + "F16SAMPLER1DSHADOW", "F16SAMPLER2DSHADOW", "F16SAMPLER1DARRAYSHADOW", + "F16SAMPLER2DARRAYSHADOW", "F16SAMPLER2DRECTSHADOW", + "F16SAMPLERCUBESHADOW", "F16SAMPLERCUBEARRAYSHADOW", "SAMPLER", + "SAMPLERSHADOW", "TEXTURE1D", "TEXTURE2D", "TEXTURE3D", "TEXTURECUBE", + "TEXTURE1DARRAY", "TEXTURE2DARRAY", "ITEXTURE1D", "ITEXTURE2D", + "ITEXTURE3D", "ITEXTURECUBE", "ITEXTURE1DARRAY", "ITEXTURE2DARRAY", + "UTEXTURE1D", "UTEXTURE2D", "UTEXTURE3D", "UTEXTURECUBE", + "UTEXTURE1DARRAY", "UTEXTURE2DARRAY", "TEXTURE2DRECT", "ITEXTURE2DRECT", + "UTEXTURE2DRECT", "TEXTUREBUFFER", "ITEXTUREBUFFER", "UTEXTUREBUFFER", + "TEXTURECUBEARRAY", "ITEXTURECUBEARRAY", "UTEXTURECUBEARRAY", + "TEXTURE2DMS", "ITEXTURE2DMS", "UTEXTURE2DMS", "TEXTURE2DMSARRAY", + "ITEXTURE2DMSARRAY", "UTEXTURE2DMSARRAY", "F16TEXTURE1D", "F16TEXTURE2D", + "F16TEXTURE3D", "F16TEXTURE2DRECT", "F16TEXTURECUBE", + "F16TEXTURE1DARRAY", "F16TEXTURE2DARRAY", "F16TEXTURECUBEARRAY", + "F16TEXTUREBUFFER", "F16TEXTURE2DMS", "F16TEXTURE2DMSARRAY", + "SUBPASSINPUT", "SUBPASSINPUTMS", "ISUBPASSINPUT", "ISUBPASSINPUTMS", + "USUBPASSINPUT", "USUBPASSINPUTMS", "F16SUBPASSINPUT", + "F16SUBPASSINPUTMS", "IMAGE1D", "IIMAGE1D", "UIMAGE1D", "IMAGE2D", + "IIMAGE2D", "UIMAGE2D", "IMAGE3D", "IIMAGE3D", "UIMAGE3D", "IMAGE2DRECT", + "IIMAGE2DRECT", "UIMAGE2DRECT", "IMAGECUBE", "IIMAGECUBE", "UIMAGECUBE", + "IMAGEBUFFER", "IIMAGEBUFFER", "UIMAGEBUFFER", "IMAGE1DARRAY", + "IIMAGE1DARRAY", "UIMAGE1DARRAY", "IMAGE2DARRAY", "IIMAGE2DARRAY", + "UIMAGE2DARRAY", "IMAGECUBEARRAY", "IIMAGECUBEARRAY", "UIMAGECUBEARRAY", + "IMAGE2DMS", "IIMAGE2DMS", "UIMAGE2DMS", "IMAGE2DMSARRAY", + "IIMAGE2DMSARRAY", "UIMAGE2DMSARRAY", "F16IMAGE1D", "F16IMAGE2D", + "F16IMAGE3D", "F16IMAGE2DRECT", "F16IMAGECUBE", "F16IMAGE1DARRAY", + "F16IMAGE2DARRAY", "F16IMAGECUBEARRAY", "F16IMAGEBUFFER", "F16IMAGE2DMS", + "F16IMAGE2DMSARRAY", "STRUCT", "VOID", "WHILE", "IDENTIFIER", + "TYPE_NAME", "FLOATCONSTANT", "DOUBLECONSTANT", "INT16CONSTANT", + "UINT16CONSTANT", "INT32CONSTANT", "UINT32CONSTANT", "INTCONSTANT", + "UINTCONSTANT", "INT64CONSTANT", "UINT64CONSTANT", "BOOLCONSTANT", "FLOAT16CONSTANT", "LEFT_OP", "RIGHT_OP", "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP", "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN", "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", @@ -928,20 +1065,24 @@ "fully_specified_type", "invariant_qualifier", "interpolation_qualifier", "layout_qualifier", "layout_qualifier_id_list", "layout_qualifier_id", "precise_qualifier", "type_qualifier", "single_type_qualifier", - "storage_qualifier", "type_name_list", "type_specifier", - "array_specifier", "type_specifier_nonarray", "precision_qualifier", - "struct_specifier", "$@3", "$@4", "struct_declaration_list", - "struct_declaration", "struct_declarator_list", "struct_declarator", - "initializer", "initializer_list", "declaration_statement", "statement", + "storage_qualifier", "non_uniform_qualifier", "type_name_list", + "type_specifier", "array_specifier", "type_specifier_nonarray", + "precision_qualifier", "struct_specifier", "$@3", "$@4", + "struct_declaration_list", "struct_declaration", + "struct_declarator_list", "struct_declarator", "initializer", + "initializer_list", "declaration_statement", "statement", "simple_statement", "compound_statement", "$@5", "$@6", "statement_no_new_scope", "statement_scoped", "$@7", "$@8", "compound_statement_no_new_scope", "statement_list", "expression_statement", "selection_statement", - "selection_rest_statement", "condition", "switch_statement", "$@9", - "switch_statement_list", "case_label", "iteration_statement", "$@10", - "$@11", "$@12", "for_init_statement", "conditionopt", - "for_rest_statement", "jump_statement", "translation_unit", - "external_declaration", "function_definition", "$@13", YY_NULL + "selection_statement_nonattributed", "selection_rest_statement", + "condition", "switch_statement", "switch_statement_nonattributed", "$@9", + "switch_statement_list", "case_label", "iteration_statement", + "iteration_statement_nonattributed", "$@10", "$@11", "$@12", + "for_init_statement", "conditionopt", "for_rest_statement", + "jump_statement", "translation_unit", "external_declaration", + "function_definition", "$@13", "attribute", "attribute_list", + "single_attribute", YY_NULL }; #endif @@ -979,16 +1120,26 @@ 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, - 545, 546, 547, 548, 549, 550, 551, 552 + 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, + 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, + 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, + 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, + 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, + 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645 }; # endif -#define YYPACT_NINF -525 +#define YYPACT_NINF -634 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-525))) + (!!((Yystate) == (-634))) -#define YYTABLE_NINF -407 +#define YYTABLE_NINF -502 #define yytable_value_is_error(Yytable_value) \ 0 @@ -997,65 +1148,76 @@ STATE-NUM. */ static const yytype_int16 yypact[] = { - 2619, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -243, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -228, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -215, -525, -525, -525, - -525, -525, -525, -525, -525, -157, -525, -216, -218, -205, - -141, 4260, -165, -525, -94, -525, -525, -525, -525, 3183, - -525, -525, -525, -117, -525, -525, 575, -525, -525, -80, - -48, -114, -525, 6381, -242, -525, -525, -113, -525, 4260, - -525, -525, -525, 4260, -75, -74, -525, -235, -190, -525, - -525, -525, 4765, -108, -525, -525, -525, -186, -525, -112, - -178, -525, -525, 4260, -115, -525, -226, 867, -525, -525, - -525, -525, -117, -229, -525, 5039, -224, -525, -71, -525, - -158, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, 5861, 5861, 5861, -525, -525, -525, -525, -525, - -525, -525, -223, -525, -525, -525, -102, -177, 6121, -100, - -525, 5861, -204, -171, -132, -221, -199, -124, -120, -111, - -84, -83, -233, -98, -525, 5313, -525, -60, 5861, -525, - -48, 4260, 4260, -59, 3456, -525, -525, -525, -99, -97, - -525, -90, -88, -96, 5587, -85, 5861, -92, -79, -81, - -525, -525, -191, -525, -525, -153, -525, -218, -78, -525, - -525, -525, -525, 1159, -525, -525, -525, -525, -525, -525, - -108, 5039, -193, 5039, -525, -525, 5039, 4260, -525, -47, - -525, -525, -525, -176, -525, -525, 5861, -42, -525, -525, - 5861, -73, -525, -525, -525, 5861, 5861, 5861, 5861, 5861, - 5861, 5861, 5861, 5861, 5861, 5861, 5861, 5861, 5861, 5861, - 5861, 5861, 5861, 5861, -525, -525, -525, -76, -525, -525, - -525, -525, 3724, -59, -117, -152, -525, -525, -525, -525, - -525, 1451, -525, 5861, -525, -525, -143, 5861, -180, -525, - -525, -525, 1451, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, 5861, 5861, -525, -525, -525, -525, - 5039, -525, -133, -525, 3992, -525, -525, -72, -77, -525, - -525, -525, -525, -525, -204, -204, -171, -171, -132, -132, - -132, -132, -221, -221, -199, -124, -120, -111, -84, -83, - 5861, -525, -525, -142, -108, -59, -525, -37, 2327, -175, - -525, -163, -525, 2892, 1451, -525, -525, -525, -525, 4491, - -525, -525, -129, -525, -525, -68, -525, -525, 2892, -70, - -525, -77, -32, 4260, -63, -66, -525, -525, 5861, 5861, - -525, -69, -61, 188, -58, 2035, -525, -56, -57, 1743, - -525, -525, -161, 5861, 1743, -70, -525, -525, 1451, 5039, - -525, -525, -525, -67, -77, -525, -525, 1451, -54, -525, - -525, -525 + 3391, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -311, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -295, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -301, -634, -634, + -634, -634, -634, -634, -634, -634, -241, -634, -302, -342, + -290, -254, 5696, -300, -634, -210, -634, -634, -634, -634, + 4160, -634, -634, -634, -634, -219, -634, -634, 696, -634, + -634, -189, -69, -207, -634, 8625, -320, -634, -634, -203, + -634, 5696, -634, -634, -634, 5696, -155, -154, -634, -324, + -288, -634, -634, -634, 6417, -190, -634, -634, -634, -292, + -634, -196, -287, -634, -634, 5696, -195, -634, -306, 1081, + -634, -634, -634, -634, -219, -325, -634, 6785, -310, -634, + -151, -634, -277, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, 7889, 7889, 7889, -634, + -634, -634, -634, -634, -634, -634, -309, -634, -634, -634, + -185, -283, 8257, -183, -634, 7889, -227, -263, -299, -318, + -194, -204, -202, -200, -165, -166, -321, -179, -634, -634, + 7153, -634, -140, 7889, -634, -69, 5696, 5696, -139, 4544, + -634, -634, -634, -182, -180, -634, -173, -169, -178, 7521, + -164, 7889, -174, -163, -167, -162, -634, -634, -252, -634, + -634, -237, -634, -342, -161, -158, -634, -634, -634, -634, + 1466, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -19, -190, 6785, -296, 6785, -634, -634, 6785, 5696, -634, + -127, -634, -634, -634, -278, -634, -634, 7889, -121, -634, + -634, 7889, -156, -634, -634, -634, 7889, 7889, 7889, 7889, + 7889, 7889, 7889, 7889, 7889, 7889, 7889, 7889, 7889, 7889, + 7889, 7889, 7889, 7889, 7889, -634, -634, -634, -157, -634, + -634, -634, -634, 4928, -139, -219, -236, -634, -634, -634, + -634, -634, 1851, -634, 7889, -634, -634, -230, 7889, -213, + -634, -634, -118, -634, 1851, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, 7889, 7889, -634, -634, + -634, -634, -634, -634, -634, 6785, -634, -270, -634, 5312, + -634, -634, -153, -150, -634, -634, -634, -634, -634, -227, + -227, -263, -263, -299, -299, -299, -299, -318, -318, -194, + -204, -202, -200, -165, -166, 7889, -634, -634, -226, -190, + -139, -634, -113, 3006, -275, -634, -253, -634, 3776, -148, + -282, -634, 1851, -634, -634, -634, -634, 6049, -634, -634, + -208, -634, -634, -147, -634, -634, 3776, -146, -634, -150, + -111, 5696, -145, 7889, -144, -118, -143, -634, -634, 7889, + 7889, -634, -149, -141, 196, -136, 2621, -634, -116, -120, + 2236, -137, -634, -634, -634, -634, -239, 7889, 2236, -146, + -634, -634, 1851, 6785, -634, -634, -634, -634, -119, -150, + -634, -634, 1851, -112, -634, -634, -634 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1063,95 +1225,108 @@ means the default is an error. */ static const yytype_uint16 yydefact[] = { - 0, 149, 150, 148, 185, 176, 177, 179, 180, 181, - 182, 183, 184, 178, 165, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 207, 208, 209, 210, 211, 212, - 186, 187, 188, 216, 217, 218, 154, 152, 153, 151, - 157, 155, 156, 158, 159, 160, 161, 162, 163, 164, - 189, 190, 191, 228, 229, 230, 192, 193, 194, 240, - 241, 242, 204, 205, 206, 213, 214, 215, 131, 130, - 129, 0, 132, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 266, 267, 268, 269, 270, 271, 273, 274, - 275, 276, 277, 278, 280, 281, 282, 283, 284, 285, - 286, 264, 265, 272, 279, 287, 288, 289, 290, 291, - 292, 361, 293, 294, 295, 296, 297, 298, 299, 300, - 302, 303, 304, 305, 306, 307, 309, 310, 311, 312, - 313, 314, 316, 317, 318, 319, 320, 321, 301, 308, - 315, 322, 323, 324, 325, 326, 327, 362, 363, 364, - 365, 366, 367, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 0, 175, 369, 448, - 128, 139, 370, 371, 372, 0, 447, 0, 449, 0, - 105, 104, 0, 116, 121, 146, 145, 143, 147, 0, - 140, 142, 126, 169, 144, 368, 0, 444, 446, 0, - 0, 0, 375, 0, 0, 93, 90, 0, 103, 0, - 112, 106, 114, 0, 115, 0, 91, 122, 0, 96, - 141, 127, 0, 170, 1, 445, 167, 0, 138, 136, - 0, 134, 373, 0, 0, 94, 0, 0, 450, 107, - 111, 113, 109, 117, 108, 0, 123, 99, 0, 97, - 0, 2, 10, 11, 4, 5, 6, 7, 8, 9, - 13, 12, 0, 0, 0, 171, 39, 38, 40, 37, - 3, 15, 33, 17, 22, 23, 0, 0, 27, 0, - 41, 0, 45, 48, 51, 56, 59, 61, 63, 65, - 67, 69, 71, 0, 31, 0, 166, 0, 0, 133, - 0, 0, 0, 0, 0, 377, 92, 95, 0, 0, - 429, 0, 0, 0, 0, 0, 0, 0, 0, 401, - 410, 414, 41, 74, 87, 0, 390, 0, 126, 393, - 412, 392, 391, 0, 394, 395, 396, 397, 398, 399, - 110, 0, 118, 0, 385, 125, 0, 0, 101, 0, - 98, 34, 35, 0, 19, 20, 0, 0, 25, 24, - 0, 175, 28, 30, 36, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 72, 172, 173, 0, 168, 89, - 137, 135, 0, 0, 383, 0, 381, 376, 378, 440, - 439, 0, 431, 0, 443, 441, 0, 0, 0, 426, - 427, 400, 0, 77, 78, 80, 79, 82, 83, 84, - 85, 86, 81, 76, 0, 0, 415, 411, 413, 120, - 0, 388, 0, 124, 0, 102, 14, 0, 21, 18, - 29, 42, 43, 44, 47, 46, 49, 50, 54, 55, - 52, 53, 57, 58, 60, 62, 64, 66, 68, 70, - 0, 174, 374, 0, 384, 0, 379, 0, 0, 0, - 442, 0, 425, 0, 402, 75, 88, 119, 386, 0, - 100, 16, 0, 380, 382, 0, 434, 433, 436, 408, - 421, 419, 0, 0, 0, 0, 387, 389, 0, 0, - 435, 0, 0, 418, 0, 0, 416, 0, 0, 0, - 403, 73, 0, 437, 0, 408, 407, 409, 423, 0, - 405, 428, 404, 0, 438, 432, 417, 424, 0, 420, - 430, 422 + 0, 153, 154, 183, 181, 184, 182, 185, 152, 196, + 186, 187, 194, 195, 192, 193, 190, 191, 188, 189, + 169, 212, 213, 214, 215, 216, 217, 230, 231, 232, + 227, 228, 229, 242, 243, 244, 224, 225, 226, 239, + 240, 241, 221, 222, 223, 236, 237, 238, 218, 219, + 220, 233, 234, 235, 197, 198, 199, 245, 246, 247, + 158, 156, 157, 155, 161, 159, 160, 162, 163, 171, + 164, 165, 166, 167, 168, 200, 201, 202, 257, 258, + 259, 203, 204, 205, 269, 270, 271, 206, 207, 208, + 281, 282, 283, 209, 210, 211, 293, 294, 295, 134, + 133, 132, 0, 135, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 332, 333, 334, 335, 336, 337, 339, 340, 341, + 342, 343, 344, 346, 347, 350, 351, 352, 354, 355, + 317, 318, 338, 345, 356, 358, 359, 360, 362, 363, + 454, 319, 320, 321, 348, 322, 326, 327, 330, 353, + 357, 361, 323, 324, 328, 329, 349, 325, 331, 364, + 365, 366, 368, 370, 372, 374, 376, 380, 381, 382, + 383, 384, 385, 387, 388, 389, 390, 391, 392, 394, + 396, 397, 398, 400, 401, 378, 386, 393, 402, 404, + 405, 406, 408, 409, 367, 369, 371, 395, 373, 375, + 377, 379, 399, 403, 407, 455, 456, 459, 460, 461, + 462, 457, 458, 410, 412, 413, 414, 416, 417, 418, + 420, 421, 422, 424, 425, 426, 428, 429, 430, 432, + 433, 434, 436, 437, 438, 440, 441, 442, 444, 445, + 446, 448, 449, 450, 452, 453, 411, 415, 419, 423, + 427, 435, 439, 443, 431, 447, 451, 0, 180, 464, + 549, 131, 142, 465, 466, 467, 0, 548, 0, 550, + 0, 108, 107, 0, 119, 124, 149, 148, 146, 150, + 0, 143, 145, 151, 129, 174, 147, 463, 0, 545, + 547, 0, 0, 0, 470, 0, 0, 96, 93, 0, + 106, 0, 115, 109, 117, 0, 118, 0, 94, 125, + 0, 99, 144, 130, 0, 175, 1, 546, 172, 0, + 141, 139, 0, 137, 468, 0, 0, 97, 0, 0, + 551, 110, 114, 116, 112, 120, 111, 0, 126, 102, + 0, 100, 0, 2, 12, 13, 10, 11, 4, 5, + 6, 7, 8, 9, 15, 14, 0, 0, 0, 176, + 42, 41, 43, 40, 3, 17, 36, 19, 24, 25, + 0, 0, 29, 0, 44, 0, 48, 51, 54, 59, + 62, 64, 66, 68, 70, 72, 74, 0, 35, 33, + 0, 170, 0, 0, 136, 0, 0, 0, 0, 0, + 472, 95, 98, 0, 0, 530, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 496, 505, 509, 44, 77, + 90, 0, 485, 0, 151, 129, 488, 507, 487, 486, + 0, 489, 490, 511, 491, 518, 492, 493, 526, 494, + 0, 113, 0, 121, 0, 480, 128, 0, 0, 104, + 0, 101, 37, 38, 0, 21, 22, 0, 0, 27, + 26, 0, 180, 30, 32, 39, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 75, 177, 178, 0, 173, + 92, 140, 138, 0, 0, 478, 0, 476, 471, 473, + 541, 540, 0, 532, 0, 544, 542, 0, 0, 0, + 525, 528, 0, 495, 0, 80, 81, 83, 82, 85, + 86, 87, 88, 89, 84, 79, 0, 0, 510, 506, + 508, 512, 519, 527, 123, 0, 483, 0, 127, 0, + 105, 16, 0, 23, 20, 31, 45, 46, 47, 50, + 49, 52, 53, 57, 58, 55, 56, 60, 61, 63, + 65, 67, 69, 71, 73, 0, 179, 469, 0, 479, + 0, 474, 0, 0, 0, 543, 0, 524, 0, 555, + 0, 553, 497, 78, 91, 122, 481, 0, 103, 18, + 0, 475, 477, 0, 535, 534, 537, 503, 520, 516, + 0, 0, 0, 0, 0, 0, 0, 482, 484, 0, + 0, 536, 0, 0, 515, 0, 0, 513, 0, 0, + 0, 0, 552, 554, 498, 76, 0, 538, 0, 503, + 502, 504, 522, 0, 500, 529, 499, 556, 0, 539, + 533, 514, 523, 0, 517, 531, 521 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -103, -525, -278, -274, -297, -273, -214, -211, - -210, -212, -209, -208, -525, -261, -525, -292, -525, -308, - -525, 4, -525, -525, -525, 5, -525, -525, -525, -41, - -38, -39, -525, -525, -504, -525, -525, -525, -525, -123, - -525, -230, -237, -525, -525, 0, -246, -525, 1, -525, - -525, -525, -337, -342, -207, -286, -378, -525, -285, -376, - -524, -322, -525, -525, -330, -327, -525, -525, -22, -452, - -275, -525, -525, -298, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -2, -525, -525 + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -289, -634, -358, -355, -401, -364, -279, -307, + -276, -280, -273, -281, -634, -354, -634, -378, -634, -367, + -397, 1, -634, -634, -634, 2, -634, -634, -634, -98, + -93, -92, -634, -634, -600, -634, -634, -634, -634, -181, + -634, -319, -326, -634, 6, -634, 0, -332, -634, -54, + -634, -634, -634, -428, -433, -272, -353, -477, -634, -357, + -467, -633, -400, -634, -634, -410, -408, -634, -634, -80, + -545, -350, -634, -216, -634, -371, -634, -214, -634, -634, + -634, -634, -212, -634, -634, -634, -634, -634, -634, -634, + -634, -61, -634, -634, -634, -634, -375 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 320, 321, 322, 487, 323, 324, 325, 326, 327, - 328, 329, 372, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 373, 510, 374, 474, 375, - 440, 376, 227, 397, 300, 377, 229, 230, 231, 260, - 261, 262, 232, 233, 234, 235, 236, 237, 280, 281, - 238, 239, 240, 241, 277, 344, 273, 243, 244, 245, - 351, 283, 354, 355, 445, 446, 395, 482, 379, 380, - 381, 382, 462, 545, 571, 553, 554, 555, 572, 383, - 384, 385, 556, 544, 386, 557, 578, 387, 388, 523, - 451, 518, 538, 551, 552, 389, 246, 247, 248, 257 + -1, 414, 415, 416, 592, 417, 418, 419, 420, 421, + 422, 423, 468, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 469, 615, 470, 576, 471, + 541, 472, 318, 498, 392, 473, 320, 321, 322, 352, + 353, 354, 323, 324, 325, 326, 327, 328, 372, 373, + 329, 330, 331, 332, 438, 369, 439, 365, 335, 336, + 337, 446, 375, 449, 450, 546, 547, 496, 587, 476, + 477, 478, 479, 564, 656, 685, 664, 665, 666, 686, + 480, 481, 482, 483, 667, 652, 484, 485, 668, 693, + 486, 487, 488, 628, 552, 623, 646, 662, 663, 489, + 338, 339, 340, 349, 490, 630, 631 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1159,155 +1334,118 @@ number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 242, 263, 270, 394, 226, 228, 403, 478, 286, 278, - 524, 343, 448, 479, 442, 481, 254, 251, 483, 542, - 433, 296, 249, 404, 405, 272, 270, 422, 423, 263, - 294, 567, 272, 285, 542, 570, 412, 250, 272, 295, - 570, 345, -32, 345, 406, 391, 390, 392, 407, 357, - 396, 426, 427, 352, 252, 434, 456, 256, 458, 255, - 484, 258, 424, 425, 463, 464, 465, 466, 467, 468, - 469, 470, 471, 472, 345, 517, 415, 416, 417, 297, - 346, 480, 298, 473, 437, 299, 347, 439, 349, 409, - 486, 539, 475, 522, 350, 410, 475, 475, 488, 394, - 448, 394, 527, 540, 394, 573, 418, 265, 419, 475, - 266, 475, 420, 421, 399, 270, 577, 400, 490, 475, - 515, 352, 476, 516, 352, 498, 499, 500, 501, 475, - 515, 259, 520, 533, 222, 223, 224, 528, 267, 529, - 494, 495, 448, 475, 548, 519, 496, 497, 478, 521, - 272, 547, 276, 502, 503, 282, 287, 292, 293, 345, - 356, 398, 348, 428, 408, 413, 429, 352, 431, 330, - 435, 432, 438, 444, 430, 452, 449, 453, 450, 454, - 457, 459, 525, 526, 279, 485, 460, -31, 394, 461, - 489, 579, 511, -26, 535, 475, 531, 549, 514, -406, - 558, 478, 532, 559, 560, 564, 563, 565, 580, 401, - 402, 369, 352, 568, 504, 541, 581, 569, 505, 507, - 506, 289, 290, 508, 291, 509, 253, 441, 414, 534, - 541, 264, 566, 536, 575, 288, 513, 394, 576, 271, - 550, 562, 330, 537, 275, 330, 242, 0, 0, 0, - 226, 228, 0, 284, 352, 574, 561, 0, 0, 264, - 0, 0, 0, 264, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 394, 0, 0, - 0, 0, 0, 353, 0, 0, 0, 378, 0, 0, - 0, 0, 0, 543, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 270, 0, 543, 0, - 0, 0, 491, 492, 493, 330, 330, 330, 330, 330, - 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, - 330, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 353, 443, 0, 353, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 378, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 353, 0, 0, + 334, 317, 319, 355, 362, 455, 333, 456, 457, 495, + 437, 460, 370, 580, 378, 584, 549, 586, 543, 632, + 588, 346, 343, 523, 524, 534, 348, 388, 650, 362, + 505, 506, 355, 681, 386, 364, 364, 684, 521, 522, + 364, 504, 492, 387, 513, 684, 650, 341, 377, -34, + 440, 507, 491, 493, 440, 508, 447, 497, 525, 526, + 535, 344, 452, 342, 440, 357, 347, 441, 358, 350, + 589, 585, 444, 442, 389, 424, 510, 390, 445, 654, + 391, 591, 511, 655, 647, 622, 538, 577, 500, 540, + 577, 501, 557, 636, 559, 637, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 648, 519, 635, 520, + 549, 351, 577, 359, 495, 575, 495, 502, 503, 495, + 688, 362, 603, 604, 605, 606, 577, 447, 577, 620, + 447, 578, 621, 595, 368, 577, 515, 692, 625, 620, + 593, 364, 641, 313, 314, 315, 516, 517, 518, 527, + 528, 424, 577, 627, 424, 374, 549, 577, 659, 379, + 658, 599, 600, 607, 608, 580, 601, 602, 384, 385, + 440, 443, 499, 451, 509, 514, 529, 530, 531, 447, + 532, 533, 536, 539, 545, 553, 550, 624, 551, 554, + 555, 626, 560, 562, 558, 561, 590, -35, 633, 634, + -33, 563, 594, -28, 616, 629, 694, 495, 639, 643, + 653, 660, 669, 619, 670, 577, -501, 672, 678, 677, + 674, 679, 687, 610, 447, 580, 465, 596, 597, 598, + 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, + 424, 424, 424, 424, 424, 424, 682, 683, 640, 695, + 609, 696, 612, 614, 371, 611, 671, 382, 381, 495, + 613, 649, 345, 383, 542, 680, 644, 642, 690, 380, + 447, 691, 618, 645, 581, 661, 582, 367, 583, 649, + 673, 675, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 676, 0, 0, 0, 0, 0, 540, + 0, 0, 0, 463, 0, 495, 0, 0, 0, 651, + 689, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 356, 0, 0, 362, 0, 651, 333, 0, + 363, 0, 0, 0, 0, 0, 333, 0, 334, 317, + 319, 0, 0, 0, 333, 376, 0, 0, 0, 0, + 0, 356, 0, 0, 0, 356, 0, 333, 0, 0, + 0, 333, 0, 0, 424, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 448, 0, 0, 0, 475, + 0, 333, 0, 0, 0, 474, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 353, 0, 0, 0, 0, 0, 0, 0, - 0, 378, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 378, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 353, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 378, 0, - 0, 0, 0, 378, 378, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 378, 0, - 0, 0, 0, 271, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 378, 0, 0, 0, 378, - 0, 0, 0, 0, 378, 0, 0, 0, 378, 0, - 0, 0, 0, 0, 0, 274, 0, 378, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 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, 0, 0, 218, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 448, 544, 0, 448, + 0, 0, 333, 333, 0, 333, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 475, 0, 0, 0, 0, 0, 474, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 448, 0, + 0, 0, 0, 0, 333, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 448, 0, 0, 0, 0, 0, 333, + 0, 0, 475, 0, 0, 0, 0, 0, 474, 0, + 0, 0, 0, 0, 475, 0, 0, 0, 0, 0, + 474, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 448, + 0, 0, 0, 0, 0, 333, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 475, 0, 0, 0, 0, 475, 474, + 0, 0, 475, 0, 474, 0, 0, 0, 474, 0, + 0, 0, 0, 0, 0, 0, 475, 0, 0, 0, + 0, 363, 474, 0, 0, 0, 0, 333, 0, 0, + 0, 0, 0, 0, 0, 0, 475, 0, 0, 0, + 475, 0, 474, 0, 0, 0, 474, 0, 475, 0, + 0, 0, 475, 0, 474, 0, 0, 0, 474, 0, + 0, 0, 475, 0, 0, 0, 366, 0, 474, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 0, 0, + 309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 219, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 220, 221, 222, 223, 224, 225, - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 358, 359, 360, 0, 361, 362, 363, - 364, 365, 366, 367, 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, 368, 301, - 218, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 0, 0, 312, 313, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 314, 0, 0, 0, 369, 370, 0, 0, - 0, 0, 371, 316, 317, 318, 319, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 220, 221, 222, 223, - 224, 225, 1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 358, 359, 360, 0, 361, - 362, 363, 364, 365, 366, 367, 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, - 368, 301, 218, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 0, 0, 312, 313, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 314, 0, 0, 0, 369, 477, - 0, 0, 0, 0, 371, 316, 317, 318, 319, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 220, 221, - 222, 223, 224, 225, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 358, 359, 360, - 0, 361, 362, 363, 364, 365, 366, 367, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 0, 0, 0, 0, 310, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 311, 312, + 313, 314, 315, 316, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 453, 454, 455, 0, 456, 457, 458, + 459, 460, 461, 462, 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, @@ -1327,187 +1465,25 @@ 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, 368, 301, 218, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 0, 0, 312, 313, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 314, 0, 0, 0, - 369, 0, 0, 0, 0, 0, 371, 316, 317, 318, - 319, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 220, 221, 222, 223, 224, 225, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 358, - 359, 360, 0, 361, 362, 363, 364, 365, 366, 367, - 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, 368, 301, 218, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 0, 0, 312, - 313, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 314, 0, - 0, 0, 287, 0, 0, 0, 0, 0, 371, 316, - 317, 318, 319, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 220, 221, 222, 223, 224, 225, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 358, 359, 360, 0, 361, 362, 363, 364, 365, - 366, 367, 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, 368, 301, 218, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 0, - 0, 312, 313, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 314, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 371, 316, 317, 318, 319, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 220, 221, 222, 223, 224, 225, - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 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, 0, 301, - 218, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 0, 0, 312, 313, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 314, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 371, 316, 317, 318, 319, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 220, 221, 222, 223, - 224, 225, 1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 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, - 0, 0, 218, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 219, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 220, 221, - 222, 223, 224, 225, 0, 0, 0, 0, 0, 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, 0, 301, 218, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 0, 0, 312, 313, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 314, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 316, 317, - 318, 319, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 220, 221, 222, 223, 224, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 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, 0, 268, 218, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 269, 1, + 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, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 463, 393, 309, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 0, 0, + 406, 407, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 408, + 0, 464, 0, 465, 466, 0, 0, 0, 0, 467, + 410, 411, 412, 413, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 311, 312, 313, 314, 315, 316, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 220, 221, 222, 223, 224, 0, 0, 0, - 0, 0, 0, 14, 15, 16, 17, 18, 19, 20, + 12, 13, 14, 15, 16, 17, 18, 19, 453, 454, + 455, 0, 456, 457, 458, 459, 460, 461, 462, 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, @@ -1527,96 +1503,31 @@ 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, 0, 0, 218, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 447, 1, 2, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 0, 0, 0, 0, 0, 220, 221, 222, 223, 224, - 0, 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, 0, 0, 218, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 512, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 0, 0, - 0, 0, 0, 220, 221, 222, 223, 224, 0, 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, 0, 0, 218, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 530, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 0, 0, 0, 0, - 0, 220, 221, 222, 223, 224, 0, 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, 0, 0, 218, 0, 0, 0, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 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, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 463, 393, + 309, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 0, 0, 406, 407, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 408, 0, 464, 0, 465, 579, + 0, 0, 0, 0, 467, 410, 411, 412, 413, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 311, 312, + 313, 314, 315, 316, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 453, 454, 455, 0, 456, 457, 458, + 459, 460, 461, 462, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, - 221, 222, 223, 224, 50, 51, 52, 53, 54, 55, + 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, 0, 0, 0, 0, 0, 73, 74, 75, + 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, @@ -1631,129 +1542,69 @@ 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, 0, 301, 218, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 0, 0, 312, 313, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 314, 0, 0, 0, - 393, 546, 0, 0, 0, 0, 0, 316, 317, 318, - 319, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, - 0, 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, 0, 301, 218, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 0, - 0, 312, 313, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 314, 0, 0, 315, 0, 0, 0, 0, 0, 0, - 0, 316, 317, 318, 319, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 0, 0, 0, 0, 0, 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, - 0, 301, 218, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 0, 0, 312, 313, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 314, 0, 0, 0, 393, 0, - 0, 0, 0, 0, 0, 316, 317, 318, 319, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 0, 0, 0, 0, 0, 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, 0, 301, 218, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 0, 0, 312, - 313, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 314, 0, - 0, 436, 0, 0, 0, 0, 0, 0, 0, 316, - 317, 318, 319, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 0, 0, - 0, 0, 0, 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, 0, 301, - 218, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 0, 0, 312, 313, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 314, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 455, 316, 317, 318, 319, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 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, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 463, 393, 309, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 0, 0, + 406, 407, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 408, + 0, 464, 0, 465, 0, 0, 0, 0, 0, 467, + 410, 411, 412, 413, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 311, 312, 313, 314, 315, 316, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 453, 454, + 455, 0, 456, 457, 458, 459, 460, 461, 462, 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, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 463, 393, + 309, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 0, 0, 406, 407, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 408, 0, 464, 0, 379, 0, + 0, 0, 0, 0, 467, 410, 411, 412, 413, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 311, 312, + 313, 314, 315, 316, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 453, 454, 455, 0, 456, 457, 458, + 459, 460, 461, 462, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 50, 51, 52, 53, 54, 55, + 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, 0, 0, 0, 0, 0, 73, 74, 75, + 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, @@ -1768,18 +1619,69 @@ 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, 0, 301, 218, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 0, 0, 312, 313, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 314, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 316, 317, 318, - 319, 0, 0, 0, 0, 0, 0, 0, 0, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 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, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 463, 393, 309, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 0, 0, + 406, 407, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 408, + 0, 464, 0, 0, 0, 0, 0, 0, 0, 467, + 410, 411, 412, 413, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 311, 312, 313, 314, 315, 316, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 0, 393, + 309, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 0, 0, 406, 407, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 408, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 467, 410, 411, 412, 413, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 311, 312, + 313, 314, 315, 316, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 50, 51, 52, 53, 54, 55, + 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, 0, 0, 0, 0, 0, 73, 74, 75, + 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, @@ -1794,155 +1696,25 @@ 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, 411, 0, 301, 218, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 0, 0, 312, 313, 0, + 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, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 0, 0, 309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 314, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 316, 317, 318, - 319, 0, 0, 0, 0, 0, 0, 0, 0, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 0, 0, 0, 0, 0, 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, 0, 0, 218 -}; - -static const yytype_int16 yycheck[] = -{ - 0, 231, 239, 295, 0, 0, 314, 383, 254, 57, - 462, 272, 354, 391, 351, 393, 232, 232, 396, 523, - 253, 267, 265, 246, 247, 267, 263, 248, 249, 259, - 265, 555, 267, 275, 538, 559, 328, 265, 267, 274, - 564, 267, 265, 267, 267, 274, 292, 293, 271, 275, - 274, 250, 251, 283, 269, 288, 364, 275, 366, 275, - 397, 266, 283, 284, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 267, 451, 280, 281, 282, 269, - 266, 274, 272, 274, 345, 275, 272, 348, 266, 266, - 266, 266, 272, 273, 272, 272, 272, 272, 406, 391, - 442, 393, 480, 266, 396, 266, 277, 272, 279, 272, - 275, 272, 244, 245, 272, 352, 568, 275, 410, 272, - 272, 351, 275, 275, 354, 422, 423, 424, 425, 272, - 272, 272, 275, 275, 291, 292, 293, 270, 232, 272, - 418, 419, 484, 272, 273, 453, 420, 421, 524, 457, - 267, 529, 232, 426, 427, 269, 269, 232, 232, 267, - 275, 232, 274, 287, 266, 265, 286, 397, 252, 272, - 268, 254, 232, 232, 285, 265, 275, 265, 275, 275, - 265, 273, 474, 475, 232, 232, 265, 265, 480, 270, - 232, 569, 268, 266, 231, 272, 268, 265, 444, 269, - 232, 577, 510, 266, 270, 266, 275, 19, 275, 312, - 313, 269, 442, 269, 428, 523, 270, 274, 429, 431, - 430, 259, 263, 432, 263, 433, 225, 350, 331, 515, - 538, 231, 554, 518, 564, 257, 443, 529, 565, 239, - 538, 549, 345, 518, 246, 348, 246, -1, -1, -1, - 246, 246, -1, 253, 484, 563, 548, -1, -1, 259, - -1, -1, -1, 263, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 569, -1, -1, - -1, -1, -1, 283, -1, -1, -1, 287, -1, -1, - -1, -1, -1, 523, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 543, -1, 538, -1, - -1, -1, 415, 416, 417, 418, 419, 420, 421, 422, - 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 351, 352, -1, 354, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 383, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 397, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 442, -1, -1, -1, -1, -1, -1, -1, - -1, 451, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 462, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 484, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 518, -1, - -1, -1, -1, 523, 524, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 538, -1, - -1, -1, -1, 543, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 555, -1, -1, -1, 559, - -1, -1, -1, -1, 564, -1, -1, -1, 568, -1, - -1, -1, -1, -1, -1, 0, -1, 577, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 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, -1, -1, 233, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 275, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 289, 290, 291, 292, 293, 294, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, -1, 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, -1, -1, 246, 247, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 265, -1, -1, -1, 269, 270, -1, -1, - -1, -1, 275, 276, 277, 278, 279, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 289, 290, 291, 292, - 293, 294, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, -1, 20, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 310, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 311, 312, 313, 314, 315, 316, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, @@ -1965,43 +1737,23 @@ 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, -1, -1, 246, 247, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 265, -1, -1, -1, 269, 270, - -1, -1, -1, -1, 275, 276, 277, 278, 279, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 289, 290, - 291, 292, 293, 294, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - -1, 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, -1, -1, 246, 247, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 265, -1, -1, -1, - 269, -1, -1, -1, -1, -1, 275, 276, 277, 278, - 279, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 289, 290, 291, 292, 293, 294, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, -1, 20, 21, 22, 23, 24, 25, 26, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 0, 393, + 309, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 0, 0, 406, 407, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 408, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 410, 411, 412, 413, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 311, 312, + 313, 314, 315, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 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, @@ -2023,14 +1775,100 @@ 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, -1, -1, 246, - 247, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 265, -1, - -1, -1, 269, -1, -1, -1, -1, -1, 275, 276, - 277, 278, 279, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 289, 290, 291, 292, 293, 294, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, -1, 20, 21, 22, 23, 24, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 0, 360, 309, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 361, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 311, 312, 313, 314, 315, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 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, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 0, 0, 309, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 548, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 311, 312, 313, 314, + 315, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 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, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 0, 0, 309, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 617, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 311, 312, 313, 314, 315, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 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, @@ -2052,44 +1890,24 @@ 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, -1, - -1, 246, 247, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 265, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 275, 276, 277, 278, 279, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 289, 290, 291, 292, 293, 294, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 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, -1, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, -1, -1, 246, 247, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 265, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 275, 276, 277, 278, 279, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 289, 290, 291, 292, - 293, 294, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 27, 28, 29, 30, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 0, 0, 309, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 638, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 311, 312, 313, 314, 315, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, @@ -2110,21 +1928,29 @@ 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, - -1, -1, 233, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 275, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 289, 290, - 291, 292, 293, 294, -1, -1, -1, -1, -1, 27, + 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, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 0, 0, + 309, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 4, 5, 6, 7, 0, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 0, 0, 0, 0, 0, 0, 0, 311, 312, + 313, 314, 315, 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, + 58, 59, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 69, 0, 0, 0, 0, 0, 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, + 98, 0, 0, 0, 0, 0, 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, @@ -2137,50 +1963,104 @@ 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, -1, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, -1, -1, 246, 247, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 265, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 276, 277, - 278, 279, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 289, 290, 291, 292, 293, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 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, -1, 232, 233, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 275, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 289, 290, 291, 292, 293, -1, -1, -1, - -1, -1, -1, 27, 28, 29, 30, 31, 32, 33, + 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, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 0, 393, 309, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 0, 0, 406, 407, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 408, 0, 0, + 0, 494, 657, 0, 0, 0, 0, 0, 410, 411, + 412, 413, 3, 4, 5, 6, 7, 0, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 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, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, + 0, 0, 0, 0, 0, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 0, + 0, 0, 0, 0, 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, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 0, + 393, 309, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 0, 0, 406, 407, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 408, 0, 0, 409, 0, + 0, 0, 0, 0, 0, 0, 410, 411, 412, 413, + 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 69, 0, 0, + 0, 0, 0, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 0, 0, 0, + 0, 0, 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, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 0, 393, 309, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, + 404, 405, 0, 0, 406, 407, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 408, 0, 0, 0, 494, 0, 0, + 0, 0, 0, 0, 410, 411, 412, 413, 3, 4, + 5, 6, 7, 0, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 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, + 54, 55, 56, 57, 58, 59, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, + 0, 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, + 94, 95, 96, 97, 98, 0, 0, 0, 0, 0, 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, @@ -2193,21 +2073,31 @@ 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, -1, -1, 233, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 270, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - -1, -1, -1, -1, -1, 289, 290, 291, 292, 293, - -1, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 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, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 0, 393, 309, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, + 0, 0, 406, 407, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 408, 0, 0, 537, 0, 0, 0, 0, 0, + 0, 0, 410, 411, 412, 413, 3, 4, 5, 6, + 7, 0, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 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, + 56, 57, 58, 59, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 69, 0, 0, 0, 0, 0, 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, + 96, 97, 98, 0, 0, 0, 0, 0, 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, @@ -2220,21 +2110,31 @@ 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, -1, -1, 233, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 270, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, -1, -1, - -1, -1, -1, 289, 290, 291, 292, 293, -1, 27, + 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, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 0, 393, 309, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 0, 0, + 406, 407, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 408, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 556, + 410, 411, 412, 413, 3, 4, 5, 6, 7, 0, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 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, + 58, 59, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 69, 0, 0, 0, 0, 0, 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, + 98, 0, 0, 0, 0, 0, 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, @@ -2247,21 +2147,31 @@ 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, -1, -1, 233, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 270, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, - -1, 289, 290, 291, 292, 293, -1, 27, 28, 29, + 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, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 0, 393, 309, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 0, 0, 406, 407, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 408, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 410, 411, + 412, 413, 3, 4, 5, 6, 7, 0, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 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, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, + 0, 0, 0, 0, 0, 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, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 0, + 0, 0, 0, 0, 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, @@ -2274,15 +2184,172 @@ 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, -1, -1, 233, -1, -1, -1, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 28, + 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, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 512, 0, + 393, 309, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 0, 0, 406, 407, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 408, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 410, 411, 412, 413, + 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 0, 0, 0, + 0, 0, 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, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 0, 0, 309 +}; + +static const yytype_int16 yycheck[] = +{ + 0, 0, 0, 322, 330, 24, 0, 26, 27, 387, + 364, 30, 81, 480, 346, 492, 449, 494, 446, 564, + 497, 323, 323, 341, 342, 346, 368, 359, 628, 355, + 339, 340, 351, 666, 358, 360, 360, 670, 337, 338, + 360, 408, 367, 367, 422, 678, 646, 358, 368, 358, + 360, 360, 384, 385, 360, 364, 375, 367, 376, 377, + 381, 362, 368, 358, 360, 365, 368, 359, 368, 359, + 498, 367, 359, 365, 362, 364, 359, 365, 365, 361, + 368, 359, 365, 365, 359, 552, 440, 365, 365, 443, + 365, 368, 459, 363, 461, 365, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 357, 359, 370, 585, 372, + 543, 365, 365, 323, 492, 367, 494, 406, 407, 497, + 359, 447, 523, 524, 525, 526, 365, 446, 365, 365, + 449, 368, 368, 511, 323, 365, 425, 682, 368, 365, + 507, 360, 368, 384, 385, 386, 373, 374, 375, 343, + 344, 440, 365, 366, 443, 362, 589, 365, 366, 362, + 637, 519, 520, 527, 528, 632, 521, 522, 323, 323, + 360, 367, 323, 368, 359, 358, 380, 379, 378, 498, + 345, 347, 361, 323, 323, 358, 368, 554, 368, 358, + 368, 558, 366, 360, 358, 358, 323, 358, 576, 577, + 358, 363, 323, 359, 361, 323, 683, 585, 361, 322, + 358, 358, 323, 545, 359, 365, 362, 361, 359, 368, + 363, 25, 359, 530, 543, 692, 362, 516, 517, 518, + 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, + 529, 530, 531, 532, 533, 534, 362, 367, 615, 368, + 529, 363, 532, 534, 323, 531, 653, 355, 351, 637, + 533, 628, 316, 355, 445, 665, 623, 620, 678, 349, + 589, 679, 544, 623, 490, 646, 490, 338, 490, 646, + 655, 659, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 660, -1, -1, -1, -1, -1, 653, + -1, -1, -1, 322, -1, 683, -1, -1, -1, 628, + 677, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 322, -1, -1, 651, -1, 646, 322, -1, + 330, -1, -1, -1, -1, -1, 330, -1, 338, 338, + 338, -1, -1, -1, 338, 345, -1, -1, -1, -1, + -1, 351, -1, -1, -1, 355, -1, 351, -1, -1, + -1, 355, -1, -1, 653, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 375, -1, -1, -1, 379, + -1, 375, -1, -1, -1, 379, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 446, 447, -1, 449, + -1, -1, 446, 447, -1, 449, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 480, -1, -1, -1, -1, -1, 480, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 498, -1, + -1, -1, -1, -1, 498, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 543, -1, -1, -1, -1, -1, 543, + -1, -1, 552, -1, -1, -1, -1, -1, 552, -1, + -1, -1, -1, -1, 564, -1, -1, -1, -1, -1, + 564, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 589, + -1, -1, -1, -1, -1, 589, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 623, -1, -1, -1, -1, 628, 623, + -1, -1, 632, -1, 628, -1, -1, -1, 632, -1, + -1, -1, -1, -1, -1, -1, 646, -1, -1, -1, + -1, 651, 646, -1, -1, -1, -1, 651, -1, -1, + -1, -1, -1, -1, -1, -1, 666, -1, -1, -1, + 670, -1, 666, -1, -1, -1, 670, -1, 678, -1, + -1, -1, 682, -1, 678, -1, -1, -1, 682, -1, + -1, -1, 692, -1, -1, -1, 0, -1, 692, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 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, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, -1, -1, + 324, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 368, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 382, 383, + 384, 385, 386, 387, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 289, - 290, 291, 292, 293, 63, 64, 65, 66, 67, 68, + 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, -1, -1, -1, -1, -1, 86, 87, 88, + 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, @@ -2297,129 +2364,69 @@ 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, -1, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, -1, -1, 246, 247, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 265, -1, -1, -1, - 269, 270, -1, -1, -1, -1, -1, 276, 277, 278, - 279, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, -1, -1, -1, -1, - -1, 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, -1, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, -1, - -1, 246, 247, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 265, -1, -1, 268, -1, -1, -1, -1, -1, -1, - -1, 276, 277, 278, 279, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - -1, -1, -1, -1, -1, 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, - -1, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, -1, -1, 246, 247, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 265, -1, -1, -1, 269, -1, - -1, -1, -1, -1, -1, 276, 277, 278, 279, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, -1, -1, -1, -1, -1, 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, -1, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, -1, -1, 246, - 247, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 265, -1, - -1, 268, -1, -1, -1, -1, -1, -1, -1, 276, - 277, 278, 279, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, -1, -1, - -1, -1, -1, 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, -1, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, -1, -1, 246, 247, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 265, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 275, 276, 277, 278, 279, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 28, + 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, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, -1, -1, + 339, 340, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 358, + -1, 360, -1, 362, 363, -1, -1, -1, -1, 368, + 369, 370, 371, 372, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 382, 383, 384, 385, 386, 387, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, -1, 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, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, -1, -1, 339, 340, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 358, -1, 360, -1, 362, 363, + -1, -1, -1, -1, 368, 369, 370, 371, 372, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 382, 383, + 384, 385, 386, 387, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 63, 64, 65, 66, 67, 68, + 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, -1, -1, -1, -1, -1, 86, 87, 88, + 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, @@ -2434,18 +2441,69 @@ 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, -1, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, -1, -1, 246, 247, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 265, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 276, 277, 278, - 279, -1, -1, -1, -1, -1, -1, -1, -1, 28, + 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, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, -1, -1, + 339, 340, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 358, + -1, 360, -1, 362, -1, -1, -1, -1, -1, 368, + 369, 370, 371, 372, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 382, 383, 384, 385, 386, 387, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, -1, 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, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, -1, -1, 339, 340, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 358, -1, 360, -1, 362, -1, + -1, -1, -1, -1, 368, 369, 370, 371, 372, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 382, 383, + 384, 385, 386, 387, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 63, 64, 65, 66, 67, 68, + 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, -1, -1, -1, -1, -1, 86, 87, 88, + 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, @@ -2460,18 +2518,69 @@ 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, -1, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, -1, -1, 246, 247, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 265, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 276, 277, 278, - 279, -1, -1, -1, -1, -1, -1, -1, -1, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 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, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, -1, -1, + 339, 340, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 358, + -1, 360, -1, -1, -1, -1, -1, -1, -1, 368, + 369, 370, 371, 372, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 382, 383, 384, 385, 386, 387, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 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, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, -1, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, -1, -1, 339, 340, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 358, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 368, 369, 370, 371, 372, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 382, 383, + 384, 385, 386, 387, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 63, 64, 65, 66, 67, 68, + 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, -1, -1, -1, -1, -1, 86, 87, 88, + 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, @@ -2486,4678 +2595,6308 @@ 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, -1, -1, 233 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint16 yystos[] = -{ - 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 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, 233, 275, - 289, 290, 291, 292, 293, 294, 329, 330, 333, 334, - 335, 336, 340, 341, 342, 343, 344, 345, 348, 349, - 350, 351, 353, 355, 356, 357, 394, 395, 396, 265, - 265, 232, 269, 356, 232, 275, 275, 397, 266, 272, - 337, 338, 339, 349, 353, 272, 275, 232, 232, 275, - 350, 353, 267, 354, 0, 395, 232, 352, 57, 232, - 346, 347, 269, 359, 353, 275, 354, 269, 376, 338, - 337, 339, 232, 232, 265, 274, 354, 269, 272, 275, - 332, 232, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 246, 247, 265, 268, 276, 277, 278, 279, - 299, 300, 301, 303, 304, 305, 306, 307, 308, 309, + 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, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, -1, -1, 324, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 368, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 382, 383, 384, 385, 386, 387, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 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, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, -1, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, -1, -1, 339, 340, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 358, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 369, 370, 371, 372, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 382, 383, + 384, 385, 386, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 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, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 321, 322, 323, 353, 267, 266, 272, 274, 266, - 272, 358, 349, 353, 360, 361, 275, 275, 16, 17, - 18, 20, 21, 22, 23, 24, 25, 26, 231, 269, - 270, 275, 310, 323, 325, 327, 329, 333, 353, 366, - 367, 368, 369, 377, 378, 379, 382, 385, 386, 393, - 354, 274, 354, 269, 325, 364, 274, 331, 232, 272, - 275, 310, 310, 327, 246, 247, 267, 271, 266, 266, - 272, 230, 325, 265, 310, 280, 281, 282, 277, 279, - 244, 245, 248, 249, 283, 284, 250, 251, 287, 286, - 285, 252, 254, 253, 288, 268, 268, 323, 232, 323, - 328, 347, 360, 353, 232, 362, 363, 270, 361, 275, - 275, 388, 265, 265, 275, 275, 327, 265, 327, 273, - 265, 270, 370, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 274, 326, 272, 275, 270, 367, 364, - 274, 364, 365, 364, 360, 232, 266, 302, 327, 232, - 325, 310, 310, 310, 312, 312, 313, 313, 314, 314, - 314, 314, 315, 315, 316, 317, 318, 319, 320, 321, - 324, 268, 270, 362, 354, 272, 275, 367, 389, 327, - 275, 327, 273, 387, 377, 325, 325, 364, 270, 272, - 270, 268, 327, 275, 363, 231, 366, 378, 390, 266, - 266, 327, 342, 349, 381, 371, 270, 364, 273, 265, - 381, 391, 392, 373, 374, 375, 380, 383, 232, 266, - 270, 325, 327, 275, 266, 19, 369, 368, 269, 274, - 368, 372, 376, 266, 327, 372, 373, 377, 384, 364, - 275, 270 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint16 yyr1[] = -{ - 0, 298, 299, 300, 300, 300, 300, 300, 300, 300, - 300, 300, 300, 300, 300, 301, 301, 301, 301, 301, - 301, 302, 303, 304, 305, 305, 306, 306, 307, 307, - 308, 309, 309, 310, 310, 310, 310, 311, 311, 311, - 311, 312, 312, 312, 312, 313, 313, 313, 314, 314, - 314, 315, 315, 315, 315, 315, 316, 316, 316, 317, - 317, 318, 318, 319, 319, 320, 320, 321, 321, 322, - 322, 323, 324, 323, 325, 325, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 327, 327, 328, - 329, 329, 329, 329, 329, 329, 329, 329, 329, 331, - 330, 332, 332, 333, 334, 334, 335, 335, 336, 337, - 337, 338, 338, 338, 338, 339, 340, 340, 340, 340, - 340, 341, 341, 341, 341, 341, 342, 342, 343, 344, - 344, 344, 344, 345, 346, 346, 347, 347, 347, 348, - 349, 349, 350, 350, 350, 350, 350, 350, 351, 351, - 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, - 351, 351, 351, 351, 351, 351, 351, 352, 352, 353, - 353, 354, 354, 354, 354, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 356, 356, 356, 358, 357, 359, 357, 360, 360, 361, - 361, 362, 362, 363, 363, 364, 364, 364, 365, 365, - 366, 367, 367, 368, 368, 368, 368, 368, 368, 368, - 369, 370, 371, 369, 372, 372, 374, 373, 375, 373, - 376, 376, 377, 377, 378, 378, 379, 380, 380, 381, - 381, 383, 382, 384, 384, 385, 385, 387, 386, 388, - 386, 389, 386, 390, 390, 391, 391, 392, 392, 393, - 393, 393, 393, 393, 394, 394, 395, 395, 395, 397, - 396 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 1, 4, 1, 3, 2, - 2, 1, 1, 1, 2, 2, 2, 1, 2, 3, - 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, - 1, 1, 3, 3, 3, 1, 3, 3, 1, 3, - 3, 1, 3, 3, 3, 3, 1, 3, 3, 1, - 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 0, 6, 1, 3, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, - 2, 2, 4, 2, 3, 4, 2, 3, 4, 0, - 6, 2, 3, 2, 1, 1, 2, 3, 3, 2, - 3, 2, 1, 2, 1, 1, 1, 3, 4, 6, - 5, 1, 2, 3, 5, 4, 1, 2, 1, 1, - 1, 1, 1, 4, 1, 3, 1, 3, 1, 1, - 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 4, 1, 3, 1, - 2, 2, 3, 3, 4, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 6, 0, 5, 1, 2, 3, - 4, 1, 3, 1, 2, 1, 3, 4, 1, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 0, 0, 5, 1, 1, 0, 2, 0, 2, - 2, 3, 1, 2, 1, 2, 5, 3, 1, 1, - 4, 0, 8, 0, 1, 3, 2, 0, 6, 0, - 8, 0, 7, 1, 1, 1, 0, 2, 3, 2, - 2, 2, 3, 2, 1, 2, 1, 1, 1, 0, - 3 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab + 320, 321, -1, 323, 324, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 368, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 382, 383, 384, 385, 386, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 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, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, -1, -1, 324, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 363, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 382, 383, 384, 385, + 386, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 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, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + -1, -1, 324, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 363, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 382, 383, 384, 385, 386, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 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, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, -1, -1, 324, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 363, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 382, 383, 384, 385, 386, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 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, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, -1, -1, + 324, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 5, 6, 7, 8, 9, -1, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, -1, -1, -1, -1, -1, -1, -1, 382, 383, + 384, 385, 386, 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, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 82, -1, -1, -1, -1, -1, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, -1, -1, -1, -1, -1, 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, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, -1, -1, 339, 340, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 358, -1, -1, + -1, 362, 363, -1, -1, -1, -1, -1, 369, 370, + 371, 372, 5, 6, 7, 8, 9, -1, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 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, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, + -1, -1, -1, -1, -1, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, + -1, -1, -1, -1, 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, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, -1, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, -1, -1, 339, 340, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 358, -1, -1, 361, -1, + -1, -1, -1, -1, -1, -1, 369, 370, 371, 372, + 5, 6, 7, 8, 9, -1, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 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, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 82, -1, -1, + -1, -1, -1, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, -1, -1, -1, + -1, -1, 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, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, -1, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, -1, -1, 339, 340, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 358, -1, -1, -1, 362, -1, -1, + -1, -1, -1, -1, 369, 370, 371, 372, 5, 6, + 7, 8, 9, -1, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 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, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 82, -1, -1, -1, -1, + -1, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, -1, -1, -1, -1, -1, + 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, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, -1, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + -1, -1, 339, 340, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 358, -1, -1, 361, -1, -1, -1, -1, -1, + -1, -1, 369, 370, 371, 372, 5, 6, 7, 8, + 9, -1, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 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, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 82, -1, -1, -1, -1, -1, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, -1, -1, -1, -1, -1, 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, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, -1, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, -1, -1, + 339, 340, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 358, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 368, + 369, 370, 371, 372, 5, 6, 7, 8, 9, -1, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 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, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 82, -1, -1, -1, -1, -1, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, -1, -1, -1, -1, -1, 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, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, -1, -1, 339, 340, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 358, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 369, 370, + 371, 372, 5, 6, 7, 8, 9, -1, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 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, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, + -1, -1, -1, -1, -1, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, + -1, -1, -1, -1, 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, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, -1, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, -1, -1, 339, 340, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 358, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 369, 370, 371, 372, + 5, 6, 7, 8, 9, -1, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 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, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, -1, -1, -1, + -1, -1, 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, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, -1, -1, 324 +}; + + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint16 yystos[] = +{ + 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 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, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 324, + 368, 382, 383, 384, 385, 386, 387, 422, 423, 426, + 427, 428, 429, 433, 434, 435, 436, 437, 438, 441, + 442, 443, 444, 445, 447, 449, 450, 451, 491, 492, + 493, 358, 358, 323, 362, 450, 323, 368, 368, 494, + 359, 365, 430, 431, 432, 442, 447, 365, 368, 323, + 323, 368, 443, 447, 360, 448, 0, 492, 323, 446, + 81, 323, 439, 440, 362, 453, 447, 368, 448, 362, + 470, 431, 430, 432, 323, 323, 358, 367, 448, 362, + 365, 368, 425, 323, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 339, 340, 358, 361, + 369, 370, 371, 372, 392, 393, 394, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, 415, 416, 445, 447, + 360, 359, 365, 367, 359, 365, 452, 442, 447, 454, + 455, 368, 368, 22, 23, 24, 26, 27, 28, 29, + 30, 31, 32, 322, 360, 362, 363, 368, 403, 416, + 418, 420, 422, 426, 445, 447, 460, 461, 462, 463, + 471, 472, 473, 474, 477, 478, 481, 482, 483, 490, + 495, 448, 367, 448, 362, 418, 458, 367, 424, 323, + 365, 368, 403, 403, 420, 339, 340, 360, 364, 359, + 359, 365, 321, 418, 358, 403, 373, 374, 375, 370, + 372, 337, 338, 341, 342, 376, 377, 343, 344, 380, + 379, 378, 345, 347, 346, 381, 361, 361, 416, 323, + 416, 421, 440, 454, 447, 323, 456, 457, 363, 455, + 368, 368, 485, 358, 358, 368, 368, 420, 358, 420, + 366, 358, 360, 363, 464, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 367, 419, 365, 368, 363, + 461, 474, 478, 483, 458, 367, 458, 459, 458, 454, + 323, 359, 395, 420, 323, 418, 403, 403, 403, 405, + 405, 406, 406, 407, 407, 407, 407, 408, 408, 409, + 410, 411, 412, 413, 414, 417, 361, 363, 456, 448, + 365, 368, 461, 486, 420, 368, 420, 366, 484, 323, + 496, 497, 471, 418, 418, 458, 363, 365, 363, 361, + 420, 368, 457, 322, 460, 472, 487, 359, 359, 420, + 435, 442, 476, 358, 361, 365, 465, 363, 458, 366, + 358, 476, 488, 489, 467, 468, 469, 475, 479, 323, + 359, 421, 361, 497, 363, 418, 420, 368, 359, 25, + 463, 462, 362, 367, 462, 466, 470, 359, 359, 420, + 466, 467, 471, 480, 458, 368, 363 +}; + + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint16 yyr1[] = +{ + 0, 391, 392, 393, 393, 393, 393, 393, 393, 393, + 393, 393, 393, 393, 393, 393, 393, 394, 394, 394, + 394, 394, 394, 395, 396, 397, 398, 398, 399, 399, + 400, 400, 401, 402, 402, 402, 403, 403, 403, 403, + 404, 404, 404, 404, 405, 405, 405, 405, 406, 406, + 406, 407, 407, 407, 408, 408, 408, 408, 408, 409, + 409, 409, 410, 410, 411, 411, 412, 412, 413, 413, + 414, 414, 415, 415, 416, 417, 416, 418, 418, 419, + 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, + 420, 420, 421, 422, 422, 422, 422, 422, 422, 422, + 422, 422, 424, 423, 425, 425, 426, 427, 427, 428, + 428, 429, 430, 430, 431, 431, 431, 431, 432, 433, + 433, 433, 433, 433, 434, 434, 434, 434, 434, 435, + 435, 436, 437, 437, 437, 437, 438, 439, 439, 440, + 440, 440, 441, 442, 442, 443, 443, 443, 443, 443, + 443, 443, 444, 444, 444, 444, 444, 444, 444, 444, + 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, + 444, 445, 446, 446, 447, 447, 448, 448, 448, 448, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 450, 450, 450, 452, 451, + 453, 451, 454, 454, 455, 455, 456, 456, 457, 457, + 458, 458, 458, 459, 459, 460, 461, 461, 462, 462, + 462, 462, 462, 462, 462, 463, 464, 465, 463, 466, + 466, 468, 467, 469, 467, 470, 470, 471, 471, 472, + 472, 473, 473, 474, 475, 475, 476, 476, 477, 477, + 479, 478, 480, 480, 481, 481, 482, 482, 484, 483, + 485, 483, 486, 483, 487, 487, 488, 488, 489, 489, + 490, 490, 490, 490, 490, 491, 491, 492, 492, 492, + 494, 493, 495, 496, 496, 497, 497 +}; + + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 3, 1, 4, 1, + 3, 2, 2, 1, 1, 1, 2, 2, 2, 1, + 2, 3, 2, 1, 1, 1, 1, 2, 2, 2, + 1, 1, 1, 1, 1, 3, 3, 3, 1, 3, + 3, 1, 3, 3, 1, 3, 3, 3, 3, 1, + 3, 3, 1, 3, 1, 3, 1, 3, 1, 3, + 1, 3, 1, 3, 1, 0, 6, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 1, 2, 2, 4, 2, 3, 4, 2, + 3, 4, 0, 6, 2, 3, 2, 1, 1, 2, + 3, 3, 2, 3, 2, 1, 2, 1, 1, 1, + 3, 4, 6, 5, 1, 2, 3, 5, 4, 1, + 2, 1, 1, 1, 1, 1, 4, 1, 3, 1, + 3, 1, 1, 1, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 4, 1, 1, 3, 1, 2, 2, 3, 3, 4, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 6, + 0, 5, 1, 2, 3, 4, 1, 3, 1, 2, + 1, 3, 4, 1, 3, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 0, 0, 5, 1, + 1, 0, 2, 0, 2, 2, 3, 1, 2, 1, + 2, 1, 2, 5, 3, 1, 1, 4, 1, 2, + 0, 8, 0, 1, 3, 2, 1, 2, 0, 6, + 0, 8, 0, 7, 1, 1, 1, 0, 2, 3, + 2, 2, 2, 3, 2, 1, 2, 1, 1, 1, + 0, 3, 5, 1, 3, 1, 4 +}; + + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab -#define YYRECOVERING() (!!yyerrstatus) +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (pParseContext, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (0) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 + + + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif + + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, pParseContext); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ + +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, glslang::TParseContext* pParseContext) +{ + FILE *yyo = yyoutput; + YYUSE (yyo); + YYUSE (pParseContext); + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif + YYUSE (yytype); +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, glslang::TParseContext* pParseContext) +{ + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep, pParseContext); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +static void +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, glslang::TParseContext* pParseContext) +{ + unsigned long int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , pParseContext); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule, pParseContext); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +static YYSIZE_T +yystrlen (const char *yystr) +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +yystpcpy (char *yydest, const char *yysrc) +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) +{ + YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULL; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) + { + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + } + } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; +} +#endif /* YYERROR_VERBOSE */ + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, glslang::TParseContext* pParseContext) +{ + YYUSE (yyvaluep); + YYUSE (pParseContext); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + + + +/*----------. +| yyparse. | +`----------*/ + +int +yyparse (glslang::TParseContext* pParseContext) +{ +/* The lookahead symbol. */ +int yychar; + + +/* The semantic value of the lookahead symbol. */ +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (pParseContext, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) + /* Number of syntax errors so far. */ + int yynerrs; -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* The stacks and their tools: + 'yyss': related to states. + 'yyvs': related to semantic values. + Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ -/* Enable debugging if requested. */ -#if YYDEBUG + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; + yystacksize = YYINITDEPTH; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } # endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = yylex (&yylval, parseContext); + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY; + + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: +#line 293 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[0].lex).loc, (yyvsp[0].lex).symbol, (yyvsp[0].lex).string); + } +#line 4016 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 3: +#line 299 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } +#line 4024 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, pParseContext); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) + case 4: +#line 302 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); + } +#line 4033 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 5: +#line 306 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); + } +#line 4042 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ + case 6: +#line 310 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); + } +#line 4050 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, glslang::TParseContext* pParseContext) -{ - FILE *yyo = yyoutput; - YYUSE (yyo); - YYUSE (pParseContext); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} + case 7: +#line 313 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); + } +#line 4059 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 8: +#line 317 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i64, (yyvsp[0].lex).loc, true); + } +#line 4068 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ + case 9: +#line 321 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u64, (yyvsp[0].lex).loc, true); + } +#line 4077 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, glslang::TParseContext* pParseContext) -{ - YYFPRINTF (yyoutput, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + case 10: +#line 325 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit integer literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((short)(yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); + } +#line 4086 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - yy_symbol_value_print (yyoutput, yytype, yyvaluep, pParseContext); - YYFPRINTF (yyoutput, ")"); -} + case 11: +#line 329 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((unsigned short)(yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); + } +#line 4095 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ + case 12: +#line 333 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); + } +#line 4103 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) + case 13: +#line 336 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtDouble, (yyvsp[0].lex).loc, true); } - YYFPRINTF (stderr, "\n"); -} +#line 4112 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) + case 14: +#line 340 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat16, (yyvsp[0].lex).loc, true); + } +#line 4121 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 15: +#line 344 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); + } +#line 4129 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ + case 16: +#line 347 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); + if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) + (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); + } +#line 4139 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, glslang::TParseContext* pParseContext) -{ - unsigned long int yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) + case 17: +#line 355 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , pParseContext); - YYFPRINTF (stderr, "\n"); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -} +#line 4147 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule, pParseContext); \ -} while (0) + case 18: +#line 358 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[-2].lex).loc, (yyvsp[-3].interm.intermTypedNode), (yyvsp[-1].interm.intermTypedNode)); + } +#line 4155 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ + case 19: +#line 361 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } +#line 4163 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 20: +#line 364 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode), *(yyvsp[0].lex).string); + } +#line 4171 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif + case 21: +#line 367 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); + parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "++", (yyvsp[-1].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "++", EOpPostIncrement, (yyvsp[-1].interm.intermTypedNode)); + } +#line 4181 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). + case 22: +#line 372 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); + parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "--", (yyvsp[-1].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "--", EOpPostDecrement, (yyvsp[-1].interm.intermTypedNode)); + } +#line 4191 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ + case 23: +#line 380 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.integerCheck((yyvsp[0].interm.intermTypedNode), "[]"); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } +#line 4200 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif + case 24: +#line 387 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleFunctionCall((yyvsp[0].interm).loc, (yyvsp[0].interm).function, (yyvsp[0].interm).intermNode); + delete (yyvsp[0].interm).function; + } +#line 4209 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 25: +#line 394 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[0].interm); + } +#line 4217 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 26: +#line 400 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[-1].interm); + (yyval.interm).loc = (yyvsp[0].lex).loc; + } +#line 4226 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 27: +#line 404 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[-1].interm); + (yyval.interm).loc = (yyvsp[0].lex).loc; + } +#line 4235 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -#if YYERROR_VERBOSE + case 28: +#line 411 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[-1].interm); + } +#line 4243 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif + case 29: +#line 414 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[0].interm); + } +#line 4251 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; + case 30: +#line 420 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + TParameter param = { 0, new TType }; + param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); + (yyvsp[-1].interm).function->addParameter(param); + (yyval.interm).function = (yyvsp[-1].interm).function; + (yyval.interm).intermNode = (yyvsp[0].interm.intermTypedNode); + } +#line 4263 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - while ((*yyd++ = *yys++) != '\0') - continue; + case 31: +#line 427 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + TParameter param = { 0, new TType }; + param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); + (yyvsp[-2].interm).function->addParameter(param); + (yyval.interm).function = (yyvsp[-2].interm).function; + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); + } +#line 4275 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - return yyd - 1; -} -# endif -# endif + case 32: +#line 437 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[-1].interm); + } +#line 4283 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') + case 33: +#line 445 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - YYSIZE_T yyn = 0; - char const *yyp = yystr; + // Constructor + (yyval.interm).intermNode = 0; + (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); + } +#line 4293 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; + case 34: +#line 450 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + // + // Should be a method or subroutine call, but we haven't recognized the arguments yet. + // + (yyval.interm).function = 0; + (yyval.interm).intermNode = 0; - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; + TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode(); + if (method) { + (yyval.interm).function = new TFunction(&method->getMethodName(), TType(EbtInt), EOpArrayLength); + (yyval.interm).intermNode = method->getObject(); + } else { + TIntermSymbol* symbol = (yyvsp[0].interm.intermTypedNode)->getAsSymbolNode(); + if (symbol) { + parseContext.reservedErrorCheck(symbol->getLoc(), symbol->getName()); + TFunction *function = new TFunction(&symbol->getName(), TType(EbtVoid)); + (yyval.interm).function = function; + } else + parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "function call, method, or subroutine call expected", "", ""); + } - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; + if ((yyval.interm).function == 0) { + // error recover + TString empty(""); + (yyval.interm).function = new TFunction(&empty, TType(EbtVoid), EOpNull); + } } +#line 4325 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif + case 35: +#line 477 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + // Constructor + (yyval.interm).intermNode = 0; + (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); + } +#line 4335 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. + case 36: +#line 485 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.variableCheck((yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + if (TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode()) + parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), ""); + } +#line 4346 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULL; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; + case 37: +#line 491 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "++", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "++", EOpPreIncrement, (yyvsp[0].interm.intermTypedNode)); + } +#line 4355 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) + case 38: +#line 495 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; + parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "--", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "--", EOpPreDecrement, (yyvsp[0].interm.intermTypedNode)); + } +#line 4364 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } + case 39: +#line 499 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + if ((yyvsp[-1].interm).op != EOpNull) { + char errorOp[2] = {0, 0}; + switch((yyvsp[-1].interm).op) { + case EOpNegative: errorOp[0] = '-'; break; + case EOpLogicalNot: errorOp[0] = '!'; break; + case EOpBitwiseNot: errorOp[0] = '~'; break; + default: break; // some compilers want this + } + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].interm).loc, errorOp, (yyvsp[-1].interm).op, (yyvsp[0].interm.intermTypedNode)); + } else { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) + (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } } +#line 4385 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } + case 40: +#line 519 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } +#line 4391 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } + case 41: +#line 520 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNegative; } +#line 4397 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - if (*yymsg_alloc < yysize) + case 42: +#line 521 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLogicalNot; } +#line 4403 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 43: +#line 522 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpBitwiseNot; + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise not"); } +#line 4410 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 44: +#line 528 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4416 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 45: +#line 529 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "*", EOpMul, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } +#line 4426 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ + case 46: +#line 534 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "/", EOpDiv, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 4436 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ + case 47: +#line 539 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "%"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "%", EOpMod, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 4447 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, glslang::TParseContext* pParseContext) -{ - YYUSE (yyvaluep); - YYUSE (pParseContext); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + case 48: +#line 548 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4453 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} + case 49: +#line 549 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "+", EOpAdd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 4463 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 50: +#line 554 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "-", EOpSub, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 4473 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 51: +#line 562 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4479 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 52: +#line 563 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift left"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<<", EOpLeftShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 4490 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/*----------. -| yyparse. | -`----------*/ + case 53: +#line 569 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift right"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">>", EOpRightShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 4501 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -int -yyparse (glslang::TParseContext* pParseContext) -{ -/* The lookahead symbol. */ -int yychar; + case 54: +#line 578 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4507 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 55: +#line 579 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<", EOpLessThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 4517 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/* The semantic value of the lookahead symbol. */ -/* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ -YY_INITIAL_VALUE (static YYSTYPE yyval_default;) -YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); + case 56: +#line 584 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">", EOpGreaterThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 4527 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* Number of syntax errors so far. */ - int yynerrs; + case 57: +#line 589 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<=", EOpLessThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 4537 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; + case 58: +#line 594 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 4547 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. + case 59: +#line 602 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4553 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ + case 60: +#line 603 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); + parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); + parseContext.specializationCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "==", EOpEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 4566 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; + case 61: +#line 611 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); + parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); + parseContext.specializationCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "!=", EOpNotEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 4579 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; + case 62: +#line 622 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4585 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - YYSIZE_T yystacksize; + case 63: +#line 623 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise and"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&", EOpAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 4596 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; + case 64: +#line 632 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4602 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif + case 65: +#line 633 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise exclusive or"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^", EOpExclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 4613 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + case 66: +#line 642 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4619 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; + case 67: +#line 643 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise inclusive or"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "|", EOpInclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 4630 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; + case 68: +#line 652 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4636 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - YYDPRINTF ((stderr, "Starting parse\n")); + case 69: +#line 653 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&&", EOpLogicalAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 4646 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; + case 70: +#line 661 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4652 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; + case 71: +#line 662 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^^", EOpLogicalXor, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 4662 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - yysetstate: - *yyssp = yystate; + case 72: +#line 670 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4668 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - if (yyss + yystacksize - 1 <= yyssp) + case 73: +#line 671 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "||", EOpLogicalOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 4678 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; + case 74: +#line 679 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4684 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); + case 75: +#line 680 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + ++parseContext.controlFlowNestingLevel; + } +#line 4692 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + case 76: +#line 683 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + --parseContext.controlFlowNestingLevel; + parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-5].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-4].lex).loc, "?", (yyvsp[-5].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-1].lex).loc, ":", (yyvsp[-2].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-1].lex).loc, ":", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addSelection((yyvsp[-5].interm.intermTypedNode), (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-4].lex).loc); + if ((yyval.interm.intermTypedNode) == 0) { + parseContext.binaryOpError((yyvsp[-4].lex).loc, ":", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString()); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } + } +#line 4709 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ + case 77: +#line 698 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4715 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; + case 78: +#line 699 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.arrayObjectCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array assignment"); + parseContext.opaqueCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); + parseContext.specializationCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); + parseContext.lValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addAssign((yyvsp[-1].interm).op, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].interm).loc); + if ((yyval.interm.intermTypedNode) == 0) { + parseContext.assignError((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString()); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } + } +#line 4732 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + case 79: +#line 714 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpAssign; + } +#line 4741 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + case 80: +#line 718 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpMulAssign; } +#line 4750 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + case 81: +#line 722 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpDivAssign; + } +#line 4759 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - if (yystate == YYFINAL) - YYACCEPT; + case 82: +#line 726 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "%="); + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpModAssign; + } +#line 4769 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - goto yybackup; + case 83: +#line 731 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpAddAssign; + } +#line 4778 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/*-----------. -| yybackup. | -`-----------*/ -yybackup: + case 84: +#line 735 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpSubAssign; + } +#line 4787 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ + case 85: +#line 739 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift left assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; + } +#line 4796 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; + case 86: +#line 743 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift right assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpRightShiftAssign; + } +#line 4805 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* Not known => get a lookahead token if don't already have one. */ + case 87: +#line 747 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-and assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAndAssign; + } +#line 4814 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) + case 88: +#line 751 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (&yylval, parseContext); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-xor assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; + } +#line 4823 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 89: +#line 755 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-or assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; } +#line 4832 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - if (yychar <= YYEOF) + case 90: +#line 762 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } - else +#line 4840 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 91: +#line 765 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + parseContext.samplerConstructorLocationCheck((yyvsp[-1].lex).loc, ",", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addComma((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); + if ((yyval.interm.intermTypedNode) == 0) { + parseContext.binaryOpError((yyvsp[-1].lex).loc, ",", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString()); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } } +#line 4853 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) + case 92: +#line 776 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; + parseContext.constantValueCheck((yyvsp[0].interm.intermTypedNode), ""); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4862 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - goto yynewstate; + case 93: +#line 783 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */); + (yyval.interm.intermNode) = 0; + // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature + } +#line 4872 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 94: +#line 788 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + if ((yyvsp[-1].interm).intermNode && (yyvsp[-1].interm).intermNode->getAsAggregate()) + (yyvsp[-1].interm).intermNode->getAsAggregate()->setOperator(EOpSequence); + (yyval.interm.intermNode) = (yyvsp[-1].interm).intermNode; + } +#line 4882 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; + case 95: +#line 793 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.profileRequires((yyvsp[-3].lex).loc, ENoProfile, 130, 0, "precision statement"); + // lazy setting of the previous scope's defaults, has effect only the first time it is called in a particular scope + parseContext.symbolTable.setPreviousDefaultPrecisions(&parseContext.defaultPrecision[0]); + parseContext.setDefaultPrecision((yyvsp[-3].lex).loc, (yyvsp[-1].interm.type), (yyvsp[-2].interm.type).qualifier.precision); + (yyval.interm.intermNode) = 0; + } +#line 4895 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; + case 96: +#line 801 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList); + (yyval.interm.intermNode) = 0; + } +#line 4904 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. + case 97: +#line 805 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string); + (yyval.interm.intermNode) = 0; + } +#line 4913 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; + case 98: +#line 809 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes); + (yyval.interm.intermNode) = 0; + } +#line 4922 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 99: +#line 813 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); + parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type)); + (yyval.interm.intermNode) = 0; + } +#line 4932 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - YY_REDUCE_PRINT (yyn); - switch (yyn) + case 100: +#line 818 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - case 2: -#line 253 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + parseContext.checkNoShaderLayouts((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).shaderQualifiers); + parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].lex).string); + (yyval.interm.intermNode) = 0; + } +#line 4942 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 101: +#line 823 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[0].lex).loc, (yyvsp[0].lex).symbol, (yyvsp[0].lex).string); + parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers); + (yyvsp[-1].interm.identifierList)->push_back((yyvsp[-2].lex).string); + parseContext.addQualifierToExisting((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier, *(yyvsp[-1].interm.identifierList)); + (yyval.interm.intermNode) = 0; } -#line 3344 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4953 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 3: -#line 259 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 102: +#line 832 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { parseContext.nestedBlockCheck((yyvsp[-2].interm.type).loc); } +#line 4959 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 103: +#line 832 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + --parseContext.structNestingLevel; + parseContext.blockName = (yyvsp[-4].lex).string; + parseContext.globalQualifierFixCheck((yyvsp[-5].interm.type).loc, (yyvsp[-5].interm.type).qualifier); + parseContext.checkNoShaderLayouts((yyvsp[-5].interm.type).loc, (yyvsp[-5].interm.type).shaderQualifiers); + parseContext.currentBlockQualifier = (yyvsp[-5].interm.type).qualifier; + (yyval.interm).loc = (yyvsp[-5].interm.type).loc; + (yyval.interm).typeList = (yyvsp[-1].interm.typeList); } -#line 3352 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4973 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 4: -#line 262 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 104: +#line 843 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); + (yyval.interm.identifierList) = new TIdentifierList; + (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 3360 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4982 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 5: -#line 265 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 105: +#line 847 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); + (yyval.interm.identifierList) = (yyvsp[-2].interm.identifierList); + (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 3369 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4991 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 6: -#line 269 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 106: +#line 854 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i64, (yyvsp[0].lex).loc, true); + (yyval.interm).function = (yyvsp[-1].interm.function); + (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 3378 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5000 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 7: -#line 273 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 107: +#line 861 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u64, (yyvsp[0].lex).loc, true); + (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 3387 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5008 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 8: -#line 277 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 108: +#line 864 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit integer literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((short)(yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); -#endif + (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 3398 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5016 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 9: -#line 283 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 109: +#line 871 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit unsigned integer literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((unsigned short)(yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); -#endif + // Add the parameter + (yyval.interm.function) = (yyvsp[-1].interm.function); + if ((yyvsp[0].interm).param.type->getBasicType() != EbtVoid) + (yyvsp[-1].interm.function)->addParameter((yyvsp[0].interm).param); + else + delete (yyvsp[0].interm).param.type; } -#line 3409 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5029 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 10: -#line 289 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 110: +#line 879 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); + // + // Only first parameter of one-parameter functions can be void + // The check for named parameters not being void is done in parameter_declarator + // + if ((yyvsp[0].interm).param.type->getBasicType() == EbtVoid) { + // + // This parameter > first is void + // + parseContext.error((yyvsp[-1].lex).loc, "cannot be an argument type except for '(void)'", "void", ""); + delete (yyvsp[0].interm).param.type; + } else { + // Add the parameter + (yyval.interm.function) = (yyvsp[-2].interm.function); + (yyvsp[-2].interm.function)->addParameter((yyvsp[0].interm).param); + } } -#line 3417 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5051 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 11: -#line 292 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 111: +#line 899 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtDouble, (yyvsp[0].lex).loc, true); + if ((yyvsp[-2].interm.type).qualifier.storage != EvqGlobal && (yyvsp[-2].interm.type).qualifier.storage != EvqTemporary) { + parseContext.error((yyvsp[-1].lex).loc, "no qualifiers allowed for function return", + GetStorageQualifierString((yyvsp[-2].interm.type).qualifier.storage), ""); + } + if ((yyvsp[-2].interm.type).arraySizes) + parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); + + // Add the function as a prototype after parsing it (we do not support recursion) + TFunction *function; + TType type((yyvsp[-2].interm.type)); + + // Potentially rename shader entry point function. No-op most of the time. + parseContext.renameShaderFunction((yyvsp[-1].lex).string); + + // Make the function + function = new TFunction((yyvsp[-1].lex).string, type); + (yyval.interm.function) = function; } -#line 3426 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5075 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 12: -#line 296 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 112: +#line 922 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat16, (yyvsp[0].lex).loc, true); -#endif + if ((yyvsp[-1].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[-1].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[-1].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + parseContext.arraySizeRequiredCheck((yyvsp[-1].interm.type).loc, *(yyvsp[-1].interm.type).arraySizes); + } + if ((yyvsp[-1].interm.type).basicType == EbtVoid) { + parseContext.error((yyvsp[0].lex).loc, "illegal use of type 'void'", (yyvsp[0].lex).string->c_str(), ""); + } + parseContext.reservedErrorCheck((yyvsp[0].lex).loc, *(yyvsp[0].lex).string); + + TParameter param = {(yyvsp[0].lex).string, new TType((yyvsp[-1].interm.type))}; + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).param = param; } -#line 3437 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5095 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 13: -#line 302 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 113: +#line 937 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); - } -#line 3445 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; + if ((yyvsp[-2].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); + } + TType* type = new TType((yyvsp[-2].interm.type)); + type->transferArraySizes((yyvsp[0].interm).arraySizes); + type->copyArrayInnerSizes((yyvsp[-2].interm.type).arraySizes); - case 14: -#line 305 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); - if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) - (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); - } -#line 3455 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; + parseContext.arrayOfArrayVersionCheck((yyvsp[-1].lex).loc, type->getArraySizes()); + parseContext.arraySizeRequiredCheck((yyvsp[0].interm).loc, *(yyvsp[0].interm).arraySizes); + parseContext.reservedErrorCheck((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string); - case 15: -#line 313 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); - } -#line 3463 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; + TParameter param = { (yyvsp[-1].lex).string, type }; - case 16: -#line 316 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[-2].lex).loc, (yyvsp[-3].interm.intermTypedNode), (yyvsp[-1].interm.intermTypedNode)); + (yyval.interm).loc = (yyvsp[-1].lex).loc; + (yyval.interm).param = param; } -#line 3471 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5119 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 17: -#line 319 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 114: +#line 962 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + (yyval.interm) = (yyvsp[0].interm); + if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) + (yyval.interm).param.type->getQualifier().precision = (yyvsp[-1].interm.type).qualifier.precision; + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); + + parseContext.checkNoShaderLayouts((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); + parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); + } -#line 3479 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5135 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 18: -#line 322 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 115: +#line 973 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode), *(yyvsp[0].lex).string); + (yyval.interm) = (yyvsp[0].interm); + + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, EvqIn, *(yyvsp[0].interm).param.type); + parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } -#line 3487 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5147 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 19: -#line 325 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 116: +#line 983 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); - parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "++", (yyvsp[-1].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "++", EOpPostIncrement, (yyvsp[-1].interm.intermTypedNode)); + (yyval.interm) = (yyvsp[0].interm); + if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) + (yyval.interm).param.type->getQualifier().precision = (yyvsp[-1].interm.type).qualifier.precision; + parseContext.precisionQualifierCheck((yyvsp[-1].interm.type).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); + + parseContext.checkNoShaderLayouts((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); + parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 3497 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5162 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 20: -#line 330 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 117: +#line 993 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); - parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "--", (yyvsp[-1].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "--", EOpPostDecrement, (yyvsp[-1].interm.intermTypedNode)); + (yyval.interm) = (yyvsp[0].interm); + + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, EvqIn, *(yyvsp[0].interm).param.type); + parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } -#line 3507 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5174 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 21: -#line 338 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 118: +#line 1003 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.integerCheck((yyvsp[0].interm.intermTypedNode), "[]"); - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + TParameter param = { 0, new TType((yyvsp[0].interm.type)) }; + (yyval.interm).param = param; + if ((yyvsp[0].interm.type).arraySizes) + parseContext.arraySizeRequiredCheck((yyvsp[0].interm.type).loc, *(yyvsp[0].interm.type).arraySizes); } -#line 3516 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5185 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 22: -#line 345 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 119: +#line 1012 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleFunctionCall((yyvsp[0].interm).loc, (yyvsp[0].interm).function, (yyvsp[0].interm).intermNode); - delete (yyvsp[0].interm).function; + (yyval.interm) = (yyvsp[0].interm); } -#line 3525 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5193 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 23: -#line 352 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 120: +#line 1015 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[0].interm); + (yyval.interm) = (yyvsp[-2].interm); + parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-2].interm).type); } -#line 3533 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5202 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 24: -#line 358 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 121: +#line 1019 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[-1].interm); - (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm) = (yyvsp[-3].interm); + parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-3].interm).type, (yyvsp[0].interm).arraySizes); } -#line 3542 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5211 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 25: -#line 362 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 122: +#line 1023 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[-1].interm); - (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).type = (yyvsp[-5].interm).type; + TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-5].interm).type, (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-5].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 3551 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5221 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 26: -#line 369 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 123: +#line 1028 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[-1].interm); + (yyval.interm).type = (yyvsp[-4].interm).type; + TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, 0, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-4].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 3559 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5231 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 27: -#line 372 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 124: +#line 1036 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[0].interm); + (yyval.interm).type = (yyvsp[0].interm.type); + (yyval.interm).intermNode = 0; + parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); } -#line 3567 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5241 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 28: -#line 378 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 125: +#line 1041 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - TParameter param = { 0, new TType }; - param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); - (yyvsp[-1].interm).function->addParameter(param); - (yyval.interm).function = (yyvsp[-1].interm).function; - (yyval.interm).intermNode = (yyvsp[0].interm.intermTypedNode); + (yyval.interm).type = (yyvsp[-1].interm.type); + (yyval.interm).intermNode = 0; + parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type)); } -#line 3579 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5251 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 29: -#line 385 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 126: +#line 1046 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - TParameter param = { 0, new TType }; - param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); - (yyvsp[-2].interm).function->addParameter(param); - (yyval.interm).function = (yyvsp[-2].interm).function; - (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); + (yyval.interm).type = (yyvsp[-2].interm.type); + (yyval.interm).intermNode = 0; + parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-2].interm.type), (yyvsp[0].interm).arraySizes); } -#line 3591 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5261 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 30: -#line 395 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 127: +#line 1051 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[-1].interm); + (yyval.interm).type = (yyvsp[-4].interm.type); + TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-4].interm.type), (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 3599 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5271 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 31: -#line 403 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 128: +#line 1056 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // Constructor - (yyval.interm).intermNode = 0; - (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); + (yyval.interm).type = (yyvsp[-3].interm.type); + TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 3609 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5281 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 32: -#line 408 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 129: +#line 1065 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // - // Should be a method or subroutine call, but we haven't recognized the arguments yet. - // - (yyval.interm).function = 0; - (yyval.interm).intermNode = 0; + (yyval.interm.type) = (yyvsp[0].interm.type); - TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode(); - if (method) { - (yyval.interm).function = new TFunction(&method->getMethodName(), TType(EbtInt), EOpArrayLength); - (yyval.interm).intermNode = method->getObject(); - } else { - TIntermSymbol* symbol = (yyvsp[0].interm.intermTypedNode)->getAsSymbolNode(); - if (symbol) { - parseContext.reservedErrorCheck(symbol->getLoc(), symbol->getName()); - TFunction *function = new TFunction(&symbol->getName(), TType(EbtVoid)); - (yyval.interm).function = function; - } else - parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "function call, method, or subroutine call expected", "", ""); + parseContext.globalQualifierTypeCheck((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier, (yyval.interm.type)); + if ((yyvsp[0].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[0].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[0].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); } - if ((yyval.interm).function == 0) { - // error recover - TString empty(""); - (yyval.interm).function = new TFunction(&empty, TType(EbtVoid), EOpNull); - } + parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier); } -#line 3641 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5297 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 33: -#line 438 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 130: +#line 1076 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.variableCheck((yyvsp[0].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); - if (TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode()) - parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), ""); - } -#line 3652 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; + parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); + parseContext.globalQualifierTypeCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, (yyvsp[0].interm.type)); - case 34: -#line 444 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "++", (yyvsp[0].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "++", EOpPreIncrement, (yyvsp[0].interm.intermTypedNode)); + if ((yyvsp[0].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[0].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[0].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + } + + if ((yyvsp[0].interm.type).arraySizes && parseContext.arrayQualifierError((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).qualifier)) + (yyvsp[0].interm.type).arraySizes = nullptr; + + parseContext.checkNoShaderLayouts((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); + (yyvsp[0].interm.type).shaderQualifiers.merge((yyvsp[-1].interm.type).shaderQualifiers); + parseContext.mergeQualifiers((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier, (yyvsp[-1].interm.type).qualifier, true); + parseContext.precisionQualifierCheck((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).basicType, (yyvsp[0].interm.type).qualifier); + + (yyval.interm.type) = (yyvsp[0].interm.type); + + if (! (yyval.interm.type).qualifier.isInterpolation() && + ((parseContext.language == EShLangVertex && (yyval.interm.type).qualifier.storage == EvqVaryingOut) || + (parseContext.language == EShLangFragment && (yyval.interm.type).qualifier.storage == EvqVaryingIn))) + (yyval.interm.type).qualifier.smooth = true; } -#line 3661 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5326 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 35: -#line 448 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 131: +#line 1103 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "--", (yyvsp[0].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "--", EOpPreDecrement, (yyvsp[0].interm.intermTypedNode)); + parseContext.globalCheck((yyvsp[0].lex).loc, "invariant"); + parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, 0, "invariant"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.invariant = true; } -#line 3670 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5337 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 36: -#line 452 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 132: +#line 1112 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - if ((yyvsp[-1].interm).op != EOpNull) { - char errorOp[2] = {0, 0}; - switch((yyvsp[-1].interm).op) { - case EOpNegative: errorOp[0] = '-'; break; - case EOpLogicalNot: errorOp[0] = '!'; break; - case EOpBitwiseNot: errorOp[0] = '~'; break; - default: break; // some compilers want this - } - (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].interm).loc, errorOp, (yyvsp[-1].interm).op, (yyvsp[0].interm.intermTypedNode)); - } else { - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); - if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) - (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); - } + parseContext.globalCheck((yyvsp[0].lex).loc, "smooth"); + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "smooth"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "smooth"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.smooth = true; } -#line 3691 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 37: -#line 472 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } -#line 3697 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 38: -#line 473 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNegative; } -#line 3703 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 39: -#line 474 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLogicalNot; } -#line 3709 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5349 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 40: -#line 475 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpBitwiseNot; - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise not"); } -#line 3716 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 133: +#line 1119 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.globalCheck((yyvsp[0].lex).loc, "flat"); + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "flat"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "flat"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.flat = true; + } +#line 5361 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 41: -#line 481 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3722 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 134: +#line 1126 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.globalCheck((yyvsp[0].lex).loc, "noperspective"); +#ifdef NV_EXTENSIONS + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective"); +#else + parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "noperspective"); +#endif + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "noperspective"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.nopersp = true; + } +#line 5377 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 42: -#line 482 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 135: +#line 1137 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "*", EOpMul, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); +#ifdef AMD_EXTENSIONS + parseContext.globalCheck((yyvsp[0].lex).loc, "__explicitInterpAMD"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECompatibilityProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.explicitInterp = true; +#endif } -#line 3732 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5391 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 43: -#line 487 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 136: +#line 1149 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "/", EOpDiv, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + (yyval.interm.type) = (yyvsp[-1].interm.type); } -#line 3742 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5399 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 44: -#line 492 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 137: +#line 1155 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "%"); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "%", EOpMod, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 3753 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5407 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 45: -#line 501 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3759 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 138: +#line 1158 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type) = (yyvsp[-2].interm.type); + (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); + parseContext.mergeObjectLayoutQualifiers((yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); + } +#line 5417 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 46: -#line 502 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 139: +#line 1165 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "+", EOpAdd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), *(yyvsp[0].lex).string); } -#line 3769 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5426 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 47: -#line 507 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 140: +#line 1169 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "-", EOpSub, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + (yyval.interm.type).init((yyvsp[-2].lex).loc); + parseContext.setLayoutQualifier((yyvsp[-2].lex).loc, (yyval.interm.type), *(yyvsp[-2].lex).string, (yyvsp[0].interm.intermTypedNode)); } -#line 3779 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5435 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 48: -#line 515 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3785 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 141: +#line 1173 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { // because "shared" is both an identifier and a keyword + (yyval.interm.type).init((yyvsp[0].lex).loc); + TString strShared("shared"); + parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), strShared); + } +#line 5445 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 49: -#line 516 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 142: +#line 1181 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift left"); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<<", EOpLeftShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + parseContext.profileRequires((yyval.interm.type).loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.noContraction = true; } -#line 3796 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5456 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 50: -#line 522 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 143: +#line 1190 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift right"); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">>", EOpRightShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 3807 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5464 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 51: -#line 531 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3813 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 144: +#line 1193 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type) = (yyvsp[-1].interm.type); + if ((yyval.interm.type).basicType == EbtVoid) + (yyval.interm.type).basicType = (yyvsp[0].interm.type).basicType; + + (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); + parseContext.mergeQualifiers((yyval.interm.type).loc, (yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); + } +#line 5477 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 52: -#line 532 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 145: +#line 1204 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<", EOpLessThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 3823 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5485 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 53: -#line 537 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 146: +#line 1207 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">", EOpGreaterThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 3833 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5493 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 54: -#line 542 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 147: +#line 1210 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<=", EOpLessThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + parseContext.checkPrecisionQualifier((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier.precision); + (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 3843 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5502 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 55: -#line 547 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 148: +#line 1214 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + // allow inheritance of storage qualifier from block declaration + (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 3853 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5511 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 56: -#line 555 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3859 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 149: +#line 1218 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + // allow inheritance of storage qualifier from block declaration + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 5520 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 57: -#line 556 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 150: +#line 1222 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); - parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); - parseContext.specializationCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "==", EOpEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + // allow inheritance of storage qualifier from block declaration + (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 3872 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5529 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 58: -#line 564 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 151: +#line 1226 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); - parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); - parseContext.specializationCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "!=", EOpNotEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 3885 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5537 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 59: -#line 575 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3891 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 152: +#line 1232 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant + } +#line 5546 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 60: -#line 576 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 153: +#line 1236 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise and"); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&", EOpAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangVertex, "attribute"); + parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "attribute"); + parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "attribute"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, ECoreProfile, 420, "attribute"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, EEsProfile, 300, "attribute"); + + parseContext.globalCheck((yyvsp[0].lex).loc, "attribute"); + + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 3902 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5563 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 61: -#line 585 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3908 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 154: +#line 1248 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "varying"); + parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "varying"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, ECoreProfile, 420, "varying"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, EEsProfile, 300, "varying"); + + parseContext.globalCheck((yyvsp[0].lex).loc, "varying"); + + (yyval.interm.type).init((yyvsp[0].lex).loc); + if (parseContext.language == EShLangVertex) + (yyval.interm.type).qualifier.storage = EvqVaryingOut; + else + (yyval.interm.type).qualifier.storage = EvqVaryingIn; + } +#line 5582 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 62: -#line 586 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 155: +#line 1262 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise exclusive or"); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^", EOpExclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + parseContext.globalCheck((yyvsp[0].lex).loc, "inout"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqInOut; } -#line 3919 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5592 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 63: -#line 595 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3925 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 156: +#line 1267 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.globalCheck((yyvsp[0].lex).loc, "in"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later + (yyval.interm.type).qualifier.storage = EvqIn; + } +#line 5603 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 64: -#line 596 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 157: +#line 1273 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise inclusive or"); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "|", EOpInclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + parseContext.globalCheck((yyvsp[0].lex).loc, "out"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later + (yyval.interm.type).qualifier.storage = EvqOut; } -#line 3936 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5614 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 65: -#line 605 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3942 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 158: +#line 1279 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 120, 0, "centroid"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "centroid"); + parseContext.globalCheck((yyvsp[0].lex).loc, "centroid"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.centroid = true; + } +#line 5626 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 159: +#line 1286 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.globalCheck((yyvsp[0].lex).loc, "patch"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.patch = true; + } +#line 5637 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 66: -#line 606 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 160: +#line 1292 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&&", EOpLogicalAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + parseContext.globalCheck((yyvsp[0].lex).loc, "sample"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.sample = true; } -#line 3952 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 67: -#line 614 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3958 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5647 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 68: -#line 615 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 161: +#line 1297 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^^", EOpLogicalXor, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + parseContext.globalCheck((yyvsp[0].lex).loc, "uniform"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqUniform; } -#line 3968 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5657 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 69: -#line 623 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3974 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 162: +#line 1302 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.globalCheck((yyvsp[0].lex).loc, "buffer"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqBuffer; + } +#line 5667 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 70: -#line 624 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 163: +#line 1307 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "||", EOpLogicalOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + parseContext.globalCheck((yyvsp[0].lex).loc, "shared"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 310, 0, "shared"); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangCompute, "shared"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqShared; } -#line 3984 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5680 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 71: -#line 632 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3990 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 164: +#line 1315 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.coherent = true; + } +#line 5689 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 72: -#line 633 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 165: +#line 1319 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - ++parseContext.controlFlowNestingLevel; + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.volatil = true; } -#line 3998 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5698 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 73: -#line 636 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 166: +#line 1323 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - --parseContext.controlFlowNestingLevel; - parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-5].interm.intermTypedNode)); - parseContext.rValueErrorCheck((yyvsp[-4].lex).loc, "?", (yyvsp[-5].interm.intermTypedNode)); - parseContext.rValueErrorCheck((yyvsp[-1].lex).loc, ":", (yyvsp[-2].interm.intermTypedNode)); - parseContext.rValueErrorCheck((yyvsp[-1].lex).loc, ":", (yyvsp[0].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addSelection((yyvsp[-5].interm.intermTypedNode), (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-4].lex).loc); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext.binaryOpError((yyvsp[-4].lex).loc, ":", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString()); - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); - } + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.restrict = true; } -#line 4015 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5707 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 74: -#line 651 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4021 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 167: +#line 1327 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.readonly = true; + } +#line 5716 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 75: -#line 652 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 168: +#line 1331 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.arrayObjectCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array assignment"); - parseContext.opaqueCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); - parseContext.specializationCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); - parseContext.lValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode)); - parseContext.rValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[0].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addAssign((yyvsp[-1].interm).op, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].interm).loc); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext.assignError((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString()); - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); - } + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.writeonly = true; } -#line 4038 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5725 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 76: -#line 667 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 169: +#line 1335 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[0].lex).loc; - (yyval.interm).op = EOpAssign; + parseContext.spvRemoved((yyvsp[0].lex).loc, "subroutine"); + parseContext.globalCheck((yyvsp[0].lex).loc, "subroutine"); + parseContext.unimplemented((yyvsp[0].lex).loc, "subroutine"); + (yyval.interm.type).init((yyvsp[0].lex).loc); } -#line 4047 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5736 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 77: -#line 671 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 170: +#line 1341 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[0].lex).loc; - (yyval.interm).op = EOpMulAssign; + parseContext.spvRemoved((yyvsp[-3].lex).loc, "subroutine"); + parseContext.globalCheck((yyvsp[-3].lex).loc, "subroutine"); + parseContext.unimplemented((yyvsp[-3].lex).loc, "subroutine"); + (yyval.interm.type).init((yyvsp[-3].lex).loc); } -#line 4056 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5747 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 78: -#line 675 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 171: +#line 1350 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[0].lex).loc; - (yyval.interm).op = EOpDivAssign; + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.nonUniform = true; } -#line 4065 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5756 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 79: -#line 679 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 172: +#line 1357 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "%="); - (yyval.interm).loc = (yyvsp[0].lex).loc; - (yyval.interm).op = EOpModAssign; + // TODO } -#line 4075 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5764 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 80: -#line 684 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 173: +#line 1360 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[0].lex).loc; - (yyval.interm).op = EOpAddAssign; + // TODO: 4.0 semantics: subroutines + // 1) make sure each identifier is a type declared earlier with SUBROUTINE + // 2) save all of the identifiers for future comparison with the declared function } -#line 4084 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5774 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 81: -#line 688 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 174: +#line 1368 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[0].lex).loc; - (yyval.interm).op = EOpSubAssign; + (yyval.interm.type) = (yyvsp[0].interm.type); + (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); } -#line 4093 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5783 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 82: -#line 692 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 175: +#line 1372 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift left assign"); - (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; + parseContext.arrayOfArrayVersionCheck((yyvsp[0].interm).loc, (yyvsp[0].interm).arraySizes); + (yyval.interm.type) = (yyvsp[-1].interm.type); + (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); + (yyval.interm.type).arraySizes = (yyvsp[0].interm).arraySizes; } -#line 4102 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5794 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 83: -#line 696 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 176: +#line 1381 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift right assign"); - (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpRightShiftAssign; + (yyval.interm).loc = (yyvsp[-1].lex).loc; + (yyval.interm).arraySizes = new TArraySizes; + (yyval.interm).arraySizes->addInnerSize(); } -#line 4111 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5804 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 84: -#line 700 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 177: +#line 1386 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-and assign"); - (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAndAssign; + (yyval.interm).loc = (yyvsp[-2].lex).loc; + (yyval.interm).arraySizes = new TArraySizes; + + TArraySize size; + parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size); + (yyval.interm).arraySizes->addInnerSize(size); } -#line 4120 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5817 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 85: -#line 704 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 178: +#line 1394 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-xor assign"); - (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; + (yyval.interm) = (yyvsp[-2].interm); + (yyval.interm).arraySizes->addInnerSize(); } -#line 4129 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5826 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 86: -#line 708 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 179: +#line 1398 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-or assign"); - (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; + (yyval.interm) = (yyvsp[-3].interm); + + TArraySize size; + parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size); + (yyval.interm).arraySizes->addInnerSize(size); } -#line 4138 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5838 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 87: -#line 715 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 180: +#line 1408 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtVoid; } -#line 4146 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5847 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 88: -#line 718 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 181: +#line 1412 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.samplerConstructorLocationCheck((yyvsp[-1].lex).loc, ",", (yyvsp[0].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addComma((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext.binaryOpError((yyvsp[-1].lex).loc, ",", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString()); - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); - } + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; } -#line 4159 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5856 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 89: -#line 729 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 182: +#line 1416 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.constantValueCheck((yyvsp[0].interm.intermTypedNode), ""); - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; } -#line 4168 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5866 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 90: -#line 736 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 183: +#line 1421 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */); - (yyval.interm.intermNode) = 0; - // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature + parseContext.float16Check((yyvsp[0].lex).loc, "float16_t", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; } -#line 4178 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5876 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 91: -#line 741 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 184: +#line 1426 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - if ((yyvsp[-1].interm).intermNode && (yyvsp[-1].interm).intermNode->getAsAggregate()) - (yyvsp[-1].interm).intermNode->getAsAggregate()->setOperator(EOpSequence); - (yyval.interm.intermNode) = (yyvsp[-1].interm).intermNode; + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; } -#line 4188 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5886 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 92: -#line 746 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 185: +#line 1431 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.profileRequires((yyvsp[-3].lex).loc, ENoProfile, 130, 0, "precision statement"); - - // lazy setting of the previous scope's defaults, has effect only the first time it is called in a particular scope - parseContext.symbolTable.setPreviousDefaultPrecisions(&parseContext.defaultPrecision[0]); - parseContext.setDefaultPrecision((yyvsp[-3].lex).loc, (yyvsp[-1].interm.type), (yyvsp[-2].interm.type).qualifier.precision); - (yyval.interm.intermNode) = 0; + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; } -#line 4201 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5896 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 93: -#line 754 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 186: +#line 1436 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList); - (yyval.interm.intermNode) = 0; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; } -#line 4210 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5905 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 94: -#line 758 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 187: +#line 1440 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string); - (yyval.interm.intermNode) = 0; + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; } -#line 4219 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5915 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 95: -#line 762 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 188: +#line 1445 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes); - (yyval.interm.intermNode) = 0; + parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; } -#line 4228 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5925 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 96: -#line 766 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 189: +#line 1450 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); - parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type)); - (yyval.interm.intermNode) = 0; + parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint8; } -#line 4238 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5935 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 97: -#line 771 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 190: +#line 1455 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.checkNoShaderLayouts((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).shaderQualifiers); - parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].lex).string); - (yyval.interm.intermNode) = 0; + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; } -#line 4248 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5945 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 98: -#line 776 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 191: +#line 1460 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers); - (yyvsp[-1].interm.identifierList)->push_back((yyvsp[-2].lex).string); - parseContext.addQualifierToExisting((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier, *(yyvsp[-1].interm.identifierList)); - (yyval.interm.intermNode) = 0; + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; } -#line 4259 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5955 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 99: -#line 785 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { parseContext.nestedBlockCheck((yyvsp[-2].interm.type).loc); } -#line 4265 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 100: -#line 785 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 192: +#line 1465 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - --parseContext.structNestingLevel; - parseContext.blockName = (yyvsp[-4].lex).string; - parseContext.globalQualifierFixCheck((yyvsp[-5].interm.type).loc, (yyvsp[-5].interm.type).qualifier); - parseContext.checkNoShaderLayouts((yyvsp[-5].interm.type).loc, (yyvsp[-5].interm.type).shaderQualifiers); - parseContext.currentBlockQualifier = (yyvsp[-5].interm.type).qualifier; - (yyval.interm).loc = (yyvsp[-5].interm.type).loc; - (yyval.interm).typeList = (yyvsp[-1].interm.typeList); + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; } -#line 4279 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5965 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 101: -#line 796 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 193: +#line 1470 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.identifierList) = new TIdentifierList; - (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; } -#line 4288 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5975 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 102: -#line 800 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 194: +#line 1475 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.identifierList) = (yyvsp[-2].interm.identifierList); - (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; } -#line 4297 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5985 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 103: -#line 807 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 195: +#line 1480 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).function = (yyvsp[-1].interm.function); - (yyval.interm).loc = (yyvsp[0].lex).loc; + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint64; } -#line 4306 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5995 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 104: -#line 814 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 196: +#line 1485 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.function) = (yyvsp[0].interm.function); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; } -#line 4314 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6004 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 105: -#line 817 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 197: +#line 1489 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.function) = (yyvsp[0].interm.function); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(2); } -#line 4322 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6014 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 106: -#line 824 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 198: +#line 1494 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // Add the parameter - (yyval.interm.function) = (yyvsp[-1].interm.function); - if ((yyvsp[0].interm).param.type->getBasicType() != EbtVoid) - (yyvsp[-1].interm.function)->addParameter((yyvsp[0].interm).param); - else - delete (yyvsp[0].interm).param.type; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(3); } -#line 4335 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6024 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 107: -#line 832 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 199: +#line 1499 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // - // Only first parameter of one-parameter functions can be void - // The check for named parameters not being void is done in parameter_declarator - // - if ((yyvsp[0].interm).param.type->getBasicType() == EbtVoid) { - // - // This parameter > first is void - // - parseContext.error((yyvsp[-1].lex).loc, "cannot be an argument type except for '(void)'", "void", ""); - delete (yyvsp[0].interm).param.type; - } else { - // Add the parameter - (yyval.interm.function) = (yyvsp[-2].interm.function); - (yyvsp[-2].interm.function)->addParameter((yyvsp[0].interm).param); - } + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(4); } -#line 4357 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6034 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 108: -#line 852 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 200: +#line 1504 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - if ((yyvsp[-2].interm.type).qualifier.storage != EvqGlobal && (yyvsp[-2].interm.type).qualifier.storage != EvqTemporary) { - parseContext.error((yyvsp[-1].lex).loc, "no qualifiers allowed for function return", - GetStorageQualifierString((yyvsp[-2].interm.type).qualifier.storage), ""); - } - if ((yyvsp[-2].interm.type).arraySizes) - parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); - - // Add the function as a prototype after parsing it (we do not support recursion) - TFunction *function; - TType type((yyvsp[-2].interm.type)); - - // Potentially rename shader entry point function. No-op most of the time. - parseContext.renameShaderFunction((yyvsp[-1].lex).string); - - // Make the function - function = new TFunction((yyvsp[-1].lex).string, type); - (yyval.interm.function) = function; + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(2); } -#line 4381 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6045 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 109: -#line 875 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 201: +#line 1510 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - if ((yyvsp[-1].interm.type).arraySizes) { - parseContext.profileRequires((yyvsp[-1].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); - parseContext.profileRequires((yyvsp[-1].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); - parseContext.arraySizeRequiredCheck((yyvsp[-1].interm.type).loc, *(yyvsp[-1].interm.type).arraySizes); - } - if ((yyvsp[-1].interm.type).basicType == EbtVoid) { - parseContext.error((yyvsp[0].lex).loc, "illegal use of type 'void'", (yyvsp[0].lex).string->c_str(), ""); - } - parseContext.reservedErrorCheck((yyvsp[0].lex).loc, *(yyvsp[0].lex).string); - - TParameter param = {(yyvsp[0].lex).string, new TType((yyvsp[-1].interm.type))}; - (yyval.interm).loc = (yyvsp[0].lex).loc; - (yyval.interm).param = param; + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(3); } -#line 4401 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6056 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 110: -#line 890 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 202: +#line 1516 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - if ((yyvsp[-2].interm.type).arraySizes) { - parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); - parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); - parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); - } - parseContext.arrayDimCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.type).arraySizes, (yyvsp[0].interm).arraySizes); - - parseContext.arraySizeRequiredCheck((yyvsp[0].interm).loc, *(yyvsp[0].interm).arraySizes); - parseContext.reservedErrorCheck((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string); - - (yyvsp[-2].interm.type).arraySizes = (yyvsp[0].interm).arraySizes; - - TParameter param = { (yyvsp[-1].lex).string, new TType((yyvsp[-2].interm.type))}; - (yyval.interm).loc = (yyvsp[-1].lex).loc; - (yyval.interm).param = param; + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(4); } -#line 4423 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6067 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 111: -#line 913 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 203: +#line 1522 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[0].interm); - if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) - (yyval.interm).param.type->getQualifier().precision = (yyvsp[-1].interm.type).qualifier.precision; - parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); - - parseContext.checkNoShaderLayouts((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); - parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); - parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); - + parseContext.float16Check((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(2); } -#line 4439 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6078 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 112: -#line 924 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 204: +#line 1528 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[0].interm); - - parseContext.parameterTypeCheck((yyvsp[0].interm).loc, EvqIn, *(yyvsp[0].interm).param.type); - parseContext.paramCheckFix((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); - parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(3); } -#line 4451 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6089 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 113: -#line 934 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 205: +#line 1534 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[0].interm); - if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) - (yyval.interm).param.type->getQualifier().precision = (yyvsp[-1].interm.type).qualifier.precision; - parseContext.precisionQualifierCheck((yyvsp[-1].interm.type).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); - - parseContext.checkNoShaderLayouts((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); - parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); - parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); + parseContext.float16Check((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(4); } -#line 4466 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6100 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 114: -#line 944 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 206: +#line 1540 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[0].interm); - - parseContext.parameterTypeCheck((yyvsp[0].interm).loc, EvqIn, *(yyvsp[0].interm).param.type); - parseContext.paramCheckFix((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); - parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(2); } -#line 4478 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6111 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 115: -#line 954 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 207: +#line 1546 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - TParameter param = { 0, new TType((yyvsp[0].interm.type)) }; - (yyval.interm).param = param; - if ((yyvsp[0].interm.type).arraySizes) - parseContext.arraySizeRequiredCheck((yyvsp[0].interm.type).loc, *(yyvsp[0].interm.type).arraySizes); + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(3); } -#line 4489 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6122 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 116: -#line 963 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 208: +#line 1552 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[0].interm); + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(4); } -#line 4497 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6133 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 117: -#line 966 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 209: +#line 1558 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[-2].interm); - parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-2].interm).type); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(2); } -#line 4506 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6144 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 118: -#line 970 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 210: +#line 1564 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[-3].interm); - parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-3].interm).type, (yyvsp[0].interm).arraySizes); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(3); } -#line 4515 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6155 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 119: -#line 974 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 211: +#line 1570 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[-5].interm).type; - TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-5].interm).type, (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); - (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-5].interm).intermNode, initNode, (yyvsp[-1].lex).loc); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(4); } -#line 4525 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6166 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 120: -#line 979 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 212: +#line 1576 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[-4].interm).type; - TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, 0, (yyvsp[0].interm.intermTypedNode)); - (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-4].interm).intermNode, initNode, (yyvsp[-1].lex).loc); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(2); } -#line 4535 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6176 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 121: -#line 987 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 213: +#line 1581 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[0].interm.type); - (yyval.interm).intermNode = 0; - parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(3); } -#line 4545 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6186 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 122: -#line 992 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 214: +#line 1586 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[-1].interm.type); - (yyval.interm).intermNode = 0; - parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type)); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(4); } -#line 4555 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6196 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 123: -#line 997 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 215: +#line 1591 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[-2].interm.type); - (yyval.interm).intermNode = 0; - parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-2].interm.type), (yyvsp[0].interm).arraySizes); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(2); } -#line 4565 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6206 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 124: -#line 1002 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 216: +#line 1596 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[-4].interm.type); - TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-4].interm.type), (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); - (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(3); } -#line 4575 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6216 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 125: -#line 1007 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 217: +#line 1601 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[-3].interm.type); - TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); - (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(4); } -#line 4585 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6226 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 126: -#line 1016 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 218: +#line 1606 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[0].interm.type); - - parseContext.globalQualifierTypeCheck((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier, (yyval.interm.type)); - if ((yyvsp[0].interm.type).arraySizes) { - parseContext.profileRequires((yyvsp[0].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); - parseContext.profileRequires((yyvsp[0].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); - } - - parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier); + parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(2); } -#line 4601 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6237 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 127: -#line 1027 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 219: +#line 1612 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); - parseContext.globalQualifierTypeCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, (yyvsp[0].interm.type)); - - if ((yyvsp[0].interm.type).arraySizes) { - parseContext.profileRequires((yyvsp[0].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); - parseContext.profileRequires((yyvsp[0].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); - } - - if ((yyvsp[0].interm.type).arraySizes && parseContext.arrayQualifierError((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).qualifier)) - (yyvsp[0].interm.type).arraySizes = 0; - - parseContext.checkNoShaderLayouts((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); - (yyvsp[0].interm.type).shaderQualifiers.merge((yyvsp[-1].interm.type).shaderQualifiers); - parseContext.mergeQualifiers((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier, (yyvsp[-1].interm.type).qualifier, true); - parseContext.precisionQualifierCheck((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).basicType, (yyvsp[0].interm.type).qualifier); - - (yyval.interm.type) = (yyvsp[0].interm.type); - - if (! (yyval.interm.type).qualifier.isInterpolation() && - ((parseContext.language == EShLangVertex && (yyval.interm.type).qualifier.storage == EvqVaryingOut) || - (parseContext.language == EShLangFragment && (yyval.interm.type).qualifier.storage == EvqVaryingIn))) - (yyval.interm.type).qualifier.smooth = true; + parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(3); } -#line 4630 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6248 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 128: -#line 1054 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 220: +#line 1618 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "invariant"); - parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, 0, "invariant"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.invariant = true; + parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(4); } -#line 4641 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6259 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 129: -#line 1063 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 221: +#line 1624 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "smooth"); - parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "smooth"); - parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "smooth"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.smooth = true; + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(2); } -#line 4653 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6270 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 130: -#line 1070 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 222: +#line 1630 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "flat"); - parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "flat"); - parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "flat"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.flat = true; + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(3); } -#line 4665 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6281 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 131: -#line 1077 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 223: +#line 1636 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "noperspective"); - parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "noperspective"); - parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "noperspective"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.nopersp = true; + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(4); } -#line 4677 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6292 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 132: -#line 1084 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 224: +#line 1642 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.globalCheck((yyvsp[0].lex).loc, "__explicitInterpAMD"); - parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); - parseContext.profileRequires((yyvsp[0].lex).loc, ECompatibilityProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.explicitInterp = true; -#endif + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(2); } -#line 4691 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6303 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 133: -#line 1096 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 225: +#line 1648 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[-1].interm.type); + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(3); } -#line 4699 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6314 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 134: -#line 1102 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 226: +#line 1654 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[0].interm.type); + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(4); } -#line 4707 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6325 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 135: -#line 1105 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 227: +#line 1660 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[-2].interm.type); - (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); - parseContext.mergeObjectLayoutQualifiers((yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(2); } -#line 4717 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6336 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 136: -#line 1112 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 228: +#line 1666 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[0].lex).loc); - parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), *(yyvsp[0].lex).string); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(3); } -#line 4726 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6347 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 137: -#line 1116 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 229: +#line 1672 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[-2].lex).loc); - parseContext.setLayoutQualifier((yyvsp[-2].lex).loc, (yyval.interm.type), *(yyvsp[-2].lex).string, (yyvsp[0].interm.intermTypedNode)); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(4); } -#line 4735 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6358 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 138: -#line 1120 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { // because "shared" is both an identifier and a keyword - (yyval.interm.type).init((yyvsp[0].lex).loc); - TString strShared("shared"); - parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), strShared); + case 230: +#line 1678 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(2); } -#line 4745 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6369 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 139: -#line 1128 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 231: +#line 1684 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.profileRequires((yyval.interm.type).loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise"); - parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.noContraction = true; + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(3); } -#line 4756 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6380 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 140: -#line 1137 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 232: +#line 1690 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[0].interm.type); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(4); } -#line 4764 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6391 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 141: -#line 1140 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 233: +#line 1696 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[-1].interm.type); - if ((yyval.interm.type).basicType == EbtVoid) - (yyval.interm.type).basicType = (yyvsp[0].interm.type).basicType; - - (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); - parseContext.mergeQualifiers((yyval.interm.type).loc, (yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); + parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint8; + (yyval.interm.type).setVector(2); } -#line 4777 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6402 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 142: -#line 1151 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 234: +#line 1702 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[0].interm.type); + parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(3); } -#line 4785 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6413 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 143: -#line 1154 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 235: +#line 1708 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[0].interm.type); + parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint8; + (yyval.interm.type).setVector(4); } -#line 4793 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6424 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 144: -#line 1157 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 236: +#line 1714 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.checkPrecisionQualifier((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier.precision); - (yyval.interm.type) = (yyvsp[0].interm.type); + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(2); } -#line 4802 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6435 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 145: -#line 1161 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 237: +#line 1720 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // allow inheritance of storage qualifier from block declaration - (yyval.interm.type) = (yyvsp[0].interm.type); + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(3); } -#line 4811 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6446 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 146: -#line 1165 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 238: +#line 1726 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // allow inheritance of storage qualifier from block declaration - (yyval.interm.type) = (yyvsp[0].interm.type); + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(4); } -#line 4820 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6457 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 147: -#line 1169 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 239: +#line 1732 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // allow inheritance of storage qualifier from block declaration - (yyval.interm.type) = (yyvsp[0].interm.type); + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(2); } -#line 4829 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6468 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 148: -#line 1176 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 240: +#line 1738 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(3); } -#line 4838 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6479 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 149: -#line 1180 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 241: +#line 1744 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.requireStage((yyvsp[0].lex).loc, EShLangVertex, "attribute"); - parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "attribute"); - parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "attribute"); - parseContext.requireNotRemoved((yyvsp[0].lex).loc, ECoreProfile, 420, "attribute"); - parseContext.requireNotRemoved((yyvsp[0].lex).loc, EEsProfile, 300, "attribute"); - - parseContext.globalCheck((yyvsp[0].lex).loc, "attribute"); - - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.storage = EvqVaryingIn; + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(4); } -#line 4855 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6490 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 150: -#line 1192 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 242: +#line 1750 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "varying"); - parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "varying"); - parseContext.requireNotRemoved((yyvsp[0].lex).loc, ECoreProfile, 420, "varying"); - parseContext.requireNotRemoved((yyvsp[0].lex).loc, EEsProfile, 300, "varying"); - - parseContext.globalCheck((yyvsp[0].lex).loc, "varying"); - - (yyval.interm.type).init((yyvsp[0].lex).loc); - if (parseContext.language == EShLangVertex) - (yyval.interm.type).qualifier.storage = EvqVaryingOut; - else - (yyval.interm.type).qualifier.storage = EvqVaryingIn; + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint64; + (yyval.interm.type).setVector(2); } -#line 4874 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6501 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 151: -#line 1206 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 243: +#line 1756 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "inout"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.storage = EvqInOut; + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint64; + (yyval.interm.type).setVector(3); } -#line 4884 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6512 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 152: -#line 1211 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 244: +#line 1762 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "in"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later - (yyval.interm.type).qualifier.storage = EvqIn; + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint64; + (yyval.interm.type).setVector(4); } -#line 4895 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6523 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 153: -#line 1217 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 245: +#line 1768 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "out"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later - (yyval.interm.type).qualifier.storage = EvqOut; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 2); } -#line 4906 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6533 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 154: -#line 1223 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 246: +#line 1773 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 120, 0, "centroid"); - parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "centroid"); - parseContext.globalCheck((yyvsp[0].lex).loc, "centroid"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.centroid = true; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 3); } -#line 4918 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6543 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 155: -#line 1230 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 247: +#line 1778 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "patch"); - parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.patch = true; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 4); } -#line 4929 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6553 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 156: -#line 1236 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 248: +#line 1783 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "sample"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.sample = true; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 2); } -#line 4939 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6563 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 157: -#line 1241 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 249: +#line 1788 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "uniform"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.storage = EvqUniform; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 3); } -#line 4949 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6573 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 158: -#line 1246 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 250: +#line 1793 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "buffer"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.storage = EvqBuffer; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 4); } -#line 4959 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6583 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 159: -#line 1251 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 251: +#line 1798 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "shared"); - parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); - parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 310, 0, "shared"); - parseContext.requireStage((yyvsp[0].lex).loc, EShLangCompute, "shared"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.storage = EvqShared; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 2); } -#line 4972 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6593 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 160: -#line 1259 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 252: +#line 1803 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.coherent = true; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 3); } -#line 4981 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6603 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 161: -#line 1263 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 253: +#line 1808 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.volatil = true; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 4); } -#line 4990 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6613 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 162: -#line 1267 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 254: +#line 1813 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.restrict = true; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 2); } -#line 4999 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6623 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 163: -#line 1271 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 255: +#line 1818 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.readonly = true; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 3); } -#line 5008 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6633 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 164: -#line 1275 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 256: +#line 1823 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.writeonly = true; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 4); } -#line 5017 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6643 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 165: -#line 1279 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 257: +#line 1828 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.spvRemoved((yyvsp[0].lex).loc, "subroutine"); - parseContext.globalCheck((yyvsp[0].lex).loc, "subroutine"); - parseContext.unimplemented((yyvsp[0].lex).loc, "subroutine"); - (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 2); } -#line 5028 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6654 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 166: -#line 1285 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 258: +#line 1834 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.spvRemoved((yyvsp[-3].lex).loc, "subroutine"); - parseContext.globalCheck((yyvsp[-3].lex).loc, "subroutine"); - parseContext.unimplemented((yyvsp[-3].lex).loc, "subroutine"); - (yyval.interm.type).init((yyvsp[-3].lex).loc); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 3); } -#line 5039 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6665 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 167: -#line 1294 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 259: +#line 1840 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // TODO + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 4); } -#line 5047 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6676 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 168: -#line 1297 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 260: +#line 1846 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // TODO: 4.0 semantics: subroutines - // 1) make sure each identifier is a type declared earlier with SUBROUTINE - // 2) save all of the identifiers for future comparison with the declared function + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 2); } -#line 5057 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6687 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 169: -#line 1305 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 261: +#line 1852 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[0].interm.type); - (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 3); } -#line 5066 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6698 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 170: -#line 1309 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 262: +#line 1858 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.arrayDimCheck((yyvsp[0].interm).loc, (yyvsp[0].interm).arraySizes, 0); - (yyval.interm.type) = (yyvsp[-1].interm.type); - (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); - (yyval.interm.type).arraySizes = (yyvsp[0].interm).arraySizes; + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 4); } -#line 5077 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6709 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 171: -#line 1318 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 263: +#line 1864 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[-1].lex).loc; - (yyval.interm).arraySizes = new TArraySizes; - (yyval.interm).arraySizes->addInnerSize(); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 2); } -#line 5087 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6720 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 172: -#line 1323 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 264: +#line 1870 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[-2].lex).loc; - (yyval.interm).arraySizes = new TArraySizes; - - TArraySize size; - parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size); - (yyval.interm).arraySizes->addInnerSize(size); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 3); } -#line 5100 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6731 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 173: -#line 1331 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 265: +#line 1876 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[-2].interm); - (yyval.interm).arraySizes->addInnerSize(); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 4); } -#line 5109 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6742 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 174: -#line 1335 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 266: +#line 1882 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[-3].interm); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 2); + } +#line 6753 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - TArraySize size; - parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size); - (yyval.interm).arraySizes->addInnerSize(size); + case 267: +#line 1888 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 3); } -#line 5121 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6764 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 175: -#line 1345 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 268: +#line 1894 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtVoid; + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 4); } -#line 5130 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6775 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 176: -#line 1349 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 269: +#line 1900 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(2, 2); } -#line 5139 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6786 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 177: -#line 1353 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 270: +#line 1906 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double"); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(3, 3); } -#line 5149 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6797 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 178: -#line 1358 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 271: +#line 1912 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; -#endif + (yyval.interm.type).setMatrix(4, 4); } -#line 5161 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6808 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 179: -#line 1365 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 272: +#line 1918 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(2, 2); } -#line 5170 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6819 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 180: -#line 1369 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 273: +#line 1924 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer"); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(2, 3); } -#line 5180 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6830 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 181: -#line 1374 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 274: +#line 1930 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(2, 4); } -#line 5190 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6841 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 182: -#line 1379 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 275: +#line 1936 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint64; + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(3, 2); } -#line 5200 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6852 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 183: -#line 1384 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 276: +#line 1942 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit integer", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt16; -#endif + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(3, 3); } -#line 5212 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6863 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 184: -#line 1391 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 277: +#line 1948 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint16; -#endif + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(3, 4); } -#line 5224 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6874 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 185: -#line 1398 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 278: +#line 1954 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(4, 2); } -#line 5233 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6885 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 186: -#line 1402 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 279: +#line 1960 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(2); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(4, 3); } -#line 5243 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6896 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 187: -#line 1407 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 280: +#line 1966 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(3); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(4, 4); } -#line 5253 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6907 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 188: -#line 1412 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 281: +#line 1972 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(4); + (yyval.interm.type).setMatrix(2, 2); } -#line 5263 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6918 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 189: -#line 1417 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 282: +#line 1978 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(2); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 3); } -#line 5274 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6929 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 190: -#line 1423 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 283: +#line 1984 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(3); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 4); } -#line 5285 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6940 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 191: -#line 1429 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 284: +#line 1990 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(4); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 2); } -#line 5296 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6951 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 192: -#line 1435 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 285: +#line 1996 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setVector(2); -#endif + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 3); } -#line 5309 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6962 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 193: -#line 1443 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 286: +#line 2002 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setVector(3); -#endif + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 4); } -#line 5322 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6973 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 194: -#line 1451 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 287: +#line 2008 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setVector(4); -#endif + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 2); } -#line 5335 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6984 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 195: -#line 1459 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 288: +#line 2014 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - (yyval.interm.type).setVector(2); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 3); } -#line 5345 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6995 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 196: -#line 1464 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 289: +#line 2020 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - (yyval.interm.type).setVector(3); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 4); } -#line 5355 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7006 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 197: -#line 1469 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 290: +#line 2026 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - (yyval.interm.type).setVector(4); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 2); } -#line 5365 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7017 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 198: -#line 1474 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 291: +#line 2032 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; - (yyval.interm.type).setVector(2); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 3); } -#line 5375 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7028 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 199: -#line 1479 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 292: +#line 2038 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; - (yyval.interm.type).setVector(3); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 4); } -#line 5385 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7039 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 200: -#line 1484 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 293: +#line 2044 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; - (yyval.interm.type).setVector(4); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 2); } -#line 5395 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7050 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 201: -#line 1489 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 294: +#line 2050 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; - (yyval.interm.type).setVector(2); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 3); } -#line 5406 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7061 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 202: -#line 1495 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 295: +#line 2056 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; - (yyval.interm.type).setVector(3); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 4); } -#line 5417 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7072 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 203: -#line 1501 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 296: +#line 2062 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; - (yyval.interm.type).setVector(4); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 2); } -#line 5428 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7083 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 204: -#line 1507 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 297: +#line 2068 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt16; - (yyval.interm.type).setVector(2); -#endif + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 3); } -#line 5441 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7094 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 205: -#line 1515 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 298: +#line 2074 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt16; - (yyval.interm.type).setVector(3); -#endif + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 4); } -#line 5454 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7105 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 206: -#line 1523 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 299: +#line 2080 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt16; - (yyval.interm.type).setVector(4); -#endif + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 2); } -#line 5467 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7116 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 207: -#line 1531 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 300: +#line 2086 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; - (yyval.interm.type).setVector(2); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 3); } -#line 5478 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7127 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 208: -#line 1537 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 301: +#line 2092 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; - (yyval.interm.type).setVector(3); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 4); } -#line 5489 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7138 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 209: -#line 1543 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 302: +#line 2098 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; - (yyval.interm.type).setVector(4); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 2); } -#line 5500 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7149 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 210: -#line 1549 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 303: +#line 2104 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint64; - (yyval.interm.type).setVector(2); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 3); } -#line 5511 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7160 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 211: -#line 1555 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 304: +#line 2110 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint64; - (yyval.interm.type).setVector(3); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 4); } -#line 5522 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7171 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 212: -#line 1561 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 305: +#line 2116 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.vulkanRemoved((yyvsp[0].lex).loc, "atomic counter types"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint64; - (yyval.interm.type).setVector(4); + (yyval.interm.type).basicType = EbtAtomicUint; } -#line 5533 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7181 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 213: -#line 1567 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 306: +#line 2121 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint16; - (yyval.interm.type).setVector(2); -#endif + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd1D); } -#line 5546 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7191 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 214: -#line 1575 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 307: +#line 2126 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint16; - (yyval.interm.type).setVector(3); -#endif + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D); } -#line 5559 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7201 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 215: -#line 1583 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 308: +#line 2131 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint16; - (yyval.interm.type).setVector(4); -#endif + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd3D); } -#line 5572 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7211 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 216: -#line 1591 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 309: +#line 2136 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 2); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdCube); } -#line 5582 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7221 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 217: -#line 1596 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 310: +#line 2141 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(3, 3); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true); } -#line 5592 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7231 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 218: -#line 1601 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 311: +#line 2146 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(4, 4); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, true); } -#line 5602 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7241 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 219: -#line 1606 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 312: +#line 2151 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 2); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdCube, false, true); } -#line 5612 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7251 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 220: -#line 1611 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 313: +#line 2156 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 3); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true); } -#line 5622 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7261 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 221: -#line 1616 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 314: +#line 2161 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 4); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true); } -#line 5632 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7271 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 222: -#line 1621 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 315: +#line 2166 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(3, 2); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true); } -#line 5642 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7281 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 223: -#line 1626 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 316: +#line 2171 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(3, 3); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true); } -#line 5652 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7291 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 224: -#line 1631 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 317: +#line 2176 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(3, 4); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true); } -#line 5662 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7301 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 225: -#line 1636 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 318: +#line 2181 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(4, 2); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true, true); } -#line 5672 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7311 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 226: -#line 1641 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 319: +#line 2186 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(4, 3); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd1D); +#endif } -#line 5682 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7324 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 227: -#line 1646 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 320: +#line 2194 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(4, 4); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd2D); +#endif } -#line 5692 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7337 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 228: -#line 1651 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 321: +#line 2202 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(2, 2); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd3D); +#endif } -#line 5703 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7350 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 229: -#line 1657 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 322: +#line 2210 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(3, 3); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, EsdCube); +#endif } -#line 5714 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7363 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 230: -#line 1663 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 323: +#line 2218 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(4, 4); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, false, true); +#endif } -#line 5725 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7376 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 231: -#line 1669 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 324: +#line 2226 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(2, 2); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, true); +#endif } -#line 5736 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7389 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 232: -#line 1675 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 325: +#line 2234 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(2, 3); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, false, true); +#endif } -#line 5747 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7402 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 233: -#line 1681 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 326: +#line 2242 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(2, 4); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true); +#endif } -#line 5758 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7415 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 234: -#line 1687 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 327: +#line 2250 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(3, 2); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true); +#endif } -#line 5769 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7428 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 235: -#line 1693 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 328: +#line 2258 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(3, 3); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true, true); +#endif } -#line 5780 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7441 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 236: -#line 1699 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 329: +#line 2266 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(3, 4); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, true); +#endif } -#line 5791 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7454 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 237: -#line 1705 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 330: +#line 2274 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(4, 2); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true); +#endif } -#line 5802 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7467 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 238: -#line 1711 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 331: +#line 2282 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(4, 3); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true, true); +#endif } -#line 5813 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7480 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 239: -#line 1717 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 332: +#line 2290 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(4, 4); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd1D); } -#line 5824 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7490 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 240: -#line 1723 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 333: +#line 2295 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 2); -#endif + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd2D); } -#line 5837 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7500 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 241: -#line 1731 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 334: +#line 2300 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 3); -#endif + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd3D); } -#line 5850 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7510 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 242: -#line 1739 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 335: +#line 2305 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(4, 4); -#endif + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, EsdCube); } -#line 5863 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7520 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 243: -#line 1747 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 336: +#line 2310 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 2); -#endif + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd1D, true); } -#line 5876 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7530 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 244: -#line 1755 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 337: +#line 2315 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 3); -#endif + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd2D, true); } -#line 5889 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7540 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 245: -#line 1763 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 338: +#line 2320 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 4); -#endif + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, EsdCube, true); } -#line 5902 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7550 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 246: -#line 1771 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 339: +#line 2325 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 2); -#endif + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd1D); } -#line 5915 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7560 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 247: -#line 1779 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 340: +#line 2330 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 3); -#endif + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd2D); } -#line 5928 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7570 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 248: -#line 1787 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 341: +#line 2335 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 4); -#endif + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd3D); } -#line 5941 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7580 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 249: -#line 1795 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 342: +#line 2340 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(4, 2); -#endif + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, EsdCube); } -#line 5954 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7590 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 250: -#line 1803 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 343: +#line 2345 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(4, 3); -#endif + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd1D, true); } -#line 5967 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7600 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 251: -#line 1811 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 344: +#line 2350 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(4, 4); -#endif + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd2D, true); } -#line 5980 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7610 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 252: -#line 1819 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 345: +#line 2355 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.vulkanRemoved((yyvsp[0].lex).loc, "atomic counter types"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtAtomicUint; + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, EsdCube, true); } -#line 5990 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7620 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 253: -#line 1824 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 346: +#line 2360 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd1D); + (yyval.interm.type).sampler.set(EbtFloat, EsdRect); } -#line 6000 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7630 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 254: -#line 1829 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 347: +#line 2365 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D); + (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true); } -#line 6010 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7640 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 255: -#line 1834 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 348: +#line 2370 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd3D); + (yyval.interm.type).sampler.set(EbtFloat16, EsdRect); +#endif } -#line 6020 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7653 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 256: -#line 1839 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 349: +#line 2378 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdCube); + (yyval.interm.type).sampler.set(EbtFloat16, EsdRect, false, true); +#endif } -#line 6030 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7666 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 257: -#line 1844 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 350: +#line 2386 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true); + (yyval.interm.type).sampler.set(EbtInt, EsdRect); } -#line 6040 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7676 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 258: -#line 1849 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 351: +#line 2391 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, true); + (yyval.interm.type).sampler.set(EbtUint, EsdRect); } -#line 6050 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7686 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 259: -#line 1854 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 352: +#line 2396 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdCube, false, true); + (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer); } -#line 6060 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7696 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 260: -#line 1859 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 353: +#line 2401 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true); + (yyval.interm.type).sampler.set(EbtFloat16, EsdBuffer); +#endif } -#line 6070 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7709 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 261: -#line 1864 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 354: +#line 2409 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true); + (yyval.interm.type).sampler.set(EbtInt, EsdBuffer); } -#line 6080 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7719 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 262: -#line 1869 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 355: +#line 2414 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true); + (yyval.interm.type).sampler.set(EbtUint, EsdBuffer); } -#line 6090 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7729 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 263: -#line 1874 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 356: +#line 2419 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true); + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true); } -#line 6100 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7739 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 264: -#line 1879 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 357: +#line 2424 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true); + (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, false, true); +#endif } -#line 6110 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7752 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 265: -#line 1884 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 358: +#line 2432 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true, true); + (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true); } -#line 6120 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7762 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 266: -#line 1889 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 359: +#line 2437 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd1D); + (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true); } -#line 6130 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7772 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 267: -#line 1894 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 360: +#line 2442 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd2D); + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true); } -#line 6140 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7782 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 268: -#line 1899 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 361: +#line 2447 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd3D); + (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, false, true); +#endif } -#line 6150 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7795 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 269: -#line 1904 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 362: +#line 2455 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, EsdCube); + (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true); } -#line 6160 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7805 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 270: -#line 1909 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 363: +#line 2460 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd1D, true); + (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true); } -#line 6170 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7815 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 271: -#line 1914 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 364: +#line 2465 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd2D, true); + (yyval.interm.type).sampler.setPureSampler(false); } -#line 6180 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7825 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 272: -#line 1919 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 365: +#line 2470 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, EsdCube, true); + (yyval.interm.type).sampler.setPureSampler(true); } -#line 6190 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7835 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 273: -#line 1924 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 366: +#line 2475 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd1D); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D); } -#line 6200 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7845 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 274: -#line 1929 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 367: +#line 2480 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd2D); + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D); +#endif } -#line 6210 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7858 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 275: -#line 1934 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 368: +#line 2488 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd3D); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D); } -#line 6220 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7868 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 276: -#line 1939 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 369: +#line 2493 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, EsdCube); + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D); +#endif } -#line 6230 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7881 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 277: -#line 1944 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 370: +#line 2501 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd1D, true); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D); } -#line 6240 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7891 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 278: -#line 1949 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 371: +#line 2506 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd2D, true); + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd3D); +#endif } -#line 6250 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7904 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 279: -#line 1954 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 372: +#line 2514 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, EsdCube, true); + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube); } -#line 6260 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7914 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 280: -#line 1959 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 373: +#line 2519 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdRect); + (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube); +#endif } -#line 6270 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7927 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 281: -#line 1964 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 374: +#line 2527 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true); } -#line 6280 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7937 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 282: -#line 1969 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 375: +#line 2532 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, EsdRect); + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D, true); +#endif } -#line 6290 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7950 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 283: -#line 1974 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 376: +#line 2540 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, EsdRect); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true); } -#line 6300 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7960 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 284: -#line 1979 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 377: +#line 2545 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer); + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true); +#endif } -#line 6310 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7973 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 285: -#line 1984 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 378: +#line 2553 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, EsdBuffer); + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true); } -#line 6320 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7983 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 286: -#line 1989 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 379: +#line 2558 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, EsdBuffer); + (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube, true); +#endif } -#line 6330 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7996 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 287: -#line 1994 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 380: +#line 2566 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D); } -#line 6340 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8006 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 288: -#line 1999 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 381: +#line 2571 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D); } -#line 6350 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8016 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 289: -#line 2004 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 382: +#line 2576 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D); } -#line 6360 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8026 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 290: -#line 2009 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 383: +#line 2581 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true); + (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube); } -#line 6370 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8036 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 291: -#line 2014 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 384: +#line 2586 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true); } -#line 6380 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8046 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 292: -#line 2019 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 385: +#line 2591 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true); } -#line 6390 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8056 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 293: -#line 2024 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 386: +#line 2596 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setPureSampler(false); + (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true); } -#line 6400 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8066 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 294: -#line 2029 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 387: +#line 2601 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setPureSampler(true); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D); } -#line 6410 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8076 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 295: -#line 2034 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 388: +#line 2606 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D); } -#line 6420 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8086 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 296: -#line 2039 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 389: +#line 2611 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D); } -#line 6430 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8096 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 297: -#line 2044 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 390: +#line 2616 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D); + (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube); } -#line 6440 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8106 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 298: -#line 2049 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 391: +#line 2621 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true); } -#line 6450 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8116 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 299: -#line 2054 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 392: +#line 2626 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true); } -#line 6460 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8126 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 300: -#line 2059 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 393: +#line 2631 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true); + (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true); } -#line 6470 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8136 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 301: -#line 2064 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 394: +#line 2636 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true); + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdRect); } -#line 6480 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8146 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 302: -#line 2069 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 395: +#line 2641 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D); + (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdRect); +#endif } -#line 6490 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8159 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 303: -#line 2074 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 396: +#line 2649 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D); + (yyval.interm.type).sampler.setTexture(EbtInt, EsdRect); } -#line 6500 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8169 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 304: -#line 2079 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 397: +#line 2654 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D); + (yyval.interm.type).sampler.setTexture(EbtUint, EsdRect); } -#line 6510 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8179 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 305: -#line 2084 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 398: +#line 2659 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube); + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdBuffer); } -#line 6520 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8189 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 306: -#line 2089 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 399: +#line 2664 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true); + (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdBuffer); +#endif } -#line 6530 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8202 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 307: -#line 2094 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 400: +#line 2672 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true); + (yyval.interm.type).sampler.setTexture(EbtInt, EsdBuffer); } -#line 6540 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8212 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 308: -#line 2099 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 401: +#line 2677 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true); + (yyval.interm.type).sampler.setTexture(EbtUint, EsdBuffer); } -#line 6550 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8222 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 309: -#line 2104 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 402: +#line 2682 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, false, false, true); } -#line 6560 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8232 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 310: -#line 2109 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 403: +#line 2687 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D); + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, false, false, true); +#endif } -#line 6570 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8245 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 311: -#line 2114 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 404: +#line 2695 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, false, false, true); } -#line 6580 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8255 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 312: -#line 2119 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 405: +#line 2700 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, false, false, true); } -#line 6590 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8265 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 313: -#line 2124 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 406: +#line 2705 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true, false, true); } -#line 6600 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8275 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 314: -#line 2129 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 407: +#line 2710 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true); + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true, false, true); +#endif } -#line 6610 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8288 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 315: -#line 2134 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 408: +#line 2718 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true, false, true); } -#line 6620 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8298 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 316: -#line 2139 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 409: +#line 2723 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, EsdRect); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true, false, true); } -#line 6630 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8308 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 317: -#line 2144 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 410: +#line 2728 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, EsdRect); + (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D); } -#line 6640 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8318 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 318: -#line 2149 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 411: +#line 2733 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, EsdRect); + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D); +#endif } -#line 6650 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8331 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 319: -#line 2154 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 412: +#line 2741 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, EsdBuffer); + (yyval.interm.type).sampler.setImage(EbtInt, Esd1D); } -#line 6660 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8341 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 320: -#line 2159 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 413: +#line 2746 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, EsdBuffer); + (yyval.interm.type).sampler.setImage(EbtUint, Esd1D); } -#line 6670 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8351 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 321: -#line 2164 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 414: +#line 2751 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, EsdBuffer); + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D); } -#line 6680 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8361 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 322: -#line 2169 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 415: +#line 2756 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, false, false, true); + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D); +#endif } -#line 6690 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8374 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 323: -#line 2174 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 416: +#line 2764 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, false, false, true); + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D); } -#line 6700 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8384 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 324: -#line 2179 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 417: +#line 2769 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, false, false, true); + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D); } -#line 6710 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8394 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 325: -#line 2184 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 418: +#line 2774 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true, false, true); + (yyval.interm.type).sampler.setImage(EbtFloat, Esd3D); } -#line 6720 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8404 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 326: -#line 2189 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 419: +#line 2779 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true, false, true); + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd3D); +#endif } -#line 6730 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8417 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 327: -#line 2194 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 420: +#line 2787 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true, false, true); + (yyval.interm.type).sampler.setImage(EbtInt, Esd3D); } -#line 6740 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8427 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 328: -#line 2199 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 421: +#line 2792 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D); + (yyval.interm.type).sampler.setImage(EbtUint, Esd3D); } -#line 6750 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8437 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 329: -#line 2204 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 422: +#line 2797 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd1D); + (yyval.interm.type).sampler.setImage(EbtFloat, EsdRect); } -#line 6760 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8447 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 330: -#line 2209 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 423: +#line 2802 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd1D); + (yyval.interm.type).sampler.setImage(EbtFloat16, EsdRect); +#endif } -#line 6770 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8460 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 331: -#line 2214 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 424: +#line 2810 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D); + (yyval.interm.type).sampler.setImage(EbtInt, EsdRect); } -#line 6780 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8470 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 332: -#line 2219 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 425: +#line 2815 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd2D); + (yyval.interm.type).sampler.setImage(EbtUint, EsdRect); } -#line 6790 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8480 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 333: -#line 2224 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 426: +#line 2820 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd2D); + (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube); } -#line 6800 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8490 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 334: -#line 2229 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 427: +#line 2825 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd3D); + (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube); +#endif } -#line 6810 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8503 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 335: -#line 2234 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 428: +#line 2833 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd3D); + (yyval.interm.type).sampler.setImage(EbtInt, EsdCube); } -#line 6820 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8513 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 336: -#line 2239 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 429: +#line 2838 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd3D); + (yyval.interm.type).sampler.setImage(EbtUint, EsdCube); } -#line 6830 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8523 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 337: -#line 2244 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 430: +#line 2843 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, EsdRect); + (yyval.interm.type).sampler.setImage(EbtFloat, EsdBuffer); } -#line 6840 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8533 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 338: -#line 2249 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 431: +#line 2848 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, EsdRect); + (yyval.interm.type).sampler.setImage(EbtFloat16, EsdBuffer); +#endif } -#line 6850 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8546 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 339: -#line 2254 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 432: +#line 2856 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, EsdRect); + (yyval.interm.type).sampler.setImage(EbtInt, EsdBuffer); } -#line 6860 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8556 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 340: -#line 2259 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 433: +#line 2861 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube); + (yyval.interm.type).sampler.setImage(EbtUint, EsdBuffer); } -#line 6870 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8566 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 341: -#line 2264 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 434: +#line 2866 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, EsdCube); + (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D, true); } -#line 6880 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8576 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 342: -#line 2269 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 435: +#line 2871 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, EsdCube); + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D, true); +#endif } -#line 6890 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8589 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 343: -#line 2274 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 436: +#line 2879 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, EsdBuffer); + (yyval.interm.type).sampler.setImage(EbtInt, Esd1D, true); } -#line 6900 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8599 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 344: -#line 2279 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 437: +#line 2884 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, EsdBuffer); + (yyval.interm.type).sampler.setImage(EbtUint, Esd1D, true); } -#line 6910 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8609 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 345: -#line 2284 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 438: +#line 2889 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, EsdBuffer); + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true); } -#line 6920 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8619 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 346: -#line 2289 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 439: +#line 2894 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D, true); + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true); +#endif } -#line 6930 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8632 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 347: -#line 2294 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 440: +#line 2902 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd1D, true); + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true); } -#line 6940 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8642 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 348: -#line 2299 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 441: +#line 2907 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd1D, true); + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true); } -#line 6950 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8652 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 349: -#line 2304 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 442: +#line 2912 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true); + (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube, true); } -#line 6960 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8662 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 350: -#line 2309 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 443: +#line 2917 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true); + (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube, true); +#endif } -#line 6970 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8675 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 351: -#line 2314 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 444: +#line 2925 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true); + (yyval.interm.type).sampler.setImage(EbtInt, EsdCube, true); } -#line 6980 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8685 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 352: -#line 2319 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 445: +#line 2930 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube, true); + (yyval.interm.type).sampler.setImage(EbtUint, EsdCube, true); } -#line 6990 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8695 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 353: -#line 2324 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 446: +#line 2935 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, EsdCube, true); + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, false, false, true); } -#line 7000 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8705 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 354: -#line 2329 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 447: +#line 2940 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, EsdCube, true); + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, false, false, true); +#endif } -#line 7010 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8718 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 355: -#line 2334 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 448: +#line 2948 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, false, false, true); + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, false, false, true); } -#line 7020 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8728 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 356: -#line 2339 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 449: +#line 2953 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, false, false, true); + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, false, false, true); } -#line 7030 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8738 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 357: -#line 2344 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 450: +#line 2958 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, false, false, true); + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true, false, true); } -#line 7040 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8748 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 358: -#line 2349 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 451: +#line 2963 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true, false, true); + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true, false, true); +#endif } -#line 7050 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8761 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 359: -#line 2354 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 452: +#line 2971 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true, false, true); } -#line 7060 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8771 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 360: -#line 2359 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 453: +#line 2976 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true, false, true); } -#line 7070 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8781 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 361: -#line 2364 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 454: +#line 2981 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // GL_OES_EGL_image_external (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.external = true; } -#line 7081 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8792 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 362: -#line 2370 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 455: +#line 2987 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat); } -#line 7092 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8803 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 363: -#line 2376 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 456: +#line 2993 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat, true); } -#line 7103 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8814 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 364: -#line 2382 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 457: +#line 2999 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setSubpass(EbtFloat16); +#endif + } +#line 8828 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 458: +#line 3008 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setSubpass(EbtFloat16, true); +#endif + } +#line 8842 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 459: +#line 3017 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt); } -#line 7114 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8853 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 365: -#line 2388 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 460: +#line 3023 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt, true); } -#line 7125 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8864 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 366: -#line 2394 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 461: +#line 3029 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint); } -#line 7136 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8875 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 367: -#line 2400 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 462: +#line 3035 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint, true); } -#line 7147 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8886 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 368: -#line 2406 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 463: +#line 3041 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); (yyval.interm.type).qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; parseContext.structTypeCheck((yyval.interm.type).loc, (yyval.interm.type)); } -#line 7157 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8896 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 369: -#line 2411 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 464: +#line 3046 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // // This is for user defined type names. The lexical phase looked up the @@ -7171,47 +8910,47 @@ } else parseContext.error((yyvsp[0].lex).loc, "expected type name", (yyvsp[0].lex).string->c_str(), ""); } -#line 7175 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8914 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 370: -#line 2427 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 465: +#line 3062 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "highp precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqHigh); } -#line 7185 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8924 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 371: -#line 2432 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 466: +#line 3067 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "mediump precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqMedium); } -#line 7195 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8934 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 372: -#line 2437 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 467: +#line 3072 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "lowp precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqLow); } -#line 7205 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8944 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 373: -#line 2445 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 468: +#line 3080 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.nestedStructCheck((yyvsp[-2].lex).loc); } -#line 7211 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8950 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 374: -#line 2445 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 469: +#line 3080 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { TType* structure = new TType((yyvsp[-1].interm.typeList), *(yyvsp[-4].lex).string); parseContext.structArrayCheck((yyvsp[-4].lex).loc, *structure); @@ -7223,17 +8962,17 @@ (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 7227 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8966 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 375: -#line 2456 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 470: +#line 3091 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.nestedStructCheck((yyvsp[-1].lex).loc); } -#line 7233 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8972 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 376: -#line 2456 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 471: +#line 3091 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { TType* structure = new TType((yyvsp[-1].interm.typeList), TString("")); (yyval.interm.type).init((yyvsp[-4].lex).loc); @@ -7241,19 +8980,19 @@ (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 7245 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8984 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 377: -#line 2466 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 472: +#line 3101 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList) = (yyvsp[0].interm.typeList); } -#line 7253 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8992 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 378: -#line 2469 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 473: +#line 3104 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); for (unsigned int i = 0; i < (yyvsp[0].interm.typeList)->size(); ++i) { @@ -7264,11 +9003,11 @@ (yyval.interm.typeList)->push_back((*(yyvsp[0].interm.typeList))[i]); } } -#line 7268 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9007 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 379: -#line 2482 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 474: +#line 3117 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -7283,17 +9022,20 @@ parseContext.precisionQualifierCheck((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).basicType, (yyvsp[-2].interm.type).qualifier); for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { - parseContext.arrayDimCheck((yyvsp[-2].interm.type).loc, (*(yyval.interm.typeList))[i].type, (yyvsp[-2].interm.type).arraySizes); - (*(yyval.interm.typeList))[i].type->mergeType((yyvsp[-2].interm.type)); + TType type((yyvsp[-2].interm.type)); + type.setFieldName((*(yyval.interm.typeList))[i].type->getFieldName()); + type.transferArraySizes((*(yyval.interm.typeList))[i].type->getArraySizes()); + type.copyArrayInnerSizes((yyvsp[-2].interm.type).arraySizes); + parseContext.arrayOfArrayVersionCheck((*(yyval.interm.typeList))[i].loc, type.getArraySizes()); + (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 7291 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9034 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 380: -#line 2500 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 475: +#line 3139 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalQualifierFixCheck((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier); if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); @@ -7303,269 +9045,273 @@ (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); - parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers); + parseContext.memberQualifierCheck((yyvsp[-3].interm.type)); parseContext.voidErrorCheck((yyvsp[-2].interm.type).loc, (*(yyvsp[-1].interm.typeList))[0].type->getFieldName(), (yyvsp[-2].interm.type).basicType); parseContext.mergeQualifiers((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, (yyvsp[-3].interm.type).qualifier, true); parseContext.precisionQualifierCheck((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).basicType, (yyvsp[-2].interm.type).qualifier); for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { - parseContext.arrayDimCheck((yyvsp[-3].interm.type).loc, (*(yyval.interm.typeList))[i].type, (yyvsp[-2].interm.type).arraySizes); - (*(yyval.interm.typeList))[i].type->mergeType((yyvsp[-2].interm.type)); + TType type((yyvsp[-2].interm.type)); + type.setFieldName((*(yyval.interm.typeList))[i].type->getFieldName()); + type.transferArraySizes((*(yyval.interm.typeList))[i].type->getArraySizes()); + type.copyArrayInnerSizes((yyvsp[-2].interm.type).arraySizes); + parseContext.arrayOfArrayVersionCheck((*(yyval.interm.typeList))[i].loc, type.getArraySizes()); + (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 7317 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9063 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 381: -#line 2524 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 476: +#line 3166 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList) = new TTypeList; (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 7326 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9072 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 382: -#line 2528 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 477: +#line 3170 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 7334 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9080 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 383: -#line 2534 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 478: +#line 3176 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeLine).type = new TType(EbtVoid); (yyval.interm.typeLine).loc = (yyvsp[0].lex).loc; (yyval.interm.typeLine).type->setFieldName(*(yyvsp[0].lex).string); } -#line 7344 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9090 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 384: -#line 2539 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 479: +#line 3181 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.arrayDimCheck((yyvsp[-1].lex).loc, (yyvsp[0].interm).arraySizes, 0); + parseContext.arrayOfArrayVersionCheck((yyvsp[-1].lex).loc, (yyvsp[0].interm).arraySizes); (yyval.interm.typeLine).type = new TType(EbtVoid); (yyval.interm.typeLine).loc = (yyvsp[-1].lex).loc; (yyval.interm.typeLine).type->setFieldName(*(yyvsp[-1].lex).string); - (yyval.interm.typeLine).type->newArraySizes(*(yyvsp[0].interm).arraySizes); + (yyval.interm.typeLine).type->transferArraySizes((yyvsp[0].interm).arraySizes); } -#line 7357 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9103 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 385: -#line 2550 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 480: +#line 3192 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 7365 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9111 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 386: -#line 2553 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 481: +#line 3195 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-2].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-2].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); } -#line 7376 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9122 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 387: -#line 2559 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 482: +#line 3201 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-3].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-3].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 7387 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9133 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 388: -#line 2568 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 483: +#line 3210 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc()); } -#line 7395 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9141 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 389: -#line 2571 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 484: +#line 3213 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); } -#line 7403 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9149 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 390: -#line 2577 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 485: +#line 3219 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7409 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9155 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 391: -#line 2581 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 486: +#line 3223 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7415 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9161 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 392: -#line 2582 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 487: +#line 3224 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7421 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9167 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 393: -#line 2588 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 488: +#line 3230 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7427 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9173 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 394: -#line 2589 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 489: +#line 3231 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7433 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9179 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 395: -#line 2590 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 490: +#line 3232 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7439 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9185 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 396: -#line 2591 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 491: +#line 3233 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7445 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9191 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 397: -#line 2592 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 492: +#line 3234 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7451 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9197 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 398: -#line 2593 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 493: +#line 3235 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7457 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9203 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 399: -#line 2594 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 494: +#line 3236 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7463 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9209 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 400: -#line 2598 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 495: +#line 3240 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 7469 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9215 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 401: -#line 2599 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 496: +#line 3241 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; } -#line 7478 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9224 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 402: -#line 2603 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 497: +#line 3245 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; } -#line 7487 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9233 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 403: -#line 2607 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 498: +#line 3249 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-2].interm.intermNode) && (yyvsp[-2].interm.intermNode)->getAsAggregate()) (yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-2].interm.intermNode); } -#line 7497 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9243 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 404: -#line 2615 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 499: +#line 3257 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7503 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9249 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 405: -#line 2616 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 500: +#line 3258 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7509 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9255 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 406: -#line 2620 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 501: +#line 3262 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { ++parseContext.controlFlowNestingLevel; } -#line 7517 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9263 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 407: -#line 2623 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 502: +#line 3265 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7526 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9272 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 408: -#line 2627 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 503: +#line 3269 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 7536 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9282 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 409: -#line 2632 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 504: +#line 3274 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7547 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9293 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 410: -#line 2641 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 505: +#line 3283 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 7555 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9301 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 411: -#line 2644 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 506: +#line 3286 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-1].interm.intermNode) && (yyvsp[-1].interm.intermNode)->getAsAggregate()) (yyvsp[-1].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-1].interm.intermNode); } -#line 7565 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9311 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 412: -#line 2652 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 507: +#line 3294 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || @@ -7574,11 +9320,11 @@ (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case } } -#line 7578 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9324 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 413: -#line 2660 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 508: +#line 3302 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || (yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { @@ -7587,59 +9333,76 @@ } else (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 7591 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9337 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 414: -#line 2671 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 509: +#line 3313 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 7597 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9343 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 415: -#line 2672 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 510: +#line 3314 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = static_cast((yyvsp[-1].interm.intermTypedNode)); } -#line 7603 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9349 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 416: -#line 2676 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 511: +#line 3318 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 9357 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 512: +#line 3321 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.handleSelectionAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 9366 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 513: +#line 3327 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-2].interm.intermTypedNode)); (yyval.interm.intermNode) = parseContext.intermediate.addSelection((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.nodePair), (yyvsp[-4].lex).loc); } -#line 7612 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9375 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 417: -#line 2683 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 514: +#line 3334 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermNode); } -#line 7621 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9384 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 418: -#line 2687 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 515: +#line 3338 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[0].interm.intermNode); (yyval.interm.nodePair).node2 = 0; } -#line 7630 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9393 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 419: -#line 2695 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 516: +#line 3346 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); parseContext.boolCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)); } -#line 7639 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9402 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 420: -#line 2699 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 517: +#line 3350 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.boolCheck((yyvsp[-2].lex).loc, (yyvsp[-3].interm.type)); @@ -7650,11 +9413,28 @@ else (yyval.interm.intermTypedNode) = 0; } -#line 7654 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9417 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 421: -#line 2712 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 518: +#line 3363 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 9425 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 519: +#line 3366 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.handleSwitchAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 9434 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 520: +#line 3372 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // start new switch sequence on the switch stack ++parseContext.controlFlowNestingLevel; @@ -7663,11 +9443,11 @@ parseContext.switchLevel.push_back(parseContext.statementNestingLevel); parseContext.symbolTable.push(); } -#line 7667 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9447 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 422: -#line 2720 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 521: +#line 3380 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = parseContext.addSwitch((yyvsp[-7].lex).loc, (yyvsp[-5].interm.intermTypedNode), (yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : 0); delete parseContext.switchSequenceStack.back(); @@ -7677,27 +9457,27 @@ --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 7681 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9461 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 423: -#line 2732 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 522: +#line 3392 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 7689 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9469 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 424: -#line 2735 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 523: +#line 3395 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7697 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9477 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 425: -#line 2741 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 524: +#line 3401 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -7710,11 +9490,11 @@ (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpCase, (yyvsp[-1].interm.intermTypedNode), (yyvsp[-2].lex).loc); } } -#line 7714 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9494 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 426: -#line 2753 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 525: +#line 3413 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -7724,11 +9504,28 @@ else (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDefault, (yyvsp[-1].lex).loc); } -#line 7728 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9508 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 427: -#line 2765 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 526: +#line 3425 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 9516 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 527: +#line 3428 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.handleLoopAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 9525 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 528: +#line 3434 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-1].lex).loc, "while loops not available", "limitation", ""); @@ -7737,11 +9534,11 @@ ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 7741 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9538 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 428: -#line 2773 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 529: +#line 3442 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), 0, true, (yyvsp[-5].lex).loc); @@ -7749,21 +9546,21 @@ --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 7753 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9550 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 429: -#line 2780 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 530: +#line 3449 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 7763 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9560 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 430: -#line 2785 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 531: +#line 3454 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-7].lex).loc, "do-while loops not available", "limitation", ""); @@ -7775,22 +9572,22 @@ --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 7779 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9576 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 431: -#line 2796 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 532: +#line 3465 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 7790 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9587 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 432: -#line 2802 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 533: +#line 3471 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[-3].interm.intermNode), (yyvsp[-5].lex).loc); @@ -7803,81 +9600,81 @@ --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 7807 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9604 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 433: -#line 2817 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 534: +#line 3486 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7815 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9612 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 434: -#line 2820 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 535: +#line 3489 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7823 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9620 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 435: -#line 2826 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 536: +#line 3495 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 7831 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9628 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 436: -#line 2829 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 537: +#line 3498 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = 0; } -#line 7839 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9636 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 437: -#line 2835 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 538: +#line 3504 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermTypedNode); (yyval.interm.nodePair).node2 = 0; } -#line 7848 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9645 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 438: -#line 2839 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 539: +#line 3508 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermTypedNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermTypedNode); } -#line 7857 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9654 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 439: -#line 2846 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 540: +#line 3515 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (parseContext.loopNestingLevel <= 0) parseContext.error((yyvsp[-1].lex).loc, "continue statement only allowed in loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpContinue, (yyvsp[-1].lex).loc); } -#line 7867 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9664 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 440: -#line 2851 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 541: +#line 3520 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0) parseContext.error((yyvsp[-1].lex).loc, "break statement only allowed in switch and loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpBreak, (yyvsp[-1].lex).loc); } -#line 7877 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9674 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 441: -#line 2856 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 542: +#line 3525 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-1].lex).loc); if (parseContext.currentFunctionType->getBasicType() != EbtVoid) @@ -7885,83 +9682,83 @@ if (parseContext.inMain) parseContext.postEntryPointReturn = true; } -#line 7889 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9686 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 442: -#line 2863 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 543: +#line 3532 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = parseContext.handleReturnValue((yyvsp[-2].lex).loc, (yyvsp[-1].interm.intermTypedNode)); } -#line 7897 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9694 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 443: -#line 2866 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 544: +#line 3535 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "discard"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[-1].lex).loc); } -#line 7906 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9703 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 444: -#line 2875 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 545: +#line 3544 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } -#line 7915 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9712 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 445: -#line 2879 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 546: +#line 3548 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[0].interm.intermNode) != nullptr) { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } } -#line 7926 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9723 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 446: -#line 2888 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 547: +#line 3557 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7934 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9731 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 447: -#line 2891 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 548: +#line 3560 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7942 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9739 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 448: -#line 2894 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 549: +#line 3563 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "extraneous semicolon"); parseContext.profileRequires((yyvsp[0].lex).loc, ~EEsProfile, 460, nullptr, "extraneous semicolon"); (yyval.interm.intermNode) = nullptr; } -#line 7952 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9749 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 449: -#line 2902 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 550: +#line 3571 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyvsp[0].interm).function = parseContext.handleFunctionDeclarator((yyvsp[0].interm).loc, *(yyvsp[0].interm).function, false /* not prototype */); (yyvsp[0].interm).intermNode = parseContext.handleFunctionDefinition((yyvsp[0].interm).loc, *(yyvsp[0].interm).function); } -#line 7961 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9758 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 450: -#line 2906 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 551: +#line 3575 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // May be best done as post process phase on intermediate code if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) @@ -7975,13 +9772,54 @@ // information. This information can be queried from the parse tree (yyval.interm.intermNode)->getAsAggregate()->setOptimize(parseContext.contextPragma.optimize); (yyval.interm.intermNode)->getAsAggregate()->setDebug(parseContext.contextPragma.debug); - (yyval.interm.intermNode)->getAsAggregate()->addToPragmaTable(parseContext.contextPragma.pragmaTable); + (yyval.interm.intermNode)->getAsAggregate()->setPragmaTable(parseContext.contextPragma.pragmaTable); + } +#line 9778 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 552: +#line 3593 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.attributes) = (yyvsp[-2].interm.attributes); + parseContext.requireExtensions((yyvsp[-4].lex).loc, 1, &E_GL_EXT_control_flow_attributes, "attribute"); + } +#line 9787 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 553: +#line 3599 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.attributes) = (yyvsp[0].interm.attributes); + } +#line 9795 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 554: +#line 3602 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.attributes) = parseContext.mergeAttributes((yyvsp[-2].interm.attributes), (yyvsp[0].interm.attributes)); + } +#line 9803 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 555: +#line 3607 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[0].lex).string); + } +#line 9811 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 556: +#line 3610 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[-3].lex).string, (yyvsp[-1].interm.intermTypedNode)); } -#line 7981 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9819 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; -#line 7985 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9823 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -8209,5 +10047,5 @@ #endif return yyresult; } -#line 2923 "MachineIndependent/glslang.y" /* yacc.c:1906 */ +#line 3614 "MachineIndependent/glslang.y" /* yacc.c:1906 */ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/glslang_tab.cpp.h vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/glslang_tab.cpp.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/glslang_tab.cpp.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/glslang_tab.cpp.h 2018-04-27 11:46:26.000000000 +0000 @@ -47,299 +47,392 @@ { ATTRIBUTE = 258, VARYING = 259, - CONST = 260, - BOOL = 261, - FLOAT = 262, + FLOAT16_T = 260, + FLOAT = 261, + FLOAT32_T = 262, DOUBLE = 263, - INT = 264, - UINT = 265, - INT64_T = 266, - UINT64_T = 267, - INT16_T = 268, - UINT16_T = 269, - FLOAT16_T = 270, - BREAK = 271, - CONTINUE = 272, - DO = 273, - ELSE = 274, - FOR = 275, - IF = 276, - DISCARD = 277, - RETURN = 278, - SWITCH = 279, - CASE = 280, - DEFAULT = 281, - SUBROUTINE = 282, - BVEC2 = 283, - BVEC3 = 284, - BVEC4 = 285, - IVEC2 = 286, - IVEC3 = 287, - IVEC4 = 288, - I64VEC2 = 289, - I64VEC3 = 290, - I64VEC4 = 291, - UVEC2 = 292, - UVEC3 = 293, - UVEC4 = 294, - U64VEC2 = 295, - U64VEC3 = 296, - U64VEC4 = 297, - VEC2 = 298, - VEC3 = 299, - VEC4 = 300, - MAT2 = 301, - MAT3 = 302, - MAT4 = 303, - CENTROID = 304, - IN = 305, - OUT = 306, - INOUT = 307, - UNIFORM = 308, - PATCH = 309, - SAMPLE = 310, - BUFFER = 311, - SHARED = 312, - COHERENT = 313, - VOLATILE = 314, - RESTRICT = 315, - READONLY = 316, - WRITEONLY = 317, - DVEC2 = 318, - DVEC3 = 319, - DVEC4 = 320, - DMAT2 = 321, - DMAT3 = 322, - DMAT4 = 323, - F16VEC2 = 324, - F16VEC3 = 325, - F16VEC4 = 326, - F16MAT2 = 327, - F16MAT3 = 328, - F16MAT4 = 329, - I16VEC2 = 330, - I16VEC3 = 331, - I16VEC4 = 332, - U16VEC2 = 333, - U16VEC3 = 334, - U16VEC4 = 335, - NOPERSPECTIVE = 336, - FLAT = 337, - SMOOTH = 338, - LAYOUT = 339, - __EXPLICITINTERPAMD = 340, - MAT2X2 = 341, - MAT2X3 = 342, - MAT2X4 = 343, - MAT3X2 = 344, - MAT3X3 = 345, - MAT3X4 = 346, - MAT4X2 = 347, - MAT4X3 = 348, - MAT4X4 = 349, - DMAT2X2 = 350, - DMAT2X3 = 351, - DMAT2X4 = 352, - DMAT3X2 = 353, - DMAT3X3 = 354, - DMAT3X4 = 355, - DMAT4X2 = 356, - DMAT4X3 = 357, - DMAT4X4 = 358, - F16MAT2X2 = 359, - F16MAT2X3 = 360, - F16MAT2X4 = 361, - F16MAT3X2 = 362, - F16MAT3X3 = 363, - F16MAT3X4 = 364, - F16MAT4X2 = 365, - F16MAT4X3 = 366, - F16MAT4X4 = 367, - ATOMIC_UINT = 368, - SAMPLER1D = 369, - SAMPLER2D = 370, - SAMPLER3D = 371, - SAMPLERCUBE = 372, - SAMPLER1DSHADOW = 373, - SAMPLER2DSHADOW = 374, - SAMPLERCUBESHADOW = 375, - SAMPLER1DARRAY = 376, - SAMPLER2DARRAY = 377, - SAMPLER1DARRAYSHADOW = 378, - SAMPLER2DARRAYSHADOW = 379, - ISAMPLER1D = 380, - ISAMPLER2D = 381, - ISAMPLER3D = 382, - ISAMPLERCUBE = 383, - ISAMPLER1DARRAY = 384, - ISAMPLER2DARRAY = 385, - USAMPLER1D = 386, - USAMPLER2D = 387, - USAMPLER3D = 388, - USAMPLERCUBE = 389, - USAMPLER1DARRAY = 390, - USAMPLER2DARRAY = 391, - SAMPLER2DRECT = 392, - SAMPLER2DRECTSHADOW = 393, - ISAMPLER2DRECT = 394, - USAMPLER2DRECT = 395, - SAMPLERBUFFER = 396, - ISAMPLERBUFFER = 397, - USAMPLERBUFFER = 398, - SAMPLERCUBEARRAY = 399, - SAMPLERCUBEARRAYSHADOW = 400, - ISAMPLERCUBEARRAY = 401, - USAMPLERCUBEARRAY = 402, - SAMPLER2DMS = 403, - ISAMPLER2DMS = 404, - USAMPLER2DMS = 405, - SAMPLER2DMSARRAY = 406, - ISAMPLER2DMSARRAY = 407, - USAMPLER2DMSARRAY = 408, - SAMPLEREXTERNALOES = 409, - SAMPLER = 410, - SAMPLERSHADOW = 411, - TEXTURE1D = 412, - TEXTURE2D = 413, - TEXTURE3D = 414, - TEXTURECUBE = 415, - TEXTURE1DARRAY = 416, - TEXTURE2DARRAY = 417, - ITEXTURE1D = 418, - ITEXTURE2D = 419, - ITEXTURE3D = 420, - ITEXTURECUBE = 421, - ITEXTURE1DARRAY = 422, - ITEXTURE2DARRAY = 423, - UTEXTURE1D = 424, - UTEXTURE2D = 425, - UTEXTURE3D = 426, - UTEXTURECUBE = 427, - UTEXTURE1DARRAY = 428, - UTEXTURE2DARRAY = 429, - TEXTURE2DRECT = 430, - ITEXTURE2DRECT = 431, - UTEXTURE2DRECT = 432, - TEXTUREBUFFER = 433, - ITEXTUREBUFFER = 434, - UTEXTUREBUFFER = 435, - TEXTURECUBEARRAY = 436, - ITEXTURECUBEARRAY = 437, - UTEXTURECUBEARRAY = 438, - TEXTURE2DMS = 439, - ITEXTURE2DMS = 440, - UTEXTURE2DMS = 441, - TEXTURE2DMSARRAY = 442, - ITEXTURE2DMSARRAY = 443, - UTEXTURE2DMSARRAY = 444, - SUBPASSINPUT = 445, - SUBPASSINPUTMS = 446, - ISUBPASSINPUT = 447, - ISUBPASSINPUTMS = 448, - USUBPASSINPUT = 449, - USUBPASSINPUTMS = 450, - IMAGE1D = 451, - IIMAGE1D = 452, - UIMAGE1D = 453, - IMAGE2D = 454, - IIMAGE2D = 455, - UIMAGE2D = 456, - IMAGE3D = 457, - IIMAGE3D = 458, - UIMAGE3D = 459, - IMAGE2DRECT = 460, - IIMAGE2DRECT = 461, - UIMAGE2DRECT = 462, - IMAGECUBE = 463, - IIMAGECUBE = 464, - UIMAGECUBE = 465, - IMAGEBUFFER = 466, - IIMAGEBUFFER = 467, - UIMAGEBUFFER = 468, - IMAGE1DARRAY = 469, - IIMAGE1DARRAY = 470, - UIMAGE1DARRAY = 471, - IMAGE2DARRAY = 472, - IIMAGE2DARRAY = 473, - UIMAGE2DARRAY = 474, - IMAGECUBEARRAY = 475, - IIMAGECUBEARRAY = 476, - UIMAGECUBEARRAY = 477, - IMAGE2DMS = 478, - IIMAGE2DMS = 479, - UIMAGE2DMS = 480, - IMAGE2DMSARRAY = 481, - IIMAGE2DMSARRAY = 482, - UIMAGE2DMSARRAY = 483, - STRUCT = 484, - VOID = 485, - WHILE = 486, - IDENTIFIER = 487, - TYPE_NAME = 488, - FLOATCONSTANT = 489, - DOUBLECONSTANT = 490, - INTCONSTANT = 491, - UINTCONSTANT = 492, - INT64CONSTANT = 493, - UINT64CONSTANT = 494, - INT16CONSTANT = 495, - UINT16CONSTANT = 496, - BOOLCONSTANT = 497, - FLOAT16CONSTANT = 498, - LEFT_OP = 499, - RIGHT_OP = 500, - INC_OP = 501, - DEC_OP = 502, - LE_OP = 503, - GE_OP = 504, - EQ_OP = 505, - NE_OP = 506, - AND_OP = 507, - OR_OP = 508, - XOR_OP = 509, - MUL_ASSIGN = 510, - DIV_ASSIGN = 511, - ADD_ASSIGN = 512, - MOD_ASSIGN = 513, - LEFT_ASSIGN = 514, - RIGHT_ASSIGN = 515, - AND_ASSIGN = 516, - XOR_ASSIGN = 517, - OR_ASSIGN = 518, - SUB_ASSIGN = 519, - LEFT_PAREN = 520, - RIGHT_PAREN = 521, - LEFT_BRACKET = 522, - RIGHT_BRACKET = 523, - LEFT_BRACE = 524, - RIGHT_BRACE = 525, - DOT = 526, - COMMA = 527, - COLON = 528, - EQUAL = 529, - SEMICOLON = 530, - BANG = 531, - DASH = 532, - TILDE = 533, - PLUS = 534, - STAR = 535, - SLASH = 536, - PERCENT = 537, - LEFT_ANGLE = 538, - RIGHT_ANGLE = 539, - VERTICAL_BAR = 540, - CARET = 541, - AMPERSAND = 542, - QUESTION = 543, - INVARIANT = 544, - PRECISE = 545, - HIGH_PRECISION = 546, - MEDIUM_PRECISION = 547, - LOW_PRECISION = 548, - PRECISION = 549, - PACKED = 550, - RESOURCE = 551, - SUPERP = 552 + FLOAT64_T = 264, + CONST = 265, + BOOL = 266, + INT = 267, + UINT = 268, + INT64_T = 269, + UINT64_T = 270, + INT32_T = 271, + UINT32_T = 272, + INT16_T = 273, + UINT16_T = 274, + INT8_T = 275, + UINT8_T = 276, + BREAK = 277, + CONTINUE = 278, + DO = 279, + ELSE = 280, + FOR = 281, + IF = 282, + DISCARD = 283, + RETURN = 284, + SWITCH = 285, + CASE = 286, + DEFAULT = 287, + SUBROUTINE = 288, + BVEC2 = 289, + BVEC3 = 290, + BVEC4 = 291, + IVEC2 = 292, + IVEC3 = 293, + IVEC4 = 294, + UVEC2 = 295, + UVEC3 = 296, + UVEC4 = 297, + I64VEC2 = 298, + I64VEC3 = 299, + I64VEC4 = 300, + U64VEC2 = 301, + U64VEC3 = 302, + U64VEC4 = 303, + I32VEC2 = 304, + I32VEC3 = 305, + I32VEC4 = 306, + U32VEC2 = 307, + U32VEC3 = 308, + U32VEC4 = 309, + I16VEC2 = 310, + I16VEC3 = 311, + I16VEC4 = 312, + U16VEC2 = 313, + U16VEC3 = 314, + U16VEC4 = 315, + I8VEC2 = 316, + I8VEC3 = 317, + I8VEC4 = 318, + U8VEC2 = 319, + U8VEC3 = 320, + U8VEC4 = 321, + VEC2 = 322, + VEC3 = 323, + VEC4 = 324, + MAT2 = 325, + MAT3 = 326, + MAT4 = 327, + CENTROID = 328, + IN = 329, + OUT = 330, + INOUT = 331, + UNIFORM = 332, + PATCH = 333, + SAMPLE = 334, + BUFFER = 335, + SHARED = 336, + NONUNIFORM = 337, + COHERENT = 338, + VOLATILE = 339, + RESTRICT = 340, + READONLY = 341, + WRITEONLY = 342, + DVEC2 = 343, + DVEC3 = 344, + DVEC4 = 345, + DMAT2 = 346, + DMAT3 = 347, + DMAT4 = 348, + F16VEC2 = 349, + F16VEC3 = 350, + F16VEC4 = 351, + F16MAT2 = 352, + F16MAT3 = 353, + F16MAT4 = 354, + F32VEC2 = 355, + F32VEC3 = 356, + F32VEC4 = 357, + F32MAT2 = 358, + F32MAT3 = 359, + F32MAT4 = 360, + F64VEC2 = 361, + F64VEC3 = 362, + F64VEC4 = 363, + F64MAT2 = 364, + F64MAT3 = 365, + F64MAT4 = 366, + NOPERSPECTIVE = 367, + FLAT = 368, + SMOOTH = 369, + LAYOUT = 370, + __EXPLICITINTERPAMD = 371, + MAT2X2 = 372, + MAT2X3 = 373, + MAT2X4 = 374, + MAT3X2 = 375, + MAT3X3 = 376, + MAT3X4 = 377, + MAT4X2 = 378, + MAT4X3 = 379, + MAT4X4 = 380, + DMAT2X2 = 381, + DMAT2X3 = 382, + DMAT2X4 = 383, + DMAT3X2 = 384, + DMAT3X3 = 385, + DMAT3X4 = 386, + DMAT4X2 = 387, + DMAT4X3 = 388, + DMAT4X4 = 389, + F16MAT2X2 = 390, + F16MAT2X3 = 391, + F16MAT2X4 = 392, + F16MAT3X2 = 393, + F16MAT3X3 = 394, + F16MAT3X4 = 395, + F16MAT4X2 = 396, + F16MAT4X3 = 397, + F16MAT4X4 = 398, + F32MAT2X2 = 399, + F32MAT2X3 = 400, + F32MAT2X4 = 401, + F32MAT3X2 = 402, + F32MAT3X3 = 403, + F32MAT3X4 = 404, + F32MAT4X2 = 405, + F32MAT4X3 = 406, + F32MAT4X4 = 407, + F64MAT2X2 = 408, + F64MAT2X3 = 409, + F64MAT2X4 = 410, + F64MAT3X2 = 411, + F64MAT3X3 = 412, + F64MAT3X4 = 413, + F64MAT4X2 = 414, + F64MAT4X3 = 415, + F64MAT4X4 = 416, + ATOMIC_UINT = 417, + SAMPLER1D = 418, + SAMPLER2D = 419, + SAMPLER3D = 420, + SAMPLERCUBE = 421, + SAMPLER1DSHADOW = 422, + SAMPLER2DSHADOW = 423, + SAMPLERCUBESHADOW = 424, + SAMPLER1DARRAY = 425, + SAMPLER2DARRAY = 426, + SAMPLER1DARRAYSHADOW = 427, + SAMPLER2DARRAYSHADOW = 428, + ISAMPLER1D = 429, + ISAMPLER2D = 430, + ISAMPLER3D = 431, + ISAMPLERCUBE = 432, + ISAMPLER1DARRAY = 433, + ISAMPLER2DARRAY = 434, + USAMPLER1D = 435, + USAMPLER2D = 436, + USAMPLER3D = 437, + USAMPLERCUBE = 438, + USAMPLER1DARRAY = 439, + USAMPLER2DARRAY = 440, + SAMPLER2DRECT = 441, + SAMPLER2DRECTSHADOW = 442, + ISAMPLER2DRECT = 443, + USAMPLER2DRECT = 444, + SAMPLERBUFFER = 445, + ISAMPLERBUFFER = 446, + USAMPLERBUFFER = 447, + SAMPLERCUBEARRAY = 448, + SAMPLERCUBEARRAYSHADOW = 449, + ISAMPLERCUBEARRAY = 450, + USAMPLERCUBEARRAY = 451, + SAMPLER2DMS = 452, + ISAMPLER2DMS = 453, + USAMPLER2DMS = 454, + SAMPLER2DMSARRAY = 455, + ISAMPLER2DMSARRAY = 456, + USAMPLER2DMSARRAY = 457, + SAMPLEREXTERNALOES = 458, + F16SAMPLER1D = 459, + F16SAMPLER2D = 460, + F16SAMPLER3D = 461, + F16SAMPLER2DRECT = 462, + F16SAMPLERCUBE = 463, + F16SAMPLER1DARRAY = 464, + F16SAMPLER2DARRAY = 465, + F16SAMPLERCUBEARRAY = 466, + F16SAMPLERBUFFER = 467, + F16SAMPLER2DMS = 468, + F16SAMPLER2DMSARRAY = 469, + F16SAMPLER1DSHADOW = 470, + F16SAMPLER2DSHADOW = 471, + F16SAMPLER1DARRAYSHADOW = 472, + F16SAMPLER2DARRAYSHADOW = 473, + F16SAMPLER2DRECTSHADOW = 474, + F16SAMPLERCUBESHADOW = 475, + F16SAMPLERCUBEARRAYSHADOW = 476, + SAMPLER = 477, + SAMPLERSHADOW = 478, + TEXTURE1D = 479, + TEXTURE2D = 480, + TEXTURE3D = 481, + TEXTURECUBE = 482, + TEXTURE1DARRAY = 483, + TEXTURE2DARRAY = 484, + ITEXTURE1D = 485, + ITEXTURE2D = 486, + ITEXTURE3D = 487, + ITEXTURECUBE = 488, + ITEXTURE1DARRAY = 489, + ITEXTURE2DARRAY = 490, + UTEXTURE1D = 491, + UTEXTURE2D = 492, + UTEXTURE3D = 493, + UTEXTURECUBE = 494, + UTEXTURE1DARRAY = 495, + UTEXTURE2DARRAY = 496, + TEXTURE2DRECT = 497, + ITEXTURE2DRECT = 498, + UTEXTURE2DRECT = 499, + TEXTUREBUFFER = 500, + ITEXTUREBUFFER = 501, + UTEXTUREBUFFER = 502, + TEXTURECUBEARRAY = 503, + ITEXTURECUBEARRAY = 504, + UTEXTURECUBEARRAY = 505, + TEXTURE2DMS = 506, + ITEXTURE2DMS = 507, + UTEXTURE2DMS = 508, + TEXTURE2DMSARRAY = 509, + ITEXTURE2DMSARRAY = 510, + UTEXTURE2DMSARRAY = 511, + F16TEXTURE1D = 512, + F16TEXTURE2D = 513, + F16TEXTURE3D = 514, + F16TEXTURE2DRECT = 515, + F16TEXTURECUBE = 516, + F16TEXTURE1DARRAY = 517, + F16TEXTURE2DARRAY = 518, + F16TEXTURECUBEARRAY = 519, + F16TEXTUREBUFFER = 520, + F16TEXTURE2DMS = 521, + F16TEXTURE2DMSARRAY = 522, + SUBPASSINPUT = 523, + SUBPASSINPUTMS = 524, + ISUBPASSINPUT = 525, + ISUBPASSINPUTMS = 526, + USUBPASSINPUT = 527, + USUBPASSINPUTMS = 528, + F16SUBPASSINPUT = 529, + F16SUBPASSINPUTMS = 530, + IMAGE1D = 531, + IIMAGE1D = 532, + UIMAGE1D = 533, + IMAGE2D = 534, + IIMAGE2D = 535, + UIMAGE2D = 536, + IMAGE3D = 537, + IIMAGE3D = 538, + UIMAGE3D = 539, + IMAGE2DRECT = 540, + IIMAGE2DRECT = 541, + UIMAGE2DRECT = 542, + IMAGECUBE = 543, + IIMAGECUBE = 544, + UIMAGECUBE = 545, + IMAGEBUFFER = 546, + IIMAGEBUFFER = 547, + UIMAGEBUFFER = 548, + IMAGE1DARRAY = 549, + IIMAGE1DARRAY = 550, + UIMAGE1DARRAY = 551, + IMAGE2DARRAY = 552, + IIMAGE2DARRAY = 553, + UIMAGE2DARRAY = 554, + IMAGECUBEARRAY = 555, + IIMAGECUBEARRAY = 556, + UIMAGECUBEARRAY = 557, + IMAGE2DMS = 558, + IIMAGE2DMS = 559, + UIMAGE2DMS = 560, + IMAGE2DMSARRAY = 561, + IIMAGE2DMSARRAY = 562, + UIMAGE2DMSARRAY = 563, + F16IMAGE1D = 564, + F16IMAGE2D = 565, + F16IMAGE3D = 566, + F16IMAGE2DRECT = 567, + F16IMAGECUBE = 568, + F16IMAGE1DARRAY = 569, + F16IMAGE2DARRAY = 570, + F16IMAGECUBEARRAY = 571, + F16IMAGEBUFFER = 572, + F16IMAGE2DMS = 573, + F16IMAGE2DMSARRAY = 574, + STRUCT = 575, + VOID = 576, + WHILE = 577, + IDENTIFIER = 578, + TYPE_NAME = 579, + FLOATCONSTANT = 580, + DOUBLECONSTANT = 581, + INT16CONSTANT = 582, + UINT16CONSTANT = 583, + INT32CONSTANT = 584, + UINT32CONSTANT = 585, + INTCONSTANT = 586, + UINTCONSTANT = 587, + INT64CONSTANT = 588, + UINT64CONSTANT = 589, + BOOLCONSTANT = 590, + FLOAT16CONSTANT = 591, + LEFT_OP = 592, + RIGHT_OP = 593, + INC_OP = 594, + DEC_OP = 595, + LE_OP = 596, + GE_OP = 597, + EQ_OP = 598, + NE_OP = 599, + AND_OP = 600, + OR_OP = 601, + XOR_OP = 602, + MUL_ASSIGN = 603, + DIV_ASSIGN = 604, + ADD_ASSIGN = 605, + MOD_ASSIGN = 606, + LEFT_ASSIGN = 607, + RIGHT_ASSIGN = 608, + AND_ASSIGN = 609, + XOR_ASSIGN = 610, + OR_ASSIGN = 611, + SUB_ASSIGN = 612, + LEFT_PAREN = 613, + RIGHT_PAREN = 614, + LEFT_BRACKET = 615, + RIGHT_BRACKET = 616, + LEFT_BRACE = 617, + RIGHT_BRACE = 618, + DOT = 619, + COMMA = 620, + COLON = 621, + EQUAL = 622, + SEMICOLON = 623, + BANG = 624, + DASH = 625, + TILDE = 626, + PLUS = 627, + STAR = 628, + SLASH = 629, + PERCENT = 630, + LEFT_ANGLE = 631, + RIGHT_ANGLE = 632, + VERTICAL_BAR = 633, + CARET = 634, + AMPERSAND = 635, + QUESTION = 636, + INVARIANT = 637, + PRECISE = 638, + HIGH_PRECISION = 639, + MEDIUM_PRECISION = 640, + LOW_PRECISION = 641, + PRECISION = 642, + PACKED = 643, + RESOURCE = 644, + SUPERP = 645 }; #endif @@ -348,7 +441,7 @@ typedef union YYSTYPE YYSTYPE; union YYSTYPE { -#line 68 "MachineIndependent/glslang.y" /* yacc.c:1909 */ +#line 70 "MachineIndependent/glslang.y" /* yacc.c:1909 */ struct { glslang::TSourceLoc loc; @@ -370,6 +463,7 @@ TIntermNode* intermNode; glslang::TIntermNodePair nodePair; glslang::TIntermTyped* intermTypedNode; + glslang::TAttributes* attributes; }; union { glslang::TPublicType type; @@ -382,7 +476,7 @@ }; } interm; -#line 386 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */ +#line 480 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */ }; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/glslang.y vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/glslang.y --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/glslang.y 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/glslang.y 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -58,6 +59,7 @@ #include "SymbolTable.h" #include "ParseHelper.h" #include "../Public/ShaderLang.h" +#include "attribute.h" using namespace glslang; @@ -86,6 +88,7 @@ TIntermNode* intermNode; glslang::TIntermNodePair nodePair; glslang::TIntermTyped* intermTypedNode; + glslang::TAttributes* attributes; }; union { glslang::TPublicType type; @@ -121,15 +124,28 @@ %expect 1 // One shift reduce conflict because of if | else %token ATTRIBUTE VARYING -%token CONST BOOL FLOAT DOUBLE INT UINT INT64_T UINT64_T INT16_T UINT16_T FLOAT16_T +%token FLOAT16_T FLOAT FLOAT32_T DOUBLE FLOAT64_T +%token CONST BOOL INT UINT INT64_T UINT64_T INT32_T UINT32_T INT16_T UINT16_T INT8_T UINT8_T %token BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT SUBROUTINE -%token BVEC2 BVEC3 BVEC4 IVEC2 IVEC3 IVEC4 I64VEC2 I64VEC3 I64VEC4 UVEC2 UVEC3 UVEC4 U64VEC2 U64VEC3 U64VEC4 VEC2 VEC3 VEC4 +%token BVEC2 BVEC3 BVEC4 +%token IVEC2 IVEC3 IVEC4 +%token UVEC2 UVEC3 UVEC4 +%token I64VEC2 I64VEC3 I64VEC4 +%token U64VEC2 U64VEC3 U64VEC4 +%token I32VEC2 I32VEC3 I32VEC4 +%token U32VEC2 U32VEC3 U32VEC4 +%token I16VEC2 I16VEC3 I16VEC4 +%token U16VEC2 U16VEC3 U16VEC4 +%token I8VEC2 I8VEC3 I8VEC4 +%token U8VEC2 U8VEC3 U8VEC4 +%token VEC2 VEC3 VEC4 %token MAT2 MAT3 MAT4 CENTROID IN OUT INOUT -%token UNIFORM PATCH SAMPLE BUFFER SHARED +%token UNIFORM PATCH SAMPLE BUFFER SHARED NONUNIFORM %token COHERENT VOLATILE RESTRICT READONLY WRITEONLY %token DVEC2 DVEC3 DVEC4 DMAT2 DMAT3 DMAT4 %token F16VEC2 F16VEC3 F16VEC4 F16MAT2 F16MAT3 F16MAT4 -%token I16VEC2 I16VEC3 I16VEC4 U16VEC2 U16VEC3 U16VEC4 +%token F32VEC2 F32VEC3 F32VEC4 F32MAT2 F32MAT3 F32MAT4 +%token F64VEC2 F64VEC3 F64VEC4 F64MAT2 F64MAT3 F64MAT4 %token NOPERSPECTIVE FLAT SMOOTH LAYOUT __EXPLICITINTERPAMD %token MAT2X2 MAT2X3 MAT2X4 @@ -141,6 +157,12 @@ %token F16MAT2X2 F16MAT2X3 F16MAT2X4 %token F16MAT3X2 F16MAT3X3 F16MAT3X4 %token F16MAT4X2 F16MAT4X3 F16MAT4X4 +%token F32MAT2X2 F32MAT2X3 F32MAT2X4 +%token F32MAT3X2 F32MAT3X3 F32MAT3X4 +%token F32MAT4X2 F32MAT4X3 F32MAT4X4 +%token F64MAT2X2 F64MAT2X3 F64MAT2X4 +%token F64MAT3X2 F64MAT3X3 F64MAT3X4 +%token F64MAT4X2 F64MAT4X3 F64MAT4X4 %token ATOMIC_UINT // combined image/sampler @@ -157,6 +179,12 @@ %token SAMPLER2DMSARRAY ISAMPLER2DMSARRAY USAMPLER2DMSARRAY %token SAMPLEREXTERNALOES +%token F16SAMPLER1D F16SAMPLER2D F16SAMPLER3D F16SAMPLER2DRECT F16SAMPLERCUBE +%token F16SAMPLER1DARRAY F16SAMPLER2DARRAY F16SAMPLERCUBEARRAY +%token F16SAMPLERBUFFER F16SAMPLER2DMS F16SAMPLER2DMSARRAY +%token F16SAMPLER1DSHADOW F16SAMPLER2DSHADOW F16SAMPLER1DARRAYSHADOW F16SAMPLER2DARRAYSHADOW +%token F16SAMPLER2DRECTSHADOW F16SAMPLERCUBESHADOW F16SAMPLERCUBEARRAYSHADOW + // pure sampler %token SAMPLER SAMPLERSHADOW @@ -172,8 +200,13 @@ %token TEXTURE2DMS ITEXTURE2DMS UTEXTURE2DMS %token TEXTURE2DMSARRAY ITEXTURE2DMSARRAY UTEXTURE2DMSARRAY +%token F16TEXTURE1D F16TEXTURE2D F16TEXTURE3D F16TEXTURE2DRECT F16TEXTURECUBE +%token F16TEXTURE1DARRAY F16TEXTURE2DARRAY F16TEXTURECUBEARRAY +%token F16TEXTUREBUFFER F16TEXTURE2DMS F16TEXTURE2DMSARRAY + // input attachments %token SUBPASSINPUT SUBPASSINPUTMS ISUBPASSINPUT ISUBPASSINPUTMS USUBPASSINPUT USUBPASSINPUTMS +%token F16SUBPASSINPUT F16SUBPASSINPUTMS %token IMAGE1D IIMAGE1D UIMAGE1D IMAGE2D IIMAGE2D %token UIMAGE2D IMAGE3D IIMAGE3D UIMAGE3D @@ -186,10 +219,14 @@ %token IMAGE2DMS IIMAGE2DMS UIMAGE2DMS %token IMAGE2DMSARRAY IIMAGE2DMSARRAY UIMAGE2DMSARRAY +%token F16IMAGE1D F16IMAGE2D F16IMAGE3D F16IMAGE2DRECT +%token F16IMAGECUBE F16IMAGE1DARRAY F16IMAGE2DARRAY F16IMAGECUBEARRAY +%token F16IMAGEBUFFER F16IMAGE2DMS F16IMAGE2DMSARRAY + %token STRUCT VOID WHILE %token IDENTIFIER TYPE_NAME -%token FLOATCONSTANT DOUBLECONSTANT INTCONSTANT UINTCONSTANT INT64CONSTANT UINT64CONSTANT INT16CONSTANT UINT16CONSTANT BOOLCONSTANT FLOAT16CONSTANT +%token FLOATCONSTANT DOUBLECONSTANT INT16CONSTANT UINT16CONSTANT INT32CONSTANT UINT32CONSTANT INTCONSTANT UINTCONSTANT INT64CONSTANT UINT64CONSTANT BOOLCONSTANT FLOAT16CONSTANT %token LEFT_OP RIGHT_OP %token INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP %token AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN @@ -218,12 +255,12 @@ %type translation_unit function_definition %type statement simple_statement %type statement_list switch_statement_list compound_statement -%type declaration_statement selection_statement expression_statement -%type switch_statement case_label +%type declaration_statement selection_statement selection_statement_nonattributed expression_statement +%type switch_statement switch_statement_nonattributed case_label %type declaration external_declaration %type for_init_statement compound_statement_no_new_scope %type selection_rest_statement for_rest_statement -%type iteration_statement jump_statement statement_no_new_scope statement_scoped +%type iteration_statement iteration_statement_nonattributed jump_statement statement_no_new_scope statement_scoped %type single_declaration init_declarator_list %type parameter_declaration parameter_declarator parameter_type_specifier @@ -231,6 +268,7 @@ %type array_specifier %type precise_qualifier invariant_qualifier interpolation_qualifier storage_qualifier precision_qualifier %type layout_qualifier layout_qualifier_id_list layout_qualifier_id +%type non_uniform_qualifier %type type_qualifier fully_specified_type type_specifier %type single_type_qualifier @@ -246,6 +284,8 @@ %type identifier_list +%type attribute attribute_list single_attribute + %start translation_unit %% @@ -259,6 +299,14 @@ : variable_identifier { $$ = $1; } + | INT32CONSTANT { + parseContext.explicitInt32Check($1.loc, "32-bit signed literal"); + $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true); + } + | UINT32CONSTANT { + parseContext.explicitInt32Check($1.loc, "32-bit signed literal"); + $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true); + } | INTCONSTANT { $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true); } @@ -275,16 +323,12 @@ $$ = parseContext.intermediate.addConstantUnion($1.u64, $1.loc, true); } | INT16CONSTANT { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit integer literal"); + parseContext.explicitInt16Check($1.loc, "16-bit integer literal"); $$ = parseContext.intermediate.addConstantUnion((short)$1.i, $1.loc, true); -#endif } | UINT16CONSTANT { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit unsigned integer literal"); + parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer literal"); $$ = parseContext.intermediate.addConstantUnion((unsigned short)$1.u, $1.loc, true); -#endif } | FLOATCONSTANT { $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true); @@ -294,10 +338,8 @@ $$ = parseContext.intermediate.addConstantUnion($1.d, EbtDouble, $1.loc, true); } | FLOAT16CONSTANT { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float literal"); $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat16, $1.loc, true); -#endif } | BOOLCONSTANT { $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true); @@ -432,6 +474,11 @@ $$.function = new TFunction(&empty, TType(EbtVoid), EOpNull); } } + | non_uniform_qualifier { + // Constructor + $$.intermNode = 0; + $$.function = parseContext.handleConstructorCall($1.loc, $1); + } ; unary_expression @@ -893,14 +940,16 @@ parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type"); parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes); } - parseContext.arrayDimCheck($2.loc, $1.arraySizes, $3.arraySizes); + TType* type = new TType($1); + type->transferArraySizes($3.arraySizes); + type->copyArrayInnerSizes($1.arraySizes); + parseContext.arrayOfArrayVersionCheck($2.loc, type->getArraySizes()); parseContext.arraySizeRequiredCheck($3.loc, *$3.arraySizes); parseContext.reservedErrorCheck($2.loc, *$2.string); - $1.arraySizes = $3.arraySizes; + TParameter param = { $2.string, type }; - TParameter param = { $2.string, new TType($1)}; $$.loc = $2.loc; $$.param = param; } @@ -925,7 +974,7 @@ $$ = $1; parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type); - parseContext.paramCheckFix($1.loc, EvqTemporary, *$$.param.type); + parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type); parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier()); } // @@ -945,7 +994,7 @@ $$ = $1; parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type); - parseContext.paramCheckFix($1.loc, EvqTemporary, *$$.param.type); + parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type); parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier()); } ; @@ -1034,7 +1083,7 @@ } if ($2.arraySizes && parseContext.arrayQualifierError($2.loc, $1.qualifier)) - $2.arraySizes = 0; + $2.arraySizes = nullptr; parseContext.checkNoShaderLayouts($2.loc, $1.shaderQualifiers); $2.shaderQualifiers.merge($1.shaderQualifiers); @@ -1076,7 +1125,11 @@ } | NOPERSPECTIVE { parseContext.globalCheck($1.loc, "noperspective"); +#ifdef NV_EXTENSIONS + parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective"); +#else parseContext.requireProfile($1.loc, ~EEsProfile, "noperspective"); +#endif parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "noperspective"); $$.init($1.loc); $$.qualifier.nopersp = true; @@ -1170,6 +1223,9 @@ // allow inheritance of storage qualifier from block declaration $$ = $1; } + | non_uniform_qualifier { + $$ = $1; + } ; storage_qualifier @@ -1290,6 +1346,13 @@ } ; +non_uniform_qualifier + : NONUNIFORM { + $$.init($1.loc); + $$.qualifier.nonUniform = true; + } + ; + type_name_list : IDENTIFIER { // TODO @@ -1307,7 +1370,7 @@ $$.qualifier.precision = parseContext.getDefaultPrecision($$); } | type_specifier_nonarray array_specifier { - parseContext.arrayDimCheck($2.loc, $2.arraySizes, 0); + parseContext.arrayOfArrayVersionCheck($2.loc, $2.arraySizes); $$ = $1; $$.qualifier.precision = parseContext.getDefaultPrecision($$); $$.arraySizes = $2.arraySizes; @@ -1356,11 +1419,19 @@ $$.basicType = EbtDouble; } | FLOAT16_T { -#ifdef AMD_EXTENSIONS - parseContext.float16Check($1.loc, "half float", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16Check($1.loc, "float16_t", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; -#endif + } + | FLOAT32_T { + parseContext.explicitFloat32Check($1.loc, "float32_t", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + } + | FLOAT64_T { + parseContext.explicitFloat64Check($1.loc, "float64_t", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; } | INT { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); @@ -1371,29 +1442,45 @@ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtUint; } - | INT64_T { - parseContext.int64Check($1.loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); + | INT8_T { + parseContext.explicitInt8Check($1.loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt64; + $$.basicType = EbtInt8; } - | UINT64_T { - parseContext.int64Check($1.loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + | UINT8_T { + parseContext.explicitInt8Check($1.loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtUint64; + $$.basicType = EbtUint8; } | INT16_T { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit integer", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitInt16Check($1.loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtInt16; -#endif } | UINT16_T { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtUint16; -#endif + } + | INT32_T { + parseContext.explicitInt32Check($1.loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt; + } + | UINT32_T { + parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint; + } + | INT64_T { + parseContext.int64Check($1.loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt64; + } + | UINT64_T { + parseContext.int64Check($1.loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint64; } | BOOL { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); @@ -1433,28 +1520,58 @@ $$.setVector(4); } | F16VEC2 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setVector(2); -#endif } | F16VEC3 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setVector(3); -#endif } | F16VEC4 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setVector(4); -#endif + } + | F32VEC2 { + parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setVector(2); + } + | F32VEC3 { + parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setVector(3); + } + | F32VEC4 { + parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setVector(4); + } + | F64VEC2 { + parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setVector(2); + } + | F64VEC3 { + parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setVector(3); + } + | F64VEC4 { + parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setVector(4); } | BVEC2 { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); @@ -1486,47 +1603,77 @@ $$.basicType = EbtInt; $$.setVector(4); } - | I64VEC2 { - parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + | I8VEC2 { + parseContext.explicitInt8Check($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt8; + $$.setVector(2); + } + | I8VEC3 { + parseContext.explicitInt8Check($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt8; + $$.setVector(3); + } + | I8VEC4 { + parseContext.explicitInt8Check($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt8; + $$.setVector(4); + } + | I16VEC2 { + parseContext.explicitInt16Check($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt16; + $$.setVector(2); + } + | I16VEC3 { + parseContext.explicitInt16Check($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt16; + $$.setVector(3); + } + | I16VEC4 { + parseContext.explicitInt16Check($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt16; + $$.setVector(4); + } + | I32VEC2 { + parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt64; + $$.basicType = EbtInt; $$.setVector(2); } - | I64VEC3 { - parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + | I32VEC3 { + parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt64; + $$.basicType = EbtInt; $$.setVector(3); } - | I64VEC4 { - parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + | I32VEC4 { + parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt64; + $$.basicType = EbtInt; $$.setVector(4); } - | I16VEC2 { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + | I64VEC2 { + parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt16; + $$.basicType = EbtInt64; $$.setVector(2); -#endif } - | I16VEC3 { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + | I64VEC3 { + parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt16; + $$.basicType = EbtInt64; $$.setVector(3); -#endif } - | I16VEC4 { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + | I64VEC4 { + parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt16; + $$.basicType = EbtInt64; $$.setVector(4); -#endif } | UVEC2 { parseContext.fullIntegerCheck($1.loc, "unsigned integer vector"); @@ -1546,47 +1693,77 @@ $$.basicType = EbtUint; $$.setVector(4); } - | U64VEC2 { - parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + | U8VEC2 { + parseContext.explicitInt8Check($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtUint64; + $$.basicType = EbtUint8; $$.setVector(2); } - | U64VEC3 { - parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + | U8VEC3 { + parseContext.explicitInt8Check($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtUint64; + $$.basicType = EbtInt8; $$.setVector(3); } - | U64VEC4 { - parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + | U8VEC4 { + parseContext.explicitInt8Check($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtUint64; + $$.basicType = EbtUint8; $$.setVector(4); } | U16VEC2 { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtUint16; $$.setVector(2); -#endif } | U16VEC3 { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtUint16; $$.setVector(3); -#endif } | U16VEC4 { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtUint16; $$.setVector(4); -#endif + } + | U32VEC2 { + parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint; + $$.setVector(2); + } + | U32VEC3 { + parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint; + $$.setVector(3); + } + | U32VEC4 { + parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint; + $$.setVector(4); + } + | U64VEC2 { + parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint64; + $$.setVector(2); + } + | U64VEC3 { + parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint64; + $$.setVector(3); + } + | U64VEC4 { + parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint64; + $$.setVector(4); } | MAT2 { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); @@ -1721,160 +1898,280 @@ $$.setMatrix(4, 4); } | F16MAT2 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(2, 2); -#endif } | F16MAT3 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(3, 3); -#endif } | F16MAT4 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(4, 4); -#endif } | F16MAT2X2 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(2, 2); -#endif } | F16MAT2X3 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(2, 3); -#endif } | F16MAT2X4 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(2, 4); -#endif } | F16MAT3X2 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(3, 2); -#endif } | F16MAT3X3 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(3, 3); -#endif } | F16MAT3X4 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(3, 4); -#endif } | F16MAT4X2 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(4, 2); -#endif } | F16MAT4X3 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(4, 3); -#endif } | F16MAT4X4 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(4, 4); -#endif } - | ATOMIC_UINT { - parseContext.vulkanRemoved($1.loc, "atomic counter types"); + | F32MAT2 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtAtomicUint; + $$.basicType = EbtFloat; + $$.setMatrix(2, 2); } - | SAMPLER1D { + | F32MAT3 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd1D); + $$.basicType = EbtFloat; + $$.setMatrix(3, 3); } - | SAMPLER2D { + | F32MAT4 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd2D); + $$.basicType = EbtFloat; + $$.setMatrix(4, 4); } - | SAMPLER3D { + | F32MAT2X2 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd3D); + $$.basicType = EbtFloat; + $$.setMatrix(2, 2); } - | SAMPLERCUBE { + | F32MAT2X3 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, EsdCube); + $$.basicType = EbtFloat; + $$.setMatrix(2, 3); } - | SAMPLER1DSHADOW { + | F32MAT2X4 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd1D, false, true); + $$.basicType = EbtFloat; + $$.setMatrix(2, 4); } - | SAMPLER2DSHADOW { + | F32MAT3X2 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd2D, false, true); + $$.basicType = EbtFloat; + $$.setMatrix(3, 2); } - | SAMPLERCUBESHADOW { + | F32MAT3X3 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, EsdCube, false, true); + $$.basicType = EbtFloat; + $$.setMatrix(3, 3); } - | SAMPLER1DARRAY { + | F32MAT3X4 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd1D, true); + $$.basicType = EbtFloat; + $$.setMatrix(3, 4); } - | SAMPLER2DARRAY { + | F32MAT4X2 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd2D, true); + $$.basicType = EbtFloat; + $$.setMatrix(4, 2); } - | SAMPLER1DARRAYSHADOW { + | F32MAT4X3 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd1D, true, true); + $$.basicType = EbtFloat; + $$.setMatrix(4, 3); } - | SAMPLER2DARRAYSHADOW { + | F32MAT4X4 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd2D, true, true); + $$.basicType = EbtFloat; + $$.setMatrix(4, 4); + } + | F64MAT2 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(2, 2); + } + | F64MAT3 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(3, 3); + } + | F64MAT4 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(4, 4); + } + | F64MAT2X2 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(2, 2); + } + | F64MAT2X3 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(2, 3); + } + | F64MAT2X4 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(2, 4); + } + | F64MAT3X2 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(3, 2); + } + | F64MAT3X3 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(3, 3); + } + | F64MAT3X4 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(3, 4); + } + | F64MAT4X2 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(4, 2); + } + | F64MAT4X3 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(4, 3); + } + | F64MAT4X4 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(4, 4); + } + | ATOMIC_UINT { + parseContext.vulkanRemoved($1.loc, "atomic counter types"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtAtomicUint; + } + | SAMPLER1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd1D); + } + | SAMPLER2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd2D); + } + | SAMPLER3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd3D); + } + | SAMPLERCUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, EsdCube); + } + | SAMPLER1DSHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd1D, false, true); + } + | SAMPLER2DSHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd2D, false, true); + } + | SAMPLERCUBESHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, EsdCube, false, true); + } + | SAMPLER1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd1D, true); + } + | SAMPLER2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd2D, true); + } + | SAMPLER1DARRAYSHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd1D, true, true); + } + | SAMPLER2DARRAYSHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd2D, true, true); } | SAMPLERCUBEARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); @@ -1886,6 +2183,110 @@ $$.basicType = EbtSampler; $$.sampler.set(EbtFloat, EsdCube, true, true); } + | F16SAMPLER1D { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd1D); +#endif + } + | F16SAMPLER2D { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd2D); +#endif + } + | F16SAMPLER3D { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd3D); +#endif + } + | F16SAMPLERCUBE { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdCube); +#endif + } + | F16SAMPLER1DSHADOW { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd1D, false, true); +#endif + } + | F16SAMPLER2DSHADOW { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd2D, false, true); +#endif + } + | F16SAMPLERCUBESHADOW { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdCube, false, true); +#endif + } + | F16SAMPLER1DARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd1D, true); +#endif + } + | F16SAMPLER2DARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd2D, true); +#endif + } + | F16SAMPLER1DARRAYSHADOW { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd1D, true, true); +#endif + } + | F16SAMPLER2DARRAYSHADOW { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd2D, true, true); +#endif + } + | F16SAMPLERCUBEARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdCube, true); +#endif + } + | F16SAMPLERCUBEARRAYSHADOW { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdCube, true, true); +#endif + } | ISAMPLER1D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -1966,6 +2367,22 @@ $$.basicType = EbtSampler; $$.sampler.set(EbtFloat, EsdRect, false, true); } + | F16SAMPLER2DRECT { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdRect); +#endif + } + | F16SAMPLER2DRECTSHADOW { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdRect, false, true); +#endif + } | ISAMPLER2DRECT { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -1981,6 +2398,14 @@ $$.basicType = EbtSampler; $$.sampler.set(EbtFloat, EsdBuffer); } + | F16SAMPLERBUFFER { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdBuffer); +#endif + } | ISAMPLERBUFFER { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -1996,6 +2421,14 @@ $$.basicType = EbtSampler; $$.sampler.set(EbtFloat, Esd2D, false, false, true); } + | F16SAMPLER2DMS { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd2D, false, false, true); +#endif + } | ISAMPLER2DMS { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2011,6 +2444,14 @@ $$.basicType = EbtSampler; $$.sampler.set(EbtFloat, Esd2D, true, false, true); } + | F16SAMPLER2DMSARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd2D, true, false, true); +#endif + } | ISAMPLER2DMSARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2036,36 +2477,92 @@ $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, Esd1D); } + | F16TEXTURE1D { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd1D); +#endif + } | TEXTURE2D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, Esd2D); } + | F16TEXTURE2D { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd2D); +#endif + } | TEXTURE3D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, Esd3D); } + | F16TEXTURE3D { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd3D); +#endif + } | TEXTURECUBE { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, EsdCube); } + | F16TEXTURECUBE { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, EsdCube); +#endif + } | TEXTURE1DARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, Esd1D, true); } + | F16TEXTURE1DARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd1D, true); +#endif + } | TEXTURE2DARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, Esd2D, true); } + | F16TEXTURE2DARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd2D, true); +#endif + } | TEXTURECUBEARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, EsdCube, true); } + | F16TEXTURECUBEARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, EsdCube, true); +#endif + } | ITEXTURE1D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2141,6 +2638,14 @@ $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, EsdRect); } + | F16TEXTURE2DRECT { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, EsdRect); +#endif + } | ITEXTURE2DRECT { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2156,6 +2661,14 @@ $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, EsdBuffer); } + | F16TEXTUREBUFFER { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, EsdBuffer); +#endif + } | ITEXTUREBUFFER { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2171,6 +2684,14 @@ $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, Esd2D, false, false, true); } + | F16TEXTURE2DMS { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd2D, false, false, true); +#endif + } | ITEXTURE2DMS { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2186,6 +2707,14 @@ $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, Esd2D, true, false, true); } + | F16TEXTURE2DMSARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd2D, true, false, true); +#endif + } | ITEXTURE2DMSARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2201,6 +2730,14 @@ $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, Esd1D); } + | F16IMAGE1D { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd1D); +#endif + } | IIMAGE1D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2216,6 +2753,14 @@ $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, Esd2D); } + | F16IMAGE2D { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd2D); +#endif + } | IIMAGE2D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2231,6 +2776,14 @@ $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, Esd3D); } + | F16IMAGE3D { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd3D); +#endif + } | IIMAGE3D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2246,6 +2799,14 @@ $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, EsdRect); } + | F16IMAGE2DRECT { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, EsdRect); +#endif + } | IIMAGE2DRECT { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2261,6 +2822,14 @@ $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, EsdCube); } + | F16IMAGECUBE { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, EsdCube); +#endif + } | IIMAGECUBE { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2276,6 +2845,14 @@ $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, EsdBuffer); } + | F16IMAGEBUFFER { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, EsdBuffer); +#endif + } | IIMAGEBUFFER { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2291,6 +2868,14 @@ $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, Esd1D, true); } + | F16IMAGE1DARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd1D, true); +#endif + } | IIMAGE1DARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2306,6 +2891,14 @@ $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, Esd2D, true); } + | F16IMAGE2DARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd2D, true); +#endif + } | IIMAGE2DARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2321,6 +2914,14 @@ $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, EsdCube, true); } + | F16IMAGECUBEARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, EsdCube, true); +#endif + } | IIMAGECUBEARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2336,6 +2937,14 @@ $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, Esd2D, false, false, true); } + | F16IMAGE2DMS { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd2D, false, false, true); +#endif + } | IIMAGE2DMS { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2351,6 +2960,14 @@ $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, Esd2D, true, false, true); } + | F16IMAGE2DMSARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd2D, true, false, true); +#endif + } | IIMAGE2DMSARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2379,6 +2996,24 @@ $$.basicType = EbtSampler; $$.sampler.setSubpass(EbtFloat, true); } + | F16SUBPASSINPUT { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtFloat16); +#endif + } + | F16SUBPASSINPUTMS { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtFloat16, true); +#endif + } | ISUBPASSINPUT { parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); @@ -2493,12 +3128,15 @@ parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier); for (unsigned int i = 0; i < $$->size(); ++i) { - parseContext.arrayDimCheck($1.loc, (*$$)[i].type, $1.arraySizes); - (*$$)[i].type->mergeType($1); + TType type($1); + type.setFieldName((*$$)[i].type->getFieldName()); + type.transferArraySizes((*$$)[i].type->getArraySizes()); + type.copyArrayInnerSizes($1.arraySizes); + parseContext.arrayOfArrayVersionCheck((*$$)[i].loc, type.getArraySizes()); + (*$$)[i].type->shallowCopy(type); } } | type_qualifier type_specifier struct_declarator_list SEMICOLON { - parseContext.globalQualifierFixCheck($1.loc, $1.qualifier); if ($2.arraySizes) { parseContext.profileRequires($2.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); parseContext.profileRequires($2.loc, EEsProfile, 300, 0, "arrayed type"); @@ -2508,14 +3146,18 @@ $$ = $3; - parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers); + parseContext.memberQualifierCheck($1); parseContext.voidErrorCheck($2.loc, (*$3)[0].type->getFieldName(), $2.basicType); parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true); parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier); for (unsigned int i = 0; i < $$->size(); ++i) { - parseContext.arrayDimCheck($1.loc, (*$$)[i].type, $2.arraySizes); - (*$$)[i].type->mergeType($2); + TType type($2); + type.setFieldName((*$$)[i].type->getFieldName()); + type.transferArraySizes((*$$)[i].type->getArraySizes()); + type.copyArrayInnerSizes($2.arraySizes); + parseContext.arrayOfArrayVersionCheck((*$$)[i].loc, type.getArraySizes()); + (*$$)[i].type->shallowCopy(type); } } ; @@ -2537,12 +3179,12 @@ $$.type->setFieldName(*$1.string); } | IDENTIFIER array_specifier { - parseContext.arrayDimCheck($1.loc, $2.arraySizes, 0); + parseContext.arrayOfArrayVersionCheck($1.loc, $2.arraySizes); $$.type = new TType(EbtVoid); $$.loc = $1.loc; $$.type->setFieldName(*$1.string); - $$.type->newArraySizes(*$2.arraySizes); + $$.type->transferArraySizes($2.arraySizes); } ; @@ -2673,6 +3315,15 @@ ; selection_statement + : selection_statement_nonattributed { + $$ = $1; + } + | attribute selection_statement_nonattributed { + parseContext.handleSelectionAttributes(*$1, $2); + $$ = $2; + } + +selection_statement_nonattributed : IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement { parseContext.boolCheck($1.loc, $3); $$ = parseContext.intermediate.addSelection($3, $5, $1.loc); @@ -2709,6 +3360,15 @@ ; switch_statement + : switch_statement_nonattributed { + $$ = $1; + } + | attribute switch_statement_nonattributed { + parseContext.handleSwitchAttributes(*$1, $2); + $$ = $2; + } + +switch_statement_nonattributed : SWITCH LEFT_PAREN expression RIGHT_PAREN { // start new switch sequence on the switch stack ++parseContext.controlFlowNestingLevel; @@ -2762,6 +3422,15 @@ ; iteration_statement + : iteration_statement_nonattributed { + $$ = $1; + } + | attribute iteration_statement_nonattributed { + parseContext.handleLoopAttributes(*$1, $2); + $$ = $2; + } + +iteration_statement_nonattributed : WHILE LEFT_PAREN { if (! parseContext.limits.whileLoops) parseContext.error($1.loc, "while loops not available", "limitation", ""); @@ -2916,8 +3585,30 @@ // information. This information can be queried from the parse tree $$->getAsAggregate()->setOptimize(parseContext.contextPragma.optimize); $$->getAsAggregate()->setDebug(parseContext.contextPragma.debug); - $$->getAsAggregate()->addToPragmaTable(parseContext.contextPragma.pragmaTable); + $$->getAsAggregate()->setPragmaTable(parseContext.contextPragma.pragmaTable); } ; +attribute + : LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET { + $$ = $3; + parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_control_flow_attributes, "attribute"); + } + +attribute_list + : single_attribute { + $$ = $1; + } + | attribute_list COMMA single_attribute { + $$ = parseContext.mergeAttributes($1, $3); + } + +single_attribute + : IDENTIFIER { + $$ = parseContext.makeAttributes(*$1.string); + } + | IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN { + $$ = parseContext.makeAttributes(*$1.string, $3); + } + %% diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/gl_types.h vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/gl_types.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/gl_types.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/gl_types.h 2018-04-27 11:46:26.000000000 +0000 @@ -117,6 +117,40 @@ #define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C #define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#ifdef AMD_EXTENSIONS +#define GL_FLOAT16_SAMPLER_1D_AMD 0x91CE +#define GL_FLOAT16_SAMPLER_2D_AMD 0x91CF +#define GL_FLOAT16_SAMPLER_3D_AMD 0x91D0 +#define GL_FLOAT16_SAMPLER_CUBE_AMD 0x91D1 +#define GL_FLOAT16_SAMPLER_2D_RECT_AMD 0x91D2 +#define GL_FLOAT16_SAMPLER_1D_ARRAY_AMD 0x91D3 +#define GL_FLOAT16_SAMPLER_2D_ARRAY_AMD 0x91D4 +#define GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_AMD 0x91D5 +#define GL_FLOAT16_SAMPLER_BUFFER_AMD 0x91D6 +#define GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_AMD 0x91D7 +#define GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_ARRAY_AMD 0x91D8 + +#define GL_FLOAT16_SAMPLER_1D_SHADOW_AMD 0x91D9 +#define GL_FLOAT16_SAMPLER_2D_SHADOW_AMD 0x91DA +#define GL_FLOAT16_SAMPLER_2D_RECT_SHADOW_AMD 0x91DB +#define GL_FLOAT16_SAMPLER_1D_ARRAY_SHADOW_AMD 0x91DC +#define GL_FLOAT16_SAMPLER_2D_ARRAY_SHADOW_AMD 0x91DD +#define GL_FLOAT16_SAMPLER_CUBE_SHADOW_AMD 0x91DE +#define GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_SHADOW_AMD 0x91DF + +#define GL_FLOAT16_IMAGE_1D_AMD 0x91E0 +#define GL_FLOAT16_IMAGE_2D_AMD 0x91E1 +#define GL_FLOAT16_IMAGE_3D_AMD 0x91E2 +#define GL_FLOAT16_IMAGE_2D_RECT_AMD 0x91E3 +#define GL_FLOAT16_IMAGE_CUBE_AMD 0x91E4 +#define GL_FLOAT16_IMAGE_1D_ARRAY_AMD 0x91E5 +#define GL_FLOAT16_IMAGE_2D_ARRAY_AMD 0x91E6 +#define GL_FLOAT16_IMAGE_CUBE_MAP_ARRAY_AMD 0x91E7 +#define GL_FLOAT16_IMAGE_BUFFER_AMD 0x91E8 +#define GL_FLOAT16_IMAGE_2D_MULTISAMPLE_AMD 0x91E9 +#define GL_FLOAT16_IMAGE_2D_MULTISAMPLE_ARRAY_AMD 0x91EA +#endif + #define GL_INT_SAMPLER_1D 0x8DC9 #define GL_INT_SAMPLER_2D 0x8DCA #define GL_INT_SAMPLER_3D 0x8DCB diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/Initialize.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/Initialize.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/Initialize.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/Initialize.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -2,6 +2,7 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2016 LunarG, Inc. // Copyright (C) 2015-2017 Google, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -83,6 +84,13 @@ // Set up textual representations for making all the permutations // of texturing/imaging functions. prefixes[EbtFloat] = ""; +#ifdef AMD_EXTENSIONS + prefixes[EbtFloat16] = "f16"; +#endif + prefixes[EbtInt8] = "i8"; + prefixes[EbtUint8] = "u8"; + prefixes[EbtInt16] = "i16"; + prefixes[EbtUint16] = "u16"; prefixes[EbtInt] = "i"; prefixes[EbtUint] = "u"; postfixes[2] = "2"; @@ -799,7 +807,6 @@ "bvec3 notEqual(u64vec3, u64vec3);" "bvec4 notEqual(u64vec4, u64vec4);" -#ifdef AMD_EXTENSIONS "int findLSB(int64_t);" "ivec2 findLSB(i64vec2);" "ivec3 findLSB(i64vec3);" @@ -819,7 +826,7 @@ "ivec2 findMSB(u64vec2);" "ivec3 findMSB(u64vec3);" "ivec4 findMSB(u64vec4);" -#endif + "\n" ); } @@ -888,6 +895,36 @@ "f16vec3 mid3(f16vec3, f16vec3, f16vec3);" "f16vec4 mid3(f16vec4, f16vec4, f16vec4);" + "int16_t min3(int16_t, int16_t, int16_t);" + "i16vec2 min3(i16vec2, i16vec2, i16vec2);" + "i16vec3 min3(i16vec3, i16vec3, i16vec3);" + "i16vec4 min3(i16vec4, i16vec4, i16vec4);" + + "int16_t max3(int16_t, int16_t, int16_t);" + "i16vec2 max3(i16vec2, i16vec2, i16vec2);" + "i16vec3 max3(i16vec3, i16vec3, i16vec3);" + "i16vec4 max3(i16vec4, i16vec4, i16vec4);" + + "int16_t mid3(int16_t, int16_t, int16_t);" + "i16vec2 mid3(i16vec2, i16vec2, i16vec2);" + "i16vec3 mid3(i16vec3, i16vec3, i16vec3);" + "i16vec4 mid3(i16vec4, i16vec4, i16vec4);" + + "uint16_t min3(uint16_t, uint16_t, uint16_t);" + "u16vec2 min3(u16vec2, u16vec2, u16vec2);" + "u16vec3 min3(u16vec3, u16vec3, u16vec3);" + "u16vec4 min3(u16vec4, u16vec4, u16vec4);" + + "uint16_t max3(uint16_t, uint16_t, uint16_t);" + "u16vec2 max3(u16vec2, u16vec2, u16vec2);" + "u16vec3 max3(u16vec3, u16vec3, u16vec3);" + "u16vec4 max3(u16vec4, u16vec4, u16vec4);" + + "uint16_t mid3(uint16_t, uint16_t, uint16_t);" + "u16vec2 mid3(u16vec2, u16vec2, u16vec2);" + "u16vec3 mid3(u16vec3, u16vec3, u16vec3);" + "u16vec4 mid3(u16vec4, u16vec4, u16vec4);" + "\n" ); } @@ -1384,7 +1421,7 @@ // // Noise functions. // - if (profile != EEsProfile) { + if (spvVersion.spv == 0 && profile != EEsProfile) { commonBuiltins.append( "float noise1(float x);" "float noise1(vec2 x);" @@ -1627,6 +1664,1087 @@ "\n"); } + // GL_KHR_shader_subgroup + if (spvVersion.vulkan > 0) { + commonBuiltins.append( + "void subgroupBarrier();" + "void subgroupMemoryBarrier();" + "void subgroupMemoryBarrierBuffer();" + "void subgroupMemoryBarrierImage();" + "bool subgroupElect();" + + "bool subgroupAll(bool);\n" + "bool subgroupAny(bool);\n" + + "bool subgroupAllEqual(float);\n" + "bool subgroupAllEqual(vec2);\n" + "bool subgroupAllEqual(vec3);\n" + "bool subgroupAllEqual(vec4);\n" + "bool subgroupAllEqual(int);\n" + "bool subgroupAllEqual(ivec2);\n" + "bool subgroupAllEqual(ivec3);\n" + "bool subgroupAllEqual(ivec4);\n" + "bool subgroupAllEqual(uint);\n" + "bool subgroupAllEqual(uvec2);\n" + "bool subgroupAllEqual(uvec3);\n" + "bool subgroupAllEqual(uvec4);\n" + "bool subgroupAllEqual(bool);\n" + "bool subgroupAllEqual(bvec2);\n" + "bool subgroupAllEqual(bvec3);\n" + "bool subgroupAllEqual(bvec4);\n" + + "float subgroupBroadcast(float, uint);\n" + "vec2 subgroupBroadcast(vec2, uint);\n" + "vec3 subgroupBroadcast(vec3, uint);\n" + "vec4 subgroupBroadcast(vec4, uint);\n" + "int subgroupBroadcast(int, uint);\n" + "ivec2 subgroupBroadcast(ivec2, uint);\n" + "ivec3 subgroupBroadcast(ivec3, uint);\n" + "ivec4 subgroupBroadcast(ivec4, uint);\n" + "uint subgroupBroadcast(uint, uint);\n" + "uvec2 subgroupBroadcast(uvec2, uint);\n" + "uvec3 subgroupBroadcast(uvec3, uint);\n" + "uvec4 subgroupBroadcast(uvec4, uint);\n" + "bool subgroupBroadcast(bool, uint);\n" + "bvec2 subgroupBroadcast(bvec2, uint);\n" + "bvec3 subgroupBroadcast(bvec3, uint);\n" + "bvec4 subgroupBroadcast(bvec4, uint);\n" + + "float subgroupBroadcastFirst(float);\n" + "vec2 subgroupBroadcastFirst(vec2);\n" + "vec3 subgroupBroadcastFirst(vec3);\n" + "vec4 subgroupBroadcastFirst(vec4);\n" + "int subgroupBroadcastFirst(int);\n" + "ivec2 subgroupBroadcastFirst(ivec2);\n" + "ivec3 subgroupBroadcastFirst(ivec3);\n" + "ivec4 subgroupBroadcastFirst(ivec4);\n" + "uint subgroupBroadcastFirst(uint);\n" + "uvec2 subgroupBroadcastFirst(uvec2);\n" + "uvec3 subgroupBroadcastFirst(uvec3);\n" + "uvec4 subgroupBroadcastFirst(uvec4);\n" + "bool subgroupBroadcastFirst(bool);\n" + "bvec2 subgroupBroadcastFirst(bvec2);\n" + "bvec3 subgroupBroadcastFirst(bvec3);\n" + "bvec4 subgroupBroadcastFirst(bvec4);\n" + + "uvec4 subgroupBallot(bool);\n" + "bool subgroupInverseBallot(uvec4);\n" + "bool subgroupBallotBitExtract(uvec4, uint);\n" + "uint subgroupBallotBitCount(uvec4);\n" + "uint subgroupBallotInclusiveBitCount(uvec4);\n" + "uint subgroupBallotExclusiveBitCount(uvec4);\n" + "uint subgroupBallotFindLSB(uvec4);\n" + "uint subgroupBallotFindMSB(uvec4);\n" + + "float subgroupShuffle(float, uint);\n" + "vec2 subgroupShuffle(vec2, uint);\n" + "vec3 subgroupShuffle(vec3, uint);\n" + "vec4 subgroupShuffle(vec4, uint);\n" + "int subgroupShuffle(int, uint);\n" + "ivec2 subgroupShuffle(ivec2, uint);\n" + "ivec3 subgroupShuffle(ivec3, uint);\n" + "ivec4 subgroupShuffle(ivec4, uint);\n" + "uint subgroupShuffle(uint, uint);\n" + "uvec2 subgroupShuffle(uvec2, uint);\n" + "uvec3 subgroupShuffle(uvec3, uint);\n" + "uvec4 subgroupShuffle(uvec4, uint);\n" + "bool subgroupShuffle(bool, uint);\n" + "bvec2 subgroupShuffle(bvec2, uint);\n" + "bvec3 subgroupShuffle(bvec3, uint);\n" + "bvec4 subgroupShuffle(bvec4, uint);\n" + + "float subgroupShuffleXor(float, uint);\n" + "vec2 subgroupShuffleXor(vec2, uint);\n" + "vec3 subgroupShuffleXor(vec3, uint);\n" + "vec4 subgroupShuffleXor(vec4, uint);\n" + "int subgroupShuffleXor(int, uint);\n" + "ivec2 subgroupShuffleXor(ivec2, uint);\n" + "ivec3 subgroupShuffleXor(ivec3, uint);\n" + "ivec4 subgroupShuffleXor(ivec4, uint);\n" + "uint subgroupShuffleXor(uint, uint);\n" + "uvec2 subgroupShuffleXor(uvec2, uint);\n" + "uvec3 subgroupShuffleXor(uvec3, uint);\n" + "uvec4 subgroupShuffleXor(uvec4, uint);\n" + "bool subgroupShuffleXor(bool, uint);\n" + "bvec2 subgroupShuffleXor(bvec2, uint);\n" + "bvec3 subgroupShuffleXor(bvec3, uint);\n" + "bvec4 subgroupShuffleXor(bvec4, uint);\n" + + "float subgroupShuffleUp(float, uint delta);\n" + "vec2 subgroupShuffleUp(vec2, uint delta);\n" + "vec3 subgroupShuffleUp(vec3, uint delta);\n" + "vec4 subgroupShuffleUp(vec4, uint delta);\n" + "int subgroupShuffleUp(int, uint delta);\n" + "ivec2 subgroupShuffleUp(ivec2, uint delta);\n" + "ivec3 subgroupShuffleUp(ivec3, uint delta);\n" + "ivec4 subgroupShuffleUp(ivec4, uint delta);\n" + "uint subgroupShuffleUp(uint, uint delta);\n" + "uvec2 subgroupShuffleUp(uvec2, uint delta);\n" + "uvec3 subgroupShuffleUp(uvec3, uint delta);\n" + "uvec4 subgroupShuffleUp(uvec4, uint delta);\n" + "bool subgroupShuffleUp(bool, uint delta);\n" + "bvec2 subgroupShuffleUp(bvec2, uint delta);\n" + "bvec3 subgroupShuffleUp(bvec3, uint delta);\n" + "bvec4 subgroupShuffleUp(bvec4, uint delta);\n" + + "float subgroupShuffleDown(float, uint delta);\n" + "vec2 subgroupShuffleDown(vec2, uint delta);\n" + "vec3 subgroupShuffleDown(vec3, uint delta);\n" + "vec4 subgroupShuffleDown(vec4, uint delta);\n" + "int subgroupShuffleDown(int, uint delta);\n" + "ivec2 subgroupShuffleDown(ivec2, uint delta);\n" + "ivec3 subgroupShuffleDown(ivec3, uint delta);\n" + "ivec4 subgroupShuffleDown(ivec4, uint delta);\n" + "uint subgroupShuffleDown(uint, uint delta);\n" + "uvec2 subgroupShuffleDown(uvec2, uint delta);\n" + "uvec3 subgroupShuffleDown(uvec3, uint delta);\n" + "uvec4 subgroupShuffleDown(uvec4, uint delta);\n" + "bool subgroupShuffleDown(bool, uint delta);\n" + "bvec2 subgroupShuffleDown(bvec2, uint delta);\n" + "bvec3 subgroupShuffleDown(bvec3, uint delta);\n" + "bvec4 subgroupShuffleDown(bvec4, uint delta);\n" + + "float subgroupAdd(float);\n" + "vec2 subgroupAdd(vec2);\n" + "vec3 subgroupAdd(vec3);\n" + "vec4 subgroupAdd(vec4);\n" + "int subgroupAdd(int);\n" + "ivec2 subgroupAdd(ivec2);\n" + "ivec3 subgroupAdd(ivec3);\n" + "ivec4 subgroupAdd(ivec4);\n" + "uint subgroupAdd(uint);\n" + "uvec2 subgroupAdd(uvec2);\n" + "uvec3 subgroupAdd(uvec3);\n" + "uvec4 subgroupAdd(uvec4);\n" + + "float subgroupMul(float);\n" + "vec2 subgroupMul(vec2);\n" + "vec3 subgroupMul(vec3);\n" + "vec4 subgroupMul(vec4);\n" + "int subgroupMul(int);\n" + "ivec2 subgroupMul(ivec2);\n" + "ivec3 subgroupMul(ivec3);\n" + "ivec4 subgroupMul(ivec4);\n" + "uint subgroupMul(uint);\n" + "uvec2 subgroupMul(uvec2);\n" + "uvec3 subgroupMul(uvec3);\n" + "uvec4 subgroupMul(uvec4);\n" + + "float subgroupMin(float);\n" + "vec2 subgroupMin(vec2);\n" + "vec3 subgroupMin(vec3);\n" + "vec4 subgroupMin(vec4);\n" + "int subgroupMin(int);\n" + "ivec2 subgroupMin(ivec2);\n" + "ivec3 subgroupMin(ivec3);\n" + "ivec4 subgroupMin(ivec4);\n" + "uint subgroupMin(uint);\n" + "uvec2 subgroupMin(uvec2);\n" + "uvec3 subgroupMin(uvec3);\n" + "uvec4 subgroupMin(uvec4);\n" + + "float subgroupMax(float);\n" + "vec2 subgroupMax(vec2);\n" + "vec3 subgroupMax(vec3);\n" + "vec4 subgroupMax(vec4);\n" + "int subgroupMax(int);\n" + "ivec2 subgroupMax(ivec2);\n" + "ivec3 subgroupMax(ivec3);\n" + "ivec4 subgroupMax(ivec4);\n" + "uint subgroupMax(uint);\n" + "uvec2 subgroupMax(uvec2);\n" + "uvec3 subgroupMax(uvec3);\n" + "uvec4 subgroupMax(uvec4);\n" + + "int subgroupAnd(int);\n" + "ivec2 subgroupAnd(ivec2);\n" + "ivec3 subgroupAnd(ivec3);\n" + "ivec4 subgroupAnd(ivec4);\n" + "uint subgroupAnd(uint);\n" + "uvec2 subgroupAnd(uvec2);\n" + "uvec3 subgroupAnd(uvec3);\n" + "uvec4 subgroupAnd(uvec4);\n" + "bool subgroupAnd(bool);\n" + "bvec2 subgroupAnd(bvec2);\n" + "bvec3 subgroupAnd(bvec3);\n" + "bvec4 subgroupAnd(bvec4);\n" + + "int subgroupOr(int);\n" + "ivec2 subgroupOr(ivec2);\n" + "ivec3 subgroupOr(ivec3);\n" + "ivec4 subgroupOr(ivec4);\n" + "uint subgroupOr(uint);\n" + "uvec2 subgroupOr(uvec2);\n" + "uvec3 subgroupOr(uvec3);\n" + "uvec4 subgroupOr(uvec4);\n" + "bool subgroupOr(bool);\n" + "bvec2 subgroupOr(bvec2);\n" + "bvec3 subgroupOr(bvec3);\n" + "bvec4 subgroupOr(bvec4);\n" + + "int subgroupXor(int);\n" + "ivec2 subgroupXor(ivec2);\n" + "ivec3 subgroupXor(ivec3);\n" + "ivec4 subgroupXor(ivec4);\n" + "uint subgroupXor(uint);\n" + "uvec2 subgroupXor(uvec2);\n" + "uvec3 subgroupXor(uvec3);\n" + "uvec4 subgroupXor(uvec4);\n" + "bool subgroupXor(bool);\n" + "bvec2 subgroupXor(bvec2);\n" + "bvec3 subgroupXor(bvec3);\n" + "bvec4 subgroupXor(bvec4);\n" + + "float subgroupInclusiveAdd(float);\n" + "vec2 subgroupInclusiveAdd(vec2);\n" + "vec3 subgroupInclusiveAdd(vec3);\n" + "vec4 subgroupInclusiveAdd(vec4);\n" + "int subgroupInclusiveAdd(int);\n" + "ivec2 subgroupInclusiveAdd(ivec2);\n" + "ivec3 subgroupInclusiveAdd(ivec3);\n" + "ivec4 subgroupInclusiveAdd(ivec4);\n" + "uint subgroupInclusiveAdd(uint);\n" + "uvec2 subgroupInclusiveAdd(uvec2);\n" + "uvec3 subgroupInclusiveAdd(uvec3);\n" + "uvec4 subgroupInclusiveAdd(uvec4);\n" + + "float subgroupInclusiveMul(float);\n" + "vec2 subgroupInclusiveMul(vec2);\n" + "vec3 subgroupInclusiveMul(vec3);\n" + "vec4 subgroupInclusiveMul(vec4);\n" + "int subgroupInclusiveMul(int);\n" + "ivec2 subgroupInclusiveMul(ivec2);\n" + "ivec3 subgroupInclusiveMul(ivec3);\n" + "ivec4 subgroupInclusiveMul(ivec4);\n" + "uint subgroupInclusiveMul(uint);\n" + "uvec2 subgroupInclusiveMul(uvec2);\n" + "uvec3 subgroupInclusiveMul(uvec3);\n" + "uvec4 subgroupInclusiveMul(uvec4);\n" + + "float subgroupInclusiveMin(float);\n" + "vec2 subgroupInclusiveMin(vec2);\n" + "vec3 subgroupInclusiveMin(vec3);\n" + "vec4 subgroupInclusiveMin(vec4);\n" + "int subgroupInclusiveMin(int);\n" + "ivec2 subgroupInclusiveMin(ivec2);\n" + "ivec3 subgroupInclusiveMin(ivec3);\n" + "ivec4 subgroupInclusiveMin(ivec4);\n" + "uint subgroupInclusiveMin(uint);\n" + "uvec2 subgroupInclusiveMin(uvec2);\n" + "uvec3 subgroupInclusiveMin(uvec3);\n" + "uvec4 subgroupInclusiveMin(uvec4);\n" + + "float subgroupInclusiveMax(float);\n" + "vec2 subgroupInclusiveMax(vec2);\n" + "vec3 subgroupInclusiveMax(vec3);\n" + "vec4 subgroupInclusiveMax(vec4);\n" + "int subgroupInclusiveMax(int);\n" + "ivec2 subgroupInclusiveMax(ivec2);\n" + "ivec3 subgroupInclusiveMax(ivec3);\n" + "ivec4 subgroupInclusiveMax(ivec4);\n" + "uint subgroupInclusiveMax(uint);\n" + "uvec2 subgroupInclusiveMax(uvec2);\n" + "uvec3 subgroupInclusiveMax(uvec3);\n" + "uvec4 subgroupInclusiveMax(uvec4);\n" + + "int subgroupInclusiveAnd(int);\n" + "ivec2 subgroupInclusiveAnd(ivec2);\n" + "ivec3 subgroupInclusiveAnd(ivec3);\n" + "ivec4 subgroupInclusiveAnd(ivec4);\n" + "uint subgroupInclusiveAnd(uint);\n" + "uvec2 subgroupInclusiveAnd(uvec2);\n" + "uvec3 subgroupInclusiveAnd(uvec3);\n" + "uvec4 subgroupInclusiveAnd(uvec4);\n" + "bool subgroupInclusiveAnd(bool);\n" + "bvec2 subgroupInclusiveAnd(bvec2);\n" + "bvec3 subgroupInclusiveAnd(bvec3);\n" + "bvec4 subgroupInclusiveAnd(bvec4);\n" + + "int subgroupInclusiveOr(int);\n" + "ivec2 subgroupInclusiveOr(ivec2);\n" + "ivec3 subgroupInclusiveOr(ivec3);\n" + "ivec4 subgroupInclusiveOr(ivec4);\n" + "uint subgroupInclusiveOr(uint);\n" + "uvec2 subgroupInclusiveOr(uvec2);\n" + "uvec3 subgroupInclusiveOr(uvec3);\n" + "uvec4 subgroupInclusiveOr(uvec4);\n" + "bool subgroupInclusiveOr(bool);\n" + "bvec2 subgroupInclusiveOr(bvec2);\n" + "bvec3 subgroupInclusiveOr(bvec3);\n" + "bvec4 subgroupInclusiveOr(bvec4);\n" + + "int subgroupInclusiveXor(int);\n" + "ivec2 subgroupInclusiveXor(ivec2);\n" + "ivec3 subgroupInclusiveXor(ivec3);\n" + "ivec4 subgroupInclusiveXor(ivec4);\n" + "uint subgroupInclusiveXor(uint);\n" + "uvec2 subgroupInclusiveXor(uvec2);\n" + "uvec3 subgroupInclusiveXor(uvec3);\n" + "uvec4 subgroupInclusiveXor(uvec4);\n" + "bool subgroupInclusiveXor(bool);\n" + "bvec2 subgroupInclusiveXor(bvec2);\n" + "bvec3 subgroupInclusiveXor(bvec3);\n" + "bvec4 subgroupInclusiveXor(bvec4);\n" + + "float subgroupExclusiveAdd(float);\n" + "vec2 subgroupExclusiveAdd(vec2);\n" + "vec3 subgroupExclusiveAdd(vec3);\n" + "vec4 subgroupExclusiveAdd(vec4);\n" + "int subgroupExclusiveAdd(int);\n" + "ivec2 subgroupExclusiveAdd(ivec2);\n" + "ivec3 subgroupExclusiveAdd(ivec3);\n" + "ivec4 subgroupExclusiveAdd(ivec4);\n" + "uint subgroupExclusiveAdd(uint);\n" + "uvec2 subgroupExclusiveAdd(uvec2);\n" + "uvec3 subgroupExclusiveAdd(uvec3);\n" + "uvec4 subgroupExclusiveAdd(uvec4);\n" + + "float subgroupExclusiveMul(float);\n" + "vec2 subgroupExclusiveMul(vec2);\n" + "vec3 subgroupExclusiveMul(vec3);\n" + "vec4 subgroupExclusiveMul(vec4);\n" + "int subgroupExclusiveMul(int);\n" + "ivec2 subgroupExclusiveMul(ivec2);\n" + "ivec3 subgroupExclusiveMul(ivec3);\n" + "ivec4 subgroupExclusiveMul(ivec4);\n" + "uint subgroupExclusiveMul(uint);\n" + "uvec2 subgroupExclusiveMul(uvec2);\n" + "uvec3 subgroupExclusiveMul(uvec3);\n" + "uvec4 subgroupExclusiveMul(uvec4);\n" + + "float subgroupExclusiveMin(float);\n" + "vec2 subgroupExclusiveMin(vec2);\n" + "vec3 subgroupExclusiveMin(vec3);\n" + "vec4 subgroupExclusiveMin(vec4);\n" + "int subgroupExclusiveMin(int);\n" + "ivec2 subgroupExclusiveMin(ivec2);\n" + "ivec3 subgroupExclusiveMin(ivec3);\n" + "ivec4 subgroupExclusiveMin(ivec4);\n" + "uint subgroupExclusiveMin(uint);\n" + "uvec2 subgroupExclusiveMin(uvec2);\n" + "uvec3 subgroupExclusiveMin(uvec3);\n" + "uvec4 subgroupExclusiveMin(uvec4);\n" + + "float subgroupExclusiveMax(float);\n" + "vec2 subgroupExclusiveMax(vec2);\n" + "vec3 subgroupExclusiveMax(vec3);\n" + "vec4 subgroupExclusiveMax(vec4);\n" + "int subgroupExclusiveMax(int);\n" + "ivec2 subgroupExclusiveMax(ivec2);\n" + "ivec3 subgroupExclusiveMax(ivec3);\n" + "ivec4 subgroupExclusiveMax(ivec4);\n" + "uint subgroupExclusiveMax(uint);\n" + "uvec2 subgroupExclusiveMax(uvec2);\n" + "uvec3 subgroupExclusiveMax(uvec3);\n" + "uvec4 subgroupExclusiveMax(uvec4);\n" + + "int subgroupExclusiveAnd(int);\n" + "ivec2 subgroupExclusiveAnd(ivec2);\n" + "ivec3 subgroupExclusiveAnd(ivec3);\n" + "ivec4 subgroupExclusiveAnd(ivec4);\n" + "uint subgroupExclusiveAnd(uint);\n" + "uvec2 subgroupExclusiveAnd(uvec2);\n" + "uvec3 subgroupExclusiveAnd(uvec3);\n" + "uvec4 subgroupExclusiveAnd(uvec4);\n" + "bool subgroupExclusiveAnd(bool);\n" + "bvec2 subgroupExclusiveAnd(bvec2);\n" + "bvec3 subgroupExclusiveAnd(bvec3);\n" + "bvec4 subgroupExclusiveAnd(bvec4);\n" + + "int subgroupExclusiveOr(int);\n" + "ivec2 subgroupExclusiveOr(ivec2);\n" + "ivec3 subgroupExclusiveOr(ivec3);\n" + "ivec4 subgroupExclusiveOr(ivec4);\n" + "uint subgroupExclusiveOr(uint);\n" + "uvec2 subgroupExclusiveOr(uvec2);\n" + "uvec3 subgroupExclusiveOr(uvec3);\n" + "uvec4 subgroupExclusiveOr(uvec4);\n" + "bool subgroupExclusiveOr(bool);\n" + "bvec2 subgroupExclusiveOr(bvec2);\n" + "bvec3 subgroupExclusiveOr(bvec3);\n" + "bvec4 subgroupExclusiveOr(bvec4);\n" + + "int subgroupExclusiveXor(int);\n" + "ivec2 subgroupExclusiveXor(ivec2);\n" + "ivec3 subgroupExclusiveXor(ivec3);\n" + "ivec4 subgroupExclusiveXor(ivec4);\n" + "uint subgroupExclusiveXor(uint);\n" + "uvec2 subgroupExclusiveXor(uvec2);\n" + "uvec3 subgroupExclusiveXor(uvec3);\n" + "uvec4 subgroupExclusiveXor(uvec4);\n" + "bool subgroupExclusiveXor(bool);\n" + "bvec2 subgroupExclusiveXor(bvec2);\n" + "bvec3 subgroupExclusiveXor(bvec3);\n" + "bvec4 subgroupExclusiveXor(bvec4);\n" + + "float subgroupClusteredAdd(float, uint);\n" + "vec2 subgroupClusteredAdd(vec2, uint);\n" + "vec3 subgroupClusteredAdd(vec3, uint);\n" + "vec4 subgroupClusteredAdd(vec4, uint);\n" + "int subgroupClusteredAdd(int, uint);\n" + "ivec2 subgroupClusteredAdd(ivec2, uint);\n" + "ivec3 subgroupClusteredAdd(ivec3, uint);\n" + "ivec4 subgroupClusteredAdd(ivec4, uint);\n" + "uint subgroupClusteredAdd(uint, uint);\n" + "uvec2 subgroupClusteredAdd(uvec2, uint);\n" + "uvec3 subgroupClusteredAdd(uvec3, uint);\n" + "uvec4 subgroupClusteredAdd(uvec4, uint);\n" + + "float subgroupClusteredMul(float, uint);\n" + "vec2 subgroupClusteredMul(vec2, uint);\n" + "vec3 subgroupClusteredMul(vec3, uint);\n" + "vec4 subgroupClusteredMul(vec4, uint);\n" + "int subgroupClusteredMul(int, uint);\n" + "ivec2 subgroupClusteredMul(ivec2, uint);\n" + "ivec3 subgroupClusteredMul(ivec3, uint);\n" + "ivec4 subgroupClusteredMul(ivec4, uint);\n" + "uint subgroupClusteredMul(uint, uint);\n" + "uvec2 subgroupClusteredMul(uvec2, uint);\n" + "uvec3 subgroupClusteredMul(uvec3, uint);\n" + "uvec4 subgroupClusteredMul(uvec4, uint);\n" + + "float subgroupClusteredMin(float, uint);\n" + "vec2 subgroupClusteredMin(vec2, uint);\n" + "vec3 subgroupClusteredMin(vec3, uint);\n" + "vec4 subgroupClusteredMin(vec4, uint);\n" + "int subgroupClusteredMin(int, uint);\n" + "ivec2 subgroupClusteredMin(ivec2, uint);\n" + "ivec3 subgroupClusteredMin(ivec3, uint);\n" + "ivec4 subgroupClusteredMin(ivec4, uint);\n" + "uint subgroupClusteredMin(uint, uint);\n" + "uvec2 subgroupClusteredMin(uvec2, uint);\n" + "uvec3 subgroupClusteredMin(uvec3, uint);\n" + "uvec4 subgroupClusteredMin(uvec4, uint);\n" + + "float subgroupClusteredMax(float, uint);\n" + "vec2 subgroupClusteredMax(vec2, uint);\n" + "vec3 subgroupClusteredMax(vec3, uint);\n" + "vec4 subgroupClusteredMax(vec4, uint);\n" + "int subgroupClusteredMax(int, uint);\n" + "ivec2 subgroupClusteredMax(ivec2, uint);\n" + "ivec3 subgroupClusteredMax(ivec3, uint);\n" + "ivec4 subgroupClusteredMax(ivec4, uint);\n" + "uint subgroupClusteredMax(uint, uint);\n" + "uvec2 subgroupClusteredMax(uvec2, uint);\n" + "uvec3 subgroupClusteredMax(uvec3, uint);\n" + "uvec4 subgroupClusteredMax(uvec4, uint);\n" + + "int subgroupClusteredAnd(int, uint);\n" + "ivec2 subgroupClusteredAnd(ivec2, uint);\n" + "ivec3 subgroupClusteredAnd(ivec3, uint);\n" + "ivec4 subgroupClusteredAnd(ivec4, uint);\n" + "uint subgroupClusteredAnd(uint, uint);\n" + "uvec2 subgroupClusteredAnd(uvec2, uint);\n" + "uvec3 subgroupClusteredAnd(uvec3, uint);\n" + "uvec4 subgroupClusteredAnd(uvec4, uint);\n" + "bool subgroupClusteredAnd(bool, uint);\n" + "bvec2 subgroupClusteredAnd(bvec2, uint);\n" + "bvec3 subgroupClusteredAnd(bvec3, uint);\n" + "bvec4 subgroupClusteredAnd(bvec4, uint);\n" + + "int subgroupClusteredOr(int, uint);\n" + "ivec2 subgroupClusteredOr(ivec2, uint);\n" + "ivec3 subgroupClusteredOr(ivec3, uint);\n" + "ivec4 subgroupClusteredOr(ivec4, uint);\n" + "uint subgroupClusteredOr(uint, uint);\n" + "uvec2 subgroupClusteredOr(uvec2, uint);\n" + "uvec3 subgroupClusteredOr(uvec3, uint);\n" + "uvec4 subgroupClusteredOr(uvec4, uint);\n" + "bool subgroupClusteredOr(bool, uint);\n" + "bvec2 subgroupClusteredOr(bvec2, uint);\n" + "bvec3 subgroupClusteredOr(bvec3, uint);\n" + "bvec4 subgroupClusteredOr(bvec4, uint);\n" + + "int subgroupClusteredXor(int, uint);\n" + "ivec2 subgroupClusteredXor(ivec2, uint);\n" + "ivec3 subgroupClusteredXor(ivec3, uint);\n" + "ivec4 subgroupClusteredXor(ivec4, uint);\n" + "uint subgroupClusteredXor(uint, uint);\n" + "uvec2 subgroupClusteredXor(uvec2, uint);\n" + "uvec3 subgroupClusteredXor(uvec3, uint);\n" + "uvec4 subgroupClusteredXor(uvec4, uint);\n" + "bool subgroupClusteredXor(bool, uint);\n" + "bvec2 subgroupClusteredXor(bvec2, uint);\n" + "bvec3 subgroupClusteredXor(bvec3, uint);\n" + "bvec4 subgroupClusteredXor(bvec4, uint);\n" + + "float subgroupQuadBroadcast(float, uint);\n" + "vec2 subgroupQuadBroadcast(vec2, uint);\n" + "vec3 subgroupQuadBroadcast(vec3, uint);\n" + "vec4 subgroupQuadBroadcast(vec4, uint);\n" + "int subgroupQuadBroadcast(int, uint);\n" + "ivec2 subgroupQuadBroadcast(ivec2, uint);\n" + "ivec3 subgroupQuadBroadcast(ivec3, uint);\n" + "ivec4 subgroupQuadBroadcast(ivec4, uint);\n" + "uint subgroupQuadBroadcast(uint, uint);\n" + "uvec2 subgroupQuadBroadcast(uvec2, uint);\n" + "uvec3 subgroupQuadBroadcast(uvec3, uint);\n" + "uvec4 subgroupQuadBroadcast(uvec4, uint);\n" + "bool subgroupQuadBroadcast(bool, uint);\n" + "bvec2 subgroupQuadBroadcast(bvec2, uint);\n" + "bvec3 subgroupQuadBroadcast(bvec3, uint);\n" + "bvec4 subgroupQuadBroadcast(bvec4, uint);\n" + + "float subgroupQuadSwapHorizontal(float);\n" + "vec2 subgroupQuadSwapHorizontal(vec2);\n" + "vec3 subgroupQuadSwapHorizontal(vec3);\n" + "vec4 subgroupQuadSwapHorizontal(vec4);\n" + "int subgroupQuadSwapHorizontal(int);\n" + "ivec2 subgroupQuadSwapHorizontal(ivec2);\n" + "ivec3 subgroupQuadSwapHorizontal(ivec3);\n" + "ivec4 subgroupQuadSwapHorizontal(ivec4);\n" + "uint subgroupQuadSwapHorizontal(uint);\n" + "uvec2 subgroupQuadSwapHorizontal(uvec2);\n" + "uvec3 subgroupQuadSwapHorizontal(uvec3);\n" + "uvec4 subgroupQuadSwapHorizontal(uvec4);\n" + "bool subgroupQuadSwapHorizontal(bool);\n" + "bvec2 subgroupQuadSwapHorizontal(bvec2);\n" + "bvec3 subgroupQuadSwapHorizontal(bvec3);\n" + "bvec4 subgroupQuadSwapHorizontal(bvec4);\n" + + "float subgroupQuadSwapVertical(float);\n" + "vec2 subgroupQuadSwapVertical(vec2);\n" + "vec3 subgroupQuadSwapVertical(vec3);\n" + "vec4 subgroupQuadSwapVertical(vec4);\n" + "int subgroupQuadSwapVertical(int);\n" + "ivec2 subgroupQuadSwapVertical(ivec2);\n" + "ivec3 subgroupQuadSwapVertical(ivec3);\n" + "ivec4 subgroupQuadSwapVertical(ivec4);\n" + "uint subgroupQuadSwapVertical(uint);\n" + "uvec2 subgroupQuadSwapVertical(uvec2);\n" + "uvec3 subgroupQuadSwapVertical(uvec3);\n" + "uvec4 subgroupQuadSwapVertical(uvec4);\n" + "bool subgroupQuadSwapVertical(bool);\n" + "bvec2 subgroupQuadSwapVertical(bvec2);\n" + "bvec3 subgroupQuadSwapVertical(bvec3);\n" + "bvec4 subgroupQuadSwapVertical(bvec4);\n" + + "float subgroupQuadSwapDiagonal(float);\n" + "vec2 subgroupQuadSwapDiagonal(vec2);\n" + "vec3 subgroupQuadSwapDiagonal(vec3);\n" + "vec4 subgroupQuadSwapDiagonal(vec4);\n" + "int subgroupQuadSwapDiagonal(int);\n" + "ivec2 subgroupQuadSwapDiagonal(ivec2);\n" + "ivec3 subgroupQuadSwapDiagonal(ivec3);\n" + "ivec4 subgroupQuadSwapDiagonal(ivec4);\n" + "uint subgroupQuadSwapDiagonal(uint);\n" + "uvec2 subgroupQuadSwapDiagonal(uvec2);\n" + "uvec3 subgroupQuadSwapDiagonal(uvec3);\n" + "uvec4 subgroupQuadSwapDiagonal(uvec4);\n" + "bool subgroupQuadSwapDiagonal(bool);\n" + "bvec2 subgroupQuadSwapDiagonal(bvec2);\n" + "bvec3 subgroupQuadSwapDiagonal(bvec3);\n" + "bvec4 subgroupQuadSwapDiagonal(bvec4);\n" + +#ifdef NV_EXTENSIONS + "uvec4 subgroupPartitionNV(float);\n" + "uvec4 subgroupPartitionNV(vec2);\n" + "uvec4 subgroupPartitionNV(vec3);\n" + "uvec4 subgroupPartitionNV(vec4);\n" + "uvec4 subgroupPartitionNV(int);\n" + "uvec4 subgroupPartitionNV(ivec2);\n" + "uvec4 subgroupPartitionNV(ivec3);\n" + "uvec4 subgroupPartitionNV(ivec4);\n" + "uvec4 subgroupPartitionNV(uint);\n" + "uvec4 subgroupPartitionNV(uvec2);\n" + "uvec4 subgroupPartitionNV(uvec3);\n" + "uvec4 subgroupPartitionNV(uvec4);\n" + "uvec4 subgroupPartitionNV(bool);\n" + "uvec4 subgroupPartitionNV(bvec2);\n" + "uvec4 subgroupPartitionNV(bvec3);\n" + "uvec4 subgroupPartitionNV(bvec4);\n" + + "float subgroupPartitionedAddNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedAddNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedAddNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedAddNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedAddNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedAddNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedAddNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedAddNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedAddNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedAddNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedAddNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedAddNV(uvec4, uvec4 ballot);\n" + + "float subgroupPartitionedMulNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedMulNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedMulNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedMulNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedMulNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedMulNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedMulNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedMulNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedMulNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedMulNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedMulNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedMulNV(uvec4, uvec4 ballot);\n" + + "float subgroupPartitionedMinNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedMinNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedMinNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedMinNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedMinNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedMinNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedMinNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedMinNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedMinNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedMinNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedMinNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedMinNV(uvec4, uvec4 ballot);\n" + + "float subgroupPartitionedMaxNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedMaxNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedMaxNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedMaxNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedMaxNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedMaxNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedMaxNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedMaxNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedMaxNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedMaxNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedMaxNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedMaxNV(uvec4, uvec4 ballot);\n" + + "int subgroupPartitionedAndNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedAndNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedAndNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedAndNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedAndNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedAndNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedAndNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedAndNV(uvec4, uvec4 ballot);\n" + "bool subgroupPartitionedAndNV(bool, uvec4 ballot);\n" + "bvec2 subgroupPartitionedAndNV(bvec2, uvec4 ballot);\n" + "bvec3 subgroupPartitionedAndNV(bvec3, uvec4 ballot);\n" + "bvec4 subgroupPartitionedAndNV(bvec4, uvec4 ballot);\n" + + "int subgroupPartitionedOrNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedOrNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedOrNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedOrNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedOrNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedOrNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedOrNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedOrNV(uvec4, uvec4 ballot);\n" + "bool subgroupPartitionedOrNV(bool, uvec4 ballot);\n" + "bvec2 subgroupPartitionedOrNV(bvec2, uvec4 ballot);\n" + "bvec3 subgroupPartitionedOrNV(bvec3, uvec4 ballot);\n" + "bvec4 subgroupPartitionedOrNV(bvec4, uvec4 ballot);\n" + + "int subgroupPartitionedXorNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedXorNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedXorNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedXorNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedXorNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedXorNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedXorNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedXorNV(uvec4, uvec4 ballot);\n" + "bool subgroupPartitionedXorNV(bool, uvec4 ballot);\n" + "bvec2 subgroupPartitionedXorNV(bvec2, uvec4 ballot);\n" + "bvec3 subgroupPartitionedXorNV(bvec3, uvec4 ballot);\n" + "bvec4 subgroupPartitionedXorNV(bvec4, uvec4 ballot);\n" + + "float subgroupPartitionedInclusiveAddNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedInclusiveAddNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedInclusiveAddNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedInclusiveAddNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedInclusiveAddNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedInclusiveAddNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedInclusiveAddNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedInclusiveAddNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedInclusiveAddNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedInclusiveAddNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedInclusiveAddNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedInclusiveAddNV(uvec4, uvec4 ballot);\n" + + "float subgroupPartitionedInclusiveMulNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedInclusiveMulNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedInclusiveMulNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedInclusiveMulNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedInclusiveMulNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedInclusiveMulNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedInclusiveMulNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedInclusiveMulNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedInclusiveMulNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedInclusiveMulNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedInclusiveMulNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedInclusiveMulNV(uvec4, uvec4 ballot);\n" + + "float subgroupPartitionedInclusiveMinNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedInclusiveMinNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedInclusiveMinNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedInclusiveMinNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedInclusiveMinNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedInclusiveMinNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedInclusiveMinNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedInclusiveMinNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedInclusiveMinNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedInclusiveMinNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedInclusiveMinNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedInclusiveMinNV(uvec4, uvec4 ballot);\n" + + "float subgroupPartitionedInclusiveMaxNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedInclusiveMaxNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedInclusiveMaxNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedInclusiveMaxNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedInclusiveMaxNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedInclusiveMaxNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedInclusiveMaxNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedInclusiveMaxNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedInclusiveMaxNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedInclusiveMaxNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedInclusiveMaxNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedInclusiveMaxNV(uvec4, uvec4 ballot);\n" + + "int subgroupPartitionedInclusiveAndNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedInclusiveAndNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedInclusiveAndNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedInclusiveAndNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedInclusiveAndNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedInclusiveAndNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedInclusiveAndNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedInclusiveAndNV(uvec4, uvec4 ballot);\n" + "bool subgroupPartitionedInclusiveAndNV(bool, uvec4 ballot);\n" + "bvec2 subgroupPartitionedInclusiveAndNV(bvec2, uvec4 ballot);\n" + "bvec3 subgroupPartitionedInclusiveAndNV(bvec3, uvec4 ballot);\n" + "bvec4 subgroupPartitionedInclusiveAndNV(bvec4, uvec4 ballot);\n" + + "int subgroupPartitionedInclusiveOrNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedInclusiveOrNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedInclusiveOrNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedInclusiveOrNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedInclusiveOrNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedInclusiveOrNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedInclusiveOrNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedInclusiveOrNV(uvec4, uvec4 ballot);\n" + "bool subgroupPartitionedInclusiveOrNV(bool, uvec4 ballot);\n" + "bvec2 subgroupPartitionedInclusiveOrNV(bvec2, uvec4 ballot);\n" + "bvec3 subgroupPartitionedInclusiveOrNV(bvec3, uvec4 ballot);\n" + "bvec4 subgroupPartitionedInclusiveOrNV(bvec4, uvec4 ballot);\n" + + "int subgroupPartitionedInclusiveXorNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedInclusiveXorNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedInclusiveXorNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedInclusiveXorNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedInclusiveXorNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedInclusiveXorNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedInclusiveXorNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedInclusiveXorNV(uvec4, uvec4 ballot);\n" + "bool subgroupPartitionedInclusiveXorNV(bool, uvec4 ballot);\n" + "bvec2 subgroupPartitionedInclusiveXorNV(bvec2, uvec4 ballot);\n" + "bvec3 subgroupPartitionedInclusiveXorNV(bvec3, uvec4 ballot);\n" + "bvec4 subgroupPartitionedInclusiveXorNV(bvec4, uvec4 ballot);\n" + + "float subgroupPartitionedExclusiveAddNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedExclusiveAddNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedExclusiveAddNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedExclusiveAddNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedExclusiveAddNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedExclusiveAddNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedExclusiveAddNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedExclusiveAddNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedExclusiveAddNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedExclusiveAddNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedExclusiveAddNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedExclusiveAddNV(uvec4, uvec4 ballot);\n" + + "float subgroupPartitionedExclusiveMulNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedExclusiveMulNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedExclusiveMulNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedExclusiveMulNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedExclusiveMulNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedExclusiveMulNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedExclusiveMulNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedExclusiveMulNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedExclusiveMulNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedExclusiveMulNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedExclusiveMulNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedExclusiveMulNV(uvec4, uvec4 ballot);\n" + + "float subgroupPartitionedExclusiveMinNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedExclusiveMinNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedExclusiveMinNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedExclusiveMinNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedExclusiveMinNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedExclusiveMinNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedExclusiveMinNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedExclusiveMinNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedExclusiveMinNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedExclusiveMinNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedExclusiveMinNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedExclusiveMinNV(uvec4, uvec4 ballot);\n" + + "float subgroupPartitionedExclusiveMaxNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedExclusiveMaxNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedExclusiveMaxNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedExclusiveMaxNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedExclusiveMaxNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedExclusiveMaxNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedExclusiveMaxNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedExclusiveMaxNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedExclusiveMaxNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedExclusiveMaxNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedExclusiveMaxNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedExclusiveMaxNV(uvec4, uvec4 ballot);\n" + + "int subgroupPartitionedExclusiveAndNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedExclusiveAndNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedExclusiveAndNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedExclusiveAndNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedExclusiveAndNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedExclusiveAndNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedExclusiveAndNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedExclusiveAndNV(uvec4, uvec4 ballot);\n" + "bool subgroupPartitionedExclusiveAndNV(bool, uvec4 ballot);\n" + "bvec2 subgroupPartitionedExclusiveAndNV(bvec2, uvec4 ballot);\n" + "bvec3 subgroupPartitionedExclusiveAndNV(bvec3, uvec4 ballot);\n" + "bvec4 subgroupPartitionedExclusiveAndNV(bvec4, uvec4 ballot);\n" + + "int subgroupPartitionedExclusiveOrNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedExclusiveOrNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedExclusiveOrNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedExclusiveOrNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedExclusiveOrNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedExclusiveOrNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedExclusiveOrNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedExclusiveOrNV(uvec4, uvec4 ballot);\n" + "bool subgroupPartitionedExclusiveOrNV(bool, uvec4 ballot);\n" + "bvec2 subgroupPartitionedExclusiveOrNV(bvec2, uvec4 ballot);\n" + "bvec3 subgroupPartitionedExclusiveOrNV(bvec3, uvec4 ballot);\n" + "bvec4 subgroupPartitionedExclusiveOrNV(bvec4, uvec4 ballot);\n" + + "int subgroupPartitionedExclusiveXorNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedExclusiveXorNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedExclusiveXorNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedExclusiveXorNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedExclusiveXorNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedExclusiveXorNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedExclusiveXorNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedExclusiveXorNV(uvec4, uvec4 ballot);\n" + "bool subgroupPartitionedExclusiveXorNV(bool, uvec4 ballot);\n" + "bvec2 subgroupPartitionedExclusiveXorNV(bvec2, uvec4 ballot);\n" + "bvec3 subgroupPartitionedExclusiveXorNV(bvec3, uvec4 ballot);\n" + "bvec4 subgroupPartitionedExclusiveXorNV(bvec4, uvec4 ballot);\n" +#endif + + "\n"); + + if (profile != EEsProfile && version >= 400) { + commonBuiltins.append( + "bool subgroupAllEqual(double);\n" + "bool subgroupAllEqual(dvec2);\n" + "bool subgroupAllEqual(dvec3);\n" + "bool subgroupAllEqual(dvec4);\n" + + "double subgroupBroadcast(double, uint);\n" + "dvec2 subgroupBroadcast(dvec2, uint);\n" + "dvec3 subgroupBroadcast(dvec3, uint);\n" + "dvec4 subgroupBroadcast(dvec4, uint);\n" + + "double subgroupBroadcastFirst(double);\n" + "dvec2 subgroupBroadcastFirst(dvec2);\n" + "dvec3 subgroupBroadcastFirst(dvec3);\n" + "dvec4 subgroupBroadcastFirst(dvec4);\n" + + "double subgroupShuffle(double, uint);\n" + "dvec2 subgroupShuffle(dvec2, uint);\n" + "dvec3 subgroupShuffle(dvec3, uint);\n" + "dvec4 subgroupShuffle(dvec4, uint);\n" + + "double subgroupShuffleXor(double, uint);\n" + "dvec2 subgroupShuffleXor(dvec2, uint);\n" + "dvec3 subgroupShuffleXor(dvec3, uint);\n" + "dvec4 subgroupShuffleXor(dvec4, uint);\n" + + "double subgroupShuffleUp(double, uint delta);\n" + "dvec2 subgroupShuffleUp(dvec2, uint delta);\n" + "dvec3 subgroupShuffleUp(dvec3, uint delta);\n" + "dvec4 subgroupShuffleUp(dvec4, uint delta);\n" + + "double subgroupShuffleDown(double, uint delta);\n" + "dvec2 subgroupShuffleDown(dvec2, uint delta);\n" + "dvec3 subgroupShuffleDown(dvec3, uint delta);\n" + "dvec4 subgroupShuffleDown(dvec4, uint delta);\n" + + "double subgroupAdd(double);\n" + "dvec2 subgroupAdd(dvec2);\n" + "dvec3 subgroupAdd(dvec3);\n" + "dvec4 subgroupAdd(dvec4);\n" + + "double subgroupMul(double);\n" + "dvec2 subgroupMul(dvec2);\n" + "dvec3 subgroupMul(dvec3);\n" + "dvec4 subgroupMul(dvec4);\n" + + "double subgroupMin(double);\n" + "dvec2 subgroupMin(dvec2);\n" + "dvec3 subgroupMin(dvec3);\n" + "dvec4 subgroupMin(dvec4);\n" + + "double subgroupMax(double);\n" + "dvec2 subgroupMax(dvec2);\n" + "dvec3 subgroupMax(dvec3);\n" + "dvec4 subgroupMax(dvec4);\n" + + "double subgroupInclusiveAdd(double);\n" + "dvec2 subgroupInclusiveAdd(dvec2);\n" + "dvec3 subgroupInclusiveAdd(dvec3);\n" + "dvec4 subgroupInclusiveAdd(dvec4);\n" + + "double subgroupInclusiveMul(double);\n" + "dvec2 subgroupInclusiveMul(dvec2);\n" + "dvec3 subgroupInclusiveMul(dvec3);\n" + "dvec4 subgroupInclusiveMul(dvec4);\n" + + "double subgroupInclusiveMin(double);\n" + "dvec2 subgroupInclusiveMin(dvec2);\n" + "dvec3 subgroupInclusiveMin(dvec3);\n" + "dvec4 subgroupInclusiveMin(dvec4);\n" + + "double subgroupInclusiveMax(double);\n" + "dvec2 subgroupInclusiveMax(dvec2);\n" + "dvec3 subgroupInclusiveMax(dvec3);\n" + "dvec4 subgroupInclusiveMax(dvec4);\n" + + "double subgroupExclusiveAdd(double);\n" + "dvec2 subgroupExclusiveAdd(dvec2);\n" + "dvec3 subgroupExclusiveAdd(dvec3);\n" + "dvec4 subgroupExclusiveAdd(dvec4);\n" + + "double subgroupExclusiveMul(double);\n" + "dvec2 subgroupExclusiveMul(dvec2);\n" + "dvec3 subgroupExclusiveMul(dvec3);\n" + "dvec4 subgroupExclusiveMul(dvec4);\n" + + "double subgroupExclusiveMin(double);\n" + "dvec2 subgroupExclusiveMin(dvec2);\n" + "dvec3 subgroupExclusiveMin(dvec3);\n" + "dvec4 subgroupExclusiveMin(dvec4);\n" + + "double subgroupExclusiveMax(double);\n" + "dvec2 subgroupExclusiveMax(dvec2);\n" + "dvec3 subgroupExclusiveMax(dvec3);\n" + "dvec4 subgroupExclusiveMax(dvec4);\n" + + "double subgroupClusteredAdd(double, uint);\n" + "dvec2 subgroupClusteredAdd(dvec2, uint);\n" + "dvec3 subgroupClusteredAdd(dvec3, uint);\n" + "dvec4 subgroupClusteredAdd(dvec4, uint);\n" + + "double subgroupClusteredMul(double, uint);\n" + "dvec2 subgroupClusteredMul(dvec2, uint);\n" + "dvec3 subgroupClusteredMul(dvec3, uint);\n" + "dvec4 subgroupClusteredMul(dvec4, uint);\n" + + "double subgroupClusteredMin(double, uint);\n" + "dvec2 subgroupClusteredMin(dvec2, uint);\n" + "dvec3 subgroupClusteredMin(dvec3, uint);\n" + "dvec4 subgroupClusteredMin(dvec4, uint);\n" + + "double subgroupClusteredMax(double, uint);\n" + "dvec2 subgroupClusteredMax(dvec2, uint);\n" + "dvec3 subgroupClusteredMax(dvec3, uint);\n" + "dvec4 subgroupClusteredMax(dvec4, uint);\n" + + "double subgroupQuadBroadcast(double, uint);\n" + "dvec2 subgroupQuadBroadcast(dvec2, uint);\n" + "dvec3 subgroupQuadBroadcast(dvec3, uint);\n" + "dvec4 subgroupQuadBroadcast(dvec4, uint);\n" + + "double subgroupQuadSwapHorizontal(double);\n" + "dvec2 subgroupQuadSwapHorizontal(dvec2);\n" + "dvec3 subgroupQuadSwapHorizontal(dvec3);\n" + "dvec4 subgroupQuadSwapHorizontal(dvec4);\n" + + "double subgroupQuadSwapVertical(double);\n" + "dvec2 subgroupQuadSwapVertical(dvec2);\n" + "dvec3 subgroupQuadSwapVertical(dvec3);\n" + "dvec4 subgroupQuadSwapVertical(dvec4);\n" + + "double subgroupQuadSwapDiagonal(double);\n" + "dvec2 subgroupQuadSwapDiagonal(dvec2);\n" + "dvec3 subgroupQuadSwapDiagonal(dvec3);\n" + "dvec4 subgroupQuadSwapDiagonal(dvec4);\n" + + +#ifdef NV_EXTENSIONS + "uvec4 subgroupPartitionNV(double);\n" + "uvec4 subgroupPartitionNV(dvec2);\n" + "uvec4 subgroupPartitionNV(dvec3);\n" + "uvec4 subgroupPartitionNV(dvec4);\n" + + "double subgroupPartitionedAddNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedAddNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedAddNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedAddNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedMulNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedMulNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedMulNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedMulNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedMinNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedMinNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedMinNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedMinNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedMaxNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedMaxNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedMaxNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedMaxNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedInclusiveAddNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedInclusiveAddNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedInclusiveAddNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedInclusiveAddNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedInclusiveMulNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedInclusiveMulNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedInclusiveMulNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedInclusiveMulNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedInclusiveMinNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedInclusiveMinNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedInclusiveMinNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedInclusiveMinNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedInclusiveMaxNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedInclusiveMaxNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedInclusiveMaxNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedInclusiveMaxNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedExclusiveAddNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedExclusiveAddNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedExclusiveAddNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedExclusiveAddNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedExclusiveMulNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedExclusiveMulNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedExclusiveMulNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedExclusiveMulNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedExclusiveMinNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedExclusiveMinNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedExclusiveMinNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedExclusiveMinNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedExclusiveMaxNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedExclusiveMaxNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedExclusiveMaxNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedExclusiveMaxNV(dvec4, uvec4 ballot);\n" +#endif + + "\n"); + } + + stageBuiltins[EShLangCompute].append( + "void subgroupMemoryBarrierShared();" + + "\n" + ); + } + if (profile != EEsProfile && version >= 460) { commonBuiltins.append( "bool anyInvocation(bool);" @@ -1675,6 +2793,16 @@ "f16vec3 minInvocationsAMD(f16vec3);" "f16vec4 minInvocationsAMD(f16vec4);" + "int16_t minInvocationsAMD(int16_t);" + "i16vec2 minInvocationsAMD(i16vec2);" + "i16vec3 minInvocationsAMD(i16vec3);" + "i16vec4 minInvocationsAMD(i16vec4);" + + "uint16_t minInvocationsAMD(uint16_t);" + "u16vec2 minInvocationsAMD(u16vec2);" + "u16vec3 minInvocationsAMD(u16vec3);" + "u16vec4 minInvocationsAMD(u16vec4);" + "float minInvocationsInclusiveScanAMD(float);" "vec2 minInvocationsInclusiveScanAMD(vec2);" "vec3 minInvocationsInclusiveScanAMD(vec3);" @@ -1710,6 +2838,16 @@ "f16vec3 minInvocationsInclusiveScanAMD(f16vec3);" "f16vec4 minInvocationsInclusiveScanAMD(f16vec4);" + "int16_t minInvocationsInclusiveScanAMD(int16_t);" + "i16vec2 minInvocationsInclusiveScanAMD(i16vec2);" + "i16vec3 minInvocationsInclusiveScanAMD(i16vec3);" + "i16vec4 minInvocationsInclusiveScanAMD(i16vec4);" + + "uint16_t minInvocationsInclusiveScanAMD(uint16_t);" + "u16vec2 minInvocationsInclusiveScanAMD(u16vec2);" + "u16vec3 minInvocationsInclusiveScanAMD(u16vec3);" + "u16vec4 minInvocationsInclusiveScanAMD(u16vec4);" + "float minInvocationsExclusiveScanAMD(float);" "vec2 minInvocationsExclusiveScanAMD(vec2);" "vec3 minInvocationsExclusiveScanAMD(vec3);" @@ -1745,6 +2883,16 @@ "f16vec3 minInvocationsExclusiveScanAMD(f16vec3);" "f16vec4 minInvocationsExclusiveScanAMD(f16vec4);" + "int16_t minInvocationsExclusiveScanAMD(int16_t);" + "i16vec2 minInvocationsExclusiveScanAMD(i16vec2);" + "i16vec3 minInvocationsExclusiveScanAMD(i16vec3);" + "i16vec4 minInvocationsExclusiveScanAMD(i16vec4);" + + "uint16_t minInvocationsExclusiveScanAMD(uint16_t);" + "u16vec2 minInvocationsExclusiveScanAMD(u16vec2);" + "u16vec3 minInvocationsExclusiveScanAMD(u16vec3);" + "u16vec4 minInvocationsExclusiveScanAMD(u16vec4);" + "float maxInvocationsAMD(float);" "vec2 maxInvocationsAMD(vec2);" "vec3 maxInvocationsAMD(vec3);" @@ -1780,6 +2928,16 @@ "f16vec3 maxInvocationsAMD(f16vec3);" "f16vec4 maxInvocationsAMD(f16vec4);" + "int16_t maxInvocationsAMD(int16_t);" + "i16vec2 maxInvocationsAMD(i16vec2);" + "i16vec3 maxInvocationsAMD(i16vec3);" + "i16vec4 maxInvocationsAMD(i16vec4);" + + "uint16_t maxInvocationsAMD(uint16_t);" + "u16vec2 maxInvocationsAMD(u16vec2);" + "u16vec3 maxInvocationsAMD(u16vec3);" + "u16vec4 maxInvocationsAMD(u16vec4);" + "float maxInvocationsInclusiveScanAMD(float);" "vec2 maxInvocationsInclusiveScanAMD(vec2);" "vec3 maxInvocationsInclusiveScanAMD(vec3);" @@ -1815,6 +2973,16 @@ "f16vec3 maxInvocationsInclusiveScanAMD(f16vec3);" "f16vec4 maxInvocationsInclusiveScanAMD(f16vec4);" + "int16_t maxInvocationsInclusiveScanAMD(int16_t);" + "i16vec2 maxInvocationsInclusiveScanAMD(i16vec2);" + "i16vec3 maxInvocationsInclusiveScanAMD(i16vec3);" + "i16vec4 maxInvocationsInclusiveScanAMD(i16vec4);" + + "uint16_t maxInvocationsInclusiveScanAMD(uint16_t);" + "u16vec2 maxInvocationsInclusiveScanAMD(u16vec2);" + "u16vec3 maxInvocationsInclusiveScanAMD(u16vec3);" + "u16vec4 maxInvocationsInclusiveScanAMD(u16vec4);" + "float maxInvocationsExclusiveScanAMD(float);" "vec2 maxInvocationsExclusiveScanAMD(vec2);" "vec3 maxInvocationsExclusiveScanAMD(vec3);" @@ -1850,6 +3018,16 @@ "f16vec3 maxInvocationsExclusiveScanAMD(f16vec3);" "f16vec4 maxInvocationsExclusiveScanAMD(f16vec4);" + "int16_t maxInvocationsExclusiveScanAMD(int16_t);" + "i16vec2 maxInvocationsExclusiveScanAMD(i16vec2);" + "i16vec3 maxInvocationsExclusiveScanAMD(i16vec3);" + "i16vec4 maxInvocationsExclusiveScanAMD(i16vec4);" + + "uint16_t maxInvocationsExclusiveScanAMD(uint16_t);" + "u16vec2 maxInvocationsExclusiveScanAMD(u16vec2);" + "u16vec3 maxInvocationsExclusiveScanAMD(u16vec3);" + "u16vec4 maxInvocationsExclusiveScanAMD(u16vec4);" + "float addInvocationsAMD(float);" "vec2 addInvocationsAMD(vec2);" "vec3 addInvocationsAMD(vec3);" @@ -1885,6 +3063,16 @@ "f16vec3 addInvocationsAMD(f16vec3);" "f16vec4 addInvocationsAMD(f16vec4);" + "int16_t addInvocationsAMD(int16_t);" + "i16vec2 addInvocationsAMD(i16vec2);" + "i16vec3 addInvocationsAMD(i16vec3);" + "i16vec4 addInvocationsAMD(i16vec4);" + + "uint16_t addInvocationsAMD(uint16_t);" + "u16vec2 addInvocationsAMD(u16vec2);" + "u16vec3 addInvocationsAMD(u16vec3);" + "u16vec4 addInvocationsAMD(u16vec4);" + "float addInvocationsInclusiveScanAMD(float);" "vec2 addInvocationsInclusiveScanAMD(vec2);" "vec3 addInvocationsInclusiveScanAMD(vec3);" @@ -1920,6 +3108,16 @@ "f16vec3 addInvocationsInclusiveScanAMD(f16vec3);" "f16vec4 addInvocationsInclusiveScanAMD(f16vec4);" + "int16_t addInvocationsInclusiveScanAMD(int16_t);" + "i16vec2 addInvocationsInclusiveScanAMD(i16vec2);" + "i16vec3 addInvocationsInclusiveScanAMD(i16vec3);" + "i16vec4 addInvocationsInclusiveScanAMD(i16vec4);" + + "uint16_t addInvocationsInclusiveScanAMD(uint16_t);" + "u16vec2 addInvocationsInclusiveScanAMD(u16vec2);" + "u16vec3 addInvocationsInclusiveScanAMD(u16vec3);" + "u16vec4 addInvocationsInclusiveScanAMD(u16vec4);" + "float addInvocationsExclusiveScanAMD(float);" "vec2 addInvocationsExclusiveScanAMD(vec2);" "vec3 addInvocationsExclusiveScanAMD(vec3);" @@ -1955,6 +3153,16 @@ "f16vec3 addInvocationsExclusiveScanAMD(f16vec3);" "f16vec4 addInvocationsExclusiveScanAMD(f16vec4);" + "int16_t addInvocationsExclusiveScanAMD(int16_t);" + "i16vec2 addInvocationsExclusiveScanAMD(i16vec2);" + "i16vec3 addInvocationsExclusiveScanAMD(i16vec3);" + "i16vec4 addInvocationsExclusiveScanAMD(i16vec4);" + + "uint16_t addInvocationsExclusiveScanAMD(uint16_t);" + "u16vec2 addInvocationsExclusiveScanAMD(u16vec2);" + "u16vec3 addInvocationsExclusiveScanAMD(u16vec3);" + "u16vec4 addInvocationsExclusiveScanAMD(u16vec4);" + "float minInvocationsNonUniformAMD(float);" "vec2 minInvocationsNonUniformAMD(vec2);" "vec3 minInvocationsNonUniformAMD(vec3);" @@ -1990,6 +3198,16 @@ "f16vec3 minInvocationsNonUniformAMD(f16vec3);" "f16vec4 minInvocationsNonUniformAMD(f16vec4);" + "int16_t minInvocationsNonUniformAMD(int16_t);" + "i16vec2 minInvocationsNonUniformAMD(i16vec2);" + "i16vec3 minInvocationsNonUniformAMD(i16vec3);" + "i16vec4 minInvocationsNonUniformAMD(i16vec4);" + + "uint16_t minInvocationsNonUniformAMD(uint16_t);" + "u16vec2 minInvocationsNonUniformAMD(u16vec2);" + "u16vec3 minInvocationsNonUniformAMD(u16vec3);" + "u16vec4 minInvocationsNonUniformAMD(u16vec4);" + "float minInvocationsInclusiveScanNonUniformAMD(float);" "vec2 minInvocationsInclusiveScanNonUniformAMD(vec2);" "vec3 minInvocationsInclusiveScanNonUniformAMD(vec3);" @@ -2025,6 +3243,16 @@ "f16vec3 minInvocationsInclusiveScanNonUniformAMD(f16vec3);" "f16vec4 minInvocationsInclusiveScanNonUniformAMD(f16vec4);" + "int16_t minInvocationsInclusiveScanNonUniformAMD(int16_t);" + "i16vec2 minInvocationsInclusiveScanNonUniformAMD(i16vec2);" + "i16vec3 minInvocationsInclusiveScanNonUniformAMD(i16vec3);" + "i16vec4 minInvocationsInclusiveScanNonUniformAMD(i16vec4);" + + "uint16_t minInvocationsInclusiveScanNonUniformAMD(uint16_t);" + "u16vec2 minInvocationsInclusiveScanNonUniformAMD(u16vec2);" + "u16vec3 minInvocationsInclusiveScanNonUniformAMD(u16vec3);" + "u16vec4 minInvocationsInclusiveScanNonUniformAMD(u16vec4);" + "float minInvocationsExclusiveScanNonUniformAMD(float);" "vec2 minInvocationsExclusiveScanNonUniformAMD(vec2);" "vec3 minInvocationsExclusiveScanNonUniformAMD(vec3);" @@ -2060,6 +3288,16 @@ "f16vec3 minInvocationsExclusiveScanNonUniformAMD(f16vec3);" "f16vec4 minInvocationsExclusiveScanNonUniformAMD(f16vec4);" + "int16_t minInvocationsExclusiveScanNonUniformAMD(int16_t);" + "i16vec2 minInvocationsExclusiveScanNonUniformAMD(i16vec2);" + "i16vec3 minInvocationsExclusiveScanNonUniformAMD(i16vec3);" + "i16vec4 minInvocationsExclusiveScanNonUniformAMD(i16vec4);" + + "uint16_t minInvocationsExclusiveScanNonUniformAMD(uint16_t);" + "u16vec2 minInvocationsExclusiveScanNonUniformAMD(u16vec2);" + "u16vec3 minInvocationsExclusiveScanNonUniformAMD(u16vec3);" + "u16vec4 minInvocationsExclusiveScanNonUniformAMD(u16vec4);" + "float maxInvocationsNonUniformAMD(float);" "vec2 maxInvocationsNonUniformAMD(vec2);" "vec3 maxInvocationsNonUniformAMD(vec3);" @@ -2095,6 +3333,16 @@ "f16vec3 maxInvocationsNonUniformAMD(f16vec3);" "f16vec4 maxInvocationsNonUniformAMD(f16vec4);" + "int16_t maxInvocationsNonUniformAMD(int16_t);" + "i16vec2 maxInvocationsNonUniformAMD(i16vec2);" + "i16vec3 maxInvocationsNonUniformAMD(i16vec3);" + "i16vec4 maxInvocationsNonUniformAMD(i16vec4);" + + "uint16_t maxInvocationsNonUniformAMD(uint16_t);" + "u16vec2 maxInvocationsNonUniformAMD(u16vec2);" + "u16vec3 maxInvocationsNonUniformAMD(u16vec3);" + "u16vec4 maxInvocationsNonUniformAMD(u16vec4);" + "float maxInvocationsInclusiveScanNonUniformAMD(float);" "vec2 maxInvocationsInclusiveScanNonUniformAMD(vec2);" "vec3 maxInvocationsInclusiveScanNonUniformAMD(vec3);" @@ -2130,6 +3378,16 @@ "f16vec3 maxInvocationsInclusiveScanNonUniformAMD(f16vec3);" "f16vec4 maxInvocationsInclusiveScanNonUniformAMD(f16vec4);" + "int16_t maxInvocationsInclusiveScanNonUniformAMD(int16_t);" + "i16vec2 maxInvocationsInclusiveScanNonUniformAMD(i16vec2);" + "i16vec3 maxInvocationsInclusiveScanNonUniformAMD(i16vec3);" + "i16vec4 maxInvocationsInclusiveScanNonUniformAMD(i16vec4);" + + "uint16_t maxInvocationsInclusiveScanNonUniformAMD(uint16_t);" + "u16vec2 maxInvocationsInclusiveScanNonUniformAMD(u16vec2);" + "u16vec3 maxInvocationsInclusiveScanNonUniformAMD(u16vec3);" + "u16vec4 maxInvocationsInclusiveScanNonUniformAMD(u16vec4);" + "float maxInvocationsExclusiveScanNonUniformAMD(float);" "vec2 maxInvocationsExclusiveScanNonUniformAMD(vec2);" "vec3 maxInvocationsExclusiveScanNonUniformAMD(vec3);" @@ -2165,6 +3423,16 @@ "f16vec3 maxInvocationsExclusiveScanNonUniformAMD(f16vec3);" "f16vec4 maxInvocationsExclusiveScanNonUniformAMD(f16vec4);" + "int16_t maxInvocationsExclusiveScanNonUniformAMD(int16_t);" + "i16vec2 maxInvocationsExclusiveScanNonUniformAMD(i16vec2);" + "i16vec3 maxInvocationsExclusiveScanNonUniformAMD(i16vec3);" + "i16vec4 maxInvocationsExclusiveScanNonUniformAMD(i16vec4);" + + "uint16_t maxInvocationsExclusiveScanNonUniformAMD(uint16_t);" + "u16vec2 maxInvocationsExclusiveScanNonUniformAMD(u16vec2);" + "u16vec3 maxInvocationsExclusiveScanNonUniformAMD(u16vec3);" + "u16vec4 maxInvocationsExclusiveScanNonUniformAMD(u16vec4);" + "float addInvocationsNonUniformAMD(float);" "vec2 addInvocationsNonUniformAMD(vec2);" "vec3 addInvocationsNonUniformAMD(vec3);" @@ -2200,6 +3468,16 @@ "f16vec3 addInvocationsNonUniformAMD(f16vec3);" "f16vec4 addInvocationsNonUniformAMD(f16vec4);" + "int16_t addInvocationsNonUniformAMD(int16_t);" + "i16vec2 addInvocationsNonUniformAMD(i16vec2);" + "i16vec3 addInvocationsNonUniformAMD(i16vec3);" + "i16vec4 addInvocationsNonUniformAMD(i16vec4);" + + "uint16_t addInvocationsNonUniformAMD(uint16_t);" + "u16vec2 addInvocationsNonUniformAMD(u16vec2);" + "u16vec3 addInvocationsNonUniformAMD(u16vec3);" + "u16vec4 addInvocationsNonUniformAMD(u16vec4);" + "float addInvocationsInclusiveScanNonUniformAMD(float);" "vec2 addInvocationsInclusiveScanNonUniformAMD(vec2);" "vec3 addInvocationsInclusiveScanNonUniformAMD(vec3);" @@ -2235,6 +3513,16 @@ "f16vec3 addInvocationsInclusiveScanNonUniformAMD(f16vec3);" "f16vec4 addInvocationsInclusiveScanNonUniformAMD(f16vec4);" + "int16_t addInvocationsInclusiveScanNonUniformAMD(int16_t);" + "i16vec2 addInvocationsInclusiveScanNonUniformAMD(i16vec2);" + "i16vec3 addInvocationsInclusiveScanNonUniformAMD(i16vec3);" + "i16vec4 addInvocationsInclusiveScanNonUniformAMD(i16vec4);" + + "uint16_t addInvocationsInclusiveScanNonUniformAMD(uint16_t);" + "u16vec2 addInvocationsInclusiveScanNonUniformAMD(u16vec2);" + "u16vec3 addInvocationsInclusiveScanNonUniformAMD(u16vec3);" + "u16vec4 addInvocationsInclusiveScanNonUniformAMD(u16vec4);" + "float addInvocationsExclusiveScanNonUniformAMD(float);" "vec2 addInvocationsExclusiveScanNonUniformAMD(vec2);" "vec3 addInvocationsExclusiveScanNonUniformAMD(vec3);" @@ -2270,6 +3558,16 @@ "f16vec3 addInvocationsExclusiveScanNonUniformAMD(f16vec3);" "f16vec4 addInvocationsExclusiveScanNonUniformAMD(f16vec4);" + "int16_t addInvocationsExclusiveScanNonUniformAMD(int16_t);" + "i16vec2 addInvocationsExclusiveScanNonUniformAMD(i16vec2);" + "i16vec3 addInvocationsExclusiveScanNonUniformAMD(i16vec3);" + "i16vec4 addInvocationsExclusiveScanNonUniformAMD(i16vec4);" + + "uint16_t addInvocationsExclusiveScanNonUniformAMD(uint16_t);" + "u16vec2 addInvocationsExclusiveScanNonUniformAMD(u16vec2);" + "u16vec3 addInvocationsExclusiveScanNonUniformAMD(u16vec3);" + "u16vec4 addInvocationsExclusiveScanNonUniformAMD(u16vec4);" + "float swizzleInvocationsAMD(float, uvec4);" "vec2 swizzleInvocationsAMD(vec2, uvec4);" "vec3 swizzleInvocationsAMD(vec3, uvec4);" @@ -2330,7 +3628,31 @@ "\n"); } - // GL_AMD_gpu_shader_half_float + // GL_AMD_shader_fragment_mask + if (profile != EEsProfile && version >= 450) { + commonBuiltins.append( + "uint fragmentMaskFetchAMD(sampler2DMS, ivec2);" + "uint fragmentMaskFetchAMD(isampler2DMS, ivec2);" + "uint fragmentMaskFetchAMD(usampler2DMS, ivec2);" + + "uint fragmentMaskFetchAMD(sampler2DMSArray, ivec3);" + "uint fragmentMaskFetchAMD(isampler2DMSArray, ivec3);" + "uint fragmentMaskFetchAMD(usampler2DMSArray, ivec3);" + + "vec4 fragmentFetchAMD(sampler2DMS, ivec2, uint);" + "ivec4 fragmentFetchAMD(isampler2DMS, ivec2, uint);" + "uvec4 fragmentFetchAMD(usampler2DMS, ivec2, uint);" + + "vec4 fragmentFetchAMD(sampler2DMSArray, ivec3, uint);" + "ivec4 fragmentFetchAMD(isampler2DMSArray, ivec3, uint);" + "uvec4 fragmentFetchAMD(usampler2DMSArray, ivec3, uint);" + + "\n"); + } + +#endif // AMD_EXTENSIONS + + // GL_AMD_gpu_shader_half_float/Explicit types if (profile != EEsProfile && version >= 450) { commonBuiltins.append( "float16_t radians(float16_t);" @@ -2678,9 +4000,168 @@ "\n"); } - // GL_AMD_gpu_shader_int16 + // Explicit types if (profile != EEsProfile && version >= 450) { commonBuiltins.append( + "int8_t abs(int8_t);" + "i8vec2 abs(i8vec2);" + "i8vec3 abs(i8vec3);" + "i8vec4 abs(i8vec4);" + + "int8_t sign(int8_t);" + "i8vec2 sign(i8vec2);" + "i8vec3 sign(i8vec3);" + "i8vec4 sign(i8vec4);" + + "int8_t min(int8_t x, int8_t y);" + "i8vec2 min(i8vec2 x, int8_t y);" + "i8vec3 min(i8vec3 x, int8_t y);" + "i8vec4 min(i8vec4 x, int8_t y);" + "i8vec2 min(i8vec2 x, i8vec2 y);" + "i8vec3 min(i8vec3 x, i8vec3 y);" + "i8vec4 min(i8vec4 x, i8vec4 y);" + + "uint8_t min(uint8_t x, uint8_t y);" + "u8vec2 min(u8vec2 x, uint8_t y);" + "u8vec3 min(u8vec3 x, uint8_t y);" + "u8vec4 min(u8vec4 x, uint8_t y);" + "u8vec2 min(u8vec2 x, u8vec2 y);" + "u8vec3 min(u8vec3 x, u8vec3 y);" + "u8vec4 min(u8vec4 x, u8vec4 y);" + + "int8_t max(int8_t x, int8_t y);" + "i8vec2 max(i8vec2 x, int8_t y);" + "i8vec3 max(i8vec3 x, int8_t y);" + "i8vec4 max(i8vec4 x, int8_t y);" + "i8vec2 max(i8vec2 x, i8vec2 y);" + "i8vec3 max(i8vec3 x, i8vec3 y);" + "i8vec4 max(i8vec4 x, i8vec4 y);" + + "uint8_t max(uint8_t x, uint8_t y);" + "u8vec2 max(u8vec2 x, uint8_t y);" + "u8vec3 max(u8vec3 x, uint8_t y);" + "u8vec4 max(u8vec4 x, uint8_t y);" + "u8vec2 max(u8vec2 x, u8vec2 y);" + "u8vec3 max(u8vec3 x, u8vec3 y);" + "u8vec4 max(u8vec4 x, u8vec4 y);" + + "int8_t clamp(int8_t x, int8_t minVal, int8_t maxVal);" + "i8vec2 clamp(i8vec2 x, int8_t minVal, int8_t maxVal);" + "i8vec3 clamp(i8vec3 x, int8_t minVal, int8_t maxVal);" + "i8vec4 clamp(i8vec4 x, int8_t minVal, int8_t maxVal);" + "i8vec2 clamp(i8vec2 x, i8vec2 minVal, i8vec2 maxVal);" + "i8vec3 clamp(i8vec3 x, i8vec3 minVal, i8vec3 maxVal);" + "i8vec4 clamp(i8vec4 x, i8vec4 minVal, i8vec4 maxVal);" + + "uint8_t clamp(uint8_t x, uint8_t minVal, uint8_t maxVal);" + "u8vec2 clamp(u8vec2 x, uint8_t minVal, uint8_t maxVal);" + "u8vec3 clamp(u8vec3 x, uint8_t minVal, uint8_t maxVal);" + "u8vec4 clamp(u8vec4 x, uint8_t minVal, uint8_t maxVal);" + "u8vec2 clamp(u8vec2 x, u8vec2 minVal, u8vec2 maxVal);" + "u8vec3 clamp(u8vec3 x, u8vec3 minVal, u8vec3 maxVal);" + "u8vec4 clamp(u8vec4 x, u8vec4 minVal, u8vec4 maxVal);" + + "int8_t mix(int8_t, int8_t, bool);" + "i8vec2 mix(i8vec2, i8vec2, bvec2);" + "i8vec3 mix(i8vec3, i8vec3, bvec3);" + "i8vec4 mix(i8vec4, i8vec4, bvec4);" + "uint8_t mix(uint8_t, uint8_t, bool);" + "u8vec2 mix(u8vec2, u8vec2, bvec2);" + "u8vec3 mix(u8vec3, u8vec3, bvec3);" + "u8vec4 mix(u8vec4, u8vec4, bvec4);" + + "bvec2 lessThan(i8vec2, i8vec2);" + "bvec3 lessThan(i8vec3, i8vec3);" + "bvec4 lessThan(i8vec4, i8vec4);" + "bvec2 lessThan(u8vec2, u8vec2);" + "bvec3 lessThan(u8vec3, u8vec3);" + "bvec4 lessThan(u8vec4, u8vec4);" + + "bvec2 lessThanEqual(i8vec2, i8vec2);" + "bvec3 lessThanEqual(i8vec3, i8vec3);" + "bvec4 lessThanEqual(i8vec4, i8vec4);" + "bvec2 lessThanEqual(u8vec2, u8vec2);" + "bvec3 lessThanEqual(u8vec3, u8vec3);" + "bvec4 lessThanEqual(u8vec4, u8vec4);" + + "bvec2 greaterThan(i8vec2, i8vec2);" + "bvec3 greaterThan(i8vec3, i8vec3);" + "bvec4 greaterThan(i8vec4, i8vec4);" + "bvec2 greaterThan(u8vec2, u8vec2);" + "bvec3 greaterThan(u8vec3, u8vec3);" + "bvec4 greaterThan(u8vec4, u8vec4);" + + "bvec2 greaterThanEqual(i8vec2, i8vec2);" + "bvec3 greaterThanEqual(i8vec3, i8vec3);" + "bvec4 greaterThanEqual(i8vec4, i8vec4);" + "bvec2 greaterThanEqual(u8vec2, u8vec2);" + "bvec3 greaterThanEqual(u8vec3, u8vec3);" + "bvec4 greaterThanEqual(u8vec4, u8vec4);" + + "bvec2 equal(i8vec2, i8vec2);" + "bvec3 equal(i8vec3, i8vec3);" + "bvec4 equal(i8vec4, i8vec4);" + "bvec2 equal(u8vec2, u8vec2);" + "bvec3 equal(u8vec3, u8vec3);" + "bvec4 equal(u8vec4, u8vec4);" + + "bvec2 notEqual(i8vec2, i8vec2);" + "bvec3 notEqual(i8vec3, i8vec3);" + "bvec4 notEqual(i8vec4, i8vec4);" + "bvec2 notEqual(u8vec2, u8vec2);" + "bvec3 notEqual(u8vec3, u8vec3);" + "bvec4 notEqual(u8vec4, u8vec4);" + + " int8_t bitfieldExtract( int8_t, int8_t, int8_t);" + "i8vec2 bitfieldExtract(i8vec2, int8_t, int8_t);" + "i8vec3 bitfieldExtract(i8vec3, int8_t, int8_t);" + "i8vec4 bitfieldExtract(i8vec4, int8_t, int8_t);" + + " uint8_t bitfieldExtract( uint8_t, int8_t, int8_t);" + "u8vec2 bitfieldExtract(u8vec2, int8_t, int8_t);" + "u8vec3 bitfieldExtract(u8vec3, int8_t, int8_t);" + "u8vec4 bitfieldExtract(u8vec4, int8_t, int8_t);" + + " int8_t bitfieldInsert( int8_t base, int8_t, int8_t, int8_t);" + "i8vec2 bitfieldInsert(i8vec2 base, i8vec2, int8_t, int8_t);" + "i8vec3 bitfieldInsert(i8vec3 base, i8vec3, int8_t, int8_t);" + "i8vec4 bitfieldInsert(i8vec4 base, i8vec4, int8_t, int8_t);" + + " uint8_t bitfieldInsert( uint8_t base, uint8_t, int8_t, int8_t);" + "u8vec2 bitfieldInsert(u8vec2 base, u8vec2, int8_t, int8_t);" + "u8vec3 bitfieldInsert(u8vec3 base, u8vec3, int8_t, int8_t);" + "u8vec4 bitfieldInsert(u8vec4 base, u8vec4, int8_t, int8_t);" + + " int8_t bitCount( int8_t);" + "i8vec2 bitCount(i8vec2);" + "i8vec3 bitCount(i8vec3);" + "i8vec4 bitCount(i8vec4);" + + " int8_t bitCount( uint8_t);" + "i8vec2 bitCount(u8vec2);" + "i8vec3 bitCount(u8vec3);" + "i8vec4 bitCount(u8vec4);" + + " int8_t findLSB( int8_t);" + "i8vec2 findLSB(i8vec2);" + "i8vec3 findLSB(i8vec3);" + "i8vec4 findLSB(i8vec4);" + + " int8_t findLSB( uint8_t);" + "i8vec2 findLSB(u8vec2);" + "i8vec3 findLSB(u8vec3);" + "i8vec4 findLSB(u8vec4);" + + " int8_t findMSB( int8_t);" + "i8vec2 findMSB(i8vec2);" + "i8vec3 findMSB(i8vec3);" + "i8vec4 findMSB(i8vec4);" + + " int8_t findMSB( uint8_t);" + "i8vec2 findMSB(u8vec2);" + "i8vec3 findMSB(u8vec3);" + "i8vec4 findMSB(u8vec4);" + "int16_t abs(int16_t);" "i16vec2 abs(i16vec2);" "i16vec3 abs(i16vec3);" @@ -2691,50 +4172,53 @@ "i16vec3 sign(i16vec3);" "i16vec4 sign(i16vec4);" - "int16_t min(int16_t, int16_t);" - "i16vec2 min(i16vec2, int16_t);" - "i16vec3 min(i16vec3, int16_t);" - "i16vec4 min(i16vec4, int16_t);" - "i16vec2 min(i16vec2, i16vec2);" - "i16vec3 min(i16vec3, i16vec3);" - "i16vec4 min(i16vec4, i16vec4);" - "uint16_t min(uint16_t, uint16_t);" - "u16vec2 min(u16vec2, uint16_t);" - "u16vec3 min(u16vec3, uint16_t);" - "u16vec4 min(u16vec4, uint16_t);" - "u16vec2 min(u16vec2, u16vec2);" - "u16vec3 min(u16vec3, u16vec3);" - "u16vec4 min(u16vec4, u16vec4);" - - "int16_t max(int16_t, int16_t);" - "i16vec2 max(i16vec2, int16_t);" - "i16vec3 max(i16vec3, int16_t);" - "i16vec4 max(i16vec4, int16_t);" - "i16vec2 max(i16vec2, i16vec2);" - "i16vec3 max(i16vec3, i16vec3);" - "i16vec4 max(i16vec4, i16vec4);" - "uint16_t max(uint16_t, uint16_t);" - "u16vec2 max(u16vec2, uint16_t);" - "u16vec3 max(u16vec3, uint16_t);" - "u16vec4 max(u16vec4, uint16_t);" - "u16vec2 max(u16vec2, u16vec2);" - "u16vec3 max(u16vec3, u16vec3);" - "u16vec4 max(u16vec4, u16vec4);" - - "int16_t clamp(int16_t, int16_t, int16_t);" - "i16vec2 clamp(i16vec2, int16_t, int16_t);" - "i16vec3 clamp(i16vec3, int16_t, int16_t);" - "i16vec4 clamp(i16vec4, int16_t, int16_t);" - "i16vec2 clamp(i16vec2, i16vec2, i16vec2);" - "i16vec3 clamp(i16vec3, i16vec3, i16vec3);" - "i16vec4 clamp(i16vec4, i16vec4, i16vec4);" - "uint16_t clamp(uint16_t, uint16_t, uint16_t);" - "u16vec2 clamp(u16vec2, uint16_t, uint16_t);" - "u16vec3 clamp(u16vec3, uint16_t, uint16_t);" - "u16vec4 clamp(u16vec4, uint16_t, uint16_t);" - "u16vec2 clamp(u16vec2, u16vec2, u16vec2);" - "u16vec3 clamp(u16vec3, u16vec3, u16vec3);" - "u16vec4 clamp(u16vec4, u16vec4, u16vec4);" + "int16_t min(int16_t x, int16_t y);" + "i16vec2 min(i16vec2 x, int16_t y);" + "i16vec3 min(i16vec3 x, int16_t y);" + "i16vec4 min(i16vec4 x, int16_t y);" + "i16vec2 min(i16vec2 x, i16vec2 y);" + "i16vec3 min(i16vec3 x, i16vec3 y);" + "i16vec4 min(i16vec4 x, i16vec4 y);" + + "uint16_t min(uint16_t x, uint16_t y);" + "u16vec2 min(u16vec2 x, uint16_t y);" + "u16vec3 min(u16vec3 x, uint16_t y);" + "u16vec4 min(u16vec4 x, uint16_t y);" + "u16vec2 min(u16vec2 x, u16vec2 y);" + "u16vec3 min(u16vec3 x, u16vec3 y);" + "u16vec4 min(u16vec4 x, u16vec4 y);" + + "int16_t max(int16_t x, int16_t y);" + "i16vec2 max(i16vec2 x, int16_t y);" + "i16vec3 max(i16vec3 x, int16_t y);" + "i16vec4 max(i16vec4 x, int16_t y);" + "i16vec2 max(i16vec2 x, i16vec2 y);" + "i16vec3 max(i16vec3 x, i16vec3 y);" + "i16vec4 max(i16vec4 x, i16vec4 y);" + + "uint16_t max(uint16_t x, uint16_t y);" + "u16vec2 max(u16vec2 x, uint16_t y);" + "u16vec3 max(u16vec3 x, uint16_t y);" + "u16vec4 max(u16vec4 x, uint16_t y);" + "u16vec2 max(u16vec2 x, u16vec2 y);" + "u16vec3 max(u16vec3 x, u16vec3 y);" + "u16vec4 max(u16vec4 x, u16vec4 y);" + + "int16_t clamp(int16_t x, int16_t minVal, int16_t maxVal);" + "i16vec2 clamp(i16vec2 x, int16_t minVal, int16_t maxVal);" + "i16vec3 clamp(i16vec3 x, int16_t minVal, int16_t maxVal);" + "i16vec4 clamp(i16vec4 x, int16_t minVal, int16_t maxVal);" + "i16vec2 clamp(i16vec2 x, i16vec2 minVal, i16vec2 maxVal);" + "i16vec3 clamp(i16vec3 x, i16vec3 minVal, i16vec3 maxVal);" + "i16vec4 clamp(i16vec4 x, i16vec4 minVal, i16vec4 maxVal);" + + "uint16_t clamp(uint16_t x, uint16_t minVal, uint16_t maxVal);" + "u16vec2 clamp(u16vec2 x, uint16_t minVal, uint16_t maxVal);" + "u16vec3 clamp(u16vec3 x, uint16_t minVal, uint16_t maxVal);" + "u16vec4 clamp(u16vec4 x, uint16_t minVal, uint16_t maxVal);" + "u16vec2 clamp(u16vec2 x, u16vec2 minVal, u16vec2 maxVal);" + "u16vec3 clamp(u16vec3 x, u16vec3 minVal, u16vec3 maxVal);" + "u16vec4 clamp(u16vec4 x, u16vec4 minVal, u16vec4 maxVal);" "int16_t mix(int16_t, int16_t, bool);" "i16vec2 mix(i16vec2, i16vec2, bvec2);" @@ -2755,6 +4239,16 @@ "f16vec3 ldexp(f16vec3, i16vec3);" "f16vec4 ldexp(f16vec4, i16vec4);" + "int16_t halfBitsToInt16(float16_t);" + "i16vec2 halfBitsToInt16(f16vec2);" + "i16vec3 halhBitsToInt16(f16vec3);" + "i16vec4 halfBitsToInt16(f16vec4);" + + "uint16_t halfBitsToUint16(float16_t);" + "u16vec2 halfBitsToUint16(f16vec2);" + "u16vec3 halfBitsToUint16(f16vec3);" + "u16vec4 halfBitsToUint16(f16vec4);" + "int16_t float16BitsToInt16(float16_t);" "i16vec2 float16BitsToInt16(f16vec2);" "i16vec3 float16BitsToInt16(f16vec3);" @@ -2775,6 +4269,16 @@ "f16vec3 uint16BitsToFloat16(u16vec3);" "f16vec4 uint16BitsToFloat16(u16vec4);" + "float16_t int16BitsToHalf(int16_t);" + "f16vec2 int16BitsToHalf(i16vec2);" + "f16vec3 int16BitsToHalf(i16vec3);" + "f16vec4 int16BitsToHalf(i16vec4);" + + "float16_t uint16BitsToHalf(uint16_t);" + "f16vec2 uint16BitsToHalf(u16vec2);" + "f16vec3 uint16BitsToHalf(u16vec3);" + "f16vec4 uint16BitsToHalf(u16vec4);" + "int packInt2x16(i16vec2);" "uint packUint2x16(u16vec2);" "int64_t packInt4x16(i16vec4);" @@ -2826,33 +4330,245 @@ "bvec3 notEqual(u16vec3, u16vec3);" "bvec4 notEqual(u16vec4, u16vec4);" + " int16_t bitfieldExtract( int16_t, int16_t, int16_t);" + "i16vec2 bitfieldExtract(i16vec2, int16_t, int16_t);" + "i16vec3 bitfieldExtract(i16vec3, int16_t, int16_t);" + "i16vec4 bitfieldExtract(i16vec4, int16_t, int16_t);" + + " uint16_t bitfieldExtract( uint16_t, int16_t, int16_t);" + "u16vec2 bitfieldExtract(u16vec2, int16_t, int16_t);" + "u16vec3 bitfieldExtract(u16vec3, int16_t, int16_t);" + "u16vec4 bitfieldExtract(u16vec4, int16_t, int16_t);" + + " int16_t bitfieldInsert( int16_t base, int16_t, int16_t, int16_t);" + "i16vec2 bitfieldInsert(i16vec2 base, i16vec2, int16_t, int16_t);" + "i16vec3 bitfieldInsert(i16vec3 base, i16vec3, int16_t, int16_t);" + "i16vec4 bitfieldInsert(i16vec4 base, i16vec4, int16_t, int16_t);" + + " uint16_t bitfieldInsert( uint16_t base, uint16_t, int16_t, int16_t);" + "u16vec2 bitfieldInsert(u16vec2 base, u16vec2, int16_t, int16_t);" + "u16vec3 bitfieldInsert(u16vec3 base, u16vec3, int16_t, int16_t);" + "u16vec4 bitfieldInsert(u16vec4 base, u16vec4, int16_t, int16_t);" + + " int16_t bitCount( int16_t);" + "i16vec2 bitCount(i16vec2);" + "i16vec3 bitCount(i16vec3);" + "i16vec4 bitCount(i16vec4);" + + " int16_t bitCount( uint16_t);" + "i16vec2 bitCount(u16vec2);" + "i16vec3 bitCount(u16vec3);" + "i16vec4 bitCount(u16vec4);" + + " int16_t findLSB( int16_t);" + "i16vec2 findLSB(i16vec2);" + "i16vec3 findLSB(i16vec3);" + "i16vec4 findLSB(i16vec4);" + + " int16_t findLSB( uint16_t);" + "i16vec2 findLSB(u16vec2);" + "i16vec3 findLSB(u16vec3);" + "i16vec4 findLSB(u16vec4);" + + " int16_t findMSB( int16_t);" + "i16vec2 findMSB(i16vec2);" + "i16vec3 findMSB(i16vec3);" + "i16vec4 findMSB(i16vec4);" + + " int16_t findMSB( uint16_t);" + "i16vec2 findMSB(u16vec2);" + "i16vec3 findMSB(u16vec3);" + "i16vec4 findMSB(u16vec4);" + + "int16_t pack16(i8vec2);" + "uint16_t pack16(u8vec2);" + "int32_t pack32(i8vec4);" + "uint32_t pack32(u8vec4);" + "int32_t pack32(i16vec2);" + "uint32_t pack32(u16vec2);" + "int64_t pack64(i16vec4);" + "uint64_t pack64(u16vec4);" + "int64_t pack64(i32vec2);" + "uint64_t pack64(u32vec2);" + + "i8vec2 unpack8(int16_t);" + "u8vec2 unpack8(uint16_t);" + "i8vec4 unpack8(int32_t);" + "u8vec4 unpack8(uint32_t);" + "i16vec2 unpack16(int32_t);" + "u16vec2 unpack16(uint32_t);" + "i16vec4 unpack16(int64_t);" + "u16vec4 unpack16(uint64_t);" + "i32vec2 unpack32(int64_t);" + "u32vec2 unpack32(uint64_t);" + + "float64_t radians(float64_t);" + "f64vec2 radians(f64vec2);" + "f64vec3 radians(f64vec3);" + "f64vec4 radians(f64vec4);" + + "float64_t degrees(float64_t);" + "f64vec2 degrees(f64vec2);" + "f64vec3 degrees(f64vec3);" + "f64vec4 degrees(f64vec4);" + + "float64_t sin(float64_t);" + "f64vec2 sin(f64vec2);" + "f64vec3 sin(f64vec3);" + "f64vec4 sin(f64vec4);" + + "float64_t cos(float64_t);" + "f64vec2 cos(f64vec2);" + "f64vec3 cos(f64vec3);" + "f64vec4 cos(f64vec4);" + + "float64_t tan(float64_t);" + "f64vec2 tan(f64vec2);" + "f64vec3 tan(f64vec3);" + "f64vec4 tan(f64vec4);" + + "float64_t asin(float64_t);" + "f64vec2 asin(f64vec2);" + "f64vec3 asin(f64vec3);" + "f64vec4 asin(f64vec4);" + + "float64_t acos(float64_t);" + "f64vec2 acos(f64vec2);" + "f64vec3 acos(f64vec3);" + "f64vec4 acos(f64vec4);" + + "float64_t atan(float64_t, float64_t);" + "f64vec2 atan(f64vec2, f64vec2);" + "f64vec3 atan(f64vec3, f64vec3);" + "f64vec4 atan(f64vec4, f64vec4);" + + "float64_t atan(float64_t);" + "f64vec2 atan(f64vec2);" + "f64vec3 atan(f64vec3);" + "f64vec4 atan(f64vec4);" + + "float64_t sinh(float64_t);" + "f64vec2 sinh(f64vec2);" + "f64vec3 sinh(f64vec3);" + "f64vec4 sinh(f64vec4);" + + "float64_t cosh(float64_t);" + "f64vec2 cosh(f64vec2);" + "f64vec3 cosh(f64vec3);" + "f64vec4 cosh(f64vec4);" + + "float64_t tanh(float64_t);" + "f64vec2 tanh(f64vec2);" + "f64vec3 tanh(f64vec3);" + "f64vec4 tanh(f64vec4);" + + "float64_t asinh(float64_t);" + "f64vec2 asinh(f64vec2);" + "f64vec3 asinh(f64vec3);" + "f64vec4 asinh(f64vec4);" + + "float64_t acosh(float64_t);" + "f64vec2 acosh(f64vec2);" + "f64vec3 acosh(f64vec3);" + "f64vec4 acosh(f64vec4);" + + "float64_t atanh(float64_t);" + "f64vec2 atanh(f64vec2);" + "f64vec3 atanh(f64vec3);" + "f64vec4 atanh(f64vec4);" + + "float64_t pow(float64_t, float64_t);" + "f64vec2 pow(f64vec2, f64vec2);" + "f64vec3 pow(f64vec3, f64vec3);" + "f64vec4 pow(f64vec4, f64vec4);" + + "float64_t exp(float64_t);" + "f64vec2 exp(f64vec2);" + "f64vec3 exp(f64vec3);" + "f64vec4 exp(f64vec4);" + + "float64_t log(float64_t);" + "f64vec2 log(f64vec2);" + "f64vec3 log(f64vec3);" + "f64vec4 log(f64vec4);" + + "float64_t exp2(float64_t);" + "f64vec2 exp2(f64vec2);" + "f64vec3 exp2(f64vec3);" + "f64vec4 exp2(f64vec4);" + + "float64_t log2(float64_t);" + "f64vec2 log2(f64vec2);" + "f64vec3 log2(f64vec3);" + "f64vec4 log2(f64vec4);" "\n"); - } - - // GL_AMD_shader_fragment_mask - if (profile != EEsProfile && version >= 450) { - commonBuiltins.append( - "uint fragmentMaskFetchAMD(sampler2DMS, ivec2);" - "uint fragmentMaskFetchAMD(isampler2DMS, ivec2);" - "uint fragmentMaskFetchAMD(usampler2DMS, ivec2);" - - "uint fragmentMaskFetchAMD(sampler2DMSArray, ivec3);" - "uint fragmentMaskFetchAMD(isampler2DMSArray, ivec3);" - "uint fragmentMaskFetchAMD(usampler2DMSArray, ivec3);" - - "vec4 fragmentFetchAMD(sampler2DMS, ivec2, uint);" - "ivec4 fragmentFetchAMD(isampler2DMS, ivec2, uint);" - "uvec4 fragmentFetchAMD(usampler2DMS, ivec2, uint);" + } + if (profile != EEsProfile && version >= 450) { + stageBuiltins[EShLangFragment].append( + "float64_t dFdx(float64_t);" + "f64vec2 dFdx(f64vec2);" + "f64vec3 dFdx(f64vec3);" + "f64vec4 dFdx(f64vec4);" + + "float64_t dFdy(float64_t);" + "f64vec2 dFdy(f64vec2);" + "f64vec3 dFdy(f64vec3);" + "f64vec4 dFdy(f64vec4);" + + "float64_t dFdxFine(float64_t);" + "f64vec2 dFdxFine(f64vec2);" + "f64vec3 dFdxFine(f64vec3);" + "f64vec4 dFdxFine(f64vec4);" + + "float64_t dFdyFine(float64_t);" + "f64vec2 dFdyFine(f64vec2);" + "f64vec3 dFdyFine(f64vec3);" + "f64vec4 dFdyFine(f64vec4);" + + "float64_t dFdxCoarse(float64_t);" + "f64vec2 dFdxCoarse(f64vec2);" + "f64vec3 dFdxCoarse(f64vec3);" + "f64vec4 dFdxCoarse(f64vec4);" + + "float64_t dFdyCoarse(float64_t);" + "f64vec2 dFdyCoarse(f64vec2);" + "f64vec3 dFdyCoarse(f64vec3);" + "f64vec4 dFdyCoarse(f64vec4);" + + "float64_t fwidth(float64_t);" + "f64vec2 fwidth(f64vec2);" + "f64vec3 fwidth(f64vec3);" + "f64vec4 fwidth(f64vec4);" + + "float64_t fwidthFine(float64_t);" + "f64vec2 fwidthFine(f64vec2);" + "f64vec3 fwidthFine(f64vec3);" + "f64vec4 fwidthFine(f64vec4);" + + "float64_t fwidthCoarse(float64_t);" + "f64vec2 fwidthCoarse(f64vec2);" + "f64vec3 fwidthCoarse(f64vec3);" + "f64vec4 fwidthCoarse(f64vec4);" + + "float64_t interpolateAtCentroid(float64_t);" + "f64vec2 interpolateAtCentroid(f64vec2);" + "f64vec3 interpolateAtCentroid(f64vec3);" + "f64vec4 interpolateAtCentroid(f64vec4);" + + "float64_t interpolateAtSample(float64_t, int);" + "f64vec2 interpolateAtSample(f64vec2, int);" + "f64vec3 interpolateAtSample(f64vec3, int);" + "f64vec4 interpolateAtSample(f64vec4, int);" + + "float64_t interpolateAtOffset(float64_t, f64vec2);" + "f64vec2 interpolateAtOffset(f64vec2, f64vec2);" + "f64vec3 interpolateAtOffset(f64vec3, f64vec2);" + "f64vec4 interpolateAtOffset(f64vec4, f64vec2);" - "vec4 fragmentFetchAMD(sampler2DMSArray, ivec3, uint);" - "ivec4 fragmentFetchAMD(isampler2DMSArray, ivec3, uint);" - "uvec4 fragmentFetchAMD(usampler2DMSArray, ivec3, uint);" + "\n"); - "\n"); } -#endif - //============================================================================ // // Prototypes for built-in functions seen by vertex shaders only. @@ -3192,7 +4908,7 @@ } // GL_AMD_shader_fragment_mask - if (profile != EEsProfile && version >= 450 && spvVersion.vulkan >= 100) { + if (profile != EEsProfile && version >= 450 && spvVersion.vulkan > 0) { stageBuiltins[EShLangFragment].append( "uint fragmentMaskFetchAMD(subpassInputMS);" "uint fragmentMaskFetchAMD(isubpassInputMS);" @@ -3491,7 +5207,7 @@ stageBuiltins[EShLangVertex].append( "int gl_InstanceID;" // needs qualifier fixed later ); - if (spvVersion.vulkan >= 100 && version >= 140) + if (spvVersion.vulkan > 0 && version >= 140) stageBuiltins[EShLangVertex].append( "in int gl_VertexIndex;" "in int gl_InstanceIndex;" @@ -3541,7 +5257,7 @@ "in highp int gl_VertexID;" // needs qualifier fixed later "in highp int gl_InstanceID;" // needs qualifier fixed later ); - if (spvVersion.vulkan >= 100) + if (spvVersion.vulkan > 0) stageBuiltins[EShLangVertex].append( "in highp int gl_VertexIndex;" "in highp int gl_InstanceIndex;" @@ -3963,6 +5679,13 @@ "in vec3 gl_BaryCoordPullModelAMD;" ); #endif + +#ifdef NV_EXTENSIONS + if (version >= 430) + stageBuiltins[EShLangFragment].append( + "in bool gl_FragFullyCoveredNV;" + ); +#endif } else { // ES profile @@ -4011,17 +5734,30 @@ // GL_ARB_shader_ballot if (profile != EEsProfile && version >= 450) { - commonBuiltins.append( + const char* ballotDecls = "uniform uint gl_SubGroupSizeARB;" - "in uint gl_SubGroupInvocationARB;" "in uint64_t gl_SubGroupEqMaskARB;" "in uint64_t gl_SubGroupGeMaskARB;" "in uint64_t gl_SubGroupGtMaskARB;" "in uint64_t gl_SubGroupLeMaskARB;" "in uint64_t gl_SubGroupLtMaskARB;" - - "\n"); + "\n"; + const char* fragmentBallotDecls = + "uniform uint gl_SubGroupSizeARB;" + "flat in uint gl_SubGroupInvocationARB;" + "flat in uint64_t gl_SubGroupEqMaskARB;" + "flat in uint64_t gl_SubGroupGeMaskARB;" + "flat in uint64_t gl_SubGroupGtMaskARB;" + "flat in uint64_t gl_SubGroupLeMaskARB;" + "flat in uint64_t gl_SubGroupLtMaskARB;" + "\n"; + stageBuiltins[EShLangVertex] .append(ballotDecls); + stageBuiltins[EShLangTessControl] .append(ballotDecls); + stageBuiltins[EShLangTessEvaluation].append(ballotDecls); + stageBuiltins[EShLangGeometry] .append(ballotDecls); + stageBuiltins[EShLangCompute] .append(ballotDecls); + stageBuiltins[EShLangFragment] .append(fragmentBallotDecls); } if ((profile != EEsProfile && version >= 140) || @@ -4032,6 +5768,39 @@ "\n"); } + // GL_KHR_shader_subgroup + if (spvVersion.vulkan > 0) { + const char* ballotDecls = + "in mediump uint gl_SubgroupSize;" + "in mediump uint gl_SubgroupInvocationID;" + "in highp uvec4 gl_SubgroupEqMask;" + "in highp uvec4 gl_SubgroupGeMask;" + "in highp uvec4 gl_SubgroupGtMask;" + "in highp uvec4 gl_SubgroupLeMask;" + "in highp uvec4 gl_SubgroupLtMask;" + "\n"; + const char* fragmentBallotDecls = + "flat in mediump uint gl_SubgroupSize;" + "flat in mediump uint gl_SubgroupInvocationID;" + "flat in highp uvec4 gl_SubgroupEqMask;" + "flat in highp uvec4 gl_SubgroupGeMask;" + "flat in highp uvec4 gl_SubgroupGtMask;" + "flat in highp uvec4 gl_SubgroupLeMask;" + "flat in highp uvec4 gl_SubgroupLtMask;" + "\n"; + stageBuiltins[EShLangVertex] .append(ballotDecls); + stageBuiltins[EShLangTessControl] .append(ballotDecls); + stageBuiltins[EShLangTessEvaluation].append(ballotDecls); + stageBuiltins[EShLangGeometry] .append(ballotDecls); + stageBuiltins[EShLangCompute] .append(ballotDecls); + stageBuiltins[EShLangFragment] .append(fragmentBallotDecls); + + stageBuiltins[EShLangCompute].append( + "highp in uint gl_NumSubgroups;" + "highp in uint gl_SubgroupID;" + "\n"); + } + if (version >= 300 /* both ES and non-ES */) { stageBuiltins[EShLangFragment].append( "flat in highp uint gl_ViewID_OVR;" // GL_OVR_multiview, GL_OVR_multiview2 @@ -4052,8 +5821,11 @@ // In this function proper, enumerate the types, then calls the next set of functions // to enumerate all the uses for that type. // - +#ifdef AMD_EXTENSIONS + TBasicType bTypes[4] = { EbtFloat, EbtFloat16, EbtInt, EbtUint }; +#else TBasicType bTypes[3] = { EbtFloat, EbtInt, EbtUint }; +#endif bool skipBuffer = (profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 140); bool skipCubeArrayed = (profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 130); @@ -4093,12 +5865,20 @@ continue; if (ms && arrayed && profile == EEsProfile && version < 310) continue; +#ifdef AMD_EXTENSIONS + for (int bType = 0; bType < 4; ++bType) { // float, float16, int, uint results + + if (shadow && bType > 1) + continue; + if (bTypes[bType] == EbtFloat16 && (profile == EEsProfile ||version < 450)) + continue; +#else for (int bType = 0; bType < 3; ++bType) { // float, int, uint results if (shadow && bType > 0) continue; - +#endif if (dim == EsdRect && version < 140 && bType > 0) continue; @@ -4216,15 +5996,37 @@ // if (profile != EEsProfile && version >= 400 && ! sampler.image && sampler.dim != EsdRect && ! sampler.ms && sampler.dim != EsdBuffer) { - stageBuiltins[EShLangFragment].append("vec2 textureQueryLod("); - stageBuiltins[EShLangFragment].append(typeName); - if (dimMap[sampler.dim] == 1) - stageBuiltins[EShLangFragment].append(", float"); - else { - stageBuiltins[EShLangFragment].append(", vec"); - stageBuiltins[EShLangFragment].append(postfixes[dimMap[sampler.dim]]); +#ifdef AMD_EXTENSIONS + for (int f16TexAddr = 0; f16TexAddr < 2; ++f16TexAddr) { + if (f16TexAddr && sampler.type != EbtFloat16) + continue; +#endif + stageBuiltins[EShLangFragment].append("vec2 textureQueryLod("); + stageBuiltins[EShLangFragment].append(typeName); + if (dimMap[sampler.dim] == 1) +#ifdef AMD_EXTENSIONS + if (f16TexAddr) + stageBuiltins[EShLangFragment].append(", float16_t"); + else + stageBuiltins[EShLangFragment].append(", float"); +#else + stageBuiltins[EShLangFragment].append(", float"); +#endif + else { +#ifdef AMD_EXTENSIONS + if (f16TexAddr) + stageBuiltins[EShLangFragment].append(", f16vec"); + else + stageBuiltins[EShLangFragment].append(", vec"); +#else + stageBuiltins[EShLangFragment].append(", vec"); +#endif + stageBuiltins[EShLangFragment].append(postfixes[dimMap[sampler.dim]]); + } + stageBuiltins[EShLangFragment].append(");\n"); +#ifdef AMD_EXTENSIONS } - stageBuiltins[EShLangFragment].append(");\n"); +#endif } // @@ -4414,7 +6216,7 @@ if (bias && (lod || sampler.ms)) continue; - if (bias && sampler.dim == Esd2D && sampler.shadow && sampler.arrayed) + if (bias && (sampler.dim == Esd2D || sampler.dim == EsdCube) && sampler.shadow && sampler.arrayed) continue; if (bias && (sampler.dim == EsdRect || sampler.dim == EsdBuffer)) continue; @@ -4463,149 +6265,237 @@ continue; if (extraProj && (sampler.dim == Esd3D || sampler.shadow)) continue; +#ifdef AMD_EXTENSIONS + for (int f16TexAddr = 0; f16TexAddr <= 1; ++f16TexAddr) { // loop over 16-bit floating-point texel addressing - for (int lodClamp = 0; lodClamp <= 1 ;++lodClamp) { // loop over "bool" lod clamp - - if (lodClamp && (profile == EEsProfile || version < 450)) - continue; - if (lodClamp && (proj || lod || fetch)) + if (f16TexAddr && sampler.type != EbtFloat16) continue; + if (f16TexAddr && sampler.shadow && ! compare) { + compare = true; // compare argument is always present + totalDims--; + } +#endif + for (int lodClamp = 0; lodClamp <= 1 ;++lodClamp) { // loop over "bool" lod clamp - for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not - - if (sparse && (profile == EEsProfile || version < 450)) + if (lodClamp && (profile == EEsProfile || version < 450)) continue; - // Sparse sampling is not for 1D/1D array texture, buffer texture, and projective texture - if (sparse && (sampler.dim == Esd1D || sampler.dim == EsdBuffer || proj)) + if (lodClamp && (proj || lod || fetch)) continue; - TString s; + for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not - // return type - if (sparse) - s.append("int "); - else { - if (sampler.shadow) - s.append("float "); + if (sparse && (profile == EEsProfile || version < 450)) + continue; + // Sparse sampling is not for 1D/1D array texture, buffer texture, and projective texture + if (sparse && (sampler.dim == Esd1D || sampler.dim == EsdBuffer || proj)) + continue; + + TString s; + + // return type + if (sparse) + s.append("int "); else { - s.append(prefixes[sampler.type]); - s.append("vec4 "); + if (sampler.shadow) +#ifdef AMD_EXTENSIONS + if (sampler.type == EbtFloat16) + s.append("float16_t "); + else + s.append("float "); +#else + s.append("float "); +#endif + else { + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } } - } - // name - if (sparse) { - if (fetch) - s.append("sparseTexel"); - else - s.append("sparseTexture"); - } else { - if (fetch) - s.append("texel"); - else - s.append("texture"); - } - if (proj) - s.append("Proj"); - if (lod) - s.append("Lod"); - if (grad) - s.append("Grad"); - if (fetch) - s.append("Fetch"); - if (offset) - s.append("Offset"); - if (lodClamp) - s.append("Clamp"); - if (lodClamp || sparse) - s.append("ARB"); - s.append("("); - - // sampler type - s.append(typeName); - - // P coordinate - if (extraProj) - s.append(",vec4"); - else { - s.append(","); - TBasicType t = fetch ? EbtInt : EbtFloat; - if (totalDims == 1) - s.append(TType::getBasicString(t)); + // name + if (sparse) { + if (fetch) + s.append("sparseTexel"); + else + s.append("sparseTexture"); + } else { - s.append(prefixes[t]); - s.append("vec"); - s.append(postfixes[totalDims]); + if (fetch) + s.append("texel"); + else + s.append("texture"); } - } - - if (bias && compare) - continue; + if (proj) + s.append("Proj"); + if (lod) + s.append("Lod"); + if (grad) + s.append("Grad"); + if (fetch) + s.append("Fetch"); + if (offset) + s.append("Offset"); + if (lodClamp) + s.append("Clamp"); + if (lodClamp || sparse) + s.append("ARB"); + s.append("("); - // non-optional lod argument (lod that's not driven by lod loop) or sample - if ((fetch && sampler.dim != EsdBuffer && sampler.dim != EsdRect && !sampler.ms) || - (sampler.ms && fetch)) - s.append(",int"); - - // non-optional lod - if (lod) - s.append(",float"); - - // gradient arguments - if (grad) { - if (dimMap[sampler.dim] == 1) - s.append(",float,float"); + // sampler type + s.append(typeName); +#ifdef AMD_EXTENSIONS + // P coordinate + if (extraProj) { + if (f16TexAddr) + s.append(",f16vec4"); + else + s.append(",vec4"); + } else { + s.append(","); + TBasicType t = fetch ? EbtInt : (f16TexAddr ? EbtFloat16 : EbtFloat); + if (totalDims == 1) + s.append(TType::getBasicString(t)); + else { + s.append(prefixes[t]); + s.append("vec"); + s.append(postfixes[totalDims]); + } + } +#else + // P coordinate + if (extraProj) + s.append(",vec4"); else { - s.append(",vec"); - s.append(postfixes[dimMap[sampler.dim]]); - s.append(",vec"); - s.append(postfixes[dimMap[sampler.dim]]); + s.append(","); + TBasicType t = fetch ? EbtInt : EbtFloat; + if (totalDims == 1) + s.append(TType::getBasicString(t)); + else { + s.append(prefixes[t]); + s.append("vec"); + s.append(postfixes[totalDims]); + } } - } - - // offset - if (offset) { - if (dimMap[sampler.dim] == 1) +#endif + // non-optional compare + if (compare) + s.append(",float"); + + // non-optional lod argument (lod that's not driven by lod loop) or sample + if ((fetch && sampler.dim != EsdBuffer && sampler.dim != EsdRect && !sampler.ms) || + (sampler.ms && fetch)) s.append(",int"); - else { - s.append(",ivec"); - s.append(postfixes[dimMap[sampler.dim]]); +#ifdef AMD_EXTENSIONS + // non-optional lod + if (lod) { + if (f16TexAddr) + s.append(",float16_t"); + else + s.append(",float"); } - } - // non-optional compare - if (compare) - s.append(",float"); - - // lod clamp - if (lodClamp) - s.append(",float"); - - // texel out (for sparse texture) - if (sparse) { - s.append(",out "); - if (sampler.shadow) - s.append("float "); - else { - s.append(prefixes[sampler.type]); - s.append("vec4 "); + // gradient arguments + if (grad) { + if (dimMap[sampler.dim] == 1) { + if (f16TexAddr) + s.append(",float16_t,float16_t"); + else + s.append(",float,float"); + } else { + if (f16TexAddr) + s.append(",f16vec"); + else + s.append(",vec"); + s.append(postfixes[dimMap[sampler.dim]]); + if (f16TexAddr) + s.append(",f16vec"); + else + s.append(",vec"); + s.append(postfixes[dimMap[sampler.dim]]); + } + } +#else + // non-optional lod + if (lod) + s.append(",float"); + + // gradient arguments + if (grad) { + if (dimMap[sampler.dim] == 1) + s.append(",float,float"); + else { + s.append(",vec"); + s.append(postfixes[dimMap[sampler.dim]]); + s.append(",vec"); + s.append(postfixes[dimMap[sampler.dim]]); + } + } +#endif + // offset + if (offset) { + if (dimMap[sampler.dim] == 1) + s.append(",int"); + else { + s.append(",ivec"); + s.append(postfixes[dimMap[sampler.dim]]); + } } - } - // optional bias - if (bias) - s.append(",float"); - - s.append(");\n"); - - // Add to the per-language set of built-ins - - if (bias || lodClamp) - stageBuiltins[EShLangFragment].append(s); - else - commonBuiltins.append(s); +#ifdef AMD_EXTENSIONS + // lod clamp + if (lodClamp) { + if (f16TexAddr) + s.append(",float16_t"); + else + s.append(",float"); + } +#else + // lod clamp + if (lodClamp) + s.append(",float"); +#endif + // texel out (for sparse texture) + if (sparse) { + s.append(",out "); + if (sampler.shadow) +#ifdef AMD_EXTENSIONS + if (sampler.type == EbtFloat16) + s.append("float16_t"); + else + s.append("float"); +#else + s.append("float"); +#endif + else { + s.append(prefixes[sampler.type]); + s.append("vec4"); + } + } +#ifdef AMD_EXTENSIONS + // optional bias + if (bias) { + if (f16TexAddr) + s.append(",float16_t"); + else + s.append(",float"); + } +#else + // optional bias + if (bias) + s.append(",float"); +#endif + s.append(");\n"); + + // Add to the per-language set of built-ins + if (bias || lodClamp) + stageBuiltins[EShLangFragment].append(s); + else + commonBuiltins.append(s); + + } } +#ifdef AMD_EXTENSIONS } +#endif } } } @@ -4638,81 +6528,96 @@ if (version < 140 && sampler.dim == EsdRect && sampler.type != EbtFloat) return; - for (int offset = 0; offset < 3; ++offset) { // loop over three forms of offset in the call name: none, Offset, and Offsets +#ifdef AMD_EXTENSIONS + for (int f16TexAddr = 0; f16TexAddr <= 1; ++f16TexAddr) { // loop over 16-bit floating-point texel addressing - for (int comp = 0; comp < 2; ++comp) { // loop over presence of comp argument + if (f16TexAddr && sampler.type != EbtFloat16) + continue; +#endif + for (int offset = 0; offset < 3; ++offset) { // loop over three forms of offset in the call name: none, Offset, and Offsets - if (comp > 0 && sampler.shadow) - continue; + for (int comp = 0; comp < 2; ++comp) { // loop over presence of comp argument - if (offset > 0 && sampler.dim == EsdCube) - continue; + if (comp > 0 && sampler.shadow) + continue; - for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not - if (sparse && (profile == EEsProfile || version < 450)) + if (offset > 0 && sampler.dim == EsdCube) continue; - TString s; + for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not + if (sparse && (profile == EEsProfile || version < 450)) + continue; - // return type - if (sparse) - s.append("int "); - else { - s.append(prefixes[sampler.type]); - s.append("vec4 "); - } + TString s; - // name - if (sparse) - s.append("sparseTextureGather"); - else - s.append("textureGather"); - switch (offset) { - case 1: - s.append("Offset"); - break; - case 2: - s.append("Offsets"); - default: - break; - } + // return type + if (sparse) + s.append("int "); + else { + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } - if (sparse) - s.append("ARB"); - s.append("("); - - // sampler type argument - s.append(typeName); - - // P coordinate argument - s.append(",vec"); - int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); - s.append(postfixes[totalDims]); - - // refZ argument - if (sampler.shadow) - s.append(",float"); - - // offset argument - if (offset > 0) { - s.append(",ivec2"); - if (offset == 2) - s.append("[4]"); - } + // name + if (sparse) + s.append("sparseTextureGather"); + else + s.append("textureGather"); + switch (offset) { + case 1: + s.append("Offset"); + break; + case 2: + s.append("Offsets"); + default: + break; + } + if (sparse) + s.append("ARB"); + s.append("("); - // texel out (for sparse texture) - if (sparse) { - s.append(",out "); - s.append(prefixes[sampler.type]); - s.append("vec4 "); - } + // sampler type argument + s.append(typeName); + + // P coordinate argument +#ifdef AMD_EXTENSIONS + if (f16TexAddr) + s.append(",f16vec"); + else + s.append(",vec"); +#else + s.append(",vec"); +#endif + int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); + s.append(postfixes[totalDims]); - // comp argument - if (comp) - s.append(",int"); + // refZ argument + if (sampler.shadow) + s.append(",float"); + + // offset argument + if (offset > 0) { + s.append(",ivec2"); + if (offset == 2) + s.append("[4]"); + } - s.append(");\n"); - commonBuiltins.append(s); + // texel out (for sparse texture) + if (sparse) { + s.append(",out "); + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } + + // comp argument + if (comp) + s.append(",int"); + + s.append(");\n"); + commonBuiltins.append(s); +#ifdef AMD_EXTENSIONS + } +#endif } } } @@ -4731,95 +6636,112 @@ if ((lod && bias) || (lod == 0 && bias == 0)) continue; - for (int offset = 0; offset < 3; ++offset) { // loop over three forms of offset in the call name: none, Offset, and Offsets + for (int f16TexAddr = 0; f16TexAddr <= 1; ++f16TexAddr) { // loop over 16-bit floating-point texel addressing - for (int comp = 0; comp < 2; ++comp) { // loop over presence of comp argument + if (f16TexAddr && sampler.type != EbtFloat16) + continue; - if (comp == 0 && bias) - continue; + for (int offset = 0; offset < 3; ++offset) { // loop over three forms of offset in the call name: none, Offset, and Offsets - if (offset > 0 && sampler.dim == EsdCube) - continue; + for (int comp = 0; comp < 2; ++comp) { // loop over presence of comp argument - for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not - if (sparse && (profile == EEsProfile || version < 450)) + if (comp == 0 && bias) continue; - TString s; + if (offset > 0 && sampler.dim == EsdCube) + continue; - // return type - if (sparse) - s.append("int "); - else { - s.append(prefixes[sampler.type]); - s.append("vec4 "); - } + for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not + if (sparse && (profile == EEsProfile || version < 450)) + continue; - // name - if (sparse) - s.append("sparseTextureGather"); - else - s.append("textureGather"); - - if (lod) - s.append("Lod"); - - switch (offset) { - case 1: - s.append("Offset"); - break; - case 2: - s.append("Offsets"); - default: - break; - } + TString s; - if (lod) - s.append("AMD"); - else if (sparse) - s.append("ARB"); + // return type + if (sparse) + s.append("int "); + else { + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } - s.append("("); + // name + if (sparse) + s.append("sparseTextureGather"); + else + s.append("textureGather"); + + if (lod) + s.append("Lod"); + + switch (offset) { + case 1: + s.append("Offset"); + break; + case 2: + s.append("Offsets"); + default: + break; + } - // sampler type argument - s.append(typeName); + if (lod) + s.append("AMD"); + else if (sparse) + s.append("ARB"); + + s.append("("); + + // sampler type argument + s.append(typeName); + + // P coordinate argument + if (f16TexAddr) + s.append(",f16vec"); + else + s.append(",vec"); + int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); + s.append(postfixes[totalDims]); + + // lod argument + if (lod) { + if (f16TexAddr) + s.append(",float16_t"); + else + s.append(",float"); + } - // P coordinate argument - s.append(",vec"); - int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); - s.append(postfixes[totalDims]); + // offset argument + if (offset > 0) { + s.append(",ivec2"); + if (offset == 2) + s.append("[4]"); + } - // lod argument - if (lod) - s.append(",float"); - - // offset argument - if (offset > 0) { - s.append(",ivec2"); - if (offset == 2) - s.append("[4]"); - } + // texel out (for sparse texture) + if (sparse) { + s.append(",out "); + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } - // texel out (for sparse texture) - if (sparse) { - s.append(",out "); - s.append(prefixes[sampler.type]); - s.append("vec4 "); - } + // comp argument + if (comp) + s.append(",int"); + + // bias argument + if (bias) { + if (f16TexAddr) + s.append(",float16_t"); + else + s.append(",float"); + } - // comp argument - if (comp) - s.append(",int"); - - // bias argument - if (bias) - s.append(",float"); - - s.append(");\n"); - if (bias) - stageBuiltins[EShLangFragment].append(s); - else - commonBuiltins.append(s); + s.append(");\n"); + if (bias) + stageBuiltins[EShLangFragment].append(s); + else + commonBuiltins.append(s); + } } } } @@ -5406,9 +7328,11 @@ BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); - if (spvVersion.vulkan >= 100) + if (spvVersion.vulkan > 0) // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); + else + BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); if (version >= 430) { symbolTable.setFunctionExtensions("anyInvocationARB", 1, &E_GL_ARB_shader_group_vote); @@ -5507,7 +7431,7 @@ SpecialQualifier("gl_InstanceID", EvqInstanceId, EbvInstanceId, symbolTable); } - if (spvVersion.vulkan >= 100) { + if (spvVersion.vulkan > 0) { BuiltInVariable("gl_VertexIndex", EbvVertexIndex, symbolTable); BuiltInVariable("gl_InstanceIndex", EbvInstanceIndex, symbolTable); } @@ -5647,6 +7571,25 @@ symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview); BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable); } + + // GL_KHR_shader_subgroup + if (spvVersion.vulkan > 0) { + symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + + BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); + BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); + BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); + BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); + BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); + BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); + BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); + } break; @@ -5858,6 +7801,13 @@ } #endif +#ifdef NV_EXTENSIONS + if (profile != EEsProfile && version >= 430) { + symbolTable.setVariableExtensions("gl_FragFullyCoveredNV", 1, &E_GL_NV_conservative_raster_underestimation); + BuiltInVariable("gl_FragFullyCoveredNV", EbvFragFullyCoveredNV, symbolTable); + } +#endif + symbolTable.setVariableExtensions("gl_FragDepthEXT", 1, &E_GL_EXT_frag_depth); if (profile == EEsProfile && version < 320) { @@ -5885,6 +7835,130 @@ BuiltInVariable("gl_ViewID_OVR", EbvViewIndex, symbolTable); } + // GL_ARB_shader_ballot + if (profile != EEsProfile) { + symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); + + BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); + BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); + BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); + BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); + BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); + BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); + + if (spvVersion.vulkan > 0) + // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan + SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); + else + BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); + } + + // GL_KHR_shader_subgroup + if (spvVersion.vulkan > 0) { + symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + + BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); + BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); + BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); + BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); + BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); + BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); + BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); + + symbolTable.setFunctionExtensions("subgroupBarrier", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setFunctionExtensions("subgroupMemoryBarrier", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setFunctionExtensions("subgroupMemoryBarrierBuffer", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setFunctionExtensions("subgroupMemoryBarrierImage", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setFunctionExtensions("subgroupElect", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setFunctionExtensions("subgroupAll", 1, &E_GL_KHR_shader_subgroup_vote); + symbolTable.setFunctionExtensions("subgroupAny", 1, &E_GL_KHR_shader_subgroup_vote); + symbolTable.setFunctionExtensions("subgroupAllEqual", 1, &E_GL_KHR_shader_subgroup_vote); + symbolTable.setFunctionExtensions("subgroupBroadcast", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBroadcastFirst", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallot", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupInverseBallot", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallotBitExtract", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallotBitCount", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallotInclusiveBitCount", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallotExclusiveBitCount", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallotFindLSB", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallotFindMSB", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupShuffle", 1, &E_GL_KHR_shader_subgroup_shuffle); + symbolTable.setFunctionExtensions("subgroupShuffleXor", 1, &E_GL_KHR_shader_subgroup_shuffle); + symbolTable.setFunctionExtensions("subgroupShuffleUp", 1, &E_GL_KHR_shader_subgroup_shuffle_relative); + symbolTable.setFunctionExtensions("subgroupShuffleDown", 1, &E_GL_KHR_shader_subgroup_shuffle_relative); + symbolTable.setFunctionExtensions("subgroupAdd", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupMul", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupMin", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupMax", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupAnd", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupOr", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupXor", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveAdd", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveMul", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveMin", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveMax", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveAnd", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveOr", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveXor", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveAdd", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveMul", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveMin", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveMax", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveAnd", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveOr", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveXor", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupClusteredAdd", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupClusteredMul", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupClusteredMin", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupClusteredMax", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupClusteredAnd", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupClusteredOr", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupClusteredXor", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupQuadBroadcast", 1, &E_GL_KHR_shader_subgroup_quad); + symbolTable.setFunctionExtensions("subgroupQuadSwapHorizontal", 1, &E_GL_KHR_shader_subgroup_quad); + symbolTable.setFunctionExtensions("subgroupQuadSwapVertical", 1, &E_GL_KHR_shader_subgroup_quad); + symbolTable.setFunctionExtensions("subgroupQuadSwapDiagonal", 1, &E_GL_KHR_shader_subgroup_quad); + +#ifdef NV_EXTENSIONS + symbolTable.setFunctionExtensions("subgroupPartitionNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedAddNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedMulNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedMinNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedMaxNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedAndNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedOrNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedXorNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveAddNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveMulNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveMinNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveMaxNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveAndNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveOrNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveXorNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveAddNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveMulNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveMinNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveMaxNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveAndNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveOrNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveXorNV", 1, &E_GL_NV_shader_subgroup_partitioned); +#endif + + } + if (profile == EEsProfile) { symbolTable.setFunctionExtensions("shadow2DEXT", 1, &E_GL_EXT_shadow_samplers); symbolTable.setFunctionExtensions("shadow2DProjEXT", 1, &E_GL_EXT_shadow_samplers); @@ -5923,6 +7997,49 @@ symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_ARB_compute_shader); } + // GL_ARB_shader_ballot + if (profile != EEsProfile) { + symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); + + BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); + BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); + BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); + BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); + BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); + BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); + + if (spvVersion.vulkan > 0) + // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan + SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); + else + BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); + } + + // GL_ARB_shader_ballot + if (spvVersion.vulkan > 0) { + symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + + BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); + BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); + BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); + BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); + BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); + BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); + BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); + } + if ((profile != EEsProfile && version >= 140) || (profile == EEsProfile && version >= 310)) { symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); @@ -5931,6 +8048,16 @@ BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable); } + // GL_KHR_shader_subgroup + if (spvVersion.vulkan > 0) { + symbolTable.setVariableExtensions("gl_NumSubgroups", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupID", 1, &E_GL_KHR_shader_subgroup_basic); + + BuiltInVariable("gl_NumSubgroups", EbvNumSubgroups, symbolTable); + BuiltInVariable("gl_SubgroupID", EbvSubgroupID, symbolTable); + + symbolTable.setFunctionExtensions("subgroupMemoryBarrierShared", 1, &E_GL_KHR_shader_subgroup_basic); + } break; default: @@ -6016,12 +8143,15 @@ symbolTable.relateToOperator("doubleBitsToUint64", EOpDoubleBitsToUint64); symbolTable.relateToOperator("int64BitsToDouble", EOpInt64BitsToDouble); symbolTable.relateToOperator("uint64BitsToDouble", EOpUint64BitsToDouble); -#ifdef AMD_EXTENSIONS + symbolTable.relateToOperator("halfBitsToInt16", EOpFloat16BitsToInt16); + symbolTable.relateToOperator("halfBitsToUint16", EOpFloat16BitsToUint16); symbolTable.relateToOperator("float16BitsToInt16", EOpFloat16BitsToInt16); symbolTable.relateToOperator("float16BitsToUint16", EOpFloat16BitsToUint16); symbolTable.relateToOperator("int16BitsToFloat16", EOpInt16BitsToFloat16); symbolTable.relateToOperator("uint16BitsToFloat16", EOpUint16BitsToFloat16); -#endif + + symbolTable.relateToOperator("int16BitsToHalf", EOpInt16BitsToFloat16); + symbolTable.relateToOperator("uint16BitsToHalf", EOpUint16BitsToFloat16); symbolTable.relateToOperator("packSnorm2x16", EOpPackSnorm2x16); symbolTable.relateToOperator("unpackSnorm2x16", EOpUnpackSnorm2x16); @@ -6044,7 +8174,6 @@ symbolTable.relateToOperator("packUint2x32", EOpPackUint2x32); symbolTable.relateToOperator("unpackUint2x32", EOpUnpackUint2x32); -#ifdef AMD_EXTENSIONS symbolTable.relateToOperator("packInt2x16", EOpPackInt2x16); symbolTable.relateToOperator("unpackInt2x16", EOpUnpackInt2x16); symbolTable.relateToOperator("packUint2x16", EOpPackUint2x16); @@ -6054,10 +8183,16 @@ symbolTable.relateToOperator("unpackInt4x16", EOpUnpackInt4x16); symbolTable.relateToOperator("packUint4x16", EOpPackUint4x16); symbolTable.relateToOperator("unpackUint4x16", EOpUnpackUint4x16); - symbolTable.relateToOperator("packFloat2x16", EOpPackFloat2x16); symbolTable.relateToOperator("unpackFloat2x16", EOpUnpackFloat2x16); -#endif + + symbolTable.relateToOperator("pack16", EOpPack16); + symbolTable.relateToOperator("pack32", EOpPack32); + symbolTable.relateToOperator("pack64", EOpPack64); + + symbolTable.relateToOperator("unpack32", EOpUnpack32); + symbolTable.relateToOperator("unpack16", EOpUnpack16); + symbolTable.relateToOperator("unpack8", EOpUnpack8); symbolTable.relateToOperator("length", EOpLength); symbolTable.relateToOperator("distance", EOpDistance); @@ -6301,6 +8436,90 @@ symbolTable.relateToOperator("fragmentFetchAMD", EOpFragmentFetch); #endif } + + // GL_KHR_shader_subgroup + if (spvVersion.vulkan > 0) { + symbolTable.relateToOperator("subgroupBarrier", EOpSubgroupBarrier); + symbolTable.relateToOperator("subgroupMemoryBarrier", EOpSubgroupMemoryBarrier); + symbolTable.relateToOperator("subgroupMemoryBarrierBuffer", EOpSubgroupMemoryBarrierBuffer); + symbolTable.relateToOperator("subgroupMemoryBarrierImage", EOpSubgroupMemoryBarrierImage); + symbolTable.relateToOperator("subgroupElect", EOpSubgroupElect); + symbolTable.relateToOperator("subgroupAll", EOpSubgroupAll); + symbolTable.relateToOperator("subgroupAny", EOpSubgroupAny); + symbolTable.relateToOperator("subgroupAllEqual", EOpSubgroupAllEqual); + symbolTable.relateToOperator("subgroupBroadcast", EOpSubgroupBroadcast); + symbolTable.relateToOperator("subgroupBroadcastFirst", EOpSubgroupBroadcastFirst); + symbolTable.relateToOperator("subgroupBallot", EOpSubgroupBallot); + symbolTable.relateToOperator("subgroupInverseBallot", EOpSubgroupInverseBallot); + symbolTable.relateToOperator("subgroupBallotBitExtract", EOpSubgroupBallotBitExtract); + symbolTable.relateToOperator("subgroupBallotBitCount", EOpSubgroupBallotBitCount); + symbolTable.relateToOperator("subgroupBallotInclusiveBitCount", EOpSubgroupBallotInclusiveBitCount); + symbolTable.relateToOperator("subgroupBallotExclusiveBitCount", EOpSubgroupBallotExclusiveBitCount); + symbolTable.relateToOperator("subgroupBallotFindLSB", EOpSubgroupBallotFindLSB); + symbolTable.relateToOperator("subgroupBallotFindMSB", EOpSubgroupBallotFindMSB); + symbolTable.relateToOperator("subgroupShuffle", EOpSubgroupShuffle); + symbolTable.relateToOperator("subgroupShuffleXor", EOpSubgroupShuffleXor); + symbolTable.relateToOperator("subgroupShuffleUp", EOpSubgroupShuffleUp); + symbolTable.relateToOperator("subgroupShuffleDown", EOpSubgroupShuffleDown); + symbolTable.relateToOperator("subgroupAdd", EOpSubgroupAdd); + symbolTable.relateToOperator("subgroupMul", EOpSubgroupMul); + symbolTable.relateToOperator("subgroupMin", EOpSubgroupMin); + symbolTable.relateToOperator("subgroupMax", EOpSubgroupMax); + symbolTable.relateToOperator("subgroupAnd", EOpSubgroupAnd); + symbolTable.relateToOperator("subgroupOr", EOpSubgroupOr); + symbolTable.relateToOperator("subgroupXor", EOpSubgroupXor); + symbolTable.relateToOperator("subgroupInclusiveAdd", EOpSubgroupInclusiveAdd); + symbolTable.relateToOperator("subgroupInclusiveMul", EOpSubgroupInclusiveMul); + symbolTable.relateToOperator("subgroupInclusiveMin", EOpSubgroupInclusiveMin); + symbolTable.relateToOperator("subgroupInclusiveMax", EOpSubgroupInclusiveMax); + symbolTable.relateToOperator("subgroupInclusiveAnd", EOpSubgroupInclusiveAnd); + symbolTable.relateToOperator("subgroupInclusiveOr", EOpSubgroupInclusiveOr); + symbolTable.relateToOperator("subgroupInclusiveXor", EOpSubgroupInclusiveXor); + symbolTable.relateToOperator("subgroupExclusiveAdd", EOpSubgroupExclusiveAdd); + symbolTable.relateToOperator("subgroupExclusiveMul", EOpSubgroupExclusiveMul); + symbolTable.relateToOperator("subgroupExclusiveMin", EOpSubgroupExclusiveMin); + symbolTable.relateToOperator("subgroupExclusiveMax", EOpSubgroupExclusiveMax); + symbolTable.relateToOperator("subgroupExclusiveAnd", EOpSubgroupExclusiveAnd); + symbolTable.relateToOperator("subgroupExclusiveOr", EOpSubgroupExclusiveOr); + symbolTable.relateToOperator("subgroupExclusiveXor", EOpSubgroupExclusiveXor); + symbolTable.relateToOperator("subgroupClusteredAdd", EOpSubgroupClusteredAdd); + symbolTable.relateToOperator("subgroupClusteredMul", EOpSubgroupClusteredMul); + symbolTable.relateToOperator("subgroupClusteredMin", EOpSubgroupClusteredMin); + symbolTable.relateToOperator("subgroupClusteredMax", EOpSubgroupClusteredMax); + symbolTable.relateToOperator("subgroupClusteredAnd", EOpSubgroupClusteredAnd); + symbolTable.relateToOperator("subgroupClusteredOr", EOpSubgroupClusteredOr); + symbolTable.relateToOperator("subgroupClusteredXor", EOpSubgroupClusteredXor); + symbolTable.relateToOperator("subgroupQuadBroadcast", EOpSubgroupQuadBroadcast); + symbolTable.relateToOperator("subgroupQuadSwapHorizontal", EOpSubgroupQuadSwapHorizontal); + symbolTable.relateToOperator("subgroupQuadSwapVertical", EOpSubgroupQuadSwapVertical); + symbolTable.relateToOperator("subgroupQuadSwapDiagonal", EOpSubgroupQuadSwapDiagonal); + +#ifdef NV_EXTENSIONS + symbolTable.relateToOperator("subgroupPartitionNV", EOpSubgroupPartition); + symbolTable.relateToOperator("subgroupPartitionedAddNV", EOpSubgroupPartitionedAdd); + symbolTable.relateToOperator("subgroupPartitionedMulNV", EOpSubgroupPartitionedMul); + symbolTable.relateToOperator("subgroupPartitionedMinNV", EOpSubgroupPartitionedMin); + symbolTable.relateToOperator("subgroupPartitionedMaxNV", EOpSubgroupPartitionedMax); + symbolTable.relateToOperator("subgroupPartitionedAndNV", EOpSubgroupPartitionedAnd); + symbolTable.relateToOperator("subgroupPartitionedOrNV", EOpSubgroupPartitionedOr); + symbolTable.relateToOperator("subgroupPartitionedXorNV", EOpSubgroupPartitionedXor); + symbolTable.relateToOperator("subgroupPartitionedInclusiveAddNV", EOpSubgroupPartitionedInclusiveAdd); + symbolTable.relateToOperator("subgroupPartitionedInclusiveMulNV", EOpSubgroupPartitionedInclusiveMul); + symbolTable.relateToOperator("subgroupPartitionedInclusiveMinNV", EOpSubgroupPartitionedInclusiveMin); + symbolTable.relateToOperator("subgroupPartitionedInclusiveMaxNV", EOpSubgroupPartitionedInclusiveMax); + symbolTable.relateToOperator("subgroupPartitionedInclusiveAndNV", EOpSubgroupPartitionedInclusiveAnd); + symbolTable.relateToOperator("subgroupPartitionedInclusiveOrNV", EOpSubgroupPartitionedInclusiveOr); + symbolTable.relateToOperator("subgroupPartitionedInclusiveXorNV", EOpSubgroupPartitionedInclusiveXor); + symbolTable.relateToOperator("subgroupPartitionedExclusiveAddNV", EOpSubgroupPartitionedExclusiveAdd); + symbolTable.relateToOperator("subgroupPartitionedExclusiveMulNV", EOpSubgroupPartitionedExclusiveMul); + symbolTable.relateToOperator("subgroupPartitionedExclusiveMinNV", EOpSubgroupPartitionedExclusiveMin); + symbolTable.relateToOperator("subgroupPartitionedExclusiveMaxNV", EOpSubgroupPartitionedExclusiveMax); + symbolTable.relateToOperator("subgroupPartitionedExclusiveAndNV", EOpSubgroupPartitionedExclusiveAnd); + symbolTable.relateToOperator("subgroupPartitionedExclusiveOrNV", EOpSubgroupPartitionedExclusiveOr); + symbolTable.relateToOperator("subgroupPartitionedExclusiveXorNV", EOpSubgroupPartitionedExclusiveXor); +#endif + } + if (profile == EEsProfile) { symbolTable.relateToOperator("shadow2DEXT", EOpTexture); symbolTable.relateToOperator("shadow2DProjEXT", EOpTextureProj); @@ -6341,12 +8560,13 @@ #ifdef AMD_EXTENSIONS if (profile != EEsProfile) symbolTable.relateToOperator("interpolateAtVertexAMD", EOpInterpolateAtVertex); - break; #endif + break; case EShLangCompute: - symbolTable.relateToOperator("memoryBarrierShared", EOpMemoryBarrierShared); - symbolTable.relateToOperator("groupMemoryBarrier", EOpGroupMemoryBarrier); + symbolTable.relateToOperator("memoryBarrierShared", EOpMemoryBarrierShared); + symbolTable.relateToOperator("groupMemoryBarrier", EOpGroupMemoryBarrier); + symbolTable.relateToOperator("subgroupMemoryBarrierShared", EOpSubgroupMemoryBarrierShared); break; default: @@ -6382,9 +8602,9 @@ if (version == 100 || IncludeLegacy(version, profile, spvVersion) || (! ForwardCompatibility && profile != EEsProfile && version < 420)) { TPrecisionQualifier pq = profile == EEsProfile ? EpqMedium : EpqNone; TType fragData(EbtFloat, EvqFragColor, pq, 4); - TArraySizes& arraySizes = *new TArraySizes; - arraySizes.addInnerSize(resources.maxDrawBuffers); - fragData.newArraySizes(arraySizes); + TArraySizes* arraySizes = new TArraySizes; + arraySizes->addInnerSize(resources.maxDrawBuffers); + fragData.transferArraySizes(arraySizes); symbolTable.insert(*new TVariable(NewPoolTString("gl_FragData"), fragData)); SpecialQualifier("gl_FragData", EvqFragColor, EbvFragData, symbolTable); } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/Initialize.h vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/Initialize.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/Initialize.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/Initialize.h 2018-04-27 11:46:26.000000000 +0000 @@ -67,7 +67,6 @@ virtual const TString& getStageString(EShLanguage language) const { return stageBuiltins[language]; } virtual void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable) = 0; - virtual void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources) = 0; protected: @@ -89,7 +88,6 @@ void initialize(const TBuiltInResource& resources, int version, EProfile, const SpvVersion& spvVersion, EShLanguage); void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable); - void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources); protected: diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/Intermediate.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/Intermediate.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/Intermediate.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/Intermediate.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -2,6 +2,7 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2015 LunarG, Inc. // Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -46,6 +47,7 @@ #include #include +#include namespace glslang { @@ -118,16 +120,12 @@ return nullptr; // Try converting the children's base types to compatible types. - TIntermTyped* child = addConversion(op, left->getType(), right); - if (child) - right = child; - else { - child = addConversion(op, right->getType(), left); - if (child) - left = child; - else - return nullptr; - } + auto children = addConversion(op, left, right); + left = std::get<0>(children); + right = std::get<1>(children); + + if (left == nullptr || right == nullptr) + return nullptr; // Convert the children's type shape to be compatible. addBiShapeConversion(op, left, right); @@ -161,6 +159,11 @@ if (specConstantPropagates(*node->getLeft(), *node->getRight()) && isSpecializationOperation(*node)) node->getWritableType().getQualifier().makeSpecConstant(); + // If must propagate nonuniform, make a nonuniform. + if ((node->getLeft()->getQualifier().nonUniform || node->getRight()->getQualifier().nonUniform) && + isNonuniformPropagating(node->getOp())) + node->getWritableType().getQualifier().nonUniform = true; + return node; } @@ -304,20 +307,18 @@ // TBasicType newType = EbtVoid; switch (op) { + case EOpConstructInt8: newType = EbtInt8; break; + case EOpConstructUint8: newType = EbtUint8; break; + case EOpConstructInt16: newType = EbtInt16; break; + case EOpConstructUint16: newType = EbtUint16; break; case EOpConstructInt: newType = EbtInt; break; case EOpConstructUint: newType = EbtUint; break; case EOpConstructInt64: newType = EbtInt64; break; case EOpConstructUint64: newType = EbtUint64; break; -#ifdef AMD_EXTENSIONS - case EOpConstructInt16: newType = EbtInt16; break; - case EOpConstructUint16: newType = EbtUint16; break; -#endif case EOpConstructBool: newType = EbtBool; break; case EOpConstructFloat: newType = EbtFloat; break; case EOpConstructDouble: newType = EbtDouble; break; -#ifdef AMD_EXTENSIONS case EOpConstructFloat16: newType = EbtFloat16; break; -#endif default: break; // some compilers want this } @@ -336,20 +337,18 @@ // TODO: but, did this bypass constant folding? // switch (op) { + case EOpConstructInt8: + case EOpConstructUint8: + case EOpConstructInt16: + case EOpConstructUint16: case EOpConstructInt: case EOpConstructUint: case EOpConstructInt64: case EOpConstructUint64: -#ifdef AMD_EXTENSIONS - case EOpConstructInt16: - case EOpConstructUint16: -#endif case EOpConstructBool: case EOpConstructFloat: case EOpConstructDouble: -#ifdef AMD_EXTENSIONS case EOpConstructFloat16: -#endif return child; default: break; // some compilers want this } @@ -373,10 +372,15 @@ if (node->getOperand()->getType().getQualifier().isSpecConstant() && isSpecializationOperation(*node)) node->getWritableType().getQualifier().makeSpecConstant(); + // If must propagate nonuniform, make a nonuniform. + if (node->getOperand()->getQualifier().nonUniform && isNonuniformPropagating(node->getOp())) + node->getWritableType().getQualifier().nonUniform = true; + return node; } -TIntermTyped* TIntermediate::addBuiltInFunctionCall(const TSourceLoc& loc, TOperator op, bool unary, TIntermNode* childNode, const TType& returnType) +TIntermTyped* TIntermediate::addBuiltInFunctionCall(const TSourceLoc& loc, TOperator op, bool unary, + TIntermNode* childNode, const TType& returnType) { if (unary) { // @@ -420,7 +424,7 @@ // // Make sure we have an aggregate. If not turn it into one. // - if (node) { + if (node != nullptr) { aggNode = node->getAsAggregate(); if (aggNode == nullptr || aggNode->getOp() != EOpNull) { // @@ -446,27 +450,14 @@ return fold(aggNode); } -// -// Convert the node's type to the given type, as allowed by the operation involved: 'op'. -// For implicit conversions, 'op' is not the requested conversion, it is the explicit -// operation requiring the implicit conversion. -// -// Returns a node representing the conversion, which could be the same -// node passed in if no conversion was needed. -// -// Generally, this is focused on basic type conversion, not shape conversion. -// See addShapeConversion(). -// -// Return nullptr if a conversion can't be done. -// -TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TIntermTyped* node) const +bool TIntermediate::isConversionAllowed(TOperator op, TIntermTyped* node) const { // // Does the base type even allow the operation? // switch (node->getBasicType()) { case EbtVoid: - return nullptr; + return false; case EbtAtomicUint: case EbtSampler: // opaque types can be passed to functions @@ -484,188 +475,19 @@ break; // otherwise, opaque types can't even be operated on, let alone converted - return nullptr; + return false; default: break; } - // Otherwise, if types are identical, no problem - if (type == node->getType()) - return node; - - // If one's a structure, then no conversions. - if (type.isStruct() || node->isStruct()) - return nullptr; - - // If one's an array, then no conversions. - if (type.isArray() || node->getType().isArray()) - return nullptr; - - // Note: callers are responsible for other aspects of shape, - // like vector and matrix sizes. - - TBasicType promoteTo; - - switch (op) { - // - // Explicit conversions (unary operations) - // - case EOpConstructBool: - promoteTo = EbtBool; - break; - case EOpConstructFloat: - promoteTo = EbtFloat; - break; - case EOpConstructDouble: - promoteTo = EbtDouble; - break; -#ifdef AMD_EXTENSIONS - case EOpConstructFloat16: - promoteTo = EbtFloat16; - break; -#endif - case EOpConstructInt: - promoteTo = EbtInt; - break; - case EOpConstructUint: - promoteTo = EbtUint; - break; - case EOpConstructInt64: - promoteTo = EbtInt64; - break; - case EOpConstructUint64: - promoteTo = EbtUint64; - break; -#ifdef AMD_EXTENSIONS - case EOpConstructInt16: - promoteTo = EbtInt16; - break; - case EOpConstructUint16: - promoteTo = EbtUint16; - break; -#endif - - // - // List all the binary ops that can implicitly convert one operand to the other's type; - // This implements the 'policy' for implicit type conversion. - // - case EOpLessThan: - case EOpGreaterThan: - case EOpLessThanEqual: - case EOpGreaterThanEqual: - case EOpEqual: - case EOpNotEqual: - - case EOpAdd: - case EOpSub: - case EOpMul: - case EOpDiv: - case EOpMod: - - case EOpVectorTimesScalar: - case EOpVectorTimesMatrix: - case EOpMatrixTimesVector: - case EOpMatrixTimesScalar: - - case EOpAnd: - case EOpInclusiveOr: - case EOpExclusiveOr: - case EOpAndAssign: - case EOpInclusiveOrAssign: - case EOpExclusiveOrAssign: - case EOpLogicalNot: - case EOpLogicalAnd: - case EOpLogicalOr: - case EOpLogicalXor: - - case EOpFunctionCall: - case EOpReturn: - case EOpAssign: - case EOpAddAssign: - case EOpSubAssign: - case EOpMulAssign: - case EOpVectorTimesScalarAssign: - case EOpMatrixTimesScalarAssign: - case EOpDivAssign: - case EOpModAssign: - - case EOpAtan: - case EOpClamp: - case EOpCross: - case EOpDistance: - case EOpDot: - case EOpDst: - case EOpFaceForward: - case EOpFma: - case EOpFrexp: - case EOpLdexp: - case EOpMix: - case EOpLit: - case EOpMax: - case EOpMin: - case EOpModf: - case EOpPow: - case EOpReflect: - case EOpRefract: - case EOpSmoothStep: - case EOpStep: - - case EOpSequence: - case EOpConstructStruct: - - if (type.getBasicType() == node->getType().getBasicType()) - return node; - - if (canImplicitlyPromote(node->getType().getBasicType(), type.getBasicType(), op)) - promoteTo = type.getBasicType(); - else - return nullptr; - - break; - - // Shifts can have mixed types as long as they are integer, without converting. - // It's the left operand's type that determines the resulting type, so no issue - // with assign shift ops either. - case EOpLeftShift: - case EOpRightShift: - case EOpLeftShiftAssign: - case EOpRightShiftAssign: - if ((type.getBasicType() == EbtInt || - type.getBasicType() == EbtUint || -#ifdef AMD_EXTENSIONS - type.getBasicType() == EbtInt16 || - type.getBasicType() == EbtUint16 || -#endif - type.getBasicType() == EbtInt64 || - type.getBasicType() == EbtUint64) && - (node->getType().getBasicType() == EbtInt || - node->getType().getBasicType() == EbtUint || -#ifdef AMD_EXTENSIONS - node->getType().getBasicType() == EbtInt16 || - node->getType().getBasicType() == EbtUint16 || -#endif - node->getType().getBasicType() == EbtInt64 || - node->getType().getBasicType() == EbtUint64)) - - return node; - else if (source == EShSourceHlsl && node->getType().getBasicType() == EbtBool) { - promoteTo = type.getBasicType(); - break; - } else - return nullptr; - - default: - // default is to require a match; all exceptions should have case statements above - - if (type.getBasicType() == node->getType().getBasicType()) - return node; - else - return nullptr; - } - - if (node->getAsConstantUnion()) - return promoteConstantUnion(promoteTo, node->getAsConstantUnion()); + return true; +} +// This is 'mechanism' here, it does any conversion told. +// It is about basic type, not about shape. +// The policy comes from the shader or the calling code. +TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped* node) const +{ // // Add a new newNode for the conversion. // @@ -673,50 +495,47 @@ TOperator newOp = EOpNull; - // This is 'mechanism' here, it does any conversion told. The policy comes - // from the shader or the above code. - switch (promoteTo) { + switch (convertTo) { case EbtDouble: switch (node->getBasicType()) { - case EbtInt: newOp = EOpConvIntToDouble; break; - case EbtUint: newOp = EOpConvUintToDouble; break; - case EbtBool: newOp = EOpConvBoolToDouble; break; - case EbtFloat: newOp = EOpConvFloatToDouble; break; -#ifdef AMD_EXTENSIONS + case EbtInt8: newOp = EOpConvInt8ToDouble; break; + case EbtUint8: newOp = EOpConvUint8ToDouble; break; + case EbtInt16: newOp = EOpConvInt16ToDouble; break; + case EbtUint16: newOp = EOpConvUint16ToDouble; break; + case EbtInt: newOp = EOpConvIntToDouble; break; + case EbtUint: newOp = EOpConvUintToDouble; break; + case EbtBool: newOp = EOpConvBoolToDouble; break; + case EbtFloat: newOp = EOpConvFloatToDouble; break; case EbtFloat16: newOp = EOpConvFloat16ToDouble; break; -#endif - case EbtInt64: newOp = EOpConvInt64ToDouble; break; - case EbtUint64: newOp = EOpConvUint64ToDouble; break; -#ifdef AMD_EXTENSIONS - case EbtInt16: newOp = EOpConvInt16ToDouble; break; - case EbtUint16: newOp = EOpConvUint16ToDouble; break; -#endif + case EbtInt64: newOp = EOpConvInt64ToDouble; break; + case EbtUint64: newOp = EOpConvUint64ToDouble; break; default: return nullptr; } break; case EbtFloat: switch (node->getBasicType()) { - case EbtInt: newOp = EOpConvIntToFloat; break; - case EbtUint: newOp = EOpConvUintToFloat; break; - case EbtBool: newOp = EOpConvBoolToFloat; break; - case EbtDouble: newOp = EOpConvDoubleToFloat; break; -#ifdef AMD_EXTENSIONS + case EbtInt8: newOp = EOpConvInt8ToFloat; break; + case EbtUint8: newOp = EOpConvUint8ToFloat; break; + case EbtInt16: newOp = EOpConvInt16ToFloat; break; + case EbtUint16: newOp = EOpConvUint16ToFloat; break; + case EbtInt: newOp = EOpConvIntToFloat; break; + case EbtUint: newOp = EOpConvUintToFloat; break; + case EbtBool: newOp = EOpConvBoolToFloat; break; + case EbtDouble: newOp = EOpConvDoubleToFloat; break; case EbtFloat16: newOp = EOpConvFloat16ToFloat; break; -#endif - case EbtInt64: newOp = EOpConvInt64ToFloat; break; - case EbtUint64: newOp = EOpConvUint64ToFloat; break; -#ifdef AMD_EXTENSIONS - case EbtInt16: newOp = EOpConvInt16ToFloat; break; - case EbtUint16: newOp = EOpConvUint16ToFloat; break; -#endif + case EbtInt64: newOp = EOpConvInt64ToFloat; break; + case EbtUint64: newOp = EOpConvUint64ToFloat; break; default: return nullptr; } break; -#ifdef AMD_EXTENSIONS case EbtFloat16: switch (node->getBasicType()) { + case EbtInt8: newOp = EOpConvInt8ToFloat16; break; + case EbtUint8: newOp = EOpConvUint8ToFloat16; break; + case EbtInt16: newOp = EOpConvInt16ToFloat16; break; + case EbtUint16: newOp = EOpConvUint16ToFloat16; break; case EbtInt: newOp = EOpConvIntToFloat16; break; case EbtUint: newOp = EOpConvUintToFloat16; break; case EbtBool: newOp = EOpConvBoolToFloat16; break; @@ -724,145 +543,170 @@ case EbtDouble: newOp = EOpConvDoubleToFloat16; break; case EbtInt64: newOp = EOpConvInt64ToFloat16; break; case EbtUint64: newOp = EOpConvUint64ToFloat16; break; - case EbtInt16: newOp = EOpConvInt16ToFloat16; break; - case EbtUint16: newOp = EOpConvUint16ToFloat16; break; default: return nullptr; } break; -#endif case EbtBool: switch (node->getBasicType()) { - case EbtInt: newOp = EOpConvIntToBool; break; - case EbtUint: newOp = EOpConvUintToBool; break; - case EbtFloat: newOp = EOpConvFloatToBool; break; - case EbtDouble: newOp = EOpConvDoubleToBool; break; -#ifdef AMD_EXTENSIONS + case EbtInt8: newOp = EOpConvInt8ToBool; break; + case EbtUint8: newOp = EOpConvUint8ToBool; break; + case EbtInt16: newOp = EOpConvInt16ToBool; break; + case EbtUint16: newOp = EOpConvUint16ToBool; break; + case EbtInt: newOp = EOpConvIntToBool; break; + case EbtUint: newOp = EOpConvUintToBool; break; + case EbtFloat: newOp = EOpConvFloatToBool; break; + case EbtDouble: newOp = EOpConvDoubleToBool; break; case EbtFloat16: newOp = EOpConvFloat16ToBool; break; -#endif - case EbtInt64: newOp = EOpConvInt64ToBool; break; - case EbtUint64: newOp = EOpConvUint64ToBool; break; -#ifdef AMD_EXTENSIONS - case EbtInt16: newOp = EOpConvInt16ToBool; break; - case EbtUint16: newOp = EOpConvUint16ToBool; break; -#endif - default: - return nullptr; - } - break; - case EbtInt: - switch (node->getBasicType()) { - case EbtUint: newOp = EOpConvUintToInt; break; - case EbtBool: newOp = EOpConvBoolToInt; break; - case EbtFloat: newOp = EOpConvFloatToInt; break; - case EbtDouble: newOp = EOpConvDoubleToInt; break; -#ifdef AMD_EXTENSIONS - case EbtFloat16: newOp = EOpConvFloat16ToInt; break; -#endif - case EbtInt64: newOp = EOpConvInt64ToInt; break; - case EbtUint64: newOp = EOpConvUint64ToInt; break; -#ifdef AMD_EXTENSIONS - case EbtInt16: newOp = EOpConvInt16ToInt; break; - case EbtUint16: newOp = EOpConvUint16ToInt; break; -#endif - default: - return nullptr; - } - break; - case EbtUint: - switch (node->getBasicType()) { - case EbtInt: newOp = EOpConvIntToUint; break; - case EbtBool: newOp = EOpConvBoolToUint; break; - case EbtFloat: newOp = EOpConvFloatToUint; break; - case EbtDouble: newOp = EOpConvDoubleToUint; break; -#ifdef AMD_EXTENSIONS - case EbtFloat16: newOp = EOpConvFloat16ToUint; break; -#endif - case EbtInt64: newOp = EOpConvInt64ToUint; break; - case EbtUint64: newOp = EOpConvUint64ToUint; break; -#ifdef AMD_EXTENSIONS - case EbtInt16: newOp = EOpConvInt16ToUint; break; - case EbtUint16: newOp = EOpConvUint16ToUint; break; -#endif + case EbtInt64: newOp = EOpConvInt64ToBool; break; + case EbtUint64: newOp = EOpConvUint64ToBool; break; default: return nullptr; } break; - case EbtInt64: + case EbtInt8: switch (node->getBasicType()) { - case EbtInt: newOp = EOpConvIntToInt64; break; - case EbtUint: newOp = EOpConvUintToInt64; break; - case EbtBool: newOp = EOpConvBoolToInt64; break; - case EbtFloat: newOp = EOpConvFloatToInt64; break; - case EbtDouble: newOp = EOpConvDoubleToInt64; break; -#ifdef AMD_EXTENSIONS - case EbtFloat16: newOp = EOpConvFloat16ToInt64; break; -#endif - case EbtUint64: newOp = EOpConvUint64ToInt64; break; -#ifdef AMD_EXTENSIONS - case EbtInt16: newOp = EOpConvInt16ToInt64; break; - case EbtUint16: newOp = EOpConvUint16ToInt64; break; -#endif + case EbtUint8: newOp = EOpConvUint8ToInt8; break; + case EbtInt16: newOp = EOpConvInt16ToInt8; break; + case EbtUint16: newOp = EOpConvUint16ToInt8; break; + case EbtInt: newOp = EOpConvIntToInt8; break; + case EbtUint: newOp = EOpConvUintToInt8; break; + case EbtInt64: newOp = EOpConvInt64ToInt8; break; + case EbtUint64: newOp = EOpConvUint64ToInt8; break; + case EbtBool: newOp = EOpConvBoolToInt8; break; + case EbtFloat: newOp = EOpConvFloatToInt8; break; + case EbtDouble: newOp = EOpConvDoubleToInt8; break; + case EbtFloat16: newOp = EOpConvFloat16ToInt8; break; default: return nullptr; } break; - case EbtUint64: + case EbtUint8: switch (node->getBasicType()) { - case EbtInt: newOp = EOpConvIntToUint64; break; - case EbtUint: newOp = EOpConvUintToUint64; break; - case EbtBool: newOp = EOpConvBoolToUint64; break; - case EbtFloat: newOp = EOpConvFloatToUint64; break; - case EbtDouble: newOp = EOpConvDoubleToUint64; break; -#ifdef AMD_EXTENSIONS - case EbtFloat16: newOp = EOpConvFloat16ToUint64; break; -#endif - case EbtInt64: newOp = EOpConvInt64ToUint64; break; -#ifdef AMD_EXTENSIONS - case EbtInt16: newOp = EOpConvInt16ToUint64; break; - case EbtUint16: newOp = EOpConvUint16ToUint64; break; -#endif + case EbtInt8: newOp = EOpConvInt8ToUint8; break; + case EbtInt16: newOp = EOpConvInt16ToUint8; break; + case EbtUint16: newOp = EOpConvUint16ToUint8; break; + case EbtInt: newOp = EOpConvIntToUint8; break; + case EbtUint: newOp = EOpConvUintToUint8; break; + case EbtInt64: newOp = EOpConvInt64ToUint8; break; + case EbtUint64: newOp = EOpConvUint64ToUint8; break; + case EbtBool: newOp = EOpConvBoolToUint8; break; + case EbtFloat: newOp = EOpConvFloatToUint8; break; + case EbtDouble: newOp = EOpConvDoubleToUint8; break; + case EbtFloat16: newOp = EOpConvFloat16ToUint8; break; default: return nullptr; } break; -#ifdef AMD_EXTENSIONS + case EbtInt16: switch (node->getBasicType()) { + case EbtUint8: newOp = EOpConvUint8ToInt16; break; + case EbtInt8: newOp = EOpConvInt8ToInt16; break; + case EbtUint16: newOp = EOpConvUint16ToInt16; break; case EbtInt: newOp = EOpConvIntToInt16; break; case EbtUint: newOp = EOpConvUintToInt16; break; + case EbtInt64: newOp = EOpConvInt64ToInt16; break; + case EbtUint64: newOp = EOpConvUint64ToInt16; break; case EbtBool: newOp = EOpConvBoolToInt16; break; case EbtFloat: newOp = EOpConvFloatToInt16; break; case EbtDouble: newOp = EOpConvDoubleToInt16; break; case EbtFloat16: newOp = EOpConvFloat16ToInt16; break; - case EbtInt64: newOp = EOpConvInt64ToInt16; break; - case EbtUint64: newOp = EOpConvUint64ToInt16; break; - case EbtUint16: newOp = EOpConvUint16ToInt16; break; default: return nullptr; } break; case EbtUint16: switch (node->getBasicType()) { + case EbtInt8: newOp = EOpConvInt8ToUint16; break; + case EbtUint8: newOp = EOpConvUint8ToUint16; break; + case EbtInt16: newOp = EOpConvInt16ToUint16; break; case EbtInt: newOp = EOpConvIntToUint16; break; case EbtUint: newOp = EOpConvUintToUint16; break; + case EbtInt64: newOp = EOpConvInt64ToUint16; break; + case EbtUint64: newOp = EOpConvUint64ToUint16; break; case EbtBool: newOp = EOpConvBoolToUint16; break; case EbtFloat: newOp = EOpConvFloatToUint16; break; case EbtDouble: newOp = EOpConvDoubleToUint16; break; case EbtFloat16: newOp = EOpConvFloat16ToUint16; break; - case EbtInt64: newOp = EOpConvInt64ToUint16; break; - case EbtUint64: newOp = EOpConvUint64ToUint16; break; - case EbtInt16: newOp = EOpConvInt16ToUint16; break; default: return nullptr; } break; -#endif + + case EbtInt: + switch (node->getBasicType()) { + case EbtInt8: newOp = EOpConvInt8ToInt; break; + case EbtUint8: newOp = EOpConvUint8ToInt; break; + case EbtInt16: newOp = EOpConvInt16ToInt; break; + case EbtUint16: newOp = EOpConvUint16ToInt; break; + case EbtUint: newOp = EOpConvUintToInt; break; + case EbtBool: newOp = EOpConvBoolToInt; break; + case EbtFloat: newOp = EOpConvFloatToInt; break; + case EbtDouble: newOp = EOpConvDoubleToInt; break; + case EbtFloat16: newOp = EOpConvFloat16ToInt; break; + case EbtInt64: newOp = EOpConvInt64ToInt; break; + case EbtUint64: newOp = EOpConvUint64ToInt; break; + default: + return nullptr; + } + break; + case EbtUint: + switch (node->getBasicType()) { + case EbtInt8: newOp = EOpConvInt8ToUint; break; + case EbtUint8: newOp = EOpConvUint8ToUint; break; + case EbtInt16: newOp = EOpConvInt16ToUint; break; + case EbtUint16: newOp = EOpConvUint16ToUint; break; + case EbtInt: newOp = EOpConvIntToUint; break; + case EbtBool: newOp = EOpConvBoolToUint; break; + case EbtFloat: newOp = EOpConvFloatToUint; break; + case EbtDouble: newOp = EOpConvDoubleToUint; break; + case EbtFloat16: newOp = EOpConvFloat16ToUint; break; + case EbtInt64: newOp = EOpConvInt64ToUint; break; + case EbtUint64: newOp = EOpConvUint64ToUint; break; + default: + return nullptr; + } + break; + case EbtInt64: + switch (node->getBasicType()) { + case EbtInt8: newOp = EOpConvInt8ToInt64; break; + case EbtUint8: newOp = EOpConvUint8ToInt64; break; + case EbtInt16: newOp = EOpConvInt16ToInt64; break; + case EbtUint16: newOp = EOpConvUint16ToInt64; break; + case EbtInt: newOp = EOpConvIntToInt64; break; + case EbtUint: newOp = EOpConvUintToInt64; break; + case EbtBool: newOp = EOpConvBoolToInt64; break; + case EbtFloat: newOp = EOpConvFloatToInt64; break; + case EbtDouble: newOp = EOpConvDoubleToInt64; break; + case EbtFloat16: newOp = EOpConvFloat16ToInt64; break; + case EbtUint64: newOp = EOpConvUint64ToInt64; break; + default: + return nullptr; + } + break; + case EbtUint64: + switch (node->getBasicType()) { + case EbtInt8: newOp = EOpConvInt8ToUint64; break; + case EbtUint8: newOp = EOpConvUint8ToUint64; break; + case EbtInt16: newOp = EOpConvInt16ToUint64; break; + case EbtUint16: newOp = EOpConvUint16ToUint64; break; + case EbtInt: newOp = EOpConvIntToUint64; break; + case EbtUint: newOp = EOpConvUintToUint64; break; + case EbtBool: newOp = EOpConvBoolToUint64; break; + case EbtFloat: newOp = EOpConvFloatToUint64; break; + case EbtDouble: newOp = EOpConvDoubleToUint64; break; + case EbtFloat16: newOp = EOpConvFloat16ToUint64; break; + case EbtInt64: newOp = EOpConvInt64ToUint64; break; + default: + return nullptr; + } + break; default: return nullptr; } - TType newType(promoteTo, EvqTemporary, node->getVectorSize(), node->getMatrixCols(), node->getMatrixRows()); + TType newType(convertTo, EvqTemporary, node->getVectorSize(), node->getMatrixCols(), node->getMatrixRows()); newNode = addUnaryNode(newOp, node, node->getLoc(), newType); // TODO: it seems that some unary folding operations should occur here, but are not @@ -874,6 +718,298 @@ return newNode; } +// For converting a pair of operands to a binary operation to compatible +// types with each other, relative to the operation in 'op'. +// This does not cover assignment operations, which is asymmetric in that the +// left type is not changeable. +// See addConversion(op, type, node) for assignments and unary operation +// conversions. +// +// Generally, this is focused on basic type conversion, not shape conversion. +// See addShapeConversion() for shape conversions. +// +// Returns the converted pair of nodes. +// Returns when there is no conversion. +std::tuple +TIntermediate::addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* node1) const +{ + if (!isConversionAllowed(op, node0) || !isConversionAllowed(op, node1)) + return std::make_tuple(nullptr, nullptr); + + if (node0->getType() != node1->getType()) { + // If differing structure, then no conversions. + if (node0->isStruct() || node1->isStruct()) + return std::make_tuple(nullptr, nullptr); + + // If differing arrays, then no conversions. + if (node0->getType().isArray() || node1->getType().isArray()) + return std::make_tuple(nullptr, nullptr); + } + + auto promoteTo = std::make_tuple(EbtNumTypes, EbtNumTypes); + + switch (op) { + // + // List all the binary ops that can implicitly convert one operand to the other's type; + // This implements the 'policy' for implicit type conversion. + // + case EOpLessThan: + case EOpGreaterThan: + case EOpLessThanEqual: + case EOpGreaterThanEqual: + case EOpEqual: + case EOpNotEqual: + + case EOpAdd: + case EOpSub: + case EOpMul: + case EOpDiv: + case EOpMod: + + case EOpVectorTimesScalar: + case EOpVectorTimesMatrix: + case EOpMatrixTimesVector: + case EOpMatrixTimesScalar: + + case EOpAnd: + case EOpInclusiveOr: + case EOpExclusiveOr: + + case EOpSequence: // used by ?: + + if (node0->getBasicType() == node1->getBasicType()) + return std::make_tuple(node0, node1); + + promoteTo = getConversionDestinatonType(node0->getBasicType(), node1->getBasicType(), op); + if (std::get<0>(promoteTo) == EbtNumTypes || std::get<1>(promoteTo) == EbtNumTypes) + return std::make_tuple(nullptr, nullptr); + + break; + + case EOpLogicalAnd: + case EOpLogicalOr: + case EOpLogicalXor: + if (source == EShSourceHlsl) + promoteTo = std::make_tuple(EbtBool, EbtBool); + else + return std::make_tuple(node0, node1); + break; + + // There are no conversions needed for GLSL; the shift amount just needs to be an + // integer type, as does the base. + // HLSL can promote bools to ints to make this work. + case EOpLeftShift: + case EOpRightShift: + if (source == EShSourceHlsl) { + TBasicType node0BasicType = node0->getBasicType(); + if (node0BasicType == EbtBool) + node0BasicType = EbtInt; + if (node1->getBasicType() == EbtBool) + promoteTo = std::make_tuple(node0BasicType, EbtInt); + else + promoteTo = std::make_tuple(node0BasicType, node1->getBasicType()); + } else { + if (isTypeInt(node0->getBasicType()) && isTypeInt(node1->getBasicType())) + return std::make_tuple(node0, node1); + else + return std::make_tuple(nullptr, nullptr); + } + break; + + default: + if (node0->getType() == node1->getType()) + return std::make_tuple(node0, node1); + + return std::make_tuple(nullptr, nullptr); + } + + TIntermTyped* newNode0; + TIntermTyped* newNode1; + + if (std::get<0>(promoteTo) != node0->getType().getBasicType()) { + if (node0->getAsConstantUnion()) + newNode0 = promoteConstantUnion(std::get<0>(promoteTo), node0->getAsConstantUnion()); + else + newNode0 = createConversion(std::get<0>(promoteTo), node0); + } else + newNode0 = node0; + + if (std::get<1>(promoteTo) != node1->getType().getBasicType()) { + if (node1->getAsConstantUnion()) + newNode1 = promoteConstantUnion(std::get<1>(promoteTo), node1->getAsConstantUnion()); + else + newNode1 = createConversion(std::get<1>(promoteTo), node1); + } else + newNode1 = node1; + + return std::make_tuple(newNode0, newNode1); +} + +// +// Convert the node's type to the given type, as allowed by the operation involved: 'op'. +// For implicit conversions, 'op' is not the requested conversion, it is the explicit +// operation requiring the implicit conversion. +// +// Binary operation conversions should be handled by addConversion(op, node, node), not here. +// +// Returns a node representing the conversion, which could be the same +// node passed in if no conversion was needed. +// +// Generally, this is focused on basic type conversion, not shape conversion. +// See addShapeConversion() for shape conversions. +// +// Return nullptr if a conversion can't be done. +// +TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TIntermTyped* node) const +{ + if (!isConversionAllowed(op, node)) + return nullptr; + + // Otherwise, if types are identical, no problem + if (type == node->getType()) + return node; + + // If one's a structure, then no conversions. + if (type.isStruct() || node->isStruct()) + return nullptr; + + // If one's an array, then no conversions. + if (type.isArray() || node->getType().isArray()) + return nullptr; + + // Note: callers are responsible for other aspects of shape, + // like vector and matrix sizes. + + TBasicType promoteTo; + + switch (op) { + // + // Explicit conversions (unary operations) + // + case EOpConstructBool: + promoteTo = EbtBool; + break; + case EOpConstructFloat: + promoteTo = EbtFloat; + break; + case EOpConstructDouble: + promoteTo = EbtDouble; + break; + case EOpConstructFloat16: + promoteTo = EbtFloat16; + break; + case EOpConstructInt8: + promoteTo = EbtInt8; + break; + case EOpConstructUint8: + promoteTo = EbtUint8; + break; + case EOpConstructInt16: + promoteTo = EbtInt16; + break; + case EOpConstructUint16: + promoteTo = EbtUint16; + break; + case EOpConstructInt: + promoteTo = EbtInt; + break; + case EOpConstructUint: + promoteTo = EbtUint; + break; + case EOpConstructInt64: + promoteTo = EbtInt64; + break; + case EOpConstructUint64: + promoteTo = EbtUint64; + break; + + case EOpLogicalNot: + + case EOpFunctionCall: + + case EOpReturn: + case EOpAssign: + case EOpAddAssign: + case EOpSubAssign: + case EOpMulAssign: + case EOpVectorTimesScalarAssign: + case EOpMatrixTimesScalarAssign: + case EOpDivAssign: + case EOpModAssign: + case EOpAndAssign: + case EOpInclusiveOrAssign: + case EOpExclusiveOrAssign: + + case EOpAtan: + case EOpClamp: + case EOpCross: + case EOpDistance: + case EOpDot: + case EOpDst: + case EOpFaceForward: + case EOpFma: + case EOpFrexp: + case EOpLdexp: + case EOpMix: + case EOpLit: + case EOpMax: + case EOpMin: + case EOpModf: + case EOpPow: + case EOpReflect: + case EOpRefract: + case EOpSmoothStep: + case EOpStep: + + case EOpSequence: + case EOpConstructStruct: + + if (type.getBasicType() == node->getType().getBasicType()) + return node; + + if (canImplicitlyPromote(node->getBasicType(), type.getBasicType(), op)) + promoteTo = type.getBasicType(); + else + return nullptr; + break; + + // For GLSL, there are no conversions needed; the shift amount just needs to be an + // integer type, as do the base/result. + // HLSL can convert the shift from a bool to an int. + case EOpLeftShiftAssign: + case EOpRightShiftAssign: + { + if (source == EShSourceHlsl && node->getType().getBasicType() == EbtBool) + promoteTo = type.getBasicType(); + else { + if (isTypeInt(type.getBasicType()) && isTypeInt(node->getBasicType())) + return node; + else + return nullptr; + } + break; + } + + default: + // default is to require a match; all exceptions should have case statements above + + if (type.getBasicType() == node->getType().getBasicType()) + return node; + else + return nullptr; + } + + if (node->getAsConstantUnion()) + return promoteConstantUnion(promoteTo, node->getAsConstantUnion()); + + // + // Add a new newNode for the conversion. + // + TIntermUnary* newNode = createConversion(promoteTo, node); + + return newNode; +} + // Convert the node's shape of type for the given type, as allowed by the // operation involved: 'op'. This is for situations where there is only one // direction to consider doing the shape conversion. @@ -1019,12 +1155,11 @@ rhsNode = addShapeConversion(lhsNode->getType(), rhsNode); } -// Convert the node's shape of type for the given type. It's not necessarily -// an error if they are different and not converted, as some operations accept -// mixed types. Promotion will do final shape checking. +// Convert the node's shape of type for the given type, as allowed by the +// operation involved: 'op'. // -// If there is a chance of two nodes, with conversions possible in each direction, -// the policy for what to ask for must be in the caller; this will do what is asked. +// Generally, the AST represents allowed GLSL shapes, so this isn't needed +// for GLSL. Bad shapes are caught in conversion or promotion. // // Return 'node' if no conversion was done. Promotion handles final shape // checking. @@ -1080,6 +1215,166 @@ return node; } +bool TIntermediate::isIntegralPromotion(TBasicType from, TBasicType to) const +{ + // integral promotions + if (to == EbtInt) { + switch(from) { + case EbtInt8: + case EbtInt16: + case EbtUint8: + case EbtUint16: + return true; + default: + break; + } + } + return false; +} + +bool TIntermediate::isFPPromotion(TBasicType from, TBasicType to) const +{ + // floating-point promotions + if (to == EbtDouble) { + switch(from) { + case EbtFloat16: + case EbtFloat: + return true; + default: + break; + } + } + return false; +} + +bool TIntermediate::isIntegralConversion(TBasicType from, TBasicType to) const +{ + switch (from) { + case EbtInt8: + switch (to) { + case EbtUint8: + case EbtInt16: + case EbtUint16: + case EbtUint: + case EbtInt64: + case EbtUint64: + return true; + default: + break; + } + break; + case EbtUint8: + switch (to) { + case EbtInt16: + case EbtUint16: + case EbtUint: + case EbtInt64: + case EbtUint64: + return true; + default: + break; + } + break; + case EbtInt16: + switch(to) { + case EbtUint16: + case EbtUint: + case EbtInt64: + case EbtUint64: + return true; + default: + break; + } + break; + case EbtUint16: + switch(to) { + case EbtUint: + case EbtInt64: + case EbtUint64: + return true; + default: + break; + } + break; + case EbtInt: + switch(to) { + case EbtUint: + return version >= 400 || (source == EShSourceHlsl); + case EbtInt64: + case EbtUint64: + return true; + default: + break; + } + break; + case EbtUint: + switch(to) { + case EbtInt64: + case EbtUint64: + return true; + default: + break; + } + break; + case EbtInt64: + if (to == EbtUint64) { + return true; + } + break; + default: + break; + } + return false; +} + +bool TIntermediate::isFPConversion(TBasicType from, TBasicType to) const +{ + if (to == EbtFloat && from == EbtFloat16) { + return true; + } else { + return false; + } +} + +bool TIntermediate::isFPIntegralConversion(TBasicType from, TBasicType to) const +{ + switch (from) { + case EbtInt8: + case EbtUint8: + case EbtInt16: + case EbtUint16: + switch (to) { + case EbtFloat16: + case EbtFloat: + case EbtDouble: + return true; + default: + break; + } + break; + case EbtInt: + case EbtUint: + switch(to) { + case EbtFloat: + case EbtDouble: + return true; + default: + break; + } + break; + case EbtInt64: + case EbtUint64: + if (to == EbtDouble) { + return true; + } + break; + + default: + break; + } + return false; +} + // // See if the 'from' type is allowed to be implicitly converted to the // 'to' type. This is not about vector/array/struct, only about basic type. @@ -1125,120 +1420,337 @@ } } - switch (to) { - case EbtDouble: - switch (from) { - case EbtInt: - case EbtUint: - case EbtInt64: - case EbtUint64: -#ifdef AMD_EXTENSIONS - case EbtInt16: - case EbtUint16: -#endif - case EbtFloat: + bool explicitTypesEnabled = extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int8) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int16) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int32) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int64) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_float16) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_float32) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_float64); + + if (explicitTypesEnabled) { + // integral promotions + if (isIntegralPromotion(from, to)) { + return true; + } + + // floating-point promotions + if (isFPPromotion(from, to)) { + return true; + } + + // integral conversions + if (isIntegralConversion(from, to)) { + return true; + } + + // floating-point conversions + if (isFPConversion(from, to)) { + return true; + } + + // floating-integral conversions + if (isFPIntegralConversion(from, to)) { + return true; + } + + // hlsl supported conversions + if (source == EShSourceHlsl) { + if (from == EbtBool && (to == EbtInt || to == EbtUint || to == EbtFloat)) + return true; + } + } else { + switch (to) { case EbtDouble: + switch (from) { + case EbtInt: + case EbtUint: + case EbtInt64: + case EbtUint64: #ifdef AMD_EXTENSIONS - case EbtFloat16: + case EbtInt16: + case EbtUint16: #endif - return true; - default: - return false; - } - case EbtFloat: - switch (from) { - case EbtInt: - case EbtUint: + case EbtFloat: + case EbtDouble: #ifdef AMD_EXTENSIONS - case EbtInt16: - case EbtUint16: + case EbtFloat16: #endif + return true; + default: + return false; + } case EbtFloat: + switch (from) { + case EbtInt: + case EbtUint: #ifdef AMD_EXTENSIONS - case EbtFloat16: + case EbtInt16: + case EbtUint16: #endif - return true; - case EbtBool: - return (source == EShSourceHlsl); - default: - return false; - } - case EbtUint: - switch (from) { - case EbtInt: - return version >= 400 || (source == EShSourceHlsl); + case EbtFloat: +#ifdef AMD_EXTENSIONS + case EbtFloat16: +#endif + return true; + case EbtBool: + return (source == EShSourceHlsl); + default: + return false; + } case EbtUint: + switch (from) { + case EbtInt: + return version >= 400 || (source == EShSourceHlsl); + case EbtUint: #ifdef AMD_EXTENSIONS - case EbtInt16: - case EbtUint16: + case EbtInt16: + case EbtUint16: #endif - return true; - case EbtBool: - return (source == EShSourceHlsl); - default: - return false; - } - case EbtInt: - switch (from) { + return true; + case EbtBool: + return (source == EShSourceHlsl); + default: + return false; + } case EbtInt: + switch (from) { + case EbtInt: #ifdef AMD_EXTENSIONS - case EbtInt16: + case EbtInt16: +#endif + return true; + case EbtBool: + return (source == EShSourceHlsl); + default: + return false; + } + case EbtUint64: + switch (from) { + case EbtInt: + case EbtUint: + case EbtInt64: + case EbtUint64: +#ifdef AMD_EXTENSIONS + case EbtInt16: + case EbtUint16: +#endif + return true; + default: + return false; + } + case EbtInt64: + switch (from) { + case EbtInt: + case EbtInt64: +#ifdef AMD_EXTENSIONS + case EbtInt16: +#endif + return true; + default: + return false; + } +#ifdef AMD_EXTENSIONS + case EbtFloat16: + switch (from) { + case EbtInt16: + case EbtUint16: + case EbtFloat16: + return true; + default: + return false; + } + case EbtUint16: + switch (from) { + case EbtInt16: + case EbtUint16: + return true; + default: + return false; + } #endif - return true; - case EbtBool: - return (source == EShSourceHlsl); default: return false; } - case EbtUint64: - switch (from) { - case EbtInt: + } + + return false; +} + +static bool canSignedIntTypeRepresentAllUnsignedValues(TBasicType sintType, TBasicType uintType) { + switch(sintType) { + case EbtInt8: + switch(uintType) { + case EbtUint8: + case EbtUint16: case EbtUint: - case EbtInt64: case EbtUint64: -#ifdef AMD_EXTENSIONS - case EbtInt16: - case EbtUint16: -#endif - return true; + return false; default: + assert(false); return false; } - case EbtInt64: - switch (from) { - case EbtInt: - case EbtInt64: -#ifdef AMD_EXTENSIONS - case EbtInt16: -#endif + break; + case EbtInt16: + switch(uintType) { + case EbtUint8: return true; + case EbtUint16: + case EbtUint: + case EbtUint64: + return false; default: + assert(false); return false; } -#ifdef AMD_EXTENSIONS - case EbtFloat16: - switch (from) { - case EbtInt16: + break; + case EbtInt: + switch(uintType) { + case EbtUint8: case EbtUint16: - case EbtFloat16: return true; + case EbtUint: + return false; default: + assert(false); return false; } - case EbtUint16: - switch (from) { - case EbtInt16: + break; + case EbtInt64: + switch(uintType) { + case EbtUint8: case EbtUint16: + case EbtUint: return true; + case EbtUint64: + return false; default: + assert(false); return false; } -#endif + break; default: + assert(false); return false; } } + +static TBasicType getCorrespondingUnsignedType(TBasicType type) { + switch(type) { + case EbtInt8: + return EbtUint8; + case EbtInt16: + return EbtUint16; + case EbtInt: + return EbtUint; + case EbtInt64: + return EbtUint64; + default: + assert(false); + return EbtNumTypes; + } +} + +// Implements the following rules +// - If either operand has type float64_t or derived from float64_t, +// the other shall be converted to float64_t or derived type. +// - Otherwise, if either operand has type float32_t or derived from +// float32_t, the other shall be converted to float32_t or derived type. +// - Otherwise, if either operand has type float16_t or derived from +// float16_t, the other shall be converted to float16_t or derived type. +// - Otherwise, if both operands have integer types the following rules +// shall be applied to the operands: +// - If both operands have the same type, no further conversion +// is needed. +// - Otherwise, if both operands have signed integer types or both +// have unsigned integer types, the operand with the type of lesser +// integer conversion rank shall be converted to the type of the +// operand with greater rank. +// - Otherwise, if the operand that has unsigned integer type has rank +// greater than or equal to the rank of the type of the other +// operand, the operand with signed integer type shall be converted +// to the type of the operand with unsigned integer type. +// - Otherwise, if the type of the operand with signed integer type can +// represent all of the values of the type of the operand with +// unsigned integer type, the operand with unsigned integer type +// shall be converted to the type of the operand with signed +// integer type. +// - Otherwise, both operands shall be converted to the unsigned +// integer type corresponding to the type of the operand with signed +// integer type. + +std::tuple TIntermediate::getConversionDestinatonType(TBasicType type0, TBasicType type1, TOperator op) const +{ + TBasicType res0 = EbtNumTypes; + TBasicType res1 = EbtNumTypes; + + if (profile == EEsProfile || version == 110) + return std::make_tuple(res0, res1);; + + if (source == EShSourceHlsl) { + if (canImplicitlyPromote(type1, type0, op)) { + res0 = type0; + res1 = type0; + } else if (canImplicitlyPromote(type0, type1, op)) { + res0 = type1; + res1 = type1; + } + return std::make_tuple(res0, res1); + } + + if ((type0 == EbtDouble && canImplicitlyPromote(type1, EbtDouble, op)) || + (type1 == EbtDouble && canImplicitlyPromote(type0, EbtDouble, op)) ) { + res0 = EbtDouble; + res1 = EbtDouble; + } else if ((type0 == EbtFloat && canImplicitlyPromote(type1, EbtFloat, op)) || + (type1 == EbtFloat && canImplicitlyPromote(type0, EbtFloat, op)) ) { + res0 = EbtFloat; + res1 = EbtFloat; + } else if ((type0 == EbtFloat16 && canImplicitlyPromote(type1, EbtFloat16, op)) || + (type1 == EbtFloat16 && canImplicitlyPromote(type0, EbtFloat16, op)) ) { + res0 = EbtFloat16; + res1 = EbtFloat16; + } else if (isTypeInt(type0) && isTypeInt(type1) && + (canImplicitlyPromote(type0, type1, op) || canImplicitlyPromote(type1, type0, op))) { + if ((isTypeSignedInt(type0) && isTypeSignedInt(type1)) || + (isTypeUnsignedInt(type0) && isTypeUnsignedInt(type1))) { + if (getTypeRank(type0) < getTypeRank(type1)) { + res0 = type1; + res1 = type1; + } else { + res0 = type0; + res1 = type0; + } + } else if (isTypeUnsignedInt(type0) && (getTypeRank(type0) > getTypeRank(type1))) { + res0 = type0; + res1 = type0; + } else if (isTypeUnsignedInt(type1) && (getTypeRank(type1) > getTypeRank(type0))) { + res0 = type1; + res1 = type1; + } else if (isTypeSignedInt(type0)) { + if (canSignedIntTypeRepresentAllUnsignedValues(type0, type1)) { + res0 = type0; + res1 = type0; + } else { + res0 = getCorrespondingUnsignedType(type0); + res1 = getCorrespondingUnsignedType(type0); + } + } else if (isTypeSignedInt(type1)) { + if (canSignedIntTypeRepresentAllUnsignedValues(type1, type0)) { + res0 = type1; + res1 = type1; + } else { + res0 = getCorrespondingUnsignedType(type1); + res1 = getCorrespondingUnsignedType(type1); + } + } + } + + return std::make_tuple(res0, res1); +} + // // Given a type, find what operation would fully construct it. // @@ -1246,6 +1758,9 @@ { TOperator op = EOpNull; + if (type.getQualifier().nonUniform) + return EOpConstructNonuniform; + switch (type.getBasicType()) { case EbtStruct: op = EOpConstructStruct; @@ -1331,7 +1846,6 @@ } } break; -#ifdef AMD_EXTENSIONS case EbtFloat16: if (type.getMatrixCols()) { switch (type.getMatrixCols()) { @@ -1361,17 +1875,52 @@ break; } } - else { - switch (type.getVectorSize()) { - case 1: op = EOpConstructFloat16; break; - case 2: op = EOpConstructF16Vec2; break; - case 3: op = EOpConstructF16Vec3; break; - case 4: op = EOpConstructF16Vec4; break; - default: break; // some compilers want this - } + else { + switch (type.getVectorSize()) { + case 1: op = EOpConstructFloat16; break; + case 2: op = EOpConstructF16Vec2; break; + case 3: op = EOpConstructF16Vec3; break; + case 4: op = EOpConstructF16Vec4; break; + default: break; // some compilers want this + } + } + break; + case EbtInt8: + switch(type.getVectorSize()) { + case 1: op = EOpConstructInt8; break; + case 2: op = EOpConstructI8Vec2; break; + case 3: op = EOpConstructI8Vec3; break; + case 4: op = EOpConstructI8Vec4; break; + default: break; // some compilers want this + } + break; + case EbtUint8: + switch(type.getVectorSize()) { + case 1: op = EOpConstructUint8; break; + case 2: op = EOpConstructU8Vec2; break; + case 3: op = EOpConstructU8Vec3; break; + case 4: op = EOpConstructU8Vec4; break; + default: break; // some compilers want this + } + break; + case EbtInt16: + switch(type.getVectorSize()) { + case 1: op = EOpConstructInt16; break; + case 2: op = EOpConstructI16Vec2; break; + case 3: op = EOpConstructI16Vec3; break; + case 4: op = EOpConstructI16Vec4; break; + default: break; // some compilers want this + } + break; + case EbtUint16: + switch(type.getVectorSize()) { + case 1: op = EOpConstructUint16; break; + case 2: op = EOpConstructU16Vec2; break; + case 3: op = EOpConstructU16Vec3; break; + case 4: op = EOpConstructU16Vec4; break; + default: break; // some compilers want this } break; -#endif case EbtInt: if (type.getMatrixCols()) { switch (type.getMatrixCols()) { @@ -1466,26 +2015,6 @@ default: break; // some compilers want this } break; -#ifdef AMD_EXTENSIONS - case EbtInt16: - switch(type.getVectorSize()) { - case 1: op = EOpConstructInt16; break; - case 2: op = EOpConstructI16Vec2; break; - case 3: op = EOpConstructI16Vec3; break; - case 4: op = EOpConstructI16Vec4; break; - default: break; // some compilers want this - } - break; - case EbtUint16: - switch(type.getVectorSize()) { - case 1: op = EOpConstructUint16; break; - case 2: op = EOpConstructU16Vec2; break; - case 3: op = EOpConstructU16Vec3; break; - case 4: op = EOpConstructU16Vec4; break; - default: break; // some compilers want this - } - break; -#endif case EbtBool: if (type.getMatrixCols()) { switch (type.getMatrixCols()) { @@ -1614,7 +2143,7 @@ // // Returns the selection node created. // -TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermNodePair nodePair, const TSourceLoc& loc, TSelectionControl control) +TIntermSelection* TIntermediate::addSelection(TIntermTyped* cond, TIntermNodePair nodePair, const TSourceLoc& loc) { // // Don't prune the false path for compile-time constants; it's needed @@ -1623,7 +2152,6 @@ TIntermSelection* node = new TIntermSelection(cond, nodePair.node1, nodePair.node2); node->setLoc(loc); - node->setSelectionControl(control); return node; } @@ -1666,27 +2194,28 @@ // // Returns the selection node created, or nullptr if one could not be. // -TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, const TSourceLoc& loc, TSelectionControl control) +TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, + const TSourceLoc& loc) { // If it's void, go to the if-then-else selection() if (trueBlock->getBasicType() == EbtVoid && falseBlock->getBasicType() == EbtVoid) { TIntermNodePair pair = { trueBlock, falseBlock }; - return addSelection(cond, pair, loc, control); + TIntermSelection* selection = addSelection(cond, pair, loc); + if (getSource() == EShSourceHlsl) + selection->setNoShortCircuit(); + + return selection; } // // Get compatible types. // - TIntermTyped* child = addConversion(EOpSequence, trueBlock->getType(), falseBlock); - if (child) - falseBlock = child; - else { - child = addConversion(EOpSequence, falseBlock->getType(), trueBlock); - if (child) - trueBlock = child; - else - return nullptr; - } + auto children = addConversion(EOpSequence, trueBlock, falseBlock); + trueBlock = std::get<0>(children); + falseBlock = std::get<1>(children); + + if (trueBlock == nullptr || falseBlock == nullptr) + return nullptr; // Handle a vector condition as a mix if (!cond->getType().isScalarOrVec1()) { @@ -1742,6 +2271,9 @@ else node->getQualifier().makeTemporary(); + if (getSource() == EShSourceHlsl) + node->setNoShortCircuit(); + return node; } @@ -1761,6 +2293,37 @@ return node; } +TIntermConstantUnion* TIntermediate::addConstantUnion(signed char i8, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setI8Const(i8); + + return addConstantUnion(unionArray, TType(EbtInt8, EvqConst), loc, literal); +} + +TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned char u8, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setUConst(u8); + + return addConstantUnion(unionArray, TType(EbtUint8, EvqConst), loc, literal); +} + +TIntermConstantUnion* TIntermediate::addConstantUnion(signed short i16, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setI16Const(i16); + + return addConstantUnion(unionArray, TType(EbtInt16, EvqConst), loc, literal); +} + +TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned short u16, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setU16Const(u16); + + return addConstantUnion(unionArray, TType(EbtUint16, EvqConst), loc, literal); +} TIntermConstantUnion* TIntermediate::addConstantUnion(int i, const TSourceLoc& loc, bool literal) const { @@ -1794,24 +2357,6 @@ return addConstantUnion(unionArray, TType(EbtUint64, EvqConst), loc, literal); } -#ifdef AMD_EXTENSIONS -TIntermConstantUnion* TIntermediate::addConstantUnion(short i16, const TSourceLoc& loc, bool literal) const -{ - TConstUnionArray unionArray(1); - unionArray[0].setIConst(i16); - - return addConstantUnion(unionArray, TType(EbtInt16, EvqConst), loc, literal); -} - -TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned short u16, const TSourceLoc& loc, bool literal) const -{ - TConstUnionArray unionArray(1); - unionArray[0].setUConst(u16); - - return addConstantUnion(unionArray, TType(EbtUint16, EvqConst), loc, literal); -} -#endif - TIntermConstantUnion* TIntermediate::addConstantUnion(bool b, const TSourceLoc& loc, bool literal) const { TConstUnionArray unionArray(1); @@ -1822,11 +2367,7 @@ TIntermConstantUnion* TIntermediate::addConstantUnion(double d, TBasicType baseType, const TSourceLoc& loc, bool literal) const { -#ifdef AMD_EXTENSIONS assert(baseType == EbtFloat || baseType == EbtDouble || baseType == EbtFloat16); -#else - assert(baseType == EbtFloat || baseType == EbtDouble); -#endif TConstUnionArray unionArray(1); unionArray[0].setDConst(d); @@ -1909,11 +2450,11 @@ // // Create while and do-while loop nodes. // -TIntermLoop* TIntermediate::addLoop(TIntermNode* body, TIntermTyped* test, TIntermTyped* terminal, bool testFirst, const TSourceLoc& loc, TLoopControl control) +TIntermLoop* TIntermediate::addLoop(TIntermNode* body, TIntermTyped* test, TIntermTyped* terminal, bool testFirst, + const TSourceLoc& loc) { TIntermLoop* node = new TIntermLoop(body, test, terminal, testFirst); node->setLoc(loc); - node->setLoopControl(control); return node; } @@ -1921,11 +2462,11 @@ // // Create a for-loop sequence. // -TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* initializer, TIntermTyped* test, TIntermTyped* terminal, bool testFirst, const TSourceLoc& loc, TLoopControl control) +TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* initializer, TIntermTyped* test, + TIntermTyped* terminal, bool testFirst, const TSourceLoc& loc, TIntermLoop*& node) { - TIntermLoop* node = new TIntermLoop(body, test, terminal, testFirst); + node = new TIntermLoop(body, test, terminal, testFirst); node->setLoc(loc); - node->setLoopControl(control); // make a sequence of the initializer and statement, but try to reuse the // aggregate already created for whatever is in the initializer, if there is one @@ -2121,12 +2662,10 @@ case EOpVectorSwizzle: case EOpConvFloatToDouble: case EOpConvDoubleToFloat: -#ifdef AMD_EXTENSIONS case EOpConvFloat16ToFloat: case EOpConvFloatToFloat16: case EOpConvFloat16ToDouble: case EOpConvDoubleToFloat16: -#endif return true; default: return false; @@ -2150,51 +2689,97 @@ case EOpIndexDirectStruct: case EOpVectorSwizzle: - // conversion constructors + // (u)int* -> bool + case EOpConvInt8ToBool: + case EOpConvInt16ToBool: case EOpConvIntToBool: + case EOpConvInt64ToBool: + case EOpConvUint8ToBool: + case EOpConvUint16ToBool: case EOpConvUintToBool: - case EOpConvUintToInt: + case EOpConvUint64ToBool: + + // bool -> (u)int* + case EOpConvBoolToInt8: + case EOpConvBoolToInt16: case EOpConvBoolToInt: - case EOpConvIntToUint: - case EOpConvBoolToUint: - case EOpConvInt64ToBool: case EOpConvBoolToInt64: - case EOpConvUint64ToBool: + case EOpConvBoolToUint8: + case EOpConvBoolToUint16: + case EOpConvBoolToUint: case EOpConvBoolToUint64: - case EOpConvInt64ToInt: - case EOpConvIntToInt64: - case EOpConvUint64ToUint: - case EOpConvUintToUint64: - case EOpConvInt64ToUint64: - case EOpConvUint64ToInt64: - case EOpConvInt64ToUint: - case EOpConvUintToInt64: - case EOpConvUint64ToInt: - case EOpConvIntToUint64: -#ifdef AMD_EXTENSIONS - case EOpConvInt16ToBool: - case EOpConvBoolToInt16: + + // int8_t -> (u)int* + case EOpConvInt8ToInt16: + case EOpConvInt8ToInt: + case EOpConvInt8ToInt64: + case EOpConvInt8ToUint8: + case EOpConvInt8ToUint16: + case EOpConvInt8ToUint: + case EOpConvInt8ToUint64: + + // int16_t -> (u)int* + case EOpConvInt16ToInt8: case EOpConvInt16ToInt: - case EOpConvIntToInt16: - case EOpConvInt16ToUint: - case EOpConvUintToInt16: case EOpConvInt16ToInt64: - case EOpConvInt64ToInt16: + case EOpConvInt16ToUint8: + case EOpConvInt16ToUint16: + case EOpConvInt16ToUint: case EOpConvInt16ToUint64: - case EOpConvUint64ToInt16: - case EOpConvUint16ToBool: - case EOpConvBoolToUint16: - case EOpConvUint16ToInt: + + // int32_t -> (u)int* + case EOpConvIntToInt8: + case EOpConvIntToInt16: + case EOpConvIntToInt64: + case EOpConvIntToUint8: case EOpConvIntToUint16: - case EOpConvUint16ToUint: - case EOpConvUintToUint16: - case EOpConvUint16ToInt64: + case EOpConvIntToUint: + case EOpConvIntToUint64: + + // int64_t -> (u)int* + case EOpConvInt64ToInt8: + case EOpConvInt64ToInt16: + case EOpConvInt64ToInt: + case EOpConvInt64ToUint8: case EOpConvInt64ToUint16: + case EOpConvInt64ToUint: + case EOpConvInt64ToUint64: + + // uint8_t -> (u)int* + case EOpConvUint8ToInt8: + case EOpConvUint8ToInt16: + case EOpConvUint8ToInt: + case EOpConvUint8ToInt64: + case EOpConvUint8ToUint16: + case EOpConvUint8ToUint: + case EOpConvUint8ToUint64: + + // uint16_t -> (u)int* + case EOpConvUint16ToInt8: + case EOpConvUint16ToInt16: + case EOpConvUint16ToInt: + case EOpConvUint16ToInt64: + case EOpConvUint16ToUint8: + case EOpConvUint16ToUint: case EOpConvUint16ToUint64: + + // uint32_t -> (u)int* + case EOpConvUintToInt8: + case EOpConvUintToInt16: + case EOpConvUintToInt: + case EOpConvUintToInt64: + case EOpConvUintToUint8: + case EOpConvUintToUint16: + case EOpConvUintToUint64: + + // uint64_t -> (u)int* + case EOpConvUint64ToInt8: + case EOpConvUint64ToInt16: + case EOpConvUint64ToInt: + case EOpConvUint64ToInt64: + case EOpConvUint64ToUint8: case EOpConvUint64ToUint16: - case EOpConvInt16ToUint16: - case EOpConvUint16ToInt16: -#endif + case EOpConvUint64ToUint: // unary operations case EOpNegative: @@ -2228,6 +2813,64 @@ } } +// Is the operation one that must propagate nonuniform? +bool TIntermediate::isNonuniformPropagating(TOperator op) const +{ + // "* All Operators in Section 5.1 (Operators), except for assignment, + // arithmetic assignment, and sequence + // * Component selection in Section 5.5 + // * Matrix components in Section 5.6 + // * Structure and Array Operations in Section 5.7, except for the length + // method." + switch (op) { + case EOpPostIncrement: + case EOpPostDecrement: + case EOpPreIncrement: + case EOpPreDecrement: + + case EOpNegative: + case EOpLogicalNot: + case EOpVectorLogicalNot: + case EOpBitwiseNot: + + case EOpAdd: + case EOpSub: + case EOpMul: + case EOpDiv: + case EOpMod: + case EOpRightShift: + case EOpLeftShift: + case EOpAnd: + case EOpInclusiveOr: + case EOpExclusiveOr: + case EOpEqual: + case EOpNotEqual: + case EOpLessThan: + case EOpGreaterThan: + case EOpLessThanEqual: + case EOpGreaterThanEqual: + case EOpVectorTimesScalar: + case EOpVectorTimesMatrix: + case EOpMatrixTimesVector: + case EOpMatrixTimesScalar: + + case EOpLogicalOr: + case EOpLogicalXor: + case EOpLogicalAnd: + + case EOpIndexDirect: + case EOpIndexIndirect: + case EOpIndexDirectStruct: + case EOpVectorSwizzle: + return true; + + default: + break; + } + + return false; +} + //////////////////////////////////////////////////////////////// // // Member functions of the nodes used for building the tree. @@ -2312,7 +2955,7 @@ // Convert operand to a boolean type if (operand->getBasicType() != EbtBool) { // Add constructor to boolean type. If that fails, we can't do it, so return false. - TIntermTyped* converted = convertToBasicType(op, EbtBool, operand); + TIntermTyped* converted = addConversion(op, TType(EbtBool), operand); if (converted == nullptr) return false; @@ -2321,15 +2964,7 @@ } break; case EOpBitwiseNot: - if (operand->getBasicType() != EbtInt && - operand->getBasicType() != EbtUint && -#ifdef AMD_EXTENSIONS - operand->getBasicType() != EbtInt16 && - operand->getBasicType() != EbtUint16 && -#endif - operand->getBasicType() != EbtInt64 && - operand->getBasicType() != EbtUint64) - + if (!isTypeInt(operand->getBasicType())) return false; break; case EOpNegative: @@ -2337,18 +2972,9 @@ case EOpPostDecrement: case EOpPreIncrement: case EOpPreDecrement: - if (operand->getBasicType() != EbtInt && - operand->getBasicType() != EbtUint && - operand->getBasicType() != EbtInt64 && - operand->getBasicType() != EbtUint64 && -#ifdef AMD_EXTENSIONS - operand->getBasicType() != EbtInt16 && - operand->getBasicType() != EbtUint16 && -#endif + if (!isTypeInt(operand->getBasicType()) && operand->getBasicType() != EbtFloat && -#ifdef AMD_EXTENSIONS operand->getBasicType() != EbtFloat16 && -#endif operand->getBasicType() != EbtDouble) return false; @@ -2368,34 +2994,12 @@ void TIntermUnary::updatePrecision() { -#ifdef AMD_EXTENSIONS if (getBasicType() == EbtInt || getBasicType() == EbtUint || getBasicType() == EbtFloat || getBasicType() == EbtFloat16) { -#else - if (getBasicType() == EbtInt || getBasicType() == EbtUint || getBasicType() == EbtFloat) { -#endif if (operand->getQualifier().precision > getQualifier().precision) getQualifier().precision = operand->getQualifier().precision; } } -// If it is not already, convert this node to the given basic type. -TIntermTyped* TIntermediate::convertToBasicType(TOperator op, TBasicType basicType, TIntermTyped* node) const -{ - if (node == nullptr) - return nullptr; - - // It's already this basic type: nothing needs to be done, so use the node directly. - if (node->getBasicType() == basicType) - return node; - - const TType& type = node->getType(); - const TType newType(basicType, type.getQualifier().storage, - type.getVectorSize(), type.getMatrixCols(), type.getMatrixRows(), type.isVector()); - - // Add constructor to the right vectorness of the right type. If that fails, we can't do it, so return nullptr. - return addConversion(op, newType, node); -} - // // See TIntermediate::promote // @@ -2468,12 +3072,19 @@ case EOpSub: case EOpDiv: case EOpMul: - left = addConversion(op, TType(EbtInt, EvqTemporary, left->getVectorSize()), left); - right = addConversion(op, TType(EbtInt, EvqTemporary, right->getVectorSize()), right); + if (left->getBasicType() == EbtBool) + left = createConversion(EbtInt, left); + if (right->getBasicType() == EbtBool) + right = createConversion(EbtInt, right); if (left == nullptr || right == nullptr) return false; node.setLeft(left); node.setRight(right); + + // Update the original base assumption on result type.. + node.setType(left->getType()); + node.getWritableType().getQualifier().clear(); + break; default: @@ -2515,21 +3126,17 @@ case EOpLogicalAnd: case EOpLogicalOr: case EOpLogicalXor: - if (getSource() == EShSourceHlsl) { - TIntermTyped* convertedL = convertToBasicType(op, EbtBool, left); - TIntermTyped* convertedR = convertToBasicType(op, EbtBool, right); - if (convertedL == nullptr || convertedR == nullptr) + // logical ops operate only on Booleans or vectors of Booleans. + if (left->getBasicType() != EbtBool || left->isMatrix()) return false; - node.setLeft(left = convertedL); // also updates stack variable - node.setRight(right = convertedR); // also updates stack variable - } else { + + if (getSource() == EShSourceGlsl) { // logical ops operate only on scalar Booleans and will promote to scalar Boolean. - if (left->getBasicType() != EbtBool || left->isVector() || left->isMatrix()) + if (left->isVector()) return false; } node.setType(TType(EbtBool, EvqTemporary, left->getVectorSize())); - break; case EOpRightShift: @@ -2550,16 +3157,7 @@ break; // Check for integer-only operands. - if ((left->getBasicType() != EbtInt && left->getBasicType() != EbtUint && -#ifdef AMD_EXTENSIONS - left->getBasicType() != EbtInt16 && left->getBasicType() != EbtUint16 && -#endif - left->getBasicType() != EbtInt64 && left->getBasicType() != EbtUint64) || - (right->getBasicType() != EbtInt && right->getBasicType() != EbtUint && -#ifdef AMD_EXTENSIONS - right->getBasicType() != EbtInt16 && right->getBasicType() != EbtUint16 && -#endif - right->getBasicType() != EbtInt64 && right->getBasicType() != EbtUint64)) + if (!isTypeInt(left->getBasicType()) && !isTypeInt(right->getBasicType())) return false; if (left->isMatrix() || right->isMatrix()) return false; @@ -2700,7 +3298,7 @@ node.setOp(op = EOpMatrixTimesScalarAssign); } } else if (left->isMatrix() && right->isMatrix()) { - if (left->getMatrixCols() != left->getMatrixRows() || left->getMatrixCols() != right->getMatrixCols() || left->getMatrixCols() != right->getMatrixRows()) + if (left->getMatrixCols() != right->getMatrixCols() || left->getMatrixCols() != right->getMatrixRows()) return false; node.setOp(op = EOpMatrixTimesMatrixAssign); } else if (!left->isMatrix() && !right->isMatrix()) { @@ -2860,11 +3458,7 @@ void TIntermBinary::updatePrecision() { -#ifdef AMD_EXTENSIONS if (getBasicType() == EbtInt || getBasicType() == EbtUint || getBasicType() == EbtFloat || getBasicType() == EbtFloat16) { -#else - if (getBasicType() == EbtInt || getBasicType() == EbtUint || getBasicType() == EbtFloat) { -#endif getQualifier().precision = std::max(right->getQualifier().precision, left->getQualifier().precision); if (getQualifier().precision != EpqNone) { left->propagatePrecision(getQualifier().precision); @@ -2875,11 +3469,7 @@ void TIntermTyped::propagatePrecision(TPrecisionQualifier newPrecision) { -#ifdef AMD_EXTENSIONS if (getQualifier().precision != EpqNone || (getBasicType() != EbtInt && getBasicType() != EbtUint && getBasicType() != EbtFloat && getBasicType() != EbtFloat16)) -#else - if (getQualifier().precision != EpqNone || (getBasicType() != EbtInt && getBasicType() != EbtUint && getBasicType() != EbtFloat)) -#endif return; getQualifier().precision = newPrecision; @@ -2954,9 +3544,7 @@ break; case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif leftUnionArray[i] = rightUnionArray[i]; break; default: @@ -2982,16 +3570,13 @@ break; case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif leftUnionArray[i] = rightUnionArray[i]; break; default: return node; } break; -#ifdef AMD_EXTENSIONS case EbtFloat16: switch (node->getType().getBasicType()) { case EbtInt: @@ -3018,7 +3603,6 @@ return node; } break; -#endif case EbtInt: switch (node->getType().getBasicType()) { case EbtInt: @@ -3038,9 +3622,7 @@ break; case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif leftUnionArray[i].setIConst(static_cast(rightUnionArray[i].getDConst())); break; default: @@ -3066,9 +3648,7 @@ break; case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif leftUnionArray[i].setUConst(static_cast(rightUnionArray[i].getDConst())); break; default: @@ -3094,9 +3674,7 @@ break; case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif leftUnionArray[i].setBConst(rightUnionArray[i].getDConst() != 0.0); break; default: @@ -3122,9 +3700,7 @@ break; case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif leftUnionArray[i].setI64Const(static_cast(rightUnionArray[i].getDConst())); break; default: @@ -3150,9 +3726,7 @@ break; case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif leftUnionArray[i].setU64Const(static_cast(rightUnionArray[i].getDConst())); break; default: @@ -3170,10 +3744,10 @@ node->getLoc()); } -void TIntermAggregate::addToPragmaTable(const TPragmaTable& pTable) +void TIntermAggregate::setPragmaTable(const TPragmaTable& pTable) { - assert(!pragmaTable); - pragmaTable = new TPragmaTable(); + assert(pragmaTable == nullptr); + pragmaTable = new TPragmaTable; *pragmaTable = pTable; } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/intermOut.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/intermOut.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/intermOut.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/intermOut.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2016 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -224,48 +225,192 @@ case EOpPreIncrement: out.debug << "Pre-Increment"; break; case EOpPreDecrement: out.debug << "Pre-Decrement"; break; + // * -> bool + case EOpConvInt8ToBool: out.debug << "Convert int8_t to bool"; break; + case EOpConvUint8ToBool: out.debug << "Convert uint8_t to bool"; break; + case EOpConvInt16ToBool: out.debug << "Convert int16_t to bool"; break; + case EOpConvUint16ToBool: out.debug << "Convert uint16_t to bool";break; case EOpConvIntToBool: out.debug << "Convert int to bool"; break; case EOpConvUintToBool: out.debug << "Convert uint to bool"; break; - case EOpConvFloatToBool: out.debug << "Convert float to bool"; break; - case EOpConvDoubleToBool: out.debug << "Convert double to bool"; break; case EOpConvInt64ToBool: out.debug << "Convert int64 to bool"; break; case EOpConvUint64ToBool: out.debug << "Convert uint64 to bool"; break; - case EOpConvIntToFloat: out.debug << "Convert int to float"; break; - case EOpConvUintToFloat: out.debug << "Convert uint to float"; break; - case EOpConvDoubleToFloat: out.debug << "Convert double to float"; break; - case EOpConvInt64ToFloat: out.debug << "Convert int64 to float"; break; - case EOpConvUint64ToFloat: out.debug << "Convert uint64 to float"; break; - case EOpConvBoolToFloat: out.debug << "Convert bool to float"; break; - case EOpConvUintToInt: out.debug << "Convert uint to int"; break; - case EOpConvFloatToInt: out.debug << "Convert float to int"; break; - case EOpConvDoubleToInt: out.debug << "Convert double to int"; break; - case EOpConvBoolToInt: out.debug << "Convert bool to int"; break; - case EOpConvInt64ToInt: out.debug << "Convert int64 to int"; break; - case EOpConvUint64ToInt: out.debug << "Convert uint64 to int"; break; - case EOpConvIntToUint: out.debug << "Convert int to uint"; break; - case EOpConvFloatToUint: out.debug << "Convert float to uint"; break; - case EOpConvDoubleToUint: out.debug << "Convert double to uint"; break; + case EOpConvFloat16ToBool: out.debug << "Convert float16_t to bool"; break; + case EOpConvFloatToBool: out.debug << "Convert float to bool"; break; + case EOpConvDoubleToBool: out.debug << "Convert double to bool"; break; + + // bool -> * + case EOpConvBoolToInt8: out.debug << "Convert bool to int8_t"; break; + case EOpConvBoolToUint8: out.debug << "Convert bool to uint8_t"; break; + case EOpConvBoolToInt16: out.debug << "Convert bool to in16t_t"; break; + case EOpConvBoolToUint16: out.debug << "Convert bool to uint16_t";break; + case EOpConvBoolToInt: out.debug << "Convert bool to int" ; break; case EOpConvBoolToUint: out.debug << "Convert bool to uint"; break; - case EOpConvInt64ToUint: out.debug << "Convert int64 to uint"; break; - case EOpConvUint64ToUint: out.debug << "Convert uint64 to uint"; break; + case EOpConvBoolToInt64: out.debug << "Convert bool to int64"; break; + case EOpConvBoolToUint64: out.debug << "Convert bool to uint64";break; + case EOpConvBoolToFloat16: out.debug << "Convert bool to float16_t"; break; + case EOpConvBoolToFloat: out.debug << "Convert bool to float"; break; + case EOpConvBoolToDouble: out.debug << "Convert bool to double"; break; + + // int8_t -> (u)int* + case EOpConvInt8ToInt16: out.debug << "Convert int8_t to int16_t";break; + case EOpConvInt8ToInt: out.debug << "Convert int8_t to int"; break; + case EOpConvInt8ToInt64: out.debug << "Convert int8_t to int64"; break; + case EOpConvInt8ToUint8: out.debug << "Convert int8_t to uint8_t";break; + case EOpConvInt8ToUint16: out.debug << "Convert int8_t to uint16_t";break; + case EOpConvInt8ToUint: out.debug << "Convert int8_t to uint"; break; + case EOpConvInt8ToUint64: out.debug << "Convert int8_t to uint64"; break; + + // uint8_t -> (u)int* + case EOpConvUint8ToInt8: out.debug << "Convert uint8_t to int8_t";break; + case EOpConvUint8ToInt16: out.debug << "Convert uint8_t to int16_t";break; + case EOpConvUint8ToInt: out.debug << "Convert uint8_t to int"; break; + case EOpConvUint8ToInt64: out.debug << "Convert uint8_t to int64"; break; + case EOpConvUint8ToUint16: out.debug << "Convert uint8_t to uint16_t";break; + case EOpConvUint8ToUint: out.debug << "Convert uint8_t to uint"; break; + case EOpConvUint8ToUint64: out.debug << "Convert uint8_t to uint64"; break; + + // int8_t -> float* + case EOpConvInt8ToFloat16: out.debug << "Convert int8_t to float16_t";break; + case EOpConvInt8ToFloat: out.debug << "Convert int8_t to float"; break; + case EOpConvInt8ToDouble: out.debug << "Convert int8_t to double"; break; + + // uint8_t -> float* + case EOpConvUint8ToFloat16: out.debug << "Convert uint8_t to float16_t";break; + case EOpConvUint8ToFloat: out.debug << "Convert uint8_t to float"; break; + case EOpConvUint8ToDouble: out.debug << "Convert uint8_t to double"; break; + + // int16_t -> (u)int* + case EOpConvInt16ToInt8: out.debug << "Convert int16_t to int8_t";break; + case EOpConvInt16ToInt: out.debug << "Convert int16_t to int"; break; + case EOpConvInt16ToInt64: out.debug << "Convert int16_t to int64"; break; + case EOpConvInt16ToUint8: out.debug << "Convert int16_t to uint8_t";break; + case EOpConvInt16ToUint16: out.debug << "Convert int16_t to uint16_t";break; + case EOpConvInt16ToUint: out.debug << "Convert int16_t to uint"; break; + case EOpConvInt16ToUint64: out.debug << "Convert int16_t to uint64"; break; + + // int16_t -> float* + case EOpConvInt16ToFloat16: out.debug << "Convert int16_t to float16_t";break; + case EOpConvInt16ToFloat: out.debug << "Convert int16_t to float"; break; + case EOpConvInt16ToDouble: out.debug << "Convert int16_t to double"; break; + + // uint16_t -> (u)int* + case EOpConvUint16ToInt8: out.debug << "Convert uint16_t to int8_t";break; + case EOpConvUint16ToInt16: out.debug << "Convert uint16_t to int16_t";break; + case EOpConvUint16ToInt: out.debug << "Convert uint16_t to int"; break; + case EOpConvUint16ToInt64: out.debug << "Convert uint16_t to int64"; break; + case EOpConvUint16ToUint8: out.debug << "Convert uint16_t to uint8_t";break; + case EOpConvUint16ToUint: out.debug << "Convert uint16_t to uint"; break; + case EOpConvUint16ToUint64: out.debug << "Convert uint16_t to uint64"; break; + + // uint16_t -> float* + case EOpConvUint16ToFloat16: out.debug << "Convert uint16_t to float16_t";break; + case EOpConvUint16ToFloat: out.debug << "Convert uint16_t to float"; break; + case EOpConvUint16ToDouble: out.debug << "Convert uint16_t to double"; break; + + // int32_t -> (u)int* + case EOpConvIntToInt8: out.debug << "Convert int to int8_t";break; + case EOpConvIntToInt16: out.debug << "Convert int to int16_t";break; + case EOpConvIntToInt64: out.debug << "Convert int to int64"; break; + case EOpConvIntToUint8: out.debug << "Convert int to uint8_t";break; + case EOpConvIntToUint16: out.debug << "Convert int to uint16_t";break; + case EOpConvIntToUint: out.debug << "Convert int to uint"; break; + case EOpConvIntToUint64: out.debug << "Convert int to uint64"; break; + + // int32_t -> float* + case EOpConvIntToFloat16: out.debug << "Convert int to float16_t";break; + case EOpConvIntToFloat: out.debug << "Convert int to float"; break; case EOpConvIntToDouble: out.debug << "Convert int to double"; break; - case EOpConvUintToDouble: out.debug << "Convert uint to double"; break; - case EOpConvFloatToDouble: out.debug << "Convert float to double"; break; - case EOpConvBoolToDouble: out.debug << "Convert bool to double"; break; - case EOpConvInt64ToDouble: out.debug << "Convert int64 to double"; break; - case EOpConvUint64ToDouble: out.debug << "Convert uint64 to double"; break; - case EOpConvBoolToInt64: out.debug << "Convert bool to int64"; break; - case EOpConvIntToInt64: out.debug << "Convert int to int64"; break; + + // uint32_t -> (u)int* + case EOpConvUintToInt8: out.debug << "Convert uint to int8_t";break; + case EOpConvUintToInt16: out.debug << "Convert uint to int16_t";break; + case EOpConvUintToInt: out.debug << "Convert uint to int";break; case EOpConvUintToInt64: out.debug << "Convert uint to int64"; break; - case EOpConvFloatToInt64: out.debug << "Convert float to int64"; break; - case EOpConvDoubleToInt64: out.debug << "Convert double to int64"; break; - case EOpConvUint64ToInt64: out.debug << "Convert uint64 to int64"; break; - case EOpConvBoolToUint64: out.debug << "Convert bool to uint64"; break; - case EOpConvIntToUint64: out.debug << "Convert int to uint64"; break; - case EOpConvUintToUint64: out.debug << "Convert uint to uint64"; break; + case EOpConvUintToUint8: out.debug << "Convert uint to uint8_t";break; + case EOpConvUintToUint16: out.debug << "Convert uint to uint16_t";break; + case EOpConvUintToUint64: out.debug << "Convert uint to uint64"; break; + + // uint32_t -> float* + case EOpConvUintToFloat16: out.debug << "Convert uint to float16_t";break; + case EOpConvUintToFloat: out.debug << "Convert uint to float"; break; + case EOpConvUintToDouble: out.debug << "Convert uint to double"; break; + + // int64 -> (u)int* + case EOpConvInt64ToInt8: out.debug << "Convert int64 to int8_t"; break; + case EOpConvInt64ToInt16: out.debug << "Convert int64 to int16_t"; break; + case EOpConvInt64ToInt: out.debug << "Convert int64 to int"; break; + case EOpConvInt64ToUint8: out.debug << "Convert int64 to uint8_t";break; + case EOpConvInt64ToUint16: out.debug << "Convert int64 to uint16_t";break; + case EOpConvInt64ToUint: out.debug << "Convert int64 to uint"; break; + case EOpConvInt64ToUint64: out.debug << "Convert int64 to uint64"; break; + + // int64 -> float* + case EOpConvInt64ToFloat16: out.debug << "Convert int64 to float16_t";break; + case EOpConvInt64ToFloat: out.debug << "Convert int64 to float"; break; + case EOpConvInt64ToDouble: out.debug << "Convert int64 to double"; break; + + // uint64 -> (u)int* + case EOpConvUint64ToInt8: out.debug << "Convert uint64 to int8_t";break; + case EOpConvUint64ToInt16: out.debug << "Convert uint64 to int16_t";break; + case EOpConvUint64ToInt: out.debug << "Convert uint64 to int"; break; + case EOpConvUint64ToInt64: out.debug << "Convert uint64 to int64"; break; + case EOpConvUint64ToUint8: out.debug << "Convert uint64 to uint8_t";break; + case EOpConvUint64ToUint16: out.debug << "Convert uint64 to uint16"; break; + case EOpConvUint64ToUint: out.debug << "Convert uint64 to uint"; break; + + // uint64 -> float* + case EOpConvUint64ToFloat16: out.debug << "Convert uint64 to float16_t";break; + case EOpConvUint64ToFloat: out.debug << "Convert uint64 to float"; break; + case EOpConvUint64ToDouble: out.debug << "Convert uint64 to double"; break; + + // float16_t -> int* + case EOpConvFloat16ToInt8: out.debug << "Convert float16_t to int8_t"; break; + case EOpConvFloat16ToInt16: out.debug << "Convert float16_t to int16_t"; break; + case EOpConvFloat16ToInt: out.debug << "Convert float16_t to int"; break; + case EOpConvFloat16ToInt64: out.debug << "Convert float16_t to int64"; break; + + // float16_t -> uint* + case EOpConvFloat16ToUint8: out.debug << "Convert float16_t to uint8_t"; break; + case EOpConvFloat16ToUint16: out.debug << "Convert float16_t to uint16_t"; break; + case EOpConvFloat16ToUint: out.debug << "Convert float16_t to uint"; break; + case EOpConvFloat16ToUint64: out.debug << "Convert float16_t to uint64"; break; + + // float16_t -> float* + case EOpConvFloat16ToFloat: out.debug << "Convert float16_t to float"; break; + case EOpConvFloat16ToDouble: out.debug << "Convert float16_t to double"; break; + + // float32 -> float* + case EOpConvFloatToFloat16: out.debug << "Convert float to float16_t"; break; + case EOpConvFloatToDouble: out.debug << "Convert float to double"; break; + + // float32_t -> int* + case EOpConvFloatToInt8: out.debug << "Convert float to int8_t"; break; + case EOpConvFloatToInt16: out.debug << "Convert float to int16_t"; break; + case EOpConvFloatToInt: out.debug << "Convert float to int"; break; + case EOpConvFloatToInt64: out.debug << "Convert float to int64"; break; + + // float32_t -> uint* + case EOpConvFloatToUint8: out.debug << "Convert float to uint8_t"; break; + case EOpConvFloatToUint16: out.debug << "Convert float to uint16_t"; break; + case EOpConvFloatToUint: out.debug << "Convert float to uint"; break; case EOpConvFloatToUint64: out.debug << "Convert float to uint64"; break; + + // double -> float* + case EOpConvDoubleToFloat16: out.debug << "Convert double to float16_t"; break; + case EOpConvDoubleToFloat: out.debug << "Convert double to float"; break; + + // double -> int* + case EOpConvDoubleToInt8: out.debug << "Convert double to int8_t"; break; + case EOpConvDoubleToInt16: out.debug << "Convert double to int16_t"; break; + case EOpConvDoubleToInt: out.debug << "Convert double to int"; break; + case EOpConvDoubleToInt64: out.debug << "Convert double to int64"; break; + + // float32_t -> uint* + case EOpConvDoubleToUint8: out.debug << "Convert double to uint8_t"; break; + case EOpConvDoubleToUint16: out.debug << "Convert double to uint16_t"; break; + case EOpConvDoubleToUint: out.debug << "Convert double to uint"; break; case EOpConvDoubleToUint64: out.debug << "Convert double to uint64"; break; - case EOpConvInt64ToUint64: out.debug << "Convert uint64 to uint64"; break; + case EOpRadians: out.debug << "radians"; break; case EOpDegrees: out.debug << "degrees"; break; @@ -309,12 +454,10 @@ case EOpDoubleBitsToUint64: out.debug << "doubleBitsToUint64"; break; case EOpInt64BitsToDouble: out.debug << "int64BitsToDouble"; break; case EOpUint64BitsToDouble: out.debug << "uint64BitsToDouble"; break; -#ifdef AMD_EXTENSIONS case EOpFloat16BitsToInt16: out.debug << "float16BitsToInt16"; break; case EOpFloat16BitsToUint16: out.debug << "float16BitsToUint16"; break; case EOpInt16BitsToFloat16: out.debug << "int16BitsToFloat16"; break; case EOpUint16BitsToFloat16: out.debug << "uint16BitsToFloat16"; break; -#endif case EOpPackSnorm2x16: out.debug << "packSnorm2x16"; break; case EOpUnpackSnorm2x16:out.debug << "unpackSnorm2x16"; break; @@ -322,6 +465,12 @@ case EOpUnpackUnorm2x16:out.debug << "unpackUnorm2x16"; break; case EOpPackHalf2x16: out.debug << "packHalf2x16"; break; case EOpUnpackHalf2x16: out.debug << "unpackHalf2x16"; break; + case EOpPack16: out.debug << "pack16"; break; + case EOpPack32: out.debug << "pack32"; break; + case EOpPack64: out.debug << "pack64"; break; + case EOpUnpack32: out.debug << "unpack32"; break; + case EOpUnpack16: out.debug << "unpack16"; break; + case EOpUnpack8: out.debug << "unpack8"; break; case EOpPackSnorm4x8: out.debug << "PackSnorm4x8"; break; case EOpUnpackSnorm4x8: out.debug << "UnpackSnorm4x8"; break; @@ -335,7 +484,6 @@ case EOpPackUint2x32: out.debug << "packUint2x32"; break; case EOpUnpackUint2x32: out.debug << "unpackUint2x32"; break; -#ifdef AMD_EXTENSIONS case EOpPackInt2x16: out.debug << "packInt2x16"; break; case EOpUnpackInt2x16: out.debug << "unpackInt2x16"; break; case EOpPackUint2x16: out.debug << "packUint2x16"; break; @@ -345,10 +493,8 @@ case EOpUnpackInt4x16: out.debug << "unpackInt4x16"; break; case EOpPackUint4x16: out.debug << "packUint4x16"; break; case EOpUnpackUint4x16: out.debug << "unpackUint4x16"; break; - case EOpPackFloat2x16: out.debug << "packFloat2x16"; break; case EOpUnpackFloat2x16: out.debug << "unpackFloat2x16"; break; -#endif case EOpLength: out.debug << "length"; break; case EOpNormalize: out.debug << "normalize"; break; @@ -402,6 +548,82 @@ case EOpAllInvocations: out.debug << "allInvocations"; break; case EOpAllInvocationsEqual: out.debug << "allInvocationsEqual"; break; + case EOpSubgroupElect: out.debug << "subgroupElect"; break; + case EOpSubgroupAll: out.debug << "subgroupAll"; break; + case EOpSubgroupAny: out.debug << "subgroupAny"; break; + case EOpSubgroupAllEqual: out.debug << "subgroupAllEqual"; break; + case EOpSubgroupBroadcast: out.debug << "subgroupBroadcast"; break; + case EOpSubgroupBroadcastFirst: out.debug << "subgroupBroadcastFirst"; break; + case EOpSubgroupBallot: out.debug << "subgroupBallot"; break; + case EOpSubgroupInverseBallot: out.debug << "subgroupInverseBallot"; break; + case EOpSubgroupBallotBitExtract: out.debug << "subgroupBallotBitExtract"; break; + case EOpSubgroupBallotBitCount: out.debug << "subgroupBallotBitCount"; break; + case EOpSubgroupBallotInclusiveBitCount: out.debug << "subgroupBallotInclusiveBitCount"; break; + case EOpSubgroupBallotExclusiveBitCount: out.debug << "subgroupBallotExclusiveBitCount"; break; + case EOpSubgroupBallotFindLSB: out.debug << "subgroupBallotFindLSB"; break; + case EOpSubgroupBallotFindMSB: out.debug << "subgroupBallotFindMSB"; break; + case EOpSubgroupShuffle: out.debug << "subgroupShuffle"; break; + case EOpSubgroupShuffleXor: out.debug << "subgroupShuffleXor"; break; + case EOpSubgroupShuffleUp: out.debug << "subgroupShuffleUp"; break; + case EOpSubgroupShuffleDown: out.debug << "subgroupShuffleDown"; break; + case EOpSubgroupAdd: out.debug << "subgroupAdd"; break; + case EOpSubgroupMul: out.debug << "subgroupMul"; break; + case EOpSubgroupMin: out.debug << "subgroupMin"; break; + case EOpSubgroupMax: out.debug << "subgroupMax"; break; + case EOpSubgroupAnd: out.debug << "subgroupAnd"; break; + case EOpSubgroupOr: out.debug << "subgroupOr"; break; + case EOpSubgroupXor: out.debug << "subgroupXor"; break; + case EOpSubgroupInclusiveAdd: out.debug << "subgroupInclusiveAdd"; break; + case EOpSubgroupInclusiveMul: out.debug << "subgroupInclusiveMul"; break; + case EOpSubgroupInclusiveMin: out.debug << "subgroupInclusiveMin"; break; + case EOpSubgroupInclusiveMax: out.debug << "subgroupInclusiveMax"; break; + case EOpSubgroupInclusiveAnd: out.debug << "subgroupInclusiveAnd"; break; + case EOpSubgroupInclusiveOr: out.debug << "subgroupInclusiveOr"; break; + case EOpSubgroupInclusiveXor: out.debug << "subgroupInclusiveXor"; break; + case EOpSubgroupExclusiveAdd: out.debug << "subgroupExclusiveAdd"; break; + case EOpSubgroupExclusiveMul: out.debug << "subgroupExclusiveMul"; break; + case EOpSubgroupExclusiveMin: out.debug << "subgroupExclusiveMin"; break; + case EOpSubgroupExclusiveMax: out.debug << "subgroupExclusiveMax"; break; + case EOpSubgroupExclusiveAnd: out.debug << "subgroupExclusiveAnd"; break; + case EOpSubgroupExclusiveOr: out.debug << "subgroupExclusiveOr"; break; + case EOpSubgroupExclusiveXor: out.debug << "subgroupExclusiveXor"; break; + case EOpSubgroupClusteredAdd: out.debug << "subgroupClusteredAdd"; break; + case EOpSubgroupClusteredMul: out.debug << "subgroupClusteredMul"; break; + case EOpSubgroupClusteredMin: out.debug << "subgroupClusteredMin"; break; + case EOpSubgroupClusteredMax: out.debug << "subgroupClusteredMax"; break; + case EOpSubgroupClusteredAnd: out.debug << "subgroupClusteredAnd"; break; + case EOpSubgroupClusteredOr: out.debug << "subgroupClusteredOr"; break; + case EOpSubgroupClusteredXor: out.debug << "subgroupClusteredXor"; break; + case EOpSubgroupQuadBroadcast: out.debug << "subgroupQuadBroadcast"; break; + case EOpSubgroupQuadSwapHorizontal: out.debug << "subgroupQuadSwapHorizontal"; break; + case EOpSubgroupQuadSwapVertical: out.debug << "subgroupQuadSwapVertical"; break; + case EOpSubgroupQuadSwapDiagonal: out.debug << "subgroupQuadSwapDiagonal"; break; + +#ifdef NV_EXTENSIONS + case EOpSubgroupPartition: out.debug << "subgroupPartitionNV"; break; + case EOpSubgroupPartitionedAdd: out.debug << "subgroupPartitionedAddNV"; break; + case EOpSubgroupPartitionedMul: out.debug << "subgroupPartitionedMulNV"; break; + case EOpSubgroupPartitionedMin: out.debug << "subgroupPartitionedMinNV"; break; + case EOpSubgroupPartitionedMax: out.debug << "subgroupPartitionedMaxNV"; break; + case EOpSubgroupPartitionedAnd: out.debug << "subgroupPartitionedAndNV"; break; + case EOpSubgroupPartitionedOr: out.debug << "subgroupPartitionedOrNV"; break; + case EOpSubgroupPartitionedXor: out.debug << "subgroupPartitionedXorNV"; break; + case EOpSubgroupPartitionedInclusiveAdd: out.debug << "subgroupPartitionedInclusiveAddNV"; break; + case EOpSubgroupPartitionedInclusiveMul: out.debug << "subgroupPartitionedInclusiveMulNV"; break; + case EOpSubgroupPartitionedInclusiveMin: out.debug << "subgroupPartitionedInclusiveMinNV"; break; + case EOpSubgroupPartitionedInclusiveMax: out.debug << "subgroupPartitionedInclusiveMaxNV"; break; + case EOpSubgroupPartitionedInclusiveAnd: out.debug << "subgroupPartitionedInclusiveAndNV"; break; + case EOpSubgroupPartitionedInclusiveOr: out.debug << "subgroupPartitionedInclusiveOrNV"; break; + case EOpSubgroupPartitionedInclusiveXor: out.debug << "subgroupPartitionedInclusiveXorNV"; break; + case EOpSubgroupPartitionedExclusiveAdd: out.debug << "subgroupPartitionedExclusiveAddNV"; break; + case EOpSubgroupPartitionedExclusiveMul: out.debug << "subgroupPartitionedExclusiveMulNV"; break; + case EOpSubgroupPartitionedExclusiveMin: out.debug << "subgroupPartitionedExclusiveMinNV"; break; + case EOpSubgroupPartitionedExclusiveMax: out.debug << "subgroupPartitionedExclusiveMaxNV"; break; + case EOpSubgroupPartitionedExclusiveAnd: out.debug << "subgroupPartitionedExclusiveAndNV"; break; + case EOpSubgroupPartitionedExclusiveOr: out.debug << "subgroupPartitionedExclusiveOrNV"; break; + case EOpSubgroupPartitionedExclusiveXor: out.debug << "subgroupPartitionedExclusiveXorNV"; break; +#endif + case EOpClip: out.debug << "clip"; break; case EOpIsFinite: out.debug << "isfinite"; break; case EOpLog10: out.debug << "log10"; break; @@ -434,62 +656,11 @@ case EOpMbcnt: out.debug << "mbcnt"; break; - case EOpCubeFaceIndex: out.debug << "cubeFaceIndex"; break; - case EOpCubeFaceCoord: out.debug << "cubeFaceCoord"; break; - case EOpFragmentMaskFetch: out.debug << "fragmentMaskFetchAMD"; break; case EOpFragmentFetch: out.debug << "fragmentFetchAMD"; break; - case EOpConvBoolToFloat16: out.debug << "Convert bool to float16"; break; - case EOpConvIntToFloat16: out.debug << "Convert int to float16"; break; - case EOpConvUintToFloat16: out.debug << "Convert uint to float16"; break; - case EOpConvFloatToFloat16: out.debug << "Convert float to float16"; break; - case EOpConvDoubleToFloat16: out.debug << "Convert double to float16"; break; - case EOpConvInt64ToFloat16: out.debug << "Convert int64 to float16"; break; - case EOpConvUint64ToFloat16: out.debug << "Convert uint64 to float16"; break; - case EOpConvFloat16ToBool: out.debug << "Convert float16 to bool"; break; - case EOpConvFloat16ToInt: out.debug << "Convert float16 to int"; break; - case EOpConvFloat16ToUint: out.debug << "Convert float16 to uint"; break; - case EOpConvFloat16ToFloat: out.debug << "Convert float16 to float"; break; - case EOpConvFloat16ToDouble: out.debug << "Convert float16 to double"; break; - case EOpConvFloat16ToInt64: out.debug << "Convert float16 to int64"; break; - case EOpConvFloat16ToUint64: out.debug << "Convert float16 to uint64"; break; - - case EOpConvBoolToInt16: out.debug << "Convert bool to int16"; break; - case EOpConvIntToInt16: out.debug << "Convert int to int16"; break; - case EOpConvUintToInt16: out.debug << "Convert uint to int16"; break; - case EOpConvFloatToInt16: out.debug << "Convert float to int16"; break; - case EOpConvDoubleToInt16: out.debug << "Convert double to int16"; break; - case EOpConvFloat16ToInt16: out.debug << "Convert float16 to int16"; break; - case EOpConvInt64ToInt16: out.debug << "Convert int64 to int16"; break; - case EOpConvUint64ToInt16: out.debug << "Convert uint64 to int16"; break; - case EOpConvUint16ToInt16: out.debug << "Convert uint16 to int16"; break; - case EOpConvInt16ToBool: out.debug << "Convert int16 to bool"; break; - case EOpConvInt16ToInt: out.debug << "Convert int16 to int"; break; - case EOpConvInt16ToUint: out.debug << "Convert int16 to uint"; break; - case EOpConvInt16ToFloat: out.debug << "Convert int16 to float"; break; - case EOpConvInt16ToDouble: out.debug << "Convert int16 to double"; break; - case EOpConvInt16ToFloat16: out.debug << "Convert int16 to float16"; break; - case EOpConvInt16ToInt64: out.debug << "Convert int16 to int64"; break; - case EOpConvInt16ToUint64: out.debug << "Convert int16 to uint64"; break; - - case EOpConvBoolToUint16: out.debug << "Convert bool to uint16"; break; - case EOpConvIntToUint16: out.debug << "Convert int to uint16"; break; - case EOpConvUintToUint16: out.debug << "Convert uint to uint16"; break; - case EOpConvFloatToUint16: out.debug << "Convert float to uint16"; break; - case EOpConvDoubleToUint16: out.debug << "Convert double to uint16"; break; - case EOpConvFloat16ToUint16: out.debug << "Convert float16 to uint16"; break; - case EOpConvInt64ToUint16: out.debug << "Convert int64 to uint16"; break; - case EOpConvUint64ToUint16: out.debug << "Convert uint64 to uint16"; break; - case EOpConvInt16ToUint16: out.debug << "Convert int16 to uint16"; break; - case EOpConvUint16ToBool: out.debug << "Convert uint16 to bool"; break; - case EOpConvUint16ToInt: out.debug << "Convert uint16 to int"; break; - case EOpConvUint16ToUint: out.debug << "Convert uint16 to uint"; break; - case EOpConvUint16ToFloat: out.debug << "Convert uint16 to float"; break; - case EOpConvUint16ToDouble: out.debug << "Convert uint16 to double"; break; - case EOpConvUint16ToFloat16: out.debug << "Convert uint16 to float16"; break; - case EOpConvUint16ToInt64: out.debug << "Convert uint16 to int64"; break; - case EOpConvUint16ToUint64: out.debug << "Convert uint16 to uint64"; break; + case EOpCubeFaceIndex: out.debug << "cubeFaceIndex"; break; + case EOpCubeFaceCoord: out.debug << "cubeFaceCoord"; break; #endif case EOpSubpassLoad: out.debug << "subpassLoad"; break; @@ -537,23 +708,30 @@ case EOpConstructBVec2: out.debug << "Construct bvec2"; break; case EOpConstructBVec3: out.debug << "Construct bvec3"; break; case EOpConstructBVec4: out.debug << "Construct bvec4"; break; + case EOpConstructInt8: out.debug << "Construct int8_t"; break; + case EOpConstructI8Vec2: out.debug << "Construct i8vec2"; break; + case EOpConstructI8Vec3: out.debug << "Construct i8vec3"; break; + case EOpConstructI8Vec4: out.debug << "Construct i8vec4"; break; case EOpConstructInt: out.debug << "Construct int"; break; case EOpConstructIVec2: out.debug << "Construct ivec2"; break; case EOpConstructIVec3: out.debug << "Construct ivec3"; break; case EOpConstructIVec4: out.debug << "Construct ivec4"; break; + case EOpConstructUint8: out.debug << "Construct uint8_t"; break; + case EOpConstructU8Vec2: out.debug << "Construct u8vec2"; break; + case EOpConstructU8Vec3: out.debug << "Construct u8vec3"; break; + case EOpConstructU8Vec4: out.debug << "Construct u8vec4"; break; case EOpConstructUint: out.debug << "Construct uint"; break; case EOpConstructUVec2: out.debug << "Construct uvec2"; break; case EOpConstructUVec3: out.debug << "Construct uvec3"; break; case EOpConstructUVec4: out.debug << "Construct uvec4"; break; - case EOpConstructInt64: out.debug << "Construct int64_t"; break; + case EOpConstructInt64: out.debug << "Construct int64"; break; case EOpConstructI64Vec2: out.debug << "Construct i64vec2"; break; case EOpConstructI64Vec3: out.debug << "Construct i64vec3"; break; case EOpConstructI64Vec4: out.debug << "Construct i64vec4"; break; - case EOpConstructUint64: out.debug << "Construct uint64_t"; break; + case EOpConstructUint64: out.debug << "Construct uint64"; break; case EOpConstructU64Vec2: out.debug << "Construct u64vec2"; break; case EOpConstructU64Vec3: out.debug << "Construct u64vec3"; break; case EOpConstructU64Vec4: out.debug << "Construct u64vec4"; break; -#ifdef AMD_EXTENSIONS case EOpConstructInt16: out.debug << "Construct int16_t"; break; case EOpConstructI16Vec2: out.debug << "Construct i16vec2"; break; case EOpConstructI16Vec3: out.debug << "Construct i16vec3"; break; @@ -562,7 +740,6 @@ case EOpConstructU16Vec2: out.debug << "Construct u16vec2"; break; case EOpConstructU16Vec3: out.debug << "Construct u16vec3"; break; case EOpConstructU16Vec4: out.debug << "Construct u16vec4"; break; -#endif case EOpConstructMat2x2: out.debug << "Construct mat2"; break; case EOpConstructMat2x3: out.debug << "Construct mat2x3"; break; case EOpConstructMat2x4: out.debug << "Construct mat2x4"; break; @@ -608,7 +785,6 @@ case EOpConstructBMat4x2: out.debug << "Construct bmat4x2"; break; case EOpConstructBMat4x3: out.debug << "Construct bmat4x3"; break; case EOpConstructBMat4x4: out.debug << "Construct bmat4"; break; -#ifdef AMD_EXTENSIONS case EOpConstructFloat16: out.debug << "Construct float16_t"; break; case EOpConstructF16Vec2: out.debug << "Construct f16vec2"; break; case EOpConstructF16Vec3: out.debug << "Construct f16vec3"; break; @@ -622,7 +798,6 @@ case EOpConstructF16Mat4x2: out.debug << "Construct f16mat4x2"; break; case EOpConstructF16Mat4x3: out.debug << "Construct f16mat4x3"; break; case EOpConstructF16Mat4x4: out.debug << "Construct f16mat4"; break; -#endif case EOpConstructStruct: out.debug << "Construct structure"; break; case EOpConstructTextureSampler: out.debug << "Construct combined texture-sampler"; break; @@ -791,10 +966,67 @@ case EOpGenMul: out.debug << "mul"; break; case EOpAllMemoryBarrierWithGroupSync: out.debug << "AllMemoryBarrierWithGroupSync"; break; - case EOpGroupMemoryBarrierWithGroupSync: out.debug << "GroupMemoryBarrierWithGroupSync"; break; + case EOpDeviceMemoryBarrier: out.debug << "DeviceMemoryBarrier"; break; + case EOpDeviceMemoryBarrierWithGroupSync: out.debug << "DeviceMemoryBarrierWithGroupSync"; break; case EOpWorkgroupMemoryBarrier: out.debug << "WorkgroupMemoryBarrier"; break; case EOpWorkgroupMemoryBarrierWithGroupSync: out.debug << "WorkgroupMemoryBarrierWithGroupSync"; break; + case EOpSubgroupBarrier: out.debug << "subgroupBarrier"; break; + case EOpSubgroupMemoryBarrier: out.debug << "subgroupMemoryBarrier"; break; + case EOpSubgroupMemoryBarrierBuffer: out.debug << "subgroupMemoryBarrierBuffer"; break; + case EOpSubgroupMemoryBarrierImage: out.debug << "subgroupMemoryBarrierImage"; break; + case EOpSubgroupMemoryBarrierShared: out.debug << "subgroupMemoryBarrierShared"; break; + case EOpSubgroupElect: out.debug << "subgroupElect"; break; + case EOpSubgroupAll: out.debug << "subgroupAll"; break; + case EOpSubgroupAny: out.debug << "subgroupAny"; break; + case EOpSubgroupAllEqual: out.debug << "subgroupAllEqual"; break; + case EOpSubgroupBroadcast: out.debug << "subgroupBroadcast"; break; + case EOpSubgroupBroadcastFirst: out.debug << "subgroupBroadcastFirst"; break; + case EOpSubgroupBallot: out.debug << "subgroupBallot"; break; + case EOpSubgroupInverseBallot: out.debug << "subgroupInverseBallot"; break; + case EOpSubgroupBallotBitExtract: out.debug << "subgroupBallotBitExtract"; break; + case EOpSubgroupBallotBitCount: out.debug << "subgroupBallotBitCount"; break; + case EOpSubgroupBallotInclusiveBitCount: out.debug << "subgroupBallotInclusiveBitCount"; break; + case EOpSubgroupBallotExclusiveBitCount: out.debug << "subgroupBallotExclusiveBitCount"; break; + case EOpSubgroupBallotFindLSB: out.debug << "subgroupBallotFindLSB"; break; + case EOpSubgroupBallotFindMSB: out.debug << "subgroupBallotFindMSB"; break; + case EOpSubgroupShuffle: out.debug << "subgroupShuffle"; break; + case EOpSubgroupShuffleXor: out.debug << "subgroupShuffleXor"; break; + case EOpSubgroupShuffleUp: out.debug << "subgroupShuffleUp"; break; + case EOpSubgroupShuffleDown: out.debug << "subgroupShuffleDown"; break; + case EOpSubgroupAdd: out.debug << "subgroupAdd"; break; + case EOpSubgroupMul: out.debug << "subgroupMul"; break; + case EOpSubgroupMin: out.debug << "subgroupMin"; break; + case EOpSubgroupMax: out.debug << "subgroupMax"; break; + case EOpSubgroupAnd: out.debug << "subgroupAnd"; break; + case EOpSubgroupOr: out.debug << "subgroupOr"; break; + case EOpSubgroupXor: out.debug << "subgroupXor"; break; + case EOpSubgroupInclusiveAdd: out.debug << "subgroupInclusiveAdd"; break; + case EOpSubgroupInclusiveMul: out.debug << "subgroupInclusiveMul"; break; + case EOpSubgroupInclusiveMin: out.debug << "subgroupInclusiveMin"; break; + case EOpSubgroupInclusiveMax: out.debug << "subgroupInclusiveMax"; break; + case EOpSubgroupInclusiveAnd: out.debug << "subgroupInclusiveAnd"; break; + case EOpSubgroupInclusiveOr: out.debug << "subgroupInclusiveOr"; break; + case EOpSubgroupInclusiveXor: out.debug << "subgroupInclusiveXor"; break; + case EOpSubgroupExclusiveAdd: out.debug << "subgroupExclusiveAdd"; break; + case EOpSubgroupExclusiveMul: out.debug << "subgroupExclusiveMul"; break; + case EOpSubgroupExclusiveMin: out.debug << "subgroupExclusiveMin"; break; + case EOpSubgroupExclusiveMax: out.debug << "subgroupExclusiveMax"; break; + case EOpSubgroupExclusiveAnd: out.debug << "subgroupExclusiveAnd"; break; + case EOpSubgroupExclusiveOr: out.debug << "subgroupExclusiveOr"; break; + case EOpSubgroupExclusiveXor: out.debug << "subgroupExclusiveXor"; break; + case EOpSubgroupClusteredAdd: out.debug << "subgroupClusteredAdd"; break; + case EOpSubgroupClusteredMul: out.debug << "subgroupClusteredMul"; break; + case EOpSubgroupClusteredMin: out.debug << "subgroupClusteredMin"; break; + case EOpSubgroupClusteredMax: out.debug << "subgroupClusteredMax"; break; + case EOpSubgroupClusteredAnd: out.debug << "subgroupClusteredAnd"; break; + case EOpSubgroupClusteredOr: out.debug << "subgroupClusteredOr"; break; + case EOpSubgroupClusteredXor: out.debug << "subgroupClusteredXor"; break; + case EOpSubgroupQuadBroadcast: out.debug << "subgroupQuadBroadcast"; break; + case EOpSubgroupQuadSwapHorizontal: out.debug << "subgroupQuadSwapHorizontal"; break; + case EOpSubgroupQuadSwapVertical: out.debug << "subgroupQuadSwapVertical"; break; + case EOpSubgroupQuadSwapDiagonal: out.debug << "subgroupQuadSwapDiagonal"; break; + case EOpSubpassLoad: out.debug << "subpassLoad"; break; case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break; @@ -816,7 +1048,15 @@ OutputTreeText(out, node, depth); out.debug << "Test condition and select"; - out.debug << " (" << node->getCompleteString() << ")\n"; + out.debug << " (" << node->getCompleteString() << ")"; + + if (node->getShortCircuit() == false) + out.debug << ": no shortcircuit"; + if (node->getFlatten()) + out.debug << ": Flatten"; + if (node->getDontFlatten()) + out.debug << ": DontFlatten"; + out.debug << "\n"; ++depth; @@ -861,9 +1101,7 @@ break; case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif { const double value = constUnion[i].getDConst(); // Print infinities and NaNs in a portable way. @@ -883,62 +1121,78 @@ } } break; - case EbtInt: + case EbtInt8: { const int maxSize = 300; char buf[maxSize]; - snprintf(buf, maxSize, "%d (%s)", constUnion[i].getIConst(), "const int"); + snprintf(buf, maxSize, "%d (%s)", constUnion[i].getI8Const(), "const int8_t"); out.debug << buf << "\n"; } break; - case EbtUint: + case EbtUint8: { const int maxSize = 300; char buf[maxSize]; - snprintf(buf, maxSize, "%u (%s)", constUnion[i].getUConst(), "const uint"); + snprintf(buf, maxSize, "%u (%s)", constUnion[i].getU8Const(), "const uint8_t"); out.debug << buf << "\n"; } break; - case EbtInt64: + case EbtInt16: { const int maxSize = 300; char buf[maxSize]; - snprintf(buf, maxSize, "%lld (%s)", constUnion[i].getI64Const(), "const int64_t"); + snprintf(buf, maxSize, "%d (%s)", constUnion[i].getI16Const(), "const int16_t"); out.debug << buf << "\n"; } break; - case EbtUint64: + case EbtUint16: { const int maxSize = 300; char buf[maxSize]; - snprintf(buf, maxSize, "%llu (%s)", constUnion[i].getU64Const(), "const uint64_t"); + snprintf(buf, maxSize, "%u (%s)", constUnion[i].getU16Const(), "const uint16_t"); out.debug << buf << "\n"; } break; -#ifdef AMD_EXTENSIONS - case EbtInt16: + case EbtInt: { const int maxSize = 300; char buf[maxSize]; - snprintf(buf, maxSize, "%d (%s)", constUnion[i].getIConst(), "const int16_t"); + snprintf(buf, maxSize, "%d (%s)", constUnion[i].getIConst(), "const int"); out.debug << buf << "\n"; } break; - case EbtUint16: + case EbtUint: { const int maxSize = 300; char buf[maxSize]; - snprintf(buf, maxSize, "%u (%s)", constUnion[i].getUConst(), "const uint16_t"); + snprintf(buf, maxSize, "%u (%s)", constUnion[i].getUConst(), "const uint"); + + out.debug << buf << "\n"; + } + break; + case EbtInt64: + { + const int maxSize = 300; + char buf[maxSize]; + snprintf(buf, maxSize, "%lld (%s)", constUnion[i].getI64Const(), "const int64_t"); + + out.debug << buf << "\n"; + } + break; + case EbtUint64: + { + const int maxSize = 300; + char buf[maxSize]; + snprintf(buf, maxSize, "%llu (%s)", constUnion[i].getU64Const(), "const uint64_t"); out.debug << buf << "\n"; } break; -#endif default: out.info.message(EPrefixInternalError, "Unknown constant", node->getLoc()); break; @@ -978,7 +1232,17 @@ out.debug << "Loop with condition "; if (! node->testFirst()) out.debug << "not "; - out.debug << "tested first\n"; + out.debug << "tested first"; + + if (node->getUnroll()) + out.debug << ": Unroll"; + if (node->getDontUnroll()) + out.debug << ": DontUnroll"; + if (node->getLoopDependency()) { + out.debug << ": Dependency "; + out.debug << node->getLoopDependency(); + } + out.debug << "\n"; ++depth; @@ -1039,7 +1303,13 @@ TInfoSink& out = infoSink; OutputTreeText(out, node, depth); - out.debug << "switch\n"; + out.debug << "switch"; + + if (node->getFlatten()) + out.debug << ": Flatten"; + if (node->getDontFlatten()) + out.debug << ": DontFlatten"; + out.debug << "\n"; OutputTreeText(out, node, depth); out.debug << "condition\n"; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/iomapper.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/iomapper.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/iomapper.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/iomapper.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -353,7 +353,9 @@ { TDefaultIoResolverBase(const TIntermediate &intermediate) : intermediate(intermediate), - nextUniformLocation(0) + nextUniformLocation(0), + nextInputLocation(0), + nextOutputLocation(0) { } int getBaseBinding(TResourceType res, unsigned int set) const { @@ -429,7 +431,9 @@ // no locations added if already present, a built-in variable, a block, or an opaque if (type.getQualifier().hasLocation() || type.isBuiltIn() || - type.getBasicType() == EbtBlock || type.containsOpaque()) + type.getBasicType() == EbtBlock || + type.getBasicType() == EbtAtomicUint || + (type.containsOpaque() && intermediate.getSpv().openGl == 0)) return -1; // no locations on blocks of built-in variables @@ -440,13 +444,17 @@ return -1; } - return nextUniformLocation++; + int location = nextUniformLocation; + + nextUniformLocation += TIntermediate::computeTypeUniformLocationSize(type); + + return location; } bool validateInOut(EShLanguage /*stage*/, const char* /*name*/, const TType& /*type*/, bool /*is_live*/) override { return true; } - int resolveInOutLocation(EShLanguage /*stage*/, const char* /*name*/, const TType& type, bool /*is_live*/) override + int resolveInOutLocation(EShLanguage stage, const char* /*name*/, const TType& type, bool /*is_live*/) override { // kick out of not doing this if (!doAutoLocationMapping()) @@ -464,14 +472,15 @@ return -1; } - // Placeholder. - // TODO: It would be nice to flesh this out using - // intermediate->computeTypeLocationSize(type), or functions that call it like - // intermediate->addUsedLocation() - // These in turn would want the intermediate, which is not available here, but - // is available in many places, and a lot of copying from it could be saved if - // it were just available. - return 0; + // point to the right input or output location counter + int& nextLocation = type.getQualifier().isPipeInput() ? nextInputLocation : nextOutputLocation; + + // Placeholder. This does not do proper cross-stage lining up, nor + // work with mixed location/no-location declarations. + int location = nextLocation; + nextLocation += TIntermediate::computeTypeLocationSize(type, stage); + + return location; } int resolveInOutComponent(EShLanguage /*stage*/, const char* /*name*/, const TType& /*type*/, bool /*is_live*/) override { @@ -492,6 +501,8 @@ protected: const TIntermediate &intermediate; int nextUniformLocation; + int nextInputLocation; + int nextOutputLocation; // Return descriptor set specific base if there is one, and the generic base otherwise. int selectBaseBinding(int base, int descriptorSetBase) const { @@ -593,7 +604,7 @@ /******************************************************************************** The following IO resolver maps types in HLSL register space, as follows: -t – for shader resource views (SRV) +t - for shader resource views (SRV) TEXTURE1D TEXTURE1DARRAY TEXTURE2D @@ -608,7 +619,7 @@ BUFFER TBUFFER -s – for samplers +s - for samplers SAMPLER SAMPLER1D SAMPLER2D @@ -617,7 +628,7 @@ SAMPLERSTATE SAMPLERCOMPARISONSTATE -u – for unordered access views (UAV) +u - for unordered access views (UAV) RWBYTEADDRESSBUFFER RWSTRUCTUREDBUFFER APPENDSTRUCTUREDBUFFER @@ -629,7 +640,7 @@ RWTEXTURE2DARRAY RWTEXTURE3D -b – for constant buffer views (CBV) +b - for constant buffer views (CBV) CBUFFER CONSTANTBUFFER ********************************************************************************/ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/linkValidate.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/linkValidate.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/linkValidate.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/linkValidate.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -1,5 +1,6 @@ // // Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -267,10 +268,13 @@ // Recursively merge the implicit array sizes through the objects' respective type trees. void TIntermediate::mergeImplicitArraySizes(TType& type, const TType& unitType) { - if (type.isImplicitlySizedArray() && unitType.isArray()) { - int newImplicitArraySize = unitType.isImplicitlySizedArray() ? unitType.getImplicitArraySize() : unitType.getOuterArraySize(); - if (newImplicitArraySize > type.getImplicitArraySize ()) - type.setImplicitArraySize(newImplicitArraySize); + if (type.isUnsizedArray()) { + if (unitType.isUnsizedArray()) { + type.updateImplicitArraySize(unitType.getImplicitArraySize()); + if (unitType.isArrayVariablyIndexed()) + type.setArrayVariablyIndexed(); + } else if (unitType.isSizedArray()) + type.changeOuterArraySize(unitType.getOuterArraySize()); } // Type mismatches are caught and reported after this, just be careful for now. @@ -293,8 +297,13 @@ // Types have to match if (symbol.getType() != unitSymbol.getType()) { - error(infoSink, "Types must match:"); - writeTypeComparison = true; + // but, we make an exception if one is an implicit array and the other is sized + if (! (symbol.getType().isArray() && unitSymbol.getType().isArray() && + symbol.getType().sameElementType(unitSymbol.getType()) && + (symbol.getType().isUnsizedArray() || unitSymbol.getType().isUnsizedArray()))) { + error(infoSink, "Types must match:"); + writeTypeComparison = true; + } } // Qualifiers have to (almost) match @@ -510,7 +519,9 @@ virtual void visitSymbol(TIntermSymbol* symbol) { // Implicitly size arrays. - symbol->getWritableType().adoptImplicitArraySizes(); + // If an unsized array is left as unsized, it effectively + // becomes run-time sized. + symbol->getWritableType().adoptImplicitArraySizes(false); } } finalLinkTraverser; @@ -765,7 +776,7 @@ int size; if (qualifier.isUniformOrBuffer()) { - if (type.isExplicitlySizedArray()) + if (type.isSizedArray()) size = type.getCumulativeArraySize(); else size = 1; @@ -773,9 +784,9 @@ // Strip off the outer array dimension for those having an extra one. if (type.isArray() && qualifier.isArrayedIo(language)) { TType elementType(type, 0); - size = computeTypeLocationSize(elementType); + size = computeTypeLocationSize(elementType, language); } else - size = computeTypeLocationSize(type); + size = computeTypeLocationSize(type, language); } // Locations, and components within locations. @@ -836,8 +847,8 @@ // combine location and component ranges TIoRange range(locationRange, componentRange, type.getBasicType(), qualifier.hasIndex() ? qualifier.layoutIndex : 0); - // check for collisions, except for vertex inputs on desktop - if (! (profile != EEsProfile && language == EShLangVertex && qualifier.isPipeInput())) + // check for collisions, except for vertex inputs on desktop targeting OpenGL + if (! (profile != EEsProfile && language == EShLangVertex && qualifier.isPipeInput()) || spvVersion.vulkan > 0) collision = checkLocationRange(set, range, type, typeCollision); if (collision < 0) @@ -907,18 +918,18 @@ // Recursively figure out how many locations are used up by an input or output type. // Return the size of type, as measured by "locations". -int TIntermediate::computeTypeLocationSize(const TType& type) const +int TIntermediate::computeTypeLocationSize(const TType& type, EShLanguage stage) { // "If the declared input is an array of size n and each element takes m locations, it will be assigned m * n // consecutive locations..." if (type.isArray()) { // TODO: perf: this can be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness + // TODO: are there valid cases of having an unsized array with a location? If so, running this code too early. TType elementType(type, 0); - if (type.isImplicitlySizedArray()) { - // TODO: are there valid cases of having an implicitly-sized array with a location? If so, running this code too early. - return computeTypeLocationSize(elementType); - } else - return type.getOuterArraySize() * computeTypeLocationSize(elementType); + if (type.isSizedArray()) + return type.getOuterArraySize() * computeTypeLocationSize(elementType, stage); + else + return computeTypeLocationSize(elementType, stage); } // "The locations consumed by block and structure members are determined by applying the rules above @@ -927,7 +938,7 @@ int size = 0; for (int member = 0; member < (int)type.getStruct()->size(); ++member) { TType memberType(type, member); - size += computeTypeLocationSize(memberType); + size += computeTypeLocationSize(memberType, stage); } return size; } @@ -941,7 +952,7 @@ if (type.isScalar()) return 1; if (type.isVector()) { - if (language == EShLangVertex && type.getQualifier().isPipeInput()) + if (stage == EShLangVertex && type.getQualifier().isPipeInput()) return 1; if (type.getBasicType() == EbtDouble && type.getVectorSize() > 2) return 2; @@ -954,13 +965,44 @@ // for an n-element array of m-component vectors..." if (type.isMatrix()) { TType columnType(type, 0); - return type.getMatrixCols() * computeTypeLocationSize(columnType); + return type.getMatrixCols() * computeTypeLocationSize(columnType, stage); } assert(0); return 1; } +// Same as computeTypeLocationSize but for uniforms +int TIntermediate::computeTypeUniformLocationSize(const TType& type) +{ + // "Individual elements of a uniform array are assigned + // consecutive locations with the first element taking location + // location." + if (type.isArray()) { + // TODO: perf: this can be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness + TType elementType(type, 0); + if (type.isSizedArray()) { + return type.getOuterArraySize() * computeTypeUniformLocationSize(elementType); + } else { + // TODO: are there valid cases of having an implicitly-sized array with a location? If so, running this code too early. + return computeTypeUniformLocationSize(elementType); + } + } + + // "Each subsequent inner-most member or element gets incremental + // locations for the entire structure or array." + if (type.isStruct()) { + int size = 0; + for (int member = 0; member < (int)type.getStruct()->size(); ++member) { + TType memberType(type, member); + size += computeTypeUniformLocationSize(memberType); + } + return size; + } + + return 1; +} + // Accumulate xfb buffer ranges and check for collisions as the accumulation is done. // // Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value. @@ -1005,7 +1047,7 @@ if (type.isArray()) { // TODO: perf: this can be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness - assert(type.isExplicitlySizedArray()); + assert(type.isSizedArray()); TType elementType(type, 0); return type.getOuterArraySize() * computeTypeXfbSize(elementType, containsDouble); } @@ -1064,11 +1106,11 @@ case EbtInt64: case EbtUint64: case EbtDouble: size = 8; return 8; -#ifdef AMD_EXTENSIONS - case EbtInt16: - case EbtUint16: case EbtFloat16: size = 2; return 2; -#endif + case EbtInt8: + case EbtUint8: size = 1; return 1; + case EbtInt16: + case EbtUint16: size = 2; return 2; default: size = 4; return 4; } } @@ -1197,6 +1239,8 @@ if (type.isVector()) { int scalarAlign = getBaseAlignmentScalar(type, size); switch (type.getVectorSize()) { + case 1: // HLSL has this, GLSL does not + return scalarAlign; case 2: size *= 2; return 2 * scalarAlign; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/localintermediate.h vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/localintermediate.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/localintermediate.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/localintermediate.h 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -78,7 +79,7 @@ assert(i < MaxSwizzleSelectors); return components[i]; } - + private: int size_; selectorType components[MaxSwizzleSelectors]; @@ -209,7 +210,7 @@ class TIntermediate { public: explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) : - implicitThisName("@this"), + implicitThisName("@this"), implicitCounterName("@count"), language(l), source(EShSourceNone), profile(p), version(v), treeRoot(0), numEntryPoints(0), numErrors(0), numPushConstants(0), recursive(false), invocations(TQualifier::layoutNotSet), vertices(TQualifier::layoutNotSet), @@ -217,6 +218,7 @@ pixelCenterInteger(false), originUpperLeft(false), vertexSpacing(EvsNone), vertexOrder(EvoNone), pointMode(false), earlyFragmentTests(false), postDepthCoverage(false), depthLayout(EldNone), depthReplacing(false), + hlslFunctionality1(false), blendEquations(0), xfbMode(false), multiStream(false), #ifdef NV_EXTENSIONS layoutOverrideCoverage(false), @@ -224,6 +226,7 @@ #endif autoMapBindings(false), autoMapLocations(false), + invertY(false), flattenUniformArrays(false), useUnknownFormat(false), hlslOffsets(false), @@ -271,7 +274,7 @@ unsigned int getShiftBinding(TResourceType res) const { return shiftBinding[res]; } - void setShiftBindingForSet(TResourceType res, unsigned int set, unsigned int shift) + void setShiftBindingForSet(TResourceType res, unsigned int shift, unsigned int set) { if (shift == 0) // ignore if there's no shift: it's a no-op. return; @@ -281,8 +284,8 @@ const char* name = getResourceName(res); if (name != nullptr) { processes.addProcess(name); - processes.addArgument(set); processes.addArgument(shift); + processes.addArgument(set); } } @@ -317,6 +320,14 @@ processes.addProcess("auto-map-locations"); } bool getAutoMapLocations() const { return autoMapLocations; } + void setInvertY(bool invert) + { + invertY = invert; + if (invertY) + processes.addProcess("invert-y"); + } + bool getInvertY() const { return invertY; } + void setFlattenUniformArrays(bool flatten) { flattenUniformArrays = flatten; @@ -352,6 +363,13 @@ } bool usingHlslIoMapping() { return hlslIoMapping; } + template T addCounterBufferName(const T& name) const { return name + implicitCounterName; } + bool hasCounterBufferName(const TString& name) const { + size_t len = strlen(implicitCounterName); + return name.size() > len && + name.compare(name.size() - len, len, implicitCounterName) == 0; + } + void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { textureSamplerTransformMode = mode; } void setVersion(int v) { version = v; } @@ -369,7 +387,7 @@ processes.addProcess("client opengl100"); // target-environment processes - if (spvVersion.vulkan == 100) + if (spvVersion.vulkan > 0) processes.addProcess("target-env vulkan1.0"); else if (spvVersion.vulkan > 0) processes.addProcess("target-env vulkanUnknown"); @@ -394,6 +412,7 @@ TIntermSymbol* addSymbol(const TType&, const TSourceLoc&); TIntermSymbol* addSymbol(const TIntermSymbol&); TIntermTyped* addConversion(TOperator, const TType&, TIntermTyped*) const; + std::tuple addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* node1) const; TIntermTyped* addUniShapeConversion(TOperator, const TType&, TIntermTyped*); void addBiShapeConversion(TOperator, TIntermTyped*& lhsNode, TIntermTyped*& rhsNode); TIntermTyped* addShapeConversion(const TType&, TIntermTyped*); @@ -403,6 +422,11 @@ TIntermTyped* addUnaryMath(TOperator, TIntermTyped* child, TSourceLoc); TIntermTyped* addBuiltInFunctionCall(const TSourceLoc& line, TOperator, bool unary, TIntermNode*, const TType& returnType); bool canImplicitlyPromote(TBasicType from, TBasicType to, TOperator op = EOpNull) const; + bool isIntegralPromotion(TBasicType from, TBasicType to) const; + bool isFPPromotion(TBasicType from, TBasicType to) const; + bool isIntegralConversion(TBasicType from, TBasicType to) const; + bool isFPConversion(TBasicType from, TBasicType to) const; + bool isFPIntegralConversion(TBasicType from, TBasicType to) const; TOperator mapTypeToConstructorOp(const TType&) const; TIntermAggregate* growAggregate(TIntermNode* left, TIntermNode* right); TIntermAggregate* growAggregate(TIntermNode* left, TIntermNode* right, const TSourceLoc&); @@ -411,27 +435,27 @@ TIntermAggregate* makeAggregate(const TSourceLoc&); TIntermTyped* setAggregateOperator(TIntermNode*, TOperator, const TType& type, TSourceLoc); bool areAllChildConst(TIntermAggregate* aggrNode); - TIntermTyped* addSelection(TIntermTyped* cond, TIntermNodePair code, const TSourceLoc&, TSelectionControl = ESelectionControlNone); - TIntermTyped* addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, const TSourceLoc&, TSelectionControl = ESelectionControlNone); + TIntermSelection* addSelection(TIntermTyped* cond, TIntermNodePair code, const TSourceLoc&); + TIntermTyped* addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, const TSourceLoc&); TIntermTyped* addComma(TIntermTyped* left, TIntermTyped* right, const TSourceLoc&); TIntermTyped* addMethod(TIntermTyped*, const TType&, const TString*, const TSourceLoc&); TIntermConstantUnion* addConstantUnion(const TConstUnionArray&, const TType&, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(signed char, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(unsigned char, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(signed short, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(unsigned short, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(int, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(unsigned int, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(long long, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(unsigned long long, const TSourceLoc&, bool literal = false) const; -#ifdef AMD_EXTENSIONS - TIntermConstantUnion* addConstantUnion(short, const TSourceLoc&, bool literal = false) const; - TIntermConstantUnion* addConstantUnion(unsigned short, const TSourceLoc&, bool literal = false) const; - -#endif TIntermConstantUnion* addConstantUnion(bool, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(double, TBasicType, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(const TString*, const TSourceLoc&, bool literal = false) const; TIntermTyped* promoteConstantUnion(TBasicType, TIntermConstantUnion*) const; bool parseConstTree(TIntermNode*, TConstUnionArray, TOperator, const TType&, bool singleConstantParam = false); - TIntermLoop* addLoop(TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, const TSourceLoc&, TLoopControl = ELoopControlNone); - TIntermAggregate* addForLoop(TIntermNode*, TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, const TSourceLoc&, TLoopControl = ELoopControlNone); + TIntermLoop* addLoop(TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, const TSourceLoc&); + TIntermAggregate* addForLoop(TIntermNode*, TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, + const TSourceLoc&, TIntermLoop*&); TIntermBranch* addBranch(TOperator, const TSourceLoc&); TIntermBranch* addBranch(TOperator, TIntermTyped*, const TSourceLoc&); template TIntermTyped* addSwizzle(TSwizzleSelectors&, const TSourceLoc&); @@ -443,9 +467,6 @@ TIntermUnary* addUnaryNode(TOperator op, TIntermTyped* child, TSourceLoc) const; TIntermUnary* addUnaryNode(TOperator op, TIntermTyped* child, TSourceLoc, const TType&) const; - // Add conversion from node's type to given basic type. - TIntermTyped* convertToBasicType(TOperator op, TBasicType basicType, TIntermTyped* node) const; - // Constant folding (in Constant.cpp) TIntermTyped* fold(TIntermAggregate* aggrNode); TIntermTyped* foldConstructor(TIntermAggregate* aggrNode); @@ -551,6 +572,9 @@ void setDepthReplacing() { depthReplacing = true; } bool isDepthReplacing() const { return depthReplacing; } + void setHlslFunctionality1() { hlslFunctionality1 = true; } + bool getHlslFunctionality1() const { return hlslFunctionality1; } + void addBlendEquation(TBlendEquationShift b) { blendEquations |= (1 << b); } unsigned int getBlendEquations() const { return blendEquations; } @@ -565,7 +589,8 @@ int checkLocationRange(int set, const TIoRange& range, const TType&, bool& typeCollision); int addUsedOffsets(int binding, int offset, int numOffsets); bool addUsedConstantId(int id); - int computeTypeLocationSize(const TType&) const; + static int computeTypeLocationSize(const TType&, EShLanguage); + static int computeTypeUniformLocationSize(const TType&); bool setXfbBufferStride(int buffer, unsigned stride) { @@ -574,6 +599,7 @@ xfbBuffers[buffer].stride = stride; return true; } + unsigned getXfbStride(int buffer) const { return xfbBuffers[buffer].stride; } int addXfbBufferOffset(const TType&); unsigned int computeTypeXfbSize(const TType&, bool& containsDouble) const; static int getBaseAlignmentScalar(const TType&, int& size); @@ -593,7 +619,7 @@ return semanticNameSet.insert(name).first->c_str(); } - void setSourceFile(const char* file) { sourceFile = file; } + void setSourceFile(const char* file) { if (file != nullptr) sourceFile = file; } const std::string& getSourceFile() const { return sourceFile; } void addSourceText(const char* text) { sourceText = sourceText + text; } const std::string& getSourceText() const { return sourceText; } @@ -609,6 +635,7 @@ bool needsLegalization() const { return needToLegalize; } const char* const implicitThisName; + const char* const implicitCounterName; protected: TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TConstUnionArray&, TIntermTyped* subtree, const TSourceLoc&); @@ -624,6 +651,7 @@ TIntermSequence& findLinkerObjects() const; bool userOutputUsed() const; bool isSpecializationOperation(const TIntermOperator&) const; + bool isNonuniformPropagating(TOperator) const; bool promoteUnary(TIntermUnary&); bool promoteBinary(TIntermBinary&); void addSymbolLinkageNode(TIntermAggregate*& linkage, TSymbolTable&, const TString&); @@ -632,6 +660,10 @@ void pushSelector(TIntermSequence&, const TMatrixSelector&, const TSourceLoc&); bool specConstantPropagates(const TIntermTyped&, const TIntermTyped&); void performTextureUpgradeAndSamplerRemovalTransformation(TIntermNode* root); + bool isConversionAllowed(TOperator op, TIntermTyped* node) const; + TIntermUnary* createConversion(TBasicType convertTo, TIntermTyped* node) const; + std::tuple getConversionDestinatonType(TBasicType type0, TBasicType type1, TOperator op) const; + bool extensionRequested(const char *extension) const {return requestedExtensions.find(extension) != requestedExtensions.end();} static const char* getResourceName(TResourceType); const EShLanguage language; // stage, known at construction time @@ -639,8 +671,8 @@ std::string entryPointName; std::string entryPointMangledName; - EProfile profile; - int version; + EProfile profile; // source profile + int version; // source version SpvVersion spvVersion; TIntermNode* treeRoot; std::set requestedExtensions; // cumulation of all enabled or required extensions; not connected to what subset of the shader used them @@ -664,6 +696,7 @@ bool postDepthCoverage; TLayoutDepth depthLayout; bool depthReplacing; + bool hlslFunctionality1; int blendEquations; // an 'or'ing of masks of shifts of TBlendEquationShift bool xfbMode; bool multiStream; @@ -682,6 +715,7 @@ std::vector resourceSetBinding; bool autoMapBindings; bool autoMapLocations; + bool invertY; bool flattenUniformArrays; bool useUnknownFormat; bool hlslOffsets; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/ParseContextBase.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/ParseContextBase.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/ParseContextBase.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/ParseContextBase.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -228,6 +228,7 @@ // must still be valid. // It is okay if the symbol's type will be subsequently edited; // the modifications will be tracked. +// Order is preserved, to avoid creating novel forward references. void TParseContextBase::trackLinkage(TSymbol& symbol) { if (!parsingBuiltins) @@ -242,7 +243,7 @@ error(loc, "", "[", "index out of range '%d'", index); index = 0; } else if (type.isArray()) { - if (type.isExplicitlySizedArray() && index >= type.getOuterArraySize()) { + if (type.isSizedArray() && index >= type.getOuterArraySize()) { error(loc, "", "[", "array index out of range '%d'", index); index = type.getOuterArraySize() - 1; } @@ -602,7 +603,7 @@ if (parsingBuiltins) return; - // Transfer the linkage symbols to AST nodes + // Transfer the linkage symbols to AST nodes, preserving order. TIntermAggregate* linkage = new TIntermAggregate; for (auto i = linkageSymbols.begin(); i != linkageSymbols.end(); ++i) intermediate.addSymbolLinkageNode(linkage, **i); diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/ParseHelper.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/ParseHelper.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/ParseHelper.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/ParseHelper.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -2,6 +2,7 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2015 LunarG, Inc. // Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -266,6 +267,8 @@ if (tokens.size() != 1) error(loc, "extra tokens", "#pragma", ""); intermediate.setUseStorageBuffer(); + } else if (tokens[0].compare("once") == 0) { + warn(loc, "not implemented", "#pragma once", ""); } } @@ -281,17 +284,17 @@ requireExtensions(loc, symbol->getNumExtensions(), symbol->getExtensions(), symbol->getName().c_str()); if (symbol && symbol->isReadOnly()) { - // All shared things containing an implicitly sized array must be copied up + // All shared things containing an unsized array must be copied up // on first use, so that all future references will share its array structure, // so that editing the implicit size will effect all nodes consuming it, // and so that editing the implicit size won't change the shared one. // // If this is a variable or a block, check it and all it contains, but if this // is a member of an anonymous block, check the whole block, as the whole block - // will need to be copied up if it contains an implicitly-sized array. - if (symbol->getType().containsImplicitlySizedArray() || + // will need to be copied up if it contains an unsized array. + if (symbol->getType().containsUnsizedArray() || (symbol->getAsAnonMember() && - symbol->getAsAnonMember()->getAnonContainer().getType().containsImplicitlySizedArray())) + symbol->getAsAnonMember()->getAnonContainer().getType().containsUnsizedArray())) makeEditable(symbol); } @@ -369,21 +372,29 @@ } else { // at least one of base and index is not a front-end constant variable... + if (index->getQualifier().isFrontEndConstant()) + checkIndex(loc, base->getType(), indexValue); + if (base->getAsSymbolNode() && isIoResizeArray(base->getType())) handleIoResizeArrayAccess(loc, base); if (index->getQualifier().isFrontEndConstant()) { - if (base->getType().isImplicitlySizedArray()) - updateImplicitArraySize(loc, base, indexValue); + if (base->getType().isUnsizedArray()) + base->getWritableType().updateImplicitArraySize(indexValue + 1); else checkIndex(loc, base->getType(), indexValue); result = intermediate.addIndex(EOpIndexDirect, base, index, loc); } else { - if (base->getType().isImplicitlySizedArray()) { + if (base->getType().isUnsizedArray()) { + // we have a variable index into an unsized array, which is okay, + // depending on the situation if (base->getAsSymbolNode() && isIoResizeArray(base->getType())) error(loc, "", "[", "array must be sized by a redeclaration or layout qualifier before being indexed with a variable"); - else - error(loc, "", "[", "array must be redeclared with a size before being indexed with a variable"); + else { + // it is okay for a run-time sized array + checkRuntimeSizable(loc, *base); + } + base->getWritableType().setArrayVariablyIndexed(); } if (base->getBasicType() == EbtBlock) { if (base->getQualifier().storage == EvqBuffer) @@ -424,6 +435,10 @@ } result->setType(newType); + // Propagate nonuniform + if (base->getQualifier().isNonUniform() || index->getQualifier().isNonUniform()) + result->getWritableType().getQualifier().nonUniform = true; + if (anyIndexLimits) handleIndexLimits(loc, base, index); } @@ -482,7 +497,7 @@ if (language == EShLangTessControl || language == EShLangTessEvaluation) { if (type.getOuterArraySize() != resources.maxPatchVertices) { - if (type.isExplicitlySizedArray()) + if (type.isSizedArray()) error(loc, "tessellation input array size must be gl_MaxPatchVertices or implicitly sized", "[]", ""); type.changeOuterArraySize(resources.maxPatchVertices); } @@ -515,7 +530,7 @@ return; // fix array size, if it can be fixed and needs to be fixed (will allow variable indexing) - if (symbolNode->getType().isImplicitlySizedArray()) { + if (symbolNode->getType().isUnsizedArray()) { int newSize = getIoArrayImplicitSize(); if (newSize > 0) symbolNode->getWritableType().changeOuterArraySize(newSize); @@ -565,7 +580,7 @@ void TParseContext::checkIoArrayConsistency(const TSourceLoc& loc, int requiredSize, const char* feature, TType& type, const TString& name) { - if (type.isImplicitlySizedArray()) + if (type.isUnsizedArray()) type.changeOuterArraySize(requiredSize); else if (type.getOuterArraySize() != requiredSize) { if (language == EShLangGeometry) @@ -732,6 +747,10 @@ if (base->getQualifier().noContraction) result->getWritableType().getQualifier().noContraction = true; + // Propagate nonuniform + if (base->getQualifier().isNonUniform()) + result->getWritableType().getQualifier().nonUniform = true; + return result; } @@ -776,7 +795,7 @@ if (prevDec->isPrototyped() && prototype) profileRequires(loc, EEsProfile, 300, nullptr, "multiple prototypes for same function"); if (prevDec->getType() != function.getType()) - error(loc, "overloaded functions must have the same return type", function.getType().getBasicTypeString().c_str(), ""); + error(loc, "overloaded functions must have the same return type", function.getName().c_str(), ""); for (int i = 0; i < prevDec->getParamCount(); ++i) { if ((*prevDec)[i].type->getQualifier().storage != function[i].type->getQualifier().storage) error(loc, "overloaded functions must have the same parameter storage qualifiers for argument", function[i].type->getStorageQualifierString(), "%d", i+1); @@ -950,7 +969,7 @@ if (builtIn && fnCandidate->getNumExtensions()) requireExtensions(loc, fnCandidate->getNumExtensions(), fnCandidate->getExtensions(), fnCandidate->getName().c_str()); - if (arguments) { + if (arguments != nullptr) { // Make sure qualifications work for these arguments. TIntermAggregate* aggregate = arguments->getAsAggregate(); for (int i = 0; i < fnCandidate->getParamCount(); ++i) { @@ -988,7 +1007,7 @@ if (builtIn && fnCandidate->getBuiltInOp() != EOpNull) { // A function call mapped to a built-in operation. - result = handleBuiltInFunctionCall(loc, *arguments, *fnCandidate); + result = handleBuiltInFunctionCall(loc, arguments, *fnCandidate); } else { // This is a function call not mapped to built-in operator. // It could still be a built-in function, but only if PureOperatorBuiltins == false. @@ -1036,20 +1055,24 @@ return result; } -TIntermTyped* TParseContext::handleBuiltInFunctionCall(TSourceLoc loc, TIntermNode& arguments, +TIntermTyped* TParseContext::handleBuiltInFunctionCall(TSourceLoc loc, TIntermNode* arguments, const TFunction& function) { checkLocation(loc, function.getBuiltInOp()); TIntermTyped *result = intermediate.addBuiltInFunctionCall(loc, function.getBuiltInOp(), function.getParamCount() == 1, - &arguments, function.getType()); + arguments, function.getType()); if (obeyPrecisionQualifiers()) computeBuiltinPrecisions(*result, function); - if (result == nullptr) { - error(arguments.getLoc(), " wrong operand type", "Internal Error", - "built in unary operator function. Type: %s", - static_cast(&arguments)->getCompleteString().c_str()); + if (result == nullptr) { + if (arguments == nullptr) + error(loc, " wrong operand type", "Internal Error", + "built in unary operator function. Type: %s", ""); + else + error(arguments->getLoc(), " wrong operand type", "Internal Error", + "built in unary operator function. Type: %s", + static_cast(arguments)->getCompleteString().c_str()); } else if (result->getAsOperator()) builtInOpCheck(loc, function, *result->getAsOperator()); @@ -1208,10 +1231,7 @@ else { const TType& type = intermNode->getAsTyped()->getType(); if (type.isArray()) { - if (type.isRuntimeSizedArray()) { - // Create a unary op and let the back end handle it - return intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, intermNode, TType(EbtInt)); - } else if (type.isImplicitlySizedArray()) { + if (type.isUnsizedArray()) { if (intermNode->getAsSymbolNode() && isIoResizeArray(type)) { // We could be between a layout declaration that gives a built-in io array implicit size and // a user redeclaration of that array, meaning we have to substitute its implicit size here @@ -1224,7 +1244,10 @@ if (length == 0) { if (intermNode->getAsSymbolNode() && isIoResizeArray(type)) error(loc, "", function->getName().c_str(), "array must first be sized by a redeclaration or layout qualifier"); - else + else if (isRuntimeLength(*intermNode->getAsTyped())) { + // Create a unary op and let the back end handle it + return intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, intermNode, TType(EbtInt)); + } else error(loc, "", function->getName().c_str(), "array must be declared with a size before using this method"); } } else if (type.getOuterArrayNode()) { @@ -1378,6 +1401,8 @@ arg0 = unaryArg; } + TString featureString; + const char* feature = nullptr; switch (callNode.getOp()) { case EOpTextureGather: case EOpTextureGatherOffset: @@ -1386,8 +1411,9 @@ // Figure out which variants are allowed by what extensions, // and what arguments must be constant for which situations. - TString featureString = fnCandidate.getName() + "(...)"; - const char* feature = featureString.c_str(); + featureString = fnCandidate.getName(); + featureString += "(...)"; + feature = featureString.c_str(); profileRequires(loc, EEsProfile, 310, nullptr, feature); int compArg = -1; // track which argument, if any, is the constant component argument switch (callNode.getOp()) { @@ -1443,8 +1469,9 @@ bias = fnCandidate.getParamCount() > 4; if (bias) { - TString biasFeatureString = fnCandidate.getName() + "with bias argument"; - const char* feature = biasFeatureString.c_str(); + featureString = fnCandidate.getName(); + featureString += "with bias argument"; + feature = featureString.c_str(); profileRequires(loc, ~EEsProfile, 450, nullptr, feature); requireExtensions(loc, 1, &E_GL_AMD_texture_gather_bias_lod, feature); } @@ -1466,8 +1493,9 @@ bias = fnCandidate.getParamCount() > 5; if (bias) { - TString featureString = fnCandidate.getName() + "with bias argument"; - const char* feature = featureString.c_str(); + featureString = fnCandidate.getName(); + featureString += "with bias argument"; + feature = featureString.c_str(); profileRequires(loc, ~EEsProfile, 450, nullptr, feature); requireExtensions(loc, 1, &E_GL_AMD_texture_gather_bias_lod, feature); } @@ -1482,6 +1510,39 @@ requireExtensions(loc, 1, &E_GL_ARB_sparse_texture2, fnCandidate.getName().c_str()); break; } + + case EOpSwizzleInvocations: + { + if (! (*argp)[1]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "offset", ""); + else { + unsigned offset[4] = {}; + offset[0] = (*argp)[1]->getAsConstantUnion()->getConstArray()[0].getUConst(); + offset[1] = (*argp)[1]->getAsConstantUnion()->getConstArray()[1].getUConst(); + offset[2] = (*argp)[1]->getAsConstantUnion()->getConstArray()[2].getUConst(); + offset[3] = (*argp)[1]->getAsConstantUnion()->getConstArray()[3].getUConst(); + if (offset[0] > 3 || offset[1] > 3 || offset[2] > 3 || offset[3] > 3) + error(loc, "components must be in the range [0, 3]", "offset", ""); + } + + break; + } + + case EOpSwizzleInvocationsMasked: + { + if (! (*argp)[1]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "mask", ""); + else { + unsigned mask[3] = {}; + mask[0] = (*argp)[1]->getAsConstantUnion()->getConstArray()[0].getUConst(); + mask[1] = (*argp)[1]->getAsConstantUnion()->getConstArray()[1].getUConst(); + mask[2] = (*argp)[1]->getAsConstantUnion()->getConstArray()[2].getUConst(); + if (mask[0] > 31 || mask[1] > 31 || mask[2] > 31) + error(loc, "components must be in the range [0, 31]", "mask", ""); + } + + break; + } #endif case EOpTextureOffset: @@ -1509,6 +1570,12 @@ } if (arg > 0) { + +#ifdef AMD_EXTENSIONS + bool f16ShadowCompare = (*argp)[1]->getAsTyped()->getBasicType() == EbtFloat16 && arg0->getType().getSampler().shadow; + if (f16ShadowCompare) + ++arg; +#endif if (! (*argp)[arg]->getAsConstantUnion()) error(loc, "argument must be compile-time constant", "texel offset", ""); else { @@ -1574,6 +1641,9 @@ case EOpInterpolateAtCentroid: case EOpInterpolateAtSample: case EOpInterpolateAtOffset: +#ifdef AMD_EXTENSIONS + case EOpInterpolateAtVertex: +#endif // Make sure the first argument is an interpolant, or an array element of an interpolant if (arg0->getType().getQualifier().storage != EvqVaryingIn) { // It might still be an array element. @@ -1588,6 +1658,23 @@ if (base == nullptr || base->getType().getQualifier().storage != EvqVaryingIn) error(loc, "first argument must be an interpolant, or interpolant-array element", fnCandidate.getName().c_str(), ""); } + +#ifdef AMD_EXTENSIONS + if (callNode.getOp() == EOpInterpolateAtVertex) { + if (!arg0->getType().getQualifier().isExplicitInterpolation()) + error(loc, "argument must be qualified as __explicitInterpAMD in", "interpolant", ""); + else { + if (! (*argp)[1]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "vertex index", ""); + else { + unsigned vertexIdx = (*argp)[1]->getAsConstantUnion()->getConstArray()[0].getUConst(); + if (vertexIdx > 2) + error(loc, "must be in the range [0, 2]", "vertex index", ""); + } + } + } +#endif + break; case EOpEmitStreamVertex: @@ -1595,9 +1682,33 @@ intermediate.setMultiStream(); break; + case EOpSubgroupClusteredAdd: + case EOpSubgroupClusteredMul: + case EOpSubgroupClusteredMin: + case EOpSubgroupClusteredMax: + case EOpSubgroupClusteredAnd: + case EOpSubgroupClusteredOr: + case EOpSubgroupClusteredXor: + if ((*argp)[1]->getAsConstantUnion() == nullptr) + error(loc, "argument must be compile-time constant", "cluster size", ""); + else { + int size = (*argp)[1]->getAsConstantUnion()->getConstArray()[0].getIConst(); + if (size < 1) + error(loc, "argument must be at least 1", "cluster size", ""); + else if (!IsPow2(size)) + error(loc, "argument must be a power of 2", "cluster size", ""); + } + break; + default: break; } + + if (callNode.getOp() > EOpSubgroupGuardStart && callNode.getOp() < EOpSubgroupGuardStop) { + // these require SPIR-V 1.3 + if (spvVersion.spv > 0 && spvVersion.spv < EShTargetSpv_1_3) + error(loc, "requires SPIR-V 1.3", "subgroup op", ""); + } } extern bool PureOperatorBuiltins; @@ -2159,7 +2270,6 @@ case EOpConstructDMat4x2: case EOpConstructDMat4x3: case EOpConstructDMat4x4: -#ifdef AMD_EXTENSIONS case EOpConstructF16Mat2x2: case EOpConstructF16Mat2x3: case EOpConstructF16Mat2x4: @@ -2169,7 +2279,6 @@ case EOpConstructF16Mat4x2: case EOpConstructF16Mat4x3: case EOpConstructF16Mat4x4: -#endif constructingMatrix = true; break; default: @@ -2190,7 +2299,7 @@ bool floatArgument = false; for (int arg = 0; arg < function.getParamCount(); ++arg) { if (function[arg].type->isArray()) { - if (! function[arg].type->isExplicitlySizedArray()) { + if (function[arg].type->isUnsizedArray()) { // Can't construct from an unsized array. error(loc, "array argument must be sized", "constructor", ""); return true; @@ -2226,18 +2335,30 @@ // Finish pinning down spec-const semantics if (specConstType) { switch (op) { + case EOpConstructInt8: + case EOpConstructUint8: + case EOpConstructInt16: + case EOpConstructUint16: case EOpConstructInt: case EOpConstructUint: case EOpConstructInt64: case EOpConstructUint64: -#ifdef AMD_EXTENSIONS - case EOpConstructInt16: - case EOpConstructUint16: -#endif case EOpConstructBool: case EOpConstructBVec2: case EOpConstructBVec3: case EOpConstructBVec4: + case EOpConstructI8Vec2: + case EOpConstructI8Vec3: + case EOpConstructI8Vec4: + case EOpConstructU8Vec2: + case EOpConstructU8Vec3: + case EOpConstructU8Vec4: + case EOpConstructI16Vec2: + case EOpConstructI16Vec3: + case EOpConstructI16Vec4: + case EOpConstructU16Vec2: + case EOpConstructU16Vec3: + case EOpConstructU16Vec4: case EOpConstructIVec2: case EOpConstructIVec3: case EOpConstructIVec4: @@ -2250,14 +2371,6 @@ case EOpConstructU64Vec2: case EOpConstructU64Vec3: case EOpConstructU64Vec4: -#ifdef AMD_EXTENSIONS - case EOpConstructI16Vec2: - case EOpConstructI16Vec3: - case EOpConstructI16Vec4: - case EOpConstructU16Vec2: - case EOpConstructU16Vec3: - case EOpConstructU16Vec4: -#endif // This was the list of valid ones, if they aren't converting from float // and aren't making an array. makeSpecConst = ! floatArgument && ! type.isArray(); @@ -2284,7 +2397,7 @@ return true; } - if (type.isImplicitlySizedArray()) { + if (type.isUnsizedArray()) { // auto adapt the constructor type to the number of arguments type.changeOuterArraySize(function.getParamCount()); } else if (type.getOuterArraySize() != function.getParamCount()) { @@ -2296,20 +2409,21 @@ // Types have to match, but we're still making the type. // Finish making the type, and the comparison is done later // when checking for conversion. - TArraySizes& arraySizes = type.getArraySizes(); + TArraySizes& arraySizes = *type.getArraySizes(); // At least the dimensionalities have to match. - if (! function[0].type->isArray() || arraySizes.getNumDims() != function[0].type->getArraySizes().getNumDims() + 1) { + if (! function[0].type->isArray() || + arraySizes.getNumDims() != function[0].type->getArraySizes()->getNumDims() + 1) { error(loc, "array constructor argument not correct type to construct array element", "constructor", ""); return true; } - if (arraySizes.isInnerImplicit()) { + if (arraySizes.isInnerUnsized()) { // "Arrays of arrays ..., and the size for any dimension is optional" // That means we need to adopt (from the first argument) the other array sizes into the type. for (int d = 1; d < arraySizes.getNumDims(); ++d) { if (arraySizes.getDimSize(d) == UnsizedArraySize) { - arraySizes.setDimSize(d, function[0].type->getArraySizes().getDimSize(d - 1)); + arraySizes.setDimSize(d, function[0].type->getArraySizes()->getDimSize(d - 1)); } } } @@ -2511,16 +2625,32 @@ } // +// Qualifier checks knowing the qualifier and that it is a member of a struct/block. +// +void TParseContext::memberQualifierCheck(glslang::TPublicType& publicType) +{ + globalQualifierFixCheck(publicType.loc, publicType.qualifier); + checkNoShaderLayouts(publicType.loc, publicType.shaderQualifiers); + if (publicType.qualifier.isNonUniform()) { + error(publicType.loc, "not allowed on block or structure members", "nonuniformEXT", ""); + publicType.qualifier.nonUniform = false; + } +} + +// // Check/fix just a full qualifier (no variables or types yet, but qualifier is complete) at global level. // void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& qualifier) { + bool nonuniformOkay = false; + // move from parameter/unknown qualifiers to pipeline in/out qualifiers switch (qualifier.storage) { case EvqIn: profileRequires(loc, ENoProfile, 130, nullptr, "in for stage inputs"); profileRequires(loc, EEsProfile, 300, nullptr, "in for stage inputs"); qualifier.storage = EvqVaryingIn; + nonuniformOkay = true; break; case EvqOut: profileRequires(loc, ENoProfile, 130, nullptr, "out for stage outputs"); @@ -2531,10 +2661,17 @@ qualifier.storage = EvqVaryingIn; error(loc, "cannot use 'inout' at global scope", "", ""); break; + case EvqGlobal: + case EvqTemporary: + nonuniformOkay = true; + break; default: break; } + if (!nonuniformOkay && qualifier.nonUniform) + error(loc, "for non-parameter, can only apply to 'in' or no storage qualifier", "nonuniformEXT", ""); + invariantCheck(loc, qualifier); } @@ -2560,17 +2697,12 @@ // now, knowing it is a shader in/out, do all the in/out semantic checks - if (publicType.basicType == EbtBool) { + if (publicType.basicType == EbtBool && !parsingBuiltins) { error(loc, "cannot be bool", GetStorageQualifierString(qualifier.storage), ""); return; } - if (publicType.basicType == EbtInt || publicType.basicType == EbtUint || -#ifdef AMD_EXTENSIONS - publicType.basicType == EbtInt16 || publicType.basicType == EbtUint16 || -#endif - publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64 || - publicType.basicType == EbtDouble) + if (isTypeInt(publicType.basicType) || publicType.basicType == EbtDouble) profileRequires(loc, EEsProfile, 300, nullptr, "shader input/output"); #ifdef AMD_EXTENSIONS @@ -2578,13 +2710,13 @@ #else if (!qualifier.flat) { #endif - if (publicType.basicType == EbtInt || publicType.basicType == EbtUint || -#ifdef AMD_EXTENSIONS - publicType.basicType == EbtInt16 || publicType.basicType == EbtUint16 || -#endif - publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64 || + if (isTypeInt(publicType.basicType) || publicType.basicType == EbtDouble || - (publicType.userDef && (publicType.userDef->containsBasicType(EbtInt) || + (publicType.userDef && (publicType.userDef->containsBasicType(EbtInt8) || + publicType.userDef->containsBasicType(EbtUint8) || + publicType.userDef->containsBasicType(EbtInt16) || + publicType.userDef->containsBasicType(EbtUint16) || + publicType.userDef->containsBasicType(EbtInt) || publicType.userDef->containsBasicType(EbtUint) || publicType.userDef->containsBasicType(EbtInt64) || publicType.userDef->containsBasicType(EbtUint64) || @@ -2686,8 +2818,8 @@ error(loc, "can't use auxiliary qualifier on a fragment output", "centroid/sample/patch", ""); if (qualifier.isInterpolation()) error(loc, "can't use interpolation qualifier on a fragment output", "flat/smooth/noperspective", ""); - if (publicType.basicType == EbtDouble) - error(loc, "cannot contain a double", GetStorageQualifierString(qualifier.storage), ""); + if (publicType.basicType == EbtDouble || publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64) + error(loc, "cannot contain a double, int64, or uint64", GetStorageQualifierString(qualifier.storage), ""); break; case EShLangCompute: @@ -2788,6 +2920,7 @@ MERGE_SINGLETON(readonly); MERGE_SINGLETON(writeonly); MERGE_SINGLETON(specConstant); + MERGE_SINGLETON(nonUniform); if (repeated) error(loc, "replicated qualifiers", "", ""); @@ -2988,7 +3121,7 @@ // void TParseContext::arraySizeRequiredCheck(const TSourceLoc& loc, const TArraySizes& arraySizes) { - if (arraySizes.isImplicit()) + if (arraySizes.hasUnsized()) error(loc, "array size required", "", ""); } @@ -3002,7 +3135,7 @@ } } -void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qualifier, const TArraySizes* arraySizes, bool initializer, bool lastMember) +void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qualifier, TArraySizes* arraySizes, bool initializer, bool lastMember) { assert(arraySizes); @@ -3015,8 +3148,10 @@ return; // No environment allows any non-outer-dimension to be implicitly sized - if (arraySizes->isInnerImplicit()) + if (arraySizes->isInnerUnsized()) { error(loc, "only outermost dimension of an array of arrays can be implicitly sized", "[]", ""); + arraySizes->clearInnerUnsized(); + } if (arraySizes->isInnerSpecialization()) error(loc, "only outermost dimension of an array of arrays can be a specialization constant", "[]", ""); @@ -3061,8 +3196,11 @@ arraySizeRequiredCheck(loc, *arraySizes); } -void TParseContext::arrayOfArrayVersionCheck(const TSourceLoc& loc) +void TParseContext::arrayOfArrayVersionCheck(const TSourceLoc& loc, const TArraySizes* sizes) { + if (sizes == nullptr || sizes->getNumDims() == 1) + return; + const char* feature = "arrays of arrays"; requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, feature); @@ -3070,36 +3208,6 @@ profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, nullptr, feature); } -void TParseContext::arrayDimCheck(const TSourceLoc& loc, const TArraySizes* sizes1, const TArraySizes* sizes2) -{ - if ((sizes1 && sizes2) || - (sizes1 && sizes1->getNumDims() > 1) || - (sizes2 && sizes2->getNumDims() > 1)) - arrayOfArrayVersionCheck(loc); -} - -void TParseContext::arrayDimCheck(const TSourceLoc& loc, const TType* type, const TArraySizes* sizes2) -{ - // skip checking for multiple dimensions on the type; it was caught earlier - if ((type && type->isArray() && sizes2) || - (sizes2 && sizes2->getNumDims() > 1)) - arrayOfArrayVersionCheck(loc); -} - -// Merge array dimensions listed in 'sizes' onto the type's array dimensions. -// -// From the spec: "vec4[2] a[3]; // size-3 array of size-2 array of vec4" -// -// That means, the 'sizes' go in front of the 'type' as outermost sizes. -// 'type' is the type part of the declaration (to the left) -// 'sizes' is the arrayness tagged on the identifier (to the right) -// -void TParseContext::arrayDimMerge(TType& type, const TArraySizes* sizes) -{ - if (sizes) - type.addArrayOuterSizes(*sizes); -} - // // Do all the semantic checking for declaring or redeclaring an array, with and // without a size, and make the right changes to the symbol table. @@ -3169,7 +3277,7 @@ return; } - if (existingType.isExplicitlySizedArray()) { + if (existingType.isSizedArray()) { // be more leniant for input arrays to geometry shaders and tessellation control outputs, where the redeclaration is the same size if (! (isIoResizeArray(type) && existingType.getOuterArraySize() == type.getOuterArraySize())) error(loc, "redeclaration of array with size", identifier.c_str(), ""); @@ -3184,64 +3292,37 @@ checkIoArraysConsistency(loc); } -void TParseContext::updateImplicitArraySize(const TSourceLoc& loc, TIntermNode *node, int index) +// Policy and error check for needing a runtime sized array. +void TParseContext::checkRuntimeSizable(const TSourceLoc& loc, const TIntermTyped& base) { - // maybe there is nothing to do... - TIntermTyped* typedNode = node->getAsTyped(); - if (typedNode->getType().getImplicitArraySize() > index) - return; - - // something to do... - - // Figure out what symbol to lookup, as we will use its type to edit for the size change, - // as that type will be shared through shallow copies for future references. - TSymbol* symbol = nullptr; - int blockIndex = -1; - const TString* lookupName = nullptr; - if (node->getAsSymbolNode()) - lookupName = &node->getAsSymbolNode()->getName(); - else if (node->getAsBinaryNode()) { - const TIntermBinary* deref = node->getAsBinaryNode(); - // This has to be the result of a block dereference, unless it's bad shader code - // If it's a uniform block, then an error will be issued elsewhere, but - // return early now to avoid crashing later in this function. - if (deref->getLeft()->getBasicType() != EbtBlock || - deref->getLeft()->getType().getQualifier().storage == EvqUniform || - deref->getRight()->getAsConstantUnion() == nullptr) - return; + // runtime length implies runtime sizeable, so no problem + if (isRuntimeLength(base)) + return; - const TIntermTyped* left = deref->getLeft(); - const TIntermTyped* right = deref->getRight(); + // check for additional things allowed by GL_EXT_nonuniform_qualifier + if (base.getBasicType() == EbtSampler || + (base.getBasicType() == EbtBlock && base.getType().getQualifier().isUniformOrBuffer())) + requireExtensions(loc, 1, &E_GL_EXT_nonuniform_qualifier, "variable index"); + else + error(loc, "", "[", "array must be redeclared with a size before being indexed with a variable"); +} - if (left->getAsBinaryNode()) { - left = left->getAsBinaryNode()->getLeft(); // Block array access - assert(left->isArray()); +// Policy decision for whether a run-time .length() is allowed. +bool TParseContext::isRuntimeLength(const TIntermTyped& base) const +{ + if (base.getType().getQualifier().storage == EvqBuffer) { + // in a buffer block + const TIntermBinary* binary = base.getAsBinaryNode(); + if (binary != nullptr && binary->getOp() == EOpIndexDirectStruct) { + // is it the last member? + const int index = binary->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); + const int memberCount = (int)binary->getLeft()->getType().getStruct()->size(); + if (index == memberCount - 1) + return true; } - - if (! left->getAsSymbolNode()) - return; - - blockIndex = right->getAsConstantUnion()->getConstArray()[0].getIConst(); - - lookupName = &left->getAsSymbolNode()->getName(); - if (IsAnonymous(*lookupName)) - lookupName = &(*left->getType().getStruct())[blockIndex].type->getFieldName(); } - // Lookup the symbol, should only fail if shader code is incorrect - symbol = symbolTable.find(*lookupName); - if (symbol == nullptr) - return; - - if (symbol->getAsFunction()) { - error(loc, "array variable name expected", symbol->getName().c_str(), ""); - return; - } - - if (symbol->getType().isStruct() && blockIndex != -1) - (*symbol->getWritableType().getStruct())[blockIndex].type->setImplicitArraySize(index + 1); - else - symbol->getWritableType().setImplicitArraySize(index + 1); + return false; } // Returns true if the first argument to the #line directive is the line number for the next line. @@ -3476,17 +3557,25 @@ return; } + // Fix XFB stuff up, it applies to the order of the redeclaration, not + // the order of the original members. + if (currentBlockQualifier.storage == EvqVaryingOut && globalOutputDefaults.hasXfbBuffer()) { + if (!currentBlockQualifier.hasXfbBuffer()) + currentBlockQualifier.layoutXfbBuffer = globalOutputDefaults.layoutXfbBuffer; + fixBlockXfbOffsets(currentBlockQualifier, newTypeList); + } + // Edit and error check the container against the redeclaration // - remove unused members // - ensure remaining qualifiers/types match + TType& type = block->getWritableType(); #ifdef NV_EXTENSIONS // if gl_PerVertex is redeclared for the purpose of passing through "gl_Position" - // for passthrough purpose, the redclared block should have the same qualifers as + // for passthrough purpose, the redeclared block should have the same qualifers as // the current one - if (currentBlockQualifier.layoutPassthrough) - { + if (currentBlockQualifier.layoutPassthrough) { type.getQualifier().layoutPassthrough = currentBlockQualifier.layoutPassthrough; type.getQualifier().storage = currentBlockQualifier.storage; type.getQualifier().layoutStream = currentBlockQualifier.layoutStream; @@ -3521,16 +3610,19 @@ error(memberLoc, "cannot redeclare block member with a different type", member->type->getFieldName().c_str(), ""); if (oldType.isArray() != newType.isArray()) error(memberLoc, "cannot change arrayness of redeclared block member", member->type->getFieldName().c_str(), ""); - else if (! oldType.sameArrayness(newType) && oldType.isExplicitlySizedArray()) + else if (! oldType.sameArrayness(newType) && oldType.isSizedArray()) error(memberLoc, "cannot change array size of redeclared block member", member->type->getFieldName().c_str(), ""); else if (newType.isArray()) arrayLimitCheck(loc, member->type->getFieldName(), newType.getOuterArraySize()); if (newType.getQualifier().isMemory()) error(memberLoc, "cannot add memory qualifier to redeclared block member", member->type->getFieldName().c_str(), ""); - if (newType.getQualifier().hasLayout()) - error(memberLoc, "cannot add layout to redeclared block member", member->type->getFieldName().c_str(), ""); + if (newType.getQualifier().hasNonXfbLayout()) + error(memberLoc, "cannot add non-XFB layout to redeclared block member", member->type->getFieldName().c_str(), ""); if (newType.getQualifier().patch) error(memberLoc, "cannot add patch to redeclared block member", member->type->getFieldName().c_str(), ""); + if (newType.getQualifier().hasXfbBuffer() && + newType.getQualifier().layoutXfbBuffer != currentBlockQualifier.layoutXfbBuffer) + error(memberLoc, "member cannot contradict block (or what block inherited from global)", "xfb_buffer", ""); oldType.getQualifier().centroid = newType.getQualifier().centroid; oldType.getQualifier().sample = newType.getQualifier().sample; oldType.getQualifier().invariant = newType.getQualifier().invariant; @@ -3538,10 +3630,21 @@ oldType.getQualifier().smooth = newType.getQualifier().smooth; oldType.getQualifier().flat = newType.getQualifier().flat; oldType.getQualifier().nopersp = newType.getQualifier().nopersp; - - if (oldType.isImplicitlySizedArray() && newType.isExplicitlySizedArray()) + oldType.getQualifier().layoutXfbOffset = newType.getQualifier().layoutXfbOffset; + oldType.getQualifier().layoutXfbBuffer = newType.getQualifier().layoutXfbBuffer; + oldType.getQualifier().layoutXfbStride = newType.getQualifier().layoutXfbStride; + if (oldType.getQualifier().layoutXfbOffset != TQualifier::layoutXfbBufferEnd) { + // if any member as an xfb_offset, then the block's xfb_buffer inherents current xfb_buffer, + // and for xfb processing, the member needs it as well, along with xfb_stride + type.getQualifier().layoutXfbBuffer = currentBlockQualifier.layoutXfbBuffer; + oldType.getQualifier().layoutXfbBuffer = currentBlockQualifier.layoutXfbBuffer; + } + if (oldType.isUnsizedArray() && newType.isSizedArray()) oldType.changeOuterArraySize(newType.getOuterArraySize()); + // check and process the member's type, which will include managing xfb information + layoutTypeCheck(loc, oldType); + // go to next member ++member; } else { @@ -3562,11 +3665,11 @@ if (type.isArray() != (arraySizes != nullptr)) error(loc, "cannot change arrayness of redeclared block", blockName.c_str(), ""); else if (type.isArray()) { - if (type.isExplicitlySizedArray() && arraySizes->getOuterSize() == UnsizedArraySize) - error(loc, "block already declared with size, can't redeclare as implicitly-sized", blockName.c_str(), ""); - else if (type.isExplicitlySizedArray() && type.getArraySizes() != *arraySizes) + if (type.isSizedArray() && !arraySizes->isSized()) + error(loc, "block already declared with size, can't redeclare as unsized", blockName.c_str(), ""); + else if (type.isSizedArray() && *type.getArraySizes() != *arraySizes) error(loc, "cannot change array size of redeclared block", blockName.c_str(), ""); - else if (type.isImplicitlySizedArray() && arraySizes->getOuterSize() != UnsizedArraySize) + else if (!type.isSizedArray() && arraySizes->isSized()) type.changeOuterArraySize(arraySizes->getOuterSize()); } @@ -3586,7 +3689,7 @@ trackLinkage(*block); } -void TParseContext::paramCheckFix(const TSourceLoc& loc, const TStorageQualifier& qualifier, TType& type) +void TParseContext::paramCheckFixStorage(const TSourceLoc& loc, const TStorageQualifier& qualifier, TType& type) { switch (qualifier) { case EvqConst: @@ -3632,8 +3735,10 @@ else warn(loc, "qualifier has no effect on non-output parameters", "precise", ""); } + if (qualifier.isNonUniform()) + type.getQualifier().nonUniform = qualifier.nonUniform; - paramCheckFix(loc, qualifier.storage, type); + paramCheckFixStorage(loc, qualifier.storage, type); } void TParseContext::nestedBlockCheck(const TSourceLoc& loc) @@ -3872,6 +3977,28 @@ default: break; } + +#ifdef NV_EXTENSIONS + // Set default outputs for GL_NV_geometry_shader_passthrough + if (language == EShLangGeometry && extensionTurnedOn(E_SPV_NV_geometry_shader_passthrough)) { + if (intermediate.getOutputPrimitive() == ElgNone) { + switch (intermediate.getInputPrimitive()) { + case ElgPoints: intermediate.setOutputPrimitive(ElgPoints); break; + case ElgLines: intermediate.setOutputPrimitive(ElgLineStrip); break; + case ElgTriangles: intermediate.setOutputPrimitive(ElgTriangles); break; + default: break; + } + } + if (intermediate.getVertices() == TQualifier::layoutNotSet) { + switch (intermediate.getInputPrimitive()) { + case ElgPoints: intermediate.setVertices(1); break; + case ElgLines: intermediate.setVertices(2); break; + case ElgTriangles: intermediate.setVertices(3); break; + default: break; + } + } + } +#endif } // @@ -4505,7 +4632,8 @@ // they are not allowed on block members. For arrayed interfaces (those generally having an // extra level of arrayness due to interface expansion), the outer array is stripped before // applying this rule." -void TParseContext::layoutMemberLocationArrayCheck(const TSourceLoc& loc, bool memberWithLocation, TArraySizes* arraySizes) +void TParseContext::layoutMemberLocationArrayCheck(const TSourceLoc& loc, bool memberWithLocation, + TArraySizes* arraySizes) { if (memberWithLocation && arraySizes != nullptr) { if (arraySizes->getNumDims() > (currentBlockQualifier.isArrayedIo(language) ? 1 : 0)) @@ -4554,6 +4682,8 @@ break; case EvqUniform: case EvqBuffer: + if (type.getBasicType() == EbtBlock) + error(loc, "cannot apply to uniform or buffer block", "location", ""); break; default: error(loc, "can only apply to uniform, buffer, in, or out storage qualifiers", "location", ""); @@ -4580,11 +4710,9 @@ // containing a double, the offset must also be a multiple of 8..." if (type.containsBasicType(EbtDouble) && ! IsMultipleOfPow2(qualifier.layoutXfbOffset, 8)) error(loc, "type contains double; xfb_offset must be a multiple of 8", "xfb_offset", ""); -#ifdef AMD_EXTENSIONS // ..., if applied to an aggregate containing a float16_t, the offset must also be a multiple of 2..." else if (type.containsBasicType(EbtFloat16) && !IsMultipleOfPow2(qualifier.layoutXfbOffset, 2)) error(loc, "type contains half float; xfb_offset must be a multiple of 2", "xfb_offset", ""); -#endif else if (! IsMultipleOfPow2(qualifier.layoutXfbOffset, 4)) error(loc, "must be a multiple of size of first component", "xfb_offset", ""); } @@ -4608,13 +4736,19 @@ if (type.getBasicType() == EbtSampler) { int lastBinding = qualifier.layoutBinding; if (type.isArray()) { - if (type.isImplicitlySizedArray()) { + if (spvVersion.vulkan > 0) lastBinding += 1; - warn(loc, "assuming array size of one for compile-time checking of binding numbers for implicitly-sized array", "[]", ""); - } else - lastBinding += type.getCumulativeArraySize(); + else { + if (type.isSizedArray()) + lastBinding += type.getCumulativeArraySize(); + else { + lastBinding += 1; + if (spvVersion.vulkan == 0) + warn(loc, "assuming binding count of one for compile-time checking of binding numbers for unsized array", "[]", ""); + } + } } - if (lastBinding >= resources.maxCombinedTextureImageUnits) + if (spvVersion.vulkan == 0 && lastBinding >= resources.maxCombinedTextureImageUnits) error(loc, "sampler binding not less than gl_MaxCombinedTextureImageUnits", "binding", type.isArray() ? "(using array)" : ""); } if (type.getBasicType() == EbtAtomicUint) { @@ -4623,12 +4757,23 @@ return; } } - } + } else if (!intermediate.getAutoMapBindings()) { + // some types require bindings - // atomic_uint - if (type.getBasicType() == EbtAtomicUint) { - if (! type.getQualifier().hasBinding()) + // atomic_uint + if (type.getBasicType() == EbtAtomicUint) error(loc, "layout(binding=X) is required", "atomic_uint", ""); + + // SPIR-V + if (spvVersion.spv > 0) { + if (qualifier.isUniformOrBuffer()) { + if (type.getBasicType() == EbtBlock && !qualifier.layoutPushConstant && + !qualifier.layoutAttachment) + error(loc, "uniform/buffer blocks require layout(binding=X)", "binding", ""); + else if (spvVersion.vulkan > 0 && type.getBasicType() == EbtSampler) + error(loc, "sampler/texture/image requires layout(binding=X)", "binding", ""); + } + } } // "The offset qualifier can only be used on block members of blocks..." @@ -4684,20 +4829,18 @@ error(loc, "can only be applied to a scalar", "constant_id", ""); switch (type.getBasicType()) { + case EbtInt8: + case EbtUint8: + case EbtInt16: + case EbtUint16: case EbtInt: case EbtUint: case EbtInt64: case EbtUint64: -#ifdef AMD_EXTENSIONS - case EbtInt16: - case EbtUint16: -#endif case EbtBool: case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif break; default: error(loc, "cannot be applied to this type", "constant_id", ""); @@ -4783,11 +4926,11 @@ error(loc, "requires uniform or buffer storage qualifier", "binding", ""); } if (qualifier.hasStream()) { - if (qualifier.storage != EvqVaryingOut) + if (!qualifier.isPipeOutput()) error(loc, "can only be used on an output", "stream", ""); } if (qualifier.hasXfb()) { - if (qualifier.storage != EvqVaryingOut) + if (!qualifier.isPipeOutput()) error(loc, "can only be used on an output", "xfb layout qualifier", ""); } if (qualifier.hasUniformLayout()) { @@ -4863,7 +5006,7 @@ // Check for overlap int numOffsets = 4; if (symbol.getType().isArray()) { - if (symbol.getType().isExplicitlySizedArray() && ! symbol.getType().getArraySizes()->isInnerImplicit()) + if (symbol.getType().isSizedArray() && !symbol.getType().getArraySizes()->isInnerUnsized()) numOffsets *= symbol.getType().getCumulativeArraySize(); else { // "It is a compile-time error to declare an unsized array of atomic_uint." @@ -4894,10 +5037,21 @@ return nullptr; } + bool explicitTypesEnabled = extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int8) || + extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int16) || + extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int32) || + extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int64) || + extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float16) || + extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float32) || + extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float64); + if (profile == EEsProfile || version < 120) function = findFunctionExact(loc, call, builtIn); else if (version < 400) function = findFunction120(loc, call, builtIn); + else if (explicitTypesEnabled) + function = findFunctionExplicitTypes(loc, call, builtIn); else function = findFunction400(loc, call, builtIn); @@ -5082,6 +5236,85 @@ return bestMatch; } +// "To determine whether the conversion for a single argument in one match +// is better than that for another match, the conversion is assigned of the +// three ranks ordered from best to worst: +// 1. Exact match: no conversion. +// 2. Promotion: integral or floating-point promotion. +// 3. Conversion: integral conversion, floating-point conversion, +// floating-integral conversion. +// A conversion C1 is better than a conversion C2 if the rank of C1 is +// better than the rank of C2." +const TFunction* TParseContext::findFunctionExplicitTypes(const TSourceLoc& loc, const TFunction& call, bool& builtIn) +{ + // first, look for an exact match + TSymbol* symbol = symbolTable.find(call.getMangledName(), &builtIn); + if (symbol) + return symbol->getAsFunction(); + + // no exact match, use the generic selector, parameterized by the GLSL rules + + // create list of candidates to send + TVector candidateList; + symbolTable.findFunctionNameList(call.getMangledName(), candidateList, builtIn); + + // can 'from' convert to 'to'? + const auto convertible = [this](const TType& from, const TType& to, TOperator, int) -> bool { + if (from == to) + return true; + if (from.isArray() || to.isArray() || ! from.sameElementShape(to)) + return false; + return intermediate.canImplicitlyPromote(from.getBasicType(), to.getBasicType()); + }; + + // Is 'to2' a better conversion than 'to1'? + // Ties should not be considered as better. + // Assumes 'convertible' already said true. + const auto better = [this](const TType& from, const TType& to1, const TType& to2) -> bool { + // 1. exact match + if (from == to2) + return from != to1; + if (from == to1) + return false; + + // 2. Promotion (integral, floating-point) is better + TBasicType from_type = from.getBasicType(); + TBasicType to1_type = to1.getBasicType(); + TBasicType to2_type = to2.getBasicType(); + bool isPromotion1 = (intermediate.isIntegralPromotion(from_type, to1_type) || + intermediate.isFPPromotion(from_type, to1_type)); + bool isPromotion2 = (intermediate.isIntegralPromotion(from_type, to2_type) || + intermediate.isFPPromotion(from_type, to2_type)); + if (isPromotion2) + return !isPromotion1; + if(isPromotion1) + return false; + + // 3. Conversion (integral, floating-point , floating-integral) + bool isConversion1 = (intermediate.isIntegralConversion(from_type, to1_type) || + intermediate.isFPConversion(from_type, to1_type) || + intermediate.isFPIntegralConversion(from_type, to1_type)); + bool isConversion2 = (intermediate.isIntegralConversion(from_type, to2_type) || + intermediate.isFPConversion(from_type, to2_type) || + intermediate.isFPIntegralConversion(from_type, to2_type)); + + return isConversion2 && !isConversion1; + }; + + // for ambiguity reporting + bool tie = false; + + // send to the generic selector + const TFunction* bestMatch = selectFunction(candidateList, call, convertible, better, tie); + + if (bestMatch == nullptr) + error(loc, "no matching overloaded function found", call.getName().c_str(), ""); + else if (tie) + error(loc, "ambiguous best function under implicit type conversion", call.getName().c_str(), ""); + + return bestMatch; +} + // When a declaration includes a type, but not a variable name, it can be // to establish defaults. void TParseContext::declareTypeDefaults(const TSourceLoc& loc, const TPublicType& publicType) @@ -5110,15 +5343,15 @@ // 'publicType' is the type part of the declaration (to the left) // 'arraySizes' is the arrayness tagged on the identifier (to the right) // -TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& identifier, const TPublicType& publicType, TArraySizes* arraySizes, TIntermTyped* initializer) +TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& identifier, const TPublicType& publicType, + TArraySizes* arraySizes, TIntermTyped* initializer) { - TType type(publicType); // shallow copy; 'type' shares the arrayness and structure definition with 'publicType' - if (type.isImplicitlySizedArray()) { - // Because "int[] a = int[2](...), b = int[3](...)" makes two arrays a and b - // of different sizes, for this case sharing the shallow copy of arrayness - // with the publicType oversubscribes it, so get a deep copy of the arrayness. - type.newArraySizes(*publicType.arraySizes); - } + // Make a fresh type that combines the characteristics from the individual + // identifier syntax and the declaration-type syntax. + TType type(publicType); + type.transferArraySizes(arraySizes); + type.copyArrayInnerSizes(publicType.arraySizes); + arrayOfArrayVersionCheck(loc, type.getArraySizes()); if (voidErrorCheck(loc, identifier, type.getBasicType())) return nullptr; @@ -5145,15 +5378,9 @@ inheritGlobalDefaults(type.getQualifier()); // Declare the variable - if (arraySizes || type.isArray()) { - // Arrayness is potentially coming both from the type and from the - // variable: "int[] a[];" or just one or the other. - // Merge it all to the type, so all arrayness is part of the type. - arrayDimCheck(loc, &type, arraySizes); - arrayDimMerge(type, arraySizes); - + if (type.isArray()) { // Check that implicit sizing is only where allowed. - arraySizesCheck(loc, type.getQualifier(), &type.getArraySizes(), initializer != nullptr, false); + arraySizesCheck(loc, type.getQualifier(), type.getArraySizes(), initializer != nullptr, false); if (! arrayQualifierError(loc, type.getQualifier()) && ! arrayError(loc, type)) declareArray(loc, identifier, type, symbol); @@ -5284,8 +5511,7 @@ } // Fix outer arrayness if variable is unsized, getting size from the initializer - if (initializer->getType().isExplicitlySizedArray() && - variable->getType().isImplicitlySizedArray()) + if (initializer->getType().isSizedArray() && variable->getType().isUnsizedArray()) variable->getWritableType().changeOuterArraySize(initializer->getType().getOuterArraySize()); // Inner arrayness can also get set by an initializer @@ -5294,8 +5520,10 @@ variable->getType().getArraySizes()->getNumDims()) { // adopt unsized sizes from the initializer's sizes for (int d = 1; d < variable->getType().getArraySizes()->getNumDims(); ++d) { - if (variable->getType().getArraySizes()->getDimSize(d) == UnsizedArraySize) - variable->getWritableType().getArraySizes().setDimSize(d, initializer->getType().getArraySizes()->getDimSize(d)); + if (variable->getType().getArraySizes()->getDimSize(d) == UnsizedArraySize) { + variable->getWritableType().getArraySizes()->setDimSize(d, + initializer->getType().getArraySizes()->getDimSize(d)); + } } } @@ -5406,16 +5634,16 @@ // Later on, initializer execution code will deal with array size logic. TType arrayType; arrayType.shallowCopy(type); // sharing struct stuff is fine - arrayType.newArraySizes(*type.getArraySizes()); // but get a fresh copy of the array information, to edit below + arrayType.copyArraySizes(*type.getArraySizes()); // but get a fresh copy of the array information, to edit below // edit array sizes to fill in unsized dimensions arrayType.changeOuterArraySize((int)initList->getSequence().size()); TIntermTyped* firstInit = initList->getSequence()[0]->getAsTyped(); if (arrayType.isArrayOfArrays() && firstInit->getType().isArray() && - arrayType.getArraySizes().getNumDims() == firstInit->getType().getArraySizes()->getNumDims() + 1) { - for (int d = 1; d < arrayType.getArraySizes().getNumDims(); ++d) { - if (arrayType.getArraySizes().getDimSize(d) == UnsizedArraySize) - arrayType.getArraySizes().setDimSize(d, firstInit->getType().getArraySizes()->getDimSize(d - 1)); + arrayType.getArraySizes()->getNumDims() == firstInit->getType().getArraySizes()->getNumDims() + 1) { + for (int d = 1; d < arrayType.getArraySizes()->getNumDims(); ++d) { + if (arrayType.getArraySizes()->getDimSize(d) == UnsizedArraySize) + arrayType.getArraySizes()->setDimSize(d, firstInit->getType().getArraySizes()->getDimSize(d - 1)); } } @@ -5565,8 +5793,22 @@ // // Returns nullptr for an error or the constructed node. // -TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, TIntermTyped* node, const TSourceLoc& loc, bool subset) +TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, TIntermTyped* node, const TSourceLoc& loc, + bool subset) { + // If we are changing a matrix in both domain of basic type and to a non matrix, + // do the shape change first (by default, below, basic type is changed before shape). + // This avoids requesting a matrix of a new type that is going to be discarded anyway. + // TODO: This could be generalized to more type combinations, but that would require + // more extensive testing and full algorithm rework. For now, the need to do two changes makes + // the recursive call work, and avoids the most aggregious case of creating integer matrices. + if (node->getType().isMatrix() && (type.isScalar() || type.isVector()) && + type.isFloatingDomain() != node->getType().isFloatingDomain()) { + TType transitionType(node->getBasicType(), glslang::EvqTemporary, type.getVectorSize(), 0, 0, node->isVector()); + TOperator transitionOp = intermediate.mapTypeToConstructorOp(transitionType); + node = constructBuiltIn(transitionType, transitionOp, node, loc, false); + } + TIntermTyped* newNode; TOperator basicOp; @@ -5606,7 +5848,6 @@ basicOp = EOpConstructDouble; break; -#ifdef AMD_EXTENSIONS case EOpConstructF16Vec2: case EOpConstructF16Vec3: case EOpConstructF16Vec4: @@ -5622,7 +5863,34 @@ case EOpConstructFloat16: basicOp = EOpConstructFloat16; break; -#endif + + case EOpConstructI8Vec2: + case EOpConstructI8Vec3: + case EOpConstructI8Vec4: + case EOpConstructInt8: + basicOp = EOpConstructInt8; + break; + + case EOpConstructU8Vec2: + case EOpConstructU8Vec3: + case EOpConstructU8Vec4: + case EOpConstructUint8: + basicOp = EOpConstructUint8; + break; + + case EOpConstructI16Vec2: + case EOpConstructI16Vec3: + case EOpConstructI16Vec4: + case EOpConstructInt16: + basicOp = EOpConstructInt16; + break; + + case EOpConstructU16Vec2: + case EOpConstructU16Vec3: + case EOpConstructU16Vec4: + case EOpConstructUint16: + basicOp = EOpConstructUint16; + break; case EOpConstructIVec2: case EOpConstructIVec3: @@ -5652,22 +5920,6 @@ basicOp = EOpConstructUint64; break; -#ifdef AMD_EXTENSIONS - case EOpConstructI16Vec2: - case EOpConstructI16Vec3: - case EOpConstructI16Vec4: - case EOpConstructInt16: - basicOp = EOpConstructInt16; - break; - - case EOpConstructU16Vec2: - case EOpConstructU16Vec3: - case EOpConstructU16Vec4: - case EOpConstructUint16: - basicOp = EOpConstructUint16; - break; -#endif - case EOpConstructBVec2: case EOpConstructBVec3: case EOpConstructBVec4: @@ -5675,6 +5927,11 @@ basicOp = EOpConstructBool; break; + case EOpConstructNonuniform: + node->getWritableType().getQualifier().nonUniform = true; + return node; + break; + default: error(loc, "unsupported construction", "", ""); @@ -5719,13 +5976,14 @@ // // Do everything needed to add an interface block. // -void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, const TString* instanceName, TArraySizes* arraySizes) +void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, const TString* instanceName, + TArraySizes* arraySizes) { blockStageIoCheck(loc, currentBlockQualifier); blockQualifierCheck(loc, currentBlockQualifier, instanceName != nullptr); - if (arraySizes) { + if (arraySizes != nullptr) { arraySizesCheck(loc, currentBlockQualifier, arraySizes, false, false); - arrayDimCheck(loc, arraySizes, 0); + arrayOfArrayVersionCheck(loc, arraySizes); if (arraySizes->getNumDims() > 1) requireProfile(loc, ~EEsProfile, "array-of-array of block"); } @@ -5742,7 +6000,7 @@ if ((currentBlockQualifier.storage == EvqUniform || currentBlockQualifier.storage == EvqBuffer) && (memberQualifier.isInterpolation() || memberQualifier.isAuxiliary())) error(memberLoc, "member of uniform or buffer block cannot have an auxiliary or interpolation qualifier", memberType.getFieldName().c_str(), ""); if (memberType.isArray()) - arraySizesCheck(memberLoc, currentBlockQualifier, &memberType.getArraySizes(), false, member == typeList.size() - 1); + arraySizesCheck(memberLoc, currentBlockQualifier, memberType.getArraySizes(), false, member == typeList.size() - 1); if (memberQualifier.hasOffset()) { if (spvVersion.spv == 0) { requireProfile(memberLoc, ~EEsProfile, "offset on block member"); @@ -5864,8 +6122,8 @@ // TType blockType(&typeList, *blockName, currentBlockQualifier); - if (arraySizes) - blockType.newArraySizes(*arraySizes); + if (arraySizes != nullptr) + blockType.transferArraySizes(arraySizes); else ioArrayCheck(loc, blockType, instanceName ? *instanceName : *blockName); @@ -6032,7 +6290,8 @@ memberQualifier.layoutLocation = nextLocation; memberQualifier.layoutComponent = TQualifier::layoutComponentEnd; } - nextLocation = memberQualifier.layoutLocation + intermediate.computeTypeLocationSize(*typeList[member].type); + nextLocation = memberQualifier.layoutLocation + intermediate.computeTypeLocationSize( + *typeList[member].type, language); } } } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/ParseHelper.h vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/ParseHelper.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/ParseHelper.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/ParseHelper.h 2018-04-27 11:46:26.000000000 +0000 @@ -44,13 +44,15 @@ #ifndef _PARSER_HELPER_INCLUDED_ #define _PARSER_HELPER_INCLUDED_ +#include +#include + #include "parseVersions.h" #include "../Include/ShHandle.h" #include "SymbolTable.h" #include "localintermediate.h" #include "Scan.h" -#include -#include +#include "attribute.h" namespace glslang { @@ -185,7 +187,7 @@ TParseContextBase& operator=(TParseContextBase&); const bool parsingBuiltins; // true if parsing built-in symbols/functions - TVector linkageSymbols; // these need to be transferred to 'linkage', after all editing is done + TVector linkageSymbols; // will be transferred to 'linkage', after all editing is done, order preserving TScanContext* scanContext; TPpContext* ppContext; TBuiltInResource resources; @@ -307,7 +309,7 @@ TFunction* handleFunctionDeclarator(const TSourceLoc&, TFunction& function, bool prototype); TIntermAggregate* handleFunctionDefinition(const TSourceLoc&, TFunction&); TIntermTyped* handleFunctionCall(const TSourceLoc&, TFunction*, TIntermNode*); - TIntermTyped* handleBuiltInFunctionCall(TSourceLoc, TIntermNode& arguments, const TFunction& function); + TIntermTyped* handleBuiltInFunctionCall(TSourceLoc, TIntermNode* arguments, const TFunction& function); void computeBuiltinPrecisions(TIntermTyped&, const TFunction&); TIntermNode* handleReturnValue(const TSourceLoc&, TIntermTyped*); void checkLocation(const TSourceLoc&, TOperator); @@ -338,17 +340,15 @@ bool arrayError(const TSourceLoc&, const TType&); void arraySizeRequiredCheck(const TSourceLoc&, const TArraySizes&); void structArrayCheck(const TSourceLoc&, const TType& structure); - void arraySizesCheck(const TSourceLoc&, const TQualifier&, const TArraySizes*, bool initializer, bool lastMember); - void arrayOfArrayVersionCheck(const TSourceLoc&); - void arrayDimCheck(const TSourceLoc&, const TArraySizes* sizes1, const TArraySizes* sizes2); - void arrayDimCheck(const TSourceLoc&, const TType*, const TArraySizes*); - void arrayDimMerge(TType& type, const TArraySizes* sizes); + void arraySizesCheck(const TSourceLoc&, const TQualifier&, TArraySizes*, bool initializer, bool lastMember); + void arrayOfArrayVersionCheck(const TSourceLoc&, const TArraySizes*); bool voidErrorCheck(const TSourceLoc&, const TString&, TBasicType); void boolCheck(const TSourceLoc&, const TIntermTyped*); void boolCheck(const TSourceLoc&, const TPublicType&); void samplerCheck(const TSourceLoc&, const TType&, const TString& identifier, TIntermTyped* initializer); void atomicUintCheck(const TSourceLoc&, const TType&, const TString& identifier); void transparentOpaqueCheck(const TSourceLoc&, const TType&, const TString& identifier); + void memberQualifierCheck(glslang::TPublicType&); void globalQualifierFixCheck(const TSourceLoc&, TQualifier&); void globalQualifierTypeCheck(const TSourceLoc&, const TQualifier&, const TPublicType&); bool structQualifierErrorCheck(const TSourceLoc&, const TPublicType& pType); @@ -361,7 +361,7 @@ bool containsFieldWithBasicType(const TType& type ,TBasicType basicType); TSymbol* redeclareBuiltinVariable(const TSourceLoc&, const TString&, const TQualifier&, const TShaderQualifiers&); void redeclareBuiltinBlock(const TSourceLoc&, TTypeList& typeList, const TString& blockName, const TString* instanceName, TArraySizes* arraySizes); - void paramCheckFix(const TSourceLoc&, const TStorageQualifier&, TType& type); + void paramCheckFixStorage(const TSourceLoc&, const TStorageQualifier&, TType& type); void paramCheckFix(const TSourceLoc&, const TQualifier&, TType& type); void nestedBlockCheck(const TSourceLoc&); void nestedStructCheck(const TSourceLoc&); @@ -390,6 +390,7 @@ const TFunction* findFunctionExact(const TSourceLoc& loc, const TFunction& call, bool& builtIn); const TFunction* findFunction120(const TSourceLoc& loc, const TFunction& call, bool& builtIn); const TFunction* findFunction400(const TSourceLoc& loc, const TFunction& call, bool& builtIn); + const TFunction* findFunctionExplicitTypes(const TSourceLoc& loc, const TFunction& call, bool& builtIn); void declareTypeDefaults(const TSourceLoc&, const TPublicType&); TIntermNode* declareVariable(const TSourceLoc&, TString& identifier, const TPublicType&, TArraySizes* typeArray = 0, TIntermTyped* initializer = 0); TIntermTyped* addConstructor(const TSourceLoc&, TIntermNode*, const TType&); @@ -408,7 +409,17 @@ void wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode); TIntermNode* addSwitch(const TSourceLoc&, TIntermTyped* expression, TIntermAggregate* body); - void updateImplicitArraySize(const TSourceLoc&, TIntermNode*, int index); + TAttributeType attributeFromName(const TString& name) const; + TAttributes* makeAttributes(const TString& identifier) const; + TAttributes* makeAttributes(const TString& identifier, TIntermNode* node) const; + TAttributes* mergeAttributes(TAttributes*, TAttributes*) const; + + // Determine selection control from attributes + void handleSelectionAttributes(const TAttributes& attributes, TIntermNode*); + void handleSwitchAttributes(const TAttributes& attributes, TIntermNode*); + + // Determine loop control from attributes + void handleLoopAttributes(const TAttributes& attributes, TIntermNode*); protected: void nonInitConstCheck(const TSourceLoc&, TString& identifier, TType& type); @@ -416,6 +427,8 @@ TVariable* makeInternalVariable(const char* name, const TType&) const; TVariable* declareNonArray(const TSourceLoc&, const TString& identifier, const TType&); void declareArray(const TSourceLoc&, const TString& identifier, const TType&, TSymbol*&); + void checkRuntimeSizable(const TSourceLoc&, const TIntermTyped&); + bool isRuntimeLength(const TIntermTyped&) const; TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable); TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer); void finish() override; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/parseVersions.h vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/parseVersions.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/parseVersions.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/parseVersions.h 2018-04-27 11:46:26.000000000 +0000 @@ -1,5 +1,6 @@ // // Copyright (C) 2016 Google, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -77,11 +78,16 @@ virtual void updateExtensionBehavior(int line, const char* const extension, const char* behavior); virtual void fullIntegerCheck(const TSourceLoc&, const char* op); virtual void doubleCheck(const TSourceLoc&, const char* op); -#ifdef AMD_EXTENSIONS - virtual void int16Check(const TSourceLoc& loc, const char* op, bool builtIn = false); virtual void float16Check(const TSourceLoc&, const char* op, bool builtIn = false); +#ifdef AMD_EXTENSIONS + virtual void float16OpaqueCheck(const TSourceLoc&, const char* op, bool builtIn = false); #endif virtual void int64Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void explicitInt8Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void explicitInt16Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void explicitInt32Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void explicitFloat32Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void explicitFloat64Check(const TSourceLoc&, const char* op, bool builtIn = false); virtual void spvRemoved(const TSourceLoc&, const char* op); virtual void vulkanRemoved(const TSourceLoc&, const char* op); virtual void requireVulkan(const TSourceLoc&, const char* op); @@ -113,6 +119,7 @@ bool relaxedErrors() const { return (messages & EShMsgRelaxedErrors) != 0; } bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; } bool isReadingHLSL() const { return (messages & EShMsgReadHlsl) == EShMsgReadHlsl; } + bool hlslEnable16BitTypes() const { return (messages & EShMsgHlslEnable16BitTypes) != 0; } TInfoSink& infoSink; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/PoolAlloc.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/PoolAlloc.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/PoolAlloc.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/PoolAlloc.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -40,35 +40,22 @@ namespace glslang { +// Process-wide TLS index OS_TLSIndex PoolIndex; -void InitializeMemoryPools() +// Return the thread-specific current pool. +TPoolAllocator& GetThreadPoolAllocator() { - TThreadMemoryPools* pools = static_cast(OS_GetTLSValue(PoolIndex)); - if (pools) - return; - - TPoolAllocator *threadPoolAllocator = new TPoolAllocator(); - - TThreadMemoryPools* threadData = new TThreadMemoryPools(); - - threadData->threadPoolAllocator = threadPoolAllocator; - - OS_SetTLSValue(PoolIndex, threadData); + return *static_cast(OS_GetTLSValue(PoolIndex)); } -void FreeGlobalPools() +// Set the thread-specific current pool. +void SetThreadPoolAllocator(TPoolAllocator* poolAllocator) { - // Release the allocated memory for this thread. - TThreadMemoryPools* globalPools = static_cast(OS_GetTLSValue(PoolIndex)); - if (! globalPools) - return; - - GetThreadPoolAllocator().popAll(); - delete &GetThreadPoolAllocator(); - delete globalPools; + OS_SetTLSValue(PoolIndex, poolAllocator); } +// Process-wide set up of the TLS pool storage. bool InitializePoolIndex() { // Allocate a TLS index. @@ -78,26 +65,6 @@ return true; } -void FreePoolIndex() -{ - // Release the TLS index. - OS_FreeTLSIndex(PoolIndex); -} - -TPoolAllocator& GetThreadPoolAllocator() -{ - TThreadMemoryPools* threadData = static_cast(OS_GetTLSValue(PoolIndex)); - - return *threadData->threadPoolAllocator; -} - -void SetThreadPoolAllocator(TPoolAllocator& poolAllocator) -{ - TThreadMemoryPools* threadData = static_cast(OS_GetTLSValue(PoolIndex)); - - threadData->threadPoolAllocator = &poolAllocator; -} - // // Implement the functionality of the TPoolAllocator class, which // is documented in PoolAlloc.h. @@ -234,13 +201,16 @@ currentPageOffset = stack.back().offset; while (inUseList != page) { - // invoke destructor to free allocation list - inUseList->~tHeader(); - tHeader* nextInUse = inUseList->nextPage; - if (inUseList->pageCount > 1) + size_t pageCount = inUseList->pageCount; + + // This technically ends the lifetime of the header as C++ object, + // but we will still control the memory and reuse it. + inUseList->~tHeader(); // currently, just a debug allocation checker + + if (pageCount > 1) { delete [] reinterpret_cast(inUseList); - else { + } else { inUseList->nextPage = freeList; freeList = inUseList; } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -731,12 +731,10 @@ TSourceLoc loc = ppToken->loc; while (token != '\n' && token != EndOfInput) { - if (token == PpAtomConstInt || token == PpAtomConstUint || + if (token == PpAtomConstInt16 || token == PpAtomConstUint16 || + token == PpAtomConstInt || token == PpAtomConstUint || token == PpAtomConstInt64 || token == PpAtomConstUint64 || -#ifdef AMD_EXTENSIONS - token == PpAtomConstInt16 || token == PpAtomConstUint16 || token == PpAtomConstFloat16 || -#endif token == PpAtomConstFloat || token == PpAtomConstDouble) { message.append(ppToken->name); } else if (token == PpAtomIdentifier || token == PpAtomConstString) { @@ -775,9 +773,7 @@ #endif case PpAtomConstFloat: case PpAtomConstDouble: -#ifdef AMD_EXTENSIONS case PpAtomConstFloat16: -#endif tokens.push_back(ppToken->name); break; default: @@ -1157,7 +1153,6 @@ } MacroSymbol* macro = macroAtom == 0 ? nullptr : lookupMacroDef(macroAtom); - int token; int depth = 0; // no recursive expansions @@ -1179,13 +1174,12 @@ TSourceLoc loc = ppToken->loc; // in case we go to the next line before discovering the error in->mac = macro; if (macro->args.size() > 0 || macro->emptyArgs) { - token = scanToken(ppToken); + int token = scanToken(ppToken); if (newLineOkay) { while (token == '\n') token = scanToken(ppToken); } if (token != '(') { - parseContext.ppError(loc, "expected '(' following", "macro expansion", atomStrings.getString(macroAtom)); UngetToken(token, ppToken); delete in; return 0; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/preprocessor/PpMemory.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/preprocessor/PpMemory.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/preprocessor/PpMemory.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/preprocessor/PpMemory.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -// -// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -// Copyright (C) 2013 LunarG, Inc. -// 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 3Dlabs Inc. Ltd. 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 HOLDERS 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. -// -/****************************************************************************\ -Copyright (c) 2002, NVIDIA Corporation. - -NVIDIA Corporation("NVIDIA") supplies this software to you in -consideration of your agreement to the following terms, and your use, -installation, modification or redistribution of this NVIDIA software -constitutes acceptance of these terms. If you do not agree with these -terms, please do not use, install, modify or redistribute this NVIDIA -software. - -In consideration of your agreement to abide by the following terms, and -subject to these terms, NVIDIA grants you a personal, non-exclusive -license, under NVIDIA's copyrights in this original NVIDIA software (the -"NVIDIA Software"), to use, reproduce, modify and redistribute the -NVIDIA Software, with or without modifications, in source and/or binary -forms; provided that if you redistribute the NVIDIA Software, you must -retain the copyright notice of NVIDIA, this notice and the following -text and disclaimers in all such redistributions of the NVIDIA Software. -Neither the name, trademarks, service marks nor logos of NVIDIA -Corporation may be used to endorse or promote products derived from the -NVIDIA Software without specific prior written permission from NVIDIA. -Except as expressly stated in this notice, no other rights or licenses -express or implied, are granted by NVIDIA herein, including but not -limited to any patent rights that may be infringed by your derivative -works or by other works in which the NVIDIA Software may be -incorporated. No hardware is licensed hereunder. - -THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT -WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, -INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR -ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER -PRODUCTS. - -IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, -INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY -OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE -NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, -TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF -NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -\****************************************************************************/ - -namespace glslang { - -} // end namespace glslang diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -103,17 +104,6 @@ { bool HasDecimalOrExponent = false; int isDouble = 0; - bool generateFloat16 = false; - bool acceptFloat16 = parseContext.intermediate.getSource() == EShSourceHlsl; - bool isFloat16 = false; - bool requireHF = false; -#ifdef AMD_EXTENSIONS - if (parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float)) { - acceptFloat16 = true; - generateFloat16 = true; - requireHF = true; - } -#endif const auto saveName = [&](int ch) { if (len <= MaxTokenLength) @@ -128,7 +118,7 @@ ch = getChar(); // 1.#INF or -1.#INF - if (parseContext.intermediate.getSource() == EShSourceHlsl && ch == '#') { + if (ch == '#' && (ifdepth > 0 || parseContext.intermediate.getSource() == EShSourceHlsl)) { if ((len < 2) || (len == 2 && ppToken->name[0] != '1') || (len == 3 && ppToken->name[1] != '1' && !(ppToken->name[0] == '-' || ppToken->name[0] == '+')) || @@ -182,28 +172,32 @@ } // Suffix: - + bool isFloat16 = false; if (ch == 'l' || ch == 'L') { - parseContext.doubleCheck(ppToken->loc, "double floating-point suffix"); - if (! HasDecimalOrExponent) + if (ifdepth == 0 && parseContext.intermediate.getSource() == EShSourceGlsl) + parseContext.doubleCheck(ppToken->loc, "double floating-point suffix"); + if (ifdepth == 0 && !HasDecimalOrExponent) parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", ""); - int ch2 = getChar(); - if (ch2 != 'f' && ch2 != 'F') { - ungetChar(); - ungetChar(); - } else { + if (parseContext.intermediate.getSource() == EShSourceGlsl) { + int ch2 = getChar(); + if (ch2 != 'f' && ch2 != 'F') { + ungetChar(); + ungetChar(); + } else { + saveName(ch); + saveName(ch2); + isDouble = 1; + } + } else if (parseContext.intermediate.getSource() == EShSourceHlsl) { saveName(ch); - saveName(ch2); isDouble = 1; } - } else if (acceptFloat16 && (ch == 'h' || ch == 'H')) { -#ifdef AMD_EXTENSIONS - if (generateFloat16) + } else if (ch == 'h' || ch == 'H') { + if (ifdepth == 0 && parseContext.intermediate.getSource() == EShSourceGlsl) parseContext.float16Check(ppToken->loc, "half floating-point suffix"); -#endif - if (!HasDecimalOrExponent) + if (ifdepth == 0 && !HasDecimalOrExponent) parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", ""); - if (requireHF) { + if (parseContext.intermediate.getSource() == EShSourceGlsl) { int ch2 = getChar(); if (ch2 != 'f' && ch2 != 'F') { ungetChar(); @@ -211,17 +205,18 @@ } else { saveName(ch); saveName(ch2); - isFloat16 = generateFloat16; + isFloat16 = true; } - } else { + } else if (parseContext.intermediate.getSource() == EShSourceHlsl) { saveName(ch); - isFloat16 = generateFloat16; + isFloat16 = true; } } else if (ch == 'f' || ch == 'F') { - parseContext.profileRequires(ppToken->loc, EEsProfile, 300, nullptr, "floating-point suffix"); - if (! parseContext.relaxedErrors()) + if (ifdepth == 0) + parseContext.profileRequires(ppToken->loc, EEsProfile, 300, nullptr, "floating-point suffix"); + if (ifdepth == 0 && !parseContext.relaxedErrors()) parseContext.profileRequires(ppToken->loc, ~EEsProfile, 120, nullptr, "floating-point suffix"); - if (! HasDecimalOrExponent) + if (ifdepth == 0 && !HasDecimalOrExponent) parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", ""); saveName(ch); } else @@ -333,19 +328,23 @@ int ch = 0; int ii = 0; unsigned long long ival = 0; - bool enableInt64 = pp->parseContext.version >= 450 && pp->parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_int64); -#ifdef AMD_EXTENSIONS - bool enableInt16 = pp->parseContext.version >= 450 && pp->parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_int16); -#endif - bool acceptHalf = pp->parseContext.intermediate.getSource() == EShSourceHlsl; -#ifdef AMD_EXTENSIONS - if (pp->parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float)) - acceptHalf = true; -#endif - const auto floatingPointChar = [&](int ch) { return ch == '.' || ch == 'e' || ch == 'E' || ch == 'f' || ch == 'F' || - (acceptHalf && (ch == 'h' || ch == 'H')); }; + ch == 'h' || ch == 'H'; }; + + static const char* const Int64_Extensions[] = { + E_GL_ARB_gpu_shader_int64, + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int64 }; + static const int Num_Int64_Extensions = sizeof(Int64_Extensions) / sizeof(Int64_Extensions[0]); + + static const char* const Int16_Extensions[] = { +#ifdef AMD_EXTENSIONS + E_GL_AMD_gpu_shader_int16, +#endif + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int16 }; + static const int Num_Int16_Extensions = sizeof(Int16_Extensions) / sizeof(Int16_Extensions[0]); ppToken->ival = 0; ppToken->i64val = 0; @@ -409,9 +408,7 @@ bool isUnsigned = false; bool isInt64 = false; -#ifdef AMD_EXTENSIONS bool isInt16 = false; -#endif ppToken->name[len++] = (char)ch; ch = getch(); if ((ch >= '0' && ch <= '9') || @@ -420,7 +417,7 @@ ival = 0; do { - if (len < MaxTokenLength && (ival <= 0x0fffffffu || (enableInt64 && ival <= 0x0fffffffffffffffull))) { + if (len < MaxTokenLength && ival <= 0x0fffffffffffffffull) { ppToken->name[len++] = (char)ch; if (ch >= '0' && ch <= '9') { ii = ch - '0'; @@ -453,33 +450,31 @@ ppToken->name[len++] = (char)ch; isUnsigned = true; - if (enableInt64) { - int nextCh = getch(); - if ((ch == 'u' && nextCh == 'l') || (ch == 'U' && nextCh == 'L')) { - if (len < MaxTokenLength) - ppToken->name[len++] = (char)nextCh; - isInt64 = true; - } else - ungetch(); - } + int nextCh = getch(); + if (nextCh == 'l' || nextCh == 'L') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt64 = true; + } else + ungetch(); #ifdef AMD_EXTENSIONS - if (enableInt16) { - int nextCh = getch(); - if ((ch == 'u' && nextCh == 's') || (ch == 'U' && nextCh == 'S')) { - if (len < MaxTokenLength) - ppToken->name[len++] = (char)nextCh; - isInt16 = true; - } else - ungetch(); - } + nextCh = getch(); + if ((nextCh == 's' || nextCh == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt16 = true; + } else + ungetch(); #endif - } else if (enableInt64 && (ch == 'l' || ch == 'L')) { + } else if (ch == 'l' || ch == 'L') { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isInt64 = true; #ifdef AMD_EXTENSIONS - } else if (enableInt16 && (ch == 's' || ch == 'S')) { + } else if ((ch == 's' || ch == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isInt16 = true; @@ -488,15 +483,29 @@ ungetch(); ppToken->name[len] = '\0'; - if (isInt64) { + if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (pp->ifdepth == 0) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "64-bit hexadecimal literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int64_Extensions, Int64_Extensions, "64-bit hexadecimal literal"); + } ppToken->i64val = ival; return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; -#ifdef AMD_EXTENSIONS } else if (isInt16) { + if (pp->ifdepth == 0) { + if (pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "16-bit hexadecimal literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int16_Extensions, Int16_Extensions, "16-bit hexadecimal literal"); + } + } ppToken->ival = (int)ival; return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16; -#endif } else { + if (ival > 0xffffffffu && !AlreadyComplained) + pp->parseContext.ppError(ppToken->loc, "hexadecimal literal too big", "", ""); ppToken->ival = (int)ival; return isUnsigned ? PpAtomConstUint : PpAtomConstInt; } @@ -505,9 +514,7 @@ bool isUnsigned = false; bool isInt64 = false; -#ifdef AMD_EXTENSIONS bool isInt16 = false; -#endif bool octalOverflow = false; bool nonOctal = false; ival = 0; @@ -520,7 +527,7 @@ pp->parseContext.ppError(ppToken->loc, "numeric literal too long", "", ""); AlreadyComplained = 1; } - if (ival <= 0x1fffffffu || (enableInt64 && ival <= 0x1fffffffffffffffull)) { + if (ival <= 0x1fffffffffffffffull) { ii = ch - '0'; ival = (ival << 3) | ii; } else @@ -553,33 +560,31 @@ ppToken->name[len++] = (char)ch; isUnsigned = true; - if (enableInt64) { - int nextCh = getch(); - if ((ch == 'u' && nextCh == 'l') || (ch == 'U' && nextCh == 'L')) { - if (len < MaxTokenLength) - ppToken->name[len++] = (char)nextCh; - isInt64 = true; - } else - ungetch(); - } + int nextCh = getch(); + if (nextCh == 'l' || nextCh == 'L') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt64 = true; + } else + ungetch(); #ifdef AMD_EXTENSIONS - if (enableInt16) { - int nextCh = getch(); - if ((ch == 'u' && nextCh == 's') || (ch == 'U' && nextCh == 'S')) { - if (len < MaxTokenLength) - ppToken->name[len++] = (char)nextCh; - isInt16 = true; - } else - ungetch(); - } + nextCh = getch(); + if ((nextCh == 's' || nextCh == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt16 = true; + } else + ungetch(); #endif - } else if (enableInt64 && (ch == 'l' || ch == 'L')) { + } else if (ch == 'l' || ch == 'L') { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isInt64 = true; #ifdef AMD_EXTENSIONS - } else if (enableInt16 && (ch == 's' || ch == 'S')) { + } else if ((ch == 's' || ch == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isInt16 = true; @@ -588,17 +593,32 @@ ungetch(); ppToken->name[len] = '\0'; + if (!isInt64 && ival > 0xffffffffu) + octalOverflow = true; + if (octalOverflow) pp->parseContext.ppError(ppToken->loc, "octal literal too big", "", ""); - if (isInt64) { + if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (pp->ifdepth == 0) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "64-bit octal literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int64_Extensions, Int64_Extensions, "64-bit octal literal"); + } ppToken->i64val = ival; return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; -#ifdef AMD_EXTENSIONS } else if (isInt16) { + if (pp->ifdepth == 0) { + if (pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "16-bit octal literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int16_Extensions, Int16_Extensions, "16-bit octal literal"); + } + } ppToken->ival = (int)ival; return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16; -#endif } else { ppToken->ival = (int)ival; return isUnsigned ? PpAtomConstUint : PpAtomConstInt; @@ -625,41 +645,37 @@ int numericLen = len; bool isUnsigned = false; bool isInt64 = false; -#ifdef AMD_EXTENSIONS bool isInt16 = false; -#endif if (ch == 'u' || ch == 'U') { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isUnsigned = true; - if (enableInt64) { - int nextCh = getch(); - if ((ch == 'u' && nextCh == 'l') || (ch == 'U' && nextCh == 'L')) { - if (len < MaxTokenLength) - ppToken->name[len++] = (char)nextCh; - isInt64 = true; - } else - ungetch(); - } + int nextCh = getch(); + if (nextCh == 'l' || nextCh == 'L') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt64 = true; + } else + ungetch(); #ifdef AMD_EXTENSIONS - if (enableInt16) { - int nextCh = getch(); - if ((ch == 'u' && nextCh == 's') || (ch == 'U' && nextCh == 'S')) { - if (len < MaxTokenLength) - ppToken->name[len++] = (char)nextCh; - isInt16 = true; - } else - ungetch(); - } + nextCh = getch(); + if ((nextCh == 's' || nextCh == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt16 = true; + } else + ungetch(); #endif - } else if (enableInt64 && (ch == 'l' || ch == 'L')) { + } else if (ch == 'l' || ch == 'L') { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isInt64 = true; #ifdef AMD_EXTENSIONS - } else if (enableInt16 && (ch == 's' || ch == 'S')) { + } else if ((ch == 's' || ch == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isInt16 = true; @@ -673,19 +689,15 @@ const unsigned remainderMaxInt = 0xFFFFFFFFu - 10 * oneTenthMaxInt; const unsigned long long oneTenthMaxInt64 = 0xFFFFFFFFFFFFFFFFull / 10; const unsigned long long remainderMaxInt64 = 0xFFFFFFFFFFFFFFFFull - 10 * oneTenthMaxInt64; -#ifdef AMD_EXTENSIONS const unsigned short oneTenthMaxInt16 = 0xFFFFu / 10; const unsigned short remainderMaxInt16 = 0xFFFFu - 10 * oneTenthMaxInt16; -#endif for (int i = 0; i < numericLen; i++) { ch = ppToken->name[i] - '0'; bool overflow = false; if (isInt64) overflow = (ival > oneTenthMaxInt64 || (ival == oneTenthMaxInt64 && (unsigned long long)ch > remainderMaxInt64)); -#ifdef AMD_EXTENSIONS else if (isInt16) overflow = (ival > oneTenthMaxInt16 || (ival == oneTenthMaxInt16 && (unsigned short)ch > remainderMaxInt16)); -#endif else overflow = (ival > oneTenthMaxInt || (ival == oneTenthMaxInt && (unsigned)ch > remainderMaxInt)); if (overflow) { @@ -696,14 +708,24 @@ ival = ival * 10 + ch; } - if (isInt64) { + if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (pp->ifdepth == 0) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "64-bit literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int64_Extensions, Int64_Extensions, "64-bit literal"); + } ppToken->i64val = ival; return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; -#ifdef AMD_EXTENSIONS } else if (isInt16) { + if (pp->ifdepth == 0 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "16-bit literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int16_Extensions, Int16_Extensions, "16-bit literal"); + } ppToken->ival = (int)ival; return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16; -#endif } else { ppToken->ival = (int)ival; return isUnsigned ? PpAtomConstUint : PpAtomConstInt; @@ -953,19 +975,15 @@ case PpAtomConstFloat: case PpAtomConstInt64: case PpAtomConstUint64: -#ifdef AMD_EXTENSIONS case PpAtomConstInt16: case PpAtomConstUint16: -#endif case PpAtomConstDouble: -#ifdef AMD_EXTENSIONS case PpAtomConstFloat16: -#endif if (ppToken.name[0] == '\0') continue; break; case PpAtomConstString: - if (parseContext.intermediate.getSource() != EShSourceHlsl) { + if (ifdepth == 0 && parseContext.intermediate.getSource() != EShSourceHlsl) { // HLSL allows string literals. parseContext.ppError(ppToken.loc, "string literals not supported", "\"\"", ""); continue; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/preprocessor/PpSymbols.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/preprocessor/PpSymbols.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/preprocessor/PpSymbols.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/preprocessor/PpSymbols.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -// -// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -// Copyright (C) 2013 LunarG, Inc. -// 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 3Dlabs Inc. Ltd. 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 HOLDERS 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. -// -/****************************************************************************\ -Copyright (c) 2002, NVIDIA Corporation. - -NVIDIA Corporation("NVIDIA") supplies this software to you in -consideration of your agreement to the following terms, and your use, -installation, modification or redistribution of this NVIDIA software -constitutes acceptance of these terms. If you do not agree with these -terms, please do not use, install, modify or redistribute this NVIDIA -software. - -In consideration of your agreement to abide by the following terms, and -subject to these terms, NVIDIA grants you a personal, non-exclusive -license, under NVIDIA's copyrights in this original NVIDIA software (the -"NVIDIA Software"), to use, reproduce, modify and redistribute the -NVIDIA Software, with or without modifications, in source and/or binary -forms; provided that if you redistribute the NVIDIA Software, you must -retain the copyright notice of NVIDIA, this notice and the following -text and disclaimers in all such redistributions of the NVIDIA Software. -Neither the name, trademarks, service marks nor logos of NVIDIA -Corporation may be used to endorse or promote products derived from the -NVIDIA Software without specific prior written permission from NVIDIA. -Except as expressly stated in this notice, no other rights or licenses -express or implied, are granted by NVIDIA herein, including but not -limited to any patent rights that may be infringed by your derivative -works or by other works in which the NVIDIA Software may be -incorporated. No hardware is licensed hereunder. - -THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT -WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, -INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR -ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER -PRODUCTS. - -IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, -INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY -OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE -NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, -TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF -NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -\****************************************************************************/ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -147,9 +147,7 @@ #endif case PpAtomConstFloat: case PpAtomConstDouble: -#ifdef AMD_EXTENSIONS case PpAtomConstFloat16: -#endif str = ppToken->name; while (*str) { putSubtoken(*str); @@ -187,9 +185,7 @@ case PpAtomIdentifier: case PpAtomConstFloat: case PpAtomConstDouble: -#ifdef AMD_EXTENSIONS case PpAtomConstFloat16: -#endif case PpAtomConstInt: case PpAtomConstUint: case PpAtomConstInt64: @@ -219,9 +215,7 @@ break; case PpAtomConstFloat: case PpAtomConstDouble: -#ifdef AMD_EXTENSIONS case PpAtomConstFloat16: -#endif ppToken->dval = atof(ppToken->name); break; case PpAtomConstInt: diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h 2018-04-27 11:46:26.000000000 +0000 @@ -127,10 +127,8 @@ PpAtomConstUint, PpAtomConstInt64, PpAtomConstUint64, -#ifdef AMD_EXTENSIONS PpAtomConstInt16, PpAtomConstUint16, -#endif PpAtomConstFloat, PpAtomConstDouble, PpAtomConstFloat16, diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/reflection.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/reflection.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/reflection.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/reflection.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -415,6 +415,36 @@ case EsdBuffer: return GL_SAMPLER_BUFFER; } +#ifdef AMD_EXTENSIONS + case EbtFloat16: + switch ((int)sampler.dim) { + case Esd1D: + switch ((int)sampler.shadow) { + case false: return sampler.arrayed ? GL_FLOAT16_SAMPLER_1D_ARRAY_AMD : GL_FLOAT16_SAMPLER_1D_AMD; + case true: return sampler.arrayed ? GL_FLOAT16_SAMPLER_1D_ARRAY_SHADOW_AMD : GL_FLOAT16_SAMPLER_1D_SHADOW_AMD; + } + case Esd2D: + switch ((int)sampler.ms) { + case false: + switch ((int)sampler.shadow) { + case false: return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_ARRAY_AMD : GL_FLOAT16_SAMPLER_2D_AMD; + case true: return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_ARRAY_SHADOW_AMD : GL_FLOAT16_SAMPLER_2D_SHADOW_AMD; + } + case true: return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_ARRAY_AMD : GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_AMD; + } + case Esd3D: + return GL_FLOAT16_SAMPLER_3D_AMD; + case EsdCube: + switch ((int)sampler.shadow) { + case false: return sampler.arrayed ? GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_AMD : GL_FLOAT16_SAMPLER_CUBE_AMD; + case true: return sampler.arrayed ? GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_SHADOW_AMD : GL_FLOAT16_SAMPLER_CUBE_SHADOW_AMD; + } + case EsdRect: + return sampler.shadow ? GL_FLOAT16_SAMPLER_2D_RECT_SHADOW_AMD : GL_FLOAT16_SAMPLER_2D_RECT_AMD; + case EsdBuffer: + return GL_FLOAT16_SAMPLER_BUFFER_AMD; + } +#endif case EbtInt: switch ((int)sampler.dim) { case Esd1D: @@ -477,6 +507,26 @@ case EsdBuffer: return GL_IMAGE_BUFFER; } +#ifdef AMD_EXTENSIONS + case EbtFloat16: + switch ((int)sampler.dim) { + case Esd1D: + return sampler.arrayed ? GL_FLOAT16_IMAGE_1D_ARRAY_AMD : GL_FLOAT16_IMAGE_1D_AMD; + case Esd2D: + switch ((int)sampler.ms) { + case false: return sampler.arrayed ? GL_FLOAT16_IMAGE_2D_ARRAY_AMD : GL_FLOAT16_IMAGE_2D_AMD; + case true: return sampler.arrayed ? GL_FLOAT16_IMAGE_2D_MULTISAMPLE_ARRAY_AMD : GL_FLOAT16_IMAGE_2D_MULTISAMPLE_AMD; + } + case Esd3D: + return GL_FLOAT16_IMAGE_3D_AMD; + case EsdCube: + return sampler.arrayed ? GL_FLOAT16_IMAGE_CUBE_MAP_ARRAY_AMD : GL_FLOAT16_IMAGE_CUBE_AMD; + case EsdRect: + return GL_FLOAT16_IMAGE_2D_RECT_AMD; + case EsdBuffer: + return GL_FLOAT16_IMAGE_BUFFER_AMD; + } +#endif case EbtInt: switch ((int)sampler.dim) { case Esd1D: @@ -716,11 +766,11 @@ } // build counter block index associations for buffers -void TReflection::buildCounterIndices() +void TReflection::buildCounterIndices(const TIntermediate& intermediate) { // search for ones that have counters for (int i = 0; i < int(indexToUniformBlock.size()); ++i) { - const TString counterName(indexToUniformBlock[i].name + "@count"); + const TString counterName(intermediate.addCounterBufferName(indexToUniformBlock[i].name)); const int index = getIndex(counterName); if (index >= 0) @@ -752,7 +802,7 @@ function->traverse(&it); } - buildCounterIndices(); + buildCounterIndices(intermediate); return true; } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/reflection.h vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/reflection.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/reflection.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/reflection.h 2018-04-27 11:46:26.000000000 +0000 @@ -156,7 +156,7 @@ protected: friend class glslang::TReflectionTraverser; - void buildCounterIndices(); + void buildCounterIndices(const TIntermediate&); void buildAttributeReflection(EShLanguage, const TIntermediate&); // Need a TString hash: typedef std::unordered_map TNameToIndex; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/Scan.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/Scan.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/Scan.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/Scan.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -45,6 +46,7 @@ #include "../Include/Types.h" #include "SymbolTable.h" #include "ParseHelper.h" +#include "attribute.h" #include "glslang_tab.cpp.h" #include "ScanContext.h" #include "Scan.h" @@ -339,6 +341,7 @@ (*KeywordMap)["const"] = CONST; (*KeywordMap)["uniform"] = UNIFORM; + (*KeywordMap)["nonuniformEXT"] = NONUNIFORM; (*KeywordMap)["in"] = IN; (*KeywordMap)["out"] = OUT; (*KeywordMap)["inout"] = INOUT; @@ -463,16 +466,34 @@ (*KeywordMap)["u64vec3"] = U64VEC3; (*KeywordMap)["u64vec4"] = U64VEC4; -#ifdef AMD_EXTENSIONS + // GL_KHX_shader_explicit_arithmetic_types + (*KeywordMap)["int8_t"] = INT8_T; + (*KeywordMap)["i8vec2"] = I8VEC2; + (*KeywordMap)["i8vec3"] = I8VEC3; + (*KeywordMap)["i8vec4"] = I8VEC4; + (*KeywordMap)["uint8_t"] = UINT8_T; + (*KeywordMap)["u8vec2"] = U8VEC2; + (*KeywordMap)["u8vec3"] = U8VEC3; + (*KeywordMap)["u8vec4"] = U8VEC4; + (*KeywordMap)["int16_t"] = INT16_T; - (*KeywordMap)["uint16_t"] = UINT16_T; (*KeywordMap)["i16vec2"] = I16VEC2; (*KeywordMap)["i16vec3"] = I16VEC3; (*KeywordMap)["i16vec4"] = I16VEC4; + (*KeywordMap)["uint16_t"] = UINT16_T; (*KeywordMap)["u16vec2"] = U16VEC2; (*KeywordMap)["u16vec3"] = U16VEC3; (*KeywordMap)["u16vec4"] = U16VEC4; + (*KeywordMap)["int32_t"] = INT32_T; + (*KeywordMap)["i32vec2"] = I32VEC2; + (*KeywordMap)["i32vec3"] = I32VEC3; + (*KeywordMap)["i32vec4"] = I32VEC4; + (*KeywordMap)["uint32_t"] = UINT32_T; + (*KeywordMap)["u32vec2"] = U32VEC2; + (*KeywordMap)["u32vec3"] = U32VEC3; + (*KeywordMap)["u32vec4"] = U32VEC4; + (*KeywordMap)["float16_t"] = FLOAT16_T; (*KeywordMap)["f16vec2"] = F16VEC2; (*KeywordMap)["f16vec3"] = F16VEC3; @@ -489,7 +510,39 @@ (*KeywordMap)["f16mat4x2"] = F16MAT4X2; (*KeywordMap)["f16mat4x3"] = F16MAT4X3; (*KeywordMap)["f16mat4x4"] = F16MAT4X4; -#endif + + (*KeywordMap)["float32_t"] = FLOAT32_T; + (*KeywordMap)["f32vec2"] = F32VEC2; + (*KeywordMap)["f32vec3"] = F32VEC3; + (*KeywordMap)["f32vec4"] = F32VEC4; + (*KeywordMap)["f32mat2"] = F32MAT2; + (*KeywordMap)["f32mat3"] = F32MAT3; + (*KeywordMap)["f32mat4"] = F32MAT4; + (*KeywordMap)["f32mat2x2"] = F32MAT2X2; + (*KeywordMap)["f32mat2x3"] = F32MAT2X3; + (*KeywordMap)["f32mat2x4"] = F32MAT2X4; + (*KeywordMap)["f32mat3x2"] = F32MAT3X2; + (*KeywordMap)["f32mat3x3"] = F32MAT3X3; + (*KeywordMap)["f32mat3x4"] = F32MAT3X4; + (*KeywordMap)["f32mat4x2"] = F32MAT4X2; + (*KeywordMap)["f32mat4x3"] = F32MAT4X3; + (*KeywordMap)["f32mat4x4"] = F32MAT4X4; + (*KeywordMap)["float64_t"] = FLOAT64_T; + (*KeywordMap)["f64vec2"] = F64VEC2; + (*KeywordMap)["f64vec3"] = F64VEC3; + (*KeywordMap)["f64vec4"] = F64VEC4; + (*KeywordMap)["f64mat2"] = F64MAT2; + (*KeywordMap)["f64mat3"] = F64MAT3; + (*KeywordMap)["f64mat4"] = F64MAT4; + (*KeywordMap)["f64mat2x2"] = F64MAT2X2; + (*KeywordMap)["f64mat2x3"] = F64MAT2X3; + (*KeywordMap)["f64mat2x4"] = F64MAT2X4; + (*KeywordMap)["f64mat3x2"] = F64MAT3X2; + (*KeywordMap)["f64mat3x3"] = F64MAT3X3; + (*KeywordMap)["f64mat3x4"] = F64MAT3X4; + (*KeywordMap)["f64mat4x2"] = F64MAT4X2; + (*KeywordMap)["f64mat4x3"] = F64MAT4X3; + (*KeywordMap)["f64mat4x4"] = F64MAT4X4; (*KeywordMap)["sampler2D"] = SAMPLER2D; (*KeywordMap)["samplerCube"] = SAMPLERCUBE; @@ -578,6 +631,54 @@ (*KeywordMap)["usubpassInput"] = USUBPASSINPUT; (*KeywordMap)["usubpassInputMS"] = USUBPASSINPUTMS; +#ifdef AMD_EXTENSIONS + (*KeywordMap)["f16sampler1D"] = F16SAMPLER1D; + (*KeywordMap)["f16sampler2D"] = F16SAMPLER2D; + (*KeywordMap)["f16sampler3D"] = F16SAMPLER3D; + (*KeywordMap)["f16sampler2DRect"] = F16SAMPLER2DRECT; + (*KeywordMap)["f16samplerCube"] = F16SAMPLERCUBE; + (*KeywordMap)["f16sampler1DArray"] = F16SAMPLER1DARRAY; + (*KeywordMap)["f16sampler2DArray"] = F16SAMPLER2DARRAY; + (*KeywordMap)["f16samplerCubeArray"] = F16SAMPLERCUBEARRAY; + (*KeywordMap)["f16samplerBuffer"] = F16SAMPLERBUFFER; + (*KeywordMap)["f16sampler2DMS"] = F16SAMPLER2DMS; + (*KeywordMap)["f16sampler2DMSArray"] = F16SAMPLER2DMSARRAY; + (*KeywordMap)["f16sampler1DShadow"] = F16SAMPLER1DSHADOW; + (*KeywordMap)["f16sampler2DShadow"] = F16SAMPLER2DSHADOW; + (*KeywordMap)["f16sampler2DRectShadow"] = F16SAMPLER2DRECTSHADOW; + (*KeywordMap)["f16samplerCubeShadow"] = F16SAMPLERCUBESHADOW; + (*KeywordMap)["f16sampler1DArrayShadow"] = F16SAMPLER1DARRAYSHADOW; + (*KeywordMap)["f16sampler2DArrayShadow"] = F16SAMPLER2DARRAYSHADOW; + (*KeywordMap)["f16samplerCubeArrayShadow"] = F16SAMPLERCUBEARRAYSHADOW; + + (*KeywordMap)["f16image1D"] = F16IMAGE1D; + (*KeywordMap)["f16image2D"] = F16IMAGE2D; + (*KeywordMap)["f16image3D"] = F16IMAGE3D; + (*KeywordMap)["f16image2DRect"] = F16IMAGE2DRECT; + (*KeywordMap)["f16imageCube"] = F16IMAGECUBE; + (*KeywordMap)["f16image1DArray"] = F16IMAGE1DARRAY; + (*KeywordMap)["f16image2DArray"] = F16IMAGE2DARRAY; + (*KeywordMap)["f16imageCubeArray"] = F16IMAGECUBEARRAY; + (*KeywordMap)["f16imageBuffer"] = F16IMAGEBUFFER; + (*KeywordMap)["f16image2DMS"] = F16IMAGE2DMS; + (*KeywordMap)["f16image2DMSArray"] = F16IMAGE2DMSARRAY; + + (*KeywordMap)["f16texture1D"] = F16TEXTURE1D; + (*KeywordMap)["f16texture2D"] = F16TEXTURE2D; + (*KeywordMap)["f16texture3D"] = F16TEXTURE3D; + (*KeywordMap)["f16texture2DRect"] = F16TEXTURE2DRECT; + (*KeywordMap)["f16textureCube"] = F16TEXTURECUBE; + (*KeywordMap)["f16texture1DArray"] = F16TEXTURE1DARRAY; + (*KeywordMap)["f16texture2DArray"] = F16TEXTURE2DARRAY; + (*KeywordMap)["f16textureCubeArray"] = F16TEXTURECUBEARRAY; + (*KeywordMap)["f16textureBuffer"] = F16TEXTUREBUFFER; + (*KeywordMap)["f16texture2DMS"] = F16TEXTURE2DMS; + (*KeywordMap)["f16texture2DMSArray"] = F16TEXTURE2DMSARRAY; + + (*KeywordMap)["f16subpassInput"] = F16SUBPASSINPUT; + (*KeywordMap)["f16subpassInputMS"] = F16SUBPASSINPUTMS; +#endif + (*KeywordMap)["noperspective"] = NOPERSPECTIVE; (*KeywordMap)["smooth"] = SMOOTH; (*KeywordMap)["flat"] = FLAT; @@ -714,19 +815,15 @@ parseContext.error(loc, "not supported", "::", ""); break; - case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT; - case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT; - case PpAtomConstInt64: parserToken->sType.lex.i64 = ppToken.i64val; return INT64CONSTANT; - case PpAtomConstUint64: parserToken->sType.lex.i64 = ppToken.i64val; return UINT64CONSTANT; -#ifdef AMD_EXTENSIONS - case PpAtomConstInt16: parserToken->sType.lex.i = ppToken.ival; return INT16CONSTANT; - case PpAtomConstUint16: parserToken->sType.lex.i = ppToken.ival; return UINT16CONSTANT; -#endif - case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT; - case PpAtomConstDouble: parserToken->sType.lex.d = ppToken.dval; return DOUBLECONSTANT; -#ifdef AMD_EXTENSIONS - case PpAtomConstFloat16: parserToken->sType.lex.d = ppToken.dval; return FLOAT16CONSTANT; -#endif + case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT; + case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT; + case PpAtomConstInt16: parserToken->sType.lex.i = ppToken.ival; return INT16CONSTANT; + case PpAtomConstUint16: parserToken->sType.lex.i = ppToken.ival; return UINT16CONSTANT; + case PpAtomConstInt64: parserToken->sType.lex.i64 = ppToken.i64val; return INT64CONSTANT; + case PpAtomConstUint64: parserToken->sType.lex.i64 = ppToken.i64val; return UINT64CONSTANT; + case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT; + case PpAtomConstDouble: parserToken->sType.lex.d = ppToken.dval; return DOUBLECONSTANT; + case PpAtomConstFloat16: parserToken->sType.lex.d = ppToken.dval; return FLOAT16CONSTANT; case PpAtomIdentifier: { int token = tokenizeIdentifier(); @@ -777,6 +874,12 @@ case CASE: return keyword; + case NONUNIFORM: + if (parseContext.extensionTurnedOn(E_GL_EXT_nonuniform_qualifier)) + return keyword; + else + return identifierOrType(); + case SWITCH: case DEFAULT: if ((parseContext.profile == EEsProfile && parseContext.version < 300) || @@ -841,7 +944,8 @@ case VOLATILE: if (parseContext.profile == EEsProfile && parseContext.version >= 310) return keyword; - if (! parseContext.symbolTable.atBuiltInLevel() && (parseContext.profile == EEsProfile || (parseContext.version < 420 && ! parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store)))) + if (! parseContext.symbolTable.atBuiltInLevel() && (parseContext.profile == EEsProfile || + (parseContext.version < 420 && ! parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store)))) reservedWord(); return keyword; @@ -865,7 +969,7 @@ case PATCH: if (parseContext.symbolTable.atBuiltInLevel() || (parseContext.profile == EEsProfile && - (parseContext.version >= 320 || + (parseContext.version >= 320 || parseContext.extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader))) || (parseContext.profile != EEsProfile && parseContext.extensionTurnedOn(E_GL_ARB_tessellation_shader))) return keyword; @@ -985,12 +1089,29 @@ case U64VEC4: afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - (parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_int64) && - parseContext.profile != EEsProfile && parseContext.version >= 450)) + (parseContext.profile != EEsProfile && parseContext.version >= 450 && + (parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_int64) || + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int64)))) + return keyword; + return identifierOrType(); + + case INT8_T: + case UINT8_T: + case I8VEC2: + case I8VEC3: + case I8VEC4: + case U8VEC2: + case U8VEC3: + case U8VEC4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + ((parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int8)) && + parseContext.profile != EEsProfile && parseContext.version >= 450)) return keyword; return identifierOrType(); -#ifdef AMD_EXTENSIONS case INT16_T: case UINT16_T: case I16VEC2: @@ -1001,10 +1122,77 @@ case U16VEC4: afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - (parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_int16) && + (parseContext.profile != EEsProfile && parseContext.version >= 450 && + ( +#ifdef AMD_EXTENSIONS + parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_int16) || +#endif + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int16)))) + return keyword; + return identifierOrType(); + case INT32_T: + case UINT32_T: + case I32VEC2: + case I32VEC3: + case I32VEC4: + case U32VEC2: + case U32VEC3: + case U32VEC4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + ((parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int32)) && parseContext.profile != EEsProfile && parseContext.version >= 450)) return keyword; return identifierOrType(); + case FLOAT32_T: + case F32VEC2: + case F32VEC3: + case F32VEC4: + case F32MAT2: + case F32MAT3: + case F32MAT4: + case F32MAT2X2: + case F32MAT2X3: + case F32MAT2X4: + case F32MAT3X2: + case F32MAT3X3: + case F32MAT3X4: + case F32MAT4X2: + case F32MAT4X3: + case F32MAT4X4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + ((parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float32)) && + parseContext.profile != EEsProfile && parseContext.version >= 450)) + return keyword; + return identifierOrType(); + + case FLOAT64_T: + case F64VEC2: + case F64VEC3: + case F64VEC4: + case F64MAT2: + case F64MAT3: + case F64MAT4: + case F64MAT2X2: + case F64MAT2X3: + case F64MAT2X4: + case F64MAT3X2: + case F64MAT3X3: + case F64MAT3X4: + case F64MAT4X2: + case F64MAT4X3: + case F64MAT4X4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + ((parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float64)) && + parseContext.profile != EEsProfile && parseContext.version >= 450)) + return keyword; + return identifierOrType(); case FLOAT16_T: case F16VEC2: @@ -1024,11 +1212,16 @@ case F16MAT4X4: afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - (parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float) && - parseContext.profile != EEsProfile && parseContext.version >= 450)) + (parseContext.profile != EEsProfile && parseContext.version >= 450 && + ( +#ifdef AMD_EXTENSIONS + parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float) || +#endif + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float16)))) return keyword; + return identifierOrType(); -#endif case SAMPLERCUBEARRAY: case SAMPLERCUBEARRAYSHADOW: @@ -1115,7 +1308,7 @@ case SAMPLER3D: afterType = true; if (parseContext.profile == EEsProfile && parseContext.version < 300) { - if (! parseContext.extensionTurnedOn(E_GL_OES_texture_3D)) + if (!parseContext.extensionTurnedOn(E_GL_OES_texture_3D)) reservedWord(); } return keyword; @@ -1193,7 +1386,7 @@ case TEXTURE1DARRAY: case SAMPLER: case SAMPLERSHADOW: - if (parseContext.spvVersion.vulkan >= 100) + if (parseContext.spvVersion.vulkan > 0) return keyword; else return identifierOrType(); @@ -1204,12 +1397,71 @@ case ISUBPASSINPUTMS: case USUBPASSINPUT: case USUBPASSINPUTMS: - if (parseContext.spvVersion.vulkan >= 100) + if (parseContext.spvVersion.vulkan > 0) return keyword; else return identifierOrType(); +#ifdef AMD_EXTENSIONS + case F16SAMPLER1D: + case F16SAMPLER2D: + case F16SAMPLER3D: + case F16SAMPLER2DRECT: + case F16SAMPLERCUBE: + case F16SAMPLER1DARRAY: + case F16SAMPLER2DARRAY: + case F16SAMPLERCUBEARRAY: + case F16SAMPLERBUFFER: + case F16SAMPLER2DMS: + case F16SAMPLER2DMSARRAY: + case F16SAMPLER1DSHADOW: + case F16SAMPLER2DSHADOW: + case F16SAMPLER1DARRAYSHADOW: + case F16SAMPLER2DARRAYSHADOW: + case F16SAMPLER2DRECTSHADOW: + case F16SAMPLERCUBESHADOW: + case F16SAMPLERCUBEARRAYSHADOW: + + case F16IMAGE1D: + case F16IMAGE2D: + case F16IMAGE3D: + case F16IMAGE2DRECT: + case F16IMAGECUBE: + case F16IMAGE1DARRAY: + case F16IMAGE2DARRAY: + case F16IMAGECUBEARRAY: + case F16IMAGEBUFFER: + case F16IMAGE2DMS: + case F16IMAGE2DMSARRAY: + + case F16TEXTURE1D: + case F16TEXTURE2D: + case F16TEXTURE3D: + case F16TEXTURE2DRECT: + case F16TEXTURECUBE: + case F16TEXTURE1DARRAY: + case F16TEXTURE2DARRAY: + case F16TEXTURECUBEARRAY: + case F16TEXTUREBUFFER: + case F16TEXTURE2DMS: + case F16TEXTURE2DMSARRAY: + + case F16SUBPASSINPUT: + case F16SUBPASSINPUTMS: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + (parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float_fetch) && + parseContext.profile != EEsProfile && parseContext.version >= 450)) + return keyword; + return identifierOrType(); +#endif + case NOPERSPECTIVE: +#ifdef NV_EXTENSIONS + if (parseContext.profile == EEsProfile && parseContext.version >= 300 && + parseContext.extensionTurnedOn(E_GL_NV_shader_noperspective_interpolation)) + return keyword; +#endif return es30ReservedFromGLSL(130); case SMOOTH: @@ -1403,7 +1655,8 @@ int TScanContext::firstGenerationImage(bool inEs310) { if (parseContext.symbolTable.atBuiltInLevel() || - (parseContext.profile != EEsProfile && (parseContext.version >= 420 || parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store))) || + (parseContext.profile != EEsProfile && (parseContext.version >= 420 || + parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store))) || (inEs310 && parseContext.profile == EEsProfile && parseContext.version >= 310)) return keyword; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/ShaderLang.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/ShaderLang.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/ShaderLang.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/ShaderLang.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -69,6 +69,10 @@ namespace { // anonymous namespace for file-local functions and symbols +// Total number of successful initializers of glslang: a refcount +// Shared global; access should be protected by a global mutex/critical section. +int NumberOfClients = 0; + using namespace glslang; // Create a language specific version of parseables. @@ -217,7 +221,7 @@ TSymbolTable* CommonSymbolTable[VersionCount][SpvVersionCount][ProfileCount][SourceCount][EPcCount] = {}; TSymbolTable* SharedSymbolTables[VersionCount][SpvVersionCount][ProfileCount][SourceCount][EShLangCount] = {}; -TPoolAllocator* PerProcessGPA = 0; +TPoolAllocator* PerProcessGPA = nullptr; // // Parse and add to the given symbol table the content of the given shader string. @@ -361,7 +365,7 @@ // pool allocator intact, so: // - Switch to a new pool for parsing the built-ins // - Do the parsing, which builds the symbol table, using the new pool -// - Switch to the process-global pool to save a copy the resulting symbol table +// - Switch to the process-global pool to save a copy of the resulting symbol table // - Free up the new pool used to parse the built-ins // - Switch back to the original thread's pool // @@ -388,8 +392,8 @@ // Switch to a new pool TPoolAllocator& previousAllocator = GetThreadPoolAllocator(); - TPoolAllocator* builtInPoolAllocator = new TPoolAllocator(); - SetThreadPoolAllocator(*builtInPoolAllocator); + TPoolAllocator* builtInPoolAllocator = new TPoolAllocator; + SetThreadPoolAllocator(builtInPoolAllocator); // Dynamically allocate the local symbol tables so we can control when they are deallocated WRT when the pool is popped. TSymbolTable* commonTable[EPcCount]; @@ -403,7 +407,7 @@ InitializeSymbolTables(infoSink, commonTable, stageTables, version, profile, spvVersion, source); // Switch to the process-global pool - SetThreadPoolAllocator(*PerProcessGPA); + SetThreadPoolAllocator(PerProcessGPA); // Copy the local symbol tables from the new pool to the global tables using the process-global pool for (int precClass = 0; precClass < EPcCount; ++precClass) { @@ -430,7 +434,7 @@ delete stageTables[stage]; delete builtInPoolAllocator; - SetThreadPoolAllocator(previousAllocator); + SetThreadPoolAllocator(&previousAllocator); glslang::ReleaseGlobalLock(); } @@ -574,7 +578,7 @@ if (spvVersion.spv != 0) { switch (profile) { case EEsProfile: - if (spvVersion.vulkan >= 100 && version < 310) { + if (spvVersion.vulkan > 0 && version < 310) { correct = false; infoSink.info.message(EPrefixError, "#version: ES shaders for Vulkan SPIR-V require version 310 or higher"); version = 310; @@ -589,7 +593,7 @@ infoSink.info.message(EPrefixError, "#version: compilation for SPIR-V does not support the compatibility profile"); break; default: - if (spvVersion.vulkan >= 100 && version < 140) { + if (spvVersion.vulkan > 0 && version < 140) { correct = false; infoSink.info.message(EPrefixError, "#version: Desktop shaders for Vulkan SPIR-V require version 140 or higher"); version = 140; @@ -615,9 +619,9 @@ { // Set up environmental defaults, first ignoring 'environment'. if (messages & EShMsgSpvRules) - spvVersion.spv = 0x00010000; + spvVersion.spv = EShTargetSpv_1_0; if (messages & EShMsgVulkanRules) { - spvVersion.vulkan = 100; + spvVersion.vulkan = EShTargetVulkan_1_0; spvVersion.vulkanGlsl = 100; } else if (spvVersion.spv != 0) spvVersion.openGl = 100; @@ -722,9 +726,6 @@ const std::string sourceEntryPointName = "", const TEnvironment* environment = nullptr) // optional way of fully setting all versions, overriding the above { - if (! InitThread()) - return false; - // This must be undone (.pop()) by the caller, after it finishes consuming the created tree. GetThreadPoolAllocator().push(); @@ -743,9 +744,9 @@ const int numPre = 2; const int numPost = requireNonempty? 1 : 0; const int numTotal = numPre + numStrings + numPost; - size_t* lengths = new size_t[numTotal]; - const char** strings = new const char*[numTotal]; - const char** names = new const char*[numTotal]; + std::unique_ptr lengths(new size_t[numTotal]); + std::unique_ptr strings(new const char*[numTotal]); + std::unique_ptr names(new const char*[numTotal]); for (int s = 0; s < numStrings; ++s) { strings[s + numPre] = shaderStrings[s]; if (inputLengths == nullptr || inputLengths[s] < 0) @@ -767,6 +768,8 @@ SpvVersion spvVersion; EShLanguage stage = compiler->getLanguage(); TranslateEnvironment(environment, messages, source, stage, spvVersion); + if (environment != nullptr && environment->target.hlslFunctionality1) + intermediate.setHlslFunctionality1(); // First, without using the preprocessor or parser, find the #version, so we know what // symbol tables, processing rules, etc. to set up. This does not need the extra strings @@ -813,7 +816,7 @@ intermediate.setProfile(profile); intermediate.setSpv(spvVersion); RecordProcesses(intermediate, messages, sourceEntryPointName); - if (spvVersion.vulkan >= 100) + if (spvVersion.vulkan > 0) intermediate.setOriginUpperLeft(); if ((messages & EShMsgHlslOffsets) || source == EShSourceHlsl) intermediate.setHlslOffsets(); @@ -831,25 +834,24 @@ [stage]; // Dynamically allocate the symbol table so we can control when it is deallocated WRT the pool. - TSymbolTable* symbolTableMemory = new TSymbolTable; - TSymbolTable& symbolTable = *symbolTableMemory; + std::unique_ptr symbolTable(new TSymbolTable); if (cachedTable) - symbolTable.adoptLevels(*cachedTable); + symbolTable->adoptLevels(*cachedTable); // Add built-in symbols that are potentially context dependent; // they get popped again further down. - if (! AddContextSpecificSymbols(resources, compiler->infoSink, symbolTable, version, profile, spvVersion, - stage, source)) + if (! AddContextSpecificSymbols(resources, compiler->infoSink, *symbolTable, version, profile, spvVersion, + stage, source)) { return false; + } // // Now we can process the full shader under proper symbols and rules. // - TParseContextBase* parseContext = CreateParseContext(symbolTable, intermediate, version, profile, source, - stage, compiler->infoSink, - spvVersion, forwardCompatible, messages, false, sourceEntryPointName); - + std::unique_ptr parseContext(CreateParseContext(*symbolTable, intermediate, version, profile, source, + stage, compiler->infoSink, + spvVersion, forwardCompatible, messages, false, sourceEntryPointName)); TPpContext ppContext(*parseContext, names[numPre] ? names[numPre] : "", includer); // only GLSL (bison triggered, really) needs an externally set scan context @@ -885,23 +887,14 @@ lengths[postIndex] = strlen(strings[numStrings + numPre]); names[postIndex] = nullptr; } - TInputScanner fullInput(numStrings + numPre + numPost, strings, lengths, names, numPre, numPost); + TInputScanner fullInput(numStrings + numPre + numPost, strings.get(), lengths.get(), names.get(), numPre, numPost); // Push a new symbol allocation scope that will get used for the shader's globals. - symbolTable.push(); + symbolTable->push(); bool success = processingContext(*parseContext, ppContext, fullInput, - versionWillBeError, symbolTable, + versionWillBeError, *symbolTable, intermediate, optLevel, messages); - - // Clean up the symbol table. The AST is self-sufficient now. - delete symbolTableMemory; - - delete parseContext; - delete [] lengths; - delete [] strings; - delete [] names; - return success; } @@ -911,7 +904,7 @@ class SourceLineSynchronizer { public: SourceLineSynchronizer(const std::function& lastSourceIndex, - std::stringstream* output) + std::string* output) : getLastSourceIndex(lastSourceIndex), output(output), lastSource(-1), lastLine(0) {} // SourceLineSynchronizer(const SourceLineSynchronizer&) = delete; // SourceLineSynchronizer& operator=(const SourceLineSynchronizer&) = delete; @@ -926,7 +919,7 @@ // used. We also need to output a newline to separate the output // from the previous source string (if there is one). if (lastSource != -1 || lastLine != 0) - *output << std::endl; + *output += '\n'; lastSource = getLastSourceIndex(); lastLine = -1; return true; @@ -941,7 +934,7 @@ syncToMostRecentString(); const bool newLineStarted = lastLine < tokenLine; for (; lastLine < tokenLine; ++lastLine) { - if (lastLine > 0) *output << std::endl; + if (lastLine > 0) *output += '\n'; } return newLineStarted; } @@ -955,8 +948,8 @@ // A function for getting the index of the last valid source string we've // read tokens from. const std::function getLastSourceIndex; - // output stream for newlines. - std::stringstream* output; + // output string for newlines. + std::string* output; // lastSource is the source string index (starting from 0) of the last token // processed. It is tracked in order for newlines to be inserted when a new // source string starts. -1 means we haven't started processing any source @@ -987,27 +980,33 @@ parseContext.setScanner(&input); ppContext.setInput(input, versionWillBeError); - std::stringstream outputStream; + std::string outputBuffer; SourceLineSynchronizer lineSync( - std::bind(&TInputScanner::getLastValidSourceIndex, &input), &outputStream); + std::bind(&TInputScanner::getLastValidSourceIndex, &input), &outputBuffer); - parseContext.setExtensionCallback([&lineSync, &outputStream]( + parseContext.setExtensionCallback([&lineSync, &outputBuffer]( int line, const char* extension, const char* behavior) { lineSync.syncToLine(line); - outputStream << "#extension " << extension << " : " << behavior; + outputBuffer += "#extension "; + outputBuffer += extension; + outputBuffer += " : "; + outputBuffer += behavior; }); - parseContext.setLineCallback([&lineSync, &outputStream, &parseContext]( + parseContext.setLineCallback([&lineSync, &outputBuffer, &parseContext]( int curLineNum, int newLineNum, bool hasSource, int sourceNum, const char* sourceName) { // SourceNum is the number of the source-string that is being parsed. lineSync.syncToLine(curLineNum); - outputStream << "#line " << newLineNum; + outputBuffer += "#line "; + outputBuffer += std::to_string(newLineNum); if (hasSource) { - outputStream << " "; + outputBuffer += ' '; if (sourceName != nullptr) { - outputStream << "\"" << sourceName << "\""; + outputBuffer += '\"'; + outputBuffer += sourceName; + outputBuffer += '\"'; } else { - outputStream << sourceNum; + outputBuffer += std::to_string(sourceNum); } } if (parseContext.lineDirectiveShouldSetNextLine()) { @@ -1015,33 +1014,36 @@ // directive. So the new line number for the current line is newLineNum -= 1; } - outputStream << std::endl; + outputBuffer += '\n'; // And we are at the next line of the #line directive now. lineSync.setLineNum(newLineNum + 1); }); parseContext.setVersionCallback( - [&lineSync, &outputStream](int line, int version, const char* str) { + [&lineSync, &outputBuffer](int line, int version, const char* str) { lineSync.syncToLine(line); - outputStream << "#version " << version; + outputBuffer += "#version "; + outputBuffer += std::to_string(version); if (str) { - outputStream << " " << str; + outputBuffer += ' '; + outputBuffer += str; } }); - parseContext.setPragmaCallback([&lineSync, &outputStream]( + parseContext.setPragmaCallback([&lineSync, &outputBuffer]( int line, const glslang::TVector& ops) { lineSync.syncToLine(line); - outputStream << "#pragma "; + outputBuffer += "#pragma "; for(size_t i = 0; i < ops.size(); ++i) { - outputStream << ops[i]; + outputBuffer += ops[i].c_str(); } }); - parseContext.setErrorCallback([&lineSync, &outputStream]( + parseContext.setErrorCallback([&lineSync, &outputBuffer]( int line, const char* errorMessage) { lineSync.syncToLine(line); - outputStream << "#error " << errorMessage; + outputBuffer += "#error "; + outputBuffer += errorMessage; }); int lastToken = EndOfInput; // lastToken records the last token processed. @@ -1057,7 +1059,7 @@ // Don't emit whitespace onto empty lines. // Copy any whitespace characters at the start of a line // from the input to the output. - outputStream << std::string(ppToken.loc.column - 1, ' '); + outputBuffer += std::string(ppToken.loc.column - 1, ' '); } // Output a space in between tokens, but not at the start of a line, @@ -1067,13 +1069,13 @@ (unNeededSpaceTokens.find((char)token) == std::string::npos) && (unNeededSpaceTokens.find((char)lastToken) == std::string::npos) && (noSpaceBeforeTokens.find((char)token) == std::string::npos)) { - outputStream << " "; + outputBuffer += ' '; } lastToken = token; - outputStream << ppToken.name; + outputBuffer += ppToken.name; } while (true); - outputStream << std::endl; - *outputString = outputStream.str(); + outputBuffer += '\n'; + *outputString = std::move(outputBuffer); bool success = true; if (parseContext.getNumErrors() > 0) { @@ -1196,7 +1198,11 @@ if (! InitProcess()) return 0; - if (! PerProcessGPA) + glslang::GetGlobalLock(); + ++NumberOfClients; + glslang::ReleaseGlobalLock(); + + if (PerProcessGPA == nullptr) PerProcessGPA = new TPoolAllocator(); glslang::TScanContext::fillInKeywordMap(); @@ -1262,6 +1268,14 @@ // int __fastcall ShFinalize() { + glslang::GetGlobalLock(); + --NumberOfClients; + assert(NumberOfClients >= 0); + bool finalize = NumberOfClients == 0; + glslang::ReleaseGlobalLock(); + if (! finalize) + return 1; + for (int version = 0; version < VersionCount; ++version) { for (int spvVersion = 0; spvVersion < SpvVersionCount; ++spvVersion) { for (int p = 0; p < ProfileCount; ++p) { @@ -1288,10 +1302,9 @@ } } - if (PerProcessGPA) { - PerProcessGPA->popAll(); + if (PerProcessGPA != nullptr) { delete PerProcessGPA; - PerProcessGPA = 0; + PerProcessGPA = nullptr; } glslang::TScanContext::deleteKeywordMap(); @@ -1332,6 +1345,8 @@ if (compiler == 0) return 0; + SetThreadPoolAllocator(compiler->getPool()); + compiler->infoSink.info.erase(); compiler->infoSink.debug.erase(); @@ -1389,6 +1404,8 @@ TShHandleBase* base = reinterpret_cast(linkHandle); TLinker* linker = static_cast(base->getAsLinker()); + SetThreadPoolAllocator(linker->getPool()); + if (linker == 0) return 0; @@ -1423,9 +1440,6 @@ // const char* ShGetInfoLog(const ShHandle handle) { - if (!InitThread()) - return 0; - if (handle == 0) return 0; @@ -1449,9 +1463,6 @@ // const void* ShGetExecutable(const ShHandle handle) { - if (!InitThread()) - return 0; - if (handle == 0) return 0; @@ -1474,9 +1485,6 @@ // int ShSetVirtualAttributeBindings(const ShHandle handle, const ShBindingTable* table) { - if (!InitThread()) - return 0; - if (handle == 0) return 0; @@ -1496,9 +1504,6 @@ // int ShSetFixedAttributeBindings(const ShHandle handle, const ShBindingTable* table) { - if (!InitThread()) - return 0; - if (handle == 0) return 0; @@ -1517,9 +1522,6 @@ // int ShExcludeAttributes(const ShHandle handle, int *attributes, int count) { - if (!InitThread()) - return 0; - if (handle == 0) return 0; @@ -1541,9 +1543,6 @@ // int ShGetUniformLocation(const ShHandle handle, const char* name) { - if (!InitThread()) - return 0; - if (handle == 0) return -1; @@ -1570,14 +1569,17 @@ #include "../Include/revision.h" +#define QUOTE(s) #s +#define STR(n) QUOTE(n) + const char* GetEsslVersionString() { - return "OpenGL ES GLSL 3.00 glslang LunarG Khronos." GLSLANG_REVISION " " GLSLANG_DATE; + return "OpenGL ES GLSL 3.20 glslang Khronos. " STR(GLSLANG_MINOR_VERSION) "." STR(GLSLANG_PATCH_LEVEL); } const char* GetGlslVersionString() { - return "4.20 glslang LunarG Khronos." GLSLANG_REVISION " " GLSLANG_DATE; + return "4.60 glslang Khronos. " STR(GLSLANG_MINOR_VERSION) "." STR(GLSLANG_PATCH_LEVEL); } int GetKhronosToolId() @@ -1602,8 +1604,9 @@ }; TShader::TShader(EShLanguage s) - : pool(0), stage(s), lengths(nullptr), stringNames(nullptr), preamble("") + : stage(s), lengths(nullptr), stringNames(nullptr), preamble("") { + pool = new TPoolAllocator; infoSink = new TInfoSink; compiler = new TDeferredCompiler(stage, *infoSink); intermediate = new TIntermediate(s); @@ -1613,6 +1616,7 @@ environment.input.dialect = EShClientNone; environment.client.client = EShClientNone; environment.target.language = EShTargetNone; + environment.target.hlslFunctionality1 = false; } TShader::~TShader() @@ -1667,8 +1671,8 @@ } // Set binding base for given resource type for a given binding set. -void TShader::setShiftBindingForSet(TResourceType res, unsigned int set, unsigned int base) { - intermediate->setShiftBindingForSet(res, set, base); +void TShader::setShiftBindingForSet(TResourceType res, unsigned int base, unsigned int set) { + intermediate->setShiftBindingForSet(res, base, set); } // Set binding base for sampler types @@ -1687,6 +1691,8 @@ void TShader::setShiftSsboBinding(unsigned int base) { setShiftBinding(EResSsbo, base); } // Enables binding automapping using TIoMapper void TShader::setAutoMapBindings(bool map) { intermediate->setAutoMapBindings(map); } +// Enables position.Y output negation in vertex shader +void TShader::setInvertY(bool invert) { intermediate->setInvertY(invert); } // Fragile: currently within one stage: simple auto-assignment of location void TShader::setAutoMapLocations(bool map) { intermediate->setAutoMapLocations(map); } // See comment above TDefaultHlslIoMapper in iomapper.cpp: @@ -1706,9 +1712,8 @@ { if (! InitThread()) return false; + SetThreadPoolAllocator(pool); - pool = new TPoolAllocator(); - SetThreadPoolAllocator(*pool); if (! preamble) preamble = ""; @@ -1730,9 +1735,8 @@ { if (! InitThread()) return false; + SetThreadPoolAllocator(pool); - pool = new TPoolAllocator(); - SetThreadPoolAllocator(*pool); if (! preamble) preamble = ""; @@ -1752,8 +1756,9 @@ return infoSink->debug.c_str(); } -TProgram::TProgram() : pool(0), reflection(0), ioMapper(nullptr), linked(false) +TProgram::TProgram() : reflection(0), ioMapper(nullptr), linked(false) { + pool = new TPoolAllocator; infoSink = new TInfoSink; for (int s = 0; s < EShLangCount; ++s) { intermediate[s] = 0; @@ -1788,8 +1793,7 @@ bool error = false; - pool = new TPoolAllocator(); - SetThreadPoolAllocator(*pool); + SetThreadPoolAllocator(pool); for (int s = 0; s < EShLangCount; ++s) { if (! linkStage((EShLanguage)s, messages)) @@ -1906,6 +1910,7 @@ int TProgram::getUniformBlockSize(int index) const { return reflection->getUniformBlock(index).size; } int TProgram::getUniformIndex(const char* name) const { return reflection->getIndex(name); } int TProgram::getUniformBinding(int index) const { return reflection->getUniform(index).getBinding(); } +int TProgram::getUniformBlockBinding(int index) const { return reflection->getUniformBlock(index).getBinding(); } int TProgram::getUniformBlockIndex(int index) const { return reflection->getUniform(index).index; } int TProgram::getUniformBlockCounterIndex(int index) const { return reflection->getUniformBlock(index).counterIndex; } int TProgram::getUniformType(int index) const { return reflection->getUniform(index).glDefineType; } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/SymbolTable.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/SymbolTable.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/SymbolTable.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/SymbolTable.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -60,21 +61,22 @@ switch (basicType) { case EbtFloat: mangledName += 'f'; break; case EbtDouble: mangledName += 'd'; break; -#ifdef AMD_EXTENSIONS case EbtFloat16: mangledName += "f16"; break; -#endif case EbtInt: mangledName += 'i'; break; case EbtUint: mangledName += 'u'; break; - case EbtInt64: mangledName += "i64"; break; - case EbtUint64: mangledName += "u64"; break; -#ifdef AMD_EXTENSIONS + case EbtInt8: mangledName += "i8"; break; + case EbtUint8: mangledName += "u8"; break; case EbtInt16: mangledName += "i16"; break; case EbtUint16: mangledName += "u16"; break; -#endif + case EbtInt64: mangledName += "i64"; break; + case EbtUint64: mangledName += "u64"; break; case EbtBool: mangledName += 'b'; break; case EbtAtomicUint: mangledName += "au"; break; case EbtSampler: switch (sampler.type) { +#ifdef AMD_EXTENSIONS + case EbtFloat16: mangledName += "f16"; break; +#endif case EbtInt: mangledName += "i"; break; case EbtUint: mangledName += "u"; break; default: break; // some compilers want this diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/Versions.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/Versions.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/Versions.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/Versions.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -185,9 +186,20 @@ extensionBehavior[E_GL_ARB_post_depth_coverage] = EBhDisable; extensionBehavior[E_GL_ARB_shader_viewport_layer_array] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_basic] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_vote] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_arithmetic] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_ballot] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_shuffle] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_shuffle_relative] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_clustered] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_quad] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_non_constant_global_initializers] = EBhDisable; extensionBehavior[E_GL_EXT_shader_image_load_formatted] = EBhDisable; extensionBehavior[E_GL_EXT_post_depth_coverage] = EBhDisable; + extensionBehavior[E_GL_EXT_control_flow_attributes] = EBhDisable; + extensionBehavior[E_GL_EXT_nonuniform_qualifier] = EBhDisable; // #line and #include extensionBehavior[E_GL_GOOGLE_cpp_style_line_directive] = EBhDisable; @@ -203,6 +215,7 @@ extensionBehavior[E_GL_AMD_gpu_shader_int16] = EBhDisable; extensionBehavior[E_GL_AMD_shader_image_load_store_lod] = EBhDisable; extensionBehavior[E_GL_AMD_shader_fragment_mask] = EBhDisable; + extensionBehavior[E_GL_AMD_gpu_shader_half_float_fetch] = EBhDisable; #endif #ifdef NV_EXTENSIONS @@ -212,6 +225,9 @@ extensionBehavior[E_GL_NV_stereo_view_rendering] = EBhDisable; extensionBehavior[E_GL_NVX_multiview_per_view_attributes] = EBhDisable; extensionBehavior[E_GL_NV_shader_atomic_int64] = EBhDisable; + extensionBehavior[E_GL_NV_conservative_raster_underestimation] = EBhDisable; + extensionBehavior[E_GL_NV_shader_noperspective_interpolation] = EBhDisable; + extensionBehavior[E_GL_NV_shader_subgroup_partitioned] = EBhDisable; #endif // AEP @@ -249,6 +265,16 @@ // OVR extensions extensionBehavior[E_GL_OVR_multiview] = EBhDisable; extensionBehavior[E_GL_OVR_multiview2] = EBhDisable; + + // explicit types + extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types] = EBhDisable; + extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_int8] = EBhDisable; + extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_int16] = EBhDisable; + extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_int32] = EBhDisable; + extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_int64] = EBhDisable; + extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_float16] = EBhDisable; + extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_float32] = EBhDisable; + extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_float64] = EBhDisable; } // Get code that is not part of a shared symbol table, is specific to this shader, @@ -296,6 +322,13 @@ "#define GL_OES_texture_cube_map_array 1\n" "#define GL_EXT_shader_non_constant_global_initializers 1\n" ; + +#ifdef NV_EXTENSIONS + if (profile == EEsProfile && version >= 300) { + preamble += "#define GL_NV_shader_noperspective_interpolation 1\n"; + } +#endif + } else { preamble = "#define GL_FRAGMENT_PRECISION_HIGH 1\n" @@ -327,6 +360,18 @@ "#define GL_EXT_shader_non_constant_global_initializers 1\n" "#define GL_EXT_shader_image_load_formatted 1\n" "#define GL_EXT_post_depth_coverage 1\n" + "#define GL_EXT_control_flow_attributes 1\n" + "#define GL_EXT_nonuniform_qualifier 1\n" + + // GL_KHR_shader_subgroup + "#define GL_KHR_shader_subgroup_basic 1\n" + "#define GL_KHR_shader_subgroup_vote 1\n" + "#define GL_KHR_shader_subgroup_arithmetic 1\n" + "#define GL_KHR_shader_subgroup_ballot 1\n" + "#define GL_KHR_shader_subgroup_shuffle 1\n" + "#define GL_KHR_shader_subgroup_shuffle_relative 1\n" + "#define GL_KHR_shader_subgroup_clustered 1\n" + "#define GL_KHR_shader_subgroup_quad 1\n" #ifdef AMD_EXTENSIONS "#define GL_AMD_shader_ballot 1\n" @@ -338,6 +383,7 @@ "#define GL_AMD_gpu_shader_int16 1\n" "#define GL_AMD_shader_image_load_store_lod 1\n" "#define GL_AMD_shader_fragment_mask 1\n" + "#define GL_AMD_gpu_shader_half_float_fetch 1\n" #endif #ifdef NV_EXTENSIONS @@ -345,7 +391,17 @@ "#define GL_NV_geometry_shader_passthrough 1\n" "#define GL_NV_viewport_array2 1\n" "#define GL_NV_shader_atomic_int64 1\n" + "#define GL_NV_conservative_raster_underestimation 1\n" + "#define GL_NV_shader_subgroup_partitioned 1\n" #endif + "#define GL_KHX_shader_explicit_arithmetic_types 1\n" + "#define GL_KHX_shader_explicit_arithmetic_types_int8 1\n" + "#define GL_KHX_shader_explicit_arithmetic_types_int16 1\n" + "#define GL_KHX_shader_explicit_arithmetic_types_int32 1\n" + "#define GL_KHX_shader_explicit_arithmetic_types_int64 1\n" + "#define GL_KHX_shader_explicit_arithmetic_types_float16 1\n" + "#define GL_KHX_shader_explicit_arithmetic_types_float32 1\n" + "#define GL_KHX_shader_explicit_arithmetic_types_float64 1\n" ; if (version >= 150) { @@ -568,7 +624,8 @@ // void TParseVersions::requireExtensions(const TSourceLoc& loc, int numExtensions, const char* const extensions[], const char* featureDesc) { - if (checkExtensionsRequested(loc, numExtensions, extensions, featureDesc)) return; + if (checkExtensionsRequested(loc, numExtensions, extensions, featureDesc)) + return; // If we get this far, give errors explaining what extensions are needed if (numExtensions == 1) @@ -586,7 +643,8 @@ // void TParseVersions::ppRequireExtensions(const TSourceLoc& loc, int numExtensions, const char* const extensions[], const char* featureDesc) { - if (checkExtensionsRequested(loc, numExtensions, extensions, featureDesc)) return; + if (checkExtensionsRequested(loc, numExtensions, extensions, featureDesc)) + return; // If we get this far, give errors explaining what extensions are needed if (numExtensions == 1) @@ -624,7 +682,8 @@ bool TParseVersions::extensionsTurnedOn(int numExtensions, const char* const extensions[]) { for (int i = 0; i < numExtensions; ++i) { - if (extensionTurnedOn(extensions[i])) return true; + if (extensionTurnedOn(extensions[i])) + return true; } return false; } @@ -680,6 +739,25 @@ updateExtensionBehavior(line, "GL_OES_shader_io_blocks", behaviorString); else if (strcmp(extension, "GL_GOOGLE_include_directive") == 0) updateExtensionBehavior(line, "GL_GOOGLE_cpp_style_line_directive", behaviorString); + // subgroup_* to subgroup_basic + else if (strcmp(extension, "GL_KHR_shader_subgroup_vote") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_KHR_shader_subgroup_arithmetic") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_KHR_shader_subgroup_ballot") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_KHR_shader_subgroup_shuffle") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_KHR_shader_subgroup_shuffle_relative") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_KHR_shader_subgroup_clustered") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_KHR_shader_subgroup_quad") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); +#ifdef NV_EXTENSIONS + else if (strcmp(extension, "GL_NV_shader_subgroup_partitioned") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); +#endif } void TParseVersions::updateExtensionBehavior(const char* extension, TExtensionBehavior behavior) @@ -737,23 +815,71 @@ profileRequires(loc, ECompatibilityProfile, 400, nullptr, op); } -#ifdef AMD_EXTENSIONS -// Call for any operation needing GLSL 16-bit integer data-type support. -void TParseVersions::int16Check(const TSourceLoc& loc, const char* op, bool builtIn) +// Call for any operation needing GLSL float16 data-type support. +void TParseVersions::float16Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { +#if AMD_EXTENSIONS + const char* const extensions[3] = {E_GL_AMD_gpu_shader_half_float, + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_float16}; + +#else + const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_float16}; +#endif + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, "explicit types"); + requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); + profileRequires(loc, ECoreProfile, 450, nullptr, op); + profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + } +} + +// Call for any operation needing GLSL float32 data-type support. +void TParseVersions::explicitFloat32Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_float32}; + requireExtensions(loc, 2, extensions, "explicit types"); + requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); + profileRequires(loc, ECoreProfile, 450, nullptr, op); + profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + } +} + +// Call for any operation needing GLSL float64 data-type support. +void TParseVersions::explicitFloat64Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_float64}; + requireExtensions(loc, 2, extensions, "explicit types"); + requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); + profileRequires(loc, ECoreProfile, 450, nullptr, op); + profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + } +} + +// Call for any operation needing GLSL explicit int8 data-type support. +void TParseVersions::explicitInt8Check(const TSourceLoc& loc, const char* op, bool builtIn) { if (! builtIn) { - requireExtensions(loc, 1, &E_GL_AMD_gpu_shader_int16, "shader int16"); + const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int8}; + requireExtensions(loc, 2, extensions, "explicit types"); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); profileRequires(loc, ECoreProfile, 450, nullptr, op); profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); } } -// Call for any operation needing GLSL float16 data-type support. -void TParseVersions::float16Check(const TSourceLoc& loc, const char* op, bool builtIn) +#ifdef AMD_EXTENSIONS +// Call for any operation needing GLSL float16 opaque-type support +void TParseVersions::float16OpaqueCheck(const TSourceLoc& loc, const char* op, bool builtIn) { if (! builtIn) { - requireExtensions(loc, 1, &E_GL_AMD_gpu_shader_half_float, "shader half float"); + requireExtensions(loc, 1, &E_GL_AMD_gpu_shader_half_float_fetch, op); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); profileRequires(loc, ECoreProfile, 450, nullptr, op); profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); @@ -761,11 +887,46 @@ } #endif +// Call for any operation needing GLSL explicit int16 data-type support. +void TParseVersions::explicitInt16Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (! builtIn) { +#if AMD_EXTENSIONS + const char* const extensions[3] = {E_GL_AMD_gpu_shader_int16, + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int16}; +#else + const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int16}; +#endif + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, "explicit types"); + requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); + profileRequires(loc, ECoreProfile, 450, nullptr, op); + profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + } +} + +// Call for any operation needing GLSL explicit int32 data-type support. +void TParseVersions::explicitInt32Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (! builtIn) { + const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int32}; + requireExtensions(loc, 2, extensions, "explicit types"); + requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); + profileRequires(loc, ECoreProfile, 450, nullptr, op); + profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + } +} + // Call for any operation needing GLSL 64-bit integer data-type support. void TParseVersions::int64Check(const TSourceLoc& loc, const char* op, bool builtIn) { if (! builtIn) { - requireExtensions(loc, 1, &E_GL_ARB_gpu_shader_int64, "shader int64"); + const char* const extensions[3] = {E_GL_ARB_gpu_shader_int64, + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int64}; + requireExtensions(loc, 3, extensions, "shader int64"); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); profileRequires(loc, ECoreProfile, 450, nullptr, op); profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); @@ -782,7 +943,7 @@ // Call for any operation removed because Vulkan SPIR-V is being generated. void TParseVersions::vulkanRemoved(const TSourceLoc& loc, const char* op) { - if (spvVersion.vulkan >= 100) + if (spvVersion.vulkan > 0) error(loc, "not allowed when using GLSL for Vulkan", op, ""); } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/Versions.h vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/Versions.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/MachineIndependent/Versions.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/MachineIndependent/Versions.h 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -83,7 +84,7 @@ SpvVersion() : spv(0), vulkanGlsl(0), vulkan(0), openGl(0) {} unsigned int spv; // the version of SPIR-V to target, as defined by "word 1" of the SPIR-V binary header int vulkanGlsl; // the version of GLSL semantics for Vulkan, from GL_KHR_vulkan_glsl, for "#define VULKAN XXX" - int vulkan; // the version of Vulkan, for which SPIR-V execution environment rules to use (100 means 1.0) + int vulkan; // the version of Vulkan, for which SPIR-V execution environment rules to use int openGl; // the version of GLSL semantics for OpenGL, from GL_ARB_gl_spirv, for "#define GL_SPIRV XXX" }; @@ -139,6 +140,15 @@ const char* const E_GL_ARB_post_depth_coverage = "GL_ARB_post_depth_coverage"; const char* const E_GL_ARB_shader_viewport_layer_array = "GL_ARB_shader_viewport_layer_array"; +const char* const E_GL_KHR_shader_subgroup_basic = "GL_KHR_shader_subgroup_basic"; +const char* const E_GL_KHR_shader_subgroup_vote = "GL_KHR_shader_subgroup_vote"; +const char* const E_GL_KHR_shader_subgroup_arithmetic = "GL_KHR_shader_subgroup_arithmetic"; +const char* const E_GL_KHR_shader_subgroup_ballot = "GL_KHR_shader_subgroup_ballot"; +const char* const E_GL_KHR_shader_subgroup_shuffle = "GL_KHR_shader_subgroup_shuffle"; +const char* const E_GL_KHR_shader_subgroup_shuffle_relative = "GL_KHR_shader_subgroup_shuffle_relative"; +const char* const E_GL_KHR_shader_subgroup_clustered = "GL_KHR_shader_subgroup_clustered"; +const char* const E_GL_KHR_shader_subgroup_quad = "GL_KHR_shader_subgroup_quad"; + const char* const E_GL_EXT_shader_non_constant_global_initializers = "GL_EXT_shader_non_constant_global_initializers"; const char* const E_GL_EXT_shader_image_load_formatted = "GL_EXT_shader_image_load_formatted"; @@ -146,6 +156,8 @@ const char* const E_GL_EXT_device_group = "GL_EXT_device_group"; const char* const E_GL_EXT_multiview = "GL_EXT_multiview"; const char* const E_GL_EXT_post_depth_coverage = "GL_EXT_post_depth_coverage"; +const char* const E_GL_EXT_control_flow_attributes = "GL_EXT_control_flow_attributes"; +const char* const E_GL_EXT_nonuniform_qualifier = "GL_EXT_nonuniform_qualifier"; // Arrays of extensions for the above viewportEXTs duplications @@ -173,6 +185,7 @@ const char* const E_GL_AMD_gpu_shader_int16 = "GL_AMD_gpu_shader_int16"; const char* const E_GL_AMD_shader_image_load_store_lod = "GL_AMD_shader_image_load_store_lod"; const char* const E_GL_AMD_shader_fragment_mask = "GL_AMD_shader_fragment_mask"; +const char* const E_GL_AMD_gpu_shader_half_float_fetch = "GL_AMD_gpu_shader_half_float_fetch"; #endif #ifdef NV_EXTENSIONS @@ -183,6 +196,9 @@ const char* const E_GL_NV_stereo_view_rendering = "GL_NV_stereo_view_rendering"; const char* const E_GL_NVX_multiview_per_view_attributes = "GL_NVX_multiview_per_view_attributes"; const char* const E_GL_NV_shader_atomic_int64 = "GL_NV_shader_atomic_int64"; +const char* const E_GL_NV_conservative_raster_underestimation = "GL_NV_conservative_raster_underestimation"; +const char* const E_GL_NV_shader_noperspective_interpolation = "GL_NV_shader_noperspective_interpolation"; +const char* const E_GL_NV_shader_subgroup_partitioned = "GL_NV_shader_subgroup_partitioned"; // Arrays of extensions for the above viewportEXTs duplications @@ -218,6 +234,16 @@ const char* const E_GL_OES_texture_buffer = "GL_OES_texture_buffer"; const char* const E_GL_OES_texture_cube_map_array = "GL_OES_texture_cube_map_array"; +// KHX +const char* const E_GL_KHX_shader_explicit_arithmetic_types = "GL_KHX_shader_explicit_arithmetic_types"; +const char* const E_GL_KHX_shader_explicit_arithmetic_types_int8 = "GL_KHX_shader_explicit_arithmetic_types_int8"; +const char* const E_GL_KHX_shader_explicit_arithmetic_types_int16 = "GL_KHX_shader_explicit_arithmetic_types_int16"; +const char* const E_GL_KHX_shader_explicit_arithmetic_types_int32 = "GL_KHX_shader_explicit_arithmetic_types_int32"; +const char* const E_GL_KHX_shader_explicit_arithmetic_types_int64 = "GL_KHX_shader_explicit_arithmetic_types_int64"; +const char* const E_GL_KHX_shader_explicit_arithmetic_types_float16 = "GL_KHX_shader_explicit_arithmetic_types_float16"; +const char* const E_GL_KHX_shader_explicit_arithmetic_types_float32 = "GL_KHX_shader_explicit_arithmetic_types_float32"; +const char* const E_GL_KHX_shader_explicit_arithmetic_types_float64 = "GL_KHX_shader_explicit_arithmetic_types_float64"; + // Arrays of extensions for the above AEP duplications const char* const AEP_geometry_shader[] = { E_GL_EXT_geometry_shader, E_GL_OES_geometry_shader }; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/OSDependent/Unix/ossource.cpp vulkan-1.1.73+dfsg/external/glslang/glslang/OSDependent/Unix/ossource.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/OSDependent/Unix/ossource.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/OSDependent/Unix/ossource.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -43,6 +43,9 @@ #include #include #include +#include +#include +#include namespace glslang { @@ -184,8 +187,18 @@ pthread_mutex_unlock(&gMutex); } +// #define DUMP_COUNTERS + void OS_DumpMemoryCounters() { +#ifdef DUMP_COUNTERS + struct rusage usage; + + if (getrusage(RUSAGE_SELF, &usage) == 0) + printf("Working set size: %ld\n", usage.ru_maxrss * 1024); +#else + printf("Recompile with DUMP_COUNTERS defined to see counters.\n"); +#endif } } // end namespace glslang diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Public/ShaderLang.h vulkan-1.1.73+dfsg/external/glslang/glslang/Public/ShaderLang.h --- vulkan-1.0.65.2+dfsg1/external/glslang/glslang/Public/ShaderLang.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/glslang/Public/ShaderLang.h 2018-04-27 11:46:26.000000000 +0000 @@ -67,16 +67,20 @@ extern "C" { #endif +// This should always increase, as some paths to do not consume +// a more major number. +// It should increment by one when new functionality is added. +#define GLSLANG_MINOR_VERSION 6 + // -// Driver must call this first, once, before doing any other -// compiler/linker operations. +// Call before doing any other compiler/linker operations. // // (Call once per process, not once per thread.) // SH_IMPORT_EXPORT int ShInitialize(); // -// Driver should call this at process shutdown. +// Call this at process shutdown to clean up memory. // SH_IMPORT_EXPORT int __fastcall ShFinalize(); @@ -120,9 +124,23 @@ typedef enum { EShTargetNone, - EshTargetSpv, + EShTargetSpv, // preferred spelling + EshTargetSpv = EShTargetSpv, // legacy spelling } EShTargetLanguage; +typedef enum { + EShTargetVulkan_1_0 = (1 << 22), + EShTargetVulkan_1_1 = (1 << 22) | (1 << 12), + EShTargetOpenGL_450 = 450, +} EShTargetClientVersion; + +typedef EShTargetClientVersion EshTargetClientVersion; + +typedef enum { + EShTargetSpv_1_0 = (1 << 16), + EShTargetSpv_1_3 = (1 << 16) | (3 << 8), +} EShTargetLanguageVersion; + struct TInputLanguage { EShSource languageFamily; // redundant information with other input, this one overrides when not EShSourceNone EShLanguage stage; // redundant information with other input, this one overrides when not EShSourceNone @@ -132,12 +150,13 @@ struct TClient { EShClient client; - int version; // version of client itself (not the client's input dialect) + EShTargetClientVersion version; // version of client itself (not the client's input dialect) }; struct TTarget { EShTargetLanguage language; - unsigned int version; // the version to target, if SPIR-V, defined by "word 1" of the SPIR-V binary header + EShTargetLanguageVersion version; // version to target, if SPIR-V, defined by "word 1" of the SPIR-V header + bool hlslFunctionality1; // can target hlsl_functionality1 extension(s) }; // All source/client/target versions and settings. @@ -195,6 +214,8 @@ EShMsgKeepUncalled = (1 << 8), // for testing, don't eliminate uncalled functions EShMsgHlslOffsets = (1 << 9), // allow block offsets to follow HLSL rules instead of GLSL rules EShMsgDebugInfo = (1 << 10), // save debug information + EShMsgHlslEnable16BitTypes = (1 << 11), // enable use of 16-bit types in SPIR-V for HLSL + EShMsgHlslLegalization = (1 << 12), // enable HLSL Legalization messages }; // @@ -290,7 +311,7 @@ // Deferred-Lowering C++ Interface // ----------------------------------- // -// Below is a new alternate C++ interface that might potentially replace the above +// Below is a new alternate C++ interface, which deprecates the above // opaque handle-based interface. // // The below is further designed to handle multiple compilation units per stage, where @@ -335,11 +356,15 @@ EResCount }; -// Make one TShader per shader that you will link into a program. Then provide -// the shader through setStrings() or setStringsWithLengths(), then call parse(), -// then query the info logs. -// Optionally use setPreamble() to set a special shader string that will be -// processed before all others but won't affect the validity of #version. +// Make one TShader per shader that you will link into a program. Then +// - provide the shader through setStrings() or setStringsWithLengths() +// - optionally call setEnv*(), see below for more detail +// - optionally use setPreamble() to set a special shader string that will be +// processed before all others but won't affect the validity of #version +// - call parse(): source language and target environment must be selected +// either by correct setting of EShMessages sent to parse(), or by +// explicitly calling setEnv*() +// - query the info logs // // N.B.: Does not yet support having the same TShader instance being linked into // multiple programs. @@ -368,16 +393,20 @@ void setShiftUavBinding(unsigned int base); // DEPRECATED: use setShiftBinding void setShiftCbufferBinding(unsigned int base); // synonym for setShiftUboBinding void setShiftSsboBinding(unsigned int base); // DEPRECATED: use setShiftBinding - void setShiftBindingForSet(TResourceType res, unsigned int set, unsigned int base); + void setShiftBindingForSet(TResourceType res, unsigned int base, unsigned int set); void setResourceSetBinding(const std::vector& base); void setAutoMapBindings(bool map); void setAutoMapLocations(bool map); + void setInvertY(bool invert); void setHlslIoMapping(bool hlslIoMap); void setFlattenUniformArrays(bool flatten); void setNoStorageFormat(bool useUnknownFormat); void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode); - // For setting up the environment (initialized in the constructor): + // For setting up the environment (cleared to nothingness in the constructor). + // These must be called so that parsing is done for the right source language and + // target environment, either indirectly through TranslateEnvironment() based on + // EShMessages et. al., or directly by the user. void setEnvInput(EShSource lang, EShLanguage envStage, EShClient client, int version) { environment.input.languageFamily = lang; @@ -385,16 +414,18 @@ environment.input.dialect = client; environment.input.dialectVersion = version; } - void setEnvClient(EShClient client, int version) + void setEnvClient(EShClient client, EShTargetClientVersion version) { environment.client.client = client; environment.client.version = version; } - void setEnvTarget(EShTargetLanguage lang, unsigned int version) + void setEnvTarget(EShTargetLanguage lang, EShTargetLanguageVersion version) { environment.target.language = lang; environment.target.version = version; } + void setEnvTargetHlslFunctionality1() { environment.target.hlslFunctionality1 = true; } + bool getEnvTargetHlslFunctionality1() const { return environment.target.hlslFunctionality1; } // Interface to #include handlers. // @@ -640,6 +671,7 @@ int getUniformBlockSize(int blockIndex) const; // can be used for glGetActiveUniformBlockiv(UNIFORM_BLOCK_DATA_SIZE) int getUniformIndex(const char* name) const; // can be used for glGetUniformIndices() int getUniformBinding(int index) const; // returns the binding number + int getUniformBlockBinding(int index) const; // returns the block binding number int getUniformBlockIndex(int index) const; // can be used for glGetActiveUniformsiv(GL_UNIFORM_BLOCK_INDEX) int getUniformBlockCounterIndex(int index) const; // returns block index of associated counter. int getUniformType(int index) const; // can be used for glGetActiveUniformsiv(GL_UNIFORM_TYPE) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/gtests/AST.FromFile.cpp vulkan-1.1.73+dfsg/external/glslang/gtests/AST.FromFile.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/gtests/AST.FromFile.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/gtests/AST.FromFile.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -41,12 +41,26 @@ using CompileToAstTest = GlslangTest<::testing::TestWithParam>; +#ifdef NV_EXTENSIONS +using CompileToAstTestNV = GlslangTest<::testing::TestWithParam>; +#endif + TEST_P(CompileToAstTest, FromFile) { loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), - Source::GLSL, Semantics::OpenGL, + Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0, + Target::AST); +} + +#ifdef NV_EXTENSIONS +// Compiling GLSL to SPIR-V under OpenGL semantics (NV extensions enabled). +TEST_P(CompileToAstTestNV, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), + Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0, Target::AST); } +#endif // clang-format off INSTANTIATE_TEST_CASE_P( @@ -84,6 +98,8 @@ "cppBad2.vert", "cppComplexExpr.vert", "cppDeepNest.frag", + "cppPassMacroName.frag", + "cppRelaxSkipTokensErrors.vert", "badChars.frag", "pointCoord.frag", "array.frag", @@ -105,6 +121,7 @@ "310.tese", "310implicitSizeArrayError.vert", "310AofA.vert", + "310runtimeArray.vert", "320.comp", "320.vert", "320.geom", @@ -160,7 +177,7 @@ "460.vert", "dce.frag", "atomic_uint.frag", -// "implicitInnerAtomicUint.frag", + "implicitInnerAtomicUint.frag", "aggOps.frag", "always-discard.frag", "always-discard2.frag", @@ -183,10 +200,13 @@ "loopsArtificial.frag", "matrix.frag", "matrix2.frag", + "mixedArrayDecls.frag", + "nonuniform.frag", "newTexture.frag", "Operations.frag", "overlongLiteral.frag", "prepost.frag", + "runtimeArray.vert", "simpleFunctionCall.frag", "structAssignment.frag", "structDeref.frag", @@ -209,9 +229,20 @@ "precise.tesc", "precise_struct_block.vert", "maxClipDistances.vert", + "findFunction.frag", + })), + FileNameAsCustomTestSuffix +); + +#ifdef NV_EXTENSIONS +INSTANTIATE_TEST_CASE_P( + Glsl, CompileToAstTestNV, + ::testing::ValuesIn(std::vector({ + "nvShaderNoperspectiveInterpolation.frag", })), FileNameAsCustomTestSuffix ); +#endif // clang-format on } // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/gtests/Config.FromFile.cpp vulkan-1.1.73+dfsg/external/glslang/gtests/Config.FromFile.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/gtests/Config.FromFile.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/gtests/Config.FromFile.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -97,7 +97,7 @@ INSTANTIATE_TEST_CASE_P( Glsl, ConfigTest, ::testing::ValuesIn(std::vector({ - {"specExamples.vert", "baseResults/test.conf", "specExamples.vert.out", (EShMessages)(EShMsgAST | EShMsgCascadingErrors)}, + {"specExamples.vert", "baseResults/test.conf", "specExamplesConf.vert.out", (EShMessages)(EShMsgAST | EShMsgCascadingErrors)}, {"100Limits.vert", "100.conf", "100LimitsConf.vert.out", EShMsgCascadingErrors}, })), ); diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/gtests/Hlsl.FromFile.cpp vulkan-1.1.73+dfsg/external/glslang/gtests/Hlsl.FromFile.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/gtests/Hlsl.FromFile.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/gtests/Hlsl.FromFile.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -58,6 +58,7 @@ } using HlslCompileTest = GlslangTest<::testing::TestWithParam>; +using HlslVulkan1_1CompileTest = GlslangTest<::testing::TestWithParam>; using HlslCompileAndFlattenTest = GlslangTest<::testing::TestWithParam>; using HlslLegalizeTest = GlslangTest<::testing::TestWithParam>; @@ -66,8 +67,15 @@ TEST_P(HlslCompileTest, FromFile) { loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName, - Source::HLSL, Semantics::Vulkan, - Target::BothASTAndSpv, GetParam().entryPoint); + Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, + Target::BothASTAndSpv, true, GetParam().entryPoint); +} + +TEST_P(HlslVulkan1_1CompileTest, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName, + Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, + Target::BothASTAndSpv, true, GetParam().entryPoint); } TEST_P(HlslCompileAndFlattenTest, FromFile) @@ -82,9 +90,9 @@ TEST_P(HlslLegalizeTest, FromFile) { loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName, - Source::HLSL, Semantics::Vulkan, - Target::Spv, GetParam().entryPoint, - "/baseLegalResults/", false); + Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, + Target::Spv, true, GetParam().entryPoint, + "/baseLegalResults/", true); } // clang-format off @@ -108,6 +116,7 @@ {"hlsl.calculatelod.dx10.frag", "main"}, {"hlsl.calculatelodunclamped.dx10.frag", "main"}, {"hlsl.cast.frag", "PixelShaderFunction"}, + {"hlsl.cbuffer-identifier.vert", "main"}, {"hlsl.charLit.vert", "main"}, {"hlsl.clip.frag", "main"}, {"hlsl.clipdistance-1.frag", "main"}, @@ -132,6 +141,7 @@ {"hlsl.clipdistance-8.vert", "main"}, {"hlsl.clipdistance-9.frag", "main"}, {"hlsl.clipdistance-9.vert", "main"}, + {"hlsl.color.hull.tesc", "main"}, {"hlsl.comparison.vec.frag", "main"}, {"hlsl.conditional.frag", "PixelShaderFunction"}, {"hlsl.constantbuffer.frag", "main"}, @@ -172,6 +182,7 @@ {"hlsl.getdimensions.dx10.vert", "main"}, {"hlsl.getsampleposition.dx10.frag", "main"}, {"hlsl.global-const-init.frag", "main"}, + {"hlsl.gs-hs-mix.tesc", "HSMain"}, {"hlsl.domain.1.tese", "main"}, {"hlsl.domain.2.tese", "main"}, {"hlsl.domain.3.tese", "main"}, @@ -186,6 +197,7 @@ {"hlsl.hull.ctrlpt-2.tesc", "main"}, {"hlsl.identifier.sample.frag", "main"}, {"hlsl.if.frag", "PixelShaderFunction"}, + {"hlsl.imagefetch-subvec4.comp", "main"}, {"hlsl.implicitBool.frag", "main"}, {"hlsl.inf.vert", "main"}, {"hlsl.inoutquals.frag", "main"}, @@ -209,6 +221,7 @@ {"hlsl.intrinsics.promote.down.frag", "main"}, {"hlsl.intrinsics.promote.outputs.frag", "main"}, {"hlsl.layout.frag", "main"}, + {"hlsl.layoutOverride.vert", "main"}, {"hlsl.load.2dms.dx10.frag", "main"}, {"hlsl.load.array.dx10.frag", "main"}, {"hlsl.load.basic.dx10.frag", "main"}, @@ -237,18 +250,21 @@ {"hlsl.matrixSwizzle.vert", "ShaderFunction"}, {"hlsl.memberFunCall.frag", "main"}, {"hlsl.mintypes.frag", "main"}, + {"hlsl.mul-truncate.frag", "main"}, {"hlsl.multiEntry.vert", "RealEntrypoint"}, {"hlsl.multiReturn.frag", "main"}, {"hlsl.matrixindex.frag", "main"}, {"hlsl.nonstaticMemberFunction.frag", "main"}, {"hlsl.numericsuffixes.frag", "main"}, - {"hlsl.numthreads.comp", "main_aux1"}, + {"hlsl.numthreads.comp", "main_aux2"}, {"hlsl.overload.frag", "PixelShaderFunction"}, {"hlsl.opaque-type-bug.frag", "main"}, {"hlsl.params.default.frag", "main"}, {"hlsl.params.default.negative.frag", "main"}, {"hlsl.partialInit.frag", "PixelShaderFunction"}, {"hlsl.partialFlattenLocal.vert", "main"}, + {"hlsl.PointSize.geom", "main"}, + {"hlsl.PointSize.vert", "main"}, {"hlsl.pp.vert", "main"}, {"hlsl.pp.line.frag", "main"}, {"hlsl.precise.frag", "main"}, @@ -297,7 +313,9 @@ {"hlsl.semicolons.frag", "main"}, {"hlsl.shapeConv.frag", "main"}, {"hlsl.shapeConvRet.frag", "main"}, + {"hlsl.snorm.uav.comp", "main"}, {"hlsl.staticMemberFunction.frag", "main"}, + {"hlsl.store.rwbyteaddressbuffer.type.comp", "main"}, {"hlsl.stringtoken.frag", "main"}, {"hlsl.string.frag", "main"}, {"hlsl.struct.split-1.vert", "main"}, @@ -326,6 +344,7 @@ {"hlsl.structStructName.frag", "main"}, {"hlsl.subpass.frag", "main"}, {"hlsl.synthesizeInput.frag", "main"}, + {"hlsl.texturebuffer.frag", "main"}, {"hlsl.texture.struct.frag", "main"}, {"hlsl.texture.subvec4.frag", "main"}, {"hlsl.this.frag", "main"}, @@ -366,6 +385,22 @@ // clang-format off INSTANTIATE_TEST_CASE_P( + ToSpirv, HlslVulkan1_1CompileTest, + ::testing::ValuesIn(std::vector{ + {"hlsl.wavebroadcast.comp", "CSMain"}, + {"hlsl.waveprefix.comp", "CSMain"}, + {"hlsl.wavequad.comp", "CSMain"}, + {"hlsl.wavequery.comp", "CSMain"}, + {"hlsl.wavequery.frag", "PixelShaderFunction"}, + {"hlsl.wavereduction.comp", "CSMain"}, + {"hlsl.wavevote.comp", "CSMain"}, + }), + FileNameAsCustomTestSuffix +); +// clang-format on + +// clang-format off +INSTANTIATE_TEST_CASE_P( ToSpirv, HlslCompileAndFlattenTest, ::testing::ValuesIn(std::vector{ {"hlsl.array.flatten.frag", "main"}, @@ -375,7 +410,7 @@ ); // clang-format on -#ifdef ENABLE_OPT +#if ENABLE_OPT // clang-format off INSTANTIATE_TEST_CASE_P( ToSpirv, HlslLegalizeTest, @@ -384,7 +419,10 @@ {"hlsl.flattenOpaque.frag", "main"}, {"hlsl.flattenOpaqueInit.vert", "main"}, {"hlsl.flattenOpaqueInitMix.vert", "main"}, - {"hlsl.flattenSubset.frag", "main"} + {"hlsl.flattenSubset.frag", "main"}, + {"hlsl.flattenSubset2.frag", "main"}, + {"hlsl.partialFlattenLocal.vert", "main"}, + {"hlsl.partialFlattenMixed.vert", "main"} }), FileNameAsCustomTestSuffix ); diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/gtests/Link.FromFile.Vk.cpp vulkan-1.1.73+dfsg/external/glslang/gtests/Link.FromFile.Vk.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/gtests/Link.FromFile.Vk.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/gtests/Link.FromFile.Vk.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -52,6 +52,7 @@ GlslangResult result; // Compile each input shader file. + bool success = true; std::vector> shaders; for (size_t i = 0; i < fileCount; ++i) { std::string contents; @@ -61,7 +62,7 @@ new glslang::TShader(GetShaderStage(GetSuffix(fileNames[i])))); auto* shader = shaders.back().get(); shader->setAutoMapLocations(true); - compile(shader, contents, "", controls); + success &= compile(shader, contents, "", controls); result.shaderResults.push_back( {fileNames[i], shader->getInfoLog(), shader->getInfoDebugLog()}); } @@ -69,10 +70,25 @@ // Link all of them. glslang::TProgram program; for (const auto& shader : shaders) program.addShader(shader.get()); - program.link(controls); + success &= program.link(controls); result.linkingOutput = program.getInfoLog(); result.linkingError = program.getInfoDebugLog(); + if (success && (controls & EShMsgSpvRules)) { + spv::SpvBuildLogger logger; + std::vector spirv_binary; + glslang::SpvOptions options; + options.disableOptimizer = true; + glslang::GlslangToSpv(*program.getIntermediate(shaders.front()->getStage()), + spirv_binary, &logger, &options); + + std::ostringstream disassembly_stream; + spv::Parameterize(); + spv::Disassemble(disassembly_stream, spirv_binary); + result.spirvWarningsErrors = logger.getAllMessages(); + result.spirv = disassembly_stream.str(); + } + std::ostringstream stream; outputResultToStream(&stream, result, controls); diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/gtests/main.cpp vulkan-1.1.73+dfsg/external/glslang/gtests/main.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/gtests/main.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/gtests/main.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -54,7 +54,7 @@ glslangtest::GlobalTestSettings.updateMode = true; } if (std::string("--test-root") == argv[i]) { - // Allow the user set the tets root directory. This is useful + // Allow the user set the test root directory. This is useful // for testing with files from another source tree. if (i + 1 < argc) { glslangtest::GlobalTestSettings.testRoot = argv[i + 1]; @@ -64,6 +64,11 @@ return 1; } } + if (std::string("--help") == argv[i]) { + printf("\nExtra options:\n\n"); + printf(" --update-mode\n Update the golden results for the tests.\n"); + printf(" --test-root \n Specify the test root directory (useful for testing with\n files from another source tree).\n"); + } } const int result = RUN_ALL_TESTS(); diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/gtests/Spv.FromFile.cpp vulkan-1.1.73+dfsg/external/glslang/gtests/Spv.FromFile.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/gtests/Spv.FromFile.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/gtests/Spv.FromFile.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -63,6 +63,7 @@ } using CompileVulkanToSpirvTest = GlslangTest<::testing::TestWithParam>; +using CompileVulkan1_1ToSpirvTest = GlslangTest<::testing::TestWithParam>; using CompileOpenGLToSpirvTest = GlslangTest<::testing::TestWithParam>; using VulkanSemantics = GlslangTest<::testing::TestWithParam>; using OpenGLSemantics = GlslangTest<::testing::TestWithParam>; @@ -82,7 +83,14 @@ TEST_P(CompileVulkanToSpirvTest, FromFile) { loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), - Source::GLSL, Semantics::Vulkan, + Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, + Target::Spv); +} + +TEST_P(CompileVulkan1_1ToSpirvTest, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), + Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, Target::Spv); } @@ -91,7 +99,7 @@ TEST_P(CompileOpenGLToSpirvTest, FromFile) { loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), - Source::GLSL, Semantics::OpenGL, + Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0, Target::Spv); } @@ -100,8 +108,8 @@ TEST_P(VulkanSemantics, FromFile) { loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), - Source::GLSL, Semantics::Vulkan, - Target::Spv); + Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, + Target::Spv, false); } // GLSL-level Vulkan semantics test. Expected to error out before generating @@ -109,15 +117,15 @@ TEST_P(OpenGLSemantics, FromFile) { loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), - Source::GLSL, Semantics::OpenGL, - Target::Spv); + Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0, + Target::Spv, false); } // GLSL-level Vulkan semantics test that need to see the AST for validation. TEST_P(VulkanAstSemantics, FromFile) { loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), - Source::GLSL, Semantics::Vulkan, + Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, Target::AST); } @@ -157,19 +165,19 @@ TEST_P(CompileVulkanToSpirvTestAMD, FromFile) { loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), - Source::GLSL, Semantics::Vulkan, + Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, Target::Spv); } #endif #ifdef NV_EXTENSIONS -// Compiling GLSL to SPIR-V under Vulkan semantics (AMD extensions enabled). +// Compiling GLSL to SPIR-V under Vulkan semantics (NV extensions enabled). // Expected to successfully generate SPIR-V. TEST_P(CompileVulkanToSpirvTestNV, FromFile) { loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), - Source::GLSL, Semantics::Vulkan, - Target::Spv); + Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, + Target::Spv); } #endif @@ -189,6 +197,7 @@ // Test looping constructs. // No tests yet for making sure break and continue from a nested loop // goes to the innermost target. + "spv.barrier.vert", "spv.do-simple.vert", "spv.do-while-continue-break.vert", "spv.for-complex-condition.vert", @@ -232,16 +241,17 @@ "spv.bool.vert", "spv.boolInBlock.frag", "spv.branch-return.vert", + "spv.builtInXFB.vert", "spv.conditionalDiscard.frag", + "spv.constStruct.vert", + "spv.controlFlowAttributes.frag", "spv.conversion.frag", "spv.dataOut.frag", "spv.dataOutIndirect.frag", "spv.dataOutIndirect.vert", "spv.deepRvalue.frag", "spv.depthOut.frag", - "spv.deviceGroup.frag", "spv.discard-dce.frag", - "spv.drawParams.vert", "spv.doWhileLoop.frag", "spv.earlyReturnDiscard.frag", "spv.extPostDepthCoverage.frag", @@ -249,6 +259,7 @@ "spv.flowControl.frag", "spv.forLoop.frag", "spv.forwardFun.frag", + "spv.fullyCovered.frag", "spv.functionCall.frag", "spv.functionNestedOpaque.vert", "spv.functionSemantics.frag", @@ -268,10 +279,10 @@ "spv.merge-unreachable.frag", "spv.multiStruct.comp", "spv.multiStructFuncall.frag", - "spv.multiView.frag", "spv.newTexture.frag", "spv.noDeadDecorations.vert", "spv.nonSquare.vert", + "spv.nonuniform.frag", "spv.noWorkgroup.comp", "spv.offsets.frag", "spv.Operations.frag", @@ -280,6 +291,9 @@ "spv.precisionNonESSamp.frag", "spv.prepost.frag", "spv.qualifiers.vert", + "spv.sample.frag", + "spv.sampleId.frag", + "spv.samplePosition.frag", "spv.sampleMaskOverrideCoverage.frag", "spv.shaderBallot.comp", "spv.shaderDrawParams.vert", @@ -308,6 +322,7 @@ "spv.variableArrayIndex.frag", "spv.varyingArray.frag", "spv.varyingArrayIndirect.frag", + "spv.vecMatConstruct.frag", "spv.voidFunction.frag", "spv.whileLoop.frag", "spv.AofA.frag", @@ -324,6 +339,44 @@ "spv.storageBuffer.vert", "spv.precise.tese", "spv.precise.tesc", + "spv.vulkan100.subgroupArithmetic.comp", + "spv.vulkan100.subgroupPartitioned.comp", + "spv.xfb.vert", + "spv.xfb2.vert", + "spv.xfb3.vert", + })), + FileNameAsCustomTestSuffix +); + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Glsl, CompileVulkan1_1ToSpirvTest, + ::testing::ValuesIn(std::vector({ + "spv.deviceGroup.frag", + "spv.drawParams.vert", + "spv.int8.frag", + "spv.vulkan110.int16.frag", + "spv.int32.frag", + "spv.explicittypes.frag", + "spv.float32.frag", + "spv.float64.frag", + "spv.multiView.frag", + "spv.subgroup.frag", + "spv.subgroup.geom", + "spv.subgroup.tesc", + "spv.subgroup.tese", + "spv.subgroup.vert", + "spv.subgroupArithmetic.comp", + "spv.subgroupBasic.comp", + "spv.subgroupBallot.comp", + "spv.subgroupClustered.comp", + "spv.subgroupClusteredNeg.comp", + "spv.subgroupPartitioned.comp", + "spv.subgroupShuffle.comp", + "spv.subgroupShuffleRelative.comp", + "spv.subgroupQuad.comp", + "spv.subgroupVote.comp", + "spv.vulkan110.storageBuffer.vert", })), FileNameAsCustomTestSuffix ); @@ -367,6 +420,7 @@ "spv.460.comp", "spv.atomic.comp", "spv.glFragColor.frag", + "spv.rankShift.comp", "spv.specConst.vert", "spv.OVR_multiview.vert", })), @@ -408,8 +462,10 @@ Glsl, CompileVulkanToSpirvTestAMD, ::testing::ValuesIn(std::vector({ "spv.float16.frag", + "spv.float16Fetch.frag", "spv.imageLoadStoreLod.frag", "spv.int16.frag", + "spv.int16.amd.frag", "spv.shaderBallotAMD.comp", "spv.shaderFragMaskAMD.frag", "spv.textureGatherBiasLod.frag", diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/gtests/TestFixture.cpp vulkan-1.1.73+dfsg/external/glslang/gtests/TestFixture.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/gtests/TestFixture.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/gtests/TestFixture.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -100,6 +100,8 @@ break; } + result = static_cast(result | EShMsgHlslLegalization); + return result; } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/gtests/TestFixture.h vulkan-1.1.73+dfsg/external/glslang/gtests/TestFixture.h --- vulkan-1.0.65.2+dfsg1/external/glslang/gtests/TestFixture.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/gtests/TestFixture.h 2018-04-27 11:46:26.000000000 +0000 @@ -70,7 +70,7 @@ // Enum for shader compilation semantics. enum class Semantics { OpenGL, - Vulkan, + Vulkan }; // Enum for compilation target. @@ -197,17 +197,40 @@ GlslangResult compileAndLink( const std::string shaderName, const std::string& code, const std::string& entryPointName, EShMessages controls, + glslang::EShTargetClientVersion clientTargetVersion, bool flattenUniformArrays = false, EShTextureSamplerTransformMode texSampTransMode = EShTexSampTransKeep, - bool disableOptimizer = true) + bool enableOptimizer = false, + bool automap = true) { - const EShLanguage kind = GetShaderStage(GetSuffix(shaderName)); + const EShLanguage stage = GetShaderStage(GetSuffix(shaderName)); - glslang::TShader shader(kind); - shader.setAutoMapLocations(true); + glslang::TShader shader(stage); + if (automap) { + shader.setAutoMapLocations(true); + shader.setAutoMapBindings(true); + } shader.setTextureSamplerTransformMode(texSampTransMode); shader.setFlattenUniformArrays(flattenUniformArrays); + if (controls & EShMsgSpvRules) { + if (controls & EShMsgVulkanRules) { + shader.setEnvInput((controls & EShMsgReadHlsl) ? glslang::EShSourceHlsl + : glslang::EShSourceGlsl, + stage, glslang::EShClientVulkan, 100); + shader.setEnvClient(glslang::EShClientVulkan, clientTargetVersion); + shader.setEnvTarget(glslang::EShTargetSpv, + clientTargetVersion == glslang::EShTargetVulkan_1_1 ? glslang::EShTargetSpv_1_3 + : glslang::EShTargetSpv_1_0); + } else { + shader.setEnvInput((controls & EShMsgReadHlsl) ? glslang::EShSourceHlsl + : glslang::EShSourceGlsl, + stage, glslang::EShClientOpenGL, 100); + shader.setEnvClient(glslang::EShClientOpenGL, clientTargetVersion); + shader.setEnvTarget(glslang::EshTargetSpv, glslang::EShTargetSpv_1_0); + } + } + bool success = compile(&shader, code, entryPointName, controls); glslang::TProgram program; @@ -219,8 +242,8 @@ if (success && (controls & EShMsgSpvRules)) { std::vector spirv_binary; glslang::SpvOptions options; - options.disableOptimizer = disableOptimizer; - glslang::GlslangToSpv(*program.getIntermediate(kind), + options.disableOptimizer = !enableOptimizer; + glslang::GlslangToSpv(*program.getIntermediate(stage), spirv_binary, &logger, &options); std::ostringstream disassembly_stream; @@ -251,9 +274,9 @@ bool autoMapBindings, bool flattenUniformArrays) { - const EShLanguage kind = GetShaderStage(GetSuffix(shaderName)); + const EShLanguage stage = GetShaderStage(GetSuffix(shaderName)); - glslang::TShader shader(kind); + glslang::TShader shader(stage); shader.setShiftSamplerBinding(baseSamplerBinding); shader.setShiftTextureBinding(baseTextureBinding); shader.setShiftImageBinding(baseImageBinding); @@ -275,7 +298,7 @@ if (success && (controls & EShMsgSpvRules)) { std::vector spirv_binary; - glslang::GlslangToSpv(*program.getIntermediate(kind), + glslang::GlslangToSpv(*program.getIntermediate(stage), spirv_binary, &logger); std::ostringstream disassembly_stream; @@ -299,9 +322,10 @@ const std::string& entryPointName, EShMessages controls, const unsigned int remapOptions = spv::spirvbin_t::NONE) { - const EShLanguage kind = GetShaderStage(GetSuffix(shaderName)); + const EShLanguage stage = GetShaderStage(GetSuffix(shaderName)); - glslang::TShader shader(kind); + glslang::TShader shader(stage); + shader.setAutoMapBindings(true); shader.setAutoMapLocations(true); bool success = compile(&shader, code, entryPointName, controls); @@ -314,7 +338,7 @@ if (success && (controls & EShMsgSpvRules)) { std::vector spirv_binary; - glslang::GlslangToSpv(*program.getIntermediate(kind), + glslang::GlslangToSpv(*program.getIntermediate(stage), spirv_binary, &logger); spv::spirvbin_t(0 /*verbosity*/).remap(spirv_binary, remapOptions); @@ -383,10 +407,12 @@ const std::string& testName, Source source, Semantics semantics, + glslang::EShTargetClientVersion clientTargetVersion, Target target, + bool automap = true, const std::string& entryPointName="", const std::string& baseDir="/baseResults/", - const bool disableOptimizer = true) + const bool enableOptimizer = false) { const std::string inputFname = testDir + "/" + testName; const std::string expectedOutputFname = @@ -396,8 +422,11 @@ tryLoadFile(inputFname, "input", &input); tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); - const EShMessages controls = DeriveOptions(source, semantics, target); - GlslangResult result = compileAndLink(testName, input, entryPointName, controls, false, EShTexSampTransKeep, disableOptimizer); + EShMessages controls = DeriveOptions(source, semantics, target); + if (enableOptimizer) + controls = static_cast(controls & ~EShMsgHlslLegalization); + GlslangResult result = compileAndLink(testName, input, entryPointName, controls, clientTargetVersion, false, + EShTexSampTransKeep, enableOptimizer, automap); // Generate the hybrid output in the way of glslangValidator. std::ostringstream stream; @@ -423,7 +452,8 @@ tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); const EShMessages controls = DeriveOptions(source, semantics, target); - GlslangResult result = compileAndLink(testName, input, entryPointName, controls, true); + GlslangResult result = compileAndLink(testName, input, entryPointName, controls, + glslang::EShTargetVulkan_1_0, true); // Generate the hybrid output in the way of glslangValidator. std::ostringstream stream; @@ -592,7 +622,9 @@ tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); const EShMessages controls = DeriveOptions(source, semantics, target); - GlslangResult result = compileAndLink(testName, input, entryPointName, controls, false, EShTexSampTransUpgradeTextureRemoveSampler); + GlslangResult result = compileAndLink(testName, input, entryPointName, controls, + glslang::EShTargetVulkan_1_0, false, + EShTexSampTransUpgradeTextureRemoveSampler); // Generate the hybrid output in the way of glslangValidator. std::ostringstream stream; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/hlsl/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/hlsl/CMakeLists.txt 2018-04-27 11:46:26.000000000 +0000 @@ -17,10 +17,14 @@ hlslGrammar.h hlslParseables.h) -add_library(HLSL STATIC ${SOURCES} ${HEADERS}) +add_library(HLSL ${LIB_TYPE} ${SOURCES} ${HEADERS}) set_property(TARGET HLSL PROPERTY FOLDER hlsl) set_property(TARGET HLSL PROPERTY POSITION_INDEPENDENT_CODE ON) +if(WIN32 AND BUILD_SHARED_LIBS) + set_target_properties(HLSL PROPERTIES PREFIX "") +endif() + if(WIN32) source_group("Source" FILES ${SOURCES} ${HEADERS}) endif(WIN32) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/hlslAttributes.cpp vulkan-1.1.73+dfsg/external/glslang/hlsl/hlslAttributes.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/hlslAttributes.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/hlsl/hlslAttributes.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -34,151 +34,73 @@ // #include "hlslAttributes.h" -#include -#include -#include +#include "hlslParseHelper.h" namespace glslang { // Map the given string to an attribute enum from TAttributeType, // or EatNone if invalid. - TAttributeType TAttributeMap::attributeFromName(const TString& nameSpace, const TString& name) + TAttributeType HlslParseContext::attributeFromName(const TString& nameSpace, const TString& name) const { - // These are case insensitive. - TString lowername(name); - std::transform(lowername.begin(), lowername.end(), lowername.begin(), ::tolower); - TString lowernameSpace(nameSpace); - std::transform(lowernameSpace.begin(), lowernameSpace.end(), lowernameSpace.begin(), ::tolower); - // handle names within a namespace - if (lowernameSpace == "vk") { - if (lowername == "input_attachment_index") + if (nameSpace == "vk") { + if (name == "input_attachment_index") return EatInputAttachment; - else if (lowername == "location") + else if (name == "location") return EatLocation; - else if (lowername == "binding") + else if (name == "binding") return EatBinding; - else if (lowername == "global_cbuffer_binding") + else if (name == "global_cbuffer_binding") return EatGlobalBinding; - } else if (lowernameSpace.size() > 0) + else if (name == "builtin") + return EatBuiltIn; + else if (name == "constant_id") + return EatConstantId; + else if (name == "push_constant") + return EatPushConstant; + } else if (nameSpace.size() > 0) return EatNone; // handle names with no namespace - if (lowername == "allow_uav_condition") + if (name == "allow_uav_condition") return EatAllow_uav_condition; - else if (lowername == "branch") + else if (name == "branch") return EatBranch; - else if (lowername == "call") + else if (name == "call") return EatCall; - else if (lowername == "domain") + else if (name == "domain") return EatDomain; - else if (lowername == "earlydepthstencil") + else if (name == "earlydepthstencil") return EatEarlyDepthStencil; - else if (lowername == "fastopt") + else if (name == "fastopt") return EatFastOpt; - else if (lowername == "flatten") + else if (name == "flatten") return EatFlatten; - else if (lowername == "forcecase") + else if (name == "forcecase") return EatForceCase; - else if (lowername == "instance") + else if (name == "instance") return EatInstance; - else if (lowername == "maxtessfactor") + else if (name == "maxtessfactor") return EatMaxTessFactor; - else if (lowername == "maxvertexcount") + else if (name == "maxvertexcount") return EatMaxVertexCount; - else if (lowername == "numthreads") + else if (name == "numthreads") return EatNumThreads; - else if (lowername == "outputcontrolpoints") + else if (name == "outputcontrolpoints") return EatOutputControlPoints; - else if (lowername == "outputtopology") + else if (name == "outputtopology") return EatOutputTopology; - else if (lowername == "partitioning") + else if (name == "partitioning") return EatPartitioning; - else if (lowername == "patchconstantfunc") + else if (name == "patchconstantfunc") return EatPatchConstantFunc; - else if (lowername == "unroll") + else if (name == "unroll") return EatUnroll; - else if (lowername == "loop") + else if (name == "loop") return EatLoop; else return EatNone; } - // Look up entry, inserting if it's not there, and if name is a valid attribute name - // as known by attributeFromName. - TAttributeType TAttributeMap::setAttribute(const TString& nameSpace, const TString* name, TIntermAggregate* value) - { - if (name == nullptr) - return EatNone; - - const TAttributeType attr = attributeFromName(nameSpace, *name); - - if (attr != EatNone) - attributes[attr] = value; - - return attr; - } - - // Look up entry (const version), and return aggregate node. This cannot change the map. - const TIntermAggregate* TAttributeMap::operator[](TAttributeType attr) const - { - const auto entry = attributes.find(attr); - - return (entry == attributes.end()) ? nullptr : entry->second; - } - - // True if entry exists in map (even if value is nullptr) - bool TAttributeMap::contains(TAttributeType attr) const - { - return attributes.find(attr) != attributes.end(); - } - - // extract integers out of attribute arguments stored in attribute aggregate - bool TAttributeMap::getInt(TAttributeType attr, int& value, int argNum) const - { - const TConstUnion* intConst = getConstUnion(attr, EbtInt, argNum); - - if (intConst == nullptr) - return false; - - value = intConst->getIConst(); - return true; - }; - - // extract strings out of attribute arguments stored in attribute aggregate. - // convert to lower case if converToLower is true (for case-insensitive compare convenience) - bool TAttributeMap::getString(TAttributeType attr, TString& value, int argNum, bool convertToLower) const - { - const TConstUnion* stringConst = getConstUnion(attr, EbtString, argNum); - - if (stringConst == nullptr) - return false; - - value = *stringConst->getSConst(); - - // Convenience. - if (convertToLower) - std::transform(value.begin(), value.end(), value.begin(), ::tolower); - - return true; - }; - - // Helper to get attribute const union. Returns nullptr on failure. - const TConstUnion* TAttributeMap::getConstUnion(TAttributeType attr, TBasicType basicType, int argNum) const - { - const TIntermAggregate* attrAgg = (*this)[attr]; - if (attrAgg == nullptr) - return nullptr; - - if (argNum >= int(attrAgg->getSequence().size())) - return nullptr; - - const TConstUnion* constVal = &attrAgg->getSequence()[argNum]->getAsConstantUnion()->getConstArray()[0]; - if (constVal == nullptr || constVal->getType() != basicType) - return nullptr; - - return constVal; - } - } // end namespace glslang diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/hlslAttributes.h vulkan-1.1.73+dfsg/external/glslang/hlsl/hlslAttributes.h --- vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/hlslAttributes.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/hlsl/hlslAttributes.h 2018-04-27 11:46:26.000000000 +0000 @@ -38,88 +38,22 @@ #include #include -#include "hlslScanContext.h" -#include "../glslang/Include/Common.h" -namespace glslang { - enum TAttributeType { - EatNone, - EatAllow_uav_condition, - EatBranch, - EatCall, - EatDomain, - EatEarlyDepthStencil, - EatFastOpt, - EatFlatten, - EatForceCase, - EatInstance, - EatMaxTessFactor, - EatNumThreads, - EatMaxVertexCount, - EatOutputControlPoints, - EatOutputTopology, - EatPartitioning, - EatPatchConstantFunc, - EatPatchSize, - EatUnroll, - EatLoop, - EatBinding, - EatGlobalBinding, - EatLocation, - EatInputAttachment - }; -} - -namespace std { - // Allow use of TAttributeType enum in hash_map without calling code having to cast. - template <> struct hash { - std::size_t operator()(glslang::TAttributeType attr) const { - return std::hash()(int(attr)); - } - }; -} // end namespace std +#include "../glslang/MachineIndependent/attribute.h" +#include "../glslang/MachineIndependent/SymbolTable.h" +#include "hlslScanContext.h" namespace glslang { - class TIntermAggregate; - - class TAttributeMap { - public: - // Search for and potentially add the attribute into the map. Return the - // attribute type enum for it, if found, else EatNone. - TAttributeType setAttribute(const TString& nameSpace, const TString* name, TIntermAggregate* value); - - // Const lookup: search for (but do not modify) the attribute in the map. - const TIntermAggregate* operator[](TAttributeType) const; - - // True if entry exists in map (even if value is nullptr) - bool contains(TAttributeType) const; - - // Obtain attribute as integer - bool getInt(TAttributeType attr, int& value, int argNum = 0) const; - - // Obtain attribute as string, with optional to-lower transform - bool getString(TAttributeType attr, TString& value, int argNum = 0, bool convertToLower = true) const; - - protected: - // Helper to get attribute const union - const TConstUnion* getConstUnion(TAttributeType attr, TBasicType, int argNum) const; - - // Find an attribute enum given its name. - static TAttributeType attributeFromName(const TString& nameSpace, const TString& name); - - std::unordered_map attributes; - }; class TFunctionDeclarator { public: TFunctionDeclarator() : function(nullptr), body(nullptr) { } TSourceLoc loc; TFunction* function; - TAttributeMap attributes; + TAttributes attributes; TVector* body; }; } // end namespace glslang - #endif // HLSLATTRIBUTES_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/hlslGrammar.cpp vulkan-1.1.73+dfsg/external/glslang/hlsl/hlslGrammar.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/hlslGrammar.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/hlsl/hlslGrammar.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -376,11 +376,9 @@ bool forbidDeclarators = (peekTokenClass(EHTokCBuffer) || peekTokenClass(EHTokTBuffer)); // fully_specified_type - if (! acceptFullySpecifiedType(declaredType, nodeList)) + if (! acceptFullySpecifiedType(declaredType, nodeList, declarator.attributes, forbidDeclarators)) return false; - parseContext.transferTypeAttributes(declarator.attributes, declaredType); - // cbuffer and tbuffer end with the closing '}'. // No semicolon is included. if (forbidDeclarators) @@ -398,6 +396,9 @@ if (peekTokenClass(EHTokLeftParen)) { // looks like function parameters + // merge in the attributes into the return type + parseContext.transferTypeAttributes(token.loc, declarator.attributes, declaredType, true); + // Potentially rename shader entry point function. No-op most of the time. parseContext.renameShaderFunction(fullName); @@ -425,32 +426,30 @@ parseContext.handleFunctionDeclarator(declarator.loc, *declarator.function, true); } } else { - // A variable declaration. Fix the storage qualifier if it's a global. + // A variable declaration. + + // merge in the attributes, the first time around, into the shared type + if (! declarator_list) + parseContext.transferTypeAttributes(token.loc, declarator.attributes, declaredType); + + // Fix the storage qualifier if it's a global. if (declaredType.getQualifier().storage == EvqTemporary && parseContext.symbolTable.atGlobalLevel()) declaredType.getQualifier().storage = EvqUniform; + // recognize array_specifier + TArraySizes* arraySizes = nullptr; + acceptArraySpecifier(arraySizes); + // We can handle multiple variables per type declaration, so // the number of types can expand when arrayness is different. TType variableType; variableType.shallowCopy(declaredType); - // recognize array_specifier - TArraySizes* arraySizes = nullptr; - acceptArraySpecifier(arraySizes); - - // Fix arrayness in the variableType - if (declaredType.isImplicitlySizedArray()) { - // Because "int[] a = int[2](...), b = int[3](...)" makes two arrays a and b - // of different sizes, for this case sharing the shallow copy of arrayness - // with the parseType oversubscribes it, so get a deep copy of the arrayness. - variableType.newArraySizes(declaredType.getArraySizes()); - } - if (arraySizes || variableType.isArray()) { - // In the most general case, arrayness is potentially coming both from the - // declared type and from the variable: "int[] a[];" or just one or the other. - // Merge it all to the variableType, so all arrayness is part of the variableType. - parseContext.arrayDimMerge(variableType, arraySizes); - } + // In the most general case, arrayness is potentially coming both from the + // declared type and from the variable: "int[] a[];" or just one or the other. + // Merge it all to the variableType, so all arrayness is part of the variableType. + variableType.transferArraySizes(arraySizes); + variableType.copyArrayInnerSizes(declaredType.getArraySizes()); // samplers accept immediate sampler state if (variableType.getBasicType() == EbtSampler) { @@ -478,8 +477,9 @@ if (typedefDecl) parseContext.declareTypedef(idToken.loc, *fullName, variableType); else if (variableType.getBasicType() == EbtBlock) { - parseContext.declareBlock(idToken.loc, variableType, fullName, - variableType.isArray() ? &variableType.getArraySizes() : nullptr); + if (expressionNode) + parseContext.error(idToken.loc, "buffer aliasing not yet supported", "block initializer", ""); + parseContext.declareBlock(idToken.loc, variableType, fullName); parseContext.declareStructBufferCounter(idToken.loc, variableType, *fullName); } else { if (variableType.getQualifier().storage == EvqUniform && ! variableType.containsOpaque()) { @@ -536,12 +536,16 @@ bool HlslGrammar::acceptControlDeclaration(TIntermNode*& node) { node = nullptr; + TAttributes attributes; // fully_specified_type TType type; - if (! acceptFullySpecifiedType(type)) + if (! acceptFullySpecifiedType(type, attributes)) return false; + if (attributes.size() > 0) + parseContext.warn(token.loc, "attributes don't apply to control declaration", "", ""); + // filter out type casts if (peekTokenClass(EHTokLeftParen)) { recedeToken(); @@ -577,12 +581,12 @@ // : type_specifier // | type_qualifier type_specifier // -bool HlslGrammar::acceptFullySpecifiedType(TType& type) +bool HlslGrammar::acceptFullySpecifiedType(TType& type, const TAttributes& attributes) { TIntermNode* nodeList = nullptr; - return acceptFullySpecifiedType(type, nodeList); + return acceptFullySpecifiedType(type, nodeList, attributes); } -bool HlslGrammar::acceptFullySpecifiedType(TType& type, TIntermNode*& nodeList) +bool HlslGrammar::acceptFullySpecifiedType(TType& type, TIntermNode*& nodeList, const TAttributes& attributes, bool forbidDeclarators) { // type_qualifier TQualifier qualifier; @@ -601,11 +605,18 @@ return false; } + if (type.getBasicType() == EbtBlock) { // the type was a block, which set some parts of the qualifier parseContext.mergeQualifiers(type.getQualifier(), qualifier); + + // merge in the attributes + parseContext.transferTypeAttributes(token.loc, attributes, type); + // further, it can create an anonymous instance of the block - if (peek() != EHTokIdentifier) + // (cbuffer and tbuffer don't consume the next identifier, and + // should set forbidDeclarators) + if (forbidDeclarators || peek() != EHTokIdentifier) parseContext.declareBlock(loc, type); } else { // Some qualifiers are set when parsing the type. Merge those with @@ -624,7 +635,7 @@ if (type.isBuiltIn()) qualifier.builtIn = type.getQualifier().builtIn; - type.getQualifier() = qualifier; + type.getQualifier() = qualifier; } return true; @@ -1016,7 +1027,7 @@ TArraySizes* arraySizes = new TArraySizes; arraySizes->addInnerSize(size->getAsConstantUnion()->getConstArray()[0].getIConst()); - type.newArraySizes(*arraySizes); + type.transferArraySizes(arraySizes); type.getQualifier().builtIn = patchType; if (! acceptTokenClass(EHTokRightAngle)) { @@ -1357,14 +1368,15 @@ } bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList) { - // Basic types for min* types, broken out here in case of future - // changes, e.g, to use native halfs. - static const TBasicType min16float_bt = EbtFloat; - static const TBasicType min10float_bt = EbtFloat; - static const TBasicType half_bt = EbtFloat; - static const TBasicType min16int_bt = EbtInt; - static const TBasicType min12int_bt = EbtInt; - static const TBasicType min16uint_bt = EbtUint; + // Basic types for min* types, use native halfs if the option allows them. + bool enable16BitTypes = parseContext.hlslEnable16BitTypes(); + + const TBasicType min16float_bt = enable16BitTypes ? EbtFloat16 : EbtFloat; + const TBasicType min10float_bt = enable16BitTypes ? EbtFloat16 : EbtFloat; + const TBasicType half_bt = enable16BitTypes ? EbtFloat16 : EbtFloat; + const TBasicType min16int_bt = enable16BitTypes ? EbtInt16 : EbtInt; + const TBasicType min12int_bt = enable16BitTypes ? EbtInt16 : EbtInt; + const TBasicType min16uint_bt = enable16BitTypes ? EbtUint16 : EbtUint; // Some types might have turned into identifiers. Take the hit for checking // when this has happened. @@ -1378,6 +1390,23 @@ } } + bool isUnorm = false; + bool isSnorm = false; + + // Accept snorm and unorm. Presently, this is ignored, save for an error check below. + switch (peek()) { + case EHTokUnorm: + isUnorm = true; + advanceToken(); // eat the token + break; + case EHTokSNorm: + isSnorm = true; + advanceToken(); // eat the token + break; + default: + break; + } + switch (peek()) { case EHTokVector: return acceptVectorTemplateType(type); @@ -1453,6 +1482,10 @@ return acceptStructBufferType(type); break; + case EHTokTextureBuffer: + return acceptTextureBufferType(type); + break; + case EHTokConstantBuffer: return acceptConstantBufferType(type); @@ -1549,6 +1582,10 @@ new(&type) TType(EbtUint, EvqTemporary, 4); break; + case EHTokUint64: + new(&type) TType(EbtUint64); + break; + case EHTokBool: new(&type) TType(EbtBool); break; @@ -1968,6 +2005,11 @@ advanceToken(); + if ((isUnorm || isSnorm) && !type.isFloatingDomain()) { + parseContext.error(token.loc, "unorm and snorm only valid in floating point domain", "", ""); + return false; + } + return true; } @@ -2003,10 +2045,18 @@ // Now known to be one of CBUFFER, TBUFFER, CLASS, or STRUCT - // IDENTIFIER + + // IDENTIFIER. It might also be a keyword which can double as an identifier. + // For example: 'cbuffer ConstantBuffer' or 'struct ConstantBuffer' is legal. + // 'cbuffer int' is also legal, and 'struct int' appears rejected only because + // it attempts to redefine the 'int' type. + const char* idString = getTypeString(peek()); TString structName = ""; - if (peekTokenClass(EHTokIdentifier)) { - structName = *token.string; + if (peekTokenClass(EHTokIdentifier) || idString != nullptr) { + if (idString != nullptr) + structName = *idString; + else + structName = *token.string; advanceToken(); } @@ -2127,6 +2177,43 @@ } } +// texture_buffer +// : TEXTUREBUFFER LEFT_ANGLE type RIGHT_ANGLE +bool HlslGrammar::acceptTextureBufferType(TType& type) +{ + if (! acceptTokenClass(EHTokTextureBuffer)) + return false; + + if (! acceptTokenClass(EHTokLeftAngle)) { + expected("left angle bracket"); + return false; + } + + TType templateType; + if (! acceptType(templateType)) { + expected("type"); + return false; + } + + if (! acceptTokenClass(EHTokRightAngle)) { + expected("right angle bracket"); + return false; + } + + templateType.getQualifier().storage = EvqBuffer; + templateType.getQualifier().readonly = true; + + TType blockType(templateType.getWritableStruct(), "", templateType.getQualifier()); + + blockType.getQualifier().storage = EvqBuffer; + blockType.getQualifier().readonly = true; + + type.shallowCopy(blockType); + + return true; +} + + // struct_buffer // : APPENDSTRUCTUREDBUFFER // | BYTEADDRESSBUFFER @@ -2199,9 +2286,9 @@ // Create an unsized array out of that type. // TODO: does this work if it's already an array type? - TArraySizes unsizedArray; - unsizedArray.addInnerSize(UnsizedArraySize); - templateType->newArraySizes(unsizedArray); + TArraySizes* unsizedArray = new TArraySizes; + unsizedArray->addInnerSize(UnsizedArraySize); + templateType->transferArraySizes(unsizedArray); templateType->getQualifier().storage = storage; // field name is canonical for all structbuffers @@ -2231,8 +2318,8 @@ // : struct_declaration SEMI_COLON struct_declaration SEMI_COLON ... // // struct_declaration -// : fully_specified_type struct_declarator COMMA struct_declarator ... -// | fully_specified_type IDENTIFIER function_parameters post_decls compound_statement // member-function definition +// : attributes fully_specified_type struct_declarator COMMA struct_declarator ... +// | attributes fully_specified_type IDENTIFIER function_parameters post_decls compound_statement // member-function definition // // struct_declarator // : IDENTIFIER post_decls @@ -2251,15 +2338,22 @@ break; // struct_declaration - + + // attributes + TAttributes attributes; + acceptAttributes(attributes); + bool declarator_list = false; // fully_specified_type TType memberType; - if (! acceptFullySpecifiedType(memberType, nodeList)) { + if (! acceptFullySpecifiedType(memberType, nodeList, attributes)) { expected("member type"); return false; } + + // merge in the attributes + parseContext.transferTypeAttributes(token.loc, attributes, memberType); // struct_declarator COMMA struct_declarator ... bool functionDefinitionAccepted = false; @@ -2292,7 +2386,7 @@ TArraySizes* arraySizes = nullptr; acceptArraySpecifier(arraySizes); if (arraySizes) - typeList->back().type->newArraySizes(*arraySizes); + typeList->back().type->transferArraySizes(arraySizes); acceptPostDecls(member.type->getQualifier()); @@ -2456,15 +2550,16 @@ bool HlslGrammar::acceptParameterDeclaration(TFunction& function) { // attributes - TAttributeMap attributes; + TAttributes attributes; acceptAttributes(attributes); // fully_specified_type TType* type = new TType; - if (! acceptFullySpecifiedType(*type)) + if (! acceptFullySpecifiedType(*type, attributes)) return false; - parseContext.transferTypeAttributes(attributes, *type); + // merge in the attributes + parseContext.transferTypeAttributes(token.loc, attributes, *type); // identifier HlslToken idToken; @@ -2474,12 +2569,12 @@ TArraySizes* arraySizes = nullptr; acceptArraySpecifier(arraySizes); if (arraySizes) { - if (arraySizes->isImplicit()) { - parseContext.error(token.loc, "function parameter array cannot be implicitly sized", "", ""); + if (arraySizes->hasUnsized()) { + parseContext.error(token.loc, "function parameter requires array size", "[]", ""); return false; } - type->newArraySizes(*arraySizes); + type->transferArraySizes(arraySizes); } // post_decls @@ -2555,6 +2650,8 @@ // bool HlslGrammar::acceptParenExpression(TIntermTyped*& expression) { + expression = nullptr; + // LEFT_PAREN if (! acceptTokenClass(EHTokLeftParen)) expected("("); @@ -2848,7 +2945,7 @@ TArraySizes* arraySizes = nullptr; acceptArraySpecifier(arraySizes); if (arraySizes != nullptr) - castType.newArraySizes(*arraySizes); + castType.transferArraySizes(arraySizes); TSourceLoc loc = token.loc; if (acceptTokenClass(EHTokRightParen)) { // We've matched "(type)" now, get the expression to cast @@ -2965,6 +3062,8 @@ } if (! peekTokenClass(EHTokLeftParen)) { node = parseContext.handleVariable(idToken.loc, fullName); + if (node == nullptr) + return false; } else if (acceptFunctionCall(idToken.loc, *fullName, node, nullptr)) { // function_call (nothing else to do yet) } else { @@ -3175,6 +3274,9 @@ case EHTokUintConstant: node = intermediate.addConstantUnion(token.u, token.loc, true); break; + case EHTokFloat16Constant: + node = intermediate.addConstantUnion(token.d, EbtFloat16, token.loc, true); + break; case EHTokFloatConstant: node = intermediate.addConstantUnion(token.d, EbtFloat, token.loc, true); break; @@ -3298,7 +3400,7 @@ statement = nullptr; // attributes - TAttributeMap attributes; + TAttributes attributes; acceptAttributes(attributes); // attributed_statement @@ -3370,7 +3472,7 @@ // | PATCHCONSTANTFUNC // | NUMTHREADS LEFT_PAREN x_size, y_size,z z_size RIGHT_PAREN // -void HlslGrammar::acceptAttributes(TAttributeMap& attributes) +void HlslGrammar::acceptAttributes(TAttributes& attributes) { // For now, accept the [ XXX(X) ] syntax, but drop all but // numthreads, which is used to set the CS local size. @@ -3441,9 +3543,16 @@ return; } - // Add any values we found into the attribute map. This accepts - // (and ignores) values not mapping to a known TAttributeType; - attributes.setAttribute(nameSpace, attributeToken.string, expressions); + // Add any values we found into the attribute map. + if (attributeToken.string != nullptr) { + TAttributeType attributeType = parseContext.attributeFromName(nameSpace, *attributeToken.string); + if (attributeType == EatNone) + parseContext.warn(attributeToken.loc, "unrecognized attribute", attributeToken.string->c_str(), ""); + else { + TAttributeArgs attributeArgs = { attributeType, expressions }; + attributes.push_back(attributeArgs); + } + } } while (true); } @@ -3451,12 +3560,10 @@ // : IF LEFT_PAREN expression RIGHT_PAREN statement // : IF LEFT_PAREN expression RIGHT_PAREN statement ELSE statement // -bool HlslGrammar::acceptSelectionStatement(TIntermNode*& statement, const TAttributeMap& attributes) +bool HlslGrammar::acceptSelectionStatement(TIntermNode*& statement, const TAttributes& attributes) { TSourceLoc loc = token.loc; - const TSelectionControl control = parseContext.handleSelectionControl(attributes); - // IF if (! acceptTokenClass(EHTokIf)) return false; @@ -3494,7 +3601,9 @@ } // Put the pieces together - statement = intermediate.addSelection(condition, thenElse, loc, control); + statement = intermediate.addSelection(condition, thenElse, loc); + parseContext.handleSelectionAttributes(loc, statement->getAsSelectionNode(), attributes); + parseContext.popScope(); --parseContext.controlFlowNestingLevel; @@ -3504,13 +3613,11 @@ // switch_statement // : SWITCH LEFT_PAREN expression RIGHT_PAREN compound_statement // -bool HlslGrammar::acceptSwitchStatement(TIntermNode*& statement, const TAttributeMap& attributes) +bool HlslGrammar::acceptSwitchStatement(TIntermNode*& statement, const TAttributes& attributes) { // SWITCH TSourceLoc loc = token.loc; - const TSelectionControl control = parseContext.handleSelectionControl(attributes); - if (! acceptTokenClass(EHTokSwitch)) return false; @@ -3530,7 +3637,8 @@ --parseContext.controlFlowNestingLevel; if (statementOkay) - statement = parseContext.addSwitch(loc, switchExpression, statement ? statement->getAsAggregate() : nullptr, control); + statement = parseContext.addSwitch(loc, switchExpression, statement ? statement->getAsAggregate() : nullptr, + attributes); parseContext.popSwitchSequence(); parseContext.popScope(); @@ -3544,7 +3652,7 @@ // | FOR LEFT_PAREN for_init_statement for_rest_statement RIGHT_PAREN statement // // Non-speculative, only call if it needs to be found; WHILE or DO or FOR already seen. -bool HlslGrammar::acceptIterationStatement(TIntermNode*& statement, const TAttributeMap& attributes) +bool HlslGrammar::acceptIterationStatement(TIntermNode*& statement, const TAttributes& attributes) { TSourceLoc loc = token.loc; TIntermTyped* condition = nullptr; @@ -3554,9 +3662,8 @@ // WHILE or DO or FOR advanceToken(); - - const TLoopControl control = parseContext.handleLoopControl(attributes); + TIntermLoop* loopNode = nullptr; switch (loop) { case EHTokWhile: // so that something declared in the condition is scoped to the lifetime @@ -3582,9 +3689,9 @@ parseContext.popScope(); --parseContext.controlFlowNestingLevel; - statement = intermediate.addLoop(statement, condition, nullptr, true, loc, control); - - return true; + loopNode = intermediate.addLoop(statement, condition, nullptr, true, loc); + statement = loopNode; + break; case EHTokDo: parseContext.nestLooping(); // this only needs to work right if no errors @@ -3603,7 +3710,6 @@ } // LEFT_PAREN condition RIGHT_PAREN - TIntermTyped* condition; if (! acceptParenExpression(condition)) return false; condition = parseContext.convertConditionalExpression(loc, condition); @@ -3616,9 +3722,9 @@ parseContext.unnestLooping(); --parseContext.controlFlowNestingLevel; - statement = intermediate.addLoop(statement, condition, 0, false, loc, control); - - return true; + loopNode = intermediate.addLoop(statement, condition, 0, false, loc); + statement = loopNode; + break; case EHTokFor: { @@ -3660,18 +3766,21 @@ return false; } - statement = intermediate.addForLoop(statement, initNode, condition, iterator, true, loc, control); + statement = intermediate.addForLoop(statement, initNode, condition, iterator, true, loc, loopNode); parseContext.popScope(); parseContext.unnestLooping(); --parseContext.controlFlowNestingLevel; - return true; + break; } default: return false; } + + parseContext.handleLoopAttributes(loc, loopNode, attributes); + return true; } // jump_statement @@ -3699,9 +3808,17 @@ switch (jump) { case EHTokContinue: statement = intermediate.addBranch(EOpContinue, token.loc); + if (parseContext.loopNestingLevel == 0) { + expected("loop"); + return false; + } break; case EHTokBreak: statement = intermediate.addBranch(EOpBreak, token.loc); + if (parseContext.loopNestingLevel == 0 && parseContext.switchSequenceStack.size() == 0) { + expected("loop or switch"); + return false; + } break; case EHTokDiscard: statement = intermediate.addBranch(EOpKill, token.loc); @@ -3993,6 +4110,8 @@ case EHTokMin10float: return "min10float"; case EHTokMin16int: return "min16int"; case EHTokMin12int: return "min12int"; + case EHTokConstantBuffer: return "ConstantBuffer"; + case EHTokLayout: return "layout"; default: return nullptr; } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/hlslGrammar.h vulkan-1.1.73+dfsg/external/glslang/hlsl/hlslGrammar.h --- vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/hlslGrammar.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/hlsl/hlslGrammar.h 2018-04-27 11:46:26.000000000 +0000 @@ -43,7 +43,6 @@ namespace glslang { - class TAttributeMap; class TFunctionDeclarator; // Should just be the grammar aspect of HLSL. @@ -71,8 +70,8 @@ bool acceptControlDeclaration(TIntermNode*& node); bool acceptSamplerDeclarationDX9(TType&); bool acceptSamplerState(); - bool acceptFullySpecifiedType(TType&); - bool acceptFullySpecifiedType(TType&, TIntermNode*& nodeList); + bool acceptFullySpecifiedType(TType&, const TAttributes&); + bool acceptFullySpecifiedType(TType&, TIntermNode*& nodeList, const TAttributes&, bool forbidDeclarators = false); bool acceptQualifier(TQualifier&); bool acceptLayoutQualifierList(TQualifier&); bool acceptType(TType&); @@ -89,6 +88,7 @@ bool acceptTextureType(TType&); bool acceptSubpassInputType(TType&); bool acceptStructBufferType(TType&); + bool acceptTextureBufferType(TType&); bool acceptConstantBufferType(TType&); bool acceptStruct(TType&, TIntermNode*& nodeList); bool acceptStructDeclarationList(TTypeList*&, TIntermNode*& nodeList, TVector&); @@ -116,10 +116,10 @@ bool acceptScopedCompoundStatement(TIntermNode*&); bool acceptStatement(TIntermNode*&); bool acceptNestedStatement(TIntermNode*&); - void acceptAttributes(TAttributeMap&); - bool acceptSelectionStatement(TIntermNode*&, const TAttributeMap&); - bool acceptSwitchStatement(TIntermNode*&, const TAttributeMap&); - bool acceptIterationStatement(TIntermNode*&, const TAttributeMap&); + void acceptAttributes(TAttributes&); + bool acceptSelectionStatement(TIntermNode*&, const TAttributes&); + bool acceptSwitchStatement(TIntermNode*&, const TAttributes&); + bool acceptIterationStatement(TIntermNode*&, const TAttributes&); bool acceptJumpStatement(TIntermNode*&); bool acceptCaseLabel(TIntermNode*&); bool acceptDefaultLabel(TIntermNode*&); diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/hlslParseables.cpp vulkan-1.1.73+dfsg/external/glslang/hlsl/hlslParseables.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/hlslParseables.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/hlsl/hlslParseables.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -259,6 +259,8 @@ case 'D': s += "double"; break; case 'I': s += "int"; break; case 'U': s += "uint"; break; + case 'L': s += "int64_t"; break; + case 'M': s += "uint64_t"; break; case 'B': s += "bool"; break; case 'S': s += "sampler"; break; case 's': s += "SamplerComparisonState"; break; @@ -544,7 +546,7 @@ // orderKey can be: // S = scalar, V = vector, M = matrix, - = void // typekey can be: - // D = double, F = float, U = uint, I = int, B = bool, S = sampler, s = shadowSampler + // D = double, F = float, U = uint, I = int, B = bool, S = sampler, s = shadowSampler, M = uint64_t, L = int64_t // An empty order or type key repeats the first one. E.g: SVM,, means 3 args each of SVM. // '>' as first letter of order creates an output parameter // '<' as first letter of order creates an input parameter @@ -580,8 +582,8 @@ { "asdouble", "V2", "D", "V2,", "UI,", EShLangAll, false }, { "asfloat", nullptr, "F", "SVM", "BFIU", EShLangAll, false }, { "asin", nullptr, nullptr, "SVM", "F", EShLangAll, false }, - { "asint", nullptr, "I", "SVM", "FU", EShLangAll, false }, - { "asuint", nullptr, "U", "SVM", "FU", EShLangAll, false }, + { "asint", nullptr, "I", "SVM", "FIU", EShLangAll, false }, + { "asuint", nullptr, "U", "SVM", "FIU", EShLangAll, false }, { "atan", nullptr, nullptr, "SVM", "F", EShLangAll, false }, { "atan2", nullptr, nullptr, "SVM,", "F,", EShLangAll, false }, { "ceil", nullptr, nullptr, "SVM", "F", EShLangAll, false }, @@ -902,6 +904,35 @@ { "DecrementCounter", nullptr, nullptr, "-", "-", EShLangAll, true }, { "Consume", nullptr, nullptr, "-", "-", EShLangAll, true }, + // SM 6.0 + + { "WaveIsFirstLane", "S", "B", "-", "-", EShLangPSCS, false}, + { "WaveGetLaneCount", "S", "U", "-", "-", EShLangPSCS, false}, + { "WaveGetLaneIndex", "S", "U", "-", "-", EShLangPSCS, false}, + { "WaveActiveAnyTrue", "S", "B", "S", "B", EShLangPSCS, false}, + { "WaveActiveAllTrue", "S", "B", "S", "B", EShLangPSCS, false}, + { "WaveActiveBallot", "V4", "U", "S", "B", EShLangPSCS, false}, + { "WaveReadLaneAt", nullptr, nullptr, "SV,S", "DFUI,U", EShLangPSCS, false}, + { "WaveReadLaneFirst", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveAllEqual", "S", "B", "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveAllEqualBool", "S", "B", "S", "B", EShLangPSCS, false}, + { "WaveActiveCountBits", "S", "U", "S", "B", EShLangPSCS, false}, + + { "WaveActiveSum", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveProduct", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveBitAnd", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveBitOr", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveBitXor", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveMin", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveMax", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WavePrefixSum", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WavePrefixProduct", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WavePrefixCountBits", "S", "U", "S", "B", EShLangPSCS, false}, + { "QuadReadAcrossX", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "QuadReadAcrossY", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "QuadReadAcrossDiagonal", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "QuadReadLaneAt", nullptr, nullptr, "SV,S", "DFUI,U", EShLangPSCS, false}, + // Methods for subpass input objects { "SubpassLoad", "V4", nullptr, "[", "FIU", EShLangPS, true }, { "SubpassLoad", "V4", nullptr, "],S", "FIU,I", EShLangPS, true }, @@ -1087,8 +1118,8 @@ symbolTable.relateToOperator("ddy_fine", EOpDPdyFine); symbolTable.relateToOperator("degrees", EOpDegrees); symbolTable.relateToOperator("determinant", EOpDeterminant); - symbolTable.relateToOperator("DeviceMemoryBarrier", EOpGroupMemoryBarrier); - symbolTable.relateToOperator("DeviceMemoryBarrierWithGroupSync", EOpGroupMemoryBarrierWithGroupSync); // ... + symbolTable.relateToOperator("DeviceMemoryBarrier", EOpDeviceMemoryBarrier); + symbolTable.relateToOperator("DeviceMemoryBarrierWithGroupSync", EOpDeviceMemoryBarrierWithGroupSync); symbolTable.relateToOperator("distance", EOpDistance); symbolTable.relateToOperator("dot", EOpDot); symbolTable.relateToOperator("dst", EOpDst); @@ -1244,6 +1275,33 @@ symbolTable.relateToOperator(BUILTIN_PREFIX "Append", EOpMethodAppend); symbolTable.relateToOperator(BUILTIN_PREFIX "RestartStrip", EOpMethodRestartStrip); + // Wave ops + symbolTable.relateToOperator("WaveIsFirstLane", EOpSubgroupElect); + symbolTable.relateToOperator("WaveGetLaneCount", EOpWaveGetLaneCount); + symbolTable.relateToOperator("WaveGetLaneIndex", EOpWaveGetLaneIndex); + symbolTable.relateToOperator("WaveActiveAnyTrue", EOpSubgroupAny); + symbolTable.relateToOperator("WaveActiveAllTrue", EOpSubgroupAll); + symbolTable.relateToOperator("WaveActiveBallot", EOpSubgroupBallot); + symbolTable.relateToOperator("WaveReadLaneFirst", EOpSubgroupBroadcastFirst); + symbolTable.relateToOperator("WaveReadLaneAt", EOpSubgroupShuffle); + symbolTable.relateToOperator("WaveActiveAllEqual", EOpSubgroupAllEqual); + symbolTable.relateToOperator("WaveActiveAllEqualBool", EOpSubgroupAllEqual); + symbolTable.relateToOperator("WaveActiveCountBits", EOpWaveActiveCountBits); + symbolTable.relateToOperator("WaveActiveSum", EOpSubgroupAdd); + symbolTable.relateToOperator("WaveActiveProduct", EOpSubgroupMul); + symbolTable.relateToOperator("WaveActiveBitAnd", EOpSubgroupAnd); + symbolTable.relateToOperator("WaveActiveBitOr", EOpSubgroupOr); + symbolTable.relateToOperator("WaveActiveBitXor", EOpSubgroupXor); + symbolTable.relateToOperator("WaveActiveMin", EOpSubgroupMin); + symbolTable.relateToOperator("WaveActiveMax", EOpSubgroupMax); + symbolTable.relateToOperator("WavePrefixSum", EOpSubgroupInclusiveAdd); + symbolTable.relateToOperator("WavePrefixProduct", EOpSubgroupInclusiveMul); + symbolTable.relateToOperator("WavePrefixCountBits", EOpWavePrefixCountBits); + symbolTable.relateToOperator("QuadReadAcrossX", EOpSubgroupQuadSwapHorizontal); + symbolTable.relateToOperator("QuadReadAcrossY", EOpSubgroupQuadSwapVertical); + symbolTable.relateToOperator("QuadReadAcrossDiagonal", EOpSubgroupQuadSwapDiagonal); + symbolTable.relateToOperator("QuadReadLaneAt", EOpSubgroupQuadBroadcast); + // Subpass input methods symbolTable.relateToOperator(BUILTIN_PREFIX "SubpassLoad", EOpSubpassLoad); symbolTable.relateToOperator(BUILTIN_PREFIX "SubpassLoadMS", EOpSubpassLoadMS); diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/hlslParseHelper.cpp vulkan-1.1.73+dfsg/external/glslang/hlsl/hlslParseHelper.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/hlslParseHelper.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/hlsl/hlslParseHelper.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -65,10 +65,10 @@ entryPointFunction(nullptr), entryPointFunctionBody(nullptr), gsStreamOutput(nullptr), - clipDistanceInput(nullptr), - cullDistanceInput(nullptr), clipDistanceOutput(nullptr), - cullDistanceOutput(nullptr) + cullDistanceOutput(nullptr), + clipDistanceInput(nullptr), + cullDistanceInput(nullptr) { globalUniformDefaults.clear(); globalUniformDefaults.layoutMatrix = ElmRowMajor; @@ -550,6 +550,13 @@ warn(loc, "unknown pack_matrix pragma value", tokens[2].c_str(), ""); globalUniformDefaults.layoutMatrix = globalBufferDefaults.layoutMatrix = ElmRowMajor; } + return; + } + + // Handle once + if (lowerTokens[0] == "once") { + warn(loc, "not implemented", "#pragma once", ""); + return; } } @@ -822,7 +829,12 @@ } else { // at least one of base and index is variable... - if (base->getAsSymbolNode() && wasFlattened(base)) { + if (index->getQualifier().isFrontEndConstant()) + checkIndex(loc, base->getType(), indexValue); + + if (base->getType().isScalarOrVec1()) + result = base; + else if (base->getAsSymbolNode() && wasFlattened(base)) { if (index->getQualifier().storage != EvqConst) error(loc, "Invalid variable index to flattened array", base->getAsSymbolNode()->getName().c_str(), ""); @@ -830,14 +842,13 @@ flattened = (result != base); } else { if (index->getQualifier().isFrontEndConstant()) { - if (base->getType().isImplicitlySizedArray()) - updateImplicitArraySize(loc, base, indexValue); + if (base->getType().isUnsizedArray()) + base->getWritableType().updateImplicitArraySize(indexValue + 1); else checkIndex(loc, base->getType(), indexValue); result = intermediate.addIndex(EOpIndexDirect, base, index, loc); - } else { + } else result = intermediate.addIndex(EOpIndexIndirect, base, index, loc); - } } } @@ -1096,7 +1107,7 @@ TVariable* ioVar = makeInternalVariable(baseName + "." + memberType.getFieldName(), memberType); if (arraySizes != nullptr && !memberType.isArray()) - ioVar->getWritableType().newArraySizes(*arraySizes); + ioVar->getWritableType().copyArraySizes(*arraySizes); splitBuiltIns[tInterstageIoData(memberType.getQualifier().builtIn, outerQualifier.storage)] = ioVar; if (!isClipOrCullDistance(ioVar->getType())) @@ -1160,7 +1171,7 @@ return (type.isArray() && intermediate.getFlattenUniformArrays() && topLevel) || (type.isStruct() && type.containsOpaque()); default: - return type.isStruct() && type.containsOpaque(); + return false; }; } @@ -1247,7 +1258,7 @@ // inherited locations must be auto bumped, not replicated if (flattenData.nextLocation != TQualifier::layoutLocationEnd) { memberVariable->getWritableType().getQualifier().layoutLocation = flattenData.nextLocation; - flattenData.nextLocation += intermediate.computeTypeLocationSize(memberVariable->getType()); + flattenData.nextLocation += intermediate.computeTypeLocationSize(memberVariable->getType(), language); nextOutLocation = std::max(nextOutLocation, flattenData.nextLocation); } } @@ -1292,7 +1303,7 @@ name + "." + dereferencedType.getFieldName(), linkage, outerQualifier, builtInArraySizes == nullptr && dereferencedType.isArray() - ? &dereferencedType.getArraySizes() + ? dereferencedType.getArraySizes() : builtInArraySizes); flattenData.offsets[pos++] = mpos; } @@ -1309,7 +1320,7 @@ TFlattenData& flattenData, TString name, bool linkage, const TQualifier& outerQualifier) { - assert(type.isArray() && !type.isImplicitlySizedArray()); + assert(type.isSizedArray()); const int size = type.getOuterArraySize(); const TType dereferencedType(type, 0); @@ -1503,9 +1514,9 @@ // Alter or set array size as needed. if (requiredArraySize > 0) { if (!type.isArray() || type.getOuterArraySize() != requiredArraySize) { - TArraySizes arraySizes; - arraySizes.addInnerSize(requiredArraySize); - type.newArraySizes(arraySizes); + TArraySizes* arraySizes = new TArraySizes; + arraySizes->addInnerSize(requiredArraySize); + type.transferArraySizes(arraySizes); } } } @@ -1527,9 +1538,9 @@ int size; if (type.isArray() && qualifier.isArrayedIo(language)) { TType elementType(type, 0); - size = intermediate.computeTypeLocationSize(elementType); + size = intermediate.computeTypeLocationSize(elementType, language); } else - size = intermediate.computeTypeLocationSize(type); + size = intermediate.computeTypeLocationSize(type, language); if (qualifier.storage == EvqVaryingIn) { variable.getWritableType().getQualifier().layoutLocation = nextInLocation; @@ -1599,7 +1610,7 @@ if (! hasStructBuffCounter(*param.type)) return; - const TString counterBlockName(getStructBuffCounterName(*param.name)); + const TString counterBlockName(intermediate.addCounterBufferName(*param.name)); TType counterType; counterBufferType(loc, counterType); @@ -1620,7 +1631,7 @@ // Returns an aggregate of parameter-symbol nodes. // TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& loc, TFunction& function, - const TAttributeMap& attributes, + const TAttributes& attributes, TIntermNode*& entryPointTree) { currentCaller = function.getMangledName(); @@ -1717,169 +1728,218 @@ } // Handle all [attrib] attribute for the shader entry point -void HlslParseContext::handleEntryPointAttributes(const TSourceLoc& loc, const TAttributeMap& attributes) +void HlslParseContext::handleEntryPointAttributes(const TSourceLoc& loc, const TAttributes& attributes) { - // Handle entry-point function attributes - const TIntermAggregate* numThreads = attributes[EatNumThreads]; - if (numThreads != nullptr) { - const TIntermSequence& sequence = numThreads->getSequence(); - - for (int lid = 0; lid < int(sequence.size()); ++lid) - intermediate.setLocalSize(lid, sequence[lid]->getAsConstantUnion()->getConstArray()[0].getIConst()); - } - - // MaxVertexCount - if (attributes.contains(EatMaxVertexCount)) { - int maxVertexCount; - - if (! attributes.getInt(EatMaxVertexCount, maxVertexCount)) { - error(loc, "invalid maxvertexcount", "", ""); - } else { - if (! intermediate.setVertices(maxVertexCount)) - error(loc, "cannot change previously set maxvertexcount attribute", "", ""); - } - } - - // Handle [patchconstantfunction("...")] - if (attributes.contains(EatPatchConstantFunc)) { - TString pcfName; - if (! attributes.getString(EatPatchConstantFunc, pcfName, 0, false)) { - error(loc, "invalid patch constant function", "", ""); - } else { - patchConstantFunctionName = pcfName; + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + switch (it->name) { + case EatNumThreads: + { + const TIntermSequence& sequence = it->args->getSequence(); + for (int lid = 0; lid < int(sequence.size()); ++lid) + intermediate.setLocalSize(lid, sequence[lid]->getAsConstantUnion()->getConstArray()[0].getIConst()); + break; } - } - - // Handle [domain("...")] - if (attributes.contains(EatDomain)) { - TString domainStr; - if (! attributes.getString(EatDomain, domainStr)) { - error(loc, "invalid domain", "", ""); - } else { - TLayoutGeometry domain = ElgNone; + case EatMaxVertexCount: + { + int maxVertexCount; - if (domainStr == "tri") { - domain = ElgTriangles; - } else if (domainStr == "quad") { - domain = ElgQuads; - } else if (domainStr == "isoline") { - domain = ElgIsolines; + if (! it->getInt(maxVertexCount)) { + error(loc, "invalid maxvertexcount", "", ""); } else { - error(loc, "unsupported domain type", domainStr.c_str(), ""); + if (! intermediate.setVertices(maxVertexCount)) + error(loc, "cannot change previously set maxvertexcount attribute", "", ""); } - - if (language == EShLangTessEvaluation) { - if (! intermediate.setInputPrimitive(domain)) - error(loc, "cannot change previously set domain", TQualifier::getGeometryString(domain), ""); + break; + } + case EatPatchConstantFunc: + { + TString pcfName; + if (! it->getString(pcfName, 0, false)) { + error(loc, "invalid patch constant function", "", ""); } else { - if (! intermediate.setOutputPrimitive(domain)) - error(loc, "cannot change previously set domain", TQualifier::getGeometryString(domain), ""); + patchConstantFunctionName = pcfName; } + break; } - } + case EatDomain: + { + // Handle [domain("...")] + TString domainStr; + if (! it->getString(domainStr)) { + error(loc, "invalid domain", "", ""); + } else { + TLayoutGeometry domain = ElgNone; - // Handle [outputtopology("...")] - if (attributes.contains(EatOutputTopology)) { - TString topologyStr; - if (! attributes.getString(EatOutputTopology, topologyStr)) { - error(loc, "invalid outputtopology", "", ""); - } else { - TVertexOrder vertexOrder = EvoNone; - TLayoutGeometry primitive = ElgNone; + if (domainStr == "tri") { + domain = ElgTriangles; + } else if (domainStr == "quad") { + domain = ElgQuads; + } else if (domainStr == "isoline") { + domain = ElgIsolines; + } else { + error(loc, "unsupported domain type", domainStr.c_str(), ""); + } - if (topologyStr == "point") { - intermediate.setPointMode(); - } else if (topologyStr == "line") { - primitive = ElgIsolines; - } else if (topologyStr == "triangle_cw") { - vertexOrder = EvoCw; - primitive = ElgTriangles; - } else if (topologyStr == "triangle_ccw") { - vertexOrder = EvoCcw; - primitive = ElgTriangles; - } else { - error(loc, "unsupported outputtopology type", topologyStr.c_str(), ""); + if (language == EShLangTessEvaluation) { + if (! intermediate.setInputPrimitive(domain)) + error(loc, "cannot change previously set domain", TQualifier::getGeometryString(domain), ""); + } else { + if (! intermediate.setOutputPrimitive(domain)) + error(loc, "cannot change previously set domain", TQualifier::getGeometryString(domain), ""); + } } + break; + } + case EatOutputTopology: + { + // Handle [outputtopology("...")] + TString topologyStr; + if (! it->getString(topologyStr)) { + error(loc, "invalid outputtopology", "", ""); + } else { + TVertexOrder vertexOrder = EvoNone; + TLayoutGeometry primitive = ElgNone; - if (vertexOrder != EvoNone) { - if (! intermediate.setVertexOrder(vertexOrder)) { - error(loc, "cannot change previously set outputtopology", - TQualifier::getVertexOrderString(vertexOrder), ""); + if (topologyStr == "point") { + intermediate.setPointMode(); + } else if (topologyStr == "line") { + primitive = ElgIsolines; + } else if (topologyStr == "triangle_cw") { + vertexOrder = EvoCw; + primitive = ElgTriangles; + } else if (topologyStr == "triangle_ccw") { + vertexOrder = EvoCcw; + primitive = ElgTriangles; + } else { + error(loc, "unsupported outputtopology type", topologyStr.c_str(), ""); + } + + if (vertexOrder != EvoNone) { + if (! intermediate.setVertexOrder(vertexOrder)) { + error(loc, "cannot change previously set outputtopology", + TQualifier::getVertexOrderString(vertexOrder), ""); + } } + if (primitive != ElgNone) + intermediate.setOutputPrimitive(primitive); } - if (primitive != ElgNone) - intermediate.setOutputPrimitive(primitive); + break; } - } - - // Handle [partitioning("...")] - if (attributes.contains(EatPartitioning)) { - TString partitionStr; - if (! attributes.getString(EatPartitioning, partitionStr)) { - error(loc, "invalid partitioning", "", ""); - } else { - TVertexSpacing partitioning = EvsNone; - - if (partitionStr == "integer") { - partitioning = EvsEqual; - } else if (partitionStr == "fractional_even") { - partitioning = EvsFractionalEven; - } else if (partitionStr == "fractional_odd") { - partitioning = EvsFractionalOdd; - //} else if (partition == "pow2") { // TODO: currently nothing to map this to. + case EatPartitioning: + { + // Handle [partitioning("...")] + TString partitionStr; + if (! it->getString(partitionStr)) { + error(loc, "invalid partitioning", "", ""); } else { - error(loc, "unsupported partitioning type", partitionStr.c_str(), ""); - } + TVertexSpacing partitioning = EvsNone; + + if (partitionStr == "integer") { + partitioning = EvsEqual; + } else if (partitionStr == "fractional_even") { + partitioning = EvsFractionalEven; + } else if (partitionStr == "fractional_odd") { + partitioning = EvsFractionalOdd; + //} else if (partition == "pow2") { // TODO: currently nothing to map this to. + } else { + error(loc, "unsupported partitioning type", partitionStr.c_str(), ""); + } - if (! intermediate.setVertexSpacing(partitioning)) - error(loc, "cannot change previously set partitioning", - TQualifier::getVertexSpacingString(partitioning), ""); + if (! intermediate.setVertexSpacing(partitioning)) + error(loc, "cannot change previously set partitioning", + TQualifier::getVertexSpacingString(partitioning), ""); + } + break; } - } - - // Handle [outputcontrolpoints("...")] - if (attributes.contains(EatOutputControlPoints)) { - int ctrlPoints; - if (! attributes.getInt(EatOutputControlPoints, ctrlPoints)) { - error(loc, "invalid outputcontrolpoints", "", ""); - } else { - if (! intermediate.setVertices(ctrlPoints)) { - error(loc, "cannot change previously set outputcontrolpoints attribute", "", ""); + case EatOutputControlPoints: + { + // Handle [outputcontrolpoints("...")] + int ctrlPoints; + if (! it->getInt(ctrlPoints)) { + error(loc, "invalid outputcontrolpoints", "", ""); + } else { + if (! intermediate.setVertices(ctrlPoints)) { + error(loc, "cannot change previously set outputcontrolpoints attribute", "", ""); + } } + break; + } + case EatBuiltIn: + case EatLocation: + // tolerate these because of dual use of entrypoint and type attributes + break; + default: + warn(loc, "attribute does not apply to entry point", "", ""); + break; } } } // Update the given type with any type-like attribute information in the // attributes. -void HlslParseContext::transferTypeAttributes(const TAttributeMap& attributes, TType& type) +void HlslParseContext::transferTypeAttributes(const TSourceLoc& loc, const TAttributes& attributes, TType& type, + bool allowEntry) { - // location - int value; - if (attributes.getInt(EatLocation, value)) - type.getQualifier().layoutLocation = value; + if (attributes.size() == 0) + return; - // binding - if (attributes.getInt(EatBinding, value)) { - type.getQualifier().layoutBinding = value; - type.getQualifier().layoutSet = 0; - } - - // set - if (attributes.getInt(EatBinding, value, 1)) - type.getQualifier().layoutSet = value; - - // global cbuffer binding - if (attributes.getInt(EatGlobalBinding, value)) - globalUniformBinding = value; - - // global cbuffer binding - if (attributes.getInt(EatGlobalBinding, value, 1)) - globalUniformSet = value; - - // input attachment - if (attributes.getInt(EatInputAttachment, value)) - type.getQualifier().layoutAttachment = value; + int value; + TString builtInString; + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + switch (it->name) { + case EatLocation: + // location + if (it->getInt(value)) + type.getQualifier().layoutLocation = value; + break; + case EatBinding: + // binding + if (it->getInt(value)) { + type.getQualifier().layoutBinding = value; + type.getQualifier().layoutSet = 0; + } + // set + if (it->getInt(value, 1)) + type.getQualifier().layoutSet = value; + break; + case EatGlobalBinding: + // global cbuffer binding + if (it->getInt(value)) + globalUniformBinding = value; + // global cbuffer binding + if (it->getInt(value, 1)) + globalUniformSet = value; + break; + case EatInputAttachment: + // input attachment + if (it->getInt(value)) + type.getQualifier().layoutAttachment = value; + break; + case EatBuiltIn: + // PointSize built-in + if (it->getString(builtInString, 0, false)) { + if (builtInString == "PointSize") + type.getQualifier().builtIn = EbvPointSize; + } + break; + case EatPushConstant: + // push_constant + type.getQualifier().layoutPushConstant = true; + break; + case EatConstantId: + // specialization constant + if (it->getInt(value)) { + TSourceLoc loc; + loc.init(); + setSpecConstantId(loc, type.getQualifier(), value); + } + break; + default: + if (! allowEntry) + warn(loc, "attribute does not apply to a type", "", ""); + break; + } + } } // @@ -1915,7 +1975,7 @@ // a subtree that creates the entry point. // TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunction& userFunction, - const TAttributeMap& attributes) + const TAttributes& attributes) { // Return true if this is a tessellation patch constant function input to a domain shader. const auto isDsPcfInput = [this](const TType& type) { @@ -2215,9 +2275,9 @@ outputType.shallowCopy(function.getType()); // vertices has necessarily already been set when handling entry point attributes. - TArraySizes arraySizes; - arraySizes.addInnerSize(intermediate.getVertices()); - outputType.newArraySizes(arraySizes); + TArraySizes* arraySizes = new TArraySizes; + arraySizes->addInnerSize(intermediate.getVertices()); + outputType.transferArraySizes(arraySizes); clearUniformInputOutput(function.getWritableType().getQualifier()); returnValue = makeIoVariable("@entryPointOutput", outputType, EvqVaryingOut); @@ -2291,6 +2351,63 @@ arguments = newArg; } +// Position may require special handling: we can optionally invert Y. +// See: https://github.com/KhronosGroup/glslang/issues/1173 +// https://github.com/KhronosGroup/glslang/issues/494 +TIntermTyped* HlslParseContext::assignPosition(const TSourceLoc& loc, TOperator op, + TIntermTyped* left, TIntermTyped* right) +{ + // If we are not asked for Y inversion, use a plain old assign. + if (!intermediate.getInvertY()) + return intermediate.addAssign(op, left, right, loc); + + // If we get here, we should invert Y. + TIntermAggregate* assignList = nullptr; + + // If this is a complex rvalue, we don't want to dereference it many times. Create a temporary. + TVariable* rhsTempVar = nullptr; + rhsTempVar = makeInternalVariable("@position", right->getType()); + rhsTempVar->getWritableType().getQualifier().makeTemporary(); + + { + TIntermTyped* rhsTempSym = intermediate.addSymbol(*rhsTempVar, loc); + assignList = intermediate.growAggregate(assignList, + intermediate.addAssign(EOpAssign, rhsTempSym, right, loc), loc); + } + + // pos.y = -pos.y + { + const int Y = 1; + + TIntermTyped* tempSymL = intermediate.addSymbol(*rhsTempVar, loc); + TIntermTyped* tempSymR = intermediate.addSymbol(*rhsTempVar, loc); + TIntermTyped* index = intermediate.addConstantUnion(Y, loc); + + TIntermTyped* lhsElement = intermediate.addIndex(EOpIndexDirect, tempSymL, index, loc); + TIntermTyped* rhsElement = intermediate.addIndex(EOpIndexDirect, tempSymR, index, loc); + + const TType derefType(right->getType(), 0); + + lhsElement->setType(derefType); + rhsElement->setType(derefType); + + TIntermTyped* yNeg = intermediate.addUnaryMath(EOpNegative, rhsElement, loc); + + assignList = intermediate.growAggregate(assignList, intermediate.addAssign(EOpAssign, lhsElement, yNeg, loc)); + } + + // Assign the rhs temp (now with Y inversion) to the final output + { + TIntermTyped* rhsTempSym = intermediate.addSymbol(*rhsTempVar, loc); + assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, left, rhsTempSym, loc)); + } + + assert(assignList != nullptr); + assignList->setOperator(EOpSequence); + + return assignList; +} + // Clip and cull distance require special handling due to a semantic mismatch. In HLSL, // these can be float scalar, float vector, or arrays of float scalar or float vector. // In SPIR-V, they are arrays of scalar floats in all cases. We must copy individual components @@ -2397,11 +2514,11 @@ clipCullType.getQualifier() = clipCullNode->getType().getQualifier(); // Create required array dimension - TArraySizes arraySizes; + TArraySizes* arraySizes = new TArraySizes; if (isImplicitlyArrayed) - arraySizes.addInnerSize(requiredOuterArraySize); - arraySizes.addInnerSize(requiredInnerArraySize); - clipCullType.newArraySizes(arraySizes); + arraySizes->addInnerSize(requiredOuterArraySize); + arraySizes->addInnerSize(requiredInnerArraySize); + clipCullType.transferArraySizes(arraySizes); // Obtain symbol name: we'll use that for the symbol we introduce. TIntermSymbol* sym = clipCullNode->getAsSymbolNode(); @@ -2556,6 +2673,12 @@ wasSplit(binaryNode->getLeft()); }; + // Return true if this stage assigns clip position with potentially inverted Y + const auto assignsClipPos = [this](const TIntermTyped* node) -> bool { + return node->getType().getQualifier().builtIn == EbvPosition && + (language == EShLangVertex || language == EShLangGeometry || language == EShLangTessEvaluation); + }; + const bool isSplitLeft = wasSplit(left) || indexesSplit(left); const bool isSplitRight = wasSplit(right) || indexesSplit(right); @@ -2571,6 +2694,9 @@ const int semanticId = (isOutput ? left : right)->getType().getQualifier().layoutLocation; return assignClipCullDistance(loc, op, semanticId, left, right); + } else if (assignsClipPos(left)) { + // Position can require special handling: see comment above assignPosition + return assignPosition(loc, op, left, right); } return intermediate.addAssign(op, left, right, loc); @@ -2655,13 +2781,23 @@ // copy from interstage IO built-in if needed subTree = intermediate.addSymbol(*builtInVar); - // Arrayness of builtIn symbols isn't handled by the normal recursion: - // it's been extracted and moved to the built-in. - if (subTree->getType().isArray() && !arrayElement.empty()) { - const TType splitDerefType(subTree->getType(), arrayElement.back()); - subTree = intermediate.addIndex(EOpIndexDirect, subTree, - intermediate.addConstantUnion(arrayElement.back(), loc), loc); - subTree->setType(splitDerefType); + if (subTree->getType().isArray()) { + // Arrayness of builtIn symbols isn't handled by the normal recursion: + // it's been extracted and moved to the built-in. + if (!arrayElement.empty()) { + const TType splitDerefType(subTree->getType(), arrayElement.back()); + subTree = intermediate.addIndex(EOpIndexDirect, subTree, + intermediate.addConstantUnion(arrayElement.back(), loc), loc); + subTree->setType(splitDerefType); + } else if (splitNode->getAsOperator() != nullptr && (splitNode->getAsOperator()->getOp() == EOpIndexIndirect)) { + // This might also be a stage with arrayed outputs, in which case there's an index + // operation we should transfer to the output builtin. + + const TType splitDerefType(subTree->getType(), 0); + subTree = intermediate.addIndex(splitNode->getAsOperator()->getOp(), subTree, + splitNode->getAsBinaryNode()->getRight(), loc); + subTree->setType(splitDerefType); + } } } else if (flattened && !shouldFlatten(derefType, isLeft ? leftStorage : rightStorage, false)) { if (isLeft) @@ -2782,7 +2918,10 @@ subSplitLeft, subSplitRight); assignList = intermediate.growAggregate(assignList, clipCullAssign, loc); - + } else if (assignsClipPos(subSplitLeft)) { + // Position can require special handling: see comment above assignPosition + TIntermTyped* positionAssign = assignPosition(loc, op, subSplitLeft, subSplitRight); + assignList = intermediate.growAggregate(assignList, positionAssign, loc); } else if (!shouldFlattenSubsetLeft && !shouldFlattenSubsetRight && !typeL.containsBuiltIn() && !typeR.containsBuiltIn()) { // If this is the final flattening (no nested types below to flatten) @@ -3025,8 +3164,8 @@ void HlslParseContext::counterBufferType(const TSourceLoc& loc, TType& type) { // Counter type - TType* counterType = new TType(EbtInt, EvqBuffer); - counterType->setFieldName("@count"); + TType* counterType = new TType(EbtUint, EvqBuffer); + counterType->setFieldName(intermediate.implicitCounterName); TTypeList* blockStruct = new TTypeList; TTypeLoc member = { counterType, loc }; @@ -3039,12 +3178,6 @@ shareStructBufferType(type); } -// knowledge of how to construct block name, in one place instead of N places. -TString HlslParseContext::getStructBuffCounterName(const TString& blockName) const -{ - return blockName + "@count"; -} - // declare counter for a structured buffer type void HlslParseContext::declareStructBufferCounter(const TSourceLoc& loc, const TType& bufferType, const TString& name) { @@ -3058,9 +3191,9 @@ TType blockType; counterBufferType(loc, blockType); - TString* blockName = new TString(getStructBuffCounterName(name)); + TString* blockName = new TString(intermediate.addCounterBufferName(name)); - // Counter buffer does not have its own counter buffer. TODO: there should be a better way to track this. + // Counter buffer is not yet in use structBufferCounter[*blockName] = false; shareStructBufferType(blockType); @@ -3074,7 +3207,7 @@ if (buffer == nullptr || ! isStructBufferType(buffer->getType())) return nullptr; - const TString counterBlockName(getStructBuffCounterName(buffer->getAsSymbolNode()->getName())); + const TString counterBlockName(intermediate.addCounterBufferName(buffer->getAsSymbolNode()->getName())); // Mark the counter as being used structBufferCounter[counterBlockName] = true; @@ -3083,11 +3216,10 @@ TIntermTyped* index = intermediate.addConstantUnion(0, loc); // index to counter inside block struct TIntermTyped* counterMember = intermediate.addIndex(EOpIndexDirectStruct, counterVar, index, loc); - counterMember->setType(TType(EbtInt)); + counterMember->setType(TType(EbtUint)); return counterMember; } - // // Decompose structure buffer methods into AST // @@ -3117,7 +3249,7 @@ // Some methods require a hidden internal counter, obtained via getStructBufferCounter(). // This lambda adds something to it and returns the old value. const auto incDecCounter = [&](int incval) -> TIntermTyped* { - TIntermTyped* incrementValue = intermediate.addConstantUnion(incval, loc, true); + TIntermTyped* incrementValue = intermediate.addConstantUnion(static_cast(incval), loc, true); TIntermTyped* counter = getStructBufferCounter(loc, bufferObj); // obtain the counter member if (counter == nullptr) @@ -3213,7 +3345,13 @@ const TOperator idxOp = (offsetIdx->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect; - vec = intermediate.growAggregate(vec, intermediate.addIndex(idxOp, argArray, offsetIdx, loc)); + TIntermTyped* indexVal = intermediate.addIndex(idxOp, argArray, offsetIdx, loc); + + TType derefType(argArray->getType(), 0); + derefType.getQualifier().makeTemporary(); + indexVal->setType(derefType); + + vec = intermediate.growAggregate(vec, indexVal); } vec->setType(TType(argArray->getBasicType(), EvqTemporary, size)); @@ -3238,7 +3376,7 @@ // Index into the array to find the item being loaded. // Byte address buffers index in bytes (only multiples of 4 permitted... not so much a byte address - // buffer then, but that's what it calls itself. + // buffer then, but that's what it calls itself). int size = 0; @@ -3274,8 +3412,17 @@ : EOpIndexIndirect; TIntermTyped* lValue = intermediate.addIndex(idxOp, argArray, offsetIdx, loc); - TIntermTyped* rValue = (size == 1) ? argValue : - intermediate.addIndex(EOpIndexDirect, argValue, idxConst, loc); + const TType derefType(argArray->getType(), 0); + lValue->setType(derefType); + + TIntermTyped* rValue; + if (size == 1) { + rValue = argValue; + } else { + rValue = intermediate.addIndex(EOpIndexDirect, argValue, idxConst, loc); + const TType indexType(argValue->getType(), 0); + rValue->setType(indexType); + } TIntermTyped* assign = intermediate.addAssign(EOpAssign, lValue, rValue, loc); @@ -3297,16 +3444,16 @@ TIntermAggregate* body = nullptr; // Length output: - if (argArray->getType().isRuntimeSizedArray()) { - TIntermTyped* lengthCall = intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, argArray, - argNumItems->getType()); - TIntermTyped* assign = intermediate.addAssign(EOpAssign, argNumItems, lengthCall, loc); - body = intermediate.growAggregate(body, assign, loc); - } else { + if (argArray->getType().isSizedArray()) { const int length = argArray->getType().getOuterArraySize(); TIntermTyped* assign = intermediate.addAssign(EOpAssign, argNumItems, intermediate.addConstantUnion(length, loc, true), loc); body = intermediate.growAggregate(body, assign, loc); + } else { + TIntermTyped* lengthCall = intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, argArray, + argNumItems->getType()); + TIntermTyped* assign = intermediate.addAssign(EOpAssign, argNumItems, lengthCall, loc); + body = intermediate.growAggregate(body, assign, loc); } // Stride output: @@ -3467,9 +3614,9 @@ TType retType(EbtFloat, EvqConst, 2); if (numSamples != 1) { - TArraySizes arraySizes; - arraySizes.addInnerSize(numSamples); - retType.newArraySizes(arraySizes); + TArraySizes* arraySizes = new TArraySizes; + arraySizes->addInnerSize(numSamples); + retType.transferArraySizes(arraySizes); } return new TIntermConstantUnion(*values, retType); @@ -4166,9 +4313,9 @@ // we construct an array from the separate args. if (hasOffset4) { TType arrayType(EbtInt, EvqTemporary, 2); - TArraySizes arraySizes; - arraySizes.addInnerSize(4); - arrayType.newArraySizes(arraySizes); + TArraySizes* arraySizes = new TArraySizes; + arraySizes->addInnerSize(4); + arrayType.transferArraySizes(arraySizes); TIntermAggregate* initList = new TIntermAggregate(EOpNull); @@ -4407,6 +4554,22 @@ return imageAggregate != nullptr && imageAggregate->getOp() == EOpImageLoad; }; + const auto lookupBuiltinVariable = [&](const char* name, TBuiltInVariable builtin, TType& type) -> TIntermTyped* { + TSymbol* symbol = symbolTable.find(name); + if (nullptr == symbol) { + type.getQualifier().builtIn = builtin; + + TVariable* variable = new TVariable(new TString(name), type); + + symbolTable.insert(*variable); + + symbol = symbolTable.find(name); + assert(symbol && "Inserted symbol could not be found!"); + } + + return intermediate.addSymbol(*(symbol->getAsVariable()), loc); + }; + // HLSL intrinsics can be pass through to native AST opcodes, or decomposed here to existing AST // opcodes for compatibility with existing software stacks. static const bool decomposeHlslIntrinsics = true; @@ -4652,6 +4815,7 @@ } else { // Set the matching operator. Since output is absent, this is all we need to do. node->getAsAggregate()->setOperator(atomicOp); + node->setType(atomic->getType()); } } @@ -4963,7 +5127,65 @@ break; } - + case EOpWaveGetLaneCount: + { + // Mapped to gl_SubgroupSize builtin (We preprend @ to the symbol + // so that it inhabits the symbol table, but has a user-invalid name + // in-case some source HLSL defined the symbol also). + TType type(EbtUint, EvqVaryingIn); + node = lookupBuiltinVariable("@gl_SubgroupSize", EbvSubgroupSize2, type); + break; + } + case EOpWaveGetLaneIndex: + { + // Mapped to gl_SubgroupInvocationID builtin (We preprend @ to the + // symbol so that it inhabits the symbol table, but has a + // user-invalid name in-case some source HLSL defined the symbol + // also). + TType type(EbtUint, EvqVaryingIn); + node = lookupBuiltinVariable("@gl_SubgroupInvocationID", EbvSubgroupInvocation2, type); + break; + } + case EOpWaveActiveCountBits: + { + // Mapped to subgroupBallotBitCount(subgroupBallot()) builtin + + // uvec4 type. + TType uvec4Type(EbtUint, EvqTemporary, 4); + + // Get the uvec4 return from subgroupBallot(). + TIntermTyped* res = intermediate.addBuiltInFunctionCall(loc, + EOpSubgroupBallot, true, arguments, uvec4Type); + + // uint type. + TType uintType(EbtUint, EvqTemporary); + + node = intermediate.addBuiltInFunctionCall(loc, + EOpSubgroupBallotBitCount, true, res, uintType); + + break; + } + case EOpWavePrefixCountBits: + { + // Mapped to subgroupBallotInclusiveBitCount(subgroupBallot()) + // builtin + + // uvec4 type. + TType uvec4Type(EbtUint, EvqTemporary, 4); + + // Get the uvec4 return from subgroupBallot(). + TIntermTyped* res = intermediate.addBuiltInFunctionCall(loc, + EOpSubgroupBallot, true, arguments, uvec4Type); + + // uint type. + TType uintType(EbtUint, EvqTemporary); + + node = intermediate.addBuiltInFunctionCall(loc, + EOpSubgroupBallotInclusiveBitCount, true, res, uintType); + + break; + } + default: break; // most pass through unchanged } @@ -5008,6 +5230,12 @@ bool builtIn = false; int thisDepth = 0; + // For mat mul, the situation is unusual: we have to compare vector sizes to mat row or col sizes, + // and clamp the opposite arg. Since that's complex, we farm it off to a separate method. + // It doesn't naturally fall out of processing an argument at a time in isolation. + if (function->getName() == "mul") + addGenMulArgumentConversion(loc, *function, arguments); + TIntermAggregate* aggregate = arguments ? arguments->getAsAggregate() : nullptr; // TODO: this needs improvement: there's no way at present to look up a signature in @@ -5170,6 +5398,83 @@ } // +// HLSL allows mismatched dimensions on vec*mat, mat*vec, vec*vec, and mat*mat. This is a +// situation not well suited to resolution in intrinsic selection, but we can do so here, since we +// can look at both arguments insert explicit shape changes if required. +// +void HlslParseContext::addGenMulArgumentConversion(const TSourceLoc& loc, TFunction& call, TIntermTyped*& args) +{ + TIntermAggregate* argAggregate = args ? args->getAsAggregate() : nullptr; + + if (argAggregate == nullptr || argAggregate->getSequence().size() != 2) { + // It really ought to have two arguments. + error(loc, "expected: mul arguments", "", ""); + return; + } + + TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped(); + TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped(); + + if (arg0->isVector() && arg1->isVector()) { + // For: + // vec * vec: it's handled during intrinsic selection, so while we could do it here, + // we can also ignore it, which is easier. + } else if (arg0->isVector() && arg1->isMatrix()) { + // vec * mat: we clamp the vec if the mat col is smaller, else clamp the mat col. + if (arg0->getVectorSize() < arg1->getMatrixCols()) { + // vec is smaller, so truncate larger mat dimension + const TType truncType(arg1->getBasicType(), arg1->getQualifier().storage, arg1->getQualifier().precision, + 0, arg0->getVectorSize(), arg1->getMatrixRows()); + arg1 = addConstructor(loc, arg1, truncType); + } else if (arg0->getVectorSize() > arg1->getMatrixCols()) { + // vec is larger, so truncate vec to mat size + const TType truncType(arg0->getBasicType(), arg0->getQualifier().storage, arg0->getQualifier().precision, + arg1->getMatrixCols()); + arg0 = addConstructor(loc, arg0, truncType); + } + } else if (arg0->isMatrix() && arg1->isVector()) { + // mat * vec: we clamp the vec if the mat col is smaller, else clamp the mat col. + if (arg1->getVectorSize() < arg0->getMatrixRows()) { + // vec is smaller, so truncate larger mat dimension + const TType truncType(arg0->getBasicType(), arg0->getQualifier().storage, arg0->getQualifier().precision, + 0, arg0->getMatrixCols(), arg1->getVectorSize()); + arg0 = addConstructor(loc, arg0, truncType); + } else if (arg1->getVectorSize() > arg0->getMatrixRows()) { + // vec is larger, so truncate vec to mat size + const TType truncType(arg1->getBasicType(), arg1->getQualifier().storage, arg1->getQualifier().precision, + arg0->getMatrixRows()); + arg1 = addConstructor(loc, arg1, truncType); + } + } else if (arg0->isMatrix() && arg1->isMatrix()) { + // mat * mat: we clamp the smaller inner dimension to match the other matrix size. + // Remember, HLSL Mrc = GLSL/SPIRV Mcr. + if (arg0->getMatrixRows() > arg1->getMatrixCols()) { + const TType truncType(arg0->getBasicType(), arg0->getQualifier().storage, arg0->getQualifier().precision, + 0, arg0->getMatrixCols(), arg1->getMatrixCols()); + arg0 = addConstructor(loc, arg0, truncType); + } else if (arg0->getMatrixRows() < arg1->getMatrixCols()) { + const TType truncType(arg1->getBasicType(), arg1->getQualifier().storage, arg1->getQualifier().precision, + 0, arg0->getMatrixRows(), arg1->getMatrixRows()); + arg1 = addConstructor(loc, arg1, truncType); + } + } else { + // It's something with scalars: we'll just leave it alone. Function selection will handle it + // downstream. + } + + // Warn if we altered one of the arguments + if (arg0 != argAggregate->getSequence()[0] || arg1 != argAggregate->getSequence()[1]) + warn(loc, "mul() matrix size mismatch", "", ""); + + // Put arguments back. (They might be unchanged, in which case this is harmless). + argAggregate->getSequence()[0] = arg0; + argAggregate->getSequence()[1] = arg1; + + call[0].type = &arg0->getWritableType(); + call[1].type = &arg1->getWritableType(); +} + +// // Add any needed implicit conversions for function-call arguments to input parameters. // void HlslParseContext::addInputArgumentConversions(const TFunction& function, TIntermTyped*& arguments) @@ -5434,12 +5739,11 @@ TType counterType; counterBufferType(loc, counterType); - const TString counterBlockName(getStructBuffCounterName(blockSym->getName())); + const TString counterBlockName(intermediate.addCounterBufferName(blockSym->getName())); TVariable* variable = makeInternalVariable(counterBlockName, counterType); - // Mark this buffer as requiring a counter block. TODO: there should be a better - // way to track it. + // Mark this buffer's counter block as being in use structBufferCounter[counterBlockName] = true; TIntermSymbol* sym = intermediate.addSymbol(*variable, loc); @@ -5681,7 +5985,8 @@ break; } - qualifier.builtIn = builtIn; + if (qualifier.builtIn == EbvNone) + qualifier.builtIn = builtIn; qualifier.semanticName = intermediate.addSemanticName(upperCase); } @@ -5760,7 +6065,10 @@ case 'c': case 's': case 'u': - qualifier.layoutBinding = regNumber + subComponent; + // if nothing else has set the binding, do so now + // (other mechanisms override this one) + if (!qualifier.hasBinding()) + qualifier.layoutBinding = regNumber + subComponent; // This handles per-register layout sets numbers. For the global mode which sets // every symbol to the same value, see setLinkageLayoutSets(). @@ -5794,7 +6102,9 @@ return true; }; - if (spaceDesc) { + // if nothing else has set the set, do so now + // (other mechanisms override this one) + if (spaceDesc && !qualifier.hasSet()) { if (! crackSpace()) { error(loc, "expected spaceN", "register", ""); return; @@ -5988,7 +6298,7 @@ bool arrayArg = false; for (int arg = 0; arg < function.getParamCount(); ++arg) { if (function[arg].type->isArray()) { - if (! function[arg].type->isExplicitlySizedArray()) { + if (function[arg].type->isUnsizedArray()) { // Can't construct from an unsized array. error(loc, "array argument must be sized", "constructor", ""); return true; @@ -6023,11 +6333,10 @@ return true; } - if (type.isImplicitlySizedArray()) { + if (type.isUnsizedArray()) { // auto adapt the constructor type to the number of arguments type.changeOuterArraySize(function.getParamCount()); - } else if (type.getOuterArraySize() != function.getParamCount() && - type.computeNumComponents() > size) { + } else if (type.getOuterArraySize() != function.getParamCount() && type.computeNumComponents() > size) { error(loc, "array constructor needs one argument per array element", "constructor", ""); return true; } @@ -6036,21 +6345,21 @@ // Types have to match, but we're still making the type. // Finish making the type, and the comparison is done later // when checking for conversion. - TArraySizes& arraySizes = type.getArraySizes(); + TArraySizes& arraySizes = *type.getArraySizes(); // At least the dimensionalities have to match. if (! function[0].type->isArray() || - arraySizes.getNumDims() != function[0].type->getArraySizes().getNumDims() + 1) { + arraySizes.getNumDims() != function[0].type->getArraySizes()->getNumDims() + 1) { error(loc, "array constructor argument not correct type to construct array element", "constructor", ""); return true; } - if (arraySizes.isInnerImplicit()) { + if (arraySizes.isInnerUnsized()) { // "Arrays of arrays ..., and the size for any dimension is optional" // That means we need to adopt (from the first argument) the other array sizes into the type. for (int d = 1; d < arraySizes.getNumDims(); ++d) { if (arraySizes.getDimSize(d) == UnsizedArraySize) { - arraySizes.setDimSize(d, function[0].type->getArraySizes().getDimSize(d - 1)); + arraySizes.setDimSize(d, function[0].type->getArraySizes()->getDimSize(d - 1)); } } } @@ -6245,6 +6554,7 @@ MERGE_SINGLETON(readonly); MERGE_SINGLETON(writeonly); MERGE_SINGLETON(specConstant); + MERGE_SINGLETON(nonUniform); } // used to flatten the sampler type space into a single dimension @@ -6300,7 +6610,7 @@ // void HlslParseContext::arraySizeRequiredCheck(const TSourceLoc& loc, const TArraySizes& arraySizes) { - if (arraySizes.isImplicit()) + if (arraySizes.hasUnsized()) error(loc, "array size required", "", ""); } @@ -6314,20 +6624,6 @@ } } -// Merge array dimensions listed in 'sizes' onto the type's array dimensions. -// -// From the spec: "vec4[2] a[3]; // size-3 array of size-2 array of vec4" -// -// That means, the 'sizes' go in front of the 'type' as outermost sizes. -// 'type' is the type part of the declaration (to the left) -// 'sizes' is the arrayness tagged on the identifier (to the right) -// -void HlslParseContext::arrayDimMerge(TType& type, const TArraySizes* sizes) -{ - if (sizes) - type.addArrayOuterSizes(*sizes); -} - // // Do all the semantic checking for declaring or redeclaring an array, with and // without a size, and make the right changes to the symbol table. @@ -6374,7 +6670,7 @@ // redeclareBuiltinVariable() should have already done the copyUp() TType& existingType = symbol->getWritableType(); - if (existingType.isExplicitlySizedArray()) { + if (existingType.isSizedArray()) { // be more lenient for input arrays to geometry shaders and tessellation control outputs, // where the redeclaration is the same size return; @@ -6383,52 +6679,6 @@ existingType.updateArraySizes(type); } -void HlslParseContext::updateImplicitArraySize(const TSourceLoc& loc, TIntermNode *node, int index) -{ - // maybe there is nothing to do... - TIntermTyped* typedNode = node->getAsTyped(); - if (typedNode->getType().getImplicitArraySize() > index) - return; - - // something to do... - - // Figure out what symbol to lookup, as we will use its type to edit for the size change, - // as that type will be shared through shallow copies for future references. - TSymbol* symbol = nullptr; - int blockIndex = -1; - const TString* lookupName = nullptr; - if (node->getAsSymbolNode()) - lookupName = &node->getAsSymbolNode()->getName(); - else if (node->getAsBinaryNode()) { - const TIntermBinary* deref = node->getAsBinaryNode(); - // This has to be the result of a block dereference, unless it's bad shader code - // If it's a uniform block, then an error will be issued elsewhere, but - // return early now to avoid crashing later in this function. - if (! deref->getLeft()->getAsSymbolNode() || deref->getLeft()->getBasicType() != EbtBlock || - deref->getLeft()->getType().getQualifier().storage == EvqUniform || - deref->getRight()->getAsConstantUnion() == nullptr) - return; - - blockIndex = deref->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); - - lookupName = &deref->getLeft()->getAsSymbolNode()->getName(); - if (IsAnonymous(*lookupName)) - lookupName = &(*deref->getLeft()->getType().getStruct())[blockIndex].type->getFieldName(); - } - - // Lookup the symbol, should only fail if shader code is incorrect - symbol = symbolTable.find(*lookupName); - if (symbol == nullptr) - return; - - if (symbol->getAsFunction()) { - error(loc, "array variable name expected", symbol->getName().c_str(), ""); - return; - } - - symbol->getWritableType().setImplicitArraySize(index + 1); -} - // // Enforce non-initializer type/qualifier rules. // @@ -6492,7 +6742,7 @@ // TType* HlslParseContext::getStructBufferContentType(const TType& type) const { - if (type.getBasicType() != EbtBlock) + if (type.getBasicType() != EbtBlock || type.getQualifier().storage != EvqBuffer) return nullptr; const int memberCount = (int)type.getStruct()->size(); @@ -6500,7 +6750,7 @@ TType* contentType = (*type.getStruct())[memberCount-1].type; - return contentType->isRuntimeSizedArray() ? contentType : nullptr; + return contentType->isUnsizedArray() ? contentType : nullptr; } // @@ -6848,15 +7098,7 @@ return; } if (id == "constant_id") { - requireSpv(loc, "constant_id"); - if (value >= (int)TQualifier::layoutSpecConstantIdEnd) { - error(loc, "specialization-constant id is too large", id.c_str(), ""); - } else { - qualifier.layoutSpecConstantId = value; - qualifier.specConstant = true; - if (! intermediate.addUsedConstantId(value)) - error(loc, "specialization-constant id already used", id.c_str(), ""); - } + setSpecConstantId(loc, qualifier, value); return; } @@ -6951,6 +7193,19 @@ error(loc, "there is no such layout identifier for this stage taking an assigned value", id.c_str(), ""); } +void HlslParseContext::setSpecConstantId(const TSourceLoc& loc, TQualifier& qualifier, int value) +{ + if (value >= (int)TQualifier::layoutSpecConstantIdEnd) { + error(loc, "specialization-constant id is too large", "constant_id", ""); + } else { + qualifier.layoutSpecConstantId = value; + qualifier.specConstant = true; + if (! intermediate.addUsedConstantId(value)) + error(loc, "specialization-constant id already used", "constant_id", ""); + } + return; +} + // Merge any layout qualifier information from src into dst, leaving everything else in dst alone // // "More than one layout qualifier may appear in a single declaration. @@ -7015,6 +7270,7 @@ } } + // // Look up a function name in the symbol table, and make sure it is a function. // @@ -7199,8 +7455,8 @@ } }; - return std::abs(linearize(to2.getBasicType()) - linearize(from.getBasicType())) < - std::abs(linearize(to1.getBasicType()) - linearize(from.getBasicType())); + return abs(linearize(to2.getBasicType()) - linearize(from.getBasicType())) < + abs(linearize(to1.getBasicType()) - linearize(from.getBasicType())); }; // for ambiguity reporting @@ -7623,8 +7879,7 @@ } // Fix outer arrayness if variable is unsized, getting size from the initializer - if (initializer->getType().isExplicitlySizedArray() && - variable->getType().isImplicitlySizedArray()) + if (initializer->getType().isSizedArray() && variable->getType().isUnsizedArray()) variable->getWritableType().changeOuterArraySize(initializer->getType().getOuterArraySize()); // Inner arrayness can also get set by an initializer @@ -7633,8 +7888,10 @@ variable->getType().getArraySizes()->getNumDims()) { // adopt unsized sizes from the initializer's sizes for (int d = 1; d < variable->getType().getArraySizes()->getNumDims(); ++d) { - if (variable->getType().getArraySizes()->getDimSize(d) == UnsizedArraySize) - variable->getWritableType().getArraySizes().setDimSize(d, initializer->getType().getArraySizes()->getDimSize(d)); + if (variable->getType().getArraySizes()->getDimSize(d) == UnsizedArraySize) { + variable->getWritableType().getArraySizes()->setDimSize(d, + initializer->getType().getArraySizes()->getDimSize(d)); + } } } @@ -7721,20 +7978,20 @@ // Later on, initializer execution code will deal with array size logic. TType arrayType; arrayType.shallowCopy(type); // sharing struct stuff is fine - arrayType.newArraySizes(*type.getArraySizes()); // but get a fresh copy of the array information, to edit below + arrayType.copyArraySizes(*type.getArraySizes()); // but get a fresh copy of the array information, to edit below // edit array sizes to fill in unsized dimensions - if (type.isImplicitlySizedArray()) + if (type.isUnsizedArray()) arrayType.changeOuterArraySize((int)initList->getSequence().size()); // set unsized array dimensions that can be derived from the initializer's first element if (arrayType.isArrayOfArrays() && initList->getSequence().size() > 0) { TIntermTyped* firstInit = initList->getSequence()[0]->getAsTyped(); if (firstInit->getType().isArray() && - arrayType.getArraySizes().getNumDims() == firstInit->getType().getArraySizes()->getNumDims() + 1) { - for (int d = 1; d < arrayType.getArraySizes().getNumDims(); ++d) { - if (arrayType.getArraySizes().getDimSize(d) == UnsizedArraySize) - arrayType.getArraySizes().setDimSize(d, firstInit->getType().getArraySizes()->getDimSize(d - 1)); + arrayType.getArraySizes()->getNumDims() == firstInit->getType().getArraySizes()->getNumDims() + 1) { + for (int d = 1; d < arrayType.getArraySizes()->getNumDims(); ++d) { + if (arrayType.getArraySizes()->getDimSize(d) == UnsizedArraySize) + arrayType.getArraySizes()->setDimSize(d, firstInit->getType().getArraySizes()->getDimSize(d - 1)); } } } @@ -7999,6 +8256,22 @@ // First, convert types as needed. // switch (op) { + case EOpConstructF16Vec2: + case EOpConstructF16Vec3: + case EOpConstructF16Vec4: + case EOpConstructF16Mat2x2: + case EOpConstructF16Mat2x3: + case EOpConstructF16Mat2x4: + case EOpConstructF16Mat3x2: + case EOpConstructF16Mat3x3: + case EOpConstructF16Mat3x4: + case EOpConstructF16Mat4x2: + case EOpConstructF16Mat4x3: + case EOpConstructF16Mat4x4: + case EOpConstructFloat16: + basicOp = EOpConstructFloat16; + break; + case EOpConstructVec2: case EOpConstructVec3: case EOpConstructVec4: @@ -8031,6 +8304,13 @@ basicOp = EOpConstructDouble; break; + case EOpConstructI16Vec2: + case EOpConstructI16Vec3: + case EOpConstructI16Vec4: + case EOpConstructInt16: + basicOp = EOpConstructInt16; + break; + case EOpConstructIVec2: case EOpConstructIVec3: case EOpConstructIVec4: @@ -8047,6 +8327,13 @@ basicOp = EOpConstructInt; break; + case EOpConstructU16Vec2: + case EOpConstructU16Vec3: + case EOpConstructU16Vec4: + case EOpConstructUint16: + basicOp = EOpConstructUint16; + break; + case EOpConstructUVec2: case EOpConstructUVec3: case EOpConstructUVec4: @@ -8196,7 +8483,7 @@ // // Do everything needed to add an interface block. // -void HlslParseContext::declareBlock(const TSourceLoc& loc, TType& type, const TString* instanceName, TArraySizes* arraySizes) +void HlslParseContext::declareBlock(const TSourceLoc& loc, TType& type, const TString* instanceName) { assert(type.getWritableStruct() != nullptr); @@ -8324,8 +8611,8 @@ const TString& interfaceName = (instanceName && !instanceName->empty()) ? *instanceName : type.getTypeName(); TType blockType(&typeList, interfaceName, type.getQualifier()); - if (arraySizes) - blockType.newArraySizes(*arraySizes); + if (type.isArray()) + blockType.transferArraySizes(type.getArraySizes()); // Add the variable, as anonymous or named instanceName. // Make an anonymous variable if no name was provided. @@ -8343,7 +8630,7 @@ return; } - // Save it in the AST for linker use. + // Save it in the AST for linker use. if (symbolTable.atGlobalLevel()) trackLinkage(variable); } @@ -8386,7 +8673,7 @@ memberQualifier.layoutComponent = 0; } nextLocation = memberQualifier.layoutLocation + - intermediate.computeTypeLocationSize(*typeList[member].type); + intermediate.computeTypeLocationSize(*typeList[member].type, language); } } } @@ -8559,6 +8846,11 @@ // bool HlslParseContext::handleOutputGeometry(const TSourceLoc& loc, const TLayoutGeometry& geometry) { + // If this is not a geometry shader, ignore. It might be a mixed shader including several stages. + // Since that's an OK situation, return true for success. + if (language != EShLangGeometry) + return true; + switch (geometry) { case ElgPoints: case ElgLineStrip: @@ -8577,29 +8869,75 @@ } // -// Selection hints +// Selection attributes // -TSelectionControl HlslParseContext::handleSelectionControl(const TAttributeMap& attributes) const +void HlslParseContext::handleSelectionAttributes(const TSourceLoc& loc, TIntermSelection* selection, + const TAttributes& attributes) { - if (attributes.contains(EatFlatten)) - return ESelectionControlFlatten; - else if (attributes.contains(EatBranch)) - return ESelectionControlDontFlatten; - else - return ESelectionControlNone; + if (selection == nullptr) + return; + + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + switch (it->name) { + case EatFlatten: + selection->setFlatten(); + break; + case EatBranch: + selection->setDontFlatten(); + break; + default: + warn(loc, "attribute does not apply to a selection", "", ""); + break; + } + } } // -// Loop hints +// Switch attributes // -TLoopControl HlslParseContext::handleLoopControl(const TAttributeMap& attributes) const +void HlslParseContext::handleSwitchAttributes(const TSourceLoc& loc, TIntermSwitch* selection, + const TAttributes& attributes) { - if (attributes.contains(EatUnroll)) - return ELoopControlUnroll; - else if (attributes.contains(EatLoop)) - return ELoopControlDontUnroll; - else - return ELoopControlNone; + if (selection == nullptr) + return; + + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + switch (it->name) { + case EatFlatten: + selection->setFlatten(); + break; + case EatBranch: + selection->setDontFlatten(); + break; + default: + warn(loc, "attribute does not apply to a switch", "", ""); + break; + } + } +} + +// +// Loop attributes +// +void HlslParseContext::handleLoopAttributes(const TSourceLoc& loc, TIntermLoop* loop, + const TAttributes& attributes) +{ + if (loop == nullptr) + return; + + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + switch (it->name) { + case EatUnroll: + loop->setUnroll(); + break; + case EatLoop: + loop->setDontUnroll(); + break; + default: + warn(loc, "attribute does not apply to a loop", "", ""); + break; + } + } } // @@ -8744,7 +9082,7 @@ // into a switch node. // TIntermNode* HlslParseContext::addSwitch(const TSourceLoc& loc, TIntermTyped* expression, - TIntermAggregate* lastStatements, TSelectionControl control) + TIntermAggregate* lastStatements, const TAttributes& attributes) { wrapupSwitchSubsequence(lastStatements, nullptr); @@ -8771,7 +9109,7 @@ TIntermSwitch* switchNode = new TIntermSwitch(expression, body); switchNode->setLoc(loc); - switchNode->setSelectionControl(control); + handleSwitchAttributes(loc, switchNode, attributes); return switchNode; } @@ -8893,7 +9231,7 @@ case EbvVertexIndex: return language == EShLangVertex; case EbvPrimitiveId: - return language == EShLangGeometry || language == EShLangFragment; + return language == EShLangGeometry || language == EShLangFragment || language == EShLangTessControl; case EbvTessLevelInner: case EbvTessLevelOuter: return language == EShLangTessEvaluation; @@ -8939,9 +9277,9 @@ return language == EShLangFragment; case EbvLayer: case EbvViewportIndex: - return language == EShLangGeometry; + return language == EShLangGeometry || language == EShLangVertex; case EbvPrimitiveId: - return language == EShLangGeometry || language == EShLangTessControl || language == EShLangTessEvaluation; + return language == EShLangGeometry; case EbvTessLevelInner: case EbvTessLevelOuter: return language == EShLangTessControl; @@ -9005,11 +9343,17 @@ qualifier.patch = false; switch (qualifier.builtIn) { + case EbvFragDepth: + intermediate.setDepthReplacing(); + intermediate.setDepth(EldAny); + break; case EbvFragDepthGreater: + intermediate.setDepthReplacing(); intermediate.setDepth(EldGreater); qualifier.builtIn = EbvFragDepth; break; case EbvFragDepthLesser: + intermediate.setDepthReplacing(); intermediate.setDepth(EldLess); qualifier.builtIn = EbvFragDepth; break; @@ -9239,7 +9583,7 @@ const TType& type = *patchConstantFunction[param].type; const TBuiltInVariable biType = patchConstantFunction[param].getDeclaredBuiltIn(); - return type.isArray() && !type.isRuntimeSizedArray() && biType == EbvOutputPatch; + return type.isSizedArray() && biType == EbvOutputPatch; }; // We will perform these steps. Each is in a scoped block for separation: they could @@ -9542,7 +9886,8 @@ } // Finalization step: remove unused buffer blocks from linkage (we don't know until the -// shader is entirely compiled) +// shader is entirely compiled). +// Preserve order of remaining symbols. void HlslParseContext::removeUnusedStructBufferCounters() { const auto endIt = std::remove_if(linkageSymbols.begin(), linkageSymbols.end(), @@ -9589,7 +9934,7 @@ // Communicate out (esp. for command line) that we formed AST that will make // illegal AST SPIR-V and it needs transforms to legalize it. - if (intermediate.needsLegalization()) + if (intermediate.needsLegalization() && (messages & EShMsgHlslLegalization)) infoSink.info << "WARNING: AST will form illegal SPIR-V; need to transform to legalize"; TParseContextBase::finish(); diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/hlslParseHelper.h vulkan-1.1.73+dfsg/external/glslang/hlsl/hlslParseHelper.h --- vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/hlslParseHelper.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/hlsl/hlslParseHelper.h 2018-04-27 11:46:26.000000000 +0000 @@ -38,12 +38,12 @@ #include "../glslang/MachineIndependent/parseVersions.h" #include "../glslang/MachineIndependent/ParseHelper.h" +#include "../glslang/MachineIndependent/attribute.h" #include namespace glslang { -class TAttributeMap; // forward declare class TFunctionDeclarator; class HlslParseContext : public TParseContextBase { @@ -80,10 +80,10 @@ bool isBuiltInMethod(const TSourceLoc&, TIntermTyped* base, const TString& field); void assignToInterface(TVariable& variable); void handleFunctionDeclarator(const TSourceLoc&, TFunction& function, bool prototype); - TIntermAggregate* handleFunctionDefinition(const TSourceLoc&, TFunction&, const TAttributeMap&, TIntermNode*& entryPointTree); - TIntermNode* transformEntryPoint(const TSourceLoc&, TFunction&, const TAttributeMap&); - void handleEntryPointAttributes(const TSourceLoc&, const TAttributeMap&); - void transferTypeAttributes(const TAttributeMap&, TType&); + TIntermAggregate* handleFunctionDefinition(const TSourceLoc&, TFunction&, const TAttributes&, TIntermNode*& entryPointTree); + TIntermNode* transformEntryPoint(const TSourceLoc&, TFunction&, const TAttributes&); + void handleEntryPointAttributes(const TSourceLoc&, const TAttributes&); + void transferTypeAttributes(const TSourceLoc&, const TAttributes&, TType&, bool allowEntry = false); void handleFunctionBody(const TSourceLoc&, TFunction&, TIntermNode* functionBody, TIntermNode*& node); void remapEntryPointIO(TFunction& function, TVariable*& returnValue, TVector& inputs, TVector& outputs); void remapNonEntryPointIO(TFunction& function); @@ -93,6 +93,7 @@ TIntermTyped* handleAssignToMatrixSwizzle(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right); TIntermTyped* handleFunctionCall(const TSourceLoc&, TFunction*, TIntermTyped*); TIntermAggregate* assignClipCullDistance(const TSourceLoc&, TOperator, int semanticId, TIntermTyped* left, TIntermTyped* right); + TIntermTyped* assignPosition(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right); void decomposeIntrinsic(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments); void decomposeSampleMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments); void decomposeStructBufferMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments); @@ -125,7 +126,6 @@ void arraySizeCheck(const TSourceLoc&, TIntermTyped* expr, TArraySize&); void arraySizeRequiredCheck(const TSourceLoc&, const TArraySizes&); void structArrayCheck(const TSourceLoc&, const TType& structure); - void arrayDimMerge(TType& type, const TArraySizes* sizes); bool voidErrorCheck(const TSourceLoc&, const TString&, TBasicType); void globalQualifierFix(const TSourceLoc&, TQualifier&); bool structQualifierErrorCheck(const TSourceLoc&, const TPublicType& pType); @@ -137,10 +137,12 @@ void setLayoutQualifier(const TSourceLoc&, TQualifier&, TString&); void setLayoutQualifier(const TSourceLoc&, TQualifier&, TString&, const TIntermTyped*); + void setSpecConstantId(const TSourceLoc&, TQualifier&, int value); void mergeObjectLayoutQualifiers(TQualifier& dest, const TQualifier& src, bool inheritOnly); void checkNoShaderLayouts(const TSourceLoc&, const TShaderQualifiers&); const TFunction* findFunction(const TSourceLoc& loc, TFunction& call, bool& builtIn, int& thisDepth, TIntermTyped*& args); + void addGenMulArgumentConversion(const TSourceLoc& loc, TFunction& call, TIntermTyped*& args); void declareTypedef(const TSourceLoc&, const TString& identifier, const TType&); void declareStruct(const TSourceLoc&, TString& structName, TType&); TSymbol* lookupUserType(const TString&, TType&); @@ -151,7 +153,7 @@ TIntermTyped* convertArray(TIntermTyped*, const TType&); TIntermTyped* constructAggregate(TIntermNode*, const TType&, int, const TSourceLoc&); TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset); - void declareBlock(const TSourceLoc&, TType&, const TString* instanceName = 0, TArraySizes* arraySizes = 0); + void declareBlock(const TSourceLoc&, TType&, const TString* instanceName = 0); void declareStructBufferCounter(const TSourceLoc& loc, const TType& bufferType, const TString& name); void fixBlockLocations(const TSourceLoc&, TQualifier&, TTypeList&, bool memberWithLocation, bool memberWithoutLocation); void fixBlockXfbOffsets(TQualifier&, TTypeList&); @@ -160,9 +162,7 @@ void addQualifierToExisting(const TSourceLoc&, TQualifier, TIdentifierList&); void updateStandaloneQualifierDefaults(const TSourceLoc&, const TPublicType&); void wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode); - TIntermNode* addSwitch(const TSourceLoc&, TIntermTyped* expression, TIntermAggregate* body, TSelectionControl control); - - void updateImplicitArraySize(const TSourceLoc&, TIntermNode*, int index); + TIntermNode* addSwitch(const TSourceLoc&, TIntermTyped* expression, TIntermAggregate* body, const TAttributes&); void nestLooping() { ++loopNestingLevel; } void unnestLooping() { --loopNestingLevel; } @@ -200,10 +200,11 @@ bool handleInputGeometry(const TSourceLoc&, const TLayoutGeometry& geometry); // Determine selection control from attributes - TSelectionControl handleSelectionControl(const TAttributeMap& attributes) const; + void handleSelectionAttributes(const TSourceLoc& loc, TIntermSelection*, const TAttributes& attributes); + void handleSwitchAttributes(const TSourceLoc& loc, TIntermSwitch*, const TAttributes& attributes); // Determine loop control from attributes - TLoopControl handleLoopControl(const TAttributeMap& attributes) const; + void handleLoopAttributes(const TSourceLoc& loc, TIntermLoop*, const TAttributes& attributes); // Share struct buffer deep types void shareStructBufferType(TType&); @@ -214,6 +215,8 @@ // Obtain the sampler return type of the given sampler in retType. void getTextureReturnType(const TSampler& sampler, TType& retType) const; + TAttributeType attributeFromName(const TString& nameSpace, const TString& name) const; + protected: struct TFlattenData { TFlattenData() : nextBinding(TQualifier::layoutBindingEnd), @@ -399,7 +402,7 @@ // may fit in TSampler::structReturnIndex. TVector textureReturnStruct; - TMap structBufferCounter; + TMap structBufferCounter; // true if counter buffer is in use // The built-in interstage IO map considers e.g, EvqPosition on input and output separately, so that we // can build the linkage correctly if position appears on both sides. Otherwise, multiple positions diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/hlslScanContext.cpp vulkan-1.1.73+dfsg/external/glslang/hlsl/hlslScanContext.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/hlslScanContext.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/hlsl/hlslScanContext.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -143,6 +143,7 @@ (*KeywordMap)["bool"] = EHTokBool; (*KeywordMap)["int"] = EHTokInt; (*KeywordMap)["uint"] = EHTokUint; + (*KeywordMap)["uint64_t"] = EHTokUint64; (*KeywordMap)["dword"] = EHTokDword; (*KeywordMap)["half"] = EHTokHalf; (*KeywordMap)["float"] = EHTokFloat; @@ -345,6 +346,7 @@ (*KeywordMap)["RWByteAddressBuffer"] = EHTokRWByteAddressBuffer; (*KeywordMap)["RWStructuredBuffer"] = EHTokRWStructuredBuffer; (*KeywordMap)["StructuredBuffer"] = EHTokStructuredBuffer; + (*KeywordMap)["TextureBuffer"] = EHTokTextureBuffer; (*KeywordMap)["class"] = EHTokClass; (*KeywordMap)["struct"] = EHTokStruct; @@ -548,6 +550,7 @@ case PpAtomConstInt: parserToken->i = ppToken.ival; return EHTokIntConstant; case PpAtomConstUint: parserToken->i = ppToken.ival; return EHTokUintConstant; + case PpAtomConstFloat16: parserToken->d = ppToken.dval; return EHTokFloat16Constant; case PpAtomConstFloat: parserToken->d = ppToken.dval; return EHTokFloatConstant; case PpAtomConstDouble: parserToken->d = ppToken.dval; return EHTokDoubleConstant; case PpAtomIdentifier: @@ -564,10 +567,15 @@ case EndOfInput: return EHTokNone; default: - char buf[2]; - buf[0] = (char)token; - buf[1] = 0; - parseContext.error(loc, "unexpected token", buf, ""); + if (token < PpAtomMaxSingle) { + char buf[2]; + buf[0] = (char)token; + buf[1] = 0; + parseContext.error(loc, "unexpected token", buf, ""); + } else if (tokenText[0] != 0) + parseContext.error(loc, "unexpected token", tokenText, ""); + else + parseContext.error(loc, "unexpected token", "", ""); break; } } while (true); @@ -644,6 +652,7 @@ case EHTokBool: case EHTokInt: case EHTokUint: + case EHTokUint64: case EHTokDword: case EHTokHalf: case EHTokFloat: @@ -829,6 +838,7 @@ case EHTokRWByteAddressBuffer: case EHTokRWStructuredBuffer: case EHTokStructuredBuffer: + case EHTokTextureBuffer: case EHTokSubpassInput: case EHTokSubpassInputMS: return keyword; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/hlslTokens.h vulkan-1.1.73+dfsg/external/glslang/hlsl/hlslTokens.h --- vulkan-1.0.65.2+dfsg1/external/glslang/hlsl/hlslTokens.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/hlsl/hlslTokens.h 2018-04-27 11:46:26.000000000 +0000 @@ -95,6 +95,7 @@ EHTokBool, EHTokInt, EHTokUint, + EHTokUint64, EHTokDword, EHTokHalf, EHTokFloat, @@ -283,6 +284,7 @@ EHTokRWByteAddressBuffer, EHTokRWStructuredBuffer, EHTokStructuredBuffer, + EHTokTextureBuffer, // variable, user type, ... EHTokIdentifier, @@ -296,6 +298,7 @@ EHTokConstantBuffer, // constant + EHTokFloat16Constant, EHTokFloatConstant, EHTokDoubleConstant, EHTokIntConstant, diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/known_good.json vulkan-1.1.73+dfsg/external/glslang/known_good.json --- vulkan-1.0.65.2+dfsg1/external/glslang/known_good.json 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/known_good.json 2018-04-27 11:46:26.000000000 +0000 @@ -5,14 +5,14 @@ "site" : "github", "subrepo" : "KhronosGroup/SPIRV-Tools", "subdir" : "External/spirv-tools", - "commit" : "5834719fc17d4735fce0102738b87b70255cfd5f" + "commit" : "26a698c34788bb69123a1f3789970a16cf4d9641" }, { "name" : "spirv-tools/external/spirv-headers", "site" : "github", "subrepo" : "KhronosGroup/SPIRV-Headers", "subdir" : "External/spirv-tools/external/spirv-headers", - "commit" : "061097878467b8e040fbf153a837d844ef9f9f96" + "commit" : "12f8de9f04327336b699b1b80aa390ae7f9ddbf4" } ] } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/known_good_khr.json vulkan-1.1.73+dfsg/external/glslang/known_good_khr.json --- vulkan-1.0.65.2+dfsg1/external/glslang/known_good_khr.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/known_good_khr.json 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,18 @@ +{ + "commits" : [ + { + "name" : "spirv-tools", + "site" : "gitlab", + "subrepo" : "spirv/spirv-tools", + "subdir" : "External/spirv-tools", + "commit" : "d4e2c2eaa6fd2e9f9cd218ea9add9b0c8ae759ba" + }, + { + "name" : "spirv-tools/external/spirv-headers", + "site" : "gitlab", + "subrepo" : "spirv/SPIRV-Headers", + "subdir" : "External/spirv-tools/external/spirv-headers", + "commit" : "4082a777bd5df31ed45acf40e64263094e85ed2e" + } + ] +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/make-revision vulkan-1.1.73+dfsg/external/glslang/make-revision --- vulkan-1.0.65.2+dfsg1/external/glslang/make-revision 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/make-revision 2018-04-27 11:46:26.000000000 +0000 @@ -1,10 +1,6 @@ #!/bin/sh ( echo "// This header is generated by the make-revision script." -echo "// For the version, it uses the latest git tag followed by the number of commits." -echo "// For the date, it uses the current date (when then script is run)." - echo -echo \#define GLSLANG_REVISION \"`git describe --tags --abbrev=0`.`git log --oneline | wc -l`\" -echo \#define GLSLANG_DATE \"`date +%d-%b-%Y`\" +echo \#define GLSLANG_PATCH_LEVEL `git log --oneline | wc -l` ) > glslang/Include/revision.h diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/OGLCompilersDLL/InitializeDll.cpp vulkan-1.1.73+dfsg/external/glslang/OGLCompilersDLL/InitializeDll.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/OGLCompilersDLL/InitializeDll.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/OGLCompilersDLL/InitializeDll.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -38,13 +38,17 @@ #include "InitializeDll.h" #include "../glslang/Include/InitializeGlobals.h" - #include "../glslang/Public/ShaderLang.h" +#include "../glslang/Include/PoolAlloc.h" namespace glslang { OS_TLSIndex ThreadInitializeIndex = OS_INVALID_TLS_INDEX; +// Per-process initialization. +// Needs to be called at least once before parsing, etc. is done. +// Will also do thread initialization for the calling thread; other +// threads will need to do that explicitly. bool InitProcess() { glslang::GetGlobalLock(); @@ -85,7 +89,9 @@ return true; } - +// Per-thread scoped initialization. +// Must be called at least once by each new thread sharing the +// symbol tables, etc., needed to parse. bool InitThread() { // @@ -99,17 +105,21 @@ if (OS_GetTLSValue(ThreadInitializeIndex) != 0) return true; - InitializeMemoryPools(); - if (! OS_SetTLSValue(ThreadInitializeIndex, (void *)1)) { assert(0 && "InitThread(): Unable to set init flag."); return false; } + glslang::SetThreadPoolAllocator(nullptr); + return true; } - +// Not necessary to call this: InitThread() is reentrant, and the need +// to do per thread tear down has been removed. +// +// This is kept, with memory management removed, to satisfy any exiting +// calls to it that rely on it. bool DetachThread() { bool success = true; @@ -125,14 +135,18 @@ assert(0 && "DetachThread(): Unable to clear init flag."); success = false; } - - FreeGlobalPools(); - } return success; } +// Not necessary to call this: InitProcess() is reentrant. +// +// This is kept, with memory management removed, to satisfy any exiting +// calls to it that rely on it. +// +// Users of glslang should call shFinalize() or glslang::FinalizeProcess() for +// process-scoped memory tear down. bool DetachProcess() { bool success = true; @@ -140,12 +154,8 @@ if (ThreadInitializeIndex == OS_INVALID_TLS_INDEX) return true; - ShFinalize(); - success = DetachThread(); - FreePoolIndex(); - OS_FreeTLSIndex(ThreadInitializeIndex); ThreadInitializeIndex = OS_INVALID_TLS_INDEX; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/OGLCompilersDLL/InitializeDll.h vulkan-1.1.73+dfsg/external/glslang/OGLCompilersDLL/InitializeDll.h --- vulkan-1.0.65.2+dfsg1/external/glslang/OGLCompilersDLL/InitializeDll.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/OGLCompilersDLL/InitializeDll.h 2018-04-27 11:46:26.000000000 +0000 @@ -40,8 +40,8 @@ bool InitProcess(); bool InitThread(); -bool DetachThread(); -bool DetachProcess(); +bool DetachThread(); // not called from standalone, perhaps other tools rely on parts of it +bool DetachProcess(); // not called from standalone, perhaps other tools rely on parts of it } // end namespace glslang diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/README.md vulkan-1.1.73+dfsg/external/glslang/README.md --- vulkan-1.0.65.2+dfsg1/external/glslang/README.md 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/README.md 2018-04-27 11:46:26.000000000 +0000 @@ -49,22 +49,31 @@ Building -------- +Instead of building manually, you can also download the binaries for your +platform directly from the [master-tot release][master-tot-release] on GitHub. +Those binaries are automatically uploaded by the buildbots after successful +testing and they always reflect the current top of the tree of the master +branch. + ### Dependencies +* A C++11 compiler. + (For MSVS: 2015 is recommended, 2013 is fully supported/tested, and 2010 support is attempted, but not tested.) * [CMake][cmake]: for generating compilation targets. +* make: _Linux_, ninja is an alternative, if configured. * [Python 2.7][python]: for executing SPIRV-Tools scripts. (Optional if not using SPIRV-Tools.) * [bison][bison]: _optional_, but needed when changing the grammar (glslang.y). * [googletest][googletest]: _optional_, but should use if making any changes to glslang. ### Build steps +The following steps assume a Bash shell. On Windows, that could be the Git Bash +shell or some other shell of your choosing. + #### 1) Check-Out this project ```bash cd -# If using SSH -git clone git@github.com:KhronosGroup/glslang.git -# Or if using HTTPS git clone https://github.com/KhronosGroup/glslang.git ``` @@ -83,28 +92,27 @@ ./update_glslang_sources.py ``` -For running the CMake GUI or Visual Studio with python dependencies, you will, -in addition to python within the cygwin environment, need a Windows [python][python] -installation, including selecting the `PATH` update. - #### 3) Configure -Assume the source directory is `$SOURCE_DIR` and -the build directory is `$BUILD_DIR`: - -For building on Linux (assuming using the Ninja generator): +Assume the source directory is `$SOURCE_DIR` and the build directory is +`$BUILD_DIR`. First ensure the build directory exists, then navigate to it: ```bash +mkdir -p $BUILD_DIR cd $BUILD_DIR +``` + +For building on Linux: -cmake -GNinja -DCMAKE_BUILD_TYPE={Debug|Release|RelWithDebInfo} \ - -DCMAKE_INSTALL_PREFIX=`pwd`/install $SOURCE_DIR +```bash +cmake -DCMAKE_BUILD_TYPE={Debug|Release|RelWithDebInfo} \ + -DCMAKE_INSTALL_PREFIX="$(pwd)/install" $SOURCE_DIR ``` For building on Windows: ```bash -cmake $SOURCE_DIR -DCMAKE_INSTALL_PREFIX=`pwd`/install +cmake $SOURCE_DIR -DCMAKE_INSTALL_PREFIX="$(pwd)/install" # The CMAKE_INSTALL_PREFIX part is for testing (explained later). ``` @@ -114,7 +122,7 @@ ```bash # for Linux: -ninja install +make -j4 install # for Windows: cmake --build . --config {Release|Debug|MinSizeRel|RelWithDebInfo} \ @@ -233,8 +241,11 @@ void FinalizeProcess(); class TShader + setStrings(...); + setEnvInput(EShSourceHlsl or EShSourceGlsl, stage, EShClientVulkan or EShClientOpenGL, 100); + setEnvClient(EShClientVulkan or EShClientOpenGL, EShTargetVulkan_1_0 or EShTargetVulkan_1_1 or EShTargetOpenGL_450); + setEnvTarget(EShTargetSpv, EShTargetSpv_1_0 or EShTargetSpv_1_3); bool parse(...); - void setStrings(...); const char* getInfoLog(); class TProgram @@ -318,3 +329,4 @@ [bison]: https://www.gnu.org/software/bison/ [googletest]: https://github.com/google/googletest [bison-gnu-win32]: http://gnuwin32.sourceforge.net/packages/bison.htm +[master-tot-release]: https://github.com/KhronosGroup/glslang/releases/tag/master-tot diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/CMakeLists.txt vulkan-1.1.73+dfsg/external/glslang/SPIRV/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/SPIRV/CMakeLists.txt 2018-04-27 11:46:26.000000000 +0000 @@ -14,6 +14,7 @@ bitutils.h spirv.hpp GLSL.std.450.h + GLSL.ext.EXT.h GLSL.ext.KHR.h GlslangToSpv.h hex_float.h @@ -39,20 +40,25 @@ GLSL.ext.NV.h) endif(ENABLE_NV_EXTENSIONS) -add_library(SPIRV STATIC ${SOURCES} ${HEADERS}) +add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS}) set_property(TARGET SPIRV PROPERTY FOLDER glslang) set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON) -add_library(SPVRemapper STATIC ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS}) +add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS}) set_property(TARGET SPVRemapper PROPERTY FOLDER glslang) set_property(TARGET SPVRemapper PROPERTY POSITION_INDEPENDENT_CODE ON) +if(WIN32 AND BUILD_SHARED_LIBS) + set_target_properties(SPIRV PROPERTIES PREFIX "") + set_target_properties(SPVRemapper PROPERTIES PREFIX "") +endif() + if(ENABLE_OPT) target_include_directories(SPIRV PRIVATE ${spirv-tools_SOURCE_DIR}/include PRIVATE ${spirv-tools_SOURCE_DIR}/source ) - target_link_libraries(SPIRV glslang SPIRV-Tools-opt SPVRemapper) + target_link_libraries(SPIRV glslang SPIRV-Tools-opt) else() target_link_libraries(SPIRV glslang) endif(ENABLE_OPT) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/disassemble.cpp vulkan-1.1.73+dfsg/external/glslang/SPIRV/disassemble.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/disassemble.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/SPIRV/disassemble.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -54,6 +54,7 @@ #ifdef AMD_EXTENSIONS #include "GLSL.ext.AMD.h" #endif + #ifdef NV_EXTENSIONS #include "GLSL.ext.NV.h" #endif @@ -80,12 +81,15 @@ // used to identify the extended instruction library imported when printing enum ExtInstSet { GLSL450Inst, + #ifdef AMD_EXTENSIONS GLSLextAMDInst, #endif + #ifdef NV_EXTENSIONS GLSLextNVInst, #endif + OpenCLExtInst, }; @@ -653,7 +657,6 @@ } #endif - #ifdef NV_EXTENSIONS static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint) { diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/doc.cpp vulkan-1.1.73+dfsg/external/glslang/SPIRV/doc.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/doc.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/SPIRV/doc.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -49,6 +49,7 @@ extern "C" { // Include C-based headers that don't have a namespace #include "GLSL.ext.KHR.h" + #include "GLSL.ext.EXT.h" #ifdef AMD_EXTENSIONS #include "GLSL.ext.AMD.h" #endif @@ -65,7 +66,7 @@ // the specification (or their sanitized versions for auto-generating the // spirv headers. // -// Also, the ceilings are declared next to these, to help keep them in sync. +// Also, for masks the ceilings are declared next to these, to help keep them in sync. // Ceilings should be // - one more than the maximum value an enumerant takes on, for non-mask enumerants // (for non-sparse enums, this is the number of enumerants) @@ -73,8 +74,6 @@ // (for non-sparse mask enums, this is the number of enumerants) // -const int SourceLanguageCeiling = 6; // HLSL todo: need official enumerant - const char* SourceString(int source) { switch (source) { @@ -85,13 +84,10 @@ case 4: return "OpenCL_CPP"; case 5: return "HLSL"; - case SourceLanguageCeiling: default: return "Bad"; } } -const int ExecutionModelCeiling = 7; - const char* ExecutionModelString(int model) { switch (model) { @@ -103,13 +99,10 @@ case 5: return "GLCompute"; case 6: return "Kernel"; - case ExecutionModelCeiling: default: return "Bad"; } } -const int AddressingModelCeiling = 3; - const char* AddressingString(int addr) { switch (addr) { @@ -117,13 +110,10 @@ case 1: return "Physical32"; case 2: return "Physical64"; - case AddressingModelCeiling: default: return "Bad"; } } -const int MemoryModelCeiling = 3; - const char* MemoryString(int mem) { switch (mem) { @@ -131,7 +121,6 @@ case 1: return "GLSL450"; case 2: return "OpenCL"; - case MemoryModelCeiling: default: return "Bad"; } } @@ -181,8 +170,6 @@ } } -const int StorageClassCeiling = 13; - const char* StorageClassString(int StorageClass) { switch (StorageClass) { @@ -200,7 +187,6 @@ case 11: return "Image"; case 12: return "StorageBuffer"; - case StorageClassCeiling: default: return "Bad"; } } @@ -260,19 +246,21 @@ default: return "Bad"; #ifdef AMD_EXTENSIONS - case 4999: return "ExplicitInterpAMD"; + case DecorationExplicitInterpAMD: return "ExplicitInterpAMD"; #endif #ifdef NV_EXTENSIONS - case 5248: return "OverrideCoverageNV"; - case 5250: return "PassthroughNV"; - case 5252: return "ViewportRelativeNV"; - case 5256: return "SecondaryViewportRelativeNV"; + case DecorationOverrideCoverageNV: return "OverrideCoverageNV"; + case DecorationPassthroughNV: return "PassthroughNV"; + case DecorationViewportRelativeNV: return "ViewportRelativeNV"; + case DecorationSecondaryViewportRelativeNV: return "SecondaryViewportRelativeNV"; #endif + + case DecorationNonUniformEXT: return "DecorationNonUniformEXT"; + case DecorationHlslCounterBufferGOOGLE: return "DecorationHlslCounterBufferGOOGLE"; + case DecorationHlslSemanticGOOGLE: return "DecorationHlslSemanticGOOGLE"; } } -const int BuiltInCeiling = 44; - const char* BuiltInString(int builtIn) { switch (builtIn) { @@ -351,13 +339,12 @@ case 5262: return "ViewportMaskPerViewNV"; #endif - case BuiltInCeiling: + case 5264: return "FullyCoveredEXT"; + default: return "Bad"; } } -const int DimensionCeiling = 7; - const char* DimensionString(int dim) { switch (dim) { @@ -369,13 +356,10 @@ case 5: return "Buffer"; case 6: return "SubpassData"; - case DimensionCeiling: default: return "Bad"; } } -const int SamplerAddressingModeCeiling = 5; - const char* SamplerAddressingModeString(int mode) { switch (mode) { @@ -385,26 +369,20 @@ case 3: return "Repeat"; case 4: return "RepeatMirrored"; - case SamplerAddressingModeCeiling: default: return "Bad"; } } -const int SamplerFilterModeCeiling = 2; - const char* SamplerFilterModeString(int mode) { switch (mode) { case 0: return "Nearest"; case 1: return "Linear"; - case SamplerFilterModeCeiling: default: return "Bad"; } } -const int ImageFormatCeiling = 40; - const char* ImageFormatString(int format) { switch (format) { @@ -461,14 +439,11 @@ case 38: return "R16ui"; case 39: return "R8ui"; - case ImageFormatCeiling: default: return "Bad"; } } -const int ImageChannelOrderCeiling = 19; - const char* ImageChannelOrderString(int format) { switch (format) { @@ -492,14 +467,11 @@ case 17: return "sRGBA"; case 18: return "sBGRA"; - case ImageChannelOrderCeiling: default: return "Bad"; } } -const int ImageChannelDataTypeCeiling = 17; - const char* ImageChannelDataTypeString(int type) { switch (type) @@ -522,7 +494,6 @@ case 15: return "UnormInt24"; case 16: return "UnormInt101010_2"; - case ImageChannelDataTypeCeiling: default: return "Bad"; } @@ -548,8 +519,6 @@ } } -const int FPFastMathCeiling = 5; - const char* FPFastMathString(int mode) { switch (mode) { @@ -559,13 +528,10 @@ case 3: return "AllowRecip"; case 4: return "Fast"; - case FPFastMathCeiling: default: return "Bad"; } } -const int FPRoundingModeCeiling = 4; - const char* FPRoundingModeString(int mode) { switch (mode) { @@ -574,26 +540,20 @@ case 2: return "RTP"; case 3: return "RTN"; - case FPRoundingModeCeiling: default: return "Bad"; } } -const int LinkageTypeCeiling = 2; - const char* LinkageTypeString(int type) { switch (type) { case 0: return "Export"; case 1: return "Import"; - case LinkageTypeCeiling: default: return "Bad"; } } -const int FuncParamAttrCeiling = 8; - const char* FuncParamAttrString(int attr) { switch (attr) { @@ -606,13 +566,10 @@ case 6: return "NoWrite"; case 7: return "NoReadWrite"; - case FuncParamAttrCeiling: default: return "Bad"; } } -const int AccessQualifierCeiling = 3; - const char* AccessQualifierString(int attr) { switch (attr) { @@ -620,7 +577,6 @@ case 1: return "WriteOnly"; case 2: return "ReadWrite"; - case AccessQualifierCeiling: default: return "Bad"; } } @@ -668,8 +624,6 @@ } } -const int MemorySemanticsCeiling = 12; - const char* MemorySemanticsString(int mem) { // Note: No bits set (None) means "Relaxed" @@ -687,13 +641,10 @@ case 10: return "AtomicCounterMemory"; case 11: return "ImageMemory"; - case MemorySemanticsCeiling: default: return "Bad"; } } -const int MemoryAccessCeiling = 3; - const char* MemoryAccessString(int mem) { switch (mem) { @@ -701,13 +652,10 @@ case 1: return "Aligned"; case 2: return "Nontemporal"; - case MemoryAccessCeiling: default: return "Bad"; } } -const int ScopeCeiling = 5; - const char* ScopeString(int mem) { switch (mem) { @@ -717,29 +665,29 @@ case 3: return "Subgroup"; case 4: return "Invocation"; - case ScopeCeiling: default: return "Bad"; } } -const int GroupOperationCeiling = 3; - const char* GroupOperationString(int gop) { switch (gop) { - case 0: return "Reduce"; - case 1: return "InclusiveScan"; - case 2: return "ExclusiveScan"; + case GroupOperationReduce: return "Reduce"; + case GroupOperationInclusiveScan: return "InclusiveScan"; + case GroupOperationExclusiveScan: return "ExclusiveScan"; + case GroupOperationClusteredReduce: return "ClusteredReduce"; +#ifdef NV_EXTENSIONS + case GroupOperationPartitionedReduceNV: return "PartitionedReduceNV"; + case GroupOperationPartitionedInclusiveScanNV: return "PartitionedInclusiveScanNV"; + case GroupOperationPartitionedExclusiveScanNV: return "PartitionedExclusiveScanNV"; +#endif - case GroupOperationCeiling: default: return "Bad"; } } -const int KernelEnqueueFlagsCeiling = 3; - const char* KernelEnqueueFlagsString(int flag) { switch (flag) @@ -748,26 +696,20 @@ case 1: return "WaitKernel"; case 2: return "WaitWorkGroup"; - case KernelEnqueueFlagsCeiling: default: return "Bad"; } } -const int KernelProfilingInfoCeiling = 1; - const char* KernelProfilingInfoString(int info) { switch (info) { case 0: return "CmdExecTime"; - case KernelProfilingInfoCeiling: default: return "Bad"; } } -const int CapabilityCeiling = 58; - const char* CapabilityString(int info) { switch (info) @@ -830,39 +772,63 @@ case 55: return "StorageImageReadWithoutFormat"; case 56: return "StorageImageWriteWithoutFormat"; case 57: return "MultiViewport"; + case 61: return "GroupNonUniform"; + case 62: return "GroupNonUniformVote"; + case 63: return "GroupNonUniformArithmetic"; + case 64: return "GroupNonUniformBallot"; + case 65: return "GroupNonUniformShuffle"; + case 66: return "GroupNonUniformShuffleRelative"; + case 67: return "GroupNonUniformClustered"; + case 68: return "GroupNonUniformQuad"; + + case CapabilitySubgroupBallotKHR: return "SubgroupBallotKHR"; + case CapabilityDrawParameters: return "DrawParameters"; + case CapabilitySubgroupVoteKHR: return "SubgroupVoteKHR"; + + case CapabilityStorageUniformBufferBlock16: return "StorageUniformBufferBlock16"; + case CapabilityStorageUniform16: return "StorageUniform16"; + case CapabilityStoragePushConstant16: return "StoragePushConstant16"; + case CapabilityStorageInputOutput16: return "StorageInputOutput16"; - case 4423: return "SubgroupBallotKHR"; - case 4427: return "DrawParameters"; - case 4431: return "SubgroupVoteKHR"; - - case 4433: return "StorageUniformBufferBlock16"; - case 4434: return "StorageUniform16"; - case 4435: return "StoragePushConstant16"; - case 4436: return "StorageInputOutput16"; - - case 4437: return "DeviceGroup"; - case 4439: return "MultiView"; + case CapabilityDeviceGroup: return "DeviceGroup"; + case CapabilityMultiView: return "MultiView"; - case 5013: return "StencilExportEXT"; + case CapabilityStencilExportEXT: return "StencilExportEXT"; #ifdef AMD_EXTENSIONS - case 5009: return "ImageGatherBiasLodAMD"; - case 5010: return "FragmentMaskAMD"; - case 5015: return "ImageReadWriteLodAMD"; + case CapabilityFloat16ImageAMD: return "Float16ImageAMD"; + case CapabilityImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD"; + case CapabilityFragmentMaskAMD: return "FragmentMaskAMD"; + case CapabilityImageReadWriteLodAMD: return "ImageReadWriteLodAMD"; #endif - case 4445: return "AtomicStorageOps"; + case CapabilityAtomicStorageOps: return "AtomicStorageOps"; - case 4447: return "SampleMaskPostDepthCoverage"; + case CapabilitySampleMaskPostDepthCoverage: return "SampleMaskPostDepthCoverage"; #ifdef NV_EXTENSIONS - case 5251: return "GeometryShaderPassthroughNV"; - case 5254: return "ShaderViewportIndexLayerNV"; - case 5255: return "ShaderViewportMaskNV"; - case 5259: return "ShaderStereoViewNV"; - case 5260: return "PerViewAttributesNV"; + case CapabilityGeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV"; + case CapabilityShaderViewportIndexLayerNV: return "ShaderViewportIndexLayerNV"; + case CapabilityShaderViewportMaskNV: return "ShaderViewportMaskNV"; + case CapabilityShaderStereoViewNV: return "ShaderStereoViewNV"; + case CapabilityPerViewAttributesNV: return "PerViewAttributesNV"; + case CapabilityGroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV"; #endif - case CapabilityCeiling: + case CapabilityFragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT"; + + case CapabilityShaderNonUniformEXT: return "CapabilityShaderNonUniformEXT"; + case CapabilityRuntimeDescriptorArrayEXT: return "CapabilityRuntimeDescriptorArrayEXT"; + case CapabilityInputAttachmentArrayDynamicIndexingEXT: return "CapabilityInputAttachmentArrayDynamicIndexingEXT"; + case CapabilityUniformTexelBufferArrayDynamicIndexingEXT: return "CapabilityUniformTexelBufferArrayDynamicIndexingEXT"; + case CapabilityStorageTexelBufferArrayDynamicIndexingEXT: return "CapabilityStorageTexelBufferArrayDynamicIndexingEXT"; + case CapabilityUniformBufferArrayNonUniformIndexingEXT: return "CapabilityUniformBufferArrayNonUniformIndexingEXT"; + case CapabilitySampledImageArrayNonUniformIndexingEXT: return "CapabilitySampledImageArrayNonUniformIndexingEXT"; + case CapabilityStorageBufferArrayNonUniformIndexingEXT: return "CapabilityStorageBufferArrayNonUniformIndexingEXT"; + case CapabilityStorageImageArrayNonUniformIndexingEXT: return "CapabilityStorageImageArrayNonUniformIndexingEXT"; + case CapabilityInputAttachmentArrayNonUniformIndexingEXT: return "CapabilityInputAttachmentArrayNonUniformIndexingEXT"; + case CapabilityUniformTexelBufferArrayNonUniformIndexingEXT: return "CapabilityUniformTexelBufferArrayNonUniformIndexingEXT"; + case CapabilityStorageTexelBufferArrayNonUniformIndexingEXT: return "CapabilityStorageTexelBufferArrayNonUniformIndexingEXT"; + default: return "Bad"; } } @@ -1192,6 +1158,44 @@ case 319: return "OpAtomicFlagClear"; case 320: return "OpImageSparseRead"; + case OpModuleProcessed: return "OpModuleProcessed"; + case OpDecorateId: return "OpDecorateId"; + + case 333: return "OpGroupNonUniformElect"; + case 334: return "OpGroupNonUniformAll"; + case 335: return "OpGroupNonUniformAny"; + case 336: return "OpGroupNonUniformAllEqual"; + case 337: return "OpGroupNonUniformBroadcast"; + case 338: return "OpGroupNonUniformBroadcastFirst"; + case 339: return "OpGroupNonUniformBallot"; + case 340: return "OpGroupNonUniformInverseBallot"; + case 341: return "OpGroupNonUniformBallotBitExtract"; + case 342: return "OpGroupNonUniformBallotBitCount"; + case 343: return "OpGroupNonUniformBallotFindLSB"; + case 344: return "OpGroupNonUniformBallotFindMSB"; + case 345: return "OpGroupNonUniformShuffle"; + case 346: return "OpGroupNonUniformShuffleXor"; + case 347: return "OpGroupNonUniformShuffleUp"; + case 348: return "OpGroupNonUniformShuffleDown"; + case 349: return "OpGroupNonUniformIAdd"; + case 350: return "OpGroupNonUniformFAdd"; + case 351: return "OpGroupNonUniformIMul"; + case 352: return "OpGroupNonUniformFMul"; + case 353: return "OpGroupNonUniformSMin"; + case 354: return "OpGroupNonUniformUMin"; + case 355: return "OpGroupNonUniformFMin"; + case 356: return "OpGroupNonUniformSMax"; + case 357: return "OpGroupNonUniformUMax"; + case 358: return "OpGroupNonUniformFMax"; + case 359: return "OpGroupNonUniformBitwiseAnd"; + case 360: return "OpGroupNonUniformBitwiseOr"; + case 361: return "OpGroupNonUniformBitwiseXor"; + case 362: return "OpGroupNonUniformLogicalAnd"; + case 363: return "OpGroupNonUniformLogicalOr"; + case 364: return "OpGroupNonUniformLogicalXor"; + case 365: return "OpGroupNonUniformQuadBroadcast"; + case 366: return "OpGroupNonUniformQuadSwap"; + case 4421: return "OpSubgroupBallotKHR"; case 4422: return "OpSubgroupFirstInvocationKHR"; case 4428: return "OpSubgroupAllKHR"; @@ -1213,7 +1217,12 @@ case 5012: return "OpFragmentFetchAMD"; #endif - case OpcodeCeiling: + case OpDecorateStringGOOGLE: return "OpDecorateStringGOOGLE"; + case OpMemberDecorateStringGOOGLE: return "OpMemberDecorateStringGOOGLE"; + +#ifdef NV_EXTENSIONS + case OpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV"; +#endif default: return "Bad"; } @@ -1226,35 +1235,12 @@ OperandParameters DecorationOperands[DecorationCeiling]; EnumDefinition OperandClassParams[OperandCount]; -EnumParameters ExecutionModelParams[ExecutionModelCeiling]; -EnumParameters AddressingParams[AddressingModelCeiling]; -EnumParameters MemoryParams[MemoryModelCeiling]; EnumParameters ExecutionModeParams[ExecutionModeCeiling]; -EnumParameters StorageParams[StorageClassCeiling]; -EnumParameters SamplerAddressingModeParams[SamplerAddressingModeCeiling]; -EnumParameters SamplerFilterModeParams[SamplerFilterModeCeiling]; -EnumParameters ImageFormatParams[ImageFormatCeiling]; -EnumParameters ImageChannelOrderParams[ImageChannelOrderCeiling]; -EnumParameters ImageChannelDataTypeParams[ImageChannelDataTypeCeiling]; EnumParameters ImageOperandsParams[ImageOperandsCeiling]; -EnumParameters FPFastMathParams[FPFastMathCeiling]; -EnumParameters FPRoundingModeParams[FPRoundingModeCeiling]; -EnumParameters LinkageTypeParams[LinkageTypeCeiling]; EnumParameters DecorationParams[DecorationCeiling]; -EnumParameters BuiltInParams[BuiltInCeiling]; -EnumParameters DimensionalityParams[DimensionCeiling]; -EnumParameters FuncParamAttrParams[FuncParamAttrCeiling]; -EnumParameters AccessQualifierParams[AccessQualifierCeiling]; -EnumParameters GroupOperationParams[GroupOperationCeiling]; EnumParameters LoopControlParams[FunctionControlCeiling]; EnumParameters SelectionControlParams[SelectControlCeiling]; EnumParameters FunctionControlParams[FunctionControlCeiling]; -EnumParameters MemorySemanticsParams[MemorySemanticsCeiling]; -EnumParameters MemoryAccessParams[MemoryAccessCeiling]; -EnumParameters ScopeParams[ScopeCeiling]; -EnumParameters KernelEnqueueFlagsParams[KernelEnqueueFlagsCeiling]; -EnumParameters KernelProfilingInfoParams[KernelProfilingInfoCeiling]; -EnumParameters CapabilityParams[CapabilityCeiling]; // Set up all the parameterizing descriptions of the opcodes, operands, etc. void Parameterize() @@ -1304,7 +1290,10 @@ InstructionDesc[OpImageWrite].setResultAndType(false, false); InstructionDesc[OpDecorationGroup].setResultAndType(true, false); InstructionDesc[OpDecorate].setResultAndType(false, false); + InstructionDesc[OpDecorateId].setResultAndType(false, false); + InstructionDesc[OpDecorateStringGOOGLE].setResultAndType(false, false); InstructionDesc[OpMemberDecorate].setResultAndType(false, false); + InstructionDesc[OpMemberDecorateStringGOOGLE].setResultAndType(false, false); InstructionDesc[OpGroupDecorate].setResultAndType(false, false); InstructionDesc[OpGroupMemberDecorate].setResultAndType(false, false); InstructionDesc[OpName].setResultAndType(false, false); @@ -1343,6 +1332,7 @@ InstructionDesc[OpReleaseEvent].setResultAndType(false, false); InstructionDesc[OpGroupWaitEvents].setResultAndType(false, false); InstructionDesc[OpAtomicFlagClear].setResultAndType(false, false); + InstructionDesc[OpModuleProcessed].setResultAndType(false, false); // Specific additional context-dependent operands @@ -1380,354 +1370,39 @@ DecorationOperands[DecorationInputAttachmentIndex].push(OperandLiteralNumber, "'Attachment Index'"); DecorationOperands[DecorationAlignment].push(OperandLiteralNumber, "'Alignment'"); - OperandClassParams[OperandSource].set(SourceLanguageCeiling, SourceString, 0); - OperandClassParams[OperandExecutionModel].set(ExecutionModelCeiling, ExecutionModelString, ExecutionModelParams); - OperandClassParams[OperandAddressing].set(AddressingModelCeiling, AddressingString, AddressingParams); - OperandClassParams[OperandMemory].set(MemoryModelCeiling, MemoryString, MemoryParams); + OperandClassParams[OperandSource].set(0, SourceString, 0); + OperandClassParams[OperandExecutionModel].set(0, ExecutionModelString, nullptr); + OperandClassParams[OperandAddressing].set(0, AddressingString, nullptr); + OperandClassParams[OperandMemory].set(0, MemoryString, nullptr); OperandClassParams[OperandExecutionMode].set(ExecutionModeCeiling, ExecutionModeString, ExecutionModeParams); OperandClassParams[OperandExecutionMode].setOperands(ExecutionModeOperands); - OperandClassParams[OperandStorage].set(StorageClassCeiling, StorageClassString, StorageParams); - OperandClassParams[OperandDimensionality].set(DimensionCeiling, DimensionString, DimensionalityParams); - OperandClassParams[OperandSamplerAddressingMode].set(SamplerAddressingModeCeiling, SamplerAddressingModeString, SamplerAddressingModeParams); - OperandClassParams[OperandSamplerFilterMode].set(SamplerFilterModeCeiling, SamplerFilterModeString, SamplerFilterModeParams); - OperandClassParams[OperandSamplerImageFormat].set(ImageFormatCeiling, ImageFormatString, ImageFormatParams); - OperandClassParams[OperandImageChannelOrder].set(ImageChannelOrderCeiling, ImageChannelOrderString, ImageChannelOrderParams); - OperandClassParams[OperandImageChannelDataType].set(ImageChannelDataTypeCeiling, ImageChannelDataTypeString, ImageChannelDataTypeParams); + OperandClassParams[OperandStorage].set(0, StorageClassString, nullptr); + OperandClassParams[OperandDimensionality].set(0, DimensionString, nullptr); + OperandClassParams[OperandSamplerAddressingMode].set(0, SamplerAddressingModeString, nullptr); + OperandClassParams[OperandSamplerFilterMode].set(0, SamplerFilterModeString, nullptr); + OperandClassParams[OperandSamplerImageFormat].set(0, ImageFormatString, nullptr); + OperandClassParams[OperandImageChannelOrder].set(0, ImageChannelOrderString, nullptr); + OperandClassParams[OperandImageChannelDataType].set(0, ImageChannelDataTypeString, nullptr); OperandClassParams[OperandImageOperands].set(ImageOperandsCeiling, ImageOperandsString, ImageOperandsParams, true); - OperandClassParams[OperandFPFastMath].set(FPFastMathCeiling, FPFastMathString, FPFastMathParams, true); - OperandClassParams[OperandFPRoundingMode].set(FPRoundingModeCeiling, FPRoundingModeString, FPRoundingModeParams); - OperandClassParams[OperandLinkageType].set(LinkageTypeCeiling, LinkageTypeString, LinkageTypeParams); - OperandClassParams[OperandFuncParamAttr].set(FuncParamAttrCeiling, FuncParamAttrString, FuncParamAttrParams); - OperandClassParams[OperandAccessQualifier].set(AccessQualifierCeiling, AccessQualifierString, AccessQualifierParams); + OperandClassParams[OperandFPFastMath].set(0, FPFastMathString, nullptr, true); + OperandClassParams[OperandFPRoundingMode].set(0, FPRoundingModeString, nullptr); + OperandClassParams[OperandLinkageType].set(0, LinkageTypeString, nullptr); + OperandClassParams[OperandFuncParamAttr].set(0, FuncParamAttrString, nullptr); + OperandClassParams[OperandAccessQualifier].set(0, AccessQualifierString, nullptr); OperandClassParams[OperandDecoration].set(DecorationCeiling, DecorationString, DecorationParams); OperandClassParams[OperandDecoration].setOperands(DecorationOperands); - OperandClassParams[OperandBuiltIn].set(BuiltInCeiling, BuiltInString, BuiltInParams); + OperandClassParams[OperandBuiltIn].set(0, BuiltInString, nullptr); OperandClassParams[OperandSelect].set(SelectControlCeiling, SelectControlString, SelectionControlParams, true); OperandClassParams[OperandLoop].set(LoopControlCeiling, LoopControlString, LoopControlParams, true); OperandClassParams[OperandFunction].set(FunctionControlCeiling, FunctionControlString, FunctionControlParams, true); - OperandClassParams[OperandMemorySemantics].set(MemorySemanticsCeiling, MemorySemanticsString, MemorySemanticsParams, true); - OperandClassParams[OperandMemoryAccess].set(MemoryAccessCeiling, MemoryAccessString, MemoryAccessParams, true); - OperandClassParams[OperandScope].set(ScopeCeiling, ScopeString, ScopeParams); - OperandClassParams[OperandGroupOperation].set(GroupOperationCeiling, GroupOperationString, GroupOperationParams); - OperandClassParams[OperandKernelEnqueueFlags].set(KernelEnqueueFlagsCeiling, KernelEnqueueFlagsString, KernelEnqueueFlagsParams); - OperandClassParams[OperandKernelProfilingInfo].set(KernelProfilingInfoCeiling, KernelProfilingInfoString, KernelProfilingInfoParams, true); - OperandClassParams[OperandCapability].set(CapabilityCeiling, CapabilityString, CapabilityParams); - OperandClassParams[OperandOpcode].set(OpcodeCeiling, OpcodeString, 0); - - CapabilityParams[CapabilityShader].caps.push_back(CapabilityMatrix); - CapabilityParams[CapabilityGeometry].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityTessellation].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityVector16].caps.push_back(CapabilityKernel); - CapabilityParams[CapabilityFloat16Buffer].caps.push_back(CapabilityKernel); - CapabilityParams[CapabilityInt64Atomics].caps.push_back(CapabilityInt64); - CapabilityParams[CapabilityImageBasic].caps.push_back(CapabilityKernel); - CapabilityParams[CapabilityImageReadWrite].caps.push_back(CapabilityImageBasic); - CapabilityParams[CapabilityImageMipmap].caps.push_back(CapabilityImageBasic); - CapabilityParams[CapabilityPipes].caps.push_back(CapabilityKernel); - CapabilityParams[CapabilityDeviceEnqueue].caps.push_back(CapabilityKernel); - CapabilityParams[CapabilityLiteralSampler].caps.push_back(CapabilityKernel); - CapabilityParams[CapabilityAtomicStorage].caps.push_back(CapabilityShader); - CapabilityParams[CapabilitySampleRateShading].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityTessellationPointSize].caps.push_back(CapabilityTessellation); - CapabilityParams[CapabilityGeometryPointSize].caps.push_back(CapabilityGeometry); - CapabilityParams[CapabilityImageGatherExtended].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityStorageImageExtendedFormats].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityStorageImageMultisample].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityUniformBufferArrayDynamicIndexing].caps.push_back(CapabilityShader); - CapabilityParams[CapabilitySampledImageArrayDynamicIndexing].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityStorageBufferArrayDynamicIndexing].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityStorageImageArrayDynamicIndexing].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityClipDistance].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityCullDistance].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityGenericPointer].caps.push_back(CapabilityAddresses); - CapabilityParams[CapabilityInt8].caps.push_back(CapabilityKernel); - CapabilityParams[CapabilityInputAttachment].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityMinLod].caps.push_back(CapabilityShader); - CapabilityParams[CapabilitySparseResidency].caps.push_back(CapabilityShader); - CapabilityParams[CapabilitySampled1D].caps.push_back(CapabilityShader); - CapabilityParams[CapabilitySampledRect].caps.push_back(CapabilityShader); - CapabilityParams[CapabilitySampledBuffer].caps.push_back(CapabilityShader); - CapabilityParams[CapabilitySampledCubeArray].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityImageMSArray].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityImage1D].caps.push_back(CapabilitySampled1D); - CapabilityParams[CapabilityImageRect].caps.push_back(CapabilitySampledRect); - CapabilityParams[CapabilityImageBuffer].caps.push_back(CapabilitySampledBuffer); - CapabilityParams[CapabilityImageCubeArray].caps.push_back(CapabilitySampledCubeArray); - CapabilityParams[CapabilityImageQuery].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityDerivativeControl].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityInterpolationFunction].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityTransformFeedback].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityGeometryStreams].caps.push_back(CapabilityGeometry); - CapabilityParams[CapabilityStorageImageReadWithoutFormat].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityStorageImageWriteWithoutFormat].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityMultiViewport].caps.push_back(CapabilityGeometry); - - AddressingParams[AddressingModelPhysical32].caps.push_back(CapabilityAddresses); - AddressingParams[AddressingModelPhysical64].caps.push_back(CapabilityAddresses); - - MemoryParams[MemoryModelSimple].caps.push_back(CapabilityShader); - MemoryParams[MemoryModelGLSL450].caps.push_back(CapabilityShader); - MemoryParams[MemoryModelOpenCL].caps.push_back(CapabilityKernel); - - MemorySemanticsParams[MemorySemanticsUniformMemoryShift].caps.push_back(CapabilityShader); - MemorySemanticsParams[MemorySemanticsAtomicCounterMemoryShift].caps.push_back(CapabilityAtomicStorage); - - ExecutionModelParams[ExecutionModelVertex].caps.push_back(CapabilityShader); - ExecutionModelParams[ExecutionModelTessellationControl].caps.push_back(CapabilityTessellation); - ExecutionModelParams[ExecutionModelTessellationEvaluation].caps.push_back(CapabilityTessellation); - ExecutionModelParams[ExecutionModelGeometry].caps.push_back(CapabilityGeometry); - ExecutionModelParams[ExecutionModelFragment].caps.push_back(CapabilityShader); - ExecutionModelParams[ExecutionModelGLCompute].caps.push_back(CapabilityShader); - ExecutionModelParams[ExecutionModelKernel].caps.push_back(CapabilityKernel); - - // Storage capabilites - StorageParams[StorageClassInput].caps.push_back(CapabilityShader); - StorageParams[StorageClassUniform].caps.push_back(CapabilityShader); - StorageParams[StorageClassOutput].caps.push_back(CapabilityShader); - StorageParams[StorageClassPrivate].caps.push_back(CapabilityShader); - StorageParams[StorageClassGeneric].caps.push_back(CapabilityKernel); - StorageParams[StorageClassAtomicCounter].caps.push_back(CapabilityAtomicStorage); - StorageParams[StorageClassPushConstant].caps.push_back(CapabilityShader); - - // Sampler Filter & Addressing mode capabilities - SamplerAddressingModeParams[SamplerAddressingModeNone].caps.push_back(CapabilityKernel); - SamplerAddressingModeParams[SamplerAddressingModeClampToEdge].caps.push_back(CapabilityKernel); - SamplerAddressingModeParams[SamplerAddressingModeClamp].caps.push_back(CapabilityKernel); - SamplerAddressingModeParams[SamplerAddressingModeRepeat].caps.push_back(CapabilityKernel); - SamplerAddressingModeParams[SamplerAddressingModeRepeatMirrored].caps.push_back(CapabilityKernel); - - SamplerFilterModeParams[SamplerFilterModeNearest].caps.push_back(CapabilityKernel); - SamplerFilterModeParams[SamplerFilterModeLinear].caps.push_back(CapabilityKernel); - - // image format capabilities - - // ES/Desktop float - ImageFormatParams[ImageFormatRgba32f].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatRgba16f].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatR32f].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatRgba8].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatRgba8Snorm].caps.push_back(CapabilityShader); - - // Desktop float - ImageFormatParams[ImageFormatRg32f].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg16f].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR11fG11fB10f].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR16f].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRgba16].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRgb10A2].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg16].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg8].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR16].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR8].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRgba16Snorm].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg16Snorm].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg8Snorm].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR16Snorm].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR8Snorm].caps.push_back(CapabilityStorageImageExtendedFormats); - - // ES/Desktop int - ImageFormatParams[ImageFormatRgba32i].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatRgba16i].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatRgba8i].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatR32i].caps.push_back(CapabilityShader); - - // Desktop int - ImageFormatParams[ImageFormatRg32i].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg16i].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg8i].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR16i].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR8i].caps.push_back(CapabilityStorageImageExtendedFormats); - - // ES/Desktop uint - ImageFormatParams[ImageFormatRgba32ui].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatRgba16ui].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatRgba8ui].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatR32ui].caps.push_back(CapabilityShader); - - // Desktop uint - ImageFormatParams[ImageFormatRgb10a2ui].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg32ui].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg16ui].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg8ui].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR16ui].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR8ui].caps.push_back(CapabilityStorageImageExtendedFormats); - - // image channel order capabilities - for (int i = 0; i < ImageChannelOrderCeiling; ++i) { - ImageChannelOrderParams[i].caps.push_back(CapabilityKernel); - } - - // image channel type capabilities - for (int i = 0; i < ImageChannelDataTypeCeiling; ++i) { - ImageChannelDataTypeParams[i].caps.push_back(CapabilityKernel); - } - - // image lookup operands - ImageOperandsParams[ImageOperandsBiasShift].caps.push_back(CapabilityShader); - ImageOperandsParams[ImageOperandsOffsetShift].caps.push_back(CapabilityImageGatherExtended); - ImageOperandsParams[ImageOperandsMinLodShift].caps.push_back(CapabilityMinLod); - - // fast math flags capabilities - for (int i = 0; i < FPFastMathCeiling; ++i) { - FPFastMathParams[i].caps.push_back(CapabilityKernel); - } - - // fp rounding mode capabilities - for (int i = 0; i < FPRoundingModeCeiling; ++i) { - FPRoundingModeParams[i].caps.push_back(CapabilityKernel); - } - - // linkage types - for (int i = 0; i < LinkageTypeCeiling; ++i) { - LinkageTypeParams[i].caps.push_back(CapabilityLinkage); - } - - // function argument types - for (int i = 0; i < FuncParamAttrCeiling; ++i) { - FuncParamAttrParams[i].caps.push_back(CapabilityKernel); - } - - // function argument types - for (int i = 0; i < AccessQualifierCeiling; ++i) { - AccessQualifierParams[i].caps.push_back(CapabilityKernel); - } - - ExecutionModeParams[ExecutionModeInvocations].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeSpacingEqual].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeSpacingFractionalEven].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeSpacingFractionalOdd].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeVertexOrderCw].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeVertexOrderCcw].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModePixelCenterInteger].caps.push_back(CapabilityShader); - ExecutionModeParams[ExecutionModeOriginUpperLeft].caps.push_back(CapabilityShader); - ExecutionModeParams[ExecutionModeOriginLowerLeft].caps.push_back(CapabilityShader); - ExecutionModeParams[ExecutionModeEarlyFragmentTests].caps.push_back(CapabilityShader); - ExecutionModeParams[ExecutionModePointMode].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeXfb].caps.push_back(CapabilityTransformFeedback); - ExecutionModeParams[ExecutionModeDepthReplacing].caps.push_back(CapabilityShader); - ExecutionModeParams[ExecutionModeDepthGreater].caps.push_back(CapabilityShader); - ExecutionModeParams[ExecutionModeDepthLess].caps.push_back(CapabilityShader); - ExecutionModeParams[ExecutionModeDepthUnchanged].caps.push_back(CapabilityShader); - ExecutionModeParams[ExecutionModeLocalSizeHint].caps.push_back(CapabilityKernel); - ExecutionModeParams[ExecutionModeInputPoints].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeInputLines].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeInputLinesAdjacency].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeTriangles].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeTriangles].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeInputTrianglesAdjacency].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeQuads].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeIsolines].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeOutputVertices].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeOutputVertices].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeOutputPoints].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeOutputLineStrip].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeOutputTriangleStrip].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeVecTypeHint].caps.push_back(CapabilityKernel); - ExecutionModeParams[ExecutionModeContractionOff].caps.push_back(CapabilityKernel); - - DecorationParams[DecorationRelaxedPrecision].caps.push_back(CapabilityShader); - DecorationParams[DecorationBlock].caps.push_back(CapabilityShader); - DecorationParams[DecorationBufferBlock].caps.push_back(CapabilityShader); - DecorationParams[DecorationRowMajor].caps.push_back(CapabilityMatrix); - DecorationParams[DecorationColMajor].caps.push_back(CapabilityMatrix); - DecorationParams[DecorationGLSLShared].caps.push_back(CapabilityShader); - DecorationParams[DecorationGLSLPacked].caps.push_back(CapabilityShader); - DecorationParams[DecorationNoPerspective].caps.push_back(CapabilityShader); - DecorationParams[DecorationFlat].caps.push_back(CapabilityShader); - DecorationParams[DecorationPatch].caps.push_back(CapabilityTessellation); - DecorationParams[DecorationCentroid].caps.push_back(CapabilityShader); - DecorationParams[DecorationSample].caps.push_back(CapabilitySampleRateShading); - DecorationParams[DecorationInvariant].caps.push_back(CapabilityShader); - DecorationParams[DecorationConstant].caps.push_back(CapabilityKernel); - DecorationParams[DecorationUniform].caps.push_back(CapabilityShader); - DecorationParams[DecorationCPacked].caps.push_back(CapabilityKernel); - DecorationParams[DecorationSaturatedConversion].caps.push_back(CapabilityKernel); - DecorationParams[DecorationStream].caps.push_back(CapabilityGeometryStreams); - DecorationParams[DecorationLocation].caps.push_back(CapabilityShader); - DecorationParams[DecorationComponent].caps.push_back(CapabilityShader); - DecorationParams[DecorationOffset].caps.push_back(CapabilityShader); - DecorationParams[DecorationIndex].caps.push_back(CapabilityShader); - DecorationParams[DecorationBinding].caps.push_back(CapabilityShader); - DecorationParams[DecorationDescriptorSet].caps.push_back(CapabilityShader); - DecorationParams[DecorationXfbBuffer].caps.push_back(CapabilityTransformFeedback); - DecorationParams[DecorationXfbStride].caps.push_back(CapabilityTransformFeedback); - DecorationParams[DecorationArrayStride].caps.push_back(CapabilityShader); - DecorationParams[DecorationMatrixStride].caps.push_back(CapabilityMatrix); - DecorationParams[DecorationFuncParamAttr].caps.push_back(CapabilityKernel); - DecorationParams[DecorationFPRoundingMode].caps.push_back(CapabilityKernel); - DecorationParams[DecorationFPFastMathMode].caps.push_back(CapabilityKernel); - DecorationParams[DecorationLinkageAttributes].caps.push_back(CapabilityLinkage); - DecorationParams[DecorationSpecId].caps.push_back(CapabilityShader); - DecorationParams[DecorationNoContraction].caps.push_back(CapabilityShader); - DecorationParams[DecorationInputAttachmentIndex].caps.push_back(CapabilityInputAttachment); - DecorationParams[DecorationAlignment].caps.push_back(CapabilityKernel); - - BuiltInParams[BuiltInPosition].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInPointSize].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInClipDistance].caps.push_back(CapabilityClipDistance); - BuiltInParams[BuiltInCullDistance].caps.push_back(CapabilityCullDistance); - - BuiltInParams[BuiltInVertexId].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInVertexId].desc = "Vertex ID, which takes on values 0, 1, 2, . . . ."; - - BuiltInParams[BuiltInInstanceId].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInInstanceId].desc = "Instance ID, which takes on values 0, 1, 2, . . . ."; - - BuiltInParams[BuiltInVertexIndex].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInVertexIndex].desc = "Vertex index, which takes on values base, base+1, base+2, . . . ."; - - BuiltInParams[BuiltInInstanceIndex].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInInstanceIndex].desc = "Instance index, which takes on values base, base+1, base+2, . . . ."; - - BuiltInParams[BuiltInPrimitiveId].caps.push_back(CapabilityGeometry); - BuiltInParams[BuiltInPrimitiveId].caps.push_back(CapabilityTessellation); - BuiltInParams[BuiltInInvocationId].caps.push_back(CapabilityGeometry); - BuiltInParams[BuiltInInvocationId].caps.push_back(CapabilityTessellation); - BuiltInParams[BuiltInLayer].caps.push_back(CapabilityGeometry); - BuiltInParams[BuiltInViewportIndex].caps.push_back(CapabilityMultiViewport); - BuiltInParams[BuiltInTessLevelOuter].caps.push_back(CapabilityTessellation); - BuiltInParams[BuiltInTessLevelInner].caps.push_back(CapabilityTessellation); - BuiltInParams[BuiltInTessCoord].caps.push_back(CapabilityTessellation); - BuiltInParams[BuiltInPatchVertices].caps.push_back(CapabilityTessellation); - BuiltInParams[BuiltInFragCoord].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInPointCoord].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInFrontFacing].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInSampleId].caps.push_back(CapabilitySampleRateShading); - BuiltInParams[BuiltInSamplePosition].caps.push_back(CapabilitySampleRateShading); - BuiltInParams[BuiltInSampleMask].caps.push_back(CapabilitySampleRateShading); - BuiltInParams[BuiltInFragDepth].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInHelperInvocation].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInWorkDim].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInGlobalSize].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInEnqueuedWorkgroupSize].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInGlobalOffset].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInGlobalLinearId].caps.push_back(CapabilityKernel); - - BuiltInParams[BuiltInSubgroupSize].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInSubgroupMaxSize].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInNumSubgroups].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInNumEnqueuedSubgroups].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInSubgroupId].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInSubgroupLocalInvocationId].caps.push_back(CapabilityKernel); - - DimensionalityParams[Dim1D].caps.push_back(CapabilitySampled1D); - DimensionalityParams[DimCube].caps.push_back(CapabilityShader); - DimensionalityParams[DimRect].caps.push_back(CapabilitySampledRect); - DimensionalityParams[DimBuffer].caps.push_back(CapabilitySampledBuffer); - DimensionalityParams[DimSubpassData].caps.push_back(CapabilityInputAttachment); - - // Group Operations - for (int i = 0; i < GroupOperationCeiling; ++i) { - GroupOperationParams[i].caps.push_back(CapabilityKernel); - } - - // Enqueue flags - for (int i = 0; i < KernelEnqueueFlagsCeiling; ++i) { - KernelEnqueueFlagsParams[i].caps.push_back(CapabilityKernel); - } - - // Profiling info - KernelProfilingInfoParams[0].caps.push_back(CapabilityKernel); + OperandClassParams[OperandMemorySemantics].set(0, MemorySemanticsString, nullptr, true); + OperandClassParams[OperandMemoryAccess].set(0, MemoryAccessString, nullptr, true); + OperandClassParams[OperandScope].set(0, ScopeString, nullptr); + OperandClassParams[OperandGroupOperation].set(0, GroupOperationString, nullptr); + OperandClassParams[OperandKernelEnqueueFlags].set(0, KernelEnqueueFlagsString, nullptr); + OperandClassParams[OperandKernelProfilingInfo].set(0, KernelProfilingInfoString, nullptr, true); + OperandClassParams[OperandCapability].set(0, CapabilityString, nullptr); + OperandClassParams[OperandOpcode].set(OpCodeMask + 1, OpcodeString, 0); // set name of operator, an initial set of style operands, and the description @@ -1779,7 +1454,6 @@ InstructionDesc[OpTypeVector].operands.push(OperandId, "'Component Type'"); InstructionDesc[OpTypeVector].operands.push(OperandLiteralNumber, "'Component Count'"); - InstructionDesc[OpTypeMatrix].capabilities.push_back(CapabilityMatrix); InstructionDesc[OpTypeMatrix].operands.push(OperandId, "'Column Type'"); InstructionDesc[OpTypeMatrix].operands.push(OperandLiteralNumber, "'Column Count'"); @@ -1797,31 +1471,19 @@ InstructionDesc[OpTypeArray].operands.push(OperandId, "'Element Type'"); InstructionDesc[OpTypeArray].operands.push(OperandId, "'Length'"); - InstructionDesc[OpTypeRuntimeArray].capabilities.push_back(CapabilityShader); InstructionDesc[OpTypeRuntimeArray].operands.push(OperandId, "'Element Type'"); InstructionDesc[OpTypeStruct].operands.push(OperandVariableIds, "'Member 0 type', +\n'member 1 type', +\n..."); - InstructionDesc[OpTypeOpaque].capabilities.push_back(CapabilityKernel); InstructionDesc[OpTypeOpaque].operands.push(OperandLiteralString, "The name of the opaque type."); InstructionDesc[OpTypePointer].operands.push(OperandStorage, ""); InstructionDesc[OpTypePointer].operands.push(OperandId, "'Type'"); - InstructionDesc[OpTypeForwardPointer].capabilities.push_back(CapabilityAddresses); InstructionDesc[OpTypeForwardPointer].operands.push(OperandId, "'Pointer Type'"); InstructionDesc[OpTypeForwardPointer].operands.push(OperandStorage, ""); - InstructionDesc[OpTypeEvent].capabilities.push_back(CapabilityKernel); - - InstructionDesc[OpTypeDeviceEvent].capabilities.push_back(CapabilityDeviceEnqueue); - - InstructionDesc[OpTypeReserveId].capabilities.push_back(CapabilityPipes); - - InstructionDesc[OpTypeQueue].capabilities.push_back(CapabilityDeviceEnqueue); - InstructionDesc[OpTypePipe].operands.push(OperandAccessQualifier, "'Qualifier'"); - InstructionDesc[OpTypePipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpTypeFunction].operands.push(OperandId, "'Return Type'"); InstructionDesc[OpTypeFunction].operands.push(OperandVariableIds, "'Parameter 0 Type', +\n'Parameter 1 Type', +\n..."); @@ -1830,7 +1492,6 @@ InstructionDesc[OpConstantComposite].operands.push(OperandVariableIds, "'Constituents'"); - InstructionDesc[OpConstantSampler].capabilities.push_back(CapabilityLiteralSampler); InstructionDesc[OpConstantSampler].operands.push(OperandSamplerAddressingMode, ""); InstructionDesc[OpConstantSampler].operands.push(OperandLiteralNumber, "'Param'"); InstructionDesc[OpConstantSampler].operands.push(OperandSamplerFilterMode, ""); @@ -1868,11 +1529,24 @@ InstructionDesc[OpDecorate].operands.push(OperandDecoration, ""); InstructionDesc[OpDecorate].operands.push(OperandVariableLiterals, "See <>."); + InstructionDesc[OpDecorateId].operands.push(OperandId, "'Target'"); + InstructionDesc[OpDecorateId].operands.push(OperandDecoration, ""); + InstructionDesc[OpDecorateId].operands.push(OperandVariableIds, "See <>."); + + InstructionDesc[OpDecorateStringGOOGLE].operands.push(OperandId, "'Target'"); + InstructionDesc[OpDecorateStringGOOGLE].operands.push(OperandDecoration, ""); + InstructionDesc[OpDecorateStringGOOGLE].operands.push(OperandLiteralString, "'Literal String'"); + InstructionDesc[OpMemberDecorate].operands.push(OperandId, "'Structure Type'"); InstructionDesc[OpMemberDecorate].operands.push(OperandLiteralNumber, "'Member'"); InstructionDesc[OpMemberDecorate].operands.push(OperandDecoration, ""); InstructionDesc[OpMemberDecorate].operands.push(OperandVariableLiterals, "See <>."); + InstructionDesc[OpMemberDecorateStringGOOGLE].operands.push(OperandId, "'Structure Type'"); + InstructionDesc[OpMemberDecorateStringGOOGLE].operands.push(OperandLiteralNumber, "'Member'"); + InstructionDesc[OpMemberDecorateStringGOOGLE].operands.push(OperandDecoration, ""); + InstructionDesc[OpMemberDecorateStringGOOGLE].operands.push(OperandLiteralString, "'Literal String'"); + InstructionDesc[OpGroupDecorate].operands.push(OperandId, "'Decoration Group'"); InstructionDesc[OpGroupDecorate].operands.push(OperandVariableIds, "'Targets'"); @@ -1910,8 +1584,6 @@ InstructionDesc[OpCopyMemorySized].operands.push(OperandId, "'Size'"); InstructionDesc[OpCopyMemorySized].operands.push(OperandMemoryAccess, "", true); - InstructionDesc[OpCopyMemorySized].capabilities.push_back(CapabilityAddresses); - InstructionDesc[OpSampledImage].operands.push(OperandId, "'Image'"); InstructionDesc[OpSampledImage].operands.push(OperandId, "'Sampler'"); @@ -1932,7 +1604,6 @@ InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSampleImplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandId, "'Coordinate'"); @@ -1944,40 +1615,34 @@ InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSampleDrefImplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSampleDrefExplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSampleProjImplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSampleProjExplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSampleProjDrefImplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSampleProjDrefExplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageFetch].operands.push(OperandId, "'Image'"); InstructionDesc[OpImageFetch].operands.push(OperandId, "'Coordinate'"); @@ -1989,122 +1654,96 @@ InstructionDesc[OpImageGather].operands.push(OperandId, "'Component'"); InstructionDesc[OpImageGather].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageGather].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageGather].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageDrefGather].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageDrefGather].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageDrefGather].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageDrefGather].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageDrefGather].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageDrefGather].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseSampleImplicitLod].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseSampleExplicitLod].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseSampleDrefImplicitLod].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseSampleDrefExplicitLod].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseSampleProjImplicitLod].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseSampleProjExplicitLod].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseFetch].operands.push(OperandId, "'Image'"); InstructionDesc[OpImageSparseFetch].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseFetch].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseFetch].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseFetch].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseGather].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseGather].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseGather].operands.push(OperandId, "'Component'"); InstructionDesc[OpImageSparseGather].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseGather].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseGather].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseDrefGather].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseDrefGather].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseDrefGather].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageSparseDrefGather].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseDrefGather].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseDrefGather].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseRead].operands.push(OperandId, "'Image'"); InstructionDesc[OpImageSparseRead].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseRead].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseRead].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseRead].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseTexelsResident].operands.push(OperandId, "'Resident Code'"); - InstructionDesc[OpImageSparseTexelsResident].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageQuerySizeLod].operands.push(OperandId, "'Image'"); InstructionDesc[OpImageQuerySizeLod].operands.push(OperandId, "'Level of Detail'"); - InstructionDesc[OpImageQuerySizeLod].capabilities.push_back(CapabilityKernel); - InstructionDesc[OpImageQuerySizeLod].capabilities.push_back(CapabilityImageQuery); InstructionDesc[OpImageQuerySize].operands.push(OperandId, "'Image'"); - InstructionDesc[OpImageQuerySize].capabilities.push_back(CapabilityKernel); - InstructionDesc[OpImageQuerySize].capabilities.push_back(CapabilityImageQuery); InstructionDesc[OpImageQueryLod].operands.push(OperandId, "'Image'"); InstructionDesc[OpImageQueryLod].operands.push(OperandId, "'Coordinate'"); - InstructionDesc[OpImageQueryLod].capabilities.push_back(CapabilityImageQuery); InstructionDesc[OpImageQueryLevels].operands.push(OperandId, "'Image'"); - InstructionDesc[OpImageQueryLevels].capabilities.push_back(CapabilityKernel); - InstructionDesc[OpImageQueryLevels].capabilities.push_back(CapabilityImageQuery); InstructionDesc[OpImageQuerySamples].operands.push(OperandId, "'Image'"); - InstructionDesc[OpImageQuerySamples].capabilities.push_back(CapabilityKernel); - InstructionDesc[OpImageQuerySamples].capabilities.push_back(CapabilityImageQuery); InstructionDesc[OpImageQueryFormat].operands.push(OperandId, "'Image'"); - InstructionDesc[OpImageQueryFormat].capabilities.push_back(CapabilityKernel); InstructionDesc[OpImageQueryOrder].operands.push(OperandId, "'Image'"); - InstructionDesc[OpImageQueryOrder].capabilities.push_back(CapabilityKernel); InstructionDesc[OpAccessChain].operands.push(OperandId, "'Base'"); InstructionDesc[OpAccessChain].operands.push(OperandVariableIds, "'Indexes'"); @@ -2115,12 +1754,10 @@ InstructionDesc[OpPtrAccessChain].operands.push(OperandId, "'Base'"); InstructionDesc[OpPtrAccessChain].operands.push(OperandId, "'Element'"); InstructionDesc[OpPtrAccessChain].operands.push(OperandVariableIds, "'Indexes'"); - InstructionDesc[OpPtrAccessChain].capabilities.push_back(CapabilityAddresses); InstructionDesc[OpInBoundsPtrAccessChain].operands.push(OperandId, "'Base'"); InstructionDesc[OpInBoundsPtrAccessChain].operands.push(OperandId, "'Element'"); InstructionDesc[OpInBoundsPtrAccessChain].operands.push(OperandVariableIds, "'Indexes'"); - InstructionDesc[OpInBoundsPtrAccessChain].capabilities.push_back(CapabilityAddresses); InstructionDesc[OpSNegate].operands.push(OperandId, "'Operand'"); @@ -2147,65 +1784,49 @@ InstructionDesc[OpFConvert].operands.push(OperandId, "'Float Value'"); InstructionDesc[OpSatConvertSToU].operands.push(OperandId, "'Signed Value'"); - InstructionDesc[OpSatConvertSToU].capabilities.push_back(CapabilityKernel); InstructionDesc[OpSatConvertUToS].operands.push(OperandId, "'Unsigned Value'"); - InstructionDesc[OpSatConvertUToS].capabilities.push_back(CapabilityKernel); InstructionDesc[OpConvertPtrToU].operands.push(OperandId, "'Pointer'"); - InstructionDesc[OpConvertPtrToU].capabilities.push_back(CapabilityAddresses); InstructionDesc[OpConvertUToPtr].operands.push(OperandId, "'Integer Value'"); - InstructionDesc[OpConvertUToPtr].capabilities.push_back(CapabilityAddresses); InstructionDesc[OpPtrCastToGeneric].operands.push(OperandId, "'Pointer'"); - InstructionDesc[OpPtrCastToGeneric].capabilities.push_back(CapabilityKernel); InstructionDesc[OpGenericCastToPtr].operands.push(OperandId, "'Pointer'"); - InstructionDesc[OpGenericCastToPtr].capabilities.push_back(CapabilityKernel); InstructionDesc[OpGenericCastToPtrExplicit].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpGenericCastToPtrExplicit].operands.push(OperandStorage, "'Storage'"); - InstructionDesc[OpGenericCastToPtrExplicit].capabilities.push_back(CapabilityKernel); InstructionDesc[OpGenericPtrMemSemantics].operands.push(OperandId, "'Pointer'"); - InstructionDesc[OpGenericPtrMemSemantics].capabilities.push_back(CapabilityKernel); InstructionDesc[OpBitcast].operands.push(OperandId, "'Operand'"); InstructionDesc[OpQuantizeToF16].operands.push(OperandId, "'Value'"); - InstructionDesc[OpTranspose].capabilities.push_back(CapabilityMatrix); InstructionDesc[OpTranspose].operands.push(OperandId, "'Matrix'"); InstructionDesc[OpIsNan].operands.push(OperandId, "'x'"); InstructionDesc[OpIsInf].operands.push(OperandId, "'x'"); - InstructionDesc[OpIsFinite].capabilities.push_back(CapabilityKernel); InstructionDesc[OpIsFinite].operands.push(OperandId, "'x'"); - InstructionDesc[OpIsNormal].capabilities.push_back(CapabilityKernel); InstructionDesc[OpIsNormal].operands.push(OperandId, "'x'"); - InstructionDesc[OpSignBitSet].capabilities.push_back(CapabilityKernel); InstructionDesc[OpSignBitSet].operands.push(OperandId, "'x'"); - InstructionDesc[OpLessOrGreater].capabilities.push_back(CapabilityKernel); InstructionDesc[OpLessOrGreater].operands.push(OperandId, "'x'"); InstructionDesc[OpLessOrGreater].operands.push(OperandId, "'y'"); - InstructionDesc[OpOrdered].capabilities.push_back(CapabilityKernel); InstructionDesc[OpOrdered].operands.push(OperandId, "'x'"); InstructionDesc[OpOrdered].operands.push(OperandId, "'y'"); - InstructionDesc[OpUnordered].capabilities.push_back(CapabilityKernel); InstructionDesc[OpUnordered].operands.push(OperandId, "'x'"); InstructionDesc[OpUnordered].operands.push(OperandId, "'y'"); InstructionDesc[OpArrayLength].operands.push(OperandId, "'Structure'"); InstructionDesc[OpArrayLength].operands.push(OperandLiteralNumber, "'Array member'"); - InstructionDesc[OpArrayLength].capabilities.push_back(CapabilityShader); InstructionDesc[OpIAdd].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpIAdd].operands.push(OperandId, "'Operand 2'"); @@ -2252,23 +1873,18 @@ InstructionDesc[OpVectorTimesScalar].operands.push(OperandId, "'Vector'"); InstructionDesc[OpVectorTimesScalar].operands.push(OperandId, "'Scalar'"); - InstructionDesc[OpMatrixTimesScalar].capabilities.push_back(CapabilityMatrix); InstructionDesc[OpMatrixTimesScalar].operands.push(OperandId, "'Matrix'"); InstructionDesc[OpMatrixTimesScalar].operands.push(OperandId, "'Scalar'"); - InstructionDesc[OpVectorTimesMatrix].capabilities.push_back(CapabilityMatrix); InstructionDesc[OpVectorTimesMatrix].operands.push(OperandId, "'Vector'"); InstructionDesc[OpVectorTimesMatrix].operands.push(OperandId, "'Matrix'"); - InstructionDesc[OpMatrixTimesVector].capabilities.push_back(CapabilityMatrix); InstructionDesc[OpMatrixTimesVector].operands.push(OperandId, "'Matrix'"); InstructionDesc[OpMatrixTimesVector].operands.push(OperandId, "'Vector'"); - InstructionDesc[OpMatrixTimesMatrix].capabilities.push_back(CapabilityMatrix); InstructionDesc[OpMatrixTimesMatrix].operands.push(OperandId, "'LeftMatrix'"); InstructionDesc[OpMatrixTimesMatrix].operands.push(OperandId, "'RightMatrix'"); - InstructionDesc[OpOuterProduct].capabilities.push_back(CapabilityMatrix); InstructionDesc[OpOuterProduct].operands.push(OperandId, "'Vector 1'"); InstructionDesc[OpOuterProduct].operands.push(OperandId, "'Vector 2'"); @@ -2319,23 +1935,19 @@ InstructionDesc[OpBitwiseAnd].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpBitwiseAnd].operands.push(OperandId, "'Operand 2'"); - InstructionDesc[OpBitFieldInsert].capabilities.push_back(CapabilityShader); InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Base'"); InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Insert'"); InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Offset'"); InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Count'"); - - InstructionDesc[OpBitFieldSExtract].capabilities.push_back(CapabilityShader); + InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Base'"); InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Offset'"); InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Count'"); - InstructionDesc[OpBitFieldUExtract].capabilities.push_back(CapabilityShader); InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Base'"); InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Offset'"); InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Count'"); - InstructionDesc[OpBitReverse].capabilities.push_back(CapabilityShader); InstructionDesc[OpBitReverse].operands.push(OperandId, "'Base'"); InstructionDesc[OpBitCount].operands.push(OperandId, "'Base'"); @@ -2410,42 +2022,27 @@ InstructionDesc[OpFUnordGreaterThanEqual].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFUnordGreaterThanEqual].operands.push(OperandId, "'Operand 2'"); - InstructionDesc[OpDPdx].capabilities.push_back(CapabilityShader); InstructionDesc[OpDPdx].operands.push(OperandId, "'P'"); - InstructionDesc[OpDPdy].capabilities.push_back(CapabilityShader); InstructionDesc[OpDPdy].operands.push(OperandId, "'P'"); - InstructionDesc[OpFwidth].capabilities.push_back(CapabilityShader); InstructionDesc[OpFwidth].operands.push(OperandId, "'P'"); - InstructionDesc[OpDPdxFine].capabilities.push_back(CapabilityDerivativeControl); InstructionDesc[OpDPdxFine].operands.push(OperandId, "'P'"); - InstructionDesc[OpDPdyFine].capabilities.push_back(CapabilityDerivativeControl); InstructionDesc[OpDPdyFine].operands.push(OperandId, "'P'"); - InstructionDesc[OpFwidthFine].capabilities.push_back(CapabilityDerivativeControl); InstructionDesc[OpFwidthFine].operands.push(OperandId, "'P'"); - InstructionDesc[OpDPdxCoarse].capabilities.push_back(CapabilityDerivativeControl); InstructionDesc[OpDPdxCoarse].operands.push(OperandId, "'P'"); - InstructionDesc[OpDPdyCoarse].capabilities.push_back(CapabilityDerivativeControl); InstructionDesc[OpDPdyCoarse].operands.push(OperandId, "'P'"); - InstructionDesc[OpFwidthCoarse].capabilities.push_back(CapabilityDerivativeControl); InstructionDesc[OpFwidthCoarse].operands.push(OperandId, "'P'"); - InstructionDesc[OpEmitVertex].capabilities.push_back(CapabilityGeometry); - - InstructionDesc[OpEndPrimitive].capabilities.push_back(CapabilityGeometry); - InstructionDesc[OpEmitStreamVertex].operands.push(OperandId, "'Stream'"); - InstructionDesc[OpEmitStreamVertex].capabilities.push_back(CapabilityGeometryStreams); InstructionDesc[OpEndStreamPrimitive].operands.push(OperandId, "'Stream'"); - InstructionDesc[OpEndStreamPrimitive].capabilities.push_back(CapabilityGeometryStreams); InstructionDesc[OpControlBarrier].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpControlBarrier].operands.push(OperandScope, "'Memory'"); @@ -2485,7 +2082,6 @@ InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandMemorySemantics, "'Unequal'"); InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId, "'Value'"); InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId, "'Comparator'"); - InstructionDesc[OpAtomicCompareExchangeWeak].capabilities.push_back(CapabilityKernel); InstructionDesc[OpAtomicIIncrement].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicIIncrement].operands.push(OperandScope, "'Scope'"); @@ -2543,16 +2139,15 @@ InstructionDesc[OpAtomicFlagTestAndSet].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicFlagTestAndSet].operands.push(OperandScope, "'Scope'"); InstructionDesc[OpAtomicFlagTestAndSet].operands.push(OperandMemorySemantics, "'Semantics'"); - InstructionDesc[OpAtomicFlagTestAndSet].capabilities.push_back(CapabilityKernel); InstructionDesc[OpAtomicFlagClear].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicFlagClear].operands.push(OperandScope, "'Scope'"); InstructionDesc[OpAtomicFlagClear].operands.push(OperandMemorySemantics, "'Semantics'"); - InstructionDesc[OpAtomicFlagClear].capabilities.push_back(CapabilityKernel); InstructionDesc[OpLoopMerge].operands.push(OperandId, "'Merge Block'"); InstructionDesc[OpLoopMerge].operands.push(OperandId, "'Continue Target'"); InstructionDesc[OpLoopMerge].operands.push(OperandLoop, ""); + InstructionDesc[OpLoopMerge].operands.push(OperandOptionalLiteral, ""); InstructionDesc[OpSelectionMerge].operands.push(OperandId, "'Merge Block'"); InstructionDesc[OpSelectionMerge].operands.push(OperandSelect, ""); @@ -2568,19 +2163,15 @@ InstructionDesc[OpSwitch].operands.push(OperandId, "'Default'"); InstructionDesc[OpSwitch].operands.push(OperandVariableLiteralId, "'Target'"); - InstructionDesc[OpKill].capabilities.push_back(CapabilityShader); InstructionDesc[OpReturnValue].operands.push(OperandId, "'Value'"); InstructionDesc[OpLifetimeStart].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpLifetimeStart].operands.push(OperandLiteralNumber, "'Size'"); - InstructionDesc[OpLifetimeStart].capabilities.push_back(CapabilityKernel); InstructionDesc[OpLifetimeStop].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpLifetimeStop].operands.push(OperandLiteralNumber, "'Size'"); - InstructionDesc[OpLifetimeStop].capabilities.push_back(CapabilityKernel); - InstructionDesc[OpGroupAsyncCopy].capabilities.push_back(CapabilityKernel); InstructionDesc[OpGroupAsyncCopy].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Destination'"); InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Source'"); @@ -2588,77 +2179,62 @@ InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Stride'"); InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Event'"); - InstructionDesc[OpGroupWaitEvents].capabilities.push_back(CapabilityKernel); InstructionDesc[OpGroupWaitEvents].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupWaitEvents].operands.push(OperandId, "'Num Events'"); InstructionDesc[OpGroupWaitEvents].operands.push(OperandId, "'Events List'"); - InstructionDesc[OpGroupAll].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupAll].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupAll].operands.push(OperandId, "'Predicate'"); - InstructionDesc[OpGroupAny].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupAny].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupAny].operands.push(OperandId, "'Predicate'"); - InstructionDesc[OpGroupBroadcast].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupBroadcast].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupBroadcast].operands.push(OperandId, "'Value'"); InstructionDesc[OpGroupBroadcast].operands.push(OperandId, "'LocalId'"); - InstructionDesc[OpGroupIAdd].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupIAdd].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupIAdd].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupIAdd].operands.push(OperandId, "'X'"); - InstructionDesc[OpGroupFAdd].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupFAdd].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupFAdd].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupFAdd].operands.push(OperandId, "'X'"); - InstructionDesc[OpGroupUMin].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupUMin].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupUMin].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupUMin].operands.push(OperandId, "'X'"); - InstructionDesc[OpGroupSMin].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupSMin].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupSMin].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupSMin].operands.push(OperandId, "X"); - InstructionDesc[OpGroupFMin].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupFMin].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupFMin].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupFMin].operands.push(OperandId, "X"); - InstructionDesc[OpGroupUMax].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupUMax].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupUMax].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupUMax].operands.push(OperandId, "X"); - InstructionDesc[OpGroupSMax].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupSMax].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupSMax].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupSMax].operands.push(OperandId, "X"); - InstructionDesc[OpGroupFMax].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupFMax].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupFMax].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupFMax].operands.push(OperandId, "X"); - InstructionDesc[OpReadPipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpReadPipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpReadPipe].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpReadPipe].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpReadPipe].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpWritePipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpWritePipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpWritePipe].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpWritePipe].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpWritePipe].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpReservedReadPipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Reserve Id'"); InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Index'"); @@ -2666,7 +2242,6 @@ InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpReservedWritePipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Reserve Id'"); InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Index'"); @@ -2674,127 +2249,99 @@ InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpReserveReadPipePackets].capabilities.push_back(CapabilityPipes); InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Num Packets'"); InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpReserveWritePipePackets].capabilities.push_back(CapabilityPipes); InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Num Packets'"); InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpCommitReadPipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Reserve Id'"); InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpCommitWritePipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Reserve Id'"); InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpIsValidReserveId].capabilities.push_back(CapabilityPipes); InstructionDesc[OpIsValidReserveId].operands.push(OperandId, "'Reserve Id'"); - InstructionDesc[OpGetNumPipePackets].capabilities.push_back(CapabilityPipes); InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpGetMaxPipePackets].capabilities.push_back(CapabilityPipes); InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpGroupReserveReadPipePackets].capabilities.push_back(CapabilityPipes); InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Num Packets'"); InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpGroupReserveWritePipePackets].capabilities.push_back(CapabilityPipes); InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Num Packets'"); InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpGroupCommitReadPipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Reserve Id'"); InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpGroupCommitWritePipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Reserve Id'"); InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpBuildNDRange].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'GlobalWorkSize'"); InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'LocalWorkSize'"); InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'GlobalWorkOffset'"); - InstructionDesc[OpGetDefaultQueue].capabilities.push_back(CapabilityDeviceEnqueue); - - InstructionDesc[OpCaptureEventProfilingInfo].capabilities.push_back(CapabilityDeviceEnqueue); - InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId, "'Event'"); InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId, "'Profiling Info'"); InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId, "'Value'"); - InstructionDesc[OpSetUserEventStatus].capabilities.push_back(CapabilityDeviceEnqueue); - InstructionDesc[OpSetUserEventStatus].operands.push(OperandId, "'Event'"); InstructionDesc[OpSetUserEventStatus].operands.push(OperandId, "'Status'"); - InstructionDesc[OpIsValidEvent].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpIsValidEvent].operands.push(OperandId, "'Event'"); - InstructionDesc[OpCreateUserEvent].capabilities.push_back(CapabilityDeviceEnqueue); - - InstructionDesc[OpRetainEvent].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpRetainEvent].operands.push(OperandId, "'Event'"); - InstructionDesc[OpReleaseEvent].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpReleaseEvent].operands.push(OperandId, "'Event'"); - InstructionDesc[OpGetKernelWorkGroupSize].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Invoke'"); InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Param'"); InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Param Size'"); InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Param Align'"); - InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Invoke'"); InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Param'"); InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Param Size'"); InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Param Align'"); - InstructionDesc[OpGetKernelNDrangeSubGroupCount].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'ND Range'"); InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Invoke'"); InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Param'"); InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Param Size'"); InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Param Align'"); - InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'ND Range'"); InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Invoke'"); InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Param'"); InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Param Size'"); InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Param Align'"); - InstructionDesc[OpEnqueueKernel].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Queue'"); InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Flags'"); InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'ND Range'"); @@ -2807,82 +2354,215 @@ InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Param Align'"); InstructionDesc[OpEnqueueKernel].operands.push(OperandVariableIds, "'Local Size'"); - InstructionDesc[OpEnqueueMarker].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Queue'"); InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Num Events'"); InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Wait Events'"); InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Ret Event'"); + InstructionDesc[OpGroupNonUniformElect].operands.push(OperandScope, "'Execution'"); + + InstructionDesc[OpGroupNonUniformAll].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformAll].operands.push(OperandId, "X"); + + InstructionDesc[OpGroupNonUniformAny].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformAny].operands.push(OperandId, "X"); + + InstructionDesc[OpGroupNonUniformAllEqual].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformAllEqual].operands.push(OperandId, "X"); + + InstructionDesc[OpGroupNonUniformBroadcast].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBroadcast].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformBroadcast].operands.push(OperandId, "ID"); + + InstructionDesc[OpGroupNonUniformBroadcastFirst].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBroadcastFirst].operands.push(OperandId, "X"); + + InstructionDesc[OpGroupNonUniformBallot].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBallot].operands.push(OperandId, "X"); + + InstructionDesc[OpGroupNonUniformInverseBallot].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformInverseBallot].operands.push(OperandId, "X"); + + InstructionDesc[OpGroupNonUniformBallotBitExtract].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBallotBitExtract].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformBallotBitExtract].operands.push(OperandId, "Bit"); + + InstructionDesc[OpGroupNonUniformBallotBitCount].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBallotBitCount].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformBallotBitCount].operands.push(OperandId, "X"); + + InstructionDesc[OpGroupNonUniformBallotFindLSB].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBallotFindLSB].operands.push(OperandId, "X"); + + InstructionDesc[OpGroupNonUniformBallotFindMSB].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBallotFindMSB].operands.push(OperandId, "X"); + + InstructionDesc[OpGroupNonUniformShuffle].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformShuffle].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformShuffle].operands.push(OperandId, "'Id'"); + + InstructionDesc[OpGroupNonUniformShuffleXor].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformShuffleXor].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformShuffleXor].operands.push(OperandId, "Mask"); + + InstructionDesc[OpGroupNonUniformShuffleUp].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformShuffleUp].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformShuffleUp].operands.push(OperandId, "Offset"); + + InstructionDesc[OpGroupNonUniformShuffleDown].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformShuffleDown].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformShuffleDown].operands.push(OperandId, "Offset"); + + InstructionDesc[OpGroupNonUniformIAdd].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformIAdd].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformIAdd].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformIAdd].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformFAdd].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformFAdd].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformFAdd].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformFAdd].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformIMul].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformIMul].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformIMul].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformIMul].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformFMul].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformFMul].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformFMul].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformFMul].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformSMin].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformSMin].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformSMin].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformSMin].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformUMin].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformUMin].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformUMin].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformUMin].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformFMin].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformFMin].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformFMin].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformFMin].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformSMax].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformSMax].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformSMax].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformSMax].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformUMax].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformUMax].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformUMax].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformUMax].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformFMax].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformFMax].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformFMax].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformFMax].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformBitwiseAnd].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBitwiseAnd].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformBitwiseAnd].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformBitwiseAnd].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformBitwiseOr].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBitwiseOr].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformBitwiseOr].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformBitwiseOr].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformBitwiseXor].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBitwiseXor].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformBitwiseXor].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformBitwiseXor].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformLogicalAnd].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformLogicalAnd].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformLogicalAnd].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformLogicalAnd].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformLogicalOr].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformLogicalOr].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformLogicalOr].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformLogicalOr].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformLogicalXor].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformLogicalXor].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformLogicalXor].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformLogicalXor].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformQuadBroadcast].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformQuadBroadcast].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformQuadBroadcast].operands.push(OperandId, "'Id'"); + + InstructionDesc[OpGroupNonUniformQuadSwap].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformQuadSwap].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformQuadSwap].operands.push(OperandLiteralNumber, "'Direction'"); + InstructionDesc[OpSubgroupBallotKHR].operands.push(OperandId, "'Predicate'"); InstructionDesc[OpSubgroupFirstInvocationKHR].operands.push(OperandId, "'Value'"); - InstructionDesc[OpSubgroupAnyKHR].capabilities.push_back(CapabilitySubgroupVoteKHR); InstructionDesc[OpSubgroupAnyKHR].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpSubgroupAnyKHR].operands.push(OperandId, "'Predicate'"); - InstructionDesc[OpSubgroupAllKHR].capabilities.push_back(CapabilitySubgroupVoteKHR); InstructionDesc[OpSubgroupAllKHR].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpSubgroupAllKHR].operands.push(OperandId, "'Predicate'"); - InstructionDesc[OpSubgroupAllEqualKHR].capabilities.push_back(CapabilitySubgroupVoteKHR); InstructionDesc[OpSubgroupAllEqualKHR].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpSubgroupAllEqualKHR].operands.push(OperandId, "'Predicate'"); - InstructionDesc[OpSubgroupReadInvocationKHR].capabilities.push_back(CapabilityGroups); InstructionDesc[OpSubgroupReadInvocationKHR].operands.push(OperandId, "'Value'"); InstructionDesc[OpSubgroupReadInvocationKHR].operands.push(OperandId, "'Index'"); + InstructionDesc[OpModuleProcessed].operands.push(OperandLiteralString, "'process'"); + #ifdef AMD_EXTENSIONS - InstructionDesc[OpGroupIAddNonUniformAMD].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandId, "'X'"); - InstructionDesc[OpGroupFAddNonUniformAMD].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupFAddNonUniformAMD].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupFAddNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupFAddNonUniformAMD].operands.push(OperandId, "'X'"); - InstructionDesc[OpGroupUMinNonUniformAMD].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupUMinNonUniformAMD].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupUMinNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupUMinNonUniformAMD].operands.push(OperandId, "'X'"); - InstructionDesc[OpGroupSMinNonUniformAMD].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupSMinNonUniformAMD].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupSMinNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupSMinNonUniformAMD].operands.push(OperandId, "X"); - InstructionDesc[OpGroupFMinNonUniformAMD].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupFMinNonUniformAMD].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupFMinNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupFMinNonUniformAMD].operands.push(OperandId, "X"); - InstructionDesc[OpGroupUMaxNonUniformAMD].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupUMaxNonUniformAMD].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupUMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupUMaxNonUniformAMD].operands.push(OperandId, "X"); - InstructionDesc[OpGroupSMaxNonUniformAMD].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupSMaxNonUniformAMD].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupSMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupSMaxNonUniformAMD].operands.push(OperandId, "X"); - InstructionDesc[OpGroupFMaxNonUniformAMD].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandId, "X"); - InstructionDesc[OpFragmentMaskFetchAMD].capabilities.push_back(CapabilityFragmentMaskAMD); InstructionDesc[OpFragmentMaskFetchAMD].operands.push(OperandId, "'Image'"); InstructionDesc[OpFragmentMaskFetchAMD].operands.push(OperandId, "'Coordinate'"); - InstructionDesc[OpFragmentFetchAMD].capabilities.push_back(CapabilityFragmentMaskAMD); InstructionDesc[OpFragmentFetchAMD].operands.push(OperandId, "'Image'"); InstructionDesc[OpFragmentFetchAMD].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpFragmentFetchAMD].operands.push(OperandId, "'Fragment Index'"); #endif + +#ifdef NV_EXTENSIONS + InstructionDesc[OpGroupNonUniformPartitionNV].operands.push(OperandId, "X"); +#endif } }; // end spv namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/doc.h vulkan-1.1.73+dfsg/external/glslang/SPIRV/doc.h --- vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/doc.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/SPIRV/doc.h 2018-04-27 11:46:26.000000000 +0000 @@ -190,7 +190,6 @@ class EnumParameters { public: EnumParameters() : desc(0) { } - EnumCaps caps; const char* desc; }; @@ -235,7 +234,6 @@ bool hasType() const { return typePresent != 0; } const char* opDesc; - EnumCaps capabilities; OpcodeClass opClass; OperandParameters operands; @@ -244,8 +242,6 @@ int resultPresent : 1; }; -const int OpcodeCeiling = 321; - // The set of objects that hold all the instruction/operand // parameterization information. extern InstructionParameters InstructionDesc[]; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/GlslangToSpv.cpp vulkan-1.1.73+dfsg/external/glslang/SPIRV/GlslangToSpv.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/GlslangToSpv.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/SPIRV/GlslangToSpv.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ // // Copyright (C) 2014-2016 LunarG, Inc. // Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -44,6 +45,7 @@ namespace spv { #include "GLSL.std.450.h" #include "GLSL.ext.KHR.h" + #include "GLSL.ext.EXT.h" #ifdef AMD_EXTENSIONS #include "GLSL.ext.AMD.h" #endif @@ -52,13 +54,12 @@ #endif } -#ifdef ENABLE_OPT +#if ENABLE_OPT #include "spirv-tools/optimizer.hpp" #include "message.h" - #include "SPVRemapper.h" #endif -#ifdef ENABLE_OPT +#if ENABLE_OPT using namespace spvtools; #endif @@ -78,11 +79,6 @@ namespace { -// For low-order part of the generator's magic number. Bump up -// when there is a change in the style (e.g., if SSA form changes, -// or a different instruction sequence to do something gets used). -const int GeneratorVersion = 2; - namespace { class SpecConstantOpModeGuard { public: @@ -102,7 +98,14 @@ spv::Builder* builder_; bool previous_flag_; }; -} + +struct OpDecorations { + spv::Decoration precision; + spv::Decoration noContraction; + spv::Decoration nonUniform; +}; + +} // namespace // // The main holder of information for translating glslang to SPIR-V. @@ -111,7 +114,8 @@ // class TGlslangToSpvTraverser : public glslang::TIntermTraverser { public: - TGlslangToSpvTraverser(const glslang::TIntermediate*, spv::SpvBuildLogger* logger, glslang::SpvOptions& options); + TGlslangToSpvTraverser(unsigned int spvVersion, const glslang::TIntermediate*, spv::SpvBuildLogger* logger, + glslang::SpvOptions& options); virtual ~TGlslangToSpvTraverser() { } bool visitAggregate(glslang::TVisit, glslang::TIntermAggregate*); @@ -128,20 +132,27 @@ void dumpSpv(std::vector& out); protected: + TGlslangToSpvTraverser(TGlslangToSpvTraverser&); + TGlslangToSpvTraverser& operator=(TGlslangToSpvTraverser&); + spv::Decoration TranslateInterpolationDecoration(const glslang::TQualifier& qualifier); spv::Decoration TranslateAuxiliaryStorageDecoration(const glslang::TQualifier& qualifier); + spv::Decoration TranslateNonUniformDecoration(const glslang::TQualifier& qualifier); spv::BuiltIn TranslateBuiltInDecoration(glslang::TBuiltInVariable, bool memberDeclaration); spv::ImageFormat TranslateImageFormat(const glslang::TType& type); - spv::SelectionControlMask TranslateSelectionControl(glslang::TSelectionControl) const; - spv::LoopControlMask TranslateLoopControl(glslang::TLoopControl) const; + spv::SelectionControlMask TranslateSelectionControl(const glslang::TIntermSelection&) const; + spv::SelectionControlMask TranslateSwitchControl(const glslang::TIntermSwitch&) const; + spv::LoopControlMask TranslateLoopControl(const glslang::TIntermLoop&, unsigned int& dependencyLength) const; spv::StorageClass TranslateStorageClass(const glslang::TType&); + void addIndirectionIndexCapabilities(const glslang::TType& baseType, const glslang::TType& indexType); spv::Id createSpvVariable(const glslang::TIntermSymbol*); spv::Id getSampledType(const glslang::TSampler&); spv::Id getInvertedSwizzleType(const glslang::TIntermTyped&); spv::Id createInvertedSwizzle(spv::Decoration precision, const glslang::TIntermTyped&, spv::Id parentResult); void convertSwizzle(const glslang::TIntermAggregate&, std::vector& swizzle); spv::Id convertGlslangToSpvType(const glslang::TType& type); - spv::Id convertGlslangToSpvType(const glslang::TType& type, glslang::TLayoutPacking, const glslang::TQualifier&); + spv::Id convertGlslangToSpvType(const glslang::TType& type, glslang::TLayoutPacking, const glslang::TQualifier&, + bool lastBufferBlockMember); bool filterMember(const glslang::TType& member); spv::Id convertGlslangStructToSpvType(const glslang::TType&, const glslang::TTypeList* glslangStruct, glslang::TLayoutPacking, const glslang::TQualifier&); @@ -154,7 +165,8 @@ glslang::TLayoutPacking getExplicitLayout(const glslang::TType& type) const; int getArrayStride(const glslang::TType& arrayType, glslang::TLayoutPacking, glslang::TLayoutMatrix); int getMatrixStride(const glslang::TType& matrixType, glslang::TLayoutPacking, glslang::TLayoutMatrix); - void updateMemberOffset(const glslang::TType& structType, const glslang::TType& memberType, int& currentOffset, int& nextOffset, glslang::TLayoutPacking, glslang::TLayoutMatrix); + void updateMemberOffset(const glslang::TType& structType, const glslang::TType& memberType, int& currentOffset, + int& nextOffset, glslang::TLayoutPacking, glslang::TLayoutMatrix); void declareUseOfStructMember(const glslang::TTypeList& members, int glslangMember); bool isShaderEntryPoint(const glslang::TIntermAggregate* node); @@ -169,28 +181,37 @@ spv::Id createImageTextureFunctionCall(glslang::TIntermOperator* node); spv::Id handleUserFunctionCall(const glslang::TIntermAggregate*); - spv::Id createBinaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id left, spv::Id right, glslang::TBasicType typeProxy, bool reduceComparison = true); - spv::Id createBinaryMatrixOperation(spv::Op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id left, spv::Id right); - spv::Id createUnaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id operand,glslang::TBasicType typeProxy); - spv::Id createUnaryMatrixOperation(spv::Op op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id operand,glslang::TBasicType typeProxy); - spv::Id createConversion(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id destTypeId, spv::Id operand, glslang::TBasicType typeProxy); + spv::Id createBinaryOperation(glslang::TOperator op, OpDecorations&, spv::Id typeId, spv::Id left, spv::Id right, + glslang::TBasicType typeProxy, bool reduceComparison = true); + spv::Id createBinaryMatrixOperation(spv::Op, OpDecorations&, spv::Id typeId, spv::Id left, spv::Id right); + spv::Id createUnaryOperation(glslang::TOperator op, OpDecorations&, spv::Id typeId, spv::Id operand, + glslang::TBasicType typeProxy); + spv::Id createUnaryMatrixOperation(spv::Op op, OpDecorations&, spv::Id typeId, spv::Id operand, + glslang::TBasicType typeProxy); + spv::Id createConversion(glslang::TOperator op, OpDecorations&, spv::Id destTypeId, spv::Id operand, + glslang::TBasicType typeProxy); + spv::Id createConversionOperation(glslang::TOperator op, spv::Id operand, int vectorSize); spv::Id makeSmearedConstant(spv::Id constant, int vectorSize); spv::Id createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy); spv::Id createInvocationsOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy); spv::Id CreateInvocationsVectorOperation(spv::Op op, spv::GroupOperation groupOperation, spv::Id typeId, std::vector& operands); + spv::Id createSubgroupOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy); spv::Id createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy); spv::Id createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId); spv::Id getSymbolId(const glslang::TIntermSymbol* node); - void addDecoration(spv::Id id, spv::Decoration dec); - void addDecoration(spv::Id id, spv::Decoration dec, unsigned value); - void addMemberDecoration(spv::Id id, int member, spv::Decoration dec); - void addMemberDecoration(spv::Id id, int member, spv::Decoration dec, unsigned value); spv::Id createSpvConstant(const glslang::TIntermTyped&); spv::Id createSpvConstantFromConstUnionArray(const glslang::TType& type, const glslang::TConstUnionArray&, int& nextConst, bool specConstant); bool isTrivialLeaf(const glslang::TIntermTyped* node); bool isTrivial(const glslang::TIntermTyped* node); spv::Id createShortCircuit(glslang::TOperator, glslang::TIntermTyped& left, glslang::TIntermTyped& right); +#ifdef AMD_EXTENSIONS spv::Id getExtBuiltins(const char* name); +#endif + void addPre13Extension(const char* ext) + { + if (builder.getSpvVersion() < glslang::EShTargetSpv_1_3) + builder.addExtension(ext); + } glslang::SpvOptions& options; spv::Function* shaderEntry; @@ -214,8 +235,10 @@ std::unordered_set rValueParameters; // set of formal function parameters passed as rValues, rather than a pointer std::unordered_map functionMap; std::unordered_map structMap[glslang::ElpCount][glslang::ElmCount]; - std::unordered_map > memberRemapper; // for mapping glslang block indices to spv indices (e.g., due to hidden members) + // for mapping glslang block indices to spv indices (e.g., due to hidden members): + std::unordered_map > memberRemapper; std::stack breakForLoop; // false means break for switch + std::unordered_map counterOriginator; }; // @@ -423,6 +446,17 @@ return spv::DecorationMax; } +// If glslang type is nonUniform, return SPIR-V NonUniform decoration. +spv::Decoration TGlslangToSpvTraverser::TranslateNonUniformDecoration(const glslang::TQualifier& qualifier) +{ + if (qualifier.isNonUniform()) { + builder.addExtension("SPV_EXT_descriptor_indexing"); + builder.addCapability(spv::CapabilityShaderNonUniformEXT); + return spv::DecorationNonUniformEXT; + } else + return spv::DecorationMax; +} + // Translate a glslang built-in variable to a SPIR-V built in decoration. Also generate // associated capabilities when required. For some built-in variables, a capability // is generated only when using the variable in an executable instruction, but not when @@ -484,7 +518,6 @@ return spv::BuiltInSamplePosition; case glslang::EbvSampleMask: - builder.addCapability(spv::CapabilitySampleRateShading); return spv::BuiltInSampleMask; case glslang::EbvLayer: @@ -505,17 +538,17 @@ case glslang::EbvInstanceIndex: return spv::BuiltInInstanceIndex; case glslang::EbvBaseVertex: - builder.addExtension(spv::E_SPV_KHR_shader_draw_parameters); + addPre13Extension(spv::E_SPV_KHR_shader_draw_parameters); builder.addCapability(spv::CapabilityDrawParameters); return spv::BuiltInBaseVertex; case glslang::EbvBaseInstance: - builder.addExtension(spv::E_SPV_KHR_shader_draw_parameters); + addPre13Extension(spv::E_SPV_KHR_shader_draw_parameters); builder.addCapability(spv::CapabilityDrawParameters); return spv::BuiltInBaseInstance; case glslang::EbvDrawId: - builder.addExtension(spv::E_SPV_KHR_shader_draw_parameters); + addPre13Extension(spv::E_SPV_KHR_shader_draw_parameters); builder.addCapability(spv::CapabilityDrawParameters); return spv::BuiltInDrawIndex; @@ -581,6 +614,46 @@ builder.addCapability(spv::CapabilitySubgroupBallotKHR); return spv::BuiltInSubgroupLtMaskKHR; + case glslang::EbvNumSubgroups: + builder.addCapability(spv::CapabilityGroupNonUniform); + return spv::BuiltInNumSubgroups; + + case glslang::EbvSubgroupID: + builder.addCapability(spv::CapabilityGroupNonUniform); + return spv::BuiltInSubgroupId; + + case glslang::EbvSubgroupSize2: + builder.addCapability(spv::CapabilityGroupNonUniform); + return spv::BuiltInSubgroupSize; + + case glslang::EbvSubgroupInvocation2: + builder.addCapability(spv::CapabilityGroupNonUniform); + return spv::BuiltInSubgroupLocalInvocationId; + + case glslang::EbvSubgroupEqMask2: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformBallot); + return spv::BuiltInSubgroupEqMask; + + case glslang::EbvSubgroupGeMask2: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformBallot); + return spv::BuiltInSubgroupGeMask; + + case glslang::EbvSubgroupGtMask2: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformBallot); + return spv::BuiltInSubgroupGtMask; + + case glslang::EbvSubgroupLeMask2: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformBallot); + return spv::BuiltInSubgroupLeMask; + + case glslang::EbvSubgroupLtMask2: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformBallot); + return spv::BuiltInSubgroupLtMask; #ifdef AMD_EXTENSIONS case glslang::EbvBaryCoordNoPersp: builder.addExtension(spv::E_SPV_AMD_shader_explicit_vertex_parameter); @@ -612,12 +685,12 @@ #endif case glslang::EbvDeviceIndex: - builder.addExtension(spv::E_SPV_KHR_device_group); + addPre13Extension(spv::E_SPV_KHR_device_group); builder.addCapability(spv::CapabilityDeviceGroup); return spv::BuiltInDeviceIndex; case glslang::EbvViewIndex: - builder.addExtension(spv::E_SPV_KHR_multiview); + addPre13Extension(spv::E_SPV_KHR_multiview); builder.addCapability(spv::CapabilityMultiView); return spv::BuiltInViewIndex; @@ -652,6 +725,10 @@ builder.addCapability(spv::CapabilityPerViewAttributesNV); } return spv::BuiltInViewportMaskPerViewNV; + case glslang::EbvFragFullyCoveredNV: + builder.addExtension(spv::E_SPV_EXT_fragment_fully_covered); + builder.addCapability(spv::CapabilityFragmentFullyCoveredEXT); + return spv::BuiltInFullyCoveredEXT; #endif default: return spv::BuiltInMax; @@ -746,26 +823,42 @@ } } -spv::SelectionControlMask TGlslangToSpvTraverser::TranslateSelectionControl(glslang::TSelectionControl selectionControl) const +spv::SelectionControlMask TGlslangToSpvTraverser::TranslateSelectionControl(const glslang::TIntermSelection& selectionNode) const { - switch (selectionControl) { - case glslang::ESelectionControlNone: return spv::SelectionControlMaskNone; - case glslang::ESelectionControlFlatten: return spv::SelectionControlFlattenMask; - case glslang::ESelectionControlDontFlatten: return spv::SelectionControlDontFlattenMask; - default: return spv::SelectionControlMaskNone; - } + if (selectionNode.getFlatten()) + return spv::SelectionControlFlattenMask; + if (selectionNode.getDontFlatten()) + return spv::SelectionControlDontFlattenMask; + return spv::SelectionControlMaskNone; +} + +spv::SelectionControlMask TGlslangToSpvTraverser::TranslateSwitchControl(const glslang::TIntermSwitch& switchNode) const +{ + if (switchNode.getFlatten()) + return spv::SelectionControlFlattenMask; + if (switchNode.getDontFlatten()) + return spv::SelectionControlDontFlattenMask; + return spv::SelectionControlMaskNone; } -spv::LoopControlMask TGlslangToSpvTraverser::TranslateLoopControl(glslang::TLoopControl loopControl) const +// return a non-0 dependency if the dependency argument must be set +spv::LoopControlMask TGlslangToSpvTraverser::TranslateLoopControl(const glslang::TIntermLoop& loopNode, + unsigned int& dependencyLength) const { - switch (loopControl) { - case glslang::ELoopControlNone: return spv::LoopControlMaskNone; - case glslang::ELoopControlUnroll: return spv::LoopControlUnrollMask; - case glslang::ELoopControlDontUnroll: return spv::LoopControlDontUnrollMask; - // TODO: DependencyInfinite - // TODO: DependencyLength - default: return spv::LoopControlMaskNone; + spv::LoopControlMask control = spv::LoopControlMaskNone; + + if (loopNode.getDontUnroll()) + control = control | spv::LoopControlDontUnrollMask; + if (loopNode.getUnroll()) + control = control | spv::LoopControlUnrollMask; + if (unsigned(loopNode.getLoopDependency()) == glslang::TIntermLoop::dependencyInfinite) + control = control | spv::LoopControlDependencyInfiniteMask; + else if (loopNode.getLoopDependency() > 0) { + control = control | spv::LoopControlDependencyLengthMask; + dependencyLength = loopNode.getLoopDependency(); } + + return control; } // Translate glslang type to SPIR-V storage class. @@ -785,7 +878,7 @@ } if (glslangIntermediate->usingStorageBuffer() && type.getQualifier().storage == glslang::EvqBuffer) { - builder.addExtension(spv::E_SPV_KHR_storage_buffer_storage_class); + addPre13Extension(spv::E_SPV_KHR_storage_buffer_storage_class); return spv::StorageClassStorageBuffer; } @@ -810,6 +903,42 @@ return spv::StorageClassFunction; } +// Add capabilities pertaining to how an array is indexed. +void TGlslangToSpvTraverser::addIndirectionIndexCapabilities(const glslang::TType& baseType, + const glslang::TType& indexType) +{ + if (indexType.getQualifier().isNonUniform()) { + // deal with an asserted non-uniform index + if (baseType.getBasicType() == glslang::EbtSampler) { + if (baseType.getQualifier().hasAttachment()) + builder.addCapability(spv::CapabilityInputAttachmentArrayNonUniformIndexingEXT); + else if (baseType.isImage() && baseType.getSampler().dim == glslang::EsdBuffer) + builder.addCapability(spv::CapabilityStorageTexelBufferArrayNonUniformIndexingEXT); + else if (baseType.isTexture() && baseType.getSampler().dim == glslang::EsdBuffer) + builder.addCapability(spv::CapabilityUniformTexelBufferArrayNonUniformIndexingEXT); + else if (baseType.isImage()) + builder.addCapability(spv::CapabilityStorageImageArrayNonUniformIndexingEXT); + else if (baseType.isTexture()) + builder.addCapability(spv::CapabilitySampledImageArrayNonUniformIndexingEXT); + } else if (baseType.getBasicType() == glslang::EbtBlock) { + if (baseType.getQualifier().storage == glslang::EvqBuffer) + builder.addCapability(spv::CapabilityStorageBufferArrayNonUniformIndexingEXT); + else if (baseType.getQualifier().storage == glslang::EvqUniform) + builder.addCapability(spv::CapabilityUniformBufferArrayNonUniformIndexingEXT); + } + } else { + // assume a dynamically uniform index + if (baseType.getBasicType() == glslang::EbtSampler) { + if (baseType.getQualifier().hasAttachment()) + builder.addCapability(spv::CapabilityInputAttachmentArrayDynamicIndexingEXT); + else if (baseType.isImage() && baseType.getSampler().dim == glslang::EsdBuffer) + builder.addCapability(spv::CapabilityStorageTexelBufferArrayDynamicIndexingEXT); + else if (baseType.isTexture() && baseType.getSampler().dim == glslang::EsdBuffer) + builder.addCapability(spv::CapabilityUniformTexelBufferArrayDynamicIndexingEXT); + } + } +} + // Return whether or not the given type is something that should be tied to a // descriptor set. bool IsDescriptorResource(const glslang::TType& type) @@ -879,13 +1008,13 @@ // Implement the TGlslangToSpvTraverser class. // -TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* glslangIntermediate, +TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const glslang::TIntermediate* glslangIntermediate, spv::SpvBuildLogger* buildLogger, glslang::SpvOptions& options) : TIntermTraverser(true, false, true), options(options), shaderEntry(nullptr), currentFunction(nullptr), sequenceDepth(0), logger(buildLogger), - builder((glslang::GetKhronosToolId() << 16) | GeneratorVersion, logger), + builder(spvVersion, (glslang::GetKhronosToolId() << 16) | glslang::GetSpirvGeneratorVersion(), logger), inEntryPoint(false), entryPointTerminated(false), linkageOnly(false), glslangIntermediate(glslangIntermediate) { @@ -1128,6 +1257,38 @@ else builder.setAccessChainLValue(id); } + + // Process linkage-only nodes for any special additional interface work. + if (linkageOnly) { + if (glslangIntermediate->getHlslFunctionality1()) { + // Map implicit counter buffers to their originating buffers, which should have been + // seen by now, given earlier pruning of unused counters, and preservation of order + // of declaration. + if (symbol->getType().getQualifier().isUniformOrBuffer()) { + if (!glslangIntermediate->hasCounterBufferName(symbol->getName())) { + // Save possible originating buffers for counter buffers, keyed by + // making the potential counter-buffer name. + std::string keyName = symbol->getName().c_str(); + keyName = glslangIntermediate->addCounterBufferName(keyName); + counterOriginator[keyName] = symbol; + } else { + // Handle a counter buffer, by finding the saved originating buffer. + std::string keyName = symbol->getName().c_str(); + auto it = counterOriginator.find(keyName); + if (it != counterOriginator.end()) { + id = getSymbolId(it->second); + if (id != spv::NoResult) { + spv::Id counterId = getSymbolId(symbol); + if (counterId != spv::NoResult) { + builder.addExtension("SPV_GOOGLE_hlsl_functionality1"); + builder.addDecorationId(id, spv::DecorationHlslCounterBufferGOOGLE, counterId); + } + } + } + } + } + } + } } bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::TIntermBinary* node) @@ -1176,8 +1337,10 @@ spv::Id leftRValue = accessChainLoad(node->getLeft()->getType()); // do the operation - rValue = createBinaryOperation(node->getOp(), TranslatePrecisionDecoration(node->getOperationPrecision()), - TranslateNoContractionDecoration(node->getType().getQualifier()), + OpDecorations decorations = { TranslatePrecisionDecoration(node->getOperationPrecision()), + TranslateNoContractionDecoration(node->getType().getQualifier()), + TranslateNonUniformDecoration(node->getType().getQualifier()) }; + rValue = createBinaryOperation(node->getOp(), decorations, convertGlslangToSpvType(node->getType()), leftRValue, rValue, node->getType().getBasicType()); @@ -1252,6 +1415,8 @@ node->getRight()->traverse(this); spv::Id index = accessChainLoad(node->getRight()->getType()); + addIndirectionIndexCapabilities(node->getLeft()->getType(), node->getRight()->getType()); + // restore the saved access chain builder.setAccessChain(partial); @@ -1304,8 +1469,10 @@ spv::Id right = accessChainLoad(node->getRight()->getType()); // get result - spv::Id result = createBinaryOperation(node->getOp(), TranslatePrecisionDecoration(node->getOperationPrecision()), - TranslateNoContractionDecoration(node->getType().getQualifier()), + OpDecorations decorations = { TranslatePrecisionDecoration(node->getOperationPrecision()), + TranslateNoContractionDecoration(node->getType().getQualifier()), + TranslateNonUniformDecoration(node->getType().getQualifier()) }; + spv::Id result = createBinaryOperation(node->getOp(), decorations, convertGlslangToSpvType(node->getType()), left, right, node->getLeft()->getType().getBasicType()); @@ -1343,10 +1510,15 @@ if (node->getOp() == glslang::EOpArrayLength) { // Quite special; won't want to evaluate the operand. + // Currently, the front-end does not allow .length() on an array until it is sized, + // except for the last block membeor of an SSBO. + // TODO: If this changes, link-time sized arrays might show up here, and need their + // size extracted. + // Normal .length() would have been constant folded by the front-end. // So, this has to be block.lastMember.length(). // SPV wants "block" and member number as the operands, go get them. - assert(node->getOperand()->getType().isRuntimeSizedArray()); + glslang::TIntermTyped* block = node->getOperand()->getAsBinaryNode()->getLeft(); block->traverse(this); unsigned int member = node->getOperand()->getAsBinaryNode()->getRight()->getAsConstantUnion()->getConstArray()[0].getUConst(); @@ -1383,20 +1555,23 @@ else operand = accessChainLoad(node->getOperand()->getType()); - spv::Decoration precision = TranslatePrecisionDecoration(node->getOperationPrecision()); - spv::Decoration noContraction = TranslateNoContractionDecoration(node->getType().getQualifier()); + OpDecorations decorations = { TranslatePrecisionDecoration(node->getOperationPrecision()), + TranslateNoContractionDecoration(node->getType().getQualifier()), + TranslateNonUniformDecoration(node->getType().getQualifier()) }; // it could be a conversion if (! result) - result = createConversion(node->getOp(), precision, noContraction, resultType(), operand, node->getOperand()->getBasicType()); + result = createConversion(node->getOp(), decorations, resultType(), operand, node->getOperand()->getBasicType()); // if not, then possibly an operation if (! result) - result = createUnaryOperation(node->getOp(), precision, noContraction, resultType(), operand, node->getOperand()->getBasicType()); + result = createUnaryOperation(node->getOp(), decorations, resultType(), operand, node->getOperand()->getBasicType()); if (result) { - if (invertedType) - result = createInvertedSwizzle(precision, *node->getOperand(), result); + if (invertedType) { + result = createInvertedSwizzle(decorations.precision, *node->getOperand(), result); + builder.addDecoration(result, decorations.nonUniform); + } builder.clearAccessChain(); builder.setAccessChainRValue(result); @@ -1417,16 +1592,14 @@ one = builder.makeFloatConstant(1.0F); else if (node->getBasicType() == glslang::EbtDouble) one = builder.makeDoubleConstant(1.0); -#ifdef AMD_EXTENSIONS else if (node->getBasicType() == glslang::EbtFloat16) one = builder.makeFloat16Constant(1.0F); -#endif - else if (node->getBasicType() == glslang::EbtInt64 || node->getBasicType() == glslang::EbtUint64) - one = builder.makeInt64Constant(1); -#ifdef AMD_EXTENSIONS + else if (node->getBasicType() == glslang::EbtInt8 || node->getBasicType() == glslang::EbtUint8) + one = builder.makeInt8Constant(1); else if (node->getBasicType() == glslang::EbtInt16 || node->getBasicType() == glslang::EbtUint16) one = builder.makeInt16Constant(1); -#endif + else if (node->getBasicType() == glslang::EbtInt64 || node->getBasicType() == glslang::EbtUint64) + one = builder.makeInt64Constant(1); else one = builder.makeIntConstant(1); glslang::TOperator op; @@ -1436,8 +1609,7 @@ else op = glslang::EOpSub; - spv::Id result = createBinaryOperation(op, precision, - TranslateNoContractionDecoration(node->getType().getQualifier()), + spv::Id result = createBinaryOperation(op, decorations, convertGlslangToSpvType(node->getType()), operand, one, node->getType().getBasicType()); assert(result != spv::NoResult); @@ -1631,7 +1803,6 @@ case glslang::EOpConstructBMat4x2: case glslang::EOpConstructBMat4x3: case glslang::EOpConstructBMat4x4: -#ifdef AMD_EXTENSIONS case glslang::EOpConstructF16Mat2x2: case glslang::EOpConstructF16Mat2x3: case glslang::EOpConstructF16Mat2x4: @@ -1641,7 +1812,6 @@ case glslang::EOpConstructF16Mat4x2: case glslang::EOpConstructF16Mat4x3: case glslang::EOpConstructF16Mat4x4: -#endif isMatrix = true; // fall through case glslang::EOpConstructFloat: @@ -1652,16 +1822,30 @@ case glslang::EOpConstructDVec2: case glslang::EOpConstructDVec3: case glslang::EOpConstructDVec4: -#ifdef AMD_EXTENSIONS case glslang::EOpConstructFloat16: case glslang::EOpConstructF16Vec2: case glslang::EOpConstructF16Vec3: case glslang::EOpConstructF16Vec4: -#endif case glslang::EOpConstructBool: case glslang::EOpConstructBVec2: case glslang::EOpConstructBVec3: case glslang::EOpConstructBVec4: + case glslang::EOpConstructInt8: + case glslang::EOpConstructI8Vec2: + case glslang::EOpConstructI8Vec3: + case glslang::EOpConstructI8Vec4: + case glslang::EOpConstructUint8: + case glslang::EOpConstructU8Vec2: + case glslang::EOpConstructU8Vec3: + case glslang::EOpConstructU8Vec4: + case glslang::EOpConstructInt16: + case glslang::EOpConstructI16Vec2: + case glslang::EOpConstructI16Vec3: + case glslang::EOpConstructI16Vec4: + case glslang::EOpConstructUint16: + case glslang::EOpConstructU16Vec2: + case glslang::EOpConstructU16Vec3: + case glslang::EOpConstructU16Vec4: case glslang::EOpConstructInt: case glslang::EOpConstructIVec2: case glslang::EOpConstructIVec3: @@ -1678,16 +1862,6 @@ case glslang::EOpConstructU64Vec2: case glslang::EOpConstructU64Vec3: case glslang::EOpConstructU64Vec4: -#ifdef AMD_EXTENSIONS - case glslang::EOpConstructInt16: - case glslang::EOpConstructI16Vec2: - case glslang::EOpConstructI16Vec3: - case glslang::EOpConstructI16Vec4: - case glslang::EOpConstructUint16: - case glslang::EOpConstructU16Vec2: - case glslang::EOpConstructU16Vec3: - case glslang::EOpConstructU16Vec4: -#endif case glslang::EOpConstructStruct: case glslang::EOpConstructTextureSampler: { @@ -1763,10 +1937,16 @@ case glslang::EOpMemoryBarrierImage: case glslang::EOpMemoryBarrierShared: case glslang::EOpGroupMemoryBarrier: + case glslang::EOpDeviceMemoryBarrier: case glslang::EOpAllMemoryBarrierWithGroupSync: - case glslang::EOpGroupMemoryBarrierWithGroupSync: + case glslang::EOpDeviceMemoryBarrierWithGroupSync: case glslang::EOpWorkgroupMemoryBarrier: case glslang::EOpWorkgroupMemoryBarrierWithGroupSync: + case glslang::EOpSubgroupBarrier: + case glslang::EOpSubgroupMemoryBarrier: + case glslang::EOpSubgroupMemoryBarrierBuffer: + case glslang::EOpSubgroupMemoryBarrierImage: + case glslang::EOpSubgroupMemoryBarrierShared: noReturnValue = true; // These all have 0 operands and will naturally finish up in the code below for 0 operands break; @@ -1817,7 +1997,10 @@ spv::Id rightId = accessChainLoad(right->getType()); builder.setLine(node->getLoc().line); - result = createBinaryOperation(binOp, precision, TranslateNoContractionDecoration(node->getType().getQualifier()), + OpDecorations decorations = { precision, + TranslateNoContractionDecoration(node->getType().getQualifier()), + TranslateNonUniformDecoration(node->getType().getQualifier()) }; + result = createBinaryOperation(binOp, decorations, resultType(), leftId, rightId, left->getType().getBasicType(), reduceComparison); @@ -1915,11 +2098,15 @@ result = createNoArgOperation(node->getOp(), precision, resultType()); break; case 1: - result = createUnaryOperation( - node->getOp(), precision, - TranslateNoContractionDecoration(node->getType().getQualifier()), - resultType(), operands.front(), - glslangOperands[0]->getAsTyped()->getBasicType()); + { + OpDecorations decorations = { precision, + TranslateNoContractionDecoration(node->getType().getQualifier()), + TranslateNonUniformDecoration(node->getType().getQualifier()) }; + result = createUnaryOperation( + node->getOp(), decorations, + resultType(), operands.front(), + glslangOperands[0]->getAsTyped()->getBasicType()); + } break; default: result = createMiscOperation(node->getOp(), precision, resultType(), operands, node->getBasicType()); @@ -1953,18 +2140,29 @@ // next layer copies r-values into memory to use the access-chain mechanism bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang::TIntermSelection* node) { - // See if it simple and safe to generate OpSelect instead of using control flow. - // Crucially, side effects must be avoided, and there are performance trade-offs. - // Return true if good idea (and safe) for OpSelect, false otherwise. - const auto selectPolicy = [&]() -> bool { - if ((!node->getType().isScalar() && !node->getType().isVector()) || - node->getBasicType() == glslang::EbtVoid) - return false; - + // See if it simple and safe, or required, to execute both sides. + // Crucially, side effects must be either semantically required or avoided, + // and there are performance trade-offs. + // Return true if required or a good idea (and safe) to execute both sides, + // false otherwise. + const auto bothSidesPolicy = [&]() -> bool { + // do we have both sides? if (node->getTrueBlock() == nullptr || node->getFalseBlock() == nullptr) return false; + // required? (unless we write additional code to look for side effects + // and make performance trade-offs if none are present) + if (!node->getShortCircuit()) + return true; + + // if not required to execute both, decide based on performance/practicality... + + // see if OpSelect can handle it + if ((!node->getType().isScalar() && !node->getType().isVector()) || + node->getBasicType() == glslang::EbtVoid) + return false; + assert(node->getType() == node->getTrueBlock() ->getAsTyped()->getType() && node->getType() == node->getFalseBlock()->getAsTyped()->getType()); @@ -1977,10 +2175,14 @@ operandOkay(node->getFalseBlock()->getAsTyped()); }; - // Emit OpSelect for this selection. - const auto handleAsOpSelect = [&]() { - node->getCondition()->traverse(this); - spv::Id condition = accessChainLoad(node->getCondition()->getType()); + spv::Id result = spv::NoResult; // upcoming result selecting between trueValue and falseValue + // emit the condition before doing anything with selection + node->getCondition()->traverse(this); + spv::Id condition = accessChainLoad(node->getCondition()->getType()); + + // Find a way of executing both sides and selecting the right result. + const auto executeBothSides = [&]() -> void { + // execute both sides node->getTrueBlock()->traverse(this); spv::Id trueValue = accessChainLoad(node->getTrueBlock()->getAsTyped()->getType()); node->getFalseBlock()->traverse(this); @@ -1988,72 +2190,98 @@ builder.setLine(node->getLoc().line); - // smear condition to vector, if necessary (AST is always scalar) - if (builder.isVector(trueValue)) - condition = builder.smearScalar(spv::NoPrecision, condition, - builder.makeVectorType(builder.makeBoolType(), - builder.getNumComponents(trueValue))); - - spv::Id select = builder.createTriOp(spv::OpSelect, - convertGlslangToSpvType(node->getType()), condition, - trueValue, falseValue); - builder.clearAccessChain(); - builder.setAccessChainRValue(select); - }; + // done if void + if (node->getBasicType() == glslang::EbtVoid) + return; - // Try for OpSelect + // emit code to select between trueValue and falseValue - if (selectPolicy()) { - SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); - if (node->getType().getQualifier().isSpecConstant()) - spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); + // see if OpSelect can handle it + if (node->getType().isScalar() || node->getType().isVector()) { + // Emit OpSelect for this selection. + + // smear condition to vector, if necessary (AST is always scalar) + if (builder.isVector(trueValue)) + condition = builder.smearScalar(spv::NoPrecision, condition, + builder.makeVectorType(builder.makeBoolType(), + builder.getNumComponents(trueValue))); + + // OpSelect + result = builder.createTriOp(spv::OpSelect, + convertGlslangToSpvType(node->getType()), condition, + trueValue, falseValue); - handleAsOpSelect(); - return false; - } + builder.clearAccessChain(); + builder.setAccessChainRValue(result); + } else { + // We need control flow to select the result. + // TODO: Once SPIR-V OpSelect allows arbitrary types, eliminate this path. + result = builder.createVariable(spv::StorageClassFunction, convertGlslangToSpvType(node->getType())); + + // Selection control: + const spv::SelectionControlMask control = TranslateSelectionControl(*node); + + // make an "if" based on the value created by the condition + spv::Builder::If ifBuilder(condition, control, builder); + + // emit the "then" statement + builder.createStore(trueValue, result); + ifBuilder.makeBeginElse(); + // emit the "else" statement + builder.createStore(falseValue, result); - // Instead, emit control flow... - // Don't handle results as temporaries, because there will be two names - // and better to leave SSA to later passes. - spv::Id result = (node->getBasicType() == glslang::EbtVoid) - ? spv::NoResult - : builder.createVariable(spv::StorageClassFunction, convertGlslangToSpvType(node->getType())); + // finish off the control flow + ifBuilder.makeEndIf(); - // emit the condition before doing anything with selection - node->getCondition()->traverse(this); + builder.clearAccessChain(); + builder.setAccessChainLValue(result); + } + }; - // Selection control: - const spv::SelectionControlMask control = TranslateSelectionControl(node->getSelectionControl()); + // Execute the one side needed, as per the condition + const auto executeOneSide = [&]() { + // Always emit control flow. + if (node->getBasicType() != glslang::EbtVoid) + result = builder.createVariable(spv::StorageClassFunction, convertGlslangToSpvType(node->getType())); - // make an "if" based on the value created by the condition - spv::Builder::If ifBuilder(accessChainLoad(node->getCondition()->getType()), control, builder); + // Selection control: + const spv::SelectionControlMask control = TranslateSelectionControl(*node); - // emit the "then" statement - if (node->getTrueBlock() != nullptr) { - node->getTrueBlock()->traverse(this); - if (result != spv::NoResult) - builder.createStore(accessChainLoad(node->getTrueBlock()->getAsTyped()->getType()), result); - } + // make an "if" based on the value created by the condition + spv::Builder::If ifBuilder(condition, control, builder); - if (node->getFalseBlock() != nullptr) { - ifBuilder.makeBeginElse(); - // emit the "else" statement - node->getFalseBlock()->traverse(this); - if (result != spv::NoResult) - builder.createStore(accessChainLoad(node->getFalseBlock()->getAsTyped()->getType()), result); - } + // emit the "then" statement + if (node->getTrueBlock() != nullptr) { + node->getTrueBlock()->traverse(this); + if (result != spv::NoResult) + builder.createStore(accessChainLoad(node->getTrueBlock()->getAsTyped()->getType()), result); + } - // finish off the control flow - ifBuilder.makeEndIf(); + if (node->getFalseBlock() != nullptr) { + ifBuilder.makeBeginElse(); + // emit the "else" statement + node->getFalseBlock()->traverse(this); + if (result != spv::NoResult) + builder.createStore(accessChainLoad(node->getFalseBlock()->getAsTyped()->getType()), result); + } - if (result != spv::NoResult) { - // GLSL only has r-values as the result of a :?, but - // if we have an l-value, that can be more efficient if it will - // become the base of a complex r-value expression, because the - // next layer copies r-values into memory to use the access-chain mechanism - builder.clearAccessChain(); - builder.setAccessChainLValue(result); - } + // finish off the control flow + ifBuilder.makeEndIf(); + + if (result != spv::NoResult) { + builder.clearAccessChain(); + builder.setAccessChainLValue(result); + } + }; + + // Try for OpSelect (or a requirement to execute both sides) + if (bothSidesPolicy()) { + SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); + if (node->getType().getQualifier().isSpecConstant()) + spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); + executeBothSides(); + } else + executeOneSide(); return false; } @@ -2065,7 +2293,7 @@ spv::Id selector = accessChainLoad(node->getCondition()->getAsTyped()->getType()); // Selection control: - const spv::SelectionControlMask control = TranslateSelectionControl(node->getSelectionControl()); + const spv::SelectionControlMask control = TranslateSwitchControl(*node); // browse the children to sort out code segments int defaultSegment = -1; @@ -2125,9 +2353,8 @@ builder.createBranch(&blocks.head); // Loop control: - const spv::LoopControlMask control = TranslateLoopControl(node->getLoopControl()); - - // TODO: dependency length + unsigned int dependencyLength = glslang::TIntermLoop::dependencyInfinite; + const spv::LoopControlMask control = TranslateLoopControl(*node, dependencyLength); // Spec requires back edges to target header blocks, and every header block // must dominate its merge block. Make a header block first to ensure these @@ -2137,7 +2364,7 @@ // including merges of its own. builder.setLine(node->getLoc().line); builder.setBuildPoint(&blocks.head); - builder.createLoopMerge(&blocks.merge, &blocks.continue_target, control); + builder.createLoopMerge(&blocks.merge, &blocks.continue_target, control, dependencyLength); if (node->testFirst() && node->getTest()) { spv::Block& test = builder.makeNewBlock(); builder.createBranch(&test); @@ -2248,25 +2475,23 @@ spv::StorageClass storageClass = TranslateStorageClass(node->getType()); spv::Id spvType = convertGlslangToSpvType(node->getType()); -#ifdef AMD_EXTENSIONS const bool contains16BitType = node->getType().containsBasicType(glslang::EbtFloat16) || node->getType().containsBasicType(glslang::EbtInt16) || node->getType().containsBasicType(glslang::EbtUint16); if (contains16BitType) { if (storageClass == spv::StorageClassInput || storageClass == spv::StorageClassOutput) { - builder.addExtension(spv::E_SPV_KHR_16bit_storage); + addPre13Extension(spv::E_SPV_KHR_16bit_storage); builder.addCapability(spv::CapabilityStorageInputOutput16); } else if (storageClass == spv::StorageClassPushConstant) { - builder.addExtension(spv::E_SPV_KHR_16bit_storage); + addPre13Extension(spv::E_SPV_KHR_16bit_storage); builder.addCapability(spv::CapabilityStoragePushConstant16); } else if (storageClass == spv::StorageClassUniform) { - builder.addExtension(spv::E_SPV_KHR_16bit_storage); + addPre13Extension(spv::E_SPV_KHR_16bit_storage); builder.addCapability(spv::CapabilityStorageUniform16); if (node->getType().getQualifier().storage == glslang::EvqBuffer) builder.addCapability(spv::CapabilityStorageUniformBufferBlock16); } } -#endif const char* name = node->getName().c_str(); if (glslang::IsAnonymous(name)) @@ -2280,6 +2505,12 @@ { switch (sampler.type) { case glslang::EbtFloat: return builder.makeFloatType(32); +#ifdef AMD_EXTENSIONS + case glslang::EbtFloat16: + builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float_fetch); + builder.addCapability(spv::CapabilityFloat16ImageAMD); + return builder.makeFloatType(16); +#endif case glslang::EbtInt: return builder.makeIntType(32); case glslang::EbtUint: return builder.makeUintType(32); default: @@ -2322,13 +2553,14 @@ // layout state rooted from the top-level type. spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& type) { - return convertGlslangToSpvType(type, getExplicitLayout(type), type.getQualifier()); + return convertGlslangToSpvType(type, getExplicitLayout(type), type.getQualifier(), false); } // Do full recursive conversion of an arbitrary glslang type to a SPIR-V Id. // explicitLayout can be kept the same throughout the hierarchical recursive walk. // Mutually recursive with convertGlslangStructToSpvType(). -spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& type, glslang::TLayoutPacking explicitLayout, const glslang::TQualifier& qualifier) +spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& type, + glslang::TLayoutPacking explicitLayout, const glslang::TQualifier& qualifier, bool lastBufferBlockMember) { spv::Id spvType = spv::NoResult; @@ -2343,12 +2575,14 @@ case glslang::EbtDouble: spvType = builder.makeFloatType(64); break; -#ifdef AMD_EXTENSIONS case glslang::EbtFloat16: - builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float); + builder.addCapability(spv::CapabilityFloat16); +#if AMD_EXTENSIONS + if (builder.getSpvVersion() < glslang::EShTargetSpv_1_3) + builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float); +#endif spvType = builder.makeFloatType(16); break; -#endif case glslang::EbtBool: // "transparent" bool doesn't exist in SPIR-V. The GLSL convention is // a 32-bit int where non-0 means true. @@ -2357,6 +2591,30 @@ else spvType = builder.makeBoolType(); break; + case glslang::EbtInt8: + builder.addCapability(spv::CapabilityInt8); + spvType = builder.makeIntType(8); + break; + case glslang::EbtUint8: + builder.addCapability(spv::CapabilityInt8); + spvType = builder.makeUintType(8); + break; + case glslang::EbtInt16: + builder.addCapability(spv::CapabilityInt16); +#ifdef AMD_EXTENSIONS + if (builder.getSpvVersion() < glslang::EShTargetSpv_1_3) + builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16); +#endif + spvType = builder.makeIntType(16); + break; + case glslang::EbtUint16: + builder.addCapability(spv::CapabilityInt16); +#ifdef AMD_EXTENSIONS + if (builder.getSpvVersion() < glslang::EShTargetSpv_1_3) + builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16); +#endif + spvType = builder.makeUintType(16); + break; case glslang::EbtInt: spvType = builder.makeIntType(32); break; @@ -2369,16 +2627,6 @@ case glslang::EbtUint64: spvType = builder.makeUintType(64); break; -#ifdef AMD_EXTENSIONS - case glslang::EbtInt16: - builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16); - spvType = builder.makeIntType(16); - break; - case glslang::EbtUint16: - builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16); - spvType = builder.makeUintType(16); - break; -#endif case glslang::EbtAtomicUint: builder.addCapability(spv::CapabilityAtomicStorage); spvType = builder.makeUintType(32); @@ -2442,8 +2690,8 @@ // Use a dummy glslang type for querying internal strides of // arrays of arrays, but using just a one-dimensional array. glslang::TType simpleArrayType(type, 0); // deference type of the array - while (simpleArrayType.getArraySizes().getNumDims() > 1) - simpleArrayType.getArraySizes().dereference(); + while (simpleArrayType.getArraySizes()->getNumDims() > 1) + simpleArrayType.getArraySizes()->dereference(); // Will compute the higher-order strides here, rather than making a whole // pile of types and doing repetitive recursion on their contents. @@ -2465,12 +2713,16 @@ stride = getArrayStride(type, explicitLayout, qualifier.layoutMatrix); } - // Do the outer dimension, which might not be known for a runtime-sized array - if (type.isRuntimeSizedArray()) { - spvType = builder.makeRuntimeArray(spvType); - } else { - assert(type.getOuterArraySize() > 0); + // Do the outer dimension, which might not be known for a runtime-sized array. + // (Unsized arrays that survive through linking will be runtime-sized arrays) + if (type.isSizedArray()) spvType = builder.makeArrayType(spvType, makeArraySizeId(*type.getArraySizes(), 0), stride); + else { + if (!lastBufferBlockMember) { + builder.addExtension("SPV_EXT_descriptor_indexing"); + builder.addCapability(spv::CapabilityRuntimeDescriptorArrayEXT); + } + spvType = builder.makeRuntimeArray(spvType); } if (stride > 0) builder.addDecoration(spvType, spv::DecorationArrayStride, stride); @@ -2538,7 +2790,10 @@ memberQualifier.layoutLocation = qualifier.layoutLocation; // recurse - spvMembers.push_back(convertGlslangToSpvType(glslangMember, explicitLayout, memberQualifier)); + bool lastBufferBlockMember = qualifier.storage == glslang::EvqBuffer && + i == (int)glslangMembers->size() - 1; + spvMembers.push_back( + convertGlslangToSpvType(glslangMember, explicitLayout, memberQualifier, lastBufferBlockMember)); } } @@ -2576,99 +2831,110 @@ InheritQualifiers(memberQualifier, qualifier); // using -1 above to indicate a hidden member - if (member >= 0) { - builder.addMemberName(spvType, member, glslangMember.getFieldName().c_str()); - addMemberDecoration(spvType, member, TranslateLayoutDecoration(glslangMember, memberQualifier.layoutMatrix)); - addMemberDecoration(spvType, member, TranslatePrecisionDecoration(glslangMember)); - // Add interpolation and auxiliary storage decorations only to top-level members of Input and Output storage classes - if (type.getQualifier().storage == glslang::EvqVaryingIn || - type.getQualifier().storage == glslang::EvqVaryingOut) { - if (type.getBasicType() == glslang::EbtBlock || - glslangIntermediate->getSource() == glslang::EShSourceHlsl) { - addMemberDecoration(spvType, member, TranslateInterpolationDecoration(memberQualifier)); - addMemberDecoration(spvType, member, TranslateAuxiliaryStorageDecoration(memberQualifier)); - } - } - addMemberDecoration(spvType, member, TranslateInvariantDecoration(memberQualifier)); - - if (type.getBasicType() == glslang::EbtBlock && - qualifier.storage == glslang::EvqBuffer) { - // Add memory decorations only to top-level members of shader storage block - std::vector memory; - TranslateMemoryDecoration(memberQualifier, memory); - for (unsigned int i = 0; i < memory.size(); ++i) - addMemberDecoration(spvType, member, memory[i]); - } + if (member < 0) + continue; - // Location assignment was already completed correctly by the front end, - // just track whether a member needs to be decorated. - // Ignore member locations if the container is an array, as that's - // ill-specified and decisions have been made to not allow this. - if (! type.isArray() && memberQualifier.hasLocation()) - builder.addMemberDecoration(spvType, member, spv::DecorationLocation, memberQualifier.layoutLocation); - - if (qualifier.hasLocation()) // track for upcoming inheritance - locationOffset += glslangIntermediate->computeTypeLocationSize(glslangMember); - - // component, XFB, others - if (glslangMember.getQualifier().hasComponent()) - builder.addMemberDecoration(spvType, member, spv::DecorationComponent, glslangMember.getQualifier().layoutComponent); - if (glslangMember.getQualifier().hasXfbOffset()) - builder.addMemberDecoration(spvType, member, spv::DecorationOffset, glslangMember.getQualifier().layoutXfbOffset); - else if (explicitLayout != glslang::ElpNone) { - // figure out what to do with offset, which is accumulating - int nextOffset; - updateMemberOffset(type, glslangMember, offset, nextOffset, explicitLayout, memberQualifier.layoutMatrix); - if (offset >= 0) - builder.addMemberDecoration(spvType, member, spv::DecorationOffset, offset); - offset = nextOffset; + builder.addMemberName(spvType, member, glslangMember.getFieldName().c_str()); + builder.addMemberDecoration(spvType, member, + TranslateLayoutDecoration(glslangMember, memberQualifier.layoutMatrix)); + builder.addMemberDecoration(spvType, member, TranslatePrecisionDecoration(glslangMember)); + // Add interpolation and auxiliary storage decorations only to + // top-level members of Input and Output storage classes + if (type.getQualifier().storage == glslang::EvqVaryingIn || + type.getQualifier().storage == glslang::EvqVaryingOut) { + if (type.getBasicType() == glslang::EbtBlock || + glslangIntermediate->getSource() == glslang::EShSourceHlsl) { + builder.addMemberDecoration(spvType, member, TranslateInterpolationDecoration(memberQualifier)); + builder.addMemberDecoration(spvType, member, TranslateAuxiliaryStorageDecoration(memberQualifier)); } + } + builder.addMemberDecoration(spvType, member, TranslateInvariantDecoration(memberQualifier)); - if (glslangMember.isMatrix() && explicitLayout != glslang::ElpNone) - builder.addMemberDecoration(spvType, member, spv::DecorationMatrixStride, getMatrixStride(glslangMember, explicitLayout, memberQualifier.layoutMatrix)); - - // built-in variable decorations - spv::BuiltIn builtIn = TranslateBuiltInDecoration(glslangMember.getQualifier().builtIn, true); - if (builtIn != spv::BuiltInMax) - addMemberDecoration(spvType, member, spv::DecorationBuiltIn, (int)builtIn); + if (type.getBasicType() == glslang::EbtBlock && + qualifier.storage == glslang::EvqBuffer) { + // Add memory decorations only to top-level members of shader storage block + std::vector memory; + TranslateMemoryDecoration(memberQualifier, memory); + for (unsigned int i = 0; i < memory.size(); ++i) + builder.addMemberDecoration(spvType, member, memory[i]); + } + + // Location assignment was already completed correctly by the front end, + // just track whether a member needs to be decorated. + // Ignore member locations if the container is an array, as that's + // ill-specified and decisions have been made to not allow this. + if (! type.isArray() && memberQualifier.hasLocation()) + builder.addMemberDecoration(spvType, member, spv::DecorationLocation, memberQualifier.layoutLocation); + + if (qualifier.hasLocation()) // track for upcoming inheritance + locationOffset += glslangIntermediate->computeTypeLocationSize( + glslangMember, glslangIntermediate->getStage()); + + // component, XFB, others + if (glslangMember.getQualifier().hasComponent()) + builder.addMemberDecoration(spvType, member, spv::DecorationComponent, + glslangMember.getQualifier().layoutComponent); + if (glslangMember.getQualifier().hasXfbOffset()) + builder.addMemberDecoration(spvType, member, spv::DecorationOffset, + glslangMember.getQualifier().layoutXfbOffset); + else if (explicitLayout != glslang::ElpNone) { + // figure out what to do with offset, which is accumulating + int nextOffset; + updateMemberOffset(type, glslangMember, offset, nextOffset, explicitLayout, memberQualifier.layoutMatrix); + if (offset >= 0) + builder.addMemberDecoration(spvType, member, spv::DecorationOffset, offset); + offset = nextOffset; + } + + if (glslangMember.isMatrix() && explicitLayout != glslang::ElpNone) + builder.addMemberDecoration(spvType, member, spv::DecorationMatrixStride, + getMatrixStride(glslangMember, explicitLayout, memberQualifier.layoutMatrix)); + + // built-in variable decorations + spv::BuiltIn builtIn = TranslateBuiltInDecoration(glslangMember.getQualifier().builtIn, true); + if (builtIn != spv::BuiltInMax) + builder.addMemberDecoration(spvType, member, spv::DecorationBuiltIn, (int)builtIn); + + // nonuniform + builder.addMemberDecoration(spvType, member, TranslateNonUniformDecoration(glslangMember.getQualifier())); + + if (glslangIntermediate->getHlslFunctionality1() && memberQualifier.semanticName != nullptr) { + builder.addExtension("SPV_GOOGLE_hlsl_functionality1"); + builder.addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationHlslSemanticGOOGLE, + memberQualifier.semanticName); + } #ifdef NV_EXTENSIONS - if (builtIn == spv::BuiltInLayer) { - // SPV_NV_viewport_array2 extension - if (glslangMember.getQualifier().layoutViewportRelative){ - addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationViewportRelativeNV); - builder.addCapability(spv::CapabilityShaderViewportMaskNV); - builder.addExtension(spv::E_SPV_NV_viewport_array2); - } - if (glslangMember.getQualifier().layoutSecondaryViewportRelativeOffset != -2048){ - addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationSecondaryViewportRelativeNV, glslangMember.getQualifier().layoutSecondaryViewportRelativeOffset); - builder.addCapability(spv::CapabilityShaderStereoViewNV); - builder.addExtension(spv::E_SPV_NV_stereo_view_rendering); - } + if (builtIn == spv::BuiltInLayer) { + // SPV_NV_viewport_array2 extension + if (glslangMember.getQualifier().layoutViewportRelative){ + builder.addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationViewportRelativeNV); + builder.addCapability(spv::CapabilityShaderViewportMaskNV); + builder.addExtension(spv::E_SPV_NV_viewport_array2); } - if (glslangMember.getQualifier().layoutPassthrough) { - addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationPassthroughNV); - builder.addCapability(spv::CapabilityGeometryShaderPassthroughNV); - builder.addExtension(spv::E_SPV_NV_geometry_shader_passthrough); + if (glslangMember.getQualifier().layoutSecondaryViewportRelativeOffset != -2048){ + builder.addMemberDecoration(spvType, member, + (spv::Decoration)spv::DecorationSecondaryViewportRelativeNV, + glslangMember.getQualifier().layoutSecondaryViewportRelativeOffset); + builder.addCapability(spv::CapabilityShaderStereoViewNV); + builder.addExtension(spv::E_SPV_NV_stereo_view_rendering); } -#endif } + if (glslangMember.getQualifier().layoutPassthrough) { + builder.addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationPassthroughNV); + builder.addCapability(spv::CapabilityGeometryShaderPassthroughNV); + builder.addExtension(spv::E_SPV_NV_geometry_shader_passthrough); + } +#endif } // Decorate the structure - addDecoration(spvType, TranslateLayoutDecoration(type, qualifier.layoutMatrix)); - addDecoration(spvType, TranslateBlockDecoration(type, glslangIntermediate->usingStorageBuffer())); + builder.addDecoration(spvType, TranslateLayoutDecoration(type, qualifier.layoutMatrix)); + builder.addDecoration(spvType, TranslateBlockDecoration(type, glslangIntermediate->usingStorageBuffer())); if (type.getQualifier().hasStream() && glslangIntermediate->isMultiStream()) { builder.addCapability(spv::CapabilityGeometryStreams); builder.addDecoration(spvType, spv::DecorationStream, type.getQualifier().layoutStream); } - if (glslangIntermediate->getXfbMode()) { - builder.addCapability(spv::CapabilityTransformFeedback); - if (type.getQualifier().hasXfbStride()) - builder.addDecoration(spvType, spv::DecorationXfbStride, type.getQualifier().layoutXfbStride); - if (type.getQualifier().hasXfbBuffer()) - builder.addDecoration(spvType, spv::DecorationXfbBuffer, type.getQualifier().layoutXfbBuffer); - } } // Turn the expression forming the array size into an id. @@ -2699,7 +2965,8 @@ spv::Id TGlslangToSpvTraverser::accessChainLoad(const glslang::TType& type) { spv::Id nominalTypeId = builder.accessChainGetInferredType(); - spv::Id loadedId = builder.accessChainLoad(TranslatePrecisionDecoration(type), nominalTypeId); + spv::Id loadedId = builder.accessChainLoad(TranslatePrecisionDecoration(type), + TranslateNonUniformDecoration(type.getQualifier()), nominalTypeId); // Need to convert to abstract types when necessary if (type.getBasicType() == glslang::EbtBool) { @@ -2972,8 +3239,14 @@ } // Does parameter need a place to keep writes, separate from the original? +// Assumes called after originalParam(), which filters out block/buffer/opaque-based +// qualifiers such that we should have only in/out/inout/constreadonly here. bool TGlslangToSpvTraverser::writableParam(glslang::TStorageQualifier qualifier) { + assert(qualifier == glslang::EvqIn || + qualifier == glslang::EvqOut || + qualifier == glslang::EvqInOut || + qualifier == glslang::EvqConstReadOnly); return qualifier != glslang::EvqConstReadOnly; } @@ -2984,7 +3257,7 @@ if (implicitThisParam) // implicit this return true; if (glslangIntermediate->getSource() == glslang::EShSourceHlsl) - return false; + return paramType.getBasicType() == glslang::EbtBlock; return paramType.containsOpaque() || // sampler, etc. (paramType.getBasicType() == glslang::EbtBlock && qualifier == glslang::EvqBuffer); // SSBO } @@ -3099,9 +3372,15 @@ glslang::TSampler sampler = {}; bool cubeCompare = false; +#ifdef AMD_EXTENSIONS + bool f16ShadowCompare = false; +#endif if (node.isTexture() || node.isImage()) { sampler = glslangArguments[0]->getAsTyped()->getType().getSampler(); cubeCompare = sampler.dim == glslang::EsdCube && sampler.arrayed && sampler.shadow; +#ifdef AMD_EXTENSIONS + f16ShadowCompare = sampler.shadow && glslangArguments[1]->getAsTyped()->getType().getBasicType() == glslang::EbtFloat16; +#endif } for (int i = 0; i < (int)glslangArguments.size(); ++i) { @@ -3126,6 +3405,21 @@ if ((sampler.ms && i == 3) || (! sampler.ms && i == 2)) lvalue = true; break; +#ifdef AMD_EXTENSIONS + case glslang::EOpSparseTexture: + if (((cubeCompare || f16ShadowCompare) && i == 3) || (! (cubeCompare || f16ShadowCompare) && i == 2)) + lvalue = true; + break; + case glslang::EOpSparseTextureClamp: + if (((cubeCompare || f16ShadowCompare) && i == 4) || (! (cubeCompare || f16ShadowCompare) && i == 3)) + lvalue = true; + break; + case glslang::EOpSparseTextureLod: + case glslang::EOpSparseTextureOffset: + if ((f16ShadowCompare && i == 4) || (! f16ShadowCompare && i == 3)) + lvalue = true; + break; +#else case glslang::EOpSparseTexture: if ((cubeCompare && i == 3) || (! cubeCompare && i == 2)) lvalue = true; @@ -3139,6 +3433,7 @@ if (i == 3) lvalue = true; break; +#endif case glslang::EOpSparseTextureFetch: if ((sampler.dim != glslang::EsdRect && i == 3) || (sampler.dim == glslang::EsdRect && i == 2)) lvalue = true; @@ -3147,6 +3442,23 @@ if ((sampler.dim != glslang::EsdRect && i == 4) || (sampler.dim == glslang::EsdRect && i == 3)) lvalue = true; break; +#ifdef AMD_EXTENSIONS + case glslang::EOpSparseTextureLodOffset: + case glslang::EOpSparseTextureGrad: + case glslang::EOpSparseTextureOffsetClamp: + if ((f16ShadowCompare && i == 5) || (! f16ShadowCompare && i == 4)) + lvalue = true; + break; + case glslang::EOpSparseTextureGradOffset: + case glslang::EOpSparseTextureGradClamp: + if ((f16ShadowCompare && i == 6) || (! f16ShadowCompare && i == 5)) + lvalue = true; + break; + case glslang::EOpSparseTextureGradOffsetClamp: + if ((f16ShadowCompare && i == 7) || (! f16ShadowCompare && i == 6)) + lvalue = true; + break; +#else case glslang::EOpSparseTextureLodOffset: case glslang::EOpSparseTextureGrad: case glslang::EOpSparseTextureOffsetClamp: @@ -3162,6 +3474,7 @@ if (i == 6) lvalue = true; break; +#endif case glslang::EOpSparseTextureGather: if ((sampler.shadow && i == 3) || (! sampler.shadow && i == 2)) lvalue = true; @@ -3211,11 +3524,15 @@ builder.setLine(node->getLoc().line); - auto resultType = [&node,this]{ return convertGlslangToSpvType(node->getType()); }; - // Process a GLSL texturing op (will be SPV image) const glslang::TSampler sampler = node->getAsAggregate() ? node->getAsAggregate()->getSequence()[0]->getAsTyped()->getType().getSampler() : node->getAsUnaryNode()->getOperand()->getAsTyped()->getType().getSampler(); +#ifdef AMD_EXTENSIONS + bool f16ShadowCompare = (sampler.shadow && node->getAsAggregate()) + ? node->getAsAggregate()->getSequence()[1]->getAsTyped()->getType().getBasicType() == glslang::EbtFloat16 + : false; +#endif + std::vector arguments; if (node->getAsAggregate()) translateArguments(*node->getAsAggregate(), arguments); @@ -3261,6 +3578,20 @@ } } + int components = node->getType().getVectorSize(); + + if (node->getOp() == glslang::EOpTextureFetch) { + // These must produce 4 components, per SPIR-V spec. We'll add a conversion constructor if needed. + // This will only happen through the HLSL path for operator[], so we do not have to handle e.g. + // the EOpTexture/Proj/Lod/etc family. It would be harmless to do so, but would need more logic + // here around e.g. which ones return scalars or other types. + components = 4; + } + + glslang::TType returnType(node->getType().getBasicType(), glslang::EvqTemporary, components); + + auto resultType = [&returnType,this]{ return convertGlslangToSpvType(returnType); }; + // Check for image functions other than queries if (node->isImage()) { std::vector operands; @@ -3307,9 +3638,14 @@ if (builder.getImageTypeFormat(builder.getImageType(operands.front())) == spv::ImageFormatUnknown) builder.addCapability(spv::CapabilityStorageImageReadWithoutFormat); - spv::Id result = builder.createOp(spv::OpImageRead, resultType(), operands); - builder.setPrecision(result, precision); - return result; + std::vector result( 1, builder.createOp(spv::OpImageRead, resultType(), operands) ); + builder.setPrecision(result[0], precision); + + // If needed, add a conversion constructor to the proper size. + if (components != node->getType().getVectorSize()) + result[0] = builder.createConstructor(precision, result, convertGlslangToSpvType(node->getType())); + + return result[0]; #ifdef AMD_EXTENSIONS } else if (node->getOp() == glslang::EOpImageStore || node->getOp() == glslang::EOpImageStoreLod) { #else @@ -3440,6 +3776,9 @@ #ifdef AMD_EXTENSIONS if (cracked.gather) ++nonBiasArgCount; // comp argument should be present when bias argument is present + + if (f16ShadowCompare) + ++nonBiasArgCount; #endif if (cracked.offset) ++nonBiasArgCount; @@ -3483,7 +3822,11 @@ bool noImplicitLod = false; // sort out where Dref is coming from +#ifdef AMD_EXTENSIONS + if (cubeCompare || f16ShadowCompare) { +#else if (cubeCompare) { +#endif params.Dref = arguments[2]; ++extraArgs; } else if (sampler.shadow && cracked.gather) { @@ -3583,7 +3926,14 @@ } } - return builder.createTextureCall(precision, resultType(), sparse, cracked.fetch, cracked.proj, cracked.gather, noImplicitLod, params); + std::vector result( 1, + builder.createTextureCall(precision, resultType(), sparse, cracked.fetch, cracked.proj, cracked.gather, noImplicitLod, params) + ); + + if (components != node->getType().getVectorSize()) + result[0] = builder.createConstructor(precision, result, convertGlslangToSpvType(node->getType())); + + return result[0]; } spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAggregate* node) @@ -3615,8 +3965,8 @@ glslangArgs[a]->traverse(this); argTypes.push_back(¶mType); // keep outputs and pass-by-originals as l-values, evaluate others as r-values - if (writableParam(qualifiers[a]) || - originalParam(qualifiers[a], paramType, function->hasImplicitThis() && a == 0)) { + if (originalParam(qualifiers[a], paramType, function->hasImplicitThis() && a == 0) || + writableParam(qualifiers[a])) { // save l-value lValues.push_back(builder.getAccessChain()); } else { @@ -3682,18 +4032,12 @@ } // Translate AST operation to SPV operation, already having SPV-based operands/types. -spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv::Decoration precision, - spv::Decoration noContraction, +spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, OpDecorations& decorations, spv::Id typeId, spv::Id left, spv::Id right, glslang::TBasicType typeProxy, bool reduceComparison) { -#ifdef AMD_EXTENSIONS - bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64 || typeProxy == glslang::EbtUint16; - bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble || typeProxy == glslang::EbtFloat16; -#else - bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64; - bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble; -#endif + bool isUnsigned = isTypeUnsignedInt(typeProxy); + bool isFloat = isTypeFloat(typeProxy); bool isBool = typeProxy == glslang::EbtBool; spv::Op binOp = spv::OpNop; @@ -3825,15 +4169,16 @@ if (binOp != spv::OpNop) { assert(comparison == false); if (builder.isMatrix(left) || builder.isMatrix(right)) - return createBinaryMatrixOperation(binOp, precision, noContraction, typeId, left, right); + return createBinaryMatrixOperation(binOp, decorations, typeId, left, right); // No matrix involved; make both operands be the same number of components, if needed if (needMatchingVectors) - builder.promoteScalar(precision, left, right); + builder.promoteScalar(decorations.precision, left, right); spv::Id result = builder.createBinOp(binOp, typeId, left, right); - addDecoration(result, noContraction); - return builder.setPrecision(result, precision); + builder.addDecoration(result, decorations.noContraction); + builder.addDecoration(result, decorations.nonUniform); + return builder.setPrecision(result, decorations.precision); } if (! comparison) @@ -3842,8 +4187,11 @@ // Handle comparison instructions if (reduceComparison && (op == glslang::EOpEqual || op == glslang::EOpNotEqual) - && (builder.isVector(left) || builder.isMatrix(left) || builder.isAggregate(left))) - return builder.createCompositeCompare(precision, left, right, op == glslang::EOpEqual); + && (builder.isVector(left) || builder.isMatrix(left) || builder.isAggregate(left))) { + spv::Id result = builder.createCompositeCompare(decorations.precision, left, right, op == glslang::EOpEqual); + builder.addDecoration(result, decorations.nonUniform); + return result; + } switch (op) { case glslang::EOpLessThan: @@ -3902,8 +4250,9 @@ if (binOp != spv::OpNop) { spv::Id result = builder.createBinOp(binOp, typeId, left, right); - addDecoration(result, noContraction); - return builder.setPrecision(result, precision); + builder.addDecoration(result, decorations.noContraction); + builder.addDecoration(result, decorations.nonUniform); + return builder.setPrecision(result, decorations.precision); } return 0; @@ -3923,7 +4272,8 @@ // matrix op scalar op in {+, -, /} // scalar op matrix op in {+, -, /} // -spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id left, spv::Id right) +spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, OpDecorations& decorations, spv::Id typeId, + spv::Id left, spv::Id right) { bool firstClass = true; @@ -3932,7 +4282,8 @@ case spv::OpFDiv: if (builder.isMatrix(left) && builder.isScalar(right)) { // turn matrix / scalar into a multiply... - right = builder.createBinOp(spv::OpFDiv, builder.getTypeId(right), builder.makeFloatConstant(1.0F), right); + spv::Id resultType = builder.getTypeId(right); + right = builder.createBinOp(spv::OpFDiv, resultType, builder.makeFpConstant(resultType, 1.0), right); op = spv::OpMatrixTimesScalar; } else firstClass = false; @@ -3961,8 +4312,9 @@ if (firstClass) { spv::Id result = builder.createBinOp(op, typeId, left, right); - addDecoration(result, noContraction); - return builder.setPrecision(result, precision); + builder.addDecoration(result, decorations.noContraction); + builder.addDecoration(result, decorations.nonUniform); + return builder.setPrecision(result, decorations.precision); } // Handle component-wise +, -, *, %, and / for all combinations of type. @@ -3989,9 +4341,9 @@ std::vector results; spv::Id smearVec = spv::NoResult; if (builder.isScalar(left)) - smearVec = builder.smearScalar(precision, left, vecType); + smearVec = builder.smearScalar(decorations.precision, left, vecType); else if (builder.isScalar(right)) - smearVec = builder.smearScalar(precision, right, vecType); + smearVec = builder.smearScalar(decorations.precision, right, vecType); // do each vector op for (unsigned int c = 0; c < numCols; ++c) { @@ -4000,12 +4352,15 @@ spv::Id leftVec = leftMat ? builder.createCompositeExtract( left, vecType, indexes) : smearVec; spv::Id rightVec = rightMat ? builder.createCompositeExtract(right, vecType, indexes) : smearVec; spv::Id result = builder.createBinOp(op, vecType, leftVec, rightVec); - addDecoration(result, noContraction); - results.push_back(builder.setPrecision(result, precision)); + builder.addDecoration(result, decorations.noContraction); + builder.addDecoration(result, decorations.nonUniform); + results.push_back(builder.setPrecision(result, decorations.precision)); } // put the pieces together - return builder.setPrecision(builder.createCompositeConstruct(typeId, results), precision); + spv::Id result = builder.setPrecision(builder.createCompositeConstruct(typeId, results), decorations.precision); + builder.addDecoration(result, decorations.nonUniform); + return result; } default: assert(0); @@ -4013,25 +4368,21 @@ } } -spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id operand, glslang::TBasicType typeProxy) +spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDecorations& decorations, spv::Id typeId, + spv::Id operand, glslang::TBasicType typeProxy) { spv::Op unaryOp = spv::OpNop; int extBuiltins = -1; int libCall = -1; -#ifdef AMD_EXTENSIONS - bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64 || typeProxy == glslang::EbtUint16; - bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble || typeProxy == glslang::EbtFloat16; -#else - bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64; - bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble; -#endif + bool isUnsigned = isTypeUnsignedInt(typeProxy); + bool isFloat = isTypeFloat(typeProxy); switch (op) { case glslang::EOpNegative: if (isFloat) { unaryOp = spv::OpFNegate; if (builder.isMatrixType(typeId)) - return createUnaryMatrixOperation(unaryOp, precision, noContraction, typeId, operand, typeProxy); + return createUnaryMatrixOperation(unaryOp, decorations, typeId, operand, typeProxy); } else unaryOp = spv::OpSNegate; break; @@ -4161,12 +4512,10 @@ case glslang::EOpDoubleBitsToUint64: case glslang::EOpInt64BitsToDouble: case glslang::EOpUint64BitsToDouble: -#ifdef AMD_EXTENSIONS case glslang::EOpFloat16BitsToInt16: case glslang::EOpFloat16BitsToUint16: case glslang::EOpInt16BitsToFloat16: case glslang::EOpUint16BitsToFloat16: -#endif unaryOp = spv::OpBitcast; break; @@ -4211,10 +4560,12 @@ case glslang::EOpUnpackInt2x32: case glslang::EOpPackUint2x32: case glslang::EOpUnpackUint2x32: - unaryOp = spv::OpBitcast; - break; - -#ifdef AMD_EXTENSIONS + case glslang::EOpPack16: + case glslang::EOpPack32: + case glslang::EOpPack64: + case glslang::EOpUnpack32: + case glslang::EOpUnpack16: + case glslang::EOpUnpack8: case glslang::EOpPackInt2x16: case glslang::EOpUnpackInt2x16: case glslang::EOpPackUint2x16: @@ -4227,7 +4578,6 @@ case glslang::EOpUnpackFloat2x16: unaryOp = spv::OpBitcast; break; -#endif case glslang::EOpDPdx: unaryOp = spv::OpDPdx; @@ -4293,7 +4643,7 @@ // Handle all of the atomics in one place, in createAtomicOperation() std::vector operands; operands.push_back(operand); - return createAtomicOperation(op, precision, typeId, operands, typeProxy); + return createAtomicOperation(op, decorations.precision, typeId, operands, typeProxy); } case glslang::EOpBitFieldReverse: @@ -4342,7 +4692,45 @@ operands.push_back(operand); return createInvocationsOperation(op, typeId, operands, typeProxy); } - + case glslang::EOpSubgroupAll: + case glslang::EOpSubgroupAny: + case glslang::EOpSubgroupAllEqual: + case glslang::EOpSubgroupBroadcastFirst: + case glslang::EOpSubgroupBallot: + case glslang::EOpSubgroupInverseBallot: + case glslang::EOpSubgroupBallotBitCount: + case glslang::EOpSubgroupBallotInclusiveBitCount: + case glslang::EOpSubgroupBallotExclusiveBitCount: + case glslang::EOpSubgroupBallotFindLSB: + case glslang::EOpSubgroupBallotFindMSB: + case glslang::EOpSubgroupAdd: + case glslang::EOpSubgroupMul: + case glslang::EOpSubgroupMin: + case glslang::EOpSubgroupMax: + case glslang::EOpSubgroupAnd: + case glslang::EOpSubgroupOr: + case glslang::EOpSubgroupXor: + case glslang::EOpSubgroupInclusiveAdd: + case glslang::EOpSubgroupInclusiveMul: + case glslang::EOpSubgroupInclusiveMin: + case glslang::EOpSubgroupInclusiveMax: + case glslang::EOpSubgroupInclusiveAnd: + case glslang::EOpSubgroupInclusiveOr: + case glslang::EOpSubgroupInclusiveXor: + case glslang::EOpSubgroupExclusiveAdd: + case glslang::EOpSubgroupExclusiveMul: + case glslang::EOpSubgroupExclusiveMin: + case glslang::EOpSubgroupExclusiveMax: + case glslang::EOpSubgroupExclusiveAnd: + case glslang::EOpSubgroupExclusiveOr: + case glslang::EOpSubgroupExclusiveXor: + case glslang::EOpSubgroupQuadSwapHorizontal: + case glslang::EOpSubgroupQuadSwapVertical: + case glslang::EOpSubgroupQuadSwapDiagonal: { + std::vector operands; + operands.push_back(operand); + return createSubgroupOperation(op, typeId, operands, typeProxy); + } #ifdef AMD_EXTENSIONS case glslang::EOpMbcnt: extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_ballot); @@ -4359,7 +4747,13 @@ libCall = spv::CubeFaceCoordAMD; break; #endif - +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartition: + builder.addExtension(spv::E_SPV_NV_shader_subgroup_partitioned); + builder.addCapability(spv::CapabilityGroupNonUniformPartitionedNV); + unaryOp = spv::OpGroupNonUniformPartitionNV; + break; +#endif default: return 0; } @@ -4373,12 +4767,14 @@ id = builder.createUnaryOp(unaryOp, typeId, operand); } - addDecoration(id, noContraction); - return builder.setPrecision(id, precision); + builder.addDecoration(id, decorations.noContraction); + builder.addDecoration(id, decorations.nonUniform); + return builder.setPrecision(id, decorations.precision); } // Create a unary operation on a matrix -spv::Id TGlslangToSpvTraverser::createUnaryMatrixOperation(spv::Op op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id operand, glslang::TBasicType /* typeProxy */) +spv::Id TGlslangToSpvTraverser::createUnaryMatrixOperation(spv::Op op, OpDecorations& decorations, spv::Id typeId, + spv::Id operand, glslang::TBasicType /* typeProxy */) { // Handle unary operations vector by vector. // The result type is the same type as the original type. @@ -4400,40 +4796,162 @@ indexes.push_back(c); spv::Id srcVec = builder.createCompositeExtract(operand, srcVecType, indexes); spv::Id destVec = builder.createUnaryOp(op, destVecType, srcVec); - addDecoration(destVec, noContraction); - results.push_back(builder.setPrecision(destVec, precision)); + builder.addDecoration(destVec, decorations.noContraction); + builder.addDecoration(destVec, decorations.nonUniform); + results.push_back(builder.setPrecision(destVec, decorations.precision)); } // put the pieces together - return builder.setPrecision(builder.createCompositeConstruct(typeId, results), precision); + spv::Id result = builder.setPrecision(builder.createCompositeConstruct(typeId, results), decorations.precision); + builder.addDecoration(result, decorations.nonUniform); + return result; } -spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id destType, spv::Id operand, glslang::TBasicType typeProxy) +spv::Id TGlslangToSpvTraverser::createConversionOperation(glslang::TOperator op, spv::Id operand, int vectorSize) { spv::Op convOp = spv::OpNop; - spv::Id zero = 0; - spv::Id one = 0; spv::Id type = 0; + spv::Id result = 0; + + switch(op) { + case glslang::EOpConvInt8ToUint16: + convOp = spv::OpSConvert; + type = builder.makeIntType(16); + break; + case glslang::EOpConvInt8ToUint: + convOp = spv::OpSConvert; + type = builder.makeIntType(32); + break; + case glslang::EOpConvInt8ToUint64: + convOp = spv::OpSConvert; + type = builder.makeIntType(64); + break; + case glslang::EOpConvInt16ToUint8: + convOp = spv::OpSConvert; + type = builder.makeIntType(8); + break; + case glslang::EOpConvInt16ToUint: + convOp = spv::OpSConvert; + type = builder.makeIntType(32); + break; + case glslang::EOpConvInt16ToUint64: + convOp = spv::OpSConvert; + type = builder.makeIntType(64); + break; + case glslang::EOpConvIntToUint8: + convOp = spv::OpSConvert; + type = builder.makeIntType(8); + break; + case glslang::EOpConvIntToUint16: + convOp = spv::OpSConvert; + type = builder.makeIntType(16); + break; + case glslang::EOpConvIntToUint64: + convOp = spv::OpSConvert; + type = builder.makeIntType(64); + break; + case glslang::EOpConvInt64ToUint8: + convOp = spv::OpSConvert; + type = builder.makeIntType(8); + break; + case glslang::EOpConvInt64ToUint16: + convOp = spv::OpSConvert; + type = builder.makeIntType(16); + break; + case glslang::EOpConvInt64ToUint: + convOp = spv::OpSConvert; + type = builder.makeIntType(32); + break; + case glslang::EOpConvUint8ToInt16: + convOp = spv::OpUConvert; + type = builder.makeIntType(16); + break; + case glslang::EOpConvUint8ToInt: + convOp = spv::OpUConvert; + type = builder.makeIntType(32); + break; + case glslang::EOpConvUint8ToInt64: + convOp = spv::OpUConvert; + type = builder.makeIntType(64); + break; + case glslang::EOpConvUint16ToInt8: + convOp = spv::OpUConvert; + type = builder.makeIntType(8); + break; + case glslang::EOpConvUint16ToInt: + convOp = spv::OpUConvert; + type = builder.makeIntType(32); + break; + case glslang::EOpConvUint16ToInt64: + convOp = spv::OpUConvert; + type = builder.makeIntType(64); + break; + case glslang::EOpConvUintToInt8: + convOp = spv::OpUConvert; + type = builder.makeIntType(8); + break; + case glslang::EOpConvUintToInt16: + convOp = spv::OpUConvert; + type = builder.makeIntType(16); + break; + case glslang::EOpConvUintToInt64: + convOp = spv::OpUConvert; + type = builder.makeIntType(64); + break; + case glslang::EOpConvUint64ToInt8: + convOp = spv::OpUConvert; + type = builder.makeIntType(8); + break; + case glslang::EOpConvUint64ToInt16: + convOp = spv::OpUConvert; + type = builder.makeIntType(16); + break; + case glslang::EOpConvUint64ToInt: + convOp = spv::OpUConvert; + type = builder.makeIntType(32); + break; + + default: + assert(false && "Default missing"); + break; + } + + if (vectorSize > 0) + type = builder.makeVectorType(type, vectorSize); + + result = builder.createUnaryOp(convOp, type, operand); + return result; +} + +spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, OpDecorations& decorations, spv::Id destType, + spv::Id operand, glslang::TBasicType typeProxy) +{ + spv::Op convOp = spv::OpNop; + spv::Id zero = 0; + spv::Id one = 0; + int vectorSize = builder.isVectorType(destType) ? builder.getNumTypeComponents(destType) : 0; switch (op) { + case glslang::EOpConvInt8ToBool: + case glslang::EOpConvUint8ToBool: + zero = builder.makeUint8Constant(0); + zero = makeSmearedConstant(zero, vectorSize); + return builder.createBinOp(spv::OpINotEqual, destType, operand, zero); + case glslang::EOpConvInt16ToBool: + case glslang::EOpConvUint16ToBool: + zero = builder.makeUint16Constant(0); + zero = makeSmearedConstant(zero, vectorSize); + return builder.createBinOp(spv::OpINotEqual, destType, operand, zero); case glslang::EOpConvIntToBool: case glslang::EOpConvUintToBool: + zero = builder.makeUintConstant(0); + zero = makeSmearedConstant(zero, vectorSize); + return builder.createBinOp(spv::OpINotEqual, destType, operand, zero); case glslang::EOpConvInt64ToBool: case glslang::EOpConvUint64ToBool: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvInt16ToBool: - case glslang::EOpConvUint16ToBool: -#endif - if (op == glslang::EOpConvInt64ToBool || op == glslang::EOpConvUint64ToBool) - zero = builder.makeUint64Constant(0); -#ifdef AMD_EXTENSIONS - else if (op == glslang::EOpConvInt16ToBool || op == glslang::EOpConvUint16ToBool) - zero = builder.makeUint16Constant(0); -#endif - else - zero = builder.makeUintConstant(0); + zero = builder.makeUint64Constant(0); zero = makeSmearedConstant(zero, vectorSize); return builder.createBinOp(spv::OpINotEqual, destType, operand, zero); @@ -4447,12 +4965,10 @@ zero = makeSmearedConstant(zero, vectorSize); return builder.createBinOp(spv::OpFOrdNotEqual, destType, operand, zero); -#ifdef AMD_EXTENSIONS case glslang::EOpConvFloat16ToBool: zero = builder.makeFloat16Constant(0.0F); zero = makeSmearedConstant(zero, vectorSize); return builder.createBinOp(spv::OpFOrdNotEqual, destType, operand, zero); -#endif case glslang::EOpConvBoolToFloat: convOp = spv::OpSelect; @@ -4466,34 +4982,45 @@ one = builder.makeDoubleConstant(1.0); break; -#ifdef AMD_EXTENSIONS case glslang::EOpConvBoolToFloat16: convOp = spv::OpSelect; zero = builder.makeFloat16Constant(0.0F); one = builder.makeFloat16Constant(1.0F); break; -#endif + + case glslang::EOpConvBoolToInt8: + zero = builder.makeInt8Constant(0); + one = builder.makeInt8Constant(1); + convOp = spv::OpSelect; + break; + + case glslang::EOpConvBoolToUint8: + zero = builder.makeUint8Constant(0); + one = builder.makeUint8Constant(1); + convOp = spv::OpSelect; + break; + + case glslang::EOpConvBoolToInt16: + zero = builder.makeInt16Constant(0); + one = builder.makeInt16Constant(1); + convOp = spv::OpSelect; + break; + + case glslang::EOpConvBoolToUint16: + zero = builder.makeUint16Constant(0); + one = builder.makeUint16Constant(1); + convOp = spv::OpSelect; + break; case glslang::EOpConvBoolToInt: case glslang::EOpConvBoolToInt64: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvBoolToInt16: -#endif if (op == glslang::EOpConvBoolToInt64) zero = builder.makeInt64Constant(0); -#ifdef AMD_EXTENSIONS - else if (op == glslang::EOpConvBoolToInt16) - zero = builder.makeInt16Constant(0); -#endif else zero = builder.makeIntConstant(0); if (op == glslang::EOpConvBoolToInt64) one = builder.makeInt64Constant(1); -#ifdef AMD_EXTENSIONS - else if (op == glslang::EOpConvBoolToInt16) - one = builder.makeInt16Constant(1); -#endif else one = builder.makeIntConstant(1); @@ -4502,104 +5029,94 @@ case glslang::EOpConvBoolToUint: case glslang::EOpConvBoolToUint64: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvBoolToUint16: -#endif if (op == glslang::EOpConvBoolToUint64) zero = builder.makeUint64Constant(0); -#ifdef AMD_EXTENSIONS - else if (op == glslang::EOpConvBoolToUint16) - zero = builder.makeUint16Constant(0); -#endif else zero = builder.makeUintConstant(0); if (op == glslang::EOpConvBoolToUint64) one = builder.makeUint64Constant(1); -#ifdef AMD_EXTENSIONS - else if (op == glslang::EOpConvBoolToUint16) - one = builder.makeUint16Constant(1); -#endif else one = builder.makeUintConstant(1); convOp = spv::OpSelect; break; + case glslang::EOpConvInt8ToFloat16: + case glslang::EOpConvInt8ToFloat: + case glslang::EOpConvInt8ToDouble: + case glslang::EOpConvInt16ToFloat16: + case glslang::EOpConvInt16ToFloat: + case glslang::EOpConvInt16ToDouble: + case glslang::EOpConvIntToFloat16: case glslang::EOpConvIntToFloat: case glslang::EOpConvIntToDouble: case glslang::EOpConvInt64ToFloat: case glslang::EOpConvInt64ToDouble: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvInt16ToFloat: - case glslang::EOpConvInt16ToDouble: - case glslang::EOpConvInt16ToFloat16: - case glslang::EOpConvIntToFloat16: case glslang::EOpConvInt64ToFloat16: -#endif convOp = spv::OpConvertSToF; break; + case glslang::EOpConvUint8ToFloat16: + case glslang::EOpConvUint8ToFloat: + case glslang::EOpConvUint8ToDouble: + case glslang::EOpConvUint16ToFloat16: + case glslang::EOpConvUint16ToFloat: + case glslang::EOpConvUint16ToDouble: + case glslang::EOpConvUintToFloat16: case glslang::EOpConvUintToFloat: case glslang::EOpConvUintToDouble: case glslang::EOpConvUint64ToFloat: case glslang::EOpConvUint64ToDouble: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvUint16ToFloat: - case glslang::EOpConvUint16ToDouble: - case glslang::EOpConvUint16ToFloat16: - case glslang::EOpConvUintToFloat16: case glslang::EOpConvUint64ToFloat16: -#endif convOp = spv::OpConvertUToF; break; case glslang::EOpConvDoubleToFloat: case glslang::EOpConvFloatToDouble: -#ifdef AMD_EXTENSIONS case glslang::EOpConvDoubleToFloat16: case glslang::EOpConvFloat16ToDouble: case glslang::EOpConvFloatToFloat16: case glslang::EOpConvFloat16ToFloat: -#endif convOp = spv::OpFConvert; if (builder.isMatrixType(destType)) - return createUnaryMatrixOperation(convOp, precision, noContraction, destType, operand, typeProxy); + return createUnaryMatrixOperation(convOp, decorations, destType, operand, typeProxy); break; - case glslang::EOpConvFloatToInt: - case glslang::EOpConvDoubleToInt: - case glslang::EOpConvFloatToInt64: - case glslang::EOpConvDoubleToInt64: -#ifdef AMD_EXTENSIONS + case glslang::EOpConvFloat16ToInt8: + case glslang::EOpConvFloatToInt8: + case glslang::EOpConvDoubleToInt8: + case glslang::EOpConvFloat16ToInt16: case glslang::EOpConvFloatToInt16: case glslang::EOpConvDoubleToInt16: - case glslang::EOpConvFloat16ToInt16: case glslang::EOpConvFloat16ToInt: + case glslang::EOpConvFloatToInt: + case glslang::EOpConvDoubleToInt: case glslang::EOpConvFloat16ToInt64: -#endif + case glslang::EOpConvFloatToInt64: + case glslang::EOpConvDoubleToInt64: convOp = spv::OpConvertFToS; break; + case glslang::EOpConvUint8ToInt8: + case glslang::EOpConvInt8ToUint8: + case glslang::EOpConvUint16ToInt16: + case glslang::EOpConvInt16ToUint16: case glslang::EOpConvUintToInt: case glslang::EOpConvIntToUint: case glslang::EOpConvUint64ToInt64: case glslang::EOpConvInt64ToUint64: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvUint16ToInt16: - case glslang::EOpConvInt16ToUint16: -#endif if (builder.isInSpecConstCodeGenMode()) { // Build zero scalar or vector for OpIAdd. - if (op == glslang::EOpConvUint64ToInt64 || op == glslang::EOpConvInt64ToUint64) - zero = builder.makeUint64Constant(0); -#ifdef AMD_EXTENSIONS - else if (op == glslang::EOpConvUint16ToInt16 || op == glslang::EOpConvInt16ToUint16) + if(op == glslang::EOpConvUint8ToInt8 || op == glslang::EOpConvInt8ToUint8) { + zero = builder.makeUint8Constant(0); + } else if (op == glslang::EOpConvUint16ToInt16 || op == glslang::EOpConvInt16ToUint16) { zero = builder.makeUint16Constant(0); -#endif - else + } else if (op == glslang::EOpConvUint64ToInt64 || op == glslang::EOpConvInt64ToUint64) { + zero = builder.makeUint64Constant(0); + } else { zero = builder.makeUintConstant(0); - + } zero = makeSmearedConstant(zero, vectorSize); // Use OpIAdd, instead of OpBitcast to do the conversion when // generating for OpSpecConstantOp instruction. @@ -4609,126 +5126,117 @@ convOp = spv::OpBitcast; break; + case glslang::EOpConvFloat16ToUint8: + case glslang::EOpConvFloatToUint8: + case glslang::EOpConvDoubleToUint8: + case glslang::EOpConvFloat16ToUint16: + case glslang::EOpConvFloatToUint16: + case glslang::EOpConvDoubleToUint16: + case glslang::EOpConvFloat16ToUint: case glslang::EOpConvFloatToUint: case glslang::EOpConvDoubleToUint: case glslang::EOpConvFloatToUint64: case glslang::EOpConvDoubleToUint64: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvFloatToUint16: - case glslang::EOpConvDoubleToUint16: - case glslang::EOpConvFloat16ToUint16: - case glslang::EOpConvFloat16ToUint: case glslang::EOpConvFloat16ToUint64: -#endif convOp = spv::OpConvertFToU; break; - case glslang::EOpConvIntToInt64: - case glslang::EOpConvInt64ToInt: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvIntToInt16: + case glslang::EOpConvInt8ToInt16: + case glslang::EOpConvInt8ToInt: + case glslang::EOpConvInt8ToInt64: + case glslang::EOpConvInt16ToInt8: case glslang::EOpConvInt16ToInt: - case glslang::EOpConvInt64ToInt16: case glslang::EOpConvInt16ToInt64: -#endif + case glslang::EOpConvIntToInt8: + case glslang::EOpConvIntToInt16: + case glslang::EOpConvIntToInt64: + case glslang::EOpConvInt64ToInt8: + case glslang::EOpConvInt64ToInt16: + case glslang::EOpConvInt64ToInt: convOp = spv::OpSConvert; break; - case glslang::EOpConvUintToUint64: - case glslang::EOpConvUint64ToUint: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvUintToUint16: + case glslang::EOpConvUint8ToUint16: + case glslang::EOpConvUint8ToUint: + case glslang::EOpConvUint8ToUint64: + case glslang::EOpConvUint16ToUint8: case glslang::EOpConvUint16ToUint: - case glslang::EOpConvUint64ToUint16: case glslang::EOpConvUint16ToUint64: -#endif + case glslang::EOpConvUintToUint8: + case glslang::EOpConvUintToUint16: + case glslang::EOpConvUintToUint64: + case glslang::EOpConvUint64ToUint8: + case glslang::EOpConvUint64ToUint16: + case glslang::EOpConvUint64ToUint: convOp = spv::OpUConvert; break; - case glslang::EOpConvIntToUint64: - case glslang::EOpConvInt64ToUint: - case glslang::EOpConvUint64ToInt: - case glslang::EOpConvUintToInt64: -#ifdef AMD_EXTENSIONS + case glslang::EOpConvInt8ToUint16: + case glslang::EOpConvInt8ToUint: + case glslang::EOpConvInt8ToUint64: + case glslang::EOpConvInt16ToUint8: case glslang::EOpConvInt16ToUint: - case glslang::EOpConvUintToInt16: case glslang::EOpConvInt16ToUint64: - case glslang::EOpConvUint64ToInt16: - case glslang::EOpConvUint16ToInt: + case glslang::EOpConvIntToUint8: case glslang::EOpConvIntToUint16: - case glslang::EOpConvUint16ToInt64: + case glslang::EOpConvIntToUint64: + case glslang::EOpConvInt64ToUint8: case glslang::EOpConvInt64ToUint16: -#endif + case glslang::EOpConvInt64ToUint: + case glslang::EOpConvUint8ToInt16: + case glslang::EOpConvUint8ToInt: + case glslang::EOpConvUint8ToInt64: + case glslang::EOpConvUint16ToInt8: + case glslang::EOpConvUint16ToInt: + case glslang::EOpConvUint16ToInt64: + case glslang::EOpConvUintToInt8: + case glslang::EOpConvUintToInt16: + case glslang::EOpConvUintToInt64: + case glslang::EOpConvUint64ToInt8: + case glslang::EOpConvUint64ToInt16: + case glslang::EOpConvUint64ToInt: // OpSConvert/OpUConvert + OpBitCast - switch (op) { - case glslang::EOpConvIntToUint64: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvInt16ToUint64: -#endif - convOp = spv::OpSConvert; - type = builder.makeIntType(64); - break; - case glslang::EOpConvInt64ToUint: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvInt16ToUint: -#endif - convOp = spv::OpSConvert; - type = builder.makeIntType(32); - break; - case glslang::EOpConvUint64ToInt: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvUint16ToInt: -#endif - convOp = spv::OpUConvert; - type = builder.makeUintType(32); - break; - case glslang::EOpConvUintToInt64: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvUint16ToInt64: -#endif - convOp = spv::OpUConvert; - type = builder.makeUintType(64); - break; -#ifdef AMD_EXTENSIONS - case glslang::EOpConvUintToInt16: - case glslang::EOpConvUint64ToInt16: - convOp = spv::OpUConvert; - type = builder.makeUintType(16); - break; - case glslang::EOpConvIntToUint16: - case glslang::EOpConvInt64ToUint16: - convOp = spv::OpSConvert; - type = builder.makeIntType(16); - break; -#endif - default: - assert(0); - break; - } - - if (vectorSize > 0) - type = builder.makeVectorType(type, vectorSize); - - operand = builder.createUnaryOp(convOp, type, operand); + operand = createConversionOperation(op, operand, vectorSize); if (builder.isInSpecConstCodeGenMode()) { // Build zero scalar or vector for OpIAdd. -#ifdef AMD_EXTENSIONS - if (op == glslang::EOpConvIntToUint64 || op == glslang::EOpConvUintToInt64 || - op == glslang::EOpConvInt16ToUint64 || op == glslang::EOpConvUint16ToInt64) - zero = builder.makeUint64Constant(0); - else if (op == glslang::EOpConvIntToUint16 || op == glslang::EOpConvUintToInt16 || - op == glslang::EOpConvInt64ToUint16 || op == glslang::EOpConvUint64ToInt16) + switch(op) { + case glslang::EOpConvInt16ToUint8: + case glslang::EOpConvIntToUint8: + case glslang::EOpConvInt64ToUint8: + case glslang::EOpConvUint16ToInt8: + case glslang::EOpConvUintToInt8: + case glslang::EOpConvUint64ToInt8: + zero = builder.makeUint8Constant(0); + break; + case glslang::EOpConvInt8ToUint16: + case glslang::EOpConvIntToUint16: + case glslang::EOpConvInt64ToUint16: + case glslang::EOpConvUint8ToInt16: + case glslang::EOpConvUintToInt16: + case glslang::EOpConvUint64ToInt16: zero = builder.makeUint16Constant(0); - else + break; + case glslang::EOpConvInt8ToUint: + case glslang::EOpConvInt16ToUint: + case glslang::EOpConvInt64ToUint: + case glslang::EOpConvUint8ToInt: + case glslang::EOpConvUint16ToInt: + case glslang::EOpConvUint64ToInt: zero = builder.makeUintConstant(0); -#else - if (op == glslang::EOpConvIntToUint64 || op == glslang::EOpConvUintToInt64) + break; + case glslang::EOpConvInt8ToUint64: + case glslang::EOpConvInt16ToUint64: + case glslang::EOpConvIntToUint64: + case glslang::EOpConvUint8ToInt64: + case glslang::EOpConvUint16ToInt64: + case glslang::EOpConvUintToInt64: zero = builder.makeUint64Constant(0); - else - zero = builder.makeUintConstant(0); -#endif - + break; + default: + assert(false && "Default missing"); + break; + } zero = makeSmearedConstant(zero, vectorSize); // Use OpIAdd, instead of OpBitcast to do the conversion when // generating for OpSpecConstantOp instruction. @@ -4752,7 +5260,9 @@ } else result = builder.createUnaryOp(convOp, destType, operand); - return builder.setPrecision(result, precision); + result = builder.setPrecision(result, decorations.precision); + builder.addDecoration(result, decorations.nonUniform); + return result; } spv::Id TGlslangToSpvTraverser::makeSmearedConstant(spv::Id constant, int vectorSize) @@ -4870,10 +5380,8 @@ // Create group invocation operations. spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy) { -#ifdef AMD_EXTENSIONS - bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64; - bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble || typeProxy == glslang::EbtFloat16; -#endif + bool isUnsigned = isTypeUnsignedInt(typeProxy); + bool isFloat = isTypeFloat(typeProxy); spv::Op opCode = spv::OpNop; std::vector spvGroupOperands; @@ -5134,15 +5642,353 @@ return builder.createCompositeConstruct(typeId, results); } -spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy) +// Create subgroup invocation operations. +spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy) { -#ifdef AMD_EXTENSIONS - bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64 || typeProxy == glslang::EbtUint16; - bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble || typeProxy == glslang::EbtFloat16; -#else - bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64; - bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble; + // Add the required capabilities. + switch (op) { + case glslang::EOpSubgroupElect: + builder.addCapability(spv::CapabilityGroupNonUniform); + break; + case glslang::EOpSubgroupAll: + case glslang::EOpSubgroupAny: + case glslang::EOpSubgroupAllEqual: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformVote); + break; + case glslang::EOpSubgroupBroadcast: + case glslang::EOpSubgroupBroadcastFirst: + case glslang::EOpSubgroupBallot: + case glslang::EOpSubgroupInverseBallot: + case glslang::EOpSubgroupBallotBitExtract: + case glslang::EOpSubgroupBallotBitCount: + case glslang::EOpSubgroupBallotInclusiveBitCount: + case glslang::EOpSubgroupBallotExclusiveBitCount: + case glslang::EOpSubgroupBallotFindLSB: + case glslang::EOpSubgroupBallotFindMSB: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformBallot); + break; + case glslang::EOpSubgroupShuffle: + case glslang::EOpSubgroupShuffleXor: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformShuffle); + break; + case glslang::EOpSubgroupShuffleUp: + case glslang::EOpSubgroupShuffleDown: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformShuffleRelative); + break; + case glslang::EOpSubgroupAdd: + case glslang::EOpSubgroupMul: + case glslang::EOpSubgroupMin: + case glslang::EOpSubgroupMax: + case glslang::EOpSubgroupAnd: + case glslang::EOpSubgroupOr: + case glslang::EOpSubgroupXor: + case glslang::EOpSubgroupInclusiveAdd: + case glslang::EOpSubgroupInclusiveMul: + case glslang::EOpSubgroupInclusiveMin: + case glslang::EOpSubgroupInclusiveMax: + case glslang::EOpSubgroupInclusiveAnd: + case glslang::EOpSubgroupInclusiveOr: + case glslang::EOpSubgroupInclusiveXor: + case glslang::EOpSubgroupExclusiveAdd: + case glslang::EOpSubgroupExclusiveMul: + case glslang::EOpSubgroupExclusiveMin: + case glslang::EOpSubgroupExclusiveMax: + case glslang::EOpSubgroupExclusiveAnd: + case glslang::EOpSubgroupExclusiveOr: + case glslang::EOpSubgroupExclusiveXor: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformArithmetic); + break; + case glslang::EOpSubgroupClusteredAdd: + case glslang::EOpSubgroupClusteredMul: + case glslang::EOpSubgroupClusteredMin: + case glslang::EOpSubgroupClusteredMax: + case glslang::EOpSubgroupClusteredAnd: + case glslang::EOpSubgroupClusteredOr: + case glslang::EOpSubgroupClusteredXor: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformClustered); + break; + case glslang::EOpSubgroupQuadBroadcast: + case glslang::EOpSubgroupQuadSwapHorizontal: + case glslang::EOpSubgroupQuadSwapVertical: + case glslang::EOpSubgroupQuadSwapDiagonal: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformQuad); + break; +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedAdd: + case glslang::EOpSubgroupPartitionedMul: + case glslang::EOpSubgroupPartitionedMin: + case glslang::EOpSubgroupPartitionedMax: + case glslang::EOpSubgroupPartitionedAnd: + case glslang::EOpSubgroupPartitionedOr: + case glslang::EOpSubgroupPartitionedXor: + case glslang::EOpSubgroupPartitionedInclusiveAdd: + case glslang::EOpSubgroupPartitionedInclusiveMul: + case glslang::EOpSubgroupPartitionedInclusiveMin: + case glslang::EOpSubgroupPartitionedInclusiveMax: + case glslang::EOpSubgroupPartitionedInclusiveAnd: + case glslang::EOpSubgroupPartitionedInclusiveOr: + case glslang::EOpSubgroupPartitionedInclusiveXor: + case glslang::EOpSubgroupPartitionedExclusiveAdd: + case glslang::EOpSubgroupPartitionedExclusiveMul: + case glslang::EOpSubgroupPartitionedExclusiveMin: + case glslang::EOpSubgroupPartitionedExclusiveMax: + case glslang::EOpSubgroupPartitionedExclusiveAnd: + case glslang::EOpSubgroupPartitionedExclusiveOr: + case glslang::EOpSubgroupPartitionedExclusiveXor: + builder.addExtension(spv::E_SPV_NV_shader_subgroup_partitioned); + builder.addCapability(spv::CapabilityGroupNonUniformPartitionedNV); + break; +#endif + default: assert(0 && "Unhandled subgroup operation!"); + } + + const bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64; + const bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble; + const bool isBool = typeProxy == glslang::EbtBool; + + spv::Op opCode = spv::OpNop; + + // Figure out which opcode to use. + switch (op) { + case glslang::EOpSubgroupElect: opCode = spv::OpGroupNonUniformElect; break; + case glslang::EOpSubgroupAll: opCode = spv::OpGroupNonUniformAll; break; + case glslang::EOpSubgroupAny: opCode = spv::OpGroupNonUniformAny; break; + case glslang::EOpSubgroupAllEqual: opCode = spv::OpGroupNonUniformAllEqual; break; + case glslang::EOpSubgroupBroadcast: opCode = spv::OpGroupNonUniformBroadcast; break; + case glslang::EOpSubgroupBroadcastFirst: opCode = spv::OpGroupNonUniformBroadcastFirst; break; + case glslang::EOpSubgroupBallot: opCode = spv::OpGroupNonUniformBallot; break; + case glslang::EOpSubgroupInverseBallot: opCode = spv::OpGroupNonUniformInverseBallot; break; + case glslang::EOpSubgroupBallotBitExtract: opCode = spv::OpGroupNonUniformBallotBitExtract; break; + case glslang::EOpSubgroupBallotBitCount: + case glslang::EOpSubgroupBallotInclusiveBitCount: + case glslang::EOpSubgroupBallotExclusiveBitCount: opCode = spv::OpGroupNonUniformBallotBitCount; break; + case glslang::EOpSubgroupBallotFindLSB: opCode = spv::OpGroupNonUniformBallotFindLSB; break; + case glslang::EOpSubgroupBallotFindMSB: opCode = spv::OpGroupNonUniformBallotFindMSB; break; + case glslang::EOpSubgroupShuffle: opCode = spv::OpGroupNonUniformShuffle; break; + case glslang::EOpSubgroupShuffleXor: opCode = spv::OpGroupNonUniformShuffleXor; break; + case glslang::EOpSubgroupShuffleUp: opCode = spv::OpGroupNonUniformShuffleUp; break; + case glslang::EOpSubgroupShuffleDown: opCode = spv::OpGroupNonUniformShuffleDown; break; + case glslang::EOpSubgroupAdd: + case glslang::EOpSubgroupInclusiveAdd: + case glslang::EOpSubgroupExclusiveAdd: + case glslang::EOpSubgroupClusteredAdd: +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedAdd: + case glslang::EOpSubgroupPartitionedInclusiveAdd: + case glslang::EOpSubgroupPartitionedExclusiveAdd: #endif + if (isFloat) { + opCode = spv::OpGroupNonUniformFAdd; + } else { + opCode = spv::OpGroupNonUniformIAdd; + } + break; + case glslang::EOpSubgroupMul: + case glslang::EOpSubgroupInclusiveMul: + case glslang::EOpSubgroupExclusiveMul: + case glslang::EOpSubgroupClusteredMul: +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedMul: + case glslang::EOpSubgroupPartitionedInclusiveMul: + case glslang::EOpSubgroupPartitionedExclusiveMul: +#endif + if (isFloat) { + opCode = spv::OpGroupNonUniformFMul; + } else { + opCode = spv::OpGroupNonUniformIMul; + } + break; + case glslang::EOpSubgroupMin: + case glslang::EOpSubgroupInclusiveMin: + case glslang::EOpSubgroupExclusiveMin: + case glslang::EOpSubgroupClusteredMin: +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedMin: + case glslang::EOpSubgroupPartitionedInclusiveMin: + case glslang::EOpSubgroupPartitionedExclusiveMin: +#endif + if (isFloat) { + opCode = spv::OpGroupNonUniformFMin; + } else if (isUnsigned) { + opCode = spv::OpGroupNonUniformUMin; + } else { + opCode = spv::OpGroupNonUniformSMin; + } + break; + case glslang::EOpSubgroupMax: + case glslang::EOpSubgroupInclusiveMax: + case glslang::EOpSubgroupExclusiveMax: + case glslang::EOpSubgroupClusteredMax: +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedMax: + case glslang::EOpSubgroupPartitionedInclusiveMax: + case glslang::EOpSubgroupPartitionedExclusiveMax: +#endif + if (isFloat) { + opCode = spv::OpGroupNonUniformFMax; + } else if (isUnsigned) { + opCode = spv::OpGroupNonUniformUMax; + } else { + opCode = spv::OpGroupNonUniformSMax; + } + break; + case glslang::EOpSubgroupAnd: + case glslang::EOpSubgroupInclusiveAnd: + case glslang::EOpSubgroupExclusiveAnd: + case glslang::EOpSubgroupClusteredAnd: +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedAnd: + case glslang::EOpSubgroupPartitionedInclusiveAnd: + case glslang::EOpSubgroupPartitionedExclusiveAnd: +#endif + if (isBool) { + opCode = spv::OpGroupNonUniformLogicalAnd; + } else { + opCode = spv::OpGroupNonUniformBitwiseAnd; + } + break; + case glslang::EOpSubgroupOr: + case glslang::EOpSubgroupInclusiveOr: + case glslang::EOpSubgroupExclusiveOr: + case glslang::EOpSubgroupClusteredOr: +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedOr: + case glslang::EOpSubgroupPartitionedInclusiveOr: + case glslang::EOpSubgroupPartitionedExclusiveOr: +#endif + if (isBool) { + opCode = spv::OpGroupNonUniformLogicalOr; + } else { + opCode = spv::OpGroupNonUniformBitwiseOr; + } + break; + case glslang::EOpSubgroupXor: + case glslang::EOpSubgroupInclusiveXor: + case glslang::EOpSubgroupExclusiveXor: + case glslang::EOpSubgroupClusteredXor: +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedXor: + case glslang::EOpSubgroupPartitionedInclusiveXor: + case glslang::EOpSubgroupPartitionedExclusiveXor: +#endif + if (isBool) { + opCode = spv::OpGroupNonUniformLogicalXor; + } else { + opCode = spv::OpGroupNonUniformBitwiseXor; + } + break; + case glslang::EOpSubgroupQuadBroadcast: opCode = spv::OpGroupNonUniformQuadBroadcast; break; + case glslang::EOpSubgroupQuadSwapHorizontal: + case glslang::EOpSubgroupQuadSwapVertical: + case glslang::EOpSubgroupQuadSwapDiagonal: opCode = spv::OpGroupNonUniformQuadSwap; break; + default: assert(0 && "Unhandled subgroup operation!"); + } + + std::vector spvGroupOperands; + + // Every operation begins with the Execution Scope operand. + spvGroupOperands.push_back(builder.makeUintConstant(spv::ScopeSubgroup)); + + // Next, for all operations that use a Group Operation, push that as an operand. + switch (op) { + default: break; + case glslang::EOpSubgroupBallotBitCount: + case glslang::EOpSubgroupAdd: + case glslang::EOpSubgroupMul: + case glslang::EOpSubgroupMin: + case glslang::EOpSubgroupMax: + case glslang::EOpSubgroupAnd: + case glslang::EOpSubgroupOr: + case glslang::EOpSubgroupXor: + spvGroupOperands.push_back(spv::GroupOperationReduce); + break; + case glslang::EOpSubgroupBallotInclusiveBitCount: + case glslang::EOpSubgroupInclusiveAdd: + case glslang::EOpSubgroupInclusiveMul: + case glslang::EOpSubgroupInclusiveMin: + case glslang::EOpSubgroupInclusiveMax: + case glslang::EOpSubgroupInclusiveAnd: + case glslang::EOpSubgroupInclusiveOr: + case glslang::EOpSubgroupInclusiveXor: + spvGroupOperands.push_back(spv::GroupOperationInclusiveScan); + break; + case glslang::EOpSubgroupBallotExclusiveBitCount: + case glslang::EOpSubgroupExclusiveAdd: + case glslang::EOpSubgroupExclusiveMul: + case glslang::EOpSubgroupExclusiveMin: + case glslang::EOpSubgroupExclusiveMax: + case glslang::EOpSubgroupExclusiveAnd: + case glslang::EOpSubgroupExclusiveOr: + case glslang::EOpSubgroupExclusiveXor: + spvGroupOperands.push_back(spv::GroupOperationExclusiveScan); + break; + case glslang::EOpSubgroupClusteredAdd: + case glslang::EOpSubgroupClusteredMul: + case glslang::EOpSubgroupClusteredMin: + case glslang::EOpSubgroupClusteredMax: + case glslang::EOpSubgroupClusteredAnd: + case glslang::EOpSubgroupClusteredOr: + case glslang::EOpSubgroupClusteredXor: + spvGroupOperands.push_back(spv::GroupOperationClusteredReduce); + break; +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedAdd: + case glslang::EOpSubgroupPartitionedMul: + case glslang::EOpSubgroupPartitionedMin: + case glslang::EOpSubgroupPartitionedMax: + case glslang::EOpSubgroupPartitionedAnd: + case glslang::EOpSubgroupPartitionedOr: + case glslang::EOpSubgroupPartitionedXor: + spvGroupOperands.push_back(spv::GroupOperationPartitionedReduceNV); + break; + case glslang::EOpSubgroupPartitionedInclusiveAdd: + case glslang::EOpSubgroupPartitionedInclusiveMul: + case glslang::EOpSubgroupPartitionedInclusiveMin: + case glslang::EOpSubgroupPartitionedInclusiveMax: + case glslang::EOpSubgroupPartitionedInclusiveAnd: + case glslang::EOpSubgroupPartitionedInclusiveOr: + case glslang::EOpSubgroupPartitionedInclusiveXor: + spvGroupOperands.push_back(spv::GroupOperationPartitionedInclusiveScanNV); + break; + case glslang::EOpSubgroupPartitionedExclusiveAdd: + case glslang::EOpSubgroupPartitionedExclusiveMul: + case glslang::EOpSubgroupPartitionedExclusiveMin: + case glslang::EOpSubgroupPartitionedExclusiveMax: + case glslang::EOpSubgroupPartitionedExclusiveAnd: + case glslang::EOpSubgroupPartitionedExclusiveOr: + case glslang::EOpSubgroupPartitionedExclusiveXor: + spvGroupOperands.push_back(spv::GroupOperationPartitionedExclusiveScanNV); + break; +#endif + } + + // Push back the operands next. + for (auto opIt : operands) { + spvGroupOperands.push_back(opIt); + } + + // Some opcodes have additional operands. + switch (op) { + default: break; + case glslang::EOpSubgroupQuadSwapHorizontal: spvGroupOperands.push_back(builder.makeUintConstant(0)); break; + case glslang::EOpSubgroupQuadSwapVertical: spvGroupOperands.push_back(builder.makeUintConstant(1)); break; + case glslang::EOpSubgroupQuadSwapDiagonal: spvGroupOperands.push_back(builder.makeUintConstant(2)); break; + } + + return builder.createOp(opCode, typeId, spvGroupOperands); +} + +spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy) +{ + bool isUnsigned = isTypeUnsignedInt(typeProxy); + bool isFloat = isTypeFloat(typeProxy); spv::Op opCode = spv::OpNop; int extBuiltins = -1; @@ -5279,10 +6125,11 @@ libCall = spv::GLSLstd450FrexpStruct; assert(builder.isPointerType(typeId1)); typeId1 = builder.getContainedTypeId(typeId1); -#ifdef AMD_EXTENSIONS int width = builder.getScalarTypeWidth(typeId1); -#else - int width = 32; +#ifdef AMD_EXTENSIONS + if (width == 16) + // Using 16-bit exp operand, enable extension SPV_AMD_gpu_shader_int16 + builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16); #endif if (builder.getNumComponents(operands[0]) == 1) frexpIntType = builder.makeIntegerType(width, true); @@ -5299,6 +6146,45 @@ case glslang::EOpReadInvocation: return createInvocationsOperation(op, typeId, operands, typeProxy); + case glslang::EOpSubgroupBroadcast: + case glslang::EOpSubgroupBallotBitExtract: + case glslang::EOpSubgroupShuffle: + case glslang::EOpSubgroupShuffleXor: + case glslang::EOpSubgroupShuffleUp: + case glslang::EOpSubgroupShuffleDown: + case glslang::EOpSubgroupClusteredAdd: + case glslang::EOpSubgroupClusteredMul: + case glslang::EOpSubgroupClusteredMin: + case glslang::EOpSubgroupClusteredMax: + case glslang::EOpSubgroupClusteredAnd: + case glslang::EOpSubgroupClusteredOr: + case glslang::EOpSubgroupClusteredXor: + case glslang::EOpSubgroupQuadBroadcast: +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedAdd: + case glslang::EOpSubgroupPartitionedMul: + case glslang::EOpSubgroupPartitionedMin: + case glslang::EOpSubgroupPartitionedMax: + case glslang::EOpSubgroupPartitionedAnd: + case glslang::EOpSubgroupPartitionedOr: + case glslang::EOpSubgroupPartitionedXor: + case glslang::EOpSubgroupPartitionedInclusiveAdd: + case glslang::EOpSubgroupPartitionedInclusiveMul: + case glslang::EOpSubgroupPartitionedInclusiveMin: + case glslang::EOpSubgroupPartitionedInclusiveMax: + case glslang::EOpSubgroupPartitionedInclusiveAnd: + case glslang::EOpSubgroupPartitionedInclusiveOr: + case glslang::EOpSubgroupPartitionedInclusiveXor: + case glslang::EOpSubgroupPartitionedExclusiveAdd: + case glslang::EOpSubgroupPartitionedExclusiveMul: + case glslang::EOpSubgroupPartitionedExclusiveMin: + case glslang::EOpSubgroupPartitionedExclusiveMax: + case glslang::EOpSubgroupPartitionedExclusiveAnd: + case glslang::EOpSubgroupPartitionedExclusiveOr: + case glslang::EOpSubgroupPartitionedExclusiveXor: +#endif + return createSubgroupOperation(op, typeId, operands, typeProxy); + #ifdef AMD_EXTENSIONS case glslang::EOpSwizzleInvocations: extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_ballot); @@ -5431,41 +6317,90 @@ builder.createNoResultOp(spv::OpEndPrimitive); return 0; case glslang::EOpBarrier: - builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeDevice, spv::MemorySemanticsMaskNone); + if (glslangIntermediate->getStage() == EShLangTessControl) { + builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeInvocation, spv::MemorySemanticsMaskNone); + // TODO: prefer the following, when available: + // builder.createControlBarrier(spv::ScopePatch, spv::ScopePatch, + // spv::MemorySemanticsPatchMask | + // spv::MemorySemanticsAcquireReleaseMask); + } else { + builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeWorkgroup, + spv::MemorySemanticsWorkgroupMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); + } return 0; case glslang::EOpMemoryBarrier: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAllMemory); + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAllMemory | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpMemoryBarrierAtomicCounter: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAtomicCounterMemoryMask); + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAtomicCounterMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpMemoryBarrierBuffer: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsUniformMemoryMask); + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsUniformMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpMemoryBarrierImage: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsImageMemoryMask); + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsImageMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpMemoryBarrierShared: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsWorkgroupMemoryMask); + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsWorkgroupMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpGroupMemoryBarrier: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsCrossWorkgroupMemoryMask); + builder.createMemoryBarrier(spv::ScopeWorkgroup, spv::MemorySemanticsAllMemory | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpAllMemoryBarrierWithGroupSync: - // Control barrier with non-"None" semantic is also a memory barrier. - builder.createControlBarrier(spv::ScopeDevice, spv::ScopeDevice, spv::MemorySemanticsAllMemory); + builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeDevice, + spv::MemorySemanticsAllMemory | + spv::MemorySemanticsAcquireReleaseMask); return 0; - case glslang::EOpGroupMemoryBarrierWithGroupSync: - // Control barrier with non-"None" semantic is also a memory barrier. - builder.createControlBarrier(spv::ScopeDevice, spv::ScopeDevice, spv::MemorySemanticsCrossWorkgroupMemoryMask); + case glslang::EOpDeviceMemoryBarrier: + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsUniformMemoryMask | + spv::MemorySemanticsImageMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); + return 0; + case glslang::EOpDeviceMemoryBarrierWithGroupSync: + builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeDevice, spv::MemorySemanticsUniformMemoryMask | + spv::MemorySemanticsImageMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpWorkgroupMemoryBarrier: - builder.createMemoryBarrier(spv::ScopeWorkgroup, spv::MemorySemanticsWorkgroupMemoryMask); + builder.createMemoryBarrier(spv::ScopeWorkgroup, spv::MemorySemanticsWorkgroupMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpWorkgroupMemoryBarrierWithGroupSync: - // Control barrier with non-"None" semantic is also a memory barrier. - builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeWorkgroup, spv::MemorySemanticsWorkgroupMemoryMask); + builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeWorkgroup, + spv::MemorySemanticsWorkgroupMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; + case glslang::EOpSubgroupBarrier: + builder.createControlBarrier(spv::ScopeSubgroup, spv::ScopeSubgroup, spv::MemorySemanticsAllMemory | + spv::MemorySemanticsAcquireReleaseMask); + return spv::NoResult; + case glslang::EOpSubgroupMemoryBarrier: + builder.createMemoryBarrier(spv::ScopeSubgroup, spv::MemorySemanticsAllMemory | + spv::MemorySemanticsAcquireReleaseMask); + return spv::NoResult; + case glslang::EOpSubgroupMemoryBarrierBuffer: + builder.createMemoryBarrier(spv::ScopeSubgroup, spv::MemorySemanticsUniformMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); + return spv::NoResult; + case glslang::EOpSubgroupMemoryBarrierImage: + builder.createMemoryBarrier(spv::ScopeSubgroup, spv::MemorySemanticsImageMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); + return spv::NoResult; + case glslang::EOpSubgroupMemoryBarrierShared: + builder.createMemoryBarrier(spv::ScopeSubgroup, spv::MemorySemanticsWorkgroupMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); + return spv::NoResult; + case glslang::EOpSubgroupElect: { + std::vector operands; + return createSubgroupOperation(op, typeId, operands, glslang::EbtVoid); + } #ifdef AMD_EXTENSIONS case glslang::EOpTime: { @@ -5494,24 +6429,15 @@ symbolValues[symbol->getId()] = id; if (symbol->getBasicType() != glslang::EbtBlock) { - addDecoration(id, TranslatePrecisionDecoration(symbol->getType())); - addDecoration(id, TranslateInterpolationDecoration(symbol->getType().getQualifier())); - addDecoration(id, TranslateAuxiliaryStorageDecoration(symbol->getType().getQualifier())); + builder.addDecoration(id, TranslatePrecisionDecoration(symbol->getType())); + builder.addDecoration(id, TranslateInterpolationDecoration(symbol->getType().getQualifier())); + builder.addDecoration(id, TranslateAuxiliaryStorageDecoration(symbol->getType().getQualifier())); if (symbol->getType().getQualifier().hasSpecConstantId()) - addDecoration(id, spv::DecorationSpecId, symbol->getType().getQualifier().layoutSpecConstantId); + builder.addDecoration(id, spv::DecorationSpecId, symbol->getType().getQualifier().layoutSpecConstantId); if (symbol->getQualifier().hasIndex()) builder.addDecoration(id, spv::DecorationIndex, symbol->getQualifier().layoutIndex); if (symbol->getQualifier().hasComponent()) builder.addDecoration(id, spv::DecorationComponent, symbol->getQualifier().layoutComponent); - if (glslangIntermediate->getXfbMode()) { - builder.addCapability(spv::CapabilityTransformFeedback); - if (symbol->getQualifier().hasXfbStride()) - builder.addDecoration(id, spv::DecorationXfbStride, symbol->getQualifier().layoutXfbStride); - if (symbol->getQualifier().hasXfbBuffer()) - builder.addDecoration(id, spv::DecorationXfbBuffer, symbol->getQualifier().layoutXfbBuffer); - if (symbol->getQualifier().hasXfbOffset()) - builder.addDecoration(id, spv::DecorationOffset, symbol->getQualifier().layoutXfbOffset); - } // atomic counters use this: if (symbol->getQualifier().hasOffset()) builder.addDecoration(id, spv::DecorationOffset, symbol->getQualifier().layoutOffset); @@ -5519,7 +6445,7 @@ if (symbol->getQualifier().hasLocation()) builder.addDecoration(id, spv::DecorationLocation, symbol->getQualifier().layoutLocation); - addDecoration(id, TranslateInvariantDecoration(symbol->getType().getQualifier())); + builder.addDecoration(id, TranslateInvariantDecoration(symbol->getType().getQualifier())); if (symbol->getQualifier().hasStream() && glslangIntermediate->isMultiStream()) { builder.addCapability(spv::CapabilityGeometryStreams); builder.addDecoration(id, spv::DecorationStream, symbol->getQualifier().layoutStream); @@ -5538,21 +6464,30 @@ builder.addCapability(spv::CapabilityTransformFeedback); if (symbol->getQualifier().hasXfbStride()) builder.addDecoration(id, spv::DecorationXfbStride, symbol->getQualifier().layoutXfbStride); - if (symbol->getQualifier().hasXfbBuffer()) + if (symbol->getQualifier().hasXfbBuffer()) { builder.addDecoration(id, spv::DecorationXfbBuffer, symbol->getQualifier().layoutXfbBuffer); + unsigned stride = glslangIntermediate->getXfbStride(symbol->getQualifier().layoutXfbBuffer); + if (stride != glslang::TQualifier::layoutXfbStrideEnd) + builder.addDecoration(id, spv::DecorationXfbStride, stride); + } + if (symbol->getQualifier().hasXfbOffset()) + builder.addDecoration(id, spv::DecorationOffset, symbol->getQualifier().layoutXfbOffset); } if (symbol->getType().isImage()) { std::vector memory; TranslateMemoryDecoration(symbol->getType().getQualifier(), memory); for (unsigned int i = 0; i < memory.size(); ++i) - addDecoration(id, memory[i]); + builder.addDecoration(id, memory[i]); } // built-in variable decorations spv::BuiltIn builtIn = TranslateBuiltInDecoration(symbol->getQualifier().builtIn, false); if (builtIn != spv::BuiltInMax) - addDecoration(id, spv::DecorationBuiltIn, (int)builtIn); + builder.addDecoration(id, spv::DecorationBuiltIn, (int)builtIn); + + // nonuniform + builder.addDecoration(id, TranslateNonUniformDecoration(symbol->getType().getQualifier())); #ifdef NV_EXTENSIONS if (builtIn == spv::BuiltInSampleMask) { @@ -5562,7 +6497,7 @@ decoration = (spv::Decoration)spv::DecorationOverrideCoverageNV; else decoration = (spv::Decoration)spv::DecorationMax; - addDecoration(id, decoration); + builder.addDecoration(id, decoration); if (decoration != spv::DecorationMax) { builder.addExtension(spv::E_SPV_NV_sample_mask_override_coverage); } @@ -5570,53 +6505,32 @@ else if (builtIn == spv::BuiltInLayer) { // SPV_NV_viewport_array2 extension if (symbol->getQualifier().layoutViewportRelative) { - addDecoration(id, (spv::Decoration)spv::DecorationViewportRelativeNV); + builder.addDecoration(id, (spv::Decoration)spv::DecorationViewportRelativeNV); builder.addCapability(spv::CapabilityShaderViewportMaskNV); builder.addExtension(spv::E_SPV_NV_viewport_array2); } if (symbol->getQualifier().layoutSecondaryViewportRelativeOffset != -2048) { - addDecoration(id, (spv::Decoration)spv::DecorationSecondaryViewportRelativeNV, symbol->getQualifier().layoutSecondaryViewportRelativeOffset); + builder.addDecoration(id, (spv::Decoration)spv::DecorationSecondaryViewportRelativeNV, + symbol->getQualifier().layoutSecondaryViewportRelativeOffset); builder.addCapability(spv::CapabilityShaderStereoViewNV); builder.addExtension(spv::E_SPV_NV_stereo_view_rendering); } } if (symbol->getQualifier().layoutPassthrough) { - addDecoration(id, spv::DecorationPassthroughNV); + builder.addDecoration(id, spv::DecorationPassthroughNV); builder.addCapability(spv::CapabilityGeometryShaderPassthroughNV); builder.addExtension(spv::E_SPV_NV_geometry_shader_passthrough); } #endif - return id; -} - -// If 'dec' is valid, add no-operand decoration to an object -void TGlslangToSpvTraverser::addDecoration(spv::Id id, spv::Decoration dec) -{ - if (dec != spv::DecorationMax) - builder.addDecoration(id, dec); -} - -// If 'dec' is valid, add a one-operand decoration to an object -void TGlslangToSpvTraverser::addDecoration(spv::Id id, spv::Decoration dec, unsigned value) -{ - if (dec != spv::DecorationMax) - builder.addDecoration(id, dec, value); -} - -// If 'dec' is valid, add a no-operand decoration to a struct member -void TGlslangToSpvTraverser::addMemberDecoration(spv::Id id, int member, spv::Decoration dec) -{ - if (dec != spv::DecorationMax) - builder.addMemberDecoration(id, (unsigned)member, dec); -} + if (glslangIntermediate->getHlslFunctionality1() && symbol->getType().getQualifier().semanticName != nullptr) { + builder.addExtension("SPV_GOOGLE_hlsl_functionality1"); + builder.addDecoration(id, (spv::Decoration)spv::DecorationHlslSemanticGOOGLE, + symbol->getType().getQualifier().semanticName); + } -// If 'dec' is valid, add a one-operand decoration to a struct member -void TGlslangToSpvTraverser::addMemberDecoration(spv::Id id, int member, spv::Decoration dec, unsigned value) -{ - if (dec != spv::DecorationMax) - builder.addMemberDecoration(id, (unsigned)member, dec, value); + return id; } // Make a full tree of instructions to build a SPIR-V specialization constant, @@ -5651,8 +6565,10 @@ for (int dim = 0; dim < 3; ++dim) { bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet); dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst)); - if (specConst) - addDecoration(dimConstId.back(), spv::DecorationSpecId, glslangIntermediate->getLocalSizeSpecId(dim)); + if (specConst) { + builder.addDecoration(dimConstId.back(), spv::DecorationSpecId, + glslangIntermediate->getLocalSizeSpecId(dim)); + } } return builder.makeCompositeConstant(builder.makeVectorType(builder.makeUintType(32), 3), dimConstId, true); } @@ -5711,6 +6627,18 @@ for (unsigned int i = 0; i < (unsigned int)glslangType.getVectorSize(); ++i) { bool zero = nextConst >= consts.size(); switch (glslangType.getBasicType()) { + case glslang::EbtInt8: + spvConsts.push_back(builder.makeInt8Constant(zero ? 0 : consts[nextConst].getI8Const())); + break; + case glslang::EbtUint8: + spvConsts.push_back(builder.makeUint8Constant(zero ? 0 : consts[nextConst].getU8Const())); + break; + case glslang::EbtInt16: + spvConsts.push_back(builder.makeInt16Constant(zero ? 0 : consts[nextConst].getI16Const())); + break; + case glslang::EbtUint16: + spvConsts.push_back(builder.makeUint16Constant(zero ? 0 : consts[nextConst].getU16Const())); + break; case glslang::EbtInt: spvConsts.push_back(builder.makeIntConstant(zero ? 0 : consts[nextConst].getIConst())); break; @@ -5723,25 +6651,15 @@ case glslang::EbtUint64: spvConsts.push_back(builder.makeUint64Constant(zero ? 0 : consts[nextConst].getU64Const())); break; -#ifdef AMD_EXTENSIONS - case glslang::EbtInt16: - spvConsts.push_back(builder.makeInt16Constant(zero ? 0 : (short)consts[nextConst].getIConst())); - break; - case glslang::EbtUint16: - spvConsts.push_back(builder.makeUint16Constant(zero ? 0 : (unsigned short)consts[nextConst].getUConst())); - break; -#endif case glslang::EbtFloat: spvConsts.push_back(builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst())); break; case glslang::EbtDouble: spvConsts.push_back(builder.makeDoubleConstant(zero ? 0.0 : consts[nextConst].getDConst())); break; -#ifdef AMD_EXTENSIONS case glslang::EbtFloat16: spvConsts.push_back(builder.makeFloat16Constant(zero ? 0.0F : (float)consts[nextConst].getDConst())); break; -#endif case glslang::EbtBool: spvConsts.push_back(builder.makeBoolConstant(zero ? false : consts[nextConst].getBConst())); break; @@ -5756,6 +6674,18 @@ bool zero = nextConst >= consts.size(); spv::Id scalar = 0; switch (glslangType.getBasicType()) { + case glslang::EbtInt8: + scalar = builder.makeInt8Constant(zero ? 0 : consts[nextConst].getI8Const(), specConstant); + break; + case glslang::EbtUint8: + scalar = builder.makeUint8Constant(zero ? 0 : consts[nextConst].getU8Const(), specConstant); + break; + case glslang::EbtInt16: + scalar = builder.makeInt16Constant(zero ? 0 : consts[nextConst].getI16Const(), specConstant); + break; + case glslang::EbtUint16: + scalar = builder.makeUint16Constant(zero ? 0 : consts[nextConst].getU16Const(), specConstant); + break; case glslang::EbtInt: scalar = builder.makeIntConstant(zero ? 0 : consts[nextConst].getIConst(), specConstant); break; @@ -5768,25 +6698,15 @@ case glslang::EbtUint64: scalar = builder.makeUint64Constant(zero ? 0 : consts[nextConst].getU64Const(), specConstant); break; -#ifdef AMD_EXTENSIONS - case glslang::EbtInt16: - scalar = builder.makeInt16Constant(zero ? 0 : (short)consts[nextConst].getIConst(), specConstant); - break; - case glslang::EbtUint16: - scalar = builder.makeUint16Constant(zero ? 0 : (unsigned short)consts[nextConst].getUConst(), specConstant); - break; -#endif case glslang::EbtFloat: scalar = builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst(), specConstant); break; case glslang::EbtDouble: scalar = builder.makeDoubleConstant(zero ? 0.0 : consts[nextConst].getDConst(), specConstant); break; -#ifdef AMD_EXTENSIONS case glslang::EbtFloat16: scalar = builder.makeFloat16Constant(zero ? 0.0F : (float)consts[nextConst].getDConst(), specConstant); break; -#endif case glslang::EbtBool: scalar = builder.makeBoolConstant(zero ? false : consts[nextConst].getBConst(), specConstant); break; @@ -5933,6 +6853,7 @@ return builder.createOp(spv::OpPhi, boolTypeId, phiOperands); } +#ifdef AMD_EXTENSIONS // Return type Id of the imported set of extended instructions corresponds to the name. // Import this set if it has not been imported yet. spv::Id TGlslangToSpvTraverser::getExtBuiltins(const char* name) @@ -5946,6 +6867,7 @@ return extBuiltins; } } +#endif }; // end anonymous namespace @@ -5959,6 +6881,20 @@ version = buf; } +// For low-order part of the generator's magic number. Bump up +// when there is a change in the style (e.g., if SSA form changes, +// or a different instruction sequence to do something gets used). +int GetSpirvGeneratorVersion() +{ + // return 1; // start + // return 2; // EOpAtomicCounterDecrement gets a post decrement, to map between GLSL -> SPIR-V + // return 3; // change/correct barrier-instruction operands, to match memory model group decisions + // return 4; // some deeper access chains: for dynamic vector component, and local Boolean component + // return 5; // make OpArrayLength result type be an int with signedness of 0 + return 6; // revert version 5 change, which makes a different (new) kind of incorrect code, + // versions 4 and 6 each generate OpArrayLength as it has long been done +} + // Write SPIR-V out to a binary file void OutputSpvBin(const std::vector& spirv, const char* baseName) { @@ -5980,7 +6916,9 @@ out.open(baseName, std::ios::binary | std::ios::out); if (out.fail()) printf("ERROR: Failed to open file: %s\n", baseName); - out << "\t// " GLSLANG_REVISION " " GLSLANG_DATE << std::endl; + out << "\t// " << + glslang::GetSpirvGeneratorVersion() << "." << GLSLANG_MINOR_VERSION << "." << GLSLANG_PATCH_LEVEL << + std::endl; if (varName != nullptr) { out << "\t #pragma once" << std::endl; out << "const uint32_t " << varName << "[] = {" << std::endl; @@ -6003,12 +6941,6 @@ out.close(); } -#ifdef ENABLE_OPT -void errHandler(const std::string& str) { - std::cerr << str << std::endl; -} -#endif - // // Set up the glslang traversal // @@ -6032,12 +6964,12 @@ glslang::GetThreadPoolAllocator().push(); - TGlslangToSpvTraverser it(&intermediate, logger, *options); + TGlslangToSpvTraverser it(intermediate.getSpv().spv, &intermediate, logger, *options); root->traverse(&it); it.finishSpv(); it.dumpSpv(spirv); -#ifdef ENABLE_OPT +#if ENABLE_OPT // If from HLSL, run spirv-opt to "legalize" the SPIR-V for Vulkan // eg. forward and remove memory writes of opaque types. if ((intermediate.getSource() == EShSourceHlsl || @@ -6054,30 +6986,35 @@ << std::endl; }); + optimizer.RegisterPass(CreateMergeReturnPass()); optimizer.RegisterPass(CreateInlineExhaustivePass()); + optimizer.RegisterPass(CreateEliminateDeadFunctionsPass()); + optimizer.RegisterPass(CreateScalarReplacementPass()); optimizer.RegisterPass(CreateLocalAccessChainConvertPass()); optimizer.RegisterPass(CreateLocalSingleBlockLoadStoreElimPass()); optimizer.RegisterPass(CreateLocalSingleStoreElimPass()); + optimizer.RegisterPass(CreateAggressiveDCEPass()); optimizer.RegisterPass(CreateInsertExtractElimPass()); + optimizer.RegisterPass(CreateDeadInsertElimPass()); optimizer.RegisterPass(CreateAggressiveDCEPass()); + optimizer.RegisterPass(CreateCCPPass()); + optimizer.RegisterPass(CreateSimplificationPass()); optimizer.RegisterPass(CreateDeadBranchElimPass()); optimizer.RegisterPass(CreateCFGCleanupPass()); optimizer.RegisterPass(CreateBlockMergePass()); optimizer.RegisterPass(CreateLocalMultiStoreElimPass()); + optimizer.RegisterPass(CreateAggressiveDCEPass()); optimizer.RegisterPass(CreateInsertExtractElimPass()); + optimizer.RegisterPass(CreateDeadInsertElimPass()); + if (options->optimizeSize) { + optimizer.RegisterPass(CreateRedundancyEliminationPass()); + // TODO(greg-lunarg): Add this when AMD driver issues are resolved + // optimizer.RegisterPass(CreateCommonUniformElimPass()); + } optimizer.RegisterPass(CreateAggressiveDCEPass()); - // TODO(greg-lunarg): Add this when AMD driver issues are resolved - // if (options->optimizeSize) - // optimizer.RegisterPass(CreateCommonUniformElimPass()); if (!optimizer.Run(spirv.data(), spirv.size(), &spirv)) return; - - // Remove dead module-level objects: functions, types, vars - // TODO(greg-lunarg): Switch to spirv-opt versions when available - spv::spirvbin_t Remapper(0); - Remapper.registerErrorHandler(errHandler); - Remapper.remap(spirv, spv::spirvbin_t::DCE_ALL); } #endif diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/GlslangToSpv.h vulkan-1.1.73+dfsg/external/glslang/SPIRV/GlslangToSpv.h --- vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/GlslangToSpv.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/SPIRV/GlslangToSpv.h 2018-04-27 11:46:26.000000000 +0000 @@ -34,7 +34,7 @@ #pragma once -#if _MSC_VER >= 1900 +#if defined(_MSC_VER) && _MSC_VER >= 1900 #pragma warning(disable : 4464) // relative include path contains '..' #endif @@ -56,6 +56,7 @@ }; void GetSpirvVersion(std::string&); +int GetSpirvGeneratorVersion(); void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, SpvOptions* options = nullptr); void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/GLSL.ext.AMD.h vulkan-1.1.73+dfsg/external/glslang/SPIRV/GLSL.ext.AMD.h --- vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/GLSL.ext.AMD.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/SPIRV/GLSL.ext.AMD.h 2018-04-27 11:46:26.000000000 +0000 @@ -27,13 +27,8 @@ #ifndef GLSLextAMD_H #define GLSLextAMD_H -enum BuiltIn; -enum Capability; -enum Decoration; -enum Op; - static const int GLSLextAMDVersion = 100; -static const int GLSLextAMDRevision = 6; +static const int GLSLextAMDRevision = 7; // SPV_AMD_shader_ballot static const char* const E_SPV_AMD_shader_ballot = "SPV_AMD_shader_ballot"; @@ -104,14 +99,10 @@ // SPV_AMD_shader_image_load_store_lod static const char* const E_SPV_AMD_shader_image_load_store_lod = "SPV_AMD_shader_image_load_store_lod"; -static const Capability CapabilityImageReadWriteLodAMD = static_cast(5015); - // SPV_AMD_shader_fragment_mask static const char* const E_SPV_AMD_shader_fragment_mask = "SPV_AMD_shader_fragment_mask"; -static const Capability CapabilityFragmentMaskAMD = static_cast(5010); - -static const Op OpFragmentMaskFetchAMD = static_cast(5011); -static const Op OpFragmentFetchAMD = static_cast(5012); +// SPV_AMD_gpu_shader_half_float_fetch +static const char* const E_SPV_AMD_gpu_shader_half_float_fetch = "SPV_AMD_gpu_shader_half_float_fetch"; #endif // #ifndef GLSLextAMD_H diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/GLSL.ext.EXT.h vulkan-1.1.73+dfsg/external/glslang/SPIRV/GLSL.ext.EXT.h --- vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/GLSL.ext.EXT.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/SPIRV/GLSL.ext.EXT.h 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,37 @@ +/* +** Copyright (c) 2014-2016 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +#ifndef GLSLextEXT_H +#define GLSLextEXT_H + +static const int GLSLextEXTVersion = 100; +static const int GLSLextEXTRevision = 1; + +static const char* const E_SPV_EXT_shader_stencil_export = "SPV_EXT_shader_stencil_export"; +static const char* const E_SPV_EXT_shader_viewport_index_layer = "SPV_EXT_shader_viewport_index_layer"; +static const char* const E_SPV_EXT_fragment_fully_covered = "SPV_EXT_fragment_fully_covered"; + +#endif // #ifndef GLSLextEXT_H diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/GLSL.ext.KHR.h vulkan-1.1.73+dfsg/external/glslang/SPIRV/GLSL.ext.KHR.h --- vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/GLSL.ext.KHR.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/SPIRV/GLSL.ext.KHR.h 2018-04-27 11:46:26.000000000 +0000 @@ -27,10 +27,6 @@ #ifndef GLSLextKHR_H #define GLSLextKHR_H -enum BuiltIn; -enum Op; -enum Capability; - static const int GLSLextKHRVersion = 100; static const int GLSLextKHRRevision = 2; @@ -42,7 +38,5 @@ static const char* const E_SPV_KHR_16bit_storage = "SPV_KHR_16bit_storage"; static const char* const E_SPV_KHR_storage_buffer_storage_class = "SPV_KHR_storage_buffer_storage_class"; static const char* const E_SPV_KHR_post_depth_coverage = "SPV_KHR_post_depth_coverage"; -static const char* const E_SPV_EXT_shader_stencil_export = "SPV_EXT_shader_stencil_export"; -static const char* const E_SPV_EXT_shader_viewport_index_layer = "SPV_EXT_shader_viewport_index_layer"; #endif // #ifndef GLSLextKHR_H diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/GLSL.ext.NV.h vulkan-1.1.73+dfsg/external/glslang/SPIRV/GLSL.ext.NV.h --- vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/GLSL.ext.NV.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/SPIRV/GLSL.ext.NV.h 2018-04-27 11:46:26.000000000 +0000 @@ -51,4 +51,7 @@ //SPV_NVX_multiview_per_view_attributes const char* const E_SPV_NVX_multiview_per_view_attributes = "SPV_NVX_multiview_per_view_attributes"; +//SPV_NV_shader_subgroup_partitioned +const char* const E_SPV_NV_shader_subgroup_partitioned = "SPV_NV_shader_subgroup_partitioned"; + #endif // #ifndef GLSLextNV_H \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/spirv.hpp vulkan-1.1.73+dfsg/external/glslang/SPIRV/spirv.hpp --- vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/spirv.hpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/SPIRV/spirv.hpp 2018-04-27 11:46:26.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2014-2017 The Khronos Group Inc. +// Copyright (c) 2014-2018 The Khronos Group Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and/or associated documentation files (the "Materials"), @@ -46,12 +46,12 @@ typedef unsigned int Id; -#define SPV_VERSION 0x10000 -#define SPV_REVISION 12 +#define SPV_VERSION 0x10300 +#define SPV_REVISION 1 static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010000; -static const unsigned int Revision = 12; +static const unsigned int Version = 0x00010300; +static const unsigned int Revision = 1; static const unsigned int OpCodeMask = 0xffff; static const unsigned int WordCountShift = 16; @@ -122,7 +122,15 @@ ExecutionModeOutputTriangleStrip = 29, ExecutionModeVecTypeHint = 30, ExecutionModeContractionOff = 31, + ExecutionModeInitializer = 33, + ExecutionModeFinalizer = 34, + ExecutionModeSubgroupSize = 35, + ExecutionModeSubgroupsPerWorkgroup = 36, + ExecutionModeSubgroupsPerWorkgroupId = 37, + ExecutionModeLocalSizeId = 38, + ExecutionModeLocalSizeHintId = 39, ExecutionModePostDepthCoverage = 4446, + ExecutionModeStencilRefReplacingEXT = 5027, ExecutionModeMax = 0x7fffffff, }; @@ -377,11 +385,17 @@ DecorationNoContraction = 42, DecorationInputAttachmentIndex = 43, DecorationAlignment = 44, + DecorationMaxByteOffset = 45, + DecorationAlignmentId = 46, + DecorationMaxByteOffsetId = 47, DecorationExplicitInterpAMD = 4999, DecorationOverrideCoverageNV = 5248, DecorationPassthroughNV = 5250, DecorationViewportRelativeNV = 5252, DecorationSecondaryViewportRelativeNV = 5256, + DecorationNonUniformEXT = 5300, + DecorationHlslCounterBufferGOOGLE = 5634, + DecorationHlslSemanticGOOGLE = 5635, DecorationMax = 0x7fffffff, }; @@ -427,10 +441,15 @@ BuiltInSubgroupLocalInvocationId = 41, BuiltInVertexIndex = 42, BuiltInInstanceIndex = 43, + BuiltInSubgroupEqMask = 4416, BuiltInSubgroupEqMaskKHR = 4416, + BuiltInSubgroupGeMask = 4417, BuiltInSubgroupGeMaskKHR = 4417, + BuiltInSubgroupGtMask = 4418, BuiltInSubgroupGtMaskKHR = 4418, + BuiltInSubgroupLeMask = 4419, BuiltInSubgroupLeMaskKHR = 4419, + BuiltInSubgroupLtMask = 4420, BuiltInSubgroupLtMaskKHR = 4420, BuiltInBaseVertex = 4424, BuiltInBaseInstance = 4425, @@ -450,6 +469,7 @@ BuiltInSecondaryViewportMaskNV = 5258, BuiltInPositionPerViewNV = 5261, BuiltInViewportMaskPerViewNV = 5262, + BuiltInFullyCoveredEXT = 5264, BuiltInMax = 0x7fffffff, }; @@ -468,6 +488,8 @@ enum LoopControlShift { LoopControlUnrollShift = 0, LoopControlDontUnrollShift = 1, + LoopControlDependencyInfiniteShift = 2, + LoopControlDependencyLengthShift = 3, LoopControlMax = 0x7fffffff, }; @@ -475,6 +497,8 @@ LoopControlMaskNone = 0, LoopControlUnrollMask = 0x00000001, LoopControlDontUnrollMask = 0x00000002, + LoopControlDependencyInfiniteMask = 0x00000004, + LoopControlDependencyLengthMask = 0x00000008, }; enum FunctionControlShift { @@ -548,6 +572,10 @@ GroupOperationReduce = 0, GroupOperationInclusiveScan = 1, GroupOperationExclusiveScan = 2, + GroupOperationClusteredReduce = 3, + GroupOperationPartitionedReduceNV = 6, + GroupOperationPartitionedInclusiveScanNV = 7, + GroupOperationPartitionedExclusiveScanNV = 8, GroupOperationMax = 0x7fffffff, }; @@ -625,6 +653,17 @@ CapabilityStorageImageReadWithoutFormat = 55, CapabilityStorageImageWriteWithoutFormat = 56, CapabilityMultiViewport = 57, + CapabilitySubgroupDispatch = 58, + CapabilityNamedBarrier = 59, + CapabilityPipeStorage = 60, + CapabilityGroupNonUniform = 61, + CapabilityGroupNonUniformVote = 62, + CapabilityGroupNonUniformArithmetic = 63, + CapabilityGroupNonUniformBallot = 64, + CapabilityGroupNonUniformShuffle = 65, + CapabilityGroupNonUniformShuffleRelative = 66, + CapabilityGroupNonUniformClustered = 67, + CapabilityGroupNonUniformQuad = 68, CapabilitySubgroupBallotKHR = 4423, CapabilityDrawParameters = 4427, CapabilitySubgroupVoteKHR = 4431, @@ -640,8 +679,11 @@ CapabilityVariablePointers = 4442, CapabilityAtomicStorageOps = 4445, CapabilitySampleMaskPostDepthCoverage = 4447, + CapabilityFloat16ImageAMD = 5008, CapabilityImageGatherBiasLodAMD = 5009, + CapabilityFragmentMaskAMD = 5010, CapabilityStencilExportEXT = 5013, + CapabilityImageReadWriteLodAMD = 5015, CapabilitySampleMaskOverrideCoverageNV = 5249, CapabilityGeometryShaderPassthroughNV = 5251, CapabilityShaderViewportIndexLayerEXT = 5254, @@ -649,6 +691,23 @@ CapabilityShaderViewportMaskNV = 5255, CapabilityShaderStereoViewNV = 5259, CapabilityPerViewAttributesNV = 5260, + CapabilityFragmentFullyCoveredEXT = 5265, + CapabilityGroupNonUniformPartitionedNV = 5297, + CapabilityShaderNonUniformEXT = 5301, + CapabilityRuntimeDescriptorArrayEXT = 5302, + CapabilityInputAttachmentArrayDynamicIndexingEXT = 5303, + CapabilityUniformTexelBufferArrayDynamicIndexingEXT = 5304, + CapabilityStorageTexelBufferArrayDynamicIndexingEXT = 5305, + CapabilityUniformBufferArrayNonUniformIndexingEXT = 5306, + CapabilitySampledImageArrayNonUniformIndexingEXT = 5307, + CapabilityStorageBufferArrayNonUniformIndexingEXT = 5308, + CapabilityStorageImageArrayNonUniformIndexingEXT = 5309, + CapabilityInputAttachmentArrayNonUniformIndexingEXT = 5310, + CapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311, + CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312, + CapabilitySubgroupShuffleINTEL = 5568, + CapabilitySubgroupBufferBlockIOINTEL = 5569, + CapabilitySubgroupImageBlockIOINTEL = 5570, CapabilityMax = 0x7fffffff, }; @@ -947,6 +1006,52 @@ OpAtomicFlagTestAndSet = 318, OpAtomicFlagClear = 319, OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpExecutionModeId = 331, + OpDecorateId = 332, + OpGroupNonUniformElect = 333, + OpGroupNonUniformAll = 334, + OpGroupNonUniformAny = 335, + OpGroupNonUniformAllEqual = 336, + OpGroupNonUniformBroadcast = 337, + OpGroupNonUniformBroadcastFirst = 338, + OpGroupNonUniformBallot = 339, + OpGroupNonUniformInverseBallot = 340, + OpGroupNonUniformBallotBitExtract = 341, + OpGroupNonUniformBallotBitCount = 342, + OpGroupNonUniformBallotFindLSB = 343, + OpGroupNonUniformBallotFindMSB = 344, + OpGroupNonUniformShuffle = 345, + OpGroupNonUniformShuffleXor = 346, + OpGroupNonUniformShuffleUp = 347, + OpGroupNonUniformShuffleDown = 348, + OpGroupNonUniformIAdd = 349, + OpGroupNonUniformFAdd = 350, + OpGroupNonUniformIMul = 351, + OpGroupNonUniformFMul = 352, + OpGroupNonUniformSMin = 353, + OpGroupNonUniformUMin = 354, + OpGroupNonUniformFMin = 355, + OpGroupNonUniformSMax = 356, + OpGroupNonUniformUMax = 357, + OpGroupNonUniformFMax = 358, + OpGroupNonUniformBitwiseAnd = 359, + OpGroupNonUniformBitwiseOr = 360, + OpGroupNonUniformBitwiseXor = 361, + OpGroupNonUniformLogicalAnd = 362, + OpGroupNonUniformLogicalOr = 363, + OpGroupNonUniformLogicalXor = 364, + OpGroupNonUniformQuadBroadcast = 365, + OpGroupNonUniformQuadSwap = 366, OpSubgroupBallotKHR = 4421, OpSubgroupFirstInvocationKHR = 4422, OpSubgroupAllKHR = 4428, @@ -961,6 +1066,19 @@ OpGroupFMaxNonUniformAMD = 5005, OpGroupUMaxNonUniformAMD = 5006, OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpGroupNonUniformPartitionNV = 5296, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateStringGOOGLE = 5633, OpMax = 0x7fffffff, }; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/SpvBuilder.cpp vulkan-1.1.73+dfsg/external/glslang/SPIRV/SpvBuilder.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/SpvBuilder.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/SPIRV/SpvBuilder.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -46,9 +46,7 @@ #include "SpvBuilder.h" -#ifdef AMD_EXTENSIONS - #include "hex_float.h" -#endif +#include "hex_float.h" #ifndef _WIN32 #include @@ -56,7 +54,8 @@ namespace spv { -Builder::Builder(unsigned int magicNumber, SpvBuildLogger* buildLogger) : +Builder::Builder(unsigned int spvVersion, unsigned int magicNumber, SpvBuildLogger* buildLogger) : + spvVersion(spvVersion), source(SourceLanguageUnknown), sourceVersion(0), sourceFileStringId(NoResult), @@ -193,6 +192,9 @@ // deal with capabilities switch (width) { + case 8: + addCapability(CapabilityInt8); + break; case 16: addCapability(CapabilityInt16); break; @@ -621,7 +623,7 @@ // See if a scalar constant of this type has already been created, so it // can be reused rather than duplicated. (Required by the specification). -Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value) const +Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value) { Instruction* constant; for (int i = 0; i < (int)groupedConstants[typeClass].size(); ++i) { @@ -636,7 +638,7 @@ } // Version of findScalarConstant (see above) for scalars that take two operands (e.g. a 'double' or 'int64'). -Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) const +Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) { Instruction* constant; for (int i = 0; i < (int)groupedConstants[typeClass].size(); ++i) { @@ -818,7 +820,6 @@ return c->getResultId(); } -#ifdef AMD_EXTENSIONS Id Builder::makeFloat16Constant(float f16, bool specConstant) { Op opcode = specConstant ? OpSpecConstant : OpConstant; @@ -846,9 +847,27 @@ return c->getResultId(); } -#endif -Id Builder::findCompositeConstant(Op typeClass, const std::vector& comps) const +Id Builder::makeFpConstant(Id type, double d, bool specConstant) +{ + assert(isFloatType(type)); + + switch (getScalarTypeWidth(type)) { + case 16: + return makeFloat16Constant((float)d, specConstant); + case 32: + return makeFloatConstant((float)d, specConstant); + case 64: + return makeDoubleConstant(d, specConstant); + default: + break; + } + + assert(false); + return NoResult; +} + +Id Builder::findCompositeConstant(Op typeClass, const std::vector& comps) { Instruction* constant = 0; bool found = false; @@ -876,6 +895,30 @@ return found ? constant->getResultId() : NoResult; } +Id Builder::findStructConstant(Id typeId, const std::vector& comps) +{ + Instruction* constant = 0; + bool found = false; + for (int i = 0; i < (int)groupedStructConstants[typeId].size(); ++i) { + constant = groupedStructConstants[typeId][i]; + + // same contents? + bool mismatch = false; + for (int op = 0; op < constant->getNumOperands(); ++op) { + if (constant->getIdOperand(op) != comps[op]) { + mismatch = true; + break; + } + } + if (! mismatch) { + found = true; + break; + } + } + + return found ? constant->getResultId() : NoResult; +} + // Comments in header Id Builder::makeCompositeConstant(Id typeId, const std::vector& members, bool specConstant) { @@ -886,25 +929,33 @@ switch (typeClass) { case OpTypeVector: case OpTypeArray: - case OpTypeStruct: case OpTypeMatrix: + if (! specConstant) { + Id existing = findCompositeConstant(typeClass, members); + if (existing) + return existing; + } + break; + case OpTypeStruct: + if (! specConstant) { + Id existing = findStructConstant(typeId, members); + if (existing) + return existing; + } break; default: assert(0); return makeFloatConstant(0.0); } - if (! specConstant) { - Id existing = findCompositeConstant(typeClass, members); - if (existing) - return existing; - } - Instruction* c = new Instruction(getUniqueId(), typeId, opcode); for (int op = 0; op < (int)members.size(); ++op) c->addIdOperand(members[op]); constantsTypesGlobals.push_back(std::unique_ptr(c)); - groupedConstants[typeClass].push_back(c); + if (typeClass == OpTypeStruct) + groupedStructConstants[typeId].push_back(c); + else + groupedConstants[typeClass].push_back(c); module.mapInstruction(c); return c->getResultId(); @@ -961,6 +1012,7 @@ { if (decoration == spv::DecorationMax) return; + Instruction* dec = new Instruction(OpDecorate); dec->addIdOperand(id); dec->addImmediateOperand(decoration); @@ -970,8 +1022,37 @@ decorations.push_back(std::unique_ptr(dec)); } +void Builder::addDecoration(Id id, Decoration decoration, const char* s) +{ + if (decoration == spv::DecorationMax) + return; + + Instruction* dec = new Instruction(OpDecorateStringGOOGLE); + dec->addIdOperand(id); + dec->addImmediateOperand(decoration); + dec->addStringOperand(s); + + decorations.push_back(std::unique_ptr(dec)); +} + +void Builder::addDecorationId(Id id, Decoration decoration, Id idDecoration) +{ + if (decoration == spv::DecorationMax) + return; + + Instruction* dec = new Instruction(OpDecorateId); + dec->addIdOperand(id); + dec->addImmediateOperand(decoration); + dec->addIdOperand(idDecoration); + + decorations.push_back(std::unique_ptr(dec)); +} + void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decoration, int num) { + if (decoration == spv::DecorationMax) + return; + Instruction* dec = new Instruction(OpMemberDecorate); dec->addIdOperand(id); dec->addImmediateOperand(member); @@ -982,6 +1063,20 @@ decorations.push_back(std::unique_ptr(dec)); } +void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decoration, const char *s) +{ + if (decoration == spv::DecorationMax) + return; + + Instruction* dec = new Instruction(OpMemberDecorateStringGOOGLE); + dec->addIdOperand(id); + dec->addImmediateOperand(member); + dec->addImmediateOperand(decoration); + dec->addStringOperand(s); + + decorations.push_back(std::unique_ptr(dec)); +} + // Comments in header Function* Builder::makeEntryPoint(const char* entryPoint) { @@ -1387,16 +1482,13 @@ return createCompositeInsert(source, target, typeId, channels.front()); Instruction* swizzle = new Instruction(getUniqueId(), typeId, OpVectorShuffle); + assert(isVector(target)); swizzle->addIdOperand(target); - if (accessChain.component != NoResult) - // For dynamic component selection, source does not involve in l-value swizzle - swizzle->addIdOperand(target); - else { - assert(getNumComponents(source) == (int)channels.size()); - assert(isVector(source)); - swizzle->addIdOperand(source); - } + + assert(getNumComponents(source) == (int)channels.size()); + assert(isVector(source)); + swizzle->addIdOperand(source); // Set up an identity shuffle from the base value to the result value unsigned int components[4]; @@ -1405,12 +1497,8 @@ components[i] = i; // Punch in the l-value swizzle - for (int i = 0; i < (int)channels.size(); ++i) { - if (accessChain.component != NoResult) - components[i] = channels[i]; // Only shuffle the base value - else - components[channels[i]] = numTargetComponents + i; - } + for (int i = 0; i < (int)channels.size(); ++i) + components[channels[i]] = numTargetComponents + i; // finish the instruction with these components selectors for (int i = 0; i < numTargetComponents; ++i) @@ -1725,7 +1813,11 @@ break; } case OpImageQueryLod: +#ifdef AMD_EXTENSIONS + resultType = makeVectorType(getScalarTypeId(getTypeId(parameters.coords)), 2); +#else resultType = makeVectorType(makeFloatType(32), 2); +#endif break; case OpImageQueryLevels: case OpImageQuerySamples: @@ -2202,7 +2294,7 @@ accessChain.preSwizzleBaseType = preSwizzleBaseType; // if needed, propagate the swizzle for the current access chain - if (accessChain.swizzle.size()) { + if (accessChain.swizzle.size() > 0) { std::vector oldSwizzle = accessChain.swizzle; accessChain.swizzle.resize(0); for (unsigned int i = 0; i < swizzle.size(); ++i) { @@ -2223,34 +2315,28 @@ transferAccessChainSwizzle(true); Id base = collapseAccessChain(); + Id source = rvalue; + + // dynamic component should be gone + assert(accessChain.component == NoResult); // If swizzle still exists, it is out-of-order or not full, we must load the target vector, // extract and insert elements to perform writeMask and/or swizzle. - Id source = NoResult; - if (accessChain.swizzle.size()) { + if (accessChain.swizzle.size() > 0) { Id tempBaseId = createLoad(base); - source = createLvalueSwizzle(getTypeId(tempBaseId), tempBaseId, rvalue, accessChain.swizzle); + source = createLvalueSwizzle(getTypeId(tempBaseId), tempBaseId, source, accessChain.swizzle); } - // dynamic component selection - if (accessChain.component != NoResult) { - Id tempBaseId = (source == NoResult) ? createLoad(base) : source; - source = createVectorInsertDynamic(tempBaseId, getTypeId(tempBaseId), rvalue, accessChain.component); - } - - if (source == NoResult) - source = rvalue; - createStore(source, base); } // Comments in header -Id Builder::accessChainLoad(Decoration precision, Id resultType) +Id Builder::accessChainLoad(Decoration precision, Decoration nonUniform, Id resultType) { Id id; if (accessChain.isRValue) { - // transfer access chain, but keep it static, so we can stay in registers + // transfer access chain, but try to stay in registers transferAccessChainSwizzle(false); if (accessChain.indexChain.size() > 0) { Id swizzleBase = accessChain.preSwizzleBaseType != NoType ? accessChain.preSwizzleBaseType : resultType; @@ -2291,6 +2377,7 @@ // load through the access chain id = createLoad(collapseAccessChain()); setPrecision(id, precision); + addDecoration(id, nonUniform); } // Done, unless there are swizzles to do @@ -2298,19 +2385,20 @@ return id; // Do remaining swizzling - // First, static swizzling - if (accessChain.swizzle.size()) { - // static swizzle + + // Do the basic swizzle + if (accessChain.swizzle.size() > 0) { Id swizzledType = getScalarTypeId(getTypeId(id)); if (accessChain.swizzle.size() > 1) swizzledType = makeVectorType(swizzledType, (int)accessChain.swizzle.size()); id = createRvalueSwizzle(precision, swizzledType, id, accessChain.swizzle); } - // dynamic single-component selection + // Do the dynamic component if (accessChain.component != NoResult) id = setPrecision(createVectorExtractDynamic(id, resultType, accessChain.component), precision); + addDecoration(id, nonUniform); return id; } @@ -2403,7 +2491,7 @@ { // Header, before first instructions: out.push_back(MagicNumber); - out.push_back(Version); + out.push_back(spvVersion); out.push_back(builderNumber); out.push_back(uniqueId + 1); out.push_back(0); @@ -2433,7 +2521,6 @@ // Debug instructions dumpInstructions(out, strings); - dumpModuleProcesses(out); dumpSourceInstructions(out); for (int e = 0; e < (int)sourceExtensions.size(); ++e) { Instruction sourceExtInst(0, 0, OpSourceExtension); @@ -2441,7 +2528,7 @@ sourceExtInst.dump(out); } dumpInstructions(out, names); - dumpInstructions(out, lines); + dumpModuleProcesses(out); // Annotation instructions dumpInstructions(out, decorations); @@ -2457,26 +2544,66 @@ // Protected methods. // -// Turn the described access chain in 'accessChain' into an instruction +// Turn the described access chain in 'accessChain' into an instruction(s) // computing its address. This *cannot* include complex swizzles, which must -// be handled after this is called, but it does include swizzles that select -// an individual element, as a single address of a scalar type can be -// computed by an OpAccessChain instruction. +// be handled after this is called. +// +// Can generate code. Id Builder::collapseAccessChain() { assert(accessChain.isRValue == false); - if (accessChain.indexChain.size() > 0) { - if (accessChain.instr == 0) { - StorageClass storageClass = (StorageClass)module.getStorageClass(getTypeId(accessChain.base)); - accessChain.instr = createAccessChain(storageClass, accessChain.base, accessChain.indexChain); - } - + // did we already emit an access chain for this? + if (accessChain.instr != NoResult) return accessChain.instr; - } else + + // If we have a dynamic component, we can still transfer + // that into a final operand to the access chain. We need to remap the + // dynamic component through the swizzle to get a new dynamic component to + // update. + // + // This was not done in transferAccessChainSwizzle() because it might + // generate code. + remapDynamicSwizzle(); + if (accessChain.component != NoResult) { + // transfer the dynamic component to the access chain + accessChain.indexChain.push_back(accessChain.component); + accessChain.component = NoResult; + } + + // note that non-trivial swizzling is left pending + + // do we have an access chain? + if (accessChain.indexChain.size() == 0) return accessChain.base; - // note that non-trivial swizzling is left pending... + // emit the access chain + StorageClass storageClass = (StorageClass)module.getStorageClass(getTypeId(accessChain.base)); + accessChain.instr = createAccessChain(storageClass, accessChain.base, accessChain.indexChain); + + return accessChain.instr; +} + +// For a dynamic component selection of a swizzle. +// +// Turn the swizzle and dynamic component into just a dynamic component. +// +// Generates code. +void Builder::remapDynamicSwizzle() +{ + // do we have a swizzle to remap a dynamic component through? + if (accessChain.component != NoResult && accessChain.swizzle.size() > 1) { + // build a vector of the swizzle for the component to map into + std::vector components; + for (int c = 0; c < (int)accessChain.swizzle.size(); ++c) + components.push_back(makeUintConstant(accessChain.swizzle[c])); + Id mapType = makeVectorType(makeUintType(32), (int)accessChain.swizzle.size()); + Id map = makeCompositeConstant(mapType, components); + + // use it + accessChain.component = createVectorExtractDynamic(map, makeUintType(32), accessChain.component); + accessChain.swizzle.clear(); + } } // clear out swizzle if it is redundant, that is reselecting the same components @@ -2502,38 +2629,30 @@ // To the extent any swizzling can become part of the chain // of accesses instead of a post operation, make it so. -// If 'dynamic' is true, include transferring a non-static component index, -// otherwise, only transfer static indexes. +// If 'dynamic' is true, include transferring the dynamic component, +// otherwise, leave it pending. // -// Also, Boolean vectors are likely to be special. While -// for external storage, they should only be integer types, -// function-local bool vectors could use sub-word indexing, -// so keep that as a separate Insert/Extract on a loaded vector. +// Does not generate code. just updates the access chain. void Builder::transferAccessChainSwizzle(bool dynamic) { - // too complex? - if (accessChain.swizzle.size() > 1) - return; - // non existent? if (accessChain.swizzle.size() == 0 && accessChain.component == NoResult) return; - // single component... - - // skip doing it for Boolean vectors - if (isBoolType(getContainedTypeId(accessChain.preSwizzleBaseType))) + // too complex? + // (this requires either a swizzle, or generating code for a dynamic component) + if (accessChain.swizzle.size() > 1) return; + // single component, either in the swizzle and/or dynamic component if (accessChain.swizzle.size() == 1) { - // handle static component + assert(accessChain.component == NoResult); + // handle static component selection accessChain.indexChain.push_back(makeUintConstant(accessChain.swizzle.front())); accessChain.swizzle.clear(); - // note, the only valid remaining dynamic access would be to this one - // component, so don't bother even looking at accessChain.component accessChain.preSwizzleBaseType = NoType; - accessChain.component = NoResult; } else if (dynamic && accessChain.component != NoResult) { + assert(accessChain.swizzle.size() == 0); // handle dynamic component accessChain.indexChain.push_back(accessChain.component); accessChain.preSwizzleBaseType = NoType; @@ -2572,12 +2691,15 @@ buildPoint->addInstruction(std::unique_ptr(merge)); } -void Builder::createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control) +void Builder::createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control, + unsigned int dependencyLength) { Instruction* merge = new Instruction(OpLoopMerge); merge->addIdOperand(mergeBlock->getId()); merge->addIdOperand(continueBlock->getId()); merge->addImmediateOperand(control); + if ((control & LoopControlDependencyLengthMask) != 0) + merge->addImmediateOperand(dependencyLength); buildPoint->addInstruction(std::unique_ptr(merge)); } @@ -2644,8 +2766,6 @@ void Builder::dumpModuleProcesses(std::vector& out) const { for (int i = 0; i < (int)moduleProcesses.size(); ++i) { - // TODO: switch this out for the 1.1 headers - const spv::Op OpModuleProcessed = (spv::Op)330; Instruction moduleProcessed(OpModuleProcessed); moduleProcessed.addStringOperand(moduleProcesses[i]); moduleProcessed.dump(out); diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/SpvBuilder.h vulkan-1.1.73+dfsg/external/glslang/SPIRV/SpvBuilder.h --- vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/SpvBuilder.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/SPIRV/SpvBuilder.h 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ // // Copyright (C) 2014-2015 LunarG, Inc. // Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -55,16 +56,19 @@ #include #include #include +#include namespace spv { class Builder { public: - Builder(unsigned int userNumber, SpvBuildLogger* logger); + Builder(unsigned int spvVersion, unsigned int userNumber, SpvBuildLogger* logger); virtual ~Builder(); static const int maxMatrixSize = 4; + unsigned int getSpvVersion() const { return spvVersion; } + void setSource(spv::SourceLanguage lang, int version) { source = lang; @@ -149,7 +153,7 @@ bool isAggregate(Id resultId) const { return isAggregateType(getTypeId(resultId)); } bool isSampledImage(Id resultId) const { return isSampledImageType(getTypeId(resultId)); } - bool isBoolType(Id typeId) const { return groupedTypes[OpTypeBool].size() > 0 && typeId == groupedTypes[OpTypeBool].back()->getResultId(); } + bool isBoolType(Id typeId) { return groupedTypes[OpTypeBool].size() > 0 && typeId == groupedTypes[OpTypeBool].back()->getResultId(); } bool isIntType(Id typeId) const { return getTypeClass(typeId) == OpTypeInt && module.getInstruction(typeId)->getImmediateOperand(1) != 0; } bool isUintType(Id typeId) const { return getTypeClass(typeId) == OpTypeInt && module.getInstruction(typeId)->getImmediateOperand(1) == 0; } bool isFloatType(Id typeId) const { return getTypeClass(typeId) == OpTypeFloat; } @@ -211,19 +215,18 @@ // For making new constants (will return old constant if the requested one was already made). Id makeBoolConstant(bool b, bool specConstant = false); + Id makeInt8Constant(int i, bool specConstant = false) { return makeIntConstant(makeIntType(8), (unsigned)i, specConstant); } + Id makeUint8Constant(unsigned u, bool specConstant = false) { return makeIntConstant(makeUintType(8), u, specConstant); } + Id makeInt16Constant(int i, bool specConstant = false) { return makeIntConstant(makeIntType(16), (unsigned)i, specConstant); } + Id makeUint16Constant(unsigned u, bool specConstant = false) { return makeIntConstant(makeUintType(16), u, specConstant); } Id makeIntConstant(int i, bool specConstant = false) { return makeIntConstant(makeIntType(32), (unsigned)i, specConstant); } Id makeUintConstant(unsigned u, bool specConstant = false) { return makeIntConstant(makeUintType(32), u, specConstant); } Id makeInt64Constant(long long i, bool specConstant = false) { return makeInt64Constant(makeIntType(64), (unsigned long long)i, specConstant); } Id makeUint64Constant(unsigned long long u, bool specConstant = false) { return makeInt64Constant(makeUintType(64), u, specConstant); } -#ifdef AMD_EXTENSIONS - Id makeInt16Constant(short i, bool specConstant = false) { return makeIntConstant(makeIntType(16), (unsigned)((unsigned short)i), specConstant); } - Id makeUint16Constant(unsigned short u, bool specConstant = false) { return makeIntConstant(makeUintType(16), (unsigned)u, specConstant); } -#endif Id makeFloatConstant(float f, bool specConstant = false); Id makeDoubleConstant(double d, bool specConstant = false); -#ifdef AMD_EXTENSIONS Id makeFloat16Constant(float f16, bool specConstant = false); -#endif + Id makeFpConstant(Id type, double d, bool specConstant = false); // Turn the array of constants into a proper spv constant of the requested type. Id makeCompositeConstant(Id type, const std::vector& comps, bool specConst = false); @@ -234,7 +237,10 @@ void addName(Id, const char* name); void addMemberName(Id, int member, const char* name); void addDecoration(Id, Decoration, int num = -1); + void addDecoration(Id, Decoration, const char*); + void addDecorationId(Id id, Decoration, Id idDecoration); void addMemberDecoration(Id, unsigned int member, Decoration, int num = -1); + void addMemberDecoration(Id, unsigned int member, Decoration, const char*); // At the end of what block do the next create*() instructions go? void setBuildPoint(Block* bp) { buildPoint = bp; } @@ -330,7 +336,7 @@ // Generally, the type of 'scalar' does not need to be the same type as the components in 'vector'. // The type of the created vector is a vector of components of the same type as the scalar. // - // Note: One of the arguments will change, with the result coming back that way rather than + // Note: One of the arguments will change, with the result coming back that way rather than // through the return value. void promoteScalar(Decoration precision, Id& left, Id& right); @@ -533,19 +539,22 @@ // push new swizzle onto the end of any existing swizzle, merging into a single swizzle void accessChainPushSwizzle(std::vector& swizzle, Id preSwizzleBaseType); - // push a variable component selection onto the access chain; supporting only one, so unsided + // push a dynamic component selection onto the access chain, only applicable with a + // non-trivial swizzle or no swizzle void accessChainPushComponent(Id component, Id preSwizzleBaseType) { - accessChain.component = component; - if (accessChain.preSwizzleBaseType == NoType) - accessChain.preSwizzleBaseType = preSwizzleBaseType; + if (accessChain.swizzle.size() != 1) { + accessChain.component = component; + if (accessChain.preSwizzleBaseType == NoType) + accessChain.preSwizzleBaseType = preSwizzleBaseType; + } } // use accessChain and swizzle to store value void accessChainStore(Id rvalue); // use accessChain and swizzle to load an r-value - Id accessChainLoad(Decoration precision, Id ResultType); + Id accessChainLoad(Decoration precision, Decoration nonUniform, Id ResultType); // get the direct pointer for an l-value Id accessChainGetLValue(); @@ -561,7 +570,7 @@ void createBranch(Block* block); void createConditionalBranch(Id condition, Block* thenBlock, Block* elseBlock); - void createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control); + void createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control, unsigned int dependencyLength); // Sets to generate opcode for specialization constants. void setToSpecConstCodeGenMode() { generatingOpCodeForSpecConst = true; } @@ -573,10 +582,12 @@ protected: Id makeIntConstant(Id typeId, unsigned value, bool specConstant); Id makeInt64Constant(Id typeId, unsigned long long value, bool specConstant); - Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value) const; - Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) const; - Id findCompositeConstant(Op typeClass, const std::vector& comps) const; + Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value); + Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2); + Id findCompositeConstant(Op typeClass, const std::vector& comps); + Id findStructConstant(Id typeId, const std::vector& comps); Id collapseAccessChain(); + void remapDynamicSwizzle(); void transferAccessChainSwizzle(bool dynamic); void simplifyAccessChainSwizzle(); void createAndSetNoPredecessorBlock(const char*); @@ -585,6 +596,7 @@ void dumpInstructions(std::vector&, const std::vector >&) const; void dumpModuleProcesses(std::vector&) const; + unsigned int spvVersion; // the version of SPIR-V to emit in the header SourceLanguage source; int sourceVersion; spv::Id sourceFileStringId; @@ -611,15 +623,15 @@ std::vector > entryPoints; std::vector > executionModes; std::vector > names; - std::vector > lines; std::vector > decorations; std::vector > constantsTypesGlobals; std::vector > externals; std::vector > functions; // not output, internally used for quick & dirty canonical (unique) creation - std::vector groupedConstants[OpConstant]; // all types appear before OpConstant - std::vector groupedTypes[OpConstant]; + std::unordered_map> groupedConstants; // map type opcodes to constant inst. + std::unordered_map> groupedStructConstants; // map struct-id to constant instructions + std::unordered_map> groupedTypes; // map type opcodes to type instructions // stack of switches std::stack switchMerges; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/spvIR.h vulkan-1.1.73+dfsg/external/glslang/SPIRV/spvIR.h --- vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/spvIR.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/SPIRV/spvIR.h 2018-04-27 11:46:26.000000000 +0000 @@ -74,11 +74,8 @@ POTENTIALLY_UNUSED const MemorySemanticsMask MemorySemanticsAllMemory = - (MemorySemanticsMask)(MemorySemanticsSequentiallyConsistentMask | - MemorySemanticsUniformMemoryMask | - MemorySemanticsSubgroupMemoryMask | + (MemorySemanticsMask)(MemorySemanticsUniformMemoryMask | MemorySemanticsWorkgroupMemoryMask | - MemorySemanticsCrossWorkgroupMemoryMask | MemorySemanticsAtomicCounterMemoryMask | MemorySemanticsImageMemoryMask); diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/SPVRemapper.cpp vulkan-1.1.73+dfsg/external/glslang/SPIRV/SPVRemapper.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/SPIRV/SPVRemapper.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/SPIRV/SPVRemapper.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -256,7 +256,7 @@ spv::Id spirvbin_t::localId(spv::Id id, spv::Id newId) { - assert(id != spv::NoResult && newId != spv::NoResult); + //assert(id != spv::NoResult && newId != spv::NoResult); if (id > bound()) { error(std::string("ID out of range: ") + std::to_string(id)); @@ -1392,7 +1392,7 @@ int strippedPos = 0; for (unsigned word = 0; word < unsigned(spv.size()); ++word) { - if (strip_it != stripRange.end() && word >= strip_it->second) + while (strip_it != stripRange.end() && word >= strip_it->second) ++strip_it; if (strip_it == stripRange.end() || word < strip_it->first || word >= strip_it->second) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/StandAlone/StandAlone.cpp vulkan-1.1.73+dfsg/external/glslang/StandAlone/StandAlone.cpp --- vulkan-1.0.65.2+dfsg1/external/glslang/StandAlone/StandAlone.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/StandAlone/StandAlone.cpp 2018-04-27 11:46:26.000000000 +0000 @@ -98,7 +98,10 @@ EOptionStdin = (1 << 27), EOptionOptimizeDisable = (1 << 28), EOptionOptimizeSize = (1 << 29), + EOptionInvertY = (1 << 30), + EOptionDumpBareVersion = (1 << 31), }; +bool targetHlslFunctionality1 = false; // // Return codes from main/exit(). @@ -127,6 +130,9 @@ bool CompileFailed = false; bool LinkFailed = false; +// array of unique places to leave the shader names and infologs for the asynchronous compiles +std::vector> WorkItems; + TBuiltInResource Resources; std::string ConfigFile; @@ -151,12 +157,16 @@ const char* sourceEntryPointName = nullptr; const char* shaderStageName = nullptr; const char* variableName = nullptr; +bool HlslEnable16BitTypes = false; std::vector IncludeDirectoryList; -int ClientInputSemanticsVersion = 100; // maps to, say, #define VULKAN 100 -int VulkanClientVersion = 100; // would map to, say, Vulkan 1.0 -int OpenGLClientVersion = 450; // doesn't influence anything yet, but maps to OpenGL 4.50 -unsigned int TargetVersion = 0x00001000; // maps to, say, SPIR-V 1.0 -std::vector Processes; // what should be recorded by OpModuleProcessed, or equivalent +int ClientInputSemanticsVersion = 100; // maps to, say, #define VULKAN 100 +glslang::EShTargetClientVersion VulkanClientVersion = + glslang::EShTargetVulkan_1_0; // would map to, say, Vulkan 1.0 +glslang::EShTargetClientVersion OpenGLClientVersion = + glslang::EShTargetOpenGL_450; // doesn't influence anything yet, but maps to OpenGL 4.50 +glslang::EShTargetLanguageVersion TargetVersion = + glslang::EShTargetSpv_1_0; // maps to, say, SPIR-V 1.0 +std::vector Processes; // what should be recorded by OpModuleProcessed, or equivalent // Per descriptor-set binding base data typedef std::map TPerSetBaseBinding; @@ -261,14 +271,14 @@ // void Error(const char* message) { - printf("%s: Error %s (use -h for usage)\n", ExecutableName, message); + fprintf(stderr, "%s: Error %s (use -h for usage)\n", ExecutableName, message); exit(EFailUsage); } // // Process an optional binding base of one the forms: // --argname [stage] base // base for stage (if given) or all stages (if not) -// --argname [stage] [set base]... // set/base pairs: set the base for given binding set. +// --argname [stage] [base set]... // set/base pairs: set the base for given binding set. // Where stage is one of the forms accepted by FindLanguage, and base is an integer // @@ -293,8 +303,8 @@ if ((argc - arg) > 2 && isdigit(argv[arg+0][0]) && isdigit(argv[arg+1][0])) { // Parse a per-set binding base while ((argc - arg) > 2 && isdigit(argv[arg+0][0]) && isdigit(argv[arg+1][0])) { - const int setNum = atoi(argv[arg++]); const int baseNum = atoi(argv[arg++]); + const int setNum = atoi(argv[arg++]); perSetBase[setNum] = baseNum; } } else { @@ -445,6 +455,11 @@ lowerword == "hlsl-iomapper" || lowerword == "hlsl-iomapping") { Options |= EOptionHlslIoMapping; + } else if (lowerword == "hlsl-enable-16bit-types") { + HlslEnable16BitTypes = true; + } else if (lowerword == "invert-y" || // synonyms + lowerword == "iy") { + Options |= EOptionInvertY; } else if (lowerword == "keep-uncalled" || // synonyms lowerword == "ku") { Options |= EOptionKeepUncalled; @@ -500,22 +515,28 @@ if (argc > 1) { if (strcmp(argv[1], "vulkan1.0") == 0) { setVulkanSpv(); - VulkanClientVersion = 100; + VulkanClientVersion = glslang::EShTargetVulkan_1_0; + } else if (strcmp(argv[1], "vulkan1.1") == 0) { + setVulkanSpv(); + TargetVersion = glslang::EShTargetSpv_1_3; + VulkanClientVersion = glslang::EShTargetVulkan_1_1; } else if (strcmp(argv[1], "opengl") == 0) { setOpenGlSpv(); - OpenGLClientVersion = 450; + OpenGLClientVersion = glslang::EShTargetOpenGL_450; } else - Error("--target-env expected vulkan1.0 or opengl"); + Error("--target-env expected vulkan1.0, vulkan1.1, or opengl"); } bumpArg(); } else if (lowerword == "variable-name" || // synonyms - lowerword == "vn") { + lowerword == "vn") { Options |= EOptionOutputHexadecimal; if (argc <= 1) Error("no provided for --variable-name"); variableName = argv[1]; bumpArg(); break; + } else if (lowerword == "version") { + Options |= EOptionDumpVersions; } else { usage(); } @@ -553,7 +574,7 @@ if (argv[0][2] == 'd') Options |= EOptionOptimizeDisable; else if (argv[0][2] == 's') -#ifdef ENABLE_OPT +#if ENABLE_OPT Options |= EOptionOptimizeSize; #else Error("-Os not available; optimizer not linked"); @@ -573,13 +594,17 @@ case 'V': setVulkanSpv(); if (argv[0][2] != 0) - ClientInputSemanticsVersion = getAttachedNumber("-G client input semantics"); + ClientInputSemanticsVersion = getAttachedNumber("-V client input semantics"); break; case 'c': Options |= EOptionDumpConfig; break; case 'd': - Options |= EOptionDefaultDesktop; + if (strncmp(&argv[0][1], "dumpversion", strlen(&argv[0][1]) + 1) == 0 || + strncmp(&argv[0][1], "dumpfullversion", strlen(&argv[0][1]) + 1) == 0) + Options |= EOptionDumpBareVersion; + else + Options |= EOptionDefaultDesktop; break; case 'e': // HLSL todo: entry point handle needs much more sophistication. @@ -589,6 +614,12 @@ Error("no provided for -e"); bumpArg(); break; + case 'f': + if (strcmp(&argv[0][2], "hlsl_functionality1") == 0) + targetHlslFunctionality1 = true; + else + Error("-f: expected hlsl_functionality1"); + break; case 'g': Options |= EOptionDebug; break; @@ -687,6 +718,10 @@ messages = (EShMessages)(messages | EShMsgHlslOffsets); if (Options & EOptionDebug) messages = (EShMessages)(messages | EShMsgDebugInfo); + if (HlslEnable16BitTypes) + messages = (EShMessages)(messages | EShMsgHlslEnable16BitTypes); + if ((Options & EOptionOptimizeDisable) || !ENABLE_OPT) + messages = (EShMessages)(messages | EShMsgHlslLegalization); } // @@ -694,6 +729,9 @@ // void CompileShaders(glslang::TWorklist& worklist) { + if (Options & EOptionDebug) + Error("cannot generate debug information unless linking to generate code"); + glslang::TWorkItem* workItem; if (Options & EOptionStdin) { worklist.remove(workItem); @@ -821,7 +859,7 @@ // TODO: use a range based for loop here, when available in all environments. for (auto i = baseBindingForSet[res][compUnit.stage].begin(); i != baseBindingForSet[res][compUnit.stage].end(); ++i) - shader->setShiftBindingForSet(res, i->first, i->second); + shader->setShiftBindingForSet(res, i->second, i->first); } shader->setFlattenUniformArrays((Options & EOptionFlattenUniformArrays) != 0); @@ -837,6 +875,9 @@ if (Options & EOptionAutoMapLocations) shader->setAutoMapLocations(true); + if (Options & EOptionInvertY) + shader->setInvertY(true); + // Set up the environment, some subsettings take precedence over earlier // ways of setting things. if (Options & EOptionSpv) { @@ -845,14 +886,15 @@ : glslang::EShSourceGlsl, compUnit.stage, glslang::EShClientVulkan, ClientInputSemanticsVersion); shader->setEnvClient(glslang::EShClientVulkan, VulkanClientVersion); - shader->setEnvTarget(glslang::EshTargetSpv, TargetVersion); } else { shader->setEnvInput((Options & EOptionReadHlsl) ? glslang::EShSourceHlsl : glslang::EShSourceGlsl, compUnit.stage, glslang::EShClientOpenGL, ClientInputSemanticsVersion); shader->setEnvClient(glslang::EShClientOpenGL, OpenGLClientVersion); - shader->setEnvTarget(glslang::EshTargetSpv, TargetVersion); } + shader->setEnvTarget(glslang::EShTargetSpv, TargetVersion); + if (targetHlslFunctionality1) + shader->setEnvTargetHlslFunctionality1(); } shaders.push_back(shader); @@ -1022,14 +1064,10 @@ FreeFileData(const_cast(it->text[0])); } -int C_DECL main(int argc, char* argv[]) +int singleMain() { - // array of unique places to leave the shader names and infologs for the asynchronous compiles - std::vector> workItems; - ProcessArguments(workItems, argc, argv); - glslang::TWorklist workList; - std::for_each(workItems.begin(), workItems.end(), [&workList](std::unique_ptr& item) { + std::for_each(WorkItems.begin(), WorkItems.end(), [&workList](std::unique_ptr& item) { assert(item); workList.add(item.get()); }); @@ -1040,8 +1078,14 @@ return ESuccess; } - if (Options & EOptionDumpVersions) { - printf("Glslang Version: %s %s\n", GLSLANG_REVISION, GLSLANG_DATE); + if (Options & EOptionDumpBareVersion) { + printf("%d.%d.%d\n", + glslang::GetSpirvGeneratorVersion(), GLSLANG_MINOR_VERSION, GLSLANG_PATCH_LEVEL); + if (workList.empty()) + return ESuccess; + } else if (Options & EOptionDumpVersions) { + printf("Glslang Version: %d.%d.%d\n", + glslang::GetSpirvGeneratorVersion(), GLSLANG_MINOR_VERSION, GLSLANG_PATCH_LEVEL); printf("ESSL Version: %s\n", glslang::GetEsslVersionString()); printf("GLSL Version: %s\n", glslang::GetGlslVersionString()); std::string spirvVersion; @@ -1049,6 +1093,7 @@ printf("SPIR-V Version %s\n", spirvVersion.c_str()); printf("GLSL.std.450 Version %d, Revision %d\n", GLSLstd450Version, GLSLstd450Revision); printf("Khronos Tool ID %d\n", glslang::GetKhronosToolId()); + printf("SPIR-V Generator Version %d\n", glslang::GetSpirvGeneratorVersion()); printf("GL_KHR_vulkan_glsl version %d\n", 100); printf("ARB_GL_gl_spirv version %d\n", 100); if (workList.empty()) @@ -1060,8 +1105,8 @@ } if (Options & EOptionStdin) { - workItems.push_back(std::unique_ptr{new glslang::TWorkItem("stdin")}); - workList.add(workItems.back().get()); + WorkItems.push_back(std::unique_ptr{new glslang::TWorkItem("stdin")}); + workList.add(WorkItems.back().get()); } ProcessConfigFile(); @@ -1074,22 +1119,25 @@ if (Options & EOptionLinkProgram || Options & EOptionOutputPreprocessed) { glslang::InitializeProcess(); + glslang::InitializeProcess(); // also test reference counting of users + glslang::InitializeProcess(); // also test reference counting of users + glslang::FinalizeProcess(); // also test reference counting of users + glslang::FinalizeProcess(); // also test reference counting of users CompileAndLinkShaderFiles(workList); glslang::FinalizeProcess(); } else { ShInitialize(); + ShInitialize(); // also test reference counting of users + ShFinalize(); // also test reference counting of users bool printShaderNames = workList.size() > 1; - if (Options & EOptionMultiThreaded) - { + if (Options & EOptionMultiThreaded) { std::array threads; - for (unsigned int t = 0; t < threads.size(); ++t) - { + for (unsigned int t = 0; t < threads.size(); ++t) { threads[t] = std::thread(CompileShaders, std::ref(workList)); - if (threads[t].get_id() == std::thread::id()) - { - printf("Failed to create thread\n"); + if (threads[t].get_id() == std::thread::id()) { + fprintf(stderr, "Failed to create thread\n"); return EFailThreadCreate; } } @@ -1099,11 +1147,11 @@ CompileShaders(workList); // Print out all the resulting infologs - for (size_t w = 0; w < workItems.size(); ++w) { - if (workItems[w]) { - if (printShaderNames || workItems[w]->results.size() > 0) - PutsIfNonEmpty(workItems[w]->name.c_str()); - PutsIfNonEmpty(workItems[w]->results.c_str()); + for (size_t w = 0; w < WorkItems.size(); ++w) { + if (WorkItems[w]) { + if (printShaderNames || WorkItems[w]->results.size() > 0) + PutsIfNonEmpty(WorkItems[w]->name.c_str()); + PutsIfNonEmpty(WorkItems[w]->results.c_str()); } } @@ -1118,6 +1166,25 @@ return 0; } +int C_DECL main(int argc, char* argv[]) +{ + ProcessArguments(WorkItems, argc, argv); + + int ret = 0; + + // Loop over the entire init/finalize cycle to watch memory changes + const int iterations = 1; + if (iterations > 1) + glslang::OS_DumpMemoryCounters(); + for (int i = 0; i < iterations; ++i) { + ret = singleMain(); + if (iterations > 1) + glslang::OS_DumpMemoryCounters(); + } + + return ret; +} + // // Deduce the language from the filename. Files must end in one of the // following extensions: @@ -1264,6 +1331,9 @@ " -d default to desktop (#version 110) when there is no shader #version\n" " (default is ES version 100)\n" " -e specify as the entry-point name\n" + " -f{hlsl_functionality1}\n" + " 'hlsl_functionality1' enables use of the\n" + " SPV_GOOGLE_hlsl_functionality1 extension\n" " -g generate debug information\n" " -h print this usage message\n" " -i intermediate tree (glslang AST) is printed out\n" @@ -1272,7 +1342,7 @@ " -o save binary to , requires a binary option (e.g., -V)\n" " -q dump reflection query database\n" " -r synonym for --relaxed-errors\n" - " -s silent mode\n" + " -s silence syntax and semantic error reporting\n" " -t multi-threaded mode\n" " -v print version strings\n" " -w synonym for --suppress-warnings\n" @@ -1284,12 +1354,16 @@ " 'location' (fragile, not cross stage)\n" " --aml synonym for --auto-map-locations\n" " --client {vulkan|opengl} see -V and -G\n" + " -dumpfullversion print bare major.minor.patchlevel\n" + " -dumpversion same as -dumpfullversion\n" " --flatten-uniform-arrays flatten uniform texture/sampler arrays to\n" " scalars\n" " --fua synonym for --flatten-uniform-arrays\n" " --hlsl-offsets Allow block offsets to follow HLSL rules\n" " Works independently of source language\n" " --hlsl-iomap Perform IO mapping in HLSL register space\n" + " --hlsl-enable-16bit-types Allow use of 16-bit types in SPIR-V for HLSL\n" + " --invert-y | --iy invert position.Y output in vertex shader\n" " --keep-uncalled don't eliminate uncalled functions\n" " --ku synonym for --keep-uncalled\n" " --no-storage-format use Unknown image format\n" @@ -1301,24 +1375,24 @@ " Set descriptor set for all resources\n" " --rsb [stage] type set binding synonym for --resource-set-binding\n" " --shift-image-binding [stage] num base binding number for images (uav)\n" - " --shift-image-binding [stage] [set num]... per-descriptor-set shift values\n" + " --shift-image-binding [stage] [num set]... per-descriptor-set shift values\n" " --sib [stage] num synonym for --shift-image-binding\n" " --shift-sampler-binding [stage] num base binding number for samplers\n" - " --shift-sampler-binding [stage] [set num]... per-descriptor-set shift values\n" + " --shift-sampler-binding [stage] [num set]... per-descriptor-set shift values\n" " --ssb [stage] num synonym for --shift-sampler-binding\n" " --shift-ssbo-binding [stage] num base binding number for SSBOs\n" - " --shift-ssbo-binding [stage] [set num]... per-descriptor-set shift values\n" + " --shift-ssbo-binding [stage] [num set]... per-descriptor-set shift values\n" " --sbb [stage] num synonym for --shift-ssbo-binding\n" " --shift-texture-binding [stage] num base binding number for textures\n" - " --shift-texture-binding [stage] [set num]... per-descriptor-set shift values\n" + " --shift-texture-binding [stage] [num set]... per-descriptor-set shift values\n" " --stb [stage] num synonym for --shift-texture-binding\n" " --shift-uav-binding [stage] num base binding number for UAVs\n" - " --shift-uav-binding [stage] [set num]... per-descriptor-set shift values\n" + " --shift-uav-binding [stage] [num set]... per-descriptor-set shift values\n" " --suavb [stage] num synonym for --shift-uav-binding\n" " --shift-UBO-binding [stage] num base binding number for UBOs\n" - " --shift-UBO-binding [stage] [set num]... per-descriptor-set shift values\n" + " --shift-UBO-binding [stage] [num set]... per-descriptor-set shift values\n" " --shift-cbuffer-binding [stage] num synonym for --shift-UBO-binding\n" - " --shift-cbuffer-binding [stage] [set num]... per-descriptor-set shift values\n" + " --shift-cbuffer-binding [stage] [num set]... per-descriptor-set shift values\n" " --sub [stage] num synonym for --shift-UBO-binding\n" " --source-entrypoint the given shader source function is\n" " renamed to be the given in -e\n" @@ -1328,14 +1402,16 @@ " using -S.\n" " --suppress-warnings suppress GLSL warnings\n" " (except as required by #extension : warn)\n" - " --target-env {vulkan1.0|opengl} set the execution environment code will\n" - " execute in (as opposed to language\n" + " --target-env {vulkan1.0 | vulkan1.1 | opengl} \n" + " set execution environment that emitted code\n" + " will execute in (as opposed to the language\n" " semantics selected by --client) defaults:\n" - " 'vulkan1.0' under '--client vulkan'\n" - " 'opengl' under '--client opengl'\n" + " 'vulkan1.0' under '--client vulkan'\n" + " 'opengl' under '--client opengl'\n" " --variable-name Creates a C header file that contains a\n" " uint32_t array named \n" " initialized with the shader binary code.\n" + " --version synonym for -v\n" " --vn synonym for --variable-name \n" ); diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/310AofA.vert vulkan-1.1.73+dfsg/external/glslang/Test/310AofA.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/310AofA.vert 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/310AofA.vert 2018-04-27 11:46:26.000000000 +0000 @@ -113,3 +113,9 @@ uniform ubaa { int a; } ubaaname[2][3]; // ERROR + +vec3 func(in mat3[2] x[3]) +{ + mat3 a0 = x[2][1]; + return a0[2]; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/310implicitSizeArrayError.vert vulkan-1.1.73+dfsg/external/glslang/Test/310implicitSizeArrayError.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/310implicitSizeArrayError.vert 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/310implicitSizeArrayError.vert 2018-04-27 11:46:26.000000000 +0000 @@ -1,5 +1,5 @@ #version 310 es -layout (location=0) uniform Block { +layout (binding=0) uniform Block { highp int a[]; } uni; layout (location=0) out highp int o; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/310runtimeArray.vert vulkan-1.1.73+dfsg/external/glslang/Test/310runtimeArray.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/310runtimeArray.vert 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/310runtimeArray.vert 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,18 @@ +#version 310 es + +precision highp float; +layout(location=0) out float o; + +struct S { float f; }; +buffer b1 { S s[]; }; +buffer b2 { S s[]; } b2name; +buffer b3 { S s[]; } b3name[]; +buffer b4 { S s[]; } b4name[4]; + +void main() +{ + o = s[5].f; + o += b2name.s[6].f; + o += b3name[3].s[7].f; + o += b4name[2].s[8].f; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/440.vert vulkan-1.1.73+dfsg/external/glslang/Test/440.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/440.vert 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/440.vert 2018-04-27 11:46:26.000000000 +0000 @@ -174,6 +174,12 @@ float f; } bbinst10; +layout(xfb_buffer = 3) out; +layout(xfb_offset = 32) out gl_PerVertex { + layout(xfb_buffer = 2) float gl_PointSize; // ERROR, change in xfb_buffer + vec4 gl_Position; +}; + int drawParamsBad() { return gl_BaseVertexARB + gl_BaseInstanceARB + gl_DrawIDARB; // ERROR, extension not requested diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/450.vert vulkan-1.1.73+dfsg/external/glslang/Test/450.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/450.vert 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/450.vert 2018-04-27 11:46:26.000000000 +0000 @@ -46,3 +46,11 @@ allInvocationsEqual(b1); // ERROR, need 4.6 } ; // ERROR: no extraneous semicolons + +layout(location = 0) uniform locBlock { // ERROR, no location uniform block + int a; +}; + +layout(location = 0) buffer locBuffBlock { // ERROR, no location on buffer block + int b; +}; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/460.frag vulkan-1.1.73+dfsg/external/glslang/Test/460.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/460.frag 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/460.frag 2018-04-27 11:46:26.000000000 +0000 @@ -15,3 +15,18 @@ b1 = allInvocations(b1); b1 = allInvocationsEqual(b1); } + +void attExtBad() +{ + // ERRORs, not enabled + [[dependency_length(1+3)]] for (int i = 0; i < 8; ++i) { } + [[flatten]] if (true) { } else { } +} + +#extension GL_EXT_control_flow_attributes : enable + +void attExt() +{ + [[dependency_length(-3)]] do { } while(true); // ERROR, not positive + [[dependency_length(0)]] do { } while(true); // ERROR, not positive +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/array.frag vulkan-1.1.73+dfsg/external/glslang/Test/array.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/array.frag 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/array.frag 2018-04-27 11:46:26.000000000 +0000 @@ -104,3 +104,9 @@ int[] i = int[](); // ERROR, need constructor arguments float emptyA[]; float b = vec4(emptyA); // ERROR, array can't be a constructor argument +uniform sampler2D s2d[]; + +void foo4() +{ + s2d[a]; // ERROR, can't variably index unsized array +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseLegalResults/hlsl.aliasOpaque.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseLegalResults/hlsl.aliasOpaque.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseLegalResults/hlsl.aliasOpaque.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseLegalResults/hlsl.aliasOpaque.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,50 +1,46 @@ hlsl.aliasOpaque.frag -WARNING: AST will form illegal SPIR-V; need to transform to legalize // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 81 +// Generated by (magic number): 80006 +// Id's are bound by 87 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 57 + EntryPoint Fragment 4 "main" 62 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" - Name 37 "gss2" - Name 39 "gss" - Name 43 "gtex" - Name 57 "@entryPointOutput" - Decorate 37(gss2) DescriptorSet 0 - Decorate 39(gss) DescriptorSet 0 - Decorate 43(gtex) DescriptorSet 0 - Decorate 57(@entryPointOutput) Location 0 + Name 47 "gss" + Name 51 "gtex" + Name 62 "@entryPointOutput" + Decorate 47(gss) DescriptorSet 0 + Decorate 51(gtex) DescriptorSet 0 + Decorate 62(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeSampler - 8: TypeFloat 32 - 10: TypeImage 8(float) 2D sampled format:Unknown - 12: TypeVector 8(float) 4 - 25: TypeSampledImage 10 - 27: TypeVector 8(float) 2 - 28: 8(float) Constant 1045220557 - 29: 8(float) Constant 1050253722 - 30: 27(fvec2) ConstantComposite 28 29 - 36: TypePointer UniformConstant 6 - 37(gss2): 36(ptr) Variable UniformConstant - 39(gss): 36(ptr) Variable UniformConstant - 42: TypePointer UniformConstant 10 - 43(gtex): 42(ptr) Variable UniformConstant - 46: 8(float) Constant 1077936128 - 56: TypePointer Output 12(fvec4) -57(@entryPointOutput): 56(ptr) Variable Output + 7: TypeFloat 32 + 8: TypeImage 7(float) 2D sampled format:Unknown + 11: TypeVector 7(float) 4 + 32: TypeSampledImage 8 + 34: TypeVector 7(float) 2 + 35: 7(float) Constant 1045220557 + 36: 7(float) Constant 1050253722 + 37: 34(fvec2) ConstantComposite 35 36 + 43: TypePointer UniformConstant 6 + 47(gss): 43(ptr) Variable UniformConstant + 50: TypePointer UniformConstant 8 + 51(gtex): 50(ptr) Variable UniformConstant + 54: 7(float) Constant 1077936128 + 61: TypePointer Output 11(fvec4) +62(@entryPointOutput): 61(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 68: 6 Load 39(gss) - 69: 10 Load 43(gtex) - 78: 25 SampledImage 69 68 - 79: 12(fvec4) ImageSampleImplicitLod 78 30 - 80: 12(fvec4) VectorTimesScalar 79 46 - Store 57(@entryPointOutput) 80 + 70: 6 Load 47(gss) + 72: 8 Load 51(gtex) + 84: 32 SampledImage 72 70 + 85: 11(fvec4) ImageSampleImplicitLod 84 37 + 86: 11(fvec4) VectorTimesScalar 85 54 + Store 62(@entryPointOutput) 86 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseLegalResults/hlsl.flattenOpaque.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseLegalResults/hlsl.flattenOpaque.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseLegalResults/hlsl.flattenOpaque.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseLegalResults/hlsl.flattenOpaque.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,65 +1,65 @@ hlsl.flattenOpaque.frag // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 144 +// Generated by (magic number): 80006 +// Id's are bound by 185 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 97 + EntryPoint Fragment 4 "main" 120 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" Name 38 "tex" - Name 70 "s.s2D" - Name 79 "s2.s2D" - Name 80 "s2.tex" - Name 97 "@entryPointOutput" + Name 82 "s.s2D" + Name 97 "s2.s2D" + Name 100 "s2.tex" + Name 120 "@entryPointOutput" Decorate 38(tex) DescriptorSet 0 - Decorate 70(s.s2D) DescriptorSet 0 - Decorate 79(s2.s2D) DescriptorSet 0 - Decorate 80(s2.tex) DescriptorSet 0 - Decorate 97(@entryPointOutput) Location 0 + Decorate 82(s.s2D) DescriptorSet 0 + Decorate 97(s2.s2D) DescriptorSet 0 + Decorate 100(s2.tex) DescriptorSet 0 + Decorate 120(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeSampler - 8: TypeFloat 32 - 9: TypeVector 8(float) 4 - 14: TypeVector 8(float) 2 - 21: TypeImage 8(float) 2D sampled format:Unknown - 37: TypePointer UniformConstant 21 + 9: TypeFloat 32 + 10: TypeVector 9(float) 4 + 15: TypeVector 9(float) 2 + 22: TypeImage 9(float) 2D sampled format:Unknown + 37: TypePointer UniformConstant 22 38(tex): 37(ptr) Variable UniformConstant - 41: TypeSampledImage 21 - 43: 8(float) Constant 1045220557 - 44: 8(float) Constant 1050253722 - 45: 14(fvec2) ConstantComposite 43 44 - 69: TypePointer UniformConstant 6 - 70(s.s2D): 69(ptr) Variable UniformConstant - 79(s2.s2D): 69(ptr) Variable UniformConstant - 80(s2.tex): 37(ptr) Variable UniformConstant - 96: TypePointer Output 9(fvec4) -97(@entryPointOutput): 96(ptr) Variable Output + 45: TypeSampledImage 22 + 47: 9(float) Constant 1045220557 + 48: 9(float) Constant 1050253722 + 49: 15(fvec2) ConstantComposite 47 48 + 81: TypePointer UniformConstant 6 + 82(s.s2D): 81(ptr) Variable UniformConstant + 97(s2.s2D): 81(ptr) Variable UniformConstant + 100(s2.tex): 37(ptr) Variable UniformConstant + 119: TypePointer Output 10(fvec4) +120(@entryPointOutput): 119(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 109: 6 Load 70(s.s2D) - 123: 21 Load 38(tex) - 125: 41 SampledImage 123 109 - 126: 9(fvec4) ImageSampleImplicitLod 125 45 - 111: 6 Load 70(s.s2D) - 128: 21 Load 38(tex) - 130: 41 SampledImage 128 111 - 132: 9(fvec4) ImageSampleImplicitLod 130 45 - 113: 9(fvec4) FAdd 126 132 - 114: 6 Load 79(s2.s2D) - 115: 21 Load 80(s2.tex) - 136: 41 SampledImage 115 114 - 137: 9(fvec4) ImageSampleImplicitLod 136 45 - 117: 9(fvec4) FAdd 113 137 - 118: 6 Load 79(s2.s2D) - 119: 21 Load 80(s2.tex) - 141: 41 SampledImage 119 118 - 143: 9(fvec4) ImageSampleImplicitLod 141 45 - 121: 9(fvec4) FAdd 117 143 - Store 97(@entryPointOutput) 121 + 134: 6 Load 82(s.s2D) + 158: 22 Load 38(tex) + 161: 45 SampledImage 158 134 + 162: 10(fvec4) ImageSampleImplicitLod 161 49 + 138: 6 Load 82(s.s2D) + 164: 22 Load 38(tex) + 167: 45 SampledImage 164 138 + 169: 10(fvec4) ImageSampleImplicitLod 167 49 + 142: 10(fvec4) FAdd 162 169 + 143: 6 Load 97(s2.s2D) + 145: 22 Load 100(s2.tex) + 175: 45 SampledImage 145 143 + 176: 10(fvec4) ImageSampleImplicitLod 175 49 + 149: 10(fvec4) FAdd 142 176 + 150: 6 Load 97(s2.s2D) + 152: 22 Load 100(s2.tex) + 182: 45 SampledImage 152 150 + 184: 10(fvec4) ImageSampleImplicitLod 182 49 + 156: 10(fvec4) FAdd 149 184 + Store 120(@entryPointOutput) 156 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,49 +1,43 @@ hlsl.flattenOpaqueInitMix.vert -WARNING: AST will form illegal SPIR-V; need to transform to legalize // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 100 +// Generated by (magic number): 80006 +// Id's are bound by 97 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 68 + EntryPoint Vertex 4 "main" 57 Source HLSL 500 Name 4 "main" - Name 34 "FxaaTex" - MemberName 34(FxaaTex) 0 "smpl" - MemberName 34(FxaaTex) 1 "tex" - MemberName 34(FxaaTex) 2 "f" - Name 38 "g_tInputTexture_sampler" - Name 41 "g_tInputTexture" - Name 68 "@entryPointOutput" - Decorate 38(g_tInputTexture_sampler) DescriptorSet 0 - Decorate 41(g_tInputTexture) DescriptorSet 0 - Decorate 68(@entryPointOutput) Location 0 + Name 44 "g_tInputTexture_sampler" + Name 47 "g_tInputTexture" + Name 57 "@entryPointOutput" + Decorate 44(g_tInputTexture_sampler) DescriptorSet 0 + Decorate 47(g_tInputTexture) DescriptorSet 0 + Decorate 57(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeSampler - 8: TypeFloat 32 - 9: TypeImage 8(float) 2D sampled format:Unknown - 12: TypeVector 8(float) 4 - 24: TypeSampledImage 9 - 28: TypeVector 8(float) 2 - 30: 8(float) Constant 0 - 34(FxaaTex): TypeStruct 6 9 8(float) - 37: TypePointer UniformConstant 6 -38(g_tInputTexture_sampler): 37(ptr) Variable UniformConstant - 40: TypePointer UniformConstant 9 -41(g_tInputTexture): 40(ptr) Variable UniformConstant - 43: 8(float) Constant 1056964608 - 67: TypePointer Output 12(fvec4) -68(@entryPointOutput): 67(ptr) Variable Output + 7: TypeFloat 32 + 8: TypeImage 7(float) 2D sampled format:Unknown + 11: TypeVector 7(float) 4 + 28: TypeSampledImage 8 + 36: TypeVector 7(float) 2 + 38: 7(float) Constant 0 + 43: TypePointer UniformConstant 6 +44(g_tInputTexture_sampler): 43(ptr) Variable UniformConstant + 46: TypePointer UniformConstant 8 +47(g_tInputTexture): 46(ptr) Variable UniformConstant + 49: 7(float) Constant 1056964608 + 56: TypePointer Output 11(fvec4) +57(@entryPointOutput): 56(ptr) Variable Output + 96: 36(fvec2) ConstantComposite 49 49 4(main): 2 Function None 3 5: Label - 79: 6 Load 38(g_tInputTexture_sampler) - 80: 9 Load 41(g_tInputTexture) - 95: 24 SampledImage 80 79 - 98: 28(fvec2) CompositeConstruct 43 43 - 99: 12(fvec4) ImageSampleExplicitLod 95 98 Lod 30 - Store 68(@entryPointOutput) 99 + 63: 6 Load 44(g_tInputTexture_sampler) + 64: 8 Load 47(g_tInputTexture) + 73: 28 SampledImage 64 63 + 79: 11(fvec4) ImageSampleExplicitLod 73 96 Lod 38 + Store 57(@entryPointOutput) 79 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,49 +1,52 @@ hlsl.flattenOpaqueInit.vert -WARNING: AST will form illegal SPIR-V; need to transform to legalize // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 125 +// Generated by (magic number): 80006 +// Id's are bound by 134 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 82 + EntryPoint Vertex 4 "main" 80 Source HLSL 500 Name 4 "main" - Name 17 "FxaaTex" - MemberName 17(FxaaTex) 0 "smpl" - MemberName 17(FxaaTex) 1 "tex" - Name 38 "g_tInputTexture_sampler" - Name 42 "g_tInputTexture" - Name 82 "@entryPointOutput" - Decorate 38(g_tInputTexture_sampler) DescriptorSet 0 - Decorate 42(g_tInputTexture) DescriptorSet 0 - Decorate 82(@entryPointOutput) Location 0 + Name 43 "g_tInputTexture_sampler" + Name 47 "g_tInputTexture" + Name 80 "@entryPointOutput" + Decorate 43(g_tInputTexture_sampler) DescriptorSet 0 + Decorate 47(g_tInputTexture) DescriptorSet 0 + Decorate 80(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeSampler - 8: TypeFloat 32 - 9: TypeImage 8(float) 2D sampled format:Unknown - 11: TypeVector 8(float) 4 - 17(FxaaTex): TypeStruct 6 9 - 26: TypeSampledImage 9 - 28: TypeVector 8(float) 2 - 29: 8(float) Constant 1050253722 - 30: 8(float) Constant 1053609165 - 31: 28(fvec2) ConstantComposite 29 30 - 32: 8(float) Constant 0 - 37: TypePointer UniformConstant 6 -38(g_tInputTexture_sampler): 37(ptr) Variable UniformConstant - 41: TypePointer UniformConstant 9 -42(g_tInputTexture): 41(ptr) Variable UniformConstant - 81: TypePointer Output 11(fvec4) -82(@entryPointOutput): 81(ptr) Variable Output + 7: TypeFloat 32 + 8: TypeImage 7(float) 2D sampled format:Unknown + 11: TypeVector 7(float) 4 + 31: TypeSampledImage 8 + 33: TypeVector 7(float) 2 + 34: 7(float) Constant 1050253722 + 35: 7(float) Constant 1053609165 + 36: 33(fvec2) ConstantComposite 34 35 + 37: 7(float) Constant 0 + 42: TypePointer UniformConstant 6 +43(g_tInputTexture_sampler): 42(ptr) Variable UniformConstant + 46: TypePointer UniformConstant 8 +47(g_tInputTexture): 46(ptr) Variable UniformConstant + 79: TypePointer Output 11(fvec4) +80(@entryPointOutput): 79(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 96: 6 Load 38(g_tInputTexture_sampler) - 97: 9 Load 42(g_tInputTexture) - 123: 26 SampledImage 97 96 - 124: 11(fvec4) ImageSampleExplicitLod 123 31 Lod 32 - Store 82(@entryPointOutput) 124 + 90: 6 Load 43(g_tInputTexture_sampler) + 91: 8 Load 47(g_tInputTexture) + 111: 31 SampledImage 91 90 + 112: 11(fvec4) ImageSampleExplicitLod 111 36 Lod 37 + 115: 6 Load 43(g_tInputTexture_sampler) + 117: 8 Load 47(g_tInputTexture) + 125: 31 SampledImage 117 115 + 126: 11(fvec4) ImageSampleExplicitLod 125 36 Lod 37 + 99: 11(fvec4) FAdd 112 126 + 132: 31 SampledImage 91 90 + 133: 11(fvec4) ImageSampleExplicitLod 132 36 Lod 37 + 104: 11(fvec4) FAdd 99 133 + Store 80(@entryPointOutput) 104 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseLegalResults/hlsl.flattenSubset2.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseLegalResults/hlsl.flattenSubset2.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseLegalResults/hlsl.flattenSubset2.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseLegalResults/hlsl.flattenSubset2.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,31 @@ +hlsl.flattenSubset2.frag +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 53 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 49 52 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 49 "vpos" + Name 52 "@entryPointOutput" + Decorate 49(vpos) Location 0 + Decorate 52(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 43: 6(float) Constant 0 + 44: 7(fvec4) ConstantComposite 43 43 43 43 + 48: TypePointer Input 7(fvec4) + 49(vpos): 48(ptr) Variable Input + 51: TypePointer Output 7(fvec4) +52(@entryPointOutput): 51(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + Store 52(@entryPointOutput) 44 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseLegalResults/hlsl.flattenSubset.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseLegalResults/hlsl.flattenSubset.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseLegalResults/hlsl.flattenSubset.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseLegalResults/hlsl.flattenSubset.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,48 +1,47 @@ hlsl.flattenSubset.frag -WARNING: AST will form illegal SPIR-V; need to transform to legalize // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 85 +// Generated by (magic number): 80006 +// Id's are bound by 66 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 54 57 + EntryPoint Fragment 4 "main" 47 50 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" - Name 17 "samp" - Name 41 "tex" - Name 54 "vpos" - Name 57 "@entryPointOutput" - Decorate 17(samp) DescriptorSet 0 - Decorate 41(tex) DescriptorSet 0 - Decorate 54(vpos) Location 0 - Decorate 57(@entryPointOutput) Location 0 + Name 21 "samp" + Name 33 "tex" + Name 47 "vpos" + Name 50 "@entryPointOutput" + Decorate 21(samp) DescriptorSet 0 + Decorate 33(tex) DescriptorSet 0 + Decorate 47(vpos) Location 0 + Decorate 50(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 7: TypeVector 6(float) 4 13: TypeSampler - 16: TypePointer UniformConstant 13 - 17(samp): 16(ptr) Variable UniformConstant - 39: TypeImage 6(float) 2D sampled format:Unknown - 40: TypePointer UniformConstant 39 - 41(tex): 40(ptr) Variable UniformConstant - 44: TypeSampledImage 39 - 46: TypeVector 6(float) 2 - 47: 6(float) Constant 1056964608 - 48: 46(fvec2) ConstantComposite 47 47 - 53: TypePointer Input 7(fvec4) - 54(vpos): 53(ptr) Variable Input - 56: TypePointer Output 7(fvec4) -57(@entryPointOutput): 56(ptr) Variable Output + 20: TypePointer UniformConstant 13 + 21(samp): 20(ptr) Variable UniformConstant + 31: TypeImage 6(float) 2D sampled format:Unknown + 32: TypePointer UniformConstant 31 + 33(tex): 32(ptr) Variable UniformConstant + 37: TypeSampledImage 31 + 39: TypeVector 6(float) 2 + 40: 6(float) Constant 1056964608 + 41: 39(fvec2) ConstantComposite 40 40 + 46: TypePointer Input 7(fvec4) + 47(vpos): 46(ptr) Variable Input + 49: TypePointer Output 7(fvec4) +50(@entryPointOutput): 49(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 74: 13 Load 17(samp) - 81: 39 Load 41(tex) - 83: 44 SampledImage 81 74 - 84: 7(fvec4) ImageSampleImplicitLod 83 48 - Store 57(@entryPointOutput) 84 + 57: 13 Load 21(samp) + 61: 31 Load 33(tex) + 64: 37 SampledImage 61 57 + 65: 7(fvec4) ImageSampleImplicitLod 64 41 + Store 50(@entryPointOutput) 65 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,81 @@ +hlsl.partialFlattenLocal.vert +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 169 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 83 86 + Source HLSL 500 + Name 4 "main" + Name 83 "pos" + Name 86 "@entryPointOutput" + Decorate 83(pos) Location 0 + Decorate 86(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 14: TypeVector 6(float) 3 + 15: TypeInt 32 0 + 16: 15(int) Constant 3 + 17: TypeArray 14(fvec3) 16 + 18: TypeVector 6(float) 2 + 19: 15(int) Constant 2 + 20: TypeArray 18(fvec2) 19 + 21: TypeInt 32 1 + 25: 21(int) Constant 0 + 31: 21(int) Constant 1 + 32: 6(float) Constant 0 + 33: 14(fvec3) ConstantComposite 32 32 32 + 34: TypePointer Function 14(fvec3) + 37: 6(float) Constant 1065353216 + 38: 18(fvec2) ConstantComposite 32 37 + 39: TypePointer Function 18(fvec2) + 54: TypeBool + 82: TypePointer Input 7(fvec4) + 83(pos): 82(ptr) Variable Input + 85: TypePointer Output 7(fvec4) +86(@entryPointOutput): 85(ptr) Variable Output + 130: TypePointer Function 17 + 132: TypePointer Function 20 + 4(main): 2 Function None 3 + 5: Label + 133: 132(ptr) Variable Function + 131: 130(ptr) Variable Function + 84: 7(fvec4) Load 83(pos) + 136: 34(ptr) AccessChain 131 25 + Store 136 33 + 137: 39(ptr) AccessChain 133 25 + Store 137 38 + Branch 100 + 100: Label + 168: 21(int) Phi 25 5 119 106 + 105: 54(bool) SLessThan 168 31 + LoopMerge 101 106 None + BranchConditional 105 106 101 + 106: Label + 138: 39(ptr) AccessChain 133 168 + 110: 18(fvec2) Load 138 + 139: 34(ptr) AccessChain 131 168 + 112: 14(fvec3) Load 139 + 113: 18(fvec2) VectorShuffle 112 112 0 1 + 114: 18(fvec2) FAdd 113 110 + 140: 34(ptr) AccessChain 131 168 + 116: 14(fvec3) Load 140 + 117: 14(fvec3) VectorShuffle 116 114 3 4 2 + Store 140 117 + 119: 21(int) IAdd 168 31 + Branch 100 + 101: Label + 142: 17 Load 131 + 161: 14(fvec3) CompositeExtract 142 0 + 124: 6(float) CompositeExtract 161 0 + 125: 6(float) CompositeExtract 161 1 + 126: 6(float) CompositeExtract 161 2 + 127: 7(fvec4) CompositeConstruct 124 125 126 32 + 128: 7(fvec4) FAdd 84 127 + Store 86(@entryPointOutput) 128 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,29 @@ +hlsl.partialFlattenMixed.vert +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 36 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 32 35 + Source HLSL 500 + Name 4 "main" + Name 32 "pos" + Name 35 "@entryPointOutput" + Decorate 32(pos) Location 0 + Decorate 35(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 31: TypePointer Input 7(fvec4) + 32(pos): 31(ptr) Variable Input + 34: TypePointer Output 7(fvec4) +35(@entryPointOutput): 34(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 33: 7(fvec4) Load 32(pos) + Store 35(@entryPointOutput) 33 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/100.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/100.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/100.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/100.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -395,7 +395,7 @@ 0:? 'v' ( smooth in 3-element array of mediump 4-component vector of float) 0:? 'f' ( invariant global mediump float) 0:? 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump int x}) -0:? 'fa' ( global implicitly-sized array of mediump float) +0:? 'fa' ( global unsized 1-element array of mediump float) 0:? 'f13' ( invariant global mediump float) 0:? 'fi' ( invariant temp mediump float) 0:? 'av' ( invariant smooth in mediump 4-component vector of float) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/120.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/120.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/120.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/120.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -19,7 +19,7 @@ ERROR: 0:83: 'xyxyx' : vector swizzle too long ERROR: 0:84: 'z' : vector swizzle selection out of range ERROR: 0:85: 'assign' : l-value required -ERROR: 0:91: 'int' : overloaded functions must have the same return type +ERROR: 0:91: 'main' : overloaded functions must have the same return type ERROR: 0:91: 'main' : function already has a body ERROR: 0:91: 'int' : entry point cannot return a value ERROR: 0:92: 'main' : function cannot take any parameter(s) @@ -52,8 +52,13 @@ ERROR: 0:212: 'sampler2DRect' : Reserved word. ERROR: 0:244: ':' : wrong operand types: no operation ':' exists that takes a left-hand operand of type ' global void' and a right operand of type ' const int' (or there is no acceptable conversion) ERROR: 0:245: ':' : wrong operand types: no operation ':' exists that takes a left-hand operand of type ' const int' and a right operand of type ' global void' (or there is no acceptable conversion) +ERROR: 0:248: 'explicit types' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:248: 'half floating-point suffix' : not supported with this profile: none ERROR: 0:248: '' : syntax error, unexpected IDENTIFIER, expecting COMMA or SEMICOLON -ERROR: 54 compilation errors. No code generated. +ERROR: 56 compilation errors. No code generated. Shader version: 120 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/120.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/120.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/120.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/120.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -19,6 +19,7 @@ ERROR: 0:35: 'arrays of arrays' : not supported with this profile: none ERROR: 0:36: 'arrays of arrays' : not supported with this profile: none ERROR: 0:37: 'arrays of arrays' : not supported with this profile: none +ERROR: 0:37: 'arrays of arrays' : not supported with this profile: none ERROR: 0:38: 'arrays of arrays' : not supported with this profile: none ERROR: 0:39: 'arrays of arrays' : not supported with this profile: none ERROR: 0:40: 'arrays of arrays' : not supported with this profile: none @@ -34,7 +35,7 @@ ERROR: 0:52: 'arrays of arrays' : not supported with this profile: none ERROR: 0:53: 'arrays of arrays' : not supported with this profile: none ERROR: 0:56: 'out' : overloaded functions must have the same parameter storage qualifiers for argument 1 -ERROR: 0:57: 'float' : overloaded functions must have the same return type +ERROR: 0:57: 'overloadA' : overloaded functions must have the same return type ERROR: 0:87: 'overloadC' : no matching overloaded function found ERROR: 0:90: 'overloadC' : no matching overloaded function found ERROR: 0:95: 'overloadD' : ambiguous function signature match: multiple signatures match under implicit type conversion @@ -78,7 +79,7 @@ ERROR: 0:195: 'gl_ModelViewMatrix' : identifiers starting with "gl_" are reserved ERROR: 0:200: 'token pasting (##)' : not supported for this version or the enabled extensions ERROR: 0:203: 'token pasting (##)' : not supported for this version or the enabled extensions -ERROR: 79 compilation errors. No code generated. +ERROR: 80 compilation errors. No code generated. Shader version: 120 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/130.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/130.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/130.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/130.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -49,7 +49,7 @@ 0:18 move second child to first child ( temp float) 0:18 'clip' ( temp float) 0:18 direct index ( smooth temp float ClipDistance) -0:18 'gl_ClipDistance' ( smooth in implicitly-sized array of float ClipDistance) +0:18 'gl_ClipDistance' ( smooth in unsized 4-element array of float ClipDistance) 0:18 Constant: 0:18 3 (const int) 0:23 Function Definition: foo( ( global void) @@ -381,7 +381,7 @@ 0:? 'fflat' ( flat in float) 0:? 'fsmooth' ( smooth in float) 0:? 'fnop' ( noperspective in float) -0:? 'gl_ClipDistance' ( smooth in implicitly-sized array of float ClipDistance) +0:? 'gl_ClipDistance' ( smooth in unsized 4-element array of float ClipDistance) 0:? 'sampC' ( uniform samplerCube) 0:? 'gl_Color' ( in 4-component vector of float Color) 0:? 'samp2D' ( uniform sampler2D) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/130.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/130.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/130.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/130.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -113,7 +113,7 @@ 0:45 'gl_VertexID' ( gl_VertexId int VertexId) 0:46 move second child to first child ( temp float) 0:46 direct index ( smooth temp float ClipDistance) -0:46 'gl_ClipDistance' ( smooth out implicitly-sized array of float ClipDistance) +0:46 'gl_ClipDistance' ( smooth out unsized 2-element array of float ClipDistance) 0:46 Constant: 0:46 1 (const int) 0:46 Constant: @@ -132,7 +132,7 @@ 0:66 'gl_DepthRange' ( uniform structure{ global float near, global float far, global float diff}) 0:66 Constant: 0:66 1 (const int) -0:67 'gl_TexCoord' ( smooth out implicitly-sized array of 4-component vector of float TexCoord) +0:67 'gl_TexCoord' ( smooth out unsized 1-element array of 4-component vector of float TexCoord) 0:68 'gl_FogFragCoord' ( smooth out float FogFragCoord) 0:69 'gl_FrontColor' ( smooth out 4-component vector of float FrontColor) 0:? Linker Objects @@ -145,8 +145,8 @@ 0:? 'c3D' ( in 3-component vector of float) 0:? 'c4D' ( smooth temp 4-component vector of float) 0:? 'v4' ( uniform 4-component vector of float) -0:? 'gl_ClipDistance' ( smooth out implicitly-sized array of float ClipDistance) -0:? 'gl_TexCoord' ( smooth out implicitly-sized array of 4-component vector of float TexCoord) +0:? 'gl_ClipDistance' ( smooth out unsized 2-element array of float ClipDistance) +0:? 'gl_TexCoord' ( smooth out unsized 1-element array of 4-component vector of float TexCoord) 0:? 'abcdef' ( global int) 0:? 'qrstuv' ( global int) 0:? 'gl_VertexID' ( gl_VertexId int VertexId) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/140.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/140.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/140.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/140.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -52,7 +52,7 @@ 0:17 'gl_DepthRange' ( uniform structure{ global float near, global float far, global float diff}) 0:17 Constant: 0:17 1 (const int) -0:18 'gl_TexCoord' ( smooth out implicitly-sized array of 4-component vector of float TexCoord) +0:18 'gl_TexCoord' ( smooth out unsized 1-element array of 4-component vector of float TexCoord) 0:19 'gl_FogFragCoord' ( smooth out float FogFragCoord) 0:20 'gl_FrontColor' ( smooth out 4-component vector of float FrontColor) 0:48 Function Definition: foo( ( global void) @@ -133,7 +133,7 @@ 0:? Linker Objects 0:? 'sbuf' ( uniform isamplerBuffer) 0:? 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform int anonMem}) -0:? 'gl_TexCoord' ( smooth out implicitly-sized array of 4-component vector of float TexCoord) +0:? 'gl_TexCoord' ( smooth out unsized 1-element array of 4-component vector of float TexCoord) 0:? 'gl_Position' ( smooth out 4-component vector of float) 0:? 'locBad' (layout( location=9) in 4-component vector of float) 0:? 'loc' (layout( location=9) in 4-component vector of float) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/150.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/150.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/150.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/150.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -67,16 +67,16 @@ 0:32 0 (const int) 0:33 move second child to first child ( temp float) 0:33 direct index (layout( stream=0) temp float ClipDistance) -0:33 gl_ClipDistance: direct index for structure (layout( stream=0) out implicitly-sized array of float ClipDistance) -0:33 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:33 gl_ClipDistance: direct index for structure (layout( stream=0) out unsized 4-element array of float ClipDistance) +0:33 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out unsized 4-element array of float ClipDistance gl_ClipDistance}) 0:33 Constant: 0:33 2 (const uint) 0:33 Constant: 0:33 3 (const int) 0:33 direct index ( temp float ClipDistance) -0:33 gl_ClipDistance: direct index for structure ( in implicitly-sized array of float ClipDistance) -0:33 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:33 'gl_in' ( in 4-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:33 gl_ClipDistance: direct index for structure ( in unsized 3-element array of float ClipDistance) +0:33 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_in' ( in 4-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:33 Constant: 0:33 1 (const int) 0:33 Constant: @@ -85,24 +85,24 @@ 0:33 2 (const int) 0:34 move second child to first child ( temp 4-component vector of float) 0:34 gl_Position: direct index for structure (layout( stream=0) gl_Position 4-component vector of float Position) -0:34 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:34 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out unsized 4-element array of float ClipDistance gl_ClipDistance}) 0:34 Constant: 0:34 0 (const uint) 0:34 gl_Position: direct index for structure ( in 4-component vector of float Position) -0:34 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:34 'gl_in' ( in 4-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:34 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:34 'gl_in' ( in 4-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:34 Constant: 0:34 0 (const int) 0:34 Constant: 0:34 0 (const int) 0:35 move second child to first child ( temp float) 0:35 gl_PointSize: direct index for structure (layout( stream=0) gl_PointSize float PointSize) -0:35 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:35 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out unsized 4-element array of float ClipDistance gl_ClipDistance}) 0:35 Constant: 0:35 1 (const uint) 0:35 gl_PointSize: direct index for structure ( in float PointSize) -0:35 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:35 'gl_in' ( in 4-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:35 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:35 'gl_in' ( in 4-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:35 Constant: 0:35 3 (const int) 0:35 Constant: @@ -151,8 +151,8 @@ 0:? 'fromV' ( in 4-element array of block{ in 3-component vector of float color}) 0:? 'toF' (layout( stream=0) out block{layout( stream=0) out 3-component vector of float color}) 0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) out 3-component vector of float color}) -0:? 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:? 'gl_in' ( in 4-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:? 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out unsized 4-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_in' ( in 4-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:? 'ov0' (layout( stream=0) out 4-component vector of float) 0:? 'ov4' (layout( stream=4) out 4-component vector of float) 0:? 'o1v0' (layout( stream=0) out 4-component vector of float) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/150.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/150.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/150.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/150.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -16,8 +16,8 @@ 0:20 move second child to first child ( temp 4-component vector of float) 0:20 'p' ( temp 4-component vector of float) 0:20 gl_Position: direct index for structure ( in 4-component vector of float Position) -0:20 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:20 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:20 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:20 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:20 Constant: 0:20 1 (const int) 0:20 Constant: @@ -26,8 +26,8 @@ 0:21 move second child to first child ( temp float) 0:21 'ps' ( temp float) 0:21 gl_PointSize: direct index for structure ( in float PointSize) -0:21 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:21 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:21 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:21 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:21 Constant: 0:21 1 (const int) 0:21 Constant: @@ -36,9 +36,9 @@ 0:22 move second child to first child ( temp float) 0:22 'cd' ( temp float) 0:22 direct index ( temp float ClipDistance) -0:22 gl_ClipDistance: direct index for structure ( in implicitly-sized array of float ClipDistance) -0:22 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:22 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:22 gl_ClipDistance: direct index for structure ( in unsized 3-element array of float ClipDistance) +0:22 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:22 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:22 Constant: 0:22 1 (const int) 0:22 Constant: @@ -59,25 +59,25 @@ 0:26 'gl_InvocationID' ( in int InvocationID) 0:28 move second child to first child ( temp 4-component vector of float) 0:28 gl_Position: direct index for structure ( out 4-component vector of float Position) -0:28 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:28 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:28 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:28 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) 0:28 'gl_InvocationID' ( in int InvocationID) 0:28 Constant: 0:28 0 (const int) 0:28 'p' ( temp 4-component vector of float) 0:29 move second child to first child ( temp float) 0:29 gl_PointSize: direct index for structure ( out float PointSize) -0:29 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:29 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:29 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:29 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) 0:29 'gl_InvocationID' ( in int InvocationID) 0:29 Constant: 0:29 1 (const int) 0:29 'ps' ( temp float) 0:30 move second child to first child ( temp float) 0:30 direct index ( temp float ClipDistance) -0:30 gl_ClipDistance: direct index for structure ( out implicitly-sized array of float ClipDistance) -0:30 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:30 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:30 gl_ClipDistance: direct index for structure ( out unsized 2-element array of float ClipDistance) +0:30 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:30 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) 0:30 'gl_InvocationID' ( in int InvocationID) 0:30 Constant: 0:30 2 (const int) @@ -99,7 +99,7 @@ 0:33 Constant: 0:33 1.300000 0:? Linker Objects -0:? 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:? 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) 0:? 'outa' ( global 4-element array of int) 0:? 'patchOut' ( patch out 4-component vector of float) @@ -129,8 +129,8 @@ 0:22 move second child to first child ( temp 4-component vector of float) 0:22 'p' ( temp 4-component vector of float) 0:22 gl_Position: direct index for structure ( in 4-component vector of float Position) -0:22 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:22 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:22 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:22 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:22 Constant: 0:22 1 (const int) 0:22 Constant: @@ -139,8 +139,8 @@ 0:23 move second child to first child ( temp float) 0:23 'ps' ( temp float) 0:23 gl_PointSize: direct index for structure ( in float PointSize) -0:23 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:23 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:23 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:23 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:23 Constant: 0:23 1 (const int) 0:23 Constant: @@ -149,9 +149,9 @@ 0:24 move second child to first child ( temp float) 0:24 'cd' ( temp float) 0:24 direct index ( temp float ClipDistance) -0:24 gl_ClipDistance: direct index for structure ( in implicitly-sized array of float ClipDistance) -0:24 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:24 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:24 gl_ClipDistance: direct index for structure ( in unsized 3-element array of float ClipDistance) +0:24 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:24 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:24 Constant: 0:24 1 (const int) 0:24 Constant: @@ -186,20 +186,20 @@ 0:30 1 (const int) 0:32 move second child to first child ( temp 4-component vector of float) 0:32 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) -0:32 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:32 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:32 Constant: 0:32 0 (const uint) 0:32 'p' ( temp 4-component vector of float) 0:33 move second child to first child ( temp float) 0:33 gl_PointSize: direct index for structure ( gl_PointSize float PointSize) -0:33 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:33 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:33 Constant: 0:33 1 (const uint) 0:33 'ps' ( temp float) 0:34 move second child to first child ( temp float) 0:34 direct index ( temp float ClipDistance) -0:34 gl_ClipDistance: direct index for structure ( out implicitly-sized array of float ClipDistance) -0:34 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:34 gl_ClipDistance: direct index for structure ( out unsized 3-element array of float ClipDistance) +0:34 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:34 Constant: 0:34 2 (const uint) 0:34 Constant: @@ -207,7 +207,7 @@ 0:34 'cd' ( temp float) 0:? Linker Objects 0:? 'patchIn' ( patch in 4-component vector of float) -0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) 400.tesc ERROR: 0:6: 'quads' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) @@ -255,8 +255,8 @@ 0:23 move second child to first child ( temp 4-component vector of float) 0:23 'p' ( temp 4-component vector of float) 0:23 gl_Position: direct index for structure ( in 4-component vector of float Position) -0:23 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:23 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:23 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:23 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:23 Constant: 0:23 1 (const int) 0:23 Constant: @@ -265,8 +265,8 @@ 0:24 move second child to first child ( temp float) 0:24 'ps' ( temp float) 0:24 gl_PointSize: direct index for structure ( in float PointSize) -0:24 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:24 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:24 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:24 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:24 Constant: 0:24 1 (const int) 0:24 Constant: @@ -275,9 +275,9 @@ 0:25 move second child to first child ( temp float) 0:25 'cd' ( temp float) 0:25 direct index ( temp float ClipDistance) -0:25 gl_ClipDistance: direct index for structure ( in implicitly-sized array of float ClipDistance) -0:25 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:25 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:25 gl_ClipDistance: direct index for structure ( in unsized 3-element array of float ClipDistance) +0:25 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:25 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:25 Constant: 0:25 1 (const int) 0:25 Constant: @@ -298,25 +298,25 @@ 0:29 'gl_InvocationID' ( in int InvocationID) 0:31 move second child to first child ( temp 4-component vector of float) 0:31 gl_Position: direct index for structure ( out 4-component vector of float Position) -0:31 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:31 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:31 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:31 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) 0:31 'gl_InvocationID' ( in int InvocationID) 0:31 Constant: 0:31 0 (const int) 0:31 'p' ( temp 4-component vector of float) 0:32 move second child to first child ( temp float) 0:32 gl_PointSize: direct index for structure ( out float PointSize) -0:32 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:32 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:32 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) 0:32 'gl_InvocationID' ( in int InvocationID) 0:32 Constant: 0:32 1 (const int) 0:32 'ps' ( temp float) 0:33 move second child to first child ( temp float) 0:33 direct index ( temp float ClipDistance) -0:33 gl_ClipDistance: direct index for structure ( out implicitly-sized array of float ClipDistance) -0:33 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:33 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:33 gl_ClipDistance: direct index for structure ( out unsized 2-element array of float ClipDistance) +0:33 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) 0:33 'gl_InvocationID' ( in int InvocationID) 0:33 Constant: 0:33 2 (const int) @@ -386,8 +386,8 @@ 0:67 Function Parameters: 0:69 Sequence 0:69 gl_PointSize: direct index for structure ( out float PointSize) -0:69 direct index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:69 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:69 direct index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:69 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) 0:69 Constant: 0:69 4 (const int) 0:69 Constant: @@ -422,7 +422,7 @@ 0:123 'gl_DeviceIndex' ( in int DeviceIndex) 0:124 'gl_ViewIndex' ( in int ViewIndex) 0:? Linker Objects -0:? 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:? 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) 0:? 'outa' ( global 4-element array of int) 0:? 'patchIn' ( patch in 4-component vector of float) 0:? 'patchOut' ( patch out 4-component vector of float) @@ -453,7 +453,7 @@ ERROR: 0:48: 'patch' : cannot use interpolation qualifiers with patch ERROR: 0:49: 'patch' : cannot use interpolation qualifiers with patch ERROR: 0:50: '' : can only have one auxiliary qualifier (centroid, patch, and sample) -ERROR: 0:54: 'gl_PerVertex' : block already declared with size, can't redeclare as implicitly-sized +ERROR: 0:54: 'gl_PerVertex' : block already declared with size, can't redeclare as unsized ERROR: 0:59: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use ERROR: 0:64: 'quads' : cannot apply to 'out' ERROR: 0:64: 'cw' : can only apply to 'in' @@ -499,8 +499,8 @@ 0:32 move second child to first child ( temp 4-component vector of float) 0:32 'p' ( temp 4-component vector of float) 0:32 gl_Position: direct index for structure ( in 4-component vector of float Position) -0:32 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:32 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:32 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:32 Constant: 0:32 1 (const int) 0:32 Constant: @@ -509,8 +509,8 @@ 0:33 move second child to first child ( temp float) 0:33 'ps' ( temp float) 0:33 gl_PointSize: direct index for structure ( in float PointSize) -0:33 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:33 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:33 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:33 Constant: 0:33 1 (const int) 0:33 Constant: @@ -519,9 +519,9 @@ 0:34 move second child to first child ( temp float) 0:34 'cd' ( temp float) 0:34 direct index ( temp float ClipDistance) -0:34 gl_ClipDistance: direct index for structure ( in implicitly-sized array of float ClipDistance) -0:34 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:34 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:34 gl_ClipDistance: direct index for structure ( in unsized 3-element array of float ClipDistance) +0:34 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:34 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:34 Constant: 0:34 1 (const int) 0:34 Constant: @@ -556,20 +556,20 @@ 0:40 1 (const int) 0:42 move second child to first child ( temp 4-component vector of float) 0:42 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) -0:42 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:42 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:42 Constant: 0:42 0 (const uint) 0:42 'p' ( temp 4-component vector of float) 0:43 move second child to first child ( temp float) 0:43 gl_PointSize: direct index for structure ( gl_PointSize float PointSize) -0:43 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:43 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:43 Constant: 0:43 1 (const uint) 0:43 'ps' ( temp float) 0:44 move second child to first child ( temp float) 0:44 direct index ( temp float ClipDistance) -0:44 gl_ClipDistance: direct index for structure ( out implicitly-sized array of float ClipDistance) -0:44 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:44 gl_ClipDistance: direct index for structure ( out unsized 3-element array of float ClipDistance) +0:44 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:44 Constant: 0:44 2 (const uint) 0:44 Constant: @@ -588,7 +588,7 @@ 0:? Linker Objects 0:? 'patchIn' ( patch in 4-component vector of float) 0:? 'patchOut' ( patch out 4-component vector of float) -0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:? 'badp1' ( smooth patch in 4-component vector of float) 0:? 'badp2' ( flat patch in 4-component vector of float) 0:? 'badp3' ( noperspective patch in 4-component vector of float) @@ -620,7 +620,7 @@ 0:8 Function Definition: main( ( global void) 0:8 Function Parameters: 0:? Linker Objects -0:? 'gl_out' ( out implicitly-sized array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:? 'gl_out' ( out unsized 1-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) 0:? 'outa' ( global 1-element array of int) 0:? 'patchOut' ( patch out 4-component vector of float) @@ -646,8 +646,8 @@ 0:17 move second child to first child ( temp 4-component vector of float) 0:17 'p' ( temp 4-component vector of float) 0:17 gl_Position: direct index for structure ( in 4-component vector of float Position) -0:17 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:17 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:17 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:17 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:17 Constant: 0:17 1 (const int) 0:17 Constant: @@ -656,8 +656,8 @@ 0:18 move second child to first child ( temp float) 0:18 'ps' ( temp float) 0:18 gl_PointSize: direct index for structure ( in float PointSize) -0:18 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:18 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:18 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:18 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:18 Constant: 0:18 1 (const int) 0:18 Constant: @@ -666,9 +666,9 @@ 0:19 move second child to first child ( temp float) 0:19 'cd' ( temp float) 0:19 direct index ( temp float ClipDistance) -0:19 gl_ClipDistance: direct index for structure ( in implicitly-sized array of float ClipDistance) -0:19 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:19 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:19 gl_ClipDistance: direct index for structure ( in unsized 3-element array of float ClipDistance) +0:19 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:19 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:19 Constant: 0:19 1 (const int) 0:19 Constant: @@ -883,7 +883,7 @@ 0:? 'b3' ( global 2-element array of 4-component vector of float) 0:? 'b4' ( global 2-element array of 4-component vector of float) 0:? 'c3' ( global 4X2 matrix of float) -0:? 'd2' ( global implicitly-sized array of structure{ global float s, global float t}) +0:? 'd2' ( global unsized 1-element array of structure{ global float s, global float t}) 0:? 'b5' ( global 5-element array of float) 0:? 'single1' ( global structure{ global int f}) 0:? 'single2' ( global structure{ global 2-component vector of uint v}) @@ -943,8 +943,6 @@ ERROR: Linking tessellation control stage: Multiple function bodies in multiple compilation units for the same signature in the same stage: main( ERROR: Linking tessellation control stage: Types must match: - gl_out: " out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}" versus " out implicitly-sized array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}" -ERROR: Linking tessellation control stage: Types must match: outa: " global 4-element array of int" versus " global 1-element array of int" ERROR: Linking tessellation control stage: can't handle multiple entry points per stage ERROR: Linking tessellation control stage: Multiple function bodies in multiple compilation units for the same signature in the same stage: @@ -956,7 +954,7 @@ ERROR: Linking tessellation control stage: Multiple function bodies in multiple compilation units for the same signature in the same stage: main( ERROR: Linking tessellation control stage: Types must match: - gl_out: " out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}" versus " out 3-element array of block{ out 4-component vector of float Position gl_Position}" + gl_out: " out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}" versus " out 3-element array of block{ out 4-component vector of float Position gl_Position}" Linked tessellation evaluation stage: diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/150.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/150.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/150.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/150.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -11,20 +11,20 @@ 0:15 Sequence 0:15 move second child to first child ( temp 4-component vector of float) 0:15 gl_Position: direct index for structure ( invariant gl_Position 4-component vector of float Position) -0:15 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:15 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) 0:15 Constant: 0:15 0 (const uint) 0:15 'iv4' ( in 4-component vector of float) 0:16 move second child to first child ( temp float) 0:16 gl_PointSize: direct index for structure ( gl_PointSize float PointSize) -0:16 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:16 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) 0:16 Constant: 0:16 1 (const uint) 0:16 'ps' ( uniform float) 0:17 move second child to first child ( temp float) 0:17 direct index ( temp float ClipDistance) 0:17 gl_ClipDistance: direct index for structure ( out 4-element array of float ClipDistance) -0:17 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:17 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) 0:17 Constant: 0:17 2 (const uint) 0:17 Constant: @@ -35,14 +35,14 @@ 0:17 0 (const int) 0:18 move second child to first child ( temp 4-component vector of float) 0:18 gl_ClipVertex: direct index for structure ( gl_ClipVertex 4-component vector of float ClipVertex) -0:18 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:18 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) 0:18 Constant: 0:18 3 (const uint) 0:18 'iv4' ( in 4-component vector of float) 0:? Linker Objects 0:? 'iv4' ( in 4-component vector of float) 0:? 'ps' ( uniform float) -0:? 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform implicitly-sized array of int a}) +0:? 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform unsized 1-element array of int a}) 0:? 'gl_VertexID' ( gl_VertexId int VertexId) 0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/300.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/300.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/300.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/300.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,7 +1,7 @@ 300.frag ERROR: 0:2: 'float' : type requires declaration of default precision qualifier ERROR: 0:30: 'noperspective' : Reserved word. -ERROR: 0:30: 'noperspective' : not supported with this profile: es +ERROR: 0:30: 'noperspective' : not supported for this version or the enabled extensions ERROR: 0:31: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: bads ERROR: 0:32: 'uint' : cannot apply precision statement to this type; use 'float', 'int' or a sampler type ERROR: 0:39: 'structure' : must be qualified as flat in @@ -26,6 +26,7 @@ ERROR: 0:102: 'arrays of arrays' : not supported for this version or the enabled extensions ERROR: 0:102: 'arrays of arrays' : not supported for this version or the enabled extensions ERROR: 0:103: 'arrays of arrays' : not supported for this version or the enabled extensions +ERROR: 0:103: 'arrays of arrays' : not supported for this version or the enabled extensions ERROR: 0:100: 'arrays of arrays' : not supported for this version or the enabled extensions ERROR: 0:100: 'array-of-array of block' : not supported with this profile: es ERROR: 0:111: 'variable indexing fragment shader output array' : not supported with this profile: es @@ -44,7 +45,7 @@ ERROR: 0:158: 'invariant' : can only apply to an output ERROR: 0:160: 'imageBuffer' : Reserved word. ERROR: 0:160: '' : syntax error, unexpected IMAGEBUFFER, expecting COMMA or SEMICOLON -ERROR: 45 compilation errors. No code generated. +ERROR: 46 compilation errors. No code generated. Shader version: 300 @@ -392,7 +393,7 @@ 0:? 'sc' ( out lowp 3-component vector of float) 0:? 'sf' ( out lowp float) 0:? 'arrayedSampler' ( uniform 5-element array of lowp sampler2D) -0:? 'multiInst' (layout( column_major shared) uniform 2-element array of 3-element array of block{layout( column_major shared) uniform 2-element array of mediump int a, layout( column_major shared) uniform 2-element array of 3-element array of mediump int b, layout( column_major shared) uniform 2-element array of 3-element array of mediump int c}) +0:? 'multiInst' (layout( column_major shared) uniform 2-element array of 3-element array of block{layout( column_major shared) uniform 3-element array of 2-element array of mediump int a, layout( column_major shared) uniform 2-element array of 3-element array of mediump int b, layout( column_major shared) uniform 2-element array of 3-element array of mediump int c}) 0:? 'colors' ( out 4-element array of lowp 4-component vector of float) 0:? 'st1' ( uniform structure{ global mediump int i, global lowp sampler2D s}) 0:? 'st2' ( uniform structure{ global mediump int i, global lowp sampler2D s}) @@ -623,7 +624,7 @@ 0:? 'sc' ( out lowp 3-component vector of float) 0:? 'sf' ( out lowp float) 0:? 'arrayedSampler' ( uniform 5-element array of lowp sampler2D) -0:? 'multiInst' (layout( column_major shared) uniform 2-element array of 3-element array of block{layout( column_major shared) uniform 2-element array of mediump int a, layout( column_major shared) uniform 2-element array of 3-element array of mediump int b, layout( column_major shared) uniform 2-element array of 3-element array of mediump int c}) +0:? 'multiInst' (layout( column_major shared) uniform 2-element array of 3-element array of block{layout( column_major shared) uniform 3-element array of 2-element array of mediump int a, layout( column_major shared) uniform 2-element array of 3-element array of mediump int b, layout( column_major shared) uniform 2-element array of 3-element array of mediump int c}) 0:? 'colors' ( out 4-element array of lowp 4-component vector of float) 0:? 'st1' ( uniform structure{ global mediump int i, global lowp sampler2D s}) 0:? 'st2' ( uniform structure{ global mediump int i, global lowp sampler2D s}) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/300.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/300.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/300.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/300.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -320,9 +320,9 @@ 0:? 'rep2' ( centroid smooth sample out highp 4-component vector of float) 0:? 'rep3' ( in highp 4-component vector of float) 0:? 's' ( smooth out structure{ global highp 3-component vector of float c, global highp float f}) -0:? 'badsize' ( global implicitly-sized array of highp float) -0:? 'badsize2' ( global implicitly-sized array of highp float) -0:? 'ubInst' (layout( column_major shared) uniform implicitly-sized array of block{layout( column_major shared) uniform implicitly-sized array of highp int a}) +0:? 'badsize' ( global unsized 1-element array of highp float) +0:? 'badsize2' ( global unsized 1-element array of highp float) +0:? 'ubInst' (layout( column_major shared) uniform unsized 1-element array of block{layout( column_major shared) uniform unsized 1-element array of highp int a}) 0:? 'okayA' ( global 2-element array of highp float) 0:? 'newV' ( invariant smooth out highp 3-component vector of float) 0:? 'invIn' ( invariant in highp 4-component vector of float) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/310AofA.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/310AofA.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/310AofA.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/310AofA.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -7,12 +7,12 @@ ERROR: 0:49: 'constructor' : array constructor argument not correct type to construct array element ERROR: 0:62: '[' : array index out of range '4' ERROR: 0:78: 'assign' : cannot convert from ' global 4-element array of 7-element array of highp float' to ' global 5-element array of 7-element array of highp float' -ERROR: 0:79: 'assign' : cannot convert from ' global 4-element array of 7-element array of highp float' to ' global implicitly-sized array of 7-element array of highp float' +ERROR: 0:79: 'assign' : cannot convert from ' global 4-element array of 7-element array of highp float' to ' global unsized 1-element array of 7-element array of highp float' ERROR: 0:81: 'foo' : no matching overloaded function found ERROR: 0:86: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type ' global 4-element array of 7-element array of highp float' and a right operand of type ' global 5-element array of 7-element array of highp float' (or there is no acceptable conversion) ERROR: 0:90: '[' : array index out of range '5' ERROR: 0:94: '[' : index out of range '-1' -ERROR: 0:96: 'assign' : cannot convert from ' temp 3-element array of highp 4-component vector of float' to 'layout( column_major shared) buffer implicitly-sized array of highp 4-component vector of float' +ERROR: 0:96: 'assign' : cannot convert from ' temp 3-element array of highp 4-component vector of float' to 'layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float' ERROR: 0:103: '' : array size required ERROR: 0:104: '' : array size required ERROR: 0:105: '' : array size required @@ -245,7 +245,7 @@ 0:77 Function Call: foo(f1[5][7]; ( global 4-element array of 7-element array of highp float) 0:77 'g5' ( global 5-element array of 7-element array of highp float) 0:78 'g5' ( global 5-element array of 7-element array of highp float) -0:79 'gu' ( global implicitly-sized array of 7-element array of highp float) +0:79 'gu' ( global unsized 1-element array of 7-element array of highp float) 0:81 Constant: 0:81 0.000000 0:82 Function Call: bar(f1[5][7]; ( global void) @@ -275,9 +275,9 @@ 0:91 Function Call: foo(f1[5][7]; ( global 4-element array of 7-element array of highp float) 0:91 'u' ( temp 5-element array of 7-element array of highp float) 0:94 direct index (layout( column_major shared) temp highp 4-component vector of float) -0:94 v: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp 4-component vector of float) -0:94 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer implicitly-sized array of highp float u, layout( column_major shared) buffer implicitly-sized array of highp 4-component vector of float v}) -0:94 'name' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer implicitly-sized array of highp float u, layout( column_major shared) buffer implicitly-sized array of highp 4-component vector of float v}) +0:94 v: direct index for structure (layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float) +0:94 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer unsized 1-element array of highp float u, layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float v}) +0:94 'name' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer unsized 1-element array of highp float u, layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float v}) 0:94 Constant: 0:94 1 (const int) 0:94 Constant: @@ -286,9 +286,9 @@ 0:94 -1 (const int) 0:95 move second child to first child ( temp highp 4-component vector of float) 0:95 direct index (layout( column_major shared) temp highp 4-component vector of float) -0:95 v: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp 4-component vector of float) -0:95 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer implicitly-sized array of highp float u, layout( column_major shared) buffer implicitly-sized array of highp 4-component vector of float v}) -0:95 'name' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer implicitly-sized array of highp float u, layout( column_major shared) buffer implicitly-sized array of highp 4-component vector of float v}) +0:95 v: direct index for structure (layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float) +0:95 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer unsized 1-element array of highp float u, layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float v}) +0:95 'name' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer unsized 1-element array of highp float u, layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float v}) 0:95 Constant: 0:95 1 (const int) 0:95 Constant: @@ -300,9 +300,9 @@ 0:95 4.300000 0:95 4.300000 0:95 4.300000 -0:96 v: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp 4-component vector of float) -0:96 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer implicitly-sized array of highp float u, layout( column_major shared) buffer implicitly-sized array of highp 4-component vector of float v}) -0:96 'name' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer implicitly-sized array of highp float u, layout( column_major shared) buffer implicitly-sized array of highp 4-component vector of float v}) +0:96 v: direct index for structure (layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float) +0:96 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer unsized 1-element array of highp float u, layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float v}) +0:96 'name' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer unsized 1-element array of highp float u, layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float v}) 0:96 Constant: 0:96 1 (const int) 0:96 Constant: @@ -310,20 +310,39 @@ 0:98 Constant: 0:98 7 (const int) 0:99 array length ( temp int) -0:99 v: direct index for structure (layout( column_major shared) buffer implicitly-sized array of 7-element array of highp 4-component vector of float) -0:99 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer highp float u, layout( column_major shared) buffer implicitly-sized array of 7-element array of highp 4-component vector of float v}) -0:99 'name3' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer highp float u, layout( column_major shared) buffer implicitly-sized array of 7-element array of highp 4-component vector of float v}) +0:99 v: direct index for structure (layout( column_major shared) buffer unsized 2-element array of 7-element array of highp 4-component vector of float) +0:99 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer highp float u, layout( column_major shared) buffer unsized 2-element array of 7-element array of highp 4-component vector of float v}) +0:99 'name3' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer highp float u, layout( column_major shared) buffer unsized 2-element array of 7-element array of highp 4-component vector of float v}) 0:99 Constant: 0:99 0 (const int) 0:99 Constant: 0:99 1 (const int) +0:117 Function Definition: func(mf33[3][2]; ( global highp 3-component vector of float) +0:117 Function Parameters: +0:117 'x' ( in 3-element array of 2-element array of highp 3X3 matrix of float) +0:119 Sequence +0:119 Sequence +0:119 move second child to first child ( temp highp 3X3 matrix of float) +0:119 'a0' ( temp highp 3X3 matrix of float) +0:119 direct index ( temp highp 3X3 matrix of float) +0:119 direct index ( temp 2-element array of highp 3X3 matrix of float) +0:119 'x' ( in 3-element array of 2-element array of highp 3X3 matrix of float) +0:119 Constant: +0:119 2 (const int) +0:119 Constant: +0:119 1 (const int) +0:120 Branch: Return with expression +0:120 direct index ( temp highp 3-component vector of float) +0:120 'a0' ( temp highp 3X3 matrix of float) +0:120 Constant: +0:120 2 (const int) 0:? Linker Objects -0:? 'name' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer implicitly-sized array of highp float u, layout( column_major shared) buffer implicitly-sized array of highp 4-component vector of float v}) -0:? 'uname' (layout( column_major shared) uniform 3-element array of block{layout( column_major shared) uniform highp float u, layout( column_major shared) uniform implicitly-sized array of highp 4-component vector of float v}) -0:? 'name2' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer highp float u, layout( column_major shared) buffer implicitly-sized array of implicitly-sized array of highp 4-component vector of float v}) -0:? 'name3' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer highp float u, layout( column_major shared) buffer implicitly-sized array of 7-element array of highp 4-component vector of float v}) +0:? 'name' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer unsized 1-element array of highp float u, layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float v}) +0:? 'uname' (layout( column_major shared) uniform 3-element array of block{layout( column_major shared) uniform highp float u, layout( column_major shared) uniform unsized 1-element array of highp 4-component vector of float v}) +0:? 'name2' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer highp float u, layout( column_major shared) buffer unsized 1-element array of 1-element array of highp 4-component vector of float v}) +0:? 'name3' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer highp float u, layout( column_major shared) buffer unsized 2-element array of 7-element array of highp 4-component vector of float v}) 0:? 'many' ( global 1-element array of 2-element array of 3-element array of 4-element array of 5-element array of 6-element array of highp float) -0:? 'gu' ( global implicitly-sized array of 7-element array of highp float) +0:? 'gu' ( global unsized 1-element array of 7-element array of highp float) 0:? 'g4' ( global 4-element array of 7-element array of highp float) 0:? 'g5' ( global 5-element array of 7-element array of highp float) 0:? 'inArray' ( in 2-element array of 3-element array of highp float) @@ -359,10 +378,10 @@ 0:13 2 (const uint) 0:13 'd' ( temp 3-element array of 2-element array of highp int) 0:? Linker Objects -0:? 'name' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer implicitly-sized array of highp float u, layout( column_major shared) buffer implicitly-sized array of highp 4-component vector of float v}) +0:? 'name' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer 1-element array of highp float u, layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float v}) 0:? 'uname' (layout( column_major shared) uniform 3-element array of block{layout( column_major shared) uniform highp float u, layout( column_major shared) uniform 1-element array of highp 4-component vector of float v}) -0:? 'name2' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer highp float u, layout( column_major shared) buffer implicitly-sized array of implicitly-sized array of highp 4-component vector of float v}) -0:? 'name3' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer highp float u, layout( column_major shared) buffer implicitly-sized array of 7-element array of highp 4-component vector of float v}) +0:? 'name2' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer highp float u, layout( column_major shared) buffer unsized 1-element array of 1-element array of highp 4-component vector of float v}) +0:? 'name3' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer highp float u, layout( column_major shared) buffer unsized 2-element array of 7-element array of highp 4-component vector of float v}) 0:? 'many' ( global 1-element array of 2-element array of 3-element array of 4-element array of 5-element array of 6-element array of highp float) 0:? 'gu' ( global 1-element array of 7-element array of highp float) 0:? 'g4' ( global 4-element array of 7-element array of highp float) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/310.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/310.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/310.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/310.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -40,7 +40,6 @@ ERROR: 0:128: 'atomic_uint' : samplers and atomic_uints cannot be output parameters ERROR: 0:130: 'return' : type does not match, or is not convertible to, the function's return type ERROR: 0:136: 'atomic_uint' : atomic_uints can only be used in uniform variables or function parameters: non_uniform_counter -ERROR: 0:136: 'atomic_uint' : layout(binding=X) is required ERROR: 0:141: 'atomic_uint' : atomic counters can only be highp ERROR: 0:141: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings ERROR: 0:143: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings @@ -84,7 +83,7 @@ ERROR: 0:244: 'gl_DeviceIndex' : required extension not requested: GL_EXT_device_group ERROR: 0:245: 'gl_ViewIndex' : undeclared identifier ERROR: 0:255: 'gl_ViewIndex' : undeclared identifier -ERROR: 83 compilation errors. No code generated. +ERROR: 82 compilation errors. No code generated. Shader version: 310 @@ -103,13 +102,13 @@ 0:35 GroupMemoryBarrier ( global void) 0:36 move second child to first child ( temp highp int) 0:36 value: direct index for structure (layout( column_major shared) buffer highp int) -0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer runtime-sized array of highp float values}) 0:36 Constant: 0:36 0 (const uint) 0:36 Convert float to int ( temp highp int) 0:36 indirect index (layout( column_major shared) temp highp float) -0:36 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp float) -0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:36 values: direct index for structure (layout( column_major shared) buffer runtime-sized array of highp float) +0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer runtime-sized array of highp float values}) 0:36 Constant: 0:36 1 (const uint) 0:36 'gl_LocalInvocationIndex' ( in highp uint LocalInvocationIndex) @@ -118,8 +117,8 @@ 0:61 Sequence 0:61 move second child to first child ( temp highp float) 0:61 direct index (layout( column_major shared) temp highp float) -0:61 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp float) -0:61 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:61 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:61 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:61 Constant: 0:61 1 (const int) 0:61 Constant: @@ -127,8 +126,8 @@ 0:61 Constant: 0:61 4.700000 0:62 array length ( temp int) -0:62 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp float) -0:62 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:62 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:62 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:62 Constant: 0:62 1 (const int) 0:63 Pre-Increment ( temp highp 4-component vector of float) @@ -281,8 +280,8 @@ 0:194 move second child to first child ( temp highp float) 0:194 'g' ( temp highp float) 0:194 direct index (layout( column_major shared) temp highp float) -0:194 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp float) -0:194 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:194 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:194 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:194 Constant: 0:194 1 (const int) 0:194 Constant: @@ -291,24 +290,24 @@ 0:195 move second child to first child ( temp highp float) 0:195 'f' ( temp highp float) 0:195 direct index (layout( column_major shared) temp highp float) -0:195 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp float) -0:195 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:195 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:195 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:195 Constant: 0:195 1 (const int) 0:195 Constant: 0:195 2 (const int) 0:196 Pre-Increment ( temp highp float) 0:196 direct index (layout( column_major shared) temp highp float) -0:196 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp float) -0:196 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:196 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:196 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:196 Constant: 0:196 1 (const int) 0:196 Constant: 0:196 2 (const int) 0:197 Post-Decrement ( temp highp float) 0:197 direct index (layout( column_major shared) temp highp float) -0:197 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp float) -0:197 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:197 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:197 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:197 Constant: 0:197 1 (const int) 0:197 Constant: @@ -316,16 +315,16 @@ 0:198 add ( temp highp float) 0:198 'f' ( temp highp float) 0:198 direct index (layout( column_major shared) temp highp float) -0:198 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp float) -0:198 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:198 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:198 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:198 Constant: 0:198 1 (const int) 0:198 Constant: 0:198 2 (const int) 0:199 subtract ( temp highp float) 0:199 direct index (layout( column_major shared) temp highp float) -0:199 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp float) -0:199 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:199 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:199 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:199 Constant: 0:199 1 (const int) 0:199 Constant: @@ -338,8 +337,8 @@ 0:201 'f' ( temp highp float) 0:201 false case 0:201 direct index (layout( column_major shared) temp highp float) -0:201 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp float) -0:201 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:201 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:201 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:201 Constant: 0:201 1 (const int) 0:201 Constant: @@ -349,8 +348,8 @@ 0:202 'b' ( temp bool) 0:202 true case 0:202 direct index (layout( column_major shared) temp highp float) -0:202 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp float) -0:202 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:202 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:202 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:202 Constant: 0:202 1 (const int) 0:202 Constant: @@ -362,8 +361,8 @@ 0:203 Compare Equal ( temp bool) 0:203 'f' ( temp highp float) 0:203 direct index (layout( column_major shared) temp highp float) -0:203 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp float) -0:203 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:203 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:203 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:203 Constant: 0:203 1 (const int) 0:203 Constant: @@ -376,8 +375,8 @@ 0:205 Compare Greater Than or Equal ( temp bool) 0:205 'f' ( temp highp float) 0:205 direct index (layout( column_major shared) temp highp float) -0:205 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp float) -0:205 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:205 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:205 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:205 Constant: 0:205 1 (const int) 0:205 Constant: @@ -390,8 +389,8 @@ 0:207 direct index ( temp highp float) 0:207 Construct vec3 ( temp highp 3-component vector of float) 0:207 direct index (layout( column_major shared) temp highp float) -0:207 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp float) -0:207 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:207 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:207 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:207 Constant: 0:207 1 (const int) 0:207 Constant: @@ -400,13 +399,13 @@ 0:207 0 (const int) 0:208 Bitwise not ( temp highp int) 0:208 value: direct index for structure (layout( column_major shared) buffer highp int) -0:208 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:208 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:208 Constant: 0:208 0 (const int) 0:209 move second child to first child ( temp highp float) 0:209 direct index (layout( column_major shared) temp highp float) -0:209 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp float) -0:209 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:209 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:209 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:209 Constant: 0:209 1 (const int) 0:209 Constant: @@ -419,21 +418,21 @@ 0:221 move second child to first child ( temp highp float) 0:221 'g' ( temp highp float) 0:221 direct index (layout( column_major shared) temp highp float) -0:221 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp float) -0:221 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:221 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:221 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:221 Constant: 0:221 1 (const int) 0:221 Constant: 0:221 2 (const int) 0:222 Bitwise not ( temp highp int) 0:222 value: direct index for structure (layout( column_major shared) buffer highp int) -0:222 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:222 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:222 Constant: 0:222 0 (const int) 0:223 move second child to first child ( temp highp float) 0:223 direct index (layout( column_major shared) temp highp float) -0:223 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp float) -0:223 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:223 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:223 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:223 Constant: 0:223 1 (const int) 0:223 Constant: @@ -442,7 +441,7 @@ 0:223 3.400000 0:224 move second child to first child ( temp highp int) 0:224 value: direct index for structure (layout( column_major shared) buffer highp int) -0:224 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:224 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:224 Constant: 0:224 0 (const int) 0:224 Constant: @@ -464,8 +463,8 @@ 0:? 4096 (const uint) 0:? 'total' ( const highp int) 0:? 66592 (const int) -0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) -0:? 'invalid' (layout( column_major shared) buffer block{layout( column_major shared) buffer implicitly-sized array of highp float values, layout( column_major shared) buffer highp int value}) +0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer runtime-sized array of highp float values}) +0:? 'invalid' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 1-element array of highp float values, layout( column_major shared) buffer highp int value}) 0:? 'v3' (layout( location=2) in highp 3-component vector of float) 0:? 'f' ( in highp float) 0:? 'fo' ( out highp float) @@ -475,7 +474,7 @@ 0:? 'arrX' ( global 2-element array of highp int) 0:? 'arrY' ( global 1-element array of highp int) 0:? 'arrZ' ( global 4096-element array of highp int) -0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:? 'v' ( buffer highp 4-component vector of float) 0:? 'us2dbad' ( uniform mediump usampler2D) 0:? 'us2d' ( uniform highp usampler2D) @@ -514,8 +513,8 @@ 0:? 'badQ1' (layout( rgba32f) coherent volatile restrict uniform highp image2D) 0:? 'badQ2' (layout( rgba8i) coherent volatile restrict uniform highp iimage2D) 0:? 'badQ3' (layout( rgba16ui) coherent volatile restrict uniform highp uimage2D) -0:? 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) -0:? 'multio' (layout( column_major shared) buffer block{layout( column_major shared) readonly buffer highp int value, layout( column_major shared) writeonly buffer implicitly-sized array of highp float values}) +0:? 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:? 'multio' (layout( column_major shared) buffer block{layout( column_major shared) readonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 1-element array of highp float values}) 0:? 'inbi' ( in block{ in highp int a}) 0:? 'outbi' ( out block{ out highp int a}) 0:? 't__' ( global highp float) @@ -541,13 +540,13 @@ 0:35 GroupMemoryBarrier ( global void) 0:36 move second child to first child ( temp highp int) 0:36 value: direct index for structure (layout( column_major shared) buffer highp int) -0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer runtime-sized array of highp float values}) 0:36 Constant: 0:36 0 (const uint) 0:36 Convert float to int ( temp highp int) 0:36 indirect index (layout( column_major shared) temp highp float) -0:36 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of highp float) -0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:36 values: direct index for structure (layout( column_major shared) buffer runtime-sized array of highp float) +0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer runtime-sized array of highp float values}) 0:36 Constant: 0:36 1 (const uint) 0:36 'gl_LocalInvocationIndex' ( in highp uint LocalInvocationIndex) @@ -558,8 +557,8 @@ 0:? 4096 (const uint) 0:? 'total' ( const highp int) 0:? 66592 (const int) -0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) -0:? 'invalid' (layout( column_major shared) buffer block{layout( column_major shared) buffer implicitly-sized array of highp float values, layout( column_major shared) buffer highp int value}) +0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer runtime-sized array of highp float values}) +0:? 'invalid' (layout( column_major shared) buffer block{layout( column_major shared) buffer 1-element array of highp float values, layout( column_major shared) buffer highp int value}) 0:? 'v3' (layout( location=2) in highp 3-component vector of float) 0:? 'f' ( in highp float) 0:? 'fo' ( out highp float) @@ -569,7 +568,7 @@ 0:? 'arrX' ( global 2-element array of highp int) 0:? 'arrY' ( global 1-element array of highp int) 0:? 'arrZ' ( global 4096-element array of highp int) -0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) +0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) 0:? 'v' ( buffer highp 4-component vector of float) 0:? 'us2dbad' ( uniform mediump usampler2D) 0:? 'us2d' ( uniform highp usampler2D) @@ -608,8 +607,8 @@ 0:? 'badQ1' (layout( rgba32f) coherent volatile restrict uniform highp image2D) 0:? 'badQ2' (layout( rgba8i) coherent volatile restrict uniform highp iimage2D) 0:? 'badQ3' (layout( rgba16ui) coherent volatile restrict uniform highp uimage2D) -0:? 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer implicitly-sized array of highp float values}) -0:? 'multio' (layout( column_major shared) buffer block{layout( column_major shared) readonly buffer highp int value, layout( column_major shared) writeonly buffer implicitly-sized array of highp float values}) +0:? 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:? 'multio' (layout( column_major shared) buffer block{layout( column_major shared) readonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 1-element array of highp float values}) 0:? 'inbi' ( in block{ in highp int a}) 0:? 'outbi' ( out block{ out highp int a}) 0:? 't__' ( global highp float) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/310.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/310.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/310.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/310.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -105,7 +105,7 @@ ERROR: 0:347: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output ERROR: 0:348: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output ERROR: 0:349: 'noperspective' : Reserved word. -ERROR: 0:349: 'noperspective' : not supported with this profile: es +ERROR: 0:349: 'noperspective' : not supported for this version or the enabled extensions ERROR: 0:349: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output ERROR: 0:355: 'interpolateAtCentroid' : required extension not requested: GL_OES_shader_multisample_interpolation ERROR: 0:356: 'interpolateAtSample' : required extension not requested: GL_OES_shader_multisample_interpolation @@ -569,12 +569,12 @@ 0:259 move second child to first child ( temp highp int) 0:259 'a3' ( temp highp int) 0:259 direct index ( flat temp highp int SampleMaskIn) -0:259 'gl_SampleMaskIn' ( flat in implicitly-sized array of highp int SampleMaskIn) +0:259 'gl_SampleMaskIn' ( flat in unsized 1-element array of highp int SampleMaskIn) 0:259 Constant: 0:259 0 (const int) 0:260 move second child to first child ( temp highp int) 0:260 direct index ( temp highp int SampleMaskIn) -0:260 'gl_SampleMask' ( out implicitly-sized array of highp int SampleMaskIn) +0:260 'gl_SampleMask' ( out unsized 1-element array of highp int SampleMaskIn) 0:260 Constant: 0:260 0 (const int) 0:260 'a3' ( temp highp int) @@ -597,12 +597,12 @@ 0:272 move second child to first child ( temp highp int) 0:272 'a3' ( temp highp int) 0:272 direct index ( flat temp highp int SampleMaskIn) -0:272 'gl_SampleMaskIn' ( flat in implicitly-sized array of highp int SampleMaskIn) +0:272 'gl_SampleMaskIn' ( flat in unsized 1-element array of highp int SampleMaskIn) 0:272 Constant: 0:272 0 (const int) 0:273 move second child to first child ( temp highp int) 0:273 direct index ( temp highp int SampleMaskIn) -0:273 'gl_SampleMask' ( out implicitly-sized array of highp int SampleMaskIn) +0:273 'gl_SampleMask' ( out unsized 1-element array of highp int SampleMaskIn) 0:273 Constant: 0:273 0 (const int) 0:273 'a3' ( temp highp int) @@ -1001,8 +1001,8 @@ 0:? 'CA5' ( uniform highp samplerCubeArrayShadow) 0:? 'CA6' ( uniform highp isamplerCubeArray) 0:? 'CA7' ( uniform highp usamplerCubeArray) -0:? 'gl_SampleMaskIn' ( flat in implicitly-sized array of highp int SampleMaskIn) -0:? 'gl_SampleMask' ( out implicitly-sized array of highp int SampleMaskIn) +0:? 'gl_SampleMaskIn' ( flat in unsized 1-element array of highp int SampleMaskIn) +0:? 'gl_SampleMask' ( out unsized 1-element array of highp int SampleMaskIn) 0:? 'im2Df' (layout( r32f) uniform highp image2D) 0:? 'im2Du' (layout( r32ui) uniform highp uimage2D) 0:? 'im2Di' (layout( r32i) uniform highp iimage2D) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/310implicitSizeArrayError.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/310implicitSizeArrayError.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/310implicitSizeArrayError.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/310implicitSizeArrayError.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -11,14 +11,14 @@ 0:7 move second child to first child ( temp highp int) 0:7 'o' (layout( location=0) smooth out highp int) 0:7 direct index (layout( column_major shared) temp highp int) -0:7 a: direct index for structure (layout( column_major shared) uniform implicitly-sized array of highp int) -0:7 'uni' (layout( location=0 column_major shared) uniform block{layout( column_major shared) uniform implicitly-sized array of highp int a}) +0:7 a: direct index for structure (layout( column_major shared) uniform unsized 3-element array of highp int) +0:7 'uni' (layout( binding=0 column_major shared) uniform block{layout( column_major shared) uniform unsized 3-element array of highp int a}) 0:7 Constant: 0:7 0 (const int) 0:7 Constant: 0:7 2 (const int) 0:? Linker Objects -0:? 'uni' (layout( location=0 column_major shared) uniform block{layout( column_major shared) uniform implicitly-sized array of highp int a}) +0:? 'uni' (layout( binding=0 column_major shared) uniform block{layout( column_major shared) uniform unsized 3-element array of highp int a}) 0:? 'o' (layout( location=0) smooth out highp int) 0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) 0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) @@ -35,14 +35,14 @@ 0:7 move second child to first child ( temp highp int) 0:7 'o' (layout( location=0) smooth out highp int) 0:7 direct index (layout( column_major shared) temp highp int) -0:7 a: direct index for structure (layout( column_major shared) uniform 1-element array of highp int) -0:7 'uni' (layout( location=0 column_major shared) uniform block{layout( column_major shared) uniform 1-element array of highp int a}) +0:7 a: direct index for structure (layout( column_major shared) uniform 3-element array of highp int) +0:7 'uni' (layout( binding=0 column_major shared) uniform block{layout( column_major shared) uniform 3-element array of highp int a}) 0:7 Constant: 0:7 0 (const int) 0:7 Constant: 0:7 2 (const int) 0:? Linker Objects -0:? 'uni' (layout( location=0 column_major shared) uniform block{layout( column_major shared) uniform 1-element array of highp int a}) +0:? 'uni' (layout( binding=0 column_major shared) uniform block{layout( column_major shared) uniform 3-element array of highp int a}) 0:? 'o' (layout( location=0) smooth out highp int) 0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) 0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/310runtimeArray.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/310runtimeArray.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/310runtimeArray.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/310runtimeArray.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,145 @@ +310runtimeArray.vert +ERROR: 0:9: '' : array size required +ERROR: 1 compilation errors. No code generated. + + +Shader version: 310 +ERROR: node is still EOpNull! +0:12 Function Definition: main( ( global void) +0:12 Function Parameters: +0:14 Sequence +0:14 move second child to first child ( temp highp float) +0:14 'o' (layout( location=0) smooth out highp float) +0:14 f: direct index for structure ( global highp float) +0:14 direct index (layout( column_major shared) temp structure{ global highp float f}) +0:14 s: direct index for structure (layout( column_major shared) buffer unsized 6-element array of structure{ global highp float f}) +0:14 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 6-element array of structure{ global highp float f} s}) +0:14 Constant: +0:14 0 (const uint) +0:14 Constant: +0:14 5 (const int) +0:14 Constant: +0:14 0 (const int) +0:15 add second child into first child ( temp highp float) +0:15 'o' (layout( location=0) smooth out highp float) +0:15 f: direct index for structure ( global highp float) +0:15 direct index (layout( column_major shared) temp structure{ global highp float f}) +0:15 s: direct index for structure (layout( column_major shared) buffer unsized 7-element array of structure{ global highp float f}) +0:15 'b2name' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 7-element array of structure{ global highp float f} s}) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 6 (const int) +0:15 Constant: +0:15 0 (const int) +0:16 add second child into first child ( temp highp float) +0:16 'o' (layout( location=0) smooth out highp float) +0:16 f: direct index for structure ( global highp float) +0:16 direct index (layout( column_major shared) temp structure{ global highp float f}) +0:16 s: direct index for structure (layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f}) +0:16 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f} s}) +0:16 'b3name' (layout( column_major shared) buffer unsized 4-element array of block{layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f} s}) +0:16 Constant: +0:16 3 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 7 (const int) +0:16 Constant: +0:16 0 (const int) +0:17 add second child into first child ( temp highp float) +0:17 'o' (layout( location=0) smooth out highp float) +0:17 f: direct index for structure ( global highp float) +0:17 direct index (layout( column_major shared) temp structure{ global highp float f}) +0:17 s: direct index for structure (layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f}) +0:17 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f} s}) +0:17 'b4name' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f} s}) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 8 (const int) +0:17 Constant: +0:17 0 (const int) +0:? Linker Objects +0:? 'o' (layout( location=0) smooth out highp float) +0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 6-element array of structure{ global highp float f} s}) +0:? 'b2name' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 7-element array of structure{ global highp float f} s}) +0:? 'b3name' (layout( column_major shared) buffer unsized 4-element array of block{layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f} s}) +0:? 'b4name' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f} s}) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + + +Linked vertex stage: + + +Shader version: 310 +ERROR: node is still EOpNull! +0:12 Function Definition: main( ( global void) +0:12 Function Parameters: +0:14 Sequence +0:14 move second child to first child ( temp highp float) +0:14 'o' (layout( location=0) smooth out highp float) +0:14 f: direct index for structure ( global highp float) +0:14 direct index (layout( column_major shared) temp structure{ global highp float f}) +0:14 s: direct index for structure (layout( column_major shared) buffer unsized 6-element array of structure{ global highp float f}) +0:14 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 6-element array of structure{ global highp float f} s}) +0:14 Constant: +0:14 0 (const uint) +0:14 Constant: +0:14 5 (const int) +0:14 Constant: +0:14 0 (const int) +0:15 add second child into first child ( temp highp float) +0:15 'o' (layout( location=0) smooth out highp float) +0:15 f: direct index for structure ( global highp float) +0:15 direct index (layout( column_major shared) temp structure{ global highp float f}) +0:15 s: direct index for structure (layout( column_major shared) buffer unsized 7-element array of structure{ global highp float f}) +0:15 'b2name' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 7-element array of structure{ global highp float f} s}) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 6 (const int) +0:15 Constant: +0:15 0 (const int) +0:16 add second child into first child ( temp highp float) +0:16 'o' (layout( location=0) smooth out highp float) +0:16 f: direct index for structure ( global highp float) +0:16 direct index (layout( column_major shared) temp structure{ global highp float f}) +0:16 s: direct index for structure (layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f}) +0:16 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f} s}) +0:16 'b3name' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f} s}) +0:16 Constant: +0:16 3 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 7 (const int) +0:16 Constant: +0:16 0 (const int) +0:17 add second child into first child ( temp highp float) +0:17 'o' (layout( location=0) smooth out highp float) +0:17 f: direct index for structure ( global highp float) +0:17 direct index (layout( column_major shared) temp structure{ global highp float f}) +0:17 s: direct index for structure (layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f}) +0:17 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f} s}) +0:17 'b4name' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f} s}) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 8 (const int) +0:17 Constant: +0:17 0 (const int) +0:? Linker Objects +0:? 'o' (layout( location=0) smooth out highp float) +0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 6-element array of structure{ global highp float f} s}) +0:? 'b2name' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 7-element array of structure{ global highp float f} s}) +0:? 'b3name' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f} s}) +0:? 'b4name' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f} s}) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/310.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/310.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/310.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/310.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -70,8 +70,8 @@ 0:25 move second child to first child ( temp highp 4-component vector of float) 0:25 'p' ( temp highp 4-component vector of float) 0:25 gl_Position: direct index for structure ( in highp 4-component vector of float Position) -0:25 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) -0:25 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) +0:25 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:25 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) 0:25 Constant: 0:25 1 (const int) 0:25 Constant: @@ -80,8 +80,8 @@ 0:26 move second child to first child ( temp highp float) 0:26 'ps' ( temp highp float) 0:26 gl_PointSize: direct index for structure ( in highp float PointSize) -0:26 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) -0:26 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) +0:26 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:26 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) 0:26 Constant: 0:26 1 (const int) 0:26 Constant: @@ -209,8 +209,8 @@ 0:114 move second child to first child ( temp highp float) 0:114 'ps' ( temp highp float) 0:114 gl_PointSize: direct index for structure ( in highp float PointSize) -0:114 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) -0:114 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) +0:114 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:114 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) 0:114 Constant: 0:114 1 (const int) 0:114 Constant: @@ -357,7 +357,7 @@ 0:? 'inb' ( in 32-element array of highp 2-component vector of float) 0:? 'inc' ( in 32-element array of highp 2-component vector of float) 0:? 'ind' ( in 32-element array of highp 2-component vector of float) -0:? 'implA' ( patch out implicitly-sized array of highp float) +0:? 'implA' ( patch out unsized 1-element array of highp float) 0:? 'ivla' (layout( location=3) in 32-element array of highp 4-component vector of float) 0:? 'ivlb' (layout( location=4) in 32-element array of highp 4-component vector of float) 0:? 'ivlc' (layout( location=4) in 32-element array of highp 4-component vector of float) @@ -372,7 +372,7 @@ 0:? 'misSized' ( out 5-element array of highp float) 0:? 'okaySize' ( out 4-element array of highp float) 0:? 'pv3' ( noContraction temp highp 3-component vector of float) -0:? 'badpatchIName' ( patch out implicitly-sized array of block{ out highp float f}) +0:? 'badpatchIName' ( patch out unsized 1-element array of block{ out highp float f}) 0:? 'patchIName' ( patch out 4-element array of block{ out highp float f}) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/310.tese.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/310.tese.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/310.tese.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/310.tese.out 2018-04-27 11:46:26.000000000 +0000 @@ -21,11 +21,11 @@ ERROR: 0:51: 'patch' : cannot use interpolation qualifiers with patch ERROR: 0:52: 'patch' : cannot use interpolation qualifiers with patch ERROR: 0:53: 'noperspective' : Reserved word. -ERROR: 0:53: 'noperspective' : not supported with this profile: es +ERROR: 0:53: 'noperspective' : not supported for this version or the enabled extensions ERROR: 0:53: 'patch' : cannot use interpolation qualifiers with patch ERROR: 0:54: 'sample' : Reserved word. ERROR: 0:54: '' : can only have one auxiliary qualifier (centroid, patch, and sample) -ERROR: 0:58: 'gl_PerVertex' : block already declared with size, can't redeclare as implicitly-sized +ERROR: 0:58: 'gl_PerVertex' : block already declared with size, can't redeclare as unsized ERROR: 0:63: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use ERROR: 0:68: 'quads' : cannot apply to 'out' ERROR: 0:68: 'cw' : can only apply to 'in' @@ -77,8 +77,8 @@ 0:36 move second child to first child ( temp highp 4-component vector of float) 0:36 'p' ( temp highp 4-component vector of float) 0:36 gl_Position: direct index for structure ( in highp 4-component vector of float Position) -0:36 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) -0:36 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) +0:36 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:36 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) 0:36 Constant: 0:36 1 (const int) 0:36 Constant: @@ -87,8 +87,8 @@ 0:37 move second child to first child ( temp highp float) 0:37 'ps' ( temp highp float) 0:37 gl_PointSize: direct index for structure ( in highp float PointSize) -0:37 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) -0:37 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) +0:37 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:37 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) 0:37 Constant: 0:37 1 (const int) 0:37 Constant: diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/320.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/320.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/320.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/320.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -23,7 +23,7 @@ ERROR: 0:158: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output ERROR: 0:159: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output ERROR: 0:160: 'noperspective' : Reserved word. -ERROR: 0:160: 'noperspective' : not supported with this profile: es +ERROR: 0:160: 'noperspective' : not supported for this version or the enabled extensions ERROR: 0:160: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output ERROR: 0:165: 'centroid/sample/patch' : can't use auxiliary qualifier on a fragment output ERROR: 0:180: 'interpolateAtCentroid' : no matching overloaded function found @@ -211,12 +211,12 @@ 0:113 move second child to first child ( temp highp int) 0:113 'a3' ( temp highp int) 0:113 direct index ( flat temp highp int SampleMaskIn) -0:113 'gl_SampleMaskIn' ( flat in implicitly-sized array of highp int SampleMaskIn) +0:113 'gl_SampleMaskIn' ( flat in unsized 1-element array of highp int SampleMaskIn) 0:113 Constant: 0:113 0 (const int) 0:114 move second child to first child ( temp highp int) 0:114 direct index ( temp highp int SampleMaskIn) -0:114 'gl_SampleMask' ( out implicitly-sized array of highp int SampleMaskIn) +0:114 'gl_SampleMask' ( out unsized 1-element array of highp int SampleMaskIn) 0:114 Constant: 0:114 0 (const int) 0:114 'a3' ( temp highp int) @@ -473,8 +473,8 @@ 0:? 'CA5' ( uniform highp samplerCubeArrayShadow) 0:? 'CA6' ( uniform highp isamplerCubeArray) 0:? 'CA7' ( uniform highp usamplerCubeArray) -0:? 'gl_SampleMaskIn' ( flat in implicitly-sized array of highp int SampleMaskIn) -0:? 'gl_SampleMask' ( out implicitly-sized array of highp int SampleMaskIn) +0:? 'gl_SampleMaskIn' ( flat in unsized 1-element array of highp int SampleMaskIn) +0:? 'gl_SampleMask' ( out unsized 1-element array of highp int SampleMaskIn) 0:? 'im2Df' (layout( r32f) uniform highp image2D) 0:? 'im2Du' (layout( r32ui) uniform highp uimage2D) 0:? 'im2Di' (layout( r32i) uniform highp iimage2D) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/320.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/320.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/320.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/320.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -62,8 +62,8 @@ 0:23 move second child to first child ( temp highp 4-component vector of float) 0:23 'p' ( temp highp 4-component vector of float) 0:23 gl_Position: direct index for structure ( in highp 4-component vector of float Position) -0:23 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) -0:23 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) +0:23 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:23 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) 0:23 Constant: 0:23 1 (const int) 0:23 Constant: @@ -72,8 +72,8 @@ 0:24 move second child to first child ( temp highp float) 0:24 'ps' ( temp highp float) 0:24 gl_PointSize: direct index for structure ( in highp float PointSize) -0:24 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) -0:24 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) +0:24 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:24 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) 0:24 Constant: 0:24 1 (const int) 0:24 Constant: @@ -192,8 +192,8 @@ 0:104 move second child to first child ( temp highp float) 0:104 'ps' ( temp highp float) 0:104 gl_PointSize: direct index for structure ( in highp float PointSize) -0:104 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) -0:104 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) +0:104 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:104 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) 0:104 Constant: 0:104 1 (const int) 0:104 Constant: @@ -336,7 +336,7 @@ 0:? 'inb' ( in 32-element array of highp 2-component vector of float) 0:? 'inc' ( in 32-element array of highp 2-component vector of float) 0:? 'ind' ( in 32-element array of highp 2-component vector of float) -0:? 'implA' ( patch out implicitly-sized array of highp float) +0:? 'implA' ( patch out unsized 1-element array of highp float) 0:? 'ivla' (layout( location=3) in 32-element array of highp 4-component vector of float) 0:? 'ivlb' (layout( location=4) in 32-element array of highp 4-component vector of float) 0:? 'ivlc' (layout( location=4) in 32-element array of highp 4-component vector of float) @@ -351,7 +351,7 @@ 0:? 'misSized' ( out 5-element array of highp float) 0:? 'okaySize' ( out 4-element array of highp float) 0:? 'pv3' ( noContraction temp highp 3-component vector of float) -0:? 'badpatchIName' ( patch out implicitly-sized array of block{ out highp float f}) +0:? 'badpatchIName' ( patch out unsized 1-element array of block{ out highp float f}) 0:? 'patchIName' ( patch out 4-element array of block{ out highp float f}) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/320.tese.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/320.tese.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/320.tese.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/320.tese.out 2018-04-27 11:46:26.000000000 +0000 @@ -21,10 +21,10 @@ ERROR: 0:47: 'patch' : cannot use interpolation qualifiers with patch ERROR: 0:48: 'patch' : cannot use interpolation qualifiers with patch ERROR: 0:49: 'noperspective' : Reserved word. -ERROR: 0:49: 'noperspective' : not supported with this profile: es +ERROR: 0:49: 'noperspective' : not supported for this version or the enabled extensions ERROR: 0:49: 'patch' : cannot use interpolation qualifiers with patch ERROR: 0:50: '' : can only have one auxiliary qualifier (centroid, patch, and sample) -ERROR: 0:54: 'gl_PerVertex' : block already declared with size, can't redeclare as implicitly-sized +ERROR: 0:54: 'gl_PerVertex' : block already declared with size, can't redeclare as unsized ERROR: 0:59: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use ERROR: 0:64: 'quads' : cannot apply to 'out' ERROR: 0:64: 'cw' : can only apply to 'in' @@ -67,8 +67,8 @@ 0:32 move second child to first child ( temp highp 4-component vector of float) 0:32 'p' ( temp highp 4-component vector of float) 0:32 gl_Position: direct index for structure ( in highp 4-component vector of float Position) -0:32 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) -0:32 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) +0:32 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:32 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) 0:32 Constant: 0:32 1 (const int) 0:32 Constant: @@ -77,8 +77,8 @@ 0:33 move second child to first child ( temp highp float) 0:33 'ps' ( temp highp float) 0:33 gl_PointSize: direct index for structure ( in highp float PointSize) -0:33 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) -0:33 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV}) +0:33 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:33 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) 0:33 Constant: 0:33 1 (const int) 0:33 Constant: diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/330.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/330.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/330.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/330.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -16,6 +16,7 @@ ERROR: 0:62: 'location on block member' : can only use in an in/out block ERROR: 0:62: 'location qualifier on uniform or buffer' : not supported for this version or the enabled extensions ERROR: 0:60: 'location qualifier on uniform or buffer' : not supported for this version or the enabled extensions +ERROR: 0:60: 'location' : cannot apply to uniform or buffer block ERROR: 0:68: 'layout-id value' : cannot be negative ERROR: 0:69: 'layout-id value' : cannot be negative ERROR: 0:76: 'f2' : cannot use layout qualifiers on structure members @@ -23,6 +24,7 @@ ERROR: 0:91: 'location qualifier on uniform or buffer' : not supported for this version or the enabled extensions ERROR: 0:91: 'location' : overlapping use of location 3 ERROR: 0:89: 'location qualifier on uniform or buffer' : not supported for this version or the enabled extensions +ERROR: 0:89: 'location' : cannot apply to uniform or buffer block ERROR: 0:94: 'location' : either the block needs a location, or all members need a location, or no members have a location ERROR: 0:108: 'A' : cannot use layout qualifiers on structure members ERROR: 0:119: 'location' : overlapping use of location 44 @@ -38,7 +40,7 @@ ERROR: 0:141: 'textureQueryLod' : no matching overloaded function found ERROR: 0:141: 'assign' : cannot convert from ' const float' to ' temp 2-component vector of float' ERROR: 0:152: 'index' : value must be 0 or 1 -ERROR: 39 compilation errors. No code generated. +ERROR: 41 compilation errors. No code generated. Shader version: 330 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/400.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/400.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/400.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/400.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -516,7 +516,7 @@ 0:? 'vl' (layout( location=4) smooth in 4-component vector of float) 0:? 'vl2' (layout( location=6) smooth in 4-component vector of float) 0:? 'uv3' (layout( location=3) uniform 3-component vector of float) -0:? 'anon@0' ( in block{ in float FogFragCoord gl_FogFragCoord, in implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, smooth in 4-component vector of float Color gl_Color, in 4-component vector of float SecondaryColor gl_SecondaryColor}) +0:? 'anon@0' ( in block{ in float FogFragCoord gl_FogFragCoord, in unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, smooth in 4-component vector of float Color gl_Color, in 4-component vector of float SecondaryColor gl_SecondaryColor}) 0:? 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord) 0:? 'u2drs' ( uniform sampler2DRectShadow) 0:? 'patchIn' ( smooth patch in 4-component vector of float) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/400.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/400.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/400.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/400.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,7 +1,7 @@ 400.geom ERROR: 0:12: 'invocations' : can only apply to a standalone qualifier ERROR: 0:20: 'patch' : not supported in this stage: geometry -ERROR: 0:20: 'gl_PointSize' : cannot add layout to redeclared block member +ERROR: 0:20: 'gl_PointSize' : cannot add non-XFB layout to redeclared block member ERROR: 0:20: 'gl_PointSize' : cannot add patch to redeclared block member ERROR: 0:25: 'length' : array must first be sized by a redeclaration or layout qualifier ERROR: 0:36: 'length' : array must first be sized by a redeclaration or layout qualifier diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/400.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/400.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/400.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/400.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -44,8 +44,8 @@ 0:23 move second child to first child ( temp 4-component vector of float) 0:23 'p' ( temp 4-component vector of float) 0:23 gl_Position: direct index for structure ( in 4-component vector of float Position) -0:23 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:23 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:23 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:23 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:23 Constant: 0:23 1 (const int) 0:23 Constant: @@ -54,8 +54,8 @@ 0:24 move second child to first child ( temp float) 0:24 'ps' ( temp float) 0:24 gl_PointSize: direct index for structure ( in float PointSize) -0:24 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:24 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:24 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:24 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:24 Constant: 0:24 1 (const int) 0:24 Constant: @@ -64,9 +64,9 @@ 0:25 move second child to first child ( temp float) 0:25 'cd' ( temp float) 0:25 direct index ( temp float ClipDistance) -0:25 gl_ClipDistance: direct index for structure ( in implicitly-sized array of float ClipDistance) -0:25 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:25 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:25 gl_ClipDistance: direct index for structure ( in unsized 3-element array of float ClipDistance) +0:25 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:25 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:25 Constant: 0:25 1 (const int) 0:25 Constant: @@ -87,25 +87,25 @@ 0:29 'gl_InvocationID' ( in int InvocationID) 0:31 move second child to first child ( temp 4-component vector of float) 0:31 gl_Position: direct index for structure ( out 4-component vector of float Position) -0:31 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:31 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:31 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:31 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) 0:31 'gl_InvocationID' ( in int InvocationID) 0:31 Constant: 0:31 0 (const int) 0:31 'p' ( temp 4-component vector of float) 0:32 move second child to first child ( temp float) 0:32 gl_PointSize: direct index for structure ( out float PointSize) -0:32 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:32 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:32 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) 0:32 'gl_InvocationID' ( in int InvocationID) 0:32 Constant: 0:32 1 (const int) 0:32 'ps' ( temp float) 0:33 move second child to first child ( temp float) 0:33 direct index ( temp float ClipDistance) -0:33 gl_ClipDistance: direct index for structure ( out implicitly-sized array of float ClipDistance) -0:33 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:33 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:33 gl_ClipDistance: direct index for structure ( out unsized 2-element array of float ClipDistance) +0:33 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) 0:33 'gl_InvocationID' ( in int InvocationID) 0:33 Constant: 0:33 2 (const int) @@ -175,8 +175,8 @@ 0:67 Function Parameters: 0:69 Sequence 0:69 gl_PointSize: direct index for structure ( out float PointSize) -0:69 direct index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:69 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:69 direct index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:69 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) 0:69 Constant: 0:69 4 (const int) 0:69 Constant: @@ -211,7 +211,7 @@ 0:123 'gl_DeviceIndex' ( in int DeviceIndex) 0:124 'gl_ViewIndex' ( in int ViewIndex) 0:? Linker Objects -0:? 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:? 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) 0:? 'outa' ( global 4-element array of int) 0:? 'patchIn' ( patch in 4-component vector of float) 0:? 'patchOut' ( patch out 4-component vector of float) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/400.tese.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/400.tese.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/400.tese.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/400.tese.out 2018-04-27 11:46:26.000000000 +0000 @@ -11,7 +11,7 @@ ERROR: 0:48: 'patch' : cannot use interpolation qualifiers with patch ERROR: 0:49: 'patch' : cannot use interpolation qualifiers with patch ERROR: 0:50: '' : can only have one auxiliary qualifier (centroid, patch, and sample) -ERROR: 0:54: 'gl_PerVertex' : block already declared with size, can't redeclare as implicitly-sized +ERROR: 0:54: 'gl_PerVertex' : block already declared with size, can't redeclare as unsized ERROR: 0:59: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use ERROR: 0:64: 'quads' : cannot apply to 'out' ERROR: 0:64: 'cw' : can only apply to 'in' @@ -57,8 +57,8 @@ 0:32 move second child to first child ( temp 4-component vector of float) 0:32 'p' ( temp 4-component vector of float) 0:32 gl_Position: direct index for structure ( in 4-component vector of float Position) -0:32 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:32 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:32 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:32 Constant: 0:32 1 (const int) 0:32 Constant: @@ -67,8 +67,8 @@ 0:33 move second child to first child ( temp float) 0:33 'ps' ( temp float) 0:33 gl_PointSize: direct index for structure ( in float PointSize) -0:33 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:33 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:33 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:33 Constant: 0:33 1 (const int) 0:33 Constant: @@ -77,9 +77,9 @@ 0:34 move second child to first child ( temp float) 0:34 'cd' ( temp float) 0:34 direct index ( temp float ClipDistance) -0:34 gl_ClipDistance: direct index for structure ( in implicitly-sized array of float ClipDistance) -0:34 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:34 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:34 gl_ClipDistance: direct index for structure ( in unsized 3-element array of float ClipDistance) +0:34 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:34 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:34 Constant: 0:34 1 (const int) 0:34 Constant: @@ -114,20 +114,20 @@ 0:40 1 (const int) 0:42 move second child to first child ( temp 4-component vector of float) 0:42 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) -0:42 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:42 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:42 Constant: 0:42 0 (const uint) 0:42 'p' ( temp 4-component vector of float) 0:43 move second child to first child ( temp float) 0:43 gl_PointSize: direct index for structure ( gl_PointSize float PointSize) -0:43 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:43 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:43 Constant: 0:43 1 (const uint) 0:43 'ps' ( temp float) 0:44 move second child to first child ( temp float) 0:44 direct index ( temp float ClipDistance) -0:44 gl_ClipDistance: direct index for structure ( out implicitly-sized array of float ClipDistance) -0:44 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:44 gl_ClipDistance: direct index for structure ( out unsized 3-element array of float ClipDistance) +0:44 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:44 Constant: 0:44 2 (const uint) 0:44 Constant: @@ -146,7 +146,7 @@ 0:? Linker Objects 0:? 'patchIn' ( patch in 4-component vector of float) 0:? 'patchOut' ( patch out 4-component vector of float) -0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:? 'badp1' ( smooth patch in 4-component vector of float) 0:? 'badp2' ( flat patch in 4-component vector of float) 0:? 'badp3' ( noperspective patch in 4-component vector of float) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/410.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/410.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/410.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/410.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -31,7 +31,7 @@ 0:30 'p' ( temp float) 0:30 gl_PointSize: direct index for structure ( in float PointSize) 0:30 direct index ( temp block{ in float PointSize gl_PointSize}) -0:30 'gl_in' ( in implicitly-sized array of block{ in float PointSize gl_PointSize}) +0:30 'gl_in' ( in unsized 2-element array of block{ in float PointSize gl_PointSize}) 0:30 Constant: 0:30 1 (const int) 0:30 Constant: @@ -53,7 +53,7 @@ 0:38 Constant: 0:38 4.000000 0:? Linker Objects -0:? 'gl_in' ( in implicitly-sized array of block{ in float PointSize gl_PointSize}) +0:? 'gl_in' ( in unsized 2-element array of block{ in float PointSize gl_PointSize}) 0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_PointSize float PointSize gl_PointSize, }) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/410.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/410.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/410.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/410.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -9,7 +9,7 @@ 0:8 Function Definition: main( ( global void) 0:8 Function Parameters: 0:? Linker Objects -0:? 'gl_out' ( out implicitly-sized array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:? 'gl_out' ( out unsized 1-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) 0:? 'outa' ( global 1-element array of int) 0:? 'patchOut' ( patch out 4-component vector of float) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/420.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/420.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/420.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/420.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -19,7 +19,7 @@ 0:? Linker Objects 0:? 'gl_FragDepth' ( gl_FragDepth float FragDepth) 0:? 'depth' ( smooth in float) -0:? 'a' (layout( binding=0 offset=0) uniform implicitly-sized array of atomic_uint) +0:? 'a' (layout( binding=0 offset=0) uniform unsized 1-element array of atomic_uint) Linked fragment stage: diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/420.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/420.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/420.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/420.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -20,15 +20,15 @@ 0:9 Constant: 0:9 1 (const int) 0:10 gl_Position: direct index for structure ( in 4-component vector of float Position) -0:10 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:10 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:10 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:10 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) 0:10 Constant: 0:10 1 (const int) 0:10 Constant: 0:10 0 (const int) 0:11 gl_Position: direct index for structure ( in 4-component vector of float Position) -0:11 indirect index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:11 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:11 indirect index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:11 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) 0:11 'i' ( global int) 0:11 Constant: 0:11 0 (const int) @@ -38,8 +38,8 @@ 0:20 Constant: 0:20 3 (const int) 0:21 gl_Position: direct index for structure ( in 4-component vector of float Position) -0:21 indirect index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:21 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:21 indirect index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:21 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) 0:21 'i' ( global int) 0:21 Constant: 0:21 0 (const int) @@ -121,12 +121,12 @@ 0:54 'i' ( global int) 0:? Linker Objects 0:? 'i' ( global int) -0:? 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:? 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) 0:? 'color3' ( in 3-element array of 4-component vector of float) 0:? 's2D' ( uniform sampler2D) 0:? 'coord' ( in 3-element array of 2-component vector of float) 0:? 'v4' ( uniform 4-component vector of float) -0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out unsized 1-element array of float ClipDistance gl_ClipDistance}) Linked geometry stage: diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/420_size_gl_in.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/420_size_gl_in.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/420_size_gl_in.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/420_size_gl_in.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -15,8 +15,8 @@ 0:13 Constant: 0:13 3 (const int) 0:14 gl_Position: direct index for structure ( in 4-component vector of float Position) -0:14 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:14 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:14 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:14 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) 0:14 Constant: 0:14 1 (const int) 0:14 Constant: @@ -24,8 +24,8 @@ 0:15 Constant: 0:15 3 (const int) 0:16 gl_Position: direct index for structure ( in 4-component vector of float Position) -0:16 indirect index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:16 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:16 indirect index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:16 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) 0:16 'i' ( global int) 0:16 Constant: 0:16 0 (const int) @@ -33,7 +33,7 @@ 0:? 'i' ( global int) 0:? 'colorun' ( in 3-element array of 4-component vector of float) 0:? 'color3' ( in 3-element array of 4-component vector of float) -0:? 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:? 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) Linked geometry stage: diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/420.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/420.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/420.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/420.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -20,8 +20,8 @@ 0:17 move second child to first child ( temp 4-component vector of float) 0:17 'p' ( temp 4-component vector of float) 0:17 gl_Position: direct index for structure ( in 4-component vector of float Position) -0:17 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:17 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:17 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:17 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:17 Constant: 0:17 1 (const int) 0:17 Constant: @@ -30,8 +30,8 @@ 0:18 move second child to first child ( temp float) 0:18 'ps' ( temp float) 0:18 gl_PointSize: direct index for structure ( in float PointSize) -0:18 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:18 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:18 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:18 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:18 Constant: 0:18 1 (const int) 0:18 Constant: @@ -40,9 +40,9 @@ 0:19 move second child to first child ( temp float) 0:19 'cd' ( temp float) 0:19 direct index ( temp float ClipDistance) -0:19 gl_ClipDistance: direct index for structure ( in implicitly-sized array of float ClipDistance) -0:19 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) -0:19 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:19 gl_ClipDistance: direct index for structure ( in unsized 3-element array of float ClipDistance) +0:19 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:19 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) 0:19 Constant: 0:19 1 (const int) 0:19 Constant: diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/420.tese.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/420.tese.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/420.tese.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/420.tese.out 2018-04-27 11:46:26.000000000 +0000 @@ -139,7 +139,7 @@ 0:? 'b3' ( global 2-element array of 4-component vector of float) 0:? 'b4' ( global 2-element array of 4-component vector of float) 0:? 'c3' ( global 4X2 matrix of float) -0:? 'd2' ( global implicitly-sized array of structure{ global float s, global float t}) +0:? 'd2' ( global unsized 1-element array of structure{ global float s, global float t}) 0:? 'b5' ( global 5-element array of float) 0:? 'single1' ( global structure{ global int f}) 0:? 'single2' ( global structure{ global 2-component vector of uint v}) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/420.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/420.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/420.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/420.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -51,7 +51,7 @@ ERROR: 0:157: 'assign' : cannot convert from ' const float' to ' temp int' ERROR: 0:158: 'textureQueryLevels' : no matching overloaded function found ERROR: 0:158: 'assign' : cannot convert from ' const float' to ' temp int' -WARNING: 0:161: '[]' : assuming array size of one for compile-time checking of binding numbers for implicitly-sized array +WARNING: 0:161: '[]' : assuming binding count of one for compile-time checking of binding numbers for unsized array ERROR: 51 compilation errors. No code generated. @@ -302,7 +302,7 @@ 0:? 'offcheckI' (layout( column_major shared) uniform block{layout( column_major shared offset=16) uniform int foo}) 0:? 'samp1D' ( uniform sampler1D) 0:? 'samp1Ds' ( uniform sampler1DShadow) -0:? 'badArray' (layout( binding=0) writeonly uniform implicitly-sized array of image1D) +0:? 'badArray' (layout( binding=0) writeonly uniform unsized 1-element array of image1D) 0:? 'gl_VertexID' ( gl_VertexId int VertexId) 0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/430AofA.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/430AofA.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/430AofA.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/430AofA.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -7,7 +7,7 @@ ERROR: 0:60: 'constructor' : cannot convert parameter 2 from ' const 2-element array of 4-component vector of float' to ' temp 3-element array of 4-component vector of float' ERROR: 0:64: '=' : cannot convert from ' const 3-element array of 2-element array of 4-component vector of float' to ' temp 4-element array of 2-element array of 4-component vector of float' ERROR: 0:70: 'assign' : cannot convert from ' global 4-element array of 7-element array of float' to ' global 5-element array of 7-element array of float' -ERROR: 0:71: 'assign' : cannot convert from ' global 4-element array of 7-element array of float' to ' global implicitly-sized array of 7-element array of float' +ERROR: 0:71: 'assign' : cannot convert from ' global 4-element array of 7-element array of float' to ' global unsized 1-element array of 7-element array of float' ERROR: 0:73: 'foo' : no matching overloaded function found ERROR: 0:78: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type ' global 4-element array of 7-element array of float' and a right operand of type ' global 5-element array of 7-element array of float' (or there is no acceptable conversion) ERROR: 0:84: '[' : array index out of range '5' @@ -335,7 +335,7 @@ 0:69 Function Call: foo(f1[5][7]; ( global 4-element array of 7-element array of float) 0:69 'g5' ( global 5-element array of 7-element array of float) 0:70 'g5' ( global 5-element array of 7-element array of float) -0:71 'gu' ( global implicitly-sized array of 7-element array of float) +0:71 'gu' ( global unsized 1-element array of 7-element array of float) 0:73 Constant: 0:73 0.000000 0:74 Function Call: bar(f1[5][7]; ( global void) @@ -404,8 +404,8 @@ 0:98 0.000000 0:? Linker Objects 0:? 'many' ( global 1-element array of 2-element array of 3-element array of 4-element array of 5-element array of 6-element array of float) -0:? 'gu' ( global implicitly-sized array of 7-element array of float) -0:? 'gimp' ( global implicitly-sized array of implicitly-sized array of float) +0:? 'gu' ( global unsized 1-element array of 7-element array of float) +0:? 'gimp' ( global unsized 1-element array of 1-element array of float) 0:? 'g4' ( global 4-element array of 7-element array of float) 0:? 'g5' ( global 5-element array of 7-element array of float) @@ -768,7 +768,7 @@ 0:? Linker Objects 0:? 'many' ( global 1-element array of 2-element array of 3-element array of 4-element array of 5-element array of 6-element array of float) 0:? 'gu' ( global 1-element array of 7-element array of float) -0:? 'gimp' ( global 1-element array of implicitly-sized array of float) +0:? 'gimp' ( global 1-element array of 1-element array of float) 0:? 'g4' ( global 4-element array of 7-element array of float) 0:? 'g5' ( global 5-element array of 7-element array of float) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/430.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/430.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/430.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/430.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -33,13 +33,13 @@ 0:35 GroupMemoryBarrier ( global void) 0:36 move second child to first child ( temp int) 0:36 value: direct index for structure (layout( column_major shared) buffer int) -0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer implicitly-sized array of float values}) +0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer runtime-sized array of float values}) 0:36 Constant: 0:36 0 (const uint) 0:36 Convert float to int ( temp int) 0:36 indirect index (layout( column_major shared) temp float) -0:36 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of float) -0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer implicitly-sized array of float values}) +0:36 values: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer runtime-sized array of float values}) 0:36 Constant: 0:36 1 (const uint) 0:36 'gl_LocalInvocationIndex' ( in uint LocalInvocationIndex) @@ -56,8 +56,8 @@ 0:65 Sequence 0:65 move second child to first child ( temp float) 0:65 direct index (layout( column_major shared) temp float) -0:65 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of float) -0:65 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer implicitly-sized array of float values}) +0:65 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of float) +0:65 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer unsized 3-element array of float values}) 0:65 Constant: 0:65 1 (const int) 0:65 Constant: @@ -65,8 +65,8 @@ 0:65 Constant: 0:65 4.700000 0:66 array length ( temp int) -0:66 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of float) -0:66 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer implicitly-sized array of float values}) +0:66 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of float) +0:66 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer unsized 3-element array of float values}) 0:66 Constant: 0:66 1 (const int) 0:67 Barrier ( global void) @@ -129,8 +129,8 @@ 0:? 4096 (const uint) 0:? 'total' ( const int) 0:? 66592 (const int) -0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer implicitly-sized array of float values}) -0:? 'invalid' (layout( column_major shared) buffer block{layout( column_major shared) buffer implicitly-sized array of float values, layout( column_major shared) buffer int value}) +0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer runtime-sized array of float values}) +0:? 'invalid' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 1-element array of float values, layout( column_major shared) buffer int value}) 0:? 'v3' (layout( location=2) in 3-component vector of float) 0:? 'f' ( in float) 0:? 'fo' ( out float) @@ -140,7 +140,7 @@ 0:? 'arrX' ( global 2-element array of int) 0:? 'arrY' ( global 1-element array of int) 0:? 'arrZ' ( global 4096-element array of int) -0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer implicitly-sized array of float values}) +0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer unsized 3-element array of float values}) 0:? 'roll' ( uniform double) 0:? 'destTex' ( writeonly uniform image2D) 0:? 'inbi' ( in block{ in int a}) @@ -165,13 +165,13 @@ 0:35 GroupMemoryBarrier ( global void) 0:36 move second child to first child ( temp int) 0:36 value: direct index for structure (layout( column_major shared) buffer int) -0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer implicitly-sized array of float values}) +0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer runtime-sized array of float values}) 0:36 Constant: 0:36 0 (const uint) 0:36 Convert float to int ( temp int) 0:36 indirect index (layout( column_major shared) temp float) -0:36 values: direct index for structure (layout( column_major shared) buffer implicitly-sized array of float) -0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer implicitly-sized array of float values}) +0:36 values: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer runtime-sized array of float values}) 0:36 Constant: 0:36 1 (const uint) 0:36 'gl_LocalInvocationIndex' ( in uint LocalInvocationIndex) @@ -190,8 +190,8 @@ 0:? 4096 (const uint) 0:? 'total' ( const int) 0:? 66592 (const int) -0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer implicitly-sized array of float values}) -0:? 'invalid' (layout( column_major shared) buffer block{layout( column_major shared) buffer implicitly-sized array of float values, layout( column_major shared) buffer int value}) +0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer runtime-sized array of float values}) +0:? 'invalid' (layout( column_major shared) buffer block{layout( column_major shared) buffer 1-element array of float values, layout( column_major shared) buffer int value}) 0:? 'v3' (layout( location=2) in 3-component vector of float) 0:? 'f' ( in float) 0:? 'fo' ( out float) @@ -201,7 +201,7 @@ 0:? 'arrX' ( global 2-element array of int) 0:? 'arrY' ( global 1-element array of int) 0:? 'arrZ' ( global 4096-element array of int) -0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer implicitly-sized array of float values}) +0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer unsized 3-element array of float values}) 0:? 'roll' ( uniform double) 0:? 'destTex' ( writeonly uniform image2D) 0:? 'inbi' ( in block{ in int a}) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/430scope.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/430scope.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/430scope.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/430scope.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -63,7 +63,7 @@ 0:47 3.000000 0:49 move second child to first child ( temp 4-component vector of float) 0:49 gl_Position: direct index for structure ( invariant gl_Position 4-component vector of float Position) -0:49 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:49 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) 0:49 Constant: 0:49 0 (const uint) 0:49 Construct vec4 ( temp 4-component vector of float) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/440.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/440.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/440.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/440.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -46,51 +46,54 @@ ERROR: 0:169: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4 ERROR: 0:169: 'xfb_stride' : 1/4 stride is too large: gl_MaxTransformFeedbackInterleavedComponents is 64 ERROR: 0:171: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4 -ERROR: 0:179: 'gl_BaseVertexARB' : required extension not requested: GL_ARB_shader_draw_parameters -ERROR: 0:179: 'gl_BaseInstanceARB' : required extension not requested: GL_ARB_shader_draw_parameters -ERROR: 0:179: 'gl_DrawIDARB' : required extension not requested: GL_ARB_shader_draw_parameters -ERROR: 0:187: 'assign' : l-value required "gl_BaseVertexARB" (can't modify shader input) -ERROR: 0:188: 'assign' : l-value required "gl_BaseInstanceARB" (can't modify shader input) -ERROR: 0:189: 'assign' : l-value required "gl_DrawIDARB" (can't modify shader input) -ERROR: 0:190: 'glBaseInstanceARB' : undeclared identifier -ERROR: 54 compilation errors. No code generated. +ERROR: 0:178: 'xfb_offset' : overlapping offsets at offset 36 in buffer 3 +ERROR: 0:179: 'xfb_buffer' : member cannot contradict block (or what block inherited from global) +ERROR: 0:178: 'xfb_offset' : overlapping offsets at offset 32 in buffer 3 +ERROR: 0:185: 'gl_BaseVertexARB' : required extension not requested: GL_ARB_shader_draw_parameters +ERROR: 0:185: 'gl_BaseInstanceARB' : required extension not requested: GL_ARB_shader_draw_parameters +ERROR: 0:185: 'gl_DrawIDARB' : required extension not requested: GL_ARB_shader_draw_parameters +ERROR: 0:193: 'assign' : l-value required "gl_BaseVertexARB" (can't modify shader input) +ERROR: 0:194: 'assign' : l-value required "gl_BaseInstanceARB" (can't modify shader input) +ERROR: 0:195: 'assign' : l-value required "gl_DrawIDARB" (can't modify shader input) +ERROR: 0:196: 'glBaseInstanceARB' : undeclared identifier +ERROR: 57 compilation errors. No code generated. Shader version: 440 Requested GL_ARB_shader_draw_parameters in xfb mode ERROR: node is still EOpNull! -0:177 Function Definition: drawParamsBad( ( global int) -0:177 Function Parameters: -0:179 Sequence -0:179 Branch: Return with expression -0:179 add ( temp int) -0:179 add ( temp int) -0:179 'gl_BaseVertexARB' ( in int BaseVertex) -0:179 'gl_BaseInstanceARB' ( in int BaseInstance) -0:179 'gl_DrawIDARB' ( in int DrawId) -0:184 Function Definition: drawParams( ( global int) -0:184 Function Parameters: -0:186 Sequence -0:186 Branch: Return with expression -0:186 add ( temp int) -0:186 add ( temp int) -0:186 'gl_BaseVertexARB' ( in int BaseVertex) -0:186 'gl_BaseInstanceARB' ( in int BaseInstance) -0:186 'gl_DrawIDARB' ( in int DrawId) -0:187 move second child to first child ( temp int) -0:187 'gl_BaseVertexARB' ( in int BaseVertex) -0:187 Constant: -0:187 3 (const int) -0:188 move second child to first child ( temp int) -0:188 'gl_BaseInstanceARB' ( in int BaseInstance) -0:188 Constant: -0:188 3 (const int) -0:189 move second child to first child ( temp int) -0:189 'gl_DrawIDARB' ( in int DrawId) -0:189 Constant: -0:189 3 (const int) -0:190 'glBaseInstanceARB' ( temp float) +0:183 Function Definition: drawParamsBad( ( global int) +0:183 Function Parameters: +0:185 Sequence +0:185 Branch: Return with expression +0:185 add ( temp int) +0:185 add ( temp int) +0:185 'gl_BaseVertexARB' ( in int BaseVertex) +0:185 'gl_BaseInstanceARB' ( in int BaseInstance) +0:185 'gl_DrawIDARB' ( in int DrawId) +0:190 Function Definition: drawParams( ( global int) +0:190 Function Parameters: +0:192 Sequence +0:192 Branch: Return with expression +0:192 add ( temp int) +0:192 add ( temp int) +0:192 'gl_BaseVertexARB' ( in int BaseVertex) +0:192 'gl_BaseInstanceARB' ( in int BaseInstance) +0:192 'gl_DrawIDARB' ( in int DrawId) +0:193 move second child to first child ( temp int) +0:193 'gl_BaseVertexARB' ( in int BaseVertex) +0:193 Constant: +0:193 3 (const int) +0:194 move second child to first child ( temp int) +0:194 'gl_BaseInstanceARB' ( in int BaseInstance) +0:194 Constant: +0:194 3 (const int) +0:195 move second child to first child ( temp int) +0:195 'gl_DrawIDARB' ( in int DrawId) +0:195 Constant: +0:195 3 (const int) +0:196 'glBaseInstanceARB' ( temp float) 0:? Linker Objects 0:? 'a' (layout( location=2 component=2) in 2-component vector of float) 0:? 'b' (layout( location=2 component=1) in float) @@ -153,6 +156,7 @@ 0:? 'bbinst9' ( out block{layout( xfb_buffer=4 xfb_offset=1) out bool b, layout( xfb_buffer=4 xfb_offset=12) out structure{ global bool b, global structure{ global int i, global double d, global float f} s, global 2-component vector of float v2} t, layout( xfb_buffer=4 xfb_offset=52) out 3X3 matrix of float m3, layout( xfb_buffer=4 xfb_offset=90) out int i, layout( xfb_buffer=4 xfb_offset=98) out double d, layout( xfb_buffer=4 xfb_offset=108) out structure{ global int a} s}) 0:? 'bm' (layout( xfb_buffer=5 xfb_offset=0) smooth out float) 0:? 'bbinst10' ( out block{layout( xfb_buffer=7 xfb_offset=0) out 4X4 matrix of double m1, layout( xfb_buffer=7 xfb_offset=128) out 4X4 matrix of double m2, layout( xfb_buffer=7 xfb_offset=256) out float f}) +0:? 'anon@0' ( out block{layout( xfb_buffer=3 xfb_offset=36) gl_Position 4-component vector of float Position gl_Position, layout( xfb_buffer=3 xfb_offset=32) gl_PointSize float PointSize gl_PointSize, }) 0:? 'gl_VertexID' ( gl_VertexId int VertexId) 0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) @@ -235,6 +239,7 @@ 0:? 'bbinst9' ( out block{layout( xfb_buffer=4 xfb_offset=1) out bool b, layout( xfb_buffer=4 xfb_offset=12) out structure{ global bool b, global structure{ global int i, global double d, global float f} s, global 2-component vector of float v2} t, layout( xfb_buffer=4 xfb_offset=52) out 3X3 matrix of float m3, layout( xfb_buffer=4 xfb_offset=90) out int i, layout( xfb_buffer=4 xfb_offset=98) out double d, layout( xfb_buffer=4 xfb_offset=108) out structure{ global int a} s}) 0:? 'bm' (layout( xfb_buffer=5 xfb_offset=0) smooth out float) 0:? 'bbinst10' ( out block{layout( xfb_buffer=7 xfb_offset=0) out 4X4 matrix of double m1, layout( xfb_buffer=7 xfb_offset=128) out 4X4 matrix of double m2, layout( xfb_buffer=7 xfb_offset=256) out float f}) +0:? 'anon@0' ( out block{layout( xfb_buffer=3 xfb_offset=36) gl_Position 4-component vector of float Position gl_Position, layout( xfb_buffer=3 xfb_offset=32) gl_PointSize float PointSize gl_PointSize, }) 0:? 'gl_VertexID' ( gl_VertexId int VertexId) 0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/450.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/450.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/450.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/450.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -19,7 +19,9 @@ ERROR: 0:45: 'allInvocations' : no matching overloaded function found ERROR: 0:46: 'allInvocationsEqual' : no matching overloaded function found ERROR: 0:48: 'extraneous semicolon' : not supported for this version or the enabled extensions -ERROR: 20 compilation errors. No code generated. +ERROR: 0:50: 'location' : cannot apply to uniform or buffer block +ERROR: 0:54: 'location' : cannot apply to uniform or buffer block +ERROR: 22 compilation errors. No code generated. Shader version: 450 @@ -77,6 +79,8 @@ 0:? 'outSS' ( smooth out structure{ global float f, global structure{ global float f} s}) 0:? 'aui' (layout( binding=0 offset=0) uniform atomic_uint) 0:? 'ui' ( global uint) +0:? 'anon@1' (layout( location=0 column_major shared) uniform block{layout( column_major shared) uniform int a}) +0:? 'anon@2' (layout( location=0 column_major shared) buffer block{layout( column_major shared) buffer int b}) 0:? 'gl_VertexID' ( gl_VertexId int VertexId) 0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) @@ -112,6 +116,8 @@ 0:? 'outSS' ( smooth out structure{ global float f, global structure{ global float f} s}) 0:? 'aui' (layout( binding=0 offset=0) uniform atomic_uint) 0:? 'ui' ( global uint) +0:? 'anon@1' (layout( location=0 column_major shared) uniform block{layout( column_major shared) uniform int a}) +0:? 'anon@2' (layout( location=0 column_major shared) buffer block{layout( column_major shared) buffer int b}) 0:? 'gl_VertexID' ( gl_VertexId int VertexId) 0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/460.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/460.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/460.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/460.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,14 @@ 460.frag +ERROR: 0:22: 'attribute' : required extension not requested: GL_EXT_control_flow_attributes +ERROR: 0:23: 'attribute' : required extension not requested: GL_EXT_control_flow_attributes +ERROR: 0:30: 'dependency_length' : must be positive +ERROR: 0:31: 'dependency_length' : must be positive +ERROR: 4 compilation errors. No code generated. + + Shader version: 460 -0:? Sequence +Requested GL_EXT_control_flow_attributes +ERROR: node is still EOpNull! 0:10 Function Definition: main( ( global void) 0:10 Function Parameters: 0:12 Sequence @@ -21,6 +29,43 @@ 0:16 'b1' ( temp bool) 0:16 allInvocationsEqual ( global bool) 0:16 'b1' ( temp bool) +0:19 Function Definition: attExtBad( ( global void) +0:19 Function Parameters: +0:22 Sequence +0:22 Sequence +0:22 Sequence +0:22 move second child to first child ( temp int) +0:22 'i' ( temp int) +0:22 Constant: +0:22 0 (const int) +0:22 Loop with condition tested first: Dependency 4 +0:22 Loop Condition +0:22 Compare Less Than ( temp bool) +0:22 'i' ( temp int) +0:22 Constant: +0:22 8 (const int) +0:22 No loop body +0:22 Loop Terminal Expression +0:22 Pre-Increment ( temp int) +0:22 'i' ( temp int) +0:23 Test condition and select ( temp void): Flatten +0:23 Condition +0:23 Constant: +0:23 true (const bool) +0:23 true case is null +0:28 Function Definition: attExt( ( global void) +0:28 Function Parameters: +0:30 Sequence +0:30 Loop with condition not tested first: Dependency -3 +0:30 Loop Condition +0:30 Constant: +0:30 true (const bool) +0:30 No loop body +0:31 Loop with condition not tested first +0:31 Loop Condition +0:31 Constant: +0:31 true (const bool) +0:31 No loop body 0:? Linker Objects 0:? 's' ( smooth in structure{ global float f, global 4-component vector of float v}) @@ -29,7 +74,8 @@ Shader version: 460 -0:? Sequence +Requested GL_EXT_control_flow_attributes +ERROR: node is still EOpNull! 0:10 Function Definition: main( ( global void) 0:10 Function Parameters: 0:12 Sequence diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/array100.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/array100.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/array100.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/array100.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -10,7 +10,7 @@ ERROR: 0:25: 'array assignment' : not supported for this version or the enabled extensions ERROR: 0:25: 'assign' : cannot convert from ' global 4-element array of mediump float' to ' global 5-element array of mediump float' ERROR: 0:26: 'array assignment' : not supported for this version or the enabled extensions -ERROR: 0:26: 'assign' : cannot convert from ' global 4-element array of mediump float' to ' global implicitly-sized array of mediump float' +ERROR: 0:26: 'assign' : cannot convert from ' global 4-element array of mediump float' to ' global unsized 1-element array of mediump float' ERROR: 0:28: 'foo' : no matching overloaded function found ERROR: 0:31: 'arrayed constructor' : not supported for this version or the enabled extensions ERROR: 0:31: 'array comparison' : not supported for this version or the enabled extensions @@ -67,7 +67,7 @@ 0:24 Function Call: foo(f1[5]; ( global 4-element array of mediump float) 0:24 'g5' ( global 5-element array of mediump float) 0:25 'g5' ( global 5-element array of mediump float) -0:26 'gu' ( global implicitly-sized array of mediump float) +0:26 'gu' ( global unsized 1-element array of mediump float) 0:28 Constant: 0:28 0.000000 0:29 Function Call: bar(f1[5]; ( global void) @@ -84,7 +84,7 @@ 0:31 true case 0:32 move second child to first child ( temp mediump float) 0:32 direct index ( temp mediump float) -0:32 'gu' ( global implicitly-sized array of mediump float) +0:32 'gu' ( global unsized 1-element array of mediump float) 0:32 Constant: 0:32 0 (const int) 0:32 Constant: @@ -152,7 +152,7 @@ 0:69 'initSb' ( temp structure{ global mediump 4-component vector of float v4, global structure{ global mediump 3-component vector of float v3, global 4-element array of mediump 2-component vector of float v2} sa}) 0:69 's1' ( temp structure{ global mediump 4-component vector of float v4, global structure{ global mediump 3-component vector of float v3, global 4-element array of mediump 2-component vector of float v2} sa}) 0:? Linker Objects -0:? 'gu' ( global implicitly-sized array of mediump float) +0:? 'gu' ( global unsized 1-element array of mediump float) 0:? 'g4' ( global 4-element array of mediump float) 0:? 'g5' ( global 5-element array of mediump float) 0:? 'a' ( uniform mediump int) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/array.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/array.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/array.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/array.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -2,7 +2,7 @@ ERROR: 0:21: '[' : array index out of range '2' ERROR: 0:27: '[' : array must be redeclared with a size before being indexed with a variable ERROR: 0:30: 'assign' : cannot convert from ' global 4-element array of float' to ' global 5-element array of float' -ERROR: 0:31: 'assign' : cannot convert from ' global 4-element array of float' to ' global implicitly-sized array of float' +ERROR: 0:31: 'assign' : cannot convert from ' global 4-element array of float' to ' global runtime-sized array of float' ERROR: 0:33: 'foo' : no matching overloaded function found ERROR: 0:42: '[' : array index out of range '5' ERROR: 0:45: '[' : array index out of range '1000' @@ -23,9 +23,11 @@ ERROR: 0:93: 'length' : array must be declared with a size before using this method ERROR: 0:101: '[' : array index out of range '5' ERROR: 0:104: 'constructor' : array constructor must have at least one argument -ERROR: 0:104: '=' : cannot convert from ' const float' to ' global implicitly-sized array of int' +ERROR: 0:104: '=' : cannot convert from ' const float' to ' global unsized 1-element array of int' ERROR: 0:106: 'constructor' : array argument must be sized -ERROR: 26 compilation errors. No code generated. +ERROR: 0:111: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier +ERROR: 0:111: 'variable indexing sampler array' : not supported with this profile: none +ERROR: 28 compilation errors. No code generated. Shader version: 130 @@ -68,21 +70,21 @@ 0:21 4.000000 0:24 move second child to first child ( temp float) 0:24 direct index ( temp float) -0:24 'gu' ( global implicitly-sized array of float) +0:24 'gu' ( global runtime-sized array of float) 0:24 Constant: 0:24 2 (const int) 0:24 Constant: 0:24 4.000000 0:26 move second child to first child ( temp float) 0:26 direct index ( temp float) -0:26 'gu' ( global implicitly-sized array of float) +0:26 'gu' ( global runtime-sized array of float) 0:26 Constant: 0:26 3 (const int) 0:26 Constant: 0:26 3.000000 0:27 move second child to first child ( temp float) 0:27 indirect index ( temp float) -0:27 'gu' ( global implicitly-sized array of float) +0:27 'gu' ( global runtime-sized array of float) 0:27 'a' ( uniform int) 0:27 Constant: 0:27 5.000000 @@ -91,7 +93,7 @@ 0:29 Function Call: foo(f1[5]; ( global 4-element array of float) 0:29 'g5' ( global 5-element array of float) 0:30 'g5' ( global 5-element array of float) -0:31 'gu' ( global implicitly-sized array of float) +0:31 'gu' ( global runtime-sized array of float) 0:33 Constant: 0:33 0.000000 0:34 Function Call: bar(f1[5]; ( global void) @@ -108,7 +110,7 @@ 0:36 true case 0:37 move second child to first child ( temp float) 0:37 direct index ( temp float) -0:37 'gu' ( global implicitly-sized array of float) +0:37 'gu' ( global runtime-sized array of float) 0:37 Constant: 0:37 0 (const int) 0:37 Constant: @@ -199,21 +201,21 @@ 0:? Sequence 0:71 move second child to first child ( temp int) 0:71 direct index ( temp int) -0:71 'uns' ( temp implicitly-sized array of int) +0:71 'uns' ( temp unsized 4-element array of int) 0:71 Constant: 0:71 3 (const int) 0:71 Constant: 0:71 40 (const int) 0:72 move second child to first child ( temp int) 0:72 direct index ( temp int) -0:72 'uns' ( temp implicitly-sized array of int) +0:72 'uns' ( temp unsized 4-element array of int) 0:72 Constant: 0:72 1 (const int) 0:72 Constant: 0:72 30 (const int) 0:73 move second child to first child ( temp 3-component vector of float) 0:73 direct index ( temp 3-component vector of float) -0:73 'guns' ( global implicitly-sized array of 3-component vector of float) +0:73 'guns' ( global unsized 8-element array of 3-component vector of float) 0:73 Constant: 0:73 2 (const int) 0:73 Constant: @@ -222,11 +224,11 @@ 0:73 2.400000 0:76 Constant: 0:76 0.000000 -0:79 Function Definition: foo2( ( global implicitly-sized array of float) +0:79 Function Definition: foo2( ( global unsized 1-element array of float) 0:79 Function Parameters: 0:? Sequence 0:82 Branch: Return with expression -0:82 'f' ( temp implicitly-sized array of float) +0:82 'f' ( temp unsized 1-element array of float) 0:84 Branch: Return with expression 0:84 'g' ( temp 9-element array of float) 0:89 Function Definition: foo3( ( global void) @@ -264,17 +266,24 @@ 0:106 'b' ( global float) 0:106 Constant: 0:106 0.000000 +0:109 Function Definition: foo4( ( global void) +0:109 Function Parameters: +0:111 Sequence +0:111 indirect index ( temp sampler2D) +0:111 's2d' ( uniform runtime-sized array of sampler2D) +0:111 'a' ( uniform int) 0:? Linker Objects -0:? 'gu' ( global implicitly-sized array of float) +0:? 'gu' ( global runtime-sized array of float) 0:? 'g4' ( global 4-element array of float) 0:? 'g5' ( global 5-element array of float) 0:? 'a' ( uniform int) -0:? 'guns' ( global implicitly-sized array of 3-component vector of float) +0:? 'guns' ( global unsized 8-element array of 3-component vector of float) 0:? 'f' ( global float) -0:? 'gUnusedUnsized' ( global implicitly-sized array of float) -0:? 'i' ( global implicitly-sized array of int) -0:? 'emptyA' ( global implicitly-sized array of float) +0:? 'gUnusedUnsized' ( global unsized 1-element array of float) +0:? 'i' ( global unsized 1-element array of int) +0:? 'emptyA' ( global unsized 1-element array of float) 0:? 'b' ( global float) +0:? 's2d' ( uniform runtime-sized array of sampler2D) Linked fragment stage: @@ -320,21 +329,21 @@ 0:21 4.000000 0:24 move second child to first child ( temp float) 0:24 direct index ( temp float) -0:24 'gu' ( global 4-element array of float) +0:24 'gu' ( global runtime-sized array of float) 0:24 Constant: 0:24 2 (const int) 0:24 Constant: 0:24 4.000000 0:26 move second child to first child ( temp float) 0:26 direct index ( temp float) -0:26 'gu' ( global 4-element array of float) +0:26 'gu' ( global runtime-sized array of float) 0:26 Constant: 0:26 3 (const int) 0:26 Constant: 0:26 3.000000 0:27 move second child to first child ( temp float) 0:27 indirect index ( temp float) -0:27 'gu' ( global 4-element array of float) +0:27 'gu' ( global runtime-sized array of float) 0:27 'a' ( uniform int) 0:27 Constant: 0:27 5.000000 @@ -343,7 +352,7 @@ 0:29 Function Call: foo(f1[5]; ( global 4-element array of float) 0:29 'g5' ( global 5-element array of float) 0:30 'g5' ( global 5-element array of float) -0:31 'gu' ( global 4-element array of float) +0:31 'gu' ( global runtime-sized array of float) 0:33 Constant: 0:33 0.000000 0:34 Function Call: bar(f1[5]; ( global void) @@ -360,7 +369,7 @@ 0:36 true case 0:37 move second child to first child ( temp float) 0:37 direct index ( temp float) -0:37 'gu' ( global 4-element array of float) +0:37 'gu' ( global runtime-sized array of float) 0:37 Constant: 0:37 0 (const int) 0:37 Constant: @@ -452,7 +461,7 @@ 0:106 Constant: 0:106 0.000000 0:? Linker Objects -0:? 'gu' ( global 4-element array of float) +0:? 'gu' ( global runtime-sized array of float) 0:? 'g4' ( global 4-element array of float) 0:? 'g5' ( global 5-element array of float) 0:? 'a' ( uniform int) @@ -462,4 +471,5 @@ 0:? 'i' ( global 1-element array of int) 0:? 'emptyA' ( global 1-element array of float) 0:? 'b' ( global float) +0:? 's2d' ( uniform runtime-sized array of sampler2D) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/atomic_uint.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/atomic_uint.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/atomic_uint.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/atomic_uint.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -2,7 +2,6 @@ ERROR: 0:10: 'atomic_uint' : samplers and atomic_uints cannot be output parameters ERROR: 0:12: 'return' : type does not match, or is not convertible to, the function's return type ERROR: 0:18: 'atomic_uint' : atomic_uints can only be used in uniform variables or function parameters: non_uniform_counter -ERROR: 0:18: 'atomic_uint' : layout(binding=X) is required ERROR: 0:23: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings ERROR: 0:28: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( binding=0 offset=0) uniform atomic_uint' and a right operand of type 'layout( binding=0 offset=0) uniform atomic_uint' (or there is no acceptable conversion) ERROR: 0:29: '-' : wrong operand type no operation '-' exists that takes an operand of type layout( binding=0 offset=0) uniform atomic_uint (or there is no acceptable conversion) @@ -10,14 +9,10 @@ ERROR: 0:34: 'assign' : l-value required "counter" (can't modify a uniform) ERROR: 0:34: 'assign' : cannot convert from ' const int' to 'layout( binding=0 offset=0) uniform atomic_uint' ERROR: 0:37: 'atomic_uint' : atomic_uints can only be used in uniform variables or function parameters: acin -ERROR: 0:37: 'atomic_uint' : layout(binding=X) is required ERROR: 0:38: 'atomic_uint' : atomic_uints can only be used in uniform variables or function parameters: acg -ERROR: 0:38: 'atomic_uint' : layout(binding=X) is required -ERROR: 0:40: 'atomic_uint' : layout(binding=X) is required -ERROR: 0:46: 'atomic_uint' : layout(binding=X) is required ERROR: 0:47: 'offset' : atomic counters sharing the same offset: 12 ERROR: 0:48: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings -ERROR: 18 compilation errors. No code generated. +ERROR: 13 compilation errors. No code generated. Shader version: 420 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/constFoldIntMin.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/constFoldIntMin.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/constFoldIntMin.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/constFoldIntMin.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -10,7 +10,7 @@ 0:6 move second child to first child ( temp int16_t) 0:6 'u' ( temp int16_t) 0:6 Constant: -0:6 32768 (const int) +0:6 -32768 (const int16_t) 0:7 Sequence 0:7 move second child to first child ( temp int) 0:7 'v' ( temp int) @@ -25,7 +25,7 @@ 0:9 move second child to first child ( temp int16_t) 0:9 'x' ( temp int16_t) 0:9 Constant: -0:9 0 (const int) +0:9 0 (const int8_t) 0:10 Sequence 0:10 move second child to first child ( temp int) 0:10 'y' ( temp int) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/cppBad.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/cppBad.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/cppBad.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/cppBad.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -2,10 +2,9 @@ ERROR: 0:2: 'preprocessor evaluation' : bad expression ERROR: 0:2: '#if' : unexpected tokens following directive ERROR: 0:5: 'string' : End of line in string -ERROR: 0:5: 'macro expansion' : expected '(' following n ERROR: 0:5: '""' : string literals not supported ERROR: 0:5: '' : syntax error, unexpected INT, expecting COMMA or SEMICOLON -ERROR: 6 compilation errors. No code generated. +ERROR: 5 compilation errors. No code generated. Shader version: 100 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/cppPassMacroName.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/cppPassMacroName.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/cppPassMacroName.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/cppPassMacroName.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,67 @@ +cppPassMacroName.frag +Shader version: 100 +0:? Sequence +0:5 Function Definition: main( ( global void) +0:5 Function Parameters: +0:7 Sequence +0:7 Sequence +0:7 move second child to first child ( temp mediump int) +0:7 'f1' ( temp mediump int) +0:7 Constant: +0:7 4 (const int) +0:8 Sequence +0:8 move second child to first child ( temp mediump int) +0:8 'f2' ( temp mediump int) +0:8 'f1' ( temp mediump int) +0:9 Sequence +0:9 move second child to first child ( temp mediump int) +0:9 'f3' ( temp mediump int) +0:9 Constant: +0:9 9 (const int) +0:10 Sequence +0:10 move second child to first child ( temp mediump int) +0:10 'f4' ( temp mediump int) +0:10 Constant: +0:10 1 (const int) +0:11 Sequence +0:11 move second child to first child ( temp mediump int) +0:11 'f5' ( temp mediump int) +0:11 Constant: +0:11 5 (const int) +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 100 +0:? Sequence +0:5 Function Definition: main( ( global void) +0:5 Function Parameters: +0:7 Sequence +0:7 Sequence +0:7 move second child to first child ( temp mediump int) +0:7 'f1' ( temp mediump int) +0:7 Constant: +0:7 4 (const int) +0:8 Sequence +0:8 move second child to first child ( temp mediump int) +0:8 'f2' ( temp mediump int) +0:8 'f1' ( temp mediump int) +0:9 Sequence +0:9 move second child to first child ( temp mediump int) +0:9 'f3' ( temp mediump int) +0:9 Constant: +0:9 9 (const int) +0:10 Sequence +0:10 move second child to first child ( temp mediump int) +0:10 'f4' ( temp mediump int) +0:10 Constant: +0:10 1 (const int) +0:11 Sequence +0:11 move second child to first child ( temp mediump int) +0:11 'f5' ( temp mediump int) +0:11 Constant: +0:11 5 (const int) +0:? Linker Objects + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/cppRelaxSkipTokensErrors.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/cppRelaxSkipTokensErrors.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/cppRelaxSkipTokensErrors.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/cppRelaxSkipTokensErrors.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,14 @@ +cppRelaxSkipTokensErrors.vert +Shader version: 110 +0:? Sequence +0:? Linker Objects + + +Linked vertex stage: + +ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point + +Shader version: 110 +0:? Sequence +0:? Linker Objects + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/cppSimple.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/cppSimple.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/cppSimple.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/cppSimple.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -75,10 +75,8 @@ ERROR: 12:20055: '#error' : good evaluation 2 ERROR: 12:9000: 'preprocessor evaluation' : expected ')' ERROR: 12:9002: '#if' : unexpected tokens following directive -ERROR: 12:9014: 'macro expansion' : expected '(' following FOOOM ERROR: 12:9014: 'FOOOM' : undeclared identifier ERROR: 12:9014: '=' : cannot convert from ' temp float' to ' global int' -ERROR: 12:9015: 'macro expansion' : expected '(' following FOOOM ERROR: 12:9016: 'preprocessor evaluation' : can't evaluate expression ERROR: 12:9016: 'preprocessor evaluation' : bad expression ERROR: 12:9500: 'preprocessor evaluation' : bad expression @@ -93,7 +91,7 @@ ERROR: 12:9602: 'defined' : cannot use in preprocessor expression when expanded from macros ERROR: 12:9603: '#error' : DEF_DEFINED then ERROR: 12:10002: '' : missing #endif -ERROR: 90 compilation errors. No code generated. +ERROR: 88 compilation errors. No code generated. Shader version: 400 @@ -136,7 +134,7 @@ 0:65 0.050000 0:69 move second child to first child ( temp 4-component vector of float) 0:69 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) -0:69 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:69 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) 0:69 Constant: 0:69 0 (const uint) 0:69 Construct vec4 ( temp 4-component vector of float) @@ -176,7 +174,7 @@ 12:20033 Sequence 12:20033 move second child to first child ( temp 4-component vector of float) 12:20033 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) -12:20033 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +12:20033 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) 12:20033 Constant: 12:20033 0 (const uint) 12:20033 Constant: @@ -190,7 +188,7 @@ 12:9011 'RECURSE' ( global int) 0:? Linker Objects 0:? 'sum' ( global float) -0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) 0:? 'linenumber' ( global int) 0:? 'filenumber' ( global int) 0:? 'version' ( global int) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/findFunction.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/findFunction.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/findFunction.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/findFunction.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,233 @@ +findFunction.frag +ERROR: 0:39: 'func' : ambiguous best function under implicit type conversion +ERROR: 0:40: 'func' : no matching overloaded function found +ERROR: 0:40: '=' : cannot convert from ' const float' to ' temp int64_t' +ERROR: 0:41: 'func' : no matching overloaded function found +ERROR: 0:41: '=' : cannot convert from ' const float' to ' temp int64_t' +ERROR: 0:44: 'func' : no matching overloaded function found +ERROR: 0:44: '=' : cannot convert from ' const float' to ' temp int64_t' +ERROR: 0:45: 'func' : ambiguous best function under implicit type conversion +ERROR: 8 compilation errors. No code generated. + + +Shader version: 450 +Requested GL_KHX_shader_explicit_arithmetic_types +ERROR: node is still EOpNull! +0:5 Function Definition: func(i81;i161;i161; ( global int64_t) +0:5 Function Parameters: +0:5 'a' ( in int8_t) +0:5 'b' ( in int16_t) +0:5 'c' ( in int16_t) +0:7 Sequence +0:7 Branch: Return with expression +0:7 Convert int16_t to int64 ( temp int64_t) +0:7 inclusive-or ( temp int16_t) +0:7 Convert int8_t to int16_t ( temp int16_t) +0:7 'a' ( in int8_t) +0:7 add ( temp int16_t) +0:7 'b' ( in int16_t) +0:7 'c' ( in int16_t) +0:10 Function Definition: func(i81;i161;i1; ( global int64_t) +0:10 Function Parameters: +0:10 'a' ( in int8_t) +0:10 'b' ( in int16_t) +0:10 'c' ( in int) +0:12 Sequence +0:12 Branch: Return with expression +0:12 Convert int to int64 ( temp int64_t) +0:12 inclusive-or ( temp int) +0:12 Convert int8_t to int ( temp int) +0:12 'a' ( in int8_t) +0:12 subtract ( temp int) +0:12 Convert int16_t to int ( temp int) +0:12 'b' ( in int16_t) +0:12 'c' ( in int) +0:15 Function Definition: func(i1;i1;i1; ( global int64_t) +0:15 Function Parameters: +0:15 'a' ( in int) +0:15 'b' ( in int) +0:15 'c' ( in int) +0:17 Sequence +0:17 Branch: Return with expression +0:17 Convert int to int64 ( temp int64_t) +0:17 add ( temp int) +0:17 divide ( temp int) +0:17 'a' ( in int) +0:17 'b' ( in int) +0:17 'c' ( in int) +0:20 Function Definition: func(f161;f161;f1; ( global int64_t) +0:20 Function Parameters: +0:20 'a' ( in float16_t) +0:20 'b' ( in float16_t) +0:20 'c' ( in float) +0:22 Sequence +0:22 Branch: Return with expression +0:22 Convert float to int64 ( temp int64_t) +0:22 subtract ( temp float) +0:22 Convert float16_t to float ( temp float) +0:22 'a' ( in float16_t) +0:22 component-wise multiply ( temp float) +0:22 Convert float16_t to float ( temp float) +0:22 'b' ( in float16_t) +0:22 'c' ( in float) +0:25 Function Definition: func(f161;i161;f1; ( global int64_t) +0:25 Function Parameters: +0:25 'a' ( in float16_t) +0:25 'b' ( in int16_t) +0:25 'c' ( in float) +0:27 Sequence +0:27 Branch: Return with expression +0:27 Convert float to int64 ( temp int64_t) +0:27 subtract ( temp float) +0:27 Convert float16_t to float ( temp float) +0:27 'a' ( in float16_t) +0:27 component-wise multiply ( temp float) +0:27 Convert int16_t to float ( temp float) +0:27 'b' ( in int16_t) +0:27 'c' ( in float) +0:30 Function Definition: main( ( global void) +0:30 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp int64_t) +0:38 'b1' ( temp int64_t) +0:38 Function Call: func(i81;i161;i1; ( global int64_t) +0:38 'x' ( temp int8_t) +0:38 'y' ( temp int16_t) +0:38 'z' ( temp int) +0:39 Sequence +0:39 move second child to first child ( temp int64_t) +0:39 'b2' ( temp int64_t) +0:39 Function Call: func(f161;i161;f1; ( global int64_t) +0:39 Convert int16_t to float16_t ( temp float16_t) +0:39 'y' ( temp int16_t) +0:39 'y' ( temp int16_t) +0:39 Convert int to float ( temp float) +0:39 'z' ( temp int) +0:42 Sequence +0:42 move second child to first child ( temp int64_t) +0:42 'b5' ( temp int64_t) +0:42 Function Call: func(f161;i161;f1; ( global int64_t) +0:42 Convert int16_t to float16_t ( temp float16_t) +0:42 'y' ( temp int16_t) +0:42 'y' ( temp int16_t) +0:42 Convert float16_t to float ( temp float) +0:42 'f16' ( temp float16_t) +0:43 Sequence +0:43 move second child to first child ( temp int64_t) +0:43 'b7' ( temp int64_t) +0:43 Function Call: func(f161;f161;f1; ( global int64_t) +0:43 'f16' ( temp float16_t) +0:43 'f16' ( temp float16_t) +0:43 Convert int16_t to float ( temp float) +0:43 'y' ( temp int16_t) +0:45 Sequence +0:45 move second child to first child ( temp int64_t) +0:45 'b9' ( temp int64_t) +0:45 Function Call: func(f161;f161;f1; ( global int64_t) +0:45 'f16' ( temp float16_t) +0:45 Convert int8_t to float16_t ( temp float16_t) +0:45 'x' ( temp int8_t) +0:45 Convert float16_t to float ( temp float) +0:45 'f16' ( temp float16_t) +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 450 +Requested GL_KHX_shader_explicit_arithmetic_types +ERROR: node is still EOpNull! +0:10 Function Definition: func(i81;i161;i1; ( global int64_t) +0:10 Function Parameters: +0:10 'a' ( in int8_t) +0:10 'b' ( in int16_t) +0:10 'c' ( in int) +0:12 Sequence +0:12 Branch: Return with expression +0:12 Convert int to int64 ( temp int64_t) +0:12 inclusive-or ( temp int) +0:12 Convert int8_t to int ( temp int) +0:12 'a' ( in int8_t) +0:12 subtract ( temp int) +0:12 Convert int16_t to int ( temp int) +0:12 'b' ( in int16_t) +0:12 'c' ( in int) +0:20 Function Definition: func(f161;f161;f1; ( global int64_t) +0:20 Function Parameters: +0:20 'a' ( in float16_t) +0:20 'b' ( in float16_t) +0:20 'c' ( in float) +0:22 Sequence +0:22 Branch: Return with expression +0:22 Convert float to int64 ( temp int64_t) +0:22 subtract ( temp float) +0:22 Convert float16_t to float ( temp float) +0:22 'a' ( in float16_t) +0:22 component-wise multiply ( temp float) +0:22 Convert float16_t to float ( temp float) +0:22 'b' ( in float16_t) +0:22 'c' ( in float) +0:25 Function Definition: func(f161;i161;f1; ( global int64_t) +0:25 Function Parameters: +0:25 'a' ( in float16_t) +0:25 'b' ( in int16_t) +0:25 'c' ( in float) +0:27 Sequence +0:27 Branch: Return with expression +0:27 Convert float to int64 ( temp int64_t) +0:27 subtract ( temp float) +0:27 Convert float16_t to float ( temp float) +0:27 'a' ( in float16_t) +0:27 component-wise multiply ( temp float) +0:27 Convert int16_t to float ( temp float) +0:27 'b' ( in int16_t) +0:27 'c' ( in float) +0:30 Function Definition: main( ( global void) +0:30 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp int64_t) +0:38 'b1' ( temp int64_t) +0:38 Function Call: func(i81;i161;i1; ( global int64_t) +0:38 'x' ( temp int8_t) +0:38 'y' ( temp int16_t) +0:38 'z' ( temp int) +0:39 Sequence +0:39 move second child to first child ( temp int64_t) +0:39 'b2' ( temp int64_t) +0:39 Function Call: func(f161;i161;f1; ( global int64_t) +0:39 Convert int16_t to float16_t ( temp float16_t) +0:39 'y' ( temp int16_t) +0:39 'y' ( temp int16_t) +0:39 Convert int to float ( temp float) +0:39 'z' ( temp int) +0:42 Sequence +0:42 move second child to first child ( temp int64_t) +0:42 'b5' ( temp int64_t) +0:42 Function Call: func(f161;i161;f1; ( global int64_t) +0:42 Convert int16_t to float16_t ( temp float16_t) +0:42 'y' ( temp int16_t) +0:42 'y' ( temp int16_t) +0:42 Convert float16_t to float ( temp float) +0:42 'f16' ( temp float16_t) +0:43 Sequence +0:43 move second child to first child ( temp int64_t) +0:43 'b7' ( temp int64_t) +0:43 Function Call: func(f161;f161;f1; ( global int64_t) +0:43 'f16' ( temp float16_t) +0:43 'f16' ( temp float16_t) +0:43 Convert int16_t to float ( temp float) +0:43 'y' ( temp int16_t) +0:45 Sequence +0:45 move second child to first child ( temp int64_t) +0:45 'b9' ( temp int64_t) +0:45 Function Call: func(f161;f161;f1; ( global int64_t) +0:45 'f16' ( temp float16_t) +0:45 Convert int8_t to float16_t ( temp float16_t) +0:45 'x' ( temp int8_t) +0:45 Convert float16_t to float ( temp float) +0:45 'f16' ( temp float16_t) +0:? Linker Objects + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/glsl.entryPointRename.vert.bad.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/glsl.entryPointRename.vert.bad.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/glsl.entryPointRename.vert.bad.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/glsl.entryPointRename.vert.bad.out 2018-04-27 11:46:26.000000000 +0000 @@ -2,7 +2,7 @@ ERROR: Source entry point must be "main" // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 20 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/glsl.entryPointRename.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/glsl.entryPointRename.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/glsl.entryPointRename.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/glsl.entryPointRename.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ glsl.entryPointRename.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 20 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/glspv.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/glspv.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/glspv.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/glspv.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,9 +1,15 @@ glspv.frag ERROR: 0:4: '#error' : GL_SPIRV is set ( correct , not an error ) ERROR: 0:6: '#error' : GL_SPIR is 100 -ERROR: 0:19: 'input_attachment_index' : only allowed when using GLSL for Vulkan -ERROR: 0:19: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON -ERROR: 4 compilation errors. No code generated. +ERROR: 0:14: 'f' : non-opaque uniform variables need a layout(location=L) +ERROR: 0:21: 'noise1' : no matching overloaded function found +ERROR: 0:22: 'noise2' : no matching overloaded function found +ERROR: 0:23: 'noise3' : no matching overloaded function found +ERROR: 0:24: 'noise4' : no matching overloaded function found +ERROR: 0:27: 'atomic_uint' : layout(binding=X) is required +ERROR: 0:28: 'input_attachment_index' : only allowed when using GLSL for Vulkan +ERROR: 0:28: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON +ERROR: 10 compilation errors. No code generated. SPIR-V is not generated for failed compile or link diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/glspv.version.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/glspv.version.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/glspv.version.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/glspv.version.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -2,7 +2,7 @@ ERROR: #version: compilation for SPIR-V does not support the compatibility profile // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 6 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.aliasOpaque.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.aliasOpaque.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.aliasOpaque.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.aliasOpaque.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -5,17 +5,24 @@ 0:? Sequence 0:12 Function Definition: osCall(struct-OS-p1-f1-t211; ( temp 4-component vector of float) 0:12 Function Parameters: -0:? 's.ss' ( in sampler) -0:? 's.a' ( in float) -0:? 's.tex' ( in texture2D) +0:12 's' ( in structure{ temp sampler ss, temp float a, temp texture2D tex}) 0:? Sequence 0:13 Branch: Return with expression 0:13 vector-scale ( temp 4-component vector of float) -0:? 's.a' ( in float) +0:13 a: direct index for structure ( temp float) +0:13 's' ( in structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:13 Constant: +0:13 1 (const int) 0:13 texture ( temp 4-component vector of float) 0:13 Construct combined texture-sampler ( temp sampler2D) -0:? 's.tex' ( in texture2D) -0:? 's.ss' ( in sampler) +0:13 tex: direct index for structure ( temp texture2D) +0:13 's' ( in structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:13 Constant: +0:13 2 (const int) +0:13 ss: direct index for structure ( temp sampler) +0:13 's' ( in structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:13 Constant: +0:13 0 (const int) 0:? Constant: 0:? 0.200000 0:? 0.300000 @@ -23,23 +30,33 @@ 0:17 Function Parameters: 0:? Sequence 0:19 move second child to first child ( temp sampler) -0:? 'os.ss' ( temp sampler) +0:19 ss: direct index for structure ( temp sampler) +0:19 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:19 Constant: +0:19 0 (const int) 0:19 'gss2' ( uniform sampler) 0:20 move second child to first child ( temp sampler) -0:? 'os.ss' ( temp sampler) +0:20 ss: direct index for structure ( temp sampler) +0:20 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:20 Constant: +0:20 0 (const int) 0:20 'gss' ( uniform sampler) 0:21 move second child to first child ( temp texture2D) -0:? 'os.tex' ( temp texture2D) +0:21 tex: direct index for structure ( temp texture2D) +0:21 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:21 Constant: +0:21 2 (const int) 0:21 'gtex' ( uniform texture2D) 0:22 move second child to first child ( temp float) -0:? 'os.a' ( temp float) +0:22 a: direct index for structure ( temp float) +0:22 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:22 Constant: +0:22 1 (const int) 0:22 Constant: 0:22 3.000000 0:28 Branch: Return with expression 0:28 Function Call: osCall(struct-OS-p1-f1-t211; ( temp 4-component vector of float) -0:? 'os.ss' ( temp sampler) -0:? 'os.a' ( temp float) -0:? 'os.tex' ( temp texture2D) +0:28 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) 0:17 Function Definition: main( ( temp void) 0:17 Function Parameters: 0:? Sequence @@ -61,17 +78,24 @@ 0:? Sequence 0:12 Function Definition: osCall(struct-OS-p1-f1-t211; ( temp 4-component vector of float) 0:12 Function Parameters: -0:? 's.ss' ( in sampler) -0:? 's.a' ( in float) -0:? 's.tex' ( in texture2D) +0:12 's' ( in structure{ temp sampler ss, temp float a, temp texture2D tex}) 0:? Sequence 0:13 Branch: Return with expression 0:13 vector-scale ( temp 4-component vector of float) -0:? 's.a' ( in float) +0:13 a: direct index for structure ( temp float) +0:13 's' ( in structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:13 Constant: +0:13 1 (const int) 0:13 texture ( temp 4-component vector of float) 0:13 Construct combined texture-sampler ( temp sampler2D) -0:? 's.tex' ( in texture2D) -0:? 's.ss' ( in sampler) +0:13 tex: direct index for structure ( temp texture2D) +0:13 's' ( in structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:13 Constant: +0:13 2 (const int) +0:13 ss: direct index for structure ( temp sampler) +0:13 's' ( in structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:13 Constant: +0:13 0 (const int) 0:? Constant: 0:? 0.200000 0:? 0.300000 @@ -79,23 +103,33 @@ 0:17 Function Parameters: 0:? Sequence 0:19 move second child to first child ( temp sampler) -0:? 'os.ss' ( temp sampler) +0:19 ss: direct index for structure ( temp sampler) +0:19 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:19 Constant: +0:19 0 (const int) 0:19 'gss2' ( uniform sampler) 0:20 move second child to first child ( temp sampler) -0:? 'os.ss' ( temp sampler) +0:20 ss: direct index for structure ( temp sampler) +0:20 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:20 Constant: +0:20 0 (const int) 0:20 'gss' ( uniform sampler) 0:21 move second child to first child ( temp texture2D) -0:? 'os.tex' ( temp texture2D) +0:21 tex: direct index for structure ( temp texture2D) +0:21 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:21 Constant: +0:21 2 (const int) 0:21 'gtex' ( uniform texture2D) 0:22 move second child to first child ( temp float) -0:? 'os.a' ( temp float) +0:22 a: direct index for structure ( temp float) +0:22 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:22 Constant: +0:22 1 (const int) 0:22 Constant: 0:22 3.000000 0:28 Branch: Return with expression 0:28 Function Call: osCall(struct-OS-p1-f1-t211; ( temp 4-component vector of float) -0:? 'os.ss' ( temp sampler) -0:? 'os.a' ( temp float) -0:? 'os.tex' ( temp texture2D) +0:28 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) 0:17 Function Definition: main( ( temp void) 0:17 Function Parameters: 0:? Sequence @@ -109,99 +143,100 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 59 +// Generated by (magic number): 80006 +// Id's are bound by 64 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 57 + EntryPoint Fragment 4 "main" 62 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" - Name 17 "osCall(struct-OS-p1-f1-t211;" - Name 14 "s.ss" - Name 15 "s.a" - Name 16 "s.tex" - Name 20 "@main(" - Name 35 "os.ss" - Name 37 "gss2" - Name 39 "gss" - Name 41 "os.tex" - Name 43 "gtex" - Name 45 "os.a" - Name 47 "param" - Name 49 "param" - Name 51 "param" - Name 57 "@entryPointOutput" - Decorate 37(gss2) DescriptorSet 0 - Decorate 39(gss) DescriptorSet 0 - Decorate 43(gtex) DescriptorSet 0 - Decorate 57(@entryPointOutput) Location 0 + Name 9 "OS" + MemberName 9(OS) 0 "ss" + MemberName 9(OS) 1 "a" + MemberName 9(OS) 2 "tex" + Name 14 "osCall(struct-OS-p1-f1-t211;" + Name 13 "s" + Name 17 "@main(" + Name 42 "os" + Name 44 "gss2" + Name 47 "gss" + Name 51 "gtex" + Name 56 "param" + Name 62 "@entryPointOutput" + Decorate 44(gss2) DescriptorSet 0 + Decorate 47(gss) DescriptorSet 0 + Decorate 51(gtex) DescriptorSet 0 + Decorate 62(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeSampler - 7: TypePointer Function 6 - 8: TypeFloat 32 - 9: TypePointer Function 8(float) - 10: TypeImage 8(float) 2D sampled format:Unknown - 11: TypePointer Function 10 - 12: TypeVector 8(float) 4 - 13: TypeFunction 12(fvec4) 7(ptr) 9(ptr) 11(ptr) - 19: TypeFunction 12(fvec4) - 25: TypeSampledImage 10 - 27: TypeVector 8(float) 2 - 28: 8(float) Constant 1045220557 - 29: 8(float) Constant 1050253722 - 30: 27(fvec2) ConstantComposite 28 29 - 36: TypePointer UniformConstant 6 - 37(gss2): 36(ptr) Variable UniformConstant - 39(gss): 36(ptr) Variable UniformConstant - 42: TypePointer UniformConstant 10 - 43(gtex): 42(ptr) Variable UniformConstant - 46: 8(float) Constant 1077936128 - 56: TypePointer Output 12(fvec4) -57(@entryPointOutput): 56(ptr) Variable Output + 7: TypeFloat 32 + 8: TypeImage 7(float) 2D sampled format:Unknown + 9(OS): TypeStruct 6 7(float) 8 + 10: TypePointer Function 9(OS) + 11: TypeVector 7(float) 4 + 12: TypeFunction 11(fvec4) 10(ptr) + 16: TypeFunction 11(fvec4) + 19: TypeInt 32 1 + 20: 19(int) Constant 1 + 21: TypePointer Function 7(float) + 24: 19(int) Constant 2 + 25: TypePointer Function 8 + 28: 19(int) Constant 0 + 29: TypePointer Function 6 + 32: TypeSampledImage 8 + 34: TypeVector 7(float) 2 + 35: 7(float) Constant 1045220557 + 36: 7(float) Constant 1050253722 + 37: 34(fvec2) ConstantComposite 35 36 + 43: TypePointer UniformConstant 6 + 44(gss2): 43(ptr) Variable UniformConstant + 47(gss): 43(ptr) Variable UniformConstant + 50: TypePointer UniformConstant 8 + 51(gtex): 50(ptr) Variable UniformConstant + 54: 7(float) Constant 1077936128 + 61: TypePointer Output 11(fvec4) +62(@entryPointOutput): 61(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 58: 12(fvec4) FunctionCall 20(@main() - Store 57(@entryPointOutput) 58 + 63: 11(fvec4) FunctionCall 17(@main() + Store 62(@entryPointOutput) 63 Return FunctionEnd -17(osCall(struct-OS-p1-f1-t211;): 12(fvec4) Function None 13 - 14(s.ss): 7(ptr) FunctionParameter - 15(s.a): 9(ptr) FunctionParameter - 16(s.tex): 11(ptr) FunctionParameter - 18: Label - 22: 8(float) Load 15(s.a) - 23: 10 Load 16(s.tex) - 24: 6 Load 14(s.ss) - 26: 25 SampledImage 23 24 - 31: 12(fvec4) ImageSampleImplicitLod 26 30 - 32: 12(fvec4) VectorTimesScalar 31 22 - ReturnValue 32 +14(osCall(struct-OS-p1-f1-t211;): 11(fvec4) Function None 12 + 13(s): 10(ptr) FunctionParameter + 15: Label + 22: 21(ptr) AccessChain 13(s) 20 + 23: 7(float) Load 22 + 26: 25(ptr) AccessChain 13(s) 24 + 27: 8 Load 26 + 30: 29(ptr) AccessChain 13(s) 28 + 31: 6 Load 30 + 33: 32 SampledImage 27 31 + 38: 11(fvec4) ImageSampleImplicitLod 33 37 + 39: 11(fvec4) VectorTimesScalar 38 23 + ReturnValue 39 FunctionEnd - 20(@main(): 12(fvec4) Function None 19 - 21: Label - 35(os.ss): 7(ptr) Variable Function - 41(os.tex): 11(ptr) Variable Function - 45(os.a): 9(ptr) Variable Function - 47(param): 7(ptr) Variable Function - 49(param): 9(ptr) Variable Function - 51(param): 11(ptr) Variable Function - 38: 6 Load 37(gss2) - Store 35(os.ss) 38 - 40: 6 Load 39(gss) - Store 35(os.ss) 40 - 44: 10 Load 43(gtex) - Store 41(os.tex) 44 - Store 45(os.a) 46 - 48: 6 Load 35(os.ss) - Store 47(param) 48 - 50: 8(float) Load 45(os.a) - Store 49(param) 50 - 52: 10 Load 41(os.tex) - Store 51(param) 52 - 53: 12(fvec4) FunctionCall 17(osCall(struct-OS-p1-f1-t211;) 47(param) 49(param) 51(param) - ReturnValue 53 + 17(@main(): 11(fvec4) Function None 16 + 18: Label + 42(os): 10(ptr) Variable Function + 56(param): 10(ptr) Variable Function + 45: 6 Load 44(gss2) + 46: 29(ptr) AccessChain 42(os) 28 + Store 46 45 + 48: 6 Load 47(gss) + 49: 29(ptr) AccessChain 42(os) 28 + Store 49 48 + 52: 8 Load 51(gtex) + 53: 25(ptr) AccessChain 42(os) 24 + Store 53 52 + 55: 21(ptr) AccessChain 42(os) 20 + Store 55 54 + 57: 9(OS) Load 42(os) + Store 56(param) 57 + 58: 11(fvec4) FunctionCall 14(osCall(struct-OS-p1-f1-t211;) 56(param) + ReturnValue 58 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.amend.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.amend.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.amend.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.amend.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -160,7 +160,7 @@ 0:? 'm' ( global 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 57 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.array.flatten.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.array.flatten.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.array.flatten.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.array.flatten.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -345,7 +345,7 @@ 0:? 'ps_output.color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 143 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.array.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.array.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.array.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.array.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -290,7 +290,7 @@ 0:? 'input' (layout( location=1) in 3-element array of 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 126 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.array.implicit-size.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.array.implicit-size.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.array.implicit-size.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.array.implicit-size.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -163,7 +163,7 @@ 0:? 'g_mystruct' ( global 2-element array of structure{ temp int i, temp float f}) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 72 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.array.multidim.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.array.multidim.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.array.multidim.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.array.multidim.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -134,7 +134,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 57 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.assoc.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.assoc.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.assoc.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.assoc.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -132,7 +132,7 @@ 0:? 'a5' (layout( location=4) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 58 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.attributeC11.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.attributeC11.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.attributeC11.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.attributeC11.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -2,42 +2,45 @@ Shader version: 500 gl_FragCoord origin is upper left 0:? Sequence -0:16 Function Definition: @main(vf4; ( temp 4-component vector of float) -0:16 Function Parameters: -0:16 'input' ( in 4-component vector of float) +0:20 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:20 Function Parameters: +0:20 'input' ( in 4-component vector of float) 0:? Sequence -0:17 Branch: Return with expression -0:17 add ( temp 4-component vector of float) -0:17 'input' ( in 4-component vector of float) -0:17 textureFetch ( temp 4-component vector of float) -0:17 'attach' ( uniform texture2D) -0:17 vector swizzle ( temp int) -0:17 Constant: -0:17 0 (const int) -0:17 0 (const int) -0:17 Sequence -0:17 Constant: -0:17 0 (const int) -0:17 direct index ( temp int) -0:17 Constant: -0:17 0 (const int) -0:17 0 (const int) -0:17 Constant: -0:17 1 (const int) -0:16 Function Definition: main( ( temp void) -0:16 Function Parameters: +0:21 Branch: Return with expression +0:21 add ( temp 4-component vector of float) +0:21 'input' ( in 4-component vector of float) +0:21 textureFetch ( temp 4-component vector of float) +0:21 'attach' ( uniform texture2D) +0:21 vector swizzle ( temp int) +0:21 Constant: +0:21 0 (const int) +0:21 0 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 direct index ( temp int) +0:21 Constant: +0:21 0 (const int) +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: 0:? Sequence -0:16 move second child to first child ( temp 4-component vector of float) +0:20 move second child to first child ( temp 4-component vector of float) 0:? 'input' ( temp 4-component vector of float) 0:? 'input' (layout( location=8) in 4-component vector of float) -0:16 move second child to first child ( temp 4-component vector of float) +0:20 move second child to first child ( temp 4-component vector of float) 0:? '@entryPointOutput' (layout( location=7) out 4-component vector of float) -0:16 Function Call: @main(vf4; ( temp 4-component vector of float) +0:20 Function Call: @main(vf4; ( temp 4-component vector of float) 0:? 'input' ( temp 4-component vector of float) 0:? Linker Objects -0:? 'buffer1' (layout( set=0 binding=1 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 2-component vector of float f} @data}) -0:? 'buffer3' (layout( set=2 binding=3 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 2-component vector of float f} @data}) +0:? 'buffer1' (layout( set=0 binding=1 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 2-component vector of float f} @data}) +0:? 'buffer3' (layout( set=2 binding=3 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 2-component vector of float f} @data}) 0:? 'attach' ( uniform texture2D) +0:? 'ci' ( specialization-constant const int) +0:? 11 (const int) +0:? 'anon@0' (layout( row_major std430 push_constant) uniform block{layout( row_major std430 offset=0) uniform int a}) 0:? '@entryPointOutput' (layout( location=7) out 4-component vector of float) 0:? 'input' (layout( location=8) in 4-component vector of float) @@ -48,48 +51,51 @@ Shader version: 500 gl_FragCoord origin is upper left 0:? Sequence -0:16 Function Definition: @main(vf4; ( temp 4-component vector of float) -0:16 Function Parameters: -0:16 'input' ( in 4-component vector of float) +0:20 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:20 Function Parameters: +0:20 'input' ( in 4-component vector of float) 0:? Sequence -0:17 Branch: Return with expression -0:17 add ( temp 4-component vector of float) -0:17 'input' ( in 4-component vector of float) -0:17 textureFetch ( temp 4-component vector of float) -0:17 'attach' ( uniform texture2D) -0:17 vector swizzle ( temp int) -0:17 Constant: -0:17 0 (const int) -0:17 0 (const int) -0:17 Sequence -0:17 Constant: -0:17 0 (const int) -0:17 direct index ( temp int) -0:17 Constant: -0:17 0 (const int) -0:17 0 (const int) -0:17 Constant: -0:17 1 (const int) -0:16 Function Definition: main( ( temp void) -0:16 Function Parameters: +0:21 Branch: Return with expression +0:21 add ( temp 4-component vector of float) +0:21 'input' ( in 4-component vector of float) +0:21 textureFetch ( temp 4-component vector of float) +0:21 'attach' ( uniform texture2D) +0:21 vector swizzle ( temp int) +0:21 Constant: +0:21 0 (const int) +0:21 0 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 direct index ( temp int) +0:21 Constant: +0:21 0 (const int) +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: 0:? Sequence -0:16 move second child to first child ( temp 4-component vector of float) +0:20 move second child to first child ( temp 4-component vector of float) 0:? 'input' ( temp 4-component vector of float) 0:? 'input' (layout( location=8) in 4-component vector of float) -0:16 move second child to first child ( temp 4-component vector of float) +0:20 move second child to first child ( temp 4-component vector of float) 0:? '@entryPointOutput' (layout( location=7) out 4-component vector of float) -0:16 Function Call: @main(vf4; ( temp 4-component vector of float) +0:20 Function Call: @main(vf4; ( temp 4-component vector of float) 0:? 'input' ( temp 4-component vector of float) 0:? Linker Objects -0:? 'buffer1' (layout( set=0 binding=1 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 2-component vector of float f} @data}) -0:? 'buffer3' (layout( set=2 binding=3 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 2-component vector of float f} @data}) +0:? 'buffer1' (layout( set=0 binding=1 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 2-component vector of float f} @data}) +0:? 'buffer3' (layout( set=2 binding=3 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 2-component vector of float f} @data}) 0:? 'attach' ( uniform texture2D) +0:? 'ci' ( specialization-constant const int) +0:? 11 (const int) +0:? 'anon@0' (layout( row_major std430 push_constant) uniform block{layout( row_major std430 offset=0) uniform int a}) 0:? '@entryPointOutput' (layout( location=7) out 4-component vector of float) 0:? 'input' (layout( location=8) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 47 +// Generated by (magic number): 80006 +// Id's are bound by 51 Capability Shader 1: ExtInstImport "GLSL.std.450" @@ -111,6 +117,10 @@ MemberName 43(buffer1) 0 "@data" Name 45 "buffer1" Name 46 "buffer3" + Name 47 "ci" + Name 48 "pcBuf" + MemberName 48(pcBuf) 0 "a" + Name 50 "" Decorate 16(attach) DescriptorSet 0 Decorate 16(attach) InputAttachmentIndex 4 Decorate 33(input) Location 8 @@ -124,6 +134,9 @@ Decorate 45(buffer1) Binding 1 Decorate 46(buffer3) DescriptorSet 2 Decorate 46(buffer3) Binding 3 + Decorate 47(ci) SpecId 13 + MemberDecorate 48(pcBuf) 0 Offset 0 + Decorate 48(pcBuf) Block 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -151,6 +164,10 @@ 44: TypePointer Uniform 43(buffer1) 45(buffer1): 44(ptr) Variable Uniform 46(buffer3): 44(ptr) Variable Uniform + 47(ci): 18(int) SpecConstant 11 + 48(pcBuf): TypeStruct 18(int) + 49: TypePointer PushConstant 48(pcBuf) + 50: 49(ptr) Variable PushConstant 4(main): 2 Function None 3 5: Label 31(input): 8(ptr) Variable Function diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.attribute.expression.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.attribute.expression.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.attribute.expression.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.attribute.expression.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -10,7 +10,7 @@ 0:11 'x' ( temp int) 0:11 Constant: 0:11 0 (const int) -0:11 Loop with condition tested first +0:11 Loop with condition tested first: Unroll 0:11 Loop Condition 0:11 Compare Less Than ( temp bool) 0:11 'x' ( temp int) @@ -53,7 +53,7 @@ 0:11 'x' ( temp int) 0:11 Constant: 0:11 0 (const int) -0:11 Loop with condition tested first +0:11 Loop with condition tested first: Unroll 0:11 Loop Condition 0:11 Compare Less Than ( temp bool) 0:11 'x' ( temp int) @@ -82,7 +82,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 39 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.attribute.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.attribute.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.attribute.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.attribute.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -6,7 +6,7 @@ 0:2 Function Parameters: 0:2 'input' ( in 4-component vector of float) 0:? Sequence -0:11 Test condition and select ( temp void) +0:11 Test condition and select ( temp void): DontFlatten 0:11 Condition 0:11 Constant: 0:11 false (const bool) @@ -33,7 +33,7 @@ 0:2 Function Parameters: 0:2 'input' ( in 4-component vector of float) 0:? Sequence -0:11 Test condition and select ( temp void) +0:11 Test condition and select ( temp void): DontFlatten 0:11 Condition 0:11 Constant: 0:11 false (const bool) @@ -50,7 +50,7 @@ 0:? 'input' (layout( location=0) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 24 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.attributeGlobalBuffer.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.attributeGlobalBuffer.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.attributeGlobalBuffer.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.attributeGlobalBuffer.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -56,7 +56,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 28 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.basic.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.basic.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.basic.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.basic.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -60,7 +60,7 @@ 0:? 'gti' ( in int LocalInvocationID) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 35 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.basic.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.basic.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.basic.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.basic.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -188,7 +188,7 @@ 0:? 'OutputStream.something' (layout( location=1) out int) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 68 Capability Geometry diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.boolConv.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.boolConv.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.boolConv.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.boolConv.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -16,84 +16,74 @@ 0:4 0 (const int) 0:6 add second child into first child ( temp int) 0:6 'r' ( temp int) -0:6 Convert bool to int ( temp int) -0:6 add ( temp bool) -0:6 Convert bool to int ( temp int) -0:6 'a' ( global bool) -0:6 Convert bool to int ( temp int) -0:6 'b' ( global bool) +0:6 add ( temp int) +0:6 Convert bool to int ( temp int) +0:6 'a' ( global bool) +0:6 Convert bool to int ( temp int) +0:6 'b' ( global bool) 0:7 add second child into first child ( temp int) 0:7 'r' ( temp int) -0:7 Convert bool to int ( temp int) -0:7 subtract ( temp bool) -0:7 Convert bool to int ( temp int) -0:7 'a' ( global bool) -0:7 Convert bool to int ( temp int) -0:7 'b' ( global bool) +0:7 subtract ( temp int) +0:7 Convert bool to int ( temp int) +0:7 'a' ( global bool) +0:7 Convert bool to int ( temp int) +0:7 'b' ( global bool) 0:8 add second child into first child ( temp int) 0:8 'r' ( temp int) -0:8 Convert bool to int ( temp int) -0:8 component-wise multiply ( temp bool) -0:8 Convert bool to int ( temp int) -0:8 'a' ( global bool) -0:8 Convert bool to int ( temp int) -0:8 'b' ( global bool) +0:8 component-wise multiply ( temp int) +0:8 Convert bool to int ( temp int) +0:8 'a' ( global bool) +0:8 Convert bool to int ( temp int) +0:8 'b' ( global bool) 0:9 add second child into first child ( temp int) 0:9 'r' ( temp int) -0:9 Convert bool to int ( temp int) -0:9 divide ( temp bool) -0:9 Convert bool to int ( temp int) -0:9 'a' ( global bool) -0:9 Convert bool to int ( temp int) -0:9 'b' ( global bool) +0:9 divide ( temp int) +0:9 Convert bool to int ( temp int) +0:9 'a' ( global bool) +0:9 Convert bool to int ( temp int) +0:9 'b' ( global bool) 0:10 add second child into first child ( temp int) 0:10 'r' ( temp int) -0:10 Convert bool to int ( temp int) -0:10 mod ( temp bool) -0:10 Convert bool to int ( temp int) -0:10 'a' ( global bool) -0:10 Convert bool to int ( temp int) -0:10 'b' ( global bool) +0:10 mod ( temp int) +0:10 Convert bool to int ( temp int) +0:10 'a' ( global bool) +0:10 Convert bool to int ( temp int) +0:10 'b' ( global bool) 0:12 add second child into first child ( temp int) 0:12 'r' ( temp int) -0:12 Convert bool to int ( temp int) -0:12 bitwise and ( temp bool) -0:12 Convert bool to int ( temp int) -0:12 'a' ( global bool) -0:12 Convert bool to int ( temp int) -0:12 'b' ( global bool) +0:12 bitwise and ( temp int) +0:12 Convert bool to int ( temp int) +0:12 'a' ( global bool) +0:12 Convert bool to int ( temp int) +0:12 'b' ( global bool) 0:13 add second child into first child ( temp int) 0:13 'r' ( temp int) -0:13 Convert bool to int ( temp int) -0:13 inclusive-or ( temp bool) -0:13 Convert bool to int ( temp int) -0:13 'a' ( global bool) -0:13 Convert bool to int ( temp int) -0:13 'b' ( global bool) +0:13 inclusive-or ( temp int) +0:13 Convert bool to int ( temp int) +0:13 'a' ( global bool) +0:13 Convert bool to int ( temp int) +0:13 'b' ( global bool) 0:14 add second child into first child ( temp int) 0:14 'r' ( temp int) -0:14 Convert bool to int ( temp int) -0:14 exclusive-or ( temp bool) -0:14 Convert bool to int ( temp int) -0:14 'a' ( global bool) -0:14 Convert bool to int ( temp int) -0:14 'b' ( global bool) +0:14 exclusive-or ( temp int) +0:14 Convert bool to int ( temp int) +0:14 'a' ( global bool) +0:14 Convert bool to int ( temp int) +0:14 'b' ( global bool) 0:16 add second child into first child ( temp int) 0:16 'r' ( temp int) -0:16 Convert bool to int ( temp int) -0:16 left-shift ( temp bool) -0:16 Convert bool to int ( temp int) -0:16 'a' ( global bool) -0:16 Convert bool to int ( temp int) -0:16 'b' ( global bool) +0:16 left-shift ( temp int) +0:16 Convert bool to int ( temp int) +0:16 'a' ( global bool) +0:16 Convert bool to int ( temp int) +0:16 'b' ( global bool) 0:17 add second child into first child ( temp int) 0:17 'r' ( temp int) -0:17 Convert bool to int ( temp int) -0:17 right-shift ( temp bool) -0:17 Convert bool to int ( temp int) -0:17 'a' ( global bool) -0:17 Convert bool to int ( temp int) -0:17 'b' ( global bool) +0:17 right-shift ( temp int) +0:17 Convert bool to int ( temp int) +0:17 'a' ( global bool) +0:17 Convert bool to int ( temp int) +0:17 'b' ( global bool) 0:19 Branch: Return with expression 0:19 Construct vec4 ( temp 4-component vector of float) 0:19 Convert int to float ( temp float) @@ -130,84 +120,74 @@ 0:4 0 (const int) 0:6 add second child into first child ( temp int) 0:6 'r' ( temp int) -0:6 Convert bool to int ( temp int) -0:6 add ( temp bool) -0:6 Convert bool to int ( temp int) -0:6 'a' ( global bool) -0:6 Convert bool to int ( temp int) -0:6 'b' ( global bool) +0:6 add ( temp int) +0:6 Convert bool to int ( temp int) +0:6 'a' ( global bool) +0:6 Convert bool to int ( temp int) +0:6 'b' ( global bool) 0:7 add second child into first child ( temp int) 0:7 'r' ( temp int) -0:7 Convert bool to int ( temp int) -0:7 subtract ( temp bool) -0:7 Convert bool to int ( temp int) -0:7 'a' ( global bool) -0:7 Convert bool to int ( temp int) -0:7 'b' ( global bool) +0:7 subtract ( temp int) +0:7 Convert bool to int ( temp int) +0:7 'a' ( global bool) +0:7 Convert bool to int ( temp int) +0:7 'b' ( global bool) 0:8 add second child into first child ( temp int) 0:8 'r' ( temp int) -0:8 Convert bool to int ( temp int) -0:8 component-wise multiply ( temp bool) -0:8 Convert bool to int ( temp int) -0:8 'a' ( global bool) -0:8 Convert bool to int ( temp int) -0:8 'b' ( global bool) +0:8 component-wise multiply ( temp int) +0:8 Convert bool to int ( temp int) +0:8 'a' ( global bool) +0:8 Convert bool to int ( temp int) +0:8 'b' ( global bool) 0:9 add second child into first child ( temp int) 0:9 'r' ( temp int) -0:9 Convert bool to int ( temp int) -0:9 divide ( temp bool) -0:9 Convert bool to int ( temp int) -0:9 'a' ( global bool) -0:9 Convert bool to int ( temp int) -0:9 'b' ( global bool) +0:9 divide ( temp int) +0:9 Convert bool to int ( temp int) +0:9 'a' ( global bool) +0:9 Convert bool to int ( temp int) +0:9 'b' ( global bool) 0:10 add second child into first child ( temp int) 0:10 'r' ( temp int) -0:10 Convert bool to int ( temp int) -0:10 mod ( temp bool) -0:10 Convert bool to int ( temp int) -0:10 'a' ( global bool) -0:10 Convert bool to int ( temp int) -0:10 'b' ( global bool) +0:10 mod ( temp int) +0:10 Convert bool to int ( temp int) +0:10 'a' ( global bool) +0:10 Convert bool to int ( temp int) +0:10 'b' ( global bool) 0:12 add second child into first child ( temp int) 0:12 'r' ( temp int) -0:12 Convert bool to int ( temp int) -0:12 bitwise and ( temp bool) -0:12 Convert bool to int ( temp int) -0:12 'a' ( global bool) -0:12 Convert bool to int ( temp int) -0:12 'b' ( global bool) +0:12 bitwise and ( temp int) +0:12 Convert bool to int ( temp int) +0:12 'a' ( global bool) +0:12 Convert bool to int ( temp int) +0:12 'b' ( global bool) 0:13 add second child into first child ( temp int) 0:13 'r' ( temp int) -0:13 Convert bool to int ( temp int) -0:13 inclusive-or ( temp bool) -0:13 Convert bool to int ( temp int) -0:13 'a' ( global bool) -0:13 Convert bool to int ( temp int) -0:13 'b' ( global bool) +0:13 inclusive-or ( temp int) +0:13 Convert bool to int ( temp int) +0:13 'a' ( global bool) +0:13 Convert bool to int ( temp int) +0:13 'b' ( global bool) 0:14 add second child into first child ( temp int) 0:14 'r' ( temp int) -0:14 Convert bool to int ( temp int) -0:14 exclusive-or ( temp bool) -0:14 Convert bool to int ( temp int) -0:14 'a' ( global bool) -0:14 Convert bool to int ( temp int) -0:14 'b' ( global bool) +0:14 exclusive-or ( temp int) +0:14 Convert bool to int ( temp int) +0:14 'a' ( global bool) +0:14 Convert bool to int ( temp int) +0:14 'b' ( global bool) 0:16 add second child into first child ( temp int) 0:16 'r' ( temp int) -0:16 Convert bool to int ( temp int) -0:16 left-shift ( temp bool) -0:16 Convert bool to int ( temp int) -0:16 'a' ( global bool) -0:16 Convert bool to int ( temp int) -0:16 'b' ( global bool) +0:16 left-shift ( temp int) +0:16 Convert bool to int ( temp int) +0:16 'a' ( global bool) +0:16 Convert bool to int ( temp int) +0:16 'b' ( global bool) 0:17 add second child into first child ( temp int) 0:17 'r' ( temp int) -0:17 Convert bool to int ( temp int) -0:17 right-shift ( temp bool) -0:17 Convert bool to int ( temp int) -0:17 'a' ( global bool) -0:17 Convert bool to int ( temp int) -0:17 'b' ( global bool) +0:17 right-shift ( temp int) +0:17 Convert bool to int ( temp int) +0:17 'a' ( global bool) +0:17 Convert bool to int ( temp int) +0:17 'b' ( global bool) 0:19 Branch: Return with expression 0:19 Construct vec4 ( temp 4-component vector of float) 0:19 Convert int to float ( temp float) @@ -224,21 +204,21 @@ 0:? '@entryPointOutput' ( out 4-component vector of float Position) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 109 +// Generated by (magic number): 80006 +// Id's are bound by 99 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 107 + EntryPoint Vertex 4 "main" 97 Source HLSL 500 Name 4 "main" Name 9 "@main(" Name 13 "b" Name 17 "r" Name 19 "a" - Name 107 "@entryPointOutput" - Decorate 107(@entryPointOutput) BuiltIn Position + Name 97 "@entryPointOutput" + Decorate 97(@entryPointOutput) BuiltIn Position 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -253,13 +233,13 @@ 18: 15(int) Constant 0 19(a): 12(ptr) Variable Private 21: 15(int) Constant 1 - 106: TypePointer Output 7(fvec4) -107(@entryPointOutput): 106(ptr) Variable Output + 96: TypePointer Output 7(fvec4) +97(@entryPointOutput): 96(ptr) Variable Output 4(main): 2 Function None 3 5: Label Store 13(b) 14 - 108: 7(fvec4) FunctionCall 9(@main() - Store 107(@entryPointOutput) 108 + 98: 7(fvec4) FunctionCall 9(@main() + Store 97(@entryPointOutput) 98 Return FunctionEnd 9(@main(): 7(fvec4) Function None 8 @@ -270,62 +250,63 @@ 22: 15(int) Select 20 21 18 23: 11(bool) Load 13(b) 24: 15(int) Select 23 21 18 - 25: 11(bool) IAdd 22 24 - 26: 15(int) Select 25 21 18 - 27: 15(int) Load 17(r) - 28: 15(int) IAdd 27 26 - Store 17(r) 28 - 29: 11(bool) Load 19(a) - 30: 15(int) Select 29 21 18 - 31: 11(bool) Load 13(b) - 32: 15(int) Select 31 21 18 - 33: 11(bool) ISub 30 32 - 34: 15(int) Select 33 21 18 - 35: 15(int) Load 17(r) - 36: 15(int) IAdd 35 34 - Store 17(r) 36 - 37: 11(bool) Load 19(a) + 25: 15(int) IAdd 22 24 + 26: 15(int) Load 17(r) + 27: 15(int) IAdd 26 25 + Store 17(r) 27 + 28: 11(bool) Load 19(a) + 29: 15(int) Select 28 21 18 + 30: 11(bool) Load 13(b) + 31: 15(int) Select 30 21 18 + 32: 15(int) ISub 29 31 + 33: 15(int) Load 17(r) + 34: 15(int) IAdd 33 32 + Store 17(r) 34 + 35: 11(bool) Load 19(a) + 36: 15(int) Select 35 21 18 + 37: 11(bool) Load 13(b) 38: 15(int) Select 37 21 18 - 39: 11(bool) Load 13(b) - 40: 15(int) Select 39 21 18 - 41: 11(bool) IMul 38 40 - 42: 15(int) Select 41 21 18 - 43: 15(int) Load 17(r) - 44: 15(int) IAdd 43 42 - Store 17(r) 44 - 45: 11(bool) Load 19(a) - 46: 15(int) Select 45 21 18 - 47: 11(bool) Load 13(b) - 48: 15(int) Select 47 21 18 - 49: 11(bool) SDiv 46 48 + 39: 15(int) IMul 36 38 + 40: 15(int) Load 17(r) + 41: 15(int) IAdd 40 39 + Store 17(r) 41 + 42: 11(bool) Load 19(a) + 43: 15(int) Select 42 21 18 + 44: 11(bool) Load 13(b) + 45: 15(int) Select 44 21 18 + 46: 15(int) SDiv 43 45 + 47: 15(int) Load 17(r) + 48: 15(int) IAdd 47 46 + Store 17(r) 48 + 49: 11(bool) Load 19(a) 50: 15(int) Select 49 21 18 - 51: 15(int) Load 17(r) - 52: 15(int) IAdd 51 50 - Store 17(r) 52 - 53: 11(bool) Load 19(a) - 54: 15(int) Select 53 21 18 - 55: 11(bool) Load 13(b) - 56: 15(int) Select 55 21 18 - 57: 11(bool) SMod 54 56 - 58: 15(int) Select 57 21 18 - 59: 15(int) Load 17(r) - 60: 15(int) IAdd 59 58 - Store 17(r) 60 - 61: 11(bool) Load 19(a) - 62: 15(int) Select 61 21 18 - 63: 11(bool) Load 13(b) + 51: 11(bool) Load 13(b) + 52: 15(int) Select 51 21 18 + 53: 15(int) SMod 50 52 + 54: 15(int) Load 17(r) + 55: 15(int) IAdd 54 53 + Store 17(r) 55 + 56: 11(bool) Load 19(a) + 57: 15(int) Select 56 21 18 + 58: 11(bool) Load 13(b) + 59: 15(int) Select 58 21 18 + 60: 15(int) BitwiseAnd 57 59 + 61: 15(int) Load 17(r) + 62: 15(int) IAdd 61 60 + Store 17(r) 62 + 63: 11(bool) Load 19(a) 64: 15(int) Select 63 21 18 - 65: 11(bool) BitwiseAnd 62 64 + 65: 11(bool) Load 13(b) 66: 15(int) Select 65 21 18 - 67: 15(int) Load 17(r) - 68: 15(int) IAdd 67 66 - Store 17(r) 68 - 69: 11(bool) Load 19(a) - 70: 15(int) Select 69 21 18 - 71: 11(bool) Load 13(b) - 72: 15(int) Select 71 21 18 - 73: 11(bool) BitwiseOr 70 72 - 74: 15(int) Select 73 21 18 + 67: 15(int) BitwiseOr 64 66 + 68: 15(int) Load 17(r) + 69: 15(int) IAdd 68 67 + Store 17(r) 69 + 70: 11(bool) Load 19(a) + 71: 15(int) Select 70 21 18 + 72: 11(bool) Load 13(b) + 73: 15(int) Select 72 21 18 + 74: 15(int) BitwiseXor 71 73 75: 15(int) Load 17(r) 76: 15(int) IAdd 75 74 Store 17(r) 76 @@ -333,31 +314,20 @@ 78: 15(int) Select 77 21 18 79: 11(bool) Load 13(b) 80: 15(int) Select 79 21 18 - 81: 11(bool) BitwiseXor 78 80 - 82: 15(int) Select 81 21 18 - 83: 15(int) Load 17(r) - 84: 15(int) IAdd 83 82 - Store 17(r) 84 - 85: 11(bool) Load 19(a) - 86: 15(int) Select 85 21 18 - 87: 11(bool) Load 13(b) - 88: 15(int) Select 87 21 18 - 89: 11(bool) ShiftLeftLogical 86 88 - 90: 15(int) Select 89 21 18 + 81: 15(int) ShiftLeftLogical 78 80 + 82: 15(int) Load 17(r) + 83: 15(int) IAdd 82 81 + Store 17(r) 83 + 84: 11(bool) Load 19(a) + 85: 15(int) Select 84 21 18 + 86: 11(bool) Load 13(b) + 87: 15(int) Select 86 21 18 + 88: 15(int) ShiftRightArithmetic 85 87 + 89: 15(int) Load 17(r) + 90: 15(int) IAdd 89 88 + Store 17(r) 90 91: 15(int) Load 17(r) - 92: 15(int) IAdd 91 90 - Store 17(r) 92 - 93: 11(bool) Load 19(a) - 94: 15(int) Select 93 21 18 - 95: 11(bool) Load 13(b) - 96: 15(int) Select 95 21 18 - 97: 11(bool) ShiftRightArithmetic 94 96 - 98: 15(int) Select 97 21 18 - 99: 15(int) Load 17(r) - 100: 15(int) IAdd 99 98 - Store 17(r) 100 - 101: 15(int) Load 17(r) - 102: 6(float) ConvertSToF 101 - 103: 7(fvec4) CompositeConstruct 102 102 102 102 - ReturnValue 103 + 92: 6(float) ConvertSToF 91 + 93: 7(fvec4) CompositeConstruct 92 92 92 92 + ReturnValue 93 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.buffer.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.buffer.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.buffer.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.buffer.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -8,50 +8,66 @@ 0:31 Branch: Return with expression 0:31 Constant: 0:31 1.000000 -0:35 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float) -0:35 Function Parameters: -0:35 'input' ( in 4-component vector of float) +0:43 Function Definition: @PixelShaderFunction(vf4; ( temp structure{ temp 4-component vector of float a}) +0:43 Function Parameters: +0:43 'input' ( in 4-component vector of float) 0:? Sequence -0:36 Branch: Return with expression -0:36 vector-scale ( temp 4-component vector of float) -0:36 add ( temp 4-component vector of float) -0:36 add ( temp 4-component vector of float) -0:36 add ( temp 4-component vector of float) -0:36 add ( temp 4-component vector of float) -0:36 'input' ( in 4-component vector of float) -0:36 v1: direct index for structure (layout( row_major std140) uniform 4-component vector of float) -0:36 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1}) -0:36 Constant: -0:36 0 (const uint) -0:36 v2: direct index for structure (layout( row_major std430) buffer 4-component vector of float) -0:36 'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2}) -0:36 Constant: -0:36 0 (const uint) -0:36 v3: direct index for structure (layout( row_major std140 offset=0) uniform 4-component vector of float) -0:36 'anon@2' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3}) -0:36 Constant: -0:36 0 (const uint) -0:36 v4: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float) -0:36 'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430 offset=128) buffer float f7, layout( row_major std430 offset=112) buffer 3X4 matrix of float m1, layout( column_major std430 offset=176) buffer 3X4 matrix of float m2, layout( row_major std430 offset=240) buffer 3X4 matrix of float m3, layout( row_major std430 offset=304) buffer 3X4 matrix of float m4}) -0:36 Constant: -0:36 0 (const uint) -0:36 Function Call: foo( ( temp float) -0:35 Function Definition: PixelShaderFunction( ( temp void) -0:35 Function Parameters: +0:45 move second child to first child ( temp 4-component vector of float) +0:45 a: direct index for structure ( temp 4-component vector of float) +0:45 'ret' ( temp structure{ temp 4-component vector of float a}) +0:45 Constant: +0:45 0 (const int) +0:45 add ( temp 4-component vector of float) +0:45 v24: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:45 'anon@4' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v24}) +0:45 Constant: +0:45 0 (const uint) +0:45 vector-scale ( temp 4-component vector of float) +0:45 add ( temp 4-component vector of float) +0:45 add ( temp 4-component vector of float) +0:45 add ( temp 4-component vector of float) +0:45 add ( temp 4-component vector of float) +0:45 'input' ( in 4-component vector of float) +0:45 v1: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:45 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1}) +0:45 Constant: +0:45 0 (const uint) +0:45 v2: direct index for structure (layout( row_major std430) buffer 4-component vector of float) +0:45 'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2}) +0:45 Constant: +0:45 0 (const uint) +0:45 v3: direct index for structure (layout( row_major std140 offset=0) uniform 4-component vector of float) +0:45 'anon@2' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3}) +0:45 Constant: +0:45 0 (const uint) +0:45 v4: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float) +0:45 'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430 offset=128) buffer float f7, layout( row_major std430 offset=112) buffer 3X4 matrix of float m1, layout( column_major std430 offset=176) buffer 3X4 matrix of float m2, layout( row_major std430 offset=240) buffer 3X4 matrix of float m3, layout( row_major std430 offset=304) buffer 3X4 matrix of float m4}) +0:45 Constant: +0:45 0 (const uint) +0:45 Function Call: foo( ( temp float) +0:46 Branch: Return with expression +0:46 'ret' ( temp structure{ temp 4-component vector of float a}) +0:43 Function Definition: PixelShaderFunction( ( temp void) +0:43 Function Parameters: 0:? Sequence -0:35 move second child to first child ( temp 4-component vector of float) +0:43 move second child to first child ( temp 4-component vector of float) 0:? 'input' ( temp 4-component vector of float) 0:? 'input' ( in 4-component vector of float FragCoord) -0:35 move second child to first child ( temp 4-component vector of float) -0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) -0:35 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float) -0:? 'input' ( temp 4-component vector of float) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.a' (layout( location=0) out 4-component vector of float) +0:43 a: direct index for structure ( temp 4-component vector of float) +0:43 Function Call: @PixelShaderFunction(vf4; ( temp structure{ temp 4-component vector of float a}) +0:? 'input' ( temp 4-component vector of float) +0:43 Constant: +0:43 0 (const int) 0:? Linker Objects 0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1}) 0:? 'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2}) 0:? 'anon@2' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3}) 0:? 'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430 offset=128) buffer float f7, layout( row_major std430 offset=112) buffer 3X4 matrix of float m1, layout( column_major std430 offset=176) buffer 3X4 matrix of float m2, layout( row_major std430 offset=240) buffer 3X4 matrix of float m3, layout( row_major std430 offset=304) buffer 3X4 matrix of float m4}) -0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'anon@4' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v24}) +0:? '@entryPointOutput.a' (layout( location=0) out 4-component vector of float) 0:? 'input' ( in 4-component vector of float FragCoord) @@ -67,203 +83,241 @@ 0:31 Branch: Return with expression 0:31 Constant: 0:31 1.000000 -0:35 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float) -0:35 Function Parameters: -0:35 'input' ( in 4-component vector of float) +0:43 Function Definition: @PixelShaderFunction(vf4; ( temp structure{ temp 4-component vector of float a}) +0:43 Function Parameters: +0:43 'input' ( in 4-component vector of float) 0:? Sequence -0:36 Branch: Return with expression -0:36 vector-scale ( temp 4-component vector of float) -0:36 add ( temp 4-component vector of float) -0:36 add ( temp 4-component vector of float) -0:36 add ( temp 4-component vector of float) -0:36 add ( temp 4-component vector of float) -0:36 'input' ( in 4-component vector of float) -0:36 v1: direct index for structure (layout( row_major std140) uniform 4-component vector of float) -0:36 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1}) -0:36 Constant: -0:36 0 (const uint) -0:36 v2: direct index for structure (layout( row_major std430) buffer 4-component vector of float) -0:36 'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2}) -0:36 Constant: -0:36 0 (const uint) -0:36 v3: direct index for structure (layout( row_major std140 offset=0) uniform 4-component vector of float) -0:36 'anon@2' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3}) -0:36 Constant: -0:36 0 (const uint) -0:36 v4: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float) -0:36 'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430 offset=128) buffer float f7, layout( row_major std430 offset=112) buffer 3X4 matrix of float m1, layout( column_major std430 offset=176) buffer 3X4 matrix of float m2, layout( row_major std430 offset=240) buffer 3X4 matrix of float m3, layout( row_major std430 offset=304) buffer 3X4 matrix of float m4}) -0:36 Constant: -0:36 0 (const uint) -0:36 Function Call: foo( ( temp float) -0:35 Function Definition: PixelShaderFunction( ( temp void) -0:35 Function Parameters: +0:45 move second child to first child ( temp 4-component vector of float) +0:45 a: direct index for structure ( temp 4-component vector of float) +0:45 'ret' ( temp structure{ temp 4-component vector of float a}) +0:45 Constant: +0:45 0 (const int) +0:45 add ( temp 4-component vector of float) +0:45 v24: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:45 'anon@4' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v24}) +0:45 Constant: +0:45 0 (const uint) +0:45 vector-scale ( temp 4-component vector of float) +0:45 add ( temp 4-component vector of float) +0:45 add ( temp 4-component vector of float) +0:45 add ( temp 4-component vector of float) +0:45 add ( temp 4-component vector of float) +0:45 'input' ( in 4-component vector of float) +0:45 v1: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:45 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1}) +0:45 Constant: +0:45 0 (const uint) +0:45 v2: direct index for structure (layout( row_major std430) buffer 4-component vector of float) +0:45 'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2}) +0:45 Constant: +0:45 0 (const uint) +0:45 v3: direct index for structure (layout( row_major std140 offset=0) uniform 4-component vector of float) +0:45 'anon@2' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3}) +0:45 Constant: +0:45 0 (const uint) +0:45 v4: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float) +0:45 'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430 offset=128) buffer float f7, layout( row_major std430 offset=112) buffer 3X4 matrix of float m1, layout( column_major std430 offset=176) buffer 3X4 matrix of float m2, layout( row_major std430 offset=240) buffer 3X4 matrix of float m3, layout( row_major std430 offset=304) buffer 3X4 matrix of float m4}) +0:45 Constant: +0:45 0 (const uint) +0:45 Function Call: foo( ( temp float) +0:46 Branch: Return with expression +0:46 'ret' ( temp structure{ temp 4-component vector of float a}) +0:43 Function Definition: PixelShaderFunction( ( temp void) +0:43 Function Parameters: 0:? Sequence -0:35 move second child to first child ( temp 4-component vector of float) +0:43 move second child to first child ( temp 4-component vector of float) 0:? 'input' ( temp 4-component vector of float) 0:? 'input' ( in 4-component vector of float FragCoord) -0:35 move second child to first child ( temp 4-component vector of float) -0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) -0:35 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float) -0:? 'input' ( temp 4-component vector of float) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.a' (layout( location=0) out 4-component vector of float) +0:43 a: direct index for structure ( temp 4-component vector of float) +0:43 Function Call: @PixelShaderFunction(vf4; ( temp structure{ temp 4-component vector of float a}) +0:? 'input' ( temp 4-component vector of float) +0:43 Constant: +0:43 0 (const int) 0:? Linker Objects 0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1}) 0:? 'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2}) 0:? 'anon@2' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3}) 0:? 'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430 offset=128) buffer float f7, layout( row_major std430 offset=112) buffer 3X4 matrix of float m1, layout( column_major std430 offset=176) buffer 3X4 matrix of float m2, layout( row_major std430 offset=240) buffer 3X4 matrix of float m3, layout( row_major std430 offset=304) buffer 3X4 matrix of float m4}) -0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'anon@4' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v24}) +0:? '@entryPointOutput.a' (layout( location=0) out 4-component vector of float) 0:? 'input' ( in 4-component vector of float FragCoord) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 61 +// Generated by (magic number): 80006 +// Id's are bound by 73 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "PixelShaderFunction" 54 57 + EntryPoint Fragment 4 "PixelShaderFunction" 65 68 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "PixelShaderFunction" Name 8 "foo(" - Name 14 "@PixelShaderFunction(vf4;" - Name 13 "input" - Name 20 "buf1" - MemberName 20(buf1) 0 "v1" - Name 22 "" - Name 29 "buf2" - MemberName 29(buf2) 0 "v2" - Name 31 "" - Name 35 "cbufName" - MemberName 35(cbufName) 0 "v3" - MemberName 35(cbufName) 1 "i3" - Name 37 "" - Name 42 "tbufName" - MemberName 42(tbufName) 0 "v4" - MemberName 42(tbufName) 1 "i4" - MemberName 42(tbufName) 2 "f1" - MemberName 42(tbufName) 3 "f3" - MemberName 42(tbufName) 4 "f4" - MemberName 42(tbufName) 5 "f5" - MemberName 42(tbufName) 6 "f6" - MemberName 42(tbufName) 7 "f7" - MemberName 42(tbufName) 8 "m1" - MemberName 42(tbufName) 9 "m2" - MemberName 42(tbufName) 10 "m3" - MemberName 42(tbufName) 11 "m4" - Name 44 "" - Name 52 "input" - Name 54 "input" - Name 57 "@entryPointOutput" - Name 58 "param" - MemberDecorate 20(buf1) 0 Offset 0 - Decorate 20(buf1) Block - Decorate 22 DescriptorSet 0 - MemberDecorate 29(buf2) 0 NonWritable - MemberDecorate 29(buf2) 0 Offset 0 - Decorate 29(buf2) BufferBlock - Decorate 31 DescriptorSet 0 - MemberDecorate 35(cbufName) 0 Offset 0 - MemberDecorate 35(cbufName) 1 Offset 20 - Decorate 35(cbufName) Block - Decorate 37 DescriptorSet 0 - MemberDecorate 42(tbufName) 0 NonWritable - MemberDecorate 42(tbufName) 0 Offset 16 - MemberDecorate 42(tbufName) 1 NonWritable - MemberDecorate 42(tbufName) 1 Offset 48 - MemberDecorate 42(tbufName) 2 NonWritable - MemberDecorate 42(tbufName) 2 Offset 60 - MemberDecorate 42(tbufName) 3 NonWritable - MemberDecorate 42(tbufName) 3 Offset 64 - MemberDecorate 42(tbufName) 4 NonWritable - MemberDecorate 42(tbufName) 4 Offset 68 - MemberDecorate 42(tbufName) 5 NonWritable - MemberDecorate 42(tbufName) 5 Offset 72 - MemberDecorate 42(tbufName) 6 NonWritable - MemberDecorate 42(tbufName) 6 Offset 76 - MemberDecorate 42(tbufName) 7 NonWritable - MemberDecorate 42(tbufName) 7 Offset 128 - MemberDecorate 42(tbufName) 8 RowMajor - MemberDecorate 42(tbufName) 8 NonWritable - MemberDecorate 42(tbufName) 8 Offset 112 - MemberDecorate 42(tbufName) 8 MatrixStride 16 - MemberDecorate 42(tbufName) 9 ColMajor - MemberDecorate 42(tbufName) 9 NonWritable - MemberDecorate 42(tbufName) 9 Offset 176 - MemberDecorate 42(tbufName) 9 MatrixStride 16 - MemberDecorate 42(tbufName) 10 RowMajor - MemberDecorate 42(tbufName) 10 NonWritable - MemberDecorate 42(tbufName) 10 Offset 240 - MemberDecorate 42(tbufName) 10 MatrixStride 16 - MemberDecorate 42(tbufName) 11 RowMajor - MemberDecorate 42(tbufName) 11 NonWritable - MemberDecorate 42(tbufName) 11 Offset 304 - MemberDecorate 42(tbufName) 11 MatrixStride 16 - Decorate 42(tbufName) BufferBlock - Decorate 44 DescriptorSet 0 - Decorate 44 Binding 8 - Decorate 54(input) BuiltIn FragCoord - Decorate 57(@entryPointOutput) Location 0 + Name 12 "id" + MemberName 12(id) 0 "a" + Name 15 "@PixelShaderFunction(vf4;" + Name 14 "input" + Name 21 "ret" + Name 24 "cbufName2" + MemberName 24(cbufName2) 0 "v24" + Name 26 "" + Name 31 "buf1" + MemberName 31(buf1) 0 "v1" + Name 33 "" + Name 37 "buf2" + MemberName 37(buf2) 0 "v2" + Name 39 "" + Name 43 "cbufName" + MemberName 43(cbufName) 0 "v3" + MemberName 43(cbufName) 1 "i3" + Name 45 "" + Name 50 "tbufName" + MemberName 50(tbufName) 0 "v4" + MemberName 50(tbufName) 1 "i4" + MemberName 50(tbufName) 2 "f1" + MemberName 50(tbufName) 3 "f3" + MemberName 50(tbufName) 4 "f4" + MemberName 50(tbufName) 5 "f5" + MemberName 50(tbufName) 6 "f6" + MemberName 50(tbufName) 7 "f7" + MemberName 50(tbufName) 8 "m1" + MemberName 50(tbufName) 9 "m2" + MemberName 50(tbufName) 10 "m3" + MemberName 50(tbufName) 11 "m4" + Name 52 "" + Name 63 "input" + Name 65 "input" + Name 68 "@entryPointOutput.a" + Name 69 "param" + MemberDecorate 24(cbufName2) 0 Offset 0 + Decorate 24(cbufName2) Block + Decorate 26 DescriptorSet 0 + MemberDecorate 31(buf1) 0 Offset 0 + Decorate 31(buf1) Block + Decorate 33 DescriptorSet 0 + MemberDecorate 37(buf2) 0 NonWritable + MemberDecorate 37(buf2) 0 Offset 0 + Decorate 37(buf2) BufferBlock + Decorate 39 DescriptorSet 0 + MemberDecorate 43(cbufName) 0 Offset 0 + MemberDecorate 43(cbufName) 1 Offset 20 + Decorate 43(cbufName) Block + Decorate 45 DescriptorSet 0 + MemberDecorate 50(tbufName) 0 NonWritable + MemberDecorate 50(tbufName) 0 Offset 16 + MemberDecorate 50(tbufName) 1 NonWritable + MemberDecorate 50(tbufName) 1 Offset 48 + MemberDecorate 50(tbufName) 2 NonWritable + MemberDecorate 50(tbufName) 2 Offset 60 + MemberDecorate 50(tbufName) 3 NonWritable + MemberDecorate 50(tbufName) 3 Offset 64 + MemberDecorate 50(tbufName) 4 NonWritable + MemberDecorate 50(tbufName) 4 Offset 68 + MemberDecorate 50(tbufName) 5 NonWritable + MemberDecorate 50(tbufName) 5 Offset 72 + MemberDecorate 50(tbufName) 6 NonWritable + MemberDecorate 50(tbufName) 6 Offset 76 + MemberDecorate 50(tbufName) 7 NonWritable + MemberDecorate 50(tbufName) 7 Offset 128 + MemberDecorate 50(tbufName) 8 RowMajor + MemberDecorate 50(tbufName) 8 NonWritable + MemberDecorate 50(tbufName) 8 Offset 112 + MemberDecorate 50(tbufName) 8 MatrixStride 16 + MemberDecorate 50(tbufName) 9 ColMajor + MemberDecorate 50(tbufName) 9 NonWritable + MemberDecorate 50(tbufName) 9 Offset 176 + MemberDecorate 50(tbufName) 9 MatrixStride 16 + MemberDecorate 50(tbufName) 10 RowMajor + MemberDecorate 50(tbufName) 10 NonWritable + MemberDecorate 50(tbufName) 10 Offset 240 + MemberDecorate 50(tbufName) 10 MatrixStride 16 + MemberDecorate 50(tbufName) 11 RowMajor + MemberDecorate 50(tbufName) 11 NonWritable + MemberDecorate 50(tbufName) 11 Offset 304 + MemberDecorate 50(tbufName) 11 MatrixStride 16 + Decorate 50(tbufName) BufferBlock + Decorate 52 DescriptorSet 0 + Decorate 52 Binding 8 + Decorate 65(input) BuiltIn FragCoord + Decorate 68(@entryPointOutput.a) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 7: TypeFunction 6(float) 10: TypeVector 6(float) 4 11: TypePointer Function 10(fvec4) - 12: TypeFunction 10(fvec4) 11(ptr) - 16: 6(float) Constant 1065353216 - 20(buf1): TypeStruct 10(fvec4) - 21: TypePointer Uniform 20(buf1) - 22: 21(ptr) Variable Uniform - 23: TypeInt 32 1 - 24: 23(int) Constant 0 - 25: TypePointer Uniform 10(fvec4) - 29(buf2): TypeStruct 10(fvec4) - 30: TypePointer Uniform 29(buf2) - 31: 30(ptr) Variable Uniform - 35(cbufName): TypeStruct 10(fvec4) 23(int) - 36: TypePointer Uniform 35(cbufName) - 37: 36(ptr) Variable Uniform - 41: TypeMatrix 10(fvec4) 3 - 42(tbufName): TypeStruct 10(fvec4) 23(int) 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 41 41 41 41 - 43: TypePointer Uniform 42(tbufName) - 44: 43(ptr) Variable Uniform - 53: TypePointer Input 10(fvec4) - 54(input): 53(ptr) Variable Input - 56: TypePointer Output 10(fvec4) -57(@entryPointOutput): 56(ptr) Variable Output + 12(id): TypeStruct 10(fvec4) + 13: TypeFunction 12(id) 11(ptr) + 17: 6(float) Constant 1065353216 + 20: TypePointer Function 12(id) + 22: TypeInt 32 1 + 23: 22(int) Constant 0 + 24(cbufName2): TypeStruct 10(fvec4) + 25: TypePointer Uniform 24(cbufName2) + 26: 25(ptr) Variable Uniform + 27: TypePointer Uniform 10(fvec4) + 31(buf1): TypeStruct 10(fvec4) + 32: TypePointer Uniform 31(buf1) + 33: 32(ptr) Variable Uniform + 37(buf2): TypeStruct 10(fvec4) + 38: TypePointer Uniform 37(buf2) + 39: 38(ptr) Variable Uniform + 43(cbufName): TypeStruct 10(fvec4) 22(int) + 44: TypePointer Uniform 43(cbufName) + 45: 44(ptr) Variable Uniform + 49: TypeMatrix 10(fvec4) 3 + 50(tbufName): TypeStruct 10(fvec4) 22(int) 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 49 49 49 49 + 51: TypePointer Uniform 50(tbufName) + 52: 51(ptr) Variable Uniform + 64: TypePointer Input 10(fvec4) + 65(input): 64(ptr) Variable Input + 67: TypePointer Output 10(fvec4) +68(@entryPointOutput.a): 67(ptr) Variable Output 4(PixelShaderFunction): 2 Function None 3 5: Label - 52(input): 11(ptr) Variable Function - 58(param): 11(ptr) Variable Function - 55: 10(fvec4) Load 54(input) - Store 52(input) 55 - 59: 10(fvec4) Load 52(input) - Store 58(param) 59 - 60: 10(fvec4) FunctionCall 14(@PixelShaderFunction(vf4;) 58(param) - Store 57(@entryPointOutput) 60 + 63(input): 11(ptr) Variable Function + 69(param): 11(ptr) Variable Function + 66: 10(fvec4) Load 65(input) + Store 63(input) 66 + 70: 10(fvec4) Load 63(input) + Store 69(param) 70 + 71: 12(id) FunctionCall 15(@PixelShaderFunction(vf4;) 69(param) + 72: 10(fvec4) CompositeExtract 71 0 + Store 68(@entryPointOutput.a) 72 Return FunctionEnd 8(foo(): 6(float) Function None 7 9: Label - ReturnValue 16 + ReturnValue 17 FunctionEnd -14(@PixelShaderFunction(vf4;): 10(fvec4) Function None 12 - 13(input): 11(ptr) FunctionParameter - 15: Label - 19: 10(fvec4) Load 13(input) - 26: 25(ptr) AccessChain 22 24 - 27: 10(fvec4) Load 26 - 28: 10(fvec4) FAdd 19 27 - 32: 25(ptr) AccessChain 31 24 - 33: 10(fvec4) Load 32 - 34: 10(fvec4) FAdd 28 33 - 38: 25(ptr) AccessChain 37 24 - 39: 10(fvec4) Load 38 - 40: 10(fvec4) FAdd 34 39 - 45: 25(ptr) AccessChain 44 24 - 46: 10(fvec4) Load 45 - 47: 10(fvec4) FAdd 40 46 - 48: 6(float) FunctionCall 8(foo() - 49: 10(fvec4) VectorTimesScalar 47 48 - ReturnValue 49 +15(@PixelShaderFunction(vf4;): 12(id) Function None 13 + 14(input): 11(ptr) FunctionParameter + 16: Label + 21(ret): 20(ptr) Variable Function + 28: 27(ptr) AccessChain 26 23 + 29: 10(fvec4) Load 28 + 30: 10(fvec4) Load 14(input) + 34: 27(ptr) AccessChain 33 23 + 35: 10(fvec4) Load 34 + 36: 10(fvec4) FAdd 30 35 + 40: 27(ptr) AccessChain 39 23 + 41: 10(fvec4) Load 40 + 42: 10(fvec4) FAdd 36 41 + 46: 27(ptr) AccessChain 45 23 + 47: 10(fvec4) Load 46 + 48: 10(fvec4) FAdd 42 47 + 53: 27(ptr) AccessChain 52 23 + 54: 10(fvec4) Load 53 + 55: 10(fvec4) FAdd 48 54 + 56: 6(float) FunctionCall 8(foo() + 57: 10(fvec4) VectorTimesScalar 55 56 + 58: 10(fvec4) FAdd 29 57 + 59: 11(ptr) AccessChain 21(ret) 23 + Store 59 58 + 60: 12(id) Load 21(ret) + ReturnValue 60 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.calculatelod.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.calculatelod.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.calculatelod.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.calculatelod.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.calculatelod.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -181,6 +182,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -356,7 +358,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 148 Capability Shader @@ -367,6 +369,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 140 144 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -13,6 +13,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any ERROR: node is still EOpNull! 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -193,6 +194,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any ERROR: node is still EOpNull! 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.cast.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.cast.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.cast.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.cast.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -72,7 +72,7 @@ 0:? 'input' (layout( location=0) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 39 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.cbuffer-identifier.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.cbuffer-identifier.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.cbuffer-identifier.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.cbuffer-identifier.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,417 @@ +hlsl.cbuffer-identifier.vert +WARNING: 0:29: '' : mul() matrix size mismatch + +Shader version: 500 +0:? Sequence +0:22 Function Definition: @main(struct-VS_INPUT-vf4-vf31; ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Function Parameters: +0:22 'input' ( in structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:? Sequence +0:23 Sequence +0:23 move second child to first child ( temp int) +0:23 'ConstantBuffer' ( temp int) +0:23 Constant: +0:23 42 (const int) +0:25 Sequence +0:25 move second child to first child ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:25 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:25 Constant: +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:26 move second child to first child ( temp 4-component vector of float) +0:26 Pos: direct index for structure ( temp 4-component vector of float) +0:26 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:26 Constant: +0:26 0 (const int) +0:26 matrix-times-vector ( temp 4-component vector of float) +0:26 World: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:26 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:26 Constant: +0:26 0 (const uint) +0:26 Pos: direct index for structure ( temp 4-component vector of float) +0:26 'input' ( in structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:26 Constant: +0:26 0 (const int) +0:27 move second child to first child ( temp 4-component vector of float) +0:27 Pos: direct index for structure ( temp 4-component vector of float) +0:27 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:27 Constant: +0:27 0 (const int) +0:27 matrix-times-vector ( temp 4-component vector of float) +0:27 View: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:27 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:27 Constant: +0:27 1 (const uint) +0:27 Pos: direct index for structure ( temp 4-component vector of float) +0:27 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:27 Constant: +0:27 0 (const int) +0:28 move second child to first child ( temp 4-component vector of float) +0:28 Pos: direct index for structure ( temp 4-component vector of float) +0:28 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:28 Constant: +0:28 0 (const int) +0:28 matrix-times-vector ( temp 4-component vector of float) +0:28 Projection: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:28 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:28 Constant: +0:28 2 (const uint) +0:28 Pos: direct index for structure ( temp 4-component vector of float) +0:28 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:28 Constant: +0:28 0 (const int) +0:29 move second child to first child ( temp 3-component vector of float) +0:29 Norm: direct index for structure ( temp 3-component vector of float) +0:29 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:29 Constant: +0:29 1 (const int) +0:29 Construct vec3 ( temp 3-component vector of float) +0:29 matrix-times-vector ( temp 4-component vector of float) +0:29 Construct mat3x4 ( uniform 3X4 matrix of float) +0:29 World: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:29 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:29 Constant: +0:29 0 (const uint) +0:29 Norm: direct index for structure ( temp 3-component vector of float) +0:29 'input' ( in structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:29 Constant: +0:29 1 (const int) +0:31 Branch: Return with expression +0:31 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Function Definition: main( ( temp void) +0:22 Function Parameters: +0:? Sequence +0:22 Sequence +0:22 move second child to first child ( temp 4-component vector of float) +0:22 Pos: direct index for structure ( temp 4-component vector of float) +0:? 'input' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Constant: +0:22 0 (const int) +0:? 'input.Pos' (layout( location=0) in 4-component vector of float) +0:22 move second child to first child ( temp 3-component vector of float) +0:22 Norm: direct index for structure ( temp 3-component vector of float) +0:? 'input' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Constant: +0:22 1 (const int) +0:? 'input.Norm' (layout( location=1) in 3-component vector of float) +0:22 Sequence +0:22 move second child to first child ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Function Call: @main(struct-VS_INPUT-vf4-vf31; ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:? 'input' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:22 Pos: direct index for structure ( temp 4-component vector of float) +0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Constant: +0:22 0 (const int) +0:22 move second child to first child ( temp 3-component vector of float) +0:? '@entryPointOutput.Norm' (layout( location=0) out 3-component vector of float) +0:22 Norm: direct index for structure ( temp 3-component vector of float) +0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Constant: +0:22 1 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:? '@entryPointOutput.Norm' (layout( location=0) out 3-component vector of float) +0:? 'input.Pos' (layout( location=0) in 4-component vector of float) +0:? 'input.Norm' (layout( location=1) in 3-component vector of float) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:22 Function Definition: @main(struct-VS_INPUT-vf4-vf31; ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Function Parameters: +0:22 'input' ( in structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:? Sequence +0:23 Sequence +0:23 move second child to first child ( temp int) +0:23 'ConstantBuffer' ( temp int) +0:23 Constant: +0:23 42 (const int) +0:25 Sequence +0:25 move second child to first child ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:25 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:25 Constant: +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:26 move second child to first child ( temp 4-component vector of float) +0:26 Pos: direct index for structure ( temp 4-component vector of float) +0:26 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:26 Constant: +0:26 0 (const int) +0:26 matrix-times-vector ( temp 4-component vector of float) +0:26 World: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:26 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:26 Constant: +0:26 0 (const uint) +0:26 Pos: direct index for structure ( temp 4-component vector of float) +0:26 'input' ( in structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:26 Constant: +0:26 0 (const int) +0:27 move second child to first child ( temp 4-component vector of float) +0:27 Pos: direct index for structure ( temp 4-component vector of float) +0:27 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:27 Constant: +0:27 0 (const int) +0:27 matrix-times-vector ( temp 4-component vector of float) +0:27 View: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:27 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:27 Constant: +0:27 1 (const uint) +0:27 Pos: direct index for structure ( temp 4-component vector of float) +0:27 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:27 Constant: +0:27 0 (const int) +0:28 move second child to first child ( temp 4-component vector of float) +0:28 Pos: direct index for structure ( temp 4-component vector of float) +0:28 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:28 Constant: +0:28 0 (const int) +0:28 matrix-times-vector ( temp 4-component vector of float) +0:28 Projection: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:28 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:28 Constant: +0:28 2 (const uint) +0:28 Pos: direct index for structure ( temp 4-component vector of float) +0:28 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:28 Constant: +0:28 0 (const int) +0:29 move second child to first child ( temp 3-component vector of float) +0:29 Norm: direct index for structure ( temp 3-component vector of float) +0:29 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:29 Constant: +0:29 1 (const int) +0:29 Construct vec3 ( temp 3-component vector of float) +0:29 matrix-times-vector ( temp 4-component vector of float) +0:29 Construct mat3x4 ( uniform 3X4 matrix of float) +0:29 World: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:29 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:29 Constant: +0:29 0 (const uint) +0:29 Norm: direct index for structure ( temp 3-component vector of float) +0:29 'input' ( in structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:29 Constant: +0:29 1 (const int) +0:31 Branch: Return with expression +0:31 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Function Definition: main( ( temp void) +0:22 Function Parameters: +0:? Sequence +0:22 Sequence +0:22 move second child to first child ( temp 4-component vector of float) +0:22 Pos: direct index for structure ( temp 4-component vector of float) +0:? 'input' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Constant: +0:22 0 (const int) +0:? 'input.Pos' (layout( location=0) in 4-component vector of float) +0:22 move second child to first child ( temp 3-component vector of float) +0:22 Norm: direct index for structure ( temp 3-component vector of float) +0:? 'input' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Constant: +0:22 1 (const int) +0:? 'input.Norm' (layout( location=1) in 3-component vector of float) +0:22 Sequence +0:22 move second child to first child ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Function Call: @main(struct-VS_INPUT-vf4-vf31; ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:? 'input' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:22 Pos: direct index for structure ( temp 4-component vector of float) +0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Constant: +0:22 0 (const int) +0:22 move second child to first child ( temp 3-component vector of float) +0:? '@entryPointOutput.Norm' (layout( location=0) out 3-component vector of float) +0:22 Norm: direct index for structure ( temp 3-component vector of float) +0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Constant: +0:22 1 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:? '@entryPointOutput.Norm' (layout( location=0) out 3-component vector of float) +0:? 'input.Pos' (layout( location=0) in 4-component vector of float) +0:? 'input.Norm' (layout( location=1) in 3-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 106 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 87 91 99 103 + Source HLSL 500 + Name 4 "main" + Name 9 "VS_INPUT" + MemberName 9(VS_INPUT) 0 "Pos" + MemberName 9(VS_INPUT) 1 "Norm" + Name 11 "PS_INPUT" + MemberName 11(PS_INPUT) 0 "Pos" + MemberName 11(PS_INPUT) 1 "Norm" + Name 14 "@main(struct-VS_INPUT-vf4-vf31;" + Name 13 "input" + Name 18 "ConstantBuffer" + Name 21 "output" + Name 28 "C" + MemberName 28(C) 0 "World" + MemberName 28(C) 1 "View" + MemberName 28(C) 2 "Projection" + Name 30 "" + Name 85 "input" + Name 87 "input.Pos" + Name 91 "input.Norm" + Name 94 "flattenTemp" + Name 95 "param" + Name 99 "@entryPointOutput.Pos" + Name 103 "@entryPointOutput.Norm" + MemberDecorate 28(C) 0 RowMajor + MemberDecorate 28(C) 0 Offset 0 + MemberDecorate 28(C) 0 MatrixStride 16 + MemberDecorate 28(C) 1 RowMajor + MemberDecorate 28(C) 1 Offset 64 + MemberDecorate 28(C) 1 MatrixStride 16 + MemberDecorate 28(C) 2 RowMajor + MemberDecorate 28(C) 2 Offset 128 + MemberDecorate 28(C) 2 MatrixStride 16 + Decorate 28(C) Block + Decorate 30 DescriptorSet 0 + Decorate 30 Binding 0 + Decorate 87(input.Pos) Location 0 + Decorate 91(input.Norm) Location 1 + Decorate 99(@entryPointOutput.Pos) BuiltIn Position + Decorate 103(@entryPointOutput.Norm) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeVector 6(float) 3 + 9(VS_INPUT): TypeStruct 7(fvec4) 8(fvec3) + 10: TypePointer Function 9(VS_INPUT) + 11(PS_INPUT): TypeStruct 7(fvec4) 8(fvec3) + 12: TypeFunction 11(PS_INPUT) 10(ptr) + 16: TypeInt 32 1 + 17: TypePointer Function 16(int) + 19: 16(int) Constant 42 + 20: TypePointer Function 11(PS_INPUT) + 22: 6(float) Constant 0 + 23: 7(fvec4) ConstantComposite 22 22 22 22 + 24: 8(fvec3) ConstantComposite 22 22 22 + 25:11(PS_INPUT) ConstantComposite 23 24 + 26: 16(int) Constant 0 + 27: TypeMatrix 7(fvec4) 4 + 28(C): TypeStruct 27 27 27 + 29: TypePointer Uniform 28(C) + 30: 29(ptr) Variable Uniform + 31: TypePointer Uniform 27 + 34: TypePointer Function 7(fvec4) + 39: 16(int) Constant 1 + 46: 16(int) Constant 2 + 55: TypeMatrix 7(fvec4) 3 + 56: 6(float) Constant 1065353216 + 73: TypePointer Function 8(fvec3) + 86: TypePointer Input 7(fvec4) + 87(input.Pos): 86(ptr) Variable Input + 90: TypePointer Input 8(fvec3) + 91(input.Norm): 90(ptr) Variable Input + 98: TypePointer Output 7(fvec4) +99(@entryPointOutput.Pos): 98(ptr) Variable Output + 102: TypePointer Output 8(fvec3) +103(@entryPointOutput.Norm): 102(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 85(input): 10(ptr) Variable Function + 94(flattenTemp): 20(ptr) Variable Function + 95(param): 10(ptr) Variable Function + 88: 7(fvec4) Load 87(input.Pos) + 89: 34(ptr) AccessChain 85(input) 26 + Store 89 88 + 92: 8(fvec3) Load 91(input.Norm) + 93: 73(ptr) AccessChain 85(input) 39 + Store 93 92 + 96: 9(VS_INPUT) Load 85(input) + Store 95(param) 96 + 97:11(PS_INPUT) FunctionCall 14(@main(struct-VS_INPUT-vf4-vf31;) 95(param) + Store 94(flattenTemp) 97 + 100: 34(ptr) AccessChain 94(flattenTemp) 26 + 101: 7(fvec4) Load 100 + Store 99(@entryPointOutput.Pos) 101 + 104: 73(ptr) AccessChain 94(flattenTemp) 39 + 105: 8(fvec3) Load 104 + Store 103(@entryPointOutput.Norm) 105 + Return + FunctionEnd +14(@main(struct-VS_INPUT-vf4-vf31;):11(PS_INPUT) Function None 12 + 13(input): 10(ptr) FunctionParameter + 15: Label +18(ConstantBuffer): 17(ptr) Variable Function + 21(output): 20(ptr) Variable Function + Store 18(ConstantBuffer) 19 + Store 21(output) 25 + 32: 31(ptr) AccessChain 30 26 + 33: 27 Load 32 + 35: 34(ptr) AccessChain 13(input) 26 + 36: 7(fvec4) Load 35 + 37: 7(fvec4) MatrixTimesVector 33 36 + 38: 34(ptr) AccessChain 21(output) 26 + Store 38 37 + 40: 31(ptr) AccessChain 30 39 + 41: 27 Load 40 + 42: 34(ptr) AccessChain 21(output) 26 + 43: 7(fvec4) Load 42 + 44: 7(fvec4) MatrixTimesVector 41 43 + 45: 34(ptr) AccessChain 21(output) 26 + Store 45 44 + 47: 31(ptr) AccessChain 30 46 + 48: 27 Load 47 + 49: 34(ptr) AccessChain 21(output) 26 + 50: 7(fvec4) Load 49 + 51: 7(fvec4) MatrixTimesVector 48 50 + 52: 34(ptr) AccessChain 21(output) 26 + Store 52 51 + 53: 31(ptr) AccessChain 30 26 + 54: 27 Load 53 + 57: 6(float) CompositeExtract 54 0 0 + 58: 6(float) CompositeExtract 54 0 1 + 59: 6(float) CompositeExtract 54 0 2 + 60: 6(float) CompositeExtract 54 0 3 + 61: 6(float) CompositeExtract 54 1 0 + 62: 6(float) CompositeExtract 54 1 1 + 63: 6(float) CompositeExtract 54 1 2 + 64: 6(float) CompositeExtract 54 1 3 + 65: 6(float) CompositeExtract 54 2 0 + 66: 6(float) CompositeExtract 54 2 1 + 67: 6(float) CompositeExtract 54 2 2 + 68: 6(float) CompositeExtract 54 2 3 + 69: 7(fvec4) CompositeConstruct 57 58 59 60 + 70: 7(fvec4) CompositeConstruct 61 62 63 64 + 71: 7(fvec4) CompositeConstruct 65 66 67 68 + 72: 55 CompositeConstruct 69 70 71 + 74: 73(ptr) AccessChain 13(input) 39 + 75: 8(fvec3) Load 74 + 76: 7(fvec4) MatrixTimesVector 72 75 + 77: 6(float) CompositeExtract 76 0 + 78: 6(float) CompositeExtract 76 1 + 79: 6(float) CompositeExtract 76 2 + 80: 8(fvec3) CompositeConstruct 77 78 79 + 81: 73(ptr) AccessChain 21(output) 39 + Store 81 80 + 82:11(PS_INPUT) Load 21(output) + ReturnValue 82 + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.charLit.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.charLit.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.charLit.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.charLit.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -146,7 +146,7 @@ 0:? '@entryPointOutput' ( out 4-component vector of float Position) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 58 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-1.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-1.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-1.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-1.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -98,7 +98,7 @@ 0:? 'cull' ( in 1-element array of float CullDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 53 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-1.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-1.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-1.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-1.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -550,7 +550,7 @@ 0:? 'OutputStream.clip' ( out 2-element array of float ClipDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 118 Capability Geometry diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-1.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-1.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-1.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-1.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -108,7 +108,7 @@ 0:? 'cull' ( out 1-element array of float CullDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 46 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-2.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-2.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-2.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-2.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -290,7 +290,7 @@ 0:? 'cull' ( in 4-element array of float CullDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 84 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-2.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-2.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-2.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-2.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -724,7 +724,7 @@ 0:? 'OutputStream.clip' ( out 4-element array of float ClipDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 128 Capability Geometry diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-2.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-2.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-2.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-2.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -420,7 +420,7 @@ 0:? 'cull' ( out 4-element array of float CullDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 89 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-3.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-3.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-3.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-3.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -98,7 +98,7 @@ 0:? 'cull' ( in 2-element array of float CullDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 53 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-3.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-3.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-3.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-3.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -630,7 +630,7 @@ 0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 127 Capability Geometry diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-3.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-3.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-3.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-3.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -136,7 +136,7 @@ 0:? 'cull' ( out 2-element array of float CullDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 51 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-4.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-4.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-4.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-4.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -174,7 +174,7 @@ 0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 57 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-4.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-4.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-4.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-4.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -612,7 +612,7 @@ 0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 130 Capability Geometry diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-4.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-4.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-4.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-4.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -270,7 +270,7 @@ 0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 72 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-5.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-5.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-5.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-5.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -232,7 +232,7 @@ 0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 62 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-5.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-5.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-5.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-5.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -318,7 +318,7 @@ 0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 73 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-6.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-6.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-6.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-6.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -282,7 +282,7 @@ 0:? 'v.clip1' ( in 8-element array of float ClipDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 79 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-6.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-6.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-6.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-6.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -428,7 +428,7 @@ 0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 86 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-7.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-7.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-7.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-7.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -270,7 +270,7 @@ 0:? 'v.clip1' ( in 8-element array of float ClipDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 78 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-7.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-7.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-7.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-7.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -384,7 +384,7 @@ 0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 81 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-8.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-8.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-8.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-8.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -186,7 +186,7 @@ 0:? 'v.clip1' ( in 4-element array of float ClipDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 65 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-8.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-8.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-8.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-8.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -240,7 +240,7 @@ 0:? '@entryPointOutput.clip1' ( out 4-element array of float ClipDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 62 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-9.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-9.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-9.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-9.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -144,7 +144,7 @@ 0:? 'clip0' ( in 4-element array of float ClipDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 68 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-9.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-9.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clipdistance-9.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clipdistance-9.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -194,7 +194,7 @@ 0:? 'clip0' ( out 4-element array of float ClipDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 67 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clip.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clip.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.clip.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.clip.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -74,7 +74,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 30 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.color.hull.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.color.hull.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.color.hull.tesc.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.color.hull.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,572 @@ +hlsl.color.hull.tesc +Shader version: 500 +vertices = 3 +vertex spacing = equal_spacing +triangle order = cw +0:? Sequence +0:37 Function Definition: ColorPatchConstantFunction(struct-HullInputType-vf3-vf41[3];u1; ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:37 Function Parameters: +0:37 'inputPatch' ( in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:37 'patchId' ( in uint) +0:? Sequence +0:42 move second child to first child ( temp float) +0:42 direct index ( temp float) +0:42 edges: direct index for structure ( temp 3-element array of float) +0:42 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 0 (const int) +0:42 tessellationAmount: direct index for structure (layout( row_major std140) uniform float) +0:42 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:42 Constant: +0:42 0 (const uint) +0:43 move second child to first child ( temp float) +0:43 direct index ( temp float) +0:43 edges: direct index for structure ( temp 3-element array of float) +0:43 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:43 Constant: +0:43 0 (const int) +0:43 Constant: +0:43 1 (const int) +0:43 tessellationAmount: direct index for structure (layout( row_major std140) uniform float) +0:43 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:43 Constant: +0:43 0 (const uint) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float) +0:44 edges: direct index for structure ( temp 3-element array of float) +0:44 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 tessellationAmount: direct index for structure (layout( row_major std140) uniform float) +0:44 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:44 Constant: +0:44 0 (const uint) +0:47 move second child to first child ( temp float) +0:47 inside: direct index for structure ( temp float) +0:47 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:47 Constant: +0:47 1 (const int) +0:47 tessellationAmount: direct index for structure (layout( row_major std140) uniform float) +0:47 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:47 Constant: +0:47 0 (const uint) +0:49 Branch: Return with expression +0:49 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:63 Function Definition: @main(struct-HullInputType-vf3-vf41[3];u1;u1; ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 Function Parameters: +0:63 'patch' ( in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 'pointId' ( in uint) +0:63 'patchId' ( in uint) +0:? Sequence +0:67 move second child to first child ( temp 3-component vector of float) +0:67 position: direct index for structure ( temp 3-component vector of float) +0:67 'output' ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:67 Constant: +0:67 0 (const int) +0:67 position: direct index for structure ( temp 3-component vector of float) +0:67 indirect index ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:67 'patch' ( in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:67 'pointId' ( in uint) +0:67 Constant: +0:67 0 (const int) +0:70 move second child to first child ( temp 4-component vector of float) +0:70 color: direct index for structure ( temp 4-component vector of float) +0:70 'output' ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:70 Constant: +0:70 1 (const int) +0:70 color: direct index for structure ( temp 4-component vector of float) +0:70 indirect index ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:70 'patch' ( in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:70 'pointId' ( in uint) +0:70 Constant: +0:70 1 (const int) +0:72 Branch: Return with expression +0:72 'output' ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 Function Definition: main( ( temp void) +0:63 Function Parameters: +0:? Sequence +0:63 move second child to first child ( temp 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 move second child to first child ( temp uint) +0:? 'pointId' ( temp uint) +0:? 'pointId' ( in uint InvocationID) +0:63 move second child to first child ( temp uint) +0:? 'patchId' ( temp uint) +0:? 'patchId' ( in uint PrimitiveID) +0:63 move second child to first child ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 indirect index (layout( location=0) out structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'pointId' ( in uint InvocationID) +0:63 Function Call: @main(struct-HullInputType-vf3-vf41[3];u1;u1; ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'pointId' ( temp uint) +0:? 'patchId' ( temp uint) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'pointId' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Function Call: ColorPatchConstantFunction(struct-HullInputType-vf3-vf41[3];u1; ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patchId' ( in uint PrimitiveID) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 2 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 2 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelInner) +0:? '@patchConstantOutput.inside' ( patch out 2-element array of float TessLevelInner) +0:? Constant: +0:? 0 (const int) +0:? inside: direct index for structure ( temp float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Constant: +0:? 1 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'pointId' ( in uint InvocationID) +0:? 'patchId' ( in uint PrimitiveID) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? '@patchConstantOutput.inside' ( patch out 2-element array of float TessLevelInner) + + +Linked tessellation control stage: + + +Shader version: 500 +vertices = 3 +vertex spacing = equal_spacing +triangle order = cw +0:? Sequence +0:37 Function Definition: ColorPatchConstantFunction(struct-HullInputType-vf3-vf41[3];u1; ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:37 Function Parameters: +0:37 'inputPatch' ( in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:37 'patchId' ( in uint) +0:? Sequence +0:42 move second child to first child ( temp float) +0:42 direct index ( temp float) +0:42 edges: direct index for structure ( temp 3-element array of float) +0:42 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 0 (const int) +0:42 tessellationAmount: direct index for structure (layout( row_major std140) uniform float) +0:42 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:42 Constant: +0:42 0 (const uint) +0:43 move second child to first child ( temp float) +0:43 direct index ( temp float) +0:43 edges: direct index for structure ( temp 3-element array of float) +0:43 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:43 Constant: +0:43 0 (const int) +0:43 Constant: +0:43 1 (const int) +0:43 tessellationAmount: direct index for structure (layout( row_major std140) uniform float) +0:43 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:43 Constant: +0:43 0 (const uint) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float) +0:44 edges: direct index for structure ( temp 3-element array of float) +0:44 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 tessellationAmount: direct index for structure (layout( row_major std140) uniform float) +0:44 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:44 Constant: +0:44 0 (const uint) +0:47 move second child to first child ( temp float) +0:47 inside: direct index for structure ( temp float) +0:47 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:47 Constant: +0:47 1 (const int) +0:47 tessellationAmount: direct index for structure (layout( row_major std140) uniform float) +0:47 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:47 Constant: +0:47 0 (const uint) +0:49 Branch: Return with expression +0:49 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:63 Function Definition: @main(struct-HullInputType-vf3-vf41[3];u1;u1; ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 Function Parameters: +0:63 'patch' ( in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 'pointId' ( in uint) +0:63 'patchId' ( in uint) +0:? Sequence +0:67 move second child to first child ( temp 3-component vector of float) +0:67 position: direct index for structure ( temp 3-component vector of float) +0:67 'output' ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:67 Constant: +0:67 0 (const int) +0:67 position: direct index for structure ( temp 3-component vector of float) +0:67 indirect index ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:67 'patch' ( in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:67 'pointId' ( in uint) +0:67 Constant: +0:67 0 (const int) +0:70 move second child to first child ( temp 4-component vector of float) +0:70 color: direct index for structure ( temp 4-component vector of float) +0:70 'output' ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:70 Constant: +0:70 1 (const int) +0:70 color: direct index for structure ( temp 4-component vector of float) +0:70 indirect index ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:70 'patch' ( in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:70 'pointId' ( in uint) +0:70 Constant: +0:70 1 (const int) +0:72 Branch: Return with expression +0:72 'output' ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 Function Definition: main( ( temp void) +0:63 Function Parameters: +0:? Sequence +0:63 move second child to first child ( temp 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 move second child to first child ( temp uint) +0:? 'pointId' ( temp uint) +0:? 'pointId' ( in uint InvocationID) +0:63 move second child to first child ( temp uint) +0:? 'patchId' ( temp uint) +0:? 'patchId' ( in uint PrimitiveID) +0:63 move second child to first child ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 indirect index (layout( location=0) out structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'pointId' ( in uint InvocationID) +0:63 Function Call: @main(struct-HullInputType-vf3-vf41[3];u1;u1; ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'pointId' ( temp uint) +0:? 'patchId' ( temp uint) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'pointId' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Function Call: ColorPatchConstantFunction(struct-HullInputType-vf3-vf41[3];u1; ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patchId' ( in uint PrimitiveID) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 2 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 2 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelInner) +0:? '@patchConstantOutput.inside' ( patch out 2-element array of float TessLevelInner) +0:? Constant: +0:? 0 (const int) +0:? inside: direct index for structure ( temp float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Constant: +0:? 1 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'pointId' ( in uint InvocationID) +0:? 'patchId' ( in uint PrimitiveID) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? '@patchConstantOutput.inside' ( patch out 2-element array of float TessLevelInner) + +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 127 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 72 76 79 83 110 123 + ExecutionMode 4 OutputVertices 3 + ExecutionMode 4 Triangles + ExecutionMode 4 SpacingEqual + ExecutionMode 4 VertexOrderCw + Source HLSL 500 + Name 4 "main" + Name 9 "HullInputType" + MemberName 9(HullInputType) 0 "position" + MemberName 9(HullInputType) 1 "color" + Name 16 "ConstantOutputType" + MemberName 16(ConstantOutputType) 0 "edges" + MemberName 16(ConstantOutputType) 1 "inside" + Name 20 "ColorPatchConstantFunction(struct-HullInputType-vf3-vf41[3];u1;" + Name 18 "inputPatch" + Name 19 "patchId" + Name 22 "HullOutputType" + MemberName 22(HullOutputType) 0 "position" + MemberName 22(HullOutputType) 1 "color" + Name 27 "@main(struct-HullInputType-vf3-vf41[3];u1;u1;" + Name 24 "patch" + Name 25 "pointId" + Name 26 "patchId" + Name 30 "output" + Name 33 "TessellationBuffer" + MemberName 33(TessellationBuffer) 0 "tessellationAmount" + MemberName 33(TessellationBuffer) 1 "padding" + Name 35 "" + Name 56 "output" + Name 70 "patch" + Name 72 "patch" + Name 74 "pointId" + Name 76 "pointId" + Name 78 "patchId" + Name 79 "patchId" + Name 83 "@entryPointOutput" + Name 85 "param" + Name 87 "param" + Name 89 "param" + Name 102 "@patchConstantResult" + Name 103 "param" + Name 105 "param" + Name 110 "@patchConstantOutput.edges" + Name 123 "@patchConstantOutput.inside" + MemberDecorate 33(TessellationBuffer) 0 Offset 0 + MemberDecorate 33(TessellationBuffer) 1 Offset 4 + Decorate 33(TessellationBuffer) Block + Decorate 35 DescriptorSet 0 + Decorate 35 Binding 0 + Decorate 72(patch) Location 0 + Decorate 76(pointId) BuiltIn InvocationId + Decorate 79(patchId) BuiltIn PrimitiveId + Decorate 83(@entryPointOutput) Location 0 + Decorate 110(@patchConstantOutput.edges) Patch + Decorate 110(@patchConstantOutput.edges) BuiltIn TessLevelOuter + Decorate 123(@patchConstantOutput.inside) Patch + Decorate 123(@patchConstantOutput.inside) BuiltIn TessLevelInner + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8: TypeVector 6(float) 4 +9(HullInputType): TypeStruct 7(fvec3) 8(fvec4) + 10: TypeInt 32 0 + 11: 10(int) Constant 3 + 12: TypeArray 9(HullInputType) 11 + 13: TypePointer Function 12 + 14: TypePointer Function 10(int) + 15: TypeArray 6(float) 11 +16(ConstantOutputType): TypeStruct 15 6(float) + 17: TypeFunction 16(ConstantOutputType) 13(ptr) 14(ptr) +22(HullOutputType): TypeStruct 7(fvec3) 8(fvec4) + 23: TypeFunction 22(HullOutputType) 13(ptr) 14(ptr) 14(ptr) + 29: TypePointer Function 16(ConstantOutputType) + 31: TypeInt 32 1 + 32: 31(int) Constant 0 +33(TessellationBuffer): TypeStruct 6(float) 7(fvec3) + 34: TypePointer Uniform 33(TessellationBuffer) + 35: 34(ptr) Variable Uniform + 36: TypePointer Uniform 6(float) + 39: TypePointer Function 6(float) + 41: 31(int) Constant 1 + 45: 31(int) Constant 2 + 55: TypePointer Function 22(HullOutputType) + 58: TypePointer Function 7(fvec3) + 63: TypePointer Function 8(fvec4) + 71: TypePointer Input 12 + 72(patch): 71(ptr) Variable Input + 75: TypePointer Input 10(int) + 76(pointId): 75(ptr) Variable Input + 79(patchId): 75(ptr) Variable Input + 81: TypeArray 22(HullOutputType) 11 + 82: TypePointer Output 81 +83(@entryPointOutput): 82(ptr) Variable Output + 92: TypePointer Output 22(HullOutputType) + 94: 10(int) Constant 2 + 95: 10(int) Constant 4 + 96: 10(int) Constant 0 + 98: TypeBool + 108: TypeArray 6(float) 95 + 109: TypePointer Output 108 +110(@patchConstantOutput.edges): 109(ptr) Variable Output + 113: TypePointer Output 6(float) + 121: TypeArray 6(float) 94 + 122: TypePointer Output 121 +123(@patchConstantOutput.inside): 122(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 70(patch): 13(ptr) Variable Function + 74(pointId): 14(ptr) Variable Function + 78(patchId): 14(ptr) Variable Function + 85(param): 13(ptr) Variable Function + 87(param): 14(ptr) Variable Function + 89(param): 14(ptr) Variable Function +102(@patchConstantResult): 29(ptr) Variable Function + 103(param): 13(ptr) Variable Function + 105(param): 14(ptr) Variable Function + 73: 12 Load 72(patch) + Store 70(patch) 73 + 77: 10(int) Load 76(pointId) + Store 74(pointId) 77 + 80: 10(int) Load 79(patchId) + Store 78(patchId) 80 + 84: 10(int) Load 76(pointId) + 86: 12 Load 70(patch) + Store 85(param) 86 + 88: 10(int) Load 74(pointId) + Store 87(param) 88 + 90: 10(int) Load 78(patchId) + Store 89(param) 90 + 91:22(HullOutputType) FunctionCall 27(@main(struct-HullInputType-vf3-vf41[3];u1;u1;) 85(param) 87(param) 89(param) + 93: 92(ptr) AccessChain 83(@entryPointOutput) 84 + Store 93 91 + ControlBarrier 94 95 96 + 97: 10(int) Load 76(pointId) + 99: 98(bool) IEqual 97 32 + SelectionMerge 101 None + BranchConditional 99 100 101 + 100: Label + 104: 12 Load 70(patch) + Store 103(param) 104 + 106: 10(int) Load 79(patchId) + Store 105(param) 106 + 107:16(ConstantOutputType) FunctionCall 20(ColorPatchConstantFunction(struct-HullInputType-vf3-vf41[3];u1;) 103(param) 105(param) + Store 102(@patchConstantResult) 107 + 111: 39(ptr) AccessChain 102(@patchConstantResult) 32 32 + 112: 6(float) Load 111 + 114: 113(ptr) AccessChain 110(@patchConstantOutput.edges) 32 + Store 114 112 + 115: 39(ptr) AccessChain 102(@patchConstantResult) 32 41 + 116: 6(float) Load 115 + 117: 113(ptr) AccessChain 110(@patchConstantOutput.edges) 41 + Store 117 116 + 118: 39(ptr) AccessChain 102(@patchConstantResult) 32 45 + 119: 6(float) Load 118 + 120: 113(ptr) AccessChain 110(@patchConstantOutput.edges) 45 + Store 120 119 + 124: 39(ptr) AccessChain 102(@patchConstantResult) 41 + 125: 6(float) Load 124 + 126: 113(ptr) AccessChain 123(@patchConstantOutput.inside) 32 + Store 126 125 + Branch 101 + 101: Label + Return + FunctionEnd +20(ColorPatchConstantFunction(struct-HullInputType-vf3-vf41[3];u1;):16(ConstantOutputType) Function None 17 + 18(inputPatch): 13(ptr) FunctionParameter + 19(patchId): 14(ptr) FunctionParameter + 21: Label + 30(output): 29(ptr) Variable Function + 37: 36(ptr) AccessChain 35 32 + 38: 6(float) Load 37 + 40: 39(ptr) AccessChain 30(output) 32 32 + Store 40 38 + 42: 36(ptr) AccessChain 35 32 + 43: 6(float) Load 42 + 44: 39(ptr) AccessChain 30(output) 32 41 + Store 44 43 + 46: 36(ptr) AccessChain 35 32 + 47: 6(float) Load 46 + 48: 39(ptr) AccessChain 30(output) 32 45 + Store 48 47 + 49: 36(ptr) AccessChain 35 32 + 50: 6(float) Load 49 + 51: 39(ptr) AccessChain 30(output) 41 + Store 51 50 + 52:16(ConstantOutputType) Load 30(output) + ReturnValue 52 + FunctionEnd +27(@main(struct-HullInputType-vf3-vf41[3];u1;u1;):22(HullOutputType) Function None 23 + 24(patch): 13(ptr) FunctionParameter + 25(pointId): 14(ptr) FunctionParameter + 26(patchId): 14(ptr) FunctionParameter + 28: Label + 56(output): 55(ptr) Variable Function + 57: 10(int) Load 25(pointId) + 59: 58(ptr) AccessChain 24(patch) 57 32 + 60: 7(fvec3) Load 59 + 61: 58(ptr) AccessChain 56(output) 32 + Store 61 60 + 62: 10(int) Load 25(pointId) + 64: 63(ptr) AccessChain 24(patch) 62 41 + 65: 8(fvec4) Load 64 + 66: 63(ptr) AccessChain 56(output) 41 + Store 66 65 + 67:22(HullOutputType) Load 56(output) + ReturnValue 67 + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.comparison.vec.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.comparison.vec.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.comparison.vec.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.comparison.vec.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -262,7 +262,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 96 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.conditional.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.conditional.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.conditional.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.conditional.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -78,7 +78,7 @@ 0:17 Sequence 0:17 move second child to first child ( temp 4-component vector of float) 0:17 'ret' ( temp 4-component vector of float) -0:17 Test condition and select ( temp 4-component vector of float) +0:17 Test condition and select ( temp 4-component vector of float): no shortcircuit 0:17 Condition 0:17 Compare Not Equal ( temp bool) 0:17 t: direct index for structure ( uniform float) @@ -169,7 +169,7 @@ 0:37 'e' ( temp int) 0:37 move second child to first child ( temp int) 0:37 'a' ( temp int) -0:37 Test condition and select ( temp int) +0:37 Test condition and select ( temp int): no shortcircuit 0:37 Condition 0:37 Convert int to bool ( temp bool) 0:37 'b' ( temp int) @@ -182,7 +182,7 @@ 0:37 10 (const int) 0:37 move second child to first child ( temp int) 0:37 'b' ( temp int) -0:37 Test condition and select ( temp int) +0:37 Test condition and select ( temp int): no shortcircuit 0:37 Condition 0:37 Convert int to bool ( temp bool) 0:37 'a' ( temp int) @@ -195,7 +195,7 @@ 0:37 11 (const int) 0:39 move second child to first child ( temp 4-component vector of float) 0:39 'f' ( temp 4-component vector of float) -0:39 Test condition and select ( temp 4-component vector of float) +0:39 Test condition and select ( temp 4-component vector of float): no shortcircuit 0:39 Condition 0:39 Compare Less Than ( temp bool) 0:39 direct index ( temp float) @@ -341,7 +341,7 @@ 0:17 Sequence 0:17 move second child to first child ( temp 4-component vector of float) 0:17 'ret' ( temp 4-component vector of float) -0:17 Test condition and select ( temp 4-component vector of float) +0:17 Test condition and select ( temp 4-component vector of float): no shortcircuit 0:17 Condition 0:17 Compare Not Equal ( temp bool) 0:17 t: direct index for structure ( uniform float) @@ -432,7 +432,7 @@ 0:37 'e' ( temp int) 0:37 move second child to first child ( temp int) 0:37 'a' ( temp int) -0:37 Test condition and select ( temp int) +0:37 Test condition and select ( temp int): no shortcircuit 0:37 Condition 0:37 Convert int to bool ( temp bool) 0:37 'b' ( temp int) @@ -445,7 +445,7 @@ 0:37 10 (const int) 0:37 move second child to first child ( temp int) 0:37 'b' ( temp int) -0:37 Test condition and select ( temp int) +0:37 Test condition and select ( temp int): no shortcircuit 0:37 Condition 0:37 Convert int to bool ( temp bool) 0:37 'a' ( temp int) @@ -458,7 +458,7 @@ 0:37 11 (const int) 0:39 move second child to first child ( temp 4-component vector of float) 0:39 'f' ( temp 4-component vector of float) -0:39 Test condition and select ( temp 4-component vector of float) +0:39 Test condition and select ( temp 4-component vector of float): no shortcircuit 0:39 Condition 0:39 Compare Less Than ( temp bool) 0:39 direct index ( temp float) @@ -522,13 +522,13 @@ 0:? 'input' (layout( location=0) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 220 +// Generated by (magic number): 80006 +// Id's are bound by 206 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "PixelShaderFunction" 213 216 + EntryPoint Fragment 4 "PixelShaderFunction" 199 202 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "PixelShaderFunction" @@ -548,20 +548,20 @@ MemberName 29($Global) 4 "f" Name 31 "" Name 85 "ret" - Name 113 "a" - Name 115 "b" - Name 117 "c" - Name 119 "d" - Name 120 "ret" - Name 140 "e" - Name 161 "f" - Name 200 "param" - Name 201 "param" - Name 202 "param" - Name 211 "input" - Name 213 "input" - Name 216 "@entryPointOutput" - Name 217 "param" + Name 110 "a" + Name 112 "b" + Name 114 "c" + Name 116 "d" + Name 117 "ret" + Name 137 "e" + Name 150 "f" + Name 186 "param" + Name 187 "param" + Name 188 "param" + Name 197 "input" + Name 199 "input" + Name 202 "@entryPointOutput" + Name 203 "param" MemberDecorate 29($Global) 0 Offset 0 MemberDecorate 29($Global) 1 Offset 16 MemberDecorate 29($Global) 2 Offset 32 @@ -569,8 +569,8 @@ MemberDecorate 29($Global) 4 Offset 52 Decorate 29($Global) Block Decorate 31 DescriptorSet 0 - Decorate 213(input) Location 0 - Decorate 216(@entryPointOutput) Location 0 + Decorate 199(input) Location 0 + Decorate 202(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -598,41 +598,41 @@ 48: 32(int) Constant 4 49: TypePointer Uniform 6(float) 53: 32(int) Constant 3 - 100: 6(float) Constant 1065353216 - 101: 7(fvec4) ConstantComposite 100 100 100 100 - 112: TypePointer Function 32(int) - 114: 32(int) Constant 5 - 116: 32(int) Constant 6 - 118: 32(int) Constant 7 - 143: TypeInt 32 0 - 144: 143(int) Constant 0 - 150: 32(int) Constant 10 - 159: 32(int) Constant 11 - 163: TypePointer Function 6(float) - 166: 143(int) Constant 1 - 192: 13(bool) ConstantTrue - 193: 13(bool) ConstantFalse - 194: 14(bvec2) ConstantComposite 192 193 - 195: 6(float) Constant 1073741824 - 196: 16(fvec2) ConstantComposite 100 195 - 197: 6(float) Constant 1077936128 - 198: 6(float) Constant 1082130432 - 199: 16(fvec2) ConstantComposite 197 198 - 204: 6(float) Constant 1092616192 - 212: TypePointer Input 7(fvec4) - 213(input): 212(ptr) Variable Input - 215: TypePointer Output 7(fvec4) -216(@entryPointOutput): 215(ptr) Variable Output + 96: 6(float) Constant 1065353216 + 97: 7(fvec4) ConstantComposite 96 96 96 96 + 109: TypePointer Function 32(int) + 111: 32(int) Constant 5 + 113: 32(int) Constant 6 + 115: 32(int) Constant 7 + 139: TypeInt 32 0 + 140: 139(int) Constant 0 + 143: 32(int) Constant 10 + 148: 32(int) Constant 11 + 151: TypePointer Function 6(float) + 154: 139(int) Constant 1 + 178: 13(bool) ConstantTrue + 179: 13(bool) ConstantFalse + 180: 14(bvec2) ConstantComposite 178 179 + 181: 6(float) Constant 1073741824 + 182: 16(fvec2) ConstantComposite 96 181 + 183: 6(float) Constant 1077936128 + 184: 6(float) Constant 1082130432 + 185: 16(fvec2) ConstantComposite 183 184 + 190: 6(float) Constant 1092616192 + 198: TypePointer Input 7(fvec4) + 199(input): 198(ptr) Variable Input + 201: TypePointer Output 7(fvec4) +202(@entryPointOutput): 201(ptr) Variable Output 4(PixelShaderFunction): 2 Function None 3 5: Label - 211(input): 24(ptr) Variable Function - 217(param): 24(ptr) Variable Function - 214: 7(fvec4) Load 213(input) - Store 211(input) 214 - 218: 7(fvec4) Load 211(input) - Store 217(param) 218 - 219: 7(fvec4) FunctionCall 27(@PixelShaderFunction(vf4;) 217(param) - Store 216(@entryPointOutput) 219 + 197(input): 24(ptr) Variable Function + 203(param): 24(ptr) Variable Function + 200: 7(fvec4) Load 199(input) + Store 197(input) 200 + 204: 7(fvec4) Load 197(input) + Store 203(param) 204 + 205: 7(fvec4) FunctionCall 27(@PixelShaderFunction(vf4;) 203(param) + Store 202(@entryPointOutput) 205 Return FunctionEnd 9(vectorCond(): 7(fvec4) Function None 8 @@ -682,154 +682,116 @@ 11(scalarCond(): 7(fvec4) Function None 8 12: Label 85(ret): 24(ptr) Variable Function - 86: 24(ptr) Variable Function - 87: 49(ptr) AccessChain 31 53 - 88: 6(float) Load 87 - 89: 49(ptr) AccessChain 31 48 - 90: 6(float) Load 89 - 91: 13(bool) FOrdNotEqual 88 90 - SelectionMerge 93 None - BranchConditional 91 92 99 - 92: Label - 94: 49(ptr) AccessChain 31 53 - 95: 6(float) Load 94 - 96: 34(ptr) AccessChain 31 33 - 97: 7(fvec4) Load 96 - 98: 7(fvec4) VectorTimesScalar 97 95 - Store 86 98 - Branch 93 - 99: Label - Store 86 101 - Branch 93 - 93: Label - 102: 7(fvec4) Load 86 - Store 85(ret) 102 - 103: 7(fvec4) Load 85(ret) - ReturnValue 103 + 86: 49(ptr) AccessChain 31 53 + 87: 6(float) Load 86 + 88: 49(ptr) AccessChain 31 48 + 89: 6(float) Load 88 + 90: 13(bool) FOrdNotEqual 87 89 + 91: 49(ptr) AccessChain 31 53 + 92: 6(float) Load 91 + 93: 34(ptr) AccessChain 31 33 + 94: 7(fvec4) Load 93 + 95: 7(fvec4) VectorTimesScalar 94 92 + 98: 43(bvec4) CompositeConstruct 90 90 90 90 + 99: 7(fvec4) Select 98 95 97 + Store 85(ret) 99 + 100: 7(fvec4) Load 85(ret) + ReturnValue 100 FunctionEnd 22(fbSelect(vb2;vf2;vf2;): 16(fvec2) Function None 18 19(cnd): 15(ptr) FunctionParameter 20(src0): 17(ptr) FunctionParameter 21(src1): 17(ptr) FunctionParameter 23: Label - 106: 16(fvec2) Load 21(src1) - 107: 16(fvec2) Load 20(src0) - 108: 14(bvec2) Load 19(cnd) - 109: 16(fvec2) Select 108 107 106 - ReturnValue 109 + 103: 16(fvec2) Load 21(src1) + 104: 16(fvec2) Load 20(src0) + 105: 14(bvec2) Load 19(cnd) + 106: 16(fvec2) Select 105 104 103 + ReturnValue 106 FunctionEnd 27(@PixelShaderFunction(vf4;): 7(fvec4) Function None 25 26(input): 24(ptr) FunctionParameter 28: Label - 113(a): 112(ptr) Variable Function - 115(b): 112(ptr) Variable Function - 117(c): 112(ptr) Variable Function - 119(d): 112(ptr) Variable Function - 120(ret): 24(ptr) Variable Function - 140(e): 112(ptr) Variable Function - 141: 112(ptr) Variable Function - 152: 112(ptr) Variable Function - 161(f): 24(ptr) Variable Function - 162: 24(ptr) Variable Function - 200(param): 15(ptr) Variable Function - 201(param): 17(ptr) Variable Function - 202(param): 17(ptr) Variable Function - Store 113(a) 114 - Store 115(b) 116 - Store 117(c) 118 - Store 119(d) 118 - 121: 32(int) Load 113(a) - 122: 6(float) ConvertSToF 121 - 123: 7(fvec4) Load 26(input) - 124: 7(fvec4) VectorTimesScalar 123 122 - 125: 32(int) Load 115(b) - 126: 6(float) ConvertSToF 125 - 127: 7(fvec4) Load 26(input) - 128: 7(fvec4) VectorTimesScalar 127 126 - 129: 7(fvec4) FAdd 124 128 - 130: 32(int) Load 117(c) - 131: 6(float) ConvertSToF 130 - 132: 7(fvec4) Load 26(input) - 133: 7(fvec4) VectorTimesScalar 132 131 - 134: 7(fvec4) FAdd 129 133 - 135: 32(int) Load 119(d) - 136: 6(float) ConvertSToF 135 - 137: 7(fvec4) Load 26(input) - 138: 7(fvec4) VectorTimesScalar 137 136 - 139: 7(fvec4) FAdd 134 138 - Store 120(ret) 139 - 142: 32(int) Load 115(b) - 145: 13(bool) INotEqual 142 144 - SelectionMerge 147 None - BranchConditional 145 146 149 - 146: Label - 148: 32(int) Load 119(d) - Store 117(c) 148 - Store 141 148 - Branch 147 - 149: Label - Store 141 150 - Branch 147 - 147: Label - 151: 32(int) Load 141 - Store 113(a) 151 - Store 140(e) 151 - 153: 32(int) Load 113(a) - 154: 13(bool) INotEqual 153 144 - SelectionMerge 156 None - BranchConditional 154 155 158 - 155: Label - 157: 32(int) Load 117(c) - Store 119(d) 157 - Store 152 157 - Branch 156 - 158: Label - Store 152 159 - Branch 156 - 156: Label - 160: 32(int) Load 152 - Store 115(b) 160 - 164: 163(ptr) AccessChain 120(ret) 144 - 165: 6(float) Load 164 - 167: 163(ptr) AccessChain 26(input) 166 - 168: 6(float) Load 167 - 169: 13(bool) FOrdLessThan 165 168 - SelectionMerge 171 None - BranchConditional 169 170 176 - 170: Label - 172: 32(int) Load 117(c) - 173: 6(float) ConvertSToF 172 - 174: 7(fvec4) Load 26(input) - 175: 7(fvec4) VectorTimesScalar 174 173 - Store 162 175 - Branch 171 - 176: Label - 177: 32(int) Load 119(d) - 178: 6(float) ConvertSToF 177 - 179: 7(fvec4) Load 26(input) - 180: 7(fvec4) VectorTimesScalar 179 178 - Store 162 180 - Branch 171 - 171: Label - 181: 7(fvec4) Load 162 - Store 161(f) 181 - 182: 32(int) Load 140(e) - 183: 6(float) ConvertSToF 182 - 184: 7(fvec4) Load 120(ret) - 185: 7(fvec4) VectorTimesScalar 184 183 - 186: 7(fvec4) Load 161(f) - 187: 7(fvec4) FAdd 185 186 - 188: 7(fvec4) FunctionCall 9(vectorCond() - 189: 7(fvec4) FAdd 187 188 - 190: 7(fvec4) FunctionCall 11(scalarCond() - 191: 7(fvec4) FAdd 189 190 - Store 200(param) 194 - Store 201(param) 196 - Store 202(param) 199 - 203: 16(fvec2) FunctionCall 22(fbSelect(vb2;vf2;vf2;) 200(param) 201(param) 202(param) - 205: 6(float) CompositeExtract 203 0 - 206: 6(float) CompositeExtract 203 1 - 207: 7(fvec4) CompositeConstruct 205 206 204 204 - 208: 7(fvec4) FAdd 191 207 - ReturnValue 208 + 110(a): 109(ptr) Variable Function + 112(b): 109(ptr) Variable Function + 114(c): 109(ptr) Variable Function + 116(d): 109(ptr) Variable Function + 117(ret): 24(ptr) Variable Function + 137(e): 109(ptr) Variable Function + 150(f): 24(ptr) Variable Function + 186(param): 15(ptr) Variable Function + 187(param): 17(ptr) Variable Function + 188(param): 17(ptr) Variable Function + Store 110(a) 111 + Store 112(b) 113 + Store 114(c) 115 + Store 116(d) 115 + 118: 32(int) Load 110(a) + 119: 6(float) ConvertSToF 118 + 120: 7(fvec4) Load 26(input) + 121: 7(fvec4) VectorTimesScalar 120 119 + 122: 32(int) Load 112(b) + 123: 6(float) ConvertSToF 122 + 124: 7(fvec4) Load 26(input) + 125: 7(fvec4) VectorTimesScalar 124 123 + 126: 7(fvec4) FAdd 121 125 + 127: 32(int) Load 114(c) + 128: 6(float) ConvertSToF 127 + 129: 7(fvec4) Load 26(input) + 130: 7(fvec4) VectorTimesScalar 129 128 + 131: 7(fvec4) FAdd 126 130 + 132: 32(int) Load 116(d) + 133: 6(float) ConvertSToF 132 + 134: 7(fvec4) Load 26(input) + 135: 7(fvec4) VectorTimesScalar 134 133 + 136: 7(fvec4) FAdd 131 135 + Store 117(ret) 136 + 138: 32(int) Load 112(b) + 141: 13(bool) INotEqual 138 140 + 142: 32(int) Load 116(d) + Store 114(c) 142 + 144: 32(int) Select 141 142 143 + Store 110(a) 144 + Store 137(e) 144 + 145: 32(int) Load 110(a) + 146: 13(bool) INotEqual 145 140 + 147: 32(int) Load 114(c) + Store 116(d) 147 + 149: 32(int) Select 146 147 148 + Store 112(b) 149 + 152: 151(ptr) AccessChain 117(ret) 140 + 153: 6(float) Load 152 + 155: 151(ptr) AccessChain 26(input) 154 + 156: 6(float) Load 155 + 157: 13(bool) FOrdLessThan 153 156 + 158: 32(int) Load 114(c) + 159: 6(float) ConvertSToF 158 + 160: 7(fvec4) Load 26(input) + 161: 7(fvec4) VectorTimesScalar 160 159 + 162: 32(int) Load 116(d) + 163: 6(float) ConvertSToF 162 + 164: 7(fvec4) Load 26(input) + 165: 7(fvec4) VectorTimesScalar 164 163 + 166: 43(bvec4) CompositeConstruct 157 157 157 157 + 167: 7(fvec4) Select 166 161 165 + Store 150(f) 167 + 168: 32(int) Load 137(e) + 169: 6(float) ConvertSToF 168 + 170: 7(fvec4) Load 117(ret) + 171: 7(fvec4) VectorTimesScalar 170 169 + 172: 7(fvec4) Load 150(f) + 173: 7(fvec4) FAdd 171 172 + 174: 7(fvec4) FunctionCall 9(vectorCond() + 175: 7(fvec4) FAdd 173 174 + 176: 7(fvec4) FunctionCall 11(scalarCond() + 177: 7(fvec4) FAdd 175 176 + Store 186(param) 180 + Store 187(param) 182 + Store 188(param) 185 + 189: 16(fvec2) FunctionCall 22(fbSelect(vb2;vf2;vf2;) 186(param) 187(param) 188(param) + 191: 6(float) CompositeExtract 189 0 + 192: 6(float) CompositeExtract 189 1 + 193: 7(fvec4) CompositeConstruct 191 192 190 190 + 194: 7(fvec4) FAdd 177 193 + ReturnValue 194 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.constantbuffer.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.constantbuffer.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.constantbuffer.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.constantbuffer.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -132,7 +132,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 66 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.constructArray.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.constructArray.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.constructArray.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.constructArray.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -268,7 +268,7 @@ 0:? '@entryPointOutput' ( out 4-component vector of float Position) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 89 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.constructexpr.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.constructexpr.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.constructexpr.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.constructexpr.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -104,7 +104,7 @@ 0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 40 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.constructimat.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.constructimat.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.constructimat.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.constructimat.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -544,7 +544,7 @@ 0:? '@entryPointOutput' (layout( location=0) out int) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 98 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.dashI.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.dashI.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.dashI.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.dashI.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ hlsl.dashI.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 40 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.deadFunctionMissingBody.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.deadFunctionMissingBody.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.deadFunctionMissingBody.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.deadFunctionMissingBody.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ hlsl.deadFunctionMissingBody.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 18 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.depthGreater.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.depthGreater.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.depthGreater.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.depthGreater.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -50,7 +50,7 @@ 0:? 'depth' ( out float FragDepth) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 20 Capability Shader @@ -59,6 +59,7 @@ EntryPoint Fragment 4 "PixelShaderFunction" 18 ExecutionMode 4 OriginUpperLeft ExecutionMode 4 DepthGreater + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "PixelShaderFunction" Name 10 "@PixelShaderFunction(f1;" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.depthLess.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.depthLess.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.depthLess.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.depthLess.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -42,7 +42,7 @@ 0:? '@entryPointOutput' ( out float FragDepth) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 16 Capability Shader @@ -51,6 +51,7 @@ EntryPoint Fragment 4 "PixelShaderFunction" 14 ExecutionMode 4 OriginUpperLeft ExecutionMode 4 DepthLess + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "PixelShaderFunction" Name 8 "@PixelShaderFunction(" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.discard.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.discard.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.discard.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.discard.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -108,7 +108,7 @@ 0:? 'input' (layout( location=0) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 50 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.doLoop.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.doLoop.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.doLoop.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.doLoop.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -6,12 +6,12 @@ 0:2 Function Parameters: 0:2 'input' ( in float) 0:? Sequence -0:3 Loop with condition not tested first +0:3 Loop with condition not tested first: Unroll 0:3 Loop Condition 0:3 Constant: 0:3 false (const bool) 0:3 No loop body -0:4 Loop with condition not tested first +0:4 Loop with condition not tested first: Unroll 0:4 Loop Condition 0:4 Constant: 0:4 false (const bool) @@ -80,12 +80,12 @@ 0:2 Function Parameters: 0:2 'input' ( in float) 0:? Sequence -0:3 Loop with condition not tested first +0:3 Loop with condition not tested first: Unroll 0:3 Loop Condition 0:3 Constant: 0:3 false (const bool) 0:3 No loop body -0:4 Loop with condition not tested first +0:4 Loop with condition not tested first: Unroll 0:4 Loop Condition 0:4 Constant: 0:4 false (const bool) @@ -144,7 +144,7 @@ 0:? 'input' (layout( location=0) in float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 71 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.domain.1.tese.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.domain.1.tese.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.domain.1.tese.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.domain.1.tese.out 2018-04-27 11:46:26.000000000 +0000 @@ -286,7 +286,7 @@ 0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 103 Capability Tessellation diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.domain.2.tese.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.domain.2.tese.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.domain.2.tese.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.domain.2.tese.out 2018-04-27 11:46:26.000000000 +0000 @@ -284,7 +284,7 @@ 0:? 'pcf_data.foo' (layout( location=2) patch in float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 98 Capability Tessellation diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.domain.3.tese.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.domain.3.tese.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.domain.3.tese.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.domain.3.tese.out 2018-04-27 11:46:26.000000000 +0000 @@ -264,7 +264,7 @@ 0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 100 Capability Tessellation diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.emptystruct.init.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.emptystruct.init.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.emptystruct.init.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.emptystruct.init.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -60,7 +60,7 @@ 0:? 'vertexIndex' (layout( location=0) in uint) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 29 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.emptystructreturn.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.emptystructreturn.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.emptystructreturn.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.emptystructreturn.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -50,7 +50,7 @@ 0:? Linker Objects // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 27 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.emptystructreturn.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.emptystructreturn.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.emptystructreturn.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.emptystructreturn.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -48,7 +48,7 @@ 0:? Linker Objects // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 27 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.entry-in.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.entry-in.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.entry-in.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.entry-in.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -166,7 +166,7 @@ 0:? 'i.i2' (layout( location=1) flat in 2-component vector of int) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 74 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.entry-out.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.entry-out.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.entry-out.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.entry-out.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -244,7 +244,7 @@ 0:? 'out3.i' (layout( location=5) out 2-component vector of int) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 89 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.entry.rename.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.entry.rename.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.entry.rename.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.entry.rename.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -72,7 +72,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 32 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ hlsl.explicitDescriptorSet.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 31 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.explicitDescriptorSet.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.explicitDescriptorSet.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.explicitDescriptorSet.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.explicitDescriptorSet.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ hlsl.explicitDescriptorSet.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 31 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.flattenOpaque.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.flattenOpaque.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.flattenOpaque.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.flattenOpaque.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,54 +1,71 @@ hlsl.flattenOpaque.frag +WARNING: AST will form illegal SPIR-V; need to transform to legalize Shader version: 500 gl_FragCoord origin is upper left 0:? Sequence 0:15 Function Definition: osCall1(struct-os-p11; ( temp 4-component vector of float) 0:15 Function Parameters: -0:? 's.s2D' ( in sampler) +0:15 's' ( in structure{ temp sampler s2D}) 0:? Sequence 0:16 Branch: Return with expression 0:16 texture ( temp 4-component vector of float) 0:16 Construct combined texture-sampler ( temp sampler2D) 0:16 'tex' ( uniform texture2D) -0:? 's.s2D' ( in sampler) +0:16 s2D: direct index for structure ( temp sampler) +0:16 's' ( in structure{ temp sampler s2D}) +0:16 Constant: +0:16 0 (const int) 0:? Constant: 0:? 0.200000 0:? 0.300000 0:20 Function Definition: osCall2(struct-os-p11;vf2; ( temp 4-component vector of float) 0:20 Function Parameters: -0:? 's.s2D' ( in sampler) +0:20 's' ( in structure{ temp sampler s2D}) 0:20 'f2' ( in 2-component vector of float) 0:? Sequence 0:21 Branch: Return with expression 0:21 texture ( temp 4-component vector of float) 0:21 Construct combined texture-sampler ( temp sampler2D) 0:21 'tex' ( uniform texture2D) -0:? 's.s2D' ( in sampler) +0:21 s2D: direct index for structure ( temp sampler) +0:21 's' ( in structure{ temp sampler s2D}) +0:21 Constant: +0:21 0 (const int) 0:21 'f2' ( in 2-component vector of float) 0:25 Function Definition: os2Call1(struct-os2-p1-t211; ( temp 4-component vector of float) 0:25 Function Parameters: -0:? 's.s2D' ( in sampler) -0:? 's.tex' ( in texture2D) +0:25 's' ( in structure{ temp sampler s2D, temp texture2D tex}) 0:? Sequence 0:26 Branch: Return with expression 0:26 texture ( temp 4-component vector of float) 0:26 Construct combined texture-sampler ( temp sampler2D) -0:? 's.tex' ( in texture2D) -0:? 's.s2D' ( in sampler) +0:26 tex: direct index for structure ( temp texture2D) +0:26 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:26 Constant: +0:26 1 (const int) +0:26 s2D: direct index for structure ( temp sampler) +0:26 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:26 Constant: +0:26 0 (const int) 0:? Constant: 0:? 0.200000 0:? 0.300000 0:30 Function Definition: os2Call2(struct-os2-p1-t211;vf2; ( temp 4-component vector of float) 0:30 Function Parameters: -0:? 's.s2D' ( in sampler) -0:? 's.tex' ( in texture2D) +0:30 's' ( in structure{ temp sampler s2D, temp texture2D tex}) 0:30 'f2' ( in 2-component vector of float) 0:? Sequence 0:31 Branch: Return with expression 0:31 texture ( temp 4-component vector of float) 0:31 Construct combined texture-sampler ( temp sampler2D) -0:? 's.tex' ( in texture2D) -0:? 's.s2D' ( in sampler) +0:31 tex: direct index for structure ( temp texture2D) +0:31 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:31 Constant: +0:31 1 (const int) +0:31 s2D: direct index for structure ( temp sampler) +0:31 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:31 Constant: +0:31 0 (const int) 0:31 'f2' ( in 2-component vector of float) 0:35 Function Definition: @main( ( temp 4-component vector of float) 0:35 Function Parameters: @@ -58,18 +75,60 @@ 0:37 add ( temp 4-component vector of float) 0:36 add ( temp 4-component vector of float) 0:36 Function Call: osCall1(struct-os-p11; ( temp 4-component vector of float) -0:? 's.s2D' ( uniform sampler) +0:36 Comma ( temp structure{ temp sampler s2D}) +0:36 Sequence +0:36 move second child to first child ( temp sampler) +0:36 s2D: direct index for structure ( temp sampler) +0:36 'aggShadow' ( temp structure{ temp sampler s2D}) +0:36 Constant: +0:36 0 (const int) +0:? 's.s2D' ( uniform sampler) +0:36 'aggShadow' ( temp structure{ temp sampler s2D}) 0:37 Function Call: osCall2(struct-os-p11;vf2; ( temp 4-component vector of float) -0:? 's.s2D' ( uniform sampler) +0:37 Comma ( temp structure{ temp sampler s2D}) +0:37 Sequence +0:37 move second child to first child ( temp sampler) +0:37 s2D: direct index for structure ( temp sampler) +0:37 'aggShadow' ( temp structure{ temp sampler s2D}) +0:37 Constant: +0:37 0 (const int) +0:? 's.s2D' ( uniform sampler) +0:37 'aggShadow' ( temp structure{ temp sampler s2D}) 0:? Constant: 0:? 0.200000 0:? 0.300000 0:38 Function Call: os2Call1(struct-os2-p1-t211; ( temp 4-component vector of float) -0:? 's2.s2D' ( uniform sampler) -0:? 's2.tex' ( uniform texture2D) +0:38 Comma ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:38 Sequence +0:38 move second child to first child ( temp sampler) +0:38 s2D: direct index for structure ( temp sampler) +0:38 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:38 Constant: +0:38 0 (const int) +0:? 's2.s2D' ( uniform sampler) +0:38 move second child to first child ( temp texture2D) +0:38 tex: direct index for structure ( temp texture2D) +0:38 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:38 Constant: +0:38 1 (const int) +0:? 's2.tex' ( uniform texture2D) +0:38 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) 0:39 Function Call: os2Call2(struct-os2-p1-t211;vf2; ( temp 4-component vector of float) -0:? 's2.s2D' ( uniform sampler) -0:? 's2.tex' ( uniform texture2D) +0:39 Comma ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:39 Sequence +0:39 move second child to first child ( temp sampler) +0:39 s2D: direct index for structure ( temp sampler) +0:39 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:39 Constant: +0:39 0 (const int) +0:? 's2.s2D' ( uniform sampler) +0:39 move second child to first child ( temp texture2D) +0:39 tex: direct index for structure ( temp texture2D) +0:39 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:39 Constant: +0:39 1 (const int) +0:? 's2.tex' ( uniform texture2D) +0:39 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) 0:? Constant: 0:? 0.200000 0:? 0.300000 @@ -95,51 +154,67 @@ 0:? Sequence 0:15 Function Definition: osCall1(struct-os-p11; ( temp 4-component vector of float) 0:15 Function Parameters: -0:? 's.s2D' ( in sampler) +0:15 's' ( in structure{ temp sampler s2D}) 0:? Sequence 0:16 Branch: Return with expression 0:16 texture ( temp 4-component vector of float) 0:16 Construct combined texture-sampler ( temp sampler2D) 0:16 'tex' ( uniform texture2D) -0:? 's.s2D' ( in sampler) +0:16 s2D: direct index for structure ( temp sampler) +0:16 's' ( in structure{ temp sampler s2D}) +0:16 Constant: +0:16 0 (const int) 0:? Constant: 0:? 0.200000 0:? 0.300000 0:20 Function Definition: osCall2(struct-os-p11;vf2; ( temp 4-component vector of float) 0:20 Function Parameters: -0:? 's.s2D' ( in sampler) +0:20 's' ( in structure{ temp sampler s2D}) 0:20 'f2' ( in 2-component vector of float) 0:? Sequence 0:21 Branch: Return with expression 0:21 texture ( temp 4-component vector of float) 0:21 Construct combined texture-sampler ( temp sampler2D) 0:21 'tex' ( uniform texture2D) -0:? 's.s2D' ( in sampler) +0:21 s2D: direct index for structure ( temp sampler) +0:21 's' ( in structure{ temp sampler s2D}) +0:21 Constant: +0:21 0 (const int) 0:21 'f2' ( in 2-component vector of float) 0:25 Function Definition: os2Call1(struct-os2-p1-t211; ( temp 4-component vector of float) 0:25 Function Parameters: -0:? 's.s2D' ( in sampler) -0:? 's.tex' ( in texture2D) +0:25 's' ( in structure{ temp sampler s2D, temp texture2D tex}) 0:? Sequence 0:26 Branch: Return with expression 0:26 texture ( temp 4-component vector of float) 0:26 Construct combined texture-sampler ( temp sampler2D) -0:? 's.tex' ( in texture2D) -0:? 's.s2D' ( in sampler) +0:26 tex: direct index for structure ( temp texture2D) +0:26 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:26 Constant: +0:26 1 (const int) +0:26 s2D: direct index for structure ( temp sampler) +0:26 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:26 Constant: +0:26 0 (const int) 0:? Constant: 0:? 0.200000 0:? 0.300000 0:30 Function Definition: os2Call2(struct-os2-p1-t211;vf2; ( temp 4-component vector of float) 0:30 Function Parameters: -0:? 's.s2D' ( in sampler) -0:? 's.tex' ( in texture2D) +0:30 's' ( in structure{ temp sampler s2D, temp texture2D tex}) 0:30 'f2' ( in 2-component vector of float) 0:? Sequence 0:31 Branch: Return with expression 0:31 texture ( temp 4-component vector of float) 0:31 Construct combined texture-sampler ( temp sampler2D) -0:? 's.tex' ( in texture2D) -0:? 's.s2D' ( in sampler) +0:31 tex: direct index for structure ( temp texture2D) +0:31 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:31 Constant: +0:31 1 (const int) +0:31 s2D: direct index for structure ( temp sampler) +0:31 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:31 Constant: +0:31 0 (const int) 0:31 'f2' ( in 2-component vector of float) 0:35 Function Definition: @main( ( temp 4-component vector of float) 0:35 Function Parameters: @@ -149,18 +224,60 @@ 0:37 add ( temp 4-component vector of float) 0:36 add ( temp 4-component vector of float) 0:36 Function Call: osCall1(struct-os-p11; ( temp 4-component vector of float) -0:? 's.s2D' ( uniform sampler) +0:36 Comma ( temp structure{ temp sampler s2D}) +0:36 Sequence +0:36 move second child to first child ( temp sampler) +0:36 s2D: direct index for structure ( temp sampler) +0:36 'aggShadow' ( temp structure{ temp sampler s2D}) +0:36 Constant: +0:36 0 (const int) +0:? 's.s2D' ( uniform sampler) +0:36 'aggShadow' ( temp structure{ temp sampler s2D}) 0:37 Function Call: osCall2(struct-os-p11;vf2; ( temp 4-component vector of float) -0:? 's.s2D' ( uniform sampler) +0:37 Comma ( temp structure{ temp sampler s2D}) +0:37 Sequence +0:37 move second child to first child ( temp sampler) +0:37 s2D: direct index for structure ( temp sampler) +0:37 'aggShadow' ( temp structure{ temp sampler s2D}) +0:37 Constant: +0:37 0 (const int) +0:? 's.s2D' ( uniform sampler) +0:37 'aggShadow' ( temp structure{ temp sampler s2D}) 0:? Constant: 0:? 0.200000 0:? 0.300000 0:38 Function Call: os2Call1(struct-os2-p1-t211; ( temp 4-component vector of float) -0:? 's2.s2D' ( uniform sampler) -0:? 's2.tex' ( uniform texture2D) +0:38 Comma ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:38 Sequence +0:38 move second child to first child ( temp sampler) +0:38 s2D: direct index for structure ( temp sampler) +0:38 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:38 Constant: +0:38 0 (const int) +0:? 's2.s2D' ( uniform sampler) +0:38 move second child to first child ( temp texture2D) +0:38 tex: direct index for structure ( temp texture2D) +0:38 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:38 Constant: +0:38 1 (const int) +0:? 's2.tex' ( uniform texture2D) +0:38 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) 0:39 Function Call: os2Call2(struct-os2-p1-t211;vf2; ( temp 4-component vector of float) -0:? 's2.s2D' ( uniform sampler) -0:? 's2.tex' ( uniform texture2D) +0:39 Comma ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:39 Sequence +0:39 move second child to first child ( temp sampler) +0:39 s2D: direct index for structure ( temp sampler) +0:39 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:39 Constant: +0:39 0 (const int) +0:? 's2.s2D' ( uniform sampler) +0:39 move second child to first child ( temp texture2D) +0:39 tex: direct index for structure ( temp texture2D) +0:39 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:39 Constant: +0:39 1 (const int) +0:? 's2.tex' ( uniform texture2D) +0:39 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) 0:? Constant: 0:? 0.200000 0:? 0.300000 @@ -178,152 +295,184 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 99 +// Generated by (magic number): 80006 +// Id's are bound by 122 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 97 + EntryPoint Fragment 4 "main" 120 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" - Name 12 "osCall1(struct-os-p11;" - Name 11 "s.s2D" - Name 19 "osCall2(struct-os-p11;vf2;" - Name 17 "s.s2D" - Name 18 "f2" - Name 26 "os2Call1(struct-os2-p1-t211;" - Name 24 "s.s2D" - Name 25 "s.tex" + Name 7 "os" + MemberName 7(os) 0 "s2D" + Name 13 "osCall1(struct-os-p11;" + Name 12 "s" + Name 20 "osCall2(struct-os-p11;vf2;" + Name 18 "s" + Name 19 "f2" + Name 23 "os2" + MemberName 23(os2) 0 "s2D" + MemberName 23(os2) 1 "tex" + Name 27 "os2Call1(struct-os2-p1-t211;" + Name 26 "s" Name 32 "os2Call2(struct-os2-p1-t211;vf2;" - Name 29 "s.s2D" - Name 30 "s.tex" + Name 30 "s" Name 31 "f2" Name 35 "@main(" Name 38 "tex" - Name 70 "s.s2D" - Name 71 "param" - Name 74 "param" - Name 76 "param" - Name 79 "s2.s2D" - Name 80 "s2.tex" - Name 81 "param" - Name 83 "param" - Name 87 "param" - Name 89 "param" + Name 80 "aggShadow" + Name 82 "s.s2D" + Name 85 "param" + Name 88 "aggShadow" Name 91 "param" - Name 97 "@entryPointOutput" + Name 93 "param" + Name 96 "aggShadow" + Name 97 "s2.s2D" + Name 100 "s2.tex" + Name 103 "param" + Name 107 "aggShadow" + Name 112 "param" + Name 114 "param" + Name 120 "@entryPointOutput" Decorate 38(tex) DescriptorSet 0 - Decorate 70(s.s2D) DescriptorSet 0 - Decorate 79(s2.s2D) DescriptorSet 0 - Decorate 80(s2.tex) DescriptorSet 0 - Decorate 97(@entryPointOutput) Location 0 + Decorate 82(s.s2D) DescriptorSet 0 + Decorate 97(s2.s2D) DescriptorSet 0 + Decorate 100(s2.tex) DescriptorSet 0 + Decorate 120(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeSampler - 7: TypePointer Function 6 - 8: TypeFloat 32 - 9: TypeVector 8(float) 4 - 10: TypeFunction 9(fvec4) 7(ptr) - 14: TypeVector 8(float) 2 - 15: TypePointer Function 14(fvec2) - 16: TypeFunction 9(fvec4) 7(ptr) 15(ptr) - 21: TypeImage 8(float) 2D sampled format:Unknown - 22: TypePointer Function 21 - 23: TypeFunction 9(fvec4) 7(ptr) 22(ptr) - 28: TypeFunction 9(fvec4) 7(ptr) 22(ptr) 15(ptr) - 34: TypeFunction 9(fvec4) - 37: TypePointer UniformConstant 21 + 7(os): TypeStruct 6 + 8: TypePointer Function 7(os) + 9: TypeFloat 32 + 10: TypeVector 9(float) 4 + 11: TypeFunction 10(fvec4) 8(ptr) + 15: TypeVector 9(float) 2 + 16: TypePointer Function 15(fvec2) + 17: TypeFunction 10(fvec4) 8(ptr) 16(ptr) + 22: TypeImage 9(float) 2D sampled format:Unknown + 23(os2): TypeStruct 6 22 + 24: TypePointer Function 23(os2) + 25: TypeFunction 10(fvec4) 24(ptr) + 29: TypeFunction 10(fvec4) 24(ptr) 16(ptr) + 34: TypeFunction 10(fvec4) + 37: TypePointer UniformConstant 22 38(tex): 37(ptr) Variable UniformConstant - 41: TypeSampledImage 21 - 43: 8(float) Constant 1045220557 - 44: 8(float) Constant 1050253722 - 45: 14(fvec2) ConstantComposite 43 44 - 69: TypePointer UniformConstant 6 - 70(s.s2D): 69(ptr) Variable UniformConstant - 79(s2.s2D): 69(ptr) Variable UniformConstant - 80(s2.tex): 37(ptr) Variable UniformConstant - 96: TypePointer Output 9(fvec4) -97(@entryPointOutput): 96(ptr) Variable Output + 40: TypeInt 32 1 + 41: 40(int) Constant 0 + 42: TypePointer Function 6 + 45: TypeSampledImage 22 + 47: 9(float) Constant 1045220557 + 48: 9(float) Constant 1050253722 + 49: 15(fvec2) ConstantComposite 47 48 + 61: 40(int) Constant 1 + 62: TypePointer Function 22 + 81: TypePointer UniformConstant 6 + 82(s.s2D): 81(ptr) Variable UniformConstant + 97(s2.s2D): 81(ptr) Variable UniformConstant + 100(s2.tex): 37(ptr) Variable UniformConstant + 119: TypePointer Output 10(fvec4) +120(@entryPointOutput): 119(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 98: 9(fvec4) FunctionCall 35(@main() - Store 97(@entryPointOutput) 98 + 121: 10(fvec4) FunctionCall 35(@main() + Store 120(@entryPointOutput) 121 Return FunctionEnd -12(osCall1(struct-os-p11;): 9(fvec4) Function None 10 - 11(s.s2D): 7(ptr) FunctionParameter - 13: Label - 39: 21 Load 38(tex) - 40: 6 Load 11(s.s2D) - 42: 41 SampledImage 39 40 - 46: 9(fvec4) ImageSampleImplicitLod 42 45 - ReturnValue 46 +13(osCall1(struct-os-p11;): 10(fvec4) Function None 11 + 12(s): 8(ptr) FunctionParameter + 14: Label + 39: 22 Load 38(tex) + 43: 42(ptr) AccessChain 12(s) 41 + 44: 6 Load 43 + 46: 45 SampledImage 39 44 + 50: 10(fvec4) ImageSampleImplicitLod 46 49 + ReturnValue 50 FunctionEnd -19(osCall2(struct-os-p11;vf2;): 9(fvec4) Function None 16 - 17(s.s2D): 7(ptr) FunctionParameter - 18(f2): 15(ptr) FunctionParameter - 20: Label - 49: 21 Load 38(tex) - 50: 6 Load 17(s.s2D) - 51: 41 SampledImage 49 50 - 52: 14(fvec2) Load 18(f2) - 53: 9(fvec4) ImageSampleImplicitLod 51 52 - ReturnValue 53 +20(osCall2(struct-os-p11;vf2;): 10(fvec4) Function None 17 + 18(s): 8(ptr) FunctionParameter + 19(f2): 16(ptr) FunctionParameter + 21: Label + 53: 22 Load 38(tex) + 54: 42(ptr) AccessChain 18(s) 41 + 55: 6 Load 54 + 56: 45 SampledImage 53 55 + 57: 15(fvec2) Load 19(f2) + 58: 10(fvec4) ImageSampleImplicitLod 56 57 + ReturnValue 58 FunctionEnd -26(os2Call1(struct-os2-p1-t211;): 9(fvec4) Function None 23 - 24(s.s2D): 7(ptr) FunctionParameter - 25(s.tex): 22(ptr) FunctionParameter - 27: Label - 56: 21 Load 25(s.tex) - 57: 6 Load 24(s.s2D) - 58: 41 SampledImage 56 57 - 59: 9(fvec4) ImageSampleImplicitLod 58 45 - ReturnValue 59 +27(os2Call1(struct-os2-p1-t211;): 10(fvec4) Function None 25 + 26(s): 24(ptr) FunctionParameter + 28: Label + 63: 62(ptr) AccessChain 26(s) 61 + 64: 22 Load 63 + 65: 42(ptr) AccessChain 26(s) 41 + 66: 6 Load 65 + 67: 45 SampledImage 64 66 + 68: 10(fvec4) ImageSampleImplicitLod 67 49 + ReturnValue 68 FunctionEnd -32(os2Call2(struct-os2-p1-t211;vf2;): 9(fvec4) Function None 28 - 29(s.s2D): 7(ptr) FunctionParameter - 30(s.tex): 22(ptr) FunctionParameter - 31(f2): 15(ptr) FunctionParameter +32(os2Call2(struct-os2-p1-t211;vf2;): 10(fvec4) Function None 29 + 30(s): 24(ptr) FunctionParameter + 31(f2): 16(ptr) FunctionParameter 33: Label - 62: 21 Load 30(s.tex) - 63: 6 Load 29(s.s2D) - 64: 41 SampledImage 62 63 - 65: 14(fvec2) Load 31(f2) - 66: 9(fvec4) ImageSampleImplicitLod 64 65 - ReturnValue 66 + 71: 62(ptr) AccessChain 30(s) 61 + 72: 22 Load 71 + 73: 42(ptr) AccessChain 30(s) 41 + 74: 6 Load 73 + 75: 45 SampledImage 72 74 + 76: 15(fvec2) Load 31(f2) + 77: 10(fvec4) ImageSampleImplicitLod 75 76 + ReturnValue 77 FunctionEnd - 35(@main(): 9(fvec4) Function None 34 + 35(@main(): 10(fvec4) Function None 34 36: Label - 71(param): 7(ptr) Variable Function - 74(param): 7(ptr) Variable Function - 76(param): 15(ptr) Variable Function - 81(param): 7(ptr) Variable Function - 83(param): 22(ptr) Variable Function - 87(param): 7(ptr) Variable Function - 89(param): 22(ptr) Variable Function - 91(param): 15(ptr) Variable Function - 72: 6 Load 70(s.s2D) - Store 71(param) 72 - 73: 9(fvec4) FunctionCall 12(osCall1(struct-os-p11;) 71(param) - 75: 6 Load 70(s.s2D) - Store 74(param) 75 - Store 76(param) 45 - 77: 9(fvec4) FunctionCall 19(osCall2(struct-os-p11;vf2;) 74(param) 76(param) - 78: 9(fvec4) FAdd 73 77 - 82: 6 Load 79(s2.s2D) - Store 81(param) 82 - 84: 21 Load 80(s2.tex) - Store 83(param) 84 - 85: 9(fvec4) FunctionCall 26(os2Call1(struct-os2-p1-t211;) 81(param) 83(param) - 86: 9(fvec4) FAdd 78 85 - 88: 6 Load 79(s2.s2D) - Store 87(param) 88 - 90: 21 Load 80(s2.tex) - Store 89(param) 90 - Store 91(param) 45 - 92: 9(fvec4) FunctionCall 32(os2Call2(struct-os2-p1-t211;vf2;) 87(param) 89(param) 91(param) - 93: 9(fvec4) FAdd 86 92 - ReturnValue 93 + 80(aggShadow): 8(ptr) Variable Function + 85(param): 8(ptr) Variable Function + 88(aggShadow): 8(ptr) Variable Function + 91(param): 8(ptr) Variable Function + 93(param): 16(ptr) Variable Function + 96(aggShadow): 24(ptr) Variable Function + 103(param): 24(ptr) Variable Function + 107(aggShadow): 24(ptr) Variable Function + 112(param): 24(ptr) Variable Function + 114(param): 16(ptr) Variable Function + 83: 6 Load 82(s.s2D) + 84: 42(ptr) AccessChain 80(aggShadow) 41 + Store 84 83 + 86: 7(os) Load 80(aggShadow) + Store 85(param) 86 + 87: 10(fvec4) FunctionCall 13(osCall1(struct-os-p11;) 85(param) + 89: 6 Load 82(s.s2D) + 90: 42(ptr) AccessChain 88(aggShadow) 41 + Store 90 89 + 92: 7(os) Load 88(aggShadow) + Store 91(param) 92 + Store 93(param) 49 + 94: 10(fvec4) FunctionCall 20(osCall2(struct-os-p11;vf2;) 91(param) 93(param) + 95: 10(fvec4) FAdd 87 94 + 98: 6 Load 97(s2.s2D) + 99: 42(ptr) AccessChain 96(aggShadow) 41 + Store 99 98 + 101: 22 Load 100(s2.tex) + 102: 62(ptr) AccessChain 96(aggShadow) 61 + Store 102 101 + 104: 23(os2) Load 96(aggShadow) + Store 103(param) 104 + 105: 10(fvec4) FunctionCall 27(os2Call1(struct-os2-p1-t211;) 103(param) + 106: 10(fvec4) FAdd 95 105 + 108: 6 Load 97(s2.s2D) + 109: 42(ptr) AccessChain 107(aggShadow) 41 + Store 109 108 + 110: 22 Load 100(s2.tex) + 111: 62(ptr) AccessChain 107(aggShadow) 61 + Store 111 110 + 113: 23(os2) Load 107(aggShadow) + Store 112(param) 113 + Store 114(param) 49 + 115: 10(fvec4) FunctionCall 32(os2Call2(struct-os2-p1-t211;vf2;) 112(param) 114(param) + 116: 10(fvec4) FAdd 106 115 + ReturnValue 116 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -4,53 +4,42 @@ 0:? Sequence 0:5 Function Definition: lookUp(struct-FxaaTex-p1-t21-f11; ( temp 4-component vector of float) 0:5 Function Parameters: -0:? 'tex.smpl' ( in sampler) -0:? 'tex.tex' ( in texture2D) -0:? 'tex.f' ( in float) +0:5 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) 0:? Sequence 0:6 Branch: Return with expression 0:6 texture ( temp 4-component vector of float) 0:6 Construct combined texture-sampler ( temp sampler2D) -0:? 'tex.tex' ( in texture2D) -0:? 'tex.smpl' ( in sampler) +0:6 tex: direct index for structure ( temp texture2D) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:6 Constant: +0:6 1 (const int) +0:6 smpl: direct index for structure ( temp sampler) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:6 Constant: +0:6 0 (const int) 0:? Construct vec2 ( temp 2-component vector of float) -0:? 'tex.f' ( in float) -0:? 'tex.f' ( in float) +0:6 f: direct index for structure ( temp float) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:6 Constant: +0:6 2 (const int) +0:6 f: direct index for structure ( temp float) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:6 Constant: +0:6 2 (const int) 0:10 Function Definition: @main( ( temp 4-component vector of float) 0:10 Function Parameters: 0:? Sequence 0:11 Sequence -0:11 Sequence -0:11 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) -0:11 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) -0:11 Construct structure ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) -0:11 'g_tInputTexture_sampler' ( uniform sampler) -0:11 'g_tInputTexture' ( uniform texture2D) -0:11 Constant: -0:11 0.500000 -0:11 move second child to first child ( temp sampler) -0:? 'tex.smpl' ( temp sampler) -0:11 smpl: direct index for structure ( temp sampler) -0:11 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) -0:11 Constant: -0:11 0 (const int) -0:11 move second child to first child ( temp texture2D) -0:? 'tex.tex' ( temp texture2D) -0:11 tex: direct index for structure ( temp texture2D) -0:11 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) -0:11 Constant: -0:11 1 (const int) -0:11 move second child to first child ( temp float) -0:? 'tex.f' ( temp float) -0:11 f: direct index for structure ( temp float) -0:11 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) -0:11 Constant: -0:11 2 (const int) +0:11 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:11 'tex' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:11 Construct structure ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:11 'g_tInputTexture_sampler' ( uniform sampler) +0:11 'g_tInputTexture' ( uniform texture2D) +0:11 Constant: +0:11 0.500000 0:12 Branch: Return with expression 0:12 Function Call: lookUp(struct-FxaaTex-p1-t21-f11; ( temp 4-component vector of float) -0:? 'tex.smpl' ( temp sampler) -0:? 'tex.tex' ( temp texture2D) -0:? 'tex.f' ( temp float) +0:12 'tex' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) 0:10 Function Definition: main( ( temp void) 0:10 Function Parameters: 0:? Sequence @@ -70,53 +59,42 @@ 0:? Sequence 0:5 Function Definition: lookUp(struct-FxaaTex-p1-t21-f11; ( temp 4-component vector of float) 0:5 Function Parameters: -0:? 'tex.smpl' ( in sampler) -0:? 'tex.tex' ( in texture2D) -0:? 'tex.f' ( in float) +0:5 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) 0:? Sequence 0:6 Branch: Return with expression 0:6 texture ( temp 4-component vector of float) 0:6 Construct combined texture-sampler ( temp sampler2D) -0:? 'tex.tex' ( in texture2D) -0:? 'tex.smpl' ( in sampler) +0:6 tex: direct index for structure ( temp texture2D) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:6 Constant: +0:6 1 (const int) +0:6 smpl: direct index for structure ( temp sampler) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:6 Constant: +0:6 0 (const int) 0:? Construct vec2 ( temp 2-component vector of float) -0:? 'tex.f' ( in float) -0:? 'tex.f' ( in float) +0:6 f: direct index for structure ( temp float) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:6 Constant: +0:6 2 (const int) +0:6 f: direct index for structure ( temp float) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:6 Constant: +0:6 2 (const int) 0:10 Function Definition: @main( ( temp 4-component vector of float) 0:10 Function Parameters: 0:? Sequence 0:11 Sequence -0:11 Sequence -0:11 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) -0:11 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) -0:11 Construct structure ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) -0:11 'g_tInputTexture_sampler' ( uniform sampler) -0:11 'g_tInputTexture' ( uniform texture2D) -0:11 Constant: -0:11 0.500000 -0:11 move second child to first child ( temp sampler) -0:? 'tex.smpl' ( temp sampler) -0:11 smpl: direct index for structure ( temp sampler) -0:11 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) -0:11 Constant: -0:11 0 (const int) -0:11 move second child to first child ( temp texture2D) -0:? 'tex.tex' ( temp texture2D) -0:11 tex: direct index for structure ( temp texture2D) -0:11 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) -0:11 Constant: -0:11 1 (const int) -0:11 move second child to first child ( temp float) -0:? 'tex.f' ( temp float) -0:11 f: direct index for structure ( temp float) -0:11 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) -0:11 Constant: -0:11 2 (const int) +0:11 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:11 'tex' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:11 Construct structure ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:11 'g_tInputTexture_sampler' ( uniform sampler) +0:11 'g_tInputTexture' ( uniform texture2D) +0:11 Constant: +0:11 0.500000 0:12 Branch: Return with expression 0:12 Function Call: lookUp(struct-FxaaTex-p1-t21-f11; ( temp 4-component vector of float) -0:? 'tex.smpl' ( temp sampler) -0:? 'tex.tex' ( temp texture2D) -0:? 'tex.f' ( temp float) +0:12 'tex' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) 0:10 Function Definition: main( ( temp void) 0:10 Function Parameters: 0:? Sequence @@ -129,112 +107,89 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 70 +// Generated by (magic number): 80006 +// Id's are bound by 59 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 68 + EntryPoint Vertex 4 "main" 57 Source HLSL 500 Name 4 "main" - Name 17 "lookUp(struct-FxaaTex-p1-t21-f11;" - Name 14 "tex.smpl" - Name 15 "tex.tex" - Name 16 "tex.f" - Name 20 "@main(" - Name 34 "FxaaTex" - MemberName 34(FxaaTex) 0 "smpl" - MemberName 34(FxaaTex) 1 "tex" - MemberName 34(FxaaTex) 2 "f" - Name 36 "flattenTemp" - Name 38 "g_tInputTexture_sampler" - Name 41 "g_tInputTexture" - Name 45 "tex.smpl" - Name 50 "tex.tex" - Name 54 "tex.f" - Name 58 "param" - Name 60 "param" - Name 62 "param" - Name 68 "@entryPointOutput" - Decorate 38(g_tInputTexture_sampler) DescriptorSet 0 - Decorate 41(g_tInputTexture) DescriptorSet 0 - Decorate 68(@entryPointOutput) Location 0 + Name 9 "FxaaTex" + MemberName 9(FxaaTex) 0 "smpl" + MemberName 9(FxaaTex) 1 "tex" + MemberName 9(FxaaTex) 2 "f" + Name 14 "lookUp(struct-FxaaTex-p1-t21-f11;" + Name 13 "tex" + Name 17 "@main(" + Name 42 "tex" + Name 44 "g_tInputTexture_sampler" + Name 47 "g_tInputTexture" + Name 51 "param" + Name 57 "@entryPointOutput" + Decorate 44(g_tInputTexture_sampler) DescriptorSet 0 + Decorate 47(g_tInputTexture) DescriptorSet 0 + Decorate 57(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeSampler - 7: TypePointer Function 6 - 8: TypeFloat 32 - 9: TypeImage 8(float) 2D sampled format:Unknown - 10: TypePointer Function 9 - 11: TypePointer Function 8(float) - 12: TypeVector 8(float) 4 - 13: TypeFunction 12(fvec4) 7(ptr) 10(ptr) 11(ptr) - 19: TypeFunction 12(fvec4) - 24: TypeSampledImage 9 - 28: TypeVector 8(float) 2 - 30: 8(float) Constant 0 - 34(FxaaTex): TypeStruct 6 9 8(float) - 35: TypePointer Function 34(FxaaTex) - 37: TypePointer UniformConstant 6 -38(g_tInputTexture_sampler): 37(ptr) Variable UniformConstant - 40: TypePointer UniformConstant 9 -41(g_tInputTexture): 40(ptr) Variable UniformConstant - 43: 8(float) Constant 1056964608 - 46: TypeInt 32 1 - 47: 46(int) Constant 0 - 51: 46(int) Constant 1 - 55: 46(int) Constant 2 - 67: TypePointer Output 12(fvec4) -68(@entryPointOutput): 67(ptr) Variable Output + 7: TypeFloat 32 + 8: TypeImage 7(float) 2D sampled format:Unknown + 9(FxaaTex): TypeStruct 6 8 7(float) + 10: TypePointer Function 9(FxaaTex) + 11: TypeVector 7(float) 4 + 12: TypeFunction 11(fvec4) 10(ptr) + 16: TypeFunction 11(fvec4) + 19: TypeInt 32 1 + 20: 19(int) Constant 1 + 21: TypePointer Function 8 + 24: 19(int) Constant 0 + 25: TypePointer Function 6 + 28: TypeSampledImage 8 + 30: 19(int) Constant 2 + 31: TypePointer Function 7(float) + 36: TypeVector 7(float) 2 + 38: 7(float) Constant 0 + 43: TypePointer UniformConstant 6 +44(g_tInputTexture_sampler): 43(ptr) Variable UniformConstant + 46: TypePointer UniformConstant 8 +47(g_tInputTexture): 46(ptr) Variable UniformConstant + 49: 7(float) Constant 1056964608 + 56: TypePointer Output 11(fvec4) +57(@entryPointOutput): 56(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 69: 12(fvec4) FunctionCall 20(@main() - Store 68(@entryPointOutput) 69 + 58: 11(fvec4) FunctionCall 17(@main() + Store 57(@entryPointOutput) 58 Return FunctionEnd -17(lookUp(struct-FxaaTex-p1-t21-f11;): 12(fvec4) Function None 13 - 14(tex.smpl): 7(ptr) FunctionParameter - 15(tex.tex): 10(ptr) FunctionParameter - 16(tex.f): 11(ptr) FunctionParameter - 18: Label - 22: 9 Load 15(tex.tex) - 23: 6 Load 14(tex.smpl) - 25: 24 SampledImage 22 23 - 26: 8(float) Load 16(tex.f) - 27: 8(float) Load 16(tex.f) - 29: 28(fvec2) CompositeConstruct 26 27 - 31: 12(fvec4) ImageSampleExplicitLod 25 29 Lod 30 - ReturnValue 31 +14(lookUp(struct-FxaaTex-p1-t21-f11;): 11(fvec4) Function None 12 + 13(tex): 10(ptr) FunctionParameter + 15: Label + 22: 21(ptr) AccessChain 13(tex) 20 + 23: 8 Load 22 + 26: 25(ptr) AccessChain 13(tex) 24 + 27: 6 Load 26 + 29: 28 SampledImage 23 27 + 32: 31(ptr) AccessChain 13(tex) 30 + 33: 7(float) Load 32 + 34: 31(ptr) AccessChain 13(tex) 30 + 35: 7(float) Load 34 + 37: 36(fvec2) CompositeConstruct 33 35 + 39: 11(fvec4) ImageSampleExplicitLod 29 37 Lod 38 + ReturnValue 39 FunctionEnd - 20(@main(): 12(fvec4) Function None 19 - 21: Label - 36(flattenTemp): 35(ptr) Variable Function - 45(tex.smpl): 7(ptr) Variable Function - 50(tex.tex): 10(ptr) Variable Function - 54(tex.f): 11(ptr) Variable Function - 58(param): 7(ptr) Variable Function - 60(param): 10(ptr) Variable Function - 62(param): 11(ptr) Variable Function - 39: 6 Load 38(g_tInputTexture_sampler) - 42: 9 Load 41(g_tInputTexture) - 44: 34(FxaaTex) CompositeConstruct 39 42 43 - Store 36(flattenTemp) 44 - 48: 7(ptr) AccessChain 36(flattenTemp) 47 - 49: 6 Load 48 - Store 45(tex.smpl) 49 - 52: 10(ptr) AccessChain 36(flattenTemp) 51 - 53: 9 Load 52 - Store 50(tex.tex) 53 - 56: 11(ptr) AccessChain 36(flattenTemp) 55 - 57: 8(float) Load 56 - Store 54(tex.f) 57 - 59: 6 Load 45(tex.smpl) - Store 58(param) 59 - 61: 9 Load 50(tex.tex) - Store 60(param) 61 - 63: 8(float) Load 54(tex.f) - Store 62(param) 63 - 64: 12(fvec4) FunctionCall 17(lookUp(struct-FxaaTex-p1-t21-f11;) 58(param) 60(param) 62(param) - ReturnValue 64 + 17(@main(): 11(fvec4) Function None 16 + 18: Label + 42(tex): 10(ptr) Variable Function + 51(param): 10(ptr) Variable Function + 45: 6 Load 44(g_tInputTexture_sampler) + 48: 8 Load 47(g_tInputTexture) + 50: 9(FxaaTex) CompositeConstruct 45 48 49 + Store 42(tex) 50 + 52: 9(FxaaTex) Load 42(tex) + Store 51(param) 52 + 53: 11(fvec4) FunctionCall 14(lookUp(struct-FxaaTex-p1-t21-f11;) 51(param) + ReturnValue 53 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -4,14 +4,19 @@ 0:? Sequence 0:5 Function Definition: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) 0:5 Function Parameters: -0:? 'tex.smpl' ( in sampler) -0:? 'tex.tex' ( in texture2D) +0:5 'tex' ( in structure{ temp sampler smpl, temp texture2D tex}) 0:? Sequence 0:6 Branch: Return with expression 0:6 texture ( temp 4-component vector of float) 0:6 Construct combined texture-sampler ( temp sampler2D) -0:? 'tex.tex' ( in texture2D) -0:? 'tex.smpl' ( in sampler) +0:6 tex: direct index for structure ( temp texture2D) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex}) +0:6 Constant: +0:6 1 (const int) +0:6 smpl: direct index for structure ( temp sampler) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex}) +0:6 Constant: +0:6 0 (const int) 0:? Constant: 0:? 0.300000 0:? 0.400000 @@ -19,10 +24,16 @@ 0:10 Function Parameters: 0:? Sequence 0:12 move second child to first child ( temp sampler) -0:? 't.smpl' ( temp sampler) +0:12 smpl: direct index for structure ( temp sampler) +0:12 't' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:12 Constant: +0:12 0 (const int) 0:12 'g_tInputTexture_sampler' ( uniform sampler) 0:13 move second child to first child ( temp texture2D) -0:? 't.tex' ( temp texture2D) +0:13 tex: direct index for structure ( temp texture2D) +0:13 't' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:13 Constant: +0:13 1 (const int) 0:13 'g_tInputTexture' ( uniform texture2D) 0:14 Branch: Return with expression 0:14 't' ( temp structure{ temp sampler smpl, temp texture2D tex}) @@ -30,53 +41,34 @@ 0:18 Function Parameters: 0:? Sequence 0:19 Sequence -0:19 Sequence -0:19 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:19 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:19 Construct structure ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:19 'g_tInputTexture_sampler' ( uniform sampler) -0:19 'g_tInputTexture' ( uniform texture2D) -0:19 move second child to first child ( temp sampler) -0:? 'tex1.smpl' ( temp sampler) -0:19 smpl: direct index for structure ( temp sampler) -0:19 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:19 Constant: -0:19 0 (const int) -0:19 move second child to first child ( temp texture2D) -0:? 'tex1.tex' ( temp texture2D) -0:19 tex: direct index for structure ( temp texture2D) -0:19 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:19 Constant: -0:19 1 (const int) +0:19 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:19 'tex1' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:19 Construct structure ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:19 'g_tInputTexture_sampler' ( uniform sampler) +0:19 'g_tInputTexture' ( uniform texture2D) 0:20 Sequence -0:20 Sequence -0:20 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:20 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:20 Function Call: fillOpaque( ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:20 move second child to first child ( temp sampler) -0:? 'tex2.smpl' ( temp sampler) -0:20 smpl: direct index for structure ( temp sampler) -0:20 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:20 Constant: -0:20 0 (const int) -0:20 move second child to first child ( temp texture2D) -0:? 'tex2.tex' ( temp texture2D) -0:20 tex: direct index for structure ( temp texture2D) -0:20 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:20 Constant: -0:20 1 (const int) +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'res' ( temp 4-component vector of float) +0:20 Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) +0:20 'tex1' ( temp structure{ temp sampler smpl, temp texture2D tex}) 0:21 Sequence -0:21 Sequence -0:21 move second child to first child ( temp sampler) -0:? 'tex3.smpl' ( temp sampler) -0:? 'tex1.smpl' ( temp sampler) -0:21 move second child to first child ( temp texture2D) -0:? 'tex3.tex' ( temp texture2D) -0:? 'tex1.tex' ( temp texture2D) -0:22 Branch: Return with expression +0:21 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:21 'tex2' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:21 Function Call: fillOpaque( ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:22 add second child into first child ( temp 4-component vector of float) +0:22 'res' ( temp 4-component vector of float) 0:22 Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) -0:? 'tex3.smpl' ( temp sampler) -0:? 'tex3.tex' ( temp texture2D) +0:22 'tex2' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:23 Sequence +0:23 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:23 'tex3' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:23 'tex1' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:24 add second child into first child ( temp 4-component vector of float) +0:24 'res' ( temp 4-component vector of float) +0:24 Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) +0:24 'tex3' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:26 Branch: Return with expression +0:26 'res' ( temp 4-component vector of float) 0:18 Function Definition: main( ( temp void) 0:18 Function Parameters: 0:? Sequence @@ -96,14 +88,19 @@ 0:? Sequence 0:5 Function Definition: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) 0:5 Function Parameters: -0:? 'tex.smpl' ( in sampler) -0:? 'tex.tex' ( in texture2D) +0:5 'tex' ( in structure{ temp sampler smpl, temp texture2D tex}) 0:? Sequence 0:6 Branch: Return with expression 0:6 texture ( temp 4-component vector of float) 0:6 Construct combined texture-sampler ( temp sampler2D) -0:? 'tex.tex' ( in texture2D) -0:? 'tex.smpl' ( in sampler) +0:6 tex: direct index for structure ( temp texture2D) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex}) +0:6 Constant: +0:6 1 (const int) +0:6 smpl: direct index for structure ( temp sampler) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex}) +0:6 Constant: +0:6 0 (const int) 0:? Constant: 0:? 0.300000 0:? 0.400000 @@ -111,10 +108,16 @@ 0:10 Function Parameters: 0:? Sequence 0:12 move second child to first child ( temp sampler) -0:? 't.smpl' ( temp sampler) +0:12 smpl: direct index for structure ( temp sampler) +0:12 't' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:12 Constant: +0:12 0 (const int) 0:12 'g_tInputTexture_sampler' ( uniform sampler) 0:13 move second child to first child ( temp texture2D) -0:? 't.tex' ( temp texture2D) +0:13 tex: direct index for structure ( temp texture2D) +0:13 't' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:13 Constant: +0:13 1 (const int) 0:13 'g_tInputTexture' ( uniform texture2D) 0:14 Branch: Return with expression 0:14 't' ( temp structure{ temp sampler smpl, temp texture2D tex}) @@ -122,53 +125,34 @@ 0:18 Function Parameters: 0:? Sequence 0:19 Sequence -0:19 Sequence -0:19 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:19 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:19 Construct structure ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:19 'g_tInputTexture_sampler' ( uniform sampler) -0:19 'g_tInputTexture' ( uniform texture2D) -0:19 move second child to first child ( temp sampler) -0:? 'tex1.smpl' ( temp sampler) -0:19 smpl: direct index for structure ( temp sampler) -0:19 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:19 Constant: -0:19 0 (const int) -0:19 move second child to first child ( temp texture2D) -0:? 'tex1.tex' ( temp texture2D) -0:19 tex: direct index for structure ( temp texture2D) -0:19 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:19 Constant: -0:19 1 (const int) +0:19 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:19 'tex1' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:19 Construct structure ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:19 'g_tInputTexture_sampler' ( uniform sampler) +0:19 'g_tInputTexture' ( uniform texture2D) 0:20 Sequence -0:20 Sequence -0:20 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:20 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:20 Function Call: fillOpaque( ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:20 move second child to first child ( temp sampler) -0:? 'tex2.smpl' ( temp sampler) -0:20 smpl: direct index for structure ( temp sampler) -0:20 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:20 Constant: -0:20 0 (const int) -0:20 move second child to first child ( temp texture2D) -0:? 'tex2.tex' ( temp texture2D) -0:20 tex: direct index for structure ( temp texture2D) -0:20 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex}) -0:20 Constant: -0:20 1 (const int) +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'res' ( temp 4-component vector of float) +0:20 Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) +0:20 'tex1' ( temp structure{ temp sampler smpl, temp texture2D tex}) 0:21 Sequence -0:21 Sequence -0:21 move second child to first child ( temp sampler) -0:? 'tex3.smpl' ( temp sampler) -0:? 'tex1.smpl' ( temp sampler) -0:21 move second child to first child ( temp texture2D) -0:? 'tex3.tex' ( temp texture2D) -0:? 'tex1.tex' ( temp texture2D) -0:22 Branch: Return with expression +0:21 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:21 'tex2' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:21 Function Call: fillOpaque( ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:22 add second child into first child ( temp 4-component vector of float) +0:22 'res' ( temp 4-component vector of float) 0:22 Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) -0:? 'tex3.smpl' ( temp sampler) -0:? 'tex3.tex' ( temp texture2D) +0:22 'tex2' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:23 Sequence +0:23 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:23 'tex3' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:23 'tex1' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:24 add second child into first child ( temp 4-component vector of float) +0:24 'res' ( temp 4-component vector of float) +0:24 Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) +0:24 'tex3' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:26 Branch: Return with expression +0:26 'res' ( temp 4-component vector of float) 0:18 Function Definition: main( ( temp void) 0:18 Function Parameters: 0:? Sequence @@ -181,136 +165,127 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 84 +// Generated by (magic number): 80006 +// Id's are bound by 82 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 82 + EntryPoint Vertex 4 "main" 80 Source HLSL 500 Name 4 "main" - Name 15 "lookUp(struct-FxaaTex-p1-t211;" - Name 13 "tex.smpl" - Name 14 "tex.tex" - Name 17 "FxaaTex" - MemberName 17(FxaaTex) 0 "smpl" - MemberName 17(FxaaTex) 1 "tex" - Name 19 "fillOpaque(" - Name 22 "@main(" - Name 36 "t.smpl" - Name 38 "g_tInputTexture_sampler" - Name 40 "t.tex" - Name 42 "g_tInputTexture" - Name 45 "t" - Name 49 "flattenTemp" - Name 53 "tex1.smpl" - Name 58 "tex1.tex" - Name 62 "flattenTemp" - Name 64 "tex2.smpl" - Name 67 "tex2.tex" - Name 70 "tex3.smpl" - Name 72 "tex3.tex" - Name 74 "param" - Name 76 "param" - Name 82 "@entryPointOutput" - Decorate 38(g_tInputTexture_sampler) DescriptorSet 0 - Decorate 42(g_tInputTexture) DescriptorSet 0 - Decorate 82(@entryPointOutput) Location 0 + Name 9 "FxaaTex" + MemberName 9(FxaaTex) 0 "smpl" + MemberName 9(FxaaTex) 1 "tex" + Name 14 "lookUp(struct-FxaaTex-p1-t211;" + Name 13 "tex" + Name 17 "fillOpaque(" + Name 20 "@main(" + Name 41 "t" + Name 43 "g_tInputTexture_sampler" + Name 47 "g_tInputTexture" + Name 53 "tex1" + Name 58 "res" + Name 59 "param" + Name 62 "tex2" + Name 64 "param" + Name 69 "tex3" + Name 71 "param" + Name 80 "@entryPointOutput" + Decorate 43(g_tInputTexture_sampler) DescriptorSet 0 + Decorate 47(g_tInputTexture) DescriptorSet 0 + Decorate 80(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeSampler - 7: TypePointer Function 6 - 8: TypeFloat 32 - 9: TypeImage 8(float) 2D sampled format:Unknown - 10: TypePointer Function 9 - 11: TypeVector 8(float) 4 - 12: TypeFunction 11(fvec4) 7(ptr) 10(ptr) - 17(FxaaTex): TypeStruct 6 9 - 18: TypeFunction 17(FxaaTex) - 21: TypeFunction 11(fvec4) - 26: TypeSampledImage 9 - 28: TypeVector 8(float) 2 - 29: 8(float) Constant 1050253722 - 30: 8(float) Constant 1053609165 - 31: 28(fvec2) ConstantComposite 29 30 - 32: 8(float) Constant 0 - 37: TypePointer UniformConstant 6 -38(g_tInputTexture_sampler): 37(ptr) Variable UniformConstant - 41: TypePointer UniformConstant 9 -42(g_tInputTexture): 41(ptr) Variable UniformConstant - 44: TypePointer Function 17(FxaaTex) - 54: TypeInt 32 1 - 55: 54(int) Constant 0 - 59: 54(int) Constant 1 - 81: TypePointer Output 11(fvec4) -82(@entryPointOutput): 81(ptr) Variable Output + 7: TypeFloat 32 + 8: TypeImage 7(float) 2D sampled format:Unknown + 9(FxaaTex): TypeStruct 6 8 + 10: TypePointer Function 9(FxaaTex) + 11: TypeVector 7(float) 4 + 12: TypeFunction 11(fvec4) 10(ptr) + 16: TypeFunction 9(FxaaTex) + 19: TypeFunction 11(fvec4) + 22: TypeInt 32 1 + 23: 22(int) Constant 1 + 24: TypePointer Function 8 + 27: 22(int) Constant 0 + 28: TypePointer Function 6 + 31: TypeSampledImage 8 + 33: TypeVector 7(float) 2 + 34: 7(float) Constant 1050253722 + 35: 7(float) Constant 1053609165 + 36: 33(fvec2) ConstantComposite 34 35 + 37: 7(float) Constant 0 + 42: TypePointer UniformConstant 6 +43(g_tInputTexture_sampler): 42(ptr) Variable UniformConstant + 46: TypePointer UniformConstant 8 +47(g_tInputTexture): 46(ptr) Variable UniformConstant + 57: TypePointer Function 11(fvec4) + 79: TypePointer Output 11(fvec4) +80(@entryPointOutput): 79(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 83: 11(fvec4) FunctionCall 22(@main() - Store 82(@entryPointOutput) 83 + 81: 11(fvec4) FunctionCall 20(@main() + Store 80(@entryPointOutput) 81 Return FunctionEnd -15(lookUp(struct-FxaaTex-p1-t211;): 11(fvec4) Function None 12 - 13(tex.smpl): 7(ptr) FunctionParameter - 14(tex.tex): 10(ptr) FunctionParameter - 16: Label - 24: 9 Load 14(tex.tex) - 25: 6 Load 13(tex.smpl) - 27: 26 SampledImage 24 25 - 33: 11(fvec4) ImageSampleExplicitLod 27 31 Lod 32 - ReturnValue 33 +14(lookUp(struct-FxaaTex-p1-t211;): 11(fvec4) Function None 12 + 13(tex): 10(ptr) FunctionParameter + 15: Label + 25: 24(ptr) AccessChain 13(tex) 23 + 26: 8 Load 25 + 29: 28(ptr) AccessChain 13(tex) 27 + 30: 6 Load 29 + 32: 31 SampledImage 26 30 + 38: 11(fvec4) ImageSampleExplicitLod 32 36 Lod 37 + ReturnValue 38 FunctionEnd - 19(fillOpaque(): 17(FxaaTex) Function None 18 - 20: Label - 36(t.smpl): 7(ptr) Variable Function - 40(t.tex): 10(ptr) Variable Function - 45(t): 44(ptr) Variable Function - 39: 6 Load 38(g_tInputTexture_sampler) - Store 36(t.smpl) 39 - 43: 9 Load 42(g_tInputTexture) - Store 40(t.tex) 43 - 46: 17(FxaaTex) Load 45(t) - ReturnValue 46 + 17(fillOpaque(): 9(FxaaTex) Function None 16 + 18: Label + 41(t): 10(ptr) Variable Function + 44: 6 Load 43(g_tInputTexture_sampler) + 45: 28(ptr) AccessChain 41(t) 27 + Store 45 44 + 48: 8 Load 47(g_tInputTexture) + 49: 24(ptr) AccessChain 41(t) 23 + Store 49 48 + 50: 9(FxaaTex) Load 41(t) + ReturnValue 50 FunctionEnd - 22(@main(): 11(fvec4) Function None 21 - 23: Label - 49(flattenTemp): 44(ptr) Variable Function - 53(tex1.smpl): 7(ptr) Variable Function - 58(tex1.tex): 10(ptr) Variable Function - 62(flattenTemp): 44(ptr) Variable Function - 64(tex2.smpl): 7(ptr) Variable Function - 67(tex2.tex): 10(ptr) Variable Function - 70(tex3.smpl): 7(ptr) Variable Function - 72(tex3.tex): 10(ptr) Variable Function - 74(param): 7(ptr) Variable Function - 76(param): 10(ptr) Variable Function - 50: 6 Load 38(g_tInputTexture_sampler) - 51: 9 Load 42(g_tInputTexture) - 52: 17(FxaaTex) CompositeConstruct 50 51 - Store 49(flattenTemp) 52 - 56: 7(ptr) AccessChain 49(flattenTemp) 55 - 57: 6 Load 56 - Store 53(tex1.smpl) 57 - 60: 10(ptr) AccessChain 49(flattenTemp) 59 - 61: 9 Load 60 - Store 58(tex1.tex) 61 - 63: 17(FxaaTex) FunctionCall 19(fillOpaque() - Store 62(flattenTemp) 63 - 65: 7(ptr) AccessChain 62(flattenTemp) 55 - 66: 6 Load 65 - Store 64(tex2.smpl) 66 - 68: 10(ptr) AccessChain 62(flattenTemp) 59 - 69: 9 Load 68 - Store 67(tex2.tex) 69 - 71: 6 Load 53(tex1.smpl) - Store 70(tex3.smpl) 71 - 73: 9 Load 58(tex1.tex) - Store 72(tex3.tex) 73 - 75: 6 Load 70(tex3.smpl) - Store 74(param) 75 - 77: 9 Load 72(tex3.tex) - Store 76(param) 77 - 78: 11(fvec4) FunctionCall 15(lookUp(struct-FxaaTex-p1-t211;) 74(param) 76(param) - ReturnValue 78 + 20(@main(): 11(fvec4) Function None 19 + 21: Label + 53(tex1): 10(ptr) Variable Function + 58(res): 57(ptr) Variable Function + 59(param): 10(ptr) Variable Function + 62(tex2): 10(ptr) Variable Function + 64(param): 10(ptr) Variable Function + 69(tex3): 10(ptr) Variable Function + 71(param): 10(ptr) Variable Function + 54: 6 Load 43(g_tInputTexture_sampler) + 55: 8 Load 47(g_tInputTexture) + 56: 9(FxaaTex) CompositeConstruct 54 55 + Store 53(tex1) 56 + 60: 9(FxaaTex) Load 53(tex1) + Store 59(param) 60 + 61: 11(fvec4) FunctionCall 14(lookUp(struct-FxaaTex-p1-t211;) 59(param) + Store 58(res) 61 + 63: 9(FxaaTex) FunctionCall 17(fillOpaque() + Store 62(tex2) 63 + 65: 9(FxaaTex) Load 62(tex2) + Store 64(param) 65 + 66: 11(fvec4) FunctionCall 14(lookUp(struct-FxaaTex-p1-t211;) 64(param) + 67: 11(fvec4) Load 58(res) + 68: 11(fvec4) FAdd 67 66 + Store 58(res) 68 + 70: 9(FxaaTex) Load 53(tex1) + Store 69(tex3) 70 + 72: 9(FxaaTex) Load 69(tex3) + Store 71(param) 72 + 73: 11(fvec4) FunctionCall 14(lookUp(struct-FxaaTex-p1-t211;) 71(param) + 74: 11(fvec4) Load 58(res) + 75: 11(fvec4) FAdd 74 73 + Store 58(res) 75 + 76: 11(fvec4) Load 58(res) + ReturnValue 76 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.flatten.return.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.flatten.return.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.flatten.return.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.flatten.return.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -118,7 +118,7 @@ 0:? '@entryPointOutput.other_struct_member3' (layout( location=3) out float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 49 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.flattenSubset2.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.flattenSubset2.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.flattenSubset2.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.flattenSubset2.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -7,33 +7,48 @@ 0:8 Function Parameters: 0:8 'vpos' ( in 4-component vector of float) 0:? Sequence -0:13 Sequence -0:13 move second child to first child ( temp float) -0:? 'a1.n.y' ( temp float) -0:? 'a2.n.y' ( temp float) -0:13 move second child to first child ( temp texture2D) -0:? 'a1.n.texNested' ( temp texture2D) -0:? 'a2.n.texNested' ( temp texture2D) -0:14 Sequence -0:14 move second child to first child ( temp float) -0:? 'b.n.y' ( temp float) -0:? 'a1.n.y' ( temp float) -0:14 move second child to first child ( temp texture2D) -0:? 'b.n.texNested' ( temp texture2D) -0:? 'a1.n.texNested' ( temp texture2D) +0:13 move second child to first child ( temp structure{ temp float y, temp texture2D texNested}) +0:13 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:13 'a1' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:13 Constant: +0:13 0 (const int) +0:13 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:13 'a2' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:13 Constant: +0:13 0 (const int) +0:14 move second child to first child ( temp structure{ temp float y, temp texture2D texNested}) +0:14 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:14 'b' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp texture2D tex}) +0:14 Constant: +0:14 0 (const int) +0:14 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:14 'a1' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:14 Constant: +0:14 0 (const int) 0:17 Sequence -0:17 Sequence -0:17 move second child to first child ( temp float) -0:? 'n.y' ( temp float) -0:? 'b.n.y' ( temp float) -0:17 move second child to first child ( temp texture2D) -0:? 'n.texNested' ( temp texture2D) -0:? 'b.n.texNested' ( temp texture2D) +0:17 move second child to first child ( temp structure{ temp float y, temp texture2D texNested}) +0:17 'n' ( temp structure{ temp float y, temp texture2D texNested}) +0:17 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:17 'b' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp texture2D tex}) +0:17 Constant: +0:17 0 (const int) 0:20 move second child to first child ( temp texture2D) -0:? 'a2.n.texNested' ( temp texture2D) +0:20 texNested: direct index for structure ( temp texture2D) +0:20 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:20 'a2' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) 0:20 'someTex' ( uniform texture2D) 0:21 move second child to first child ( temp float) -0:? 'a1.n.y' ( temp float) +0:21 y: direct index for structure ( temp float) +0:21 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:21 'a1' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 0 (const int) 0:21 Constant: 0:21 1.000000 0:23 Branch: Return with expression @@ -68,33 +83,48 @@ 0:8 Function Parameters: 0:8 'vpos' ( in 4-component vector of float) 0:? Sequence -0:13 Sequence -0:13 move second child to first child ( temp float) -0:? 'a1.n.y' ( temp float) -0:? 'a2.n.y' ( temp float) -0:13 move second child to first child ( temp texture2D) -0:? 'a1.n.texNested' ( temp texture2D) -0:? 'a2.n.texNested' ( temp texture2D) -0:14 Sequence -0:14 move second child to first child ( temp float) -0:? 'b.n.y' ( temp float) -0:? 'a1.n.y' ( temp float) -0:14 move second child to first child ( temp texture2D) -0:? 'b.n.texNested' ( temp texture2D) -0:? 'a1.n.texNested' ( temp texture2D) +0:13 move second child to first child ( temp structure{ temp float y, temp texture2D texNested}) +0:13 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:13 'a1' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:13 Constant: +0:13 0 (const int) +0:13 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:13 'a2' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:13 Constant: +0:13 0 (const int) +0:14 move second child to first child ( temp structure{ temp float y, temp texture2D texNested}) +0:14 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:14 'b' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp texture2D tex}) +0:14 Constant: +0:14 0 (const int) +0:14 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:14 'a1' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:14 Constant: +0:14 0 (const int) 0:17 Sequence -0:17 Sequence -0:17 move second child to first child ( temp float) -0:? 'n.y' ( temp float) -0:? 'b.n.y' ( temp float) -0:17 move second child to first child ( temp texture2D) -0:? 'n.texNested' ( temp texture2D) -0:? 'b.n.texNested' ( temp texture2D) +0:17 move second child to first child ( temp structure{ temp float y, temp texture2D texNested}) +0:17 'n' ( temp structure{ temp float y, temp texture2D texNested}) +0:17 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:17 'b' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp texture2D tex}) +0:17 Constant: +0:17 0 (const int) 0:20 move second child to first child ( temp texture2D) -0:? 'a2.n.texNested' ( temp texture2D) +0:20 texNested: direct index for structure ( temp texture2D) +0:20 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:20 'a2' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) 0:20 'someTex' ( uniform texture2D) 0:21 move second child to first child ( temp float) -0:? 'a1.n.y' ( temp float) +0:21 y: direct index for structure ( temp float) +0:21 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:21 'a1' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 0 (const int) 0:21 Constant: 0:21 1.000000 0:23 Branch: Return with expression @@ -119,89 +149,100 @@ 0:? 'vpos' (layout( location=0) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 47 +// Generated by (magic number): 80006 +// Id's are bound by 56 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 40 43 + EntryPoint Fragment 4 "main" 49 52 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" Name 11 "@main(vf4;" Name 10 "vpos" - Name 14 "a1.n.y" - Name 15 "a2.n.y" - Name 19 "a1.n.texNested" - Name 20 "a2.n.texNested" - Name 22 "b.n.y" - Name 24 "b.n.texNested" - Name 26 "n.y" - Name 28 "n.texNested" - Name 31 "someTex" - Name 38 "vpos" - Name 40 "vpos" - Name 43 "@entryPointOutput" - Name 44 "param" - Decorate 31(someTex) DescriptorSet 0 - Decorate 40(vpos) Location 0 - Decorate 43(@entryPointOutput) Location 0 + Name 14 "Nested" + MemberName 14(Nested) 0 "y" + MemberName 14(Nested) 1 "texNested" + Name 15 "A" + MemberName 15(A) 0 "n" + MemberName 15(A) 1 "x" + Name 17 "a1" + Name 20 "a2" + Name 25 "B" + MemberName 25(B) 0 "n" + MemberName 25(B) 1 "tex" + Name 27 "b" + Name 31 "n" + Name 36 "someTex" + Name 47 "vpos" + Name 49 "vpos" + Name 52 "@entryPointOutput" + Name 53 "param" + Decorate 36(someTex) DescriptorSet 0 + Decorate 49(vpos) Location 0 + Decorate 52(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 7: TypeVector 6(float) 4 8: TypePointer Function 7(fvec4) 9: TypeFunction 7(fvec4) 8(ptr) - 13: TypePointer Function 6(float) - 17: TypeImage 6(float) 2D sampled format:Unknown - 18: TypePointer Function 17 - 30: TypePointer UniformConstant 17 - 31(someTex): 30(ptr) Variable UniformConstant - 33: 6(float) Constant 1065353216 - 34: 6(float) Constant 0 - 35: 7(fvec4) ConstantComposite 34 34 34 34 - 39: TypePointer Input 7(fvec4) - 40(vpos): 39(ptr) Variable Input - 42: TypePointer Output 7(fvec4) -43(@entryPointOutput): 42(ptr) Variable Output + 13: TypeImage 6(float) 2D sampled format:Unknown + 14(Nested): TypeStruct 6(float) 13 + 15(A): TypeStruct 14(Nested) 6(float) + 16: TypePointer Function 15(A) + 18: TypeInt 32 1 + 19: 18(int) Constant 0 + 21: TypePointer Function 14(Nested) + 25(B): TypeStruct 14(Nested) 13 + 26: TypePointer Function 25(B) + 34: 18(int) Constant 1 + 35: TypePointer UniformConstant 13 + 36(someTex): 35(ptr) Variable UniformConstant + 38: TypePointer Function 13 + 40: 6(float) Constant 1065353216 + 41: TypePointer Function 6(float) + 43: 6(float) Constant 0 + 44: 7(fvec4) ConstantComposite 43 43 43 43 + 48: TypePointer Input 7(fvec4) + 49(vpos): 48(ptr) Variable Input + 51: TypePointer Output 7(fvec4) +52(@entryPointOutput): 51(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 38(vpos): 8(ptr) Variable Function - 44(param): 8(ptr) Variable Function - 41: 7(fvec4) Load 40(vpos) - Store 38(vpos) 41 - 45: 7(fvec4) Load 38(vpos) - Store 44(param) 45 - 46: 7(fvec4) FunctionCall 11(@main(vf4;) 44(param) - Store 43(@entryPointOutput) 46 + 47(vpos): 8(ptr) Variable Function + 53(param): 8(ptr) Variable Function + 50: 7(fvec4) Load 49(vpos) + Store 47(vpos) 50 + 54: 7(fvec4) Load 47(vpos) + Store 53(param) 54 + 55: 7(fvec4) FunctionCall 11(@main(vf4;) 53(param) + Store 52(@entryPointOutput) 55 Return FunctionEnd 11(@main(vf4;): 7(fvec4) Function None 9 10(vpos): 8(ptr) FunctionParameter 12: Label - 14(a1.n.y): 13(ptr) Variable Function - 15(a2.n.y): 13(ptr) Variable Function -19(a1.n.texNested): 18(ptr) Variable Function -20(a2.n.texNested): 18(ptr) Variable Function - 22(b.n.y): 13(ptr) Variable Function -24(b.n.texNested): 18(ptr) Variable Function - 26(n.y): 13(ptr) Variable Function - 28(n.texNested): 18(ptr) Variable Function - 16: 6(float) Load 15(a2.n.y) - Store 14(a1.n.y) 16 - 21: 17 Load 20(a2.n.texNested) - Store 19(a1.n.texNested) 21 - 23: 6(float) Load 14(a1.n.y) - Store 22(b.n.y) 23 - 25: 17 Load 19(a1.n.texNested) - Store 24(b.n.texNested) 25 - 27: 6(float) Load 22(b.n.y) - Store 26(n.y) 27 - 29: 17 Load 24(b.n.texNested) - Store 28(n.texNested) 29 - 32: 17 Load 31(someTex) - Store 20(a2.n.texNested) 32 - Store 14(a1.n.y) 33 - ReturnValue 35 + 17(a1): 16(ptr) Variable Function + 20(a2): 16(ptr) Variable Function + 27(b): 26(ptr) Variable Function + 31(n): 21(ptr) Variable Function + 22: 21(ptr) AccessChain 20(a2) 19 + 23: 14(Nested) Load 22 + 24: 21(ptr) AccessChain 17(a1) 19 + Store 24 23 + 28: 21(ptr) AccessChain 17(a1) 19 + 29: 14(Nested) Load 28 + 30: 21(ptr) AccessChain 27(b) 19 + Store 30 29 + 32: 21(ptr) AccessChain 27(b) 19 + 33: 14(Nested) Load 32 + Store 31(n) 33 + 37: 13 Load 36(someTex) + 39: 38(ptr) AccessChain 20(a2) 19 34 + Store 39 37 + 42: 41(ptr) AccessChain 17(a1) 19 19 + Store 42 40 + ReturnValue 44 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.flattenSubset.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.flattenSubset.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.flattenSubset.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.flattenSubset.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -8,32 +8,34 @@ 0:30 'vpos' ( in 4-component vector of float) 0:? Sequence 0:33 move second child to first child ( temp sampler) -0:? 's1.s0.ss' ( temp sampler) +0:33 ss: direct index for structure ( temp sampler) +0:33 s0: direct index for structure ( temp structure{ temp int x, temp int y, temp sampler ss}) +0:33 's1' ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) +0:33 Constant: +0:33 2 (const int) +0:33 Constant: +0:33 2 (const int) 0:33 'samp' ( uniform sampler) -0:34 Sequence -0:34 move second child to first child ( temp float) -0:? 's2.resources.b' ( temp float) -0:? 's1.b' ( temp float) -0:34 move second child to first child ( temp sampler) -0:? 's2.resources.samplerState' ( temp sampler) -0:? 's1.samplerState' ( temp sampler) -0:34 move second child to first child ( temp int) -0:? 's2.resources.s0.x' ( temp int) -0:? 's1.s0.x' ( temp int) -0:34 move second child to first child ( temp int) -0:? 's2.resources.s0.y' ( temp int) -0:? 's1.s0.y' ( temp int) -0:34 move second child to first child ( temp sampler) -0:? 's2.resources.s0.ss' ( temp sampler) -0:? 's1.s0.ss' ( temp sampler) -0:34 move second child to first child ( temp int) -0:? 's2.resources.a' ( temp int) -0:? 's1.a' ( temp int) +0:34 move second child to first child ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) +0:34 resources: direct index for structure ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) +0:34 's2' ( temp structure{ temp int a1, temp int a2, temp int a3, temp int a4, temp int a5, temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a} resources}) +0:34 Constant: +0:34 5 (const int) +0:34 's1' ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) 0:35 Branch: Return with expression 0:35 texture ( temp 4-component vector of float) 0:35 Construct combined texture-sampler ( temp sampler2D) 0:35 'tex' ( uniform texture2D) -0:? 's2.resources.s0.ss' ( temp sampler) +0:35 ss: direct index for structure ( temp sampler) +0:35 s0: direct index for structure ( temp structure{ temp int x, temp int y, temp sampler ss}) +0:35 resources: direct index for structure ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) +0:35 's2' ( temp structure{ temp int a1, temp int a2, temp int a3, temp int a4, temp int a5, temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a} resources}) +0:35 Constant: +0:35 5 (const int) +0:35 Constant: +0:35 2 (const int) +0:35 Constant: +0:35 2 (const int) 0:35 Constant: 0:35 0.500000 0:35 0.500000 @@ -65,32 +67,34 @@ 0:30 'vpos' ( in 4-component vector of float) 0:? Sequence 0:33 move second child to first child ( temp sampler) -0:? 's1.s0.ss' ( temp sampler) +0:33 ss: direct index for structure ( temp sampler) +0:33 s0: direct index for structure ( temp structure{ temp int x, temp int y, temp sampler ss}) +0:33 's1' ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) +0:33 Constant: +0:33 2 (const int) +0:33 Constant: +0:33 2 (const int) 0:33 'samp' ( uniform sampler) -0:34 Sequence -0:34 move second child to first child ( temp float) -0:? 's2.resources.b' ( temp float) -0:? 's1.b' ( temp float) -0:34 move second child to first child ( temp sampler) -0:? 's2.resources.samplerState' ( temp sampler) -0:? 's1.samplerState' ( temp sampler) -0:34 move second child to first child ( temp int) -0:? 's2.resources.s0.x' ( temp int) -0:? 's1.s0.x' ( temp int) -0:34 move second child to first child ( temp int) -0:? 's2.resources.s0.y' ( temp int) -0:? 's1.s0.y' ( temp int) -0:34 move second child to first child ( temp sampler) -0:? 's2.resources.s0.ss' ( temp sampler) -0:? 's1.s0.ss' ( temp sampler) -0:34 move second child to first child ( temp int) -0:? 's2.resources.a' ( temp int) -0:? 's1.a' ( temp int) +0:34 move second child to first child ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) +0:34 resources: direct index for structure ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) +0:34 's2' ( temp structure{ temp int a1, temp int a2, temp int a3, temp int a4, temp int a5, temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a} resources}) +0:34 Constant: +0:34 5 (const int) +0:34 's1' ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) 0:35 Branch: Return with expression 0:35 texture ( temp 4-component vector of float) 0:35 Construct combined texture-sampler ( temp sampler2D) 0:35 'tex' ( uniform texture2D) -0:? 's2.resources.s0.ss' ( temp sampler) +0:35 ss: direct index for structure ( temp sampler) +0:35 s0: direct index for structure ( temp structure{ temp int x, temp int y, temp sampler ss}) +0:35 resources: direct index for structure ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) +0:35 's2' ( temp structure{ temp int a1, temp int a2, temp int a3, temp int a4, temp int a5, temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a} resources}) +0:35 Constant: +0:35 5 (const int) +0:35 Constant: +0:35 2 (const int) +0:35 Constant: +0:35 2 (const int) 0:35 Constant: 0:35 0.500000 0:35 0.500000 @@ -111,40 +115,46 @@ 0:? 'vpos' (layout( location=0) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 61 +// Generated by (magic number): 80006 +// Id's are bound by 54 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 54 57 + EntryPoint Fragment 4 "main" 47 50 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" Name 11 "@main(vf4;" Name 10 "vpos" - Name 15 "s1.s0.ss" - Name 17 "samp" - Name 20 "s2.resources.b" - Name 21 "s1.b" - Name 23 "s2.resources.samplerState" - Name 24 "s1.samplerState" - Name 28 "s2.resources.s0.x" - Name 29 "s1.s0.x" - Name 31 "s2.resources.s0.y" - Name 32 "s1.s0.y" - Name 34 "s2.resources.s0.ss" - Name 36 "s2.resources.a" - Name 37 "s1.a" - Name 41 "tex" - Name 52 "vpos" - Name 54 "vpos" - Name 57 "@entryPointOutput" - Name 58 "param" - Decorate 17(samp) DescriptorSet 0 - Decorate 41(tex) DescriptorSet 0 - Decorate 54(vpos) Location 0 - Decorate 57(@entryPointOutput) Location 0 + Name 15 "S0" + MemberName 15(S0) 0 "x" + MemberName 15(S0) 1 "y" + MemberName 15(S0) 2 "ss" + Name 16 "S1" + MemberName 16(S1) 0 "b" + MemberName 16(S1) 1 "samplerState" + MemberName 16(S1) 2 "s0" + MemberName 16(S1) 3 "a" + Name 18 "s1" + Name 21 "samp" + Name 25 "S2" + MemberName 25(S2) 0 "a1" + MemberName 25(S2) 1 "a2" + MemberName 25(S2) 2 "a3" + MemberName 25(S2) 3 "a4" + MemberName 25(S2) 4 "a5" + MemberName 25(S2) 5 "resources" + Name 27 "s2" + Name 33 "tex" + Name 45 "vpos" + Name 47 "vpos" + Name 50 "@entryPointOutput" + Name 51 "param" + Decorate 21(samp) DescriptorSet 0 + Decorate 33(tex) DescriptorSet 0 + Decorate 47(vpos) Location 0 + Decorate 50(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -152,67 +162,55 @@ 8: TypePointer Function 7(fvec4) 9: TypeFunction 7(fvec4) 8(ptr) 13: TypeSampler - 14: TypePointer Function 13 - 16: TypePointer UniformConstant 13 - 17(samp): 16(ptr) Variable UniformConstant - 19: TypePointer Function 6(float) - 26: TypeInt 32 1 - 27: TypePointer Function 26(int) - 39: TypeImage 6(float) 2D sampled format:Unknown - 40: TypePointer UniformConstant 39 - 41(tex): 40(ptr) Variable UniformConstant - 44: TypeSampledImage 39 - 46: TypeVector 6(float) 2 - 47: 6(float) Constant 1056964608 - 48: 46(fvec2) ConstantComposite 47 47 - 53: TypePointer Input 7(fvec4) - 54(vpos): 53(ptr) Variable Input - 56: TypePointer Output 7(fvec4) -57(@entryPointOutput): 56(ptr) Variable Output + 14: TypeInt 32 1 + 15(S0): TypeStruct 14(int) 14(int) 13 + 16(S1): TypeStruct 6(float) 13 15(S0) 14(int) + 17: TypePointer Function 16(S1) + 19: 14(int) Constant 2 + 20: TypePointer UniformConstant 13 + 21(samp): 20(ptr) Variable UniformConstant + 23: TypePointer Function 13 + 25(S2): TypeStruct 14(int) 14(int) 14(int) 14(int) 14(int) 16(S1) + 26: TypePointer Function 25(S2) + 28: 14(int) Constant 5 + 31: TypeImage 6(float) 2D sampled format:Unknown + 32: TypePointer UniformConstant 31 + 33(tex): 32(ptr) Variable UniformConstant + 37: TypeSampledImage 31 + 39: TypeVector 6(float) 2 + 40: 6(float) Constant 1056964608 + 41: 39(fvec2) ConstantComposite 40 40 + 46: TypePointer Input 7(fvec4) + 47(vpos): 46(ptr) Variable Input + 49: TypePointer Output 7(fvec4) +50(@entryPointOutput): 49(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 52(vpos): 8(ptr) Variable Function - 58(param): 8(ptr) Variable Function - 55: 7(fvec4) Load 54(vpos) - Store 52(vpos) 55 - 59: 7(fvec4) Load 52(vpos) - Store 58(param) 59 - 60: 7(fvec4) FunctionCall 11(@main(vf4;) 58(param) - Store 57(@entryPointOutput) 60 + 45(vpos): 8(ptr) Variable Function + 51(param): 8(ptr) Variable Function + 48: 7(fvec4) Load 47(vpos) + Store 45(vpos) 48 + 52: 7(fvec4) Load 45(vpos) + Store 51(param) 52 + 53: 7(fvec4) FunctionCall 11(@main(vf4;) 51(param) + Store 50(@entryPointOutput) 53 Return FunctionEnd 11(@main(vf4;): 7(fvec4) Function None 9 10(vpos): 8(ptr) FunctionParameter 12: Label - 15(s1.s0.ss): 14(ptr) Variable Function -20(s2.resources.b): 19(ptr) Variable Function - 21(s1.b): 19(ptr) Variable Function -23(s2.resources.samplerState): 14(ptr) Variable Function -24(s1.samplerState): 14(ptr) Variable Function -28(s2.resources.s0.x): 27(ptr) Variable Function - 29(s1.s0.x): 27(ptr) Variable Function -31(s2.resources.s0.y): 27(ptr) Variable Function - 32(s1.s0.y): 27(ptr) Variable Function -34(s2.resources.s0.ss): 14(ptr) Variable Function -36(s2.resources.a): 27(ptr) Variable Function - 37(s1.a): 27(ptr) Variable Function - 18: 13 Load 17(samp) - Store 15(s1.s0.ss) 18 - 22: 6(float) Load 21(s1.b) - Store 20(s2.resources.b) 22 - 25: 13 Load 24(s1.samplerState) - Store 23(s2.resources.samplerState) 25 - 30: 26(int) Load 29(s1.s0.x) - Store 28(s2.resources.s0.x) 30 - 33: 26(int) Load 32(s1.s0.y) - Store 31(s2.resources.s0.y) 33 - 35: 13 Load 15(s1.s0.ss) - Store 34(s2.resources.s0.ss) 35 - 38: 26(int) Load 37(s1.a) - Store 36(s2.resources.a) 38 - 42: 39 Load 41(tex) - 43: 13 Load 34(s2.resources.s0.ss) - 45: 44 SampledImage 42 43 - 49: 7(fvec4) ImageSampleImplicitLod 45 48 - ReturnValue 49 + 18(s1): 17(ptr) Variable Function + 27(s2): 26(ptr) Variable Function + 22: 13 Load 21(samp) + 24: 23(ptr) AccessChain 18(s1) 19 19 + Store 24 22 + 29: 16(S1) Load 18(s1) + 30: 17(ptr) AccessChain 27(s2) 28 + Store 30 29 + 34: 31 Load 33(tex) + 35: 23(ptr) AccessChain 27(s2) 28 19 19 + 36: 13 Load 35 + 38: 37 SampledImage 34 36 + 42: 7(fvec4) ImageSampleImplicitLod 38 41 + ReturnValue 42 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.float1.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.float1.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.float1.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.float1.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -65,7 +65,7 @@ 0:? 'scalar' ( global float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 27 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.float4.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.float4.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.float4.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.float4.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -42,7 +42,7 @@ 0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float AmbientColor, uniform bool ff1, layout( offset=20) uniform float ff2, layout( binding=0 offset=32) uniform 4-component vector of float ff3, layout( binding=1 offset=48) uniform 4-component vector of float ff4}) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 26 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.forLoop.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.forLoop.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.forLoop.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.forLoop.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -17,7 +17,7 @@ 0:4 No loop condition 0:4 No loop body 0:? Sequence -0:5 Loop with condition tested first +0:5 Loop with condition tested first: Unroll 0:5 Loop Condition 0:5 any ( temp bool) 0:5 NotEqual ( temp 4-component vector of bool) @@ -220,7 +220,7 @@ 0:4 No loop condition 0:4 No loop body 0:? Sequence -0:5 Loop with condition tested first +0:5 Loop with condition tested first: Unroll 0:5 Loop Condition 0:5 any ( temp bool) 0:5 NotEqual ( temp 4-component vector of bool) @@ -402,7 +402,7 @@ 0:? 'input' (layout( location=0) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 183 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.fraggeom.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.fraggeom.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.fraggeom.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.fraggeom.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -64,7 +64,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 25 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gather.array.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gather.array.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gather.array.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gather.array.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.gather.array.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -133,6 +134,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -260,7 +262,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 124 Capability Shader @@ -270,6 +272,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 107 111 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gather.basic.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gather.basic.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gather.basic.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gather.basic.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.gather.basic.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:29 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:29 Function Parameters: @@ -131,6 +132,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:29 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:29 Function Parameters: @@ -256,7 +258,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 135 Capability Shader @@ -265,6 +267,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 108 112 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -220,7 +220,7 @@ 0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 126 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.gathercmpRGBA.offset.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:38 Function Parameters: @@ -230,6 +231,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:38 Function Parameters: @@ -454,7 +456,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 164 Capability Shader @@ -463,6 +465,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 129 133 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.gather.offsetarray.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:20 Function Parameters: @@ -103,6 +104,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:20 Function Parameters: @@ -200,7 +202,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 97 Capability Shader @@ -209,6 +211,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 80 84 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gather.offset.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gather.offset.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gather.offset.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gather.offset.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.gather.offset.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:28 Function Parameters: @@ -106,6 +107,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:28 Function Parameters: @@ -206,7 +208,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 114 Capability Shader @@ -215,6 +217,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 79 83 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.gatherRGBA.array.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:28 Function Parameters: @@ -377,6 +378,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:28 Function Parameters: @@ -748,7 +750,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 255 Capability Shader @@ -758,6 +760,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 238 242 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.gatherRGBA.basic.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:34 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:34 Function Parameters: @@ -381,6 +382,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:34 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:34 Function Parameters: @@ -756,7 +758,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 265 Capability Shader @@ -765,6 +767,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 238 242 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.gatherRGBA.offsetarray.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:33 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:33 Function Parameters: @@ -629,6 +630,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:33 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:33 Function Parameters: @@ -1252,7 +1254,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 389 Capability Shader @@ -1263,6 +1265,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 363 367 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.gatherRGBA.offset.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:39 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:39 Function Parameters: @@ -633,6 +634,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:39 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:39 Function Parameters: @@ -1260,7 +1262,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 399 Capability Shader @@ -1270,6 +1272,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 363 367 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.getdimensions.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:46 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:46 Function Parameters: @@ -1161,6 +1162,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:46 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:46 Function Parameters: @@ -2316,7 +2318,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 550 Capability Shader @@ -2327,6 +2329,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 540 544 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.getdimensions.dx10.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.getdimensions.dx10.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.getdimensions.dx10.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.getdimensions.dx10.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -116,7 +116,7 @@ 0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 48 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.getdimensions.rw.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:44 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:44 Function Parameters: @@ -361,6 +362,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:44 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:44 Function Parameters: @@ -716,7 +718,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 232 Capability Shader @@ -727,6 +729,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 216 220 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.getsampleposition.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:13 Function Definition: @main(i1; ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:13 Function Parameters: @@ -14,7 +15,7 @@ 0:16 '@sampleCount' ( temp uint) 0:16 imageQuerySamples ( temp uint) 0:16 'g_tTex2dmsf4' ( uniform texture2DMS) -0:16 Test condition and select ( temp 2-component vector of float) +0:16 Test condition and select ( temp 2-component vector of float): no shortcircuit 0:16 Condition 0:16 Compare Equal ( temp bool) 0:16 '@sampleCount' ( temp uint) @@ -29,7 +30,7 @@ 0:? -0.250000 0:16 'sample' ( in int) 0:16 false case -0:16 Test condition and select ( temp 2-component vector of float) +0:16 Test condition and select ( temp 2-component vector of float): no shortcircuit 0:16 Condition 0:16 Compare Equal ( temp bool) 0:16 '@sampleCount' ( temp uint) @@ -48,7 +49,7 @@ 0:? 0.375000 0:16 'sample' ( in int) 0:16 false case -0:16 Test condition and select ( temp 2-component vector of float) +0:16 Test condition and select ( temp 2-component vector of float): no shortcircuit 0:16 Condition 0:16 Compare Equal ( temp bool) 0:16 '@sampleCount' ( temp uint) @@ -75,7 +76,7 @@ 0:? -0.437500 0:16 'sample' ( in int) 0:16 false case -0:16 Test condition and select ( temp 2-component vector of float) +0:16 Test condition and select ( temp 2-component vector of float): no shortcircuit 0:16 Condition 0:16 Compare Equal ( temp bool) 0:16 '@sampleCount' ( temp uint) @@ -129,7 +130,7 @@ 0:17 '@sampleCount' ( temp uint) 0:17 imageQuerySamples ( temp uint) 0:17 'g_tTex2dmsf4a' ( uniform texture2DMSArray) -0:17 Test condition and select ( temp 2-component vector of float) +0:17 Test condition and select ( temp 2-component vector of float): no shortcircuit 0:17 Condition 0:17 Compare Equal ( temp bool) 0:17 '@sampleCount' ( temp uint) @@ -144,7 +145,7 @@ 0:? -0.250000 0:17 'sample' ( in int) 0:17 false case -0:17 Test condition and select ( temp 2-component vector of float) +0:17 Test condition and select ( temp 2-component vector of float): no shortcircuit 0:17 Condition 0:17 Compare Equal ( temp bool) 0:17 '@sampleCount' ( temp uint) @@ -163,7 +164,7 @@ 0:? 0.375000 0:17 'sample' ( in int) 0:17 false case -0:17 Test condition and select ( temp 2-component vector of float) +0:17 Test condition and select ( temp 2-component vector of float): no shortcircuit 0:17 Condition 0:17 Compare Equal ( temp bool) 0:17 '@sampleCount' ( temp uint) @@ -190,7 +191,7 @@ 0:? -0.437500 0:17 'sample' ( in int) 0:17 false case -0:17 Test condition and select ( temp 2-component vector of float) +0:17 Test condition and select ( temp 2-component vector of float): no shortcircuit 0:17 Condition 0:17 Compare Equal ( temp bool) 0:17 '@sampleCount' ( temp uint) @@ -292,6 +293,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:13 Function Definition: @main(i1; ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:13 Function Parameters: @@ -305,7 +307,7 @@ 0:16 '@sampleCount' ( temp uint) 0:16 imageQuerySamples ( temp uint) 0:16 'g_tTex2dmsf4' ( uniform texture2DMS) -0:16 Test condition and select ( temp 2-component vector of float) +0:16 Test condition and select ( temp 2-component vector of float): no shortcircuit 0:16 Condition 0:16 Compare Equal ( temp bool) 0:16 '@sampleCount' ( temp uint) @@ -320,7 +322,7 @@ 0:? -0.250000 0:16 'sample' ( in int) 0:16 false case -0:16 Test condition and select ( temp 2-component vector of float) +0:16 Test condition and select ( temp 2-component vector of float): no shortcircuit 0:16 Condition 0:16 Compare Equal ( temp bool) 0:16 '@sampleCount' ( temp uint) @@ -339,7 +341,7 @@ 0:? 0.375000 0:16 'sample' ( in int) 0:16 false case -0:16 Test condition and select ( temp 2-component vector of float) +0:16 Test condition and select ( temp 2-component vector of float): no shortcircuit 0:16 Condition 0:16 Compare Equal ( temp bool) 0:16 '@sampleCount' ( temp uint) @@ -366,7 +368,7 @@ 0:? -0.437500 0:16 'sample' ( in int) 0:16 false case -0:16 Test condition and select ( temp 2-component vector of float) +0:16 Test condition and select ( temp 2-component vector of float): no shortcircuit 0:16 Condition 0:16 Compare Equal ( temp bool) 0:16 '@sampleCount' ( temp uint) @@ -420,7 +422,7 @@ 0:17 '@sampleCount' ( temp uint) 0:17 imageQuerySamples ( temp uint) 0:17 'g_tTex2dmsf4a' ( uniform texture2DMSArray) -0:17 Test condition and select ( temp 2-component vector of float) +0:17 Test condition and select ( temp 2-component vector of float): no shortcircuit 0:17 Condition 0:17 Compare Equal ( temp bool) 0:17 '@sampleCount' ( temp uint) @@ -435,7 +437,7 @@ 0:? -0.250000 0:17 'sample' ( in int) 0:17 false case -0:17 Test condition and select ( temp 2-component vector of float) +0:17 Test condition and select ( temp 2-component vector of float): no shortcircuit 0:17 Condition 0:17 Compare Equal ( temp bool) 0:17 '@sampleCount' ( temp uint) @@ -454,7 +456,7 @@ 0:? 0.375000 0:17 'sample' ( in int) 0:17 false case -0:17 Test condition and select ( temp 2-component vector of float) +0:17 Test condition and select ( temp 2-component vector of float): no shortcircuit 0:17 Condition 0:17 Compare Equal ( temp bool) 0:17 '@sampleCount' ( temp uint) @@ -481,7 +483,7 @@ 0:? -0.437500 0:17 'sample' ( in int) 0:17 false case -0:17 Test condition and select ( temp 2-component vector of float) +0:17 Test condition and select ( temp 2-component vector of float): no shortcircuit 0:17 Condition 0:17 Compare Equal ( temp bool) 0:17 '@sampleCount' ( temp uint) @@ -578,15 +580,16 @@ 0:? 'sample' (layout( location=0) flat in int) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 221 +// Generated by (magic number): 80006 +// Id's are bound by 198 Capability Shader Capability ImageQuery 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 204 211 215 + EntryPoint Fragment 4 "main" 181 188 192 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 10 "PS_OUTPUT" @@ -597,33 +600,33 @@ Name 17 "r00" Name 20 "@sampleCount" Name 23 "g_tTex2dmsf4" - Name 42 "indexable" - Name 65 "indexable" - Name 96 "indexable" - Name 129 "indexable" - Name 138 "r01" - Name 139 "@sampleCount" - Name 142 "g_tTex2dmsf4a" - Name 151 "indexable" - Name 161 "indexable" - Name 171 "indexable" - Name 181 "indexable" - Name 190 "psout" - Name 202 "sample" - Name 204 "sample" - Name 206 "flattenTemp" - Name 207 "param" - Name 211 "@entryPointOutput.Color" - Name 215 "@entryPointOutput.Depth" - Name 220 "g_sSamp" + Name 39 "indexable" + Name 58 "indexable" + Name 85 "indexable" + Name 114 "indexable" + Name 127 "r01" + Name 128 "@sampleCount" + Name 131 "g_tTex2dmsf4a" + Name 137 "indexable" + Name 143 "indexable" + Name 149 "indexable" + Name 155 "indexable" + Name 167 "psout" + Name 179 "sample" + Name 181 "sample" + Name 183 "flattenTemp" + Name 184 "param" + Name 188 "@entryPointOutput.Color" + Name 192 "@entryPointOutput.Depth" + Name 197 "g_sSamp" Decorate 23(g_tTex2dmsf4) DescriptorSet 0 - Decorate 142(g_tTex2dmsf4a) DescriptorSet 0 - Decorate 204(sample) Flat - Decorate 204(sample) Location 0 - Decorate 211(@entryPointOutput.Color) Location 0 - Decorate 215(@entryPointOutput.Depth) BuiltIn FragDepth - Decorate 220(g_sSamp) DescriptorSet 0 - Decorate 220(g_sSamp) Binding 0 + Decorate 131(g_tTex2dmsf4a) DescriptorSet 0 + Decorate 181(sample) Flat + Decorate 181(sample) Location 0 + Decorate 188(@entryPointOutput.Color) Location 0 + Decorate 192(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 197(g_sSamp) DescriptorSet 0 + Decorate 197(g_sSamp) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -639,110 +642,111 @@ 21: TypeImage 8(float) 2D multi-sampled sampled format:Unknown 22: TypePointer UniformConstant 21 23(g_tTex2dmsf4): 22(ptr) Variable UniformConstant - 28: 6(int) Constant 2 - 29: TypeBool - 33: 18(int) Constant 2 - 34: TypeArray 15(fvec2) 33 - 35: 8(float) Constant 1048576000 - 36: 15(fvec2) ConstantComposite 35 35 - 37: 8(float) Constant 3196059648 - 38: 15(fvec2) ConstantComposite 37 37 - 39: 34 ConstantComposite 36 38 - 41: TypePointer Function 34 - 48: 6(int) Constant 4 - 52: 18(int) Constant 4 - 53: TypeArray 15(fvec2) 52 - 54: 8(float) Constant 3187671040 - 55: 8(float) Constant 3200253952 - 56: 15(fvec2) ConstantComposite 54 55 - 57: 8(float) Constant 1052770304 - 58: 15(fvec2) ConstantComposite 57 54 - 59: 8(float) Constant 1040187392 - 60: 15(fvec2) ConstantComposite 55 59 - 61: 15(fvec2) ConstantComposite 59 57 - 62: 53 ConstantComposite 56 58 60 61 - 64: TypePointer Function 53 - 71: 6(int) Constant 8 - 75: 18(int) Constant 8 - 76: TypeArray 15(fvec2) 75 - 77: 8(float) Constant 1031798784 - 78: 8(float) Constant 3191865344 - 79: 15(fvec2) ConstantComposite 77 78 - 80: 8(float) Constant 3179282432 - 81: 8(float) Constant 1044381696 - 82: 15(fvec2) ConstantComposite 80 81 - 83: 8(float) Constant 1050673152 - 84: 15(fvec2) ConstantComposite 83 77 - 85: 8(float) Constant 3198156800 - 86: 15(fvec2) ConstantComposite 78 85 - 87: 15(fvec2) ConstantComposite 85 83 - 88: 8(float) Constant 3202351104 - 89: 15(fvec2) ConstantComposite 88 80 - 90: 8(float) Constant 1054867456 - 91: 15(fvec2) ConstantComposite 81 90 - 92: 15(fvec2) ConstantComposite 90 88 - 93: 76 ConstantComposite 79 82 84 86 87 89 91 92 - 95: TypePointer Function 76 - 102: 6(int) Constant 16 - 106: 18(int) Constant 16 - 107: TypeArray 15(fvec2) 106 - 108: 15(fvec2) ConstantComposite 77 77 - 109: 15(fvec2) ConstantComposite 80 78 - 110: 15(fvec2) ConstantComposite 78 59 - 111: 15(fvec2) ConstantComposite 35 80 - 112: 15(fvec2) ConstantComposite 85 54 - 113: 15(fvec2) ConstantComposite 59 83 - 114: 15(fvec2) ConstantComposite 83 81 - 115: 15(fvec2) ConstantComposite 81 85 - 116: 15(fvec2) ConstantComposite 54 57 - 117: 8(float) Constant 0 - 118: 15(fvec2) ConstantComposite 117 88 - 119: 15(fvec2) ConstantComposite 37 55 - 120: 15(fvec2) ConstantComposite 55 35 - 121: 8(float) Constant 3204448256 - 122: 15(fvec2) ConstantComposite 121 117 - 123: 15(fvec2) ConstantComposite 90 37 - 124: 15(fvec2) ConstantComposite 57 90 - 125: 15(fvec2) ConstantComposite 88 121 - 126: 107 ConstantComposite 108 109 110 111 112 113 114 115 116 118 119 120 122 123 124 125 - 128: TypePointer Function 107 - 133: 15(fvec2) ConstantComposite 117 117 - 140: TypeImage 8(float) 2D array multi-sampled sampled format:Unknown - 141: TypePointer UniformConstant 140 -142(g_tTex2dmsf4a): 141(ptr) Variable UniformConstant - 189: TypePointer Function 10(PS_OUTPUT) - 191: 6(int) Constant 0 - 192: 8(float) Constant 1065353216 - 193: 9(fvec4) ConstantComposite 192 192 192 192 - 194: TypePointer Function 9(fvec4) - 196: 6(int) Constant 1 - 197: TypePointer Function 8(float) - 203: TypePointer Input 6(int) - 204(sample): 203(ptr) Variable Input - 210: TypePointer Output 9(fvec4) -211(@entryPointOutput.Color): 210(ptr) Variable Output - 214: TypePointer Output 8(float) -215(@entryPointOutput.Depth): 214(ptr) Variable Output - 218: TypeSampler - 219: TypePointer UniformConstant 218 - 220(g_sSamp): 219(ptr) Variable UniformConstant + 27: 6(int) Constant 2 + 28: TypeBool + 30: 18(int) Constant 2 + 31: TypeArray 15(fvec2) 30 + 32: 8(float) Constant 1048576000 + 33: 15(fvec2) ConstantComposite 32 32 + 34: 8(float) Constant 3196059648 + 35: 15(fvec2) ConstantComposite 34 34 + 36: 31 ConstantComposite 33 35 + 38: TypePointer Function 31 + 43: 6(int) Constant 4 + 45: 18(int) Constant 4 + 46: TypeArray 15(fvec2) 45 + 47: 8(float) Constant 3187671040 + 48: 8(float) Constant 3200253952 + 49: 15(fvec2) ConstantComposite 47 48 + 50: 8(float) Constant 1052770304 + 51: 15(fvec2) ConstantComposite 50 47 + 52: 8(float) Constant 1040187392 + 53: 15(fvec2) ConstantComposite 48 52 + 54: 15(fvec2) ConstantComposite 52 50 + 55: 46 ConstantComposite 49 51 53 54 + 57: TypePointer Function 46 + 62: 6(int) Constant 8 + 64: 18(int) Constant 8 + 65: TypeArray 15(fvec2) 64 + 66: 8(float) Constant 1031798784 + 67: 8(float) Constant 3191865344 + 68: 15(fvec2) ConstantComposite 66 67 + 69: 8(float) Constant 3179282432 + 70: 8(float) Constant 1044381696 + 71: 15(fvec2) ConstantComposite 69 70 + 72: 8(float) Constant 1050673152 + 73: 15(fvec2) ConstantComposite 72 66 + 74: 8(float) Constant 3198156800 + 75: 15(fvec2) ConstantComposite 67 74 + 76: 15(fvec2) ConstantComposite 74 72 + 77: 8(float) Constant 3202351104 + 78: 15(fvec2) ConstantComposite 77 69 + 79: 8(float) Constant 1054867456 + 80: 15(fvec2) ConstantComposite 70 79 + 81: 15(fvec2) ConstantComposite 79 77 + 82: 65 ConstantComposite 68 71 73 75 76 78 80 81 + 84: TypePointer Function 65 + 89: 6(int) Constant 16 + 91: 18(int) Constant 16 + 92: TypeArray 15(fvec2) 91 + 93: 15(fvec2) ConstantComposite 66 66 + 94: 15(fvec2) ConstantComposite 69 67 + 95: 15(fvec2) ConstantComposite 67 52 + 96: 15(fvec2) ConstantComposite 32 69 + 97: 15(fvec2) ConstantComposite 74 47 + 98: 15(fvec2) ConstantComposite 52 72 + 99: 15(fvec2) ConstantComposite 72 70 + 100: 15(fvec2) ConstantComposite 70 74 + 101: 15(fvec2) ConstantComposite 47 50 + 102: 8(float) Constant 0 + 103: 15(fvec2) ConstantComposite 102 77 + 104: 15(fvec2) ConstantComposite 34 48 + 105: 15(fvec2) ConstantComposite 48 32 + 106: 8(float) Constant 3204448256 + 107: 15(fvec2) ConstantComposite 106 102 + 108: 15(fvec2) ConstantComposite 79 34 + 109: 15(fvec2) ConstantComposite 50 79 + 110: 15(fvec2) ConstantComposite 77 106 + 111: 92 ConstantComposite 93 94 95 96 97 98 99 100 101 103 104 105 107 108 109 110 + 113: TypePointer Function 92 + 117: 15(fvec2) ConstantComposite 102 102 + 118: TypeVector 28(bool) 2 + 129: TypeImage 8(float) 2D array multi-sampled sampled format:Unknown + 130: TypePointer UniformConstant 129 +131(g_tTex2dmsf4a): 130(ptr) Variable UniformConstant + 166: TypePointer Function 10(PS_OUTPUT) + 168: 6(int) Constant 0 + 169: 8(float) Constant 1065353216 + 170: 9(fvec4) ConstantComposite 169 169 169 169 + 171: TypePointer Function 9(fvec4) + 173: 6(int) Constant 1 + 174: TypePointer Function 8(float) + 180: TypePointer Input 6(int) + 181(sample): 180(ptr) Variable Input + 187: TypePointer Output 9(fvec4) +188(@entryPointOutput.Color): 187(ptr) Variable Output + 191: TypePointer Output 8(float) +192(@entryPointOutput.Depth): 191(ptr) Variable Output + 195: TypeSampler + 196: TypePointer UniformConstant 195 + 197(g_sSamp): 196(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label - 202(sample): 7(ptr) Variable Function -206(flattenTemp): 189(ptr) Variable Function - 207(param): 7(ptr) Variable Function - 205: 6(int) Load 204(sample) - Store 202(sample) 205 - 208: 6(int) Load 202(sample) - Store 207(param) 208 - 209:10(PS_OUTPUT) FunctionCall 13(@main(i1;) 207(param) - Store 206(flattenTemp) 209 - 212: 194(ptr) AccessChain 206(flattenTemp) 191 - 213: 9(fvec4) Load 212 - Store 211(@entryPointOutput.Color) 213 - 216: 197(ptr) AccessChain 206(flattenTemp) 196 - 217: 8(float) Load 216 - Store 215(@entryPointOutput.Depth) 217 + 179(sample): 7(ptr) Variable Function +183(flattenTemp): 166(ptr) Variable Function + 184(param): 7(ptr) Variable Function + 182: 6(int) Load 181(sample) + Store 179(sample) 182 + 185: 6(int) Load 179(sample) + Store 184(param) 185 + 186:10(PS_OUTPUT) FunctionCall 13(@main(i1;) 184(param) + Store 183(flattenTemp) 186 + 189: 171(ptr) AccessChain 183(flattenTemp) 168 + 190: 9(fvec4) Load 189 + Store 188(@entryPointOutput.Color) 190 + 193: 174(ptr) AccessChain 183(flattenTemp) 173 + 194: 8(float) Load 193 + Store 192(@entryPointOutput.Depth) 194 Return FunctionEnd 13(@main(i1;):10(PS_OUTPUT) Function None 11 @@ -750,165 +754,93 @@ 14: Label 17(r00): 16(ptr) Variable Function 20(@sampleCount): 19(ptr) Variable Function - 26: 16(ptr) Variable Function - 42(indexable): 41(ptr) Variable Function - 46: 16(ptr) Variable Function - 65(indexable): 64(ptr) Variable Function - 69: 16(ptr) Variable Function - 96(indexable): 95(ptr) Variable Function - 100: 16(ptr) Variable Function - 129(indexable): 128(ptr) Variable Function - 138(r01): 16(ptr) Variable Function -139(@sampleCount): 19(ptr) Variable Function - 145: 16(ptr) Variable Function - 151(indexable): 41(ptr) Variable Function - 155: 16(ptr) Variable Function - 161(indexable): 64(ptr) Variable Function - 165: 16(ptr) Variable Function - 171(indexable): 95(ptr) Variable Function - 175: 16(ptr) Variable Function - 181(indexable): 128(ptr) Variable Function - 190(psout): 189(ptr) Variable Function + 39(indexable): 38(ptr) Variable Function + 58(indexable): 57(ptr) Variable Function + 85(indexable): 84(ptr) Variable Function + 114(indexable): 113(ptr) Variable Function + 127(r01): 16(ptr) Variable Function +128(@sampleCount): 19(ptr) Variable Function + 137(indexable): 38(ptr) Variable Function + 143(indexable): 57(ptr) Variable Function + 149(indexable): 84(ptr) Variable Function + 155(indexable): 113(ptr) Variable Function + 167(psout): 166(ptr) Variable Function 24: 21 Load 23(g_tTex2dmsf4) 25: 18(int) ImageQuerySamples 24 Store 20(@sampleCount) 25 - 27: 18(int) Load 20(@sampleCount) - 30: 29(bool) IEqual 27 28 - SelectionMerge 32 None - BranchConditional 30 31 45 - 31: Label - 40: 6(int) Load 12(sample) - Store 42(indexable) 39 - 43: 16(ptr) AccessChain 42(indexable) 40 - 44: 15(fvec2) Load 43 - Store 26 44 - Branch 32 - 45: Label - 47: 18(int) Load 20(@sampleCount) - 49: 29(bool) IEqual 47 48 - SelectionMerge 51 None - BranchConditional 49 50 68 - 50: Label - 63: 6(int) Load 12(sample) - Store 65(indexable) 62 - 66: 16(ptr) AccessChain 65(indexable) 63 - 67: 15(fvec2) Load 66 - Store 46 67 - Branch 51 - 68: Label - 70: 18(int) Load 20(@sampleCount) - 72: 29(bool) IEqual 70 71 - SelectionMerge 74 None - BranchConditional 72 73 99 - 73: Label - 94: 6(int) Load 12(sample) - Store 96(indexable) 93 - 97: 16(ptr) AccessChain 96(indexable) 94 - 98: 15(fvec2) Load 97 - Store 69 98 - Branch 74 - 99: Label - 101: 18(int) Load 20(@sampleCount) - 103: 29(bool) IEqual 101 102 - SelectionMerge 105 None - BranchConditional 103 104 132 - 104: Label - 127: 6(int) Load 12(sample) - Store 129(indexable) 126 - 130: 16(ptr) AccessChain 129(indexable) 127 - 131: 15(fvec2) Load 130 - Store 100 131 - Branch 105 - 132: Label - Store 100 133 - Branch 105 - 105: Label - 134: 15(fvec2) Load 100 - Store 69 134 - Branch 74 - 74: Label - 135: 15(fvec2) Load 69 - Store 46 135 - Branch 51 - 51: Label - 136: 15(fvec2) Load 46 - Store 26 136 - Branch 32 - 32: Label - 137: 15(fvec2) Load 26 - Store 17(r00) 137 - 143: 140 Load 142(g_tTex2dmsf4a) - 144: 18(int) ImageQuerySamples 143 - Store 139(@sampleCount) 144 - 146: 18(int) Load 139(@sampleCount) - 147: 29(bool) IEqual 146 28 - SelectionMerge 149 None - BranchConditional 147 148 154 - 148: Label - 150: 6(int) Load 12(sample) - Store 151(indexable) 39 - 152: 16(ptr) AccessChain 151(indexable) 150 - 153: 15(fvec2) Load 152 - Store 145 153 - Branch 149 - 154: Label - 156: 18(int) Load 139(@sampleCount) - 157: 29(bool) IEqual 156 48 - SelectionMerge 159 None - BranchConditional 157 158 164 - 158: Label - 160: 6(int) Load 12(sample) - Store 161(indexable) 62 - 162: 16(ptr) AccessChain 161(indexable) 160 - 163: 15(fvec2) Load 162 - Store 155 163 - Branch 159 - 164: Label - 166: 18(int) Load 139(@sampleCount) - 167: 29(bool) IEqual 166 71 - SelectionMerge 169 None - BranchConditional 167 168 174 - 168: Label - 170: 6(int) Load 12(sample) - Store 171(indexable) 93 - 172: 16(ptr) AccessChain 171(indexable) 170 - 173: 15(fvec2) Load 172 - Store 165 173 - Branch 169 - 174: Label - 176: 18(int) Load 139(@sampleCount) - 177: 29(bool) IEqual 176 102 - SelectionMerge 179 None - BranchConditional 177 178 184 - 178: Label - 180: 6(int) Load 12(sample) - Store 181(indexable) 126 - 182: 16(ptr) AccessChain 181(indexable) 180 - 183: 15(fvec2) Load 182 - Store 175 183 - Branch 179 - 184: Label - Store 175 133 - Branch 179 - 179: Label - 185: 15(fvec2) Load 175 - Store 165 185 - Branch 169 - 169: Label - 186: 15(fvec2) Load 165 - Store 155 186 - Branch 159 - 159: Label - 187: 15(fvec2) Load 155 - Store 145 187 - Branch 149 - 149: Label - 188: 15(fvec2) Load 145 - Store 138(r01) 188 - 195: 194(ptr) AccessChain 190(psout) 191 - Store 195 193 - 198: 197(ptr) AccessChain 190(psout) 196 - Store 198 192 - 199:10(PS_OUTPUT) Load 190(psout) - ReturnValue 199 + 26: 18(int) Load 20(@sampleCount) + 29: 28(bool) IEqual 26 27 + 37: 6(int) Load 12(sample) + Store 39(indexable) 36 + 40: 16(ptr) AccessChain 39(indexable) 37 + 41: 15(fvec2) Load 40 + 42: 18(int) Load 20(@sampleCount) + 44: 28(bool) IEqual 42 43 + 56: 6(int) Load 12(sample) + Store 58(indexable) 55 + 59: 16(ptr) AccessChain 58(indexable) 56 + 60: 15(fvec2) Load 59 + 61: 18(int) Load 20(@sampleCount) + 63: 28(bool) IEqual 61 62 + 83: 6(int) Load 12(sample) + Store 85(indexable) 82 + 86: 16(ptr) AccessChain 85(indexable) 83 + 87: 15(fvec2) Load 86 + 88: 18(int) Load 20(@sampleCount) + 90: 28(bool) IEqual 88 89 + 112: 6(int) Load 12(sample) + Store 114(indexable) 111 + 115: 16(ptr) AccessChain 114(indexable) 112 + 116: 15(fvec2) Load 115 + 119: 118(bvec2) CompositeConstruct 90 90 + 120: 15(fvec2) Select 119 116 117 + 121: 118(bvec2) CompositeConstruct 63 63 + 122: 15(fvec2) Select 121 87 120 + 123: 118(bvec2) CompositeConstruct 44 44 + 124: 15(fvec2) Select 123 60 122 + 125: 118(bvec2) CompositeConstruct 29 29 + 126: 15(fvec2) Select 125 41 124 + Store 17(r00) 126 + 132: 129 Load 131(g_tTex2dmsf4a) + 133: 18(int) ImageQuerySamples 132 + Store 128(@sampleCount) 133 + 134: 18(int) Load 128(@sampleCount) + 135: 28(bool) IEqual 134 27 + 136: 6(int) Load 12(sample) + Store 137(indexable) 36 + 138: 16(ptr) AccessChain 137(indexable) 136 + 139: 15(fvec2) Load 138 + 140: 18(int) Load 128(@sampleCount) + 141: 28(bool) IEqual 140 43 + 142: 6(int) Load 12(sample) + Store 143(indexable) 55 + 144: 16(ptr) AccessChain 143(indexable) 142 + 145: 15(fvec2) Load 144 + 146: 18(int) Load 128(@sampleCount) + 147: 28(bool) IEqual 146 62 + 148: 6(int) Load 12(sample) + Store 149(indexable) 82 + 150: 16(ptr) AccessChain 149(indexable) 148 + 151: 15(fvec2) Load 150 + 152: 18(int) Load 128(@sampleCount) + 153: 28(bool) IEqual 152 89 + 154: 6(int) Load 12(sample) + Store 155(indexable) 111 + 156: 16(ptr) AccessChain 155(indexable) 154 + 157: 15(fvec2) Load 156 + 158: 118(bvec2) CompositeConstruct 153 153 + 159: 15(fvec2) Select 158 157 117 + 160: 118(bvec2) CompositeConstruct 147 147 + 161: 15(fvec2) Select 160 151 159 + 162: 118(bvec2) CompositeConstruct 141 141 + 163: 15(fvec2) Select 162 145 161 + 164: 118(bvec2) CompositeConstruct 135 135 + 165: 15(fvec2) Select 164 139 163 + Store 127(r01) 165 + 172: 171(ptr) AccessChain 167(psout) 168 + Store 172 170 + 175: 174(ptr) AccessChain 167(psout) 173 + Store 175 169 + 176:10(PS_OUTPUT) Load 167(psout) + ReturnValue 176 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.global-const-init.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.global-const-init.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.global-const-init.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.global-const-init.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -102,7 +102,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 50 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,1158 @@ +hlsl.gs-hs-mix.tesc +Shader version: 500 +vertices = 3 +input primitive = triangles +vertex spacing = fractional_odd_spacing +triangle order = ccw +0:? Sequence +0:31 Function Definition: HSPatchConstant(struct-HSInput-vf3-vf31[3]; ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:31 Function Parameters: +0:31 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? Sequence +0:32 Sequence +0:32 move second child to first child ( temp 3-component vector of float) +0:32 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:32 tess_factor: direct index for structure (layout( row_major std140) uniform 3-component vector of float) +0:32 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:32 Constant: +0:32 6 (const uint) +0:33 Sequence +0:33 move second child to first child ( temp float) +0:33 'roundedInsideTessFactor' ( temp float) +0:33 Constant: +0:33 3.000000 +0:34 Sequence +0:34 move second child to first child ( temp float) +0:34 'insideTessFactor' ( temp float) +0:34 Constant: +0:34 1.000000 +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:39 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 direct index ( temp float) +0:39 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:39 Constant: +0:39 0 (const int) +0:40 move second child to first child ( temp float) +0:40 direct index ( temp float) +0:40 EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:40 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 direct index ( temp float) +0:40 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:40 Constant: +0:40 1 (const int) +0:41 move second child to first child ( temp float) +0:41 direct index ( temp float) +0:41 EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:41 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 2 (const int) +0:41 direct index ( temp float) +0:41 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:41 Constant: +0:41 2 (const int) +0:42 move second child to first child ( temp float) +0:42 InsideTessFactor: direct index for structure ( temp float) +0:42 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:42 Constant: +0:42 1 (const int) +0:42 'roundedInsideTessFactor' ( temp float) +0:45 move second child to first child ( temp 3-component vector of float) +0:45 direct index ( temp 3-component vector of float) +0:45 NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:45 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 NormalWS: direct index for structure ( temp 3-component vector of float) +0:45 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:45 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 1 (const int) +0:46 move second child to first child ( temp 3-component vector of float) +0:46 direct index ( temp 3-component vector of float) +0:46 NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:46 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:46 Constant: +0:46 2 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 NormalWS: direct index for structure ( temp 3-component vector of float) +0:46 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:46 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 direct index ( temp 3-component vector of float) +0:47 NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:47 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:47 Constant: +0:47 2 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 NormalWS: direct index for structure ( temp 3-component vector of float) +0:47 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:47 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:47 Constant: +0:47 2 (const int) +0:47 Constant: +0:47 1 (const int) +0:49 Branch: Return with expression +0:49 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:61 Function Definition: @HSMain(struct-HSInput-vf3-vf31[3];u1; ( temp structure{ temp 3-component vector of float PositionWS}) +0:61 Function Parameters: +0:61 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:61 'id' ( in uint) +0:? Sequence +0:63 move second child to first child ( temp 3-component vector of float) +0:63 PositionWS: direct index for structure ( temp 3-component vector of float) +0:63 'output' ( temp structure{ temp 3-component vector of float PositionWS}) +0:63 Constant: +0:63 0 (const int) +0:63 PositionWS: direct index for structure ( temp 3-component vector of float) +0:63 indirect index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:63 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:63 'id' ( in uint) +0:63 Constant: +0:63 0 (const int) +0:64 Branch: Return with expression +0:64 'output' ( temp structure{ temp 3-component vector of float PositionWS}) +0:61 Function Definition: HSMain( ( temp void) +0:61 Function Parameters: +0:? Sequence +0:61 move second child to first child ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:61 move second child to first child ( temp uint) +0:? 'id' ( temp uint) +0:? 'id' ( in uint InvocationID) +0:61 move second child to first child ( temp structure{ temp 3-component vector of float PositionWS}) +0:61 indirect index (layout( location=0) out structure{ temp 3-component vector of float PositionWS}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float PositionWS}) +0:? 'id' ( in uint InvocationID) +0:61 Function Call: @HSMain(struct-HSInput-vf3-vf31[3];u1; ( temp structure{ temp 3-component vector of float PositionWS}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'id' ( temp uint) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'id' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Function Call: HSPatchConstant(struct-HSInput-vf3-vf31[3]; ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 2 (const int) +0:? direct index ( temp float) +0:? EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 2 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelInner) +0:? '@patchConstantOutput.InsideTessFactor' ( patch out 2-element array of float TessLevelInner) +0:? Constant: +0:? 0 (const int) +0:? InsideTessFactor: direct index for structure ( temp float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp 3-element array of 3-component vector of float) +0:? NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:? '@patchConstantOutput' (layout( location=1) patch out structure{ temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 2 (const int) +0:84 Function Definition: GSMain(struct-GSVertexInput-vf3-vf31[3];struct-GSVertexOutput-vf41; ( temp void) +0:84 Function Parameters: +0:84 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:84 'output' ( out structure{ temp 4-component vector of float PositionCS}) +0:? Sequence +0:86 Sequence +0:86 move second child to first child ( temp 3-component vector of float) +0:86 'P0' ( temp 3-component vector of float) +0:86 vector swizzle ( temp 3-component vector of float) +0:86 PositionWS: direct index for structure ( temp 3-component vector of float) +0:86 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:86 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 0 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:86 Constant: +0:86 2 (const int) +0:87 Sequence +0:87 move second child to first child ( temp 3-component vector of float) +0:87 'P1' ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 PositionWS: direct index for structure ( temp 3-component vector of float) +0:87 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:87 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 0 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:88 Sequence +0:88 move second child to first child ( temp 3-component vector of float) +0:88 'P2' ( temp 3-component vector of float) +0:88 vector swizzle ( temp 3-component vector of float) +0:88 PositionWS: direct index for structure ( temp 3-component vector of float) +0:88 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:88 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:88 Constant: +0:88 2 (const int) +0:88 Constant: +0:88 0 (const int) +0:88 Sequence +0:88 Constant: +0:88 0 (const int) +0:88 Constant: +0:88 1 (const int) +0:88 Constant: +0:88 2 (const int) +0:92 add second child into first child ( temp float) +0:92 direct index ( temp float) +0:92 'P0' ( temp 3-component vector of float) +0:92 Constant: +0:92 2 (const int) +0:92 Constant: +0:92 0.001000 +0:93 add second child into first child ( temp float) +0:93 direct index ( temp float) +0:93 'P1' ( temp 3-component vector of float) +0:93 Constant: +0:93 2 (const int) +0:93 Constant: +0:93 0.001000 +0:94 add second child into first child ( temp float) +0:94 direct index ( temp float) +0:94 'P2' ( temp 3-component vector of float) +0:94 Constant: +0:94 2 (const int) +0:94 Constant: +0:94 0.001000 +0:95 Sequence +0:95 move second child to first child ( temp 4-component vector of float) +0:95 'Q0' ( temp 4-component vector of float) +0:95 vector-times-matrix ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:95 'P0' ( temp 3-component vector of float) +0:95 Constant: +0:95 1.000000 +0:95 proj_matrix: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:95 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:95 Constant: +0:95 1 (const uint) +0:96 Sequence +0:96 move second child to first child ( temp 4-component vector of float) +0:96 'Q1' ( temp 4-component vector of float) +0:96 vector-times-matrix ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:96 'P1' ( temp 3-component vector of float) +0:96 Constant: +0:96 1.000000 +0:96 proj_matrix: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:96 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:96 Constant: +0:96 1 (const uint) +0:97 Sequence +0:97 move second child to first child ( temp 4-component vector of float) +0:97 'Q2' ( temp 4-component vector of float) +0:97 vector-times-matrix ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:97 'P2' ( temp 3-component vector of float) +0:97 Constant: +0:97 1.000000 +0:97 proj_matrix: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:97 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:97 Constant: +0:97 1 (const uint) +0:100 move second child to first child ( temp 4-component vector of float) +0:100 PositionCS: direct index for structure ( temp 4-component vector of float) +0:100 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:100 Constant: +0:100 0 (const int) +0:100 'Q0' ( temp 4-component vector of float) +0:101 Constant: +0:101 0.000000 +0:102 move second child to first child ( temp 4-component vector of float) +0:102 PositionCS: direct index for structure ( temp 4-component vector of float) +0:102 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:102 Constant: +0:102 0 (const int) +0:102 'Q1' ( temp 4-component vector of float) +0:103 Constant: +0:103 0.000000 +0:104 Constant: +0:104 0.000000 +0:107 move second child to first child ( temp 4-component vector of float) +0:107 PositionCS: direct index for structure ( temp 4-component vector of float) +0:107 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:107 Constant: +0:107 0 (const int) +0:107 'Q1' ( temp 4-component vector of float) +0:108 Constant: +0:108 0.000000 +0:109 move second child to first child ( temp 4-component vector of float) +0:109 PositionCS: direct index for structure ( temp 4-component vector of float) +0:109 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:109 Constant: +0:109 0 (const int) +0:109 'Q2' ( temp 4-component vector of float) +0:110 Constant: +0:110 0.000000 +0:111 Constant: +0:111 0.000000 +0:114 move second child to first child ( temp 4-component vector of float) +0:114 PositionCS: direct index for structure ( temp 4-component vector of float) +0:114 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:114 Constant: +0:114 0 (const int) +0:114 'Q2' ( temp 4-component vector of float) +0:115 Constant: +0:115 0.000000 +0:116 move second child to first child ( temp 4-component vector of float) +0:116 PositionCS: direct index for structure ( temp 4-component vector of float) +0:116 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:116 Constant: +0:116 0 (const int) +0:116 'Q0' ( temp 4-component vector of float) +0:117 Constant: +0:117 0.000000 +0:118 Constant: +0:118 0.000000 +0:? Linker Objects +0:? 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float PositionWS}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'id' ( in uint InvocationID) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? '@patchConstantOutput.InsideTessFactor' ( patch out 2-element array of float TessLevelInner) +0:? '@patchConstantOutput' (layout( location=1) patch out structure{ temp 3-element array of 3-component vector of float NormalWS}) + + +Linked tessellation control stage: + + +Shader version: 500 +vertices = 3 +input primitive = triangles +vertex spacing = fractional_odd_spacing +triangle order = ccw +0:? Sequence +0:31 Function Definition: HSPatchConstant(struct-HSInput-vf3-vf31[3]; ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:31 Function Parameters: +0:31 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? Sequence +0:32 Sequence +0:32 move second child to first child ( temp 3-component vector of float) +0:32 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:32 tess_factor: direct index for structure (layout( row_major std140) uniform 3-component vector of float) +0:32 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:32 Constant: +0:32 6 (const uint) +0:33 Sequence +0:33 move second child to first child ( temp float) +0:33 'roundedInsideTessFactor' ( temp float) +0:33 Constant: +0:33 3.000000 +0:34 Sequence +0:34 move second child to first child ( temp float) +0:34 'insideTessFactor' ( temp float) +0:34 Constant: +0:34 1.000000 +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:39 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 direct index ( temp float) +0:39 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:39 Constant: +0:39 0 (const int) +0:40 move second child to first child ( temp float) +0:40 direct index ( temp float) +0:40 EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:40 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 direct index ( temp float) +0:40 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:40 Constant: +0:40 1 (const int) +0:41 move second child to first child ( temp float) +0:41 direct index ( temp float) +0:41 EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:41 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 2 (const int) +0:41 direct index ( temp float) +0:41 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:41 Constant: +0:41 2 (const int) +0:42 move second child to first child ( temp float) +0:42 InsideTessFactor: direct index for structure ( temp float) +0:42 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:42 Constant: +0:42 1 (const int) +0:42 'roundedInsideTessFactor' ( temp float) +0:45 move second child to first child ( temp 3-component vector of float) +0:45 direct index ( temp 3-component vector of float) +0:45 NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:45 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 NormalWS: direct index for structure ( temp 3-component vector of float) +0:45 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:45 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 1 (const int) +0:46 move second child to first child ( temp 3-component vector of float) +0:46 direct index ( temp 3-component vector of float) +0:46 NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:46 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:46 Constant: +0:46 2 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 NormalWS: direct index for structure ( temp 3-component vector of float) +0:46 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:46 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 direct index ( temp 3-component vector of float) +0:47 NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:47 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:47 Constant: +0:47 2 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 NormalWS: direct index for structure ( temp 3-component vector of float) +0:47 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:47 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:47 Constant: +0:47 2 (const int) +0:47 Constant: +0:47 1 (const int) +0:49 Branch: Return with expression +0:49 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:61 Function Definition: @HSMain(struct-HSInput-vf3-vf31[3];u1; ( temp structure{ temp 3-component vector of float PositionWS}) +0:61 Function Parameters: +0:61 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:61 'id' ( in uint) +0:? Sequence +0:63 move second child to first child ( temp 3-component vector of float) +0:63 PositionWS: direct index for structure ( temp 3-component vector of float) +0:63 'output' ( temp structure{ temp 3-component vector of float PositionWS}) +0:63 Constant: +0:63 0 (const int) +0:63 PositionWS: direct index for structure ( temp 3-component vector of float) +0:63 indirect index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:63 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:63 'id' ( in uint) +0:63 Constant: +0:63 0 (const int) +0:64 Branch: Return with expression +0:64 'output' ( temp structure{ temp 3-component vector of float PositionWS}) +0:61 Function Definition: HSMain( ( temp void) +0:61 Function Parameters: +0:? Sequence +0:61 move second child to first child ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:61 move second child to first child ( temp uint) +0:? 'id' ( temp uint) +0:? 'id' ( in uint InvocationID) +0:61 move second child to first child ( temp structure{ temp 3-component vector of float PositionWS}) +0:61 indirect index (layout( location=0) out structure{ temp 3-component vector of float PositionWS}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float PositionWS}) +0:? 'id' ( in uint InvocationID) +0:61 Function Call: @HSMain(struct-HSInput-vf3-vf31[3];u1; ( temp structure{ temp 3-component vector of float PositionWS}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'id' ( temp uint) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'id' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Function Call: HSPatchConstant(struct-HSInput-vf3-vf31[3]; ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 2 (const int) +0:? direct index ( temp float) +0:? EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 2 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelInner) +0:? '@patchConstantOutput.InsideTessFactor' ( patch out 2-element array of float TessLevelInner) +0:? Constant: +0:? 0 (const int) +0:? InsideTessFactor: direct index for structure ( temp float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp 3-element array of 3-component vector of float) +0:? NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:? '@patchConstantOutput' (layout( location=1) patch out structure{ temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 2 (const int) +0:84 Function Definition: GSMain(struct-GSVertexInput-vf3-vf31[3];struct-GSVertexOutput-vf41; ( temp void) +0:84 Function Parameters: +0:84 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:84 'output' ( out structure{ temp 4-component vector of float PositionCS}) +0:? Sequence +0:86 Sequence +0:86 move second child to first child ( temp 3-component vector of float) +0:86 'P0' ( temp 3-component vector of float) +0:86 vector swizzle ( temp 3-component vector of float) +0:86 PositionWS: direct index for structure ( temp 3-component vector of float) +0:86 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:86 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 0 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:86 Constant: +0:86 2 (const int) +0:87 Sequence +0:87 move second child to first child ( temp 3-component vector of float) +0:87 'P1' ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 PositionWS: direct index for structure ( temp 3-component vector of float) +0:87 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:87 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 0 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:88 Sequence +0:88 move second child to first child ( temp 3-component vector of float) +0:88 'P2' ( temp 3-component vector of float) +0:88 vector swizzle ( temp 3-component vector of float) +0:88 PositionWS: direct index for structure ( temp 3-component vector of float) +0:88 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:88 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:88 Constant: +0:88 2 (const int) +0:88 Constant: +0:88 0 (const int) +0:88 Sequence +0:88 Constant: +0:88 0 (const int) +0:88 Constant: +0:88 1 (const int) +0:88 Constant: +0:88 2 (const int) +0:92 add second child into first child ( temp float) +0:92 direct index ( temp float) +0:92 'P0' ( temp 3-component vector of float) +0:92 Constant: +0:92 2 (const int) +0:92 Constant: +0:92 0.001000 +0:93 add second child into first child ( temp float) +0:93 direct index ( temp float) +0:93 'P1' ( temp 3-component vector of float) +0:93 Constant: +0:93 2 (const int) +0:93 Constant: +0:93 0.001000 +0:94 add second child into first child ( temp float) +0:94 direct index ( temp float) +0:94 'P2' ( temp 3-component vector of float) +0:94 Constant: +0:94 2 (const int) +0:94 Constant: +0:94 0.001000 +0:95 Sequence +0:95 move second child to first child ( temp 4-component vector of float) +0:95 'Q0' ( temp 4-component vector of float) +0:95 vector-times-matrix ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:95 'P0' ( temp 3-component vector of float) +0:95 Constant: +0:95 1.000000 +0:95 proj_matrix: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:95 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:95 Constant: +0:95 1 (const uint) +0:96 Sequence +0:96 move second child to first child ( temp 4-component vector of float) +0:96 'Q1' ( temp 4-component vector of float) +0:96 vector-times-matrix ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:96 'P1' ( temp 3-component vector of float) +0:96 Constant: +0:96 1.000000 +0:96 proj_matrix: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:96 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:96 Constant: +0:96 1 (const uint) +0:97 Sequence +0:97 move second child to first child ( temp 4-component vector of float) +0:97 'Q2' ( temp 4-component vector of float) +0:97 vector-times-matrix ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:97 'P2' ( temp 3-component vector of float) +0:97 Constant: +0:97 1.000000 +0:97 proj_matrix: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:97 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:97 Constant: +0:97 1 (const uint) +0:100 move second child to first child ( temp 4-component vector of float) +0:100 PositionCS: direct index for structure ( temp 4-component vector of float) +0:100 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:100 Constant: +0:100 0 (const int) +0:100 'Q0' ( temp 4-component vector of float) +0:101 Constant: +0:101 0.000000 +0:102 move second child to first child ( temp 4-component vector of float) +0:102 PositionCS: direct index for structure ( temp 4-component vector of float) +0:102 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:102 Constant: +0:102 0 (const int) +0:102 'Q1' ( temp 4-component vector of float) +0:103 Constant: +0:103 0.000000 +0:104 Constant: +0:104 0.000000 +0:107 move second child to first child ( temp 4-component vector of float) +0:107 PositionCS: direct index for structure ( temp 4-component vector of float) +0:107 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:107 Constant: +0:107 0 (const int) +0:107 'Q1' ( temp 4-component vector of float) +0:108 Constant: +0:108 0.000000 +0:109 move second child to first child ( temp 4-component vector of float) +0:109 PositionCS: direct index for structure ( temp 4-component vector of float) +0:109 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:109 Constant: +0:109 0 (const int) +0:109 'Q2' ( temp 4-component vector of float) +0:110 Constant: +0:110 0.000000 +0:111 Constant: +0:111 0.000000 +0:114 move second child to first child ( temp 4-component vector of float) +0:114 PositionCS: direct index for structure ( temp 4-component vector of float) +0:114 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:114 Constant: +0:114 0 (const int) +0:114 'Q2' ( temp 4-component vector of float) +0:115 Constant: +0:115 0.000000 +0:116 move second child to first child ( temp 4-component vector of float) +0:116 PositionCS: direct index for structure ( temp 4-component vector of float) +0:116 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:116 Constant: +0:116 0 (const int) +0:116 'Q0' ( temp 4-component vector of float) +0:117 Constant: +0:117 0.000000 +0:118 Constant: +0:118 0.000000 +0:? Linker Objects +0:? 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float PositionWS}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'id' ( in uint InvocationID) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? '@patchConstantOutput.InsideTessFactor' ( patch out 2-element array of float TessLevelInner) +0:? '@patchConstantOutput' (layout( location=1) patch out structure{ temp 3-element array of 3-component vector of float NormalWS}) + +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 216 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "HSMain" 97 101 105 126 139 145 + ExecutionMode 4 OutputVertices 3 + ExecutionMode 4 Triangles + ExecutionMode 4 SpacingFractionalOdd + ExecutionMode 4 VertexOrderCcw + Source HLSL 500 + Name 4 "HSMain" + Name 8 "HSInput" + MemberName 8(HSInput) 0 "PositionWS" + MemberName 8(HSInput) 1 "NormalWS" + Name 15 "HSTrianglePatchConstant" + MemberName 15(HSTrianglePatchConstant) 0 "EdgeTessFactor" + MemberName 15(HSTrianglePatchConstant) 1 "InsideTessFactor" + MemberName 15(HSTrianglePatchConstant) 2 "NormalWS" + Name 18 "HSPatchConstant(struct-HSInput-vf3-vf31[3];" + Name 17 "patch" + Name 21 "HSOutput" + MemberName 21(HSOutput) 0 "PositionWS" + Name 25 "@HSMain(struct-HSInput-vf3-vf31[3];u1;" + Name 23 "patch" + Name 24 "id" + Name 27 "GSVertexInput" + MemberName 27(GSVertexInput) 0 "PositionWS" + MemberName 27(GSVertexInput) 1 "NormalWS" + Name 31 "GSVertexOutput" + MemberName 31(GSVertexOutput) 0 "PositionCS" + Name 36 "GSMain(struct-GSVertexInput-vf3-vf31[3];struct-GSVertexOutput-vf41;" + Name 34 "input" + Name 35 "output" + Name 39 "roundedEdgeTessFactor" + Name 42 "UniformBlock0" + MemberName 42(UniformBlock0) 0 "model_view_matrix" + MemberName 42(UniformBlock0) 1 "proj_matrix" + MemberName 42(UniformBlock0) 2 "model_view_proj_matrix" + MemberName 42(UniformBlock0) 3 "normal_matrix" + MemberName 42(UniformBlock0) 4 "color" + MemberName 42(UniformBlock0) 5 "view_dir" + MemberName 42(UniformBlock0) 6 "tess_factor" + Name 44 "" + Name 51 "roundedInsideTessFactor" + Name 53 "insideTessFactor" + Name 56 "result" + Name 87 "output" + Name 95 "patch" + Name 97 "patch" + Name 99 "id" + Name 101 "id" + Name 105 "@entryPointOutput" + Name 107 "param" + Name 109 "param" + Name 120 "@patchConstantResult" + Name 121 "param" + Name 126 "@patchConstantOutput.EdgeTessFactor" + Name 139 "@patchConstantOutput.InsideTessFactor" + Name 143 "HSTrianglePatchConstant" + MemberName 143(HSTrianglePatchConstant) 0 "NormalWS" + Name 145 "@patchConstantOutput" + Name 151 "P0" + Name 154 "P1" + Name 157 "P2" + Name 174 "Q0" + Name 184 "Q1" + Name 193 "Q2" + Name 202 "vertex" + MemberDecorate 42(UniformBlock0) 0 RowMajor + MemberDecorate 42(UniformBlock0) 0 Offset 0 + MemberDecorate 42(UniformBlock0) 0 MatrixStride 16 + MemberDecorate 42(UniformBlock0) 1 RowMajor + MemberDecorate 42(UniformBlock0) 1 Offset 64 + MemberDecorate 42(UniformBlock0) 1 MatrixStride 16 + MemberDecorate 42(UniformBlock0) 2 RowMajor + MemberDecorate 42(UniformBlock0) 2 Offset 128 + MemberDecorate 42(UniformBlock0) 2 MatrixStride 16 + MemberDecorate 42(UniformBlock0) 3 RowMajor + MemberDecorate 42(UniformBlock0) 3 Offset 192 + MemberDecorate 42(UniformBlock0) 3 MatrixStride 16 + MemberDecorate 42(UniformBlock0) 4 Offset 240 + MemberDecorate 42(UniformBlock0) 5 Offset 256 + MemberDecorate 42(UniformBlock0) 6 Offset 272 + Decorate 42(UniformBlock0) Block + Decorate 44 DescriptorSet 0 + Decorate 44 Binding 0 + Decorate 97(patch) Location 0 + Decorate 101(id) BuiltIn InvocationId + Decorate 105(@entryPointOutput) Location 0 + Decorate 126(@patchConstantOutput.EdgeTessFactor) Patch + Decorate 126(@patchConstantOutput.EdgeTessFactor) BuiltIn TessLevelOuter + Decorate 139(@patchConstantOutput.InsideTessFactor) Patch + Decorate 139(@patchConstantOutput.InsideTessFactor) BuiltIn TessLevelInner + MemberDecorate 143(HSTrianglePatchConstant) 0 Patch + Decorate 145(@patchConstantOutput) Patch + Decorate 145(@patchConstantOutput) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8(HSInput): TypeStruct 7(fvec3) 7(fvec3) + 9: TypeInt 32 0 + 10: 9(int) Constant 3 + 11: TypeArray 8(HSInput) 10 + 12: TypePointer Function 11 + 13: TypeArray 6(float) 10 + 14: TypeArray 7(fvec3) 10 +15(HSTrianglePatchConstant): TypeStruct 13 6(float) 14 + 16: TypeFunction 15(HSTrianglePatchConstant) 12(ptr) + 20: TypePointer Function 9(int) + 21(HSOutput): TypeStruct 7(fvec3) + 22: TypeFunction 21(HSOutput) 12(ptr) 20(ptr) +27(GSVertexInput): TypeStruct 7(fvec3) 7(fvec3) + 28: TypeArray 27(GSVertexInput) 10 + 29: TypePointer Function 28 + 30: TypeVector 6(float) 4 +31(GSVertexOutput): TypeStruct 30(fvec4) + 32: TypePointer Function 31(GSVertexOutput) + 33: TypeFunction 2 29(ptr) 32(ptr) + 38: TypePointer Function 7(fvec3) + 40: TypeMatrix 30(fvec4) 4 + 41: TypeMatrix 7(fvec3) 3 +42(UniformBlock0): TypeStruct 40 40 40 41 7(fvec3) 7(fvec3) 7(fvec3) + 43: TypePointer Uniform 42(UniformBlock0) + 44: 43(ptr) Variable Uniform + 45: TypeInt 32 1 + 46: 45(int) Constant 6 + 47: TypePointer Uniform 7(fvec3) + 50: TypePointer Function 6(float) + 52: 6(float) Constant 1077936128 + 54: 6(float) Constant 1065353216 + 55: TypePointer Function 15(HSTrianglePatchConstant) + 57: 45(int) Constant 0 + 58: 9(int) Constant 0 + 62: 45(int) Constant 1 + 63: 9(int) Constant 1 + 67: 45(int) Constant 2 + 68: 9(int) Constant 2 + 86: TypePointer Function 21(HSOutput) + 96: TypePointer Input 11 + 97(patch): 96(ptr) Variable Input + 100: TypePointer Input 9(int) + 101(id): 100(ptr) Variable Input + 103: TypeArray 21(HSOutput) 10 + 104: TypePointer Output 103 +105(@entryPointOutput): 104(ptr) Variable Output + 112: TypePointer Output 21(HSOutput) + 114: 9(int) Constant 4 + 116: TypeBool + 124: TypeArray 6(float) 114 + 125: TypePointer Output 124 +126(@patchConstantOutput.EdgeTessFactor): 125(ptr) Variable Output + 129: TypePointer Output 6(float) + 137: TypeArray 6(float) 68 + 138: TypePointer Output 137 +139(@patchConstantOutput.InsideTessFactor): 138(ptr) Variable Output +143(HSTrianglePatchConstant): TypeStruct 14 + 144: TypePointer Output 143(HSTrianglePatchConstant) +145(@patchConstantOutput): 144(ptr) Variable Output + 146: TypePointer Function 14 + 149: TypePointer Output 14 + 160: 6(float) Constant 981668463 + 173: TypePointer Function 30(fvec4) + 180: TypePointer Uniform 40 + 205: 6(float) Constant 0 + 4(HSMain): 2 Function None 3 + 5: Label + 95(patch): 12(ptr) Variable Function + 99(id): 20(ptr) Variable Function + 107(param): 12(ptr) Variable Function + 109(param): 20(ptr) Variable Function +120(@patchConstantResult): 55(ptr) Variable Function + 121(param): 12(ptr) Variable Function + 98: 11 Load 97(patch) + Store 95(patch) 98 + 102: 9(int) Load 101(id) + Store 99(id) 102 + 106: 9(int) Load 101(id) + 108: 11 Load 95(patch) + Store 107(param) 108 + 110: 9(int) Load 99(id) + Store 109(param) 110 + 111:21(HSOutput) FunctionCall 25(@HSMain(struct-HSInput-vf3-vf31[3];u1;) 107(param) 109(param) + 113: 112(ptr) AccessChain 105(@entryPointOutput) 106 + Store 113 111 + ControlBarrier 68 114 58 + 115: 9(int) Load 101(id) + 117: 116(bool) IEqual 115 57 + SelectionMerge 119 None + BranchConditional 117 118 119 + 118: Label + 122: 11 Load 95(patch) + Store 121(param) 122 + 123:15(HSTrianglePatchConstant) FunctionCall 18(HSPatchConstant(struct-HSInput-vf3-vf31[3];) 121(param) + Store 120(@patchConstantResult) 123 + 127: 50(ptr) AccessChain 120(@patchConstantResult) 57 57 + 128: 6(float) Load 127 + 130: 129(ptr) AccessChain 126(@patchConstantOutput.EdgeTessFactor) 57 + Store 130 128 + 131: 50(ptr) AccessChain 120(@patchConstantResult) 57 62 + 132: 6(float) Load 131 + 133: 129(ptr) AccessChain 126(@patchConstantOutput.EdgeTessFactor) 62 + Store 133 132 + 134: 50(ptr) AccessChain 120(@patchConstantResult) 57 67 + 135: 6(float) Load 134 + 136: 129(ptr) AccessChain 126(@patchConstantOutput.EdgeTessFactor) 67 + Store 136 135 + 140: 50(ptr) AccessChain 120(@patchConstantResult) 62 + 141: 6(float) Load 140 + 142: 129(ptr) AccessChain 139(@patchConstantOutput.InsideTessFactor) 57 + Store 142 141 + 147: 146(ptr) AccessChain 120(@patchConstantResult) 67 + 148: 14 Load 147 + 150: 149(ptr) AccessChain 145(@patchConstantOutput) 57 + Store 150 148 + Branch 119 + 119: Label + Return + FunctionEnd +18(HSPatchConstant(struct-HSInput-vf3-vf31[3];):15(HSTrianglePatchConstant) Function None 16 + 17(patch): 12(ptr) FunctionParameter + 19: Label +39(roundedEdgeTessFactor): 38(ptr) Variable Function +51(roundedInsideTessFactor): 50(ptr) Variable Function +53(insideTessFactor): 50(ptr) Variable Function + 56(result): 55(ptr) Variable Function + 48: 47(ptr) AccessChain 44 46 + 49: 7(fvec3) Load 48 + Store 39(roundedEdgeTessFactor) 49 + Store 51(roundedInsideTessFactor) 52 + Store 53(insideTessFactor) 54 + 59: 50(ptr) AccessChain 39(roundedEdgeTessFactor) 58 + 60: 6(float) Load 59 + 61: 50(ptr) AccessChain 56(result) 57 57 + Store 61 60 + 64: 50(ptr) AccessChain 39(roundedEdgeTessFactor) 63 + 65: 6(float) Load 64 + 66: 50(ptr) AccessChain 56(result) 57 62 + Store 66 65 + 69: 50(ptr) AccessChain 39(roundedEdgeTessFactor) 68 + 70: 6(float) Load 69 + 71: 50(ptr) AccessChain 56(result) 57 67 + Store 71 70 + 72: 6(float) Load 51(roundedInsideTessFactor) + 73: 50(ptr) AccessChain 56(result) 62 + Store 73 72 + 74: 38(ptr) AccessChain 17(patch) 57 62 + 75: 7(fvec3) Load 74 + 76: 38(ptr) AccessChain 56(result) 67 57 + Store 76 75 + 77: 38(ptr) AccessChain 17(patch) 62 62 + 78: 7(fvec3) Load 77 + 79: 38(ptr) AccessChain 56(result) 67 62 + Store 79 78 + 80: 38(ptr) AccessChain 17(patch) 67 62 + 81: 7(fvec3) Load 80 + 82: 38(ptr) AccessChain 56(result) 67 67 + Store 82 81 + 83:15(HSTrianglePatchConstant) Load 56(result) + ReturnValue 83 + FunctionEnd +25(@HSMain(struct-HSInput-vf3-vf31[3];u1;):21(HSOutput) Function None 22 + 23(patch): 12(ptr) FunctionParameter + 24(id): 20(ptr) FunctionParameter + 26: Label + 87(output): 86(ptr) Variable Function + 88: 9(int) Load 24(id) + 89: 38(ptr) AccessChain 23(patch) 88 57 + 90: 7(fvec3) Load 89 + 91: 38(ptr) AccessChain 87(output) 57 + Store 91 90 + 92:21(HSOutput) Load 87(output) + ReturnValue 92 + FunctionEnd +36(GSMain(struct-GSVertexInput-vf3-vf31[3];struct-GSVertexOutput-vf41;): 2 Function None 33 + 34(input): 29(ptr) FunctionParameter + 35(output): 32(ptr) FunctionParameter + 37: Label + 151(P0): 38(ptr) Variable Function + 154(P1): 38(ptr) Variable Function + 157(P2): 38(ptr) Variable Function + 174(Q0): 173(ptr) Variable Function + 184(Q1): 173(ptr) Variable Function + 193(Q2): 173(ptr) Variable Function + 202(vertex): 32(ptr) Variable Function + 152: 38(ptr) AccessChain 34(input) 57 57 + 153: 7(fvec3) Load 152 + Store 151(P0) 153 + 155: 38(ptr) AccessChain 34(input) 62 57 + 156: 7(fvec3) Load 155 + Store 154(P1) 156 + 158: 38(ptr) AccessChain 34(input) 67 57 + 159: 7(fvec3) Load 158 + Store 157(P2) 159 + 161: 50(ptr) AccessChain 151(P0) 68 + 162: 6(float) Load 161 + 163: 6(float) FAdd 162 160 + 164: 50(ptr) AccessChain 151(P0) 68 + Store 164 163 + 165: 50(ptr) AccessChain 154(P1) 68 + 166: 6(float) Load 165 + 167: 6(float) FAdd 166 160 + 168: 50(ptr) AccessChain 154(P1) 68 + Store 168 167 + 169: 50(ptr) AccessChain 157(P2) 68 + 170: 6(float) Load 169 + 171: 6(float) FAdd 170 160 + 172: 50(ptr) AccessChain 157(P2) 68 + Store 172 171 + 175: 7(fvec3) Load 151(P0) + 176: 6(float) CompositeExtract 175 0 + 177: 6(float) CompositeExtract 175 1 + 178: 6(float) CompositeExtract 175 2 + 179: 30(fvec4) CompositeConstruct 176 177 178 54 + 181: 180(ptr) AccessChain 44 62 + 182: 40 Load 181 + 183: 30(fvec4) VectorTimesMatrix 179 182 + Store 174(Q0) 183 + 185: 7(fvec3) Load 154(P1) + 186: 6(float) CompositeExtract 185 0 + 187: 6(float) CompositeExtract 185 1 + 188: 6(float) CompositeExtract 185 2 + 189: 30(fvec4) CompositeConstruct 186 187 188 54 + 190: 180(ptr) AccessChain 44 62 + 191: 40 Load 190 + 192: 30(fvec4) VectorTimesMatrix 189 191 + Store 184(Q1) 192 + 194: 7(fvec3) Load 157(P2) + 195: 6(float) CompositeExtract 194 0 + 196: 6(float) CompositeExtract 194 1 + 197: 6(float) CompositeExtract 194 2 + 198: 30(fvec4) CompositeConstruct 195 196 197 54 + 199: 180(ptr) AccessChain 44 62 + 200: 40 Load 199 + 201: 30(fvec4) VectorTimesMatrix 198 200 + Store 193(Q2) 201 + 203: 30(fvec4) Load 174(Q0) + 204: 173(ptr) AccessChain 202(vertex) 57 + Store 204 203 + 206: 30(fvec4) Load 184(Q1) + 207: 173(ptr) AccessChain 202(vertex) 57 + Store 207 206 + 208: 30(fvec4) Load 184(Q1) + 209: 173(ptr) AccessChain 202(vertex) 57 + Store 209 208 + 210: 30(fvec4) Load 193(Q2) + 211: 173(ptr) AccessChain 202(vertex) 57 + Store 211 210 + 212: 30(fvec4) Load 193(Q2) + 213: 173(ptr) AccessChain 202(vertex) 57 + Store 213 212 + 214: 30(fvec4) Load 174(Q0) + 215: 173(ptr) AccessChain 202(vertex) 57 + Store 215 214 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.hlslOffset.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.hlslOffset.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.hlslOffset.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.hlslOffset.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -26,7 +26,7 @@ 0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform float m0, layout( row_major std140) uniform 3-component vector of float m4, layout( row_major std140) uniform float m16, layout( row_major std140 offset=20) uniform 3-component vector of float m20, layout( row_major std140 offset=36) uniform 3-component vector of float m36, layout( row_major std140 offset=56) uniform 2-component vector of float m56, layout( row_major std140) uniform float m64, layout( row_major std140) uniform 2-component vector of float m68, layout( row_major std140) uniform float m76, layout( row_major std140) uniform float m80, layout( row_major std140) uniform 1-element array of 2-component vector of float m96}) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 18 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.hull.1.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.hull.1.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.hull.1.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.hull.1.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -224,13 +224,13 @@ 0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 90 +// Generated by (magic number): 80006 +// Id's are bound by 89 Capability Tessellation 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint TessellationControl 4 "main" 40 44 48 66 72 + EntryPoint TessellationControl 4 "main" 40 44 48 65 71 ExecutionMode 4 OutputVertices 4 ExecutionMode 4 Isolines ExecutionMode 4 SpacingEqual @@ -255,17 +255,17 @@ Name 48 "@entryPointOutput" Name 50 "param" Name 52 "param" - Name 65 "@patchConstantResult" - Name 66 "pid" - Name 67 "param" - Name 72 "@patchConstantOutput.edges" - Name 82 "output" + Name 64 "@patchConstantResult" + Name 65 "pid" + Name 66 "param" + Name 71 "@patchConstantOutput.edges" + Name 81 "output" Decorate 40(ip) Location 0 Decorate 44(m_cpid) BuiltIn InvocationId Decorate 48(@entryPointOutput) Location 0 - Decorate 66(pid) BuiltIn PrimitiveId - Decorate 72(@patchConstantOutput.edges) Patch - Decorate 72(@patchConstantOutput.edges) BuiltIn TessLevelOuter + Decorate 65(pid) BuiltIn PrimitiveId + Decorate 71(@patchConstantOutput.edges) Patch + Decorate 71(@patchConstantOutput.edges) BuiltIn TessLevelOuter 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -294,27 +294,26 @@ 47: TypePointer Output 46 48(@entryPointOutput): 47(ptr) Variable Output 55: TypePointer Output 14(HS_OUT) - 57: 9(int) Constant 1 - 58: 9(int) Constant 0 - 60: TypeBool - 64: TypePointer Function 22(HS_CONSTANT_OUT) - 66(pid): 43(ptr) Variable Input - 70: TypeArray 6(float) 10 - 71: TypePointer Output 70 -72(@patchConstantOutput.edges): 71(ptr) Variable Output - 73: TypePointer Function 6(float) - 76: TypePointer Output 6(float) - 78: 29(int) Constant 1 - 83: 6(float) Constant 1073741824 - 85: 6(float) Constant 1090519040 + 57: 9(int) Constant 0 + 59: TypeBool + 63: TypePointer Function 22(HS_CONSTANT_OUT) + 65(pid): 43(ptr) Variable Input + 69: TypeArray 6(float) 10 + 70: TypePointer Output 69 +71(@patchConstantOutput.edges): 70(ptr) Variable Output + 72: TypePointer Function 6(float) + 75: TypePointer Output 6(float) + 77: 29(int) Constant 1 + 82: 6(float) Constant 1073741824 + 84: 6(float) Constant 1090519040 4(main): 2 Function None 3 5: Label 38(ip): 12(ptr) Variable Function 42(m_cpid): 13(ptr) Variable Function 50(param): 12(ptr) Variable Function 52(param): 13(ptr) Variable Function -65(@patchConstantResult): 64(ptr) Variable Function - 67(param): 13(ptr) Variable Function +64(@patchConstantResult): 63(ptr) Variable Function + 66(param): 13(ptr) Variable Function 41: 11 Load 40(ip) Store 38(ip) 41 45: 9(int) Load 44(m_cpid) @@ -327,26 +326,26 @@ 54: 14(HS_OUT) FunctionCall 18(@main(struct-VS_OUT-vf31[4];u1;) 50(param) 52(param) 56: 55(ptr) AccessChain 48(@entryPointOutput) 49 Store 56 54 - ControlBarrier 20 57 58 - 59: 9(int) Load 44(m_cpid) - 61: 60(bool) IEqual 59 30 - SelectionMerge 63 None - BranchConditional 61 62 63 - 62: Label - 68: 9(int) Load 66(pid) - Store 67(param) 68 - 69:22(HS_CONSTANT_OUT) FunctionCall 25(PCF(u1;) 67(param) - Store 65(@patchConstantResult) 69 - 74: 73(ptr) AccessChain 65(@patchConstantResult) 30 30 - 75: 6(float) Load 74 - 77: 76(ptr) AccessChain 72(@patchConstantOutput.edges) 30 - Store 77 75 - 79: 73(ptr) AccessChain 65(@patchConstantResult) 30 78 - 80: 6(float) Load 79 - 81: 76(ptr) AccessChain 72(@patchConstantOutput.edges) 78 - Store 81 80 - Branch 63 - 63: Label + ControlBarrier 20 10 57 + 58: 9(int) Load 44(m_cpid) + 60: 59(bool) IEqual 58 30 + SelectionMerge 62 None + BranchConditional 60 61 62 + 61: Label + 67: 9(int) Load 65(pid) + Store 66(param) 67 + 68:22(HS_CONSTANT_OUT) FunctionCall 25(PCF(u1;) 66(param) + Store 64(@patchConstantResult) 68 + 73: 72(ptr) AccessChain 64(@patchConstantResult) 30 30 + 74: 6(float) Load 73 + 76: 75(ptr) AccessChain 71(@patchConstantOutput.edges) 30 + Store 76 74 + 78: 72(ptr) AccessChain 64(@patchConstantResult) 30 77 + 79: 6(float) Load 78 + 80: 75(ptr) AccessChain 71(@patchConstantOutput.edges) 77 + Store 80 79 + Branch 62 + 62: Label Return FunctionEnd 18(@main(struct-VS_OUT-vf31[4];u1;): 14(HS_OUT) Function None 15 @@ -364,11 +363,11 @@ 25(PCF(u1;):22(HS_CONSTANT_OUT) Function None 23 24(pid): 13(ptr) FunctionParameter 26: Label - 82(output): 64(ptr) Variable Function - 84: 73(ptr) AccessChain 82(output) 30 30 - Store 84 83 - 86: 73(ptr) AccessChain 82(output) 30 78 - Store 86 85 - 87:22(HS_CONSTANT_OUT) Load 82(output) - ReturnValue 87 + 81(output): 63(ptr) Variable Function + 83: 72(ptr) AccessChain 81(output) 30 30 + Store 83 82 + 85: 72(ptr) AccessChain 81(output) 30 77 + Store 85 84 + 86:22(HS_CONSTANT_OUT) Load 81(output) + ReturnValue 86 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.hull.2.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.hull.2.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.hull.2.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.hull.2.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -220,13 +220,13 @@ 0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 92 +// Generated by (magic number): 80006 +// Id's are bound by 91 Capability Tessellation 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint TessellationControl 4 "main" 42 46 48 64 66 74 + EntryPoint TessellationControl 4 "main" 42 46 48 63 65 73 ExecutionMode 4 OutputVertices 4 ExecutionMode 4 Isolines ExecutionMode 4 SpacingEqual @@ -249,20 +249,20 @@ Name 46 "@entryPointOutput" Name 48 "InvocationId" Name 50 "param" - Name 63 "@patchConstantResult" - Name 64 "pid" - Name 66 "pos" - Name 67 "param" - Name 69 "param" - Name 74 "@patchConstantOutput.edges" - Name 84 "output" + Name 62 "@patchConstantResult" + Name 63 "pid" + Name 65 "pos" + Name 66 "param" + Name 68 "param" + Name 73 "@patchConstantOutput.edges" + Name 83 "output" Decorate 42(ip) Location 0 Decorate 46(@entryPointOutput) Location 0 Decorate 48(InvocationId) BuiltIn InvocationId - Decorate 64(pid) BuiltIn PrimitiveId - Decorate 66(pos) BuiltIn Position - Decorate 74(@patchConstantOutput.edges) Patch - Decorate 74(@patchConstantOutput.edges) BuiltIn TessLevelOuter + Decorate 63(pid) BuiltIn PrimitiveId + Decorate 65(pos) BuiltIn Position + Decorate 73(@patchConstantOutput.edges) Patch + Decorate 73(@patchConstantOutput.edges) BuiltIn TessLevelOuter 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -293,28 +293,27 @@ 47: TypePointer Input 9(int) 48(InvocationId): 47(ptr) Variable Input 53: TypePointer Output 13(HS_OUT) - 55: 9(int) Constant 1 - 56: 9(int) Constant 0 - 58: TypeBool - 62: TypePointer Function 23(HS_CONSTANT_OUT) - 64(pid): 47(ptr) Variable Input - 65: TypePointer Input 19(fvec4) - 66(pos): 65(ptr) Variable Input - 72: TypeArray 6(float) 10 - 73: TypePointer Output 72 -74(@patchConstantOutput.edges): 73(ptr) Variable Output - 75: TypePointer Function 6(float) - 78: TypePointer Output 6(float) - 80: 31(int) Constant 1 - 85: 6(float) Constant 1073741824 - 87: 6(float) Constant 1090519040 + 55: 9(int) Constant 0 + 57: TypeBool + 61: TypePointer Function 23(HS_CONSTANT_OUT) + 63(pid): 47(ptr) Variable Input + 64: TypePointer Input 19(fvec4) + 65(pos): 64(ptr) Variable Input + 71: TypeArray 6(float) 10 + 72: TypePointer Output 71 +73(@patchConstantOutput.edges): 72(ptr) Variable Output + 74: TypePointer Function 6(float) + 77: TypePointer Output 6(float) + 79: 31(int) Constant 1 + 84: 6(float) Constant 1073741824 + 86: 6(float) Constant 1090519040 4(main): 2 Function None 3 5: Label 40(ip): 12(ptr) Variable Function 50(param): 12(ptr) Variable Function -63(@patchConstantResult): 62(ptr) Variable Function - 67(param): 18(ptr) Variable Function - 69(param): 20(ptr) Variable Function +62(@patchConstantResult): 61(ptr) Variable Function + 66(param): 18(ptr) Variable Function + 68(param): 20(ptr) Variable Function 43: 11 Load 42(ip) Store 40(ip) 43 49: 9(int) Load 48(InvocationId) @@ -323,28 +322,28 @@ 52: 13(HS_OUT) FunctionCall 16(@main(struct-VS_OUT-vf31[4];) 50(param) 54: 53(ptr) AccessChain 46(@entryPointOutput) 49 Store 54 52 - ControlBarrier 21 55 56 - 57: 9(int) Load 48(InvocationId) - 59: 58(bool) IEqual 57 32 - SelectionMerge 61 None - BranchConditional 59 60 61 - 60: Label - 68: 9(int) Load 64(pid) - Store 67(param) 68 - 70: 19(fvec4) Load 66(pos) - Store 69(param) 70 - 71:23(HS_CONSTANT_OUT) FunctionCall 27(PCF(u1;vf4;) 67(param) 69(param) - Store 63(@patchConstantResult) 71 - 76: 75(ptr) AccessChain 63(@patchConstantResult) 32 32 - 77: 6(float) Load 76 - 79: 78(ptr) AccessChain 74(@patchConstantOutput.edges) 32 - Store 79 77 - 81: 75(ptr) AccessChain 63(@patchConstantResult) 32 80 - 82: 6(float) Load 81 - 83: 78(ptr) AccessChain 74(@patchConstantOutput.edges) 80 - Store 83 82 - Branch 61 - 61: Label + ControlBarrier 21 10 55 + 56: 9(int) Load 48(InvocationId) + 58: 57(bool) IEqual 56 32 + SelectionMerge 60 None + BranchConditional 58 59 60 + 59: Label + 67: 9(int) Load 63(pid) + Store 66(param) 67 + 69: 19(fvec4) Load 65(pos) + Store 68(param) 69 + 70:23(HS_CONSTANT_OUT) FunctionCall 27(PCF(u1;vf4;) 66(param) 68(param) + Store 62(@patchConstantResult) 70 + 75: 74(ptr) AccessChain 62(@patchConstantResult) 32 32 + 76: 6(float) Load 75 + 78: 77(ptr) AccessChain 73(@patchConstantOutput.edges) 32 + Store 78 76 + 80: 74(ptr) AccessChain 62(@patchConstantResult) 32 79 + 81: 6(float) Load 80 + 82: 77(ptr) AccessChain 73(@patchConstantOutput.edges) 79 + Store 82 81 + Branch 60 + 60: Label Return FunctionEnd 16(@main(struct-VS_OUT-vf31[4];): 13(HS_OUT) Function None 14 @@ -362,11 +361,11 @@ 25(pid): 18(ptr) FunctionParameter 26(pos): 20(ptr) FunctionParameter 28: Label - 84(output): 62(ptr) Variable Function - 86: 75(ptr) AccessChain 84(output) 32 32 - Store 86 85 - 88: 75(ptr) AccessChain 84(output) 32 80 - Store 88 87 - 89:23(HS_CONSTANT_OUT) Load 84(output) - ReturnValue 89 + 83(output): 61(ptr) Variable Function + 85: 74(ptr) AccessChain 83(output) 32 32 + Store 85 84 + 87: 74(ptr) AccessChain 83(output) 32 79 + Store 87 86 + 88:23(HS_CONSTANT_OUT) Load 83(output) + ReturnValue 88 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.hull.3.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.hull.3.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.hull.3.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.hull.3.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -220,13 +220,13 @@ 0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 92 +// Generated by (magic number): 80006 +// Id's are bound by 91 Capability Tessellation 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint TessellationControl 4 "main" 42 46 48 64 66 74 + EntryPoint TessellationControl 4 "main" 42 46 48 63 65 73 ExecutionMode 4 OutputVertices 4 ExecutionMode 4 Triangles ExecutionMode 4 SpacingEqual @@ -250,20 +250,20 @@ Name 46 "@entryPointOutput" Name 48 "InvocationId" Name 50 "param" - Name 63 "@patchConstantResult" - Name 64 "pid" - Name 66 "pos" - Name 67 "param" - Name 69 "param" - Name 74 "@patchConstantOutput.edges" - Name 84 "output" + Name 62 "@patchConstantResult" + Name 63 "pid" + Name 65 "pos" + Name 66 "param" + Name 68 "param" + Name 73 "@patchConstantOutput.edges" + Name 83 "output" Decorate 42(ip) Location 0 Decorate 46(@entryPointOutput) Location 0 Decorate 48(InvocationId) BuiltIn InvocationId - Decorate 64(pid) BuiltIn PrimitiveId - Decorate 66(pos) BuiltIn Position - Decorate 74(@patchConstantOutput.edges) Patch - Decorate 74(@patchConstantOutput.edges) BuiltIn TessLevelOuter + Decorate 63(pid) BuiltIn PrimitiveId + Decorate 65(pos) BuiltIn Position + Decorate 73(@patchConstantOutput.edges) Patch + Decorate 73(@patchConstantOutput.edges) BuiltIn TessLevelOuter 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -294,28 +294,27 @@ 47: TypePointer Input 9(int) 48(InvocationId): 47(ptr) Variable Input 53: TypePointer Output 13(HS_OUT) - 55: 9(int) Constant 1 - 56: 9(int) Constant 0 - 58: TypeBool - 62: TypePointer Function 23(HS_CONSTANT_OUT) - 64(pid): 47(ptr) Variable Input - 65: TypePointer Input 19(fvec4) - 66(pos): 65(ptr) Variable Input - 72: TypeArray 6(float) 10 - 73: TypePointer Output 72 -74(@patchConstantOutput.edges): 73(ptr) Variable Output - 75: TypePointer Function 6(float) - 78: TypePointer Output 6(float) - 80: 31(int) Constant 1 - 85: 6(float) Constant 1073741824 - 87: 6(float) Constant 1090519040 + 55: 9(int) Constant 0 + 57: TypeBool + 61: TypePointer Function 23(HS_CONSTANT_OUT) + 63(pid): 47(ptr) Variable Input + 64: TypePointer Input 19(fvec4) + 65(pos): 64(ptr) Variable Input + 71: TypeArray 6(float) 10 + 72: TypePointer Output 71 +73(@patchConstantOutput.edges): 72(ptr) Variable Output + 74: TypePointer Function 6(float) + 77: TypePointer Output 6(float) + 79: 31(int) Constant 1 + 84: 6(float) Constant 1073741824 + 86: 6(float) Constant 1090519040 4(main): 2 Function None 3 5: Label 40(ip): 12(ptr) Variable Function 50(param): 12(ptr) Variable Function -63(@patchConstantResult): 62(ptr) Variable Function - 67(param): 18(ptr) Variable Function - 69(param): 20(ptr) Variable Function +62(@patchConstantResult): 61(ptr) Variable Function + 66(param): 18(ptr) Variable Function + 68(param): 20(ptr) Variable Function 43: 11 Load 42(ip) Store 40(ip) 43 49: 9(int) Load 48(InvocationId) @@ -324,28 +323,28 @@ 52: 13(HS_OUT) FunctionCall 16(@main(struct-VS_OUT-vf31[4];) 50(param) 54: 53(ptr) AccessChain 46(@entryPointOutput) 49 Store 54 52 - ControlBarrier 21 55 56 - 57: 9(int) Load 48(InvocationId) - 59: 58(bool) IEqual 57 32 - SelectionMerge 61 None - BranchConditional 59 60 61 - 60: Label - 68: 9(int) Load 64(pid) - Store 67(param) 68 - 70: 19(fvec4) Load 66(pos) - Store 69(param) 70 - 71:23(HS_CONSTANT_OUT) FunctionCall 27(PCF(u1;vf4;) 67(param) 69(param) - Store 63(@patchConstantResult) 71 - 76: 75(ptr) AccessChain 63(@patchConstantResult) 32 32 - 77: 6(float) Load 76 - 79: 78(ptr) AccessChain 74(@patchConstantOutput.edges) 32 - Store 79 77 - 81: 75(ptr) AccessChain 63(@patchConstantResult) 32 80 - 82: 6(float) Load 81 - 83: 78(ptr) AccessChain 74(@patchConstantOutput.edges) 80 - Store 83 82 - Branch 61 - 61: Label + ControlBarrier 21 10 55 + 56: 9(int) Load 48(InvocationId) + 58: 57(bool) IEqual 56 32 + SelectionMerge 60 None + BranchConditional 58 59 60 + 59: Label + 67: 9(int) Load 63(pid) + Store 66(param) 67 + 69: 19(fvec4) Load 65(pos) + Store 68(param) 69 + 70:23(HS_CONSTANT_OUT) FunctionCall 27(PCF(u1;vf4;) 66(param) 68(param) + Store 62(@patchConstantResult) 70 + 75: 74(ptr) AccessChain 62(@patchConstantResult) 32 32 + 76: 6(float) Load 75 + 78: 77(ptr) AccessChain 73(@patchConstantOutput.edges) 32 + Store 78 76 + 80: 74(ptr) AccessChain 62(@patchConstantResult) 32 79 + 81: 6(float) Load 80 + 82: 77(ptr) AccessChain 73(@patchConstantOutput.edges) 79 + Store 82 81 + Branch 60 + 60: Label Return FunctionEnd 16(@main(struct-VS_OUT-vf31[4];): 13(HS_OUT) Function None 14 @@ -363,11 +362,11 @@ 25(pid): 18(ptr) FunctionParameter 26(pos): 20(ptr) FunctionParameter 28: Label - 84(output): 62(ptr) Variable Function - 86: 75(ptr) AccessChain 84(output) 32 32 - Store 86 85 - 88: 75(ptr) AccessChain 84(output) 32 80 - Store 88 87 - 89:23(HS_CONSTANT_OUT) Load 84(output) - ReturnValue 89 + 83(output): 61(ptr) Variable Function + 85: 74(ptr) AccessChain 83(output) 32 32 + Store 85 84 + 87: 74(ptr) AccessChain 83(output) 32 79 + Store 87 86 + 88:23(HS_CONSTANT_OUT) Load 83(output) + ReturnValue 88 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.hull.4.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.hull.4.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.hull.4.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.hull.4.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -159,10 +159,9 @@ 0:? 'cpid' ( in uint InvocationID) 0:39 Sequence 0:39 move second child to first child ( temp 4-component vector of float) -0:39 direct index ( out 4-component vector of float Position) +0:39 indirect index ( out 4-component vector of float Position) 0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position) -0:39 Constant: -0:39 0 (const int) +0:? 'cpid' ( in uint InvocationID) 0:39 m_Position: direct index for structure ( temp 4-component vector of float) 0:39 Function Call: @main(struct-HS_Input-vf4-vf41[3];u1; ( temp structure{ temp 4-component vector of float m_Position}) 0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) @@ -400,10 +399,9 @@ 0:? 'cpid' ( in uint InvocationID) 0:39 Sequence 0:39 move second child to first child ( temp 4-component vector of float) -0:39 direct index ( out 4-component vector of float Position) +0:39 indirect index ( out 4-component vector of float Position) 0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position) -0:39 Constant: -0:39 0 (const int) +0:? 'cpid' ( in uint InvocationID) 0:39 m_Position: direct index for structure ( temp 4-component vector of float) 0:39 Function Call: @main(struct-HS_Input-vf4-vf41[3];u1; ( temp structure{ temp 4-component vector of float m_Position}) 0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) @@ -478,7 +476,7 @@ 0:? '@patchConstantOutput.fInsideTessFactor' ( patch out 2-element array of float TessLevelInner) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 127 Capability Tessellation @@ -514,10 +512,10 @@ Name 81 "cpid" Name 83 "cpid" Name 86 "@entryPointOutput.m_Position" - Name 87 "param" - Name 89 "param" - Name 103 "@patchConstantResult" - Name 104 "param" + Name 88 "param" + Name 90 "param" + Name 104 "@patchConstantResult" + Name 105 "param" Name 110 "@patchConstantOutput.fTessFactor" Name 123 "@patchConstantOutput.fInsideTessFactor" Decorate 56(I.m_Position) BuiltIn Position @@ -568,27 +566,26 @@ 83(cpid): 82(ptr) Variable Input 85: TypePointer Output 54 86(@entryPointOutput.m_Position): 85(ptr) Variable Output - 93: TypePointer Output 7(fvec4) - 95: 9(int) Constant 2 - 96: 9(int) Constant 1 - 97: 9(int) Constant 0 - 99: TypeBool - 107: 9(int) Constant 4 - 108: TypeArray 6(float) 107 + 94: TypePointer Output 7(fvec4) + 96: 9(int) Constant 2 + 97: 9(int) Constant 4 + 98: 9(int) Constant 0 + 100: TypeBool + 108: TypeArray 6(float) 97 109: TypePointer Output 108 110(@patchConstantOutput.fTessFactor): 109(ptr) Variable Output 113: TypePointer Output 6(float) - 121: TypeArray 6(float) 95 + 121: TypeArray 6(float) 96 122: TypePointer Output 121 123(@patchConstantOutput.fInsideTessFactor): 122(ptr) Variable Output 4(main): 2 Function None 3 5: Label 53(I): 12(ptr) Variable Function 81(cpid): 19(ptr) Variable Function - 87(param): 12(ptr) Variable Function - 89(param): 19(ptr) Variable Function -103(@patchConstantResult): 26(ptr) Variable Function - 104(param): 12(ptr) Variable Function + 88(param): 12(ptr) Variable Function + 90(param): 19(ptr) Variable Function +104(@patchConstantResult): 26(ptr) Variable Function + 105(param): 12(ptr) Variable Function 58: 57(ptr) AccessChain 56(I.m_Position) 33 59: 7(fvec4) Load 58 60: 48(ptr) AccessChain 53(I) 33 33 @@ -615,42 +612,43 @@ Store 80 79 84: 9(int) Load 83(cpid) Store 81(cpid) 84 - 88: 11 Load 53(I) - Store 87(param) 88 - 90: 9(int) Load 81(cpid) - Store 89(param) 90 - 91:20(HS_Main_Output) FunctionCall 24(@main(struct-HS_Input-vf4-vf41[3];u1;) 87(param) 89(param) - 92: 7(fvec4) CompositeExtract 91 0 - 94: 93(ptr) AccessChain 86(@entryPointOutput.m_Position) 33 - Store 94 92 - ControlBarrier 95 96 97 - 98: 9(int) Load 83(cpid) - 100: 99(bool) IEqual 98 33 - SelectionMerge 102 None - BranchConditional 100 101 102 - 101: Label - 105: 11 Load 53(I) - Store 104(param) 105 - 106:14(HS_Output) FunctionCall 17(HS_ConstFunc(struct-HS_Input-vf4-vf41[3];) 104(param) - Store 103(@patchConstantResult) 106 - 111: 34(ptr) AccessChain 103(@patchConstantResult) 33 33 + 87: 9(int) Load 83(cpid) + 89: 11 Load 53(I) + Store 88(param) 89 + 91: 9(int) Load 81(cpid) + Store 90(param) 91 + 92:20(HS_Main_Output) FunctionCall 24(@main(struct-HS_Input-vf4-vf41[3];u1;) 88(param) 90(param) + 93: 7(fvec4) CompositeExtract 92 0 + 95: 94(ptr) AccessChain 86(@entryPointOutput.m_Position) 87 + Store 95 93 + ControlBarrier 96 97 98 + 99: 9(int) Load 83(cpid) + 101: 100(bool) IEqual 99 33 + SelectionMerge 103 None + BranchConditional 101 102 103 + 102: Label + 106: 11 Load 53(I) + Store 105(param) 106 + 107:14(HS_Output) FunctionCall 17(HS_ConstFunc(struct-HS_Input-vf4-vf41[3];) 105(param) + Store 104(@patchConstantResult) 107 + 111: 34(ptr) AccessChain 104(@patchConstantResult) 33 33 112: 6(float) Load 111 114: 113(ptr) AccessChain 110(@patchConstantOutput.fTessFactor) 33 Store 114 112 - 115: 34(ptr) AccessChain 103(@patchConstantResult) 33 32 + 115: 34(ptr) AccessChain 104(@patchConstantResult) 33 32 116: 6(float) Load 115 117: 113(ptr) AccessChain 110(@patchConstantOutput.fTessFactor) 32 Store 117 116 - 118: 34(ptr) AccessChain 103(@patchConstantResult) 33 74 + 118: 34(ptr) AccessChain 104(@patchConstantResult) 33 74 119: 6(float) Load 118 120: 113(ptr) AccessChain 110(@patchConstantOutput.fTessFactor) 74 Store 120 119 - 124: 34(ptr) AccessChain 103(@patchConstantResult) 32 + 124: 34(ptr) AccessChain 104(@patchConstantResult) 32 125: 6(float) Load 124 126: 113(ptr) AccessChain 123(@patchConstantOutput.fInsideTessFactor) 33 Store 126 125 - Branch 102 - 102: Label + Branch 103 + 103: Label Return FunctionEnd 17(HS_ConstFunc(struct-HS_Input-vf4-vf41[3];):14(HS_Output) Function None 15 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.hull.5.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.hull.5.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.hull.5.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.hull.5.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -80,10 +80,9 @@ 0:? 'cpid' ( in uint InvocationID) 0:39 Sequence 0:39 move second child to first child ( temp 4-component vector of float) -0:39 direct index ( out 4-component vector of float Position) +0:39 indirect index ( out 4-component vector of float Position) 0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position) -0:39 Constant: -0:39 0 (const int) +0:? 'cpid' ( in uint InvocationID) 0:39 m_Position: direct index for structure ( temp 4-component vector of float) 0:39 Function Call: @main(u1; ( temp structure{ temp 4-component vector of float m_Position}) 0:? 'cpid' ( temp uint) @@ -174,10 +173,9 @@ 0:? 'cpid' ( in uint InvocationID) 0:39 Sequence 0:39 move second child to first child ( temp 4-component vector of float) -0:39 direct index ( out 4-component vector of float Position) +0:39 indirect index ( out 4-component vector of float Position) 0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position) -0:39 Constant: -0:39 0 (const int) +0:? 'cpid' ( in uint InvocationID) 0:39 m_Position: direct index for structure ( temp 4-component vector of float) 0:39 Function Call: @main(u1; ( temp structure{ temp 4-component vector of float m_Position}) 0:? 'cpid' ( temp uint) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.hull.ctrlpt-1.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.hull.ctrlpt-1.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.hull.ctrlpt-1.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.hull.ctrlpt-1.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -396,7 +396,7 @@ 0:? '@patchConstantOutput.flInFactor' ( patch out 2-element array of float TessLevelInner) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 124 Capability Tessellation @@ -434,12 +434,12 @@ Name 68 "param" Name 70 "param" Name 74 "i" - Name 75 "param" - Name 77 "param" - Name 81 "i" - Name 82 "param" - Name 84 "param" - Name 88 "@patchConstantResult" + Name 76 "param" + Name 78 "param" + Name 82 "i" + Name 83 "param" + Name 85 "param" + Name 89 "@patchConstantResult" Name 94 "@patchConstantOutput.tfactor" Name 108 "@patchConstantOutput.flInFactor" Name 112 "o" @@ -478,15 +478,15 @@ 48(@entryPointOutput): 47(ptr) Variable Output 55: TypePointer Output 14(hs_out_t) 57: 9(int) Constant 2 - 58: 9(int) Constant 1 + 58: 9(int) Constant 4 59: 9(int) Constant 0 61: TypeBool 65: TypePointer Function 20 73: 29(int) Constant 1 - 80: 29(int) Constant 2 - 87: TypePointer Function 22(hs_pcf_t) - 91: 9(int) Constant 4 - 92: TypeArray 6(float) 91 + 75: 9(int) Constant 1 + 81: 29(int) Constant 2 + 88: TypePointer Function 22(hs_pcf_t) + 92: TypeArray 6(float) 58 93: TypePointer Output 92 94(@patchConstantOutput.tfactor): 93(ptr) Variable Output 95: TypePointer Function 6(float) @@ -506,12 +506,12 @@ 68(param): 12(ptr) Variable Function 70(param): 13(ptr) Variable Function 74(i): 12(ptr) Variable Function - 75(param): 12(ptr) Variable Function - 77(param): 13(ptr) Variable Function - 81(i): 12(ptr) Variable Function - 82(param): 12(ptr) Variable Function - 84(param): 13(ptr) Variable Function -88(@patchConstantResult): 87(ptr) Variable Function + 76(param): 12(ptr) Variable Function + 78(param): 13(ptr) Variable Function + 82(i): 12(ptr) Variable Function + 83(param): 12(ptr) Variable Function + 85(param): 13(ptr) Variable Function +89(@patchConstantResult): 88(ptr) Variable Function 42: 11 Load 41(i) Store 39(i) 42 46: 9(int) Load 45(cpid) @@ -536,34 +536,34 @@ 71:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 68(param) 70(param) 72: 27(ptr) AccessChain 66(pcf_out) 30 Store 72 71 - 76: 11 Load 74(i) - Store 75(param) 76 - Store 77(param) 58 - 78:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 75(param) 77(param) - 79: 27(ptr) AccessChain 66(pcf_out) 73 - Store 79 78 - 83: 11 Load 81(i) - Store 82(param) 83 - Store 84(param) 57 - 85:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 82(param) 84(param) - 86: 27(ptr) AccessChain 66(pcf_out) 80 - Store 86 85 - 89: 20 Load 66(pcf_out) - 90:22(hs_pcf_t) FunctionCall 25(PCF(struct-hs_out_t-vf31[3];) 89 - Store 88(@patchConstantResult) 90 - 96: 95(ptr) AccessChain 88(@patchConstantResult) 30 30 + 77: 11 Load 74(i) + Store 76(param) 77 + Store 78(param) 75 + 79:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 76(param) 78(param) + 80: 27(ptr) AccessChain 66(pcf_out) 73 + Store 80 79 + 84: 11 Load 82(i) + Store 83(param) 84 + Store 85(param) 57 + 86:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 83(param) 85(param) + 87: 27(ptr) AccessChain 66(pcf_out) 81 + Store 87 86 + 90: 20 Load 66(pcf_out) + 91:22(hs_pcf_t) FunctionCall 25(PCF(struct-hs_out_t-vf31[3];) 90 + Store 89(@patchConstantResult) 91 + 96: 95(ptr) AccessChain 89(@patchConstantResult) 30 30 97: 6(float) Load 96 99: 98(ptr) AccessChain 94(@patchConstantOutput.tfactor) 30 Store 99 97 - 100: 95(ptr) AccessChain 88(@patchConstantResult) 30 73 + 100: 95(ptr) AccessChain 89(@patchConstantResult) 30 73 101: 6(float) Load 100 102: 98(ptr) AccessChain 94(@patchConstantOutput.tfactor) 73 Store 102 101 - 103: 95(ptr) AccessChain 88(@patchConstantResult) 30 80 + 103: 95(ptr) AccessChain 89(@patchConstantResult) 30 81 104: 6(float) Load 103 - 105: 98(ptr) AccessChain 94(@patchConstantOutput.tfactor) 80 + 105: 98(ptr) AccessChain 94(@patchConstantOutput.tfactor) 81 Store 105 104 - 109: 95(ptr) AccessChain 88(@patchConstantResult) 73 + 109: 95(ptr) AccessChain 89(@patchConstantResult) 73 110: 6(float) Load 109 111: 98(ptr) AccessChain 108(@patchConstantOutput.flInFactor) 30 Store 111 110 @@ -587,7 +587,7 @@ 25(PCF(struct-hs_out_t-vf31[3];):22(hs_pcf_t) Function None 23 24(pcf_out): 20 FunctionParameter 26: Label - 112(o): 87(ptr) Variable Function + 112(o): 88(ptr) Variable Function 113: 6(float) CompositeExtract 24(pcf_out) 0 0 0 114: 95(ptr) AccessChain 112(o) 30 30 Store 114 113 @@ -595,7 +595,7 @@ 116: 95(ptr) AccessChain 112(o) 30 73 Store 116 115 117: 6(float) CompositeExtract 24(pcf_out) 2 0 0 - 118: 95(ptr) AccessChain 112(o) 30 80 + 118: 95(ptr) AccessChain 112(o) 30 81 Store 118 117 120: 95(ptr) AccessChain 112(o) 73 Store 120 119 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.hull.ctrlpt-2.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.hull.ctrlpt-2.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.hull.ctrlpt-2.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.hull.ctrlpt-2.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -414,7 +414,7 @@ 0:? '@patchConstantOutput.flInFactor' ( patch out 2-element array of float TessLevelInner) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 126 Capability Tessellation @@ -453,12 +453,12 @@ Name 69 "param" Name 71 "param" Name 75 "i" - Name 76 "param" - Name 78 "param" - Name 82 "i" - Name 83 "param" - Name 85 "param" - Name 89 "@patchConstantResult" + Name 77 "param" + Name 79 "param" + Name 83 "i" + Name 84 "param" + Name 86 "param" + Name 90 "@patchConstantResult" Name 96 "@patchConstantOutput.tfactor" Name 110 "@patchConstantOutput.flInFactor" Name 114 "o" @@ -497,15 +497,15 @@ 49(@entryPointOutput): 48(ptr) Variable Output 56: TypePointer Output 14(hs_out_t) 58: 9(int) Constant 2 - 59: 9(int) Constant 1 + 59: 9(int) Constant 4 60: 9(int) Constant 0 62: TypeBool 66: TypePointer Function 20 74: 28(int) Constant 1 - 81: 28(int) Constant 2 - 88: TypePointer Function 22(hs_pcf_t) - 93: 9(int) Constant 4 - 94: TypeArray 6(float) 93 + 76: 9(int) Constant 1 + 82: 28(int) Constant 2 + 89: TypePointer Function 22(hs_pcf_t) + 94: TypeArray 6(float) 59 95: TypePointer Output 94 96(@patchConstantOutput.tfactor): 95(ptr) Variable Output 97: TypePointer Function 6(float) @@ -525,12 +525,12 @@ 69(param): 12(ptr) Variable Function 71(param): 13(ptr) Variable Function 75(i): 12(ptr) Variable Function - 76(param): 12(ptr) Variable Function - 78(param): 13(ptr) Variable Function - 82(i): 12(ptr) Variable Function - 83(param): 12(ptr) Variable Function - 85(param): 13(ptr) Variable Function -89(@patchConstantResult): 88(ptr) Variable Function + 77(param): 12(ptr) Variable Function + 79(param): 13(ptr) Variable Function + 83(i): 12(ptr) Variable Function + 84(param): 12(ptr) Variable Function + 86(param): 13(ptr) Variable Function +90(@patchConstantResult): 89(ptr) Variable Function 43: 11 Load 42(i) Store 40(i) 43 47: 9(int) Load 46(cpid) @@ -555,35 +555,35 @@ 72:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 69(param) 71(param) 73: 30(ptr) AccessChain 67(pcf_out) 29 Store 73 72 - 77: 11 Load 75(i) - Store 76(param) 77 - Store 78(param) 59 - 79:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 76(param) 78(param) - 80: 30(ptr) AccessChain 67(pcf_out) 74 - Store 80 79 - 84: 11 Load 82(i) - Store 83(param) 84 - Store 85(param) 58 - 86:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 83(param) 85(param) - 87: 30(ptr) AccessChain 67(pcf_out) 81 - Store 87 86 - 90: 20 Load 67(pcf_out) - 91: 11 Load 40(i) - 92:22(hs_pcf_t) FunctionCall 26(PCF(struct-hs_out_t-vf31[3];struct-hs_in_t-vf31[3];) 90 91 - Store 89(@patchConstantResult) 92 - 98: 97(ptr) AccessChain 89(@patchConstantResult) 29 29 + 78: 11 Load 75(i) + Store 77(param) 78 + Store 79(param) 76 + 80:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 77(param) 79(param) + 81: 30(ptr) AccessChain 67(pcf_out) 74 + Store 81 80 + 85: 11 Load 83(i) + Store 84(param) 85 + Store 86(param) 58 + 87:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 84(param) 86(param) + 88: 30(ptr) AccessChain 67(pcf_out) 82 + Store 88 87 + 91: 20 Load 67(pcf_out) + 92: 11 Load 40(i) + 93:22(hs_pcf_t) FunctionCall 26(PCF(struct-hs_out_t-vf31[3];struct-hs_in_t-vf31[3];) 91 92 + Store 90(@patchConstantResult) 93 + 98: 97(ptr) AccessChain 90(@patchConstantResult) 29 29 99: 6(float) Load 98 101: 100(ptr) AccessChain 96(@patchConstantOutput.tfactor) 29 Store 101 99 - 102: 97(ptr) AccessChain 89(@patchConstantResult) 29 74 + 102: 97(ptr) AccessChain 90(@patchConstantResult) 29 74 103: 6(float) Load 102 104: 100(ptr) AccessChain 96(@patchConstantOutput.tfactor) 74 Store 104 103 - 105: 97(ptr) AccessChain 89(@patchConstantResult) 29 81 + 105: 97(ptr) AccessChain 90(@patchConstantResult) 29 82 106: 6(float) Load 105 - 107: 100(ptr) AccessChain 96(@patchConstantOutput.tfactor) 81 + 107: 100(ptr) AccessChain 96(@patchConstantOutput.tfactor) 82 Store 107 106 - 111: 97(ptr) AccessChain 89(@patchConstantResult) 74 + 111: 97(ptr) AccessChain 90(@patchConstantResult) 74 112: 6(float) Load 111 113: 100(ptr) AccessChain 110(@patchConstantOutput.flInFactor) 29 Store 113 112 @@ -608,7 +608,7 @@ 24(pcf_out): 20 FunctionParameter 25(pcf_in): 11 FunctionParameter 27: Label - 114(o): 88(ptr) Variable Function + 114(o): 89(ptr) Variable Function 115: 6(float) CompositeExtract 24(pcf_out) 0 0 0 116: 97(ptr) AccessChain 114(o) 29 29 Store 116 115 @@ -616,7 +616,7 @@ 118: 97(ptr) AccessChain 114(o) 29 74 Store 118 117 119: 6(float) CompositeExtract 24(pcf_out) 2 0 0 - 120: 97(ptr) AccessChain 114(o) 29 81 + 120: 97(ptr) AccessChain 114(o) 29 82 Store 120 119 122: 97(ptr) AccessChain 114(o) 74 Store 122 121 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.hull.void.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.hull.void.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.hull.void.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.hull.void.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -108,7 +108,7 @@ 0:? 'InvocationId' ( in uint InvocationID) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 55 Capability Tessellation @@ -161,7 +161,7 @@ 39(InvocationId): 38(ptr) Variable Input 44: TypePointer Output 13(HS_OUT) 46: 9(int) Constant 2 - 47: 9(int) Constant 1 + 47: 9(int) Constant 4 48: 9(int) Constant 0 50: TypeBool 4(main): 2 Function None 3 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.identifier.sample.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.identifier.sample.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.identifier.sample.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.identifier.sample.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -86,7 +86,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 33 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.if.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.if.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.if.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.if.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -42,7 +42,7 @@ 0:14 'input' ( in 4-component vector of float) 0:14 'input' ( in 4-component vector of float) 0:14 true case is null -0:19 Test condition and select ( temp void) +0:19 Test condition and select ( temp void): Flatten 0:19 Condition 0:19 all ( temp bool) 0:19 Equal ( temp 4-component vector of bool) @@ -152,7 +152,7 @@ 0:14 'input' ( in 4-component vector of float) 0:14 'input' ( in 4-component vector of float) 0:14 true case is null -0:19 Test condition and select ( temp void) +0:19 Test condition and select ( temp void): Flatten 0:19 Condition 0:19 all ( temp bool) 0:19 Equal ( temp 4-component vector of bool) @@ -216,7 +216,7 @@ 0:? 'input' (layout( location=0) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 103 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.imagefetch-subvec4.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.imagefetch-subvec4.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.imagefetch-subvec4.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.imagefetch-subvec4.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,142 @@ +hlsl.imagefetch-subvec4.comp +Shader version: 500 +local_size = (8, 8, 8) +0:? Sequence +0:6 Function Definition: @main(vu3; ( temp void) +0:6 Function Parameters: +0:6 'tid' ( in 3-component vector of uint) +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp uint) +0:7 'storeTemp' ( temp uint) +0:7 Convert int to uint ( temp uint) +0:7 textureFetch ( temp int) +0:7 'IN' (layout( binding=0) uniform itexture3D) +0:7 'tid' ( in 3-component vector of uint) +0:7 Constant: +0:7 0 (const int) +0:7 imageStore ( temp void) +0:7 'OUT' (layout( binding=1 r32ui) uniform uimage3D) +0:7 'tid' ( in 3-component vector of uint) +0:7 'storeTemp' ( temp uint) +0:7 'storeTemp' ( temp uint) +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 move second child to first child ( temp 3-component vector of uint) +0:? 'tid' ( temp 3-component vector of uint) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) +0:6 Function Call: @main(vu3; ( temp void) +0:? 'tid' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'IN' (layout( binding=0) uniform itexture3D) +0:? 'OUT' (layout( binding=1 r32ui) uniform uimage3D) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (8, 8, 8) +0:? Sequence +0:6 Function Definition: @main(vu3; ( temp void) +0:6 Function Parameters: +0:6 'tid' ( in 3-component vector of uint) +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp uint) +0:7 'storeTemp' ( temp uint) +0:7 Convert int to uint ( temp uint) +0:7 textureFetch ( temp int) +0:7 'IN' (layout( binding=0) uniform itexture3D) +0:7 'tid' ( in 3-component vector of uint) +0:7 Constant: +0:7 0 (const int) +0:7 imageStore ( temp void) +0:7 'OUT' (layout( binding=1 r32ui) uniform uimage3D) +0:7 'tid' ( in 3-component vector of uint) +0:7 'storeTemp' ( temp uint) +0:7 'storeTemp' ( temp uint) +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 move second child to first child ( temp 3-component vector of uint) +0:? 'tid' ( temp 3-component vector of uint) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) +0:6 Function Call: @main(vu3; ( temp void) +0:? 'tid' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'IN' (layout( binding=0) uniform itexture3D) +0:? 'OUT' (layout( binding=1 r32ui) uniform uimage3D) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 39 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 34 + ExecutionMode 4 LocalSize 8 8 8 + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vu3;" + Name 10 "tid" + Name 14 "storeTemp" + Name 18 "IN" + Name 28 "OUT" + Name 32 "tid" + Name 34 "tid" + Name 36 "param" + Decorate 18(IN) DescriptorSet 0 + Decorate 18(IN) Binding 0 + Decorate 28(OUT) DescriptorSet 0 + Decorate 28(OUT) Binding 1 + Decorate 34(tid) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 13: TypePointer Function 6(int) + 15: TypeInt 32 1 + 16: TypeImage 15(int) 3D sampled format:Unknown + 17: TypePointer UniformConstant 16 + 18(IN): 17(ptr) Variable UniformConstant + 21: 15(int) Constant 0 + 22: TypeVector 15(int) 4 + 26: TypeImage 6(int) 3D nonsampled format:R32ui + 27: TypePointer UniformConstant 26 + 28(OUT): 27(ptr) Variable UniformConstant + 33: TypePointer Input 7(ivec3) + 34(tid): 33(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 32(tid): 8(ptr) Variable Function + 36(param): 8(ptr) Variable Function + 35: 7(ivec3) Load 34(tid) + Store 32(tid) 35 + 37: 7(ivec3) Load 32(tid) + Store 36(param) 37 + 38: 2 FunctionCall 11(@main(vu3;) 36(param) + Return + FunctionEnd + 11(@main(vu3;): 2 Function None 9 + 10(tid): 8(ptr) FunctionParameter + 12: Label + 14(storeTemp): 13(ptr) Variable Function + 19: 16 Load 18(IN) + 20: 7(ivec3) Load 10(tid) + 23: 22(ivec4) ImageFetch 19 20 Lod 21 + 24: 15(int) CompositeExtract 23 0 + 25: 6(int) Bitcast 24 + Store 14(storeTemp) 25 + 29: 26 Load 28(OUT) + 30: 7(ivec3) Load 10(tid) + 31: 6(int) Load 14(storeTemp) + ImageWrite 29 30 31 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.implicitBool.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.implicitBool.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.implicitBool.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.implicitBool.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -74,12 +74,11 @@ 0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) 0:17 Constant: 0:17 1 (const uint) -0:17 Convert int to bool ( temp bool) -0:17 Convert float to int ( temp int) -0:17 condf: direct index for structure ( uniform float) -0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) -0:17 Constant: -0:17 0 (const uint) +0:17 Convert float to bool ( temp bool) +0:17 condf: direct index for structure ( uniform float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:17 Constant: +0:17 0 (const uint) 0:17 Convert float to bool ( temp bool) 0:17 condf1: direct index for structure ( uniform 1-component vector of float) 0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) @@ -133,7 +132,7 @@ 0:28 Sequence 0:28 move second child to first child ( temp float) 0:28 'g' ( temp float) -0:28 Test condition and select ( temp float) +0:28 Test condition and select ( temp float): no shortcircuit 0:28 Condition 0:28 Convert float to bool ( temp bool) 0:28 condf: direct index for structure ( uniform float) @@ -243,12 +242,11 @@ 0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) 0:17 Constant: 0:17 1 (const uint) -0:17 Convert int to bool ( temp bool) -0:17 Convert float to int ( temp int) -0:17 condf: direct index for structure ( uniform float) -0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) -0:17 Constant: -0:17 0 (const uint) +0:17 Convert float to bool ( temp bool) +0:17 condf: direct index for structure ( uniform float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:17 Constant: +0:17 0 (const uint) 0:17 Convert float to bool ( temp bool) 0:17 condf1: direct index for structure ( uniform 1-component vector of float) 0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) @@ -302,7 +300,7 @@ 0:28 Sequence 0:28 move second child to first child ( temp float) 0:28 'g' ( temp float) -0:28 Test condition and select ( temp float) +0:28 Test condition and select ( temp float): no shortcircuit 0:28 Condition 0:28 Convert float to bool ( temp bool) 0:28 condf: direct index for structure ( uniform float) @@ -334,13 +332,13 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 140 +// Generated by (magic number): 80006 +// Id's are bound by 139 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 138 + EntryPoint Fragment 4 "main" 137 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" @@ -352,17 +350,17 @@ MemberName 16($Global) 2 "condf1" MemberName 16($Global) 3 "condi1" Name 18 "" - Name 88 "f" - Name 101 "i" - Name 121 "g" - Name 138 "@entryPointOutput" + Name 87 "f" + Name 100 "i" + Name 120 "g" + Name 137 "@entryPointOutput" MemberDecorate 16($Global) 0 Offset 0 MemberDecorate 16($Global) 1 Offset 4 - MemberDecorate 16($Global) 2 Offset 16 - MemberDecorate 16($Global) 3 Offset 32 + MemberDecorate 16($Global) 2 Offset 8 + MemberDecorate 16($Global) 3 Offset 12 Decorate 16($Global) Block Decorate 18 DescriptorSet 0 - Decorate 138(@entryPointOutput) Location 0 + Decorate 137(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -388,25 +386,25 @@ 53: 6(float) Constant 1077936128 57: 15(int) Constant 3 64: 6(float) Constant 1082130432 - 83: 6(float) Constant 1084227584 - 87: TypePointer Function 6(float) - 100: TypePointer Function 15(int) - 125: 6(float) Constant 1088421888 - 126: 6(float) Constant 1090519040 - 137: TypePointer Output 7(fvec4) -138(@entryPointOutput): 137(ptr) Variable Output + 82: 6(float) Constant 1084227584 + 86: TypePointer Function 6(float) + 99: TypePointer Function 15(int) + 124: 6(float) Constant 1088421888 + 125: 6(float) Constant 1090519040 + 136: TypePointer Output 7(fvec4) +137(@entryPointOutput): 136(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 139: 7(fvec4) FunctionCall 9(@main() - Store 138(@entryPointOutput) 139 + 138: 7(fvec4) FunctionCall 9(@main() + Store 137(@entryPointOutput) 138 Return FunctionEnd 9(@main(): 7(fvec4) Function None 8 10: Label 12(a): 11(ptr) Variable Function - 88(f): 87(ptr) Variable Function - 101(i): 100(ptr) Variable Function - 121(g): 87(ptr) Variable Function + 87(f): 86(ptr) Variable Function + 100(i): 99(ptr) Variable Function + 120(g): 86(ptr) Variable Function Store 12(a) 14 21: 20(ptr) AccessChain 18 19 22: 15(int) Load 21 @@ -457,85 +455,84 @@ 70: 23(bool) INotEqual 69 25 71: 35(ptr) AccessChain 18 34 72: 6(float) Load 71 - 73: 15(int) ConvertFToS 72 - 74: 23(bool) INotEqual 73 25 - 75: 23(bool) LogicalAnd 70 74 - 76: 35(ptr) AccessChain 18 46 - 77: 6(float) Load 76 - 78: 23(bool) FOrdNotEqual 77 38 - 79: 23(bool) LogicalOr 75 78 - SelectionMerge 81 None - BranchConditional 79 80 81 - 80: Label - 82: 7(fvec4) Load 12(a) - 84: 7(fvec4) CompositeConstruct 83 83 83 83 - 85: 7(fvec4) FAdd 82 84 - ReturnValue 85 - 81: Label - 89: 35(ptr) AccessChain 18 34 - 90: 6(float) Load 89 - Store 88(f) 90 - Branch 91 - 91: Label - LoopMerge 93 94 None - Branch 95 - 95: Label - 96: 6(float) Load 88(f) - 97: 23(bool) FOrdNotEqual 96 38 - BranchConditional 97 92 93 - 92: Label - 98: 6(float) Load 88(f) - 99: 6(float) FSub 98 30 - Store 88(f) 99 - Branch 94 - 94: Label - Branch 91 - 93: Label - 102: 20(ptr) AccessChain 18 19 - 103: 15(int) Load 102 - Store 101(i) 103 + 73: 23(bool) FOrdNotEqual 72 38 + 74: 23(bool) LogicalAnd 70 73 + 75: 35(ptr) AccessChain 18 46 + 76: 6(float) Load 75 + 77: 23(bool) FOrdNotEqual 76 38 + 78: 23(bool) LogicalOr 74 77 + SelectionMerge 80 None + BranchConditional 78 79 80 + 79: Label + 81: 7(fvec4) Load 12(a) + 83: 7(fvec4) CompositeConstruct 82 82 82 82 + 84: 7(fvec4) FAdd 81 83 + ReturnValue 84 + 80: Label + 88: 35(ptr) AccessChain 18 34 + 89: 6(float) Load 88 + Store 87(f) 89 + Branch 90 + 90: Label + LoopMerge 92 93 None + Branch 94 + 94: Label + 95: 6(float) Load 87(f) + 96: 23(bool) FOrdNotEqual 95 38 + BranchConditional 96 91 92 + 91: Label + 97: 6(float) Load 87(f) + 98: 6(float) FSub 97 30 + Store 87(f) 98 + Branch 93 + 93: Label + Branch 90 + 92: Label + 101: 20(ptr) AccessChain 18 19 + 102: 15(int) Load 101 + Store 100(i) 102 + Branch 103 + 103: Label + LoopMerge 105 106 None Branch 104 104: Label - LoopMerge 106 107 None - Branch 105 - 105: Label - 108: 15(int) Load 101(i) - 109: 15(int) ISub 108 19 - Store 101(i) 109 - Branch 107 - 107: Label - 110: 15(int) Load 101(i) - 111: 23(bool) INotEqual 110 25 - BranchConditional 111 104 106 + 107: 15(int) Load 100(i) + 108: 15(int) ISub 107 19 + Store 100(i) 108 + Branch 106 106: Label - Branch 112 - 112: Label - LoopMerge 114 115 None - Branch 116 - 116: Label - 117: 15(int) Load 101(i) - 118: 23(bool) INotEqual 117 25 - BranchConditional 118 113 114 - 113: Label - 119: 15(int) Load 101(i) - 120: 15(int) ISub 119 19 - Store 101(i) 120 - Branch 115 - 115: Label - Branch 112 - 114: Label - 122: 35(ptr) AccessChain 18 34 - 123: 6(float) Load 122 - 124: 23(bool) FOrdNotEqual 123 38 - 127: 6(float) Select 124 125 126 - Store 121(g) 127 - 128: 6(float) Load 121(g) - 129: 7(fvec4) Load 12(a) - 130: 7(fvec4) CompositeConstruct 128 128 128 128 - 131: 7(fvec4) FAdd 129 130 - Store 12(a) 131 - 132: 7(fvec4) Load 12(a) - 133: 7(fvec4) CompositeConstruct 30 30 30 30 - 134: 7(fvec4) FSub 132 133 - ReturnValue 134 + 109: 15(int) Load 100(i) + 110: 23(bool) INotEqual 109 25 + BranchConditional 110 103 105 + 105: Label + Branch 111 + 111: Label + LoopMerge 113 114 None + Branch 115 + 115: Label + 116: 15(int) Load 100(i) + 117: 23(bool) INotEqual 116 25 + BranchConditional 117 112 113 + 112: Label + 118: 15(int) Load 100(i) + 119: 15(int) ISub 118 19 + Store 100(i) 119 + Branch 114 + 114: Label + Branch 111 + 113: Label + 121: 35(ptr) AccessChain 18 34 + 122: 6(float) Load 121 + 123: 23(bool) FOrdNotEqual 122 38 + 126: 6(float) Select 123 124 125 + Store 120(g) 126 + 127: 6(float) Load 120(g) + 128: 7(fvec4) Load 12(a) + 129: 7(fvec4) CompositeConstruct 127 127 127 127 + 130: 7(fvec4) FAdd 128 129 + Store 12(a) 130 + 131: 7(fvec4) Load 12(a) + 132: 7(fvec4) CompositeConstruct 30 30 30 30 + 133: 7(fvec4) FSub 131 132 + ReturnValue 133 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.include.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.include.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.include.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.include.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ ../Test/hlsl.include.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 44 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.inf.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.inf.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.inf.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.inf.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -112,7 +112,7 @@ 0:? '@entryPointOutput' ( out 4-component vector of float Position) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 37 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.init2.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.init2.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.init2.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.init2.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -358,7 +358,7 @@ 0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 112 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.init.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.init.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.init.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.init.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -331,7 +331,7 @@ 0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform float a, layout( row_major std140) uniform float b, layout( row_major std140) uniform float c}) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 110 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.inoutquals.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.inoutquals.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.inoutquals.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.inoutquals.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.inoutquals.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:8 Function Definition: MyFunc(f1;f1;f1;f1; ( temp void) 0:8 Function Parameters: @@ -106,6 +107,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:8 Function Definition: MyFunc(f1;f1;f1;f1; ( temp void) 0:8 Function Parameters: @@ -206,15 +208,15 @@ 0:? 'sampleMask' ( out int SampleMaskIn) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 88 Capability Shader - Capability SampleRateShading 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 68 78 82 86 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 13 "MyFunc(f1;f1;f1;f1;" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsic.frexp.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsic.frexp.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsic.frexp.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsic.frexp.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -190,7 +190,7 @@ 0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 98 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsic.frexp.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsic.frexp.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsic.frexp.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsic.frexp.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -113,7 +113,7 @@ 0:? Linker Objects // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 78 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.barriers.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.barriers.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.barriers.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.barriers.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -7,8 +7,8 @@ 0:? Sequence 0:4 MemoryBarrier ( temp void) 0:5 AllMemoryBarrierWithGroupSync ( temp void) -0:6 GroupMemoryBarrier ( temp void) -0:7 GroupMemoryBarrierWithGroupSync ( temp void) +0:6 DeviceMemoryBarrier ( temp void) +0:7 DeviceMemoryBarrierWithGroupSync ( temp void) 0:8 WorkgroupMemoryBarrier ( temp void) 0:9 WorkgroupMemoryBarrierWithGroupSync ( temp void) 0:11 Branch: Return with expression @@ -35,8 +35,8 @@ 0:? Sequence 0:4 MemoryBarrier ( temp void) 0:5 AllMemoryBarrierWithGroupSync ( temp void) -0:6 GroupMemoryBarrier ( temp void) -0:7 GroupMemoryBarrierWithGroupSync ( temp void) +0:6 DeviceMemoryBarrier ( temp void) +0:7 DeviceMemoryBarrierWithGroupSync ( temp void) 0:8 WorkgroupMemoryBarrier ( temp void) 0:9 WorkgroupMemoryBarrierWithGroupSync ( temp void) 0:11 Branch: Return with expression @@ -52,7 +52,7 @@ 0:? '@entryPointOutput' (layout( location=0) out float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 22 Capability Shader @@ -71,10 +71,10 @@ 7: TypeFunction 6(float) 10: TypeInt 32 0 11: 10(int) Constant 1 - 12: 10(int) Constant 4048 - 13: 10(int) Constant 512 - 14: 10(int) Constant 2 - 15: 10(int) Constant 256 + 12: 10(int) Constant 3400 + 13: 10(int) Constant 2 + 14: 10(int) Constant 2120 + 15: 10(int) Constant 264 16: 6(float) Constant 0 19: TypePointer Output 6(float) 20(@entryPointOutput): 19(ptr) Variable Output @@ -87,10 +87,10 @@ 8(@ComputeShaderFunction(): 6(float) Function None 7 9: Label MemoryBarrier 11 12 - ControlBarrier 11 11 12 - MemoryBarrier 11 13 - ControlBarrier 11 11 13 - MemoryBarrier 14 15 - ControlBarrier 14 14 15 + ControlBarrier 13 11 12 + MemoryBarrier 11 14 + ControlBarrier 13 11 14 + MemoryBarrier 13 15 + ControlBarrier 13 13 15 ReturnValue 16 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -13,7 +13,7 @@ 0:21 all ( temp bool) 0:21 Convert float to bool ( temp bool) 0:21 'inF0' ( in float) -0:24 AtomicAdd ( temp void) +0:24 AtomicAdd ( temp uint) 0:24 'gs_ua' ( shared uint) 0:24 'gs_ub' ( shared uint) 0:25 move second child to first child ( temp uint) @@ -21,7 +21,7 @@ 0:25 AtomicAdd ( temp uint) 0:25 'gs_ua' ( shared uint) 0:25 'gs_ub' ( shared uint) -0:26 AtomicAnd ( temp void) +0:26 AtomicAnd ( temp uint) 0:26 'gs_ua' ( shared uint) 0:26 'gs_ub' ( shared uint) 0:27 move second child to first child ( temp uint) @@ -40,7 +40,7 @@ 0:29 AtomicExchange ( temp uint) 0:29 'gs_ua' ( shared uint) 0:29 'gs_ub' ( shared uint) -0:30 AtomicMax ( temp void) +0:30 AtomicMax ( temp uint) 0:30 'gs_ua' ( shared uint) 0:30 'gs_ub' ( shared uint) 0:31 move second child to first child ( temp uint) @@ -48,7 +48,7 @@ 0:31 AtomicMax ( temp uint) 0:31 'gs_ua' ( shared uint) 0:31 'gs_ub' ( shared uint) -0:32 AtomicMin ( temp void) +0:32 AtomicMin ( temp uint) 0:32 'gs_ua' ( shared uint) 0:32 'gs_ub' ( shared uint) 0:33 move second child to first child ( temp uint) @@ -56,7 +56,7 @@ 0:33 AtomicMin ( temp uint) 0:33 'gs_ua' ( shared uint) 0:33 'gs_ub' ( shared uint) -0:34 AtomicOr ( temp void) +0:34 AtomicOr ( temp uint) 0:34 'gs_ua' ( shared uint) 0:34 'gs_ub' ( shared uint) 0:35 move second child to first child ( temp uint) @@ -64,7 +64,7 @@ 0:35 AtomicOr ( temp uint) 0:35 'gs_ua' ( shared uint) 0:35 'gs_ub' ( shared uint) -0:36 AtomicXor ( temp void) +0:36 AtomicXor ( temp uint) 0:36 'gs_ua' ( shared uint) 0:36 'gs_ub' ( shared uint) 0:37 move second child to first child ( temp uint) @@ -95,7 +95,7 @@ 0:55 all ( temp bool) 0:55 Convert float to bool ( temp 2-component vector of bool) 0:55 'inF0' ( in 2-component vector of float) -0:58 AtomicAdd ( temp void) +0:58 AtomicAdd ( temp 2-component vector of uint) 0:58 'gs_ua2' ( shared 2-component vector of uint) 0:58 'gs_ub2' ( shared 2-component vector of uint) 0:59 move second child to first child ( temp 2-component vector of uint) @@ -103,7 +103,7 @@ 0:59 AtomicAdd ( temp 2-component vector of uint) 0:59 'gs_ua2' ( shared 2-component vector of uint) 0:59 'gs_ub2' ( shared 2-component vector of uint) -0:60 AtomicAnd ( temp void) +0:60 AtomicAnd ( temp 2-component vector of uint) 0:60 'gs_ua2' ( shared 2-component vector of uint) 0:60 'gs_ub2' ( shared 2-component vector of uint) 0:61 move second child to first child ( temp 2-component vector of uint) @@ -122,7 +122,7 @@ 0:63 AtomicExchange ( temp 2-component vector of uint) 0:63 'gs_ua2' ( shared 2-component vector of uint) 0:63 'gs_ub2' ( shared 2-component vector of uint) -0:64 AtomicMax ( temp void) +0:64 AtomicMax ( temp 2-component vector of uint) 0:64 'gs_ua2' ( shared 2-component vector of uint) 0:64 'gs_ub2' ( shared 2-component vector of uint) 0:65 move second child to first child ( temp 2-component vector of uint) @@ -130,7 +130,7 @@ 0:65 AtomicMax ( temp 2-component vector of uint) 0:65 'gs_ua2' ( shared 2-component vector of uint) 0:65 'gs_ub2' ( shared 2-component vector of uint) -0:66 AtomicMin ( temp void) +0:66 AtomicMin ( temp 2-component vector of uint) 0:66 'gs_ua2' ( shared 2-component vector of uint) 0:66 'gs_ub2' ( shared 2-component vector of uint) 0:67 move second child to first child ( temp 2-component vector of uint) @@ -138,7 +138,7 @@ 0:67 AtomicMin ( temp 2-component vector of uint) 0:67 'gs_ua2' ( shared 2-component vector of uint) 0:67 'gs_ub2' ( shared 2-component vector of uint) -0:68 AtomicOr ( temp void) +0:68 AtomicOr ( temp 2-component vector of uint) 0:68 'gs_ua2' ( shared 2-component vector of uint) 0:68 'gs_ub2' ( shared 2-component vector of uint) 0:69 move second child to first child ( temp 2-component vector of uint) @@ -146,7 +146,7 @@ 0:69 AtomicOr ( temp 2-component vector of uint) 0:69 'gs_ua2' ( shared 2-component vector of uint) 0:69 'gs_ub2' ( shared 2-component vector of uint) -0:70 AtomicXor ( temp void) +0:70 AtomicXor ( temp 2-component vector of uint) 0:70 'gs_ua2' ( shared 2-component vector of uint) 0:70 'gs_ub2' ( shared 2-component vector of uint) 0:71 move second child to first child ( temp 2-component vector of uint) @@ -169,7 +169,7 @@ 0:82 all ( temp bool) 0:82 Convert float to bool ( temp 3-component vector of bool) 0:82 'inF0' ( in 3-component vector of float) -0:85 AtomicAdd ( temp void) +0:85 AtomicAdd ( temp 3-component vector of uint) 0:85 'gs_ua3' ( shared 3-component vector of uint) 0:85 'gs_ub3' ( shared 3-component vector of uint) 0:86 move second child to first child ( temp 3-component vector of uint) @@ -177,7 +177,7 @@ 0:86 AtomicAdd ( temp 3-component vector of uint) 0:86 'gs_ua3' ( shared 3-component vector of uint) 0:86 'gs_ub3' ( shared 3-component vector of uint) -0:87 AtomicAnd ( temp void) +0:87 AtomicAnd ( temp 3-component vector of uint) 0:87 'gs_ua3' ( shared 3-component vector of uint) 0:87 'gs_ub3' ( shared 3-component vector of uint) 0:88 move second child to first child ( temp 3-component vector of uint) @@ -196,7 +196,7 @@ 0:90 AtomicExchange ( temp 3-component vector of uint) 0:90 'gs_ua3' ( shared 3-component vector of uint) 0:90 'gs_ub3' ( shared 3-component vector of uint) -0:91 AtomicMax ( temp void) +0:91 AtomicMax ( temp 3-component vector of uint) 0:91 'gs_ua3' ( shared 3-component vector of uint) 0:91 'gs_ub3' ( shared 3-component vector of uint) 0:92 move second child to first child ( temp 3-component vector of uint) @@ -204,7 +204,7 @@ 0:92 AtomicMax ( temp 3-component vector of uint) 0:92 'gs_ua3' ( shared 3-component vector of uint) 0:92 'gs_ub3' ( shared 3-component vector of uint) -0:93 AtomicMin ( temp void) +0:93 AtomicMin ( temp 3-component vector of uint) 0:93 'gs_ua3' ( shared 3-component vector of uint) 0:93 'gs_ub3' ( shared 3-component vector of uint) 0:94 move second child to first child ( temp 3-component vector of uint) @@ -212,7 +212,7 @@ 0:94 AtomicMin ( temp 3-component vector of uint) 0:94 'gs_ua3' ( shared 3-component vector of uint) 0:94 'gs_ub3' ( shared 3-component vector of uint) -0:95 AtomicOr ( temp void) +0:95 AtomicOr ( temp 3-component vector of uint) 0:95 'gs_ua3' ( shared 3-component vector of uint) 0:95 'gs_ub3' ( shared 3-component vector of uint) 0:96 move second child to first child ( temp 3-component vector of uint) @@ -220,7 +220,7 @@ 0:96 AtomicOr ( temp 3-component vector of uint) 0:96 'gs_ua3' ( shared 3-component vector of uint) 0:96 'gs_ub3' ( shared 3-component vector of uint) -0:97 AtomicXor ( temp void) +0:97 AtomicXor ( temp 3-component vector of uint) 0:97 'gs_ua3' ( shared 3-component vector of uint) 0:97 'gs_ub3' ( shared 3-component vector of uint) 0:98 move second child to first child ( temp 3-component vector of uint) @@ -244,7 +244,7 @@ 0:109 all ( temp bool) 0:109 Convert float to bool ( temp 4-component vector of bool) 0:109 'inF0' ( in 4-component vector of float) -0:112 AtomicAdd ( temp void) +0:112 AtomicAdd ( temp 4-component vector of uint) 0:112 'gs_ua4' ( shared 4-component vector of uint) 0:112 'gs_ub4' ( shared 4-component vector of uint) 0:113 move second child to first child ( temp 4-component vector of uint) @@ -252,7 +252,7 @@ 0:113 AtomicAdd ( temp 4-component vector of uint) 0:113 'gs_ua4' ( shared 4-component vector of uint) 0:113 'gs_ub4' ( shared 4-component vector of uint) -0:114 AtomicAnd ( temp void) +0:114 AtomicAnd ( temp 4-component vector of uint) 0:114 'gs_ua4' ( shared 4-component vector of uint) 0:114 'gs_ub4' ( shared 4-component vector of uint) 0:115 move second child to first child ( temp 4-component vector of uint) @@ -271,7 +271,7 @@ 0:117 AtomicExchange ( temp 4-component vector of uint) 0:117 'gs_ua4' ( shared 4-component vector of uint) 0:117 'gs_ub4' ( shared 4-component vector of uint) -0:118 AtomicMax ( temp void) +0:118 AtomicMax ( temp 4-component vector of uint) 0:118 'gs_ua4' ( shared 4-component vector of uint) 0:118 'gs_ub4' ( shared 4-component vector of uint) 0:119 move second child to first child ( temp 4-component vector of uint) @@ -279,7 +279,7 @@ 0:119 AtomicMax ( temp 4-component vector of uint) 0:119 'gs_ua4' ( shared 4-component vector of uint) 0:119 'gs_ub4' ( shared 4-component vector of uint) -0:120 AtomicMin ( temp void) +0:120 AtomicMin ( temp 4-component vector of uint) 0:120 'gs_ua4' ( shared 4-component vector of uint) 0:120 'gs_ub4' ( shared 4-component vector of uint) 0:121 move second child to first child ( temp 4-component vector of uint) @@ -287,7 +287,7 @@ 0:121 AtomicMin ( temp 4-component vector of uint) 0:121 'gs_ua4' ( shared 4-component vector of uint) 0:121 'gs_ub4' ( shared 4-component vector of uint) -0:122 AtomicOr ( temp void) +0:122 AtomicOr ( temp 4-component vector of uint) 0:122 'gs_ua4' ( shared 4-component vector of uint) 0:122 'gs_ub4' ( shared 4-component vector of uint) 0:123 move second child to first child ( temp 4-component vector of uint) @@ -295,7 +295,7 @@ 0:123 AtomicOr ( temp 4-component vector of uint) 0:123 'gs_ua4' ( shared 4-component vector of uint) 0:123 'gs_ub4' ( shared 4-component vector of uint) -0:124 AtomicXor ( temp void) +0:124 AtomicXor ( temp 4-component vector of uint) 0:124 'gs_ua4' ( shared 4-component vector of uint) 0:124 'gs_ub4' ( shared 4-component vector of uint) 0:125 move second child to first child ( temp 4-component vector of uint) @@ -373,7 +373,7 @@ 0:21 all ( temp bool) 0:21 Convert float to bool ( temp bool) 0:21 'inF0' ( in float) -0:24 AtomicAdd ( temp void) +0:24 AtomicAdd ( temp uint) 0:24 'gs_ua' ( shared uint) 0:24 'gs_ub' ( shared uint) 0:25 move second child to first child ( temp uint) @@ -381,7 +381,7 @@ 0:25 AtomicAdd ( temp uint) 0:25 'gs_ua' ( shared uint) 0:25 'gs_ub' ( shared uint) -0:26 AtomicAnd ( temp void) +0:26 AtomicAnd ( temp uint) 0:26 'gs_ua' ( shared uint) 0:26 'gs_ub' ( shared uint) 0:27 move second child to first child ( temp uint) @@ -400,7 +400,7 @@ 0:29 AtomicExchange ( temp uint) 0:29 'gs_ua' ( shared uint) 0:29 'gs_ub' ( shared uint) -0:30 AtomicMax ( temp void) +0:30 AtomicMax ( temp uint) 0:30 'gs_ua' ( shared uint) 0:30 'gs_ub' ( shared uint) 0:31 move second child to first child ( temp uint) @@ -408,7 +408,7 @@ 0:31 AtomicMax ( temp uint) 0:31 'gs_ua' ( shared uint) 0:31 'gs_ub' ( shared uint) -0:32 AtomicMin ( temp void) +0:32 AtomicMin ( temp uint) 0:32 'gs_ua' ( shared uint) 0:32 'gs_ub' ( shared uint) 0:33 move second child to first child ( temp uint) @@ -416,7 +416,7 @@ 0:33 AtomicMin ( temp uint) 0:33 'gs_ua' ( shared uint) 0:33 'gs_ub' ( shared uint) -0:34 AtomicOr ( temp void) +0:34 AtomicOr ( temp uint) 0:34 'gs_ua' ( shared uint) 0:34 'gs_ub' ( shared uint) 0:35 move second child to first child ( temp uint) @@ -424,7 +424,7 @@ 0:35 AtomicOr ( temp uint) 0:35 'gs_ua' ( shared uint) 0:35 'gs_ub' ( shared uint) -0:36 AtomicXor ( temp void) +0:36 AtomicXor ( temp uint) 0:36 'gs_ua' ( shared uint) 0:36 'gs_ub' ( shared uint) 0:37 move second child to first child ( temp uint) @@ -455,7 +455,7 @@ 0:55 all ( temp bool) 0:55 Convert float to bool ( temp 2-component vector of bool) 0:55 'inF0' ( in 2-component vector of float) -0:58 AtomicAdd ( temp void) +0:58 AtomicAdd ( temp 2-component vector of uint) 0:58 'gs_ua2' ( shared 2-component vector of uint) 0:58 'gs_ub2' ( shared 2-component vector of uint) 0:59 move second child to first child ( temp 2-component vector of uint) @@ -463,7 +463,7 @@ 0:59 AtomicAdd ( temp 2-component vector of uint) 0:59 'gs_ua2' ( shared 2-component vector of uint) 0:59 'gs_ub2' ( shared 2-component vector of uint) -0:60 AtomicAnd ( temp void) +0:60 AtomicAnd ( temp 2-component vector of uint) 0:60 'gs_ua2' ( shared 2-component vector of uint) 0:60 'gs_ub2' ( shared 2-component vector of uint) 0:61 move second child to first child ( temp 2-component vector of uint) @@ -482,7 +482,7 @@ 0:63 AtomicExchange ( temp 2-component vector of uint) 0:63 'gs_ua2' ( shared 2-component vector of uint) 0:63 'gs_ub2' ( shared 2-component vector of uint) -0:64 AtomicMax ( temp void) +0:64 AtomicMax ( temp 2-component vector of uint) 0:64 'gs_ua2' ( shared 2-component vector of uint) 0:64 'gs_ub2' ( shared 2-component vector of uint) 0:65 move second child to first child ( temp 2-component vector of uint) @@ -490,7 +490,7 @@ 0:65 AtomicMax ( temp 2-component vector of uint) 0:65 'gs_ua2' ( shared 2-component vector of uint) 0:65 'gs_ub2' ( shared 2-component vector of uint) -0:66 AtomicMin ( temp void) +0:66 AtomicMin ( temp 2-component vector of uint) 0:66 'gs_ua2' ( shared 2-component vector of uint) 0:66 'gs_ub2' ( shared 2-component vector of uint) 0:67 move second child to first child ( temp 2-component vector of uint) @@ -498,7 +498,7 @@ 0:67 AtomicMin ( temp 2-component vector of uint) 0:67 'gs_ua2' ( shared 2-component vector of uint) 0:67 'gs_ub2' ( shared 2-component vector of uint) -0:68 AtomicOr ( temp void) +0:68 AtomicOr ( temp 2-component vector of uint) 0:68 'gs_ua2' ( shared 2-component vector of uint) 0:68 'gs_ub2' ( shared 2-component vector of uint) 0:69 move second child to first child ( temp 2-component vector of uint) @@ -506,7 +506,7 @@ 0:69 AtomicOr ( temp 2-component vector of uint) 0:69 'gs_ua2' ( shared 2-component vector of uint) 0:69 'gs_ub2' ( shared 2-component vector of uint) -0:70 AtomicXor ( temp void) +0:70 AtomicXor ( temp 2-component vector of uint) 0:70 'gs_ua2' ( shared 2-component vector of uint) 0:70 'gs_ub2' ( shared 2-component vector of uint) 0:71 move second child to first child ( temp 2-component vector of uint) @@ -529,7 +529,7 @@ 0:82 all ( temp bool) 0:82 Convert float to bool ( temp 3-component vector of bool) 0:82 'inF0' ( in 3-component vector of float) -0:85 AtomicAdd ( temp void) +0:85 AtomicAdd ( temp 3-component vector of uint) 0:85 'gs_ua3' ( shared 3-component vector of uint) 0:85 'gs_ub3' ( shared 3-component vector of uint) 0:86 move second child to first child ( temp 3-component vector of uint) @@ -537,7 +537,7 @@ 0:86 AtomicAdd ( temp 3-component vector of uint) 0:86 'gs_ua3' ( shared 3-component vector of uint) 0:86 'gs_ub3' ( shared 3-component vector of uint) -0:87 AtomicAnd ( temp void) +0:87 AtomicAnd ( temp 3-component vector of uint) 0:87 'gs_ua3' ( shared 3-component vector of uint) 0:87 'gs_ub3' ( shared 3-component vector of uint) 0:88 move second child to first child ( temp 3-component vector of uint) @@ -556,7 +556,7 @@ 0:90 AtomicExchange ( temp 3-component vector of uint) 0:90 'gs_ua3' ( shared 3-component vector of uint) 0:90 'gs_ub3' ( shared 3-component vector of uint) -0:91 AtomicMax ( temp void) +0:91 AtomicMax ( temp 3-component vector of uint) 0:91 'gs_ua3' ( shared 3-component vector of uint) 0:91 'gs_ub3' ( shared 3-component vector of uint) 0:92 move second child to first child ( temp 3-component vector of uint) @@ -564,7 +564,7 @@ 0:92 AtomicMax ( temp 3-component vector of uint) 0:92 'gs_ua3' ( shared 3-component vector of uint) 0:92 'gs_ub3' ( shared 3-component vector of uint) -0:93 AtomicMin ( temp void) +0:93 AtomicMin ( temp 3-component vector of uint) 0:93 'gs_ua3' ( shared 3-component vector of uint) 0:93 'gs_ub3' ( shared 3-component vector of uint) 0:94 move second child to first child ( temp 3-component vector of uint) @@ -572,7 +572,7 @@ 0:94 AtomicMin ( temp 3-component vector of uint) 0:94 'gs_ua3' ( shared 3-component vector of uint) 0:94 'gs_ub3' ( shared 3-component vector of uint) -0:95 AtomicOr ( temp void) +0:95 AtomicOr ( temp 3-component vector of uint) 0:95 'gs_ua3' ( shared 3-component vector of uint) 0:95 'gs_ub3' ( shared 3-component vector of uint) 0:96 move second child to first child ( temp 3-component vector of uint) @@ -580,7 +580,7 @@ 0:96 AtomicOr ( temp 3-component vector of uint) 0:96 'gs_ua3' ( shared 3-component vector of uint) 0:96 'gs_ub3' ( shared 3-component vector of uint) -0:97 AtomicXor ( temp void) +0:97 AtomicXor ( temp 3-component vector of uint) 0:97 'gs_ua3' ( shared 3-component vector of uint) 0:97 'gs_ub3' ( shared 3-component vector of uint) 0:98 move second child to first child ( temp 3-component vector of uint) @@ -604,7 +604,7 @@ 0:109 all ( temp bool) 0:109 Convert float to bool ( temp 4-component vector of bool) 0:109 'inF0' ( in 4-component vector of float) -0:112 AtomicAdd ( temp void) +0:112 AtomicAdd ( temp 4-component vector of uint) 0:112 'gs_ua4' ( shared 4-component vector of uint) 0:112 'gs_ub4' ( shared 4-component vector of uint) 0:113 move second child to first child ( temp 4-component vector of uint) @@ -612,7 +612,7 @@ 0:113 AtomicAdd ( temp 4-component vector of uint) 0:113 'gs_ua4' ( shared 4-component vector of uint) 0:113 'gs_ub4' ( shared 4-component vector of uint) -0:114 AtomicAnd ( temp void) +0:114 AtomicAnd ( temp 4-component vector of uint) 0:114 'gs_ua4' ( shared 4-component vector of uint) 0:114 'gs_ub4' ( shared 4-component vector of uint) 0:115 move second child to first child ( temp 4-component vector of uint) @@ -631,7 +631,7 @@ 0:117 AtomicExchange ( temp 4-component vector of uint) 0:117 'gs_ua4' ( shared 4-component vector of uint) 0:117 'gs_ub4' ( shared 4-component vector of uint) -0:118 AtomicMax ( temp void) +0:118 AtomicMax ( temp 4-component vector of uint) 0:118 'gs_ua4' ( shared 4-component vector of uint) 0:118 'gs_ub4' ( shared 4-component vector of uint) 0:119 move second child to first child ( temp 4-component vector of uint) @@ -639,7 +639,7 @@ 0:119 AtomicMax ( temp 4-component vector of uint) 0:119 'gs_ua4' ( shared 4-component vector of uint) 0:119 'gs_ub4' ( shared 4-component vector of uint) -0:120 AtomicMin ( temp void) +0:120 AtomicMin ( temp 4-component vector of uint) 0:120 'gs_ua4' ( shared 4-component vector of uint) 0:120 'gs_ub4' ( shared 4-component vector of uint) 0:121 move second child to first child ( temp 4-component vector of uint) @@ -647,7 +647,7 @@ 0:121 AtomicMin ( temp 4-component vector of uint) 0:121 'gs_ua4' ( shared 4-component vector of uint) 0:121 'gs_ub4' ( shared 4-component vector of uint) -0:122 AtomicOr ( temp void) +0:122 AtomicOr ( temp 4-component vector of uint) 0:122 'gs_ua4' ( shared 4-component vector of uint) 0:122 'gs_ub4' ( shared 4-component vector of uint) 0:123 move second child to first child ( temp 4-component vector of uint) @@ -655,7 +655,7 @@ 0:123 AtomicOr ( temp 4-component vector of uint) 0:123 'gs_ua4' ( shared 4-component vector of uint) 0:123 'gs_ub4' ( shared 4-component vector of uint) -0:124 AtomicXor ( temp void) +0:124 AtomicXor ( temp 4-component vector of uint) 0:124 'gs_ua4' ( shared 4-component vector of uint) 0:124 'gs_ub4' ( shared 4-component vector of uint) 0:125 move second child to first child ( temp 4-component vector of uint) @@ -716,7 +716,7 @@ 0:? 'inU1' (layout( location=4) in 4-component vector of uint) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 265 Capability Shader @@ -905,12 +905,12 @@ 63: 61(bool) FOrdNotEqual 60 62 64: 61(bool) All 63 68: 8(int) Load 67(gs_ub) - 71: 2 AtomicIAdd 66(gs_ua) 69 70 68 + 71: 8(int) AtomicIAdd 66(gs_ua) 69 70 68 73: 8(int) Load 67(gs_ub) 74: 8(int) AtomicIAdd 66(gs_ua) 69 70 73 Store 72(out_u1) 74 75: 8(int) Load 67(gs_ub) - 76: 2 AtomicAnd 66(gs_ua) 69 70 75 + 76: 8(int) AtomicAnd 66(gs_ua) 69 70 75 77: 8(int) Load 67(gs_ub) 78: 8(int) AtomicAnd 66(gs_ua) 69 70 77 Store 72(out_u1) 78 @@ -922,22 +922,22 @@ 84: 8(int) AtomicExchange 66(gs_ua) 69 70 83 Store 72(out_u1) 84 85: 8(int) Load 67(gs_ub) - 86: 2 AtomicSMax 66(gs_ua) 69 70 85 + 86: 8(int) AtomicUMax 66(gs_ua) 69 70 85 87: 8(int) Load 67(gs_ub) 88: 8(int) AtomicUMax 66(gs_ua) 69 70 87 Store 72(out_u1) 88 89: 8(int) Load 67(gs_ub) - 90: 2 AtomicSMin 66(gs_ua) 69 70 89 + 90: 8(int) AtomicUMin 66(gs_ua) 69 70 89 91: 8(int) Load 67(gs_ub) 92: 8(int) AtomicUMin 66(gs_ua) 69 70 91 Store 72(out_u1) 92 93: 8(int) Load 67(gs_ub) - 94: 2 AtomicOr 66(gs_ua) 69 70 93 + 94: 8(int) AtomicOr 66(gs_ua) 69 70 93 95: 8(int) Load 67(gs_ub) 96: 8(int) AtomicOr 66(gs_ua) 69 70 95 Store 72(out_u1) 96 97: 8(int) Load 67(gs_ub) - 98: 2 AtomicXor 66(gs_ua) 69 70 97 + 98: 8(int) AtomicXor 66(gs_ua) 69 70 97 99: 8(int) Load 67(gs_ub) 100: 8(int) AtomicXor 66(gs_ua) 69 70 99 Store 72(out_u1) 100 @@ -962,12 +962,12 @@ 108: 106(bvec2) FOrdNotEqual 105 107 109: 61(bool) All 108 113: 26(ivec2) Load 112(gs_ub2) - 114: 2 AtomicIAdd 111(gs_ua2) 69 70 113 + 114: 26(ivec2) AtomicIAdd 111(gs_ua2) 69 70 113 116: 26(ivec2) Load 112(gs_ub2) 117: 26(ivec2) AtomicIAdd 111(gs_ua2) 69 70 116 Store 115(out_u2) 117 118: 26(ivec2) Load 112(gs_ub2) - 119: 2 AtomicAnd 111(gs_ua2) 69 70 118 + 119: 26(ivec2) AtomicAnd 111(gs_ua2) 69 70 118 120: 26(ivec2) Load 112(gs_ub2) 121: 26(ivec2) AtomicAnd 111(gs_ua2) 69 70 120 Store 115(out_u2) 121 @@ -979,22 +979,22 @@ 127: 26(ivec2) AtomicExchange 111(gs_ua2) 69 70 126 Store 115(out_u2) 127 128: 26(ivec2) Load 112(gs_ub2) - 129: 2 AtomicSMax 111(gs_ua2) 69 70 128 + 129: 26(ivec2) AtomicUMax 111(gs_ua2) 69 70 128 130: 26(ivec2) Load 112(gs_ub2) 131: 26(ivec2) AtomicUMax 111(gs_ua2) 69 70 130 Store 115(out_u2) 131 132: 26(ivec2) Load 112(gs_ub2) - 133: 2 AtomicSMin 111(gs_ua2) 69 70 132 + 133: 26(ivec2) AtomicUMin 111(gs_ua2) 69 70 132 134: 26(ivec2) Load 112(gs_ub2) 135: 26(ivec2) AtomicUMin 111(gs_ua2) 69 70 134 Store 115(out_u2) 135 136: 26(ivec2) Load 112(gs_ub2) - 137: 2 AtomicOr 111(gs_ua2) 69 70 136 + 137: 26(ivec2) AtomicOr 111(gs_ua2) 69 70 136 138: 26(ivec2) Load 112(gs_ub2) 139: 26(ivec2) AtomicOr 111(gs_ua2) 69 70 138 Store 115(out_u2) 139 140: 26(ivec2) Load 112(gs_ub2) - 141: 2 AtomicXor 111(gs_ua2) 69 70 140 + 141: 26(ivec2) AtomicXor 111(gs_ua2) 69 70 140 142: 26(ivec2) Load 112(gs_ub2) 143: 26(ivec2) AtomicXor 111(gs_ua2) 69 70 142 Store 115(out_u2) 143 @@ -1012,12 +1012,12 @@ 152: 150(bvec3) FOrdNotEqual 149 151 153: 61(bool) All 152 157: 38(ivec3) Load 156(gs_ub3) - 158: 2 AtomicIAdd 155(gs_ua3) 69 70 157 + 158: 38(ivec3) AtomicIAdd 155(gs_ua3) 69 70 157 160: 38(ivec3) Load 156(gs_ub3) 161: 38(ivec3) AtomicIAdd 155(gs_ua3) 69 70 160 Store 159(out_u3) 161 162: 38(ivec3) Load 156(gs_ub3) - 163: 2 AtomicAnd 155(gs_ua3) 69 70 162 + 163: 38(ivec3) AtomicAnd 155(gs_ua3) 69 70 162 164: 38(ivec3) Load 156(gs_ub3) 165: 38(ivec3) AtomicAnd 155(gs_ua3) 69 70 164 Store 159(out_u3) 165 @@ -1029,22 +1029,22 @@ 171: 38(ivec3) AtomicExchange 155(gs_ua3) 69 70 170 Store 159(out_u3) 171 172: 38(ivec3) Load 156(gs_ub3) - 173: 2 AtomicSMax 155(gs_ua3) 69 70 172 + 173: 38(ivec3) AtomicUMax 155(gs_ua3) 69 70 172 174: 38(ivec3) Load 156(gs_ub3) 175: 38(ivec3) AtomicUMax 155(gs_ua3) 69 70 174 Store 159(out_u3) 175 176: 38(ivec3) Load 156(gs_ub3) - 177: 2 AtomicSMin 155(gs_ua3) 69 70 176 + 177: 38(ivec3) AtomicUMin 155(gs_ua3) 69 70 176 178: 38(ivec3) Load 156(gs_ub3) 179: 38(ivec3) AtomicUMin 155(gs_ua3) 69 70 178 Store 159(out_u3) 179 180: 38(ivec3) Load 156(gs_ub3) - 181: 2 AtomicOr 155(gs_ua3) 69 70 180 + 181: 38(ivec3) AtomicOr 155(gs_ua3) 69 70 180 182: 38(ivec3) Load 156(gs_ub3) 183: 38(ivec3) AtomicOr 155(gs_ua3) 69 70 182 Store 159(out_u3) 183 184: 38(ivec3) Load 156(gs_ub3) - 185: 2 AtomicXor 155(gs_ua3) 69 70 184 + 185: 38(ivec3) AtomicXor 155(gs_ua3) 69 70 184 186: 38(ivec3) Load 156(gs_ub3) 187: 38(ivec3) AtomicXor 155(gs_ua3) 69 70 186 Store 159(out_u3) 187 @@ -1062,12 +1062,12 @@ 195: 193(bvec4) FOrdNotEqual 192 194 196: 61(bool) All 195 200: 50(ivec4) Load 199(gs_ub4) - 201: 2 AtomicIAdd 198(gs_ua4) 69 70 200 + 201: 50(ivec4) AtomicIAdd 198(gs_ua4) 69 70 200 203: 50(ivec4) Load 199(gs_ub4) 204: 50(ivec4) AtomicIAdd 198(gs_ua4) 69 70 203 Store 202(out_u4) 204 205: 50(ivec4) Load 199(gs_ub4) - 206: 2 AtomicAnd 198(gs_ua4) 69 70 205 + 206: 50(ivec4) AtomicAnd 198(gs_ua4) 69 70 205 207: 50(ivec4) Load 199(gs_ub4) 208: 50(ivec4) AtomicAnd 198(gs_ua4) 69 70 207 Store 202(out_u4) 208 @@ -1079,22 +1079,22 @@ 214: 50(ivec4) AtomicExchange 198(gs_ua4) 69 70 213 Store 202(out_u4) 214 215: 50(ivec4) Load 199(gs_ub4) - 216: 2 AtomicSMax 198(gs_ua4) 69 70 215 + 216: 50(ivec4) AtomicUMax 198(gs_ua4) 69 70 215 217: 50(ivec4) Load 199(gs_ub4) 218: 50(ivec4) AtomicUMax 198(gs_ua4) 69 70 217 Store 202(out_u4) 218 219: 50(ivec4) Load 199(gs_ub4) - 220: 2 AtomicSMin 198(gs_ua4) 69 70 219 + 220: 50(ivec4) AtomicUMin 198(gs_ua4) 69 70 219 221: 50(ivec4) Load 199(gs_ub4) 222: 50(ivec4) AtomicUMin 198(gs_ua4) 69 70 221 Store 202(out_u4) 222 223: 50(ivec4) Load 199(gs_ub4) - 224: 2 AtomicOr 198(gs_ua4) 69 70 223 + 224: 50(ivec4) AtomicOr 198(gs_ua4) 69 70 223 225: 50(ivec4) Load 199(gs_ub4) 226: 50(ivec4) AtomicOr 198(gs_ua4) 69 70 225 Store 202(out_u4) 226 227: 50(ivec4) Load 199(gs_ub4) - 228: 2 AtomicXor 198(gs_ua4) 69 70 227 + 228: 50(ivec4) AtomicXor 198(gs_ua4) 69 70 227 229: 50(ivec4) Load 199(gs_ub4) 230: 50(ivec4) AtomicXor 198(gs_ua4) 69 70 229 Store 202(out_u4) 230 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.d3dcolortoubyte4.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.d3dcolortoubyte4.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.d3dcolortoubyte4.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.d3dcolortoubyte4.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -74,7 +74,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of int) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 29 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.double.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.double.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.double.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.double.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -164,7 +164,7 @@ 0:? 'inU1b' (layout( location=9) flat in uint) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 90 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.evalfns.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.evalfns.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.evalfns.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.evalfns.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -154,7 +154,7 @@ 0:? 'inI2' (layout( location=4) flat in 2-component vector of int) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 80 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.f1632.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.f1632.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.f1632.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.f1632.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -260,7 +260,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 103 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.f3216.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.f3216.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.f3216.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.f3216.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -270,7 +270,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 106 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -2,13 +2,13 @@ Shader version: 500 gl_FragCoord origin is upper left 0:? Sequence -0:17 Function Definition: PixelShaderFunctionS(f1;f1;f1;u1;u1; ( temp float) +0:17 Function Definition: PixelShaderFunctionS(f1;f1;f1;u1;i1; ( temp float) 0:17 Function Parameters: 0:17 'inF0' ( in float) 0:17 'inF1' ( in float) 0:17 'inF2' ( in float) 0:17 'inU0' ( in uint) -0:17 'inU1' ( in uint) +0:17 'inU1' ( in int) 0:? Sequence 0:20 Sequence 0:20 move second child to first child ( temp bool) @@ -46,7 +46,7 @@ 0:26 move second child to first child ( temp uint) 0:26 'r006' ( temp uint) 0:26 floatBitsToUint ( temp uint) -0:26 'inF0' ( in float) +0:26 'inU1' ( in int) 0:27 Sequence 0:27 move second child to first child ( temp float) 0:27 'r007' ( temp float) @@ -2820,13 +2820,13 @@ Shader version: 500 gl_FragCoord origin is upper left 0:? Sequence -0:17 Function Definition: PixelShaderFunctionS(f1;f1;f1;u1;u1; ( temp float) +0:17 Function Definition: PixelShaderFunctionS(f1;f1;f1;u1;i1; ( temp float) 0:17 Function Parameters: 0:17 'inF0' ( in float) 0:17 'inF1' ( in float) 0:17 'inF2' ( in float) 0:17 'inU0' ( in uint) -0:17 'inU1' ( in uint) +0:17 'inU1' ( in int) 0:? Sequence 0:20 Sequence 0:20 move second child to first child ( temp bool) @@ -2864,7 +2864,7 @@ 0:26 move second child to first child ( temp uint) 0:26 'r006' ( temp uint) 0:26 floatBitsToUint ( temp uint) -0:26 'inF0' ( in float) +0:26 'inU1' ( in int) 0:27 Sequence 0:27 move second child to first child ( temp float) 0:27 'r007' ( temp float) @@ -5632,7 +5632,7 @@ 0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 1832 Capability Shader @@ -5643,85 +5643,85 @@ ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" - Name 16 "PixelShaderFunctionS(f1;f1;f1;u1;u1;" - Name 11 "inF0" - Name 12 "inF1" - Name 13 "inF2" - Name 14 "inU0" - Name 15 "inU1" - Name 22 "PixelShaderFunction1(vf1;vf1;vf1;" - Name 19 "inF0" - Name 20 "inF1" - Name 21 "inF2" - Name 34 "PixelShaderFunction2(vf2;vf2;vf2;vu2;vu2;" - Name 29 "inF0" - Name 30 "inF1" - Name 31 "inF2" - Name 32 "inU0" - Name 33 "inU1" - Name 46 "PixelShaderFunction3(vf3;vf3;vf3;vu3;vu3;" - Name 41 "inF0" - Name 42 "inF1" - Name 43 "inF2" - Name 44 "inU0" - Name 45 "inU1" - Name 58 "PixelShaderFunction(vf4;vf4;vf4;vu4;vu4;" - Name 53 "inF0" - Name 54 "inF1" - Name 55 "inF2" - Name 56 "inU0" - Name 57 "inU1" - Name 66 "PixelShaderFunction2x2(mf22;mf22;mf22;" - Name 63 "inF0" - Name 64 "inF1" - Name 65 "inF2" - Name 74 "PixelShaderFunction3x3(mf33;mf33;mf33;" - Name 71 "inF0" - Name 72 "inF1" - Name 73 "inF2" - Name 82 "PixelShaderFunction4x4(mf44;mf44;mf44;" - Name 79 "inF0" - Name 80 "inF1" - Name 81 "inF2" - Name 91 "TestGenMul2(f1;f1;vf2;vf2;mf22;mf22;" - Name 85 "inF0" - Name 86 "inF1" - Name 87 "inFV0" - Name 88 "inFV1" - Name 89 "inFM0" - Name 90 "inFM1" - Name 100 "TestGenMul3(f1;f1;vf3;vf3;mf33;mf33;" - Name 94 "inF0" - Name 95 "inF1" - Name 96 "inFV0" - Name 97 "inFV1" - Name 98 "inFM0" - Name 99 "inFM1" - Name 109 "TestGenMul4(f1;f1;vf4;vf4;mf44;mf44;" - Name 103 "inF0" - Name 104 "inF1" - Name 105 "inFV0" - Name 106 "inFV1" - Name 107 "inFM0" - Name 108 "inFM1" - Name 129 "TestGenMulNxM(f1;f1;vf2;vf3;mf23;mf32;mf33;mf34;mf24;" - Name 120 "inF0" - Name 121 "inF1" - Name 122 "inFV2" - Name 123 "inFV3" - Name 124 "inFM2x3" - Name 125 "inFM3x2" - Name 126 "inFM3x3" - Name 127 "inFM3x4" - Name 128 "inFM2x4" - Name 131 "PS_OUTPUT" - MemberName 131(PS_OUTPUT) 0 "color" - Name 133 "@main(" - Name 137 "r000" - Name 142 "r001" - Name 145 "r002" - Name 148 "r003" - Name 152 "r004" + Name 18 "PixelShaderFunctionS(f1;f1;f1;u1;i1;" + Name 13 "inF0" + Name 14 "inF1" + Name 15 "inF2" + Name 16 "inU0" + Name 17 "inU1" + Name 24 "PixelShaderFunction1(vf1;vf1;vf1;" + Name 21 "inF0" + Name 22 "inF1" + Name 23 "inF2" + Name 36 "PixelShaderFunction2(vf2;vf2;vf2;vu2;vu2;" + Name 31 "inF0" + Name 32 "inF1" + Name 33 "inF2" + Name 34 "inU0" + Name 35 "inU1" + Name 48 "PixelShaderFunction3(vf3;vf3;vf3;vu3;vu3;" + Name 43 "inF0" + Name 44 "inF1" + Name 45 "inF2" + Name 46 "inU0" + Name 47 "inU1" + Name 60 "PixelShaderFunction(vf4;vf4;vf4;vu4;vu4;" + Name 55 "inF0" + Name 56 "inF1" + Name 57 "inF2" + Name 58 "inU0" + Name 59 "inU1" + Name 68 "PixelShaderFunction2x2(mf22;mf22;mf22;" + Name 65 "inF0" + Name 66 "inF1" + Name 67 "inF2" + Name 76 "PixelShaderFunction3x3(mf33;mf33;mf33;" + Name 73 "inF0" + Name 74 "inF1" + Name 75 "inF2" + Name 84 "PixelShaderFunction4x4(mf44;mf44;mf44;" + Name 81 "inF0" + Name 82 "inF1" + Name 83 "inF2" + Name 93 "TestGenMul2(f1;f1;vf2;vf2;mf22;mf22;" + Name 87 "inF0" + Name 88 "inF1" + Name 89 "inFV0" + Name 90 "inFV1" + Name 91 "inFM0" + Name 92 "inFM1" + Name 102 "TestGenMul3(f1;f1;vf3;vf3;mf33;mf33;" + Name 96 "inF0" + Name 97 "inF1" + Name 98 "inFV0" + Name 99 "inFV1" + Name 100 "inFM0" + Name 101 "inFM1" + Name 111 "TestGenMul4(f1;f1;vf4;vf4;mf44;mf44;" + Name 105 "inF0" + Name 106 "inF1" + Name 107 "inFV0" + Name 108 "inFV1" + Name 109 "inFM0" + Name 110 "inFM1" + Name 131 "TestGenMulNxM(f1;f1;vf2;vf3;mf23;mf32;mf33;mf34;mf24;" + Name 122 "inF0" + Name 123 "inF1" + Name 124 "inFV2" + Name 125 "inFV3" + Name 126 "inFM2x3" + Name 127 "inFM3x2" + Name 128 "inFM3x3" + Name 129 "inFM3x4" + Name 130 "inFM2x4" + Name 133 "PS_OUTPUT" + MemberName 133(PS_OUTPUT) 0 "color" + Name 135 "@main(" + Name 139 "r000" + Name 144 "r001" + Name 147 "r002" + Name 150 "r003" + Name 154 "r004" Name 157 "r005" Name 160 "r006" Name 163 "r007" @@ -6161,153 +6161,153 @@ 7: TypePointer Function 6(float) 8: TypeInt 32 0 9: TypePointer Function 8(int) - 10: TypeFunction 6(float) 7(ptr) 7(ptr) 7(ptr) 9(ptr) 9(ptr) - 18: TypeFunction 6(float) 7(ptr) 7(ptr) 7(ptr) - 24: TypeVector 6(float) 2 - 25: TypePointer Function 24(fvec2) - 26: TypeVector 8(int) 2 - 27: TypePointer Function 26(ivec2) - 28: TypeFunction 24(fvec2) 25(ptr) 25(ptr) 25(ptr) 27(ptr) 27(ptr) - 36: TypeVector 6(float) 3 - 37: TypePointer Function 36(fvec3) - 38: TypeVector 8(int) 3 - 39: TypePointer Function 38(ivec3) - 40: TypeFunction 36(fvec3) 37(ptr) 37(ptr) 37(ptr) 39(ptr) 39(ptr) - 48: TypeVector 6(float) 4 - 49: TypePointer Function 48(fvec4) - 50: TypeVector 8(int) 4 - 51: TypePointer Function 50(ivec4) - 52: TypeFunction 48(fvec4) 49(ptr) 49(ptr) 49(ptr) 51(ptr) 51(ptr) - 60: TypeMatrix 24(fvec2) 2 - 61: TypePointer Function 60 - 62: TypeFunction 60 61(ptr) 61(ptr) 61(ptr) - 68: TypeMatrix 36(fvec3) 3 - 69: TypePointer Function 68 - 70: TypeFunction 68 69(ptr) 69(ptr) 69(ptr) - 76: TypeMatrix 48(fvec4) 4 - 77: TypePointer Function 76 - 78: TypeFunction 76 77(ptr) 77(ptr) 77(ptr) - 84: TypeFunction 2 7(ptr) 7(ptr) 25(ptr) 25(ptr) 61(ptr) 61(ptr) - 93: TypeFunction 2 7(ptr) 7(ptr) 37(ptr) 37(ptr) 69(ptr) 69(ptr) - 102: TypeFunction 2 7(ptr) 7(ptr) 49(ptr) 49(ptr) 77(ptr) 77(ptr) - 111: TypeMatrix 36(fvec3) 2 - 112: TypePointer Function 111 - 113: TypeMatrix 24(fvec2) 3 + 10: TypeInt 32 1 + 11: TypePointer Function 10(int) + 12: TypeFunction 6(float) 7(ptr) 7(ptr) 7(ptr) 9(ptr) 11(ptr) + 20: TypeFunction 6(float) 7(ptr) 7(ptr) 7(ptr) + 26: TypeVector 6(float) 2 + 27: TypePointer Function 26(fvec2) + 28: TypeVector 8(int) 2 + 29: TypePointer Function 28(ivec2) + 30: TypeFunction 26(fvec2) 27(ptr) 27(ptr) 27(ptr) 29(ptr) 29(ptr) + 38: TypeVector 6(float) 3 + 39: TypePointer Function 38(fvec3) + 40: TypeVector 8(int) 3 + 41: TypePointer Function 40(ivec3) + 42: TypeFunction 38(fvec3) 39(ptr) 39(ptr) 39(ptr) 41(ptr) 41(ptr) + 50: TypeVector 6(float) 4 + 51: TypePointer Function 50(fvec4) + 52: TypeVector 8(int) 4 + 53: TypePointer Function 52(ivec4) + 54: TypeFunction 50(fvec4) 51(ptr) 51(ptr) 51(ptr) 53(ptr) 53(ptr) + 62: TypeMatrix 26(fvec2) 2 + 63: TypePointer Function 62 + 64: TypeFunction 62 63(ptr) 63(ptr) 63(ptr) + 70: TypeMatrix 38(fvec3) 3 + 71: TypePointer Function 70 + 72: TypeFunction 70 71(ptr) 71(ptr) 71(ptr) + 78: TypeMatrix 50(fvec4) 4 + 79: TypePointer Function 78 + 80: TypeFunction 78 79(ptr) 79(ptr) 79(ptr) + 86: TypeFunction 2 7(ptr) 7(ptr) 27(ptr) 27(ptr) 63(ptr) 63(ptr) + 95: TypeFunction 2 7(ptr) 7(ptr) 39(ptr) 39(ptr) 71(ptr) 71(ptr) + 104: TypeFunction 2 7(ptr) 7(ptr) 51(ptr) 51(ptr) 79(ptr) 79(ptr) + 113: TypeMatrix 38(fvec3) 2 114: TypePointer Function 113 - 115: TypeMatrix 48(fvec4) 3 + 115: TypeMatrix 26(fvec2) 3 116: TypePointer Function 115 - 117: TypeMatrix 48(fvec4) 2 + 117: TypeMatrix 50(fvec4) 3 118: TypePointer Function 117 - 119: TypeFunction 2 7(ptr) 7(ptr) 25(ptr) 37(ptr) 112(ptr) 114(ptr) 69(ptr) 116(ptr) 118(ptr) - 131(PS_OUTPUT): TypeStruct 48(fvec4) - 132: TypeFunction 131(PS_OUTPUT) - 135: TypeBool - 136: TypePointer Function 135(bool) - 139: 6(float) Constant 0 - 155: TypeInt 32 1 - 156: TypePointer Function 155(int) - 187: 155(int) Constant 0 - 199: 155(int) Constant 7 + 119: TypeMatrix 50(fvec4) 2 + 120: TypePointer Function 119 + 121: TypeFunction 2 7(ptr) 7(ptr) 27(ptr) 39(ptr) 114(ptr) 116(ptr) 71(ptr) 118(ptr) 120(ptr) + 133(PS_OUTPUT): TypeStruct 50(fvec4) + 134: TypeFunction 133(PS_OUTPUT) + 137: TypeBool + 138: TypePointer Function 137(bool) + 141: 6(float) Constant 0 + 187: 10(int) Constant 0 + 199: 10(int) Constant 7 268: 6(float) Constant 1050288283 289: 6(float) Constant 1065353216 - 293: 155(int) Constant 2 - 345: TypeVector 135(bool) 2 - 346: 24(fvec2) ConstantComposite 139 139 - 362: TypeVector 155(int) 2 + 293: 10(int) Constant 2 + 345: TypeVector 137(bool) 2 + 346: 26(fvec2) ConstantComposite 141 141 + 362: TypeVector 10(int) 2 363: TypePointer Function 362(ivec2) 395: 8(int) Constant 0 - 396: 26(ivec2) ConstantComposite 395 395 - 409: 155(int) Constant 3 + 396: 28(ivec2) ConstantComposite 395 395 + 409: 10(int) Constant 3 410: 362(ivec2) ConstantComposite 199 409 453: 8(int) Constant 7 454: 8(int) Constant 8 - 455: 26(ivec2) ConstantComposite 453 454 + 455: 28(ivec2) ConstantComposite 453 454 472: TypePointer Function 345(bvec2) 530: 6(float) Constant 1073741824 533: 8(int) Constant 1 534: 8(int) Constant 2 - 535: 26(ivec2) ConstantComposite 533 534 - 582: 24(fvec2) ConstantComposite 289 530 - 587: TypeVector 135(bool) 3 - 588: 36(fvec3) ConstantComposite 139 139 139 - 604: TypeVector 155(int) 3 + 535: 28(ivec2) ConstantComposite 533 534 + 582: 26(fvec2) ConstantComposite 289 530 + 587: TypeVector 137(bool) 3 + 588: 38(fvec3) ConstantComposite 141 141 141 + 604: TypeVector 10(int) 3 605: TypePointer Function 604(ivec3) - 637: 38(ivec3) ConstantComposite 395 395 395 + 637: 40(ivec3) ConstantComposite 395 395 395 650: 8(int) Constant 3 651: 8(int) Constant 5 - 652: 38(ivec3) ConstantComposite 453 650 651 + 652: 40(ivec3) ConstantComposite 453 650 651 699: 8(int) Constant 4 - 700: 38(ivec3) ConstantComposite 534 650 699 + 700: 40(ivec3) ConstantComposite 534 650 699 717: TypePointer Function 587(bvec3) 736: 6(float) Constant 1050253722 - 783: 38(ivec3) ConstantComposite 533 534 650 + 783: 40(ivec3) ConstantComposite 533 534 650 830: 6(float) Constant 1077936128 - 831: 36(fvec3) ConstantComposite 289 530 830 - 836: TypeVector 135(bool) 4 - 837: 48(fvec4) ConstantComposite 139 139 139 139 - 853: TypeVector 155(int) 4 + 831: 38(fvec3) ConstantComposite 289 530 830 + 836: TypeVector 137(bool) 4 + 837: 50(fvec4) ConstantComposite 141 141 141 141 + 853: TypeVector 10(int) 4 854: TypePointer Function 853(ivec4) - 886: 50(ivec4) ConstantComposite 395 395 395 395 - 899: 50(ivec4) ConstantComposite 453 650 651 534 + 886: 52(ivec4) ConstantComposite 395 395 395 395 + 899: 52(ivec4) ConstantComposite 453 650 651 534 953: 8(int) Constant 9 954: 8(int) Constant 10 - 955: 50(ivec4) ConstantComposite 453 454 953 954 + 955: 52(ivec4) ConstantComposite 453 454 953 954 972: TypePointer Function 836(bvec4) - 1032: 50(ivec4) ConstantComposite 533 534 650 699 + 1032: 52(ivec4) ConstantComposite 533 534 650 699 1079: 6(float) Constant 1082130432 - 1080: 48(fvec4) ConstantComposite 289 530 830 1079 + 1080: 50(fvec4) ConstantComposite 289 530 830 1079 1085: TypeMatrix 345(bvec2) 2 - 1111: 60 ConstantComposite 346 346 - 1258: 24(fvec2) ConstantComposite 530 530 - 1259: 60 ConstantComposite 1258 1258 + 1111: 62 ConstantComposite 346 346 + 1258: 26(fvec2) ConstantComposite 530 530 + 1259: 62 ConstantComposite 1258 1258 1264: TypeMatrix 587(bvec3) 3 - 1290: 68 ConstantComposite 588 588 588 - 1440: 36(fvec3) ConstantComposite 830 830 830 - 1441: 68 ConstantComposite 1440 1440 1440 + 1290: 70 ConstantComposite 588 588 588 + 1440: 38(fvec3) ConstantComposite 830 830 830 + 1441: 70 ConstantComposite 1440 1440 1440 1446: TypeMatrix 836(bvec4) 4 - 1472: 76 ConstantComposite 837 837 837 837 - 1625: 48(fvec4) ConstantComposite 1079 1079 1079 1079 - 1626: 76 ConstantComposite 1625 1625 1625 1625 - 1805: TypePointer Function 131(PS_OUTPUT) - 1807: 48(fvec4) ConstantComposite 289 289 289 289 - 1812: TypePointer Output 48(fvec4) + 1472: 78 ConstantComposite 837 837 837 837 + 1625: 50(fvec4) ConstantComposite 1079 1079 1079 1079 + 1626: 78 ConstantComposite 1625 1625 1625 1625 + 1805: TypePointer Function 133(PS_OUTPUT) + 1807: 50(fvec4) ConstantComposite 289 289 289 289 + 1812: TypePointer Output 50(fvec4) 1813(@entryPointOutput.color): 1812(ptr) Variable Output 1816: TypePointer Workgroup 8(int) 1817(gs_ua): 1816(ptr) Variable Workgroup 1818(gs_ub): 1816(ptr) Variable Workgroup 1819(gs_uc): 1816(ptr) Variable Workgroup - 1820: TypePointer Workgroup 26(ivec2) + 1820: TypePointer Workgroup 28(ivec2) 1821(gs_ua2): 1820(ptr) Variable Workgroup 1822(gs_ub2): 1820(ptr) Variable Workgroup 1823(gs_uc2): 1820(ptr) Variable Workgroup - 1824: TypePointer Workgroup 38(ivec3) + 1824: TypePointer Workgroup 40(ivec3) 1825(gs_ua3): 1824(ptr) Variable Workgroup 1826(gs_ub3): 1824(ptr) Variable Workgroup 1827(gs_uc3): 1824(ptr) Variable Workgroup - 1828: TypePointer Workgroup 50(ivec4) + 1828: TypePointer Workgroup 52(ivec4) 1829(gs_ua4): 1828(ptr) Variable Workgroup 1830(gs_ub4): 1828(ptr) Variable Workgroup 1831(gs_uc4): 1828(ptr) Variable Workgroup 4(main): 2 Function None 3 5: Label - 1814:131(PS_OUTPUT) FunctionCall 133(@main() - 1815: 48(fvec4) CompositeExtract 1814 0 + 1814:133(PS_OUTPUT) FunctionCall 135(@main() + 1815: 50(fvec4) CompositeExtract 1814 0 Store 1813(@entryPointOutput.color) 1815 Return FunctionEnd -16(PixelShaderFunctionS(f1;f1;f1;u1;u1;): 6(float) Function None 10 - 11(inF0): 7(ptr) FunctionParameter - 12(inF1): 7(ptr) FunctionParameter - 13(inF2): 7(ptr) FunctionParameter - 14(inU0): 9(ptr) FunctionParameter - 15(inU1): 9(ptr) FunctionParameter - 17: Label - 137(r000): 136(ptr) Variable Function - 142(r001): 7(ptr) Variable Function - 145(r002): 7(ptr) Variable Function - 148(r003): 136(ptr) Variable Function - 152(r004): 7(ptr) Variable Function - 157(r005): 156(ptr) Variable Function +18(PixelShaderFunctionS(f1;f1;f1;u1;i1;): 6(float) Function None 12 + 13(inF0): 7(ptr) FunctionParameter + 14(inF1): 7(ptr) FunctionParameter + 15(inF2): 7(ptr) FunctionParameter + 16(inU0): 9(ptr) FunctionParameter + 17(inU1): 11(ptr) FunctionParameter + 19: Label + 139(r000): 138(ptr) Variable Function + 144(r001): 7(ptr) Variable Function + 147(r002): 7(ptr) Variable Function + 150(r003): 138(ptr) Variable Function + 154(r004): 7(ptr) Variable Function + 157(r005): 11(ptr) Variable Function 160(r006): 9(ptr) Variable Function 163(r007): 7(ptr) Variable Function 166(r009): 7(ptr) Variable Function @@ -6316,7 +6316,7 @@ 176(r012): 7(ptr) Variable Function 192(r014): 7(ptr) Variable Function 195(r015): 7(ptr) Variable Function - 198(r016): 156(ptr) Variable Function + 198(r016): 11(ptr) Variable Function 201(r017): 7(ptr) Variable Function 204(r018): 7(ptr) Variable Function 207(r019): 7(ptr) Variable Function @@ -6332,8 +6332,8 @@ 237(r033): 7(ptr) Variable Function 241(r034): 7(ptr) Variable Function 244(r036): 7(ptr) Variable Function - 247(r037): 136(ptr) Variable Function - 250(r038): 136(ptr) Variable Function + 247(r037): 138(ptr) Variable Function + 250(r038): 138(ptr) Variable Function 253(r039): 7(ptr) Variable Function 257(r039a): 7(ptr) Variable Function 262(r040): 7(ptr) Variable Function @@ -6357,2102 +6357,2102 @@ 330(r059): 7(ptr) Variable Function 333(r060): 7(ptr) Variable Function 336(r061): 7(ptr) Variable Function - 138: 6(float) Load 11(inF0) - 140: 135(bool) FOrdNotEqual 138 139 - 141: 135(bool) All 140 - Store 137(r000) 141 - 143: 6(float) Load 11(inF0) - 144: 6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 143 - Store 142(r001) 144 - 146: 6(float) Load 11(inF0) - 147: 6(float) ExtInst 1(GLSL.std.450) 17(Acos) 146 - Store 145(r002) 147 - 149: 6(float) Load 11(inF0) - 150: 135(bool) FOrdNotEqual 149 139 - 151: 135(bool) Any 150 - Store 148(r003) 151 - 153: 6(float) Load 11(inF0) - 154: 6(float) ExtInst 1(GLSL.std.450) 16(Asin) 153 - Store 152(r004) 154 - 158: 6(float) Load 11(inF0) - 159: 155(int) Bitcast 158 + 140: 6(float) Load 13(inF0) + 142: 137(bool) FOrdNotEqual 140 141 + 143: 137(bool) All 142 + Store 139(r000) 143 + 145: 6(float) Load 13(inF0) + 146: 6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 145 + Store 144(r001) 146 + 148: 6(float) Load 13(inF0) + 149: 6(float) ExtInst 1(GLSL.std.450) 17(Acos) 148 + Store 147(r002) 149 + 151: 6(float) Load 13(inF0) + 152: 137(bool) FOrdNotEqual 151 141 + 153: 137(bool) Any 152 + Store 150(r003) 153 + 155: 6(float) Load 13(inF0) + 156: 6(float) ExtInst 1(GLSL.std.450) 16(Asin) 155 + Store 154(r004) 156 + 158: 6(float) Load 13(inF0) + 159: 10(int) Bitcast 158 Store 157(r005) 159 - 161: 6(float) Load 11(inF0) + 161: 10(int) Load 17(inU1) 162: 8(int) Bitcast 161 Store 160(r006) 162 - 164: 8(int) Load 14(inU0) + 164: 8(int) Load 16(inU0) 165: 6(float) Bitcast 164 Store 163(r007) 165 - 167: 6(float) Load 11(inF0) + 167: 6(float) Load 13(inF0) 168: 6(float) ExtInst 1(GLSL.std.450) 18(Atan) 167 Store 166(r009) 168 - 170: 6(float) Load 11(inF0) - 171: 6(float) Load 12(inF1) + 170: 6(float) Load 13(inF0) + 171: 6(float) Load 14(inF1) 172: 6(float) ExtInst 1(GLSL.std.450) 25(Atan2) 170 171 Store 169(r010) 172 - 174: 6(float) Load 11(inF0) + 174: 6(float) Load 13(inF0) 175: 6(float) ExtInst 1(GLSL.std.450) 9(Ceil) 174 Store 173(r011) 175 - 177: 6(float) Load 11(inF0) - 178: 6(float) Load 12(inF1) - 179: 6(float) Load 13(inF2) + 177: 6(float) Load 13(inF0) + 178: 6(float) Load 14(inF1) + 179: 6(float) Load 15(inF2) 180: 6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 177 178 179 Store 176(r012) 180 - 181: 6(float) Load 11(inF0) - 182: 135(bool) FOrdLessThan 181 139 + 181: 6(float) Load 13(inF0) + 182: 137(bool) FOrdLessThan 181 141 SelectionMerge 184 None BranchConditional 182 183 184 183: Label Kill 184: Label - 186: 155(int) Load 157(r005) - 188: 135(bool) SLessThan 186 187 + 186: 10(int) Load 157(r005) + 188: 137(bool) SLessThan 186 187 SelectionMerge 190 None BranchConditional 188 189 190 189: Label Kill 190: Label - 193: 6(float) Load 11(inF0) + 193: 6(float) Load 13(inF0) 194: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 193 Store 192(r014) 194 - 196: 6(float) Load 11(inF0) + 196: 6(float) Load 13(inF0) 197: 6(float) ExtInst 1(GLSL.std.450) 20(Cosh) 196 Store 195(r015) 197 - 200: 155(int) BitCount 199 + 200: 10(int) BitCount 199 Store 198(r016) 200 - 202: 6(float) Load 11(inF0) + 202: 6(float) Load 13(inF0) 203: 6(float) DPdx 202 Store 201(r017) 203 - 205: 6(float) Load 11(inF0) + 205: 6(float) Load 13(inF0) 206: 6(float) DPdxCoarse 205 Store 204(r018) 206 - 208: 6(float) Load 11(inF0) + 208: 6(float) Load 13(inF0) 209: 6(float) DPdxFine 208 Store 207(r019) 209 - 211: 6(float) Load 11(inF0) + 211: 6(float) Load 13(inF0) 212: 6(float) DPdy 211 Store 210(r020) 212 - 214: 6(float) Load 11(inF0) + 214: 6(float) Load 13(inF0) 215: 6(float) DPdyCoarse 214 Store 213(r021) 215 - 217: 6(float) Load 11(inF0) + 217: 6(float) Load 13(inF0) 218: 6(float) DPdyFine 217 Store 216(r022) 218 - 220: 6(float) Load 11(inF0) + 220: 6(float) Load 13(inF0) 221: 6(float) ExtInst 1(GLSL.std.450) 12(Degrees) 220 Store 219(r023) 221 - 223: 6(float) Load 11(inF0) + 223: 6(float) Load 13(inF0) 224: 6(float) ExtInst 1(GLSL.std.450) 27(Exp) 223 Store 222(r027) 224 - 226: 6(float) Load 11(inF0) + 226: 6(float) Load 13(inF0) 227: 6(float) ExtInst 1(GLSL.std.450) 29(Exp2) 226 Store 225(r028) 227 - 229: 155(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 199 + 229: 10(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 199 230: 8(int) Bitcast 229 Store 228(r029) 230 - 232: 155(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 199 + 232: 10(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 199 233: 8(int) Bitcast 232 Store 231(r030) 233 - 235: 6(float) Load 11(inF0) + 235: 6(float) Load 13(inF0) 236: 6(float) ExtInst 1(GLSL.std.450) 8(Floor) 235 Store 234(r031) 236 - 238: 6(float) Load 11(inF0) - 239: 6(float) Load 12(inF1) + 238: 6(float) Load 13(inF0) + 239: 6(float) Load 14(inF1) 240: 6(float) FMod 238 239 Store 237(r033) 240 - 242: 6(float) Load 11(inF0) + 242: 6(float) Load 13(inF0) 243: 6(float) ExtInst 1(GLSL.std.450) 10(Fract) 242 Store 241(r034) 243 - 245: 6(float) Load 11(inF0) + 245: 6(float) Load 13(inF0) 246: 6(float) Fwidth 245 Store 244(r036) 246 - 248: 6(float) Load 11(inF0) - 249: 135(bool) IsInf 248 + 248: 6(float) Load 13(inF0) + 249: 137(bool) IsInf 248 Store 247(r037) 249 - 251: 6(float) Load 11(inF0) - 252: 135(bool) IsNan 251 + 251: 6(float) Load 13(inF0) + 252: 137(bool) IsNan 251 Store 250(r038) 252 - 254: 6(float) Load 11(inF0) - 255: 6(float) Load 12(inF1) + 254: 6(float) Load 13(inF0) + 255: 6(float) Load 14(inF1) 256: 6(float) ExtInst 1(GLSL.std.450) 53(Ldexp) 254 255 Store 253(r039) 256 - 258: 6(float) Load 11(inF0) - 259: 6(float) Load 12(inF1) - 260: 6(float) Load 13(inF2) + 258: 6(float) Load 13(inF0) + 259: 6(float) Load 14(inF1) + 260: 6(float) Load 15(inF2) 261: 6(float) ExtInst 1(GLSL.std.450) 46(FMix) 258 259 260 Store 257(r039a) 261 - 263: 6(float) Load 11(inF0) + 263: 6(float) Load 13(inF0) 264: 6(float) ExtInst 1(GLSL.std.450) 28(Log) 263 Store 262(r040) 264 - 266: 6(float) Load 11(inF0) + 266: 6(float) Load 13(inF0) 267: 6(float) ExtInst 1(GLSL.std.450) 30(Log2) 266 269: 6(float) FMul 267 268 Store 265(r041) 269 - 271: 6(float) Load 11(inF0) + 271: 6(float) Load 13(inF0) 272: 6(float) ExtInst 1(GLSL.std.450) 30(Log2) 271 Store 270(r042) 272 - 274: 6(float) Load 11(inF0) - 275: 6(float) Load 12(inF1) + 274: 6(float) Load 13(inF0) + 275: 6(float) Load 14(inF1) 276: 6(float) ExtInst 1(GLSL.std.450) 40(FMax) 274 275 Store 273(r043) 276 - 278: 6(float) Load 11(inF0) - 279: 6(float) Load 12(inF1) + 278: 6(float) Load 13(inF0) + 279: 6(float) Load 14(inF1) 280: 6(float) ExtInst 1(GLSL.std.450) 37(FMin) 278 279 Store 277(r044) 280 - 282: 6(float) Load 11(inF0) - 283: 6(float) Load 12(inF1) + 282: 6(float) Load 13(inF0) + 283: 6(float) Load 14(inF1) 284: 6(float) ExtInst 1(GLSL.std.450) 26(Pow) 282 283 Store 281(r045) 284 - 286: 6(float) Load 11(inF0) + 286: 6(float) Load 13(inF0) 287: 6(float) ExtInst 1(GLSL.std.450) 11(Radians) 286 Store 285(r046) 287 - 290: 6(float) Load 11(inF0) + 290: 6(float) Load 13(inF0) 291: 6(float) FDiv 289 290 Store 288(r047) 291 - 294: 155(int) BitReverse 293 + 294: 10(int) BitReverse 293 295: 8(int) Bitcast 294 Store 292(r048) 295 - 297: 6(float) Load 11(inF0) + 297: 6(float) Load 13(inF0) 298: 6(float) ExtInst 1(GLSL.std.450) 2(RoundEven) 297 Store 296(r049) 298 - 300: 6(float) Load 11(inF0) + 300: 6(float) Load 13(inF0) 301: 6(float) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 300 Store 299(r050) 301 - 303: 6(float) Load 11(inF0) - 304: 6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 303 139 289 + 303: 6(float) Load 13(inF0) + 304: 6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 303 141 289 Store 302(r051) 304 - 306: 6(float) Load 11(inF0) + 306: 6(float) Load 13(inF0) 307: 6(float) ExtInst 1(GLSL.std.450) 6(FSign) 306 Store 305(r052) 307 - 309: 6(float) Load 11(inF0) + 309: 6(float) Load 13(inF0) 310: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 309 Store 308(r053) 310 - 311: 6(float) Load 11(inF0) + 311: 6(float) Load 13(inF0) 312: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 311 - Store 12(inF1) 312 - 313: 6(float) Load 11(inF0) + Store 14(inF1) 312 + 313: 6(float) Load 13(inF0) 314: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 313 - Store 13(inF2) 314 - 316: 6(float) Load 11(inF0) + Store 15(inF2) 314 + 316: 6(float) Load 13(inF0) 317: 6(float) ExtInst 1(GLSL.std.450) 19(Sinh) 316 Store 315(r055) 317 - 319: 6(float) Load 11(inF0) - 320: 6(float) Load 12(inF1) - 321: 6(float) Load 13(inF2) + 319: 6(float) Load 13(inF0) + 320: 6(float) Load 14(inF1) + 321: 6(float) Load 15(inF2) 322: 6(float) ExtInst 1(GLSL.std.450) 49(SmoothStep) 319 320 321 Store 318(r056) 322 - 324: 6(float) Load 11(inF0) + 324: 6(float) Load 13(inF0) 325: 6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 324 Store 323(r057) 325 - 327: 6(float) Load 11(inF0) - 328: 6(float) Load 12(inF1) + 327: 6(float) Load 13(inF0) + 328: 6(float) Load 14(inF1) 329: 6(float) ExtInst 1(GLSL.std.450) 48(Step) 327 328 Store 326(r058) 329 - 331: 6(float) Load 11(inF0) + 331: 6(float) Load 13(inF0) 332: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 331 Store 330(r059) 332 - 334: 6(float) Load 11(inF0) + 334: 6(float) Load 13(inF0) 335: 6(float) ExtInst 1(GLSL.std.450) 21(Tanh) 334 Store 333(r060) 335 - 337: 6(float) Load 11(inF0) + 337: 6(float) Load 13(inF0) 338: 6(float) ExtInst 1(GLSL.std.450) 3(Trunc) 337 Store 336(r061) 338 - ReturnValue 139 + ReturnValue 141 FunctionEnd -22(PixelShaderFunction1(vf1;vf1;vf1;): 6(float) Function None 18 - 19(inF0): 7(ptr) FunctionParameter - 20(inF1): 7(ptr) FunctionParameter - 21(inF2): 7(ptr) FunctionParameter - 23: Label - ReturnValue 139 +24(PixelShaderFunction1(vf1;vf1;vf1;): 6(float) Function None 20 + 21(inF0): 7(ptr) FunctionParameter + 22(inF1): 7(ptr) FunctionParameter + 23(inF2): 7(ptr) FunctionParameter + 25: Label + ReturnValue 141 FunctionEnd -34(PixelShaderFunction2(vf2;vf2;vf2;vu2;vu2;): 24(fvec2) Function None 28 - 29(inF0): 25(ptr) FunctionParameter - 30(inF1): 25(ptr) FunctionParameter - 31(inF2): 25(ptr) FunctionParameter - 32(inU0): 27(ptr) FunctionParameter - 33(inU1): 27(ptr) FunctionParameter - 35: Label - 343(r000): 136(ptr) Variable Function - 349(r001): 25(ptr) Variable Function - 352(r002): 25(ptr) Variable Function - 355(r003): 136(ptr) Variable Function - 359(r004): 25(ptr) Variable Function +36(PixelShaderFunction2(vf2;vf2;vf2;vu2;vu2;): 26(fvec2) Function None 30 + 31(inF0): 27(ptr) FunctionParameter + 32(inF1): 27(ptr) FunctionParameter + 33(inF2): 27(ptr) FunctionParameter + 34(inU0): 29(ptr) FunctionParameter + 35(inU1): 29(ptr) FunctionParameter + 37: Label + 343(r000): 138(ptr) Variable Function + 349(r001): 27(ptr) Variable Function + 352(r002): 27(ptr) Variable Function + 355(r003): 138(ptr) Variable Function + 359(r004): 27(ptr) Variable Function 364(r005): 363(ptr) Variable Function - 367(r006): 27(ptr) Variable Function - 370(r007): 25(ptr) Variable Function - 373(r009): 25(ptr) Variable Function - 376(r010): 25(ptr) Variable Function - 380(r011): 25(ptr) Variable Function - 383(r012): 25(ptr) Variable Function - 402(r013): 25(ptr) Variable Function - 405(r015): 25(ptr) Variable Function + 367(r006): 29(ptr) Variable Function + 370(r007): 27(ptr) Variable Function + 373(r009): 27(ptr) Variable Function + 376(r010): 27(ptr) Variable Function + 380(r011): 27(ptr) Variable Function + 383(r012): 27(ptr) Variable Function + 402(r013): 27(ptr) Variable Function + 405(r015): 27(ptr) Variable Function 408(r016): 363(ptr) Variable Function - 412(r017): 25(ptr) Variable Function - 415(r018): 25(ptr) Variable Function - 418(r019): 25(ptr) Variable Function - 421(r020): 25(ptr) Variable Function - 424(r021): 25(ptr) Variable Function - 427(r022): 25(ptr) Variable Function - 430(r023): 25(ptr) Variable Function + 412(r017): 27(ptr) Variable Function + 415(r018): 27(ptr) Variable Function + 418(r019): 27(ptr) Variable Function + 421(r020): 27(ptr) Variable Function + 424(r021): 27(ptr) Variable Function + 427(r022): 27(ptr) Variable Function + 430(r023): 27(ptr) Variable Function 433(r026): 7(ptr) Variable Function 437(r027): 7(ptr) Variable Function - 441(r028): 25(ptr) Variable Function - 444(r029): 25(ptr) Variable Function - 447(r030): 25(ptr) Variable Function - 452(r031): 27(ptr) Variable Function - 457(r032): 27(ptr) Variable Function - 459(r033): 25(ptr) Variable Function - 462(r035): 25(ptr) Variable Function - 466(r036): 25(ptr) Variable Function - 469(r038): 25(ptr) Variable Function + 441(r028): 27(ptr) Variable Function + 444(r029): 27(ptr) Variable Function + 447(r030): 27(ptr) Variable Function + 452(r031): 29(ptr) Variable Function + 457(r032): 29(ptr) Variable Function + 459(r033): 27(ptr) Variable Function + 462(r035): 27(ptr) Variable Function + 466(r036): 27(ptr) Variable Function + 469(r038): 27(ptr) Variable Function 473(r039): 472(ptr) Variable Function 476(r040): 472(ptr) Variable Function - 479(r041): 25(ptr) Variable Function - 483(r039a): 25(ptr) Variable Function + 479(r041): 27(ptr) Variable Function + 483(r039a): 27(ptr) Variable Function 488(r042): 7(ptr) Variable Function - 491(r043): 25(ptr) Variable Function - 494(r044): 25(ptr) Variable Function - 498(r045): 25(ptr) Variable Function - 501(r046): 25(ptr) Variable Function - 505(r047): 25(ptr) Variable Function - 509(r048): 25(ptr) Variable Function - 512(r049): 25(ptr) Variable Function - 516(r050): 25(ptr) Variable Function - 519(r051): 25(ptr) Variable Function - 523(r052): 25(ptr) Variable Function - 527(r053): 25(ptr) Variable Function - 532(r054): 27(ptr) Variable Function - 537(r055): 25(ptr) Variable Function - 540(r056): 25(ptr) Variable Function - 543(r057): 25(ptr) Variable Function - 548(r058): 25(ptr) Variable Function - 551(r059): 25(ptr) Variable Function - 558(r060): 25(ptr) Variable Function - 561(r061): 25(ptr) Variable Function - 566(r062): 25(ptr) Variable Function - 569(r063): 25(ptr) Variable Function - 573(r064): 25(ptr) Variable Function - 576(r065): 25(ptr) Variable Function - 579(r066): 25(ptr) Variable Function - 344: 24(fvec2) Load 29(inF0) + 491(r043): 27(ptr) Variable Function + 494(r044): 27(ptr) Variable Function + 498(r045): 27(ptr) Variable Function + 501(r046): 27(ptr) Variable Function + 505(r047): 27(ptr) Variable Function + 509(r048): 27(ptr) Variable Function + 512(r049): 27(ptr) Variable Function + 516(r050): 27(ptr) Variable Function + 519(r051): 27(ptr) Variable Function + 523(r052): 27(ptr) Variable Function + 527(r053): 27(ptr) Variable Function + 532(r054): 29(ptr) Variable Function + 537(r055): 27(ptr) Variable Function + 540(r056): 27(ptr) Variable Function + 543(r057): 27(ptr) Variable Function + 548(r058): 27(ptr) Variable Function + 551(r059): 27(ptr) Variable Function + 558(r060): 27(ptr) Variable Function + 561(r061): 27(ptr) Variable Function + 566(r062): 27(ptr) Variable Function + 569(r063): 27(ptr) Variable Function + 573(r064): 27(ptr) Variable Function + 576(r065): 27(ptr) Variable Function + 579(r066): 27(ptr) Variable Function + 344: 26(fvec2) Load 31(inF0) 347: 345(bvec2) FOrdNotEqual 344 346 - 348: 135(bool) All 347 + 348: 137(bool) All 347 Store 343(r000) 348 - 350: 24(fvec2) Load 29(inF0) - 351: 24(fvec2) ExtInst 1(GLSL.std.450) 4(FAbs) 350 + 350: 26(fvec2) Load 31(inF0) + 351: 26(fvec2) ExtInst 1(GLSL.std.450) 4(FAbs) 350 Store 349(r001) 351 - 353: 24(fvec2) Load 29(inF0) - 354: 24(fvec2) ExtInst 1(GLSL.std.450) 17(Acos) 353 + 353: 26(fvec2) Load 31(inF0) + 354: 26(fvec2) ExtInst 1(GLSL.std.450) 17(Acos) 353 Store 352(r002) 354 - 356: 24(fvec2) Load 29(inF0) + 356: 26(fvec2) Load 31(inF0) 357: 345(bvec2) FOrdNotEqual 356 346 - 358: 135(bool) Any 357 + 358: 137(bool) Any 357 Store 355(r003) 358 - 360: 24(fvec2) Load 29(inF0) - 361: 24(fvec2) ExtInst 1(GLSL.std.450) 16(Asin) 360 + 360: 26(fvec2) Load 31(inF0) + 361: 26(fvec2) ExtInst 1(GLSL.std.450) 16(Asin) 360 Store 359(r004) 361 - 365: 24(fvec2) Load 29(inF0) + 365: 26(fvec2) Load 31(inF0) 366: 362(ivec2) Bitcast 365 Store 364(r005) 366 - 368: 24(fvec2) Load 29(inF0) - 369: 26(ivec2) Bitcast 368 + 368: 26(fvec2) Load 31(inF0) + 369: 28(ivec2) Bitcast 368 Store 367(r006) 369 - 371: 26(ivec2) Load 32(inU0) - 372: 24(fvec2) Bitcast 371 + 371: 28(ivec2) Load 34(inU0) + 372: 26(fvec2) Bitcast 371 Store 370(r007) 372 - 374: 24(fvec2) Load 29(inF0) - 375: 24(fvec2) ExtInst 1(GLSL.std.450) 18(Atan) 374 + 374: 26(fvec2) Load 31(inF0) + 375: 26(fvec2) ExtInst 1(GLSL.std.450) 18(Atan) 374 Store 373(r009) 375 - 377: 24(fvec2) Load 29(inF0) - 378: 24(fvec2) Load 30(inF1) - 379: 24(fvec2) ExtInst 1(GLSL.std.450) 25(Atan2) 377 378 + 377: 26(fvec2) Load 31(inF0) + 378: 26(fvec2) Load 32(inF1) + 379: 26(fvec2) ExtInst 1(GLSL.std.450) 25(Atan2) 377 378 Store 376(r010) 379 - 381: 24(fvec2) Load 29(inF0) - 382: 24(fvec2) ExtInst 1(GLSL.std.450) 9(Ceil) 381 + 381: 26(fvec2) Load 31(inF0) + 382: 26(fvec2) ExtInst 1(GLSL.std.450) 9(Ceil) 381 Store 380(r011) 382 - 384: 24(fvec2) Load 29(inF0) - 385: 24(fvec2) Load 30(inF1) - 386: 24(fvec2) Load 31(inF2) - 387: 24(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 384 385 386 + 384: 26(fvec2) Load 31(inF0) + 385: 26(fvec2) Load 32(inF1) + 386: 26(fvec2) Load 33(inF2) + 387: 26(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 384 385 386 Store 383(r012) 387 - 388: 24(fvec2) Load 29(inF0) + 388: 26(fvec2) Load 31(inF0) 389: 345(bvec2) FOrdLessThan 388 346 - 390: 135(bool) Any 389 + 390: 137(bool) Any 389 SelectionMerge 392 None BranchConditional 390 391 392 391: Label Kill 392: Label - 394: 26(ivec2) Load 32(inU0) + 394: 28(ivec2) Load 34(inU0) 397: 345(bvec2) ULessThan 394 396 - 398: 135(bool) Any 397 + 398: 137(bool) Any 397 SelectionMerge 400 None BranchConditional 398 399 400 399: Label Kill 400: Label - 403: 24(fvec2) Load 29(inF0) - 404: 24(fvec2) ExtInst 1(GLSL.std.450) 14(Cos) 403 + 403: 26(fvec2) Load 31(inF0) + 404: 26(fvec2) ExtInst 1(GLSL.std.450) 14(Cos) 403 Store 402(r013) 404 - 406: 24(fvec2) Load 29(inF0) - 407: 24(fvec2) ExtInst 1(GLSL.std.450) 20(Cosh) 406 + 406: 26(fvec2) Load 31(inF0) + 407: 26(fvec2) ExtInst 1(GLSL.std.450) 20(Cosh) 406 Store 405(r015) 407 411: 362(ivec2) BitCount 410 Store 408(r016) 411 - 413: 24(fvec2) Load 29(inF0) - 414: 24(fvec2) DPdx 413 + 413: 26(fvec2) Load 31(inF0) + 414: 26(fvec2) DPdx 413 Store 412(r017) 414 - 416: 24(fvec2) Load 29(inF0) - 417: 24(fvec2) DPdxCoarse 416 + 416: 26(fvec2) Load 31(inF0) + 417: 26(fvec2) DPdxCoarse 416 Store 415(r018) 417 - 419: 24(fvec2) Load 29(inF0) - 420: 24(fvec2) DPdxFine 419 + 419: 26(fvec2) Load 31(inF0) + 420: 26(fvec2) DPdxFine 419 Store 418(r019) 420 - 422: 24(fvec2) Load 29(inF0) - 423: 24(fvec2) DPdy 422 + 422: 26(fvec2) Load 31(inF0) + 423: 26(fvec2) DPdy 422 Store 421(r020) 423 - 425: 24(fvec2) Load 29(inF0) - 426: 24(fvec2) DPdyCoarse 425 + 425: 26(fvec2) Load 31(inF0) + 426: 26(fvec2) DPdyCoarse 425 Store 424(r021) 426 - 428: 24(fvec2) Load 29(inF0) - 429: 24(fvec2) DPdyFine 428 + 428: 26(fvec2) Load 31(inF0) + 429: 26(fvec2) DPdyFine 428 Store 427(r022) 429 - 431: 24(fvec2) Load 29(inF0) - 432: 24(fvec2) ExtInst 1(GLSL.std.450) 12(Degrees) 431 + 431: 26(fvec2) Load 31(inF0) + 432: 26(fvec2) ExtInst 1(GLSL.std.450) 12(Degrees) 431 Store 430(r023) 432 - 434: 24(fvec2) Load 29(inF0) - 435: 24(fvec2) Load 30(inF1) + 434: 26(fvec2) Load 31(inF0) + 435: 26(fvec2) Load 32(inF1) 436: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 434 435 Store 433(r026) 436 - 438: 24(fvec2) Load 29(inF0) - 439: 24(fvec2) Load 30(inF1) + 438: 26(fvec2) Load 31(inF0) + 439: 26(fvec2) Load 32(inF1) 440: 6(float) Dot 438 439 Store 437(r027) 440 - 442: 24(fvec2) Load 29(inF0) - 443: 24(fvec2) ExtInst 1(GLSL.std.450) 27(Exp) 442 + 442: 26(fvec2) Load 31(inF0) + 443: 26(fvec2) ExtInst 1(GLSL.std.450) 27(Exp) 442 Store 441(r028) 443 - 445: 24(fvec2) Load 29(inF0) - 446: 24(fvec2) ExtInst 1(GLSL.std.450) 29(Exp2) 445 + 445: 26(fvec2) Load 31(inF0) + 446: 26(fvec2) ExtInst 1(GLSL.std.450) 29(Exp2) 445 Store 444(r029) 446 - 448: 24(fvec2) Load 29(inF0) - 449: 24(fvec2) Load 30(inF1) - 450: 24(fvec2) Load 31(inF2) - 451: 24(fvec2) ExtInst 1(GLSL.std.450) 70(FaceForward) 448 449 450 + 448: 26(fvec2) Load 31(inF0) + 449: 26(fvec2) Load 32(inF1) + 450: 26(fvec2) Load 33(inF2) + 451: 26(fvec2) ExtInst 1(GLSL.std.450) 70(FaceForward) 448 449 450 Store 447(r030) 451 - 456: 26(ivec2) ExtInst 1(GLSL.std.450) 75(FindUMsb) 455 + 456: 28(ivec2) ExtInst 1(GLSL.std.450) 75(FindUMsb) 455 Store 452(r031) 456 - 458: 26(ivec2) ExtInst 1(GLSL.std.450) 73(FindILsb) 455 + 458: 28(ivec2) ExtInst 1(GLSL.std.450) 73(FindILsb) 455 Store 457(r032) 458 - 460: 24(fvec2) Load 29(inF0) - 461: 24(fvec2) ExtInst 1(GLSL.std.450) 8(Floor) 460 + 460: 26(fvec2) Load 31(inF0) + 461: 26(fvec2) ExtInst 1(GLSL.std.450) 8(Floor) 460 Store 459(r033) 461 - 463: 24(fvec2) Load 29(inF0) - 464: 24(fvec2) Load 30(inF1) - 465: 24(fvec2) FMod 463 464 + 463: 26(fvec2) Load 31(inF0) + 464: 26(fvec2) Load 32(inF1) + 465: 26(fvec2) FMod 463 464 Store 462(r035) 465 - 467: 24(fvec2) Load 29(inF0) - 468: 24(fvec2) ExtInst 1(GLSL.std.450) 10(Fract) 467 + 467: 26(fvec2) Load 31(inF0) + 468: 26(fvec2) ExtInst 1(GLSL.std.450) 10(Fract) 467 Store 466(r036) 468 - 470: 24(fvec2) Load 29(inF0) - 471: 24(fvec2) Fwidth 470 + 470: 26(fvec2) Load 31(inF0) + 471: 26(fvec2) Fwidth 470 Store 469(r038) 471 - 474: 24(fvec2) Load 29(inF0) + 474: 26(fvec2) Load 31(inF0) 475: 345(bvec2) IsInf 474 Store 473(r039) 475 - 477: 24(fvec2) Load 29(inF0) + 477: 26(fvec2) Load 31(inF0) 478: 345(bvec2) IsNan 477 Store 476(r040) 478 - 480: 24(fvec2) Load 29(inF0) - 481: 24(fvec2) Load 30(inF1) - 482: 24(fvec2) ExtInst 1(GLSL.std.450) 53(Ldexp) 480 481 + 480: 26(fvec2) Load 31(inF0) + 481: 26(fvec2) Load 32(inF1) + 482: 26(fvec2) ExtInst 1(GLSL.std.450) 53(Ldexp) 480 481 Store 479(r041) 482 - 484: 24(fvec2) Load 29(inF0) - 485: 24(fvec2) Load 30(inF1) - 486: 24(fvec2) Load 31(inF2) - 487: 24(fvec2) ExtInst 1(GLSL.std.450) 46(FMix) 484 485 486 + 484: 26(fvec2) Load 31(inF0) + 485: 26(fvec2) Load 32(inF1) + 486: 26(fvec2) Load 33(inF2) + 487: 26(fvec2) ExtInst 1(GLSL.std.450) 46(FMix) 484 485 486 Store 483(r039a) 487 - 489: 24(fvec2) Load 29(inF0) + 489: 26(fvec2) Load 31(inF0) 490: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 489 Store 488(r042) 490 - 492: 24(fvec2) Load 29(inF0) - 493: 24(fvec2) ExtInst 1(GLSL.std.450) 28(Log) 492 + 492: 26(fvec2) Load 31(inF0) + 493: 26(fvec2) ExtInst 1(GLSL.std.450) 28(Log) 492 Store 491(r043) 493 - 495: 24(fvec2) Load 29(inF0) - 496: 24(fvec2) ExtInst 1(GLSL.std.450) 30(Log2) 495 - 497: 24(fvec2) VectorTimesScalar 496 268 + 495: 26(fvec2) Load 31(inF0) + 496: 26(fvec2) ExtInst 1(GLSL.std.450) 30(Log2) 495 + 497: 26(fvec2) VectorTimesScalar 496 268 Store 494(r044) 497 - 499: 24(fvec2) Load 29(inF0) - 500: 24(fvec2) ExtInst 1(GLSL.std.450) 30(Log2) 499 + 499: 26(fvec2) Load 31(inF0) + 500: 26(fvec2) ExtInst 1(GLSL.std.450) 30(Log2) 499 Store 498(r045) 500 - 502: 24(fvec2) Load 29(inF0) - 503: 24(fvec2) Load 30(inF1) - 504: 24(fvec2) ExtInst 1(GLSL.std.450) 40(FMax) 502 503 + 502: 26(fvec2) Load 31(inF0) + 503: 26(fvec2) Load 32(inF1) + 504: 26(fvec2) ExtInst 1(GLSL.std.450) 40(FMax) 502 503 Store 501(r046) 504 - 506: 24(fvec2) Load 29(inF0) - 507: 24(fvec2) Load 30(inF1) - 508: 24(fvec2) ExtInst 1(GLSL.std.450) 37(FMin) 506 507 + 506: 26(fvec2) Load 31(inF0) + 507: 26(fvec2) Load 32(inF1) + 508: 26(fvec2) ExtInst 1(GLSL.std.450) 37(FMin) 506 507 Store 505(r047) 508 - 510: 24(fvec2) Load 29(inF0) - 511: 24(fvec2) ExtInst 1(GLSL.std.450) 69(Normalize) 510 + 510: 26(fvec2) Load 31(inF0) + 511: 26(fvec2) ExtInst 1(GLSL.std.450) 69(Normalize) 510 Store 509(r048) 511 - 513: 24(fvec2) Load 29(inF0) - 514: 24(fvec2) Load 30(inF1) - 515: 24(fvec2) ExtInst 1(GLSL.std.450) 26(Pow) 513 514 + 513: 26(fvec2) Load 31(inF0) + 514: 26(fvec2) Load 32(inF1) + 515: 26(fvec2) ExtInst 1(GLSL.std.450) 26(Pow) 513 514 Store 512(r049) 515 - 517: 24(fvec2) Load 29(inF0) - 518: 24(fvec2) ExtInst 1(GLSL.std.450) 11(Radians) 517 + 517: 26(fvec2) Load 31(inF0) + 518: 26(fvec2) ExtInst 1(GLSL.std.450) 11(Radians) 517 Store 516(r050) 518 - 520: 24(fvec2) Load 29(inF0) - 521: 24(fvec2) CompositeConstruct 289 289 - 522: 24(fvec2) FDiv 521 520 + 520: 26(fvec2) Load 31(inF0) + 521: 26(fvec2) CompositeConstruct 289 289 + 522: 26(fvec2) FDiv 521 520 Store 519(r051) 522 - 524: 24(fvec2) Load 29(inF0) - 525: 24(fvec2) Load 30(inF1) - 526: 24(fvec2) ExtInst 1(GLSL.std.450) 71(Reflect) 524 525 + 524: 26(fvec2) Load 31(inF0) + 525: 26(fvec2) Load 32(inF1) + 526: 26(fvec2) ExtInst 1(GLSL.std.450) 71(Reflect) 524 525 Store 523(r052) 526 - 528: 24(fvec2) Load 29(inF0) - 529: 24(fvec2) Load 30(inF1) - 531: 24(fvec2) ExtInst 1(GLSL.std.450) 72(Refract) 528 529 530 + 528: 26(fvec2) Load 31(inF0) + 529: 26(fvec2) Load 32(inF1) + 531: 26(fvec2) ExtInst 1(GLSL.std.450) 72(Refract) 528 529 530 Store 527(r053) 531 - 536: 26(ivec2) BitReverse 535 + 536: 28(ivec2) BitReverse 535 Store 532(r054) 536 - 538: 24(fvec2) Load 29(inF0) - 539: 24(fvec2) ExtInst 1(GLSL.std.450) 2(RoundEven) 538 + 538: 26(fvec2) Load 31(inF0) + 539: 26(fvec2) ExtInst 1(GLSL.std.450) 2(RoundEven) 538 Store 537(r055) 539 - 541: 24(fvec2) Load 29(inF0) - 542: 24(fvec2) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 541 + 541: 26(fvec2) Load 31(inF0) + 542: 26(fvec2) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 541 Store 540(r056) 542 - 544: 24(fvec2) Load 29(inF0) - 545: 24(fvec2) CompositeConstruct 139 139 - 546: 24(fvec2) CompositeConstruct 289 289 - 547: 24(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 544 545 546 + 544: 26(fvec2) Load 31(inF0) + 545: 26(fvec2) CompositeConstruct 141 141 + 546: 26(fvec2) CompositeConstruct 289 289 + 547: 26(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 544 545 546 Store 543(r057) 547 - 549: 24(fvec2) Load 29(inF0) - 550: 24(fvec2) ExtInst 1(GLSL.std.450) 6(FSign) 549 + 549: 26(fvec2) Load 31(inF0) + 550: 26(fvec2) ExtInst 1(GLSL.std.450) 6(FSign) 549 Store 548(r058) 550 - 552: 24(fvec2) Load 29(inF0) - 553: 24(fvec2) ExtInst 1(GLSL.std.450) 13(Sin) 552 + 552: 26(fvec2) Load 31(inF0) + 553: 26(fvec2) ExtInst 1(GLSL.std.450) 13(Sin) 552 Store 551(r059) 553 - 554: 24(fvec2) Load 29(inF0) - 555: 24(fvec2) ExtInst 1(GLSL.std.450) 13(Sin) 554 - Store 30(inF1) 555 - 556: 24(fvec2) Load 29(inF0) - 557: 24(fvec2) ExtInst 1(GLSL.std.450) 14(Cos) 556 - Store 31(inF2) 557 - 559: 24(fvec2) Load 29(inF0) - 560: 24(fvec2) ExtInst 1(GLSL.std.450) 19(Sinh) 559 + 554: 26(fvec2) Load 31(inF0) + 555: 26(fvec2) ExtInst 1(GLSL.std.450) 13(Sin) 554 + Store 32(inF1) 555 + 556: 26(fvec2) Load 31(inF0) + 557: 26(fvec2) ExtInst 1(GLSL.std.450) 14(Cos) 556 + Store 33(inF2) 557 + 559: 26(fvec2) Load 31(inF0) + 560: 26(fvec2) ExtInst 1(GLSL.std.450) 19(Sinh) 559 Store 558(r060) 560 - 562: 24(fvec2) Load 29(inF0) - 563: 24(fvec2) Load 30(inF1) - 564: 24(fvec2) Load 31(inF2) - 565: 24(fvec2) ExtInst 1(GLSL.std.450) 49(SmoothStep) 562 563 564 + 562: 26(fvec2) Load 31(inF0) + 563: 26(fvec2) Load 32(inF1) + 564: 26(fvec2) Load 33(inF2) + 565: 26(fvec2) ExtInst 1(GLSL.std.450) 49(SmoothStep) 562 563 564 Store 561(r061) 565 - 567: 24(fvec2) Load 29(inF0) - 568: 24(fvec2) ExtInst 1(GLSL.std.450) 31(Sqrt) 567 + 567: 26(fvec2) Load 31(inF0) + 568: 26(fvec2) ExtInst 1(GLSL.std.450) 31(Sqrt) 567 Store 566(r062) 568 - 570: 24(fvec2) Load 29(inF0) - 571: 24(fvec2) Load 30(inF1) - 572: 24(fvec2) ExtInst 1(GLSL.std.450) 48(Step) 570 571 + 570: 26(fvec2) Load 31(inF0) + 571: 26(fvec2) Load 32(inF1) + 572: 26(fvec2) ExtInst 1(GLSL.std.450) 48(Step) 570 571 Store 569(r063) 572 - 574: 24(fvec2) Load 29(inF0) - 575: 24(fvec2) ExtInst 1(GLSL.std.450) 15(Tan) 574 + 574: 26(fvec2) Load 31(inF0) + 575: 26(fvec2) ExtInst 1(GLSL.std.450) 15(Tan) 574 Store 573(r064) 575 - 577: 24(fvec2) Load 29(inF0) - 578: 24(fvec2) ExtInst 1(GLSL.std.450) 21(Tanh) 577 + 577: 26(fvec2) Load 31(inF0) + 578: 26(fvec2) ExtInst 1(GLSL.std.450) 21(Tanh) 577 Store 576(r065) 578 - 580: 24(fvec2) Load 29(inF0) - 581: 24(fvec2) ExtInst 1(GLSL.std.450) 3(Trunc) 580 + 580: 26(fvec2) Load 31(inF0) + 581: 26(fvec2) ExtInst 1(GLSL.std.450) 3(Trunc) 580 Store 579(r066) 581 ReturnValue 582 FunctionEnd -46(PixelShaderFunction3(vf3;vf3;vf3;vu3;vu3;): 36(fvec3) Function None 40 - 41(inF0): 37(ptr) FunctionParameter - 42(inF1): 37(ptr) FunctionParameter - 43(inF2): 37(ptr) FunctionParameter - 44(inU0): 39(ptr) FunctionParameter - 45(inU1): 39(ptr) FunctionParameter - 47: Label - 585(r000): 136(ptr) Variable Function - 591(r001): 37(ptr) Variable Function - 594(r002): 37(ptr) Variable Function - 597(r003): 136(ptr) Variable Function - 601(r004): 37(ptr) Variable Function +48(PixelShaderFunction3(vf3;vf3;vf3;vu3;vu3;): 38(fvec3) Function None 42 + 43(inF0): 39(ptr) FunctionParameter + 44(inF1): 39(ptr) FunctionParameter + 45(inF2): 39(ptr) FunctionParameter + 46(inU0): 41(ptr) FunctionParameter + 47(inU1): 41(ptr) FunctionParameter + 49: Label + 585(r000): 138(ptr) Variable Function + 591(r001): 39(ptr) Variable Function + 594(r002): 39(ptr) Variable Function + 597(r003): 138(ptr) Variable Function + 601(r004): 39(ptr) Variable Function 606(r005): 605(ptr) Variable Function - 609(r006): 39(ptr) Variable Function - 612(r007): 37(ptr) Variable Function - 615(r009): 37(ptr) Variable Function - 618(r010): 37(ptr) Variable Function - 622(r011): 37(ptr) Variable Function - 625(r012): 37(ptr) Variable Function - 643(r013): 37(ptr) Variable Function - 646(r014): 37(ptr) Variable Function - 649(r015): 39(ptr) Variable Function - 654(r016): 37(ptr) Variable Function - 658(r017): 37(ptr) Variable Function - 661(r018): 37(ptr) Variable Function - 664(r019): 37(ptr) Variable Function - 667(r020): 37(ptr) Variable Function - 670(r021): 37(ptr) Variable Function - 673(r022): 37(ptr) Variable Function - 676(r023): 37(ptr) Variable Function + 609(r006): 41(ptr) Variable Function + 612(r007): 39(ptr) Variable Function + 615(r009): 39(ptr) Variable Function + 618(r010): 39(ptr) Variable Function + 622(r011): 39(ptr) Variable Function + 625(r012): 39(ptr) Variable Function + 643(r013): 39(ptr) Variable Function + 646(r014): 39(ptr) Variable Function + 649(r015): 41(ptr) Variable Function + 654(r016): 39(ptr) Variable Function + 658(r017): 39(ptr) Variable Function + 661(r018): 39(ptr) Variable Function + 664(r019): 39(ptr) Variable Function + 667(r020): 39(ptr) Variable Function + 670(r021): 39(ptr) Variable Function + 673(r022): 39(ptr) Variable Function + 676(r023): 39(ptr) Variable Function 679(r024): 7(ptr) Variable Function 683(r025): 7(ptr) Variable Function - 687(r029): 37(ptr) Variable Function - 690(r030): 37(ptr) Variable Function - 693(r031): 37(ptr) Variable Function - 698(r032): 39(ptr) Variable Function - 702(r033): 39(ptr) Variable Function - 704(r034): 37(ptr) Variable Function - 707(r036): 37(ptr) Variable Function - 711(r037): 37(ptr) Variable Function - 714(r039): 37(ptr) Variable Function + 687(r029): 39(ptr) Variable Function + 690(r030): 39(ptr) Variable Function + 693(r031): 39(ptr) Variable Function + 698(r032): 41(ptr) Variable Function + 702(r033): 41(ptr) Variable Function + 704(r034): 39(ptr) Variable Function + 707(r036): 39(ptr) Variable Function + 711(r037): 39(ptr) Variable Function + 714(r039): 39(ptr) Variable Function 718(r040): 717(ptr) Variable Function 721(r041): 717(ptr) Variable Function - 724(r042): 37(ptr) Variable Function - 728(r039a): 37(ptr) Variable Function - 733(r039b): 37(ptr) Variable Function + 724(r042): 39(ptr) Variable Function + 728(r039a): 39(ptr) Variable Function + 733(r039b): 39(ptr) Variable Function 739(r043): 7(ptr) Variable Function - 742(r044): 37(ptr) Variable Function - 745(r045): 37(ptr) Variable Function - 749(r046): 37(ptr) Variable Function - 752(r047): 37(ptr) Variable Function - 756(r048): 37(ptr) Variable Function - 760(r049): 37(ptr) Variable Function - 763(r050): 37(ptr) Variable Function - 767(r051): 37(ptr) Variable Function - 770(r052): 37(ptr) Variable Function - 774(r053): 37(ptr) Variable Function - 778(r054): 37(ptr) Variable Function - 782(r055): 39(ptr) Variable Function - 785(r056): 37(ptr) Variable Function - 788(r057): 37(ptr) Variable Function - 791(r058): 37(ptr) Variable Function - 796(r059): 37(ptr) Variable Function - 799(r060): 37(ptr) Variable Function - 806(r061): 37(ptr) Variable Function - 809(r062): 37(ptr) Variable Function - 814(r063): 37(ptr) Variable Function - 817(r064): 37(ptr) Variable Function - 821(r065): 37(ptr) Variable Function - 824(r066): 37(ptr) Variable Function - 827(r067): 37(ptr) Variable Function - 586: 36(fvec3) Load 41(inF0) + 742(r044): 39(ptr) Variable Function + 745(r045): 39(ptr) Variable Function + 749(r046): 39(ptr) Variable Function + 752(r047): 39(ptr) Variable Function + 756(r048): 39(ptr) Variable Function + 760(r049): 39(ptr) Variable Function + 763(r050): 39(ptr) Variable Function + 767(r051): 39(ptr) Variable Function + 770(r052): 39(ptr) Variable Function + 774(r053): 39(ptr) Variable Function + 778(r054): 39(ptr) Variable Function + 782(r055): 41(ptr) Variable Function + 785(r056): 39(ptr) Variable Function + 788(r057): 39(ptr) Variable Function + 791(r058): 39(ptr) Variable Function + 796(r059): 39(ptr) Variable Function + 799(r060): 39(ptr) Variable Function + 806(r061): 39(ptr) Variable Function + 809(r062): 39(ptr) Variable Function + 814(r063): 39(ptr) Variable Function + 817(r064): 39(ptr) Variable Function + 821(r065): 39(ptr) Variable Function + 824(r066): 39(ptr) Variable Function + 827(r067): 39(ptr) Variable Function + 586: 38(fvec3) Load 43(inF0) 589: 587(bvec3) FOrdNotEqual 586 588 - 590: 135(bool) All 589 + 590: 137(bool) All 589 Store 585(r000) 590 - 592: 36(fvec3) Load 41(inF0) - 593: 36(fvec3) ExtInst 1(GLSL.std.450) 4(FAbs) 592 + 592: 38(fvec3) Load 43(inF0) + 593: 38(fvec3) ExtInst 1(GLSL.std.450) 4(FAbs) 592 Store 591(r001) 593 - 595: 36(fvec3) Load 41(inF0) - 596: 36(fvec3) ExtInst 1(GLSL.std.450) 17(Acos) 595 + 595: 38(fvec3) Load 43(inF0) + 596: 38(fvec3) ExtInst 1(GLSL.std.450) 17(Acos) 595 Store 594(r002) 596 - 598: 36(fvec3) Load 41(inF0) + 598: 38(fvec3) Load 43(inF0) 599: 587(bvec3) FOrdNotEqual 598 588 - 600: 135(bool) Any 599 + 600: 137(bool) Any 599 Store 597(r003) 600 - 602: 36(fvec3) Load 41(inF0) - 603: 36(fvec3) ExtInst 1(GLSL.std.450) 16(Asin) 602 + 602: 38(fvec3) Load 43(inF0) + 603: 38(fvec3) ExtInst 1(GLSL.std.450) 16(Asin) 602 Store 601(r004) 603 - 607: 36(fvec3) Load 41(inF0) + 607: 38(fvec3) Load 43(inF0) 608: 604(ivec3) Bitcast 607 Store 606(r005) 608 - 610: 36(fvec3) Load 41(inF0) - 611: 38(ivec3) Bitcast 610 + 610: 38(fvec3) Load 43(inF0) + 611: 40(ivec3) Bitcast 610 Store 609(r006) 611 - 613: 38(ivec3) Load 44(inU0) - 614: 36(fvec3) Bitcast 613 + 613: 40(ivec3) Load 46(inU0) + 614: 38(fvec3) Bitcast 613 Store 612(r007) 614 - 616: 36(fvec3) Load 41(inF0) - 617: 36(fvec3) ExtInst 1(GLSL.std.450) 18(Atan) 616 + 616: 38(fvec3) Load 43(inF0) + 617: 38(fvec3) ExtInst 1(GLSL.std.450) 18(Atan) 616 Store 615(r009) 617 - 619: 36(fvec3) Load 41(inF0) - 620: 36(fvec3) Load 42(inF1) - 621: 36(fvec3) ExtInst 1(GLSL.std.450) 25(Atan2) 619 620 + 619: 38(fvec3) Load 43(inF0) + 620: 38(fvec3) Load 44(inF1) + 621: 38(fvec3) ExtInst 1(GLSL.std.450) 25(Atan2) 619 620 Store 618(r010) 621 - 623: 36(fvec3) Load 41(inF0) - 624: 36(fvec3) ExtInst 1(GLSL.std.450) 9(Ceil) 623 + 623: 38(fvec3) Load 43(inF0) + 624: 38(fvec3) ExtInst 1(GLSL.std.450) 9(Ceil) 623 Store 622(r011) 624 - 626: 36(fvec3) Load 41(inF0) - 627: 36(fvec3) Load 42(inF1) - 628: 36(fvec3) Load 43(inF2) - 629: 36(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 626 627 628 + 626: 38(fvec3) Load 43(inF0) + 627: 38(fvec3) Load 44(inF1) + 628: 38(fvec3) Load 45(inF2) + 629: 38(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 626 627 628 Store 625(r012) 629 - 630: 36(fvec3) Load 41(inF0) + 630: 38(fvec3) Load 43(inF0) 631: 587(bvec3) FOrdLessThan 630 588 - 632: 135(bool) Any 631 + 632: 137(bool) Any 631 SelectionMerge 634 None BranchConditional 632 633 634 633: Label Kill 634: Label - 636: 38(ivec3) Load 44(inU0) + 636: 40(ivec3) Load 46(inU0) 638: 587(bvec3) ULessThan 636 637 - 639: 135(bool) Any 638 + 639: 137(bool) Any 638 SelectionMerge 641 None BranchConditional 639 640 641 640: Label Kill 641: Label - 644: 36(fvec3) Load 41(inF0) - 645: 36(fvec3) ExtInst 1(GLSL.std.450) 14(Cos) 644 + 644: 38(fvec3) Load 43(inF0) + 645: 38(fvec3) ExtInst 1(GLSL.std.450) 14(Cos) 644 Store 643(r013) 645 - 647: 36(fvec3) Load 41(inF0) - 648: 36(fvec3) ExtInst 1(GLSL.std.450) 20(Cosh) 647 + 647: 38(fvec3) Load 43(inF0) + 648: 38(fvec3) ExtInst 1(GLSL.std.450) 20(Cosh) 647 Store 646(r014) 648 - 653: 38(ivec3) BitCount 652 + 653: 40(ivec3) BitCount 652 Store 649(r015) 653 - 655: 36(fvec3) Load 41(inF0) - 656: 36(fvec3) Load 42(inF1) - 657: 36(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 655 656 + 655: 38(fvec3) Load 43(inF0) + 656: 38(fvec3) Load 44(inF1) + 657: 38(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 655 656 Store 654(r016) 657 - 659: 36(fvec3) Load 41(inF0) - 660: 36(fvec3) DPdx 659 + 659: 38(fvec3) Load 43(inF0) + 660: 38(fvec3) DPdx 659 Store 658(r017) 660 - 662: 36(fvec3) Load 41(inF0) - 663: 36(fvec3) DPdxCoarse 662 + 662: 38(fvec3) Load 43(inF0) + 663: 38(fvec3) DPdxCoarse 662 Store 661(r018) 663 - 665: 36(fvec3) Load 41(inF0) - 666: 36(fvec3) DPdxFine 665 + 665: 38(fvec3) Load 43(inF0) + 666: 38(fvec3) DPdxFine 665 Store 664(r019) 666 - 668: 36(fvec3) Load 41(inF0) - 669: 36(fvec3) DPdy 668 + 668: 38(fvec3) Load 43(inF0) + 669: 38(fvec3) DPdy 668 Store 667(r020) 669 - 671: 36(fvec3) Load 41(inF0) - 672: 36(fvec3) DPdyCoarse 671 + 671: 38(fvec3) Load 43(inF0) + 672: 38(fvec3) DPdyCoarse 671 Store 670(r021) 672 - 674: 36(fvec3) Load 41(inF0) - 675: 36(fvec3) DPdyFine 674 + 674: 38(fvec3) Load 43(inF0) + 675: 38(fvec3) DPdyFine 674 Store 673(r022) 675 - 677: 36(fvec3) Load 41(inF0) - 678: 36(fvec3) ExtInst 1(GLSL.std.450) 12(Degrees) 677 + 677: 38(fvec3) Load 43(inF0) + 678: 38(fvec3) ExtInst 1(GLSL.std.450) 12(Degrees) 677 Store 676(r023) 678 - 680: 36(fvec3) Load 41(inF0) - 681: 36(fvec3) Load 42(inF1) + 680: 38(fvec3) Load 43(inF0) + 681: 38(fvec3) Load 44(inF1) 682: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 680 681 Store 679(r024) 682 - 684: 36(fvec3) Load 41(inF0) - 685: 36(fvec3) Load 42(inF1) + 684: 38(fvec3) Load 43(inF0) + 685: 38(fvec3) Load 44(inF1) 686: 6(float) Dot 684 685 Store 683(r025) 686 - 688: 36(fvec3) Load 41(inF0) - 689: 36(fvec3) ExtInst 1(GLSL.std.450) 27(Exp) 688 + 688: 38(fvec3) Load 43(inF0) + 689: 38(fvec3) ExtInst 1(GLSL.std.450) 27(Exp) 688 Store 687(r029) 689 - 691: 36(fvec3) Load 41(inF0) - 692: 36(fvec3) ExtInst 1(GLSL.std.450) 29(Exp2) 691 + 691: 38(fvec3) Load 43(inF0) + 692: 38(fvec3) ExtInst 1(GLSL.std.450) 29(Exp2) 691 Store 690(r030) 692 - 694: 36(fvec3) Load 41(inF0) - 695: 36(fvec3) Load 42(inF1) - 696: 36(fvec3) Load 43(inF2) - 697: 36(fvec3) ExtInst 1(GLSL.std.450) 70(FaceForward) 694 695 696 + 694: 38(fvec3) Load 43(inF0) + 695: 38(fvec3) Load 44(inF1) + 696: 38(fvec3) Load 45(inF2) + 697: 38(fvec3) ExtInst 1(GLSL.std.450) 70(FaceForward) 694 695 696 Store 693(r031) 697 - 701: 38(ivec3) ExtInst 1(GLSL.std.450) 75(FindUMsb) 700 + 701: 40(ivec3) ExtInst 1(GLSL.std.450) 75(FindUMsb) 700 Store 698(r032) 701 - 703: 38(ivec3) ExtInst 1(GLSL.std.450) 73(FindILsb) 700 + 703: 40(ivec3) ExtInst 1(GLSL.std.450) 73(FindILsb) 700 Store 702(r033) 703 - 705: 36(fvec3) Load 41(inF0) - 706: 36(fvec3) ExtInst 1(GLSL.std.450) 8(Floor) 705 + 705: 38(fvec3) Load 43(inF0) + 706: 38(fvec3) ExtInst 1(GLSL.std.450) 8(Floor) 705 Store 704(r034) 706 - 708: 36(fvec3) Load 41(inF0) - 709: 36(fvec3) Load 42(inF1) - 710: 36(fvec3) FMod 708 709 + 708: 38(fvec3) Load 43(inF0) + 709: 38(fvec3) Load 44(inF1) + 710: 38(fvec3) FMod 708 709 Store 707(r036) 710 - 712: 36(fvec3) Load 41(inF0) - 713: 36(fvec3) ExtInst 1(GLSL.std.450) 10(Fract) 712 + 712: 38(fvec3) Load 43(inF0) + 713: 38(fvec3) ExtInst 1(GLSL.std.450) 10(Fract) 712 Store 711(r037) 713 - 715: 36(fvec3) Load 41(inF0) - 716: 36(fvec3) Fwidth 715 + 715: 38(fvec3) Load 43(inF0) + 716: 38(fvec3) Fwidth 715 Store 714(r039) 716 - 719: 36(fvec3) Load 41(inF0) + 719: 38(fvec3) Load 43(inF0) 720: 587(bvec3) IsInf 719 Store 718(r040) 720 - 722: 36(fvec3) Load 41(inF0) + 722: 38(fvec3) Load 43(inF0) 723: 587(bvec3) IsNan 722 Store 721(r041) 723 - 725: 36(fvec3) Load 41(inF0) - 726: 36(fvec3) Load 42(inF1) - 727: 36(fvec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 725 726 + 725: 38(fvec3) Load 43(inF0) + 726: 38(fvec3) Load 44(inF1) + 727: 38(fvec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 725 726 Store 724(r042) 727 - 729: 36(fvec3) Load 41(inF0) - 730: 36(fvec3) Load 42(inF1) - 731: 36(fvec3) Load 43(inF2) - 732: 36(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 729 730 731 + 729: 38(fvec3) Load 43(inF0) + 730: 38(fvec3) Load 44(inF1) + 731: 38(fvec3) Load 45(inF2) + 732: 38(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 729 730 731 Store 728(r039a) 732 - 734: 36(fvec3) Load 41(inF0) - 735: 36(fvec3) Load 42(inF1) - 737: 36(fvec3) CompositeConstruct 736 736 736 - 738: 36(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 734 735 737 + 734: 38(fvec3) Load 43(inF0) + 735: 38(fvec3) Load 44(inF1) + 737: 38(fvec3) CompositeConstruct 736 736 736 + 738: 38(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 734 735 737 Store 733(r039b) 738 - 740: 36(fvec3) Load 41(inF0) + 740: 38(fvec3) Load 43(inF0) 741: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 740 Store 739(r043) 741 - 743: 36(fvec3) Load 41(inF0) - 744: 36(fvec3) ExtInst 1(GLSL.std.450) 28(Log) 743 + 743: 38(fvec3) Load 43(inF0) + 744: 38(fvec3) ExtInst 1(GLSL.std.450) 28(Log) 743 Store 742(r044) 744 - 746: 36(fvec3) Load 41(inF0) - 747: 36(fvec3) ExtInst 1(GLSL.std.450) 30(Log2) 746 - 748: 36(fvec3) VectorTimesScalar 747 268 + 746: 38(fvec3) Load 43(inF0) + 747: 38(fvec3) ExtInst 1(GLSL.std.450) 30(Log2) 746 + 748: 38(fvec3) VectorTimesScalar 747 268 Store 745(r045) 748 - 750: 36(fvec3) Load 41(inF0) - 751: 36(fvec3) ExtInst 1(GLSL.std.450) 30(Log2) 750 + 750: 38(fvec3) Load 43(inF0) + 751: 38(fvec3) ExtInst 1(GLSL.std.450) 30(Log2) 750 Store 749(r046) 751 - 753: 36(fvec3) Load 41(inF0) - 754: 36(fvec3) Load 42(inF1) - 755: 36(fvec3) ExtInst 1(GLSL.std.450) 40(FMax) 753 754 + 753: 38(fvec3) Load 43(inF0) + 754: 38(fvec3) Load 44(inF1) + 755: 38(fvec3) ExtInst 1(GLSL.std.450) 40(FMax) 753 754 Store 752(r047) 755 - 757: 36(fvec3) Load 41(inF0) - 758: 36(fvec3) Load 42(inF1) - 759: 36(fvec3) ExtInst 1(GLSL.std.450) 37(FMin) 757 758 + 757: 38(fvec3) Load 43(inF0) + 758: 38(fvec3) Load 44(inF1) + 759: 38(fvec3) ExtInst 1(GLSL.std.450) 37(FMin) 757 758 Store 756(r048) 759 - 761: 36(fvec3) Load 41(inF0) - 762: 36(fvec3) ExtInst 1(GLSL.std.450) 69(Normalize) 761 + 761: 38(fvec3) Load 43(inF0) + 762: 38(fvec3) ExtInst 1(GLSL.std.450) 69(Normalize) 761 Store 760(r049) 762 - 764: 36(fvec3) Load 41(inF0) - 765: 36(fvec3) Load 42(inF1) - 766: 36(fvec3) ExtInst 1(GLSL.std.450) 26(Pow) 764 765 + 764: 38(fvec3) Load 43(inF0) + 765: 38(fvec3) Load 44(inF1) + 766: 38(fvec3) ExtInst 1(GLSL.std.450) 26(Pow) 764 765 Store 763(r050) 766 - 768: 36(fvec3) Load 41(inF0) - 769: 36(fvec3) ExtInst 1(GLSL.std.450) 11(Radians) 768 + 768: 38(fvec3) Load 43(inF0) + 769: 38(fvec3) ExtInst 1(GLSL.std.450) 11(Radians) 768 Store 767(r051) 769 - 771: 36(fvec3) Load 41(inF0) - 772: 36(fvec3) CompositeConstruct 289 289 289 - 773: 36(fvec3) FDiv 772 771 + 771: 38(fvec3) Load 43(inF0) + 772: 38(fvec3) CompositeConstruct 289 289 289 + 773: 38(fvec3) FDiv 772 771 Store 770(r052) 773 - 775: 36(fvec3) Load 41(inF0) - 776: 36(fvec3) Load 42(inF1) - 777: 36(fvec3) ExtInst 1(GLSL.std.450) 71(Reflect) 775 776 + 775: 38(fvec3) Load 43(inF0) + 776: 38(fvec3) Load 44(inF1) + 777: 38(fvec3) ExtInst 1(GLSL.std.450) 71(Reflect) 775 776 Store 774(r053) 777 - 779: 36(fvec3) Load 41(inF0) - 780: 36(fvec3) Load 42(inF1) - 781: 36(fvec3) ExtInst 1(GLSL.std.450) 72(Refract) 779 780 530 + 779: 38(fvec3) Load 43(inF0) + 780: 38(fvec3) Load 44(inF1) + 781: 38(fvec3) ExtInst 1(GLSL.std.450) 72(Refract) 779 780 530 Store 778(r054) 781 - 784: 38(ivec3) BitReverse 783 + 784: 40(ivec3) BitReverse 783 Store 782(r055) 784 - 786: 36(fvec3) Load 41(inF0) - 787: 36(fvec3) ExtInst 1(GLSL.std.450) 2(RoundEven) 786 + 786: 38(fvec3) Load 43(inF0) + 787: 38(fvec3) ExtInst 1(GLSL.std.450) 2(RoundEven) 786 Store 785(r056) 787 - 789: 36(fvec3) Load 41(inF0) - 790: 36(fvec3) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 789 + 789: 38(fvec3) Load 43(inF0) + 790: 38(fvec3) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 789 Store 788(r057) 790 - 792: 36(fvec3) Load 41(inF0) - 793: 36(fvec3) CompositeConstruct 139 139 139 - 794: 36(fvec3) CompositeConstruct 289 289 289 - 795: 36(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 792 793 794 + 792: 38(fvec3) Load 43(inF0) + 793: 38(fvec3) CompositeConstruct 141 141 141 + 794: 38(fvec3) CompositeConstruct 289 289 289 + 795: 38(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 792 793 794 Store 791(r058) 795 - 797: 36(fvec3) Load 41(inF0) - 798: 36(fvec3) ExtInst 1(GLSL.std.450) 6(FSign) 797 + 797: 38(fvec3) Load 43(inF0) + 798: 38(fvec3) ExtInst 1(GLSL.std.450) 6(FSign) 797 Store 796(r059) 798 - 800: 36(fvec3) Load 41(inF0) - 801: 36(fvec3) ExtInst 1(GLSL.std.450) 13(Sin) 800 + 800: 38(fvec3) Load 43(inF0) + 801: 38(fvec3) ExtInst 1(GLSL.std.450) 13(Sin) 800 Store 799(r060) 801 - 802: 36(fvec3) Load 41(inF0) - 803: 36(fvec3) ExtInst 1(GLSL.std.450) 13(Sin) 802 - Store 42(inF1) 803 - 804: 36(fvec3) Load 41(inF0) - 805: 36(fvec3) ExtInst 1(GLSL.std.450) 14(Cos) 804 - Store 43(inF2) 805 - 807: 36(fvec3) Load 41(inF0) - 808: 36(fvec3) ExtInst 1(GLSL.std.450) 19(Sinh) 807 + 802: 38(fvec3) Load 43(inF0) + 803: 38(fvec3) ExtInst 1(GLSL.std.450) 13(Sin) 802 + Store 44(inF1) 803 + 804: 38(fvec3) Load 43(inF0) + 805: 38(fvec3) ExtInst 1(GLSL.std.450) 14(Cos) 804 + Store 45(inF2) 805 + 807: 38(fvec3) Load 43(inF0) + 808: 38(fvec3) ExtInst 1(GLSL.std.450) 19(Sinh) 807 Store 806(r061) 808 - 810: 36(fvec3) Load 41(inF0) - 811: 36(fvec3) Load 42(inF1) - 812: 36(fvec3) Load 43(inF2) - 813: 36(fvec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 810 811 812 + 810: 38(fvec3) Load 43(inF0) + 811: 38(fvec3) Load 44(inF1) + 812: 38(fvec3) Load 45(inF2) + 813: 38(fvec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 810 811 812 Store 809(r062) 813 - 815: 36(fvec3) Load 41(inF0) - 816: 36(fvec3) ExtInst 1(GLSL.std.450) 31(Sqrt) 815 + 815: 38(fvec3) Load 43(inF0) + 816: 38(fvec3) ExtInst 1(GLSL.std.450) 31(Sqrt) 815 Store 814(r063) 816 - 818: 36(fvec3) Load 41(inF0) - 819: 36(fvec3) Load 42(inF1) - 820: 36(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 818 819 + 818: 38(fvec3) Load 43(inF0) + 819: 38(fvec3) Load 44(inF1) + 820: 38(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 818 819 Store 817(r064) 820 - 822: 36(fvec3) Load 41(inF0) - 823: 36(fvec3) ExtInst 1(GLSL.std.450) 15(Tan) 822 + 822: 38(fvec3) Load 43(inF0) + 823: 38(fvec3) ExtInst 1(GLSL.std.450) 15(Tan) 822 Store 821(r065) 823 - 825: 36(fvec3) Load 41(inF0) - 826: 36(fvec3) ExtInst 1(GLSL.std.450) 21(Tanh) 825 + 825: 38(fvec3) Load 43(inF0) + 826: 38(fvec3) ExtInst 1(GLSL.std.450) 21(Tanh) 825 Store 824(r066) 826 - 828: 36(fvec3) Load 41(inF0) - 829: 36(fvec3) ExtInst 1(GLSL.std.450) 3(Trunc) 828 + 828: 38(fvec3) Load 43(inF0) + 829: 38(fvec3) ExtInst 1(GLSL.std.450) 3(Trunc) 828 Store 827(r067) 829 ReturnValue 831 FunctionEnd -58(PixelShaderFunction(vf4;vf4;vf4;vu4;vu4;): 48(fvec4) Function None 52 - 53(inF0): 49(ptr) FunctionParameter - 54(inF1): 49(ptr) FunctionParameter - 55(inF2): 49(ptr) FunctionParameter - 56(inU0): 51(ptr) FunctionParameter - 57(inU1): 51(ptr) FunctionParameter - 59: Label - 834(r000): 136(ptr) Variable Function - 840(r001): 49(ptr) Variable Function - 843(r002): 49(ptr) Variable Function - 846(r003): 136(ptr) Variable Function - 850(r004): 49(ptr) Variable Function +60(PixelShaderFunction(vf4;vf4;vf4;vu4;vu4;): 50(fvec4) Function None 54 + 55(inF0): 51(ptr) FunctionParameter + 56(inF1): 51(ptr) FunctionParameter + 57(inF2): 51(ptr) FunctionParameter + 58(inU0): 53(ptr) FunctionParameter + 59(inU1): 53(ptr) FunctionParameter + 61: Label + 834(r000): 138(ptr) Variable Function + 840(r001): 51(ptr) Variable Function + 843(r002): 51(ptr) Variable Function + 846(r003): 138(ptr) Variable Function + 850(r004): 51(ptr) Variable Function 855(r005): 854(ptr) Variable Function - 858(r006): 51(ptr) Variable Function - 861(r007): 49(ptr) Variable Function - 864(r009): 49(ptr) Variable Function - 867(r010): 49(ptr) Variable Function - 871(r011): 49(ptr) Variable Function - 874(r012): 49(ptr) Variable Function - 892(r013): 49(ptr) Variable Function - 895(r014): 49(ptr) Variable Function - 898(r015): 51(ptr) Variable Function - 901(r016): 49(ptr) Variable Function - 904(r017): 49(ptr) Variable Function - 907(r018): 49(ptr) Variable Function - 910(r019): 49(ptr) Variable Function - 913(r020): 49(ptr) Variable Function - 916(r021): 49(ptr) Variable Function - 919(r022): 49(ptr) Variable Function + 858(r006): 53(ptr) Variable Function + 861(r007): 51(ptr) Variable Function + 864(r009): 51(ptr) Variable Function + 867(r010): 51(ptr) Variable Function + 871(r011): 51(ptr) Variable Function + 874(r012): 51(ptr) Variable Function + 892(r013): 51(ptr) Variable Function + 895(r014): 51(ptr) Variable Function + 898(r015): 53(ptr) Variable Function + 901(r016): 51(ptr) Variable Function + 904(r017): 51(ptr) Variable Function + 907(r018): 51(ptr) Variable Function + 910(r019): 51(ptr) Variable Function + 913(r020): 51(ptr) Variable Function + 916(r021): 51(ptr) Variable Function + 919(r022): 51(ptr) Variable Function 922(r023): 7(ptr) Variable Function 926(r024): 7(ptr) Variable Function - 930(r025): 49(ptr) Variable Function - 941(r029): 49(ptr) Variable Function - 944(r030): 49(ptr) Variable Function - 947(r031): 49(ptr) Variable Function - 952(r032): 51(ptr) Variable Function - 957(r033): 51(ptr) Variable Function - 959(r034): 49(ptr) Variable Function - 962(r036): 49(ptr) Variable Function - 966(r037): 49(ptr) Variable Function - 969(r039): 49(ptr) Variable Function + 930(r025): 51(ptr) Variable Function + 941(r029): 51(ptr) Variable Function + 944(r030): 51(ptr) Variable Function + 947(r031): 51(ptr) Variable Function + 952(r032): 53(ptr) Variable Function + 957(r033): 53(ptr) Variable Function + 959(r034): 51(ptr) Variable Function + 962(r036): 51(ptr) Variable Function + 966(r037): 51(ptr) Variable Function + 969(r039): 51(ptr) Variable Function 973(r040): 972(ptr) Variable Function 976(r041): 972(ptr) Variable Function - 979(r042): 49(ptr) Variable Function - 983(r039a): 49(ptr) Variable Function + 979(r042): 51(ptr) Variable Function + 983(r039a): 51(ptr) Variable Function 988(r043): 7(ptr) Variable Function - 991(r044): 49(ptr) Variable Function - 994(r045): 49(ptr) Variable Function - 998(r046): 49(ptr) Variable Function - 1001(r047): 49(ptr) Variable Function - 1005(r048): 49(ptr) Variable Function - 1009(r049): 49(ptr) Variable Function - 1012(r050): 49(ptr) Variable Function - 1016(r051): 49(ptr) Variable Function - 1019(r052): 49(ptr) Variable Function - 1023(r053): 49(ptr) Variable Function - 1027(r054): 49(ptr) Variable Function - 1031(r055): 51(ptr) Variable Function - 1034(r056): 49(ptr) Variable Function - 1037(r057): 49(ptr) Variable Function - 1040(r058): 49(ptr) Variable Function - 1045(r059): 49(ptr) Variable Function - 1048(r060): 49(ptr) Variable Function - 1055(r061): 49(ptr) Variable Function - 1058(r062): 49(ptr) Variable Function - 1063(r063): 49(ptr) Variable Function - 1066(r064): 49(ptr) Variable Function - 1070(r065): 49(ptr) Variable Function - 1073(r066): 49(ptr) Variable Function - 1076(r067): 49(ptr) Variable Function - 835: 48(fvec4) Load 53(inF0) + 991(r044): 51(ptr) Variable Function + 994(r045): 51(ptr) Variable Function + 998(r046): 51(ptr) Variable Function + 1001(r047): 51(ptr) Variable Function + 1005(r048): 51(ptr) Variable Function + 1009(r049): 51(ptr) Variable Function + 1012(r050): 51(ptr) Variable Function + 1016(r051): 51(ptr) Variable Function + 1019(r052): 51(ptr) Variable Function + 1023(r053): 51(ptr) Variable Function + 1027(r054): 51(ptr) Variable Function + 1031(r055): 53(ptr) Variable Function + 1034(r056): 51(ptr) Variable Function + 1037(r057): 51(ptr) Variable Function + 1040(r058): 51(ptr) Variable Function + 1045(r059): 51(ptr) Variable Function + 1048(r060): 51(ptr) Variable Function + 1055(r061): 51(ptr) Variable Function + 1058(r062): 51(ptr) Variable Function + 1063(r063): 51(ptr) Variable Function + 1066(r064): 51(ptr) Variable Function + 1070(r065): 51(ptr) Variable Function + 1073(r066): 51(ptr) Variable Function + 1076(r067): 51(ptr) Variable Function + 835: 50(fvec4) Load 55(inF0) 838: 836(bvec4) FOrdNotEqual 835 837 - 839: 135(bool) All 838 + 839: 137(bool) All 838 Store 834(r000) 839 - 841: 48(fvec4) Load 53(inF0) - 842: 48(fvec4) ExtInst 1(GLSL.std.450) 4(FAbs) 841 + 841: 50(fvec4) Load 55(inF0) + 842: 50(fvec4) ExtInst 1(GLSL.std.450) 4(FAbs) 841 Store 840(r001) 842 - 844: 48(fvec4) Load 53(inF0) - 845: 48(fvec4) ExtInst 1(GLSL.std.450) 17(Acos) 844 + 844: 50(fvec4) Load 55(inF0) + 845: 50(fvec4) ExtInst 1(GLSL.std.450) 17(Acos) 844 Store 843(r002) 845 - 847: 48(fvec4) Load 53(inF0) + 847: 50(fvec4) Load 55(inF0) 848: 836(bvec4) FOrdNotEqual 847 837 - 849: 135(bool) Any 848 + 849: 137(bool) Any 848 Store 846(r003) 849 - 851: 48(fvec4) Load 53(inF0) - 852: 48(fvec4) ExtInst 1(GLSL.std.450) 16(Asin) 851 + 851: 50(fvec4) Load 55(inF0) + 852: 50(fvec4) ExtInst 1(GLSL.std.450) 16(Asin) 851 Store 850(r004) 852 - 856: 48(fvec4) Load 53(inF0) + 856: 50(fvec4) Load 55(inF0) 857: 853(ivec4) Bitcast 856 Store 855(r005) 857 - 859: 48(fvec4) Load 53(inF0) - 860: 50(ivec4) Bitcast 859 + 859: 50(fvec4) Load 55(inF0) + 860: 52(ivec4) Bitcast 859 Store 858(r006) 860 - 862: 50(ivec4) Load 56(inU0) - 863: 48(fvec4) Bitcast 862 + 862: 52(ivec4) Load 58(inU0) + 863: 50(fvec4) Bitcast 862 Store 861(r007) 863 - 865: 48(fvec4) Load 53(inF0) - 866: 48(fvec4) ExtInst 1(GLSL.std.450) 18(Atan) 865 + 865: 50(fvec4) Load 55(inF0) + 866: 50(fvec4) ExtInst 1(GLSL.std.450) 18(Atan) 865 Store 864(r009) 866 - 868: 48(fvec4) Load 53(inF0) - 869: 48(fvec4) Load 54(inF1) - 870: 48(fvec4) ExtInst 1(GLSL.std.450) 25(Atan2) 868 869 + 868: 50(fvec4) Load 55(inF0) + 869: 50(fvec4) Load 56(inF1) + 870: 50(fvec4) ExtInst 1(GLSL.std.450) 25(Atan2) 868 869 Store 867(r010) 870 - 872: 48(fvec4) Load 53(inF0) - 873: 48(fvec4) ExtInst 1(GLSL.std.450) 9(Ceil) 872 + 872: 50(fvec4) Load 55(inF0) + 873: 50(fvec4) ExtInst 1(GLSL.std.450) 9(Ceil) 872 Store 871(r011) 873 - 875: 48(fvec4) Load 53(inF0) - 876: 48(fvec4) Load 54(inF1) - 877: 48(fvec4) Load 55(inF2) - 878: 48(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 875 876 877 + 875: 50(fvec4) Load 55(inF0) + 876: 50(fvec4) Load 56(inF1) + 877: 50(fvec4) Load 57(inF2) + 878: 50(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 875 876 877 Store 874(r012) 878 - 879: 48(fvec4) Load 53(inF0) + 879: 50(fvec4) Load 55(inF0) 880: 836(bvec4) FOrdLessThan 879 837 - 881: 135(bool) Any 880 + 881: 137(bool) Any 880 SelectionMerge 883 None BranchConditional 881 882 883 882: Label Kill 883: Label - 885: 50(ivec4) Load 56(inU0) + 885: 52(ivec4) Load 58(inU0) 887: 836(bvec4) ULessThan 885 886 - 888: 135(bool) Any 887 + 888: 137(bool) Any 887 SelectionMerge 890 None BranchConditional 888 889 890 889: Label Kill 890: Label - 893: 48(fvec4) Load 53(inF0) - 894: 48(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 893 + 893: 50(fvec4) Load 55(inF0) + 894: 50(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 893 Store 892(r013) 894 - 896: 48(fvec4) Load 53(inF0) - 897: 48(fvec4) ExtInst 1(GLSL.std.450) 20(Cosh) 896 + 896: 50(fvec4) Load 55(inF0) + 897: 50(fvec4) ExtInst 1(GLSL.std.450) 20(Cosh) 896 Store 895(r014) 897 - 900: 50(ivec4) BitCount 899 + 900: 52(ivec4) BitCount 899 Store 898(r015) 900 - 902: 48(fvec4) Load 53(inF0) - 903: 48(fvec4) DPdx 902 + 902: 50(fvec4) Load 55(inF0) + 903: 50(fvec4) DPdx 902 Store 901(r016) 903 - 905: 48(fvec4) Load 53(inF0) - 906: 48(fvec4) DPdxCoarse 905 + 905: 50(fvec4) Load 55(inF0) + 906: 50(fvec4) DPdxCoarse 905 Store 904(r017) 906 - 908: 48(fvec4) Load 53(inF0) - 909: 48(fvec4) DPdxFine 908 + 908: 50(fvec4) Load 55(inF0) + 909: 50(fvec4) DPdxFine 908 Store 907(r018) 909 - 911: 48(fvec4) Load 53(inF0) - 912: 48(fvec4) DPdy 911 + 911: 50(fvec4) Load 55(inF0) + 912: 50(fvec4) DPdy 911 Store 910(r019) 912 - 914: 48(fvec4) Load 53(inF0) - 915: 48(fvec4) DPdyCoarse 914 + 914: 50(fvec4) Load 55(inF0) + 915: 50(fvec4) DPdyCoarse 914 Store 913(r020) 915 - 917: 48(fvec4) Load 53(inF0) - 918: 48(fvec4) DPdyFine 917 + 917: 50(fvec4) Load 55(inF0) + 918: 50(fvec4) DPdyFine 917 Store 916(r021) 918 - 920: 48(fvec4) Load 53(inF0) - 921: 48(fvec4) ExtInst 1(GLSL.std.450) 12(Degrees) 920 + 920: 50(fvec4) Load 55(inF0) + 921: 50(fvec4) ExtInst 1(GLSL.std.450) 12(Degrees) 920 Store 919(r022) 921 - 923: 48(fvec4) Load 53(inF0) - 924: 48(fvec4) Load 54(inF1) + 923: 50(fvec4) Load 55(inF0) + 924: 50(fvec4) Load 56(inF1) 925: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 923 924 Store 922(r023) 925 - 927: 48(fvec4) Load 53(inF0) - 928: 48(fvec4) Load 54(inF1) + 927: 50(fvec4) Load 55(inF0) + 928: 50(fvec4) Load 56(inF1) 929: 6(float) Dot 927 928 Store 926(r024) 929 - 931: 7(ptr) AccessChain 53(inF0) 533 + 931: 7(ptr) AccessChain 55(inF0) 533 932: 6(float) Load 931 - 933: 7(ptr) AccessChain 54(inF1) 533 + 933: 7(ptr) AccessChain 56(inF1) 533 934: 6(float) Load 933 935: 6(float) FMul 932 934 - 936: 7(ptr) AccessChain 53(inF0) 534 + 936: 7(ptr) AccessChain 55(inF0) 534 937: 6(float) Load 936 - 938: 7(ptr) AccessChain 54(inF1) 650 + 938: 7(ptr) AccessChain 56(inF1) 650 939: 6(float) Load 938 - 940: 48(fvec4) CompositeConstruct 289 935 937 939 + 940: 50(fvec4) CompositeConstruct 289 935 937 939 Store 930(r025) 940 - 942: 48(fvec4) Load 53(inF0) - 943: 48(fvec4) ExtInst 1(GLSL.std.450) 27(Exp) 942 + 942: 50(fvec4) Load 55(inF0) + 943: 50(fvec4) ExtInst 1(GLSL.std.450) 27(Exp) 942 Store 941(r029) 943 - 945: 48(fvec4) Load 53(inF0) - 946: 48(fvec4) ExtInst 1(GLSL.std.450) 29(Exp2) 945 + 945: 50(fvec4) Load 55(inF0) + 946: 50(fvec4) ExtInst 1(GLSL.std.450) 29(Exp2) 945 Store 944(r030) 946 - 948: 48(fvec4) Load 53(inF0) - 949: 48(fvec4) Load 54(inF1) - 950: 48(fvec4) Load 55(inF2) - 951: 48(fvec4) ExtInst 1(GLSL.std.450) 70(FaceForward) 948 949 950 + 948: 50(fvec4) Load 55(inF0) + 949: 50(fvec4) Load 56(inF1) + 950: 50(fvec4) Load 57(inF2) + 951: 50(fvec4) ExtInst 1(GLSL.std.450) 70(FaceForward) 948 949 950 Store 947(r031) 951 - 956: 50(ivec4) ExtInst 1(GLSL.std.450) 75(FindUMsb) 955 + 956: 52(ivec4) ExtInst 1(GLSL.std.450) 75(FindUMsb) 955 Store 952(r032) 956 - 958: 50(ivec4) ExtInst 1(GLSL.std.450) 73(FindILsb) 955 + 958: 52(ivec4) ExtInst 1(GLSL.std.450) 73(FindILsb) 955 Store 957(r033) 958 - 960: 48(fvec4) Load 53(inF0) - 961: 48(fvec4) ExtInst 1(GLSL.std.450) 8(Floor) 960 + 960: 50(fvec4) Load 55(inF0) + 961: 50(fvec4) ExtInst 1(GLSL.std.450) 8(Floor) 960 Store 959(r034) 961 - 963: 48(fvec4) Load 53(inF0) - 964: 48(fvec4) Load 54(inF1) - 965: 48(fvec4) FMod 963 964 + 963: 50(fvec4) Load 55(inF0) + 964: 50(fvec4) Load 56(inF1) + 965: 50(fvec4) FMod 963 964 Store 962(r036) 965 - 967: 48(fvec4) Load 53(inF0) - 968: 48(fvec4) ExtInst 1(GLSL.std.450) 10(Fract) 967 + 967: 50(fvec4) Load 55(inF0) + 968: 50(fvec4) ExtInst 1(GLSL.std.450) 10(Fract) 967 Store 966(r037) 968 - 970: 48(fvec4) Load 53(inF0) - 971: 48(fvec4) Fwidth 970 + 970: 50(fvec4) Load 55(inF0) + 971: 50(fvec4) Fwidth 970 Store 969(r039) 971 - 974: 48(fvec4) Load 53(inF0) + 974: 50(fvec4) Load 55(inF0) 975: 836(bvec4) IsInf 974 Store 973(r040) 975 - 977: 48(fvec4) Load 53(inF0) + 977: 50(fvec4) Load 55(inF0) 978: 836(bvec4) IsNan 977 Store 976(r041) 978 - 980: 48(fvec4) Load 53(inF0) - 981: 48(fvec4) Load 54(inF1) - 982: 48(fvec4) ExtInst 1(GLSL.std.450) 53(Ldexp) 980 981 + 980: 50(fvec4) Load 55(inF0) + 981: 50(fvec4) Load 56(inF1) + 982: 50(fvec4) ExtInst 1(GLSL.std.450) 53(Ldexp) 980 981 Store 979(r042) 982 - 984: 48(fvec4) Load 53(inF0) - 985: 48(fvec4) Load 54(inF1) - 986: 48(fvec4) Load 55(inF2) - 987: 48(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 984 985 986 + 984: 50(fvec4) Load 55(inF0) + 985: 50(fvec4) Load 56(inF1) + 986: 50(fvec4) Load 57(inF2) + 987: 50(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 984 985 986 Store 983(r039a) 987 - 989: 48(fvec4) Load 53(inF0) + 989: 50(fvec4) Load 55(inF0) 990: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 989 Store 988(r043) 990 - 992: 48(fvec4) Load 53(inF0) - 993: 48(fvec4) ExtInst 1(GLSL.std.450) 28(Log) 992 + 992: 50(fvec4) Load 55(inF0) + 993: 50(fvec4) ExtInst 1(GLSL.std.450) 28(Log) 992 Store 991(r044) 993 - 995: 48(fvec4) Load 53(inF0) - 996: 48(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 995 - 997: 48(fvec4) VectorTimesScalar 996 268 + 995: 50(fvec4) Load 55(inF0) + 996: 50(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 995 + 997: 50(fvec4) VectorTimesScalar 996 268 Store 994(r045) 997 - 999: 48(fvec4) Load 53(inF0) - 1000: 48(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 999 + 999: 50(fvec4) Load 55(inF0) + 1000: 50(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 999 Store 998(r046) 1000 - 1002: 48(fvec4) Load 53(inF0) - 1003: 48(fvec4) Load 54(inF1) - 1004: 48(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 1002 1003 + 1002: 50(fvec4) Load 55(inF0) + 1003: 50(fvec4) Load 56(inF1) + 1004: 50(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 1002 1003 Store 1001(r047) 1004 - 1006: 48(fvec4) Load 53(inF0) - 1007: 48(fvec4) Load 54(inF1) - 1008: 48(fvec4) ExtInst 1(GLSL.std.450) 37(FMin) 1006 1007 + 1006: 50(fvec4) Load 55(inF0) + 1007: 50(fvec4) Load 56(inF1) + 1008: 50(fvec4) ExtInst 1(GLSL.std.450) 37(FMin) 1006 1007 Store 1005(r048) 1008 - 1010: 48(fvec4) Load 53(inF0) - 1011: 48(fvec4) ExtInst 1(GLSL.std.450) 69(Normalize) 1010 + 1010: 50(fvec4) Load 55(inF0) + 1011: 50(fvec4) ExtInst 1(GLSL.std.450) 69(Normalize) 1010 Store 1009(r049) 1011 - 1013: 48(fvec4) Load 53(inF0) - 1014: 48(fvec4) Load 54(inF1) - 1015: 48(fvec4) ExtInst 1(GLSL.std.450) 26(Pow) 1013 1014 + 1013: 50(fvec4) Load 55(inF0) + 1014: 50(fvec4) Load 56(inF1) + 1015: 50(fvec4) ExtInst 1(GLSL.std.450) 26(Pow) 1013 1014 Store 1012(r050) 1015 - 1017: 48(fvec4) Load 53(inF0) - 1018: 48(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 1017 + 1017: 50(fvec4) Load 55(inF0) + 1018: 50(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 1017 Store 1016(r051) 1018 - 1020: 48(fvec4) Load 53(inF0) - 1021: 48(fvec4) CompositeConstruct 289 289 289 289 - 1022: 48(fvec4) FDiv 1021 1020 + 1020: 50(fvec4) Load 55(inF0) + 1021: 50(fvec4) CompositeConstruct 289 289 289 289 + 1022: 50(fvec4) FDiv 1021 1020 Store 1019(r052) 1022 - 1024: 48(fvec4) Load 53(inF0) - 1025: 48(fvec4) Load 54(inF1) - 1026: 48(fvec4) ExtInst 1(GLSL.std.450) 71(Reflect) 1024 1025 + 1024: 50(fvec4) Load 55(inF0) + 1025: 50(fvec4) Load 56(inF1) + 1026: 50(fvec4) ExtInst 1(GLSL.std.450) 71(Reflect) 1024 1025 Store 1023(r053) 1026 - 1028: 48(fvec4) Load 53(inF0) - 1029: 48(fvec4) Load 54(inF1) - 1030: 48(fvec4) ExtInst 1(GLSL.std.450) 72(Refract) 1028 1029 530 + 1028: 50(fvec4) Load 55(inF0) + 1029: 50(fvec4) Load 56(inF1) + 1030: 50(fvec4) ExtInst 1(GLSL.std.450) 72(Refract) 1028 1029 530 Store 1027(r054) 1030 - 1033: 50(ivec4) BitReverse 1032 + 1033: 52(ivec4) BitReverse 1032 Store 1031(r055) 1033 - 1035: 48(fvec4) Load 53(inF0) - 1036: 48(fvec4) ExtInst 1(GLSL.std.450) 2(RoundEven) 1035 + 1035: 50(fvec4) Load 55(inF0) + 1036: 50(fvec4) ExtInst 1(GLSL.std.450) 2(RoundEven) 1035 Store 1034(r056) 1036 - 1038: 48(fvec4) Load 53(inF0) - 1039: 48(fvec4) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1038 + 1038: 50(fvec4) Load 55(inF0) + 1039: 50(fvec4) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1038 Store 1037(r057) 1039 - 1041: 48(fvec4) Load 53(inF0) - 1042: 48(fvec4) CompositeConstruct 139 139 139 139 - 1043: 48(fvec4) CompositeConstruct 289 289 289 289 - 1044: 48(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 1041 1042 1043 + 1041: 50(fvec4) Load 55(inF0) + 1042: 50(fvec4) CompositeConstruct 141 141 141 141 + 1043: 50(fvec4) CompositeConstruct 289 289 289 289 + 1044: 50(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 1041 1042 1043 Store 1040(r058) 1044 - 1046: 48(fvec4) Load 53(inF0) - 1047: 48(fvec4) ExtInst 1(GLSL.std.450) 6(FSign) 1046 + 1046: 50(fvec4) Load 55(inF0) + 1047: 50(fvec4) ExtInst 1(GLSL.std.450) 6(FSign) 1046 Store 1045(r059) 1047 - 1049: 48(fvec4) Load 53(inF0) - 1050: 48(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 1049 + 1049: 50(fvec4) Load 55(inF0) + 1050: 50(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 1049 Store 1048(r060) 1050 - 1051: 48(fvec4) Load 53(inF0) - 1052: 48(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 1051 - Store 54(inF1) 1052 - 1053: 48(fvec4) Load 53(inF0) - 1054: 48(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 1053 - Store 55(inF2) 1054 - 1056: 48(fvec4) Load 53(inF0) - 1057: 48(fvec4) ExtInst 1(GLSL.std.450) 19(Sinh) 1056 + 1051: 50(fvec4) Load 55(inF0) + 1052: 50(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 1051 + Store 56(inF1) 1052 + 1053: 50(fvec4) Load 55(inF0) + 1054: 50(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 1053 + Store 57(inF2) 1054 + 1056: 50(fvec4) Load 55(inF0) + 1057: 50(fvec4) ExtInst 1(GLSL.std.450) 19(Sinh) 1056 Store 1055(r061) 1057 - 1059: 48(fvec4) Load 53(inF0) - 1060: 48(fvec4) Load 54(inF1) - 1061: 48(fvec4) Load 55(inF2) - 1062: 48(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 1059 1060 1061 + 1059: 50(fvec4) Load 55(inF0) + 1060: 50(fvec4) Load 56(inF1) + 1061: 50(fvec4) Load 57(inF2) + 1062: 50(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 1059 1060 1061 Store 1058(r062) 1062 - 1064: 48(fvec4) Load 53(inF0) - 1065: 48(fvec4) ExtInst 1(GLSL.std.450) 31(Sqrt) 1064 + 1064: 50(fvec4) Load 55(inF0) + 1065: 50(fvec4) ExtInst 1(GLSL.std.450) 31(Sqrt) 1064 Store 1063(r063) 1065 - 1067: 48(fvec4) Load 53(inF0) - 1068: 48(fvec4) Load 54(inF1) - 1069: 48(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 1067 1068 + 1067: 50(fvec4) Load 55(inF0) + 1068: 50(fvec4) Load 56(inF1) + 1069: 50(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 1067 1068 Store 1066(r064) 1069 - 1071: 48(fvec4) Load 53(inF0) - 1072: 48(fvec4) ExtInst 1(GLSL.std.450) 15(Tan) 1071 + 1071: 50(fvec4) Load 55(inF0) + 1072: 50(fvec4) ExtInst 1(GLSL.std.450) 15(Tan) 1071 Store 1070(r065) 1072 - 1074: 48(fvec4) Load 53(inF0) - 1075: 48(fvec4) ExtInst 1(GLSL.std.450) 21(Tanh) 1074 + 1074: 50(fvec4) Load 55(inF0) + 1075: 50(fvec4) ExtInst 1(GLSL.std.450) 21(Tanh) 1074 Store 1073(r066) 1075 - 1077: 48(fvec4) Load 53(inF0) - 1078: 48(fvec4) ExtInst 1(GLSL.std.450) 3(Trunc) 1077 + 1077: 50(fvec4) Load 55(inF0) + 1078: 50(fvec4) ExtInst 1(GLSL.std.450) 3(Trunc) 1077 Store 1076(r067) 1078 ReturnValue 1080 FunctionEnd -66(PixelShaderFunction2x2(mf22;mf22;mf22;): 60 Function None 62 - 63(inF0): 61(ptr) FunctionParameter - 64(inF1): 61(ptr) FunctionParameter - 65(inF2): 61(ptr) FunctionParameter - 67: Label - 1083(r000): 136(ptr) Variable Function - 1088(r001): 61(ptr) Variable Function - 1093(r003): 136(ptr) Variable Function - 1097(r004): 61(ptr) Variable Function - 1100(r005): 61(ptr) Variable Function - 1103(r006): 61(ptr) Variable Function - 1107(r007): 61(ptr) Variable Function - 1117(r008): 61(ptr) Variable Function - 1122(r009): 61(ptr) Variable Function - 1125(r010): 61(ptr) Variable Function - 1128(r011): 61(ptr) Variable Function - 1131(r012): 61(ptr) Variable Function - 1134(r013): 61(ptr) Variable Function - 1137(r014): 61(ptr) Variable Function - 1140(r015): 61(ptr) Variable Function - 1143(r016): 61(ptr) Variable Function - 1146(r017): 61(ptr) Variable Function +68(PixelShaderFunction2x2(mf22;mf22;mf22;): 62 Function None 64 + 65(inF0): 63(ptr) FunctionParameter + 66(inF1): 63(ptr) FunctionParameter + 67(inF2): 63(ptr) FunctionParameter + 69: Label + 1083(r000): 138(ptr) Variable Function + 1088(r001): 63(ptr) Variable Function + 1093(r003): 138(ptr) Variable Function + 1097(r004): 63(ptr) Variable Function + 1100(r005): 63(ptr) Variable Function + 1103(r006): 63(ptr) Variable Function + 1107(r007): 63(ptr) Variable Function + 1117(r008): 63(ptr) Variable Function + 1122(r009): 63(ptr) Variable Function + 1125(r010): 63(ptr) Variable Function + 1128(r011): 63(ptr) Variable Function + 1131(r012): 63(ptr) Variable Function + 1134(r013): 63(ptr) Variable Function + 1137(r014): 63(ptr) Variable Function + 1140(r015): 63(ptr) Variable Function + 1143(r016): 63(ptr) Variable Function + 1146(r017): 63(ptr) Variable Function 1149(r018): 7(ptr) Variable Function - 1152(r019): 61(ptr) Variable Function - 1155(R020): 61(ptr) Variable Function - 1158(r021): 61(ptr) Variable Function - 1161(r022): 61(ptr) Variable Function - 1171(r023): 61(ptr) Variable Function - 1174(r025): 61(ptr) Variable Function - 1177(r026): 61(ptr) Variable Function - 1181(r026a): 61(ptr) Variable Function - 1186(r027): 61(ptr) Variable Function - 1189(r028): 61(ptr) Variable Function - 1193(r029): 61(ptr) Variable Function - 1196(r030): 61(ptr) Variable Function - 1200(r031): 61(ptr) Variable Function - 1204(r032): 61(ptr) Variable Function - 1208(r033): 61(ptr) Variable Function - 1211(r034): 61(ptr) Variable Function - 1214(r035): 61(ptr) Variable Function - 1217(r036): 61(ptr) Variable Function - 1222(r037): 61(ptr) Variable Function - 1225(r038): 61(ptr) Variable Function - 1232(r039): 61(ptr) Variable Function - 1235(r049): 61(ptr) Variable Function - 1240(r041): 61(ptr) Variable Function - 1243(r042): 61(ptr) Variable Function - 1247(r043): 61(ptr) Variable Function - 1250(r044): 61(ptr) Variable Function - 1255(r046): 61(ptr) Variable Function - 1084: 60 Load 63(inF0) - 1086: 1085 FOrdNotEqual 1084 139 - 1087: 135(bool) All 1086 + 1152(r019): 63(ptr) Variable Function + 1155(R020): 63(ptr) Variable Function + 1158(r021): 63(ptr) Variable Function + 1161(r022): 63(ptr) Variable Function + 1171(r023): 63(ptr) Variable Function + 1174(r025): 63(ptr) Variable Function + 1177(r026): 63(ptr) Variable Function + 1181(r026a): 63(ptr) Variable Function + 1186(r027): 63(ptr) Variable Function + 1189(r028): 63(ptr) Variable Function + 1193(r029): 63(ptr) Variable Function + 1196(r030): 63(ptr) Variable Function + 1200(r031): 63(ptr) Variable Function + 1204(r032): 63(ptr) Variable Function + 1208(r033): 63(ptr) Variable Function + 1211(r034): 63(ptr) Variable Function + 1214(r035): 63(ptr) Variable Function + 1217(r036): 63(ptr) Variable Function + 1222(r037): 63(ptr) Variable Function + 1225(r038): 63(ptr) Variable Function + 1232(r039): 63(ptr) Variable Function + 1235(r049): 63(ptr) Variable Function + 1240(r041): 63(ptr) Variable Function + 1243(r042): 63(ptr) Variable Function + 1247(r043): 63(ptr) Variable Function + 1250(r044): 63(ptr) Variable Function + 1255(r046): 63(ptr) Variable Function + 1084: 62 Load 65(inF0) + 1086: 1085 FOrdNotEqual 1084 141 + 1087: 137(bool) All 1086 Store 1083(r000) 1087 - 1089: 60 Load 63(inF0) - 1090: 60 ExtInst 1(GLSL.std.450) 4(FAbs) 1089 + 1089: 62 Load 65(inF0) + 1090: 62 ExtInst 1(GLSL.std.450) 4(FAbs) 1089 Store 1088(r001) 1090 - 1091: 60 Load 63(inF0) - 1092: 60 ExtInst 1(GLSL.std.450) 17(Acos) 1091 - 1094: 60 Load 63(inF0) - 1095: 1085 FOrdNotEqual 1094 139 - 1096: 135(bool) Any 1095 + 1091: 62 Load 65(inF0) + 1092: 62 ExtInst 1(GLSL.std.450) 17(Acos) 1091 + 1094: 62 Load 65(inF0) + 1095: 1085 FOrdNotEqual 1094 141 + 1096: 137(bool) Any 1095 Store 1093(r003) 1096 - 1098: 60 Load 63(inF0) - 1099: 60 ExtInst 1(GLSL.std.450) 16(Asin) 1098 + 1098: 62 Load 65(inF0) + 1099: 62 ExtInst 1(GLSL.std.450) 16(Asin) 1098 Store 1097(r004) 1099 - 1101: 60 Load 63(inF0) - 1102: 60 ExtInst 1(GLSL.std.450) 18(Atan) 1101 + 1101: 62 Load 65(inF0) + 1102: 62 ExtInst 1(GLSL.std.450) 18(Atan) 1101 Store 1100(r005) 1102 - 1104: 60 Load 63(inF0) - 1105: 60 Load 64(inF1) - 1106: 60 ExtInst 1(GLSL.std.450) 25(Atan2) 1104 1105 + 1104: 62 Load 65(inF0) + 1105: 62 Load 66(inF1) + 1106: 62 ExtInst 1(GLSL.std.450) 25(Atan2) 1104 1105 Store 1103(r006) 1106 - 1108: 60 Load 63(inF0) - 1109: 60 ExtInst 1(GLSL.std.450) 9(Ceil) 1108 + 1108: 62 Load 65(inF0) + 1109: 62 ExtInst 1(GLSL.std.450) 9(Ceil) 1108 Store 1107(r007) 1109 - 1110: 60 Load 63(inF0) + 1110: 62 Load 65(inF0) 1112: 1085 FOrdLessThan 1110 1111 - 1113: 135(bool) Any 1112 + 1113: 137(bool) Any 1112 SelectionMerge 1115 None BranchConditional 1113 1114 1115 1114: Label Kill 1115: Label - 1118: 60 Load 63(inF0) - 1119: 60 Load 64(inF1) - 1120: 60 Load 65(inF2) - 1121: 60 ExtInst 1(GLSL.std.450) 43(FClamp) 1118 1119 1120 + 1118: 62 Load 65(inF0) + 1119: 62 Load 66(inF1) + 1120: 62 Load 67(inF2) + 1121: 62 ExtInst 1(GLSL.std.450) 43(FClamp) 1118 1119 1120 Store 1117(r008) 1121 - 1123: 60 Load 63(inF0) - 1124: 60 ExtInst 1(GLSL.std.450) 14(Cos) 1123 + 1123: 62 Load 65(inF0) + 1124: 62 ExtInst 1(GLSL.std.450) 14(Cos) 1123 Store 1122(r009) 1124 - 1126: 60 Load 63(inF0) - 1127: 60 ExtInst 1(GLSL.std.450) 20(Cosh) 1126 + 1126: 62 Load 65(inF0) + 1127: 62 ExtInst 1(GLSL.std.450) 20(Cosh) 1126 Store 1125(r010) 1127 - 1129: 60 Load 63(inF0) - 1130: 60 DPdx 1129 + 1129: 62 Load 65(inF0) + 1130: 62 DPdx 1129 Store 1128(r011) 1130 - 1132: 60 Load 63(inF0) - 1133: 60 DPdxCoarse 1132 + 1132: 62 Load 65(inF0) + 1133: 62 DPdxCoarse 1132 Store 1131(r012) 1133 - 1135: 60 Load 63(inF0) - 1136: 60 DPdxFine 1135 + 1135: 62 Load 65(inF0) + 1136: 62 DPdxFine 1135 Store 1134(r013) 1136 - 1138: 60 Load 63(inF0) - 1139: 60 DPdy 1138 + 1138: 62 Load 65(inF0) + 1139: 62 DPdy 1138 Store 1137(r014) 1139 - 1141: 60 Load 63(inF0) - 1142: 60 DPdyCoarse 1141 + 1141: 62 Load 65(inF0) + 1142: 62 DPdyCoarse 1141 Store 1140(r015) 1142 - 1144: 60 Load 63(inF0) - 1145: 60 DPdyFine 1144 + 1144: 62 Load 65(inF0) + 1145: 62 DPdyFine 1144 Store 1143(r016) 1145 - 1147: 60 Load 63(inF0) - 1148: 60 ExtInst 1(GLSL.std.450) 12(Degrees) 1147 + 1147: 62 Load 65(inF0) + 1148: 62 ExtInst 1(GLSL.std.450) 12(Degrees) 1147 Store 1146(r017) 1148 - 1150: 60 Load 63(inF0) + 1150: 62 Load 65(inF0) 1151: 6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 1150 Store 1149(r018) 1151 - 1153: 60 Load 63(inF0) - 1154: 60 ExtInst 1(GLSL.std.450) 27(Exp) 1153 + 1153: 62 Load 65(inF0) + 1154: 62 ExtInst 1(GLSL.std.450) 27(Exp) 1153 Store 1152(r019) 1154 - 1156: 60 Load 63(inF0) - 1157: 60 ExtInst 1(GLSL.std.450) 29(Exp2) 1156 + 1156: 62 Load 65(inF0) + 1157: 62 ExtInst 1(GLSL.std.450) 29(Exp2) 1156 Store 1155(R020) 1157 - 1159: 60 Load 63(inF0) - 1160: 60 ExtInst 1(GLSL.std.450) 8(Floor) 1159 + 1159: 62 Load 65(inF0) + 1160: 62 ExtInst 1(GLSL.std.450) 8(Floor) 1159 Store 1158(r021) 1160 - 1162: 60 Load 63(inF0) - 1163: 60 Load 64(inF1) - 1164: 24(fvec2) CompositeExtract 1162 0 - 1165: 24(fvec2) CompositeExtract 1163 0 - 1166: 24(fvec2) FMod 1164 1165 - 1167: 24(fvec2) CompositeExtract 1162 1 - 1168: 24(fvec2) CompositeExtract 1163 1 - 1169: 24(fvec2) FMod 1167 1168 - 1170: 60 CompositeConstruct 1166 1169 + 1162: 62 Load 65(inF0) + 1163: 62 Load 66(inF1) + 1164: 26(fvec2) CompositeExtract 1162 0 + 1165: 26(fvec2) CompositeExtract 1163 0 + 1166: 26(fvec2) FMod 1164 1165 + 1167: 26(fvec2) CompositeExtract 1162 1 + 1168: 26(fvec2) CompositeExtract 1163 1 + 1169: 26(fvec2) FMod 1167 1168 + 1170: 62 CompositeConstruct 1166 1169 Store 1161(r022) 1170 - 1172: 60 Load 63(inF0) - 1173: 60 ExtInst 1(GLSL.std.450) 10(Fract) 1172 + 1172: 62 Load 65(inF0) + 1173: 62 ExtInst 1(GLSL.std.450) 10(Fract) 1172 Store 1171(r023) 1173 - 1175: 60 Load 63(inF0) - 1176: 60 Fwidth 1175 + 1175: 62 Load 65(inF0) + 1176: 62 Fwidth 1175 Store 1174(r025) 1176 - 1178: 60 Load 63(inF0) - 1179: 60 Load 64(inF1) - 1180: 60 ExtInst 1(GLSL.std.450) 53(Ldexp) 1178 1179 + 1178: 62 Load 65(inF0) + 1179: 62 Load 66(inF1) + 1180: 62 ExtInst 1(GLSL.std.450) 53(Ldexp) 1178 1179 Store 1177(r026) 1180 - 1182: 60 Load 63(inF0) - 1183: 60 Load 64(inF1) - 1184: 60 Load 65(inF2) - 1185: 60 ExtInst 1(GLSL.std.450) 46(FMix) 1182 1183 1184 + 1182: 62 Load 65(inF0) + 1183: 62 Load 66(inF1) + 1184: 62 Load 67(inF2) + 1185: 62 ExtInst 1(GLSL.std.450) 46(FMix) 1182 1183 1184 Store 1181(r026a) 1185 - 1187: 60 Load 63(inF0) - 1188: 60 ExtInst 1(GLSL.std.450) 28(Log) 1187 + 1187: 62 Load 65(inF0) + 1188: 62 ExtInst 1(GLSL.std.450) 28(Log) 1187 Store 1186(r027) 1188 - 1190: 60 Load 63(inF0) - 1191: 60 ExtInst 1(GLSL.std.450) 30(Log2) 1190 - 1192: 60 MatrixTimesScalar 1191 268 + 1190: 62 Load 65(inF0) + 1191: 62 ExtInst 1(GLSL.std.450) 30(Log2) 1190 + 1192: 62 MatrixTimesScalar 1191 268 Store 1189(r028) 1192 - 1194: 60 Load 63(inF0) - 1195: 60 ExtInst 1(GLSL.std.450) 30(Log2) 1194 + 1194: 62 Load 65(inF0) + 1195: 62 ExtInst 1(GLSL.std.450) 30(Log2) 1194 Store 1193(r029) 1195 - 1197: 60 Load 63(inF0) - 1198: 60 Load 64(inF1) - 1199: 60 ExtInst 1(GLSL.std.450) 40(FMax) 1197 1198 + 1197: 62 Load 65(inF0) + 1198: 62 Load 66(inF1) + 1199: 62 ExtInst 1(GLSL.std.450) 40(FMax) 1197 1198 Store 1196(r030) 1199 - 1201: 60 Load 63(inF0) - 1202: 60 Load 64(inF1) - 1203: 60 ExtInst 1(GLSL.std.450) 37(FMin) 1201 1202 + 1201: 62 Load 65(inF0) + 1202: 62 Load 66(inF1) + 1203: 62 ExtInst 1(GLSL.std.450) 37(FMin) 1201 1202 Store 1200(r031) 1203 - 1205: 60 Load 63(inF0) - 1206: 60 Load 64(inF1) - 1207: 60 ExtInst 1(GLSL.std.450) 26(Pow) 1205 1206 + 1205: 62 Load 65(inF0) + 1206: 62 Load 66(inF1) + 1207: 62 ExtInst 1(GLSL.std.450) 26(Pow) 1205 1206 Store 1204(r032) 1207 - 1209: 60 Load 63(inF0) - 1210: 60 ExtInst 1(GLSL.std.450) 11(Radians) 1209 + 1209: 62 Load 65(inF0) + 1210: 62 ExtInst 1(GLSL.std.450) 11(Radians) 1209 Store 1208(r033) 1210 - 1212: 60 Load 63(inF0) - 1213: 60 ExtInst 1(GLSL.std.450) 2(RoundEven) 1212 + 1212: 62 Load 65(inF0) + 1213: 62 ExtInst 1(GLSL.std.450) 2(RoundEven) 1212 Store 1211(r034) 1213 - 1215: 60 Load 63(inF0) - 1216: 60 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1215 + 1215: 62 Load 65(inF0) + 1216: 62 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1215 Store 1214(r035) 1216 - 1218: 60 Load 63(inF0) - 1219: 24(fvec2) CompositeConstruct 139 139 - 1220: 24(fvec2) CompositeConstruct 289 289 - 1221: 60 ExtInst 1(GLSL.std.450) 43(FClamp) 1218 1219 1220 + 1218: 62 Load 65(inF0) + 1219: 26(fvec2) CompositeConstruct 141 141 + 1220: 26(fvec2) CompositeConstruct 289 289 + 1221: 62 ExtInst 1(GLSL.std.450) 43(FClamp) 1218 1219 1220 Store 1217(r036) 1221 - 1223: 60 Load 63(inF0) - 1224: 60 ExtInst 1(GLSL.std.450) 6(FSign) 1223 + 1223: 62 Load 65(inF0) + 1224: 62 ExtInst 1(GLSL.std.450) 6(FSign) 1223 Store 1222(r037) 1224 - 1226: 60 Load 63(inF0) - 1227: 60 ExtInst 1(GLSL.std.450) 13(Sin) 1226 + 1226: 62 Load 65(inF0) + 1227: 62 ExtInst 1(GLSL.std.450) 13(Sin) 1226 Store 1225(r038) 1227 - 1228: 60 Load 63(inF0) - 1229: 60 ExtInst 1(GLSL.std.450) 13(Sin) 1228 - Store 64(inF1) 1229 - 1230: 60 Load 63(inF0) - 1231: 60 ExtInst 1(GLSL.std.450) 14(Cos) 1230 - Store 65(inF2) 1231 - 1233: 60 Load 63(inF0) - 1234: 60 ExtInst 1(GLSL.std.450) 19(Sinh) 1233 + 1228: 62 Load 65(inF0) + 1229: 62 ExtInst 1(GLSL.std.450) 13(Sin) 1228 + Store 66(inF1) 1229 + 1230: 62 Load 65(inF0) + 1231: 62 ExtInst 1(GLSL.std.450) 14(Cos) 1230 + Store 67(inF2) 1231 + 1233: 62 Load 65(inF0) + 1234: 62 ExtInst 1(GLSL.std.450) 19(Sinh) 1233 Store 1232(r039) 1234 - 1236: 60 Load 63(inF0) - 1237: 60 Load 64(inF1) - 1238: 60 Load 65(inF2) - 1239: 60 ExtInst 1(GLSL.std.450) 49(SmoothStep) 1236 1237 1238 + 1236: 62 Load 65(inF0) + 1237: 62 Load 66(inF1) + 1238: 62 Load 67(inF2) + 1239: 62 ExtInst 1(GLSL.std.450) 49(SmoothStep) 1236 1237 1238 Store 1235(r049) 1239 - 1241: 60 Load 63(inF0) - 1242: 60 ExtInst 1(GLSL.std.450) 31(Sqrt) 1241 + 1241: 62 Load 65(inF0) + 1242: 62 ExtInst 1(GLSL.std.450) 31(Sqrt) 1241 Store 1240(r041) 1242 - 1244: 60 Load 63(inF0) - 1245: 60 Load 64(inF1) - 1246: 60 ExtInst 1(GLSL.std.450) 48(Step) 1244 1245 + 1244: 62 Load 65(inF0) + 1245: 62 Load 66(inF1) + 1246: 62 ExtInst 1(GLSL.std.450) 48(Step) 1244 1245 Store 1243(r042) 1246 - 1248: 60 Load 63(inF0) - 1249: 60 ExtInst 1(GLSL.std.450) 15(Tan) 1248 + 1248: 62 Load 65(inF0) + 1249: 62 ExtInst 1(GLSL.std.450) 15(Tan) 1248 Store 1247(r043) 1249 - 1251: 60 Load 63(inF0) - 1252: 60 ExtInst 1(GLSL.std.450) 21(Tanh) 1251 + 1251: 62 Load 65(inF0) + 1252: 62 ExtInst 1(GLSL.std.450) 21(Tanh) 1251 Store 1250(r044) 1252 - 1253: 60 Load 63(inF0) - 1254: 60 Transpose 1253 - 1256: 60 Load 63(inF0) - 1257: 60 ExtInst 1(GLSL.std.450) 3(Trunc) 1256 + 1253: 62 Load 65(inF0) + 1254: 62 Transpose 1253 + 1256: 62 Load 65(inF0) + 1257: 62 ExtInst 1(GLSL.std.450) 3(Trunc) 1256 Store 1255(r046) 1257 ReturnValue 1259 FunctionEnd -74(PixelShaderFunction3x3(mf33;mf33;mf33;): 68 Function None 70 - 71(inF0): 69(ptr) FunctionParameter - 72(inF1): 69(ptr) FunctionParameter - 73(inF2): 69(ptr) FunctionParameter - 75: Label - 1262(r000): 136(ptr) Variable Function - 1267(r001): 69(ptr) Variable Function - 1272(r003): 136(ptr) Variable Function - 1276(r004): 69(ptr) Variable Function - 1279(r005): 69(ptr) Variable Function - 1282(r006): 69(ptr) Variable Function - 1286(r007): 69(ptr) Variable Function - 1296(r008): 69(ptr) Variable Function - 1301(r009): 69(ptr) Variable Function - 1304(r010): 69(ptr) Variable Function - 1307(r011): 69(ptr) Variable Function - 1310(r012): 69(ptr) Variable Function - 1313(r013): 69(ptr) Variable Function - 1316(r014): 69(ptr) Variable Function - 1319(r015): 69(ptr) Variable Function - 1322(r016): 69(ptr) Variable Function - 1325(r017): 69(ptr) Variable Function +76(PixelShaderFunction3x3(mf33;mf33;mf33;): 70 Function None 72 + 73(inF0): 71(ptr) FunctionParameter + 74(inF1): 71(ptr) FunctionParameter + 75(inF2): 71(ptr) FunctionParameter + 77: Label + 1262(r000): 138(ptr) Variable Function + 1267(r001): 71(ptr) Variable Function + 1272(r003): 138(ptr) Variable Function + 1276(r004): 71(ptr) Variable Function + 1279(r005): 71(ptr) Variable Function + 1282(r006): 71(ptr) Variable Function + 1286(r007): 71(ptr) Variable Function + 1296(r008): 71(ptr) Variable Function + 1301(r009): 71(ptr) Variable Function + 1304(r010): 71(ptr) Variable Function + 1307(r011): 71(ptr) Variable Function + 1310(r012): 71(ptr) Variable Function + 1313(r013): 71(ptr) Variable Function + 1316(r014): 71(ptr) Variable Function + 1319(r015): 71(ptr) Variable Function + 1322(r016): 71(ptr) Variable Function + 1325(r017): 71(ptr) Variable Function 1328(r018): 7(ptr) Variable Function - 1331(r019): 69(ptr) Variable Function - 1334(R020): 69(ptr) Variable Function - 1337(r021): 69(ptr) Variable Function - 1340(r022): 69(ptr) Variable Function - 1353(r023): 69(ptr) Variable Function - 1356(r025): 69(ptr) Variable Function - 1359(r026): 69(ptr) Variable Function - 1363(r026a): 69(ptr) Variable Function - 1368(r027): 69(ptr) Variable Function - 1371(r028): 69(ptr) Variable Function - 1375(r029): 69(ptr) Variable Function - 1378(r030): 69(ptr) Variable Function - 1382(r031): 69(ptr) Variable Function - 1386(r032): 69(ptr) Variable Function - 1390(r033): 69(ptr) Variable Function - 1393(r034): 69(ptr) Variable Function - 1396(r035): 69(ptr) Variable Function - 1399(r036): 69(ptr) Variable Function - 1404(r037): 69(ptr) Variable Function - 1407(r038): 69(ptr) Variable Function - 1414(r039): 69(ptr) Variable Function - 1417(r049): 69(ptr) Variable Function - 1422(r041): 69(ptr) Variable Function - 1425(r042): 69(ptr) Variable Function - 1429(r043): 69(ptr) Variable Function - 1432(r044): 69(ptr) Variable Function - 1437(r046): 69(ptr) Variable Function - 1263: 68 Load 71(inF0) - 1265: 1264 FOrdNotEqual 1263 139 - 1266: 135(bool) All 1265 + 1331(r019): 71(ptr) Variable Function + 1334(R020): 71(ptr) Variable Function + 1337(r021): 71(ptr) Variable Function + 1340(r022): 71(ptr) Variable Function + 1353(r023): 71(ptr) Variable Function + 1356(r025): 71(ptr) Variable Function + 1359(r026): 71(ptr) Variable Function + 1363(r026a): 71(ptr) Variable Function + 1368(r027): 71(ptr) Variable Function + 1371(r028): 71(ptr) Variable Function + 1375(r029): 71(ptr) Variable Function + 1378(r030): 71(ptr) Variable Function + 1382(r031): 71(ptr) Variable Function + 1386(r032): 71(ptr) Variable Function + 1390(r033): 71(ptr) Variable Function + 1393(r034): 71(ptr) Variable Function + 1396(r035): 71(ptr) Variable Function + 1399(r036): 71(ptr) Variable Function + 1404(r037): 71(ptr) Variable Function + 1407(r038): 71(ptr) Variable Function + 1414(r039): 71(ptr) Variable Function + 1417(r049): 71(ptr) Variable Function + 1422(r041): 71(ptr) Variable Function + 1425(r042): 71(ptr) Variable Function + 1429(r043): 71(ptr) Variable Function + 1432(r044): 71(ptr) Variable Function + 1437(r046): 71(ptr) Variable Function + 1263: 70 Load 73(inF0) + 1265: 1264 FOrdNotEqual 1263 141 + 1266: 137(bool) All 1265 Store 1262(r000) 1266 - 1268: 68 Load 71(inF0) - 1269: 68 ExtInst 1(GLSL.std.450) 4(FAbs) 1268 + 1268: 70 Load 73(inF0) + 1269: 70 ExtInst 1(GLSL.std.450) 4(FAbs) 1268 Store 1267(r001) 1269 - 1270: 68 Load 71(inF0) - 1271: 68 ExtInst 1(GLSL.std.450) 17(Acos) 1270 - 1273: 68 Load 71(inF0) - 1274: 1264 FOrdNotEqual 1273 139 - 1275: 135(bool) Any 1274 + 1270: 70 Load 73(inF0) + 1271: 70 ExtInst 1(GLSL.std.450) 17(Acos) 1270 + 1273: 70 Load 73(inF0) + 1274: 1264 FOrdNotEqual 1273 141 + 1275: 137(bool) Any 1274 Store 1272(r003) 1275 - 1277: 68 Load 71(inF0) - 1278: 68 ExtInst 1(GLSL.std.450) 16(Asin) 1277 + 1277: 70 Load 73(inF0) + 1278: 70 ExtInst 1(GLSL.std.450) 16(Asin) 1277 Store 1276(r004) 1278 - 1280: 68 Load 71(inF0) - 1281: 68 ExtInst 1(GLSL.std.450) 18(Atan) 1280 + 1280: 70 Load 73(inF0) + 1281: 70 ExtInst 1(GLSL.std.450) 18(Atan) 1280 Store 1279(r005) 1281 - 1283: 68 Load 71(inF0) - 1284: 68 Load 72(inF1) - 1285: 68 ExtInst 1(GLSL.std.450) 25(Atan2) 1283 1284 + 1283: 70 Load 73(inF0) + 1284: 70 Load 74(inF1) + 1285: 70 ExtInst 1(GLSL.std.450) 25(Atan2) 1283 1284 Store 1282(r006) 1285 - 1287: 68 Load 71(inF0) - 1288: 68 ExtInst 1(GLSL.std.450) 9(Ceil) 1287 + 1287: 70 Load 73(inF0) + 1288: 70 ExtInst 1(GLSL.std.450) 9(Ceil) 1287 Store 1286(r007) 1288 - 1289: 68 Load 71(inF0) + 1289: 70 Load 73(inF0) 1291: 1264 FOrdLessThan 1289 1290 - 1292: 135(bool) Any 1291 + 1292: 137(bool) Any 1291 SelectionMerge 1294 None BranchConditional 1292 1293 1294 1293: Label Kill 1294: Label - 1297: 68 Load 71(inF0) - 1298: 68 Load 72(inF1) - 1299: 68 Load 73(inF2) - 1300: 68 ExtInst 1(GLSL.std.450) 43(FClamp) 1297 1298 1299 + 1297: 70 Load 73(inF0) + 1298: 70 Load 74(inF1) + 1299: 70 Load 75(inF2) + 1300: 70 ExtInst 1(GLSL.std.450) 43(FClamp) 1297 1298 1299 Store 1296(r008) 1300 - 1302: 68 Load 71(inF0) - 1303: 68 ExtInst 1(GLSL.std.450) 14(Cos) 1302 + 1302: 70 Load 73(inF0) + 1303: 70 ExtInst 1(GLSL.std.450) 14(Cos) 1302 Store 1301(r009) 1303 - 1305: 68 Load 71(inF0) - 1306: 68 ExtInst 1(GLSL.std.450) 20(Cosh) 1305 + 1305: 70 Load 73(inF0) + 1306: 70 ExtInst 1(GLSL.std.450) 20(Cosh) 1305 Store 1304(r010) 1306 - 1308: 68 Load 71(inF0) - 1309: 68 DPdx 1308 + 1308: 70 Load 73(inF0) + 1309: 70 DPdx 1308 Store 1307(r011) 1309 - 1311: 68 Load 71(inF0) - 1312: 68 DPdxCoarse 1311 + 1311: 70 Load 73(inF0) + 1312: 70 DPdxCoarse 1311 Store 1310(r012) 1312 - 1314: 68 Load 71(inF0) - 1315: 68 DPdxFine 1314 + 1314: 70 Load 73(inF0) + 1315: 70 DPdxFine 1314 Store 1313(r013) 1315 - 1317: 68 Load 71(inF0) - 1318: 68 DPdy 1317 + 1317: 70 Load 73(inF0) + 1318: 70 DPdy 1317 Store 1316(r014) 1318 - 1320: 68 Load 71(inF0) - 1321: 68 DPdyCoarse 1320 + 1320: 70 Load 73(inF0) + 1321: 70 DPdyCoarse 1320 Store 1319(r015) 1321 - 1323: 68 Load 71(inF0) - 1324: 68 DPdyFine 1323 + 1323: 70 Load 73(inF0) + 1324: 70 DPdyFine 1323 Store 1322(r016) 1324 - 1326: 68 Load 71(inF0) - 1327: 68 ExtInst 1(GLSL.std.450) 12(Degrees) 1326 + 1326: 70 Load 73(inF0) + 1327: 70 ExtInst 1(GLSL.std.450) 12(Degrees) 1326 Store 1325(r017) 1327 - 1329: 68 Load 71(inF0) + 1329: 70 Load 73(inF0) 1330: 6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 1329 Store 1328(r018) 1330 - 1332: 68 Load 71(inF0) - 1333: 68 ExtInst 1(GLSL.std.450) 27(Exp) 1332 + 1332: 70 Load 73(inF0) + 1333: 70 ExtInst 1(GLSL.std.450) 27(Exp) 1332 Store 1331(r019) 1333 - 1335: 68 Load 71(inF0) - 1336: 68 ExtInst 1(GLSL.std.450) 29(Exp2) 1335 + 1335: 70 Load 73(inF0) + 1336: 70 ExtInst 1(GLSL.std.450) 29(Exp2) 1335 Store 1334(R020) 1336 - 1338: 68 Load 71(inF0) - 1339: 68 ExtInst 1(GLSL.std.450) 8(Floor) 1338 + 1338: 70 Load 73(inF0) + 1339: 70 ExtInst 1(GLSL.std.450) 8(Floor) 1338 Store 1337(r021) 1339 - 1341: 68 Load 71(inF0) - 1342: 68 Load 72(inF1) - 1343: 36(fvec3) CompositeExtract 1341 0 - 1344: 36(fvec3) CompositeExtract 1342 0 - 1345: 36(fvec3) FMod 1343 1344 - 1346: 36(fvec3) CompositeExtract 1341 1 - 1347: 36(fvec3) CompositeExtract 1342 1 - 1348: 36(fvec3) FMod 1346 1347 - 1349: 36(fvec3) CompositeExtract 1341 2 - 1350: 36(fvec3) CompositeExtract 1342 2 - 1351: 36(fvec3) FMod 1349 1350 - 1352: 68 CompositeConstruct 1345 1348 1351 + 1341: 70 Load 73(inF0) + 1342: 70 Load 74(inF1) + 1343: 38(fvec3) CompositeExtract 1341 0 + 1344: 38(fvec3) CompositeExtract 1342 0 + 1345: 38(fvec3) FMod 1343 1344 + 1346: 38(fvec3) CompositeExtract 1341 1 + 1347: 38(fvec3) CompositeExtract 1342 1 + 1348: 38(fvec3) FMod 1346 1347 + 1349: 38(fvec3) CompositeExtract 1341 2 + 1350: 38(fvec3) CompositeExtract 1342 2 + 1351: 38(fvec3) FMod 1349 1350 + 1352: 70 CompositeConstruct 1345 1348 1351 Store 1340(r022) 1352 - 1354: 68 Load 71(inF0) - 1355: 68 ExtInst 1(GLSL.std.450) 10(Fract) 1354 + 1354: 70 Load 73(inF0) + 1355: 70 ExtInst 1(GLSL.std.450) 10(Fract) 1354 Store 1353(r023) 1355 - 1357: 68 Load 71(inF0) - 1358: 68 Fwidth 1357 + 1357: 70 Load 73(inF0) + 1358: 70 Fwidth 1357 Store 1356(r025) 1358 - 1360: 68 Load 71(inF0) - 1361: 68 Load 72(inF1) - 1362: 68 ExtInst 1(GLSL.std.450) 53(Ldexp) 1360 1361 + 1360: 70 Load 73(inF0) + 1361: 70 Load 74(inF1) + 1362: 70 ExtInst 1(GLSL.std.450) 53(Ldexp) 1360 1361 Store 1359(r026) 1362 - 1364: 68 Load 71(inF0) - 1365: 68 Load 72(inF1) - 1366: 68 Load 73(inF2) - 1367: 68 ExtInst 1(GLSL.std.450) 46(FMix) 1364 1365 1366 + 1364: 70 Load 73(inF0) + 1365: 70 Load 74(inF1) + 1366: 70 Load 75(inF2) + 1367: 70 ExtInst 1(GLSL.std.450) 46(FMix) 1364 1365 1366 Store 1363(r026a) 1367 - 1369: 68 Load 71(inF0) - 1370: 68 ExtInst 1(GLSL.std.450) 28(Log) 1369 + 1369: 70 Load 73(inF0) + 1370: 70 ExtInst 1(GLSL.std.450) 28(Log) 1369 Store 1368(r027) 1370 - 1372: 68 Load 71(inF0) - 1373: 68 ExtInst 1(GLSL.std.450) 30(Log2) 1372 - 1374: 68 MatrixTimesScalar 1373 268 + 1372: 70 Load 73(inF0) + 1373: 70 ExtInst 1(GLSL.std.450) 30(Log2) 1372 + 1374: 70 MatrixTimesScalar 1373 268 Store 1371(r028) 1374 - 1376: 68 Load 71(inF0) - 1377: 68 ExtInst 1(GLSL.std.450) 30(Log2) 1376 + 1376: 70 Load 73(inF0) + 1377: 70 ExtInst 1(GLSL.std.450) 30(Log2) 1376 Store 1375(r029) 1377 - 1379: 68 Load 71(inF0) - 1380: 68 Load 72(inF1) - 1381: 68 ExtInst 1(GLSL.std.450) 40(FMax) 1379 1380 + 1379: 70 Load 73(inF0) + 1380: 70 Load 74(inF1) + 1381: 70 ExtInst 1(GLSL.std.450) 40(FMax) 1379 1380 Store 1378(r030) 1381 - 1383: 68 Load 71(inF0) - 1384: 68 Load 72(inF1) - 1385: 68 ExtInst 1(GLSL.std.450) 37(FMin) 1383 1384 + 1383: 70 Load 73(inF0) + 1384: 70 Load 74(inF1) + 1385: 70 ExtInst 1(GLSL.std.450) 37(FMin) 1383 1384 Store 1382(r031) 1385 - 1387: 68 Load 71(inF0) - 1388: 68 Load 72(inF1) - 1389: 68 ExtInst 1(GLSL.std.450) 26(Pow) 1387 1388 + 1387: 70 Load 73(inF0) + 1388: 70 Load 74(inF1) + 1389: 70 ExtInst 1(GLSL.std.450) 26(Pow) 1387 1388 Store 1386(r032) 1389 - 1391: 68 Load 71(inF0) - 1392: 68 ExtInst 1(GLSL.std.450) 11(Radians) 1391 + 1391: 70 Load 73(inF0) + 1392: 70 ExtInst 1(GLSL.std.450) 11(Radians) 1391 Store 1390(r033) 1392 - 1394: 68 Load 71(inF0) - 1395: 68 ExtInst 1(GLSL.std.450) 2(RoundEven) 1394 + 1394: 70 Load 73(inF0) + 1395: 70 ExtInst 1(GLSL.std.450) 2(RoundEven) 1394 Store 1393(r034) 1395 - 1397: 68 Load 71(inF0) - 1398: 68 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1397 + 1397: 70 Load 73(inF0) + 1398: 70 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1397 Store 1396(r035) 1398 - 1400: 68 Load 71(inF0) - 1401: 36(fvec3) CompositeConstruct 139 139 139 - 1402: 36(fvec3) CompositeConstruct 289 289 289 - 1403: 68 ExtInst 1(GLSL.std.450) 43(FClamp) 1400 1401 1402 + 1400: 70 Load 73(inF0) + 1401: 38(fvec3) CompositeConstruct 141 141 141 + 1402: 38(fvec3) CompositeConstruct 289 289 289 + 1403: 70 ExtInst 1(GLSL.std.450) 43(FClamp) 1400 1401 1402 Store 1399(r036) 1403 - 1405: 68 Load 71(inF0) - 1406: 68 ExtInst 1(GLSL.std.450) 6(FSign) 1405 + 1405: 70 Load 73(inF0) + 1406: 70 ExtInst 1(GLSL.std.450) 6(FSign) 1405 Store 1404(r037) 1406 - 1408: 68 Load 71(inF0) - 1409: 68 ExtInst 1(GLSL.std.450) 13(Sin) 1408 + 1408: 70 Load 73(inF0) + 1409: 70 ExtInst 1(GLSL.std.450) 13(Sin) 1408 Store 1407(r038) 1409 - 1410: 68 Load 71(inF0) - 1411: 68 ExtInst 1(GLSL.std.450) 13(Sin) 1410 - Store 72(inF1) 1411 - 1412: 68 Load 71(inF0) - 1413: 68 ExtInst 1(GLSL.std.450) 14(Cos) 1412 - Store 73(inF2) 1413 - 1415: 68 Load 71(inF0) - 1416: 68 ExtInst 1(GLSL.std.450) 19(Sinh) 1415 + 1410: 70 Load 73(inF0) + 1411: 70 ExtInst 1(GLSL.std.450) 13(Sin) 1410 + Store 74(inF1) 1411 + 1412: 70 Load 73(inF0) + 1413: 70 ExtInst 1(GLSL.std.450) 14(Cos) 1412 + Store 75(inF2) 1413 + 1415: 70 Load 73(inF0) + 1416: 70 ExtInst 1(GLSL.std.450) 19(Sinh) 1415 Store 1414(r039) 1416 - 1418: 68 Load 71(inF0) - 1419: 68 Load 72(inF1) - 1420: 68 Load 73(inF2) - 1421: 68 ExtInst 1(GLSL.std.450) 49(SmoothStep) 1418 1419 1420 + 1418: 70 Load 73(inF0) + 1419: 70 Load 74(inF1) + 1420: 70 Load 75(inF2) + 1421: 70 ExtInst 1(GLSL.std.450) 49(SmoothStep) 1418 1419 1420 Store 1417(r049) 1421 - 1423: 68 Load 71(inF0) - 1424: 68 ExtInst 1(GLSL.std.450) 31(Sqrt) 1423 + 1423: 70 Load 73(inF0) + 1424: 70 ExtInst 1(GLSL.std.450) 31(Sqrt) 1423 Store 1422(r041) 1424 - 1426: 68 Load 71(inF0) - 1427: 68 Load 72(inF1) - 1428: 68 ExtInst 1(GLSL.std.450) 48(Step) 1426 1427 + 1426: 70 Load 73(inF0) + 1427: 70 Load 74(inF1) + 1428: 70 ExtInst 1(GLSL.std.450) 48(Step) 1426 1427 Store 1425(r042) 1428 - 1430: 68 Load 71(inF0) - 1431: 68 ExtInst 1(GLSL.std.450) 15(Tan) 1430 + 1430: 70 Load 73(inF0) + 1431: 70 ExtInst 1(GLSL.std.450) 15(Tan) 1430 Store 1429(r043) 1431 - 1433: 68 Load 71(inF0) - 1434: 68 ExtInst 1(GLSL.std.450) 21(Tanh) 1433 + 1433: 70 Load 73(inF0) + 1434: 70 ExtInst 1(GLSL.std.450) 21(Tanh) 1433 Store 1432(r044) 1434 - 1435: 68 Load 71(inF0) - 1436: 68 Transpose 1435 - 1438: 68 Load 71(inF0) - 1439: 68 ExtInst 1(GLSL.std.450) 3(Trunc) 1438 + 1435: 70 Load 73(inF0) + 1436: 70 Transpose 1435 + 1438: 70 Load 73(inF0) + 1439: 70 ExtInst 1(GLSL.std.450) 3(Trunc) 1438 Store 1437(r046) 1439 ReturnValue 1441 FunctionEnd -82(PixelShaderFunction4x4(mf44;mf44;mf44;): 76 Function None 78 - 79(inF0): 77(ptr) FunctionParameter - 80(inF1): 77(ptr) FunctionParameter - 81(inF2): 77(ptr) FunctionParameter - 83: Label - 1444(r000): 136(ptr) Variable Function - 1449(r001): 77(ptr) Variable Function - 1454(r003): 136(ptr) Variable Function - 1458(r004): 77(ptr) Variable Function - 1461(r005): 77(ptr) Variable Function - 1464(r006): 77(ptr) Variable Function - 1468(r007): 77(ptr) Variable Function - 1478(r008): 77(ptr) Variable Function - 1483(r009): 77(ptr) Variable Function - 1486(r010): 77(ptr) Variable Function - 1489(r011): 77(ptr) Variable Function - 1492(r012): 77(ptr) Variable Function - 1495(r013): 77(ptr) Variable Function - 1498(r014): 77(ptr) Variable Function - 1501(r015): 77(ptr) Variable Function - 1504(r016): 77(ptr) Variable Function - 1507(r017): 77(ptr) Variable Function +84(PixelShaderFunction4x4(mf44;mf44;mf44;): 78 Function None 80 + 81(inF0): 79(ptr) FunctionParameter + 82(inF1): 79(ptr) FunctionParameter + 83(inF2): 79(ptr) FunctionParameter + 85: Label + 1444(r000): 138(ptr) Variable Function + 1449(r001): 79(ptr) Variable Function + 1454(r003): 138(ptr) Variable Function + 1458(r004): 79(ptr) Variable Function + 1461(r005): 79(ptr) Variable Function + 1464(r006): 79(ptr) Variable Function + 1468(r007): 79(ptr) Variable Function + 1478(r008): 79(ptr) Variable Function + 1483(r009): 79(ptr) Variable Function + 1486(r010): 79(ptr) Variable Function + 1489(r011): 79(ptr) Variable Function + 1492(r012): 79(ptr) Variable Function + 1495(r013): 79(ptr) Variable Function + 1498(r014): 79(ptr) Variable Function + 1501(r015): 79(ptr) Variable Function + 1504(r016): 79(ptr) Variable Function + 1507(r017): 79(ptr) Variable Function 1510(r018): 7(ptr) Variable Function - 1513(r019): 77(ptr) Variable Function - 1516(R020): 77(ptr) Variable Function - 1519(r021): 77(ptr) Variable Function - 1522(r022): 77(ptr) Variable Function - 1538(r023): 77(ptr) Variable Function - 1541(r025): 77(ptr) Variable Function - 1544(r026): 77(ptr) Variable Function - 1548(r026a): 77(ptr) Variable Function - 1553(r027): 77(ptr) Variable Function - 1556(r028): 77(ptr) Variable Function - 1560(r029): 77(ptr) Variable Function - 1563(r030): 77(ptr) Variable Function - 1567(r031): 77(ptr) Variable Function - 1571(r032): 77(ptr) Variable Function - 1575(r033): 77(ptr) Variable Function - 1578(r034): 77(ptr) Variable Function - 1581(r035): 77(ptr) Variable Function - 1584(r036): 77(ptr) Variable Function - 1589(r037): 77(ptr) Variable Function - 1592(r038): 77(ptr) Variable Function - 1599(r039): 77(ptr) Variable Function - 1602(r049): 77(ptr) Variable Function - 1607(r041): 77(ptr) Variable Function - 1610(r042): 77(ptr) Variable Function - 1614(r043): 77(ptr) Variable Function - 1617(r044): 77(ptr) Variable Function - 1622(r046): 77(ptr) Variable Function - 1445: 76 Load 79(inF0) - 1447: 1446 FOrdNotEqual 1445 139 - 1448: 135(bool) All 1447 + 1513(r019): 79(ptr) Variable Function + 1516(R020): 79(ptr) Variable Function + 1519(r021): 79(ptr) Variable Function + 1522(r022): 79(ptr) Variable Function + 1538(r023): 79(ptr) Variable Function + 1541(r025): 79(ptr) Variable Function + 1544(r026): 79(ptr) Variable Function + 1548(r026a): 79(ptr) Variable Function + 1553(r027): 79(ptr) Variable Function + 1556(r028): 79(ptr) Variable Function + 1560(r029): 79(ptr) Variable Function + 1563(r030): 79(ptr) Variable Function + 1567(r031): 79(ptr) Variable Function + 1571(r032): 79(ptr) Variable Function + 1575(r033): 79(ptr) Variable Function + 1578(r034): 79(ptr) Variable Function + 1581(r035): 79(ptr) Variable Function + 1584(r036): 79(ptr) Variable Function + 1589(r037): 79(ptr) Variable Function + 1592(r038): 79(ptr) Variable Function + 1599(r039): 79(ptr) Variable Function + 1602(r049): 79(ptr) Variable Function + 1607(r041): 79(ptr) Variable Function + 1610(r042): 79(ptr) Variable Function + 1614(r043): 79(ptr) Variable Function + 1617(r044): 79(ptr) Variable Function + 1622(r046): 79(ptr) Variable Function + 1445: 78 Load 81(inF0) + 1447: 1446 FOrdNotEqual 1445 141 + 1448: 137(bool) All 1447 Store 1444(r000) 1448 - 1450: 76 Load 79(inF0) - 1451: 76 ExtInst 1(GLSL.std.450) 4(FAbs) 1450 + 1450: 78 Load 81(inF0) + 1451: 78 ExtInst 1(GLSL.std.450) 4(FAbs) 1450 Store 1449(r001) 1451 - 1452: 76 Load 79(inF0) - 1453: 76 ExtInst 1(GLSL.std.450) 17(Acos) 1452 - 1455: 76 Load 79(inF0) - 1456: 1446 FOrdNotEqual 1455 139 - 1457: 135(bool) Any 1456 + 1452: 78 Load 81(inF0) + 1453: 78 ExtInst 1(GLSL.std.450) 17(Acos) 1452 + 1455: 78 Load 81(inF0) + 1456: 1446 FOrdNotEqual 1455 141 + 1457: 137(bool) Any 1456 Store 1454(r003) 1457 - 1459: 76 Load 79(inF0) - 1460: 76 ExtInst 1(GLSL.std.450) 16(Asin) 1459 + 1459: 78 Load 81(inF0) + 1460: 78 ExtInst 1(GLSL.std.450) 16(Asin) 1459 Store 1458(r004) 1460 - 1462: 76 Load 79(inF0) - 1463: 76 ExtInst 1(GLSL.std.450) 18(Atan) 1462 + 1462: 78 Load 81(inF0) + 1463: 78 ExtInst 1(GLSL.std.450) 18(Atan) 1462 Store 1461(r005) 1463 - 1465: 76 Load 79(inF0) - 1466: 76 Load 80(inF1) - 1467: 76 ExtInst 1(GLSL.std.450) 25(Atan2) 1465 1466 + 1465: 78 Load 81(inF0) + 1466: 78 Load 82(inF1) + 1467: 78 ExtInst 1(GLSL.std.450) 25(Atan2) 1465 1466 Store 1464(r006) 1467 - 1469: 76 Load 79(inF0) - 1470: 76 ExtInst 1(GLSL.std.450) 9(Ceil) 1469 + 1469: 78 Load 81(inF0) + 1470: 78 ExtInst 1(GLSL.std.450) 9(Ceil) 1469 Store 1468(r007) 1470 - 1471: 76 Load 79(inF0) + 1471: 78 Load 81(inF0) 1473: 1446 FOrdLessThan 1471 1472 - 1474: 135(bool) Any 1473 + 1474: 137(bool) Any 1473 SelectionMerge 1476 None BranchConditional 1474 1475 1476 1475: Label Kill 1476: Label - 1479: 76 Load 79(inF0) - 1480: 76 Load 80(inF1) - 1481: 76 Load 81(inF2) - 1482: 76 ExtInst 1(GLSL.std.450) 43(FClamp) 1479 1480 1481 + 1479: 78 Load 81(inF0) + 1480: 78 Load 82(inF1) + 1481: 78 Load 83(inF2) + 1482: 78 ExtInst 1(GLSL.std.450) 43(FClamp) 1479 1480 1481 Store 1478(r008) 1482 - 1484: 76 Load 79(inF0) - 1485: 76 ExtInst 1(GLSL.std.450) 14(Cos) 1484 + 1484: 78 Load 81(inF0) + 1485: 78 ExtInst 1(GLSL.std.450) 14(Cos) 1484 Store 1483(r009) 1485 - 1487: 76 Load 79(inF0) - 1488: 76 ExtInst 1(GLSL.std.450) 20(Cosh) 1487 + 1487: 78 Load 81(inF0) + 1488: 78 ExtInst 1(GLSL.std.450) 20(Cosh) 1487 Store 1486(r010) 1488 - 1490: 76 Load 79(inF0) - 1491: 76 DPdx 1490 + 1490: 78 Load 81(inF0) + 1491: 78 DPdx 1490 Store 1489(r011) 1491 - 1493: 76 Load 79(inF0) - 1494: 76 DPdxCoarse 1493 + 1493: 78 Load 81(inF0) + 1494: 78 DPdxCoarse 1493 Store 1492(r012) 1494 - 1496: 76 Load 79(inF0) - 1497: 76 DPdxFine 1496 + 1496: 78 Load 81(inF0) + 1497: 78 DPdxFine 1496 Store 1495(r013) 1497 - 1499: 76 Load 79(inF0) - 1500: 76 DPdy 1499 + 1499: 78 Load 81(inF0) + 1500: 78 DPdy 1499 Store 1498(r014) 1500 - 1502: 76 Load 79(inF0) - 1503: 76 DPdyCoarse 1502 + 1502: 78 Load 81(inF0) + 1503: 78 DPdyCoarse 1502 Store 1501(r015) 1503 - 1505: 76 Load 79(inF0) - 1506: 76 DPdyFine 1505 + 1505: 78 Load 81(inF0) + 1506: 78 DPdyFine 1505 Store 1504(r016) 1506 - 1508: 76 Load 79(inF0) - 1509: 76 ExtInst 1(GLSL.std.450) 12(Degrees) 1508 + 1508: 78 Load 81(inF0) + 1509: 78 ExtInst 1(GLSL.std.450) 12(Degrees) 1508 Store 1507(r017) 1509 - 1511: 76 Load 79(inF0) + 1511: 78 Load 81(inF0) 1512: 6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 1511 Store 1510(r018) 1512 - 1514: 76 Load 79(inF0) - 1515: 76 ExtInst 1(GLSL.std.450) 27(Exp) 1514 + 1514: 78 Load 81(inF0) + 1515: 78 ExtInst 1(GLSL.std.450) 27(Exp) 1514 Store 1513(r019) 1515 - 1517: 76 Load 79(inF0) - 1518: 76 ExtInst 1(GLSL.std.450) 29(Exp2) 1517 + 1517: 78 Load 81(inF0) + 1518: 78 ExtInst 1(GLSL.std.450) 29(Exp2) 1517 Store 1516(R020) 1518 - 1520: 76 Load 79(inF0) - 1521: 76 ExtInst 1(GLSL.std.450) 8(Floor) 1520 + 1520: 78 Load 81(inF0) + 1521: 78 ExtInst 1(GLSL.std.450) 8(Floor) 1520 Store 1519(r021) 1521 - 1523: 76 Load 79(inF0) - 1524: 76 Load 80(inF1) - 1525: 48(fvec4) CompositeExtract 1523 0 - 1526: 48(fvec4) CompositeExtract 1524 0 - 1527: 48(fvec4) FMod 1525 1526 - 1528: 48(fvec4) CompositeExtract 1523 1 - 1529: 48(fvec4) CompositeExtract 1524 1 - 1530: 48(fvec4) FMod 1528 1529 - 1531: 48(fvec4) CompositeExtract 1523 2 - 1532: 48(fvec4) CompositeExtract 1524 2 - 1533: 48(fvec4) FMod 1531 1532 - 1534: 48(fvec4) CompositeExtract 1523 3 - 1535: 48(fvec4) CompositeExtract 1524 3 - 1536: 48(fvec4) FMod 1534 1535 - 1537: 76 CompositeConstruct 1527 1530 1533 1536 + 1523: 78 Load 81(inF0) + 1524: 78 Load 82(inF1) + 1525: 50(fvec4) CompositeExtract 1523 0 + 1526: 50(fvec4) CompositeExtract 1524 0 + 1527: 50(fvec4) FMod 1525 1526 + 1528: 50(fvec4) CompositeExtract 1523 1 + 1529: 50(fvec4) CompositeExtract 1524 1 + 1530: 50(fvec4) FMod 1528 1529 + 1531: 50(fvec4) CompositeExtract 1523 2 + 1532: 50(fvec4) CompositeExtract 1524 2 + 1533: 50(fvec4) FMod 1531 1532 + 1534: 50(fvec4) CompositeExtract 1523 3 + 1535: 50(fvec4) CompositeExtract 1524 3 + 1536: 50(fvec4) FMod 1534 1535 + 1537: 78 CompositeConstruct 1527 1530 1533 1536 Store 1522(r022) 1537 - 1539: 76 Load 79(inF0) - 1540: 76 ExtInst 1(GLSL.std.450) 10(Fract) 1539 + 1539: 78 Load 81(inF0) + 1540: 78 ExtInst 1(GLSL.std.450) 10(Fract) 1539 Store 1538(r023) 1540 - 1542: 76 Load 79(inF0) - 1543: 76 Fwidth 1542 + 1542: 78 Load 81(inF0) + 1543: 78 Fwidth 1542 Store 1541(r025) 1543 - 1545: 76 Load 79(inF0) - 1546: 76 Load 80(inF1) - 1547: 76 ExtInst 1(GLSL.std.450) 53(Ldexp) 1545 1546 + 1545: 78 Load 81(inF0) + 1546: 78 Load 82(inF1) + 1547: 78 ExtInst 1(GLSL.std.450) 53(Ldexp) 1545 1546 Store 1544(r026) 1547 - 1549: 76 Load 79(inF0) - 1550: 76 Load 80(inF1) - 1551: 76 Load 81(inF2) - 1552: 76 ExtInst 1(GLSL.std.450) 46(FMix) 1549 1550 1551 + 1549: 78 Load 81(inF0) + 1550: 78 Load 82(inF1) + 1551: 78 Load 83(inF2) + 1552: 78 ExtInst 1(GLSL.std.450) 46(FMix) 1549 1550 1551 Store 1548(r026a) 1552 - 1554: 76 Load 79(inF0) - 1555: 76 ExtInst 1(GLSL.std.450) 28(Log) 1554 + 1554: 78 Load 81(inF0) + 1555: 78 ExtInst 1(GLSL.std.450) 28(Log) 1554 Store 1553(r027) 1555 - 1557: 76 Load 79(inF0) - 1558: 76 ExtInst 1(GLSL.std.450) 30(Log2) 1557 - 1559: 76 MatrixTimesScalar 1558 268 + 1557: 78 Load 81(inF0) + 1558: 78 ExtInst 1(GLSL.std.450) 30(Log2) 1557 + 1559: 78 MatrixTimesScalar 1558 268 Store 1556(r028) 1559 - 1561: 76 Load 79(inF0) - 1562: 76 ExtInst 1(GLSL.std.450) 30(Log2) 1561 + 1561: 78 Load 81(inF0) + 1562: 78 ExtInst 1(GLSL.std.450) 30(Log2) 1561 Store 1560(r029) 1562 - 1564: 76 Load 79(inF0) - 1565: 76 Load 80(inF1) - 1566: 76 ExtInst 1(GLSL.std.450) 40(FMax) 1564 1565 + 1564: 78 Load 81(inF0) + 1565: 78 Load 82(inF1) + 1566: 78 ExtInst 1(GLSL.std.450) 40(FMax) 1564 1565 Store 1563(r030) 1566 - 1568: 76 Load 79(inF0) - 1569: 76 Load 80(inF1) - 1570: 76 ExtInst 1(GLSL.std.450) 37(FMin) 1568 1569 + 1568: 78 Load 81(inF0) + 1569: 78 Load 82(inF1) + 1570: 78 ExtInst 1(GLSL.std.450) 37(FMin) 1568 1569 Store 1567(r031) 1570 - 1572: 76 Load 79(inF0) - 1573: 76 Load 80(inF1) - 1574: 76 ExtInst 1(GLSL.std.450) 26(Pow) 1572 1573 + 1572: 78 Load 81(inF0) + 1573: 78 Load 82(inF1) + 1574: 78 ExtInst 1(GLSL.std.450) 26(Pow) 1572 1573 Store 1571(r032) 1574 - 1576: 76 Load 79(inF0) - 1577: 76 ExtInst 1(GLSL.std.450) 11(Radians) 1576 + 1576: 78 Load 81(inF0) + 1577: 78 ExtInst 1(GLSL.std.450) 11(Radians) 1576 Store 1575(r033) 1577 - 1579: 76 Load 79(inF0) - 1580: 76 ExtInst 1(GLSL.std.450) 2(RoundEven) 1579 + 1579: 78 Load 81(inF0) + 1580: 78 ExtInst 1(GLSL.std.450) 2(RoundEven) 1579 Store 1578(r034) 1580 - 1582: 76 Load 79(inF0) - 1583: 76 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1582 + 1582: 78 Load 81(inF0) + 1583: 78 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1582 Store 1581(r035) 1583 - 1585: 76 Load 79(inF0) - 1586: 48(fvec4) CompositeConstruct 139 139 139 139 - 1587: 48(fvec4) CompositeConstruct 289 289 289 289 - 1588: 76 ExtInst 1(GLSL.std.450) 43(FClamp) 1585 1586 1587 + 1585: 78 Load 81(inF0) + 1586: 50(fvec4) CompositeConstruct 141 141 141 141 + 1587: 50(fvec4) CompositeConstruct 289 289 289 289 + 1588: 78 ExtInst 1(GLSL.std.450) 43(FClamp) 1585 1586 1587 Store 1584(r036) 1588 - 1590: 76 Load 79(inF0) - 1591: 76 ExtInst 1(GLSL.std.450) 6(FSign) 1590 + 1590: 78 Load 81(inF0) + 1591: 78 ExtInst 1(GLSL.std.450) 6(FSign) 1590 Store 1589(r037) 1591 - 1593: 76 Load 79(inF0) - 1594: 76 ExtInst 1(GLSL.std.450) 13(Sin) 1593 + 1593: 78 Load 81(inF0) + 1594: 78 ExtInst 1(GLSL.std.450) 13(Sin) 1593 Store 1592(r038) 1594 - 1595: 76 Load 79(inF0) - 1596: 76 ExtInst 1(GLSL.std.450) 13(Sin) 1595 - Store 80(inF1) 1596 - 1597: 76 Load 79(inF0) - 1598: 76 ExtInst 1(GLSL.std.450) 14(Cos) 1597 - Store 81(inF2) 1598 - 1600: 76 Load 79(inF0) - 1601: 76 ExtInst 1(GLSL.std.450) 19(Sinh) 1600 + 1595: 78 Load 81(inF0) + 1596: 78 ExtInst 1(GLSL.std.450) 13(Sin) 1595 + Store 82(inF1) 1596 + 1597: 78 Load 81(inF0) + 1598: 78 ExtInst 1(GLSL.std.450) 14(Cos) 1597 + Store 83(inF2) 1598 + 1600: 78 Load 81(inF0) + 1601: 78 ExtInst 1(GLSL.std.450) 19(Sinh) 1600 Store 1599(r039) 1601 - 1603: 76 Load 79(inF0) - 1604: 76 Load 80(inF1) - 1605: 76 Load 81(inF2) - 1606: 76 ExtInst 1(GLSL.std.450) 49(SmoothStep) 1603 1604 1605 + 1603: 78 Load 81(inF0) + 1604: 78 Load 82(inF1) + 1605: 78 Load 83(inF2) + 1606: 78 ExtInst 1(GLSL.std.450) 49(SmoothStep) 1603 1604 1605 Store 1602(r049) 1606 - 1608: 76 Load 79(inF0) - 1609: 76 ExtInst 1(GLSL.std.450) 31(Sqrt) 1608 + 1608: 78 Load 81(inF0) + 1609: 78 ExtInst 1(GLSL.std.450) 31(Sqrt) 1608 Store 1607(r041) 1609 - 1611: 76 Load 79(inF0) - 1612: 76 Load 80(inF1) - 1613: 76 ExtInst 1(GLSL.std.450) 48(Step) 1611 1612 + 1611: 78 Load 81(inF0) + 1612: 78 Load 82(inF1) + 1613: 78 ExtInst 1(GLSL.std.450) 48(Step) 1611 1612 Store 1610(r042) 1613 - 1615: 76 Load 79(inF0) - 1616: 76 ExtInst 1(GLSL.std.450) 15(Tan) 1615 + 1615: 78 Load 81(inF0) + 1616: 78 ExtInst 1(GLSL.std.450) 15(Tan) 1615 Store 1614(r043) 1616 - 1618: 76 Load 79(inF0) - 1619: 76 ExtInst 1(GLSL.std.450) 21(Tanh) 1618 + 1618: 78 Load 81(inF0) + 1619: 78 ExtInst 1(GLSL.std.450) 21(Tanh) 1618 Store 1617(r044) 1619 - 1620: 76 Load 79(inF0) - 1621: 76 Transpose 1620 - 1623: 76 Load 79(inF0) - 1624: 76 ExtInst 1(GLSL.std.450) 3(Trunc) 1623 + 1620: 78 Load 81(inF0) + 1621: 78 Transpose 1620 + 1623: 78 Load 81(inF0) + 1624: 78 ExtInst 1(GLSL.std.450) 3(Trunc) 1623 Store 1622(r046) 1624 ReturnValue 1626 FunctionEnd -91(TestGenMul2(f1;f1;vf2;vf2;mf22;mf22;): 2 Function None 84 - 85(inF0): 7(ptr) FunctionParameter - 86(inF1): 7(ptr) FunctionParameter - 87(inFV0): 25(ptr) FunctionParameter - 88(inFV1): 25(ptr) FunctionParameter - 89(inFM0): 61(ptr) FunctionParameter - 90(inFM1): 61(ptr) FunctionParameter - 92: Label +93(TestGenMul2(f1;f1;vf2;vf2;mf22;mf22;): 2 Function None 86 + 87(inF0): 7(ptr) FunctionParameter + 88(inF1): 7(ptr) FunctionParameter + 89(inFV0): 27(ptr) FunctionParameter + 90(inFV1): 27(ptr) FunctionParameter + 91(inFM0): 63(ptr) FunctionParameter + 92(inFM1): 63(ptr) FunctionParameter + 94: Label 1629(r0): 7(ptr) Variable Function - 1633(r1): 25(ptr) Variable Function - 1637(r2): 25(ptr) Variable Function + 1633(r1): 27(ptr) Variable Function + 1637(r2): 27(ptr) Variable Function 1641(r3): 7(ptr) Variable Function - 1645(r4): 25(ptr) Variable Function - 1649(r5): 25(ptr) Variable Function - 1653(r6): 61(ptr) Variable Function - 1657(r7): 61(ptr) Variable Function - 1661(r8): 61(ptr) Variable Function - 1630: 6(float) Load 86(inF1) - 1631: 6(float) Load 85(inF0) + 1645(r4): 27(ptr) Variable Function + 1649(r5): 27(ptr) Variable Function + 1653(r6): 63(ptr) Variable Function + 1657(r7): 63(ptr) Variable Function + 1661(r8): 63(ptr) Variable Function + 1630: 6(float) Load 88(inF1) + 1631: 6(float) Load 87(inF0) 1632: 6(float) FMul 1630 1631 Store 1629(r0) 1632 - 1634: 6(float) Load 85(inF0) - 1635: 24(fvec2) Load 87(inFV0) - 1636: 24(fvec2) VectorTimesScalar 1635 1634 + 1634: 6(float) Load 87(inF0) + 1635: 26(fvec2) Load 89(inFV0) + 1636: 26(fvec2) VectorTimesScalar 1635 1634 Store 1633(r1) 1636 - 1638: 24(fvec2) Load 87(inFV0) - 1639: 6(float) Load 85(inF0) - 1640: 24(fvec2) VectorTimesScalar 1638 1639 + 1638: 26(fvec2) Load 89(inFV0) + 1639: 6(float) Load 87(inF0) + 1640: 26(fvec2) VectorTimesScalar 1638 1639 Store 1637(r2) 1640 - 1642: 24(fvec2) Load 87(inFV0) - 1643: 24(fvec2) Load 88(inFV1) + 1642: 26(fvec2) Load 89(inFV0) + 1643: 26(fvec2) Load 90(inFV1) 1644: 6(float) Dot 1642 1643 Store 1641(r3) 1644 - 1646: 24(fvec2) Load 87(inFV0) - 1647: 60 Load 89(inFM0) - 1648: 24(fvec2) VectorTimesMatrix 1646 1647 + 1646: 26(fvec2) Load 89(inFV0) + 1647: 62 Load 91(inFM0) + 1648: 26(fvec2) VectorTimesMatrix 1646 1647 Store 1645(r4) 1648 - 1650: 60 Load 89(inFM0) - 1651: 24(fvec2) Load 87(inFV0) - 1652: 24(fvec2) MatrixTimesVector 1650 1651 + 1650: 62 Load 91(inFM0) + 1651: 26(fvec2) Load 89(inFV0) + 1652: 26(fvec2) MatrixTimesVector 1650 1651 Store 1649(r5) 1652 - 1654: 6(float) Load 85(inF0) - 1655: 60 Load 89(inFM0) - 1656: 60 MatrixTimesScalar 1655 1654 + 1654: 6(float) Load 87(inF0) + 1655: 62 Load 91(inFM0) + 1656: 62 MatrixTimesScalar 1655 1654 Store 1653(r6) 1656 - 1658: 60 Load 89(inFM0) - 1659: 6(float) Load 85(inF0) - 1660: 60 MatrixTimesScalar 1658 1659 + 1658: 62 Load 91(inFM0) + 1659: 6(float) Load 87(inF0) + 1660: 62 MatrixTimesScalar 1658 1659 Store 1657(r7) 1660 - 1662: 60 Load 90(inFM1) - 1663: 60 Load 89(inFM0) - 1664: 60 MatrixTimesMatrix 1662 1663 + 1662: 62 Load 92(inFM1) + 1663: 62 Load 91(inFM0) + 1664: 62 MatrixTimesMatrix 1662 1663 Store 1661(r8) 1664 Return FunctionEnd -100(TestGenMul3(f1;f1;vf3;vf3;mf33;mf33;): 2 Function None 93 - 94(inF0): 7(ptr) FunctionParameter - 95(inF1): 7(ptr) FunctionParameter - 96(inFV0): 37(ptr) FunctionParameter - 97(inFV1): 37(ptr) FunctionParameter - 98(inFM0): 69(ptr) FunctionParameter - 99(inFM1): 69(ptr) FunctionParameter - 101: Label +102(TestGenMul3(f1;f1;vf3;vf3;mf33;mf33;): 2 Function None 95 + 96(inF0): 7(ptr) FunctionParameter + 97(inF1): 7(ptr) FunctionParameter + 98(inFV0): 39(ptr) FunctionParameter + 99(inFV1): 39(ptr) FunctionParameter + 100(inFM0): 71(ptr) FunctionParameter + 101(inFM1): 71(ptr) FunctionParameter + 103: Label 1665(r0): 7(ptr) Variable Function - 1669(r1): 37(ptr) Variable Function - 1673(r2): 37(ptr) Variable Function + 1669(r1): 39(ptr) Variable Function + 1673(r2): 39(ptr) Variable Function 1677(r3): 7(ptr) Variable Function - 1681(r4): 37(ptr) Variable Function - 1685(r5): 37(ptr) Variable Function - 1689(r6): 69(ptr) Variable Function - 1693(r7): 69(ptr) Variable Function - 1697(r8): 69(ptr) Variable Function - 1666: 6(float) Load 95(inF1) - 1667: 6(float) Load 94(inF0) + 1681(r4): 39(ptr) Variable Function + 1685(r5): 39(ptr) Variable Function + 1689(r6): 71(ptr) Variable Function + 1693(r7): 71(ptr) Variable Function + 1697(r8): 71(ptr) Variable Function + 1666: 6(float) Load 97(inF1) + 1667: 6(float) Load 96(inF0) 1668: 6(float) FMul 1666 1667 Store 1665(r0) 1668 - 1670: 6(float) Load 94(inF0) - 1671: 36(fvec3) Load 96(inFV0) - 1672: 36(fvec3) VectorTimesScalar 1671 1670 + 1670: 6(float) Load 96(inF0) + 1671: 38(fvec3) Load 98(inFV0) + 1672: 38(fvec3) VectorTimesScalar 1671 1670 Store 1669(r1) 1672 - 1674: 36(fvec3) Load 96(inFV0) - 1675: 6(float) Load 94(inF0) - 1676: 36(fvec3) VectorTimesScalar 1674 1675 + 1674: 38(fvec3) Load 98(inFV0) + 1675: 6(float) Load 96(inF0) + 1676: 38(fvec3) VectorTimesScalar 1674 1675 Store 1673(r2) 1676 - 1678: 36(fvec3) Load 96(inFV0) - 1679: 36(fvec3) Load 97(inFV1) + 1678: 38(fvec3) Load 98(inFV0) + 1679: 38(fvec3) Load 99(inFV1) 1680: 6(float) Dot 1678 1679 Store 1677(r3) 1680 - 1682: 36(fvec3) Load 96(inFV0) - 1683: 68 Load 98(inFM0) - 1684: 36(fvec3) VectorTimesMatrix 1682 1683 + 1682: 38(fvec3) Load 98(inFV0) + 1683: 70 Load 100(inFM0) + 1684: 38(fvec3) VectorTimesMatrix 1682 1683 Store 1681(r4) 1684 - 1686: 68 Load 98(inFM0) - 1687: 36(fvec3) Load 96(inFV0) - 1688: 36(fvec3) MatrixTimesVector 1686 1687 + 1686: 70 Load 100(inFM0) + 1687: 38(fvec3) Load 98(inFV0) + 1688: 38(fvec3) MatrixTimesVector 1686 1687 Store 1685(r5) 1688 - 1690: 6(float) Load 94(inF0) - 1691: 68 Load 98(inFM0) - 1692: 68 MatrixTimesScalar 1691 1690 + 1690: 6(float) Load 96(inF0) + 1691: 70 Load 100(inFM0) + 1692: 70 MatrixTimesScalar 1691 1690 Store 1689(r6) 1692 - 1694: 68 Load 98(inFM0) - 1695: 6(float) Load 94(inF0) - 1696: 68 MatrixTimesScalar 1694 1695 + 1694: 70 Load 100(inFM0) + 1695: 6(float) Load 96(inF0) + 1696: 70 MatrixTimesScalar 1694 1695 Store 1693(r7) 1696 - 1698: 68 Load 99(inFM1) - 1699: 68 Load 98(inFM0) - 1700: 68 MatrixTimesMatrix 1698 1699 + 1698: 70 Load 101(inFM1) + 1699: 70 Load 100(inFM0) + 1700: 70 MatrixTimesMatrix 1698 1699 Store 1697(r8) 1700 Return FunctionEnd -109(TestGenMul4(f1;f1;vf4;vf4;mf44;mf44;): 2 Function None 102 - 103(inF0): 7(ptr) FunctionParameter - 104(inF1): 7(ptr) FunctionParameter - 105(inFV0): 49(ptr) FunctionParameter - 106(inFV1): 49(ptr) FunctionParameter - 107(inFM0): 77(ptr) FunctionParameter - 108(inFM1): 77(ptr) FunctionParameter - 110: Label +111(TestGenMul4(f1;f1;vf4;vf4;mf44;mf44;): 2 Function None 104 + 105(inF0): 7(ptr) FunctionParameter + 106(inF1): 7(ptr) FunctionParameter + 107(inFV0): 51(ptr) FunctionParameter + 108(inFV1): 51(ptr) FunctionParameter + 109(inFM0): 79(ptr) FunctionParameter + 110(inFM1): 79(ptr) FunctionParameter + 112: Label 1701(r0): 7(ptr) Variable Function - 1705(r1): 49(ptr) Variable Function - 1709(r2): 49(ptr) Variable Function + 1705(r1): 51(ptr) Variable Function + 1709(r2): 51(ptr) Variable Function 1713(r3): 7(ptr) Variable Function - 1717(r4): 49(ptr) Variable Function - 1721(r5): 49(ptr) Variable Function - 1725(r6): 77(ptr) Variable Function - 1729(r7): 77(ptr) Variable Function - 1733(r8): 77(ptr) Variable Function - 1702: 6(float) Load 104(inF1) - 1703: 6(float) Load 103(inF0) + 1717(r4): 51(ptr) Variable Function + 1721(r5): 51(ptr) Variable Function + 1725(r6): 79(ptr) Variable Function + 1729(r7): 79(ptr) Variable Function + 1733(r8): 79(ptr) Variable Function + 1702: 6(float) Load 106(inF1) + 1703: 6(float) Load 105(inF0) 1704: 6(float) FMul 1702 1703 Store 1701(r0) 1704 - 1706: 6(float) Load 103(inF0) - 1707: 48(fvec4) Load 105(inFV0) - 1708: 48(fvec4) VectorTimesScalar 1707 1706 + 1706: 6(float) Load 105(inF0) + 1707: 50(fvec4) Load 107(inFV0) + 1708: 50(fvec4) VectorTimesScalar 1707 1706 Store 1705(r1) 1708 - 1710: 48(fvec4) Load 105(inFV0) - 1711: 6(float) Load 103(inF0) - 1712: 48(fvec4) VectorTimesScalar 1710 1711 + 1710: 50(fvec4) Load 107(inFV0) + 1711: 6(float) Load 105(inF0) + 1712: 50(fvec4) VectorTimesScalar 1710 1711 Store 1709(r2) 1712 - 1714: 48(fvec4) Load 105(inFV0) - 1715: 48(fvec4) Load 106(inFV1) + 1714: 50(fvec4) Load 107(inFV0) + 1715: 50(fvec4) Load 108(inFV1) 1716: 6(float) Dot 1714 1715 Store 1713(r3) 1716 - 1718: 48(fvec4) Load 105(inFV0) - 1719: 76 Load 107(inFM0) - 1720: 48(fvec4) VectorTimesMatrix 1718 1719 + 1718: 50(fvec4) Load 107(inFV0) + 1719: 78 Load 109(inFM0) + 1720: 50(fvec4) VectorTimesMatrix 1718 1719 Store 1717(r4) 1720 - 1722: 76 Load 107(inFM0) - 1723: 48(fvec4) Load 105(inFV0) - 1724: 48(fvec4) MatrixTimesVector 1722 1723 + 1722: 78 Load 109(inFM0) + 1723: 50(fvec4) Load 107(inFV0) + 1724: 50(fvec4) MatrixTimesVector 1722 1723 Store 1721(r5) 1724 - 1726: 6(float) Load 103(inF0) - 1727: 76 Load 107(inFM0) - 1728: 76 MatrixTimesScalar 1727 1726 + 1726: 6(float) Load 105(inF0) + 1727: 78 Load 109(inFM0) + 1728: 78 MatrixTimesScalar 1727 1726 Store 1725(r6) 1728 - 1730: 76 Load 107(inFM0) - 1731: 6(float) Load 103(inF0) - 1732: 76 MatrixTimesScalar 1730 1731 + 1730: 78 Load 109(inFM0) + 1731: 6(float) Load 105(inF0) + 1732: 78 MatrixTimesScalar 1730 1731 Store 1729(r7) 1732 - 1734: 76 Load 108(inFM1) - 1735: 76 Load 107(inFM0) - 1736: 76 MatrixTimesMatrix 1734 1735 + 1734: 78 Load 110(inFM1) + 1735: 78 Load 109(inFM0) + 1736: 78 MatrixTimesMatrix 1734 1735 Store 1733(r8) 1736 Return FunctionEnd -129(TestGenMulNxM(f1;f1;vf2;vf3;mf23;mf32;mf33;mf34;mf24;): 2 Function None 119 - 120(inF0): 7(ptr) FunctionParameter - 121(inF1): 7(ptr) FunctionParameter - 122(inFV2): 25(ptr) FunctionParameter - 123(inFV3): 37(ptr) FunctionParameter - 124(inFM2x3): 112(ptr) FunctionParameter - 125(inFM3x2): 114(ptr) FunctionParameter - 126(inFM3x3): 69(ptr) FunctionParameter - 127(inFM3x4): 116(ptr) FunctionParameter - 128(inFM2x4): 118(ptr) FunctionParameter - 130: Label +131(TestGenMulNxM(f1;f1;vf2;vf3;mf23;mf32;mf33;mf34;mf24;): 2 Function None 121 + 122(inF0): 7(ptr) FunctionParameter + 123(inF1): 7(ptr) FunctionParameter + 124(inFV2): 27(ptr) FunctionParameter + 125(inFV3): 39(ptr) FunctionParameter + 126(inFM2x3): 114(ptr) FunctionParameter + 127(inFM3x2): 116(ptr) FunctionParameter + 128(inFM3x3): 71(ptr) FunctionParameter + 129(inFM3x4): 118(ptr) FunctionParameter + 130(inFM2x4): 120(ptr) FunctionParameter + 132: Label 1737(r00): 7(ptr) Variable Function - 1741(r01): 25(ptr) Variable Function - 1745(r02): 37(ptr) Variable Function - 1749(r03): 25(ptr) Variable Function - 1753(r04): 37(ptr) Variable Function + 1741(r01): 27(ptr) Variable Function + 1745(r02): 39(ptr) Variable Function + 1749(r03): 27(ptr) Variable Function + 1753(r04): 39(ptr) Variable Function 1757(r05): 7(ptr) Variable Function 1761(r06): 7(ptr) Variable Function - 1765(r07): 37(ptr) Variable Function - 1769(r08): 25(ptr) Variable Function - 1773(r09): 25(ptr) Variable Function - 1777(r10): 37(ptr) Variable Function - 1781(r11): 112(ptr) Variable Function - 1785(r12): 114(ptr) Variable Function - 1789(r13): 61(ptr) Variable Function - 1793(r14): 112(ptr) Variable Function - 1797(r15): 118(ptr) Variable Function - 1801(r16): 116(ptr) Variable Function - 1738: 6(float) Load 121(inF1) - 1739: 6(float) Load 120(inF0) + 1765(r07): 39(ptr) Variable Function + 1769(r08): 27(ptr) Variable Function + 1773(r09): 27(ptr) Variable Function + 1777(r10): 39(ptr) Variable Function + 1781(r11): 114(ptr) Variable Function + 1785(r12): 116(ptr) Variable Function + 1789(r13): 63(ptr) Variable Function + 1793(r14): 114(ptr) Variable Function + 1797(r15): 120(ptr) Variable Function + 1801(r16): 118(ptr) Variable Function + 1738: 6(float) Load 123(inF1) + 1739: 6(float) Load 122(inF0) 1740: 6(float) FMul 1738 1739 Store 1737(r00) 1740 - 1742: 6(float) Load 120(inF0) - 1743: 24(fvec2) Load 122(inFV2) - 1744: 24(fvec2) VectorTimesScalar 1743 1742 + 1742: 6(float) Load 122(inF0) + 1743: 26(fvec2) Load 124(inFV2) + 1744: 26(fvec2) VectorTimesScalar 1743 1742 Store 1741(r01) 1744 - 1746: 6(float) Load 120(inF0) - 1747: 36(fvec3) Load 123(inFV3) - 1748: 36(fvec3) VectorTimesScalar 1747 1746 + 1746: 6(float) Load 122(inF0) + 1747: 38(fvec3) Load 125(inFV3) + 1748: 38(fvec3) VectorTimesScalar 1747 1746 Store 1745(r02) 1748 - 1750: 24(fvec2) Load 122(inFV2) - 1751: 6(float) Load 120(inF0) - 1752: 24(fvec2) VectorTimesScalar 1750 1751 + 1750: 26(fvec2) Load 124(inFV2) + 1751: 6(float) Load 122(inF0) + 1752: 26(fvec2) VectorTimesScalar 1750 1751 Store 1749(r03) 1752 - 1754: 36(fvec3) Load 123(inFV3) - 1755: 6(float) Load 120(inF0) - 1756: 36(fvec3) VectorTimesScalar 1754 1755 + 1754: 38(fvec3) Load 125(inFV3) + 1755: 6(float) Load 122(inF0) + 1756: 38(fvec3) VectorTimesScalar 1754 1755 Store 1753(r04) 1756 - 1758: 24(fvec2) Load 122(inFV2) - 1759: 24(fvec2) Load 122(inFV2) + 1758: 26(fvec2) Load 124(inFV2) + 1759: 26(fvec2) Load 124(inFV2) 1760: 6(float) Dot 1758 1759 Store 1757(r05) 1760 - 1762: 36(fvec3) Load 123(inFV3) - 1763: 36(fvec3) Load 123(inFV3) + 1762: 38(fvec3) Load 125(inFV3) + 1763: 38(fvec3) Load 125(inFV3) 1764: 6(float) Dot 1762 1763 Store 1761(r06) 1764 - 1766: 111 Load 124(inFM2x3) - 1767: 24(fvec2) Load 122(inFV2) - 1768: 36(fvec3) MatrixTimesVector 1766 1767 + 1766: 113 Load 126(inFM2x3) + 1767: 26(fvec2) Load 124(inFV2) + 1768: 38(fvec3) MatrixTimesVector 1766 1767 Store 1765(r07) 1768 - 1770: 113 Load 125(inFM3x2) - 1771: 36(fvec3) Load 123(inFV3) - 1772: 24(fvec2) MatrixTimesVector 1770 1771 + 1770: 115 Load 127(inFM3x2) + 1771: 38(fvec3) Load 125(inFV3) + 1772: 26(fvec2) MatrixTimesVector 1770 1771 Store 1769(r08) 1772 - 1774: 36(fvec3) Load 123(inFV3) - 1775: 111 Load 124(inFM2x3) - 1776: 24(fvec2) VectorTimesMatrix 1774 1775 + 1774: 38(fvec3) Load 125(inFV3) + 1775: 113 Load 126(inFM2x3) + 1776: 26(fvec2) VectorTimesMatrix 1774 1775 Store 1773(r09) 1776 - 1778: 24(fvec2) Load 122(inFV2) - 1779: 113 Load 125(inFM3x2) - 1780: 36(fvec3) VectorTimesMatrix 1778 1779 + 1778: 26(fvec2) Load 124(inFV2) + 1779: 115 Load 127(inFM3x2) + 1780: 38(fvec3) VectorTimesMatrix 1778 1779 Store 1777(r10) 1780 - 1782: 6(float) Load 120(inF0) - 1783: 111 Load 124(inFM2x3) - 1784: 111 MatrixTimesScalar 1783 1782 + 1782: 6(float) Load 122(inF0) + 1783: 113 Load 126(inFM2x3) + 1784: 113 MatrixTimesScalar 1783 1782 Store 1781(r11) 1784 - 1786: 6(float) Load 120(inF0) - 1787: 113 Load 125(inFM3x2) - 1788: 113 MatrixTimesScalar 1787 1786 + 1786: 6(float) Load 122(inF0) + 1787: 115 Load 127(inFM3x2) + 1788: 115 MatrixTimesScalar 1787 1786 Store 1785(r12) 1788 - 1790: 113 Load 125(inFM3x2) - 1791: 111 Load 124(inFM2x3) - 1792: 60 MatrixTimesMatrix 1790 1791 + 1790: 115 Load 127(inFM3x2) + 1791: 113 Load 126(inFM2x3) + 1792: 62 MatrixTimesMatrix 1790 1791 Store 1789(r13) 1792 - 1794: 68 Load 126(inFM3x3) - 1795: 111 Load 124(inFM2x3) - 1796: 111 MatrixTimesMatrix 1794 1795 + 1794: 70 Load 128(inFM3x3) + 1795: 113 Load 126(inFM2x3) + 1796: 113 MatrixTimesMatrix 1794 1795 Store 1793(r14) 1796 - 1798: 115 Load 127(inFM3x4) - 1799: 111 Load 124(inFM2x3) - 1800: 117 MatrixTimesMatrix 1798 1799 + 1798: 117 Load 129(inFM3x4) + 1799: 113 Load 126(inFM2x3) + 1800: 119 MatrixTimesMatrix 1798 1799 Store 1797(r15) 1800 - 1802: 117 Load 128(inFM2x4) - 1803: 113 Load 125(inFM3x2) - 1804: 115 MatrixTimesMatrix 1802 1803 + 1802: 119 Load 130(inFM2x4) + 1803: 115 Load 127(inFM3x2) + 1804: 117 MatrixTimesMatrix 1802 1803 Store 1801(r16) 1804 Return FunctionEnd - 133(@main():131(PS_OUTPUT) Function None 132 - 134: Label + 135(@main():133(PS_OUTPUT) Function None 134 + 136: Label 1806(ps_output): 1805(ptr) Variable Function - 1808: 49(ptr) AccessChain 1806(ps_output) 187 + 1808: 51(ptr) AccessChain 1806(ps_output) 187 Store 1808 1807 - 1809:131(PS_OUTPUT) Load 1806(ps_output) + 1809:133(PS_OUTPUT) Load 1806(ps_output) ReturnValue 1809 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.lit.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.lit.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.lit.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.lit.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -18,7 +18,7 @@ 0:3 'n_dot_l' ( in float) 0:3 Constant: 0:3 0.000000 -0:3 Test condition and select ( temp float) +0:3 Test condition and select ( temp float): no shortcircuit 0:3 Condition 0:3 Compare Less Than ( temp bool) 0:3 min ( temp float) @@ -79,7 +79,7 @@ 0:3 'n_dot_l' ( in float) 0:3 Constant: 0:3 0.000000 -0:3 Test condition and select ( temp float) +0:3 Test condition and select ( temp float): no shortcircuit 0:3 Condition 0:3 Compare Less Than ( temp bool) 0:3 min ( temp float) @@ -118,13 +118,13 @@ 0:? 'm' (layout( location=2) in float) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 52 +// Generated by (magic number): 80006 +// Id's are bound by 48 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "PixelShaderFunction" 37 40 43 + EntryPoint Fragment 4 "PixelShaderFunction" 33 36 39 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "PixelShaderFunction" @@ -133,18 +133,18 @@ Name 10 "n_dot_h" Name 11 "m" Name 16 "r0" - Name 35 "n_dot_l" - Name 37 "n_dot_l" - Name 39 "n_dot_h" - Name 40 "n_dot_h" - Name 42 "m" - Name 43 "m" + Name 31 "n_dot_l" + Name 33 "n_dot_l" + Name 35 "n_dot_h" + Name 36 "n_dot_h" + Name 38 "m" + Name 39 "m" + Name 41 "param" + Name 43 "param" Name 45 "param" - Name 47 "param" - Name 49 "param" - Decorate 37(n_dot_l) Location 0 - Decorate 40(n_dot_h) Location 1 - Decorate 43(m) Location 2 + Decorate 33(n_dot_l) Location 0 + Decorate 36(n_dot_h) Location 1 + Decorate 39(m) Location 2 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -154,32 +154,32 @@ 15: TypePointer Function 14(fvec4) 17: 6(float) Constant 1065353216 19: 6(float) Constant 0 - 25: TypeBool - 36: TypePointer Input 6(float) - 37(n_dot_l): 36(ptr) Variable Input - 40(n_dot_h): 36(ptr) Variable Input - 43(m): 36(ptr) Variable Input + 24: TypeBool + 32: TypePointer Input 6(float) + 33(n_dot_l): 32(ptr) Variable Input + 36(n_dot_h): 32(ptr) Variable Input + 39(m): 32(ptr) Variable Input 4(PixelShaderFunction): 2 Function None 3 5: Label - 35(n_dot_l): 7(ptr) Variable Function - 39(n_dot_h): 7(ptr) Variable Function - 42(m): 7(ptr) Variable Function + 31(n_dot_l): 7(ptr) Variable Function + 35(n_dot_h): 7(ptr) Variable Function + 38(m): 7(ptr) Variable Function + 41(param): 7(ptr) Variable Function + 43(param): 7(ptr) Variable Function 45(param): 7(ptr) Variable Function - 47(param): 7(ptr) Variable Function - 49(param): 7(ptr) Variable Function - 38: 6(float) Load 37(n_dot_l) - Store 35(n_dot_l) 38 - 41: 6(float) Load 40(n_dot_h) - Store 39(n_dot_h) 41 - 44: 6(float) Load 43(m) - Store 42(m) 44 - 46: 6(float) Load 35(n_dot_l) + 34: 6(float) Load 33(n_dot_l) + Store 31(n_dot_l) 34 + 37: 6(float) Load 36(n_dot_h) + Store 35(n_dot_h) 37 + 40: 6(float) Load 39(m) + Store 38(m) 40 + 42: 6(float) Load 31(n_dot_l) + Store 41(param) 42 + 44: 6(float) Load 35(n_dot_h) + Store 43(param) 44 + 46: 6(float) Load 38(m) Store 45(param) 46 - 48: 6(float) Load 39(n_dot_h) - Store 47(param) 48 - 50: 6(float) Load 42(m) - Store 49(param) 50 - 51: 2 FunctionCall 12(@PixelShaderFunction(f1;f1;f1;) 45(param) 47(param) 49(param) + 47: 2 FunctionCall 12(@PixelShaderFunction(f1;f1;f1;) 41(param) 43(param) 45(param) Return FunctionEnd 12(@PixelShaderFunction(f1;f1;f1;): 2 Function None 8 @@ -188,27 +188,17 @@ 11(m): 7(ptr) FunctionParameter 13: Label 16(r0): 15(ptr) Variable Function - 21: 7(ptr) Variable Function 18: 6(float) Load 9(n_dot_l) 20: 6(float) ExtInst 1(GLSL.std.450) 40(FMax) 18 19 - 22: 6(float) Load 9(n_dot_l) - 23: 6(float) Load 10(n_dot_h) - 24: 6(float) ExtInst 1(GLSL.std.450) 37(FMin) 22 23 - 26: 25(bool) FOrdLessThan 24 19 - SelectionMerge 28 None - BranchConditional 26 27 29 - 27: Label - Store 21 19 - Branch 28 - 29: Label - 30: 6(float) Load 10(n_dot_h) - 31: 6(float) Load 11(m) - 32: 6(float) FMul 30 31 - Store 21 32 - Branch 28 - 28: Label - 33: 6(float) Load 21 - 34: 14(fvec4) CompositeConstruct 17 20 33 17 - Store 16(r0) 34 + 21: 6(float) Load 9(n_dot_l) + 22: 6(float) Load 10(n_dot_h) + 23: 6(float) ExtInst 1(GLSL.std.450) 37(FMin) 21 22 + 25: 24(bool) FOrdLessThan 23 19 + 26: 6(float) Load 10(n_dot_h) + 27: 6(float) Load 11(m) + 28: 6(float) FMul 26 27 + 29: 6(float) Select 25 19 28 + 30: 14(fvec4) CompositeConstruct 17 20 29 17 + Store 16(r0) 30 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.negative.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.negative.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.negative.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.negative.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -180,7 +180,7 @@ 0:? 'inI0' (layout( location=3) in 4-component vector of int) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 99 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.negative.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.negative.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.negative.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.negative.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -308,7 +308,7 @@ 0:? 'inI0' (layout( location=3) in 4-component vector of int) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 155 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.promote.down.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.promote.down.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.promote.down.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.promote.down.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -104,7 +104,7 @@ 0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 50 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -888,7 +888,7 @@ 0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 322 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -204,7 +204,7 @@ 0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 80 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.intrinsics.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.intrinsics.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -2779,7 +2779,7 @@ 0:? Linker Objects // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 1225 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.isfinite.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.isfinite.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.isfinite.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.isfinite.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -172,7 +172,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 85 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.layout.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.layout.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.layout.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.layout.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -6,23 +6,33 @@ 0:16 Function Parameters: 0:16 'input' ( in 4-component vector of float) 0:? Sequence -0:17 Branch: Return with expression -0:17 add ( temp 4-component vector of float) -0:17 add ( temp 4-component vector of float) -0:17 add ( temp 4-component vector of float) -0:17 'input' ( in 4-component vector of float) -0:17 v1: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float) -0:17 'anon@0' (layout( set=3 binding=5 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1}) -0:17 Constant: -0:17 0 (const uint) -0:17 v5: direct index for structure (layout( row_major std430 offset=0) buffer 4-component vector of float) -0:17 'anon@1' (layout( row_major std430 push_constant) readonly buffer block{layout( row_major std430 offset=0) buffer 4-component vector of float v5}) -0:17 Constant: -0:17 0 (const uint) -0:17 v1PostLayout: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float) -0:17 'anon@2' (layout( set=4 binding=7 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1PostLayout}) -0:17 Constant: -0:17 0 (const uint) +0:17 Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'layout' ( temp 4-component vector of float) +0:17 Constant: +0:17 2.000000 +0:17 2.000000 +0:17 2.000000 +0:17 2.000000 +0:18 Branch: Return with expression +0:18 add ( temp 4-component vector of float) +0:18 add ( temp 4-component vector of float) +0:18 add ( temp 4-component vector of float) +0:18 'input' ( in 4-component vector of float) +0:18 v1: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float) +0:18 'anon@0' (layout( set=3 binding=5 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1}) +0:18 Constant: +0:18 0 (const uint) +0:18 v5: direct index for structure (layout( row_major std430 offset=0) buffer 4-component vector of float) +0:18 'anon@1' (layout( row_major std430 push_constant) readonly buffer block{layout( row_major std430 offset=0) buffer 4-component vector of float v5}) +0:18 Constant: +0:18 0 (const uint) +0:18 component-wise multiply ( temp 4-component vector of float) +0:18 v1PostLayout: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float) +0:18 'anon@2' (layout( set=4 binding=7 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1PostLayout}) +0:18 Constant: +0:18 0 (const uint) +0:18 'layout' ( temp 4-component vector of float) 0:? Linker Objects 0:? 'anon@0' (layout( set=3 binding=5 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1}) 0:? 'anon@1' (layout( row_major std430 push_constant) readonly buffer block{layout( row_major std430 offset=0) buffer 4-component vector of float v5}) @@ -42,23 +52,33 @@ 0:16 Function Parameters: 0:16 'input' ( in 4-component vector of float) 0:? Sequence -0:17 Branch: Return with expression -0:17 add ( temp 4-component vector of float) -0:17 add ( temp 4-component vector of float) -0:17 add ( temp 4-component vector of float) -0:17 'input' ( in 4-component vector of float) -0:17 v1: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float) -0:17 'anon@0' (layout( set=3 binding=5 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1}) -0:17 Constant: -0:17 0 (const uint) -0:17 v5: direct index for structure (layout( row_major std430 offset=0) buffer 4-component vector of float) -0:17 'anon@1' (layout( row_major std430 push_constant) readonly buffer block{layout( row_major std430 offset=0) buffer 4-component vector of float v5}) -0:17 Constant: -0:17 0 (const uint) -0:17 v1PostLayout: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float) -0:17 'anon@2' (layout( set=4 binding=7 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1PostLayout}) -0:17 Constant: -0:17 0 (const uint) +0:17 Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'layout' ( temp 4-component vector of float) +0:17 Constant: +0:17 2.000000 +0:17 2.000000 +0:17 2.000000 +0:17 2.000000 +0:18 Branch: Return with expression +0:18 add ( temp 4-component vector of float) +0:18 add ( temp 4-component vector of float) +0:18 add ( temp 4-component vector of float) +0:18 'input' ( in 4-component vector of float) +0:18 v1: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float) +0:18 'anon@0' (layout( set=3 binding=5 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1}) +0:18 Constant: +0:18 0 (const uint) +0:18 v5: direct index for structure (layout( row_major std430 offset=0) buffer 4-component vector of float) +0:18 'anon@1' (layout( row_major std430 push_constant) readonly buffer block{layout( row_major std430 offset=0) buffer 4-component vector of float v5}) +0:18 Constant: +0:18 0 (const uint) +0:18 component-wise multiply ( temp 4-component vector of float) +0:18 v1PostLayout: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float) +0:18 'anon@2' (layout( set=4 binding=7 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1PostLayout}) +0:18 Constant: +0:18 0 (const uint) +0:18 'layout' ( temp 4-component vector of float) 0:? Linker Objects 0:? 'anon@0' (layout( set=3 binding=5 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1}) 0:? 'anon@1' (layout( row_major std430 push_constant) readonly buffer block{layout( row_major std430 offset=0) buffer 4-component vector of float v5}) @@ -67,8 +87,8 @@ 0:? 'anon@2' (layout( set=4 binding=7 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1PostLayout}) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 39 +// Generated by (magic number): 80006 +// Id's are bound by 44 Capability Shader 1: ExtInstImport "GLSL.std.450" @@ -79,50 +99,53 @@ Name 4 "main" Name 11 "PixelShaderFunction(vf4;" Name 10 "input" - Name 14 "tbufName" - MemberName 14(tbufName) 0 "v1" - Name 16 "" - Name 23 "tbufName2" - MemberName 23(tbufName2) 0 "v5" - Name 25 "" - Name 30 "tbufName2" - MemberName 30(tbufName2) 0 "v1PostLayout" - Name 32 "" - Name 38 "specConst" - MemberDecorate 14(tbufName) 0 NonWritable - MemberDecorate 14(tbufName) 0 Offset 16 - Decorate 14(tbufName) BufferBlock - Decorate 16 DescriptorSet 3 - Decorate 16 Binding 5 - MemberDecorate 23(tbufName2) 0 NonWritable - MemberDecorate 23(tbufName2) 0 Offset 0 - Decorate 23(tbufName2) BufferBlock - MemberDecorate 30(tbufName2) 0 NonWritable - MemberDecorate 30(tbufName2) 0 Offset 16 - Decorate 30(tbufName2) BufferBlock - Decorate 32 DescriptorSet 4 - Decorate 32 Binding 7 - Decorate 38(specConst) SpecId 17 + Name 13 "layout" + Name 17 "tbufName" + MemberName 17(tbufName) 0 "v1" + Name 19 "" + Name 26 "tbufName2" + MemberName 26(tbufName2) 0 "v5" + Name 28 "" + Name 33 "tbufName2" + MemberName 33(tbufName2) 0 "v1PostLayout" + Name 35 "" + Name 43 "specConst" + MemberDecorate 17(tbufName) 0 NonWritable + MemberDecorate 17(tbufName) 0 Offset 16 + Decorate 17(tbufName) BufferBlock + Decorate 19 DescriptorSet 3 + Decorate 19 Binding 5 + MemberDecorate 26(tbufName2) 0 NonWritable + MemberDecorate 26(tbufName2) 0 Offset 0 + Decorate 26(tbufName2) BufferBlock + MemberDecorate 33(tbufName2) 0 NonWritable + MemberDecorate 33(tbufName2) 0 Offset 16 + Decorate 33(tbufName2) BufferBlock + Decorate 35 DescriptorSet 4 + Decorate 35 Binding 7 + Decorate 43(specConst) SpecId 17 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 7: TypeVector 6(float) 4 8: TypePointer Function 7(fvec4) 9: TypeFunction 7(fvec4) 8(ptr) - 14(tbufName): TypeStruct 7(fvec4) - 15: TypePointer Uniform 14(tbufName) - 16: 15(ptr) Variable Uniform - 17: TypeInt 32 1 - 18: 17(int) Constant 0 - 19: TypePointer Uniform 7(fvec4) - 23(tbufName2): TypeStruct 7(fvec4) - 24: TypePointer PushConstant 23(tbufName2) - 25: 24(ptr) Variable PushConstant - 26: TypePointer PushConstant 7(fvec4) - 30(tbufName2): TypeStruct 7(fvec4) - 31: TypePointer Uniform 30(tbufName2) - 32: 31(ptr) Variable Uniform - 38(specConst): 17(int) SpecConstant 10 + 14: 6(float) Constant 1073741824 + 15: 7(fvec4) ConstantComposite 14 14 14 14 + 17(tbufName): TypeStruct 7(fvec4) + 18: TypePointer Uniform 17(tbufName) + 19: 18(ptr) Variable Uniform + 20: TypeInt 32 1 + 21: 20(int) Constant 0 + 22: TypePointer Uniform 7(fvec4) + 26(tbufName2): TypeStruct 7(fvec4) + 27: TypePointer PushConstant 26(tbufName2) + 28: 27(ptr) Variable PushConstant + 29: TypePointer PushConstant 7(fvec4) + 33(tbufName2): TypeStruct 7(fvec4) + 34: TypePointer Uniform 33(tbufName2) + 35: 34(ptr) Variable Uniform + 43(specConst): 20(int) SpecConstant 10 4(main): 2 Function None 3 5: Label Return @@ -130,15 +153,19 @@ 11(PixelShaderFunction(vf4;): 7(fvec4) Function None 9 10(input): 8(ptr) FunctionParameter 12: Label - 13: 7(fvec4) Load 10(input) - 20: 19(ptr) AccessChain 16 18 - 21: 7(fvec4) Load 20 - 22: 7(fvec4) FAdd 13 21 - 27: 26(ptr) AccessChain 25 18 - 28: 7(fvec4) Load 27 - 29: 7(fvec4) FAdd 22 28 - 33: 19(ptr) AccessChain 32 18 - 34: 7(fvec4) Load 33 - 35: 7(fvec4) FAdd 29 34 - ReturnValue 35 + 13(layout): 8(ptr) Variable Function + Store 13(layout) 15 + 16: 7(fvec4) Load 10(input) + 23: 22(ptr) AccessChain 19 21 + 24: 7(fvec4) Load 23 + 25: 7(fvec4) FAdd 16 24 + 30: 29(ptr) AccessChain 28 21 + 31: 7(fvec4) Load 30 + 32: 7(fvec4) FAdd 25 31 + 36: 22(ptr) AccessChain 35 21 + 37: 7(fvec4) Load 36 + 38: 7(fvec4) Load 13(layout) + 39: 7(fvec4) FMul 37 38 + 40: 7(fvec4) FAdd 32 39 + ReturnValue 40 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.layoutOverride.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.layoutOverride.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.layoutOverride.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.layoutOverride.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,104 @@ +hlsl.layoutOverride.vert +Shader version: 500 +0:? Sequence +0:5 Function Definition: @main( ( temp 4-component vector of float) +0:5 Function Parameters: +0:? Sequence +0:6 Branch: Return with expression +0:6 texture ( temp 4-component vector of float) +0:6 Construct combined texture-sampler ( temp sampler2D) +0:6 'tex' (layout( set=2 binding=0) uniform texture2D) +0:6 'samp' ( uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:5 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tex' (layout( set=2 binding=0) uniform texture2D) +0:? 'samp' ( uniform sampler) +0:? '@entryPointOutput' ( out 4-component vector of float Position) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:5 Function Definition: @main( ( temp 4-component vector of float) +0:5 Function Parameters: +0:? Sequence +0:6 Branch: Return with expression +0:6 texture ( temp 4-component vector of float) +0:6 Construct combined texture-sampler ( temp sampler2D) +0:6 'tex' (layout( set=2 binding=0) uniform texture2D) +0:6 'samp' ( uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:5 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tex' (layout( set=2 binding=0) uniform texture2D) +0:? 'samp' ( uniform sampler) +0:? '@entryPointOutput' ( out 4-component vector of float Position) + +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 32 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 30 + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 13 "tex" + Name 17 "samp" + Name 30 "@entryPointOutput" + Decorate 13(tex) DescriptorSet 2 + Decorate 13(tex) Binding 0 + Decorate 17(samp) DescriptorSet 0 + Decorate 30(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeImage 6(float) 2D sampled format:Unknown + 12: TypePointer UniformConstant 11 + 13(tex): 12(ptr) Variable UniformConstant + 15: TypeSampler + 16: TypePointer UniformConstant 15 + 17(samp): 16(ptr) Variable UniformConstant + 19: TypeSampledImage 11 + 21: TypeVector 6(float) 2 + 22: 6(float) Constant 1045220557 + 23: 6(float) Constant 1050253722 + 24: 21(fvec2) ConstantComposite 22 23 + 25: 6(float) Constant 0 + 29: TypePointer Output 7(fvec4) +30(@entryPointOutput): 29(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 31: 7(fvec4) FunctionCall 9(@main() + Store 30(@entryPointOutput) 31 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 14: 11 Load 13(tex) + 18: 15 Load 17(samp) + 20: 19 SampledImage 14 18 + 26: 7(fvec4) ImageSampleExplicitLod 20 24 Lod 25 + ReturnValue 26 + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.load.2dms.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:28 Function Parameters: @@ -181,6 +182,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:28 Function Parameters: @@ -356,7 +358,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 130 Capability Shader @@ -365,6 +367,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 120 124 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.load.array.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:48 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:48 Function Parameters: @@ -196,6 +197,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:48 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:48 Function Parameters: @@ -386,7 +388,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 159 Capability Shader @@ -396,6 +398,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 104 108 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.basic.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.basic.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.basic.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.basic.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.load.basic.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:48 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:48 Function Parameters: @@ -247,6 +248,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:48 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:48 Function Parameters: @@ -488,7 +490,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 179 Capability Shader @@ -498,6 +500,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 133 137 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -452,7 +452,7 @@ 0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 171 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.load.buffer.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -85,6 +86,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -164,7 +166,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 72 Capability Shader @@ -173,6 +175,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 64 68 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.load.buffer.float.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -88,6 +89,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -170,7 +172,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 75 Capability Shader @@ -179,6 +181,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 67 71 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.load.offsetarray.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:48 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:48 Function Parameters: @@ -220,6 +221,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:48 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:48 Function Parameters: @@ -434,7 +436,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 174 Capability Shader @@ -445,6 +447,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 119 123 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.load.offset.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:48 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:48 Function Parameters: @@ -283,6 +284,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:48 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:48 Function Parameters: @@ -560,7 +562,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 201 Capability Shader @@ -571,6 +573,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 155 159 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -110,7 +110,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 57 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.load.rwtexture.array.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:40 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:40 Function Parameters: @@ -106,6 +107,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:40 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:40 Function Parameters: @@ -206,7 +208,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 119 Capability Shader @@ -215,6 +217,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 82 86 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.load.rwtexture.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:40 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:40 Function Parameters: @@ -124,6 +125,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:40 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:40 Function Parameters: @@ -242,7 +244,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 132 Capability Shader @@ -251,6 +253,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 104 108 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.localStructuredBuffer.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.localStructuredBuffer.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.localStructuredBuffer.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.localStructuredBuffer.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,7 +1,11 @@ hlsl.localStructuredBuffer.comp +ERROR: 0:3: 'block initializer' : buffer aliasing not yet supported +ERROR: 1 compilation errors. No code generated. + + Shader version: 500 local_size = (1, 1, 1) -0:? Sequence +ERROR: node is still EOpNull! 0:2 Function Definition: @main( ( temp void) 0:2 Function Parameters: 0:2 Function Definition: main( ( temp void) @@ -9,7 +13,7 @@ 0:? Sequence 0:2 Function Call: @main( ( temp void) 0:? Linker Objects -0:? 'srt0' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:? 'srt0' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) Linked compute stage: @@ -17,7 +21,7 @@ Shader version: 500 local_size = (1, 1, 1) -0:? Sequence +ERROR: node is still EOpNull! 0:2 Function Definition: @main( ( temp void) 0:2 Function Parameters: 0:2 Function Definition: main( ( temp void) @@ -25,40 +29,6 @@ 0:? Sequence 0:2 Function Call: @main( ( temp void) 0:? Linker Objects -0:? 'srt0' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:? 'srt0' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) -// Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 14 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint GLCompute 4 "main" - ExecutionMode 4 LocalSize 1 1 1 - Source HLSL 500 - Name 4 "main" - Name 6 "@main(" - Name 11 "srt0" - MemberName 11(srt0) 0 "@data" - Name 13 "srt0" - Decorate 10 ArrayStride 4 - MemberDecorate 11(srt0) 0 Offset 0 - Decorate 11(srt0) BufferBlock - Decorate 13(srt0) DescriptorSet 0 - 2: TypeVoid - 3: TypeFunction 2 - 9: TypeInt 32 0 - 10: TypeRuntimeArray 9(int) - 11(srt0): TypeStruct 10 - 12: TypePointer Uniform 11(srt0) - 13(srt0): 12(ptr) Variable Uniform - 4(main): 2 Function None 3 - 5: Label - 8: 2 FunctionCall 6(@main() - Return - FunctionEnd - 6(@main(): 2 Function None 3 - 7: Label - Return - FunctionEnd +SPIR-V is not generated for failed compile or link diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.logical.binary.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.logical.binary.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.logical.binary.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.logical.binary.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -13,12 +13,11 @@ 0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) 0:13 Constant: 0:13 0 (const uint) -0:13 Convert int to bool ( temp bool) -0:13 Convert float to int ( temp int) -0:13 fval: direct index for structure ( uniform float) -0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) -0:13 Constant: -0:13 2 (const uint) +0:13 Convert float to bool ( temp bool) +0:13 fval: direct index for structure ( uniform float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:13 Constant: +0:13 2 (const uint) 0:13 true case is null 0:14 Test condition and select ( temp void) 0:14 Condition @@ -28,12 +27,11 @@ 0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) 0:14 Constant: 0:14 0 (const uint) -0:14 Convert int to bool ( temp bool) -0:14 Convert float to int ( temp int) -0:14 fval: direct index for structure ( uniform float) -0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) -0:14 Constant: -0:14 2 (const uint) +0:14 Convert float to bool ( temp bool) +0:14 fval: direct index for structure ( uniform float) +0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:14 Constant: +0:14 2 (const uint) 0:14 true case is null 0:17 move second child to first child ( temp 4-component vector of float) 0:17 Color: direct index for structure ( temp 4-component vector of float) @@ -79,12 +77,11 @@ 0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) 0:13 Constant: 0:13 0 (const uint) -0:13 Convert int to bool ( temp bool) -0:13 Convert float to int ( temp int) -0:13 fval: direct index for structure ( uniform float) -0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) -0:13 Constant: -0:13 2 (const uint) +0:13 Convert float to bool ( temp bool) +0:13 fval: direct index for structure ( uniform float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:13 Constant: +0:13 2 (const uint) 0:13 true case is null 0:14 Test condition and select ( temp void) 0:14 Condition @@ -94,12 +91,11 @@ 0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) 0:14 Constant: 0:14 0 (const uint) -0:14 Convert int to bool ( temp bool) -0:14 Convert float to int ( temp int) -0:14 fval: direct index for structure ( uniform float) -0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) -0:14 Constant: -0:14 2 (const uint) +0:14 Convert float to bool ( temp bool) +0:14 fval: direct index for structure ( uniform float) +0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:14 Constant: +0:14 2 (const uint) 0:14 true case is null 0:17 move second child to first child ( temp 4-component vector of float) 0:17 Color: direct index for structure ( temp 4-component vector of float) @@ -128,13 +124,13 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 57 +// Generated by (magic number): 80006 +// Id's are bound by 56 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 54 + EntryPoint Fragment 4 "main" 53 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" @@ -147,15 +143,15 @@ MemberName 14($Global) 2 "fval" MemberName 14($Global) 3 "fval4" Name 16 "" - Name 45 "psout" - Name 54 "@entryPointOutput.Color" + Name 44 "psout" + Name 53 "@entryPointOutput.Color" MemberDecorate 14($Global) 0 Offset 0 MemberDecorate 14($Global) 1 Offset 16 MemberDecorate 14($Global) 2 Offset 32 MemberDecorate 14($Global) 3 Offset 48 Decorate 14($Global) Block Decorate 16 DescriptorSet 0 - Decorate 54(@entryPointOutput.Color) Location 0 + Decorate 53(@entryPointOutput.Color) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -174,29 +170,29 @@ 23: 22(int) Constant 0 25: 12(int) Constant 2 26: TypePointer Uniform 6(float) - 44: TypePointer Function 8(PS_OUTPUT) - 46: 6(float) Constant 1065353216 - 47: 7(fvec4) ConstantComposite 46 46 46 46 - 48: TypePointer Function 7(fvec4) - 53: TypePointer Output 7(fvec4) -54(@entryPointOutput.Color): 53(ptr) Variable Output + 29: 6(float) Constant 0 + 43: TypePointer Function 8(PS_OUTPUT) + 45: 6(float) Constant 1065353216 + 46: 7(fvec4) ConstantComposite 45 45 45 45 + 47: TypePointer Function 7(fvec4) + 52: TypePointer Output 7(fvec4) +53(@entryPointOutput.Color): 52(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 55:8(PS_OUTPUT) FunctionCall 10(@main() - 56: 7(fvec4) CompositeExtract 55 0 - Store 54(@entryPointOutput.Color) 56 + 54:8(PS_OUTPUT) FunctionCall 10(@main() + 55: 7(fvec4) CompositeExtract 54 0 + Store 53(@entryPointOutput.Color) 55 Return FunctionEnd 10(@main():8(PS_OUTPUT) Function None 9 11: Label - 45(psout): 44(ptr) Variable Function + 44(psout): 43(ptr) Variable Function 19: 18(ptr) AccessChain 16 17 20: 12(int) Load 19 24: 21(bool) INotEqual 20 23 27: 26(ptr) AccessChain 16 25 28: 6(float) Load 27 - 29: 12(int) ConvertFToS 28 - 30: 21(bool) INotEqual 29 23 + 30: 21(bool) FOrdNotEqual 28 29 31: 21(bool) LogicalAnd 24 30 SelectionMerge 33 None BranchConditional 31 32 33 @@ -208,16 +204,15 @@ 36: 21(bool) INotEqual 35 23 37: 26(ptr) AccessChain 16 25 38: 6(float) Load 37 - 39: 12(int) ConvertFToS 38 - 40: 21(bool) INotEqual 39 23 - 41: 21(bool) LogicalOr 36 40 - SelectionMerge 43 None - BranchConditional 41 42 43 - 42: Label - Branch 43 - 43: Label - 49: 48(ptr) AccessChain 45(psout) 17 - Store 49 47 - 50:8(PS_OUTPUT) Load 45(psout) - ReturnValue 50 + 39: 21(bool) FOrdNotEqual 38 29 + 40: 21(bool) LogicalOr 36 39 + SelectionMerge 42 None + BranchConditional 40 41 42 + 41: Label + Branch 42 + 42: Label + 48: 47(ptr) AccessChain 44(psout) 17 + Store 48 46 + 49:8(PS_OUTPUT) Load 44(psout) + ReturnValue 49 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.logical.binary.vec.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.logical.binary.vec.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.logical.binary.vec.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.logical.binary.vec.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -254,7 +254,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 115 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.logicalConvert.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.logicalConvert.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.logicalConvert.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.logicalConvert.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -254,7 +254,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 50 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.logical.unary.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.logical.unary.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.logical.unary.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.logical.unary.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -184,7 +184,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 84 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.loopattr.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.loopattr.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.loopattr.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.loopattr.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -10,7 +10,7 @@ 0:5 'x' ( temp int) 0:5 Constant: 0:5 0 (const int) -0:5 Loop with condition tested first +0:5 Loop with condition tested first: Unroll 0:5 Loop Condition 0:5 Compare Less Than ( temp bool) 0:5 'x' ( temp int) @@ -25,7 +25,7 @@ 0:8 'y' ( temp int) 0:8 Constant: 0:8 0 (const int) -0:8 Loop with condition tested first +0:8 Loop with condition tested first: DontUnroll 0:8 Loop Condition 0:8 Compare Less Than ( temp bool) 0:8 'y' ( temp int) @@ -80,7 +80,7 @@ 0:5 'x' ( temp int) 0:5 Constant: 0:5 0 (const int) -0:5 Loop with condition tested first +0:5 Loop with condition tested first: Unroll 0:5 Loop Condition 0:5 Compare Less Than ( temp bool) 0:5 'x' ( temp int) @@ -95,7 +95,7 @@ 0:8 'y' ( temp int) 0:8 Constant: 0:8 0 (const int) -0:8 Loop with condition tested first +0:8 Loop with condition tested first: DontUnroll 0:8 Loop Condition 0:8 Compare Less Than ( temp bool) 0:8 'y' ( temp int) @@ -136,7 +136,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 54 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.matNx1.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.matNx1.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.matNx1.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.matNx1.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -152,7 +152,7 @@ 0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 77 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.matpack-1.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.matpack-1.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.matpack-1.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.matpack-1.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -100,7 +100,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 39 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.matpack-pragma.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.matpack-pragma.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.matpack-pragma.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.matpack-pragma.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -170,7 +170,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 44 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.matrixindex.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.matrixindex.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.matrixindex.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.matrixindex.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -272,7 +272,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 83 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.matrixSwizzle.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.matrixSwizzle.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.matrixSwizzle.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.matrixSwizzle.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -677,7 +677,7 @@ Missing functionality: matrix swizzle // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 118 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.matType.bool.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.matType.bool.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.matType.bool.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.matType.bool.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -232,7 +232,7 @@ 0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 130 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.matType.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.matType.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.matType.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.matType.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -31,7 +31,7 @@ 0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 1-component vector of float f1, uniform 1X1 matrix of float fmat11, uniform 4X1 matrix of float fmat41, uniform 1X2 matrix of float fmat12, uniform 2X3 matrix of double dmat23, uniform 4X4 matrix of int int44}) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 30 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.matType.int.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.matType.int.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.matType.int.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.matType.int.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -398,7 +398,7 @@ 0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 232 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.max.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.max.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.max.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.max.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -66,7 +66,7 @@ 0:? 'input2' (layout( location=1) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 33 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.memberFunCall.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.memberFunCall.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.memberFunCall.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.memberFunCall.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -152,7 +152,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 73 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.mintypes.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.mintypes.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.mintypes.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.mintypes.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -98,7 +98,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 70 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.mip.operator.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.mip.operator.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.mip.operator.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.mip.operator.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -128,7 +128,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 61 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.multiDescriptorSet.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.multiDescriptorSet.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.multiDescriptorSet.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.multiDescriptorSet.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ hlsl.multiDescriptorSet.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 92 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.multiEntry.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.multiEntry.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.multiEntry.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.multiEntry.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -70,7 +70,7 @@ 0:? 'Index' ( in uint VertexIndex) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 41 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.multiReturn.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.multiReturn.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.multiReturn.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.multiReturn.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -48,7 +48,7 @@ 0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{ temp float f, temp 3-component vector of float v, temp 3X3 matrix of float m} s}) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 42 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.mul-truncate.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.mul-truncate.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.mul-truncate.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.mul-truncate.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,684 @@ +hlsl.mul-truncate.frag +WARNING: 0:24: '' : mul() matrix size mismatch +WARNING: 0:25: '' : mul() matrix size mismatch +WARNING: 0:28: '' : mul() matrix size mismatch +WARNING: 0:29: '' : mul() matrix size mismatch +WARNING: 0:32: '' : mul() matrix size mismatch +WARNING: 0:33: '' : mul() matrix size mismatch +WARNING: 0:34: '' : mul() matrix size mismatch +WARNING: 0:35: '' : mul() matrix size mismatch + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:18 Function Definition: @main( ( temp 4-component vector of float) +0:18 Function Parameters: +0:? Sequence +0:20 Sequence +0:20 move second child to first child ( temp float) +0:20 'r00' ( temp float) +0:20 dot-product ( temp float) +0:20 v2: direct index for structure (layout( row_major std140) uniform 2-component vector of float) +0:20 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:20 Constant: +0:20 8 (const uint) +0:20 Construct vec2 ( in 2-component vector of float) +0:20 v3: direct index for structure (layout( row_major std140) uniform 3-component vector of float) +0:20 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:20 Constant: +0:20 7 (const uint) +0:21 Sequence +0:21 move second child to first child ( temp float) +0:21 'r01' ( temp float) +0:21 dot-product ( temp float) +0:21 Construct vec2 ( in 2-component vector of float) +0:21 v4: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:21 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:21 Constant: +0:21 6 (const uint) +0:21 v2: direct index for structure (layout( row_major std140) uniform 2-component vector of float) +0:21 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:21 Constant: +0:21 8 (const uint) +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of float) +0:24 'r10' ( temp 4-component vector of float) +0:24 matrix-times-vector ( temp 4-component vector of float) +0:24 Construct mat3x4 ( uniform 3X4 matrix of float) +0:24 m44: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:24 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:24 Constant: +0:24 0 (const uint) +0:24 v3: direct index for structure (layout( row_major std140) uniform 3-component vector of float) +0:24 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:24 Constant: +0:24 7 (const uint) +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'r11' ( temp 4-component vector of float) +0:25 matrix-times-vector ( temp 4-component vector of float) +0:25 m34: direct index for structure (layout( row_major std140) uniform 3X4 matrix of float) +0:25 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:25 Constant: +0:25 2 (const uint) +0:25 Construct vec3 ( uniform 3-component vector of float) +0:25 v4: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:25 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:25 Constant: +0:25 6 (const uint) +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of float) +0:28 'r20' ( temp 4-component vector of float) +0:28 vector-times-matrix ( temp 4-component vector of float) +0:28 v3: direct index for structure (layout( row_major std140) uniform 3-component vector of float) +0:28 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:28 Constant: +0:28 7 (const uint) +0:28 Construct mat4x3 ( uniform 4X3 matrix of float) +0:28 m44: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:28 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:28 Constant: +0:28 0 (const uint) +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of float) +0:29 'r21' ( temp 4-component vector of float) +0:29 vector-times-matrix ( temp 4-component vector of float) +0:29 Construct vec3 ( uniform 3-component vector of float) +0:29 v4: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:29 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:29 Constant: +0:29 6 (const uint) +0:29 m43: direct index for structure (layout( row_major std140) uniform 4X3 matrix of float) +0:29 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:29 Constant: +0:29 1 (const uint) +0:32 Sequence +0:32 move second child to first child ( temp 2X3 matrix of float) +0:32 'r30' ( temp 2X3 matrix of float) +0:32 matrix-multiply ( temp 2X3 matrix of float) +0:32 m33: direct index for structure (layout( row_major std140) uniform 3X3 matrix of float) +0:32 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:32 Constant: +0:32 3 (const uint) +0:32 Construct mat2x3 ( uniform 2X3 matrix of float) +0:32 m24: direct index for structure (layout( row_major std140) uniform 2X4 matrix of float) +0:32 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:32 Constant: +0:32 4 (const uint) +0:33 Sequence +0:33 move second child to first child ( temp 3X4 matrix of float) +0:33 'r31' ( temp 3X4 matrix of float) +0:33 matrix-multiply ( temp 3X4 matrix of float) +0:33 m24: direct index for structure (layout( row_major std140) uniform 2X4 matrix of float) +0:33 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:33 Constant: +0:33 4 (const uint) +0:33 Construct mat3x2 ( uniform 3X2 matrix of float) +0:33 m33: direct index for structure (layout( row_major std140) uniform 3X3 matrix of float) +0:33 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:33 Constant: +0:33 3 (const uint) +0:34 Sequence +0:34 move second child to first child ( temp 3X2 matrix of float) +0:34 'r32' ( temp 3X2 matrix of float) +0:34 matrix-multiply ( temp 3X2 matrix of float) +0:34 Construct mat3x2 ( uniform 3X2 matrix of float) +0:34 m42: direct index for structure (layout( row_major std140) uniform 4X2 matrix of float) +0:34 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:34 Constant: +0:34 5 (const uint) +0:34 m33: direct index for structure (layout( row_major std140) uniform 3X3 matrix of float) +0:34 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:34 Constant: +0:34 3 (const uint) +0:35 Sequence +0:35 move second child to first child ( temp 4X3 matrix of float) +0:35 'r33' ( temp 4X3 matrix of float) +0:35 matrix-multiply ( temp 4X3 matrix of float) +0:35 Construct mat2x3 ( uniform 2X3 matrix of float) +0:35 m33: direct index for structure (layout( row_major std140) uniform 3X3 matrix of float) +0:35 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:35 Constant: +0:35 3 (const uint) +0:35 m42: direct index for structure (layout( row_major std140) uniform 4X2 matrix of float) +0:35 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:35 Constant: +0:35 5 (const uint) +0:37 Branch: Return with expression +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 'r10' ( temp 4-component vector of float) +0:37 'r11' ( temp 4-component vector of float) +0:37 'r20' ( temp 4-component vector of float) +0:37 'r21' ( temp 4-component vector of float) +0:37 'r00' ( temp float) +0:37 'r01' ( temp float) +0:37 direct index ( temp float) +0:37 direct index ( temp 3-component vector of float) +0:37 'r30' ( temp 2X3 matrix of float) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 direct index ( temp 4-component vector of float) +0:37 'r31' ( temp 3X4 matrix of float) +0:37 Constant: +0:37 0 (const int) +0:37 direct index ( temp float) +0:37 direct index ( temp 2-component vector of float) +0:37 'r32' ( temp 3X2 matrix of float) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 direct index ( temp 4-component vector of float) +0:37 transpose ( temp 3X4 matrix of float) +0:37 'r33' ( temp 4X3 matrix of float) +0:37 Constant: +0:37 0 (const int) +0:18 Function Definition: main( ( temp void) +0:18 Function Parameters: +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:18 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:18 Function Definition: @main( ( temp 4-component vector of float) +0:18 Function Parameters: +0:? Sequence +0:20 Sequence +0:20 move second child to first child ( temp float) +0:20 'r00' ( temp float) +0:20 dot-product ( temp float) +0:20 v2: direct index for structure (layout( row_major std140) uniform 2-component vector of float) +0:20 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:20 Constant: +0:20 8 (const uint) +0:20 Construct vec2 ( in 2-component vector of float) +0:20 v3: direct index for structure (layout( row_major std140) uniform 3-component vector of float) +0:20 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:20 Constant: +0:20 7 (const uint) +0:21 Sequence +0:21 move second child to first child ( temp float) +0:21 'r01' ( temp float) +0:21 dot-product ( temp float) +0:21 Construct vec2 ( in 2-component vector of float) +0:21 v4: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:21 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:21 Constant: +0:21 6 (const uint) +0:21 v2: direct index for structure (layout( row_major std140) uniform 2-component vector of float) +0:21 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:21 Constant: +0:21 8 (const uint) +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of float) +0:24 'r10' ( temp 4-component vector of float) +0:24 matrix-times-vector ( temp 4-component vector of float) +0:24 Construct mat3x4 ( uniform 3X4 matrix of float) +0:24 m44: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:24 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:24 Constant: +0:24 0 (const uint) +0:24 v3: direct index for structure (layout( row_major std140) uniform 3-component vector of float) +0:24 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:24 Constant: +0:24 7 (const uint) +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'r11' ( temp 4-component vector of float) +0:25 matrix-times-vector ( temp 4-component vector of float) +0:25 m34: direct index for structure (layout( row_major std140) uniform 3X4 matrix of float) +0:25 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:25 Constant: +0:25 2 (const uint) +0:25 Construct vec3 ( uniform 3-component vector of float) +0:25 v4: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:25 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:25 Constant: +0:25 6 (const uint) +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of float) +0:28 'r20' ( temp 4-component vector of float) +0:28 vector-times-matrix ( temp 4-component vector of float) +0:28 v3: direct index for structure (layout( row_major std140) uniform 3-component vector of float) +0:28 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:28 Constant: +0:28 7 (const uint) +0:28 Construct mat4x3 ( uniform 4X3 matrix of float) +0:28 m44: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:28 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:28 Constant: +0:28 0 (const uint) +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of float) +0:29 'r21' ( temp 4-component vector of float) +0:29 vector-times-matrix ( temp 4-component vector of float) +0:29 Construct vec3 ( uniform 3-component vector of float) +0:29 v4: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:29 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:29 Constant: +0:29 6 (const uint) +0:29 m43: direct index for structure (layout( row_major std140) uniform 4X3 matrix of float) +0:29 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:29 Constant: +0:29 1 (const uint) +0:32 Sequence +0:32 move second child to first child ( temp 2X3 matrix of float) +0:32 'r30' ( temp 2X3 matrix of float) +0:32 matrix-multiply ( temp 2X3 matrix of float) +0:32 m33: direct index for structure (layout( row_major std140) uniform 3X3 matrix of float) +0:32 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:32 Constant: +0:32 3 (const uint) +0:32 Construct mat2x3 ( uniform 2X3 matrix of float) +0:32 m24: direct index for structure (layout( row_major std140) uniform 2X4 matrix of float) +0:32 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:32 Constant: +0:32 4 (const uint) +0:33 Sequence +0:33 move second child to first child ( temp 3X4 matrix of float) +0:33 'r31' ( temp 3X4 matrix of float) +0:33 matrix-multiply ( temp 3X4 matrix of float) +0:33 m24: direct index for structure (layout( row_major std140) uniform 2X4 matrix of float) +0:33 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:33 Constant: +0:33 4 (const uint) +0:33 Construct mat3x2 ( uniform 3X2 matrix of float) +0:33 m33: direct index for structure (layout( row_major std140) uniform 3X3 matrix of float) +0:33 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:33 Constant: +0:33 3 (const uint) +0:34 Sequence +0:34 move second child to first child ( temp 3X2 matrix of float) +0:34 'r32' ( temp 3X2 matrix of float) +0:34 matrix-multiply ( temp 3X2 matrix of float) +0:34 Construct mat3x2 ( uniform 3X2 matrix of float) +0:34 m42: direct index for structure (layout( row_major std140) uniform 4X2 matrix of float) +0:34 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:34 Constant: +0:34 5 (const uint) +0:34 m33: direct index for structure (layout( row_major std140) uniform 3X3 matrix of float) +0:34 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:34 Constant: +0:34 3 (const uint) +0:35 Sequence +0:35 move second child to first child ( temp 4X3 matrix of float) +0:35 'r33' ( temp 4X3 matrix of float) +0:35 matrix-multiply ( temp 4X3 matrix of float) +0:35 Construct mat2x3 ( uniform 2X3 matrix of float) +0:35 m33: direct index for structure (layout( row_major std140) uniform 3X3 matrix of float) +0:35 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:35 Constant: +0:35 3 (const uint) +0:35 m42: direct index for structure (layout( row_major std140) uniform 4X2 matrix of float) +0:35 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:35 Constant: +0:35 5 (const uint) +0:37 Branch: Return with expression +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 'r10' ( temp 4-component vector of float) +0:37 'r11' ( temp 4-component vector of float) +0:37 'r20' ( temp 4-component vector of float) +0:37 'r21' ( temp 4-component vector of float) +0:37 'r00' ( temp float) +0:37 'r01' ( temp float) +0:37 direct index ( temp float) +0:37 direct index ( temp 3-component vector of float) +0:37 'r30' ( temp 2X3 matrix of float) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 direct index ( temp 4-component vector of float) +0:37 'r31' ( temp 3X4 matrix of float) +0:37 Constant: +0:37 0 (const int) +0:37 direct index ( temp float) +0:37 direct index ( temp 2-component vector of float) +0:37 'r32' ( temp 3X2 matrix of float) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 direct index ( temp 4-component vector of float) +0:37 transpose ( temp 3X4 matrix of float) +0:37 'r33' ( temp 4X3 matrix of float) +0:37 Constant: +0:37 0 (const int) +0:18 Function Definition: main( ( temp void) +0:18 Function Parameters: +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:18 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 231 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 229 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 12 "r00" + Name 21 "Matrix" + MemberName 21(Matrix) 0 "m44" + MemberName 21(Matrix) 1 "m43" + MemberName 21(Matrix) 2 "m34" + MemberName 21(Matrix) 3 "m33" + MemberName 21(Matrix) 4 "m24" + MemberName 21(Matrix) 5 "m42" + MemberName 21(Matrix) 6 "v4" + MemberName 21(Matrix) 7 "v3" + MemberName 21(Matrix) 8 "v2" + Name 23 "" + Name 37 "r01" + Name 49 "r10" + Name 75 "r11" + Name 87 "r20" + Name 110 "r21" + Name 124 "r30" + Name 144 "r31" + Name 162 "r32" + Name 181 "r33" + Name 229 "@entryPointOutput" + MemberDecorate 21(Matrix) 0 RowMajor + MemberDecorate 21(Matrix) 0 Offset 0 + MemberDecorate 21(Matrix) 0 MatrixStride 16 + MemberDecorate 21(Matrix) 1 RowMajor + MemberDecorate 21(Matrix) 1 Offset 64 + MemberDecorate 21(Matrix) 1 MatrixStride 16 + MemberDecorate 21(Matrix) 2 RowMajor + MemberDecorate 21(Matrix) 2 Offset 112 + MemberDecorate 21(Matrix) 2 MatrixStride 16 + MemberDecorate 21(Matrix) 3 RowMajor + MemberDecorate 21(Matrix) 3 Offset 176 + MemberDecorate 21(Matrix) 3 MatrixStride 16 + MemberDecorate 21(Matrix) 4 RowMajor + MemberDecorate 21(Matrix) 4 Offset 224 + MemberDecorate 21(Matrix) 4 MatrixStride 16 + MemberDecorate 21(Matrix) 5 RowMajor + MemberDecorate 21(Matrix) 5 Offset 288 + MemberDecorate 21(Matrix) 5 MatrixStride 16 + MemberDecorate 21(Matrix) 6 Offset 320 + MemberDecorate 21(Matrix) 7 Offset 336 + MemberDecorate 21(Matrix) 8 Offset 352 + Decorate 21(Matrix) Block + Decorate 23 DescriptorSet 0 + Decorate 229(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypePointer Function 6(float) + 13: TypeMatrix 7(fvec4) 4 + 14: TypeVector 6(float) 3 + 15: TypeMatrix 14(fvec3) 4 + 16: TypeMatrix 7(fvec4) 3 + 17: TypeMatrix 14(fvec3) 3 + 18: TypeMatrix 7(fvec4) 2 + 19: TypeVector 6(float) 2 + 20: TypeMatrix 19(fvec2) 4 + 21(Matrix): TypeStruct 13 15 16 17 18 20 7(fvec4) 14(fvec3) 19(fvec2) + 22: TypePointer Uniform 21(Matrix) + 23: 22(ptr) Variable Uniform + 24: TypeInt 32 1 + 25: 24(int) Constant 8 + 26: TypePointer Uniform 19(fvec2) + 29: 24(int) Constant 7 + 30: TypePointer Uniform 14(fvec3) + 38: 24(int) Constant 6 + 39: TypePointer Uniform 7(fvec4) + 48: TypePointer Function 7(fvec4) + 50: 24(int) Constant 0 + 51: TypePointer Uniform 13 + 54: 6(float) Constant 1065353216 + 55: 6(float) Constant 0 + 76: 24(int) Constant 2 + 77: TypePointer Uniform 16 + 117: 24(int) Constant 1 + 118: TypePointer Uniform 15 + 122: TypeMatrix 14(fvec3) 2 + 123: TypePointer Function 122 + 125: 24(int) Constant 3 + 126: TypePointer Uniform 17 + 129: 24(int) Constant 4 + 130: TypePointer Uniform 18 + 143: TypePointer Function 16 + 149: TypeMatrix 19(fvec2) 3 + 161: TypePointer Function 149 + 163: 24(int) Constant 5 + 164: TypePointer Uniform 20 + 180: TypePointer Function 15 + 209: TypeInt 32 0 + 210: 209(int) Constant 0 + 228: TypePointer Output 7(fvec4) +229(@entryPointOutput): 228(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 230: 7(fvec4) FunctionCall 9(@main() + Store 229(@entryPointOutput) 230 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 12(r00): 11(ptr) Variable Function + 37(r01): 11(ptr) Variable Function + 49(r10): 48(ptr) Variable Function + 75(r11): 48(ptr) Variable Function + 87(r20): 48(ptr) Variable Function + 110(r21): 48(ptr) Variable Function + 124(r30): 123(ptr) Variable Function + 144(r31): 143(ptr) Variable Function + 162(r32): 161(ptr) Variable Function + 181(r33): 180(ptr) Variable Function + 27: 26(ptr) AccessChain 23 25 + 28: 19(fvec2) Load 27 + 31: 30(ptr) AccessChain 23 29 + 32: 14(fvec3) Load 31 + 33: 6(float) CompositeExtract 32 0 + 34: 6(float) CompositeExtract 32 1 + 35: 19(fvec2) CompositeConstruct 33 34 + 36: 6(float) Dot 28 35 + Store 12(r00) 36 + 40: 39(ptr) AccessChain 23 38 + 41: 7(fvec4) Load 40 + 42: 6(float) CompositeExtract 41 0 + 43: 6(float) CompositeExtract 41 1 + 44: 19(fvec2) CompositeConstruct 42 43 + 45: 26(ptr) AccessChain 23 25 + 46: 19(fvec2) Load 45 + 47: 6(float) Dot 44 46 + Store 37(r01) 47 + 52: 51(ptr) AccessChain 23 50 + 53: 13 Load 52 + 56: 6(float) CompositeExtract 53 0 0 + 57: 6(float) CompositeExtract 53 0 1 + 58: 6(float) CompositeExtract 53 0 2 + 59: 6(float) CompositeExtract 53 0 3 + 60: 6(float) CompositeExtract 53 1 0 + 61: 6(float) CompositeExtract 53 1 1 + 62: 6(float) CompositeExtract 53 1 2 + 63: 6(float) CompositeExtract 53 1 3 + 64: 6(float) CompositeExtract 53 2 0 + 65: 6(float) CompositeExtract 53 2 1 + 66: 6(float) CompositeExtract 53 2 2 + 67: 6(float) CompositeExtract 53 2 3 + 68: 7(fvec4) CompositeConstruct 56 57 58 59 + 69: 7(fvec4) CompositeConstruct 60 61 62 63 + 70: 7(fvec4) CompositeConstruct 64 65 66 67 + 71: 16 CompositeConstruct 68 69 70 + 72: 30(ptr) AccessChain 23 29 + 73: 14(fvec3) Load 72 + 74: 7(fvec4) MatrixTimesVector 71 73 + Store 49(r10) 74 + 78: 77(ptr) AccessChain 23 76 + 79: 16 Load 78 + 80: 39(ptr) AccessChain 23 38 + 81: 7(fvec4) Load 80 + 82: 6(float) CompositeExtract 81 0 + 83: 6(float) CompositeExtract 81 1 + 84: 6(float) CompositeExtract 81 2 + 85: 14(fvec3) CompositeConstruct 82 83 84 + 86: 7(fvec4) MatrixTimesVector 79 85 + Store 75(r11) 86 + 88: 30(ptr) AccessChain 23 29 + 89: 14(fvec3) Load 88 + 90: 51(ptr) AccessChain 23 50 + 91: 13 Load 90 + 92: 6(float) CompositeExtract 91 0 0 + 93: 6(float) CompositeExtract 91 0 1 + 94: 6(float) CompositeExtract 91 0 2 + 95: 6(float) CompositeExtract 91 1 0 + 96: 6(float) CompositeExtract 91 1 1 + 97: 6(float) CompositeExtract 91 1 2 + 98: 6(float) CompositeExtract 91 2 0 + 99: 6(float) CompositeExtract 91 2 1 + 100: 6(float) CompositeExtract 91 2 2 + 101: 6(float) CompositeExtract 91 3 0 + 102: 6(float) CompositeExtract 91 3 1 + 103: 6(float) CompositeExtract 91 3 2 + 104: 14(fvec3) CompositeConstruct 92 93 94 + 105: 14(fvec3) CompositeConstruct 95 96 97 + 106: 14(fvec3) CompositeConstruct 98 99 100 + 107: 14(fvec3) CompositeConstruct 101 102 103 + 108: 15 CompositeConstruct 104 105 106 107 + 109: 7(fvec4) VectorTimesMatrix 89 108 + Store 87(r20) 109 + 111: 39(ptr) AccessChain 23 38 + 112: 7(fvec4) Load 111 + 113: 6(float) CompositeExtract 112 0 + 114: 6(float) CompositeExtract 112 1 + 115: 6(float) CompositeExtract 112 2 + 116: 14(fvec3) CompositeConstruct 113 114 115 + 119: 118(ptr) AccessChain 23 117 + 120: 15 Load 119 + 121: 7(fvec4) VectorTimesMatrix 116 120 + Store 110(r21) 121 + 127: 126(ptr) AccessChain 23 125 + 128: 17 Load 127 + 131: 130(ptr) AccessChain 23 129 + 132: 18 Load 131 + 133: 6(float) CompositeExtract 132 0 0 + 134: 6(float) CompositeExtract 132 0 1 + 135: 6(float) CompositeExtract 132 0 2 + 136: 6(float) CompositeExtract 132 1 0 + 137: 6(float) CompositeExtract 132 1 1 + 138: 6(float) CompositeExtract 132 1 2 + 139: 14(fvec3) CompositeConstruct 133 134 135 + 140: 14(fvec3) CompositeConstruct 136 137 138 + 141: 122 CompositeConstruct 139 140 + 142: 122 MatrixTimesMatrix 128 141 + Store 124(r30) 142 + 145: 130(ptr) AccessChain 23 129 + 146: 18 Load 145 + 147: 126(ptr) AccessChain 23 125 + 148: 17 Load 147 + 150: 6(float) CompositeExtract 148 0 0 + 151: 6(float) CompositeExtract 148 0 1 + 152: 6(float) CompositeExtract 148 1 0 + 153: 6(float) CompositeExtract 148 1 1 + 154: 6(float) CompositeExtract 148 2 0 + 155: 6(float) CompositeExtract 148 2 1 + 156: 19(fvec2) CompositeConstruct 150 151 + 157: 19(fvec2) CompositeConstruct 152 153 + 158: 19(fvec2) CompositeConstruct 154 155 + 159: 149 CompositeConstruct 156 157 158 + 160: 16 MatrixTimesMatrix 146 159 + Store 144(r31) 160 + 165: 164(ptr) AccessChain 23 163 + 166: 20 Load 165 + 167: 6(float) CompositeExtract 166 0 0 + 168: 6(float) CompositeExtract 166 0 1 + 169: 6(float) CompositeExtract 166 1 0 + 170: 6(float) CompositeExtract 166 1 1 + 171: 6(float) CompositeExtract 166 2 0 + 172: 6(float) CompositeExtract 166 2 1 + 173: 19(fvec2) CompositeConstruct 167 168 + 174: 19(fvec2) CompositeConstruct 169 170 + 175: 19(fvec2) CompositeConstruct 171 172 + 176: 149 CompositeConstruct 173 174 175 + 177: 126(ptr) AccessChain 23 125 + 178: 17 Load 177 + 179: 149 MatrixTimesMatrix 176 178 + Store 162(r32) 179 + 182: 126(ptr) AccessChain 23 125 + 183: 17 Load 182 + 184: 6(float) CompositeExtract 183 0 0 + 185: 6(float) CompositeExtract 183 0 1 + 186: 6(float) CompositeExtract 183 0 2 + 187: 6(float) CompositeExtract 183 1 0 + 188: 6(float) CompositeExtract 183 1 1 + 189: 6(float) CompositeExtract 183 1 2 + 190: 14(fvec3) CompositeConstruct 184 185 186 + 191: 14(fvec3) CompositeConstruct 187 188 189 + 192: 122 CompositeConstruct 190 191 + 193: 164(ptr) AccessChain 23 163 + 194: 20 Load 193 + 195: 15 MatrixTimesMatrix 192 194 + Store 181(r33) 195 + 196: 7(fvec4) Load 49(r10) + 197: 7(fvec4) Load 75(r11) + 198: 7(fvec4) FAdd 196 197 + 199: 7(fvec4) Load 87(r20) + 200: 7(fvec4) FAdd 198 199 + 201: 7(fvec4) Load 110(r21) + 202: 7(fvec4) FAdd 200 201 + 203: 6(float) Load 12(r00) + 204: 7(fvec4) CompositeConstruct 203 203 203 203 + 205: 7(fvec4) FAdd 202 204 + 206: 6(float) Load 37(r01) + 207: 7(fvec4) CompositeConstruct 206 206 206 206 + 208: 7(fvec4) FAdd 205 207 + 211: 11(ptr) AccessChain 124(r30) 50 210 + 212: 6(float) Load 211 + 213: 7(fvec4) CompositeConstruct 212 212 212 212 + 214: 7(fvec4) FAdd 208 213 + 215: 48(ptr) AccessChain 144(r31) 50 + 216: 7(fvec4) Load 215 + 217: 7(fvec4) FAdd 214 216 + 218: 11(ptr) AccessChain 162(r32) 50 210 + 219: 6(float) Load 218 + 220: 7(fvec4) CompositeConstruct 219 219 219 219 + 221: 7(fvec4) FAdd 217 220 + 222: 15 Load 181(r33) + 223: 16 Transpose 222 + 224: 7(fvec4) CompositeExtract 223 0 + 225: 7(fvec4) FAdd 221 224 + ReturnValue 225 + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.namespace.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.namespace.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.namespace.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.namespace.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -102,7 +102,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 54 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.nonint-index.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.nonint-index.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.nonint-index.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.nonint-index.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -88,7 +88,7 @@ 0:? 'input' (layout( location=0) in float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 39 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.nonstaticMemberFunction.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.nonstaticMemberFunction.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.nonstaticMemberFunction.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.nonstaticMemberFunction.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -268,7 +268,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 111 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.noSemantic.functionality1.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.noSemantic.functionality1.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.noSemantic.functionality1.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.noSemantic.functionality1.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,62 @@ +hlsl.noSemantic.functionality1.comp +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 30 + + Capability Shader + Extension "SPV_GOOGLE_hlsl_functionality1" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 1 1 1 + Source HLSL 500 + Name 4 "main" + Name 6 "@main(" + Name 11 "Buf" + MemberName 11(Buf) 0 "@data" + Name 13 "Buf" + Name 17 "Buf@count" + MemberName 17(Buf@count) 0 "@count" + Name 19 "Buf@count" + Decorate 10 ArrayStride 16 + MemberDecorate 11(Buf) 0 Offset 0 + Decorate 11(Buf) BufferBlock + Decorate 13(Buf) DescriptorSet 0 + Decorate 13(Buf) Binding 0 + MemberDecorate 17(Buf@count) 0 Offset 0 + Decorate 17(Buf@count) BufferBlock + Decorate 19(Buf@count) DescriptorSet 0 + DecorateId 13(Buf) DecorationHlslCounterBufferGOOGLE 19(Buf@count) + 2: TypeVoid + 3: TypeFunction 2 + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeRuntimeArray 9(fvec4) + 11(Buf): TypeStruct 10 + 12: TypePointer Uniform 11(Buf) + 13(Buf): 12(ptr) Variable Uniform + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: TypeInt 32 0 + 17(Buf@count): TypeStruct 16(int) + 18: TypePointer Uniform 17(Buf@count) + 19(Buf@count): 18(ptr) Variable Uniform + 20: TypePointer Uniform 16(int) + 22: 16(int) Constant 1 + 23: 16(int) Constant 0 + 25: 8(float) Constant 1065353216 + 26: 9(fvec4) ConstantComposite 25 25 25 25 + 27: TypePointer Uniform 9(fvec4) + 4(main): 2 Function None 3 + 5: Label + 29: 2 FunctionCall 6(@main() + Return + FunctionEnd + 6(@main(): 2 Function None 3 + 7: Label + 21: 20(ptr) AccessChain 19(Buf@count) 15 + 24: 16(int) AtomicIAdd 21 22 23 22 + 28: 27(ptr) AccessChain 13(Buf) 15 24 + Store 28 26 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.numericsuffixes.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.numericsuffixes.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.numericsuffixes.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.numericsuffixes.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -192,7 +192,7 @@ 0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 54 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.numthreads.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.numthreads.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.numthreads.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.numthreads.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,20 +1,20 @@ hlsl.numthreads.comp Shader version: 500 -local_size = (4, 4, 2) +local_size = (1, 4, 8) 0:? Sequence 0:4 Function Definition: main(vu3; ( temp void) 0:4 Function Parameters: 0:4 'tid' ( in 3-component vector of uint) -0:9 Function Definition: @main_aux1(vu3; ( temp void) +0:9 Function Definition: @main_aux2(vu3; ( temp void) 0:9 Function Parameters: 0:9 'tid' ( in 3-component vector of uint) -0:9 Function Definition: main_aux1( ( temp void) +0:9 Function Definition: main_aux2( ( temp void) 0:9 Function Parameters: 0:? Sequence 0:9 move second child to first child ( temp 3-component vector of uint) 0:? 'tid' ( temp 3-component vector of uint) 0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) -0:9 Function Call: @main_aux1(vu3; ( temp void) +0:9 Function Call: @main_aux2(vu3; ( temp void) 0:? 'tid' ( temp 3-component vector of uint) 0:? Linker Objects 0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) @@ -24,39 +24,39 @@ Shader version: 500 -local_size = (4, 4, 2) +local_size = (1, 4, 8) 0:? Sequence 0:4 Function Definition: main(vu3; ( temp void) 0:4 Function Parameters: 0:4 'tid' ( in 3-component vector of uint) -0:9 Function Definition: @main_aux1(vu3; ( temp void) +0:9 Function Definition: @main_aux2(vu3; ( temp void) 0:9 Function Parameters: 0:9 'tid' ( in 3-component vector of uint) -0:9 Function Definition: main_aux1( ( temp void) +0:9 Function Definition: main_aux2( ( temp void) 0:9 Function Parameters: 0:? Sequence 0:9 move second child to first child ( temp 3-component vector of uint) 0:? 'tid' ( temp 3-component vector of uint) 0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) -0:9 Function Call: @main_aux1(vu3; ( temp void) +0:9 Function Call: @main_aux2(vu3; ( temp void) 0:? 'tid' ( temp 3-component vector of uint) 0:? Linker Objects 0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 23 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint GLCompute 4 "main_aux1" 18 - ExecutionMode 4 LocalSize 4 4 2 + EntryPoint GLCompute 4 "main_aux2" 18 + ExecutionMode 4 LocalSize 1 4 8 Source HLSL 500 - Name 4 "main_aux1" + Name 4 "main_aux2" Name 11 "main(vu3;" Name 10 "tid" - Name 14 "@main_aux1(vu3;" + Name 14 "@main_aux2(vu3;" Name 13 "tid" Name 16 "tid" Name 18 "tid" @@ -70,7 +70,7 @@ 9: TypeFunction 2 8(ptr) 17: TypePointer Input 7(ivec3) 18(tid): 17(ptr) Variable Input - 4(main_aux1): 2 Function None 3 + 4(main_aux2): 2 Function None 3 5: Label 16(tid): 8(ptr) Variable Function 20(param): 8(ptr) Variable Function @@ -78,7 +78,7 @@ Store 16(tid) 19 21: 7(ivec3) Load 16(tid) Store 20(param) 21 - 22: 2 FunctionCall 14(@main_aux1(vu3;) 20(param) + 22: 2 FunctionCall 14(@main_aux2(vu3;) 20(param) Return FunctionEnd 11(main(vu3;): 2 Function None 9 @@ -86,7 +86,7 @@ 12: Label Return FunctionEnd -14(@main_aux1(vu3;): 2 Function None 9 +14(@main_aux2(vu3;): 2 Function None 9 13(tid): 8(ptr) FunctionParameter 15: Label Return diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.opaque-type-bug.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.opaque-type-bug.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.opaque-type-bug.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.opaque-type-bug.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -58,7 +58,7 @@ 0:? 'MyTexture' (layout( binding=0) uniform texture2D) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 27 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.overload.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.overload.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.overload.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.overload.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -734,7 +734,7 @@ 0:? 'input' (layout( location=0) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 520 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.params.default.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.params.default.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.params.default.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.params.default.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -376,7 +376,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of int) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 178 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.partialFlattenLocal.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.partialFlattenLocal.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.partialFlattenLocal.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.partialFlattenLocal.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -7,11 +7,17 @@ 0:12 'pos' ( in 4-component vector of float) 0:? Sequence 0:14 move second child to first child ( temp texture2D) -0:? 'packed.tex' ( temp texture2D) +0:14 tex: direct index for structure ( temp texture2D) +0:14 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:14 Constant: +0:14 0 (const int) 0:14 'tex' ( uniform texture2D) 0:15 move second child to first child ( temp 3-component vector of float) 0:15 direct index ( temp 3-component vector of float) -0:? 'packed.pos' ( temp 3-element array of 3-component vector of float) +0:15 pos: direct index for structure ( temp 3-element array of 3-component vector of float) +0:15 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:15 Constant: +0:15 1 (const int) 0:15 Constant: 0:15 0 (const int) 0:? Constant: @@ -20,18 +26,27 @@ 0:? 0.000000 0:16 move second child to first child ( temp 2-component vector of float) 0:16 direct index ( temp 2-component vector of float) -0:? 'packed.uv' ( temp 2-element array of 2-component vector of float) +0:16 uv: direct index for structure ( temp 2-element array of 2-component vector of float) +0:16 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:16 Constant: +0:16 2 (const int) 0:16 Constant: 0:16 0 (const int) 0:? Constant: 0:? 0.000000 0:? 1.000000 0:17 move second child to first child ( temp float) -0:? 'packed.x' ( temp float) +0:17 x: direct index for structure ( temp float) +0:17 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:17 Constant: +0:17 3 (const int) 0:17 Constant: 0:17 1.000000 0:18 move second child to first child ( temp int) -0:? 'packed.n' ( temp int) +0:18 n: direct index for structure ( temp int) +0:18 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:18 Constant: +0:18 4 (const int) 0:18 Constant: 0:18 3 (const int) 0:20 Sequence @@ -50,7 +65,10 @@ 0:21 add second child into first child ( temp 2-component vector of float) 0:21 vector swizzle ( temp 2-component vector of float) 0:21 indirect index ( temp 3-component vector of float) -0:? 'packed.pos' ( temp 3-element array of 3-component vector of float) +0:21 pos: direct index for structure ( temp 3-element array of 3-component vector of float) +0:21 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:21 Constant: +0:21 1 (const int) 0:21 'i' ( temp int) 0:21 Sequence 0:21 Constant: @@ -58,34 +76,27 @@ 0:21 Constant: 0:21 1 (const int) 0:21 indirect index ( temp 2-component vector of float) -0:? 'packed.uv' ( temp 2-element array of 2-component vector of float) +0:21 uv: direct index for structure ( temp 2-element array of 2-component vector of float) +0:21 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:21 Constant: +0:21 2 (const int) 0:21 'i' ( temp int) 0:20 Loop Terminal Expression 0:20 Pre-Increment ( temp int) 0:20 'i' ( temp int) 0:24 Sequence -0:24 Sequence -0:24 move second child to first child ( temp texture2D) -0:? 'packed2.tex' ( temp texture2D) -0:? 'packed.tex' ( temp texture2D) -0:24 move second child to first child ( temp 3-element array of 3-component vector of float) -0:? 'packed2.pos' ( temp 3-element array of 3-component vector of float) -0:? 'packed.pos' ( temp 3-element array of 3-component vector of float) -0:24 move second child to first child ( temp 2-element array of 2-component vector of float) -0:? 'packed2.uv' ( temp 2-element array of 2-component vector of float) -0:? 'packed.uv' ( temp 2-element array of 2-component vector of float) -0:24 move second child to first child ( temp float) -0:? 'packed2.x' ( temp float) -0:? 'packed.x' ( temp float) -0:24 move second child to first child ( temp int) -0:? 'packed2.n' ( temp int) -0:? 'packed.n' ( temp int) +0:24 move second child to first child ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:24 'packed2' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:24 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) 0:26 Branch: Return with expression 0:26 add ( temp 4-component vector of float) 0:26 'pos' ( in 4-component vector of float) 0:? Construct vec4 ( temp 4-component vector of float) 0:26 direct index ( temp 3-component vector of float) -0:? 'packed2.pos' ( temp 3-element array of 3-component vector of float) +0:26 pos: direct index for structure ( temp 3-element array of 3-component vector of float) +0:26 'packed2' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:26 Constant: +0:26 1 (const int) 0:26 Constant: 0:26 0 (const int) 0:26 Constant: @@ -116,11 +127,17 @@ 0:12 'pos' ( in 4-component vector of float) 0:? Sequence 0:14 move second child to first child ( temp texture2D) -0:? 'packed.tex' ( temp texture2D) +0:14 tex: direct index for structure ( temp texture2D) +0:14 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:14 Constant: +0:14 0 (const int) 0:14 'tex' ( uniform texture2D) 0:15 move second child to first child ( temp 3-component vector of float) 0:15 direct index ( temp 3-component vector of float) -0:? 'packed.pos' ( temp 3-element array of 3-component vector of float) +0:15 pos: direct index for structure ( temp 3-element array of 3-component vector of float) +0:15 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:15 Constant: +0:15 1 (const int) 0:15 Constant: 0:15 0 (const int) 0:? Constant: @@ -129,18 +146,27 @@ 0:? 0.000000 0:16 move second child to first child ( temp 2-component vector of float) 0:16 direct index ( temp 2-component vector of float) -0:? 'packed.uv' ( temp 2-element array of 2-component vector of float) +0:16 uv: direct index for structure ( temp 2-element array of 2-component vector of float) +0:16 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:16 Constant: +0:16 2 (const int) 0:16 Constant: 0:16 0 (const int) 0:? Constant: 0:? 0.000000 0:? 1.000000 0:17 move second child to first child ( temp float) -0:? 'packed.x' ( temp float) +0:17 x: direct index for structure ( temp float) +0:17 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:17 Constant: +0:17 3 (const int) 0:17 Constant: 0:17 1.000000 0:18 move second child to first child ( temp int) -0:? 'packed.n' ( temp int) +0:18 n: direct index for structure ( temp int) +0:18 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:18 Constant: +0:18 4 (const int) 0:18 Constant: 0:18 3 (const int) 0:20 Sequence @@ -159,7 +185,10 @@ 0:21 add second child into first child ( temp 2-component vector of float) 0:21 vector swizzle ( temp 2-component vector of float) 0:21 indirect index ( temp 3-component vector of float) -0:? 'packed.pos' ( temp 3-element array of 3-component vector of float) +0:21 pos: direct index for structure ( temp 3-element array of 3-component vector of float) +0:21 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:21 Constant: +0:21 1 (const int) 0:21 'i' ( temp int) 0:21 Sequence 0:21 Constant: @@ -167,34 +196,27 @@ 0:21 Constant: 0:21 1 (const int) 0:21 indirect index ( temp 2-component vector of float) -0:? 'packed.uv' ( temp 2-element array of 2-component vector of float) +0:21 uv: direct index for structure ( temp 2-element array of 2-component vector of float) +0:21 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:21 Constant: +0:21 2 (const int) 0:21 'i' ( temp int) 0:20 Loop Terminal Expression 0:20 Pre-Increment ( temp int) 0:20 'i' ( temp int) 0:24 Sequence -0:24 Sequence -0:24 move second child to first child ( temp texture2D) -0:? 'packed2.tex' ( temp texture2D) -0:? 'packed.tex' ( temp texture2D) -0:24 move second child to first child ( temp 3-element array of 3-component vector of float) -0:? 'packed2.pos' ( temp 3-element array of 3-component vector of float) -0:? 'packed.pos' ( temp 3-element array of 3-component vector of float) -0:24 move second child to first child ( temp 2-element array of 2-component vector of float) -0:? 'packed2.uv' ( temp 2-element array of 2-component vector of float) -0:? 'packed.uv' ( temp 2-element array of 2-component vector of float) -0:24 move second child to first child ( temp float) -0:? 'packed2.x' ( temp float) -0:? 'packed.x' ( temp float) -0:24 move second child to first child ( temp int) -0:? 'packed2.n' ( temp int) -0:? 'packed.n' ( temp int) +0:24 move second child to first child ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:24 'packed2' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:24 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) 0:26 Branch: Return with expression 0:26 add ( temp 4-component vector of float) 0:26 'pos' ( in 4-component vector of float) 0:? Construct vec4 ( temp 4-component vector of float) 0:26 direct index ( temp 3-component vector of float) -0:? 'packed2.pos' ( temp 3-element array of 3-component vector of float) +0:26 pos: direct index for structure ( temp 3-element array of 3-component vector of float) +0:26 'packed2' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:26 Constant: +0:26 1 (const int) 0:26 Constant: 0:26 0 (const int) 0:26 Constant: @@ -215,36 +237,34 @@ 0:? 'pos' (layout( location=0) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 97 +// Generated by (magic number): 80006 +// Id's are bound by 90 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 90 93 + EntryPoint Vertex 4 "main" 83 86 Source HLSL 500 Name 4 "main" Name 11 "@main(vf4;" Name 10 "pos" - Name 15 "packed.tex" - Name 17 "tex" - Name 24 "packed.pos" - Name 35 "packed.uv" - Name 41 "packed.x" - Name 43 "packed.n" - Name 45 "i" - Name 68 "packed2.tex" - Name 70 "packed2.pos" - Name 72 "packed2.uv" - Name 74 "packed2.x" - Name 76 "packed2.n" - Name 88 "pos" - Name 90 "pos" - Name 93 "@entryPointOutput" - Name 94 "param" - Decorate 17(tex) DescriptorSet 0 - Decorate 90(pos) Location 0 - Decorate 93(@entryPointOutput) BuiltIn Position + Name 22 "Packed" + MemberName 22(Packed) 0 "tex" + MemberName 22(Packed) 1 "pos" + MemberName 22(Packed) 2 "uv" + MemberName 22(Packed) 3 "x" + MemberName 22(Packed) 4 "n" + Name 24 "packed" + Name 27 "tex" + Name 47 "i" + Name 69 "packed2" + Name 81 "pos" + Name 83 "pos" + Name 86 "@entryPointOutput" + Name 87 "param" + Decorate 27(tex) DescriptorSet 0 + Decorate 83(pos) Location 0 + Decorate 86(@entryPointOutput) BuiltIn Position 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -252,115 +272,104 @@ 8: TypePointer Function 7(fvec4) 9: TypeFunction 7(fvec4) 8(ptr) 13: TypeImage 6(float) 2D sampled format:Unknown - 14: TypePointer Function 13 - 16: TypePointer UniformConstant 13 - 17(tex): 16(ptr) Variable UniformConstant - 19: TypeVector 6(float) 3 - 20: TypeInt 32 0 - 21: 20(int) Constant 3 - 22: TypeArray 19(fvec3) 21 - 23: TypePointer Function 22 - 25: TypeInt 32 1 - 26: 25(int) Constant 0 - 27: 6(float) Constant 0 - 28: 19(fvec3) ConstantComposite 27 27 27 - 29: TypePointer Function 19(fvec3) - 31: TypeVector 6(float) 2 - 32: 20(int) Constant 2 - 33: TypeArray 31(fvec2) 32 - 34: TypePointer Function 33 - 36: 6(float) Constant 1065353216 - 37: 31(fvec2) ConstantComposite 27 36 - 38: TypePointer Function 31(fvec2) - 40: TypePointer Function 6(float) - 42: TypePointer Function 25(int) - 44: 25(int) Constant 3 - 52: 25(int) Constant 1 - 53: TypeBool - 89: TypePointer Input 7(fvec4) - 90(pos): 89(ptr) Variable Input - 92: TypePointer Output 7(fvec4) -93(@entryPointOutput): 92(ptr) Variable Output + 14: TypeVector 6(float) 3 + 15: TypeInt 32 0 + 16: 15(int) Constant 3 + 17: TypeArray 14(fvec3) 16 + 18: TypeVector 6(float) 2 + 19: 15(int) Constant 2 + 20: TypeArray 18(fvec2) 19 + 21: TypeInt 32 1 + 22(Packed): TypeStruct 13 17 20 6(float) 21(int) + 23: TypePointer Function 22(Packed) + 25: 21(int) Constant 0 + 26: TypePointer UniformConstant 13 + 27(tex): 26(ptr) Variable UniformConstant + 29: TypePointer Function 13 + 31: 21(int) Constant 1 + 32: 6(float) Constant 0 + 33: 14(fvec3) ConstantComposite 32 32 32 + 34: TypePointer Function 14(fvec3) + 36: 21(int) Constant 2 + 37: 6(float) Constant 1065353216 + 38: 18(fvec2) ConstantComposite 32 37 + 39: TypePointer Function 18(fvec2) + 41: 21(int) Constant 3 + 42: TypePointer Function 6(float) + 44: 21(int) Constant 4 + 45: TypePointer Function 21(int) + 54: TypeBool + 82: TypePointer Input 7(fvec4) + 83(pos): 82(ptr) Variable Input + 85: TypePointer Output 7(fvec4) +86(@entryPointOutput): 85(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 88(pos): 8(ptr) Variable Function - 94(param): 8(ptr) Variable Function - 91: 7(fvec4) Load 90(pos) - Store 88(pos) 91 - 95: 7(fvec4) Load 88(pos) - Store 94(param) 95 - 96: 7(fvec4) FunctionCall 11(@main(vf4;) 94(param) - Store 93(@entryPointOutput) 96 + 81(pos): 8(ptr) Variable Function + 87(param): 8(ptr) Variable Function + 84: 7(fvec4) Load 83(pos) + Store 81(pos) 84 + 88: 7(fvec4) Load 81(pos) + Store 87(param) 88 + 89: 7(fvec4) FunctionCall 11(@main(vf4;) 87(param) + Store 86(@entryPointOutput) 89 Return FunctionEnd 11(@main(vf4;): 7(fvec4) Function None 9 10(pos): 8(ptr) FunctionParameter 12: Label - 15(packed.tex): 14(ptr) Variable Function - 24(packed.pos): 23(ptr) Variable Function - 35(packed.uv): 34(ptr) Variable Function - 41(packed.x): 40(ptr) Variable Function - 43(packed.n): 42(ptr) Variable Function - 45(i): 42(ptr) Variable Function - 68(packed2.tex): 14(ptr) Variable Function - 70(packed2.pos): 23(ptr) Variable Function - 72(packed2.uv): 34(ptr) Variable Function - 74(packed2.x): 40(ptr) Variable Function - 76(packed2.n): 42(ptr) Variable Function - 18: 13 Load 17(tex) - Store 15(packed.tex) 18 - 30: 29(ptr) AccessChain 24(packed.pos) 26 + 24(packed): 23(ptr) Variable Function + 47(i): 45(ptr) Variable Function + 69(packed2): 23(ptr) Variable Function + 28: 13 Load 27(tex) + 30: 29(ptr) AccessChain 24(packed) 25 Store 30 28 - 39: 38(ptr) AccessChain 35(packed.uv) 26 - Store 39 37 - Store 41(packed.x) 36 - Store 43(packed.n) 44 - Store 45(i) 26 - Branch 46 - 46: Label - LoopMerge 48 49 None - Branch 50 - 50: Label - 51: 25(int) Load 45(i) - 54: 53(bool) SLessThan 51 52 - BranchConditional 54 47 48 - 47: Label - 55: 25(int) Load 45(i) - 56: 25(int) Load 45(i) - 57: 38(ptr) AccessChain 35(packed.uv) 56 - 58: 31(fvec2) Load 57 - 59: 29(ptr) AccessChain 24(packed.pos) 55 - 60: 19(fvec3) Load 59 - 61: 31(fvec2) VectorShuffle 60 60 0 1 - 62: 31(fvec2) FAdd 61 58 - 63: 29(ptr) AccessChain 24(packed.pos) 55 - 64: 19(fvec3) Load 63 - 65: 19(fvec3) VectorShuffle 64 62 3 4 2 - Store 63 65 - Branch 49 - 49: Label - 66: 25(int) Load 45(i) - 67: 25(int) IAdd 66 52 - Store 45(i) 67 - Branch 46 + 35: 34(ptr) AccessChain 24(packed) 31 25 + Store 35 33 + 40: 39(ptr) AccessChain 24(packed) 36 25 + Store 40 38 + 43: 42(ptr) AccessChain 24(packed) 41 + Store 43 37 + 46: 45(ptr) AccessChain 24(packed) 44 + Store 46 41 + Store 47(i) 25 + Branch 48 48: Label - 69: 13 Load 15(packed.tex) - Store 68(packed2.tex) 69 - 71: 22 Load 24(packed.pos) - Store 70(packed2.pos) 71 - 73: 33 Load 35(packed.uv) - Store 72(packed2.uv) 73 - 75: 6(float) Load 41(packed.x) - Store 74(packed2.x) 75 - 77: 25(int) Load 43(packed.n) - Store 76(packed2.n) 77 - 78: 7(fvec4) Load 10(pos) - 79: 29(ptr) AccessChain 70(packed2.pos) 26 - 80: 19(fvec3) Load 79 - 81: 6(float) CompositeExtract 80 0 - 82: 6(float) CompositeExtract 80 1 - 83: 6(float) CompositeExtract 80 2 - 84: 7(fvec4) CompositeConstruct 81 82 83 27 - 85: 7(fvec4) FAdd 78 84 - ReturnValue 85 + LoopMerge 50 51 None + Branch 52 + 52: Label + 53: 21(int) Load 47(i) + 55: 54(bool) SLessThan 53 31 + BranchConditional 55 49 50 + 49: Label + 56: 21(int) Load 47(i) + 57: 21(int) Load 47(i) + 58: 39(ptr) AccessChain 24(packed) 36 57 + 59: 18(fvec2) Load 58 + 60: 34(ptr) AccessChain 24(packed) 31 56 + 61: 14(fvec3) Load 60 + 62: 18(fvec2) VectorShuffle 61 61 0 1 + 63: 18(fvec2) FAdd 62 59 + 64: 34(ptr) AccessChain 24(packed) 31 56 + 65: 14(fvec3) Load 64 + 66: 14(fvec3) VectorShuffle 65 63 3 4 2 + Store 64 66 + Branch 51 + 51: Label + 67: 21(int) Load 47(i) + 68: 21(int) IAdd 67 31 + Store 47(i) 68 + Branch 48 + 50: Label + 70: 22(Packed) Load 24(packed) + Store 69(packed2) 70 + 71: 7(fvec4) Load 10(pos) + 72: 34(ptr) AccessChain 69(packed2) 31 25 + 73: 14(fvec3) Load 72 + 74: 6(float) CompositeExtract 73 0 + 75: 6(float) CompositeExtract 73 1 + 76: 6(float) CompositeExtract 73 2 + 77: 7(fvec4) CompositeConstruct 74 75 76 32 + 78: 7(fvec4) FAdd 71 77 + ReturnValue 78 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.partialFlattenMixed.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.partialFlattenMixed.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.partialFlattenMixed.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.partialFlattenMixed.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -9,13 +9,19 @@ 0:13 Sequence 0:13 move second child to first child ( temp texture2D) 0:13 direct index ( temp texture2D) -0:? 'packed.membTex' ( temp 2-element array of texture2D) +0:13 membTex: direct index for structure ( temp 2-element array of texture2D) +0:13 'packed' ( temp structure{ temp int a, temp 2-element array of texture2D membTex, temp int b}) +0:13 Constant: +0:13 1 (const int) 0:13 Constant: 0:13 0 (const int) 0:? 'tex[0]' ( uniform texture2D) 0:13 move second child to first child ( temp texture2D) 0:13 direct index ( temp texture2D) -0:? 'packed.membTex' ( temp 2-element array of texture2D) +0:13 membTex: direct index for structure ( temp 2-element array of texture2D) +0:13 'packed' ( temp structure{ temp int a, temp 2-element array of texture2D membTex, temp int b}) +0:13 Constant: +0:13 1 (const int) 0:13 Constant: 0:13 1 (const int) 0:? 'tex[1]' ( uniform texture2D) @@ -50,13 +56,19 @@ 0:13 Sequence 0:13 move second child to first child ( temp texture2D) 0:13 direct index ( temp texture2D) -0:? 'packed.membTex' ( temp 2-element array of texture2D) +0:13 membTex: direct index for structure ( temp 2-element array of texture2D) +0:13 'packed' ( temp structure{ temp int a, temp 2-element array of texture2D membTex, temp int b}) +0:13 Constant: +0:13 1 (const int) 0:13 Constant: 0:13 0 (const int) 0:? 'tex[0]' ( uniform texture2D) 0:13 move second child to first child ( temp texture2D) 0:13 direct index ( temp texture2D) -0:? 'packed.membTex' ( temp 2-element array of texture2D) +0:13 membTex: direct index for structure ( temp 2-element array of texture2D) +0:13 'packed' ( temp structure{ temp int a, temp 2-element array of texture2D membTex, temp int b}) +0:13 Constant: +0:13 1 (const int) 0:13 Constant: 0:13 1 (const int) 0:? 'tex[1]' ( uniform texture2D) @@ -79,72 +91,77 @@ 0:? 'pos' (layout( location=0) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 42 +// Generated by (magic number): 80006 +// Id's are bound by 43 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 35 38 + EntryPoint Vertex 4 "main" 36 39 Source HLSL 500 Name 4 "main" Name 11 "@main(vf4;" Name 10 "pos" - Name 18 "packed.membTex" - Name 22 "tex[0]" - Name 27 "tex[1]" - Name 33 "pos" - Name 35 "pos" - Name 38 "@entryPointOutput" - Name 39 "param" - Decorate 22(tex[0]) DescriptorSet 0 - Decorate 27(tex[1]) DescriptorSet 0 - Decorate 35(pos) Location 0 - Decorate 38(@entryPointOutput) BuiltIn Position + Name 18 "Packed" + MemberName 18(Packed) 0 "a" + MemberName 18(Packed) 1 "membTex" + MemberName 18(Packed) 2 "b" + Name 20 "packed" + Name 24 "tex[0]" + Name 28 "tex[1]" + Name 34 "pos" + Name 36 "pos" + Name 39 "@entryPointOutput" + Name 40 "param" + Decorate 24(tex[0]) DescriptorSet 0 + Decorate 28(tex[1]) DescriptorSet 0 + Decorate 36(pos) Location 0 + Decorate 39(@entryPointOutput) BuiltIn Position 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 7: TypeVector 6(float) 4 8: TypePointer Function 7(fvec4) 9: TypeFunction 7(fvec4) 8(ptr) - 13: TypeImage 6(float) 2D sampled format:Unknown - 14: TypeInt 32 0 - 15: 14(int) Constant 2 - 16: TypeArray 13 15 - 17: TypePointer Function 16 - 19: TypeInt 32 1 - 20: 19(int) Constant 0 - 21: TypePointer UniformConstant 13 - 22(tex[0]): 21(ptr) Variable UniformConstant - 24: TypePointer Function 13 - 26: 19(int) Constant 1 - 27(tex[1]): 21(ptr) Variable UniformConstant - 34: TypePointer Input 7(fvec4) - 35(pos): 34(ptr) Variable Input - 37: TypePointer Output 7(fvec4) -38(@entryPointOutput): 37(ptr) Variable Output + 13: TypeInt 32 1 + 14: TypeImage 6(float) 2D sampled format:Unknown + 15: TypeInt 32 0 + 16: 15(int) Constant 2 + 17: TypeArray 14 16 + 18(Packed): TypeStruct 13(int) 17 13(int) + 19: TypePointer Function 18(Packed) + 21: 13(int) Constant 1 + 22: 13(int) Constant 0 + 23: TypePointer UniformConstant 14 + 24(tex[0]): 23(ptr) Variable UniformConstant + 26: TypePointer Function 14 + 28(tex[1]): 23(ptr) Variable UniformConstant + 35: TypePointer Input 7(fvec4) + 36(pos): 35(ptr) Variable Input + 38: TypePointer Output 7(fvec4) +39(@entryPointOutput): 38(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 33(pos): 8(ptr) Variable Function - 39(param): 8(ptr) Variable Function - 36: 7(fvec4) Load 35(pos) - Store 33(pos) 36 - 40: 7(fvec4) Load 33(pos) - Store 39(param) 40 - 41: 7(fvec4) FunctionCall 11(@main(vf4;) 39(param) - Store 38(@entryPointOutput) 41 + 34(pos): 8(ptr) Variable Function + 40(param): 8(ptr) Variable Function + 37: 7(fvec4) Load 36(pos) + Store 34(pos) 37 + 41: 7(fvec4) Load 34(pos) + Store 40(param) 41 + 42: 7(fvec4) FunctionCall 11(@main(vf4;) 40(param) + Store 39(@entryPointOutput) 42 Return FunctionEnd 11(@main(vf4;): 7(fvec4) Function None 9 10(pos): 8(ptr) FunctionParameter 12: Label -18(packed.membTex): 17(ptr) Variable Function - 23: 13 Load 22(tex[0]) - 25: 24(ptr) AccessChain 18(packed.membTex) 20 - Store 25 23 - 28: 13 Load 27(tex[1]) - 29: 24(ptr) AccessChain 18(packed.membTex) 26 - Store 29 28 - 30: 7(fvec4) Load 10(pos) - ReturnValue 30 + 20(packed): 19(ptr) Variable Function + 25: 14 Load 24(tex[0]) + 27: 26(ptr) AccessChain 20(packed) 21 22 + Store 27 25 + 29: 14 Load 28(tex[1]) + 30: 26(ptr) AccessChain 20(packed) 21 21 + Store 30 29 + 31: 7(fvec4) Load 10(pos) + ReturnValue 31 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.partialInit.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.partialInit.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.partialInit.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.partialInit.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -399,7 +399,7 @@ 0:? 0 (const int) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 104 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.PointSize.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.PointSize.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.PointSize.geom.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.PointSize.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,143 @@ +hlsl.PointSize.geom +Shader version: 500 +invocations = -1 +max_vertices = 4 +input primitive = triangles +output primitive = line_strip +0:? Sequence +0:8 Function Definition: @main(u1[3];struct-S-f11; ( temp void) +0:8 Function Parameters: +0:8 'ps' ( in 3-element array of uint) +0:8 'OutputStream' ( out structure{ temp float ps}) +0:? Sequence +0:10 Sequence +0:10 Sequence +0:10 move second child to first child ( temp float) +0:? 'OutputStream.ps' ( out float PointSize) +0:10 ps: direct index for structure ( temp float) +0:10 's' ( temp structure{ temp float ps}) +0:10 Constant: +0:10 0 (const int) +0:10 EmitVertex ( temp void) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 move second child to first child ( temp 3-element array of uint) +0:? 'ps' ( temp 3-element array of uint) +0:? 'ps' ( in 3-element array of uint PointSize) +0:8 Function Call: @main(u1[3];struct-S-f11; ( temp void) +0:? 'ps' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp float ps}) +0:? Linker Objects +0:? 'ps' ( in 3-element array of uint PointSize) +0:? 'OutputStream.ps' ( out float PointSize) + + +Linked geometry stage: + + +Shader version: 500 +invocations = 1 +max_vertices = 4 +input primitive = triangles +output primitive = line_strip +0:? Sequence +0:8 Function Definition: @main(u1[3];struct-S-f11; ( temp void) +0:8 Function Parameters: +0:8 'ps' ( in 3-element array of uint) +0:8 'OutputStream' ( out structure{ temp float ps}) +0:? Sequence +0:10 Sequence +0:10 Sequence +0:10 move second child to first child ( temp float) +0:? 'OutputStream.ps' ( out float PointSize) +0:10 ps: direct index for structure ( temp float) +0:10 's' ( temp structure{ temp float ps}) +0:10 Constant: +0:10 0 (const int) +0:10 EmitVertex ( temp void) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 move second child to first child ( temp 3-element array of uint) +0:? 'ps' ( temp 3-element array of uint) +0:? 'ps' ( in 3-element array of uint PointSize) +0:8 Function Call: @main(u1[3];struct-S-f11; ( temp void) +0:? 'ps' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp float ps}) +0:? Linker Objects +0:? 'ps' ( in 3-element array of uint PointSize) +0:? 'OutputStream.ps' ( out float PointSize) + +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 36 + + Capability Geometry + Capability GeometryPointSize + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 19 28 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputLineStrip + ExecutionMode 4 OutputVertices 4 + Source HLSL 500 + Name 4 "main" + Name 11 "S" + MemberName 11(S) 0 "ps" + Name 16 "@main(u1[3];struct-S-f11;" + Name 14 "ps" + Name 15 "OutputStream" + Name 19 "OutputStream.ps" + Name 20 "s" + Name 26 "ps" + Name 28 "ps" + Name 30 "OutputStream" + Name 31 "param" + Name 33 "param" + Decorate 19(OutputStream.ps) BuiltIn PointSize + Decorate 28(ps) BuiltIn PointSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: 6(int) Constant 3 + 8: TypeArray 6(int) 7 + 9: TypePointer Function 8 + 10: TypeFloat 32 + 11(S): TypeStruct 10(float) + 12: TypePointer Function 11(S) + 13: TypeFunction 2 9(ptr) 12(ptr) + 18: TypePointer Output 10(float) +19(OutputStream.ps): 18(ptr) Variable Output + 21: TypeInt 32 1 + 22: 21(int) Constant 0 + 23: TypePointer Function 10(float) + 27: TypePointer Input 8 + 28(ps): 27(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 26(ps): 9(ptr) Variable Function +30(OutputStream): 12(ptr) Variable Function + 31(param): 9(ptr) Variable Function + 33(param): 12(ptr) Variable Function + 29: 8 Load 28(ps) + Store 26(ps) 29 + 32: 8 Load 26(ps) + Store 31(param) 32 + 34: 2 FunctionCall 16(@main(u1[3];struct-S-f11;) 31(param) 33(param) + 35: 11(S) Load 33(param) + Store 30(OutputStream) 35 + Return + FunctionEnd +16(@main(u1[3];struct-S-f11;): 2 Function None 13 + 14(ps): 9(ptr) FunctionParameter +15(OutputStream): 12(ptr) FunctionParameter + 17: Label + 20(s): 12(ptr) Variable Function + 24: 23(ptr) AccessChain 20(s) 22 + 25: 10(float) Load 24 + Store 19(OutputStream.ps) 25 + EmitVertex + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.PointSize.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.PointSize.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.PointSize.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.PointSize.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,69 @@ +hlsl.PointSize.vert +Shader version: 500 +0:? Sequence +0:2 Function Definition: @main( ( temp float) +0:2 Function Parameters: +0:? Sequence +0:3 Branch: Return with expression +0:3 Constant: +0:3 2.300000 +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp float) +0:? '@entryPointOutput' ( out float PointSize) +0:2 Function Call: @main( ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' ( out float PointSize) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:2 Function Definition: @main( ( temp float) +0:2 Function Parameters: +0:? Sequence +0:3 Branch: Return with expression +0:3 Constant: +0:3 2.300000 +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp float) +0:? '@entryPointOutput' ( out float PointSize) +0:2 Function Call: @main( ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' ( out float PointSize) + +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 16 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 14 + Source HLSL 500 + Name 4 "main" + Name 8 "@main(" + Name 14 "@entryPointOutput" + Decorate 14(@entryPointOutput) BuiltIn PointSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeFunction 6(float) + 10: 6(float) Constant 1075000115 + 13: TypePointer Output 6(float) +14(@entryPointOutput): 13(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 15: 6(float) FunctionCall 8(@main() + Store 14(@entryPointOutput) 15 + Return + FunctionEnd + 8(@main(): 6(float) Function None 7 + 9: Label + ReturnValue 10 + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.pp.line.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.pp.line.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.pp.line.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.pp.line.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.pp.line.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:4 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:4 Function Parameters: @@ -62,6 +63,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:4 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:4 Function Parameters: @@ -118,7 +120,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 42 Capability Shader @@ -126,6 +128,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 35 39 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.pp.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.pp.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.pp.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.pp.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -26,7 +26,7 @@ 0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int goodGlobal1, uniform int goodGlobal2}) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 13 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.precedence2.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.precedence2.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.precedence2.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.precedence2.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -114,7 +114,7 @@ 0:? 'a4' (layout( location=3) flat in int) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 56 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.precedence.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.precedence.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.precedence.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.precedence.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -148,7 +148,7 @@ 0:? 'a4' (layout( location=3) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 65 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.precise.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.precise.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.precise.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.precise.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -76,7 +76,7 @@ 0:? '@entryPointOutput.color' (layout( location=0) noContraction out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 37 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.preprocessor.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.preprocessor.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.preprocessor.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.preprocessor.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -94,7 +94,7 @@ 0:? 'input' (layout( location=0) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 40 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.promote.atomic.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.promote.atomic.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.promote.atomic.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.promote.atomic.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -64,7 +64,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 36 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.promote.binary.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.promote.binary.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.promote.binary.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.promote.binary.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -172,7 +172,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 83 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.promote.vec1.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.promote.vec1.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.promote.vec1.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.promote.vec1.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -80,7 +80,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 31 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.promotions.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.promotions.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.promotions.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.promotions.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1582,7 +1582,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 596 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.rw.atomics.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.rw.atomics.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.rw.atomics.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.rw.atomics.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -3946,7 +3946,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 1147 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.rw.bracket.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.rw.bracket.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.rw.bracket.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.rw.bracket.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1744,7 +1744,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 607 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.rw.register.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.rw.register.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.rw.register.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.rw.register.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -98,7 +98,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 42 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1690,7 +1690,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 571 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -202,7 +202,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 63 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1708,7 +1708,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 605 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.sample.array.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.sample.array.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.sample.array.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.sample.array.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.sample.array.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -163,6 +164,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -320,7 +322,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 146 Capability Shader @@ -330,6 +332,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 138 142 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.sample.basic.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.sample.basic.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.sample.basic.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.sample.basic.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -3,6 +3,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:53 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:53 Function Parameters: @@ -278,6 +279,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:53 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:53 Function Parameters: @@ -548,7 +550,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 198 Capability Shader @@ -557,6 +559,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 188 192 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplebias.array.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplebias.array.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplebias.array.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplebias.array.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplebias.array.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -181,6 +182,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -356,7 +358,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 146 Capability Shader @@ -366,6 +368,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 138 142 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplebias.basic.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplebias.basic.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplebias.basic.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplebias.basic.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplebias.basic.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:28 Function Parameters: @@ -214,6 +215,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:28 Function Parameters: @@ -422,7 +424,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 170 Capability Shader @@ -431,6 +433,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 162 166 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplebias.offsetarray.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:20 Function Parameters: @@ -151,6 +152,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:20 Function Parameters: @@ -296,7 +298,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 118 Capability Shader @@ -305,6 +307,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 110 114 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplebias.offset.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:28 Function Parameters: @@ -202,6 +203,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:28 Function Parameters: @@ -398,7 +400,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 161 Capability Shader @@ -407,6 +409,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 144 148 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplecmp.array.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplecmp.array.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplecmp.array.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplecmp.array.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplecmp.array.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:38 Function Parameters: @@ -201,6 +202,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:38 Function Parameters: @@ -396,7 +398,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 209 Capability Shader @@ -406,6 +408,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 166 170 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplecmp.basic.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplecmp.basic.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplecmp.basic.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplecmp.basic.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplecmp.basic.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:38 Function Parameters: @@ -192,6 +193,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:38 Function Parameters: @@ -378,7 +380,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 198 Capability Shader @@ -388,6 +390,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 155 159 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplecmp.dualmode.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplecmp.dualmode.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplecmp.dualmode.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplecmp.dualmode.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -85,7 +85,7 @@ 0:? 'g_tTex' (layout( binding=3) uniform texture1D) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 43 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplecmplevelzero.array.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:38 Function Parameters: @@ -219,6 +220,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:38 Function Parameters: @@ -432,7 +434,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 210 Capability Shader @@ -442,6 +444,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 167 171 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplecmplevelzero.basic.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplecmplevelzero.basic.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplecmplevelzero.basic.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplecmplevelzero.basic.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplecmplevelzero.basic.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:38 Function Parameters: @@ -210,6 +211,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:38 Function Parameters: @@ -414,7 +416,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 199 Capability Shader @@ -424,6 +426,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 156 160 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplecmplevelzero.offsetarray.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplecmplevelzero.offsetarray.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplecmplevelzero.offsetarray.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplecmplevelzero.offsetarray.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplecmplevelzero.offsetarray.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:38 Function Parameters: @@ -183,6 +184,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:38 Function Parameters: @@ -360,7 +362,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 179 Capability Shader @@ -370,6 +372,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 127 131 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplecmplevelzero.offset.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplecmplevelzero.offset.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplecmplevelzero.offset.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplecmplevelzero.offset.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplecmplevelzero.offset.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:38 Function Parameters: @@ -177,6 +178,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:38 Function Parameters: @@ -348,7 +350,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 168 Capability Shader @@ -358,6 +360,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 116 120 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplecmp.offsetarray.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplecmp.offsetarray.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplecmp.offsetarray.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplecmp.offsetarray.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplecmp.offsetarray.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:38 Function Parameters: @@ -171,6 +172,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:38 Function Parameters: @@ -336,7 +338,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 178 Capability Shader @@ -346,6 +348,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 126 130 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplecmp.offset.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplecmp.offset.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplecmp.offset.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplecmp.offset.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplecmp.offset.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:38 Function Parameters: @@ -165,6 +166,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:38 Function Parameters: @@ -324,7 +326,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 167 Capability Shader @@ -334,6 +336,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 115 119 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplegrad.array.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplegrad.array.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplegrad.array.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplegrad.array.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplegrad.array.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -217,6 +218,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -428,7 +430,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 140 Capability Shader @@ -438,6 +440,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 132 136 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplegrad.basic.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:28 Function Parameters: @@ -268,6 +269,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:28 Function Parameters: @@ -530,7 +532,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 175 Capability Shader @@ -539,6 +541,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 167 171 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -494,7 +494,7 @@ 0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 166 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplegrad.offsetarray.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplegrad.offsetarray.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplegrad.offsetarray.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplegrad.offsetarray.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplegrad.offsetarray.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -172,6 +173,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -338,7 +340,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 120 Capability Shader @@ -348,6 +350,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 103 107 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplegrad.offset.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplegrad.offset.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplegrad.offset.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplegrad.offset.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplegrad.offset.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:28 Function Parameters: @@ -238,6 +239,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:28 Function Parameters: @@ -470,7 +472,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 166 Capability Shader @@ -479,6 +481,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 149 153 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplelevel.array.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplelevel.array.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplelevel.array.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplelevel.array.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplelevel.array.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -181,6 +182,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:24 Function Parameters: @@ -356,7 +358,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 147 Capability Shader @@ -366,6 +368,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 139 143 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplelevel.basic.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:29 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:29 Function Parameters: @@ -215,6 +216,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:29 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:29 Function Parameters: @@ -424,7 +426,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 172 Capability Shader @@ -433,6 +435,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 163 167 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -386,7 +386,7 @@ 0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 162 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplelevel.offsetarray.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplelevel.offsetarray.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplelevel.offsetarray.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplelevel.offsetarray.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplelevel.offsetarray.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:20 Function Parameters: @@ -151,6 +152,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:20 Function Parameters: @@ -296,7 +298,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 119 Capability Shader @@ -305,6 +307,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 111 115 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplelevel.offset.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplelevel.offset.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.samplelevel.offset.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.samplelevel.offset.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.samplelevel.offset.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:28 Function Parameters: @@ -202,6 +203,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:28 Function Parameters: @@ -398,7 +400,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 162 Capability Shader @@ -407,6 +409,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 145 149 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.sample.offsetarray.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.sample.offsetarray.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.sample.offsetarray.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.sample.offsetarray.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.sample.offsetarray.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:20 Function Parameters: @@ -139,6 +140,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:20 Function Parameters: @@ -272,7 +274,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 118 Capability Shader @@ -281,6 +283,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 110 114 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.sample.offset.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.sample.offset.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.sample.offset.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.sample.offset.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ hlsl.sample.offset.dx10.frag Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:28 Function Parameters: @@ -184,6 +185,7 @@ Shader version: 500 gl_FragCoord origin is upper left +using depth_any 0:? Sequence 0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) 0:28 Function Parameters: @@ -362,7 +364,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 161 Capability Shader @@ -371,6 +373,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 144 148 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.sample.sub-vec4.dx10.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.sample.sub-vec4.dx10.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.sample.sub-vec4.dx10.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.sample.sub-vec4.dx10.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -154,7 +154,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 72 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.scalar2matrix.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.scalar2matrix.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.scalar2matrix.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.scalar2matrix.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -374,7 +374,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 96 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.scalarCast.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.scalarCast.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.scalarCast.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.scalarCast.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -322,7 +322,7 @@ 0:? '@entryPointOutput.texCoord' (layout( location=0) out 2-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 120 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.scalar-length.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.scalar-length.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.scalar-length.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.scalar-length.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -64,7 +64,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 30 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.scope.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.scope.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.scope.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.scope.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -102,7 +102,7 @@ 0:? 'input' (layout( location=0) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 49 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.semantic-1.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.semantic-1.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.semantic-1.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.semantic-1.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -242,7 +242,7 @@ 0:? 'v' (layout( location=0) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 84 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.semantic.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.semantic.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.semantic.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.semantic.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -156,7 +156,7 @@ 0:? 'OutputStream.cull0' ( out 1-element array of float CullDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 65 Capability Geometry diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.semantic.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.semantic.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.semantic.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.semantic.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -210,7 +210,7 @@ 0:? '@entryPointOutput.cull1' ( out 2-element array of float CullDistance) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 70 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.semicolons.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.semicolons.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.semicolons.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.semicolons.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -74,7 +74,7 @@ 0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 31 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.shapeConv.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.shapeConv.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.shapeConv.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.shapeConv.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -321,7 +321,7 @@ 0:? Linker Objects // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 127 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.shapeConvRet.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.shapeConvRet.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.shapeConvRet.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.shapeConvRet.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -68,7 +68,7 @@ 0:? 'f' (layout( location=0) in float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 35 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.shift.per-set.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.shift.per-set.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.shift.per-set.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.shift.per-set.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -9,15 +9,15 @@ 0:36 't2' (layout( set=1 binding=2) uniform texture2D) 0:37 't3' (layout( set=2 binding=1) uniform texture3D) 0:38 direct index (layout( row_major std430) buffer 4-component vector of float) -0:38 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float) -0:38 't4' (layout( set=3 binding=1 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:38 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:38 't4' (layout( set=3 binding=1 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:38 Constant: 0:38 0 (const uint) 0:38 Constant: 0:38 0 (const int) 0:39 indirect index (layout( row_major std430) buffer uint) -0:39 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:39 't5' (layout( set=3 binding=2 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:39 't5' (layout( set=3 binding=2 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:39 Constant: 0:39 0 (const uint) 0:39 right-shift ( temp int) @@ -36,8 +36,8 @@ 0:49 Constant: 0:49 0 (const int) 0:50 indirect index (layout( row_major std430) buffer uint) -0:50 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:50 'u5' (layout( set=2 binding=4 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:50 'u5' (layout( set=2 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:50 Constant: 0:50 0 (const uint) 0:50 right-shift ( temp int) @@ -46,14 +46,14 @@ 0:50 Constant: 0:50 2 (const int) 0:51 direct index (layout( row_major std430) buffer float) -0:51 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of float) -0:51 'u6' (layout( set=3 binding=4 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:51 'u6' (layout( set=3 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:51 Constant: 0:51 0 (const uint) 0:51 Constant: 0:51 0 (const int) -0:52 'u7' (layout( set=4 binding=4 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) -0:53 'u8' (layout( set=5 binding=4 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:52 'u7' (layout( set=4 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:53 'u8' (layout( set=5 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:55 cb1: direct index for structure (layout( row_major std140) uniform int) 0:55 'anon@0' (layout( set=6 binding=1 row_major std140) uniform block{layout( row_major std140) uniform int cb1}) 0:55 Constant: @@ -80,17 +80,17 @@ 0:? 't1' (layout( set=1 binding=1) uniform texture1D) 0:? 't2' (layout( set=1 binding=2) uniform texture2D) 0:? 't3' (layout( set=2 binding=1) uniform texture3D) -0:? 't4' (layout( set=3 binding=1 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) -0:? 't5' (layout( set=3 binding=2 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:? 't4' (layout( set=3 binding=1 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 't5' (layout( set=3 binding=2 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:? 't6' (layout( set=3 binding=3 rgba32f) uniform textureBuffer) 0:? 'u1' (layout( set=1 binding=1 rgba32f) uniform image1D) 0:? 'u2' (layout( set=2 binding=2 rgba32f) uniform image2D) 0:? 'u3' (layout( set=2 binding=3 rgba32f) uniform image3D) 0:? 'u4' (layout( set=1 binding=4 r32f) uniform imageBuffer) -0:? 'u5' (layout( set=2 binding=4 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) -0:? 'u6' (layout( set=3 binding=4 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) -0:? 'u7' (layout( set=4 binding=4 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) -0:? 'u8' (layout( set=5 binding=4 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:? 'u5' (layout( set=2 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? 'u6' (layout( set=3 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:? 'u7' (layout( set=4 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:? 'u8' (layout( set=5 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:? 'anon@0' (layout( set=6 binding=1 row_major std140) uniform block{layout( row_major std140) uniform int cb1}) 0:? 'anon@1' (layout( binding=7 row_major std430) readonly buffer block{layout( row_major std430) buffer int tb1}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) @@ -109,15 +109,15 @@ 0:36 't2' (layout( set=1 binding=2) uniform texture2D) 0:37 't3' (layout( set=2 binding=1) uniform texture3D) 0:38 direct index (layout( row_major std430) buffer 4-component vector of float) -0:38 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float) -0:38 't4' (layout( set=3 binding=1 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:38 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:38 't4' (layout( set=3 binding=1 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:38 Constant: 0:38 0 (const uint) 0:38 Constant: 0:38 0 (const int) 0:39 indirect index (layout( row_major std430) buffer uint) -0:39 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:39 't5' (layout( set=3 binding=2 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:39 't5' (layout( set=3 binding=2 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:39 Constant: 0:39 0 (const uint) 0:39 right-shift ( temp int) @@ -136,8 +136,8 @@ 0:49 Constant: 0:49 0 (const int) 0:50 indirect index (layout( row_major std430) buffer uint) -0:50 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:50 'u5' (layout( set=2 binding=4 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:50 'u5' (layout( set=2 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:50 Constant: 0:50 0 (const uint) 0:50 right-shift ( temp int) @@ -146,14 +146,14 @@ 0:50 Constant: 0:50 2 (const int) 0:51 direct index (layout( row_major std430) buffer float) -0:51 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of float) -0:51 'u6' (layout( set=3 binding=4 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:51 'u6' (layout( set=3 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:51 Constant: 0:51 0 (const uint) 0:51 Constant: 0:51 0 (const int) -0:52 'u7' (layout( set=4 binding=4 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) -0:53 'u8' (layout( set=5 binding=4 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:52 'u7' (layout( set=4 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:53 'u8' (layout( set=5 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:55 cb1: direct index for structure (layout( row_major std140) uniform int) 0:55 'anon@0' (layout( set=6 binding=1 row_major std140) uniform block{layout( row_major std140) uniform int cb1}) 0:55 Constant: @@ -180,17 +180,17 @@ 0:? 't1' (layout( set=1 binding=1) uniform texture1D) 0:? 't2' (layout( set=1 binding=2) uniform texture2D) 0:? 't3' (layout( set=2 binding=1) uniform texture3D) -0:? 't4' (layout( set=3 binding=1 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) -0:? 't5' (layout( set=3 binding=2 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:? 't4' (layout( set=3 binding=1 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 't5' (layout( set=3 binding=2 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:? 't6' (layout( set=3 binding=3 rgba32f) uniform textureBuffer) 0:? 'u1' (layout( set=1 binding=1 rgba32f) uniform image1D) 0:? 'u2' (layout( set=2 binding=2 rgba32f) uniform image2D) 0:? 'u3' (layout( set=2 binding=3 rgba32f) uniform image3D) 0:? 'u4' (layout( set=1 binding=4 r32f) uniform imageBuffer) -0:? 'u5' (layout( set=2 binding=4 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) -0:? 'u6' (layout( set=3 binding=4 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) -0:? 'u7' (layout( set=4 binding=4 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) -0:? 'u8' (layout( set=5 binding=4 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:? 'u5' (layout( set=2 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? 'u6' (layout( set=3 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:? 'u7' (layout( set=4 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:? 'u8' (layout( set=5 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:? 'anon@0' (layout( set=6 binding=1 row_major std140) uniform block{layout( row_major std140) uniform int cb1}) 0:? 'anon@1' (layout( binding=7 row_major std430) readonly buffer block{layout( row_major std430) buffer int tb1}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.sin.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.sin.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.sin.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.sin.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -52,7 +52,7 @@ 0:? 'input' (layout( location=0) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 26 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.snorm.uav.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.snorm.uav.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.snorm.uav.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.snorm.uav.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,212 @@ +hlsl.snorm.uav.comp +Shader version: 500 +local_size = (16, 16, 1) +0:? Sequence +0:12 Function Definition: @main(vu3; ( temp void) +0:12 Function Parameters: +0:12 'tid' ( in 3-component vector of uint) +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'storeTemp' ( temp 4-component vector of float) +0:13 add ( temp 4-component vector of float) +0:13 textureFetch ( temp 4-component vector of float) +0:13 'ResultInS' (layout( binding=1) uniform texture3D) +0:13 'tid' ( in 3-component vector of uint) +0:13 Constant: +0:13 0 (const int) +0:13 uf4: direct index for structure ( uniform 4-component vector of float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float uf4}) +0:13 Constant: +0:13 0 (const uint) +0:13 imageStore ( temp void) +0:13 'ResultOutS' (layout( binding=1 rgba32f) uniform image3D) +0:13 'tid' ( in 3-component vector of uint) +0:13 'storeTemp' ( temp 4-component vector of float) +0:13 'storeTemp' ( temp 4-component vector of float) +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 'storeTemp' ( temp 4-component vector of float) +0:14 textureFetch ( temp 4-component vector of float) +0:14 'ResultInU' (layout( binding=0) uniform texture3D) +0:14 'tid' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 imageStore ( temp void) +0:14 'ResultOutU' (layout( binding=0 rgba32f) uniform image3D) +0:14 'tid' ( in 3-component vector of uint) +0:14 'storeTemp' ( temp 4-component vector of float) +0:14 'storeTemp' ( temp 4-component vector of float) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp 3-component vector of uint) +0:? 'tid' ( temp 3-component vector of uint) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) +0:12 Function Call: @main(vu3; ( temp void) +0:? 'tid' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float uf4}) +0:? 'ResultInU' (layout( binding=0) uniform texture3D) +0:? 'ResultOutU' (layout( binding=0 rgba32f) uniform image3D) +0:? 'ResultInS' (layout( binding=1) uniform texture3D) +0:? 'ResultOutS' (layout( binding=1 rgba32f) uniform image3D) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (16, 16, 1) +0:? Sequence +0:12 Function Definition: @main(vu3; ( temp void) +0:12 Function Parameters: +0:12 'tid' ( in 3-component vector of uint) +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'storeTemp' ( temp 4-component vector of float) +0:13 add ( temp 4-component vector of float) +0:13 textureFetch ( temp 4-component vector of float) +0:13 'ResultInS' (layout( binding=1) uniform texture3D) +0:13 'tid' ( in 3-component vector of uint) +0:13 Constant: +0:13 0 (const int) +0:13 uf4: direct index for structure ( uniform 4-component vector of float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float uf4}) +0:13 Constant: +0:13 0 (const uint) +0:13 imageStore ( temp void) +0:13 'ResultOutS' (layout( binding=1 rgba32f) uniform image3D) +0:13 'tid' ( in 3-component vector of uint) +0:13 'storeTemp' ( temp 4-component vector of float) +0:13 'storeTemp' ( temp 4-component vector of float) +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 'storeTemp' ( temp 4-component vector of float) +0:14 textureFetch ( temp 4-component vector of float) +0:14 'ResultInU' (layout( binding=0) uniform texture3D) +0:14 'tid' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 imageStore ( temp void) +0:14 'ResultOutU' (layout( binding=0 rgba32f) uniform image3D) +0:14 'tid' ( in 3-component vector of uint) +0:14 'storeTemp' ( temp 4-component vector of float) +0:14 'storeTemp' ( temp 4-component vector of float) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp 3-component vector of uint) +0:? 'tid' ( temp 3-component vector of uint) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) +0:12 Function Call: @main(vu3; ( temp void) +0:? 'tid' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float uf4}) +0:? 'ResultInU' (layout( binding=0) uniform texture3D) +0:? 'ResultOutU' (layout( binding=0 rgba32f) uniform image3D) +0:? 'ResultInS' (layout( binding=1) uniform texture3D) +0:? 'ResultOutS' (layout( binding=1 rgba32f) uniform image3D) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 54 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 49 + ExecutionMode 4 LocalSize 16 16 1 + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vu3;" + Name 10 "tid" + Name 16 "storeTemp" + Name 19 "ResultInS" + Name 25 "$Global" + MemberName 25($Global) 0 "uf4" + Name 27 "" + Name 34 "ResultOutS" + Name 38 "storeTemp" + Name 39 "ResultInU" + Name 43 "ResultOutU" + Name 47 "tid" + Name 49 "tid" + Name 51 "param" + Decorate 19(ResultInS) DescriptorSet 0 + Decorate 19(ResultInS) Binding 1 + MemberDecorate 25($Global) 0 Offset 0 + Decorate 25($Global) Block + Decorate 27 DescriptorSet 0 + Decorate 34(ResultOutS) DescriptorSet 0 + Decorate 34(ResultOutS) Binding 1 + Decorate 39(ResultInU) DescriptorSet 0 + Decorate 39(ResultInU) Binding 0 + Decorate 43(ResultOutU) DescriptorSet 0 + Decorate 43(ResultOutU) Binding 0 + Decorate 49(tid) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 13: TypeFloat 32 + 14: TypeVector 13(float) 4 + 15: TypePointer Function 14(fvec4) + 17: TypeImage 13(float) 3D sampled format:Unknown + 18: TypePointer UniformConstant 17 + 19(ResultInS): 18(ptr) Variable UniformConstant + 22: TypeInt 32 1 + 23: 22(int) Constant 0 + 25($Global): TypeStruct 14(fvec4) + 26: TypePointer Uniform 25($Global) + 27: 26(ptr) Variable Uniform + 28: TypePointer Uniform 14(fvec4) + 32: TypeImage 13(float) 3D nonsampled format:Rgba32f + 33: TypePointer UniformConstant 32 + 34(ResultOutS): 33(ptr) Variable UniformConstant + 39(ResultInU): 18(ptr) Variable UniformConstant + 43(ResultOutU): 33(ptr) Variable UniformConstant + 48: TypePointer Input 7(ivec3) + 49(tid): 48(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 47(tid): 8(ptr) Variable Function + 51(param): 8(ptr) Variable Function + 50: 7(ivec3) Load 49(tid) + Store 47(tid) 50 + 52: 7(ivec3) Load 47(tid) + Store 51(param) 52 + 53: 2 FunctionCall 11(@main(vu3;) 51(param) + Return + FunctionEnd + 11(@main(vu3;): 2 Function None 9 + 10(tid): 8(ptr) FunctionParameter + 12: Label + 16(storeTemp): 15(ptr) Variable Function + 38(storeTemp): 15(ptr) Variable Function + 20: 17 Load 19(ResultInS) + 21: 7(ivec3) Load 10(tid) + 24: 14(fvec4) ImageFetch 20 21 Lod 23 + 29: 28(ptr) AccessChain 27 23 + 30: 14(fvec4) Load 29 + 31: 14(fvec4) FAdd 24 30 + Store 16(storeTemp) 31 + 35: 32 Load 34(ResultOutS) + 36: 7(ivec3) Load 10(tid) + 37: 14(fvec4) Load 16(storeTemp) + ImageWrite 35 36 37 + 40: 17 Load 39(ResultInU) + 41: 7(ivec3) Load 10(tid) + 42: 14(fvec4) ImageFetch 40 41 Lod 23 + Store 38(storeTemp) 42 + 44: 32 Load 43(ResultOutU) + 45: 7(ivec3) Load 10(tid) + 46: 14(fvec4) Load 38(storeTemp) + ImageWrite 44 45 46 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.staticMemberFunction.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.staticMemberFunction.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.staticMemberFunction.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.staticMemberFunction.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -118,7 +118,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 54 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,173 @@ +hlsl.store.rwbyteaddressbuffer.type.comp +Shader version: 500 +local_size = (64, 1, 1) +0:? Sequence +0:5 Function Definition: @main(vu3; ( temp void) +0:5 Function Parameters: +0:5 'dispatchThreadID' ( in 3-component vector of uint) +0:? Sequence +0:6 Test condition and select ( temp void) +0:6 Condition +0:6 Compare Equal ( temp bool) +0:6 direct index ( temp uint) +0:6 'dispatchThreadID' ( in 3-component vector of uint) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0 (const uint) +0:6 true case +0:? Sequence +0:7 move second child to first child ( temp int) +0:7 'byteAddrTemp' ( temp int) +0:7 right-shift ( temp int) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 2 (const int) +0:7 move second child to first child ( temp uint) +0:7 indirect index (layout( row_major std430) buffer uint) +0:7 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:7 'buffer' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:7 Constant: +0:7 0 (const uint) +0:7 'byteAddrTemp' ( temp int) +0:7 Constant: +0:7 2 (const uint) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 3-component vector of uint) +0:? 'dispatchThreadID' ( temp 3-component vector of uint) +0:? 'dispatchThreadID' ( in 3-component vector of uint GlobalInvocationID) +0:5 Function Call: @main(vu3; ( temp void) +0:? 'dispatchThreadID' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'buffer' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? 'dispatchThreadID' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (64, 1, 1) +0:? Sequence +0:5 Function Definition: @main(vu3; ( temp void) +0:5 Function Parameters: +0:5 'dispatchThreadID' ( in 3-component vector of uint) +0:? Sequence +0:6 Test condition and select ( temp void) +0:6 Condition +0:6 Compare Equal ( temp bool) +0:6 direct index ( temp uint) +0:6 'dispatchThreadID' ( in 3-component vector of uint) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0 (const uint) +0:6 true case +0:? Sequence +0:7 move second child to first child ( temp int) +0:7 'byteAddrTemp' ( temp int) +0:7 right-shift ( temp int) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 2 (const int) +0:7 move second child to first child ( temp uint) +0:7 indirect index (layout( row_major std430) buffer uint) +0:7 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:7 'buffer' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:7 Constant: +0:7 0 (const uint) +0:7 'byteAddrTemp' ( temp int) +0:7 Constant: +0:7 2 (const uint) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 3-component vector of uint) +0:? 'dispatchThreadID' ( temp 3-component vector of uint) +0:? 'dispatchThreadID' ( in 3-component vector of uint GlobalInvocationID) +0:5 Function Call: @main(vu3; ( temp void) +0:? 'dispatchThreadID' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'buffer' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? 'dispatchThreadID' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 42 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 37 + ExecutionMode 4 LocalSize 64 1 1 + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vu3;" + Name 10 "dispatchThreadID" + Name 23 "byteAddrTemp" + Name 28 "buffer" + MemberName 28(buffer) 0 "@data" + Name 30 "buffer" + Name 35 "dispatchThreadID" + Name 37 "dispatchThreadID" + Name 39 "param" + Decorate 27 ArrayStride 4 + MemberDecorate 28(buffer) 0 Offset 0 + Decorate 28(buffer) BufferBlock + Decorate 30(buffer) DescriptorSet 0 + Decorate 37(dispatchThreadID) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 13: 6(int) Constant 0 + 14: TypePointer Function 6(int) + 17: TypeBool + 21: TypeInt 32 1 + 22: TypePointer Function 21(int) + 24: 21(int) Constant 0 + 25: 21(int) Constant 2 + 27: TypeRuntimeArray 6(int) + 28(buffer): TypeStruct 27 + 29: TypePointer Uniform 28(buffer) + 30(buffer): 29(ptr) Variable Uniform + 32: 6(int) Constant 2 + 33: TypePointer Uniform 6(int) + 36: TypePointer Input 7(ivec3) +37(dispatchThreadID): 36(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label +35(dispatchThreadID): 8(ptr) Variable Function + 39(param): 8(ptr) Variable Function + 38: 7(ivec3) Load 37(dispatchThreadID) + Store 35(dispatchThreadID) 38 + 40: 7(ivec3) Load 35(dispatchThreadID) + Store 39(param) 40 + 41: 2 FunctionCall 11(@main(vu3;) 39(param) + Return + FunctionEnd + 11(@main(vu3;): 2 Function None 9 +10(dispatchThreadID): 8(ptr) FunctionParameter + 12: Label +23(byteAddrTemp): 22(ptr) Variable Function + 15: 14(ptr) AccessChain 10(dispatchThreadID) 13 + 16: 6(int) Load 15 + 18: 17(bool) IEqual 16 13 + SelectionMerge 20 None + BranchConditional 18 19 20 + 19: Label + 26: 21(int) ShiftRightArithmetic 24 25 + Store 23(byteAddrTemp) 26 + 31: 21(int) Load 23(byteAddrTemp) + 34: 33(ptr) AccessChain 30(buffer) 24 31 + Store 34 32 + Branch 20 + 20: Label + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.string.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.string.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.string.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.string.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -50,7 +50,7 @@ 0:? 'f' (layout( location=0) in float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 24 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.stringtoken.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.stringtoken.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.stringtoken.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.stringtoken.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -70,7 +70,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 34 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structarray.flatten.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structarray.flatten.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structarray.flatten.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structarray.flatten.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -156,7 +156,7 @@ 0:? 'ps_output.color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 80 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structarray.flatten.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structarray.flatten.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structarray.flatten.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structarray.flatten.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -170,7 +170,7 @@ 0:? 'outStream.uv' (layout( location=1) out 2-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 58 Capability Geometry diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.append.fn.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.append.fn.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.append.fn.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.append.fn.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -4,24 +4,24 @@ 0:? Sequence 0:8 Function Definition: Fn2(block--vf4[0]1;block--vf4[0]1; ( temp 4-component vector of float) 0:8 Function Parameters: -0:8 'arg_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) -0:8 'arg_a@count' ( buffer block{layout( row_major std430) buffer int @count}) -0:8 'arg_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) -0:8 'arg_c@count' ( buffer block{layout( row_major std430) buffer int @count}) +0:8 'arg_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:8 'arg_a@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:8 'arg_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:8 'arg_c@count' ( buffer block{layout( row_major std430) buffer uint @count}) 0:? Sequence 0:9 move second child to first child ( temp 4-component vector of float) 0:9 indirect index ( buffer 4-component vector of float) -0:9 @data: direct index for structure ( buffer implicitly-sized array of 4-component vector of float) -0:9 'arg_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:9 @data: direct index for structure ( buffer unsized 1-element array of 4-component vector of float) +0:9 'arg_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:9 Constant: 0:9 0 (const uint) 0:9 AtomicAdd ( temp uint) -0:9 @count: direct index for structure ( temp int) -0:9 'arg_a@count' ( buffer block{layout( row_major std430) buffer int @count}) +0:9 @count: direct index for structure ( temp uint) +0:9 'arg_a@count' ( buffer block{layout( row_major std430) buffer uint @count}) 0:9 Constant: 0:9 0 (const int) 0:9 Constant: -0:9 1 (const int) +0:9 1 (const uint) 0:? Constant: 0:? 1.000000 0:? 2.000000 @@ -29,18 +29,18 @@ 0:? 4.000000 0:10 Branch: Return with expression 0:10 indirect index ( buffer 4-component vector of float) -0:10 @data: direct index for structure ( buffer implicitly-sized array of 4-component vector of float) -0:10 'arg_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:10 @data: direct index for structure ( buffer unsized 1-element array of 4-component vector of float) +0:10 'arg_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 add ( temp uint) 0:10 AtomicAdd ( temp uint) -0:10 @count: direct index for structure ( temp int) -0:10 'arg_c@count' ( buffer block{layout( row_major std430) buffer int @count}) +0:10 @count: direct index for structure ( temp uint) +0:10 'arg_c@count' ( buffer block{layout( row_major std430) buffer uint @count}) 0:10 Constant: 0:10 0 (const int) 0:10 Constant: -0:10 -1 (const int) +0:10 4294967295 (const uint) 0:10 Constant: 0:10 -1 (const int) 0:19 Function Definition: @main(u1; ( temp 4-component vector of float) @@ -49,10 +49,10 @@ 0:? Sequence 0:22 Branch: Return with expression 0:22 Function Call: Fn2(block--vf4[0]1;block--vf4[0]1; ( temp 4-component vector of float) -0:22 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) -0:22 'sbuf_a@count' ( buffer block{layout( row_major std430) buffer int @count}) -0:22 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) -0:22 'sbuf_c@count' ( buffer block{layout( row_major std430) buffer int @count}) +0:22 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:22 'sbuf_a@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:22 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:22 'sbuf_c@count' ( buffer block{layout( row_major std430) buffer uint @count}) 0:19 Function Definition: main( ( temp void) 0:19 Function Parameters: 0:? Sequence @@ -64,11 +64,11 @@ 0:19 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) -0:? 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) -0:? 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) -0:? 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) -0:? 'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:? 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) @@ -81,24 +81,24 @@ 0:? Sequence 0:8 Function Definition: Fn2(block--vf4[0]1;block--vf4[0]1; ( temp 4-component vector of float) 0:8 Function Parameters: -0:8 'arg_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) -0:8 'arg_a@count' ( buffer block{layout( row_major std430) buffer int @count}) -0:8 'arg_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) -0:8 'arg_c@count' ( buffer block{layout( row_major std430) buffer int @count}) +0:8 'arg_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:8 'arg_a@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:8 'arg_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:8 'arg_c@count' ( buffer block{layout( row_major std430) buffer uint @count}) 0:? Sequence 0:9 move second child to first child ( temp 4-component vector of float) 0:9 indirect index ( buffer 4-component vector of float) -0:9 @data: direct index for structure ( buffer implicitly-sized array of 4-component vector of float) -0:9 'arg_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:9 @data: direct index for structure ( buffer unsized 1-element array of 4-component vector of float) +0:9 'arg_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:9 Constant: 0:9 0 (const uint) 0:9 AtomicAdd ( temp uint) -0:9 @count: direct index for structure ( temp int) -0:9 'arg_a@count' ( buffer block{layout( row_major std430) buffer int @count}) +0:9 @count: direct index for structure ( temp uint) +0:9 'arg_a@count' ( buffer block{layout( row_major std430) buffer uint @count}) 0:9 Constant: 0:9 0 (const int) 0:9 Constant: -0:9 1 (const int) +0:9 1 (const uint) 0:? Constant: 0:? 1.000000 0:? 2.000000 @@ -106,18 +106,18 @@ 0:? 4.000000 0:10 Branch: Return with expression 0:10 indirect index ( buffer 4-component vector of float) -0:10 @data: direct index for structure ( buffer implicitly-sized array of 4-component vector of float) -0:10 'arg_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:10 @data: direct index for structure ( buffer unsized 1-element array of 4-component vector of float) +0:10 'arg_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 add ( temp uint) 0:10 AtomicAdd ( temp uint) -0:10 @count: direct index for structure ( temp int) -0:10 'arg_c@count' ( buffer block{layout( row_major std430) buffer int @count}) +0:10 @count: direct index for structure ( temp uint) +0:10 'arg_c@count' ( buffer block{layout( row_major std430) buffer uint @count}) 0:10 Constant: 0:10 0 (const int) 0:10 Constant: -0:10 -1 (const int) +0:10 4294967295 (const uint) 0:10 Constant: 0:10 -1 (const int) 0:19 Function Definition: @main(u1; ( temp 4-component vector of float) @@ -126,10 +126,10 @@ 0:? Sequence 0:22 Branch: Return with expression 0:22 Function Call: Fn2(block--vf4[0]1;block--vf4[0]1; ( temp 4-component vector of float) -0:22 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) -0:22 'sbuf_a@count' ( buffer block{layout( row_major std430) buffer int @count}) -0:22 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) -0:22 'sbuf_c@count' ( buffer block{layout( row_major std430) buffer int @count}) +0:22 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:22 'sbuf_a@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:22 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:22 'sbuf_c@count' ( buffer block{layout( row_major std430) buffer uint @count}) 0:19 Function Definition: main( ( temp void) 0:19 Function Parameters: 0:? Sequence @@ -141,22 +141,22 @@ 0:19 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) -0:? 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) -0:? 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) -0:? 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) -0:? 'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:? 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 76 +// Generated by (magic number): 80006 +// Id's are bound by 70 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 64 67 + EntryPoint Fragment 4 "main" 58 61 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" @@ -169,92 +169,86 @@ Name 16 "arg_a@count" Name 17 "arg_c" Name 18 "arg_c@count" - Name 25 "@main(u1;" - Name 24 "pos" - Name 50 "sbuf_a" - Name 52 "sbuf_a@count" - Name 53 "sbuf_c" - Name 54 "sbuf_c@count" - Name 55 "param" - Name 56 "param" - Name 57 "param" - Name 58 "param" - Name 62 "pos" - Name 64 "pos" - Name 67 "@entryPointOutput" - Name 68 "param" - Name 71 "sbuf_a@count" - MemberName 71(sbuf_a@count) 0 "@count" - Name 73 "sbuf_a@count" - Name 74 "sbuf_c@count" - Name 75 "sbuf_unused" + Name 24 "@main(u1;" + Name 23 "pos" + Name 49 "sbuf_a" + Name 50 "sbuf_a@count" + Name 51 "sbuf_c" + Name 52 "sbuf_c@count" + Name 56 "pos" + Name 58 "pos" + Name 61 "@entryPointOutput" + Name 62 "param" + Name 65 "sbuf_a@count" + MemberName 65(sbuf_a@count) 0 "@count" + Name 67 "sbuf_a@count" + Name 68 "sbuf_c@count" + Name 69 "sbuf_unused" Decorate 8 ArrayStride 16 MemberDecorate 9 0 Offset 0 Decorate 9 BufferBlock Decorate 12 BufferBlock - Decorate 50(sbuf_a) DescriptorSet 0 - Decorate 52(sbuf_a@count) DescriptorSet 0 - Decorate 53(sbuf_c) DescriptorSet 0 - Decorate 54(sbuf_c@count) DescriptorSet 0 - Decorate 64(pos) Flat - Decorate 64(pos) Location 0 - Decorate 67(@entryPointOutput) Location 0 - MemberDecorate 71(sbuf_a@count) 0 Offset 0 - Decorate 71(sbuf_a@count) BufferBlock - Decorate 73(sbuf_a@count) DescriptorSet 0 - Decorate 74(sbuf_c@count) DescriptorSet 0 - Decorate 75(sbuf_unused) DescriptorSet 0 + Decorate 49(sbuf_a) DescriptorSet 0 + Decorate 50(sbuf_a@count) DescriptorSet 0 + Decorate 51(sbuf_c) DescriptorSet 0 + Decorate 52(sbuf_c@count) DescriptorSet 0 + Decorate 58(pos) Flat + Decorate 58(pos) Location 0 + Decorate 61(@entryPointOutput) Location 0 + MemberDecorate 65(sbuf_a@count) 0 Offset 0 + Decorate 65(sbuf_a@count) BufferBlock + Decorate 67(sbuf_a@count) DescriptorSet 0 + Decorate 68(sbuf_c@count) DescriptorSet 0 + Decorate 69(sbuf_unused) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 7: TypeVector 6(float) 4 8: TypeRuntimeArray 7(fvec4) 9: TypeStruct 8 - 10: TypePointer Function 9(struct) - 11: TypeInt 32 1 + 10: TypePointer Uniform 9(struct) + 11: TypeInt 32 0 12: TypeStruct 11(int) - 13: TypePointer Function 12(struct) + 13: TypePointer Uniform 12(struct) 14: TypeFunction 7(fvec4) 10(ptr) 13(ptr) 10(ptr) 13(ptr) - 21: TypeInt 32 0 - 22: TypePointer Function 21(int) - 23: TypeFunction 7(fvec4) 22(ptr) - 27: 11(int) Constant 0 - 28: TypePointer Function 11(int) + 21: TypePointer Function 11(int) + 22: TypeFunction 7(fvec4) 21(ptr) + 26: TypeInt 32 1 + 27: 26(int) Constant 0 + 28: TypePointer Uniform 11(int) 30: 11(int) Constant 1 - 31: 21(int) Constant 1 - 32: 21(int) Constant 0 - 34: 6(float) Constant 1065353216 - 35: 6(float) Constant 1073741824 - 36: 6(float) Constant 1077936128 - 37: 6(float) Constant 1082130432 - 38: 7(fvec4) ConstantComposite 34 35 36 37 - 39: TypePointer Function 7(fvec4) - 42: 11(int) Constant 4294967295 - 49: TypePointer Uniform 9(struct) - 50(sbuf_a): 49(ptr) Variable Uniform - 51: TypePointer Uniform 12(struct) -52(sbuf_a@count): 51(ptr) Variable Uniform - 53(sbuf_c): 49(ptr) Variable Uniform -54(sbuf_c@count): 51(ptr) Variable Uniform - 63: TypePointer Input 21(int) - 64(pos): 63(ptr) Variable Input - 66: TypePointer Output 7(fvec4) -67(@entryPointOutput): 66(ptr) Variable Output -71(sbuf_a@count): TypeStruct 11(int) - 72: TypePointer Uniform 71(sbuf_a@count) -73(sbuf_a@count): 72(ptr) Variable Uniform -74(sbuf_c@count): 72(ptr) Variable Uniform - 75(sbuf_unused): 49(ptr) Variable Uniform + 31: 11(int) Constant 0 + 33: 6(float) Constant 1065353216 + 34: 6(float) Constant 1073741824 + 35: 6(float) Constant 1077936128 + 36: 6(float) Constant 1082130432 + 37: 7(fvec4) ConstantComposite 33 34 35 36 + 38: TypePointer Uniform 7(fvec4) + 41: 11(int) Constant 4294967295 + 43: 26(int) Constant 4294967295 + 49(sbuf_a): 10(ptr) Variable Uniform +50(sbuf_a@count): 13(ptr) Variable Uniform + 51(sbuf_c): 10(ptr) Variable Uniform +52(sbuf_c@count): 13(ptr) Variable Uniform + 57: TypePointer Input 11(int) + 58(pos): 57(ptr) Variable Input + 60: TypePointer Output 7(fvec4) +61(@entryPointOutput): 60(ptr) Variable Output +65(sbuf_a@count): TypeStruct 11(int) + 66: TypePointer Uniform 65(sbuf_a@count) +67(sbuf_a@count): 66(ptr) Variable Uniform +68(sbuf_c@count): 66(ptr) Variable Uniform + 69(sbuf_unused): 10(ptr) Variable Uniform 4(main): 2 Function None 3 5: Label - 62(pos): 22(ptr) Variable Function - 68(param): 22(ptr) Variable Function - 65: 21(int) Load 64(pos) - Store 62(pos) 65 - 69: 21(int) Load 62(pos) - Store 68(param) 69 - 70: 7(fvec4) FunctionCall 25(@main(u1;) 68(param) - Store 67(@entryPointOutput) 70 + 56(pos): 21(ptr) Variable Function + 62(param): 21(ptr) Variable Function + 59: 11(int) Load 58(pos) + Store 56(pos) 59 + 63: 11(int) Load 56(pos) + Store 62(param) 63 + 64: 7(fvec4) FunctionCall 24(@main(u1;) 62(param) + Store 61(@entryPointOutput) 64 Return FunctionEnd 19(Fn2(block--vf4[0]1;block--vf4[0]1;): 7(fvec4) Function None 14 @@ -264,23 +258,19 @@ 18(arg_c@count): 13(ptr) FunctionParameter 20: Label 29: 28(ptr) AccessChain 16(arg_a@count) 27 - 33: 21(int) AtomicIAdd 29 31 32 30 - 40: 39(ptr) AccessChain 15(arg_a) 27 33 - Store 40 38 - 41: 28(ptr) AccessChain 18(arg_c@count) 27 - 43: 21(int) AtomicIAdd 41 31 32 42 - 44: 21(int) IAdd 43 42 - 45: 39(ptr) AccessChain 17(arg_c) 27 44 + 32: 11(int) AtomicIAdd 29 30 31 30 + 39: 38(ptr) AccessChain 15(arg_a) 27 32 + Store 39 37 + 40: 28(ptr) AccessChain 18(arg_c@count) 27 + 42: 11(int) AtomicIAdd 40 30 31 41 + 44: 11(int) IAdd 42 43 + 45: 38(ptr) AccessChain 17(arg_c) 27 44 46: 7(fvec4) Load 45 ReturnValue 46 FunctionEnd - 25(@main(u1;): 7(fvec4) Function None 23 - 24(pos): 22(ptr) FunctionParameter - 26: Label - 55(param): 10(ptr) Variable Function - 56(param): 13(ptr) Variable Function - 57(param): 10(ptr) Variable Function - 58(param): 13(ptr) Variable Function - 59: 7(fvec4) FunctionCall 19(Fn2(block--vf4[0]1;block--vf4[0]1;) 55(param) 56(param) 57(param) 58(param) - ReturnValue 59 + 24(@main(u1;): 7(fvec4) Function None 22 + 23(pos): 21(ptr) FunctionParameter + 25: Label + 53: 7(fvec4) FunctionCall 19(Fn2(block--vf4[0]1;block--vf4[0]1;) 49(sbuf_a) 50(sbuf_a@count) 51(sbuf_c) 52(sbuf_c@count) + ReturnValue 53 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -8,17 +8,17 @@ 0:? Sequence 0:8 move second child to first child ( temp 4-component vector of float) 0:8 indirect index (layout( row_major std430) buffer 4-component vector of float) -0:8 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float) -0:8 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:8 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:8 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:8 Constant: 0:8 0 (const uint) 0:8 AtomicAdd ( temp uint) -0:8 @count: direct index for structure ( temp int) -0:8 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) +0:8 @count: direct index for structure ( temp uint) +0:8 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) 0:8 Constant: 0:8 0 (const int) 0:8 Constant: -0:8 1 (const int) +0:8 1 (const uint) 0:? Constant: 0:? 1.000000 0:? 2.000000 @@ -26,18 +26,18 @@ 0:? 4.000000 0:10 Branch: Return with expression 0:10 indirect index (layout( row_major std430) buffer 4-component vector of float) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float) -0:10 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:10 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 add ( temp uint) 0:10 AtomicAdd ( temp uint) -0:10 @count: direct index for structure ( temp int) -0:10 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) +0:10 @count: direct index for structure ( temp uint) +0:10 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) 0:10 Constant: 0:10 0 (const int) 0:10 Constant: -0:10 -1 (const int) +0:10 4294967295 (const uint) 0:10 Constant: 0:10 -1 (const int) 0:7 Function Definition: main( ( temp void) @@ -51,11 +51,11 @@ 0:7 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) -0:? 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) -0:? 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) -0:? 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) -0:? 'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:? 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) @@ -72,17 +72,17 @@ 0:? Sequence 0:8 move second child to first child ( temp 4-component vector of float) 0:8 indirect index (layout( row_major std430) buffer 4-component vector of float) -0:8 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float) -0:8 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:8 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:8 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:8 Constant: 0:8 0 (const uint) 0:8 AtomicAdd ( temp uint) -0:8 @count: direct index for structure ( temp int) -0:8 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) +0:8 @count: direct index for structure ( temp uint) +0:8 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) 0:8 Constant: 0:8 0 (const int) 0:8 Constant: -0:8 1 (const int) +0:8 1 (const uint) 0:? Constant: 0:? 1.000000 0:? 2.000000 @@ -90,18 +90,18 @@ 0:? 4.000000 0:10 Branch: Return with expression 0:10 indirect index (layout( row_major std430) buffer 4-component vector of float) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float) -0:10 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:10 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 add ( temp uint) 0:10 AtomicAdd ( temp uint) -0:10 @count: direct index for structure ( temp int) -0:10 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) +0:10 @count: direct index for structure ( temp uint) +0:10 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) 0:10 Constant: 0:10 0 (const int) 0:10 Constant: -0:10 -1 (const int) +0:10 4294967295 (const uint) 0:10 Constant: 0:10 -1 (const int) 0:7 Function Definition: main( ( temp void) @@ -115,16 +115,16 @@ 0:7 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) -0:? 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) -0:? 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) -0:? 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) -0:? 'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:? 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 56 Capability Shader @@ -142,8 +142,8 @@ Name 20 "sbuf_a@count" MemberName 20(sbuf_a@count) 0 "@count" Name 22 "sbuf_a@count" - Name 36 "sbuf_c" - Name 37 "sbuf_c@count" + Name 35 "sbuf_c" + Name 36 "sbuf_c@count" Name 46 "pos" Name 48 "pos" Name 51 "@entryPointOutput" @@ -156,8 +156,8 @@ MemberDecorate 20(sbuf_a@count) 0 Offset 0 Decorate 20(sbuf_a@count) BufferBlock Decorate 22(sbuf_a@count) DescriptorSet 0 - Decorate 36(sbuf_c) DescriptorSet 0 - Decorate 37(sbuf_c@count) DescriptorSet 0 + Decorate 35(sbuf_c) DescriptorSet 0 + Decorate 36(sbuf_c@count) DescriptorSet 0 Decorate 48(pos) Flat Decorate 48(pos) Location 0 Decorate 51(@entryPointOutput) Location 0 @@ -175,22 +175,22 @@ 17(sbuf_a): 16(ptr) Variable Uniform 18: TypeInt 32 1 19: 18(int) Constant 0 -20(sbuf_a@count): TypeStruct 18(int) +20(sbuf_a@count): TypeStruct 6(int) 21: TypePointer Uniform 20(sbuf_a@count) 22(sbuf_a@count): 21(ptr) Variable Uniform - 23: TypePointer Uniform 18(int) - 25: 18(int) Constant 1 - 26: 6(int) Constant 1 - 27: 6(int) Constant 0 - 29: 8(float) Constant 1065353216 - 30: 8(float) Constant 1073741824 - 31: 8(float) Constant 1077936128 - 32: 8(float) Constant 1082130432 - 33: 9(fvec4) ConstantComposite 29 30 31 32 - 34: TypePointer Uniform 9(fvec4) - 36(sbuf_c): 16(ptr) Variable Uniform -37(sbuf_c@count): 21(ptr) Variable Uniform - 39: 18(int) Constant 4294967295 + 23: TypePointer Uniform 6(int) + 25: 6(int) Constant 1 + 26: 6(int) Constant 0 + 28: 8(float) Constant 1065353216 + 29: 8(float) Constant 1073741824 + 30: 8(float) Constant 1077936128 + 31: 8(float) Constant 1082130432 + 32: 9(fvec4) ConstantComposite 28 29 30 31 + 33: TypePointer Uniform 9(fvec4) + 35(sbuf_c): 16(ptr) Variable Uniform +36(sbuf_c@count): 21(ptr) Variable Uniform + 38: 6(int) Constant 4294967295 + 40: 18(int) Constant 4294967295 47: TypePointer Input 6(int) 48(pos): 47(ptr) Variable Input 50: TypePointer Output 9(fvec4) @@ -212,13 +212,13 @@ 11(pos): 7(ptr) FunctionParameter 13: Label 24: 23(ptr) AccessChain 22(sbuf_a@count) 19 - 28: 6(int) AtomicIAdd 24 26 27 25 - 35: 34(ptr) AccessChain 17(sbuf_a) 19 28 - Store 35 33 - 38: 23(ptr) AccessChain 37(sbuf_c@count) 19 - 40: 6(int) AtomicIAdd 38 26 27 39 - 41: 6(int) IAdd 40 39 - 42: 34(ptr) AccessChain 36(sbuf_c) 19 41 + 27: 6(int) AtomicIAdd 24 25 26 25 + 34: 33(ptr) AccessChain 17(sbuf_a) 19 27 + Store 34 32 + 37: 23(ptr) AccessChain 36(sbuf_c@count) 19 + 39: 6(int) AtomicIAdd 37 25 26 38 + 41: 6(int) IAdd 39 40 + 42: 33(ptr) AccessChain 35(sbuf_c) 19 41 43: 9(fvec4) Load 42 ReturnValue 43 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -6,10 +6,10 @@ 0:5 Function Parameters: 0:5 'pos' ( in uint) 0:? Sequence -0:8 AtomicAdd ( temp void) +0:8 AtomicAdd ( temp uint) 0:8 indirect index (layout( row_major std430) buffer uint) -0:8 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:8 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:8 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:8 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:8 Constant: 0:8 0 (const uint) 0:8 right-shift ( temp int) @@ -23,8 +23,8 @@ 0:9 'u' ( temp uint) 0:9 AtomicAdd ( temp uint) 0:9 indirect index (layout( row_major std430) buffer uint) -0:9 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:9 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:9 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:9 Constant: 0:9 0 (const uint) 0:9 right-shift ( temp int) @@ -34,10 +34,10 @@ 0:9 2 (const int) 0:9 Constant: 0:9 1 (const int) -0:10 AtomicAnd ( temp void) +0:10 AtomicAnd ( temp uint) 0:10 indirect index (layout( row_major std430) buffer uint) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 right-shift ( temp int) @@ -51,8 +51,8 @@ 0:11 'u' ( temp uint) 0:11 AtomicAnd ( temp uint) 0:11 indirect index (layout( row_major std430) buffer uint) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 right-shift ( temp int) @@ -67,8 +67,8 @@ 0:12 Convert int to uint ( temp uint) 0:12 AtomicCompSwap ( temp int) 0:12 indirect index (layout( row_major std430) buffer uint) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 right-shift ( temp int) @@ -84,8 +84,8 @@ 0:14 'u' ( temp uint) 0:14 AtomicExchange ( temp uint) 0:14 indirect index (layout( row_major std430) buffer uint) -0:14 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:14 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:14 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:14 Constant: 0:14 0 (const uint) 0:14 right-shift ( temp int) @@ -95,10 +95,10 @@ 0:14 2 (const int) 0:14 Constant: 0:14 1 (const int) -0:15 AtomicMax ( temp void) +0:15 AtomicMax ( temp uint) 0:15 indirect index (layout( row_major std430) buffer uint) -0:15 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:15 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:15 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:15 Constant: 0:15 0 (const uint) 0:15 right-shift ( temp int) @@ -112,8 +112,8 @@ 0:16 'u' ( temp uint) 0:16 AtomicMax ( temp uint) 0:16 indirect index (layout( row_major std430) buffer uint) -0:16 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:16 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:16 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:16 Constant: 0:16 0 (const uint) 0:16 right-shift ( temp int) @@ -123,10 +123,10 @@ 0:16 2 (const int) 0:16 Constant: 0:16 1 (const int) -0:17 AtomicMin ( temp void) +0:17 AtomicMin ( temp uint) 0:17 indirect index (layout( row_major std430) buffer uint) -0:17 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:17 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:17 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:17 Constant: 0:17 0 (const uint) 0:17 right-shift ( temp int) @@ -140,8 +140,8 @@ 0:18 'u' ( temp uint) 0:18 AtomicMin ( temp uint) 0:18 indirect index (layout( row_major std430) buffer uint) -0:18 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:18 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:18 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:18 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:18 Constant: 0:18 0 (const uint) 0:18 right-shift ( temp int) @@ -151,10 +151,10 @@ 0:18 2 (const int) 0:18 Constant: 0:18 1 (const int) -0:19 AtomicOr ( temp void) +0:19 AtomicOr ( temp uint) 0:19 indirect index (layout( row_major std430) buffer uint) -0:19 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:19 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:19 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:19 Constant: 0:19 0 (const uint) 0:19 right-shift ( temp int) @@ -168,8 +168,8 @@ 0:20 'u' ( temp uint) 0:20 AtomicOr ( temp uint) 0:20 indirect index (layout( row_major std430) buffer uint) -0:20 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:20 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:20 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:20 Constant: 0:20 0 (const uint) 0:20 right-shift ( temp int) @@ -179,10 +179,10 @@ 0:20 2 (const int) 0:20 Constant: 0:20 1 (const int) -0:21 AtomicXor ( temp void) +0:21 AtomicXor ( temp uint) 0:21 indirect index (layout( row_major std430) buffer uint) -0:21 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:21 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:21 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:21 Constant: 0:21 0 (const uint) 0:21 right-shift ( temp int) @@ -196,8 +196,8 @@ 0:22 'u' ( temp uint) 0:22 AtomicXor ( temp uint) 0:22 indirect index (layout( row_major std430) buffer uint) -0:22 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:22 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:22 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:22 Constant: 0:22 0 (const uint) 0:22 right-shift ( temp int) @@ -211,8 +211,8 @@ 0:24 Construct vec4 ( temp 4-component vector of float) 0:24 Convert uint to float ( temp float) 0:24 indirect index (layout( row_major std430) buffer uint) -0:24 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:24 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:24 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:24 Constant: 0:24 0 (const uint) 0:24 right-shift ( temp int) @@ -230,7 +230,7 @@ 0:5 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:? 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) @@ -245,10 +245,10 @@ 0:5 Function Parameters: 0:5 'pos' ( in uint) 0:? Sequence -0:8 AtomicAdd ( temp void) +0:8 AtomicAdd ( temp uint) 0:8 indirect index (layout( row_major std430) buffer uint) -0:8 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:8 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:8 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:8 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:8 Constant: 0:8 0 (const uint) 0:8 right-shift ( temp int) @@ -262,8 +262,8 @@ 0:9 'u' ( temp uint) 0:9 AtomicAdd ( temp uint) 0:9 indirect index (layout( row_major std430) buffer uint) -0:9 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:9 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:9 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:9 Constant: 0:9 0 (const uint) 0:9 right-shift ( temp int) @@ -273,10 +273,10 @@ 0:9 2 (const int) 0:9 Constant: 0:9 1 (const int) -0:10 AtomicAnd ( temp void) +0:10 AtomicAnd ( temp uint) 0:10 indirect index (layout( row_major std430) buffer uint) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 right-shift ( temp int) @@ -290,8 +290,8 @@ 0:11 'u' ( temp uint) 0:11 AtomicAnd ( temp uint) 0:11 indirect index (layout( row_major std430) buffer uint) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 right-shift ( temp int) @@ -306,8 +306,8 @@ 0:12 Convert int to uint ( temp uint) 0:12 AtomicCompSwap ( temp int) 0:12 indirect index (layout( row_major std430) buffer uint) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 right-shift ( temp int) @@ -323,8 +323,8 @@ 0:14 'u' ( temp uint) 0:14 AtomicExchange ( temp uint) 0:14 indirect index (layout( row_major std430) buffer uint) -0:14 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:14 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:14 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:14 Constant: 0:14 0 (const uint) 0:14 right-shift ( temp int) @@ -334,10 +334,10 @@ 0:14 2 (const int) 0:14 Constant: 0:14 1 (const int) -0:15 AtomicMax ( temp void) +0:15 AtomicMax ( temp uint) 0:15 indirect index (layout( row_major std430) buffer uint) -0:15 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:15 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:15 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:15 Constant: 0:15 0 (const uint) 0:15 right-shift ( temp int) @@ -351,8 +351,8 @@ 0:16 'u' ( temp uint) 0:16 AtomicMax ( temp uint) 0:16 indirect index (layout( row_major std430) buffer uint) -0:16 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:16 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:16 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:16 Constant: 0:16 0 (const uint) 0:16 right-shift ( temp int) @@ -362,10 +362,10 @@ 0:16 2 (const int) 0:16 Constant: 0:16 1 (const int) -0:17 AtomicMin ( temp void) +0:17 AtomicMin ( temp uint) 0:17 indirect index (layout( row_major std430) buffer uint) -0:17 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:17 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:17 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:17 Constant: 0:17 0 (const uint) 0:17 right-shift ( temp int) @@ -379,8 +379,8 @@ 0:18 'u' ( temp uint) 0:18 AtomicMin ( temp uint) 0:18 indirect index (layout( row_major std430) buffer uint) -0:18 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:18 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:18 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:18 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:18 Constant: 0:18 0 (const uint) 0:18 right-shift ( temp int) @@ -390,10 +390,10 @@ 0:18 2 (const int) 0:18 Constant: 0:18 1 (const int) -0:19 AtomicOr ( temp void) +0:19 AtomicOr ( temp uint) 0:19 indirect index (layout( row_major std430) buffer uint) -0:19 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:19 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:19 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:19 Constant: 0:19 0 (const uint) 0:19 right-shift ( temp int) @@ -407,8 +407,8 @@ 0:20 'u' ( temp uint) 0:20 AtomicOr ( temp uint) 0:20 indirect index (layout( row_major std430) buffer uint) -0:20 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:20 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:20 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:20 Constant: 0:20 0 (const uint) 0:20 right-shift ( temp int) @@ -418,10 +418,10 @@ 0:20 2 (const int) 0:20 Constant: 0:20 1 (const int) -0:21 AtomicXor ( temp void) +0:21 AtomicXor ( temp uint) 0:21 indirect index (layout( row_major std430) buffer uint) -0:21 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:21 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:21 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:21 Constant: 0:21 0 (const uint) 0:21 right-shift ( temp int) @@ -435,8 +435,8 @@ 0:22 'u' ( temp uint) 0:22 AtomicXor ( temp uint) 0:22 indirect index (layout( row_major std430) buffer uint) -0:22 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:22 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:22 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:22 Constant: 0:22 0 (const uint) 0:22 right-shift ( temp int) @@ -450,8 +450,8 @@ 0:24 Construct vec4 ( temp 4-component vector of float) 0:24 Convert uint to float ( temp float) 0:24 indirect index (layout( row_major std430) buffer uint) -0:24 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:24 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:24 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:24 Constant: 0:24 0 (const uint) 0:24 right-shift ( temp int) @@ -469,12 +469,12 @@ 0:5 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:? 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 87 Capability Shader @@ -542,14 +542,14 @@ 29(u): 7(ptr) Variable Function 22: 18(int) ShiftRightArithmetic 20 21 24: 23(ptr) AccessChain 17(sbuf) 19 22 - 28: 2 AtomicIAdd 24 26 27 25 + 28: 6(int) AtomicIAdd 24 26 27 25 30: 18(int) ShiftRightArithmetic 20 21 31: 23(ptr) AccessChain 17(sbuf) 19 30 32: 6(int) AtomicIAdd 31 26 27 25 Store 29(u) 32 33: 18(int) ShiftRightArithmetic 20 21 34: 23(ptr) AccessChain 17(sbuf) 19 33 - 35: 2 AtomicAnd 34 26 27 25 + 35: 6(int) AtomicAnd 34 26 27 25 36: 18(int) ShiftRightArithmetic 20 21 37: 23(ptr) AccessChain 17(sbuf) 19 36 38: 6(int) AtomicAnd 37 26 27 25 @@ -565,28 +565,28 @@ Store 29(u) 45 46: 18(int) ShiftRightArithmetic 20 21 47: 23(ptr) AccessChain 17(sbuf) 19 46 - 48: 2 AtomicSMax 47 26 27 25 + 48: 6(int) AtomicUMax 47 26 27 25 49: 18(int) ShiftRightArithmetic 20 21 50: 23(ptr) AccessChain 17(sbuf) 19 49 51: 6(int) AtomicUMax 50 26 27 25 Store 29(u) 51 52: 18(int) ShiftRightArithmetic 20 21 53: 23(ptr) AccessChain 17(sbuf) 19 52 - 54: 2 AtomicSMin 53 26 27 25 + 54: 6(int) AtomicUMin 53 26 27 25 55: 18(int) ShiftRightArithmetic 20 21 56: 23(ptr) AccessChain 17(sbuf) 19 55 57: 6(int) AtomicUMin 56 26 27 25 Store 29(u) 57 58: 18(int) ShiftRightArithmetic 20 21 59: 23(ptr) AccessChain 17(sbuf) 19 58 - 60: 2 AtomicOr 59 26 27 25 + 60: 6(int) AtomicOr 59 26 27 25 61: 18(int) ShiftRightArithmetic 20 21 62: 23(ptr) AccessChain 17(sbuf) 19 61 63: 6(int) AtomicOr 62 26 27 25 Store 29(u) 63 64: 18(int) ShiftRightArithmetic 20 21 65: 23(ptr) AccessChain 17(sbuf) 19 64 - 66: 2 AtomicXor 65 26 27 25 + 66: 6(int) AtomicXor 65 26 27 25 67: 18(int) ShiftRightArithmetic 20 21 68: 23(ptr) AccessChain 17(sbuf) 19 67 69: 6(int) AtomicXor 68 26 27 25 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -10,8 +10,8 @@ 0:7 move second child to first child ( temp uint) 0:7 'size' ( temp uint) 0:7 array length ( temp uint) -0:7 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:7 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:7 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:7 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:7 Constant: 0:7 0 (const uint) 0:12 Branch: Return with expression @@ -20,8 +20,8 @@ 0:9 add ( temp 4-component vector of float) 0:9 Convert uint to float ( temp float) 0:9 indirect index (layout( row_major std430) buffer uint) -0:9 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:9 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:9 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:9 Constant: 0:9 0 (const uint) 0:9 right-shift ( temp int) @@ -41,15 +41,15 @@ 0:10 Constant: 0:10 2 (const int) 0:? Construct vec2 ( temp 2-component vector of uint) -0:10 indirect index ( temp float) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:10 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 'byteAddrTemp' ( temp int) -0:10 indirect index ( temp float) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:10 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 add ( temp int) @@ -73,24 +73,24 @@ 0:11 Constant: 0:11 2 (const int) 0:? Construct vec3 ( temp 3-component vector of uint) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 'byteAddrTemp' ( temp int) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) 0:11 'byteAddrTemp' ( temp int) 0:11 Constant: 0:11 1 (const int) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) @@ -111,33 +111,33 @@ 0:12 Constant: 0:12 2 (const int) 0:? Construct vec4 ( temp 4-component vector of uint) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 'byteAddrTemp' ( temp int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 1 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 2 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) @@ -155,7 +155,7 @@ 0:5 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:? 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) @@ -174,8 +174,8 @@ 0:7 move second child to first child ( temp uint) 0:7 'size' ( temp uint) 0:7 array length ( temp uint) -0:7 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:7 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:7 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:7 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:7 Constant: 0:7 0 (const uint) 0:12 Branch: Return with expression @@ -184,8 +184,8 @@ 0:9 add ( temp 4-component vector of float) 0:9 Convert uint to float ( temp float) 0:9 indirect index (layout( row_major std430) buffer uint) -0:9 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:9 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:9 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:9 Constant: 0:9 0 (const uint) 0:9 right-shift ( temp int) @@ -205,15 +205,15 @@ 0:10 Constant: 0:10 2 (const int) 0:? Construct vec2 ( temp 2-component vector of uint) -0:10 indirect index ( temp float) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:10 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 'byteAddrTemp' ( temp int) -0:10 indirect index ( temp float) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:10 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 add ( temp int) @@ -237,24 +237,24 @@ 0:11 Constant: 0:11 2 (const int) 0:? Construct vec3 ( temp 3-component vector of uint) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 'byteAddrTemp' ( temp int) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) 0:11 'byteAddrTemp' ( temp int) 0:11 Constant: 0:11 1 (const int) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) @@ -275,33 +275,33 @@ 0:12 Constant: 0:12 2 (const int) 0:? Construct vec4 ( temp 4-component vector of uint) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 'byteAddrTemp' ( temp int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 1 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 2 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) @@ -319,12 +319,12 @@ 0:5 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:? 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 114 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -8,8 +8,8 @@ 0:? Sequence 0:13 move second child to first child ( temp float) 0:13 indirect index (layout( row_major std430) buffer float) -0:13 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of float) -0:13 'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:13 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:13 'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:13 Constant: 0:13 0 (const uint) 0:13 add ( temp uint) @@ -22,8 +22,8 @@ 0:17 move second child to first child ( temp uint) 0:17 'size' ( temp uint) 0:17 array length ( temp uint) -0:17 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test}) -0:17 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:17 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) 0:17 Constant: 0:17 0 (const uint) 0:17 move second child to first child ( temp uint) @@ -34,8 +34,8 @@ 0:19 Condition 0:19 test: direct index for structure ( temp bool) 0:19 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test}) -0:19 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test}) -0:19 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:19 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) 0:19 Constant: 0:19 0 (const uint) 0:19 'pos' ( in uint) @@ -47,16 +47,16 @@ 0:20 add ( temp 3-component vector of float) 0:20 color: direct index for structure ( temp 3-component vector of float) 0:20 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test}) -0:20 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test}) -0:20 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:20 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) 0:20 Constant: 0:20 0 (const uint) 0:20 'pos' ( in uint) 0:20 Constant: 0:20 0 (const int) 0:20 indirect index (layout( row_major std430) buffer float) -0:20 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of float) -0:20 'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:20 'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:20 Constant: 0:20 0 (const uint) 0:20 'pos' ( in uint) @@ -80,8 +80,8 @@ 0:12 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test} @data}) -0:? 'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:? 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:? 'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) @@ -98,8 +98,8 @@ 0:? Sequence 0:13 move second child to first child ( temp float) 0:13 indirect index (layout( row_major std430) buffer float) -0:13 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of float) -0:13 'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:13 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:13 'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:13 Constant: 0:13 0 (const uint) 0:13 add ( temp uint) @@ -112,8 +112,8 @@ 0:17 move second child to first child ( temp uint) 0:17 'size' ( temp uint) 0:17 array length ( temp uint) -0:17 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test}) -0:17 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:17 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) 0:17 Constant: 0:17 0 (const uint) 0:17 move second child to first child ( temp uint) @@ -124,8 +124,8 @@ 0:19 Condition 0:19 test: direct index for structure ( temp bool) 0:19 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test}) -0:19 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test}) -0:19 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:19 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) 0:19 Constant: 0:19 0 (const uint) 0:19 'pos' ( in uint) @@ -137,16 +137,16 @@ 0:20 add ( temp 3-component vector of float) 0:20 color: direct index for structure ( temp 3-component vector of float) 0:20 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test}) -0:20 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test}) -0:20 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:20 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) 0:20 Constant: 0:20 0 (const uint) 0:20 'pos' ( in uint) 0:20 Constant: 0:20 0 (const int) 0:20 indirect index (layout( row_major std430) buffer float) -0:20 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of float) -0:20 'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:20 'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:20 Constant: 0:20 0 (const uint) 0:20 'pos' ( in uint) @@ -170,13 +170,13 @@ 0:12 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test} @data}) -0:? 'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:? 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:? 'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 78 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -10,18 +10,18 @@ 0:14 move second child to first child ( temp structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) 0:14 'data' ( temp structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) 0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) -0:14 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) -0:14 'csb' (layout( binding=1 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId} @data}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) +0:14 'csb' (layout( binding=1 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId} @data}) 0:14 Constant: 0:14 0 (const uint) 0:14 add ( temp uint) 0:14 AtomicAdd ( temp uint) -0:14 @count: direct index for structure ( temp int) -0:14 'csb@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) +0:14 @count: direct index for structure ( temp uint) +0:14 'csb@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) 0:14 Constant: 0:14 0 (const int) 0:14 Constant: -0:14 -1 (const int) +0:14 4294967295 (const uint) 0:14 Constant: 0:14 -1 (const int) 0:15 Sequence @@ -53,8 +53,8 @@ 0:16 'storeTemp' ( temp 4-component vector of float) 0:18 move second child to first child ( temp 4-component vector of float) 0:18 indirect index (layout( row_major std430) buffer 4-component vector of float) -0:18 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float) -0:18 'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:18 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:18 'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:18 Constant: 0:18 0 (const uint) 0:18 Convert float to uint ( temp uint) @@ -63,8 +63,8 @@ 0:18 Constant: 0:18 0 (const int) 0:18 indirect index (layout( row_major std430) buffer 4-component vector of float) -0:18 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float) -0:18 'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:18 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:18 'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:18 Constant: 0:18 0 (const uint) 0:18 Convert float to uint ( temp uint) @@ -82,9 +82,9 @@ 0:? 'nThreadId' ( temp 3-component vector of uint) 0:? Linker Objects 0:? 'outtx' (layout( rgba32f) uniform image2D) -0:? 'csb' (layout( binding=1 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId} @data}) -0:? 'csb@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) -0:? 'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:? 'csb' (layout( binding=1 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId} @data}) +0:? 'csb@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:? 'nThreadId' ( in 3-component vector of uint GlobalInvocationID) @@ -102,18 +102,18 @@ 0:14 move second child to first child ( temp structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) 0:14 'data' ( temp structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) 0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) -0:14 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) -0:14 'csb' (layout( binding=1 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId} @data}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) +0:14 'csb' (layout( binding=1 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId} @data}) 0:14 Constant: 0:14 0 (const uint) 0:14 add ( temp uint) 0:14 AtomicAdd ( temp uint) -0:14 @count: direct index for structure ( temp int) -0:14 'csb@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) +0:14 @count: direct index for structure ( temp uint) +0:14 'csb@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) 0:14 Constant: 0:14 0 (const int) 0:14 Constant: -0:14 -1 (const int) +0:14 4294967295 (const uint) 0:14 Constant: 0:14 -1 (const int) 0:15 Sequence @@ -145,8 +145,8 @@ 0:16 'storeTemp' ( temp 4-component vector of float) 0:18 move second child to first child ( temp 4-component vector of float) 0:18 indirect index (layout( row_major std430) buffer 4-component vector of float) -0:18 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float) -0:18 'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:18 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:18 'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:18 Constant: 0:18 0 (const uint) 0:18 Convert float to uint ( temp uint) @@ -155,8 +155,8 @@ 0:18 Constant: 0:18 0 (const int) 0:18 indirect index (layout( row_major std430) buffer 4-component vector of float) -0:18 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float) -0:18 'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:18 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:18 'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:18 Constant: 0:18 0 (const uint) 0:18 Convert float to uint ( temp uint) @@ -174,19 +174,19 @@ 0:? 'nThreadId' ( temp 3-component vector of uint) 0:? Linker Objects 0:? 'outtx' (layout( rgba32f) uniform image2D) -0:? 'csb' (layout( binding=1 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId} @data}) -0:? 'csb@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) -0:? 'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data}) +0:? 'csb' (layout( binding=1 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId} @data}) +0:? 'csb@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) 0:? 'nThreadId' ( in 3-component vector of uint GlobalInvocationID) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 84 +// Generated by (magic number): 80006 +// Id's are bound by 85 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint GLCompute 4 "main" 79 + EntryPoint GLCompute 4 "main" 80 ExecutionMode 4 LocalSize 1 1 1 Source HLSL 500 Name 4 "main" @@ -205,15 +205,15 @@ Name 26 "csb@count" MemberName 26(csb@count) 0 "@count" Name 28 "csb@count" - Name 48 "coord" - Name 52 "storeTemp" - Name 57 "outtx" - Name 63 "rwsb" - MemberName 63(rwsb) 0 "@data" - Name 65 "rwsb" - Name 77 "nThreadId" - Name 79 "nThreadId" - Name 81 "param" + Name 49 "coord" + Name 53 "storeTemp" + Name 58 "outtx" + Name 64 "rwsb" + MemberName 64(rwsb) 0 "@data" + Name 66 "rwsb" + Name 78 "nThreadId" + Name 80 "nThreadId" + Name 82 "param" MemberDecorate 19(sb_t) 0 Offset 0 MemberDecorate 19(sb_t) 1 Offset 16 Decorate 20 ArrayStride 32 @@ -224,12 +224,12 @@ MemberDecorate 26(csb@count) 0 Offset 0 Decorate 26(csb@count) BufferBlock Decorate 28(csb@count) DescriptorSet 0 - Decorate 57(outtx) DescriptorSet 0 - Decorate 62 ArrayStride 16 - MemberDecorate 63(rwsb) 0 Offset 0 - Decorate 63(rwsb) BufferBlock - Decorate 65(rwsb) DescriptorSet 0 - Decorate 79(nThreadId) BuiltIn GlobalInvocationId + Decorate 58(outtx) DescriptorSet 0 + Decorate 63 ArrayStride 16 + MemberDecorate 64(rwsb) 0 Offset 0 + Decorate 64(rwsb) BufferBlock + Decorate 66(rwsb) DescriptorSet 0 + Decorate 80(nThreadId) BuiltIn GlobalInvocationId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 @@ -248,79 +248,80 @@ 23(csb): 22(ptr) Variable Uniform 24: TypeInt 32 1 25: 24(int) Constant 0 - 26(csb@count): TypeStruct 24(int) + 26(csb@count): TypeStruct 6(int) 27: TypePointer Uniform 26(csb@count) 28(csb@count): 27(ptr) Variable Uniform - 29: TypePointer Uniform 24(int) - 31: 24(int) Constant 4294967295 + 29: TypePointer Uniform 6(int) + 31: 6(int) Constant 4294967295 32: 6(int) Constant 1 33: 6(int) Constant 0 - 36: TypePointer Uniform 19(sb_t) - 40: TypePointer Function 14(fvec4) - 43: 24(int) Constant 1 - 44: TypePointer Function 15(ivec2) - 46: TypeVector 13(float) 2 - 47: TypePointer Function 46(fvec2) - 55: TypeImage 13(float) 2D nonsampled format:Rgba32f - 56: TypePointer UniformConstant 55 - 57(outtx): 56(ptr) Variable UniformConstant - 62: TypeRuntimeArray 14(fvec4) - 63(rwsb): TypeStruct 62 - 64: TypePointer Uniform 63(rwsb) - 65(rwsb): 64(ptr) Variable Uniform - 66: TypePointer Function 13(float) - 73: TypePointer Uniform 14(fvec4) - 78: TypePointer Input 7(ivec3) - 79(nThreadId): 78(ptr) Variable Input + 35: 24(int) Constant 4294967295 + 37: TypePointer Uniform 19(sb_t) + 41: TypePointer Function 14(fvec4) + 44: 24(int) Constant 1 + 45: TypePointer Function 15(ivec2) + 47: TypeVector 13(float) 2 + 48: TypePointer Function 47(fvec2) + 56: TypeImage 13(float) 2D nonsampled format:Rgba32f + 57: TypePointer UniformConstant 56 + 58(outtx): 57(ptr) Variable UniformConstant + 63: TypeRuntimeArray 14(fvec4) + 64(rwsb): TypeStruct 63 + 65: TypePointer Uniform 64(rwsb) + 66(rwsb): 65(ptr) Variable Uniform + 67: TypePointer Function 13(float) + 74: TypePointer Uniform 14(fvec4) + 79: TypePointer Input 7(ivec3) + 80(nThreadId): 79(ptr) Variable Input 4(main): 2 Function None 3 5: Label - 77(nThreadId): 8(ptr) Variable Function - 81(param): 8(ptr) Variable Function - 80: 7(ivec3) Load 79(nThreadId) - Store 77(nThreadId) 80 - 82: 7(ivec3) Load 77(nThreadId) - Store 81(param) 82 - 83: 2 FunctionCall 11(@main(vu3;) 81(param) + 78(nThreadId): 8(ptr) Variable Function + 82(param): 8(ptr) Variable Function + 81: 7(ivec3) Load 80(nThreadId) + Store 78(nThreadId) 81 + 83: 7(ivec3) Load 78(nThreadId) + Store 82(param) 83 + 84: 2 FunctionCall 11(@main(vu3;) 82(param) Return FunctionEnd 11(@main(vu3;): 2 Function None 9 10(nThreadId): 8(ptr) FunctionParameter 12: Label 18(data): 17(ptr) Variable Function - 48(coord): 47(ptr) Variable Function - 52(storeTemp): 40(ptr) Variable Function + 49(coord): 48(ptr) Variable Function + 53(storeTemp): 41(ptr) Variable Function 30: 29(ptr) AccessChain 28(csb@count) 25 34: 6(int) AtomicIAdd 30 32 33 31 - 35: 6(int) IAdd 34 31 - 37: 36(ptr) AccessChain 23(csb) 25 35 - 38: 19(sb_t) Load 37 - 39: 14(fvec4) CompositeExtract 38 0 - 41: 40(ptr) AccessChain 18(data) 25 - Store 41 39 - 42: 15(ivec2) CompositeExtract 38 1 - 45: 44(ptr) AccessChain 18(data) 43 - Store 45 42 - 49: 44(ptr) AccessChain 18(data) 43 - 50: 15(ivec2) Load 49 - 51: 46(fvec2) ConvertUToF 50 - Store 48(coord) 51 - 53: 40(ptr) AccessChain 18(data) 25 - 54: 14(fvec4) Load 53 - Store 52(storeTemp) 54 - 58: 55 Load 57(outtx) - 59: 46(fvec2) Load 48(coord) - 60: 15(ivec2) ConvertFToU 59 - 61: 14(fvec4) Load 52(storeTemp) - ImageWrite 58 60 61 - 67: 66(ptr) AccessChain 48(coord) 33 - 68: 13(float) Load 67 - 69: 6(int) ConvertFToU 68 - 70: 66(ptr) AccessChain 48(coord) 32 - 71: 13(float) Load 70 - 72: 6(int) ConvertFToU 71 - 74: 73(ptr) AccessChain 65(rwsb) 25 72 - 75: 14(fvec4) Load 74 - 76: 73(ptr) AccessChain 65(rwsb) 25 69 - Store 76 75 + 36: 6(int) IAdd 34 35 + 38: 37(ptr) AccessChain 23(csb) 25 36 + 39: 19(sb_t) Load 38 + 40: 14(fvec4) CompositeExtract 39 0 + 42: 41(ptr) AccessChain 18(data) 25 + Store 42 40 + 43: 15(ivec2) CompositeExtract 39 1 + 46: 45(ptr) AccessChain 18(data) 44 + Store 46 43 + 50: 45(ptr) AccessChain 18(data) 44 + 51: 15(ivec2) Load 50 + 52: 47(fvec2) ConvertUToF 51 + Store 49(coord) 52 + 54: 41(ptr) AccessChain 18(data) 25 + 55: 14(fvec4) Load 54 + Store 53(storeTemp) 55 + 59: 56 Load 58(outtx) + 60: 47(fvec2) Load 49(coord) + 61: 15(ivec2) ConvertFToU 60 + 62: 14(fvec4) Load 53(storeTemp) + ImageWrite 59 61 62 + 68: 67(ptr) AccessChain 49(coord) 33 + 69: 13(float) Load 68 + 70: 6(int) ConvertFToU 69 + 71: 67(ptr) AccessChain 49(coord) 32 + 72: 13(float) Load 71 + 73: 6(int) ConvertFToU 72 + 75: 74(ptr) AccessChain 66(rwsb) 25 73 + 76: 14(fvec4) Load 75 + 77: 74(ptr) AccessChain 66(rwsb) 25 70 + Store 77 76 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -5,7 +5,7 @@ 0:5 Function Definition: testLoad(u1;block--u1[0]1; ( temp 2-component vector of uint) 0:5 Function Parameters: 0:5 'loc' ( in uint) -0:5 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:5 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:? Sequence 0:6 Sequence 0:6 move second child to first child ( temp 2-component vector of uint) @@ -18,15 +18,15 @@ 0:6 Constant: 0:6 2 (const int) 0:? Construct vec2 ( temp 2-component vector of uint) -0:6 indirect index ( temp float) -0:6 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:6 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:6 indirect index ( temp uint) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:6 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:6 Constant: 0:6 0 (const uint) 0:6 'byteAddrTemp' ( temp int) -0:6 indirect index ( temp float) -0:6 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:6 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:6 indirect index ( temp uint) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:6 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:6 Constant: 0:6 0 (const uint) 0:6 add ( temp int) @@ -44,7 +44,7 @@ 0:13 'result' ( temp 2-component vector of uint) 0:13 Function Call: testLoad(u1;block--u1[0]1; ( temp 2-component vector of uint) 0:13 'dispatchId' ( in uint) -0:13 'g_input' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:13 'g_input' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:14 Sequence 0:14 imageStore ( temp void) 0:14 'g_output' (layout( binding=1 rg32ui) uniform uimageBuffer) @@ -60,7 +60,7 @@ 0:12 Function Call: @main(u1; ( temp void) 0:? 'dispatchId' ( temp uint) 0:? Linker Objects -0:? 'g_input' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:? 'g_input' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:? 'g_output' (layout( binding=1 rg32ui) uniform uimageBuffer) 0:? 'dispatchId' ( in uint GlobalInvocationID) @@ -74,7 +74,7 @@ 0:5 Function Definition: testLoad(u1;block--u1[0]1; ( temp 2-component vector of uint) 0:5 Function Parameters: 0:5 'loc' ( in uint) -0:5 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:5 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:? Sequence 0:6 Sequence 0:6 move second child to first child ( temp 2-component vector of uint) @@ -87,15 +87,15 @@ 0:6 Constant: 0:6 2 (const int) 0:? Construct vec2 ( temp 2-component vector of uint) -0:6 indirect index ( temp float) -0:6 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:6 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:6 indirect index ( temp uint) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:6 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:6 Constant: 0:6 0 (const uint) 0:6 'byteAddrTemp' ( temp int) -0:6 indirect index ( temp float) -0:6 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:6 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:6 indirect index ( temp uint) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:6 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:6 Constant: 0:6 0 (const uint) 0:6 add ( temp int) @@ -113,7 +113,7 @@ 0:13 'result' ( temp 2-component vector of uint) 0:13 Function Call: testLoad(u1;block--u1[0]1; ( temp 2-component vector of uint) 0:13 'dispatchId' ( in uint) -0:13 'g_input' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:13 'g_input' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:14 Sequence 0:14 imageStore ( temp void) 0:14 'g_output' (layout( binding=1 rg32ui) uniform uimageBuffer) @@ -129,20 +129,20 @@ 0:12 Function Call: @main(u1; ( temp void) 0:? 'dispatchId' ( temp uint) 0:? Linker Objects -0:? 'g_input' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:? 'g_input' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:? 'g_output' (layout( binding=1 rg32ui) uniform uimageBuffer) 0:? 'dispatchId' ( in uint GlobalInvocationID) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 62 +// Generated by (magic number): 80006 +// Id's are bound by 61 Capability Shader Capability ImageBuffer Capability StorageImageExtendedFormats 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint GLCompute 4 "main" 57 + EntryPoint GLCompute 4 "main" 56 ExecutionMode 4 LocalSize 256 1 1 Source HLSL 500 Name 4 "main" @@ -155,14 +155,13 @@ Name 18 "dispatchId" Name 22 "result" Name 25 "byteAddrTemp" - Name 42 "result" + Name 43 "result" Name 44 "g_input" Name 45 "param" - Name 47 "param" - Name 51 "g_output" - Name 55 "dispatchId" - Name 57 "dispatchId" - Name 59 "param" + Name 50 "g_output" + Name 54 "dispatchId" + Name 56 "dispatchId" + Name 58 "param" Decorate 8 ArrayStride 4 MemberDecorate 9 0 NonWritable MemberDecorate 9 0 Offset 0 @@ -170,16 +169,16 @@ Decorate 14(buffer) NonWritable Decorate 44(g_input) DescriptorSet 0 Decorate 44(g_input) Binding 0 - Decorate 51(g_output) DescriptorSet 0 - Decorate 51(g_output) Binding 1 - Decorate 57(dispatchId) BuiltIn GlobalInvocationId + Decorate 50(g_output) DescriptorSet 0 + Decorate 50(g_output) Binding 1 + Decorate 56(dispatchId) BuiltIn GlobalInvocationId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 7: TypePointer Function 6(int) 8: TypeRuntimeArray 6(int) 9: TypeStruct 8 - 10: TypePointer Function 9(struct) + 10: TypePointer Uniform 9(struct) 11: TypeVector 6(int) 2 12: TypeFunction 11(ivec2) 7(ptr) 10(ptr) 17: TypeFunction 2 7(ptr) @@ -188,23 +187,23 @@ 24: TypePointer Function 23(int) 27: 23(int) Constant 2 29: 23(int) Constant 0 - 34: 23(int) Constant 1 - 43: TypePointer Uniform 9(struct) - 44(g_input): 43(ptr) Variable Uniform - 49: TypeImage 6(int) Buffer nonsampled format:Rg32ui - 50: TypePointer UniformConstant 49 - 51(g_output): 50(ptr) Variable UniformConstant - 56: TypePointer Input 6(int) - 57(dispatchId): 56(ptr) Variable Input + 31: TypePointer Uniform 6(int) + 35: 23(int) Constant 1 + 44(g_input): 10(ptr) Variable Uniform + 48: TypeImage 6(int) Buffer nonsampled format:Rg32ui + 49: TypePointer UniformConstant 48 + 50(g_output): 49(ptr) Variable UniformConstant + 55: TypePointer Input 6(int) + 56(dispatchId): 55(ptr) Variable Input 4(main): 2 Function None 3 5: Label - 55(dispatchId): 7(ptr) Variable Function - 59(param): 7(ptr) Variable Function - 58: 6(int) Load 57(dispatchId) - Store 55(dispatchId) 58 - 60: 6(int) Load 55(dispatchId) - Store 59(param) 60 - 61: 2 FunctionCall 19(@main(u1;) 59(param) + 54(dispatchId): 7(ptr) Variable Function + 58(param): 7(ptr) Variable Function + 57: 6(int) Load 56(dispatchId) + Store 54(dispatchId) 57 + 59: 6(int) Load 54(dispatchId) + Store 58(param) 59 + 60: 2 FunctionCall 19(@main(u1;) 58(param) Return FunctionEnd 15(testLoad(u1;block--u1[0]1;): 11(ivec2) Function None 12 @@ -217,30 +216,29 @@ 28: 23(int) ShiftRightLogical 26 27 Store 25(byteAddrTemp) 28 30: 23(int) Load 25(byteAddrTemp) - 31: 7(ptr) AccessChain 14(buffer) 29 30 - 32: 6(int) Load 31 - 33: 23(int) Load 25(byteAddrTemp) - 35: 23(int) IAdd 33 34 - 36: 7(ptr) AccessChain 14(buffer) 29 35 - 37: 6(int) Load 36 - 38: 11(ivec2) CompositeConstruct 32 37 - Store 22(result) 38 - 39: 11(ivec2) Load 22(result) - ReturnValue 39 + 32: 31(ptr) AccessChain 14(buffer) 29 30 + 33: 6(int) Load 32 + 34: 23(int) Load 25(byteAddrTemp) + 36: 23(int) IAdd 34 35 + 37: 31(ptr) AccessChain 14(buffer) 29 36 + 38: 6(int) Load 37 + 39: 11(ivec2) CompositeConstruct 33 38 + Store 22(result) 39 + 40: 11(ivec2) Load 22(result) + ReturnValue 40 FunctionEnd 19(@main(u1;): 2 Function None 17 18(dispatchId): 7(ptr) FunctionParameter 20: Label - 42(result): 21(ptr) Variable Function + 43(result): 21(ptr) Variable Function 45(param): 7(ptr) Variable Function - 47(param): 10(ptr) Variable Function 46: 6(int) Load 18(dispatchId) Store 45(param) 46 - 48: 11(ivec2) FunctionCall 15(testLoad(u1;block--u1[0]1;) 45(param) 47(param) - Store 42(result) 48 - 52: 49 Load 51(g_output) - 53: 6(int) Load 18(dispatchId) - 54: 11(ivec2) Load 42(result) - ImageWrite 52 53 54 + 47: 11(ivec2) FunctionCall 15(testLoad(u1;block--u1[0]1;) 45(param) 44(g_input) + Store 43(result) 47 + 51: 48 Load 50(g_output) + 52: 6(int) Load 18(dispatchId) + 53: 11(ivec2) Load 43(result) + ImageWrite 51 52 53 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -4,27 +4,27 @@ 0:? Sequence 0:5 Function Definition: get(block--vu4[0]1;u1; ( temp 4-component vector of uint) 0:5 Function Parameters: -0:5 'sb' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) +0:5 'sb' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:5 'bufferOffset' ( in uint) 0:? Sequence 0:6 Branch: Return with expression 0:6 indirect index (layout( row_major std430) buffer 4-component vector of uint) -0:6 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint) -0:6 'sb' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint) +0:6 'sb' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:6 Constant: 0:6 0 (const uint) 0:6 'bufferOffset' ( in uint) 0:10 Function Definition: set(block--vu4[0]1;u1;vu4; ( temp void) 0:10 Function Parameters: -0:10 'sb' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) -0:10 'sb@count' ( buffer block{layout( row_major std430) buffer int @count}) +0:10 'sb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:10 'sb@count' ( buffer block{layout( row_major std430) buffer uint @count}) 0:10 'bufferOffset' ( in uint) 0:10 'data' ( in 4-component vector of uint) 0:? Sequence 0:11 move second child to first child ( temp 4-component vector of uint) 0:11 indirect index ( buffer 4-component vector of uint) -0:11 @data: direct index for structure ( buffer implicitly-sized array of 4-component vector of uint) -0:11 'sb' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) +0:11 @data: direct index for structure ( buffer unsized 1-element array of 4-component vector of uint) +0:11 'sb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 'bufferOffset' ( in uint) @@ -34,12 +34,12 @@ 0:20 'pos' ( in uint) 0:? Sequence 0:21 Function Call: set(block--vu4[0]1;u1;vu4; ( temp void) -0:21 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) -0:21 'sbuf2@count' ( buffer block{layout( row_major std430) buffer int @count}) +0:21 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:21 'sbuf2@count' ( buffer block{layout( row_major std430) buffer uint @count}) 0:21 Constant: 0:21 2 (const uint) 0:21 Function Call: get(block--vu4[0]1;u1; ( temp 4-component vector of uint) -0:21 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) +0:21 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:21 Constant: 0:21 3 (const uint) 0:23 Branch: Return with expression @@ -59,10 +59,10 @@ 0:20 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) -0:? 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) -0:? 'sbuf2@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) -0:? 'sbuf3' (layout( binding=12 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of 3-component vector of uint @data}) +0:? 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:? 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:? 'sbuf2@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf3' (layout( binding=12 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 3-component vector of uint @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) @@ -75,27 +75,27 @@ 0:? Sequence 0:5 Function Definition: get(block--vu4[0]1;u1; ( temp 4-component vector of uint) 0:5 Function Parameters: -0:5 'sb' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) +0:5 'sb' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:5 'bufferOffset' ( in uint) 0:? Sequence 0:6 Branch: Return with expression 0:6 indirect index (layout( row_major std430) buffer 4-component vector of uint) -0:6 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint) -0:6 'sb' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint) +0:6 'sb' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:6 Constant: 0:6 0 (const uint) 0:6 'bufferOffset' ( in uint) 0:10 Function Definition: set(block--vu4[0]1;u1;vu4; ( temp void) 0:10 Function Parameters: -0:10 'sb' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) -0:10 'sb@count' ( buffer block{layout( row_major std430) buffer int @count}) +0:10 'sb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:10 'sb@count' ( buffer block{layout( row_major std430) buffer uint @count}) 0:10 'bufferOffset' ( in uint) 0:10 'data' ( in 4-component vector of uint) 0:? Sequence 0:11 move second child to first child ( temp 4-component vector of uint) 0:11 indirect index ( buffer 4-component vector of uint) -0:11 @data: direct index for structure ( buffer implicitly-sized array of 4-component vector of uint) -0:11 'sb' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) +0:11 @data: direct index for structure ( buffer unsized 1-element array of 4-component vector of uint) +0:11 'sb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 'bufferOffset' ( in uint) @@ -105,12 +105,12 @@ 0:20 'pos' ( in uint) 0:? Sequence 0:21 Function Call: set(block--vu4[0]1;u1;vu4; ( temp void) -0:21 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) -0:21 'sbuf2@count' ( buffer block{layout( row_major std430) buffer int @count}) +0:21 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:21 'sbuf2@count' ( buffer block{layout( row_major std430) buffer uint @count}) 0:21 Constant: 0:21 2 (const uint) 0:21 Function Call: get(block--vu4[0]1;u1; ( temp 4-component vector of uint) -0:21 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) +0:21 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:21 Constant: 0:21 3 (const uint) 0:23 Branch: Return with expression @@ -130,21 +130,21 @@ 0:20 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) -0:? 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) -0:? 'sbuf2@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) -0:? 'sbuf3' (layout( binding=12 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of 3-component vector of uint @data}) +0:? 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:? 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:? 'sbuf2@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf3' (layout( binding=12 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 3-component vector of uint @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 83 +// Generated by (magic number): 80006 +// Id's are bound by 78 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 68 71 + EntryPoint Fragment 4 "main" 63 66 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" @@ -155,34 +155,31 @@ Name 14 "bufferOffset" Name 18 "" MemberName 18 0 "@data" - Name 21 "" - MemberName 21 0 "@count" - Name 29 "set(block--vu4[0]1;u1;vu4;" - Name 25 "sb" - Name 26 "sb@count" - Name 27 "bufferOffset" - Name 28 "data" - Name 35 "@main(u1;" - Name 34 "pos" + Name 20 "" + MemberName 20 0 "@count" + Name 28 "set(block--vu4[0]1;u1;vu4;" + Name 24 "sb" + Name 25 "sb@count" + Name 26 "bufferOffset" + Name 27 "data" + Name 34 "@main(u1;" + Name 33 "pos" Name 47 "sbuf2" - Name 49 "sbuf2@count" - Name 52 "sbuf" + Name 48 "sbuf2@count" + Name 50 "sbuf" + Name 52 "param" Name 54 "param" Name 55 "param" - Name 57 "param" - Name 58 "param" - Name 59 "param" - Name 60 "param" - Name 66 "pos" - Name 68 "pos" - Name 71 "@entryPointOutput" - Name 72 "param" - Name 75 "sbuf2@count" - MemberName 75(sbuf2@count) 0 "@count" - Name 77 "sbuf2@count" - Name 80 "sbuf3" - MemberName 80(sbuf3) 0 "@data" - Name 82 "sbuf3" + Name 61 "pos" + Name 63 "pos" + Name 66 "@entryPointOutput" + Name 67 "param" + Name 70 "sbuf2@count" + MemberName 70(sbuf2@count) 0 "@count" + Name 72 "sbuf2@count" + Name 75 "sbuf3" + MemberName 75(sbuf3) 0 "@data" + Name 77 "sbuf3" Decorate 8 ArrayStride 16 MemberDecorate 9 0 NonWritable MemberDecorate 9 0 Offset 0 @@ -191,76 +188,74 @@ Decorate 17 ArrayStride 16 MemberDecorate 18 0 Offset 0 Decorate 18 BufferBlock - Decorate 21 BufferBlock + Decorate 20 BufferBlock Decorate 47(sbuf2) DescriptorSet 0 - Decorate 49(sbuf2@count) DescriptorSet 0 - Decorate 52(sbuf) DescriptorSet 0 - Decorate 52(sbuf) Binding 10 - Decorate 68(pos) Flat - Decorate 68(pos) Location 0 - Decorate 71(@entryPointOutput) Location 0 - MemberDecorate 75(sbuf2@count) 0 Offset 0 - Decorate 75(sbuf2@count) BufferBlock - Decorate 77(sbuf2@count) DescriptorSet 0 - Decorate 79 ArrayStride 16 - MemberDecorate 80(sbuf3) 0 NonWritable - MemberDecorate 80(sbuf3) 0 Offset 0 - Decorate 80(sbuf3) BufferBlock - Decorate 82(sbuf3) DescriptorSet 0 - Decorate 82(sbuf3) Binding 12 + Decorate 48(sbuf2@count) DescriptorSet 0 + Decorate 50(sbuf) DescriptorSet 0 + Decorate 50(sbuf) Binding 10 + Decorate 63(pos) Flat + Decorate 63(pos) Location 0 + Decorate 66(@entryPointOutput) Location 0 + MemberDecorate 70(sbuf2@count) 0 Offset 0 + Decorate 70(sbuf2@count) BufferBlock + Decorate 72(sbuf2@count) DescriptorSet 0 + Decorate 74 ArrayStride 16 + MemberDecorate 75(sbuf3) 0 NonWritable + MemberDecorate 75(sbuf3) 0 Offset 0 + Decorate 75(sbuf3) BufferBlock + Decorate 77(sbuf3) DescriptorSet 0 + Decorate 77(sbuf3) Binding 12 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 7: TypeVector 6(int) 4 8: TypeRuntimeArray 7(ivec4) 9: TypeStruct 8 - 10: TypePointer Function 9(struct) + 10: TypePointer Uniform 9(struct) 11: TypePointer Function 6(int) 12: TypeFunction 7(ivec4) 10(ptr) 11(ptr) 17: TypeRuntimeArray 7(ivec4) 18: TypeStruct 17 - 19: TypePointer Function 18(struct) - 20: TypeInt 32 1 - 21: TypeStruct 20(int) - 22: TypePointer Function 21(struct) - 23: TypePointer Function 7(ivec4) - 24: TypeFunction 2 19(ptr) 22(ptr) 11(ptr) 23(ptr) - 31: TypeFloat 32 - 32: TypeVector 31(float) 4 - 33: TypeFunction 32(fvec4) 11(ptr) - 37: 20(int) Constant 0 - 46: TypePointer Uniform 18(struct) - 47(sbuf2): 46(ptr) Variable Uniform - 48: TypePointer Uniform 21(struct) - 49(sbuf2@count): 48(ptr) Variable Uniform - 50: 6(int) Constant 2 - 51: TypePointer Uniform 9(struct) - 52(sbuf): 51(ptr) Variable Uniform - 53: 6(int) Constant 3 - 62: 31(float) Constant 0 - 63: 32(fvec4) ConstantComposite 62 62 62 62 - 67: TypePointer Input 6(int) - 68(pos): 67(ptr) Variable Input - 70: TypePointer Output 32(fvec4) -71(@entryPointOutput): 70(ptr) Variable Output - 75(sbuf2@count): TypeStruct 20(int) - 76: TypePointer Uniform 75(sbuf2@count) - 77(sbuf2@count): 76(ptr) Variable Uniform - 78: TypeVector 6(int) 3 - 79: TypeRuntimeArray 78(ivec3) - 80(sbuf3): TypeStruct 79 - 81: TypePointer Uniform 80(sbuf3) - 82(sbuf3): 81(ptr) Variable Uniform + 19: TypePointer Uniform 18(struct) + 20: TypeStruct 6(int) + 21: TypePointer Uniform 20(struct) + 22: TypePointer Function 7(ivec4) + 23: TypeFunction 2 19(ptr) 21(ptr) 11(ptr) 22(ptr) + 30: TypeFloat 32 + 31: TypeVector 30(float) 4 + 32: TypeFunction 31(fvec4) 11(ptr) + 36: TypeInt 32 1 + 37: 36(int) Constant 0 + 39: TypePointer Uniform 7(ivec4) + 47(sbuf2): 19(ptr) Variable Uniform + 48(sbuf2@count): 21(ptr) Variable Uniform + 49: 6(int) Constant 2 + 50(sbuf): 10(ptr) Variable Uniform + 51: 6(int) Constant 3 + 57: 30(float) Constant 0 + 58: 31(fvec4) ConstantComposite 57 57 57 57 + 62: TypePointer Input 6(int) + 63(pos): 62(ptr) Variable Input + 65: TypePointer Output 31(fvec4) +66(@entryPointOutput): 65(ptr) Variable Output + 70(sbuf2@count): TypeStruct 6(int) + 71: TypePointer Uniform 70(sbuf2@count) + 72(sbuf2@count): 71(ptr) Variable Uniform + 73: TypeVector 6(int) 3 + 74: TypeRuntimeArray 73(ivec3) + 75(sbuf3): TypeStruct 74 + 76: TypePointer Uniform 75(sbuf3) + 77(sbuf3): 76(ptr) Variable Uniform 4(main): 2 Function None 3 5: Label - 66(pos): 11(ptr) Variable Function - 72(param): 11(ptr) Variable Function - 69: 6(int) Load 68(pos) - Store 66(pos) 69 - 73: 6(int) Load 66(pos) - Store 72(param) 73 - 74: 32(fvec4) FunctionCall 35(@main(u1;) 72(param) - Store 71(@entryPointOutput) 74 + 61(pos): 11(ptr) Variable Function + 67(param): 11(ptr) Variable Function + 64: 6(int) Load 63(pos) + Store 61(pos) 64 + 68: 6(int) Load 61(pos) + Store 67(param) 68 + 69: 31(fvec4) FunctionCall 34(@main(u1;) 67(param) + Store 66(@entryPointOutput) 69 Return FunctionEnd 15(get(block--vu4[0]1;u1;): 7(ivec4) Function None 12 @@ -268,35 +263,32 @@ 14(bufferOffset): 11(ptr) FunctionParameter 16: Label 38: 6(int) Load 14(bufferOffset) - 39: 23(ptr) AccessChain 13(sb) 37 38 - 40: 7(ivec4) Load 39 - ReturnValue 40 + 40: 39(ptr) AccessChain 13(sb) 37 38 + 41: 7(ivec4) Load 40 + ReturnValue 41 FunctionEnd -29(set(block--vu4[0]1;u1;vu4;): 2 Function None 24 - 25(sb): 19(ptr) FunctionParameter - 26(sb@count): 22(ptr) FunctionParameter -27(bufferOffset): 11(ptr) FunctionParameter - 28(data): 23(ptr) FunctionParameter - 30: Label - 43: 6(int) Load 27(bufferOffset) - 44: 7(ivec4) Load 28(data) - 45: 23(ptr) AccessChain 25(sb) 37 43 - Store 45 44 +28(set(block--vu4[0]1;u1;vu4;): 2 Function None 23 + 24(sb): 19(ptr) FunctionParameter + 25(sb@count): 21(ptr) FunctionParameter +26(bufferOffset): 11(ptr) FunctionParameter + 27(data): 22(ptr) FunctionParameter + 29: Label + 44: 6(int) Load 26(bufferOffset) + 45: 7(ivec4) Load 27(data) + 46: 39(ptr) AccessChain 24(sb) 37 44 + Store 46 45 Return FunctionEnd - 35(@main(u1;): 32(fvec4) Function None 33 - 34(pos): 11(ptr) FunctionParameter - 36: Label - 54(param): 10(ptr) Variable Function - 55(param): 11(ptr) Variable Function - 57(param): 19(ptr) Variable Function - 58(param): 22(ptr) Variable Function - 59(param): 11(ptr) Variable Function - 60(param): 23(ptr) Variable Function + 34(@main(u1;): 31(fvec4) Function None 32 + 33(pos): 11(ptr) FunctionParameter + 35: Label + 52(param): 11(ptr) Variable Function + 54(param): 11(ptr) Variable Function + 55(param): 22(ptr) Variable Function + Store 52(param) 51 + 53: 7(ivec4) FunctionCall 15(get(block--vu4[0]1;u1;) 50(sbuf) 52(param) + Store 54(param) 49 Store 55(param) 53 - 56: 7(ivec4) FunctionCall 15(get(block--vu4[0]1;u1;) 54(param) 55(param) - Store 59(param) 50 - Store 60(param) 56 - 61: 2 FunctionCall 29(set(block--vu4[0]1;u1;vu4;) 57(param) 58(param) 59(param) 60(param) - ReturnValue 63 + 56: 2 FunctionCall 28(set(block--vu4[0]1;u1;vu4;) 47(sbuf2) 48(sbuf2@count) 54(param) 55(param) + ReturnValue 58 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -10,8 +10,8 @@ 0:13 move second child to first child ( temp structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) 0:13 'mydata' ( temp structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) 0:13 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) -0:13 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) -0:13 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:13 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:13 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) 0:13 Constant: 0:13 0 (const uint) 0:13 'pos' ( in uint) @@ -19,8 +19,8 @@ 0:17 move second child to first child ( temp uint) 0:17 'size' ( temp uint) 0:17 array length ( temp uint) -0:17 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) -0:17 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:17 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) 0:17 Constant: 0:17 0 (const uint) 0:17 move second child to first child ( temp uint) @@ -31,8 +31,8 @@ 0:19 Condition 0:19 test: direct index for structure ( temp bool) 0:19 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) -0:19 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) -0:19 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:19 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) 0:19 Constant: 0:19 0 (const uint) 0:19 'pos' ( in uint) @@ -44,16 +44,16 @@ 0:20 add ( temp 3-component vector of float) 0:20 color: direct index for structure ( temp 3-component vector of float) 0:20 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) -0:20 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) -0:20 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:20 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) 0:20 Constant: 0:20 0 (const uint) 0:20 'pos' ( in uint) 0:20 Constant: 0:20 0 (const int) 0:20 indirect index (layout( row_major std430) buffer float) -0:20 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of float) -0:20 'sbuf2' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:20 'sbuf2' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:20 Constant: 0:20 0 (const uint) 0:20 'pos' ( in uint) @@ -86,8 +86,8 @@ 0:12 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) -0:? 'sbuf2' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:? 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:? 'sbuf2' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) @@ -106,8 +106,8 @@ 0:13 move second child to first child ( temp structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) 0:13 'mydata' ( temp structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) 0:13 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) -0:13 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) -0:13 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:13 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:13 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) 0:13 Constant: 0:13 0 (const uint) 0:13 'pos' ( in uint) @@ -115,8 +115,8 @@ 0:17 move second child to first child ( temp uint) 0:17 'size' ( temp uint) 0:17 array length ( temp uint) -0:17 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) -0:17 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:17 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) 0:17 Constant: 0:17 0 (const uint) 0:17 move second child to first child ( temp uint) @@ -127,8 +127,8 @@ 0:19 Condition 0:19 test: direct index for structure ( temp bool) 0:19 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) -0:19 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) -0:19 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:19 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) 0:19 Constant: 0:19 0 (const uint) 0:19 'pos' ( in uint) @@ -140,16 +140,16 @@ 0:20 add ( temp 3-component vector of float) 0:20 color: direct index for structure ( temp 3-component vector of float) 0:20 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) -0:20 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) -0:20 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:20 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) 0:20 Constant: 0:20 0 (const uint) 0:20 'pos' ( in uint) 0:20 Constant: 0:20 0 (const int) 0:20 indirect index (layout( row_major std430) buffer float) -0:20 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of float) -0:20 'sbuf2' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:20 'sbuf2' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:20 Constant: 0:20 0 (const uint) 0:20 'pos' ( in uint) @@ -182,13 +182,13 @@ 0:12 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) -0:? 'sbuf2' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:? 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:? 'sbuf2' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 96 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.hlslfun1.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.hlslfun1.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.hlslfun1.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.hlslfun1.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,125 @@ +hlsl.structbuffer.incdec.frag +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 70 + + Capability Shader + Extension "SPV_GOOGLE_hlsl_functionality1" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 63 66 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 12 "@main(u1;" + Name 11 "pos" + Name 16 "result" + Name 20 "sbuf_rw_i" + MemberName 20(sbuf_rw_i) 0 "@data" + Name 22 "sbuf_rw_i" + Name 26 "sbuf_rw_d" + Name 27 "sbuf_rw_nocounter" + Name 33 "c1" + Name 34 "sbuf_rw_i@count" + MemberName 34(sbuf_rw_i@count) 0 "@count" + Name 36 "sbuf_rw_i@count" + Name 41 "c2" + Name 42 "sbuf_rw_d@count" + Name 61 "pos" + Name 63 "pos" + Name 66 "@entryPointOutput" + Name 67 "param" + Decorate 19 ArrayStride 16 + MemberDecorate 20(sbuf_rw_i) 0 Offset 0 + Decorate 20(sbuf_rw_i) BufferBlock + Decorate 22(sbuf_rw_i) DescriptorSet 0 + Decorate 26(sbuf_rw_d) DescriptorSet 0 + Decorate 27(sbuf_rw_nocounter) DescriptorSet 0 + MemberDecorate 34(sbuf_rw_i@count) 0 Offset 0 + Decorate 34(sbuf_rw_i@count) BufferBlock + Decorate 36(sbuf_rw_i@count) DescriptorSet 0 + Decorate 42(sbuf_rw_d@count) DescriptorSet 0 + Decorate 63(pos) Flat + Decorate 63(pos) Location 0 + DecorateStringGOOGLE 63(pos) DecorationHlslSemanticGOOGLE "FOO" + Decorate 66(@entryPointOutput) Location 0 + DecorateStringGOOGLE 66(@entryPointOutput) DecorationHlslSemanticGOOGLE "SV_TARGET0" + DecorateId 22(sbuf_rw_i) DecorationHlslCounterBufferGOOGLE 36(sbuf_rw_i@count) + DecorateId 26(sbuf_rw_d) DecorationHlslCounterBufferGOOGLE 42(sbuf_rw_d@count) + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeFunction 9(fvec4) 7(ptr) + 14: TypeVector 6(int) 4 + 15: TypePointer Function 14(ivec4) + 17: 6(int) Constant 0 + 18: 14(ivec4) ConstantComposite 17 17 17 17 + 19: TypeRuntimeArray 14(ivec4) + 20(sbuf_rw_i): TypeStruct 19 + 21: TypePointer Uniform 20(sbuf_rw_i) + 22(sbuf_rw_i): 21(ptr) Variable Uniform + 23: TypeInt 32 1 + 24: 23(int) Constant 0 + 25: 23(int) Constant 7 + 26(sbuf_rw_d): 21(ptr) Variable Uniform +27(sbuf_rw_nocounter): 21(ptr) Variable Uniform + 28: 23(int) Constant 5 + 29: 6(int) Constant 2 + 30: 14(ivec4) ConstantComposite 29 29 29 29 + 31: TypePointer Uniform 14(ivec4) +34(sbuf_rw_i@count): TypeStruct 6(int) + 35: TypePointer Uniform 34(sbuf_rw_i@count) +36(sbuf_rw_i@count): 35(ptr) Variable Uniform + 37: TypePointer Uniform 6(int) + 39: 6(int) Constant 1 +42(sbuf_rw_d@count): 35(ptr) Variable Uniform + 44: 6(int) Constant 4294967295 + 46: 23(int) Constant 4294967295 + 62: TypePointer Input 6(int) + 63(pos): 62(ptr) Variable Input + 65: TypePointer Output 9(fvec4) +66(@entryPointOutput): 65(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 61(pos): 7(ptr) Variable Function + 67(param): 7(ptr) Variable Function + 64: 6(int) Load 63(pos) + Store 61(pos) 64 + 68: 6(int) Load 61(pos) + Store 67(param) 68 + 69: 9(fvec4) FunctionCall 12(@main(u1;) 67(param) + Store 66(@entryPointOutput) 69 + Return + FunctionEnd + 12(@main(u1;): 9(fvec4) Function None 10 + 11(pos): 7(ptr) FunctionParameter + 13: Label + 16(result): 15(ptr) Variable Function + 33(c1): 7(ptr) Variable Function + 41(c2): 7(ptr) Variable Function + Store 16(result) 18 + 32: 31(ptr) AccessChain 27(sbuf_rw_nocounter) 24 28 + Store 32 30 + 38: 37(ptr) AccessChain 36(sbuf_rw_i@count) 24 + 40: 6(int) AtomicIAdd 38 39 17 39 + Store 33(c1) 40 + 43: 37(ptr) AccessChain 42(sbuf_rw_d@count) 24 + 45: 6(int) AtomicIAdd 43 39 17 44 + 47: 6(int) IAdd 45 46 + Store 41(c2) 47 + 48: 7(ptr) AccessChain 16(result) 17 + 49: 6(int) Load 48 + 50: 8(float) ConvertUToF 49 + 51: 7(ptr) AccessChain 16(result) 39 + 52: 6(int) Load 51 + 53: 8(float) ConvertUToF 52 + 54: 6(int) Load 33(c1) + 55: 8(float) ConvertUToF 54 + 56: 6(int) Load 41(c2) + 57: 8(float) ConvertUToF 56 + 58: 9(fvec4) CompositeConstruct 50 53 55 57 + ReturnValue 58 + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -15,23 +15,23 @@ 0:8 0 (const uint) 0:8 0 (const uint) 0:10 direct index (layout( row_major std430) buffer 4-component vector of uint) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint) -0:10 'sbuf_rw_i' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint) +0:10 'sbuf_rw_i' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 Constant: 0:10 7 (const int) 0:11 direct index (layout( row_major std430) buffer 4-component vector of uint) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint) -0:11 'sbuf_rw_d' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint) +0:11 'sbuf_rw_d' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 Constant: 0:11 7 (const int) 0:13 move second child to first child ( temp 4-component vector of uint) 0:13 direct index (layout( row_major std430) buffer 4-component vector of uint) -0:13 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint) -0:13 'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) +0:13 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint) +0:13 'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:13 Constant: 0:13 0 (const uint) 0:13 Constant: @@ -45,23 +45,23 @@ 0:15 move second child to first child ( temp uint) 0:15 'c1' ( temp uint) 0:15 AtomicAdd ( temp uint) -0:15 @count: direct index for structure ( temp int) -0:15 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) +0:15 @count: direct index for structure ( temp uint) +0:15 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) 0:15 Constant: 0:15 0 (const int) 0:15 Constant: -0:15 1 (const int) +0:15 1 (const uint) 0:16 Sequence 0:16 move second child to first child ( temp uint) 0:16 'c2' ( temp uint) 0:16 add ( temp uint) 0:16 AtomicAdd ( temp uint) -0:16 @count: direct index for structure ( temp int) -0:16 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) +0:16 @count: direct index for structure ( temp uint) +0:16 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) 0:16 Constant: 0:16 0 (const int) 0:16 Constant: -0:16 -1 (const int) +0:16 4294967295 (const uint) 0:16 Constant: 0:16 -1 (const int) 0:18 Branch: Return with expression @@ -91,11 +91,11 @@ 0:7 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf_rw_i' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) -0:? 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) -0:? 'sbuf_rw_d' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) -0:? 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) -0:? 'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) +0:? 'sbuf_rw_i' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:? 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_rw_d' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:? 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) @@ -119,23 +119,23 @@ 0:8 0 (const uint) 0:8 0 (const uint) 0:10 direct index (layout( row_major std430) buffer 4-component vector of uint) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint) -0:10 'sbuf_rw_i' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint) +0:10 'sbuf_rw_i' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 Constant: 0:10 7 (const int) 0:11 direct index (layout( row_major std430) buffer 4-component vector of uint) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint) -0:11 'sbuf_rw_d' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint) +0:11 'sbuf_rw_d' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 Constant: 0:11 7 (const int) 0:13 move second child to first child ( temp 4-component vector of uint) 0:13 direct index (layout( row_major std430) buffer 4-component vector of uint) -0:13 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint) -0:13 'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) +0:13 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint) +0:13 'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:13 Constant: 0:13 0 (const uint) 0:13 Constant: @@ -149,23 +149,23 @@ 0:15 move second child to first child ( temp uint) 0:15 'c1' ( temp uint) 0:15 AtomicAdd ( temp uint) -0:15 @count: direct index for structure ( temp int) -0:15 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) +0:15 @count: direct index for structure ( temp uint) +0:15 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) 0:15 Constant: 0:15 0 (const int) 0:15 Constant: -0:15 1 (const int) +0:15 1 (const uint) 0:16 Sequence 0:16 move second child to first child ( temp uint) 0:16 'c2' ( temp uint) 0:16 add ( temp uint) 0:16 AtomicAdd ( temp uint) -0:16 @count: direct index for structure ( temp int) -0:16 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) +0:16 @count: direct index for structure ( temp uint) +0:16 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) 0:16 Constant: 0:16 0 (const int) 0:16 Constant: -0:16 -1 (const int) +0:16 4294967295 (const uint) 0:16 Constant: 0:16 -1 (const int) 0:18 Branch: Return with expression @@ -195,16 +195,16 @@ 0:7 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf_rw_i' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) -0:? 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) -0:? 'sbuf_rw_d' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) -0:? 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count}) -0:? 'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data}) +0:? 'sbuf_rw_i' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:? 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_rw_d' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:? 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 70 Capability Shader @@ -226,8 +226,8 @@ Name 34 "sbuf_rw_i@count" MemberName 34(sbuf_rw_i@count) 0 "@count" Name 36 "sbuf_rw_i@count" - Name 42 "c2" - Name 43 "sbuf_rw_d@count" + Name 41 "c2" + Name 42 "sbuf_rw_d@count" Name 61 "pos" Name 63 "pos" Name 66 "@entryPointOutput" @@ -241,7 +241,7 @@ MemberDecorate 34(sbuf_rw_i@count) 0 Offset 0 Decorate 34(sbuf_rw_i@count) BufferBlock Decorate 36(sbuf_rw_i@count) DescriptorSet 0 - Decorate 43(sbuf_rw_d@count) DescriptorSet 0 + Decorate 42(sbuf_rw_d@count) DescriptorSet 0 Decorate 63(pos) Flat Decorate 63(pos) Location 0 Decorate 66(@entryPointOutput) Location 0 @@ -269,14 +269,14 @@ 29: 6(int) Constant 2 30: 14(ivec4) ConstantComposite 29 29 29 29 31: TypePointer Uniform 14(ivec4) -34(sbuf_rw_i@count): TypeStruct 23(int) +34(sbuf_rw_i@count): TypeStruct 6(int) 35: TypePointer Uniform 34(sbuf_rw_i@count) 36(sbuf_rw_i@count): 35(ptr) Variable Uniform - 37: TypePointer Uniform 23(int) - 39: 23(int) Constant 1 - 40: 6(int) Constant 1 -43(sbuf_rw_d@count): 35(ptr) Variable Uniform - 45: 23(int) Constant 4294967295 + 37: TypePointer Uniform 6(int) + 39: 6(int) Constant 1 +42(sbuf_rw_d@count): 35(ptr) Variable Uniform + 44: 6(int) Constant 4294967295 + 46: 23(int) Constant 4294967295 62: TypePointer Input 6(int) 63(pos): 62(ptr) Variable Input 65: TypePointer Output 9(fvec4) @@ -298,26 +298,26 @@ 13: Label 16(result): 15(ptr) Variable Function 33(c1): 7(ptr) Variable Function - 42(c2): 7(ptr) Variable Function + 41(c2): 7(ptr) Variable Function Store 16(result) 18 32: 31(ptr) AccessChain 27(sbuf_rw_nocounter) 24 28 Store 32 30 38: 37(ptr) AccessChain 36(sbuf_rw_i@count) 24 - 41: 6(int) AtomicIAdd 38 40 17 39 - Store 33(c1) 41 - 44: 37(ptr) AccessChain 43(sbuf_rw_d@count) 24 - 46: 6(int) AtomicIAdd 44 40 17 45 - 47: 6(int) IAdd 46 45 - Store 42(c2) 47 + 40: 6(int) AtomicIAdd 38 39 17 39 + Store 33(c1) 40 + 43: 37(ptr) AccessChain 42(sbuf_rw_d@count) 24 + 45: 6(int) AtomicIAdd 43 39 17 44 + 47: 6(int) IAdd 45 46 + Store 41(c2) 47 48: 7(ptr) AccessChain 16(result) 17 49: 6(int) Load 48 50: 8(float) ConvertUToF 49 - 51: 7(ptr) AccessChain 16(result) 40 + 51: 7(ptr) AccessChain 16(result) 39 52: 6(int) Load 51 53: 8(float) ConvertUToF 52 54: 6(int) Load 33(c1) 55: 8(float) ConvertUToF 54 - 56: 6(int) Load 42(c2) + 56: 6(int) Load 41(c2) 57: 8(float) ConvertUToF 56 58: 9(fvec4) CompositeConstruct 50 53 55 57 ReturnValue 58 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -10,8 +10,8 @@ 0:7 move second child to first child ( temp uint) 0:7 'size' ( temp uint) 0:7 array length ( temp uint) -0:7 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:7 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:7 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:7 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:7 Constant: 0:7 0 (const uint) 0:? Sequence @@ -21,23 +21,22 @@ 0:9 'pos' ( in uint) 0:9 Constant: 0:9 2 (const int) -0:9 move second child to first child ( temp float) -0:9 indirect index ( temp float) -0:9 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:9 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:9 move second child to first child ( temp uint) +0:9 indirect index (layout( row_major std430) buffer uint) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:9 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:9 Constant: 0:9 0 (const uint) 0:9 'byteAddrTemp' ( temp int) -0:9 Convert uint to float ( temp float) -0:9 indirect index (layout( row_major std430) buffer uint) -0:9 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:9 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) -0:9 Constant: -0:9 0 (const uint) -0:9 right-shift ( temp int) -0:9 'pos' ( in uint) -0:9 Constant: -0:9 2 (const int) +0:9 indirect index (layout( row_major std430) buffer uint) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:9 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:9 Constant: +0:9 0 (const uint) +0:9 right-shift ( temp int) +0:9 'pos' ( in uint) +0:9 Constant: +0:9 2 (const int) 0:? Sequence 0:10 move second child to first child ( temp int) 0:10 'byteAddrTemp' ( temp int) @@ -45,14 +44,14 @@ 0:10 'pos' ( in uint) 0:10 Constant: 0:10 2 (const int) -0:10 move second child to first child ( temp float) -0:10 indirect index ( temp float) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:10 move second child to first child ( temp uint) +0:10 indirect index (layout( row_major std430) buffer uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 'byteAddrTemp' ( temp int) -0:10 direct index ( temp float) +0:10 direct index ( temp uint) 0:? Sequence 0:10 move second child to first child ( temp int) 0:10 'byteAddrTemp' ( temp int) @@ -61,15 +60,15 @@ 0:10 Constant: 0:10 2 (const int) 0:? Construct vec2 ( temp 2-component vector of uint) -0:10 indirect index ( temp float) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 'byteAddrTemp' ( temp int) -0:10 indirect index ( temp float) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 add ( temp int) @@ -78,17 +77,17 @@ 0:10 1 (const int) 0:10 Constant: 0:10 0 (const int) -0:10 move second child to first child ( temp float) -0:10 indirect index ( temp float) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:10 move second child to first child ( temp uint) +0:10 indirect index (layout( row_major std430) buffer uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 add ( temp int) 0:10 'byteAddrTemp' ( temp int) 0:10 Constant: 0:10 1 (const int) -0:10 direct index ( temp float) +0:10 direct index ( temp uint) 0:? Sequence 0:10 move second child to first child ( temp int) 0:10 'byteAddrTemp' ( temp int) @@ -97,15 +96,15 @@ 0:10 Constant: 0:10 2 (const int) 0:? Construct vec2 ( temp 2-component vector of uint) -0:10 indirect index ( temp float) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 'byteAddrTemp' ( temp int) -0:10 indirect index ( temp float) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 add ( temp int) @@ -121,14 +120,14 @@ 0:11 'pos' ( in uint) 0:11 Constant: 0:11 2 (const int) -0:11 move second child to first child ( temp float) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 move second child to first child ( temp uint) +0:11 indirect index (layout( row_major std430) buffer uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 'byteAddrTemp' ( temp int) -0:11 direct index ( temp float) +0:11 direct index ( temp uint) 0:? Sequence 0:11 move second child to first child ( temp int) 0:11 'byteAddrTemp' ( temp int) @@ -137,24 +136,24 @@ 0:11 Constant: 0:11 2 (const int) 0:? Construct vec3 ( temp 3-component vector of uint) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 'byteAddrTemp' ( temp int) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) 0:11 'byteAddrTemp' ( temp int) 0:11 Constant: 0:11 1 (const int) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) @@ -163,17 +162,17 @@ 0:11 2 (const int) 0:11 Constant: 0:11 0 (const int) -0:11 move second child to first child ( temp float) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 move second child to first child ( temp uint) +0:11 indirect index (layout( row_major std430) buffer uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) 0:11 'byteAddrTemp' ( temp int) 0:11 Constant: 0:11 1 (const int) -0:11 direct index ( temp float) +0:11 direct index ( temp uint) 0:? Sequence 0:11 move second child to first child ( temp int) 0:11 'byteAddrTemp' ( temp int) @@ -182,24 +181,24 @@ 0:11 Constant: 0:11 2 (const int) 0:? Construct vec3 ( temp 3-component vector of uint) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 'byteAddrTemp' ( temp int) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) 0:11 'byteAddrTemp' ( temp int) 0:11 Constant: 0:11 1 (const int) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) @@ -208,17 +207,17 @@ 0:11 2 (const int) 0:11 Constant: 0:11 1 (const int) -0:11 move second child to first child ( temp float) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 move second child to first child ( temp uint) +0:11 indirect index (layout( row_major std430) buffer uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) 0:11 'byteAddrTemp' ( temp int) 0:11 Constant: 0:11 2 (const int) -0:11 direct index ( temp float) +0:11 direct index ( temp uint) 0:? Sequence 0:11 move second child to first child ( temp int) 0:11 'byteAddrTemp' ( temp int) @@ -227,24 +226,24 @@ 0:11 Constant: 0:11 2 (const int) 0:? Construct vec3 ( temp 3-component vector of uint) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 'byteAddrTemp' ( temp int) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) 0:11 'byteAddrTemp' ( temp int) 0:11 Constant: 0:11 1 (const int) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) @@ -260,14 +259,14 @@ 0:12 'pos' ( in uint) 0:12 Constant: 0:12 2 (const int) -0:12 move second child to first child ( temp float) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 move second child to first child ( temp uint) +0:12 indirect index (layout( row_major std430) buffer uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 'byteAddrTemp' ( temp int) -0:12 direct index ( temp float) +0:12 direct index ( temp uint) 0:? Sequence 0:12 move second child to first child ( temp int) 0:12 'byteAddrTemp' ( temp int) @@ -276,33 +275,33 @@ 0:12 Constant: 0:12 2 (const int) 0:? Construct vec4 ( temp 4-component vector of uint) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 'byteAddrTemp' ( temp int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 1 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 2 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) @@ -311,17 +310,17 @@ 0:12 3 (const int) 0:12 Constant: 0:12 0 (const int) -0:12 move second child to first child ( temp float) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 move second child to first child ( temp uint) +0:12 indirect index (layout( row_major std430) buffer uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 1 (const int) -0:12 direct index ( temp float) +0:12 direct index ( temp uint) 0:? Sequence 0:12 move second child to first child ( temp int) 0:12 'byteAddrTemp' ( temp int) @@ -330,33 +329,33 @@ 0:12 Constant: 0:12 2 (const int) 0:? Construct vec4 ( temp 4-component vector of uint) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 'byteAddrTemp' ( temp int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 1 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 2 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) @@ -365,17 +364,17 @@ 0:12 3 (const int) 0:12 Constant: 0:12 1 (const int) -0:12 move second child to first child ( temp float) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 move second child to first child ( temp uint) +0:12 indirect index (layout( row_major std430) buffer uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 2 (const int) -0:12 direct index ( temp float) +0:12 direct index ( temp uint) 0:? Sequence 0:12 move second child to first child ( temp int) 0:12 'byteAddrTemp' ( temp int) @@ -384,33 +383,33 @@ 0:12 Constant: 0:12 2 (const int) 0:? Construct vec4 ( temp 4-component vector of uint) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 'byteAddrTemp' ( temp int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 1 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 2 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) @@ -419,17 +418,17 @@ 0:12 3 (const int) 0:12 Constant: 0:12 2 (const int) -0:12 move second child to first child ( temp float) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 move second child to first child ( temp uint) +0:12 indirect index (layout( row_major std430) buffer uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 3 (const int) -0:12 direct index ( temp float) +0:12 direct index ( temp uint) 0:? Sequence 0:12 move second child to first child ( temp int) 0:12 'byteAddrTemp' ( temp int) @@ -438,33 +437,33 @@ 0:12 Constant: 0:12 2 (const int) 0:? Construct vec4 ( temp 4-component vector of uint) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 'byteAddrTemp' ( temp int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 1 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 2 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) @@ -477,8 +476,8 @@ 0:14 Construct vec4 ( temp 4-component vector of float) 0:14 Convert uint to float ( temp float) 0:14 indirect index (layout( row_major std430) buffer uint) -0:14 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:14 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:14 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:14 Constant: 0:14 0 (const uint) 0:14 right-shift ( temp int) @@ -496,7 +495,7 @@ 0:5 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:? 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) @@ -515,8 +514,8 @@ 0:7 move second child to first child ( temp uint) 0:7 'size' ( temp uint) 0:7 array length ( temp uint) -0:7 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:7 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:7 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:7 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:7 Constant: 0:7 0 (const uint) 0:? Sequence @@ -526,23 +525,22 @@ 0:9 'pos' ( in uint) 0:9 Constant: 0:9 2 (const int) -0:9 move second child to first child ( temp float) -0:9 indirect index ( temp float) -0:9 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:9 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:9 move second child to first child ( temp uint) +0:9 indirect index (layout( row_major std430) buffer uint) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:9 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:9 Constant: 0:9 0 (const uint) 0:9 'byteAddrTemp' ( temp int) -0:9 Convert uint to float ( temp float) -0:9 indirect index (layout( row_major std430) buffer uint) -0:9 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:9 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) -0:9 Constant: -0:9 0 (const uint) -0:9 right-shift ( temp int) -0:9 'pos' ( in uint) -0:9 Constant: -0:9 2 (const int) +0:9 indirect index (layout( row_major std430) buffer uint) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:9 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:9 Constant: +0:9 0 (const uint) +0:9 right-shift ( temp int) +0:9 'pos' ( in uint) +0:9 Constant: +0:9 2 (const int) 0:? Sequence 0:10 move second child to first child ( temp int) 0:10 'byteAddrTemp' ( temp int) @@ -550,14 +548,14 @@ 0:10 'pos' ( in uint) 0:10 Constant: 0:10 2 (const int) -0:10 move second child to first child ( temp float) -0:10 indirect index ( temp float) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:10 move second child to first child ( temp uint) +0:10 indirect index (layout( row_major std430) buffer uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 'byteAddrTemp' ( temp int) -0:10 direct index ( temp float) +0:10 direct index ( temp uint) 0:? Sequence 0:10 move second child to first child ( temp int) 0:10 'byteAddrTemp' ( temp int) @@ -566,15 +564,15 @@ 0:10 Constant: 0:10 2 (const int) 0:? Construct vec2 ( temp 2-component vector of uint) -0:10 indirect index ( temp float) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 'byteAddrTemp' ( temp int) -0:10 indirect index ( temp float) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 add ( temp int) @@ -583,17 +581,17 @@ 0:10 1 (const int) 0:10 Constant: 0:10 0 (const int) -0:10 move second child to first child ( temp float) -0:10 indirect index ( temp float) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:10 move second child to first child ( temp uint) +0:10 indirect index (layout( row_major std430) buffer uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 add ( temp int) 0:10 'byteAddrTemp' ( temp int) 0:10 Constant: 0:10 1 (const int) -0:10 direct index ( temp float) +0:10 direct index ( temp uint) 0:? Sequence 0:10 move second child to first child ( temp int) 0:10 'byteAddrTemp' ( temp int) @@ -602,15 +600,15 @@ 0:10 Constant: 0:10 2 (const int) 0:? Construct vec2 ( temp 2-component vector of uint) -0:10 indirect index ( temp float) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 'byteAddrTemp' ( temp int) -0:10 indirect index ( temp float) -0:10 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:10 Constant: 0:10 0 (const uint) 0:10 add ( temp int) @@ -626,14 +624,14 @@ 0:11 'pos' ( in uint) 0:11 Constant: 0:11 2 (const int) -0:11 move second child to first child ( temp float) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 move second child to first child ( temp uint) +0:11 indirect index (layout( row_major std430) buffer uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 'byteAddrTemp' ( temp int) -0:11 direct index ( temp float) +0:11 direct index ( temp uint) 0:? Sequence 0:11 move second child to first child ( temp int) 0:11 'byteAddrTemp' ( temp int) @@ -642,24 +640,24 @@ 0:11 Constant: 0:11 2 (const int) 0:? Construct vec3 ( temp 3-component vector of uint) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 'byteAddrTemp' ( temp int) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) 0:11 'byteAddrTemp' ( temp int) 0:11 Constant: 0:11 1 (const int) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) @@ -668,17 +666,17 @@ 0:11 2 (const int) 0:11 Constant: 0:11 0 (const int) -0:11 move second child to first child ( temp float) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 move second child to first child ( temp uint) +0:11 indirect index (layout( row_major std430) buffer uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) 0:11 'byteAddrTemp' ( temp int) 0:11 Constant: 0:11 1 (const int) -0:11 direct index ( temp float) +0:11 direct index ( temp uint) 0:? Sequence 0:11 move second child to first child ( temp int) 0:11 'byteAddrTemp' ( temp int) @@ -687,24 +685,24 @@ 0:11 Constant: 0:11 2 (const int) 0:? Construct vec3 ( temp 3-component vector of uint) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 'byteAddrTemp' ( temp int) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) 0:11 'byteAddrTemp' ( temp int) 0:11 Constant: 0:11 1 (const int) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) @@ -713,17 +711,17 @@ 0:11 2 (const int) 0:11 Constant: 0:11 1 (const int) -0:11 move second child to first child ( temp float) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 move second child to first child ( temp uint) +0:11 indirect index (layout( row_major std430) buffer uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) 0:11 'byteAddrTemp' ( temp int) 0:11 Constant: 0:11 2 (const int) -0:11 direct index ( temp float) +0:11 direct index ( temp uint) 0:? Sequence 0:11 move second child to first child ( temp int) 0:11 'byteAddrTemp' ( temp int) @@ -732,24 +730,24 @@ 0:11 Constant: 0:11 2 (const int) 0:? Construct vec3 ( temp 3-component vector of uint) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 'byteAddrTemp' ( temp int) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) 0:11 'byteAddrTemp' ( temp int) 0:11 Constant: 0:11 1 (const int) -0:11 indirect index ( temp float) -0:11 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:11 Constant: 0:11 0 (const uint) 0:11 add ( temp int) @@ -765,14 +763,14 @@ 0:12 'pos' ( in uint) 0:12 Constant: 0:12 2 (const int) -0:12 move second child to first child ( temp float) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 move second child to first child ( temp uint) +0:12 indirect index (layout( row_major std430) buffer uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 'byteAddrTemp' ( temp int) -0:12 direct index ( temp float) +0:12 direct index ( temp uint) 0:? Sequence 0:12 move second child to first child ( temp int) 0:12 'byteAddrTemp' ( temp int) @@ -781,33 +779,33 @@ 0:12 Constant: 0:12 2 (const int) 0:? Construct vec4 ( temp 4-component vector of uint) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 'byteAddrTemp' ( temp int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 1 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 2 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) @@ -816,17 +814,17 @@ 0:12 3 (const int) 0:12 Constant: 0:12 0 (const int) -0:12 move second child to first child ( temp float) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 move second child to first child ( temp uint) +0:12 indirect index (layout( row_major std430) buffer uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 1 (const int) -0:12 direct index ( temp float) +0:12 direct index ( temp uint) 0:? Sequence 0:12 move second child to first child ( temp int) 0:12 'byteAddrTemp' ( temp int) @@ -835,33 +833,33 @@ 0:12 Constant: 0:12 2 (const int) 0:? Construct vec4 ( temp 4-component vector of uint) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 'byteAddrTemp' ( temp int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 1 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 2 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) @@ -870,17 +868,17 @@ 0:12 3 (const int) 0:12 Constant: 0:12 1 (const int) -0:12 move second child to first child ( temp float) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 move second child to first child ( temp uint) +0:12 indirect index (layout( row_major std430) buffer uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 2 (const int) -0:12 direct index ( temp float) +0:12 direct index ( temp uint) 0:? Sequence 0:12 move second child to first child ( temp int) 0:12 'byteAddrTemp' ( temp int) @@ -889,33 +887,33 @@ 0:12 Constant: 0:12 2 (const int) 0:? Construct vec4 ( temp 4-component vector of uint) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 'byteAddrTemp' ( temp int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 1 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 2 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) @@ -924,17 +922,17 @@ 0:12 3 (const int) 0:12 Constant: 0:12 2 (const int) -0:12 move second child to first child ( temp float) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 move second child to first child ( temp uint) +0:12 indirect index (layout( row_major std430) buffer uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 3 (const int) -0:12 direct index ( temp float) +0:12 direct index ( temp uint) 0:? Sequence 0:12 move second child to first child ( temp int) 0:12 'byteAddrTemp' ( temp int) @@ -943,33 +941,33 @@ 0:12 Constant: 0:12 2 (const int) 0:? Construct vec4 ( temp 4-component vector of uint) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 'byteAddrTemp' ( temp int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 1 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) 0:12 'byteAddrTemp' ( temp int) 0:12 Constant: 0:12 2 (const int) -0:12 indirect index ( temp float) -0:12 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:12 Constant: 0:12 0 (const uint) 0:12 add ( temp int) @@ -982,8 +980,8 @@ 0:14 Construct vec4 ( temp 4-component vector of float) 0:14 Convert uint to float ( temp float) 0:14 indirect index (layout( row_major std430) buffer uint) -0:14 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint) -0:14 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:14 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:14 Constant: 0:14 0 (const uint) 0:14 right-shift ( temp int) @@ -1001,18 +999,18 @@ 0:5 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data}) +0:? 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 240 +// Generated by (magic number): 80006 +// Id's are bound by 239 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 233 236 + EntryPoint Fragment 4 "main" 232 235 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" @@ -1023,23 +1021,23 @@ MemberName 16(sbuf) 0 "@data" Name 18 "sbuf" Name 22 "byteAddrTemp" - Name 35 "byteAddrTemp" - Name 39 "byteAddrTemp" - Name 70 "byteAddrTemp" - Name 74 "byteAddrTemp" - Name 129 "byteAddrTemp" - Name 133 "byteAddrTemp" - Name 231 "pos" - Name 233 "pos" - Name 236 "@entryPointOutput" - Name 237 "param" + Name 34 "byteAddrTemp" + Name 38 "byteAddrTemp" + Name 69 "byteAddrTemp" + Name 73 "byteAddrTemp" + Name 128 "byteAddrTemp" + Name 132 "byteAddrTemp" + Name 230 "pos" + Name 232 "pos" + Name 235 "@entryPointOutput" + Name 236 "param" Decorate 15 ArrayStride 4 MemberDecorate 16(sbuf) 0 Offset 0 Decorate 16(sbuf) BufferBlock Decorate 18(sbuf) DescriptorSet 0 - Decorate 233(pos) Flat - Decorate 233(pos) Location 0 - Decorate 236(@entryPointOutput) Location 0 + Decorate 232(pos) Flat + Decorate 232(pos) Location 0 + Decorate 235(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 @@ -1056,29 +1054,29 @@ 24: 19(int) Constant 2 26: 19(int) Constant 0 30: TypePointer Uniform 6(int) - 46: 19(int) Constant 1 - 50: TypeVector 6(int) 2 - 52: 6(int) Constant 0 - 67: 6(int) Constant 1 - 88: TypeVector 6(int) 3 - 126: 6(int) Constant 2 - 148: 19(int) Constant 3 - 152: TypeVector 6(int) 4 - 220: 6(int) Constant 3 - 232: TypePointer Input 6(int) - 233(pos): 232(ptr) Variable Input - 235: TypePointer Output 9(fvec4) -236(@entryPointOutput): 235(ptr) Variable Output + 45: 19(int) Constant 1 + 49: TypeVector 6(int) 2 + 51: 6(int) Constant 0 + 66: 6(int) Constant 1 + 87: TypeVector 6(int) 3 + 125: 6(int) Constant 2 + 147: 19(int) Constant 3 + 151: TypeVector 6(int) 4 + 219: 6(int) Constant 3 + 231: TypePointer Input 6(int) + 232(pos): 231(ptr) Variable Input + 234: TypePointer Output 9(fvec4) +235(@entryPointOutput): 234(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 231(pos): 7(ptr) Variable Function - 237(param): 7(ptr) Variable Function - 234: 6(int) Load 233(pos) - Store 231(pos) 234 - 238: 6(int) Load 231(pos) - Store 237(param) 238 - 239: 9(fvec4) FunctionCall 12(@main(u1;) 237(param) - Store 236(@entryPointOutput) 239 + 230(pos): 7(ptr) Variable Function + 236(param): 7(ptr) Variable Function + 233: 6(int) Load 232(pos) + Store 230(pos) 233 + 237: 6(int) Load 230(pos) + Store 236(param) 237 + 238: 9(fvec4) FunctionCall 12(@main(u1;) 236(param) + Store 235(@entryPointOutput) 238 Return FunctionEnd 12(@main(u1;): 9(fvec4) Function None 10 @@ -1086,12 +1084,12 @@ 13: Label 14(size): 7(ptr) Variable Function 22(byteAddrTemp): 21(ptr) Variable Function -35(byteAddrTemp): 21(ptr) Variable Function -39(byteAddrTemp): 21(ptr) Variable Function -70(byteAddrTemp): 21(ptr) Variable Function -74(byteAddrTemp): 21(ptr) Variable Function -129(byteAddrTemp): 21(ptr) Variable Function -133(byteAddrTemp): 21(ptr) Variable Function +34(byteAddrTemp): 21(ptr) Variable Function +38(byteAddrTemp): 21(ptr) Variable Function +69(byteAddrTemp): 21(ptr) Variable Function +73(byteAddrTemp): 21(ptr) Variable Function +128(byteAddrTemp): 21(ptr) Variable Function +132(byteAddrTemp): 21(ptr) Variable Function 20: 19(int) ArrayLength 18(sbuf) 0 Store 14(size) 20 23: 6(int) Load 11(pos) @@ -1102,208 +1100,207 @@ 29: 19(int) ShiftRightLogical 28 24 31: 30(ptr) AccessChain 18(sbuf) 26 29 32: 6(int) Load 31 - 33: 8(float) ConvertUToF 32 - 34: 30(ptr) AccessChain 18(sbuf) 26 27 - Store 34 33 - 36: 6(int) Load 11(pos) - 37: 19(int) ShiftRightLogical 36 24 - Store 35(byteAddrTemp) 37 - 38: 19(int) Load 35(byteAddrTemp) - 40: 6(int) Load 11(pos) - 41: 19(int) ShiftRightLogical 40 24 - Store 39(byteAddrTemp) 41 - 42: 19(int) Load 39(byteAddrTemp) - 43: 30(ptr) AccessChain 18(sbuf) 26 42 - 44: 6(int) Load 43 - 45: 19(int) Load 39(byteAddrTemp) - 47: 19(int) IAdd 45 46 - 48: 30(ptr) AccessChain 18(sbuf) 26 47 - 49: 6(int) Load 48 - 51: 50(ivec2) CompositeConstruct 44 49 - 53: 6(int) CompositeExtract 51 0 - 54: 30(ptr) AccessChain 18(sbuf) 26 38 - Store 54 53 - 55: 19(int) Load 35(byteAddrTemp) - 56: 19(int) IAdd 55 46 - 57: 6(int) Load 11(pos) - 58: 19(int) ShiftRightLogical 57 24 - Store 39(byteAddrTemp) 58 - 59: 19(int) Load 39(byteAddrTemp) - 60: 30(ptr) AccessChain 18(sbuf) 26 59 - 61: 6(int) Load 60 - 62: 19(int) Load 39(byteAddrTemp) - 63: 19(int) IAdd 62 46 - 64: 30(ptr) AccessChain 18(sbuf) 26 63 - 65: 6(int) Load 64 - 66: 50(ivec2) CompositeConstruct 61 65 - 68: 6(int) CompositeExtract 66 1 - 69: 30(ptr) AccessChain 18(sbuf) 26 56 - Store 69 68 - 71: 6(int) Load 11(pos) - 72: 19(int) ShiftRightLogical 71 24 - Store 70(byteAddrTemp) 72 - 73: 19(int) Load 70(byteAddrTemp) - 75: 6(int) Load 11(pos) - 76: 19(int) ShiftRightLogical 75 24 - Store 74(byteAddrTemp) 76 - 77: 19(int) Load 74(byteAddrTemp) - 78: 30(ptr) AccessChain 18(sbuf) 26 77 - 79: 6(int) Load 78 - 80: 19(int) Load 74(byteAddrTemp) - 81: 19(int) IAdd 80 46 - 82: 30(ptr) AccessChain 18(sbuf) 26 81 - 83: 6(int) Load 82 - 84: 19(int) Load 74(byteAddrTemp) - 85: 19(int) IAdd 84 24 - 86: 30(ptr) AccessChain 18(sbuf) 26 85 - 87: 6(int) Load 86 - 89: 88(ivec3) CompositeConstruct 79 83 87 - 90: 6(int) CompositeExtract 89 0 - 91: 30(ptr) AccessChain 18(sbuf) 26 73 - Store 91 90 - 92: 19(int) Load 70(byteAddrTemp) - 93: 19(int) IAdd 92 46 - 94: 6(int) Load 11(pos) - 95: 19(int) ShiftRightLogical 94 24 - Store 74(byteAddrTemp) 95 - 96: 19(int) Load 74(byteAddrTemp) - 97: 30(ptr) AccessChain 18(sbuf) 26 96 - 98: 6(int) Load 97 - 99: 19(int) Load 74(byteAddrTemp) - 100: 19(int) IAdd 99 46 - 101: 30(ptr) AccessChain 18(sbuf) 26 100 - 102: 6(int) Load 101 - 103: 19(int) Load 74(byteAddrTemp) - 104: 19(int) IAdd 103 24 - 105: 30(ptr) AccessChain 18(sbuf) 26 104 - 106: 6(int) Load 105 - 107: 88(ivec3) CompositeConstruct 98 102 106 - 108: 6(int) CompositeExtract 107 1 - 109: 30(ptr) AccessChain 18(sbuf) 26 93 - Store 109 108 - 110: 19(int) Load 70(byteAddrTemp) - 111: 19(int) IAdd 110 24 - 112: 6(int) Load 11(pos) - 113: 19(int) ShiftRightLogical 112 24 - Store 74(byteAddrTemp) 113 - 114: 19(int) Load 74(byteAddrTemp) - 115: 30(ptr) AccessChain 18(sbuf) 26 114 - 116: 6(int) Load 115 - 117: 19(int) Load 74(byteAddrTemp) - 118: 19(int) IAdd 117 46 - 119: 30(ptr) AccessChain 18(sbuf) 26 118 - 120: 6(int) Load 119 - 121: 19(int) Load 74(byteAddrTemp) - 122: 19(int) IAdd 121 24 - 123: 30(ptr) AccessChain 18(sbuf) 26 122 - 124: 6(int) Load 123 - 125: 88(ivec3) CompositeConstruct 116 120 124 - 127: 6(int) CompositeExtract 125 2 - 128: 30(ptr) AccessChain 18(sbuf) 26 111 - Store 128 127 - 130: 6(int) Load 11(pos) - 131: 19(int) ShiftRightLogical 130 24 - Store 129(byteAddrTemp) 131 - 132: 19(int) Load 129(byteAddrTemp) - 134: 6(int) Load 11(pos) - 135: 19(int) ShiftRightLogical 134 24 - Store 133(byteAddrTemp) 135 - 136: 19(int) Load 133(byteAddrTemp) - 137: 30(ptr) AccessChain 18(sbuf) 26 136 - 138: 6(int) Load 137 - 139: 19(int) Load 133(byteAddrTemp) - 140: 19(int) IAdd 139 46 - 141: 30(ptr) AccessChain 18(sbuf) 26 140 - 142: 6(int) Load 141 - 143: 19(int) Load 133(byteAddrTemp) - 144: 19(int) IAdd 143 24 - 145: 30(ptr) AccessChain 18(sbuf) 26 144 - 146: 6(int) Load 145 - 147: 19(int) Load 133(byteAddrTemp) - 149: 19(int) IAdd 147 148 - 150: 30(ptr) AccessChain 18(sbuf) 26 149 - 151: 6(int) Load 150 - 153: 152(ivec4) CompositeConstruct 138 142 146 151 - 154: 6(int) CompositeExtract 153 0 - 155: 30(ptr) AccessChain 18(sbuf) 26 132 - Store 155 154 - 156: 19(int) Load 129(byteAddrTemp) - 157: 19(int) IAdd 156 46 - 158: 6(int) Load 11(pos) - 159: 19(int) ShiftRightLogical 158 24 - Store 133(byteAddrTemp) 159 - 160: 19(int) Load 133(byteAddrTemp) - 161: 30(ptr) AccessChain 18(sbuf) 26 160 - 162: 6(int) Load 161 - 163: 19(int) Load 133(byteAddrTemp) - 164: 19(int) IAdd 163 46 - 165: 30(ptr) AccessChain 18(sbuf) 26 164 - 166: 6(int) Load 165 - 167: 19(int) Load 133(byteAddrTemp) - 168: 19(int) IAdd 167 24 - 169: 30(ptr) AccessChain 18(sbuf) 26 168 - 170: 6(int) Load 169 - 171: 19(int) Load 133(byteAddrTemp) - 172: 19(int) IAdd 171 148 - 173: 30(ptr) AccessChain 18(sbuf) 26 172 - 174: 6(int) Load 173 - 175: 152(ivec4) CompositeConstruct 162 166 170 174 - 176: 6(int) CompositeExtract 175 1 - 177: 30(ptr) AccessChain 18(sbuf) 26 157 - Store 177 176 - 178: 19(int) Load 129(byteAddrTemp) - 179: 19(int) IAdd 178 24 - 180: 6(int) Load 11(pos) - 181: 19(int) ShiftRightLogical 180 24 - Store 133(byteAddrTemp) 181 - 182: 19(int) Load 133(byteAddrTemp) - 183: 30(ptr) AccessChain 18(sbuf) 26 182 - 184: 6(int) Load 183 - 185: 19(int) Load 133(byteAddrTemp) - 186: 19(int) IAdd 185 46 - 187: 30(ptr) AccessChain 18(sbuf) 26 186 - 188: 6(int) Load 187 - 189: 19(int) Load 133(byteAddrTemp) - 190: 19(int) IAdd 189 24 - 191: 30(ptr) AccessChain 18(sbuf) 26 190 - 192: 6(int) Load 191 - 193: 19(int) Load 133(byteAddrTemp) - 194: 19(int) IAdd 193 148 - 195: 30(ptr) AccessChain 18(sbuf) 26 194 - 196: 6(int) Load 195 - 197: 152(ivec4) CompositeConstruct 184 188 192 196 - 198: 6(int) CompositeExtract 197 2 - 199: 30(ptr) AccessChain 18(sbuf) 26 179 - Store 199 198 - 200: 19(int) Load 129(byteAddrTemp) - 201: 19(int) IAdd 200 148 - 202: 6(int) Load 11(pos) - 203: 19(int) ShiftRightLogical 202 24 - Store 133(byteAddrTemp) 203 - 204: 19(int) Load 133(byteAddrTemp) - 205: 30(ptr) AccessChain 18(sbuf) 26 204 - 206: 6(int) Load 205 - 207: 19(int) Load 133(byteAddrTemp) - 208: 19(int) IAdd 207 46 - 209: 30(ptr) AccessChain 18(sbuf) 26 208 - 210: 6(int) Load 209 - 211: 19(int) Load 133(byteAddrTemp) - 212: 19(int) IAdd 211 24 - 213: 30(ptr) AccessChain 18(sbuf) 26 212 - 214: 6(int) Load 213 - 215: 19(int) Load 133(byteAddrTemp) - 216: 19(int) IAdd 215 148 - 217: 30(ptr) AccessChain 18(sbuf) 26 216 - 218: 6(int) Load 217 - 219: 152(ivec4) CompositeConstruct 206 210 214 218 - 221: 6(int) CompositeExtract 219 3 - 222: 30(ptr) AccessChain 18(sbuf) 26 201 - Store 222 221 - 223: 6(int) Load 11(pos) - 224: 19(int) ShiftRightLogical 223 24 - 225: 30(ptr) AccessChain 18(sbuf) 26 224 - 226: 6(int) Load 225 - 227: 8(float) ConvertUToF 226 - 228: 9(fvec4) CompositeConstruct 227 227 227 227 - ReturnValue 228 + 33: 30(ptr) AccessChain 18(sbuf) 26 27 + Store 33 32 + 35: 6(int) Load 11(pos) + 36: 19(int) ShiftRightLogical 35 24 + Store 34(byteAddrTemp) 36 + 37: 19(int) Load 34(byteAddrTemp) + 39: 6(int) Load 11(pos) + 40: 19(int) ShiftRightLogical 39 24 + Store 38(byteAddrTemp) 40 + 41: 19(int) Load 38(byteAddrTemp) + 42: 30(ptr) AccessChain 18(sbuf) 26 41 + 43: 6(int) Load 42 + 44: 19(int) Load 38(byteAddrTemp) + 46: 19(int) IAdd 44 45 + 47: 30(ptr) AccessChain 18(sbuf) 26 46 + 48: 6(int) Load 47 + 50: 49(ivec2) CompositeConstruct 43 48 + 52: 6(int) CompositeExtract 50 0 + 53: 30(ptr) AccessChain 18(sbuf) 26 37 + Store 53 52 + 54: 19(int) Load 34(byteAddrTemp) + 55: 19(int) IAdd 54 45 + 56: 6(int) Load 11(pos) + 57: 19(int) ShiftRightLogical 56 24 + Store 38(byteAddrTemp) 57 + 58: 19(int) Load 38(byteAddrTemp) + 59: 30(ptr) AccessChain 18(sbuf) 26 58 + 60: 6(int) Load 59 + 61: 19(int) Load 38(byteAddrTemp) + 62: 19(int) IAdd 61 45 + 63: 30(ptr) AccessChain 18(sbuf) 26 62 + 64: 6(int) Load 63 + 65: 49(ivec2) CompositeConstruct 60 64 + 67: 6(int) CompositeExtract 65 1 + 68: 30(ptr) AccessChain 18(sbuf) 26 55 + Store 68 67 + 70: 6(int) Load 11(pos) + 71: 19(int) ShiftRightLogical 70 24 + Store 69(byteAddrTemp) 71 + 72: 19(int) Load 69(byteAddrTemp) + 74: 6(int) Load 11(pos) + 75: 19(int) ShiftRightLogical 74 24 + Store 73(byteAddrTemp) 75 + 76: 19(int) Load 73(byteAddrTemp) + 77: 30(ptr) AccessChain 18(sbuf) 26 76 + 78: 6(int) Load 77 + 79: 19(int) Load 73(byteAddrTemp) + 80: 19(int) IAdd 79 45 + 81: 30(ptr) AccessChain 18(sbuf) 26 80 + 82: 6(int) Load 81 + 83: 19(int) Load 73(byteAddrTemp) + 84: 19(int) IAdd 83 24 + 85: 30(ptr) AccessChain 18(sbuf) 26 84 + 86: 6(int) Load 85 + 88: 87(ivec3) CompositeConstruct 78 82 86 + 89: 6(int) CompositeExtract 88 0 + 90: 30(ptr) AccessChain 18(sbuf) 26 72 + Store 90 89 + 91: 19(int) Load 69(byteAddrTemp) + 92: 19(int) IAdd 91 45 + 93: 6(int) Load 11(pos) + 94: 19(int) ShiftRightLogical 93 24 + Store 73(byteAddrTemp) 94 + 95: 19(int) Load 73(byteAddrTemp) + 96: 30(ptr) AccessChain 18(sbuf) 26 95 + 97: 6(int) Load 96 + 98: 19(int) Load 73(byteAddrTemp) + 99: 19(int) IAdd 98 45 + 100: 30(ptr) AccessChain 18(sbuf) 26 99 + 101: 6(int) Load 100 + 102: 19(int) Load 73(byteAddrTemp) + 103: 19(int) IAdd 102 24 + 104: 30(ptr) AccessChain 18(sbuf) 26 103 + 105: 6(int) Load 104 + 106: 87(ivec3) CompositeConstruct 97 101 105 + 107: 6(int) CompositeExtract 106 1 + 108: 30(ptr) AccessChain 18(sbuf) 26 92 + Store 108 107 + 109: 19(int) Load 69(byteAddrTemp) + 110: 19(int) IAdd 109 24 + 111: 6(int) Load 11(pos) + 112: 19(int) ShiftRightLogical 111 24 + Store 73(byteAddrTemp) 112 + 113: 19(int) Load 73(byteAddrTemp) + 114: 30(ptr) AccessChain 18(sbuf) 26 113 + 115: 6(int) Load 114 + 116: 19(int) Load 73(byteAddrTemp) + 117: 19(int) IAdd 116 45 + 118: 30(ptr) AccessChain 18(sbuf) 26 117 + 119: 6(int) Load 118 + 120: 19(int) Load 73(byteAddrTemp) + 121: 19(int) IAdd 120 24 + 122: 30(ptr) AccessChain 18(sbuf) 26 121 + 123: 6(int) Load 122 + 124: 87(ivec3) CompositeConstruct 115 119 123 + 126: 6(int) CompositeExtract 124 2 + 127: 30(ptr) AccessChain 18(sbuf) 26 110 + Store 127 126 + 129: 6(int) Load 11(pos) + 130: 19(int) ShiftRightLogical 129 24 + Store 128(byteAddrTemp) 130 + 131: 19(int) Load 128(byteAddrTemp) + 133: 6(int) Load 11(pos) + 134: 19(int) ShiftRightLogical 133 24 + Store 132(byteAddrTemp) 134 + 135: 19(int) Load 132(byteAddrTemp) + 136: 30(ptr) AccessChain 18(sbuf) 26 135 + 137: 6(int) Load 136 + 138: 19(int) Load 132(byteAddrTemp) + 139: 19(int) IAdd 138 45 + 140: 30(ptr) AccessChain 18(sbuf) 26 139 + 141: 6(int) Load 140 + 142: 19(int) Load 132(byteAddrTemp) + 143: 19(int) IAdd 142 24 + 144: 30(ptr) AccessChain 18(sbuf) 26 143 + 145: 6(int) Load 144 + 146: 19(int) Load 132(byteAddrTemp) + 148: 19(int) IAdd 146 147 + 149: 30(ptr) AccessChain 18(sbuf) 26 148 + 150: 6(int) Load 149 + 152: 151(ivec4) CompositeConstruct 137 141 145 150 + 153: 6(int) CompositeExtract 152 0 + 154: 30(ptr) AccessChain 18(sbuf) 26 131 + Store 154 153 + 155: 19(int) Load 128(byteAddrTemp) + 156: 19(int) IAdd 155 45 + 157: 6(int) Load 11(pos) + 158: 19(int) ShiftRightLogical 157 24 + Store 132(byteAddrTemp) 158 + 159: 19(int) Load 132(byteAddrTemp) + 160: 30(ptr) AccessChain 18(sbuf) 26 159 + 161: 6(int) Load 160 + 162: 19(int) Load 132(byteAddrTemp) + 163: 19(int) IAdd 162 45 + 164: 30(ptr) AccessChain 18(sbuf) 26 163 + 165: 6(int) Load 164 + 166: 19(int) Load 132(byteAddrTemp) + 167: 19(int) IAdd 166 24 + 168: 30(ptr) AccessChain 18(sbuf) 26 167 + 169: 6(int) Load 168 + 170: 19(int) Load 132(byteAddrTemp) + 171: 19(int) IAdd 170 147 + 172: 30(ptr) AccessChain 18(sbuf) 26 171 + 173: 6(int) Load 172 + 174: 151(ivec4) CompositeConstruct 161 165 169 173 + 175: 6(int) CompositeExtract 174 1 + 176: 30(ptr) AccessChain 18(sbuf) 26 156 + Store 176 175 + 177: 19(int) Load 128(byteAddrTemp) + 178: 19(int) IAdd 177 24 + 179: 6(int) Load 11(pos) + 180: 19(int) ShiftRightLogical 179 24 + Store 132(byteAddrTemp) 180 + 181: 19(int) Load 132(byteAddrTemp) + 182: 30(ptr) AccessChain 18(sbuf) 26 181 + 183: 6(int) Load 182 + 184: 19(int) Load 132(byteAddrTemp) + 185: 19(int) IAdd 184 45 + 186: 30(ptr) AccessChain 18(sbuf) 26 185 + 187: 6(int) Load 186 + 188: 19(int) Load 132(byteAddrTemp) + 189: 19(int) IAdd 188 24 + 190: 30(ptr) AccessChain 18(sbuf) 26 189 + 191: 6(int) Load 190 + 192: 19(int) Load 132(byteAddrTemp) + 193: 19(int) IAdd 192 147 + 194: 30(ptr) AccessChain 18(sbuf) 26 193 + 195: 6(int) Load 194 + 196: 151(ivec4) CompositeConstruct 183 187 191 195 + 197: 6(int) CompositeExtract 196 2 + 198: 30(ptr) AccessChain 18(sbuf) 26 178 + Store 198 197 + 199: 19(int) Load 128(byteAddrTemp) + 200: 19(int) IAdd 199 147 + 201: 6(int) Load 11(pos) + 202: 19(int) ShiftRightLogical 201 24 + Store 132(byteAddrTemp) 202 + 203: 19(int) Load 132(byteAddrTemp) + 204: 30(ptr) AccessChain 18(sbuf) 26 203 + 205: 6(int) Load 204 + 206: 19(int) Load 132(byteAddrTemp) + 207: 19(int) IAdd 206 45 + 208: 30(ptr) AccessChain 18(sbuf) 26 207 + 209: 6(int) Load 208 + 210: 19(int) Load 132(byteAddrTemp) + 211: 19(int) IAdd 210 24 + 212: 30(ptr) AccessChain 18(sbuf) 26 211 + 213: 6(int) Load 212 + 214: 19(int) Load 132(byteAddrTemp) + 215: 19(int) IAdd 214 147 + 216: 30(ptr) AccessChain 18(sbuf) 26 215 + 217: 6(int) Load 216 + 218: 151(ivec4) CompositeConstruct 205 209 213 217 + 220: 6(int) CompositeExtract 218 3 + 221: 30(ptr) AccessChain 18(sbuf) 26 200 + Store 221 220 + 222: 6(int) Load 11(pos) + 223: 19(int) ShiftRightLogical 222 24 + 224: 30(ptr) AccessChain 18(sbuf) 26 223 + 225: 6(int) Load 224 + 226: 8(float) ConvertUToF 225 + 227: 9(fvec4) CompositeConstruct 226 226 226 226 + ReturnValue 227 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -8,8 +8,8 @@ 0:? Sequence 0:13 move second child to first child ( temp float) 0:13 indirect index (layout( row_major std430) buffer float) -0:13 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of float) -0:13 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:13 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:13 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:13 Constant: 0:13 0 (const uint) 0:13 add ( temp uint) @@ -22,8 +22,8 @@ 0:17 move second child to first child ( temp uint) 0:17 'size' ( temp uint) 0:17 array length ( temp uint) -0:17 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test}) -0:17 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:17 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) 0:17 Constant: 0:17 0 (const uint) 0:17 move second child to first child ( temp uint) @@ -34,8 +34,8 @@ 0:19 Condition 0:19 test: direct index for structure ( temp bool) 0:19 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test}) -0:19 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test}) -0:19 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:19 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) 0:19 Constant: 0:19 0 (const uint) 0:19 'pos' ( in uint) @@ -47,16 +47,16 @@ 0:20 add ( temp 3-component vector of float) 0:20 color: direct index for structure ( temp 3-component vector of float) 0:20 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test}) -0:20 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test}) -0:20 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:20 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) 0:20 Constant: 0:20 0 (const uint) 0:20 'pos' ( in uint) 0:20 Constant: 0:20 0 (const int) 0:20 indirect index (layout( row_major std430) buffer float) -0:20 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of float) -0:20 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:20 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:20 Constant: 0:20 0 (const uint) 0:20 'pos' ( in uint) @@ -80,8 +80,8 @@ 0:12 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test} @data}) -0:? 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:? 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:? 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) @@ -98,8 +98,8 @@ 0:? Sequence 0:13 move second child to first child ( temp float) 0:13 indirect index (layout( row_major std430) buffer float) -0:13 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of float) -0:13 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:13 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:13 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:13 Constant: 0:13 0 (const uint) 0:13 add ( temp uint) @@ -112,8 +112,8 @@ 0:17 move second child to first child ( temp uint) 0:17 'size' ( temp uint) 0:17 array length ( temp uint) -0:17 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test}) -0:17 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:17 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) 0:17 Constant: 0:17 0 (const uint) 0:17 move second child to first child ( temp uint) @@ -124,8 +124,8 @@ 0:19 Condition 0:19 test: direct index for structure ( temp bool) 0:19 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test}) -0:19 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test}) -0:19 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:19 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) 0:19 Constant: 0:19 0 (const uint) 0:19 'pos' ( in uint) @@ -137,16 +137,16 @@ 0:20 add ( temp 3-component vector of float) 0:20 color: direct index for structure ( temp 3-component vector of float) 0:20 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test}) -0:20 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test}) -0:20 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:20 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) 0:20 Constant: 0:20 0 (const uint) 0:20 'pos' ( in uint) 0:20 Constant: 0:20 0 (const int) 0:20 indirect index (layout( row_major std430) buffer float) -0:20 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of float) -0:20 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:20 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:20 Constant: 0:20 0 (const uint) 0:20 'pos' ( in uint) @@ -170,13 +170,13 @@ 0:12 Function Call: @main(u1; ( temp 4-component vector of float) 0:? 'pos' ( temp uint) 0:? Linker Objects -0:? 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color, temp bool test} @data}) -0:? 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data}) +0:? 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:? 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 78 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.struct.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.struct.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.struct.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.struct.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -212,7 +212,7 @@ 0:? 's.ff4' (layout( location=7) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 102 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structin.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structin.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structin.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structin.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -340,7 +340,7 @@ 0:? 'e' (layout( location=5) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 94 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structIoFourWay.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structIoFourWay.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structIoFourWay.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structIoFourWay.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -162,7 +162,7 @@ 0:? 't.normal' (layout( location=3) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 65 Capability Shader @@ -171,6 +171,7 @@ EntryPoint Fragment 4 "main" 22 27 31 36 45 48 51 55 ExecutionMode 4 OriginUpperLeft ExecutionMode 4 DepthGreater + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "T" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.struct.split-1.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.struct.split-1.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.struct.split-1.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.struct.split-1.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -196,7 +196,7 @@ 0:? 'Pos_loose' (layout( location=3) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 70 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.struct.split.array.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.struct.split.array.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.struct.split.array.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.struct.split.array.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -160,7 +160,7 @@ 0:? 'OutputStream.VertexID' (layout( location=2) out uint) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 82 Capability Geometry diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -208,7 +208,7 @@ 0:? 'input[2].f' (layout( location=3) in float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 66 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.struct.split.call.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.struct.split.call.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.struct.split.call.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.struct.split.call.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -214,7 +214,7 @@ 0:? 'vsin.x1_in' (layout( location=2) in int) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 77 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.struct.split.nested.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.struct.split.nested.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.struct.split.nested.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.struct.split.nested.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -448,7 +448,7 @@ 0:? 'ts.contains_no_builtin_io.m1' (layout( location=3) out int) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 100 Capability Geometry diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.struct.split.trivial.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.struct.split.trivial.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.struct.split.trivial.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.struct.split.trivial.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -192,7 +192,7 @@ 0:? 'ts.pos' ( out 4-component vector of float Position) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 67 Capability Geometry diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.struct.split.trivial.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.struct.split.trivial.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.struct.split.trivial.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.struct.split.trivial.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -98,7 +98,7 @@ 0:? 'Pos_loose' (layout( location=1) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 45 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structStructName.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structStructName.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.structStructName.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.structStructName.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -44,7 +44,7 @@ 0:? '@entryPointOutput' (layout( location=0) out int) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 22 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.subpass.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.subpass.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.subpass.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.subpass.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -430,7 +430,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 204 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.switch.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.switch.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.switch.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.switch.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -36,7 +36,7 @@ 0:17 Pre-Decrement ( temp 4-component vector of float) 0:17 'input' ( in 4-component vector of float) 0:18 Branch: Break -0:21 switch +0:21 switch: DontFlatten 0:21 condition 0:21 'c' ( in int) 0:21 body @@ -186,7 +186,7 @@ 0:17 Pre-Decrement ( temp 4-component vector of float) 0:17 'input' ( in 4-component vector of float) 0:18 Branch: Break -0:21 switch +0:21 switch: DontFlatten 0:21 condition 0:21 'c' ( in int) 0:21 body @@ -296,7 +296,7 @@ 0:? 'd' (layout( location=2) flat in int) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 106 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.swizzle.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.swizzle.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.swizzle.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.swizzle.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -77,7 +77,7 @@ 0:? 'AmbientColor' ( global 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 30 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.synthesizeInput.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.synthesizeInput.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.synthesizeInput.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.synthesizeInput.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -98,7 +98,7 @@ 0:? 'input.no_interp' (layout( location=1) flat in uint) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 44 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.target.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.target.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.target.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.target.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -114,7 +114,7 @@ 0:? 'out2' (layout( location=3) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 50 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.targetStruct1.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.targetStruct1.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.targetStruct1.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.targetStruct1.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -184,7 +184,7 @@ 0:? 'po' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 65 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.targetStruct2.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.targetStruct2.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.targetStruct2.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.targetStruct2.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -184,7 +184,7 @@ 0:? 'po' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 65 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.templatetypes.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.templatetypes.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.templatetypes.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.templatetypes.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -508,7 +508,7 @@ 0:? '@entryPointOutput' (layout( location=0) out float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 153 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.texturebuffer.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.texturebuffer.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.texturebuffer.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.texturebuffer.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,153 @@ +hlsl.texturebuffer.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:15 Function Parameters: +0:15 'pos' ( in 4-component vector of float) +0:? Sequence +0:16 Branch: Return with expression +0:16 add ( temp 4-component vector of float) +0:16 f: direct index for structure (layout( row_major std430) buffer 4-component vector of float) +0:16 'TextureBuffer_var' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f, layout( row_major std430) buffer 4-component vector of int i}) +0:16 Constant: +0:16 0 (const int) +0:16 f2: direct index for structure (layout( row_major std430) buffer 4-component vector of float) +0:16 'anon@0' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f2, layout( row_major std430) buffer 4-component vector of int i2}) +0:16 Constant: +0:16 0 (const uint) +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:15 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'TextureBuffer_var' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f, layout( row_major std430) buffer 4-component vector of int i}) +0:? 'anon@0' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f2, layout( row_major std430) buffer 4-component vector of int i2}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:15 Function Parameters: +0:15 'pos' ( in 4-component vector of float) +0:? Sequence +0:16 Branch: Return with expression +0:16 add ( temp 4-component vector of float) +0:16 f: direct index for structure (layout( row_major std430) buffer 4-component vector of float) +0:16 'TextureBuffer_var' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f, layout( row_major std430) buffer 4-component vector of int i}) +0:16 Constant: +0:16 0 (const int) +0:16 f2: direct index for structure (layout( row_major std430) buffer 4-component vector of float) +0:16 'anon@0' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f2, layout( row_major std430) buffer 4-component vector of int i2}) +0:16 Constant: +0:16 0 (const uint) +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:15 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'TextureBuffer_var' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f, layout( row_major std430) buffer 4-component vector of int i}) +0:? 'anon@0' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f2, layout( row_major std430) buffer 4-component vector of int i2}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) + +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 39 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 32 35 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vf4;" + Name 10 "pos" + Name 15 "TextureBuffer_var" + MemberName 15(TextureBuffer_var) 0 "f" + MemberName 15(TextureBuffer_var) 1 "i" + Name 17 "TextureBuffer_var" + Name 22 "tbuf2" + MemberName 22(tbuf2) 0 "f2" + MemberName 22(tbuf2) 1 "i2" + Name 24 "" + Name 30 "pos" + Name 32 "pos" + Name 35 "@entryPointOutput" + Name 36 "param" + MemberDecorate 15(TextureBuffer_var) 0 NonWritable + MemberDecorate 15(TextureBuffer_var) 0 Offset 0 + MemberDecorate 15(TextureBuffer_var) 1 NonWritable + MemberDecorate 15(TextureBuffer_var) 1 Offset 16 + Decorate 15(TextureBuffer_var) BufferBlock + Decorate 17(TextureBuffer_var) DescriptorSet 0 + Decorate 17(TextureBuffer_var) Binding 0 + MemberDecorate 22(tbuf2) 0 NonWritable + MemberDecorate 22(tbuf2) 0 Offset 0 + MemberDecorate 22(tbuf2) 1 NonWritable + MemberDecorate 22(tbuf2) 1 Offset 16 + Decorate 22(tbuf2) BufferBlock + Decorate 24 DescriptorSet 0 + Decorate 32(pos) BuiltIn FragCoord + Decorate 35(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 13: TypeInt 32 1 + 14: TypeVector 13(int) 4 +15(TextureBuffer_var): TypeStruct 7(fvec4) 14(ivec4) + 16: TypePointer Uniform 15(TextureBuffer_var) +17(TextureBuffer_var): 16(ptr) Variable Uniform + 18: 13(int) Constant 0 + 19: TypePointer Uniform 7(fvec4) + 22(tbuf2): TypeStruct 7(fvec4) 14(ivec4) + 23: TypePointer Uniform 22(tbuf2) + 24: 23(ptr) Variable Uniform + 31: TypePointer Input 7(fvec4) + 32(pos): 31(ptr) Variable Input + 34: TypePointer Output 7(fvec4) +35(@entryPointOutput): 34(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 30(pos): 8(ptr) Variable Function + 36(param): 8(ptr) Variable Function + 33: 7(fvec4) Load 32(pos) + Store 30(pos) 33 + 37: 7(fvec4) Load 30(pos) + Store 36(param) 37 + 38: 7(fvec4) FunctionCall 11(@main(vf4;) 36(param) + Store 35(@entryPointOutput) 38 + Return + FunctionEnd + 11(@main(vf4;): 7(fvec4) Function None 9 + 10(pos): 8(ptr) FunctionParameter + 12: Label + 20: 19(ptr) AccessChain 17(TextureBuffer_var) 18 + 21: 7(fvec4) Load 20 + 25: 19(ptr) AccessChain 24 18 + 26: 7(fvec4) Load 25 + 27: 7(fvec4) FAdd 21 26 + ReturnValue 27 + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.texture.struct.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.texture.struct.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.texture.struct.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.texture.struct.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -838,7 +838,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 240 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.texture.subvec4.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.texture.subvec4.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.texture.subvec4.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.texture.subvec4.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -356,7 +356,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 130 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.this.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.this.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.this.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.this.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -240,7 +240,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 98 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.tx.bracket.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.tx.bracket.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.tx.bracket.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.tx.bracket.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -422,7 +422,7 @@ 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 188 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.tx.overload.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.tx.overload.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.tx.overload.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.tx.overload.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -134,7 +134,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 73 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.typedef.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.typedef.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.typedef.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.typedef.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -79,7 +79,7 @@ 0:? Linker Objects // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 34 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.typeGraphCopy.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.typeGraphCopy.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.typeGraphCopy.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.typeGraphCopy.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -62,7 +62,7 @@ 0:? '@entryPointOutput' (layout( location=0) out float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 28 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.type.half.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.type.half.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.type.half.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.type.half.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -164,7 +164,7 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 60 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.type.identifier.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.type.identifier.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.type.identifier.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.type.identifier.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -86,7 +86,7 @@ 0:25 'uint' ( temp mediump uint) 0:25 'min16float' ( temp mediump float) 0:25 'min10float' ( temp mediump float) -0:25 Test condition and select ( temp mediump float) +0:25 Test condition and select ( temp mediump float): no shortcircuit 0:25 Condition 0:25 direct index ( temp bool) 0:25 'bool' ( temp 2-element array of bool) @@ -221,7 +221,7 @@ 0:25 'uint' ( temp mediump uint) 0:25 'min16float' ( temp mediump float) 0:25 'min10float' ( temp mediump float) -0:25 Test condition and select ( temp mediump float) +0:25 Test condition and select ( temp mediump float): no shortcircuit 0:25 Condition 0:25 direct index ( temp bool) 0:25 'bool' ( temp 2-element array of bool) @@ -266,13 +266,13 @@ 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 109 +// Generated by (magic number): 80006 +// Id's are bound by 105 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 107 + EntryPoint Fragment 4 "main" 103 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" @@ -289,9 +289,9 @@ Name 56 "foo_t" MemberName 56(foo_t) 0 "float" Name 58 "float" - Name 86 "param" - Name 93 "half2x3" - Name 107 "@entryPointOutput" + Name 82 "param" + Name 89 "half2x3" + Name 103 "@entryPointOutput" Decorate 49(min16float) RelaxedPrecision Decorate 50 RelaxedPrecision Decorate 51 RelaxedPrecision @@ -308,15 +308,14 @@ Decorate 72 RelaxedPrecision Decorate 73 RelaxedPrecision Decorate 74 RelaxedPrecision - Decorate 80 RelaxedPrecision + Decorate 77 RelaxedPrecision + Decorate 78 RelaxedPrecision + Decorate 79 RelaxedPrecision Decorate 81 RelaxedPrecision Decorate 83 RelaxedPrecision Decorate 84 RelaxedPrecision Decorate 85 RelaxedPrecision - Decorate 87 RelaxedPrecision - Decorate 88 RelaxedPrecision - Decorate 89 RelaxedPrecision - Decorate 107(@entryPointOutput) Location 0 + Decorate 103(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -341,16 +340,16 @@ 56(foo_t): TypeStruct 6(float) 57: TypePointer Function 56(foo_t) 59: 6(float) Constant 1109917696 - 90: TypeVector 6(float) 3 - 91: TypeMatrix 90(fvec3) 2 - 92: TypePointer Function 91 - 97: 22(int) Constant 0 - 106: TypePointer Output 12(fvec4) -107(@entryPointOutput): 106(ptr) Variable Output + 86: TypeVector 6(float) 3 + 87: TypeMatrix 86(fvec3) 2 + 88: TypePointer Function 87 + 93: 22(int) Constant 0 + 102: TypePointer Output 12(fvec4) +103(@entryPointOutput): 102(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 108: 12(fvec4) FunctionCall 14(@main() - Store 107(@entryPointOutput) 108 + 104: 12(fvec4) FunctionCall 14(@main() + Store 103(@entryPointOutput) 104 Return FunctionEnd 10(fn(f1;): 6(float) Function None 8 @@ -369,9 +368,8 @@ 52(min10float): 7(ptr) Variable Function 54(half): 7(ptr) Variable Function 58(float): 57(ptr) Variable Function - 75: 7(ptr) Variable Function - 86(param): 7(ptr) Variable Function - 93(half2x3): 92(ptr) Variable Function + 82(param): 7(ptr) Variable Function + 89(half2x3): 88(ptr) Variable Function Store 19(float) 20 27: 6(float) Load 19(float) 29: 21(bool) FOrdNotEqual 27 28 @@ -412,36 +410,27 @@ 72: 6(float) FAdd 70 71 73: 6(float) Load 52(min10float) 74: 6(float) FAdd 72 73 - 76: 37(ptr) AccessChain 26(bool) 40 - 77: 21(bool) Load 76 - SelectionMerge 79 None - BranchConditional 77 78 82 - 78: Label - 80: 33(int) Load 35(int) - 81: 6(float) ConvertSToF 80 - Store 75 81 - Branch 79 - 82: Label - 83: 6(float) Load 19(float) - Store 75 83 - Branch 79 - 79: Label - 84: 6(float) Load 75 - 85: 6(float) FAdd 74 84 - 87: 6(float) Load 19(float) - Store 86(param) 87 - 88: 6(float) FunctionCall 10(fn(f1;) 86(param) - 89: 6(float) FAdd 85 88 - Store 19(float) 89 - 94: 6(float) Load 19(float) + 75: 37(ptr) AccessChain 26(bool) 40 + 76: 21(bool) Load 75 + 77: 33(int) Load 35(int) + 78: 6(float) ConvertSToF 77 + 79: 6(float) Load 19(float) + 80: 6(float) Select 76 78 79 + 81: 6(float) FAdd 74 80 + 83: 6(float) Load 19(float) + Store 82(param) 83 + 84: 6(float) FunctionCall 10(fn(f1;) 82(param) + 85: 6(float) FAdd 81 84 + Store 19(float) 85 + 90: 6(float) Load 19(float) + 91: 6(float) Load 19(float) + 92: 6(float) FMul 90 91 + 94: 7(ptr) AccessChain 89(half2x3) 40 93 + Store 94 92 95: 6(float) Load 19(float) - 96: 6(float) FMul 94 95 - 98: 7(ptr) AccessChain 93(half2x3) 40 97 - Store 98 96 - 99: 6(float) Load 19(float) - 100: 7(ptr) AccessChain 93(half2x3) 40 97 - 101: 6(float) Load 100 - 102: 6(float) FAdd 99 101 - 103: 12(fvec4) CompositeConstruct 102 102 102 102 - ReturnValue 103 + 96: 7(ptr) AccessChain 89(half2x3) 40 93 + 97: 6(float) Load 96 + 98: 6(float) FAdd 95 97 + 99: 12(fvec4) CompositeConstruct 98 98 98 98 + ReturnValue 99 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.void.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.void.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.void.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.void.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -54,7 +54,7 @@ 0:? 'input' (layout( location=0) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 27 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.wavebroadcast.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.wavebroadcast.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.wavebroadcast.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.wavebroadcast.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,2731 @@ +hlsl.wavebroadcast.comp +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:13 Function Definition: @CSMain(vu3; ( temp void) +0:13 Function Parameters: +0:13 'dti' ( in 3-component vector of uint) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 subgroupShuffle ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 13 (const uint) +0:15 move second child to first child ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 subgroupShuffle ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 13 (const uint) +0:16 move second child to first child ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 subgroupShuffle ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 13 (const uint) +0:17 move second child to first child ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 subgroupShuffle ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 13 (const uint) +0:19 move second child to first child ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 subgroupShuffle ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 13 (const uint) +0:20 move second child to first child ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 subgroupShuffle ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 13 (const uint) +0:21 move second child to first child ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 subgroupShuffle ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 13 (const uint) +0:22 move second child to first child ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 subgroupShuffle ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 Constant: +0:22 13 (const uint) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 subgroupShuffle ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 13 (const uint) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 subgroupShuffle ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 13 (const uint) +0:26 move second child to first child ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 subgroupShuffle ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 Constant: +0:26 13 (const uint) +0:27 move second child to first child ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 subgroupShuffle ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Constant: +0:27 13 (const uint) +0:29 move second child to first child ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 subgroupBroadcastFirst ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:30 move second child to first child ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 subgroupBroadcastFirst ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:31 move second child to first child ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 subgroupBroadcastFirst ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:32 move second child to first child ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 subgroupBroadcastFirst ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:34 move second child to first child ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 subgroupBroadcastFirst ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:35 move second child to first child ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 subgroupBroadcastFirst ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:36 move second child to first child ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 subgroupBroadcastFirst ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:37 move second child to first child ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 subgroupBroadcastFirst ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:39 move second child to first child ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 subgroupBroadcastFirst ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:40 move second child to first child ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 subgroupBroadcastFirst ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:41 move second child to first child ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 subgroupBroadcastFirst ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:42 move second child to first child ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 subgroupBroadcastFirst ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:44 move second child to first child ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 subgroupBroadcastFirst ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 subgroupBroadcastFirst ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:46 move second child to first child ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 subgroupBroadcastFirst ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 subgroupBroadcastFirst ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:49 move second child to first child ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 subgroupBroadcastFirst ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:50 move second child to first child ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 subgroupBroadcastFirst ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:51 move second child to first child ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 subgroupBroadcastFirst ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:52 move second child to first child ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 subgroupBroadcastFirst ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:13 Function Definition: CSMain( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:13 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:13 Function Definition: @CSMain(vu3; ( temp void) +0:13 Function Parameters: +0:13 'dti' ( in 3-component vector of uint) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 subgroupShuffle ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 13 (const uint) +0:15 move second child to first child ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 subgroupShuffle ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 13 (const uint) +0:16 move second child to first child ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 subgroupShuffle ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 13 (const uint) +0:17 move second child to first child ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 subgroupShuffle ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 13 (const uint) +0:19 move second child to first child ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 subgroupShuffle ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 13 (const uint) +0:20 move second child to first child ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 subgroupShuffle ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 13 (const uint) +0:21 move second child to first child ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 subgroupShuffle ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 13 (const uint) +0:22 move second child to first child ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 subgroupShuffle ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 Constant: +0:22 13 (const uint) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 subgroupShuffle ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 13 (const uint) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 subgroupShuffle ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 13 (const uint) +0:26 move second child to first child ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 subgroupShuffle ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 Constant: +0:26 13 (const uint) +0:27 move second child to first child ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 subgroupShuffle ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Constant: +0:27 13 (const uint) +0:29 move second child to first child ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 subgroupBroadcastFirst ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:30 move second child to first child ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 subgroupBroadcastFirst ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:31 move second child to first child ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 subgroupBroadcastFirst ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:32 move second child to first child ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 subgroupBroadcastFirst ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:34 move second child to first child ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 subgroupBroadcastFirst ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:35 move second child to first child ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 subgroupBroadcastFirst ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:36 move second child to first child ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 subgroupBroadcastFirst ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:37 move second child to first child ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 subgroupBroadcastFirst ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:39 move second child to first child ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 subgroupBroadcastFirst ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:40 move second child to first child ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 subgroupBroadcastFirst ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:41 move second child to first child ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 subgroupBroadcastFirst ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:42 move second child to first child ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 subgroupBroadcastFirst ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:44 move second child to first child ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 subgroupBroadcastFirst ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 subgroupBroadcastFirst ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:46 move second child to first child ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 subgroupBroadcastFirst ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 subgroupBroadcastFirst ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:49 move second child to first child ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 subgroupBroadcastFirst ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:50 move second child to first child ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 subgroupBroadcastFirst ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:51 move second child to first child ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 subgroupBroadcastFirst ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:52 move second child to first child ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 subgroupBroadcastFirst ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:13 Function Definition: CSMain( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:13 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 359 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformBallot + Capability GroupNonUniformShuffle + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "CSMain" 354 + ExecutionMode 4 LocalSize 32 16 1 + Source HLSL 500 + Name 4 "CSMain" + Name 11 "@CSMain(vu3;" + Name 10 "dti" + Name 20 "Types" + MemberName 20(Types) 0 "u" + MemberName 20(Types) 1 "i" + MemberName 20(Types) 2 "f" + MemberName 20(Types) 3 "d" + Name 22 "data" + MemberName 22(data) 0 "@data" + Name 24 "data" + Name 352 "dti" + Name 354 "dti" + Name 356 "param" + MemberDecorate 20(Types) 0 Offset 0 + MemberDecorate 20(Types) 1 Offset 16 + MemberDecorate 20(Types) 2 Offset 32 + MemberDecorate 20(Types) 3 Offset 64 + Decorate 21 ArrayStride 96 + MemberDecorate 22(data) 0 Offset 0 + Decorate 22(data) BufferBlock + Decorate 24(data) DescriptorSet 0 + Decorate 354(dti) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 13: TypeVector 6(int) 4 + 14: TypeInt 32 1 + 15: TypeVector 14(int) 4 + 16: TypeFloat 32 + 17: TypeVector 16(float) 4 + 18: TypeFloat 64 + 19: TypeVector 18(float) 4 + 20(Types): TypeStruct 13(ivec4) 15(ivec4) 17(fvec4) 19(fvec4) + 21: TypeRuntimeArray 20(Types) + 22(data): TypeStruct 21 + 23: TypePointer Uniform 22(data) + 24(data): 23(ptr) Variable Uniform + 25: 14(int) Constant 0 + 26: 6(int) Constant 0 + 27: TypePointer Function 6(int) + 32: TypePointer Uniform 13(ivec4) + 35: 6(int) Constant 13 + 36: 6(int) Constant 3 + 43: TypePointer Uniform 6(int) + 52: TypeVector 6(int) 2 + 73: 14(int) Constant 1 + 76: TypePointer Uniform 15(ivec4) + 85: TypePointer Uniform 14(int) + 94: TypeVector 14(int) 2 + 106: TypeVector 14(int) 3 + 116: 14(int) Constant 2 + 119: TypePointer Uniform 17(fvec4) + 128: TypePointer Uniform 16(float) + 137: TypeVector 16(float) 2 + 149: TypeVector 16(float) 3 + 159: 14(int) Constant 3 + 162: TypePointer Uniform 19(fvec4) + 171: TypePointer Uniform 18(float) + 180: TypeVector 18(float) 2 + 192: TypeVector 18(float) 3 + 353: TypePointer Input 7(ivec3) + 354(dti): 353(ptr) Variable Input + 4(CSMain): 2 Function None 3 + 5: Label + 352(dti): 8(ptr) Variable Function + 356(param): 8(ptr) Variable Function + 355: 7(ivec3) Load 354(dti) + Store 352(dti) 355 + 357: 7(ivec3) Load 352(dti) + Store 356(param) 357 + 358: 2 FunctionCall 11(@CSMain(vu3;) 356(param) + Return + FunctionEnd +11(@CSMain(vu3;): 2 Function None 9 + 10(dti): 8(ptr) FunctionParameter + 12: Label + 28: 27(ptr) AccessChain 10(dti) 26 + 29: 6(int) Load 28 + 30: 27(ptr) AccessChain 10(dti) 26 + 31: 6(int) Load 30 + 33: 32(ptr) AccessChain 24(data) 25 31 25 + 34: 13(ivec4) Load 33 + 37: 13(ivec4) GroupNonUniformShuffle 36 34 35 + 38: 32(ptr) AccessChain 24(data) 25 29 25 + Store 38 37 + 39: 27(ptr) AccessChain 10(dti) 26 + 40: 6(int) Load 39 + 41: 27(ptr) AccessChain 10(dti) 26 + 42: 6(int) Load 41 + 44: 43(ptr) AccessChain 24(data) 25 42 25 26 + 45: 6(int) Load 44 + 46: 6(int) GroupNonUniformShuffle 36 45 35 + 47: 43(ptr) AccessChain 24(data) 25 40 25 26 + Store 47 46 + 48: 27(ptr) AccessChain 10(dti) 26 + 49: 6(int) Load 48 + 50: 27(ptr) AccessChain 10(dti) 26 + 51: 6(int) Load 50 + 53: 32(ptr) AccessChain 24(data) 25 51 25 + 54: 13(ivec4) Load 53 + 55: 52(ivec2) VectorShuffle 54 54 0 1 + 56: 52(ivec2) GroupNonUniformShuffle 36 55 35 + 57: 32(ptr) AccessChain 24(data) 25 49 25 + 58: 13(ivec4) Load 57 + 59: 13(ivec4) VectorShuffle 58 56 4 5 2 3 + Store 57 59 + 60: 27(ptr) AccessChain 10(dti) 26 + 61: 6(int) Load 60 + 62: 27(ptr) AccessChain 10(dti) 26 + 63: 6(int) Load 62 + 64: 32(ptr) AccessChain 24(data) 25 63 25 + 65: 13(ivec4) Load 64 + 66: 7(ivec3) VectorShuffle 65 65 0 1 2 + 67: 7(ivec3) GroupNonUniformShuffle 36 66 35 + 68: 32(ptr) AccessChain 24(data) 25 61 25 + 69: 13(ivec4) Load 68 + 70: 13(ivec4) VectorShuffle 69 67 4 5 6 3 + Store 68 70 + 71: 27(ptr) AccessChain 10(dti) 26 + 72: 6(int) Load 71 + 74: 27(ptr) AccessChain 10(dti) 26 + 75: 6(int) Load 74 + 77: 76(ptr) AccessChain 24(data) 25 75 73 + 78: 15(ivec4) Load 77 + 79: 15(ivec4) GroupNonUniformShuffle 36 78 35 + 80: 76(ptr) AccessChain 24(data) 25 72 73 + Store 80 79 + 81: 27(ptr) AccessChain 10(dti) 26 + 82: 6(int) Load 81 + 83: 27(ptr) AccessChain 10(dti) 26 + 84: 6(int) Load 83 + 86: 85(ptr) AccessChain 24(data) 25 84 73 26 + 87: 14(int) Load 86 + 88: 14(int) GroupNonUniformShuffle 36 87 35 + 89: 85(ptr) AccessChain 24(data) 25 82 73 26 + Store 89 88 + 90: 27(ptr) AccessChain 10(dti) 26 + 91: 6(int) Load 90 + 92: 27(ptr) AccessChain 10(dti) 26 + 93: 6(int) Load 92 + 95: 76(ptr) AccessChain 24(data) 25 93 73 + 96: 15(ivec4) Load 95 + 97: 94(ivec2) VectorShuffle 96 96 0 1 + 98: 94(ivec2) GroupNonUniformShuffle 36 97 35 + 99: 76(ptr) AccessChain 24(data) 25 91 73 + 100: 15(ivec4) Load 99 + 101: 15(ivec4) VectorShuffle 100 98 4 5 2 3 + Store 99 101 + 102: 27(ptr) AccessChain 10(dti) 26 + 103: 6(int) Load 102 + 104: 27(ptr) AccessChain 10(dti) 26 + 105: 6(int) Load 104 + 107: 76(ptr) AccessChain 24(data) 25 105 73 + 108: 15(ivec4) Load 107 + 109: 106(ivec3) VectorShuffle 108 108 0 1 2 + 110: 106(ivec3) GroupNonUniformShuffle 36 109 35 + 111: 76(ptr) AccessChain 24(data) 25 103 73 + 112: 15(ivec4) Load 111 + 113: 15(ivec4) VectorShuffle 112 110 4 5 6 3 + Store 111 113 + 114: 27(ptr) AccessChain 10(dti) 26 + 115: 6(int) Load 114 + 117: 27(ptr) AccessChain 10(dti) 26 + 118: 6(int) Load 117 + 120: 119(ptr) AccessChain 24(data) 25 118 116 + 121: 17(fvec4) Load 120 + 122: 17(fvec4) GroupNonUniformShuffle 36 121 35 + 123: 119(ptr) AccessChain 24(data) 25 115 116 + Store 123 122 + 124: 27(ptr) AccessChain 10(dti) 26 + 125: 6(int) Load 124 + 126: 27(ptr) AccessChain 10(dti) 26 + 127: 6(int) Load 126 + 129: 128(ptr) AccessChain 24(data) 25 127 116 26 + 130: 16(float) Load 129 + 131: 16(float) GroupNonUniformShuffle 36 130 35 + 132: 128(ptr) AccessChain 24(data) 25 125 116 26 + Store 132 131 + 133: 27(ptr) AccessChain 10(dti) 26 + 134: 6(int) Load 133 + 135: 27(ptr) AccessChain 10(dti) 26 + 136: 6(int) Load 135 + 138: 119(ptr) AccessChain 24(data) 25 136 116 + 139: 17(fvec4) Load 138 + 140: 137(fvec2) VectorShuffle 139 139 0 1 + 141: 137(fvec2) GroupNonUniformShuffle 36 140 35 + 142: 119(ptr) AccessChain 24(data) 25 134 116 + 143: 17(fvec4) Load 142 + 144: 17(fvec4) VectorShuffle 143 141 4 5 2 3 + Store 142 144 + 145: 27(ptr) AccessChain 10(dti) 26 + 146: 6(int) Load 145 + 147: 27(ptr) AccessChain 10(dti) 26 + 148: 6(int) Load 147 + 150: 119(ptr) AccessChain 24(data) 25 148 116 + 151: 17(fvec4) Load 150 + 152: 149(fvec3) VectorShuffle 151 151 0 1 2 + 153: 149(fvec3) GroupNonUniformShuffle 36 152 35 + 154: 119(ptr) AccessChain 24(data) 25 146 116 + 155: 17(fvec4) Load 154 + 156: 17(fvec4) VectorShuffle 155 153 4 5 6 3 + Store 154 156 + 157: 27(ptr) AccessChain 10(dti) 26 + 158: 6(int) Load 157 + 160: 27(ptr) AccessChain 10(dti) 26 + 161: 6(int) Load 160 + 163: 162(ptr) AccessChain 24(data) 25 161 159 + 164: 19(fvec4) Load 163 + 165: 19(fvec4) GroupNonUniformBroadcastFirst 36 164 + 166: 162(ptr) AccessChain 24(data) 25 158 159 + Store 166 165 + 167: 27(ptr) AccessChain 10(dti) 26 + 168: 6(int) Load 167 + 169: 27(ptr) AccessChain 10(dti) 26 + 170: 6(int) Load 169 + 172: 171(ptr) AccessChain 24(data) 25 170 159 26 + 173: 18(float) Load 172 + 174: 18(float) GroupNonUniformBroadcastFirst 36 173 + 175: 171(ptr) AccessChain 24(data) 25 168 159 26 + Store 175 174 + 176: 27(ptr) AccessChain 10(dti) 26 + 177: 6(int) Load 176 + 178: 27(ptr) AccessChain 10(dti) 26 + 179: 6(int) Load 178 + 181: 162(ptr) AccessChain 24(data) 25 179 159 + 182: 19(fvec4) Load 181 + 183: 180(fvec2) VectorShuffle 182 182 0 1 + 184: 180(fvec2) GroupNonUniformBroadcastFirst 36 183 + 185: 162(ptr) AccessChain 24(data) 25 177 159 + 186: 19(fvec4) Load 185 + 187: 19(fvec4) VectorShuffle 186 184 4 5 2 3 + Store 185 187 + 188: 27(ptr) AccessChain 10(dti) 26 + 189: 6(int) Load 188 + 190: 27(ptr) AccessChain 10(dti) 26 + 191: 6(int) Load 190 + 193: 162(ptr) AccessChain 24(data) 25 191 159 + 194: 19(fvec4) Load 193 + 195: 192(fvec3) VectorShuffle 194 194 0 1 2 + 196: 192(fvec3) GroupNonUniformBroadcastFirst 36 195 + 197: 162(ptr) AccessChain 24(data) 25 189 159 + 198: 19(fvec4) Load 197 + 199: 19(fvec4) VectorShuffle 198 196 4 5 6 3 + Store 197 199 + 200: 27(ptr) AccessChain 10(dti) 26 + 201: 6(int) Load 200 + 202: 27(ptr) AccessChain 10(dti) 26 + 203: 6(int) Load 202 + 204: 32(ptr) AccessChain 24(data) 25 203 25 + 205: 13(ivec4) Load 204 + 206: 13(ivec4) GroupNonUniformBroadcastFirst 36 205 + 207: 32(ptr) AccessChain 24(data) 25 201 25 + Store 207 206 + 208: 27(ptr) AccessChain 10(dti) 26 + 209: 6(int) Load 208 + 210: 27(ptr) AccessChain 10(dti) 26 + 211: 6(int) Load 210 + 212: 43(ptr) AccessChain 24(data) 25 211 25 26 + 213: 6(int) Load 212 + 214: 6(int) GroupNonUniformBroadcastFirst 36 213 + 215: 43(ptr) AccessChain 24(data) 25 209 25 26 + Store 215 214 + 216: 27(ptr) AccessChain 10(dti) 26 + 217: 6(int) Load 216 + 218: 27(ptr) AccessChain 10(dti) 26 + 219: 6(int) Load 218 + 220: 32(ptr) AccessChain 24(data) 25 219 25 + 221: 13(ivec4) Load 220 + 222: 52(ivec2) VectorShuffle 221 221 0 1 + 223: 52(ivec2) GroupNonUniformBroadcastFirst 36 222 + 224: 32(ptr) AccessChain 24(data) 25 217 25 + 225: 13(ivec4) Load 224 + 226: 13(ivec4) VectorShuffle 225 223 4 5 2 3 + Store 224 226 + 227: 27(ptr) AccessChain 10(dti) 26 + 228: 6(int) Load 227 + 229: 27(ptr) AccessChain 10(dti) 26 + 230: 6(int) Load 229 + 231: 32(ptr) AccessChain 24(data) 25 230 25 + 232: 13(ivec4) Load 231 + 233: 7(ivec3) VectorShuffle 232 232 0 1 2 + 234: 7(ivec3) GroupNonUniformBroadcastFirst 36 233 + 235: 32(ptr) AccessChain 24(data) 25 228 25 + 236: 13(ivec4) Load 235 + 237: 13(ivec4) VectorShuffle 236 234 4 5 6 3 + Store 235 237 + 238: 27(ptr) AccessChain 10(dti) 26 + 239: 6(int) Load 238 + 240: 27(ptr) AccessChain 10(dti) 26 + 241: 6(int) Load 240 + 242: 76(ptr) AccessChain 24(data) 25 241 73 + 243: 15(ivec4) Load 242 + 244: 15(ivec4) GroupNonUniformBroadcastFirst 36 243 + 245: 76(ptr) AccessChain 24(data) 25 239 73 + Store 245 244 + 246: 27(ptr) AccessChain 10(dti) 26 + 247: 6(int) Load 246 + 248: 27(ptr) AccessChain 10(dti) 26 + 249: 6(int) Load 248 + 250: 85(ptr) AccessChain 24(data) 25 249 73 26 + 251: 14(int) Load 250 + 252: 14(int) GroupNonUniformBroadcastFirst 36 251 + 253: 85(ptr) AccessChain 24(data) 25 247 73 26 + Store 253 252 + 254: 27(ptr) AccessChain 10(dti) 26 + 255: 6(int) Load 254 + 256: 27(ptr) AccessChain 10(dti) 26 + 257: 6(int) Load 256 + 258: 76(ptr) AccessChain 24(data) 25 257 73 + 259: 15(ivec4) Load 258 + 260: 94(ivec2) VectorShuffle 259 259 0 1 + 261: 94(ivec2) GroupNonUniformBroadcastFirst 36 260 + 262: 76(ptr) AccessChain 24(data) 25 255 73 + 263: 15(ivec4) Load 262 + 264: 15(ivec4) VectorShuffle 263 261 4 5 2 3 + Store 262 264 + 265: 27(ptr) AccessChain 10(dti) 26 + 266: 6(int) Load 265 + 267: 27(ptr) AccessChain 10(dti) 26 + 268: 6(int) Load 267 + 269: 76(ptr) AccessChain 24(data) 25 268 73 + 270: 15(ivec4) Load 269 + 271: 106(ivec3) VectorShuffle 270 270 0 1 2 + 272: 106(ivec3) GroupNonUniformBroadcastFirst 36 271 + 273: 76(ptr) AccessChain 24(data) 25 266 73 + 274: 15(ivec4) Load 273 + 275: 15(ivec4) VectorShuffle 274 272 4 5 6 3 + Store 273 275 + 276: 27(ptr) AccessChain 10(dti) 26 + 277: 6(int) Load 276 + 278: 27(ptr) AccessChain 10(dti) 26 + 279: 6(int) Load 278 + 280: 119(ptr) AccessChain 24(data) 25 279 116 + 281: 17(fvec4) Load 280 + 282: 17(fvec4) GroupNonUniformBroadcastFirst 36 281 + 283: 119(ptr) AccessChain 24(data) 25 277 116 + Store 283 282 + 284: 27(ptr) AccessChain 10(dti) 26 + 285: 6(int) Load 284 + 286: 27(ptr) AccessChain 10(dti) 26 + 287: 6(int) Load 286 + 288: 128(ptr) AccessChain 24(data) 25 287 116 26 + 289: 16(float) Load 288 + 290: 16(float) GroupNonUniformBroadcastFirst 36 289 + 291: 128(ptr) AccessChain 24(data) 25 285 116 26 + Store 291 290 + 292: 27(ptr) AccessChain 10(dti) 26 + 293: 6(int) Load 292 + 294: 27(ptr) AccessChain 10(dti) 26 + 295: 6(int) Load 294 + 296: 119(ptr) AccessChain 24(data) 25 295 116 + 297: 17(fvec4) Load 296 + 298: 137(fvec2) VectorShuffle 297 297 0 1 + 299: 137(fvec2) GroupNonUniformBroadcastFirst 36 298 + 300: 119(ptr) AccessChain 24(data) 25 293 116 + 301: 17(fvec4) Load 300 + 302: 17(fvec4) VectorShuffle 301 299 4 5 2 3 + Store 300 302 + 303: 27(ptr) AccessChain 10(dti) 26 + 304: 6(int) Load 303 + 305: 27(ptr) AccessChain 10(dti) 26 + 306: 6(int) Load 305 + 307: 119(ptr) AccessChain 24(data) 25 306 116 + 308: 17(fvec4) Load 307 + 309: 149(fvec3) VectorShuffle 308 308 0 1 2 + 310: 149(fvec3) GroupNonUniformBroadcastFirst 36 309 + 311: 119(ptr) AccessChain 24(data) 25 304 116 + 312: 17(fvec4) Load 311 + 313: 17(fvec4) VectorShuffle 312 310 4 5 6 3 + Store 311 313 + 314: 27(ptr) AccessChain 10(dti) 26 + 315: 6(int) Load 314 + 316: 27(ptr) AccessChain 10(dti) 26 + 317: 6(int) Load 316 + 318: 162(ptr) AccessChain 24(data) 25 317 159 + 319: 19(fvec4) Load 318 + 320: 19(fvec4) GroupNonUniformBroadcastFirst 36 319 + 321: 162(ptr) AccessChain 24(data) 25 315 159 + Store 321 320 + 322: 27(ptr) AccessChain 10(dti) 26 + 323: 6(int) Load 322 + 324: 27(ptr) AccessChain 10(dti) 26 + 325: 6(int) Load 324 + 326: 171(ptr) AccessChain 24(data) 25 325 159 26 + 327: 18(float) Load 326 + 328: 18(float) GroupNonUniformBroadcastFirst 36 327 + 329: 171(ptr) AccessChain 24(data) 25 323 159 26 + Store 329 328 + 330: 27(ptr) AccessChain 10(dti) 26 + 331: 6(int) Load 330 + 332: 27(ptr) AccessChain 10(dti) 26 + 333: 6(int) Load 332 + 334: 162(ptr) AccessChain 24(data) 25 333 159 + 335: 19(fvec4) Load 334 + 336: 180(fvec2) VectorShuffle 335 335 0 1 + 337: 180(fvec2) GroupNonUniformBroadcastFirst 36 336 + 338: 162(ptr) AccessChain 24(data) 25 331 159 + 339: 19(fvec4) Load 338 + 340: 19(fvec4) VectorShuffle 339 337 4 5 2 3 + Store 338 340 + 341: 27(ptr) AccessChain 10(dti) 26 + 342: 6(int) Load 341 + 343: 27(ptr) AccessChain 10(dti) 26 + 344: 6(int) Load 343 + 345: 162(ptr) AccessChain 24(data) 25 344 159 + 346: 19(fvec4) Load 345 + 347: 192(fvec3) VectorShuffle 346 346 0 1 2 + 348: 192(fvec3) GroupNonUniformBroadcastFirst 36 347 + 349: 162(ptr) AccessChain 24(data) 25 342 159 + 350: 19(fvec4) Load 349 + 351: 19(fvec4) VectorShuffle 350 348 4 5 6 3 + Store 349 351 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.waveprefix.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.waveprefix.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.waveprefix.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.waveprefix.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,2766 @@ +hlsl.waveprefix.comp +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:13 Function Definition: @CSMain(vu3; ( temp void) +0:13 Function Parameters: +0:13 'dti' ( in 3-component vector of uint) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 subgroupInclusiveAdd ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:15 move second child to first child ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 subgroupInclusiveAdd ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:16 move second child to first child ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 subgroupInclusiveAdd ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:17 move second child to first child ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 subgroupInclusiveAdd ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:19 move second child to first child ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 subgroupInclusiveAdd ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 subgroupInclusiveAdd ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:21 move second child to first child ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 subgroupInclusiveAdd ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:22 move second child to first child ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 subgroupInclusiveAdd ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 subgroupInclusiveAdd ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 subgroupInclusiveAdd ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:26 move second child to first child ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 subgroupInclusiveAdd ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:27 move second child to first child ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 subgroupInclusiveAdd ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:29 move second child to first child ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 subgroupInclusiveAdd ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:30 move second child to first child ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 subgroupInclusiveAdd ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:31 move second child to first child ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 subgroupInclusiveAdd ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:32 move second child to first child ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 subgroupInclusiveAdd ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:34 move second child to first child ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 subgroupInclusiveMul ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:35 move second child to first child ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 subgroupInclusiveMul ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:36 move second child to first child ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 subgroupInclusiveMul ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:37 move second child to first child ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 subgroupInclusiveMul ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:39 move second child to first child ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 subgroupInclusiveMul ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:40 move second child to first child ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 subgroupInclusiveMul ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:41 move second child to first child ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 subgroupInclusiveMul ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:42 move second child to first child ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 subgroupInclusiveMul ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:44 move second child to first child ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 subgroupInclusiveMul ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 subgroupInclusiveMul ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:46 move second child to first child ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 subgroupInclusiveMul ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 subgroupInclusiveMul ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:49 move second child to first child ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 subgroupInclusiveMul ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:50 move second child to first child ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 subgroupInclusiveMul ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:51 move second child to first child ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 subgroupInclusiveMul ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:52 move second child to first child ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 subgroupInclusiveMul ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:54 move second child to first child ( temp uint) +0:54 direct index ( temp uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 subgroupBallotInclusiveBitCount ( temp uint) +0:54 subgroupBallot ( temp 4-component vector of uint) +0:54 Compare Equal ( temp bool) +0:54 direct index ( temp uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const uint) +0:13 Function Definition: CSMain( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:13 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:13 Function Definition: @CSMain(vu3; ( temp void) +0:13 Function Parameters: +0:13 'dti' ( in 3-component vector of uint) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 subgroupInclusiveAdd ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:15 move second child to first child ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 subgroupInclusiveAdd ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:16 move second child to first child ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 subgroupInclusiveAdd ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:17 move second child to first child ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 subgroupInclusiveAdd ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:19 move second child to first child ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 subgroupInclusiveAdd ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 subgroupInclusiveAdd ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:21 move second child to first child ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 subgroupInclusiveAdd ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:22 move second child to first child ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 subgroupInclusiveAdd ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 subgroupInclusiveAdd ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 subgroupInclusiveAdd ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:26 move second child to first child ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 subgroupInclusiveAdd ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:27 move second child to first child ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 subgroupInclusiveAdd ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:29 move second child to first child ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 subgroupInclusiveAdd ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:30 move second child to first child ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 subgroupInclusiveAdd ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:31 move second child to first child ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 subgroupInclusiveAdd ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:32 move second child to first child ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 subgroupInclusiveAdd ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:34 move second child to first child ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 subgroupInclusiveMul ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:35 move second child to first child ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 subgroupInclusiveMul ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:36 move second child to first child ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 subgroupInclusiveMul ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:37 move second child to first child ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 subgroupInclusiveMul ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:39 move second child to first child ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 subgroupInclusiveMul ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:40 move second child to first child ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 subgroupInclusiveMul ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:41 move second child to first child ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 subgroupInclusiveMul ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:42 move second child to first child ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 subgroupInclusiveMul ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:44 move second child to first child ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 subgroupInclusiveMul ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 subgroupInclusiveMul ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:46 move second child to first child ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 subgroupInclusiveMul ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 subgroupInclusiveMul ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:49 move second child to first child ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 subgroupInclusiveMul ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:50 move second child to first child ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 subgroupInclusiveMul ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:51 move second child to first child ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 subgroupInclusiveMul ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:52 move second child to first child ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 subgroupInclusiveMul ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:54 move second child to first child ( temp uint) +0:54 direct index ( temp uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 subgroupBallotInclusiveBitCount ( temp uint) +0:54 subgroupBallot ( temp 4-component vector of uint) +0:54 Compare Equal ( temp bool) +0:54 direct index ( temp uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const uint) +0:13 Function Definition: CSMain( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:13 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 369 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformArithmetic + Capability GroupNonUniformBallot + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "CSMain" 364 + ExecutionMode 4 LocalSize 32 16 1 + Source HLSL 500 + Name 4 "CSMain" + Name 11 "@CSMain(vu3;" + Name 10 "dti" + Name 20 "Types" + MemberName 20(Types) 0 "u" + MemberName 20(Types) 1 "i" + MemberName 20(Types) 2 "f" + MemberName 20(Types) 3 "d" + Name 22 "data" + MemberName 22(data) 0 "@data" + Name 24 "data" + Name 362 "dti" + Name 364 "dti" + Name 366 "param" + MemberDecorate 20(Types) 0 Offset 0 + MemberDecorate 20(Types) 1 Offset 16 + MemberDecorate 20(Types) 2 Offset 32 + MemberDecorate 20(Types) 3 Offset 64 + Decorate 21 ArrayStride 96 + MemberDecorate 22(data) 0 Offset 0 + Decorate 22(data) BufferBlock + Decorate 24(data) DescriptorSet 0 + Decorate 364(dti) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 13: TypeVector 6(int) 4 + 14: TypeInt 32 1 + 15: TypeVector 14(int) 4 + 16: TypeFloat 32 + 17: TypeVector 16(float) 4 + 18: TypeFloat 64 + 19: TypeVector 18(float) 4 + 20(Types): TypeStruct 13(ivec4) 15(ivec4) 17(fvec4) 19(fvec4) + 21: TypeRuntimeArray 20(Types) + 22(data): TypeStruct 21 + 23: TypePointer Uniform 22(data) + 24(data): 23(ptr) Variable Uniform + 25: 14(int) Constant 0 + 26: 6(int) Constant 0 + 27: TypePointer Function 6(int) + 32: TypePointer Uniform 13(ivec4) + 35: 6(int) Constant 3 + 42: TypePointer Uniform 6(int) + 51: TypeVector 6(int) 2 + 72: 14(int) Constant 1 + 75: TypePointer Uniform 15(ivec4) + 84: TypePointer Uniform 14(int) + 93: TypeVector 14(int) 2 + 105: TypeVector 14(int) 3 + 115: 14(int) Constant 2 + 118: TypePointer Uniform 17(fvec4) + 127: TypePointer Uniform 16(float) + 136: TypeVector 16(float) 2 + 148: TypeVector 16(float) 3 + 158: 14(int) Constant 3 + 161: TypePointer Uniform 19(fvec4) + 170: TypePointer Uniform 18(float) + 179: TypeVector 18(float) 2 + 191: TypeVector 18(float) 3 + 357: TypeBool + 363: TypePointer Input 7(ivec3) + 364(dti): 363(ptr) Variable Input + 4(CSMain): 2 Function None 3 + 5: Label + 362(dti): 8(ptr) Variable Function + 366(param): 8(ptr) Variable Function + 365: 7(ivec3) Load 364(dti) + Store 362(dti) 365 + 367: 7(ivec3) Load 362(dti) + Store 366(param) 367 + 368: 2 FunctionCall 11(@CSMain(vu3;) 366(param) + Return + FunctionEnd +11(@CSMain(vu3;): 2 Function None 9 + 10(dti): 8(ptr) FunctionParameter + 12: Label + 28: 27(ptr) AccessChain 10(dti) 26 + 29: 6(int) Load 28 + 30: 27(ptr) AccessChain 10(dti) 26 + 31: 6(int) Load 30 + 33: 32(ptr) AccessChain 24(data) 25 31 25 + 34: 13(ivec4) Load 33 + 36: 13(ivec4) GroupNonUniformIAdd 35 InclusiveScan 34 + 37: 32(ptr) AccessChain 24(data) 25 29 25 + Store 37 36 + 38: 27(ptr) AccessChain 10(dti) 26 + 39: 6(int) Load 38 + 40: 27(ptr) AccessChain 10(dti) 26 + 41: 6(int) Load 40 + 43: 42(ptr) AccessChain 24(data) 25 41 25 26 + 44: 6(int) Load 43 + 45: 6(int) GroupNonUniformIAdd 35 InclusiveScan 44 + 46: 42(ptr) AccessChain 24(data) 25 39 25 26 + Store 46 45 + 47: 27(ptr) AccessChain 10(dti) 26 + 48: 6(int) Load 47 + 49: 27(ptr) AccessChain 10(dti) 26 + 50: 6(int) Load 49 + 52: 32(ptr) AccessChain 24(data) 25 50 25 + 53: 13(ivec4) Load 52 + 54: 51(ivec2) VectorShuffle 53 53 0 1 + 55: 51(ivec2) GroupNonUniformIAdd 35 InclusiveScan 54 + 56: 32(ptr) AccessChain 24(data) 25 48 25 + 57: 13(ivec4) Load 56 + 58: 13(ivec4) VectorShuffle 57 55 4 5 2 3 + Store 56 58 + 59: 27(ptr) AccessChain 10(dti) 26 + 60: 6(int) Load 59 + 61: 27(ptr) AccessChain 10(dti) 26 + 62: 6(int) Load 61 + 63: 32(ptr) AccessChain 24(data) 25 62 25 + 64: 13(ivec4) Load 63 + 65: 7(ivec3) VectorShuffle 64 64 0 1 2 + 66: 7(ivec3) GroupNonUniformIAdd 35 InclusiveScan 65 + 67: 32(ptr) AccessChain 24(data) 25 60 25 + 68: 13(ivec4) Load 67 + 69: 13(ivec4) VectorShuffle 68 66 4 5 6 3 + Store 67 69 + 70: 27(ptr) AccessChain 10(dti) 26 + 71: 6(int) Load 70 + 73: 27(ptr) AccessChain 10(dti) 26 + 74: 6(int) Load 73 + 76: 75(ptr) AccessChain 24(data) 25 74 72 + 77: 15(ivec4) Load 76 + 78: 15(ivec4) GroupNonUniformIAdd 35 InclusiveScan 77 + 79: 75(ptr) AccessChain 24(data) 25 71 72 + Store 79 78 + 80: 27(ptr) AccessChain 10(dti) 26 + 81: 6(int) Load 80 + 82: 27(ptr) AccessChain 10(dti) 26 + 83: 6(int) Load 82 + 85: 84(ptr) AccessChain 24(data) 25 83 72 26 + 86: 14(int) Load 85 + 87: 14(int) GroupNonUniformIAdd 35 InclusiveScan 86 + 88: 84(ptr) AccessChain 24(data) 25 81 72 26 + Store 88 87 + 89: 27(ptr) AccessChain 10(dti) 26 + 90: 6(int) Load 89 + 91: 27(ptr) AccessChain 10(dti) 26 + 92: 6(int) Load 91 + 94: 75(ptr) AccessChain 24(data) 25 92 72 + 95: 15(ivec4) Load 94 + 96: 93(ivec2) VectorShuffle 95 95 0 1 + 97: 93(ivec2) GroupNonUniformIAdd 35 InclusiveScan 96 + 98: 75(ptr) AccessChain 24(data) 25 90 72 + 99: 15(ivec4) Load 98 + 100: 15(ivec4) VectorShuffle 99 97 4 5 2 3 + Store 98 100 + 101: 27(ptr) AccessChain 10(dti) 26 + 102: 6(int) Load 101 + 103: 27(ptr) AccessChain 10(dti) 26 + 104: 6(int) Load 103 + 106: 75(ptr) AccessChain 24(data) 25 104 72 + 107: 15(ivec4) Load 106 + 108: 105(ivec3) VectorShuffle 107 107 0 1 2 + 109: 105(ivec3) GroupNonUniformIAdd 35 InclusiveScan 108 + 110: 75(ptr) AccessChain 24(data) 25 102 72 + 111: 15(ivec4) Load 110 + 112: 15(ivec4) VectorShuffle 111 109 4 5 6 3 + Store 110 112 + 113: 27(ptr) AccessChain 10(dti) 26 + 114: 6(int) Load 113 + 116: 27(ptr) AccessChain 10(dti) 26 + 117: 6(int) Load 116 + 119: 118(ptr) AccessChain 24(data) 25 117 115 + 120: 17(fvec4) Load 119 + 121: 17(fvec4) GroupNonUniformFAdd 35 InclusiveScan 120 + 122: 118(ptr) AccessChain 24(data) 25 114 115 + Store 122 121 + 123: 27(ptr) AccessChain 10(dti) 26 + 124: 6(int) Load 123 + 125: 27(ptr) AccessChain 10(dti) 26 + 126: 6(int) Load 125 + 128: 127(ptr) AccessChain 24(data) 25 126 115 26 + 129: 16(float) Load 128 + 130: 16(float) GroupNonUniformFAdd 35 InclusiveScan 129 + 131: 127(ptr) AccessChain 24(data) 25 124 115 26 + Store 131 130 + 132: 27(ptr) AccessChain 10(dti) 26 + 133: 6(int) Load 132 + 134: 27(ptr) AccessChain 10(dti) 26 + 135: 6(int) Load 134 + 137: 118(ptr) AccessChain 24(data) 25 135 115 + 138: 17(fvec4) Load 137 + 139: 136(fvec2) VectorShuffle 138 138 0 1 + 140: 136(fvec2) GroupNonUniformFAdd 35 InclusiveScan 139 + 141: 118(ptr) AccessChain 24(data) 25 133 115 + 142: 17(fvec4) Load 141 + 143: 17(fvec4) VectorShuffle 142 140 4 5 2 3 + Store 141 143 + 144: 27(ptr) AccessChain 10(dti) 26 + 145: 6(int) Load 144 + 146: 27(ptr) AccessChain 10(dti) 26 + 147: 6(int) Load 146 + 149: 118(ptr) AccessChain 24(data) 25 147 115 + 150: 17(fvec4) Load 149 + 151: 148(fvec3) VectorShuffle 150 150 0 1 2 + 152: 148(fvec3) GroupNonUniformFAdd 35 InclusiveScan 151 + 153: 118(ptr) AccessChain 24(data) 25 145 115 + 154: 17(fvec4) Load 153 + 155: 17(fvec4) VectorShuffle 154 152 4 5 6 3 + Store 153 155 + 156: 27(ptr) AccessChain 10(dti) 26 + 157: 6(int) Load 156 + 159: 27(ptr) AccessChain 10(dti) 26 + 160: 6(int) Load 159 + 162: 161(ptr) AccessChain 24(data) 25 160 158 + 163: 19(fvec4) Load 162 + 164: 19(fvec4) GroupNonUniformFAdd 35 InclusiveScan 163 + 165: 161(ptr) AccessChain 24(data) 25 157 158 + Store 165 164 + 166: 27(ptr) AccessChain 10(dti) 26 + 167: 6(int) Load 166 + 168: 27(ptr) AccessChain 10(dti) 26 + 169: 6(int) Load 168 + 171: 170(ptr) AccessChain 24(data) 25 169 158 26 + 172: 18(float) Load 171 + 173: 18(float) GroupNonUniformFAdd 35 InclusiveScan 172 + 174: 170(ptr) AccessChain 24(data) 25 167 158 26 + Store 174 173 + 175: 27(ptr) AccessChain 10(dti) 26 + 176: 6(int) Load 175 + 177: 27(ptr) AccessChain 10(dti) 26 + 178: 6(int) Load 177 + 180: 161(ptr) AccessChain 24(data) 25 178 158 + 181: 19(fvec4) Load 180 + 182: 179(fvec2) VectorShuffle 181 181 0 1 + 183: 179(fvec2) GroupNonUniformFAdd 35 InclusiveScan 182 + 184: 161(ptr) AccessChain 24(data) 25 176 158 + 185: 19(fvec4) Load 184 + 186: 19(fvec4) VectorShuffle 185 183 4 5 2 3 + Store 184 186 + 187: 27(ptr) AccessChain 10(dti) 26 + 188: 6(int) Load 187 + 189: 27(ptr) AccessChain 10(dti) 26 + 190: 6(int) Load 189 + 192: 161(ptr) AccessChain 24(data) 25 190 158 + 193: 19(fvec4) Load 192 + 194: 191(fvec3) VectorShuffle 193 193 0 1 2 + 195: 191(fvec3) GroupNonUniformFAdd 35 InclusiveScan 194 + 196: 161(ptr) AccessChain 24(data) 25 188 158 + 197: 19(fvec4) Load 196 + 198: 19(fvec4) VectorShuffle 197 195 4 5 6 3 + Store 196 198 + 199: 27(ptr) AccessChain 10(dti) 26 + 200: 6(int) Load 199 + 201: 27(ptr) AccessChain 10(dti) 26 + 202: 6(int) Load 201 + 203: 32(ptr) AccessChain 24(data) 25 202 25 + 204: 13(ivec4) Load 203 + 205: 13(ivec4) GroupNonUniformIMul 35 InclusiveScan 204 + 206: 32(ptr) AccessChain 24(data) 25 200 25 + Store 206 205 + 207: 27(ptr) AccessChain 10(dti) 26 + 208: 6(int) Load 207 + 209: 27(ptr) AccessChain 10(dti) 26 + 210: 6(int) Load 209 + 211: 42(ptr) AccessChain 24(data) 25 210 25 26 + 212: 6(int) Load 211 + 213: 6(int) GroupNonUniformIMul 35 InclusiveScan 212 + 214: 42(ptr) AccessChain 24(data) 25 208 25 26 + Store 214 213 + 215: 27(ptr) AccessChain 10(dti) 26 + 216: 6(int) Load 215 + 217: 27(ptr) AccessChain 10(dti) 26 + 218: 6(int) Load 217 + 219: 32(ptr) AccessChain 24(data) 25 218 25 + 220: 13(ivec4) Load 219 + 221: 51(ivec2) VectorShuffle 220 220 0 1 + 222: 51(ivec2) GroupNonUniformIMul 35 InclusiveScan 221 + 223: 32(ptr) AccessChain 24(data) 25 216 25 + 224: 13(ivec4) Load 223 + 225: 13(ivec4) VectorShuffle 224 222 4 5 2 3 + Store 223 225 + 226: 27(ptr) AccessChain 10(dti) 26 + 227: 6(int) Load 226 + 228: 27(ptr) AccessChain 10(dti) 26 + 229: 6(int) Load 228 + 230: 32(ptr) AccessChain 24(data) 25 229 25 + 231: 13(ivec4) Load 230 + 232: 7(ivec3) VectorShuffle 231 231 0 1 2 + 233: 7(ivec3) GroupNonUniformIMul 35 InclusiveScan 232 + 234: 32(ptr) AccessChain 24(data) 25 227 25 + 235: 13(ivec4) Load 234 + 236: 13(ivec4) VectorShuffle 235 233 4 5 6 3 + Store 234 236 + 237: 27(ptr) AccessChain 10(dti) 26 + 238: 6(int) Load 237 + 239: 27(ptr) AccessChain 10(dti) 26 + 240: 6(int) Load 239 + 241: 75(ptr) AccessChain 24(data) 25 240 72 + 242: 15(ivec4) Load 241 + 243: 15(ivec4) GroupNonUniformIMul 35 InclusiveScan 242 + 244: 75(ptr) AccessChain 24(data) 25 238 72 + Store 244 243 + 245: 27(ptr) AccessChain 10(dti) 26 + 246: 6(int) Load 245 + 247: 27(ptr) AccessChain 10(dti) 26 + 248: 6(int) Load 247 + 249: 84(ptr) AccessChain 24(data) 25 248 72 26 + 250: 14(int) Load 249 + 251: 14(int) GroupNonUniformIMul 35 InclusiveScan 250 + 252: 84(ptr) AccessChain 24(data) 25 246 72 26 + Store 252 251 + 253: 27(ptr) AccessChain 10(dti) 26 + 254: 6(int) Load 253 + 255: 27(ptr) AccessChain 10(dti) 26 + 256: 6(int) Load 255 + 257: 75(ptr) AccessChain 24(data) 25 256 72 + 258: 15(ivec4) Load 257 + 259: 93(ivec2) VectorShuffle 258 258 0 1 + 260: 93(ivec2) GroupNonUniformIMul 35 InclusiveScan 259 + 261: 75(ptr) AccessChain 24(data) 25 254 72 + 262: 15(ivec4) Load 261 + 263: 15(ivec4) VectorShuffle 262 260 4 5 2 3 + Store 261 263 + 264: 27(ptr) AccessChain 10(dti) 26 + 265: 6(int) Load 264 + 266: 27(ptr) AccessChain 10(dti) 26 + 267: 6(int) Load 266 + 268: 75(ptr) AccessChain 24(data) 25 267 72 + 269: 15(ivec4) Load 268 + 270: 105(ivec3) VectorShuffle 269 269 0 1 2 + 271: 105(ivec3) GroupNonUniformIMul 35 InclusiveScan 270 + 272: 75(ptr) AccessChain 24(data) 25 265 72 + 273: 15(ivec4) Load 272 + 274: 15(ivec4) VectorShuffle 273 271 4 5 6 3 + Store 272 274 + 275: 27(ptr) AccessChain 10(dti) 26 + 276: 6(int) Load 275 + 277: 27(ptr) AccessChain 10(dti) 26 + 278: 6(int) Load 277 + 279: 118(ptr) AccessChain 24(data) 25 278 115 + 280: 17(fvec4) Load 279 + 281: 17(fvec4) GroupNonUniformFMul 35 InclusiveScan 280 + 282: 118(ptr) AccessChain 24(data) 25 276 115 + Store 282 281 + 283: 27(ptr) AccessChain 10(dti) 26 + 284: 6(int) Load 283 + 285: 27(ptr) AccessChain 10(dti) 26 + 286: 6(int) Load 285 + 287: 127(ptr) AccessChain 24(data) 25 286 115 26 + 288: 16(float) Load 287 + 289: 16(float) GroupNonUniformFMul 35 InclusiveScan 288 + 290: 127(ptr) AccessChain 24(data) 25 284 115 26 + Store 290 289 + 291: 27(ptr) AccessChain 10(dti) 26 + 292: 6(int) Load 291 + 293: 27(ptr) AccessChain 10(dti) 26 + 294: 6(int) Load 293 + 295: 118(ptr) AccessChain 24(data) 25 294 115 + 296: 17(fvec4) Load 295 + 297: 136(fvec2) VectorShuffle 296 296 0 1 + 298: 136(fvec2) GroupNonUniformFMul 35 InclusiveScan 297 + 299: 118(ptr) AccessChain 24(data) 25 292 115 + 300: 17(fvec4) Load 299 + 301: 17(fvec4) VectorShuffle 300 298 4 5 2 3 + Store 299 301 + 302: 27(ptr) AccessChain 10(dti) 26 + 303: 6(int) Load 302 + 304: 27(ptr) AccessChain 10(dti) 26 + 305: 6(int) Load 304 + 306: 118(ptr) AccessChain 24(data) 25 305 115 + 307: 17(fvec4) Load 306 + 308: 148(fvec3) VectorShuffle 307 307 0 1 2 + 309: 148(fvec3) GroupNonUniformFMul 35 InclusiveScan 308 + 310: 118(ptr) AccessChain 24(data) 25 303 115 + 311: 17(fvec4) Load 310 + 312: 17(fvec4) VectorShuffle 311 309 4 5 6 3 + Store 310 312 + 313: 27(ptr) AccessChain 10(dti) 26 + 314: 6(int) Load 313 + 315: 27(ptr) AccessChain 10(dti) 26 + 316: 6(int) Load 315 + 317: 161(ptr) AccessChain 24(data) 25 316 158 + 318: 19(fvec4) Load 317 + 319: 19(fvec4) GroupNonUniformFMul 35 InclusiveScan 318 + 320: 161(ptr) AccessChain 24(data) 25 314 158 + Store 320 319 + 321: 27(ptr) AccessChain 10(dti) 26 + 322: 6(int) Load 321 + 323: 27(ptr) AccessChain 10(dti) 26 + 324: 6(int) Load 323 + 325: 170(ptr) AccessChain 24(data) 25 324 158 26 + 326: 18(float) Load 325 + 327: 18(float) GroupNonUniformFMul 35 InclusiveScan 326 + 328: 170(ptr) AccessChain 24(data) 25 322 158 26 + Store 328 327 + 329: 27(ptr) AccessChain 10(dti) 26 + 330: 6(int) Load 329 + 331: 27(ptr) AccessChain 10(dti) 26 + 332: 6(int) Load 331 + 333: 161(ptr) AccessChain 24(data) 25 332 158 + 334: 19(fvec4) Load 333 + 335: 179(fvec2) VectorShuffle 334 334 0 1 + 336: 179(fvec2) GroupNonUniformFMul 35 InclusiveScan 335 + 337: 161(ptr) AccessChain 24(data) 25 330 158 + 338: 19(fvec4) Load 337 + 339: 19(fvec4) VectorShuffle 338 336 4 5 2 3 + Store 337 339 + 340: 27(ptr) AccessChain 10(dti) 26 + 341: 6(int) Load 340 + 342: 27(ptr) AccessChain 10(dti) 26 + 343: 6(int) Load 342 + 344: 161(ptr) AccessChain 24(data) 25 343 158 + 345: 19(fvec4) Load 344 + 346: 191(fvec3) VectorShuffle 345 345 0 1 2 + 347: 191(fvec3) GroupNonUniformFMul 35 InclusiveScan 346 + 348: 161(ptr) AccessChain 24(data) 25 341 158 + 349: 19(fvec4) Load 348 + 350: 19(fvec4) VectorShuffle 349 347 4 5 6 3 + Store 348 350 + 351: 27(ptr) AccessChain 10(dti) 26 + 352: 6(int) Load 351 + 353: 27(ptr) AccessChain 10(dti) 26 + 354: 6(int) Load 353 + 355: 42(ptr) AccessChain 24(data) 25 354 25 26 + 356: 6(int) Load 355 + 358: 357(bool) IEqual 356 26 + 359: 13(ivec4) GroupNonUniformBallot 35 358 + 360: 6(int) GroupNonUniformBallotBitCount 35 InclusiveScan 359 + 361: 42(ptr) AccessChain 24(data) 25 352 25 26 + Store 361 360 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.wavequad.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.wavequad.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.wavequad.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.wavequad.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,9299 @@ +hlsl.wavequad.comp +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:13 Function Definition: @CSMain(vu3; ( temp void) +0:13 Function Parameters: +0:13 'dti' ( in 3-component vector of uint) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 subgroupQuadBroadcast ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const uint) +0:15 move second child to first child ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 subgroupQuadBroadcast ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const uint) +0:16 move second child to first child ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 subgroupQuadBroadcast ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 0 (const uint) +0:17 move second child to first child ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 subgroupQuadBroadcast ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 0 (const uint) +0:19 move second child to first child ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 subgroupQuadBroadcast ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 0 (const uint) +0:20 move second child to first child ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 subgroupQuadBroadcast ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 0 (const uint) +0:21 move second child to first child ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 subgroupQuadBroadcast ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 0 (const uint) +0:22 move second child to first child ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 subgroupQuadBroadcast ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 Constant: +0:22 0 (const uint) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 subgroupQuadBroadcast ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 0 (const uint) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 subgroupQuadBroadcast ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 0 (const uint) +0:26 move second child to first child ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 subgroupQuadBroadcast ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 Constant: +0:26 0 (const uint) +0:27 move second child to first child ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 subgroupQuadBroadcast ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Constant: +0:27 0 (const uint) +0:29 move second child to first child ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 subgroupQuadBroadcast ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 Constant: +0:29 0 (const uint) +0:30 move second child to first child ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 subgroupQuadBroadcast ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 0 (const uint) +0:31 move second child to first child ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 subgroupQuadBroadcast ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 Constant: +0:31 0 (const uint) +0:32 move second child to first child ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 subgroupQuadBroadcast ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 Constant: +0:32 0 (const uint) +0:34 move second child to first child ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 subgroupQuadBroadcast ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 1 (const uint) +0:35 move second child to first child ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 subgroupQuadBroadcast ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 1 (const uint) +0:36 move second child to first child ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 subgroupQuadBroadcast ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 Constant: +0:36 1 (const uint) +0:37 move second child to first child ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 subgroupQuadBroadcast ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 Constant: +0:37 1 (const uint) +0:39 move second child to first child ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 subgroupQuadBroadcast ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 Constant: +0:39 1 (const uint) +0:40 move second child to first child ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 subgroupQuadBroadcast ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const uint) +0:41 move second child to first child ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 subgroupQuadBroadcast ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Constant: +0:41 1 (const uint) +0:42 move second child to first child ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 subgroupQuadBroadcast ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 Constant: +0:42 1 (const uint) +0:44 move second child to first child ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 subgroupQuadBroadcast ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 Constant: +0:44 1 (const uint) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 subgroupQuadBroadcast ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 1 (const uint) +0:46 move second child to first child ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 subgroupQuadBroadcast ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 1 (const uint) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 subgroupQuadBroadcast ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Constant: +0:47 1 (const uint) +0:49 move second child to first child ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 subgroupQuadBroadcast ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 Constant: +0:49 1 (const uint) +0:50 move second child to first child ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 subgroupQuadBroadcast ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 1 (const uint) +0:51 move second child to first child ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 subgroupQuadBroadcast ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 Constant: +0:51 1 (const uint) +0:52 move second child to first child ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 subgroupQuadBroadcast ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 Constant: +0:52 1 (const uint) +0:54 move second child to first child ( temp 4-component vector of uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 subgroupQuadBroadcast ( temp 4-component vector of uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 2 (const uint) +0:55 move second child to first child ( temp uint) +0:55 direct index ( temp uint) +0:55 u: direct index for structure ( temp 4-component vector of uint) +0:55 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:55 Constant: +0:55 0 (const uint) +0:55 direct index ( temp uint) +0:55 'dti' ( in 3-component vector of uint) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 subgroupQuadBroadcast ( temp uint) +0:55 direct index ( temp uint) +0:55 u: direct index for structure ( temp 4-component vector of uint) +0:55 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:55 Constant: +0:55 0 (const uint) +0:55 direct index ( temp uint) +0:55 'dti' ( in 3-component vector of uint) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 2 (const uint) +0:56 move second child to first child ( temp 2-component vector of uint) +0:56 vector swizzle ( temp 2-component vector of uint) +0:56 u: direct index for structure ( temp 4-component vector of uint) +0:56 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:56 Constant: +0:56 0 (const uint) +0:56 direct index ( temp uint) +0:56 'dti' ( in 3-component vector of uint) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 0 (const int) +0:56 Sequence +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1 (const int) +0:56 subgroupQuadBroadcast ( temp 2-component vector of uint) +0:56 vector swizzle ( temp 2-component vector of uint) +0:56 u: direct index for structure ( temp 4-component vector of uint) +0:56 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:56 Constant: +0:56 0 (const uint) +0:56 direct index ( temp uint) +0:56 'dti' ( in 3-component vector of uint) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 0 (const int) +0:56 Sequence +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1 (const int) +0:56 Constant: +0:56 2 (const uint) +0:57 move second child to first child ( temp 3-component vector of uint) +0:57 vector swizzle ( temp 3-component vector of uint) +0:57 u: direct index for structure ( temp 4-component vector of uint) +0:57 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:57 Constant: +0:57 0 (const uint) +0:57 direct index ( temp uint) +0:57 'dti' ( in 3-component vector of uint) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 0 (const int) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:57 subgroupQuadBroadcast ( temp 3-component vector of uint) +0:57 vector swizzle ( temp 3-component vector of uint) +0:57 u: direct index for structure ( temp 4-component vector of uint) +0:57 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:57 Constant: +0:57 0 (const uint) +0:57 direct index ( temp uint) +0:57 'dti' ( in 3-component vector of uint) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 0 (const int) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:57 Constant: +0:57 2 (const uint) +0:59 move second child to first child ( temp 4-component vector of int) +0:59 i: direct index for structure ( temp 4-component vector of int) +0:59 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:59 Constant: +0:59 0 (const uint) +0:59 direct index ( temp uint) +0:59 'dti' ( in 3-component vector of uint) +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 subgroupQuadBroadcast ( temp 4-component vector of int) +0:59 i: direct index for structure ( temp 4-component vector of int) +0:59 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:59 Constant: +0:59 0 (const uint) +0:59 direct index ( temp uint) +0:59 'dti' ( in 3-component vector of uint) +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 Constant: +0:59 2 (const uint) +0:60 move second child to first child ( temp int) +0:60 direct index ( temp int) +0:60 i: direct index for structure ( temp 4-component vector of int) +0:60 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:60 Constant: +0:60 0 (const uint) +0:60 direct index ( temp uint) +0:60 'dti' ( in 3-component vector of uint) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 1 (const int) +0:60 Constant: +0:60 0 (const int) +0:60 subgroupQuadBroadcast ( temp int) +0:60 direct index ( temp int) +0:60 i: direct index for structure ( temp 4-component vector of int) +0:60 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:60 Constant: +0:60 0 (const uint) +0:60 direct index ( temp uint) +0:60 'dti' ( in 3-component vector of uint) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 1 (const int) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 2 (const uint) +0:61 move second child to first child ( temp 2-component vector of int) +0:61 vector swizzle ( temp 2-component vector of int) +0:61 i: direct index for structure ( temp 4-component vector of int) +0:61 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:61 Constant: +0:61 0 (const uint) +0:61 direct index ( temp uint) +0:61 'dti' ( in 3-component vector of uint) +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Sequence +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 subgroupQuadBroadcast ( temp 2-component vector of int) +0:61 vector swizzle ( temp 2-component vector of int) +0:61 i: direct index for structure ( temp 4-component vector of int) +0:61 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:61 Constant: +0:61 0 (const uint) +0:61 direct index ( temp uint) +0:61 'dti' ( in 3-component vector of uint) +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Sequence +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Constant: +0:61 2 (const uint) +0:62 move second child to first child ( temp 3-component vector of int) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 i: direct index for structure ( temp 4-component vector of int) +0:62 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:62 Constant: +0:62 0 (const uint) +0:62 direct index ( temp uint) +0:62 'dti' ( in 3-component vector of uint) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:62 subgroupQuadBroadcast ( temp 3-component vector of int) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 i: direct index for structure ( temp 4-component vector of int) +0:62 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:62 Constant: +0:62 0 (const uint) +0:62 direct index ( temp uint) +0:62 'dti' ( in 3-component vector of uint) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:62 Constant: +0:62 2 (const uint) +0:64 move second child to first child ( temp 4-component vector of float) +0:64 f: direct index for structure ( temp 4-component vector of float) +0:64 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:64 Constant: +0:64 0 (const uint) +0:64 direct index ( temp uint) +0:64 'dti' ( in 3-component vector of uint) +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 2 (const int) +0:64 subgroupQuadBroadcast ( temp 4-component vector of float) +0:64 f: direct index for structure ( temp 4-component vector of float) +0:64 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:64 Constant: +0:64 0 (const uint) +0:64 direct index ( temp uint) +0:64 'dti' ( in 3-component vector of uint) +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 2 (const int) +0:64 Constant: +0:64 2 (const uint) +0:65 move second child to first child ( temp float) +0:65 direct index ( temp float) +0:65 f: direct index for structure ( temp 4-component vector of float) +0:65 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:65 Constant: +0:65 0 (const uint) +0:65 direct index ( temp uint) +0:65 'dti' ( in 3-component vector of uint) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 Constant: +0:65 0 (const int) +0:65 subgroupQuadBroadcast ( temp float) +0:65 direct index ( temp float) +0:65 f: direct index for structure ( temp 4-component vector of float) +0:65 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:65 Constant: +0:65 0 (const uint) +0:65 direct index ( temp uint) +0:65 'dti' ( in 3-component vector of uint) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const uint) +0:66 move second child to first child ( temp 2-component vector of float) +0:66 vector swizzle ( temp 2-component vector of float) +0:66 f: direct index for structure ( temp 4-component vector of float) +0:66 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:66 Constant: +0:66 0 (const uint) +0:66 direct index ( temp uint) +0:66 'dti' ( in 3-component vector of uint) +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 2 (const int) +0:66 Sequence +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 1 (const int) +0:66 subgroupQuadBroadcast ( temp 2-component vector of float) +0:66 vector swizzle ( temp 2-component vector of float) +0:66 f: direct index for structure ( temp 4-component vector of float) +0:66 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:66 Constant: +0:66 0 (const uint) +0:66 direct index ( temp uint) +0:66 'dti' ( in 3-component vector of uint) +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 2 (const int) +0:66 Sequence +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 1 (const int) +0:66 Constant: +0:66 2 (const uint) +0:67 move second child to first child ( temp 3-component vector of float) +0:67 vector swizzle ( temp 3-component vector of float) +0:67 f: direct index for structure ( temp 4-component vector of float) +0:67 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:67 Constant: +0:67 0 (const uint) +0:67 direct index ( temp uint) +0:67 'dti' ( in 3-component vector of uint) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Sequence +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 subgroupQuadBroadcast ( temp 3-component vector of float) +0:67 vector swizzle ( temp 3-component vector of float) +0:67 f: direct index for structure ( temp 4-component vector of float) +0:67 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:67 Constant: +0:67 0 (const uint) +0:67 direct index ( temp uint) +0:67 'dti' ( in 3-component vector of uint) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Sequence +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Constant: +0:67 2 (const uint) +0:69 move second child to first child ( temp 4-component vector of double) +0:69 d: direct index for structure ( temp 4-component vector of double) +0:69 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:69 Constant: +0:69 0 (const uint) +0:69 direct index ( temp uint) +0:69 'dti' ( in 3-component vector of uint) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 3 (const int) +0:69 subgroupQuadBroadcast ( temp 4-component vector of double) +0:69 d: direct index for structure ( temp 4-component vector of double) +0:69 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:69 Constant: +0:69 0 (const uint) +0:69 direct index ( temp uint) +0:69 'dti' ( in 3-component vector of uint) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 3 (const int) +0:69 Constant: +0:69 2 (const uint) +0:70 move second child to first child ( temp double) +0:70 direct index ( temp double) +0:70 d: direct index for structure ( temp 4-component vector of double) +0:70 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:70 Constant: +0:70 0 (const uint) +0:70 direct index ( temp uint) +0:70 'dti' ( in 3-component vector of uint) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 3 (const int) +0:70 Constant: +0:70 0 (const int) +0:70 subgroupQuadBroadcast ( temp double) +0:70 direct index ( temp double) +0:70 d: direct index for structure ( temp 4-component vector of double) +0:70 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:70 Constant: +0:70 0 (const uint) +0:70 direct index ( temp uint) +0:70 'dti' ( in 3-component vector of uint) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 3 (const int) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 2 (const uint) +0:71 move second child to first child ( temp 2-component vector of double) +0:71 vector swizzle ( temp 2-component vector of double) +0:71 d: direct index for structure ( temp 4-component vector of double) +0:71 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:71 Constant: +0:71 0 (const uint) +0:71 direct index ( temp uint) +0:71 'dti' ( in 3-component vector of uint) +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 3 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:71 subgroupQuadBroadcast ( temp 2-component vector of double) +0:71 vector swizzle ( temp 2-component vector of double) +0:71 d: direct index for structure ( temp 4-component vector of double) +0:71 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:71 Constant: +0:71 0 (const uint) +0:71 direct index ( temp uint) +0:71 'dti' ( in 3-component vector of uint) +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 3 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:71 Constant: +0:71 2 (const uint) +0:72 move second child to first child ( temp 3-component vector of double) +0:72 vector swizzle ( temp 3-component vector of double) +0:72 d: direct index for structure ( temp 4-component vector of double) +0:72 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:72 Constant: +0:72 0 (const uint) +0:72 direct index ( temp uint) +0:72 'dti' ( in 3-component vector of uint) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 3 (const int) +0:72 Sequence +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 2 (const int) +0:72 subgroupQuadBroadcast ( temp 3-component vector of double) +0:72 vector swizzle ( temp 3-component vector of double) +0:72 d: direct index for structure ( temp 4-component vector of double) +0:72 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:72 Constant: +0:72 0 (const uint) +0:72 direct index ( temp uint) +0:72 'dti' ( in 3-component vector of uint) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 3 (const int) +0:72 Sequence +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 2 (const int) +0:72 Constant: +0:72 2 (const uint) +0:74 move second child to first child ( temp 4-component vector of uint) +0:74 u: direct index for structure ( temp 4-component vector of uint) +0:74 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:74 Constant: +0:74 0 (const uint) +0:74 direct index ( temp uint) +0:74 'dti' ( in 3-component vector of uint) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 0 (const int) +0:74 subgroupQuadBroadcast ( temp 4-component vector of uint) +0:74 u: direct index for structure ( temp 4-component vector of uint) +0:74 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:74 Constant: +0:74 0 (const uint) +0:74 direct index ( temp uint) +0:74 'dti' ( in 3-component vector of uint) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 3 (const uint) +0:75 move second child to first child ( temp uint) +0:75 direct index ( temp uint) +0:75 u: direct index for structure ( temp 4-component vector of uint) +0:75 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:75 Constant: +0:75 0 (const uint) +0:75 direct index ( temp uint) +0:75 'dti' ( in 3-component vector of uint) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 subgroupQuadBroadcast ( temp uint) +0:75 direct index ( temp uint) +0:75 u: direct index for structure ( temp 4-component vector of uint) +0:75 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:75 Constant: +0:75 0 (const uint) +0:75 direct index ( temp uint) +0:75 'dti' ( in 3-component vector of uint) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 3 (const uint) +0:76 move second child to first child ( temp 2-component vector of uint) +0:76 vector swizzle ( temp 2-component vector of uint) +0:76 u: direct index for structure ( temp 4-component vector of uint) +0:76 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:76 Constant: +0:76 0 (const uint) +0:76 direct index ( temp uint) +0:76 'dti' ( in 3-component vector of uint) +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 0 (const int) +0:76 Sequence +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 1 (const int) +0:76 subgroupQuadBroadcast ( temp 2-component vector of uint) +0:76 vector swizzle ( temp 2-component vector of uint) +0:76 u: direct index for structure ( temp 4-component vector of uint) +0:76 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:76 Constant: +0:76 0 (const uint) +0:76 direct index ( temp uint) +0:76 'dti' ( in 3-component vector of uint) +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 0 (const int) +0:76 Sequence +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 1 (const int) +0:76 Constant: +0:76 3 (const uint) +0:77 move second child to first child ( temp 3-component vector of uint) +0:77 vector swizzle ( temp 3-component vector of uint) +0:77 u: direct index for structure ( temp 4-component vector of uint) +0:77 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:77 Constant: +0:77 0 (const uint) +0:77 direct index ( temp uint) +0:77 'dti' ( in 3-component vector of uint) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 0 (const int) +0:77 Sequence +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 1 (const int) +0:77 Constant: +0:77 2 (const int) +0:77 subgroupQuadBroadcast ( temp 3-component vector of uint) +0:77 vector swizzle ( temp 3-component vector of uint) +0:77 u: direct index for structure ( temp 4-component vector of uint) +0:77 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:77 Constant: +0:77 0 (const uint) +0:77 direct index ( temp uint) +0:77 'dti' ( in 3-component vector of uint) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 0 (const int) +0:77 Sequence +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 1 (const int) +0:77 Constant: +0:77 2 (const int) +0:77 Constant: +0:77 3 (const uint) +0:79 move second child to first child ( temp 4-component vector of int) +0:79 i: direct index for structure ( temp 4-component vector of int) +0:79 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:79 Constant: +0:79 0 (const uint) +0:79 direct index ( temp uint) +0:79 'dti' ( in 3-component vector of uint) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:79 subgroupQuadBroadcast ( temp 4-component vector of int) +0:79 i: direct index for structure ( temp 4-component vector of int) +0:79 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:79 Constant: +0:79 0 (const uint) +0:79 direct index ( temp uint) +0:79 'dti' ( in 3-component vector of uint) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:79 Constant: +0:79 3 (const uint) +0:80 move second child to first child ( temp int) +0:80 direct index ( temp int) +0:80 i: direct index for structure ( temp 4-component vector of int) +0:80 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:80 Constant: +0:80 0 (const uint) +0:80 direct index ( temp uint) +0:80 'dti' ( in 3-component vector of uint) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 1 (const int) +0:80 Constant: +0:80 0 (const int) +0:80 subgroupQuadBroadcast ( temp int) +0:80 direct index ( temp int) +0:80 i: direct index for structure ( temp 4-component vector of int) +0:80 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:80 Constant: +0:80 0 (const uint) +0:80 direct index ( temp uint) +0:80 'dti' ( in 3-component vector of uint) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 1 (const int) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 3 (const uint) +0:81 move second child to first child ( temp 2-component vector of int) +0:81 vector swizzle ( temp 2-component vector of int) +0:81 i: direct index for structure ( temp 4-component vector of int) +0:81 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:81 Constant: +0:81 0 (const uint) +0:81 direct index ( temp uint) +0:81 'dti' ( in 3-component vector of uint) +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Sequence +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 subgroupQuadBroadcast ( temp 2-component vector of int) +0:81 vector swizzle ( temp 2-component vector of int) +0:81 i: direct index for structure ( temp 4-component vector of int) +0:81 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:81 Constant: +0:81 0 (const uint) +0:81 direct index ( temp uint) +0:81 'dti' ( in 3-component vector of uint) +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Sequence +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Constant: +0:81 3 (const uint) +0:82 move second child to first child ( temp 3-component vector of int) +0:82 vector swizzle ( temp 3-component vector of int) +0:82 i: direct index for structure ( temp 4-component vector of int) +0:82 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:82 Constant: +0:82 0 (const uint) +0:82 direct index ( temp uint) +0:82 'dti' ( in 3-component vector of uint) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Sequence +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Constant: +0:82 2 (const int) +0:82 subgroupQuadBroadcast ( temp 3-component vector of int) +0:82 vector swizzle ( temp 3-component vector of int) +0:82 i: direct index for structure ( temp 4-component vector of int) +0:82 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:82 Constant: +0:82 0 (const uint) +0:82 direct index ( temp uint) +0:82 'dti' ( in 3-component vector of uint) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Sequence +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Constant: +0:82 2 (const int) +0:82 Constant: +0:82 3 (const uint) +0:84 move second child to first child ( temp 4-component vector of float) +0:84 f: direct index for structure ( temp 4-component vector of float) +0:84 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:84 Constant: +0:84 0 (const uint) +0:84 direct index ( temp uint) +0:84 'dti' ( in 3-component vector of uint) +0:84 Constant: +0:84 0 (const int) +0:84 Constant: +0:84 2 (const int) +0:84 subgroupQuadBroadcast ( temp 4-component vector of float) +0:84 f: direct index for structure ( temp 4-component vector of float) +0:84 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:84 Constant: +0:84 0 (const uint) +0:84 direct index ( temp uint) +0:84 'dti' ( in 3-component vector of uint) +0:84 Constant: +0:84 0 (const int) +0:84 Constant: +0:84 2 (const int) +0:84 Constant: +0:84 3 (const uint) +0:85 move second child to first child ( temp float) +0:85 direct index ( temp float) +0:85 f: direct index for structure ( temp 4-component vector of float) +0:85 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:85 Constant: +0:85 0 (const uint) +0:85 direct index ( temp uint) +0:85 'dti' ( in 3-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 2 (const int) +0:85 Constant: +0:85 0 (const int) +0:85 subgroupQuadBroadcast ( temp float) +0:85 direct index ( temp float) +0:85 f: direct index for structure ( temp 4-component vector of float) +0:85 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:85 Constant: +0:85 0 (const uint) +0:85 direct index ( temp uint) +0:85 'dti' ( in 3-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 2 (const int) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 3 (const uint) +0:86 move second child to first child ( temp 2-component vector of float) +0:86 vector swizzle ( temp 2-component vector of float) +0:86 f: direct index for structure ( temp 4-component vector of float) +0:86 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:86 Constant: +0:86 0 (const uint) +0:86 direct index ( temp uint) +0:86 'dti' ( in 3-component vector of uint) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 2 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:86 subgroupQuadBroadcast ( temp 2-component vector of float) +0:86 vector swizzle ( temp 2-component vector of float) +0:86 f: direct index for structure ( temp 4-component vector of float) +0:86 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:86 Constant: +0:86 0 (const uint) +0:86 direct index ( temp uint) +0:86 'dti' ( in 3-component vector of uint) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 2 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:86 Constant: +0:86 3 (const uint) +0:87 move second child to first child ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 f: direct index for structure ( temp 4-component vector of float) +0:87 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:87 Constant: +0:87 0 (const uint) +0:87 direct index ( temp uint) +0:87 'dti' ( in 3-component vector of uint) +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 subgroupQuadBroadcast ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 f: direct index for structure ( temp 4-component vector of float) +0:87 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:87 Constant: +0:87 0 (const uint) +0:87 direct index ( temp uint) +0:87 'dti' ( in 3-component vector of uint) +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Constant: +0:87 3 (const uint) +0:89 move second child to first child ( temp 4-component vector of double) +0:89 d: direct index for structure ( temp 4-component vector of double) +0:89 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:89 Constant: +0:89 0 (const uint) +0:89 direct index ( temp uint) +0:89 'dti' ( in 3-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 Constant: +0:89 3 (const int) +0:89 subgroupQuadBroadcast ( temp 4-component vector of double) +0:89 d: direct index for structure ( temp 4-component vector of double) +0:89 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:89 Constant: +0:89 0 (const uint) +0:89 direct index ( temp uint) +0:89 'dti' ( in 3-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 Constant: +0:89 3 (const int) +0:89 Constant: +0:89 3 (const uint) +0:90 move second child to first child ( temp double) +0:90 direct index ( temp double) +0:90 d: direct index for structure ( temp 4-component vector of double) +0:90 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:90 Constant: +0:90 0 (const uint) +0:90 direct index ( temp uint) +0:90 'dti' ( in 3-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const int) +0:90 Constant: +0:90 0 (const int) +0:90 subgroupQuadBroadcast ( temp double) +0:90 direct index ( temp double) +0:90 d: direct index for structure ( temp 4-component vector of double) +0:90 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:90 Constant: +0:90 0 (const uint) +0:90 direct index ( temp uint) +0:90 'dti' ( in 3-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const int) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const uint) +0:91 move second child to first child ( temp 2-component vector of double) +0:91 vector swizzle ( temp 2-component vector of double) +0:91 d: direct index for structure ( temp 4-component vector of double) +0:91 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:91 Constant: +0:91 0 (const uint) +0:91 direct index ( temp uint) +0:91 'dti' ( in 3-component vector of uint) +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 3 (const int) +0:91 Sequence +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 1 (const int) +0:91 subgroupQuadBroadcast ( temp 2-component vector of double) +0:91 vector swizzle ( temp 2-component vector of double) +0:91 d: direct index for structure ( temp 4-component vector of double) +0:91 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:91 Constant: +0:91 0 (const uint) +0:91 direct index ( temp uint) +0:91 'dti' ( in 3-component vector of uint) +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 3 (const int) +0:91 Sequence +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 1 (const int) +0:91 Constant: +0:91 3 (const uint) +0:92 move second child to first child ( temp 3-component vector of double) +0:92 vector swizzle ( temp 3-component vector of double) +0:92 d: direct index for structure ( temp 4-component vector of double) +0:92 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:92 Constant: +0:92 0 (const uint) +0:92 direct index ( temp uint) +0:92 'dti' ( in 3-component vector of uint) +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 3 (const int) +0:92 Sequence +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 1 (const int) +0:92 Constant: +0:92 2 (const int) +0:92 subgroupQuadBroadcast ( temp 3-component vector of double) +0:92 vector swizzle ( temp 3-component vector of double) +0:92 d: direct index for structure ( temp 4-component vector of double) +0:92 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:92 Constant: +0:92 0 (const uint) +0:92 direct index ( temp uint) +0:92 'dti' ( in 3-component vector of uint) +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 3 (const int) +0:92 Sequence +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 1 (const int) +0:92 Constant: +0:92 2 (const int) +0:92 Constant: +0:92 3 (const uint) +0:94 move second child to first child ( temp 4-component vector of uint) +0:94 u: direct index for structure ( temp 4-component vector of uint) +0:94 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:94 Constant: +0:94 0 (const uint) +0:94 direct index ( temp uint) +0:94 'dti' ( in 3-component vector of uint) +0:94 Constant: +0:94 0 (const int) +0:94 Constant: +0:94 0 (const int) +0:94 subgroupQuadSwapHorizontal ( temp 4-component vector of uint) +0:94 u: direct index for structure ( temp 4-component vector of uint) +0:94 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:94 Constant: +0:94 0 (const uint) +0:94 direct index ( temp uint) +0:94 'dti' ( in 3-component vector of uint) +0:94 Constant: +0:94 0 (const int) +0:94 Constant: +0:94 0 (const int) +0:95 move second child to first child ( temp uint) +0:95 direct index ( temp uint) +0:95 u: direct index for structure ( temp 4-component vector of uint) +0:95 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:95 Constant: +0:95 0 (const uint) +0:95 direct index ( temp uint) +0:95 'dti' ( in 3-component vector of uint) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 subgroupQuadSwapHorizontal ( temp uint) +0:95 direct index ( temp uint) +0:95 u: direct index for structure ( temp 4-component vector of uint) +0:95 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:95 Constant: +0:95 0 (const uint) +0:95 direct index ( temp uint) +0:95 'dti' ( in 3-component vector of uint) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:96 move second child to first child ( temp 2-component vector of uint) +0:96 vector swizzle ( temp 2-component vector of uint) +0:96 u: direct index for structure ( temp 4-component vector of uint) +0:96 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:96 Constant: +0:96 0 (const uint) +0:96 direct index ( temp uint) +0:96 'dti' ( in 3-component vector of uint) +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 0 (const int) +0:96 Sequence +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 1 (const int) +0:96 subgroupQuadSwapHorizontal ( temp 2-component vector of uint) +0:96 vector swizzle ( temp 2-component vector of uint) +0:96 u: direct index for structure ( temp 4-component vector of uint) +0:96 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:96 Constant: +0:96 0 (const uint) +0:96 direct index ( temp uint) +0:96 'dti' ( in 3-component vector of uint) +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 0 (const int) +0:96 Sequence +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 1 (const int) +0:97 move second child to first child ( temp 3-component vector of uint) +0:97 vector swizzle ( temp 3-component vector of uint) +0:97 u: direct index for structure ( temp 4-component vector of uint) +0:97 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:97 Constant: +0:97 0 (const uint) +0:97 direct index ( temp uint) +0:97 'dti' ( in 3-component vector of uint) +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 0 (const int) +0:97 Sequence +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 1 (const int) +0:97 Constant: +0:97 2 (const int) +0:97 subgroupQuadSwapHorizontal ( temp 3-component vector of uint) +0:97 vector swizzle ( temp 3-component vector of uint) +0:97 u: direct index for structure ( temp 4-component vector of uint) +0:97 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:97 Constant: +0:97 0 (const uint) +0:97 direct index ( temp uint) +0:97 'dti' ( in 3-component vector of uint) +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 0 (const int) +0:97 Sequence +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 1 (const int) +0:97 Constant: +0:97 2 (const int) +0:99 move second child to first child ( temp 4-component vector of int) +0:99 i: direct index for structure ( temp 4-component vector of int) +0:99 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:99 Constant: +0:99 0 (const uint) +0:99 direct index ( temp uint) +0:99 'dti' ( in 3-component vector of uint) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) +0:99 subgroupQuadSwapHorizontal ( temp 4-component vector of int) +0:99 i: direct index for structure ( temp 4-component vector of int) +0:99 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:99 Constant: +0:99 0 (const uint) +0:99 direct index ( temp uint) +0:99 'dti' ( in 3-component vector of uint) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) +0:100 move second child to first child ( temp int) +0:100 direct index ( temp int) +0:100 i: direct index for structure ( temp 4-component vector of int) +0:100 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:100 Constant: +0:100 0 (const uint) +0:100 direct index ( temp uint) +0:100 'dti' ( in 3-component vector of uint) +0:100 Constant: +0:100 0 (const int) +0:100 Constant: +0:100 1 (const int) +0:100 Constant: +0:100 0 (const int) +0:100 subgroupQuadSwapHorizontal ( temp int) +0:100 direct index ( temp int) +0:100 i: direct index for structure ( temp 4-component vector of int) +0:100 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:100 Constant: +0:100 0 (const uint) +0:100 direct index ( temp uint) +0:100 'dti' ( in 3-component vector of uint) +0:100 Constant: +0:100 0 (const int) +0:100 Constant: +0:100 1 (const int) +0:100 Constant: +0:100 0 (const int) +0:101 move second child to first child ( temp 2-component vector of int) +0:101 vector swizzle ( temp 2-component vector of int) +0:101 i: direct index for structure ( temp 4-component vector of int) +0:101 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:101 Constant: +0:101 0 (const uint) +0:101 direct index ( temp uint) +0:101 'dti' ( in 3-component vector of uint) +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 Sequence +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 subgroupQuadSwapHorizontal ( temp 2-component vector of int) +0:101 vector swizzle ( temp 2-component vector of int) +0:101 i: direct index for structure ( temp 4-component vector of int) +0:101 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:101 Constant: +0:101 0 (const uint) +0:101 direct index ( temp uint) +0:101 'dti' ( in 3-component vector of uint) +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 Sequence +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:102 move second child to first child ( temp 3-component vector of int) +0:102 vector swizzle ( temp 3-component vector of int) +0:102 i: direct index for structure ( temp 4-component vector of int) +0:102 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:102 Constant: +0:102 0 (const uint) +0:102 direct index ( temp uint) +0:102 'dti' ( in 3-component vector of uint) +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Sequence +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Constant: +0:102 2 (const int) +0:102 subgroupQuadSwapHorizontal ( temp 3-component vector of int) +0:102 vector swizzle ( temp 3-component vector of int) +0:102 i: direct index for structure ( temp 4-component vector of int) +0:102 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:102 Constant: +0:102 0 (const uint) +0:102 direct index ( temp uint) +0:102 'dti' ( in 3-component vector of uint) +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Sequence +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Constant: +0:102 2 (const int) +0:104 move second child to first child ( temp 4-component vector of float) +0:104 f: direct index for structure ( temp 4-component vector of float) +0:104 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:104 Constant: +0:104 0 (const uint) +0:104 direct index ( temp uint) +0:104 'dti' ( in 3-component vector of uint) +0:104 Constant: +0:104 0 (const int) +0:104 Constant: +0:104 2 (const int) +0:104 subgroupQuadSwapHorizontal ( temp 4-component vector of float) +0:104 f: direct index for structure ( temp 4-component vector of float) +0:104 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:104 Constant: +0:104 0 (const uint) +0:104 direct index ( temp uint) +0:104 'dti' ( in 3-component vector of uint) +0:104 Constant: +0:104 0 (const int) +0:104 Constant: +0:104 2 (const int) +0:105 move second child to first child ( temp float) +0:105 direct index ( temp float) +0:105 f: direct index for structure ( temp 4-component vector of float) +0:105 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:105 Constant: +0:105 0 (const uint) +0:105 direct index ( temp uint) +0:105 'dti' ( in 3-component vector of uint) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 2 (const int) +0:105 Constant: +0:105 0 (const int) +0:105 subgroupQuadSwapHorizontal ( temp float) +0:105 direct index ( temp float) +0:105 f: direct index for structure ( temp 4-component vector of float) +0:105 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:105 Constant: +0:105 0 (const uint) +0:105 direct index ( temp uint) +0:105 'dti' ( in 3-component vector of uint) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 2 (const int) +0:105 Constant: +0:105 0 (const int) +0:106 move second child to first child ( temp 2-component vector of float) +0:106 vector swizzle ( temp 2-component vector of float) +0:106 f: direct index for structure ( temp 4-component vector of float) +0:106 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:106 Constant: +0:106 0 (const uint) +0:106 direct index ( temp uint) +0:106 'dti' ( in 3-component vector of uint) +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 2 (const int) +0:106 Sequence +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 1 (const int) +0:106 subgroupQuadSwapHorizontal ( temp 2-component vector of float) +0:106 vector swizzle ( temp 2-component vector of float) +0:106 f: direct index for structure ( temp 4-component vector of float) +0:106 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:106 Constant: +0:106 0 (const uint) +0:106 direct index ( temp uint) +0:106 'dti' ( in 3-component vector of uint) +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 2 (const int) +0:106 Sequence +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 1 (const int) +0:107 move second child to first child ( temp 3-component vector of float) +0:107 vector swizzle ( temp 3-component vector of float) +0:107 f: direct index for structure ( temp 4-component vector of float) +0:107 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:107 Constant: +0:107 0 (const uint) +0:107 direct index ( temp uint) +0:107 'dti' ( in 3-component vector of uint) +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 2 (const int) +0:107 Sequence +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 1 (const int) +0:107 Constant: +0:107 2 (const int) +0:107 subgroupQuadSwapHorizontal ( temp 3-component vector of float) +0:107 vector swizzle ( temp 3-component vector of float) +0:107 f: direct index for structure ( temp 4-component vector of float) +0:107 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:107 Constant: +0:107 0 (const uint) +0:107 direct index ( temp uint) +0:107 'dti' ( in 3-component vector of uint) +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 2 (const int) +0:107 Sequence +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 1 (const int) +0:107 Constant: +0:107 2 (const int) +0:109 move second child to first child ( temp 4-component vector of double) +0:109 d: direct index for structure ( temp 4-component vector of double) +0:109 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:109 Constant: +0:109 0 (const uint) +0:109 direct index ( temp uint) +0:109 'dti' ( in 3-component vector of uint) +0:109 Constant: +0:109 0 (const int) +0:109 Constant: +0:109 3 (const int) +0:109 subgroupQuadSwapHorizontal ( temp 4-component vector of double) +0:109 d: direct index for structure ( temp 4-component vector of double) +0:109 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:109 Constant: +0:109 0 (const uint) +0:109 direct index ( temp uint) +0:109 'dti' ( in 3-component vector of uint) +0:109 Constant: +0:109 0 (const int) +0:109 Constant: +0:109 3 (const int) +0:110 move second child to first child ( temp double) +0:110 direct index ( temp double) +0:110 d: direct index for structure ( temp 4-component vector of double) +0:110 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:110 Constant: +0:110 0 (const uint) +0:110 direct index ( temp uint) +0:110 'dti' ( in 3-component vector of uint) +0:110 Constant: +0:110 0 (const int) +0:110 Constant: +0:110 3 (const int) +0:110 Constant: +0:110 0 (const int) +0:110 subgroupQuadSwapHorizontal ( temp double) +0:110 direct index ( temp double) +0:110 d: direct index for structure ( temp 4-component vector of double) +0:110 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:110 Constant: +0:110 0 (const uint) +0:110 direct index ( temp uint) +0:110 'dti' ( in 3-component vector of uint) +0:110 Constant: +0:110 0 (const int) +0:110 Constant: +0:110 3 (const int) +0:110 Constant: +0:110 0 (const int) +0:111 move second child to first child ( temp 2-component vector of double) +0:111 vector swizzle ( temp 2-component vector of double) +0:111 d: direct index for structure ( temp 4-component vector of double) +0:111 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:111 Constant: +0:111 0 (const uint) +0:111 direct index ( temp uint) +0:111 'dti' ( in 3-component vector of uint) +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 3 (const int) +0:111 Sequence +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:111 subgroupQuadSwapHorizontal ( temp 2-component vector of double) +0:111 vector swizzle ( temp 2-component vector of double) +0:111 d: direct index for structure ( temp 4-component vector of double) +0:111 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:111 Constant: +0:111 0 (const uint) +0:111 direct index ( temp uint) +0:111 'dti' ( in 3-component vector of uint) +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 3 (const int) +0:111 Sequence +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:112 move second child to first child ( temp 3-component vector of double) +0:112 vector swizzle ( temp 3-component vector of double) +0:112 d: direct index for structure ( temp 4-component vector of double) +0:112 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:112 Constant: +0:112 0 (const uint) +0:112 direct index ( temp uint) +0:112 'dti' ( in 3-component vector of uint) +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 3 (const int) +0:112 Sequence +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Constant: +0:112 2 (const int) +0:112 subgroupQuadSwapHorizontal ( temp 3-component vector of double) +0:112 vector swizzle ( temp 3-component vector of double) +0:112 d: direct index for structure ( temp 4-component vector of double) +0:112 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:112 Constant: +0:112 0 (const uint) +0:112 direct index ( temp uint) +0:112 'dti' ( in 3-component vector of uint) +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 3 (const int) +0:112 Sequence +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Constant: +0:112 2 (const int) +0:114 move second child to first child ( temp 4-component vector of uint) +0:114 u: direct index for structure ( temp 4-component vector of uint) +0:114 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:114 Constant: +0:114 0 (const uint) +0:114 direct index ( temp uint) +0:114 'dti' ( in 3-component vector of uint) +0:114 Constant: +0:114 0 (const int) +0:114 Constant: +0:114 0 (const int) +0:114 subgroupQuadSwapVertical ( temp 4-component vector of uint) +0:114 u: direct index for structure ( temp 4-component vector of uint) +0:114 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:114 Constant: +0:114 0 (const uint) +0:114 direct index ( temp uint) +0:114 'dti' ( in 3-component vector of uint) +0:114 Constant: +0:114 0 (const int) +0:114 Constant: +0:114 0 (const int) +0:115 move second child to first child ( temp uint) +0:115 direct index ( temp uint) +0:115 u: direct index for structure ( temp 4-component vector of uint) +0:115 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:115 Constant: +0:115 0 (const uint) +0:115 direct index ( temp uint) +0:115 'dti' ( in 3-component vector of uint) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 subgroupQuadSwapVertical ( temp uint) +0:115 direct index ( temp uint) +0:115 u: direct index for structure ( temp 4-component vector of uint) +0:115 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:115 Constant: +0:115 0 (const uint) +0:115 direct index ( temp uint) +0:115 'dti' ( in 3-component vector of uint) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:116 move second child to first child ( temp 2-component vector of uint) +0:116 vector swizzle ( temp 2-component vector of uint) +0:116 u: direct index for structure ( temp 4-component vector of uint) +0:116 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:116 Constant: +0:116 0 (const uint) +0:116 direct index ( temp uint) +0:116 'dti' ( in 3-component vector of uint) +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 0 (const int) +0:116 Sequence +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 1 (const int) +0:116 subgroupQuadSwapVertical ( temp 2-component vector of uint) +0:116 vector swizzle ( temp 2-component vector of uint) +0:116 u: direct index for structure ( temp 4-component vector of uint) +0:116 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:116 Constant: +0:116 0 (const uint) +0:116 direct index ( temp uint) +0:116 'dti' ( in 3-component vector of uint) +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 0 (const int) +0:116 Sequence +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 1 (const int) +0:117 move second child to first child ( temp 3-component vector of uint) +0:117 vector swizzle ( temp 3-component vector of uint) +0:117 u: direct index for structure ( temp 4-component vector of uint) +0:117 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:117 Constant: +0:117 0 (const uint) +0:117 direct index ( temp uint) +0:117 'dti' ( in 3-component vector of uint) +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 0 (const int) +0:117 Sequence +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 1 (const int) +0:117 Constant: +0:117 2 (const int) +0:117 subgroupQuadSwapVertical ( temp 3-component vector of uint) +0:117 vector swizzle ( temp 3-component vector of uint) +0:117 u: direct index for structure ( temp 4-component vector of uint) +0:117 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:117 Constant: +0:117 0 (const uint) +0:117 direct index ( temp uint) +0:117 'dti' ( in 3-component vector of uint) +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 0 (const int) +0:117 Sequence +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 1 (const int) +0:117 Constant: +0:117 2 (const int) +0:119 move second child to first child ( temp 4-component vector of int) +0:119 i: direct index for structure ( temp 4-component vector of int) +0:119 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:119 Constant: +0:119 0 (const uint) +0:119 direct index ( temp uint) +0:119 'dti' ( in 3-component vector of uint) +0:119 Constant: +0:119 0 (const int) +0:119 Constant: +0:119 1 (const int) +0:119 subgroupQuadSwapVertical ( temp 4-component vector of int) +0:119 i: direct index for structure ( temp 4-component vector of int) +0:119 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:119 Constant: +0:119 0 (const uint) +0:119 direct index ( temp uint) +0:119 'dti' ( in 3-component vector of uint) +0:119 Constant: +0:119 0 (const int) +0:119 Constant: +0:119 1 (const int) +0:120 move second child to first child ( temp int) +0:120 direct index ( temp int) +0:120 i: direct index for structure ( temp 4-component vector of int) +0:120 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:120 Constant: +0:120 0 (const uint) +0:120 direct index ( temp uint) +0:120 'dti' ( in 3-component vector of uint) +0:120 Constant: +0:120 0 (const int) +0:120 Constant: +0:120 1 (const int) +0:120 Constant: +0:120 0 (const int) +0:120 subgroupQuadSwapVertical ( temp int) +0:120 direct index ( temp int) +0:120 i: direct index for structure ( temp 4-component vector of int) +0:120 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:120 Constant: +0:120 0 (const uint) +0:120 direct index ( temp uint) +0:120 'dti' ( in 3-component vector of uint) +0:120 Constant: +0:120 0 (const int) +0:120 Constant: +0:120 1 (const int) +0:120 Constant: +0:120 0 (const int) +0:121 move second child to first child ( temp 2-component vector of int) +0:121 vector swizzle ( temp 2-component vector of int) +0:121 i: direct index for structure ( temp 4-component vector of int) +0:121 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:121 Constant: +0:121 0 (const uint) +0:121 direct index ( temp uint) +0:121 'dti' ( in 3-component vector of uint) +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 Sequence +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 subgroupQuadSwapVertical ( temp 2-component vector of int) +0:121 vector swizzle ( temp 2-component vector of int) +0:121 i: direct index for structure ( temp 4-component vector of int) +0:121 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:121 Constant: +0:121 0 (const uint) +0:121 direct index ( temp uint) +0:121 'dti' ( in 3-component vector of uint) +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 Sequence +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:122 move second child to first child ( temp 3-component vector of int) +0:122 vector swizzle ( temp 3-component vector of int) +0:122 i: direct index for structure ( temp 4-component vector of int) +0:122 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:122 Constant: +0:122 0 (const uint) +0:122 direct index ( temp uint) +0:122 'dti' ( in 3-component vector of uint) +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Sequence +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Constant: +0:122 2 (const int) +0:122 subgroupQuadSwapVertical ( temp 3-component vector of int) +0:122 vector swizzle ( temp 3-component vector of int) +0:122 i: direct index for structure ( temp 4-component vector of int) +0:122 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:122 Constant: +0:122 0 (const uint) +0:122 direct index ( temp uint) +0:122 'dti' ( in 3-component vector of uint) +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Sequence +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Constant: +0:122 2 (const int) +0:124 move second child to first child ( temp 4-component vector of float) +0:124 f: direct index for structure ( temp 4-component vector of float) +0:124 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:124 Constant: +0:124 0 (const uint) +0:124 direct index ( temp uint) +0:124 'dti' ( in 3-component vector of uint) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 2 (const int) +0:124 subgroupQuadSwapVertical ( temp 4-component vector of float) +0:124 f: direct index for structure ( temp 4-component vector of float) +0:124 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:124 Constant: +0:124 0 (const uint) +0:124 direct index ( temp uint) +0:124 'dti' ( in 3-component vector of uint) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 2 (const int) +0:125 move second child to first child ( temp float) +0:125 direct index ( temp float) +0:125 f: direct index for structure ( temp 4-component vector of float) +0:125 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:125 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:125 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:125 Constant: +0:125 0 (const uint) +0:125 direct index ( temp uint) +0:125 'dti' ( in 3-component vector of uint) +0:125 Constant: +0:125 0 (const int) +0:125 Constant: +0:125 2 (const int) +0:125 Constant: +0:125 0 (const int) +0:125 subgroupQuadSwapVertical ( temp float) +0:125 direct index ( temp float) +0:125 f: direct index for structure ( temp 4-component vector of float) +0:125 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:125 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:125 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:125 Constant: +0:125 0 (const uint) +0:125 direct index ( temp uint) +0:125 'dti' ( in 3-component vector of uint) +0:125 Constant: +0:125 0 (const int) +0:125 Constant: +0:125 2 (const int) +0:125 Constant: +0:125 0 (const int) +0:126 move second child to first child ( temp 2-component vector of float) +0:126 vector swizzle ( temp 2-component vector of float) +0:126 f: direct index for structure ( temp 4-component vector of float) +0:126 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:126 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:126 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:126 Constant: +0:126 0 (const uint) +0:126 direct index ( temp uint) +0:126 'dti' ( in 3-component vector of uint) +0:126 Constant: +0:126 0 (const int) +0:126 Constant: +0:126 2 (const int) +0:126 Sequence +0:126 Constant: +0:126 0 (const int) +0:126 Constant: +0:126 1 (const int) +0:126 subgroupQuadSwapVertical ( temp 2-component vector of float) +0:126 vector swizzle ( temp 2-component vector of float) +0:126 f: direct index for structure ( temp 4-component vector of float) +0:126 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:126 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:126 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:126 Constant: +0:126 0 (const uint) +0:126 direct index ( temp uint) +0:126 'dti' ( in 3-component vector of uint) +0:126 Constant: +0:126 0 (const int) +0:126 Constant: +0:126 2 (const int) +0:126 Sequence +0:126 Constant: +0:126 0 (const int) +0:126 Constant: +0:126 1 (const int) +0:127 move second child to first child ( temp 3-component vector of float) +0:127 vector swizzle ( temp 3-component vector of float) +0:127 f: direct index for structure ( temp 4-component vector of float) +0:127 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:127 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:127 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:127 Constant: +0:127 0 (const uint) +0:127 direct index ( temp uint) +0:127 'dti' ( in 3-component vector of uint) +0:127 Constant: +0:127 0 (const int) +0:127 Constant: +0:127 2 (const int) +0:127 Sequence +0:127 Constant: +0:127 0 (const int) +0:127 Constant: +0:127 1 (const int) +0:127 Constant: +0:127 2 (const int) +0:127 subgroupQuadSwapVertical ( temp 3-component vector of float) +0:127 vector swizzle ( temp 3-component vector of float) +0:127 f: direct index for structure ( temp 4-component vector of float) +0:127 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:127 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:127 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:127 Constant: +0:127 0 (const uint) +0:127 direct index ( temp uint) +0:127 'dti' ( in 3-component vector of uint) +0:127 Constant: +0:127 0 (const int) +0:127 Constant: +0:127 2 (const int) +0:127 Sequence +0:127 Constant: +0:127 0 (const int) +0:127 Constant: +0:127 1 (const int) +0:127 Constant: +0:127 2 (const int) +0:129 move second child to first child ( temp 4-component vector of double) +0:129 d: direct index for structure ( temp 4-component vector of double) +0:129 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:129 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:129 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:129 Constant: +0:129 0 (const uint) +0:129 direct index ( temp uint) +0:129 'dti' ( in 3-component vector of uint) +0:129 Constant: +0:129 0 (const int) +0:129 Constant: +0:129 3 (const int) +0:129 subgroupQuadSwapVertical ( temp 4-component vector of double) +0:129 d: direct index for structure ( temp 4-component vector of double) +0:129 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:129 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:129 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:129 Constant: +0:129 0 (const uint) +0:129 direct index ( temp uint) +0:129 'dti' ( in 3-component vector of uint) +0:129 Constant: +0:129 0 (const int) +0:129 Constant: +0:129 3 (const int) +0:130 move second child to first child ( temp double) +0:130 direct index ( temp double) +0:130 d: direct index for structure ( temp 4-component vector of double) +0:130 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:130 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:130 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:130 Constant: +0:130 0 (const uint) +0:130 direct index ( temp uint) +0:130 'dti' ( in 3-component vector of uint) +0:130 Constant: +0:130 0 (const int) +0:130 Constant: +0:130 3 (const int) +0:130 Constant: +0:130 0 (const int) +0:130 subgroupQuadSwapVertical ( temp double) +0:130 direct index ( temp double) +0:130 d: direct index for structure ( temp 4-component vector of double) +0:130 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:130 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:130 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:130 Constant: +0:130 0 (const uint) +0:130 direct index ( temp uint) +0:130 'dti' ( in 3-component vector of uint) +0:130 Constant: +0:130 0 (const int) +0:130 Constant: +0:130 3 (const int) +0:130 Constant: +0:130 0 (const int) +0:131 move second child to first child ( temp 2-component vector of double) +0:131 vector swizzle ( temp 2-component vector of double) +0:131 d: direct index for structure ( temp 4-component vector of double) +0:131 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:131 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:131 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:131 Constant: +0:131 0 (const uint) +0:131 direct index ( temp uint) +0:131 'dti' ( in 3-component vector of uint) +0:131 Constant: +0:131 0 (const int) +0:131 Constant: +0:131 3 (const int) +0:131 Sequence +0:131 Constant: +0:131 0 (const int) +0:131 Constant: +0:131 1 (const int) +0:131 subgroupQuadSwapVertical ( temp 2-component vector of double) +0:131 vector swizzle ( temp 2-component vector of double) +0:131 d: direct index for structure ( temp 4-component vector of double) +0:131 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:131 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:131 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:131 Constant: +0:131 0 (const uint) +0:131 direct index ( temp uint) +0:131 'dti' ( in 3-component vector of uint) +0:131 Constant: +0:131 0 (const int) +0:131 Constant: +0:131 3 (const int) +0:131 Sequence +0:131 Constant: +0:131 0 (const int) +0:131 Constant: +0:131 1 (const int) +0:132 move second child to first child ( temp 3-component vector of double) +0:132 vector swizzle ( temp 3-component vector of double) +0:132 d: direct index for structure ( temp 4-component vector of double) +0:132 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:132 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:132 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:132 Constant: +0:132 0 (const uint) +0:132 direct index ( temp uint) +0:132 'dti' ( in 3-component vector of uint) +0:132 Constant: +0:132 0 (const int) +0:132 Constant: +0:132 3 (const int) +0:132 Sequence +0:132 Constant: +0:132 0 (const int) +0:132 Constant: +0:132 1 (const int) +0:132 Constant: +0:132 2 (const int) +0:132 subgroupQuadSwapVertical ( temp 3-component vector of double) +0:132 vector swizzle ( temp 3-component vector of double) +0:132 d: direct index for structure ( temp 4-component vector of double) +0:132 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:132 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:132 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:132 Constant: +0:132 0 (const uint) +0:132 direct index ( temp uint) +0:132 'dti' ( in 3-component vector of uint) +0:132 Constant: +0:132 0 (const int) +0:132 Constant: +0:132 3 (const int) +0:132 Sequence +0:132 Constant: +0:132 0 (const int) +0:132 Constant: +0:132 1 (const int) +0:132 Constant: +0:132 2 (const int) +0:134 move second child to first child ( temp 4-component vector of uint) +0:134 u: direct index for structure ( temp 4-component vector of uint) +0:134 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:134 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:134 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:134 Constant: +0:134 0 (const uint) +0:134 direct index ( temp uint) +0:134 'dti' ( in 3-component vector of uint) +0:134 Constant: +0:134 0 (const int) +0:134 Constant: +0:134 0 (const int) +0:134 subgroupQuadSwapDiagonal ( temp 4-component vector of uint) +0:134 u: direct index for structure ( temp 4-component vector of uint) +0:134 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:134 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:134 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:134 Constant: +0:134 0 (const uint) +0:134 direct index ( temp uint) +0:134 'dti' ( in 3-component vector of uint) +0:134 Constant: +0:134 0 (const int) +0:134 Constant: +0:134 0 (const int) +0:135 move second child to first child ( temp uint) +0:135 direct index ( temp uint) +0:135 u: direct index for structure ( temp 4-component vector of uint) +0:135 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:135 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:135 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:135 Constant: +0:135 0 (const uint) +0:135 direct index ( temp uint) +0:135 'dti' ( in 3-component vector of uint) +0:135 Constant: +0:135 0 (const int) +0:135 Constant: +0:135 0 (const int) +0:135 Constant: +0:135 0 (const int) +0:135 subgroupQuadSwapDiagonal ( temp uint) +0:135 direct index ( temp uint) +0:135 u: direct index for structure ( temp 4-component vector of uint) +0:135 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:135 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:135 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:135 Constant: +0:135 0 (const uint) +0:135 direct index ( temp uint) +0:135 'dti' ( in 3-component vector of uint) +0:135 Constant: +0:135 0 (const int) +0:135 Constant: +0:135 0 (const int) +0:135 Constant: +0:135 0 (const int) +0:136 move second child to first child ( temp 2-component vector of uint) +0:136 vector swizzle ( temp 2-component vector of uint) +0:136 u: direct index for structure ( temp 4-component vector of uint) +0:136 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:136 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:136 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:136 Constant: +0:136 0 (const uint) +0:136 direct index ( temp uint) +0:136 'dti' ( in 3-component vector of uint) +0:136 Constant: +0:136 0 (const int) +0:136 Constant: +0:136 0 (const int) +0:136 Sequence +0:136 Constant: +0:136 0 (const int) +0:136 Constant: +0:136 1 (const int) +0:136 subgroupQuadSwapDiagonal ( temp 2-component vector of uint) +0:136 vector swizzle ( temp 2-component vector of uint) +0:136 u: direct index for structure ( temp 4-component vector of uint) +0:136 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:136 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:136 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:136 Constant: +0:136 0 (const uint) +0:136 direct index ( temp uint) +0:136 'dti' ( in 3-component vector of uint) +0:136 Constant: +0:136 0 (const int) +0:136 Constant: +0:136 0 (const int) +0:136 Sequence +0:136 Constant: +0:136 0 (const int) +0:136 Constant: +0:136 1 (const int) +0:137 move second child to first child ( temp 3-component vector of uint) +0:137 vector swizzle ( temp 3-component vector of uint) +0:137 u: direct index for structure ( temp 4-component vector of uint) +0:137 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:137 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:137 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:137 Constant: +0:137 0 (const uint) +0:137 direct index ( temp uint) +0:137 'dti' ( in 3-component vector of uint) +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 0 (const int) +0:137 Sequence +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 1 (const int) +0:137 Constant: +0:137 2 (const int) +0:137 subgroupQuadSwapDiagonal ( temp 3-component vector of uint) +0:137 vector swizzle ( temp 3-component vector of uint) +0:137 u: direct index for structure ( temp 4-component vector of uint) +0:137 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:137 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:137 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:137 Constant: +0:137 0 (const uint) +0:137 direct index ( temp uint) +0:137 'dti' ( in 3-component vector of uint) +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 0 (const int) +0:137 Sequence +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 1 (const int) +0:137 Constant: +0:137 2 (const int) +0:139 move second child to first child ( temp 4-component vector of int) +0:139 i: direct index for structure ( temp 4-component vector of int) +0:139 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:139 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:139 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:139 Constant: +0:139 0 (const uint) +0:139 direct index ( temp uint) +0:139 'dti' ( in 3-component vector of uint) +0:139 Constant: +0:139 0 (const int) +0:139 Constant: +0:139 1 (const int) +0:139 subgroupQuadSwapDiagonal ( temp 4-component vector of int) +0:139 i: direct index for structure ( temp 4-component vector of int) +0:139 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:139 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:139 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:139 Constant: +0:139 0 (const uint) +0:139 direct index ( temp uint) +0:139 'dti' ( in 3-component vector of uint) +0:139 Constant: +0:139 0 (const int) +0:139 Constant: +0:139 1 (const int) +0:140 move second child to first child ( temp int) +0:140 direct index ( temp int) +0:140 i: direct index for structure ( temp 4-component vector of int) +0:140 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:140 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:140 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:140 Constant: +0:140 0 (const uint) +0:140 direct index ( temp uint) +0:140 'dti' ( in 3-component vector of uint) +0:140 Constant: +0:140 0 (const int) +0:140 Constant: +0:140 1 (const int) +0:140 Constant: +0:140 0 (const int) +0:140 subgroupQuadSwapDiagonal ( temp int) +0:140 direct index ( temp int) +0:140 i: direct index for structure ( temp 4-component vector of int) +0:140 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:140 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:140 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:140 Constant: +0:140 0 (const uint) +0:140 direct index ( temp uint) +0:140 'dti' ( in 3-component vector of uint) +0:140 Constant: +0:140 0 (const int) +0:140 Constant: +0:140 1 (const int) +0:140 Constant: +0:140 0 (const int) +0:141 move second child to first child ( temp 2-component vector of int) +0:141 vector swizzle ( temp 2-component vector of int) +0:141 i: direct index for structure ( temp 4-component vector of int) +0:141 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:141 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:141 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:141 Constant: +0:141 0 (const uint) +0:141 direct index ( temp uint) +0:141 'dti' ( in 3-component vector of uint) +0:141 Constant: +0:141 0 (const int) +0:141 Constant: +0:141 1 (const int) +0:141 Sequence +0:141 Constant: +0:141 0 (const int) +0:141 Constant: +0:141 1 (const int) +0:141 subgroupQuadSwapDiagonal ( temp 2-component vector of int) +0:141 vector swizzle ( temp 2-component vector of int) +0:141 i: direct index for structure ( temp 4-component vector of int) +0:141 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:141 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:141 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:141 Constant: +0:141 0 (const uint) +0:141 direct index ( temp uint) +0:141 'dti' ( in 3-component vector of uint) +0:141 Constant: +0:141 0 (const int) +0:141 Constant: +0:141 1 (const int) +0:141 Sequence +0:141 Constant: +0:141 0 (const int) +0:141 Constant: +0:141 1 (const int) +0:142 move second child to first child ( temp 3-component vector of int) +0:142 vector swizzle ( temp 3-component vector of int) +0:142 i: direct index for structure ( temp 4-component vector of int) +0:142 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:142 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:142 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:142 Constant: +0:142 0 (const uint) +0:142 direct index ( temp uint) +0:142 'dti' ( in 3-component vector of uint) +0:142 Constant: +0:142 0 (const int) +0:142 Constant: +0:142 1 (const int) +0:142 Sequence +0:142 Constant: +0:142 0 (const int) +0:142 Constant: +0:142 1 (const int) +0:142 Constant: +0:142 2 (const int) +0:142 subgroupQuadSwapDiagonal ( temp 3-component vector of int) +0:142 vector swizzle ( temp 3-component vector of int) +0:142 i: direct index for structure ( temp 4-component vector of int) +0:142 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:142 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:142 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:142 Constant: +0:142 0 (const uint) +0:142 direct index ( temp uint) +0:142 'dti' ( in 3-component vector of uint) +0:142 Constant: +0:142 0 (const int) +0:142 Constant: +0:142 1 (const int) +0:142 Sequence +0:142 Constant: +0:142 0 (const int) +0:142 Constant: +0:142 1 (const int) +0:142 Constant: +0:142 2 (const int) +0:144 move second child to first child ( temp 4-component vector of float) +0:144 f: direct index for structure ( temp 4-component vector of float) +0:144 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:144 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:144 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:144 Constant: +0:144 0 (const uint) +0:144 direct index ( temp uint) +0:144 'dti' ( in 3-component vector of uint) +0:144 Constant: +0:144 0 (const int) +0:144 Constant: +0:144 2 (const int) +0:144 subgroupQuadSwapDiagonal ( temp 4-component vector of float) +0:144 f: direct index for structure ( temp 4-component vector of float) +0:144 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:144 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:144 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:144 Constant: +0:144 0 (const uint) +0:144 direct index ( temp uint) +0:144 'dti' ( in 3-component vector of uint) +0:144 Constant: +0:144 0 (const int) +0:144 Constant: +0:144 2 (const int) +0:145 move second child to first child ( temp float) +0:145 direct index ( temp float) +0:145 f: direct index for structure ( temp 4-component vector of float) +0:145 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:145 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:145 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:145 Constant: +0:145 0 (const uint) +0:145 direct index ( temp uint) +0:145 'dti' ( in 3-component vector of uint) +0:145 Constant: +0:145 0 (const int) +0:145 Constant: +0:145 2 (const int) +0:145 Constant: +0:145 0 (const int) +0:145 subgroupQuadSwapDiagonal ( temp float) +0:145 direct index ( temp float) +0:145 f: direct index for structure ( temp 4-component vector of float) +0:145 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:145 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:145 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:145 Constant: +0:145 0 (const uint) +0:145 direct index ( temp uint) +0:145 'dti' ( in 3-component vector of uint) +0:145 Constant: +0:145 0 (const int) +0:145 Constant: +0:145 2 (const int) +0:145 Constant: +0:145 0 (const int) +0:146 move second child to first child ( temp 2-component vector of float) +0:146 vector swizzle ( temp 2-component vector of float) +0:146 f: direct index for structure ( temp 4-component vector of float) +0:146 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:146 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:146 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:146 Constant: +0:146 0 (const uint) +0:146 direct index ( temp uint) +0:146 'dti' ( in 3-component vector of uint) +0:146 Constant: +0:146 0 (const int) +0:146 Constant: +0:146 2 (const int) +0:146 Sequence +0:146 Constant: +0:146 0 (const int) +0:146 Constant: +0:146 1 (const int) +0:146 subgroupQuadSwapDiagonal ( temp 2-component vector of float) +0:146 vector swizzle ( temp 2-component vector of float) +0:146 f: direct index for structure ( temp 4-component vector of float) +0:146 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:146 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:146 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:146 Constant: +0:146 0 (const uint) +0:146 direct index ( temp uint) +0:146 'dti' ( in 3-component vector of uint) +0:146 Constant: +0:146 0 (const int) +0:146 Constant: +0:146 2 (const int) +0:146 Sequence +0:146 Constant: +0:146 0 (const int) +0:146 Constant: +0:146 1 (const int) +0:147 move second child to first child ( temp 3-component vector of float) +0:147 vector swizzle ( temp 3-component vector of float) +0:147 f: direct index for structure ( temp 4-component vector of float) +0:147 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:147 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:147 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:147 Constant: +0:147 0 (const uint) +0:147 direct index ( temp uint) +0:147 'dti' ( in 3-component vector of uint) +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 2 (const int) +0:147 Sequence +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 1 (const int) +0:147 Constant: +0:147 2 (const int) +0:147 subgroupQuadSwapDiagonal ( temp 3-component vector of float) +0:147 vector swizzle ( temp 3-component vector of float) +0:147 f: direct index for structure ( temp 4-component vector of float) +0:147 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:147 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:147 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:147 Constant: +0:147 0 (const uint) +0:147 direct index ( temp uint) +0:147 'dti' ( in 3-component vector of uint) +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 2 (const int) +0:147 Sequence +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 1 (const int) +0:147 Constant: +0:147 2 (const int) +0:149 move second child to first child ( temp 4-component vector of double) +0:149 d: direct index for structure ( temp 4-component vector of double) +0:149 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:149 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:149 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:149 Constant: +0:149 0 (const uint) +0:149 direct index ( temp uint) +0:149 'dti' ( in 3-component vector of uint) +0:149 Constant: +0:149 0 (const int) +0:149 Constant: +0:149 3 (const int) +0:149 subgroupQuadSwapDiagonal ( temp 4-component vector of double) +0:149 d: direct index for structure ( temp 4-component vector of double) +0:149 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:149 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:149 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:149 Constant: +0:149 0 (const uint) +0:149 direct index ( temp uint) +0:149 'dti' ( in 3-component vector of uint) +0:149 Constant: +0:149 0 (const int) +0:149 Constant: +0:149 3 (const int) +0:150 move second child to first child ( temp double) +0:150 direct index ( temp double) +0:150 d: direct index for structure ( temp 4-component vector of double) +0:150 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:150 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:150 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:150 Constant: +0:150 0 (const uint) +0:150 direct index ( temp uint) +0:150 'dti' ( in 3-component vector of uint) +0:150 Constant: +0:150 0 (const int) +0:150 Constant: +0:150 3 (const int) +0:150 Constant: +0:150 0 (const int) +0:150 subgroupQuadSwapDiagonal ( temp double) +0:150 direct index ( temp double) +0:150 d: direct index for structure ( temp 4-component vector of double) +0:150 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:150 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:150 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:150 Constant: +0:150 0 (const uint) +0:150 direct index ( temp uint) +0:150 'dti' ( in 3-component vector of uint) +0:150 Constant: +0:150 0 (const int) +0:150 Constant: +0:150 3 (const int) +0:150 Constant: +0:150 0 (const int) +0:151 move second child to first child ( temp 2-component vector of double) +0:151 vector swizzle ( temp 2-component vector of double) +0:151 d: direct index for structure ( temp 4-component vector of double) +0:151 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:151 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:151 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:151 Constant: +0:151 0 (const uint) +0:151 direct index ( temp uint) +0:151 'dti' ( in 3-component vector of uint) +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 3 (const int) +0:151 Sequence +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 1 (const int) +0:151 subgroupQuadSwapDiagonal ( temp 2-component vector of double) +0:151 vector swizzle ( temp 2-component vector of double) +0:151 d: direct index for structure ( temp 4-component vector of double) +0:151 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:151 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:151 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:151 Constant: +0:151 0 (const uint) +0:151 direct index ( temp uint) +0:151 'dti' ( in 3-component vector of uint) +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 3 (const int) +0:151 Sequence +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 1 (const int) +0:152 move second child to first child ( temp 3-component vector of double) +0:152 vector swizzle ( temp 3-component vector of double) +0:152 d: direct index for structure ( temp 4-component vector of double) +0:152 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:152 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:152 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:152 Constant: +0:152 0 (const uint) +0:152 direct index ( temp uint) +0:152 'dti' ( in 3-component vector of uint) +0:152 Constant: +0:152 0 (const int) +0:152 Constant: +0:152 3 (const int) +0:152 Sequence +0:152 Constant: +0:152 0 (const int) +0:152 Constant: +0:152 1 (const int) +0:152 Constant: +0:152 2 (const int) +0:152 subgroupQuadSwapDiagonal ( temp 3-component vector of double) +0:152 vector swizzle ( temp 3-component vector of double) +0:152 d: direct index for structure ( temp 4-component vector of double) +0:152 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:152 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:152 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:152 Constant: +0:152 0 (const uint) +0:152 direct index ( temp uint) +0:152 'dti' ( in 3-component vector of uint) +0:152 Constant: +0:152 0 (const int) +0:152 Constant: +0:152 3 (const int) +0:152 Sequence +0:152 Constant: +0:152 0 (const int) +0:152 Constant: +0:152 1 (const int) +0:152 Constant: +0:152 2 (const int) +0:13 Function Definition: CSMain( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:13 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:13 Function Definition: @CSMain(vu3; ( temp void) +0:13 Function Parameters: +0:13 'dti' ( in 3-component vector of uint) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 subgroupQuadBroadcast ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const uint) +0:15 move second child to first child ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 subgroupQuadBroadcast ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const uint) +0:16 move second child to first child ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 subgroupQuadBroadcast ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 0 (const uint) +0:17 move second child to first child ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 subgroupQuadBroadcast ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 0 (const uint) +0:19 move second child to first child ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 subgroupQuadBroadcast ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 0 (const uint) +0:20 move second child to first child ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 subgroupQuadBroadcast ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 0 (const uint) +0:21 move second child to first child ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 subgroupQuadBroadcast ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 0 (const uint) +0:22 move second child to first child ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 subgroupQuadBroadcast ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 Constant: +0:22 0 (const uint) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 subgroupQuadBroadcast ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 0 (const uint) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 subgroupQuadBroadcast ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 0 (const uint) +0:26 move second child to first child ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 subgroupQuadBroadcast ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 Constant: +0:26 0 (const uint) +0:27 move second child to first child ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 subgroupQuadBroadcast ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Constant: +0:27 0 (const uint) +0:29 move second child to first child ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 subgroupQuadBroadcast ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 Constant: +0:29 0 (const uint) +0:30 move second child to first child ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 subgroupQuadBroadcast ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 0 (const uint) +0:31 move second child to first child ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 subgroupQuadBroadcast ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 Constant: +0:31 0 (const uint) +0:32 move second child to first child ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 subgroupQuadBroadcast ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 Constant: +0:32 0 (const uint) +0:34 move second child to first child ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 subgroupQuadBroadcast ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 1 (const uint) +0:35 move second child to first child ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 subgroupQuadBroadcast ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 1 (const uint) +0:36 move second child to first child ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 subgroupQuadBroadcast ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 Constant: +0:36 1 (const uint) +0:37 move second child to first child ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 subgroupQuadBroadcast ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 Constant: +0:37 1 (const uint) +0:39 move second child to first child ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 subgroupQuadBroadcast ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 Constant: +0:39 1 (const uint) +0:40 move second child to first child ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 subgroupQuadBroadcast ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const uint) +0:41 move second child to first child ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 subgroupQuadBroadcast ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Constant: +0:41 1 (const uint) +0:42 move second child to first child ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 subgroupQuadBroadcast ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 Constant: +0:42 1 (const uint) +0:44 move second child to first child ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 subgroupQuadBroadcast ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 Constant: +0:44 1 (const uint) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 subgroupQuadBroadcast ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 1 (const uint) +0:46 move second child to first child ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 subgroupQuadBroadcast ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 1 (const uint) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 subgroupQuadBroadcast ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Constant: +0:47 1 (const uint) +0:49 move second child to first child ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 subgroupQuadBroadcast ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 Constant: +0:49 1 (const uint) +0:50 move second child to first child ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 subgroupQuadBroadcast ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 1 (const uint) +0:51 move second child to first child ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 subgroupQuadBroadcast ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 Constant: +0:51 1 (const uint) +0:52 move second child to first child ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 subgroupQuadBroadcast ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 Constant: +0:52 1 (const uint) +0:54 move second child to first child ( temp 4-component vector of uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 subgroupQuadBroadcast ( temp 4-component vector of uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 2 (const uint) +0:55 move second child to first child ( temp uint) +0:55 direct index ( temp uint) +0:55 u: direct index for structure ( temp 4-component vector of uint) +0:55 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:55 Constant: +0:55 0 (const uint) +0:55 direct index ( temp uint) +0:55 'dti' ( in 3-component vector of uint) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 subgroupQuadBroadcast ( temp uint) +0:55 direct index ( temp uint) +0:55 u: direct index for structure ( temp 4-component vector of uint) +0:55 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:55 Constant: +0:55 0 (const uint) +0:55 direct index ( temp uint) +0:55 'dti' ( in 3-component vector of uint) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 2 (const uint) +0:56 move second child to first child ( temp 2-component vector of uint) +0:56 vector swizzle ( temp 2-component vector of uint) +0:56 u: direct index for structure ( temp 4-component vector of uint) +0:56 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:56 Constant: +0:56 0 (const uint) +0:56 direct index ( temp uint) +0:56 'dti' ( in 3-component vector of uint) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 0 (const int) +0:56 Sequence +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1 (const int) +0:56 subgroupQuadBroadcast ( temp 2-component vector of uint) +0:56 vector swizzle ( temp 2-component vector of uint) +0:56 u: direct index for structure ( temp 4-component vector of uint) +0:56 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:56 Constant: +0:56 0 (const uint) +0:56 direct index ( temp uint) +0:56 'dti' ( in 3-component vector of uint) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 0 (const int) +0:56 Sequence +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1 (const int) +0:56 Constant: +0:56 2 (const uint) +0:57 move second child to first child ( temp 3-component vector of uint) +0:57 vector swizzle ( temp 3-component vector of uint) +0:57 u: direct index for structure ( temp 4-component vector of uint) +0:57 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:57 Constant: +0:57 0 (const uint) +0:57 direct index ( temp uint) +0:57 'dti' ( in 3-component vector of uint) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 0 (const int) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:57 subgroupQuadBroadcast ( temp 3-component vector of uint) +0:57 vector swizzle ( temp 3-component vector of uint) +0:57 u: direct index for structure ( temp 4-component vector of uint) +0:57 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:57 Constant: +0:57 0 (const uint) +0:57 direct index ( temp uint) +0:57 'dti' ( in 3-component vector of uint) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 0 (const int) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:57 Constant: +0:57 2 (const uint) +0:59 move second child to first child ( temp 4-component vector of int) +0:59 i: direct index for structure ( temp 4-component vector of int) +0:59 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:59 Constant: +0:59 0 (const uint) +0:59 direct index ( temp uint) +0:59 'dti' ( in 3-component vector of uint) +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 subgroupQuadBroadcast ( temp 4-component vector of int) +0:59 i: direct index for structure ( temp 4-component vector of int) +0:59 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:59 Constant: +0:59 0 (const uint) +0:59 direct index ( temp uint) +0:59 'dti' ( in 3-component vector of uint) +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 Constant: +0:59 2 (const uint) +0:60 move second child to first child ( temp int) +0:60 direct index ( temp int) +0:60 i: direct index for structure ( temp 4-component vector of int) +0:60 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:60 Constant: +0:60 0 (const uint) +0:60 direct index ( temp uint) +0:60 'dti' ( in 3-component vector of uint) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 1 (const int) +0:60 Constant: +0:60 0 (const int) +0:60 subgroupQuadBroadcast ( temp int) +0:60 direct index ( temp int) +0:60 i: direct index for structure ( temp 4-component vector of int) +0:60 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:60 Constant: +0:60 0 (const uint) +0:60 direct index ( temp uint) +0:60 'dti' ( in 3-component vector of uint) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 1 (const int) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 2 (const uint) +0:61 move second child to first child ( temp 2-component vector of int) +0:61 vector swizzle ( temp 2-component vector of int) +0:61 i: direct index for structure ( temp 4-component vector of int) +0:61 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:61 Constant: +0:61 0 (const uint) +0:61 direct index ( temp uint) +0:61 'dti' ( in 3-component vector of uint) +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Sequence +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 subgroupQuadBroadcast ( temp 2-component vector of int) +0:61 vector swizzle ( temp 2-component vector of int) +0:61 i: direct index for structure ( temp 4-component vector of int) +0:61 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:61 Constant: +0:61 0 (const uint) +0:61 direct index ( temp uint) +0:61 'dti' ( in 3-component vector of uint) +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Sequence +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Constant: +0:61 2 (const uint) +0:62 move second child to first child ( temp 3-component vector of int) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 i: direct index for structure ( temp 4-component vector of int) +0:62 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:62 Constant: +0:62 0 (const uint) +0:62 direct index ( temp uint) +0:62 'dti' ( in 3-component vector of uint) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:62 subgroupQuadBroadcast ( temp 3-component vector of int) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 i: direct index for structure ( temp 4-component vector of int) +0:62 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:62 Constant: +0:62 0 (const uint) +0:62 direct index ( temp uint) +0:62 'dti' ( in 3-component vector of uint) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:62 Constant: +0:62 2 (const uint) +0:64 move second child to first child ( temp 4-component vector of float) +0:64 f: direct index for structure ( temp 4-component vector of float) +0:64 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:64 Constant: +0:64 0 (const uint) +0:64 direct index ( temp uint) +0:64 'dti' ( in 3-component vector of uint) +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 2 (const int) +0:64 subgroupQuadBroadcast ( temp 4-component vector of float) +0:64 f: direct index for structure ( temp 4-component vector of float) +0:64 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:64 Constant: +0:64 0 (const uint) +0:64 direct index ( temp uint) +0:64 'dti' ( in 3-component vector of uint) +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 2 (const int) +0:64 Constant: +0:64 2 (const uint) +0:65 move second child to first child ( temp float) +0:65 direct index ( temp float) +0:65 f: direct index for structure ( temp 4-component vector of float) +0:65 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:65 Constant: +0:65 0 (const uint) +0:65 direct index ( temp uint) +0:65 'dti' ( in 3-component vector of uint) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 Constant: +0:65 0 (const int) +0:65 subgroupQuadBroadcast ( temp float) +0:65 direct index ( temp float) +0:65 f: direct index for structure ( temp 4-component vector of float) +0:65 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:65 Constant: +0:65 0 (const uint) +0:65 direct index ( temp uint) +0:65 'dti' ( in 3-component vector of uint) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const uint) +0:66 move second child to first child ( temp 2-component vector of float) +0:66 vector swizzle ( temp 2-component vector of float) +0:66 f: direct index for structure ( temp 4-component vector of float) +0:66 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:66 Constant: +0:66 0 (const uint) +0:66 direct index ( temp uint) +0:66 'dti' ( in 3-component vector of uint) +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 2 (const int) +0:66 Sequence +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 1 (const int) +0:66 subgroupQuadBroadcast ( temp 2-component vector of float) +0:66 vector swizzle ( temp 2-component vector of float) +0:66 f: direct index for structure ( temp 4-component vector of float) +0:66 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:66 Constant: +0:66 0 (const uint) +0:66 direct index ( temp uint) +0:66 'dti' ( in 3-component vector of uint) +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 2 (const int) +0:66 Sequence +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 1 (const int) +0:66 Constant: +0:66 2 (const uint) +0:67 move second child to first child ( temp 3-component vector of float) +0:67 vector swizzle ( temp 3-component vector of float) +0:67 f: direct index for structure ( temp 4-component vector of float) +0:67 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:67 Constant: +0:67 0 (const uint) +0:67 direct index ( temp uint) +0:67 'dti' ( in 3-component vector of uint) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Sequence +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 subgroupQuadBroadcast ( temp 3-component vector of float) +0:67 vector swizzle ( temp 3-component vector of float) +0:67 f: direct index for structure ( temp 4-component vector of float) +0:67 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:67 Constant: +0:67 0 (const uint) +0:67 direct index ( temp uint) +0:67 'dti' ( in 3-component vector of uint) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Sequence +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Constant: +0:67 2 (const uint) +0:69 move second child to first child ( temp 4-component vector of double) +0:69 d: direct index for structure ( temp 4-component vector of double) +0:69 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:69 Constant: +0:69 0 (const uint) +0:69 direct index ( temp uint) +0:69 'dti' ( in 3-component vector of uint) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 3 (const int) +0:69 subgroupQuadBroadcast ( temp 4-component vector of double) +0:69 d: direct index for structure ( temp 4-component vector of double) +0:69 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:69 Constant: +0:69 0 (const uint) +0:69 direct index ( temp uint) +0:69 'dti' ( in 3-component vector of uint) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 3 (const int) +0:69 Constant: +0:69 2 (const uint) +0:70 move second child to first child ( temp double) +0:70 direct index ( temp double) +0:70 d: direct index for structure ( temp 4-component vector of double) +0:70 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:70 Constant: +0:70 0 (const uint) +0:70 direct index ( temp uint) +0:70 'dti' ( in 3-component vector of uint) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 3 (const int) +0:70 Constant: +0:70 0 (const int) +0:70 subgroupQuadBroadcast ( temp double) +0:70 direct index ( temp double) +0:70 d: direct index for structure ( temp 4-component vector of double) +0:70 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:70 Constant: +0:70 0 (const uint) +0:70 direct index ( temp uint) +0:70 'dti' ( in 3-component vector of uint) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 3 (const int) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 2 (const uint) +0:71 move second child to first child ( temp 2-component vector of double) +0:71 vector swizzle ( temp 2-component vector of double) +0:71 d: direct index for structure ( temp 4-component vector of double) +0:71 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:71 Constant: +0:71 0 (const uint) +0:71 direct index ( temp uint) +0:71 'dti' ( in 3-component vector of uint) +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 3 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:71 subgroupQuadBroadcast ( temp 2-component vector of double) +0:71 vector swizzle ( temp 2-component vector of double) +0:71 d: direct index for structure ( temp 4-component vector of double) +0:71 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:71 Constant: +0:71 0 (const uint) +0:71 direct index ( temp uint) +0:71 'dti' ( in 3-component vector of uint) +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 3 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:71 Constant: +0:71 2 (const uint) +0:72 move second child to first child ( temp 3-component vector of double) +0:72 vector swizzle ( temp 3-component vector of double) +0:72 d: direct index for structure ( temp 4-component vector of double) +0:72 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:72 Constant: +0:72 0 (const uint) +0:72 direct index ( temp uint) +0:72 'dti' ( in 3-component vector of uint) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 3 (const int) +0:72 Sequence +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 2 (const int) +0:72 subgroupQuadBroadcast ( temp 3-component vector of double) +0:72 vector swizzle ( temp 3-component vector of double) +0:72 d: direct index for structure ( temp 4-component vector of double) +0:72 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:72 Constant: +0:72 0 (const uint) +0:72 direct index ( temp uint) +0:72 'dti' ( in 3-component vector of uint) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 3 (const int) +0:72 Sequence +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 2 (const int) +0:72 Constant: +0:72 2 (const uint) +0:74 move second child to first child ( temp 4-component vector of uint) +0:74 u: direct index for structure ( temp 4-component vector of uint) +0:74 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:74 Constant: +0:74 0 (const uint) +0:74 direct index ( temp uint) +0:74 'dti' ( in 3-component vector of uint) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 0 (const int) +0:74 subgroupQuadBroadcast ( temp 4-component vector of uint) +0:74 u: direct index for structure ( temp 4-component vector of uint) +0:74 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:74 Constant: +0:74 0 (const uint) +0:74 direct index ( temp uint) +0:74 'dti' ( in 3-component vector of uint) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 3 (const uint) +0:75 move second child to first child ( temp uint) +0:75 direct index ( temp uint) +0:75 u: direct index for structure ( temp 4-component vector of uint) +0:75 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:75 Constant: +0:75 0 (const uint) +0:75 direct index ( temp uint) +0:75 'dti' ( in 3-component vector of uint) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 subgroupQuadBroadcast ( temp uint) +0:75 direct index ( temp uint) +0:75 u: direct index for structure ( temp 4-component vector of uint) +0:75 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:75 Constant: +0:75 0 (const uint) +0:75 direct index ( temp uint) +0:75 'dti' ( in 3-component vector of uint) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 3 (const uint) +0:76 move second child to first child ( temp 2-component vector of uint) +0:76 vector swizzle ( temp 2-component vector of uint) +0:76 u: direct index for structure ( temp 4-component vector of uint) +0:76 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:76 Constant: +0:76 0 (const uint) +0:76 direct index ( temp uint) +0:76 'dti' ( in 3-component vector of uint) +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 0 (const int) +0:76 Sequence +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 1 (const int) +0:76 subgroupQuadBroadcast ( temp 2-component vector of uint) +0:76 vector swizzle ( temp 2-component vector of uint) +0:76 u: direct index for structure ( temp 4-component vector of uint) +0:76 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:76 Constant: +0:76 0 (const uint) +0:76 direct index ( temp uint) +0:76 'dti' ( in 3-component vector of uint) +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 0 (const int) +0:76 Sequence +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 1 (const int) +0:76 Constant: +0:76 3 (const uint) +0:77 move second child to first child ( temp 3-component vector of uint) +0:77 vector swizzle ( temp 3-component vector of uint) +0:77 u: direct index for structure ( temp 4-component vector of uint) +0:77 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:77 Constant: +0:77 0 (const uint) +0:77 direct index ( temp uint) +0:77 'dti' ( in 3-component vector of uint) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 0 (const int) +0:77 Sequence +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 1 (const int) +0:77 Constant: +0:77 2 (const int) +0:77 subgroupQuadBroadcast ( temp 3-component vector of uint) +0:77 vector swizzle ( temp 3-component vector of uint) +0:77 u: direct index for structure ( temp 4-component vector of uint) +0:77 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:77 Constant: +0:77 0 (const uint) +0:77 direct index ( temp uint) +0:77 'dti' ( in 3-component vector of uint) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 0 (const int) +0:77 Sequence +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 1 (const int) +0:77 Constant: +0:77 2 (const int) +0:77 Constant: +0:77 3 (const uint) +0:79 move second child to first child ( temp 4-component vector of int) +0:79 i: direct index for structure ( temp 4-component vector of int) +0:79 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:79 Constant: +0:79 0 (const uint) +0:79 direct index ( temp uint) +0:79 'dti' ( in 3-component vector of uint) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:79 subgroupQuadBroadcast ( temp 4-component vector of int) +0:79 i: direct index for structure ( temp 4-component vector of int) +0:79 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:79 Constant: +0:79 0 (const uint) +0:79 direct index ( temp uint) +0:79 'dti' ( in 3-component vector of uint) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:79 Constant: +0:79 3 (const uint) +0:80 move second child to first child ( temp int) +0:80 direct index ( temp int) +0:80 i: direct index for structure ( temp 4-component vector of int) +0:80 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:80 Constant: +0:80 0 (const uint) +0:80 direct index ( temp uint) +0:80 'dti' ( in 3-component vector of uint) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 1 (const int) +0:80 Constant: +0:80 0 (const int) +0:80 subgroupQuadBroadcast ( temp int) +0:80 direct index ( temp int) +0:80 i: direct index for structure ( temp 4-component vector of int) +0:80 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:80 Constant: +0:80 0 (const uint) +0:80 direct index ( temp uint) +0:80 'dti' ( in 3-component vector of uint) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 1 (const int) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 3 (const uint) +0:81 move second child to first child ( temp 2-component vector of int) +0:81 vector swizzle ( temp 2-component vector of int) +0:81 i: direct index for structure ( temp 4-component vector of int) +0:81 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:81 Constant: +0:81 0 (const uint) +0:81 direct index ( temp uint) +0:81 'dti' ( in 3-component vector of uint) +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Sequence +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 subgroupQuadBroadcast ( temp 2-component vector of int) +0:81 vector swizzle ( temp 2-component vector of int) +0:81 i: direct index for structure ( temp 4-component vector of int) +0:81 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:81 Constant: +0:81 0 (const uint) +0:81 direct index ( temp uint) +0:81 'dti' ( in 3-component vector of uint) +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Sequence +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Constant: +0:81 3 (const uint) +0:82 move second child to first child ( temp 3-component vector of int) +0:82 vector swizzle ( temp 3-component vector of int) +0:82 i: direct index for structure ( temp 4-component vector of int) +0:82 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:82 Constant: +0:82 0 (const uint) +0:82 direct index ( temp uint) +0:82 'dti' ( in 3-component vector of uint) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Sequence +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Constant: +0:82 2 (const int) +0:82 subgroupQuadBroadcast ( temp 3-component vector of int) +0:82 vector swizzle ( temp 3-component vector of int) +0:82 i: direct index for structure ( temp 4-component vector of int) +0:82 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:82 Constant: +0:82 0 (const uint) +0:82 direct index ( temp uint) +0:82 'dti' ( in 3-component vector of uint) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Sequence +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Constant: +0:82 2 (const int) +0:82 Constant: +0:82 3 (const uint) +0:84 move second child to first child ( temp 4-component vector of float) +0:84 f: direct index for structure ( temp 4-component vector of float) +0:84 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:84 Constant: +0:84 0 (const uint) +0:84 direct index ( temp uint) +0:84 'dti' ( in 3-component vector of uint) +0:84 Constant: +0:84 0 (const int) +0:84 Constant: +0:84 2 (const int) +0:84 subgroupQuadBroadcast ( temp 4-component vector of float) +0:84 f: direct index for structure ( temp 4-component vector of float) +0:84 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:84 Constant: +0:84 0 (const uint) +0:84 direct index ( temp uint) +0:84 'dti' ( in 3-component vector of uint) +0:84 Constant: +0:84 0 (const int) +0:84 Constant: +0:84 2 (const int) +0:84 Constant: +0:84 3 (const uint) +0:85 move second child to first child ( temp float) +0:85 direct index ( temp float) +0:85 f: direct index for structure ( temp 4-component vector of float) +0:85 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:85 Constant: +0:85 0 (const uint) +0:85 direct index ( temp uint) +0:85 'dti' ( in 3-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 2 (const int) +0:85 Constant: +0:85 0 (const int) +0:85 subgroupQuadBroadcast ( temp float) +0:85 direct index ( temp float) +0:85 f: direct index for structure ( temp 4-component vector of float) +0:85 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:85 Constant: +0:85 0 (const uint) +0:85 direct index ( temp uint) +0:85 'dti' ( in 3-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 2 (const int) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 3 (const uint) +0:86 move second child to first child ( temp 2-component vector of float) +0:86 vector swizzle ( temp 2-component vector of float) +0:86 f: direct index for structure ( temp 4-component vector of float) +0:86 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:86 Constant: +0:86 0 (const uint) +0:86 direct index ( temp uint) +0:86 'dti' ( in 3-component vector of uint) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 2 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:86 subgroupQuadBroadcast ( temp 2-component vector of float) +0:86 vector swizzle ( temp 2-component vector of float) +0:86 f: direct index for structure ( temp 4-component vector of float) +0:86 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:86 Constant: +0:86 0 (const uint) +0:86 direct index ( temp uint) +0:86 'dti' ( in 3-component vector of uint) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 2 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:86 Constant: +0:86 3 (const uint) +0:87 move second child to first child ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 f: direct index for structure ( temp 4-component vector of float) +0:87 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:87 Constant: +0:87 0 (const uint) +0:87 direct index ( temp uint) +0:87 'dti' ( in 3-component vector of uint) +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 subgroupQuadBroadcast ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 f: direct index for structure ( temp 4-component vector of float) +0:87 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:87 Constant: +0:87 0 (const uint) +0:87 direct index ( temp uint) +0:87 'dti' ( in 3-component vector of uint) +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Constant: +0:87 3 (const uint) +0:89 move second child to first child ( temp 4-component vector of double) +0:89 d: direct index for structure ( temp 4-component vector of double) +0:89 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:89 Constant: +0:89 0 (const uint) +0:89 direct index ( temp uint) +0:89 'dti' ( in 3-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 Constant: +0:89 3 (const int) +0:89 subgroupQuadBroadcast ( temp 4-component vector of double) +0:89 d: direct index for structure ( temp 4-component vector of double) +0:89 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:89 Constant: +0:89 0 (const uint) +0:89 direct index ( temp uint) +0:89 'dti' ( in 3-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 Constant: +0:89 3 (const int) +0:89 Constant: +0:89 3 (const uint) +0:90 move second child to first child ( temp double) +0:90 direct index ( temp double) +0:90 d: direct index for structure ( temp 4-component vector of double) +0:90 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:90 Constant: +0:90 0 (const uint) +0:90 direct index ( temp uint) +0:90 'dti' ( in 3-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const int) +0:90 Constant: +0:90 0 (const int) +0:90 subgroupQuadBroadcast ( temp double) +0:90 direct index ( temp double) +0:90 d: direct index for structure ( temp 4-component vector of double) +0:90 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:90 Constant: +0:90 0 (const uint) +0:90 direct index ( temp uint) +0:90 'dti' ( in 3-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const int) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const uint) +0:91 move second child to first child ( temp 2-component vector of double) +0:91 vector swizzle ( temp 2-component vector of double) +0:91 d: direct index for structure ( temp 4-component vector of double) +0:91 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:91 Constant: +0:91 0 (const uint) +0:91 direct index ( temp uint) +0:91 'dti' ( in 3-component vector of uint) +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 3 (const int) +0:91 Sequence +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 1 (const int) +0:91 subgroupQuadBroadcast ( temp 2-component vector of double) +0:91 vector swizzle ( temp 2-component vector of double) +0:91 d: direct index for structure ( temp 4-component vector of double) +0:91 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:91 Constant: +0:91 0 (const uint) +0:91 direct index ( temp uint) +0:91 'dti' ( in 3-component vector of uint) +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 3 (const int) +0:91 Sequence +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 1 (const int) +0:91 Constant: +0:91 3 (const uint) +0:92 move second child to first child ( temp 3-component vector of double) +0:92 vector swizzle ( temp 3-component vector of double) +0:92 d: direct index for structure ( temp 4-component vector of double) +0:92 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:92 Constant: +0:92 0 (const uint) +0:92 direct index ( temp uint) +0:92 'dti' ( in 3-component vector of uint) +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 3 (const int) +0:92 Sequence +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 1 (const int) +0:92 Constant: +0:92 2 (const int) +0:92 subgroupQuadBroadcast ( temp 3-component vector of double) +0:92 vector swizzle ( temp 3-component vector of double) +0:92 d: direct index for structure ( temp 4-component vector of double) +0:92 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:92 Constant: +0:92 0 (const uint) +0:92 direct index ( temp uint) +0:92 'dti' ( in 3-component vector of uint) +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 3 (const int) +0:92 Sequence +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 1 (const int) +0:92 Constant: +0:92 2 (const int) +0:92 Constant: +0:92 3 (const uint) +0:94 move second child to first child ( temp 4-component vector of uint) +0:94 u: direct index for structure ( temp 4-component vector of uint) +0:94 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:94 Constant: +0:94 0 (const uint) +0:94 direct index ( temp uint) +0:94 'dti' ( in 3-component vector of uint) +0:94 Constant: +0:94 0 (const int) +0:94 Constant: +0:94 0 (const int) +0:94 subgroupQuadSwapHorizontal ( temp 4-component vector of uint) +0:94 u: direct index for structure ( temp 4-component vector of uint) +0:94 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:94 Constant: +0:94 0 (const uint) +0:94 direct index ( temp uint) +0:94 'dti' ( in 3-component vector of uint) +0:94 Constant: +0:94 0 (const int) +0:94 Constant: +0:94 0 (const int) +0:95 move second child to first child ( temp uint) +0:95 direct index ( temp uint) +0:95 u: direct index for structure ( temp 4-component vector of uint) +0:95 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:95 Constant: +0:95 0 (const uint) +0:95 direct index ( temp uint) +0:95 'dti' ( in 3-component vector of uint) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 subgroupQuadSwapHorizontal ( temp uint) +0:95 direct index ( temp uint) +0:95 u: direct index for structure ( temp 4-component vector of uint) +0:95 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:95 Constant: +0:95 0 (const uint) +0:95 direct index ( temp uint) +0:95 'dti' ( in 3-component vector of uint) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:96 move second child to first child ( temp 2-component vector of uint) +0:96 vector swizzle ( temp 2-component vector of uint) +0:96 u: direct index for structure ( temp 4-component vector of uint) +0:96 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:96 Constant: +0:96 0 (const uint) +0:96 direct index ( temp uint) +0:96 'dti' ( in 3-component vector of uint) +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 0 (const int) +0:96 Sequence +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 1 (const int) +0:96 subgroupQuadSwapHorizontal ( temp 2-component vector of uint) +0:96 vector swizzle ( temp 2-component vector of uint) +0:96 u: direct index for structure ( temp 4-component vector of uint) +0:96 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:96 Constant: +0:96 0 (const uint) +0:96 direct index ( temp uint) +0:96 'dti' ( in 3-component vector of uint) +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 0 (const int) +0:96 Sequence +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 1 (const int) +0:97 move second child to first child ( temp 3-component vector of uint) +0:97 vector swizzle ( temp 3-component vector of uint) +0:97 u: direct index for structure ( temp 4-component vector of uint) +0:97 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:97 Constant: +0:97 0 (const uint) +0:97 direct index ( temp uint) +0:97 'dti' ( in 3-component vector of uint) +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 0 (const int) +0:97 Sequence +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 1 (const int) +0:97 Constant: +0:97 2 (const int) +0:97 subgroupQuadSwapHorizontal ( temp 3-component vector of uint) +0:97 vector swizzle ( temp 3-component vector of uint) +0:97 u: direct index for structure ( temp 4-component vector of uint) +0:97 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:97 Constant: +0:97 0 (const uint) +0:97 direct index ( temp uint) +0:97 'dti' ( in 3-component vector of uint) +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 0 (const int) +0:97 Sequence +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 1 (const int) +0:97 Constant: +0:97 2 (const int) +0:99 move second child to first child ( temp 4-component vector of int) +0:99 i: direct index for structure ( temp 4-component vector of int) +0:99 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:99 Constant: +0:99 0 (const uint) +0:99 direct index ( temp uint) +0:99 'dti' ( in 3-component vector of uint) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) +0:99 subgroupQuadSwapHorizontal ( temp 4-component vector of int) +0:99 i: direct index for structure ( temp 4-component vector of int) +0:99 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:99 Constant: +0:99 0 (const uint) +0:99 direct index ( temp uint) +0:99 'dti' ( in 3-component vector of uint) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) +0:100 move second child to first child ( temp int) +0:100 direct index ( temp int) +0:100 i: direct index for structure ( temp 4-component vector of int) +0:100 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:100 Constant: +0:100 0 (const uint) +0:100 direct index ( temp uint) +0:100 'dti' ( in 3-component vector of uint) +0:100 Constant: +0:100 0 (const int) +0:100 Constant: +0:100 1 (const int) +0:100 Constant: +0:100 0 (const int) +0:100 subgroupQuadSwapHorizontal ( temp int) +0:100 direct index ( temp int) +0:100 i: direct index for structure ( temp 4-component vector of int) +0:100 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:100 Constant: +0:100 0 (const uint) +0:100 direct index ( temp uint) +0:100 'dti' ( in 3-component vector of uint) +0:100 Constant: +0:100 0 (const int) +0:100 Constant: +0:100 1 (const int) +0:100 Constant: +0:100 0 (const int) +0:101 move second child to first child ( temp 2-component vector of int) +0:101 vector swizzle ( temp 2-component vector of int) +0:101 i: direct index for structure ( temp 4-component vector of int) +0:101 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:101 Constant: +0:101 0 (const uint) +0:101 direct index ( temp uint) +0:101 'dti' ( in 3-component vector of uint) +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 Sequence +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 subgroupQuadSwapHorizontal ( temp 2-component vector of int) +0:101 vector swizzle ( temp 2-component vector of int) +0:101 i: direct index for structure ( temp 4-component vector of int) +0:101 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:101 Constant: +0:101 0 (const uint) +0:101 direct index ( temp uint) +0:101 'dti' ( in 3-component vector of uint) +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 Sequence +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:102 move second child to first child ( temp 3-component vector of int) +0:102 vector swizzle ( temp 3-component vector of int) +0:102 i: direct index for structure ( temp 4-component vector of int) +0:102 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:102 Constant: +0:102 0 (const uint) +0:102 direct index ( temp uint) +0:102 'dti' ( in 3-component vector of uint) +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Sequence +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Constant: +0:102 2 (const int) +0:102 subgroupQuadSwapHorizontal ( temp 3-component vector of int) +0:102 vector swizzle ( temp 3-component vector of int) +0:102 i: direct index for structure ( temp 4-component vector of int) +0:102 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:102 Constant: +0:102 0 (const uint) +0:102 direct index ( temp uint) +0:102 'dti' ( in 3-component vector of uint) +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Sequence +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Constant: +0:102 2 (const int) +0:104 move second child to first child ( temp 4-component vector of float) +0:104 f: direct index for structure ( temp 4-component vector of float) +0:104 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:104 Constant: +0:104 0 (const uint) +0:104 direct index ( temp uint) +0:104 'dti' ( in 3-component vector of uint) +0:104 Constant: +0:104 0 (const int) +0:104 Constant: +0:104 2 (const int) +0:104 subgroupQuadSwapHorizontal ( temp 4-component vector of float) +0:104 f: direct index for structure ( temp 4-component vector of float) +0:104 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:104 Constant: +0:104 0 (const uint) +0:104 direct index ( temp uint) +0:104 'dti' ( in 3-component vector of uint) +0:104 Constant: +0:104 0 (const int) +0:104 Constant: +0:104 2 (const int) +0:105 move second child to first child ( temp float) +0:105 direct index ( temp float) +0:105 f: direct index for structure ( temp 4-component vector of float) +0:105 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:105 Constant: +0:105 0 (const uint) +0:105 direct index ( temp uint) +0:105 'dti' ( in 3-component vector of uint) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 2 (const int) +0:105 Constant: +0:105 0 (const int) +0:105 subgroupQuadSwapHorizontal ( temp float) +0:105 direct index ( temp float) +0:105 f: direct index for structure ( temp 4-component vector of float) +0:105 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:105 Constant: +0:105 0 (const uint) +0:105 direct index ( temp uint) +0:105 'dti' ( in 3-component vector of uint) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 2 (const int) +0:105 Constant: +0:105 0 (const int) +0:106 move second child to first child ( temp 2-component vector of float) +0:106 vector swizzle ( temp 2-component vector of float) +0:106 f: direct index for structure ( temp 4-component vector of float) +0:106 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:106 Constant: +0:106 0 (const uint) +0:106 direct index ( temp uint) +0:106 'dti' ( in 3-component vector of uint) +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 2 (const int) +0:106 Sequence +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 1 (const int) +0:106 subgroupQuadSwapHorizontal ( temp 2-component vector of float) +0:106 vector swizzle ( temp 2-component vector of float) +0:106 f: direct index for structure ( temp 4-component vector of float) +0:106 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:106 Constant: +0:106 0 (const uint) +0:106 direct index ( temp uint) +0:106 'dti' ( in 3-component vector of uint) +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 2 (const int) +0:106 Sequence +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 1 (const int) +0:107 move second child to first child ( temp 3-component vector of float) +0:107 vector swizzle ( temp 3-component vector of float) +0:107 f: direct index for structure ( temp 4-component vector of float) +0:107 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:107 Constant: +0:107 0 (const uint) +0:107 direct index ( temp uint) +0:107 'dti' ( in 3-component vector of uint) +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 2 (const int) +0:107 Sequence +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 1 (const int) +0:107 Constant: +0:107 2 (const int) +0:107 subgroupQuadSwapHorizontal ( temp 3-component vector of float) +0:107 vector swizzle ( temp 3-component vector of float) +0:107 f: direct index for structure ( temp 4-component vector of float) +0:107 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:107 Constant: +0:107 0 (const uint) +0:107 direct index ( temp uint) +0:107 'dti' ( in 3-component vector of uint) +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 2 (const int) +0:107 Sequence +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 1 (const int) +0:107 Constant: +0:107 2 (const int) +0:109 move second child to first child ( temp 4-component vector of double) +0:109 d: direct index for structure ( temp 4-component vector of double) +0:109 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:109 Constant: +0:109 0 (const uint) +0:109 direct index ( temp uint) +0:109 'dti' ( in 3-component vector of uint) +0:109 Constant: +0:109 0 (const int) +0:109 Constant: +0:109 3 (const int) +0:109 subgroupQuadSwapHorizontal ( temp 4-component vector of double) +0:109 d: direct index for structure ( temp 4-component vector of double) +0:109 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:109 Constant: +0:109 0 (const uint) +0:109 direct index ( temp uint) +0:109 'dti' ( in 3-component vector of uint) +0:109 Constant: +0:109 0 (const int) +0:109 Constant: +0:109 3 (const int) +0:110 move second child to first child ( temp double) +0:110 direct index ( temp double) +0:110 d: direct index for structure ( temp 4-component vector of double) +0:110 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:110 Constant: +0:110 0 (const uint) +0:110 direct index ( temp uint) +0:110 'dti' ( in 3-component vector of uint) +0:110 Constant: +0:110 0 (const int) +0:110 Constant: +0:110 3 (const int) +0:110 Constant: +0:110 0 (const int) +0:110 subgroupQuadSwapHorizontal ( temp double) +0:110 direct index ( temp double) +0:110 d: direct index for structure ( temp 4-component vector of double) +0:110 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:110 Constant: +0:110 0 (const uint) +0:110 direct index ( temp uint) +0:110 'dti' ( in 3-component vector of uint) +0:110 Constant: +0:110 0 (const int) +0:110 Constant: +0:110 3 (const int) +0:110 Constant: +0:110 0 (const int) +0:111 move second child to first child ( temp 2-component vector of double) +0:111 vector swizzle ( temp 2-component vector of double) +0:111 d: direct index for structure ( temp 4-component vector of double) +0:111 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:111 Constant: +0:111 0 (const uint) +0:111 direct index ( temp uint) +0:111 'dti' ( in 3-component vector of uint) +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 3 (const int) +0:111 Sequence +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:111 subgroupQuadSwapHorizontal ( temp 2-component vector of double) +0:111 vector swizzle ( temp 2-component vector of double) +0:111 d: direct index for structure ( temp 4-component vector of double) +0:111 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:111 Constant: +0:111 0 (const uint) +0:111 direct index ( temp uint) +0:111 'dti' ( in 3-component vector of uint) +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 3 (const int) +0:111 Sequence +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:112 move second child to first child ( temp 3-component vector of double) +0:112 vector swizzle ( temp 3-component vector of double) +0:112 d: direct index for structure ( temp 4-component vector of double) +0:112 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:112 Constant: +0:112 0 (const uint) +0:112 direct index ( temp uint) +0:112 'dti' ( in 3-component vector of uint) +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 3 (const int) +0:112 Sequence +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Constant: +0:112 2 (const int) +0:112 subgroupQuadSwapHorizontal ( temp 3-component vector of double) +0:112 vector swizzle ( temp 3-component vector of double) +0:112 d: direct index for structure ( temp 4-component vector of double) +0:112 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:112 Constant: +0:112 0 (const uint) +0:112 direct index ( temp uint) +0:112 'dti' ( in 3-component vector of uint) +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 3 (const int) +0:112 Sequence +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Constant: +0:112 2 (const int) +0:114 move second child to first child ( temp 4-component vector of uint) +0:114 u: direct index for structure ( temp 4-component vector of uint) +0:114 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:114 Constant: +0:114 0 (const uint) +0:114 direct index ( temp uint) +0:114 'dti' ( in 3-component vector of uint) +0:114 Constant: +0:114 0 (const int) +0:114 Constant: +0:114 0 (const int) +0:114 subgroupQuadSwapVertical ( temp 4-component vector of uint) +0:114 u: direct index for structure ( temp 4-component vector of uint) +0:114 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:114 Constant: +0:114 0 (const uint) +0:114 direct index ( temp uint) +0:114 'dti' ( in 3-component vector of uint) +0:114 Constant: +0:114 0 (const int) +0:114 Constant: +0:114 0 (const int) +0:115 move second child to first child ( temp uint) +0:115 direct index ( temp uint) +0:115 u: direct index for structure ( temp 4-component vector of uint) +0:115 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:115 Constant: +0:115 0 (const uint) +0:115 direct index ( temp uint) +0:115 'dti' ( in 3-component vector of uint) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 subgroupQuadSwapVertical ( temp uint) +0:115 direct index ( temp uint) +0:115 u: direct index for structure ( temp 4-component vector of uint) +0:115 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:115 Constant: +0:115 0 (const uint) +0:115 direct index ( temp uint) +0:115 'dti' ( in 3-component vector of uint) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:116 move second child to first child ( temp 2-component vector of uint) +0:116 vector swizzle ( temp 2-component vector of uint) +0:116 u: direct index for structure ( temp 4-component vector of uint) +0:116 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:116 Constant: +0:116 0 (const uint) +0:116 direct index ( temp uint) +0:116 'dti' ( in 3-component vector of uint) +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 0 (const int) +0:116 Sequence +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 1 (const int) +0:116 subgroupQuadSwapVertical ( temp 2-component vector of uint) +0:116 vector swizzle ( temp 2-component vector of uint) +0:116 u: direct index for structure ( temp 4-component vector of uint) +0:116 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:116 Constant: +0:116 0 (const uint) +0:116 direct index ( temp uint) +0:116 'dti' ( in 3-component vector of uint) +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 0 (const int) +0:116 Sequence +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 1 (const int) +0:117 move second child to first child ( temp 3-component vector of uint) +0:117 vector swizzle ( temp 3-component vector of uint) +0:117 u: direct index for structure ( temp 4-component vector of uint) +0:117 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:117 Constant: +0:117 0 (const uint) +0:117 direct index ( temp uint) +0:117 'dti' ( in 3-component vector of uint) +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 0 (const int) +0:117 Sequence +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 1 (const int) +0:117 Constant: +0:117 2 (const int) +0:117 subgroupQuadSwapVertical ( temp 3-component vector of uint) +0:117 vector swizzle ( temp 3-component vector of uint) +0:117 u: direct index for structure ( temp 4-component vector of uint) +0:117 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:117 Constant: +0:117 0 (const uint) +0:117 direct index ( temp uint) +0:117 'dti' ( in 3-component vector of uint) +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 0 (const int) +0:117 Sequence +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 1 (const int) +0:117 Constant: +0:117 2 (const int) +0:119 move second child to first child ( temp 4-component vector of int) +0:119 i: direct index for structure ( temp 4-component vector of int) +0:119 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:119 Constant: +0:119 0 (const uint) +0:119 direct index ( temp uint) +0:119 'dti' ( in 3-component vector of uint) +0:119 Constant: +0:119 0 (const int) +0:119 Constant: +0:119 1 (const int) +0:119 subgroupQuadSwapVertical ( temp 4-component vector of int) +0:119 i: direct index for structure ( temp 4-component vector of int) +0:119 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:119 Constant: +0:119 0 (const uint) +0:119 direct index ( temp uint) +0:119 'dti' ( in 3-component vector of uint) +0:119 Constant: +0:119 0 (const int) +0:119 Constant: +0:119 1 (const int) +0:120 move second child to first child ( temp int) +0:120 direct index ( temp int) +0:120 i: direct index for structure ( temp 4-component vector of int) +0:120 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:120 Constant: +0:120 0 (const uint) +0:120 direct index ( temp uint) +0:120 'dti' ( in 3-component vector of uint) +0:120 Constant: +0:120 0 (const int) +0:120 Constant: +0:120 1 (const int) +0:120 Constant: +0:120 0 (const int) +0:120 subgroupQuadSwapVertical ( temp int) +0:120 direct index ( temp int) +0:120 i: direct index for structure ( temp 4-component vector of int) +0:120 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:120 Constant: +0:120 0 (const uint) +0:120 direct index ( temp uint) +0:120 'dti' ( in 3-component vector of uint) +0:120 Constant: +0:120 0 (const int) +0:120 Constant: +0:120 1 (const int) +0:120 Constant: +0:120 0 (const int) +0:121 move second child to first child ( temp 2-component vector of int) +0:121 vector swizzle ( temp 2-component vector of int) +0:121 i: direct index for structure ( temp 4-component vector of int) +0:121 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:121 Constant: +0:121 0 (const uint) +0:121 direct index ( temp uint) +0:121 'dti' ( in 3-component vector of uint) +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 Sequence +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 subgroupQuadSwapVertical ( temp 2-component vector of int) +0:121 vector swizzle ( temp 2-component vector of int) +0:121 i: direct index for structure ( temp 4-component vector of int) +0:121 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:121 Constant: +0:121 0 (const uint) +0:121 direct index ( temp uint) +0:121 'dti' ( in 3-component vector of uint) +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 Sequence +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:122 move second child to first child ( temp 3-component vector of int) +0:122 vector swizzle ( temp 3-component vector of int) +0:122 i: direct index for structure ( temp 4-component vector of int) +0:122 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:122 Constant: +0:122 0 (const uint) +0:122 direct index ( temp uint) +0:122 'dti' ( in 3-component vector of uint) +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Sequence +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Constant: +0:122 2 (const int) +0:122 subgroupQuadSwapVertical ( temp 3-component vector of int) +0:122 vector swizzle ( temp 3-component vector of int) +0:122 i: direct index for structure ( temp 4-component vector of int) +0:122 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:122 Constant: +0:122 0 (const uint) +0:122 direct index ( temp uint) +0:122 'dti' ( in 3-component vector of uint) +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Sequence +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Constant: +0:122 2 (const int) +0:124 move second child to first child ( temp 4-component vector of float) +0:124 f: direct index for structure ( temp 4-component vector of float) +0:124 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:124 Constant: +0:124 0 (const uint) +0:124 direct index ( temp uint) +0:124 'dti' ( in 3-component vector of uint) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 2 (const int) +0:124 subgroupQuadSwapVertical ( temp 4-component vector of float) +0:124 f: direct index for structure ( temp 4-component vector of float) +0:124 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:124 Constant: +0:124 0 (const uint) +0:124 direct index ( temp uint) +0:124 'dti' ( in 3-component vector of uint) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 2 (const int) +0:125 move second child to first child ( temp float) +0:125 direct index ( temp float) +0:125 f: direct index for structure ( temp 4-component vector of float) +0:125 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:125 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:125 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:125 Constant: +0:125 0 (const uint) +0:125 direct index ( temp uint) +0:125 'dti' ( in 3-component vector of uint) +0:125 Constant: +0:125 0 (const int) +0:125 Constant: +0:125 2 (const int) +0:125 Constant: +0:125 0 (const int) +0:125 subgroupQuadSwapVertical ( temp float) +0:125 direct index ( temp float) +0:125 f: direct index for structure ( temp 4-component vector of float) +0:125 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:125 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:125 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:125 Constant: +0:125 0 (const uint) +0:125 direct index ( temp uint) +0:125 'dti' ( in 3-component vector of uint) +0:125 Constant: +0:125 0 (const int) +0:125 Constant: +0:125 2 (const int) +0:125 Constant: +0:125 0 (const int) +0:126 move second child to first child ( temp 2-component vector of float) +0:126 vector swizzle ( temp 2-component vector of float) +0:126 f: direct index for structure ( temp 4-component vector of float) +0:126 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:126 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:126 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:126 Constant: +0:126 0 (const uint) +0:126 direct index ( temp uint) +0:126 'dti' ( in 3-component vector of uint) +0:126 Constant: +0:126 0 (const int) +0:126 Constant: +0:126 2 (const int) +0:126 Sequence +0:126 Constant: +0:126 0 (const int) +0:126 Constant: +0:126 1 (const int) +0:126 subgroupQuadSwapVertical ( temp 2-component vector of float) +0:126 vector swizzle ( temp 2-component vector of float) +0:126 f: direct index for structure ( temp 4-component vector of float) +0:126 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:126 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:126 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:126 Constant: +0:126 0 (const uint) +0:126 direct index ( temp uint) +0:126 'dti' ( in 3-component vector of uint) +0:126 Constant: +0:126 0 (const int) +0:126 Constant: +0:126 2 (const int) +0:126 Sequence +0:126 Constant: +0:126 0 (const int) +0:126 Constant: +0:126 1 (const int) +0:127 move second child to first child ( temp 3-component vector of float) +0:127 vector swizzle ( temp 3-component vector of float) +0:127 f: direct index for structure ( temp 4-component vector of float) +0:127 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:127 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:127 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:127 Constant: +0:127 0 (const uint) +0:127 direct index ( temp uint) +0:127 'dti' ( in 3-component vector of uint) +0:127 Constant: +0:127 0 (const int) +0:127 Constant: +0:127 2 (const int) +0:127 Sequence +0:127 Constant: +0:127 0 (const int) +0:127 Constant: +0:127 1 (const int) +0:127 Constant: +0:127 2 (const int) +0:127 subgroupQuadSwapVertical ( temp 3-component vector of float) +0:127 vector swizzle ( temp 3-component vector of float) +0:127 f: direct index for structure ( temp 4-component vector of float) +0:127 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:127 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:127 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:127 Constant: +0:127 0 (const uint) +0:127 direct index ( temp uint) +0:127 'dti' ( in 3-component vector of uint) +0:127 Constant: +0:127 0 (const int) +0:127 Constant: +0:127 2 (const int) +0:127 Sequence +0:127 Constant: +0:127 0 (const int) +0:127 Constant: +0:127 1 (const int) +0:127 Constant: +0:127 2 (const int) +0:129 move second child to first child ( temp 4-component vector of double) +0:129 d: direct index for structure ( temp 4-component vector of double) +0:129 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:129 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:129 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:129 Constant: +0:129 0 (const uint) +0:129 direct index ( temp uint) +0:129 'dti' ( in 3-component vector of uint) +0:129 Constant: +0:129 0 (const int) +0:129 Constant: +0:129 3 (const int) +0:129 subgroupQuadSwapVertical ( temp 4-component vector of double) +0:129 d: direct index for structure ( temp 4-component vector of double) +0:129 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:129 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:129 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:129 Constant: +0:129 0 (const uint) +0:129 direct index ( temp uint) +0:129 'dti' ( in 3-component vector of uint) +0:129 Constant: +0:129 0 (const int) +0:129 Constant: +0:129 3 (const int) +0:130 move second child to first child ( temp double) +0:130 direct index ( temp double) +0:130 d: direct index for structure ( temp 4-component vector of double) +0:130 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:130 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:130 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:130 Constant: +0:130 0 (const uint) +0:130 direct index ( temp uint) +0:130 'dti' ( in 3-component vector of uint) +0:130 Constant: +0:130 0 (const int) +0:130 Constant: +0:130 3 (const int) +0:130 Constant: +0:130 0 (const int) +0:130 subgroupQuadSwapVertical ( temp double) +0:130 direct index ( temp double) +0:130 d: direct index for structure ( temp 4-component vector of double) +0:130 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:130 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:130 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:130 Constant: +0:130 0 (const uint) +0:130 direct index ( temp uint) +0:130 'dti' ( in 3-component vector of uint) +0:130 Constant: +0:130 0 (const int) +0:130 Constant: +0:130 3 (const int) +0:130 Constant: +0:130 0 (const int) +0:131 move second child to first child ( temp 2-component vector of double) +0:131 vector swizzle ( temp 2-component vector of double) +0:131 d: direct index for structure ( temp 4-component vector of double) +0:131 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:131 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:131 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:131 Constant: +0:131 0 (const uint) +0:131 direct index ( temp uint) +0:131 'dti' ( in 3-component vector of uint) +0:131 Constant: +0:131 0 (const int) +0:131 Constant: +0:131 3 (const int) +0:131 Sequence +0:131 Constant: +0:131 0 (const int) +0:131 Constant: +0:131 1 (const int) +0:131 subgroupQuadSwapVertical ( temp 2-component vector of double) +0:131 vector swizzle ( temp 2-component vector of double) +0:131 d: direct index for structure ( temp 4-component vector of double) +0:131 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:131 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:131 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:131 Constant: +0:131 0 (const uint) +0:131 direct index ( temp uint) +0:131 'dti' ( in 3-component vector of uint) +0:131 Constant: +0:131 0 (const int) +0:131 Constant: +0:131 3 (const int) +0:131 Sequence +0:131 Constant: +0:131 0 (const int) +0:131 Constant: +0:131 1 (const int) +0:132 move second child to first child ( temp 3-component vector of double) +0:132 vector swizzle ( temp 3-component vector of double) +0:132 d: direct index for structure ( temp 4-component vector of double) +0:132 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:132 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:132 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:132 Constant: +0:132 0 (const uint) +0:132 direct index ( temp uint) +0:132 'dti' ( in 3-component vector of uint) +0:132 Constant: +0:132 0 (const int) +0:132 Constant: +0:132 3 (const int) +0:132 Sequence +0:132 Constant: +0:132 0 (const int) +0:132 Constant: +0:132 1 (const int) +0:132 Constant: +0:132 2 (const int) +0:132 subgroupQuadSwapVertical ( temp 3-component vector of double) +0:132 vector swizzle ( temp 3-component vector of double) +0:132 d: direct index for structure ( temp 4-component vector of double) +0:132 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:132 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:132 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:132 Constant: +0:132 0 (const uint) +0:132 direct index ( temp uint) +0:132 'dti' ( in 3-component vector of uint) +0:132 Constant: +0:132 0 (const int) +0:132 Constant: +0:132 3 (const int) +0:132 Sequence +0:132 Constant: +0:132 0 (const int) +0:132 Constant: +0:132 1 (const int) +0:132 Constant: +0:132 2 (const int) +0:134 move second child to first child ( temp 4-component vector of uint) +0:134 u: direct index for structure ( temp 4-component vector of uint) +0:134 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:134 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:134 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:134 Constant: +0:134 0 (const uint) +0:134 direct index ( temp uint) +0:134 'dti' ( in 3-component vector of uint) +0:134 Constant: +0:134 0 (const int) +0:134 Constant: +0:134 0 (const int) +0:134 subgroupQuadSwapDiagonal ( temp 4-component vector of uint) +0:134 u: direct index for structure ( temp 4-component vector of uint) +0:134 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:134 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:134 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:134 Constant: +0:134 0 (const uint) +0:134 direct index ( temp uint) +0:134 'dti' ( in 3-component vector of uint) +0:134 Constant: +0:134 0 (const int) +0:134 Constant: +0:134 0 (const int) +0:135 move second child to first child ( temp uint) +0:135 direct index ( temp uint) +0:135 u: direct index for structure ( temp 4-component vector of uint) +0:135 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:135 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:135 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:135 Constant: +0:135 0 (const uint) +0:135 direct index ( temp uint) +0:135 'dti' ( in 3-component vector of uint) +0:135 Constant: +0:135 0 (const int) +0:135 Constant: +0:135 0 (const int) +0:135 Constant: +0:135 0 (const int) +0:135 subgroupQuadSwapDiagonal ( temp uint) +0:135 direct index ( temp uint) +0:135 u: direct index for structure ( temp 4-component vector of uint) +0:135 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:135 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:135 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:135 Constant: +0:135 0 (const uint) +0:135 direct index ( temp uint) +0:135 'dti' ( in 3-component vector of uint) +0:135 Constant: +0:135 0 (const int) +0:135 Constant: +0:135 0 (const int) +0:135 Constant: +0:135 0 (const int) +0:136 move second child to first child ( temp 2-component vector of uint) +0:136 vector swizzle ( temp 2-component vector of uint) +0:136 u: direct index for structure ( temp 4-component vector of uint) +0:136 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:136 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:136 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:136 Constant: +0:136 0 (const uint) +0:136 direct index ( temp uint) +0:136 'dti' ( in 3-component vector of uint) +0:136 Constant: +0:136 0 (const int) +0:136 Constant: +0:136 0 (const int) +0:136 Sequence +0:136 Constant: +0:136 0 (const int) +0:136 Constant: +0:136 1 (const int) +0:136 subgroupQuadSwapDiagonal ( temp 2-component vector of uint) +0:136 vector swizzle ( temp 2-component vector of uint) +0:136 u: direct index for structure ( temp 4-component vector of uint) +0:136 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:136 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:136 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:136 Constant: +0:136 0 (const uint) +0:136 direct index ( temp uint) +0:136 'dti' ( in 3-component vector of uint) +0:136 Constant: +0:136 0 (const int) +0:136 Constant: +0:136 0 (const int) +0:136 Sequence +0:136 Constant: +0:136 0 (const int) +0:136 Constant: +0:136 1 (const int) +0:137 move second child to first child ( temp 3-component vector of uint) +0:137 vector swizzle ( temp 3-component vector of uint) +0:137 u: direct index for structure ( temp 4-component vector of uint) +0:137 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:137 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:137 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:137 Constant: +0:137 0 (const uint) +0:137 direct index ( temp uint) +0:137 'dti' ( in 3-component vector of uint) +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 0 (const int) +0:137 Sequence +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 1 (const int) +0:137 Constant: +0:137 2 (const int) +0:137 subgroupQuadSwapDiagonal ( temp 3-component vector of uint) +0:137 vector swizzle ( temp 3-component vector of uint) +0:137 u: direct index for structure ( temp 4-component vector of uint) +0:137 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:137 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:137 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:137 Constant: +0:137 0 (const uint) +0:137 direct index ( temp uint) +0:137 'dti' ( in 3-component vector of uint) +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 0 (const int) +0:137 Sequence +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 1 (const int) +0:137 Constant: +0:137 2 (const int) +0:139 move second child to first child ( temp 4-component vector of int) +0:139 i: direct index for structure ( temp 4-component vector of int) +0:139 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:139 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:139 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:139 Constant: +0:139 0 (const uint) +0:139 direct index ( temp uint) +0:139 'dti' ( in 3-component vector of uint) +0:139 Constant: +0:139 0 (const int) +0:139 Constant: +0:139 1 (const int) +0:139 subgroupQuadSwapDiagonal ( temp 4-component vector of int) +0:139 i: direct index for structure ( temp 4-component vector of int) +0:139 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:139 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:139 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:139 Constant: +0:139 0 (const uint) +0:139 direct index ( temp uint) +0:139 'dti' ( in 3-component vector of uint) +0:139 Constant: +0:139 0 (const int) +0:139 Constant: +0:139 1 (const int) +0:140 move second child to first child ( temp int) +0:140 direct index ( temp int) +0:140 i: direct index for structure ( temp 4-component vector of int) +0:140 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:140 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:140 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:140 Constant: +0:140 0 (const uint) +0:140 direct index ( temp uint) +0:140 'dti' ( in 3-component vector of uint) +0:140 Constant: +0:140 0 (const int) +0:140 Constant: +0:140 1 (const int) +0:140 Constant: +0:140 0 (const int) +0:140 subgroupQuadSwapDiagonal ( temp int) +0:140 direct index ( temp int) +0:140 i: direct index for structure ( temp 4-component vector of int) +0:140 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:140 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:140 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:140 Constant: +0:140 0 (const uint) +0:140 direct index ( temp uint) +0:140 'dti' ( in 3-component vector of uint) +0:140 Constant: +0:140 0 (const int) +0:140 Constant: +0:140 1 (const int) +0:140 Constant: +0:140 0 (const int) +0:141 move second child to first child ( temp 2-component vector of int) +0:141 vector swizzle ( temp 2-component vector of int) +0:141 i: direct index for structure ( temp 4-component vector of int) +0:141 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:141 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:141 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:141 Constant: +0:141 0 (const uint) +0:141 direct index ( temp uint) +0:141 'dti' ( in 3-component vector of uint) +0:141 Constant: +0:141 0 (const int) +0:141 Constant: +0:141 1 (const int) +0:141 Sequence +0:141 Constant: +0:141 0 (const int) +0:141 Constant: +0:141 1 (const int) +0:141 subgroupQuadSwapDiagonal ( temp 2-component vector of int) +0:141 vector swizzle ( temp 2-component vector of int) +0:141 i: direct index for structure ( temp 4-component vector of int) +0:141 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:141 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:141 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:141 Constant: +0:141 0 (const uint) +0:141 direct index ( temp uint) +0:141 'dti' ( in 3-component vector of uint) +0:141 Constant: +0:141 0 (const int) +0:141 Constant: +0:141 1 (const int) +0:141 Sequence +0:141 Constant: +0:141 0 (const int) +0:141 Constant: +0:141 1 (const int) +0:142 move second child to first child ( temp 3-component vector of int) +0:142 vector swizzle ( temp 3-component vector of int) +0:142 i: direct index for structure ( temp 4-component vector of int) +0:142 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:142 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:142 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:142 Constant: +0:142 0 (const uint) +0:142 direct index ( temp uint) +0:142 'dti' ( in 3-component vector of uint) +0:142 Constant: +0:142 0 (const int) +0:142 Constant: +0:142 1 (const int) +0:142 Sequence +0:142 Constant: +0:142 0 (const int) +0:142 Constant: +0:142 1 (const int) +0:142 Constant: +0:142 2 (const int) +0:142 subgroupQuadSwapDiagonal ( temp 3-component vector of int) +0:142 vector swizzle ( temp 3-component vector of int) +0:142 i: direct index for structure ( temp 4-component vector of int) +0:142 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:142 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:142 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:142 Constant: +0:142 0 (const uint) +0:142 direct index ( temp uint) +0:142 'dti' ( in 3-component vector of uint) +0:142 Constant: +0:142 0 (const int) +0:142 Constant: +0:142 1 (const int) +0:142 Sequence +0:142 Constant: +0:142 0 (const int) +0:142 Constant: +0:142 1 (const int) +0:142 Constant: +0:142 2 (const int) +0:144 move second child to first child ( temp 4-component vector of float) +0:144 f: direct index for structure ( temp 4-component vector of float) +0:144 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:144 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:144 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:144 Constant: +0:144 0 (const uint) +0:144 direct index ( temp uint) +0:144 'dti' ( in 3-component vector of uint) +0:144 Constant: +0:144 0 (const int) +0:144 Constant: +0:144 2 (const int) +0:144 subgroupQuadSwapDiagonal ( temp 4-component vector of float) +0:144 f: direct index for structure ( temp 4-component vector of float) +0:144 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:144 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:144 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:144 Constant: +0:144 0 (const uint) +0:144 direct index ( temp uint) +0:144 'dti' ( in 3-component vector of uint) +0:144 Constant: +0:144 0 (const int) +0:144 Constant: +0:144 2 (const int) +0:145 move second child to first child ( temp float) +0:145 direct index ( temp float) +0:145 f: direct index for structure ( temp 4-component vector of float) +0:145 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:145 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:145 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:145 Constant: +0:145 0 (const uint) +0:145 direct index ( temp uint) +0:145 'dti' ( in 3-component vector of uint) +0:145 Constant: +0:145 0 (const int) +0:145 Constant: +0:145 2 (const int) +0:145 Constant: +0:145 0 (const int) +0:145 subgroupQuadSwapDiagonal ( temp float) +0:145 direct index ( temp float) +0:145 f: direct index for structure ( temp 4-component vector of float) +0:145 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:145 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:145 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:145 Constant: +0:145 0 (const uint) +0:145 direct index ( temp uint) +0:145 'dti' ( in 3-component vector of uint) +0:145 Constant: +0:145 0 (const int) +0:145 Constant: +0:145 2 (const int) +0:145 Constant: +0:145 0 (const int) +0:146 move second child to first child ( temp 2-component vector of float) +0:146 vector swizzle ( temp 2-component vector of float) +0:146 f: direct index for structure ( temp 4-component vector of float) +0:146 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:146 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:146 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:146 Constant: +0:146 0 (const uint) +0:146 direct index ( temp uint) +0:146 'dti' ( in 3-component vector of uint) +0:146 Constant: +0:146 0 (const int) +0:146 Constant: +0:146 2 (const int) +0:146 Sequence +0:146 Constant: +0:146 0 (const int) +0:146 Constant: +0:146 1 (const int) +0:146 subgroupQuadSwapDiagonal ( temp 2-component vector of float) +0:146 vector swizzle ( temp 2-component vector of float) +0:146 f: direct index for structure ( temp 4-component vector of float) +0:146 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:146 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:146 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:146 Constant: +0:146 0 (const uint) +0:146 direct index ( temp uint) +0:146 'dti' ( in 3-component vector of uint) +0:146 Constant: +0:146 0 (const int) +0:146 Constant: +0:146 2 (const int) +0:146 Sequence +0:146 Constant: +0:146 0 (const int) +0:146 Constant: +0:146 1 (const int) +0:147 move second child to first child ( temp 3-component vector of float) +0:147 vector swizzle ( temp 3-component vector of float) +0:147 f: direct index for structure ( temp 4-component vector of float) +0:147 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:147 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:147 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:147 Constant: +0:147 0 (const uint) +0:147 direct index ( temp uint) +0:147 'dti' ( in 3-component vector of uint) +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 2 (const int) +0:147 Sequence +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 1 (const int) +0:147 Constant: +0:147 2 (const int) +0:147 subgroupQuadSwapDiagonal ( temp 3-component vector of float) +0:147 vector swizzle ( temp 3-component vector of float) +0:147 f: direct index for structure ( temp 4-component vector of float) +0:147 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:147 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:147 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:147 Constant: +0:147 0 (const uint) +0:147 direct index ( temp uint) +0:147 'dti' ( in 3-component vector of uint) +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 2 (const int) +0:147 Sequence +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 1 (const int) +0:147 Constant: +0:147 2 (const int) +0:149 move second child to first child ( temp 4-component vector of double) +0:149 d: direct index for structure ( temp 4-component vector of double) +0:149 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:149 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:149 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:149 Constant: +0:149 0 (const uint) +0:149 direct index ( temp uint) +0:149 'dti' ( in 3-component vector of uint) +0:149 Constant: +0:149 0 (const int) +0:149 Constant: +0:149 3 (const int) +0:149 subgroupQuadSwapDiagonal ( temp 4-component vector of double) +0:149 d: direct index for structure ( temp 4-component vector of double) +0:149 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:149 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:149 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:149 Constant: +0:149 0 (const uint) +0:149 direct index ( temp uint) +0:149 'dti' ( in 3-component vector of uint) +0:149 Constant: +0:149 0 (const int) +0:149 Constant: +0:149 3 (const int) +0:150 move second child to first child ( temp double) +0:150 direct index ( temp double) +0:150 d: direct index for structure ( temp 4-component vector of double) +0:150 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:150 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:150 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:150 Constant: +0:150 0 (const uint) +0:150 direct index ( temp uint) +0:150 'dti' ( in 3-component vector of uint) +0:150 Constant: +0:150 0 (const int) +0:150 Constant: +0:150 3 (const int) +0:150 Constant: +0:150 0 (const int) +0:150 subgroupQuadSwapDiagonal ( temp double) +0:150 direct index ( temp double) +0:150 d: direct index for structure ( temp 4-component vector of double) +0:150 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:150 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:150 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:150 Constant: +0:150 0 (const uint) +0:150 direct index ( temp uint) +0:150 'dti' ( in 3-component vector of uint) +0:150 Constant: +0:150 0 (const int) +0:150 Constant: +0:150 3 (const int) +0:150 Constant: +0:150 0 (const int) +0:151 move second child to first child ( temp 2-component vector of double) +0:151 vector swizzle ( temp 2-component vector of double) +0:151 d: direct index for structure ( temp 4-component vector of double) +0:151 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:151 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:151 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:151 Constant: +0:151 0 (const uint) +0:151 direct index ( temp uint) +0:151 'dti' ( in 3-component vector of uint) +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 3 (const int) +0:151 Sequence +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 1 (const int) +0:151 subgroupQuadSwapDiagonal ( temp 2-component vector of double) +0:151 vector swizzle ( temp 2-component vector of double) +0:151 d: direct index for structure ( temp 4-component vector of double) +0:151 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:151 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:151 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:151 Constant: +0:151 0 (const uint) +0:151 direct index ( temp uint) +0:151 'dti' ( in 3-component vector of uint) +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 3 (const int) +0:151 Sequence +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 1 (const int) +0:152 move second child to first child ( temp 3-component vector of double) +0:152 vector swizzle ( temp 3-component vector of double) +0:152 d: direct index for structure ( temp 4-component vector of double) +0:152 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:152 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:152 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:152 Constant: +0:152 0 (const uint) +0:152 direct index ( temp uint) +0:152 'dti' ( in 3-component vector of uint) +0:152 Constant: +0:152 0 (const int) +0:152 Constant: +0:152 3 (const int) +0:152 Sequence +0:152 Constant: +0:152 0 (const int) +0:152 Constant: +0:152 1 (const int) +0:152 Constant: +0:152 2 (const int) +0:152 subgroupQuadSwapDiagonal ( temp 3-component vector of double) +0:152 vector swizzle ( temp 3-component vector of double) +0:152 d: direct index for structure ( temp 4-component vector of double) +0:152 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:152 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:152 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:152 Constant: +0:152 0 (const uint) +0:152 direct index ( temp uint) +0:152 'dti' ( in 3-component vector of uint) +0:152 Constant: +0:152 0 (const int) +0:152 Constant: +0:152 3 (const int) +0:152 Sequence +0:152 Constant: +0:152 0 (const int) +0:152 Constant: +0:152 1 (const int) +0:152 Constant: +0:152 2 (const int) +0:13 Function Definition: CSMain( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:13 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 1120 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformQuad + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "CSMain" 1115 + ExecutionMode 4 LocalSize 32 16 1 + Source HLSL 500 + Name 4 "CSMain" + Name 11 "@CSMain(vu3;" + Name 10 "dti" + Name 20 "Types" + MemberName 20(Types) 0 "u" + MemberName 20(Types) 1 "i" + MemberName 20(Types) 2 "f" + MemberName 20(Types) 3 "d" + Name 22 "data" + MemberName 22(data) 0 "@data" + Name 24 "data" + Name 1113 "dti" + Name 1115 "dti" + Name 1117 "param" + MemberDecorate 20(Types) 0 Offset 0 + MemberDecorate 20(Types) 1 Offset 16 + MemberDecorate 20(Types) 2 Offset 32 + MemberDecorate 20(Types) 3 Offset 64 + Decorate 21 ArrayStride 96 + MemberDecorate 22(data) 0 Offset 0 + Decorate 22(data) BufferBlock + Decorate 24(data) DescriptorSet 0 + Decorate 1115(dti) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 13: TypeVector 6(int) 4 + 14: TypeInt 32 1 + 15: TypeVector 14(int) 4 + 16: TypeFloat 32 + 17: TypeVector 16(float) 4 + 18: TypeFloat 64 + 19: TypeVector 18(float) 4 + 20(Types): TypeStruct 13(ivec4) 15(ivec4) 17(fvec4) 19(fvec4) + 21: TypeRuntimeArray 20(Types) + 22(data): TypeStruct 21 + 23: TypePointer Uniform 22(data) + 24(data): 23(ptr) Variable Uniform + 25: 14(int) Constant 0 + 26: 6(int) Constant 0 + 27: TypePointer Function 6(int) + 32: TypePointer Uniform 13(ivec4) + 35: 6(int) Constant 3 + 42: TypePointer Uniform 6(int) + 51: TypeVector 6(int) 2 + 72: 14(int) Constant 1 + 75: TypePointer Uniform 15(ivec4) + 84: TypePointer Uniform 14(int) + 93: TypeVector 14(int) 2 + 105: TypeVector 14(int) 3 + 115: 14(int) Constant 2 + 118: TypePointer Uniform 17(fvec4) + 127: TypePointer Uniform 16(float) + 136: TypeVector 16(float) 2 + 148: TypeVector 16(float) 3 + 158: 14(int) Constant 3 + 161: TypePointer Uniform 19(fvec4) + 170: TypePointer Uniform 18(float) + 179: TypeVector 18(float) 2 + 191: TypeVector 18(float) 3 + 205: 6(int) Constant 1 + 358: 6(int) Constant 2 + 1114: TypePointer Input 7(ivec3) + 1115(dti): 1114(ptr) Variable Input + 4(CSMain): 2 Function None 3 + 5: Label + 1113(dti): 8(ptr) Variable Function + 1117(param): 8(ptr) Variable Function + 1116: 7(ivec3) Load 1115(dti) + Store 1113(dti) 1116 + 1118: 7(ivec3) Load 1113(dti) + Store 1117(param) 1118 + 1119: 2 FunctionCall 11(@CSMain(vu3;) 1117(param) + Return + FunctionEnd +11(@CSMain(vu3;): 2 Function None 9 + 10(dti): 8(ptr) FunctionParameter + 12: Label + 28: 27(ptr) AccessChain 10(dti) 26 + 29: 6(int) Load 28 + 30: 27(ptr) AccessChain 10(dti) 26 + 31: 6(int) Load 30 + 33: 32(ptr) AccessChain 24(data) 25 31 25 + 34: 13(ivec4) Load 33 + 36: 13(ivec4) GroupNonUniformQuadBroadcast 35 34 26 + 37: 32(ptr) AccessChain 24(data) 25 29 25 + Store 37 36 + 38: 27(ptr) AccessChain 10(dti) 26 + 39: 6(int) Load 38 + 40: 27(ptr) AccessChain 10(dti) 26 + 41: 6(int) Load 40 + 43: 42(ptr) AccessChain 24(data) 25 41 25 26 + 44: 6(int) Load 43 + 45: 6(int) GroupNonUniformQuadBroadcast 35 44 26 + 46: 42(ptr) AccessChain 24(data) 25 39 25 26 + Store 46 45 + 47: 27(ptr) AccessChain 10(dti) 26 + 48: 6(int) Load 47 + 49: 27(ptr) AccessChain 10(dti) 26 + 50: 6(int) Load 49 + 52: 32(ptr) AccessChain 24(data) 25 50 25 + 53: 13(ivec4) Load 52 + 54: 51(ivec2) VectorShuffle 53 53 0 1 + 55: 51(ivec2) GroupNonUniformQuadBroadcast 35 54 26 + 56: 32(ptr) AccessChain 24(data) 25 48 25 + 57: 13(ivec4) Load 56 + 58: 13(ivec4) VectorShuffle 57 55 4 5 2 3 + Store 56 58 + 59: 27(ptr) AccessChain 10(dti) 26 + 60: 6(int) Load 59 + 61: 27(ptr) AccessChain 10(dti) 26 + 62: 6(int) Load 61 + 63: 32(ptr) AccessChain 24(data) 25 62 25 + 64: 13(ivec4) Load 63 + 65: 7(ivec3) VectorShuffle 64 64 0 1 2 + 66: 7(ivec3) GroupNonUniformQuadBroadcast 35 65 26 + 67: 32(ptr) AccessChain 24(data) 25 60 25 + 68: 13(ivec4) Load 67 + 69: 13(ivec4) VectorShuffle 68 66 4 5 6 3 + Store 67 69 + 70: 27(ptr) AccessChain 10(dti) 26 + 71: 6(int) Load 70 + 73: 27(ptr) AccessChain 10(dti) 26 + 74: 6(int) Load 73 + 76: 75(ptr) AccessChain 24(data) 25 74 72 + 77: 15(ivec4) Load 76 + 78: 15(ivec4) GroupNonUniformQuadBroadcast 35 77 26 + 79: 75(ptr) AccessChain 24(data) 25 71 72 + Store 79 78 + 80: 27(ptr) AccessChain 10(dti) 26 + 81: 6(int) Load 80 + 82: 27(ptr) AccessChain 10(dti) 26 + 83: 6(int) Load 82 + 85: 84(ptr) AccessChain 24(data) 25 83 72 26 + 86: 14(int) Load 85 + 87: 14(int) GroupNonUniformQuadBroadcast 35 86 26 + 88: 84(ptr) AccessChain 24(data) 25 81 72 26 + Store 88 87 + 89: 27(ptr) AccessChain 10(dti) 26 + 90: 6(int) Load 89 + 91: 27(ptr) AccessChain 10(dti) 26 + 92: 6(int) Load 91 + 94: 75(ptr) AccessChain 24(data) 25 92 72 + 95: 15(ivec4) Load 94 + 96: 93(ivec2) VectorShuffle 95 95 0 1 + 97: 93(ivec2) GroupNonUniformQuadBroadcast 35 96 26 + 98: 75(ptr) AccessChain 24(data) 25 90 72 + 99: 15(ivec4) Load 98 + 100: 15(ivec4) VectorShuffle 99 97 4 5 2 3 + Store 98 100 + 101: 27(ptr) AccessChain 10(dti) 26 + 102: 6(int) Load 101 + 103: 27(ptr) AccessChain 10(dti) 26 + 104: 6(int) Load 103 + 106: 75(ptr) AccessChain 24(data) 25 104 72 + 107: 15(ivec4) Load 106 + 108: 105(ivec3) VectorShuffle 107 107 0 1 2 + 109: 105(ivec3) GroupNonUniformQuadBroadcast 35 108 26 + 110: 75(ptr) AccessChain 24(data) 25 102 72 + 111: 15(ivec4) Load 110 + 112: 15(ivec4) VectorShuffle 111 109 4 5 6 3 + Store 110 112 + 113: 27(ptr) AccessChain 10(dti) 26 + 114: 6(int) Load 113 + 116: 27(ptr) AccessChain 10(dti) 26 + 117: 6(int) Load 116 + 119: 118(ptr) AccessChain 24(data) 25 117 115 + 120: 17(fvec4) Load 119 + 121: 17(fvec4) GroupNonUniformQuadBroadcast 35 120 26 + 122: 118(ptr) AccessChain 24(data) 25 114 115 + Store 122 121 + 123: 27(ptr) AccessChain 10(dti) 26 + 124: 6(int) Load 123 + 125: 27(ptr) AccessChain 10(dti) 26 + 126: 6(int) Load 125 + 128: 127(ptr) AccessChain 24(data) 25 126 115 26 + 129: 16(float) Load 128 + 130: 16(float) GroupNonUniformQuadBroadcast 35 129 26 + 131: 127(ptr) AccessChain 24(data) 25 124 115 26 + Store 131 130 + 132: 27(ptr) AccessChain 10(dti) 26 + 133: 6(int) Load 132 + 134: 27(ptr) AccessChain 10(dti) 26 + 135: 6(int) Load 134 + 137: 118(ptr) AccessChain 24(data) 25 135 115 + 138: 17(fvec4) Load 137 + 139: 136(fvec2) VectorShuffle 138 138 0 1 + 140: 136(fvec2) GroupNonUniformQuadBroadcast 35 139 26 + 141: 118(ptr) AccessChain 24(data) 25 133 115 + 142: 17(fvec4) Load 141 + 143: 17(fvec4) VectorShuffle 142 140 4 5 2 3 + Store 141 143 + 144: 27(ptr) AccessChain 10(dti) 26 + 145: 6(int) Load 144 + 146: 27(ptr) AccessChain 10(dti) 26 + 147: 6(int) Load 146 + 149: 118(ptr) AccessChain 24(data) 25 147 115 + 150: 17(fvec4) Load 149 + 151: 148(fvec3) VectorShuffle 150 150 0 1 2 + 152: 148(fvec3) GroupNonUniformQuadBroadcast 35 151 26 + 153: 118(ptr) AccessChain 24(data) 25 145 115 + 154: 17(fvec4) Load 153 + 155: 17(fvec4) VectorShuffle 154 152 4 5 6 3 + Store 153 155 + 156: 27(ptr) AccessChain 10(dti) 26 + 157: 6(int) Load 156 + 159: 27(ptr) AccessChain 10(dti) 26 + 160: 6(int) Load 159 + 162: 161(ptr) AccessChain 24(data) 25 160 158 + 163: 19(fvec4) Load 162 + 164: 19(fvec4) GroupNonUniformQuadBroadcast 35 163 26 + 165: 161(ptr) AccessChain 24(data) 25 157 158 + Store 165 164 + 166: 27(ptr) AccessChain 10(dti) 26 + 167: 6(int) Load 166 + 168: 27(ptr) AccessChain 10(dti) 26 + 169: 6(int) Load 168 + 171: 170(ptr) AccessChain 24(data) 25 169 158 26 + 172: 18(float) Load 171 + 173: 18(float) GroupNonUniformQuadBroadcast 35 172 26 + 174: 170(ptr) AccessChain 24(data) 25 167 158 26 + Store 174 173 + 175: 27(ptr) AccessChain 10(dti) 26 + 176: 6(int) Load 175 + 177: 27(ptr) AccessChain 10(dti) 26 + 178: 6(int) Load 177 + 180: 161(ptr) AccessChain 24(data) 25 178 158 + 181: 19(fvec4) Load 180 + 182: 179(fvec2) VectorShuffle 181 181 0 1 + 183: 179(fvec2) GroupNonUniformQuadBroadcast 35 182 26 + 184: 161(ptr) AccessChain 24(data) 25 176 158 + 185: 19(fvec4) Load 184 + 186: 19(fvec4) VectorShuffle 185 183 4 5 2 3 + Store 184 186 + 187: 27(ptr) AccessChain 10(dti) 26 + 188: 6(int) Load 187 + 189: 27(ptr) AccessChain 10(dti) 26 + 190: 6(int) Load 189 + 192: 161(ptr) AccessChain 24(data) 25 190 158 + 193: 19(fvec4) Load 192 + 194: 191(fvec3) VectorShuffle 193 193 0 1 2 + 195: 191(fvec3) GroupNonUniformQuadBroadcast 35 194 26 + 196: 161(ptr) AccessChain 24(data) 25 188 158 + 197: 19(fvec4) Load 196 + 198: 19(fvec4) VectorShuffle 197 195 4 5 6 3 + Store 196 198 + 199: 27(ptr) AccessChain 10(dti) 26 + 200: 6(int) Load 199 + 201: 27(ptr) AccessChain 10(dti) 26 + 202: 6(int) Load 201 + 203: 32(ptr) AccessChain 24(data) 25 202 25 + 204: 13(ivec4) Load 203 + 206: 13(ivec4) GroupNonUniformQuadBroadcast 35 204 205 + 207: 32(ptr) AccessChain 24(data) 25 200 25 + Store 207 206 + 208: 27(ptr) AccessChain 10(dti) 26 + 209: 6(int) Load 208 + 210: 27(ptr) AccessChain 10(dti) 26 + 211: 6(int) Load 210 + 212: 42(ptr) AccessChain 24(data) 25 211 25 26 + 213: 6(int) Load 212 + 214: 6(int) GroupNonUniformQuadBroadcast 35 213 205 + 215: 42(ptr) AccessChain 24(data) 25 209 25 26 + Store 215 214 + 216: 27(ptr) AccessChain 10(dti) 26 + 217: 6(int) Load 216 + 218: 27(ptr) AccessChain 10(dti) 26 + 219: 6(int) Load 218 + 220: 32(ptr) AccessChain 24(data) 25 219 25 + 221: 13(ivec4) Load 220 + 222: 51(ivec2) VectorShuffle 221 221 0 1 + 223: 51(ivec2) GroupNonUniformQuadBroadcast 35 222 205 + 224: 32(ptr) AccessChain 24(data) 25 217 25 + 225: 13(ivec4) Load 224 + 226: 13(ivec4) VectorShuffle 225 223 4 5 2 3 + Store 224 226 + 227: 27(ptr) AccessChain 10(dti) 26 + 228: 6(int) Load 227 + 229: 27(ptr) AccessChain 10(dti) 26 + 230: 6(int) Load 229 + 231: 32(ptr) AccessChain 24(data) 25 230 25 + 232: 13(ivec4) Load 231 + 233: 7(ivec3) VectorShuffle 232 232 0 1 2 + 234: 7(ivec3) GroupNonUniformQuadBroadcast 35 233 205 + 235: 32(ptr) AccessChain 24(data) 25 228 25 + 236: 13(ivec4) Load 235 + 237: 13(ivec4) VectorShuffle 236 234 4 5 6 3 + Store 235 237 + 238: 27(ptr) AccessChain 10(dti) 26 + 239: 6(int) Load 238 + 240: 27(ptr) AccessChain 10(dti) 26 + 241: 6(int) Load 240 + 242: 75(ptr) AccessChain 24(data) 25 241 72 + 243: 15(ivec4) Load 242 + 244: 15(ivec4) GroupNonUniformQuadBroadcast 35 243 205 + 245: 75(ptr) AccessChain 24(data) 25 239 72 + Store 245 244 + 246: 27(ptr) AccessChain 10(dti) 26 + 247: 6(int) Load 246 + 248: 27(ptr) AccessChain 10(dti) 26 + 249: 6(int) Load 248 + 250: 84(ptr) AccessChain 24(data) 25 249 72 26 + 251: 14(int) Load 250 + 252: 14(int) GroupNonUniformQuadBroadcast 35 251 205 + 253: 84(ptr) AccessChain 24(data) 25 247 72 26 + Store 253 252 + 254: 27(ptr) AccessChain 10(dti) 26 + 255: 6(int) Load 254 + 256: 27(ptr) AccessChain 10(dti) 26 + 257: 6(int) Load 256 + 258: 75(ptr) AccessChain 24(data) 25 257 72 + 259: 15(ivec4) Load 258 + 260: 93(ivec2) VectorShuffle 259 259 0 1 + 261: 93(ivec2) GroupNonUniformQuadBroadcast 35 260 205 + 262: 75(ptr) AccessChain 24(data) 25 255 72 + 263: 15(ivec4) Load 262 + 264: 15(ivec4) VectorShuffle 263 261 4 5 2 3 + Store 262 264 + 265: 27(ptr) AccessChain 10(dti) 26 + 266: 6(int) Load 265 + 267: 27(ptr) AccessChain 10(dti) 26 + 268: 6(int) Load 267 + 269: 75(ptr) AccessChain 24(data) 25 268 72 + 270: 15(ivec4) Load 269 + 271: 105(ivec3) VectorShuffle 270 270 0 1 2 + 272: 105(ivec3) GroupNonUniformQuadBroadcast 35 271 205 + 273: 75(ptr) AccessChain 24(data) 25 266 72 + 274: 15(ivec4) Load 273 + 275: 15(ivec4) VectorShuffle 274 272 4 5 6 3 + Store 273 275 + 276: 27(ptr) AccessChain 10(dti) 26 + 277: 6(int) Load 276 + 278: 27(ptr) AccessChain 10(dti) 26 + 279: 6(int) Load 278 + 280: 118(ptr) AccessChain 24(data) 25 279 115 + 281: 17(fvec4) Load 280 + 282: 17(fvec4) GroupNonUniformQuadBroadcast 35 281 205 + 283: 118(ptr) AccessChain 24(data) 25 277 115 + Store 283 282 + 284: 27(ptr) AccessChain 10(dti) 26 + 285: 6(int) Load 284 + 286: 27(ptr) AccessChain 10(dti) 26 + 287: 6(int) Load 286 + 288: 127(ptr) AccessChain 24(data) 25 287 115 26 + 289: 16(float) Load 288 + 290: 16(float) GroupNonUniformQuadBroadcast 35 289 205 + 291: 127(ptr) AccessChain 24(data) 25 285 115 26 + Store 291 290 + 292: 27(ptr) AccessChain 10(dti) 26 + 293: 6(int) Load 292 + 294: 27(ptr) AccessChain 10(dti) 26 + 295: 6(int) Load 294 + 296: 118(ptr) AccessChain 24(data) 25 295 115 + 297: 17(fvec4) Load 296 + 298: 136(fvec2) VectorShuffle 297 297 0 1 + 299: 136(fvec2) GroupNonUniformQuadBroadcast 35 298 205 + 300: 118(ptr) AccessChain 24(data) 25 293 115 + 301: 17(fvec4) Load 300 + 302: 17(fvec4) VectorShuffle 301 299 4 5 2 3 + Store 300 302 + 303: 27(ptr) AccessChain 10(dti) 26 + 304: 6(int) Load 303 + 305: 27(ptr) AccessChain 10(dti) 26 + 306: 6(int) Load 305 + 307: 118(ptr) AccessChain 24(data) 25 306 115 + 308: 17(fvec4) Load 307 + 309: 148(fvec3) VectorShuffle 308 308 0 1 2 + 310: 148(fvec3) GroupNonUniformQuadBroadcast 35 309 205 + 311: 118(ptr) AccessChain 24(data) 25 304 115 + 312: 17(fvec4) Load 311 + 313: 17(fvec4) VectorShuffle 312 310 4 5 6 3 + Store 311 313 + 314: 27(ptr) AccessChain 10(dti) 26 + 315: 6(int) Load 314 + 316: 27(ptr) AccessChain 10(dti) 26 + 317: 6(int) Load 316 + 318: 161(ptr) AccessChain 24(data) 25 317 158 + 319: 19(fvec4) Load 318 + 320: 19(fvec4) GroupNonUniformQuadBroadcast 35 319 205 + 321: 161(ptr) AccessChain 24(data) 25 315 158 + Store 321 320 + 322: 27(ptr) AccessChain 10(dti) 26 + 323: 6(int) Load 322 + 324: 27(ptr) AccessChain 10(dti) 26 + 325: 6(int) Load 324 + 326: 170(ptr) AccessChain 24(data) 25 325 158 26 + 327: 18(float) Load 326 + 328: 18(float) GroupNonUniformQuadBroadcast 35 327 205 + 329: 170(ptr) AccessChain 24(data) 25 323 158 26 + Store 329 328 + 330: 27(ptr) AccessChain 10(dti) 26 + 331: 6(int) Load 330 + 332: 27(ptr) AccessChain 10(dti) 26 + 333: 6(int) Load 332 + 334: 161(ptr) AccessChain 24(data) 25 333 158 + 335: 19(fvec4) Load 334 + 336: 179(fvec2) VectorShuffle 335 335 0 1 + 337: 179(fvec2) GroupNonUniformQuadBroadcast 35 336 205 + 338: 161(ptr) AccessChain 24(data) 25 331 158 + 339: 19(fvec4) Load 338 + 340: 19(fvec4) VectorShuffle 339 337 4 5 2 3 + Store 338 340 + 341: 27(ptr) AccessChain 10(dti) 26 + 342: 6(int) Load 341 + 343: 27(ptr) AccessChain 10(dti) 26 + 344: 6(int) Load 343 + 345: 161(ptr) AccessChain 24(data) 25 344 158 + 346: 19(fvec4) Load 345 + 347: 191(fvec3) VectorShuffle 346 346 0 1 2 + 348: 191(fvec3) GroupNonUniformQuadBroadcast 35 347 205 + 349: 161(ptr) AccessChain 24(data) 25 342 158 + 350: 19(fvec4) Load 349 + 351: 19(fvec4) VectorShuffle 350 348 4 5 6 3 + Store 349 351 + 352: 27(ptr) AccessChain 10(dti) 26 + 353: 6(int) Load 352 + 354: 27(ptr) AccessChain 10(dti) 26 + 355: 6(int) Load 354 + 356: 32(ptr) AccessChain 24(data) 25 355 25 + 357: 13(ivec4) Load 356 + 359: 13(ivec4) GroupNonUniformQuadBroadcast 35 357 358 + 360: 32(ptr) AccessChain 24(data) 25 353 25 + Store 360 359 + 361: 27(ptr) AccessChain 10(dti) 26 + 362: 6(int) Load 361 + 363: 27(ptr) AccessChain 10(dti) 26 + 364: 6(int) Load 363 + 365: 42(ptr) AccessChain 24(data) 25 364 25 26 + 366: 6(int) Load 365 + 367: 6(int) GroupNonUniformQuadBroadcast 35 366 358 + 368: 42(ptr) AccessChain 24(data) 25 362 25 26 + Store 368 367 + 369: 27(ptr) AccessChain 10(dti) 26 + 370: 6(int) Load 369 + 371: 27(ptr) AccessChain 10(dti) 26 + 372: 6(int) Load 371 + 373: 32(ptr) AccessChain 24(data) 25 372 25 + 374: 13(ivec4) Load 373 + 375: 51(ivec2) VectorShuffle 374 374 0 1 + 376: 51(ivec2) GroupNonUniformQuadBroadcast 35 375 358 + 377: 32(ptr) AccessChain 24(data) 25 370 25 + 378: 13(ivec4) Load 377 + 379: 13(ivec4) VectorShuffle 378 376 4 5 2 3 + Store 377 379 + 380: 27(ptr) AccessChain 10(dti) 26 + 381: 6(int) Load 380 + 382: 27(ptr) AccessChain 10(dti) 26 + 383: 6(int) Load 382 + 384: 32(ptr) AccessChain 24(data) 25 383 25 + 385: 13(ivec4) Load 384 + 386: 7(ivec3) VectorShuffle 385 385 0 1 2 + 387: 7(ivec3) GroupNonUniformQuadBroadcast 35 386 358 + 388: 32(ptr) AccessChain 24(data) 25 381 25 + 389: 13(ivec4) Load 388 + 390: 13(ivec4) VectorShuffle 389 387 4 5 6 3 + Store 388 390 + 391: 27(ptr) AccessChain 10(dti) 26 + 392: 6(int) Load 391 + 393: 27(ptr) AccessChain 10(dti) 26 + 394: 6(int) Load 393 + 395: 75(ptr) AccessChain 24(data) 25 394 72 + 396: 15(ivec4) Load 395 + 397: 15(ivec4) GroupNonUniformQuadBroadcast 35 396 358 + 398: 75(ptr) AccessChain 24(data) 25 392 72 + Store 398 397 + 399: 27(ptr) AccessChain 10(dti) 26 + 400: 6(int) Load 399 + 401: 27(ptr) AccessChain 10(dti) 26 + 402: 6(int) Load 401 + 403: 84(ptr) AccessChain 24(data) 25 402 72 26 + 404: 14(int) Load 403 + 405: 14(int) GroupNonUniformQuadBroadcast 35 404 358 + 406: 84(ptr) AccessChain 24(data) 25 400 72 26 + Store 406 405 + 407: 27(ptr) AccessChain 10(dti) 26 + 408: 6(int) Load 407 + 409: 27(ptr) AccessChain 10(dti) 26 + 410: 6(int) Load 409 + 411: 75(ptr) AccessChain 24(data) 25 410 72 + 412: 15(ivec4) Load 411 + 413: 93(ivec2) VectorShuffle 412 412 0 1 + 414: 93(ivec2) GroupNonUniformQuadBroadcast 35 413 358 + 415: 75(ptr) AccessChain 24(data) 25 408 72 + 416: 15(ivec4) Load 415 + 417: 15(ivec4) VectorShuffle 416 414 4 5 2 3 + Store 415 417 + 418: 27(ptr) AccessChain 10(dti) 26 + 419: 6(int) Load 418 + 420: 27(ptr) AccessChain 10(dti) 26 + 421: 6(int) Load 420 + 422: 75(ptr) AccessChain 24(data) 25 421 72 + 423: 15(ivec4) Load 422 + 424: 105(ivec3) VectorShuffle 423 423 0 1 2 + 425: 105(ivec3) GroupNonUniformQuadBroadcast 35 424 358 + 426: 75(ptr) AccessChain 24(data) 25 419 72 + 427: 15(ivec4) Load 426 + 428: 15(ivec4) VectorShuffle 427 425 4 5 6 3 + Store 426 428 + 429: 27(ptr) AccessChain 10(dti) 26 + 430: 6(int) Load 429 + 431: 27(ptr) AccessChain 10(dti) 26 + 432: 6(int) Load 431 + 433: 118(ptr) AccessChain 24(data) 25 432 115 + 434: 17(fvec4) Load 433 + 435: 17(fvec4) GroupNonUniformQuadBroadcast 35 434 358 + 436: 118(ptr) AccessChain 24(data) 25 430 115 + Store 436 435 + 437: 27(ptr) AccessChain 10(dti) 26 + 438: 6(int) Load 437 + 439: 27(ptr) AccessChain 10(dti) 26 + 440: 6(int) Load 439 + 441: 127(ptr) AccessChain 24(data) 25 440 115 26 + 442: 16(float) Load 441 + 443: 16(float) GroupNonUniformQuadBroadcast 35 442 358 + 444: 127(ptr) AccessChain 24(data) 25 438 115 26 + Store 444 443 + 445: 27(ptr) AccessChain 10(dti) 26 + 446: 6(int) Load 445 + 447: 27(ptr) AccessChain 10(dti) 26 + 448: 6(int) Load 447 + 449: 118(ptr) AccessChain 24(data) 25 448 115 + 450: 17(fvec4) Load 449 + 451: 136(fvec2) VectorShuffle 450 450 0 1 + 452: 136(fvec2) GroupNonUniformQuadBroadcast 35 451 358 + 453: 118(ptr) AccessChain 24(data) 25 446 115 + 454: 17(fvec4) Load 453 + 455: 17(fvec4) VectorShuffle 454 452 4 5 2 3 + Store 453 455 + 456: 27(ptr) AccessChain 10(dti) 26 + 457: 6(int) Load 456 + 458: 27(ptr) AccessChain 10(dti) 26 + 459: 6(int) Load 458 + 460: 118(ptr) AccessChain 24(data) 25 459 115 + 461: 17(fvec4) Load 460 + 462: 148(fvec3) VectorShuffle 461 461 0 1 2 + 463: 148(fvec3) GroupNonUniformQuadBroadcast 35 462 358 + 464: 118(ptr) AccessChain 24(data) 25 457 115 + 465: 17(fvec4) Load 464 + 466: 17(fvec4) VectorShuffle 465 463 4 5 6 3 + Store 464 466 + 467: 27(ptr) AccessChain 10(dti) 26 + 468: 6(int) Load 467 + 469: 27(ptr) AccessChain 10(dti) 26 + 470: 6(int) Load 469 + 471: 161(ptr) AccessChain 24(data) 25 470 158 + 472: 19(fvec4) Load 471 + 473: 19(fvec4) GroupNonUniformQuadBroadcast 35 472 358 + 474: 161(ptr) AccessChain 24(data) 25 468 158 + Store 474 473 + 475: 27(ptr) AccessChain 10(dti) 26 + 476: 6(int) Load 475 + 477: 27(ptr) AccessChain 10(dti) 26 + 478: 6(int) Load 477 + 479: 170(ptr) AccessChain 24(data) 25 478 158 26 + 480: 18(float) Load 479 + 481: 18(float) GroupNonUniformQuadBroadcast 35 480 358 + 482: 170(ptr) AccessChain 24(data) 25 476 158 26 + Store 482 481 + 483: 27(ptr) AccessChain 10(dti) 26 + 484: 6(int) Load 483 + 485: 27(ptr) AccessChain 10(dti) 26 + 486: 6(int) Load 485 + 487: 161(ptr) AccessChain 24(data) 25 486 158 + 488: 19(fvec4) Load 487 + 489: 179(fvec2) VectorShuffle 488 488 0 1 + 490: 179(fvec2) GroupNonUniformQuadBroadcast 35 489 358 + 491: 161(ptr) AccessChain 24(data) 25 484 158 + 492: 19(fvec4) Load 491 + 493: 19(fvec4) VectorShuffle 492 490 4 5 2 3 + Store 491 493 + 494: 27(ptr) AccessChain 10(dti) 26 + 495: 6(int) Load 494 + 496: 27(ptr) AccessChain 10(dti) 26 + 497: 6(int) Load 496 + 498: 161(ptr) AccessChain 24(data) 25 497 158 + 499: 19(fvec4) Load 498 + 500: 191(fvec3) VectorShuffle 499 499 0 1 2 + 501: 191(fvec3) GroupNonUniformQuadBroadcast 35 500 358 + 502: 161(ptr) AccessChain 24(data) 25 495 158 + 503: 19(fvec4) Load 502 + 504: 19(fvec4) VectorShuffle 503 501 4 5 6 3 + Store 502 504 + 505: 27(ptr) AccessChain 10(dti) 26 + 506: 6(int) Load 505 + 507: 27(ptr) AccessChain 10(dti) 26 + 508: 6(int) Load 507 + 509: 32(ptr) AccessChain 24(data) 25 508 25 + 510: 13(ivec4) Load 509 + 511: 13(ivec4) GroupNonUniformQuadBroadcast 35 510 35 + 512: 32(ptr) AccessChain 24(data) 25 506 25 + Store 512 511 + 513: 27(ptr) AccessChain 10(dti) 26 + 514: 6(int) Load 513 + 515: 27(ptr) AccessChain 10(dti) 26 + 516: 6(int) Load 515 + 517: 42(ptr) AccessChain 24(data) 25 516 25 26 + 518: 6(int) Load 517 + 519: 6(int) GroupNonUniformQuadBroadcast 35 518 35 + 520: 42(ptr) AccessChain 24(data) 25 514 25 26 + Store 520 519 + 521: 27(ptr) AccessChain 10(dti) 26 + 522: 6(int) Load 521 + 523: 27(ptr) AccessChain 10(dti) 26 + 524: 6(int) Load 523 + 525: 32(ptr) AccessChain 24(data) 25 524 25 + 526: 13(ivec4) Load 525 + 527: 51(ivec2) VectorShuffle 526 526 0 1 + 528: 51(ivec2) GroupNonUniformQuadBroadcast 35 527 35 + 529: 32(ptr) AccessChain 24(data) 25 522 25 + 530: 13(ivec4) Load 529 + 531: 13(ivec4) VectorShuffle 530 528 4 5 2 3 + Store 529 531 + 532: 27(ptr) AccessChain 10(dti) 26 + 533: 6(int) Load 532 + 534: 27(ptr) AccessChain 10(dti) 26 + 535: 6(int) Load 534 + 536: 32(ptr) AccessChain 24(data) 25 535 25 + 537: 13(ivec4) Load 536 + 538: 7(ivec3) VectorShuffle 537 537 0 1 2 + 539: 7(ivec3) GroupNonUniformQuadBroadcast 35 538 35 + 540: 32(ptr) AccessChain 24(data) 25 533 25 + 541: 13(ivec4) Load 540 + 542: 13(ivec4) VectorShuffle 541 539 4 5 6 3 + Store 540 542 + 543: 27(ptr) AccessChain 10(dti) 26 + 544: 6(int) Load 543 + 545: 27(ptr) AccessChain 10(dti) 26 + 546: 6(int) Load 545 + 547: 75(ptr) AccessChain 24(data) 25 546 72 + 548: 15(ivec4) Load 547 + 549: 15(ivec4) GroupNonUniformQuadBroadcast 35 548 35 + 550: 75(ptr) AccessChain 24(data) 25 544 72 + Store 550 549 + 551: 27(ptr) AccessChain 10(dti) 26 + 552: 6(int) Load 551 + 553: 27(ptr) AccessChain 10(dti) 26 + 554: 6(int) Load 553 + 555: 84(ptr) AccessChain 24(data) 25 554 72 26 + 556: 14(int) Load 555 + 557: 14(int) GroupNonUniformQuadBroadcast 35 556 35 + 558: 84(ptr) AccessChain 24(data) 25 552 72 26 + Store 558 557 + 559: 27(ptr) AccessChain 10(dti) 26 + 560: 6(int) Load 559 + 561: 27(ptr) AccessChain 10(dti) 26 + 562: 6(int) Load 561 + 563: 75(ptr) AccessChain 24(data) 25 562 72 + 564: 15(ivec4) Load 563 + 565: 93(ivec2) VectorShuffle 564 564 0 1 + 566: 93(ivec2) GroupNonUniformQuadBroadcast 35 565 35 + 567: 75(ptr) AccessChain 24(data) 25 560 72 + 568: 15(ivec4) Load 567 + 569: 15(ivec4) VectorShuffle 568 566 4 5 2 3 + Store 567 569 + 570: 27(ptr) AccessChain 10(dti) 26 + 571: 6(int) Load 570 + 572: 27(ptr) AccessChain 10(dti) 26 + 573: 6(int) Load 572 + 574: 75(ptr) AccessChain 24(data) 25 573 72 + 575: 15(ivec4) Load 574 + 576: 105(ivec3) VectorShuffle 575 575 0 1 2 + 577: 105(ivec3) GroupNonUniformQuadBroadcast 35 576 35 + 578: 75(ptr) AccessChain 24(data) 25 571 72 + 579: 15(ivec4) Load 578 + 580: 15(ivec4) VectorShuffle 579 577 4 5 6 3 + Store 578 580 + 581: 27(ptr) AccessChain 10(dti) 26 + 582: 6(int) Load 581 + 583: 27(ptr) AccessChain 10(dti) 26 + 584: 6(int) Load 583 + 585: 118(ptr) AccessChain 24(data) 25 584 115 + 586: 17(fvec4) Load 585 + 587: 17(fvec4) GroupNonUniformQuadBroadcast 35 586 35 + 588: 118(ptr) AccessChain 24(data) 25 582 115 + Store 588 587 + 589: 27(ptr) AccessChain 10(dti) 26 + 590: 6(int) Load 589 + 591: 27(ptr) AccessChain 10(dti) 26 + 592: 6(int) Load 591 + 593: 127(ptr) AccessChain 24(data) 25 592 115 26 + 594: 16(float) Load 593 + 595: 16(float) GroupNonUniformQuadBroadcast 35 594 35 + 596: 127(ptr) AccessChain 24(data) 25 590 115 26 + Store 596 595 + 597: 27(ptr) AccessChain 10(dti) 26 + 598: 6(int) Load 597 + 599: 27(ptr) AccessChain 10(dti) 26 + 600: 6(int) Load 599 + 601: 118(ptr) AccessChain 24(data) 25 600 115 + 602: 17(fvec4) Load 601 + 603: 136(fvec2) VectorShuffle 602 602 0 1 + 604: 136(fvec2) GroupNonUniformQuadBroadcast 35 603 35 + 605: 118(ptr) AccessChain 24(data) 25 598 115 + 606: 17(fvec4) Load 605 + 607: 17(fvec4) VectorShuffle 606 604 4 5 2 3 + Store 605 607 + 608: 27(ptr) AccessChain 10(dti) 26 + 609: 6(int) Load 608 + 610: 27(ptr) AccessChain 10(dti) 26 + 611: 6(int) Load 610 + 612: 118(ptr) AccessChain 24(data) 25 611 115 + 613: 17(fvec4) Load 612 + 614: 148(fvec3) VectorShuffle 613 613 0 1 2 + 615: 148(fvec3) GroupNonUniformQuadBroadcast 35 614 35 + 616: 118(ptr) AccessChain 24(data) 25 609 115 + 617: 17(fvec4) Load 616 + 618: 17(fvec4) VectorShuffle 617 615 4 5 6 3 + Store 616 618 + 619: 27(ptr) AccessChain 10(dti) 26 + 620: 6(int) Load 619 + 621: 27(ptr) AccessChain 10(dti) 26 + 622: 6(int) Load 621 + 623: 161(ptr) AccessChain 24(data) 25 622 158 + 624: 19(fvec4) Load 623 + 625: 19(fvec4) GroupNonUniformQuadBroadcast 35 624 35 + 626: 161(ptr) AccessChain 24(data) 25 620 158 + Store 626 625 + 627: 27(ptr) AccessChain 10(dti) 26 + 628: 6(int) Load 627 + 629: 27(ptr) AccessChain 10(dti) 26 + 630: 6(int) Load 629 + 631: 170(ptr) AccessChain 24(data) 25 630 158 26 + 632: 18(float) Load 631 + 633: 18(float) GroupNonUniformQuadBroadcast 35 632 35 + 634: 170(ptr) AccessChain 24(data) 25 628 158 26 + Store 634 633 + 635: 27(ptr) AccessChain 10(dti) 26 + 636: 6(int) Load 635 + 637: 27(ptr) AccessChain 10(dti) 26 + 638: 6(int) Load 637 + 639: 161(ptr) AccessChain 24(data) 25 638 158 + 640: 19(fvec4) Load 639 + 641: 179(fvec2) VectorShuffle 640 640 0 1 + 642: 179(fvec2) GroupNonUniformQuadBroadcast 35 641 35 + 643: 161(ptr) AccessChain 24(data) 25 636 158 + 644: 19(fvec4) Load 643 + 645: 19(fvec4) VectorShuffle 644 642 4 5 2 3 + Store 643 645 + 646: 27(ptr) AccessChain 10(dti) 26 + 647: 6(int) Load 646 + 648: 27(ptr) AccessChain 10(dti) 26 + 649: 6(int) Load 648 + 650: 161(ptr) AccessChain 24(data) 25 649 158 + 651: 19(fvec4) Load 650 + 652: 191(fvec3) VectorShuffle 651 651 0 1 2 + 653: 191(fvec3) GroupNonUniformQuadBroadcast 35 652 35 + 654: 161(ptr) AccessChain 24(data) 25 647 158 + 655: 19(fvec4) Load 654 + 656: 19(fvec4) VectorShuffle 655 653 4 5 6 3 + Store 654 656 + 657: 27(ptr) AccessChain 10(dti) 26 + 658: 6(int) Load 657 + 659: 27(ptr) AccessChain 10(dti) 26 + 660: 6(int) Load 659 + 661: 32(ptr) AccessChain 24(data) 25 660 25 + 662: 13(ivec4) Load 661 + 663: 13(ivec4) GroupNonUniformQuadSwap 35 662 26 + 664: 32(ptr) AccessChain 24(data) 25 658 25 + Store 664 663 + 665: 27(ptr) AccessChain 10(dti) 26 + 666: 6(int) Load 665 + 667: 27(ptr) AccessChain 10(dti) 26 + 668: 6(int) Load 667 + 669: 42(ptr) AccessChain 24(data) 25 668 25 26 + 670: 6(int) Load 669 + 671: 6(int) GroupNonUniformQuadSwap 35 670 26 + 672: 42(ptr) AccessChain 24(data) 25 666 25 26 + Store 672 671 + 673: 27(ptr) AccessChain 10(dti) 26 + 674: 6(int) Load 673 + 675: 27(ptr) AccessChain 10(dti) 26 + 676: 6(int) Load 675 + 677: 32(ptr) AccessChain 24(data) 25 676 25 + 678: 13(ivec4) Load 677 + 679: 51(ivec2) VectorShuffle 678 678 0 1 + 680: 51(ivec2) GroupNonUniformQuadSwap 35 679 26 + 681: 32(ptr) AccessChain 24(data) 25 674 25 + 682: 13(ivec4) Load 681 + 683: 13(ivec4) VectorShuffle 682 680 4 5 2 3 + Store 681 683 + 684: 27(ptr) AccessChain 10(dti) 26 + 685: 6(int) Load 684 + 686: 27(ptr) AccessChain 10(dti) 26 + 687: 6(int) Load 686 + 688: 32(ptr) AccessChain 24(data) 25 687 25 + 689: 13(ivec4) Load 688 + 690: 7(ivec3) VectorShuffle 689 689 0 1 2 + 691: 7(ivec3) GroupNonUniformQuadSwap 35 690 26 + 692: 32(ptr) AccessChain 24(data) 25 685 25 + 693: 13(ivec4) Load 692 + 694: 13(ivec4) VectorShuffle 693 691 4 5 6 3 + Store 692 694 + 695: 27(ptr) AccessChain 10(dti) 26 + 696: 6(int) Load 695 + 697: 27(ptr) AccessChain 10(dti) 26 + 698: 6(int) Load 697 + 699: 75(ptr) AccessChain 24(data) 25 698 72 + 700: 15(ivec4) Load 699 + 701: 15(ivec4) GroupNonUniformQuadSwap 35 700 26 + 702: 75(ptr) AccessChain 24(data) 25 696 72 + Store 702 701 + 703: 27(ptr) AccessChain 10(dti) 26 + 704: 6(int) Load 703 + 705: 27(ptr) AccessChain 10(dti) 26 + 706: 6(int) Load 705 + 707: 84(ptr) AccessChain 24(data) 25 706 72 26 + 708: 14(int) Load 707 + 709: 14(int) GroupNonUniformQuadSwap 35 708 26 + 710: 84(ptr) AccessChain 24(data) 25 704 72 26 + Store 710 709 + 711: 27(ptr) AccessChain 10(dti) 26 + 712: 6(int) Load 711 + 713: 27(ptr) AccessChain 10(dti) 26 + 714: 6(int) Load 713 + 715: 75(ptr) AccessChain 24(data) 25 714 72 + 716: 15(ivec4) Load 715 + 717: 93(ivec2) VectorShuffle 716 716 0 1 + 718: 93(ivec2) GroupNonUniformQuadSwap 35 717 26 + 719: 75(ptr) AccessChain 24(data) 25 712 72 + 720: 15(ivec4) Load 719 + 721: 15(ivec4) VectorShuffle 720 718 4 5 2 3 + Store 719 721 + 722: 27(ptr) AccessChain 10(dti) 26 + 723: 6(int) Load 722 + 724: 27(ptr) AccessChain 10(dti) 26 + 725: 6(int) Load 724 + 726: 75(ptr) AccessChain 24(data) 25 725 72 + 727: 15(ivec4) Load 726 + 728: 105(ivec3) VectorShuffle 727 727 0 1 2 + 729: 105(ivec3) GroupNonUniformQuadSwap 35 728 26 + 730: 75(ptr) AccessChain 24(data) 25 723 72 + 731: 15(ivec4) Load 730 + 732: 15(ivec4) VectorShuffle 731 729 4 5 6 3 + Store 730 732 + 733: 27(ptr) AccessChain 10(dti) 26 + 734: 6(int) Load 733 + 735: 27(ptr) AccessChain 10(dti) 26 + 736: 6(int) Load 735 + 737: 118(ptr) AccessChain 24(data) 25 736 115 + 738: 17(fvec4) Load 737 + 739: 17(fvec4) GroupNonUniformQuadSwap 35 738 26 + 740: 118(ptr) AccessChain 24(data) 25 734 115 + Store 740 739 + 741: 27(ptr) AccessChain 10(dti) 26 + 742: 6(int) Load 741 + 743: 27(ptr) AccessChain 10(dti) 26 + 744: 6(int) Load 743 + 745: 127(ptr) AccessChain 24(data) 25 744 115 26 + 746: 16(float) Load 745 + 747: 16(float) GroupNonUniformQuadSwap 35 746 26 + 748: 127(ptr) AccessChain 24(data) 25 742 115 26 + Store 748 747 + 749: 27(ptr) AccessChain 10(dti) 26 + 750: 6(int) Load 749 + 751: 27(ptr) AccessChain 10(dti) 26 + 752: 6(int) Load 751 + 753: 118(ptr) AccessChain 24(data) 25 752 115 + 754: 17(fvec4) Load 753 + 755: 136(fvec2) VectorShuffle 754 754 0 1 + 756: 136(fvec2) GroupNonUniformQuadSwap 35 755 26 + 757: 118(ptr) AccessChain 24(data) 25 750 115 + 758: 17(fvec4) Load 757 + 759: 17(fvec4) VectorShuffle 758 756 4 5 2 3 + Store 757 759 + 760: 27(ptr) AccessChain 10(dti) 26 + 761: 6(int) Load 760 + 762: 27(ptr) AccessChain 10(dti) 26 + 763: 6(int) Load 762 + 764: 118(ptr) AccessChain 24(data) 25 763 115 + 765: 17(fvec4) Load 764 + 766: 148(fvec3) VectorShuffle 765 765 0 1 2 + 767: 148(fvec3) GroupNonUniformQuadSwap 35 766 26 + 768: 118(ptr) AccessChain 24(data) 25 761 115 + 769: 17(fvec4) Load 768 + 770: 17(fvec4) VectorShuffle 769 767 4 5 6 3 + Store 768 770 + 771: 27(ptr) AccessChain 10(dti) 26 + 772: 6(int) Load 771 + 773: 27(ptr) AccessChain 10(dti) 26 + 774: 6(int) Load 773 + 775: 161(ptr) AccessChain 24(data) 25 774 158 + 776: 19(fvec4) Load 775 + 777: 19(fvec4) GroupNonUniformQuadSwap 35 776 26 + 778: 161(ptr) AccessChain 24(data) 25 772 158 + Store 778 777 + 779: 27(ptr) AccessChain 10(dti) 26 + 780: 6(int) Load 779 + 781: 27(ptr) AccessChain 10(dti) 26 + 782: 6(int) Load 781 + 783: 170(ptr) AccessChain 24(data) 25 782 158 26 + 784: 18(float) Load 783 + 785: 18(float) GroupNonUniformQuadSwap 35 784 26 + 786: 170(ptr) AccessChain 24(data) 25 780 158 26 + Store 786 785 + 787: 27(ptr) AccessChain 10(dti) 26 + 788: 6(int) Load 787 + 789: 27(ptr) AccessChain 10(dti) 26 + 790: 6(int) Load 789 + 791: 161(ptr) AccessChain 24(data) 25 790 158 + 792: 19(fvec4) Load 791 + 793: 179(fvec2) VectorShuffle 792 792 0 1 + 794: 179(fvec2) GroupNonUniformQuadSwap 35 793 26 + 795: 161(ptr) AccessChain 24(data) 25 788 158 + 796: 19(fvec4) Load 795 + 797: 19(fvec4) VectorShuffle 796 794 4 5 2 3 + Store 795 797 + 798: 27(ptr) AccessChain 10(dti) 26 + 799: 6(int) Load 798 + 800: 27(ptr) AccessChain 10(dti) 26 + 801: 6(int) Load 800 + 802: 161(ptr) AccessChain 24(data) 25 801 158 + 803: 19(fvec4) Load 802 + 804: 191(fvec3) VectorShuffle 803 803 0 1 2 + 805: 191(fvec3) GroupNonUniformQuadSwap 35 804 26 + 806: 161(ptr) AccessChain 24(data) 25 799 158 + 807: 19(fvec4) Load 806 + 808: 19(fvec4) VectorShuffle 807 805 4 5 6 3 + Store 806 808 + 809: 27(ptr) AccessChain 10(dti) 26 + 810: 6(int) Load 809 + 811: 27(ptr) AccessChain 10(dti) 26 + 812: 6(int) Load 811 + 813: 32(ptr) AccessChain 24(data) 25 812 25 + 814: 13(ivec4) Load 813 + 815: 13(ivec4) GroupNonUniformQuadSwap 35 814 205 + 816: 32(ptr) AccessChain 24(data) 25 810 25 + Store 816 815 + 817: 27(ptr) AccessChain 10(dti) 26 + 818: 6(int) Load 817 + 819: 27(ptr) AccessChain 10(dti) 26 + 820: 6(int) Load 819 + 821: 42(ptr) AccessChain 24(data) 25 820 25 26 + 822: 6(int) Load 821 + 823: 6(int) GroupNonUniformQuadSwap 35 822 205 + 824: 42(ptr) AccessChain 24(data) 25 818 25 26 + Store 824 823 + 825: 27(ptr) AccessChain 10(dti) 26 + 826: 6(int) Load 825 + 827: 27(ptr) AccessChain 10(dti) 26 + 828: 6(int) Load 827 + 829: 32(ptr) AccessChain 24(data) 25 828 25 + 830: 13(ivec4) Load 829 + 831: 51(ivec2) VectorShuffle 830 830 0 1 + 832: 51(ivec2) GroupNonUniformQuadSwap 35 831 205 + 833: 32(ptr) AccessChain 24(data) 25 826 25 + 834: 13(ivec4) Load 833 + 835: 13(ivec4) VectorShuffle 834 832 4 5 2 3 + Store 833 835 + 836: 27(ptr) AccessChain 10(dti) 26 + 837: 6(int) Load 836 + 838: 27(ptr) AccessChain 10(dti) 26 + 839: 6(int) Load 838 + 840: 32(ptr) AccessChain 24(data) 25 839 25 + 841: 13(ivec4) Load 840 + 842: 7(ivec3) VectorShuffle 841 841 0 1 2 + 843: 7(ivec3) GroupNonUniformQuadSwap 35 842 205 + 844: 32(ptr) AccessChain 24(data) 25 837 25 + 845: 13(ivec4) Load 844 + 846: 13(ivec4) VectorShuffle 845 843 4 5 6 3 + Store 844 846 + 847: 27(ptr) AccessChain 10(dti) 26 + 848: 6(int) Load 847 + 849: 27(ptr) AccessChain 10(dti) 26 + 850: 6(int) Load 849 + 851: 75(ptr) AccessChain 24(data) 25 850 72 + 852: 15(ivec4) Load 851 + 853: 15(ivec4) GroupNonUniformQuadSwap 35 852 205 + 854: 75(ptr) AccessChain 24(data) 25 848 72 + Store 854 853 + 855: 27(ptr) AccessChain 10(dti) 26 + 856: 6(int) Load 855 + 857: 27(ptr) AccessChain 10(dti) 26 + 858: 6(int) Load 857 + 859: 84(ptr) AccessChain 24(data) 25 858 72 26 + 860: 14(int) Load 859 + 861: 14(int) GroupNonUniformQuadSwap 35 860 205 + 862: 84(ptr) AccessChain 24(data) 25 856 72 26 + Store 862 861 + 863: 27(ptr) AccessChain 10(dti) 26 + 864: 6(int) Load 863 + 865: 27(ptr) AccessChain 10(dti) 26 + 866: 6(int) Load 865 + 867: 75(ptr) AccessChain 24(data) 25 866 72 + 868: 15(ivec4) Load 867 + 869: 93(ivec2) VectorShuffle 868 868 0 1 + 870: 93(ivec2) GroupNonUniformQuadSwap 35 869 205 + 871: 75(ptr) AccessChain 24(data) 25 864 72 + 872: 15(ivec4) Load 871 + 873: 15(ivec4) VectorShuffle 872 870 4 5 2 3 + Store 871 873 + 874: 27(ptr) AccessChain 10(dti) 26 + 875: 6(int) Load 874 + 876: 27(ptr) AccessChain 10(dti) 26 + 877: 6(int) Load 876 + 878: 75(ptr) AccessChain 24(data) 25 877 72 + 879: 15(ivec4) Load 878 + 880: 105(ivec3) VectorShuffle 879 879 0 1 2 + 881: 105(ivec3) GroupNonUniformQuadSwap 35 880 205 + 882: 75(ptr) AccessChain 24(data) 25 875 72 + 883: 15(ivec4) Load 882 + 884: 15(ivec4) VectorShuffle 883 881 4 5 6 3 + Store 882 884 + 885: 27(ptr) AccessChain 10(dti) 26 + 886: 6(int) Load 885 + 887: 27(ptr) AccessChain 10(dti) 26 + 888: 6(int) Load 887 + 889: 118(ptr) AccessChain 24(data) 25 888 115 + 890: 17(fvec4) Load 889 + 891: 17(fvec4) GroupNonUniformQuadSwap 35 890 205 + 892: 118(ptr) AccessChain 24(data) 25 886 115 + Store 892 891 + 893: 27(ptr) AccessChain 10(dti) 26 + 894: 6(int) Load 893 + 895: 27(ptr) AccessChain 10(dti) 26 + 896: 6(int) Load 895 + 897: 127(ptr) AccessChain 24(data) 25 896 115 26 + 898: 16(float) Load 897 + 899: 16(float) GroupNonUniformQuadSwap 35 898 205 + 900: 127(ptr) AccessChain 24(data) 25 894 115 26 + Store 900 899 + 901: 27(ptr) AccessChain 10(dti) 26 + 902: 6(int) Load 901 + 903: 27(ptr) AccessChain 10(dti) 26 + 904: 6(int) Load 903 + 905: 118(ptr) AccessChain 24(data) 25 904 115 + 906: 17(fvec4) Load 905 + 907: 136(fvec2) VectorShuffle 906 906 0 1 + 908: 136(fvec2) GroupNonUniformQuadSwap 35 907 205 + 909: 118(ptr) AccessChain 24(data) 25 902 115 + 910: 17(fvec4) Load 909 + 911: 17(fvec4) VectorShuffle 910 908 4 5 2 3 + Store 909 911 + 912: 27(ptr) AccessChain 10(dti) 26 + 913: 6(int) Load 912 + 914: 27(ptr) AccessChain 10(dti) 26 + 915: 6(int) Load 914 + 916: 118(ptr) AccessChain 24(data) 25 915 115 + 917: 17(fvec4) Load 916 + 918: 148(fvec3) VectorShuffle 917 917 0 1 2 + 919: 148(fvec3) GroupNonUniformQuadSwap 35 918 205 + 920: 118(ptr) AccessChain 24(data) 25 913 115 + 921: 17(fvec4) Load 920 + 922: 17(fvec4) VectorShuffle 921 919 4 5 6 3 + Store 920 922 + 923: 27(ptr) AccessChain 10(dti) 26 + 924: 6(int) Load 923 + 925: 27(ptr) AccessChain 10(dti) 26 + 926: 6(int) Load 925 + 927: 161(ptr) AccessChain 24(data) 25 926 158 + 928: 19(fvec4) Load 927 + 929: 19(fvec4) GroupNonUniformQuadSwap 35 928 205 + 930: 161(ptr) AccessChain 24(data) 25 924 158 + Store 930 929 + 931: 27(ptr) AccessChain 10(dti) 26 + 932: 6(int) Load 931 + 933: 27(ptr) AccessChain 10(dti) 26 + 934: 6(int) Load 933 + 935: 170(ptr) AccessChain 24(data) 25 934 158 26 + 936: 18(float) Load 935 + 937: 18(float) GroupNonUniformQuadSwap 35 936 205 + 938: 170(ptr) AccessChain 24(data) 25 932 158 26 + Store 938 937 + 939: 27(ptr) AccessChain 10(dti) 26 + 940: 6(int) Load 939 + 941: 27(ptr) AccessChain 10(dti) 26 + 942: 6(int) Load 941 + 943: 161(ptr) AccessChain 24(data) 25 942 158 + 944: 19(fvec4) Load 943 + 945: 179(fvec2) VectorShuffle 944 944 0 1 + 946: 179(fvec2) GroupNonUniformQuadSwap 35 945 205 + 947: 161(ptr) AccessChain 24(data) 25 940 158 + 948: 19(fvec4) Load 947 + 949: 19(fvec4) VectorShuffle 948 946 4 5 2 3 + Store 947 949 + 950: 27(ptr) AccessChain 10(dti) 26 + 951: 6(int) Load 950 + 952: 27(ptr) AccessChain 10(dti) 26 + 953: 6(int) Load 952 + 954: 161(ptr) AccessChain 24(data) 25 953 158 + 955: 19(fvec4) Load 954 + 956: 191(fvec3) VectorShuffle 955 955 0 1 2 + 957: 191(fvec3) GroupNonUniformQuadSwap 35 956 205 + 958: 161(ptr) AccessChain 24(data) 25 951 158 + 959: 19(fvec4) Load 958 + 960: 19(fvec4) VectorShuffle 959 957 4 5 6 3 + Store 958 960 + 961: 27(ptr) AccessChain 10(dti) 26 + 962: 6(int) Load 961 + 963: 27(ptr) AccessChain 10(dti) 26 + 964: 6(int) Load 963 + 965: 32(ptr) AccessChain 24(data) 25 964 25 + 966: 13(ivec4) Load 965 + 967: 13(ivec4) GroupNonUniformQuadSwap 35 966 358 + 968: 32(ptr) AccessChain 24(data) 25 962 25 + Store 968 967 + 969: 27(ptr) AccessChain 10(dti) 26 + 970: 6(int) Load 969 + 971: 27(ptr) AccessChain 10(dti) 26 + 972: 6(int) Load 971 + 973: 42(ptr) AccessChain 24(data) 25 972 25 26 + 974: 6(int) Load 973 + 975: 6(int) GroupNonUniformQuadSwap 35 974 358 + 976: 42(ptr) AccessChain 24(data) 25 970 25 26 + Store 976 975 + 977: 27(ptr) AccessChain 10(dti) 26 + 978: 6(int) Load 977 + 979: 27(ptr) AccessChain 10(dti) 26 + 980: 6(int) Load 979 + 981: 32(ptr) AccessChain 24(data) 25 980 25 + 982: 13(ivec4) Load 981 + 983: 51(ivec2) VectorShuffle 982 982 0 1 + 984: 51(ivec2) GroupNonUniformQuadSwap 35 983 358 + 985: 32(ptr) AccessChain 24(data) 25 978 25 + 986: 13(ivec4) Load 985 + 987: 13(ivec4) VectorShuffle 986 984 4 5 2 3 + Store 985 987 + 988: 27(ptr) AccessChain 10(dti) 26 + 989: 6(int) Load 988 + 990: 27(ptr) AccessChain 10(dti) 26 + 991: 6(int) Load 990 + 992: 32(ptr) AccessChain 24(data) 25 991 25 + 993: 13(ivec4) Load 992 + 994: 7(ivec3) VectorShuffle 993 993 0 1 2 + 995: 7(ivec3) GroupNonUniformQuadSwap 35 994 358 + 996: 32(ptr) AccessChain 24(data) 25 989 25 + 997: 13(ivec4) Load 996 + 998: 13(ivec4) VectorShuffle 997 995 4 5 6 3 + Store 996 998 + 999: 27(ptr) AccessChain 10(dti) 26 + 1000: 6(int) Load 999 + 1001: 27(ptr) AccessChain 10(dti) 26 + 1002: 6(int) Load 1001 + 1003: 75(ptr) AccessChain 24(data) 25 1002 72 + 1004: 15(ivec4) Load 1003 + 1005: 15(ivec4) GroupNonUniformQuadSwap 35 1004 358 + 1006: 75(ptr) AccessChain 24(data) 25 1000 72 + Store 1006 1005 + 1007: 27(ptr) AccessChain 10(dti) 26 + 1008: 6(int) Load 1007 + 1009: 27(ptr) AccessChain 10(dti) 26 + 1010: 6(int) Load 1009 + 1011: 84(ptr) AccessChain 24(data) 25 1010 72 26 + 1012: 14(int) Load 1011 + 1013: 14(int) GroupNonUniformQuadSwap 35 1012 358 + 1014: 84(ptr) AccessChain 24(data) 25 1008 72 26 + Store 1014 1013 + 1015: 27(ptr) AccessChain 10(dti) 26 + 1016: 6(int) Load 1015 + 1017: 27(ptr) AccessChain 10(dti) 26 + 1018: 6(int) Load 1017 + 1019: 75(ptr) AccessChain 24(data) 25 1018 72 + 1020: 15(ivec4) Load 1019 + 1021: 93(ivec2) VectorShuffle 1020 1020 0 1 + 1022: 93(ivec2) GroupNonUniformQuadSwap 35 1021 358 + 1023: 75(ptr) AccessChain 24(data) 25 1016 72 + 1024: 15(ivec4) Load 1023 + 1025: 15(ivec4) VectorShuffle 1024 1022 4 5 2 3 + Store 1023 1025 + 1026: 27(ptr) AccessChain 10(dti) 26 + 1027: 6(int) Load 1026 + 1028: 27(ptr) AccessChain 10(dti) 26 + 1029: 6(int) Load 1028 + 1030: 75(ptr) AccessChain 24(data) 25 1029 72 + 1031: 15(ivec4) Load 1030 + 1032: 105(ivec3) VectorShuffle 1031 1031 0 1 2 + 1033: 105(ivec3) GroupNonUniformQuadSwap 35 1032 358 + 1034: 75(ptr) AccessChain 24(data) 25 1027 72 + 1035: 15(ivec4) Load 1034 + 1036: 15(ivec4) VectorShuffle 1035 1033 4 5 6 3 + Store 1034 1036 + 1037: 27(ptr) AccessChain 10(dti) 26 + 1038: 6(int) Load 1037 + 1039: 27(ptr) AccessChain 10(dti) 26 + 1040: 6(int) Load 1039 + 1041: 118(ptr) AccessChain 24(data) 25 1040 115 + 1042: 17(fvec4) Load 1041 + 1043: 17(fvec4) GroupNonUniformQuadSwap 35 1042 358 + 1044: 118(ptr) AccessChain 24(data) 25 1038 115 + Store 1044 1043 + 1045: 27(ptr) AccessChain 10(dti) 26 + 1046: 6(int) Load 1045 + 1047: 27(ptr) AccessChain 10(dti) 26 + 1048: 6(int) Load 1047 + 1049: 127(ptr) AccessChain 24(data) 25 1048 115 26 + 1050: 16(float) Load 1049 + 1051: 16(float) GroupNonUniformQuadSwap 35 1050 358 + 1052: 127(ptr) AccessChain 24(data) 25 1046 115 26 + Store 1052 1051 + 1053: 27(ptr) AccessChain 10(dti) 26 + 1054: 6(int) Load 1053 + 1055: 27(ptr) AccessChain 10(dti) 26 + 1056: 6(int) Load 1055 + 1057: 118(ptr) AccessChain 24(data) 25 1056 115 + 1058: 17(fvec4) Load 1057 + 1059: 136(fvec2) VectorShuffle 1058 1058 0 1 + 1060: 136(fvec2) GroupNonUniformQuadSwap 35 1059 358 + 1061: 118(ptr) AccessChain 24(data) 25 1054 115 + 1062: 17(fvec4) Load 1061 + 1063: 17(fvec4) VectorShuffle 1062 1060 4 5 2 3 + Store 1061 1063 + 1064: 27(ptr) AccessChain 10(dti) 26 + 1065: 6(int) Load 1064 + 1066: 27(ptr) AccessChain 10(dti) 26 + 1067: 6(int) Load 1066 + 1068: 118(ptr) AccessChain 24(data) 25 1067 115 + 1069: 17(fvec4) Load 1068 + 1070: 148(fvec3) VectorShuffle 1069 1069 0 1 2 + 1071: 148(fvec3) GroupNonUniformQuadSwap 35 1070 358 + 1072: 118(ptr) AccessChain 24(data) 25 1065 115 + 1073: 17(fvec4) Load 1072 + 1074: 17(fvec4) VectorShuffle 1073 1071 4 5 6 3 + Store 1072 1074 + 1075: 27(ptr) AccessChain 10(dti) 26 + 1076: 6(int) Load 1075 + 1077: 27(ptr) AccessChain 10(dti) 26 + 1078: 6(int) Load 1077 + 1079: 161(ptr) AccessChain 24(data) 25 1078 158 + 1080: 19(fvec4) Load 1079 + 1081: 19(fvec4) GroupNonUniformQuadSwap 35 1080 358 + 1082: 161(ptr) AccessChain 24(data) 25 1076 158 + Store 1082 1081 + 1083: 27(ptr) AccessChain 10(dti) 26 + 1084: 6(int) Load 1083 + 1085: 27(ptr) AccessChain 10(dti) 26 + 1086: 6(int) Load 1085 + 1087: 170(ptr) AccessChain 24(data) 25 1086 158 26 + 1088: 18(float) Load 1087 + 1089: 18(float) GroupNonUniformQuadSwap 35 1088 358 + 1090: 170(ptr) AccessChain 24(data) 25 1084 158 26 + Store 1090 1089 + 1091: 27(ptr) AccessChain 10(dti) 26 + 1092: 6(int) Load 1091 + 1093: 27(ptr) AccessChain 10(dti) 26 + 1094: 6(int) Load 1093 + 1095: 161(ptr) AccessChain 24(data) 25 1094 158 + 1096: 19(fvec4) Load 1095 + 1097: 179(fvec2) VectorShuffle 1096 1096 0 1 + 1098: 179(fvec2) GroupNonUniformQuadSwap 35 1097 358 + 1099: 161(ptr) AccessChain 24(data) 25 1092 158 + 1100: 19(fvec4) Load 1099 + 1101: 19(fvec4) VectorShuffle 1100 1098 4 5 2 3 + Store 1099 1101 + 1102: 27(ptr) AccessChain 10(dti) 26 + 1103: 6(int) Load 1102 + 1104: 27(ptr) AccessChain 10(dti) 26 + 1105: 6(int) Load 1104 + 1106: 161(ptr) AccessChain 24(data) 25 1105 158 + 1107: 19(fvec4) Load 1106 + 1108: 191(fvec3) VectorShuffle 1107 1107 0 1 2 + 1109: 191(fvec3) GroupNonUniformQuadSwap 35 1108 358 + 1110: 161(ptr) AccessChain 24(data) 25 1103 158 + 1111: 19(fvec4) Load 1110 + 1112: 19(fvec4) VectorShuffle 1111 1109 4 5 6 3 + Store 1110 1112 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.wavequery.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.wavequery.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.wavequery.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.wavequery.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,116 @@ +hlsl.wavequery.comp +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:5 Function Definition: @CSMain( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:6 move second child to first child ( temp uint) +0:6 indirect index (layout( row_major std430) buffer uint) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:6 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:6 Constant: +0:6 0 (const uint) +0:6 '@gl_SubgroupInvocationID' ( in uint unknown built-in variable) +0:6 Test condition and select ( temp uint): no shortcircuit +0:6 Condition +0:6 subgroupElect ( temp bool) +0:6 true case +0:6 '@gl_SubgroupSize' ( in uint unknown built-in variable) +0:6 false case +0:6 Constant: +0:6 0 (const uint) +0:5 Function Definition: CSMain( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 Function Call: @CSMain( ( temp void) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) + + +Linked compute stage: + + +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:5 Function Definition: @CSMain( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:6 move second child to first child ( temp uint) +0:6 indirect index (layout( row_major std430) buffer uint) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:6 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:6 Constant: +0:6 0 (const uint) +0:6 '@gl_SubgroupInvocationID' ( in uint unknown built-in variable) +0:6 Test condition and select ( temp uint): no shortcircuit +0:6 Condition +0:6 subgroupElect ( temp bool) +0:6 true case +0:6 '@gl_SubgroupSize' ( in uint unknown built-in variable) +0:6 false case +0:6 Constant: +0:6 0 (const uint) +0:5 Function Definition: CSMain( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 Function Call: @CSMain( ( temp void) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) + +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 28 + + Capability Shader + Capability GroupNonUniform + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "CSMain" 16 21 + ExecutionMode 4 LocalSize 32 16 1 + Source HLSL 500 + Name 4 "CSMain" + Name 6 "@CSMain(" + Name 10 "data" + MemberName 10(data) 0 "@data" + Name 12 "data" + Name 16 "@gl_SubgroupInvocationID" + Name 21 "@gl_SubgroupSize" + Decorate 9 ArrayStride 4 + MemberDecorate 10(data) 0 Offset 0 + Decorate 10(data) BufferBlock + Decorate 12(data) DescriptorSet 0 + Decorate 16(@gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 21(@gl_SubgroupSize) BuiltIn SubgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 8: TypeInt 32 0 + 9: TypeRuntimeArray 8(int) + 10(data): TypeStruct 9 + 11: TypePointer Uniform 10(data) + 12(data): 11(ptr) Variable Uniform + 13: TypeInt 32 1 + 14: 13(int) Constant 0 + 15: TypePointer Input 8(int) +16(@gl_SubgroupInvocationID): 15(ptr) Variable Input + 18: TypeBool + 19: 8(int) Constant 3 +21(@gl_SubgroupSize): 15(ptr) Variable Input + 23: 8(int) Constant 0 + 25: TypePointer Uniform 8(int) + 4(CSMain): 2 Function None 3 + 5: Label + 27: 2 FunctionCall 6(@CSMain() + Return + FunctionEnd + 6(@CSMain(): 2 Function None 3 + 7: Label + 17: 8(int) Load 16(@gl_SubgroupInvocationID) + 20: 18(bool) GroupNonUniformElect 19 + 22: 8(int) Load 21(@gl_SubgroupSize) + 24: 8(int) Select 20 22 23 + 26: 25(ptr) AccessChain 12(data) 14 17 + Store 26 24 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.wavequery.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.wavequery.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.wavequery.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.wavequery.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,123 @@ +hlsl.wavequery.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction( ( temp 4-component vector of float) +0:2 Function Parameters: +0:? Sequence +0:3 Test condition and select ( temp void) +0:3 Condition +0:3 subgroupElect ( temp bool) +0:3 true case +0:? Sequence +0:5 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:3 false case +0:? Sequence +0:9 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 3.000000 +0:? 2.000000 +0:? 1.000000 +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction( ( temp 4-component vector of float) +0:2 Function Parameters: +0:? Sequence +0:3 Test condition and select ( temp void) +0:3 Condition +0:3 subgroupElect ( temp bool) +0:3 true case +0:? Sequence +0:5 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:3 false case +0:? Sequence +0:9 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 3.000000 +0:? 2.000000 +0:? 1.000000 +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 30 + + Capability Shader + Capability GroupNonUniform + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 28 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 9 "@PixelShaderFunction(" + Name 28 "@entryPointOutput" + Decorate 28(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeBool + 12: TypeInt 32 0 + 13: 12(int) Constant 3 + 17: 6(float) Constant 1065353216 + 18: 6(float) Constant 1073741824 + 19: 6(float) Constant 1077936128 + 20: 6(float) Constant 1082130432 + 21: 7(fvec4) ConstantComposite 17 18 19 20 + 24: 7(fvec4) ConstantComposite 20 19 18 17 + 27: TypePointer Output 7(fvec4) +28(@entryPointOutput): 27(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 29: 7(fvec4) FunctionCall 9(@PixelShaderFunction() + Store 28(@entryPointOutput) 29 + Return + FunctionEnd +9(@PixelShaderFunction(): 7(fvec4) Function None 8 + 10: Label + 14: 11(bool) GroupNonUniformElect 13 + SelectionMerge 16 None + BranchConditional 14 15 23 + 15: Label + ReturnValue 21 + 23: Label + ReturnValue 24 + 16: Label + 26: 7(fvec4) Undef + ReturnValue 26 + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.wavereduction.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.wavereduction.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.wavereduction.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.wavereduction.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,7218 @@ +hlsl.wavereduction.comp +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:13 Function Definition: @CSMain(vu3; ( temp void) +0:13 Function Parameters: +0:13 'dti' ( in 3-component vector of uint) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 subgroupAdd ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:15 move second child to first child ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 subgroupAdd ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:16 move second child to first child ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 subgroupAdd ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:17 move second child to first child ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 subgroupAdd ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:19 move second child to first child ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 subgroupAdd ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 subgroupAdd ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:21 move second child to first child ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 subgroupAdd ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:22 move second child to first child ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 subgroupAdd ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 subgroupAdd ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 subgroupAdd ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:26 move second child to first child ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 subgroupAdd ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:27 move second child to first child ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 subgroupAdd ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:29 move second child to first child ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 subgroupAdd ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:30 move second child to first child ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 subgroupAdd ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:31 move second child to first child ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 subgroupAdd ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:32 move second child to first child ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 subgroupAdd ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:34 move second child to first child ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 subgroupMul ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:35 move second child to first child ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 subgroupMul ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:36 move second child to first child ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 subgroupMul ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:37 move second child to first child ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 subgroupMul ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:39 move second child to first child ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 subgroupMul ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:40 move second child to first child ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 subgroupMul ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:41 move second child to first child ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 subgroupMul ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:42 move second child to first child ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 subgroupMul ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:44 move second child to first child ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 subgroupMul ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 subgroupMul ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:46 move second child to first child ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 subgroupMul ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 subgroupMul ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:49 move second child to first child ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 subgroupMul ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:50 move second child to first child ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 subgroupMul ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:51 move second child to first child ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 subgroupMul ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:52 move second child to first child ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 subgroupMul ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:54 move second child to first child ( temp 4-component vector of uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 subgroupMin ( temp 4-component vector of uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:55 move second child to first child ( temp uint) +0:55 direct index ( temp uint) +0:55 u: direct index for structure ( temp 4-component vector of uint) +0:55 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:55 Constant: +0:55 0 (const uint) +0:55 direct index ( temp uint) +0:55 'dti' ( in 3-component vector of uint) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 subgroupMin ( temp uint) +0:55 direct index ( temp uint) +0:55 u: direct index for structure ( temp 4-component vector of uint) +0:55 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:55 Constant: +0:55 0 (const uint) +0:55 direct index ( temp uint) +0:55 'dti' ( in 3-component vector of uint) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:56 move second child to first child ( temp 2-component vector of uint) +0:56 vector swizzle ( temp 2-component vector of uint) +0:56 u: direct index for structure ( temp 4-component vector of uint) +0:56 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:56 Constant: +0:56 0 (const uint) +0:56 direct index ( temp uint) +0:56 'dti' ( in 3-component vector of uint) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 0 (const int) +0:56 Sequence +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1 (const int) +0:56 subgroupMin ( temp 2-component vector of uint) +0:56 vector swizzle ( temp 2-component vector of uint) +0:56 u: direct index for structure ( temp 4-component vector of uint) +0:56 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:56 Constant: +0:56 0 (const uint) +0:56 direct index ( temp uint) +0:56 'dti' ( in 3-component vector of uint) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 0 (const int) +0:56 Sequence +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1 (const int) +0:57 move second child to first child ( temp 3-component vector of uint) +0:57 vector swizzle ( temp 3-component vector of uint) +0:57 u: direct index for structure ( temp 4-component vector of uint) +0:57 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:57 Constant: +0:57 0 (const uint) +0:57 direct index ( temp uint) +0:57 'dti' ( in 3-component vector of uint) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 0 (const int) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:57 subgroupMin ( temp 3-component vector of uint) +0:57 vector swizzle ( temp 3-component vector of uint) +0:57 u: direct index for structure ( temp 4-component vector of uint) +0:57 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:57 Constant: +0:57 0 (const uint) +0:57 direct index ( temp uint) +0:57 'dti' ( in 3-component vector of uint) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 0 (const int) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:59 move second child to first child ( temp 4-component vector of int) +0:59 i: direct index for structure ( temp 4-component vector of int) +0:59 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:59 Constant: +0:59 0 (const uint) +0:59 direct index ( temp uint) +0:59 'dti' ( in 3-component vector of uint) +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 subgroupMin ( temp 4-component vector of int) +0:59 i: direct index for structure ( temp 4-component vector of int) +0:59 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:59 Constant: +0:59 0 (const uint) +0:59 direct index ( temp uint) +0:59 'dti' ( in 3-component vector of uint) +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:60 move second child to first child ( temp int) +0:60 direct index ( temp int) +0:60 i: direct index for structure ( temp 4-component vector of int) +0:60 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:60 Constant: +0:60 0 (const uint) +0:60 direct index ( temp uint) +0:60 'dti' ( in 3-component vector of uint) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 1 (const int) +0:60 Constant: +0:60 0 (const int) +0:60 subgroupMin ( temp int) +0:60 direct index ( temp int) +0:60 i: direct index for structure ( temp 4-component vector of int) +0:60 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:60 Constant: +0:60 0 (const uint) +0:60 direct index ( temp uint) +0:60 'dti' ( in 3-component vector of uint) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 1 (const int) +0:60 Constant: +0:60 0 (const int) +0:61 move second child to first child ( temp 2-component vector of int) +0:61 vector swizzle ( temp 2-component vector of int) +0:61 i: direct index for structure ( temp 4-component vector of int) +0:61 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:61 Constant: +0:61 0 (const uint) +0:61 direct index ( temp uint) +0:61 'dti' ( in 3-component vector of uint) +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Sequence +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 subgroupMin ( temp 2-component vector of int) +0:61 vector swizzle ( temp 2-component vector of int) +0:61 i: direct index for structure ( temp 4-component vector of int) +0:61 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:61 Constant: +0:61 0 (const uint) +0:61 direct index ( temp uint) +0:61 'dti' ( in 3-component vector of uint) +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Sequence +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:62 move second child to first child ( temp 3-component vector of int) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 i: direct index for structure ( temp 4-component vector of int) +0:62 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:62 Constant: +0:62 0 (const uint) +0:62 direct index ( temp uint) +0:62 'dti' ( in 3-component vector of uint) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:62 subgroupMin ( temp 3-component vector of int) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 i: direct index for structure ( temp 4-component vector of int) +0:62 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:62 Constant: +0:62 0 (const uint) +0:62 direct index ( temp uint) +0:62 'dti' ( in 3-component vector of uint) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:64 move second child to first child ( temp 4-component vector of float) +0:64 f: direct index for structure ( temp 4-component vector of float) +0:64 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:64 Constant: +0:64 0 (const uint) +0:64 direct index ( temp uint) +0:64 'dti' ( in 3-component vector of uint) +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 2 (const int) +0:64 subgroupMin ( temp 4-component vector of float) +0:64 f: direct index for structure ( temp 4-component vector of float) +0:64 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:64 Constant: +0:64 0 (const uint) +0:64 direct index ( temp uint) +0:64 'dti' ( in 3-component vector of uint) +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 2 (const int) +0:65 move second child to first child ( temp float) +0:65 direct index ( temp float) +0:65 f: direct index for structure ( temp 4-component vector of float) +0:65 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:65 Constant: +0:65 0 (const uint) +0:65 direct index ( temp uint) +0:65 'dti' ( in 3-component vector of uint) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 Constant: +0:65 0 (const int) +0:65 subgroupMin ( temp float) +0:65 direct index ( temp float) +0:65 f: direct index for structure ( temp 4-component vector of float) +0:65 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:65 Constant: +0:65 0 (const uint) +0:65 direct index ( temp uint) +0:65 'dti' ( in 3-component vector of uint) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 Constant: +0:65 0 (const int) +0:66 move second child to first child ( temp 2-component vector of float) +0:66 vector swizzle ( temp 2-component vector of float) +0:66 f: direct index for structure ( temp 4-component vector of float) +0:66 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:66 Constant: +0:66 0 (const uint) +0:66 direct index ( temp uint) +0:66 'dti' ( in 3-component vector of uint) +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 2 (const int) +0:66 Sequence +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 1 (const int) +0:66 subgroupMin ( temp 2-component vector of float) +0:66 vector swizzle ( temp 2-component vector of float) +0:66 f: direct index for structure ( temp 4-component vector of float) +0:66 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:66 Constant: +0:66 0 (const uint) +0:66 direct index ( temp uint) +0:66 'dti' ( in 3-component vector of uint) +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 2 (const int) +0:66 Sequence +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 1 (const int) +0:67 move second child to first child ( temp 3-component vector of float) +0:67 vector swizzle ( temp 3-component vector of float) +0:67 f: direct index for structure ( temp 4-component vector of float) +0:67 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:67 Constant: +0:67 0 (const uint) +0:67 direct index ( temp uint) +0:67 'dti' ( in 3-component vector of uint) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Sequence +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 subgroupMin ( temp 3-component vector of float) +0:67 vector swizzle ( temp 3-component vector of float) +0:67 f: direct index for structure ( temp 4-component vector of float) +0:67 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:67 Constant: +0:67 0 (const uint) +0:67 direct index ( temp uint) +0:67 'dti' ( in 3-component vector of uint) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Sequence +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1 (const int) +0:67 Constant: +0:67 2 (const int) +0:69 move second child to first child ( temp 4-component vector of double) +0:69 d: direct index for structure ( temp 4-component vector of double) +0:69 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:69 Constant: +0:69 0 (const uint) +0:69 direct index ( temp uint) +0:69 'dti' ( in 3-component vector of uint) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 3 (const int) +0:69 subgroupMin ( temp 4-component vector of double) +0:69 d: direct index for structure ( temp 4-component vector of double) +0:69 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:69 Constant: +0:69 0 (const uint) +0:69 direct index ( temp uint) +0:69 'dti' ( in 3-component vector of uint) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 3 (const int) +0:70 move second child to first child ( temp double) +0:70 direct index ( temp double) +0:70 d: direct index for structure ( temp 4-component vector of double) +0:70 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:70 Constant: +0:70 0 (const uint) +0:70 direct index ( temp uint) +0:70 'dti' ( in 3-component vector of uint) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 3 (const int) +0:70 Constant: +0:70 0 (const int) +0:70 subgroupMin ( temp double) +0:70 direct index ( temp double) +0:70 d: direct index for structure ( temp 4-component vector of double) +0:70 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:70 Constant: +0:70 0 (const uint) +0:70 direct index ( temp uint) +0:70 'dti' ( in 3-component vector of uint) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 3 (const int) +0:70 Constant: +0:70 0 (const int) +0:71 move second child to first child ( temp 2-component vector of double) +0:71 vector swizzle ( temp 2-component vector of double) +0:71 d: direct index for structure ( temp 4-component vector of double) +0:71 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:71 Constant: +0:71 0 (const uint) +0:71 direct index ( temp uint) +0:71 'dti' ( in 3-component vector of uint) +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 3 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:71 subgroupMin ( temp 2-component vector of double) +0:71 vector swizzle ( temp 2-component vector of double) +0:71 d: direct index for structure ( temp 4-component vector of double) +0:71 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:71 Constant: +0:71 0 (const uint) +0:71 direct index ( temp uint) +0:71 'dti' ( in 3-component vector of uint) +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 3 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:72 move second child to first child ( temp 3-component vector of double) +0:72 vector swizzle ( temp 3-component vector of double) +0:72 d: direct index for structure ( temp 4-component vector of double) +0:72 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:72 Constant: +0:72 0 (const uint) +0:72 direct index ( temp uint) +0:72 'dti' ( in 3-component vector of uint) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 3 (const int) +0:72 Sequence +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 2 (const int) +0:72 subgroupMin ( temp 3-component vector of double) +0:72 vector swizzle ( temp 3-component vector of double) +0:72 d: direct index for structure ( temp 4-component vector of double) +0:72 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:72 Constant: +0:72 0 (const uint) +0:72 direct index ( temp uint) +0:72 'dti' ( in 3-component vector of uint) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 3 (const int) +0:72 Sequence +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 2 (const int) +0:74 move second child to first child ( temp 4-component vector of uint) +0:74 u: direct index for structure ( temp 4-component vector of uint) +0:74 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:74 Constant: +0:74 0 (const uint) +0:74 direct index ( temp uint) +0:74 'dti' ( in 3-component vector of uint) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 0 (const int) +0:74 subgroupMax ( temp 4-component vector of uint) +0:74 u: direct index for structure ( temp 4-component vector of uint) +0:74 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:74 Constant: +0:74 0 (const uint) +0:74 direct index ( temp uint) +0:74 'dti' ( in 3-component vector of uint) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 0 (const int) +0:75 move second child to first child ( temp uint) +0:75 direct index ( temp uint) +0:75 u: direct index for structure ( temp 4-component vector of uint) +0:75 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:75 Constant: +0:75 0 (const uint) +0:75 direct index ( temp uint) +0:75 'dti' ( in 3-component vector of uint) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 subgroupMax ( temp uint) +0:75 direct index ( temp uint) +0:75 u: direct index for structure ( temp 4-component vector of uint) +0:75 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:75 Constant: +0:75 0 (const uint) +0:75 direct index ( temp uint) +0:75 'dti' ( in 3-component vector of uint) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:76 move second child to first child ( temp 2-component vector of uint) +0:76 vector swizzle ( temp 2-component vector of uint) +0:76 u: direct index for structure ( temp 4-component vector of uint) +0:76 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:76 Constant: +0:76 0 (const uint) +0:76 direct index ( temp uint) +0:76 'dti' ( in 3-component vector of uint) +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 0 (const int) +0:76 Sequence +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 1 (const int) +0:76 subgroupMax ( temp 2-component vector of uint) +0:76 vector swizzle ( temp 2-component vector of uint) +0:76 u: direct index for structure ( temp 4-component vector of uint) +0:76 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:76 Constant: +0:76 0 (const uint) +0:76 direct index ( temp uint) +0:76 'dti' ( in 3-component vector of uint) +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 0 (const int) +0:76 Sequence +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 1 (const int) +0:77 move second child to first child ( temp 3-component vector of uint) +0:77 vector swizzle ( temp 3-component vector of uint) +0:77 u: direct index for structure ( temp 4-component vector of uint) +0:77 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:77 Constant: +0:77 0 (const uint) +0:77 direct index ( temp uint) +0:77 'dti' ( in 3-component vector of uint) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 0 (const int) +0:77 Sequence +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 1 (const int) +0:77 Constant: +0:77 2 (const int) +0:77 subgroupMax ( temp 3-component vector of uint) +0:77 vector swizzle ( temp 3-component vector of uint) +0:77 u: direct index for structure ( temp 4-component vector of uint) +0:77 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:77 Constant: +0:77 0 (const uint) +0:77 direct index ( temp uint) +0:77 'dti' ( in 3-component vector of uint) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 0 (const int) +0:77 Sequence +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 1 (const int) +0:77 Constant: +0:77 2 (const int) +0:79 move second child to first child ( temp 4-component vector of int) +0:79 i: direct index for structure ( temp 4-component vector of int) +0:79 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:79 Constant: +0:79 0 (const uint) +0:79 direct index ( temp uint) +0:79 'dti' ( in 3-component vector of uint) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:79 subgroupMax ( temp 4-component vector of int) +0:79 i: direct index for structure ( temp 4-component vector of int) +0:79 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:79 Constant: +0:79 0 (const uint) +0:79 direct index ( temp uint) +0:79 'dti' ( in 3-component vector of uint) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:80 move second child to first child ( temp int) +0:80 direct index ( temp int) +0:80 i: direct index for structure ( temp 4-component vector of int) +0:80 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:80 Constant: +0:80 0 (const uint) +0:80 direct index ( temp uint) +0:80 'dti' ( in 3-component vector of uint) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 1 (const int) +0:80 Constant: +0:80 0 (const int) +0:80 subgroupMax ( temp int) +0:80 direct index ( temp int) +0:80 i: direct index for structure ( temp 4-component vector of int) +0:80 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:80 Constant: +0:80 0 (const uint) +0:80 direct index ( temp uint) +0:80 'dti' ( in 3-component vector of uint) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 1 (const int) +0:80 Constant: +0:80 0 (const int) +0:81 move second child to first child ( temp 2-component vector of int) +0:81 vector swizzle ( temp 2-component vector of int) +0:81 i: direct index for structure ( temp 4-component vector of int) +0:81 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:81 Constant: +0:81 0 (const uint) +0:81 direct index ( temp uint) +0:81 'dti' ( in 3-component vector of uint) +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Sequence +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 subgroupMax ( temp 2-component vector of int) +0:81 vector swizzle ( temp 2-component vector of int) +0:81 i: direct index for structure ( temp 4-component vector of int) +0:81 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:81 Constant: +0:81 0 (const uint) +0:81 direct index ( temp uint) +0:81 'dti' ( in 3-component vector of uint) +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Sequence +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:82 move second child to first child ( temp 3-component vector of int) +0:82 vector swizzle ( temp 3-component vector of int) +0:82 i: direct index for structure ( temp 4-component vector of int) +0:82 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:82 Constant: +0:82 0 (const uint) +0:82 direct index ( temp uint) +0:82 'dti' ( in 3-component vector of uint) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Sequence +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Constant: +0:82 2 (const int) +0:82 subgroupMax ( temp 3-component vector of int) +0:82 vector swizzle ( temp 3-component vector of int) +0:82 i: direct index for structure ( temp 4-component vector of int) +0:82 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:82 Constant: +0:82 0 (const uint) +0:82 direct index ( temp uint) +0:82 'dti' ( in 3-component vector of uint) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Sequence +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Constant: +0:82 2 (const int) +0:84 move second child to first child ( temp 4-component vector of float) +0:84 f: direct index for structure ( temp 4-component vector of float) +0:84 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:84 Constant: +0:84 0 (const uint) +0:84 direct index ( temp uint) +0:84 'dti' ( in 3-component vector of uint) +0:84 Constant: +0:84 0 (const int) +0:84 Constant: +0:84 2 (const int) +0:84 subgroupMax ( temp 4-component vector of float) +0:84 f: direct index for structure ( temp 4-component vector of float) +0:84 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:84 Constant: +0:84 0 (const uint) +0:84 direct index ( temp uint) +0:84 'dti' ( in 3-component vector of uint) +0:84 Constant: +0:84 0 (const int) +0:84 Constant: +0:84 2 (const int) +0:85 move second child to first child ( temp float) +0:85 direct index ( temp float) +0:85 f: direct index for structure ( temp 4-component vector of float) +0:85 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:85 Constant: +0:85 0 (const uint) +0:85 direct index ( temp uint) +0:85 'dti' ( in 3-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 2 (const int) +0:85 Constant: +0:85 0 (const int) +0:85 subgroupMax ( temp float) +0:85 direct index ( temp float) +0:85 f: direct index for structure ( temp 4-component vector of float) +0:85 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:85 Constant: +0:85 0 (const uint) +0:85 direct index ( temp uint) +0:85 'dti' ( in 3-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 2 (const int) +0:85 Constant: +0:85 0 (const int) +0:86 move second child to first child ( temp 2-component vector of float) +0:86 vector swizzle ( temp 2-component vector of float) +0:86 f: direct index for structure ( temp 4-component vector of float) +0:86 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:86 Constant: +0:86 0 (const uint) +0:86 direct index ( temp uint) +0:86 'dti' ( in 3-component vector of uint) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 2 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:86 subgroupMax ( temp 2-component vector of float) +0:86 vector swizzle ( temp 2-component vector of float) +0:86 f: direct index for structure ( temp 4-component vector of float) +0:86 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:86 Constant: +0:86 0 (const uint) +0:86 direct index ( temp uint) +0:86 'dti' ( in 3-component vector of uint) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 2 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:87 move second child to first child ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 f: direct index for structure ( temp 4-component vector of float) +0:87 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:87 Constant: +0:87 0 (const uint) +0:87 direct index ( temp uint) +0:87 'dti' ( in 3-component vector of uint) +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 subgroupMax ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 f: direct index for structure ( temp 4-component vector of float) +0:87 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:87 Constant: +0:87 0 (const uint) +0:87 direct index ( temp uint) +0:87 'dti' ( in 3-component vector of uint) +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:89 move second child to first child ( temp 4-component vector of double) +0:89 d: direct index for structure ( temp 4-component vector of double) +0:89 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:89 Constant: +0:89 0 (const uint) +0:89 direct index ( temp uint) +0:89 'dti' ( in 3-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 Constant: +0:89 3 (const int) +0:89 subgroupMax ( temp 4-component vector of double) +0:89 d: direct index for structure ( temp 4-component vector of double) +0:89 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:89 Constant: +0:89 0 (const uint) +0:89 direct index ( temp uint) +0:89 'dti' ( in 3-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 Constant: +0:89 3 (const int) +0:90 move second child to first child ( temp double) +0:90 direct index ( temp double) +0:90 d: direct index for structure ( temp 4-component vector of double) +0:90 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:90 Constant: +0:90 0 (const uint) +0:90 direct index ( temp uint) +0:90 'dti' ( in 3-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const int) +0:90 Constant: +0:90 0 (const int) +0:90 subgroupMax ( temp double) +0:90 direct index ( temp double) +0:90 d: direct index for structure ( temp 4-component vector of double) +0:90 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:90 Constant: +0:90 0 (const uint) +0:90 direct index ( temp uint) +0:90 'dti' ( in 3-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const int) +0:90 Constant: +0:90 0 (const int) +0:91 move second child to first child ( temp 2-component vector of double) +0:91 vector swizzle ( temp 2-component vector of double) +0:91 d: direct index for structure ( temp 4-component vector of double) +0:91 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:91 Constant: +0:91 0 (const uint) +0:91 direct index ( temp uint) +0:91 'dti' ( in 3-component vector of uint) +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 3 (const int) +0:91 Sequence +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 1 (const int) +0:91 subgroupMax ( temp 2-component vector of double) +0:91 vector swizzle ( temp 2-component vector of double) +0:91 d: direct index for structure ( temp 4-component vector of double) +0:91 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:91 Constant: +0:91 0 (const uint) +0:91 direct index ( temp uint) +0:91 'dti' ( in 3-component vector of uint) +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 3 (const int) +0:91 Sequence +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 1 (const int) +0:92 move second child to first child ( temp 3-component vector of double) +0:92 vector swizzle ( temp 3-component vector of double) +0:92 d: direct index for structure ( temp 4-component vector of double) +0:92 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:92 Constant: +0:92 0 (const uint) +0:92 direct index ( temp uint) +0:92 'dti' ( in 3-component vector of uint) +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 3 (const int) +0:92 Sequence +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 1 (const int) +0:92 Constant: +0:92 2 (const int) +0:92 subgroupMax ( temp 3-component vector of double) +0:92 vector swizzle ( temp 3-component vector of double) +0:92 d: direct index for structure ( temp 4-component vector of double) +0:92 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:92 Constant: +0:92 0 (const uint) +0:92 direct index ( temp uint) +0:92 'dti' ( in 3-component vector of uint) +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 3 (const int) +0:92 Sequence +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 1 (const int) +0:92 Constant: +0:92 2 (const int) +0:94 move second child to first child ( temp 4-component vector of uint) +0:94 u: direct index for structure ( temp 4-component vector of uint) +0:94 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:94 Constant: +0:94 0 (const uint) +0:94 direct index ( temp uint) +0:94 'dti' ( in 3-component vector of uint) +0:94 Constant: +0:94 0 (const int) +0:94 Constant: +0:94 0 (const int) +0:94 subgroupAnd ( temp 4-component vector of uint) +0:94 u: direct index for structure ( temp 4-component vector of uint) +0:94 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:94 Constant: +0:94 0 (const uint) +0:94 direct index ( temp uint) +0:94 'dti' ( in 3-component vector of uint) +0:94 Constant: +0:94 0 (const int) +0:94 Constant: +0:94 0 (const int) +0:95 move second child to first child ( temp uint) +0:95 direct index ( temp uint) +0:95 u: direct index for structure ( temp 4-component vector of uint) +0:95 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:95 Constant: +0:95 0 (const uint) +0:95 direct index ( temp uint) +0:95 'dti' ( in 3-component vector of uint) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 subgroupAnd ( temp uint) +0:95 direct index ( temp uint) +0:95 u: direct index for structure ( temp 4-component vector of uint) +0:95 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:95 Constant: +0:95 0 (const uint) +0:95 direct index ( temp uint) +0:95 'dti' ( in 3-component vector of uint) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:96 move second child to first child ( temp 2-component vector of uint) +0:96 vector swizzle ( temp 2-component vector of uint) +0:96 u: direct index for structure ( temp 4-component vector of uint) +0:96 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:96 Constant: +0:96 0 (const uint) +0:96 direct index ( temp uint) +0:96 'dti' ( in 3-component vector of uint) +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 0 (const int) +0:96 Sequence +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 1 (const int) +0:96 subgroupAnd ( temp 2-component vector of uint) +0:96 vector swizzle ( temp 2-component vector of uint) +0:96 u: direct index for structure ( temp 4-component vector of uint) +0:96 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:96 Constant: +0:96 0 (const uint) +0:96 direct index ( temp uint) +0:96 'dti' ( in 3-component vector of uint) +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 0 (const int) +0:96 Sequence +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 1 (const int) +0:97 move second child to first child ( temp 3-component vector of uint) +0:97 vector swizzle ( temp 3-component vector of uint) +0:97 u: direct index for structure ( temp 4-component vector of uint) +0:97 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:97 Constant: +0:97 0 (const uint) +0:97 direct index ( temp uint) +0:97 'dti' ( in 3-component vector of uint) +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 0 (const int) +0:97 Sequence +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 1 (const int) +0:97 Constant: +0:97 2 (const int) +0:97 subgroupAnd ( temp 3-component vector of uint) +0:97 vector swizzle ( temp 3-component vector of uint) +0:97 u: direct index for structure ( temp 4-component vector of uint) +0:97 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:97 Constant: +0:97 0 (const uint) +0:97 direct index ( temp uint) +0:97 'dti' ( in 3-component vector of uint) +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 0 (const int) +0:97 Sequence +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 1 (const int) +0:97 Constant: +0:97 2 (const int) +0:99 move second child to first child ( temp 4-component vector of int) +0:99 i: direct index for structure ( temp 4-component vector of int) +0:99 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:99 Constant: +0:99 0 (const uint) +0:99 direct index ( temp uint) +0:99 'dti' ( in 3-component vector of uint) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) +0:99 subgroupAnd ( temp 4-component vector of int) +0:99 i: direct index for structure ( temp 4-component vector of int) +0:99 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:99 Constant: +0:99 0 (const uint) +0:99 direct index ( temp uint) +0:99 'dti' ( in 3-component vector of uint) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) +0:100 move second child to first child ( temp int) +0:100 direct index ( temp int) +0:100 i: direct index for structure ( temp 4-component vector of int) +0:100 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:100 Constant: +0:100 0 (const uint) +0:100 direct index ( temp uint) +0:100 'dti' ( in 3-component vector of uint) +0:100 Constant: +0:100 0 (const int) +0:100 Constant: +0:100 1 (const int) +0:100 Constant: +0:100 0 (const int) +0:100 subgroupAnd ( temp int) +0:100 direct index ( temp int) +0:100 i: direct index for structure ( temp 4-component vector of int) +0:100 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:100 Constant: +0:100 0 (const uint) +0:100 direct index ( temp uint) +0:100 'dti' ( in 3-component vector of uint) +0:100 Constant: +0:100 0 (const int) +0:100 Constant: +0:100 1 (const int) +0:100 Constant: +0:100 0 (const int) +0:101 move second child to first child ( temp 2-component vector of int) +0:101 vector swizzle ( temp 2-component vector of int) +0:101 i: direct index for structure ( temp 4-component vector of int) +0:101 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:101 Constant: +0:101 0 (const uint) +0:101 direct index ( temp uint) +0:101 'dti' ( in 3-component vector of uint) +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 Sequence +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 subgroupAnd ( temp 2-component vector of int) +0:101 vector swizzle ( temp 2-component vector of int) +0:101 i: direct index for structure ( temp 4-component vector of int) +0:101 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:101 Constant: +0:101 0 (const uint) +0:101 direct index ( temp uint) +0:101 'dti' ( in 3-component vector of uint) +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 Sequence +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:102 move second child to first child ( temp 3-component vector of int) +0:102 vector swizzle ( temp 3-component vector of int) +0:102 i: direct index for structure ( temp 4-component vector of int) +0:102 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:102 Constant: +0:102 0 (const uint) +0:102 direct index ( temp uint) +0:102 'dti' ( in 3-component vector of uint) +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Sequence +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Constant: +0:102 2 (const int) +0:102 subgroupAnd ( temp 3-component vector of int) +0:102 vector swizzle ( temp 3-component vector of int) +0:102 i: direct index for structure ( temp 4-component vector of int) +0:102 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:102 Constant: +0:102 0 (const uint) +0:102 direct index ( temp uint) +0:102 'dti' ( in 3-component vector of uint) +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Sequence +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Constant: +0:102 2 (const int) +0:104 move second child to first child ( temp 4-component vector of uint) +0:104 u: direct index for structure ( temp 4-component vector of uint) +0:104 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:104 Constant: +0:104 0 (const uint) +0:104 direct index ( temp uint) +0:104 'dti' ( in 3-component vector of uint) +0:104 Constant: +0:104 0 (const int) +0:104 Constant: +0:104 0 (const int) +0:104 subgroupOr ( temp 4-component vector of uint) +0:104 u: direct index for structure ( temp 4-component vector of uint) +0:104 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:104 Constant: +0:104 0 (const uint) +0:104 direct index ( temp uint) +0:104 'dti' ( in 3-component vector of uint) +0:104 Constant: +0:104 0 (const int) +0:104 Constant: +0:104 0 (const int) +0:105 move second child to first child ( temp uint) +0:105 direct index ( temp uint) +0:105 u: direct index for structure ( temp 4-component vector of uint) +0:105 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:105 Constant: +0:105 0 (const uint) +0:105 direct index ( temp uint) +0:105 'dti' ( in 3-component vector of uint) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 0 (const int) +0:105 subgroupOr ( temp uint) +0:105 direct index ( temp uint) +0:105 u: direct index for structure ( temp 4-component vector of uint) +0:105 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:105 Constant: +0:105 0 (const uint) +0:105 direct index ( temp uint) +0:105 'dti' ( in 3-component vector of uint) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 0 (const int) +0:106 move second child to first child ( temp 2-component vector of uint) +0:106 vector swizzle ( temp 2-component vector of uint) +0:106 u: direct index for structure ( temp 4-component vector of uint) +0:106 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:106 Constant: +0:106 0 (const uint) +0:106 direct index ( temp uint) +0:106 'dti' ( in 3-component vector of uint) +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 0 (const int) +0:106 Sequence +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 1 (const int) +0:106 subgroupOr ( temp 2-component vector of uint) +0:106 vector swizzle ( temp 2-component vector of uint) +0:106 u: direct index for structure ( temp 4-component vector of uint) +0:106 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:106 Constant: +0:106 0 (const uint) +0:106 direct index ( temp uint) +0:106 'dti' ( in 3-component vector of uint) +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 0 (const int) +0:106 Sequence +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 1 (const int) +0:107 move second child to first child ( temp 3-component vector of uint) +0:107 vector swizzle ( temp 3-component vector of uint) +0:107 u: direct index for structure ( temp 4-component vector of uint) +0:107 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:107 Constant: +0:107 0 (const uint) +0:107 direct index ( temp uint) +0:107 'dti' ( in 3-component vector of uint) +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 0 (const int) +0:107 Sequence +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 1 (const int) +0:107 Constant: +0:107 2 (const int) +0:107 subgroupOr ( temp 3-component vector of uint) +0:107 vector swizzle ( temp 3-component vector of uint) +0:107 u: direct index for structure ( temp 4-component vector of uint) +0:107 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:107 Constant: +0:107 0 (const uint) +0:107 direct index ( temp uint) +0:107 'dti' ( in 3-component vector of uint) +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 0 (const int) +0:107 Sequence +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 1 (const int) +0:107 Constant: +0:107 2 (const int) +0:109 move second child to first child ( temp 4-component vector of int) +0:109 i: direct index for structure ( temp 4-component vector of int) +0:109 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:109 Constant: +0:109 0 (const uint) +0:109 direct index ( temp uint) +0:109 'dti' ( in 3-component vector of uint) +0:109 Constant: +0:109 0 (const int) +0:109 Constant: +0:109 1 (const int) +0:109 subgroupOr ( temp 4-component vector of int) +0:109 i: direct index for structure ( temp 4-component vector of int) +0:109 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:109 Constant: +0:109 0 (const uint) +0:109 direct index ( temp uint) +0:109 'dti' ( in 3-component vector of uint) +0:109 Constant: +0:109 0 (const int) +0:109 Constant: +0:109 1 (const int) +0:110 move second child to first child ( temp int) +0:110 direct index ( temp int) +0:110 i: direct index for structure ( temp 4-component vector of int) +0:110 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:110 Constant: +0:110 0 (const uint) +0:110 direct index ( temp uint) +0:110 'dti' ( in 3-component vector of uint) +0:110 Constant: +0:110 0 (const int) +0:110 Constant: +0:110 1 (const int) +0:110 Constant: +0:110 0 (const int) +0:110 subgroupOr ( temp int) +0:110 direct index ( temp int) +0:110 i: direct index for structure ( temp 4-component vector of int) +0:110 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:110 Constant: +0:110 0 (const uint) +0:110 direct index ( temp uint) +0:110 'dti' ( in 3-component vector of uint) +0:110 Constant: +0:110 0 (const int) +0:110 Constant: +0:110 1 (const int) +0:110 Constant: +0:110 0 (const int) +0:111 move second child to first child ( temp 2-component vector of int) +0:111 vector swizzle ( temp 2-component vector of int) +0:111 i: direct index for structure ( temp 4-component vector of int) +0:111 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:111 Constant: +0:111 0 (const uint) +0:111 direct index ( temp uint) +0:111 'dti' ( in 3-component vector of uint) +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:111 Sequence +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:111 subgroupOr ( temp 2-component vector of int) +0:111 vector swizzle ( temp 2-component vector of int) +0:111 i: direct index for structure ( temp 4-component vector of int) +0:111 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:111 Constant: +0:111 0 (const uint) +0:111 direct index ( temp uint) +0:111 'dti' ( in 3-component vector of uint) +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:111 Sequence +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:112 move second child to first child ( temp 3-component vector of int) +0:112 vector swizzle ( temp 3-component vector of int) +0:112 i: direct index for structure ( temp 4-component vector of int) +0:112 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:112 Constant: +0:112 0 (const uint) +0:112 direct index ( temp uint) +0:112 'dti' ( in 3-component vector of uint) +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Sequence +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Constant: +0:112 2 (const int) +0:112 subgroupOr ( temp 3-component vector of int) +0:112 vector swizzle ( temp 3-component vector of int) +0:112 i: direct index for structure ( temp 4-component vector of int) +0:112 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:112 Constant: +0:112 0 (const uint) +0:112 direct index ( temp uint) +0:112 'dti' ( in 3-component vector of uint) +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Sequence +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Constant: +0:112 2 (const int) +0:114 move second child to first child ( temp 4-component vector of uint) +0:114 u: direct index for structure ( temp 4-component vector of uint) +0:114 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:114 Constant: +0:114 0 (const uint) +0:114 direct index ( temp uint) +0:114 'dti' ( in 3-component vector of uint) +0:114 Constant: +0:114 0 (const int) +0:114 Constant: +0:114 0 (const int) +0:114 subgroupXor ( temp 4-component vector of uint) +0:114 u: direct index for structure ( temp 4-component vector of uint) +0:114 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:114 Constant: +0:114 0 (const uint) +0:114 direct index ( temp uint) +0:114 'dti' ( in 3-component vector of uint) +0:114 Constant: +0:114 0 (const int) +0:114 Constant: +0:114 0 (const int) +0:115 move second child to first child ( temp uint) +0:115 direct index ( temp uint) +0:115 u: direct index for structure ( temp 4-component vector of uint) +0:115 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:115 Constant: +0:115 0 (const uint) +0:115 direct index ( temp uint) +0:115 'dti' ( in 3-component vector of uint) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 subgroupXor ( temp uint) +0:115 direct index ( temp uint) +0:115 u: direct index for structure ( temp 4-component vector of uint) +0:115 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:115 Constant: +0:115 0 (const uint) +0:115 direct index ( temp uint) +0:115 'dti' ( in 3-component vector of uint) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:116 move second child to first child ( temp 2-component vector of uint) +0:116 vector swizzle ( temp 2-component vector of uint) +0:116 u: direct index for structure ( temp 4-component vector of uint) +0:116 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:116 Constant: +0:116 0 (const uint) +0:116 direct index ( temp uint) +0:116 'dti' ( in 3-component vector of uint) +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 0 (const int) +0:116 Sequence +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 1 (const int) +0:116 subgroupXor ( temp 2-component vector of uint) +0:116 vector swizzle ( temp 2-component vector of uint) +0:116 u: direct index for structure ( temp 4-component vector of uint) +0:116 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:116 Constant: +0:116 0 (const uint) +0:116 direct index ( temp uint) +0:116 'dti' ( in 3-component vector of uint) +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 0 (const int) +0:116 Sequence +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 1 (const int) +0:117 move second child to first child ( temp 3-component vector of uint) +0:117 vector swizzle ( temp 3-component vector of uint) +0:117 u: direct index for structure ( temp 4-component vector of uint) +0:117 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:117 Constant: +0:117 0 (const uint) +0:117 direct index ( temp uint) +0:117 'dti' ( in 3-component vector of uint) +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 0 (const int) +0:117 Sequence +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 1 (const int) +0:117 Constant: +0:117 2 (const int) +0:117 subgroupXor ( temp 3-component vector of uint) +0:117 vector swizzle ( temp 3-component vector of uint) +0:117 u: direct index for structure ( temp 4-component vector of uint) +0:117 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:117 Constant: +0:117 0 (const uint) +0:117 direct index ( temp uint) +0:117 'dti' ( in 3-component vector of uint) +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 0 (const int) +0:117 Sequence +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 1 (const int) +0:117 Constant: +0:117 2 (const int) +0:119 move second child to first child ( temp 4-component vector of int) +0:119 i: direct index for structure ( temp 4-component vector of int) +0:119 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:119 Constant: +0:119 0 (const uint) +0:119 direct index ( temp uint) +0:119 'dti' ( in 3-component vector of uint) +0:119 Constant: +0:119 0 (const int) +0:119 Constant: +0:119 1 (const int) +0:119 subgroupXor ( temp 4-component vector of int) +0:119 i: direct index for structure ( temp 4-component vector of int) +0:119 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:119 Constant: +0:119 0 (const uint) +0:119 direct index ( temp uint) +0:119 'dti' ( in 3-component vector of uint) +0:119 Constant: +0:119 0 (const int) +0:119 Constant: +0:119 1 (const int) +0:120 move second child to first child ( temp int) +0:120 direct index ( temp int) +0:120 i: direct index for structure ( temp 4-component vector of int) +0:120 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:120 Constant: +0:120 0 (const uint) +0:120 direct index ( temp uint) +0:120 'dti' ( in 3-component vector of uint) +0:120 Constant: +0:120 0 (const int) +0:120 Constant: +0:120 1 (const int) +0:120 Constant: +0:120 0 (const int) +0:120 subgroupXor ( temp int) +0:120 direct index ( temp int) +0:120 i: direct index for structure ( temp 4-component vector of int) +0:120 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:120 Constant: +0:120 0 (const uint) +0:120 direct index ( temp uint) +0:120 'dti' ( in 3-component vector of uint) +0:120 Constant: +0:120 0 (const int) +0:120 Constant: +0:120 1 (const int) +0:120 Constant: +0:120 0 (const int) +0:121 move second child to first child ( temp 2-component vector of int) +0:121 vector swizzle ( temp 2-component vector of int) +0:121 i: direct index for structure ( temp 4-component vector of int) +0:121 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:121 Constant: +0:121 0 (const uint) +0:121 direct index ( temp uint) +0:121 'dti' ( in 3-component vector of uint) +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 Sequence +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 subgroupXor ( temp 2-component vector of int) +0:121 vector swizzle ( temp 2-component vector of int) +0:121 i: direct index for structure ( temp 4-component vector of int) +0:121 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:121 Constant: +0:121 0 (const uint) +0:121 direct index ( temp uint) +0:121 'dti' ( in 3-component vector of uint) +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 Sequence +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:122 move second child to first child ( temp 3-component vector of int) +0:122 vector swizzle ( temp 3-component vector of int) +0:122 i: direct index for structure ( temp 4-component vector of int) +0:122 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:122 Constant: +0:122 0 (const uint) +0:122 direct index ( temp uint) +0:122 'dti' ( in 3-component vector of uint) +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Sequence +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Constant: +0:122 2 (const int) +0:122 subgroupXor ( temp 3-component vector of int) +0:122 vector swizzle ( temp 3-component vector of int) +0:122 i: direct index for structure ( temp 4-component vector of int) +0:122 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:122 Constant: +0:122 0 (const uint) +0:122 direct index ( temp uint) +0:122 'dti' ( in 3-component vector of uint) +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Sequence +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Constant: +0:122 2 (const int) +0:124 move second child to first child ( temp uint) +0:124 direct index ( temp uint) +0:124 u: direct index for structure ( temp 4-component vector of uint) +0:124 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:124 Constant: +0:124 0 (const uint) +0:124 direct index ( temp uint) +0:124 'dti' ( in 3-component vector of uint) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const int) +0:124 subgroupBallotBitCount ( temp uint) +0:124 subgroupBallot ( temp 4-component vector of uint) +0:124 Compare Equal ( temp bool) +0:124 direct index ( temp uint) +0:124 u: direct index for structure ( temp 4-component vector of uint) +0:124 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:124 Constant: +0:124 0 (const uint) +0:124 direct index ( temp uint) +0:124 'dti' ( in 3-component vector of uint) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const uint) +0:13 Function Definition: CSMain( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:13 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:13 Function Definition: @CSMain(vu3; ( temp void) +0:13 Function Parameters: +0:13 'dti' ( in 3-component vector of uint) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 subgroupAdd ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:15 move second child to first child ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 subgroupAdd ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:16 move second child to first child ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 subgroupAdd ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:17 move second child to first child ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 subgroupAdd ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:19 move second child to first child ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 subgroupAdd ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 subgroupAdd ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:21 move second child to first child ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 subgroupAdd ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:22 move second child to first child ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 subgroupAdd ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 subgroupAdd ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 subgroupAdd ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:26 move second child to first child ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 subgroupAdd ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:27 move second child to first child ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 subgroupAdd ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:29 move second child to first child ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 subgroupAdd ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:30 move second child to first child ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 subgroupAdd ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:31 move second child to first child ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 subgroupAdd ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:32 move second child to first child ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 subgroupAdd ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:34 move second child to first child ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 subgroupMul ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:35 move second child to first child ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 subgroupMul ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:36 move second child to first child ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 subgroupMul ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:37 move second child to first child ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 subgroupMul ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:39 move second child to first child ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 subgroupMul ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:40 move second child to first child ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 subgroupMul ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:41 move second child to first child ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 subgroupMul ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:42 move second child to first child ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 subgroupMul ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:44 move second child to first child ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 subgroupMul ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 subgroupMul ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:46 move second child to first child ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 subgroupMul ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 subgroupMul ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:49 move second child to first child ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 subgroupMul ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:50 move second child to first child ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 subgroupMul ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:51 move second child to first child ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 subgroupMul ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:52 move second child to first child ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 subgroupMul ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:54 move second child to first child ( temp 4-component vector of uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 subgroupMin ( temp 4-component vector of uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:55 move second child to first child ( temp uint) +0:55 direct index ( temp uint) +0:55 u: direct index for structure ( temp 4-component vector of uint) +0:55 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:55 Constant: +0:55 0 (const uint) +0:55 direct index ( temp uint) +0:55 'dti' ( in 3-component vector of uint) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 subgroupMin ( temp uint) +0:55 direct index ( temp uint) +0:55 u: direct index for structure ( temp 4-component vector of uint) +0:55 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:55 Constant: +0:55 0 (const uint) +0:55 direct index ( temp uint) +0:55 'dti' ( in 3-component vector of uint) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:56 move second child to first child ( temp 2-component vector of uint) +0:56 vector swizzle ( temp 2-component vector of uint) +0:56 u: direct index for structure ( temp 4-component vector of uint) +0:56 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:56 Constant: +0:56 0 (const uint) +0:56 direct index ( temp uint) +0:56 'dti' ( in 3-component vector of uint) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 0 (const int) +0:56 Sequence +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1 (const int) +0:56 subgroupMin ( temp 2-component vector of uint) +0:56 vector swizzle ( temp 2-component vector of uint) +0:56 u: direct index for structure ( temp 4-component vector of uint) +0:56 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:56 Constant: +0:56 0 (const uint) +0:56 direct index ( temp uint) +0:56 'dti' ( in 3-component vector of uint) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 0 (const int) +0:56 Sequence +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1 (const int) +0:57 move second child to first child ( temp 3-component vector of uint) +0:57 vector swizzle ( temp 3-component vector of uint) +0:57 u: direct index for structure ( temp 4-component vector of uint) +0:57 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:57 Constant: +0:57 0 (const uint) +0:57 direct index ( temp uint) +0:57 'dti' ( in 3-component vector of uint) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 0 (const int) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:57 subgroupMin ( temp 3-component vector of uint) +0:57 vector swizzle ( temp 3-component vector of uint) +0:57 u: direct index for structure ( temp 4-component vector of uint) +0:57 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:57 Constant: +0:57 0 (const uint) +0:57 direct index ( temp uint) +0:57 'dti' ( in 3-component vector of uint) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 0 (const int) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:59 move second child to first child ( temp 4-component vector of int) +0:59 i: direct index for structure ( temp 4-component vector of int) +0:59 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:59 Constant: +0:59 0 (const uint) +0:59 direct index ( temp uint) +0:59 'dti' ( in 3-component vector of uint) +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 subgroupMin ( temp 4-component vector of int) +0:59 i: direct index for structure ( temp 4-component vector of int) +0:59 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:59 Constant: +0:59 0 (const uint) +0:59 direct index ( temp uint) +0:59 'dti' ( in 3-component vector of uint) +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:60 move second child to first child ( temp int) +0:60 direct index ( temp int) +0:60 i: direct index for structure ( temp 4-component vector of int) +0:60 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:60 Constant: +0:60 0 (const uint) +0:60 direct index ( temp uint) +0:60 'dti' ( in 3-component vector of uint) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 1 (const int) +0:60 Constant: +0:60 0 (const int) +0:60 subgroupMin ( temp int) +0:60 direct index ( temp int) +0:60 i: direct index for structure ( temp 4-component vector of int) +0:60 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:60 Constant: +0:60 0 (const uint) +0:60 direct index ( temp uint) +0:60 'dti' ( in 3-component vector of uint) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 1 (const int) +0:60 Constant: +0:60 0 (const int) +0:61 move second child to first child ( temp 2-component vector of int) +0:61 vector swizzle ( temp 2-component vector of int) +0:61 i: direct index for structure ( temp 4-component vector of int) +0:61 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:61 Constant: +0:61 0 (const uint) +0:61 direct index ( temp uint) +0:61 'dti' ( in 3-component vector of uint) +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Sequence +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 subgroupMin ( temp 2-component vector of int) +0:61 vector swizzle ( temp 2-component vector of int) +0:61 i: direct index for structure ( temp 4-component vector of int) +0:61 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:61 Constant: +0:61 0 (const uint) +0:61 direct index ( temp uint) +0:61 'dti' ( in 3-component vector of uint) +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Sequence +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:62 move second child to first child ( temp 3-component vector of int) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 i: direct index for structure ( temp 4-component vector of int) +0:62 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:62 Constant: +0:62 0 (const uint) +0:62 direct index ( temp uint) +0:62 'dti' ( in 3-component vector of uint) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:62 subgroupMin ( temp 3-component vector of int) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 i: direct index for structure ( temp 4-component vector of int) +0:62 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:62 Constant: +0:62 0 (const uint) +0:62 direct index ( temp uint) +0:62 'dti' ( in 3-component vector of uint) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:64 move second child to first child ( temp 4-component vector of float) +0:64 f: direct index for structure ( temp 4-component vector of float) +0:64 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:64 Constant: +0:64 0 (const uint) +0:64 direct index ( temp uint) +0:64 'dti' ( in 3-component vector of uint) +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 2 (const int) +0:64 subgroupMin ( temp 4-component vector of float) +0:64 f: direct index for structure ( temp 4-component vector of float) +0:64 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:64 Constant: +0:64 0 (const uint) +0:64 direct index ( temp uint) +0:64 'dti' ( in 3-component vector of uint) +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 2 (const int) +0:65 move second child to first child ( temp float) +0:65 direct index ( temp float) +0:65 f: direct index for structure ( temp 4-component vector of float) +0:65 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:65 Constant: +0:65 0 (const uint) +0:65 direct index ( temp uint) +0:65 'dti' ( in 3-component vector of uint) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 Constant: +0:65 0 (const int) +0:65 subgroupMin ( temp float) +0:65 direct index ( temp float) +0:65 f: direct index for structure ( temp 4-component vector of float) +0:65 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:65 Constant: +0:65 0 (const uint) +0:65 direct index ( temp uint) +0:65 'dti' ( in 3-component vector of uint) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 Constant: +0:65 0 (const int) +0:66 move second child to first child ( temp 2-component vector of float) +0:66 vector swizzle ( temp 2-component vector of float) +0:66 f: direct index for structure ( temp 4-component vector of float) +0:66 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:66 Constant: +0:66 0 (const uint) +0:66 direct index ( temp uint) +0:66 'dti' ( in 3-component vector of uint) +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 2 (const int) +0:66 Sequence +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 1 (const int) +0:66 subgroupMin ( temp 2-component vector of float) +0:66 vector swizzle ( temp 2-component vector of float) +0:66 f: direct index for structure ( temp 4-component vector of float) +0:66 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:66 Constant: +0:66 0 (const uint) +0:66 direct index ( temp uint) +0:66 'dti' ( in 3-component vector of uint) +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 2 (const int) +0:66 Sequence +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 1 (const int) +0:67 move second child to first child ( temp 3-component vector of float) +0:67 vector swizzle ( temp 3-component vector of float) +0:67 f: direct index for structure ( temp 4-component vector of float) +0:67 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:67 Constant: +0:67 0 (const uint) +0:67 direct index ( temp uint) +0:67 'dti' ( in 3-component vector of uint) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Sequence +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 subgroupMin ( temp 3-component vector of float) +0:67 vector swizzle ( temp 3-component vector of float) +0:67 f: direct index for structure ( temp 4-component vector of float) +0:67 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:67 Constant: +0:67 0 (const uint) +0:67 direct index ( temp uint) +0:67 'dti' ( in 3-component vector of uint) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Sequence +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1 (const int) +0:67 Constant: +0:67 2 (const int) +0:69 move second child to first child ( temp 4-component vector of double) +0:69 d: direct index for structure ( temp 4-component vector of double) +0:69 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:69 Constant: +0:69 0 (const uint) +0:69 direct index ( temp uint) +0:69 'dti' ( in 3-component vector of uint) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 3 (const int) +0:69 subgroupMin ( temp 4-component vector of double) +0:69 d: direct index for structure ( temp 4-component vector of double) +0:69 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:69 Constant: +0:69 0 (const uint) +0:69 direct index ( temp uint) +0:69 'dti' ( in 3-component vector of uint) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 3 (const int) +0:70 move second child to first child ( temp double) +0:70 direct index ( temp double) +0:70 d: direct index for structure ( temp 4-component vector of double) +0:70 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:70 Constant: +0:70 0 (const uint) +0:70 direct index ( temp uint) +0:70 'dti' ( in 3-component vector of uint) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 3 (const int) +0:70 Constant: +0:70 0 (const int) +0:70 subgroupMin ( temp double) +0:70 direct index ( temp double) +0:70 d: direct index for structure ( temp 4-component vector of double) +0:70 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:70 Constant: +0:70 0 (const uint) +0:70 direct index ( temp uint) +0:70 'dti' ( in 3-component vector of uint) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 3 (const int) +0:70 Constant: +0:70 0 (const int) +0:71 move second child to first child ( temp 2-component vector of double) +0:71 vector swizzle ( temp 2-component vector of double) +0:71 d: direct index for structure ( temp 4-component vector of double) +0:71 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:71 Constant: +0:71 0 (const uint) +0:71 direct index ( temp uint) +0:71 'dti' ( in 3-component vector of uint) +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 3 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:71 subgroupMin ( temp 2-component vector of double) +0:71 vector swizzle ( temp 2-component vector of double) +0:71 d: direct index for structure ( temp 4-component vector of double) +0:71 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:71 Constant: +0:71 0 (const uint) +0:71 direct index ( temp uint) +0:71 'dti' ( in 3-component vector of uint) +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 3 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:72 move second child to first child ( temp 3-component vector of double) +0:72 vector swizzle ( temp 3-component vector of double) +0:72 d: direct index for structure ( temp 4-component vector of double) +0:72 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:72 Constant: +0:72 0 (const uint) +0:72 direct index ( temp uint) +0:72 'dti' ( in 3-component vector of uint) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 3 (const int) +0:72 Sequence +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 2 (const int) +0:72 subgroupMin ( temp 3-component vector of double) +0:72 vector swizzle ( temp 3-component vector of double) +0:72 d: direct index for structure ( temp 4-component vector of double) +0:72 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:72 Constant: +0:72 0 (const uint) +0:72 direct index ( temp uint) +0:72 'dti' ( in 3-component vector of uint) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 3 (const int) +0:72 Sequence +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 2 (const int) +0:74 move second child to first child ( temp 4-component vector of uint) +0:74 u: direct index for structure ( temp 4-component vector of uint) +0:74 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:74 Constant: +0:74 0 (const uint) +0:74 direct index ( temp uint) +0:74 'dti' ( in 3-component vector of uint) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 0 (const int) +0:74 subgroupMax ( temp 4-component vector of uint) +0:74 u: direct index for structure ( temp 4-component vector of uint) +0:74 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:74 Constant: +0:74 0 (const uint) +0:74 direct index ( temp uint) +0:74 'dti' ( in 3-component vector of uint) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 0 (const int) +0:75 move second child to first child ( temp uint) +0:75 direct index ( temp uint) +0:75 u: direct index for structure ( temp 4-component vector of uint) +0:75 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:75 Constant: +0:75 0 (const uint) +0:75 direct index ( temp uint) +0:75 'dti' ( in 3-component vector of uint) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 subgroupMax ( temp uint) +0:75 direct index ( temp uint) +0:75 u: direct index for structure ( temp 4-component vector of uint) +0:75 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:75 Constant: +0:75 0 (const uint) +0:75 direct index ( temp uint) +0:75 'dti' ( in 3-component vector of uint) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:76 move second child to first child ( temp 2-component vector of uint) +0:76 vector swizzle ( temp 2-component vector of uint) +0:76 u: direct index for structure ( temp 4-component vector of uint) +0:76 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:76 Constant: +0:76 0 (const uint) +0:76 direct index ( temp uint) +0:76 'dti' ( in 3-component vector of uint) +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 0 (const int) +0:76 Sequence +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 1 (const int) +0:76 subgroupMax ( temp 2-component vector of uint) +0:76 vector swizzle ( temp 2-component vector of uint) +0:76 u: direct index for structure ( temp 4-component vector of uint) +0:76 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:76 Constant: +0:76 0 (const uint) +0:76 direct index ( temp uint) +0:76 'dti' ( in 3-component vector of uint) +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 0 (const int) +0:76 Sequence +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 1 (const int) +0:77 move second child to first child ( temp 3-component vector of uint) +0:77 vector swizzle ( temp 3-component vector of uint) +0:77 u: direct index for structure ( temp 4-component vector of uint) +0:77 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:77 Constant: +0:77 0 (const uint) +0:77 direct index ( temp uint) +0:77 'dti' ( in 3-component vector of uint) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 0 (const int) +0:77 Sequence +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 1 (const int) +0:77 Constant: +0:77 2 (const int) +0:77 subgroupMax ( temp 3-component vector of uint) +0:77 vector swizzle ( temp 3-component vector of uint) +0:77 u: direct index for structure ( temp 4-component vector of uint) +0:77 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:77 Constant: +0:77 0 (const uint) +0:77 direct index ( temp uint) +0:77 'dti' ( in 3-component vector of uint) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 0 (const int) +0:77 Sequence +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 1 (const int) +0:77 Constant: +0:77 2 (const int) +0:79 move second child to first child ( temp 4-component vector of int) +0:79 i: direct index for structure ( temp 4-component vector of int) +0:79 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:79 Constant: +0:79 0 (const uint) +0:79 direct index ( temp uint) +0:79 'dti' ( in 3-component vector of uint) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:79 subgroupMax ( temp 4-component vector of int) +0:79 i: direct index for structure ( temp 4-component vector of int) +0:79 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:79 Constant: +0:79 0 (const uint) +0:79 direct index ( temp uint) +0:79 'dti' ( in 3-component vector of uint) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:80 move second child to first child ( temp int) +0:80 direct index ( temp int) +0:80 i: direct index for structure ( temp 4-component vector of int) +0:80 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:80 Constant: +0:80 0 (const uint) +0:80 direct index ( temp uint) +0:80 'dti' ( in 3-component vector of uint) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 1 (const int) +0:80 Constant: +0:80 0 (const int) +0:80 subgroupMax ( temp int) +0:80 direct index ( temp int) +0:80 i: direct index for structure ( temp 4-component vector of int) +0:80 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:80 Constant: +0:80 0 (const uint) +0:80 direct index ( temp uint) +0:80 'dti' ( in 3-component vector of uint) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 1 (const int) +0:80 Constant: +0:80 0 (const int) +0:81 move second child to first child ( temp 2-component vector of int) +0:81 vector swizzle ( temp 2-component vector of int) +0:81 i: direct index for structure ( temp 4-component vector of int) +0:81 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:81 Constant: +0:81 0 (const uint) +0:81 direct index ( temp uint) +0:81 'dti' ( in 3-component vector of uint) +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Sequence +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 subgroupMax ( temp 2-component vector of int) +0:81 vector swizzle ( temp 2-component vector of int) +0:81 i: direct index for structure ( temp 4-component vector of int) +0:81 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:81 Constant: +0:81 0 (const uint) +0:81 direct index ( temp uint) +0:81 'dti' ( in 3-component vector of uint) +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Sequence +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:82 move second child to first child ( temp 3-component vector of int) +0:82 vector swizzle ( temp 3-component vector of int) +0:82 i: direct index for structure ( temp 4-component vector of int) +0:82 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:82 Constant: +0:82 0 (const uint) +0:82 direct index ( temp uint) +0:82 'dti' ( in 3-component vector of uint) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Sequence +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Constant: +0:82 2 (const int) +0:82 subgroupMax ( temp 3-component vector of int) +0:82 vector swizzle ( temp 3-component vector of int) +0:82 i: direct index for structure ( temp 4-component vector of int) +0:82 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:82 Constant: +0:82 0 (const uint) +0:82 direct index ( temp uint) +0:82 'dti' ( in 3-component vector of uint) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Sequence +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Constant: +0:82 2 (const int) +0:84 move second child to first child ( temp 4-component vector of float) +0:84 f: direct index for structure ( temp 4-component vector of float) +0:84 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:84 Constant: +0:84 0 (const uint) +0:84 direct index ( temp uint) +0:84 'dti' ( in 3-component vector of uint) +0:84 Constant: +0:84 0 (const int) +0:84 Constant: +0:84 2 (const int) +0:84 subgroupMax ( temp 4-component vector of float) +0:84 f: direct index for structure ( temp 4-component vector of float) +0:84 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:84 Constant: +0:84 0 (const uint) +0:84 direct index ( temp uint) +0:84 'dti' ( in 3-component vector of uint) +0:84 Constant: +0:84 0 (const int) +0:84 Constant: +0:84 2 (const int) +0:85 move second child to first child ( temp float) +0:85 direct index ( temp float) +0:85 f: direct index for structure ( temp 4-component vector of float) +0:85 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:85 Constant: +0:85 0 (const uint) +0:85 direct index ( temp uint) +0:85 'dti' ( in 3-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 2 (const int) +0:85 Constant: +0:85 0 (const int) +0:85 subgroupMax ( temp float) +0:85 direct index ( temp float) +0:85 f: direct index for structure ( temp 4-component vector of float) +0:85 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:85 Constant: +0:85 0 (const uint) +0:85 direct index ( temp uint) +0:85 'dti' ( in 3-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 2 (const int) +0:85 Constant: +0:85 0 (const int) +0:86 move second child to first child ( temp 2-component vector of float) +0:86 vector swizzle ( temp 2-component vector of float) +0:86 f: direct index for structure ( temp 4-component vector of float) +0:86 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:86 Constant: +0:86 0 (const uint) +0:86 direct index ( temp uint) +0:86 'dti' ( in 3-component vector of uint) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 2 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:86 subgroupMax ( temp 2-component vector of float) +0:86 vector swizzle ( temp 2-component vector of float) +0:86 f: direct index for structure ( temp 4-component vector of float) +0:86 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:86 Constant: +0:86 0 (const uint) +0:86 direct index ( temp uint) +0:86 'dti' ( in 3-component vector of uint) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 2 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:87 move second child to first child ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 f: direct index for structure ( temp 4-component vector of float) +0:87 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:87 Constant: +0:87 0 (const uint) +0:87 direct index ( temp uint) +0:87 'dti' ( in 3-component vector of uint) +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 subgroupMax ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 f: direct index for structure ( temp 4-component vector of float) +0:87 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:87 Constant: +0:87 0 (const uint) +0:87 direct index ( temp uint) +0:87 'dti' ( in 3-component vector of uint) +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:89 move second child to first child ( temp 4-component vector of double) +0:89 d: direct index for structure ( temp 4-component vector of double) +0:89 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:89 Constant: +0:89 0 (const uint) +0:89 direct index ( temp uint) +0:89 'dti' ( in 3-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 Constant: +0:89 3 (const int) +0:89 subgroupMax ( temp 4-component vector of double) +0:89 d: direct index for structure ( temp 4-component vector of double) +0:89 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:89 Constant: +0:89 0 (const uint) +0:89 direct index ( temp uint) +0:89 'dti' ( in 3-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 Constant: +0:89 3 (const int) +0:90 move second child to first child ( temp double) +0:90 direct index ( temp double) +0:90 d: direct index for structure ( temp 4-component vector of double) +0:90 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:90 Constant: +0:90 0 (const uint) +0:90 direct index ( temp uint) +0:90 'dti' ( in 3-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const int) +0:90 Constant: +0:90 0 (const int) +0:90 subgroupMax ( temp double) +0:90 direct index ( temp double) +0:90 d: direct index for structure ( temp 4-component vector of double) +0:90 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:90 Constant: +0:90 0 (const uint) +0:90 direct index ( temp uint) +0:90 'dti' ( in 3-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const int) +0:90 Constant: +0:90 0 (const int) +0:91 move second child to first child ( temp 2-component vector of double) +0:91 vector swizzle ( temp 2-component vector of double) +0:91 d: direct index for structure ( temp 4-component vector of double) +0:91 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:91 Constant: +0:91 0 (const uint) +0:91 direct index ( temp uint) +0:91 'dti' ( in 3-component vector of uint) +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 3 (const int) +0:91 Sequence +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 1 (const int) +0:91 subgroupMax ( temp 2-component vector of double) +0:91 vector swizzle ( temp 2-component vector of double) +0:91 d: direct index for structure ( temp 4-component vector of double) +0:91 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:91 Constant: +0:91 0 (const uint) +0:91 direct index ( temp uint) +0:91 'dti' ( in 3-component vector of uint) +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 3 (const int) +0:91 Sequence +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 1 (const int) +0:92 move second child to first child ( temp 3-component vector of double) +0:92 vector swizzle ( temp 3-component vector of double) +0:92 d: direct index for structure ( temp 4-component vector of double) +0:92 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:92 Constant: +0:92 0 (const uint) +0:92 direct index ( temp uint) +0:92 'dti' ( in 3-component vector of uint) +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 3 (const int) +0:92 Sequence +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 1 (const int) +0:92 Constant: +0:92 2 (const int) +0:92 subgroupMax ( temp 3-component vector of double) +0:92 vector swizzle ( temp 3-component vector of double) +0:92 d: direct index for structure ( temp 4-component vector of double) +0:92 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:92 Constant: +0:92 0 (const uint) +0:92 direct index ( temp uint) +0:92 'dti' ( in 3-component vector of uint) +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 3 (const int) +0:92 Sequence +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 1 (const int) +0:92 Constant: +0:92 2 (const int) +0:94 move second child to first child ( temp 4-component vector of uint) +0:94 u: direct index for structure ( temp 4-component vector of uint) +0:94 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:94 Constant: +0:94 0 (const uint) +0:94 direct index ( temp uint) +0:94 'dti' ( in 3-component vector of uint) +0:94 Constant: +0:94 0 (const int) +0:94 Constant: +0:94 0 (const int) +0:94 subgroupAnd ( temp 4-component vector of uint) +0:94 u: direct index for structure ( temp 4-component vector of uint) +0:94 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:94 Constant: +0:94 0 (const uint) +0:94 direct index ( temp uint) +0:94 'dti' ( in 3-component vector of uint) +0:94 Constant: +0:94 0 (const int) +0:94 Constant: +0:94 0 (const int) +0:95 move second child to first child ( temp uint) +0:95 direct index ( temp uint) +0:95 u: direct index for structure ( temp 4-component vector of uint) +0:95 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:95 Constant: +0:95 0 (const uint) +0:95 direct index ( temp uint) +0:95 'dti' ( in 3-component vector of uint) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 subgroupAnd ( temp uint) +0:95 direct index ( temp uint) +0:95 u: direct index for structure ( temp 4-component vector of uint) +0:95 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:95 Constant: +0:95 0 (const uint) +0:95 direct index ( temp uint) +0:95 'dti' ( in 3-component vector of uint) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:96 move second child to first child ( temp 2-component vector of uint) +0:96 vector swizzle ( temp 2-component vector of uint) +0:96 u: direct index for structure ( temp 4-component vector of uint) +0:96 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:96 Constant: +0:96 0 (const uint) +0:96 direct index ( temp uint) +0:96 'dti' ( in 3-component vector of uint) +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 0 (const int) +0:96 Sequence +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 1 (const int) +0:96 subgroupAnd ( temp 2-component vector of uint) +0:96 vector swizzle ( temp 2-component vector of uint) +0:96 u: direct index for structure ( temp 4-component vector of uint) +0:96 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:96 Constant: +0:96 0 (const uint) +0:96 direct index ( temp uint) +0:96 'dti' ( in 3-component vector of uint) +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 0 (const int) +0:96 Sequence +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 1 (const int) +0:97 move second child to first child ( temp 3-component vector of uint) +0:97 vector swizzle ( temp 3-component vector of uint) +0:97 u: direct index for structure ( temp 4-component vector of uint) +0:97 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:97 Constant: +0:97 0 (const uint) +0:97 direct index ( temp uint) +0:97 'dti' ( in 3-component vector of uint) +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 0 (const int) +0:97 Sequence +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 1 (const int) +0:97 Constant: +0:97 2 (const int) +0:97 subgroupAnd ( temp 3-component vector of uint) +0:97 vector swizzle ( temp 3-component vector of uint) +0:97 u: direct index for structure ( temp 4-component vector of uint) +0:97 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:97 Constant: +0:97 0 (const uint) +0:97 direct index ( temp uint) +0:97 'dti' ( in 3-component vector of uint) +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 0 (const int) +0:97 Sequence +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 1 (const int) +0:97 Constant: +0:97 2 (const int) +0:99 move second child to first child ( temp 4-component vector of int) +0:99 i: direct index for structure ( temp 4-component vector of int) +0:99 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:99 Constant: +0:99 0 (const uint) +0:99 direct index ( temp uint) +0:99 'dti' ( in 3-component vector of uint) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) +0:99 subgroupAnd ( temp 4-component vector of int) +0:99 i: direct index for structure ( temp 4-component vector of int) +0:99 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:99 Constant: +0:99 0 (const uint) +0:99 direct index ( temp uint) +0:99 'dti' ( in 3-component vector of uint) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) +0:100 move second child to first child ( temp int) +0:100 direct index ( temp int) +0:100 i: direct index for structure ( temp 4-component vector of int) +0:100 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:100 Constant: +0:100 0 (const uint) +0:100 direct index ( temp uint) +0:100 'dti' ( in 3-component vector of uint) +0:100 Constant: +0:100 0 (const int) +0:100 Constant: +0:100 1 (const int) +0:100 Constant: +0:100 0 (const int) +0:100 subgroupAnd ( temp int) +0:100 direct index ( temp int) +0:100 i: direct index for structure ( temp 4-component vector of int) +0:100 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:100 Constant: +0:100 0 (const uint) +0:100 direct index ( temp uint) +0:100 'dti' ( in 3-component vector of uint) +0:100 Constant: +0:100 0 (const int) +0:100 Constant: +0:100 1 (const int) +0:100 Constant: +0:100 0 (const int) +0:101 move second child to first child ( temp 2-component vector of int) +0:101 vector swizzle ( temp 2-component vector of int) +0:101 i: direct index for structure ( temp 4-component vector of int) +0:101 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:101 Constant: +0:101 0 (const uint) +0:101 direct index ( temp uint) +0:101 'dti' ( in 3-component vector of uint) +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 Sequence +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 subgroupAnd ( temp 2-component vector of int) +0:101 vector swizzle ( temp 2-component vector of int) +0:101 i: direct index for structure ( temp 4-component vector of int) +0:101 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:101 Constant: +0:101 0 (const uint) +0:101 direct index ( temp uint) +0:101 'dti' ( in 3-component vector of uint) +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 Sequence +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:102 move second child to first child ( temp 3-component vector of int) +0:102 vector swizzle ( temp 3-component vector of int) +0:102 i: direct index for structure ( temp 4-component vector of int) +0:102 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:102 Constant: +0:102 0 (const uint) +0:102 direct index ( temp uint) +0:102 'dti' ( in 3-component vector of uint) +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Sequence +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Constant: +0:102 2 (const int) +0:102 subgroupAnd ( temp 3-component vector of int) +0:102 vector swizzle ( temp 3-component vector of int) +0:102 i: direct index for structure ( temp 4-component vector of int) +0:102 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:102 Constant: +0:102 0 (const uint) +0:102 direct index ( temp uint) +0:102 'dti' ( in 3-component vector of uint) +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Sequence +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Constant: +0:102 2 (const int) +0:104 move second child to first child ( temp 4-component vector of uint) +0:104 u: direct index for structure ( temp 4-component vector of uint) +0:104 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:104 Constant: +0:104 0 (const uint) +0:104 direct index ( temp uint) +0:104 'dti' ( in 3-component vector of uint) +0:104 Constant: +0:104 0 (const int) +0:104 Constant: +0:104 0 (const int) +0:104 subgroupOr ( temp 4-component vector of uint) +0:104 u: direct index for structure ( temp 4-component vector of uint) +0:104 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:104 Constant: +0:104 0 (const uint) +0:104 direct index ( temp uint) +0:104 'dti' ( in 3-component vector of uint) +0:104 Constant: +0:104 0 (const int) +0:104 Constant: +0:104 0 (const int) +0:105 move second child to first child ( temp uint) +0:105 direct index ( temp uint) +0:105 u: direct index for structure ( temp 4-component vector of uint) +0:105 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:105 Constant: +0:105 0 (const uint) +0:105 direct index ( temp uint) +0:105 'dti' ( in 3-component vector of uint) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 0 (const int) +0:105 subgroupOr ( temp uint) +0:105 direct index ( temp uint) +0:105 u: direct index for structure ( temp 4-component vector of uint) +0:105 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:105 Constant: +0:105 0 (const uint) +0:105 direct index ( temp uint) +0:105 'dti' ( in 3-component vector of uint) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 0 (const int) +0:106 move second child to first child ( temp 2-component vector of uint) +0:106 vector swizzle ( temp 2-component vector of uint) +0:106 u: direct index for structure ( temp 4-component vector of uint) +0:106 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:106 Constant: +0:106 0 (const uint) +0:106 direct index ( temp uint) +0:106 'dti' ( in 3-component vector of uint) +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 0 (const int) +0:106 Sequence +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 1 (const int) +0:106 subgroupOr ( temp 2-component vector of uint) +0:106 vector swizzle ( temp 2-component vector of uint) +0:106 u: direct index for structure ( temp 4-component vector of uint) +0:106 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:106 Constant: +0:106 0 (const uint) +0:106 direct index ( temp uint) +0:106 'dti' ( in 3-component vector of uint) +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 0 (const int) +0:106 Sequence +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 1 (const int) +0:107 move second child to first child ( temp 3-component vector of uint) +0:107 vector swizzle ( temp 3-component vector of uint) +0:107 u: direct index for structure ( temp 4-component vector of uint) +0:107 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:107 Constant: +0:107 0 (const uint) +0:107 direct index ( temp uint) +0:107 'dti' ( in 3-component vector of uint) +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 0 (const int) +0:107 Sequence +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 1 (const int) +0:107 Constant: +0:107 2 (const int) +0:107 subgroupOr ( temp 3-component vector of uint) +0:107 vector swizzle ( temp 3-component vector of uint) +0:107 u: direct index for structure ( temp 4-component vector of uint) +0:107 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:107 Constant: +0:107 0 (const uint) +0:107 direct index ( temp uint) +0:107 'dti' ( in 3-component vector of uint) +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 0 (const int) +0:107 Sequence +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 1 (const int) +0:107 Constant: +0:107 2 (const int) +0:109 move second child to first child ( temp 4-component vector of int) +0:109 i: direct index for structure ( temp 4-component vector of int) +0:109 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:109 Constant: +0:109 0 (const uint) +0:109 direct index ( temp uint) +0:109 'dti' ( in 3-component vector of uint) +0:109 Constant: +0:109 0 (const int) +0:109 Constant: +0:109 1 (const int) +0:109 subgroupOr ( temp 4-component vector of int) +0:109 i: direct index for structure ( temp 4-component vector of int) +0:109 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:109 Constant: +0:109 0 (const uint) +0:109 direct index ( temp uint) +0:109 'dti' ( in 3-component vector of uint) +0:109 Constant: +0:109 0 (const int) +0:109 Constant: +0:109 1 (const int) +0:110 move second child to first child ( temp int) +0:110 direct index ( temp int) +0:110 i: direct index for structure ( temp 4-component vector of int) +0:110 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:110 Constant: +0:110 0 (const uint) +0:110 direct index ( temp uint) +0:110 'dti' ( in 3-component vector of uint) +0:110 Constant: +0:110 0 (const int) +0:110 Constant: +0:110 1 (const int) +0:110 Constant: +0:110 0 (const int) +0:110 subgroupOr ( temp int) +0:110 direct index ( temp int) +0:110 i: direct index for structure ( temp 4-component vector of int) +0:110 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:110 Constant: +0:110 0 (const uint) +0:110 direct index ( temp uint) +0:110 'dti' ( in 3-component vector of uint) +0:110 Constant: +0:110 0 (const int) +0:110 Constant: +0:110 1 (const int) +0:110 Constant: +0:110 0 (const int) +0:111 move second child to first child ( temp 2-component vector of int) +0:111 vector swizzle ( temp 2-component vector of int) +0:111 i: direct index for structure ( temp 4-component vector of int) +0:111 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:111 Constant: +0:111 0 (const uint) +0:111 direct index ( temp uint) +0:111 'dti' ( in 3-component vector of uint) +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:111 Sequence +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:111 subgroupOr ( temp 2-component vector of int) +0:111 vector swizzle ( temp 2-component vector of int) +0:111 i: direct index for structure ( temp 4-component vector of int) +0:111 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:111 Constant: +0:111 0 (const uint) +0:111 direct index ( temp uint) +0:111 'dti' ( in 3-component vector of uint) +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:111 Sequence +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:112 move second child to first child ( temp 3-component vector of int) +0:112 vector swizzle ( temp 3-component vector of int) +0:112 i: direct index for structure ( temp 4-component vector of int) +0:112 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:112 Constant: +0:112 0 (const uint) +0:112 direct index ( temp uint) +0:112 'dti' ( in 3-component vector of uint) +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Sequence +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Constant: +0:112 2 (const int) +0:112 subgroupOr ( temp 3-component vector of int) +0:112 vector swizzle ( temp 3-component vector of int) +0:112 i: direct index for structure ( temp 4-component vector of int) +0:112 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:112 Constant: +0:112 0 (const uint) +0:112 direct index ( temp uint) +0:112 'dti' ( in 3-component vector of uint) +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Sequence +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Constant: +0:112 2 (const int) +0:114 move second child to first child ( temp 4-component vector of uint) +0:114 u: direct index for structure ( temp 4-component vector of uint) +0:114 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:114 Constant: +0:114 0 (const uint) +0:114 direct index ( temp uint) +0:114 'dti' ( in 3-component vector of uint) +0:114 Constant: +0:114 0 (const int) +0:114 Constant: +0:114 0 (const int) +0:114 subgroupXor ( temp 4-component vector of uint) +0:114 u: direct index for structure ( temp 4-component vector of uint) +0:114 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:114 Constant: +0:114 0 (const uint) +0:114 direct index ( temp uint) +0:114 'dti' ( in 3-component vector of uint) +0:114 Constant: +0:114 0 (const int) +0:114 Constant: +0:114 0 (const int) +0:115 move second child to first child ( temp uint) +0:115 direct index ( temp uint) +0:115 u: direct index for structure ( temp 4-component vector of uint) +0:115 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:115 Constant: +0:115 0 (const uint) +0:115 direct index ( temp uint) +0:115 'dti' ( in 3-component vector of uint) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 subgroupXor ( temp uint) +0:115 direct index ( temp uint) +0:115 u: direct index for structure ( temp 4-component vector of uint) +0:115 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:115 Constant: +0:115 0 (const uint) +0:115 direct index ( temp uint) +0:115 'dti' ( in 3-component vector of uint) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:116 move second child to first child ( temp 2-component vector of uint) +0:116 vector swizzle ( temp 2-component vector of uint) +0:116 u: direct index for structure ( temp 4-component vector of uint) +0:116 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:116 Constant: +0:116 0 (const uint) +0:116 direct index ( temp uint) +0:116 'dti' ( in 3-component vector of uint) +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 0 (const int) +0:116 Sequence +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 1 (const int) +0:116 subgroupXor ( temp 2-component vector of uint) +0:116 vector swizzle ( temp 2-component vector of uint) +0:116 u: direct index for structure ( temp 4-component vector of uint) +0:116 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:116 Constant: +0:116 0 (const uint) +0:116 direct index ( temp uint) +0:116 'dti' ( in 3-component vector of uint) +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 0 (const int) +0:116 Sequence +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 1 (const int) +0:117 move second child to first child ( temp 3-component vector of uint) +0:117 vector swizzle ( temp 3-component vector of uint) +0:117 u: direct index for structure ( temp 4-component vector of uint) +0:117 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:117 Constant: +0:117 0 (const uint) +0:117 direct index ( temp uint) +0:117 'dti' ( in 3-component vector of uint) +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 0 (const int) +0:117 Sequence +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 1 (const int) +0:117 Constant: +0:117 2 (const int) +0:117 subgroupXor ( temp 3-component vector of uint) +0:117 vector swizzle ( temp 3-component vector of uint) +0:117 u: direct index for structure ( temp 4-component vector of uint) +0:117 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:117 Constant: +0:117 0 (const uint) +0:117 direct index ( temp uint) +0:117 'dti' ( in 3-component vector of uint) +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 0 (const int) +0:117 Sequence +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 1 (const int) +0:117 Constant: +0:117 2 (const int) +0:119 move second child to first child ( temp 4-component vector of int) +0:119 i: direct index for structure ( temp 4-component vector of int) +0:119 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:119 Constant: +0:119 0 (const uint) +0:119 direct index ( temp uint) +0:119 'dti' ( in 3-component vector of uint) +0:119 Constant: +0:119 0 (const int) +0:119 Constant: +0:119 1 (const int) +0:119 subgroupXor ( temp 4-component vector of int) +0:119 i: direct index for structure ( temp 4-component vector of int) +0:119 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:119 Constant: +0:119 0 (const uint) +0:119 direct index ( temp uint) +0:119 'dti' ( in 3-component vector of uint) +0:119 Constant: +0:119 0 (const int) +0:119 Constant: +0:119 1 (const int) +0:120 move second child to first child ( temp int) +0:120 direct index ( temp int) +0:120 i: direct index for structure ( temp 4-component vector of int) +0:120 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:120 Constant: +0:120 0 (const uint) +0:120 direct index ( temp uint) +0:120 'dti' ( in 3-component vector of uint) +0:120 Constant: +0:120 0 (const int) +0:120 Constant: +0:120 1 (const int) +0:120 Constant: +0:120 0 (const int) +0:120 subgroupXor ( temp int) +0:120 direct index ( temp int) +0:120 i: direct index for structure ( temp 4-component vector of int) +0:120 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:120 Constant: +0:120 0 (const uint) +0:120 direct index ( temp uint) +0:120 'dti' ( in 3-component vector of uint) +0:120 Constant: +0:120 0 (const int) +0:120 Constant: +0:120 1 (const int) +0:120 Constant: +0:120 0 (const int) +0:121 move second child to first child ( temp 2-component vector of int) +0:121 vector swizzle ( temp 2-component vector of int) +0:121 i: direct index for structure ( temp 4-component vector of int) +0:121 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:121 Constant: +0:121 0 (const uint) +0:121 direct index ( temp uint) +0:121 'dti' ( in 3-component vector of uint) +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 Sequence +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 subgroupXor ( temp 2-component vector of int) +0:121 vector swizzle ( temp 2-component vector of int) +0:121 i: direct index for structure ( temp 4-component vector of int) +0:121 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:121 Constant: +0:121 0 (const uint) +0:121 direct index ( temp uint) +0:121 'dti' ( in 3-component vector of uint) +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 Sequence +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:122 move second child to first child ( temp 3-component vector of int) +0:122 vector swizzle ( temp 3-component vector of int) +0:122 i: direct index for structure ( temp 4-component vector of int) +0:122 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:122 Constant: +0:122 0 (const uint) +0:122 direct index ( temp uint) +0:122 'dti' ( in 3-component vector of uint) +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Sequence +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Constant: +0:122 2 (const int) +0:122 subgroupXor ( temp 3-component vector of int) +0:122 vector swizzle ( temp 3-component vector of int) +0:122 i: direct index for structure ( temp 4-component vector of int) +0:122 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:122 Constant: +0:122 0 (const uint) +0:122 direct index ( temp uint) +0:122 'dti' ( in 3-component vector of uint) +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Sequence +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Constant: +0:122 2 (const int) +0:124 move second child to first child ( temp uint) +0:124 direct index ( temp uint) +0:124 u: direct index for structure ( temp 4-component vector of uint) +0:124 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:124 Constant: +0:124 0 (const uint) +0:124 direct index ( temp uint) +0:124 'dti' ( in 3-component vector of uint) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const int) +0:124 subgroupBallotBitCount ( temp uint) +0:124 subgroupBallot ( temp 4-component vector of uint) +0:124 Compare Equal ( temp bool) +0:124 direct index ( temp uint) +0:124 u: direct index for structure ( temp 4-component vector of uint) +0:124 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:124 Constant: +0:124 0 (const uint) +0:124 direct index ( temp uint) +0:124 'dti' ( in 3-component vector of uint) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const uint) +0:13 Function Definition: CSMain( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:13 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 901 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformArithmetic + Capability GroupNonUniformBallot + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "CSMain" 896 + ExecutionMode 4 LocalSize 32 16 1 + Source HLSL 500 + Name 4 "CSMain" + Name 11 "@CSMain(vu3;" + Name 10 "dti" + Name 20 "Types" + MemberName 20(Types) 0 "u" + MemberName 20(Types) 1 "i" + MemberName 20(Types) 2 "f" + MemberName 20(Types) 3 "d" + Name 22 "data" + MemberName 22(data) 0 "@data" + Name 24 "data" + Name 894 "dti" + Name 896 "dti" + Name 898 "param" + MemberDecorate 20(Types) 0 Offset 0 + MemberDecorate 20(Types) 1 Offset 16 + MemberDecorate 20(Types) 2 Offset 32 + MemberDecorate 20(Types) 3 Offset 64 + Decorate 21 ArrayStride 96 + MemberDecorate 22(data) 0 Offset 0 + Decorate 22(data) BufferBlock + Decorate 24(data) DescriptorSet 0 + Decorate 896(dti) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 13: TypeVector 6(int) 4 + 14: TypeInt 32 1 + 15: TypeVector 14(int) 4 + 16: TypeFloat 32 + 17: TypeVector 16(float) 4 + 18: TypeFloat 64 + 19: TypeVector 18(float) 4 + 20(Types): TypeStruct 13(ivec4) 15(ivec4) 17(fvec4) 19(fvec4) + 21: TypeRuntimeArray 20(Types) + 22(data): TypeStruct 21 + 23: TypePointer Uniform 22(data) + 24(data): 23(ptr) Variable Uniform + 25: 14(int) Constant 0 + 26: 6(int) Constant 0 + 27: TypePointer Function 6(int) + 32: TypePointer Uniform 13(ivec4) + 35: 6(int) Constant 3 + 42: TypePointer Uniform 6(int) + 51: TypeVector 6(int) 2 + 72: 14(int) Constant 1 + 75: TypePointer Uniform 15(ivec4) + 84: TypePointer Uniform 14(int) + 93: TypeVector 14(int) 2 + 105: TypeVector 14(int) 3 + 115: 14(int) Constant 2 + 118: TypePointer Uniform 17(fvec4) + 127: TypePointer Uniform 16(float) + 136: TypeVector 16(float) 2 + 148: TypeVector 16(float) 3 + 158: 14(int) Constant 3 + 161: TypePointer Uniform 19(fvec4) + 170: TypePointer Uniform 18(float) + 179: TypeVector 18(float) 2 + 191: TypeVector 18(float) 3 + 889: TypeBool + 895: TypePointer Input 7(ivec3) + 896(dti): 895(ptr) Variable Input + 4(CSMain): 2 Function None 3 + 5: Label + 894(dti): 8(ptr) Variable Function + 898(param): 8(ptr) Variable Function + 897: 7(ivec3) Load 896(dti) + Store 894(dti) 897 + 899: 7(ivec3) Load 894(dti) + Store 898(param) 899 + 900: 2 FunctionCall 11(@CSMain(vu3;) 898(param) + Return + FunctionEnd +11(@CSMain(vu3;): 2 Function None 9 + 10(dti): 8(ptr) FunctionParameter + 12: Label + 28: 27(ptr) AccessChain 10(dti) 26 + 29: 6(int) Load 28 + 30: 27(ptr) AccessChain 10(dti) 26 + 31: 6(int) Load 30 + 33: 32(ptr) AccessChain 24(data) 25 31 25 + 34: 13(ivec4) Load 33 + 36: 13(ivec4) GroupNonUniformIAdd 35 Reduce 34 + 37: 32(ptr) AccessChain 24(data) 25 29 25 + Store 37 36 + 38: 27(ptr) AccessChain 10(dti) 26 + 39: 6(int) Load 38 + 40: 27(ptr) AccessChain 10(dti) 26 + 41: 6(int) Load 40 + 43: 42(ptr) AccessChain 24(data) 25 41 25 26 + 44: 6(int) Load 43 + 45: 6(int) GroupNonUniformIAdd 35 Reduce 44 + 46: 42(ptr) AccessChain 24(data) 25 39 25 26 + Store 46 45 + 47: 27(ptr) AccessChain 10(dti) 26 + 48: 6(int) Load 47 + 49: 27(ptr) AccessChain 10(dti) 26 + 50: 6(int) Load 49 + 52: 32(ptr) AccessChain 24(data) 25 50 25 + 53: 13(ivec4) Load 52 + 54: 51(ivec2) VectorShuffle 53 53 0 1 + 55: 51(ivec2) GroupNonUniformIAdd 35 Reduce 54 + 56: 32(ptr) AccessChain 24(data) 25 48 25 + 57: 13(ivec4) Load 56 + 58: 13(ivec4) VectorShuffle 57 55 4 5 2 3 + Store 56 58 + 59: 27(ptr) AccessChain 10(dti) 26 + 60: 6(int) Load 59 + 61: 27(ptr) AccessChain 10(dti) 26 + 62: 6(int) Load 61 + 63: 32(ptr) AccessChain 24(data) 25 62 25 + 64: 13(ivec4) Load 63 + 65: 7(ivec3) VectorShuffle 64 64 0 1 2 + 66: 7(ivec3) GroupNonUniformIAdd 35 Reduce 65 + 67: 32(ptr) AccessChain 24(data) 25 60 25 + 68: 13(ivec4) Load 67 + 69: 13(ivec4) VectorShuffle 68 66 4 5 6 3 + Store 67 69 + 70: 27(ptr) AccessChain 10(dti) 26 + 71: 6(int) Load 70 + 73: 27(ptr) AccessChain 10(dti) 26 + 74: 6(int) Load 73 + 76: 75(ptr) AccessChain 24(data) 25 74 72 + 77: 15(ivec4) Load 76 + 78: 15(ivec4) GroupNonUniformIAdd 35 Reduce 77 + 79: 75(ptr) AccessChain 24(data) 25 71 72 + Store 79 78 + 80: 27(ptr) AccessChain 10(dti) 26 + 81: 6(int) Load 80 + 82: 27(ptr) AccessChain 10(dti) 26 + 83: 6(int) Load 82 + 85: 84(ptr) AccessChain 24(data) 25 83 72 26 + 86: 14(int) Load 85 + 87: 14(int) GroupNonUniformIAdd 35 Reduce 86 + 88: 84(ptr) AccessChain 24(data) 25 81 72 26 + Store 88 87 + 89: 27(ptr) AccessChain 10(dti) 26 + 90: 6(int) Load 89 + 91: 27(ptr) AccessChain 10(dti) 26 + 92: 6(int) Load 91 + 94: 75(ptr) AccessChain 24(data) 25 92 72 + 95: 15(ivec4) Load 94 + 96: 93(ivec2) VectorShuffle 95 95 0 1 + 97: 93(ivec2) GroupNonUniformIAdd 35 Reduce 96 + 98: 75(ptr) AccessChain 24(data) 25 90 72 + 99: 15(ivec4) Load 98 + 100: 15(ivec4) VectorShuffle 99 97 4 5 2 3 + Store 98 100 + 101: 27(ptr) AccessChain 10(dti) 26 + 102: 6(int) Load 101 + 103: 27(ptr) AccessChain 10(dti) 26 + 104: 6(int) Load 103 + 106: 75(ptr) AccessChain 24(data) 25 104 72 + 107: 15(ivec4) Load 106 + 108: 105(ivec3) VectorShuffle 107 107 0 1 2 + 109: 105(ivec3) GroupNonUniformIAdd 35 Reduce 108 + 110: 75(ptr) AccessChain 24(data) 25 102 72 + 111: 15(ivec4) Load 110 + 112: 15(ivec4) VectorShuffle 111 109 4 5 6 3 + Store 110 112 + 113: 27(ptr) AccessChain 10(dti) 26 + 114: 6(int) Load 113 + 116: 27(ptr) AccessChain 10(dti) 26 + 117: 6(int) Load 116 + 119: 118(ptr) AccessChain 24(data) 25 117 115 + 120: 17(fvec4) Load 119 + 121: 17(fvec4) GroupNonUniformFAdd 35 Reduce 120 + 122: 118(ptr) AccessChain 24(data) 25 114 115 + Store 122 121 + 123: 27(ptr) AccessChain 10(dti) 26 + 124: 6(int) Load 123 + 125: 27(ptr) AccessChain 10(dti) 26 + 126: 6(int) Load 125 + 128: 127(ptr) AccessChain 24(data) 25 126 115 26 + 129: 16(float) Load 128 + 130: 16(float) GroupNonUniformFAdd 35 Reduce 129 + 131: 127(ptr) AccessChain 24(data) 25 124 115 26 + Store 131 130 + 132: 27(ptr) AccessChain 10(dti) 26 + 133: 6(int) Load 132 + 134: 27(ptr) AccessChain 10(dti) 26 + 135: 6(int) Load 134 + 137: 118(ptr) AccessChain 24(data) 25 135 115 + 138: 17(fvec4) Load 137 + 139: 136(fvec2) VectorShuffle 138 138 0 1 + 140: 136(fvec2) GroupNonUniformFAdd 35 Reduce 139 + 141: 118(ptr) AccessChain 24(data) 25 133 115 + 142: 17(fvec4) Load 141 + 143: 17(fvec4) VectorShuffle 142 140 4 5 2 3 + Store 141 143 + 144: 27(ptr) AccessChain 10(dti) 26 + 145: 6(int) Load 144 + 146: 27(ptr) AccessChain 10(dti) 26 + 147: 6(int) Load 146 + 149: 118(ptr) AccessChain 24(data) 25 147 115 + 150: 17(fvec4) Load 149 + 151: 148(fvec3) VectorShuffle 150 150 0 1 2 + 152: 148(fvec3) GroupNonUniformFAdd 35 Reduce 151 + 153: 118(ptr) AccessChain 24(data) 25 145 115 + 154: 17(fvec4) Load 153 + 155: 17(fvec4) VectorShuffle 154 152 4 5 6 3 + Store 153 155 + 156: 27(ptr) AccessChain 10(dti) 26 + 157: 6(int) Load 156 + 159: 27(ptr) AccessChain 10(dti) 26 + 160: 6(int) Load 159 + 162: 161(ptr) AccessChain 24(data) 25 160 158 + 163: 19(fvec4) Load 162 + 164: 19(fvec4) GroupNonUniformFAdd 35 Reduce 163 + 165: 161(ptr) AccessChain 24(data) 25 157 158 + Store 165 164 + 166: 27(ptr) AccessChain 10(dti) 26 + 167: 6(int) Load 166 + 168: 27(ptr) AccessChain 10(dti) 26 + 169: 6(int) Load 168 + 171: 170(ptr) AccessChain 24(data) 25 169 158 26 + 172: 18(float) Load 171 + 173: 18(float) GroupNonUniformFAdd 35 Reduce 172 + 174: 170(ptr) AccessChain 24(data) 25 167 158 26 + Store 174 173 + 175: 27(ptr) AccessChain 10(dti) 26 + 176: 6(int) Load 175 + 177: 27(ptr) AccessChain 10(dti) 26 + 178: 6(int) Load 177 + 180: 161(ptr) AccessChain 24(data) 25 178 158 + 181: 19(fvec4) Load 180 + 182: 179(fvec2) VectorShuffle 181 181 0 1 + 183: 179(fvec2) GroupNonUniformFAdd 35 Reduce 182 + 184: 161(ptr) AccessChain 24(data) 25 176 158 + 185: 19(fvec4) Load 184 + 186: 19(fvec4) VectorShuffle 185 183 4 5 2 3 + Store 184 186 + 187: 27(ptr) AccessChain 10(dti) 26 + 188: 6(int) Load 187 + 189: 27(ptr) AccessChain 10(dti) 26 + 190: 6(int) Load 189 + 192: 161(ptr) AccessChain 24(data) 25 190 158 + 193: 19(fvec4) Load 192 + 194: 191(fvec3) VectorShuffle 193 193 0 1 2 + 195: 191(fvec3) GroupNonUniformFAdd 35 Reduce 194 + 196: 161(ptr) AccessChain 24(data) 25 188 158 + 197: 19(fvec4) Load 196 + 198: 19(fvec4) VectorShuffle 197 195 4 5 6 3 + Store 196 198 + 199: 27(ptr) AccessChain 10(dti) 26 + 200: 6(int) Load 199 + 201: 27(ptr) AccessChain 10(dti) 26 + 202: 6(int) Load 201 + 203: 32(ptr) AccessChain 24(data) 25 202 25 + 204: 13(ivec4) Load 203 + 205: 13(ivec4) GroupNonUniformIMul 35 Reduce 204 + 206: 32(ptr) AccessChain 24(data) 25 200 25 + Store 206 205 + 207: 27(ptr) AccessChain 10(dti) 26 + 208: 6(int) Load 207 + 209: 27(ptr) AccessChain 10(dti) 26 + 210: 6(int) Load 209 + 211: 42(ptr) AccessChain 24(data) 25 210 25 26 + 212: 6(int) Load 211 + 213: 6(int) GroupNonUniformIMul 35 Reduce 212 + 214: 42(ptr) AccessChain 24(data) 25 208 25 26 + Store 214 213 + 215: 27(ptr) AccessChain 10(dti) 26 + 216: 6(int) Load 215 + 217: 27(ptr) AccessChain 10(dti) 26 + 218: 6(int) Load 217 + 219: 32(ptr) AccessChain 24(data) 25 218 25 + 220: 13(ivec4) Load 219 + 221: 51(ivec2) VectorShuffle 220 220 0 1 + 222: 51(ivec2) GroupNonUniformIMul 35 Reduce 221 + 223: 32(ptr) AccessChain 24(data) 25 216 25 + 224: 13(ivec4) Load 223 + 225: 13(ivec4) VectorShuffle 224 222 4 5 2 3 + Store 223 225 + 226: 27(ptr) AccessChain 10(dti) 26 + 227: 6(int) Load 226 + 228: 27(ptr) AccessChain 10(dti) 26 + 229: 6(int) Load 228 + 230: 32(ptr) AccessChain 24(data) 25 229 25 + 231: 13(ivec4) Load 230 + 232: 7(ivec3) VectorShuffle 231 231 0 1 2 + 233: 7(ivec3) GroupNonUniformIMul 35 Reduce 232 + 234: 32(ptr) AccessChain 24(data) 25 227 25 + 235: 13(ivec4) Load 234 + 236: 13(ivec4) VectorShuffle 235 233 4 5 6 3 + Store 234 236 + 237: 27(ptr) AccessChain 10(dti) 26 + 238: 6(int) Load 237 + 239: 27(ptr) AccessChain 10(dti) 26 + 240: 6(int) Load 239 + 241: 75(ptr) AccessChain 24(data) 25 240 72 + 242: 15(ivec4) Load 241 + 243: 15(ivec4) GroupNonUniformIMul 35 Reduce 242 + 244: 75(ptr) AccessChain 24(data) 25 238 72 + Store 244 243 + 245: 27(ptr) AccessChain 10(dti) 26 + 246: 6(int) Load 245 + 247: 27(ptr) AccessChain 10(dti) 26 + 248: 6(int) Load 247 + 249: 84(ptr) AccessChain 24(data) 25 248 72 26 + 250: 14(int) Load 249 + 251: 14(int) GroupNonUniformIMul 35 Reduce 250 + 252: 84(ptr) AccessChain 24(data) 25 246 72 26 + Store 252 251 + 253: 27(ptr) AccessChain 10(dti) 26 + 254: 6(int) Load 253 + 255: 27(ptr) AccessChain 10(dti) 26 + 256: 6(int) Load 255 + 257: 75(ptr) AccessChain 24(data) 25 256 72 + 258: 15(ivec4) Load 257 + 259: 93(ivec2) VectorShuffle 258 258 0 1 + 260: 93(ivec2) GroupNonUniformIMul 35 Reduce 259 + 261: 75(ptr) AccessChain 24(data) 25 254 72 + 262: 15(ivec4) Load 261 + 263: 15(ivec4) VectorShuffle 262 260 4 5 2 3 + Store 261 263 + 264: 27(ptr) AccessChain 10(dti) 26 + 265: 6(int) Load 264 + 266: 27(ptr) AccessChain 10(dti) 26 + 267: 6(int) Load 266 + 268: 75(ptr) AccessChain 24(data) 25 267 72 + 269: 15(ivec4) Load 268 + 270: 105(ivec3) VectorShuffle 269 269 0 1 2 + 271: 105(ivec3) GroupNonUniformIMul 35 Reduce 270 + 272: 75(ptr) AccessChain 24(data) 25 265 72 + 273: 15(ivec4) Load 272 + 274: 15(ivec4) VectorShuffle 273 271 4 5 6 3 + Store 272 274 + 275: 27(ptr) AccessChain 10(dti) 26 + 276: 6(int) Load 275 + 277: 27(ptr) AccessChain 10(dti) 26 + 278: 6(int) Load 277 + 279: 118(ptr) AccessChain 24(data) 25 278 115 + 280: 17(fvec4) Load 279 + 281: 17(fvec4) GroupNonUniformFMul 35 Reduce 280 + 282: 118(ptr) AccessChain 24(data) 25 276 115 + Store 282 281 + 283: 27(ptr) AccessChain 10(dti) 26 + 284: 6(int) Load 283 + 285: 27(ptr) AccessChain 10(dti) 26 + 286: 6(int) Load 285 + 287: 127(ptr) AccessChain 24(data) 25 286 115 26 + 288: 16(float) Load 287 + 289: 16(float) GroupNonUniformFMul 35 Reduce 288 + 290: 127(ptr) AccessChain 24(data) 25 284 115 26 + Store 290 289 + 291: 27(ptr) AccessChain 10(dti) 26 + 292: 6(int) Load 291 + 293: 27(ptr) AccessChain 10(dti) 26 + 294: 6(int) Load 293 + 295: 118(ptr) AccessChain 24(data) 25 294 115 + 296: 17(fvec4) Load 295 + 297: 136(fvec2) VectorShuffle 296 296 0 1 + 298: 136(fvec2) GroupNonUniformFMul 35 Reduce 297 + 299: 118(ptr) AccessChain 24(data) 25 292 115 + 300: 17(fvec4) Load 299 + 301: 17(fvec4) VectorShuffle 300 298 4 5 2 3 + Store 299 301 + 302: 27(ptr) AccessChain 10(dti) 26 + 303: 6(int) Load 302 + 304: 27(ptr) AccessChain 10(dti) 26 + 305: 6(int) Load 304 + 306: 118(ptr) AccessChain 24(data) 25 305 115 + 307: 17(fvec4) Load 306 + 308: 148(fvec3) VectorShuffle 307 307 0 1 2 + 309: 148(fvec3) GroupNonUniformFMul 35 Reduce 308 + 310: 118(ptr) AccessChain 24(data) 25 303 115 + 311: 17(fvec4) Load 310 + 312: 17(fvec4) VectorShuffle 311 309 4 5 6 3 + Store 310 312 + 313: 27(ptr) AccessChain 10(dti) 26 + 314: 6(int) Load 313 + 315: 27(ptr) AccessChain 10(dti) 26 + 316: 6(int) Load 315 + 317: 161(ptr) AccessChain 24(data) 25 316 158 + 318: 19(fvec4) Load 317 + 319: 19(fvec4) GroupNonUniformFMul 35 Reduce 318 + 320: 161(ptr) AccessChain 24(data) 25 314 158 + Store 320 319 + 321: 27(ptr) AccessChain 10(dti) 26 + 322: 6(int) Load 321 + 323: 27(ptr) AccessChain 10(dti) 26 + 324: 6(int) Load 323 + 325: 170(ptr) AccessChain 24(data) 25 324 158 26 + 326: 18(float) Load 325 + 327: 18(float) GroupNonUniformFMul 35 Reduce 326 + 328: 170(ptr) AccessChain 24(data) 25 322 158 26 + Store 328 327 + 329: 27(ptr) AccessChain 10(dti) 26 + 330: 6(int) Load 329 + 331: 27(ptr) AccessChain 10(dti) 26 + 332: 6(int) Load 331 + 333: 161(ptr) AccessChain 24(data) 25 332 158 + 334: 19(fvec4) Load 333 + 335: 179(fvec2) VectorShuffle 334 334 0 1 + 336: 179(fvec2) GroupNonUniformFMul 35 Reduce 335 + 337: 161(ptr) AccessChain 24(data) 25 330 158 + 338: 19(fvec4) Load 337 + 339: 19(fvec4) VectorShuffle 338 336 4 5 2 3 + Store 337 339 + 340: 27(ptr) AccessChain 10(dti) 26 + 341: 6(int) Load 340 + 342: 27(ptr) AccessChain 10(dti) 26 + 343: 6(int) Load 342 + 344: 161(ptr) AccessChain 24(data) 25 343 158 + 345: 19(fvec4) Load 344 + 346: 191(fvec3) VectorShuffle 345 345 0 1 2 + 347: 191(fvec3) GroupNonUniformFMul 35 Reduce 346 + 348: 161(ptr) AccessChain 24(data) 25 341 158 + 349: 19(fvec4) Load 348 + 350: 19(fvec4) VectorShuffle 349 347 4 5 6 3 + Store 348 350 + 351: 27(ptr) AccessChain 10(dti) 26 + 352: 6(int) Load 351 + 353: 27(ptr) AccessChain 10(dti) 26 + 354: 6(int) Load 353 + 355: 32(ptr) AccessChain 24(data) 25 354 25 + 356: 13(ivec4) Load 355 + 357: 13(ivec4) GroupNonUniformUMin 35 Reduce 356 + 358: 32(ptr) AccessChain 24(data) 25 352 25 + Store 358 357 + 359: 27(ptr) AccessChain 10(dti) 26 + 360: 6(int) Load 359 + 361: 27(ptr) AccessChain 10(dti) 26 + 362: 6(int) Load 361 + 363: 42(ptr) AccessChain 24(data) 25 362 25 26 + 364: 6(int) Load 363 + 365: 6(int) GroupNonUniformUMin 35 Reduce 364 + 366: 42(ptr) AccessChain 24(data) 25 360 25 26 + Store 366 365 + 367: 27(ptr) AccessChain 10(dti) 26 + 368: 6(int) Load 367 + 369: 27(ptr) AccessChain 10(dti) 26 + 370: 6(int) Load 369 + 371: 32(ptr) AccessChain 24(data) 25 370 25 + 372: 13(ivec4) Load 371 + 373: 51(ivec2) VectorShuffle 372 372 0 1 + 374: 51(ivec2) GroupNonUniformUMin 35 Reduce 373 + 375: 32(ptr) AccessChain 24(data) 25 368 25 + 376: 13(ivec4) Load 375 + 377: 13(ivec4) VectorShuffle 376 374 4 5 2 3 + Store 375 377 + 378: 27(ptr) AccessChain 10(dti) 26 + 379: 6(int) Load 378 + 380: 27(ptr) AccessChain 10(dti) 26 + 381: 6(int) Load 380 + 382: 32(ptr) AccessChain 24(data) 25 381 25 + 383: 13(ivec4) Load 382 + 384: 7(ivec3) VectorShuffle 383 383 0 1 2 + 385: 7(ivec3) GroupNonUniformUMin 35 Reduce 384 + 386: 32(ptr) AccessChain 24(data) 25 379 25 + 387: 13(ivec4) Load 386 + 388: 13(ivec4) VectorShuffle 387 385 4 5 6 3 + Store 386 388 + 389: 27(ptr) AccessChain 10(dti) 26 + 390: 6(int) Load 389 + 391: 27(ptr) AccessChain 10(dti) 26 + 392: 6(int) Load 391 + 393: 75(ptr) AccessChain 24(data) 25 392 72 + 394: 15(ivec4) Load 393 + 395: 15(ivec4) GroupNonUniformSMin 35 Reduce 394 + 396: 75(ptr) AccessChain 24(data) 25 390 72 + Store 396 395 + 397: 27(ptr) AccessChain 10(dti) 26 + 398: 6(int) Load 397 + 399: 27(ptr) AccessChain 10(dti) 26 + 400: 6(int) Load 399 + 401: 84(ptr) AccessChain 24(data) 25 400 72 26 + 402: 14(int) Load 401 + 403: 14(int) GroupNonUniformSMin 35 Reduce 402 + 404: 84(ptr) AccessChain 24(data) 25 398 72 26 + Store 404 403 + 405: 27(ptr) AccessChain 10(dti) 26 + 406: 6(int) Load 405 + 407: 27(ptr) AccessChain 10(dti) 26 + 408: 6(int) Load 407 + 409: 75(ptr) AccessChain 24(data) 25 408 72 + 410: 15(ivec4) Load 409 + 411: 93(ivec2) VectorShuffle 410 410 0 1 + 412: 93(ivec2) GroupNonUniformSMin 35 Reduce 411 + 413: 75(ptr) AccessChain 24(data) 25 406 72 + 414: 15(ivec4) Load 413 + 415: 15(ivec4) VectorShuffle 414 412 4 5 2 3 + Store 413 415 + 416: 27(ptr) AccessChain 10(dti) 26 + 417: 6(int) Load 416 + 418: 27(ptr) AccessChain 10(dti) 26 + 419: 6(int) Load 418 + 420: 75(ptr) AccessChain 24(data) 25 419 72 + 421: 15(ivec4) Load 420 + 422: 105(ivec3) VectorShuffle 421 421 0 1 2 + 423: 105(ivec3) GroupNonUniformSMin 35 Reduce 422 + 424: 75(ptr) AccessChain 24(data) 25 417 72 + 425: 15(ivec4) Load 424 + 426: 15(ivec4) VectorShuffle 425 423 4 5 6 3 + Store 424 426 + 427: 27(ptr) AccessChain 10(dti) 26 + 428: 6(int) Load 427 + 429: 27(ptr) AccessChain 10(dti) 26 + 430: 6(int) Load 429 + 431: 118(ptr) AccessChain 24(data) 25 430 115 + 432: 17(fvec4) Load 431 + 433: 17(fvec4) GroupNonUniformFMin 35 Reduce 432 + 434: 118(ptr) AccessChain 24(data) 25 428 115 + Store 434 433 + 435: 27(ptr) AccessChain 10(dti) 26 + 436: 6(int) Load 435 + 437: 27(ptr) AccessChain 10(dti) 26 + 438: 6(int) Load 437 + 439: 127(ptr) AccessChain 24(data) 25 438 115 26 + 440: 16(float) Load 439 + 441: 16(float) GroupNonUniformFMin 35 Reduce 440 + 442: 127(ptr) AccessChain 24(data) 25 436 115 26 + Store 442 441 + 443: 27(ptr) AccessChain 10(dti) 26 + 444: 6(int) Load 443 + 445: 27(ptr) AccessChain 10(dti) 26 + 446: 6(int) Load 445 + 447: 118(ptr) AccessChain 24(data) 25 446 115 + 448: 17(fvec4) Load 447 + 449: 136(fvec2) VectorShuffle 448 448 0 1 + 450: 136(fvec2) GroupNonUniformFMin 35 Reduce 449 + 451: 118(ptr) AccessChain 24(data) 25 444 115 + 452: 17(fvec4) Load 451 + 453: 17(fvec4) VectorShuffle 452 450 4 5 2 3 + Store 451 453 + 454: 27(ptr) AccessChain 10(dti) 26 + 455: 6(int) Load 454 + 456: 27(ptr) AccessChain 10(dti) 26 + 457: 6(int) Load 456 + 458: 118(ptr) AccessChain 24(data) 25 457 115 + 459: 17(fvec4) Load 458 + 460: 148(fvec3) VectorShuffle 459 459 0 1 2 + 461: 148(fvec3) GroupNonUniformFMin 35 Reduce 460 + 462: 118(ptr) AccessChain 24(data) 25 455 115 + 463: 17(fvec4) Load 462 + 464: 17(fvec4) VectorShuffle 463 461 4 5 6 3 + Store 462 464 + 465: 27(ptr) AccessChain 10(dti) 26 + 466: 6(int) Load 465 + 467: 27(ptr) AccessChain 10(dti) 26 + 468: 6(int) Load 467 + 469: 161(ptr) AccessChain 24(data) 25 468 158 + 470: 19(fvec4) Load 469 + 471: 19(fvec4) GroupNonUniformFMin 35 Reduce 470 + 472: 161(ptr) AccessChain 24(data) 25 466 158 + Store 472 471 + 473: 27(ptr) AccessChain 10(dti) 26 + 474: 6(int) Load 473 + 475: 27(ptr) AccessChain 10(dti) 26 + 476: 6(int) Load 475 + 477: 170(ptr) AccessChain 24(data) 25 476 158 26 + 478: 18(float) Load 477 + 479: 18(float) GroupNonUniformFMin 35 Reduce 478 + 480: 170(ptr) AccessChain 24(data) 25 474 158 26 + Store 480 479 + 481: 27(ptr) AccessChain 10(dti) 26 + 482: 6(int) Load 481 + 483: 27(ptr) AccessChain 10(dti) 26 + 484: 6(int) Load 483 + 485: 161(ptr) AccessChain 24(data) 25 484 158 + 486: 19(fvec4) Load 485 + 487: 179(fvec2) VectorShuffle 486 486 0 1 + 488: 179(fvec2) GroupNonUniformFMin 35 Reduce 487 + 489: 161(ptr) AccessChain 24(data) 25 482 158 + 490: 19(fvec4) Load 489 + 491: 19(fvec4) VectorShuffle 490 488 4 5 2 3 + Store 489 491 + 492: 27(ptr) AccessChain 10(dti) 26 + 493: 6(int) Load 492 + 494: 27(ptr) AccessChain 10(dti) 26 + 495: 6(int) Load 494 + 496: 161(ptr) AccessChain 24(data) 25 495 158 + 497: 19(fvec4) Load 496 + 498: 191(fvec3) VectorShuffle 497 497 0 1 2 + 499: 191(fvec3) GroupNonUniformFMin 35 Reduce 498 + 500: 161(ptr) AccessChain 24(data) 25 493 158 + 501: 19(fvec4) Load 500 + 502: 19(fvec4) VectorShuffle 501 499 4 5 6 3 + Store 500 502 + 503: 27(ptr) AccessChain 10(dti) 26 + 504: 6(int) Load 503 + 505: 27(ptr) AccessChain 10(dti) 26 + 506: 6(int) Load 505 + 507: 32(ptr) AccessChain 24(data) 25 506 25 + 508: 13(ivec4) Load 507 + 509: 13(ivec4) GroupNonUniformUMax 35 Reduce 508 + 510: 32(ptr) AccessChain 24(data) 25 504 25 + Store 510 509 + 511: 27(ptr) AccessChain 10(dti) 26 + 512: 6(int) Load 511 + 513: 27(ptr) AccessChain 10(dti) 26 + 514: 6(int) Load 513 + 515: 42(ptr) AccessChain 24(data) 25 514 25 26 + 516: 6(int) Load 515 + 517: 6(int) GroupNonUniformUMax 35 Reduce 516 + 518: 42(ptr) AccessChain 24(data) 25 512 25 26 + Store 518 517 + 519: 27(ptr) AccessChain 10(dti) 26 + 520: 6(int) Load 519 + 521: 27(ptr) AccessChain 10(dti) 26 + 522: 6(int) Load 521 + 523: 32(ptr) AccessChain 24(data) 25 522 25 + 524: 13(ivec4) Load 523 + 525: 51(ivec2) VectorShuffle 524 524 0 1 + 526: 51(ivec2) GroupNonUniformUMax 35 Reduce 525 + 527: 32(ptr) AccessChain 24(data) 25 520 25 + 528: 13(ivec4) Load 527 + 529: 13(ivec4) VectorShuffle 528 526 4 5 2 3 + Store 527 529 + 530: 27(ptr) AccessChain 10(dti) 26 + 531: 6(int) Load 530 + 532: 27(ptr) AccessChain 10(dti) 26 + 533: 6(int) Load 532 + 534: 32(ptr) AccessChain 24(data) 25 533 25 + 535: 13(ivec4) Load 534 + 536: 7(ivec3) VectorShuffle 535 535 0 1 2 + 537: 7(ivec3) GroupNonUniformUMax 35 Reduce 536 + 538: 32(ptr) AccessChain 24(data) 25 531 25 + 539: 13(ivec4) Load 538 + 540: 13(ivec4) VectorShuffle 539 537 4 5 6 3 + Store 538 540 + 541: 27(ptr) AccessChain 10(dti) 26 + 542: 6(int) Load 541 + 543: 27(ptr) AccessChain 10(dti) 26 + 544: 6(int) Load 543 + 545: 75(ptr) AccessChain 24(data) 25 544 72 + 546: 15(ivec4) Load 545 + 547: 15(ivec4) GroupNonUniformSMax 35 Reduce 546 + 548: 75(ptr) AccessChain 24(data) 25 542 72 + Store 548 547 + 549: 27(ptr) AccessChain 10(dti) 26 + 550: 6(int) Load 549 + 551: 27(ptr) AccessChain 10(dti) 26 + 552: 6(int) Load 551 + 553: 84(ptr) AccessChain 24(data) 25 552 72 26 + 554: 14(int) Load 553 + 555: 14(int) GroupNonUniformSMax 35 Reduce 554 + 556: 84(ptr) AccessChain 24(data) 25 550 72 26 + Store 556 555 + 557: 27(ptr) AccessChain 10(dti) 26 + 558: 6(int) Load 557 + 559: 27(ptr) AccessChain 10(dti) 26 + 560: 6(int) Load 559 + 561: 75(ptr) AccessChain 24(data) 25 560 72 + 562: 15(ivec4) Load 561 + 563: 93(ivec2) VectorShuffle 562 562 0 1 + 564: 93(ivec2) GroupNonUniformSMax 35 Reduce 563 + 565: 75(ptr) AccessChain 24(data) 25 558 72 + 566: 15(ivec4) Load 565 + 567: 15(ivec4) VectorShuffle 566 564 4 5 2 3 + Store 565 567 + 568: 27(ptr) AccessChain 10(dti) 26 + 569: 6(int) Load 568 + 570: 27(ptr) AccessChain 10(dti) 26 + 571: 6(int) Load 570 + 572: 75(ptr) AccessChain 24(data) 25 571 72 + 573: 15(ivec4) Load 572 + 574: 105(ivec3) VectorShuffle 573 573 0 1 2 + 575: 105(ivec3) GroupNonUniformSMax 35 Reduce 574 + 576: 75(ptr) AccessChain 24(data) 25 569 72 + 577: 15(ivec4) Load 576 + 578: 15(ivec4) VectorShuffle 577 575 4 5 6 3 + Store 576 578 + 579: 27(ptr) AccessChain 10(dti) 26 + 580: 6(int) Load 579 + 581: 27(ptr) AccessChain 10(dti) 26 + 582: 6(int) Load 581 + 583: 118(ptr) AccessChain 24(data) 25 582 115 + 584: 17(fvec4) Load 583 + 585: 17(fvec4) GroupNonUniformFMax 35 Reduce 584 + 586: 118(ptr) AccessChain 24(data) 25 580 115 + Store 586 585 + 587: 27(ptr) AccessChain 10(dti) 26 + 588: 6(int) Load 587 + 589: 27(ptr) AccessChain 10(dti) 26 + 590: 6(int) Load 589 + 591: 127(ptr) AccessChain 24(data) 25 590 115 26 + 592: 16(float) Load 591 + 593: 16(float) GroupNonUniformFMax 35 Reduce 592 + 594: 127(ptr) AccessChain 24(data) 25 588 115 26 + Store 594 593 + 595: 27(ptr) AccessChain 10(dti) 26 + 596: 6(int) Load 595 + 597: 27(ptr) AccessChain 10(dti) 26 + 598: 6(int) Load 597 + 599: 118(ptr) AccessChain 24(data) 25 598 115 + 600: 17(fvec4) Load 599 + 601: 136(fvec2) VectorShuffle 600 600 0 1 + 602: 136(fvec2) GroupNonUniformFMax 35 Reduce 601 + 603: 118(ptr) AccessChain 24(data) 25 596 115 + 604: 17(fvec4) Load 603 + 605: 17(fvec4) VectorShuffle 604 602 4 5 2 3 + Store 603 605 + 606: 27(ptr) AccessChain 10(dti) 26 + 607: 6(int) Load 606 + 608: 27(ptr) AccessChain 10(dti) 26 + 609: 6(int) Load 608 + 610: 118(ptr) AccessChain 24(data) 25 609 115 + 611: 17(fvec4) Load 610 + 612: 148(fvec3) VectorShuffle 611 611 0 1 2 + 613: 148(fvec3) GroupNonUniformFMax 35 Reduce 612 + 614: 118(ptr) AccessChain 24(data) 25 607 115 + 615: 17(fvec4) Load 614 + 616: 17(fvec4) VectorShuffle 615 613 4 5 6 3 + Store 614 616 + 617: 27(ptr) AccessChain 10(dti) 26 + 618: 6(int) Load 617 + 619: 27(ptr) AccessChain 10(dti) 26 + 620: 6(int) Load 619 + 621: 161(ptr) AccessChain 24(data) 25 620 158 + 622: 19(fvec4) Load 621 + 623: 19(fvec4) GroupNonUniformFMax 35 Reduce 622 + 624: 161(ptr) AccessChain 24(data) 25 618 158 + Store 624 623 + 625: 27(ptr) AccessChain 10(dti) 26 + 626: 6(int) Load 625 + 627: 27(ptr) AccessChain 10(dti) 26 + 628: 6(int) Load 627 + 629: 170(ptr) AccessChain 24(data) 25 628 158 26 + 630: 18(float) Load 629 + 631: 18(float) GroupNonUniformFMax 35 Reduce 630 + 632: 170(ptr) AccessChain 24(data) 25 626 158 26 + Store 632 631 + 633: 27(ptr) AccessChain 10(dti) 26 + 634: 6(int) Load 633 + 635: 27(ptr) AccessChain 10(dti) 26 + 636: 6(int) Load 635 + 637: 161(ptr) AccessChain 24(data) 25 636 158 + 638: 19(fvec4) Load 637 + 639: 179(fvec2) VectorShuffle 638 638 0 1 + 640: 179(fvec2) GroupNonUniformFMax 35 Reduce 639 + 641: 161(ptr) AccessChain 24(data) 25 634 158 + 642: 19(fvec4) Load 641 + 643: 19(fvec4) VectorShuffle 642 640 4 5 2 3 + Store 641 643 + 644: 27(ptr) AccessChain 10(dti) 26 + 645: 6(int) Load 644 + 646: 27(ptr) AccessChain 10(dti) 26 + 647: 6(int) Load 646 + 648: 161(ptr) AccessChain 24(data) 25 647 158 + 649: 19(fvec4) Load 648 + 650: 191(fvec3) VectorShuffle 649 649 0 1 2 + 651: 191(fvec3) GroupNonUniformFMax 35 Reduce 650 + 652: 161(ptr) AccessChain 24(data) 25 645 158 + 653: 19(fvec4) Load 652 + 654: 19(fvec4) VectorShuffle 653 651 4 5 6 3 + Store 652 654 + 655: 27(ptr) AccessChain 10(dti) 26 + 656: 6(int) Load 655 + 657: 27(ptr) AccessChain 10(dti) 26 + 658: 6(int) Load 657 + 659: 32(ptr) AccessChain 24(data) 25 658 25 + 660: 13(ivec4) Load 659 + 661: 13(ivec4) GroupNonUniformBitwiseAnd 35 Reduce 660 + 662: 32(ptr) AccessChain 24(data) 25 656 25 + Store 662 661 + 663: 27(ptr) AccessChain 10(dti) 26 + 664: 6(int) Load 663 + 665: 27(ptr) AccessChain 10(dti) 26 + 666: 6(int) Load 665 + 667: 42(ptr) AccessChain 24(data) 25 666 25 26 + 668: 6(int) Load 667 + 669: 6(int) GroupNonUniformBitwiseAnd 35 Reduce 668 + 670: 42(ptr) AccessChain 24(data) 25 664 25 26 + Store 670 669 + 671: 27(ptr) AccessChain 10(dti) 26 + 672: 6(int) Load 671 + 673: 27(ptr) AccessChain 10(dti) 26 + 674: 6(int) Load 673 + 675: 32(ptr) AccessChain 24(data) 25 674 25 + 676: 13(ivec4) Load 675 + 677: 51(ivec2) VectorShuffle 676 676 0 1 + 678: 51(ivec2) GroupNonUniformBitwiseAnd 35 Reduce 677 + 679: 32(ptr) AccessChain 24(data) 25 672 25 + 680: 13(ivec4) Load 679 + 681: 13(ivec4) VectorShuffle 680 678 4 5 2 3 + Store 679 681 + 682: 27(ptr) AccessChain 10(dti) 26 + 683: 6(int) Load 682 + 684: 27(ptr) AccessChain 10(dti) 26 + 685: 6(int) Load 684 + 686: 32(ptr) AccessChain 24(data) 25 685 25 + 687: 13(ivec4) Load 686 + 688: 7(ivec3) VectorShuffle 687 687 0 1 2 + 689: 7(ivec3) GroupNonUniformBitwiseAnd 35 Reduce 688 + 690: 32(ptr) AccessChain 24(data) 25 683 25 + 691: 13(ivec4) Load 690 + 692: 13(ivec4) VectorShuffle 691 689 4 5 6 3 + Store 690 692 + 693: 27(ptr) AccessChain 10(dti) 26 + 694: 6(int) Load 693 + 695: 27(ptr) AccessChain 10(dti) 26 + 696: 6(int) Load 695 + 697: 75(ptr) AccessChain 24(data) 25 696 72 + 698: 15(ivec4) Load 697 + 699: 15(ivec4) GroupNonUniformBitwiseAnd 35 Reduce 698 + 700: 75(ptr) AccessChain 24(data) 25 694 72 + Store 700 699 + 701: 27(ptr) AccessChain 10(dti) 26 + 702: 6(int) Load 701 + 703: 27(ptr) AccessChain 10(dti) 26 + 704: 6(int) Load 703 + 705: 84(ptr) AccessChain 24(data) 25 704 72 26 + 706: 14(int) Load 705 + 707: 14(int) GroupNonUniformBitwiseAnd 35 Reduce 706 + 708: 84(ptr) AccessChain 24(data) 25 702 72 26 + Store 708 707 + 709: 27(ptr) AccessChain 10(dti) 26 + 710: 6(int) Load 709 + 711: 27(ptr) AccessChain 10(dti) 26 + 712: 6(int) Load 711 + 713: 75(ptr) AccessChain 24(data) 25 712 72 + 714: 15(ivec4) Load 713 + 715: 93(ivec2) VectorShuffle 714 714 0 1 + 716: 93(ivec2) GroupNonUniformBitwiseAnd 35 Reduce 715 + 717: 75(ptr) AccessChain 24(data) 25 710 72 + 718: 15(ivec4) Load 717 + 719: 15(ivec4) VectorShuffle 718 716 4 5 2 3 + Store 717 719 + 720: 27(ptr) AccessChain 10(dti) 26 + 721: 6(int) Load 720 + 722: 27(ptr) AccessChain 10(dti) 26 + 723: 6(int) Load 722 + 724: 75(ptr) AccessChain 24(data) 25 723 72 + 725: 15(ivec4) Load 724 + 726: 105(ivec3) VectorShuffle 725 725 0 1 2 + 727: 105(ivec3) GroupNonUniformBitwiseAnd 35 Reduce 726 + 728: 75(ptr) AccessChain 24(data) 25 721 72 + 729: 15(ivec4) Load 728 + 730: 15(ivec4) VectorShuffle 729 727 4 5 6 3 + Store 728 730 + 731: 27(ptr) AccessChain 10(dti) 26 + 732: 6(int) Load 731 + 733: 27(ptr) AccessChain 10(dti) 26 + 734: 6(int) Load 733 + 735: 32(ptr) AccessChain 24(data) 25 734 25 + 736: 13(ivec4) Load 735 + 737: 13(ivec4) GroupNonUniformBitwiseOr 35 Reduce 736 + 738: 32(ptr) AccessChain 24(data) 25 732 25 + Store 738 737 + 739: 27(ptr) AccessChain 10(dti) 26 + 740: 6(int) Load 739 + 741: 27(ptr) AccessChain 10(dti) 26 + 742: 6(int) Load 741 + 743: 42(ptr) AccessChain 24(data) 25 742 25 26 + 744: 6(int) Load 743 + 745: 6(int) GroupNonUniformBitwiseOr 35 Reduce 744 + 746: 42(ptr) AccessChain 24(data) 25 740 25 26 + Store 746 745 + 747: 27(ptr) AccessChain 10(dti) 26 + 748: 6(int) Load 747 + 749: 27(ptr) AccessChain 10(dti) 26 + 750: 6(int) Load 749 + 751: 32(ptr) AccessChain 24(data) 25 750 25 + 752: 13(ivec4) Load 751 + 753: 51(ivec2) VectorShuffle 752 752 0 1 + 754: 51(ivec2) GroupNonUniformBitwiseOr 35 Reduce 753 + 755: 32(ptr) AccessChain 24(data) 25 748 25 + 756: 13(ivec4) Load 755 + 757: 13(ivec4) VectorShuffle 756 754 4 5 2 3 + Store 755 757 + 758: 27(ptr) AccessChain 10(dti) 26 + 759: 6(int) Load 758 + 760: 27(ptr) AccessChain 10(dti) 26 + 761: 6(int) Load 760 + 762: 32(ptr) AccessChain 24(data) 25 761 25 + 763: 13(ivec4) Load 762 + 764: 7(ivec3) VectorShuffle 763 763 0 1 2 + 765: 7(ivec3) GroupNonUniformBitwiseOr 35 Reduce 764 + 766: 32(ptr) AccessChain 24(data) 25 759 25 + 767: 13(ivec4) Load 766 + 768: 13(ivec4) VectorShuffle 767 765 4 5 6 3 + Store 766 768 + 769: 27(ptr) AccessChain 10(dti) 26 + 770: 6(int) Load 769 + 771: 27(ptr) AccessChain 10(dti) 26 + 772: 6(int) Load 771 + 773: 75(ptr) AccessChain 24(data) 25 772 72 + 774: 15(ivec4) Load 773 + 775: 15(ivec4) GroupNonUniformBitwiseOr 35 Reduce 774 + 776: 75(ptr) AccessChain 24(data) 25 770 72 + Store 776 775 + 777: 27(ptr) AccessChain 10(dti) 26 + 778: 6(int) Load 777 + 779: 27(ptr) AccessChain 10(dti) 26 + 780: 6(int) Load 779 + 781: 84(ptr) AccessChain 24(data) 25 780 72 26 + 782: 14(int) Load 781 + 783: 14(int) GroupNonUniformBitwiseOr 35 Reduce 782 + 784: 84(ptr) AccessChain 24(data) 25 778 72 26 + Store 784 783 + 785: 27(ptr) AccessChain 10(dti) 26 + 786: 6(int) Load 785 + 787: 27(ptr) AccessChain 10(dti) 26 + 788: 6(int) Load 787 + 789: 75(ptr) AccessChain 24(data) 25 788 72 + 790: 15(ivec4) Load 789 + 791: 93(ivec2) VectorShuffle 790 790 0 1 + 792: 93(ivec2) GroupNonUniformBitwiseOr 35 Reduce 791 + 793: 75(ptr) AccessChain 24(data) 25 786 72 + 794: 15(ivec4) Load 793 + 795: 15(ivec4) VectorShuffle 794 792 4 5 2 3 + Store 793 795 + 796: 27(ptr) AccessChain 10(dti) 26 + 797: 6(int) Load 796 + 798: 27(ptr) AccessChain 10(dti) 26 + 799: 6(int) Load 798 + 800: 75(ptr) AccessChain 24(data) 25 799 72 + 801: 15(ivec4) Load 800 + 802: 105(ivec3) VectorShuffle 801 801 0 1 2 + 803: 105(ivec3) GroupNonUniformBitwiseOr 35 Reduce 802 + 804: 75(ptr) AccessChain 24(data) 25 797 72 + 805: 15(ivec4) Load 804 + 806: 15(ivec4) VectorShuffle 805 803 4 5 6 3 + Store 804 806 + 807: 27(ptr) AccessChain 10(dti) 26 + 808: 6(int) Load 807 + 809: 27(ptr) AccessChain 10(dti) 26 + 810: 6(int) Load 809 + 811: 32(ptr) AccessChain 24(data) 25 810 25 + 812: 13(ivec4) Load 811 + 813: 13(ivec4) GroupNonUniformBitwiseXor 35 Reduce 812 + 814: 32(ptr) AccessChain 24(data) 25 808 25 + Store 814 813 + 815: 27(ptr) AccessChain 10(dti) 26 + 816: 6(int) Load 815 + 817: 27(ptr) AccessChain 10(dti) 26 + 818: 6(int) Load 817 + 819: 42(ptr) AccessChain 24(data) 25 818 25 26 + 820: 6(int) Load 819 + 821: 6(int) GroupNonUniformBitwiseXor 35 Reduce 820 + 822: 42(ptr) AccessChain 24(data) 25 816 25 26 + Store 822 821 + 823: 27(ptr) AccessChain 10(dti) 26 + 824: 6(int) Load 823 + 825: 27(ptr) AccessChain 10(dti) 26 + 826: 6(int) Load 825 + 827: 32(ptr) AccessChain 24(data) 25 826 25 + 828: 13(ivec4) Load 827 + 829: 51(ivec2) VectorShuffle 828 828 0 1 + 830: 51(ivec2) GroupNonUniformBitwiseXor 35 Reduce 829 + 831: 32(ptr) AccessChain 24(data) 25 824 25 + 832: 13(ivec4) Load 831 + 833: 13(ivec4) VectorShuffle 832 830 4 5 2 3 + Store 831 833 + 834: 27(ptr) AccessChain 10(dti) 26 + 835: 6(int) Load 834 + 836: 27(ptr) AccessChain 10(dti) 26 + 837: 6(int) Load 836 + 838: 32(ptr) AccessChain 24(data) 25 837 25 + 839: 13(ivec4) Load 838 + 840: 7(ivec3) VectorShuffle 839 839 0 1 2 + 841: 7(ivec3) GroupNonUniformBitwiseXor 35 Reduce 840 + 842: 32(ptr) AccessChain 24(data) 25 835 25 + 843: 13(ivec4) Load 842 + 844: 13(ivec4) VectorShuffle 843 841 4 5 6 3 + Store 842 844 + 845: 27(ptr) AccessChain 10(dti) 26 + 846: 6(int) Load 845 + 847: 27(ptr) AccessChain 10(dti) 26 + 848: 6(int) Load 847 + 849: 75(ptr) AccessChain 24(data) 25 848 72 + 850: 15(ivec4) Load 849 + 851: 15(ivec4) GroupNonUniformBitwiseXor 35 Reduce 850 + 852: 75(ptr) AccessChain 24(data) 25 846 72 + Store 852 851 + 853: 27(ptr) AccessChain 10(dti) 26 + 854: 6(int) Load 853 + 855: 27(ptr) AccessChain 10(dti) 26 + 856: 6(int) Load 855 + 857: 84(ptr) AccessChain 24(data) 25 856 72 26 + 858: 14(int) Load 857 + 859: 14(int) GroupNonUniformBitwiseXor 35 Reduce 858 + 860: 84(ptr) AccessChain 24(data) 25 854 72 26 + Store 860 859 + 861: 27(ptr) AccessChain 10(dti) 26 + 862: 6(int) Load 861 + 863: 27(ptr) AccessChain 10(dti) 26 + 864: 6(int) Load 863 + 865: 75(ptr) AccessChain 24(data) 25 864 72 + 866: 15(ivec4) Load 865 + 867: 93(ivec2) VectorShuffle 866 866 0 1 + 868: 93(ivec2) GroupNonUniformBitwiseXor 35 Reduce 867 + 869: 75(ptr) AccessChain 24(data) 25 862 72 + 870: 15(ivec4) Load 869 + 871: 15(ivec4) VectorShuffle 870 868 4 5 2 3 + Store 869 871 + 872: 27(ptr) AccessChain 10(dti) 26 + 873: 6(int) Load 872 + 874: 27(ptr) AccessChain 10(dti) 26 + 875: 6(int) Load 874 + 876: 75(ptr) AccessChain 24(data) 25 875 72 + 877: 15(ivec4) Load 876 + 878: 105(ivec3) VectorShuffle 877 877 0 1 2 + 879: 105(ivec3) GroupNonUniformBitwiseXor 35 Reduce 878 + 880: 75(ptr) AccessChain 24(data) 25 873 72 + 881: 15(ivec4) Load 880 + 882: 15(ivec4) VectorShuffle 881 879 4 5 6 3 + Store 880 882 + 883: 27(ptr) AccessChain 10(dti) 26 + 884: 6(int) Load 883 + 885: 27(ptr) AccessChain 10(dti) 26 + 886: 6(int) Load 885 + 887: 42(ptr) AccessChain 24(data) 25 886 25 26 + 888: 6(int) Load 887 + 890: 889(bool) IEqual 888 26 + 891: 13(ivec4) GroupNonUniformBallot 35 890 + 892: 6(int) GroupNonUniformBallotBitCount 35 Reduce 891 + 893: 42(ptr) AccessChain 24(data) 25 884 25 26 + Store 893 892 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.wavevote.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.wavevote.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.wavevote.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.wavevote.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,316 @@ +hlsl.wavevote.comp +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:5 Function Definition: @CSMain(vu3; ( temp void) +0:5 Function Parameters: +0:5 'dti' ( in 3-component vector of uint) +0:? Sequence +0:6 move second child to first child ( temp uint64_t) +0:6 indirect index (layout( row_major std430) buffer uint64_t) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint64_t) +0:6 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:6 Constant: +0:6 0 (const uint) +0:6 direct index ( temp uint) +0:6 'dti' ( in 3-component vector of uint) +0:6 Constant: +0:6 0 (const int) +0:6 Construct uint64 (layout( row_major std430) buffer uint64_t) +0:6 Convert uint to uint64 ( temp 4-component vector of uint64_t) +0:6 subgroupBallot ( temp 4-component vector of uint) +0:6 subgroupAny ( temp bool) +0:6 Compare Equal ( temp bool) +0:6 direct index ( temp uint) +0:6 'dti' ( in 3-component vector of uint) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0 (const uint) +0:7 move second child to first child ( temp uint64_t) +0:7 indirect index (layout( row_major std430) buffer uint64_t) +0:7 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint64_t) +0:7 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:7 Constant: +0:7 0 (const uint) +0:7 direct index ( temp uint) +0:7 'dti' ( in 3-component vector of uint) +0:7 Constant: +0:7 1 (const int) +0:7 Construct uint64 (layout( row_major std430) buffer uint64_t) +0:7 Convert uint to uint64 ( temp 4-component vector of uint64_t) +0:7 subgroupBallot ( temp 4-component vector of uint) +0:7 subgroupAll ( temp bool) +0:7 Compare Equal ( temp bool) +0:7 direct index ( temp uint) +0:7 'dti' ( in 3-component vector of uint) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const uint) +0:8 move second child to first child ( temp uint64_t) +0:8 indirect index (layout( row_major std430) buffer uint64_t) +0:8 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint64_t) +0:8 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:8 Constant: +0:8 0 (const uint) +0:8 direct index ( temp uint) +0:8 'dti' ( in 3-component vector of uint) +0:8 Constant: +0:8 2 (const int) +0:8 Construct uint64 (layout( row_major std430) buffer uint64_t) +0:8 Convert uint to uint64 ( temp 4-component vector of uint64_t) +0:8 subgroupBallot ( temp 4-component vector of uint) +0:8 subgroupAllEqual ( temp bool) +0:8 Compare Equal ( temp bool) +0:8 direct index ( temp uint) +0:8 'dti' ( in 3-component vector of uint) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 0 (const uint) +0:9 move second child to first child ( temp uint64_t) +0:9 indirect index (layout( row_major std430) buffer uint64_t) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint64_t) +0:9 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:9 Constant: +0:9 0 (const uint) +0:9 direct index ( temp uint) +0:9 'dti' ( in 3-component vector of uint) +0:9 Constant: +0:9 2 (const int) +0:9 Construct uint64 (layout( row_major std430) buffer uint64_t) +0:9 Convert uint to uint64 ( temp 4-component vector of uint64_t) +0:9 subgroupBallot ( temp 4-component vector of uint) +0:9 subgroupAllEqual ( temp bool) +0:9 direct index ( temp uint) +0:9 'dti' ( in 3-component vector of uint) +0:9 Constant: +0:9 2 (const int) +0:5 Function Definition: CSMain( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:5 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:5 Function Definition: @CSMain(vu3; ( temp void) +0:5 Function Parameters: +0:5 'dti' ( in 3-component vector of uint) +0:? Sequence +0:6 move second child to first child ( temp uint64_t) +0:6 indirect index (layout( row_major std430) buffer uint64_t) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint64_t) +0:6 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:6 Constant: +0:6 0 (const uint) +0:6 direct index ( temp uint) +0:6 'dti' ( in 3-component vector of uint) +0:6 Constant: +0:6 0 (const int) +0:6 Construct uint64 (layout( row_major std430) buffer uint64_t) +0:6 Convert uint to uint64 ( temp 4-component vector of uint64_t) +0:6 subgroupBallot ( temp 4-component vector of uint) +0:6 subgroupAny ( temp bool) +0:6 Compare Equal ( temp bool) +0:6 direct index ( temp uint) +0:6 'dti' ( in 3-component vector of uint) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0 (const uint) +0:7 move second child to first child ( temp uint64_t) +0:7 indirect index (layout( row_major std430) buffer uint64_t) +0:7 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint64_t) +0:7 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:7 Constant: +0:7 0 (const uint) +0:7 direct index ( temp uint) +0:7 'dti' ( in 3-component vector of uint) +0:7 Constant: +0:7 1 (const int) +0:7 Construct uint64 (layout( row_major std430) buffer uint64_t) +0:7 Convert uint to uint64 ( temp 4-component vector of uint64_t) +0:7 subgroupBallot ( temp 4-component vector of uint) +0:7 subgroupAll ( temp bool) +0:7 Compare Equal ( temp bool) +0:7 direct index ( temp uint) +0:7 'dti' ( in 3-component vector of uint) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const uint) +0:8 move second child to first child ( temp uint64_t) +0:8 indirect index (layout( row_major std430) buffer uint64_t) +0:8 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint64_t) +0:8 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:8 Constant: +0:8 0 (const uint) +0:8 direct index ( temp uint) +0:8 'dti' ( in 3-component vector of uint) +0:8 Constant: +0:8 2 (const int) +0:8 Construct uint64 (layout( row_major std430) buffer uint64_t) +0:8 Convert uint to uint64 ( temp 4-component vector of uint64_t) +0:8 subgroupBallot ( temp 4-component vector of uint) +0:8 subgroupAllEqual ( temp bool) +0:8 Compare Equal ( temp bool) +0:8 direct index ( temp uint) +0:8 'dti' ( in 3-component vector of uint) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 0 (const uint) +0:9 move second child to first child ( temp uint64_t) +0:9 indirect index (layout( row_major std430) buffer uint64_t) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint64_t) +0:9 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:9 Constant: +0:9 0 (const uint) +0:9 direct index ( temp uint) +0:9 'dti' ( in 3-component vector of uint) +0:9 Constant: +0:9 2 (const int) +0:9 Construct uint64 (layout( row_major std430) buffer uint64_t) +0:9 Convert uint to uint64 ( temp 4-component vector of uint64_t) +0:9 subgroupBallot ( temp 4-component vector of uint) +0:9 subgroupAllEqual ( temp bool) +0:9 direct index ( temp uint) +0:9 'dti' ( in 3-component vector of uint) +0:9 Constant: +0:9 2 (const int) +0:5 Function Definition: CSMain( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:5 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 75 + + Capability Shader + Capability Int64 + Capability GroupNonUniform + Capability GroupNonUniformVote + Capability GroupNonUniformBallot + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "CSMain" 70 + ExecutionMode 4 LocalSize 32 16 1 + Source HLSL 500 + Name 4 "CSMain" + Name 11 "@CSMain(vu3;" + Name 10 "dti" + Name 15 "data" + MemberName 15(data) 0 "@data" + Name 17 "data" + Name 68 "dti" + Name 70 "dti" + Name 72 "param" + Decorate 14 ArrayStride 8 + MemberDecorate 15(data) 0 Offset 0 + Decorate 15(data) BufferBlock + Decorate 17(data) DescriptorSet 0 + Decorate 70(dti) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 13: TypeInt 64 0 + 14: TypeRuntimeArray 13(int) + 15(data): TypeStruct 14 + 16: TypePointer Uniform 15(data) + 17(data): 16(ptr) Variable Uniform + 18: TypeInt 32 1 + 19: 18(int) Constant 0 + 20: 6(int) Constant 0 + 21: TypePointer Function 6(int) + 26: TypeBool + 28: 6(int) Constant 3 + 30: TypeVector 6(int) 4 + 32: TypeVector 13(int) 4 + 35: TypePointer Uniform 13(int) + 37: 6(int) Constant 1 + 48: 6(int) Constant 2 + 69: TypePointer Input 7(ivec3) + 70(dti): 69(ptr) Variable Input + 4(CSMain): 2 Function None 3 + 5: Label + 68(dti): 8(ptr) Variable Function + 72(param): 8(ptr) Variable Function + 71: 7(ivec3) Load 70(dti) + Store 68(dti) 71 + 73: 7(ivec3) Load 68(dti) + Store 72(param) 73 + 74: 2 FunctionCall 11(@CSMain(vu3;) 72(param) + Return + FunctionEnd +11(@CSMain(vu3;): 2 Function None 9 + 10(dti): 8(ptr) FunctionParameter + 12: Label + 22: 21(ptr) AccessChain 10(dti) 20 + 23: 6(int) Load 22 + 24: 21(ptr) AccessChain 10(dti) 20 + 25: 6(int) Load 24 + 27: 26(bool) IEqual 25 20 + 29: 26(bool) GroupNonUniformAny 28 27 + 31: 30(ivec4) GroupNonUniformBallot 28 29 + 33: 32(ivec4) UConvert 31 + 34: 13(int) CompositeExtract 33 0 + 36: 35(ptr) AccessChain 17(data) 19 23 + Store 36 34 + 38: 21(ptr) AccessChain 10(dti) 37 + 39: 6(int) Load 38 + 40: 21(ptr) AccessChain 10(dti) 37 + 41: 6(int) Load 40 + 42: 26(bool) IEqual 41 20 + 43: 26(bool) GroupNonUniformAll 28 42 + 44: 30(ivec4) GroupNonUniformBallot 28 43 + 45: 32(ivec4) UConvert 44 + 46: 13(int) CompositeExtract 45 0 + 47: 35(ptr) AccessChain 17(data) 19 39 + Store 47 46 + 49: 21(ptr) AccessChain 10(dti) 48 + 50: 6(int) Load 49 + 51: 21(ptr) AccessChain 10(dti) 48 + 52: 6(int) Load 51 + 53: 26(bool) IEqual 52 20 + 54: 26(bool) GroupNonUniformAllEqual 28 53 + 55: 30(ivec4) GroupNonUniformBallot 28 54 + 56: 32(ivec4) UConvert 55 + 57: 13(int) CompositeExtract 56 0 + 58: 35(ptr) AccessChain 17(data) 19 50 + Store 58 57 + 59: 21(ptr) AccessChain 10(dti) 48 + 60: 6(int) Load 59 + 61: 21(ptr) AccessChain 10(dti) 48 + 62: 6(int) Load 61 + 63: 26(bool) GroupNonUniformAllEqual 28 62 + 64: 30(ivec4) GroupNonUniformBallot 28 63 + 65: 32(ivec4) UConvert 64 + 66: 13(int) CompositeExtract 65 0 + 67: 35(ptr) AccessChain 17(data) 19 60 + Store 67 66 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.whileLoop.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.whileLoop.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.whileLoop.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.whileLoop.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -21,7 +21,7 @@ 0:4 Constant: 0:4 false (const bool) 0:4 No loop body -0:5 Loop with condition tested first +0:5 Loop with condition tested first: Unroll 0:5 Loop Condition 0:5 Constant: 0:5 false (const bool) @@ -71,7 +71,7 @@ 0:4 Constant: 0:4 false (const bool) 0:4 No loop body -0:5 Loop with condition tested first +0:5 Loop with condition tested first: Unroll 0:5 Loop Condition 0:5 Constant: 0:5 false (const bool) @@ -96,7 +96,7 @@ 0:? 'input' (layout( location=0) in 4-component vector of float) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 52 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.y-negate-1.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.y-negate-1.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.y-negate-1.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.y-negate-1.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,130 @@ +hlsl.y-negate-1.vert +Shader version: 500 +0:? Sequence +0:7 Function Definition: @main( ( temp 4-component vector of float) +0:7 Function Parameters: +0:? Sequence +0:8 Branch: Return with expression +0:8 pos: direct index for structure ( uniform 4-component vector of float) +0:8 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos}) +0:8 Constant: +0:8 0 (const uint) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 '@position' ( temp 4-component vector of float) +0:7 Function Call: @main( ( temp 4-component vector of float) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 '@position' ( temp 4-component vector of float) +0:7 Constant: +0:7 1 (const int) +0:7 Negate value ( temp float) +0:7 direct index ( temp float) +0:7 '@position' ( temp 4-component vector of float) +0:7 Constant: +0:7 1 (const int) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:7 '@position' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos}) +0:? '@entryPointOutput' ( out 4-component vector of float Position) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:7 Function Definition: @main( ( temp 4-component vector of float) +0:7 Function Parameters: +0:? Sequence +0:8 Branch: Return with expression +0:8 pos: direct index for structure ( uniform 4-component vector of float) +0:8 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos}) +0:8 Constant: +0:8 0 (const uint) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 '@position' ( temp 4-component vector of float) +0:7 Function Call: @main( ( temp 4-component vector of float) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 '@position' ( temp 4-component vector of float) +0:7 Constant: +0:7 1 (const int) +0:7 Negate value ( temp float) +0:7 direct index ( temp float) +0:7 '@position' ( temp 4-component vector of float) +0:7 Constant: +0:7 1 (const int) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:7 '@position' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos}) +0:? '@entryPointOutput' ( out 4-component vector of float Position) + +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 34 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 32 + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 11 "$Global" + MemberName 11($Global) 0 "pos" + Name 13 "" + Name 22 "@position" + Name 32 "@entryPointOutput" + MemberDecorate 11($Global) 0 Offset 0 + Decorate 11($Global) Block + Decorate 13 DescriptorSet 0 + Decorate 32(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11($Global): TypeStruct 7(fvec4) + 12: TypePointer Uniform 11($Global) + 13: 12(ptr) Variable Uniform + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: TypePointer Uniform 7(fvec4) + 21: TypePointer Function 7(fvec4) + 24: TypeInt 32 0 + 25: 24(int) Constant 1 + 26: TypePointer Function 6(float) + 31: TypePointer Output 7(fvec4) +32(@entryPointOutput): 31(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 22(@position): 21(ptr) Variable Function + 23: 7(fvec4) FunctionCall 9(@main() + Store 22(@position) 23 + 27: 26(ptr) AccessChain 22(@position) 25 + 28: 6(float) Load 27 + 29: 6(float) FNegate 28 + 30: 26(ptr) AccessChain 22(@position) 25 + Store 30 29 + 33: 7(fvec4) Load 22(@position) + Store 32(@entryPointOutput) 33 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 17: 16(ptr) AccessChain 13 15 + 18: 7(fvec4) Load 17 + ReturnValue 18 + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.y-negate-2.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.y-negate-2.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.y-negate-2.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.y-negate-2.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,148 @@ +hlsl.y-negate-2.vert +Shader version: 500 +0:? Sequence +0:6 Function Definition: @main(vf4; ( temp void) +0:6 Function Parameters: +0:6 'position' ( out 4-component vector of float) +0:? Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 'position' ( out 4-component vector of float) +0:7 pos: direct index for structure ( uniform 4-component vector of float) +0:7 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos}) +0:7 Constant: +0:7 0 (const uint) +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 Function Call: @main(vf4; ( temp void) +0:? 'position' ( temp 4-component vector of float) +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:6 '@position' ( temp 4-component vector of float) +0:? 'position' ( temp 4-component vector of float) +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:6 '@position' ( temp 4-component vector of float) +0:6 Constant: +0:6 1 (const int) +0:6 Negate value ( temp float) +0:6 direct index ( temp float) +0:6 '@position' ( temp 4-component vector of float) +0:6 Constant: +0:6 1 (const int) +0:6 move second child to first child ( temp 4-component vector of float) +0:? 'position' ( out 4-component vector of float Position) +0:6 '@position' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos}) +0:? 'position' ( out 4-component vector of float Position) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:6 Function Definition: @main(vf4; ( temp void) +0:6 Function Parameters: +0:6 'position' ( out 4-component vector of float) +0:? Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 'position' ( out 4-component vector of float) +0:7 pos: direct index for structure ( uniform 4-component vector of float) +0:7 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos}) +0:7 Constant: +0:7 0 (const uint) +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 Function Call: @main(vf4; ( temp void) +0:? 'position' ( temp 4-component vector of float) +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:6 '@position' ( temp 4-component vector of float) +0:? 'position' ( temp 4-component vector of float) +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:6 '@position' ( temp 4-component vector of float) +0:6 Constant: +0:6 1 (const int) +0:6 Negate value ( temp float) +0:6 direct index ( temp float) +0:6 '@position' ( temp 4-component vector of float) +0:6 Constant: +0:6 1 (const int) +0:6 move second child to first child ( temp 4-component vector of float) +0:? 'position' ( out 4-component vector of float Position) +0:6 '@position' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos}) +0:? 'position' ( out 4-component vector of float Position) + +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 37 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 35 + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vf4;" + Name 10 "position" + Name 13 "$Global" + MemberName 13($Global) 0 "pos" + Name 15 "" + Name 21 "position" + Name 22 "param" + Name 25 "@position" + Name 35 "position" + MemberDecorate 13($Global) 0 Offset 0 + Decorate 13($Global) Block + Decorate 15 DescriptorSet 0 + Decorate 35(position) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 2 8(ptr) + 13($Global): TypeStruct 7(fvec4) + 14: TypePointer Uniform 13($Global) + 15: 14(ptr) Variable Uniform + 16: TypeInt 32 1 + 17: 16(int) Constant 0 + 18: TypePointer Uniform 7(fvec4) + 27: TypeInt 32 0 + 28: 27(int) Constant 1 + 29: TypePointer Function 6(float) + 34: TypePointer Output 7(fvec4) + 35(position): 34(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 21(position): 8(ptr) Variable Function + 22(param): 8(ptr) Variable Function + 25(@position): 8(ptr) Variable Function + 23: 2 FunctionCall 11(@main(vf4;) 22(param) + 24: 7(fvec4) Load 22(param) + Store 21(position) 24 + 26: 7(fvec4) Load 21(position) + Store 25(@position) 26 + 30: 29(ptr) AccessChain 25(@position) 28 + 31: 6(float) Load 30 + 32: 6(float) FNegate 31 + 33: 29(ptr) AccessChain 25(@position) 28 + Store 33 32 + 36: 7(fvec4) Load 25(@position) + Store 35(position) 36 + Return + FunctionEnd + 11(@main(vf4;): 2 Function None 9 + 10(position): 8(ptr) FunctionParameter + 12: Label + 19: 18(ptr) AccessChain 15 17 + 20: 7(fvec4) Load 19 + Store 10(position) 20 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.y-negate-3.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.y-negate-3.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/hlsl.y-negate-3.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/hlsl.y-negate-3.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,211 @@ +hlsl.y-negate-3.vert +Shader version: 500 +0:? Sequence +0:11 Function Definition: @main( ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Function Parameters: +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 pos: direct index for structure ( temp 4-component vector of float) +0:14 'vsout' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:14 Constant: +0:14 0 (const int) +0:14 position: direct index for structure ( uniform 4-component vector of float) +0:14 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float position}) +0:14 Constant: +0:14 0 (const uint) +0:15 move second child to first child ( temp int) +0:15 somethingelse: direct index for structure ( temp int) +0:15 'vsout' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 42 (const int) +0:17 Branch: Return with expression +0:17 'vsout' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Function Call: @main( ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:11 '@position' ( temp 4-component vector of float) +0:11 pos: direct index for structure ( temp 4-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 '@position' ( temp 4-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Negate value ( temp float) +0:11 direct index ( temp float) +0:11 '@position' ( temp 4-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.pos' ( out 4-component vector of float Position) +0:11 '@position' ( temp 4-component vector of float) +0:11 move second child to first child ( temp int) +0:? '@entryPointOutput.somethingelse' (layout( location=0) out int) +0:11 somethingelse: direct index for structure ( temp int) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Constant: +0:11 1 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float position}) +0:? '@entryPointOutput.pos' ( out 4-component vector of float Position) +0:? '@entryPointOutput.somethingelse' (layout( location=0) out int) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:11 Function Definition: @main( ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Function Parameters: +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 pos: direct index for structure ( temp 4-component vector of float) +0:14 'vsout' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:14 Constant: +0:14 0 (const int) +0:14 position: direct index for structure ( uniform 4-component vector of float) +0:14 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float position}) +0:14 Constant: +0:14 0 (const uint) +0:15 move second child to first child ( temp int) +0:15 somethingelse: direct index for structure ( temp int) +0:15 'vsout' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 42 (const int) +0:17 Branch: Return with expression +0:17 'vsout' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Function Call: @main( ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:11 '@position' ( temp 4-component vector of float) +0:11 pos: direct index for structure ( temp 4-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 '@position' ( temp 4-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Negate value ( temp float) +0:11 direct index ( temp float) +0:11 '@position' ( temp 4-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.pos' ( out 4-component vector of float Position) +0:11 '@position' ( temp 4-component vector of float) +0:11 move second child to first child ( temp int) +0:? '@entryPointOutput.somethingelse' (layout( location=0) out int) +0:11 somethingelse: direct index for structure ( temp int) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Constant: +0:11 1 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float position}) +0:? '@entryPointOutput.pos' ( out 4-component vector of float Position) +0:? '@entryPointOutput.somethingelse' (layout( location=0) out int) + +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 50 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 44 47 + Source HLSL 500 + Name 4 "main" + Name 9 "VS_OUT" + MemberName 9(VS_OUT) 0 "pos" + MemberName 9(VS_OUT) 1 "somethingelse" + Name 11 "@main(" + Name 14 "vsout" + Name 16 "$Global" + MemberName 16($Global) 0 "position" + Name 18 "" + Name 31 "flattenTemp" + Name 33 "@position" + Name 44 "@entryPointOutput.pos" + Name 47 "@entryPointOutput.somethingelse" + MemberDecorate 16($Global) 0 Offset 0 + Decorate 16($Global) Block + Decorate 18 DescriptorSet 0 + Decorate 44(@entryPointOutput.pos) BuiltIn Position + Decorate 47(@entryPointOutput.somethingelse) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 1 + 9(VS_OUT): TypeStruct 7(fvec4) 8(int) + 10: TypeFunction 9(VS_OUT) + 13: TypePointer Function 9(VS_OUT) + 15: 8(int) Constant 0 + 16($Global): TypeStruct 7(fvec4) + 17: TypePointer Uniform 16($Global) + 18: 17(ptr) Variable Uniform + 19: TypePointer Uniform 7(fvec4) + 22: TypePointer Function 7(fvec4) + 24: 8(int) Constant 1 + 25: 8(int) Constant 42 + 26: TypePointer Function 8(int) + 36: TypeInt 32 0 + 37: 36(int) Constant 1 + 38: TypePointer Function 6(float) + 43: TypePointer Output 7(fvec4) +44(@entryPointOutput.pos): 43(ptr) Variable Output + 46: TypePointer Output 8(int) +47(@entryPointOutput.somethingelse): 46(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 31(flattenTemp): 13(ptr) Variable Function + 33(@position): 22(ptr) Variable Function + 32: 9(VS_OUT) FunctionCall 11(@main() + Store 31(flattenTemp) 32 + 34: 22(ptr) AccessChain 31(flattenTemp) 15 + 35: 7(fvec4) Load 34 + Store 33(@position) 35 + 39: 38(ptr) AccessChain 33(@position) 37 + 40: 6(float) Load 39 + 41: 6(float) FNegate 40 + 42: 38(ptr) AccessChain 33(@position) 37 + Store 42 41 + 45: 7(fvec4) Load 33(@position) + Store 44(@entryPointOutput.pos) 45 + 48: 26(ptr) AccessChain 31(flattenTemp) 24 + 49: 8(int) Load 48 + Store 47(@entryPointOutput.somethingelse) 49 + Return + FunctionEnd + 11(@main(): 9(VS_OUT) Function None 10 + 12: Label + 14(vsout): 13(ptr) Variable Function + 20: 19(ptr) AccessChain 18 15 + 21: 7(fvec4) Load 20 + 23: 22(ptr) AccessChain 14(vsout) 15 + Store 23 21 + 27: 26(ptr) AccessChain 14(vsout) 24 + Store 27 25 + 28: 9(VS_OUT) Load 14(vsout) + ReturnValue 28 + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/implicitInnerAtomicUint.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/implicitInnerAtomicUint.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/implicitInnerAtomicUint.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/implicitInnerAtomicUint.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,20 @@ +implicitInnerAtomicUint.frag +ERROR: 0:2: '[]' : only outermost dimension of an array of arrays can be implicitly sized +ERROR: 1 compilation errors. No code generated. + + +Shader version: 460 +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'c' (layout( binding=0 offset=0) uniform 1-element array of 1-element array of atomic_uint) + + +Linked fragment stage: + +ERROR: Linking fragment stage: Missing entry point: Each stage requires one entry point + +Shader version: 460 +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'c' (layout( binding=0 offset=0) uniform 1-element array of 1-element array of atomic_uint) + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/link1.vk.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/link1.vk.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/link1.vk.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/link1.vk.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -2,30 +2,105 @@ Shader version: 450 gl_FragCoord origin is upper left 0:? Sequence -0:7 Function Definition: main( ( global void) -0:7 Function Parameters: -0:9 Sequence -0:9 move second child to first child ( temp highp 4-component vector of float) -0:9 'color' ( out highp 4-component vector of float) -0:9 Function Call: getColor( ( global highp 4-component vector of float) +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:18 Sequence +0:18 move second child to first child ( temp highp 4-component vector of float) +0:18 'color' (layout( location=0) out highp 4-component vector of float) +0:18 Function Call: getColor( ( global highp 4-component vector of float) +0:20 move second child to first child ( temp highp int) +0:20 direct index ( temp highp int) +0:20 'a1' ( global unsized 9-element array of highp int) +0:20 Constant: +0:20 8 (const int) +0:20 Constant: +0:20 1 (const int) +0:21 move second child to first child ( temp highp int) +0:21 direct index ( temp highp int) +0:21 'a2' ( global unsized 2-element array of highp int) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 1 (const int) +0:22 move second child to first child ( temp highp int) +0:22 indirect index ( temp highp int) +0:22 'b' ( global 5-element array of highp int) +0:22 'i' ( global highp int) +0:22 Constant: +0:22 1 (const int) +0:23 move second child to first child ( temp highp int) +0:23 direct index ( temp highp int) +0:23 'c' ( global unsized 4-element array of highp int) +0:23 Constant: +0:23 3 (const int) +0:23 Constant: +0:23 1 (const int) 0:? Linker Objects -0:? 'color' ( out highp 4-component vector of float) +0:? 'color' (layout( location=0) out highp 4-component vector of float) +0:? 'a1' ( global unsized 9-element array of highp int) +0:? 'a2' ( global unsized 2-element array of highp int) +0:? 'b' ( global 5-element array of highp int) +0:? 'c' ( global unsized 4-element array of highp int) +0:? 'i' ( global highp int) +0:? 'anon@0' (layout( column_major std430) buffer block{layout( column_major std430) buffer unsized 1-element array of highp float r}) +0:? 'anon@1' (layout( column_major std430) buffer block{layout( column_major std430) buffer unsized 1-element array of highp float m}) link2.vk.frag Shader version: 450 gl_FragCoord origin is upper left 0:? Sequence -0:5 Function Definition: getColor( ( global highp 4-component vector of float) -0:5 Function Parameters: -0:7 Sequence -0:7 Branch: Return with expression -0:7 texture ( global highp 4-component vector of float) -0:7 's2D' ( uniform highp sampler2D) -0:7 Constant: -0:7 0.500000 -0:7 0.500000 +0:14 Function Definition: getColor( ( global highp 4-component vector of float) +0:14 Function Parameters: +0:16 Sequence +0:16 move second child to first child ( temp highp int) +0:16 direct index ( temp highp int) +0:16 'a1' ( global unsized 3-element array of highp int) +0:16 Constant: +0:16 2 (const int) +0:16 Constant: +0:16 1 (const int) +0:17 move second child to first child ( temp highp int) +0:17 direct index ( temp highp int) +0:17 'a2' ( global unsized 10-element array of highp int) +0:17 Constant: +0:17 9 (const int) +0:17 Constant: +0:17 1 (const int) +0:18 move second child to first child ( temp highp int) +0:18 direct index ( temp highp int) +0:18 'b' ( global unsized 3-element array of highp int) +0:18 Constant: +0:18 2 (const int) +0:18 Constant: +0:18 1 (const int) +0:19 move second child to first child ( temp highp int) +0:19 direct index ( temp highp int) +0:19 'c' ( global 7-element array of highp int) +0:19 Constant: +0:19 3 (const int) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child ( temp highp int) +0:20 indirect index ( temp highp int) +0:20 'c' ( global 7-element array of highp int) +0:20 'i' ( global highp int) +0:20 Constant: +0:20 1 (const int) +0:22 Branch: Return with expression +0:22 texture ( global highp 4-component vector of float) +0:22 's2D' (layout( binding=1) uniform highp sampler2D) +0:22 Constant: +0:22 0.500000 +0:22 0.500000 0:? Linker Objects -0:? 's2D' ( uniform highp sampler2D) +0:? 's2D' (layout( binding=1) uniform highp sampler2D) +0:? 'a1' ( global unsized 3-element array of highp int) +0:? 'a2' ( global unsized 10-element array of highp int) +0:? 'b' ( global unsized 3-element array of highp int) +0:? 'c' ( global 7-element array of highp int) +0:? 'i' ( global highp int) +0:? 'anon@0' (layout( column_major std430) buffer block{layout( column_major std430) buffer unsized 1-element array of highp float r}) +0:? 'anon@1' (layout( column_major std430) buffer block{layout( column_major std430) buffer 4-element array of highp float m}) Linked fragment stage: @@ -34,23 +109,207 @@ Shader version: 450 gl_FragCoord origin is upper left 0:? Sequence -0:7 Function Definition: main( ( global void) -0:7 Function Parameters: -0:9 Sequence -0:9 move second child to first child ( temp highp 4-component vector of float) -0:9 'color' ( out highp 4-component vector of float) -0:9 Function Call: getColor( ( global highp 4-component vector of float) -0:5 Function Definition: getColor( ( global highp 4-component vector of float) -0:5 Function Parameters: -0:7 Sequence -0:7 Branch: Return with expression -0:7 texture ( global highp 4-component vector of float) -0:7 's2D' ( uniform highp sampler2D) -0:7 Constant: -0:7 0.500000 -0:7 0.500000 +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:18 Sequence +0:18 move second child to first child ( temp highp 4-component vector of float) +0:18 'color' (layout( location=0) out highp 4-component vector of float) +0:18 Function Call: getColor( ( global highp 4-component vector of float) +0:20 move second child to first child ( temp highp int) +0:20 direct index ( temp highp int) +0:20 'a1' ( global 9-element array of highp int) +0:20 Constant: +0:20 8 (const int) +0:20 Constant: +0:20 1 (const int) +0:21 move second child to first child ( temp highp int) +0:21 direct index ( temp highp int) +0:21 'a2' ( global 10-element array of highp int) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 1 (const int) +0:22 move second child to first child ( temp highp int) +0:22 indirect index ( temp highp int) +0:22 'b' ( global 5-element array of highp int) +0:22 'i' ( global highp int) +0:22 Constant: +0:22 1 (const int) +0:23 move second child to first child ( temp highp int) +0:23 direct index ( temp highp int) +0:23 'c' ( global 7-element array of highp int) +0:23 Constant: +0:23 3 (const int) +0:23 Constant: +0:23 1 (const int) +0:14 Function Definition: getColor( ( global highp 4-component vector of float) +0:14 Function Parameters: +0:16 Sequence +0:16 move second child to first child ( temp highp int) +0:16 direct index ( temp highp int) +0:16 'a1' ( global 3-element array of highp int) +0:16 Constant: +0:16 2 (const int) +0:16 Constant: +0:16 1 (const int) +0:17 move second child to first child ( temp highp int) +0:17 direct index ( temp highp int) +0:17 'a2' ( global 10-element array of highp int) +0:17 Constant: +0:17 9 (const int) +0:17 Constant: +0:17 1 (const int) +0:18 move second child to first child ( temp highp int) +0:18 direct index ( temp highp int) +0:18 'b' ( global 3-element array of highp int) +0:18 Constant: +0:18 2 (const int) +0:18 Constant: +0:18 1 (const int) +0:19 move second child to first child ( temp highp int) +0:19 direct index ( temp highp int) +0:19 'c' ( global 7-element array of highp int) +0:19 Constant: +0:19 3 (const int) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child ( temp highp int) +0:20 indirect index ( temp highp int) +0:20 'c' ( global 7-element array of highp int) +0:20 'i' ( global highp int) +0:20 Constant: +0:20 1 (const int) +0:22 Branch: Return with expression +0:22 texture ( global highp 4-component vector of float) +0:22 's2D' (layout( binding=1) uniform highp sampler2D) +0:22 Constant: +0:22 0.500000 +0:22 0.500000 0:? Linker Objects -0:? 'color' ( out highp 4-component vector of float) -0:? 's2D' ( uniform highp sampler2D) +0:? 'color' (layout( location=0) out highp 4-component vector of float) +0:? 'a1' ( global 9-element array of highp int) +0:? 'a2' ( global 10-element array of highp int) +0:? 'b' ( global 5-element array of highp int) +0:? 'c' ( global 7-element array of highp int) +0:? 'i' ( global highp int) +0:? 'anon@0' (layout( column_major std430) buffer block{layout( column_major std430) buffer unsized 1-element array of highp float r}) +0:? 'anon@1' (layout( column_major std430) buffer block{layout( column_major std430) buffer 4-element array of highp float m}) +0:? 's2D' (layout( binding=1) uniform highp sampler2D) -SPIR-V is not generated for failed compile or link +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 71 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 12 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "getColor(" + Name 12 "color" + Name 19 "a1" + Name 27 "a2" + Name 32 "b" + Name 33 "i" + Name 39 "c" + Name 54 "s2D" + Name 63 "bnameRuntime" + MemberName 63(bnameRuntime) 0 "r" + Name 65 "" + Name 68 "bnameImplicit" + MemberName 68(bnameImplicit) 0 "m" + Name 70 "" + Decorate 12(color) Location 0 + Decorate 54(s2D) DescriptorSet 0 + Decorate 54(s2D) Binding 1 + Decorate 62 ArrayStride 4 + MemberDecorate 63(bnameRuntime) 0 Offset 0 + Decorate 63(bnameRuntime) BufferBlock + Decorate 65 DescriptorSet 0 + Decorate 67 ArrayStride 4 + MemberDecorate 68(bnameImplicit) 0 Offset 0 + Decorate 68(bnameImplicit) BufferBlock + Decorate 70 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypePointer Output 7(fvec4) + 12(color): 11(ptr) Variable Output + 14: TypeInt 32 1 + 15: TypeInt 32 0 + 16: 15(int) Constant 9 + 17: TypeArray 14(int) 16 + 18: TypePointer Private 17 + 19(a1): 18(ptr) Variable Private + 20: 14(int) Constant 8 + 21: 14(int) Constant 1 + 22: TypePointer Private 14(int) + 24: 15(int) Constant 10 + 25: TypeArray 14(int) 24 + 26: TypePointer Private 25 + 27(a2): 26(ptr) Variable Private + 29: 15(int) Constant 5 + 30: TypeArray 14(int) 29 + 31: TypePointer Private 30 + 32(b): 31(ptr) Variable Private + 33(i): 22(ptr) Variable Private + 36: 15(int) Constant 7 + 37: TypeArray 14(int) 36 + 38: TypePointer Private 37 + 39(c): 38(ptr) Variable Private + 40: 14(int) Constant 3 + 42: 14(int) Constant 2 + 43: TypePointer Output 6(float) + 45: 14(int) Constant 9 + 51: TypeImage 6(float) 2D sampled format:Unknown + 52: TypeSampledImage 51 + 53: TypePointer UniformConstant 52 + 54(s2D): 53(ptr) Variable UniformConstant + 56: TypeVector 6(float) 2 + 57: 6(float) Constant 1056964608 + 58: 56(fvec2) ConstantComposite 57 57 + 62: TypeRuntimeArray 6(float) +63(bnameRuntime): TypeStruct 62 + 64: TypePointer Uniform 63(bnameRuntime) + 65: 64(ptr) Variable Uniform + 66: 15(int) Constant 4 + 67: TypeArray 6(float) 66 +68(bnameImplicit): TypeStruct 67 + 69: TypePointer Uniform 68(bnameImplicit) + 70: 69(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 13: 7(fvec4) FunctionCall 9(getColor() + Store 12(color) 13 + 23: 22(ptr) AccessChain 19(a1) 20 + Store 23 21 + 28: 22(ptr) AccessChain 27(a2) 21 + Store 28 21 + 34: 14(int) Load 33(i) + 35: 22(ptr) AccessChain 32(b) 34 + Store 35 21 + 41: 22(ptr) AccessChain 39(c) 40 + Store 41 21 + Return + FunctionEnd + 9(getColor(): 7(fvec4) Function None 8 + 10: Label + 44: 43(ptr) AccessChain 12(color) 42 + Store 44 21 + 46: 22(ptr) AccessChain 19(a1) 45 + Store 46 21 + 47: 22(ptr) AccessChain 27(a2) 42 + Store 47 21 + 48: 22(ptr) AccessChain 32(b) 40 + Store 48 21 + 49: 37 Load 39(c) + 50: 22(ptr) AccessChain 32(b) 49 + Store 50 21 + 55: 52 Load 54(s2D) + 59: 7(fvec4) ImageSampleImplicitLod 55 58 + ReturnValue 59 + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/matrix2.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/matrix2.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/matrix2.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/matrix2.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -158,6 +158,9 @@ 0:49 'FragColor' ( out 4-component vector of float) 0:49 Constant: 0:49 3 (const int) +0:50 matrix mult second child into first child ( temp 3X4 matrix of float) +0:50 'm34' ( temp 3X4 matrix of float) +0:50 'colorTransform' ( uniform 3X3 matrix of float) 0:? Linker Objects 0:? 'colorTransform' ( uniform 3X3 matrix of float) 0:? 'Color' ( smooth in 3-component vector of float) @@ -331,6 +334,9 @@ 0:49 'FragColor' ( out 4-component vector of float) 0:49 Constant: 0:49 3 (const int) +0:50 matrix mult second child into first child ( temp 3X4 matrix of float) +0:50 'm34' ( temp 3X4 matrix of float) +0:50 'colorTransform' ( uniform 3X3 matrix of float) 0:? Linker Objects 0:? 'colorTransform' ( uniform 3X3 matrix of float) 0:? 'Color' ( smooth in 3-component vector of float) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/matrixError.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/matrixError.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/matrixError.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/matrixError.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -6,7 +6,9 @@ ERROR: 0:19: 'xy' : does not apply to this type: temp 2X3 matrix of float ERROR: 0:21: '[' : matrix index out of range '2' ERROR: 0:21: '[' : vector index out of range '4' -ERROR: 7 compilation errors. No code generated. +ERROR: 0:22: 'assign' : cannot convert from ' temp 2X3 matrix of float' to ' temp 2X3 matrix of float' +ERROR: 0:23: 'assign' : cannot convert from ' uniform 3X2 matrix of float' to ' temp 2X3 matrix of float' +ERROR: 9 compilation errors. No code generated. Shader version: 120 @@ -32,6 +34,8 @@ 0:21 2 (const int) 0:21 Constant: 0:21 4 (const int) +0:22 'm23' ( temp 2X3 matrix of float) +0:23 'm23' ( temp 2X3 matrix of float) 0:? Linker Objects 0:? 'v3' ( in 3-component vector of float) 0:? 'm32' ( uniform 3X2 matrix of float) @@ -64,6 +68,8 @@ 0:21 2 (const int) 0:21 Constant: 0:21 4 (const int) +0:22 'm23' ( temp 2X3 matrix of float) +0:23 'm23' ( temp 2X3 matrix of float) 0:? Linker Objects 0:? 'v3' ( in 3-component vector of float) 0:? 'm32' ( uniform 3X2 matrix of float) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/mixedArrayDecls.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/mixedArrayDecls.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/mixedArrayDecls.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/mixedArrayDecls.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,68 @@ +mixedArrayDecls.frag +ERROR: 0:30: '' : syntax error, unexpected LEFT_PAREN, expecting COMMA or SEMICOLON +ERROR: 1 compilation errors. No code generated. + + +Shader version: 450 +ERROR: node is still EOpNull! +0:16 Function Definition: foo(i1[14][15][6]; ( global 14-element array of 15-element array of 6-element array of int) +0:16 Function Parameters: +0:16 'p' ( in 14-element array of 15-element array of 6-element array of int) +0:16 Sequence +0:16 Branch: Return with expression +0:16 'p' ( in 14-element array of 15-element array of 6-element array of int) +0:18 Function Definition: main( ( global void) +0:18 Function Parameters: +0:20 Sequence +0:20 direct index ( temp 14-element array of int) +0:20 'g' ( global unsized 4-element array of 14-element array of int) +0:20 Constant: +0:20 3 (const int) +0:21 direct index ( temp 14-element array of int) +0:21 'h' ( global unsized 3-element array of 14-element array of int) +0:21 Constant: +0:21 2 (const int) +0:24 Function Definition: bar( ( global 4-element array of 3-element array of 2-element array of float) +0:24 Function Parameters: +0:? Sequence +0:24 Branch: Return with expression +0:24 'a' ( temp 4-element array of 3-element array of 2-element array of float) +0:? Linker Objects +0:? 's' ( global structure{ global 2-element array of 3-element array of int a, global 5-element array of 3-element array of int b}) +0:? 'c' ( global 4-element array of 5-element array of int) +0:? 'd' ( global 8-element array of 5-element array of int) +0:? 'e' ( global 11-element array of 9-element array of int) +0:? 'f' ( global 13-element array of 9-element array of int) +0:? 'g' ( global unsized 4-element array of 14-element array of int) +0:? 'h' ( global unsized 3-element array of 14-element array of int) +0:? 'inbinst' ( in 4-element array of 5-element array of 6-element array of block{ in 8-element array of 9-element array of 7-element array of float f}) +0:? 'barm' ( global 4-element array of 3-element array of 2-element array of float) + + +Linked fragment stage: + + +Shader version: 450 +ERROR: node is still EOpNull! +0:18 Function Definition: main( ( global void) +0:18 Function Parameters: +0:20 Sequence +0:20 direct index ( temp 14-element array of int) +0:20 'g' ( global 4-element array of 14-element array of int) +0:20 Constant: +0:20 3 (const int) +0:21 direct index ( temp 14-element array of int) +0:21 'h' ( global 3-element array of 14-element array of int) +0:21 Constant: +0:21 2 (const int) +0:? Linker Objects +0:? 's' ( global structure{ global 2-element array of 3-element array of int a, global 5-element array of 3-element array of int b}) +0:? 'c' ( global 4-element array of 5-element array of int) +0:? 'd' ( global 8-element array of 5-element array of int) +0:? 'e' ( global 11-element array of 9-element array of int) +0:? 'f' ( global 13-element array of 9-element array of int) +0:? 'g' ( global 4-element array of 14-element array of int) +0:? 'h' ( global 3-element array of 14-element array of int) +0:? 'inbinst' ( in 4-element array of 5-element array of 6-element array of block{ in 8-element array of 9-element array of 7-element array of float f}) +0:? 'barm' ( global 4-element array of 3-element array of 2-element array of float) + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/nonuniform.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/nonuniform.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/nonuniform.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/nonuniform.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,92 @@ +nonuniform.frag +ERROR: 0:10: 'nonuniformEXT' : for non-parameter, can only apply to 'in' or no storage qualifier +ERROR: 0:11: 'nonuniformEXT' : for non-parameter, can only apply to 'in' or no storage qualifier +ERROR: 0:12: 'nonuniformEXT' : for non-parameter, can only apply to 'in' or no storage qualifier +ERROR: 0:22: 'nonuniformEXT' : for non-parameter, can only apply to 'in' or no storage qualifier +ERROR: 0:28: 'constructor' : too many arguments +ERROR: 0:28: 'assign' : cannot convert from ' const float' to ' nonuniform temp int' +ERROR: 0:29: 'constructor' : not enough data provided for construction +ERROR: 0:29: 'assign' : cannot convert from ' const float' to ' nonuniform temp int' +ERROR: 0:32: 'nonuniformEXT' : not allowed on block or structure members +ERROR: 0:33: 'nonuniformEXT' : not allowed on block or structure members +ERROR: 10 compilation errors. No code generated. + + +Shader version: 450 +Requested GL_EXT_nonuniform_qualifier +ERROR: node is still EOpNull! +0:14 Function Definition: foo(i1;i1; ( nonuniform temp int) +0:14 Function Parameters: +0:14 'nupi' ( nonuniform in int) +0:14 'f' ( nonuniform out int) +0:16 Sequence +0:16 Branch: Return with expression +0:16 'nupi' ( nonuniform in int) +0:19 Function Definition: main( ( global void) +0:19 Function Parameters: +0:? Sequence +0:24 Function Call: foo(i1;i1; ( nonuniform temp int) +0:24 'nu_li' ( nonuniform temp int) +0:24 'nu_li' ( nonuniform temp int) +0:27 move second child to first child ( temp int) +0:27 'nu_li' ( nonuniform temp int) +0:27 add ( nonuniform temp int) +0:27 'a' ( nonuniform temp int) +0:27 component-wise multiply ( nonuniform temp int) +0:27 'a' ( temp int) +0:27 Constant: +0:27 2 (const int) +0:28 'nu_li' ( nonuniform temp int) +0:29 'nu_li' ( nonuniform temp int) +0:? Linker Objects +0:? 'nonuniformEXT' ( global int) +0:? 'nu_inv4' ( smooth nonuniform in 4-component vector of float) +0:? 'nu_gf' ( nonuniform temp float) +0:? 'nu_outv4' ( nonuniform out 4-component vector of float) +0:? 'nu_uv4' ( nonuniform uniform 4-component vector of float) +0:? 'nu_constf' ( nonuniform const float) +0:? 1.000000 +0:? 'ins' (layout( location=1) smooth in structure{ global float a, temp float b}) +0:? 'inb' (layout( location=3) in block{ in float a, in float b}) + + +Linked fragment stage: + + +Shader version: 450 +Requested GL_EXT_nonuniform_qualifier +ERROR: node is still EOpNull! +0:14 Function Definition: foo(i1;i1; ( nonuniform temp int) +0:14 Function Parameters: +0:14 'nupi' ( nonuniform in int) +0:14 'f' ( nonuniform out int) +0:16 Sequence +0:16 Branch: Return with expression +0:16 'nupi' ( nonuniform in int) +0:19 Function Definition: main( ( global void) +0:19 Function Parameters: +0:? Sequence +0:24 Function Call: foo(i1;i1; ( nonuniform temp int) +0:24 'nu_li' ( nonuniform temp int) +0:24 'nu_li' ( nonuniform temp int) +0:27 move second child to first child ( temp int) +0:27 'nu_li' ( nonuniform temp int) +0:27 add ( nonuniform temp int) +0:27 'a' ( nonuniform temp int) +0:27 component-wise multiply ( nonuniform temp int) +0:27 'a' ( temp int) +0:27 Constant: +0:27 2 (const int) +0:28 'nu_li' ( nonuniform temp int) +0:29 'nu_li' ( nonuniform temp int) +0:? Linker Objects +0:? 'nonuniformEXT' ( global int) +0:? 'nu_inv4' ( smooth nonuniform in 4-component vector of float) +0:? 'nu_gf' ( nonuniform temp float) +0:? 'nu_outv4' ( nonuniform out 4-component vector of float) +0:? 'nu_uv4' ( nonuniform uniform 4-component vector of float) +0:? 'nu_constf' ( nonuniform const float) +0:? 1.000000 +0:? 'ins' (layout( location=1) smooth in structure{ global float a, temp float b}) +0:? 'inb' (layout( location=3) in block{ in float a, in float b}) + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/numeral.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/numeral.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/numeral.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/numeral.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -85,12 +85,12 @@ 0:17 move second child to first child ( temp int) 0:17 'obig' ( temp int) 0:17 Constant: -0:17 995208915 (const int) +0:17 -1662398820 (const int) 0:18 Sequence 0:18 move second child to first child ( temp int) 0:18 'omax1' ( temp int) 0:18 Constant: -0:18 536870912 (const int) +0:18 0 (const int) 0:20 Sequence 0:20 move second child to first child ( temp uint) 0:20 'uo5' ( temp uint) @@ -225,7 +225,7 @@ 0:50 move second child to first child ( temp int) 0:50 'hbig' ( temp int) 0:50 Constant: -0:50 -1 (const int) +0:50 -15 (const int) 0:52 Sequence 0:52 move second child to first child ( temp float) 0:52 'f1' ( temp float) @@ -494,12 +494,12 @@ 0:17 move second child to first child ( temp int) 0:17 'obig' ( temp int) 0:17 Constant: -0:17 995208915 (const int) +0:17 -1662398820 (const int) 0:18 Sequence 0:18 move second child to first child ( temp int) 0:18 'omax1' ( temp int) 0:18 Constant: -0:18 536870912 (const int) +0:18 0 (const int) 0:20 Sequence 0:20 move second child to first child ( temp uint) 0:20 'uo5' ( temp uint) @@ -634,7 +634,7 @@ 0:50 move second child to first child ( temp int) 0:50 'hbig' ( temp int) 0:50 Constant: -0:50 -1 (const int) +0:50 -15 (const int) 0:52 Sequence 0:52 move second child to first child ( temp float) 0:52 'f1' ( temp float) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/nvShaderNoperspectiveInterpolation.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/nvShaderNoperspectiveInterpolation.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/nvShaderNoperspectiveInterpolation.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/nvShaderNoperspectiveInterpolation.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,38 @@ +nvShaderNoperspectiveInterpolation.frag +ERROR: 0:5: 'noperspective' : Reserved word. +ERROR: 0:5: 'noperspective' : not supported for this version or the enabled extensions +ERROR: 2 compilation errors. No code generated. + + +Shader version: 300 +Requested GL_NV_shader_noperspective_interpolation +ERROR: node is still EOpNull! +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:14 Sequence +0:14 move second child to first child ( temp mediump 4-component vector of float) +0:14 'fragColor' ( out mediump 4-component vector of float) +0:14 'color' ( noperspective in mediump 4-component vector of float) +0:? Linker Objects +0:? 'bad' ( noperspective in mediump 4-component vector of float) +0:? 'color' ( noperspective in mediump 4-component vector of float) +0:? 'fragColor' ( out mediump 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 300 +Requested GL_NV_shader_noperspective_interpolation +ERROR: node is still EOpNull! +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:14 Sequence +0:14 move second child to first child ( temp mediump 4-component vector of float) +0:14 'fragColor' ( out mediump 4-component vector of float) +0:14 'color' ( noperspective in mediump 4-component vector of float) +0:? Linker Objects +0:? 'bad' ( noperspective in mediump 4-component vector of float) +0:? 'color' ( noperspective in mediump 4-component vector of float) +0:? 'fragColor' ( out mediump 4-component vector of float) + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/preprocessor.pragma.vert.err vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/preprocessor.pragma.vert.err --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/preprocessor.pragma.vert.err 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/preprocessor.pragma.vert.err 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,2 @@ +WARNING: 0:10: '#pragma once' : not implemented + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/preprocessor.pragma.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/preprocessor.pragma.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/preprocessor.pragma.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/preprocessor.pragma.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -7,6 +7,8 @@ #pragma undefined_pragma(x,4) +#pragma once + int main(){ } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/preprocessor.simple.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/preprocessor.simple.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/preprocessor.simple.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/preprocessor.simple.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -25,6 +25,6 @@ == != & ^ | && ^^ || ? : += -= *= /= %= <<= >>= &= |= ^= - 1.2 2E10 5u - 5 lf + 1.2 2E10 5u - 5l f } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.basic.dcefunc.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.basic.dcefunc.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.basic.dcefunc.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.basic.dcefunc.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ remap.basic.dcefunc.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 22 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.basic.everything.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.basic.everything.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.basic.everything.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.basic.everything.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ remap.basic.everything.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 24969 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.basic.none.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.basic.none.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.basic.none.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.basic.none.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ remap.basic.none.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 22 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.basic.strip.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.basic.strip.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.basic.strip.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.basic.strip.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ remap.basic.strip.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 22 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.hlsl.sample.basic.everything.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.hlsl.sample.basic.everything.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.hlsl.sample.basic.everything.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.hlsl.sample.basic.everything.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -2,7 +2,7 @@ WARNING: 0:4: 'immediate sampler state' : unimplemented // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 24878 Capability Shader @@ -11,6 +11,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 5663 "main" 4253 3709 ExecutionMode 5663 OriginUpperLeft + ExecutionMode 5663 DepthReplacing Decorate 4727 DescriptorSet 0 Decorate 4727 Binding 0 Decorate 3305 DescriptorSet 0 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.hlsl.sample.basic.none.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.hlsl.sample.basic.none.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.hlsl.sample.basic.none.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.hlsl.sample.basic.none.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -2,7 +2,7 @@ WARNING: 0:4: 'immediate sampler state' : unimplemented // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 198 Capability Shader @@ -11,6 +11,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 188 192 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Source HLSL 500 Name 4 "main" Name 8 "PS_OUTPUT" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.hlsl.sample.basic.strip.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.hlsl.sample.basic.strip.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.hlsl.sample.basic.strip.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.hlsl.sample.basic.strip.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -2,7 +2,7 @@ WARNING: 0:4: 'immediate sampler state' : unimplemented // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 198 Capability Shader @@ -11,6 +11,7 @@ MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 188 192 ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing Decorate 45 DescriptorSet 0 Decorate 45 Binding 0 Decorate 49 DescriptorSet 0 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.hlsl.templatetypes.everything.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.hlsl.templatetypes.everything.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.hlsl.templatetypes.everything.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.hlsl.templatetypes.everything.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ remap.hlsl.templatetypes.everything.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 24954 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.hlsl.templatetypes.none.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.hlsl.templatetypes.none.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.hlsl.templatetypes.none.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.hlsl.templatetypes.none.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ remap.hlsl.templatetypes.none.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 160 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.if.everything.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.if.everything.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.if.everything.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.if.everything.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ remap.if.everything.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 22855 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.if.none.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.if.none.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.if.none.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.if.none.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ remap.if.none.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 25 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.similar_1a.everything.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.similar_1a.everything.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.similar_1a.everything.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.similar_1a.everything.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ remap.similar_1a.everything.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 24916 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.similar_1a.none.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.similar_1a.none.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.similar_1a.none.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.similar_1a.none.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ remap.similar_1a.none.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 86 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.similar_1b.everything.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.similar_1b.everything.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.similar_1b.everything.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.similar_1b.everything.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ remap.similar_1b.everything.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 24916 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.similar_1b.none.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.similar_1b.none.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.similar_1b.none.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.similar_1b.none.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ remap.similar_1b.none.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 91 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.specconst.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.specconst.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.specconst.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.specconst.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ remap.specconst.comp // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 16104 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.switch.everything.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.switch.everything.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.switch.everything.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.switch.everything.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -3,7 +3,7 @@ "precision mediump int; precision highp float;" // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 23990 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.switch.none.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.switch.none.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.switch.none.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.switch.none.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -3,7 +3,7 @@ "precision mediump int; precision highp float;" // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 48 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.uniformarray.everything.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.uniformarray.everything.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.uniformarray.everything.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.uniformarray.everything.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ remap.uniformarray.everything.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 25030 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.uniformarray.none.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.uniformarray.none.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/remap.uniformarray.none.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/remap.uniformarray.none.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ remap.uniformarray.none.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 53 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/runtimeArray.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/runtimeArray.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/runtimeArray.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/runtimeArray.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,632 @@ +runtimeArray.vert +WARNING: 0:33: '[]' : assuming binding count of one for compile-time checking of binding numbers for unsized array +WARNING: 0:34: '[]' : assuming binding count of one for compile-time checking of binding numbers for unsized array +WARNING: 0:37: '[]' : assuming binding count of one for compile-time checking of binding numbers for unsized array +WARNING: 0:38: '[]' : assuming binding count of one for compile-time checking of binding numbers for unsized array +WARNING: 0:39: '[]' : assuming binding count of one for compile-time checking of binding numbers for unsized array +WARNING: 0:40: '[]' : assuming binding count of one for compile-time checking of binding numbers for unsized array +ERROR: 0:61: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:62: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:63: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:66: 'length' : array must be declared with a size before using this method +ERROR: 0:67: 'length' : array must be declared with a size before using this method +ERROR: 0:68: 'length' : array must be declared with a size before using this method +ERROR: 0:71: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:72: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:73: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:76: 'length' : array must be declared with a size before using this method +ERROR: 0:77: 'length' : array must be declared with a size before using this method +ERROR: 0:78: 'length' : array must be declared with a size before using this method +ERROR: 0:81: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:82: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:83: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:86: 'length' : array must be declared with a size before using this method +ERROR: 0:87: 'length' : array must be declared with a size before using this method +ERROR: 0:88: 'length' : array must be declared with a size before using this method +ERROR: 0:100: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier +ERROR: 0:101: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier +ERROR: 0:102: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier +ERROR: 0:103: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier +ERROR: 0:104: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier +ERROR: 0:105: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier +ERROR: 0:106: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier +ERROR: 0:107: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier +ERROR: 26 compilation errors. No code generated. + + +Shader version: 450 +ERROR: node is still EOpNull! +0:44 Function Definition: main( ( global void) +0:44 Function Parameters: +0:46 Sequence +0:46 direct index (layout( column_major shared) temp int) +0:46 a: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:46 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 3 (const int) +0:47 direct index (layout( column_major shared) temp float) +0:47 b: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:47 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 3 (const int) +0:48 direct index (layout( column_major shared) temp int) +0:48 a: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:48 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:48 Constant: +0:48 0 (const int) +0:48 Constant: +0:48 3 (const int) +0:49 direct index (layout( column_major shared) temp float) +0:49 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:49 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:49 Constant: +0:49 1 (const int) +0:49 Constant: +0:49 3 (const int) +0:51 direct index (layout( column_major shared) temp int) +0:51 a: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:51 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:51 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:51 Constant: +0:51 3 (const int) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:52 direct index (layout( column_major shared) temp float) +0:52 b: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:52 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:52 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:52 Constant: +0:52 3 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 3 (const int) +0:53 direct index (layout( column_major shared) temp int) +0:53 a: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:53 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:53 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:53 Constant: +0:53 3 (const int) +0:53 Constant: +0:53 0 (const int) +0:53 Constant: +0:53 3 (const int) +0:54 direct index (layout( column_major shared) temp float) +0:54 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:54 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:54 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:54 Constant: +0:54 3 (const int) +0:54 Constant: +0:54 1 (const int) +0:54 Constant: +0:54 3 (const int) +0:56 direct index (layout( column_major shared) temp int) +0:56 aua: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:56 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:56 Constant: +0:56 0 (const uint) +0:56 Constant: +0:56 3 (const int) +0:57 direct index (layout( column_major shared) temp float) +0:57 aub: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:57 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:57 Constant: +0:57 1 (const uint) +0:57 Constant: +0:57 3 (const int) +0:58 direct index (layout( column_major shared) temp int) +0:58 aba: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:58 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:58 Constant: +0:58 0 (const uint) +0:58 Constant: +0:58 3 (const int) +0:59 direct index (layout( column_major shared) temp float) +0:59 abb: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:59 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:59 Constant: +0:59 1 (const uint) +0:59 Constant: +0:59 3 (const int) +0:61 indirect index (layout( column_major shared) temp int) +0:61 a: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:61 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:61 Constant: +0:61 0 (const int) +0:61 'i' ( global int) +0:62 indirect index (layout( column_major shared) temp float) +0:62 b: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:62 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:62 Constant: +0:62 1 (const int) +0:62 'i' ( global int) +0:63 indirect index (layout( column_major shared) temp int) +0:63 a: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:63 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:63 Constant: +0:63 0 (const int) +0:63 'i' ( global int) +0:64 indirect index (layout( column_major shared) temp float) +0:64 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:64 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:64 Constant: +0:64 1 (const int) +0:64 'i' ( global int) +0:66 Constant: +0:66 1 (const int) +0:67 Constant: +0:67 1 (const int) +0:68 Constant: +0:68 1 (const int) +0:69 array length ( temp int) +0:69 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:69 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:69 Constant: +0:69 1 (const int) +0:71 indirect index (layout( column_major shared) temp int) +0:71 a: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:71 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:71 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:71 Constant: +0:71 1 (const int) +0:71 Constant: +0:71 0 (const int) +0:71 'i' ( global int) +0:72 indirect index (layout( column_major shared) temp float) +0:72 b: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:72 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:72 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 'i' ( global int) +0:73 indirect index (layout( column_major shared) temp int) +0:73 a: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:73 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:73 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:73 Constant: +0:73 1 (const int) +0:73 Constant: +0:73 0 (const int) +0:73 'i' ( global int) +0:74 indirect index (layout( column_major shared) temp float) +0:74 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:74 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:74 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:74 Constant: +0:74 1 (const int) +0:74 Constant: +0:74 1 (const int) +0:74 'i' ( global int) +0:76 Constant: +0:76 1 (const int) +0:77 Constant: +0:77 1 (const int) +0:78 Constant: +0:78 1 (const int) +0:79 array length ( temp int) +0:79 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:79 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:79 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:79 Constant: +0:79 1 (const int) +0:79 Constant: +0:79 1 (const int) +0:81 indirect index (layout( column_major shared) temp int) +0:81 aua: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:81 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:81 Constant: +0:81 0 (const uint) +0:81 'i' ( global int) +0:82 indirect index (layout( column_major shared) temp float) +0:82 aub: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:82 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:82 Constant: +0:82 1 (const uint) +0:82 'i' ( global int) +0:83 indirect index (layout( column_major shared) temp int) +0:83 aba: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:83 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:83 Constant: +0:83 0 (const uint) +0:83 'i' ( global int) +0:84 indirect index (layout( column_major shared) temp float) +0:84 abb: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:84 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:84 Constant: +0:84 1 (const uint) +0:84 'i' ( global int) +0:86 Constant: +0:86 1 (const int) +0:87 Constant: +0:87 1 (const int) +0:88 Constant: +0:88 1 (const int) +0:89 array length ( temp int) +0:89 abb: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:89 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:89 Constant: +0:89 1 (const uint) +0:91 direct index (layout( binding=1) temp samplerBuffer) +0:91 'uniformTexelBufferDyn' (layout( binding=1) uniform runtime-sized array of samplerBuffer) +0:91 Constant: +0:91 1 (const int) +0:92 direct index (layout( binding=2 r32f) temp imageBuffer) +0:92 'storageTexelBufferDyn' (layout( binding=2 r32f) uniform runtime-sized array of imageBuffer) +0:92 Constant: +0:92 1 (const int) +0:93 direct index (layout( binding=3 column_major shared) temp block{layout( column_major shared) uniform float a}) +0:93 'uniformBuffer' (layout( binding=3 column_major shared) uniform runtime-sized array of block{layout( column_major shared) uniform float a}) +0:93 Constant: +0:93 1 (const int) +0:94 direct index (layout( binding=4 column_major shared) temp block{layout( column_major shared) buffer float b}) +0:94 'storageBuffer' (layout( binding=4 column_major shared) buffer runtime-sized array of block{layout( column_major shared) buffer float b}) +0:94 Constant: +0:94 1 (const int) +0:95 direct index (layout( binding=5) temp sampler2D) +0:95 'sampledImage' (layout( binding=5) uniform runtime-sized array of sampler2D) +0:95 Constant: +0:95 1 (const int) +0:96 direct index (layout( binding=6 r32f) temp image2D) +0:96 'storageImage' (layout( binding=6 r32f) uniform runtime-sized array of image2D) +0:96 Constant: +0:96 1 (const int) +0:97 direct index (layout( binding=8) temp samplerBuffer) +0:97 'uniformTexelBuffer' (layout( binding=8) uniform runtime-sized array of samplerBuffer) +0:97 Constant: +0:97 1 (const int) +0:98 direct index (layout( binding=9 r32f) temp imageBuffer) +0:98 'storageTexelBuffer' (layout( binding=9 r32f) uniform runtime-sized array of imageBuffer) +0:98 Constant: +0:98 1 (const int) +0:100 indirect index (layout( binding=1) temp samplerBuffer) +0:100 'uniformTexelBufferDyn' (layout( binding=1) uniform runtime-sized array of samplerBuffer) +0:100 'i' ( global int) +0:101 indirect index (layout( binding=2 r32f) temp imageBuffer) +0:101 'storageTexelBufferDyn' (layout( binding=2 r32f) uniform runtime-sized array of imageBuffer) +0:101 'i' ( global int) +0:102 indirect index (layout( binding=3 column_major shared) temp block{layout( column_major shared) uniform float a}) +0:102 'uniformBuffer' (layout( binding=3 column_major shared) uniform runtime-sized array of block{layout( column_major shared) uniform float a}) +0:102 'i' ( global int) +0:103 indirect index (layout( binding=4 column_major shared) temp block{layout( column_major shared) buffer float b}) +0:103 'storageBuffer' (layout( binding=4 column_major shared) buffer runtime-sized array of block{layout( column_major shared) buffer float b}) +0:103 'i' ( global int) +0:104 indirect index (layout( binding=5) temp sampler2D) +0:104 'sampledImage' (layout( binding=5) uniform runtime-sized array of sampler2D) +0:104 'i' ( global int) +0:105 indirect index (layout( binding=6 r32f) temp image2D) +0:105 'storageImage' (layout( binding=6 r32f) uniform runtime-sized array of image2D) +0:105 'i' ( global int) +0:106 indirect index (layout( binding=8) temp samplerBuffer) +0:106 'uniformTexelBuffer' (layout( binding=8) uniform runtime-sized array of samplerBuffer) +0:106 'i' ( global int) +0:107 indirect index (layout( binding=9 r32f) temp imageBuffer) +0:107 'storageTexelBuffer' (layout( binding=9 r32f) uniform runtime-sized array of imageBuffer) +0:107 'i' ( global int) +0:? Linker Objects +0:? 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:? 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:? 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:? 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:? 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:? 'uniformTexelBufferDyn' (layout( binding=1) uniform runtime-sized array of samplerBuffer) +0:? 'storageTexelBufferDyn' (layout( binding=2 r32f) uniform runtime-sized array of imageBuffer) +0:? 'uniformBuffer' (layout( binding=3 column_major shared) uniform runtime-sized array of block{layout( column_major shared) uniform float a}) +0:? 'storageBuffer' (layout( binding=4 column_major shared) buffer runtime-sized array of block{layout( column_major shared) buffer float b}) +0:? 'sampledImage' (layout( binding=5) uniform runtime-sized array of sampler2D) +0:? 'storageImage' (layout( binding=6 r32f) uniform runtime-sized array of image2D) +0:? 'uniformTexelBuffer' (layout( binding=8) uniform runtime-sized array of samplerBuffer) +0:? 'storageTexelBuffer' (layout( binding=9 r32f) uniform runtime-sized array of imageBuffer) +0:? 'i' ( global int) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 450 +ERROR: node is still EOpNull! +0:44 Function Definition: main( ( global void) +0:44 Function Parameters: +0:46 Sequence +0:46 direct index (layout( column_major shared) temp int) +0:46 a: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:46 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 3 (const int) +0:47 direct index (layout( column_major shared) temp float) +0:47 b: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:47 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 3 (const int) +0:48 direct index (layout( column_major shared) temp int) +0:48 a: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:48 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:48 Constant: +0:48 0 (const int) +0:48 Constant: +0:48 3 (const int) +0:49 direct index (layout( column_major shared) temp float) +0:49 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:49 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:49 Constant: +0:49 1 (const int) +0:49 Constant: +0:49 3 (const int) +0:51 direct index (layout( column_major shared) temp int) +0:51 a: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:51 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:51 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:51 Constant: +0:51 3 (const int) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:52 direct index (layout( column_major shared) temp float) +0:52 b: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:52 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:52 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:52 Constant: +0:52 3 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 3 (const int) +0:53 direct index (layout( column_major shared) temp int) +0:53 a: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:53 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:53 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:53 Constant: +0:53 3 (const int) +0:53 Constant: +0:53 0 (const int) +0:53 Constant: +0:53 3 (const int) +0:54 direct index (layout( column_major shared) temp float) +0:54 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:54 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:54 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:54 Constant: +0:54 3 (const int) +0:54 Constant: +0:54 1 (const int) +0:54 Constant: +0:54 3 (const int) +0:56 direct index (layout( column_major shared) temp int) +0:56 aua: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:56 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:56 Constant: +0:56 0 (const uint) +0:56 Constant: +0:56 3 (const int) +0:57 direct index (layout( column_major shared) temp float) +0:57 aub: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:57 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:57 Constant: +0:57 1 (const uint) +0:57 Constant: +0:57 3 (const int) +0:58 direct index (layout( column_major shared) temp int) +0:58 aba: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:58 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:58 Constant: +0:58 0 (const uint) +0:58 Constant: +0:58 3 (const int) +0:59 direct index (layout( column_major shared) temp float) +0:59 abb: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:59 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:59 Constant: +0:59 1 (const uint) +0:59 Constant: +0:59 3 (const int) +0:61 indirect index (layout( column_major shared) temp int) +0:61 a: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:61 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:61 Constant: +0:61 0 (const int) +0:61 'i' ( global int) +0:62 indirect index (layout( column_major shared) temp float) +0:62 b: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:62 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:62 Constant: +0:62 1 (const int) +0:62 'i' ( global int) +0:63 indirect index (layout( column_major shared) temp int) +0:63 a: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:63 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:63 Constant: +0:63 0 (const int) +0:63 'i' ( global int) +0:64 indirect index (layout( column_major shared) temp float) +0:64 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:64 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:64 Constant: +0:64 1 (const int) +0:64 'i' ( global int) +0:66 Constant: +0:66 1 (const int) +0:67 Constant: +0:67 1 (const int) +0:68 Constant: +0:68 1 (const int) +0:69 array length ( temp int) +0:69 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:69 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:69 Constant: +0:69 1 (const int) +0:71 indirect index (layout( column_major shared) temp int) +0:71 a: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:71 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:71 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:71 Constant: +0:71 1 (const int) +0:71 Constant: +0:71 0 (const int) +0:71 'i' ( global int) +0:72 indirect index (layout( column_major shared) temp float) +0:72 b: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:72 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:72 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 'i' ( global int) +0:73 indirect index (layout( column_major shared) temp int) +0:73 a: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:73 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:73 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:73 Constant: +0:73 1 (const int) +0:73 Constant: +0:73 0 (const int) +0:73 'i' ( global int) +0:74 indirect index (layout( column_major shared) temp float) +0:74 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:74 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:74 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:74 Constant: +0:74 1 (const int) +0:74 Constant: +0:74 1 (const int) +0:74 'i' ( global int) +0:76 Constant: +0:76 1 (const int) +0:77 Constant: +0:77 1 (const int) +0:78 Constant: +0:78 1 (const int) +0:79 array length ( temp int) +0:79 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:79 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:79 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:79 Constant: +0:79 1 (const int) +0:79 Constant: +0:79 1 (const int) +0:81 indirect index (layout( column_major shared) temp int) +0:81 aua: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:81 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:81 Constant: +0:81 0 (const uint) +0:81 'i' ( global int) +0:82 indirect index (layout( column_major shared) temp float) +0:82 aub: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:82 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:82 Constant: +0:82 1 (const uint) +0:82 'i' ( global int) +0:83 indirect index (layout( column_major shared) temp int) +0:83 aba: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:83 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:83 Constant: +0:83 0 (const uint) +0:83 'i' ( global int) +0:84 indirect index (layout( column_major shared) temp float) +0:84 abb: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:84 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:84 Constant: +0:84 1 (const uint) +0:84 'i' ( global int) +0:86 Constant: +0:86 1 (const int) +0:87 Constant: +0:87 1 (const int) +0:88 Constant: +0:88 1 (const int) +0:89 array length ( temp int) +0:89 abb: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:89 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:89 Constant: +0:89 1 (const uint) +0:91 direct index (layout( binding=1) temp samplerBuffer) +0:91 'uniformTexelBufferDyn' (layout( binding=1) uniform runtime-sized array of samplerBuffer) +0:91 Constant: +0:91 1 (const int) +0:92 direct index (layout( binding=2 r32f) temp imageBuffer) +0:92 'storageTexelBufferDyn' (layout( binding=2 r32f) uniform runtime-sized array of imageBuffer) +0:92 Constant: +0:92 1 (const int) +0:93 direct index (layout( binding=3 column_major shared) temp block{layout( column_major shared) uniform float a}) +0:93 'uniformBuffer' (layout( binding=3 column_major shared) uniform runtime-sized array of block{layout( column_major shared) uniform float a}) +0:93 Constant: +0:93 1 (const int) +0:94 direct index (layout( binding=4 column_major shared) temp block{layout( column_major shared) buffer float b}) +0:94 'storageBuffer' (layout( binding=4 column_major shared) buffer runtime-sized array of block{layout( column_major shared) buffer float b}) +0:94 Constant: +0:94 1 (const int) +0:95 direct index (layout( binding=5) temp sampler2D) +0:95 'sampledImage' (layout( binding=5) uniform runtime-sized array of sampler2D) +0:95 Constant: +0:95 1 (const int) +0:96 direct index (layout( binding=6 r32f) temp image2D) +0:96 'storageImage' (layout( binding=6 r32f) uniform runtime-sized array of image2D) +0:96 Constant: +0:96 1 (const int) +0:97 direct index (layout( binding=8) temp samplerBuffer) +0:97 'uniformTexelBuffer' (layout( binding=8) uniform runtime-sized array of samplerBuffer) +0:97 Constant: +0:97 1 (const int) +0:98 direct index (layout( binding=9 r32f) temp imageBuffer) +0:98 'storageTexelBuffer' (layout( binding=9 r32f) uniform runtime-sized array of imageBuffer) +0:98 Constant: +0:98 1 (const int) +0:100 indirect index (layout( binding=1) temp samplerBuffer) +0:100 'uniformTexelBufferDyn' (layout( binding=1) uniform runtime-sized array of samplerBuffer) +0:100 'i' ( global int) +0:101 indirect index (layout( binding=2 r32f) temp imageBuffer) +0:101 'storageTexelBufferDyn' (layout( binding=2 r32f) uniform runtime-sized array of imageBuffer) +0:101 'i' ( global int) +0:102 indirect index (layout( binding=3 column_major shared) temp block{layout( column_major shared) uniform float a}) +0:102 'uniformBuffer' (layout( binding=3 column_major shared) uniform runtime-sized array of block{layout( column_major shared) uniform float a}) +0:102 'i' ( global int) +0:103 indirect index (layout( binding=4 column_major shared) temp block{layout( column_major shared) buffer float b}) +0:103 'storageBuffer' (layout( binding=4 column_major shared) buffer runtime-sized array of block{layout( column_major shared) buffer float b}) +0:103 'i' ( global int) +0:104 indirect index (layout( binding=5) temp sampler2D) +0:104 'sampledImage' (layout( binding=5) uniform runtime-sized array of sampler2D) +0:104 'i' ( global int) +0:105 indirect index (layout( binding=6 r32f) temp image2D) +0:105 'storageImage' (layout( binding=6 r32f) uniform runtime-sized array of image2D) +0:105 'i' ( global int) +0:106 indirect index (layout( binding=8) temp samplerBuffer) +0:106 'uniformTexelBuffer' (layout( binding=8) uniform runtime-sized array of samplerBuffer) +0:106 'i' ( global int) +0:107 indirect index (layout( binding=9 r32f) temp imageBuffer) +0:107 'storageTexelBuffer' (layout( binding=9 r32f) uniform runtime-sized array of imageBuffer) +0:107 'i' ( global int) +0:? Linker Objects +0:? 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:? 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:? 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:? 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:? 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:? 'uniformTexelBufferDyn' (layout( binding=1) uniform runtime-sized array of samplerBuffer) +0:? 'storageTexelBufferDyn' (layout( binding=2 r32f) uniform runtime-sized array of imageBuffer) +0:? 'uniformBuffer' (layout( binding=3 column_major shared) uniform runtime-sized array of block{layout( column_major shared) uniform float a}) +0:? 'storageBuffer' (layout( binding=4 column_major shared) buffer runtime-sized array of block{layout( column_major shared) buffer float b}) +0:? 'sampledImage' (layout( binding=5) uniform runtime-sized array of sampler2D) +0:? 'storageImage' (layout( binding=6 r32f) uniform runtime-sized array of image2D) +0:? 'uniformTexelBuffer' (layout( binding=8) uniform runtime-sized array of samplerBuffer) +0:? 'storageTexelBuffer' (layout( binding=9 r32f) uniform runtime-sized array of imageBuffer) +0:? 'i' ( global int) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/specExamplesConf.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/specExamplesConf.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/specExamplesConf.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/specExamplesConf.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,599 @@ +specExamples.vert +ERROR: 0:29: 'location' : can only apply to uniform, buffer, in, or out storage qualifiers +ERROR: 0:31: 'triangles' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:31: 'invocations' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:33: 'lines' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:35: 'triangle_strip' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:35: 'max_vertices' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:36: 'max_vertices' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:37: 'triangle_strip' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:41: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:43: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:45: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:46: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:47: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:50: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:55: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:80: 's17' : redefinition +ERROR: 0:85: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 0:87: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 0:89: 'binding' : atomic_uint binding is too large +ERROR: 0:91: 'bar' : redefinition +ERROR: 0:92: 'atomic_uint' : layout(binding=X) is required +ERROR: 0:94: 'a2' : redefinition +ERROR: 0:95: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 0:96: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 0:97: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 0:106: '' : vertex input cannot be further qualified +ERROR: 0:106: 'redeclaration' : cannot change storage, memory, or auxiliary qualification of gl_FrontColor +ERROR: 0:112: 'ColorIvn' : identifier not previously declared +ERROR: 0:132: 'shared' : not supported in this stage: vertex +ERROR: 0:134: '' : function does not return a value: funcA +ERROR: 0:136: '' : function does not return a value: funcB +ERROR: 0:153: '' : function does not return a value: func3 +ERROR: 0:170: 'coherent' : argument cannot drop memory qualifier when passed to formal parameter +ERROR: 33 compilation errors. No code generated. + + +Shader version: 430 +Requested GL_3DL_array_objects +ERROR: node is still EOpNull! +0:134 Function Definition: funcA(I21; ( global 4-component vector of float) +0:134 Function Parameters: +0:134 'a' ( restrict in image2D) +0:136 Function Definition: funcB(I21; ( global 4-component vector of float) +0:136 Function Parameters: +0:136 'a' ( in image2D) +0:140 Function Definition: func(f1;f1;f1;f1; ( global float) +0:140 Function Parameters: +0:140 'e' ( in float) +0:140 'f' ( in float) +0:140 'g' ( in float) +0:140 'h' ( in float) +0:142 Sequence +0:142 Branch: Return with expression +0:142 add ( temp float) +0:142 component-wise multiply ( temp float) +0:142 'e' ( in float) +0:142 'f' ( in float) +0:142 component-wise multiply ( temp float) +0:142 'g' ( in float) +0:142 'h' ( in float) +0:146 Function Definition: func2(f1;f1;f1;f1; ( global float) +0:146 Function Parameters: +0:146 'e' ( in float) +0:146 'f' ( in float) +0:146 'g' ( in float) +0:146 'h' ( in float) +0:148 Sequence +0:148 Sequence +0:148 move second child to first child ( temp float) +0:148 'result' ( noContraction temp float) +0:148 add ( temp float) +0:148 component-wise multiply ( temp float) +0:148 'e' ( in float) +0:148 'f' ( in float) +0:148 component-wise multiply ( temp float) +0:148 'g' ( in float) +0:148 'h' ( in float) +0:150 Branch: Return with expression +0:150 'result' ( noContraction temp float) +0:153 Function Definition: func3(f1;f1;f1; ( global float) +0:153 Function Parameters: +0:153 'i' ( in float) +0:153 'j' ( in float) +0:153 'k' ( noContraction out float) +0:155 Sequence +0:155 move second child to first child ( temp float) +0:155 'k' ( noContraction out float) +0:155 add ( temp float) +0:155 component-wise multiply ( temp float) +0:155 'i' ( in float) +0:155 'i' ( in float) +0:155 'j' ( in float) +0:158 Function Definition: main( ( global void) +0:158 Function Parameters: +0:160 Sequence +0:160 Sequence +0:160 move second child to first child ( temp 3-component vector of float) +0:160 'r' ( temp 3-component vector of float) +0:160 Construct vec3 ( temp 3-component vector of float) +0:160 component-wise multiply ( temp 4-component vector of float) +0:160 'a' ( in 4-component vector of float) +0:160 'b' ( in 4-component vector of float) +0:161 Sequence +0:161 move second child to first child ( temp 3-component vector of float) +0:161 's' ( temp 3-component vector of float) +0:161 Construct vec3 ( temp 3-component vector of float) +0:161 component-wise multiply ( temp 4-component vector of float) +0:161 'c' ( in 4-component vector of float) +0:161 'd' ( in 4-component vector of float) +0:162 move second child to first child ( temp 3-component vector of float) +0:162 vector swizzle ( noContraction temp 3-component vector of float) +0:162 'v' ( noContraction smooth out 4-component vector of float) +0:162 Sequence +0:162 Constant: +0:162 0 (const int) +0:162 Constant: +0:162 1 (const int) +0:162 Constant: +0:162 2 (const int) +0:162 add ( temp 3-component vector of float) +0:162 'r' ( temp 3-component vector of float) +0:162 's' ( temp 3-component vector of float) +0:163 move second child to first child ( temp float) +0:163 direct index ( noContraction temp float) +0:163 'v' ( noContraction smooth out 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 add ( temp float) +0:163 component-wise multiply ( temp float) +0:163 direct index ( temp float) +0:163 'a' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 direct index ( temp float) +0:163 'b' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 component-wise multiply ( temp float) +0:163 direct index ( temp float) +0:163 'c' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 direct index ( temp float) +0:163 'd' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:164 move second child to first child ( temp float) +0:164 direct index ( noContraction temp float) +0:164 'v' ( noContraction smooth out 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 Function Call: func(f1;f1;f1;f1; ( global float) +0:164 direct index ( temp float) +0:164 'a' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 direct index ( temp float) +0:164 'b' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 direct index ( temp float) +0:164 'c' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 direct index ( temp float) +0:164 'd' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:166 move second child to first child ( temp float) +0:166 direct index ( noContraction temp float) +0:166 'v' ( noContraction smooth out 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 Function Call: func2(f1;f1;f1;f1; ( global float) +0:166 direct index ( temp float) +0:166 'a' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 direct index ( temp float) +0:166 'b' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 direct index ( temp float) +0:166 'c' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 direct index ( temp float) +0:166 'd' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:167 Function Call: func3(f1;f1;f1; ( global float) +0:167 component-wise multiply ( temp float) +0:167 direct index ( temp float) +0:167 'a' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 direct index ( temp float) +0:167 'b' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 component-wise multiply ( temp float) +0:167 direct index ( temp float) +0:167 'c' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 direct index ( temp float) +0:167 'd' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 direct index ( noContraction temp float) +0:167 'v' ( noContraction smooth out 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:169 Function Call: funcA(I21; ( global 4-component vector of float) +0:169 'img1' (layout( rgba32f) uniform image2D) +0:170 Function Call: funcB(I21; ( global 4-component vector of float) +0:170 'img2' (layout( rgba32f) coherent uniform image2D) +0:? Sequence +0:178 Sequence +0:178 move second child to first child ( temp structure{ temp float intensity, temp 3-component vector of float position}) +0:178 'lightVar' ( temp structure{ temp float intensity, temp 3-component vector of float position}) +0:178 Constant: +0:178 3.000000 +0:178 1.000000 +0:178 2.000000 +0:178 3.000000 +0:? Sequence +0:185 Sequence +0:185 move second child to first child ( temp 5-element array of float) +0:185 'a' ( temp 5-element array of float) +0:185 Construct float ( temp 5-element array of float) +0:185 'g' ( temp float) +0:185 Constant: +0:185 1.000000 +0:185 'g' ( temp float) +0:185 Constant: +0:185 2.300000 +0:185 'g' ( temp float) +0:188 move second child to first child ( temp 3-element array of float) +0:188 'b' ( temp 3-element array of float) +0:188 Construct float ( temp 3-element array of float) +0:188 'g' ( temp float) +0:188 add ( temp float) +0:188 'g' ( temp float) +0:188 Constant: +0:188 1.000000 +0:188 add ( temp float) +0:188 'g' ( temp float) +0:188 Constant: +0:188 2.000000 +0:191 Sequence +0:191 Sequence +0:191 move second child to first child ( temp 2-element array of 4-component vector of float) +0:191 'b' ( temp 2-element array of 4-component vector of float) +0:191 Constant: +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:192 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:192 'b' ( temp 2-element array of 4-component vector of float) +0:192 'b' ( temp 2-element array of 4-component vector of float) +0:192 'b' ( temp 2-element array of 4-component vector of float) +0:193 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:193 'b' ( temp 2-element array of 4-component vector of float) +0:193 'b' ( temp 2-element array of 4-component vector of float) +0:193 'b' ( temp 2-element array of 4-component vector of float) +0:194 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:194 'b' ( temp 2-element array of 4-component vector of float) +0:194 'b' ( temp 2-element array of 4-component vector of float) +0:194 'b' ( temp 2-element array of 4-component vector of float) +0:? Linker Objects +0:? 'Coords' ( out block{ out 4-component vector of float Position, out 2-component vector of float Texture}) +0:? 'anon@0' ( out block{ out 4-component vector of float Color}) +0:? 'transforms' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform 4X4 matrix of float ModelViewMatrix, layout( column_major shared) uniform 4X4 matrix of float ModelViewProjectionMatrix, layout( column_major shared) uniform unsized 1-element array of 4-component vector of float a, layout( column_major shared) uniform float Deformation}) +0:? 'normal' (layout( location=3) in 4-component vector of float) +0:? 'colors' (layout( location=6) in 3-element array of 4-component vector of float) +0:? 'transforms2' (layout( location=9) in 2-element array of 4X4 matrix of float) +0:? 's' (layout( location=3) temp structure{ global 3-component vector of float a1, global 2X2 matrix of float b, global 2-element array of 4-component vector of float c}) +0:? 'var1' ( smooth out 4-component vector of float) +0:? 'anon@1' ( out block{ out 4-component vector of float var2, out 2-component vector of float var3, out 3-component vector of float var4}) +0:? 'var5' ( smooth out 4-component vector of float) +0:? 'anon@2' ( out block{ out 4-component vector of float var6}) +0:? 'var7' ( smooth out 4-component vector of float) +0:? 'anon@3' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4X4 matrix of float M1, layout( column_major std140 offset=64) uniform 4X4 matrix of float M2, layout( row_major std140 offset=128) uniform 3X3 matrix of float N1}) +0:? 'anon@4' (layout( column_major shared) uniform block{layout( column_major shared) uniform 4X4 matrix of float M13, layout( row_major shared) uniform 4X4 matrix of float m14, layout( column_major shared) uniform 3X3 matrix of float N12}) +0:? 's17' (layout( binding=3) uniform sampler2D) +0:? 'a2' (layout( binding=2 offset=4) uniform atomic_uint) +0:? 'bar' (layout( binding=2) uniform atomic_uint) +0:? 'bar23' (layout( offset=8) uniform atomic_uint) +0:? 'b2' (layout( binding=2) uniform atomic_uint) +0:? 'c2' (layout( binding=3) uniform atomic_uint) +0:? 'd2' (layout( binding=2) uniform atomic_uint) +0:? 'anon@5' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, flat out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'ColorInv' ( smooth out 3-component vector of float) +0:? 'Color4' ( invariant centroid smooth out 3-component vector of float) +0:? 'position' ( noContraction smooth out 4-component vector of float) +0:? 'Color5' ( noContraction smooth out 3-component vector of float) +0:? 'a' ( in 4-component vector of float) +0:? 'b' ( in 4-component vector of float) +0:? 'c' ( in 4-component vector of float) +0:? 'd' ( in 4-component vector of float) +0:? 'v' ( noContraction smooth out 4-component vector of float) +0:? 'anon@6' (layout( column_major shared) coherent buffer block{layout( column_major shared) readonly buffer 4-component vector of float member1, layout( column_major shared) buffer 4-component vector of float member2}) +0:? 'anon@7' (layout( column_major shared) buffer block{layout( column_major shared) coherent readonly buffer 4-component vector of float member1A, layout( column_major shared) coherent buffer 4-component vector of float member2A}) +0:? 'shv' ( shared 4-component vector of float) +0:? 'img1' (layout( rgba32f) uniform image2D) +0:? 'img2' (layout( rgba32f) coherent uniform image2D) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 430 +Requested GL_3DL_array_objects +ERROR: node is still EOpNull! +0:134 Function Definition: funcA(I21; ( global 4-component vector of float) +0:134 Function Parameters: +0:134 'a' ( restrict in image2D) +0:136 Function Definition: funcB(I21; ( global 4-component vector of float) +0:136 Function Parameters: +0:136 'a' ( in image2D) +0:140 Function Definition: func(f1;f1;f1;f1; ( global float) +0:140 Function Parameters: +0:140 'e' ( in float) +0:140 'f' ( in float) +0:140 'g' ( in float) +0:140 'h' ( in float) +0:142 Sequence +0:142 Branch: Return with expression +0:142 add ( temp float) +0:142 component-wise multiply ( temp float) +0:142 'e' ( in float) +0:142 'f' ( in float) +0:142 component-wise multiply ( temp float) +0:142 'g' ( in float) +0:142 'h' ( in float) +0:146 Function Definition: func2(f1;f1;f1;f1; ( global float) +0:146 Function Parameters: +0:146 'e' ( in float) +0:146 'f' ( in float) +0:146 'g' ( in float) +0:146 'h' ( in float) +0:148 Sequence +0:148 Sequence +0:148 move second child to first child ( temp float) +0:148 'result' ( noContraction temp float) +0:148 add ( temp float) +0:148 component-wise multiply ( temp float) +0:148 'e' ( in float) +0:148 'f' ( in float) +0:148 component-wise multiply ( temp float) +0:148 'g' ( in float) +0:148 'h' ( in float) +0:150 Branch: Return with expression +0:150 'result' ( noContraction temp float) +0:153 Function Definition: func3(f1;f1;f1; ( global float) +0:153 Function Parameters: +0:153 'i' ( in float) +0:153 'j' ( in float) +0:153 'k' ( noContraction out float) +0:155 Sequence +0:155 move second child to first child ( temp float) +0:155 'k' ( noContraction out float) +0:155 add ( temp float) +0:155 component-wise multiply ( temp float) +0:155 'i' ( in float) +0:155 'i' ( in float) +0:155 'j' ( in float) +0:158 Function Definition: main( ( global void) +0:158 Function Parameters: +0:160 Sequence +0:160 Sequence +0:160 move second child to first child ( temp 3-component vector of float) +0:160 'r' ( temp 3-component vector of float) +0:160 Construct vec3 ( temp 3-component vector of float) +0:160 component-wise multiply ( temp 4-component vector of float) +0:160 'a' ( in 4-component vector of float) +0:160 'b' ( in 4-component vector of float) +0:161 Sequence +0:161 move second child to first child ( temp 3-component vector of float) +0:161 's' ( temp 3-component vector of float) +0:161 Construct vec3 ( temp 3-component vector of float) +0:161 component-wise multiply ( temp 4-component vector of float) +0:161 'c' ( in 4-component vector of float) +0:161 'd' ( in 4-component vector of float) +0:162 move second child to first child ( temp 3-component vector of float) +0:162 vector swizzle ( noContraction temp 3-component vector of float) +0:162 'v' ( noContraction smooth out 4-component vector of float) +0:162 Sequence +0:162 Constant: +0:162 0 (const int) +0:162 Constant: +0:162 1 (const int) +0:162 Constant: +0:162 2 (const int) +0:162 add ( temp 3-component vector of float) +0:162 'r' ( temp 3-component vector of float) +0:162 's' ( temp 3-component vector of float) +0:163 move second child to first child ( temp float) +0:163 direct index ( noContraction temp float) +0:163 'v' ( noContraction smooth out 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 add ( temp float) +0:163 component-wise multiply ( temp float) +0:163 direct index ( temp float) +0:163 'a' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 direct index ( temp float) +0:163 'b' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 component-wise multiply ( temp float) +0:163 direct index ( temp float) +0:163 'c' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 direct index ( temp float) +0:163 'd' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:164 move second child to first child ( temp float) +0:164 direct index ( noContraction temp float) +0:164 'v' ( noContraction smooth out 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 Function Call: func(f1;f1;f1;f1; ( global float) +0:164 direct index ( temp float) +0:164 'a' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 direct index ( temp float) +0:164 'b' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 direct index ( temp float) +0:164 'c' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 direct index ( temp float) +0:164 'd' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:166 move second child to first child ( temp float) +0:166 direct index ( noContraction temp float) +0:166 'v' ( noContraction smooth out 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 Function Call: func2(f1;f1;f1;f1; ( global float) +0:166 direct index ( temp float) +0:166 'a' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 direct index ( temp float) +0:166 'b' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 direct index ( temp float) +0:166 'c' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 direct index ( temp float) +0:166 'd' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:167 Function Call: func3(f1;f1;f1; ( global float) +0:167 component-wise multiply ( temp float) +0:167 direct index ( temp float) +0:167 'a' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 direct index ( temp float) +0:167 'b' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 component-wise multiply ( temp float) +0:167 direct index ( temp float) +0:167 'c' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 direct index ( temp float) +0:167 'd' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 direct index ( noContraction temp float) +0:167 'v' ( noContraction smooth out 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:169 Function Call: funcA(I21; ( global 4-component vector of float) +0:169 'img1' (layout( rgba32f) uniform image2D) +0:170 Function Call: funcB(I21; ( global 4-component vector of float) +0:170 'img2' (layout( rgba32f) coherent uniform image2D) +0:? Sequence +0:178 Sequence +0:178 move second child to first child ( temp structure{ temp float intensity, temp 3-component vector of float position}) +0:178 'lightVar' ( temp structure{ temp float intensity, temp 3-component vector of float position}) +0:178 Constant: +0:178 3.000000 +0:178 1.000000 +0:178 2.000000 +0:178 3.000000 +0:? Sequence +0:185 Sequence +0:185 move second child to first child ( temp 5-element array of float) +0:185 'a' ( temp 5-element array of float) +0:185 Construct float ( temp 5-element array of float) +0:185 'g' ( temp float) +0:185 Constant: +0:185 1.000000 +0:185 'g' ( temp float) +0:185 Constant: +0:185 2.300000 +0:185 'g' ( temp float) +0:188 move second child to first child ( temp 3-element array of float) +0:188 'b' ( temp 3-element array of float) +0:188 Construct float ( temp 3-element array of float) +0:188 'g' ( temp float) +0:188 add ( temp float) +0:188 'g' ( temp float) +0:188 Constant: +0:188 1.000000 +0:188 add ( temp float) +0:188 'g' ( temp float) +0:188 Constant: +0:188 2.000000 +0:191 Sequence +0:191 Sequence +0:191 move second child to first child ( temp 2-element array of 4-component vector of float) +0:191 'b' ( temp 2-element array of 4-component vector of float) +0:191 Constant: +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:192 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:192 'b' ( temp 2-element array of 4-component vector of float) +0:192 'b' ( temp 2-element array of 4-component vector of float) +0:192 'b' ( temp 2-element array of 4-component vector of float) +0:193 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:193 'b' ( temp 2-element array of 4-component vector of float) +0:193 'b' ( temp 2-element array of 4-component vector of float) +0:193 'b' ( temp 2-element array of 4-component vector of float) +0:194 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:194 'b' ( temp 2-element array of 4-component vector of float) +0:194 'b' ( temp 2-element array of 4-component vector of float) +0:194 'b' ( temp 2-element array of 4-component vector of float) +0:? Linker Objects +0:? 'Coords' ( out block{ out 4-component vector of float Position, out 2-component vector of float Texture}) +0:? 'anon@0' ( out block{ out 4-component vector of float Color}) +0:? 'transforms' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform 4X4 matrix of float ModelViewMatrix, layout( column_major shared) uniform 4X4 matrix of float ModelViewProjectionMatrix, layout( column_major shared) uniform 1-element array of 4-component vector of float a, layout( column_major shared) uniform float Deformation}) +0:? 'normal' (layout( location=3) in 4-component vector of float) +0:? 'colors' (layout( location=6) in 3-element array of 4-component vector of float) +0:? 'transforms2' (layout( location=9) in 2-element array of 4X4 matrix of float) +0:? 's' (layout( location=3) temp structure{ global 3-component vector of float a1, global 2X2 matrix of float b, global 2-element array of 4-component vector of float c}) +0:? 'var1' ( smooth out 4-component vector of float) +0:? 'anon@1' ( out block{ out 4-component vector of float var2, out 2-component vector of float var3, out 3-component vector of float var4}) +0:? 'var5' ( smooth out 4-component vector of float) +0:? 'anon@2' ( out block{ out 4-component vector of float var6}) +0:? 'var7' ( smooth out 4-component vector of float) +0:? 'anon@3' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4X4 matrix of float M1, layout( column_major std140 offset=64) uniform 4X4 matrix of float M2, layout( row_major std140 offset=128) uniform 3X3 matrix of float N1}) +0:? 'anon@4' (layout( column_major shared) uniform block{layout( column_major shared) uniform 4X4 matrix of float M13, layout( row_major shared) uniform 4X4 matrix of float m14, layout( column_major shared) uniform 3X3 matrix of float N12}) +0:? 's17' (layout( binding=3) uniform sampler2D) +0:? 'a2' (layout( binding=2 offset=4) uniform atomic_uint) +0:? 'bar' (layout( binding=2) uniform atomic_uint) +0:? 'bar23' (layout( offset=8) uniform atomic_uint) +0:? 'b2' (layout( binding=2) uniform atomic_uint) +0:? 'c2' (layout( binding=3) uniform atomic_uint) +0:? 'd2' (layout( binding=2) uniform atomic_uint) +0:? 'anon@5' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, flat out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'ColorInv' ( smooth out 3-component vector of float) +0:? 'Color4' ( invariant centroid smooth out 3-component vector of float) +0:? 'position' ( noContraction smooth out 4-component vector of float) +0:? 'Color5' ( noContraction smooth out 3-component vector of float) +0:? 'a' ( in 4-component vector of float) +0:? 'b' ( in 4-component vector of float) +0:? 'c' ( in 4-component vector of float) +0:? 'd' ( in 4-component vector of float) +0:? 'v' ( noContraction smooth out 4-component vector of float) +0:? 'anon@6' (layout( column_major shared) coherent buffer block{layout( column_major shared) readonly buffer 4-component vector of float member1, layout( column_major shared) buffer 4-component vector of float member2}) +0:? 'anon@7' (layout( column_major shared) buffer block{layout( column_major shared) coherent readonly buffer 4-component vector of float member1A, layout( column_major shared) coherent buffer 4-component vector of float member2A}) +0:? 'shv' ( shared 4-component vector of float) +0:? 'img1' (layout( rgba32f) uniform image2D) +0:? 'img2' (layout( rgba32f) coherent uniform image2D) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/specExamples.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/specExamples.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/specExamples.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/specExamples.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -320,7 +320,7 @@ 0:? 'factor' (layout( location=3 index=1) out 4-component vector of float) 0:? 'colors' (layout( location=2) out 3-element array of 4-component vector of float) 0:? 'gl_FragDepth' ( gl_FragDepth float FragDepth) -0:? 'anon@2' ( in block{ in float FogFragCoord gl_FogFragCoord, in implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, flat in 4-component vector of float Color gl_Color, in 4-component vector of float SecondaryColor gl_SecondaryColor}) +0:? 'anon@2' ( in block{ in float FogFragCoord gl_FogFragCoord, in unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, flat in 4-component vector of float Color gl_Color, in 4-component vector of float SecondaryColor gl_SecondaryColor}) Linked fragment stage: diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/specExamples.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/specExamples.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/specExamples.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/specExamples.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -19,7 +19,6 @@ ERROR: 0:87: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings ERROR: 0:89: 'binding' : atomic_uint binding is too large ERROR: 0:91: 'bar' : redefinition -ERROR: 0:92: 'atomic_uint' : layout(binding=X) is required ERROR: 0:94: 'a2' : redefinition ERROR: 0:95: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings ERROR: 0:96: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings @@ -32,7 +31,7 @@ ERROR: 0:136: '' : function does not return a value: funcB ERROR: 0:153: '' : function does not return a value: func3 ERROR: 0:170: 'coherent' : argument cannot drop memory qualifier when passed to formal parameter -ERROR: 33 compilation errors. No code generated. +ERROR: 32 compilation errors. No code generated. Shader version: 430 @@ -277,7 +276,7 @@ 0:? Linker Objects 0:? 'Coords' ( out block{ out 4-component vector of float Position, out 2-component vector of float Texture}) 0:? 'anon@0' ( out block{ out 4-component vector of float Color}) -0:? 'transforms' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform 4X4 matrix of float ModelViewMatrix, layout( column_major shared) uniform 4X4 matrix of float ModelViewProjectionMatrix, layout( column_major shared) uniform implicitly-sized array of 4-component vector of float a, layout( column_major shared) uniform float Deformation}) +0:? 'transforms' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform 4X4 matrix of float ModelViewMatrix, layout( column_major shared) uniform 4X4 matrix of float ModelViewProjectionMatrix, layout( column_major shared) uniform unsized 1-element array of 4-component vector of float a, layout( column_major shared) uniform float Deformation}) 0:? 'normal' (layout( location=3) in 4-component vector of float) 0:? 'colors' (layout( location=6) in 3-element array of 4-component vector of float) 0:? 'transforms2' (layout( location=9) in 2-element array of 4X4 matrix of float) @@ -296,7 +295,7 @@ 0:? 'b2' (layout( binding=2) uniform atomic_uint) 0:? 'c2' (layout( binding=3) uniform atomic_uint) 0:? 'd2' (layout( binding=2) uniform atomic_uint) -0:? 'anon@5' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, flat out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'anon@5' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, flat out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) 0:? 'ColorInv' ( smooth out 3-component vector of float) 0:? 'Color4' ( invariant centroid smooth out 3-component vector of float) 0:? 'position' ( noContraction smooth out 4-component vector of float) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.100ops.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.100ops.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.100ops.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.100ops.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.100ops.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 49 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.130.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.130.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.130.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.130.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -2,7 +2,7 @@ WARNING: 0:31: '#extension' : extension is only partially supported: GL_ARB_gpu_shader5 // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 205 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.140.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.140.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.140.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.140.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.140.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 96 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.150.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.150.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.150.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.150.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.150.geom // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 71 Capability Geometry diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.150.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.150.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.150.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.150.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.150.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 63 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.300BuiltIns.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.300BuiltIns.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.300BuiltIns.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.300BuiltIns.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.300BuiltIns.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 42 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.300layout.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.300layout.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.300layout.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.300layout.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.300layout.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 37 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.300layoutp.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.300layoutp.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.300layoutp.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.300layoutp.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.300layoutp.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 115 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.300layout.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.300layout.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.300layout.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.300layout.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.300layout.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 163 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.310.bitcast.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.310.bitcast.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.310.bitcast.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.310.bitcast.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.310.bitcast.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 153 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.310.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.310.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.310.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.310.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,7 +1,7 @@ spv.310.comp // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 69 +// Generated by (magic number): 80006 +// Id's are bound by 71 Capability Shader Capability DeviceGroup @@ -13,17 +13,17 @@ Source ESSL 310 SourceExtension "GL_EXT_device_group" Name 4 "main" - Name 13 "outb" - MemberName 13(outb) 0 "f" - MemberName 13(outb) 1 "g" - MemberName 13(outb) 2 "h" - MemberName 13(outb) 3 "uns" - Name 15 "outbname" - Name 19 "s" - Name 24 "outbna" - MemberName 24(outbna) 0 "k" - MemberName 24(outbna) 1 "na" - Name 26 "outbnamena" + Name 12 "outb" + MemberName 12(outb) 0 "f" + MemberName 12(outb) 1 "g" + MemberName 12(outb) 2 "h" + MemberName 12(outb) 3 "uns" + Name 14 "outbname" + Name 18 "s" + Name 23 "outbna" + MemberName 23(outbna) 0 "k" + MemberName 23(outbna) 1 "na" + Name 25 "outbnamena" Name 42 "i" Name 48 "outs" MemberName 48(outs) 0 "s" @@ -31,17 +31,17 @@ Name 50 "outnames" Name 53 "gl_LocalInvocationID" Name 64 "gl_DeviceIndex" - Decorate 12 ArrayStride 16 - MemberDecorate 13(outb) 0 Offset 0 - MemberDecorate 13(outb) 1 Offset 4 - MemberDecorate 13(outb) 2 Offset 8 - MemberDecorate 13(outb) 3 Offset 16 - Decorate 13(outb) BufferBlock - Decorate 15(outbname) DescriptorSet 0 - MemberDecorate 24(outbna) 0 Offset 0 - MemberDecorate 24(outbna) 1 Offset 16 - Decorate 24(outbna) BufferBlock - Decorate 26(outbnamena) DescriptorSet 0 + Decorate 11 ArrayStride 16 + MemberDecorate 12(outb) 0 Offset 0 + MemberDecorate 12(outb) 1 Offset 4 + MemberDecorate 12(outb) 2 Offset 8 + MemberDecorate 12(outb) 3 Offset 16 + Decorate 12(outb) BufferBlock + Decorate 14(outbname) DescriptorSet 0 + MemberDecorate 23(outbna) 0 Offset 0 + MemberDecorate 23(outbna) 1 Offset 16 + Decorate 23(outbna) BufferBlock + Decorate 25(outbnamena) DescriptorSet 0 Decorate 47 ArrayStride 16 MemberDecorate 48(outs) 0 Offset 0 MemberDecorate 48(outs) 1 Offset 16 @@ -49,81 +49,85 @@ Decorate 50(outnames) DescriptorSet 0 Decorate 53(gl_LocalInvocationID) BuiltIn LocalInvocationId Decorate 64(gl_DeviceIndex) BuiltIn DeviceIndex - Decorate 68 BuiltIn WorkgroupSize + Decorate 70 BuiltIn WorkgroupSize 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 7: 6(int) Constant 2 - 8: 6(int) Constant 1 - 9: 6(int) Constant 0 - 10: TypeFloat 32 - 11: TypeVector 10(float) 3 - 12: TypeRuntimeArray 11(fvec3) - 13(outb): TypeStruct 10(float) 10(float) 10(float) 12 - 14: TypePointer Uniform 13(outb) - 15(outbname): 14(ptr) Variable Uniform - 16: TypeInt 32 1 - 17: 16(int) Constant 0 - 18: TypePointer Workgroup 10(float) - 19(s): 18(ptr) Variable Workgroup - 21: TypePointer Uniform 10(float) - 23: TypeVector 10(float) 4 - 24(outbna): TypeStruct 16(int) 23(fvec4) - 25: TypePointer Uniform 24(outbna) - 26(outbnamena): 25(ptr) Variable Uniform - 27: 16(int) Constant 1 - 30: TypePointer Uniform 23(fvec4) - 32: 16(int) Constant 3 - 33: 16(int) Constant 18 - 36: 16(int) Constant 17 - 37: 10(float) Constant 1077936128 - 38: 11(fvec3) ConstantComposite 37 37 37 - 39: TypePointer Uniform 11(fvec3) - 41: TypePointer Workgroup 16(int) + 8: 6(int) Constant 264 + 9: TypeFloat 32 + 10: TypeVector 9(float) 3 + 11: TypeRuntimeArray 10(fvec3) + 12(outb): TypeStruct 9(float) 9(float) 9(float) 11 + 13: TypePointer Uniform 12(outb) + 14(outbname): 13(ptr) Variable Uniform + 15: TypeInt 32 1 + 16: 15(int) Constant 0 + 17: TypePointer Workgroup 9(float) + 18(s): 17(ptr) Variable Workgroup + 20: TypePointer Uniform 9(float) + 22: TypeVector 9(float) 4 + 23(outbna): TypeStruct 15(int) 22(fvec4) + 24: TypePointer Uniform 23(outbna) + 25(outbnamena): 24(ptr) Variable Uniform + 26: 15(int) Constant 1 + 29: TypePointer Uniform 22(fvec4) + 31: 15(int) Constant 3 + 32: 15(int) Constant 18 + 33: 6(int) Constant 0 + 36: 15(int) Constant 17 + 37: 9(float) Constant 1077936128 + 38: 10(fvec3) ConstantComposite 37 37 37 + 39: TypePointer Uniform 10(fvec3) + 41: TypePointer Workgroup 15(int) 42(i): 41(ptr) Variable Workgroup - 47: TypeRuntimeArray 23(fvec4) - 48(outs): TypeStruct 16(int) 47 + 47: TypeRuntimeArray 22(fvec4) + 48(outs): TypeStruct 15(int) 47 49: TypePointer Uniform 48(outs) 50(outnames): 49(ptr) Variable Uniform 51: TypeVector 6(int) 3 52: TypePointer Input 51(ivec3) 53(gl_LocalInvocationID): 52(ptr) Variable Input 54: TypePointer Input 6(int) - 61: TypePointer Uniform 16(int) - 63: TypePointer Input 16(int) + 61: TypePointer Uniform 15(int) + 63: TypePointer Input 15(int) 64(gl_DeviceIndex): 63(ptr) Variable Input - 65: 6(int) Constant 16 - 66: 6(int) Constant 32 - 67: 6(int) Constant 4 - 68: 51(ivec3) ConstantComposite 65 66 67 + 65: 6(int) Constant 1 + 66: 6(int) Constant 3400 + 67: 6(int) Constant 16 + 68: 6(int) Constant 32 + 69: 6(int) Constant 4 + 70: 51(ivec3) ConstantComposite 67 68 69 4(main): 2 Function None 3 5: Label - ControlBarrier 7 8 9 - 20: 10(float) Load 19(s) - 22: 21(ptr) AccessChain 15(outbname) 17 - Store 22 20 - 28: 10(float) Load 19(s) - 29: 23(fvec4) CompositeConstruct 28 28 28 28 - 31: 30(ptr) AccessChain 26(outbnamena) 27 - Store 31 29 - 34: 21(ptr) AccessChain 15(outbname) 32 33 9 - 35: 10(float) Load 34 - Store 19(s) 35 - 40: 39(ptr) AccessChain 15(outbname) 32 36 + ControlBarrier 7 7 8 + 19: 9(float) Load 18(s) + 21: 20(ptr) AccessChain 14(outbname) 16 + Store 21 19 + 27: 9(float) Load 18(s) + 28: 22(fvec4) CompositeConstruct 27 27 27 27 + 30: 29(ptr) AccessChain 25(outbnamena) 26 + Store 30 28 + 34: 20(ptr) AccessChain 14(outbname) 31 32 33 + 35: 9(float) Load 34 + Store 18(s) 35 + 40: 39(ptr) AccessChain 14(outbname) 31 36 Store 40 38 - 43: 16(int) Load 42(i) - 44: 10(float) Load 19(s) - 45: 11(fvec3) CompositeConstruct 44 44 44 - 46: 39(ptr) AccessChain 15(outbname) 32 43 + 43: 15(int) Load 42(i) + 44: 9(float) Load 18(s) + 45: 10(fvec3) CompositeConstruct 44 44 44 + 46: 39(ptr) AccessChain 14(outbname) 31 43 Store 46 45 - 55: 54(ptr) AccessChain 53(gl_LocalInvocationID) 9 + 55: 54(ptr) AccessChain 53(gl_LocalInvocationID) 33 56: 6(int) Load 55 - 57: 10(float) Load 19(s) - 58: 23(fvec4) CompositeConstruct 57 57 57 57 - 59: 30(ptr) AccessChain 50(outnames) 27 56 + 57: 9(float) Load 18(s) + 58: 22(fvec4) CompositeConstruct 57 57 57 57 + 59: 29(ptr) AccessChain 50(outnames) 26 56 Store 59 58 - 60: 16(int) ArrayLength 15(outbname) 3 - 62: 61(ptr) AccessChain 50(outnames) 17 + 60: 15(int) ArrayLength 14(outbname) 3 + 62: 61(ptr) AccessChain 50(outnames) 16 Store 62 60 + MemoryBarrier 65 8 + MemoryBarrier 7 66 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.330.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.330.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.330.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.330.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.330.geom // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 32 Capability Geometry diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.400.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.400.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.400.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.400.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.400.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 1118 Capability Shader @@ -273,10 +273,10 @@ 439(bvec2v): 438(ptr) Variable Function 448(bvec3v): 447(ptr) Variable Function 457(bvec4v): 456(ptr) Variable Function - 556: 429(ptr) Variable Function - 565: 438(ptr) Variable Function - 574: 447(ptr) Variable Function - 583: 456(ptr) Variable Function + 557: 429(ptr) Variable Function + 566: 438(ptr) Variable Function + 575: 447(ptr) Variable Function + 584: 456(ptr) Variable Function 739(dmat2v): 738(ptr) Variable Function 745(dmat3v): 744(ptr) Variable Function 751(dmat4v): 750(ptr) Variable Function @@ -875,61 +875,61 @@ 554: 53(fvec4) Load 55(dvec4v) 555: 455(bvec4) IsNan 554 Store 457(bvec4v) 555 - 557: 428(bool) Load 430(boolv) + 556: 428(bool) Load 430(boolv) SelectionMerge 559 None - BranchConditional 557 558 562 + BranchConditional 556 558 562 558: Label 560: 39(float) Load 41(doublev) 561: 428(bool) IsInf 560 - Store 556 561 + Store 557 561 Branch 559 562: Label - Store 556 563 + Store 557 563 Branch 559 559: Label - 564: 428(bool) Load 556 + 564: 428(bool) Load 557 Store 430(boolv) 564 - 566: 428(bool) Load 430(boolv) + 565: 428(bool) Load 430(boolv) SelectionMerge 568 None - BranchConditional 566 567 571 + BranchConditional 565 567 571 567: Label 569: 43(fvec2) Load 45(dvec2v) 570: 437(bvec2) IsInf 569 - Store 565 570 + Store 566 570 Branch 568 571: Label - Store 565 572 + Store 566 572 Branch 568 568: Label - 573: 437(bvec2) Load 565 + 573: 437(bvec2) Load 566 Store 439(bvec2v) 573 - 575: 428(bool) Load 430(boolv) + 574: 428(bool) Load 430(boolv) SelectionMerge 577 None - BranchConditional 575 576 580 + BranchConditional 574 576 580 576: Label 578: 48(fvec3) Load 50(dvec3v) 579: 446(bvec3) IsInf 578 - Store 574 579 + Store 575 579 Branch 577 580: Label - Store 574 581 + Store 575 581 Branch 577 577: Label - 582: 446(bvec3) Load 574 + 582: 446(bvec3) Load 575 Store 448(bvec3v) 582 - 584: 428(bool) Load 430(boolv) + 583: 428(bool) Load 430(boolv) SelectionMerge 586 None - BranchConditional 584 585 589 + BranchConditional 583 585 589 585: Label 587: 53(fvec4) Load 55(dvec4v) 588: 455(bvec4) IsInf 587 - Store 583 588 + Store 584 588 Branch 586 589: Label - Store 583 590 + Store 584 590 Branch 586 586: Label - 591: 455(bvec4) Load 583 + 591: 455(bvec4) Load 584 Store 457(bvec4v) 591 592: 39(float) Load 41(doublev) 593: 39(float) ExtInst 1(GLSL.std.450) 66(Length) 592 @@ -1368,18 +1368,18 @@ 997: 10(float) Select 995 996 21 998: 39(float) FConvert 997 999: 39(float) FAdd 994 998 - 1000: 437(bvec2) Load 439(bvec2v) - 1001: 428(bool) CompositeExtract 1000 0 + 1000: 429(ptr) AccessChain 439(bvec2v) 33 + 1001: 428(bool) Load 1000 1002: 10(float) Select 1001 996 21 1003: 39(float) FConvert 1002 1004: 39(float) FAdd 999 1003 - 1005: 446(bvec3) Load 448(bvec3v) - 1006: 428(bool) CompositeExtract 1005 0 + 1005: 429(ptr) AccessChain 448(bvec3v) 33 + 1006: 428(bool) Load 1005 1007: 10(float) Select 1006 996 21 1008: 39(float) FConvert 1007 1009: 39(float) FAdd 1004 1008 - 1010: 455(bvec4) Load 457(bvec4v) - 1011: 428(bool) CompositeExtract 1010 0 + 1010: 429(ptr) AccessChain 457(bvec4v) 33 + 1011: 428(bool) Load 1010 1012: 10(float) Select 1011 996 21 1013: 39(float) FConvert 1012 1014: 39(float) FAdd 1009 1013 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.400.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.400.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.400.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.400.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,14 +1,14 @@ spv.400.tesc // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 93 +// Generated by (magic number): 80006 +// Id's are bound by 92 Capability Tessellation Capability TessellationPointSize Capability ClipDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint TessellationControl 4 "main" 24 41 44 47 54 68 73 79 83 84 87 88 91 92 + EntryPoint TessellationControl 4 "main" 24 41 44 47 53 67 72 78 82 83 86 87 90 91 ExecutionMode 4 OutputVertices 4 Source GLSL 400 SourceExtension "GL_ARB_separate_shader_objects" @@ -32,17 +32,17 @@ MemberName 50(gl_PerVertex) 0 "gl_Position" MemberName 50(gl_PerVertex) 1 "gl_PointSize" MemberName 50(gl_PerVertex) 2 "gl_ClipDistance" - Name 54 "gl_out" - Name 68 "gl_TessLevelOuter" - Name 73 "gl_TessLevelInner" - Name 78 "outa" - Name 79 "patchOut" - Name 83 "inb" - Name 84 "ind" - Name 87 "ivla" - Name 88 "ivlb" - Name 91 "ovla" - Name 92 "ovlb" + Name 53 "gl_out" + Name 67 "gl_TessLevelOuter" + Name 72 "gl_TessLevelInner" + Name 77 "outa" + Name 78 "patchOut" + Name 82 "inb" + Name 83 "ind" + Name 86 "ivla" + Name 87 "ivlb" + Name 90 "ovla" + Name 91 "ovlb" MemberDecorate 20(gl_PerVertex) 0 BuiltIn Position MemberDecorate 20(gl_PerVertex) 1 BuiltIn PointSize MemberDecorate 20(gl_PerVertex) 2 BuiltIn ClipDistance @@ -54,20 +54,20 @@ MemberDecorate 50(gl_PerVertex) 1 BuiltIn PointSize MemberDecorate 50(gl_PerVertex) 2 BuiltIn ClipDistance Decorate 50(gl_PerVertex) Block - Decorate 68(gl_TessLevelOuter) Patch - Decorate 68(gl_TessLevelOuter) BuiltIn TessLevelOuter - Decorate 73(gl_TessLevelInner) Patch - Decorate 73(gl_TessLevelInner) BuiltIn TessLevelInner - Decorate 79(patchOut) Patch - Decorate 87(ivla) Location 3 - Decorate 88(ivlb) Location 4 - Decorate 91(ovla) Location 3 - Decorate 92(ovlb) Location 4 + Decorate 67(gl_TessLevelOuter) Patch + Decorate 67(gl_TessLevelOuter) BuiltIn TessLevelOuter + Decorate 72(gl_TessLevelInner) Patch + Decorate 72(gl_TessLevelInner) BuiltIn TessLevelInner + Decorate 78(patchOut) Patch + Decorate 86(ivla) Location 3 + Decorate 87(ivlb) Location 4 + Decorate 90(ovla) Location 3 + Decorate 91(ovlb) Location 4 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 7: 6(int) Constant 2 - 8: 6(int) Constant 1 + 8: 6(int) Constant 4 9: 6(int) Constant 0 10: TypeInt 32 1 11: TypePointer Function 10(int) @@ -94,37 +94,36 @@ 47(gl_InvocationID): 40(ptr) Variable Input 49: TypeArray 14(float) 7 50(gl_PerVertex): TypeStruct 15(fvec4) 14(float) 49 - 51: 6(int) Constant 4 - 52: TypeArray 50(gl_PerVertex) 51 - 53: TypePointer Output 52 - 54(gl_out): 53(ptr) Variable Output - 57: TypePointer Output 15(fvec4) - 61: TypePointer Output 14(float) - 66: TypeArray 14(float) 51 - 67: TypePointer Output 66 -68(gl_TessLevelOuter): 67(ptr) Variable Output - 69: 10(int) Constant 3 - 70: 14(float) Constant 1078774989 - 72: TypePointer Output 49 -73(gl_TessLevelInner): 72(ptr) Variable Output - 74: 14(float) Constant 1067869798 - 76: TypeArray 10(int) 51 - 77: TypePointer Private 76 - 78(outa): 77(ptr) Variable Private - 79(patchOut): 57(ptr) Variable Output - 80: TypeVector 14(float) 2 - 81: TypeArray 80(fvec2) 21 - 82: TypePointer Input 81 - 83(inb): 82(ptr) Variable Input - 84(ind): 82(ptr) Variable Input - 85: TypeArray 15(fvec4) 21 - 86: TypePointer Input 85 - 87(ivla): 86(ptr) Variable Input - 88(ivlb): 86(ptr) Variable Input - 89: TypeArray 15(fvec4) 51 - 90: TypePointer Output 89 - 91(ovla): 90(ptr) Variable Output - 92(ovlb): 90(ptr) Variable Output + 51: TypeArray 50(gl_PerVertex) 8 + 52: TypePointer Output 51 + 53(gl_out): 52(ptr) Variable Output + 56: TypePointer Output 15(fvec4) + 60: TypePointer Output 14(float) + 65: TypeArray 14(float) 8 + 66: TypePointer Output 65 +67(gl_TessLevelOuter): 66(ptr) Variable Output + 68: 10(int) Constant 3 + 69: 14(float) Constant 1078774989 + 71: TypePointer Output 49 +72(gl_TessLevelInner): 71(ptr) Variable Output + 73: 14(float) Constant 1067869798 + 75: TypeArray 10(int) 8 + 76: TypePointer Private 75 + 77(outa): 76(ptr) Variable Private + 78(patchOut): 56(ptr) Variable Output + 79: TypeVector 14(float) 2 + 80: TypeArray 79(fvec2) 21 + 81: TypePointer Input 80 + 82(inb): 81(ptr) Variable Input + 83(ind): 81(ptr) Variable Input + 84: TypeArray 15(fvec4) 21 + 85: TypePointer Input 84 + 86(ivla): 85(ptr) Variable Input + 87(ivlb): 85(ptr) Variable Input + 88: TypeArray 15(fvec4) 8 + 89: TypePointer Output 88 + 90(ovla): 89(ptr) Variable Output + 91(ovlb): 89(ptr) Variable Output 4(main): 2 Function None 3 5: Label 12(a): 11(ptr) Variable Function @@ -151,21 +150,21 @@ Store 43(pid) 45 48: 10(int) Load 47(gl_InvocationID) Store 46(iid) 48 - 55: 10(int) Load 47(gl_InvocationID) - 56: 15(fvec4) Load 17(p) - 58: 57(ptr) AccessChain 54(gl_out) 55 26 - Store 58 56 - 59: 10(int) Load 47(gl_InvocationID) - 60: 14(float) Load 31(ps) - 62: 61(ptr) AccessChain 54(gl_out) 59 25 - Store 62 60 - 63: 10(int) Load 47(gl_InvocationID) - 64: 14(float) Load 35(cd) - 65: 61(ptr) AccessChain 54(gl_out) 63 36 25 - Store 65 64 - 71: 61(ptr) AccessChain 68(gl_TessLevelOuter) 69 - Store 71 70 - 75: 61(ptr) AccessChain 73(gl_TessLevelInner) 25 - Store 75 74 + 54: 10(int) Load 47(gl_InvocationID) + 55: 15(fvec4) Load 17(p) + 57: 56(ptr) AccessChain 53(gl_out) 54 26 + Store 57 55 + 58: 10(int) Load 47(gl_InvocationID) + 59: 14(float) Load 31(ps) + 61: 60(ptr) AccessChain 53(gl_out) 58 25 + Store 61 59 + 62: 10(int) Load 47(gl_InvocationID) + 63: 14(float) Load 35(cd) + 64: 60(ptr) AccessChain 53(gl_out) 62 36 25 + Store 64 63 + 70: 60(ptr) AccessChain 67(gl_TessLevelOuter) 68 + Store 70 69 + 74: 60(ptr) AccessChain 72(gl_TessLevelInner) 25 + Store 74 73 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.400.tese.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.400.tese.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.400.tese.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.400.tese.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.400.tese // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 96 Capability Tessellation diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.420.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.420.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.420.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.420.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.420.geom // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 72 Capability Geometry diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.430.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.430.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.430.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.430.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.430.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 24 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.430.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.430.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.430.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.430.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.430.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 66 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.450.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.450.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.450.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.450.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.450.geom // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 31 Capability Geometry diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.450.noRedecl.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.450.noRedecl.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.450.noRedecl.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.450.noRedecl.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.450.noRedecl.tesc // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 21 Capability Tessellation diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.450.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.450.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.450.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.450.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.450.tesc // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 45 Capability Tessellation diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.460.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.460.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.460.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.460.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.460.comp // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 15 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.460.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.460.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.460.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.460.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.460.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 32 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.460.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.460.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.460.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.460.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.460.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 20 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.accessChain.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.accessChain.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.accessChain.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.accessChain.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,12 +1,12 @@ spv.accessChain.frag // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 206 +// Generated by (magic number): 80006 +// Id's are bound by 222 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 65 158 + EntryPoint Fragment 4 "main" 69 170 ExecutionMode 4 OriginUpperLeft Source GLSL 420 Name 4 "main" @@ -50,12 +50,12 @@ Name 62 "GetColor13(struct-S-vf31;i1;" Name 60 "i" Name 61 "comp" - Name 65 "OutColor" - Name 153 "s" - Name 158 "u" - Name 159 "param" - Name 163 "param" - Name 167 "param" + Name 66 "GetColor14(struct-S-vf31;i1;" + Name 64 "i" + Name 65 "comp" + Name 69 "OutColor" + Name 165 "s" + Name 170 "u" Name 171 "param" Name 175 "param" Name 179 "param" @@ -65,8 +65,12 @@ Name 195 "param" Name 199 "param" Name 203 "param" - Decorate 65(OutColor) Location 0 - Decorate 158(u) Flat + Name 207 "param" + Name 211 "param" + Name 215 "param" + Name 219 "param" + Decorate 69(OutColor) Location 0 + Decorate 170(u) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -76,25 +80,27 @@ 13: TypeInt 32 1 14: TypePointer Function 13(int) 15: TypeFunction 2 8(S) 14(ptr) - 64: TypePointer Output 7(fvec3) - 65(OutColor): 64(ptr) Variable Output - 66: 13(int) Constant 0 - 67: TypeInt 32 0 - 68: 67(int) Constant 0 - 95: TypeVector 6(float) 2 - 109: 67(int) Constant 2 - 136: TypePointer Output 6(float) - 150: 6(float) Constant 0 - 151: 7(fvec3) ConstantComposite 150 150 150 - 152: TypePointer Function 8(S) - 157: TypePointer Input 13(int) - 158(u): 157(ptr) Variable Input + 68: TypePointer Output 7(fvec3) + 69(OutColor): 68(ptr) Variable Output + 70: 13(int) Constant 0 + 71: TypeInt 32 0 + 72: 71(int) Constant 0 + 99: TypeVector 6(float) 2 + 113: 71(int) Constant 2 + 140: TypePointer Output 6(float) + 147: 71(int) Constant 1 + 148: TypeVector 71(int) 2 + 149: 148(ivec2) ConstantComposite 113 147 + 158: TypeVector 71(int) 3 + 159: 158(ivec3) ConstantComposite 113 147 72 + 162: 6(float) Constant 0 + 163: 7(fvec3) ConstantComposite 162 162 162 + 164: TypePointer Function 8(S) + 169: TypePointer Input 13(int) + 170(u): 169(ptr) Variable Input 4(main): 2 Function None 3 5: Label - 153(s): 152(ptr) Variable Function - 159(param): 14(ptr) Variable Function - 163(param): 14(ptr) Variable Function - 167(param): 14(ptr) Variable Function + 165(s): 164(ptr) Variable Function 171(param): 14(ptr) Variable Function 175(param): 14(ptr) Variable Function 179(param): 14(ptr) Variable Function @@ -104,224 +110,242 @@ 195(param): 14(ptr) Variable Function 199(param): 14(ptr) Variable Function 203(param): 14(ptr) Variable Function - Store 65(OutColor) 151 - 154: 8(S) Load 153(s) - 155: 2 FunctionCall 11(GetColor1(struct-S-vf31;) 154 - 156: 8(S) Load 153(s) - 160: 13(int) Load 158(u) - Store 159(param) 160 - 161: 2 FunctionCall 18(GetColor2(struct-S-vf31;i1;) 156 159(param) - 162: 8(S) Load 153(s) - 164: 13(int) Load 158(u) - Store 163(param) 164 - 165: 2 FunctionCall 22(GetColor3(struct-S-vf31;i1;) 162 163(param) - 166: 8(S) Load 153(s) - 168: 13(int) Load 158(u) - Store 167(param) 168 - 169: 2 FunctionCall 26(GetColor4(struct-S-vf31;i1;) 166 167(param) - 170: 8(S) Load 153(s) - 172: 13(int) Load 158(u) + 207(param): 14(ptr) Variable Function + 211(param): 14(ptr) Variable Function + 215(param): 14(ptr) Variable Function + 219(param): 14(ptr) Variable Function + Store 69(OutColor) 163 + 166: 8(S) Load 165(s) + 167: 2 FunctionCall 11(GetColor1(struct-S-vf31;) 166 + 168: 8(S) Load 165(s) + 172: 13(int) Load 170(u) Store 171(param) 172 - 173: 2 FunctionCall 30(GetColor5(struct-S-vf31;i1;) 170 171(param) - 174: 8(S) Load 153(s) - 176: 13(int) Load 158(u) + 173: 2 FunctionCall 18(GetColor2(struct-S-vf31;i1;) 168 171(param) + 174: 8(S) Load 165(s) + 176: 13(int) Load 170(u) Store 175(param) 176 - 177: 2 FunctionCall 34(GetColor6(struct-S-vf31;i1;) 174 175(param) - 178: 8(S) Load 153(s) - 180: 13(int) Load 158(u) + 177: 2 FunctionCall 22(GetColor3(struct-S-vf31;i1;) 174 175(param) + 178: 8(S) Load 165(s) + 180: 13(int) Load 170(u) Store 179(param) 180 - 181: 2 FunctionCall 38(GetColor7(struct-S-vf31;i1;) 178 179(param) - 182: 8(S) Load 153(s) - 184: 13(int) Load 158(u) + 181: 2 FunctionCall 26(GetColor4(struct-S-vf31;i1;) 178 179(param) + 182: 8(S) Load 165(s) + 184: 13(int) Load 170(u) Store 183(param) 184 - 185: 2 FunctionCall 42(GetColor8(struct-S-vf31;i1;) 182 183(param) - 186: 8(S) Load 153(s) - 188: 13(int) Load 158(u) + 185: 2 FunctionCall 30(GetColor5(struct-S-vf31;i1;) 182 183(param) + 186: 8(S) Load 165(s) + 188: 13(int) Load 170(u) Store 187(param) 188 - 189: 2 FunctionCall 46(GetColor9(struct-S-vf31;i1;) 186 187(param) - 190: 8(S) Load 153(s) - 192: 13(int) Load 158(u) + 189: 2 FunctionCall 34(GetColor6(struct-S-vf31;i1;) 186 187(param) + 190: 8(S) Load 165(s) + 192: 13(int) Load 170(u) Store 191(param) 192 - 193: 2 FunctionCall 50(GetColor10(struct-S-vf31;i1;) 190 191(param) - 194: 8(S) Load 153(s) - 196: 13(int) Load 158(u) + 193: 2 FunctionCall 38(GetColor7(struct-S-vf31;i1;) 190 191(param) + 194: 8(S) Load 165(s) + 196: 13(int) Load 170(u) Store 195(param) 196 - 197: 2 FunctionCall 54(GetColor11(struct-S-vf31;i1;) 194 195(param) - 198: 8(S) Load 153(s) - 200: 13(int) Load 158(u) + 197: 2 FunctionCall 42(GetColor8(struct-S-vf31;i1;) 194 195(param) + 198: 8(S) Load 165(s) + 200: 13(int) Load 170(u) Store 199(param) 200 - 201: 2 FunctionCall 58(GetColor12(struct-S-vf31;i1;) 198 199(param) - 202: 8(S) Load 153(s) - 204: 13(int) Load 158(u) + 201: 2 FunctionCall 46(GetColor9(struct-S-vf31;i1;) 198 199(param) + 202: 8(S) Load 165(s) + 204: 13(int) Load 170(u) Store 203(param) 204 - 205: 2 FunctionCall 62(GetColor13(struct-S-vf31;i1;) 202 203(param) + 205: 2 FunctionCall 50(GetColor10(struct-S-vf31;i1;) 202 203(param) + 206: 8(S) Load 165(s) + 208: 13(int) Load 170(u) + Store 207(param) 208 + 209: 2 FunctionCall 54(GetColor11(struct-S-vf31;i1;) 206 207(param) + 210: 8(S) Load 165(s) + 212: 13(int) Load 170(u) + Store 211(param) 212 + 213: 2 FunctionCall 58(GetColor12(struct-S-vf31;i1;) 210 211(param) + 214: 8(S) Load 165(s) + 216: 13(int) Load 170(u) + Store 215(param) 216 + 217: 2 FunctionCall 62(GetColor13(struct-S-vf31;i1;) 214 215(param) + 218: 8(S) Load 165(s) + 220: 13(int) Load 170(u) + Store 219(param) 220 + 221: 2 FunctionCall 66(GetColor14(struct-S-vf31;i1;) 218 219(param) Return FunctionEnd 11(GetColor1(struct-S-vf31;): 2 Function None 9 10(i): 8(S) FunctionParameter 12: Label - 69: 6(float) CompositeExtract 10(i) 0 0 - 70: 7(fvec3) Load 65(OutColor) - 71: 7(fvec3) CompositeConstruct 69 69 69 - 72: 7(fvec3) FAdd 70 71 - Store 65(OutColor) 72 + 73: 6(float) CompositeExtract 10(i) 0 0 + 74: 7(fvec3) Load 69(OutColor) + 75: 7(fvec3) CompositeConstruct 73 73 73 + 76: 7(fvec3) FAdd 74 75 + Store 69(OutColor) 76 Return FunctionEnd 18(GetColor2(struct-S-vf31;i1;): 2 Function None 15 16(i): 8(S) FunctionParameter 17(comp): 14(ptr) FunctionParameter 19: Label - 73: 13(int) Load 17(comp) - 74: 7(fvec3) CompositeExtract 16(i) 0 - 75: 6(float) VectorExtractDynamic 74 73 - 76: 7(fvec3) Load 65(OutColor) - 77: 7(fvec3) CompositeConstruct 75 75 75 - 78: 7(fvec3) FAdd 76 77 - Store 65(OutColor) 78 + 77: 13(int) Load 17(comp) + 78: 7(fvec3) CompositeExtract 16(i) 0 + 79: 6(float) VectorExtractDynamic 78 77 + 80: 7(fvec3) Load 69(OutColor) + 81: 7(fvec3) CompositeConstruct 79 79 79 + 82: 7(fvec3) FAdd 80 81 + Store 69(OutColor) 82 Return FunctionEnd 22(GetColor3(struct-S-vf31;i1;): 2 Function None 15 20(i): 8(S) FunctionParameter 21(comp): 14(ptr) FunctionParameter 23: Label - 79: 13(int) Load 21(comp) - 80: 7(fvec3) CompositeExtract 20(i) 0 - 81: 6(float) VectorExtractDynamic 80 79 - 82: 7(fvec3) Load 65(OutColor) - 83: 7(fvec3) CompositeConstruct 81 81 81 - 84: 7(fvec3) FAdd 82 83 - Store 65(OutColor) 84 + 83: 13(int) Load 21(comp) + 84: 7(fvec3) CompositeExtract 20(i) 0 + 85: 6(float) VectorExtractDynamic 84 83 + 86: 7(fvec3) Load 69(OutColor) + 87: 7(fvec3) CompositeConstruct 85 85 85 + 88: 7(fvec3) FAdd 86 87 + Store 69(OutColor) 88 Return FunctionEnd 26(GetColor4(struct-S-vf31;i1;): 2 Function None 15 24(i): 8(S) FunctionParameter 25(comp): 14(ptr) FunctionParameter 27: Label - 85: 13(int) Load 25(comp) - 86: 7(fvec3) CompositeExtract 24(i) 0 - 87: 6(float) VectorExtractDynamic 86 85 - 88: 7(fvec3) Load 65(OutColor) - 89: 7(fvec3) CompositeConstruct 87 87 87 - 90: 7(fvec3) FAdd 88 89 - Store 65(OutColor) 90 + 89: 13(int) Load 25(comp) + 90: 7(fvec3) CompositeExtract 24(i) 0 + 91: 6(float) VectorExtractDynamic 90 89 + 92: 7(fvec3) Load 69(OutColor) + 93: 7(fvec3) CompositeConstruct 91 91 91 + 94: 7(fvec3) FAdd 92 93 + Store 69(OutColor) 94 Return FunctionEnd 30(GetColor5(struct-S-vf31;i1;): 2 Function None 15 28(i): 8(S) FunctionParameter 29(comp): 14(ptr) FunctionParameter 31: Label - 91: 7(fvec3) CompositeExtract 28(i) 0 - 92: 7(fvec3) Load 65(OutColor) - 93: 7(fvec3) FAdd 92 91 - Store 65(OutColor) 93 + 95: 7(fvec3) CompositeExtract 28(i) 0 + 96: 7(fvec3) Load 69(OutColor) + 97: 7(fvec3) FAdd 96 95 + Store 69(OutColor) 97 Return FunctionEnd 34(GetColor6(struct-S-vf31;i1;): 2 Function None 15 32(i): 8(S) FunctionParameter 33(comp): 14(ptr) FunctionParameter 35: Label - 94: 13(int) Load 33(comp) - 96: 7(fvec3) CompositeExtract 32(i) 0 - 97: 95(fvec2) VectorShuffle 96 96 1 0 - 98: 6(float) VectorExtractDynamic 97 94 - 99: 7(fvec3) Load 65(OutColor) - 100: 7(fvec3) CompositeConstruct 98 98 98 - 101: 7(fvec3) FAdd 99 100 - Store 65(OutColor) 101 + 98: 13(int) Load 33(comp) + 100: 7(fvec3) CompositeExtract 32(i) 0 + 101: 99(fvec2) VectorShuffle 100 100 1 0 + 102: 6(float) VectorExtractDynamic 101 98 + 103: 7(fvec3) Load 69(OutColor) + 104: 7(fvec3) CompositeConstruct 102 102 102 + 105: 7(fvec3) FAdd 103 104 + Store 69(OutColor) 105 Return FunctionEnd 38(GetColor7(struct-S-vf31;i1;): 2 Function None 15 36(i): 8(S) FunctionParameter 37(comp): 14(ptr) FunctionParameter 39: Label - 102: 7(fvec3) CompositeExtract 36(i) 0 - 103: 95(fvec2) VectorShuffle 102 102 0 1 - 104: 7(fvec3) Load 65(OutColor) - 105: 95(fvec2) VectorShuffle 104 104 0 1 - 106: 95(fvec2) FAdd 105 103 - 107: 7(fvec3) Load 65(OutColor) - 108: 7(fvec3) VectorShuffle 107 106 3 4 2 - Store 65(OutColor) 108 + 106: 7(fvec3) CompositeExtract 36(i) 0 + 107: 99(fvec2) VectorShuffle 106 106 0 1 + 108: 7(fvec3) Load 69(OutColor) + 109: 99(fvec2) VectorShuffle 108 108 0 1 + 110: 99(fvec2) FAdd 109 107 + 111: 7(fvec3) Load 69(OutColor) + 112: 7(fvec3) VectorShuffle 111 110 3 4 2 + Store 69(OutColor) 112 Return FunctionEnd 42(GetColor8(struct-S-vf31;i1;): 2 Function None 15 40(i): 8(S) FunctionParameter 41(comp): 14(ptr) FunctionParameter 43: Label - 110: 6(float) CompositeExtract 40(i) 0 2 - 111: 7(fvec3) Load 65(OutColor) - 112: 7(fvec3) CompositeConstruct 110 110 110 - 113: 7(fvec3) FAdd 111 112 - Store 65(OutColor) 113 + 114: 6(float) CompositeExtract 40(i) 0 2 + 115: 7(fvec3) Load 69(OutColor) + 116: 7(fvec3) CompositeConstruct 114 114 114 + 117: 7(fvec3) FAdd 115 116 + Store 69(OutColor) 117 Return FunctionEnd 46(GetColor9(struct-S-vf31;i1;): 2 Function None 15 44(i): 8(S) FunctionParameter 45(comp): 14(ptr) FunctionParameter 47: Label - 114: 7(fvec3) CompositeExtract 44(i) 0 - 115: 7(fvec3) Load 65(OutColor) - 116: 7(fvec3) VectorShuffle 115 115 2 0 1 - 117: 7(fvec3) FAdd 116 114 - 118: 7(fvec3) Load 65(OutColor) - 119: 7(fvec3) VectorShuffle 118 117 4 5 3 - Store 65(OutColor) 119 + 118: 7(fvec3) CompositeExtract 44(i) 0 + 119: 7(fvec3) Load 69(OutColor) + 120: 7(fvec3) VectorShuffle 119 119 2 0 1 + 121: 7(fvec3) FAdd 120 118 + 122: 7(fvec3) Load 69(OutColor) + 123: 7(fvec3) VectorShuffle 122 121 4 5 3 + Store 69(OutColor) 123 Return FunctionEnd 50(GetColor10(struct-S-vf31;i1;): 2 Function None 15 48(i): 8(S) FunctionParameter 49(comp): 14(ptr) FunctionParameter 51: Label - 120: 7(fvec3) CompositeExtract 48(i) 0 - 121: 95(fvec2) VectorShuffle 120 120 0 1 - 122: 7(fvec3) Load 65(OutColor) - 123: 95(fvec2) VectorShuffle 122 122 2 1 - 124: 95(fvec2) FAdd 123 121 - 125: 7(fvec3) Load 65(OutColor) - 126: 7(fvec3) VectorShuffle 125 124 0 4 3 - Store 65(OutColor) 126 + 124: 7(fvec3) CompositeExtract 48(i) 0 + 125: 99(fvec2) VectorShuffle 124 124 0 1 + 126: 7(fvec3) Load 69(OutColor) + 127: 99(fvec2) VectorShuffle 126 126 2 1 + 128: 99(fvec2) FAdd 127 125 + 129: 7(fvec3) Load 69(OutColor) + 130: 7(fvec3) VectorShuffle 129 128 0 4 3 + Store 69(OutColor) 130 Return FunctionEnd 54(GetColor11(struct-S-vf31;i1;): 2 Function None 15 52(i): 8(S) FunctionParameter 53(comp): 14(ptr) FunctionParameter 55: Label - 127: 7(fvec3) CompositeExtract 52(i) 0 - 128: 95(fvec2) VectorShuffle 127 127 0 1 - 129: 7(fvec3) Load 65(OutColor) - 130: 95(fvec2) VectorShuffle 129 129 0 2 - 131: 95(fvec2) FAdd 130 128 - 132: 7(fvec3) Load 65(OutColor) - 133: 7(fvec3) VectorShuffle 132 131 3 1 4 - Store 65(OutColor) 133 + 131: 7(fvec3) CompositeExtract 52(i) 0 + 132: 99(fvec2) VectorShuffle 131 131 0 1 + 133: 7(fvec3) Load 69(OutColor) + 134: 99(fvec2) VectorShuffle 133 133 0 2 + 135: 99(fvec2) FAdd 134 132 + 136: 7(fvec3) Load 69(OutColor) + 137: 7(fvec3) VectorShuffle 136 135 3 1 4 + Store 69(OutColor) 137 Return FunctionEnd 58(GetColor12(struct-S-vf31;i1;): 2 Function None 15 56(i): 8(S) FunctionParameter 57(comp): 14(ptr) FunctionParameter 59: Label - 134: 13(int) Load 57(comp) - 135: 6(float) CompositeExtract 56(i) 0 0 - 137: 136(ptr) AccessChain 65(OutColor) 134 - 138: 6(float) Load 137 - 139: 6(float) FAdd 138 135 - 140: 136(ptr) AccessChain 65(OutColor) 134 - Store 140 139 + 138: 13(int) Load 57(comp) + 139: 6(float) CompositeExtract 56(i) 0 0 + 141: 140(ptr) AccessChain 69(OutColor) 138 + 142: 6(float) Load 141 + 143: 6(float) FAdd 142 139 + 144: 140(ptr) AccessChain 69(OutColor) 138 + Store 144 143 Return FunctionEnd 62(GetColor13(struct-S-vf31;i1;): 2 Function None 15 60(i): 8(S) FunctionParameter 61(comp): 14(ptr) FunctionParameter 63: Label - 141: 13(int) Load 61(comp) - 142: 6(float) CompositeExtract 60(i) 0 0 - 143: 7(fvec3) Load 65(OutColor) - 144: 95(fvec2) VectorShuffle 143 143 2 1 - 145: 6(float) VectorExtractDynamic 144 141 - 146: 6(float) FAdd 145 142 - 147: 7(fvec3) Load 65(OutColor) - 148: 7(fvec3) VectorShuffle 147 147 2 1 2 - 149: 7(fvec3) VectorInsertDynamic 148 146 141 - Store 65(OutColor) 149 + 145: 13(int) Load 61(comp) + 146: 6(float) CompositeExtract 60(i) 0 0 + 150: 71(int) VectorExtractDynamic 149 145 + 151: 140(ptr) AccessChain 69(OutColor) 150 + 152: 6(float) Load 151 + 153: 6(float) FAdd 152 146 + 154: 71(int) VectorExtractDynamic 149 145 + 155: 140(ptr) AccessChain 69(OutColor) 154 + Store 155 153 + Return + FunctionEnd +66(GetColor14(struct-S-vf31;i1;): 2 Function None 15 + 64(i): 8(S) FunctionParameter + 65(comp): 14(ptr) FunctionParameter + 67: Label + 156: 13(int) Load 65(comp) + 157: 6(float) CompositeExtract 64(i) 0 0 + 160: 71(int) VectorExtractDynamic 159 156 + 161: 140(ptr) AccessChain 69(OutColor) 160 + Store 161 157 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.aggOps.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.aggOps.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.aggOps.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.aggOps.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -3,7 +3,7 @@ "precision mediump int; precision highp float;" // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 215 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.always-discard2.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.always-discard2.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.always-discard2.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.always-discard2.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.always-discard2.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 40 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.always-discard.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.always-discard.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.always-discard.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.always-discard.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.always-discard.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 84 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.AofA.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.AofA.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.AofA.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.AofA.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.AofA.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 104 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.arbPostDepthCoverage.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.arbPostDepthCoverage.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.arbPostDepthCoverage.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.arbPostDepthCoverage.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,10 +1,9 @@ spv.arbPostDepthCoverage.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 18 Capability Shader - Capability SampleRateShading Capability SampleMaskPostDepthCoverage Extension "SPV_KHR_post_depth_coverage" 1: ExtInstImport "GLSL.std.450" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.atomic.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.atomic.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.atomic.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.atomic.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.atomic.comp // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 74 Capability Shader @@ -47,7 +47,7 @@ 8: TypeFunction 6(int) 7(ptr) 14: 6(int) Constant 1 15: 6(int) Constant 0 - 19: 6(int) Constant 1024 + 19: 6(int) Constant 1032 20(counter): 7(ptr) Variable AtomicCounter 22: TypePointer Function 6(int) 24: 6(int) Constant 4 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.atomicInt64.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.atomicInt64.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.atomicInt64.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.atomicInt64.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.atomicInt64.comp // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 149 Capability Shader @@ -50,7 +50,7 @@ 24: 22(int) Constant 0 28: 17(int) Constant 1 29: TypePointer Uniform 10(int) - 31: 10(int) Constant 15 0 + 31: 10(int) Constant 15 240 84(Struct): TypeStruct 6(int) 10(int) 85: TypePointer Workgroup 84(Struct) 86(s): 85(ptr) Variable Workgroup diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.barrier.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.barrier.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.barrier.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.barrier.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,46 @@ +spv.barrier.vert +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 24 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 15 + Source GLSL 450 + Name 4 "main" + Name 9 "c0" + Name 15 "c1" + Decorate 9(c0) Location 0 + Decorate 15(c1) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(c0): 8(ptr) Variable Output + 10: 6(float) Constant 1065353216 + 11: 7(fvec4) ConstantComposite 10 10 10 10 + 12: TypeInt 32 0 + 13: 12(int) Constant 1 + 14: 12(int) Constant 3400 + 15(c1): 8(ptr) Variable Output + 16: 12(int) Constant 72 + 20: 12(int) Constant 2056 + 4(main): 2 Function None 3 + 5: Label + Store 9(c0) 11 + MemoryBarrier 13 14 + Store 15(c1) 11 + MemoryBarrier 13 16 + 17: 7(fvec4) Load 9(c0) + 18: 7(fvec4) CompositeConstruct 10 10 10 10 + 19: 7(fvec4) FAdd 17 18 + Store 9(c0) 19 + MemoryBarrier 13 20 + 21: 7(fvec4) Load 9(c0) + 22: 7(fvec4) CompositeConstruct 10 10 10 10 + 23: 7(fvec4) FAdd 21 22 + Store 9(c0) 23 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.bitCast.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.bitCast.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.bitCast.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.bitCast.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.bitCast.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 172 Capability Shader @@ -86,8 +86,8 @@ 148(u4): 147(ptr) Variable Input 153: TypePointer Output 46(fvec4) 154(fragColor): 153(ptr) Variable Output - 159: TypeBool - 160: TypeVector 159(bool) 4 + 158: TypeBool + 159: TypeVector 158(bool) 4 168: 12(float) Constant 1045220557 169: 46(fvec4) ConstantComposite 168 168 168 168 4(main): 2 Function None 3 @@ -95,7 +95,7 @@ 9(idata): 8(ptr) Variable Function 55(udata): 54(ptr) Variable Function 85(fdata): 84(ptr) Variable Function - 155: 84(ptr) Variable Function + 162: 84(ptr) Variable Function Store 9(idata) 11 15: 12(float) Load 14(f1) 16: 6(int) Bitcast 15 @@ -211,24 +211,24 @@ 151: 46(fvec4) Load 85(fdata) 152: 46(fvec4) FAdd 151 150 Store 85(fdata) 152 - 156: 7(ivec4) Load 9(idata) - 157: 53(ivec4) Bitcast 156 - 158: 53(ivec4) Load 55(udata) - 161: 160(bvec4) IEqual 157 158 - 162: 159(bool) All 161 + 155: 7(ivec4) Load 9(idata) + 156: 53(ivec4) Bitcast 155 + 157: 53(ivec4) Load 55(udata) + 160: 159(bvec4) IEqual 156 157 + 161: 158(bool) All 160 SelectionMerge 164 None - BranchConditional 162 163 166 + BranchConditional 161 163 166 163: Label 165: 46(fvec4) Load 85(fdata) - Store 155 165 + Store 162 165 Branch 164 166: Label 167: 46(fvec4) Load 85(fdata) 170: 46(fvec4) FAdd 167 169 - Store 155 170 + Store 162 170 Branch 164 164: Label - 171: 46(fvec4) Load 155 + 171: 46(fvec4) Load 162 Store 154(fragColor) 171 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.boolInBlock.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.boolInBlock.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.boolInBlock.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.boolInBlock.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,12 +1,12 @@ spv.boolInBlock.frag // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 107 +// Generated by (magic number): 80006 +// Id's are bound by 102 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 75 + EntryPoint Fragment 4 "main" 74 ExecutionMode 4 OriginUpperLeft Source GLSL 450 Name 4 "main" @@ -14,24 +14,24 @@ Name 12 "paramb4" Name 13 "paramb2" Name 17 "b1" - Name 24 "Buffer" - MemberName 24(Buffer) 0 "b2" - Name 26 "" - Name 39 "Uniform" - MemberName 39(Uniform) 0 "b4" - Name 41 "" - Name 62 "param" - Name 67 "param" - Name 75 "fragColor" - MemberDecorate 24(Buffer) 0 Offset 0 - Decorate 24(Buffer) BufferBlock - Decorate 26 DescriptorSet 0 - Decorate 26 Binding 1 - MemberDecorate 39(Uniform) 0 Offset 0 - Decorate 39(Uniform) Block - Decorate 41 DescriptorSet 0 - Decorate 41 Binding 0 - Decorate 75(fragColor) Location 0 + Name 25 "Buffer" + MemberName 25(Buffer) 0 "b2" + Name 27 "" + Name 40 "Uniform" + MemberName 40(Uniform) 0 "b4" + Name 42 "" + Name 60 "param" + Name 66 "param" + Name 74 "fragColor" + MemberDecorate 25(Buffer) 0 Offset 0 + Decorate 25(Buffer) BufferBlock + Decorate 27 DescriptorSet 0 + Decorate 27 Binding 1 + MemberDecorate 40(Uniform) 0 Offset 0 + Decorate 40(Uniform) Block + Decorate 42 DescriptorSet 0 + Decorate 42 Binding 0 + Decorate 74(fragColor) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeBool @@ -41,111 +41,106 @@ 10: TypePointer Function 9(bvec2) 11: TypeFunction 2 8(ptr) 10(ptr) 16: TypePointer Function 6(bool) - 22: TypeInt 32 0 - 23: TypeVector 22(int) 2 - 24(Buffer): TypeStruct 23(ivec2) - 25: TypePointer Uniform 24(Buffer) - 26: 25(ptr) Variable Uniform - 27: TypeInt 32 1 - 28: 27(int) Constant 0 - 29: 6(bool) ConstantFalse - 30: 9(bvec2) ConstantComposite 29 29 - 31: 22(int) Constant 1 - 32: 23(ivec2) ConstantComposite 31 31 - 33: 22(int) Constant 0 - 34: 23(ivec2) ConstantComposite 33 33 - 36: TypePointer Uniform 23(ivec2) - 38: TypeVector 22(int) 4 - 39(Uniform): TypeStruct 38(ivec4) - 40: TypePointer Uniform 39(Uniform) - 41: 40(ptr) Variable Uniform - 42: TypePointer Uniform 38(ivec4) - 65: 38(ivec4) ConstantComposite 33 33 33 33 - 72: TypeFloat 32 - 73: TypeVector 72(float) 4 - 74: TypePointer Output 73(fvec4) - 75(fragColor): 74(ptr) Variable Output - 87: 72(float) Constant 0 - 88: 72(float) Constant 1065353216 + 18: TypeInt 32 0 + 19: 18(int) Constant 2 + 24: TypeVector 18(int) 2 + 25(Buffer): TypeStruct 24(ivec2) + 26: TypePointer Uniform 25(Buffer) + 27: 26(ptr) Variable Uniform + 28: TypeInt 32 1 + 29: 28(int) Constant 0 + 30: 6(bool) ConstantFalse + 31: 9(bvec2) ConstantComposite 30 30 + 32: 18(int) Constant 1 + 33: 24(ivec2) ConstantComposite 32 32 + 34: 18(int) Constant 0 + 35: 24(ivec2) ConstantComposite 34 34 + 37: TypePointer Uniform 24(ivec2) + 39: TypeVector 18(int) 4 + 40(Uniform): TypeStruct 39(ivec4) + 41: TypePointer Uniform 40(Uniform) + 42: 41(ptr) Variable Uniform + 43: TypePointer Uniform 18(int) + 61: TypePointer Uniform 39(ivec4) + 64: 39(ivec4) ConstantComposite 34 34 34 34 + 71: TypeFloat 32 + 72: TypeVector 71(float) 4 + 73: TypePointer Output 72(fvec4) + 74(fragColor): 73(ptr) Variable Output + 84: 71(float) Constant 0 + 85: 71(float) Constant 1065353216 4(main): 2 Function None 3 5: Label - 62(param): 8(ptr) Variable Function - 67(param): 10(ptr) Variable Function - 35: 23(ivec2) Select 30 32 34 - 37: 36(ptr) AccessChain 26 28 - Store 37 35 - 43: 42(ptr) AccessChain 41 28 - 44: 38(ivec4) Load 43 - 45: 22(int) CompositeExtract 44 2 - 46: 6(bool) INotEqual 45 33 + 60(param): 8(ptr) Variable Function + 66(param): 10(ptr) Variable Function + 36: 24(ivec2) Select 31 33 35 + 38: 37(ptr) AccessChain 27 29 + Store 38 36 + 44: 43(ptr) AccessChain 42 29 19 + 45: 18(int) Load 44 + 46: 6(bool) INotEqual 45 34 SelectionMerge 48 None BranchConditional 46 47 48 47: Label - 49: 42(ptr) AccessChain 41 28 - 50: 38(ivec4) Load 49 - 51: 22(int) CompositeExtract 50 0 - 52: 6(bool) INotEqual 51 33 - 53: 9(bvec2) CompositeConstruct 52 52 - 54: 23(ivec2) Select 53 32 34 - 55: 36(ptr) AccessChain 26 28 - Store 55 54 + 49: 43(ptr) AccessChain 42 29 34 + 50: 18(int) Load 49 + 51: 6(bool) INotEqual 50 34 + 52: 9(bvec2) CompositeConstruct 51 51 + 53: 24(ivec2) Select 52 33 35 + 54: 37(ptr) AccessChain 27 29 + Store 54 53 Branch 48 48: Label - 56: 36(ptr) AccessChain 26 28 - 57: 23(ivec2) Load 56 - 58: 22(int) CompositeExtract 57 0 - 59: 6(bool) INotEqual 58 33 - SelectionMerge 61 None - BranchConditional 59 60 61 - 60: Label - 63: 42(ptr) AccessChain 41 28 - 64: 38(ivec4) Load 63 - 66: 7(bvec4) INotEqual 64 65 - Store 62(param) 66 - 68: 2 FunctionCall 14(foo(vb4;vb2;) 62(param) 67(param) - 69: 9(bvec2) Load 67(param) - 70: 23(ivec2) Select 69 32 34 - 71: 36(ptr) AccessChain 26 28 - Store 71 70 - Branch 61 - 61: Label - 76: 42(ptr) AccessChain 41 28 - 77: 38(ivec4) Load 76 - 78: 22(int) CompositeExtract 77 0 - 79: 6(bool) INotEqual 78 33 - SelectionMerge 81 None - BranchConditional 79 80 81 - 80: Label - 82: 42(ptr) AccessChain 41 28 - 83: 38(ivec4) Load 82 - 84: 22(int) CompositeExtract 83 1 - 85: 6(bool) INotEqual 84 33 - Branch 81 - 81: Label - 86: 6(bool) Phi 79 61 85 80 - 89: 72(float) Select 86 88 87 - 90: 73(fvec4) CompositeConstruct 89 89 89 89 - Store 75(fragColor) 90 - 91: 42(ptr) AccessChain 41 28 - 92: 38(ivec4) Load 91 - 93: 22(int) CompositeExtract 92 0 - 94: 6(bool) INotEqual 93 33 - 95: 6(bool) LogicalNot 94 - SelectionMerge 97 None - BranchConditional 95 96 97 - 96: Label - 98: 42(ptr) AccessChain 41 28 - 99: 38(ivec4) Load 98 - 100: 22(int) CompositeExtract 99 1 - 101: 6(bool) INotEqual 100 33 - Branch 97 - 97: Label - 102: 6(bool) Phi 94 81 101 96 - 103: 72(float) Select 102 88 87 - 104: 73(fvec4) CompositeConstruct 103 103 103 103 - 105: 73(fvec4) Load 75(fragColor) - 106: 73(fvec4) FSub 105 104 - Store 75(fragColor) 106 + 55: 43(ptr) AccessChain 27 29 34 + 56: 18(int) Load 55 + 57: 6(bool) INotEqual 56 34 + SelectionMerge 59 None + BranchConditional 57 58 59 + 58: Label + 62: 61(ptr) AccessChain 42 29 + 63: 39(ivec4) Load 62 + 65: 7(bvec4) INotEqual 63 64 + Store 60(param) 65 + 67: 2 FunctionCall 14(foo(vb4;vb2;) 60(param) 66(param) + 68: 9(bvec2) Load 66(param) + 69: 24(ivec2) Select 68 33 35 + 70: 37(ptr) AccessChain 27 29 + Store 70 69 + Branch 59 + 59: Label + 75: 43(ptr) AccessChain 42 29 34 + 76: 18(int) Load 75 + 77: 6(bool) INotEqual 76 34 + SelectionMerge 79 None + BranchConditional 77 78 79 + 78: Label + 80: 43(ptr) AccessChain 42 29 32 + 81: 18(int) Load 80 + 82: 6(bool) INotEqual 81 34 + Branch 79 + 79: Label + 83: 6(bool) Phi 77 59 82 78 + 86: 71(float) Select 83 85 84 + 87: 72(fvec4) CompositeConstruct 86 86 86 86 + Store 74(fragColor) 87 + 88: 43(ptr) AccessChain 42 29 34 + 89: 18(int) Load 88 + 90: 6(bool) INotEqual 89 34 + 91: 6(bool) LogicalNot 90 + SelectionMerge 93 None + BranchConditional 91 92 93 + 92: Label + 94: 43(ptr) AccessChain 42 29 32 + 95: 18(int) Load 94 + 96: 6(bool) INotEqual 95 34 + Branch 93 + 93: Label + 97: 6(bool) Phi 90 79 96 92 + 98: 71(float) Select 97 85 84 + 99: 72(fvec4) CompositeConstruct 98 98 98 98 + 100: 72(fvec4) Load 74(fragColor) + 101: 72(fvec4) FSub 100 99 + Store 74(fragColor) 101 Return FunctionEnd 14(foo(vb4;vb2;): 2 Function None 11 @@ -153,11 +148,11 @@ 13(paramb2): 10(ptr) FunctionParameter 15: Label 17(b1): 16(ptr) Variable Function - 18: 7(bvec4) Load 12(paramb4) - 19: 6(bool) CompositeExtract 18 2 - Store 17(b1) 19 - 20: 6(bool) Load 17(b1) - 21: 9(bvec2) CompositeConstruct 20 20 - Store 13(paramb2) 21 + 20: 16(ptr) AccessChain 12(paramb4) 19 + 21: 6(bool) Load 20 + Store 17(b1) 21 + 22: 6(bool) Load 17(b1) + 23: 9(bvec2) CompositeConstruct 22 22 + Store 13(paramb2) 23 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.bool.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.bool.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.bool.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.bool.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.bool.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 46 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.branch-return.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.branch-return.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.branch-return.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.branch-return.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.branch-return.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 38 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.buffer.autoassign.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.buffer.autoassign.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.buffer.autoassign.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.buffer.autoassign.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.buffer.autoassign.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 50 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.builtInXFB.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.builtInXFB.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.builtInXFB.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.builtInXFB.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,47 @@ +spv.builtInXFB.vert +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 21 + + Capability Shader + Capability TransformFeedback + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 10 + ExecutionMode 4 Xfb + Source GLSL 450 + Name 4 "main" + Name 8 "gl_PerVertex" + MemberName 8(gl_PerVertex) 0 "gl_Position" + MemberName 8(gl_PerVertex) 1 "gl_PointSize" + Name 10 "" + MemberDecorate 8(gl_PerVertex) 0 Offset 20 + MemberDecorate 8(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 8(gl_PerVertex) 1 Offset 16 + MemberDecorate 8(gl_PerVertex) 1 BuiltIn PointSize + Decorate 8(gl_PerVertex) Block + Decorate 10 XfbBuffer 1 + Decorate 10 XfbStride 64 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(gl_PerVertex): TypeStruct 7(fvec4) 6(float) + 9: TypePointer Output 8(gl_PerVertex) + 10: 9(ptr) Variable Output + 11: TypeInt 32 1 + 12: 11(int) Constant 0 + 13: 6(float) Constant 1065353216 + 14: 7(fvec4) ConstantComposite 13 13 13 13 + 15: TypePointer Output 7(fvec4) + 17: 11(int) Constant 1 + 18: 6(float) Constant 1073741824 + 19: TypePointer Output 6(float) + 4(main): 2 Function None 3 + 5: Label + 16: 15(ptr) AccessChain 10 12 + Store 16 14 + 20: 19(ptr) AccessChain 10 17 + Store 20 18 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.conditionalDiscard.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.conditionalDiscard.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.conditionalDiscard.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.conditionalDiscard.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.conditionalDiscard.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 36 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.constStruct.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.constStruct.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.constStruct.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.constStruct.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,45 @@ +spv.constStruct.vert +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 23 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source GLSL 450 + Name 4 "main" + Name 9 "T" + MemberName 9(T) 0 "m" + Name 10 "U" + MemberName 10(U) 0 "m" + Name 11 "S" + MemberName 11(S) 0 "t" + MemberName 11(S) 1 "u" + Name 13 "s1" + Name 22 "s2" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypeMatrix 7(fvec2) 2 + 9(T): TypeStruct 8 + 10(U): TypeStruct 8 + 11(S): TypeStruct 9(T) 10(U) + 12: TypePointer Function 11(S) + 14: 6(float) Constant 1065353216 + 15: 6(float) Constant 0 + 16: 7(fvec2) ConstantComposite 14 15 + 17: 7(fvec2) ConstantComposite 15 14 + 18: 8 ConstantComposite 16 17 + 19: 9(T) ConstantComposite 18 + 20: 10(U) ConstantComposite 18 + 21: 11(S) ConstantComposite 19 20 + 4(main): 2 Function None 3 + 5: Label + 13(s1): 12(ptr) Variable Function + 22(s2): 12(ptr) Variable Function + Store 13(s1) 21 + Store 22(s2) 21 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.controlFlowAttributes.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.controlFlowAttributes.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.controlFlowAttributes.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.controlFlowAttributes.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,238 @@ +spv.controlFlowAttributes.frag +WARNING: 0:20: '' : attribute with arguments not recognized, skipping +WARNING: 0:21: '' : attribute with arguments not recognized, skipping +WARNING: 0:22: '' : attribute with arguments not recognized, skipping +WARNING: 0:23: 'dependency_length' : expected a single integer argument +WARNING: 0:24: '' : attribute with arguments not recognized, skipping +WARNING: 0:25: '' : attribute with arguments not recognized, skipping +WARNING: 0:26: '' : attribute with arguments not recognized, skipping + +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 118 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_control_flow_attributes" + Name 4 "main" + Name 8 "i" + Name 36 "i" + Name 47 "cond" + Name 60 "i" + Name 79 "i" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 16: 6(int) Constant 8 + 17: TypeBool + 20: 6(int) Constant 1 + 31: 17(bool) ConstantTrue + 46: TypePointer Private 17(bool) + 47(cond): 46(ptr) Variable Private + 54: 17(bool) ConstantFalse + 55: 6(int) Constant 3 + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + 36(i): 7(ptr) Variable Function + 60(i): 7(ptr) Variable Function + 79(i): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + LoopMerge 12 13 Unroll + Branch 14 + 14: Label + 15: 6(int) Load 8(i) + 18: 17(bool) SLessThan 15 16 + BranchConditional 18 11 12 + 11: Label + Branch 13 + 13: Label + 19: 6(int) Load 8(i) + 21: 6(int) IAdd 19 20 + Store 8(i) 21 + Branch 10 + 12: Label + Branch 22 + 22: Label + LoopMerge 24 25 DontUnroll + Branch 23 + 23: Label + Branch 25 + 25: Label + Branch 22 + 24: Label + Branch 26 + 26: Label + LoopMerge 28 29 DontUnroll + Branch 30 + 30: Label + BranchConditional 31 27 28 + 27: Label + Branch 29 + 29: Label + Branch 26 + 28: Label + Branch 32 + 32: Label + LoopMerge 34 35 DependencyInfinite + Branch 33 + 33: Label + Branch 35 + 35: Label + BranchConditional 31 32 34 + 34: Label + Store 36(i) 9 + Branch 37 + 37: Label + LoopMerge 39 40 DependencyLength 4 + Branch 41 + 41: Label + 42: 6(int) Load 36(i) + 43: 17(bool) SLessThan 42 16 + BranchConditional 43 38 39 + 38: Label + Branch 40 + 40: Label + 44: 6(int) Load 36(i) + 45: 6(int) IAdd 44 20 + Store 36(i) 45 + Branch 37 + 39: Label + 48: 17(bool) Load 47(cond) + SelectionMerge 50 Flatten + BranchConditional 48 49 50 + 49: Label + Branch 50 + 50: Label + 51: 17(bool) Load 47(cond) + SelectionMerge 53 DontFlatten + BranchConditional 51 52 53 + 52: Label + Store 47(cond) 54 + Branch 53 + 53: Label + SelectionMerge 57 DontFlatten + Switch 55 57 + case 3: 56 + 56: Label + Branch 57 + 57: Label + Store 60(i) 9 + Branch 61 + 61: Label + LoopMerge 63 64 None + Branch 65 + 65: Label + 66: 6(int) Load 60(i) + 67: 17(bool) SLessThan 66 16 + BranchConditional 67 62 63 + 62: Label + Branch 64 + 64: Label + 68: 6(int) Load 60(i) + 69: 6(int) IAdd 68 20 + Store 60(i) 69 + Branch 61 + 63: Label + Branch 70 + 70: Label + LoopMerge 72 73 None + Branch 74 + 74: Label + BranchConditional 31 71 72 + 71: Label + Branch 73 + 73: Label + Branch 70 + 72: Label + Branch 75 + 75: Label + LoopMerge 77 78 None + Branch 76 + 76: Label + Branch 78 + 78: Label + BranchConditional 31 75 77 + 77: Label + Store 79(i) 9 + Branch 80 + 80: Label + LoopMerge 82 83 None + Branch 84 + 84: Label + 85: 6(int) Load 79(i) + 86: 17(bool) SLessThan 85 16 + BranchConditional 86 81 82 + 81: Label + Branch 83 + 83: Label + 87: 6(int) Load 79(i) + 88: 6(int) IAdd 87 20 + Store 79(i) 88 + Branch 80 + 82: Label + 89: 17(bool) Load 47(cond) + SelectionMerge 91 None + BranchConditional 89 90 91 + 90: Label + Branch 91 + 91: Label + 92: 17(bool) Load 47(cond) + SelectionMerge 94 None + BranchConditional 92 93 94 + 93: Label + Store 47(cond) 54 + Branch 94 + 94: Label + SelectionMerge 96 None + Switch 55 96 + case 3: 95 + 95: Label + Branch 96 + 96: Label + Branch 99 + 99: Label + LoopMerge 101 102 Unroll DontUnroll DependencyLength 2 + Branch 103 + 103: Label + 104: 17(bool) Load 47(cond) + BranchConditional 104 100 101 + 100: Label + Branch 102 + 102: Label + Branch 99 + 101: Label + SelectionMerge 106 DontFlatten + Switch 55 106 + case 3: 105 + 105: Label + Branch 106 + 106: Label + 109: 17(bool) Load 47(cond) + SelectionMerge 111 Flatten + BranchConditional 109 110 111 + 110: Label + Branch 111 + 111: Label + Branch 112 + 112: Label + LoopMerge 114 115 DependencyInfinite + Branch 116 + 116: Label + 117: 17(bool) Load 47(cond) + BranchConditional 117 113 114 + 113: Label + Branch 115 + 115: Label + Branch 112 + 114: Label + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.conversion.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.conversion.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.conversion.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.conversion.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.conversion.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 455 Capability Shader @@ -119,8 +119,8 @@ 315: 13(int) Constant 1 321: TypePointer Output 95(fvec4) 322(gl_FragColor): 321(ptr) Variable Output - 367: 13(int) Constant 2 - 380: 13(int) Constant 3 + 336: 13(int) Constant 2 + 349: 13(int) Constant 3 427: TypePointer Private 6(bool) 428(u_b): 427(ptr) Variable Private 429: TypePointer Private 23(bvec2) @@ -163,9 +163,9 @@ 110(f2): 109(ptr) Variable Function 114(f3): 113(ptr) Variable Function 118(f4): 117(ptr) Variable Function - 297: 105(ptr) Variable Function - 307: 105(ptr) Variable Function - 323: 117(ptr) Variable Function + 298: 105(ptr) Variable Function + 309: 105(ptr) Variable Function + 353: 117(ptr) Variable Function 417(cv2): 93(ptr) Variable Function 418(cv5): 44(ptr) Variable Function 12: 9(int) Load 11(u_i) @@ -425,101 +425,101 @@ SelectionMerge 296 None BranchConditional 294 295 296 295: Label - 298: 6(bool) Load 8(b) + 297: 6(bool) Load 8(b) SelectionMerge 300 None - BranchConditional 298 299 303 + BranchConditional 297 299 303 299: Label 301: 9(int) Load 58(i) 302: 16(float) ConvertSToF 301 - Store 297 302 + Store 298 302 Branch 300 303: Label 304: 105(ptr) AccessChain 110(f2) 14 305: 16(float) Load 304 - Store 297 305 + Store 298 305 Branch 300 300: Label - 306: 16(float) Load 297 - 308: 23(bvec2) Load 25(b2) - 309: 6(bool) CompositeExtract 308 0 + 306: 16(float) Load 298 + 307: 7(ptr) AccessChain 25(b2) 14 + 308: 6(bool) Load 307 SelectionMerge 311 None - BranchConditional 309 310 314 + BranchConditional 308 310 314 310: Label 312: 105(ptr) AccessChain 114(f3) 14 313: 16(float) Load 312 - Store 307 313 + Store 309 313 Branch 311 314: Label 316: 57(ptr) AccessChain 68(i2) 315 317: 9(int) Load 316 318: 16(float) ConvertSToF 317 - Store 307 318 + Store 309 318 Branch 311 311: Label - 319: 16(float) Load 307 + 319: 16(float) Load 309 320: 16(float) FAdd 306 319 Store 106(f) 320 Branch 296 296: Label - 324: 6(bool) Load 8(b) - 325: 23(bvec2) Load 25(b2) - 326: 6(bool) CompositeExtract 325 0 - 327: 6(bool) LogicalOr 324 326 - 328: 23(bvec2) Load 25(b2) - 329: 6(bool) CompositeExtract 328 1 - 330: 6(bool) LogicalOr 327 329 - 331: 31(bvec3) Load 33(b3) - 332: 6(bool) CompositeExtract 331 0 - 333: 6(bool) LogicalOr 330 332 - 334: 31(bvec3) Load 33(b3) - 335: 6(bool) CompositeExtract 334 1 - 336: 6(bool) LogicalOr 333 335 - 337: 31(bvec3) Load 33(b3) - 338: 6(bool) CompositeExtract 337 2 - 339: 6(bool) LogicalOr 336 338 - 340: 43(bvec4) Load 45(b4) - 341: 6(bool) CompositeExtract 340 0 + 323: 6(bool) Load 8(b) + 324: 7(ptr) AccessChain 25(b2) 14 + 325: 6(bool) Load 324 + 326: 6(bool) LogicalOr 323 325 + 327: 7(ptr) AccessChain 25(b2) 315 + 328: 6(bool) Load 327 + 329: 6(bool) LogicalOr 326 328 + 330: 7(ptr) AccessChain 33(b3) 14 + 331: 6(bool) Load 330 + 332: 6(bool) LogicalOr 329 331 + 333: 7(ptr) AccessChain 33(b3) 315 + 334: 6(bool) Load 333 + 335: 6(bool) LogicalOr 332 334 + 337: 7(ptr) AccessChain 33(b3) 336 + 338: 6(bool) Load 337 + 339: 6(bool) LogicalOr 335 338 + 340: 7(ptr) AccessChain 45(b4) 14 + 341: 6(bool) Load 340 342: 6(bool) LogicalOr 339 341 - 343: 43(bvec4) Load 45(b4) - 344: 6(bool) CompositeExtract 343 1 + 343: 7(ptr) AccessChain 45(b4) 315 + 344: 6(bool) Load 343 345: 6(bool) LogicalOr 342 344 - 346: 43(bvec4) Load 45(b4) - 347: 6(bool) CompositeExtract 346 2 + 346: 7(ptr) AccessChain 45(b4) 336 + 347: 6(bool) Load 346 348: 6(bool) LogicalOr 345 347 - 349: 43(bvec4) Load 45(b4) - 350: 6(bool) CompositeExtract 349 3 - 351: 6(bool) LogicalOr 348 350 - SelectionMerge 353 None - BranchConditional 351 352 415 - 352: Label - 354: 9(int) Load 58(i) - 355: 57(ptr) AccessChain 68(i2) 14 - 356: 9(int) Load 355 - 357: 9(int) IAdd 354 356 - 358: 57(ptr) AccessChain 68(i2) 315 - 359: 9(int) Load 358 - 360: 9(int) IAdd 357 359 - 361: 57(ptr) AccessChain 81(i3) 14 - 362: 9(int) Load 361 - 363: 9(int) IAdd 360 362 - 364: 57(ptr) AccessChain 81(i3) 315 - 365: 9(int) Load 364 - 366: 9(int) IAdd 363 365 - 368: 57(ptr) AccessChain 81(i3) 367 - 369: 9(int) Load 368 - 370: 9(int) IAdd 366 369 - 371: 57(ptr) AccessChain 94(i4) 14 - 372: 9(int) Load 371 - 373: 9(int) IAdd 370 372 - 374: 57(ptr) AccessChain 94(i4) 315 - 375: 9(int) Load 374 - 376: 9(int) IAdd 373 375 - 377: 57(ptr) AccessChain 94(i4) 367 - 378: 9(int) Load 377 - 379: 9(int) IAdd 376 378 - 381: 57(ptr) AccessChain 94(i4) 380 + 350: 7(ptr) AccessChain 45(b4) 349 + 351: 6(bool) Load 350 + 352: 6(bool) LogicalOr 348 351 + SelectionMerge 355 None + BranchConditional 352 354 415 + 354: Label + 356: 9(int) Load 58(i) + 357: 57(ptr) AccessChain 68(i2) 14 + 358: 9(int) Load 357 + 359: 9(int) IAdd 356 358 + 360: 57(ptr) AccessChain 68(i2) 315 + 361: 9(int) Load 360 + 362: 9(int) IAdd 359 361 + 363: 57(ptr) AccessChain 81(i3) 14 + 364: 9(int) Load 363 + 365: 9(int) IAdd 362 364 + 366: 57(ptr) AccessChain 81(i3) 315 + 367: 9(int) Load 366 + 368: 9(int) IAdd 365 367 + 369: 57(ptr) AccessChain 81(i3) 336 + 370: 9(int) Load 369 + 371: 9(int) IAdd 368 370 + 372: 57(ptr) AccessChain 94(i4) 14 + 373: 9(int) Load 372 + 374: 9(int) IAdd 371 373 + 375: 57(ptr) AccessChain 94(i4) 315 + 376: 9(int) Load 375 + 377: 9(int) IAdd 374 376 + 378: 57(ptr) AccessChain 94(i4) 336 + 379: 9(int) Load 378 + 380: 9(int) IAdd 377 379 + 381: 57(ptr) AccessChain 94(i4) 349 382: 9(int) Load 381 - 383: 9(int) IAdd 379 382 + 383: 9(int) IAdd 380 382 384: 16(float) ConvertSToF 383 385: 16(float) Load 106(f) 386: 16(float) FAdd 384 385 @@ -535,7 +535,7 @@ 396: 105(ptr) AccessChain 114(f3) 315 397: 16(float) Load 396 398: 16(float) FAdd 395 397 - 399: 105(ptr) AccessChain 114(f3) 367 + 399: 105(ptr) AccessChain 114(f3) 336 400: 16(float) Load 399 401: 16(float) FAdd 398 400 402: 105(ptr) AccessChain 118(f4) 14 @@ -544,20 +544,20 @@ 405: 105(ptr) AccessChain 118(f4) 315 406: 16(float) Load 405 407: 16(float) FAdd 404 406 - 408: 105(ptr) AccessChain 118(f4) 367 + 408: 105(ptr) AccessChain 118(f4) 336 409: 16(float) Load 408 410: 16(float) FAdd 407 409 - 411: 105(ptr) AccessChain 118(f4) 380 + 411: 105(ptr) AccessChain 118(f4) 349 412: 16(float) Load 411 413: 16(float) FAdd 410 412 414: 95(fvec4) CompositeConstruct 413 413 413 413 - Store 323 414 - Branch 353 + Store 353 414 + Branch 355 415: Label - Store 323 151 - Branch 353 - 353: Label - 416: 95(fvec4) Load 323 + Store 353 151 + Branch 355 + 355: Label + 416: 95(fvec4) Load 353 Store 322(gl_FragColor) 416 Store 417(cv2) 102 419: 92(ivec4) Load 417(cv2) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.dataOut.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.dataOut.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.dataOut.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.dataOut.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.dataOut.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 20 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.dataOutIndirect.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.dataOutIndirect.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.dataOutIndirect.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.dataOutIndirect.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.dataOutIndirect.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 26 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.dataOutIndirect.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.dataOutIndirect.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.dataOutIndirect.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.dataOutIndirect.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -2,7 +2,7 @@ WARNING: 0:3: attribute deprecated in version 130; may be removed in future release // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 38 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,280 @@ +spv.debugInfo.frag +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 126 + + Capability Shader + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 5 "main" 24 52 + ExecutionMode 5 OriginLowerLeft + 1: String "spv.debugInfo.frag" + Source GLSL 450 1 "#version 450 + +struct S { + int a; +}; + +uniform ubuf { + S s; +}; + +uniform sampler2D s2d; + +layout(location = 0) in vec4 inv; +layout(location = 0) out vec4 outv; + +vec4 foo(S s) +{ + vec4 r = s.a * inv; + ++r; + if (r.x > 3.0) + --r; + else + r *= 2; + + return r; +} + +void main() +{ + outv = foo(s); + outv += texture(s2d, vec2(0.5)); + + switch (s.a) { + case 10: + ++outv; + break; + case 20: + outv = 2 * outv; + ++outv; + break; + default: + --outv; + break; + } + + for (int i = 0; i < 10; ++i) + outv *= 3.0; + + outv.x < 10.0 ? + outv = sin(outv) : + outv = cos(outv); +}" + Name 5 "main" + Name 8 "S" + MemberName 8(S) 0 "a" + Name 14 "foo(struct-S-i11;" + Name 13 "s" + Name 17 "r" + Name 24 "inv" + Name 52 "outv" + Name 53 "S" + MemberName 53(S) 0 "a" + Name 54 "ubuf" + MemberName 54(ubuf) 0 "s" + Name 56 "" + Name 57 "S" + MemberName 57(S) 0 "a" + Name 59 "param" + Name 69 "s2d" + Name 99 "i" + ModuleProcessed "no-storage-format" + ModuleProcessed "resource-set-binding 3" + ModuleProcessed "auto-map-locations" + ModuleProcessed "client opengl100" + ModuleProcessed "target-env opengl" + ModuleProcessed "relaxed-errors" + ModuleProcessed "suppress-warnings" + ModuleProcessed "hlsl-offsets" + ModuleProcessed "entry-point main" + Decorate 24(inv) Location 0 + Decorate 52(outv) Location 0 + MemberDecorate 53(S) 0 Offset 0 + MemberDecorate 54(ubuf) 0 Offset 0 + Decorate 54(ubuf) Block + Decorate 56 DescriptorSet 3 + Decorate 69(s2d) Location 0 + Decorate 69(s2d) DescriptorSet 3 + 3: TypeVoid + 4: TypeFunction 3 + 7: TypeInt 32 1 + 8(S): TypeStruct 7(int) + 9: TypePointer Function 8(S) + 10: TypeFloat 32 + 11: TypeVector 10(float) 4 + 12: TypeFunction 11(fvec4) 9(ptr) + 16: TypePointer Function 11(fvec4) + 18: 7(int) Constant 0 + 19: TypePointer Function 7(int) + 23: TypePointer Input 11(fvec4) + 24(inv): 23(ptr) Variable Input + 28: 10(float) Constant 1065353216 + 31: TypeInt 32 0 + 32: 31(int) Constant 0 + 33: TypePointer Function 10(float) + 36: 10(float) Constant 1077936128 + 37: TypeBool + 45: 10(float) Constant 1073741824 + 51: TypePointer Output 11(fvec4) + 52(outv): 51(ptr) Variable Output + 53(S): TypeStruct 7(int) + 54(ubuf): TypeStruct 53(S) + 55: TypePointer Uniform 54(ubuf) + 56: 55(ptr) Variable Uniform + 57(S): TypeStruct 7(int) + 58: TypePointer Function 57(S) + 60: TypePointer Uniform 53(S) + 66: TypeImage 10(float) 2D sampled format:Unknown + 67: TypeSampledImage 66 + 68: TypePointer UniformConstant 67 + 69(s2d): 68(ptr) Variable UniformConstant + 71: TypeVector 10(float) 2 + 72: 10(float) Constant 1056964608 + 73: 71(fvec2) ConstantComposite 72 72 + 77: TypePointer Uniform 7(int) + 106: 7(int) Constant 10 + 111: 7(int) Constant 1 + 113: TypePointer Output 10(float) + 116: 10(float) Constant 1092616192 + 5(main): 3 Function None 4 + 6: Label + 59(param): 58(ptr) Variable Function + 99(i): 19(ptr) Variable Function + 118: 16(ptr) Variable Function + Line 1 30 0 + 61: 60(ptr) AccessChain 56 18 + 62: 53(S) Load 61 + 63: 7(int) CompositeExtract 62 0 + 64: 19(ptr) AccessChain 59(param) 18 + Store 64 63 + 65: 11(fvec4) FunctionCall 14(foo(struct-S-i11;) 59(param) + Store 52(outv) 65 + Line 1 31 0 + 70: 67 Load 69(s2d) + 74: 11(fvec4) ImageSampleImplicitLod 70 73 + 75: 11(fvec4) Load 52(outv) + 76: 11(fvec4) FAdd 75 74 + Store 52(outv) 76 + Line 1 33 0 + 78: 77(ptr) AccessChain 56 18 18 + 79: 7(int) Load 78 + SelectionMerge 83 None + Switch 79 82 + case 10: 80 + case 20: 81 + 82: Label + Line 1 42 0 + 94: 11(fvec4) Load 52(outv) + 95: 11(fvec4) CompositeConstruct 28 28 28 28 + 96: 11(fvec4) FSub 94 95 + Store 52(outv) 96 + Line 1 43 0 + Branch 83 + 80: Label + Line 1 35 0 + 84: 11(fvec4) Load 52(outv) + 85: 11(fvec4) CompositeConstruct 28 28 28 28 + 86: 11(fvec4) FAdd 84 85 + Store 52(outv) 86 + Line 1 36 0 + Branch 83 + 81: Label + Line 1 38 0 + 88: 11(fvec4) Load 52(outv) + 89: 11(fvec4) VectorTimesScalar 88 45 + Store 52(outv) 89 + Line 1 39 0 + 90: 11(fvec4) Load 52(outv) + 91: 11(fvec4) CompositeConstruct 28 28 28 28 + 92: 11(fvec4) FAdd 90 91 + Store 52(outv) 92 + Line 1 40 0 + Branch 83 + 83: Label + Line 1 46 0 + Store 99(i) 18 + Branch 100 + 100: Label + LoopMerge 102 103 None + Branch 104 + 104: Label + 105: 7(int) Load 99(i) + 107: 37(bool) SLessThan 105 106 + BranchConditional 107 101 102 + 101: Label + Line 1 47 0 + 108: 11(fvec4) Load 52(outv) + 109: 11(fvec4) VectorTimesScalar 108 36 + Store 52(outv) 109 + Branch 103 + 103: Label + Line 1 46 0 + 110: 7(int) Load 99(i) + 112: 7(int) IAdd 110 111 + Store 99(i) 112 + Branch 100 + 102: Label + Line 1 49 0 + 114: 113(ptr) AccessChain 52(outv) 32 + 115: 10(float) Load 114 + 117: 37(bool) FOrdLessThan 115 116 + SelectionMerge 120 None + BranchConditional 117 119 123 + 119: Label + Line 1 50 0 + 121: 11(fvec4) Load 52(outv) + 122: 11(fvec4) ExtInst 2(GLSL.std.450) 13(Sin) 121 + Store 52(outv) 122 + Store 118 122 + Branch 120 + 123: Label + Line 1 51 0 + 124: 11(fvec4) Load 52(outv) + 125: 11(fvec4) ExtInst 2(GLSL.std.450) 14(Cos) 124 + Store 52(outv) 125 + Store 118 125 + Branch 120 + 120: Label + Return + FunctionEnd +14(foo(struct-S-i11;): 11(fvec4) Function None 12 + 13(s): 9(ptr) FunctionParameter + 15: Label + 17(r): 16(ptr) Variable Function + Line 1 18 0 + 20: 19(ptr) AccessChain 13(s) 18 + 21: 7(int) Load 20 + 22: 10(float) ConvertSToF 21 + 25: 11(fvec4) Load 24(inv) + 26: 11(fvec4) VectorTimesScalar 25 22 + Store 17(r) 26 + Line 1 19 0 + 27: 11(fvec4) Load 17(r) + 29: 11(fvec4) CompositeConstruct 28 28 28 28 + 30: 11(fvec4) FAdd 27 29 + Store 17(r) 30 + Line 1 20 0 + 34: 33(ptr) AccessChain 17(r) 32 + 35: 10(float) Load 34 + 38: 37(bool) FOrdGreaterThan 35 36 + SelectionMerge 40 None + BranchConditional 38 39 44 + 39: Label + Line 1 21 0 + 41: 11(fvec4) Load 17(r) + 42: 11(fvec4) CompositeConstruct 28 28 28 28 + 43: 11(fvec4) FSub 41 42 + Store 17(r) 43 + Branch 40 + 44: Label + Line 1 23 0 + 46: 11(fvec4) Load 17(r) + 47: 11(fvec4) VectorTimesScalar 46 45 + Store 17(r) 47 + Branch 40 + 40: Label + Line 1 25 0 + 48: 11(fvec4) Load 17(r) + ReturnValue 48 + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.debugInfo.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.debugInfo.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.debugInfo.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.debugInfo.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.debugInfo.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 126 Capability Shader @@ -11,6 +11,7 @@ 1: String "spv.debugInfo.frag" Source GLSL 450 1 "// OpModuleProcessed no-storage-format // OpModuleProcessed resource-set-binding 3 +// OpModuleProcessed auto-map-bindings // OpModuleProcessed auto-map-locations // OpModuleProcessed client opengl100 // OpModuleProcessed target-env opengl @@ -95,7 +96,10 @@ MemberDecorate 54(ubuf) 0 Offset 0 Decorate 54(ubuf) Block Decorate 56 DescriptorSet 3 + Decorate 56 Binding 0 + Decorate 69(s2d) Location 0 Decorate 69(s2d) DescriptorSet 3 + Decorate 69(s2d) Binding 1 3: TypeVoid 4: TypeFunction 3 7: TypeInt 32 1 @@ -135,13 +139,13 @@ 77: TypePointer Uniform 7(int) 106: 7(int) Constant 10 111: 7(int) Constant 1 - 114: TypePointer Output 10(float) - 117: 10(float) Constant 1092616192 + 113: TypePointer Output 10(float) + 116: 10(float) Constant 1092616192 5(main): 3 Function None 4 6: Label 59(param): 58(ptr) Variable Function 99(i): 19(ptr) Variable Function - 113: 16(ptr) Variable Function + 118: 16(ptr) Variable Function Line 1 30 0 61: 60(ptr) AccessChain 56 18 62: 53(S) Load 61 @@ -216,24 +220,24 @@ Branch 100 102: Label Line 1 49 0 - 115: 114(ptr) AccessChain 52(outv) 32 - 116: 10(float) Load 115 - 118: 37(bool) FOrdLessThan 116 117 + 114: 113(ptr) AccessChain 52(outv) 32 + 115: 10(float) Load 114 + 117: 37(bool) FOrdLessThan 115 116 SelectionMerge 120 None - BranchConditional 118 119 123 + BranchConditional 117 119 123 119: Label Line 1 50 0 121: 11(fvec4) Load 52(outv) 122: 11(fvec4) ExtInst 2(GLSL.std.450) 13(Sin) 121 Store 52(outv) 122 - Store 113 122 + Store 118 122 Branch 120 123: Label Line 1 51 0 124: 11(fvec4) Load 52(outv) 125: 11(fvec4) ExtInst 2(GLSL.std.450) 14(Cos) 124 Store 52(outv) 125 - Store 113 125 + Store 118 125 Branch 120 120: Label Return diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.deepRvalue.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.deepRvalue.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.deepRvalue.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.deepRvalue.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.deepRvalue.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 152 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.depthOut.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.depthOut.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.depthOut.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.depthOut.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.depthOut.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 15 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.deviceGroup.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.deviceGroup.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.deviceGroup.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.deviceGroup.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,11 +1,10 @@ spv.deviceGroup.frag -// Module Version 10000 -// Generated by (magic number): 80002 +// Module Version 10300 +// Generated by (magic number): 80006 // Id's are bound by 17 Capability Shader Capability DeviceGroup - Extension "SPV_KHR_device_group" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 9 12 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.discard-dce.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.discard-dce.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.discard-dce.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.discard-dce.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.discard-dce.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 84 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.do-simple.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.do-simple.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.do-simple.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.do-simple.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.do-simple.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 21 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.double.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.double.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.double.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.double.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.double.comp // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 60 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.do-while-continue-break.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.do-while-continue-break.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.do-while-continue-break.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.do-while-continue-break.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.do-while-continue-break.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 43 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.doWhileLoop.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.doWhileLoop.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.doWhileLoop.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.doWhileLoop.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.doWhileLoop.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 34 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.drawParams.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.drawParams.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.drawParams.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.drawParams.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,11 +1,10 @@ spv.drawParams.vert -// Module Version 10000 -// Generated by (magic number): 80002 +// Module Version 10300 +// Generated by (magic number): 80006 // Id's are bound by 29 Capability Shader Capability DrawParameters - Extension "SPV_KHR_shader_draw_parameters" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Vertex 4 "main" 10 13 16 21 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.earlyReturnDiscard.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.earlyReturnDiscard.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.earlyReturnDiscard.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.earlyReturnDiscard.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.earlyReturnDiscard.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 110 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.explicittypes.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.explicittypes.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.explicittypes.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.explicittypes.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,882 @@ +spv.explicittypes.frag +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 576 + + Capability Shader + Capability Float16 + Capability Float64 + Capability Int64 + Capability Int16 + Capability Int8 + Capability StorageUniform16 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_KHX_shader_explicit_arithmetic_types" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + Name 4 "main" + Name 6 "literal(" + Name 8 "typeCast8(" + Name 10 "typeCast16(" + Name 12 "typeCast32(" + Name 14 "typeCast64(" + Name 18 "i64" + Name 26 "Uniforms" + MemberName 26(Uniforms) 0 "index" + Name 28 "" + Name 35 "indexable" + Name 40 "u64" + Name 49 "indexable" + Name 53 "i32" + Name 62 "indexable" + Name 66 "u32" + Name 74 "indexable" + Name 79 "i16" + Name 88 "indexable" + Name 93 "u16" + Name 101 "indexable" + Name 106 "i8" + Name 115 "indexable" + Name 120 "u8" + Name 128 "indexable" + Name 133 "u8v" + Name 136 "i8v" + Name 141 "i16v" + Name 149 "i32v" + Name 157 "u32v" + Name 163 "i64v" + Name 168 "u64v" + Name 182 "f16v" + Name 188 "f32v" + Name 194 "f64v" + Name 222 "u16v" + Name 252 "bv" + Name 268 "i32v" + Name 269 "i16v" + Name 272 "u16v" + Name 278 "u32v" + Name 282 "i64v" + Name 285 "u64v" + Name 296 "f16v" + Name 299 "f32v" + Name 302 "f64v" + Name 347 "i8v" + Name 353 "u8v" + Name 363 "bv" + Name 380 "u32v" + Name 381 "i32v" + Name 384 "i64v" + Name 387 "u64v" + Name 396 "f32v" + Name 399 "f64v" + Name 406 "i8v" + Name 412 "i16v" + Name 429 "u8v" + Name 435 "u16v" + Name 452 "f16v" + Name 465 "bv" + Name 481 "u64v" + Name 482 "i64v" + Name 485 "f64v" + Name 490 "i8v" + Name 496 "i16v" + Name 502 "i32v" + Name 510 "u8v" + Name 516 "u16v" + Name 522 "u32v" + Name 534 "f16v" + Name 537 "f32v" + Name 548 "bv" + Name 573 "Block" + MemberName 573(Block) 0 "i16" + MemberName 573(Block) 1 "i16v2" + MemberName 573(Block) 2 "i16v3" + MemberName 573(Block) 3 "i16v4" + MemberName 573(Block) 4 "u16" + MemberName 573(Block) 5 "u16v2" + MemberName 573(Block) 6 "u16v3" + MemberName 573(Block) 7 "u16v4" + MemberName 573(Block) 8 "i32" + MemberName 573(Block) 9 "i32v2" + MemberName 573(Block) 10 "i32v3" + MemberName 573(Block) 11 "i32v4" + MemberName 573(Block) 12 "u32" + MemberName 573(Block) 13 "u32v2" + MemberName 573(Block) 14 "u32v3" + MemberName 573(Block) 15 "u32v4" + Name 575 "block" + MemberDecorate 26(Uniforms) 0 Offset 0 + Decorate 26(Uniforms) Block + Decorate 28 DescriptorSet 0 + Decorate 28 Binding 0 + MemberDecorate 573(Block) 0 Offset 0 + MemberDecorate 573(Block) 1 Offset 4 + MemberDecorate 573(Block) 2 Offset 8 + MemberDecorate 573(Block) 3 Offset 16 + MemberDecorate 573(Block) 4 Offset 24 + MemberDecorate 573(Block) 5 Offset 28 + MemberDecorate 573(Block) 6 Offset 32 + MemberDecorate 573(Block) 7 Offset 40 + MemberDecorate 573(Block) 8 Offset 48 + MemberDecorate 573(Block) 9 Offset 56 + MemberDecorate 573(Block) 10 Offset 64 + MemberDecorate 573(Block) 11 Offset 80 + MemberDecorate 573(Block) 12 Offset 96 + MemberDecorate 573(Block) 13 Offset 104 + MemberDecorate 573(Block) 14 Offset 112 + MemberDecorate 573(Block) 15 Offset 128 + Decorate 573(Block) Block + Decorate 575(block) DescriptorSet 0 + Decorate 575(block) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 16: TypeInt 64 1 + 17: TypePointer Function 16(int) + 19: TypeInt 32 0 + 20: 19(int) Constant 3 + 21: TypeArray 16(int) 20 + 22: 16(int) Constant 4008636143 4008636142 + 23: 16(int) Constant 4294967295 4294967295 + 24: 16(int) Constant 0 1 + 25: 21 ConstantComposite 22 23 24 + 26(Uniforms): TypeStruct 19(int) + 27: TypePointer Uniform 26(Uniforms) + 28: 27(ptr) Variable Uniform + 29: TypeInt 32 1 + 30: 29(int) Constant 0 + 31: TypePointer Uniform 19(int) + 34: TypePointer Function 21 + 38: TypeInt 64 0 + 39: TypePointer Function 38(int) + 41: TypeArray 38(int) 20 + 42: 38(int) Constant 4294967295 4294967295 + 43: 38(int) Constant 0 1 + 44: 38(int) Constant 4294967295 1 + 45: 41 ConstantComposite 42 43 44 + 48: TypePointer Function 41 + 52: TypePointer Function 29(int) + 54: TypeArray 29(int) 20 + 55: 29(int) Constant 4008636143 + 56: 29(int) Constant 4294967295 + 57: 29(int) Constant 536870912 + 58: 54 ConstantComposite 55 56 57 + 61: TypePointer Function 54 + 65: TypePointer Function 19(int) + 67: TypeArray 19(int) 20 + 68: 19(int) Constant 4294967295 + 69: 19(int) Constant 2147483647 + 70: 67 ConstantComposite 68 68 69 + 73: TypePointer Function 67 + 77: TypeInt 16 1 + 78: TypePointer Function 77(int) + 80: TypeArray 77(int) 20 + 81: 77(int) Constant 4294962927 + 82: 77(int) Constant 4294967295 + 83: 77(int) Constant 16384 + 84: 80 ConstantComposite 81 82 83 + 87: TypePointer Function 80 + 91: TypeInt 16 0 + 92: TypePointer Function 91(int) + 94: TypeArray 91(int) 20 + 95: 91(int) Constant 65535 + 96: 91(int) Constant 32767 + 97: 94 ConstantComposite 95 95 96 + 100: TypePointer Function 94 + 104: TypeInt 8 1 + 105: TypePointer Function 104(int) + 107: TypeArray 104(int) 20 + 108: 104(int) Constant 4294967279 + 109: 104(int) Constant 4294967295 + 110: 104(int) Constant 0 + 111: 107 ConstantComposite 108 109 110 + 114: TypePointer Function 107 + 118: TypeInt 8 0 + 119: TypePointer Function 118(int) + 121: TypeArray 118(int) 20 + 122: 118(int) Constant 255 + 123: 118(int) Constant 127 + 124: 121 ConstantComposite 122 122 123 + 127: TypePointer Function 121 + 131: TypeVector 118(int) 2 + 132: TypePointer Function 131(ivec2) + 134: TypeVector 104(int) 2 + 135: TypePointer Function 134(ivec2) + 139: TypeVector 77(int) 2 + 140: TypePointer Function 139(ivec2) + 147: TypeVector 29(int) 2 + 148: TypePointer Function 147(ivec2) + 155: TypeVector 19(int) 2 + 156: TypePointer Function 155(ivec2) + 161: TypeVector 16(int) 2 + 162: TypePointer Function 161(ivec2) + 166: TypeVector 38(int) 2 + 167: TypePointer Function 166(ivec2) + 179: TypeFloat 16 + 180: TypeVector 179(float) 2 + 181: TypePointer Function 180(fvec2) + 185: TypeFloat 32 + 186: TypeVector 185(float) 2 + 187: TypePointer Function 186(fvec2) + 191: TypeFloat 64 + 192: TypeVector 191(float) 2 + 193: TypePointer Function 192(fvec2) + 220: TypeVector 91(int) 2 + 221: TypePointer Function 220(ivec2) + 249: TypeBool + 250: TypeVector 249(bool) 2 + 251: TypePointer Function 250(bvec2) + 254: 104(int) Constant 1 + 255: 134(ivec2) ConstantComposite 110 110 + 256: 134(ivec2) ConstantComposite 254 254 + 259: 118(int) Constant 0 + 260: 118(int) Constant 1 + 261: 131(ivec2) ConstantComposite 259 259 + 262: 131(ivec2) ConstantComposite 260 260 + 365: 77(int) Constant 0 + 366: 77(int) Constant 1 + 367: 139(ivec2) ConstantComposite 365 365 + 368: 139(ivec2) ConstantComposite 366 366 + 371: 91(int) Constant 0 + 372: 91(int) Constant 1 + 373: 220(ivec2) ConstantComposite 371 371 + 374: 220(ivec2) ConstantComposite 372 372 + 467: 29(int) Constant 1 + 468: 147(ivec2) ConstantComposite 30 30 + 469: 147(ivec2) ConstantComposite 467 467 + 472: 19(int) Constant 0 + 473: 19(int) Constant 1 + 474: 155(ivec2) ConstantComposite 472 472 + 475: 155(ivec2) ConstantComposite 473 473 + 550: 16(int) Constant 0 0 + 551: 16(int) Constant 1 0 + 552: 161(ivec2) ConstantComposite 550 550 + 553: 161(ivec2) ConstantComposite 551 551 + 556: 38(int) Constant 0 0 + 557: 38(int) Constant 1 0 + 558: 166(ivec2) ConstantComposite 556 556 + 559: 166(ivec2) ConstantComposite 557 557 + 565: TypeVector 77(int) 3 + 566: TypeVector 77(int) 4 + 567: TypeVector 91(int) 3 + 568: TypeVector 91(int) 4 + 569: TypeVector 29(int) 3 + 570: TypeVector 29(int) 4 + 571: TypeVector 19(int) 3 + 572: TypeVector 19(int) 4 + 573(Block): TypeStruct 77(int) 139(ivec2) 565(ivec3) 566(ivec4) 91(int) 220(ivec2) 567(ivec3) 568(ivec4) 29(int) 147(ivec2) 569(ivec3) 570(ivec4) 19(int) 155(ivec2) 571(ivec3) 572(ivec4) + 574: TypePointer Uniform 573(Block) + 575(block): 574(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd + 6(literal(): 2 Function None 3 + 7: Label + 18(i64): 17(ptr) Variable Function + 35(indexable): 34(ptr) Variable Function + 40(u64): 39(ptr) Variable Function + 49(indexable): 48(ptr) Variable Function + 53(i32): 52(ptr) Variable Function + 62(indexable): 61(ptr) Variable Function + 66(u32): 65(ptr) Variable Function + 74(indexable): 73(ptr) Variable Function + 79(i16): 78(ptr) Variable Function + 88(indexable): 87(ptr) Variable Function + 93(u16): 92(ptr) Variable Function + 101(indexable): 100(ptr) Variable Function + 106(i8): 105(ptr) Variable Function + 115(indexable): 114(ptr) Variable Function + 120(u8): 119(ptr) Variable Function + 128(indexable): 127(ptr) Variable Function + 32: 31(ptr) AccessChain 28 30 + 33: 19(int) Load 32 + Store 35(indexable) 25 + 36: 17(ptr) AccessChain 35(indexable) 33 + 37: 16(int) Load 36 + Store 18(i64) 37 + 46: 31(ptr) AccessChain 28 30 + 47: 19(int) Load 46 + Store 49(indexable) 45 + 50: 39(ptr) AccessChain 49(indexable) 47 + 51: 38(int) Load 50 + Store 40(u64) 51 + 59: 31(ptr) AccessChain 28 30 + 60: 19(int) Load 59 + Store 62(indexable) 58 + 63: 52(ptr) AccessChain 62(indexable) 60 + 64: 29(int) Load 63 + Store 53(i32) 64 + 71: 31(ptr) AccessChain 28 30 + 72: 19(int) Load 71 + Store 74(indexable) 70 + 75: 65(ptr) AccessChain 74(indexable) 72 + 76: 19(int) Load 75 + Store 66(u32) 76 + 85: 31(ptr) AccessChain 28 30 + 86: 19(int) Load 85 + Store 88(indexable) 84 + 89: 78(ptr) AccessChain 88(indexable) 86 + 90: 77(int) Load 89 + Store 79(i16) 90 + 98: 31(ptr) AccessChain 28 30 + 99: 19(int) Load 98 + Store 101(indexable) 97 + 102: 92(ptr) AccessChain 101(indexable) 99 + 103: 91(int) Load 102 + Store 93(u16) 103 + 112: 31(ptr) AccessChain 28 30 + 113: 19(int) Load 112 + Store 115(indexable) 111 + 116: 105(ptr) AccessChain 115(indexable) 113 + 117: 104(int) Load 116 + Store 106(i8) 117 + 125: 31(ptr) AccessChain 28 30 + 126: 19(int) Load 125 + Store 128(indexable) 124 + 129: 119(ptr) AccessChain 128(indexable) 126 + 130: 118(int) Load 129 + Store 120(u8) 130 + Return + FunctionEnd + 8(typeCast8(): 2 Function None 3 + 9: Label + 133(u8v): 132(ptr) Variable Function + 136(i8v): 135(ptr) Variable Function + 141(i16v): 140(ptr) Variable Function + 149(i32v): 148(ptr) Variable Function + 157(u32v): 156(ptr) Variable Function + 163(i64v): 162(ptr) Variable Function + 168(u64v): 167(ptr) Variable Function + 182(f16v): 181(ptr) Variable Function + 188(f32v): 187(ptr) Variable Function + 194(f64v): 193(ptr) Variable Function + 222(u16v): 221(ptr) Variable Function + 252(bv): 251(ptr) Variable Function + 137: 134(ivec2) Load 136(i8v) + 138: 131(ivec2) Bitcast 137 + Store 133(u8v) 138 + 142: 134(ivec2) Load 136(i8v) + 143: 139(ivec2) SConvert 142 + Store 141(i16v) 143 + 144: 131(ivec2) Load 133(u8v) + 145: 139(ivec2) UConvert 144 + 146: 139(ivec2) Bitcast 145 + Store 141(i16v) 146 + 150: 134(ivec2) Load 136(i8v) + 151: 147(ivec2) SConvert 150 + Store 149(i32v) 151 + 152: 131(ivec2) Load 133(u8v) + 153: 147(ivec2) UConvert 152 + 154: 147(ivec2) Bitcast 153 + Store 149(i32v) 154 + 158: 134(ivec2) Load 136(i8v) + 159: 147(ivec2) SConvert 158 + 160: 155(ivec2) Bitcast 159 + Store 157(u32v) 160 + 164: 134(ivec2) Load 136(i8v) + 165: 161(ivec2) SConvert 164 + Store 163(i64v) 165 + 169: 134(ivec2) Load 136(i8v) + 170: 161(ivec2) SConvert 169 + 171: 166(ivec2) Bitcast 170 + Store 168(u64v) 171 + 172: 131(ivec2) Load 133(u8v) + 173: 155(ivec2) UConvert 172 + Store 157(u32v) 173 + 174: 131(ivec2) Load 133(u8v) + 175: 161(ivec2) UConvert 174 + 176: 161(ivec2) Bitcast 175 + Store 163(i64v) 176 + 177: 131(ivec2) Load 133(u8v) + 178: 166(ivec2) UConvert 177 + Store 168(u64v) 178 + 183: 134(ivec2) Load 136(i8v) + 184: 180(fvec2) ConvertSToF 183 + Store 182(f16v) 184 + 189: 134(ivec2) Load 136(i8v) + 190: 186(fvec2) ConvertSToF 189 + Store 188(f32v) 190 + 195: 134(ivec2) Load 136(i8v) + 196: 192(fvec2) ConvertSToF 195 + Store 194(f64v) 196 + 197: 131(ivec2) Load 133(u8v) + 198: 180(fvec2) ConvertUToF 197 + Store 182(f16v) 198 + 199: 131(ivec2) Load 133(u8v) + 200: 186(fvec2) ConvertUToF 199 + Store 188(f32v) 200 + 201: 131(ivec2) Load 133(u8v) + 202: 192(fvec2) ConvertUToF 201 + Store 194(f64v) 202 + 203: 131(ivec2) Load 133(u8v) + 204: 134(ivec2) Bitcast 203 + Store 136(i8v) 204 + 205: 134(ivec2) Load 136(i8v) + 206: 139(ivec2) SConvert 205 + Store 141(i16v) 206 + 207: 131(ivec2) Load 133(u8v) + 208: 139(ivec2) UConvert 207 + 209: 139(ivec2) Bitcast 208 + Store 141(i16v) 209 + 210: 134(ivec2) Load 136(i8v) + 211: 147(ivec2) SConvert 210 + Store 149(i32v) 211 + 212: 131(ivec2) Load 133(u8v) + 213: 147(ivec2) UConvert 212 + 214: 147(ivec2) Bitcast 213 + Store 149(i32v) 214 + 215: 134(ivec2) Load 136(i8v) + 216: 161(ivec2) SConvert 215 + Store 163(i64v) 216 + 217: 134(ivec2) Load 136(i8v) + 218: 161(ivec2) SConvert 217 + 219: 166(ivec2) Bitcast 218 + Store 168(u64v) 219 + 223: 134(ivec2) Load 136(i8v) + 224: 139(ivec2) SConvert 223 + 225: 220(ivec2) Bitcast 224 + Store 222(u16v) 225 + 226: 131(ivec2) Load 133(u8v) + 227: 220(ivec2) UConvert 226 + Store 222(u16v) 227 + 228: 131(ivec2) Load 133(u8v) + 229: 155(ivec2) UConvert 228 + Store 157(u32v) 229 + 230: 131(ivec2) Load 133(u8v) + 231: 161(ivec2) UConvert 230 + 232: 161(ivec2) Bitcast 231 + Store 163(i64v) 232 + 233: 131(ivec2) Load 133(u8v) + 234: 161(ivec2) UConvert 233 + 235: 161(ivec2) Bitcast 234 + 236: 166(ivec2) Bitcast 235 + Store 168(u64v) 236 + 237: 134(ivec2) Load 136(i8v) + 238: 180(fvec2) ConvertSToF 237 + Store 182(f16v) 238 + 239: 134(ivec2) Load 136(i8v) + 240: 186(fvec2) ConvertSToF 239 + Store 188(f32v) 240 + 241: 134(ivec2) Load 136(i8v) + 242: 192(fvec2) ConvertSToF 241 + Store 194(f64v) 242 + 243: 131(ivec2) Load 133(u8v) + 244: 180(fvec2) ConvertUToF 243 + Store 182(f16v) 244 + 245: 131(ivec2) Load 133(u8v) + 246: 186(fvec2) ConvertUToF 245 + Store 188(f32v) 246 + 247: 131(ivec2) Load 133(u8v) + 248: 192(fvec2) ConvertUToF 247 + Store 194(f64v) 248 + 253: 250(bvec2) Load 252(bv) + 257: 134(ivec2) Select 253 256 255 + Store 136(i8v) 257 + 258: 250(bvec2) Load 252(bv) + 263: 131(ivec2) Select 258 262 261 + Store 133(u8v) 263 + 264: 134(ivec2) Load 136(i8v) + 265: 250(bvec2) INotEqual 264 261 + Store 252(bv) 265 + 266: 131(ivec2) Load 133(u8v) + 267: 250(bvec2) INotEqual 266 261 + Store 252(bv) 267 + Return + FunctionEnd + 10(typeCast16(): 2 Function None 3 + 11: Label + 268(i32v): 148(ptr) Variable Function + 269(i16v): 140(ptr) Variable Function + 272(u16v): 221(ptr) Variable Function + 278(u32v): 156(ptr) Variable Function + 282(i64v): 162(ptr) Variable Function + 285(u64v): 167(ptr) Variable Function + 296(f16v): 181(ptr) Variable Function + 299(f32v): 187(ptr) Variable Function + 302(f64v): 193(ptr) Variable Function + 347(i8v): 135(ptr) Variable Function + 353(u8v): 132(ptr) Variable Function + 363(bv): 251(ptr) Variable Function + 270: 139(ivec2) Load 269(i16v) + 271: 147(ivec2) SConvert 270 + Store 268(i32v) 271 + 273: 220(ivec2) Load 272(u16v) + 274: 147(ivec2) UConvert 273 + 275: 147(ivec2) Bitcast 274 + Store 268(i32v) 275 + 276: 139(ivec2) Load 269(i16v) + 277: 220(ivec2) Bitcast 276 + Store 272(u16v) 277 + 279: 139(ivec2) Load 269(i16v) + 280: 147(ivec2) SConvert 279 + 281: 155(ivec2) Bitcast 280 + Store 278(u32v) 281 + 283: 139(ivec2) Load 269(i16v) + 284: 161(ivec2) SConvert 283 + Store 282(i64v) 284 + 286: 139(ivec2) Load 269(i16v) + 287: 161(ivec2) SConvert 286 + 288: 166(ivec2) Bitcast 287 + Store 285(u64v) 288 + 289: 220(ivec2) Load 272(u16v) + 290: 155(ivec2) UConvert 289 + Store 278(u32v) 290 + 291: 220(ivec2) Load 272(u16v) + 292: 161(ivec2) UConvert 291 + 293: 161(ivec2) Bitcast 292 + Store 282(i64v) 293 + 294: 220(ivec2) Load 272(u16v) + 295: 166(ivec2) UConvert 294 + Store 285(u64v) 295 + 297: 139(ivec2) Load 269(i16v) + 298: 180(fvec2) ConvertSToF 297 + Store 296(f16v) 298 + 300: 139(ivec2) Load 269(i16v) + 301: 186(fvec2) ConvertSToF 300 + Store 299(f32v) 301 + 303: 139(ivec2) Load 269(i16v) + 304: 192(fvec2) ConvertSToF 303 + Store 302(f64v) 304 + 305: 220(ivec2) Load 272(u16v) + 306: 180(fvec2) ConvertUToF 305 + Store 296(f16v) 306 + 307: 220(ivec2) Load 272(u16v) + 308: 186(fvec2) ConvertUToF 307 + Store 299(f32v) 308 + 309: 220(ivec2) Load 272(u16v) + 310: 192(fvec2) ConvertUToF 309 + Store 302(f64v) 310 + 311: 139(ivec2) Load 269(i16v) + 312: 147(ivec2) SConvert 311 + Store 268(i32v) 312 + 313: 220(ivec2) Load 272(u16v) + 314: 147(ivec2) UConvert 313 + 315: 147(ivec2) Bitcast 314 + Store 268(i32v) 315 + 316: 139(ivec2) Load 269(i16v) + 317: 220(ivec2) Bitcast 316 + Store 272(u16v) 317 + 318: 139(ivec2) Load 269(i16v) + 319: 147(ivec2) SConvert 318 + 320: 155(ivec2) Bitcast 319 + Store 278(u32v) 320 + 321: 139(ivec2) Load 269(i16v) + 322: 161(ivec2) SConvert 321 + Store 282(i64v) 322 + 323: 139(ivec2) Load 269(i16v) + 324: 161(ivec2) SConvert 323 + 325: 166(ivec2) Bitcast 324 + Store 285(u64v) 325 + 326: 220(ivec2) Load 272(u16v) + 327: 155(ivec2) UConvert 326 + Store 278(u32v) 327 + 328: 220(ivec2) Load 272(u16v) + 329: 161(ivec2) UConvert 328 + 330: 161(ivec2) Bitcast 329 + Store 282(i64v) 330 + 331: 220(ivec2) Load 272(u16v) + 332: 161(ivec2) UConvert 331 + 333: 161(ivec2) Bitcast 332 + 334: 166(ivec2) Bitcast 333 + Store 285(u64v) 334 + 335: 139(ivec2) Load 269(i16v) + 336: 180(fvec2) ConvertSToF 335 + Store 296(f16v) 336 + 337: 139(ivec2) Load 269(i16v) + 338: 186(fvec2) ConvertSToF 337 + Store 299(f32v) 338 + 339: 139(ivec2) Load 269(i16v) + 340: 192(fvec2) ConvertSToF 339 + Store 302(f64v) 340 + 341: 220(ivec2) Load 272(u16v) + 342: 180(fvec2) ConvertUToF 341 + Store 296(f16v) 342 + 343: 220(ivec2) Load 272(u16v) + 344: 186(fvec2) ConvertUToF 343 + Store 299(f32v) 344 + 345: 220(ivec2) Load 272(u16v) + 346: 192(fvec2) ConvertUToF 345 + Store 302(f64v) 346 + 348: 139(ivec2) Load 269(i16v) + 349: 134(ivec2) SConvert 348 + Store 347(i8v) 349 + 350: 220(ivec2) Load 272(u16v) + 351: 134(ivec2) UConvert 350 + 352: 134(ivec2) Bitcast 351 + Store 347(i8v) 352 + 354: 139(ivec2) Load 269(i16v) + 355: 134(ivec2) SConvert 354 + 356: 131(ivec2) Bitcast 355 + Store 353(u8v) 356 + 357: 220(ivec2) Load 272(u16v) + 358: 131(ivec2) UConvert 357 + Store 353(u8v) 358 + 359: 220(ivec2) Load 272(u16v) + 360: 131(ivec2) UConvert 359 + 361: 139(ivec2) UConvert 360 + 362: 139(ivec2) Bitcast 361 + Store 269(i16v) 362 + 364: 250(bvec2) Load 363(bv) + 369: 139(ivec2) Select 364 368 367 + Store 269(i16v) 369 + 370: 250(bvec2) Load 363(bv) + 375: 220(ivec2) Select 370 374 373 + Store 272(u16v) 375 + 376: 139(ivec2) Load 269(i16v) + 377: 250(bvec2) INotEqual 376 373 + Store 363(bv) 377 + 378: 220(ivec2) Load 272(u16v) + 379: 250(bvec2) INotEqual 378 373 + Store 363(bv) 379 + Return + FunctionEnd + 12(typeCast32(): 2 Function None 3 + 13: Label + 380(u32v): 156(ptr) Variable Function + 381(i32v): 148(ptr) Variable Function + 384(i64v): 162(ptr) Variable Function + 387(u64v): 167(ptr) Variable Function + 396(f32v): 187(ptr) Variable Function + 399(f64v): 193(ptr) Variable Function + 406(i8v): 135(ptr) Variable Function + 412(i16v): 140(ptr) Variable Function + 429(u8v): 132(ptr) Variable Function + 435(u16v): 221(ptr) Variable Function + 452(f16v): 181(ptr) Variable Function + 465(bv): 251(ptr) Variable Function + 382: 147(ivec2) Load 381(i32v) + 383: 155(ivec2) Bitcast 382 + Store 380(u32v) 383 + 385: 147(ivec2) Load 381(i32v) + 386: 161(ivec2) SConvert 385 + Store 384(i64v) 386 + 388: 147(ivec2) Load 381(i32v) + 389: 161(ivec2) SConvert 388 + 390: 166(ivec2) Bitcast 389 + Store 387(u64v) 390 + 391: 155(ivec2) Load 380(u32v) + 392: 161(ivec2) UConvert 391 + 393: 161(ivec2) Bitcast 392 + Store 384(i64v) 393 + 394: 155(ivec2) Load 380(u32v) + 395: 166(ivec2) UConvert 394 + Store 387(u64v) 395 + 397: 147(ivec2) Load 381(i32v) + 398: 186(fvec2) ConvertSToF 397 + Store 396(f32v) 398 + 400: 147(ivec2) Load 381(i32v) + 401: 192(fvec2) ConvertSToF 400 + Store 399(f64v) 401 + 402: 155(ivec2) Load 380(u32v) + 403: 186(fvec2) ConvertUToF 402 + Store 396(f32v) 403 + 404: 155(ivec2) Load 380(u32v) + 405: 192(fvec2) ConvertUToF 404 + Store 399(f64v) 405 + 407: 147(ivec2) Load 381(i32v) + 408: 134(ivec2) SConvert 407 + Store 406(i8v) 408 + 409: 155(ivec2) Load 380(u32v) + 410: 134(ivec2) UConvert 409 + 411: 134(ivec2) Bitcast 410 + Store 406(i8v) 411 + 413: 147(ivec2) Load 381(i32v) + 414: 139(ivec2) SConvert 413 + Store 412(i16v) 414 + 415: 155(ivec2) Load 380(u32v) + 416: 139(ivec2) UConvert 415 + 417: 139(ivec2) Bitcast 416 + Store 412(i16v) 417 + 418: 147(ivec2) Load 381(i32v) + 419: 29(int) CompositeExtract 418 0 + 420: 29(int) CompositeExtract 418 1 + 421: 147(ivec2) CompositeConstruct 419 420 + Store 381(i32v) 421 + 422: 155(ivec2) Load 380(u32v) + 423: 147(ivec2) Bitcast 422 + Store 381(i32v) 423 + 424: 147(ivec2) Load 381(i32v) + 425: 161(ivec2) SConvert 424 + Store 384(i64v) 425 + 426: 155(ivec2) Load 380(u32v) + 427: 161(ivec2) UConvert 426 + 428: 161(ivec2) Bitcast 427 + Store 384(i64v) 428 + 430: 147(ivec2) Load 381(i32v) + 431: 134(ivec2) SConvert 430 + 432: 131(ivec2) Bitcast 431 + Store 429(u8v) 432 + 433: 155(ivec2) Load 380(u32v) + 434: 131(ivec2) UConvert 433 + Store 429(u8v) 434 + 436: 147(ivec2) Load 381(i32v) + 437: 139(ivec2) SConvert 436 + 438: 220(ivec2) Bitcast 437 + Store 435(u16v) 438 + 439: 155(ivec2) Load 380(u32v) + 440: 220(ivec2) UConvert 439 + Store 435(u16v) 440 + 441: 147(ivec2) Load 381(i32v) + 442: 155(ivec2) Bitcast 441 + Store 380(u32v) 442 + 443: 155(ivec2) Load 380(u32v) + 444: 19(int) CompositeExtract 443 0 + 445: 19(int) CompositeExtract 443 1 + 446: 155(ivec2) CompositeConstruct 444 445 + Store 380(u32v) 446 + 447: 147(ivec2) Load 381(i32v) + 448: 161(ivec2) SConvert 447 + 449: 166(ivec2) Bitcast 448 + Store 387(u64v) 449 + 450: 155(ivec2) Load 380(u32v) + 451: 166(ivec2) UConvert 450 + Store 387(u64v) 451 + 453: 147(ivec2) Load 381(i32v) + 454: 180(fvec2) ConvertSToF 453 + Store 452(f16v) 454 + 455: 147(ivec2) Load 381(i32v) + 456: 186(fvec2) ConvertSToF 455 + Store 396(f32v) 456 + 457: 147(ivec2) Load 381(i32v) + 458: 192(fvec2) ConvertSToF 457 + Store 399(f64v) 458 + 459: 155(ivec2) Load 380(u32v) + 460: 180(fvec2) ConvertUToF 459 + Store 452(f16v) 460 + 461: 155(ivec2) Load 380(u32v) + 462: 186(fvec2) ConvertUToF 461 + Store 396(f32v) 462 + 463: 155(ivec2) Load 380(u32v) + 464: 192(fvec2) ConvertUToF 463 + Store 399(f64v) 464 + 466: 250(bvec2) Load 465(bv) + 470: 147(ivec2) Select 466 469 468 + Store 381(i32v) 470 + 471: 250(bvec2) Load 465(bv) + 476: 155(ivec2) Select 471 475 474 + Store 380(u32v) 476 + 477: 147(ivec2) Load 381(i32v) + 478: 250(bvec2) INotEqual 477 474 + Store 465(bv) 478 + 479: 155(ivec2) Load 380(u32v) + 480: 250(bvec2) INotEqual 479 474 + Store 465(bv) 480 + Return + FunctionEnd + 14(typeCast64(): 2 Function None 3 + 15: Label + 481(u64v): 167(ptr) Variable Function + 482(i64v): 162(ptr) Variable Function + 485(f64v): 193(ptr) Variable Function + 490(i8v): 135(ptr) Variable Function + 496(i16v): 140(ptr) Variable Function + 502(i32v): 148(ptr) Variable Function + 510(u8v): 132(ptr) Variable Function + 516(u16v): 221(ptr) Variable Function + 522(u32v): 156(ptr) Variable Function + 534(f16v): 181(ptr) Variable Function + 537(f32v): 187(ptr) Variable Function + 548(bv): 251(ptr) Variable Function + 483: 161(ivec2) Load 482(i64v) + 484: 166(ivec2) Bitcast 483 + Store 481(u64v) 484 + 486: 161(ivec2) Load 482(i64v) + 487: 192(fvec2) ConvertSToF 486 + Store 485(f64v) 487 + 488: 166(ivec2) Load 481(u64v) + 489: 192(fvec2) ConvertUToF 488 + Store 485(f64v) 489 + 491: 161(ivec2) Load 482(i64v) + 492: 134(ivec2) SConvert 491 + Store 490(i8v) 492 + 493: 166(ivec2) Load 481(u64v) + 494: 134(ivec2) UConvert 493 + 495: 134(ivec2) Bitcast 494 + Store 490(i8v) 495 + 497: 161(ivec2) Load 482(i64v) + 498: 139(ivec2) SConvert 497 + Store 496(i16v) 498 + 499: 166(ivec2) Load 481(u64v) + 500: 139(ivec2) UConvert 499 + 501: 139(ivec2) Bitcast 500 + Store 496(i16v) 501 + 503: 161(ivec2) Load 482(i64v) + 504: 147(ivec2) SConvert 503 + Store 502(i32v) 504 + 505: 166(ivec2) Load 481(u64v) + 506: 147(ivec2) UConvert 505 + 507: 147(ivec2) Bitcast 506 + Store 502(i32v) 507 + 508: 166(ivec2) Load 481(u64v) + 509: 161(ivec2) Bitcast 508 + Store 482(i64v) 509 + 511: 161(ivec2) Load 482(i64v) + 512: 134(ivec2) SConvert 511 + 513: 131(ivec2) Bitcast 512 + Store 510(u8v) 513 + 514: 166(ivec2) Load 481(u64v) + 515: 131(ivec2) UConvert 514 + Store 510(u8v) 515 + 517: 161(ivec2) Load 482(i64v) + 518: 139(ivec2) SConvert 517 + 519: 220(ivec2) Bitcast 518 + Store 516(u16v) 519 + 520: 166(ivec2) Load 481(u64v) + 521: 220(ivec2) UConvert 520 + Store 516(u16v) 521 + 523: 161(ivec2) Load 482(i64v) + 524: 147(ivec2) SConvert 523 + 525: 155(ivec2) Bitcast 524 + Store 522(u32v) 525 + 526: 166(ivec2) Load 481(u64v) + 527: 155(ivec2) UConvert 526 + Store 522(u32v) 527 + 528: 161(ivec2) Load 482(i64v) + 529: 166(ivec2) Bitcast 528 + Store 481(u64v) 529 + 530: 166(ivec2) Load 481(u64v) + 531: 38(int) CompositeExtract 530 0 + 532: 38(int) CompositeExtract 530 1 + 533: 166(ivec2) CompositeConstruct 531 532 + Store 481(u64v) 533 + 535: 161(ivec2) Load 482(i64v) + 536: 180(fvec2) ConvertSToF 535 + Store 534(f16v) 536 + 538: 161(ivec2) Load 482(i64v) + 539: 186(fvec2) ConvertSToF 538 + Store 537(f32v) 539 + 540: 161(ivec2) Load 482(i64v) + 541: 192(fvec2) ConvertSToF 540 + Store 485(f64v) 541 + 542: 166(ivec2) Load 481(u64v) + 543: 180(fvec2) ConvertUToF 542 + Store 534(f16v) 543 + 544: 166(ivec2) Load 481(u64v) + 545: 186(fvec2) ConvertUToF 544 + Store 537(f32v) 545 + 546: 166(ivec2) Load 481(u64v) + 547: 192(fvec2) ConvertUToF 546 + Store 485(f64v) 547 + 549: 250(bvec2) Load 548(bv) + 554: 161(ivec2) Select 549 553 552 + Store 482(i64v) 554 + 555: 250(bvec2) Load 548(bv) + 560: 166(ivec2) Select 555 559 558 + Store 481(u64v) 560 + 561: 161(ivec2) Load 482(i64v) + 562: 250(bvec2) INotEqual 561 558 + Store 548(bv) 562 + 563: 166(ivec2) Load 481(u64v) + 564: 250(bvec2) INotEqual 563 558 + Store 548(bv) 564 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.extPostDepthCoverage.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.extPostDepthCoverage.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.extPostDepthCoverage.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.extPostDepthCoverage.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.extPostDepthCoverage.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 6 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.float16Fetch.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.float16Fetch.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.float16Fetch.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.float16Fetch.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,7070 @@ +spv.float16Fetch.frag +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 5923 + + Capability Shader + Capability Float16 + Capability StorageImageMultisample + Capability ImageCubeArray + Capability ImageRect + Capability SampledRect + Capability InputAttachment + Capability SparseResidency + Capability MinLod + Capability Sampled1D + Capability Image1D + Capability SampledCubeArray + Capability SampledBuffer + Capability ImageBuffer + Capability ImageMSArray + Capability ImageQuery + Capability StorageInputOutput16 + Capability Float16ImageAMD + Capability ImageGatherBiasLodAMD + Extension "SPV_AMD_gpu_shader_half_float" + Extension "SPV_AMD_gpu_shader_half_float_fetch" + Extension "SPV_AMD_texture_gather_bias_lod" + Extension "SPV_KHR_16bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 128 135 137 148 156 169 177 215 251 309 565 572 1393 1401 1409 1417 1425 1433 4257 4264 5913 5922 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_AMD_gpu_shader_half_float" + SourceExtension "GL_AMD_gpu_shader_half_float_fetch" + SourceExtension "GL_AMD_texture_gather_bias_lod" + SourceExtension "GL_ARB_sparse_texture2" + SourceExtension "GL_ARB_sparse_texture_clamp" + Name 4 "main" + Name 9 "testTexture(" + Name 11 "testTextureProj(" + Name 13 "testTextureLod(" + Name 15 "testTextureOffset(" + Name 17 "testTextureProjOffset(" + Name 19 "testTextureLodOffset(" + Name 21 "testTextureProjLodOffset(" + Name 23 "testTexelFetch(" + Name 25 "testTexelFetchOffset(" + Name 27 "testTextureGrad(" + Name 29 "testTextureGradOffset(" + Name 31 "testTextureProjGrad(" + Name 33 "testTextureProjGradoffset(" + Name 35 "testTextureGather(" + Name 37 "testTextureGatherOffset(" + Name 39 "testTextureGatherOffsets(" + Name 41 "testTextureGatherLod(" + Name 43 "testTextureGatherLodOffset(" + Name 45 "testTextureGatherLodOffsets(" + Name 50 "testTextureSize(" + Name 55 "testTextureQueryLod(" + Name 58 "testTextureQueryLevels(" + Name 60 "testTextureSamples(" + Name 62 "testImageLoad(" + Name 67 "testImageStore(vf164;" + Name 66 "data" + Name 69 "testSparseTexture(" + Name 71 "testSparseTextureLod(" + Name 73 "testSparseTextureOffset(" + Name 75 "testSparseTextureLodOffset(" + Name 77 "testSparseTextureGrad(" + Name 79 "testSparseTextureGradOffset(" + Name 81 "testSparseTexelFetch(" + Name 83 "testSparseTexelFetchOffset(" + Name 85 "testSparseTextureGather(" + Name 87 "testSparseTextureGatherOffset(" + Name 89 "testSparseTextureGatherOffsets(" + Name 91 "testSparseTextureGatherLod(" + Name 93 "testSparseTextureGatherLodOffset(" + Name 95 "testSparseTextureGatherLodOffsets(" + Name 97 "testSparseImageLoad(" + Name 99 "testSparseTextureClamp(" + Name 101 "testTextureClamp(" + Name 103 "testSparseTextureOffsetClamp(" + Name 105 "testTextureOffsetClamp(" + Name 107 "testSparseTextureGradClamp(" + Name 109 "testTextureGradClamp(" + Name 111 "testSparseTextureGradOffsetClamp(" + Name 113 "testTextureGradOffsetClamp(" + Name 115 "testCombinedTextureSampler(" + Name 117 "testSubpassLoad(" + Name 119 "texel" + Name 125 "s1D" + Name 128 "c1" + Name 135 "f16c1" + Name 137 "f16bias" + Name 145 "s2D" + Name 148 "c2" + Name 156 "f16c2" + Name 165 "s3D" + Name 169 "c3" + Name 177 "f16c3" + Name 186 "sCube" + Name 201 "s1DShadow" + Name 215 "compare" + Name 226 "s2DShadow" + Name 247 "sCubeShadow" + Name 251 "c4" + Name 271 "s1DArray" + Name 286 "s2DArray" + Name 301 "sCubeArray" + Name 309 "f16c4" + Name 318 "s1DArrayShadow" + Name 339 "s2DArrayShadow" + Name 359 "s2DRect" + Name 373 "s2DRectShadow" + Name 393 "sCubeArrayShadow" + Name 413 "texel" + Name 562 "texel" + Name 565 "lod" + Name 572 "f16lod" + Name 706 "texel" + Name 863 "texel" + Name 1012 "texel" + Name 1130 "texel" + Name 1244 "texel" + Name 1300 "sBuffer" + Name 1311 "s2DMS" + Name 1322 "s2DMSArray" + Name 1334 "texel" + Name 1390 "texel" + Name 1393 "dPdxy1" + Name 1401 "f16dPdxy1" + Name 1409 "dPdxy2" + Name 1417 "f16dPdxy2" + Name 1425 "dPdxy3" + Name 1433 "f16dPdxy3" + Name 1632 "texel" + Name 1820 "texel" + Name 2002 "texel" + Name 2184 "texel" + Name 2303 "texel" + Name 2375 "texel" + Name 2450 "texel" + Name 2502 "texel" + Name 2530 "texel" + Name 2559 "size" + Name 2733 "lod" + Name 2869 "levels" + Name 2938 "samples" + Name 2952 "texel" + Name 2955 "i1D" + Name 2964 "i2D" + Name 2973 "i3D" + Name 2982 "i2DRect" + Name 2991 "iCube" + Name 3000 "iBuffer" + Name 3009 "i1DArray" + Name 3018 "i2DArray" + Name 3027 "iCubeArray" + Name 3036 "i2DMS" + Name 3045 "i2DMSArray" + Name 3099 "texel" + Name 3102 "ResType" + Name 3138 "ResType" + Name 3242 "texel" + Name 3322 "texel" + Name 3412 "texel" + Name 3468 "texel" + Name 3628 "texel" + Name 3742 "texel" + Name 3794 "texel" + Name 3832 "texel" + Name 3950 "texel" + Name 4022 "texel" + Name 4094 "texel" + Name 4146 "texel" + Name 4174 "texel" + Name 4202 "texel" + Name 4254 "texel" + Name 4257 "lodClamp" + Name 4264 "f16lodClamp" + Name 4391 "texel" + Name 4598 "texel" + Name 4674 "texel" + Name 4818 "texel" + Name 4962 "texel" + Name 5188 "texel" + Name 5280 "texel" + Name 5452 "texel" + Name 5454 "t1D" + Name 5458 "s" + Name 5474 "t2D" + Name 5491 "t3D" + Name 5508 "tCube" + Name 5525 "sShadow" + Name 5589 "t1DArray" + Name 5606 "t2DArray" + Name 5623 "tCubeArray" + Name 5681 "t2DRect" + Name 5741 "subpass" + Name 5747 "subpassMS" + Name 5753 "result" + Name 5834 "param" + Name 5913 "fragColor" + Name 5917 "tBuffer" + Name 5919 "t2DMS" + Name 5921 "t2DMSArray" + Name 5922 "bias" + Decorate 125(s1D) DescriptorSet 0 + Decorate 125(s1D) Binding 0 + Decorate 128(c1) Location 0 + Decorate 135(f16c1) Location 11 + Decorate 137(f16bias) Location 16 + Decorate 145(s2D) DescriptorSet 0 + Decorate 145(s2D) Binding 1 + Decorate 148(c2) Location 1 + Decorate 156(f16c2) Location 12 + Decorate 165(s3D) DescriptorSet 0 + Decorate 165(s3D) Binding 2 + Decorate 169(c3) Location 2 + Decorate 177(f16c3) Location 13 + Decorate 186(sCube) DescriptorSet 0 + Decorate 186(sCube) Binding 4 + Decorate 201(s1DShadow) DescriptorSet 0 + Decorate 201(s1DShadow) Binding 11 + Decorate 215(compare) Location 4 + Decorate 226(s2DShadow) DescriptorSet 0 + Decorate 226(s2DShadow) Binding 12 + Decorate 247(sCubeShadow) DescriptorSet 0 + Decorate 247(sCubeShadow) Binding 14 + Decorate 251(c4) Location 3 + Decorate 271(s1DArray) DescriptorSet 0 + Decorate 271(s1DArray) Binding 7 + Decorate 286(s2DArray) DescriptorSet 0 + Decorate 286(s2DArray) Binding 8 + Decorate 301(sCubeArray) DescriptorSet 0 + Decorate 301(sCubeArray) Binding 9 + Decorate 309(f16c4) Location 14 + Decorate 318(s1DArrayShadow) DescriptorSet 0 + Decorate 318(s1DArrayShadow) Binding 15 + Decorate 339(s2DArrayShadow) DescriptorSet 0 + Decorate 339(s2DArrayShadow) Binding 16 + Decorate 359(s2DRect) DescriptorSet 0 + Decorate 359(s2DRect) Binding 3 + Decorate 373(s2DRectShadow) DescriptorSet 0 + Decorate 373(s2DRectShadow) Binding 13 + Decorate 393(sCubeArrayShadow) DescriptorSet 0 + Decorate 393(sCubeArrayShadow) Binding 17 + Decorate 565(lod) Location 5 + Decorate 572(f16lod) Location 15 + Decorate 1300(sBuffer) DescriptorSet 0 + Decorate 1300(sBuffer) Binding 5 + Decorate 1311(s2DMS) DescriptorSet 0 + Decorate 1311(s2DMS) Binding 6 + Decorate 1322(s2DMSArray) DescriptorSet 0 + Decorate 1322(s2DMSArray) Binding 10 + Decorate 1393(dPdxy1) Location 8 + Decorate 1401(f16dPdxy1) Location 18 + Decorate 1409(dPdxy2) Location 9 + Decorate 1417(f16dPdxy2) Location 19 + Decorate 1425(dPdxy3) Location 10 + Decorate 1433(f16dPdxy3) Location 20 + Decorate 2955(i1D) DescriptorSet 1 + Decorate 2955(i1D) Binding 0 + Decorate 2964(i2D) DescriptorSet 1 + Decorate 2964(i2D) Binding 1 + Decorate 2973(i3D) DescriptorSet 1 + Decorate 2973(i3D) Binding 2 + Decorate 2982(i2DRect) DescriptorSet 1 + Decorate 2982(i2DRect) Binding 3 + Decorate 2991(iCube) DescriptorSet 1 + Decorate 2991(iCube) Binding 4 + Decorate 3000(iBuffer) DescriptorSet 1 + Decorate 3000(iBuffer) Binding 8 + Decorate 3009(i1DArray) DescriptorSet 1 + Decorate 3009(i1DArray) Binding 5 + Decorate 3018(i2DArray) DescriptorSet 1 + Decorate 3018(i2DArray) Binding 6 + Decorate 3027(iCubeArray) DescriptorSet 1 + Decorate 3027(iCubeArray) Binding 7 + Decorate 3036(i2DMS) DescriptorSet 1 + Decorate 3036(i2DMS) Binding 9 + Decorate 3045(i2DMSArray) DescriptorSet 1 + Decorate 3045(i2DMSArray) Binding 10 + Decorate 4257(lodClamp) Location 7 + Decorate 4264(f16lodClamp) Location 17 + Decorate 5454(t1D) DescriptorSet 2 + Decorate 5454(t1D) Binding 0 + Decorate 5458(s) DescriptorSet 2 + Decorate 5458(s) Binding 11 + Decorate 5474(t2D) DescriptorSet 2 + Decorate 5474(t2D) Binding 1 + Decorate 5491(t3D) DescriptorSet 2 + Decorate 5491(t3D) Binding 2 + Decorate 5508(tCube) DescriptorSet 2 + Decorate 5508(tCube) Binding 4 + Decorate 5525(sShadow) DescriptorSet 2 + Decorate 5525(sShadow) Binding 12 + Decorate 5589(t1DArray) DescriptorSet 2 + Decorate 5589(t1DArray) Binding 5 + Decorate 5606(t2DArray) DescriptorSet 2 + Decorate 5606(t2DArray) Binding 6 + Decorate 5623(tCubeArray) DescriptorSet 2 + Decorate 5623(tCubeArray) Binding 7 + Decorate 5681(t2DRect) DescriptorSet 2 + Decorate 5681(t2DRect) Binding 3 + Decorate 5741(subpass) DescriptorSet 3 + Decorate 5741(subpass) Binding 0 + Decorate 5741(subpass) InputAttachmentIndex 0 + Decorate 5747(subpassMS) DescriptorSet 3 + Decorate 5747(subpassMS) Binding 1 + Decorate 5747(subpassMS) InputAttachmentIndex 0 + Decorate 5913(fragColor) Location 0 + Decorate 5917(tBuffer) DescriptorSet 2 + Decorate 5917(tBuffer) Binding 8 + Decorate 5919(t2DMS) DescriptorSet 2 + Decorate 5919(t2DMS) Binding 9 + Decorate 5921(t2DMSArray) DescriptorSet 2 + Decorate 5921(t2DMSArray) Binding 10 + Decorate 5922(bias) Location 6 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 16 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 47: TypeInt 32 1 + 48: TypeVector 47(int) 4 + 49: TypeFunction 48(ivec4) + 52: TypeFloat 32 + 53: TypeVector 52(float) 2 + 54: TypeFunction 53(fvec2) + 57: TypeFunction 47(int) + 64: TypePointer Function 7(fvec4) + 65: TypeFunction 2 64(ptr) + 120: 6(float) Constant 0 + 121: 7(fvec4) ConstantComposite 120 120 120 120 + 122: TypeImage 6(float) 1D sampled format:Unknown + 123: TypeSampledImage 122 + 124: TypePointer UniformConstant 123 + 125(s1D): 124(ptr) Variable UniformConstant + 127: TypePointer Input 52(float) + 128(c1): 127(ptr) Variable Input + 134: TypePointer Input 6(float) + 135(f16c1): 134(ptr) Variable Input + 137(f16bias): 134(ptr) Variable Input + 142: TypeImage 6(float) 2D sampled format:Unknown + 143: TypeSampledImage 142 + 144: TypePointer UniformConstant 143 + 145(s2D): 144(ptr) Variable UniformConstant + 147: TypePointer Input 53(fvec2) + 148(c2): 147(ptr) Variable Input + 154: TypeVector 6(float) 2 + 155: TypePointer Input 154(fvec2) + 156(f16c2): 155(ptr) Variable Input + 162: TypeImage 6(float) 3D sampled format:Unknown + 163: TypeSampledImage 162 + 164: TypePointer UniformConstant 163 + 165(s3D): 164(ptr) Variable UniformConstant + 167: TypeVector 52(float) 3 + 168: TypePointer Input 167(fvec3) + 169(c3): 168(ptr) Variable Input + 175: TypeVector 6(float) 3 + 176: TypePointer Input 175(fvec3) + 177(f16c3): 176(ptr) Variable Input + 183: TypeImage 6(float) Cube sampled format:Unknown + 184: TypeSampledImage 183 + 185: TypePointer UniformConstant 184 + 186(sCube): 185(ptr) Variable UniformConstant + 198: TypeImage 6(float) 1D depth sampled format:Unknown + 199: TypeSampledImage 198 + 200: TypePointer UniformConstant 199 + 201(s1DShadow): 200(ptr) Variable UniformConstant + 206: TypeInt 32 0 + 207: 206(int) Constant 0 + 208: TypePointer Function 6(float) + 215(compare): 127(ptr) Variable Input + 223: TypeImage 6(float) 2D depth sampled format:Unknown + 224: TypeSampledImage 223 + 225: TypePointer UniformConstant 224 + 226(s2DShadow): 225(ptr) Variable UniformConstant + 244: TypeImage 6(float) Cube depth sampled format:Unknown + 245: TypeSampledImage 244 + 246: TypePointer UniformConstant 245 +247(sCubeShadow): 246(ptr) Variable UniformConstant + 249: TypeVector 52(float) 4 + 250: TypePointer Input 249(fvec4) + 251(c4): 250(ptr) Variable Input + 268: TypeImage 6(float) 1D array sampled format:Unknown + 269: TypeSampledImage 268 + 270: TypePointer UniformConstant 269 + 271(s1DArray): 270(ptr) Variable UniformConstant + 283: TypeImage 6(float) 2D array sampled format:Unknown + 284: TypeSampledImage 283 + 285: TypePointer UniformConstant 284 + 286(s2DArray): 285(ptr) Variable UniformConstant + 298: TypeImage 6(float) Cube array sampled format:Unknown + 299: TypeSampledImage 298 + 300: TypePointer UniformConstant 299 + 301(sCubeArray): 300(ptr) Variable UniformConstant + 308: TypePointer Input 7(fvec4) + 309(f16c4): 308(ptr) Variable Input + 315: TypeImage 6(float) 1D depth array sampled format:Unknown + 316: TypeSampledImage 315 + 317: TypePointer UniformConstant 316 +318(s1DArrayShadow): 317(ptr) Variable UniformConstant + 336: TypeImage 6(float) 2D depth array sampled format:Unknown + 337: TypeSampledImage 336 + 338: TypePointer UniformConstant 337 +339(s2DArrayShadow): 338(ptr) Variable UniformConstant + 356: TypeImage 6(float) Rect sampled format:Unknown + 357: TypeSampledImage 356 + 358: TypePointer UniformConstant 357 + 359(s2DRect): 358(ptr) Variable UniformConstant + 370: TypeImage 6(float) Rect depth sampled format:Unknown + 371: TypeSampledImage 370 + 372: TypePointer UniformConstant 371 +373(s2DRectShadow): 372(ptr) Variable UniformConstant + 390: TypeImage 6(float) Cube depth array sampled format:Unknown + 391: TypeSampledImage 390 + 392: TypePointer UniformConstant 391 +393(sCubeArrayShadow): 392(ptr) Variable UniformConstant + 565(lod): 127(ptr) Variable Input + 572(f16lod): 134(ptr) Variable Input + 709: 47(int) Constant 1 + 721: TypeVector 47(int) 2 + 722: 721(ivec2) ConstantComposite 709 709 + 734: TypeVector 47(int) 3 + 735: 734(ivec3) ConstantComposite 709 709 709 + 1297: TypeImage 6(float) Buffer sampled format:Unknown + 1298: TypeSampledImage 1297 + 1299: TypePointer UniformConstant 1298 + 1300(sBuffer): 1299(ptr) Variable UniformConstant + 1308: TypeImage 6(float) 2D multi-sampled sampled format:Unknown + 1309: TypeSampledImage 1308 + 1310: TypePointer UniformConstant 1309 + 1311(s2DMS): 1310(ptr) Variable UniformConstant + 1319: TypeImage 6(float) 2D array multi-sampled sampled format:Unknown + 1320: TypeSampledImage 1319 + 1321: TypePointer UniformConstant 1320 +1322(s2DMSArray): 1321(ptr) Variable UniformConstant + 1326: 47(int) Constant 2 + 1393(dPdxy1): 127(ptr) Variable Input + 1401(f16dPdxy1): 134(ptr) Variable Input + 1409(dPdxy2): 147(ptr) Variable Input + 1417(f16dPdxy2): 155(ptr) Variable Input + 1425(dPdxy3): 168(ptr) Variable Input + 1433(f16dPdxy3): 176(ptr) Variable Input + 2187: 47(int) Constant 0 + 2378: 206(int) Constant 4 + 2379: TypeArray 721(ivec2) 2378 + 2380: 2379 ConstantComposite 722 722 722 722 + 2558: TypePointer Function 48(ivec4) + 2560: 48(ivec4) ConstantComposite 2187 2187 2187 2187 + 2566: TypePointer Function 47(int) + 2732: TypePointer Function 53(fvec2) + 2734: 52(float) Constant 0 + 2735: 53(fvec2) ConstantComposite 2734 2734 + 2953: TypeImage 6(float) 1D nonsampled format:Rgba16f + 2954: TypePointer UniformConstant 2953 + 2955(i1D): 2954(ptr) Variable UniformConstant + 2962: TypeImage 6(float) 2D nonsampled format:Rgba16f + 2963: TypePointer UniformConstant 2962 + 2964(i2D): 2963(ptr) Variable UniformConstant + 2971: TypeImage 6(float) 3D nonsampled format:Rgba16f + 2972: TypePointer UniformConstant 2971 + 2973(i3D): 2972(ptr) Variable UniformConstant + 2980: TypeImage 6(float) Rect nonsampled format:Rgba16f + 2981: TypePointer UniformConstant 2980 + 2982(i2DRect): 2981(ptr) Variable UniformConstant + 2989: TypeImage 6(float) Cube nonsampled format:Rgba16f + 2990: TypePointer UniformConstant 2989 + 2991(iCube): 2990(ptr) Variable UniformConstant + 2998: TypeImage 6(float) Buffer nonsampled format:Rgba16f + 2999: TypePointer UniformConstant 2998 + 3000(iBuffer): 2999(ptr) Variable UniformConstant + 3007: TypeImage 6(float) 1D array nonsampled format:Rgba16f + 3008: TypePointer UniformConstant 3007 + 3009(i1DArray): 3008(ptr) Variable UniformConstant + 3016: TypeImage 6(float) 2D array nonsampled format:Rgba16f + 3017: TypePointer UniformConstant 3016 + 3018(i2DArray): 3017(ptr) Variable UniformConstant + 3025: TypeImage 6(float) Cube array nonsampled format:Rgba16f + 3026: TypePointer UniformConstant 3025 +3027(iCubeArray): 3026(ptr) Variable UniformConstant + 3034: TypeImage 6(float) 2D multi-sampled nonsampled format:Rgba16f + 3035: TypePointer UniformConstant 3034 + 3036(i2DMS): 3035(ptr) Variable UniformConstant + 3043: TypeImage 6(float) 2D array multi-sampled nonsampled format:Rgba16f + 3044: TypePointer UniformConstant 3043 +3045(i2DMSArray): 3044(ptr) Variable UniformConstant + 3102(ResType): TypeStruct 47(int) 7(fvec4) + 3138(ResType): TypeStruct 47(int) 6(float) + 4257(lodClamp): 127(ptr) Variable Input +4264(f16lodClamp): 134(ptr) Variable Input + 5453: TypePointer UniformConstant 122 + 5454(t1D): 5453(ptr) Variable UniformConstant + 5456: TypeSampler + 5457: TypePointer UniformConstant 5456 + 5458(s): 5457(ptr) Variable UniformConstant + 5473: TypePointer UniformConstant 142 + 5474(t2D): 5473(ptr) Variable UniformConstant + 5490: TypePointer UniformConstant 162 + 5491(t3D): 5490(ptr) Variable UniformConstant + 5507: TypePointer UniformConstant 183 + 5508(tCube): 5507(ptr) Variable UniformConstant + 5525(sShadow): 5457(ptr) Variable UniformConstant + 5588: TypePointer UniformConstant 268 + 5589(t1DArray): 5588(ptr) Variable UniformConstant + 5605: TypePointer UniformConstant 283 + 5606(t2DArray): 5605(ptr) Variable UniformConstant + 5622: TypePointer UniformConstant 298 +5623(tCubeArray): 5622(ptr) Variable UniformConstant + 5680: TypePointer UniformConstant 356 + 5681(t2DRect): 5680(ptr) Variable UniformConstant + 5739: TypeImage 6(float) SubpassData nonsampled format:Unknown + 5740: TypePointer UniformConstant 5739 + 5741(subpass): 5740(ptr) Variable UniformConstant + 5743: 721(ivec2) ConstantComposite 2187 2187 + 5745: TypeImage 6(float) SubpassData multi-sampled nonsampled format:Unknown + 5746: TypePointer UniformConstant 5745 + 5747(subpassMS): 5746(ptr) Variable UniformConstant + 5912: TypePointer Output 249(fvec4) + 5913(fragColor): 5912(ptr) Variable Output + 5916: TypePointer UniformConstant 1297 + 5917(tBuffer): 5916(ptr) Variable UniformConstant + 5918: TypePointer UniformConstant 1308 + 5919(t2DMS): 5918(ptr) Variable UniformConstant + 5920: TypePointer UniformConstant 1319 +5921(t2DMSArray): 5920(ptr) Variable UniformConstant + 5922(bias): 127(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 5753(result): 64(ptr) Variable Function + 5834(param): 64(ptr) Variable Function + Store 5753(result) 121 + 5754: 7(fvec4) FunctionCall 9(testTexture() + 5755: 7(fvec4) Load 5753(result) + 5756: 7(fvec4) FAdd 5755 5754 + Store 5753(result) 5756 + 5757: 7(fvec4) FunctionCall 11(testTextureProj() + 5758: 7(fvec4) Load 5753(result) + 5759: 7(fvec4) FAdd 5758 5757 + Store 5753(result) 5759 + 5760: 7(fvec4) FunctionCall 13(testTextureLod() + 5761: 7(fvec4) Load 5753(result) + 5762: 7(fvec4) FAdd 5761 5760 + Store 5753(result) 5762 + 5763: 7(fvec4) FunctionCall 15(testTextureOffset() + 5764: 7(fvec4) Load 5753(result) + 5765: 7(fvec4) FAdd 5764 5763 + Store 5753(result) 5765 + 5766: 7(fvec4) FunctionCall 19(testTextureLodOffset() + 5767: 7(fvec4) Load 5753(result) + 5768: 7(fvec4) FAdd 5767 5766 + Store 5753(result) 5768 + 5769: 7(fvec4) FunctionCall 21(testTextureProjLodOffset() + 5770: 7(fvec4) Load 5753(result) + 5771: 7(fvec4) FAdd 5770 5769 + Store 5753(result) 5771 + 5772: 7(fvec4) FunctionCall 23(testTexelFetch() + 5773: 7(fvec4) Load 5753(result) + 5774: 7(fvec4) FAdd 5773 5772 + Store 5753(result) 5774 + 5775: 7(fvec4) FunctionCall 25(testTexelFetchOffset() + 5776: 7(fvec4) Load 5753(result) + 5777: 7(fvec4) FAdd 5776 5775 + Store 5753(result) 5777 + 5778: 7(fvec4) FunctionCall 27(testTextureGrad() + 5779: 7(fvec4) Load 5753(result) + 5780: 7(fvec4) FAdd 5779 5778 + Store 5753(result) 5780 + 5781: 7(fvec4) FunctionCall 29(testTextureGradOffset() + 5782: 7(fvec4) Load 5753(result) + 5783: 7(fvec4) FAdd 5782 5781 + Store 5753(result) 5783 + 5784: 7(fvec4) FunctionCall 31(testTextureProjGrad() + 5785: 7(fvec4) Load 5753(result) + 5786: 7(fvec4) FAdd 5785 5784 + Store 5753(result) 5786 + 5787: 7(fvec4) FunctionCall 33(testTextureProjGradoffset() + 5788: 7(fvec4) Load 5753(result) + 5789: 7(fvec4) FAdd 5788 5787 + Store 5753(result) 5789 + 5790: 7(fvec4) FunctionCall 35(testTextureGather() + 5791: 7(fvec4) Load 5753(result) + 5792: 7(fvec4) FAdd 5791 5790 + Store 5753(result) 5792 + 5793: 7(fvec4) FunctionCall 37(testTextureGatherOffset() + 5794: 7(fvec4) Load 5753(result) + 5795: 7(fvec4) FAdd 5794 5793 + Store 5753(result) 5795 + 5796: 7(fvec4) FunctionCall 39(testTextureGatherOffsets() + 5797: 7(fvec4) Load 5753(result) + 5798: 7(fvec4) FAdd 5797 5796 + Store 5753(result) 5798 + 5799: 7(fvec4) FunctionCall 41(testTextureGatherLod() + 5800: 7(fvec4) Load 5753(result) + 5801: 7(fvec4) FAdd 5800 5799 + Store 5753(result) 5801 + 5802: 7(fvec4) FunctionCall 43(testTextureGatherLodOffset() + 5803: 7(fvec4) Load 5753(result) + 5804: 7(fvec4) FAdd 5803 5802 + Store 5753(result) 5804 + 5805: 7(fvec4) FunctionCall 45(testTextureGatherLodOffsets() + 5806: 7(fvec4) Load 5753(result) + 5807: 7(fvec4) FAdd 5806 5805 + Store 5753(result) 5807 + 5808: 48(ivec4) FunctionCall 50(testTextureSize() + 5809: 7(fvec4) ConvertSToF 5808 + 5810: 7(fvec4) Load 5753(result) + 5811: 7(fvec4) FAdd 5810 5809 + Store 5753(result) 5811 + 5812: 53(fvec2) FunctionCall 55(testTextureQueryLod() + 5813: 154(fvec2) FConvert 5812 + 5814: 7(fvec4) Load 5753(result) + 5815: 154(fvec2) VectorShuffle 5814 5814 0 1 + 5816: 154(fvec2) FAdd 5815 5813 + 5817: 7(fvec4) Load 5753(result) + 5818: 7(fvec4) VectorShuffle 5817 5816 4 5 2 3 + Store 5753(result) 5818 + 5819: 47(int) FunctionCall 58(testTextureQueryLevels() + 5820: 6(float) ConvertSToF 5819 + 5821: 208(ptr) AccessChain 5753(result) 207 + 5822: 6(float) Load 5821 + 5823: 6(float) FAdd 5822 5820 + 5824: 208(ptr) AccessChain 5753(result) 207 + Store 5824 5823 + 5825: 47(int) FunctionCall 60(testTextureSamples() + 5826: 6(float) ConvertSToF 5825 + 5827: 208(ptr) AccessChain 5753(result) 207 + 5828: 6(float) Load 5827 + 5829: 6(float) FAdd 5828 5826 + 5830: 208(ptr) AccessChain 5753(result) 207 + Store 5830 5829 + 5831: 7(fvec4) FunctionCall 62(testImageLoad() + 5832: 7(fvec4) Load 5753(result) + 5833: 7(fvec4) FAdd 5832 5831 + Store 5753(result) 5833 + 5835: 7(fvec4) Load 5753(result) + Store 5834(param) 5835 + 5836: 2 FunctionCall 67(testImageStore(vf164;) 5834(param) + 5837: 7(fvec4) FunctionCall 69(testSparseTexture() + 5838: 7(fvec4) Load 5753(result) + 5839: 7(fvec4) FAdd 5838 5837 + Store 5753(result) 5839 + 5840: 7(fvec4) FunctionCall 71(testSparseTextureLod() + 5841: 7(fvec4) Load 5753(result) + 5842: 7(fvec4) FAdd 5841 5840 + Store 5753(result) 5842 + 5843: 7(fvec4) FunctionCall 73(testSparseTextureOffset() + 5844: 7(fvec4) Load 5753(result) + 5845: 7(fvec4) FAdd 5844 5843 + Store 5753(result) 5845 + 5846: 7(fvec4) FunctionCall 75(testSparseTextureLodOffset() + 5847: 7(fvec4) Load 5753(result) + 5848: 7(fvec4) FAdd 5847 5846 + Store 5753(result) 5848 + 5849: 7(fvec4) FunctionCall 77(testSparseTextureGrad() + 5850: 7(fvec4) Load 5753(result) + 5851: 7(fvec4) FAdd 5850 5849 + Store 5753(result) 5851 + 5852: 7(fvec4) FunctionCall 79(testSparseTextureGradOffset() + 5853: 7(fvec4) Load 5753(result) + 5854: 7(fvec4) FAdd 5853 5852 + Store 5753(result) 5854 + 5855: 7(fvec4) FunctionCall 81(testSparseTexelFetch() + 5856: 7(fvec4) Load 5753(result) + 5857: 7(fvec4) FAdd 5856 5855 + Store 5753(result) 5857 + 5858: 7(fvec4) FunctionCall 83(testSparseTexelFetchOffset() + 5859: 7(fvec4) Load 5753(result) + 5860: 7(fvec4) FAdd 5859 5858 + Store 5753(result) 5860 + 5861: 7(fvec4) FunctionCall 85(testSparseTextureGather() + 5862: 7(fvec4) Load 5753(result) + 5863: 7(fvec4) FAdd 5862 5861 + Store 5753(result) 5863 + 5864: 7(fvec4) FunctionCall 87(testSparseTextureGatherOffset() + 5865: 7(fvec4) Load 5753(result) + 5866: 7(fvec4) FAdd 5865 5864 + Store 5753(result) 5866 + 5867: 7(fvec4) FunctionCall 89(testSparseTextureGatherOffsets() + 5868: 7(fvec4) Load 5753(result) + 5869: 7(fvec4) FAdd 5868 5867 + Store 5753(result) 5869 + 5870: 7(fvec4) FunctionCall 91(testSparseTextureGatherLod() + 5871: 7(fvec4) Load 5753(result) + 5872: 7(fvec4) FAdd 5871 5870 + Store 5753(result) 5872 + 5873: 7(fvec4) FunctionCall 93(testSparseTextureGatherLodOffset() + 5874: 7(fvec4) Load 5753(result) + 5875: 7(fvec4) FAdd 5874 5873 + Store 5753(result) 5875 + 5876: 7(fvec4) FunctionCall 95(testSparseTextureGatherLodOffsets() + 5877: 7(fvec4) Load 5753(result) + 5878: 7(fvec4) FAdd 5877 5876 + Store 5753(result) 5878 + 5879: 7(fvec4) FunctionCall 97(testSparseImageLoad() + 5880: 7(fvec4) Load 5753(result) + 5881: 7(fvec4) FAdd 5880 5879 + Store 5753(result) 5881 + 5882: 7(fvec4) FunctionCall 99(testSparseTextureClamp() + 5883: 7(fvec4) Load 5753(result) + 5884: 7(fvec4) FAdd 5883 5882 + Store 5753(result) 5884 + 5885: 7(fvec4) FunctionCall 101(testTextureClamp() + 5886: 7(fvec4) Load 5753(result) + 5887: 7(fvec4) FAdd 5886 5885 + Store 5753(result) 5887 + 5888: 7(fvec4) FunctionCall 103(testSparseTextureOffsetClamp() + 5889: 7(fvec4) Load 5753(result) + 5890: 7(fvec4) FAdd 5889 5888 + Store 5753(result) 5890 + 5891: 7(fvec4) FunctionCall 105(testTextureOffsetClamp() + 5892: 7(fvec4) Load 5753(result) + 5893: 7(fvec4) FAdd 5892 5891 + Store 5753(result) 5893 + 5894: 7(fvec4) FunctionCall 77(testSparseTextureGrad() + 5895: 7(fvec4) Load 5753(result) + 5896: 7(fvec4) FAdd 5895 5894 + Store 5753(result) 5896 + 5897: 7(fvec4) FunctionCall 27(testTextureGrad() + 5898: 7(fvec4) Load 5753(result) + 5899: 7(fvec4) FAdd 5898 5897 + Store 5753(result) 5899 + 5900: 7(fvec4) FunctionCall 111(testSparseTextureGradOffsetClamp() + 5901: 7(fvec4) Load 5753(result) + 5902: 7(fvec4) FAdd 5901 5900 + Store 5753(result) 5902 + 5903: 7(fvec4) FunctionCall 113(testTextureGradOffsetClamp() + 5904: 7(fvec4) Load 5753(result) + 5905: 7(fvec4) FAdd 5904 5903 + Store 5753(result) 5905 + 5906: 7(fvec4) FunctionCall 115(testCombinedTextureSampler() + 5907: 7(fvec4) Load 5753(result) + 5908: 7(fvec4) FAdd 5907 5906 + Store 5753(result) 5908 + 5909: 7(fvec4) FunctionCall 117(testSubpassLoad() + 5910: 7(fvec4) Load 5753(result) + 5911: 7(fvec4) FAdd 5910 5909 + Store 5753(result) 5911 + 5914: 7(fvec4) Load 5753(result) + 5915: 249(fvec4) FConvert 5914 + Store 5913(fragColor) 5915 + Return + FunctionEnd + 9(testTexture(): 7(fvec4) Function None 8 + 10: Label + 119(texel): 64(ptr) Variable Function + Store 119(texel) 121 + 126: 123 Load 125(s1D) + 129: 52(float) Load 128(c1) + 130: 7(fvec4) ImageSampleImplicitLod 126 129 + 131: 7(fvec4) Load 119(texel) + 132: 7(fvec4) FAdd 131 130 + Store 119(texel) 132 + 133: 123 Load 125(s1D) + 136: 6(float) Load 135(f16c1) + 138: 6(float) Load 137(f16bias) + 139: 7(fvec4) ImageSampleImplicitLod 133 136 Bias 138 + 140: 7(fvec4) Load 119(texel) + 141: 7(fvec4) FAdd 140 139 + Store 119(texel) 141 + 146: 143 Load 145(s2D) + 149: 53(fvec2) Load 148(c2) + 150: 7(fvec4) ImageSampleImplicitLod 146 149 + 151: 7(fvec4) Load 119(texel) + 152: 7(fvec4) FAdd 151 150 + Store 119(texel) 152 + 153: 143 Load 145(s2D) + 157: 154(fvec2) Load 156(f16c2) + 158: 6(float) Load 137(f16bias) + 159: 7(fvec4) ImageSampleImplicitLod 153 157 Bias 158 + 160: 7(fvec4) Load 119(texel) + 161: 7(fvec4) FAdd 160 159 + Store 119(texel) 161 + 166: 163 Load 165(s3D) + 170: 167(fvec3) Load 169(c3) + 171: 7(fvec4) ImageSampleImplicitLod 166 170 + 172: 7(fvec4) Load 119(texel) + 173: 7(fvec4) FAdd 172 171 + Store 119(texel) 173 + 174: 163 Load 165(s3D) + 178: 175(fvec3) Load 177(f16c3) + 179: 6(float) Load 137(f16bias) + 180: 7(fvec4) ImageSampleImplicitLod 174 178 Bias 179 + 181: 7(fvec4) Load 119(texel) + 182: 7(fvec4) FAdd 181 180 + Store 119(texel) 182 + 187: 184 Load 186(sCube) + 188: 167(fvec3) Load 169(c3) + 189: 7(fvec4) ImageSampleImplicitLod 187 188 + 190: 7(fvec4) Load 119(texel) + 191: 7(fvec4) FAdd 190 189 + Store 119(texel) 191 + 192: 184 Load 186(sCube) + 193: 175(fvec3) Load 177(f16c3) + 194: 6(float) Load 137(f16bias) + 195: 7(fvec4) ImageSampleImplicitLod 192 193 Bias 194 + 196: 7(fvec4) Load 119(texel) + 197: 7(fvec4) FAdd 196 195 + Store 119(texel) 197 + 202: 199 Load 201(s1DShadow) + 203: 167(fvec3) Load 169(c3) + 204: 52(float) CompositeExtract 203 2 + 205: 6(float) ImageSampleDrefImplicitLod 202 203 204 + 209: 208(ptr) AccessChain 119(texel) 207 + 210: 6(float) Load 209 + 211: 6(float) FAdd 210 205 + 212: 208(ptr) AccessChain 119(texel) 207 + Store 212 211 + 213: 199 Load 201(s1DShadow) + 214: 154(fvec2) Load 156(f16c2) + 216: 52(float) Load 215(compare) + 217: 6(float) Load 137(f16bias) + 218: 6(float) ImageSampleDrefImplicitLod 213 214 216 Bias 217 + 219: 208(ptr) AccessChain 119(texel) 207 + 220: 6(float) Load 219 + 221: 6(float) FAdd 220 218 + 222: 208(ptr) AccessChain 119(texel) 207 + Store 222 221 + 227: 224 Load 226(s2DShadow) + 228: 167(fvec3) Load 169(c3) + 229: 52(float) CompositeExtract 228 2 + 230: 6(float) ImageSampleDrefImplicitLod 227 228 229 + 231: 208(ptr) AccessChain 119(texel) 207 + 232: 6(float) Load 231 + 233: 6(float) FAdd 232 230 + 234: 208(ptr) AccessChain 119(texel) 207 + Store 234 233 + 235: 224 Load 226(s2DShadow) + 236: 154(fvec2) Load 156(f16c2) + 237: 52(float) Load 215(compare) + 238: 6(float) Load 137(f16bias) + 239: 6(float) ImageSampleDrefImplicitLod 235 236 237 Bias 238 + 240: 208(ptr) AccessChain 119(texel) 207 + 241: 6(float) Load 240 + 242: 6(float) FAdd 241 239 + 243: 208(ptr) AccessChain 119(texel) 207 + Store 243 242 + 248: 245 Load 247(sCubeShadow) + 252: 249(fvec4) Load 251(c4) + 253: 52(float) CompositeExtract 252 3 + 254: 6(float) ImageSampleDrefImplicitLod 248 252 253 + 255: 208(ptr) AccessChain 119(texel) 207 + 256: 6(float) Load 255 + 257: 6(float) FAdd 256 254 + 258: 208(ptr) AccessChain 119(texel) 207 + Store 258 257 + 259: 245 Load 247(sCubeShadow) + 260: 175(fvec3) Load 177(f16c3) + 261: 52(float) Load 215(compare) + 262: 6(float) Load 137(f16bias) + 263: 6(float) ImageSampleDrefImplicitLod 259 260 261 Bias 262 + 264: 208(ptr) AccessChain 119(texel) 207 + 265: 6(float) Load 264 + 266: 6(float) FAdd 265 263 + 267: 208(ptr) AccessChain 119(texel) 207 + Store 267 266 + 272: 269 Load 271(s1DArray) + 273: 53(fvec2) Load 148(c2) + 274: 7(fvec4) ImageSampleImplicitLod 272 273 + 275: 7(fvec4) Load 119(texel) + 276: 7(fvec4) FAdd 275 274 + Store 119(texel) 276 + 277: 269 Load 271(s1DArray) + 278: 154(fvec2) Load 156(f16c2) + 279: 6(float) Load 137(f16bias) + 280: 7(fvec4) ImageSampleImplicitLod 277 278 Bias 279 + 281: 7(fvec4) Load 119(texel) + 282: 7(fvec4) FAdd 281 280 + Store 119(texel) 282 + 287: 284 Load 286(s2DArray) + 288: 167(fvec3) Load 169(c3) + 289: 7(fvec4) ImageSampleImplicitLod 287 288 + 290: 7(fvec4) Load 119(texel) + 291: 7(fvec4) FAdd 290 289 + Store 119(texel) 291 + 292: 284 Load 286(s2DArray) + 293: 175(fvec3) Load 177(f16c3) + 294: 6(float) Load 137(f16bias) + 295: 7(fvec4) ImageSampleImplicitLod 292 293 Bias 294 + 296: 7(fvec4) Load 119(texel) + 297: 7(fvec4) FAdd 296 295 + Store 119(texel) 297 + 302: 299 Load 301(sCubeArray) + 303: 249(fvec4) Load 251(c4) + 304: 7(fvec4) ImageSampleImplicitLod 302 303 + 305: 7(fvec4) Load 119(texel) + 306: 7(fvec4) FAdd 305 304 + Store 119(texel) 306 + 307: 299 Load 301(sCubeArray) + 310: 7(fvec4) Load 309(f16c4) + 311: 6(float) Load 137(f16bias) + 312: 7(fvec4) ImageSampleImplicitLod 307 310 Bias 311 + 313: 7(fvec4) Load 119(texel) + 314: 7(fvec4) FAdd 313 312 + Store 119(texel) 314 + 319: 316 Load 318(s1DArrayShadow) + 320: 167(fvec3) Load 169(c3) + 321: 52(float) CompositeExtract 320 2 + 322: 6(float) ImageSampleDrefImplicitLod 319 320 321 + 323: 208(ptr) AccessChain 119(texel) 207 + 324: 6(float) Load 323 + 325: 6(float) FAdd 324 322 + 326: 208(ptr) AccessChain 119(texel) 207 + Store 326 325 + 327: 316 Load 318(s1DArrayShadow) + 328: 154(fvec2) Load 156(f16c2) + 329: 52(float) Load 215(compare) + 330: 6(float) Load 137(f16bias) + 331: 6(float) ImageSampleDrefImplicitLod 327 328 329 Bias 330 + 332: 208(ptr) AccessChain 119(texel) 207 + 333: 6(float) Load 332 + 334: 6(float) FAdd 333 331 + 335: 208(ptr) AccessChain 119(texel) 207 + Store 335 334 + 340: 337 Load 339(s2DArrayShadow) + 341: 249(fvec4) Load 251(c4) + 342: 52(float) CompositeExtract 341 3 + 343: 6(float) ImageSampleDrefImplicitLod 340 341 342 + 344: 208(ptr) AccessChain 119(texel) 207 + 345: 6(float) Load 344 + 346: 6(float) FAdd 345 343 + 347: 208(ptr) AccessChain 119(texel) 207 + Store 347 346 + 348: 337 Load 339(s2DArrayShadow) + 349: 175(fvec3) Load 177(f16c3) + 350: 52(float) Load 215(compare) + 351: 6(float) ImageSampleDrefImplicitLod 348 349 350 + 352: 208(ptr) AccessChain 119(texel) 207 + 353: 6(float) Load 352 + 354: 6(float) FAdd 353 351 + 355: 208(ptr) AccessChain 119(texel) 207 + Store 355 354 + 360: 357 Load 359(s2DRect) + 361: 53(fvec2) Load 148(c2) + 362: 7(fvec4) ImageSampleImplicitLod 360 361 + 363: 7(fvec4) Load 119(texel) + 364: 7(fvec4) FAdd 363 362 + Store 119(texel) 364 + 365: 357 Load 359(s2DRect) + 366: 154(fvec2) Load 156(f16c2) + 367: 7(fvec4) ImageSampleImplicitLod 365 366 + 368: 7(fvec4) Load 119(texel) + 369: 7(fvec4) FAdd 368 367 + Store 119(texel) 369 + 374: 371 Load 373(s2DRectShadow) + 375: 167(fvec3) Load 169(c3) + 376: 52(float) CompositeExtract 375 2 + 377: 6(float) ImageSampleDrefImplicitLod 374 375 376 + 378: 208(ptr) AccessChain 119(texel) 207 + 379: 6(float) Load 378 + 380: 6(float) FAdd 379 377 + 381: 208(ptr) AccessChain 119(texel) 207 + Store 381 380 + 382: 371 Load 373(s2DRectShadow) + 383: 154(fvec2) Load 156(f16c2) + 384: 52(float) Load 215(compare) + 385: 6(float) ImageSampleDrefImplicitLod 382 383 384 + 386: 208(ptr) AccessChain 119(texel) 207 + 387: 6(float) Load 386 + 388: 6(float) FAdd 387 385 + 389: 208(ptr) AccessChain 119(texel) 207 + Store 389 388 + 394: 391 Load 393(sCubeArrayShadow) + 395: 249(fvec4) Load 251(c4) + 396: 52(float) Load 215(compare) + 397: 6(float) ImageSampleDrefImplicitLod 394 395 396 + 398: 208(ptr) AccessChain 119(texel) 207 + 399: 6(float) Load 398 + 400: 6(float) FAdd 399 397 + 401: 208(ptr) AccessChain 119(texel) 207 + Store 401 400 + 402: 391 Load 393(sCubeArrayShadow) + 403: 7(fvec4) Load 309(f16c4) + 404: 52(float) Load 215(compare) + 405: 6(float) ImageSampleDrefImplicitLod 402 403 404 + 406: 208(ptr) AccessChain 119(texel) 207 + 407: 6(float) Load 406 + 408: 6(float) FAdd 407 405 + 409: 208(ptr) AccessChain 119(texel) 207 + Store 409 408 + 410: 7(fvec4) Load 119(texel) + ReturnValue 410 + FunctionEnd +11(testTextureProj(): 7(fvec4) Function None 8 + 12: Label + 413(texel): 64(ptr) Variable Function + Store 413(texel) 121 + 414: 123 Load 125(s1D) + 415: 53(fvec2) Load 148(c2) + 416: 7(fvec4) ImageSampleProjImplicitLod 414 415 + 417: 7(fvec4) Load 413(texel) + 418: 7(fvec4) FAdd 417 416 + Store 413(texel) 418 + 419: 123 Load 125(s1D) + 420: 154(fvec2) Load 156(f16c2) + 421: 6(float) Load 137(f16bias) + 422: 7(fvec4) ImageSampleProjImplicitLod 419 420 Bias 421 + 423: 7(fvec4) Load 413(texel) + 424: 7(fvec4) FAdd 423 422 + Store 413(texel) 424 + 425: 123 Load 125(s1D) + 426: 249(fvec4) Load 251(c4) + 427: 52(float) CompositeExtract 426 3 + 428: 249(fvec4) CompositeInsert 427 426 1 + 429: 7(fvec4) ImageSampleProjImplicitLod 425 428 + 430: 7(fvec4) Load 413(texel) + 431: 7(fvec4) FAdd 430 429 + Store 413(texel) 431 + 432: 123 Load 125(s1D) + 433: 7(fvec4) Load 309(f16c4) + 434: 6(float) Load 137(f16bias) + 435: 6(float) CompositeExtract 433 3 + 436: 7(fvec4) CompositeInsert 435 433 1 + 437: 7(fvec4) ImageSampleProjImplicitLod 432 436 Bias 434 + 438: 7(fvec4) Load 413(texel) + 439: 7(fvec4) FAdd 438 437 + Store 413(texel) 439 + 440: 143 Load 145(s2D) + 441: 167(fvec3) Load 169(c3) + 442: 7(fvec4) ImageSampleProjImplicitLod 440 441 + 443: 7(fvec4) Load 413(texel) + 444: 7(fvec4) FAdd 443 442 + Store 413(texel) 444 + 445: 143 Load 145(s2D) + 446: 175(fvec3) Load 177(f16c3) + 447: 6(float) Load 137(f16bias) + 448: 7(fvec4) ImageSampleProjImplicitLod 445 446 Bias 447 + 449: 7(fvec4) Load 413(texel) + 450: 7(fvec4) FAdd 449 448 + Store 413(texel) 450 + 451: 143 Load 145(s2D) + 452: 249(fvec4) Load 251(c4) + 453: 52(float) CompositeExtract 452 3 + 454: 249(fvec4) CompositeInsert 453 452 2 + 455: 7(fvec4) ImageSampleProjImplicitLod 451 454 + 456: 7(fvec4) Load 413(texel) + 457: 7(fvec4) FAdd 456 455 + Store 413(texel) 457 + 458: 143 Load 145(s2D) + 459: 7(fvec4) Load 309(f16c4) + 460: 6(float) Load 137(f16bias) + 461: 6(float) CompositeExtract 459 3 + 462: 7(fvec4) CompositeInsert 461 459 2 + 463: 7(fvec4) ImageSampleProjImplicitLod 458 462 Bias 460 + 464: 7(fvec4) Load 413(texel) + 465: 7(fvec4) FAdd 464 463 + Store 413(texel) 465 + 466: 163 Load 165(s3D) + 467: 249(fvec4) Load 251(c4) + 468: 7(fvec4) ImageSampleProjImplicitLod 466 467 + 469: 7(fvec4) Load 413(texel) + 470: 7(fvec4) FAdd 469 468 + Store 413(texel) 470 + 471: 163 Load 165(s3D) + 472: 7(fvec4) Load 309(f16c4) + 473: 6(float) Load 137(f16bias) + 474: 7(fvec4) ImageSampleProjImplicitLod 471 472 Bias 473 + 475: 7(fvec4) Load 413(texel) + 476: 7(fvec4) FAdd 475 474 + Store 413(texel) 476 + 477: 199 Load 201(s1DShadow) + 478: 249(fvec4) Load 251(c4) + 479: 52(float) CompositeExtract 478 2 + 480: 52(float) CompositeExtract 478 3 + 481: 249(fvec4) CompositeInsert 480 478 1 + 482: 6(float) ImageSampleProjDrefImplicitLod 477 481 479 + 483: 208(ptr) AccessChain 413(texel) 207 + 484: 6(float) Load 483 + 485: 6(float) FAdd 484 482 + 486: 208(ptr) AccessChain 413(texel) 207 + Store 486 485 + 487: 199 Load 201(s1DShadow) + 488: 175(fvec3) Load 177(f16c3) + 489: 52(float) Load 215(compare) + 490: 6(float) Load 137(f16bias) + 491: 6(float) CompositeExtract 488 2 + 492: 175(fvec3) CompositeInsert 491 488 1 + 493: 6(float) ImageSampleProjDrefImplicitLod 487 492 489 Bias 490 + 494: 208(ptr) AccessChain 413(texel) 207 + 495: 6(float) Load 494 + 496: 6(float) FAdd 495 493 + 497: 208(ptr) AccessChain 413(texel) 207 + Store 497 496 + 498: 224 Load 226(s2DShadow) + 499: 249(fvec4) Load 251(c4) + 500: 52(float) CompositeExtract 499 2 + 501: 52(float) CompositeExtract 499 3 + 502: 249(fvec4) CompositeInsert 501 499 2 + 503: 6(float) ImageSampleProjDrefImplicitLod 498 502 500 + 504: 208(ptr) AccessChain 413(texel) 207 + 505: 6(float) Load 504 + 506: 6(float) FAdd 505 503 + 507: 208(ptr) AccessChain 413(texel) 207 + Store 507 506 + 508: 224 Load 226(s2DShadow) + 509: 175(fvec3) Load 177(f16c3) + 510: 52(float) Load 215(compare) + 511: 6(float) Load 137(f16bias) + 512: 6(float) ImageSampleProjDrefImplicitLod 508 509 510 Bias 511 + 513: 208(ptr) AccessChain 413(texel) 207 + 514: 6(float) Load 513 + 515: 6(float) FAdd 514 512 + 516: 208(ptr) AccessChain 413(texel) 207 + Store 516 515 + 517: 357 Load 359(s2DRect) + 518: 167(fvec3) Load 169(c3) + 519: 7(fvec4) ImageSampleProjImplicitLod 517 518 + 520: 7(fvec4) Load 413(texel) + 521: 7(fvec4) FAdd 520 519 + Store 413(texel) 521 + 522: 357 Load 359(s2DRect) + 523: 175(fvec3) Load 177(f16c3) + 524: 7(fvec4) ImageSampleProjImplicitLod 522 523 + 525: 7(fvec4) Load 413(texel) + 526: 7(fvec4) FAdd 525 524 + Store 413(texel) 526 + 527: 357 Load 359(s2DRect) + 528: 249(fvec4) Load 251(c4) + 529: 52(float) CompositeExtract 528 3 + 530: 249(fvec4) CompositeInsert 529 528 2 + 531: 7(fvec4) ImageSampleProjImplicitLod 527 530 + 532: 7(fvec4) Load 413(texel) + 533: 7(fvec4) FAdd 532 531 + Store 413(texel) 533 + 534: 357 Load 359(s2DRect) + 535: 7(fvec4) Load 309(f16c4) + 536: 6(float) CompositeExtract 535 3 + 537: 7(fvec4) CompositeInsert 536 535 2 + 538: 7(fvec4) ImageSampleProjImplicitLod 534 537 + 539: 7(fvec4) Load 413(texel) + 540: 7(fvec4) FAdd 539 538 + Store 413(texel) 540 + 541: 371 Load 373(s2DRectShadow) + 542: 249(fvec4) Load 251(c4) + 543: 52(float) CompositeExtract 542 2 + 544: 52(float) CompositeExtract 542 3 + 545: 249(fvec4) CompositeInsert 544 542 2 + 546: 6(float) ImageSampleProjDrefImplicitLod 541 545 543 + 547: 208(ptr) AccessChain 413(texel) 207 + 548: 6(float) Load 547 + 549: 6(float) FAdd 548 546 + 550: 208(ptr) AccessChain 413(texel) 207 + Store 550 549 + 551: 371 Load 373(s2DRectShadow) + 552: 175(fvec3) Load 177(f16c3) + 553: 52(float) Load 215(compare) + 554: 6(float) ImageSampleProjDrefImplicitLod 551 552 553 + 555: 208(ptr) AccessChain 413(texel) 207 + 556: 6(float) Load 555 + 557: 6(float) FAdd 556 554 + 558: 208(ptr) AccessChain 413(texel) 207 + Store 558 557 + 559: 7(fvec4) Load 413(texel) + ReturnValue 559 + FunctionEnd +13(testTextureLod(): 7(fvec4) Function None 8 + 14: Label + 562(texel): 64(ptr) Variable Function + Store 562(texel) 121 + 563: 123 Load 125(s1D) + 564: 52(float) Load 128(c1) + 566: 52(float) Load 565(lod) + 567: 7(fvec4) ImageSampleExplicitLod 563 564 Lod 566 + 568: 7(fvec4) Load 562(texel) + 569: 7(fvec4) FAdd 568 567 + Store 562(texel) 569 + 570: 123 Load 125(s1D) + 571: 6(float) Load 135(f16c1) + 573: 6(float) Load 572(f16lod) + 574: 7(fvec4) ImageSampleExplicitLod 570 571 Lod 573 + 575: 7(fvec4) Load 562(texel) + 576: 7(fvec4) FAdd 575 574 + Store 562(texel) 576 + 577: 143 Load 145(s2D) + 578: 53(fvec2) Load 148(c2) + 579: 52(float) Load 565(lod) + 580: 7(fvec4) ImageSampleExplicitLod 577 578 Lod 579 + 581: 7(fvec4) Load 562(texel) + 582: 7(fvec4) FAdd 581 580 + Store 562(texel) 582 + 583: 143 Load 145(s2D) + 584: 154(fvec2) Load 156(f16c2) + 585: 6(float) Load 572(f16lod) + 586: 7(fvec4) ImageSampleExplicitLod 583 584 Lod 585 + 587: 7(fvec4) Load 562(texel) + 588: 7(fvec4) FAdd 587 586 + Store 562(texel) 588 + 589: 163 Load 165(s3D) + 590: 167(fvec3) Load 169(c3) + 591: 52(float) Load 565(lod) + 592: 7(fvec4) ImageSampleExplicitLod 589 590 Lod 591 + 593: 7(fvec4) Load 562(texel) + 594: 7(fvec4) FAdd 593 592 + Store 562(texel) 594 + 595: 163 Load 165(s3D) + 596: 175(fvec3) Load 177(f16c3) + 597: 6(float) Load 572(f16lod) + 598: 7(fvec4) ImageSampleExplicitLod 595 596 Lod 597 + 599: 7(fvec4) Load 562(texel) + 600: 7(fvec4) FAdd 599 598 + Store 562(texel) 600 + 601: 184 Load 186(sCube) + 602: 167(fvec3) Load 169(c3) + 603: 52(float) Load 565(lod) + 604: 7(fvec4) ImageSampleExplicitLod 601 602 Lod 603 + 605: 7(fvec4) Load 562(texel) + 606: 7(fvec4) FAdd 605 604 + Store 562(texel) 606 + 607: 184 Load 186(sCube) + 608: 175(fvec3) Load 177(f16c3) + 609: 6(float) Load 572(f16lod) + 610: 7(fvec4) ImageSampleExplicitLod 607 608 Lod 609 + 611: 7(fvec4) Load 562(texel) + 612: 7(fvec4) FAdd 611 610 + Store 562(texel) 612 + 613: 199 Load 201(s1DShadow) + 614: 167(fvec3) Load 169(c3) + 615: 52(float) Load 565(lod) + 616: 52(float) CompositeExtract 614 2 + 617: 6(float) ImageSampleDrefExplicitLod 613 614 616 Lod 615 + 618: 208(ptr) AccessChain 562(texel) 207 + 619: 6(float) Load 618 + 620: 6(float) FAdd 619 617 + 621: 208(ptr) AccessChain 562(texel) 207 + Store 621 620 + 622: 199 Load 201(s1DShadow) + 623: 154(fvec2) Load 156(f16c2) + 624: 52(float) Load 215(compare) + 625: 6(float) Load 572(f16lod) + 626: 6(float) ImageSampleDrefExplicitLod 622 623 624 Lod 625 + 627: 208(ptr) AccessChain 562(texel) 207 + 628: 6(float) Load 627 + 629: 6(float) FAdd 628 626 + 630: 208(ptr) AccessChain 562(texel) 207 + Store 630 629 + 631: 224 Load 226(s2DShadow) + 632: 167(fvec3) Load 169(c3) + 633: 52(float) Load 565(lod) + 634: 52(float) CompositeExtract 632 2 + 635: 6(float) ImageSampleDrefExplicitLod 631 632 634 Lod 633 + 636: 208(ptr) AccessChain 562(texel) 207 + 637: 6(float) Load 636 + 638: 6(float) FAdd 637 635 + 639: 208(ptr) AccessChain 562(texel) 207 + Store 639 638 + 640: 224 Load 226(s2DShadow) + 641: 154(fvec2) Load 156(f16c2) + 642: 52(float) Load 215(compare) + 643: 6(float) Load 572(f16lod) + 644: 6(float) ImageSampleDrefExplicitLod 640 641 642 Lod 643 + 645: 208(ptr) AccessChain 562(texel) 207 + 646: 6(float) Load 645 + 647: 6(float) FAdd 646 644 + 648: 208(ptr) AccessChain 562(texel) 207 + Store 648 647 + 649: 269 Load 271(s1DArray) + 650: 53(fvec2) Load 148(c2) + 651: 52(float) Load 565(lod) + 652: 7(fvec4) ImageSampleExplicitLod 649 650 Lod 651 + 653: 7(fvec4) Load 562(texel) + 654: 7(fvec4) FAdd 653 652 + Store 562(texel) 654 + 655: 269 Load 271(s1DArray) + 656: 154(fvec2) Load 156(f16c2) + 657: 6(float) Load 572(f16lod) + 658: 7(fvec4) ImageSampleExplicitLod 655 656 Lod 657 + 659: 7(fvec4) Load 562(texel) + 660: 7(fvec4) FAdd 659 658 + Store 562(texel) 660 + 661: 284 Load 286(s2DArray) + 662: 167(fvec3) Load 169(c3) + 663: 52(float) Load 565(lod) + 664: 7(fvec4) ImageSampleExplicitLod 661 662 Lod 663 + 665: 7(fvec4) Load 562(texel) + 666: 7(fvec4) FAdd 665 664 + Store 562(texel) 666 + 667: 284 Load 286(s2DArray) + 668: 175(fvec3) Load 177(f16c3) + 669: 6(float) Load 572(f16lod) + 670: 7(fvec4) ImageSampleExplicitLod 667 668 Lod 669 + 671: 7(fvec4) Load 562(texel) + 672: 7(fvec4) FAdd 671 670 + Store 562(texel) 672 + 673: 316 Load 318(s1DArrayShadow) + 674: 167(fvec3) Load 169(c3) + 675: 52(float) Load 565(lod) + 676: 52(float) CompositeExtract 674 2 + 677: 6(float) ImageSampleDrefExplicitLod 673 674 676 Lod 675 + 678: 208(ptr) AccessChain 562(texel) 207 + 679: 6(float) Load 678 + 680: 6(float) FAdd 679 677 + 681: 208(ptr) AccessChain 562(texel) 207 + Store 681 680 + 682: 316 Load 318(s1DArrayShadow) + 683: 154(fvec2) Load 156(f16c2) + 684: 52(float) Load 215(compare) + 685: 6(float) Load 572(f16lod) + 686: 6(float) ImageSampleDrefExplicitLod 682 683 684 Lod 685 + 687: 208(ptr) AccessChain 562(texel) 207 + 688: 6(float) Load 687 + 689: 6(float) FAdd 688 686 + 690: 208(ptr) AccessChain 562(texel) 207 + Store 690 689 + 691: 299 Load 301(sCubeArray) + 692: 249(fvec4) Load 251(c4) + 693: 52(float) Load 565(lod) + 694: 7(fvec4) ImageSampleExplicitLod 691 692 Lod 693 + 695: 7(fvec4) Load 562(texel) + 696: 7(fvec4) FAdd 695 694 + Store 562(texel) 696 + 697: 299 Load 301(sCubeArray) + 698: 7(fvec4) Load 309(f16c4) + 699: 6(float) Load 572(f16lod) + 700: 7(fvec4) ImageSampleExplicitLod 697 698 Lod 699 + 701: 7(fvec4) Load 562(texel) + 702: 7(fvec4) FAdd 701 700 + Store 562(texel) 702 + 703: 7(fvec4) Load 562(texel) + ReturnValue 703 + FunctionEnd +15(testTextureOffset(): 7(fvec4) Function None 8 + 16: Label + 706(texel): 64(ptr) Variable Function + Store 706(texel) 121 + 707: 123 Load 125(s1D) + 708: 52(float) Load 128(c1) + 710: 7(fvec4) ImageSampleImplicitLod 707 708 ConstOffset 709 + 711: 7(fvec4) Load 706(texel) + 712: 7(fvec4) FAdd 711 710 + Store 706(texel) 712 + 713: 123 Load 125(s1D) + 714: 6(float) Load 135(f16c1) + 715: 6(float) Load 137(f16bias) + 716: 7(fvec4) ImageSampleImplicitLod 713 714 Bias ConstOffset 715 709 + 717: 7(fvec4) Load 706(texel) + 718: 7(fvec4) FAdd 717 716 + Store 706(texel) 718 + 719: 143 Load 145(s2D) + 720: 53(fvec2) Load 148(c2) + 723: 7(fvec4) ImageSampleImplicitLod 719 720 ConstOffset 722 + 724: 7(fvec4) Load 706(texel) + 725: 7(fvec4) FAdd 724 723 + Store 706(texel) 725 + 726: 143 Load 145(s2D) + 727: 154(fvec2) Load 156(f16c2) + 728: 6(float) Load 137(f16bias) + 729: 7(fvec4) ImageSampleImplicitLod 726 727 Bias ConstOffset 728 722 + 730: 7(fvec4) Load 706(texel) + 731: 7(fvec4) FAdd 730 729 + Store 706(texel) 731 + 732: 163 Load 165(s3D) + 733: 167(fvec3) Load 169(c3) + 736: 7(fvec4) ImageSampleImplicitLod 732 733 ConstOffset 735 + 737: 7(fvec4) Load 706(texel) + 738: 7(fvec4) FAdd 737 736 + Store 706(texel) 738 + 739: 163 Load 165(s3D) + 740: 175(fvec3) Load 177(f16c3) + 741: 6(float) Load 137(f16bias) + 742: 7(fvec4) ImageSampleImplicitLod 739 740 Bias ConstOffset 741 735 + 743: 7(fvec4) Load 706(texel) + 744: 7(fvec4) FAdd 743 742 + Store 706(texel) 744 + 745: 357 Load 359(s2DRect) + 746: 53(fvec2) Load 148(c2) + 747: 7(fvec4) ImageSampleImplicitLod 745 746 ConstOffset 722 + 748: 7(fvec4) Load 706(texel) + 749: 7(fvec4) FAdd 748 747 + Store 706(texel) 749 + 750: 357 Load 359(s2DRect) + 751: 154(fvec2) Load 156(f16c2) + 752: 7(fvec4) ImageSampleImplicitLod 750 751 ConstOffset 722 + 753: 7(fvec4) Load 706(texel) + 754: 7(fvec4) FAdd 753 752 + Store 706(texel) 754 + 755: 371 Load 373(s2DRectShadow) + 756: 167(fvec3) Load 169(c3) + 757: 52(float) CompositeExtract 756 2 + 758: 6(float) ImageSampleDrefImplicitLod 755 756 757 ConstOffset 722 + 759: 208(ptr) AccessChain 706(texel) 207 + 760: 6(float) Load 759 + 761: 6(float) FAdd 760 758 + 762: 208(ptr) AccessChain 706(texel) 207 + Store 762 761 + 763: 371 Load 373(s2DRectShadow) + 764: 154(fvec2) Load 156(f16c2) + 765: 52(float) Load 215(compare) + 766: 6(float) ImageSampleDrefImplicitLod 763 764 765 ConstOffset 722 + 767: 208(ptr) AccessChain 706(texel) 207 + 768: 6(float) Load 767 + 769: 6(float) FAdd 768 766 + 770: 208(ptr) AccessChain 706(texel) 207 + Store 770 769 + 771: 199 Load 201(s1DShadow) + 772: 167(fvec3) Load 169(c3) + 773: 52(float) CompositeExtract 772 2 + 774: 6(float) ImageSampleDrefImplicitLod 771 772 773 ConstOffset 709 + 775: 208(ptr) AccessChain 706(texel) 207 + 776: 6(float) Load 775 + 777: 6(float) FAdd 776 774 + 778: 208(ptr) AccessChain 706(texel) 207 + Store 778 777 + 779: 199 Load 201(s1DShadow) + 780: 154(fvec2) Load 156(f16c2) + 781: 52(float) Load 215(compare) + 782: 6(float) Load 137(f16bias) + 783: 6(float) ImageSampleDrefImplicitLod 779 780 781 Bias ConstOffset 782 709 + 784: 208(ptr) AccessChain 706(texel) 207 + 785: 6(float) Load 784 + 786: 6(float) FAdd 785 783 + 787: 208(ptr) AccessChain 706(texel) 207 + Store 787 786 + 788: 224 Load 226(s2DShadow) + 789: 167(fvec3) Load 169(c3) + 790: 52(float) CompositeExtract 789 2 + 791: 6(float) ImageSampleDrefImplicitLod 788 789 790 ConstOffset 722 + 792: 208(ptr) AccessChain 706(texel) 207 + 793: 6(float) Load 792 + 794: 6(float) FAdd 793 791 + 795: 208(ptr) AccessChain 706(texel) 207 + Store 795 794 + 796: 224 Load 226(s2DShadow) + 797: 154(fvec2) Load 156(f16c2) + 798: 52(float) Load 215(compare) + 799: 6(float) Load 137(f16bias) + 800: 6(float) ImageSampleDrefImplicitLod 796 797 798 Bias ConstOffset 799 722 + 801: 208(ptr) AccessChain 706(texel) 207 + 802: 6(float) Load 801 + 803: 6(float) FAdd 802 800 + 804: 208(ptr) AccessChain 706(texel) 207 + Store 804 803 + 805: 269 Load 271(s1DArray) + 806: 53(fvec2) Load 148(c2) + 807: 7(fvec4) ImageSampleImplicitLod 805 806 ConstOffset 709 + 808: 7(fvec4) Load 706(texel) + 809: 7(fvec4) FAdd 808 807 + Store 706(texel) 809 + 810: 269 Load 271(s1DArray) + 811: 154(fvec2) Load 156(f16c2) + 812: 6(float) Load 137(f16bias) + 813: 7(fvec4) ImageSampleImplicitLod 810 811 Bias ConstOffset 812 709 + 814: 7(fvec4) Load 706(texel) + 815: 7(fvec4) FAdd 814 813 + Store 706(texel) 815 + 816: 284 Load 286(s2DArray) + 817: 167(fvec3) Load 169(c3) + 818: 7(fvec4) ImageSampleImplicitLod 816 817 ConstOffset 722 + 819: 7(fvec4) Load 706(texel) + 820: 7(fvec4) FAdd 819 818 + Store 706(texel) 820 + 821: 284 Load 286(s2DArray) + 822: 175(fvec3) Load 177(f16c3) + 823: 6(float) Load 137(f16bias) + 824: 7(fvec4) ImageSampleImplicitLod 821 822 Bias ConstOffset 823 722 + 825: 7(fvec4) Load 706(texel) + 826: 7(fvec4) FAdd 825 824 + Store 706(texel) 826 + 827: 316 Load 318(s1DArrayShadow) + 828: 167(fvec3) Load 169(c3) + 829: 52(float) CompositeExtract 828 2 + 830: 6(float) ImageSampleDrefImplicitLod 827 828 829 ConstOffset 709 + 831: 208(ptr) AccessChain 706(texel) 207 + 832: 6(float) Load 831 + 833: 6(float) FAdd 832 830 + 834: 208(ptr) AccessChain 706(texel) 207 + Store 834 833 + 835: 316 Load 318(s1DArrayShadow) + 836: 154(fvec2) Load 156(f16c2) + 837: 52(float) Load 215(compare) + 838: 6(float) Load 137(f16bias) + 839: 6(float) ImageSampleDrefImplicitLod 835 836 837 Bias ConstOffset 838 709 + 840: 208(ptr) AccessChain 706(texel) 207 + 841: 6(float) Load 840 + 842: 6(float) FAdd 841 839 + 843: 208(ptr) AccessChain 706(texel) 207 + Store 843 842 + 844: 337 Load 339(s2DArrayShadow) + 845: 249(fvec4) Load 251(c4) + 846: 52(float) CompositeExtract 845 3 + 847: 6(float) ImageSampleDrefImplicitLod 844 845 846 ConstOffset 722 + 848: 208(ptr) AccessChain 706(texel) 207 + 849: 6(float) Load 848 + 850: 6(float) FAdd 849 847 + 851: 208(ptr) AccessChain 706(texel) 207 + Store 851 850 + 852: 337 Load 339(s2DArrayShadow) + 853: 175(fvec3) Load 177(f16c3) + 854: 52(float) Load 215(compare) + 855: 6(float) ImageSampleDrefImplicitLod 852 853 854 ConstOffset 722 + 856: 208(ptr) AccessChain 706(texel) 207 + 857: 6(float) Load 856 + 858: 6(float) FAdd 857 855 + 859: 208(ptr) AccessChain 706(texel) 207 + Store 859 858 + 860: 7(fvec4) Load 706(texel) + ReturnValue 860 + FunctionEnd +17(testTextureProjOffset(): 7(fvec4) Function None 8 + 18: Label + 863(texel): 64(ptr) Variable Function + Store 863(texel) 121 + 864: 123 Load 125(s1D) + 865: 53(fvec2) Load 148(c2) + 866: 7(fvec4) ImageSampleProjImplicitLod 864 865 ConstOffset 709 + 867: 7(fvec4) Load 863(texel) + 868: 7(fvec4) FAdd 867 866 + Store 863(texel) 868 + 869: 123 Load 125(s1D) + 870: 154(fvec2) Load 156(f16c2) + 871: 6(float) Load 137(f16bias) + 872: 7(fvec4) ImageSampleProjImplicitLod 869 870 Bias ConstOffset 871 709 + 873: 7(fvec4) Load 863(texel) + 874: 7(fvec4) FAdd 873 872 + Store 863(texel) 874 + 875: 123 Load 125(s1D) + 876: 249(fvec4) Load 251(c4) + 877: 52(float) CompositeExtract 876 3 + 878: 249(fvec4) CompositeInsert 877 876 1 + 879: 7(fvec4) ImageSampleProjImplicitLod 875 878 ConstOffset 709 + 880: 7(fvec4) Load 863(texel) + 881: 7(fvec4) FAdd 880 879 + Store 863(texel) 881 + 882: 123 Load 125(s1D) + 883: 7(fvec4) Load 309(f16c4) + 884: 6(float) Load 137(f16bias) + 885: 6(float) CompositeExtract 883 3 + 886: 7(fvec4) CompositeInsert 885 883 1 + 887: 7(fvec4) ImageSampleProjImplicitLod 882 886 Bias ConstOffset 884 709 + 888: 7(fvec4) Load 863(texel) + 889: 7(fvec4) FAdd 888 887 + Store 863(texel) 889 + 890: 143 Load 145(s2D) + 891: 167(fvec3) Load 169(c3) + 892: 7(fvec4) ImageSampleProjImplicitLod 890 891 ConstOffset 722 + 893: 7(fvec4) Load 863(texel) + 894: 7(fvec4) FAdd 893 892 + Store 863(texel) 894 + 895: 143 Load 145(s2D) + 896: 175(fvec3) Load 177(f16c3) + 897: 6(float) Load 137(f16bias) + 898: 7(fvec4) ImageSampleProjImplicitLod 895 896 Bias ConstOffset 897 722 + 899: 7(fvec4) Load 863(texel) + 900: 7(fvec4) FAdd 899 898 + Store 863(texel) 900 + 901: 143 Load 145(s2D) + 902: 249(fvec4) Load 251(c4) + 903: 52(float) CompositeExtract 902 3 + 904: 249(fvec4) CompositeInsert 903 902 2 + 905: 7(fvec4) ImageSampleProjImplicitLod 901 904 ConstOffset 722 + 906: 7(fvec4) Load 863(texel) + 907: 7(fvec4) FAdd 906 905 + Store 863(texel) 907 + 908: 143 Load 145(s2D) + 909: 7(fvec4) Load 309(f16c4) + 910: 6(float) Load 137(f16bias) + 911: 6(float) CompositeExtract 909 3 + 912: 7(fvec4) CompositeInsert 911 909 2 + 913: 7(fvec4) ImageSampleProjImplicitLod 908 912 Bias ConstOffset 910 722 + 914: 7(fvec4) Load 863(texel) + 915: 7(fvec4) FAdd 914 913 + Store 863(texel) 915 + 916: 163 Load 165(s3D) + 917: 249(fvec4) Load 251(c4) + 918: 7(fvec4) ImageSampleProjImplicitLod 916 917 ConstOffset 735 + 919: 7(fvec4) Load 863(texel) + 920: 7(fvec4) FAdd 919 918 + Store 863(texel) 920 + 921: 163 Load 165(s3D) + 922: 7(fvec4) Load 309(f16c4) + 923: 6(float) Load 137(f16bias) + 924: 7(fvec4) ImageSampleProjImplicitLod 921 922 Bias ConstOffset 923 735 + 925: 7(fvec4) Load 863(texel) + 926: 7(fvec4) FAdd 925 924 + Store 863(texel) 926 + 927: 357 Load 359(s2DRect) + 928: 167(fvec3) Load 169(c3) + 929: 7(fvec4) ImageSampleProjImplicitLod 927 928 ConstOffset 722 + 930: 7(fvec4) Load 863(texel) + 931: 7(fvec4) FAdd 930 929 + Store 863(texel) 931 + 932: 357 Load 359(s2DRect) + 933: 175(fvec3) Load 177(f16c3) + 934: 7(fvec4) ImageSampleProjImplicitLod 932 933 ConstOffset 722 + 935: 7(fvec4) Load 863(texel) + 936: 7(fvec4) FAdd 935 934 + Store 863(texel) 936 + 937: 357 Load 359(s2DRect) + 938: 249(fvec4) Load 251(c4) + 939: 52(float) CompositeExtract 938 3 + 940: 249(fvec4) CompositeInsert 939 938 2 + 941: 7(fvec4) ImageSampleProjImplicitLod 937 940 ConstOffset 722 + 942: 7(fvec4) Load 863(texel) + 943: 7(fvec4) FAdd 942 941 + Store 863(texel) 943 + 944: 357 Load 359(s2DRect) + 945: 7(fvec4) Load 309(f16c4) + 946: 6(float) CompositeExtract 945 3 + 947: 7(fvec4) CompositeInsert 946 945 2 + 948: 7(fvec4) ImageSampleProjImplicitLod 944 947 ConstOffset 722 + 949: 7(fvec4) Load 863(texel) + 950: 7(fvec4) FAdd 949 948 + Store 863(texel) 950 + 951: 371 Load 373(s2DRectShadow) + 952: 249(fvec4) Load 251(c4) + 953: 52(float) CompositeExtract 952 2 + 954: 52(float) CompositeExtract 952 3 + 955: 249(fvec4) CompositeInsert 954 952 2 + 956: 6(float) ImageSampleProjDrefImplicitLod 951 955 953 ConstOffset 722 + 957: 208(ptr) AccessChain 863(texel) 207 + 958: 6(float) Load 957 + 959: 6(float) FAdd 958 956 + 960: 208(ptr) AccessChain 863(texel) 207 + Store 960 959 + 961: 371 Load 373(s2DRectShadow) + 962: 175(fvec3) Load 177(f16c3) + 963: 52(float) Load 215(compare) + 964: 6(float) ImageSampleProjDrefImplicitLod 961 962 963 ConstOffset 722 + 965: 208(ptr) AccessChain 863(texel) 207 + 966: 6(float) Load 965 + 967: 6(float) FAdd 966 964 + 968: 208(ptr) AccessChain 863(texel) 207 + Store 968 967 + 969: 199 Load 201(s1DShadow) + 970: 249(fvec4) Load 251(c4) + 971: 52(float) CompositeExtract 970 2 + 972: 52(float) CompositeExtract 970 3 + 973: 249(fvec4) CompositeInsert 972 970 1 + 974: 6(float) ImageSampleProjDrefImplicitLod 969 973 971 ConstOffset 709 + 975: 208(ptr) AccessChain 863(texel) 207 + 976: 6(float) Load 975 + 977: 6(float) FAdd 976 974 + 978: 208(ptr) AccessChain 863(texel) 207 + Store 978 977 + 979: 199 Load 201(s1DShadow) + 980: 175(fvec3) Load 177(f16c3) + 981: 52(float) Load 215(compare) + 982: 6(float) Load 137(f16bias) + 983: 6(float) CompositeExtract 980 2 + 984: 175(fvec3) CompositeInsert 983 980 1 + 985: 6(float) ImageSampleProjDrefImplicitLod 979 984 981 Bias ConstOffset 982 709 + 986: 208(ptr) AccessChain 863(texel) 207 + 987: 6(float) Load 986 + 988: 6(float) FAdd 987 985 + 989: 208(ptr) AccessChain 863(texel) 207 + Store 989 988 + 990: 224 Load 226(s2DShadow) + 991: 249(fvec4) Load 251(c4) + 992: 52(float) CompositeExtract 991 2 + 993: 52(float) CompositeExtract 991 3 + 994: 249(fvec4) CompositeInsert 993 991 2 + 995: 6(float) ImageSampleProjDrefImplicitLod 990 994 992 ConstOffset 722 + 996: 208(ptr) AccessChain 863(texel) 207 + 997: 6(float) Load 996 + 998: 6(float) FAdd 997 995 + 999: 208(ptr) AccessChain 863(texel) 207 + Store 999 998 + 1000: 224 Load 226(s2DShadow) + 1001: 175(fvec3) Load 177(f16c3) + 1002: 52(float) Load 215(compare) + 1003: 6(float) Load 137(f16bias) + 1004: 6(float) ImageSampleProjDrefImplicitLod 1000 1001 1002 Bias ConstOffset 1003 722 + 1005: 208(ptr) AccessChain 863(texel) 207 + 1006: 6(float) Load 1005 + 1007: 6(float) FAdd 1006 1004 + 1008: 208(ptr) AccessChain 863(texel) 207 + Store 1008 1007 + 1009: 7(fvec4) Load 863(texel) + ReturnValue 1009 + FunctionEnd +19(testTextureLodOffset(): 7(fvec4) Function None 8 + 20: Label + 1012(texel): 64(ptr) Variable Function + Store 1012(texel) 121 + 1013: 123 Load 125(s1D) + 1014: 52(float) Load 128(c1) + 1015: 52(float) Load 565(lod) + 1016: 7(fvec4) ImageSampleExplicitLod 1013 1014 Lod ConstOffset 1015 709 + 1017: 7(fvec4) Load 1012(texel) + 1018: 7(fvec4) FAdd 1017 1016 + Store 1012(texel) 1018 + 1019: 123 Load 125(s1D) + 1020: 6(float) Load 135(f16c1) + 1021: 6(float) Load 572(f16lod) + 1022: 7(fvec4) ImageSampleExplicitLod 1019 1020 Lod ConstOffset 1021 709 + 1023: 7(fvec4) Load 1012(texel) + 1024: 7(fvec4) FAdd 1023 1022 + Store 1012(texel) 1024 + 1025: 143 Load 145(s2D) + 1026: 53(fvec2) Load 148(c2) + 1027: 52(float) Load 565(lod) + 1028: 7(fvec4) ImageSampleExplicitLod 1025 1026 Lod ConstOffset 1027 722 + 1029: 7(fvec4) Load 1012(texel) + 1030: 7(fvec4) FAdd 1029 1028 + Store 1012(texel) 1030 + 1031: 143 Load 145(s2D) + 1032: 154(fvec2) Load 156(f16c2) + 1033: 6(float) Load 572(f16lod) + 1034: 7(fvec4) ImageSampleExplicitLod 1031 1032 Lod ConstOffset 1033 722 + 1035: 7(fvec4) Load 1012(texel) + 1036: 7(fvec4) FAdd 1035 1034 + Store 1012(texel) 1036 + 1037: 163 Load 165(s3D) + 1038: 167(fvec3) Load 169(c3) + 1039: 52(float) Load 565(lod) + 1040: 7(fvec4) ImageSampleExplicitLod 1037 1038 Lod ConstOffset 1039 735 + 1041: 7(fvec4) Load 1012(texel) + 1042: 7(fvec4) FAdd 1041 1040 + Store 1012(texel) 1042 + 1043: 163 Load 165(s3D) + 1044: 175(fvec3) Load 177(f16c3) + 1045: 6(float) Load 572(f16lod) + 1046: 7(fvec4) ImageSampleExplicitLod 1043 1044 Lod ConstOffset 1045 735 + 1047: 7(fvec4) Load 1012(texel) + 1048: 7(fvec4) FAdd 1047 1046 + Store 1012(texel) 1048 + 1049: 199 Load 201(s1DShadow) + 1050: 167(fvec3) Load 169(c3) + 1051: 52(float) Load 565(lod) + 1052: 52(float) CompositeExtract 1050 2 + 1053: 6(float) ImageSampleDrefExplicitLod 1049 1050 1052 Lod ConstOffset 1051 709 + 1054: 208(ptr) AccessChain 1012(texel) 207 + 1055: 6(float) Load 1054 + 1056: 6(float) FAdd 1055 1053 + 1057: 208(ptr) AccessChain 1012(texel) 207 + Store 1057 1056 + 1058: 199 Load 201(s1DShadow) + 1059: 154(fvec2) Load 156(f16c2) + 1060: 52(float) Load 215(compare) + 1061: 6(float) Load 572(f16lod) + 1062: 6(float) ImageSampleDrefExplicitLod 1058 1059 1060 Lod ConstOffset 1061 709 + 1063: 208(ptr) AccessChain 1012(texel) 207 + 1064: 6(float) Load 1063 + 1065: 6(float) FAdd 1064 1062 + 1066: 208(ptr) AccessChain 1012(texel) 207 + Store 1066 1065 + 1067: 224 Load 226(s2DShadow) + 1068: 167(fvec3) Load 169(c3) + 1069: 52(float) Load 565(lod) + 1070: 52(float) CompositeExtract 1068 2 + 1071: 6(float) ImageSampleDrefExplicitLod 1067 1068 1070 Lod ConstOffset 1069 722 + 1072: 208(ptr) AccessChain 1012(texel) 207 + 1073: 6(float) Load 1072 + 1074: 6(float) FAdd 1073 1071 + 1075: 208(ptr) AccessChain 1012(texel) 207 + Store 1075 1074 + 1076: 224 Load 226(s2DShadow) + 1077: 154(fvec2) Load 156(f16c2) + 1078: 52(float) Load 215(compare) + 1079: 6(float) Load 572(f16lod) + 1080: 6(float) ImageSampleDrefExplicitLod 1076 1077 1078 Lod ConstOffset 1079 722 + 1081: 208(ptr) AccessChain 1012(texel) 207 + 1082: 6(float) Load 1081 + 1083: 6(float) FAdd 1082 1080 + 1084: 208(ptr) AccessChain 1012(texel) 207 + Store 1084 1083 + 1085: 269 Load 271(s1DArray) + 1086: 53(fvec2) Load 148(c2) + 1087: 52(float) Load 565(lod) + 1088: 7(fvec4) ImageSampleExplicitLod 1085 1086 Lod ConstOffset 1087 709 + 1089: 7(fvec4) Load 1012(texel) + 1090: 7(fvec4) FAdd 1089 1088 + Store 1012(texel) 1090 + 1091: 269 Load 271(s1DArray) + 1092: 154(fvec2) Load 156(f16c2) + 1093: 6(float) Load 572(f16lod) + 1094: 7(fvec4) ImageSampleExplicitLod 1091 1092 Lod ConstOffset 1093 709 + 1095: 7(fvec4) Load 1012(texel) + 1096: 7(fvec4) FAdd 1095 1094 + Store 1012(texel) 1096 + 1097: 284 Load 286(s2DArray) + 1098: 167(fvec3) Load 169(c3) + 1099: 52(float) Load 565(lod) + 1100: 7(fvec4) ImageSampleExplicitLod 1097 1098 Lod ConstOffset 1099 722 + 1101: 7(fvec4) Load 1012(texel) + 1102: 7(fvec4) FAdd 1101 1100 + Store 1012(texel) 1102 + 1103: 284 Load 286(s2DArray) + 1104: 175(fvec3) Load 177(f16c3) + 1105: 6(float) Load 572(f16lod) + 1106: 7(fvec4) ImageSampleExplicitLod 1103 1104 Lod ConstOffset 1105 722 + 1107: 7(fvec4) Load 1012(texel) + 1108: 7(fvec4) FAdd 1107 1106 + Store 1012(texel) 1108 + 1109: 316 Load 318(s1DArrayShadow) + 1110: 167(fvec3) Load 169(c3) + 1111: 52(float) Load 565(lod) + 1112: 52(float) CompositeExtract 1110 2 + 1113: 6(float) ImageSampleDrefExplicitLod 1109 1110 1112 Lod ConstOffset 1111 709 + 1114: 208(ptr) AccessChain 1012(texel) 207 + 1115: 6(float) Load 1114 + 1116: 6(float) FAdd 1115 1113 + 1117: 208(ptr) AccessChain 1012(texel) 207 + Store 1117 1116 + 1118: 316 Load 318(s1DArrayShadow) + 1119: 154(fvec2) Load 156(f16c2) + 1120: 52(float) Load 215(compare) + 1121: 6(float) Load 572(f16lod) + 1122: 6(float) ImageSampleDrefExplicitLod 1118 1119 1120 Lod ConstOffset 1121 709 + 1123: 208(ptr) AccessChain 1012(texel) 207 + 1124: 6(float) Load 1123 + 1125: 6(float) FAdd 1124 1122 + 1126: 208(ptr) AccessChain 1012(texel) 207 + Store 1126 1125 + 1127: 7(fvec4) Load 1012(texel) + ReturnValue 1127 + FunctionEnd +21(testTextureProjLodOffset(): 7(fvec4) Function None 8 + 22: Label + 1130(texel): 64(ptr) Variable Function + Store 1130(texel) 121 + 1131: 123 Load 125(s1D) + 1132: 53(fvec2) Load 148(c2) + 1133: 52(float) Load 565(lod) + 1134: 7(fvec4) ImageSampleProjExplicitLod 1131 1132 Lod ConstOffset 1133 709 + 1135: 7(fvec4) Load 1130(texel) + 1136: 7(fvec4) FAdd 1135 1134 + Store 1130(texel) 1136 + 1137: 123 Load 125(s1D) + 1138: 154(fvec2) Load 156(f16c2) + 1139: 6(float) Load 572(f16lod) + 1140: 7(fvec4) ImageSampleProjExplicitLod 1137 1138 Lod ConstOffset 1139 709 + 1141: 7(fvec4) Load 1130(texel) + 1142: 7(fvec4) FAdd 1141 1140 + Store 1130(texel) 1142 + 1143: 123 Load 125(s1D) + 1144: 249(fvec4) Load 251(c4) + 1145: 52(float) Load 565(lod) + 1146: 52(float) CompositeExtract 1144 3 + 1147: 249(fvec4) CompositeInsert 1146 1144 1 + 1148: 7(fvec4) ImageSampleProjExplicitLod 1143 1147 Lod ConstOffset 1145 709 + 1149: 7(fvec4) Load 1130(texel) + 1150: 7(fvec4) FAdd 1149 1148 + Store 1130(texel) 1150 + 1151: 123 Load 125(s1D) + 1152: 7(fvec4) Load 309(f16c4) + 1153: 6(float) Load 572(f16lod) + 1154: 6(float) CompositeExtract 1152 3 + 1155: 7(fvec4) CompositeInsert 1154 1152 1 + 1156: 7(fvec4) ImageSampleProjExplicitLod 1151 1155 Lod ConstOffset 1153 709 + 1157: 7(fvec4) Load 1130(texel) + 1158: 7(fvec4) FAdd 1157 1156 + Store 1130(texel) 1158 + 1159: 143 Load 145(s2D) + 1160: 167(fvec3) Load 169(c3) + 1161: 52(float) Load 565(lod) + 1162: 7(fvec4) ImageSampleProjExplicitLod 1159 1160 Lod ConstOffset 1161 722 + 1163: 7(fvec4) Load 1130(texel) + 1164: 7(fvec4) FAdd 1163 1162 + Store 1130(texel) 1164 + 1165: 143 Load 145(s2D) + 1166: 175(fvec3) Load 177(f16c3) + 1167: 6(float) Load 572(f16lod) + 1168: 7(fvec4) ImageSampleProjExplicitLod 1165 1166 Lod ConstOffset 1167 722 + 1169: 7(fvec4) Load 1130(texel) + 1170: 7(fvec4) FAdd 1169 1168 + Store 1130(texel) 1170 + 1171: 143 Load 145(s2D) + 1172: 249(fvec4) Load 251(c4) + 1173: 52(float) Load 565(lod) + 1174: 52(float) CompositeExtract 1172 3 + 1175: 249(fvec4) CompositeInsert 1174 1172 2 + 1176: 7(fvec4) ImageSampleProjExplicitLod 1171 1175 Lod ConstOffset 1173 722 + 1177: 7(fvec4) Load 1130(texel) + 1178: 7(fvec4) FAdd 1177 1176 + Store 1130(texel) 1178 + 1179: 143 Load 145(s2D) + 1180: 7(fvec4) Load 309(f16c4) + 1181: 6(float) Load 572(f16lod) + 1182: 6(float) CompositeExtract 1180 3 + 1183: 7(fvec4) CompositeInsert 1182 1180 2 + 1184: 7(fvec4) ImageSampleProjExplicitLod 1179 1183 Lod ConstOffset 1181 722 + 1185: 7(fvec4) Load 1130(texel) + 1186: 7(fvec4) FAdd 1185 1184 + Store 1130(texel) 1186 + 1187: 163 Load 165(s3D) + 1188: 249(fvec4) Load 251(c4) + 1189: 52(float) Load 565(lod) + 1190: 7(fvec4) ImageSampleProjExplicitLod 1187 1188 Lod ConstOffset 1189 735 + 1191: 7(fvec4) Load 1130(texel) + 1192: 7(fvec4) FAdd 1191 1190 + Store 1130(texel) 1192 + 1193: 163 Load 165(s3D) + 1194: 7(fvec4) Load 309(f16c4) + 1195: 6(float) Load 572(f16lod) + 1196: 7(fvec4) ImageSampleProjExplicitLod 1193 1194 Lod ConstOffset 1195 735 + 1197: 7(fvec4) Load 1130(texel) + 1198: 7(fvec4) FAdd 1197 1196 + Store 1130(texel) 1198 + 1199: 199 Load 201(s1DShadow) + 1200: 249(fvec4) Load 251(c4) + 1201: 52(float) Load 565(lod) + 1202: 52(float) CompositeExtract 1200 2 + 1203: 52(float) CompositeExtract 1200 3 + 1204: 249(fvec4) CompositeInsert 1203 1200 1 + 1205: 6(float) ImageSampleProjDrefExplicitLod 1199 1204 1202 Lod ConstOffset 1201 709 + 1206: 208(ptr) AccessChain 1130(texel) 207 + 1207: 6(float) Load 1206 + 1208: 6(float) FAdd 1207 1205 + 1209: 208(ptr) AccessChain 1130(texel) 207 + Store 1209 1208 + 1210: 199 Load 201(s1DShadow) + 1211: 175(fvec3) Load 177(f16c3) + 1212: 52(float) Load 215(compare) + 1213: 6(float) Load 572(f16lod) + 1214: 6(float) CompositeExtract 1211 2 + 1215: 175(fvec3) CompositeInsert 1214 1211 1 + 1216: 6(float) ImageSampleProjDrefExplicitLod 1210 1215 1212 Lod ConstOffset 1213 709 + 1217: 208(ptr) AccessChain 1130(texel) 207 + 1218: 6(float) Load 1217 + 1219: 6(float) FAdd 1218 1216 + 1220: 208(ptr) AccessChain 1130(texel) 207 + Store 1220 1219 + 1221: 224 Load 226(s2DShadow) + 1222: 249(fvec4) Load 251(c4) + 1223: 52(float) Load 565(lod) + 1224: 52(float) CompositeExtract 1222 2 + 1225: 52(float) CompositeExtract 1222 3 + 1226: 249(fvec4) CompositeInsert 1225 1222 2 + 1227: 6(float) ImageSampleProjDrefExplicitLod 1221 1226 1224 Lod ConstOffset 1223 722 + 1228: 208(ptr) AccessChain 1130(texel) 207 + 1229: 6(float) Load 1228 + 1230: 6(float) FAdd 1229 1227 + 1231: 208(ptr) AccessChain 1130(texel) 207 + Store 1231 1230 + 1232: 224 Load 226(s2DShadow) + 1233: 175(fvec3) Load 177(f16c3) + 1234: 52(float) Load 215(compare) + 1235: 6(float) Load 572(f16lod) + 1236: 6(float) ImageSampleProjDrefExplicitLod 1232 1233 1234 Lod ConstOffset 1235 722 + 1237: 208(ptr) AccessChain 1130(texel) 207 + 1238: 6(float) Load 1237 + 1239: 6(float) FAdd 1238 1236 + 1240: 208(ptr) AccessChain 1130(texel) 207 + Store 1240 1239 + 1241: 7(fvec4) Load 1130(texel) + ReturnValue 1241 + FunctionEnd +23(testTexelFetch(): 7(fvec4) Function None 8 + 24: Label + 1244(texel): 64(ptr) Variable Function + Store 1244(texel) 121 + 1245: 123 Load 125(s1D) + 1246: 52(float) Load 128(c1) + 1247: 47(int) ConvertFToS 1246 + 1248: 52(float) Load 565(lod) + 1249: 47(int) ConvertFToS 1248 + 1250: 122 Image 1245 + 1251: 7(fvec4) ImageFetch 1250 1247 Lod 1249 + 1252: 7(fvec4) Load 1244(texel) + 1253: 7(fvec4) FAdd 1252 1251 + Store 1244(texel) 1253 + 1254: 143 Load 145(s2D) + 1255: 53(fvec2) Load 148(c2) + 1256: 721(ivec2) ConvertFToS 1255 + 1257: 52(float) Load 565(lod) + 1258: 47(int) ConvertFToS 1257 + 1259: 142 Image 1254 + 1260: 7(fvec4) ImageFetch 1259 1256 Lod 1258 + 1261: 7(fvec4) Load 1244(texel) + 1262: 7(fvec4) FAdd 1261 1260 + Store 1244(texel) 1262 + 1263: 163 Load 165(s3D) + 1264: 167(fvec3) Load 169(c3) + 1265: 734(ivec3) ConvertFToS 1264 + 1266: 52(float) Load 565(lod) + 1267: 47(int) ConvertFToS 1266 + 1268: 162 Image 1263 + 1269: 7(fvec4) ImageFetch 1268 1265 Lod 1267 + 1270: 7(fvec4) Load 1244(texel) + 1271: 7(fvec4) FAdd 1270 1269 + Store 1244(texel) 1271 + 1272: 357 Load 359(s2DRect) + 1273: 53(fvec2) Load 148(c2) + 1274: 721(ivec2) ConvertFToS 1273 + 1275: 356 Image 1272 + 1276: 7(fvec4) ImageFetch 1275 1274 + 1277: 7(fvec4) Load 1244(texel) + 1278: 7(fvec4) FAdd 1277 1276 + Store 1244(texel) 1278 + 1279: 269 Load 271(s1DArray) + 1280: 53(fvec2) Load 148(c2) + 1281: 721(ivec2) ConvertFToS 1280 + 1282: 52(float) Load 565(lod) + 1283: 47(int) ConvertFToS 1282 + 1284: 268 Image 1279 + 1285: 7(fvec4) ImageFetch 1284 1281 Lod 1283 + 1286: 7(fvec4) Load 1244(texel) + 1287: 7(fvec4) FAdd 1286 1285 + Store 1244(texel) 1287 + 1288: 284 Load 286(s2DArray) + 1289: 167(fvec3) Load 169(c3) + 1290: 734(ivec3) ConvertFToS 1289 + 1291: 52(float) Load 565(lod) + 1292: 47(int) ConvertFToS 1291 + 1293: 283 Image 1288 + 1294: 7(fvec4) ImageFetch 1293 1290 Lod 1292 + 1295: 7(fvec4) Load 1244(texel) + 1296: 7(fvec4) FAdd 1295 1294 + Store 1244(texel) 1296 + 1301: 1298 Load 1300(sBuffer) + 1302: 52(float) Load 128(c1) + 1303: 47(int) ConvertFToS 1302 + 1304: 1297 Image 1301 + 1305: 7(fvec4) ImageFetch 1304 1303 + 1306: 7(fvec4) Load 1244(texel) + 1307: 7(fvec4) FAdd 1306 1305 + Store 1244(texel) 1307 + 1312: 1309 Load 1311(s2DMS) + 1313: 53(fvec2) Load 148(c2) + 1314: 721(ivec2) ConvertFToS 1313 + 1315: 1308 Image 1312 + 1316: 7(fvec4) ImageFetch 1315 1314 Sample 709 + 1317: 7(fvec4) Load 1244(texel) + 1318: 7(fvec4) FAdd 1317 1316 + Store 1244(texel) 1318 + 1323: 1320 Load 1322(s2DMSArray) + 1324: 167(fvec3) Load 169(c3) + 1325: 734(ivec3) ConvertFToS 1324 + 1327: 1319 Image 1323 + 1328: 7(fvec4) ImageFetch 1327 1325 Sample 1326 + 1329: 7(fvec4) Load 1244(texel) + 1330: 7(fvec4) FAdd 1329 1328 + Store 1244(texel) 1330 + 1331: 7(fvec4) Load 1244(texel) + ReturnValue 1331 + FunctionEnd +25(testTexelFetchOffset(): 7(fvec4) Function None 8 + 26: Label + 1334(texel): 64(ptr) Variable Function + Store 1334(texel) 121 + 1335: 123 Load 125(s1D) + 1336: 52(float) Load 128(c1) + 1337: 47(int) ConvertFToS 1336 + 1338: 52(float) Load 565(lod) + 1339: 47(int) ConvertFToS 1338 + 1340: 122 Image 1335 + 1341: 7(fvec4) ImageFetch 1340 1337 Lod ConstOffset 1339 709 + 1342: 7(fvec4) Load 1334(texel) + 1343: 7(fvec4) FAdd 1342 1341 + Store 1334(texel) 1343 + 1344: 143 Load 145(s2D) + 1345: 53(fvec2) Load 148(c2) + 1346: 721(ivec2) ConvertFToS 1345 + 1347: 52(float) Load 565(lod) + 1348: 47(int) ConvertFToS 1347 + 1349: 142 Image 1344 + 1350: 7(fvec4) ImageFetch 1349 1346 Lod ConstOffset 1348 722 + 1351: 7(fvec4) Load 1334(texel) + 1352: 7(fvec4) FAdd 1351 1350 + Store 1334(texel) 1352 + 1353: 163 Load 165(s3D) + 1354: 167(fvec3) Load 169(c3) + 1355: 734(ivec3) ConvertFToS 1354 + 1356: 52(float) Load 565(lod) + 1357: 47(int) ConvertFToS 1356 + 1358: 162 Image 1353 + 1359: 7(fvec4) ImageFetch 1358 1355 Lod ConstOffset 1357 735 + 1360: 7(fvec4) Load 1334(texel) + 1361: 7(fvec4) FAdd 1360 1359 + Store 1334(texel) 1361 + 1362: 357 Load 359(s2DRect) + 1363: 53(fvec2) Load 148(c2) + 1364: 721(ivec2) ConvertFToS 1363 + 1365: 356 Image 1362 + 1366: 7(fvec4) ImageFetch 1365 1364 ConstOffset 722 + 1367: 7(fvec4) Load 1334(texel) + 1368: 7(fvec4) FAdd 1367 1366 + Store 1334(texel) 1368 + 1369: 269 Load 271(s1DArray) + 1370: 53(fvec2) Load 148(c2) + 1371: 721(ivec2) ConvertFToS 1370 + 1372: 52(float) Load 565(lod) + 1373: 47(int) ConvertFToS 1372 + 1374: 268 Image 1369 + 1375: 7(fvec4) ImageFetch 1374 1371 Lod ConstOffset 1373 709 + 1376: 7(fvec4) Load 1334(texel) + 1377: 7(fvec4) FAdd 1376 1375 + Store 1334(texel) 1377 + 1378: 284 Load 286(s2DArray) + 1379: 167(fvec3) Load 169(c3) + 1380: 734(ivec3) ConvertFToS 1379 + 1381: 52(float) Load 565(lod) + 1382: 47(int) ConvertFToS 1381 + 1383: 283 Image 1378 + 1384: 7(fvec4) ImageFetch 1383 1380 Lod ConstOffset 1382 722 + 1385: 7(fvec4) Load 1334(texel) + 1386: 7(fvec4) FAdd 1385 1384 + Store 1334(texel) 1386 + 1387: 7(fvec4) Load 1334(texel) + ReturnValue 1387 + FunctionEnd +27(testTextureGrad(): 7(fvec4) Function None 8 + 28: Label + 1390(texel): 64(ptr) Variable Function + Store 1390(texel) 121 + 1391: 123 Load 125(s1D) + 1392: 52(float) Load 128(c1) + 1394: 52(float) Load 1393(dPdxy1) + 1395: 52(float) Load 1393(dPdxy1) + 1396: 7(fvec4) ImageSampleExplicitLod 1391 1392 Grad 1394 1395 + 1397: 7(fvec4) Load 1390(texel) + 1398: 7(fvec4) FAdd 1397 1396 + Store 1390(texel) 1398 + 1399: 123 Load 125(s1D) + 1400: 6(float) Load 135(f16c1) + 1402: 6(float) Load 1401(f16dPdxy1) + 1403: 6(float) Load 1401(f16dPdxy1) + 1404: 7(fvec4) ImageSampleExplicitLod 1399 1400 Grad 1402 1403 + 1405: 7(fvec4) Load 1390(texel) + 1406: 7(fvec4) FAdd 1405 1404 + Store 1390(texel) 1406 + 1407: 143 Load 145(s2D) + 1408: 53(fvec2) Load 148(c2) + 1410: 53(fvec2) Load 1409(dPdxy2) + 1411: 53(fvec2) Load 1409(dPdxy2) + 1412: 7(fvec4) ImageSampleExplicitLod 1407 1408 Grad 1410 1411 + 1413: 7(fvec4) Load 1390(texel) + 1414: 7(fvec4) FAdd 1413 1412 + Store 1390(texel) 1414 + 1415: 143 Load 145(s2D) + 1416: 154(fvec2) Load 156(f16c2) + 1418: 154(fvec2) Load 1417(f16dPdxy2) + 1419: 154(fvec2) Load 1417(f16dPdxy2) + 1420: 7(fvec4) ImageSampleExplicitLod 1415 1416 Grad 1418 1419 + 1421: 7(fvec4) Load 1390(texel) + 1422: 7(fvec4) FAdd 1421 1420 + Store 1390(texel) 1422 + 1423: 163 Load 165(s3D) + 1424: 167(fvec3) Load 169(c3) + 1426: 167(fvec3) Load 1425(dPdxy3) + 1427: 167(fvec3) Load 1425(dPdxy3) + 1428: 7(fvec4) ImageSampleExplicitLod 1423 1424 Grad 1426 1427 + 1429: 7(fvec4) Load 1390(texel) + 1430: 7(fvec4) FAdd 1429 1428 + Store 1390(texel) 1430 + 1431: 163 Load 165(s3D) + 1432: 175(fvec3) Load 177(f16c3) + 1434: 175(fvec3) Load 1433(f16dPdxy3) + 1435: 175(fvec3) Load 1433(f16dPdxy3) + 1436: 7(fvec4) ImageSampleExplicitLod 1431 1432 Grad 1434 1435 + 1437: 7(fvec4) Load 1390(texel) + 1438: 7(fvec4) FAdd 1437 1436 + Store 1390(texel) 1438 + 1439: 184 Load 186(sCube) + 1440: 167(fvec3) Load 169(c3) + 1441: 167(fvec3) Load 1425(dPdxy3) + 1442: 167(fvec3) Load 1425(dPdxy3) + 1443: 7(fvec4) ImageSampleExplicitLod 1439 1440 Grad 1441 1442 + 1444: 7(fvec4) Load 1390(texel) + 1445: 7(fvec4) FAdd 1444 1443 + Store 1390(texel) 1445 + 1446: 184 Load 186(sCube) + 1447: 175(fvec3) Load 177(f16c3) + 1448: 175(fvec3) Load 1433(f16dPdxy3) + 1449: 175(fvec3) Load 1433(f16dPdxy3) + 1450: 7(fvec4) ImageSampleExplicitLod 1446 1447 Grad 1448 1449 + 1451: 7(fvec4) Load 1390(texel) + 1452: 7(fvec4) FAdd 1451 1450 + Store 1390(texel) 1452 + 1453: 357 Load 359(s2DRect) + 1454: 53(fvec2) Load 148(c2) + 1455: 53(fvec2) Load 1409(dPdxy2) + 1456: 53(fvec2) Load 1409(dPdxy2) + 1457: 7(fvec4) ImageSampleExplicitLod 1453 1454 Grad 1455 1456 + 1458: 7(fvec4) Load 1390(texel) + 1459: 7(fvec4) FAdd 1458 1457 + Store 1390(texel) 1459 + 1460: 357 Load 359(s2DRect) + 1461: 154(fvec2) Load 156(f16c2) + 1462: 154(fvec2) Load 1417(f16dPdxy2) + 1463: 154(fvec2) Load 1417(f16dPdxy2) + 1464: 7(fvec4) ImageSampleExplicitLod 1460 1461 Grad 1462 1463 + 1465: 7(fvec4) Load 1390(texel) + 1466: 7(fvec4) FAdd 1465 1464 + Store 1390(texel) 1466 + 1467: 371 Load 373(s2DRectShadow) + 1468: 167(fvec3) Load 169(c3) + 1469: 53(fvec2) Load 1409(dPdxy2) + 1470: 53(fvec2) Load 1409(dPdxy2) + 1471: 52(float) CompositeExtract 1468 2 + 1472: 6(float) ImageSampleDrefExplicitLod 1467 1468 1471 Grad 1469 1470 + 1473: 208(ptr) AccessChain 1390(texel) 207 + 1474: 6(float) Load 1473 + 1475: 6(float) FAdd 1474 1472 + 1476: 208(ptr) AccessChain 1390(texel) 207 + Store 1476 1475 + 1477: 371 Load 373(s2DRectShadow) + 1478: 154(fvec2) Load 156(f16c2) + 1479: 52(float) Load 215(compare) + 1480: 154(fvec2) Load 1417(f16dPdxy2) + 1481: 154(fvec2) Load 1417(f16dPdxy2) + 1482: 6(float) ImageSampleDrefExplicitLod 1477 1478 1479 Grad 1480 1481 + 1483: 208(ptr) AccessChain 1390(texel) 207 + 1484: 6(float) Load 1483 + 1485: 6(float) FAdd 1484 1482 + 1486: 208(ptr) AccessChain 1390(texel) 207 + Store 1486 1485 + 1487: 199 Load 201(s1DShadow) + 1488: 167(fvec3) Load 169(c3) + 1489: 52(float) Load 1393(dPdxy1) + 1490: 52(float) Load 1393(dPdxy1) + 1491: 52(float) CompositeExtract 1488 2 + 1492: 6(float) ImageSampleDrefExplicitLod 1487 1488 1491 Grad 1489 1490 + 1493: 208(ptr) AccessChain 1390(texel) 207 + 1494: 6(float) Load 1493 + 1495: 6(float) FAdd 1494 1492 + 1496: 208(ptr) AccessChain 1390(texel) 207 + Store 1496 1495 + 1497: 199 Load 201(s1DShadow) + 1498: 154(fvec2) Load 156(f16c2) + 1499: 52(float) Load 215(compare) + 1500: 6(float) Load 1401(f16dPdxy1) + 1501: 6(float) Load 1401(f16dPdxy1) + 1502: 6(float) ImageSampleDrefExplicitLod 1497 1498 1499 Grad 1500 1501 + 1503: 208(ptr) AccessChain 1390(texel) 207 + 1504: 6(float) Load 1503 + 1505: 6(float) FAdd 1504 1502 + 1506: 208(ptr) AccessChain 1390(texel) 207 + Store 1506 1505 + 1507: 224 Load 226(s2DShadow) + 1508: 167(fvec3) Load 169(c3) + 1509: 53(fvec2) Load 1409(dPdxy2) + 1510: 53(fvec2) Load 1409(dPdxy2) + 1511: 52(float) CompositeExtract 1508 2 + 1512: 6(float) ImageSampleDrefExplicitLod 1507 1508 1511 Grad 1509 1510 + 1513: 208(ptr) AccessChain 1390(texel) 207 + 1514: 6(float) Load 1513 + 1515: 6(float) FAdd 1514 1512 + 1516: 208(ptr) AccessChain 1390(texel) 207 + Store 1516 1515 + 1517: 224 Load 226(s2DShadow) + 1518: 154(fvec2) Load 156(f16c2) + 1519: 52(float) Load 215(compare) + 1520: 154(fvec2) Load 1417(f16dPdxy2) + 1521: 154(fvec2) Load 1417(f16dPdxy2) + 1522: 6(float) ImageSampleDrefExplicitLod 1517 1518 1519 Grad 1520 1521 + 1523: 208(ptr) AccessChain 1390(texel) 207 + 1524: 6(float) Load 1523 + 1525: 6(float) FAdd 1524 1522 + 1526: 208(ptr) AccessChain 1390(texel) 207 + Store 1526 1525 + 1527: 245 Load 247(sCubeShadow) + 1528: 249(fvec4) Load 251(c4) + 1529: 167(fvec3) Load 1425(dPdxy3) + 1530: 167(fvec3) Load 1425(dPdxy3) + 1531: 52(float) CompositeExtract 1528 3 + 1532: 6(float) ImageSampleDrefExplicitLod 1527 1528 1531 Grad 1529 1530 + 1533: 208(ptr) AccessChain 1390(texel) 207 + 1534: 6(float) Load 1533 + 1535: 6(float) FAdd 1534 1532 + 1536: 208(ptr) AccessChain 1390(texel) 207 + Store 1536 1535 + 1537: 245 Load 247(sCubeShadow) + 1538: 175(fvec3) Load 177(f16c3) + 1539: 52(float) Load 215(compare) + 1540: 175(fvec3) Load 1433(f16dPdxy3) + 1541: 175(fvec3) Load 1433(f16dPdxy3) + 1542: 6(float) ImageSampleDrefExplicitLod 1537 1538 1539 Grad 1540 1541 + 1543: 208(ptr) AccessChain 1390(texel) 207 + 1544: 6(float) Load 1543 + 1545: 6(float) FAdd 1544 1542 + 1546: 208(ptr) AccessChain 1390(texel) 207 + Store 1546 1545 + 1547: 269 Load 271(s1DArray) + 1548: 53(fvec2) Load 148(c2) + 1549: 52(float) Load 1393(dPdxy1) + 1550: 52(float) Load 1393(dPdxy1) + 1551: 7(fvec4) ImageSampleExplicitLod 1547 1548 Grad 1549 1550 + 1552: 7(fvec4) Load 1390(texel) + 1553: 7(fvec4) FAdd 1552 1551 + Store 1390(texel) 1553 + 1554: 269 Load 271(s1DArray) + 1555: 154(fvec2) Load 156(f16c2) + 1556: 6(float) Load 1401(f16dPdxy1) + 1557: 6(float) Load 1401(f16dPdxy1) + 1558: 7(fvec4) ImageSampleExplicitLod 1554 1555 Grad 1556 1557 + 1559: 7(fvec4) Load 1390(texel) + 1560: 7(fvec4) FAdd 1559 1558 + Store 1390(texel) 1560 + 1561: 284 Load 286(s2DArray) + 1562: 167(fvec3) Load 169(c3) + 1563: 53(fvec2) Load 1409(dPdxy2) + 1564: 53(fvec2) Load 1409(dPdxy2) + 1565: 7(fvec4) ImageSampleExplicitLod 1561 1562 Grad 1563 1564 + 1566: 7(fvec4) Load 1390(texel) + 1567: 7(fvec4) FAdd 1566 1565 + Store 1390(texel) 1567 + 1568: 284 Load 286(s2DArray) + 1569: 175(fvec3) Load 177(f16c3) + 1570: 154(fvec2) Load 1417(f16dPdxy2) + 1571: 154(fvec2) Load 1417(f16dPdxy2) + 1572: 7(fvec4) ImageSampleExplicitLod 1568 1569 Grad 1570 1571 + 1573: 7(fvec4) Load 1390(texel) + 1574: 7(fvec4) FAdd 1573 1572 + Store 1390(texel) 1574 + 1575: 316 Load 318(s1DArrayShadow) + 1576: 167(fvec3) Load 169(c3) + 1577: 52(float) Load 1393(dPdxy1) + 1578: 52(float) Load 1393(dPdxy1) + 1579: 52(float) CompositeExtract 1576 2 + 1580: 6(float) ImageSampleDrefExplicitLod 1575 1576 1579 Grad 1577 1578 + 1581: 208(ptr) AccessChain 1390(texel) 207 + 1582: 6(float) Load 1581 + 1583: 6(float) FAdd 1582 1580 + 1584: 208(ptr) AccessChain 1390(texel) 207 + Store 1584 1583 + 1585: 316 Load 318(s1DArrayShadow) + 1586: 154(fvec2) Load 156(f16c2) + 1587: 52(float) Load 215(compare) + 1588: 6(float) Load 1401(f16dPdxy1) + 1589: 6(float) Load 1401(f16dPdxy1) + 1590: 6(float) ImageSampleDrefExplicitLod 1585 1586 1587 Grad 1588 1589 + 1591: 208(ptr) AccessChain 1390(texel) 207 + 1592: 6(float) Load 1591 + 1593: 6(float) FAdd 1592 1590 + 1594: 208(ptr) AccessChain 1390(texel) 207 + Store 1594 1593 + 1595: 337 Load 339(s2DArrayShadow) + 1596: 249(fvec4) Load 251(c4) + 1597: 53(fvec2) Load 1409(dPdxy2) + 1598: 53(fvec2) Load 1409(dPdxy2) + 1599: 52(float) CompositeExtract 1596 3 + 1600: 6(float) ImageSampleDrefExplicitLod 1595 1596 1599 Grad 1597 1598 + 1601: 208(ptr) AccessChain 1390(texel) 207 + 1602: 6(float) Load 1601 + 1603: 6(float) FAdd 1602 1600 + 1604: 208(ptr) AccessChain 1390(texel) 207 + Store 1604 1603 + 1605: 337 Load 339(s2DArrayShadow) + 1606: 175(fvec3) Load 177(f16c3) + 1607: 52(float) Load 215(compare) + 1608: 154(fvec2) Load 1417(f16dPdxy2) + 1609: 154(fvec2) Load 1417(f16dPdxy2) + 1610: 6(float) ImageSampleDrefExplicitLod 1605 1606 1607 Grad 1608 1609 + 1611: 208(ptr) AccessChain 1390(texel) 207 + 1612: 6(float) Load 1611 + 1613: 6(float) FAdd 1612 1610 + 1614: 208(ptr) AccessChain 1390(texel) 207 + Store 1614 1613 + 1615: 299 Load 301(sCubeArray) + 1616: 249(fvec4) Load 251(c4) + 1617: 167(fvec3) Load 1425(dPdxy3) + 1618: 167(fvec3) Load 1425(dPdxy3) + 1619: 7(fvec4) ImageSampleExplicitLod 1615 1616 Grad 1617 1618 + 1620: 7(fvec4) Load 1390(texel) + 1621: 7(fvec4) FAdd 1620 1619 + Store 1390(texel) 1621 + 1622: 299 Load 301(sCubeArray) + 1623: 7(fvec4) Load 309(f16c4) + 1624: 175(fvec3) Load 1433(f16dPdxy3) + 1625: 175(fvec3) Load 1433(f16dPdxy3) + 1626: 7(fvec4) ImageSampleExplicitLod 1622 1623 Grad 1624 1625 + 1627: 7(fvec4) Load 1390(texel) + 1628: 7(fvec4) FAdd 1627 1626 + Store 1390(texel) 1628 + 1629: 7(fvec4) Load 1390(texel) + ReturnValue 1629 + FunctionEnd +29(testTextureGradOffset(): 7(fvec4) Function None 8 + 30: Label + 1632(texel): 64(ptr) Variable Function + Store 1632(texel) 121 + 1633: 123 Load 125(s1D) + 1634: 52(float) Load 128(c1) + 1635: 52(float) Load 1393(dPdxy1) + 1636: 52(float) Load 1393(dPdxy1) + 1637: 7(fvec4) ImageSampleExplicitLod 1633 1634 Grad ConstOffset 1635 1636 709 + 1638: 7(fvec4) Load 1632(texel) + 1639: 7(fvec4) FAdd 1638 1637 + Store 1632(texel) 1639 + 1640: 123 Load 125(s1D) + 1641: 6(float) Load 135(f16c1) + 1642: 6(float) Load 1401(f16dPdxy1) + 1643: 6(float) Load 1401(f16dPdxy1) + 1644: 7(fvec4) ImageSampleExplicitLod 1640 1641 Grad ConstOffset 1642 1643 709 + 1645: 7(fvec4) Load 1632(texel) + 1646: 7(fvec4) FAdd 1645 1644 + Store 1632(texel) 1646 + 1647: 143 Load 145(s2D) + 1648: 53(fvec2) Load 148(c2) + 1649: 53(fvec2) Load 1409(dPdxy2) + 1650: 53(fvec2) Load 1409(dPdxy2) + 1651: 7(fvec4) ImageSampleExplicitLod 1647 1648 Grad ConstOffset 1649 1650 722 + 1652: 7(fvec4) Load 1632(texel) + 1653: 7(fvec4) FAdd 1652 1651 + Store 1632(texel) 1653 + 1654: 143 Load 145(s2D) + 1655: 154(fvec2) Load 156(f16c2) + 1656: 154(fvec2) Load 1417(f16dPdxy2) + 1657: 154(fvec2) Load 1417(f16dPdxy2) + 1658: 7(fvec4) ImageSampleExplicitLod 1654 1655 Grad ConstOffset 1656 1657 722 + 1659: 7(fvec4) Load 1632(texel) + 1660: 7(fvec4) FAdd 1659 1658 + Store 1632(texel) 1660 + 1661: 163 Load 165(s3D) + 1662: 167(fvec3) Load 169(c3) + 1663: 167(fvec3) Load 1425(dPdxy3) + 1664: 167(fvec3) Load 1425(dPdxy3) + 1665: 7(fvec4) ImageSampleExplicitLod 1661 1662 Grad ConstOffset 1663 1664 735 + 1666: 7(fvec4) Load 1632(texel) + 1667: 7(fvec4) FAdd 1666 1665 + Store 1632(texel) 1667 + 1668: 163 Load 165(s3D) + 1669: 175(fvec3) Load 177(f16c3) + 1670: 175(fvec3) Load 1433(f16dPdxy3) + 1671: 175(fvec3) Load 1433(f16dPdxy3) + 1672: 7(fvec4) ImageSampleExplicitLod 1668 1669 Grad ConstOffset 1670 1671 735 + 1673: 7(fvec4) Load 1632(texel) + 1674: 7(fvec4) FAdd 1673 1672 + Store 1632(texel) 1674 + 1675: 357 Load 359(s2DRect) + 1676: 53(fvec2) Load 148(c2) + 1677: 53(fvec2) Load 1409(dPdxy2) + 1678: 53(fvec2) Load 1409(dPdxy2) + 1679: 7(fvec4) ImageSampleExplicitLod 1675 1676 Grad ConstOffset 1677 1678 722 + 1680: 7(fvec4) Load 1632(texel) + 1681: 7(fvec4) FAdd 1680 1679 + Store 1632(texel) 1681 + 1682: 357 Load 359(s2DRect) + 1683: 154(fvec2) Load 156(f16c2) + 1684: 154(fvec2) Load 1417(f16dPdxy2) + 1685: 154(fvec2) Load 1417(f16dPdxy2) + 1686: 7(fvec4) ImageSampleExplicitLod 1682 1683 Grad ConstOffset 1684 1685 722 + 1687: 7(fvec4) Load 1632(texel) + 1688: 7(fvec4) FAdd 1687 1686 + Store 1632(texel) 1688 + 1689: 371 Load 373(s2DRectShadow) + 1690: 167(fvec3) Load 169(c3) + 1691: 53(fvec2) Load 1409(dPdxy2) + 1692: 53(fvec2) Load 1409(dPdxy2) + 1693: 52(float) CompositeExtract 1690 2 + 1694: 6(float) ImageSampleDrefExplicitLod 1689 1690 1693 Grad ConstOffset 1691 1692 722 + 1695: 208(ptr) AccessChain 1632(texel) 207 + 1696: 6(float) Load 1695 + 1697: 6(float) FAdd 1696 1694 + 1698: 208(ptr) AccessChain 1632(texel) 207 + Store 1698 1697 + 1699: 371 Load 373(s2DRectShadow) + 1700: 154(fvec2) Load 156(f16c2) + 1701: 52(float) Load 215(compare) + 1702: 154(fvec2) Load 1417(f16dPdxy2) + 1703: 154(fvec2) Load 1417(f16dPdxy2) + 1704: 6(float) ImageSampleDrefExplicitLod 1699 1700 1701 Grad ConstOffset 1702 1703 722 + 1705: 208(ptr) AccessChain 1632(texel) 207 + 1706: 6(float) Load 1705 + 1707: 6(float) FAdd 1706 1704 + 1708: 208(ptr) AccessChain 1632(texel) 207 + Store 1708 1707 + 1709: 199 Load 201(s1DShadow) + 1710: 167(fvec3) Load 169(c3) + 1711: 52(float) Load 1393(dPdxy1) + 1712: 52(float) Load 1393(dPdxy1) + 1713: 52(float) CompositeExtract 1710 2 + 1714: 6(float) ImageSampleDrefExplicitLod 1709 1710 1713 Grad ConstOffset 1711 1712 709 + 1715: 208(ptr) AccessChain 1632(texel) 207 + 1716: 6(float) Load 1715 + 1717: 6(float) FAdd 1716 1714 + 1718: 208(ptr) AccessChain 1632(texel) 207 + Store 1718 1717 + 1719: 199 Load 201(s1DShadow) + 1720: 154(fvec2) Load 156(f16c2) + 1721: 52(float) Load 215(compare) + 1722: 6(float) Load 1401(f16dPdxy1) + 1723: 6(float) Load 1401(f16dPdxy1) + 1724: 6(float) ImageSampleDrefExplicitLod 1719 1720 1721 Grad ConstOffset 1722 1723 709 + 1725: 208(ptr) AccessChain 1632(texel) 207 + 1726: 6(float) Load 1725 + 1727: 6(float) FAdd 1726 1724 + 1728: 208(ptr) AccessChain 1632(texel) 207 + Store 1728 1727 + 1729: 224 Load 226(s2DShadow) + 1730: 167(fvec3) Load 169(c3) + 1731: 53(fvec2) Load 1409(dPdxy2) + 1732: 53(fvec2) Load 1409(dPdxy2) + 1733: 52(float) CompositeExtract 1730 2 + 1734: 6(float) ImageSampleDrefExplicitLod 1729 1730 1733 Grad ConstOffset 1731 1732 722 + 1735: 208(ptr) AccessChain 1632(texel) 207 + 1736: 6(float) Load 1735 + 1737: 6(float) FAdd 1736 1734 + 1738: 208(ptr) AccessChain 1632(texel) 207 + Store 1738 1737 + 1739: 224 Load 226(s2DShadow) + 1740: 154(fvec2) Load 156(f16c2) + 1741: 52(float) Load 215(compare) + 1742: 154(fvec2) Load 1417(f16dPdxy2) + 1743: 154(fvec2) Load 1417(f16dPdxy2) + 1744: 6(float) ImageSampleDrefExplicitLod 1739 1740 1741 Grad ConstOffset 1742 1743 722 + 1745: 208(ptr) AccessChain 1632(texel) 207 + 1746: 6(float) Load 1745 + 1747: 6(float) FAdd 1746 1744 + 1748: 208(ptr) AccessChain 1632(texel) 207 + Store 1748 1747 + 1749: 269 Load 271(s1DArray) + 1750: 53(fvec2) Load 148(c2) + 1751: 52(float) Load 1393(dPdxy1) + 1752: 52(float) Load 1393(dPdxy1) + 1753: 7(fvec4) ImageSampleExplicitLod 1749 1750 Grad ConstOffset 1751 1752 709 + 1754: 7(fvec4) Load 1632(texel) + 1755: 7(fvec4) FAdd 1754 1753 + Store 1632(texel) 1755 + 1756: 269 Load 271(s1DArray) + 1757: 154(fvec2) Load 156(f16c2) + 1758: 6(float) Load 1401(f16dPdxy1) + 1759: 6(float) Load 1401(f16dPdxy1) + 1760: 7(fvec4) ImageSampleExplicitLod 1756 1757 Grad ConstOffset 1758 1759 709 + 1761: 7(fvec4) Load 1632(texel) + 1762: 7(fvec4) FAdd 1761 1760 + Store 1632(texel) 1762 + 1763: 284 Load 286(s2DArray) + 1764: 167(fvec3) Load 169(c3) + 1765: 53(fvec2) Load 1409(dPdxy2) + 1766: 53(fvec2) Load 1409(dPdxy2) + 1767: 7(fvec4) ImageSampleExplicitLod 1763 1764 Grad ConstOffset 1765 1766 722 + 1768: 7(fvec4) Load 1632(texel) + 1769: 7(fvec4) FAdd 1768 1767 + Store 1632(texel) 1769 + 1770: 284 Load 286(s2DArray) + 1771: 175(fvec3) Load 177(f16c3) + 1772: 154(fvec2) Load 1417(f16dPdxy2) + 1773: 154(fvec2) Load 1417(f16dPdxy2) + 1774: 7(fvec4) ImageSampleExplicitLod 1770 1771 Grad ConstOffset 1772 1773 722 + 1775: 7(fvec4) Load 1632(texel) + 1776: 7(fvec4) FAdd 1775 1774 + Store 1632(texel) 1776 + 1777: 316 Load 318(s1DArrayShadow) + 1778: 167(fvec3) Load 169(c3) + 1779: 52(float) Load 1393(dPdxy1) + 1780: 52(float) Load 1393(dPdxy1) + 1781: 52(float) CompositeExtract 1778 2 + 1782: 6(float) ImageSampleDrefExplicitLod 1777 1778 1781 Grad ConstOffset 1779 1780 709 + 1783: 208(ptr) AccessChain 1632(texel) 207 + 1784: 6(float) Load 1783 + 1785: 6(float) FAdd 1784 1782 + 1786: 208(ptr) AccessChain 1632(texel) 207 + Store 1786 1785 + 1787: 316 Load 318(s1DArrayShadow) + 1788: 154(fvec2) Load 156(f16c2) + 1789: 52(float) Load 215(compare) + 1790: 6(float) Load 1401(f16dPdxy1) + 1791: 6(float) Load 1401(f16dPdxy1) + 1792: 6(float) ImageSampleDrefExplicitLod 1787 1788 1789 Grad ConstOffset 1790 1791 709 + 1793: 208(ptr) AccessChain 1632(texel) 207 + 1794: 6(float) Load 1793 + 1795: 6(float) FAdd 1794 1792 + 1796: 208(ptr) AccessChain 1632(texel) 207 + Store 1796 1795 + 1797: 337 Load 339(s2DArrayShadow) + 1798: 249(fvec4) Load 251(c4) + 1799: 53(fvec2) Load 1409(dPdxy2) + 1800: 53(fvec2) Load 1409(dPdxy2) + 1801: 52(float) CompositeExtract 1798 3 + 1802: 6(float) ImageSampleDrefExplicitLod 1797 1798 1801 Grad ConstOffset 1799 1800 722 + 1803: 208(ptr) AccessChain 1632(texel) 207 + 1804: 6(float) Load 1803 + 1805: 6(float) FAdd 1804 1802 + 1806: 208(ptr) AccessChain 1632(texel) 207 + Store 1806 1805 + 1807: 337 Load 339(s2DArrayShadow) + 1808: 175(fvec3) Load 177(f16c3) + 1809: 52(float) Load 215(compare) + 1810: 154(fvec2) Load 1417(f16dPdxy2) + 1811: 154(fvec2) Load 1417(f16dPdxy2) + 1812: 6(float) ImageSampleDrefExplicitLod 1807 1808 1809 Grad ConstOffset 1810 1811 722 + 1813: 208(ptr) AccessChain 1632(texel) 207 + 1814: 6(float) Load 1813 + 1815: 6(float) FAdd 1814 1812 + 1816: 208(ptr) AccessChain 1632(texel) 207 + Store 1816 1815 + 1817: 7(fvec4) Load 1632(texel) + ReturnValue 1817 + FunctionEnd +31(testTextureProjGrad(): 7(fvec4) Function None 8 + 32: Label + 1820(texel): 64(ptr) Variable Function + Store 1820(texel) 121 + 1821: 123 Load 125(s1D) + 1822: 53(fvec2) Load 148(c2) + 1823: 52(float) Load 1393(dPdxy1) + 1824: 52(float) Load 1393(dPdxy1) + 1825: 7(fvec4) ImageSampleProjExplicitLod 1821 1822 Grad 1823 1824 + 1826: 7(fvec4) Load 1820(texel) + 1827: 7(fvec4) FAdd 1826 1825 + Store 1820(texel) 1827 + 1828: 123 Load 125(s1D) + 1829: 154(fvec2) Load 156(f16c2) + 1830: 6(float) Load 1401(f16dPdxy1) + 1831: 6(float) Load 1401(f16dPdxy1) + 1832: 7(fvec4) ImageSampleProjExplicitLod 1828 1829 Grad 1830 1831 + 1833: 7(fvec4) Load 1820(texel) + 1834: 7(fvec4) FAdd 1833 1832 + Store 1820(texel) 1834 + 1835: 123 Load 125(s1D) + 1836: 249(fvec4) Load 251(c4) + 1837: 52(float) Load 1393(dPdxy1) + 1838: 52(float) Load 1393(dPdxy1) + 1839: 52(float) CompositeExtract 1836 3 + 1840: 249(fvec4) CompositeInsert 1839 1836 1 + 1841: 7(fvec4) ImageSampleProjExplicitLod 1835 1840 Grad 1837 1838 + 1842: 7(fvec4) Load 1820(texel) + 1843: 7(fvec4) FAdd 1842 1841 + Store 1820(texel) 1843 + 1844: 123 Load 125(s1D) + 1845: 7(fvec4) Load 309(f16c4) + 1846: 6(float) Load 1401(f16dPdxy1) + 1847: 6(float) Load 1401(f16dPdxy1) + 1848: 6(float) CompositeExtract 1845 3 + 1849: 7(fvec4) CompositeInsert 1848 1845 1 + 1850: 7(fvec4) ImageSampleProjExplicitLod 1844 1849 Grad 1846 1847 + 1851: 7(fvec4) Load 1820(texel) + 1852: 7(fvec4) FAdd 1851 1850 + Store 1820(texel) 1852 + 1853: 143 Load 145(s2D) + 1854: 167(fvec3) Load 169(c3) + 1855: 53(fvec2) Load 1409(dPdxy2) + 1856: 53(fvec2) Load 1409(dPdxy2) + 1857: 7(fvec4) ImageSampleProjExplicitLod 1853 1854 Grad 1855 1856 + 1858: 7(fvec4) Load 1820(texel) + 1859: 7(fvec4) FAdd 1858 1857 + Store 1820(texel) 1859 + 1860: 143 Load 145(s2D) + 1861: 175(fvec3) Load 177(f16c3) + 1862: 154(fvec2) Load 1417(f16dPdxy2) + 1863: 154(fvec2) Load 1417(f16dPdxy2) + 1864: 7(fvec4) ImageSampleProjExplicitLod 1860 1861 Grad 1862 1863 + 1865: 7(fvec4) Load 1820(texel) + 1866: 7(fvec4) FAdd 1865 1864 + Store 1820(texel) 1866 + 1867: 143 Load 145(s2D) + 1868: 249(fvec4) Load 251(c4) + 1869: 53(fvec2) Load 1409(dPdxy2) + 1870: 53(fvec2) Load 1409(dPdxy2) + 1871: 52(float) CompositeExtract 1868 3 + 1872: 249(fvec4) CompositeInsert 1871 1868 2 + 1873: 7(fvec4) ImageSampleProjExplicitLod 1867 1872 Grad 1869 1870 + 1874: 7(fvec4) Load 1820(texel) + 1875: 7(fvec4) FAdd 1874 1873 + Store 1820(texel) 1875 + 1876: 143 Load 145(s2D) + 1877: 7(fvec4) Load 309(f16c4) + 1878: 154(fvec2) Load 1417(f16dPdxy2) + 1879: 154(fvec2) Load 1417(f16dPdxy2) + 1880: 6(float) CompositeExtract 1877 3 + 1881: 7(fvec4) CompositeInsert 1880 1877 2 + 1882: 7(fvec4) ImageSampleProjExplicitLod 1876 1881 Grad 1878 1879 + 1883: 7(fvec4) Load 1820(texel) + 1884: 7(fvec4) FAdd 1883 1882 + Store 1820(texel) 1884 + 1885: 163 Load 165(s3D) + 1886: 249(fvec4) Load 251(c4) + 1887: 167(fvec3) Load 1425(dPdxy3) + 1888: 167(fvec3) Load 1425(dPdxy3) + 1889: 7(fvec4) ImageSampleProjExplicitLod 1885 1886 Grad 1887 1888 + 1890: 7(fvec4) Load 1820(texel) + 1891: 7(fvec4) FAdd 1890 1889 + Store 1820(texel) 1891 + 1892: 163 Load 165(s3D) + 1893: 7(fvec4) Load 309(f16c4) + 1894: 175(fvec3) Load 1433(f16dPdxy3) + 1895: 175(fvec3) Load 1433(f16dPdxy3) + 1896: 7(fvec4) ImageSampleProjExplicitLod 1892 1893 Grad 1894 1895 + 1897: 7(fvec4) Load 1820(texel) + 1898: 7(fvec4) FAdd 1897 1896 + Store 1820(texel) 1898 + 1899: 357 Load 359(s2DRect) + 1900: 167(fvec3) Load 169(c3) + 1901: 53(fvec2) Load 1409(dPdxy2) + 1902: 53(fvec2) Load 1409(dPdxy2) + 1903: 7(fvec4) ImageSampleProjExplicitLod 1899 1900 Grad 1901 1902 + 1904: 7(fvec4) Load 1820(texel) + 1905: 7(fvec4) FAdd 1904 1903 + Store 1820(texel) 1905 + 1906: 357 Load 359(s2DRect) + 1907: 175(fvec3) Load 177(f16c3) + 1908: 154(fvec2) Load 1417(f16dPdxy2) + 1909: 154(fvec2) Load 1417(f16dPdxy2) + 1910: 7(fvec4) ImageSampleProjExplicitLod 1906 1907 Grad 1908 1909 + 1911: 7(fvec4) Load 1820(texel) + 1912: 7(fvec4) FAdd 1911 1910 + Store 1820(texel) 1912 + 1913: 357 Load 359(s2DRect) + 1914: 249(fvec4) Load 251(c4) + 1915: 53(fvec2) Load 1409(dPdxy2) + 1916: 53(fvec2) Load 1409(dPdxy2) + 1917: 52(float) CompositeExtract 1914 3 + 1918: 249(fvec4) CompositeInsert 1917 1914 2 + 1919: 7(fvec4) ImageSampleProjExplicitLod 1913 1918 Grad 1915 1916 + 1920: 7(fvec4) Load 1820(texel) + 1921: 7(fvec4) FAdd 1920 1919 + Store 1820(texel) 1921 + 1922: 357 Load 359(s2DRect) + 1923: 7(fvec4) Load 309(f16c4) + 1924: 154(fvec2) Load 1417(f16dPdxy2) + 1925: 154(fvec2) Load 1417(f16dPdxy2) + 1926: 6(float) CompositeExtract 1923 3 + 1927: 7(fvec4) CompositeInsert 1926 1923 2 + 1928: 7(fvec4) ImageSampleProjExplicitLod 1922 1927 Grad 1924 1925 + 1929: 7(fvec4) Load 1820(texel) + 1930: 7(fvec4) FAdd 1929 1928 + Store 1820(texel) 1930 + 1931: 371 Load 373(s2DRectShadow) + 1932: 249(fvec4) Load 251(c4) + 1933: 53(fvec2) Load 1409(dPdxy2) + 1934: 53(fvec2) Load 1409(dPdxy2) + 1935: 52(float) CompositeExtract 1932 2 + 1936: 52(float) CompositeExtract 1932 3 + 1937: 249(fvec4) CompositeInsert 1936 1932 2 + 1938: 6(float) ImageSampleProjDrefExplicitLod 1931 1937 1935 Grad 1933 1934 + 1939: 208(ptr) AccessChain 1820(texel) 207 + 1940: 6(float) Load 1939 + 1941: 6(float) FAdd 1940 1938 + 1942: 208(ptr) AccessChain 1820(texel) 207 + Store 1942 1941 + 1943: 371 Load 373(s2DRectShadow) + 1944: 175(fvec3) Load 177(f16c3) + 1945: 52(float) Load 215(compare) + 1946: 154(fvec2) Load 1417(f16dPdxy2) + 1947: 154(fvec2) Load 1417(f16dPdxy2) + 1948: 6(float) ImageSampleProjDrefExplicitLod 1943 1944 1945 Grad 1946 1947 + 1949: 208(ptr) AccessChain 1820(texel) 207 + 1950: 6(float) Load 1949 + 1951: 6(float) FAdd 1950 1948 + 1952: 208(ptr) AccessChain 1820(texel) 207 + Store 1952 1951 + 1953: 199 Load 201(s1DShadow) + 1954: 249(fvec4) Load 251(c4) + 1955: 52(float) Load 1393(dPdxy1) + 1956: 52(float) Load 1393(dPdxy1) + 1957: 52(float) CompositeExtract 1954 2 + 1958: 52(float) CompositeExtract 1954 3 + 1959: 249(fvec4) CompositeInsert 1958 1954 1 + 1960: 6(float) ImageSampleProjDrefExplicitLod 1953 1959 1957 Grad 1955 1956 + 1961: 208(ptr) AccessChain 1820(texel) 207 + 1962: 6(float) Load 1961 + 1963: 6(float) FAdd 1962 1960 + 1964: 208(ptr) AccessChain 1820(texel) 207 + Store 1964 1963 + 1965: 199 Load 201(s1DShadow) + 1966: 175(fvec3) Load 177(f16c3) + 1967: 52(float) Load 215(compare) + 1968: 6(float) Load 1401(f16dPdxy1) + 1969: 6(float) Load 1401(f16dPdxy1) + 1970: 6(float) CompositeExtract 1966 2 + 1971: 175(fvec3) CompositeInsert 1970 1966 1 + 1972: 6(float) ImageSampleProjDrefExplicitLod 1965 1971 1967 Grad 1968 1969 + 1973: 208(ptr) AccessChain 1820(texel) 207 + 1974: 6(float) Load 1973 + 1975: 6(float) FAdd 1974 1972 + 1976: 208(ptr) AccessChain 1820(texel) 207 + Store 1976 1975 + 1977: 224 Load 226(s2DShadow) + 1978: 249(fvec4) Load 251(c4) + 1979: 53(fvec2) Load 1409(dPdxy2) + 1980: 53(fvec2) Load 1409(dPdxy2) + 1981: 52(float) CompositeExtract 1978 2 + 1982: 52(float) CompositeExtract 1978 3 + 1983: 249(fvec4) CompositeInsert 1982 1978 2 + 1984: 6(float) ImageSampleProjDrefExplicitLod 1977 1983 1981 Grad 1979 1980 + 1985: 208(ptr) AccessChain 1820(texel) 207 + 1986: 6(float) Load 1985 + 1987: 6(float) FAdd 1986 1984 + 1988: 208(ptr) AccessChain 1820(texel) 207 + Store 1988 1987 + 1989: 224 Load 226(s2DShadow) + 1990: 175(fvec3) Load 177(f16c3) + 1991: 52(float) Load 215(compare) + 1992: 154(fvec2) Load 1417(f16dPdxy2) + 1993: 154(fvec2) Load 1417(f16dPdxy2) + 1994: 6(float) ImageSampleProjDrefExplicitLod 1989 1990 1991 Grad 1992 1993 + 1995: 208(ptr) AccessChain 1820(texel) 207 + 1996: 6(float) Load 1995 + 1997: 6(float) FAdd 1996 1994 + 1998: 208(ptr) AccessChain 1820(texel) 207 + Store 1998 1997 + 1999: 7(fvec4) Load 1820(texel) + ReturnValue 1999 + FunctionEnd +33(testTextureProjGradoffset(): 7(fvec4) Function None 8 + 34: Label + 2002(texel): 64(ptr) Variable Function + Store 2002(texel) 121 + 2003: 123 Load 125(s1D) + 2004: 53(fvec2) Load 148(c2) + 2005: 52(float) Load 1393(dPdxy1) + 2006: 52(float) Load 1393(dPdxy1) + 2007: 7(fvec4) ImageSampleProjExplicitLod 2003 2004 Grad ConstOffset 2005 2006 709 + 2008: 7(fvec4) Load 2002(texel) + 2009: 7(fvec4) FAdd 2008 2007 + Store 2002(texel) 2009 + 2010: 123 Load 125(s1D) + 2011: 154(fvec2) Load 156(f16c2) + 2012: 6(float) Load 1401(f16dPdxy1) + 2013: 6(float) Load 1401(f16dPdxy1) + 2014: 7(fvec4) ImageSampleProjExplicitLod 2010 2011 Grad ConstOffset 2012 2013 709 + 2015: 7(fvec4) Load 2002(texel) + 2016: 7(fvec4) FAdd 2015 2014 + Store 2002(texel) 2016 + 2017: 123 Load 125(s1D) + 2018: 249(fvec4) Load 251(c4) + 2019: 52(float) Load 1393(dPdxy1) + 2020: 52(float) Load 1393(dPdxy1) + 2021: 52(float) CompositeExtract 2018 3 + 2022: 249(fvec4) CompositeInsert 2021 2018 1 + 2023: 7(fvec4) ImageSampleProjExplicitLod 2017 2022 Grad ConstOffset 2019 2020 709 + 2024: 7(fvec4) Load 2002(texel) + 2025: 7(fvec4) FAdd 2024 2023 + Store 2002(texel) 2025 + 2026: 123 Load 125(s1D) + 2027: 7(fvec4) Load 309(f16c4) + 2028: 6(float) Load 1401(f16dPdxy1) + 2029: 6(float) Load 1401(f16dPdxy1) + 2030: 6(float) CompositeExtract 2027 3 + 2031: 7(fvec4) CompositeInsert 2030 2027 1 + 2032: 7(fvec4) ImageSampleProjExplicitLod 2026 2031 Grad ConstOffset 2028 2029 709 + 2033: 7(fvec4) Load 2002(texel) + 2034: 7(fvec4) FAdd 2033 2032 + Store 2002(texel) 2034 + 2035: 143 Load 145(s2D) + 2036: 167(fvec3) Load 169(c3) + 2037: 53(fvec2) Load 1409(dPdxy2) + 2038: 53(fvec2) Load 1409(dPdxy2) + 2039: 7(fvec4) ImageSampleProjExplicitLod 2035 2036 Grad ConstOffset 2037 2038 722 + 2040: 7(fvec4) Load 2002(texel) + 2041: 7(fvec4) FAdd 2040 2039 + Store 2002(texel) 2041 + 2042: 143 Load 145(s2D) + 2043: 175(fvec3) Load 177(f16c3) + 2044: 154(fvec2) Load 1417(f16dPdxy2) + 2045: 154(fvec2) Load 1417(f16dPdxy2) + 2046: 7(fvec4) ImageSampleProjExplicitLod 2042 2043 Grad ConstOffset 2044 2045 722 + 2047: 7(fvec4) Load 2002(texel) + 2048: 7(fvec4) FAdd 2047 2046 + Store 2002(texel) 2048 + 2049: 143 Load 145(s2D) + 2050: 249(fvec4) Load 251(c4) + 2051: 53(fvec2) Load 1409(dPdxy2) + 2052: 53(fvec2) Load 1409(dPdxy2) + 2053: 52(float) CompositeExtract 2050 3 + 2054: 249(fvec4) CompositeInsert 2053 2050 2 + 2055: 7(fvec4) ImageSampleProjExplicitLod 2049 2054 Grad ConstOffset 2051 2052 722 + 2056: 7(fvec4) Load 2002(texel) + 2057: 7(fvec4) FAdd 2056 2055 + Store 2002(texel) 2057 + 2058: 143 Load 145(s2D) + 2059: 7(fvec4) Load 309(f16c4) + 2060: 154(fvec2) Load 1417(f16dPdxy2) + 2061: 154(fvec2) Load 1417(f16dPdxy2) + 2062: 6(float) CompositeExtract 2059 3 + 2063: 7(fvec4) CompositeInsert 2062 2059 2 + 2064: 7(fvec4) ImageSampleProjExplicitLod 2058 2063 Grad ConstOffset 2060 2061 722 + 2065: 7(fvec4) Load 2002(texel) + 2066: 7(fvec4) FAdd 2065 2064 + Store 2002(texel) 2066 + 2067: 357 Load 359(s2DRect) + 2068: 167(fvec3) Load 169(c3) + 2069: 53(fvec2) Load 1409(dPdxy2) + 2070: 53(fvec2) Load 1409(dPdxy2) + 2071: 7(fvec4) ImageSampleProjExplicitLod 2067 2068 Grad ConstOffset 2069 2070 722 + 2072: 7(fvec4) Load 2002(texel) + 2073: 7(fvec4) FAdd 2072 2071 + Store 2002(texel) 2073 + 2074: 357 Load 359(s2DRect) + 2075: 175(fvec3) Load 177(f16c3) + 2076: 154(fvec2) Load 1417(f16dPdxy2) + 2077: 154(fvec2) Load 1417(f16dPdxy2) + 2078: 7(fvec4) ImageSampleProjExplicitLod 2074 2075 Grad ConstOffset 2076 2077 722 + 2079: 7(fvec4) Load 2002(texel) + 2080: 7(fvec4) FAdd 2079 2078 + Store 2002(texel) 2080 + 2081: 357 Load 359(s2DRect) + 2082: 249(fvec4) Load 251(c4) + 2083: 53(fvec2) Load 1409(dPdxy2) + 2084: 53(fvec2) Load 1409(dPdxy2) + 2085: 52(float) CompositeExtract 2082 3 + 2086: 249(fvec4) CompositeInsert 2085 2082 2 + 2087: 7(fvec4) ImageSampleProjExplicitLod 2081 2086 Grad ConstOffset 2083 2084 722 + 2088: 7(fvec4) Load 2002(texel) + 2089: 7(fvec4) FAdd 2088 2087 + Store 2002(texel) 2089 + 2090: 357 Load 359(s2DRect) + 2091: 7(fvec4) Load 309(f16c4) + 2092: 154(fvec2) Load 1417(f16dPdxy2) + 2093: 154(fvec2) Load 1417(f16dPdxy2) + 2094: 6(float) CompositeExtract 2091 3 + 2095: 7(fvec4) CompositeInsert 2094 2091 2 + 2096: 7(fvec4) ImageSampleProjExplicitLod 2090 2095 Grad ConstOffset 2092 2093 722 + 2097: 7(fvec4) Load 2002(texel) + 2098: 7(fvec4) FAdd 2097 2096 + Store 2002(texel) 2098 + 2099: 371 Load 373(s2DRectShadow) + 2100: 249(fvec4) Load 251(c4) + 2101: 53(fvec2) Load 1409(dPdxy2) + 2102: 53(fvec2) Load 1409(dPdxy2) + 2103: 52(float) CompositeExtract 2100 2 + 2104: 52(float) CompositeExtract 2100 3 + 2105: 249(fvec4) CompositeInsert 2104 2100 2 + 2106: 6(float) ImageSampleProjDrefExplicitLod 2099 2105 2103 Grad ConstOffset 2101 2102 722 + 2107: 208(ptr) AccessChain 2002(texel) 207 + 2108: 6(float) Load 2107 + 2109: 6(float) FAdd 2108 2106 + 2110: 208(ptr) AccessChain 2002(texel) 207 + Store 2110 2109 + 2111: 371 Load 373(s2DRectShadow) + 2112: 175(fvec3) Load 177(f16c3) + 2113: 52(float) Load 215(compare) + 2114: 154(fvec2) Load 1417(f16dPdxy2) + 2115: 154(fvec2) Load 1417(f16dPdxy2) + 2116: 6(float) ImageSampleProjDrefExplicitLod 2111 2112 2113 Grad ConstOffset 2114 2115 722 + 2117: 208(ptr) AccessChain 2002(texel) 207 + 2118: 6(float) Load 2117 + 2119: 6(float) FAdd 2118 2116 + 2120: 208(ptr) AccessChain 2002(texel) 207 + Store 2120 2119 + 2121: 163 Load 165(s3D) + 2122: 249(fvec4) Load 251(c4) + 2123: 167(fvec3) Load 1425(dPdxy3) + 2124: 167(fvec3) Load 1425(dPdxy3) + 2125: 7(fvec4) ImageSampleProjExplicitLod 2121 2122 Grad ConstOffset 2123 2124 735 + 2126: 7(fvec4) Load 2002(texel) + 2127: 7(fvec4) FAdd 2126 2125 + Store 2002(texel) 2127 + 2128: 163 Load 165(s3D) + 2129: 7(fvec4) Load 309(f16c4) + 2130: 175(fvec3) Load 1433(f16dPdxy3) + 2131: 175(fvec3) Load 1433(f16dPdxy3) + 2132: 7(fvec4) ImageSampleProjExplicitLod 2128 2129 Grad ConstOffset 2130 2131 735 + 2133: 7(fvec4) Load 2002(texel) + 2134: 7(fvec4) FAdd 2133 2132 + Store 2002(texel) 2134 + 2135: 199 Load 201(s1DShadow) + 2136: 249(fvec4) Load 251(c4) + 2137: 52(float) Load 1393(dPdxy1) + 2138: 52(float) Load 1393(dPdxy1) + 2139: 52(float) CompositeExtract 2136 2 + 2140: 52(float) CompositeExtract 2136 3 + 2141: 249(fvec4) CompositeInsert 2140 2136 1 + 2142: 6(float) ImageSampleProjDrefExplicitLod 2135 2141 2139 Grad ConstOffset 2137 2138 709 + 2143: 208(ptr) AccessChain 2002(texel) 207 + 2144: 6(float) Load 2143 + 2145: 6(float) FAdd 2144 2142 + 2146: 208(ptr) AccessChain 2002(texel) 207 + Store 2146 2145 + 2147: 199 Load 201(s1DShadow) + 2148: 175(fvec3) Load 177(f16c3) + 2149: 52(float) Load 215(compare) + 2150: 6(float) Load 1401(f16dPdxy1) + 2151: 6(float) Load 1401(f16dPdxy1) + 2152: 6(float) CompositeExtract 2148 2 + 2153: 175(fvec3) CompositeInsert 2152 2148 1 + 2154: 6(float) ImageSampleProjDrefExplicitLod 2147 2153 2149 Grad ConstOffset 2150 2151 709 + 2155: 208(ptr) AccessChain 2002(texel) 207 + 2156: 6(float) Load 2155 + 2157: 6(float) FAdd 2156 2154 + 2158: 208(ptr) AccessChain 2002(texel) 207 + Store 2158 2157 + 2159: 224 Load 226(s2DShadow) + 2160: 249(fvec4) Load 251(c4) + 2161: 53(fvec2) Load 1409(dPdxy2) + 2162: 53(fvec2) Load 1409(dPdxy2) + 2163: 52(float) CompositeExtract 2160 2 + 2164: 52(float) CompositeExtract 2160 3 + 2165: 249(fvec4) CompositeInsert 2164 2160 2 + 2166: 6(float) ImageSampleProjDrefExplicitLod 2159 2165 2163 Grad ConstOffset 2161 2162 722 + 2167: 208(ptr) AccessChain 2002(texel) 207 + 2168: 6(float) Load 2167 + 2169: 6(float) FAdd 2168 2166 + 2170: 208(ptr) AccessChain 2002(texel) 207 + Store 2170 2169 + 2171: 224 Load 226(s2DShadow) + 2172: 175(fvec3) Load 177(f16c3) + 2173: 52(float) Load 215(compare) + 2174: 154(fvec2) Load 1417(f16dPdxy2) + 2175: 154(fvec2) Load 1417(f16dPdxy2) + 2176: 6(float) ImageSampleProjDrefExplicitLod 2171 2172 2173 Grad ConstOffset 2174 2175 722 + 2177: 208(ptr) AccessChain 2002(texel) 207 + 2178: 6(float) Load 2177 + 2179: 6(float) FAdd 2178 2176 + 2180: 208(ptr) AccessChain 2002(texel) 207 + Store 2180 2179 + 2181: 7(fvec4) Load 2002(texel) + ReturnValue 2181 + FunctionEnd +35(testTextureGather(): 7(fvec4) Function None 8 + 36: Label + 2184(texel): 64(ptr) Variable Function + Store 2184(texel) 121 + 2185: 143 Load 145(s2D) + 2186: 53(fvec2) Load 148(c2) + 2188: 7(fvec4) ImageGather 2185 2186 2187 + 2189: 7(fvec4) Load 2184(texel) + 2190: 7(fvec4) FAdd 2189 2188 + Store 2184(texel) 2190 + 2191: 143 Load 145(s2D) + 2192: 154(fvec2) Load 156(f16c2) + 2193: 6(float) Load 137(f16bias) + 2194: 7(fvec4) ImageGather 2191 2192 2187 Bias 2193 + 2195: 7(fvec4) Load 2184(texel) + 2196: 7(fvec4) FAdd 2195 2194 + Store 2184(texel) 2196 + 2197: 284 Load 286(s2DArray) + 2198: 167(fvec3) Load 169(c3) + 2199: 7(fvec4) ImageGather 2197 2198 2187 + 2200: 7(fvec4) Load 2184(texel) + 2201: 7(fvec4) FAdd 2200 2199 + Store 2184(texel) 2201 + 2202: 284 Load 286(s2DArray) + 2203: 175(fvec3) Load 177(f16c3) + 2204: 6(float) Load 137(f16bias) + 2205: 7(fvec4) ImageGather 2202 2203 2187 Bias 2204 + 2206: 7(fvec4) Load 2184(texel) + 2207: 7(fvec4) FAdd 2206 2205 + Store 2184(texel) 2207 + 2208: 184 Load 186(sCube) + 2209: 167(fvec3) Load 169(c3) + 2210: 7(fvec4) ImageGather 2208 2209 2187 + 2211: 7(fvec4) Load 2184(texel) + 2212: 7(fvec4) FAdd 2211 2210 + Store 2184(texel) 2212 + 2213: 184 Load 186(sCube) + 2214: 175(fvec3) Load 177(f16c3) + 2215: 6(float) Load 137(f16bias) + 2216: 7(fvec4) ImageGather 2213 2214 2187 Bias 2215 + 2217: 7(fvec4) Load 2184(texel) + 2218: 7(fvec4) FAdd 2217 2216 + Store 2184(texel) 2218 + 2219: 299 Load 301(sCubeArray) + 2220: 249(fvec4) Load 251(c4) + 2221: 7(fvec4) ImageGather 2219 2220 2187 + 2222: 7(fvec4) Load 2184(texel) + 2223: 7(fvec4) FAdd 2222 2221 + Store 2184(texel) 2223 + 2224: 299 Load 301(sCubeArray) + 2225: 7(fvec4) Load 309(f16c4) + 2226: 6(float) Load 137(f16bias) + 2227: 7(fvec4) ImageGather 2224 2225 2187 Bias 2226 + 2228: 7(fvec4) Load 2184(texel) + 2229: 7(fvec4) FAdd 2228 2227 + Store 2184(texel) 2229 + 2230: 357 Load 359(s2DRect) + 2231: 53(fvec2) Load 148(c2) + 2232: 7(fvec4) ImageGather 2230 2231 2187 + 2233: 7(fvec4) Load 2184(texel) + 2234: 7(fvec4) FAdd 2233 2232 + Store 2184(texel) 2234 + 2235: 357 Load 359(s2DRect) + 2236: 154(fvec2) Load 156(f16c2) + 2237: 7(fvec4) ImageGather 2235 2236 2187 + 2238: 7(fvec4) Load 2184(texel) + 2239: 7(fvec4) FAdd 2238 2237 + Store 2184(texel) 2239 + 2240: 224 Load 226(s2DShadow) + 2241: 53(fvec2) Load 148(c2) + 2242: 52(float) Load 215(compare) + 2243: 7(fvec4) ImageDrefGather 2240 2241 2242 + 2244: 7(fvec4) Load 2184(texel) + 2245: 7(fvec4) FAdd 2244 2243 + Store 2184(texel) 2245 + 2246: 224 Load 226(s2DShadow) + 2247: 154(fvec2) Load 156(f16c2) + 2248: 52(float) Load 215(compare) + 2249: 7(fvec4) ImageDrefGather 2246 2247 2248 + 2250: 7(fvec4) Load 2184(texel) + 2251: 7(fvec4) FAdd 2250 2249 + Store 2184(texel) 2251 + 2252: 337 Load 339(s2DArrayShadow) + 2253: 167(fvec3) Load 169(c3) + 2254: 52(float) Load 215(compare) + 2255: 7(fvec4) ImageDrefGather 2252 2253 2254 + 2256: 7(fvec4) Load 2184(texel) + 2257: 7(fvec4) FAdd 2256 2255 + Store 2184(texel) 2257 + 2258: 337 Load 339(s2DArrayShadow) + 2259: 175(fvec3) Load 177(f16c3) + 2260: 52(float) Load 215(compare) + 2261: 7(fvec4) ImageDrefGather 2258 2259 2260 + 2262: 7(fvec4) Load 2184(texel) + 2263: 7(fvec4) FAdd 2262 2261 + Store 2184(texel) 2263 + 2264: 245 Load 247(sCubeShadow) + 2265: 167(fvec3) Load 169(c3) + 2266: 52(float) Load 215(compare) + 2267: 7(fvec4) ImageDrefGather 2264 2265 2266 + 2268: 7(fvec4) Load 2184(texel) + 2269: 7(fvec4) FAdd 2268 2267 + Store 2184(texel) 2269 + 2270: 245 Load 247(sCubeShadow) + 2271: 175(fvec3) Load 177(f16c3) + 2272: 52(float) Load 215(compare) + 2273: 7(fvec4) ImageDrefGather 2270 2271 2272 + 2274: 7(fvec4) Load 2184(texel) + 2275: 7(fvec4) FAdd 2274 2273 + Store 2184(texel) 2275 + 2276: 391 Load 393(sCubeArrayShadow) + 2277: 249(fvec4) Load 251(c4) + 2278: 52(float) Load 215(compare) + 2279: 7(fvec4) ImageDrefGather 2276 2277 2278 + 2280: 7(fvec4) Load 2184(texel) + 2281: 7(fvec4) FAdd 2280 2279 + Store 2184(texel) 2281 + 2282: 391 Load 393(sCubeArrayShadow) + 2283: 7(fvec4) Load 309(f16c4) + 2284: 52(float) Load 215(compare) + 2285: 7(fvec4) ImageDrefGather 2282 2283 2284 + 2286: 7(fvec4) Load 2184(texel) + 2287: 7(fvec4) FAdd 2286 2285 + Store 2184(texel) 2287 + 2288: 371 Load 373(s2DRectShadow) + 2289: 53(fvec2) Load 148(c2) + 2290: 52(float) Load 215(compare) + 2291: 7(fvec4) ImageDrefGather 2288 2289 2290 + 2292: 7(fvec4) Load 2184(texel) + 2293: 7(fvec4) FAdd 2292 2291 + Store 2184(texel) 2293 + 2294: 371 Load 373(s2DRectShadow) + 2295: 154(fvec2) Load 156(f16c2) + 2296: 52(float) Load 215(compare) + 2297: 7(fvec4) ImageDrefGather 2294 2295 2296 + 2298: 7(fvec4) Load 2184(texel) + 2299: 7(fvec4) FAdd 2298 2297 + Store 2184(texel) 2299 + 2300: 7(fvec4) Load 2184(texel) + ReturnValue 2300 + FunctionEnd +37(testTextureGatherOffset(): 7(fvec4) Function None 8 + 38: Label + 2303(texel): 64(ptr) Variable Function + Store 2303(texel) 121 + 2304: 143 Load 145(s2D) + 2305: 53(fvec2) Load 148(c2) + 2306: 7(fvec4) ImageGather 2304 2305 2187 ConstOffset 722 + 2307: 7(fvec4) Load 2303(texel) + 2308: 7(fvec4) FAdd 2307 2306 + Store 2303(texel) 2308 + 2309: 143 Load 145(s2D) + 2310: 154(fvec2) Load 156(f16c2) + 2311: 6(float) Load 137(f16bias) + 2312: 7(fvec4) ImageGather 2309 2310 2187 Bias ConstOffset 2311 722 + 2313: 7(fvec4) Load 2303(texel) + 2314: 7(fvec4) FAdd 2313 2312 + Store 2303(texel) 2314 + 2315: 284 Load 286(s2DArray) + 2316: 167(fvec3) Load 169(c3) + 2317: 7(fvec4) ImageGather 2315 2316 2187 ConstOffset 722 + 2318: 7(fvec4) Load 2303(texel) + 2319: 7(fvec4) FAdd 2318 2317 + Store 2303(texel) 2319 + 2320: 284 Load 286(s2DArray) + 2321: 175(fvec3) Load 177(f16c3) + 2322: 6(float) Load 137(f16bias) + 2323: 7(fvec4) ImageGather 2320 2321 2187 Bias ConstOffset 2322 722 + 2324: 7(fvec4) Load 2303(texel) + 2325: 7(fvec4) FAdd 2324 2323 + Store 2303(texel) 2325 + 2326: 357 Load 359(s2DRect) + 2327: 53(fvec2) Load 148(c2) + 2328: 7(fvec4) ImageGather 2326 2327 2187 ConstOffset 722 + 2329: 7(fvec4) Load 2303(texel) + 2330: 7(fvec4) FAdd 2329 2328 + Store 2303(texel) 2330 + 2331: 357 Load 359(s2DRect) + 2332: 154(fvec2) Load 156(f16c2) + 2333: 7(fvec4) ImageGather 2331 2332 2187 ConstOffset 722 + 2334: 7(fvec4) Load 2303(texel) + 2335: 7(fvec4) FAdd 2334 2333 + Store 2303(texel) 2335 + 2336: 224 Load 226(s2DShadow) + 2337: 53(fvec2) Load 148(c2) + 2338: 52(float) Load 215(compare) + 2339: 7(fvec4) ImageDrefGather 2336 2337 2338 ConstOffset 722 + 2340: 7(fvec4) Load 2303(texel) + 2341: 7(fvec4) FAdd 2340 2339 + Store 2303(texel) 2341 + 2342: 224 Load 226(s2DShadow) + 2343: 154(fvec2) Load 156(f16c2) + 2344: 52(float) Load 215(compare) + 2345: 7(fvec4) ImageDrefGather 2342 2343 2344 ConstOffset 722 + 2346: 7(fvec4) Load 2303(texel) + 2347: 7(fvec4) FAdd 2346 2345 + Store 2303(texel) 2347 + 2348: 337 Load 339(s2DArrayShadow) + 2349: 167(fvec3) Load 169(c3) + 2350: 52(float) Load 215(compare) + 2351: 7(fvec4) ImageDrefGather 2348 2349 2350 ConstOffset 722 + 2352: 7(fvec4) Load 2303(texel) + 2353: 7(fvec4) FAdd 2352 2351 + Store 2303(texel) 2353 + 2354: 337 Load 339(s2DArrayShadow) + 2355: 175(fvec3) Load 177(f16c3) + 2356: 52(float) Load 215(compare) + 2357: 7(fvec4) ImageDrefGather 2354 2355 2356 ConstOffset 722 + 2358: 7(fvec4) Load 2303(texel) + 2359: 7(fvec4) FAdd 2358 2357 + Store 2303(texel) 2359 + 2360: 371 Load 373(s2DRectShadow) + 2361: 53(fvec2) Load 148(c2) + 2362: 52(float) Load 215(compare) + 2363: 7(fvec4) ImageDrefGather 2360 2361 2362 ConstOffset 722 + 2364: 7(fvec4) Load 2303(texel) + 2365: 7(fvec4) FAdd 2364 2363 + Store 2303(texel) 2365 + 2366: 371 Load 373(s2DRectShadow) + 2367: 154(fvec2) Load 156(f16c2) + 2368: 52(float) Load 215(compare) + 2369: 7(fvec4) ImageDrefGather 2366 2367 2368 ConstOffset 722 + 2370: 7(fvec4) Load 2303(texel) + 2371: 7(fvec4) FAdd 2370 2369 + Store 2303(texel) 2371 + 2372: 7(fvec4) Load 2303(texel) + ReturnValue 2372 + FunctionEnd +39(testTextureGatherOffsets(): 7(fvec4) Function None 8 + 40: Label + 2375(texel): 64(ptr) Variable Function + Store 2375(texel) 121 + 2376: 143 Load 145(s2D) + 2377: 53(fvec2) Load 148(c2) + 2381: 7(fvec4) ImageGather 2376 2377 2187 ConstOffsets 2380 + 2382: 7(fvec4) Load 2375(texel) + 2383: 7(fvec4) FAdd 2382 2381 + Store 2375(texel) 2383 + 2384: 143 Load 145(s2D) + 2385: 154(fvec2) Load 156(f16c2) + 2386: 6(float) Load 137(f16bias) + 2387: 7(fvec4) ImageGather 2384 2385 2187 Bias ConstOffsets 2386 2380 + 2388: 7(fvec4) Load 2375(texel) + 2389: 7(fvec4) FAdd 2388 2387 + Store 2375(texel) 2389 + 2390: 284 Load 286(s2DArray) + 2391: 167(fvec3) Load 169(c3) + 2392: 7(fvec4) ImageGather 2390 2391 2187 ConstOffsets 2380 + 2393: 7(fvec4) Load 2375(texel) + 2394: 7(fvec4) FAdd 2393 2392 + Store 2375(texel) 2394 + 2395: 284 Load 286(s2DArray) + 2396: 175(fvec3) Load 177(f16c3) + 2397: 6(float) Load 137(f16bias) + 2398: 7(fvec4) ImageGather 2395 2396 2187 Bias ConstOffsets 2397 2380 + 2399: 7(fvec4) Load 2375(texel) + 2400: 7(fvec4) FAdd 2399 2398 + Store 2375(texel) 2400 + 2401: 357 Load 359(s2DRect) + 2402: 53(fvec2) Load 148(c2) + 2403: 7(fvec4) ImageGather 2401 2402 2187 ConstOffsets 2380 + 2404: 7(fvec4) Load 2375(texel) + 2405: 7(fvec4) FAdd 2404 2403 + Store 2375(texel) 2405 + 2406: 357 Load 359(s2DRect) + 2407: 154(fvec2) Load 156(f16c2) + 2408: 7(fvec4) ImageGather 2406 2407 2187 ConstOffsets 2380 + 2409: 7(fvec4) Load 2375(texel) + 2410: 7(fvec4) FAdd 2409 2408 + Store 2375(texel) 2410 + 2411: 224 Load 226(s2DShadow) + 2412: 53(fvec2) Load 148(c2) + 2413: 52(float) Load 215(compare) + 2414: 7(fvec4) ImageDrefGather 2411 2412 2413 ConstOffsets 2380 + 2415: 7(fvec4) Load 2375(texel) + 2416: 7(fvec4) FAdd 2415 2414 + Store 2375(texel) 2416 + 2417: 224 Load 226(s2DShadow) + 2418: 154(fvec2) Load 156(f16c2) + 2419: 52(float) Load 215(compare) + 2420: 7(fvec4) ImageDrefGather 2417 2418 2419 ConstOffsets 2380 + 2421: 7(fvec4) Load 2375(texel) + 2422: 7(fvec4) FAdd 2421 2420 + Store 2375(texel) 2422 + 2423: 337 Load 339(s2DArrayShadow) + 2424: 167(fvec3) Load 169(c3) + 2425: 52(float) Load 215(compare) + 2426: 7(fvec4) ImageDrefGather 2423 2424 2425 ConstOffsets 2380 + 2427: 7(fvec4) Load 2375(texel) + 2428: 7(fvec4) FAdd 2427 2426 + Store 2375(texel) 2428 + 2429: 337 Load 339(s2DArrayShadow) + 2430: 175(fvec3) Load 177(f16c3) + 2431: 52(float) Load 215(compare) + 2432: 7(fvec4) ImageDrefGather 2429 2430 2431 ConstOffsets 2380 + 2433: 7(fvec4) Load 2375(texel) + 2434: 7(fvec4) FAdd 2433 2432 + Store 2375(texel) 2434 + 2435: 371 Load 373(s2DRectShadow) + 2436: 53(fvec2) Load 148(c2) + 2437: 52(float) Load 215(compare) + 2438: 7(fvec4) ImageDrefGather 2435 2436 2437 ConstOffsets 2380 + 2439: 7(fvec4) Load 2375(texel) + 2440: 7(fvec4) FAdd 2439 2438 + Store 2375(texel) 2440 + 2441: 371 Load 373(s2DRectShadow) + 2442: 154(fvec2) Load 156(f16c2) + 2443: 52(float) Load 215(compare) + 2444: 7(fvec4) ImageDrefGather 2441 2442 2443 ConstOffsets 2380 + 2445: 7(fvec4) Load 2375(texel) + 2446: 7(fvec4) FAdd 2445 2444 + Store 2375(texel) 2446 + 2447: 7(fvec4) Load 2375(texel) + ReturnValue 2447 + FunctionEnd +41(testTextureGatherLod(): 7(fvec4) Function None 8 + 42: Label + 2450(texel): 64(ptr) Variable Function + Store 2450(texel) 121 + 2451: 143 Load 145(s2D) + 2452: 53(fvec2) Load 148(c2) + 2453: 52(float) Load 565(lod) + 2454: 7(fvec4) ImageGather 2451 2452 2187 Lod 2453 + 2455: 7(fvec4) Load 2450(texel) + 2456: 7(fvec4) FAdd 2455 2454 + Store 2450(texel) 2456 + 2457: 143 Load 145(s2D) + 2458: 154(fvec2) Load 156(f16c2) + 2459: 6(float) Load 572(f16lod) + 2460: 7(fvec4) ImageGather 2457 2458 2187 Lod 2459 + 2461: 7(fvec4) Load 2450(texel) + 2462: 7(fvec4) FAdd 2461 2460 + Store 2450(texel) 2462 + 2463: 284 Load 286(s2DArray) + 2464: 167(fvec3) Load 169(c3) + 2465: 52(float) Load 565(lod) + 2466: 7(fvec4) ImageGather 2463 2464 2187 Lod 2465 + 2467: 7(fvec4) Load 2450(texel) + 2468: 7(fvec4) FAdd 2467 2466 + Store 2450(texel) 2468 + 2469: 284 Load 286(s2DArray) + 2470: 175(fvec3) Load 177(f16c3) + 2471: 6(float) Load 572(f16lod) + 2472: 7(fvec4) ImageGather 2469 2470 2187 Lod 2471 + 2473: 7(fvec4) Load 2450(texel) + 2474: 7(fvec4) FAdd 2473 2472 + Store 2450(texel) 2474 + 2475: 184 Load 186(sCube) + 2476: 167(fvec3) Load 169(c3) + 2477: 52(float) Load 565(lod) + 2478: 7(fvec4) ImageGather 2475 2476 2187 Lod 2477 + 2479: 7(fvec4) Load 2450(texel) + 2480: 7(fvec4) FAdd 2479 2478 + Store 2450(texel) 2480 + 2481: 184 Load 186(sCube) + 2482: 175(fvec3) Load 177(f16c3) + 2483: 6(float) Load 572(f16lod) + 2484: 7(fvec4) ImageGather 2481 2482 2187 Lod 2483 + 2485: 7(fvec4) Load 2450(texel) + 2486: 7(fvec4) FAdd 2485 2484 + Store 2450(texel) 2486 + 2487: 299 Load 301(sCubeArray) + 2488: 249(fvec4) Load 251(c4) + 2489: 52(float) Load 565(lod) + 2490: 7(fvec4) ImageGather 2487 2488 2187 Lod 2489 + 2491: 7(fvec4) Load 2450(texel) + 2492: 7(fvec4) FAdd 2491 2490 + Store 2450(texel) 2492 + 2493: 299 Load 301(sCubeArray) + 2494: 7(fvec4) Load 309(f16c4) + 2495: 6(float) Load 572(f16lod) + 2496: 7(fvec4) ImageGather 2493 2494 2187 Lod 2495 + 2497: 7(fvec4) Load 2450(texel) + 2498: 7(fvec4) FAdd 2497 2496 + Store 2450(texel) 2498 + 2499: 7(fvec4) Load 2450(texel) + ReturnValue 2499 + FunctionEnd +43(testTextureGatherLodOffset(): 7(fvec4) Function None 8 + 44: Label + 2502(texel): 64(ptr) Variable Function + Store 2502(texel) 121 + 2503: 143 Load 145(s2D) + 2504: 53(fvec2) Load 148(c2) + 2505: 52(float) Load 565(lod) + 2506: 7(fvec4) ImageGather 2503 2504 2187 Lod ConstOffset 2505 722 + 2507: 7(fvec4) Load 2502(texel) + 2508: 7(fvec4) FAdd 2507 2506 + Store 2502(texel) 2508 + 2509: 143 Load 145(s2D) + 2510: 154(fvec2) Load 156(f16c2) + 2511: 6(float) Load 572(f16lod) + 2512: 7(fvec4) ImageGather 2509 2510 2187 Lod ConstOffset 2511 722 + 2513: 7(fvec4) Load 2502(texel) + 2514: 7(fvec4) FAdd 2513 2512 + Store 2502(texel) 2514 + 2515: 284 Load 286(s2DArray) + 2516: 167(fvec3) Load 169(c3) + 2517: 52(float) Load 565(lod) + 2518: 7(fvec4) ImageGather 2515 2516 2187 Lod ConstOffset 2517 722 + 2519: 7(fvec4) Load 2502(texel) + 2520: 7(fvec4) FAdd 2519 2518 + Store 2502(texel) 2520 + 2521: 284 Load 286(s2DArray) + 2522: 175(fvec3) Load 177(f16c3) + 2523: 6(float) Load 572(f16lod) + 2524: 7(fvec4) ImageGather 2521 2522 2187 Lod ConstOffset 2523 722 + 2525: 7(fvec4) Load 2502(texel) + 2526: 7(fvec4) FAdd 2525 2524 + Store 2502(texel) 2526 + 2527: 7(fvec4) Load 2502(texel) + ReturnValue 2527 + FunctionEnd +45(testTextureGatherLodOffsets(): 7(fvec4) Function None 8 + 46: Label + 2530(texel): 64(ptr) Variable Function + Store 2530(texel) 121 + 2531: 143 Load 145(s2D) + 2532: 53(fvec2) Load 148(c2) + 2533: 52(float) Load 565(lod) + 2534: 7(fvec4) ImageGather 2531 2532 2187 Lod ConstOffsets 2533 2380 + 2535: 7(fvec4) Load 2530(texel) + 2536: 7(fvec4) FAdd 2535 2534 + Store 2530(texel) 2536 + 2537: 143 Load 145(s2D) + 2538: 154(fvec2) Load 156(f16c2) + 2539: 6(float) Load 572(f16lod) + 2540: 7(fvec4) ImageGather 2537 2538 2187 Lod ConstOffsets 2539 2380 + 2541: 7(fvec4) Load 2530(texel) + 2542: 7(fvec4) FAdd 2541 2540 + Store 2530(texel) 2542 + 2543: 284 Load 286(s2DArray) + 2544: 167(fvec3) Load 169(c3) + 2545: 52(float) Load 565(lod) + 2546: 7(fvec4) ImageGather 2543 2544 2187 Lod ConstOffsets 2545 2380 + 2547: 7(fvec4) Load 2530(texel) + 2548: 7(fvec4) FAdd 2547 2546 + Store 2530(texel) 2548 + 2549: 284 Load 286(s2DArray) + 2550: 175(fvec3) Load 177(f16c3) + 2551: 6(float) Load 572(f16lod) + 2552: 7(fvec4) ImageGather 2549 2550 2187 Lod ConstOffsets 2551 2380 + 2553: 7(fvec4) Load 2530(texel) + 2554: 7(fvec4) FAdd 2553 2552 + Store 2530(texel) 2554 + 2555: 7(fvec4) Load 2530(texel) + ReturnValue 2555 + FunctionEnd +50(testTextureSize(): 48(ivec4) Function None 49 + 51: Label + 2559(size): 2558(ptr) Variable Function + Store 2559(size) 2560 + 2561: 123 Load 125(s1D) + 2562: 52(float) Load 565(lod) + 2563: 47(int) ConvertFToS 2562 + 2564: 122 Image 2561 + 2565: 47(int) ImageQuerySizeLod 2564 2563 + 2567: 2566(ptr) AccessChain 2559(size) 207 + 2568: 47(int) Load 2567 + 2569: 47(int) IAdd 2568 2565 + 2570: 2566(ptr) AccessChain 2559(size) 207 + Store 2570 2569 + 2571: 143 Load 145(s2D) + 2572: 52(float) Load 565(lod) + 2573: 47(int) ConvertFToS 2572 + 2574: 142 Image 2571 + 2575: 721(ivec2) ImageQuerySizeLod 2574 2573 + 2576: 48(ivec4) Load 2559(size) + 2577: 721(ivec2) VectorShuffle 2576 2576 0 1 + 2578: 721(ivec2) IAdd 2577 2575 + 2579: 48(ivec4) Load 2559(size) + 2580: 48(ivec4) VectorShuffle 2579 2578 4 5 2 3 + Store 2559(size) 2580 + 2581: 163 Load 165(s3D) + 2582: 52(float) Load 565(lod) + 2583: 47(int) ConvertFToS 2582 + 2584: 162 Image 2581 + 2585: 734(ivec3) ImageQuerySizeLod 2584 2583 + 2586: 48(ivec4) Load 2559(size) + 2587: 734(ivec3) VectorShuffle 2586 2586 0 1 2 + 2588: 734(ivec3) IAdd 2587 2585 + 2589: 48(ivec4) Load 2559(size) + 2590: 48(ivec4) VectorShuffle 2589 2588 4 5 6 3 + Store 2559(size) 2590 + 2591: 184 Load 186(sCube) + 2592: 52(float) Load 565(lod) + 2593: 47(int) ConvertFToS 2592 + 2594: 183 Image 2591 + 2595: 721(ivec2) ImageQuerySizeLod 2594 2593 + 2596: 48(ivec4) Load 2559(size) + 2597: 721(ivec2) VectorShuffle 2596 2596 0 1 + 2598: 721(ivec2) IAdd 2597 2595 + 2599: 48(ivec4) Load 2559(size) + 2600: 48(ivec4) VectorShuffle 2599 2598 4 5 2 3 + Store 2559(size) 2600 + 2601: 199 Load 201(s1DShadow) + 2602: 52(float) Load 565(lod) + 2603: 47(int) ConvertFToS 2602 + 2604: 198 Image 2601 + 2605: 47(int) ImageQuerySizeLod 2604 2603 + 2606: 2566(ptr) AccessChain 2559(size) 207 + 2607: 47(int) Load 2606 + 2608: 47(int) IAdd 2607 2605 + 2609: 2566(ptr) AccessChain 2559(size) 207 + Store 2609 2608 + 2610: 224 Load 226(s2DShadow) + 2611: 52(float) Load 565(lod) + 2612: 47(int) ConvertFToS 2611 + 2613: 223 Image 2610 + 2614: 721(ivec2) ImageQuerySizeLod 2613 2612 + 2615: 48(ivec4) Load 2559(size) + 2616: 721(ivec2) VectorShuffle 2615 2615 0 1 + 2617: 721(ivec2) IAdd 2616 2614 + 2618: 48(ivec4) Load 2559(size) + 2619: 48(ivec4) VectorShuffle 2618 2617 4 5 2 3 + Store 2559(size) 2619 + 2620: 245 Load 247(sCubeShadow) + 2621: 52(float) Load 565(lod) + 2622: 47(int) ConvertFToS 2621 + 2623: 244 Image 2620 + 2624: 721(ivec2) ImageQuerySizeLod 2623 2622 + 2625: 48(ivec4) Load 2559(size) + 2626: 721(ivec2) VectorShuffle 2625 2625 0 1 + 2627: 721(ivec2) IAdd 2626 2624 + 2628: 48(ivec4) Load 2559(size) + 2629: 48(ivec4) VectorShuffle 2628 2627 4 5 2 3 + Store 2559(size) 2629 + 2630: 299 Load 301(sCubeArray) + 2631: 52(float) Load 565(lod) + 2632: 47(int) ConvertFToS 2631 + 2633: 298 Image 2630 + 2634: 734(ivec3) ImageQuerySizeLod 2633 2632 + 2635: 48(ivec4) Load 2559(size) + 2636: 734(ivec3) VectorShuffle 2635 2635 0 1 2 + 2637: 734(ivec3) IAdd 2636 2634 + 2638: 48(ivec4) Load 2559(size) + 2639: 48(ivec4) VectorShuffle 2638 2637 4 5 6 3 + Store 2559(size) 2639 + 2640: 391 Load 393(sCubeArrayShadow) + 2641: 52(float) Load 565(lod) + 2642: 47(int) ConvertFToS 2641 + 2643: 390 Image 2640 + 2644: 734(ivec3) ImageQuerySizeLod 2643 2642 + 2645: 48(ivec4) Load 2559(size) + 2646: 734(ivec3) VectorShuffle 2645 2645 0 1 2 + 2647: 734(ivec3) IAdd 2646 2644 + 2648: 48(ivec4) Load 2559(size) + 2649: 48(ivec4) VectorShuffle 2648 2647 4 5 6 3 + Store 2559(size) 2649 + 2650: 357 Load 359(s2DRect) + 2651: 356 Image 2650 + 2652: 721(ivec2) ImageQuerySize 2651 + 2653: 48(ivec4) Load 2559(size) + 2654: 721(ivec2) VectorShuffle 2653 2653 0 1 + 2655: 721(ivec2) IAdd 2654 2652 + 2656: 48(ivec4) Load 2559(size) + 2657: 48(ivec4) VectorShuffle 2656 2655 4 5 2 3 + Store 2559(size) 2657 + 2658: 371 Load 373(s2DRectShadow) + 2659: 370 Image 2658 + 2660: 721(ivec2) ImageQuerySize 2659 + 2661: 48(ivec4) Load 2559(size) + 2662: 721(ivec2) VectorShuffle 2661 2661 0 1 + 2663: 721(ivec2) IAdd 2662 2660 + 2664: 48(ivec4) Load 2559(size) + 2665: 48(ivec4) VectorShuffle 2664 2663 4 5 2 3 + Store 2559(size) 2665 + 2666: 269 Load 271(s1DArray) + 2667: 52(float) Load 565(lod) + 2668: 47(int) ConvertFToS 2667 + 2669: 268 Image 2666 + 2670: 721(ivec2) ImageQuerySizeLod 2669 2668 + 2671: 48(ivec4) Load 2559(size) + 2672: 721(ivec2) VectorShuffle 2671 2671 0 1 + 2673: 721(ivec2) IAdd 2672 2670 + 2674: 48(ivec4) Load 2559(size) + 2675: 48(ivec4) VectorShuffle 2674 2673 4 5 2 3 + Store 2559(size) 2675 + 2676: 284 Load 286(s2DArray) + 2677: 52(float) Load 565(lod) + 2678: 47(int) ConvertFToS 2677 + 2679: 283 Image 2676 + 2680: 734(ivec3) ImageQuerySizeLod 2679 2678 + 2681: 48(ivec4) Load 2559(size) + 2682: 734(ivec3) VectorShuffle 2681 2681 0 1 2 + 2683: 734(ivec3) IAdd 2682 2680 + 2684: 48(ivec4) Load 2559(size) + 2685: 48(ivec4) VectorShuffle 2684 2683 4 5 6 3 + Store 2559(size) 2685 + 2686: 316 Load 318(s1DArrayShadow) + 2687: 52(float) Load 565(lod) + 2688: 47(int) ConvertFToS 2687 + 2689: 315 Image 2686 + 2690: 721(ivec2) ImageQuerySizeLod 2689 2688 + 2691: 48(ivec4) Load 2559(size) + 2692: 721(ivec2) VectorShuffle 2691 2691 0 1 + 2693: 721(ivec2) IAdd 2692 2690 + 2694: 48(ivec4) Load 2559(size) + 2695: 48(ivec4) VectorShuffle 2694 2693 4 5 2 3 + Store 2559(size) 2695 + 2696: 337 Load 339(s2DArrayShadow) + 2697: 52(float) Load 565(lod) + 2698: 47(int) ConvertFToS 2697 + 2699: 336 Image 2696 + 2700: 734(ivec3) ImageQuerySizeLod 2699 2698 + 2701: 48(ivec4) Load 2559(size) + 2702: 734(ivec3) VectorShuffle 2701 2701 0 1 2 + 2703: 734(ivec3) IAdd 2702 2700 + 2704: 48(ivec4) Load 2559(size) + 2705: 48(ivec4) VectorShuffle 2704 2703 4 5 6 3 + Store 2559(size) 2705 + 2706: 1298 Load 1300(sBuffer) + 2707: 1297 Image 2706 + 2708: 47(int) ImageQuerySize 2707 + 2709: 2566(ptr) AccessChain 2559(size) 207 + 2710: 47(int) Load 2709 + 2711: 47(int) IAdd 2710 2708 + 2712: 2566(ptr) AccessChain 2559(size) 207 + Store 2712 2711 + 2713: 1309 Load 1311(s2DMS) + 2714: 1308 Image 2713 + 2715: 721(ivec2) ImageQuerySize 2714 + 2716: 48(ivec4) Load 2559(size) + 2717: 721(ivec2) VectorShuffle 2716 2716 0 1 + 2718: 721(ivec2) IAdd 2717 2715 + 2719: 48(ivec4) Load 2559(size) + 2720: 48(ivec4) VectorShuffle 2719 2718 4 5 2 3 + Store 2559(size) 2720 + 2721: 1320 Load 1322(s2DMSArray) + 2722: 1319 Image 2721 + 2723: 734(ivec3) ImageQuerySize 2722 + 2724: 48(ivec4) Load 2559(size) + 2725: 734(ivec3) VectorShuffle 2724 2724 0 1 2 + 2726: 734(ivec3) IAdd 2725 2723 + 2727: 48(ivec4) Load 2559(size) + 2728: 48(ivec4) VectorShuffle 2727 2726 4 5 6 3 + Store 2559(size) 2728 + 2729: 48(ivec4) Load 2559(size) + ReturnValue 2729 + FunctionEnd +55(testTextureQueryLod(): 53(fvec2) Function None 54 + 56: Label + 2733(lod): 2732(ptr) Variable Function + Store 2733(lod) 2735 + 2736: 123 Load 125(s1D) + 2737: 52(float) Load 128(c1) + 2738: 53(fvec2) ImageQueryLod 2736 2737 + 2739: 53(fvec2) Load 2733(lod) + 2740: 53(fvec2) FAdd 2739 2738 + Store 2733(lod) 2740 + 2741: 123 Load 125(s1D) + 2742: 6(float) Load 135(f16c1) + 2743: 154(fvec2) ImageQueryLod 2741 2742 + 2744: 53(fvec2) Load 2733(lod) + 2745: 53(fvec2) FAdd 2744 2743 + Store 2733(lod) 2745 + 2746: 143 Load 145(s2D) + 2747: 53(fvec2) Load 148(c2) + 2748: 53(fvec2) ImageQueryLod 2746 2747 + 2749: 53(fvec2) Load 2733(lod) + 2750: 53(fvec2) FAdd 2749 2748 + Store 2733(lod) 2750 + 2751: 143 Load 145(s2D) + 2752: 154(fvec2) Load 156(f16c2) + 2753: 154(fvec2) ImageQueryLod 2751 2752 + 2754: 53(fvec2) Load 2733(lod) + 2755: 53(fvec2) FAdd 2754 2753 + Store 2733(lod) 2755 + 2756: 163 Load 165(s3D) + 2757: 167(fvec3) Load 169(c3) + 2758: 53(fvec2) ImageQueryLod 2756 2757 + 2759: 53(fvec2) Load 2733(lod) + 2760: 53(fvec2) FAdd 2759 2758 + Store 2733(lod) 2760 + 2761: 163 Load 165(s3D) + 2762: 175(fvec3) Load 177(f16c3) + 2763: 154(fvec2) ImageQueryLod 2761 2762 + 2764: 53(fvec2) Load 2733(lod) + 2765: 53(fvec2) FAdd 2764 2763 + Store 2733(lod) 2765 + 2766: 184 Load 186(sCube) + 2767: 167(fvec3) Load 169(c3) + 2768: 53(fvec2) ImageQueryLod 2766 2767 + 2769: 53(fvec2) Load 2733(lod) + 2770: 53(fvec2) FAdd 2769 2768 + Store 2733(lod) 2770 + 2771: 184 Load 186(sCube) + 2772: 175(fvec3) Load 177(f16c3) + 2773: 154(fvec2) ImageQueryLod 2771 2772 + 2774: 53(fvec2) Load 2733(lod) + 2775: 53(fvec2) FAdd 2774 2773 + Store 2733(lod) 2775 + 2776: 269 Load 271(s1DArray) + 2777: 52(float) Load 128(c1) + 2778: 53(fvec2) ImageQueryLod 2776 2777 + 2779: 53(fvec2) Load 2733(lod) + 2780: 53(fvec2) FAdd 2779 2778 + Store 2733(lod) 2780 + 2781: 269 Load 271(s1DArray) + 2782: 6(float) Load 135(f16c1) + 2783: 154(fvec2) ImageQueryLod 2781 2782 + 2784: 53(fvec2) Load 2733(lod) + 2785: 53(fvec2) FAdd 2784 2783 + Store 2733(lod) 2785 + 2786: 284 Load 286(s2DArray) + 2787: 53(fvec2) Load 148(c2) + 2788: 53(fvec2) ImageQueryLod 2786 2787 + 2789: 53(fvec2) Load 2733(lod) + 2790: 53(fvec2) FAdd 2789 2788 + Store 2733(lod) 2790 + 2791: 284 Load 286(s2DArray) + 2792: 154(fvec2) Load 156(f16c2) + 2793: 154(fvec2) ImageQueryLod 2791 2792 + 2794: 53(fvec2) Load 2733(lod) + 2795: 53(fvec2) FAdd 2794 2793 + Store 2733(lod) 2795 + 2796: 299 Load 301(sCubeArray) + 2797: 167(fvec3) Load 169(c3) + 2798: 53(fvec2) ImageQueryLod 2796 2797 + 2799: 53(fvec2) Load 2733(lod) + 2800: 53(fvec2) FAdd 2799 2798 + Store 2733(lod) 2800 + 2801: 299 Load 301(sCubeArray) + 2802: 175(fvec3) Load 177(f16c3) + 2803: 154(fvec2) ImageQueryLod 2801 2802 + 2804: 53(fvec2) Load 2733(lod) + 2805: 53(fvec2) FAdd 2804 2803 + Store 2733(lod) 2805 + 2806: 199 Load 201(s1DShadow) + 2807: 52(float) Load 128(c1) + 2808: 53(fvec2) ImageQueryLod 2806 2807 + 2809: 53(fvec2) Load 2733(lod) + 2810: 53(fvec2) FAdd 2809 2808 + Store 2733(lod) 2810 + 2811: 199 Load 201(s1DShadow) + 2812: 6(float) Load 135(f16c1) + 2813: 154(fvec2) ImageQueryLod 2811 2812 + 2814: 53(fvec2) Load 2733(lod) + 2815: 53(fvec2) FAdd 2814 2813 + Store 2733(lod) 2815 + 2816: 224 Load 226(s2DShadow) + 2817: 53(fvec2) Load 148(c2) + 2818: 53(fvec2) ImageQueryLod 2816 2817 + 2819: 53(fvec2) Load 2733(lod) + 2820: 53(fvec2) FAdd 2819 2818 + Store 2733(lod) 2820 + 2821: 224 Load 226(s2DShadow) + 2822: 154(fvec2) Load 156(f16c2) + 2823: 154(fvec2) ImageQueryLod 2821 2822 + 2824: 53(fvec2) Load 2733(lod) + 2825: 53(fvec2) FAdd 2824 2823 + Store 2733(lod) 2825 + 2826: 391 Load 393(sCubeArrayShadow) + 2827: 167(fvec3) Load 169(c3) + 2828: 53(fvec2) ImageQueryLod 2826 2827 + 2829: 53(fvec2) Load 2733(lod) + 2830: 53(fvec2) FAdd 2829 2828 + Store 2733(lod) 2830 + 2831: 391 Load 393(sCubeArrayShadow) + 2832: 175(fvec3) Load 177(f16c3) + 2833: 154(fvec2) ImageQueryLod 2831 2832 + 2834: 53(fvec2) Load 2733(lod) + 2835: 53(fvec2) FAdd 2834 2833 + Store 2733(lod) 2835 + 2836: 316 Load 318(s1DArrayShadow) + 2837: 52(float) Load 128(c1) + 2838: 53(fvec2) ImageQueryLod 2836 2837 + 2839: 53(fvec2) Load 2733(lod) + 2840: 53(fvec2) FAdd 2839 2838 + Store 2733(lod) 2840 + 2841: 316 Load 318(s1DArrayShadow) + 2842: 6(float) Load 135(f16c1) + 2843: 154(fvec2) ImageQueryLod 2841 2842 + 2844: 53(fvec2) Load 2733(lod) + 2845: 53(fvec2) FAdd 2844 2843 + Store 2733(lod) 2845 + 2846: 337 Load 339(s2DArrayShadow) + 2847: 53(fvec2) Load 148(c2) + 2848: 53(fvec2) ImageQueryLod 2846 2847 + 2849: 53(fvec2) Load 2733(lod) + 2850: 53(fvec2) FAdd 2849 2848 + Store 2733(lod) 2850 + 2851: 337 Load 339(s2DArrayShadow) + 2852: 154(fvec2) Load 156(f16c2) + 2853: 154(fvec2) ImageQueryLod 2851 2852 + 2854: 53(fvec2) Load 2733(lod) + 2855: 53(fvec2) FAdd 2854 2853 + Store 2733(lod) 2855 + 2856: 391 Load 393(sCubeArrayShadow) + 2857: 167(fvec3) Load 169(c3) + 2858: 53(fvec2) ImageQueryLod 2856 2857 + 2859: 53(fvec2) Load 2733(lod) + 2860: 53(fvec2) FAdd 2859 2858 + Store 2733(lod) 2860 + 2861: 391 Load 393(sCubeArrayShadow) + 2862: 175(fvec3) Load 177(f16c3) + 2863: 154(fvec2) ImageQueryLod 2861 2862 + 2864: 53(fvec2) Load 2733(lod) + 2865: 53(fvec2) FAdd 2864 2863 + Store 2733(lod) 2865 + 2866: 53(fvec2) Load 2733(lod) + ReturnValue 2866 + FunctionEnd +58(testTextureQueryLevels(): 47(int) Function None 57 + 59: Label + 2869(levels): 2566(ptr) Variable Function + Store 2869(levels) 2187 + 2870: 123 Load 125(s1D) + 2871: 122 Image 2870 + 2872: 47(int) ImageQueryLevels 2871 + 2873: 47(int) Load 2869(levels) + 2874: 47(int) IAdd 2873 2872 + Store 2869(levels) 2874 + 2875: 143 Load 145(s2D) + 2876: 142 Image 2875 + 2877: 47(int) ImageQueryLevels 2876 + 2878: 47(int) Load 2869(levels) + 2879: 47(int) IAdd 2878 2877 + Store 2869(levels) 2879 + 2880: 163 Load 165(s3D) + 2881: 162 Image 2880 + 2882: 47(int) ImageQueryLevels 2881 + 2883: 47(int) Load 2869(levels) + 2884: 47(int) IAdd 2883 2882 + Store 2869(levels) 2884 + 2885: 184 Load 186(sCube) + 2886: 183 Image 2885 + 2887: 47(int) ImageQueryLevels 2886 + 2888: 47(int) Load 2869(levels) + 2889: 47(int) IAdd 2888 2887 + Store 2869(levels) 2889 + 2890: 199 Load 201(s1DShadow) + 2891: 198 Image 2890 + 2892: 47(int) ImageQueryLevels 2891 + 2893: 47(int) Load 2869(levels) + 2894: 47(int) IAdd 2893 2892 + Store 2869(levels) 2894 + 2895: 224 Load 226(s2DShadow) + 2896: 223 Image 2895 + 2897: 47(int) ImageQueryLevels 2896 + 2898: 47(int) Load 2869(levels) + 2899: 47(int) IAdd 2898 2897 + Store 2869(levels) 2899 + 2900: 245 Load 247(sCubeShadow) + 2901: 244 Image 2900 + 2902: 47(int) ImageQueryLevels 2901 + 2903: 47(int) Load 2869(levels) + 2904: 47(int) IAdd 2903 2902 + Store 2869(levels) 2904 + 2905: 299 Load 301(sCubeArray) + 2906: 298 Image 2905 + 2907: 47(int) ImageQueryLevels 2906 + 2908: 47(int) Load 2869(levels) + 2909: 47(int) IAdd 2908 2907 + Store 2869(levels) 2909 + 2910: 391 Load 393(sCubeArrayShadow) + 2911: 390 Image 2910 + 2912: 47(int) ImageQueryLevels 2911 + 2913: 47(int) Load 2869(levels) + 2914: 47(int) IAdd 2913 2912 + Store 2869(levels) 2914 + 2915: 269 Load 271(s1DArray) + 2916: 268 Image 2915 + 2917: 47(int) ImageQueryLevels 2916 + 2918: 47(int) Load 2869(levels) + 2919: 47(int) IAdd 2918 2917 + Store 2869(levels) 2919 + 2920: 284 Load 286(s2DArray) + 2921: 283 Image 2920 + 2922: 47(int) ImageQueryLevels 2921 + 2923: 47(int) Load 2869(levels) + 2924: 47(int) IAdd 2923 2922 + Store 2869(levels) 2924 + 2925: 316 Load 318(s1DArrayShadow) + 2926: 315 Image 2925 + 2927: 47(int) ImageQueryLevels 2926 + 2928: 47(int) Load 2869(levels) + 2929: 47(int) IAdd 2928 2927 + Store 2869(levels) 2929 + 2930: 337 Load 339(s2DArrayShadow) + 2931: 336 Image 2930 + 2932: 47(int) ImageQueryLevels 2931 + 2933: 47(int) Load 2869(levels) + 2934: 47(int) IAdd 2933 2932 + Store 2869(levels) 2934 + 2935: 47(int) Load 2869(levels) + ReturnValue 2935 + FunctionEnd +60(testTextureSamples(): 47(int) Function None 57 + 61: Label + 2938(samples): 2566(ptr) Variable Function + Store 2938(samples) 2187 + 2939: 1309 Load 1311(s2DMS) + 2940: 1308 Image 2939 + 2941: 47(int) ImageQuerySamples 2940 + 2942: 47(int) Load 2938(samples) + 2943: 47(int) IAdd 2942 2941 + Store 2938(samples) 2943 + 2944: 1320 Load 1322(s2DMSArray) + 2945: 1319 Image 2944 + 2946: 47(int) ImageQuerySamples 2945 + 2947: 47(int) Load 2938(samples) + 2948: 47(int) IAdd 2947 2946 + Store 2938(samples) 2948 + 2949: 47(int) Load 2938(samples) + ReturnValue 2949 + FunctionEnd +62(testImageLoad(): 7(fvec4) Function None 8 + 63: Label + 2952(texel): 64(ptr) Variable Function + Store 2952(texel) 121 + 2956: 2953 Load 2955(i1D) + 2957: 52(float) Load 128(c1) + 2958: 47(int) ConvertFToS 2957 + 2959: 7(fvec4) ImageRead 2956 2958 + 2960: 7(fvec4) Load 2952(texel) + 2961: 7(fvec4) FAdd 2960 2959 + Store 2952(texel) 2961 + 2965: 2962 Load 2964(i2D) + 2966: 53(fvec2) Load 148(c2) + 2967: 721(ivec2) ConvertFToS 2966 + 2968: 7(fvec4) ImageRead 2965 2967 + 2969: 7(fvec4) Load 2952(texel) + 2970: 7(fvec4) FAdd 2969 2968 + Store 2952(texel) 2970 + 2974: 2971 Load 2973(i3D) + 2975: 167(fvec3) Load 169(c3) + 2976: 734(ivec3) ConvertFToS 2975 + 2977: 7(fvec4) ImageRead 2974 2976 + 2978: 7(fvec4) Load 2952(texel) + 2979: 7(fvec4) FAdd 2978 2977 + Store 2952(texel) 2979 + 2983: 2980 Load 2982(i2DRect) + 2984: 53(fvec2) Load 148(c2) + 2985: 721(ivec2) ConvertFToS 2984 + 2986: 7(fvec4) ImageRead 2983 2985 + 2987: 7(fvec4) Load 2952(texel) + 2988: 7(fvec4) FAdd 2987 2986 + Store 2952(texel) 2988 + 2992: 2989 Load 2991(iCube) + 2993: 167(fvec3) Load 169(c3) + 2994: 734(ivec3) ConvertFToS 2993 + 2995: 7(fvec4) ImageRead 2992 2994 + 2996: 7(fvec4) Load 2952(texel) + 2997: 7(fvec4) FAdd 2996 2995 + Store 2952(texel) 2997 + 3001: 2998 Load 3000(iBuffer) + 3002: 52(float) Load 128(c1) + 3003: 47(int) ConvertFToS 3002 + 3004: 7(fvec4) ImageRead 3001 3003 + 3005: 7(fvec4) Load 2952(texel) + 3006: 7(fvec4) FAdd 3005 3004 + Store 2952(texel) 3006 + 3010: 3007 Load 3009(i1DArray) + 3011: 53(fvec2) Load 148(c2) + 3012: 721(ivec2) ConvertFToS 3011 + 3013: 7(fvec4) ImageRead 3010 3012 + 3014: 7(fvec4) Load 2952(texel) + 3015: 7(fvec4) FAdd 3014 3013 + Store 2952(texel) 3015 + 3019: 3016 Load 3018(i2DArray) + 3020: 167(fvec3) Load 169(c3) + 3021: 734(ivec3) ConvertFToS 3020 + 3022: 7(fvec4) ImageRead 3019 3021 + 3023: 7(fvec4) Load 2952(texel) + 3024: 7(fvec4) FAdd 3023 3022 + Store 2952(texel) 3024 + 3028: 3025 Load 3027(iCubeArray) + 3029: 167(fvec3) Load 169(c3) + 3030: 734(ivec3) ConvertFToS 3029 + 3031: 7(fvec4) ImageRead 3028 3030 + 3032: 7(fvec4) Load 2952(texel) + 3033: 7(fvec4) FAdd 3032 3031 + Store 2952(texel) 3033 + 3037: 3034 Load 3036(i2DMS) + 3038: 53(fvec2) Load 148(c2) + 3039: 721(ivec2) ConvertFToS 3038 + 3040: 7(fvec4) ImageRead 3037 3039 Sample 709 + 3041: 7(fvec4) Load 2952(texel) + 3042: 7(fvec4) FAdd 3041 3040 + Store 2952(texel) 3042 + 3046: 3043 Load 3045(i2DMSArray) + 3047: 167(fvec3) Load 169(c3) + 3048: 734(ivec3) ConvertFToS 3047 + 3049: 7(fvec4) ImageRead 3046 3048 Sample 709 + 3050: 7(fvec4) Load 2952(texel) + 3051: 7(fvec4) FAdd 3050 3049 + Store 2952(texel) 3051 + 3052: 7(fvec4) Load 2952(texel) + ReturnValue 3052 + FunctionEnd +67(testImageStore(vf164;): 2 Function None 65 + 66(data): 64(ptr) FunctionParameter + 68: Label + 3055: 2953 Load 2955(i1D) + 3056: 52(float) Load 128(c1) + 3057: 47(int) ConvertFToS 3056 + 3058: 7(fvec4) Load 66(data) + ImageWrite 3055 3057 3058 + 3059: 2962 Load 2964(i2D) + 3060: 53(fvec2) Load 148(c2) + 3061: 721(ivec2) ConvertFToS 3060 + 3062: 7(fvec4) Load 66(data) + ImageWrite 3059 3061 3062 + 3063: 2971 Load 2973(i3D) + 3064: 167(fvec3) Load 169(c3) + 3065: 734(ivec3) ConvertFToS 3064 + 3066: 7(fvec4) Load 66(data) + ImageWrite 3063 3065 3066 + 3067: 2980 Load 2982(i2DRect) + 3068: 53(fvec2) Load 148(c2) + 3069: 721(ivec2) ConvertFToS 3068 + 3070: 7(fvec4) Load 66(data) + ImageWrite 3067 3069 3070 + 3071: 2989 Load 2991(iCube) + 3072: 167(fvec3) Load 169(c3) + 3073: 734(ivec3) ConvertFToS 3072 + 3074: 7(fvec4) Load 66(data) + ImageWrite 3071 3073 3074 + 3075: 2998 Load 3000(iBuffer) + 3076: 52(float) Load 128(c1) + 3077: 47(int) ConvertFToS 3076 + 3078: 7(fvec4) Load 66(data) + ImageWrite 3075 3077 3078 + 3079: 3007 Load 3009(i1DArray) + 3080: 53(fvec2) Load 148(c2) + 3081: 721(ivec2) ConvertFToS 3080 + 3082: 7(fvec4) Load 66(data) + ImageWrite 3079 3081 3082 + 3083: 3016 Load 3018(i2DArray) + 3084: 167(fvec3) Load 169(c3) + 3085: 734(ivec3) ConvertFToS 3084 + 3086: 7(fvec4) Load 66(data) + ImageWrite 3083 3085 3086 + 3087: 3025 Load 3027(iCubeArray) + 3088: 167(fvec3) Load 169(c3) + 3089: 734(ivec3) ConvertFToS 3088 + 3090: 7(fvec4) Load 66(data) + ImageWrite 3087 3089 3090 + 3091: 3034 Load 3036(i2DMS) + 3092: 53(fvec2) Load 148(c2) + 3093: 721(ivec2) ConvertFToS 3092 + 3094: 7(fvec4) Load 66(data) + ImageWrite 3091 3093 3094 Sample 709 + 3095: 3043 Load 3045(i2DMSArray) + 3096: 167(fvec3) Load 169(c3) + 3097: 734(ivec3) ConvertFToS 3096 + 3098: 7(fvec4) Load 66(data) + ImageWrite 3095 3097 3098 Sample 709 + Return + FunctionEnd +69(testSparseTexture(): 7(fvec4) Function None 8 + 70: Label + 3099(texel): 64(ptr) Variable Function + Store 3099(texel) 121 + 3100: 143 Load 145(s2D) + 3101: 53(fvec2) Load 148(c2) + 3103:3102(ResType) ImageSparseSampleImplicitLod 3100 3101 + 3104: 7(fvec4) CompositeExtract 3103 1 + Store 3099(texel) 3104 + 3105: 47(int) CompositeExtract 3103 0 + 3106: 143 Load 145(s2D) + 3107: 154(fvec2) Load 156(f16c2) + 3108: 6(float) Load 137(f16bias) + 3109:3102(ResType) ImageSparseSampleImplicitLod 3106 3107 Bias 3108 + 3110: 7(fvec4) CompositeExtract 3109 1 + Store 3099(texel) 3110 + 3111: 47(int) CompositeExtract 3109 0 + 3112: 163 Load 165(s3D) + 3113: 167(fvec3) Load 169(c3) + 3114:3102(ResType) ImageSparseSampleImplicitLod 3112 3113 + 3115: 7(fvec4) CompositeExtract 3114 1 + Store 3099(texel) 3115 + 3116: 47(int) CompositeExtract 3114 0 + 3117: 163 Load 165(s3D) + 3118: 175(fvec3) Load 177(f16c3) + 3119: 6(float) Load 137(f16bias) + 3120:3102(ResType) ImageSparseSampleImplicitLod 3117 3118 Bias 3119 + 3121: 7(fvec4) CompositeExtract 3120 1 + Store 3099(texel) 3121 + 3122: 47(int) CompositeExtract 3120 0 + 3123: 184 Load 186(sCube) + 3124: 167(fvec3) Load 169(c3) + 3125:3102(ResType) ImageSparseSampleImplicitLod 3123 3124 + 3126: 7(fvec4) CompositeExtract 3125 1 + Store 3099(texel) 3126 + 3127: 47(int) CompositeExtract 3125 0 + 3128: 184 Load 186(sCube) + 3129: 175(fvec3) Load 177(f16c3) + 3130: 6(float) Load 137(f16bias) + 3131:3102(ResType) ImageSparseSampleImplicitLod 3128 3129 Bias 3130 + 3132: 7(fvec4) CompositeExtract 3131 1 + Store 3099(texel) 3132 + 3133: 47(int) CompositeExtract 3131 0 + 3134: 224 Load 226(s2DShadow) + 3135: 167(fvec3) Load 169(c3) + 3136: 208(ptr) AccessChain 3099(texel) 207 + 3137: 52(float) CompositeExtract 3135 2 + 3139:3138(ResType) ImageSparseSampleDrefImplicitLod 3134 3135 3137 + 3140: 6(float) CompositeExtract 3139 1 + Store 3136 3140 + 3141: 47(int) CompositeExtract 3139 0 + 3142: 224 Load 226(s2DShadow) + 3143: 154(fvec2) Load 156(f16c2) + 3144: 52(float) Load 215(compare) + 3145: 208(ptr) AccessChain 3099(texel) 207 + 3146: 6(float) Load 137(f16bias) + 3147:3138(ResType) ImageSparseSampleDrefImplicitLod 3142 3143 3144 Bias 3146 + 3148: 6(float) CompositeExtract 3147 1 + Store 3145 3148 + 3149: 47(int) CompositeExtract 3147 0 + 3150: 245 Load 247(sCubeShadow) + 3151: 249(fvec4) Load 251(c4) + 3152: 208(ptr) AccessChain 3099(texel) 207 + 3153: 52(float) CompositeExtract 3151 3 + 3154:3138(ResType) ImageSparseSampleDrefImplicitLod 3150 3151 3153 + 3155: 6(float) CompositeExtract 3154 1 + Store 3152 3155 + 3156: 47(int) CompositeExtract 3154 0 + 3157: 245 Load 247(sCubeShadow) + 3158: 175(fvec3) Load 177(f16c3) + 3159: 52(float) Load 215(compare) + 3160: 208(ptr) AccessChain 3099(texel) 207 + 3161: 6(float) Load 137(f16bias) + 3162:3138(ResType) ImageSparseSampleDrefImplicitLod 3157 3158 3159 Bias 3161 + 3163: 6(float) CompositeExtract 3162 1 + Store 3160 3163 + 3164: 47(int) CompositeExtract 3162 0 + 3165: 284 Load 286(s2DArray) + 3166: 167(fvec3) Load 169(c3) + 3167:3102(ResType) ImageSparseSampleImplicitLod 3165 3166 + 3168: 7(fvec4) CompositeExtract 3167 1 + Store 3099(texel) 3168 + 3169: 47(int) CompositeExtract 3167 0 + 3170: 284 Load 286(s2DArray) + 3171: 175(fvec3) Load 177(f16c3) + 3172: 6(float) Load 137(f16bias) + 3173:3102(ResType) ImageSparseSampleImplicitLod 3170 3171 Bias 3172 + 3174: 7(fvec4) CompositeExtract 3173 1 + Store 3099(texel) 3174 + 3175: 47(int) CompositeExtract 3173 0 + 3176: 299 Load 301(sCubeArray) + 3177: 249(fvec4) Load 251(c4) + 3178:3102(ResType) ImageSparseSampleImplicitLod 3176 3177 + 3179: 7(fvec4) CompositeExtract 3178 1 + Store 3099(texel) 3179 + 3180: 47(int) CompositeExtract 3178 0 + 3181: 299 Load 301(sCubeArray) + 3182: 7(fvec4) Load 309(f16c4) + 3183: 6(float) Load 137(f16bias) + 3184:3102(ResType) ImageSparseSampleImplicitLod 3181 3182 Bias 3183 + 3185: 7(fvec4) CompositeExtract 3184 1 + Store 3099(texel) 3185 + 3186: 47(int) CompositeExtract 3184 0 + 3187: 337 Load 339(s2DArrayShadow) + 3188: 249(fvec4) Load 251(c4) + 3189: 208(ptr) AccessChain 3099(texel) 207 + 3190: 52(float) CompositeExtract 3188 3 + 3191:3138(ResType) ImageSparseSampleDrefImplicitLod 3187 3188 3190 + 3192: 6(float) CompositeExtract 3191 1 + Store 3189 3192 + 3193: 47(int) CompositeExtract 3191 0 + 3194: 337 Load 339(s2DArrayShadow) + 3195: 175(fvec3) Load 177(f16c3) + 3196: 52(float) Load 215(compare) + 3197: 208(ptr) AccessChain 3099(texel) 207 + 3198:3138(ResType) ImageSparseSampleDrefImplicitLod 3194 3195 3196 + 3199: 6(float) CompositeExtract 3198 1 + Store 3197 3199 + 3200: 47(int) CompositeExtract 3198 0 + 3201: 357 Load 359(s2DRect) + 3202: 53(fvec2) Load 148(c2) + 3203:3102(ResType) ImageSparseSampleImplicitLod 3201 3202 + 3204: 7(fvec4) CompositeExtract 3203 1 + Store 3099(texel) 3204 + 3205: 47(int) CompositeExtract 3203 0 + 3206: 357 Load 359(s2DRect) + 3207: 154(fvec2) Load 156(f16c2) + 3208:3102(ResType) ImageSparseSampleImplicitLod 3206 3207 + 3209: 7(fvec4) CompositeExtract 3208 1 + Store 3099(texel) 3209 + 3210: 47(int) CompositeExtract 3208 0 + 3211: 371 Load 373(s2DRectShadow) + 3212: 167(fvec3) Load 169(c3) + 3213: 208(ptr) AccessChain 3099(texel) 207 + 3214: 52(float) CompositeExtract 3212 2 + 3215:3138(ResType) ImageSparseSampleDrefImplicitLod 3211 3212 3214 + 3216: 6(float) CompositeExtract 3215 1 + Store 3213 3216 + 3217: 47(int) CompositeExtract 3215 0 + 3218: 371 Load 373(s2DRectShadow) + 3219: 154(fvec2) Load 156(f16c2) + 3220: 52(float) Load 215(compare) + 3221: 208(ptr) AccessChain 3099(texel) 207 + 3222:3138(ResType) ImageSparseSampleDrefImplicitLod 3218 3219 3220 + 3223: 6(float) CompositeExtract 3222 1 + Store 3221 3223 + 3224: 47(int) CompositeExtract 3222 0 + 3225: 391 Load 393(sCubeArrayShadow) + 3226: 249(fvec4) Load 251(c4) + 3227: 52(float) Load 215(compare) + 3228: 208(ptr) AccessChain 3099(texel) 207 + 3229:3138(ResType) ImageSparseSampleDrefImplicitLod 3225 3226 3227 + 3230: 6(float) CompositeExtract 3229 1 + Store 3228 3230 + 3231: 47(int) CompositeExtract 3229 0 + 3232: 391 Load 393(sCubeArrayShadow) + 3233: 7(fvec4) Load 309(f16c4) + 3234: 52(float) Load 215(compare) + 3235: 208(ptr) AccessChain 3099(texel) 207 + 3236:3138(ResType) ImageSparseSampleDrefImplicitLod 3232 3233 3234 + 3237: 6(float) CompositeExtract 3236 1 + Store 3235 3237 + 3238: 47(int) CompositeExtract 3236 0 + 3239: 7(fvec4) Load 3099(texel) + ReturnValue 3239 + FunctionEnd +71(testSparseTextureLod(): 7(fvec4) Function None 8 + 72: Label + 3242(texel): 64(ptr) Variable Function + Store 3242(texel) 121 + 3243: 143 Load 145(s2D) + 3244: 53(fvec2) Load 148(c2) + 3245: 52(float) Load 565(lod) + 3246:3102(ResType) ImageSparseSampleExplicitLod 3243 3244 Lod 3245 + 3247: 7(fvec4) CompositeExtract 3246 1 + Store 3242(texel) 3247 + 3248: 47(int) CompositeExtract 3246 0 + 3249: 143 Load 145(s2D) + 3250: 154(fvec2) Load 156(f16c2) + 3251: 6(float) Load 572(f16lod) + 3252:3102(ResType) ImageSparseSampleExplicitLod 3249 3250 Lod 3251 + 3253: 7(fvec4) CompositeExtract 3252 1 + Store 3242(texel) 3253 + 3254: 47(int) CompositeExtract 3252 0 + 3255: 163 Load 165(s3D) + 3256: 167(fvec3) Load 169(c3) + 3257: 52(float) Load 565(lod) + 3258:3102(ResType) ImageSparseSampleExplicitLod 3255 3256 Lod 3257 + 3259: 7(fvec4) CompositeExtract 3258 1 + Store 3242(texel) 3259 + 3260: 47(int) CompositeExtract 3258 0 + 3261: 163 Load 165(s3D) + 3262: 175(fvec3) Load 177(f16c3) + 3263: 6(float) Load 572(f16lod) + 3264:3102(ResType) ImageSparseSampleExplicitLod 3261 3262 Lod 3263 + 3265: 7(fvec4) CompositeExtract 3264 1 + Store 3242(texel) 3265 + 3266: 47(int) CompositeExtract 3264 0 + 3267: 184 Load 186(sCube) + 3268: 167(fvec3) Load 169(c3) + 3269: 52(float) Load 565(lod) + 3270:3102(ResType) ImageSparseSampleExplicitLod 3267 3268 Lod 3269 + 3271: 7(fvec4) CompositeExtract 3270 1 + Store 3242(texel) 3271 + 3272: 47(int) CompositeExtract 3270 0 + 3273: 184 Load 186(sCube) + 3274: 175(fvec3) Load 177(f16c3) + 3275: 6(float) Load 572(f16lod) + 3276:3102(ResType) ImageSparseSampleExplicitLod 3273 3274 Lod 3275 + 3277: 7(fvec4) CompositeExtract 3276 1 + Store 3242(texel) 3277 + 3278: 47(int) CompositeExtract 3276 0 + 3279: 224 Load 226(s2DShadow) + 3280: 167(fvec3) Load 169(c3) + 3281: 52(float) Load 565(lod) + 3282: 208(ptr) AccessChain 3242(texel) 207 + 3283: 52(float) CompositeExtract 3280 2 + 3284:3138(ResType) ImageSparseSampleDrefExplicitLod 3279 3280 3283 Lod 3281 + 3285: 6(float) CompositeExtract 3284 1 + Store 3282 3285 + 3286: 47(int) CompositeExtract 3284 0 + 3287: 224 Load 226(s2DShadow) + 3288: 154(fvec2) Load 156(f16c2) + 3289: 52(float) Load 215(compare) + 3290: 6(float) Load 572(f16lod) + 3291: 208(ptr) AccessChain 3242(texel) 207 + 3292:3138(ResType) ImageSparseSampleDrefExplicitLod 3287 3288 3289 Lod 3290 + 3293: 6(float) CompositeExtract 3292 1 + Store 3291 3293 + 3294: 47(int) CompositeExtract 3292 0 + 3295: 284 Load 286(s2DArray) + 3296: 167(fvec3) Load 169(c3) + 3297: 52(float) Load 565(lod) + 3298:3102(ResType) ImageSparseSampleExplicitLod 3295 3296 Lod 3297 + 3299: 7(fvec4) CompositeExtract 3298 1 + Store 3242(texel) 3299 + 3300: 47(int) CompositeExtract 3298 0 + 3301: 284 Load 286(s2DArray) + 3302: 175(fvec3) Load 177(f16c3) + 3303: 6(float) Load 572(f16lod) + 3304:3102(ResType) ImageSparseSampleExplicitLod 3301 3302 Lod 3303 + 3305: 7(fvec4) CompositeExtract 3304 1 + Store 3242(texel) 3305 + 3306: 47(int) CompositeExtract 3304 0 + 3307: 299 Load 301(sCubeArray) + 3308: 249(fvec4) Load 251(c4) + 3309: 52(float) Load 565(lod) + 3310:3102(ResType) ImageSparseSampleExplicitLod 3307 3308 Lod 3309 + 3311: 7(fvec4) CompositeExtract 3310 1 + Store 3242(texel) 3311 + 3312: 47(int) CompositeExtract 3310 0 + 3313: 299 Load 301(sCubeArray) + 3314: 7(fvec4) Load 309(f16c4) + 3315: 6(float) Load 572(f16lod) + 3316:3102(ResType) ImageSparseSampleExplicitLod 3313 3314 Lod 3315 + 3317: 7(fvec4) CompositeExtract 3316 1 + Store 3242(texel) 3317 + 3318: 47(int) CompositeExtract 3316 0 + 3319: 7(fvec4) Load 3242(texel) + ReturnValue 3319 + FunctionEnd +73(testSparseTextureOffset(): 7(fvec4) Function None 8 + 74: Label + 3322(texel): 64(ptr) Variable Function + Store 3322(texel) 121 + 3323: 143 Load 145(s2D) + 3324: 53(fvec2) Load 148(c2) + 3325:3102(ResType) ImageSparseSampleImplicitLod 3323 3324 ConstOffset 722 + 3326: 7(fvec4) CompositeExtract 3325 1 + Store 3322(texel) 3326 + 3327: 47(int) CompositeExtract 3325 0 + 3328: 143 Load 145(s2D) + 3329: 154(fvec2) Load 156(f16c2) + 3330: 6(float) Load 137(f16bias) + 3331:3102(ResType) ImageSparseSampleImplicitLod 3328 3329 Bias ConstOffset 3330 722 + 3332: 7(fvec4) CompositeExtract 3331 1 + Store 3322(texel) 3332 + 3333: 47(int) CompositeExtract 3331 0 + 3334: 163 Load 165(s3D) + 3335: 167(fvec3) Load 169(c3) + 3336:3102(ResType) ImageSparseSampleImplicitLod 3334 3335 ConstOffset 735 + 3337: 7(fvec4) CompositeExtract 3336 1 + Store 3322(texel) 3337 + 3338: 47(int) CompositeExtract 3336 0 + 3339: 163 Load 165(s3D) + 3340: 175(fvec3) Load 177(f16c3) + 3341: 6(float) Load 137(f16bias) + 3342:3102(ResType) ImageSparseSampleImplicitLod 3339 3340 Bias ConstOffset 3341 735 + 3343: 7(fvec4) CompositeExtract 3342 1 + Store 3322(texel) 3343 + 3344: 47(int) CompositeExtract 3342 0 + 3345: 357 Load 359(s2DRect) + 3346: 53(fvec2) Load 148(c2) + 3347:3102(ResType) ImageSparseSampleImplicitLod 3345 3346 ConstOffset 722 + 3348: 7(fvec4) CompositeExtract 3347 1 + Store 3322(texel) 3348 + 3349: 47(int) CompositeExtract 3347 0 + 3350: 357 Load 359(s2DRect) + 3351: 154(fvec2) Load 156(f16c2) + 3352:3102(ResType) ImageSparseSampleImplicitLod 3350 3351 ConstOffset 722 + 3353: 7(fvec4) CompositeExtract 3352 1 + Store 3322(texel) 3353 + 3354: 47(int) CompositeExtract 3352 0 + 3355: 371 Load 373(s2DRectShadow) + 3356: 167(fvec3) Load 169(c3) + 3357: 208(ptr) AccessChain 3322(texel) 207 + 3358: 52(float) CompositeExtract 3356 2 + 3359:3138(ResType) ImageSparseSampleDrefImplicitLod 3355 3356 3358 ConstOffset 722 + 3360: 6(float) CompositeExtract 3359 1 + Store 3357 3360 + 3361: 47(int) CompositeExtract 3359 0 + 3362: 371 Load 373(s2DRectShadow) + 3363: 154(fvec2) Load 156(f16c2) + 3364: 52(float) Load 215(compare) + 3365: 208(ptr) AccessChain 3322(texel) 207 + 3366:3138(ResType) ImageSparseSampleDrefImplicitLod 3362 3363 3364 ConstOffset 722 + 3367: 6(float) CompositeExtract 3366 1 + Store 3365 3367 + 3368: 47(int) CompositeExtract 3366 0 + 3369: 224 Load 226(s2DShadow) + 3370: 167(fvec3) Load 169(c3) + 3371: 208(ptr) AccessChain 3322(texel) 207 + 3372: 52(float) CompositeExtract 3370 2 + 3373:3138(ResType) ImageSparseSampleDrefImplicitLod 3369 3370 3372 ConstOffset 722 + 3374: 6(float) CompositeExtract 3373 1 + Store 3371 3374 + 3375: 47(int) CompositeExtract 3373 0 + 3376: 224 Load 226(s2DShadow) + 3377: 154(fvec2) Load 156(f16c2) + 3378: 52(float) Load 215(compare) + 3379: 208(ptr) AccessChain 3322(texel) 207 + 3380: 6(float) Load 137(f16bias) + 3381:3138(ResType) ImageSparseSampleDrefImplicitLod 3376 3377 3378 Bias ConstOffset 3380 722 + 3382: 6(float) CompositeExtract 3381 1 + Store 3379 3382 + 3383: 47(int) CompositeExtract 3381 0 + 3384: 284 Load 286(s2DArray) + 3385: 167(fvec3) Load 169(c3) + 3386:3102(ResType) ImageSparseSampleImplicitLod 3384 3385 ConstOffset 722 + 3387: 7(fvec4) CompositeExtract 3386 1 + Store 3322(texel) 3387 + 3388: 47(int) CompositeExtract 3386 0 + 3389: 284 Load 286(s2DArray) + 3390: 175(fvec3) Load 177(f16c3) + 3391: 6(float) Load 137(f16bias) + 3392:3102(ResType) ImageSparseSampleImplicitLod 3389 3390 Bias ConstOffset 3391 722 + 3393: 7(fvec4) CompositeExtract 3392 1 + Store 3322(texel) 3393 + 3394: 47(int) CompositeExtract 3392 0 + 3395: 337 Load 339(s2DArrayShadow) + 3396: 249(fvec4) Load 251(c4) + 3397: 208(ptr) AccessChain 3322(texel) 207 + 3398: 52(float) CompositeExtract 3396 3 + 3399:3138(ResType) ImageSparseSampleDrefImplicitLod 3395 3396 3398 ConstOffset 722 + 3400: 6(float) CompositeExtract 3399 1 + Store 3397 3400 + 3401: 47(int) CompositeExtract 3399 0 + 3402: 337 Load 339(s2DArrayShadow) + 3403: 175(fvec3) Load 177(f16c3) + 3404: 52(float) Load 215(compare) + 3405: 208(ptr) AccessChain 3322(texel) 207 + 3406:3138(ResType) ImageSparseSampleDrefImplicitLod 3402 3403 3404 ConstOffset 722 + 3407: 6(float) CompositeExtract 3406 1 + Store 3405 3407 + 3408: 47(int) CompositeExtract 3406 0 + 3409: 7(fvec4) Load 3322(texel) + ReturnValue 3409 + FunctionEnd +75(testSparseTextureLodOffset(): 7(fvec4) Function None 8 + 76: Label + 3412(texel): 64(ptr) Variable Function + Store 3412(texel) 121 + 3413: 143 Load 145(s2D) + 3414: 53(fvec2) Load 148(c2) + 3415: 52(float) Load 565(lod) + 3416:3102(ResType) ImageSparseSampleExplicitLod 3413 3414 Lod ConstOffset 3415 722 + 3417: 7(fvec4) CompositeExtract 3416 1 + Store 3412(texel) 3417 + 3418: 47(int) CompositeExtract 3416 0 + 3419: 143 Load 145(s2D) + 3420: 154(fvec2) Load 156(f16c2) + 3421: 6(float) Load 572(f16lod) + 3422:3102(ResType) ImageSparseSampleExplicitLod 3419 3420 Lod ConstOffset 3421 722 + 3423: 7(fvec4) CompositeExtract 3422 1 + Store 3412(texel) 3423 + 3424: 47(int) CompositeExtract 3422 0 + 3425: 163 Load 165(s3D) + 3426: 167(fvec3) Load 169(c3) + 3427: 52(float) Load 565(lod) + 3428:3102(ResType) ImageSparseSampleExplicitLod 3425 3426 Lod ConstOffset 3427 735 + 3429: 7(fvec4) CompositeExtract 3428 1 + Store 3412(texel) 3429 + 3430: 47(int) CompositeExtract 3428 0 + 3431: 163 Load 165(s3D) + 3432: 175(fvec3) Load 177(f16c3) + 3433: 6(float) Load 572(f16lod) + 3434:3102(ResType) ImageSparseSampleExplicitLod 3431 3432 Lod ConstOffset 3433 735 + 3435: 7(fvec4) CompositeExtract 3434 1 + Store 3412(texel) 3435 + 3436: 47(int) CompositeExtract 3434 0 + 3437: 224 Load 226(s2DShadow) + 3438: 167(fvec3) Load 169(c3) + 3439: 52(float) Load 565(lod) + 3440: 208(ptr) AccessChain 3412(texel) 207 + 3441: 52(float) CompositeExtract 3438 2 + 3442:3138(ResType) ImageSparseSampleDrefExplicitLod 3437 3438 3441 Lod ConstOffset 3439 722 + 3443: 6(float) CompositeExtract 3442 1 + Store 3440 3443 + 3444: 47(int) CompositeExtract 3442 0 + 3445: 224 Load 226(s2DShadow) + 3446: 154(fvec2) Load 156(f16c2) + 3447: 52(float) Load 215(compare) + 3448: 6(float) Load 572(f16lod) + 3449: 208(ptr) AccessChain 3412(texel) 207 + 3450:3138(ResType) ImageSparseSampleDrefExplicitLod 3445 3446 3447 Lod ConstOffset 3448 722 + 3451: 6(float) CompositeExtract 3450 1 + Store 3449 3451 + 3452: 47(int) CompositeExtract 3450 0 + 3453: 284 Load 286(s2DArray) + 3454: 167(fvec3) Load 169(c3) + 3455: 52(float) Load 565(lod) + 3456:3102(ResType) ImageSparseSampleExplicitLod 3453 3454 Lod ConstOffset 3455 722 + 3457: 7(fvec4) CompositeExtract 3456 1 + Store 3412(texel) 3457 + 3458: 47(int) CompositeExtract 3456 0 + 3459: 284 Load 286(s2DArray) + 3460: 175(fvec3) Load 177(f16c3) + 3461: 6(float) Load 572(f16lod) + 3462:3102(ResType) ImageSparseSampleExplicitLod 3459 3460 Lod ConstOffset 3461 722 + 3463: 7(fvec4) CompositeExtract 3462 1 + Store 3412(texel) 3463 + 3464: 47(int) CompositeExtract 3462 0 + 3465: 7(fvec4) Load 3412(texel) + ReturnValue 3465 + FunctionEnd +77(testSparseTextureGrad(): 7(fvec4) Function None 8 + 78: Label + 3468(texel): 64(ptr) Variable Function + Store 3468(texel) 121 + 3469: 143 Load 145(s2D) + 3470: 53(fvec2) Load 148(c2) + 3471: 53(fvec2) Load 1409(dPdxy2) + 3472: 53(fvec2) Load 1409(dPdxy2) + 3473:3102(ResType) ImageSparseSampleExplicitLod 3469 3470 Grad 3471 3472 + 3474: 7(fvec4) CompositeExtract 3473 1 + Store 3468(texel) 3474 + 3475: 47(int) CompositeExtract 3473 0 + 3476: 143 Load 145(s2D) + 3477: 154(fvec2) Load 156(f16c2) + 3478: 154(fvec2) Load 1417(f16dPdxy2) + 3479: 154(fvec2) Load 1417(f16dPdxy2) + 3480:3102(ResType) ImageSparseSampleExplicitLod 3476 3477 Grad 3478 3479 + 3481: 7(fvec4) CompositeExtract 3480 1 + Store 3468(texel) 3481 + 3482: 47(int) CompositeExtract 3480 0 + 3483: 163 Load 165(s3D) + 3484: 167(fvec3) Load 169(c3) + 3485: 167(fvec3) Load 1425(dPdxy3) + 3486: 167(fvec3) Load 1425(dPdxy3) + 3487:3102(ResType) ImageSparseSampleExplicitLod 3483 3484 Grad 3485 3486 + 3488: 7(fvec4) CompositeExtract 3487 1 + Store 3468(texel) 3488 + 3489: 47(int) CompositeExtract 3487 0 + 3490: 163 Load 165(s3D) + 3491: 175(fvec3) Load 177(f16c3) + 3492: 175(fvec3) Load 1433(f16dPdxy3) + 3493: 175(fvec3) Load 1433(f16dPdxy3) + 3494:3102(ResType) ImageSparseSampleExplicitLod 3490 3491 Grad 3492 3493 + 3495: 7(fvec4) CompositeExtract 3494 1 + Store 3468(texel) 3495 + 3496: 47(int) CompositeExtract 3494 0 + 3497: 184 Load 186(sCube) + 3498: 167(fvec3) Load 169(c3) + 3499: 167(fvec3) Load 1425(dPdxy3) + 3500: 167(fvec3) Load 1425(dPdxy3) + 3501:3102(ResType) ImageSparseSampleExplicitLod 3497 3498 Grad 3499 3500 + 3502: 7(fvec4) CompositeExtract 3501 1 + Store 3468(texel) 3502 + 3503: 47(int) CompositeExtract 3501 0 + 3504: 184 Load 186(sCube) + 3505: 175(fvec3) Load 177(f16c3) + 3506: 175(fvec3) Load 1433(f16dPdxy3) + 3507: 175(fvec3) Load 1433(f16dPdxy3) + 3508:3102(ResType) ImageSparseSampleExplicitLod 3504 3505 Grad 3506 3507 + 3509: 7(fvec4) CompositeExtract 3508 1 + Store 3468(texel) 3509 + 3510: 47(int) CompositeExtract 3508 0 + 3511: 357 Load 359(s2DRect) + 3512: 53(fvec2) Load 148(c2) + 3513: 53(fvec2) Load 1409(dPdxy2) + 3514: 53(fvec2) Load 1409(dPdxy2) + 3515:3102(ResType) ImageSparseSampleExplicitLod 3511 3512 Grad 3513 3514 + 3516: 7(fvec4) CompositeExtract 3515 1 + Store 3468(texel) 3516 + 3517: 47(int) CompositeExtract 3515 0 + 3518: 357 Load 359(s2DRect) + 3519: 154(fvec2) Load 156(f16c2) + 3520: 154(fvec2) Load 1417(f16dPdxy2) + 3521: 154(fvec2) Load 1417(f16dPdxy2) + 3522:3102(ResType) ImageSparseSampleExplicitLod 3518 3519 Grad 3520 3521 + 3523: 7(fvec4) CompositeExtract 3522 1 + Store 3468(texel) 3523 + 3524: 47(int) CompositeExtract 3522 0 + 3525: 371 Load 373(s2DRectShadow) + 3526: 167(fvec3) Load 169(c3) + 3527: 53(fvec2) Load 1409(dPdxy2) + 3528: 53(fvec2) Load 1409(dPdxy2) + 3529: 208(ptr) AccessChain 3468(texel) 207 + 3530: 52(float) CompositeExtract 3526 2 + 3531:3138(ResType) ImageSparseSampleDrefExplicitLod 3525 3526 3530 Grad 3527 3528 + 3532: 6(float) CompositeExtract 3531 1 + Store 3529 3532 + 3533: 47(int) CompositeExtract 3531 0 + 3534: 371 Load 373(s2DRectShadow) + 3535: 154(fvec2) Load 156(f16c2) + 3536: 52(float) Load 215(compare) + 3537: 154(fvec2) Load 1417(f16dPdxy2) + 3538: 154(fvec2) Load 1417(f16dPdxy2) + 3539: 208(ptr) AccessChain 3468(texel) 207 + 3540:3138(ResType) ImageSparseSampleDrefExplicitLod 3534 3535 3536 Grad 3537 3538 + 3541: 6(float) CompositeExtract 3540 1 + Store 3539 3541 + 3542: 47(int) CompositeExtract 3540 0 + 3543: 224 Load 226(s2DShadow) + 3544: 167(fvec3) Load 169(c3) + 3545: 53(fvec2) Load 1409(dPdxy2) + 3546: 53(fvec2) Load 1409(dPdxy2) + 3547: 208(ptr) AccessChain 3468(texel) 207 + 3548: 52(float) CompositeExtract 3544 2 + 3549:3138(ResType) ImageSparseSampleDrefExplicitLod 3543 3544 3548 Grad 3545 3546 + 3550: 6(float) CompositeExtract 3549 1 + Store 3547 3550 + 3551: 47(int) CompositeExtract 3549 0 + 3552: 224 Load 226(s2DShadow) + 3553: 154(fvec2) Load 156(f16c2) + 3554: 52(float) Load 215(compare) + 3555: 154(fvec2) Load 1417(f16dPdxy2) + 3556: 154(fvec2) Load 1417(f16dPdxy2) + 3557: 208(ptr) AccessChain 3468(texel) 207 + 3558:3138(ResType) ImageSparseSampleDrefExplicitLod 3552 3553 3554 Grad 3555 3556 + 3559: 6(float) CompositeExtract 3558 1 + Store 3557 3559 + 3560: 47(int) CompositeExtract 3558 0 + 3561: 245 Load 247(sCubeShadow) + 3562: 249(fvec4) Load 251(c4) + 3563: 167(fvec3) Load 1425(dPdxy3) + 3564: 167(fvec3) Load 1425(dPdxy3) + 3565: 208(ptr) AccessChain 3468(texel) 207 + 3566: 52(float) CompositeExtract 3562 3 + 3567:3138(ResType) ImageSparseSampleDrefExplicitLod 3561 3562 3566 Grad 3563 3564 + 3568: 6(float) CompositeExtract 3567 1 + Store 3565 3568 + 3569: 47(int) CompositeExtract 3567 0 + 3570: 245 Load 247(sCubeShadow) + 3571: 175(fvec3) Load 177(f16c3) + 3572: 52(float) Load 215(compare) + 3573: 175(fvec3) Load 1433(f16dPdxy3) + 3574: 175(fvec3) Load 1433(f16dPdxy3) + 3575: 208(ptr) AccessChain 3468(texel) 207 + 3576:3138(ResType) ImageSparseSampleDrefExplicitLod 3570 3571 3572 Grad 3573 3574 + 3577: 6(float) CompositeExtract 3576 1 + Store 3575 3577 + 3578: 47(int) CompositeExtract 3576 0 + 3579: 284 Load 286(s2DArray) + 3580: 167(fvec3) Load 169(c3) + 3581: 53(fvec2) Load 1409(dPdxy2) + 3582: 53(fvec2) Load 1409(dPdxy2) + 3583:3102(ResType) ImageSparseSampleExplicitLod 3579 3580 Grad 3581 3582 + 3584: 7(fvec4) CompositeExtract 3583 1 + Store 3468(texel) 3584 + 3585: 47(int) CompositeExtract 3583 0 + 3586: 284 Load 286(s2DArray) + 3587: 175(fvec3) Load 177(f16c3) + 3588: 154(fvec2) Load 1417(f16dPdxy2) + 3589: 154(fvec2) Load 1417(f16dPdxy2) + 3590:3102(ResType) ImageSparseSampleExplicitLod 3586 3587 Grad 3588 3589 + 3591: 7(fvec4) CompositeExtract 3590 1 + Store 3468(texel) 3591 + 3592: 47(int) CompositeExtract 3590 0 + 3593: 337 Load 339(s2DArrayShadow) + 3594: 249(fvec4) Load 251(c4) + 3595: 53(fvec2) Load 1409(dPdxy2) + 3596: 53(fvec2) Load 1409(dPdxy2) + 3597: 208(ptr) AccessChain 3468(texel) 207 + 3598: 52(float) CompositeExtract 3594 3 + 3599:3138(ResType) ImageSparseSampleDrefExplicitLod 3593 3594 3598 Grad 3595 3596 + 3600: 6(float) CompositeExtract 3599 1 + Store 3597 3600 + 3601: 47(int) CompositeExtract 3599 0 + 3602: 337 Load 339(s2DArrayShadow) + 3603: 175(fvec3) Load 177(f16c3) + 3604: 52(float) Load 215(compare) + 3605: 154(fvec2) Load 1417(f16dPdxy2) + 3606: 154(fvec2) Load 1417(f16dPdxy2) + 3607: 208(ptr) AccessChain 3468(texel) 207 + 3608:3138(ResType) ImageSparseSampleDrefExplicitLod 3602 3603 3604 Grad 3605 3606 + 3609: 6(float) CompositeExtract 3608 1 + Store 3607 3609 + 3610: 47(int) CompositeExtract 3608 0 + 3611: 299 Load 301(sCubeArray) + 3612: 249(fvec4) Load 251(c4) + 3613: 167(fvec3) Load 1425(dPdxy3) + 3614: 167(fvec3) Load 1425(dPdxy3) + 3615:3102(ResType) ImageSparseSampleExplicitLod 3611 3612 Grad 3613 3614 + 3616: 7(fvec4) CompositeExtract 3615 1 + Store 3468(texel) 3616 + 3617: 47(int) CompositeExtract 3615 0 + 3618: 299 Load 301(sCubeArray) + 3619: 7(fvec4) Load 309(f16c4) + 3620: 175(fvec3) Load 1433(f16dPdxy3) + 3621: 175(fvec3) Load 1433(f16dPdxy3) + 3622:3102(ResType) ImageSparseSampleExplicitLod 3618 3619 Grad 3620 3621 + 3623: 7(fvec4) CompositeExtract 3622 1 + Store 3468(texel) 3623 + 3624: 47(int) CompositeExtract 3622 0 + 3625: 7(fvec4) Load 3468(texel) + ReturnValue 3625 + FunctionEnd +79(testSparseTextureGradOffset(): 7(fvec4) Function None 8 + 80: Label + 3628(texel): 64(ptr) Variable Function + Store 3628(texel) 121 + 3629: 143 Load 145(s2D) + 3630: 53(fvec2) Load 148(c2) + 3631: 53(fvec2) Load 1409(dPdxy2) + 3632: 53(fvec2) Load 1409(dPdxy2) + 3633:3102(ResType) ImageSparseSampleExplicitLod 3629 3630 Grad ConstOffset 3631 3632 722 + 3634: 7(fvec4) CompositeExtract 3633 1 + Store 3628(texel) 3634 + 3635: 47(int) CompositeExtract 3633 0 + 3636: 143 Load 145(s2D) + 3637: 154(fvec2) Load 156(f16c2) + 3638: 154(fvec2) Load 1417(f16dPdxy2) + 3639: 154(fvec2) Load 1417(f16dPdxy2) + 3640:3102(ResType) ImageSparseSampleExplicitLod 3636 3637 Grad ConstOffset 3638 3639 722 + 3641: 7(fvec4) CompositeExtract 3640 1 + Store 3628(texel) 3641 + 3642: 47(int) CompositeExtract 3640 0 + 3643: 163 Load 165(s3D) + 3644: 167(fvec3) Load 169(c3) + 3645: 167(fvec3) Load 1425(dPdxy3) + 3646: 167(fvec3) Load 1425(dPdxy3) + 3647:3102(ResType) ImageSparseSampleExplicitLod 3643 3644 Grad ConstOffset 3645 3646 735 + 3648: 7(fvec4) CompositeExtract 3647 1 + Store 3628(texel) 3648 + 3649: 47(int) CompositeExtract 3647 0 + 3650: 163 Load 165(s3D) + 3651: 175(fvec3) Load 177(f16c3) + 3652: 175(fvec3) Load 1433(f16dPdxy3) + 3653: 175(fvec3) Load 1433(f16dPdxy3) + 3654:3102(ResType) ImageSparseSampleExplicitLod 3650 3651 Grad ConstOffset 3652 3653 735 + 3655: 7(fvec4) CompositeExtract 3654 1 + Store 3628(texel) 3655 + 3656: 47(int) CompositeExtract 3654 0 + 3657: 357 Load 359(s2DRect) + 3658: 53(fvec2) Load 148(c2) + 3659: 53(fvec2) Load 1409(dPdxy2) + 3660: 53(fvec2) Load 1409(dPdxy2) + 3661:3102(ResType) ImageSparseSampleExplicitLod 3657 3658 Grad ConstOffset 3659 3660 722 + 3662: 7(fvec4) CompositeExtract 3661 1 + Store 3628(texel) 3662 + 3663: 47(int) CompositeExtract 3661 0 + 3664: 357 Load 359(s2DRect) + 3665: 154(fvec2) Load 156(f16c2) + 3666: 154(fvec2) Load 1417(f16dPdxy2) + 3667: 154(fvec2) Load 1417(f16dPdxy2) + 3668:3102(ResType) ImageSparseSampleExplicitLod 3664 3665 Grad ConstOffset 3666 3667 722 + 3669: 7(fvec4) CompositeExtract 3668 1 + Store 3628(texel) 3669 + 3670: 47(int) CompositeExtract 3668 0 + 3671: 371 Load 373(s2DRectShadow) + 3672: 167(fvec3) Load 169(c3) + 3673: 53(fvec2) Load 1409(dPdxy2) + 3674: 53(fvec2) Load 1409(dPdxy2) + 3675: 208(ptr) AccessChain 3628(texel) 207 + 3676: 52(float) CompositeExtract 3672 2 + 3677:3138(ResType) ImageSparseSampleDrefExplicitLod 3671 3672 3676 Grad ConstOffset 3673 3674 722 + 3678: 6(float) CompositeExtract 3677 1 + Store 3675 3678 + 3679: 47(int) CompositeExtract 3677 0 + 3680: 371 Load 373(s2DRectShadow) + 3681: 154(fvec2) Load 156(f16c2) + 3682: 52(float) Load 215(compare) + 3683: 154(fvec2) Load 1417(f16dPdxy2) + 3684: 154(fvec2) Load 1417(f16dPdxy2) + 3685: 208(ptr) AccessChain 3628(texel) 207 + 3686:3138(ResType) ImageSparseSampleDrefExplicitLod 3680 3681 3682 Grad ConstOffset 3683 3684 722 + 3687: 6(float) CompositeExtract 3686 1 + Store 3685 3687 + 3688: 47(int) CompositeExtract 3686 0 + 3689: 224 Load 226(s2DShadow) + 3690: 167(fvec3) Load 169(c3) + 3691: 53(fvec2) Load 1409(dPdxy2) + 3692: 53(fvec2) Load 1409(dPdxy2) + 3693: 208(ptr) AccessChain 3628(texel) 207 + 3694: 52(float) CompositeExtract 3690 2 + 3695:3138(ResType) ImageSparseSampleDrefExplicitLod 3689 3690 3694 Grad ConstOffset 3691 3692 722 + 3696: 6(float) CompositeExtract 3695 1 + Store 3693 3696 + 3697: 47(int) CompositeExtract 3695 0 + 3698: 224 Load 226(s2DShadow) + 3699: 154(fvec2) Load 156(f16c2) + 3700: 52(float) Load 215(compare) + 3701: 154(fvec2) Load 1417(f16dPdxy2) + 3702: 154(fvec2) Load 1417(f16dPdxy2) + 3703: 208(ptr) AccessChain 3628(texel) 207 + 3704:3138(ResType) ImageSparseSampleDrefExplicitLod 3698 3699 3700 Grad ConstOffset 3701 3702 722 + 3705: 6(float) CompositeExtract 3704 1 + Store 3703 3705 + 3706: 47(int) CompositeExtract 3704 0 + 3707: 284 Load 286(s2DArray) + 3708: 167(fvec3) Load 169(c3) + 3709: 53(fvec2) Load 1409(dPdxy2) + 3710: 53(fvec2) Load 1409(dPdxy2) + 3711:3102(ResType) ImageSparseSampleExplicitLod 3707 3708 Grad ConstOffset 3709 3710 722 + 3712: 7(fvec4) CompositeExtract 3711 1 + Store 3628(texel) 3712 + 3713: 47(int) CompositeExtract 3711 0 + 3714: 284 Load 286(s2DArray) + 3715: 175(fvec3) Load 177(f16c3) + 3716: 154(fvec2) Load 1417(f16dPdxy2) + 3717: 154(fvec2) Load 1417(f16dPdxy2) + 3718:3102(ResType) ImageSparseSampleExplicitLod 3714 3715 Grad ConstOffset 3716 3717 722 + 3719: 7(fvec4) CompositeExtract 3718 1 + Store 3628(texel) 3719 + 3720: 47(int) CompositeExtract 3718 0 + 3721: 337 Load 339(s2DArrayShadow) + 3722: 249(fvec4) Load 251(c4) + 3723: 53(fvec2) Load 1409(dPdxy2) + 3724: 53(fvec2) Load 1409(dPdxy2) + 3725: 208(ptr) AccessChain 3628(texel) 207 + 3726: 52(float) CompositeExtract 3722 3 + 3727:3138(ResType) ImageSparseSampleDrefExplicitLod 3721 3722 3726 Grad ConstOffset 3723 3724 722 + 3728: 6(float) CompositeExtract 3727 1 + Store 3725 3728 + 3729: 47(int) CompositeExtract 3727 0 + 3730: 337 Load 339(s2DArrayShadow) + 3731: 175(fvec3) Load 177(f16c3) + 3732: 52(float) Load 215(compare) + 3733: 154(fvec2) Load 1417(f16dPdxy2) + 3734: 154(fvec2) Load 1417(f16dPdxy2) + 3735: 208(ptr) AccessChain 3628(texel) 207 + 3736:3138(ResType) ImageSparseSampleDrefExplicitLod 3730 3731 3732 Grad ConstOffset 3733 3734 722 + 3737: 6(float) CompositeExtract 3736 1 + Store 3735 3737 + 3738: 47(int) CompositeExtract 3736 0 + 3739: 7(fvec4) Load 3628(texel) + ReturnValue 3739 + FunctionEnd +81(testSparseTexelFetch(): 7(fvec4) Function None 8 + 82: Label + 3742(texel): 64(ptr) Variable Function + Store 3742(texel) 121 + 3743: 143 Load 145(s2D) + 3744: 53(fvec2) Load 148(c2) + 3745: 721(ivec2) ConvertFToS 3744 + 3746: 52(float) Load 565(lod) + 3747: 47(int) ConvertFToS 3746 + 3748: 142 Image 3743 + 3749:3102(ResType) ImageSparseFetch 3748 3745 Lod 3747 + 3750: 7(fvec4) CompositeExtract 3749 1 + Store 3742(texel) 3750 + 3751: 47(int) CompositeExtract 3749 0 + 3752: 163 Load 165(s3D) + 3753: 167(fvec3) Load 169(c3) + 3754: 734(ivec3) ConvertFToS 3753 + 3755: 52(float) Load 565(lod) + 3756: 47(int) ConvertFToS 3755 + 3757: 162 Image 3752 + 3758:3102(ResType) ImageSparseFetch 3757 3754 Lod 3756 + 3759: 7(fvec4) CompositeExtract 3758 1 + Store 3742(texel) 3759 + 3760: 47(int) CompositeExtract 3758 0 + 3761: 357 Load 359(s2DRect) + 3762: 53(fvec2) Load 148(c2) + 3763: 721(ivec2) ConvertFToS 3762 + 3764: 356 Image 3761 + 3765:3102(ResType) ImageSparseFetch 3764 3763 + 3766: 7(fvec4) CompositeExtract 3765 1 + Store 3742(texel) 3766 + 3767: 47(int) CompositeExtract 3765 0 + 3768: 284 Load 286(s2DArray) + 3769: 167(fvec3) Load 169(c3) + 3770: 734(ivec3) ConvertFToS 3769 + 3771: 52(float) Load 565(lod) + 3772: 47(int) ConvertFToS 3771 + 3773: 283 Image 3768 + 3774:3102(ResType) ImageSparseFetch 3773 3770 Lod 3772 + 3775: 7(fvec4) CompositeExtract 3774 1 + Store 3742(texel) 3775 + 3776: 47(int) CompositeExtract 3774 0 + 3777: 1309 Load 1311(s2DMS) + 3778: 53(fvec2) Load 148(c2) + 3779: 721(ivec2) ConvertFToS 3778 + 3780: 1308 Image 3777 + 3781:3102(ResType) ImageSparseFetch 3780 3779 Sample 709 + 3782: 7(fvec4) CompositeExtract 3781 1 + Store 3742(texel) 3782 + 3783: 47(int) CompositeExtract 3781 0 + 3784: 1320 Load 1322(s2DMSArray) + 3785: 167(fvec3) Load 169(c3) + 3786: 734(ivec3) ConvertFToS 3785 + 3787: 1319 Image 3784 + 3788:3102(ResType) ImageSparseFetch 3787 3786 Sample 1326 + 3789: 7(fvec4) CompositeExtract 3788 1 + Store 3742(texel) 3789 + 3790: 47(int) CompositeExtract 3788 0 + 3791: 7(fvec4) Load 3742(texel) + ReturnValue 3791 + FunctionEnd +83(testSparseTexelFetchOffset(): 7(fvec4) Function None 8 + 84: Label + 3794(texel): 64(ptr) Variable Function + Store 3794(texel) 121 + 3795: 143 Load 145(s2D) + 3796: 53(fvec2) Load 148(c2) + 3797: 721(ivec2) ConvertFToS 3796 + 3798: 52(float) Load 565(lod) + 3799: 47(int) ConvertFToS 3798 + 3800: 142 Image 3795 + 3801:3102(ResType) ImageSparseFetch 3800 3797 Lod ConstOffset 3799 722 + 3802: 7(fvec4) CompositeExtract 3801 1 + Store 3794(texel) 3802 + 3803: 47(int) CompositeExtract 3801 0 + 3804: 163 Load 165(s3D) + 3805: 167(fvec3) Load 169(c3) + 3806: 734(ivec3) ConvertFToS 3805 + 3807: 52(float) Load 565(lod) + 3808: 47(int) ConvertFToS 3807 + 3809: 162 Image 3804 + 3810:3102(ResType) ImageSparseFetch 3809 3806 Lod ConstOffset 3808 735 + 3811: 7(fvec4) CompositeExtract 3810 1 + Store 3794(texel) 3811 + 3812: 47(int) CompositeExtract 3810 0 + 3813: 357 Load 359(s2DRect) + 3814: 53(fvec2) Load 148(c2) + 3815: 721(ivec2) ConvertFToS 3814 + 3816: 356 Image 3813 + 3817:3102(ResType) ImageSparseFetch 3816 3815 ConstOffset 722 + 3818: 7(fvec4) CompositeExtract 3817 1 + Store 3794(texel) 3818 + 3819: 47(int) CompositeExtract 3817 0 + 3820: 284 Load 286(s2DArray) + 3821: 167(fvec3) Load 169(c3) + 3822: 734(ivec3) ConvertFToS 3821 + 3823: 52(float) Load 565(lod) + 3824: 47(int) ConvertFToS 3823 + 3825: 283 Image 3820 + 3826:3102(ResType) ImageSparseFetch 3825 3822 Lod ConstOffset 3824 722 + 3827: 7(fvec4) CompositeExtract 3826 1 + Store 3794(texel) 3827 + 3828: 47(int) CompositeExtract 3826 0 + 3829: 7(fvec4) Load 3794(texel) + ReturnValue 3829 + FunctionEnd +85(testSparseTextureGather(): 7(fvec4) Function None 8 + 86: Label + 3832(texel): 64(ptr) Variable Function + Store 3832(texel) 121 + 3833: 143 Load 145(s2D) + 3834: 53(fvec2) Load 148(c2) + 3835:3102(ResType) ImageSparseGather 3833 3834 2187 + 3836: 7(fvec4) CompositeExtract 3835 1 + Store 3832(texel) 3836 + 3837: 47(int) CompositeExtract 3835 0 + 3838: 143 Load 145(s2D) + 3839: 154(fvec2) Load 156(f16c2) + 3840: 6(float) Load 137(f16bias) + 3841:3102(ResType) ImageSparseGather 3838 3839 2187 Bias 3840 + 3842: 7(fvec4) CompositeExtract 3841 1 + Store 3832(texel) 3842 + 3843: 47(int) CompositeExtract 3841 0 + 3844: 284 Load 286(s2DArray) + 3845: 167(fvec3) Load 169(c3) + 3846:3102(ResType) ImageSparseGather 3844 3845 2187 + 3847: 7(fvec4) CompositeExtract 3846 1 + Store 3832(texel) 3847 + 3848: 47(int) CompositeExtract 3846 0 + 3849: 284 Load 286(s2DArray) + 3850: 175(fvec3) Load 177(f16c3) + 3851: 6(float) Load 137(f16bias) + 3852:3102(ResType) ImageSparseGather 3849 3850 2187 Bias 3851 + 3853: 7(fvec4) CompositeExtract 3852 1 + Store 3832(texel) 3853 + 3854: 47(int) CompositeExtract 3852 0 + 3855: 184 Load 186(sCube) + 3856: 167(fvec3) Load 169(c3) + 3857:3102(ResType) ImageSparseGather 3855 3856 2187 + 3858: 7(fvec4) CompositeExtract 3857 1 + Store 3832(texel) 3858 + 3859: 47(int) CompositeExtract 3857 0 + 3860: 184 Load 186(sCube) + 3861: 175(fvec3) Load 177(f16c3) + 3862: 6(float) Load 137(f16bias) + 3863:3102(ResType) ImageSparseGather 3860 3861 2187 Bias 3862 + 3864: 7(fvec4) CompositeExtract 3863 1 + Store 3832(texel) 3864 + 3865: 47(int) CompositeExtract 3863 0 + 3866: 299 Load 301(sCubeArray) + 3867: 249(fvec4) Load 251(c4) + 3868:3102(ResType) ImageSparseGather 3866 3867 2187 + 3869: 7(fvec4) CompositeExtract 3868 1 + Store 3832(texel) 3869 + 3870: 47(int) CompositeExtract 3868 0 + 3871: 299 Load 301(sCubeArray) + 3872: 7(fvec4) Load 309(f16c4) + 3873: 6(float) Load 137(f16bias) + 3874:3102(ResType) ImageSparseGather 3871 3872 2187 Bias 3873 + 3875: 7(fvec4) CompositeExtract 3874 1 + Store 3832(texel) 3875 + 3876: 47(int) CompositeExtract 3874 0 + 3877: 357 Load 359(s2DRect) + 3878: 53(fvec2) Load 148(c2) + 3879:3102(ResType) ImageSparseGather 3877 3878 2187 + 3880: 7(fvec4) CompositeExtract 3879 1 + Store 3832(texel) 3880 + 3881: 47(int) CompositeExtract 3879 0 + 3882: 357 Load 359(s2DRect) + 3883: 154(fvec2) Load 156(f16c2) + 3884:3102(ResType) ImageSparseGather 3882 3883 2187 + 3885: 7(fvec4) CompositeExtract 3884 1 + Store 3832(texel) 3885 + 3886: 47(int) CompositeExtract 3884 0 + 3887: 224 Load 226(s2DShadow) + 3888: 53(fvec2) Load 148(c2) + 3889: 52(float) Load 215(compare) + 3890:3102(ResType) ImageSparseDrefGather 3887 3888 3889 + 3891: 7(fvec4) CompositeExtract 3890 1 + Store 3832(texel) 3891 + 3892: 47(int) CompositeExtract 3890 0 + 3893: 224 Load 226(s2DShadow) + 3894: 154(fvec2) Load 156(f16c2) + 3895: 52(float) Load 215(compare) + 3896:3102(ResType) ImageSparseDrefGather 3893 3894 3895 + 3897: 7(fvec4) CompositeExtract 3896 1 + Store 3832(texel) 3897 + 3898: 47(int) CompositeExtract 3896 0 + 3899: 337 Load 339(s2DArrayShadow) + 3900: 167(fvec3) Load 169(c3) + 3901: 52(float) Load 215(compare) + 3902:3102(ResType) ImageSparseDrefGather 3899 3900 3901 + 3903: 7(fvec4) CompositeExtract 3902 1 + Store 3832(texel) 3903 + 3904: 47(int) CompositeExtract 3902 0 + 3905: 337 Load 339(s2DArrayShadow) + 3906: 175(fvec3) Load 177(f16c3) + 3907: 52(float) Load 215(compare) + 3908:3102(ResType) ImageSparseDrefGather 3905 3906 3907 + 3909: 7(fvec4) CompositeExtract 3908 1 + Store 3832(texel) 3909 + 3910: 47(int) CompositeExtract 3908 0 + 3911: 245 Load 247(sCubeShadow) + 3912: 167(fvec3) Load 169(c3) + 3913: 52(float) Load 215(compare) + 3914:3102(ResType) ImageSparseDrefGather 3911 3912 3913 + 3915: 7(fvec4) CompositeExtract 3914 1 + Store 3832(texel) 3915 + 3916: 47(int) CompositeExtract 3914 0 + 3917: 245 Load 247(sCubeShadow) + 3918: 175(fvec3) Load 177(f16c3) + 3919: 52(float) Load 215(compare) + 3920:3102(ResType) ImageSparseDrefGather 3917 3918 3919 + 3921: 7(fvec4) CompositeExtract 3920 1 + Store 3832(texel) 3921 + 3922: 47(int) CompositeExtract 3920 0 + 3923: 391 Load 393(sCubeArrayShadow) + 3924: 249(fvec4) Load 251(c4) + 3925: 52(float) Load 215(compare) + 3926:3102(ResType) ImageSparseDrefGather 3923 3924 3925 + 3927: 7(fvec4) CompositeExtract 3926 1 + Store 3832(texel) 3927 + 3928: 47(int) CompositeExtract 3926 0 + 3929: 391 Load 393(sCubeArrayShadow) + 3930: 7(fvec4) Load 309(f16c4) + 3931: 52(float) Load 215(compare) + 3932:3102(ResType) ImageSparseDrefGather 3929 3930 3931 + 3933: 7(fvec4) CompositeExtract 3932 1 + Store 3832(texel) 3933 + 3934: 47(int) CompositeExtract 3932 0 + 3935: 371 Load 373(s2DRectShadow) + 3936: 53(fvec2) Load 148(c2) + 3937: 52(float) Load 215(compare) + 3938:3102(ResType) ImageSparseDrefGather 3935 3936 3937 + 3939: 7(fvec4) CompositeExtract 3938 1 + Store 3832(texel) 3939 + 3940: 47(int) CompositeExtract 3938 0 + 3941: 371 Load 373(s2DRectShadow) + 3942: 154(fvec2) Load 156(f16c2) + 3943: 52(float) Load 215(compare) + 3944:3102(ResType) ImageSparseDrefGather 3941 3942 3943 + 3945: 7(fvec4) CompositeExtract 3944 1 + Store 3832(texel) 3945 + 3946: 47(int) CompositeExtract 3944 0 + 3947: 7(fvec4) Load 3832(texel) + ReturnValue 3947 + FunctionEnd +87(testSparseTextureGatherOffset(): 7(fvec4) Function None 8 + 88: Label + 3950(texel): 64(ptr) Variable Function + Store 3950(texel) 121 + 3951: 143 Load 145(s2D) + 3952: 53(fvec2) Load 148(c2) + 3953:3102(ResType) ImageSparseGather 3951 3952 2187 ConstOffset 722 + 3954: 7(fvec4) CompositeExtract 3953 1 + Store 3950(texel) 3954 + 3955: 47(int) CompositeExtract 3953 0 + 3956: 143 Load 145(s2D) + 3957: 154(fvec2) Load 156(f16c2) + 3958: 6(float) Load 137(f16bias) + 3959:3102(ResType) ImageSparseGather 3956 3957 2187 Bias ConstOffset 3958 722 + 3960: 7(fvec4) CompositeExtract 3959 1 + Store 3950(texel) 3960 + 3961: 47(int) CompositeExtract 3959 0 + 3962: 284 Load 286(s2DArray) + 3963: 167(fvec3) Load 169(c3) + 3964:3102(ResType) ImageSparseGather 3962 3963 2187 ConstOffset 722 + 3965: 7(fvec4) CompositeExtract 3964 1 + Store 3950(texel) 3965 + 3966: 47(int) CompositeExtract 3964 0 + 3967: 284 Load 286(s2DArray) + 3968: 175(fvec3) Load 177(f16c3) + 3969: 6(float) Load 137(f16bias) + 3970:3102(ResType) ImageSparseGather 3967 3968 2187 Bias ConstOffset 3969 722 + 3971: 7(fvec4) CompositeExtract 3970 1 + Store 3950(texel) 3971 + 3972: 47(int) CompositeExtract 3970 0 + 3973: 357 Load 359(s2DRect) + 3974: 53(fvec2) Load 148(c2) + 3975:3102(ResType) ImageSparseGather 3973 3974 2187 ConstOffset 722 + 3976: 7(fvec4) CompositeExtract 3975 1 + Store 3950(texel) 3976 + 3977: 47(int) CompositeExtract 3975 0 + 3978: 357 Load 359(s2DRect) + 3979: 154(fvec2) Load 156(f16c2) + 3980:3102(ResType) ImageSparseGather 3978 3979 2187 ConstOffset 722 + 3981: 7(fvec4) CompositeExtract 3980 1 + Store 3950(texel) 3981 + 3982: 47(int) CompositeExtract 3980 0 + 3983: 224 Load 226(s2DShadow) + 3984: 53(fvec2) Load 148(c2) + 3985: 52(float) Load 215(compare) + 3986:3102(ResType) ImageSparseDrefGather 3983 3984 3985 ConstOffset 722 + 3987: 7(fvec4) CompositeExtract 3986 1 + Store 3950(texel) 3987 + 3988: 47(int) CompositeExtract 3986 0 + 3989: 224 Load 226(s2DShadow) + 3990: 154(fvec2) Load 156(f16c2) + 3991: 52(float) Load 215(compare) + 3992:3102(ResType) ImageSparseDrefGather 3989 3990 3991 ConstOffset 722 + 3993: 7(fvec4) CompositeExtract 3992 1 + Store 3950(texel) 3993 + 3994: 47(int) CompositeExtract 3992 0 + 3995: 337 Load 339(s2DArrayShadow) + 3996: 167(fvec3) Load 169(c3) + 3997: 52(float) Load 215(compare) + 3998:3102(ResType) ImageSparseDrefGather 3995 3996 3997 ConstOffset 722 + 3999: 7(fvec4) CompositeExtract 3998 1 + Store 3950(texel) 3999 + 4000: 47(int) CompositeExtract 3998 0 + 4001: 337 Load 339(s2DArrayShadow) + 4002: 175(fvec3) Load 177(f16c3) + 4003: 52(float) Load 215(compare) + 4004:3102(ResType) ImageSparseDrefGather 4001 4002 4003 ConstOffset 722 + 4005: 7(fvec4) CompositeExtract 4004 1 + Store 3950(texel) 4005 + 4006: 47(int) CompositeExtract 4004 0 + 4007: 371 Load 373(s2DRectShadow) + 4008: 53(fvec2) Load 148(c2) + 4009: 52(float) Load 215(compare) + 4010:3102(ResType) ImageSparseDrefGather 4007 4008 4009 ConstOffset 722 + 4011: 7(fvec4) CompositeExtract 4010 1 + Store 3950(texel) 4011 + 4012: 47(int) CompositeExtract 4010 0 + 4013: 371 Load 373(s2DRectShadow) + 4014: 154(fvec2) Load 156(f16c2) + 4015: 52(float) Load 215(compare) + 4016:3102(ResType) ImageSparseDrefGather 4013 4014 4015 ConstOffset 722 + 4017: 7(fvec4) CompositeExtract 4016 1 + Store 3950(texel) 4017 + 4018: 47(int) CompositeExtract 4016 0 + 4019: 7(fvec4) Load 3950(texel) + ReturnValue 4019 + FunctionEnd +89(testSparseTextureGatherOffsets(): 7(fvec4) Function None 8 + 90: Label + 4022(texel): 64(ptr) Variable Function + Store 4022(texel) 121 + 4023: 143 Load 145(s2D) + 4024: 53(fvec2) Load 148(c2) + 4025:3102(ResType) ImageSparseGather 4023 4024 2187 ConstOffsets 2380 + 4026: 7(fvec4) CompositeExtract 4025 1 + Store 4022(texel) 4026 + 4027: 47(int) CompositeExtract 4025 0 + 4028: 143 Load 145(s2D) + 4029: 154(fvec2) Load 156(f16c2) + 4030: 6(float) Load 137(f16bias) + 4031:3102(ResType) ImageSparseGather 4028 4029 2187 Bias ConstOffsets 4030 2380 + 4032: 7(fvec4) CompositeExtract 4031 1 + Store 4022(texel) 4032 + 4033: 47(int) CompositeExtract 4031 0 + 4034: 284 Load 286(s2DArray) + 4035: 167(fvec3) Load 169(c3) + 4036:3102(ResType) ImageSparseGather 4034 4035 2187 ConstOffsets 2380 + 4037: 7(fvec4) CompositeExtract 4036 1 + Store 4022(texel) 4037 + 4038: 47(int) CompositeExtract 4036 0 + 4039: 284 Load 286(s2DArray) + 4040: 175(fvec3) Load 177(f16c3) + 4041: 6(float) Load 137(f16bias) + 4042:3102(ResType) ImageSparseGather 4039 4040 2187 Bias ConstOffsets 4041 2380 + 4043: 7(fvec4) CompositeExtract 4042 1 + Store 4022(texel) 4043 + 4044: 47(int) CompositeExtract 4042 0 + 4045: 357 Load 359(s2DRect) + 4046: 53(fvec2) Load 148(c2) + 4047:3102(ResType) ImageSparseGather 4045 4046 2187 ConstOffsets 2380 + 4048: 7(fvec4) CompositeExtract 4047 1 + Store 4022(texel) 4048 + 4049: 47(int) CompositeExtract 4047 0 + 4050: 357 Load 359(s2DRect) + 4051: 154(fvec2) Load 156(f16c2) + 4052:3102(ResType) ImageSparseGather 4050 4051 2187 ConstOffsets 2380 + 4053: 7(fvec4) CompositeExtract 4052 1 + Store 4022(texel) 4053 + 4054: 47(int) CompositeExtract 4052 0 + 4055: 224 Load 226(s2DShadow) + 4056: 53(fvec2) Load 148(c2) + 4057: 52(float) Load 215(compare) + 4058:3102(ResType) ImageSparseDrefGather 4055 4056 4057 ConstOffsets 2380 + 4059: 7(fvec4) CompositeExtract 4058 1 + Store 4022(texel) 4059 + 4060: 47(int) CompositeExtract 4058 0 + 4061: 224 Load 226(s2DShadow) + 4062: 154(fvec2) Load 156(f16c2) + 4063: 52(float) Load 215(compare) + 4064:3102(ResType) ImageSparseDrefGather 4061 4062 4063 ConstOffsets 2380 + 4065: 7(fvec4) CompositeExtract 4064 1 + Store 4022(texel) 4065 + 4066: 47(int) CompositeExtract 4064 0 + 4067: 337 Load 339(s2DArrayShadow) + 4068: 167(fvec3) Load 169(c3) + 4069: 52(float) Load 215(compare) + 4070:3102(ResType) ImageSparseDrefGather 4067 4068 4069 ConstOffsets 2380 + 4071: 7(fvec4) CompositeExtract 4070 1 + Store 4022(texel) 4071 + 4072: 47(int) CompositeExtract 4070 0 + 4073: 337 Load 339(s2DArrayShadow) + 4074: 175(fvec3) Load 177(f16c3) + 4075: 52(float) Load 215(compare) + 4076:3102(ResType) ImageSparseDrefGather 4073 4074 4075 ConstOffsets 2380 + 4077: 7(fvec4) CompositeExtract 4076 1 + Store 4022(texel) 4077 + 4078: 47(int) CompositeExtract 4076 0 + 4079: 371 Load 373(s2DRectShadow) + 4080: 53(fvec2) Load 148(c2) + 4081: 52(float) Load 215(compare) + 4082:3102(ResType) ImageSparseDrefGather 4079 4080 4081 ConstOffsets 2380 + 4083: 7(fvec4) CompositeExtract 4082 1 + Store 4022(texel) 4083 + 4084: 47(int) CompositeExtract 4082 0 + 4085: 371 Load 373(s2DRectShadow) + 4086: 154(fvec2) Load 156(f16c2) + 4087: 52(float) Load 215(compare) + 4088:3102(ResType) ImageSparseDrefGather 4085 4086 4087 ConstOffsets 2380 + 4089: 7(fvec4) CompositeExtract 4088 1 + Store 4022(texel) 4089 + 4090: 47(int) CompositeExtract 4088 0 + 4091: 7(fvec4) Load 4022(texel) + ReturnValue 4091 + FunctionEnd +91(testSparseTextureGatherLod(): 7(fvec4) Function None 8 + 92: Label + 4094(texel): 64(ptr) Variable Function + Store 4094(texel) 121 + 4095: 143 Load 145(s2D) + 4096: 53(fvec2) Load 148(c2) + 4097: 52(float) Load 565(lod) + 4098:3102(ResType) ImageSparseGather 4095 4096 2187 Lod 4097 + 4099: 7(fvec4) CompositeExtract 4098 1 + Store 4094(texel) 4099 + 4100: 47(int) CompositeExtract 4098 0 + 4101: 143 Load 145(s2D) + 4102: 154(fvec2) Load 156(f16c2) + 4103: 6(float) Load 572(f16lod) + 4104:3102(ResType) ImageSparseGather 4101 4102 2187 Lod 4103 + 4105: 7(fvec4) CompositeExtract 4104 1 + Store 4094(texel) 4105 + 4106: 47(int) CompositeExtract 4104 0 + 4107: 284 Load 286(s2DArray) + 4108: 167(fvec3) Load 169(c3) + 4109: 52(float) Load 565(lod) + 4110:3102(ResType) ImageSparseGather 4107 4108 2187 Lod 4109 + 4111: 7(fvec4) CompositeExtract 4110 1 + Store 4094(texel) 4111 + 4112: 47(int) CompositeExtract 4110 0 + 4113: 284 Load 286(s2DArray) + 4114: 175(fvec3) Load 177(f16c3) + 4115: 6(float) Load 572(f16lod) + 4116:3102(ResType) ImageSparseGather 4113 4114 2187 Lod 4115 + 4117: 7(fvec4) CompositeExtract 4116 1 + Store 4094(texel) 4117 + 4118: 47(int) CompositeExtract 4116 0 + 4119: 184 Load 186(sCube) + 4120: 167(fvec3) Load 169(c3) + 4121: 52(float) Load 565(lod) + 4122:3102(ResType) ImageSparseGather 4119 4120 2187 Lod 4121 + 4123: 7(fvec4) CompositeExtract 4122 1 + Store 4094(texel) 4123 + 4124: 47(int) CompositeExtract 4122 0 + 4125: 184 Load 186(sCube) + 4126: 175(fvec3) Load 177(f16c3) + 4127: 6(float) Load 572(f16lod) + 4128:3102(ResType) ImageSparseGather 4125 4126 2187 Lod 4127 + 4129: 7(fvec4) CompositeExtract 4128 1 + Store 4094(texel) 4129 + 4130: 47(int) CompositeExtract 4128 0 + 4131: 299 Load 301(sCubeArray) + 4132: 249(fvec4) Load 251(c4) + 4133: 52(float) Load 565(lod) + 4134:3102(ResType) ImageSparseGather 4131 4132 2187 Lod 4133 + 4135: 7(fvec4) CompositeExtract 4134 1 + Store 4094(texel) 4135 + 4136: 47(int) CompositeExtract 4134 0 + 4137: 299 Load 301(sCubeArray) + 4138: 7(fvec4) Load 309(f16c4) + 4139: 6(float) Load 572(f16lod) + 4140:3102(ResType) ImageSparseGather 4137 4138 2187 Lod 4139 + 4141: 7(fvec4) CompositeExtract 4140 1 + Store 4094(texel) 4141 + 4142: 47(int) CompositeExtract 4140 0 + 4143: 7(fvec4) Load 4094(texel) + ReturnValue 4143 + FunctionEnd +93(testSparseTextureGatherLodOffset(): 7(fvec4) Function None 8 + 94: Label + 4146(texel): 64(ptr) Variable Function + Store 4146(texel) 121 + 4147: 143 Load 145(s2D) + 4148: 53(fvec2) Load 148(c2) + 4149: 52(float) Load 565(lod) + 4150:3102(ResType) ImageSparseGather 4147 4148 2187 Lod ConstOffset 4149 722 + 4151: 7(fvec4) CompositeExtract 4150 1 + Store 4146(texel) 4151 + 4152: 47(int) CompositeExtract 4150 0 + 4153: 143 Load 145(s2D) + 4154: 154(fvec2) Load 156(f16c2) + 4155: 6(float) Load 572(f16lod) + 4156:3102(ResType) ImageSparseGather 4153 4154 2187 Lod ConstOffset 4155 722 + 4157: 7(fvec4) CompositeExtract 4156 1 + Store 4146(texel) 4157 + 4158: 47(int) CompositeExtract 4156 0 + 4159: 284 Load 286(s2DArray) + 4160: 167(fvec3) Load 169(c3) + 4161: 52(float) Load 565(lod) + 4162:3102(ResType) ImageSparseGather 4159 4160 2187 Lod ConstOffset 4161 722 + 4163: 7(fvec4) CompositeExtract 4162 1 + Store 4146(texel) 4163 + 4164: 47(int) CompositeExtract 4162 0 + 4165: 284 Load 286(s2DArray) + 4166: 175(fvec3) Load 177(f16c3) + 4167: 6(float) Load 572(f16lod) + 4168:3102(ResType) ImageSparseGather 4165 4166 2187 Lod ConstOffset 4167 722 + 4169: 7(fvec4) CompositeExtract 4168 1 + Store 4146(texel) 4169 + 4170: 47(int) CompositeExtract 4168 0 + 4171: 7(fvec4) Load 4146(texel) + ReturnValue 4171 + FunctionEnd +95(testSparseTextureGatherLodOffsets(): 7(fvec4) Function None 8 + 96: Label + 4174(texel): 64(ptr) Variable Function + Store 4174(texel) 121 + 4175: 143 Load 145(s2D) + 4176: 53(fvec2) Load 148(c2) + 4177: 52(float) Load 565(lod) + 4178:3102(ResType) ImageSparseGather 4175 4176 2187 Lod ConstOffsets 4177 2380 + 4179: 7(fvec4) CompositeExtract 4178 1 + Store 4174(texel) 4179 + 4180: 47(int) CompositeExtract 4178 0 + 4181: 143 Load 145(s2D) + 4182: 154(fvec2) Load 156(f16c2) + 4183: 6(float) Load 572(f16lod) + 4184:3102(ResType) ImageSparseGather 4181 4182 2187 Lod ConstOffsets 4183 2380 + 4185: 7(fvec4) CompositeExtract 4184 1 + Store 4174(texel) 4185 + 4186: 47(int) CompositeExtract 4184 0 + 4187: 284 Load 286(s2DArray) + 4188: 167(fvec3) Load 169(c3) + 4189: 52(float) Load 565(lod) + 4190:3102(ResType) ImageSparseGather 4187 4188 2187 Lod ConstOffsets 4189 2380 + 4191: 7(fvec4) CompositeExtract 4190 1 + Store 4174(texel) 4191 + 4192: 47(int) CompositeExtract 4190 0 + 4193: 284 Load 286(s2DArray) + 4194: 175(fvec3) Load 177(f16c3) + 4195: 6(float) Load 572(f16lod) + 4196:3102(ResType) ImageSparseGather 4193 4194 2187 Lod ConstOffsets 4195 2380 + 4197: 7(fvec4) CompositeExtract 4196 1 + Store 4174(texel) 4197 + 4198: 47(int) CompositeExtract 4196 0 + 4199: 7(fvec4) Load 4174(texel) + ReturnValue 4199 + FunctionEnd +97(testSparseImageLoad(): 7(fvec4) Function None 8 + 98: Label + 4202(texel): 64(ptr) Variable Function + Store 4202(texel) 121 + 4203: 2962 Load 2964(i2D) + 4204: 53(fvec2) Load 148(c2) + 4205: 721(ivec2) ConvertFToS 4204 + 4206:3102(ResType) ImageSparseRead 4203 4205 + 4207: 7(fvec4) CompositeExtract 4206 1 + Store 4202(texel) 4207 + 4208: 47(int) CompositeExtract 4206 0 + 4209: 2971 Load 2973(i3D) + 4210: 167(fvec3) Load 169(c3) + 4211: 734(ivec3) ConvertFToS 4210 + 4212:3102(ResType) ImageSparseRead 4209 4211 + 4213: 7(fvec4) CompositeExtract 4212 1 + Store 4202(texel) 4213 + 4214: 47(int) CompositeExtract 4212 0 + 4215: 2980 Load 2982(i2DRect) + 4216: 53(fvec2) Load 148(c2) + 4217: 721(ivec2) ConvertFToS 4216 + 4218:3102(ResType) ImageSparseRead 4215 4217 + 4219: 7(fvec4) CompositeExtract 4218 1 + Store 4202(texel) 4219 + 4220: 47(int) CompositeExtract 4218 0 + 4221: 2989 Load 2991(iCube) + 4222: 167(fvec3) Load 169(c3) + 4223: 734(ivec3) ConvertFToS 4222 + 4224:3102(ResType) ImageSparseRead 4221 4223 + 4225: 7(fvec4) CompositeExtract 4224 1 + Store 4202(texel) 4225 + 4226: 47(int) CompositeExtract 4224 0 + 4227: 3016 Load 3018(i2DArray) + 4228: 167(fvec3) Load 169(c3) + 4229: 734(ivec3) ConvertFToS 4228 + 4230:3102(ResType) ImageSparseRead 4227 4229 + 4231: 7(fvec4) CompositeExtract 4230 1 + Store 4202(texel) 4231 + 4232: 47(int) CompositeExtract 4230 0 + 4233: 3025 Load 3027(iCubeArray) + 4234: 167(fvec3) Load 169(c3) + 4235: 734(ivec3) ConvertFToS 4234 + 4236:3102(ResType) ImageSparseRead 4233 4235 + 4237: 7(fvec4) CompositeExtract 4236 1 + Store 4202(texel) 4237 + 4238: 47(int) CompositeExtract 4236 0 + 4239: 3034 Load 3036(i2DMS) + 4240: 53(fvec2) Load 148(c2) + 4241: 721(ivec2) ConvertFToS 4240 + 4242:3102(ResType) ImageSparseRead 4239 4241 Sample 709 + 4243: 7(fvec4) CompositeExtract 4242 1 + Store 4202(texel) 4243 + 4244: 47(int) CompositeExtract 4242 0 + 4245: 3043 Load 3045(i2DMSArray) + 4246: 167(fvec3) Load 169(c3) + 4247: 734(ivec3) ConvertFToS 4246 + 4248:3102(ResType) ImageSparseRead 4245 4247 Sample 1326 + 4249: 7(fvec4) CompositeExtract 4248 1 + Store 4202(texel) 4249 + 4250: 47(int) CompositeExtract 4248 0 + 4251: 7(fvec4) Load 4202(texel) + ReturnValue 4251 + FunctionEnd +99(testSparseTextureClamp(): 7(fvec4) Function None 8 + 100: Label + 4254(texel): 64(ptr) Variable Function + Store 4254(texel) 121 + 4255: 143 Load 145(s2D) + 4256: 53(fvec2) Load 148(c2) + 4258: 52(float) Load 4257(lodClamp) + 4259:3102(ResType) ImageSparseSampleImplicitLod 4255 4256 MinLod 4258 + 4260: 7(fvec4) CompositeExtract 4259 1 + Store 4254(texel) 4260 + 4261: 47(int) CompositeExtract 4259 0 + 4262: 143 Load 145(s2D) + 4263: 154(fvec2) Load 156(f16c2) + 4265: 6(float) Load 4264(f16lodClamp) + 4266: 6(float) Load 137(f16bias) + 4267:3102(ResType) ImageSparseSampleImplicitLod 4262 4263 Bias MinLod 4266 4265 + 4268: 7(fvec4) CompositeExtract 4267 1 + Store 4254(texel) 4268 + 4269: 47(int) CompositeExtract 4267 0 + 4270: 163 Load 165(s3D) + 4271: 167(fvec3) Load 169(c3) + 4272: 52(float) Load 4257(lodClamp) + 4273:3102(ResType) ImageSparseSampleImplicitLod 4270 4271 MinLod 4272 + 4274: 7(fvec4) CompositeExtract 4273 1 + Store 4254(texel) 4274 + 4275: 47(int) CompositeExtract 4273 0 + 4276: 163 Load 165(s3D) + 4277: 175(fvec3) Load 177(f16c3) + 4278: 6(float) Load 4264(f16lodClamp) + 4279: 6(float) Load 137(f16bias) + 4280:3102(ResType) ImageSparseSampleImplicitLod 4276 4277 Bias MinLod 4279 4278 + 4281: 7(fvec4) CompositeExtract 4280 1 + Store 4254(texel) 4281 + 4282: 47(int) CompositeExtract 4280 0 + 4283: 184 Load 186(sCube) + 4284: 167(fvec3) Load 169(c3) + 4285: 52(float) Load 4257(lodClamp) + 4286:3102(ResType) ImageSparseSampleImplicitLod 4283 4284 MinLod 4285 + 4287: 7(fvec4) CompositeExtract 4286 1 + Store 4254(texel) 4287 + 4288: 47(int) CompositeExtract 4286 0 + 4289: 184 Load 186(sCube) + 4290: 175(fvec3) Load 177(f16c3) + 4291: 6(float) Load 4264(f16lodClamp) + 4292: 6(float) Load 137(f16bias) + 4293:3102(ResType) ImageSparseSampleImplicitLod 4289 4290 Bias MinLod 4292 4291 + 4294: 7(fvec4) CompositeExtract 4293 1 + Store 4254(texel) 4294 + 4295: 47(int) CompositeExtract 4293 0 + 4296: 224 Load 226(s2DShadow) + 4297: 167(fvec3) Load 169(c3) + 4298: 52(float) Load 4257(lodClamp) + 4299: 208(ptr) AccessChain 4254(texel) 207 + 4300: 52(float) CompositeExtract 4297 2 + 4301:3138(ResType) ImageSparseSampleDrefImplicitLod 4296 4297 4300 MinLod 4298 + 4302: 6(float) CompositeExtract 4301 1 + Store 4299 4302 + 4303: 47(int) CompositeExtract 4301 0 + 4304: 224 Load 226(s2DShadow) + 4305: 154(fvec2) Load 156(f16c2) + 4306: 52(float) Load 215(compare) + 4307: 6(float) Load 4264(f16lodClamp) + 4308: 208(ptr) AccessChain 4254(texel) 207 + 4309: 6(float) Load 137(f16bias) + 4310:3138(ResType) ImageSparseSampleDrefImplicitLod 4304 4305 4306 Bias MinLod 4309 4307 + 4311: 6(float) CompositeExtract 4310 1 + Store 4308 4311 + 4312: 47(int) CompositeExtract 4310 0 + 4313: 245 Load 247(sCubeShadow) + 4314: 249(fvec4) Load 251(c4) + 4315: 52(float) Load 4257(lodClamp) + 4316: 208(ptr) AccessChain 4254(texel) 207 + 4317: 52(float) CompositeExtract 4314 3 + 4318:3138(ResType) ImageSparseSampleDrefImplicitLod 4313 4314 4317 MinLod 4315 + 4319: 6(float) CompositeExtract 4318 1 + Store 4316 4319 + 4320: 47(int) CompositeExtract 4318 0 + 4321: 245 Load 247(sCubeShadow) + 4322: 175(fvec3) Load 177(f16c3) + 4323: 52(float) Load 215(compare) + 4324: 6(float) Load 4264(f16lodClamp) + 4325: 208(ptr) AccessChain 4254(texel) 207 + 4326: 6(float) Load 137(f16bias) + 4327:3138(ResType) ImageSparseSampleDrefImplicitLod 4321 4322 4323 Bias MinLod 4326 4324 + 4328: 6(float) CompositeExtract 4327 1 + Store 4325 4328 + 4329: 47(int) CompositeExtract 4327 0 + 4330: 284 Load 286(s2DArray) + 4331: 167(fvec3) Load 169(c3) + 4332: 52(float) Load 4257(lodClamp) + 4333:3102(ResType) ImageSparseSampleImplicitLod 4330 4331 MinLod 4332 + 4334: 7(fvec4) CompositeExtract 4333 1 + Store 4254(texel) 4334 + 4335: 47(int) CompositeExtract 4333 0 + 4336: 284 Load 286(s2DArray) + 4337: 175(fvec3) Load 177(f16c3) + 4338: 6(float) Load 4264(f16lodClamp) + 4339: 6(float) Load 137(f16bias) + 4340:3102(ResType) ImageSparseSampleImplicitLod 4336 4337 Bias MinLod 4339 4338 + 4341: 7(fvec4) CompositeExtract 4340 1 + Store 4254(texel) 4341 + 4342: 47(int) CompositeExtract 4340 0 + 4343: 299 Load 301(sCubeArray) + 4344: 249(fvec4) Load 251(c4) + 4345: 52(float) Load 4257(lodClamp) + 4346:3102(ResType) ImageSparseSampleImplicitLod 4343 4344 MinLod 4345 + 4347: 7(fvec4) CompositeExtract 4346 1 + Store 4254(texel) 4347 + 4348: 47(int) CompositeExtract 4346 0 + 4349: 299 Load 301(sCubeArray) + 4350: 7(fvec4) Load 309(f16c4) + 4351: 6(float) Load 4264(f16lodClamp) + 4352: 6(float) Load 137(f16bias) + 4353:3102(ResType) ImageSparseSampleImplicitLod 4349 4350 Bias MinLod 4352 4351 + 4354: 7(fvec4) CompositeExtract 4353 1 + Store 4254(texel) 4354 + 4355: 47(int) CompositeExtract 4353 0 + 4356: 337 Load 339(s2DArrayShadow) + 4357: 249(fvec4) Load 251(c4) + 4358: 52(float) Load 4257(lodClamp) + 4359: 208(ptr) AccessChain 4254(texel) 207 + 4360: 52(float) CompositeExtract 4357 3 + 4361:3138(ResType) ImageSparseSampleDrefImplicitLod 4356 4357 4360 MinLod 4358 + 4362: 6(float) CompositeExtract 4361 1 + Store 4359 4362 + 4363: 47(int) CompositeExtract 4361 0 + 4364: 337 Load 339(s2DArrayShadow) + 4365: 175(fvec3) Load 177(f16c3) + 4366: 52(float) Load 215(compare) + 4367: 6(float) Load 4264(f16lodClamp) + 4368: 208(ptr) AccessChain 4254(texel) 207 + 4369:3138(ResType) ImageSparseSampleDrefImplicitLod 4364 4365 4366 MinLod 4367 + 4370: 6(float) CompositeExtract 4369 1 + Store 4368 4370 + 4371: 47(int) CompositeExtract 4369 0 + 4372: 391 Load 393(sCubeArrayShadow) + 4373: 249(fvec4) Load 251(c4) + 4374: 52(float) Load 215(compare) + 4375: 52(float) Load 4257(lodClamp) + 4376: 208(ptr) AccessChain 4254(texel) 207 + 4377:3138(ResType) ImageSparseSampleDrefImplicitLod 4372 4373 4374 MinLod 4375 + 4378: 6(float) CompositeExtract 4377 1 + Store 4376 4378 + 4379: 47(int) CompositeExtract 4377 0 + 4380: 391 Load 393(sCubeArrayShadow) + 4381: 7(fvec4) Load 309(f16c4) + 4382: 52(float) Load 215(compare) + 4383: 6(float) Load 4264(f16lodClamp) + 4384: 208(ptr) AccessChain 4254(texel) 207 + 4385:3138(ResType) ImageSparseSampleDrefImplicitLod 4380 4381 4382 MinLod 4383 + 4386: 6(float) CompositeExtract 4385 1 + Store 4384 4386 + 4387: 47(int) CompositeExtract 4385 0 + 4388: 7(fvec4) Load 4254(texel) + ReturnValue 4388 + FunctionEnd +101(testTextureClamp(): 7(fvec4) Function None 8 + 102: Label + 4391(texel): 64(ptr) Variable Function + Store 4391(texel) 121 + 4392: 123 Load 125(s1D) + 4393: 52(float) Load 128(c1) + 4394: 52(float) Load 4257(lodClamp) + 4395: 7(fvec4) ImageSampleImplicitLod 4392 4393 MinLod 4394 + 4396: 7(fvec4) Load 4391(texel) + 4397: 7(fvec4) FAdd 4396 4395 + Store 4391(texel) 4397 + 4398: 123 Load 125(s1D) + 4399: 6(float) Load 135(f16c1) + 4400: 6(float) Load 4264(f16lodClamp) + 4401: 6(float) Load 137(f16bias) + 4402: 7(fvec4) ImageSampleImplicitLod 4398 4399 Bias MinLod 4401 4400 + 4403: 7(fvec4) Load 4391(texel) + 4404: 7(fvec4) FAdd 4403 4402 + Store 4391(texel) 4404 + 4405: 143 Load 145(s2D) + 4406: 53(fvec2) Load 148(c2) + 4407: 52(float) Load 4257(lodClamp) + 4408: 7(fvec4) ImageSampleImplicitLod 4405 4406 MinLod 4407 + 4409: 7(fvec4) Load 4391(texel) + 4410: 7(fvec4) FAdd 4409 4408 + Store 4391(texel) 4410 + 4411: 143 Load 145(s2D) + 4412: 154(fvec2) Load 156(f16c2) + 4413: 6(float) Load 4264(f16lodClamp) + 4414: 6(float) Load 137(f16bias) + 4415: 7(fvec4) ImageSampleImplicitLod 4411 4412 Bias MinLod 4414 4413 + 4416: 7(fvec4) Load 4391(texel) + 4417: 7(fvec4) FAdd 4416 4415 + Store 4391(texel) 4417 + 4418: 163 Load 165(s3D) + 4419: 167(fvec3) Load 169(c3) + 4420: 52(float) Load 4257(lodClamp) + 4421: 7(fvec4) ImageSampleImplicitLod 4418 4419 MinLod 4420 + 4422: 7(fvec4) Load 4391(texel) + 4423: 7(fvec4) FAdd 4422 4421 + Store 4391(texel) 4423 + 4424: 163 Load 165(s3D) + 4425: 175(fvec3) Load 177(f16c3) + 4426: 6(float) Load 4264(f16lodClamp) + 4427: 6(float) Load 137(f16bias) + 4428: 7(fvec4) ImageSampleImplicitLod 4424 4425 Bias MinLod 4427 4426 + 4429: 7(fvec4) Load 4391(texel) + 4430: 7(fvec4) FAdd 4429 4428 + Store 4391(texel) 4430 + 4431: 184 Load 186(sCube) + 4432: 167(fvec3) Load 169(c3) + 4433: 52(float) Load 4257(lodClamp) + 4434: 7(fvec4) ImageSampleImplicitLod 4431 4432 MinLod 4433 + 4435: 7(fvec4) Load 4391(texel) + 4436: 7(fvec4) FAdd 4435 4434 + Store 4391(texel) 4436 + 4437: 184 Load 186(sCube) + 4438: 175(fvec3) Load 177(f16c3) + 4439: 6(float) Load 4264(f16lodClamp) + 4440: 6(float) Load 137(f16bias) + 4441: 7(fvec4) ImageSampleImplicitLod 4437 4438 Bias MinLod 4440 4439 + 4442: 7(fvec4) Load 4391(texel) + 4443: 7(fvec4) FAdd 4442 4441 + Store 4391(texel) 4443 + 4444: 199 Load 201(s1DShadow) + 4445: 167(fvec3) Load 169(c3) + 4446: 52(float) Load 4257(lodClamp) + 4447: 52(float) CompositeExtract 4445 2 + 4448: 6(float) ImageSampleDrefImplicitLod 4444 4445 4447 MinLod 4446 + 4449: 208(ptr) AccessChain 4391(texel) 207 + 4450: 6(float) Load 4449 + 4451: 6(float) FAdd 4450 4448 + 4452: 208(ptr) AccessChain 4391(texel) 207 + Store 4452 4451 + 4453: 199 Load 201(s1DShadow) + 4454: 154(fvec2) Load 156(f16c2) + 4455: 52(float) Load 215(compare) + 4456: 6(float) Load 4264(f16lodClamp) + 4457: 6(float) Load 137(f16bias) + 4458: 6(float) ImageSampleDrefImplicitLod 4453 4454 4455 Bias MinLod 4457 4456 + 4459: 208(ptr) AccessChain 4391(texel) 207 + 4460: 6(float) Load 4459 + 4461: 6(float) FAdd 4460 4458 + 4462: 208(ptr) AccessChain 4391(texel) 207 + Store 4462 4461 + 4463: 224 Load 226(s2DShadow) + 4464: 167(fvec3) Load 169(c3) + 4465: 52(float) Load 4257(lodClamp) + 4466: 52(float) CompositeExtract 4464 2 + 4467: 6(float) ImageSampleDrefImplicitLod 4463 4464 4466 MinLod 4465 + 4468: 208(ptr) AccessChain 4391(texel) 207 + 4469: 6(float) Load 4468 + 4470: 6(float) FAdd 4469 4467 + 4471: 208(ptr) AccessChain 4391(texel) 207 + Store 4471 4470 + 4472: 224 Load 226(s2DShadow) + 4473: 154(fvec2) Load 156(f16c2) + 4474: 52(float) Load 215(compare) + 4475: 6(float) Load 4264(f16lodClamp) + 4476: 6(float) Load 137(f16bias) + 4477: 6(float) ImageSampleDrefImplicitLod 4472 4473 4474 Bias MinLod 4476 4475 + 4478: 208(ptr) AccessChain 4391(texel) 207 + 4479: 6(float) Load 4478 + 4480: 6(float) FAdd 4479 4477 + 4481: 208(ptr) AccessChain 4391(texel) 207 + Store 4481 4480 + 4482: 245 Load 247(sCubeShadow) + 4483: 249(fvec4) Load 251(c4) + 4484: 52(float) Load 4257(lodClamp) + 4485: 52(float) CompositeExtract 4483 3 + 4486: 6(float) ImageSampleDrefImplicitLod 4482 4483 4485 MinLod 4484 + 4487: 208(ptr) AccessChain 4391(texel) 207 + 4488: 6(float) Load 4487 + 4489: 6(float) FAdd 4488 4486 + 4490: 208(ptr) AccessChain 4391(texel) 207 + Store 4490 4489 + 4491: 245 Load 247(sCubeShadow) + 4492: 175(fvec3) Load 177(f16c3) + 4493: 52(float) Load 215(compare) + 4494: 6(float) Load 4264(f16lodClamp) + 4495: 6(float) Load 137(f16bias) + 4496: 6(float) ImageSampleDrefImplicitLod 4491 4492 4493 Bias MinLod 4495 4494 + 4497: 208(ptr) AccessChain 4391(texel) 207 + 4498: 6(float) Load 4497 + 4499: 6(float) FAdd 4498 4496 + 4500: 208(ptr) AccessChain 4391(texel) 207 + Store 4500 4499 + 4501: 269 Load 271(s1DArray) + 4502: 53(fvec2) Load 148(c2) + 4503: 52(float) Load 4257(lodClamp) + 4504: 7(fvec4) ImageSampleImplicitLod 4501 4502 MinLod 4503 + 4505: 7(fvec4) Load 4391(texel) + 4506: 7(fvec4) FAdd 4505 4504 + Store 4391(texel) 4506 + 4507: 269 Load 271(s1DArray) + 4508: 154(fvec2) Load 156(f16c2) + 4509: 6(float) Load 4264(f16lodClamp) + 4510: 6(float) Load 137(f16bias) + 4511: 7(fvec4) ImageSampleImplicitLod 4507 4508 Bias MinLod 4510 4509 + 4512: 7(fvec4) Load 4391(texel) + 4513: 7(fvec4) FAdd 4512 4511 + Store 4391(texel) 4513 + 4514: 284 Load 286(s2DArray) + 4515: 167(fvec3) Load 169(c3) + 4516: 52(float) Load 4257(lodClamp) + 4517: 7(fvec4) ImageSampleImplicitLod 4514 4515 MinLod 4516 + 4518: 7(fvec4) Load 4391(texel) + 4519: 7(fvec4) FAdd 4518 4517 + Store 4391(texel) 4519 + 4520: 284 Load 286(s2DArray) + 4521: 175(fvec3) Load 177(f16c3) + 4522: 6(float) Load 4264(f16lodClamp) + 4523: 6(float) Load 137(f16bias) + 4524: 7(fvec4) ImageSampleImplicitLod 4520 4521 Bias MinLod 4523 4522 + 4525: 7(fvec4) Load 4391(texel) + 4526: 7(fvec4) FAdd 4525 4524 + Store 4391(texel) 4526 + 4527: 299 Load 301(sCubeArray) + 4528: 249(fvec4) Load 251(c4) + 4529: 52(float) Load 4257(lodClamp) + 4530: 7(fvec4) ImageSampleImplicitLod 4527 4528 MinLod 4529 + 4531: 7(fvec4) Load 4391(texel) + 4532: 7(fvec4) FAdd 4531 4530 + Store 4391(texel) 4532 + 4533: 299 Load 301(sCubeArray) + 4534: 7(fvec4) Load 309(f16c4) + 4535: 6(float) Load 4264(f16lodClamp) + 4536: 6(float) Load 137(f16bias) + 4537: 7(fvec4) ImageSampleImplicitLod 4533 4534 Bias MinLod 4536 4535 + 4538: 7(fvec4) Load 4391(texel) + 4539: 7(fvec4) FAdd 4538 4537 + Store 4391(texel) 4539 + 4540: 316 Load 318(s1DArrayShadow) + 4541: 167(fvec3) Load 169(c3) + 4542: 52(float) Load 4257(lodClamp) + 4543: 52(float) CompositeExtract 4541 2 + 4544: 6(float) ImageSampleDrefImplicitLod 4540 4541 4543 MinLod 4542 + 4545: 208(ptr) AccessChain 4391(texel) 207 + 4546: 6(float) Load 4545 + 4547: 6(float) FAdd 4546 4544 + 4548: 208(ptr) AccessChain 4391(texel) 207 + Store 4548 4547 + 4549: 316 Load 318(s1DArrayShadow) + 4550: 154(fvec2) Load 156(f16c2) + 4551: 52(float) Load 215(compare) + 4552: 6(float) Load 4264(f16lodClamp) + 4553: 6(float) Load 137(f16bias) + 4554: 6(float) ImageSampleDrefImplicitLod 4549 4550 4551 Bias MinLod 4553 4552 + 4555: 208(ptr) AccessChain 4391(texel) 207 + 4556: 6(float) Load 4555 + 4557: 6(float) FAdd 4556 4554 + 4558: 208(ptr) AccessChain 4391(texel) 207 + Store 4558 4557 + 4559: 337 Load 339(s2DArrayShadow) + 4560: 249(fvec4) Load 251(c4) + 4561: 52(float) Load 4257(lodClamp) + 4562: 52(float) CompositeExtract 4560 3 + 4563: 6(float) ImageSampleDrefImplicitLod 4559 4560 4562 MinLod 4561 + 4564: 208(ptr) AccessChain 4391(texel) 207 + 4565: 6(float) Load 4564 + 4566: 6(float) FAdd 4565 4563 + 4567: 208(ptr) AccessChain 4391(texel) 207 + Store 4567 4566 + 4568: 337 Load 339(s2DArrayShadow) + 4569: 175(fvec3) Load 177(f16c3) + 4570: 52(float) Load 215(compare) + 4571: 6(float) Load 4264(f16lodClamp) + 4572: 6(float) ImageSampleDrefImplicitLod 4568 4569 4570 MinLod 4571 + 4573: 208(ptr) AccessChain 4391(texel) 207 + 4574: 6(float) Load 4573 + 4575: 6(float) FAdd 4574 4572 + 4576: 208(ptr) AccessChain 4391(texel) 207 + Store 4576 4575 + 4577: 391 Load 393(sCubeArrayShadow) + 4578: 249(fvec4) Load 251(c4) + 4579: 52(float) Load 215(compare) + 4580: 52(float) Load 4257(lodClamp) + 4581: 6(float) ImageSampleDrefImplicitLod 4577 4578 4579 MinLod 4580 + 4582: 208(ptr) AccessChain 4391(texel) 207 + 4583: 6(float) Load 4582 + 4584: 6(float) FAdd 4583 4581 + 4585: 208(ptr) AccessChain 4391(texel) 207 + Store 4585 4584 + 4586: 391 Load 393(sCubeArrayShadow) + 4587: 7(fvec4) Load 309(f16c4) + 4588: 52(float) Load 215(compare) + 4589: 6(float) Load 4264(f16lodClamp) + 4590: 6(float) ImageSampleDrefImplicitLod 4586 4587 4588 MinLod 4589 + 4591: 208(ptr) AccessChain 4391(texel) 207 + 4592: 6(float) Load 4591 + 4593: 6(float) FAdd 4592 4590 + 4594: 208(ptr) AccessChain 4391(texel) 207 + Store 4594 4593 + 4595: 7(fvec4) Load 4391(texel) + ReturnValue 4595 + FunctionEnd +103(testSparseTextureOffsetClamp(): 7(fvec4) Function None 8 + 104: Label + 4598(texel): 64(ptr) Variable Function + Store 4598(texel) 121 + 4599: 143 Load 145(s2D) + 4600: 53(fvec2) Load 148(c2) + 4601: 52(float) Load 4257(lodClamp) + 4602:3102(ResType) ImageSparseSampleImplicitLod 4599 4600 ConstOffset MinLod 722 4601 + 4603: 7(fvec4) CompositeExtract 4602 1 + Store 4598(texel) 4603 + 4604: 47(int) CompositeExtract 4602 0 + 4605: 143 Load 145(s2D) + 4606: 154(fvec2) Load 156(f16c2) + 4607: 6(float) Load 4264(f16lodClamp) + 4608: 6(float) Load 137(f16bias) + 4609:3102(ResType) ImageSparseSampleImplicitLod 4605 4606 Bias ConstOffset MinLod 4608 722 4607 + 4610: 7(fvec4) CompositeExtract 4609 1 + Store 4598(texel) 4610 + 4611: 47(int) CompositeExtract 4609 0 + 4612: 163 Load 165(s3D) + 4613: 167(fvec3) Load 169(c3) + 4614: 52(float) Load 4257(lodClamp) + 4615:3102(ResType) ImageSparseSampleImplicitLod 4612 4613 ConstOffset MinLod 735 4614 + 4616: 7(fvec4) CompositeExtract 4615 1 + Store 4598(texel) 4616 + 4617: 47(int) CompositeExtract 4615 0 + 4618: 163 Load 165(s3D) + 4619: 175(fvec3) Load 177(f16c3) + 4620: 6(float) Load 4264(f16lodClamp) + 4621: 6(float) Load 137(f16bias) + 4622:3102(ResType) ImageSparseSampleImplicitLod 4618 4619 Bias ConstOffset MinLod 4621 735 4620 + 4623: 7(fvec4) CompositeExtract 4622 1 + Store 4598(texel) 4623 + 4624: 47(int) CompositeExtract 4622 0 + 4625: 224 Load 226(s2DShadow) + 4626: 167(fvec3) Load 169(c3) + 4627: 52(float) Load 4257(lodClamp) + 4628: 208(ptr) AccessChain 4598(texel) 207 + 4629: 52(float) CompositeExtract 4626 2 + 4630:3138(ResType) ImageSparseSampleDrefImplicitLod 4625 4626 4629 ConstOffset MinLod 722 4627 + 4631: 6(float) CompositeExtract 4630 1 + Store 4628 4631 + 4632: 47(int) CompositeExtract 4630 0 + 4633: 224 Load 226(s2DShadow) + 4634: 154(fvec2) Load 156(f16c2) + 4635: 52(float) Load 215(compare) + 4636: 6(float) Load 4264(f16lodClamp) + 4637: 208(ptr) AccessChain 4598(texel) 207 + 4638: 6(float) Load 137(f16bias) + 4639:3138(ResType) ImageSparseSampleDrefImplicitLod 4633 4634 4635 Bias ConstOffset MinLod 4638 722 4636 + 4640: 6(float) CompositeExtract 4639 1 + Store 4637 4640 + 4641: 47(int) CompositeExtract 4639 0 + 4642: 284 Load 286(s2DArray) + 4643: 167(fvec3) Load 169(c3) + 4644: 52(float) Load 4257(lodClamp) + 4645:3102(ResType) ImageSparseSampleImplicitLod 4642 4643 ConstOffset MinLod 722 4644 + 4646: 7(fvec4) CompositeExtract 4645 1 + Store 4598(texel) 4646 + 4647: 47(int) CompositeExtract 4645 0 + 4648: 284 Load 286(s2DArray) + 4649: 175(fvec3) Load 177(f16c3) + 4650: 6(float) Load 4264(f16lodClamp) + 4651: 6(float) Load 137(f16bias) + 4652:3102(ResType) ImageSparseSampleImplicitLod 4648 4649 Bias ConstOffset MinLod 4651 722 4650 + 4653: 7(fvec4) CompositeExtract 4652 1 + Store 4598(texel) 4653 + 4654: 47(int) CompositeExtract 4652 0 + 4655: 337 Load 339(s2DArrayShadow) + 4656: 249(fvec4) Load 251(c4) + 4657: 52(float) Load 4257(lodClamp) + 4658: 208(ptr) AccessChain 4598(texel) 207 + 4659: 52(float) CompositeExtract 4656 3 + 4660:3138(ResType) ImageSparseSampleDrefImplicitLod 4655 4656 4659 ConstOffset MinLod 722 4657 + 4661: 6(float) CompositeExtract 4660 1 + Store 4658 4661 + 4662: 47(int) CompositeExtract 4660 0 + 4663: 337 Load 339(s2DArrayShadow) + 4664: 175(fvec3) Load 177(f16c3) + 4665: 52(float) Load 215(compare) + 4666: 6(float) Load 4264(f16lodClamp) + 4667: 208(ptr) AccessChain 4598(texel) 207 + 4668:3138(ResType) ImageSparseSampleDrefImplicitLod 4663 4664 4665 ConstOffset MinLod 722 4666 + 4669: 6(float) CompositeExtract 4668 1 + Store 4667 4669 + 4670: 47(int) CompositeExtract 4668 0 + 4671: 7(fvec4) Load 4598(texel) + ReturnValue 4671 + FunctionEnd +105(testTextureOffsetClamp(): 7(fvec4) Function None 8 + 106: Label + 4674(texel): 64(ptr) Variable Function + Store 4674(texel) 121 + 4675: 123 Load 125(s1D) + 4676: 52(float) Load 128(c1) + 4677: 52(float) Load 4257(lodClamp) + 4678: 7(fvec4) ImageSampleImplicitLod 4675 4676 ConstOffset MinLod 709 4677 + 4679: 7(fvec4) Load 4674(texel) + 4680: 7(fvec4) FAdd 4679 4678 + Store 4674(texel) 4680 + 4681: 123 Load 125(s1D) + 4682: 6(float) Load 135(f16c1) + 4683: 6(float) Load 4264(f16lodClamp) + 4684: 6(float) Load 137(f16bias) + 4685: 7(fvec4) ImageSampleImplicitLod 4681 4682 Bias ConstOffset MinLod 4684 709 4683 + 4686: 7(fvec4) Load 4674(texel) + 4687: 7(fvec4) FAdd 4686 4685 + Store 4674(texel) 4687 + 4688: 143 Load 145(s2D) + 4689: 53(fvec2) Load 148(c2) + 4690: 52(float) Load 4257(lodClamp) + 4691: 7(fvec4) ImageSampleImplicitLod 4688 4689 ConstOffset MinLod 722 4690 + 4692: 7(fvec4) Load 4674(texel) + 4693: 7(fvec4) FAdd 4692 4691 + Store 4674(texel) 4693 + 4694: 143 Load 145(s2D) + 4695: 154(fvec2) Load 156(f16c2) + 4696: 6(float) Load 4264(f16lodClamp) + 4697: 6(float) Load 137(f16bias) + 4698: 7(fvec4) ImageSampleImplicitLod 4694 4695 Bias ConstOffset MinLod 4697 722 4696 + 4699: 7(fvec4) Load 4674(texel) + 4700: 7(fvec4) FAdd 4699 4698 + Store 4674(texel) 4700 + 4701: 163 Load 165(s3D) + 4702: 167(fvec3) Load 169(c3) + 4703: 52(float) Load 4257(lodClamp) + 4704: 7(fvec4) ImageSampleImplicitLod 4701 4702 ConstOffset MinLod 735 4703 + 4705: 7(fvec4) Load 4674(texel) + 4706: 7(fvec4) FAdd 4705 4704 + Store 4674(texel) 4706 + 4707: 163 Load 165(s3D) + 4708: 175(fvec3) Load 177(f16c3) + 4709: 6(float) Load 4264(f16lodClamp) + 4710: 6(float) Load 137(f16bias) + 4711: 7(fvec4) ImageSampleImplicitLod 4707 4708 Bias ConstOffset MinLod 4710 735 4709 + 4712: 7(fvec4) Load 4674(texel) + 4713: 7(fvec4) FAdd 4712 4711 + Store 4674(texel) 4713 + 4714: 199 Load 201(s1DShadow) + 4715: 167(fvec3) Load 169(c3) + 4716: 52(float) Load 4257(lodClamp) + 4717: 52(float) CompositeExtract 4715 2 + 4718: 6(float) ImageSampleDrefImplicitLod 4714 4715 4717 ConstOffset MinLod 709 4716 + 4719: 208(ptr) AccessChain 4674(texel) 207 + 4720: 6(float) Load 4719 + 4721: 6(float) FAdd 4720 4718 + 4722: 208(ptr) AccessChain 4674(texel) 207 + Store 4722 4721 + 4723: 199 Load 201(s1DShadow) + 4724: 154(fvec2) Load 156(f16c2) + 4725: 52(float) Load 215(compare) + 4726: 6(float) Load 4264(f16lodClamp) + 4727: 6(float) Load 137(f16bias) + 4728: 6(float) ImageSampleDrefImplicitLod 4723 4724 4725 Bias ConstOffset MinLod 4727 709 4726 + 4729: 208(ptr) AccessChain 4674(texel) 207 + 4730: 6(float) Load 4729 + 4731: 6(float) FAdd 4730 4728 + 4732: 208(ptr) AccessChain 4674(texel) 207 + Store 4732 4731 + 4733: 224 Load 226(s2DShadow) + 4734: 167(fvec3) Load 169(c3) + 4735: 52(float) Load 4257(lodClamp) + 4736: 52(float) CompositeExtract 4734 2 + 4737: 6(float) ImageSampleDrefImplicitLod 4733 4734 4736 ConstOffset MinLod 722 4735 + 4738: 208(ptr) AccessChain 4674(texel) 207 + 4739: 6(float) Load 4738 + 4740: 6(float) FAdd 4739 4737 + 4741: 208(ptr) AccessChain 4674(texel) 207 + Store 4741 4740 + 4742: 224 Load 226(s2DShadow) + 4743: 154(fvec2) Load 156(f16c2) + 4744: 52(float) Load 215(compare) + 4745: 6(float) Load 4264(f16lodClamp) + 4746: 6(float) Load 137(f16bias) + 4747: 6(float) ImageSampleDrefImplicitLod 4742 4743 4744 Bias ConstOffset MinLod 4746 722 4745 + 4748: 208(ptr) AccessChain 4674(texel) 207 + 4749: 6(float) Load 4748 + 4750: 6(float) FAdd 4749 4747 + 4751: 208(ptr) AccessChain 4674(texel) 207 + Store 4751 4750 + 4752: 269 Load 271(s1DArray) + 4753: 53(fvec2) Load 148(c2) + 4754: 52(float) Load 4257(lodClamp) + 4755: 7(fvec4) ImageSampleImplicitLod 4752 4753 ConstOffset MinLod 709 4754 + 4756: 7(fvec4) Load 4674(texel) + 4757: 7(fvec4) FAdd 4756 4755 + Store 4674(texel) 4757 + 4758: 269 Load 271(s1DArray) + 4759: 154(fvec2) Load 156(f16c2) + 4760: 6(float) Load 4264(f16lodClamp) + 4761: 6(float) Load 137(f16bias) + 4762: 7(fvec4) ImageSampleImplicitLod 4758 4759 Bias ConstOffset MinLod 4761 709 4760 + 4763: 7(fvec4) Load 4674(texel) + 4764: 7(fvec4) FAdd 4763 4762 + Store 4674(texel) 4764 + 4765: 284 Load 286(s2DArray) + 4766: 167(fvec3) Load 169(c3) + 4767: 52(float) Load 4257(lodClamp) + 4768: 7(fvec4) ImageSampleImplicitLod 4765 4766 ConstOffset MinLod 722 4767 + 4769: 7(fvec4) Load 4674(texel) + 4770: 7(fvec4) FAdd 4769 4768 + Store 4674(texel) 4770 + 4771: 284 Load 286(s2DArray) + 4772: 175(fvec3) Load 177(f16c3) + 4773: 6(float) Load 4264(f16lodClamp) + 4774: 6(float) Load 137(f16bias) + 4775: 7(fvec4) ImageSampleImplicitLod 4771 4772 Bias ConstOffset MinLod 4774 722 4773 + 4776: 7(fvec4) Load 4674(texel) + 4777: 7(fvec4) FAdd 4776 4775 + Store 4674(texel) 4777 + 4778: 316 Load 318(s1DArrayShadow) + 4779: 167(fvec3) Load 169(c3) + 4780: 52(float) Load 4257(lodClamp) + 4781: 52(float) CompositeExtract 4779 2 + 4782: 6(float) ImageSampleDrefImplicitLod 4778 4779 4781 ConstOffset MinLod 709 4780 + 4783: 208(ptr) AccessChain 4674(texel) 207 + 4784: 6(float) Load 4783 + 4785: 6(float) FAdd 4784 4782 + 4786: 208(ptr) AccessChain 4674(texel) 207 + Store 4786 4785 + 4787: 316 Load 318(s1DArrayShadow) + 4788: 154(fvec2) Load 156(f16c2) + 4789: 52(float) Load 215(compare) + 4790: 6(float) Load 4264(f16lodClamp) + 4791: 6(float) Load 137(f16bias) + 4792: 6(float) ImageSampleDrefImplicitLod 4787 4788 4789 Bias ConstOffset MinLod 4791 709 4790 + 4793: 208(ptr) AccessChain 4674(texel) 207 + 4794: 6(float) Load 4793 + 4795: 6(float) FAdd 4794 4792 + 4796: 208(ptr) AccessChain 4674(texel) 207 + Store 4796 4795 + 4797: 337 Load 339(s2DArrayShadow) + 4798: 249(fvec4) Load 251(c4) + 4799: 52(float) Load 4257(lodClamp) + 4800: 52(float) CompositeExtract 4798 3 + 4801: 6(float) ImageSampleDrefImplicitLod 4797 4798 4800 ConstOffset MinLod 722 4799 + 4802: 208(ptr) AccessChain 4674(texel) 207 + 4803: 6(float) Load 4802 + 4804: 6(float) FAdd 4803 4801 + 4805: 208(ptr) AccessChain 4674(texel) 207 + Store 4805 4804 + 4806: 337 Load 339(s2DArrayShadow) + 4807: 175(fvec3) Load 177(f16c3) + 4808: 52(float) Load 215(compare) + 4809: 6(float) Load 4264(f16lodClamp) + 4810: 6(float) ImageSampleDrefImplicitLod 4806 4807 4808 ConstOffset MinLod 722 4809 + 4811: 208(ptr) AccessChain 4674(texel) 207 + 4812: 6(float) Load 4811 + 4813: 6(float) FAdd 4812 4810 + 4814: 208(ptr) AccessChain 4674(texel) 207 + Store 4814 4813 + 4815: 7(fvec4) Load 4674(texel) + ReturnValue 4815 + FunctionEnd +107(testSparseTextureGradClamp(): 7(fvec4) Function None 8 + 108: Label + 4818(texel): 64(ptr) Variable Function + Store 4818(texel) 121 + 4819: 143 Load 145(s2D) + 4820: 53(fvec2) Load 148(c2) + 4821: 53(fvec2) Load 1409(dPdxy2) + 4822: 53(fvec2) Load 1409(dPdxy2) + 4823: 52(float) Load 4257(lodClamp) + 4824:3102(ResType) ImageSparseSampleExplicitLod 4819 4820 Grad MinLod 4821 4822 4823 + 4825: 7(fvec4) CompositeExtract 4824 1 + Store 4818(texel) 4825 + 4826: 47(int) CompositeExtract 4824 0 + 4827: 143 Load 145(s2D) + 4828: 154(fvec2) Load 156(f16c2) + 4829: 154(fvec2) Load 1417(f16dPdxy2) + 4830: 154(fvec2) Load 1417(f16dPdxy2) + 4831: 6(float) Load 4264(f16lodClamp) + 4832:3102(ResType) ImageSparseSampleExplicitLod 4827 4828 Grad MinLod 4829 4830 4831 + 4833: 7(fvec4) CompositeExtract 4832 1 + Store 4818(texel) 4833 + 4834: 47(int) CompositeExtract 4832 0 + 4835: 163 Load 165(s3D) + 4836: 167(fvec3) Load 169(c3) + 4837: 167(fvec3) Load 1425(dPdxy3) + 4838: 167(fvec3) Load 1425(dPdxy3) + 4839: 52(float) Load 4257(lodClamp) + 4840:3102(ResType) ImageSparseSampleExplicitLod 4835 4836 Grad MinLod 4837 4838 4839 + 4841: 7(fvec4) CompositeExtract 4840 1 + Store 4818(texel) 4841 + 4842: 47(int) CompositeExtract 4840 0 + 4843: 163 Load 165(s3D) + 4844: 175(fvec3) Load 177(f16c3) + 4845: 175(fvec3) Load 1433(f16dPdxy3) + 4846: 175(fvec3) Load 1433(f16dPdxy3) + 4847: 6(float) Load 4264(f16lodClamp) + 4848:3102(ResType) ImageSparseSampleExplicitLod 4843 4844 Grad MinLod 4845 4846 4847 + 4849: 7(fvec4) CompositeExtract 4848 1 + Store 4818(texel) 4849 + 4850: 47(int) CompositeExtract 4848 0 + 4851: 184 Load 186(sCube) + 4852: 167(fvec3) Load 169(c3) + 4853: 167(fvec3) Load 1425(dPdxy3) + 4854: 167(fvec3) Load 1425(dPdxy3) + 4855: 52(float) Load 4257(lodClamp) + 4856:3102(ResType) ImageSparseSampleExplicitLod 4851 4852 Grad MinLod 4853 4854 4855 + 4857: 7(fvec4) CompositeExtract 4856 1 + Store 4818(texel) 4857 + 4858: 47(int) CompositeExtract 4856 0 + 4859: 184 Load 186(sCube) + 4860: 175(fvec3) Load 177(f16c3) + 4861: 175(fvec3) Load 1433(f16dPdxy3) + 4862: 175(fvec3) Load 1433(f16dPdxy3) + 4863: 6(float) Load 4264(f16lodClamp) + 4864:3102(ResType) ImageSparseSampleExplicitLod 4859 4860 Grad MinLod 4861 4862 4863 + 4865: 7(fvec4) CompositeExtract 4864 1 + Store 4818(texel) 4865 + 4866: 47(int) CompositeExtract 4864 0 + 4867: 224 Load 226(s2DShadow) + 4868: 167(fvec3) Load 169(c3) + 4869: 53(fvec2) Load 1409(dPdxy2) + 4870: 53(fvec2) Load 1409(dPdxy2) + 4871: 52(float) Load 4257(lodClamp) + 4872: 208(ptr) AccessChain 4818(texel) 207 + 4873: 52(float) CompositeExtract 4868 2 + 4874:3138(ResType) ImageSparseSampleDrefExplicitLod 4867 4868 4873 Grad MinLod 4869 4870 4871 + 4875: 6(float) CompositeExtract 4874 1 + Store 4872 4875 + 4876: 47(int) CompositeExtract 4874 0 + 4877: 224 Load 226(s2DShadow) + 4878: 154(fvec2) Load 156(f16c2) + 4879: 52(float) Load 215(compare) + 4880: 154(fvec2) Load 1417(f16dPdxy2) + 4881: 154(fvec2) Load 1417(f16dPdxy2) + 4882: 6(float) Load 4264(f16lodClamp) + 4883: 208(ptr) AccessChain 4818(texel) 207 + 4884:3138(ResType) ImageSparseSampleDrefExplicitLod 4877 4878 4879 Grad MinLod 4880 4881 4882 + 4885: 6(float) CompositeExtract 4884 1 + Store 4883 4885 + 4886: 47(int) CompositeExtract 4884 0 + 4887: 245 Load 247(sCubeShadow) + 4888: 249(fvec4) Load 251(c4) + 4889: 167(fvec3) Load 1425(dPdxy3) + 4890: 167(fvec3) Load 1425(dPdxy3) + 4891: 52(float) Load 4257(lodClamp) + 4892: 208(ptr) AccessChain 4818(texel) 207 + 4893: 52(float) CompositeExtract 4888 3 + 4894:3138(ResType) ImageSparseSampleDrefExplicitLod 4887 4888 4893 Grad MinLod 4889 4890 4891 + 4895: 6(float) CompositeExtract 4894 1 + Store 4892 4895 + 4896: 47(int) CompositeExtract 4894 0 + 4897: 245 Load 247(sCubeShadow) + 4898: 175(fvec3) Load 177(f16c3) + 4899: 52(float) Load 215(compare) + 4900: 175(fvec3) Load 1433(f16dPdxy3) + 4901: 175(fvec3) Load 1433(f16dPdxy3) + 4902: 6(float) Load 4264(f16lodClamp) + 4903: 208(ptr) AccessChain 4818(texel) 207 + 4904:3138(ResType) ImageSparseSampleDrefExplicitLod 4897 4898 4899 Grad MinLod 4900 4901 4902 + 4905: 6(float) CompositeExtract 4904 1 + Store 4903 4905 + 4906: 47(int) CompositeExtract 4904 0 + 4907: 284 Load 286(s2DArray) + 4908: 167(fvec3) Load 169(c3) + 4909: 53(fvec2) Load 1409(dPdxy2) + 4910: 53(fvec2) Load 1409(dPdxy2) + 4911: 52(float) Load 4257(lodClamp) + 4912:3102(ResType) ImageSparseSampleExplicitLod 4907 4908 Grad MinLod 4909 4910 4911 + 4913: 7(fvec4) CompositeExtract 4912 1 + Store 4818(texel) 4913 + 4914: 47(int) CompositeExtract 4912 0 + 4915: 284 Load 286(s2DArray) + 4916: 175(fvec3) Load 177(f16c3) + 4917: 154(fvec2) Load 1417(f16dPdxy2) + 4918: 154(fvec2) Load 1417(f16dPdxy2) + 4919: 6(float) Load 4264(f16lodClamp) + 4920:3102(ResType) ImageSparseSampleExplicitLod 4915 4916 Grad MinLod 4917 4918 4919 + 4921: 7(fvec4) CompositeExtract 4920 1 + Store 4818(texel) 4921 + 4922: 47(int) CompositeExtract 4920 0 + 4923: 337 Load 339(s2DArrayShadow) + 4924: 249(fvec4) Load 251(c4) + 4925: 53(fvec2) Load 1409(dPdxy2) + 4926: 53(fvec2) Load 1409(dPdxy2) + 4927: 52(float) Load 4257(lodClamp) + 4928: 208(ptr) AccessChain 4818(texel) 207 + 4929: 52(float) CompositeExtract 4924 3 + 4930:3138(ResType) ImageSparseSampleDrefExplicitLod 4923 4924 4929 Grad MinLod 4925 4926 4927 + 4931: 6(float) CompositeExtract 4930 1 + Store 4928 4931 + 4932: 47(int) CompositeExtract 4930 0 + 4933: 337 Load 339(s2DArrayShadow) + 4934: 175(fvec3) Load 177(f16c3) + 4935: 52(float) Load 215(compare) + 4936: 154(fvec2) Load 1417(f16dPdxy2) + 4937: 154(fvec2) Load 1417(f16dPdxy2) + 4938: 6(float) Load 4264(f16lodClamp) + 4939: 208(ptr) AccessChain 4818(texel) 207 + 4940:3138(ResType) ImageSparseSampleDrefExplicitLod 4933 4934 4935 Grad MinLod 4936 4937 4938 + 4941: 6(float) CompositeExtract 4940 1 + Store 4939 4941 + 4942: 47(int) CompositeExtract 4940 0 + 4943: 299 Load 301(sCubeArray) + 4944: 249(fvec4) Load 251(c4) + 4945: 167(fvec3) Load 1425(dPdxy3) + 4946: 167(fvec3) Load 1425(dPdxy3) + 4947: 52(float) Load 4257(lodClamp) + 4948:3102(ResType) ImageSparseSampleExplicitLod 4943 4944 Grad MinLod 4945 4946 4947 + 4949: 7(fvec4) CompositeExtract 4948 1 + Store 4818(texel) 4949 + 4950: 47(int) CompositeExtract 4948 0 + 4951: 299 Load 301(sCubeArray) + 4952: 7(fvec4) Load 309(f16c4) + 4953: 175(fvec3) Load 1433(f16dPdxy3) + 4954: 175(fvec3) Load 1433(f16dPdxy3) + 4955: 6(float) Load 4264(f16lodClamp) + 4956:3102(ResType) ImageSparseSampleExplicitLod 4951 4952 Grad MinLod 4953 4954 4955 + 4957: 7(fvec4) CompositeExtract 4956 1 + Store 4818(texel) 4957 + 4958: 47(int) CompositeExtract 4956 0 + 4959: 7(fvec4) Load 4818(texel) + ReturnValue 4959 + FunctionEnd +109(testTextureGradClamp(): 7(fvec4) Function None 8 + 110: Label + 4962(texel): 64(ptr) Variable Function + Store 4962(texel) 121 + 4963: 123 Load 125(s1D) + 4964: 52(float) Load 128(c1) + 4965: 52(float) Load 1393(dPdxy1) + 4966: 52(float) Load 1393(dPdxy1) + 4967: 52(float) Load 4257(lodClamp) + 4968: 7(fvec4) ImageSampleExplicitLod 4963 4964 Grad MinLod 4965 4966 4967 + 4969: 7(fvec4) Load 4962(texel) + 4970: 7(fvec4) FAdd 4969 4968 + Store 4962(texel) 4970 + 4971: 123 Load 125(s1D) + 4972: 6(float) Load 135(f16c1) + 4973: 6(float) Load 1401(f16dPdxy1) + 4974: 6(float) Load 1401(f16dPdxy1) + 4975: 6(float) Load 4264(f16lodClamp) + 4976: 7(fvec4) ImageSampleExplicitLod 4971 4972 Grad MinLod 4973 4974 4975 + 4977: 7(fvec4) Load 4962(texel) + 4978: 7(fvec4) FAdd 4977 4976 + Store 4962(texel) 4978 + 4979: 143 Load 145(s2D) + 4980: 53(fvec2) Load 148(c2) + 4981: 53(fvec2) Load 1409(dPdxy2) + 4982: 53(fvec2) Load 1409(dPdxy2) + 4983: 52(float) Load 4257(lodClamp) + 4984: 7(fvec4) ImageSampleExplicitLod 4979 4980 Grad MinLod 4981 4982 4983 + 4985: 7(fvec4) Load 4962(texel) + 4986: 7(fvec4) FAdd 4985 4984 + Store 4962(texel) 4986 + 4987: 143 Load 145(s2D) + 4988: 154(fvec2) Load 156(f16c2) + 4989: 154(fvec2) Load 1417(f16dPdxy2) + 4990: 154(fvec2) Load 1417(f16dPdxy2) + 4991: 6(float) Load 4264(f16lodClamp) + 4992: 7(fvec4) ImageSampleExplicitLod 4987 4988 Grad MinLod 4989 4990 4991 + 4993: 7(fvec4) Load 4962(texel) + 4994: 7(fvec4) FAdd 4993 4992 + Store 4962(texel) 4994 + 4995: 163 Load 165(s3D) + 4996: 167(fvec3) Load 169(c3) + 4997: 167(fvec3) Load 1425(dPdxy3) + 4998: 167(fvec3) Load 1425(dPdxy3) + 4999: 52(float) Load 4257(lodClamp) + 5000: 7(fvec4) ImageSampleExplicitLod 4995 4996 Grad MinLod 4997 4998 4999 + 5001: 7(fvec4) Load 4962(texel) + 5002: 7(fvec4) FAdd 5001 5000 + Store 4962(texel) 5002 + 5003: 163 Load 165(s3D) + 5004: 175(fvec3) Load 177(f16c3) + 5005: 175(fvec3) Load 1433(f16dPdxy3) + 5006: 175(fvec3) Load 1433(f16dPdxy3) + 5007: 6(float) Load 4264(f16lodClamp) + 5008: 7(fvec4) ImageSampleExplicitLod 5003 5004 Grad MinLod 5005 5006 5007 + 5009: 7(fvec4) Load 4962(texel) + 5010: 7(fvec4) FAdd 5009 5008 + Store 4962(texel) 5010 + 5011: 184 Load 186(sCube) + 5012: 167(fvec3) Load 169(c3) + 5013: 167(fvec3) Load 1425(dPdxy3) + 5014: 167(fvec3) Load 1425(dPdxy3) + 5015: 52(float) Load 4257(lodClamp) + 5016: 7(fvec4) ImageSampleExplicitLod 5011 5012 Grad MinLod 5013 5014 5015 + 5017: 7(fvec4) Load 4962(texel) + 5018: 7(fvec4) FAdd 5017 5016 + Store 4962(texel) 5018 + 5019: 184 Load 186(sCube) + 5020: 175(fvec3) Load 177(f16c3) + 5021: 175(fvec3) Load 1433(f16dPdxy3) + 5022: 175(fvec3) Load 1433(f16dPdxy3) + 5023: 6(float) Load 4264(f16lodClamp) + 5024: 7(fvec4) ImageSampleExplicitLod 5019 5020 Grad MinLod 5021 5022 5023 + 5025: 7(fvec4) Load 4962(texel) + 5026: 7(fvec4) FAdd 5025 5024 + Store 4962(texel) 5026 + 5027: 199 Load 201(s1DShadow) + 5028: 167(fvec3) Load 169(c3) + 5029: 52(float) Load 1393(dPdxy1) + 5030: 52(float) Load 1393(dPdxy1) + 5031: 52(float) Load 4257(lodClamp) + 5032: 52(float) CompositeExtract 5028 2 + 5033: 6(float) ImageSampleDrefExplicitLod 5027 5028 5032 Grad MinLod 5029 5030 5031 + 5034: 208(ptr) AccessChain 4962(texel) 207 + 5035: 6(float) Load 5034 + 5036: 6(float) FAdd 5035 5033 + 5037: 208(ptr) AccessChain 4962(texel) 207 + Store 5037 5036 + 5038: 199 Load 201(s1DShadow) + 5039: 154(fvec2) Load 156(f16c2) + 5040: 52(float) Load 215(compare) + 5041: 6(float) Load 1401(f16dPdxy1) + 5042: 6(float) Load 1401(f16dPdxy1) + 5043: 6(float) Load 4264(f16lodClamp) + 5044: 6(float) ImageSampleDrefExplicitLod 5038 5039 5040 Grad MinLod 5041 5042 5043 + 5045: 208(ptr) AccessChain 4962(texel) 207 + 5046: 6(float) Load 5045 + 5047: 6(float) FAdd 5046 5044 + 5048: 208(ptr) AccessChain 4962(texel) 207 + Store 5048 5047 + 5049: 224 Load 226(s2DShadow) + 5050: 167(fvec3) Load 169(c3) + 5051: 53(fvec2) Load 1409(dPdxy2) + 5052: 53(fvec2) Load 1409(dPdxy2) + 5053: 52(float) Load 4257(lodClamp) + 5054: 52(float) CompositeExtract 5050 2 + 5055: 6(float) ImageSampleDrefExplicitLod 5049 5050 5054 Grad MinLod 5051 5052 5053 + 5056: 208(ptr) AccessChain 4962(texel) 207 + 5057: 6(float) Load 5056 + 5058: 6(float) FAdd 5057 5055 + 5059: 208(ptr) AccessChain 4962(texel) 207 + Store 5059 5058 + 5060: 224 Load 226(s2DShadow) + 5061: 154(fvec2) Load 156(f16c2) + 5062: 52(float) Load 215(compare) + 5063: 154(fvec2) Load 1417(f16dPdxy2) + 5064: 154(fvec2) Load 1417(f16dPdxy2) + 5065: 6(float) Load 4264(f16lodClamp) + 5066: 6(float) ImageSampleDrefExplicitLod 5060 5061 5062 Grad MinLod 5063 5064 5065 + 5067: 208(ptr) AccessChain 4962(texel) 207 + 5068: 6(float) Load 5067 + 5069: 6(float) FAdd 5068 5066 + 5070: 208(ptr) AccessChain 4962(texel) 207 + Store 5070 5069 + 5071: 245 Load 247(sCubeShadow) + 5072: 249(fvec4) Load 251(c4) + 5073: 167(fvec3) Load 1425(dPdxy3) + 5074: 167(fvec3) Load 1425(dPdxy3) + 5075: 52(float) Load 4257(lodClamp) + 5076: 52(float) CompositeExtract 5072 3 + 5077: 6(float) ImageSampleDrefExplicitLod 5071 5072 5076 Grad MinLod 5073 5074 5075 + 5078: 208(ptr) AccessChain 4962(texel) 207 + 5079: 6(float) Load 5078 + 5080: 6(float) FAdd 5079 5077 + 5081: 208(ptr) AccessChain 4962(texel) 207 + Store 5081 5080 + 5082: 245 Load 247(sCubeShadow) + 5083: 175(fvec3) Load 177(f16c3) + 5084: 52(float) Load 215(compare) + 5085: 175(fvec3) Load 1433(f16dPdxy3) + 5086: 175(fvec3) Load 1433(f16dPdxy3) + 5087: 6(float) Load 4264(f16lodClamp) + 5088: 6(float) ImageSampleDrefExplicitLod 5082 5083 5084 Grad MinLod 5085 5086 5087 + 5089: 208(ptr) AccessChain 4962(texel) 207 + 5090: 6(float) Load 5089 + 5091: 6(float) FAdd 5090 5088 + 5092: 208(ptr) AccessChain 4962(texel) 207 + Store 5092 5091 + 5093: 269 Load 271(s1DArray) + 5094: 53(fvec2) Load 148(c2) + 5095: 52(float) Load 1393(dPdxy1) + 5096: 52(float) Load 1393(dPdxy1) + 5097: 52(float) Load 4257(lodClamp) + 5098: 7(fvec4) ImageSampleExplicitLod 5093 5094 Grad MinLod 5095 5096 5097 + 5099: 7(fvec4) Load 4962(texel) + 5100: 7(fvec4) FAdd 5099 5098 + Store 4962(texel) 5100 + 5101: 269 Load 271(s1DArray) + 5102: 154(fvec2) Load 156(f16c2) + 5103: 6(float) Load 1401(f16dPdxy1) + 5104: 6(float) Load 1401(f16dPdxy1) + 5105: 6(float) Load 4264(f16lodClamp) + 5106: 7(fvec4) ImageSampleExplicitLod 5101 5102 Grad MinLod 5103 5104 5105 + 5107: 7(fvec4) Load 4962(texel) + 5108: 7(fvec4) FAdd 5107 5106 + Store 4962(texel) 5108 + 5109: 284 Load 286(s2DArray) + 5110: 167(fvec3) Load 169(c3) + 5111: 53(fvec2) Load 1409(dPdxy2) + 5112: 53(fvec2) Load 1409(dPdxy2) + 5113: 52(float) Load 4257(lodClamp) + 5114: 7(fvec4) ImageSampleExplicitLod 5109 5110 Grad MinLod 5111 5112 5113 + 5115: 7(fvec4) Load 4962(texel) + 5116: 7(fvec4) FAdd 5115 5114 + Store 4962(texel) 5116 + 5117: 284 Load 286(s2DArray) + 5118: 175(fvec3) Load 177(f16c3) + 5119: 154(fvec2) Load 1417(f16dPdxy2) + 5120: 154(fvec2) Load 1417(f16dPdxy2) + 5121: 6(float) Load 4264(f16lodClamp) + 5122: 7(fvec4) ImageSampleExplicitLod 5117 5118 Grad MinLod 5119 5120 5121 + 5123: 7(fvec4) Load 4962(texel) + 5124: 7(fvec4) FAdd 5123 5122 + Store 4962(texel) 5124 + 5125: 316 Load 318(s1DArrayShadow) + 5126: 167(fvec3) Load 169(c3) + 5127: 52(float) Load 1393(dPdxy1) + 5128: 52(float) Load 1393(dPdxy1) + 5129: 52(float) Load 4257(lodClamp) + 5130: 52(float) CompositeExtract 5126 2 + 5131: 6(float) ImageSampleDrefExplicitLod 5125 5126 5130 Grad MinLod 5127 5128 5129 + 5132: 208(ptr) AccessChain 4962(texel) 207 + 5133: 6(float) Load 5132 + 5134: 6(float) FAdd 5133 5131 + 5135: 208(ptr) AccessChain 4962(texel) 207 + Store 5135 5134 + 5136: 316 Load 318(s1DArrayShadow) + 5137: 154(fvec2) Load 156(f16c2) + 5138: 52(float) Load 215(compare) + 5139: 6(float) Load 1401(f16dPdxy1) + 5140: 6(float) Load 1401(f16dPdxy1) + 5141: 6(float) Load 4264(f16lodClamp) + 5142: 6(float) ImageSampleDrefExplicitLod 5136 5137 5138 Grad MinLod 5139 5140 5141 + 5143: 208(ptr) AccessChain 4962(texel) 207 + 5144: 6(float) Load 5143 + 5145: 6(float) FAdd 5144 5142 + 5146: 208(ptr) AccessChain 4962(texel) 207 + Store 5146 5145 + 5147: 337 Load 339(s2DArrayShadow) + 5148: 249(fvec4) Load 251(c4) + 5149: 53(fvec2) Load 1409(dPdxy2) + 5150: 53(fvec2) Load 1409(dPdxy2) + 5151: 52(float) Load 4257(lodClamp) + 5152: 52(float) CompositeExtract 5148 3 + 5153: 6(float) ImageSampleDrefExplicitLod 5147 5148 5152 Grad MinLod 5149 5150 5151 + 5154: 208(ptr) AccessChain 4962(texel) 207 + 5155: 6(float) Load 5154 + 5156: 6(float) FAdd 5155 5153 + 5157: 208(ptr) AccessChain 4962(texel) 207 + Store 5157 5156 + 5158: 337 Load 339(s2DArrayShadow) + 5159: 175(fvec3) Load 177(f16c3) + 5160: 52(float) Load 215(compare) + 5161: 154(fvec2) Load 1417(f16dPdxy2) + 5162: 154(fvec2) Load 1417(f16dPdxy2) + 5163: 6(float) Load 4264(f16lodClamp) + 5164: 6(float) ImageSampleDrefExplicitLod 5158 5159 5160 Grad MinLod 5161 5162 5163 + 5165: 208(ptr) AccessChain 4962(texel) 207 + 5166: 6(float) Load 5165 + 5167: 6(float) FAdd 5166 5164 + 5168: 208(ptr) AccessChain 4962(texel) 207 + Store 5168 5167 + 5169: 299 Load 301(sCubeArray) + 5170: 249(fvec4) Load 251(c4) + 5171: 167(fvec3) Load 1425(dPdxy3) + 5172: 167(fvec3) Load 1425(dPdxy3) + 5173: 52(float) Load 4257(lodClamp) + 5174: 7(fvec4) ImageSampleExplicitLod 5169 5170 Grad MinLod 5171 5172 5173 + 5175: 7(fvec4) Load 4962(texel) + 5176: 7(fvec4) FAdd 5175 5174 + Store 4962(texel) 5176 + 5177: 299 Load 301(sCubeArray) + 5178: 7(fvec4) Load 309(f16c4) + 5179: 175(fvec3) Load 1433(f16dPdxy3) + 5180: 175(fvec3) Load 1433(f16dPdxy3) + 5181: 6(float) Load 4264(f16lodClamp) + 5182: 7(fvec4) ImageSampleExplicitLod 5177 5178 Grad MinLod 5179 5180 5181 + 5183: 7(fvec4) Load 4962(texel) + 5184: 7(fvec4) FAdd 5183 5182 + Store 4962(texel) 5184 + 5185: 7(fvec4) Load 4962(texel) + ReturnValue 5185 + FunctionEnd +111(testSparseTextureGradOffsetClamp(): 7(fvec4) Function None 8 + 112: Label + 5188(texel): 64(ptr) Variable Function + Store 5188(texel) 121 + 5189: 143 Load 145(s2D) + 5190: 53(fvec2) Load 148(c2) + 5191: 53(fvec2) Load 1409(dPdxy2) + 5192: 53(fvec2) Load 1409(dPdxy2) + 5193: 52(float) Load 4257(lodClamp) + 5194:3102(ResType) ImageSparseSampleExplicitLod 5189 5190 Grad ConstOffset MinLod 5191 5192 722 5193 + 5195: 7(fvec4) CompositeExtract 5194 1 + Store 5188(texel) 5195 + 5196: 47(int) CompositeExtract 5194 0 + 5197: 143 Load 145(s2D) + 5198: 154(fvec2) Load 156(f16c2) + 5199: 154(fvec2) Load 1417(f16dPdxy2) + 5200: 154(fvec2) Load 1417(f16dPdxy2) + 5201: 6(float) Load 4264(f16lodClamp) + 5202:3102(ResType) ImageSparseSampleExplicitLod 5197 5198 Grad ConstOffset MinLod 5199 5200 722 5201 + 5203: 7(fvec4) CompositeExtract 5202 1 + Store 5188(texel) 5203 + 5204: 47(int) CompositeExtract 5202 0 + 5205: 163 Load 165(s3D) + 5206: 167(fvec3) Load 169(c3) + 5207: 167(fvec3) Load 1425(dPdxy3) + 5208: 167(fvec3) Load 1425(dPdxy3) + 5209: 52(float) Load 4257(lodClamp) + 5210:3102(ResType) ImageSparseSampleExplicitLod 5205 5206 Grad ConstOffset MinLod 5207 5208 735 5209 + 5211: 7(fvec4) CompositeExtract 5210 1 + Store 5188(texel) 5211 + 5212: 47(int) CompositeExtract 5210 0 + 5213: 163 Load 165(s3D) + 5214: 175(fvec3) Load 177(f16c3) + 5215: 175(fvec3) Load 1433(f16dPdxy3) + 5216: 175(fvec3) Load 1433(f16dPdxy3) + 5217: 6(float) Load 4264(f16lodClamp) + 5218:3102(ResType) ImageSparseSampleExplicitLod 5213 5214 Grad ConstOffset MinLod 5215 5216 735 5217 + 5219: 7(fvec4) CompositeExtract 5218 1 + Store 5188(texel) 5219 + 5220: 47(int) CompositeExtract 5218 0 + 5221: 224 Load 226(s2DShadow) + 5222: 167(fvec3) Load 169(c3) + 5223: 53(fvec2) Load 1409(dPdxy2) + 5224: 53(fvec2) Load 1409(dPdxy2) + 5225: 52(float) Load 4257(lodClamp) + 5226: 208(ptr) AccessChain 5188(texel) 207 + 5227: 52(float) CompositeExtract 5222 2 + 5228:3138(ResType) ImageSparseSampleDrefExplicitLod 5221 5222 5227 Grad ConstOffset MinLod 5223 5224 722 5225 + 5229: 6(float) CompositeExtract 5228 1 + Store 5226 5229 + 5230: 47(int) CompositeExtract 5228 0 + 5231: 224 Load 226(s2DShadow) + 5232: 154(fvec2) Load 156(f16c2) + 5233: 52(float) Load 215(compare) + 5234: 154(fvec2) Load 1417(f16dPdxy2) + 5235: 154(fvec2) Load 1417(f16dPdxy2) + 5236: 6(float) Load 4264(f16lodClamp) + 5237: 208(ptr) AccessChain 5188(texel) 207 + 5238:3138(ResType) ImageSparseSampleDrefExplicitLod 5231 5232 5233 Grad ConstOffset MinLod 5234 5235 722 5236 + 5239: 6(float) CompositeExtract 5238 1 + Store 5237 5239 + 5240: 47(int) CompositeExtract 5238 0 + 5241: 284 Load 286(s2DArray) + 5242: 167(fvec3) Load 169(c3) + 5243: 53(fvec2) Load 1409(dPdxy2) + 5244: 53(fvec2) Load 1409(dPdxy2) + 5245: 52(float) Load 4257(lodClamp) + 5246:3102(ResType) ImageSparseSampleExplicitLod 5241 5242 Grad ConstOffset MinLod 5243 5244 722 5245 + 5247: 7(fvec4) CompositeExtract 5246 1 + Store 5188(texel) 5247 + 5248: 47(int) CompositeExtract 5246 0 + 5249: 284 Load 286(s2DArray) + 5250: 175(fvec3) Load 177(f16c3) + 5251: 154(fvec2) Load 1417(f16dPdxy2) + 5252: 154(fvec2) Load 1417(f16dPdxy2) + 5253: 6(float) Load 4264(f16lodClamp) + 5254:3102(ResType) ImageSparseSampleExplicitLod 5249 5250 Grad ConstOffset MinLod 5251 5252 722 5253 + 5255: 7(fvec4) CompositeExtract 5254 1 + Store 5188(texel) 5255 + 5256: 47(int) CompositeExtract 5254 0 + 5257: 337 Load 339(s2DArrayShadow) + 5258: 249(fvec4) Load 251(c4) + 5259: 53(fvec2) Load 1409(dPdxy2) + 5260: 53(fvec2) Load 1409(dPdxy2) + 5261: 52(float) Load 4257(lodClamp) + 5262: 208(ptr) AccessChain 5188(texel) 207 + 5263: 52(float) CompositeExtract 5258 3 + 5264:3138(ResType) ImageSparseSampleDrefExplicitLod 5257 5258 5263 Grad ConstOffset MinLod 5259 5260 722 5261 + 5265: 6(float) CompositeExtract 5264 1 + Store 5262 5265 + 5266: 47(int) CompositeExtract 5264 0 + 5267: 337 Load 339(s2DArrayShadow) + 5268: 175(fvec3) Load 177(f16c3) + 5269: 52(float) Load 215(compare) + 5270: 154(fvec2) Load 1417(f16dPdxy2) + 5271: 154(fvec2) Load 1417(f16dPdxy2) + 5272: 6(float) Load 4264(f16lodClamp) + 5273: 208(ptr) AccessChain 5188(texel) 207 + 5274:3138(ResType) ImageSparseSampleDrefExplicitLod 5267 5268 5269 Grad ConstOffset MinLod 5270 5271 722 5272 + 5275: 6(float) CompositeExtract 5274 1 + Store 5273 5275 + 5276: 47(int) CompositeExtract 5274 0 + 5277: 7(fvec4) Load 5188(texel) + ReturnValue 5277 + FunctionEnd +113(testTextureGradOffsetClamp(): 7(fvec4) Function None 8 + 114: Label + 5280(texel): 64(ptr) Variable Function + Store 5280(texel) 121 + 5281: 123 Load 125(s1D) + 5282: 52(float) Load 128(c1) + 5283: 52(float) Load 1393(dPdxy1) + 5284: 52(float) Load 1393(dPdxy1) + 5285: 52(float) Load 4257(lodClamp) + 5286: 7(fvec4) ImageSampleExplicitLod 5281 5282 Grad ConstOffset MinLod 5283 5284 709 5285 + 5287: 7(fvec4) Load 5280(texel) + 5288: 7(fvec4) FAdd 5287 5286 + Store 5280(texel) 5288 + 5289: 123 Load 125(s1D) + 5290: 6(float) Load 135(f16c1) + 5291: 6(float) Load 1401(f16dPdxy1) + 5292: 6(float) Load 1401(f16dPdxy1) + 5293: 6(float) Load 4264(f16lodClamp) + 5294: 7(fvec4) ImageSampleExplicitLod 5289 5290 Grad ConstOffset MinLod 5291 5292 709 5293 + 5295: 7(fvec4) Load 5280(texel) + 5296: 7(fvec4) FAdd 5295 5294 + Store 5280(texel) 5296 + 5297: 143 Load 145(s2D) + 5298: 53(fvec2) Load 148(c2) + 5299: 53(fvec2) Load 1409(dPdxy2) + 5300: 53(fvec2) Load 1409(dPdxy2) + 5301: 52(float) Load 4257(lodClamp) + 5302: 7(fvec4) ImageSampleExplicitLod 5297 5298 Grad ConstOffset MinLod 5299 5300 722 5301 + 5303: 7(fvec4) Load 5280(texel) + 5304: 7(fvec4) FAdd 5303 5302 + Store 5280(texel) 5304 + 5305: 143 Load 145(s2D) + 5306: 154(fvec2) Load 156(f16c2) + 5307: 154(fvec2) Load 1417(f16dPdxy2) + 5308: 154(fvec2) Load 1417(f16dPdxy2) + 5309: 6(float) Load 4264(f16lodClamp) + 5310: 7(fvec4) ImageSampleExplicitLod 5305 5306 Grad ConstOffset MinLod 5307 5308 722 5309 + 5311: 7(fvec4) Load 5280(texel) + 5312: 7(fvec4) FAdd 5311 5310 + Store 5280(texel) 5312 + 5313: 163 Load 165(s3D) + 5314: 167(fvec3) Load 169(c3) + 5315: 167(fvec3) Load 1425(dPdxy3) + 5316: 167(fvec3) Load 1425(dPdxy3) + 5317: 52(float) Load 4257(lodClamp) + 5318: 7(fvec4) ImageSampleExplicitLod 5313 5314 Grad ConstOffset MinLod 5315 5316 735 5317 + 5319: 7(fvec4) Load 5280(texel) + 5320: 7(fvec4) FAdd 5319 5318 + Store 5280(texel) 5320 + 5321: 163 Load 165(s3D) + 5322: 175(fvec3) Load 177(f16c3) + 5323: 175(fvec3) Load 1433(f16dPdxy3) + 5324: 175(fvec3) Load 1433(f16dPdxy3) + 5325: 6(float) Load 4264(f16lodClamp) + 5326: 7(fvec4) ImageSampleExplicitLod 5321 5322 Grad ConstOffset MinLod 5323 5324 735 5325 + 5327: 7(fvec4) Load 5280(texel) + 5328: 7(fvec4) FAdd 5327 5326 + Store 5280(texel) 5328 + 5329: 199 Load 201(s1DShadow) + 5330: 167(fvec3) Load 169(c3) + 5331: 52(float) Load 1393(dPdxy1) + 5332: 52(float) Load 1393(dPdxy1) + 5333: 52(float) Load 4257(lodClamp) + 5334: 52(float) CompositeExtract 5330 2 + 5335: 6(float) ImageSampleDrefExplicitLod 5329 5330 5334 Grad ConstOffset MinLod 5331 5332 709 5333 + 5336: 208(ptr) AccessChain 5280(texel) 207 + 5337: 6(float) Load 5336 + 5338: 6(float) FAdd 5337 5335 + 5339: 208(ptr) AccessChain 5280(texel) 207 + Store 5339 5338 + 5340: 199 Load 201(s1DShadow) + 5341: 154(fvec2) Load 156(f16c2) + 5342: 52(float) Load 215(compare) + 5343: 6(float) Load 1401(f16dPdxy1) + 5344: 6(float) Load 1401(f16dPdxy1) + 5345: 6(float) Load 4264(f16lodClamp) + 5346: 6(float) ImageSampleDrefExplicitLod 5340 5341 5342 Grad ConstOffset MinLod 5343 5344 709 5345 + 5347: 208(ptr) AccessChain 5280(texel) 207 + 5348: 6(float) Load 5347 + 5349: 6(float) FAdd 5348 5346 + 5350: 208(ptr) AccessChain 5280(texel) 207 + Store 5350 5349 + 5351: 224 Load 226(s2DShadow) + 5352: 167(fvec3) Load 169(c3) + 5353: 53(fvec2) Load 1409(dPdxy2) + 5354: 53(fvec2) Load 1409(dPdxy2) + 5355: 52(float) Load 4257(lodClamp) + 5356: 52(float) CompositeExtract 5352 2 + 5357: 6(float) ImageSampleDrefExplicitLod 5351 5352 5356 Grad ConstOffset MinLod 5353 5354 722 5355 + 5358: 208(ptr) AccessChain 5280(texel) 207 + 5359: 6(float) Load 5358 + 5360: 6(float) FAdd 5359 5357 + 5361: 208(ptr) AccessChain 5280(texel) 207 + Store 5361 5360 + 5362: 224 Load 226(s2DShadow) + 5363: 154(fvec2) Load 156(f16c2) + 5364: 52(float) Load 215(compare) + 5365: 154(fvec2) Load 1417(f16dPdxy2) + 5366: 154(fvec2) Load 1417(f16dPdxy2) + 5367: 6(float) Load 4264(f16lodClamp) + 5368: 6(float) ImageSampleDrefExplicitLod 5362 5363 5364 Grad ConstOffset MinLod 5365 5366 722 5367 + 5369: 208(ptr) AccessChain 5280(texel) 207 + 5370: 6(float) Load 5369 + 5371: 6(float) FAdd 5370 5368 + 5372: 208(ptr) AccessChain 5280(texel) 207 + Store 5372 5371 + 5373: 269 Load 271(s1DArray) + 5374: 53(fvec2) Load 148(c2) + 5375: 52(float) Load 1393(dPdxy1) + 5376: 52(float) Load 1393(dPdxy1) + 5377: 52(float) Load 4257(lodClamp) + 5378: 7(fvec4) ImageSampleExplicitLod 5373 5374 Grad ConstOffset MinLod 5375 5376 709 5377 + 5379: 7(fvec4) Load 5280(texel) + 5380: 7(fvec4) FAdd 5379 5378 + Store 5280(texel) 5380 + 5381: 269 Load 271(s1DArray) + 5382: 154(fvec2) Load 156(f16c2) + 5383: 6(float) Load 1401(f16dPdxy1) + 5384: 6(float) Load 1401(f16dPdxy1) + 5385: 6(float) Load 4264(f16lodClamp) + 5386: 7(fvec4) ImageSampleExplicitLod 5381 5382 Grad ConstOffset MinLod 5383 5384 709 5385 + 5387: 7(fvec4) Load 5280(texel) + 5388: 7(fvec4) FAdd 5387 5386 + Store 5280(texel) 5388 + 5389: 284 Load 286(s2DArray) + 5390: 167(fvec3) Load 169(c3) + 5391: 53(fvec2) Load 1409(dPdxy2) + 5392: 53(fvec2) Load 1409(dPdxy2) + 5393: 52(float) Load 4257(lodClamp) + 5394: 7(fvec4) ImageSampleExplicitLod 5389 5390 Grad ConstOffset MinLod 5391 5392 722 5393 + 5395: 7(fvec4) Load 5280(texel) + 5396: 7(fvec4) FAdd 5395 5394 + Store 5280(texel) 5396 + 5397: 284 Load 286(s2DArray) + 5398: 175(fvec3) Load 177(f16c3) + 5399: 154(fvec2) Load 1417(f16dPdxy2) + 5400: 154(fvec2) Load 1417(f16dPdxy2) + 5401: 6(float) Load 4264(f16lodClamp) + 5402: 7(fvec4) ImageSampleExplicitLod 5397 5398 Grad ConstOffset MinLod 5399 5400 722 5401 + 5403: 7(fvec4) Load 5280(texel) + 5404: 7(fvec4) FAdd 5403 5402 + Store 5280(texel) 5404 + 5405: 316 Load 318(s1DArrayShadow) + 5406: 167(fvec3) Load 169(c3) + 5407: 52(float) Load 1393(dPdxy1) + 5408: 52(float) Load 1393(dPdxy1) + 5409: 52(float) Load 4257(lodClamp) + 5410: 52(float) CompositeExtract 5406 2 + 5411: 6(float) ImageSampleDrefExplicitLod 5405 5406 5410 Grad ConstOffset MinLod 5407 5408 709 5409 + 5412: 208(ptr) AccessChain 5280(texel) 207 + 5413: 6(float) Load 5412 + 5414: 6(float) FAdd 5413 5411 + 5415: 208(ptr) AccessChain 5280(texel) 207 + Store 5415 5414 + 5416: 316 Load 318(s1DArrayShadow) + 5417: 154(fvec2) Load 156(f16c2) + 5418: 52(float) Load 215(compare) + 5419: 6(float) Load 1401(f16dPdxy1) + 5420: 6(float) Load 1401(f16dPdxy1) + 5421: 6(float) Load 4264(f16lodClamp) + 5422: 6(float) ImageSampleDrefExplicitLod 5416 5417 5418 Grad ConstOffset MinLod 5419 5420 709 5421 + 5423: 208(ptr) AccessChain 5280(texel) 207 + 5424: 6(float) Load 5423 + 5425: 6(float) FAdd 5424 5422 + 5426: 208(ptr) AccessChain 5280(texel) 207 + Store 5426 5425 + 5427: 337 Load 339(s2DArrayShadow) + 5428: 249(fvec4) Load 251(c4) + 5429: 53(fvec2) Load 1409(dPdxy2) + 5430: 53(fvec2) Load 1409(dPdxy2) + 5431: 52(float) Load 4257(lodClamp) + 5432: 52(float) CompositeExtract 5428 3 + 5433: 6(float) ImageSampleDrefExplicitLod 5427 5428 5432 Grad ConstOffset MinLod 5429 5430 722 5431 + 5434: 208(ptr) AccessChain 5280(texel) 207 + 5435: 6(float) Load 5434 + 5436: 6(float) FAdd 5435 5433 + 5437: 208(ptr) AccessChain 5280(texel) 207 + Store 5437 5436 + 5438: 337 Load 339(s2DArrayShadow) + 5439: 175(fvec3) Load 177(f16c3) + 5440: 52(float) Load 215(compare) + 5441: 154(fvec2) Load 1417(f16dPdxy2) + 5442: 154(fvec2) Load 1417(f16dPdxy2) + 5443: 6(float) Load 4264(f16lodClamp) + 5444: 6(float) ImageSampleDrefExplicitLod 5438 5439 5440 Grad ConstOffset MinLod 5441 5442 722 5443 + 5445: 208(ptr) AccessChain 5280(texel) 207 + 5446: 6(float) Load 5445 + 5447: 6(float) FAdd 5446 5444 + 5448: 208(ptr) AccessChain 5280(texel) 207 + Store 5448 5447 + 5449: 7(fvec4) Load 5280(texel) + ReturnValue 5449 + FunctionEnd +115(testCombinedTextureSampler(): 7(fvec4) Function None 8 + 116: Label + 5452(texel): 64(ptr) Variable Function + Store 5452(texel) 121 + 5455: 122 Load 5454(t1D) + 5459: 5456 Load 5458(s) + 5460: 123 SampledImage 5455 5459 + 5461: 52(float) Load 128(c1) + 5462: 7(fvec4) ImageSampleImplicitLod 5460 5461 + 5463: 7(fvec4) Load 5452(texel) + 5464: 7(fvec4) FAdd 5463 5462 + Store 5452(texel) 5464 + 5465: 122 Load 5454(t1D) + 5466: 5456 Load 5458(s) + 5467: 123 SampledImage 5465 5466 + 5468: 6(float) Load 135(f16c1) + 5469: 6(float) Load 137(f16bias) + 5470: 7(fvec4) ImageSampleImplicitLod 5467 5468 Bias 5469 + 5471: 7(fvec4) Load 5452(texel) + 5472: 7(fvec4) FAdd 5471 5470 + Store 5452(texel) 5472 + 5475: 142 Load 5474(t2D) + 5476: 5456 Load 5458(s) + 5477: 143 SampledImage 5475 5476 + 5478: 53(fvec2) Load 148(c2) + 5479: 7(fvec4) ImageSampleImplicitLod 5477 5478 + 5480: 7(fvec4) Load 5452(texel) + 5481: 7(fvec4) FAdd 5480 5479 + Store 5452(texel) 5481 + 5482: 142 Load 5474(t2D) + 5483: 5456 Load 5458(s) + 5484: 143 SampledImage 5482 5483 + 5485: 154(fvec2) Load 156(f16c2) + 5486: 6(float) Load 137(f16bias) + 5487: 7(fvec4) ImageSampleImplicitLod 5484 5485 Bias 5486 + 5488: 7(fvec4) Load 5452(texel) + 5489: 7(fvec4) FAdd 5488 5487 + Store 5452(texel) 5489 + 5492: 162 Load 5491(t3D) + 5493: 5456 Load 5458(s) + 5494: 163 SampledImage 5492 5493 + 5495: 167(fvec3) Load 169(c3) + 5496: 7(fvec4) ImageSampleImplicitLod 5494 5495 + 5497: 7(fvec4) Load 5452(texel) + 5498: 7(fvec4) FAdd 5497 5496 + Store 5452(texel) 5498 + 5499: 162 Load 5491(t3D) + 5500: 5456 Load 5458(s) + 5501: 163 SampledImage 5499 5500 + 5502: 175(fvec3) Load 177(f16c3) + 5503: 6(float) Load 137(f16bias) + 5504: 7(fvec4) ImageSampleImplicitLod 5501 5502 Bias 5503 + 5505: 7(fvec4) Load 5452(texel) + 5506: 7(fvec4) FAdd 5505 5504 + Store 5452(texel) 5506 + 5509: 183 Load 5508(tCube) + 5510: 5456 Load 5458(s) + 5511: 184 SampledImage 5509 5510 + 5512: 167(fvec3) Load 169(c3) + 5513: 7(fvec4) ImageSampleImplicitLod 5511 5512 + 5514: 7(fvec4) Load 5452(texel) + 5515: 7(fvec4) FAdd 5514 5513 + Store 5452(texel) 5515 + 5516: 183 Load 5508(tCube) + 5517: 5456 Load 5458(s) + 5518: 184 SampledImage 5516 5517 + 5519: 175(fvec3) Load 177(f16c3) + 5520: 6(float) Load 137(f16bias) + 5521: 7(fvec4) ImageSampleImplicitLod 5518 5519 Bias 5520 + 5522: 7(fvec4) Load 5452(texel) + 5523: 7(fvec4) FAdd 5522 5521 + Store 5452(texel) 5523 + 5524: 122 Load 5454(t1D) + 5526: 5456 Load 5525(sShadow) + 5527: 199 SampledImage 5524 5526 + 5528: 167(fvec3) Load 169(c3) + 5529: 52(float) CompositeExtract 5528 2 + 5530: 6(float) ImageSampleDrefImplicitLod 5527 5528 5529 + 5531: 208(ptr) AccessChain 5452(texel) 207 + 5532: 6(float) Load 5531 + 5533: 6(float) FAdd 5532 5530 + 5534: 208(ptr) AccessChain 5452(texel) 207 + Store 5534 5533 + 5535: 122 Load 5454(t1D) + 5536: 5456 Load 5525(sShadow) + 5537: 199 SampledImage 5535 5536 + 5538: 154(fvec2) Load 156(f16c2) + 5539: 52(float) Load 215(compare) + 5540: 6(float) Load 137(f16bias) + 5541: 6(float) ImageSampleDrefImplicitLod 5537 5538 5539 Bias 5540 + 5542: 208(ptr) AccessChain 5452(texel) 207 + 5543: 6(float) Load 5542 + 5544: 6(float) FAdd 5543 5541 + 5545: 208(ptr) AccessChain 5452(texel) 207 + Store 5545 5544 + 5546: 142 Load 5474(t2D) + 5547: 5456 Load 5525(sShadow) + 5548: 224 SampledImage 5546 5547 + 5549: 167(fvec3) Load 169(c3) + 5550: 52(float) CompositeExtract 5549 2 + 5551: 6(float) ImageSampleDrefImplicitLod 5548 5549 5550 + 5552: 208(ptr) AccessChain 5452(texel) 207 + 5553: 6(float) Load 5552 + 5554: 6(float) FAdd 5553 5551 + 5555: 208(ptr) AccessChain 5452(texel) 207 + Store 5555 5554 + 5556: 142 Load 5474(t2D) + 5557: 5456 Load 5525(sShadow) + 5558: 224 SampledImage 5556 5557 + 5559: 154(fvec2) Load 156(f16c2) + 5560: 52(float) Load 215(compare) + 5561: 6(float) Load 137(f16bias) + 5562: 6(float) ImageSampleDrefImplicitLod 5558 5559 5560 Bias 5561 + 5563: 208(ptr) AccessChain 5452(texel) 207 + 5564: 6(float) Load 5563 + 5565: 6(float) FAdd 5564 5562 + 5566: 208(ptr) AccessChain 5452(texel) 207 + Store 5566 5565 + 5567: 183 Load 5508(tCube) + 5568: 5456 Load 5525(sShadow) + 5569: 245 SampledImage 5567 5568 + 5570: 249(fvec4) Load 251(c4) + 5571: 52(float) CompositeExtract 5570 3 + 5572: 6(float) ImageSampleDrefImplicitLod 5569 5570 5571 + 5573: 208(ptr) AccessChain 5452(texel) 207 + 5574: 6(float) Load 5573 + 5575: 6(float) FAdd 5574 5572 + 5576: 208(ptr) AccessChain 5452(texel) 207 + Store 5576 5575 + 5577: 183 Load 5508(tCube) + 5578: 5456 Load 5525(sShadow) + 5579: 245 SampledImage 5577 5578 + 5580: 175(fvec3) Load 177(f16c3) + 5581: 52(float) Load 215(compare) + 5582: 6(float) Load 137(f16bias) + 5583: 6(float) ImageSampleDrefImplicitLod 5579 5580 5581 Bias 5582 + 5584: 208(ptr) AccessChain 5452(texel) 207 + 5585: 6(float) Load 5584 + 5586: 6(float) FAdd 5585 5583 + 5587: 208(ptr) AccessChain 5452(texel) 207 + Store 5587 5586 + 5590: 268 Load 5589(t1DArray) + 5591: 5456 Load 5458(s) + 5592: 269 SampledImage 5590 5591 + 5593: 53(fvec2) Load 148(c2) + 5594: 7(fvec4) ImageSampleImplicitLod 5592 5593 + 5595: 7(fvec4) Load 5452(texel) + 5596: 7(fvec4) FAdd 5595 5594 + Store 5452(texel) 5596 + 5597: 268 Load 5589(t1DArray) + 5598: 5456 Load 5458(s) + 5599: 269 SampledImage 5597 5598 + 5600: 154(fvec2) Load 156(f16c2) + 5601: 6(float) Load 137(f16bias) + 5602: 7(fvec4) ImageSampleImplicitLod 5599 5600 Bias 5601 + 5603: 7(fvec4) Load 5452(texel) + 5604: 7(fvec4) FAdd 5603 5602 + Store 5452(texel) 5604 + 5607: 283 Load 5606(t2DArray) + 5608: 5456 Load 5458(s) + 5609: 284 SampledImage 5607 5608 + 5610: 167(fvec3) Load 169(c3) + 5611: 7(fvec4) ImageSampleImplicitLod 5609 5610 + 5612: 7(fvec4) Load 5452(texel) + 5613: 7(fvec4) FAdd 5612 5611 + Store 5452(texel) 5613 + 5614: 283 Load 5606(t2DArray) + 5615: 5456 Load 5458(s) + 5616: 284 SampledImage 5614 5615 + 5617: 175(fvec3) Load 177(f16c3) + 5618: 6(float) Load 137(f16bias) + 5619: 7(fvec4) ImageSampleImplicitLod 5616 5617 Bias 5618 + 5620: 7(fvec4) Load 5452(texel) + 5621: 7(fvec4) FAdd 5620 5619 + Store 5452(texel) 5621 + 5624: 298 Load 5623(tCubeArray) + 5625: 5456 Load 5458(s) + 5626: 299 SampledImage 5624 5625 + 5627: 249(fvec4) Load 251(c4) + 5628: 7(fvec4) ImageSampleImplicitLod 5626 5627 + 5629: 7(fvec4) Load 5452(texel) + 5630: 7(fvec4) FAdd 5629 5628 + Store 5452(texel) 5630 + 5631: 298 Load 5623(tCubeArray) + 5632: 5456 Load 5458(s) + 5633: 299 SampledImage 5631 5632 + 5634: 7(fvec4) Load 309(f16c4) + 5635: 6(float) Load 137(f16bias) + 5636: 7(fvec4) ImageSampleImplicitLod 5633 5634 Bias 5635 + 5637: 7(fvec4) Load 5452(texel) + 5638: 7(fvec4) FAdd 5637 5636 + Store 5452(texel) 5638 + 5639: 268 Load 5589(t1DArray) + 5640: 5456 Load 5525(sShadow) + 5641: 316 SampledImage 5639 5640 + 5642: 167(fvec3) Load 169(c3) + 5643: 52(float) CompositeExtract 5642 2 + 5644: 6(float) ImageSampleDrefImplicitLod 5641 5642 5643 + 5645: 208(ptr) AccessChain 5452(texel) 207 + 5646: 6(float) Load 5645 + 5647: 6(float) FAdd 5646 5644 + 5648: 208(ptr) AccessChain 5452(texel) 207 + Store 5648 5647 + 5649: 268 Load 5589(t1DArray) + 5650: 5456 Load 5525(sShadow) + 5651: 316 SampledImage 5649 5650 + 5652: 154(fvec2) Load 156(f16c2) + 5653: 52(float) Load 215(compare) + 5654: 6(float) Load 137(f16bias) + 5655: 6(float) ImageSampleDrefImplicitLod 5651 5652 5653 Bias 5654 + 5656: 208(ptr) AccessChain 5452(texel) 207 + 5657: 6(float) Load 5656 + 5658: 6(float) FAdd 5657 5655 + 5659: 208(ptr) AccessChain 5452(texel) 207 + Store 5659 5658 + 5660: 283 Load 5606(t2DArray) + 5661: 5456 Load 5525(sShadow) + 5662: 337 SampledImage 5660 5661 + 5663: 249(fvec4) Load 251(c4) + 5664: 52(float) CompositeExtract 5663 3 + 5665: 6(float) ImageSampleDrefImplicitLod 5662 5663 5664 + 5666: 208(ptr) AccessChain 5452(texel) 207 + 5667: 6(float) Load 5666 + 5668: 6(float) FAdd 5667 5665 + 5669: 208(ptr) AccessChain 5452(texel) 207 + Store 5669 5668 + 5670: 283 Load 5606(t2DArray) + 5671: 5456 Load 5525(sShadow) + 5672: 337 SampledImage 5670 5671 + 5673: 175(fvec3) Load 177(f16c3) + 5674: 52(float) Load 215(compare) + 5675: 6(float) ImageSampleDrefImplicitLod 5672 5673 5674 + 5676: 208(ptr) AccessChain 5452(texel) 207 + 5677: 6(float) Load 5676 + 5678: 6(float) FAdd 5677 5675 + 5679: 208(ptr) AccessChain 5452(texel) 207 + Store 5679 5678 + 5682: 356 Load 5681(t2DRect) + 5683: 5456 Load 5458(s) + 5684: 357 SampledImage 5682 5683 + 5685: 53(fvec2) Load 148(c2) + 5686: 7(fvec4) ImageSampleImplicitLod 5684 5685 + 5687: 7(fvec4) Load 5452(texel) + 5688: 7(fvec4) FAdd 5687 5686 + Store 5452(texel) 5688 + 5689: 356 Load 5681(t2DRect) + 5690: 5456 Load 5458(s) + 5691: 357 SampledImage 5689 5690 + 5692: 154(fvec2) Load 156(f16c2) + 5693: 7(fvec4) ImageSampleImplicitLod 5691 5692 + 5694: 7(fvec4) Load 5452(texel) + 5695: 7(fvec4) FAdd 5694 5693 + Store 5452(texel) 5695 + 5696: 356 Load 5681(t2DRect) + 5697: 5456 Load 5525(sShadow) + 5698: 371 SampledImage 5696 5697 + 5699: 167(fvec3) Load 169(c3) + 5700: 52(float) CompositeExtract 5699 2 + 5701: 6(float) ImageSampleDrefImplicitLod 5698 5699 5700 + 5702: 208(ptr) AccessChain 5452(texel) 207 + 5703: 6(float) Load 5702 + 5704: 6(float) FAdd 5703 5701 + 5705: 208(ptr) AccessChain 5452(texel) 207 + Store 5705 5704 + 5706: 356 Load 5681(t2DRect) + 5707: 5456 Load 5525(sShadow) + 5708: 371 SampledImage 5706 5707 + 5709: 154(fvec2) Load 156(f16c2) + 5710: 52(float) Load 215(compare) + 5711: 6(float) ImageSampleDrefImplicitLod 5708 5709 5710 + 5712: 208(ptr) AccessChain 5452(texel) 207 + 5713: 6(float) Load 5712 + 5714: 6(float) FAdd 5713 5711 + 5715: 208(ptr) AccessChain 5452(texel) 207 + Store 5715 5714 + 5716: 298 Load 5623(tCubeArray) + 5717: 5456 Load 5525(sShadow) + 5718: 391 SampledImage 5716 5717 + 5719: 249(fvec4) Load 251(c4) + 5720: 52(float) Load 215(compare) + 5721: 6(float) ImageSampleDrefImplicitLod 5718 5719 5720 + 5722: 208(ptr) AccessChain 5452(texel) 207 + 5723: 6(float) Load 5722 + 5724: 6(float) FAdd 5723 5721 + 5725: 208(ptr) AccessChain 5452(texel) 207 + Store 5725 5724 + 5726: 298 Load 5623(tCubeArray) + 5727: 5456 Load 5525(sShadow) + 5728: 391 SampledImage 5726 5727 + 5729: 7(fvec4) Load 309(f16c4) + 5730: 52(float) Load 215(compare) + 5731: 6(float) ImageSampleDrefImplicitLod 5728 5729 5730 + 5732: 208(ptr) AccessChain 5452(texel) 207 + 5733: 6(float) Load 5732 + 5734: 6(float) FAdd 5733 5731 + 5735: 208(ptr) AccessChain 5452(texel) 207 + Store 5735 5734 + 5736: 7(fvec4) Load 5452(texel) + ReturnValue 5736 + FunctionEnd +117(testSubpassLoad(): 7(fvec4) Function None 8 + 118: Label + 5742: 5739 Load 5741(subpass) + 5744: 7(fvec4) ImageRead 5742 5743 + 5748: 5745 Load 5747(subpassMS) + 5749: 7(fvec4) ImageRead 5748 5743 Sample 1326 + 5750: 7(fvec4) FAdd 5744 5749 + ReturnValue 5750 + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.float16.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.float16.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.float16.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.float16.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.float16.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 534 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.float32.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.float32.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.float32.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.float32.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,800 @@ +spv.float32.frag +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 530 + + Capability Shader + Capability Float16 + Capability Float64 + Capability Int64 + Capability Int16 + Capability Int8 + Capability DerivativeControl + Capability InterpolationFunction + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 468 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_KHX_shader_explicit_arithmetic_types" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + Name 4 "main" + Name 6 "literal(" + Name 8 "operators(" + Name 10 "typeCast(" + Name 12 "builtinAngleTrigFuncs(" + Name 14 "builtinExpFuncs(" + Name 16 "builtinCommonFuncs(" + Name 18 "builtinGeometryFuncs(" + Name 20 "builtinMatrixFuncs(" + Name 22 "builtinVecRelFuncs(" + Name 24 "builtinFragProcFuncs(" + Name 29 "f32v" + Name 40 "f32v" + Name 62 "f32m" + Name 85 "f32" + Name 109 "b" + Name 152 "f64v" + Name 155 "f32v" + Name 160 "bv" + Name 175 "f16v" + Name 183 "i8v" + Name 189 "i16v" + Name 195 "i32v" + Name 201 "i64v" + Name 204 "u8v" + Name 210 "u16v" + Name 215 "u32v" + Name 221 "u64v" + Name 226 "f32v2" + Name 227 "f32v1" + Name 259 "f32v2" + Name 260 "f32v1" + Name 276 "f32v2" + Name 277 "f32v1" + Name 298 "f32" + Name 302 "f32v3" + Name 342 "bv" + Name 363 "b" + Name 373 "iv" + Name 374 "ResType" + Name 381 "f32" + Name 382 "f32v1" + Name 386 "f32v2" + Name 392 "f32v3" + Name 411 "f32m3" + Name 412 "f32m1" + Name 414 "f32m2" + Name 423 "f32v1" + Name 425 "f32v2" + Name 430 "f32m4" + Name 433 "f32" + Name 436 "f32m5" + Name 441 "f32m6" + Name 442 "f32m7" + Name 445 "bv" + Name 446 "f32v1" + Name 448 "f32v2" + Name 466 "f32v" + Name 468 "if32v" + Name 517 "S" + MemberName 517(S) 0 "x" + MemberName 517(S) 1 "y" + MemberName 517(S) 2 "z" + Name 519 "B1" + MemberName 519(B1) 0 "a" + MemberName 519(B1) 1 "b" + MemberName 519(B1) 2 "c" + MemberName 519(B1) 3 "d" + MemberName 519(B1) 4 "e" + MemberName 519(B1) 5 "f" + MemberName 519(B1) 6 "g" + MemberName 519(B1) 7 "h" + Name 521 "" + Name 522 "sf16" + Name 523 "sf" + Name 524 "sd" + Decorate 515 ArrayStride 16 + Decorate 516 ArrayStride 32 + MemberDecorate 517(S) 0 Offset 0 + MemberDecorate 517(S) 1 Offset 8 + MemberDecorate 517(S) 2 Offset 16 + Decorate 518 ArrayStride 32 + MemberDecorate 519(B1) 0 Offset 0 + MemberDecorate 519(B1) 1 Offset 8 + MemberDecorate 519(B1) 2 Offset 16 + MemberDecorate 519(B1) 3 Offset 32 + MemberDecorate 519(B1) 4 ColMajor + MemberDecorate 519(B1) 4 Offset 64 + MemberDecorate 519(B1) 4 MatrixStride 16 + MemberDecorate 519(B1) 5 ColMajor + MemberDecorate 519(B1) 5 Offset 96 + MemberDecorate 519(B1) 5 MatrixStride 16 + MemberDecorate 519(B1) 6 Offset 160 + MemberDecorate 519(B1) 7 Offset 192 + Decorate 519(B1) Block + Decorate 521 DescriptorSet 0 + Decorate 522(sf16) SpecId 100 + Decorate 523(sf) SpecId 101 + Decorate 524(sd) SpecId 102 + 2: TypeVoid + 3: TypeFunction 2 + 26: TypeFloat 32 + 27: TypeVector 26(float) 2 + 28: TypePointer Function 27(fvec2) + 30: 26(float) Constant 897988541 + 31: TypeInt 32 0 + 32: 31(int) Constant 0 + 33: TypePointer Function 26(float) + 35: 26(float) Constant 3196059648 + 36: 26(float) Constant 1022739087 + 37: 27(fvec2) ConstantComposite 35 36 + 54: 26(float) Constant 1065353216 + 60: TypeMatrix 27(fvec2) 2 + 61: TypePointer Function 60 + 88: 31(int) Constant 1 + 107: TypeBool + 108: TypePointer Function 107(bool) + 149: TypeFloat 64 + 150: TypeVector 149(float) 3 + 151: TypePointer Function 150(fvec3) + 153: TypeVector 26(float) 3 + 154: TypePointer Function 153(fvec3) + 158: TypeVector 107(bool) 3 + 159: TypePointer Function 158(bvec3) + 162: 26(float) Constant 0 + 163: 153(fvec3) ConstantComposite 162 162 162 + 164: 153(fvec3) ConstantComposite 54 54 54 + 172: TypeFloat 16 + 173: TypeVector 172(float) 3 + 174: TypePointer Function 173(fvec3) + 180: TypeInt 8 1 + 181: TypeVector 180(int) 3 + 182: TypePointer Function 181(ivec3) + 186: TypeInt 16 1 + 187: TypeVector 186(int) 3 + 188: TypePointer Function 187(ivec3) + 192: TypeInt 32 1 + 193: TypeVector 192(int) 3 + 194: TypePointer Function 193(ivec3) + 198: TypeInt 64 1 + 199: TypeVector 198(int) 3 + 200: TypePointer Function 199(ivec3) + 207: TypeInt 16 0 + 208: TypeVector 207(int) 3 + 209: TypePointer Function 208(ivec3) + 213: TypeVector 31(int) 3 + 214: TypePointer Function 213(ivec3) + 218: TypeInt 64 0 + 219: TypeVector 218(int) 3 + 220: TypePointer Function 219(ivec3) + 224: TypeVector 26(float) 4 + 225: TypePointer Function 224(fvec4) + 374(ResType): TypeStruct 153(fvec3) 193(ivec3) + 409: TypeMatrix 153(fvec3) 2 + 410: TypePointer Function 409 + 428: TypeMatrix 27(fvec2) 3 + 429: TypePointer Function 428 + 434: TypeMatrix 153(fvec3) 3 + 435: TypePointer Function 434 + 439: TypeMatrix 224(fvec4) 4 + 440: TypePointer Function 439 + 467: TypePointer Input 153(fvec3) + 468(if32v): 467(ptr) Variable Input + 469: TypePointer Input 26(float) + 506: 192(int) Constant 1 + 511: 26(float) Constant 1056964608 + 512: 27(fvec2) ConstantComposite 511 511 + 514: 31(int) Constant 2 + 515: TypeArray 26(float) 514 + 516: TypeArray 409 514 + 517(S): TypeStruct 26(float) 27(fvec2) 153(fvec3) + 518: TypeArray 517(S) 514 + 519(B1): TypeStruct 26(float) 27(fvec2) 153(fvec3) 515 409 516 517(S) 518 + 520: TypePointer Uniform 519(B1) + 521: 520(ptr) Variable Uniform + 522(sf16): 172(float) SpecConstant 12288 + 523(sf): 26(float) SpecConstant 1048576000 + 524(sd): 149(float) SpecConstant 0 1071644672 + 525: 26(float) SpecConstantOp 115 522(sf16) + 526: 26(float) SpecConstantOp 115 522(sf16) + 527: 149(float) SpecConstantOp 115 526 + 528: 172(float) SpecConstantOp 115 523(sf) + 529: 172(float) SpecConstantOp 115 524(sd) + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd + 6(literal(): 2 Function None 3 + 7: Label + 29(f32v): 28(ptr) Variable Function + 34: 33(ptr) AccessChain 29(f32v) 32 + Store 34 30 + 38: 27(fvec2) Load 29(f32v) + 39: 27(fvec2) FAdd 38 37 + Store 29(f32v) 39 + Return + FunctionEnd + 8(operators(): 2 Function None 3 + 9: Label + 40(f32v): 28(ptr) Variable Function + 62(f32m): 61(ptr) Variable Function + 85(f32): 33(ptr) Variable Function + 109(b): 108(ptr) Variable Function + 41: 27(fvec2) Load 40(f32v) + 42: 27(fvec2) Load 40(f32v) + 43: 27(fvec2) FAdd 42 41 + Store 40(f32v) 43 + 44: 27(fvec2) Load 40(f32v) + 45: 27(fvec2) Load 40(f32v) + 46: 27(fvec2) FSub 45 44 + Store 40(f32v) 46 + 47: 27(fvec2) Load 40(f32v) + 48: 27(fvec2) Load 40(f32v) + 49: 27(fvec2) FMul 48 47 + Store 40(f32v) 49 + 50: 27(fvec2) Load 40(f32v) + 51: 27(fvec2) Load 40(f32v) + 52: 27(fvec2) FDiv 51 50 + Store 40(f32v) 52 + 53: 27(fvec2) Load 40(f32v) + 55: 27(fvec2) CompositeConstruct 54 54 + 56: 27(fvec2) FAdd 53 55 + Store 40(f32v) 56 + 57: 27(fvec2) Load 40(f32v) + 58: 27(fvec2) CompositeConstruct 54 54 + 59: 27(fvec2) FSub 57 58 + Store 40(f32v) 59 + 63: 60 Load 62(f32m) + 64: 27(fvec2) CompositeConstruct 54 54 + 65: 27(fvec2) CompositeExtract 63 0 + 66: 27(fvec2) FAdd 65 64 + 67: 27(fvec2) CompositeExtract 63 1 + 68: 27(fvec2) FAdd 67 64 + 69: 60 CompositeConstruct 66 68 + Store 62(f32m) 69 + 70: 60 Load 62(f32m) + 71: 27(fvec2) CompositeConstruct 54 54 + 72: 27(fvec2) CompositeExtract 70 0 + 73: 27(fvec2) FSub 72 71 + 74: 27(fvec2) CompositeExtract 70 1 + 75: 27(fvec2) FSub 74 71 + 76: 60 CompositeConstruct 73 75 + Store 62(f32m) 76 + 77: 27(fvec2) Load 40(f32v) + 78: 27(fvec2) FNegate 77 + Store 40(f32v) 78 + 79: 60 Load 62(f32m) + 80: 27(fvec2) CompositeExtract 79 0 + 81: 27(fvec2) FNegate 80 + 82: 27(fvec2) CompositeExtract 79 1 + 83: 27(fvec2) FNegate 82 + 84: 60 CompositeConstruct 81 83 + Store 62(f32m) 84 + 86: 33(ptr) AccessChain 40(f32v) 32 + 87: 26(float) Load 86 + 89: 33(ptr) AccessChain 40(f32v) 88 + 90: 26(float) Load 89 + 91: 26(float) FAdd 87 90 + Store 85(f32) 91 + 92: 33(ptr) AccessChain 40(f32v) 32 + 93: 26(float) Load 92 + 94: 33(ptr) AccessChain 40(f32v) 88 + 95: 26(float) Load 94 + 96: 26(float) FSub 93 95 + Store 85(f32) 96 + 97: 33(ptr) AccessChain 40(f32v) 32 + 98: 26(float) Load 97 + 99: 33(ptr) AccessChain 40(f32v) 88 + 100: 26(float) Load 99 + 101: 26(float) FMul 98 100 + Store 85(f32) 101 + 102: 33(ptr) AccessChain 40(f32v) 32 + 103: 26(float) Load 102 + 104: 33(ptr) AccessChain 40(f32v) 88 + 105: 26(float) Load 104 + 106: 26(float) FDiv 103 105 + Store 85(f32) 106 + 110: 33(ptr) AccessChain 40(f32v) 32 + 111: 26(float) Load 110 + 112: 26(float) Load 85(f32) + 113: 107(bool) FOrdNotEqual 111 112 + Store 109(b) 113 + 114: 33(ptr) AccessChain 40(f32v) 88 + 115: 26(float) Load 114 + 116: 26(float) Load 85(f32) + 117: 107(bool) FOrdEqual 115 116 + Store 109(b) 117 + 118: 33(ptr) AccessChain 40(f32v) 32 + 119: 26(float) Load 118 + 120: 26(float) Load 85(f32) + 121: 107(bool) FOrdGreaterThan 119 120 + Store 109(b) 121 + 122: 33(ptr) AccessChain 40(f32v) 88 + 123: 26(float) Load 122 + 124: 26(float) Load 85(f32) + 125: 107(bool) FOrdLessThan 123 124 + Store 109(b) 125 + 126: 33(ptr) AccessChain 40(f32v) 32 + 127: 26(float) Load 126 + 128: 26(float) Load 85(f32) + 129: 107(bool) FOrdGreaterThanEqual 127 128 + Store 109(b) 129 + 130: 33(ptr) AccessChain 40(f32v) 88 + 131: 26(float) Load 130 + 132: 26(float) Load 85(f32) + 133: 107(bool) FOrdLessThanEqual 131 132 + Store 109(b) 133 + 134: 27(fvec2) Load 40(f32v) + 135: 26(float) Load 85(f32) + 136: 27(fvec2) VectorTimesScalar 134 135 + Store 40(f32v) 136 + 137: 60 Load 62(f32m) + 138: 26(float) Load 85(f32) + 139: 60 MatrixTimesScalar 137 138 + Store 62(f32m) 139 + 140: 60 Load 62(f32m) + 141: 27(fvec2) Load 40(f32v) + 142: 27(fvec2) MatrixTimesVector 140 141 + Store 40(f32v) 142 + 143: 27(fvec2) Load 40(f32v) + 144: 60 Load 62(f32m) + 145: 27(fvec2) VectorTimesMatrix 143 144 + Store 40(f32v) 145 + 146: 60 Load 62(f32m) + 147: 60 Load 62(f32m) + 148: 60 MatrixTimesMatrix 146 147 + Store 62(f32m) 148 + Return + FunctionEnd + 10(typeCast(): 2 Function None 3 + 11: Label + 152(f64v): 151(ptr) Variable Function + 155(f32v): 154(ptr) Variable Function + 160(bv): 159(ptr) Variable Function + 175(f16v): 174(ptr) Variable Function + 183(i8v): 182(ptr) Variable Function + 189(i16v): 188(ptr) Variable Function + 195(i32v): 194(ptr) Variable Function + 201(i64v): 200(ptr) Variable Function + 204(u8v): 182(ptr) Variable Function + 210(u16v): 209(ptr) Variable Function + 215(u32v): 214(ptr) Variable Function + 221(u64v): 220(ptr) Variable Function + 156: 153(fvec3) Load 155(f32v) + 157: 150(fvec3) FConvert 156 + Store 152(f64v) 157 + 161: 158(bvec3) Load 160(bv) + 165: 153(fvec3) Select 161 164 163 + Store 155(f32v) 165 + 166: 153(fvec3) Load 155(f32v) + 167: 158(bvec3) FOrdNotEqual 166 163 + Store 160(bv) 167 + 168: 150(fvec3) Load 152(f64v) + 169: 153(fvec3) FConvert 168 + Store 155(f32v) 169 + 170: 153(fvec3) Load 155(f32v) + 171: 150(fvec3) FConvert 170 + Store 152(f64v) 171 + 176: 173(fvec3) Load 175(f16v) + 177: 153(fvec3) FConvert 176 + Store 155(f32v) 177 + 178: 153(fvec3) Load 155(f32v) + 179: 173(fvec3) FConvert 178 + Store 175(f16v) 179 + 184: 153(fvec3) Load 155(f32v) + 185: 181(ivec3) ConvertFToS 184 + Store 183(i8v) 185 + 190: 153(fvec3) Load 155(f32v) + 191: 187(ivec3) ConvertFToS 190 + Store 189(i16v) 191 + 196: 153(fvec3) Load 155(f32v) + 197: 193(ivec3) ConvertFToS 196 + Store 195(i32v) 197 + 202: 153(fvec3) Load 155(f32v) + 203: 199(ivec3) ConvertFToS 202 + Store 201(i64v) 203 + 205: 153(fvec3) Load 155(f32v) + 206: 181(ivec3) ConvertFToS 205 + Store 204(u8v) 206 + 211: 153(fvec3) Load 155(f32v) + 212: 208(ivec3) ConvertFToU 211 + Store 210(u16v) 212 + 216: 153(fvec3) Load 155(f32v) + 217: 213(ivec3) ConvertFToU 216 + Store 215(u32v) 217 + 222: 153(fvec3) Load 155(f32v) + 223: 219(ivec3) ConvertFToU 222 + Store 221(u64v) 223 + Return + FunctionEnd +12(builtinAngleTrigFuncs(): 2 Function None 3 + 13: Label + 226(f32v2): 225(ptr) Variable Function + 227(f32v1): 225(ptr) Variable Function + 228: 224(fvec4) Load 227(f32v1) + 229: 224(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 228 + Store 226(f32v2) 229 + 230: 224(fvec4) Load 227(f32v1) + 231: 224(fvec4) ExtInst 1(GLSL.std.450) 12(Degrees) 230 + Store 226(f32v2) 231 + 232: 224(fvec4) Load 227(f32v1) + 233: 224(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 232 + Store 226(f32v2) 233 + 234: 224(fvec4) Load 227(f32v1) + 235: 224(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 234 + Store 226(f32v2) 235 + 236: 224(fvec4) Load 227(f32v1) + 237: 224(fvec4) ExtInst 1(GLSL.std.450) 15(Tan) 236 + Store 226(f32v2) 237 + 238: 224(fvec4) Load 227(f32v1) + 239: 224(fvec4) ExtInst 1(GLSL.std.450) 16(Asin) 238 + Store 226(f32v2) 239 + 240: 224(fvec4) Load 227(f32v1) + 241: 224(fvec4) ExtInst 1(GLSL.std.450) 17(Acos) 240 + Store 226(f32v2) 241 + 242: 224(fvec4) Load 227(f32v1) + 243: 224(fvec4) Load 226(f32v2) + 244: 224(fvec4) ExtInst 1(GLSL.std.450) 25(Atan2) 242 243 + Store 226(f32v2) 244 + 245: 224(fvec4) Load 227(f32v1) + 246: 224(fvec4) ExtInst 1(GLSL.std.450) 18(Atan) 245 + Store 226(f32v2) 246 + 247: 224(fvec4) Load 227(f32v1) + 248: 224(fvec4) ExtInst 1(GLSL.std.450) 19(Sinh) 247 + Store 226(f32v2) 248 + 249: 224(fvec4) Load 227(f32v1) + 250: 224(fvec4) ExtInst 1(GLSL.std.450) 20(Cosh) 249 + Store 226(f32v2) 250 + 251: 224(fvec4) Load 227(f32v1) + 252: 224(fvec4) ExtInst 1(GLSL.std.450) 21(Tanh) 251 + Store 226(f32v2) 252 + 253: 224(fvec4) Load 227(f32v1) + 254: 224(fvec4) ExtInst 1(GLSL.std.450) 22(Asinh) 253 + Store 226(f32v2) 254 + 255: 224(fvec4) Load 227(f32v1) + 256: 224(fvec4) ExtInst 1(GLSL.std.450) 23(Acosh) 255 + Store 226(f32v2) 256 + 257: 224(fvec4) Load 227(f32v1) + 258: 224(fvec4) ExtInst 1(GLSL.std.450) 24(Atanh) 257 + Store 226(f32v2) 258 + Return + FunctionEnd +14(builtinExpFuncs(): 2 Function None 3 + 15: Label + 259(f32v2): 28(ptr) Variable Function + 260(f32v1): 28(ptr) Variable Function + 261: 27(fvec2) Load 260(f32v1) + 262: 27(fvec2) Load 259(f32v2) + 263: 27(fvec2) ExtInst 1(GLSL.std.450) 26(Pow) 261 262 + Store 259(f32v2) 263 + 264: 27(fvec2) Load 260(f32v1) + 265: 27(fvec2) ExtInst 1(GLSL.std.450) 27(Exp) 264 + Store 259(f32v2) 265 + 266: 27(fvec2) Load 260(f32v1) + 267: 27(fvec2) ExtInst 1(GLSL.std.450) 28(Log) 266 + Store 259(f32v2) 267 + 268: 27(fvec2) Load 260(f32v1) + 269: 27(fvec2) ExtInst 1(GLSL.std.450) 29(Exp2) 268 + Store 259(f32v2) 269 + 270: 27(fvec2) Load 260(f32v1) + 271: 27(fvec2) ExtInst 1(GLSL.std.450) 30(Log2) 270 + Store 259(f32v2) 271 + 272: 27(fvec2) Load 260(f32v1) + 273: 27(fvec2) ExtInst 1(GLSL.std.450) 31(Sqrt) 272 + Store 259(f32v2) 273 + 274: 27(fvec2) Load 260(f32v1) + 275: 27(fvec2) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 274 + Store 259(f32v2) 275 + Return + FunctionEnd +16(builtinCommonFuncs(): 2 Function None 3 + 17: Label + 276(f32v2): 154(ptr) Variable Function + 277(f32v1): 154(ptr) Variable Function + 298(f32): 33(ptr) Variable Function + 302(f32v3): 154(ptr) Variable Function + 342(bv): 159(ptr) Variable Function + 363(b): 108(ptr) Variable Function + 373(iv): 194(ptr) Variable Function + 278: 153(fvec3) Load 277(f32v1) + 279: 153(fvec3) ExtInst 1(GLSL.std.450) 4(FAbs) 278 + Store 276(f32v2) 279 + 280: 153(fvec3) Load 277(f32v1) + 281: 153(fvec3) ExtInst 1(GLSL.std.450) 6(FSign) 280 + Store 276(f32v2) 281 + 282: 153(fvec3) Load 277(f32v1) + 283: 153(fvec3) ExtInst 1(GLSL.std.450) 8(Floor) 282 + Store 276(f32v2) 283 + 284: 153(fvec3) Load 277(f32v1) + 285: 153(fvec3) ExtInst 1(GLSL.std.450) 3(Trunc) 284 + Store 276(f32v2) 285 + 286: 153(fvec3) Load 277(f32v1) + 287: 153(fvec3) ExtInst 1(GLSL.std.450) 1(Round) 286 + Store 276(f32v2) 287 + 288: 153(fvec3) Load 277(f32v1) + 289: 153(fvec3) ExtInst 1(GLSL.std.450) 2(RoundEven) 288 + Store 276(f32v2) 289 + 290: 153(fvec3) Load 277(f32v1) + 291: 153(fvec3) ExtInst 1(GLSL.std.450) 9(Ceil) 290 + Store 276(f32v2) 291 + 292: 153(fvec3) Load 277(f32v1) + 293: 153(fvec3) ExtInst 1(GLSL.std.450) 10(Fract) 292 + Store 276(f32v2) 293 + 294: 153(fvec3) Load 277(f32v1) + 295: 153(fvec3) Load 276(f32v2) + 296: 153(fvec3) FMod 294 295 + Store 276(f32v2) 296 + 297: 153(fvec3) Load 277(f32v1) + 299: 26(float) Load 298(f32) + 300: 153(fvec3) CompositeConstruct 299 299 299 + 301: 153(fvec3) FMod 297 300 + Store 276(f32v2) 301 + 303: 153(fvec3) Load 277(f32v1) + 304: 153(fvec3) ExtInst 1(GLSL.std.450) 35(Modf) 303 276(f32v2) + Store 302(f32v3) 304 + 305: 153(fvec3) Load 277(f32v1) + 306: 153(fvec3) Load 276(f32v2) + 307: 153(fvec3) ExtInst 1(GLSL.std.450) 37(FMin) 305 306 + Store 302(f32v3) 307 + 308: 153(fvec3) Load 277(f32v1) + 309: 26(float) Load 298(f32) + 310: 153(fvec3) CompositeConstruct 309 309 309 + 311: 153(fvec3) ExtInst 1(GLSL.std.450) 37(FMin) 308 310 + Store 302(f32v3) 311 + 312: 153(fvec3) Load 277(f32v1) + 313: 153(fvec3) Load 276(f32v2) + 314: 153(fvec3) ExtInst 1(GLSL.std.450) 40(FMax) 312 313 + Store 302(f32v3) 314 + 315: 153(fvec3) Load 277(f32v1) + 316: 26(float) Load 298(f32) + 317: 153(fvec3) CompositeConstruct 316 316 316 + 318: 153(fvec3) ExtInst 1(GLSL.std.450) 40(FMax) 315 317 + Store 302(f32v3) 318 + 319: 153(fvec3) Load 277(f32v1) + 320: 26(float) Load 298(f32) + 321: 33(ptr) AccessChain 276(f32v2) 32 + 322: 26(float) Load 321 + 323: 153(fvec3) CompositeConstruct 320 320 320 + 324: 153(fvec3) CompositeConstruct 322 322 322 + 325: 153(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 319 323 324 + Store 302(f32v3) 325 + 326: 153(fvec3) Load 277(f32v1) + 327: 153(fvec3) Load 276(f32v2) + 328: 26(float) Load 298(f32) + 329: 153(fvec3) CompositeConstruct 328 328 328 + 330: 153(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 326 327 329 + Store 302(f32v3) 330 + 331: 153(fvec3) Load 277(f32v1) + 332: 153(fvec3) Load 276(f32v2) + 333: 26(float) Load 298(f32) + 334: 153(fvec3) CompositeConstruct 333 333 333 + 335: 153(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 331 332 334 + Store 302(f32v3) 335 + 336: 153(fvec3) Load 277(f32v1) + 337: 153(fvec3) Load 276(f32v2) + 338: 153(fvec3) Load 302(f32v3) + 339: 153(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 336 337 338 + Store 302(f32v3) 339 + 340: 153(fvec3) Load 277(f32v1) + 341: 153(fvec3) Load 276(f32v2) + 343: 158(bvec3) Load 342(bv) + 344: 153(fvec3) Select 343 341 340 + Store 302(f32v3) 344 + 345: 153(fvec3) Load 277(f32v1) + 346: 153(fvec3) Load 276(f32v2) + 347: 153(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 345 346 + Store 302(f32v3) 347 + 348: 26(float) Load 298(f32) + 349: 153(fvec3) Load 302(f32v3) + 350: 153(fvec3) CompositeConstruct 348 348 348 + 351: 153(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 350 349 + Store 302(f32v3) 351 + 352: 153(fvec3) Load 277(f32v1) + 353: 153(fvec3) Load 276(f32v2) + 354: 153(fvec3) Load 302(f32v3) + 355: 153(fvec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 352 353 354 + Store 302(f32v3) 355 + 356: 26(float) Load 298(f32) + 357: 33(ptr) AccessChain 277(f32v1) 32 + 358: 26(float) Load 357 + 359: 153(fvec3) Load 276(f32v2) + 360: 153(fvec3) CompositeConstruct 356 356 356 + 361: 153(fvec3) CompositeConstruct 358 358 358 + 362: 153(fvec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 360 361 359 + Store 302(f32v3) 362 + 364: 26(float) Load 298(f32) + 365: 107(bool) IsNan 364 + Store 363(b) 365 + 366: 153(fvec3) Load 277(f32v1) + 367: 158(bvec3) IsInf 366 + Store 342(bv) 367 + 368: 153(fvec3) Load 277(f32v1) + 369: 153(fvec3) Load 276(f32v2) + 370: 153(fvec3) Load 302(f32v3) + 371: 153(fvec3) ExtInst 1(GLSL.std.450) 50(Fma) 368 369 370 + Store 302(f32v3) 371 + 372: 153(fvec3) Load 277(f32v1) + 375:374(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 372 + 376: 193(ivec3) CompositeExtract 375 1 + Store 373(iv) 376 + 377: 153(fvec3) CompositeExtract 375 0 + Store 276(f32v2) 377 + 378: 153(fvec3) Load 277(f32v1) + 379: 193(ivec3) Load 373(iv) + 380: 153(fvec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 378 379 + Store 276(f32v2) 380 + Return + FunctionEnd +18(builtinGeometryFuncs(): 2 Function None 3 + 19: Label + 381(f32): 33(ptr) Variable Function + 382(f32v1): 154(ptr) Variable Function + 386(f32v2): 154(ptr) Variable Function + 392(f32v3): 154(ptr) Variable Function + 383: 153(fvec3) Load 382(f32v1) + 384: 26(float) ExtInst 1(GLSL.std.450) 66(Length) 383 + Store 381(f32) 384 + 385: 153(fvec3) Load 382(f32v1) + 387: 153(fvec3) Load 386(f32v2) + 388: 26(float) ExtInst 1(GLSL.std.450) 67(Distance) 385 387 + Store 381(f32) 388 + 389: 153(fvec3) Load 382(f32v1) + 390: 153(fvec3) Load 386(f32v2) + 391: 26(float) Dot 389 390 + Store 381(f32) 391 + 393: 153(fvec3) Load 382(f32v1) + 394: 153(fvec3) Load 386(f32v2) + 395: 153(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 393 394 + Store 392(f32v3) 395 + 396: 153(fvec3) Load 382(f32v1) + 397: 153(fvec3) ExtInst 1(GLSL.std.450) 69(Normalize) 396 + Store 386(f32v2) 397 + 398: 153(fvec3) Load 382(f32v1) + 399: 153(fvec3) Load 386(f32v2) + 400: 153(fvec3) Load 392(f32v3) + 401: 153(fvec3) ExtInst 1(GLSL.std.450) 70(FaceForward) 398 399 400 + Store 392(f32v3) 401 + 402: 153(fvec3) Load 382(f32v1) + 403: 153(fvec3) Load 386(f32v2) + 404: 153(fvec3) ExtInst 1(GLSL.std.450) 71(Reflect) 402 403 + Store 392(f32v3) 404 + 405: 153(fvec3) Load 382(f32v1) + 406: 153(fvec3) Load 386(f32v2) + 407: 26(float) Load 381(f32) + 408: 153(fvec3) ExtInst 1(GLSL.std.450) 72(Refract) 405 406 407 + Store 392(f32v3) 408 + Return + FunctionEnd +20(builtinMatrixFuncs(): 2 Function None 3 + 21: Label + 411(f32m3): 410(ptr) Variable Function + 412(f32m1): 410(ptr) Variable Function + 414(f32m2): 410(ptr) Variable Function + 423(f32v1): 154(ptr) Variable Function + 425(f32v2): 28(ptr) Variable Function + 430(f32m4): 429(ptr) Variable Function + 433(f32): 33(ptr) Variable Function + 436(f32m5): 435(ptr) Variable Function + 441(f32m6): 440(ptr) Variable Function + 442(f32m7): 440(ptr) Variable Function + 413: 409 Load 412(f32m1) + 415: 409 Load 414(f32m2) + 416: 153(fvec3) CompositeExtract 413 0 + 417: 153(fvec3) CompositeExtract 415 0 + 418: 153(fvec3) FMul 416 417 + 419: 153(fvec3) CompositeExtract 413 1 + 420: 153(fvec3) CompositeExtract 415 1 + 421: 153(fvec3) FMul 419 420 + 422: 409 CompositeConstruct 418 421 + Store 411(f32m3) 422 + 424: 153(fvec3) Load 423(f32v1) + 426: 27(fvec2) Load 425(f32v2) + 427: 409 OuterProduct 424 426 + Store 412(f32m1) 427 + 431: 409 Load 412(f32m1) + 432: 428 Transpose 431 + Store 430(f32m4) 432 + 437: 434 Load 436(f32m5) + 438: 26(float) ExtInst 1(GLSL.std.450) 33(Determinant) 437 + Store 433(f32) 438 + 443: 439 Load 442(f32m7) + 444: 439 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 443 + Store 441(f32m6) 444 + Return + FunctionEnd +22(builtinVecRelFuncs(): 2 Function None 3 + 23: Label + 445(bv): 159(ptr) Variable Function + 446(f32v1): 154(ptr) Variable Function + 448(f32v2): 154(ptr) Variable Function + 447: 153(fvec3) Load 446(f32v1) + 449: 153(fvec3) Load 448(f32v2) + 450: 158(bvec3) FOrdLessThan 447 449 + Store 445(bv) 450 + 451: 153(fvec3) Load 446(f32v1) + 452: 153(fvec3) Load 448(f32v2) + 453: 158(bvec3) FOrdLessThanEqual 451 452 + Store 445(bv) 453 + 454: 153(fvec3) Load 446(f32v1) + 455: 153(fvec3) Load 448(f32v2) + 456: 158(bvec3) FOrdGreaterThan 454 455 + Store 445(bv) 456 + 457: 153(fvec3) Load 446(f32v1) + 458: 153(fvec3) Load 448(f32v2) + 459: 158(bvec3) FOrdGreaterThanEqual 457 458 + Store 445(bv) 459 + 460: 153(fvec3) Load 446(f32v1) + 461: 153(fvec3) Load 448(f32v2) + 462: 158(bvec3) FOrdEqual 460 461 + Store 445(bv) 462 + 463: 153(fvec3) Load 446(f32v1) + 464: 153(fvec3) Load 448(f32v2) + 465: 158(bvec3) FOrdNotEqual 463 464 + Store 445(bv) 465 + Return + FunctionEnd +24(builtinFragProcFuncs(): 2 Function None 3 + 25: Label + 466(f32v): 154(ptr) Variable Function + 470: 469(ptr) AccessChain 468(if32v) 32 + 471: 26(float) Load 470 + 472: 26(float) DPdx 471 + 473: 33(ptr) AccessChain 466(f32v) 32 + Store 473 472 + 474: 469(ptr) AccessChain 468(if32v) 88 + 475: 26(float) Load 474 + 476: 26(float) DPdy 475 + 477: 33(ptr) AccessChain 466(f32v) 88 + Store 477 476 + 478: 153(fvec3) Load 468(if32v) + 479: 27(fvec2) VectorShuffle 478 478 0 1 + 480: 27(fvec2) DPdxFine 479 + 481: 153(fvec3) Load 466(f32v) + 482: 153(fvec3) VectorShuffle 481 480 3 4 2 + Store 466(f32v) 482 + 483: 153(fvec3) Load 468(if32v) + 484: 27(fvec2) VectorShuffle 483 483 0 1 + 485: 27(fvec2) DPdyFine 484 + 486: 153(fvec3) Load 466(f32v) + 487: 153(fvec3) VectorShuffle 486 485 3 4 2 + Store 466(f32v) 487 + 488: 153(fvec3) Load 468(if32v) + 489: 153(fvec3) DPdxCoarse 488 + Store 466(f32v) 489 + 490: 153(fvec3) Load 468(if32v) + 491: 153(fvec3) DPdxCoarse 490 + Store 466(f32v) 491 + 492: 469(ptr) AccessChain 468(if32v) 32 + 493: 26(float) Load 492 + 494: 26(float) Fwidth 493 + 495: 33(ptr) AccessChain 466(f32v) 32 + Store 495 494 + 496: 153(fvec3) Load 468(if32v) + 497: 27(fvec2) VectorShuffle 496 496 0 1 + 498: 27(fvec2) FwidthFine 497 + 499: 153(fvec3) Load 466(f32v) + 500: 153(fvec3) VectorShuffle 499 498 3 4 2 + Store 466(f32v) 500 + 501: 153(fvec3) Load 468(if32v) + 502: 153(fvec3) FwidthCoarse 501 + Store 466(f32v) 502 + 503: 469(ptr) AccessChain 468(if32v) 32 + 504: 26(float) ExtInst 1(GLSL.std.450) 76(InterpolateAtCentroid) 503 + 505: 33(ptr) AccessChain 466(f32v) 32 + Store 505 504 + 507: 153(fvec3) ExtInst 1(GLSL.std.450) 77(InterpolateAtSample) 468(if32v) 506 + 508: 27(fvec2) VectorShuffle 507 507 0 1 + 509: 153(fvec3) Load 466(f32v) + 510: 153(fvec3) VectorShuffle 509 508 3 4 2 + Store 466(f32v) 510 + 513: 153(fvec3) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 468(if32v) 512 + Store 466(f32v) 513 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.float64.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.float64.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.float64.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.float64.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,788 @@ +spv.float64.frag +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 521 + + Capability Shader + Capability Float16 + Capability Float64 + Capability Int64 + Capability Int16 + Capability Int8 + Capability DerivativeControl + Capability InterpolationFunction + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 458 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_KHX_shader_explicit_arithmetic_types" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + Name 4 "main" + Name 6 "literal(" + Name 8 "operators(" + Name 10 "typeCast(" + Name 12 "builtinAngleTrigFuncs(" + Name 14 "builtinExpFuncs(" + Name 16 "builtinCommonFuncs(" + Name 18 "builtinGeometryFuncs(" + Name 20 "builtinMatrixFuncs(" + Name 22 "builtinVecRelFuncs(" + Name 24 "builtinFragProcFuncs(" + Name 29 "f64v" + Name 40 "f64v" + Name 62 "f64m" + Name 85 "f64" + Name 109 "b" + Name 151 "f64v" + Name 154 "bv" + Name 165 "f16v" + Name 173 "i8v" + Name 179 "i16v" + Name 185 "i32v" + Name 191 "i64v" + Name 194 "u8v" + Name 200 "u16v" + Name 205 "u32v" + Name 211 "u64v" + Name 216 "f64v2" + Name 217 "f64v1" + Name 249 "f64v2" + Name 250 "f64v1" + Name 266 "f64v2" + Name 267 "f64v1" + Name 288 "f64" + Name 292 "f64v3" + Name 332 "bv" + Name 353 "b" + Name 363 "iv" + Name 364 "ResType" + Name 371 "f64" + Name 372 "f64v1" + Name 376 "f64v2" + Name 382 "f64v3" + Name 401 "f64m3" + Name 402 "f64m1" + Name 404 "f64m2" + Name 413 "f64v1" + Name 415 "f64v2" + Name 420 "f64m4" + Name 423 "f64" + Name 426 "f64m5" + Name 431 "f64m6" + Name 432 "f64m7" + Name 435 "bv" + Name 436 "f64v1" + Name 438 "f64v2" + Name 456 "f64v" + Name 458 "if64v" + Name 507 "S" + MemberName 507(S) 0 "x" + MemberName 507(S) 1 "y" + MemberName 507(S) 2 "z" + Name 509 "B1" + MemberName 509(B1) 0 "a" + MemberName 509(B1) 1 "b" + MemberName 509(B1) 2 "c" + MemberName 509(B1) 3 "d" + MemberName 509(B1) 4 "e" + MemberName 509(B1) 5 "f" + MemberName 509(B1) 6 "g" + MemberName 509(B1) 7 "h" + Name 511 "" + Name 512 "sf16" + Name 514 "sf" + Name 515 "sd" + Decorate 458(if64v) Flat + Decorate 505 ArrayStride 16 + Decorate 506 ArrayStride 64 + MemberDecorate 507(S) 0 Offset 0 + MemberDecorate 507(S) 1 Offset 16 + MemberDecorate 507(S) 2 Offset 32 + Decorate 508 ArrayStride 64 + MemberDecorate 509(B1) 0 Offset 0 + MemberDecorate 509(B1) 1 Offset 16 + MemberDecorate 509(B1) 2 Offset 32 + MemberDecorate 509(B1) 3 Offset 64 + MemberDecorate 509(B1) 4 ColMajor + MemberDecorate 509(B1) 4 Offset 96 + MemberDecorate 509(B1) 4 MatrixStride 32 + MemberDecorate 509(B1) 5 ColMajor + MemberDecorate 509(B1) 5 Offset 160 + MemberDecorate 509(B1) 5 MatrixStride 32 + MemberDecorate 509(B1) 6 Offset 288 + MemberDecorate 509(B1) 7 Offset 352 + Decorate 509(B1) Block + Decorate 511 DescriptorSet 0 + Decorate 512(sf16) SpecId 100 + Decorate 514(sf) SpecId 101 + Decorate 515(sd) SpecId 102 + 2: TypeVoid + 3: TypeFunction 2 + 26: TypeFloat 64 + 27: TypeVector 26(float) 2 + 28: TypePointer Function 27(fvec2) + 30: 26(float) Constant 2696277389 1051772663 + 31: TypeInt 32 0 + 32: 31(int) Constant 0 + 33: TypePointer Function 26(float) + 35: 26(float) Constant 0 3218079744 + 36: 26(float) Constant 3951369912 1067366481 + 37: 27(fvec2) ConstantComposite 35 36 + 54: 26(float) Constant 0 1072693248 + 60: TypeMatrix 27(fvec2) 2 + 61: TypePointer Function 60 + 88: 31(int) Constant 1 + 107: TypeBool + 108: TypePointer Function 107(bool) + 149: TypeVector 26(float) 3 + 150: TypePointer Function 149(fvec3) + 152: TypeVector 107(bool) 3 + 153: TypePointer Function 152(bvec3) + 156: 26(float) Constant 0 0 + 157: 149(fvec3) ConstantComposite 156 156 156 + 158: 149(fvec3) ConstantComposite 54 54 54 + 162: TypeFloat 16 + 163: TypeVector 162(float) 3 + 164: TypePointer Function 163(fvec3) + 170: TypeInt 8 1 + 171: TypeVector 170(int) 3 + 172: TypePointer Function 171(ivec3) + 176: TypeInt 16 1 + 177: TypeVector 176(int) 3 + 178: TypePointer Function 177(ivec3) + 182: TypeInt 32 1 + 183: TypeVector 182(int) 3 + 184: TypePointer Function 183(ivec3) + 188: TypeInt 64 1 + 189: TypeVector 188(int) 3 + 190: TypePointer Function 189(ivec3) + 197: TypeInt 16 0 + 198: TypeVector 197(int) 3 + 199: TypePointer Function 198(ivec3) + 203: TypeVector 31(int) 3 + 204: TypePointer Function 203(ivec3) + 208: TypeInt 64 0 + 209: TypeVector 208(int) 3 + 210: TypePointer Function 209(ivec3) + 214: TypeVector 26(float) 4 + 215: TypePointer Function 214(fvec4) + 364(ResType): TypeStruct 149(fvec3) 183(ivec3) + 399: TypeMatrix 149(fvec3) 2 + 400: TypePointer Function 399 + 418: TypeMatrix 27(fvec2) 3 + 419: TypePointer Function 418 + 424: TypeMatrix 149(fvec3) 3 + 425: TypePointer Function 424 + 429: TypeMatrix 214(fvec4) 4 + 430: TypePointer Function 429 + 457: TypePointer Input 149(fvec3) + 458(if64v): 457(ptr) Variable Input + 459: TypePointer Input 26(float) + 496: 182(int) Constant 1 + 501: 26(float) Constant 0 1071644672 + 502: 27(fvec2) ConstantComposite 501 501 + 504: 31(int) Constant 2 + 505: TypeArray 26(float) 504 + 506: TypeArray 399 504 + 507(S): TypeStruct 26(float) 27(fvec2) 149(fvec3) + 508: TypeArray 507(S) 504 + 509(B1): TypeStruct 26(float) 27(fvec2) 149(fvec3) 505 399 506 507(S) 508 + 510: TypePointer Uniform 509(B1) + 511: 510(ptr) Variable Uniform + 512(sf16): 162(float) SpecConstant 12288 + 513: TypeFloat 32 + 514(sf): 513(float) SpecConstant 1048576000 + 515(sd): 26(float) SpecConstant 0 1071644672 + 516: 513(float) SpecConstantOp 115 512(sf16) + 517: 513(float) SpecConstantOp 115 512(sf16) + 518: 26(float) SpecConstantOp 115 517 + 519: 162(float) SpecConstantOp 115 514(sf) + 520: 162(float) SpecConstantOp 115 515(sd) + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd + 6(literal(): 2 Function None 3 + 7: Label + 29(f64v): 28(ptr) Variable Function + 34: 33(ptr) AccessChain 29(f64v) 32 + Store 34 30 + 38: 27(fvec2) Load 29(f64v) + 39: 27(fvec2) FAdd 38 37 + Store 29(f64v) 39 + Return + FunctionEnd + 8(operators(): 2 Function None 3 + 9: Label + 40(f64v): 28(ptr) Variable Function + 62(f64m): 61(ptr) Variable Function + 85(f64): 33(ptr) Variable Function + 109(b): 108(ptr) Variable Function + 41: 27(fvec2) Load 40(f64v) + 42: 27(fvec2) Load 40(f64v) + 43: 27(fvec2) FAdd 42 41 + Store 40(f64v) 43 + 44: 27(fvec2) Load 40(f64v) + 45: 27(fvec2) Load 40(f64v) + 46: 27(fvec2) FSub 45 44 + Store 40(f64v) 46 + 47: 27(fvec2) Load 40(f64v) + 48: 27(fvec2) Load 40(f64v) + 49: 27(fvec2) FMul 48 47 + Store 40(f64v) 49 + 50: 27(fvec2) Load 40(f64v) + 51: 27(fvec2) Load 40(f64v) + 52: 27(fvec2) FDiv 51 50 + Store 40(f64v) 52 + 53: 27(fvec2) Load 40(f64v) + 55: 27(fvec2) CompositeConstruct 54 54 + 56: 27(fvec2) FAdd 53 55 + Store 40(f64v) 56 + 57: 27(fvec2) Load 40(f64v) + 58: 27(fvec2) CompositeConstruct 54 54 + 59: 27(fvec2) FSub 57 58 + Store 40(f64v) 59 + 63: 60 Load 62(f64m) + 64: 27(fvec2) CompositeConstruct 54 54 + 65: 27(fvec2) CompositeExtract 63 0 + 66: 27(fvec2) FAdd 65 64 + 67: 27(fvec2) CompositeExtract 63 1 + 68: 27(fvec2) FAdd 67 64 + 69: 60 CompositeConstruct 66 68 + Store 62(f64m) 69 + 70: 60 Load 62(f64m) + 71: 27(fvec2) CompositeConstruct 54 54 + 72: 27(fvec2) CompositeExtract 70 0 + 73: 27(fvec2) FSub 72 71 + 74: 27(fvec2) CompositeExtract 70 1 + 75: 27(fvec2) FSub 74 71 + 76: 60 CompositeConstruct 73 75 + Store 62(f64m) 76 + 77: 27(fvec2) Load 40(f64v) + 78: 27(fvec2) FNegate 77 + Store 40(f64v) 78 + 79: 60 Load 62(f64m) + 80: 27(fvec2) CompositeExtract 79 0 + 81: 27(fvec2) FNegate 80 + 82: 27(fvec2) CompositeExtract 79 1 + 83: 27(fvec2) FNegate 82 + 84: 60 CompositeConstruct 81 83 + Store 62(f64m) 84 + 86: 33(ptr) AccessChain 40(f64v) 32 + 87: 26(float) Load 86 + 89: 33(ptr) AccessChain 40(f64v) 88 + 90: 26(float) Load 89 + 91: 26(float) FAdd 87 90 + Store 85(f64) 91 + 92: 33(ptr) AccessChain 40(f64v) 32 + 93: 26(float) Load 92 + 94: 33(ptr) AccessChain 40(f64v) 88 + 95: 26(float) Load 94 + 96: 26(float) FSub 93 95 + Store 85(f64) 96 + 97: 33(ptr) AccessChain 40(f64v) 32 + 98: 26(float) Load 97 + 99: 33(ptr) AccessChain 40(f64v) 88 + 100: 26(float) Load 99 + 101: 26(float) FMul 98 100 + Store 85(f64) 101 + 102: 33(ptr) AccessChain 40(f64v) 32 + 103: 26(float) Load 102 + 104: 33(ptr) AccessChain 40(f64v) 88 + 105: 26(float) Load 104 + 106: 26(float) FDiv 103 105 + Store 85(f64) 106 + 110: 33(ptr) AccessChain 40(f64v) 32 + 111: 26(float) Load 110 + 112: 26(float) Load 85(f64) + 113: 107(bool) FOrdNotEqual 111 112 + Store 109(b) 113 + 114: 33(ptr) AccessChain 40(f64v) 88 + 115: 26(float) Load 114 + 116: 26(float) Load 85(f64) + 117: 107(bool) FOrdEqual 115 116 + Store 109(b) 117 + 118: 33(ptr) AccessChain 40(f64v) 32 + 119: 26(float) Load 118 + 120: 26(float) Load 85(f64) + 121: 107(bool) FOrdGreaterThan 119 120 + Store 109(b) 121 + 122: 33(ptr) AccessChain 40(f64v) 88 + 123: 26(float) Load 122 + 124: 26(float) Load 85(f64) + 125: 107(bool) FOrdLessThan 123 124 + Store 109(b) 125 + 126: 33(ptr) AccessChain 40(f64v) 32 + 127: 26(float) Load 126 + 128: 26(float) Load 85(f64) + 129: 107(bool) FOrdGreaterThanEqual 127 128 + Store 109(b) 129 + 130: 33(ptr) AccessChain 40(f64v) 88 + 131: 26(float) Load 130 + 132: 26(float) Load 85(f64) + 133: 107(bool) FOrdLessThanEqual 131 132 + Store 109(b) 133 + 134: 27(fvec2) Load 40(f64v) + 135: 26(float) Load 85(f64) + 136: 27(fvec2) VectorTimesScalar 134 135 + Store 40(f64v) 136 + 137: 60 Load 62(f64m) + 138: 26(float) Load 85(f64) + 139: 60 MatrixTimesScalar 137 138 + Store 62(f64m) 139 + 140: 60 Load 62(f64m) + 141: 27(fvec2) Load 40(f64v) + 142: 27(fvec2) MatrixTimesVector 140 141 + Store 40(f64v) 142 + 143: 27(fvec2) Load 40(f64v) + 144: 60 Load 62(f64m) + 145: 27(fvec2) VectorTimesMatrix 143 144 + Store 40(f64v) 145 + 146: 60 Load 62(f64m) + 147: 60 Load 62(f64m) + 148: 60 MatrixTimesMatrix 146 147 + Store 62(f64m) 148 + Return + FunctionEnd + 10(typeCast(): 2 Function None 3 + 11: Label + 151(f64v): 150(ptr) Variable Function + 154(bv): 153(ptr) Variable Function + 165(f16v): 164(ptr) Variable Function + 173(i8v): 172(ptr) Variable Function + 179(i16v): 178(ptr) Variable Function + 185(i32v): 184(ptr) Variable Function + 191(i64v): 190(ptr) Variable Function + 194(u8v): 172(ptr) Variable Function + 200(u16v): 199(ptr) Variable Function + 205(u32v): 204(ptr) Variable Function + 211(u64v): 210(ptr) Variable Function + 155: 152(bvec3) Load 154(bv) + 159: 149(fvec3) Select 155 158 157 + Store 151(f64v) 159 + 160: 149(fvec3) Load 151(f64v) + 161: 152(bvec3) FOrdNotEqual 160 157 + Store 154(bv) 161 + 166: 163(fvec3) Load 165(f16v) + 167: 149(fvec3) FConvert 166 + Store 151(f64v) 167 + 168: 149(fvec3) Load 151(f64v) + 169: 163(fvec3) FConvert 168 + Store 165(f16v) 169 + 174: 149(fvec3) Load 151(f64v) + 175: 171(ivec3) ConvertFToS 174 + Store 173(i8v) 175 + 180: 149(fvec3) Load 151(f64v) + 181: 177(ivec3) ConvertFToS 180 + Store 179(i16v) 181 + 186: 149(fvec3) Load 151(f64v) + 187: 183(ivec3) ConvertFToS 186 + Store 185(i32v) 187 + 192: 149(fvec3) Load 151(f64v) + 193: 189(ivec3) ConvertFToS 192 + Store 191(i64v) 193 + 195: 149(fvec3) Load 151(f64v) + 196: 171(ivec3) ConvertFToS 195 + Store 194(u8v) 196 + 201: 149(fvec3) Load 151(f64v) + 202: 198(ivec3) ConvertFToU 201 + Store 200(u16v) 202 + 206: 149(fvec3) Load 151(f64v) + 207: 203(ivec3) ConvertFToU 206 + Store 205(u32v) 207 + 212: 149(fvec3) Load 151(f64v) + 213: 209(ivec3) ConvertFToU 212 + Store 211(u64v) 213 + Return + FunctionEnd +12(builtinAngleTrigFuncs(): 2 Function None 3 + 13: Label + 216(f64v2): 215(ptr) Variable Function + 217(f64v1): 215(ptr) Variable Function + 218: 214(fvec4) Load 217(f64v1) + 219: 214(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 218 + Store 216(f64v2) 219 + 220: 214(fvec4) Load 217(f64v1) + 221: 214(fvec4) ExtInst 1(GLSL.std.450) 12(Degrees) 220 + Store 216(f64v2) 221 + 222: 214(fvec4) Load 217(f64v1) + 223: 214(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 222 + Store 216(f64v2) 223 + 224: 214(fvec4) Load 217(f64v1) + 225: 214(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 224 + Store 216(f64v2) 225 + 226: 214(fvec4) Load 217(f64v1) + 227: 214(fvec4) ExtInst 1(GLSL.std.450) 15(Tan) 226 + Store 216(f64v2) 227 + 228: 214(fvec4) Load 217(f64v1) + 229: 214(fvec4) ExtInst 1(GLSL.std.450) 16(Asin) 228 + Store 216(f64v2) 229 + 230: 214(fvec4) Load 217(f64v1) + 231: 214(fvec4) ExtInst 1(GLSL.std.450) 17(Acos) 230 + Store 216(f64v2) 231 + 232: 214(fvec4) Load 217(f64v1) + 233: 214(fvec4) Load 216(f64v2) + 234: 214(fvec4) ExtInst 1(GLSL.std.450) 25(Atan2) 232 233 + Store 216(f64v2) 234 + 235: 214(fvec4) Load 217(f64v1) + 236: 214(fvec4) ExtInst 1(GLSL.std.450) 18(Atan) 235 + Store 216(f64v2) 236 + 237: 214(fvec4) Load 217(f64v1) + 238: 214(fvec4) ExtInst 1(GLSL.std.450) 19(Sinh) 237 + Store 216(f64v2) 238 + 239: 214(fvec4) Load 217(f64v1) + 240: 214(fvec4) ExtInst 1(GLSL.std.450) 20(Cosh) 239 + Store 216(f64v2) 240 + 241: 214(fvec4) Load 217(f64v1) + 242: 214(fvec4) ExtInst 1(GLSL.std.450) 21(Tanh) 241 + Store 216(f64v2) 242 + 243: 214(fvec4) Load 217(f64v1) + 244: 214(fvec4) ExtInst 1(GLSL.std.450) 22(Asinh) 243 + Store 216(f64v2) 244 + 245: 214(fvec4) Load 217(f64v1) + 246: 214(fvec4) ExtInst 1(GLSL.std.450) 23(Acosh) 245 + Store 216(f64v2) 246 + 247: 214(fvec4) Load 217(f64v1) + 248: 214(fvec4) ExtInst 1(GLSL.std.450) 24(Atanh) 247 + Store 216(f64v2) 248 + Return + FunctionEnd +14(builtinExpFuncs(): 2 Function None 3 + 15: Label + 249(f64v2): 28(ptr) Variable Function + 250(f64v1): 28(ptr) Variable Function + 251: 27(fvec2) Load 250(f64v1) + 252: 27(fvec2) Load 249(f64v2) + 253: 27(fvec2) ExtInst 1(GLSL.std.450) 26(Pow) 251 252 + Store 249(f64v2) 253 + 254: 27(fvec2) Load 250(f64v1) + 255: 27(fvec2) ExtInst 1(GLSL.std.450) 27(Exp) 254 + Store 249(f64v2) 255 + 256: 27(fvec2) Load 250(f64v1) + 257: 27(fvec2) ExtInst 1(GLSL.std.450) 28(Log) 256 + Store 249(f64v2) 257 + 258: 27(fvec2) Load 250(f64v1) + 259: 27(fvec2) ExtInst 1(GLSL.std.450) 29(Exp2) 258 + Store 249(f64v2) 259 + 260: 27(fvec2) Load 250(f64v1) + 261: 27(fvec2) ExtInst 1(GLSL.std.450) 30(Log2) 260 + Store 249(f64v2) 261 + 262: 27(fvec2) Load 250(f64v1) + 263: 27(fvec2) ExtInst 1(GLSL.std.450) 31(Sqrt) 262 + Store 249(f64v2) 263 + 264: 27(fvec2) Load 250(f64v1) + 265: 27(fvec2) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 264 + Store 249(f64v2) 265 + Return + FunctionEnd +16(builtinCommonFuncs(): 2 Function None 3 + 17: Label + 266(f64v2): 150(ptr) Variable Function + 267(f64v1): 150(ptr) Variable Function + 288(f64): 33(ptr) Variable Function + 292(f64v3): 150(ptr) Variable Function + 332(bv): 153(ptr) Variable Function + 353(b): 108(ptr) Variable Function + 363(iv): 184(ptr) Variable Function + 268: 149(fvec3) Load 267(f64v1) + 269: 149(fvec3) ExtInst 1(GLSL.std.450) 4(FAbs) 268 + Store 266(f64v2) 269 + 270: 149(fvec3) Load 267(f64v1) + 271: 149(fvec3) ExtInst 1(GLSL.std.450) 6(FSign) 270 + Store 266(f64v2) 271 + 272: 149(fvec3) Load 267(f64v1) + 273: 149(fvec3) ExtInst 1(GLSL.std.450) 8(Floor) 272 + Store 266(f64v2) 273 + 274: 149(fvec3) Load 267(f64v1) + 275: 149(fvec3) ExtInst 1(GLSL.std.450) 3(Trunc) 274 + Store 266(f64v2) 275 + 276: 149(fvec3) Load 267(f64v1) + 277: 149(fvec3) ExtInst 1(GLSL.std.450) 1(Round) 276 + Store 266(f64v2) 277 + 278: 149(fvec3) Load 267(f64v1) + 279: 149(fvec3) ExtInst 1(GLSL.std.450) 2(RoundEven) 278 + Store 266(f64v2) 279 + 280: 149(fvec3) Load 267(f64v1) + 281: 149(fvec3) ExtInst 1(GLSL.std.450) 9(Ceil) 280 + Store 266(f64v2) 281 + 282: 149(fvec3) Load 267(f64v1) + 283: 149(fvec3) ExtInst 1(GLSL.std.450) 10(Fract) 282 + Store 266(f64v2) 283 + 284: 149(fvec3) Load 267(f64v1) + 285: 149(fvec3) Load 266(f64v2) + 286: 149(fvec3) FMod 284 285 + Store 266(f64v2) 286 + 287: 149(fvec3) Load 267(f64v1) + 289: 26(float) Load 288(f64) + 290: 149(fvec3) CompositeConstruct 289 289 289 + 291: 149(fvec3) FMod 287 290 + Store 266(f64v2) 291 + 293: 149(fvec3) Load 267(f64v1) + 294: 149(fvec3) ExtInst 1(GLSL.std.450) 35(Modf) 293 266(f64v2) + Store 292(f64v3) 294 + 295: 149(fvec3) Load 267(f64v1) + 296: 149(fvec3) Load 266(f64v2) + 297: 149(fvec3) ExtInst 1(GLSL.std.450) 37(FMin) 295 296 + Store 292(f64v3) 297 + 298: 149(fvec3) Load 267(f64v1) + 299: 26(float) Load 288(f64) + 300: 149(fvec3) CompositeConstruct 299 299 299 + 301: 149(fvec3) ExtInst 1(GLSL.std.450) 37(FMin) 298 300 + Store 292(f64v3) 301 + 302: 149(fvec3) Load 267(f64v1) + 303: 149(fvec3) Load 266(f64v2) + 304: 149(fvec3) ExtInst 1(GLSL.std.450) 40(FMax) 302 303 + Store 292(f64v3) 304 + 305: 149(fvec3) Load 267(f64v1) + 306: 26(float) Load 288(f64) + 307: 149(fvec3) CompositeConstruct 306 306 306 + 308: 149(fvec3) ExtInst 1(GLSL.std.450) 40(FMax) 305 307 + Store 292(f64v3) 308 + 309: 149(fvec3) Load 267(f64v1) + 310: 26(float) Load 288(f64) + 311: 33(ptr) AccessChain 266(f64v2) 32 + 312: 26(float) Load 311 + 313: 149(fvec3) CompositeConstruct 310 310 310 + 314: 149(fvec3) CompositeConstruct 312 312 312 + 315: 149(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 309 313 314 + Store 292(f64v3) 315 + 316: 149(fvec3) Load 267(f64v1) + 317: 149(fvec3) Load 266(f64v2) + 318: 26(float) Load 288(f64) + 319: 149(fvec3) CompositeConstruct 318 318 318 + 320: 149(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 316 317 319 + Store 292(f64v3) 320 + 321: 149(fvec3) Load 267(f64v1) + 322: 149(fvec3) Load 266(f64v2) + 323: 26(float) Load 288(f64) + 324: 149(fvec3) CompositeConstruct 323 323 323 + 325: 149(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 321 322 324 + Store 292(f64v3) 325 + 326: 149(fvec3) Load 267(f64v1) + 327: 149(fvec3) Load 266(f64v2) + 328: 149(fvec3) Load 292(f64v3) + 329: 149(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 326 327 328 + Store 292(f64v3) 329 + 330: 149(fvec3) Load 267(f64v1) + 331: 149(fvec3) Load 266(f64v2) + 333: 152(bvec3) Load 332(bv) + 334: 149(fvec3) Select 333 331 330 + Store 292(f64v3) 334 + 335: 149(fvec3) Load 267(f64v1) + 336: 149(fvec3) Load 266(f64v2) + 337: 149(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 335 336 + Store 292(f64v3) 337 + 338: 26(float) Load 288(f64) + 339: 149(fvec3) Load 292(f64v3) + 340: 149(fvec3) CompositeConstruct 338 338 338 + 341: 149(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 340 339 + Store 292(f64v3) 341 + 342: 149(fvec3) Load 267(f64v1) + 343: 149(fvec3) Load 266(f64v2) + 344: 149(fvec3) Load 292(f64v3) + 345: 149(fvec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 342 343 344 + Store 292(f64v3) 345 + 346: 26(float) Load 288(f64) + 347: 33(ptr) AccessChain 267(f64v1) 32 + 348: 26(float) Load 347 + 349: 149(fvec3) Load 266(f64v2) + 350: 149(fvec3) CompositeConstruct 346 346 346 + 351: 149(fvec3) CompositeConstruct 348 348 348 + 352: 149(fvec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 350 351 349 + Store 292(f64v3) 352 + 354: 26(float) Load 288(f64) + 355: 107(bool) IsNan 354 + Store 353(b) 355 + 356: 149(fvec3) Load 267(f64v1) + 357: 152(bvec3) IsInf 356 + Store 332(bv) 357 + 358: 149(fvec3) Load 267(f64v1) + 359: 149(fvec3) Load 266(f64v2) + 360: 149(fvec3) Load 292(f64v3) + 361: 149(fvec3) ExtInst 1(GLSL.std.450) 50(Fma) 358 359 360 + Store 292(f64v3) 361 + 362: 149(fvec3) Load 267(f64v1) + 365:364(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 362 + 366: 183(ivec3) CompositeExtract 365 1 + Store 363(iv) 366 + 367: 149(fvec3) CompositeExtract 365 0 + Store 266(f64v2) 367 + 368: 149(fvec3) Load 267(f64v1) + 369: 183(ivec3) Load 363(iv) + 370: 149(fvec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 368 369 + Store 266(f64v2) 370 + Return + FunctionEnd +18(builtinGeometryFuncs(): 2 Function None 3 + 19: Label + 371(f64): 33(ptr) Variable Function + 372(f64v1): 150(ptr) Variable Function + 376(f64v2): 150(ptr) Variable Function + 382(f64v3): 150(ptr) Variable Function + 373: 149(fvec3) Load 372(f64v1) + 374: 26(float) ExtInst 1(GLSL.std.450) 66(Length) 373 + Store 371(f64) 374 + 375: 149(fvec3) Load 372(f64v1) + 377: 149(fvec3) Load 376(f64v2) + 378: 26(float) ExtInst 1(GLSL.std.450) 67(Distance) 375 377 + Store 371(f64) 378 + 379: 149(fvec3) Load 372(f64v1) + 380: 149(fvec3) Load 376(f64v2) + 381: 26(float) Dot 379 380 + Store 371(f64) 381 + 383: 149(fvec3) Load 372(f64v1) + 384: 149(fvec3) Load 376(f64v2) + 385: 149(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 383 384 + Store 382(f64v3) 385 + 386: 149(fvec3) Load 372(f64v1) + 387: 149(fvec3) ExtInst 1(GLSL.std.450) 69(Normalize) 386 + Store 376(f64v2) 387 + 388: 149(fvec3) Load 372(f64v1) + 389: 149(fvec3) Load 376(f64v2) + 390: 149(fvec3) Load 382(f64v3) + 391: 149(fvec3) ExtInst 1(GLSL.std.450) 70(FaceForward) 388 389 390 + Store 382(f64v3) 391 + 392: 149(fvec3) Load 372(f64v1) + 393: 149(fvec3) Load 376(f64v2) + 394: 149(fvec3) ExtInst 1(GLSL.std.450) 71(Reflect) 392 393 + Store 382(f64v3) 394 + 395: 149(fvec3) Load 372(f64v1) + 396: 149(fvec3) Load 376(f64v2) + 397: 26(float) Load 371(f64) + 398: 149(fvec3) ExtInst 1(GLSL.std.450) 72(Refract) 395 396 397 + Store 382(f64v3) 398 + Return + FunctionEnd +20(builtinMatrixFuncs(): 2 Function None 3 + 21: Label + 401(f64m3): 400(ptr) Variable Function + 402(f64m1): 400(ptr) Variable Function + 404(f64m2): 400(ptr) Variable Function + 413(f64v1): 150(ptr) Variable Function + 415(f64v2): 28(ptr) Variable Function + 420(f64m4): 419(ptr) Variable Function + 423(f64): 33(ptr) Variable Function + 426(f64m5): 425(ptr) Variable Function + 431(f64m6): 430(ptr) Variable Function + 432(f64m7): 430(ptr) Variable Function + 403: 399 Load 402(f64m1) + 405: 399 Load 404(f64m2) + 406: 149(fvec3) CompositeExtract 403 0 + 407: 149(fvec3) CompositeExtract 405 0 + 408: 149(fvec3) FMul 406 407 + 409: 149(fvec3) CompositeExtract 403 1 + 410: 149(fvec3) CompositeExtract 405 1 + 411: 149(fvec3) FMul 409 410 + 412: 399 CompositeConstruct 408 411 + Store 401(f64m3) 412 + 414: 149(fvec3) Load 413(f64v1) + 416: 27(fvec2) Load 415(f64v2) + 417: 399 OuterProduct 414 416 + Store 402(f64m1) 417 + 421: 399 Load 402(f64m1) + 422: 418 Transpose 421 + Store 420(f64m4) 422 + 427: 424 Load 426(f64m5) + 428: 26(float) ExtInst 1(GLSL.std.450) 33(Determinant) 427 + Store 423(f64) 428 + 433: 429 Load 432(f64m7) + 434: 429 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 433 + Store 431(f64m6) 434 + Return + FunctionEnd +22(builtinVecRelFuncs(): 2 Function None 3 + 23: Label + 435(bv): 153(ptr) Variable Function + 436(f64v1): 150(ptr) Variable Function + 438(f64v2): 150(ptr) Variable Function + 437: 149(fvec3) Load 436(f64v1) + 439: 149(fvec3) Load 438(f64v2) + 440: 152(bvec3) FOrdLessThan 437 439 + Store 435(bv) 440 + 441: 149(fvec3) Load 436(f64v1) + 442: 149(fvec3) Load 438(f64v2) + 443: 152(bvec3) FOrdLessThanEqual 441 442 + Store 435(bv) 443 + 444: 149(fvec3) Load 436(f64v1) + 445: 149(fvec3) Load 438(f64v2) + 446: 152(bvec3) FOrdGreaterThan 444 445 + Store 435(bv) 446 + 447: 149(fvec3) Load 436(f64v1) + 448: 149(fvec3) Load 438(f64v2) + 449: 152(bvec3) FOrdGreaterThanEqual 447 448 + Store 435(bv) 449 + 450: 149(fvec3) Load 436(f64v1) + 451: 149(fvec3) Load 438(f64v2) + 452: 152(bvec3) FOrdEqual 450 451 + Store 435(bv) 452 + 453: 149(fvec3) Load 436(f64v1) + 454: 149(fvec3) Load 438(f64v2) + 455: 152(bvec3) FOrdNotEqual 453 454 + Store 435(bv) 455 + Return + FunctionEnd +24(builtinFragProcFuncs(): 2 Function None 3 + 25: Label + 456(f64v): 150(ptr) Variable Function + 460: 459(ptr) AccessChain 458(if64v) 32 + 461: 26(float) Load 460 + 462: 26(float) DPdx 461 + 463: 33(ptr) AccessChain 456(f64v) 32 + Store 463 462 + 464: 459(ptr) AccessChain 458(if64v) 88 + 465: 26(float) Load 464 + 466: 26(float) DPdy 465 + 467: 33(ptr) AccessChain 456(f64v) 88 + Store 467 466 + 468: 149(fvec3) Load 458(if64v) + 469: 27(fvec2) VectorShuffle 468 468 0 1 + 470: 27(fvec2) DPdxFine 469 + 471: 149(fvec3) Load 456(f64v) + 472: 149(fvec3) VectorShuffle 471 470 3 4 2 + Store 456(f64v) 472 + 473: 149(fvec3) Load 458(if64v) + 474: 27(fvec2) VectorShuffle 473 473 0 1 + 475: 27(fvec2) DPdyFine 474 + 476: 149(fvec3) Load 456(f64v) + 477: 149(fvec3) VectorShuffle 476 475 3 4 2 + Store 456(f64v) 477 + 478: 149(fvec3) Load 458(if64v) + 479: 149(fvec3) DPdxCoarse 478 + Store 456(f64v) 479 + 480: 149(fvec3) Load 458(if64v) + 481: 149(fvec3) DPdxCoarse 480 + Store 456(f64v) 481 + 482: 459(ptr) AccessChain 458(if64v) 32 + 483: 26(float) Load 482 + 484: 26(float) Fwidth 483 + 485: 33(ptr) AccessChain 456(f64v) 32 + Store 485 484 + 486: 149(fvec3) Load 458(if64v) + 487: 27(fvec2) VectorShuffle 486 486 0 1 + 488: 27(fvec2) FwidthFine 487 + 489: 149(fvec3) Load 456(f64v) + 490: 149(fvec3) VectorShuffle 489 488 3 4 2 + Store 456(f64v) 490 + 491: 149(fvec3) Load 458(if64v) + 492: 149(fvec3) FwidthCoarse 491 + Store 456(f64v) 492 + 493: 459(ptr) AccessChain 458(if64v) 32 + 494: 26(float) ExtInst 1(GLSL.std.450) 76(InterpolateAtCentroid) 493 + 495: 33(ptr) AccessChain 456(f64v) 32 + Store 495 494 + 497: 149(fvec3) ExtInst 1(GLSL.std.450) 77(InterpolateAtSample) 458(if64v) 496 + 498: 27(fvec2) VectorShuffle 497 497 0 1 + 499: 149(fvec3) Load 456(f64v) + 500: 149(fvec3) VectorShuffle 499 498 3 4 2 + Store 456(f64v) 500 + 503: 149(fvec3) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 458(if64v) 502 + Store 456(f64v) 503 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.flowControl.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.flowControl.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.flowControl.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.flowControl.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.flowControl.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 39 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.for-complex-condition.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.for-complex-condition.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.for-complex-condition.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.for-complex-condition.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.for-complex-condition.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 31 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.for-continue-break.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.for-continue-break.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.for-continue-break.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.for-continue-break.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.for-continue-break.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 45 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.forLoop.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.forLoop.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.forLoop.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.forLoop.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.forLoop.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 131 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.for-nobody.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.for-nobody.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.for-nobody.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.for-nobody.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.for-nobody.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 25 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.for-notest.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.for-notest.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.for-notest.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.for-notest.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.for-notest.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 20 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.for-simple.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.for-simple.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.for-simple.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.for-simple.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.for-simple.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 24 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.forwardFun.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.forwardFun.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.forwardFun.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.forwardFun.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.forwardFun.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 60 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.fullyCovered.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.fullyCovered.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.fullyCovered.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.fullyCovered.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,37 @@ +spv.fullyCovered.frag +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 18 + + Capability Shader + Capability FragmentFullyCoveredEXT + Extension "SPV_EXT_fragment_fully_covered" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 12 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_NV_conservative_raster_underestimation" + Name 4 "main" + Name 9 "color" + Name 12 "gl_FragFullyCoveredNV" + Decorate 12(gl_FragFullyCoveredNV) BuiltIn FullyCoveredEXT + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(color): 8(ptr) Variable Output + 10: TypeBool + 11: TypePointer Input 10(bool) +12(gl_FragFullyCoveredNV): 11(ptr) Variable Input + 14: 6(float) Constant 0 + 15: 6(float) Constant 1065353216 + 4(main): 2 Function None 3 + 5: Label + 13: 10(bool) Load 12(gl_FragFullyCoveredNV) + 16: 6(float) Select 13 15 14 + 17: 7(fvec4) CompositeConstruct 16 14 14 14 + Store 9(color) 17 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.functionCall.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.functionCall.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.functionCall.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.functionCall.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -4,7 +4,7 @@ WARNING: 0:5: varying deprecated in version 130; may be removed in future release // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 76 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.functionNestedOpaque.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 39 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.functionSemantics.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.functionSemantics.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.functionSemantics.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.functionSemantics.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.functionSemantics.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 156 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.GeometryShaderPassthrough.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.GeometryShaderPassthrough.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.GeometryShaderPassthrough.geom.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.GeometryShaderPassthrough.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.GeometryShaderPassthrough.geom // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 15 Capability Geometry @@ -11,7 +11,7 @@ EntryPoint Geometry 4 "main" 10 14 ExecutionMode 4 Triangles ExecutionMode 4 Invocations 1 - ExecutionMode 4 OutputVertices + ExecutionMode 4 OutputVertices 3 Source GLSL 450 SourceExtension "GL_NV_geometry_shader_passthrough" Name 4 "main" diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.glFragColor.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.glFragColor.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.glFragColor.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.glFragColor.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.glFragColor.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 12 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.glsl.register.autoassign.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.glsl.register.autoassign.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.glsl.register.autoassign.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.glsl.register.autoassign.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.glsl.register.autoassign.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 142 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.glsl.register.noautoassign.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.glsl.register.noautoassign.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.glsl.register.noautoassign.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.glsl.register.noautoassign.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.glsl.register.noautoassign.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 142 Capability Shader @@ -41,19 +41,25 @@ Name 137 "FragColor" Name 141 "g_tTex_unused3" Decorate 17(g_tTex1) DescriptorSet 0 - Decorate 17(g_tTex1) Binding 11 + Decorate 17(g_tTex1) Binding 17 Decorate 21(g_sSamp1) DescriptorSet 0 Decorate 21(g_sSamp1) Binding 5 Decorate 27(g_tTex2) DescriptorSet 0 + Decorate 27(g_tTex2) Binding 18 Decorate 29(g_sSamp2) DescriptorSet 0 + Decorate 29(g_sSamp2) Binding 6 Decorate 39(g_tTex3) DescriptorSet 0 - Decorate 39(g_tTex3) Binding 13 + Decorate 39(g_tTex3) Binding 19 Decorate 46(g_sSamp3) DescriptorSet 0 Decorate 46(g_sSamp3) Binding 7 Decorate 64(g_tTex4) DescriptorSet 0 + Decorate 64(g_tTex4) Binding 20 Decorate 69(g_sSamp4) DescriptorSet 0 + Decorate 69(g_sSamp4) Binding 8 Decorate 84(g_tTex5) DescriptorSet 0 + Decorate 84(g_tTex5) Binding 21 Decorate 86(g_sSamp5) DescriptorSet 0 + Decorate 86(g_sSamp5) Binding 9 MemberDecorate 93(MyStruct_t) 0 Offset 0 MemberDecorate 93(MyStruct_t) 1 Offset 4 MemberDecorate 93(MyStruct_t) 2 Offset 16 @@ -65,13 +71,16 @@ Decorate 97 DescriptorSet 0 Decorate 97 Binding 19 Decorate 119(g_tTex_unused1) DescriptorSet 0 - Decorate 119(g_tTex_unused1) Binding 10 + Decorate 119(g_tTex_unused1) Binding 22 Decorate 121(g_sSamp_unused1) DescriptorSet 0 + Decorate 121(g_sSamp_unused1) Binding 10 Decorate 126(g_tTex_unused2) DescriptorSet 0 - Decorate 126(g_tTex_unused2) Binding 12 + Decorate 126(g_tTex_unused2) Binding 23 Decorate 128(g_sSamp_unused2) DescriptorSet 0 + Decorate 128(g_sSamp_unused2) Binding 11 Decorate 137(FragColor) Location 0 Decorate 141(g_tTex_unused3) DescriptorSet 0 + Decorate 141(g_tTex_unused3) Binding 24 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.hlslDebugInfo.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.hlslDebugInfo.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.hlslDebugInfo.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.hlslDebugInfo.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.hlslDebugInfo.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 19 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.hlslOffsets.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.hlslOffsets.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.hlslOffsets.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.hlslOffsets.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -18,7 +18,7 @@ 0:? 'anon@0' (layout( column_major std430) buffer block{layout( column_major std430) buffer highp float m0, layout( column_major std430) buffer highp 3-component vector of float m4, layout( column_major std430) buffer highp float m16, layout( column_major std430 offset=20) buffer highp 3-component vector of float m20, layout( column_major std430) buffer highp 3-component vector of float m32, layout( column_major std430) buffer highp 2-component vector of float m48, layout( column_major std430) buffer highp 2-component vector of float m56, layout( column_major std430) buffer highp float m64, layout( column_major std430) buffer highp 2-component vector of float m68, layout( column_major std430) buffer highp float m76, layout( column_major std430) buffer highp float m80, layout( column_major std430 offset=88) buffer highp 2-component vector of float m88, layout( column_major std430) buffer highp 2-component vector of float m96, layout( column_major std430) buffer 2-component vector of double m112}) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 14 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.image.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.image.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.image.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.image.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.image.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 376 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.imageLoadStoreLod.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 82 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.int16.amd.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.int16.amd.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.int16.amd.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.int16.amd.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,778 @@ +spv.int16.amd.frag +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 560 + + Capability Shader + Capability Float16 + Capability Float64 + Capability Int64 + Capability Int16 + Capability StorageUniform16 + Capability StorageInputOutput16 + Extension "SPV_AMD_gpu_shader_half_float" + Extension "SPV_AMD_gpu_shader_int16" + Extension "SPV_KHR_16bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 519 521 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_AMD_gpu_shader_half_float" + SourceExtension "GL_AMD_gpu_shader_int16" + SourceExtension "GL_ARB_gpu_shader_int64" + Name 4 "main" + Name 6 "literal(" + Name 8 "operators(" + Name 10 "typeCast(" + Name 12 "builtinFuncs(" + Name 16 "u16" + Name 25 "Uniforms" + MemberName 25(Uniforms) 0 "i" + Name 27 "" + Name 34 "indexable" + Name 45 "indexable" + Name 51 "u16v" + Name 57 "i16" + Name 70 "u16" + Name 127 "b" + Name 148 "u" + Name 159 "i" + Name 189 "i16v" + Name 192 "bv" + Name 200 "u16v" + Name 213 "iv" + Name 226 "uv" + Name 240 "fv" + Name 252 "dv" + Name 264 "f16v" + Name 276 "i64v" + Name 290 "u64v" + Name 305 "i16v" + Name 311 "i16" + Name 319 "u16v" + Name 321 "u16" + Name 393 "f16v" + Name 396 "exp" + Name 397 "ResType" + Name 418 "packi" + Name 423 "packu" + Name 432 "packi64" + Name 441 "packu64" + Name 450 "bv" + Name 515 "Block" + MemberName 515(Block) 0 "i16v" + MemberName 515(Block) 1 "u16" + Name 517 "block" + Name 519 "iu16v" + Name 521 "ii16" + Name 522 "si64" + Name 523 "su64" + Name 524 "si" + Name 525 "su" + Name 526 "sb" + Name 527 "si16" + Name 528 "su16" + MemberDecorate 25(Uniforms) 0 Offset 0 + Decorate 25(Uniforms) Block + Decorate 27 DescriptorSet 0 + Decorate 27 Binding 0 + MemberDecorate 515(Block) 0 Offset 0 + MemberDecorate 515(Block) 1 Offset 6 + Decorate 515(Block) Block + Decorate 517(block) DescriptorSet 0 + Decorate 517(block) Binding 1 + Decorate 519(iu16v) Flat + Decorate 519(iu16v) Location 0 + Decorate 521(ii16) Flat + Decorate 521(ii16) Location 1 + Decorate 522(si64) SpecId 100 + Decorate 523(su64) SpecId 101 + Decorate 524(si) SpecId 102 + Decorate 525(su) SpecId 103 + Decorate 526(sb) SpecId 104 + Decorate 527(si16) SpecId 105 + Decorate 528(su16) SpecId 106 + 2: TypeVoid + 3: TypeFunction 2 + 14: TypeInt 16 0 + 15: TypePointer Function 14(int) + 17: TypeInt 16 1 + 18: TypeInt 32 0 + 19: 18(int) Constant 3 + 20: TypeArray 17(int) 19 + 21: 17(int) Constant 273 + 22: 17(int) Constant 4294967294 + 23: 17(int) Constant 256 + 24: 20 ConstantComposite 21 22 23 + 25(Uniforms): TypeStruct 18(int) + 26: TypePointer Uniform 25(Uniforms) + 27: 26(ptr) Variable Uniform + 28: TypeInt 32 1 + 29: 28(int) Constant 0 + 30: TypePointer Uniform 18(int) + 33: TypePointer Function 20 + 35: TypePointer Function 17(int) + 39: TypeArray 14(int) 19 + 40: 14(int) Constant 65535 + 41: 39 ConstantComposite 40 40 40 + 44: TypePointer Function 39 + 49: TypeVector 14(int) 3 + 50: TypePointer Function 49(ivec3) + 53: 17(int) Constant 1 + 54: TypeVector 17(int) 3 + 111: 18(int) Constant 1 + 117: 18(int) Constant 2 + 125: TypeBool + 126: TypePointer Function 125(bool) + 128: 18(int) Constant 0 + 147: TypePointer Function 18(int) + 158: TypePointer Function 28(int) + 187: TypeVector 17(int) 2 + 188: TypePointer Function 187(ivec2) + 190: TypeVector 125(bool) 2 + 191: TypePointer Function 190(bvec2) + 194: 17(int) Constant 0 + 195: 187(ivec2) ConstantComposite 194 194 + 196: 187(ivec2) ConstantComposite 53 53 + 198: TypeVector 14(int) 2 + 199: TypePointer Function 198(ivec2) + 202: 14(int) Constant 0 + 203: 14(int) Constant 1 + 204: 198(ivec2) ConstantComposite 202 202 + 205: 198(ivec2) ConstantComposite 203 203 + 211: TypeVector 28(int) 2 + 212: TypePointer Function 211(ivec2) + 224: TypeVector 18(int) 2 + 225: TypePointer Function 224(ivec2) + 237: TypeFloat 32 + 238: TypeVector 237(float) 2 + 239: TypePointer Function 238(fvec2) + 249: TypeFloat 64 + 250: TypeVector 249(float) 2 + 251: TypePointer Function 250(fvec2) + 261: TypeFloat 16 + 262: TypeVector 261(float) 2 + 263: TypePointer Function 262(fvec2) + 273: TypeInt 64 1 + 274: TypeVector 273(int) 2 + 275: TypePointer Function 274(ivec2) + 287: TypeInt 64 0 + 288: TypeVector 287(int) 2 + 289: TypePointer Function 288(ivec2) + 316: 17(int) Constant 4294967295 + 317: 187(ivec2) ConstantComposite 316 316 + 326: 49(ivec3) ConstantComposite 202 202 202 + 368: 125(bool) ConstantTrue + 375: 125(bool) ConstantFalse + 376: 190(bvec2) ConstantComposite 375 375 + 388: TypeVector 125(bool) 3 + 389: 388(bvec3) ConstantComposite 375 375 375 + 391: TypeVector 261(float) 3 + 392: TypePointer Function 391(fvec3) + 395: TypePointer Function 54(ivec3) + 397(ResType): TypeStruct 391(fvec3) 54(ivec3) + 407: TypePointer Function 261(float) + 431: TypePointer Function 273(int) + 434: TypeVector 17(int) 4 + 440: TypePointer Function 287(int) + 443: TypeVector 14(int) 4 + 449: TypePointer Function 388(bvec3) + 515(Block): TypeStruct 54(ivec3) 14(int) + 516: TypePointer Uniform 515(Block) + 517(block): 516(ptr) Variable Uniform + 518: TypePointer Input 49(ivec3) + 519(iu16v): 518(ptr) Variable Input + 520: TypePointer Input 17(int) + 521(ii16): 520(ptr) Variable Input + 522(si64): 273(int) SpecConstant 4294967286 4294967295 + 523(su64): 287(int) SpecConstant 20 0 + 524(si): 28(int) SpecConstant 4294967291 + 525(su): 18(int) SpecConstant 4 + 526(sb): 125(bool) SpecConstantTrue + 527(si16): 17(int) SpecConstant 4294967291 + 528(su16): 14(int) SpecConstant 4 + 529: 125(bool) SpecConstantOp 171 527(si16) 202 + 530: 125(bool) SpecConstantOp 171 528(su16) 202 + 531: 17(int) SpecConstantOp 169 526(sb) 53 194 + 532: 14(int) SpecConstantOp 169 526(sb) 203 202 + 533: 28(int) SpecConstantOp 114 527(si16) + 534: 28(int) SpecConstantOp 113 528(su16) + 535: 28(int) SpecConstantOp 128 534 128 + 536: 17(int) SpecConstantOp 114 524(si) + 537: 17(int) SpecConstantOp 114 524(si) + 538: 14(int) SpecConstantOp 128 537 202 + 539: 28(int) SpecConstantOp 114 527(si16) + 540: 18(int) SpecConstantOp 128 539 128 + 541: 18(int) SpecConstantOp 113 528(su16) + 542: 17(int) SpecConstantOp 113 525(su) + 543: 17(int) SpecConstantOp 128 542 202 + 544: 14(int) SpecConstantOp 113 525(su) + 545: 273(int) SpecConstantOp 114 527(si16) + 546: 273(int) SpecConstantOp 113 528(su16) + 547: 287(int) Constant 0 0 + 548: 273(int) SpecConstantOp 128 546 547 + 549: 17(int) SpecConstantOp 114 522(si64) + 550: 17(int) SpecConstantOp 114 522(si64) + 551: 14(int) SpecConstantOp 128 550 202 + 552: 273(int) SpecConstantOp 114 527(si16) + 553: 287(int) SpecConstantOp 128 552 547 + 554: 287(int) SpecConstantOp 113 528(su16) + 555: 17(int) SpecConstantOp 113 523(su64) + 556: 17(int) SpecConstantOp 128 555 202 + 557: 14(int) SpecConstantOp 113 523(su64) + 558: 14(int) SpecConstantOp 128 527(si16) 202 + 559: 17(int) SpecConstantOp 128 528(su16) 202 + 4(main): 2 Function None 3 + 5: Label + 511: 2 FunctionCall 6(literal() + 512: 2 FunctionCall 8(operators() + 513: 2 FunctionCall 10(typeCast() + 514: 2 FunctionCall 12(builtinFuncs() + Return + FunctionEnd + 6(literal(): 2 Function None 3 + 7: Label + 16(u16): 15(ptr) Variable Function + 34(indexable): 33(ptr) Variable Function + 45(indexable): 44(ptr) Variable Function + 31: 30(ptr) AccessChain 27 29 + 32: 18(int) Load 31 + Store 34(indexable) 24 + 36: 35(ptr) AccessChain 34(indexable) 32 + 37: 17(int) Load 36 + 38: 14(int) Bitcast 37 + 42: 30(ptr) AccessChain 27 29 + 43: 18(int) Load 42 + Store 45(indexable) 41 + 46: 15(ptr) AccessChain 45(indexable) 43 + 47: 14(int) Load 46 + 48: 14(int) IAdd 38 47 + Store 16(u16) 48 + Return + FunctionEnd + 8(operators(): 2 Function None 3 + 9: Label + 51(u16v): 50(ptr) Variable Function + 57(i16): 35(ptr) Variable Function + 70(u16): 15(ptr) Variable Function + 127(b): 126(ptr) Variable Function + 148(u): 147(ptr) Variable Function + 159(i): 158(ptr) Variable Function + 52: 49(ivec3) Load 51(u16v) + 55: 54(ivec3) CompositeConstruct 53 53 53 + 56: 49(ivec3) IAdd 52 55 + Store 51(u16v) 56 + 58: 17(int) Load 57(i16) + 59: 17(int) ISub 58 53 + Store 57(i16) 59 + 60: 17(int) Load 57(i16) + 61: 17(int) IAdd 60 53 + Store 57(i16) 61 + 62: 49(ivec3) Load 51(u16v) + 63: 54(ivec3) CompositeConstruct 53 53 53 + 64: 49(ivec3) ISub 62 63 + Store 51(u16v) 64 + 65: 49(ivec3) Load 51(u16v) + 66: 49(ivec3) Not 65 + Store 51(u16v) 66 + 67: 17(int) Load 57(i16) + Store 57(i16) 67 + 68: 49(ivec3) Load 51(u16v) + 69: 49(ivec3) SNegate 68 + Store 51(u16v) 69 + 71: 17(int) Load 57(i16) + 72: 14(int) Bitcast 71 + 73: 14(int) Load 70(u16) + 74: 14(int) IAdd 73 72 + Store 70(u16) 74 + 75: 49(ivec3) Load 51(u16v) + 76: 49(ivec3) Load 51(u16v) + 77: 49(ivec3) ISub 76 75 + Store 51(u16v) 77 + 78: 17(int) Load 57(i16) + 79: 17(int) Load 57(i16) + 80: 17(int) IMul 79 78 + Store 57(i16) 80 + 81: 49(ivec3) Load 51(u16v) + 82: 49(ivec3) Load 51(u16v) + 83: 49(ivec3) UDiv 82 81 + Store 51(u16v) 83 + 84: 17(int) Load 57(i16) + 85: 14(int) Bitcast 84 + 86: 49(ivec3) Load 51(u16v) + 87: 49(ivec3) CompositeConstruct 85 85 85 + 88: 49(ivec3) UMod 86 87 + Store 51(u16v) 88 + 89: 49(ivec3) Load 51(u16v) + 90: 49(ivec3) Load 51(u16v) + 91: 49(ivec3) IAdd 89 90 + Store 51(u16v) 91 + 92: 17(int) Load 57(i16) + 93: 14(int) Bitcast 92 + 94: 14(int) Load 70(u16) + 95: 14(int) ISub 93 94 + Store 70(u16) 95 + 96: 49(ivec3) Load 51(u16v) + 97: 17(int) Load 57(i16) + 98: 14(int) Bitcast 97 + 99: 49(ivec3) CompositeConstruct 98 98 98 + 100: 49(ivec3) IMul 96 99 + Store 51(u16v) 100 + 101: 17(int) Load 57(i16) + 102: 17(int) Load 57(i16) + 103: 17(int) IMul 101 102 + Store 57(i16) 103 + 104: 17(int) Load 57(i16) + 105: 17(int) Load 57(i16) + 106: 17(int) SMod 104 105 + Store 57(i16) 106 + 107: 17(int) Load 57(i16) + 108: 49(ivec3) Load 51(u16v) + 109: 54(ivec3) CompositeConstruct 107 107 107 + 110: 49(ivec3) ShiftLeftLogical 108 109 + Store 51(u16v) 110 + 112: 15(ptr) AccessChain 51(u16v) 111 + 113: 14(int) Load 112 + 114: 17(int) Load 57(i16) + 115: 17(int) ShiftRightArithmetic 114 113 + Store 57(i16) 115 + 116: 17(int) Load 57(i16) + 118: 15(ptr) AccessChain 51(u16v) 117 + 119: 14(int) Load 118 + 120: 17(int) ShiftLeftLogical 116 119 + Store 57(i16) 120 + 121: 49(ivec3) Load 51(u16v) + 122: 17(int) Load 57(i16) + 123: 54(ivec3) CompositeConstruct 122 122 122 + 124: 49(ivec3) ShiftLeftLogical 121 123 + Store 51(u16v) 124 + 129: 15(ptr) AccessChain 51(u16v) 128 + 130: 14(int) Load 129 + 131: 17(int) Load 57(i16) + 132: 14(int) Bitcast 131 + 133: 125(bool) INotEqual 130 132 + Store 127(b) 133 + 134: 17(int) Load 57(i16) + 135: 14(int) Bitcast 134 + 136: 15(ptr) AccessChain 51(u16v) 128 + 137: 14(int) Load 136 + 138: 125(bool) IEqual 135 137 + Store 127(b) 138 + 139: 15(ptr) AccessChain 51(u16v) 128 + 140: 14(int) Load 139 + 141: 15(ptr) AccessChain 51(u16v) 111 + 142: 14(int) Load 141 + 143: 125(bool) UGreaterThan 140 142 + Store 127(b) 143 + 144: 17(int) Load 57(i16) + 145: 28(int) SConvert 144 + 146: 18(int) Bitcast 145 + 149: 18(int) Load 148(u) + 150: 125(bool) ULessThan 146 149 + Store 127(b) 150 + 151: 15(ptr) AccessChain 51(u16v) 111 + 152: 14(int) Load 151 + 153: 15(ptr) AccessChain 51(u16v) 128 + 154: 14(int) Load 153 + 155: 125(bool) UGreaterThanEqual 152 154 + Store 127(b) 155 + 156: 17(int) Load 57(i16) + 157: 28(int) SConvert 156 + 160: 28(int) Load 159(i) + 161: 125(bool) SLessThanEqual 157 160 + Store 127(b) 161 + 162: 17(int) Load 57(i16) + 163: 14(int) Bitcast 162 + 164: 49(ivec3) Load 51(u16v) + 165: 49(ivec3) CompositeConstruct 163 163 163 + 166: 49(ivec3) BitwiseOr 164 165 + Store 51(u16v) 166 + 167: 17(int) Load 57(i16) + 168: 14(int) Bitcast 167 + 169: 14(int) Load 70(u16) + 170: 14(int) BitwiseOr 168 169 + Store 70(u16) 170 + 171: 17(int) Load 57(i16) + 172: 17(int) Load 57(i16) + 173: 17(int) BitwiseAnd 172 171 + Store 57(i16) 173 + 174: 49(ivec3) Load 51(u16v) + 175: 49(ivec3) Load 51(u16v) + 176: 49(ivec3) BitwiseAnd 174 175 + Store 51(u16v) 176 + 177: 17(int) Load 57(i16) + 178: 14(int) Bitcast 177 + 179: 49(ivec3) Load 51(u16v) + 180: 49(ivec3) CompositeConstruct 178 178 178 + 181: 49(ivec3) BitwiseXor 179 180 + Store 51(u16v) 181 + 182: 49(ivec3) Load 51(u16v) + 183: 17(int) Load 57(i16) + 184: 14(int) Bitcast 183 + 185: 49(ivec3) CompositeConstruct 184 184 184 + 186: 49(ivec3) BitwiseXor 182 185 + Store 51(u16v) 186 + Return + FunctionEnd + 10(typeCast(): 2 Function None 3 + 11: Label + 189(i16v): 188(ptr) Variable Function + 192(bv): 191(ptr) Variable Function + 200(u16v): 199(ptr) Variable Function + 213(iv): 212(ptr) Variable Function + 226(uv): 225(ptr) Variable Function + 240(fv): 239(ptr) Variable Function + 252(dv): 251(ptr) Variable Function + 264(f16v): 263(ptr) Variable Function + 276(i64v): 275(ptr) Variable Function + 290(u64v): 289(ptr) Variable Function + 193: 190(bvec2) Load 192(bv) + 197: 187(ivec2) Select 193 196 195 + Store 189(i16v) 197 + 201: 190(bvec2) Load 192(bv) + 206: 198(ivec2) Select 201 205 204 + Store 200(u16v) 206 + 207: 187(ivec2) Load 189(i16v) + 208: 190(bvec2) INotEqual 207 204 + Store 192(bv) 208 + 209: 198(ivec2) Load 200(u16v) + 210: 190(bvec2) INotEqual 209 204 + Store 192(bv) 210 + 214: 211(ivec2) Load 213(iv) + 215: 187(ivec2) SConvert 214 + Store 189(i16v) 215 + 216: 211(ivec2) Load 213(iv) + 217: 187(ivec2) SConvert 216 + 218: 198(ivec2) Bitcast 217 + Store 200(u16v) 218 + 219: 187(ivec2) Load 189(i16v) + 220: 211(ivec2) SConvert 219 + Store 213(iv) 220 + 221: 198(ivec2) Load 200(u16v) + 222: 211(ivec2) UConvert 221 + 223: 211(ivec2) Bitcast 222 + Store 213(iv) 223 + 227: 224(ivec2) Load 226(uv) + 228: 187(ivec2) UConvert 227 + 229: 187(ivec2) Bitcast 228 + Store 189(i16v) 229 + 230: 224(ivec2) Load 226(uv) + 231: 198(ivec2) UConvert 230 + Store 200(u16v) 231 + 232: 187(ivec2) Load 189(i16v) + 233: 211(ivec2) SConvert 232 + 234: 224(ivec2) Bitcast 233 + Store 226(uv) 234 + 235: 198(ivec2) Load 200(u16v) + 236: 224(ivec2) UConvert 235 + Store 226(uv) 236 + 241: 238(fvec2) Load 240(fv) + 242: 187(ivec2) ConvertFToS 241 + Store 189(i16v) 242 + 243: 238(fvec2) Load 240(fv) + 244: 198(ivec2) ConvertFToU 243 + Store 200(u16v) 244 + 245: 187(ivec2) Load 189(i16v) + 246: 238(fvec2) ConvertSToF 245 + Store 240(fv) 246 + 247: 198(ivec2) Load 200(u16v) + 248: 238(fvec2) ConvertUToF 247 + Store 240(fv) 248 + 253: 250(fvec2) Load 252(dv) + 254: 187(ivec2) ConvertFToS 253 + Store 189(i16v) 254 + 255: 250(fvec2) Load 252(dv) + 256: 198(ivec2) ConvertFToU 255 + Store 200(u16v) 256 + 257: 187(ivec2) Load 189(i16v) + 258: 250(fvec2) ConvertSToF 257 + Store 252(dv) 258 + 259: 198(ivec2) Load 200(u16v) + 260: 250(fvec2) ConvertUToF 259 + Store 252(dv) 260 + 265: 262(fvec2) Load 264(f16v) + 266: 187(ivec2) ConvertFToS 265 + Store 189(i16v) 266 + 267: 262(fvec2) Load 264(f16v) + 268: 198(ivec2) ConvertFToU 267 + Store 200(u16v) 268 + 269: 187(ivec2) Load 189(i16v) + 270: 262(fvec2) ConvertSToF 269 + Store 264(f16v) 270 + 271: 198(ivec2) Load 200(u16v) + 272: 262(fvec2) ConvertUToF 271 + Store 264(f16v) 272 + 277: 274(ivec2) Load 276(i64v) + 278: 187(ivec2) SConvert 277 + Store 189(i16v) 278 + 279: 274(ivec2) Load 276(i64v) + 280: 187(ivec2) SConvert 279 + 281: 198(ivec2) Bitcast 280 + Store 200(u16v) 281 + 282: 187(ivec2) Load 189(i16v) + 283: 274(ivec2) SConvert 282 + Store 276(i64v) 283 + 284: 198(ivec2) Load 200(u16v) + 285: 274(ivec2) UConvert 284 + 286: 274(ivec2) Bitcast 285 + Store 276(i64v) 286 + 291: 288(ivec2) Load 290(u64v) + 292: 187(ivec2) UConvert 291 + 293: 187(ivec2) Bitcast 292 + Store 189(i16v) 293 + 294: 288(ivec2) Load 290(u64v) + 295: 198(ivec2) UConvert 294 + Store 200(u16v) 295 + 296: 187(ivec2) Load 189(i16v) + 297: 274(ivec2) SConvert 296 + 298: 288(ivec2) Bitcast 297 + Store 290(u64v) 298 + 299: 198(ivec2) Load 200(u16v) + 300: 288(ivec2) UConvert 299 + Store 290(u64v) 300 + 301: 198(ivec2) Load 200(u16v) + 302: 187(ivec2) Bitcast 301 + Store 189(i16v) 302 + 303: 187(ivec2) Load 189(i16v) + 304: 198(ivec2) Bitcast 303 + Store 200(u16v) 304 + Return + FunctionEnd +12(builtinFuncs(): 2 Function None 3 + 13: Label + 305(i16v): 188(ptr) Variable Function + 311(i16): 35(ptr) Variable Function + 319(u16v): 50(ptr) Variable Function + 321(u16): 15(ptr) Variable Function + 393(f16v): 392(ptr) Variable Function + 396(exp): 395(ptr) Variable Function + 418(packi): 158(ptr) Variable Function + 423(packu): 147(ptr) Variable Function + 432(packi64): 431(ptr) Variable Function + 441(packu64): 440(ptr) Variable Function + 450(bv): 449(ptr) Variable Function + 306: 187(ivec2) Load 305(i16v) + 307: 187(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 306 + Store 305(i16v) 307 + 308: 187(ivec2) Load 305(i16v) + 309: 187(ivec2) ExtInst 1(GLSL.std.450) 7(SSign) 308 + Store 305(i16v) 309 + 310: 187(ivec2) Load 305(i16v) + 312: 17(int) Load 311(i16) + 313: 187(ivec2) CompositeConstruct 312 312 + 314: 187(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 310 313 + Store 305(i16v) 314 + 315: 187(ivec2) Load 305(i16v) + 318: 187(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 315 317 + Store 305(i16v) 318 + 320: 49(ivec3) Load 319(u16v) + 322: 14(int) Load 321(u16) + 323: 49(ivec3) CompositeConstruct 322 322 322 + 324: 49(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 320 323 + Store 319(u16v) 324 + 325: 49(ivec3) Load 319(u16v) + 327: 49(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 325 326 + Store 319(u16v) 327 + 328: 187(ivec2) Load 305(i16v) + 329: 17(int) Load 311(i16) + 330: 187(ivec2) CompositeConstruct 329 329 + 331: 187(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 328 330 + Store 305(i16v) 331 + 332: 187(ivec2) Load 305(i16v) + 333: 187(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 332 317 + Store 305(i16v) 333 + 334: 49(ivec3) Load 319(u16v) + 335: 14(int) Load 321(u16) + 336: 49(ivec3) CompositeConstruct 335 335 335 + 337: 49(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 334 336 + Store 319(u16v) 337 + 338: 49(ivec3) Load 319(u16v) + 339: 49(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 338 326 + Store 319(u16v) 339 + 340: 187(ivec2) Load 305(i16v) + 341: 17(int) Load 311(i16) + 342: 17(int) SNegate 341 + 343: 17(int) Load 311(i16) + 344: 187(ivec2) CompositeConstruct 342 342 + 345: 187(ivec2) CompositeConstruct 343 343 + 346: 187(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 340 344 345 + Store 305(i16v) 346 + 347: 187(ivec2) Load 305(i16v) + 348: 187(ivec2) Load 305(i16v) + 349: 187(ivec2) SNegate 348 + 350: 187(ivec2) Load 305(i16v) + 351: 187(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 347 349 350 + Store 305(i16v) 351 + 352: 49(ivec3) Load 319(u16v) + 353: 14(int) Load 321(u16) + 354: 14(int) SNegate 353 + 355: 14(int) Load 321(u16) + 356: 49(ivec3) CompositeConstruct 354 354 354 + 357: 49(ivec3) CompositeConstruct 355 355 355 + 358: 49(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 352 356 357 + Store 319(u16v) 358 + 359: 49(ivec3) Load 319(u16v) + 360: 49(ivec3) Load 319(u16v) + 361: 49(ivec3) SNegate 360 + 362: 49(ivec3) Load 319(u16v) + 363: 49(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 359 361 362 + Store 319(u16v) 363 + 364: 35(ptr) AccessChain 305(i16v) 128 + 365: 17(int) Load 364 + 366: 35(ptr) AccessChain 305(i16v) 111 + 367: 17(int) Load 366 + 369: 17(int) Select 368 367 365 + Store 311(i16) 369 + 370: 17(int) Load 311(i16) + 371: 187(ivec2) CompositeConstruct 370 370 + 372: 17(int) Load 311(i16) + 373: 17(int) SNegate 372 + 374: 187(ivec2) CompositeConstruct 373 373 + 377: 187(ivec2) Select 376 374 371 + Store 305(i16v) 377 + 378: 15(ptr) AccessChain 319(u16v) 128 + 379: 14(int) Load 378 + 380: 15(ptr) AccessChain 319(u16v) 111 + 381: 14(int) Load 380 + 382: 14(int) Select 368 381 379 + Store 321(u16) 382 + 383: 14(int) Load 321(u16) + 384: 49(ivec3) CompositeConstruct 383 383 383 + 385: 14(int) Load 321(u16) + 386: 14(int) SNegate 385 + 387: 49(ivec3) CompositeConstruct 386 386 386 + 390: 49(ivec3) Select 389 387 384 + Store 319(u16v) 390 + 394: 391(fvec3) Load 393(f16v) + 398:397(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 394 + 399: 54(ivec3) CompositeExtract 398 1 + Store 396(exp) 399 + 400: 391(fvec3) CompositeExtract 398 0 + Store 393(f16v) 400 + 401: 391(fvec3) Load 393(f16v) + 402: 54(ivec3) Load 396(exp) + 403: 391(fvec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 401 402 + Store 393(f16v) 403 + 404: 391(fvec3) Load 393(f16v) + 405: 262(fvec2) VectorShuffle 404 404 0 1 + 406: 187(ivec2) Bitcast 405 + Store 305(i16v) 406 + 408: 407(ptr) AccessChain 393(f16v) 117 + 409: 261(float) Load 408 + 410: 14(int) Bitcast 409 + 411: 15(ptr) AccessChain 319(u16v) 128 + Store 411 410 + 412: 187(ivec2) Load 305(i16v) + 413: 262(fvec2) Bitcast 412 + 414: 391(fvec3) Load 393(f16v) + 415: 391(fvec3) VectorShuffle 414 413 3 4 2 + Store 393(f16v) 415 + 416: 49(ivec3) Load 319(u16v) + 417: 391(fvec3) Bitcast 416 + Store 393(f16v) 417 + 419: 187(ivec2) Load 305(i16v) + 420: 28(int) Bitcast 419 + Store 418(packi) 420 + 421: 28(int) Load 418(packi) + 422: 187(ivec2) Bitcast 421 + Store 305(i16v) 422 + 424: 49(ivec3) Load 319(u16v) + 425: 198(ivec2) VectorShuffle 424 424 0 1 + 426: 18(int) Bitcast 425 + Store 423(packu) 426 + 427: 18(int) Load 423(packu) + 428: 198(ivec2) Bitcast 427 + 429: 49(ivec3) Load 319(u16v) + 430: 49(ivec3) VectorShuffle 429 428 3 4 2 + Store 319(u16v) 430 + 433: 17(int) Load 311(i16) + 435: 434(ivec4) CompositeConstruct 433 433 433 433 + 436: 273(int) Bitcast 435 + Store 432(packi64) 436 + 437: 273(int) Load 432(packi64) + 438: 434(ivec4) Bitcast 437 + 439: 187(ivec2) VectorShuffle 438 438 0 1 + Store 305(i16v) 439 + 442: 14(int) Load 321(u16) + 444: 443(ivec4) CompositeConstruct 442 442 442 442 + 445: 287(int) Bitcast 444 + Store 441(packu64) 445 + 446: 287(int) Load 441(packu64) + 447: 443(ivec4) Bitcast 446 + 448: 49(ivec3) VectorShuffle 447 447 0 1 2 + Store 319(u16v) 448 + 451: 49(ivec3) Load 319(u16v) + 452: 14(int) Load 321(u16) + 453: 49(ivec3) CompositeConstruct 452 452 452 + 454: 388(bvec3) ULessThan 451 453 + Store 450(bv) 454 + 455: 187(ivec2) Load 305(i16v) + 456: 17(int) Load 311(i16) + 457: 187(ivec2) CompositeConstruct 456 456 + 458: 190(bvec2) SLessThan 455 457 + 459: 388(bvec3) Load 450(bv) + 460: 388(bvec3) VectorShuffle 459 458 3 4 2 + Store 450(bv) 460 + 461: 49(ivec3) Load 319(u16v) + 462: 14(int) Load 321(u16) + 463: 49(ivec3) CompositeConstruct 462 462 462 + 464: 388(bvec3) ULessThanEqual 461 463 + Store 450(bv) 464 + 465: 187(ivec2) Load 305(i16v) + 466: 17(int) Load 311(i16) + 467: 187(ivec2) CompositeConstruct 466 466 + 468: 190(bvec2) SLessThanEqual 465 467 + 469: 388(bvec3) Load 450(bv) + 470: 388(bvec3) VectorShuffle 469 468 3 4 2 + Store 450(bv) 470 + 471: 49(ivec3) Load 319(u16v) + 472: 14(int) Load 321(u16) + 473: 49(ivec3) CompositeConstruct 472 472 472 + 474: 388(bvec3) UGreaterThan 471 473 + Store 450(bv) 474 + 475: 187(ivec2) Load 305(i16v) + 476: 17(int) Load 311(i16) + 477: 187(ivec2) CompositeConstruct 476 476 + 478: 190(bvec2) SGreaterThan 475 477 + 479: 388(bvec3) Load 450(bv) + 480: 388(bvec3) VectorShuffle 479 478 3 4 2 + Store 450(bv) 480 + 481: 49(ivec3) Load 319(u16v) + 482: 14(int) Load 321(u16) + 483: 49(ivec3) CompositeConstruct 482 482 482 + 484: 388(bvec3) UGreaterThanEqual 481 483 + Store 450(bv) 484 + 485: 187(ivec2) Load 305(i16v) + 486: 17(int) Load 311(i16) + 487: 187(ivec2) CompositeConstruct 486 486 + 488: 190(bvec2) SGreaterThanEqual 485 487 + 489: 388(bvec3) Load 450(bv) + 490: 388(bvec3) VectorShuffle 489 488 3 4 2 + Store 450(bv) 490 + 491: 49(ivec3) Load 319(u16v) + 492: 14(int) Load 321(u16) + 493: 49(ivec3) CompositeConstruct 492 492 492 + 494: 388(bvec3) IEqual 491 493 + Store 450(bv) 494 + 495: 187(ivec2) Load 305(i16v) + 496: 17(int) Load 311(i16) + 497: 187(ivec2) CompositeConstruct 496 496 + 498: 190(bvec2) IEqual 495 497 + 499: 388(bvec3) Load 450(bv) + 500: 388(bvec3) VectorShuffle 499 498 3 4 2 + Store 450(bv) 500 + 501: 49(ivec3) Load 319(u16v) + 502: 14(int) Load 321(u16) + 503: 49(ivec3) CompositeConstruct 502 502 502 + 504: 388(bvec3) INotEqual 501 503 + Store 450(bv) 504 + 505: 187(ivec2) Load 305(i16v) + 506: 17(int) Load 311(i16) + 507: 187(ivec2) CompositeConstruct 506 506 + 508: 190(bvec2) INotEqual 505 507 + 509: 388(bvec3) Load 450(bv) + 510: 388(bvec3) VectorShuffle 509 508 3 4 2 + Store 450(bv) 510 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.int16.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.int16.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.int16.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.int16.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,779 +1,744 @@ spv.int16.frag // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 561 +// Generated by (magic number): 80006 +// Id's are bound by 523 Capability Shader Capability Float16 Capability Float64 Capability Int64 Capability Int16 + Capability Int8 Capability StorageUniform16 - Capability StorageInputOutput16 Extension "SPV_AMD_gpu_shader_half_float" Extension "SPV_AMD_gpu_shader_int16" Extension "SPV_KHR_16bit_storage" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 520 522 + EntryPoint Fragment 4 "main" ExecutionMode 4 OriginUpperLeft Source GLSL 450 - SourceExtension "GL_AMD_gpu_shader_half_float" - SourceExtension "GL_AMD_gpu_shader_int16" - SourceExtension "GL_ARB_gpu_shader_int64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" Name 4 "main" Name 6 "literal(" - Name 8 "operators(" - Name 10 "typeCast(" + Name 8 "typeCast16(" + Name 10 "operators(" Name 12 "builtinFuncs(" - Name 16 "u16" - Name 25 "Uniforms" - MemberName 25(Uniforms) 0 "i" - Name 27 "" - Name 34 "indexable" - Name 45 "indexable" - Name 51 "u16v" - Name 57 "i16" - Name 70 "u16" - Name 108 "i" - Name 130 "b" - Name 151 "u" - Name 190 "i16v" - Name 193 "bv" - Name 201 "u16v" - Name 214 "iv" + Name 16 "i16" + Name 24 "Uniforms" + MemberName 24(Uniforms) 0 "index" + Name 26 "" + Name 33 "indexable" + Name 38 "u16" + Name 46 "indexable" + Name 51 "i32v" + Name 54 "i16v" + Name 59 "u16v" + Name 67 "u32v" + Name 74 "i64v" + Name 80 "u64v" + Name 94 "f16v" + Name 100 "f32v" + Name 106 "f64v" + Name 154 "i8v" + Name 163 "u8v" + Name 176 "bv" + Name 195 "u16v" + Name 200 "i16" + Name 220 "i" Name 227 "uv" - Name 241 "fv" - Name 253 "dv" - Name 265 "f16v" - Name 277 "i64v" - Name 291 "u64v" - Name 306 "i16v" - Name 312 "i16" - Name 320 "u16v" - Name 322 "u16" - Name 394 "f16v" - Name 397 "exp" - Name 398 "ResType" - Name 419 "packi" - Name 424 "packu" - Name 433 "packi64" - Name 442 "packu64" - Name 451 "bv" - Name 516 "Block" - MemberName 516(Block) 0 "i16v" - MemberName 516(Block) 1 "u16" - Name 518 "block" - Name 520 "iu16v" - Name 522 "ii16" - Name 523 "si64" - Name 524 "su64" - Name 525 "si" - Name 526 "su" - Name 527 "sb" - Name 528 "si16" - Name 529 "su16" - MemberDecorate 25(Uniforms) 0 Offset 0 - Decorate 25(Uniforms) Block - Decorate 27 DescriptorSet 0 - Decorate 27 Binding 0 - MemberDecorate 516(Block) 0 Offset 0 - MemberDecorate 516(Block) 1 Offset 6 - Decorate 516(Block) Block - Decorate 518(block) DescriptorSet 0 - Decorate 518(block) Binding 1 - Decorate 520(iu16v) Flat - Decorate 520(iu16v) Location 0 - Decorate 522(ii16) Flat - Decorate 522(ii16) Location 1 - Decorate 523(si64) SpecId 100 - Decorate 524(su64) SpecId 101 - Decorate 525(si) SpecId 102 - Decorate 526(su) SpecId 103 - Decorate 527(sb) SpecId 104 - Decorate 528(si16) SpecId 105 - Decorate 529(su16) SpecId 106 + Name 243 "i64" + Name 281 "b" + Name 343 "i16v" + Name 346 "i16" + Name 356 "u16v" + Name 358 "u16" + Name 428 "i32" + Name 431 "i64" + Name 434 "i16v4" + Name 437 "u32" + Name 438 "u16v2" + Name 442 "u64" + Name 445 "u16v4" + Name 457 "bv" + Name 518 "Block" + MemberName 518(Block) 0 "i16" + MemberName 518(Block) 1 "i16v2" + MemberName 518(Block) 2 "i16v3" + MemberName 518(Block) 3 "i16v4" + MemberName 518(Block) 4 "u16" + MemberName 518(Block) 5 "u16v2" + MemberName 518(Block) 6 "u16v3" + MemberName 518(Block) 7 "u16v4" + Name 520 "block" + Name 521 "si16" + Name 522 "su16" + MemberDecorate 24(Uniforms) 0 Offset 0 + Decorate 24(Uniforms) Block + Decorate 26 DescriptorSet 0 + Decorate 26 Binding 0 + MemberDecorate 518(Block) 0 Offset 0 + MemberDecorate 518(Block) 1 Offset 4 + MemberDecorate 518(Block) 2 Offset 8 + MemberDecorate 518(Block) 3 Offset 16 + MemberDecorate 518(Block) 4 Offset 24 + MemberDecorate 518(Block) 5 Offset 28 + MemberDecorate 518(Block) 6 Offset 32 + MemberDecorate 518(Block) 7 Offset 40 + Decorate 518(Block) Block + Decorate 520(block) DescriptorSet 0 + Decorate 520(block) Binding 1 + Decorate 521(si16) SpecId 100 + Decorate 522(su16) SpecId 101 2: TypeVoid 3: TypeFunction 2 - 14: TypeInt 16 0 + 14: TypeInt 16 1 15: TypePointer Function 14(int) - 17: TypeInt 16 1 - 18: TypeInt 32 0 - 19: 18(int) Constant 3 - 20: TypeArray 17(int) 19 - 21: 17(int) Constant 273 - 22: 17(int) Constant 65534 - 23: 17(int) Constant 256 - 24: 20 ConstantComposite 21 22 23 - 25(Uniforms): TypeStruct 18(int) - 26: TypePointer Uniform 25(Uniforms) - 27: 26(ptr) Variable Uniform - 28: TypeInt 32 1 - 29: 28(int) Constant 0 - 30: TypePointer Uniform 18(int) - 33: TypePointer Function 20 - 35: TypePointer Function 17(int) - 39: TypeArray 14(int) 19 - 40: 14(int) Constant 65535 - 41: 39 ConstantComposite 40 40 40 - 44: TypePointer Function 39 - 49: TypeVector 14(int) 3 - 50: TypePointer Function 49(ivec3) - 53: 17(int) Constant 1 - 54: TypeVector 17(int) 3 - 107: TypePointer Function 28(int) - 111: TypeVector 28(int) 3 - 114: 18(int) Constant 1 - 120: 18(int) Constant 2 - 128: TypeBool - 129: TypePointer Function 128(bool) - 131: 18(int) Constant 0 - 150: TypePointer Function 18(int) - 188: TypeVector 17(int) 2 - 189: TypePointer Function 188(ivec2) - 191: TypeVector 128(bool) 2 - 192: TypePointer Function 191(bvec2) - 195: 17(int) Constant 0 - 196: 188(ivec2) ConstantComposite 195 195 - 197: 188(ivec2) ConstantComposite 53 53 - 199: TypeVector 14(int) 2 - 200: TypePointer Function 199(ivec2) - 203: 14(int) Constant 0 - 204: 14(int) Constant 1 - 205: 199(ivec2) ConstantComposite 203 203 - 206: 199(ivec2) ConstantComposite 204 204 - 212: TypeVector 28(int) 2 - 213: TypePointer Function 212(ivec2) - 223: TypeVector 18(int) 2 - 226: TypePointer Function 223(ivec2) - 238: TypeFloat 32 - 239: TypeVector 238(float) 2 - 240: TypePointer Function 239(fvec2) - 250: TypeFloat 64 - 251: TypeVector 250(float) 2 - 252: TypePointer Function 251(fvec2) - 262: TypeFloat 16 - 263: TypeVector 262(float) 2 - 264: TypePointer Function 263(fvec2) - 274: TypeInt 64 1 - 275: TypeVector 274(int) 2 - 276: TypePointer Function 275(ivec2) - 286: TypeInt 64 0 - 287: TypeVector 286(int) 2 - 290: TypePointer Function 287(ivec2) - 317: 17(int) Constant 65535 - 318: 188(ivec2) ConstantComposite 317 317 - 327: 49(ivec3) ConstantComposite 203 203 203 - 369: 128(bool) ConstantTrue - 376: 128(bool) ConstantFalse - 377: 191(bvec2) ConstantComposite 376 376 - 389: TypeVector 128(bool) 3 - 390: 389(bvec3) ConstantComposite 376 376 376 - 392: TypeVector 262(float) 3 - 393: TypePointer Function 392(fvec3) - 396: TypePointer Function 54(ivec3) - 398(ResType): TypeStruct 392(fvec3) 54(ivec3) - 408: TypePointer Function 262(float) - 432: TypePointer Function 274(int) - 435: TypeVector 17(int) 4 - 441: TypePointer Function 286(int) - 444: TypeVector 14(int) 4 - 450: TypePointer Function 389(bvec3) - 516(Block): TypeStruct 54(ivec3) 14(int) - 517: TypePointer Uniform 516(Block) - 518(block): 517(ptr) Variable Uniform - 519: TypePointer Input 49(ivec3) - 520(iu16v): 519(ptr) Variable Input - 521: TypePointer Input 17(int) - 522(ii16): 521(ptr) Variable Input - 523(si64): 274(int) SpecConstant 4294967286 4294967295 - 524(su64): 286(int) SpecConstant 20 0 - 525(si): 28(int) SpecConstant 4294967291 - 526(su): 18(int) SpecConstant 4 - 527(sb): 128(bool) SpecConstantTrue - 528(si16): 17(int) SpecConstant 65531 - 529(su16): 14(int) SpecConstant 4 - 530: 128(bool) SpecConstantOp 171 528(si16) 203 - 531: 128(bool) SpecConstantOp 171 529(su16) 203 - 532: 17(int) SpecConstantOp 169 527(sb) 53 195 - 533: 14(int) SpecConstantOp 169 527(sb) 204 203 - 534: 28(int) SpecConstantOp 114 528(si16) - 535: 18(int) SpecConstantOp 113 529(su16) - 536: 28(int) SpecConstantOp 128 535 131 - 537: 17(int) SpecConstantOp 114 525(si) - 538: 17(int) SpecConstantOp 114 525(si) - 539: 14(int) SpecConstantOp 128 538 203 - 540: 28(int) SpecConstantOp 114 528(si16) - 541: 18(int) SpecConstantOp 128 540 131 - 542: 18(int) SpecConstantOp 113 529(su16) - 543: 14(int) SpecConstantOp 113 526(su) - 544: 17(int) SpecConstantOp 128 543 203 - 545: 14(int) SpecConstantOp 113 526(su) - 546: 274(int) SpecConstantOp 114 528(si16) - 547: 286(int) SpecConstantOp 113 529(su16) - 548: 286(int) Constant 0 0 - 549: 274(int) SpecConstantOp 128 547 548 - 550: 17(int) SpecConstantOp 114 523(si64) - 551: 17(int) SpecConstantOp 114 523(si64) - 552: 14(int) SpecConstantOp 128 551 203 - 553: 274(int) SpecConstantOp 114 528(si16) - 554: 286(int) SpecConstantOp 128 553 548 - 555: 286(int) SpecConstantOp 113 529(su16) - 556: 14(int) SpecConstantOp 113 524(su64) - 557: 17(int) SpecConstantOp 128 556 203 - 558: 14(int) SpecConstantOp 113 524(su64) - 559: 14(int) SpecConstantOp 128 528(si16) 203 - 560: 17(int) SpecConstantOp 128 529(su16) 203 + 17: TypeInt 32 0 + 18: 17(int) Constant 3 + 19: TypeArray 14(int) 18 + 20: 14(int) Constant 4294962927 + 21: 14(int) Constant 4294967295 + 22: 14(int) Constant 16384 + 23: 19 ConstantComposite 20 21 22 + 24(Uniforms): TypeStruct 17(int) + 25: TypePointer Uniform 24(Uniforms) + 26: 25(ptr) Variable Uniform + 27: TypeInt 32 1 + 28: 27(int) Constant 0 + 29: TypePointer Uniform 17(int) + 32: TypePointer Function 19 + 36: TypeInt 16 0 + 37: TypePointer Function 36(int) + 39: TypeArray 36(int) 18 + 40: 36(int) Constant 65535 + 41: 36(int) Constant 32767 + 42: 39 ConstantComposite 40 40 41 + 45: TypePointer Function 39 + 49: TypeVector 27(int) 2 + 50: TypePointer Function 49(ivec2) + 52: TypeVector 14(int) 2 + 53: TypePointer Function 52(ivec2) + 57: TypeVector 36(int) 2 + 58: TypePointer Function 57(ivec2) + 65: TypeVector 17(int) 2 + 66: TypePointer Function 65(ivec2) + 71: TypeInt 64 1 + 72: TypeVector 71(int) 2 + 73: TypePointer Function 72(ivec2) + 77: TypeInt 64 0 + 78: TypeVector 77(int) 2 + 79: TypePointer Function 78(ivec2) + 91: TypeFloat 16 + 92: TypeVector 91(float) 2 + 93: TypePointer Function 92(fvec2) + 97: TypeFloat 32 + 98: TypeVector 97(float) 2 + 99: TypePointer Function 98(fvec2) + 103: TypeFloat 64 + 104: TypeVector 103(float) 2 + 105: TypePointer Function 104(fvec2) + 151: TypeInt 8 1 + 152: TypeVector 151(int) 2 + 153: TypePointer Function 152(ivec2) + 160: TypeInt 8 0 + 161: TypeVector 160(int) 2 + 162: TypePointer Function 161(ivec2) + 173: TypeBool + 174: TypeVector 173(bool) 2 + 175: TypePointer Function 174(bvec2) + 178: 14(int) Constant 0 + 179: 14(int) Constant 1 + 180: 52(ivec2) ConstantComposite 178 178 + 181: 52(ivec2) ConstantComposite 179 179 + 184: 36(int) Constant 0 + 185: 36(int) Constant 1 + 186: 57(ivec2) ConstantComposite 184 184 + 187: 57(ivec2) ConstantComposite 185 185 + 193: TypeVector 36(int) 3 + 194: TypePointer Function 193(ivec3) + 197: TypeVector 14(int) 3 + 219: TypePointer Function 27(int) + 225: TypeVector 17(int) 3 + 226: TypePointer Function 225(ivec3) + 242: TypePointer Function 71(int) + 264: 17(int) Constant 1 + 270: 17(int) Constant 2 + 276: TypeVector 27(int) 3 + 280: TypePointer Function 173(bool) + 282: 17(int) Constant 0 + 296: TypePointer Function 17(int) + 354: 52(ivec2) ConstantComposite 21 21 + 363: 193(ivec3) ConstantComposite 184 184 184 + 405: 173(bool) ConstantTrue + 412: 173(bool) ConstantFalse + 413: 174(bvec2) ConstantComposite 412 412 + 425: TypeVector 173(bool) 3 + 426: 425(bvec3) ConstantComposite 412 412 412 + 432: TypeVector 14(int) 4 + 433: TypePointer Function 432(ivec4) + 441: TypePointer Function 77(int) + 443: TypeVector 36(int) 4 + 444: TypePointer Function 443(ivec4) + 456: TypePointer Function 425(bvec3) + 518(Block): TypeStruct 14(int) 52(ivec2) 197(ivec3) 432(ivec4) 36(int) 57(ivec2) 193(ivec3) 443(ivec4) + 519: TypePointer Uniform 518(Block) + 520(block): 519(ptr) Variable Uniform + 521(si16): 14(int) SpecConstant 4294967286 + 522(su16): 36(int) SpecConstant 20 4(main): 2 Function None 3 5: Label - 512: 2 FunctionCall 6(literal() - 513: 2 FunctionCall 8(operators() - 514: 2 FunctionCall 10(typeCast() - 515: 2 FunctionCall 12(builtinFuncs() Return FunctionEnd 6(literal(): 2 Function None 3 7: Label - 16(u16): 15(ptr) Variable Function - 34(indexable): 33(ptr) Variable Function - 45(indexable): 44(ptr) Variable Function - 31: 30(ptr) AccessChain 27 29 - 32: 18(int) Load 31 - Store 34(indexable) 24 - 36: 35(ptr) AccessChain 34(indexable) 32 - 37: 17(int) Load 36 - 38: 14(int) Bitcast 37 - 42: 30(ptr) AccessChain 27 29 - 43: 18(int) Load 42 - Store 45(indexable) 41 - 46: 15(ptr) AccessChain 45(indexable) 43 - 47: 14(int) Load 46 - 48: 14(int) IAdd 38 47 - Store 16(u16) 48 + 16(i16): 15(ptr) Variable Function + 33(indexable): 32(ptr) Variable Function + 38(u16): 37(ptr) Variable Function + 46(indexable): 45(ptr) Variable Function + 30: 29(ptr) AccessChain 26 28 + 31: 17(int) Load 30 + Store 33(indexable) 23 + 34: 15(ptr) AccessChain 33(indexable) 31 + 35: 14(int) Load 34 + Store 16(i16) 35 + 43: 29(ptr) AccessChain 26 28 + 44: 17(int) Load 43 + Store 46(indexable) 42 + 47: 37(ptr) AccessChain 46(indexable) 44 + 48: 36(int) Load 47 + Store 38(u16) 48 Return FunctionEnd - 8(operators(): 2 Function None 3 + 8(typeCast16(): 2 Function None 3 9: Label - 51(u16v): 50(ptr) Variable Function - 57(i16): 35(ptr) Variable Function - 70(u16): 15(ptr) Variable Function - 108(i): 107(ptr) Variable Function - 130(b): 129(ptr) Variable Function - 151(u): 150(ptr) Variable Function - 52: 49(ivec3) Load 51(u16v) - 55: 54(ivec3) CompositeConstruct 53 53 53 - 56: 49(ivec3) IAdd 52 55 - Store 51(u16v) 56 - 58: 17(int) Load 57(i16) - 59: 17(int) ISub 58 53 - Store 57(i16) 59 - 60: 17(int) Load 57(i16) - 61: 17(int) IAdd 60 53 - Store 57(i16) 61 - 62: 49(ivec3) Load 51(u16v) - 63: 54(ivec3) CompositeConstruct 53 53 53 - 64: 49(ivec3) ISub 62 63 - Store 51(u16v) 64 - 65: 49(ivec3) Load 51(u16v) - 66: 49(ivec3) Not 65 - Store 51(u16v) 66 - 67: 17(int) Load 57(i16) - Store 57(i16) 67 - 68: 49(ivec3) Load 51(u16v) - 69: 49(ivec3) SNegate 68 - Store 51(u16v) 69 - 71: 17(int) Load 57(i16) - 72: 14(int) Bitcast 71 - 73: 14(int) Load 70(u16) - 74: 14(int) IAdd 73 72 - Store 70(u16) 74 - 75: 49(ivec3) Load 51(u16v) - 76: 49(ivec3) Load 51(u16v) - 77: 49(ivec3) ISub 76 75 - Store 51(u16v) 77 - 78: 17(int) Load 57(i16) - 79: 17(int) Load 57(i16) - 80: 17(int) IMul 79 78 - Store 57(i16) 80 - 81: 49(ivec3) Load 51(u16v) - 82: 49(ivec3) Load 51(u16v) - 83: 49(ivec3) UDiv 82 81 - Store 51(u16v) 83 - 84: 17(int) Load 57(i16) - 85: 14(int) Bitcast 84 - 86: 49(ivec3) Load 51(u16v) - 87: 49(ivec3) CompositeConstruct 85 85 85 - 88: 49(ivec3) UMod 86 87 - Store 51(u16v) 88 - 89: 49(ivec3) Load 51(u16v) - 90: 49(ivec3) Load 51(u16v) - 91: 49(ivec3) IAdd 89 90 - Store 51(u16v) 91 - 92: 17(int) Load 57(i16) - 93: 14(int) Bitcast 92 - 94: 14(int) Load 70(u16) - 95: 14(int) ISub 93 94 - Store 70(u16) 95 - 96: 49(ivec3) Load 51(u16v) - 97: 17(int) Load 57(i16) - 98: 14(int) Bitcast 97 - 99: 49(ivec3) CompositeConstruct 98 98 98 - 100: 49(ivec3) IMul 96 99 - Store 51(u16v) 100 - 101: 17(int) Load 57(i16) - 102: 17(int) Load 57(i16) - 103: 17(int) IMul 101 102 - Store 57(i16) 103 - 104: 17(int) Load 57(i16) - 105: 17(int) Load 57(i16) - 106: 17(int) SMod 104 105 - Store 57(i16) 106 - 109: 28(int) Load 108(i) - 110: 49(ivec3) Load 51(u16v) - 112: 111(ivec3) CompositeConstruct 109 109 109 - 113: 49(ivec3) ShiftLeftLogical 110 112 - Store 51(u16v) 113 - 115: 15(ptr) AccessChain 51(u16v) 114 - 116: 14(int) Load 115 - 117: 17(int) Load 57(i16) - 118: 17(int) ShiftRightArithmetic 117 116 - Store 57(i16) 118 - 119: 17(int) Load 57(i16) - 121: 15(ptr) AccessChain 51(u16v) 120 - 122: 14(int) Load 121 - 123: 17(int) ShiftLeftLogical 119 122 - Store 57(i16) 123 - 124: 49(ivec3) Load 51(u16v) - 125: 17(int) Load 57(i16) - 126: 54(ivec3) CompositeConstruct 125 125 125 - 127: 49(ivec3) ShiftLeftLogical 124 126 - Store 51(u16v) 127 - 132: 15(ptr) AccessChain 51(u16v) 131 - 133: 14(int) Load 132 - 134: 17(int) Load 57(i16) - 135: 14(int) Bitcast 134 - 136: 128(bool) INotEqual 133 135 - Store 130(b) 136 - 137: 17(int) Load 57(i16) - 138: 14(int) Bitcast 137 - 139: 15(ptr) AccessChain 51(u16v) 131 - 140: 14(int) Load 139 - 141: 128(bool) IEqual 138 140 - Store 130(b) 141 - 142: 15(ptr) AccessChain 51(u16v) 131 - 143: 14(int) Load 142 - 144: 15(ptr) AccessChain 51(u16v) 114 - 145: 14(int) Load 144 - 146: 128(bool) UGreaterThan 143 145 - Store 130(b) 146 - 147: 17(int) Load 57(i16) - 148: 28(int) SConvert 147 - 149: 18(int) Bitcast 148 - 152: 18(int) Load 151(u) - 153: 128(bool) ULessThan 149 152 - Store 130(b) 153 - 154: 15(ptr) AccessChain 51(u16v) 114 - 155: 14(int) Load 154 - 156: 15(ptr) AccessChain 51(u16v) 131 - 157: 14(int) Load 156 - 158: 128(bool) UGreaterThanEqual 155 157 - Store 130(b) 158 - 159: 17(int) Load 57(i16) - 160: 28(int) SConvert 159 - 161: 28(int) Load 108(i) - 162: 128(bool) SLessThanEqual 160 161 - Store 130(b) 162 - 163: 17(int) Load 57(i16) - 164: 14(int) Bitcast 163 - 165: 49(ivec3) Load 51(u16v) - 166: 49(ivec3) CompositeConstruct 164 164 164 - 167: 49(ivec3) BitwiseOr 165 166 - Store 51(u16v) 167 - 168: 17(int) Load 57(i16) - 169: 14(int) Bitcast 168 - 170: 14(int) Load 70(u16) - 171: 14(int) BitwiseOr 169 170 - Store 70(u16) 171 - 172: 17(int) Load 57(i16) - 173: 17(int) Load 57(i16) - 174: 17(int) BitwiseAnd 173 172 - Store 57(i16) 174 - 175: 49(ivec3) Load 51(u16v) - 176: 49(ivec3) Load 51(u16v) - 177: 49(ivec3) BitwiseAnd 175 176 - Store 51(u16v) 177 - 178: 17(int) Load 57(i16) - 179: 14(int) Bitcast 178 - 180: 49(ivec3) Load 51(u16v) - 181: 49(ivec3) CompositeConstruct 179 179 179 - 182: 49(ivec3) BitwiseXor 180 181 - Store 51(u16v) 182 - 183: 49(ivec3) Load 51(u16v) - 184: 17(int) Load 57(i16) - 185: 14(int) Bitcast 184 - 186: 49(ivec3) CompositeConstruct 185 185 185 - 187: 49(ivec3) BitwiseXor 183 186 - Store 51(u16v) 187 + 51(i32v): 50(ptr) Variable Function + 54(i16v): 53(ptr) Variable Function + 59(u16v): 58(ptr) Variable Function + 67(u32v): 66(ptr) Variable Function + 74(i64v): 73(ptr) Variable Function + 80(u64v): 79(ptr) Variable Function + 94(f16v): 93(ptr) Variable Function + 100(f32v): 99(ptr) Variable Function + 106(f64v): 105(ptr) Variable Function + 154(i8v): 153(ptr) Variable Function + 163(u8v): 162(ptr) Variable Function + 176(bv): 175(ptr) Variable Function + 55: 52(ivec2) Load 54(i16v) + 56: 49(ivec2) SConvert 55 + Store 51(i32v) 56 + 60: 57(ivec2) Load 59(u16v) + 61: 49(ivec2) UConvert 60 + 62: 49(ivec2) Bitcast 61 + Store 51(i32v) 62 + 63: 52(ivec2) Load 54(i16v) + 64: 57(ivec2) Bitcast 63 + Store 59(u16v) 64 + 68: 52(ivec2) Load 54(i16v) + 69: 49(ivec2) SConvert 68 + 70: 65(ivec2) Bitcast 69 + Store 67(u32v) 70 + 75: 52(ivec2) Load 54(i16v) + 76: 72(ivec2) SConvert 75 + Store 74(i64v) 76 + 81: 52(ivec2) Load 54(i16v) + 82: 72(ivec2) SConvert 81 + 83: 78(ivec2) Bitcast 82 + Store 80(u64v) 83 + 84: 57(ivec2) Load 59(u16v) + 85: 65(ivec2) UConvert 84 + Store 67(u32v) 85 + 86: 57(ivec2) Load 59(u16v) + 87: 72(ivec2) UConvert 86 + 88: 72(ivec2) Bitcast 87 + Store 74(i64v) 88 + 89: 57(ivec2) Load 59(u16v) + 90: 78(ivec2) UConvert 89 + Store 80(u64v) 90 + 95: 52(ivec2) Load 54(i16v) + 96: 92(fvec2) ConvertSToF 95 + Store 94(f16v) 96 + 101: 52(ivec2) Load 54(i16v) + 102: 98(fvec2) ConvertSToF 101 + Store 100(f32v) 102 + 107: 52(ivec2) Load 54(i16v) + 108: 104(fvec2) ConvertSToF 107 + Store 106(f64v) 108 + 109: 57(ivec2) Load 59(u16v) + 110: 92(fvec2) ConvertUToF 109 + Store 94(f16v) 110 + 111: 57(ivec2) Load 59(u16v) + 112: 98(fvec2) ConvertUToF 111 + Store 100(f32v) 112 + 113: 57(ivec2) Load 59(u16v) + 114: 104(fvec2) ConvertUToF 113 + Store 106(f64v) 114 + 115: 52(ivec2) Load 54(i16v) + 116: 49(ivec2) SConvert 115 + Store 51(i32v) 116 + 117: 57(ivec2) Load 59(u16v) + 118: 49(ivec2) UConvert 117 + 119: 49(ivec2) Bitcast 118 + Store 51(i32v) 119 + 120: 52(ivec2) Load 54(i16v) + 121: 57(ivec2) Bitcast 120 + Store 59(u16v) 121 + 122: 52(ivec2) Load 54(i16v) + 123: 49(ivec2) SConvert 122 + 124: 65(ivec2) Bitcast 123 + Store 67(u32v) 124 + 125: 52(ivec2) Load 54(i16v) + 126: 72(ivec2) SConvert 125 + Store 74(i64v) 126 + 127: 52(ivec2) Load 54(i16v) + 128: 72(ivec2) SConvert 127 + 129: 78(ivec2) Bitcast 128 + Store 80(u64v) 129 + 130: 57(ivec2) Load 59(u16v) + 131: 65(ivec2) UConvert 130 + Store 67(u32v) 131 + 132: 57(ivec2) Load 59(u16v) + 133: 72(ivec2) UConvert 132 + 134: 72(ivec2) Bitcast 133 + Store 74(i64v) 134 + 135: 57(ivec2) Load 59(u16v) + 136: 72(ivec2) UConvert 135 + 137: 72(ivec2) Bitcast 136 + 138: 78(ivec2) Bitcast 137 + Store 80(u64v) 138 + 139: 52(ivec2) Load 54(i16v) + 140: 92(fvec2) ConvertSToF 139 + Store 94(f16v) 140 + 141: 52(ivec2) Load 54(i16v) + 142: 98(fvec2) ConvertSToF 141 + Store 100(f32v) 142 + 143: 52(ivec2) Load 54(i16v) + 144: 104(fvec2) ConvertSToF 143 + Store 106(f64v) 144 + 145: 57(ivec2) Load 59(u16v) + 146: 92(fvec2) ConvertUToF 145 + Store 94(f16v) 146 + 147: 57(ivec2) Load 59(u16v) + 148: 98(fvec2) ConvertUToF 147 + Store 100(f32v) 148 + 149: 57(ivec2) Load 59(u16v) + 150: 104(fvec2) ConvertUToF 149 + Store 106(f64v) 150 + 155: 52(ivec2) Load 54(i16v) + 156: 152(ivec2) SConvert 155 + Store 154(i8v) 156 + 157: 57(ivec2) Load 59(u16v) + 158: 152(ivec2) UConvert 157 + 159: 152(ivec2) Bitcast 158 + Store 154(i8v) 159 + 164: 52(ivec2) Load 54(i16v) + 165: 152(ivec2) SConvert 164 + 166: 161(ivec2) Bitcast 165 + Store 163(u8v) 166 + 167: 57(ivec2) Load 59(u16v) + 168: 161(ivec2) UConvert 167 + Store 163(u8v) 168 + 169: 57(ivec2) Load 59(u16v) + 170: 161(ivec2) UConvert 169 + 171: 52(ivec2) UConvert 170 + 172: 52(ivec2) Bitcast 171 + Store 54(i16v) 172 + 177: 174(bvec2) Load 176(bv) + 182: 52(ivec2) Select 177 181 180 + Store 54(i16v) 182 + 183: 174(bvec2) Load 176(bv) + 188: 57(ivec2) Select 183 187 186 + Store 59(u16v) 188 + 189: 52(ivec2) Load 54(i16v) + 190: 174(bvec2) INotEqual 189 186 + Store 176(bv) 190 + 191: 57(ivec2) Load 59(u16v) + 192: 174(bvec2) INotEqual 191 186 + Store 176(bv) 192 Return FunctionEnd - 10(typeCast(): 2 Function None 3 + 10(operators(): 2 Function None 3 11: Label - 190(i16v): 189(ptr) Variable Function - 193(bv): 192(ptr) Variable Function - 201(u16v): 200(ptr) Variable Function - 214(iv): 213(ptr) Variable Function + 195(u16v): 194(ptr) Variable Function + 200(i16): 15(ptr) Variable Function + 220(i): 219(ptr) Variable Function 227(uv): 226(ptr) Variable Function - 241(fv): 240(ptr) Variable Function - 253(dv): 252(ptr) Variable Function - 265(f16v): 264(ptr) Variable Function - 277(i64v): 276(ptr) Variable Function - 291(u64v): 290(ptr) Variable Function - 194: 191(bvec2) Load 193(bv) - 198: 188(ivec2) Select 194 197 196 - Store 190(i16v) 198 - 202: 191(bvec2) Load 193(bv) - 207: 199(ivec2) Select 202 206 205 - Store 201(u16v) 207 - 208: 188(ivec2) Load 190(i16v) - 209: 191(bvec2) INotEqual 208 205 - Store 193(bv) 209 - 210: 199(ivec2) Load 201(u16v) - 211: 191(bvec2) INotEqual 210 205 - Store 193(bv) 211 - 215: 212(ivec2) Load 214(iv) - 216: 188(ivec2) SConvert 215 - Store 190(i16v) 216 - 217: 212(ivec2) Load 214(iv) - 218: 188(ivec2) SConvert 217 - 219: 199(ivec2) Bitcast 218 - Store 201(u16v) 219 - 220: 188(ivec2) Load 190(i16v) - 221: 212(ivec2) SConvert 220 - Store 214(iv) 221 - 222: 199(ivec2) Load 201(u16v) - 224: 223(ivec2) UConvert 222 - 225: 212(ivec2) Bitcast 224 - Store 214(iv) 225 - 228: 223(ivec2) Load 227(uv) - 229: 199(ivec2) UConvert 228 - 230: 188(ivec2) Bitcast 229 - Store 190(i16v) 230 - 231: 223(ivec2) Load 227(uv) - 232: 199(ivec2) UConvert 231 - Store 201(u16v) 232 - 233: 188(ivec2) Load 190(i16v) - 234: 212(ivec2) SConvert 233 - 235: 223(ivec2) Bitcast 234 - Store 227(uv) 235 - 236: 199(ivec2) Load 201(u16v) - 237: 223(ivec2) UConvert 236 + 243(i64): 242(ptr) Variable Function + 281(b): 280(ptr) Variable Function + 196: 193(ivec3) Load 195(u16v) + 198: 197(ivec3) CompositeConstruct 179 179 179 + 199: 193(ivec3) IAdd 196 198 + Store 195(u16v) 199 + 201: 14(int) Load 200(i16) + 202: 14(int) ISub 201 179 + Store 200(i16) 202 + 203: 14(int) Load 200(i16) + 204: 14(int) IAdd 203 179 + Store 200(i16) 204 + 205: 193(ivec3) Load 195(u16v) + 206: 197(ivec3) CompositeConstruct 179 179 179 + 207: 193(ivec3) ISub 205 206 + Store 195(u16v) 207 + 208: 193(ivec3) Load 195(u16v) + 209: 193(ivec3) Not 208 + Store 195(u16v) 209 + 210: 14(int) Load 200(i16) + Store 200(i16) 210 + 211: 193(ivec3) Load 195(u16v) + 212: 193(ivec3) SNegate 211 + Store 195(u16v) 212 + 213: 14(int) Load 200(i16) + 214: 14(int) Load 200(i16) + 215: 14(int) IAdd 214 213 + Store 200(i16) 215 + 216: 193(ivec3) Load 195(u16v) + 217: 193(ivec3) Load 195(u16v) + 218: 193(ivec3) ISub 217 216 + Store 195(u16v) 218 + 221: 14(int) Load 200(i16) + 222: 27(int) SConvert 221 + 223: 27(int) Load 220(i) + 224: 27(int) IMul 223 222 + Store 220(i) 224 + 228: 193(ivec3) Load 195(u16v) + 229: 225(ivec3) UConvert 228 + 230: 225(ivec3) Load 227(uv) + 231: 225(ivec3) UDiv 230 229 + Store 227(uv) 231 + 232: 14(int) Load 200(i16) + 233: 27(int) SConvert 232 + 234: 17(int) Bitcast 233 + 235: 225(ivec3) Load 227(uv) + 236: 225(ivec3) CompositeConstruct 234 234 234 + 237: 225(ivec3) UMod 235 236 Store 227(uv) 237 - 242: 239(fvec2) Load 241(fv) - 243: 188(ivec2) ConvertFToS 242 - Store 190(i16v) 243 - 244: 239(fvec2) Load 241(fv) - 245: 199(ivec2) ConvertFToU 244 - Store 201(u16v) 245 - 246: 188(ivec2) Load 190(i16v) - 247: 239(fvec2) ConvertSToF 246 - Store 241(fv) 247 - 248: 199(ivec2) Load 201(u16v) - 249: 239(fvec2) ConvertUToF 248 - Store 241(fv) 249 - 254: 251(fvec2) Load 253(dv) - 255: 188(ivec2) ConvertFToS 254 - Store 190(i16v) 255 - 256: 251(fvec2) Load 253(dv) - 257: 199(ivec2) ConvertFToU 256 - Store 201(u16v) 257 - 258: 188(ivec2) Load 190(i16v) - 259: 251(fvec2) ConvertSToF 258 - Store 253(dv) 259 - 260: 199(ivec2) Load 201(u16v) - 261: 251(fvec2) ConvertUToF 260 - Store 253(dv) 261 - 266: 263(fvec2) Load 265(f16v) - 267: 188(ivec2) ConvertFToS 266 - Store 190(i16v) 267 - 268: 263(fvec2) Load 265(f16v) - 269: 199(ivec2) ConvertFToU 268 - Store 201(u16v) 269 - 270: 188(ivec2) Load 190(i16v) - 271: 263(fvec2) ConvertSToF 270 - Store 265(f16v) 271 - 272: 199(ivec2) Load 201(u16v) - 273: 263(fvec2) ConvertUToF 272 - Store 265(f16v) 273 - 278: 275(ivec2) Load 277(i64v) - 279: 188(ivec2) SConvert 278 - Store 190(i16v) 279 - 280: 275(ivec2) Load 277(i64v) - 281: 188(ivec2) SConvert 280 - 282: 199(ivec2) Bitcast 281 - Store 201(u16v) 282 - 283: 188(ivec2) Load 190(i16v) - 284: 275(ivec2) SConvert 283 - Store 277(i64v) 284 - 285: 199(ivec2) Load 201(u16v) - 288: 287(ivec2) UConvert 285 - 289: 275(ivec2) Bitcast 288 - Store 277(i64v) 289 - 292: 287(ivec2) Load 291(u64v) - 293: 199(ivec2) UConvert 292 - 294: 188(ivec2) Bitcast 293 - Store 190(i16v) 294 - 295: 287(ivec2) Load 291(u64v) - 296: 199(ivec2) UConvert 295 - Store 201(u16v) 296 - 297: 188(ivec2) Load 190(i16v) - 298: 275(ivec2) SConvert 297 - 299: 287(ivec2) Bitcast 298 - Store 291(u64v) 299 - 300: 199(ivec2) Load 201(u16v) - 301: 287(ivec2) UConvert 300 - Store 291(u64v) 301 - 302: 199(ivec2) Load 201(u16v) - 303: 188(ivec2) Bitcast 302 - Store 190(i16v) 303 - 304: 188(ivec2) Load 190(i16v) - 305: 199(ivec2) Bitcast 304 - Store 201(u16v) 305 + 238: 193(ivec3) Load 195(u16v) + 239: 225(ivec3) UConvert 238 + 240: 225(ivec3) Load 227(uv) + 241: 225(ivec3) IAdd 239 240 + Store 227(uv) 241 + 244: 14(int) Load 200(i16) + 245: 71(int) SConvert 244 + 246: 71(int) Load 243(i64) + 247: 71(int) ISub 245 246 + Store 243(i64) 247 + 248: 193(ivec3) Load 195(u16v) + 249: 225(ivec3) UConvert 248 + 250: 225(ivec3) Load 227(uv) + 251: 225(ivec3) IMul 249 250 + Store 227(uv) 251 + 252: 14(int) Load 200(i16) + 253: 71(int) SConvert 252 + 254: 71(int) Load 243(i64) + 255: 71(int) IMul 253 254 + Store 243(i64) 255 + 256: 14(int) Load 200(i16) + 257: 27(int) SConvert 256 + 258: 27(int) Load 220(i) + 259: 27(int) SMod 257 258 + Store 220(i) 259 + 260: 14(int) Load 200(i16) + 261: 193(ivec3) Load 195(u16v) + 262: 197(ivec3) CompositeConstruct 260 260 260 + 263: 193(ivec3) ShiftLeftLogical 261 262 + Store 195(u16v) 263 + 265: 37(ptr) AccessChain 195(u16v) 264 + 266: 36(int) Load 265 + 267: 14(int) Load 200(i16) + 268: 14(int) ShiftRightArithmetic 267 266 + Store 200(i16) 268 + 269: 14(int) Load 200(i16) + 271: 37(ptr) AccessChain 195(u16v) 270 + 272: 36(int) Load 271 + 273: 14(int) ShiftLeftLogical 269 272 + Store 200(i16) 273 + 274: 193(ivec3) Load 195(u16v) + 275: 27(int) Load 220(i) + 277: 276(ivec3) CompositeConstruct 275 275 275 + 278: 193(ivec3) ShiftLeftLogical 274 277 + 279: 225(ivec3) UConvert 278 + Store 227(uv) 279 + 283: 37(ptr) AccessChain 195(u16v) 282 + 284: 36(int) Load 283 + 285: 14(int) Load 200(i16) + 286: 36(int) Bitcast 285 + 287: 173(bool) INotEqual 284 286 + Store 281(b) 287 + 288: 14(int) Load 200(i16) + 289: 36(int) Bitcast 288 + 290: 37(ptr) AccessChain 195(u16v) 282 + 291: 36(int) Load 290 + 292: 173(bool) IEqual 289 291 + Store 281(b) 292 + 293: 37(ptr) AccessChain 195(u16v) 282 + 294: 36(int) Load 293 + 295: 17(int) UConvert 294 + 297: 296(ptr) AccessChain 227(uv) 264 + 298: 17(int) Load 297 + 299: 173(bool) UGreaterThan 295 298 + Store 281(b) 299 + 300: 14(int) Load 200(i16) + 301: 27(int) SConvert 300 + 302: 27(int) Load 220(i) + 303: 173(bool) SLessThan 301 302 + Store 281(b) 303 + 304: 37(ptr) AccessChain 195(u16v) 264 + 305: 36(int) Load 304 + 306: 17(int) UConvert 305 + 307: 296(ptr) AccessChain 227(uv) 282 + 308: 17(int) Load 307 + 309: 173(bool) UGreaterThanEqual 306 308 + Store 281(b) 309 + 310: 14(int) Load 200(i16) + 311: 27(int) SConvert 310 + 312: 27(int) Load 220(i) + 313: 173(bool) SLessThanEqual 311 312 + Store 281(b) 313 + 314: 14(int) Load 200(i16) + 315: 27(int) SConvert 314 + 316: 17(int) Bitcast 315 + 317: 225(ivec3) Load 227(uv) + 318: 225(ivec3) CompositeConstruct 316 316 316 + 319: 225(ivec3) BitwiseOr 317 318 + Store 227(uv) 319 + 320: 14(int) Load 200(i16) + 321: 27(int) SConvert 320 + 322: 27(int) Load 220(i) + 323: 27(int) BitwiseOr 321 322 + Store 220(i) 323 + 324: 14(int) Load 200(i16) + 325: 71(int) SConvert 324 + 326: 71(int) Load 243(i64) + 327: 71(int) BitwiseAnd 326 325 + Store 243(i64) 327 + 328: 193(ivec3) Load 195(u16v) + 329: 225(ivec3) UConvert 328 + 330: 225(ivec3) Load 227(uv) + 331: 225(ivec3) BitwiseAnd 329 330 + Store 227(uv) 331 + 332: 14(int) Load 200(i16) + 333: 27(int) SConvert 332 + 334: 17(int) Bitcast 333 + 335: 225(ivec3) Load 227(uv) + 336: 225(ivec3) CompositeConstruct 334 334 334 + 337: 225(ivec3) BitwiseXor 335 336 + Store 227(uv) 337 + 338: 193(ivec3) Load 195(u16v) + 339: 14(int) Load 200(i16) + 340: 36(int) Bitcast 339 + 341: 193(ivec3) CompositeConstruct 340 340 340 + 342: 193(ivec3) BitwiseXor 338 341 + Store 195(u16v) 342 Return FunctionEnd 12(builtinFuncs(): 2 Function None 3 13: Label - 306(i16v): 189(ptr) Variable Function - 312(i16): 35(ptr) Variable Function - 320(u16v): 50(ptr) Variable Function - 322(u16): 15(ptr) Variable Function - 394(f16v): 393(ptr) Variable Function - 397(exp): 396(ptr) Variable Function - 419(packi): 107(ptr) Variable Function - 424(packu): 150(ptr) Variable Function - 433(packi64): 432(ptr) Variable Function - 442(packu64): 441(ptr) Variable Function - 451(bv): 450(ptr) Variable Function - 307: 188(ivec2) Load 306(i16v) - 308: 188(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 307 - Store 306(i16v) 308 - 309: 188(ivec2) Load 306(i16v) - 310: 188(ivec2) ExtInst 1(GLSL.std.450) 7(SSign) 309 - Store 306(i16v) 310 - 311: 188(ivec2) Load 306(i16v) - 313: 17(int) Load 312(i16) - 314: 188(ivec2) CompositeConstruct 313 313 - 315: 188(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 311 314 - Store 306(i16v) 315 - 316: 188(ivec2) Load 306(i16v) - 319: 188(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 316 318 - Store 306(i16v) 319 - 321: 49(ivec3) Load 320(u16v) - 323: 14(int) Load 322(u16) - 324: 49(ivec3) CompositeConstruct 323 323 323 - 325: 49(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 321 324 - Store 320(u16v) 325 - 326: 49(ivec3) Load 320(u16v) - 328: 49(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 326 327 - Store 320(u16v) 328 - 329: 188(ivec2) Load 306(i16v) - 330: 17(int) Load 312(i16) - 331: 188(ivec2) CompositeConstruct 330 330 - 332: 188(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 329 331 - Store 306(i16v) 332 - 333: 188(ivec2) Load 306(i16v) - 334: 188(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 333 318 - Store 306(i16v) 334 - 335: 49(ivec3) Load 320(u16v) - 336: 14(int) Load 322(u16) - 337: 49(ivec3) CompositeConstruct 336 336 336 - 338: 49(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 335 337 - Store 320(u16v) 338 - 339: 49(ivec3) Load 320(u16v) - 340: 49(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 339 327 - Store 320(u16v) 340 - 341: 188(ivec2) Load 306(i16v) - 342: 17(int) Load 312(i16) - 343: 17(int) SNegate 342 - 344: 17(int) Load 312(i16) - 345: 188(ivec2) CompositeConstruct 343 343 - 346: 188(ivec2) CompositeConstruct 344 344 - 347: 188(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 341 345 346 - Store 306(i16v) 347 - 348: 188(ivec2) Load 306(i16v) - 349: 188(ivec2) Load 306(i16v) - 350: 188(ivec2) SNegate 349 - 351: 188(ivec2) Load 306(i16v) - 352: 188(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 348 350 351 - Store 306(i16v) 352 - 353: 49(ivec3) Load 320(u16v) - 354: 14(int) Load 322(u16) - 355: 14(int) SNegate 354 - 356: 14(int) Load 322(u16) - 357: 49(ivec3) CompositeConstruct 355 355 355 - 358: 49(ivec3) CompositeConstruct 356 356 356 - 359: 49(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 353 357 358 - Store 320(u16v) 359 - 360: 49(ivec3) Load 320(u16v) - 361: 49(ivec3) Load 320(u16v) - 362: 49(ivec3) SNegate 361 - 363: 49(ivec3) Load 320(u16v) - 364: 49(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 360 362 363 - Store 320(u16v) 364 - 365: 35(ptr) AccessChain 306(i16v) 131 - 366: 17(int) Load 365 - 367: 35(ptr) AccessChain 306(i16v) 114 - 368: 17(int) Load 367 - 370: 17(int) Select 369 368 366 - Store 312(i16) 370 - 371: 17(int) Load 312(i16) - 372: 188(ivec2) CompositeConstruct 371 371 - 373: 17(int) Load 312(i16) - 374: 17(int) SNegate 373 - 375: 188(ivec2) CompositeConstruct 374 374 - 378: 188(ivec2) Select 377 375 372 - Store 306(i16v) 378 - 379: 15(ptr) AccessChain 320(u16v) 131 - 380: 14(int) Load 379 - 381: 15(ptr) AccessChain 320(u16v) 114 - 382: 14(int) Load 381 - 383: 14(int) Select 369 382 380 - Store 322(u16) 383 - 384: 14(int) Load 322(u16) - 385: 49(ivec3) CompositeConstruct 384 384 384 - 386: 14(int) Load 322(u16) - 387: 14(int) SNegate 386 - 388: 49(ivec3) CompositeConstruct 387 387 387 - 391: 49(ivec3) Select 390 388 385 - Store 320(u16v) 391 - 395: 392(fvec3) Load 394(f16v) - 399:398(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 395 - 400: 54(ivec3) CompositeExtract 399 1 - Store 397(exp) 400 - 401: 392(fvec3) CompositeExtract 399 0 - Store 394(f16v) 401 - 402: 392(fvec3) Load 394(f16v) - 403: 54(ivec3) Load 397(exp) - 404: 392(fvec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 402 403 - Store 394(f16v) 404 - 405: 392(fvec3) Load 394(f16v) - 406: 263(fvec2) VectorShuffle 405 405 0 1 - 407: 188(ivec2) Bitcast 406 - Store 306(i16v) 407 - 409: 408(ptr) AccessChain 394(f16v) 120 - 410: 262(float) Load 409 - 411: 14(int) Bitcast 410 - 412: 15(ptr) AccessChain 320(u16v) 131 - Store 412 411 - 413: 188(ivec2) Load 306(i16v) - 414: 263(fvec2) Bitcast 413 - 415: 392(fvec3) Load 394(f16v) - 416: 392(fvec3) VectorShuffle 415 414 3 4 2 - Store 394(f16v) 416 - 417: 49(ivec3) Load 320(u16v) - 418: 392(fvec3) Bitcast 417 - Store 394(f16v) 418 - 420: 188(ivec2) Load 306(i16v) - 421: 28(int) Bitcast 420 - Store 419(packi) 421 - 422: 28(int) Load 419(packi) - 423: 188(ivec2) Bitcast 422 - Store 306(i16v) 423 - 425: 49(ivec3) Load 320(u16v) - 426: 199(ivec2) VectorShuffle 425 425 0 1 - 427: 18(int) Bitcast 426 - Store 424(packu) 427 - 428: 18(int) Load 424(packu) - 429: 199(ivec2) Bitcast 428 - 430: 49(ivec3) Load 320(u16v) - 431: 49(ivec3) VectorShuffle 430 429 3 4 2 - Store 320(u16v) 431 - 434: 17(int) Load 312(i16) - 436: 435(ivec4) CompositeConstruct 434 434 434 434 - 437: 274(int) Bitcast 436 - Store 433(packi64) 437 - 438: 274(int) Load 433(packi64) - 439: 435(ivec4) Bitcast 438 - 440: 188(ivec2) VectorShuffle 439 439 0 1 - Store 306(i16v) 440 - 443: 14(int) Load 322(u16) - 445: 444(ivec4) CompositeConstruct 443 443 443 443 - 446: 286(int) Bitcast 445 - Store 442(packu64) 446 - 447: 286(int) Load 442(packu64) - 448: 444(ivec4) Bitcast 447 - 449: 49(ivec3) VectorShuffle 448 448 0 1 2 - Store 320(u16v) 449 - 452: 49(ivec3) Load 320(u16v) - 453: 14(int) Load 322(u16) - 454: 49(ivec3) CompositeConstruct 453 453 453 - 455: 389(bvec3) ULessThan 452 454 - Store 451(bv) 455 - 456: 188(ivec2) Load 306(i16v) - 457: 17(int) Load 312(i16) - 458: 188(ivec2) CompositeConstruct 457 457 - 459: 191(bvec2) SLessThan 456 458 - 460: 389(bvec3) Load 451(bv) - 461: 389(bvec3) VectorShuffle 460 459 3 4 2 - Store 451(bv) 461 - 462: 49(ivec3) Load 320(u16v) - 463: 14(int) Load 322(u16) - 464: 49(ivec3) CompositeConstruct 463 463 463 - 465: 389(bvec3) ULessThanEqual 462 464 - Store 451(bv) 465 - 466: 188(ivec2) Load 306(i16v) - 467: 17(int) Load 312(i16) - 468: 188(ivec2) CompositeConstruct 467 467 - 469: 191(bvec2) SLessThanEqual 466 468 - 470: 389(bvec3) Load 451(bv) - 471: 389(bvec3) VectorShuffle 470 469 3 4 2 - Store 451(bv) 471 - 472: 49(ivec3) Load 320(u16v) - 473: 14(int) Load 322(u16) - 474: 49(ivec3) CompositeConstruct 473 473 473 - 475: 389(bvec3) UGreaterThan 472 474 - Store 451(bv) 475 - 476: 188(ivec2) Load 306(i16v) - 477: 17(int) Load 312(i16) - 478: 188(ivec2) CompositeConstruct 477 477 - 479: 191(bvec2) SGreaterThan 476 478 - 480: 389(bvec3) Load 451(bv) - 481: 389(bvec3) VectorShuffle 480 479 3 4 2 - Store 451(bv) 481 - 482: 49(ivec3) Load 320(u16v) - 483: 14(int) Load 322(u16) - 484: 49(ivec3) CompositeConstruct 483 483 483 - 485: 389(bvec3) UGreaterThanEqual 482 484 - Store 451(bv) 485 - 486: 188(ivec2) Load 306(i16v) - 487: 17(int) Load 312(i16) - 488: 188(ivec2) CompositeConstruct 487 487 - 489: 191(bvec2) SGreaterThanEqual 486 488 - 490: 389(bvec3) Load 451(bv) - 491: 389(bvec3) VectorShuffle 490 489 3 4 2 - Store 451(bv) 491 - 492: 49(ivec3) Load 320(u16v) - 493: 14(int) Load 322(u16) - 494: 49(ivec3) CompositeConstruct 493 493 493 - 495: 389(bvec3) IEqual 492 494 - Store 451(bv) 495 - 496: 188(ivec2) Load 306(i16v) - 497: 17(int) Load 312(i16) - 498: 188(ivec2) CompositeConstruct 497 497 - 499: 191(bvec2) IEqual 496 498 - 500: 389(bvec3) Load 451(bv) - 501: 389(bvec3) VectorShuffle 500 499 3 4 2 - Store 451(bv) 501 - 502: 49(ivec3) Load 320(u16v) - 503: 14(int) Load 322(u16) - 504: 49(ivec3) CompositeConstruct 503 503 503 - 505: 389(bvec3) INotEqual 502 504 - Store 451(bv) 505 - 506: 188(ivec2) Load 306(i16v) - 507: 17(int) Load 312(i16) - 508: 188(ivec2) CompositeConstruct 507 507 - 509: 191(bvec2) INotEqual 506 508 - 510: 389(bvec3) Load 451(bv) - 511: 389(bvec3) VectorShuffle 510 509 3 4 2 - Store 451(bv) 511 + 343(i16v): 53(ptr) Variable Function + 346(i16): 15(ptr) Variable Function + 356(u16v): 194(ptr) Variable Function + 358(u16): 37(ptr) Variable Function + 428(i32): 219(ptr) Variable Function + 431(i64): 242(ptr) Variable Function + 434(i16v4): 433(ptr) Variable Function + 437(u32): 296(ptr) Variable Function + 438(u16v2): 58(ptr) Variable Function + 442(u64): 441(ptr) Variable Function + 445(u16v4): 444(ptr) Variable Function + 457(bv): 456(ptr) Variable Function + 344: 52(ivec2) Load 343(i16v) + 345: 52(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 344 + Store 343(i16v) 345 + 347: 14(int) Load 346(i16) + 348: 14(int) ExtInst 1(GLSL.std.450) 7(SSign) 347 + Store 346(i16) 348 + 349: 52(ivec2) Load 343(i16v) + 350: 14(int) Load 346(i16) + 351: 52(ivec2) CompositeConstruct 350 350 + 352: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 349 351 + Store 343(i16v) 352 + 353: 52(ivec2) Load 343(i16v) + 355: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 353 354 + Store 343(i16v) 355 + 357: 193(ivec3) Load 356(u16v) + 359: 36(int) Load 358(u16) + 360: 193(ivec3) CompositeConstruct 359 359 359 + 361: 193(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 357 360 + Store 356(u16v) 361 + 362: 193(ivec3) Load 356(u16v) + 364: 193(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 362 363 + Store 356(u16v) 364 + 365: 52(ivec2) Load 343(i16v) + 366: 14(int) Load 346(i16) + 367: 52(ivec2) CompositeConstruct 366 366 + 368: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 365 367 + Store 343(i16v) 368 + 369: 52(ivec2) Load 343(i16v) + 370: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 369 354 + Store 343(i16v) 370 + 371: 193(ivec3) Load 356(u16v) + 372: 36(int) Load 358(u16) + 373: 193(ivec3) CompositeConstruct 372 372 372 + 374: 193(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 371 373 + Store 356(u16v) 374 + 375: 193(ivec3) Load 356(u16v) + 376: 193(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 375 363 + Store 356(u16v) 376 + 377: 52(ivec2) Load 343(i16v) + 378: 14(int) Load 346(i16) + 379: 14(int) SNegate 378 + 380: 14(int) Load 346(i16) + 381: 52(ivec2) CompositeConstruct 379 379 + 382: 52(ivec2) CompositeConstruct 380 380 + 383: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 377 381 382 + Store 343(i16v) 383 + 384: 52(ivec2) Load 343(i16v) + 385: 52(ivec2) Load 343(i16v) + 386: 52(ivec2) SNegate 385 + 387: 52(ivec2) Load 343(i16v) + 388: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 384 386 387 + Store 343(i16v) 388 + 389: 193(ivec3) Load 356(u16v) + 390: 36(int) Load 358(u16) + 391: 36(int) SNegate 390 + 392: 36(int) Load 358(u16) + 393: 193(ivec3) CompositeConstruct 391 391 391 + 394: 193(ivec3) CompositeConstruct 392 392 392 + 395: 193(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 389 393 394 + Store 356(u16v) 395 + 396: 193(ivec3) Load 356(u16v) + 397: 193(ivec3) Load 356(u16v) + 398: 193(ivec3) SNegate 397 + 399: 193(ivec3) Load 356(u16v) + 400: 193(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 396 398 399 + Store 356(u16v) 400 + 401: 15(ptr) AccessChain 343(i16v) 282 + 402: 14(int) Load 401 + 403: 15(ptr) AccessChain 343(i16v) 264 + 404: 14(int) Load 403 + 406: 14(int) Select 405 404 402 + Store 346(i16) 406 + 407: 14(int) Load 346(i16) + 408: 52(ivec2) CompositeConstruct 407 407 + 409: 14(int) Load 346(i16) + 410: 14(int) SNegate 409 + 411: 52(ivec2) CompositeConstruct 410 410 + 414: 52(ivec2) Select 413 411 408 + Store 343(i16v) 414 + 415: 37(ptr) AccessChain 356(u16v) 282 + 416: 36(int) Load 415 + 417: 37(ptr) AccessChain 356(u16v) 264 + 418: 36(int) Load 417 + 419: 36(int) Select 405 418 416 + Store 358(u16) 419 + 420: 36(int) Load 358(u16) + 421: 193(ivec3) CompositeConstruct 420 420 420 + 422: 36(int) Load 358(u16) + 423: 36(int) SNegate 422 + 424: 193(ivec3) CompositeConstruct 423 423 423 + 427: 193(ivec3) Select 426 424 421 + Store 356(u16v) 427 + 429: 52(ivec2) Load 343(i16v) + 430: 27(int) Bitcast 429 + Store 428(i32) 430 + 435: 432(ivec4) Load 434(i16v4) + 436: 71(int) Bitcast 435 + Store 431(i64) 436 + 439: 57(ivec2) Load 438(u16v2) + 440: 17(int) Bitcast 439 + Store 437(u32) 440 + 446: 443(ivec4) Load 445(u16v4) + 447: 77(int) Bitcast 446 + Store 442(u64) 447 + 448: 27(int) Load 428(i32) + 449: 52(ivec2) Bitcast 448 + Store 343(i16v) 449 + 450: 71(int) Load 431(i64) + 451: 432(ivec4) Bitcast 450 + Store 434(i16v4) 451 + 452: 17(int) Load 437(u32) + 453: 57(ivec2) Bitcast 452 + Store 438(u16v2) 453 + 454: 77(int) Load 442(u64) + 455: 443(ivec4) Bitcast 454 + Store 445(u16v4) 455 + 458: 193(ivec3) Load 356(u16v) + 459: 36(int) Load 358(u16) + 460: 193(ivec3) CompositeConstruct 459 459 459 + 461: 425(bvec3) ULessThan 458 460 + Store 457(bv) 461 + 462: 52(ivec2) Load 343(i16v) + 463: 14(int) Load 346(i16) + 464: 52(ivec2) CompositeConstruct 463 463 + 465: 174(bvec2) SLessThan 462 464 + 466: 425(bvec3) Load 457(bv) + 467: 425(bvec3) VectorShuffle 466 465 3 4 2 + Store 457(bv) 467 + 468: 193(ivec3) Load 356(u16v) + 469: 36(int) Load 358(u16) + 470: 193(ivec3) CompositeConstruct 469 469 469 + 471: 425(bvec3) ULessThanEqual 468 470 + Store 457(bv) 471 + 472: 52(ivec2) Load 343(i16v) + 473: 14(int) Load 346(i16) + 474: 52(ivec2) CompositeConstruct 473 473 + 475: 174(bvec2) SLessThanEqual 472 474 + 476: 425(bvec3) Load 457(bv) + 477: 425(bvec3) VectorShuffle 476 475 3 4 2 + Store 457(bv) 477 + 478: 193(ivec3) Load 356(u16v) + 479: 36(int) Load 358(u16) + 480: 193(ivec3) CompositeConstruct 479 479 479 + 481: 425(bvec3) UGreaterThan 478 480 + Store 457(bv) 481 + 482: 52(ivec2) Load 343(i16v) + 483: 14(int) Load 346(i16) + 484: 52(ivec2) CompositeConstruct 483 483 + 485: 174(bvec2) SGreaterThan 482 484 + 486: 425(bvec3) Load 457(bv) + 487: 425(bvec3) VectorShuffle 486 485 3 4 2 + Store 457(bv) 487 + 488: 193(ivec3) Load 356(u16v) + 489: 36(int) Load 358(u16) + 490: 193(ivec3) CompositeConstruct 489 489 489 + 491: 425(bvec3) UGreaterThanEqual 488 490 + Store 457(bv) 491 + 492: 52(ivec2) Load 343(i16v) + 493: 14(int) Load 346(i16) + 494: 52(ivec2) CompositeConstruct 493 493 + 495: 174(bvec2) SGreaterThanEqual 492 494 + 496: 425(bvec3) Load 457(bv) + 497: 425(bvec3) VectorShuffle 496 495 3 4 2 + Store 457(bv) 497 + 498: 193(ivec3) Load 356(u16v) + 499: 36(int) Load 358(u16) + 500: 193(ivec3) CompositeConstruct 499 499 499 + 501: 425(bvec3) IEqual 498 500 + Store 457(bv) 501 + 502: 52(ivec2) Load 343(i16v) + 503: 14(int) Load 346(i16) + 504: 52(ivec2) CompositeConstruct 503 503 + 505: 174(bvec2) IEqual 502 504 + 506: 425(bvec3) Load 457(bv) + 507: 425(bvec3) VectorShuffle 506 505 3 4 2 + Store 457(bv) 507 + 508: 193(ivec3) Load 356(u16v) + 509: 36(int) Load 358(u16) + 510: 193(ivec3) CompositeConstruct 509 509 509 + 511: 425(bvec3) INotEqual 508 510 + Store 457(bv) 511 + 512: 52(ivec2) Load 343(i16v) + 513: 14(int) Load 346(i16) + 514: 52(ivec2) CompositeConstruct 513 513 + 515: 174(bvec2) INotEqual 512 514 + 516: 425(bvec3) Load 457(bv) + 517: 425(bvec3) VectorShuffle 516 515 3 4 2 + Store 457(bv) 517 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.int32.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.int32.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.int32.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.int32.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,712 @@ +spv.int32.frag +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 493 + + Capability Shader + Capability Float16 + Capability Float64 + Capability Int64 + Capability Int16 + Capability Int8 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_KHX_shader_explicit_arithmetic_types" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + Name 4 "main" + Name 6 "literal(" + Name 8 "typeCast32(" + Name 10 "operators(" + Name 12 "builtinFuncs(" + Name 16 "u32Max" + Name 20 "i32" + Name 27 "Uniforms" + MemberName 27(Uniforms) 0 "index" + Name 29 "" + Name 35 "indexable" + Name 39 "u32" + Name 46 "indexable" + Name 51 "u32v" + Name 54 "i32v" + Name 60 "i64v" + Name 66 "u64v" + Name 78 "f32v" + Name 84 "f64v" + Name 94 "i8v" + Name 103 "i16v" + Name 123 "u8v" + Name 132 "u16v" + Name 152 "f16v" + Name 168 "bv" + Name 186 "u32v" + Name 191 "i32" + Name 210 "i" + Name 214 "uv" + Name 227 "i64" + Name 260 "b" + Name 312 "i32v" + Name 315 "i32" + Name 325 "u32v" + Name 327 "u32" + Name 399 "i8v4" + Name 402 "i16v2" + Name 407 "u8v4" + Name 410 "u16v2" + Name 413 "i64" + Name 416 "u32v2" + Name 418 "u64" + Name 422 "bv" + Name 485 "Block" + MemberName 485(Block) 0 "i32" + MemberName 485(Block) 1 "i32v2" + MemberName 485(Block) 2 "i32v3" + MemberName 485(Block) 3 "i32v4" + MemberName 485(Block) 4 "u32" + MemberName 485(Block) 5 "u32v2" + MemberName 485(Block) 6 "u32v3" + MemberName 485(Block) 7 "u32v4" + Name 487 "block" + Name 488 "si32" + Name 489 "su32" + Name 490 "si" + Name 491 "su" + Name 492 "sb" + MemberDecorate 27(Uniforms) 0 Offset 0 + Decorate 27(Uniforms) Block + Decorate 29 DescriptorSet 0 + Decorate 29 Binding 0 + MemberDecorate 485(Block) 0 Offset 0 + MemberDecorate 485(Block) 1 Offset 8 + MemberDecorate 485(Block) 2 Offset 16 + MemberDecorate 485(Block) 3 Offset 32 + MemberDecorate 485(Block) 4 Offset 48 + MemberDecorate 485(Block) 5 Offset 56 + MemberDecorate 485(Block) 6 Offset 64 + MemberDecorate 485(Block) 7 Offset 80 + Decorate 485(Block) Block + Decorate 487(block) DescriptorSet 0 + Decorate 487(block) Binding 1 + Decorate 488(si32) SpecId 100 + Decorate 489(su32) SpecId 101 + Decorate 490(si) SpecId 102 + Decorate 491(su) SpecId 103 + Decorate 492(sb) SpecId 104 + 2: TypeVoid + 3: TypeFunction 2 + 14: TypeInt 32 0 + 15: TypePointer Private 14(int) + 16(u32Max): 15(ptr) Variable Private + 17: 14(int) Constant 4294967295 + 18: TypeInt 32 1 + 19: TypePointer Function 18(int) + 21: 14(int) Constant 3 + 22: TypeArray 18(int) 21 + 23: 18(int) Constant 4008636143 + 24: 18(int) Constant 4294967295 + 25: 18(int) Constant 536870912 + 26: 22 ConstantComposite 23 24 25 + 27(Uniforms): TypeStruct 14(int) + 28: TypePointer Uniform 27(Uniforms) + 29: 28(ptr) Variable Uniform + 30: 18(int) Constant 0 + 31: TypePointer Uniform 14(int) + 34: TypePointer Function 22 + 38: TypePointer Function 14(int) + 40: TypeArray 14(int) 21 + 41: 14(int) Constant 2147483647 + 42: 40 ConstantComposite 17 17 41 + 45: TypePointer Function 40 + 49: TypeVector 14(int) 2 + 50: TypePointer Function 49(ivec2) + 52: TypeVector 18(int) 2 + 53: TypePointer Function 52(ivec2) + 57: TypeInt 64 1 + 58: TypeVector 57(int) 2 + 59: TypePointer Function 58(ivec2) + 63: TypeInt 64 0 + 64: TypeVector 63(int) 2 + 65: TypePointer Function 64(ivec2) + 75: TypeFloat 32 + 76: TypeVector 75(float) 2 + 77: TypePointer Function 76(fvec2) + 81: TypeFloat 64 + 82: TypeVector 81(float) 2 + 83: TypePointer Function 82(fvec2) + 91: TypeInt 8 1 + 92: TypeVector 91(int) 2 + 93: TypePointer Function 92(ivec2) + 100: TypeInt 16 1 + 101: TypeVector 100(int) 2 + 102: TypePointer Function 101(ivec2) + 120: TypeInt 8 0 + 121: TypeVector 120(int) 2 + 122: TypePointer Function 121(ivec2) + 129: TypeInt 16 0 + 130: TypeVector 129(int) 2 + 131: TypePointer Function 130(ivec2) + 149: TypeFloat 16 + 150: TypeVector 149(float) 2 + 151: TypePointer Function 150(fvec2) + 165: TypeBool + 166: TypeVector 165(bool) 2 + 167: TypePointer Function 166(bvec2) + 170: 18(int) Constant 1 + 171: 52(ivec2) ConstantComposite 30 30 + 172: 52(ivec2) ConstantComposite 170 170 + 175: 14(int) Constant 0 + 176: 14(int) Constant 1 + 177: 49(ivec2) ConstantComposite 175 175 + 178: 49(ivec2) ConstantComposite 176 176 + 184: TypeVector 14(int) 3 + 185: TypePointer Function 184(ivec3) + 188: TypeVector 18(int) 3 + 226: TypePointer Function 57(int) + 251: 14(int) Constant 2 + 259: TypePointer Function 165(bool) + 323: 52(ivec2) ConstantComposite 24 24 + 332: 184(ivec3) ConstantComposite 175 175 175 + 374: 165(bool) ConstantTrue + 381: 165(bool) ConstantFalse + 382: 166(bvec2) ConstantComposite 381 381 + 394: TypeVector 165(bool) 3 + 395: 394(bvec3) ConstantComposite 381 381 381 + 397: TypeVector 91(int) 4 + 398: TypePointer Function 397(ivec4) + 405: TypeVector 120(int) 4 + 406: TypePointer Function 405(ivec4) + 417: TypePointer Function 63(int) + 421: TypePointer Function 394(bvec3) + 483: TypeVector 18(int) 4 + 484: TypeVector 14(int) 4 + 485(Block): TypeStruct 18(int) 52(ivec2) 188(ivec3) 483(ivec4) 14(int) 49(ivec2) 184(ivec3) 484(ivec4) + 486: TypePointer Uniform 485(Block) + 487(block): 486(ptr) Variable Uniform + 488(si32): 18(int) SpecConstant 4294967286 + 489(su32): 14(int) SpecConstant 20 + 490(si): 18(int) SpecConstant 4294967291 + 491(su): 14(int) SpecConstant 4 + 492(sb): 165(bool) SpecConstantTrue + 4(main): 2 Function None 3 + 5: Label + Store 16(u32Max) 17 + Return + FunctionEnd + 6(literal(): 2 Function None 3 + 7: Label + 20(i32): 19(ptr) Variable Function + 35(indexable): 34(ptr) Variable Function + 39(u32): 38(ptr) Variable Function + 46(indexable): 45(ptr) Variable Function + 32: 31(ptr) AccessChain 29 30 + 33: 14(int) Load 32 + Store 35(indexable) 26 + 36: 19(ptr) AccessChain 35(indexable) 33 + 37: 18(int) Load 36 + Store 20(i32) 37 + 43: 31(ptr) AccessChain 29 30 + 44: 14(int) Load 43 + Store 46(indexable) 42 + 47: 38(ptr) AccessChain 46(indexable) 44 + 48: 14(int) Load 47 + Store 39(u32) 48 + Return + FunctionEnd + 8(typeCast32(): 2 Function None 3 + 9: Label + 51(u32v): 50(ptr) Variable Function + 54(i32v): 53(ptr) Variable Function + 60(i64v): 59(ptr) Variable Function + 66(u64v): 65(ptr) Variable Function + 78(f32v): 77(ptr) Variable Function + 84(f64v): 83(ptr) Variable Function + 94(i8v): 93(ptr) Variable Function + 103(i16v): 102(ptr) Variable Function + 123(u8v): 122(ptr) Variable Function + 132(u16v): 131(ptr) Variable Function + 152(f16v): 151(ptr) Variable Function + 168(bv): 167(ptr) Variable Function + 55: 52(ivec2) Load 54(i32v) + 56: 49(ivec2) Bitcast 55 + Store 51(u32v) 56 + 61: 52(ivec2) Load 54(i32v) + 62: 58(ivec2) SConvert 61 + Store 60(i64v) 62 + 67: 52(ivec2) Load 54(i32v) + 68: 58(ivec2) SConvert 67 + 69: 64(ivec2) Bitcast 68 + Store 66(u64v) 69 + 70: 49(ivec2) Load 51(u32v) + 71: 58(ivec2) UConvert 70 + 72: 58(ivec2) Bitcast 71 + Store 60(i64v) 72 + 73: 49(ivec2) Load 51(u32v) + 74: 64(ivec2) UConvert 73 + Store 66(u64v) 74 + 79: 52(ivec2) Load 54(i32v) + 80: 76(fvec2) ConvertSToF 79 + Store 78(f32v) 80 + 85: 52(ivec2) Load 54(i32v) + 86: 82(fvec2) ConvertSToF 85 + Store 84(f64v) 86 + 87: 49(ivec2) Load 51(u32v) + 88: 76(fvec2) ConvertUToF 87 + Store 78(f32v) 88 + 89: 49(ivec2) Load 51(u32v) + 90: 82(fvec2) ConvertUToF 89 + Store 84(f64v) 90 + 95: 52(ivec2) Load 54(i32v) + 96: 92(ivec2) SConvert 95 + Store 94(i8v) 96 + 97: 49(ivec2) Load 51(u32v) + 98: 92(ivec2) UConvert 97 + 99: 92(ivec2) Bitcast 98 + Store 94(i8v) 99 + 104: 52(ivec2) Load 54(i32v) + 105: 101(ivec2) SConvert 104 + Store 103(i16v) 105 + 106: 49(ivec2) Load 51(u32v) + 107: 101(ivec2) UConvert 106 + 108: 101(ivec2) Bitcast 107 + Store 103(i16v) 108 + 109: 52(ivec2) Load 54(i32v) + 110: 18(int) CompositeExtract 109 0 + 111: 18(int) CompositeExtract 109 1 + 112: 52(ivec2) CompositeConstruct 110 111 + Store 54(i32v) 112 + 113: 49(ivec2) Load 51(u32v) + 114: 52(ivec2) Bitcast 113 + Store 54(i32v) 114 + 115: 52(ivec2) Load 54(i32v) + 116: 58(ivec2) SConvert 115 + Store 60(i64v) 116 + 117: 49(ivec2) Load 51(u32v) + 118: 58(ivec2) UConvert 117 + 119: 58(ivec2) Bitcast 118 + Store 60(i64v) 119 + 124: 52(ivec2) Load 54(i32v) + 125: 92(ivec2) SConvert 124 + 126: 121(ivec2) Bitcast 125 + Store 123(u8v) 126 + 127: 49(ivec2) Load 51(u32v) + 128: 121(ivec2) UConvert 127 + Store 123(u8v) 128 + 133: 52(ivec2) Load 54(i32v) + 134: 101(ivec2) SConvert 133 + 135: 130(ivec2) Bitcast 134 + Store 132(u16v) 135 + 136: 49(ivec2) Load 51(u32v) + 137: 130(ivec2) UConvert 136 + Store 132(u16v) 137 + 138: 52(ivec2) Load 54(i32v) + 139: 49(ivec2) Bitcast 138 + Store 51(u32v) 139 + 140: 49(ivec2) Load 51(u32v) + 141: 14(int) CompositeExtract 140 0 + 142: 14(int) CompositeExtract 140 1 + 143: 49(ivec2) CompositeConstruct 141 142 + Store 51(u32v) 143 + 144: 52(ivec2) Load 54(i32v) + 145: 58(ivec2) SConvert 144 + 146: 64(ivec2) Bitcast 145 + Store 66(u64v) 146 + 147: 49(ivec2) Load 51(u32v) + 148: 64(ivec2) UConvert 147 + Store 66(u64v) 148 + 153: 52(ivec2) Load 54(i32v) + 154: 150(fvec2) ConvertSToF 153 + Store 152(f16v) 154 + 155: 52(ivec2) Load 54(i32v) + 156: 76(fvec2) ConvertSToF 155 + Store 78(f32v) 156 + 157: 52(ivec2) Load 54(i32v) + 158: 82(fvec2) ConvertSToF 157 + Store 84(f64v) 158 + 159: 49(ivec2) Load 51(u32v) + 160: 150(fvec2) ConvertUToF 159 + Store 152(f16v) 160 + 161: 49(ivec2) Load 51(u32v) + 162: 76(fvec2) ConvertUToF 161 + Store 78(f32v) 162 + 163: 49(ivec2) Load 51(u32v) + 164: 82(fvec2) ConvertUToF 163 + Store 84(f64v) 164 + 169: 166(bvec2) Load 168(bv) + 173: 52(ivec2) Select 169 172 171 + Store 54(i32v) 173 + 174: 166(bvec2) Load 168(bv) + 179: 49(ivec2) Select 174 178 177 + Store 51(u32v) 179 + 180: 52(ivec2) Load 54(i32v) + 181: 166(bvec2) INotEqual 180 177 + Store 168(bv) 181 + 182: 49(ivec2) Load 51(u32v) + 183: 166(bvec2) INotEqual 182 177 + Store 168(bv) 183 + Return + FunctionEnd + 10(operators(): 2 Function None 3 + 11: Label + 186(u32v): 185(ptr) Variable Function + 191(i32): 19(ptr) Variable Function + 210(i): 19(ptr) Variable Function + 214(uv): 185(ptr) Variable Function + 227(i64): 226(ptr) Variable Function + 260(b): 259(ptr) Variable Function + 187: 184(ivec3) Load 186(u32v) + 189: 188(ivec3) CompositeConstruct 170 170 170 + 190: 184(ivec3) IAdd 187 189 + Store 186(u32v) 190 + 192: 18(int) Load 191(i32) + 193: 18(int) ISub 192 170 + Store 191(i32) 193 + 194: 18(int) Load 191(i32) + 195: 18(int) IAdd 194 170 + Store 191(i32) 195 + 196: 184(ivec3) Load 186(u32v) + 197: 188(ivec3) CompositeConstruct 170 170 170 + 198: 184(ivec3) ISub 196 197 + Store 186(u32v) 198 + 199: 184(ivec3) Load 186(u32v) + 200: 184(ivec3) Not 199 + Store 186(u32v) 200 + 201: 18(int) Load 191(i32) + Store 191(i32) 201 + 202: 184(ivec3) Load 186(u32v) + 203: 184(ivec3) SNegate 202 + Store 186(u32v) 203 + 204: 18(int) Load 191(i32) + 205: 18(int) Load 191(i32) + 206: 18(int) IAdd 205 204 + Store 191(i32) 206 + 207: 184(ivec3) Load 186(u32v) + 208: 184(ivec3) Load 186(u32v) + 209: 184(ivec3) ISub 208 207 + Store 186(u32v) 209 + 211: 18(int) Load 191(i32) + 212: 18(int) Load 210(i) + 213: 18(int) IMul 212 211 + Store 210(i) 213 + 215: 184(ivec3) Load 186(u32v) + 216: 184(ivec3) Load 214(uv) + 217: 184(ivec3) UDiv 216 215 + Store 214(uv) 217 + 218: 18(int) Load 191(i32) + 219: 14(int) Bitcast 218 + 220: 184(ivec3) Load 214(uv) + 221: 184(ivec3) CompositeConstruct 219 219 219 + 222: 184(ivec3) UMod 220 221 + Store 214(uv) 222 + 223: 184(ivec3) Load 186(u32v) + 224: 184(ivec3) Load 214(uv) + 225: 184(ivec3) IAdd 223 224 + Store 214(uv) 225 + 228: 18(int) Load 191(i32) + 229: 57(int) SConvert 228 + 230: 57(int) Load 227(i64) + 231: 57(int) ISub 229 230 + Store 227(i64) 231 + 232: 184(ivec3) Load 186(u32v) + 233: 184(ivec3) Load 214(uv) + 234: 184(ivec3) IMul 232 233 + Store 214(uv) 234 + 235: 18(int) Load 191(i32) + 236: 57(int) SConvert 235 + 237: 57(int) Load 227(i64) + 238: 57(int) IMul 236 237 + Store 227(i64) 238 + 239: 18(int) Load 191(i32) + 240: 18(int) Load 210(i) + 241: 18(int) SMod 239 240 + Store 210(i) 241 + 242: 18(int) Load 191(i32) + 243: 184(ivec3) Load 186(u32v) + 244: 188(ivec3) CompositeConstruct 242 242 242 + 245: 184(ivec3) ShiftLeftLogical 243 244 + Store 186(u32v) 245 + 246: 38(ptr) AccessChain 186(u32v) 176 + 247: 14(int) Load 246 + 248: 18(int) Load 191(i32) + 249: 18(int) ShiftRightArithmetic 248 247 + Store 191(i32) 249 + 250: 57(int) Load 227(i64) + 252: 38(ptr) AccessChain 186(u32v) 251 + 253: 14(int) Load 252 + 254: 57(int) ShiftLeftLogical 250 253 + Store 227(i64) 254 + 255: 184(ivec3) Load 186(u32v) + 256: 18(int) Load 210(i) + 257: 188(ivec3) CompositeConstruct 256 256 256 + 258: 184(ivec3) ShiftLeftLogical 255 257 + Store 214(uv) 258 + 261: 38(ptr) AccessChain 186(u32v) 175 + 262: 14(int) Load 261 + 263: 18(int) Load 191(i32) + 264: 14(int) Bitcast 263 + 265: 165(bool) INotEqual 262 264 + Store 260(b) 265 + 266: 18(int) Load 191(i32) + 267: 14(int) Bitcast 266 + 268: 38(ptr) AccessChain 186(u32v) 175 + 269: 14(int) Load 268 + 270: 165(bool) IEqual 267 269 + Store 260(b) 270 + 271: 38(ptr) AccessChain 186(u32v) 175 + 272: 14(int) Load 271 + 273: 38(ptr) AccessChain 214(uv) 176 + 274: 14(int) Load 273 + 275: 165(bool) UGreaterThan 272 274 + Store 260(b) 275 + 276: 18(int) Load 191(i32) + 277: 18(int) Load 210(i) + 278: 165(bool) SLessThan 276 277 + Store 260(b) 278 + 279: 38(ptr) AccessChain 186(u32v) 176 + 280: 14(int) Load 279 + 281: 38(ptr) AccessChain 214(uv) 175 + 282: 14(int) Load 281 + 283: 165(bool) UGreaterThanEqual 280 282 + Store 260(b) 283 + 284: 18(int) Load 191(i32) + 285: 18(int) Load 210(i) + 286: 165(bool) SLessThanEqual 284 285 + Store 260(b) 286 + 287: 18(int) Load 191(i32) + 288: 14(int) Bitcast 287 + 289: 184(ivec3) Load 214(uv) + 290: 184(ivec3) CompositeConstruct 288 288 288 + 291: 184(ivec3) BitwiseOr 289 290 + Store 214(uv) 291 + 292: 18(int) Load 191(i32) + 293: 18(int) Load 210(i) + 294: 18(int) BitwiseOr 292 293 + Store 210(i) 294 + 295: 18(int) Load 191(i32) + 296: 57(int) SConvert 295 + 297: 57(int) Load 227(i64) + 298: 57(int) BitwiseAnd 297 296 + Store 227(i64) 298 + 299: 184(ivec3) Load 186(u32v) + 300: 184(ivec3) Load 214(uv) + 301: 184(ivec3) BitwiseAnd 299 300 + Store 214(uv) 301 + 302: 18(int) Load 191(i32) + 303: 14(int) Bitcast 302 + 304: 184(ivec3) Load 214(uv) + 305: 184(ivec3) CompositeConstruct 303 303 303 + 306: 184(ivec3) BitwiseXor 304 305 + Store 214(uv) 306 + 307: 184(ivec3) Load 186(u32v) + 308: 18(int) Load 191(i32) + 309: 14(int) Bitcast 308 + 310: 184(ivec3) CompositeConstruct 309 309 309 + 311: 184(ivec3) BitwiseXor 307 310 + Store 186(u32v) 311 + Return + FunctionEnd +12(builtinFuncs(): 2 Function None 3 + 13: Label + 312(i32v): 53(ptr) Variable Function + 315(i32): 19(ptr) Variable Function + 325(u32v): 185(ptr) Variable Function + 327(u32): 38(ptr) Variable Function + 399(i8v4): 398(ptr) Variable Function + 402(i16v2): 102(ptr) Variable Function + 407(u8v4): 406(ptr) Variable Function + 410(u16v2): 131(ptr) Variable Function + 413(i64): 226(ptr) Variable Function + 416(u32v2): 50(ptr) Variable Function + 418(u64): 417(ptr) Variable Function + 422(bv): 421(ptr) Variable Function + 313: 52(ivec2) Load 312(i32v) + 314: 52(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 313 + Store 312(i32v) 314 + 316: 18(int) Load 315(i32) + 317: 18(int) ExtInst 1(GLSL.std.450) 7(SSign) 316 + Store 315(i32) 317 + 318: 52(ivec2) Load 312(i32v) + 319: 18(int) Load 315(i32) + 320: 52(ivec2) CompositeConstruct 319 319 + 321: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 318 320 + Store 312(i32v) 321 + 322: 52(ivec2) Load 312(i32v) + 324: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 322 323 + Store 312(i32v) 324 + 326: 184(ivec3) Load 325(u32v) + 328: 14(int) Load 327(u32) + 329: 184(ivec3) CompositeConstruct 328 328 328 + 330: 184(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 326 329 + Store 325(u32v) 330 + 331: 184(ivec3) Load 325(u32v) + 333: 184(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 331 332 + Store 325(u32v) 333 + 334: 52(ivec2) Load 312(i32v) + 335: 18(int) Load 315(i32) + 336: 52(ivec2) CompositeConstruct 335 335 + 337: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 334 336 + Store 312(i32v) 337 + 338: 52(ivec2) Load 312(i32v) + 339: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 338 323 + Store 312(i32v) 339 + 340: 184(ivec3) Load 325(u32v) + 341: 14(int) Load 327(u32) + 342: 184(ivec3) CompositeConstruct 341 341 341 + 343: 184(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 340 342 + Store 325(u32v) 343 + 344: 184(ivec3) Load 325(u32v) + 345: 184(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 344 332 + Store 325(u32v) 345 + 346: 52(ivec2) Load 312(i32v) + 347: 18(int) Load 315(i32) + 348: 18(int) SNegate 347 + 349: 18(int) Load 315(i32) + 350: 52(ivec2) CompositeConstruct 348 348 + 351: 52(ivec2) CompositeConstruct 349 349 + 352: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 346 350 351 + Store 312(i32v) 352 + 353: 52(ivec2) Load 312(i32v) + 354: 52(ivec2) Load 312(i32v) + 355: 52(ivec2) SNegate 354 + 356: 52(ivec2) Load 312(i32v) + 357: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 353 355 356 + Store 312(i32v) 357 + 358: 184(ivec3) Load 325(u32v) + 359: 14(int) Load 327(u32) + 360: 14(int) SNegate 359 + 361: 14(int) Load 327(u32) + 362: 184(ivec3) CompositeConstruct 360 360 360 + 363: 184(ivec3) CompositeConstruct 361 361 361 + 364: 184(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 358 362 363 + Store 325(u32v) 364 + 365: 184(ivec3) Load 325(u32v) + 366: 184(ivec3) Load 325(u32v) + 367: 184(ivec3) SNegate 366 + 368: 184(ivec3) Load 325(u32v) + 369: 184(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 365 367 368 + Store 325(u32v) 369 + 370: 19(ptr) AccessChain 312(i32v) 175 + 371: 18(int) Load 370 + 372: 19(ptr) AccessChain 312(i32v) 176 + 373: 18(int) Load 372 + 375: 18(int) Select 374 373 371 + Store 315(i32) 375 + 376: 18(int) Load 315(i32) + 377: 52(ivec2) CompositeConstruct 376 376 + 378: 18(int) Load 315(i32) + 379: 18(int) SNegate 378 + 380: 52(ivec2) CompositeConstruct 379 379 + 383: 52(ivec2) Select 382 380 377 + Store 312(i32v) 383 + 384: 38(ptr) AccessChain 325(u32v) 175 + 385: 14(int) Load 384 + 386: 38(ptr) AccessChain 325(u32v) 176 + 387: 14(int) Load 386 + 388: 14(int) Select 374 387 385 + Store 327(u32) 388 + 389: 14(int) Load 327(u32) + 390: 184(ivec3) CompositeConstruct 389 389 389 + 391: 14(int) Load 327(u32) + 392: 14(int) SNegate 391 + 393: 184(ivec3) CompositeConstruct 392 392 392 + 396: 184(ivec3) Select 395 393 390 + Store 325(u32v) 396 + 400: 397(ivec4) Load 399(i8v4) + 401: 18(int) Bitcast 400 + Store 315(i32) 401 + 403: 101(ivec2) Load 402(i16v2) + 404: 18(int) Bitcast 403 + Store 315(i32) 404 + 408: 405(ivec4) Load 407(u8v4) + 409: 14(int) Bitcast 408 + Store 327(u32) 409 + 411: 130(ivec2) Load 410(u16v2) + 412: 14(int) Bitcast 411 + Store 327(u32) 412 + 414: 57(int) Load 413(i64) + 415: 52(ivec2) Bitcast 414 + Store 312(i32v) 415 + 419: 63(int) Load 418(u64) + 420: 49(ivec2) Bitcast 419 + Store 416(u32v2) 420 + 423: 184(ivec3) Load 325(u32v) + 424: 14(int) Load 327(u32) + 425: 184(ivec3) CompositeConstruct 424 424 424 + 426: 394(bvec3) ULessThan 423 425 + Store 422(bv) 426 + 427: 52(ivec2) Load 312(i32v) + 428: 18(int) Load 315(i32) + 429: 52(ivec2) CompositeConstruct 428 428 + 430: 166(bvec2) SLessThan 427 429 + 431: 394(bvec3) Load 422(bv) + 432: 394(bvec3) VectorShuffle 431 430 3 4 2 + Store 422(bv) 432 + 433: 184(ivec3) Load 325(u32v) + 434: 14(int) Load 327(u32) + 435: 184(ivec3) CompositeConstruct 434 434 434 + 436: 394(bvec3) ULessThanEqual 433 435 + Store 422(bv) 436 + 437: 52(ivec2) Load 312(i32v) + 438: 18(int) Load 315(i32) + 439: 52(ivec2) CompositeConstruct 438 438 + 440: 166(bvec2) SLessThanEqual 437 439 + 441: 394(bvec3) Load 422(bv) + 442: 394(bvec3) VectorShuffle 441 440 3 4 2 + Store 422(bv) 442 + 443: 184(ivec3) Load 325(u32v) + 444: 14(int) Load 327(u32) + 445: 184(ivec3) CompositeConstruct 444 444 444 + 446: 394(bvec3) UGreaterThan 443 445 + Store 422(bv) 446 + 447: 52(ivec2) Load 312(i32v) + 448: 18(int) Load 315(i32) + 449: 52(ivec2) CompositeConstruct 448 448 + 450: 166(bvec2) SGreaterThan 447 449 + 451: 394(bvec3) Load 422(bv) + 452: 394(bvec3) VectorShuffle 451 450 3 4 2 + Store 422(bv) 452 + 453: 184(ivec3) Load 325(u32v) + 454: 14(int) Load 327(u32) + 455: 184(ivec3) CompositeConstruct 454 454 454 + 456: 394(bvec3) UGreaterThanEqual 453 455 + Store 422(bv) 456 + 457: 52(ivec2) Load 312(i32v) + 458: 18(int) Load 315(i32) + 459: 52(ivec2) CompositeConstruct 458 458 + 460: 166(bvec2) SGreaterThanEqual 457 459 + 461: 394(bvec3) Load 422(bv) + 462: 394(bvec3) VectorShuffle 461 460 3 4 2 + Store 422(bv) 462 + 463: 184(ivec3) Load 325(u32v) + 464: 14(int) Load 327(u32) + 465: 184(ivec3) CompositeConstruct 464 464 464 + 466: 394(bvec3) IEqual 463 465 + Store 422(bv) 466 + 467: 52(ivec2) Load 312(i32v) + 468: 18(int) Load 315(i32) + 469: 52(ivec2) CompositeConstruct 468 468 + 470: 166(bvec2) IEqual 467 469 + 471: 394(bvec3) Load 422(bv) + 472: 394(bvec3) VectorShuffle 471 470 3 4 2 + Store 422(bv) 472 + 473: 184(ivec3) Load 325(u32v) + 474: 14(int) Load 327(u32) + 475: 184(ivec3) CompositeConstruct 474 474 474 + 476: 394(bvec3) INotEqual 473 475 + Store 422(bv) 476 + 477: 52(ivec2) Load 312(i32v) + 478: 18(int) Load 315(i32) + 479: 52(ivec2) CompositeConstruct 478 478 + 480: 166(bvec2) INotEqual 477 479 + 481: 394(bvec3) Load 422(bv) + 482: 394(bvec3) VectorShuffle 481 480 3 4 2 + Store 422(bv) 482 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.int64.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.int64.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.int64.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.int64.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,7 +1,7 @@ spv.int64.frag // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 480 +// Generated by (magic number): 80006 +// Id's are bound by 488 Capability Shader Capability Float64 @@ -12,6 +12,7 @@ ExecutionMode 4 OriginUpperLeft Source GLSL 450 SourceExtension "GL_ARB_gpu_shader_int64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" Name 4 "main" Name 6 "literal(" Name 8 "typeCast(" @@ -36,38 +37,38 @@ Name 139 "i64" Name 159 "i" Name 166 "uv" - Name 218 "b" - Name 278 "i64v" - Name 281 "i64" - Name 291 "u64v" - Name 293 "u64" - Name 365 "dv" - Name 384 "iv" - Name 389 "uv" - Name 393 "bv" - Name 454 "Block" - MemberName 454(Block) 0 "i64v" - MemberName 454(Block) 1 "u64" - Name 456 "block" - Name 457 "si64" - Name 458 "su64" - Name 459 "si" - Name 460 "su" - Name 461 "sb" + Name 226 "b" + Name 286 "i64v" + Name 289 "i64" + Name 299 "u64v" + Name 301 "u64" + Name 373 "dv" + Name 392 "iv" + Name 397 "uv" + Name 401 "bv" + Name 462 "Block" + MemberName 462(Block) 0 "i64v" + MemberName 462(Block) 1 "u64" + Name 464 "block" + Name 465 "si64" + Name 466 "su64" + Name 467 "si" + Name 468 "su" + Name 469 "sb" MemberDecorate 28(Uniforms) 0 Offset 0 Decorate 28(Uniforms) Block Decorate 30 DescriptorSet 0 Decorate 30 Binding 0 - MemberDecorate 454(Block) 0 Offset 0 - MemberDecorate 454(Block) 1 Offset 24 - Decorate 454(Block) Block - Decorate 456(block) DescriptorSet 0 - Decorate 456(block) Binding 1 - Decorate 457(si64) SpecId 100 - Decorate 458(su64) SpecId 101 - Decorate 459(si) SpecId 102 - Decorate 460(su) SpecId 103 - Decorate 461(sb) SpecId 104 + MemberDecorate 462(Block) 0 Offset 0 + MemberDecorate 462(Block) 1 Offset 24 + Decorate 462(Block) Block + Decorate 464(block) DescriptorSet 0 + Decorate 464(block) Binding 1 + Decorate 465(si64) SpecId 100 + Decorate 466(su64) SpecId 101 + Decorate 467(si) SpecId 102 + Decorate 468(su) SpecId 103 + Decorate 469(sb) SpecId 104 2: TypeVoid 3: TypeFunction 2 14: TypeInt 64 0 @@ -128,52 +129,52 @@ 164: TypeVector 21(int) 3 165: TypePointer Function 164(ivec3) 199: TypeVector 31(int) 3 - 202: 21(int) Constant 1 - 203: TypePointer Function 21(int) - 209: 21(int) Constant 2 - 217: TypePointer Function 55(bool) - 219: 21(int) Constant 0 - 289: 52(ivec2) ConstantComposite 25 25 - 298: 132(ivec3) ConstantComposite 69 69 69 - 340: 55(bool) ConstantTrue - 347: 55(bool) ConstantFalse - 348: 56(bvec2) ConstantComposite 347 347 - 360: TypeVector 55(bool) 3 - 361: 360(bvec3) ConstantComposite 347 347 347 - 363: TypeVector 94(float) 3 - 364: TypePointer Function 363(fvec3) - 369: TypePointer Function 94(float) - 380: 31(int) Constant 1 - 381: 31(int) Constant 2 - 382: 74(ivec2) ConstantComposite 380 381 - 387: 81(ivec2) ConstantComposite 209 22 - 392: TypePointer Function 360(bvec3) - 454(Block): TypeStruct 136(ivec3) 14(int) - 455: TypePointer Uniform 454(Block) - 456(block): 455(ptr) Variable Uniform - 457(si64): 18(int) SpecConstant 4294967286 4294967295 - 458(su64): 14(int) SpecConstant 20 0 - 459(si): 31(int) SpecConstant 4294967291 - 460(su): 21(int) SpecConstant 4 - 461(sb): 55(bool) SpecConstantTrue - 462: 55(bool) SpecConstantOp 171 457(si64) 69 - 463: 55(bool) SpecConstantOp 171 458(su64) 69 - 464: 18(int) SpecConstantOp 169 461(sb) 61 60 - 465: 14(int) SpecConstantOp 169 461(sb) 70 69 - 466: 31(int) SpecConstantOp 114 457(si64) - 467: 18(int) SpecConstantOp 114 459(si) - 468: 21(int) SpecConstantOp 113 458(su64) - 469: 14(int) SpecConstantOp 113 460(su) - 470: 18(int) SpecConstantOp 128 458(su64) 69 - 471: 14(int) SpecConstantOp 128 457(si64) 69 - 472: 21(int) SpecConstantOp 113 458(su64) - 473: 31(int) SpecConstantOp 128 472 219 - 474: 18(int) SpecConstantOp 114 459(si) - 475: 14(int) SpecConstantOp 128 474 69 - 476: 31(int) SpecConstantOp 114 457(si64) - 477: 21(int) SpecConstantOp 128 476 219 - 478: 14(int) SpecConstantOp 113 460(su) - 479: 18(int) SpecConstantOp 128 478 69 + 203: 21(int) Constant 1 + 204: TypePointer Function 21(int) + 217: 21(int) Constant 2 + 225: TypePointer Function 55(bool) + 227: 21(int) Constant 0 + 297: 52(ivec2) ConstantComposite 25 25 + 306: 132(ivec3) ConstantComposite 69 69 69 + 348: 55(bool) ConstantTrue + 355: 55(bool) ConstantFalse + 356: 56(bvec2) ConstantComposite 355 355 + 368: TypeVector 55(bool) 3 + 369: 368(bvec3) ConstantComposite 355 355 355 + 371: TypeVector 94(float) 3 + 372: TypePointer Function 371(fvec3) + 377: TypePointer Function 94(float) + 388: 31(int) Constant 1 + 389: 31(int) Constant 2 + 390: 74(ivec2) ConstantComposite 388 389 + 395: 81(ivec2) ConstantComposite 217 22 + 400: TypePointer Function 368(bvec3) + 462(Block): TypeStruct 136(ivec3) 14(int) + 463: TypePointer Uniform 462(Block) + 464(block): 463(ptr) Variable Uniform + 465(si64): 18(int) SpecConstant 4294967286 4294967295 + 466(su64): 14(int) SpecConstant 20 0 + 467(si): 31(int) SpecConstant 4294967291 + 468(su): 21(int) SpecConstant 4 + 469(sb): 55(bool) SpecConstantTrue + 470: 55(bool) SpecConstantOp 171 465(si64) 69 + 471: 55(bool) SpecConstantOp 171 466(su64) 69 + 472: 18(int) SpecConstantOp 169 469(sb) 61 60 + 473: 14(int) SpecConstantOp 169 469(sb) 70 69 + 474: 31(int) SpecConstantOp 114 465(si64) + 475: 18(int) SpecConstantOp 114 467(si) + 476: 21(int) SpecConstantOp 113 466(su64) + 477: 14(int) SpecConstantOp 113 468(su) + 478: 18(int) SpecConstantOp 128 466(su64) 69 + 479: 14(int) SpecConstantOp 128 465(si64) 69 + 480: 31(int) SpecConstantOp 113 466(su64) + 481: 31(int) SpecConstantOp 128 480 227 + 482: 18(int) SpecConstantOp 114 467(si) + 483: 14(int) SpecConstantOp 128 482 69 + 484: 31(int) SpecConstantOp 114 465(si64) + 485: 21(int) SpecConstantOp 128 484 227 + 486: 18(int) SpecConstantOp 113 468(su) + 487: 18(int) SpecConstantOp 128 486 69 4(main): 2 Function None 3 5: Label Store 16(u64Max) 17 @@ -267,11 +268,11 @@ 122: 81(ivec2) Bitcast 121 Store 83(uv) 122 123: 81(ivec2) Load 83(uv) - 124: 65(ivec2) UConvert 123 + 124: 52(ivec2) UConvert 123 125: 52(ivec2) Bitcast 124 Store 54(i64v) 125 126: 65(ivec2) Load 67(u64v) - 127: 81(ivec2) UConvert 126 + 127: 74(ivec2) UConvert 126 128: 74(ivec2) Bitcast 127 Store 76(iv) 128 129: 74(ivec2) Load 76(iv) @@ -286,7 +287,7 @@ 139(i64): 19(ptr) Variable Function 159(i): 158(ptr) Variable Function 166(uv): 165(ptr) Variable Function - 218(b): 217(ptr) Variable Function + 226(b): 225(ptr) Variable Function 135: 132(ivec3) Load 134(u64v) 137: 136(ivec3) CompositeConstruct 61 61 61 138: 132(ivec3) IAdd 135 137 @@ -359,298 +360,308 @@ 195: 18(int) SConvert 194 196: 18(int) SMod 193 195 Store 139(i64) 196 - 197: 31(int) Load 159(i) - 198: 132(ivec3) Load 134(u64v) - 200: 199(ivec3) CompositeConstruct 197 197 197 - 201: 132(ivec3) ShiftLeftLogical 198 200 + 197: 132(ivec3) Load 134(u64v) + 198: 31(int) Load 159(i) + 200: 199(ivec3) CompositeConstruct 198 198 198 + 201: 132(ivec3) ShiftLeftLogical 197 200 Store 134(u64v) 201 - 204: 203(ptr) AccessChain 166(uv) 202 - 205: 21(int) Load 204 - 206: 18(int) Load 139(i64) - 207: 18(int) ShiftRightArithmetic 206 205 + 202: 18(int) Load 139(i64) + 205: 204(ptr) AccessChain 166(uv) 203 + 206: 21(int) Load 205 + 207: 18(int) ShiftRightArithmetic 202 206 Store 139(i64) 207 - 208: 18(int) Load 139(i64) - 210: 40(ptr) AccessChain 134(u64v) 209 - 211: 14(int) Load 210 - 212: 18(int) ShiftLeftLogical 208 211 - Store 139(i64) 212 - 213: 132(ivec3) Load 134(u64v) + 208: 31(int) Load 159(i) + 209: 132(ivec3) Load 134(u64v) + 210: 199(ivec3) CompositeConstruct 208 208 208 + 211: 132(ivec3) ShiftLeftLogical 209 210 + Store 134(u64v) 211 + 212: 204(ptr) AccessChain 166(uv) 203 + 213: 21(int) Load 212 214: 18(int) Load 139(i64) - 215: 136(ivec3) CompositeConstruct 214 214 214 - 216: 132(ivec3) ShiftLeftLogical 213 215 - Store 134(u64v) 216 - 220: 40(ptr) AccessChain 134(u64v) 219 - 221: 14(int) Load 220 + 215: 18(int) ShiftRightArithmetic 214 213 + Store 139(i64) 215 + 216: 18(int) Load 139(i64) + 218: 40(ptr) AccessChain 134(u64v) 217 + 219: 14(int) Load 218 + 220: 18(int) ShiftLeftLogical 216 219 + Store 139(i64) 220 + 221: 132(ivec3) Load 134(u64v) 222: 18(int) Load 139(i64) - 223: 14(int) Bitcast 222 - 224: 55(bool) INotEqual 221 223 - Store 218(b) 224 - 225: 18(int) Load 139(i64) - 226: 14(int) Bitcast 225 - 227: 40(ptr) AccessChain 134(u64v) 219 - 228: 14(int) Load 227 - 229: 55(bool) IEqual 226 228 - Store 218(b) 229 - 230: 40(ptr) AccessChain 134(u64v) 219 - 231: 14(int) Load 230 - 232: 203(ptr) AccessChain 166(uv) 202 - 233: 21(int) Load 232 - 234: 14(int) UConvert 233 - 235: 55(bool) UGreaterThan 231 234 - Store 218(b) 235 - 236: 18(int) Load 139(i64) - 237: 31(int) Load 159(i) - 238: 18(int) SConvert 237 - 239: 55(bool) SLessThan 236 238 - Store 218(b) 239 - 240: 40(ptr) AccessChain 134(u64v) 202 - 241: 14(int) Load 240 - 242: 203(ptr) AccessChain 166(uv) 219 - 243: 21(int) Load 242 - 244: 14(int) UConvert 243 - 245: 55(bool) UGreaterThanEqual 241 244 - Store 218(b) 245 - 246: 18(int) Load 139(i64) - 247: 31(int) Load 159(i) - 248: 18(int) SConvert 247 - 249: 55(bool) SLessThanEqual 246 248 - Store 218(b) 249 - 250: 31(int) Load 159(i) - 251: 18(int) SConvert 250 - 252: 14(int) Bitcast 251 - 253: 132(ivec3) Load 134(u64v) - 254: 132(ivec3) CompositeConstruct 252 252 252 - 255: 132(ivec3) BitwiseOr 253 254 - Store 134(u64v) 255 - 256: 18(int) Load 139(i64) - 257: 31(int) Load 159(i) - 258: 18(int) SConvert 257 - 259: 18(int) BitwiseOr 256 258 - Store 139(i64) 259 - 260: 31(int) Load 159(i) - 261: 18(int) SConvert 260 - 262: 18(int) Load 139(i64) - 263: 18(int) BitwiseAnd 262 261 - Store 139(i64) 263 - 264: 132(ivec3) Load 134(u64v) - 265: 164(ivec3) Load 166(uv) - 266: 132(ivec3) UConvert 265 - 267: 132(ivec3) BitwiseAnd 264 266 - Store 134(u64v) 267 - 268: 18(int) Load 139(i64) - 269: 14(int) Bitcast 268 - 270: 132(ivec3) Load 134(u64v) - 271: 132(ivec3) CompositeConstruct 269 269 269 - 272: 132(ivec3) BitwiseXor 270 271 - Store 134(u64v) 272 - 273: 132(ivec3) Load 134(u64v) - 274: 18(int) Load 139(i64) - 275: 14(int) Bitcast 274 - 276: 132(ivec3) CompositeConstruct 275 275 275 - 277: 132(ivec3) BitwiseXor 273 276 - Store 134(u64v) 277 + 223: 136(ivec3) CompositeConstruct 222 222 222 + 224: 132(ivec3) ShiftLeftLogical 221 223 + Store 134(u64v) 224 + 228: 40(ptr) AccessChain 134(u64v) 227 + 229: 14(int) Load 228 + 230: 18(int) Load 139(i64) + 231: 14(int) Bitcast 230 + 232: 55(bool) INotEqual 229 231 + Store 226(b) 232 + 233: 18(int) Load 139(i64) + 234: 14(int) Bitcast 233 + 235: 40(ptr) AccessChain 134(u64v) 227 + 236: 14(int) Load 235 + 237: 55(bool) IEqual 234 236 + Store 226(b) 237 + 238: 40(ptr) AccessChain 134(u64v) 227 + 239: 14(int) Load 238 + 240: 204(ptr) AccessChain 166(uv) 203 + 241: 21(int) Load 240 + 242: 14(int) UConvert 241 + 243: 55(bool) UGreaterThan 239 242 + Store 226(b) 243 + 244: 18(int) Load 139(i64) + 245: 31(int) Load 159(i) + 246: 18(int) SConvert 245 + 247: 55(bool) SLessThan 244 246 + Store 226(b) 247 + 248: 40(ptr) AccessChain 134(u64v) 203 + 249: 14(int) Load 248 + 250: 204(ptr) AccessChain 166(uv) 227 + 251: 21(int) Load 250 + 252: 14(int) UConvert 251 + 253: 55(bool) UGreaterThanEqual 249 252 + Store 226(b) 253 + 254: 18(int) Load 139(i64) + 255: 31(int) Load 159(i) + 256: 18(int) SConvert 255 + 257: 55(bool) SLessThanEqual 254 256 + Store 226(b) 257 + 258: 31(int) Load 159(i) + 259: 18(int) SConvert 258 + 260: 14(int) Bitcast 259 + 261: 132(ivec3) Load 134(u64v) + 262: 132(ivec3) CompositeConstruct 260 260 260 + 263: 132(ivec3) BitwiseOr 261 262 + Store 134(u64v) 263 + 264: 18(int) Load 139(i64) + 265: 31(int) Load 159(i) + 266: 18(int) SConvert 265 + 267: 18(int) BitwiseOr 264 266 + Store 139(i64) 267 + 268: 31(int) Load 159(i) + 269: 18(int) SConvert 268 + 270: 18(int) Load 139(i64) + 271: 18(int) BitwiseAnd 270 269 + Store 139(i64) 271 + 272: 132(ivec3) Load 134(u64v) + 273: 164(ivec3) Load 166(uv) + 274: 132(ivec3) UConvert 273 + 275: 132(ivec3) BitwiseAnd 272 274 + Store 134(u64v) 275 + 276: 18(int) Load 139(i64) + 277: 14(int) Bitcast 276 + 278: 132(ivec3) Load 134(u64v) + 279: 132(ivec3) CompositeConstruct 277 277 277 + 280: 132(ivec3) BitwiseXor 278 279 + Store 134(u64v) 280 + 281: 132(ivec3) Load 134(u64v) + 282: 18(int) Load 139(i64) + 283: 14(int) Bitcast 282 + 284: 132(ivec3) CompositeConstruct 283 283 283 + 285: 132(ivec3) BitwiseXor 281 284 + Store 134(u64v) 285 Return FunctionEnd 12(builtinFuncs(): 2 Function None 3 13: Label - 278(i64v): 53(ptr) Variable Function - 281(i64): 19(ptr) Variable Function - 291(u64v): 133(ptr) Variable Function - 293(u64): 40(ptr) Variable Function - 365(dv): 364(ptr) Variable Function - 384(iv): 75(ptr) Variable Function - 389(uv): 82(ptr) Variable Function - 393(bv): 392(ptr) Variable Function - 279: 52(ivec2) Load 278(i64v) - 280: 52(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 279 - Store 278(i64v) 280 - 282: 18(int) Load 281(i64) - 283: 18(int) ExtInst 1(GLSL.std.450) 7(SSign) 282 - Store 281(i64) 283 - 284: 52(ivec2) Load 278(i64v) - 285: 18(int) Load 281(i64) - 286: 52(ivec2) CompositeConstruct 285 285 - 287: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 284 286 - Store 278(i64v) 287 - 288: 52(ivec2) Load 278(i64v) - 290: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 288 289 - Store 278(i64v) 290 - 292: 132(ivec3) Load 291(u64v) - 294: 14(int) Load 293(u64) - 295: 132(ivec3) CompositeConstruct 294 294 294 - 296: 132(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 292 295 - Store 291(u64v) 296 - 297: 132(ivec3) Load 291(u64v) - 299: 132(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 297 298 - Store 291(u64v) 299 - 300: 52(ivec2) Load 278(i64v) - 301: 18(int) Load 281(i64) - 302: 52(ivec2) CompositeConstruct 301 301 - 303: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 300 302 - Store 278(i64v) 303 - 304: 52(ivec2) Load 278(i64v) - 305: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 304 289 - Store 278(i64v) 305 - 306: 132(ivec3) Load 291(u64v) - 307: 14(int) Load 293(u64) - 308: 132(ivec3) CompositeConstruct 307 307 307 - 309: 132(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 306 308 - Store 291(u64v) 309 - 310: 132(ivec3) Load 291(u64v) - 311: 132(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 310 298 - Store 291(u64v) 311 - 312: 52(ivec2) Load 278(i64v) - 313: 18(int) Load 281(i64) - 314: 18(int) SNegate 313 - 315: 18(int) Load 281(i64) - 316: 52(ivec2) CompositeConstruct 314 314 - 317: 52(ivec2) CompositeConstruct 315 315 - 318: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 312 316 317 - Store 278(i64v) 318 - 319: 52(ivec2) Load 278(i64v) - 320: 52(ivec2) Load 278(i64v) - 321: 52(ivec2) SNegate 320 - 322: 52(ivec2) Load 278(i64v) - 323: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 319 321 322 - Store 278(i64v) 323 - 324: 132(ivec3) Load 291(u64v) - 325: 14(int) Load 293(u64) - 326: 14(int) SNegate 325 - 327: 14(int) Load 293(u64) - 328: 132(ivec3) CompositeConstruct 326 326 326 - 329: 132(ivec3) CompositeConstruct 327 327 327 - 330: 132(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 324 328 329 - Store 291(u64v) 330 - 331: 132(ivec3) Load 291(u64v) - 332: 132(ivec3) Load 291(u64v) - 333: 132(ivec3) SNegate 332 - 334: 132(ivec3) Load 291(u64v) - 335: 132(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 331 333 334 - Store 291(u64v) 335 - 336: 19(ptr) AccessChain 278(i64v) 219 - 337: 18(int) Load 336 - 338: 19(ptr) AccessChain 278(i64v) 202 - 339: 18(int) Load 338 - 341: 18(int) Select 340 339 337 - Store 281(i64) 341 - 342: 18(int) Load 281(i64) - 343: 52(ivec2) CompositeConstruct 342 342 - 344: 18(int) Load 281(i64) - 345: 18(int) SNegate 344 - 346: 52(ivec2) CompositeConstruct 345 345 - 349: 52(ivec2) Select 348 346 343 - Store 278(i64v) 349 - 350: 40(ptr) AccessChain 291(u64v) 219 - 351: 14(int) Load 350 - 352: 40(ptr) AccessChain 291(u64v) 202 - 353: 14(int) Load 352 - 354: 14(int) Select 340 353 351 - Store 293(u64) 354 - 355: 14(int) Load 293(u64) - 356: 132(ivec3) CompositeConstruct 355 355 355 - 357: 14(int) Load 293(u64) - 358: 14(int) SNegate 357 - 359: 132(ivec3) CompositeConstruct 358 358 358 - 362: 132(ivec3) Select 361 359 356 - Store 291(u64v) 362 - 366: 363(fvec3) Load 365(dv) - 367: 95(fvec2) VectorShuffle 366 366 0 1 - 368: 52(ivec2) Bitcast 367 - Store 278(i64v) 368 - 370: 369(ptr) AccessChain 365(dv) 209 - 371: 94(float) Load 370 - 372: 14(int) Bitcast 371 - 373: 40(ptr) AccessChain 291(u64v) 219 - Store 373 372 - 374: 52(ivec2) Load 278(i64v) - 375: 95(fvec2) Bitcast 374 - 376: 363(fvec3) Load 365(dv) - 377: 363(fvec3) VectorShuffle 376 375 3 4 2 - Store 365(dv) 377 - 378: 132(ivec3) Load 291(u64v) - 379: 363(fvec3) Bitcast 378 - Store 365(dv) 379 - 383: 18(int) Bitcast 382 - Store 281(i64) 383 - 385: 18(int) Load 281(i64) - 386: 74(ivec2) Bitcast 385 - Store 384(iv) 386 - 388: 14(int) Bitcast 387 - Store 293(u64) 388 - 390: 14(int) Load 293(u64) - 391: 81(ivec2) Bitcast 390 - Store 389(uv) 391 - 394: 132(ivec3) Load 291(u64v) - 395: 14(int) Load 293(u64) - 396: 132(ivec3) CompositeConstruct 395 395 395 - 397: 360(bvec3) ULessThan 394 396 - Store 393(bv) 397 - 398: 52(ivec2) Load 278(i64v) - 399: 18(int) Load 281(i64) - 400: 52(ivec2) CompositeConstruct 399 399 - 401: 56(bvec2) SLessThan 398 400 - 402: 360(bvec3) Load 393(bv) - 403: 360(bvec3) VectorShuffle 402 401 3 4 2 - Store 393(bv) 403 - 404: 132(ivec3) Load 291(u64v) - 405: 14(int) Load 293(u64) - 406: 132(ivec3) CompositeConstruct 405 405 405 - 407: 360(bvec3) ULessThanEqual 404 406 - Store 393(bv) 407 - 408: 52(ivec2) Load 278(i64v) - 409: 18(int) Load 281(i64) - 410: 52(ivec2) CompositeConstruct 409 409 - 411: 56(bvec2) SLessThanEqual 408 410 - 412: 360(bvec3) Load 393(bv) - 413: 360(bvec3) VectorShuffle 412 411 3 4 2 - Store 393(bv) 413 - 414: 132(ivec3) Load 291(u64v) - 415: 14(int) Load 293(u64) - 416: 132(ivec3) CompositeConstruct 415 415 415 - 417: 360(bvec3) UGreaterThan 414 416 - Store 393(bv) 417 - 418: 52(ivec2) Load 278(i64v) - 419: 18(int) Load 281(i64) - 420: 52(ivec2) CompositeConstruct 419 419 - 421: 56(bvec2) SGreaterThan 418 420 - 422: 360(bvec3) Load 393(bv) - 423: 360(bvec3) VectorShuffle 422 421 3 4 2 - Store 393(bv) 423 - 424: 132(ivec3) Load 291(u64v) - 425: 14(int) Load 293(u64) - 426: 132(ivec3) CompositeConstruct 425 425 425 - 427: 360(bvec3) UGreaterThanEqual 424 426 - Store 393(bv) 427 - 428: 52(ivec2) Load 278(i64v) - 429: 18(int) Load 281(i64) - 430: 52(ivec2) CompositeConstruct 429 429 - 431: 56(bvec2) SGreaterThanEqual 428 430 - 432: 360(bvec3) Load 393(bv) - 433: 360(bvec3) VectorShuffle 432 431 3 4 2 - Store 393(bv) 433 - 434: 132(ivec3) Load 291(u64v) - 435: 14(int) Load 293(u64) - 436: 132(ivec3) CompositeConstruct 435 435 435 - 437: 360(bvec3) IEqual 434 436 - Store 393(bv) 437 - 438: 52(ivec2) Load 278(i64v) - 439: 18(int) Load 281(i64) - 440: 52(ivec2) CompositeConstruct 439 439 - 441: 56(bvec2) IEqual 438 440 - 442: 360(bvec3) Load 393(bv) - 443: 360(bvec3) VectorShuffle 442 441 3 4 2 - Store 393(bv) 443 - 444: 132(ivec3) Load 291(u64v) - 445: 14(int) Load 293(u64) - 446: 132(ivec3) CompositeConstruct 445 445 445 - 447: 360(bvec3) INotEqual 444 446 - Store 393(bv) 447 - 448: 52(ivec2) Load 278(i64v) - 449: 18(int) Load 281(i64) - 450: 52(ivec2) CompositeConstruct 449 449 - 451: 56(bvec2) INotEqual 448 450 - 452: 360(bvec3) Load 393(bv) - 453: 360(bvec3) VectorShuffle 452 451 3 4 2 - Store 393(bv) 453 + 286(i64v): 53(ptr) Variable Function + 289(i64): 19(ptr) Variable Function + 299(u64v): 133(ptr) Variable Function + 301(u64): 40(ptr) Variable Function + 373(dv): 372(ptr) Variable Function + 392(iv): 75(ptr) Variable Function + 397(uv): 82(ptr) Variable Function + 401(bv): 400(ptr) Variable Function + 287: 52(ivec2) Load 286(i64v) + 288: 52(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 287 + Store 286(i64v) 288 + 290: 18(int) Load 289(i64) + 291: 18(int) ExtInst 1(GLSL.std.450) 7(SSign) 290 + Store 289(i64) 291 + 292: 52(ivec2) Load 286(i64v) + 293: 18(int) Load 289(i64) + 294: 52(ivec2) CompositeConstruct 293 293 + 295: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 292 294 + Store 286(i64v) 295 + 296: 52(ivec2) Load 286(i64v) + 298: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 296 297 + Store 286(i64v) 298 + 300: 132(ivec3) Load 299(u64v) + 302: 14(int) Load 301(u64) + 303: 132(ivec3) CompositeConstruct 302 302 302 + 304: 132(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 300 303 + Store 299(u64v) 304 + 305: 132(ivec3) Load 299(u64v) + 307: 132(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 305 306 + Store 299(u64v) 307 + 308: 52(ivec2) Load 286(i64v) + 309: 18(int) Load 289(i64) + 310: 52(ivec2) CompositeConstruct 309 309 + 311: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 308 310 + Store 286(i64v) 311 + 312: 52(ivec2) Load 286(i64v) + 313: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 312 297 + Store 286(i64v) 313 + 314: 132(ivec3) Load 299(u64v) + 315: 14(int) Load 301(u64) + 316: 132(ivec3) CompositeConstruct 315 315 315 + 317: 132(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 314 316 + Store 299(u64v) 317 + 318: 132(ivec3) Load 299(u64v) + 319: 132(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 318 306 + Store 299(u64v) 319 + 320: 52(ivec2) Load 286(i64v) + 321: 18(int) Load 289(i64) + 322: 18(int) SNegate 321 + 323: 18(int) Load 289(i64) + 324: 52(ivec2) CompositeConstruct 322 322 + 325: 52(ivec2) CompositeConstruct 323 323 + 326: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 320 324 325 + Store 286(i64v) 326 + 327: 52(ivec2) Load 286(i64v) + 328: 52(ivec2) Load 286(i64v) + 329: 52(ivec2) SNegate 328 + 330: 52(ivec2) Load 286(i64v) + 331: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 327 329 330 + Store 286(i64v) 331 + 332: 132(ivec3) Load 299(u64v) + 333: 14(int) Load 301(u64) + 334: 14(int) SNegate 333 + 335: 14(int) Load 301(u64) + 336: 132(ivec3) CompositeConstruct 334 334 334 + 337: 132(ivec3) CompositeConstruct 335 335 335 + 338: 132(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 332 336 337 + Store 299(u64v) 338 + 339: 132(ivec3) Load 299(u64v) + 340: 132(ivec3) Load 299(u64v) + 341: 132(ivec3) SNegate 340 + 342: 132(ivec3) Load 299(u64v) + 343: 132(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 339 341 342 + Store 299(u64v) 343 + 344: 19(ptr) AccessChain 286(i64v) 227 + 345: 18(int) Load 344 + 346: 19(ptr) AccessChain 286(i64v) 203 + 347: 18(int) Load 346 + 349: 18(int) Select 348 347 345 + Store 289(i64) 349 + 350: 18(int) Load 289(i64) + 351: 52(ivec2) CompositeConstruct 350 350 + 352: 18(int) Load 289(i64) + 353: 18(int) SNegate 352 + 354: 52(ivec2) CompositeConstruct 353 353 + 357: 52(ivec2) Select 356 354 351 + Store 286(i64v) 357 + 358: 40(ptr) AccessChain 299(u64v) 227 + 359: 14(int) Load 358 + 360: 40(ptr) AccessChain 299(u64v) 203 + 361: 14(int) Load 360 + 362: 14(int) Select 348 361 359 + Store 301(u64) 362 + 363: 14(int) Load 301(u64) + 364: 132(ivec3) CompositeConstruct 363 363 363 + 365: 14(int) Load 301(u64) + 366: 14(int) SNegate 365 + 367: 132(ivec3) CompositeConstruct 366 366 366 + 370: 132(ivec3) Select 369 367 364 + Store 299(u64v) 370 + 374: 371(fvec3) Load 373(dv) + 375: 95(fvec2) VectorShuffle 374 374 0 1 + 376: 52(ivec2) Bitcast 375 + Store 286(i64v) 376 + 378: 377(ptr) AccessChain 373(dv) 217 + 379: 94(float) Load 378 + 380: 14(int) Bitcast 379 + 381: 40(ptr) AccessChain 299(u64v) 227 + Store 381 380 + 382: 52(ivec2) Load 286(i64v) + 383: 95(fvec2) Bitcast 382 + 384: 371(fvec3) Load 373(dv) + 385: 371(fvec3) VectorShuffle 384 383 3 4 2 + Store 373(dv) 385 + 386: 132(ivec3) Load 299(u64v) + 387: 371(fvec3) Bitcast 386 + Store 373(dv) 387 + 391: 18(int) Bitcast 390 + Store 289(i64) 391 + 393: 18(int) Load 289(i64) + 394: 74(ivec2) Bitcast 393 + Store 392(iv) 394 + 396: 14(int) Bitcast 395 + Store 301(u64) 396 + 398: 14(int) Load 301(u64) + 399: 81(ivec2) Bitcast 398 + Store 397(uv) 399 + 402: 132(ivec3) Load 299(u64v) + 403: 14(int) Load 301(u64) + 404: 132(ivec3) CompositeConstruct 403 403 403 + 405: 368(bvec3) ULessThan 402 404 + Store 401(bv) 405 + 406: 52(ivec2) Load 286(i64v) + 407: 18(int) Load 289(i64) + 408: 52(ivec2) CompositeConstruct 407 407 + 409: 56(bvec2) SLessThan 406 408 + 410: 368(bvec3) Load 401(bv) + 411: 368(bvec3) VectorShuffle 410 409 3 4 2 + Store 401(bv) 411 + 412: 132(ivec3) Load 299(u64v) + 413: 14(int) Load 301(u64) + 414: 132(ivec3) CompositeConstruct 413 413 413 + 415: 368(bvec3) ULessThanEqual 412 414 + Store 401(bv) 415 + 416: 52(ivec2) Load 286(i64v) + 417: 18(int) Load 289(i64) + 418: 52(ivec2) CompositeConstruct 417 417 + 419: 56(bvec2) SLessThanEqual 416 418 + 420: 368(bvec3) Load 401(bv) + 421: 368(bvec3) VectorShuffle 420 419 3 4 2 + Store 401(bv) 421 + 422: 132(ivec3) Load 299(u64v) + 423: 14(int) Load 301(u64) + 424: 132(ivec3) CompositeConstruct 423 423 423 + 425: 368(bvec3) UGreaterThan 422 424 + Store 401(bv) 425 + 426: 52(ivec2) Load 286(i64v) + 427: 18(int) Load 289(i64) + 428: 52(ivec2) CompositeConstruct 427 427 + 429: 56(bvec2) SGreaterThan 426 428 + 430: 368(bvec3) Load 401(bv) + 431: 368(bvec3) VectorShuffle 430 429 3 4 2 + Store 401(bv) 431 + 432: 132(ivec3) Load 299(u64v) + 433: 14(int) Load 301(u64) + 434: 132(ivec3) CompositeConstruct 433 433 433 + 435: 368(bvec3) UGreaterThanEqual 432 434 + Store 401(bv) 435 + 436: 52(ivec2) Load 286(i64v) + 437: 18(int) Load 289(i64) + 438: 52(ivec2) CompositeConstruct 437 437 + 439: 56(bvec2) SGreaterThanEqual 436 438 + 440: 368(bvec3) Load 401(bv) + 441: 368(bvec3) VectorShuffle 440 439 3 4 2 + Store 401(bv) 441 + 442: 132(ivec3) Load 299(u64v) + 443: 14(int) Load 301(u64) + 444: 132(ivec3) CompositeConstruct 443 443 443 + 445: 368(bvec3) IEqual 442 444 + Store 401(bv) 445 + 446: 52(ivec2) Load 286(i64v) + 447: 18(int) Load 289(i64) + 448: 52(ivec2) CompositeConstruct 447 447 + 449: 56(bvec2) IEqual 446 448 + 450: 368(bvec3) Load 401(bv) + 451: 368(bvec3) VectorShuffle 450 449 3 4 2 + Store 401(bv) 451 + 452: 132(ivec3) Load 299(u64v) + 453: 14(int) Load 301(u64) + 454: 132(ivec3) CompositeConstruct 453 453 453 + 455: 368(bvec3) INotEqual 452 454 + Store 401(bv) 455 + 456: 52(ivec2) Load 286(i64v) + 457: 18(int) Load 289(i64) + 458: 52(ivec2) CompositeConstruct 457 457 + 459: 56(bvec2) INotEqual 456 458 + 460: 368(bvec3) Load 401(bv) + 461: 368(bvec3) VectorShuffle 460 459 3 4 2 + Store 401(bv) 461 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.int8.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.int8.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.int8.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.int8.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,748 @@ +spv.int8.frag +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 531 + + Capability Shader + Capability Float16 + Capability Float64 + Capability Int64 + Capability Int16 + Capability Int8 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_KHX_shader_explicit_arithmetic_types" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + Name 4 "main" + Name 6 "literal(" + Name 8 "typeCast8(" + Name 10 "operators(" + Name 12 "builtinFuncs(" + Name 16 "i8" + Name 24 "Uniforms" + MemberName 24(Uniforms) 0 "index" + Name 26 "" + Name 33 "indexable" + Name 38 "u8" + Name 46 "indexable" + Name 51 "u8v" + Name 54 "i8v" + Name 60 "i16v" + Name 68 "i32v" + Name 76 "u32v" + Name 83 "i64v" + Name 89 "u64v" + Name 103 "f16v" + Name 109 "f32v" + Name 115 "f64v" + Name 144 "u16v" + Name 174 "bv" + Name 192 "u8v" + Name 196 "i8" + Name 216 "i" + Name 223 "uv" + Name 242 "i16" + Name 279 "b" + Name 341 "i8v" + Name 344 "i8" + Name 354 "u8v" + Name 356 "u8" + Name 430 "i16" + Name 433 "i32" + Name 436 "i8v4" + Name 440 "u16" + Name 441 "u8v2" + Name 444 "u32" + Name 447 "u8v4" + Name 459 "bv" + Name 526 "Block" + MemberName 526(Block) 0 "i8" + MemberName 526(Block) 1 "i8v2" + MemberName 526(Block) 2 "i8v3" + MemberName 526(Block) 3 "i8v4" + MemberName 526(Block) 4 "u8" + MemberName 526(Block) 5 "u8v2" + MemberName 526(Block) 6 "u8v3" + MemberName 526(Block) 7 "u8v4" + Name 528 "block" + Name 529 "si8" + Name 530 "su8" + MemberDecorate 24(Uniforms) 0 Offset 0 + Decorate 24(Uniforms) Block + Decorate 26 DescriptorSet 0 + Decorate 26 Binding 0 + MemberDecorate 526(Block) 0 Offset 0 + MemberDecorate 526(Block) 1 Offset 2 + MemberDecorate 526(Block) 2 Offset 4 + MemberDecorate 526(Block) 3 Offset 8 + MemberDecorate 526(Block) 4 Offset 12 + MemberDecorate 526(Block) 5 Offset 14 + MemberDecorate 526(Block) 6 Offset 16 + MemberDecorate 526(Block) 7 Offset 20 + Decorate 526(Block) Block + Decorate 528(block) DescriptorSet 0 + Decorate 528(block) Binding 1 + Decorate 529(si8) SpecId 100 + Decorate 530(su8) SpecId 101 + 2: TypeVoid + 3: TypeFunction 2 + 14: TypeInt 8 1 + 15: TypePointer Function 14(int) + 17: TypeInt 32 0 + 18: 17(int) Constant 3 + 19: TypeArray 14(int) 18 + 20: 14(int) Constant 4294967279 + 21: 14(int) Constant 4294967295 + 22: 14(int) Constant 0 + 23: 19 ConstantComposite 20 21 22 + 24(Uniforms): TypeStruct 17(int) + 25: TypePointer Uniform 24(Uniforms) + 26: 25(ptr) Variable Uniform + 27: TypeInt 32 1 + 28: 27(int) Constant 0 + 29: TypePointer Uniform 17(int) + 32: TypePointer Function 19 + 36: TypeInt 8 0 + 37: TypePointer Function 36(int) + 39: TypeArray 36(int) 18 + 40: 36(int) Constant 255 + 41: 36(int) Constant 127 + 42: 39 ConstantComposite 40 40 41 + 45: TypePointer Function 39 + 49: TypeVector 36(int) 2 + 50: TypePointer Function 49(ivec2) + 52: TypeVector 14(int) 2 + 53: TypePointer Function 52(ivec2) + 57: TypeInt 16 1 + 58: TypeVector 57(int) 2 + 59: TypePointer Function 58(ivec2) + 66: TypeVector 27(int) 2 + 67: TypePointer Function 66(ivec2) + 74: TypeVector 17(int) 2 + 75: TypePointer Function 74(ivec2) + 80: TypeInt 64 1 + 81: TypeVector 80(int) 2 + 82: TypePointer Function 81(ivec2) + 86: TypeInt 64 0 + 87: TypeVector 86(int) 2 + 88: TypePointer Function 87(ivec2) + 100: TypeFloat 16 + 101: TypeVector 100(float) 2 + 102: TypePointer Function 101(fvec2) + 106: TypeFloat 32 + 107: TypeVector 106(float) 2 + 108: TypePointer Function 107(fvec2) + 112: TypeFloat 64 + 113: TypeVector 112(float) 2 + 114: TypePointer Function 113(fvec2) + 141: TypeInt 16 0 + 142: TypeVector 141(int) 2 + 143: TypePointer Function 142(ivec2) + 171: TypeBool + 172: TypeVector 171(bool) 2 + 173: TypePointer Function 172(bvec2) + 176: 14(int) Constant 1 + 177: 52(ivec2) ConstantComposite 22 22 + 178: 52(ivec2) ConstantComposite 176 176 + 181: 36(int) Constant 0 + 182: 36(int) Constant 1 + 183: 49(ivec2) ConstantComposite 181 181 + 184: 49(ivec2) ConstantComposite 182 182 + 190: TypeVector 14(int) 3 + 191: TypePointer Function 190(ivec3) + 215: TypePointer Function 27(int) + 221: TypeVector 17(int) 3 + 222: TypePointer Function 221(ivec3) + 225: TypeVector 27(int) 3 + 241: TypePointer Function 57(int) + 264: 17(int) Constant 1 + 270: 17(int) Constant 2 + 278: TypePointer Function 171(bool) + 280: 17(int) Constant 0 + 293: TypePointer Function 17(int) + 352: 52(ivec2) ConstantComposite 21 21 + 358: TypeVector 36(int) 3 + 362: 190(ivec3) ConstantComposite 22 22 22 + 404: 171(bool) ConstantTrue + 411: 171(bool) ConstantFalse + 412: 172(bvec2) ConstantComposite 411 411 + 427: TypeVector 171(bool) 3 + 428: 427(bvec3) ConstantComposite 411 411 411 + 434: TypeVector 14(int) 4 + 435: TypePointer Function 434(ivec4) + 439: TypePointer Function 141(int) + 445: TypeVector 36(int) 4 + 446: TypePointer Function 445(ivec4) + 458: TypePointer Function 427(bvec3) + 526(Block): TypeStruct 14(int) 52(ivec2) 190(ivec3) 434(ivec4) 36(int) 49(ivec2) 190(ivec3) 445(ivec4) + 527: TypePointer Uniform 526(Block) + 528(block): 527(ptr) Variable Uniform + 529(si8): 14(int) SpecConstant 4294967286 + 530(su8): 36(int) SpecConstant 20 + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd + 6(literal(): 2 Function None 3 + 7: Label + 16(i8): 15(ptr) Variable Function + 33(indexable): 32(ptr) Variable Function + 38(u8): 37(ptr) Variable Function + 46(indexable): 45(ptr) Variable Function + 30: 29(ptr) AccessChain 26 28 + 31: 17(int) Load 30 + Store 33(indexable) 23 + 34: 15(ptr) AccessChain 33(indexable) 31 + 35: 14(int) Load 34 + Store 16(i8) 35 + 43: 29(ptr) AccessChain 26 28 + 44: 17(int) Load 43 + Store 46(indexable) 42 + 47: 37(ptr) AccessChain 46(indexable) 44 + 48: 36(int) Load 47 + Store 38(u8) 48 + Return + FunctionEnd + 8(typeCast8(): 2 Function None 3 + 9: Label + 51(u8v): 50(ptr) Variable Function + 54(i8v): 53(ptr) Variable Function + 60(i16v): 59(ptr) Variable Function + 68(i32v): 67(ptr) Variable Function + 76(u32v): 75(ptr) Variable Function + 83(i64v): 82(ptr) Variable Function + 89(u64v): 88(ptr) Variable Function + 103(f16v): 102(ptr) Variable Function + 109(f32v): 108(ptr) Variable Function + 115(f64v): 114(ptr) Variable Function + 144(u16v): 143(ptr) Variable Function + 174(bv): 173(ptr) Variable Function + 55: 52(ivec2) Load 54(i8v) + 56: 49(ivec2) Bitcast 55 + Store 51(u8v) 56 + 61: 52(ivec2) Load 54(i8v) + 62: 58(ivec2) SConvert 61 + Store 60(i16v) 62 + 63: 49(ivec2) Load 51(u8v) + 64: 58(ivec2) UConvert 63 + 65: 58(ivec2) Bitcast 64 + Store 60(i16v) 65 + 69: 52(ivec2) Load 54(i8v) + 70: 66(ivec2) SConvert 69 + Store 68(i32v) 70 + 71: 49(ivec2) Load 51(u8v) + 72: 66(ivec2) UConvert 71 + 73: 66(ivec2) Bitcast 72 + Store 68(i32v) 73 + 77: 52(ivec2) Load 54(i8v) + 78: 66(ivec2) SConvert 77 + 79: 74(ivec2) Bitcast 78 + Store 76(u32v) 79 + 84: 52(ivec2) Load 54(i8v) + 85: 81(ivec2) SConvert 84 + Store 83(i64v) 85 + 90: 52(ivec2) Load 54(i8v) + 91: 81(ivec2) SConvert 90 + 92: 87(ivec2) Bitcast 91 + Store 89(u64v) 92 + 93: 49(ivec2) Load 51(u8v) + 94: 74(ivec2) UConvert 93 + Store 76(u32v) 94 + 95: 49(ivec2) Load 51(u8v) + 96: 81(ivec2) UConvert 95 + 97: 81(ivec2) Bitcast 96 + Store 83(i64v) 97 + 98: 49(ivec2) Load 51(u8v) + 99: 87(ivec2) UConvert 98 + Store 89(u64v) 99 + 104: 52(ivec2) Load 54(i8v) + 105: 101(fvec2) ConvertSToF 104 + Store 103(f16v) 105 + 110: 52(ivec2) Load 54(i8v) + 111: 107(fvec2) ConvertSToF 110 + Store 109(f32v) 111 + 116: 52(ivec2) Load 54(i8v) + 117: 113(fvec2) ConvertSToF 116 + Store 115(f64v) 117 + 118: 49(ivec2) Load 51(u8v) + 119: 101(fvec2) ConvertUToF 118 + Store 103(f16v) 119 + 120: 49(ivec2) Load 51(u8v) + 121: 107(fvec2) ConvertUToF 120 + Store 109(f32v) 121 + 122: 49(ivec2) Load 51(u8v) + 123: 113(fvec2) ConvertUToF 122 + Store 115(f64v) 123 + 124: 49(ivec2) Load 51(u8v) + 125: 52(ivec2) Bitcast 124 + Store 54(i8v) 125 + 126: 52(ivec2) Load 54(i8v) + 127: 58(ivec2) SConvert 126 + Store 60(i16v) 127 + 128: 49(ivec2) Load 51(u8v) + 129: 58(ivec2) UConvert 128 + 130: 58(ivec2) Bitcast 129 + Store 60(i16v) 130 + 131: 52(ivec2) Load 54(i8v) + 132: 66(ivec2) SConvert 131 + Store 68(i32v) 132 + 133: 49(ivec2) Load 51(u8v) + 134: 66(ivec2) UConvert 133 + 135: 66(ivec2) Bitcast 134 + Store 68(i32v) 135 + 136: 52(ivec2) Load 54(i8v) + 137: 81(ivec2) SConvert 136 + Store 83(i64v) 137 + 138: 52(ivec2) Load 54(i8v) + 139: 81(ivec2) SConvert 138 + 140: 87(ivec2) Bitcast 139 + Store 89(u64v) 140 + 145: 52(ivec2) Load 54(i8v) + 146: 58(ivec2) SConvert 145 + 147: 142(ivec2) Bitcast 146 + Store 144(u16v) 147 + 148: 49(ivec2) Load 51(u8v) + 149: 142(ivec2) UConvert 148 + Store 144(u16v) 149 + 150: 49(ivec2) Load 51(u8v) + 151: 74(ivec2) UConvert 150 + Store 76(u32v) 151 + 152: 49(ivec2) Load 51(u8v) + 153: 81(ivec2) UConvert 152 + 154: 81(ivec2) Bitcast 153 + Store 83(i64v) 154 + 155: 49(ivec2) Load 51(u8v) + 156: 81(ivec2) UConvert 155 + 157: 81(ivec2) Bitcast 156 + 158: 87(ivec2) Bitcast 157 + Store 89(u64v) 158 + 159: 52(ivec2) Load 54(i8v) + 160: 101(fvec2) ConvertSToF 159 + Store 103(f16v) 160 + 161: 52(ivec2) Load 54(i8v) + 162: 107(fvec2) ConvertSToF 161 + Store 109(f32v) 162 + 163: 52(ivec2) Load 54(i8v) + 164: 113(fvec2) ConvertSToF 163 + Store 115(f64v) 164 + 165: 49(ivec2) Load 51(u8v) + 166: 101(fvec2) ConvertUToF 165 + Store 103(f16v) 166 + 167: 49(ivec2) Load 51(u8v) + 168: 107(fvec2) ConvertUToF 167 + Store 109(f32v) 168 + 169: 49(ivec2) Load 51(u8v) + 170: 113(fvec2) ConvertUToF 169 + Store 115(f64v) 170 + 175: 172(bvec2) Load 174(bv) + 179: 52(ivec2) Select 175 178 177 + Store 54(i8v) 179 + 180: 172(bvec2) Load 174(bv) + 185: 49(ivec2) Select 180 184 183 + Store 51(u8v) 185 + 186: 52(ivec2) Load 54(i8v) + 187: 172(bvec2) INotEqual 186 183 + Store 174(bv) 187 + 188: 49(ivec2) Load 51(u8v) + 189: 172(bvec2) INotEqual 188 183 + Store 174(bv) 189 + Return + FunctionEnd + 10(operators(): 2 Function None 3 + 11: Label + 192(u8v): 191(ptr) Variable Function + 196(i8): 15(ptr) Variable Function + 216(i): 215(ptr) Variable Function + 223(uv): 222(ptr) Variable Function + 242(i16): 241(ptr) Variable Function + 279(b): 278(ptr) Variable Function + 193: 190(ivec3) Load 192(u8v) + 194: 190(ivec3) CompositeConstruct 176 176 176 + 195: 190(ivec3) IAdd 193 194 + Store 192(u8v) 195 + 197: 14(int) Load 196(i8) + 198: 14(int) ISub 197 176 + Store 196(i8) 198 + 199: 14(int) Load 196(i8) + 200: 14(int) IAdd 199 176 + Store 196(i8) 200 + 201: 190(ivec3) Load 192(u8v) + 202: 190(ivec3) CompositeConstruct 176 176 176 + 203: 190(ivec3) ISub 201 202 + Store 192(u8v) 203 + 204: 190(ivec3) Load 192(u8v) + 205: 190(ivec3) Not 204 + Store 192(u8v) 205 + 206: 14(int) Load 196(i8) + Store 196(i8) 206 + 207: 190(ivec3) Load 192(u8v) + 208: 190(ivec3) SNegate 207 + Store 192(u8v) 208 + 209: 14(int) Load 196(i8) + 210: 14(int) Load 196(i8) + 211: 14(int) IAdd 210 209 + Store 196(i8) 211 + 212: 190(ivec3) Load 192(u8v) + 213: 190(ivec3) Load 192(u8v) + 214: 190(ivec3) ISub 213 212 + Store 192(u8v) 214 + 217: 14(int) Load 196(i8) + 218: 27(int) SConvert 217 + 219: 27(int) Load 216(i) + 220: 27(int) IMul 219 218 + Store 216(i) 220 + 224: 190(ivec3) Load 192(u8v) + 226: 225(ivec3) SConvert 224 + 227: 221(ivec3) Bitcast 226 + 228: 221(ivec3) Load 223(uv) + 229: 221(ivec3) UDiv 228 227 + Store 223(uv) 229 + 230: 14(int) Load 196(i8) + 231: 27(int) SConvert 230 + 232: 17(int) Bitcast 231 + 233: 221(ivec3) Load 223(uv) + 234: 221(ivec3) CompositeConstruct 232 232 232 + 235: 221(ivec3) UMod 233 234 + Store 223(uv) 235 + 236: 190(ivec3) Load 192(u8v) + 237: 225(ivec3) SConvert 236 + 238: 221(ivec3) Bitcast 237 + 239: 221(ivec3) Load 223(uv) + 240: 221(ivec3) IAdd 238 239 + Store 223(uv) 240 + 243: 14(int) Load 196(i8) + 244: 57(int) SConvert 243 + 245: 57(int) Load 242(i16) + 246: 57(int) ISub 244 245 + Store 242(i16) 246 + 247: 190(ivec3) Load 192(u8v) + 248: 225(ivec3) SConvert 247 + 249: 221(ivec3) Bitcast 248 + 250: 221(ivec3) Load 223(uv) + 251: 221(ivec3) IMul 249 250 + Store 223(uv) 251 + 252: 14(int) Load 196(i8) + 253: 57(int) SConvert 252 + 254: 57(int) Load 242(i16) + 255: 57(int) IMul 253 254 + Store 242(i16) 255 + 256: 14(int) Load 196(i8) + 257: 27(int) SConvert 256 + 258: 27(int) Load 216(i) + 259: 27(int) SMod 257 258 + Store 216(i) 259 + 260: 14(int) Load 196(i8) + 261: 190(ivec3) Load 192(u8v) + 262: 190(ivec3) CompositeConstruct 260 260 260 + 263: 190(ivec3) ShiftLeftLogical 261 262 + Store 192(u8v) 263 + 265: 15(ptr) AccessChain 192(u8v) 264 + 266: 14(int) Load 265 + 267: 14(int) Load 196(i8) + 268: 14(int) ShiftRightArithmetic 267 266 + Store 196(i8) 268 + 269: 14(int) Load 196(i8) + 271: 15(ptr) AccessChain 192(u8v) 270 + 272: 14(int) Load 271 + 273: 14(int) ShiftLeftLogical 269 272 + Store 196(i8) 273 + 274: 190(ivec3) Load 192(u8v) + 275: 14(int) Load 196(i8) + 276: 190(ivec3) CompositeConstruct 275 275 275 + 277: 190(ivec3) ShiftLeftLogical 274 276 + Store 192(u8v) 277 + 281: 15(ptr) AccessChain 192(u8v) 280 + 282: 14(int) Load 281 + 283: 14(int) Load 196(i8) + 284: 171(bool) INotEqual 282 283 + Store 279(b) 284 + 285: 14(int) Load 196(i8) + 286: 15(ptr) AccessChain 192(u8v) 280 + 287: 14(int) Load 286 + 288: 171(bool) IEqual 285 287 + Store 279(b) 288 + 289: 15(ptr) AccessChain 192(u8v) 280 + 290: 14(int) Load 289 + 291: 27(int) SConvert 290 + 292: 17(int) Bitcast 291 + 294: 293(ptr) AccessChain 223(uv) 264 + 295: 17(int) Load 294 + 296: 171(bool) UGreaterThan 292 295 + Store 279(b) 296 + 297: 14(int) Load 196(i8) + 298: 27(int) SConvert 297 + 299: 27(int) Load 216(i) + 300: 171(bool) SLessThan 298 299 + Store 279(b) 300 + 301: 15(ptr) AccessChain 192(u8v) 264 + 302: 14(int) Load 301 + 303: 27(int) SConvert 302 + 304: 17(int) Bitcast 303 + 305: 293(ptr) AccessChain 223(uv) 280 + 306: 17(int) Load 305 + 307: 171(bool) UGreaterThanEqual 304 306 + Store 279(b) 307 + 308: 14(int) Load 196(i8) + 309: 27(int) SConvert 308 + 310: 27(int) Load 216(i) + 311: 171(bool) SLessThanEqual 309 310 + Store 279(b) 311 + 312: 14(int) Load 196(i8) + 313: 27(int) SConvert 312 + 314: 17(int) Bitcast 313 + 315: 221(ivec3) Load 223(uv) + 316: 221(ivec3) CompositeConstruct 314 314 314 + 317: 221(ivec3) BitwiseOr 315 316 + Store 223(uv) 317 + 318: 14(int) Load 196(i8) + 319: 27(int) SConvert 318 + 320: 27(int) Load 216(i) + 321: 27(int) BitwiseOr 319 320 + Store 216(i) 321 + 322: 14(int) Load 196(i8) + 323: 57(int) SConvert 322 + 324: 57(int) Load 242(i16) + 325: 57(int) BitwiseAnd 324 323 + Store 242(i16) 325 + 326: 190(ivec3) Load 192(u8v) + 327: 225(ivec3) SConvert 326 + 328: 221(ivec3) Bitcast 327 + 329: 221(ivec3) Load 223(uv) + 330: 221(ivec3) BitwiseAnd 328 329 + Store 223(uv) 330 + 331: 14(int) Load 196(i8) + 332: 27(int) SConvert 331 + 333: 17(int) Bitcast 332 + 334: 221(ivec3) Load 223(uv) + 335: 221(ivec3) CompositeConstruct 333 333 333 + 336: 221(ivec3) BitwiseXor 334 335 + Store 223(uv) 336 + 337: 190(ivec3) Load 192(u8v) + 338: 14(int) Load 196(i8) + 339: 190(ivec3) CompositeConstruct 338 338 338 + 340: 190(ivec3) BitwiseXor 337 339 + Store 192(u8v) 340 + Return + FunctionEnd +12(builtinFuncs(): 2 Function None 3 + 13: Label + 341(i8v): 53(ptr) Variable Function + 344(i8): 15(ptr) Variable Function + 354(u8v): 191(ptr) Variable Function + 356(u8): 37(ptr) Variable Function + 430(i16): 241(ptr) Variable Function + 433(i32): 215(ptr) Variable Function + 436(i8v4): 435(ptr) Variable Function + 440(u16): 439(ptr) Variable Function + 441(u8v2): 50(ptr) Variable Function + 444(u32): 293(ptr) Variable Function + 447(u8v4): 446(ptr) Variable Function + 459(bv): 458(ptr) Variable Function + 342: 52(ivec2) Load 341(i8v) + 343: 52(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 342 + Store 341(i8v) 343 + 345: 14(int) Load 344(i8) + 346: 14(int) ExtInst 1(GLSL.std.450) 7(SSign) 345 + Store 344(i8) 346 + 347: 52(ivec2) Load 341(i8v) + 348: 14(int) Load 344(i8) + 349: 52(ivec2) CompositeConstruct 348 348 + 350: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 347 349 + Store 341(i8v) 350 + 351: 52(ivec2) Load 341(i8v) + 353: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 351 352 + Store 341(i8v) 353 + 355: 190(ivec3) Load 354(u8v) + 357: 36(int) Load 356(u8) + 359: 358(ivec3) CompositeConstruct 357 357 357 + 360: 190(ivec3) ExtInst 1(GLSL.std.450) 39(SMin) 355 359 + Store 354(u8v) 360 + 361: 190(ivec3) Load 354(u8v) + 363: 190(ivec3) ExtInst 1(GLSL.std.450) 39(SMin) 361 362 + Store 354(u8v) 363 + 364: 52(ivec2) Load 341(i8v) + 365: 14(int) Load 344(i8) + 366: 52(ivec2) CompositeConstruct 365 365 + 367: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 364 366 + Store 341(i8v) 367 + 368: 52(ivec2) Load 341(i8v) + 369: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 368 352 + Store 341(i8v) 369 + 370: 190(ivec3) Load 354(u8v) + 371: 36(int) Load 356(u8) + 372: 358(ivec3) CompositeConstruct 371 371 371 + 373: 190(ivec3) ExtInst 1(GLSL.std.450) 42(SMax) 370 372 + Store 354(u8v) 373 + 374: 190(ivec3) Load 354(u8v) + 375: 190(ivec3) ExtInst 1(GLSL.std.450) 42(SMax) 374 362 + Store 354(u8v) 375 + 376: 52(ivec2) Load 341(i8v) + 377: 14(int) Load 344(i8) + 378: 14(int) SNegate 377 + 379: 14(int) Load 344(i8) + 380: 52(ivec2) CompositeConstruct 378 378 + 381: 52(ivec2) CompositeConstruct 379 379 + 382: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 376 380 381 + Store 341(i8v) 382 + 383: 52(ivec2) Load 341(i8v) + 384: 52(ivec2) Load 341(i8v) + 385: 52(ivec2) SNegate 384 + 386: 52(ivec2) Load 341(i8v) + 387: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 383 385 386 + Store 341(i8v) 387 + 388: 190(ivec3) Load 354(u8v) + 389: 36(int) Load 356(u8) + 390: 36(int) SNegate 389 + 391: 36(int) Load 356(u8) + 392: 358(ivec3) CompositeConstruct 390 390 390 + 393: 358(ivec3) CompositeConstruct 391 391 391 + 394: 190(ivec3) ExtInst 1(GLSL.std.450) 45(SClamp) 388 392 393 + Store 354(u8v) 394 + 395: 190(ivec3) Load 354(u8v) + 396: 190(ivec3) Load 354(u8v) + 397: 190(ivec3) SNegate 396 + 398: 190(ivec3) Load 354(u8v) + 399: 190(ivec3) ExtInst 1(GLSL.std.450) 45(SClamp) 395 397 398 + Store 354(u8v) 399 + 400: 15(ptr) AccessChain 341(i8v) 280 + 401: 14(int) Load 400 + 402: 15(ptr) AccessChain 341(i8v) 264 + 403: 14(int) Load 402 + 405: 14(int) Select 404 403 401 + Store 344(i8) 405 + 406: 14(int) Load 344(i8) + 407: 52(ivec2) CompositeConstruct 406 406 + 408: 14(int) Load 344(i8) + 409: 14(int) SNegate 408 + 410: 52(ivec2) CompositeConstruct 409 409 + 413: 52(ivec2) Select 412 410 407 + Store 341(i8v) 413 + 414: 15(ptr) AccessChain 354(u8v) 280 + 415: 14(int) Load 414 + 416: 15(ptr) AccessChain 354(u8v) 264 + 417: 14(int) Load 416 + 418: 14(int) Select 404 417 415 + 419: 36(int) Bitcast 418 + Store 356(u8) 419 + 420: 36(int) Load 356(u8) + 421: 14(int) Bitcast 420 + 422: 190(ivec3) CompositeConstruct 421 421 421 + 423: 36(int) Load 356(u8) + 424: 36(int) SNegate 423 + 425: 14(int) Bitcast 424 + 426: 190(ivec3) CompositeConstruct 425 425 425 + 429: 190(ivec3) Select 428 426 422 + Store 354(u8v) 429 + 431: 52(ivec2) Load 341(i8v) + 432: 57(int) Bitcast 431 + Store 430(i16) 432 + 437: 434(ivec4) Load 436(i8v4) + 438: 27(int) Bitcast 437 + Store 433(i32) 438 + 442: 49(ivec2) Load 441(u8v2) + 443: 141(int) Bitcast 442 + Store 440(u16) 443 + 448: 445(ivec4) Load 447(u8v4) + 449: 17(int) Bitcast 448 + Store 444(u32) 449 + 450: 57(int) Load 430(i16) + 451: 52(ivec2) Bitcast 450 + Store 341(i8v) 451 + 452: 27(int) Load 433(i32) + 453: 434(ivec4) Bitcast 452 + Store 436(i8v4) 453 + 454: 141(int) Load 440(u16) + 455: 49(ivec2) Bitcast 454 + Store 441(u8v2) 455 + 456: 17(int) Load 444(u32) + 457: 445(ivec4) Bitcast 456 + Store 447(u8v4) 457 + 460: 190(ivec3) Load 354(u8v) + 461: 36(int) Load 356(u8) + 462: 14(int) Bitcast 461 + 463: 190(ivec3) CompositeConstruct 462 462 462 + 464: 427(bvec3) SLessThan 460 463 + Store 459(bv) 464 + 465: 52(ivec2) Load 341(i8v) + 466: 14(int) Load 344(i8) + 467: 52(ivec2) CompositeConstruct 466 466 + 468: 172(bvec2) SLessThan 465 467 + 469: 427(bvec3) Load 459(bv) + 470: 427(bvec3) VectorShuffle 469 468 3 4 2 + Store 459(bv) 470 + 471: 190(ivec3) Load 354(u8v) + 472: 36(int) Load 356(u8) + 473: 14(int) Bitcast 472 + 474: 190(ivec3) CompositeConstruct 473 473 473 + 475: 427(bvec3) SLessThanEqual 471 474 + Store 459(bv) 475 + 476: 52(ivec2) Load 341(i8v) + 477: 14(int) Load 344(i8) + 478: 52(ivec2) CompositeConstruct 477 477 + 479: 172(bvec2) SLessThanEqual 476 478 + 480: 427(bvec3) Load 459(bv) + 481: 427(bvec3) VectorShuffle 480 479 3 4 2 + Store 459(bv) 481 + 482: 190(ivec3) Load 354(u8v) + 483: 36(int) Load 356(u8) + 484: 14(int) Bitcast 483 + 485: 190(ivec3) CompositeConstruct 484 484 484 + 486: 427(bvec3) SGreaterThan 482 485 + Store 459(bv) 486 + 487: 52(ivec2) Load 341(i8v) + 488: 14(int) Load 344(i8) + 489: 52(ivec2) CompositeConstruct 488 488 + 490: 172(bvec2) SGreaterThan 487 489 + 491: 427(bvec3) Load 459(bv) + 492: 427(bvec3) VectorShuffle 491 490 3 4 2 + Store 459(bv) 492 + 493: 190(ivec3) Load 354(u8v) + 494: 36(int) Load 356(u8) + 495: 14(int) Bitcast 494 + 496: 190(ivec3) CompositeConstruct 495 495 495 + 497: 427(bvec3) SGreaterThanEqual 493 496 + Store 459(bv) 497 + 498: 52(ivec2) Load 341(i8v) + 499: 14(int) Load 344(i8) + 500: 52(ivec2) CompositeConstruct 499 499 + 501: 172(bvec2) SGreaterThanEqual 498 500 + 502: 427(bvec3) Load 459(bv) + 503: 427(bvec3) VectorShuffle 502 501 3 4 2 + Store 459(bv) 503 + 504: 190(ivec3) Load 354(u8v) + 505: 36(int) Load 356(u8) + 506: 14(int) Bitcast 505 + 507: 190(ivec3) CompositeConstruct 506 506 506 + 508: 427(bvec3) IEqual 504 507 + Store 459(bv) 508 + 509: 52(ivec2) Load 341(i8v) + 510: 14(int) Load 344(i8) + 511: 52(ivec2) CompositeConstruct 510 510 + 512: 172(bvec2) IEqual 509 511 + 513: 427(bvec3) Load 459(bv) + 514: 427(bvec3) VectorShuffle 513 512 3 4 2 + Store 459(bv) 514 + 515: 190(ivec3) Load 354(u8v) + 516: 36(int) Load 356(u8) + 517: 14(int) Bitcast 516 + 518: 190(ivec3) CompositeConstruct 517 517 517 + 519: 427(bvec3) INotEqual 515 518 + Store 459(bv) 519 + 520: 52(ivec2) Load 341(i8v) + 521: 14(int) Load 344(i8) + 522: 52(ivec2) CompositeConstruct 521 521 + 523: 172(bvec2) INotEqual 520 522 + 524: 427(bvec3) Load 459(bv) + 525: 427(bvec3) VectorShuffle 524 523 3 4 2 + Store 459(bv) 525 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.interpOps.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.interpOps.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.interpOps.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.interpOps.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.interpOps.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 100 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.intOps.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.intOps.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.intOps.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.intOps.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.intOps.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 268 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.layoutNested.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.layoutNested.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.layoutNested.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.layoutNested.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.layoutNested.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 66 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.length.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.length.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.length.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.length.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.length.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 33 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.localAggregates.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.localAggregates.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.localAggregates.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.localAggregates.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.localAggregates.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 136 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.loopsArtificial.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.loopsArtificial.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.loopsArtificial.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.loopsArtificial.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.loopsArtificial.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 158 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.loops.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.loops.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.loops.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.loops.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.loops.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 725 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.matFun.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.matFun.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.matFun.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.matFun.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.matFun.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 103 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.matrix2.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.matrix2.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.matrix2.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.matrix2.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.matrix2.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 221 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.matrix.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.matrix.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.matrix.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.matrix.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.matrix.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 286 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.memoryQualifier.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.memoryQualifier.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.memoryQualifier.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.memoryQualifier.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.memoryQualifier.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 97 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.merge-unreachable.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.merge-unreachable.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.merge-unreachable.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.merge-unreachable.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.merge-unreachable.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 25 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.multiStruct.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.multiStruct.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.multiStruct.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.multiStruct.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.multiStruct.comp // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 161 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.multiStructFuncall.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.multiStructFuncall.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.multiStructFuncall.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.multiStructFuncall.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.multiStructFuncall.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 63 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.multiView.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.multiView.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.multiView.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.multiView.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,11 +1,10 @@ spv.multiView.frag -// Module Version 10000 -// Generated by (magic number): 80002 +// Module Version 10300 +// Generated by (magic number): 80006 // Id's are bound by 17 Capability Shader Capability MultiView - Extension "SPV_KHR_multiview" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 9 12 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.multiviewPerViewAttributes.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.multiviewPerViewAttributes.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.multiviewPerViewAttributes.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.multiviewPerViewAttributes.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.multiviewPerViewAttributes.tesc // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 37 Capability Tessellation diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.multiviewPerViewAttributes.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.multiviewPerViewAttributes.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.multiviewPerViewAttributes.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.multiviewPerViewAttributes.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.multiviewPerViewAttributes.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 29 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.newTexture.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.newTexture.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.newTexture.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.newTexture.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.newTexture.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 284 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.noBuiltInLoc.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.noBuiltInLoc.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.noBuiltInLoc.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.noBuiltInLoc.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,12 +1,13 @@ spv.noBuiltInLoc.vert // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 33 +// Generated by (magic number): 80006 +// Id's are bound by 35 Capability Shader + Capability AtomicStorage 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 9 11 18 31 32 + EntryPoint Vertex 4 "main" 9 11 18 33 34 Source GLSL 450 Name 4 "main" Name 9 "bar" @@ -20,8 +21,9 @@ Name 24 "uv1" Name 26 "uv2" Name 29 "uv3" - Name 31 "gl_VertexID" - Name 32 "gl_InstanceID" + Name 31 "a_uint" + Name 33 "gl_VertexID" + Name 34 "gl_InstanceID" Decorate 9(bar) Location 0 Decorate 11(foo) Location 0 MemberDecorate 16(gl_PerVertex) 0 BuiltIn Position @@ -35,8 +37,11 @@ Decorate 26(uv2) DescriptorSet 0 Decorate 29(uv3) Location 2 Decorate 29(uv3) DescriptorSet 0 - Decorate 31(gl_VertexID) BuiltIn VertexId - Decorate 32(gl_InstanceID) BuiltIn InstanceId + Decorate 31(a_uint) Offset 0 + Decorate 31(a_uint) DescriptorSet 0 + Decorate 31(a_uint) Binding 0 + Decorate 33(gl_VertexID) BuiltIn VertexId + Decorate 34(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -60,9 +65,11 @@ 27: TypeVector 6(float) 3 28: TypePointer UniformConstant 27(fvec3) 29(uv3): 28(ptr) Variable UniformConstant - 30: TypePointer Input 19(int) - 31(gl_VertexID): 30(ptr) Variable Input -32(gl_InstanceID): 30(ptr) Variable Input + 30: TypePointer AtomicCounter 13(int) + 31(a_uint): 30(ptr) Variable AtomicCounter + 32: TypePointer Input 19(int) + 33(gl_VertexID): 32(ptr) Variable Input +34(gl_InstanceID): 32(ptr) Variable Input 4(main): 2 Function None 3 5: Label 12: 7(fvec4) Load 11(foo) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.noDeadDecorations.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.noDeadDecorations.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.noDeadDecorations.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.noDeadDecorations.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.noDeadDecorations.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 32 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.nonSquare.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.nonSquare.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.nonSquare.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.nonSquare.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.nonSquare.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 90 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.nonuniform.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.nonuniform.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.nonuniform.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.nonuniform.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,359 @@ +spv.nonuniform.frag +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 210 + + Capability Shader + Capability InputAttachment + Capability SampledBuffer + Capability ImageBuffer + Capability CapabilityShaderNonUniformEXT + Capability CapabilityRuntimeDescriptorArrayEXT + Capability CapabilityInputAttachmentArrayDynamicIndexingEXT + Capability CapabilityUniformTexelBufferArrayDynamicIndexingEXT + Capability CapabilityStorageTexelBufferArrayDynamicIndexingEXT + Capability CapabilityUniformBufferArrayNonUniformIndexingEXT + Capability CapabilitySampledImageArrayNonUniformIndexingEXT + Capability CapabilityStorageBufferArrayNonUniformIndexingEXT + Capability CapabilityStorageImageArrayNonUniformIndexingEXT + Capability CapabilityInputAttachmentArrayNonUniformIndexingEXT + Capability CapabilityUniformTexelBufferArrayNonUniformIndexingEXT + Capability CapabilityStorageTexelBufferArrayNonUniformIndexingEXT + Extension "SPV_EXT_descriptor_indexing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 33 90 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_nonuniform_qualifier" + Name 4 "main" + Name 11 "foo(i1;i1;" + Name 9 "nupi" + Name 10 "f" + Name 16 "a" + Name 17 "nu_li" + Name 18 "param" + Name 20 "param" + Name 30 "b" + Name 33 "nu_inv4" + Name 39 "nu_gf" + Name 45 "inputAttachmentDyn" + Name 46 "dyn_i" + Name 62 "uniformTexelBufferDyn" + Name 76 "storageTexelBufferDyn" + Name 85 "uname" + MemberName 85(uname) 0 "a" + Name 88 "uniformBuffer" + Name 90 "nu_ii" + Name 97 "bname" + MemberName 97(bname) 0 "b" + Name 100 "storageBuffer" + Name 110 "sampledImage" + Name 125 "storageImage" + Name 137 "inputAttachment" + Name 147 "uniformTexelBuffer" + Name 158 "storageTexelBuffer" + Name 168 "v" + Name 183 "uv" + Name 193 "m" + Name 201 "S" + MemberName 201(S) 0 "a" + Name 203 "s" + Decorate 13 DecorationNonUniformEXT + Decorate 17(nu_li) DecorationNonUniformEXT + Decorate 19 DecorationNonUniformEXT + Decorate 23 DecorationNonUniformEXT + Decorate 26 DecorationNonUniformEXT + Decorate 27 DecorationNonUniformEXT + Decorate 33(nu_inv4) Location 0 + Decorate 33(nu_inv4) DecorationNonUniformEXT + Decorate 38 DecorationNonUniformEXT + Decorate 39(nu_gf) DecorationNonUniformEXT + Decorate 40 DecorationNonUniformEXT + Decorate 41 DecorationNonUniformEXT + Decorate 45(inputAttachmentDyn) DescriptorSet 0 + Decorate 45(inputAttachmentDyn) Binding 0 + Decorate 45(inputAttachmentDyn) InputAttachmentIndex 0 + Decorate 62(uniformTexelBufferDyn) DescriptorSet 0 + Decorate 62(uniformTexelBufferDyn) Binding 1 + Decorate 76(storageTexelBufferDyn) DescriptorSet 0 + Decorate 76(storageTexelBufferDyn) Binding 2 + MemberDecorate 85(uname) 0 Offset 0 + Decorate 85(uname) Block + Decorate 88(uniformBuffer) DescriptorSet 0 + Decorate 88(uniformBuffer) Binding 3 + Decorate 90(nu_ii) Flat + Decorate 90(nu_ii) Location 1 + Decorate 90(nu_ii) DecorationNonUniformEXT + Decorate 91 DecorationNonUniformEXT + Decorate 94 DecorationNonUniformEXT + MemberDecorate 97(bname) 0 Offset 0 + Decorate 97(bname) BufferBlock + Decorate 100(storageBuffer) DescriptorSet 0 + Decorate 100(storageBuffer) Binding 4 + Decorate 101 DecorationNonUniformEXT + Decorate 103 DecorationNonUniformEXT + Decorate 110(sampledImage) DescriptorSet 0 + Decorate 110(sampledImage) Binding 5 + Decorate 111 DecorationNonUniformEXT + Decorate 114 DecorationNonUniformEXT + Decorate 125(storageImage) DescriptorSet 0 + Decorate 125(storageImage) Binding 6 + Decorate 126 DecorationNonUniformEXT + Decorate 129 DecorationNonUniformEXT + Decorate 137(inputAttachment) DescriptorSet 0 + Decorate 137(inputAttachment) Binding 7 + Decorate 137(inputAttachment) InputAttachmentIndex 1 + Decorate 138 DecorationNonUniformEXT + Decorate 140 DecorationNonUniformEXT + Decorate 147(uniformTexelBuffer) DescriptorSet 0 + Decorate 147(uniformTexelBuffer) Binding 8 + Decorate 148 DecorationNonUniformEXT + Decorate 150 DecorationNonUniformEXT + Decorate 158(storageTexelBuffer) DescriptorSet 0 + Decorate 158(storageTexelBuffer) Binding 9 + Decorate 159 DecorationNonUniformEXT + Decorate 161 DecorationNonUniformEXT + Decorate 168(v) DecorationNonUniformEXT + Decorate 171 DecorationNonUniformEXT + Decorate 173 DecorationNonUniformEXT + Decorate 178 DecorationNonUniformEXT + Decorate 180 DecorationNonUniformEXT + Decorate 184 DecorationNonUniformEXT + Decorate 186 DecorationNonUniformEXT + Decorate 188 DecorationNonUniformEXT + Decorate 193(m) DecorationNonUniformEXT + Decorate 195 DecorationNonUniformEXT + Decorate 203(s) DecorationNonUniformEXT + Decorate 205 DecorationNonUniformEXT + Decorate 207 DecorationNonUniformEXT + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 8: TypeFunction 6(int) 7(ptr) 7(ptr) + 25: 6(int) Constant 2 + 28: TypeFloat 32 + 29: TypePointer Function 28(float) + 31: TypeVector 28(float) 4 + 32: TypePointer Input 31(fvec4) + 33(nu_inv4): 32(ptr) Variable Input + 34: TypeInt 32 0 + 35: 34(int) Constant 0 + 36: TypePointer Input 28(float) + 42: TypeImage 28(float) SubpassData nonsampled format:Unknown + 43: TypeRuntimeArray 42 + 44: TypePointer UniformConstant 43 +45(inputAttachmentDyn): 44(ptr) Variable UniformConstant + 48: TypePointer UniformConstant 42 + 51: 6(int) Constant 0 + 52: TypeVector 6(int) 2 + 53: 52(ivec2) ConstantComposite 51 51 + 58: TypeImage 28(float) Buffer sampled format:Unknown + 59: TypeSampledImage 58 + 60: TypeRuntimeArray 59 + 61: TypePointer UniformConstant 60 +62(uniformTexelBufferDyn): 61(ptr) Variable UniformConstant + 64: TypePointer UniformConstant 59 + 67: 6(int) Constant 1 + 73: TypeImage 28(float) Buffer nonsampled format:R32f + 74: TypeRuntimeArray 73 + 75: TypePointer UniformConstant 74 +76(storageTexelBufferDyn): 75(ptr) Variable UniformConstant + 78: TypePointer UniformConstant 73 + 85(uname): TypeStruct 28(float) + 86: TypeRuntimeArray 85(uname) + 87: TypePointer Uniform 86 +88(uniformBuffer): 87(ptr) Variable Uniform + 89: TypePointer Input 6(int) + 90(nu_ii): 89(ptr) Variable Input + 92: TypePointer Uniform 28(float) + 97(bname): TypeStruct 28(float) + 98: TypeRuntimeArray 97(bname) + 99: TypePointer Uniform 98 +100(storageBuffer): 99(ptr) Variable Uniform + 106: TypeImage 28(float) 2D sampled format:Unknown + 107: TypeSampledImage 106 + 108: TypeRuntimeArray 107 + 109: TypePointer UniformConstant 108 +110(sampledImage): 109(ptr) Variable UniformConstant + 112: TypePointer UniformConstant 107 + 115: TypeVector 28(float) 2 + 116: 28(float) Constant 1056964608 + 117: 115(fvec2) ConstantComposite 116 116 + 122: TypeImage 28(float) 2D nonsampled format:R32f + 123: TypeRuntimeArray 122 + 124: TypePointer UniformConstant 123 +125(storageImage): 124(ptr) Variable UniformConstant + 127: TypePointer UniformConstant 122 + 130: 52(ivec2) ConstantComposite 67 67 + 135: TypeRuntimeArray 42 + 136: TypePointer UniformConstant 135 +137(inputAttachment): 136(ptr) Variable UniformConstant + 145: TypeRuntimeArray 59 + 146: TypePointer UniformConstant 145 +147(uniformTexelBuffer): 146(ptr) Variable UniformConstant + 156: TypeRuntimeArray 73 + 157: TypePointer UniformConstant 156 +158(storageTexelBuffer): 157(ptr) Variable UniformConstant + 166: TypeVector 6(int) 4 + 167: TypePointer Function 166(ivec4) + 169: 34(int) Constant 1 + 176: 34(int) Constant 2 + 191: TypeMatrix 31(fvec4) 4 + 192: TypePointer Function 191 + 201(S): TypeStruct 6(int) + 202: TypePointer Function 201(S) + 4(main): 2 Function None 3 + 5: Label + 16(a): 7(ptr) Variable Function + 17(nu_li): 7(ptr) Variable Function + 18(param): 7(ptr) Variable Function + 20(param): 7(ptr) Variable Function + 30(b): 29(ptr) Variable Function + 39(nu_gf): 29(ptr) Variable Function + 46(dyn_i): 7(ptr) Variable Function + 168(v): 167(ptr) Variable Function + 183(uv): 167(ptr) Variable Function + 193(m): 192(ptr) Variable Function + 203(s): 202(ptr) Variable Function + 19: 6(int) Load 17(nu_li) + Store 18(param) 19 + 21: 6(int) FunctionCall 11(foo(i1;i1;) 18(param) 20(param) + 22: 6(int) Load 20(param) + Store 17(nu_li) 22 + Store 16(a) 21 + 23: 6(int) Load 16(a) + 24: 6(int) Load 16(a) + 26: 6(int) IMul 24 25 + 27: 6(int) IAdd 23 26 + Store 17(nu_li) 27 + 37: 36(ptr) AccessChain 33(nu_inv4) 35 + 38: 28(float) Load 37 + 40: 28(float) Load 39(nu_gf) + 41: 28(float) FMul 38 40 + Store 30(b) 41 + 47: 6(int) Load 46(dyn_i) + 49: 48(ptr) AccessChain 45(inputAttachmentDyn) 47 + 50: 42 Load 49 + 54: 31(fvec4) ImageRead 50 53 + 55: 28(float) CompositeExtract 54 0 + 56: 28(float) Load 30(b) + 57: 28(float) FAdd 56 55 + Store 30(b) 57 + 63: 6(int) Load 46(dyn_i) + 65: 64(ptr) AccessChain 62(uniformTexelBufferDyn) 63 + 66: 59 Load 65 + 68: 58 Image 66 + 69: 31(fvec4) ImageFetch 68 67 + 70: 28(float) CompositeExtract 69 0 + 71: 28(float) Load 30(b) + 72: 28(float) FAdd 71 70 + Store 30(b) 72 + 77: 6(int) Load 46(dyn_i) + 79: 78(ptr) AccessChain 76(storageTexelBufferDyn) 77 + 80: 73 Load 79 + 81: 31(fvec4) ImageRead 80 67 + 82: 28(float) CompositeExtract 81 0 + 83: 28(float) Load 30(b) + 84: 28(float) FAdd 83 82 + Store 30(b) 84 + 91: 6(int) Load 90(nu_ii) + 93: 92(ptr) AccessChain 88(uniformBuffer) 91 51 + 94: 28(float) Load 93 + 95: 28(float) Load 30(b) + 96: 28(float) FAdd 95 94 + Store 30(b) 96 + 101: 6(int) Load 90(nu_ii) + 102: 92(ptr) AccessChain 100(storageBuffer) 101 51 + 103: 28(float) Load 102 + 104: 28(float) Load 30(b) + 105: 28(float) FAdd 104 103 + Store 30(b) 105 + 111: 6(int) Load 90(nu_ii) + 113: 112(ptr) AccessChain 110(sampledImage) 111 + 114: 107 Load 113 + 118: 31(fvec4) ImageSampleImplicitLod 114 117 + 119: 28(float) CompositeExtract 118 0 + 120: 28(float) Load 30(b) + 121: 28(float) FAdd 120 119 + Store 30(b) 121 + 126: 6(int) Load 90(nu_ii) + 128: 127(ptr) AccessChain 125(storageImage) 126 + 129: 122 Load 128 + 131: 31(fvec4) ImageRead 129 130 + 132: 28(float) CompositeExtract 131 0 + 133: 28(float) Load 30(b) + 134: 28(float) FAdd 133 132 + Store 30(b) 134 + 138: 6(int) Load 90(nu_ii) + 139: 48(ptr) AccessChain 137(inputAttachment) 138 + 140: 42 Load 139 + 141: 31(fvec4) ImageRead 140 53 + 142: 28(float) CompositeExtract 141 0 + 143: 28(float) Load 30(b) + 144: 28(float) FAdd 143 142 + Store 30(b) 144 + 148: 6(int) Load 90(nu_ii) + 149: 64(ptr) AccessChain 147(uniformTexelBuffer) 148 + 150: 59 Load 149 + 151: 58 Image 150 + 152: 31(fvec4) ImageFetch 151 67 + 153: 28(float) CompositeExtract 152 0 + 154: 28(float) Load 30(b) + 155: 28(float) FAdd 154 153 + Store 30(b) 155 + 159: 6(int) Load 90(nu_ii) + 160: 78(ptr) AccessChain 158(storageTexelBuffer) 159 + 161: 73 Load 160 + 162: 31(fvec4) ImageRead 161 67 + 163: 28(float) CompositeExtract 162 0 + 164: 28(float) Load 30(b) + 165: 28(float) FAdd 164 163 + Store 30(b) 165 + 170: 7(ptr) AccessChain 168(v) 169 + 171: 6(int) Load 170 + 172: 92(ptr) AccessChain 88(uniformBuffer) 171 51 + 173: 28(float) Load 172 + 174: 28(float) Load 30(b) + 175: 28(float) FAdd 174 173 + Store 30(b) 175 + 177: 7(ptr) AccessChain 168(v) 176 + 178: 6(int) Load 177 + 179: 92(ptr) AccessChain 88(uniformBuffer) 178 51 + 180: 28(float) Load 179 + 181: 28(float) Load 30(b) + 182: 28(float) FAdd 181 180 + Store 30(b) 182 + 184: 6(int) Load 90(nu_ii) + 185: 7(ptr) AccessChain 183(uv) 184 + 186: 6(int) Load 185 + 187: 92(ptr) AccessChain 88(uniformBuffer) 186 51 + 188: 28(float) Load 187 + 189: 28(float) Load 30(b) + 190: 28(float) FAdd 189 188 + Store 30(b) 190 + 194: 29(ptr) AccessChain 193(m) 25 176 + 195: 28(float) Load 194 + 196: 6(int) ConvertFToS 195 + 197: 92(ptr) AccessChain 88(uniformBuffer) 196 51 + 198: 28(float) Load 197 + 199: 28(float) Load 30(b) + 200: 28(float) FAdd 199 198 + Store 30(b) 200 + 204: 7(ptr) AccessChain 203(s) 51 + 205: 6(int) Load 204 + 206: 92(ptr) AccessChain 88(uniformBuffer) 205 51 + 207: 28(float) Load 206 + 208: 28(float) Load 30(b) + 209: 28(float) FAdd 208 207 + Store 30(b) 209 + Return + FunctionEnd + 11(foo(i1;i1;): 6(int) Function None 8 + 9(nupi): 7(ptr) FunctionParameter + 10(f): 7(ptr) FunctionParameter + 12: Label + 13: 6(int) Load 9(nupi) + ReturnValue 13 + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.noWorkgroup.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.noWorkgroup.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.noWorkgroup.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.noWorkgroup.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.noWorkgroup.comp // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 12 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.offsets.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.offsets.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.offsets.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.offsets.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.offsets.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 15 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.Operations.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.Operations.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.Operations.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.Operations.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.Operations.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 532 Capability Shader @@ -90,10 +90,10 @@ 188(f): 143(ptr) Variable Function 285(u): 284(ptr) Variable Function 305(b): 304(ptr) Variable Function - 486: 8(ptr) Variable Function + 487: 8(ptr) Variable Function 503(m1): 502(ptr) Variable Function 510(m2): 502(ptr) Variable Function - 513: 502(ptr) Variable Function + 514: 502(ptr) Variable Function 12: 7(fvec4) Load 11(uv4) 13: 7(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 12 Store 9(v) 13 @@ -658,9 +658,9 @@ 482: 178(bool) Load 305(b) 483: 178(bool) LogicalNot 482 Store 305(b) 483 - 487: 178(bool) Load 305(b) + 486: 178(bool) Load 305(b) SelectionMerge 489 None - BranchConditional 487 488 498 + BranchConditional 486 488 498 488: Label 490: 18(int) Load 20(i) 491: 6(float) ConvertSToF 490 @@ -670,30 +670,30 @@ 495: 7(fvec4) FAdd 492 494 496: 7(fvec4) Load 9(v) 497: 7(fvec4) FAdd 495 496 - Store 486 497 + Store 487 497 Branch 489 498: Label 499: 7(fvec4) Load 9(v) - Store 486 499 + Store 487 499 Branch 489 489: Label - 500: 7(fvec4) Load 486 + 500: 7(fvec4) Load 487 Store 485(FragColor) 500 Store 503(m1) 509 Store 510(m2) 512 - 514: 178(bool) Load 305(b) + 513: 178(bool) Load 305(b) SelectionMerge 516 None - BranchConditional 514 515 518 + BranchConditional 513 515 518 515: Label 517: 501 Load 503(m1) - Store 513 517 + Store 514 517 Branch 516 518: Label 519: 501 Load 510(m2) - Store 513 519 + Store 514 519 Branch 516 516: Label - 520: 8(ptr) AccessChain 513 405 + 520: 8(ptr) AccessChain 514 405 521: 7(fvec4) Load 520 522: 7(fvec4) Load 485(FragColor) 523: 7(fvec4) FAdd 522 521 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.OVR_multiview.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.OVR_multiview.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.OVR_multiview.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.OVR_multiview.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.OVR_multiview.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 27 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.paramMemory.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.paramMemory.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.paramMemory.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.paramMemory.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.paramMemory.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 69 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.precise.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.precise.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.precise.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.precise.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.precise.tesc // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 72 Capability Tessellation diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.precise.tese.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.precise.tese.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.precise.tese.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.precise.tese.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.precise.tese // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 119 Capability Tessellation diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.precision.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.precision.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.precision.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.precision.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.precision.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 127 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.precisionNonESSamp.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.precisionNonESSamp.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.precisionNonESSamp.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.precisionNonESSamp.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.precisionNonESSamp.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 47 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.prepost.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.prepost.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.prepost.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.prepost.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.prepost.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 94 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.pushConstantAnon.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.pushConstantAnon.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.pushConstantAnon.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.pushConstantAnon.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.pushConstantAnon.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 38 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.pushConstant.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.pushConstant.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.pushConstant.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.pushConstant.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.pushConstant.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 35 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.qualifiers.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.qualifiers.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.qualifiers.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.qualifiers.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.qualifiers.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 21 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.queryL.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.queryL.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.queryL.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.queryL.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.queryL.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 224 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.rankShift.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.rankShift.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.rankShift.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.rankShift.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,57 @@ +spv.rankShift.comp +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 33 + + Capability Shader + Capability Int64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 54 1 1 + Source GLSL 450 + SourceExtension "GL_ARB_gpu_shader_int64" + Name 4 "main" + Name 8 "result" + Name 11 "arg0" + Name 15 "arg1" + Decorate 11(arg0) Location 4 + Decorate 15(arg1) Location 5 + Decorate 32 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 64 0 + 7: TypePointer Function 6(int) + 9: TypeInt 64 1 + 10: TypePointer UniformConstant 9(int) + 11(arg0): 10(ptr) Variable UniformConstant + 13: TypeInt 32 0 + 14: TypePointer UniformConstant 13(int) + 15(arg1): 14(ptr) Variable UniformConstant + 29: TypeVector 13(int) 3 + 30: 13(int) Constant 54 + 31: 13(int) Constant 1 + 32: 29(ivec3) ConstantComposite 30 31 31 + 4(main): 2 Function None 3 + 5: Label + 8(result): 7(ptr) Variable Function + 12: 9(int) Load 11(arg0) + 16: 13(int) Load 15(arg1) + 17: 9(int) ShiftLeftLogical 12 16 + 18: 6(int) Bitcast 17 + Store 8(result) 18 + 19: 9(int) Load 11(arg0) + 20: 13(int) Load 15(arg1) + 21: 9(int) ShiftRightArithmetic 19 20 + 22: 6(int) Bitcast 21 + Store 8(result) 22 + 23: 13(int) Load 15(arg1) + 24: 6(int) Load 8(result) + 25: 6(int) ShiftLeftLogical 24 23 + Store 8(result) 25 + 26: 13(int) Load 15(arg1) + 27: 6(int) Load 8(result) + 28: 6(int) ShiftRightLogical 27 26 + Store 8(result) 28 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.register.autoassign-2.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.register.autoassign-2.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.register.autoassign-2.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.register.autoassign-2.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.register.autoassign-2.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 47 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.register.autoassign.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.register.autoassign.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.register.autoassign.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.register.autoassign.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.register.autoassign.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 155 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.register.noautoassign.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.register.noautoassign.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.register.noautoassign.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.register.noautoassign.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.register.noautoassign.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 155 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.register.subpass.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.register.subpass.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.register.subpass.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.register.subpass.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.register.subpass.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 40 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.rw.autoassign.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.rw.autoassign.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.rw.autoassign.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.rw.autoassign.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.rw.autoassign.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 42 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.sample.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.sample.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.sample.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.sample.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,32 @@ +spv.sample.frag +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 13 + + Capability Shader + Capability SampleRateShading + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 11 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "color" + Name 11 "samp" + Decorate 9(color) Location 0 + Decorate 11(samp) Sample + Decorate 11(samp) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(color): 8(ptr) Variable Output + 10: TypePointer Input 7(fvec4) + 11(samp): 10(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 12: 7(fvec4) Load 11(samp) + Store 9(color) 12 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.sampleId.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.sampleId.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.sampleId.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.sampleId.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,52 @@ +spv.sampleId.frag +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 26 + + Capability Shader + Capability SampleRateShading + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 8 18 20 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 8 "gl_SampleID" + Name 18 "color" + Name 20 "samp" + Decorate 8(gl_SampleID) Flat + Decorate 8(gl_SampleID) BuiltIn SampleId + Decorate 18(color) Location 0 + Decorate 20(samp) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Input 6(int) + 8(gl_SampleID): 7(ptr) Variable Input + 10: 6(int) Constant 3 + 11: TypeBool + 15: TypeFloat 32 + 16: TypeVector 15(float) 4 + 17: TypePointer Output 16(fvec4) + 18(color): 17(ptr) Variable Output + 19: TypePointer Input 16(fvec4) + 20(samp): 19(ptr) Variable Input + 23: 15(float) Constant 1073741824 + 4(main): 2 Function None 3 + 5: Label + 9: 6(int) Load 8(gl_SampleID) + 12: 11(bool) SLessThan 9 10 + SelectionMerge 14 None + BranchConditional 12 13 22 + 13: Label + 21: 16(fvec4) Load 20(samp) + Store 18(color) 21 + Branch 14 + 22: Label + 24: 16(fvec4) Load 20(samp) + 25: 16(fvec4) VectorTimesScalar 24 23 + Store 18(color) 25 + Branch 14 + 14: Label + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.sampleMaskOverrideCoverage.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.sampleMaskOverrideCoverage.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.sampleMaskOverrideCoverage.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.sampleMaskOverrideCoverage.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,10 +1,9 @@ spv.sampleMaskOverrideCoverage.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 20 Capability Shader - Capability SampleRateShading Extension "SPV_NV_sample_mask_override_coverage" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.samplePosition.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.samplePosition.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.samplePosition.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.samplePosition.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,55 @@ +spv.samplePosition.frag +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 30 + + Capability Shader + Capability SampleRateShading + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 22 24 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "gl_SamplePosition" + Name 22 "color" + Name 24 "samp" + Decorate 9(gl_SamplePosition) BuiltIn SamplePosition + Decorate 22(color) Location 0 + Decorate 24(samp) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypePointer Input 7(fvec2) +9(gl_SamplePosition): 8(ptr) Variable Input + 10: TypeInt 32 0 + 11: 10(int) Constant 1 + 12: TypePointer Input 6(float) + 15: 6(float) Constant 1056964608 + 16: TypeBool + 20: TypeVector 6(float) 4 + 21: TypePointer Output 20(fvec4) + 22(color): 21(ptr) Variable Output + 23: TypePointer Input 20(fvec4) + 24(samp): 23(ptr) Variable Input + 27: 6(float) Constant 1073741824 + 4(main): 2 Function None 3 + 5: Label + 13: 12(ptr) AccessChain 9(gl_SamplePosition) 11 + 14: 6(float) Load 13 + 17: 16(bool) FOrdLessThan 14 15 + SelectionMerge 19 None + BranchConditional 17 18 26 + 18: Label + 25: 20(fvec4) Load 24(samp) + Store 22(color) 25 + Branch 19 + 26: Label + 28: 20(fvec4) Load 24(samp) + 29: 20(fvec4) VectorTimesScalar 28 27 + Store 22(color) 29 + Branch 19 + 19: Label + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.separate.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.separate.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.separate.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.separate.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.separate.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 319 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.set.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.set.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.set.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.set.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.set.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 22 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.shaderBallotAMD.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.shaderBallotAMD.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.shaderBallotAMD.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.shaderBallotAMD.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,16 +1,18 @@ spv.shaderBallotAMD.comp // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 1048 +// Generated by (magic number): 80006 +// Id's are bound by 1343 Capability Shader Capability Float16 Capability Float64 Capability Int64 Capability Groups + Capability Int16 Capability StorageUniformBufferBlock16 Capability StorageUniform16 Extension "SPV_AMD_gpu_shader_half_float" + Extension "SPV_AMD_gpu_shader_int16" Extension "SPV_AMD_shader_ballot" Extension "SPV_KHR_16bit_storage" 1: ExtInstImport "GLSL.std.450" @@ -19,29 +21,34 @@ ExecutionMode 4 LocalSize 8 8 1 Source GLSL 450 SourceExtension "GL_AMD_gpu_shader_half_float" + SourceExtension "GL_AMD_gpu_shader_int16" SourceExtension "GL_AMD_shader_ballot" SourceExtension "GL_ARB_gpu_shader_int64" Name 4 "main" - Name 18 "Buffers" - MemberName 18(Buffers) 0 "i" - MemberName 18(Buffers) 1 "uv" - MemberName 18(Buffers) 2 "fv" - MemberName 18(Buffers) 3 "dv" - MemberName 18(Buffers) 4 "i64" - MemberName 18(Buffers) 5 "u64v" - MemberName 18(Buffers) 6 "f16v" - Name 20 "" - MemberDecorate 18(Buffers) 0 Offset 0 - MemberDecorate 18(Buffers) 1 Offset 8 - MemberDecorate 18(Buffers) 2 Offset 16 - MemberDecorate 18(Buffers) 3 Offset 32 - MemberDecorate 18(Buffers) 4 Offset 64 - MemberDecorate 18(Buffers) 5 Offset 80 - MemberDecorate 18(Buffers) 6 Offset 96 - Decorate 18(Buffers) BufferBlock - Decorate 20 DescriptorSet 0 - Decorate 20 Binding 0 - Decorate 1047 BuiltIn WorkgroupSize + Name 21 "Buffers" + MemberName 21(Buffers) 0 "i" + MemberName 21(Buffers) 1 "uv" + MemberName 21(Buffers) 2 "fv" + MemberName 21(Buffers) 3 "dv" + MemberName 21(Buffers) 4 "i64" + MemberName 21(Buffers) 5 "u64v" + MemberName 21(Buffers) 6 "f16v" + MemberName 21(Buffers) 7 "i16v" + MemberName 21(Buffers) 8 "u16" + Name 23 "" + MemberDecorate 21(Buffers) 0 Offset 0 + MemberDecorate 21(Buffers) 1 Offset 8 + MemberDecorate 21(Buffers) 2 Offset 16 + MemberDecorate 21(Buffers) 3 Offset 32 + MemberDecorate 21(Buffers) 4 Offset 64 + MemberDecorate 21(Buffers) 5 Offset 80 + MemberDecorate 21(Buffers) 6 Offset 96 + MemberDecorate 21(Buffers) 7 Offset 104 + MemberDecorate 21(Buffers) 8 Offset 112 + Decorate 21(Buffers) BufferBlock + Decorate 23 DescriptorSet 0 + Decorate 23 Binding 0 + Decorate 1342 BuiltIn WorkgroupSize 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -56,1163 +63,1494 @@ 15: TypeVector 14(int) 2 16: TypeFloat 16 17: TypeVector 16(float) 3 - 18(Buffers): TypeStruct 6(int) 8(ivec2) 10(fvec3) 12(fvec4) 13(int) 15(ivec2) 17(fvec3) - 19: TypePointer Uniform 18(Buffers) - 20: 19(ptr) Variable Uniform - 21: 6(int) Constant 0 - 22: TypePointer Uniform 6(int) - 25: 7(int) Constant 3 - 28: 6(int) Constant 1 - 29: TypePointer Uniform 8(ivec2) - 38: 6(int) Constant 2 - 39: TypePointer Uniform 10(fvec3) - 50: 6(int) Constant 3 - 51: TypePointer Uniform 12(fvec4) - 64: 6(int) Constant 4 - 65: TypePointer Uniform 13(int) - 70: 6(int) Constant 5 - 71: TypePointer Uniform 15(ivec2) - 80: 6(int) Constant 6 - 81: TypePointer Uniform 17(fvec3) - 1044: TypeVector 7(int) 3 - 1045: 7(int) Constant 8 - 1046: 7(int) Constant 1 - 1047: 1044(ivec3) ConstantComposite 1045 1045 1046 + 18: TypeInt 16 1 + 19: TypeVector 18(int) 4 + 20: TypeInt 16 0 + 21(Buffers): TypeStruct 6(int) 8(ivec2) 10(fvec3) 12(fvec4) 13(int) 15(ivec2) 17(fvec3) 19(ivec4) 20(int) + 22: TypePointer Uniform 21(Buffers) + 23: 22(ptr) Variable Uniform + 24: 6(int) Constant 0 + 25: TypePointer Uniform 6(int) + 28: 7(int) Constant 3 + 31: 6(int) Constant 1 + 32: TypePointer Uniform 8(ivec2) + 41: 6(int) Constant 2 + 42: TypePointer Uniform 10(fvec3) + 53: 6(int) Constant 3 + 54: TypePointer Uniform 12(fvec4) + 67: 6(int) Constant 4 + 68: TypePointer Uniform 13(int) + 73: 6(int) Constant 5 + 74: TypePointer Uniform 15(ivec2) + 83: 6(int) Constant 6 + 84: TypePointer Uniform 17(fvec3) + 95: 6(int) Constant 7 + 96: TypePointer Uniform 19(ivec4) + 109: 6(int) Constant 8 + 110: TypePointer Uniform 20(int) + 1339: TypeVector 7(int) 3 + 1340: 7(int) Constant 8 + 1341: 7(int) Constant 1 + 1342: 1339(ivec3) ConstantComposite 1340 1340 1341 4(main): 2 Function None 3 5: Label - 23: 22(ptr) AccessChain 20 21 - 24: 6(int) Load 23 - 26: 6(int) GroupSMin 25 Reduce 24 - 27: 22(ptr) AccessChain 20 21 - Store 27 26 - 30: 29(ptr) AccessChain 20 28 - 31: 8(ivec2) Load 30 - 32: 7(int) CompositeExtract 31 0 - 33: 7(int) GroupUMin 25 Reduce 32 - 34: 7(int) CompositeExtract 31 1 - 35: 7(int) GroupUMin 25 Reduce 34 - 36: 8(ivec2) CompositeConstruct 33 35 - 37: 29(ptr) AccessChain 20 28 - Store 37 36 - 40: 39(ptr) AccessChain 20 38 - 41: 10(fvec3) Load 40 - 42: 9(float) CompositeExtract 41 0 - 43: 9(float) GroupFMin 25 Reduce 42 - 44: 9(float) CompositeExtract 41 1 - 45: 9(float) GroupFMin 25 Reduce 44 - 46: 9(float) CompositeExtract 41 2 - 47: 9(float) GroupFMin 25 Reduce 46 - 48: 10(fvec3) CompositeConstruct 43 45 47 - 49: 39(ptr) AccessChain 20 38 - Store 49 48 - 52: 51(ptr) AccessChain 20 50 - 53: 12(fvec4) Load 52 - 54: 11(float) CompositeExtract 53 0 - 55: 11(float) GroupFMin 25 Reduce 54 - 56: 11(float) CompositeExtract 53 1 - 57: 11(float) GroupFMin 25 Reduce 56 - 58: 11(float) CompositeExtract 53 2 - 59: 11(float) GroupFMin 25 Reduce 58 - 60: 11(float) CompositeExtract 53 3 - 61: 11(float) GroupFMin 25 Reduce 60 - 62: 12(fvec4) CompositeConstruct 55 57 59 61 - 63: 51(ptr) AccessChain 20 50 - Store 63 62 - 66: 65(ptr) AccessChain 20 64 - 67: 13(int) Load 66 - 68: 13(int) GroupSMin 25 Reduce 67 - 69: 65(ptr) AccessChain 20 64 - Store 69 68 - 72: 71(ptr) AccessChain 20 70 - 73: 15(ivec2) Load 72 - 74: 14(int) CompositeExtract 73 0 - 75: 14(int) GroupUMin 25 Reduce 74 - 76: 14(int) CompositeExtract 73 1 - 77: 14(int) GroupUMin 25 Reduce 76 - 78: 15(ivec2) CompositeConstruct 75 77 - 79: 71(ptr) AccessChain 20 70 - Store 79 78 - 82: 81(ptr) AccessChain 20 80 - 83: 17(fvec3) Load 82 - 84: 16(float) CompositeExtract 83 0 - 85: 16(float) GroupFMin 25 Reduce 84 - 86: 16(float) CompositeExtract 83 1 - 87: 16(float) GroupFMin 25 Reduce 86 - 88: 16(float) CompositeExtract 83 2 - 89: 16(float) GroupFMin 25 Reduce 88 - 90: 17(fvec3) CompositeConstruct 85 87 89 - 91: 81(ptr) AccessChain 20 80 - Store 91 90 - 92: 22(ptr) AccessChain 20 21 - 93: 6(int) Load 92 - 94: 6(int) GroupSMax 25 Reduce 93 - 95: 22(ptr) AccessChain 20 21 - Store 95 94 - 96: 29(ptr) AccessChain 20 28 - 97: 8(ivec2) Load 96 - 98: 7(int) CompositeExtract 97 0 - 99: 7(int) GroupUMax 25 Reduce 98 - 100: 7(int) CompositeExtract 97 1 - 101: 7(int) GroupUMax 25 Reduce 100 - 102: 8(ivec2) CompositeConstruct 99 101 - 103: 29(ptr) AccessChain 20 28 - Store 103 102 - 104: 39(ptr) AccessChain 20 38 - 105: 10(fvec3) Load 104 - 106: 9(float) CompositeExtract 105 0 - 107: 9(float) GroupFMax 25 Reduce 106 - 108: 9(float) CompositeExtract 105 1 - 109: 9(float) GroupFMax 25 Reduce 108 - 110: 9(float) CompositeExtract 105 2 - 111: 9(float) GroupFMax 25 Reduce 110 - 112: 10(fvec3) CompositeConstruct 107 109 111 - 113: 39(ptr) AccessChain 20 38 - Store 113 112 - 114: 51(ptr) AccessChain 20 50 - 115: 12(fvec4) Load 114 - 116: 11(float) CompositeExtract 115 0 - 117: 11(float) GroupFMax 25 Reduce 116 - 118: 11(float) CompositeExtract 115 1 - 119: 11(float) GroupFMax 25 Reduce 118 - 120: 11(float) CompositeExtract 115 2 - 121: 11(float) GroupFMax 25 Reduce 120 - 122: 11(float) CompositeExtract 115 3 - 123: 11(float) GroupFMax 25 Reduce 122 - 124: 12(fvec4) CompositeConstruct 117 119 121 123 - 125: 51(ptr) AccessChain 20 50 - Store 125 124 - 126: 65(ptr) AccessChain 20 64 - 127: 13(int) Load 126 - 128: 13(int) GroupSMax 25 Reduce 127 - 129: 65(ptr) AccessChain 20 64 - Store 129 128 - 130: 71(ptr) AccessChain 20 70 - 131: 15(ivec2) Load 130 - 132: 14(int) CompositeExtract 131 0 - 133: 14(int) GroupUMax 25 Reduce 132 - 134: 14(int) CompositeExtract 131 1 - 135: 14(int) GroupUMax 25 Reduce 134 - 136: 15(ivec2) CompositeConstruct 133 135 - 137: 71(ptr) AccessChain 20 70 - Store 137 136 - 138: 81(ptr) AccessChain 20 80 - 139: 17(fvec3) Load 138 - 140: 16(float) CompositeExtract 139 0 - 141: 16(float) GroupFMax 25 Reduce 140 - 142: 16(float) CompositeExtract 139 1 - 143: 16(float) GroupFMax 25 Reduce 142 - 144: 16(float) CompositeExtract 139 2 - 145: 16(float) GroupFMax 25 Reduce 144 - 146: 17(fvec3) CompositeConstruct 141 143 145 - 147: 81(ptr) AccessChain 20 80 - Store 147 146 - 148: 22(ptr) AccessChain 20 21 - 149: 6(int) Load 148 - 150: 6(int) GroupIAdd 25 Reduce 149 - 151: 22(ptr) AccessChain 20 21 - Store 151 150 - 152: 29(ptr) AccessChain 20 28 - 153: 8(ivec2) Load 152 - 154: 7(int) CompositeExtract 153 0 - 155: 7(int) GroupIAdd 25 Reduce 154 - 156: 7(int) CompositeExtract 153 1 - 157: 7(int) GroupIAdd 25 Reduce 156 - 158: 8(ivec2) CompositeConstruct 155 157 - 159: 29(ptr) AccessChain 20 28 - Store 159 158 - 160: 39(ptr) AccessChain 20 38 - 161: 10(fvec3) Load 160 - 162: 9(float) CompositeExtract 161 0 - 163: 9(float) GroupFAdd 25 Reduce 162 - 164: 9(float) CompositeExtract 161 1 - 165: 9(float) GroupFAdd 25 Reduce 164 - 166: 9(float) CompositeExtract 161 2 - 167: 9(float) GroupFAdd 25 Reduce 166 - 168: 10(fvec3) CompositeConstruct 163 165 167 - 169: 39(ptr) AccessChain 20 38 - Store 169 168 - 170: 51(ptr) AccessChain 20 50 - 171: 12(fvec4) Load 170 - 172: 11(float) CompositeExtract 171 0 - 173: 11(float) GroupFAdd 25 Reduce 172 - 174: 11(float) CompositeExtract 171 1 - 175: 11(float) GroupFAdd 25 Reduce 174 - 176: 11(float) CompositeExtract 171 2 - 177: 11(float) GroupFAdd 25 Reduce 176 - 178: 11(float) CompositeExtract 171 3 - 179: 11(float) GroupFAdd 25 Reduce 178 - 180: 12(fvec4) CompositeConstruct 173 175 177 179 - 181: 51(ptr) AccessChain 20 50 - Store 181 180 - 182: 65(ptr) AccessChain 20 64 - 183: 13(int) Load 182 - 184: 13(int) GroupIAdd 25 Reduce 183 - 185: 65(ptr) AccessChain 20 64 - Store 185 184 - 186: 71(ptr) AccessChain 20 70 - 187: 15(ivec2) Load 186 - 188: 14(int) CompositeExtract 187 0 - 189: 14(int) GroupIAdd 25 Reduce 188 - 190: 14(int) CompositeExtract 187 1 - 191: 14(int) GroupIAdd 25 Reduce 190 - 192: 15(ivec2) CompositeConstruct 189 191 - 193: 71(ptr) AccessChain 20 70 - Store 193 192 - 194: 81(ptr) AccessChain 20 80 - 195: 17(fvec3) Load 194 - 196: 16(float) CompositeExtract 195 0 - 197: 16(float) GroupFAdd 25 Reduce 196 - 198: 16(float) CompositeExtract 195 1 - 199: 16(float) GroupFAdd 25 Reduce 198 - 200: 16(float) CompositeExtract 195 2 - 201: 16(float) GroupFAdd 25 Reduce 200 - 202: 17(fvec3) CompositeConstruct 197 199 201 - 203: 81(ptr) AccessChain 20 80 - Store 203 202 - 204: 22(ptr) AccessChain 20 21 - 205: 6(int) Load 204 - 206: 6(int) GroupSMinNonUniformAMD 25 Reduce 205 - 207: 22(ptr) AccessChain 20 21 - Store 207 206 - 208: 29(ptr) AccessChain 20 28 - 209: 8(ivec2) Load 208 - 210: 7(int) CompositeExtract 209 0 - 211: 7(int) GroupUMinNonUniformAMD 25 Reduce 210 - 212: 7(int) CompositeExtract 209 1 - 213: 7(int) GroupUMinNonUniformAMD 25 Reduce 212 - 214: 8(ivec2) CompositeConstruct 211 213 - 215: 29(ptr) AccessChain 20 28 - Store 215 214 - 216: 39(ptr) AccessChain 20 38 - 217: 10(fvec3) Load 216 - 218: 9(float) CompositeExtract 217 0 - 219: 9(float) GroupFMinNonUniformAMD 25 Reduce 218 - 220: 9(float) CompositeExtract 217 1 - 221: 9(float) GroupFMinNonUniformAMD 25 Reduce 220 - 222: 9(float) CompositeExtract 217 2 - 223: 9(float) GroupFMinNonUniformAMD 25 Reduce 222 - 224: 10(fvec3) CompositeConstruct 219 221 223 - 225: 39(ptr) AccessChain 20 38 - Store 225 224 - 226: 51(ptr) AccessChain 20 50 - 227: 12(fvec4) Load 226 - 228: 11(float) CompositeExtract 227 0 - 229: 11(float) GroupFMinNonUniformAMD 25 Reduce 228 - 230: 11(float) CompositeExtract 227 1 - 231: 11(float) GroupFMinNonUniformAMD 25 Reduce 230 - 232: 11(float) CompositeExtract 227 2 - 233: 11(float) GroupFMinNonUniformAMD 25 Reduce 232 - 234: 11(float) CompositeExtract 227 3 - 235: 11(float) GroupFMinNonUniformAMD 25 Reduce 234 - 236: 12(fvec4) CompositeConstruct 229 231 233 235 - 237: 51(ptr) AccessChain 20 50 - Store 237 236 - 238: 65(ptr) AccessChain 20 64 - 239: 13(int) Load 238 - 240: 13(int) GroupSMinNonUniformAMD 25 Reduce 239 - 241: 65(ptr) AccessChain 20 64 - Store 241 240 - 242: 71(ptr) AccessChain 20 70 - 243: 15(ivec2) Load 242 - 244: 14(int) CompositeExtract 243 0 - 245: 14(int) GroupUMinNonUniformAMD 25 Reduce 244 - 246: 14(int) CompositeExtract 243 1 - 247: 14(int) GroupUMinNonUniformAMD 25 Reduce 246 - 248: 15(ivec2) CompositeConstruct 245 247 - 249: 71(ptr) AccessChain 20 70 - Store 249 248 - 250: 81(ptr) AccessChain 20 80 - 251: 17(fvec3) Load 250 - 252: 16(float) CompositeExtract 251 0 - 253: 16(float) GroupFMinNonUniformAMD 25 Reduce 252 - 254: 16(float) CompositeExtract 251 1 - 255: 16(float) GroupFMinNonUniformAMD 25 Reduce 254 - 256: 16(float) CompositeExtract 251 2 - 257: 16(float) GroupFMinNonUniformAMD 25 Reduce 256 - 258: 17(fvec3) CompositeConstruct 253 255 257 - 259: 81(ptr) AccessChain 20 80 - Store 259 258 - 260: 22(ptr) AccessChain 20 21 - 261: 6(int) Load 260 - 262: 6(int) GroupSMaxNonUniformAMD 25 Reduce 261 - 263: 22(ptr) AccessChain 20 21 - Store 263 262 - 264: 29(ptr) AccessChain 20 28 - 265: 8(ivec2) Load 264 - 266: 7(int) CompositeExtract 265 0 - 267: 7(int) GroupUMaxNonUniformAMD 25 Reduce 266 - 268: 7(int) CompositeExtract 265 1 - 269: 7(int) GroupUMaxNonUniformAMD 25 Reduce 268 - 270: 8(ivec2) CompositeConstruct 267 269 - 271: 29(ptr) AccessChain 20 28 - Store 271 270 - 272: 39(ptr) AccessChain 20 38 - 273: 10(fvec3) Load 272 - 274: 9(float) CompositeExtract 273 0 - 275: 9(float) GroupFMaxNonUniformAMD 25 Reduce 274 - 276: 9(float) CompositeExtract 273 1 - 277: 9(float) GroupFMaxNonUniformAMD 25 Reduce 276 - 278: 9(float) CompositeExtract 273 2 - 279: 9(float) GroupFMaxNonUniformAMD 25 Reduce 278 - 280: 10(fvec3) CompositeConstruct 275 277 279 - 281: 39(ptr) AccessChain 20 38 - Store 281 280 - 282: 51(ptr) AccessChain 20 50 - 283: 12(fvec4) Load 282 - 284: 11(float) CompositeExtract 283 0 - 285: 11(float) GroupFMaxNonUniformAMD 25 Reduce 284 - 286: 11(float) CompositeExtract 283 1 - 287: 11(float) GroupFMaxNonUniformAMD 25 Reduce 286 - 288: 11(float) CompositeExtract 283 2 - 289: 11(float) GroupFMaxNonUniformAMD 25 Reduce 288 - 290: 11(float) CompositeExtract 283 3 - 291: 11(float) GroupFMaxNonUniformAMD 25 Reduce 290 - 292: 12(fvec4) CompositeConstruct 285 287 289 291 - 293: 51(ptr) AccessChain 20 50 - Store 293 292 - 294: 65(ptr) AccessChain 20 64 - 295: 13(int) Load 294 - 296: 13(int) GroupSMaxNonUniformAMD 25 Reduce 295 - 297: 65(ptr) AccessChain 20 64 - Store 297 296 - 298: 71(ptr) AccessChain 20 70 - 299: 15(ivec2) Load 298 - 300: 14(int) CompositeExtract 299 0 - 301: 14(int) GroupUMaxNonUniformAMD 25 Reduce 300 - 302: 14(int) CompositeExtract 299 1 - 303: 14(int) GroupUMaxNonUniformAMD 25 Reduce 302 - 304: 15(ivec2) CompositeConstruct 301 303 - 305: 71(ptr) AccessChain 20 70 - Store 305 304 - 306: 81(ptr) AccessChain 20 80 - 307: 17(fvec3) Load 306 - 308: 16(float) CompositeExtract 307 0 - 309: 16(float) GroupFMaxNonUniformAMD 25 Reduce 308 - 310: 16(float) CompositeExtract 307 1 - 311: 16(float) GroupFMaxNonUniformAMD 25 Reduce 310 - 312: 16(float) CompositeExtract 307 2 - 313: 16(float) GroupFMaxNonUniformAMD 25 Reduce 312 - 314: 17(fvec3) CompositeConstruct 309 311 313 - 315: 81(ptr) AccessChain 20 80 - Store 315 314 - 316: 22(ptr) AccessChain 20 21 - 317: 6(int) Load 316 - 318: 6(int) GroupIAddNonUniformAMD 25 Reduce 317 - 319: 22(ptr) AccessChain 20 21 - Store 319 318 - 320: 29(ptr) AccessChain 20 28 - 321: 8(ivec2) Load 320 - 322: 7(int) CompositeExtract 321 0 - 323: 7(int) GroupIAddNonUniformAMD 25 Reduce 322 - 324: 7(int) CompositeExtract 321 1 - 325: 7(int) GroupIAddNonUniformAMD 25 Reduce 324 - 326: 8(ivec2) CompositeConstruct 323 325 - 327: 29(ptr) AccessChain 20 28 - Store 327 326 - 328: 39(ptr) AccessChain 20 38 - 329: 10(fvec3) Load 328 - 330: 9(float) CompositeExtract 329 0 - 331: 9(float) GroupFAddNonUniformAMD 25 Reduce 330 - 332: 9(float) CompositeExtract 329 1 - 333: 9(float) GroupFAddNonUniformAMD 25 Reduce 332 - 334: 9(float) CompositeExtract 329 2 - 335: 9(float) GroupFAddNonUniformAMD 25 Reduce 334 - 336: 10(fvec3) CompositeConstruct 331 333 335 - 337: 39(ptr) AccessChain 20 38 - Store 337 336 - 338: 51(ptr) AccessChain 20 50 - 339: 12(fvec4) Load 338 - 340: 11(float) CompositeExtract 339 0 - 341: 11(float) GroupFAddNonUniformAMD 25 Reduce 340 - 342: 11(float) CompositeExtract 339 1 - 343: 11(float) GroupFAddNonUniformAMD 25 Reduce 342 - 344: 11(float) CompositeExtract 339 2 - 345: 11(float) GroupFAddNonUniformAMD 25 Reduce 344 - 346: 11(float) CompositeExtract 339 3 - 347: 11(float) GroupFAddNonUniformAMD 25 Reduce 346 - 348: 12(fvec4) CompositeConstruct 341 343 345 347 - 349: 51(ptr) AccessChain 20 50 - Store 349 348 - 350: 65(ptr) AccessChain 20 64 - 351: 13(int) Load 350 - 352: 13(int) GroupIAddNonUniformAMD 25 Reduce 351 - 353: 65(ptr) AccessChain 20 64 - Store 353 352 - 354: 71(ptr) AccessChain 20 70 - 355: 15(ivec2) Load 354 - 356: 14(int) CompositeExtract 355 0 - 357: 14(int) GroupIAddNonUniformAMD 25 Reduce 356 - 358: 14(int) CompositeExtract 355 1 - 359: 14(int) GroupIAddNonUniformAMD 25 Reduce 358 - 360: 15(ivec2) CompositeConstruct 357 359 - 361: 71(ptr) AccessChain 20 70 - Store 361 360 - 362: 81(ptr) AccessChain 20 80 - 363: 17(fvec3) Load 362 - 364: 16(float) CompositeExtract 363 0 - 365: 16(float) GroupFAddNonUniformAMD 25 Reduce 364 - 366: 16(float) CompositeExtract 363 1 - 367: 16(float) GroupFAddNonUniformAMD 25 Reduce 366 - 368: 16(float) CompositeExtract 363 2 - 369: 16(float) GroupFAddNonUniformAMD 25 Reduce 368 - 370: 17(fvec3) CompositeConstruct 365 367 369 - 371: 81(ptr) AccessChain 20 80 - Store 371 370 - 372: 22(ptr) AccessChain 20 21 - 373: 6(int) Load 372 - 374: 6(int) GroupSMin 25 InclusiveScan 373 - 375: 22(ptr) AccessChain 20 21 - Store 375 374 - 376: 29(ptr) AccessChain 20 28 - 377: 8(ivec2) Load 376 - 378: 7(int) CompositeExtract 377 0 - 379: 7(int) GroupUMin 25 InclusiveScan 378 - 380: 7(int) CompositeExtract 377 1 - 381: 7(int) GroupUMin 25 InclusiveScan 380 - 382: 8(ivec2) CompositeConstruct 379 381 - 383: 29(ptr) AccessChain 20 28 - Store 383 382 - 384: 39(ptr) AccessChain 20 38 - 385: 10(fvec3) Load 384 - 386: 9(float) CompositeExtract 385 0 - 387: 9(float) GroupFMin 25 InclusiveScan 386 - 388: 9(float) CompositeExtract 385 1 - 389: 9(float) GroupFMin 25 InclusiveScan 388 - 390: 9(float) CompositeExtract 385 2 - 391: 9(float) GroupFMin 25 InclusiveScan 390 - 392: 10(fvec3) CompositeConstruct 387 389 391 - 393: 39(ptr) AccessChain 20 38 - Store 393 392 - 394: 51(ptr) AccessChain 20 50 - 395: 12(fvec4) Load 394 - 396: 11(float) CompositeExtract 395 0 - 397: 11(float) GroupFMin 25 InclusiveScan 396 - 398: 11(float) CompositeExtract 395 1 - 399: 11(float) GroupFMin 25 InclusiveScan 398 - 400: 11(float) CompositeExtract 395 2 - 401: 11(float) GroupFMin 25 InclusiveScan 400 - 402: 11(float) CompositeExtract 395 3 - 403: 11(float) GroupFMin 25 InclusiveScan 402 - 404: 12(fvec4) CompositeConstruct 397 399 401 403 - 405: 51(ptr) AccessChain 20 50 - Store 405 404 - 406: 65(ptr) AccessChain 20 64 - 407: 13(int) Load 406 - 408: 13(int) GroupSMin 25 InclusiveScan 407 - 409: 65(ptr) AccessChain 20 64 - Store 409 408 - 410: 71(ptr) AccessChain 20 70 - 411: 15(ivec2) Load 410 - 412: 14(int) CompositeExtract 411 0 - 413: 14(int) GroupUMin 25 InclusiveScan 412 - 414: 14(int) CompositeExtract 411 1 - 415: 14(int) GroupUMin 25 InclusiveScan 414 - 416: 15(ivec2) CompositeConstruct 413 415 - 417: 71(ptr) AccessChain 20 70 - Store 417 416 - 418: 81(ptr) AccessChain 20 80 - 419: 17(fvec3) Load 418 - 420: 16(float) CompositeExtract 419 0 - 421: 16(float) GroupFMin 25 InclusiveScan 420 - 422: 16(float) CompositeExtract 419 1 - 423: 16(float) GroupFMin 25 InclusiveScan 422 - 424: 16(float) CompositeExtract 419 2 - 425: 16(float) GroupFMin 25 InclusiveScan 424 - 426: 17(fvec3) CompositeConstruct 421 423 425 - 427: 81(ptr) AccessChain 20 80 - Store 427 426 - 428: 22(ptr) AccessChain 20 21 - 429: 6(int) Load 428 - 430: 6(int) GroupSMax 25 InclusiveScan 429 - 431: 22(ptr) AccessChain 20 21 - Store 431 430 - 432: 29(ptr) AccessChain 20 28 - 433: 8(ivec2) Load 432 - 434: 7(int) CompositeExtract 433 0 - 435: 7(int) GroupUMax 25 InclusiveScan 434 - 436: 7(int) CompositeExtract 433 1 - 437: 7(int) GroupUMax 25 InclusiveScan 436 - 438: 8(ivec2) CompositeConstruct 435 437 - 439: 29(ptr) AccessChain 20 28 - Store 439 438 - 440: 39(ptr) AccessChain 20 38 - 441: 10(fvec3) Load 440 - 442: 9(float) CompositeExtract 441 0 - 443: 9(float) GroupFMax 25 InclusiveScan 442 - 444: 9(float) CompositeExtract 441 1 - 445: 9(float) GroupFMax 25 InclusiveScan 444 - 446: 9(float) CompositeExtract 441 2 - 447: 9(float) GroupFMax 25 InclusiveScan 446 - 448: 10(fvec3) CompositeConstruct 443 445 447 - 449: 39(ptr) AccessChain 20 38 - Store 449 448 - 450: 51(ptr) AccessChain 20 50 - 451: 12(fvec4) Load 450 - 452: 11(float) CompositeExtract 451 0 - 453: 11(float) GroupFMax 25 InclusiveScan 452 - 454: 11(float) CompositeExtract 451 1 - 455: 11(float) GroupFMax 25 InclusiveScan 454 - 456: 11(float) CompositeExtract 451 2 - 457: 11(float) GroupFMax 25 InclusiveScan 456 - 458: 11(float) CompositeExtract 451 3 - 459: 11(float) GroupFMax 25 InclusiveScan 458 - 460: 12(fvec4) CompositeConstruct 453 455 457 459 - 461: 51(ptr) AccessChain 20 50 - Store 461 460 - 462: 65(ptr) AccessChain 20 64 - 463: 13(int) Load 462 - 464: 13(int) GroupSMax 25 InclusiveScan 463 - 465: 65(ptr) AccessChain 20 64 - Store 465 464 - 466: 71(ptr) AccessChain 20 70 - 467: 15(ivec2) Load 466 - 468: 14(int) CompositeExtract 467 0 - 469: 14(int) GroupUMax 25 InclusiveScan 468 - 470: 14(int) CompositeExtract 467 1 - 471: 14(int) GroupUMax 25 InclusiveScan 470 - 472: 15(ivec2) CompositeConstruct 469 471 - 473: 71(ptr) AccessChain 20 70 - Store 473 472 - 474: 81(ptr) AccessChain 20 80 - 475: 17(fvec3) Load 474 - 476: 16(float) CompositeExtract 475 0 - 477: 16(float) GroupFMax 25 InclusiveScan 476 - 478: 16(float) CompositeExtract 475 1 - 479: 16(float) GroupFMax 25 InclusiveScan 478 - 480: 16(float) CompositeExtract 475 2 - 481: 16(float) GroupFMax 25 InclusiveScan 480 - 482: 17(fvec3) CompositeConstruct 477 479 481 - 483: 81(ptr) AccessChain 20 80 - Store 483 482 - 484: 22(ptr) AccessChain 20 21 - 485: 6(int) Load 484 - 486: 6(int) GroupIAdd 25 InclusiveScan 485 - 487: 22(ptr) AccessChain 20 21 - Store 487 486 - 488: 29(ptr) AccessChain 20 28 - 489: 8(ivec2) Load 488 - 490: 7(int) CompositeExtract 489 0 - 491: 7(int) GroupIAdd 25 InclusiveScan 490 - 492: 7(int) CompositeExtract 489 1 - 493: 7(int) GroupIAdd 25 InclusiveScan 492 - 494: 8(ivec2) CompositeConstruct 491 493 - 495: 29(ptr) AccessChain 20 28 - Store 495 494 - 496: 39(ptr) AccessChain 20 38 - 497: 10(fvec3) Load 496 - 498: 9(float) CompositeExtract 497 0 - 499: 9(float) GroupFAdd 25 InclusiveScan 498 - 500: 9(float) CompositeExtract 497 1 - 501: 9(float) GroupFAdd 25 InclusiveScan 500 - 502: 9(float) CompositeExtract 497 2 - 503: 9(float) GroupFAdd 25 InclusiveScan 502 - 504: 10(fvec3) CompositeConstruct 499 501 503 - 505: 39(ptr) AccessChain 20 38 - Store 505 504 - 506: 51(ptr) AccessChain 20 50 - 507: 12(fvec4) Load 506 - 508: 11(float) CompositeExtract 507 0 - 509: 11(float) GroupFAdd 25 InclusiveScan 508 - 510: 11(float) CompositeExtract 507 1 - 511: 11(float) GroupFAdd 25 InclusiveScan 510 - 512: 11(float) CompositeExtract 507 2 - 513: 11(float) GroupFAdd 25 InclusiveScan 512 - 514: 11(float) CompositeExtract 507 3 - 515: 11(float) GroupFAdd 25 InclusiveScan 514 - 516: 12(fvec4) CompositeConstruct 509 511 513 515 - 517: 51(ptr) AccessChain 20 50 - Store 517 516 - 518: 65(ptr) AccessChain 20 64 - 519: 13(int) Load 518 - 520: 13(int) GroupIAdd 25 InclusiveScan 519 - 521: 65(ptr) AccessChain 20 64 - Store 521 520 - 522: 71(ptr) AccessChain 20 70 - 523: 15(ivec2) Load 522 - 524: 14(int) CompositeExtract 523 0 - 525: 14(int) GroupIAdd 25 InclusiveScan 524 - 526: 14(int) CompositeExtract 523 1 - 527: 14(int) GroupIAdd 25 InclusiveScan 526 - 528: 15(ivec2) CompositeConstruct 525 527 - 529: 71(ptr) AccessChain 20 70 - Store 529 528 - 530: 81(ptr) AccessChain 20 80 - 531: 17(fvec3) Load 530 - 532: 16(float) CompositeExtract 531 0 - 533: 16(float) GroupFAdd 25 InclusiveScan 532 - 534: 16(float) CompositeExtract 531 1 - 535: 16(float) GroupFAdd 25 InclusiveScan 534 - 536: 16(float) CompositeExtract 531 2 - 537: 16(float) GroupFAdd 25 InclusiveScan 536 - 538: 17(fvec3) CompositeConstruct 533 535 537 - 539: 81(ptr) AccessChain 20 80 - Store 539 538 - 540: 22(ptr) AccessChain 20 21 - 541: 6(int) Load 540 - 542: 6(int) GroupSMin 25 ExclusiveScan 541 - 543: 22(ptr) AccessChain 20 21 - Store 543 542 - 544: 29(ptr) AccessChain 20 28 - 545: 8(ivec2) Load 544 - 546: 7(int) CompositeExtract 545 0 - 547: 7(int) GroupUMin 25 ExclusiveScan 546 - 548: 7(int) CompositeExtract 545 1 - 549: 7(int) GroupUMin 25 ExclusiveScan 548 - 550: 8(ivec2) CompositeConstruct 547 549 - 551: 29(ptr) AccessChain 20 28 - Store 551 550 - 552: 39(ptr) AccessChain 20 38 - 553: 10(fvec3) Load 552 - 554: 9(float) CompositeExtract 553 0 - 555: 9(float) GroupFMin 25 ExclusiveScan 554 - 556: 9(float) CompositeExtract 553 1 - 557: 9(float) GroupFMin 25 ExclusiveScan 556 - 558: 9(float) CompositeExtract 553 2 - 559: 9(float) GroupFMin 25 ExclusiveScan 558 - 560: 10(fvec3) CompositeConstruct 555 557 559 - 561: 39(ptr) AccessChain 20 38 - Store 561 560 - 562: 51(ptr) AccessChain 20 50 - 563: 12(fvec4) Load 562 - 564: 11(float) CompositeExtract 563 0 - 565: 11(float) GroupFMin 25 ExclusiveScan 564 - 566: 11(float) CompositeExtract 563 1 - 567: 11(float) GroupFMin 25 ExclusiveScan 566 - 568: 11(float) CompositeExtract 563 2 - 569: 11(float) GroupFMin 25 ExclusiveScan 568 - 570: 11(float) CompositeExtract 563 3 - 571: 11(float) GroupFMin 25 ExclusiveScan 570 - 572: 12(fvec4) CompositeConstruct 565 567 569 571 - 573: 51(ptr) AccessChain 20 50 - Store 573 572 - 574: 65(ptr) AccessChain 20 64 - 575: 13(int) Load 574 - 576: 13(int) GroupSMin 25 ExclusiveScan 575 - 577: 65(ptr) AccessChain 20 64 - Store 577 576 - 578: 71(ptr) AccessChain 20 70 - 579: 15(ivec2) Load 578 - 580: 14(int) CompositeExtract 579 0 - 581: 14(int) GroupUMin 25 ExclusiveScan 580 - 582: 14(int) CompositeExtract 579 1 - 583: 14(int) GroupUMin 25 ExclusiveScan 582 - 584: 15(ivec2) CompositeConstruct 581 583 - 585: 71(ptr) AccessChain 20 70 - Store 585 584 - 586: 81(ptr) AccessChain 20 80 - 587: 17(fvec3) Load 586 - 588: 16(float) CompositeExtract 587 0 - 589: 16(float) GroupFMin 25 ExclusiveScan 588 - 590: 16(float) CompositeExtract 587 1 - 591: 16(float) GroupFMin 25 ExclusiveScan 590 - 592: 16(float) CompositeExtract 587 2 - 593: 16(float) GroupFMin 25 ExclusiveScan 592 - 594: 17(fvec3) CompositeConstruct 589 591 593 - 595: 81(ptr) AccessChain 20 80 - Store 595 594 - 596: 22(ptr) AccessChain 20 21 - 597: 6(int) Load 596 - 598: 6(int) GroupSMax 25 ExclusiveScan 597 - 599: 22(ptr) AccessChain 20 21 - Store 599 598 - 600: 29(ptr) AccessChain 20 28 - 601: 8(ivec2) Load 600 - 602: 7(int) CompositeExtract 601 0 - 603: 7(int) GroupUMax 25 ExclusiveScan 602 - 604: 7(int) CompositeExtract 601 1 - 605: 7(int) GroupUMax 25 ExclusiveScan 604 - 606: 8(ivec2) CompositeConstruct 603 605 - 607: 29(ptr) AccessChain 20 28 - Store 607 606 - 608: 39(ptr) AccessChain 20 38 - 609: 10(fvec3) Load 608 - 610: 9(float) CompositeExtract 609 0 - 611: 9(float) GroupFMax 25 ExclusiveScan 610 - 612: 9(float) CompositeExtract 609 1 - 613: 9(float) GroupFMax 25 ExclusiveScan 612 - 614: 9(float) CompositeExtract 609 2 - 615: 9(float) GroupFMax 25 ExclusiveScan 614 - 616: 10(fvec3) CompositeConstruct 611 613 615 - 617: 39(ptr) AccessChain 20 38 - Store 617 616 - 618: 51(ptr) AccessChain 20 50 - 619: 12(fvec4) Load 618 - 620: 11(float) CompositeExtract 619 0 - 621: 11(float) GroupFMax 25 ExclusiveScan 620 - 622: 11(float) CompositeExtract 619 1 - 623: 11(float) GroupFMax 25 ExclusiveScan 622 - 624: 11(float) CompositeExtract 619 2 - 625: 11(float) GroupFMax 25 ExclusiveScan 624 - 626: 11(float) CompositeExtract 619 3 - 627: 11(float) GroupFMax 25 ExclusiveScan 626 - 628: 12(fvec4) CompositeConstruct 621 623 625 627 - 629: 51(ptr) AccessChain 20 50 - Store 629 628 - 630: 65(ptr) AccessChain 20 64 - 631: 13(int) Load 630 - 632: 13(int) GroupSMax 25 ExclusiveScan 631 - 633: 65(ptr) AccessChain 20 64 - Store 633 632 - 634: 71(ptr) AccessChain 20 70 - 635: 15(ivec2) Load 634 - 636: 14(int) CompositeExtract 635 0 - 637: 14(int) GroupUMax 25 ExclusiveScan 636 - 638: 14(int) CompositeExtract 635 1 - 639: 14(int) GroupUMax 25 ExclusiveScan 638 - 640: 15(ivec2) CompositeConstruct 637 639 - 641: 71(ptr) AccessChain 20 70 - Store 641 640 - 642: 81(ptr) AccessChain 20 80 - 643: 17(fvec3) Load 642 - 644: 16(float) CompositeExtract 643 0 - 645: 16(float) GroupFMax 25 ExclusiveScan 644 - 646: 16(float) CompositeExtract 643 1 - 647: 16(float) GroupFMax 25 ExclusiveScan 646 - 648: 16(float) CompositeExtract 643 2 - 649: 16(float) GroupFMax 25 ExclusiveScan 648 - 650: 17(fvec3) CompositeConstruct 645 647 649 - 651: 81(ptr) AccessChain 20 80 - Store 651 650 - 652: 22(ptr) AccessChain 20 21 - 653: 6(int) Load 652 - 654: 6(int) GroupIAdd 25 ExclusiveScan 653 - 655: 22(ptr) AccessChain 20 21 - Store 655 654 - 656: 29(ptr) AccessChain 20 28 - 657: 8(ivec2) Load 656 - 658: 7(int) CompositeExtract 657 0 - 659: 7(int) GroupIAdd 25 ExclusiveScan 658 - 660: 7(int) CompositeExtract 657 1 - 661: 7(int) GroupIAdd 25 ExclusiveScan 660 - 662: 8(ivec2) CompositeConstruct 659 661 - 663: 29(ptr) AccessChain 20 28 - Store 663 662 - 664: 39(ptr) AccessChain 20 38 - 665: 10(fvec3) Load 664 - 666: 9(float) CompositeExtract 665 0 - 667: 9(float) GroupFAdd 25 ExclusiveScan 666 - 668: 9(float) CompositeExtract 665 1 - 669: 9(float) GroupFAdd 25 ExclusiveScan 668 - 670: 9(float) CompositeExtract 665 2 - 671: 9(float) GroupFAdd 25 ExclusiveScan 670 - 672: 10(fvec3) CompositeConstruct 667 669 671 - 673: 39(ptr) AccessChain 20 38 - Store 673 672 - 674: 51(ptr) AccessChain 20 50 - 675: 12(fvec4) Load 674 - 676: 11(float) CompositeExtract 675 0 - 677: 11(float) GroupFAdd 25 ExclusiveScan 676 - 678: 11(float) CompositeExtract 675 1 - 679: 11(float) GroupFAdd 25 ExclusiveScan 678 - 680: 11(float) CompositeExtract 675 2 - 681: 11(float) GroupFAdd 25 ExclusiveScan 680 - 682: 11(float) CompositeExtract 675 3 - 683: 11(float) GroupFAdd 25 ExclusiveScan 682 - 684: 12(fvec4) CompositeConstruct 677 679 681 683 - 685: 51(ptr) AccessChain 20 50 - Store 685 684 - 686: 65(ptr) AccessChain 20 64 - 687: 13(int) Load 686 - 688: 13(int) GroupIAdd 25 ExclusiveScan 687 - 689: 65(ptr) AccessChain 20 64 - Store 689 688 - 690: 71(ptr) AccessChain 20 70 - 691: 15(ivec2) Load 690 - 692: 14(int) CompositeExtract 691 0 - 693: 14(int) GroupIAdd 25 ExclusiveScan 692 - 694: 14(int) CompositeExtract 691 1 - 695: 14(int) GroupIAdd 25 ExclusiveScan 694 - 696: 15(ivec2) CompositeConstruct 693 695 - 697: 71(ptr) AccessChain 20 70 - Store 697 696 - 698: 81(ptr) AccessChain 20 80 - 699: 17(fvec3) Load 698 - 700: 16(float) CompositeExtract 699 0 - 701: 16(float) GroupFAdd 25 ExclusiveScan 700 - 702: 16(float) CompositeExtract 699 1 - 703: 16(float) GroupFAdd 25 ExclusiveScan 702 - 704: 16(float) CompositeExtract 699 2 - 705: 16(float) GroupFAdd 25 ExclusiveScan 704 - 706: 17(fvec3) CompositeConstruct 701 703 705 - 707: 81(ptr) AccessChain 20 80 - Store 707 706 - 708: 22(ptr) AccessChain 20 21 - 709: 6(int) Load 708 - 710: 6(int) GroupSMinNonUniformAMD 25 InclusiveScan 709 - 711: 22(ptr) AccessChain 20 21 - Store 711 710 - 712: 29(ptr) AccessChain 20 28 - 713: 8(ivec2) Load 712 - 714: 7(int) CompositeExtract 713 0 - 715: 7(int) GroupUMinNonUniformAMD 25 InclusiveScan 714 - 716: 7(int) CompositeExtract 713 1 - 717: 7(int) GroupUMinNonUniformAMD 25 InclusiveScan 716 - 718: 8(ivec2) CompositeConstruct 715 717 - 719: 29(ptr) AccessChain 20 28 - Store 719 718 - 720: 39(ptr) AccessChain 20 38 - 721: 10(fvec3) Load 720 - 722: 9(float) CompositeExtract 721 0 - 723: 9(float) GroupFMinNonUniformAMD 25 InclusiveScan 722 - 724: 9(float) CompositeExtract 721 1 - 725: 9(float) GroupFMinNonUniformAMD 25 InclusiveScan 724 - 726: 9(float) CompositeExtract 721 2 - 727: 9(float) GroupFMinNonUniformAMD 25 InclusiveScan 726 - 728: 10(fvec3) CompositeConstruct 723 725 727 - 729: 39(ptr) AccessChain 20 38 - Store 729 728 - 730: 51(ptr) AccessChain 20 50 - 731: 12(fvec4) Load 730 - 732: 11(float) CompositeExtract 731 0 - 733: 11(float) GroupFMinNonUniformAMD 25 InclusiveScan 732 - 734: 11(float) CompositeExtract 731 1 - 735: 11(float) GroupFMinNonUniformAMD 25 InclusiveScan 734 - 736: 11(float) CompositeExtract 731 2 - 737: 11(float) GroupFMinNonUniformAMD 25 InclusiveScan 736 - 738: 11(float) CompositeExtract 731 3 - 739: 11(float) GroupFMinNonUniformAMD 25 InclusiveScan 738 - 740: 12(fvec4) CompositeConstruct 733 735 737 739 - 741: 51(ptr) AccessChain 20 50 - Store 741 740 - 742: 65(ptr) AccessChain 20 64 - 743: 13(int) Load 742 - 744: 13(int) GroupSMinNonUniformAMD 25 InclusiveScan 743 - 745: 65(ptr) AccessChain 20 64 - Store 745 744 - 746: 71(ptr) AccessChain 20 70 - 747: 15(ivec2) Load 746 - 748: 14(int) CompositeExtract 747 0 - 749: 14(int) GroupUMinNonUniformAMD 25 InclusiveScan 748 - 750: 14(int) CompositeExtract 747 1 - 751: 14(int) GroupUMinNonUniformAMD 25 InclusiveScan 750 - 752: 15(ivec2) CompositeConstruct 749 751 - 753: 71(ptr) AccessChain 20 70 - Store 753 752 - 754: 81(ptr) AccessChain 20 80 - 755: 17(fvec3) Load 754 - 756: 16(float) CompositeExtract 755 0 - 757: 16(float) GroupFMinNonUniformAMD 25 InclusiveScan 756 - 758: 16(float) CompositeExtract 755 1 - 759: 16(float) GroupFMinNonUniformAMD 25 InclusiveScan 758 - 760: 16(float) CompositeExtract 755 2 - 761: 16(float) GroupFMinNonUniformAMD 25 InclusiveScan 760 - 762: 17(fvec3) CompositeConstruct 757 759 761 - 763: 81(ptr) AccessChain 20 80 - Store 763 762 - 764: 22(ptr) AccessChain 20 21 - 765: 6(int) Load 764 - 766: 6(int) GroupSMaxNonUniformAMD 25 InclusiveScan 765 - 767: 22(ptr) AccessChain 20 21 - Store 767 766 - 768: 29(ptr) AccessChain 20 28 - 769: 8(ivec2) Load 768 - 770: 7(int) CompositeExtract 769 0 - 771: 7(int) GroupUMaxNonUniformAMD 25 InclusiveScan 770 - 772: 7(int) CompositeExtract 769 1 - 773: 7(int) GroupUMaxNonUniformAMD 25 InclusiveScan 772 - 774: 8(ivec2) CompositeConstruct 771 773 - 775: 29(ptr) AccessChain 20 28 - Store 775 774 - 776: 39(ptr) AccessChain 20 38 - 777: 10(fvec3) Load 776 - 778: 9(float) CompositeExtract 777 0 - 779: 9(float) GroupFMaxNonUniformAMD 25 InclusiveScan 778 - 780: 9(float) CompositeExtract 777 1 - 781: 9(float) GroupFMaxNonUniformAMD 25 InclusiveScan 780 - 782: 9(float) CompositeExtract 777 2 - 783: 9(float) GroupFMaxNonUniformAMD 25 InclusiveScan 782 - 784: 10(fvec3) CompositeConstruct 779 781 783 - 785: 39(ptr) AccessChain 20 38 - Store 785 784 - 786: 51(ptr) AccessChain 20 50 - 787: 12(fvec4) Load 786 - 788: 11(float) CompositeExtract 787 0 - 789: 11(float) GroupFMaxNonUniformAMD 25 InclusiveScan 788 - 790: 11(float) CompositeExtract 787 1 - 791: 11(float) GroupFMaxNonUniformAMD 25 InclusiveScan 790 - 792: 11(float) CompositeExtract 787 2 - 793: 11(float) GroupFMaxNonUniformAMD 25 InclusiveScan 792 - 794: 11(float) CompositeExtract 787 3 - 795: 11(float) GroupFMaxNonUniformAMD 25 InclusiveScan 794 - 796: 12(fvec4) CompositeConstruct 789 791 793 795 - 797: 51(ptr) AccessChain 20 50 - Store 797 796 - 798: 65(ptr) AccessChain 20 64 - 799: 13(int) Load 798 - 800: 13(int) GroupSMaxNonUniformAMD 25 InclusiveScan 799 - 801: 65(ptr) AccessChain 20 64 - Store 801 800 - 802: 71(ptr) AccessChain 20 70 - 803: 15(ivec2) Load 802 - 804: 14(int) CompositeExtract 803 0 - 805: 14(int) GroupUMaxNonUniformAMD 25 InclusiveScan 804 - 806: 14(int) CompositeExtract 803 1 - 807: 14(int) GroupUMaxNonUniformAMD 25 InclusiveScan 806 - 808: 15(ivec2) CompositeConstruct 805 807 - 809: 71(ptr) AccessChain 20 70 - Store 809 808 - 810: 81(ptr) AccessChain 20 80 - 811: 17(fvec3) Load 810 - 812: 16(float) CompositeExtract 811 0 - 813: 16(float) GroupFMaxNonUniformAMD 25 InclusiveScan 812 - 814: 16(float) CompositeExtract 811 1 - 815: 16(float) GroupFMaxNonUniformAMD 25 InclusiveScan 814 - 816: 16(float) CompositeExtract 811 2 - 817: 16(float) GroupFMaxNonUniformAMD 25 InclusiveScan 816 - 818: 17(fvec3) CompositeConstruct 813 815 817 - 819: 81(ptr) AccessChain 20 80 - Store 819 818 - 820: 22(ptr) AccessChain 20 21 - 821: 6(int) Load 820 - 822: 6(int) GroupIAddNonUniformAMD 25 InclusiveScan 821 - 823: 22(ptr) AccessChain 20 21 - Store 823 822 - 824: 29(ptr) AccessChain 20 28 - 825: 8(ivec2) Load 824 - 826: 7(int) CompositeExtract 825 0 - 827: 7(int) GroupIAddNonUniformAMD 25 InclusiveScan 826 - 828: 7(int) CompositeExtract 825 1 - 829: 7(int) GroupIAddNonUniformAMD 25 InclusiveScan 828 - 830: 8(ivec2) CompositeConstruct 827 829 - 831: 29(ptr) AccessChain 20 28 - Store 831 830 - 832: 39(ptr) AccessChain 20 38 - 833: 10(fvec3) Load 832 - 834: 9(float) CompositeExtract 833 0 - 835: 9(float) GroupFAddNonUniformAMD 25 InclusiveScan 834 - 836: 9(float) CompositeExtract 833 1 - 837: 9(float) GroupFAddNonUniformAMD 25 InclusiveScan 836 - 838: 9(float) CompositeExtract 833 2 - 839: 9(float) GroupFAddNonUniformAMD 25 InclusiveScan 838 - 840: 10(fvec3) CompositeConstruct 835 837 839 - 841: 39(ptr) AccessChain 20 38 - Store 841 840 - 842: 51(ptr) AccessChain 20 50 - 843: 12(fvec4) Load 842 - 844: 11(float) CompositeExtract 843 0 - 845: 11(float) GroupFAddNonUniformAMD 25 InclusiveScan 844 - 846: 11(float) CompositeExtract 843 1 - 847: 11(float) GroupFAddNonUniformAMD 25 InclusiveScan 846 - 848: 11(float) CompositeExtract 843 2 - 849: 11(float) GroupFAddNonUniformAMD 25 InclusiveScan 848 - 850: 11(float) CompositeExtract 843 3 - 851: 11(float) GroupFAddNonUniformAMD 25 InclusiveScan 850 - 852: 12(fvec4) CompositeConstruct 845 847 849 851 - 853: 51(ptr) AccessChain 20 50 - Store 853 852 - 854: 65(ptr) AccessChain 20 64 - 855: 13(int) Load 854 - 856: 13(int) GroupIAddNonUniformAMD 25 InclusiveScan 855 - 857: 65(ptr) AccessChain 20 64 - Store 857 856 - 858: 71(ptr) AccessChain 20 70 - 859: 15(ivec2) Load 858 - 860: 14(int) CompositeExtract 859 0 - 861: 14(int) GroupIAddNonUniformAMD 25 InclusiveScan 860 - 862: 14(int) CompositeExtract 859 1 - 863: 14(int) GroupIAddNonUniformAMD 25 InclusiveScan 862 - 864: 15(ivec2) CompositeConstruct 861 863 - 865: 71(ptr) AccessChain 20 70 - Store 865 864 - 866: 81(ptr) AccessChain 20 80 - 867: 17(fvec3) Load 866 - 868: 16(float) CompositeExtract 867 0 - 869: 16(float) GroupFAddNonUniformAMD 25 InclusiveScan 868 - 870: 16(float) CompositeExtract 867 1 - 871: 16(float) GroupFAddNonUniformAMD 25 InclusiveScan 870 - 872: 16(float) CompositeExtract 867 2 - 873: 16(float) GroupFAddNonUniformAMD 25 InclusiveScan 872 - 874: 17(fvec3) CompositeConstruct 869 871 873 - 875: 81(ptr) AccessChain 20 80 - Store 875 874 - 876: 22(ptr) AccessChain 20 21 - 877: 6(int) Load 876 - 878: 6(int) GroupSMinNonUniformAMD 25 ExclusiveScan 877 - 879: 22(ptr) AccessChain 20 21 - Store 879 878 - 880: 29(ptr) AccessChain 20 28 - 881: 8(ivec2) Load 880 - 882: 7(int) CompositeExtract 881 0 - 883: 7(int) GroupUMinNonUniformAMD 25 ExclusiveScan 882 - 884: 7(int) CompositeExtract 881 1 - 885: 7(int) GroupUMinNonUniformAMD 25 ExclusiveScan 884 - 886: 8(ivec2) CompositeConstruct 883 885 - 887: 29(ptr) AccessChain 20 28 - Store 887 886 - 888: 39(ptr) AccessChain 20 38 - 889: 10(fvec3) Load 888 - 890: 9(float) CompositeExtract 889 0 - 891: 9(float) GroupFMinNonUniformAMD 25 ExclusiveScan 890 - 892: 9(float) CompositeExtract 889 1 - 893: 9(float) GroupFMinNonUniformAMD 25 ExclusiveScan 892 - 894: 9(float) CompositeExtract 889 2 - 895: 9(float) GroupFMinNonUniformAMD 25 ExclusiveScan 894 - 896: 10(fvec3) CompositeConstruct 891 893 895 - 897: 39(ptr) AccessChain 20 38 - Store 897 896 - 898: 51(ptr) AccessChain 20 50 - 899: 12(fvec4) Load 898 - 900: 11(float) CompositeExtract 899 0 - 901: 11(float) GroupFMinNonUniformAMD 25 ExclusiveScan 900 - 902: 11(float) CompositeExtract 899 1 - 903: 11(float) GroupFMinNonUniformAMD 25 ExclusiveScan 902 - 904: 11(float) CompositeExtract 899 2 - 905: 11(float) GroupFMinNonUniformAMD 25 ExclusiveScan 904 - 906: 11(float) CompositeExtract 899 3 - 907: 11(float) GroupFMinNonUniformAMD 25 ExclusiveScan 906 - 908: 12(fvec4) CompositeConstruct 901 903 905 907 - 909: 51(ptr) AccessChain 20 50 - Store 909 908 - 910: 65(ptr) AccessChain 20 64 - 911: 13(int) Load 910 - 912: 13(int) GroupSMinNonUniformAMD 25 ExclusiveScan 911 - 913: 65(ptr) AccessChain 20 64 - Store 913 912 - 914: 71(ptr) AccessChain 20 70 - 915: 15(ivec2) Load 914 - 916: 14(int) CompositeExtract 915 0 - 917: 14(int) GroupUMinNonUniformAMD 25 ExclusiveScan 916 - 918: 14(int) CompositeExtract 915 1 - 919: 14(int) GroupUMinNonUniformAMD 25 ExclusiveScan 918 - 920: 15(ivec2) CompositeConstruct 917 919 - 921: 71(ptr) AccessChain 20 70 - Store 921 920 - 922: 81(ptr) AccessChain 20 80 - 923: 17(fvec3) Load 922 - 924: 16(float) CompositeExtract 923 0 - 925: 16(float) GroupFMinNonUniformAMD 25 ExclusiveScan 924 - 926: 16(float) CompositeExtract 923 1 - 927: 16(float) GroupFMinNonUniformAMD 25 ExclusiveScan 926 - 928: 16(float) CompositeExtract 923 2 - 929: 16(float) GroupFMinNonUniformAMD 25 ExclusiveScan 928 - 930: 17(fvec3) CompositeConstruct 925 927 929 - 931: 81(ptr) AccessChain 20 80 - Store 931 930 - 932: 22(ptr) AccessChain 20 21 - 933: 6(int) Load 932 - 934: 6(int) GroupSMaxNonUniformAMD 25 ExclusiveScan 933 - 935: 22(ptr) AccessChain 20 21 - Store 935 934 - 936: 29(ptr) AccessChain 20 28 - 937: 8(ivec2) Load 936 - 938: 7(int) CompositeExtract 937 0 - 939: 7(int) GroupUMaxNonUniformAMD 25 ExclusiveScan 938 - 940: 7(int) CompositeExtract 937 1 - 941: 7(int) GroupUMaxNonUniformAMD 25 ExclusiveScan 940 - 942: 8(ivec2) CompositeConstruct 939 941 - 943: 29(ptr) AccessChain 20 28 - Store 943 942 - 944: 39(ptr) AccessChain 20 38 - 945: 10(fvec3) Load 944 - 946: 9(float) CompositeExtract 945 0 - 947: 9(float) GroupFMaxNonUniformAMD 25 ExclusiveScan 946 - 948: 9(float) CompositeExtract 945 1 - 949: 9(float) GroupFMaxNonUniformAMD 25 ExclusiveScan 948 - 950: 9(float) CompositeExtract 945 2 - 951: 9(float) GroupFMaxNonUniformAMD 25 ExclusiveScan 950 - 952: 10(fvec3) CompositeConstruct 947 949 951 - 953: 39(ptr) AccessChain 20 38 - Store 953 952 - 954: 51(ptr) AccessChain 20 50 - 955: 12(fvec4) Load 954 - 956: 11(float) CompositeExtract 955 0 - 957: 11(float) GroupFMaxNonUniformAMD 25 ExclusiveScan 956 - 958: 11(float) CompositeExtract 955 1 - 959: 11(float) GroupFMaxNonUniformAMD 25 ExclusiveScan 958 - 960: 11(float) CompositeExtract 955 2 - 961: 11(float) GroupFMaxNonUniformAMD 25 ExclusiveScan 960 - 962: 11(float) CompositeExtract 955 3 - 963: 11(float) GroupFMaxNonUniformAMD 25 ExclusiveScan 962 - 964: 12(fvec4) CompositeConstruct 957 959 961 963 - 965: 51(ptr) AccessChain 20 50 - Store 965 964 - 966: 65(ptr) AccessChain 20 64 - 967: 13(int) Load 966 - 968: 13(int) GroupSMaxNonUniformAMD 25 ExclusiveScan 967 - 969: 65(ptr) AccessChain 20 64 - Store 969 968 - 970: 71(ptr) AccessChain 20 70 - 971: 15(ivec2) Load 970 - 972: 14(int) CompositeExtract 971 0 - 973: 14(int) GroupUMaxNonUniformAMD 25 ExclusiveScan 972 - 974: 14(int) CompositeExtract 971 1 - 975: 14(int) GroupUMaxNonUniformAMD 25 ExclusiveScan 974 - 976: 15(ivec2) CompositeConstruct 973 975 - 977: 71(ptr) AccessChain 20 70 - Store 977 976 - 978: 81(ptr) AccessChain 20 80 - 979: 17(fvec3) Load 978 - 980: 16(float) CompositeExtract 979 0 - 981: 16(float) GroupFMaxNonUniformAMD 25 ExclusiveScan 980 - 982: 16(float) CompositeExtract 979 1 - 983: 16(float) GroupFMaxNonUniformAMD 25 ExclusiveScan 982 - 984: 16(float) CompositeExtract 979 2 - 985: 16(float) GroupFMaxNonUniformAMD 25 ExclusiveScan 984 - 986: 17(fvec3) CompositeConstruct 981 983 985 - 987: 81(ptr) AccessChain 20 80 - Store 987 986 - 988: 22(ptr) AccessChain 20 21 - 989: 6(int) Load 988 - 990: 6(int) GroupIAddNonUniformAMD 25 ExclusiveScan 989 - 991: 22(ptr) AccessChain 20 21 - Store 991 990 - 992: 29(ptr) AccessChain 20 28 - 993: 8(ivec2) Load 992 - 994: 7(int) CompositeExtract 993 0 - 995: 7(int) GroupIAddNonUniformAMD 25 ExclusiveScan 994 - 996: 7(int) CompositeExtract 993 1 - 997: 7(int) GroupIAddNonUniformAMD 25 ExclusiveScan 996 - 998: 8(ivec2) CompositeConstruct 995 997 - 999: 29(ptr) AccessChain 20 28 - Store 999 998 - 1000: 39(ptr) AccessChain 20 38 - 1001: 10(fvec3) Load 1000 - 1002: 9(float) CompositeExtract 1001 0 - 1003: 9(float) GroupFAddNonUniformAMD 25 ExclusiveScan 1002 - 1004: 9(float) CompositeExtract 1001 1 - 1005: 9(float) GroupFAddNonUniformAMD 25 ExclusiveScan 1004 - 1006: 9(float) CompositeExtract 1001 2 - 1007: 9(float) GroupFAddNonUniformAMD 25 ExclusiveScan 1006 - 1008: 10(fvec3) CompositeConstruct 1003 1005 1007 - 1009: 39(ptr) AccessChain 20 38 - Store 1009 1008 - 1010: 51(ptr) AccessChain 20 50 - 1011: 12(fvec4) Load 1010 - 1012: 11(float) CompositeExtract 1011 0 - 1013: 11(float) GroupFAddNonUniformAMD 25 ExclusiveScan 1012 - 1014: 11(float) CompositeExtract 1011 1 - 1015: 11(float) GroupFAddNonUniformAMD 25 ExclusiveScan 1014 - 1016: 11(float) CompositeExtract 1011 2 - 1017: 11(float) GroupFAddNonUniformAMD 25 ExclusiveScan 1016 - 1018: 11(float) CompositeExtract 1011 3 - 1019: 11(float) GroupFAddNonUniformAMD 25 ExclusiveScan 1018 - 1020: 12(fvec4) CompositeConstruct 1013 1015 1017 1019 - 1021: 51(ptr) AccessChain 20 50 - Store 1021 1020 - 1022: 65(ptr) AccessChain 20 64 - 1023: 13(int) Load 1022 - 1024: 13(int) GroupIAddNonUniformAMD 25 ExclusiveScan 1023 - 1025: 65(ptr) AccessChain 20 64 - Store 1025 1024 - 1026: 71(ptr) AccessChain 20 70 - 1027: 15(ivec2) Load 1026 - 1028: 14(int) CompositeExtract 1027 0 - 1029: 14(int) GroupIAddNonUniformAMD 25 ExclusiveScan 1028 - 1030: 14(int) CompositeExtract 1027 1 - 1031: 14(int) GroupIAddNonUniformAMD 25 ExclusiveScan 1030 - 1032: 15(ivec2) CompositeConstruct 1029 1031 - 1033: 71(ptr) AccessChain 20 70 - Store 1033 1032 - 1034: 81(ptr) AccessChain 20 80 - 1035: 17(fvec3) Load 1034 - 1036: 16(float) CompositeExtract 1035 0 - 1037: 16(float) GroupFAddNonUniformAMD 25 ExclusiveScan 1036 - 1038: 16(float) CompositeExtract 1035 1 - 1039: 16(float) GroupFAddNonUniformAMD 25 ExclusiveScan 1038 - 1040: 16(float) CompositeExtract 1035 2 - 1041: 16(float) GroupFAddNonUniformAMD 25 ExclusiveScan 1040 - 1042: 17(fvec3) CompositeConstruct 1037 1039 1041 - 1043: 81(ptr) AccessChain 20 80 - Store 1043 1042 + 26: 25(ptr) AccessChain 23 24 + 27: 6(int) Load 26 + 29: 6(int) GroupSMin 28 Reduce 27 + 30: 25(ptr) AccessChain 23 24 + Store 30 29 + 33: 32(ptr) AccessChain 23 31 + 34: 8(ivec2) Load 33 + 35: 7(int) CompositeExtract 34 0 + 36: 7(int) GroupUMin 28 Reduce 35 + 37: 7(int) CompositeExtract 34 1 + 38: 7(int) GroupUMin 28 Reduce 37 + 39: 8(ivec2) CompositeConstruct 36 38 + 40: 32(ptr) AccessChain 23 31 + Store 40 39 + 43: 42(ptr) AccessChain 23 41 + 44: 10(fvec3) Load 43 + 45: 9(float) CompositeExtract 44 0 + 46: 9(float) GroupFMin 28 Reduce 45 + 47: 9(float) CompositeExtract 44 1 + 48: 9(float) GroupFMin 28 Reduce 47 + 49: 9(float) CompositeExtract 44 2 + 50: 9(float) GroupFMin 28 Reduce 49 + 51: 10(fvec3) CompositeConstruct 46 48 50 + 52: 42(ptr) AccessChain 23 41 + Store 52 51 + 55: 54(ptr) AccessChain 23 53 + 56: 12(fvec4) Load 55 + 57: 11(float) CompositeExtract 56 0 + 58: 11(float) GroupFMin 28 Reduce 57 + 59: 11(float) CompositeExtract 56 1 + 60: 11(float) GroupFMin 28 Reduce 59 + 61: 11(float) CompositeExtract 56 2 + 62: 11(float) GroupFMin 28 Reduce 61 + 63: 11(float) CompositeExtract 56 3 + 64: 11(float) GroupFMin 28 Reduce 63 + 65: 12(fvec4) CompositeConstruct 58 60 62 64 + 66: 54(ptr) AccessChain 23 53 + Store 66 65 + 69: 68(ptr) AccessChain 23 67 + 70: 13(int) Load 69 + 71: 13(int) GroupSMin 28 Reduce 70 + 72: 68(ptr) AccessChain 23 67 + Store 72 71 + 75: 74(ptr) AccessChain 23 73 + 76: 15(ivec2) Load 75 + 77: 14(int) CompositeExtract 76 0 + 78: 14(int) GroupUMin 28 Reduce 77 + 79: 14(int) CompositeExtract 76 1 + 80: 14(int) GroupUMin 28 Reduce 79 + 81: 15(ivec2) CompositeConstruct 78 80 + 82: 74(ptr) AccessChain 23 73 + Store 82 81 + 85: 84(ptr) AccessChain 23 83 + 86: 17(fvec3) Load 85 + 87: 16(float) CompositeExtract 86 0 + 88: 16(float) GroupFMin 28 Reduce 87 + 89: 16(float) CompositeExtract 86 1 + 90: 16(float) GroupFMin 28 Reduce 89 + 91: 16(float) CompositeExtract 86 2 + 92: 16(float) GroupFMin 28 Reduce 91 + 93: 17(fvec3) CompositeConstruct 88 90 92 + 94: 84(ptr) AccessChain 23 83 + Store 94 93 + 97: 96(ptr) AccessChain 23 95 + 98: 19(ivec4) Load 97 + 99: 18(int) CompositeExtract 98 0 + 100: 18(int) GroupSMin 28 Reduce 99 + 101: 18(int) CompositeExtract 98 1 + 102: 18(int) GroupSMin 28 Reduce 101 + 103: 18(int) CompositeExtract 98 2 + 104: 18(int) GroupSMin 28 Reduce 103 + 105: 18(int) CompositeExtract 98 3 + 106: 18(int) GroupSMin 28 Reduce 105 + 107: 19(ivec4) CompositeConstruct 100 102 104 106 + 108: 96(ptr) AccessChain 23 95 + Store 108 107 + 111: 110(ptr) AccessChain 23 109 + 112: 20(int) Load 111 + 113: 20(int) GroupUMin 28 Reduce 112 + 114: 110(ptr) AccessChain 23 109 + Store 114 113 + 115: 25(ptr) AccessChain 23 24 + 116: 6(int) Load 115 + 117: 6(int) GroupSMax 28 Reduce 116 + 118: 25(ptr) AccessChain 23 24 + Store 118 117 + 119: 32(ptr) AccessChain 23 31 + 120: 8(ivec2) Load 119 + 121: 7(int) CompositeExtract 120 0 + 122: 7(int) GroupUMax 28 Reduce 121 + 123: 7(int) CompositeExtract 120 1 + 124: 7(int) GroupUMax 28 Reduce 123 + 125: 8(ivec2) CompositeConstruct 122 124 + 126: 32(ptr) AccessChain 23 31 + Store 126 125 + 127: 42(ptr) AccessChain 23 41 + 128: 10(fvec3) Load 127 + 129: 9(float) CompositeExtract 128 0 + 130: 9(float) GroupFMax 28 Reduce 129 + 131: 9(float) CompositeExtract 128 1 + 132: 9(float) GroupFMax 28 Reduce 131 + 133: 9(float) CompositeExtract 128 2 + 134: 9(float) GroupFMax 28 Reduce 133 + 135: 10(fvec3) CompositeConstruct 130 132 134 + 136: 42(ptr) AccessChain 23 41 + Store 136 135 + 137: 54(ptr) AccessChain 23 53 + 138: 12(fvec4) Load 137 + 139: 11(float) CompositeExtract 138 0 + 140: 11(float) GroupFMax 28 Reduce 139 + 141: 11(float) CompositeExtract 138 1 + 142: 11(float) GroupFMax 28 Reduce 141 + 143: 11(float) CompositeExtract 138 2 + 144: 11(float) GroupFMax 28 Reduce 143 + 145: 11(float) CompositeExtract 138 3 + 146: 11(float) GroupFMax 28 Reduce 145 + 147: 12(fvec4) CompositeConstruct 140 142 144 146 + 148: 54(ptr) AccessChain 23 53 + Store 148 147 + 149: 68(ptr) AccessChain 23 67 + 150: 13(int) Load 149 + 151: 13(int) GroupSMax 28 Reduce 150 + 152: 68(ptr) AccessChain 23 67 + Store 152 151 + 153: 74(ptr) AccessChain 23 73 + 154: 15(ivec2) Load 153 + 155: 14(int) CompositeExtract 154 0 + 156: 14(int) GroupUMax 28 Reduce 155 + 157: 14(int) CompositeExtract 154 1 + 158: 14(int) GroupUMax 28 Reduce 157 + 159: 15(ivec2) CompositeConstruct 156 158 + 160: 74(ptr) AccessChain 23 73 + Store 160 159 + 161: 84(ptr) AccessChain 23 83 + 162: 17(fvec3) Load 161 + 163: 16(float) CompositeExtract 162 0 + 164: 16(float) GroupFMax 28 Reduce 163 + 165: 16(float) CompositeExtract 162 1 + 166: 16(float) GroupFMax 28 Reduce 165 + 167: 16(float) CompositeExtract 162 2 + 168: 16(float) GroupFMax 28 Reduce 167 + 169: 17(fvec3) CompositeConstruct 164 166 168 + 170: 84(ptr) AccessChain 23 83 + Store 170 169 + 171: 96(ptr) AccessChain 23 95 + 172: 19(ivec4) Load 171 + 173: 18(int) CompositeExtract 172 0 + 174: 18(int) GroupSMax 28 Reduce 173 + 175: 18(int) CompositeExtract 172 1 + 176: 18(int) GroupSMax 28 Reduce 175 + 177: 18(int) CompositeExtract 172 2 + 178: 18(int) GroupSMax 28 Reduce 177 + 179: 18(int) CompositeExtract 172 3 + 180: 18(int) GroupSMax 28 Reduce 179 + 181: 19(ivec4) CompositeConstruct 174 176 178 180 + 182: 96(ptr) AccessChain 23 95 + Store 182 181 + 183: 110(ptr) AccessChain 23 109 + 184: 20(int) Load 183 + 185: 20(int) GroupUMax 28 Reduce 184 + 186: 110(ptr) AccessChain 23 109 + Store 186 185 + 187: 25(ptr) AccessChain 23 24 + 188: 6(int) Load 187 + 189: 6(int) GroupIAdd 28 Reduce 188 + 190: 25(ptr) AccessChain 23 24 + Store 190 189 + 191: 32(ptr) AccessChain 23 31 + 192: 8(ivec2) Load 191 + 193: 7(int) CompositeExtract 192 0 + 194: 7(int) GroupIAdd 28 Reduce 193 + 195: 7(int) CompositeExtract 192 1 + 196: 7(int) GroupIAdd 28 Reduce 195 + 197: 8(ivec2) CompositeConstruct 194 196 + 198: 32(ptr) AccessChain 23 31 + Store 198 197 + 199: 42(ptr) AccessChain 23 41 + 200: 10(fvec3) Load 199 + 201: 9(float) CompositeExtract 200 0 + 202: 9(float) GroupFAdd 28 Reduce 201 + 203: 9(float) CompositeExtract 200 1 + 204: 9(float) GroupFAdd 28 Reduce 203 + 205: 9(float) CompositeExtract 200 2 + 206: 9(float) GroupFAdd 28 Reduce 205 + 207: 10(fvec3) CompositeConstruct 202 204 206 + 208: 42(ptr) AccessChain 23 41 + Store 208 207 + 209: 54(ptr) AccessChain 23 53 + 210: 12(fvec4) Load 209 + 211: 11(float) CompositeExtract 210 0 + 212: 11(float) GroupFAdd 28 Reduce 211 + 213: 11(float) CompositeExtract 210 1 + 214: 11(float) GroupFAdd 28 Reduce 213 + 215: 11(float) CompositeExtract 210 2 + 216: 11(float) GroupFAdd 28 Reduce 215 + 217: 11(float) CompositeExtract 210 3 + 218: 11(float) GroupFAdd 28 Reduce 217 + 219: 12(fvec4) CompositeConstruct 212 214 216 218 + 220: 54(ptr) AccessChain 23 53 + Store 220 219 + 221: 68(ptr) AccessChain 23 67 + 222: 13(int) Load 221 + 223: 13(int) GroupIAdd 28 Reduce 222 + 224: 68(ptr) AccessChain 23 67 + Store 224 223 + 225: 74(ptr) AccessChain 23 73 + 226: 15(ivec2) Load 225 + 227: 14(int) CompositeExtract 226 0 + 228: 14(int) GroupIAdd 28 Reduce 227 + 229: 14(int) CompositeExtract 226 1 + 230: 14(int) GroupIAdd 28 Reduce 229 + 231: 15(ivec2) CompositeConstruct 228 230 + 232: 74(ptr) AccessChain 23 73 + Store 232 231 + 233: 84(ptr) AccessChain 23 83 + 234: 17(fvec3) Load 233 + 235: 16(float) CompositeExtract 234 0 + 236: 16(float) GroupFAdd 28 Reduce 235 + 237: 16(float) CompositeExtract 234 1 + 238: 16(float) GroupFAdd 28 Reduce 237 + 239: 16(float) CompositeExtract 234 2 + 240: 16(float) GroupFAdd 28 Reduce 239 + 241: 17(fvec3) CompositeConstruct 236 238 240 + 242: 84(ptr) AccessChain 23 83 + Store 242 241 + 243: 96(ptr) AccessChain 23 95 + 244: 19(ivec4) Load 243 + 245: 18(int) CompositeExtract 244 0 + 246: 18(int) GroupIAdd 28 Reduce 245 + 247: 18(int) CompositeExtract 244 1 + 248: 18(int) GroupIAdd 28 Reduce 247 + 249: 18(int) CompositeExtract 244 2 + 250: 18(int) GroupIAdd 28 Reduce 249 + 251: 18(int) CompositeExtract 244 3 + 252: 18(int) GroupIAdd 28 Reduce 251 + 253: 19(ivec4) CompositeConstruct 246 248 250 252 + 254: 96(ptr) AccessChain 23 95 + Store 254 253 + 255: 110(ptr) AccessChain 23 109 + 256: 20(int) Load 255 + 257: 20(int) GroupIAdd 28 Reduce 256 + 258: 110(ptr) AccessChain 23 109 + Store 258 257 + 259: 25(ptr) AccessChain 23 24 + 260: 6(int) Load 259 + 261: 6(int) GroupSMinNonUniformAMD 28 Reduce 260 + 262: 25(ptr) AccessChain 23 24 + Store 262 261 + 263: 32(ptr) AccessChain 23 31 + 264: 8(ivec2) Load 263 + 265: 7(int) CompositeExtract 264 0 + 266: 7(int) GroupUMinNonUniformAMD 28 Reduce 265 + 267: 7(int) CompositeExtract 264 1 + 268: 7(int) GroupUMinNonUniformAMD 28 Reduce 267 + 269: 8(ivec2) CompositeConstruct 266 268 + 270: 32(ptr) AccessChain 23 31 + Store 270 269 + 271: 42(ptr) AccessChain 23 41 + 272: 10(fvec3) Load 271 + 273: 9(float) CompositeExtract 272 0 + 274: 9(float) GroupFMinNonUniformAMD 28 Reduce 273 + 275: 9(float) CompositeExtract 272 1 + 276: 9(float) GroupFMinNonUniformAMD 28 Reduce 275 + 277: 9(float) CompositeExtract 272 2 + 278: 9(float) GroupFMinNonUniformAMD 28 Reduce 277 + 279: 10(fvec3) CompositeConstruct 274 276 278 + 280: 42(ptr) AccessChain 23 41 + Store 280 279 + 281: 54(ptr) AccessChain 23 53 + 282: 12(fvec4) Load 281 + 283: 11(float) CompositeExtract 282 0 + 284: 11(float) GroupFMinNonUniformAMD 28 Reduce 283 + 285: 11(float) CompositeExtract 282 1 + 286: 11(float) GroupFMinNonUniformAMD 28 Reduce 285 + 287: 11(float) CompositeExtract 282 2 + 288: 11(float) GroupFMinNonUniformAMD 28 Reduce 287 + 289: 11(float) CompositeExtract 282 3 + 290: 11(float) GroupFMinNonUniformAMD 28 Reduce 289 + 291: 12(fvec4) CompositeConstruct 284 286 288 290 + 292: 54(ptr) AccessChain 23 53 + Store 292 291 + 293: 68(ptr) AccessChain 23 67 + 294: 13(int) Load 293 + 295: 13(int) GroupSMinNonUniformAMD 28 Reduce 294 + 296: 68(ptr) AccessChain 23 67 + Store 296 295 + 297: 74(ptr) AccessChain 23 73 + 298: 15(ivec2) Load 297 + 299: 14(int) CompositeExtract 298 0 + 300: 14(int) GroupUMinNonUniformAMD 28 Reduce 299 + 301: 14(int) CompositeExtract 298 1 + 302: 14(int) GroupUMinNonUniformAMD 28 Reduce 301 + 303: 15(ivec2) CompositeConstruct 300 302 + 304: 74(ptr) AccessChain 23 73 + Store 304 303 + 305: 84(ptr) AccessChain 23 83 + 306: 17(fvec3) Load 305 + 307: 16(float) CompositeExtract 306 0 + 308: 16(float) GroupFMinNonUniformAMD 28 Reduce 307 + 309: 16(float) CompositeExtract 306 1 + 310: 16(float) GroupFMinNonUniformAMD 28 Reduce 309 + 311: 16(float) CompositeExtract 306 2 + 312: 16(float) GroupFMinNonUniformAMD 28 Reduce 311 + 313: 17(fvec3) CompositeConstruct 308 310 312 + 314: 84(ptr) AccessChain 23 83 + Store 314 313 + 315: 96(ptr) AccessChain 23 95 + 316: 19(ivec4) Load 315 + 317: 18(int) CompositeExtract 316 0 + 318: 18(int) GroupSMinNonUniformAMD 28 Reduce 317 + 319: 18(int) CompositeExtract 316 1 + 320: 18(int) GroupSMinNonUniformAMD 28 Reduce 319 + 321: 18(int) CompositeExtract 316 2 + 322: 18(int) GroupSMinNonUniformAMD 28 Reduce 321 + 323: 18(int) CompositeExtract 316 3 + 324: 18(int) GroupSMinNonUniformAMD 28 Reduce 323 + 325: 19(ivec4) CompositeConstruct 318 320 322 324 + 326: 96(ptr) AccessChain 23 95 + Store 326 325 + 327: 110(ptr) AccessChain 23 109 + 328: 20(int) Load 327 + 329: 20(int) GroupUMinNonUniformAMD 28 Reduce 328 + 330: 110(ptr) AccessChain 23 109 + Store 330 329 + 331: 25(ptr) AccessChain 23 24 + 332: 6(int) Load 331 + 333: 6(int) GroupSMaxNonUniformAMD 28 Reduce 332 + 334: 25(ptr) AccessChain 23 24 + Store 334 333 + 335: 32(ptr) AccessChain 23 31 + 336: 8(ivec2) Load 335 + 337: 7(int) CompositeExtract 336 0 + 338: 7(int) GroupUMaxNonUniformAMD 28 Reduce 337 + 339: 7(int) CompositeExtract 336 1 + 340: 7(int) GroupUMaxNonUniformAMD 28 Reduce 339 + 341: 8(ivec2) CompositeConstruct 338 340 + 342: 32(ptr) AccessChain 23 31 + Store 342 341 + 343: 42(ptr) AccessChain 23 41 + 344: 10(fvec3) Load 343 + 345: 9(float) CompositeExtract 344 0 + 346: 9(float) GroupFMaxNonUniformAMD 28 Reduce 345 + 347: 9(float) CompositeExtract 344 1 + 348: 9(float) GroupFMaxNonUniformAMD 28 Reduce 347 + 349: 9(float) CompositeExtract 344 2 + 350: 9(float) GroupFMaxNonUniformAMD 28 Reduce 349 + 351: 10(fvec3) CompositeConstruct 346 348 350 + 352: 42(ptr) AccessChain 23 41 + Store 352 351 + 353: 54(ptr) AccessChain 23 53 + 354: 12(fvec4) Load 353 + 355: 11(float) CompositeExtract 354 0 + 356: 11(float) GroupFMaxNonUniformAMD 28 Reduce 355 + 357: 11(float) CompositeExtract 354 1 + 358: 11(float) GroupFMaxNonUniformAMD 28 Reduce 357 + 359: 11(float) CompositeExtract 354 2 + 360: 11(float) GroupFMaxNonUniformAMD 28 Reduce 359 + 361: 11(float) CompositeExtract 354 3 + 362: 11(float) GroupFMaxNonUniformAMD 28 Reduce 361 + 363: 12(fvec4) CompositeConstruct 356 358 360 362 + 364: 54(ptr) AccessChain 23 53 + Store 364 363 + 365: 68(ptr) AccessChain 23 67 + 366: 13(int) Load 365 + 367: 13(int) GroupSMaxNonUniformAMD 28 Reduce 366 + 368: 68(ptr) AccessChain 23 67 + Store 368 367 + 369: 74(ptr) AccessChain 23 73 + 370: 15(ivec2) Load 369 + 371: 14(int) CompositeExtract 370 0 + 372: 14(int) GroupUMaxNonUniformAMD 28 Reduce 371 + 373: 14(int) CompositeExtract 370 1 + 374: 14(int) GroupUMaxNonUniformAMD 28 Reduce 373 + 375: 15(ivec2) CompositeConstruct 372 374 + 376: 74(ptr) AccessChain 23 73 + Store 376 375 + 377: 84(ptr) AccessChain 23 83 + 378: 17(fvec3) Load 377 + 379: 16(float) CompositeExtract 378 0 + 380: 16(float) GroupFMaxNonUniformAMD 28 Reduce 379 + 381: 16(float) CompositeExtract 378 1 + 382: 16(float) GroupFMaxNonUniformAMD 28 Reduce 381 + 383: 16(float) CompositeExtract 378 2 + 384: 16(float) GroupFMaxNonUniformAMD 28 Reduce 383 + 385: 17(fvec3) CompositeConstruct 380 382 384 + 386: 84(ptr) AccessChain 23 83 + Store 386 385 + 387: 96(ptr) AccessChain 23 95 + 388: 19(ivec4) Load 387 + 389: 18(int) CompositeExtract 388 0 + 390: 18(int) GroupSMaxNonUniformAMD 28 Reduce 389 + 391: 18(int) CompositeExtract 388 1 + 392: 18(int) GroupSMaxNonUniformAMD 28 Reduce 391 + 393: 18(int) CompositeExtract 388 2 + 394: 18(int) GroupSMaxNonUniformAMD 28 Reduce 393 + 395: 18(int) CompositeExtract 388 3 + 396: 18(int) GroupSMaxNonUniformAMD 28 Reduce 395 + 397: 19(ivec4) CompositeConstruct 390 392 394 396 + 398: 96(ptr) AccessChain 23 95 + Store 398 397 + 399: 110(ptr) AccessChain 23 109 + 400: 20(int) Load 399 + 401: 20(int) GroupUMaxNonUniformAMD 28 Reduce 400 + 402: 110(ptr) AccessChain 23 109 + Store 402 401 + 403: 25(ptr) AccessChain 23 24 + 404: 6(int) Load 403 + 405: 6(int) GroupIAddNonUniformAMD 28 Reduce 404 + 406: 25(ptr) AccessChain 23 24 + Store 406 405 + 407: 32(ptr) AccessChain 23 31 + 408: 8(ivec2) Load 407 + 409: 7(int) CompositeExtract 408 0 + 410: 7(int) GroupIAddNonUniformAMD 28 Reduce 409 + 411: 7(int) CompositeExtract 408 1 + 412: 7(int) GroupIAddNonUniformAMD 28 Reduce 411 + 413: 8(ivec2) CompositeConstruct 410 412 + 414: 32(ptr) AccessChain 23 31 + Store 414 413 + 415: 42(ptr) AccessChain 23 41 + 416: 10(fvec3) Load 415 + 417: 9(float) CompositeExtract 416 0 + 418: 9(float) GroupFAddNonUniformAMD 28 Reduce 417 + 419: 9(float) CompositeExtract 416 1 + 420: 9(float) GroupFAddNonUniformAMD 28 Reduce 419 + 421: 9(float) CompositeExtract 416 2 + 422: 9(float) GroupFAddNonUniformAMD 28 Reduce 421 + 423: 10(fvec3) CompositeConstruct 418 420 422 + 424: 42(ptr) AccessChain 23 41 + Store 424 423 + 425: 54(ptr) AccessChain 23 53 + 426: 12(fvec4) Load 425 + 427: 11(float) CompositeExtract 426 0 + 428: 11(float) GroupFAddNonUniformAMD 28 Reduce 427 + 429: 11(float) CompositeExtract 426 1 + 430: 11(float) GroupFAddNonUniformAMD 28 Reduce 429 + 431: 11(float) CompositeExtract 426 2 + 432: 11(float) GroupFAddNonUniformAMD 28 Reduce 431 + 433: 11(float) CompositeExtract 426 3 + 434: 11(float) GroupFAddNonUniformAMD 28 Reduce 433 + 435: 12(fvec4) CompositeConstruct 428 430 432 434 + 436: 54(ptr) AccessChain 23 53 + Store 436 435 + 437: 68(ptr) AccessChain 23 67 + 438: 13(int) Load 437 + 439: 13(int) GroupIAddNonUniformAMD 28 Reduce 438 + 440: 68(ptr) AccessChain 23 67 + Store 440 439 + 441: 74(ptr) AccessChain 23 73 + 442: 15(ivec2) Load 441 + 443: 14(int) CompositeExtract 442 0 + 444: 14(int) GroupIAddNonUniformAMD 28 Reduce 443 + 445: 14(int) CompositeExtract 442 1 + 446: 14(int) GroupIAddNonUniformAMD 28 Reduce 445 + 447: 15(ivec2) CompositeConstruct 444 446 + 448: 74(ptr) AccessChain 23 73 + Store 448 447 + 449: 84(ptr) AccessChain 23 83 + 450: 17(fvec3) Load 449 + 451: 16(float) CompositeExtract 450 0 + 452: 16(float) GroupFAddNonUniformAMD 28 Reduce 451 + 453: 16(float) CompositeExtract 450 1 + 454: 16(float) GroupFAddNonUniformAMD 28 Reduce 453 + 455: 16(float) CompositeExtract 450 2 + 456: 16(float) GroupFAddNonUniformAMD 28 Reduce 455 + 457: 17(fvec3) CompositeConstruct 452 454 456 + 458: 84(ptr) AccessChain 23 83 + Store 458 457 + 459: 96(ptr) AccessChain 23 95 + 460: 19(ivec4) Load 459 + 461: 18(int) CompositeExtract 460 0 + 462: 18(int) GroupIAddNonUniformAMD 28 Reduce 461 + 463: 18(int) CompositeExtract 460 1 + 464: 18(int) GroupIAddNonUniformAMD 28 Reduce 463 + 465: 18(int) CompositeExtract 460 2 + 466: 18(int) GroupIAddNonUniformAMD 28 Reduce 465 + 467: 18(int) CompositeExtract 460 3 + 468: 18(int) GroupIAddNonUniformAMD 28 Reduce 467 + 469: 19(ivec4) CompositeConstruct 462 464 466 468 + 470: 96(ptr) AccessChain 23 95 + Store 470 469 + 471: 110(ptr) AccessChain 23 109 + 472: 20(int) Load 471 + 473: 20(int) GroupIAddNonUniformAMD 28 Reduce 472 + 474: 110(ptr) AccessChain 23 109 + Store 474 473 + 475: 25(ptr) AccessChain 23 24 + 476: 6(int) Load 475 + 477: 6(int) GroupSMin 28 InclusiveScan 476 + 478: 25(ptr) AccessChain 23 24 + Store 478 477 + 479: 32(ptr) AccessChain 23 31 + 480: 8(ivec2) Load 479 + 481: 7(int) CompositeExtract 480 0 + 482: 7(int) GroupUMin 28 InclusiveScan 481 + 483: 7(int) CompositeExtract 480 1 + 484: 7(int) GroupUMin 28 InclusiveScan 483 + 485: 8(ivec2) CompositeConstruct 482 484 + 486: 32(ptr) AccessChain 23 31 + Store 486 485 + 487: 42(ptr) AccessChain 23 41 + 488: 10(fvec3) Load 487 + 489: 9(float) CompositeExtract 488 0 + 490: 9(float) GroupFMin 28 InclusiveScan 489 + 491: 9(float) CompositeExtract 488 1 + 492: 9(float) GroupFMin 28 InclusiveScan 491 + 493: 9(float) CompositeExtract 488 2 + 494: 9(float) GroupFMin 28 InclusiveScan 493 + 495: 10(fvec3) CompositeConstruct 490 492 494 + 496: 42(ptr) AccessChain 23 41 + Store 496 495 + 497: 54(ptr) AccessChain 23 53 + 498: 12(fvec4) Load 497 + 499: 11(float) CompositeExtract 498 0 + 500: 11(float) GroupFMin 28 InclusiveScan 499 + 501: 11(float) CompositeExtract 498 1 + 502: 11(float) GroupFMin 28 InclusiveScan 501 + 503: 11(float) CompositeExtract 498 2 + 504: 11(float) GroupFMin 28 InclusiveScan 503 + 505: 11(float) CompositeExtract 498 3 + 506: 11(float) GroupFMin 28 InclusiveScan 505 + 507: 12(fvec4) CompositeConstruct 500 502 504 506 + 508: 54(ptr) AccessChain 23 53 + Store 508 507 + 509: 68(ptr) AccessChain 23 67 + 510: 13(int) Load 509 + 511: 13(int) GroupSMin 28 InclusiveScan 510 + 512: 68(ptr) AccessChain 23 67 + Store 512 511 + 513: 74(ptr) AccessChain 23 73 + 514: 15(ivec2) Load 513 + 515: 14(int) CompositeExtract 514 0 + 516: 14(int) GroupUMin 28 InclusiveScan 515 + 517: 14(int) CompositeExtract 514 1 + 518: 14(int) GroupUMin 28 InclusiveScan 517 + 519: 15(ivec2) CompositeConstruct 516 518 + 520: 74(ptr) AccessChain 23 73 + Store 520 519 + 521: 84(ptr) AccessChain 23 83 + 522: 17(fvec3) Load 521 + 523: 16(float) CompositeExtract 522 0 + 524: 16(float) GroupFMin 28 InclusiveScan 523 + 525: 16(float) CompositeExtract 522 1 + 526: 16(float) GroupFMin 28 InclusiveScan 525 + 527: 16(float) CompositeExtract 522 2 + 528: 16(float) GroupFMin 28 InclusiveScan 527 + 529: 17(fvec3) CompositeConstruct 524 526 528 + 530: 84(ptr) AccessChain 23 83 + Store 530 529 + 531: 96(ptr) AccessChain 23 95 + 532: 19(ivec4) Load 531 + 533: 18(int) CompositeExtract 532 0 + 534: 18(int) GroupSMin 28 InclusiveScan 533 + 535: 18(int) CompositeExtract 532 1 + 536: 18(int) GroupSMin 28 InclusiveScan 535 + 537: 18(int) CompositeExtract 532 2 + 538: 18(int) GroupSMin 28 InclusiveScan 537 + 539: 18(int) CompositeExtract 532 3 + 540: 18(int) GroupSMin 28 InclusiveScan 539 + 541: 19(ivec4) CompositeConstruct 534 536 538 540 + 542: 96(ptr) AccessChain 23 95 + Store 542 541 + 543: 110(ptr) AccessChain 23 109 + 544: 20(int) Load 543 + 545: 20(int) GroupUMin 28 InclusiveScan 544 + 546: 110(ptr) AccessChain 23 109 + Store 546 545 + 547: 25(ptr) AccessChain 23 24 + 548: 6(int) Load 547 + 549: 6(int) GroupSMax 28 InclusiveScan 548 + 550: 25(ptr) AccessChain 23 24 + Store 550 549 + 551: 32(ptr) AccessChain 23 31 + 552: 8(ivec2) Load 551 + 553: 7(int) CompositeExtract 552 0 + 554: 7(int) GroupUMax 28 InclusiveScan 553 + 555: 7(int) CompositeExtract 552 1 + 556: 7(int) GroupUMax 28 InclusiveScan 555 + 557: 8(ivec2) CompositeConstruct 554 556 + 558: 32(ptr) AccessChain 23 31 + Store 558 557 + 559: 42(ptr) AccessChain 23 41 + 560: 10(fvec3) Load 559 + 561: 9(float) CompositeExtract 560 0 + 562: 9(float) GroupFMax 28 InclusiveScan 561 + 563: 9(float) CompositeExtract 560 1 + 564: 9(float) GroupFMax 28 InclusiveScan 563 + 565: 9(float) CompositeExtract 560 2 + 566: 9(float) GroupFMax 28 InclusiveScan 565 + 567: 10(fvec3) CompositeConstruct 562 564 566 + 568: 42(ptr) AccessChain 23 41 + Store 568 567 + 569: 54(ptr) AccessChain 23 53 + 570: 12(fvec4) Load 569 + 571: 11(float) CompositeExtract 570 0 + 572: 11(float) GroupFMax 28 InclusiveScan 571 + 573: 11(float) CompositeExtract 570 1 + 574: 11(float) GroupFMax 28 InclusiveScan 573 + 575: 11(float) CompositeExtract 570 2 + 576: 11(float) GroupFMax 28 InclusiveScan 575 + 577: 11(float) CompositeExtract 570 3 + 578: 11(float) GroupFMax 28 InclusiveScan 577 + 579: 12(fvec4) CompositeConstruct 572 574 576 578 + 580: 54(ptr) AccessChain 23 53 + Store 580 579 + 581: 68(ptr) AccessChain 23 67 + 582: 13(int) Load 581 + 583: 13(int) GroupSMax 28 InclusiveScan 582 + 584: 68(ptr) AccessChain 23 67 + Store 584 583 + 585: 74(ptr) AccessChain 23 73 + 586: 15(ivec2) Load 585 + 587: 14(int) CompositeExtract 586 0 + 588: 14(int) GroupUMax 28 InclusiveScan 587 + 589: 14(int) CompositeExtract 586 1 + 590: 14(int) GroupUMax 28 InclusiveScan 589 + 591: 15(ivec2) CompositeConstruct 588 590 + 592: 74(ptr) AccessChain 23 73 + Store 592 591 + 593: 84(ptr) AccessChain 23 83 + 594: 17(fvec3) Load 593 + 595: 16(float) CompositeExtract 594 0 + 596: 16(float) GroupFMax 28 InclusiveScan 595 + 597: 16(float) CompositeExtract 594 1 + 598: 16(float) GroupFMax 28 InclusiveScan 597 + 599: 16(float) CompositeExtract 594 2 + 600: 16(float) GroupFMax 28 InclusiveScan 599 + 601: 17(fvec3) CompositeConstruct 596 598 600 + 602: 84(ptr) AccessChain 23 83 + Store 602 601 + 603: 96(ptr) AccessChain 23 95 + 604: 19(ivec4) Load 603 + 605: 18(int) CompositeExtract 604 0 + 606: 18(int) GroupSMax 28 InclusiveScan 605 + 607: 18(int) CompositeExtract 604 1 + 608: 18(int) GroupSMax 28 InclusiveScan 607 + 609: 18(int) CompositeExtract 604 2 + 610: 18(int) GroupSMax 28 InclusiveScan 609 + 611: 18(int) CompositeExtract 604 3 + 612: 18(int) GroupSMax 28 InclusiveScan 611 + 613: 19(ivec4) CompositeConstruct 606 608 610 612 + 614: 96(ptr) AccessChain 23 95 + Store 614 613 + 615: 110(ptr) AccessChain 23 109 + 616: 20(int) Load 615 + 617: 20(int) GroupUMax 28 InclusiveScan 616 + 618: 110(ptr) AccessChain 23 109 + Store 618 617 + 619: 25(ptr) AccessChain 23 24 + 620: 6(int) Load 619 + 621: 6(int) GroupIAdd 28 InclusiveScan 620 + 622: 25(ptr) AccessChain 23 24 + Store 622 621 + 623: 32(ptr) AccessChain 23 31 + 624: 8(ivec2) Load 623 + 625: 7(int) CompositeExtract 624 0 + 626: 7(int) GroupIAdd 28 InclusiveScan 625 + 627: 7(int) CompositeExtract 624 1 + 628: 7(int) GroupIAdd 28 InclusiveScan 627 + 629: 8(ivec2) CompositeConstruct 626 628 + 630: 32(ptr) AccessChain 23 31 + Store 630 629 + 631: 42(ptr) AccessChain 23 41 + 632: 10(fvec3) Load 631 + 633: 9(float) CompositeExtract 632 0 + 634: 9(float) GroupFAdd 28 InclusiveScan 633 + 635: 9(float) CompositeExtract 632 1 + 636: 9(float) GroupFAdd 28 InclusiveScan 635 + 637: 9(float) CompositeExtract 632 2 + 638: 9(float) GroupFAdd 28 InclusiveScan 637 + 639: 10(fvec3) CompositeConstruct 634 636 638 + 640: 42(ptr) AccessChain 23 41 + Store 640 639 + 641: 54(ptr) AccessChain 23 53 + 642: 12(fvec4) Load 641 + 643: 11(float) CompositeExtract 642 0 + 644: 11(float) GroupFAdd 28 InclusiveScan 643 + 645: 11(float) CompositeExtract 642 1 + 646: 11(float) GroupFAdd 28 InclusiveScan 645 + 647: 11(float) CompositeExtract 642 2 + 648: 11(float) GroupFAdd 28 InclusiveScan 647 + 649: 11(float) CompositeExtract 642 3 + 650: 11(float) GroupFAdd 28 InclusiveScan 649 + 651: 12(fvec4) CompositeConstruct 644 646 648 650 + 652: 54(ptr) AccessChain 23 53 + Store 652 651 + 653: 68(ptr) AccessChain 23 67 + 654: 13(int) Load 653 + 655: 13(int) GroupIAdd 28 InclusiveScan 654 + 656: 68(ptr) AccessChain 23 67 + Store 656 655 + 657: 74(ptr) AccessChain 23 73 + 658: 15(ivec2) Load 657 + 659: 14(int) CompositeExtract 658 0 + 660: 14(int) GroupIAdd 28 InclusiveScan 659 + 661: 14(int) CompositeExtract 658 1 + 662: 14(int) GroupIAdd 28 InclusiveScan 661 + 663: 15(ivec2) CompositeConstruct 660 662 + 664: 74(ptr) AccessChain 23 73 + Store 664 663 + 665: 84(ptr) AccessChain 23 83 + 666: 17(fvec3) Load 665 + 667: 16(float) CompositeExtract 666 0 + 668: 16(float) GroupFAdd 28 InclusiveScan 667 + 669: 16(float) CompositeExtract 666 1 + 670: 16(float) GroupFAdd 28 InclusiveScan 669 + 671: 16(float) CompositeExtract 666 2 + 672: 16(float) GroupFAdd 28 InclusiveScan 671 + 673: 17(fvec3) CompositeConstruct 668 670 672 + 674: 84(ptr) AccessChain 23 83 + Store 674 673 + 675: 96(ptr) AccessChain 23 95 + 676: 19(ivec4) Load 675 + 677: 18(int) CompositeExtract 676 0 + 678: 18(int) GroupIAdd 28 InclusiveScan 677 + 679: 18(int) CompositeExtract 676 1 + 680: 18(int) GroupIAdd 28 InclusiveScan 679 + 681: 18(int) CompositeExtract 676 2 + 682: 18(int) GroupIAdd 28 InclusiveScan 681 + 683: 18(int) CompositeExtract 676 3 + 684: 18(int) GroupIAdd 28 InclusiveScan 683 + 685: 19(ivec4) CompositeConstruct 678 680 682 684 + 686: 96(ptr) AccessChain 23 95 + Store 686 685 + 687: 110(ptr) AccessChain 23 109 + 688: 20(int) Load 687 + 689: 20(int) GroupIAdd 28 InclusiveScan 688 + 690: 110(ptr) AccessChain 23 109 + Store 690 689 + 691: 25(ptr) AccessChain 23 24 + 692: 6(int) Load 691 + 693: 6(int) GroupSMin 28 ExclusiveScan 692 + 694: 25(ptr) AccessChain 23 24 + Store 694 693 + 695: 32(ptr) AccessChain 23 31 + 696: 8(ivec2) Load 695 + 697: 7(int) CompositeExtract 696 0 + 698: 7(int) GroupUMin 28 ExclusiveScan 697 + 699: 7(int) CompositeExtract 696 1 + 700: 7(int) GroupUMin 28 ExclusiveScan 699 + 701: 8(ivec2) CompositeConstruct 698 700 + 702: 32(ptr) AccessChain 23 31 + Store 702 701 + 703: 42(ptr) AccessChain 23 41 + 704: 10(fvec3) Load 703 + 705: 9(float) CompositeExtract 704 0 + 706: 9(float) GroupFMin 28 ExclusiveScan 705 + 707: 9(float) CompositeExtract 704 1 + 708: 9(float) GroupFMin 28 ExclusiveScan 707 + 709: 9(float) CompositeExtract 704 2 + 710: 9(float) GroupFMin 28 ExclusiveScan 709 + 711: 10(fvec3) CompositeConstruct 706 708 710 + 712: 42(ptr) AccessChain 23 41 + Store 712 711 + 713: 54(ptr) AccessChain 23 53 + 714: 12(fvec4) Load 713 + 715: 11(float) CompositeExtract 714 0 + 716: 11(float) GroupFMin 28 ExclusiveScan 715 + 717: 11(float) CompositeExtract 714 1 + 718: 11(float) GroupFMin 28 ExclusiveScan 717 + 719: 11(float) CompositeExtract 714 2 + 720: 11(float) GroupFMin 28 ExclusiveScan 719 + 721: 11(float) CompositeExtract 714 3 + 722: 11(float) GroupFMin 28 ExclusiveScan 721 + 723: 12(fvec4) CompositeConstruct 716 718 720 722 + 724: 54(ptr) AccessChain 23 53 + Store 724 723 + 725: 68(ptr) AccessChain 23 67 + 726: 13(int) Load 725 + 727: 13(int) GroupSMin 28 ExclusiveScan 726 + 728: 68(ptr) AccessChain 23 67 + Store 728 727 + 729: 74(ptr) AccessChain 23 73 + 730: 15(ivec2) Load 729 + 731: 14(int) CompositeExtract 730 0 + 732: 14(int) GroupUMin 28 ExclusiveScan 731 + 733: 14(int) CompositeExtract 730 1 + 734: 14(int) GroupUMin 28 ExclusiveScan 733 + 735: 15(ivec2) CompositeConstruct 732 734 + 736: 74(ptr) AccessChain 23 73 + Store 736 735 + 737: 84(ptr) AccessChain 23 83 + 738: 17(fvec3) Load 737 + 739: 16(float) CompositeExtract 738 0 + 740: 16(float) GroupFMin 28 ExclusiveScan 739 + 741: 16(float) CompositeExtract 738 1 + 742: 16(float) GroupFMin 28 ExclusiveScan 741 + 743: 16(float) CompositeExtract 738 2 + 744: 16(float) GroupFMin 28 ExclusiveScan 743 + 745: 17(fvec3) CompositeConstruct 740 742 744 + 746: 84(ptr) AccessChain 23 83 + Store 746 745 + 747: 96(ptr) AccessChain 23 95 + 748: 19(ivec4) Load 747 + 749: 18(int) CompositeExtract 748 0 + 750: 18(int) GroupSMin 28 ExclusiveScan 749 + 751: 18(int) CompositeExtract 748 1 + 752: 18(int) GroupSMin 28 ExclusiveScan 751 + 753: 18(int) CompositeExtract 748 2 + 754: 18(int) GroupSMin 28 ExclusiveScan 753 + 755: 18(int) CompositeExtract 748 3 + 756: 18(int) GroupSMin 28 ExclusiveScan 755 + 757: 19(ivec4) CompositeConstruct 750 752 754 756 + 758: 96(ptr) AccessChain 23 95 + Store 758 757 + 759: 110(ptr) AccessChain 23 109 + 760: 20(int) Load 759 + 761: 20(int) GroupUMin 28 ExclusiveScan 760 + 762: 110(ptr) AccessChain 23 109 + Store 762 761 + 763: 25(ptr) AccessChain 23 24 + 764: 6(int) Load 763 + 765: 6(int) GroupSMax 28 ExclusiveScan 764 + 766: 25(ptr) AccessChain 23 24 + Store 766 765 + 767: 32(ptr) AccessChain 23 31 + 768: 8(ivec2) Load 767 + 769: 7(int) CompositeExtract 768 0 + 770: 7(int) GroupUMax 28 ExclusiveScan 769 + 771: 7(int) CompositeExtract 768 1 + 772: 7(int) GroupUMax 28 ExclusiveScan 771 + 773: 8(ivec2) CompositeConstruct 770 772 + 774: 32(ptr) AccessChain 23 31 + Store 774 773 + 775: 42(ptr) AccessChain 23 41 + 776: 10(fvec3) Load 775 + 777: 9(float) CompositeExtract 776 0 + 778: 9(float) GroupFMax 28 ExclusiveScan 777 + 779: 9(float) CompositeExtract 776 1 + 780: 9(float) GroupFMax 28 ExclusiveScan 779 + 781: 9(float) CompositeExtract 776 2 + 782: 9(float) GroupFMax 28 ExclusiveScan 781 + 783: 10(fvec3) CompositeConstruct 778 780 782 + 784: 42(ptr) AccessChain 23 41 + Store 784 783 + 785: 54(ptr) AccessChain 23 53 + 786: 12(fvec4) Load 785 + 787: 11(float) CompositeExtract 786 0 + 788: 11(float) GroupFMax 28 ExclusiveScan 787 + 789: 11(float) CompositeExtract 786 1 + 790: 11(float) GroupFMax 28 ExclusiveScan 789 + 791: 11(float) CompositeExtract 786 2 + 792: 11(float) GroupFMax 28 ExclusiveScan 791 + 793: 11(float) CompositeExtract 786 3 + 794: 11(float) GroupFMax 28 ExclusiveScan 793 + 795: 12(fvec4) CompositeConstruct 788 790 792 794 + 796: 54(ptr) AccessChain 23 53 + Store 796 795 + 797: 68(ptr) AccessChain 23 67 + 798: 13(int) Load 797 + 799: 13(int) GroupSMax 28 ExclusiveScan 798 + 800: 68(ptr) AccessChain 23 67 + Store 800 799 + 801: 74(ptr) AccessChain 23 73 + 802: 15(ivec2) Load 801 + 803: 14(int) CompositeExtract 802 0 + 804: 14(int) GroupUMax 28 ExclusiveScan 803 + 805: 14(int) CompositeExtract 802 1 + 806: 14(int) GroupUMax 28 ExclusiveScan 805 + 807: 15(ivec2) CompositeConstruct 804 806 + 808: 74(ptr) AccessChain 23 73 + Store 808 807 + 809: 84(ptr) AccessChain 23 83 + 810: 17(fvec3) Load 809 + 811: 16(float) CompositeExtract 810 0 + 812: 16(float) GroupFMax 28 ExclusiveScan 811 + 813: 16(float) CompositeExtract 810 1 + 814: 16(float) GroupFMax 28 ExclusiveScan 813 + 815: 16(float) CompositeExtract 810 2 + 816: 16(float) GroupFMax 28 ExclusiveScan 815 + 817: 17(fvec3) CompositeConstruct 812 814 816 + 818: 84(ptr) AccessChain 23 83 + Store 818 817 + 819: 96(ptr) AccessChain 23 95 + 820: 19(ivec4) Load 819 + 821: 18(int) CompositeExtract 820 0 + 822: 18(int) GroupSMax 28 ExclusiveScan 821 + 823: 18(int) CompositeExtract 820 1 + 824: 18(int) GroupSMax 28 ExclusiveScan 823 + 825: 18(int) CompositeExtract 820 2 + 826: 18(int) GroupSMax 28 ExclusiveScan 825 + 827: 18(int) CompositeExtract 820 3 + 828: 18(int) GroupSMax 28 ExclusiveScan 827 + 829: 19(ivec4) CompositeConstruct 822 824 826 828 + 830: 96(ptr) AccessChain 23 95 + Store 830 829 + 831: 110(ptr) AccessChain 23 109 + 832: 20(int) Load 831 + 833: 20(int) GroupUMax 28 ExclusiveScan 832 + 834: 110(ptr) AccessChain 23 109 + Store 834 833 + 835: 25(ptr) AccessChain 23 24 + 836: 6(int) Load 835 + 837: 6(int) GroupIAdd 28 ExclusiveScan 836 + 838: 25(ptr) AccessChain 23 24 + Store 838 837 + 839: 32(ptr) AccessChain 23 31 + 840: 8(ivec2) Load 839 + 841: 7(int) CompositeExtract 840 0 + 842: 7(int) GroupIAdd 28 ExclusiveScan 841 + 843: 7(int) CompositeExtract 840 1 + 844: 7(int) GroupIAdd 28 ExclusiveScan 843 + 845: 8(ivec2) CompositeConstruct 842 844 + 846: 32(ptr) AccessChain 23 31 + Store 846 845 + 847: 42(ptr) AccessChain 23 41 + 848: 10(fvec3) Load 847 + 849: 9(float) CompositeExtract 848 0 + 850: 9(float) GroupFAdd 28 ExclusiveScan 849 + 851: 9(float) CompositeExtract 848 1 + 852: 9(float) GroupFAdd 28 ExclusiveScan 851 + 853: 9(float) CompositeExtract 848 2 + 854: 9(float) GroupFAdd 28 ExclusiveScan 853 + 855: 10(fvec3) CompositeConstruct 850 852 854 + 856: 42(ptr) AccessChain 23 41 + Store 856 855 + 857: 54(ptr) AccessChain 23 53 + 858: 12(fvec4) Load 857 + 859: 11(float) CompositeExtract 858 0 + 860: 11(float) GroupFAdd 28 ExclusiveScan 859 + 861: 11(float) CompositeExtract 858 1 + 862: 11(float) GroupFAdd 28 ExclusiveScan 861 + 863: 11(float) CompositeExtract 858 2 + 864: 11(float) GroupFAdd 28 ExclusiveScan 863 + 865: 11(float) CompositeExtract 858 3 + 866: 11(float) GroupFAdd 28 ExclusiveScan 865 + 867: 12(fvec4) CompositeConstruct 860 862 864 866 + 868: 54(ptr) AccessChain 23 53 + Store 868 867 + 869: 68(ptr) AccessChain 23 67 + 870: 13(int) Load 869 + 871: 13(int) GroupIAdd 28 ExclusiveScan 870 + 872: 68(ptr) AccessChain 23 67 + Store 872 871 + 873: 74(ptr) AccessChain 23 73 + 874: 15(ivec2) Load 873 + 875: 14(int) CompositeExtract 874 0 + 876: 14(int) GroupIAdd 28 ExclusiveScan 875 + 877: 14(int) CompositeExtract 874 1 + 878: 14(int) GroupIAdd 28 ExclusiveScan 877 + 879: 15(ivec2) CompositeConstruct 876 878 + 880: 74(ptr) AccessChain 23 73 + Store 880 879 + 881: 84(ptr) AccessChain 23 83 + 882: 17(fvec3) Load 881 + 883: 16(float) CompositeExtract 882 0 + 884: 16(float) GroupFAdd 28 ExclusiveScan 883 + 885: 16(float) CompositeExtract 882 1 + 886: 16(float) GroupFAdd 28 ExclusiveScan 885 + 887: 16(float) CompositeExtract 882 2 + 888: 16(float) GroupFAdd 28 ExclusiveScan 887 + 889: 17(fvec3) CompositeConstruct 884 886 888 + 890: 84(ptr) AccessChain 23 83 + Store 890 889 + 891: 96(ptr) AccessChain 23 95 + 892: 19(ivec4) Load 891 + 893: 18(int) CompositeExtract 892 0 + 894: 18(int) GroupIAdd 28 ExclusiveScan 893 + 895: 18(int) CompositeExtract 892 1 + 896: 18(int) GroupIAdd 28 ExclusiveScan 895 + 897: 18(int) CompositeExtract 892 2 + 898: 18(int) GroupIAdd 28 ExclusiveScan 897 + 899: 18(int) CompositeExtract 892 3 + 900: 18(int) GroupIAdd 28 ExclusiveScan 899 + 901: 19(ivec4) CompositeConstruct 894 896 898 900 + 902: 96(ptr) AccessChain 23 95 + Store 902 901 + 903: 110(ptr) AccessChain 23 109 + 904: 20(int) Load 903 + 905: 20(int) GroupIAdd 28 ExclusiveScan 904 + 906: 110(ptr) AccessChain 23 109 + Store 906 905 + 907: 25(ptr) AccessChain 23 24 + 908: 6(int) Load 907 + 909: 6(int) GroupSMinNonUniformAMD 28 InclusiveScan 908 + 910: 25(ptr) AccessChain 23 24 + Store 910 909 + 911: 32(ptr) AccessChain 23 31 + 912: 8(ivec2) Load 911 + 913: 7(int) CompositeExtract 912 0 + 914: 7(int) GroupUMinNonUniformAMD 28 InclusiveScan 913 + 915: 7(int) CompositeExtract 912 1 + 916: 7(int) GroupUMinNonUniformAMD 28 InclusiveScan 915 + 917: 8(ivec2) CompositeConstruct 914 916 + 918: 32(ptr) AccessChain 23 31 + Store 918 917 + 919: 42(ptr) AccessChain 23 41 + 920: 10(fvec3) Load 919 + 921: 9(float) CompositeExtract 920 0 + 922: 9(float) GroupFMinNonUniformAMD 28 InclusiveScan 921 + 923: 9(float) CompositeExtract 920 1 + 924: 9(float) GroupFMinNonUniformAMD 28 InclusiveScan 923 + 925: 9(float) CompositeExtract 920 2 + 926: 9(float) GroupFMinNonUniformAMD 28 InclusiveScan 925 + 927: 10(fvec3) CompositeConstruct 922 924 926 + 928: 42(ptr) AccessChain 23 41 + Store 928 927 + 929: 54(ptr) AccessChain 23 53 + 930: 12(fvec4) Load 929 + 931: 11(float) CompositeExtract 930 0 + 932: 11(float) GroupFMinNonUniformAMD 28 InclusiveScan 931 + 933: 11(float) CompositeExtract 930 1 + 934: 11(float) GroupFMinNonUniformAMD 28 InclusiveScan 933 + 935: 11(float) CompositeExtract 930 2 + 936: 11(float) GroupFMinNonUniformAMD 28 InclusiveScan 935 + 937: 11(float) CompositeExtract 930 3 + 938: 11(float) GroupFMinNonUniformAMD 28 InclusiveScan 937 + 939: 12(fvec4) CompositeConstruct 932 934 936 938 + 940: 54(ptr) AccessChain 23 53 + Store 940 939 + 941: 68(ptr) AccessChain 23 67 + 942: 13(int) Load 941 + 943: 13(int) GroupSMinNonUniformAMD 28 InclusiveScan 942 + 944: 68(ptr) AccessChain 23 67 + Store 944 943 + 945: 74(ptr) AccessChain 23 73 + 946: 15(ivec2) Load 945 + 947: 14(int) CompositeExtract 946 0 + 948: 14(int) GroupUMinNonUniformAMD 28 InclusiveScan 947 + 949: 14(int) CompositeExtract 946 1 + 950: 14(int) GroupUMinNonUniformAMD 28 InclusiveScan 949 + 951: 15(ivec2) CompositeConstruct 948 950 + 952: 74(ptr) AccessChain 23 73 + Store 952 951 + 953: 84(ptr) AccessChain 23 83 + 954: 17(fvec3) Load 953 + 955: 16(float) CompositeExtract 954 0 + 956: 16(float) GroupFMinNonUniformAMD 28 InclusiveScan 955 + 957: 16(float) CompositeExtract 954 1 + 958: 16(float) GroupFMinNonUniformAMD 28 InclusiveScan 957 + 959: 16(float) CompositeExtract 954 2 + 960: 16(float) GroupFMinNonUniformAMD 28 InclusiveScan 959 + 961: 17(fvec3) CompositeConstruct 956 958 960 + 962: 84(ptr) AccessChain 23 83 + Store 962 961 + 963: 96(ptr) AccessChain 23 95 + 964: 19(ivec4) Load 963 + 965: 18(int) CompositeExtract 964 0 + 966: 18(int) GroupSMinNonUniformAMD 28 InclusiveScan 965 + 967: 18(int) CompositeExtract 964 1 + 968: 18(int) GroupSMinNonUniformAMD 28 InclusiveScan 967 + 969: 18(int) CompositeExtract 964 2 + 970: 18(int) GroupSMinNonUniformAMD 28 InclusiveScan 969 + 971: 18(int) CompositeExtract 964 3 + 972: 18(int) GroupSMinNonUniformAMD 28 InclusiveScan 971 + 973: 19(ivec4) CompositeConstruct 966 968 970 972 + 974: 96(ptr) AccessChain 23 95 + Store 974 973 + 975: 110(ptr) AccessChain 23 109 + 976: 20(int) Load 975 + 977: 20(int) GroupUMinNonUniformAMD 28 InclusiveScan 976 + 978: 110(ptr) AccessChain 23 109 + Store 978 977 + 979: 25(ptr) AccessChain 23 24 + 980: 6(int) Load 979 + 981: 6(int) GroupSMaxNonUniformAMD 28 InclusiveScan 980 + 982: 25(ptr) AccessChain 23 24 + Store 982 981 + 983: 32(ptr) AccessChain 23 31 + 984: 8(ivec2) Load 983 + 985: 7(int) CompositeExtract 984 0 + 986: 7(int) GroupUMaxNonUniformAMD 28 InclusiveScan 985 + 987: 7(int) CompositeExtract 984 1 + 988: 7(int) GroupUMaxNonUniformAMD 28 InclusiveScan 987 + 989: 8(ivec2) CompositeConstruct 986 988 + 990: 32(ptr) AccessChain 23 31 + Store 990 989 + 991: 42(ptr) AccessChain 23 41 + 992: 10(fvec3) Load 991 + 993: 9(float) CompositeExtract 992 0 + 994: 9(float) GroupFMaxNonUniformAMD 28 InclusiveScan 993 + 995: 9(float) CompositeExtract 992 1 + 996: 9(float) GroupFMaxNonUniformAMD 28 InclusiveScan 995 + 997: 9(float) CompositeExtract 992 2 + 998: 9(float) GroupFMaxNonUniformAMD 28 InclusiveScan 997 + 999: 10(fvec3) CompositeConstruct 994 996 998 + 1000: 42(ptr) AccessChain 23 41 + Store 1000 999 + 1001: 54(ptr) AccessChain 23 53 + 1002: 12(fvec4) Load 1001 + 1003: 11(float) CompositeExtract 1002 0 + 1004: 11(float) GroupFMaxNonUniformAMD 28 InclusiveScan 1003 + 1005: 11(float) CompositeExtract 1002 1 + 1006: 11(float) GroupFMaxNonUniformAMD 28 InclusiveScan 1005 + 1007: 11(float) CompositeExtract 1002 2 + 1008: 11(float) GroupFMaxNonUniformAMD 28 InclusiveScan 1007 + 1009: 11(float) CompositeExtract 1002 3 + 1010: 11(float) GroupFMaxNonUniformAMD 28 InclusiveScan 1009 + 1011: 12(fvec4) CompositeConstruct 1004 1006 1008 1010 + 1012: 54(ptr) AccessChain 23 53 + Store 1012 1011 + 1013: 68(ptr) AccessChain 23 67 + 1014: 13(int) Load 1013 + 1015: 13(int) GroupSMaxNonUniformAMD 28 InclusiveScan 1014 + 1016: 68(ptr) AccessChain 23 67 + Store 1016 1015 + 1017: 74(ptr) AccessChain 23 73 + 1018: 15(ivec2) Load 1017 + 1019: 14(int) CompositeExtract 1018 0 + 1020: 14(int) GroupUMaxNonUniformAMD 28 InclusiveScan 1019 + 1021: 14(int) CompositeExtract 1018 1 + 1022: 14(int) GroupUMaxNonUniformAMD 28 InclusiveScan 1021 + 1023: 15(ivec2) CompositeConstruct 1020 1022 + 1024: 74(ptr) AccessChain 23 73 + Store 1024 1023 + 1025: 84(ptr) AccessChain 23 83 + 1026: 17(fvec3) Load 1025 + 1027: 16(float) CompositeExtract 1026 0 + 1028: 16(float) GroupFMaxNonUniformAMD 28 InclusiveScan 1027 + 1029: 16(float) CompositeExtract 1026 1 + 1030: 16(float) GroupFMaxNonUniformAMD 28 InclusiveScan 1029 + 1031: 16(float) CompositeExtract 1026 2 + 1032: 16(float) GroupFMaxNonUniformAMD 28 InclusiveScan 1031 + 1033: 17(fvec3) CompositeConstruct 1028 1030 1032 + 1034: 84(ptr) AccessChain 23 83 + Store 1034 1033 + 1035: 96(ptr) AccessChain 23 95 + 1036: 19(ivec4) Load 1035 + 1037: 18(int) CompositeExtract 1036 0 + 1038: 18(int) GroupSMaxNonUniformAMD 28 InclusiveScan 1037 + 1039: 18(int) CompositeExtract 1036 1 + 1040: 18(int) GroupSMaxNonUniformAMD 28 InclusiveScan 1039 + 1041: 18(int) CompositeExtract 1036 2 + 1042: 18(int) GroupSMaxNonUniformAMD 28 InclusiveScan 1041 + 1043: 18(int) CompositeExtract 1036 3 + 1044: 18(int) GroupSMaxNonUniformAMD 28 InclusiveScan 1043 + 1045: 19(ivec4) CompositeConstruct 1038 1040 1042 1044 + 1046: 96(ptr) AccessChain 23 95 + Store 1046 1045 + 1047: 110(ptr) AccessChain 23 109 + 1048: 20(int) Load 1047 + 1049: 20(int) GroupUMaxNonUniformAMD 28 InclusiveScan 1048 + 1050: 110(ptr) AccessChain 23 109 + Store 1050 1049 + 1051: 25(ptr) AccessChain 23 24 + 1052: 6(int) Load 1051 + 1053: 6(int) GroupIAddNonUniformAMD 28 InclusiveScan 1052 + 1054: 25(ptr) AccessChain 23 24 + Store 1054 1053 + 1055: 32(ptr) AccessChain 23 31 + 1056: 8(ivec2) Load 1055 + 1057: 7(int) CompositeExtract 1056 0 + 1058: 7(int) GroupIAddNonUniformAMD 28 InclusiveScan 1057 + 1059: 7(int) CompositeExtract 1056 1 + 1060: 7(int) GroupIAddNonUniformAMD 28 InclusiveScan 1059 + 1061: 8(ivec2) CompositeConstruct 1058 1060 + 1062: 32(ptr) AccessChain 23 31 + Store 1062 1061 + 1063: 42(ptr) AccessChain 23 41 + 1064: 10(fvec3) Load 1063 + 1065: 9(float) CompositeExtract 1064 0 + 1066: 9(float) GroupFAddNonUniformAMD 28 InclusiveScan 1065 + 1067: 9(float) CompositeExtract 1064 1 + 1068: 9(float) GroupFAddNonUniformAMD 28 InclusiveScan 1067 + 1069: 9(float) CompositeExtract 1064 2 + 1070: 9(float) GroupFAddNonUniformAMD 28 InclusiveScan 1069 + 1071: 10(fvec3) CompositeConstruct 1066 1068 1070 + 1072: 42(ptr) AccessChain 23 41 + Store 1072 1071 + 1073: 54(ptr) AccessChain 23 53 + 1074: 12(fvec4) Load 1073 + 1075: 11(float) CompositeExtract 1074 0 + 1076: 11(float) GroupFAddNonUniformAMD 28 InclusiveScan 1075 + 1077: 11(float) CompositeExtract 1074 1 + 1078: 11(float) GroupFAddNonUniformAMD 28 InclusiveScan 1077 + 1079: 11(float) CompositeExtract 1074 2 + 1080: 11(float) GroupFAddNonUniformAMD 28 InclusiveScan 1079 + 1081: 11(float) CompositeExtract 1074 3 + 1082: 11(float) GroupFAddNonUniformAMD 28 InclusiveScan 1081 + 1083: 12(fvec4) CompositeConstruct 1076 1078 1080 1082 + 1084: 54(ptr) AccessChain 23 53 + Store 1084 1083 + 1085: 68(ptr) AccessChain 23 67 + 1086: 13(int) Load 1085 + 1087: 13(int) GroupIAddNonUniformAMD 28 InclusiveScan 1086 + 1088: 68(ptr) AccessChain 23 67 + Store 1088 1087 + 1089: 74(ptr) AccessChain 23 73 + 1090: 15(ivec2) Load 1089 + 1091: 14(int) CompositeExtract 1090 0 + 1092: 14(int) GroupIAddNonUniformAMD 28 InclusiveScan 1091 + 1093: 14(int) CompositeExtract 1090 1 + 1094: 14(int) GroupIAddNonUniformAMD 28 InclusiveScan 1093 + 1095: 15(ivec2) CompositeConstruct 1092 1094 + 1096: 74(ptr) AccessChain 23 73 + Store 1096 1095 + 1097: 84(ptr) AccessChain 23 83 + 1098: 17(fvec3) Load 1097 + 1099: 16(float) CompositeExtract 1098 0 + 1100: 16(float) GroupFAddNonUniformAMD 28 InclusiveScan 1099 + 1101: 16(float) CompositeExtract 1098 1 + 1102: 16(float) GroupFAddNonUniformAMD 28 InclusiveScan 1101 + 1103: 16(float) CompositeExtract 1098 2 + 1104: 16(float) GroupFAddNonUniformAMD 28 InclusiveScan 1103 + 1105: 17(fvec3) CompositeConstruct 1100 1102 1104 + 1106: 84(ptr) AccessChain 23 83 + Store 1106 1105 + 1107: 96(ptr) AccessChain 23 95 + 1108: 19(ivec4) Load 1107 + 1109: 18(int) CompositeExtract 1108 0 + 1110: 18(int) GroupIAddNonUniformAMD 28 InclusiveScan 1109 + 1111: 18(int) CompositeExtract 1108 1 + 1112: 18(int) GroupIAddNonUniformAMD 28 InclusiveScan 1111 + 1113: 18(int) CompositeExtract 1108 2 + 1114: 18(int) GroupIAddNonUniformAMD 28 InclusiveScan 1113 + 1115: 18(int) CompositeExtract 1108 3 + 1116: 18(int) GroupIAddNonUniformAMD 28 InclusiveScan 1115 + 1117: 19(ivec4) CompositeConstruct 1110 1112 1114 1116 + 1118: 96(ptr) AccessChain 23 95 + Store 1118 1117 + 1119: 110(ptr) AccessChain 23 109 + 1120: 20(int) Load 1119 + 1121: 20(int) GroupIAddNonUniformAMD 28 InclusiveScan 1120 + 1122: 110(ptr) AccessChain 23 109 + Store 1122 1121 + 1123: 25(ptr) AccessChain 23 24 + 1124: 6(int) Load 1123 + 1125: 6(int) GroupSMinNonUniformAMD 28 ExclusiveScan 1124 + 1126: 25(ptr) AccessChain 23 24 + Store 1126 1125 + 1127: 32(ptr) AccessChain 23 31 + 1128: 8(ivec2) Load 1127 + 1129: 7(int) CompositeExtract 1128 0 + 1130: 7(int) GroupUMinNonUniformAMD 28 ExclusiveScan 1129 + 1131: 7(int) CompositeExtract 1128 1 + 1132: 7(int) GroupUMinNonUniformAMD 28 ExclusiveScan 1131 + 1133: 8(ivec2) CompositeConstruct 1130 1132 + 1134: 32(ptr) AccessChain 23 31 + Store 1134 1133 + 1135: 42(ptr) AccessChain 23 41 + 1136: 10(fvec3) Load 1135 + 1137: 9(float) CompositeExtract 1136 0 + 1138: 9(float) GroupFMinNonUniformAMD 28 ExclusiveScan 1137 + 1139: 9(float) CompositeExtract 1136 1 + 1140: 9(float) GroupFMinNonUniformAMD 28 ExclusiveScan 1139 + 1141: 9(float) CompositeExtract 1136 2 + 1142: 9(float) GroupFMinNonUniformAMD 28 ExclusiveScan 1141 + 1143: 10(fvec3) CompositeConstruct 1138 1140 1142 + 1144: 42(ptr) AccessChain 23 41 + Store 1144 1143 + 1145: 54(ptr) AccessChain 23 53 + 1146: 12(fvec4) Load 1145 + 1147: 11(float) CompositeExtract 1146 0 + 1148: 11(float) GroupFMinNonUniformAMD 28 ExclusiveScan 1147 + 1149: 11(float) CompositeExtract 1146 1 + 1150: 11(float) GroupFMinNonUniformAMD 28 ExclusiveScan 1149 + 1151: 11(float) CompositeExtract 1146 2 + 1152: 11(float) GroupFMinNonUniformAMD 28 ExclusiveScan 1151 + 1153: 11(float) CompositeExtract 1146 3 + 1154: 11(float) GroupFMinNonUniformAMD 28 ExclusiveScan 1153 + 1155: 12(fvec4) CompositeConstruct 1148 1150 1152 1154 + 1156: 54(ptr) AccessChain 23 53 + Store 1156 1155 + 1157: 68(ptr) AccessChain 23 67 + 1158: 13(int) Load 1157 + 1159: 13(int) GroupSMinNonUniformAMD 28 ExclusiveScan 1158 + 1160: 68(ptr) AccessChain 23 67 + Store 1160 1159 + 1161: 74(ptr) AccessChain 23 73 + 1162: 15(ivec2) Load 1161 + 1163: 14(int) CompositeExtract 1162 0 + 1164: 14(int) GroupUMinNonUniformAMD 28 ExclusiveScan 1163 + 1165: 14(int) CompositeExtract 1162 1 + 1166: 14(int) GroupUMinNonUniformAMD 28 ExclusiveScan 1165 + 1167: 15(ivec2) CompositeConstruct 1164 1166 + 1168: 74(ptr) AccessChain 23 73 + Store 1168 1167 + 1169: 84(ptr) AccessChain 23 83 + 1170: 17(fvec3) Load 1169 + 1171: 16(float) CompositeExtract 1170 0 + 1172: 16(float) GroupFMinNonUniformAMD 28 ExclusiveScan 1171 + 1173: 16(float) CompositeExtract 1170 1 + 1174: 16(float) GroupFMinNonUniformAMD 28 ExclusiveScan 1173 + 1175: 16(float) CompositeExtract 1170 2 + 1176: 16(float) GroupFMinNonUniformAMD 28 ExclusiveScan 1175 + 1177: 17(fvec3) CompositeConstruct 1172 1174 1176 + 1178: 84(ptr) AccessChain 23 83 + Store 1178 1177 + 1179: 96(ptr) AccessChain 23 95 + 1180: 19(ivec4) Load 1179 + 1181: 18(int) CompositeExtract 1180 0 + 1182: 18(int) GroupSMinNonUniformAMD 28 ExclusiveScan 1181 + 1183: 18(int) CompositeExtract 1180 1 + 1184: 18(int) GroupSMinNonUniformAMD 28 ExclusiveScan 1183 + 1185: 18(int) CompositeExtract 1180 2 + 1186: 18(int) GroupSMinNonUniformAMD 28 ExclusiveScan 1185 + 1187: 18(int) CompositeExtract 1180 3 + 1188: 18(int) GroupSMinNonUniformAMD 28 ExclusiveScan 1187 + 1189: 19(ivec4) CompositeConstruct 1182 1184 1186 1188 + 1190: 96(ptr) AccessChain 23 95 + Store 1190 1189 + 1191: 110(ptr) AccessChain 23 109 + 1192: 20(int) Load 1191 + 1193: 20(int) GroupUMinNonUniformAMD 28 ExclusiveScan 1192 + 1194: 110(ptr) AccessChain 23 109 + Store 1194 1193 + 1195: 25(ptr) AccessChain 23 24 + 1196: 6(int) Load 1195 + 1197: 6(int) GroupSMaxNonUniformAMD 28 ExclusiveScan 1196 + 1198: 25(ptr) AccessChain 23 24 + Store 1198 1197 + 1199: 32(ptr) AccessChain 23 31 + 1200: 8(ivec2) Load 1199 + 1201: 7(int) CompositeExtract 1200 0 + 1202: 7(int) GroupUMaxNonUniformAMD 28 ExclusiveScan 1201 + 1203: 7(int) CompositeExtract 1200 1 + 1204: 7(int) GroupUMaxNonUniformAMD 28 ExclusiveScan 1203 + 1205: 8(ivec2) CompositeConstruct 1202 1204 + 1206: 32(ptr) AccessChain 23 31 + Store 1206 1205 + 1207: 42(ptr) AccessChain 23 41 + 1208: 10(fvec3) Load 1207 + 1209: 9(float) CompositeExtract 1208 0 + 1210: 9(float) GroupFMaxNonUniformAMD 28 ExclusiveScan 1209 + 1211: 9(float) CompositeExtract 1208 1 + 1212: 9(float) GroupFMaxNonUniformAMD 28 ExclusiveScan 1211 + 1213: 9(float) CompositeExtract 1208 2 + 1214: 9(float) GroupFMaxNonUniformAMD 28 ExclusiveScan 1213 + 1215: 10(fvec3) CompositeConstruct 1210 1212 1214 + 1216: 42(ptr) AccessChain 23 41 + Store 1216 1215 + 1217: 54(ptr) AccessChain 23 53 + 1218: 12(fvec4) Load 1217 + 1219: 11(float) CompositeExtract 1218 0 + 1220: 11(float) GroupFMaxNonUniformAMD 28 ExclusiveScan 1219 + 1221: 11(float) CompositeExtract 1218 1 + 1222: 11(float) GroupFMaxNonUniformAMD 28 ExclusiveScan 1221 + 1223: 11(float) CompositeExtract 1218 2 + 1224: 11(float) GroupFMaxNonUniformAMD 28 ExclusiveScan 1223 + 1225: 11(float) CompositeExtract 1218 3 + 1226: 11(float) GroupFMaxNonUniformAMD 28 ExclusiveScan 1225 + 1227: 12(fvec4) CompositeConstruct 1220 1222 1224 1226 + 1228: 54(ptr) AccessChain 23 53 + Store 1228 1227 + 1229: 68(ptr) AccessChain 23 67 + 1230: 13(int) Load 1229 + 1231: 13(int) GroupSMaxNonUniformAMD 28 ExclusiveScan 1230 + 1232: 68(ptr) AccessChain 23 67 + Store 1232 1231 + 1233: 74(ptr) AccessChain 23 73 + 1234: 15(ivec2) Load 1233 + 1235: 14(int) CompositeExtract 1234 0 + 1236: 14(int) GroupUMaxNonUniformAMD 28 ExclusiveScan 1235 + 1237: 14(int) CompositeExtract 1234 1 + 1238: 14(int) GroupUMaxNonUniformAMD 28 ExclusiveScan 1237 + 1239: 15(ivec2) CompositeConstruct 1236 1238 + 1240: 74(ptr) AccessChain 23 73 + Store 1240 1239 + 1241: 84(ptr) AccessChain 23 83 + 1242: 17(fvec3) Load 1241 + 1243: 16(float) CompositeExtract 1242 0 + 1244: 16(float) GroupFMaxNonUniformAMD 28 ExclusiveScan 1243 + 1245: 16(float) CompositeExtract 1242 1 + 1246: 16(float) GroupFMaxNonUniformAMD 28 ExclusiveScan 1245 + 1247: 16(float) CompositeExtract 1242 2 + 1248: 16(float) GroupFMaxNonUniformAMD 28 ExclusiveScan 1247 + 1249: 17(fvec3) CompositeConstruct 1244 1246 1248 + 1250: 84(ptr) AccessChain 23 83 + Store 1250 1249 + 1251: 96(ptr) AccessChain 23 95 + 1252: 19(ivec4) Load 1251 + 1253: 18(int) CompositeExtract 1252 0 + 1254: 18(int) GroupSMaxNonUniformAMD 28 ExclusiveScan 1253 + 1255: 18(int) CompositeExtract 1252 1 + 1256: 18(int) GroupSMaxNonUniformAMD 28 ExclusiveScan 1255 + 1257: 18(int) CompositeExtract 1252 2 + 1258: 18(int) GroupSMaxNonUniformAMD 28 ExclusiveScan 1257 + 1259: 18(int) CompositeExtract 1252 3 + 1260: 18(int) GroupSMaxNonUniformAMD 28 ExclusiveScan 1259 + 1261: 19(ivec4) CompositeConstruct 1254 1256 1258 1260 + 1262: 96(ptr) AccessChain 23 95 + Store 1262 1261 + 1263: 110(ptr) AccessChain 23 109 + 1264: 20(int) Load 1263 + 1265: 20(int) GroupUMaxNonUniformAMD 28 ExclusiveScan 1264 + 1266: 110(ptr) AccessChain 23 109 + Store 1266 1265 + 1267: 25(ptr) AccessChain 23 24 + 1268: 6(int) Load 1267 + 1269: 6(int) GroupIAddNonUniformAMD 28 ExclusiveScan 1268 + 1270: 25(ptr) AccessChain 23 24 + Store 1270 1269 + 1271: 32(ptr) AccessChain 23 31 + 1272: 8(ivec2) Load 1271 + 1273: 7(int) CompositeExtract 1272 0 + 1274: 7(int) GroupIAddNonUniformAMD 28 ExclusiveScan 1273 + 1275: 7(int) CompositeExtract 1272 1 + 1276: 7(int) GroupIAddNonUniformAMD 28 ExclusiveScan 1275 + 1277: 8(ivec2) CompositeConstruct 1274 1276 + 1278: 32(ptr) AccessChain 23 31 + Store 1278 1277 + 1279: 42(ptr) AccessChain 23 41 + 1280: 10(fvec3) Load 1279 + 1281: 9(float) CompositeExtract 1280 0 + 1282: 9(float) GroupFAddNonUniformAMD 28 ExclusiveScan 1281 + 1283: 9(float) CompositeExtract 1280 1 + 1284: 9(float) GroupFAddNonUniformAMD 28 ExclusiveScan 1283 + 1285: 9(float) CompositeExtract 1280 2 + 1286: 9(float) GroupFAddNonUniformAMD 28 ExclusiveScan 1285 + 1287: 10(fvec3) CompositeConstruct 1282 1284 1286 + 1288: 42(ptr) AccessChain 23 41 + Store 1288 1287 + 1289: 54(ptr) AccessChain 23 53 + 1290: 12(fvec4) Load 1289 + 1291: 11(float) CompositeExtract 1290 0 + 1292: 11(float) GroupFAddNonUniformAMD 28 ExclusiveScan 1291 + 1293: 11(float) CompositeExtract 1290 1 + 1294: 11(float) GroupFAddNonUniformAMD 28 ExclusiveScan 1293 + 1295: 11(float) CompositeExtract 1290 2 + 1296: 11(float) GroupFAddNonUniformAMD 28 ExclusiveScan 1295 + 1297: 11(float) CompositeExtract 1290 3 + 1298: 11(float) GroupFAddNonUniformAMD 28 ExclusiveScan 1297 + 1299: 12(fvec4) CompositeConstruct 1292 1294 1296 1298 + 1300: 54(ptr) AccessChain 23 53 + Store 1300 1299 + 1301: 68(ptr) AccessChain 23 67 + 1302: 13(int) Load 1301 + 1303: 13(int) GroupIAddNonUniformAMD 28 ExclusiveScan 1302 + 1304: 68(ptr) AccessChain 23 67 + Store 1304 1303 + 1305: 74(ptr) AccessChain 23 73 + 1306: 15(ivec2) Load 1305 + 1307: 14(int) CompositeExtract 1306 0 + 1308: 14(int) GroupIAddNonUniformAMD 28 ExclusiveScan 1307 + 1309: 14(int) CompositeExtract 1306 1 + 1310: 14(int) GroupIAddNonUniformAMD 28 ExclusiveScan 1309 + 1311: 15(ivec2) CompositeConstruct 1308 1310 + 1312: 74(ptr) AccessChain 23 73 + Store 1312 1311 + 1313: 84(ptr) AccessChain 23 83 + 1314: 17(fvec3) Load 1313 + 1315: 16(float) CompositeExtract 1314 0 + 1316: 16(float) GroupFAddNonUniformAMD 28 ExclusiveScan 1315 + 1317: 16(float) CompositeExtract 1314 1 + 1318: 16(float) GroupFAddNonUniformAMD 28 ExclusiveScan 1317 + 1319: 16(float) CompositeExtract 1314 2 + 1320: 16(float) GroupFAddNonUniformAMD 28 ExclusiveScan 1319 + 1321: 17(fvec3) CompositeConstruct 1316 1318 1320 + 1322: 84(ptr) AccessChain 23 83 + Store 1322 1321 + 1323: 96(ptr) AccessChain 23 95 + 1324: 19(ivec4) Load 1323 + 1325: 18(int) CompositeExtract 1324 0 + 1326: 18(int) GroupIAddNonUniformAMD 28 ExclusiveScan 1325 + 1327: 18(int) CompositeExtract 1324 1 + 1328: 18(int) GroupIAddNonUniformAMD 28 ExclusiveScan 1327 + 1329: 18(int) CompositeExtract 1324 2 + 1330: 18(int) GroupIAddNonUniformAMD 28 ExclusiveScan 1329 + 1331: 18(int) CompositeExtract 1324 3 + 1332: 18(int) GroupIAddNonUniformAMD 28 ExclusiveScan 1331 + 1333: 19(ivec4) CompositeConstruct 1326 1328 1330 1332 + 1334: 96(ptr) AccessChain 23 95 + Store 1334 1333 + 1335: 110(ptr) AccessChain 23 109 + 1336: 20(int) Load 1335 + 1337: 20(int) GroupIAddNonUniformAMD 28 ExclusiveScan 1336 + 1338: 110(ptr) AccessChain 23 109 + Store 1338 1337 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.shaderBallot.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.shaderBallot.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.shaderBallot.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.shaderBallot.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.shaderBallot.comp // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 298 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.shaderDrawParams.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.shaderDrawParams.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.shaderDrawParams.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.shaderDrawParams.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.shaderDrawParams.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 53 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.shaderFragMaskAMD.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.shaderFragMaskAMD.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.shaderFragMaskAMD.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.shaderFragMaskAMD.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.shaderFragMaskAMD.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 80 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.shaderGroupVote.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.shaderGroupVote.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.shaderGroupVote.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.shaderGroupVote.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.shaderGroupVote.comp // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 33 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.shaderStencilExport.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.shaderStencilExport.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.shaderStencilExport.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.shaderStencilExport.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.shaderStencilExport.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 10 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.shiftOps.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.shiftOps.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.shiftOps.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.shiftOps.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.shiftOps.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 38 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.shortCircuit.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.shortCircuit.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.shortCircuit.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.shortCircuit.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.shortCircuit.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 147 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.simpleFunctionCall.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.simpleFunctionCall.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.simpleFunctionCall.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.simpleFunctionCall.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.simpleFunctionCall.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 19 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.simpleMat.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.simpleMat.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.simpleMat.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.simpleMat.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -2,7 +2,7 @@ WARNING: 0:3: varying deprecated in version 130; may be removed in future release // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 39 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.sparseTextureClamp.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.sparseTextureClamp.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.sparseTextureClamp.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.sparseTextureClamp.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.sparseTextureClamp.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 360 Capability Shader @@ -145,14 +145,14 @@ 310: 157(ivec2) ConstantComposite 143 143 344: TypePointer Output 11(fvec4) 345(outColor): 344(ptr) Variable Output - 348: TypeBool + 347: TypeBool 4(main): 2 Function None 3 5: Label 8(resident): 7(ptr) Variable Function 13(texel): 12(ptr) Variable Function 18(itexel): 17(ptr) Variable Function 23(utexel): 22(ptr) Variable Function - 346: 12(ptr) Variable Function + 349: 12(ptr) Variable Function Store 8(resident) 9 Store 13(texel) 15 Store 18(itexel) 19 @@ -442,13 +442,13 @@ 342: 16(ivec4) Load 18(itexel) 343: 16(ivec4) IAdd 342 341 Store 18(itexel) 343 - 347: 6(int) Load 8(resident) - 349: 348(bool) ImageSparseTexelsResident 347 + 346: 6(int) Load 8(resident) + 348: 347(bool) ImageSparseTexelsResident 346 SelectionMerge 351 None - BranchConditional 349 350 353 + BranchConditional 348 350 353 350: Label 352: 11(fvec4) Load 13(texel) - Store 346 352 + Store 349 352 Branch 351 353: Label 354: 16(ivec4) Load 18(itexel) @@ -456,10 +456,10 @@ 356: 21(ivec4) Load 23(utexel) 357: 11(fvec4) ConvertUToF 356 358: 11(fvec4) FAdd 355 357 - Store 346 358 + Store 349 358 Branch 351 351: Label - 359: 11(fvec4) Load 346 + 359: 11(fvec4) Load 349 Store 345(outColor) 359 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.sparseTexture.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.sparseTexture.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.sparseTexture.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.sparseTexture.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.sparseTexture.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 438 Capability Shader @@ -182,14 +182,14 @@ 414(i2DMS): 413(ptr) Variable UniformConstant 422: TypePointer Output 11(fvec4) 423(outColor): 422(ptr) Variable Output - 426: TypeBool + 425: TypeBool 4(main): 2 Function None 3 5: Label 8(resident): 7(ptr) Variable Function 13(texel): 12(ptr) Variable Function 18(itexel): 17(ptr) Variable Function 23(utexel): 22(ptr) Variable Function - 424: 12(ptr) Variable Function + 427: 12(ptr) Variable Function Store 8(resident) 9 Store 13(texel) 15 Store 18(itexel) 19 @@ -565,13 +565,13 @@ 420: 6(int) Load 8(resident) 421: 6(int) BitwiseOr 420 419 Store 8(resident) 421 - 425: 6(int) Load 8(resident) - 427: 426(bool) ImageSparseTexelsResident 425 + 424: 6(int) Load 8(resident) + 426: 425(bool) ImageSparseTexelsResident 424 SelectionMerge 429 None - BranchConditional 427 428 431 + BranchConditional 426 428 431 428: Label 430: 11(fvec4) Load 13(texel) - Store 424 430 + Store 427 430 Branch 429 431: Label 432: 16(ivec4) Load 18(itexel) @@ -579,10 +579,10 @@ 434: 21(ivec4) Load 23(utexel) 435: 11(fvec4) ConvertUToF 434 436: 11(fvec4) FAdd 433 435 - Store 424 436 + Store 427 436 Branch 429 429: Label - 437: 11(fvec4) Load 424 + 437: 11(fvec4) Load 427 Store 423(outColor) 437 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.specConstantComposite.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.specConstantComposite.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.specConstantComposite.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.specConstantComposite.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.specConstantComposite.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 43 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.specConstant.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.specConstant.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.specConstant.comp.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.specConstant.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.specConstant.comp // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 27 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.specConstantOperations.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.specConstantOperations.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.specConstantOperations.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.specConstantOperations.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.specConstantOperations.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 162 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.specConstant.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.specConstant.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.specConstant.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.specConstant.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.specConstant.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 81 Capability Shader @@ -11,7 +11,7 @@ Source GLSL 400 Name 4 "main" Name 9 "arraySize" - Name 14 "foo(vf4[s1522];" + Name 14 "foo(vf4[s2468];" Name 13 "p" Name 17 "builtin_spec_constant(" Name 20 "color" @@ -102,10 +102,10 @@ Store 20(color) 46 48: 10 Load 22(ucol) Store 47(param) 48 - 49: 2 FunctionCall 14(foo(vf4[s1522];) 47(param) + 49: 2 FunctionCall 14(foo(vf4[s2468];) 47(param) Return FunctionEnd -14(foo(vf4[s1522];): 2 Function None 12 +14(foo(vf4[s2468];): 2 Function None 12 13(p): 11(ptr) FunctionParameter 15: Label 54: 24(ptr) AccessChain 53(dupUcol) 23 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.specConst.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.specConst.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.specConst.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.specConst.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.specConst.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 27 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.ssboAlias.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.ssboAlias.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.ssboAlias.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.ssboAlias.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,12 +1,12 @@ spv.ssboAlias.frag // Module Version 10000 -// Generated by (magic number): 80002 -// Id's are bound by 46 +// Generated by (magic number): 80006 +// Id's are bound by 44 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 43 + EntryPoint Fragment 4 "main" 41 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" @@ -17,10 +17,10 @@ Name 18 "Buf1@count" MemberName 18(Buf1@count) 0 "@count" Name 20 "Buf1@count" - Name 30 "Buf2" - Name 31 "Buf2@count" - Name 43 "@entryPointOutput" - Name 45 "Buf3" + Name 28 "Buf2" + Name 29 "Buf2@count" + Name 41 "@entryPointOutput" + Name 43 "Buf3" Decorate 12 ArrayStride 4 MemberDecorate 13(Buf1) 0 Offset 0 Decorate 13(Buf1) BufferBlock @@ -30,13 +30,13 @@ Decorate 18(Buf1@count) BufferBlock Decorate 20(Buf1@count) DescriptorSet 0 Decorate 20(Buf1@count) Binding 83 - Decorate 30(Buf2) DescriptorSet 0 - Decorate 30(Buf2) Binding 85 - Decorate 31(Buf2@count) DescriptorSet 0 - Decorate 31(Buf2@count) Binding 86 - Decorate 43(@entryPointOutput) Location 0 - Decorate 45(Buf3) DescriptorSet 0 - Decorate 45(Buf3) Binding 84 + Decorate 28(Buf2) DescriptorSet 0 + Decorate 28(Buf2) Binding 85 + Decorate 29(Buf2@count) DescriptorSet 0 + Decorate 29(Buf2@count) Binding 86 + Decorate 41(@entryPointOutput) Location 0 + Decorate 43(Buf3) DescriptorSet 0 + Decorate 43(Buf3) Binding 84 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -49,40 +49,38 @@ 15(Buf1): 14(ptr) Variable Uniform 16: TypeInt 32 1 17: 16(int) Constant 0 - 18(Buf1@count): TypeStruct 16(int) + 18(Buf1@count): TypeStruct 11(int) 19: TypePointer Uniform 18(Buf1@count) 20(Buf1@count): 19(ptr) Variable Uniform - 21: TypePointer Uniform 16(int) - 23: 16(int) Constant 1 - 24: 11(int) Constant 1 - 25: 11(int) Constant 0 - 27: 11(int) Constant 10 - 28: TypePointer Uniform 11(int) - 30(Buf2): 14(ptr) Variable Uniform - 31(Buf2@count): 19(ptr) Variable Uniform - 34: 11(int) Constant 20 - 36: 6(float) Constant 1065353216 - 37: 6(float) Constant 1077936128 - 38: 6(float) Constant 1084227584 - 39: 7(fvec4) ConstantComposite 36 37 38 36 - 42: TypePointer Output 7(fvec4) -43(@entryPointOutput): 42(ptr) Variable Output - 45(Buf3): 14(ptr) Variable Uniform + 21: TypePointer Uniform 11(int) + 23: 11(int) Constant 1 + 24: 11(int) Constant 0 + 26: 11(int) Constant 10 + 28(Buf2): 14(ptr) Variable Uniform + 29(Buf2@count): 19(ptr) Variable Uniform + 32: 11(int) Constant 20 + 34: 6(float) Constant 1065353216 + 35: 6(float) Constant 1077936128 + 36: 6(float) Constant 1084227584 + 37: 7(fvec4) ConstantComposite 34 35 36 34 + 40: TypePointer Output 7(fvec4) +41(@entryPointOutput): 40(ptr) Variable Output + 43(Buf3): 14(ptr) Variable Uniform 4(main): 2 Function None 3 5: Label - 44: 7(fvec4) FunctionCall 9(@main() - Store 43(@entryPointOutput) 44 + 42: 7(fvec4) FunctionCall 9(@main() + Store 41(@entryPointOutput) 42 Return FunctionEnd 9(@main(): 7(fvec4) Function None 8 10: Label 22: 21(ptr) AccessChain 20(Buf1@count) 17 - 26: 11(int) AtomicIAdd 22 24 25 23 - 29: 28(ptr) AccessChain 15(Buf1) 17 26 - Store 29 27 - 32: 21(ptr) AccessChain 31(Buf2@count) 17 - 33: 11(int) AtomicIAdd 32 24 25 23 - 35: 28(ptr) AccessChain 30(Buf2) 17 33 - Store 35 34 - ReturnValue 39 + 25: 11(int) AtomicIAdd 22 23 24 23 + 27: 21(ptr) AccessChain 15(Buf1) 17 25 + Store 27 26 + 30: 21(ptr) AccessChain 29(Buf2@count) 17 + 31: 11(int) AtomicIAdd 30 23 24 23 + 33: 21(ptr) AccessChain 28(Buf2) 17 31 + Store 33 32 + ReturnValue 37 FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.ssbo.autoassign.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.ssbo.autoassign.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.ssbo.autoassign.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.ssbo.autoassign.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.ssbo.autoassign.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 99 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.stereoViewRendering.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.stereoViewRendering.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.stereoViewRendering.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.stereoViewRendering.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.stereoViewRendering.tesc // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 38 Capability Geometry diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.stereoViewRendering.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.stereoViewRendering.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.stereoViewRendering.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.stereoViewRendering.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.stereoViewRendering.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 27 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.storageBuffer.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.storageBuffer.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.storageBuffer.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.storageBuffer.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.storageBuffer.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 31 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.structAssignment.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.structAssignment.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.structAssignment.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.structAssignment.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -3,7 +3,7 @@ "precision mediump int; precision highp float;" // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 50 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.structDeref.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.structDeref.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.structDeref.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.structDeref.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.structDeref.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 123 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.structure.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.structure.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.structure.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.structure.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.structure.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 60 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupArithmetic.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupArithmetic.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupArithmetic.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupArithmetic.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,2428 @@ +spv.subgroupArithmetic.comp +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 2085 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformArithmetic + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 10 12 + ExecutionMode 4 LocalSize 8 1 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_arithmetic" + SourceExtension "GL_KHR_shader_subgroup_basic" + Name 4 "main" + Name 8 "invocation" + Name 10 "gl_SubgroupInvocationID" + Name 12 "gl_SubgroupSize" + Name 24 "Buffers" + MemberName 24(Buffers) 0 "f4" + MemberName 24(Buffers) 1 "i4" + MemberName 24(Buffers) 2 "u4" + MemberName 24(Buffers) 3 "d4" + Name 27 "data" + Decorate 10(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 10(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 11 RelaxedPrecision + Decorate 12(gl_SubgroupSize) RelaxedPrecision + Decorate 12(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 13 RelaxedPrecision + Decorate 14 RelaxedPrecision + Decorate 16 RelaxedPrecision + MemberDecorate 24(Buffers) 0 Offset 0 + MemberDecorate 24(Buffers) 1 Offset 16 + MemberDecorate 24(Buffers) 2 Offset 32 + MemberDecorate 24(Buffers) 3 Offset 64 + Decorate 24(Buffers) BufferBlock + Decorate 27(data) DescriptorSet 0 + Decorate 27(data) Binding 0 + Decorate 2084 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_SubgroupInvocationID): 9(ptr) Variable Input +12(gl_SubgroupSize): 9(ptr) Variable Input + 15: 6(int) Constant 4 + 17: TypeFloat 32 + 18: TypeVector 17(float) 4 + 19: TypeInt 32 1 + 20: TypeVector 19(int) 4 + 21: TypeVector 6(int) 4 + 22: TypeFloat 64 + 23: TypeVector 22(float) 4 + 24(Buffers): TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(fvec4) + 25: TypeArray 24(Buffers) 15 + 26: TypePointer Uniform 25 + 27(data): 26(ptr) Variable Uniform + 29: 19(int) Constant 0 + 30: 6(int) Constant 0 + 31: TypePointer Uniform 17(float) + 34: 6(int) Constant 3 + 38: 19(int) Constant 1 + 39: TypeVector 17(float) 2 + 40: TypePointer Uniform 18(fvec4) + 49: 19(int) Constant 2 + 50: TypeVector 17(float) 3 + 59: 19(int) Constant 3 + 65: TypePointer Uniform 19(int) + 71: TypeVector 19(int) 2 + 72: TypePointer Uniform 20(ivec4) + 81: TypeVector 19(int) 3 + 95: TypePointer Uniform 6(int) + 101: TypeVector 6(int) 2 + 102: TypePointer Uniform 21(ivec4) + 111: TypeVector 6(int) 3 + 125: TypePointer Uniform 22(float) + 131: TypeVector 22(float) 2 + 132: TypePointer Uniform 23(fvec4) + 141: TypeVector 22(float) 3 + 521: TypeBool + 530: 71(ivec2) ConstantComposite 29 29 + 531: TypeVector 521(bool) 2 + 534: 71(ivec2) ConstantComposite 38 38 + 543: 81(ivec3) ConstantComposite 29 29 29 + 544: TypeVector 521(bool) 3 + 547: 81(ivec3) ConstantComposite 38 38 38 + 555: 20(ivec4) ConstantComposite 29 29 29 29 + 556: TypeVector 521(bool) 4 + 559: 20(ivec4) ConstantComposite 38 38 38 38 + 2082: 6(int) Constant 8 + 2083: 6(int) Constant 1 + 2084: 111(ivec3) ConstantComposite 2082 2083 2083 + 4(main): 2 Function None 3 + 5: Label + 8(invocation): 7(ptr) Variable Function + 11: 6(int) Load 10(gl_SubgroupInvocationID) + 13: 6(int) Load 12(gl_SubgroupSize) + 14: 6(int) IAdd 11 13 + 16: 6(int) UMod 14 15 + Store 8(invocation) 16 + 28: 6(int) Load 8(invocation) + 32: 31(ptr) AccessChain 27(data) 29 29 30 + 33: 17(float) Load 32 + 35: 17(float) GroupNonUniformFAdd 34 Reduce 33 + 36: 31(ptr) AccessChain 27(data) 28 29 30 + Store 36 35 + 37: 6(int) Load 8(invocation) + 41: 40(ptr) AccessChain 27(data) 38 29 + 42: 18(fvec4) Load 41 + 43: 39(fvec2) VectorShuffle 42 42 0 1 + 44: 39(fvec2) GroupNonUniformFAdd 34 Reduce 43 + 45: 40(ptr) AccessChain 27(data) 37 29 + 46: 18(fvec4) Load 45 + 47: 18(fvec4) VectorShuffle 46 44 4 5 2 3 + Store 45 47 + 48: 6(int) Load 8(invocation) + 51: 40(ptr) AccessChain 27(data) 49 29 + 52: 18(fvec4) Load 51 + 53: 50(fvec3) VectorShuffle 52 52 0 1 2 + 54: 50(fvec3) GroupNonUniformFAdd 34 Reduce 53 + 55: 40(ptr) AccessChain 27(data) 48 29 + 56: 18(fvec4) Load 55 + 57: 18(fvec4) VectorShuffle 56 54 4 5 6 3 + Store 55 57 + 58: 6(int) Load 8(invocation) + 60: 40(ptr) AccessChain 27(data) 59 29 + 61: 18(fvec4) Load 60 + 62: 18(fvec4) GroupNonUniformFAdd 34 Reduce 61 + 63: 40(ptr) AccessChain 27(data) 58 29 + Store 63 62 + 64: 6(int) Load 8(invocation) + 66: 65(ptr) AccessChain 27(data) 29 38 30 + 67: 19(int) Load 66 + 68: 19(int) GroupNonUniformIAdd 34 Reduce 67 + 69: 65(ptr) AccessChain 27(data) 64 38 30 + Store 69 68 + 70: 6(int) Load 8(invocation) + 73: 72(ptr) AccessChain 27(data) 38 38 + 74: 20(ivec4) Load 73 + 75: 71(ivec2) VectorShuffle 74 74 0 1 + 76: 71(ivec2) GroupNonUniformIAdd 34 Reduce 75 + 77: 72(ptr) AccessChain 27(data) 70 38 + 78: 20(ivec4) Load 77 + 79: 20(ivec4) VectorShuffle 78 76 4 5 2 3 + Store 77 79 + 80: 6(int) Load 8(invocation) + 82: 72(ptr) AccessChain 27(data) 49 38 + 83: 20(ivec4) Load 82 + 84: 81(ivec3) VectorShuffle 83 83 0 1 2 + 85: 81(ivec3) GroupNonUniformIAdd 34 Reduce 84 + 86: 72(ptr) AccessChain 27(data) 80 38 + 87: 20(ivec4) Load 86 + 88: 20(ivec4) VectorShuffle 87 85 4 5 6 3 + Store 86 88 + 89: 6(int) Load 8(invocation) + 90: 72(ptr) AccessChain 27(data) 59 38 + 91: 20(ivec4) Load 90 + 92: 20(ivec4) GroupNonUniformIAdd 34 Reduce 91 + 93: 72(ptr) AccessChain 27(data) 89 38 + Store 93 92 + 94: 6(int) Load 8(invocation) + 96: 95(ptr) AccessChain 27(data) 29 49 30 + 97: 6(int) Load 96 + 98: 6(int) GroupNonUniformIAdd 34 Reduce 97 + 99: 95(ptr) AccessChain 27(data) 94 49 30 + Store 99 98 + 100: 6(int) Load 8(invocation) + 103: 102(ptr) AccessChain 27(data) 38 49 + 104: 21(ivec4) Load 103 + 105: 101(ivec2) VectorShuffle 104 104 0 1 + 106: 101(ivec2) GroupNonUniformIAdd 34 Reduce 105 + 107: 102(ptr) AccessChain 27(data) 100 49 + 108: 21(ivec4) Load 107 + 109: 21(ivec4) VectorShuffle 108 106 4 5 2 3 + Store 107 109 + 110: 6(int) Load 8(invocation) + 112: 102(ptr) AccessChain 27(data) 49 49 + 113: 21(ivec4) Load 112 + 114: 111(ivec3) VectorShuffle 113 113 0 1 2 + 115: 111(ivec3) GroupNonUniformIAdd 34 Reduce 114 + 116: 102(ptr) AccessChain 27(data) 110 49 + 117: 21(ivec4) Load 116 + 118: 21(ivec4) VectorShuffle 117 115 4 5 6 3 + Store 116 118 + 119: 6(int) Load 8(invocation) + 120: 102(ptr) AccessChain 27(data) 59 49 + 121: 21(ivec4) Load 120 + 122: 21(ivec4) GroupNonUniformIAdd 34 Reduce 121 + 123: 102(ptr) AccessChain 27(data) 119 49 + Store 123 122 + 124: 6(int) Load 8(invocation) + 126: 125(ptr) AccessChain 27(data) 29 59 30 + 127: 22(float) Load 126 + 128: 22(float) GroupNonUniformFAdd 34 Reduce 127 + 129: 125(ptr) AccessChain 27(data) 124 59 30 + Store 129 128 + 130: 6(int) Load 8(invocation) + 133: 132(ptr) AccessChain 27(data) 38 59 + 134: 23(fvec4) Load 133 + 135: 131(fvec2) VectorShuffle 134 134 0 1 + 136: 131(fvec2) GroupNonUniformFAdd 34 Reduce 135 + 137: 132(ptr) AccessChain 27(data) 130 59 + 138: 23(fvec4) Load 137 + 139: 23(fvec4) VectorShuffle 138 136 4 5 2 3 + Store 137 139 + 140: 6(int) Load 8(invocation) + 142: 132(ptr) AccessChain 27(data) 49 59 + 143: 23(fvec4) Load 142 + 144: 141(fvec3) VectorShuffle 143 143 0 1 2 + 145: 141(fvec3) GroupNonUniformFAdd 34 Reduce 144 + 146: 132(ptr) AccessChain 27(data) 140 59 + 147: 23(fvec4) Load 146 + 148: 23(fvec4) VectorShuffle 147 145 4 5 6 3 + Store 146 148 + 149: 6(int) Load 8(invocation) + 150: 132(ptr) AccessChain 27(data) 59 59 + 151: 23(fvec4) Load 150 + 152: 23(fvec4) GroupNonUniformFAdd 34 Reduce 151 + 153: 132(ptr) AccessChain 27(data) 149 59 + Store 153 152 + 154: 6(int) Load 8(invocation) + 155: 31(ptr) AccessChain 27(data) 29 29 30 + 156: 17(float) Load 155 + 157: 17(float) GroupNonUniformFMul 34 Reduce 156 + 158: 31(ptr) AccessChain 27(data) 154 29 30 + Store 158 157 + 159: 6(int) Load 8(invocation) + 160: 40(ptr) AccessChain 27(data) 38 29 + 161: 18(fvec4) Load 160 + 162: 39(fvec2) VectorShuffle 161 161 0 1 + 163: 39(fvec2) GroupNonUniformFMul 34 Reduce 162 + 164: 40(ptr) AccessChain 27(data) 159 29 + 165: 18(fvec4) Load 164 + 166: 18(fvec4) VectorShuffle 165 163 4 5 2 3 + Store 164 166 + 167: 6(int) Load 8(invocation) + 168: 40(ptr) AccessChain 27(data) 49 29 + 169: 18(fvec4) Load 168 + 170: 50(fvec3) VectorShuffle 169 169 0 1 2 + 171: 50(fvec3) GroupNonUniformFMul 34 Reduce 170 + 172: 40(ptr) AccessChain 27(data) 167 29 + 173: 18(fvec4) Load 172 + 174: 18(fvec4) VectorShuffle 173 171 4 5 6 3 + Store 172 174 + 175: 6(int) Load 8(invocation) + 176: 40(ptr) AccessChain 27(data) 59 29 + 177: 18(fvec4) Load 176 + 178: 18(fvec4) GroupNonUniformFMul 34 Reduce 177 + 179: 40(ptr) AccessChain 27(data) 175 29 + Store 179 178 + 180: 6(int) Load 8(invocation) + 181: 65(ptr) AccessChain 27(data) 29 38 30 + 182: 19(int) Load 181 + 183: 19(int) GroupNonUniformIMul 34 Reduce 182 + 184: 65(ptr) AccessChain 27(data) 180 38 30 + Store 184 183 + 185: 6(int) Load 8(invocation) + 186: 72(ptr) AccessChain 27(data) 38 38 + 187: 20(ivec4) Load 186 + 188: 71(ivec2) VectorShuffle 187 187 0 1 + 189: 71(ivec2) GroupNonUniformIMul 34 Reduce 188 + 190: 72(ptr) AccessChain 27(data) 185 38 + 191: 20(ivec4) Load 190 + 192: 20(ivec4) VectorShuffle 191 189 4 5 2 3 + Store 190 192 + 193: 6(int) Load 8(invocation) + 194: 72(ptr) AccessChain 27(data) 49 38 + 195: 20(ivec4) Load 194 + 196: 81(ivec3) VectorShuffle 195 195 0 1 2 + 197: 81(ivec3) GroupNonUniformIMul 34 Reduce 196 + 198: 72(ptr) AccessChain 27(data) 193 38 + 199: 20(ivec4) Load 198 + 200: 20(ivec4) VectorShuffle 199 197 4 5 6 3 + Store 198 200 + 201: 6(int) Load 8(invocation) + 202: 72(ptr) AccessChain 27(data) 59 38 + 203: 20(ivec4) Load 202 + 204: 20(ivec4) GroupNonUniformIMul 34 Reduce 203 + 205: 72(ptr) AccessChain 27(data) 201 38 + Store 205 204 + 206: 6(int) Load 8(invocation) + 207: 95(ptr) AccessChain 27(data) 29 49 30 + 208: 6(int) Load 207 + 209: 6(int) GroupNonUniformIMul 34 Reduce 208 + 210: 95(ptr) AccessChain 27(data) 206 49 30 + Store 210 209 + 211: 6(int) Load 8(invocation) + 212: 102(ptr) AccessChain 27(data) 38 49 + 213: 21(ivec4) Load 212 + 214: 101(ivec2) VectorShuffle 213 213 0 1 + 215: 101(ivec2) GroupNonUniformIMul 34 Reduce 214 + 216: 102(ptr) AccessChain 27(data) 211 49 + 217: 21(ivec4) Load 216 + 218: 21(ivec4) VectorShuffle 217 215 4 5 2 3 + Store 216 218 + 219: 6(int) Load 8(invocation) + 220: 102(ptr) AccessChain 27(data) 49 49 + 221: 21(ivec4) Load 220 + 222: 111(ivec3) VectorShuffle 221 221 0 1 2 + 223: 111(ivec3) GroupNonUniformIMul 34 Reduce 222 + 224: 102(ptr) AccessChain 27(data) 219 49 + 225: 21(ivec4) Load 224 + 226: 21(ivec4) VectorShuffle 225 223 4 5 6 3 + Store 224 226 + 227: 6(int) Load 8(invocation) + 228: 102(ptr) AccessChain 27(data) 59 49 + 229: 21(ivec4) Load 228 + 230: 21(ivec4) GroupNonUniformIMul 34 Reduce 229 + 231: 102(ptr) AccessChain 27(data) 227 49 + Store 231 230 + 232: 6(int) Load 8(invocation) + 233: 125(ptr) AccessChain 27(data) 29 59 30 + 234: 22(float) Load 233 + 235: 22(float) GroupNonUniformFMul 34 Reduce 234 + 236: 125(ptr) AccessChain 27(data) 232 59 30 + Store 236 235 + 237: 6(int) Load 8(invocation) + 238: 132(ptr) AccessChain 27(data) 38 59 + 239: 23(fvec4) Load 238 + 240: 131(fvec2) VectorShuffle 239 239 0 1 + 241: 131(fvec2) GroupNonUniformFMul 34 Reduce 240 + 242: 132(ptr) AccessChain 27(data) 237 59 + 243: 23(fvec4) Load 242 + 244: 23(fvec4) VectorShuffle 243 241 4 5 2 3 + Store 242 244 + 245: 6(int) Load 8(invocation) + 246: 132(ptr) AccessChain 27(data) 49 59 + 247: 23(fvec4) Load 246 + 248: 141(fvec3) VectorShuffle 247 247 0 1 2 + 249: 141(fvec3) GroupNonUniformFMul 34 Reduce 248 + 250: 132(ptr) AccessChain 27(data) 245 59 + 251: 23(fvec4) Load 250 + 252: 23(fvec4) VectorShuffle 251 249 4 5 6 3 + Store 250 252 + 253: 6(int) Load 8(invocation) + 254: 132(ptr) AccessChain 27(data) 59 59 + 255: 23(fvec4) Load 254 + 256: 23(fvec4) GroupNonUniformFMul 34 Reduce 255 + 257: 132(ptr) AccessChain 27(data) 253 59 + Store 257 256 + 258: 6(int) Load 8(invocation) + 259: 31(ptr) AccessChain 27(data) 29 29 30 + 260: 17(float) Load 259 + 261: 17(float) GroupNonUniformFMin 34 Reduce 260 + 262: 31(ptr) AccessChain 27(data) 258 29 30 + Store 262 261 + 263: 6(int) Load 8(invocation) + 264: 40(ptr) AccessChain 27(data) 38 29 + 265: 18(fvec4) Load 264 + 266: 39(fvec2) VectorShuffle 265 265 0 1 + 267: 39(fvec2) GroupNonUniformFMin 34 Reduce 266 + 268: 40(ptr) AccessChain 27(data) 263 29 + 269: 18(fvec4) Load 268 + 270: 18(fvec4) VectorShuffle 269 267 4 5 2 3 + Store 268 270 + 271: 6(int) Load 8(invocation) + 272: 40(ptr) AccessChain 27(data) 49 29 + 273: 18(fvec4) Load 272 + 274: 50(fvec3) VectorShuffle 273 273 0 1 2 + 275: 50(fvec3) GroupNonUniformFMin 34 Reduce 274 + 276: 40(ptr) AccessChain 27(data) 271 29 + 277: 18(fvec4) Load 276 + 278: 18(fvec4) VectorShuffle 277 275 4 5 6 3 + Store 276 278 + 279: 6(int) Load 8(invocation) + 280: 40(ptr) AccessChain 27(data) 59 29 + 281: 18(fvec4) Load 280 + 282: 18(fvec4) GroupNonUniformFMin 34 Reduce 281 + 283: 40(ptr) AccessChain 27(data) 279 29 + Store 283 282 + 284: 6(int) Load 8(invocation) + 285: 65(ptr) AccessChain 27(data) 29 38 30 + 286: 19(int) Load 285 + 287: 19(int) GroupNonUniformSMin 34 Reduce 286 + 288: 65(ptr) AccessChain 27(data) 284 38 30 + Store 288 287 + 289: 6(int) Load 8(invocation) + 290: 72(ptr) AccessChain 27(data) 38 38 + 291: 20(ivec4) Load 290 + 292: 71(ivec2) VectorShuffle 291 291 0 1 + 293: 71(ivec2) GroupNonUniformSMin 34 Reduce 292 + 294: 72(ptr) AccessChain 27(data) 289 38 + 295: 20(ivec4) Load 294 + 296: 20(ivec4) VectorShuffle 295 293 4 5 2 3 + Store 294 296 + 297: 6(int) Load 8(invocation) + 298: 72(ptr) AccessChain 27(data) 49 38 + 299: 20(ivec4) Load 298 + 300: 81(ivec3) VectorShuffle 299 299 0 1 2 + 301: 81(ivec3) GroupNonUniformSMin 34 Reduce 300 + 302: 72(ptr) AccessChain 27(data) 297 38 + 303: 20(ivec4) Load 302 + 304: 20(ivec4) VectorShuffle 303 301 4 5 6 3 + Store 302 304 + 305: 6(int) Load 8(invocation) + 306: 72(ptr) AccessChain 27(data) 59 38 + 307: 20(ivec4) Load 306 + 308: 20(ivec4) GroupNonUniformSMin 34 Reduce 307 + 309: 72(ptr) AccessChain 27(data) 305 38 + Store 309 308 + 310: 6(int) Load 8(invocation) + 311: 95(ptr) AccessChain 27(data) 29 49 30 + 312: 6(int) Load 311 + 313: 6(int) GroupNonUniformUMin 34 Reduce 312 + 314: 95(ptr) AccessChain 27(data) 310 49 30 + Store 314 313 + 315: 6(int) Load 8(invocation) + 316: 102(ptr) AccessChain 27(data) 38 49 + 317: 21(ivec4) Load 316 + 318: 101(ivec2) VectorShuffle 317 317 0 1 + 319: 101(ivec2) GroupNonUniformUMin 34 Reduce 318 + 320: 102(ptr) AccessChain 27(data) 315 49 + 321: 21(ivec4) Load 320 + 322: 21(ivec4) VectorShuffle 321 319 4 5 2 3 + Store 320 322 + 323: 6(int) Load 8(invocation) + 324: 102(ptr) AccessChain 27(data) 49 49 + 325: 21(ivec4) Load 324 + 326: 111(ivec3) VectorShuffle 325 325 0 1 2 + 327: 111(ivec3) GroupNonUniformUMin 34 Reduce 326 + 328: 102(ptr) AccessChain 27(data) 323 49 + 329: 21(ivec4) Load 328 + 330: 21(ivec4) VectorShuffle 329 327 4 5 6 3 + Store 328 330 + 331: 6(int) Load 8(invocation) + 332: 102(ptr) AccessChain 27(data) 59 49 + 333: 21(ivec4) Load 332 + 334: 21(ivec4) GroupNonUniformUMin 34 Reduce 333 + 335: 102(ptr) AccessChain 27(data) 331 49 + Store 335 334 + 336: 6(int) Load 8(invocation) + 337: 125(ptr) AccessChain 27(data) 29 59 30 + 338: 22(float) Load 337 + 339: 22(float) GroupNonUniformFMin 34 Reduce 338 + 340: 125(ptr) AccessChain 27(data) 336 59 30 + Store 340 339 + 341: 6(int) Load 8(invocation) + 342: 132(ptr) AccessChain 27(data) 38 59 + 343: 23(fvec4) Load 342 + 344: 131(fvec2) VectorShuffle 343 343 0 1 + 345: 131(fvec2) GroupNonUniformFMin 34 Reduce 344 + 346: 132(ptr) AccessChain 27(data) 341 59 + 347: 23(fvec4) Load 346 + 348: 23(fvec4) VectorShuffle 347 345 4 5 2 3 + Store 346 348 + 349: 6(int) Load 8(invocation) + 350: 132(ptr) AccessChain 27(data) 49 59 + 351: 23(fvec4) Load 350 + 352: 141(fvec3) VectorShuffle 351 351 0 1 2 + 353: 141(fvec3) GroupNonUniformFMin 34 Reduce 352 + 354: 132(ptr) AccessChain 27(data) 349 59 + 355: 23(fvec4) Load 354 + 356: 23(fvec4) VectorShuffle 355 353 4 5 6 3 + Store 354 356 + 357: 6(int) Load 8(invocation) + 358: 132(ptr) AccessChain 27(data) 59 59 + 359: 23(fvec4) Load 358 + 360: 23(fvec4) GroupNonUniformFMin 34 Reduce 359 + 361: 132(ptr) AccessChain 27(data) 357 59 + Store 361 360 + 362: 6(int) Load 8(invocation) + 363: 31(ptr) AccessChain 27(data) 29 29 30 + 364: 17(float) Load 363 + 365: 17(float) GroupNonUniformFMax 34 Reduce 364 + 366: 31(ptr) AccessChain 27(data) 362 29 30 + Store 366 365 + 367: 6(int) Load 8(invocation) + 368: 40(ptr) AccessChain 27(data) 38 29 + 369: 18(fvec4) Load 368 + 370: 39(fvec2) VectorShuffle 369 369 0 1 + 371: 39(fvec2) GroupNonUniformFMax 34 Reduce 370 + 372: 40(ptr) AccessChain 27(data) 367 29 + 373: 18(fvec4) Load 372 + 374: 18(fvec4) VectorShuffle 373 371 4 5 2 3 + Store 372 374 + 375: 6(int) Load 8(invocation) + 376: 40(ptr) AccessChain 27(data) 49 29 + 377: 18(fvec4) Load 376 + 378: 50(fvec3) VectorShuffle 377 377 0 1 2 + 379: 50(fvec3) GroupNonUniformFMax 34 Reduce 378 + 380: 40(ptr) AccessChain 27(data) 375 29 + 381: 18(fvec4) Load 380 + 382: 18(fvec4) VectorShuffle 381 379 4 5 6 3 + Store 380 382 + 383: 6(int) Load 8(invocation) + 384: 40(ptr) AccessChain 27(data) 59 29 + 385: 18(fvec4) Load 384 + 386: 18(fvec4) GroupNonUniformFMax 34 Reduce 385 + 387: 40(ptr) AccessChain 27(data) 383 29 + Store 387 386 + 388: 6(int) Load 8(invocation) + 389: 65(ptr) AccessChain 27(data) 29 38 30 + 390: 19(int) Load 389 + 391: 19(int) GroupNonUniformSMax 34 Reduce 390 + 392: 65(ptr) AccessChain 27(data) 388 38 30 + Store 392 391 + 393: 6(int) Load 8(invocation) + 394: 72(ptr) AccessChain 27(data) 38 38 + 395: 20(ivec4) Load 394 + 396: 71(ivec2) VectorShuffle 395 395 0 1 + 397: 71(ivec2) GroupNonUniformSMax 34 Reduce 396 + 398: 72(ptr) AccessChain 27(data) 393 38 + 399: 20(ivec4) Load 398 + 400: 20(ivec4) VectorShuffle 399 397 4 5 2 3 + Store 398 400 + 401: 6(int) Load 8(invocation) + 402: 72(ptr) AccessChain 27(data) 49 38 + 403: 20(ivec4) Load 402 + 404: 81(ivec3) VectorShuffle 403 403 0 1 2 + 405: 81(ivec3) GroupNonUniformSMax 34 Reduce 404 + 406: 72(ptr) AccessChain 27(data) 401 38 + 407: 20(ivec4) Load 406 + 408: 20(ivec4) VectorShuffle 407 405 4 5 6 3 + Store 406 408 + 409: 6(int) Load 8(invocation) + 410: 72(ptr) AccessChain 27(data) 59 38 + 411: 20(ivec4) Load 410 + 412: 20(ivec4) GroupNonUniformSMax 34 Reduce 411 + 413: 72(ptr) AccessChain 27(data) 409 38 + Store 413 412 + 414: 6(int) Load 8(invocation) + 415: 95(ptr) AccessChain 27(data) 29 49 30 + 416: 6(int) Load 415 + 417: 6(int) GroupNonUniformUMax 34 Reduce 416 + 418: 95(ptr) AccessChain 27(data) 414 49 30 + Store 418 417 + 419: 6(int) Load 8(invocation) + 420: 102(ptr) AccessChain 27(data) 38 49 + 421: 21(ivec4) Load 420 + 422: 101(ivec2) VectorShuffle 421 421 0 1 + 423: 101(ivec2) GroupNonUniformUMax 34 Reduce 422 + 424: 102(ptr) AccessChain 27(data) 419 49 + 425: 21(ivec4) Load 424 + 426: 21(ivec4) VectorShuffle 425 423 4 5 2 3 + Store 424 426 + 427: 6(int) Load 8(invocation) + 428: 102(ptr) AccessChain 27(data) 49 49 + 429: 21(ivec4) Load 428 + 430: 111(ivec3) VectorShuffle 429 429 0 1 2 + 431: 111(ivec3) GroupNonUniformUMax 34 Reduce 430 + 432: 102(ptr) AccessChain 27(data) 427 49 + 433: 21(ivec4) Load 432 + 434: 21(ivec4) VectorShuffle 433 431 4 5 6 3 + Store 432 434 + 435: 6(int) Load 8(invocation) + 436: 102(ptr) AccessChain 27(data) 59 49 + 437: 21(ivec4) Load 436 + 438: 21(ivec4) GroupNonUniformUMax 34 Reduce 437 + 439: 102(ptr) AccessChain 27(data) 435 49 + Store 439 438 + 440: 6(int) Load 8(invocation) + 441: 125(ptr) AccessChain 27(data) 29 59 30 + 442: 22(float) Load 441 + 443: 22(float) GroupNonUniformFMax 34 Reduce 442 + 444: 125(ptr) AccessChain 27(data) 440 59 30 + Store 444 443 + 445: 6(int) Load 8(invocation) + 446: 132(ptr) AccessChain 27(data) 38 59 + 447: 23(fvec4) Load 446 + 448: 131(fvec2) VectorShuffle 447 447 0 1 + 449: 131(fvec2) GroupNonUniformFMax 34 Reduce 448 + 450: 132(ptr) AccessChain 27(data) 445 59 + 451: 23(fvec4) Load 450 + 452: 23(fvec4) VectorShuffle 451 449 4 5 2 3 + Store 450 452 + 453: 6(int) Load 8(invocation) + 454: 132(ptr) AccessChain 27(data) 49 59 + 455: 23(fvec4) Load 454 + 456: 141(fvec3) VectorShuffle 455 455 0 1 2 + 457: 141(fvec3) GroupNonUniformFMax 34 Reduce 456 + 458: 132(ptr) AccessChain 27(data) 453 59 + 459: 23(fvec4) Load 458 + 460: 23(fvec4) VectorShuffle 459 457 4 5 6 3 + Store 458 460 + 461: 6(int) Load 8(invocation) + 462: 132(ptr) AccessChain 27(data) 59 59 + 463: 23(fvec4) Load 462 + 464: 23(fvec4) GroupNonUniformFMax 34 Reduce 463 + 465: 132(ptr) AccessChain 27(data) 461 59 + Store 465 464 + 466: 6(int) Load 8(invocation) + 467: 65(ptr) AccessChain 27(data) 29 38 30 + 468: 19(int) Load 467 + 469: 19(int) GroupNonUniformBitwiseAnd 34 Reduce 468 + 470: 65(ptr) AccessChain 27(data) 466 38 30 + Store 470 469 + 471: 6(int) Load 8(invocation) + 472: 72(ptr) AccessChain 27(data) 38 38 + 473: 20(ivec4) Load 472 + 474: 71(ivec2) VectorShuffle 473 473 0 1 + 475: 71(ivec2) GroupNonUniformBitwiseAnd 34 Reduce 474 + 476: 72(ptr) AccessChain 27(data) 471 38 + 477: 20(ivec4) Load 476 + 478: 20(ivec4) VectorShuffle 477 475 4 5 2 3 + Store 476 478 + 479: 6(int) Load 8(invocation) + 480: 72(ptr) AccessChain 27(data) 49 38 + 481: 20(ivec4) Load 480 + 482: 81(ivec3) VectorShuffle 481 481 0 1 2 + 483: 81(ivec3) GroupNonUniformBitwiseAnd 34 Reduce 482 + 484: 72(ptr) AccessChain 27(data) 479 38 + 485: 20(ivec4) Load 484 + 486: 20(ivec4) VectorShuffle 485 483 4 5 6 3 + Store 484 486 + 487: 6(int) Load 8(invocation) + 488: 72(ptr) AccessChain 27(data) 59 38 + 489: 20(ivec4) Load 488 + 490: 20(ivec4) GroupNonUniformBitwiseAnd 34 Reduce 489 + 491: 72(ptr) AccessChain 27(data) 487 38 + Store 491 490 + 492: 6(int) Load 8(invocation) + 493: 95(ptr) AccessChain 27(data) 29 49 30 + 494: 6(int) Load 493 + 495: 6(int) GroupNonUniformBitwiseAnd 34 Reduce 494 + 496: 95(ptr) AccessChain 27(data) 492 49 30 + Store 496 495 + 497: 6(int) Load 8(invocation) + 498: 102(ptr) AccessChain 27(data) 38 49 + 499: 21(ivec4) Load 498 + 500: 101(ivec2) VectorShuffle 499 499 0 1 + 501: 101(ivec2) GroupNonUniformBitwiseAnd 34 Reduce 500 + 502: 102(ptr) AccessChain 27(data) 497 49 + 503: 21(ivec4) Load 502 + 504: 21(ivec4) VectorShuffle 503 501 4 5 2 3 + Store 502 504 + 505: 6(int) Load 8(invocation) + 506: 102(ptr) AccessChain 27(data) 49 49 + 507: 21(ivec4) Load 506 + 508: 111(ivec3) VectorShuffle 507 507 0 1 2 + 509: 111(ivec3) GroupNonUniformBitwiseAnd 34 Reduce 508 + 510: 102(ptr) AccessChain 27(data) 505 49 + 511: 21(ivec4) Load 510 + 512: 21(ivec4) VectorShuffle 511 509 4 5 6 3 + Store 510 512 + 513: 6(int) Load 8(invocation) + 514: 102(ptr) AccessChain 27(data) 59 49 + 515: 21(ivec4) Load 514 + 516: 21(ivec4) GroupNonUniformBitwiseAnd 34 Reduce 515 + 517: 102(ptr) AccessChain 27(data) 513 49 + Store 517 516 + 518: 6(int) Load 8(invocation) + 519: 65(ptr) AccessChain 27(data) 29 38 30 + 520: 19(int) Load 519 + 522: 521(bool) SLessThan 520 29 + 523: 521(bool) GroupNonUniformLogicalAnd 34 Reduce 522 + 524: 19(int) Select 523 38 29 + 525: 65(ptr) AccessChain 27(data) 518 38 30 + Store 525 524 + 526: 6(int) Load 8(invocation) + 527: 72(ptr) AccessChain 27(data) 38 38 + 528: 20(ivec4) Load 527 + 529: 71(ivec2) VectorShuffle 528 528 0 1 + 532: 531(bvec2) SLessThan 529 530 + 533: 531(bvec2) GroupNonUniformLogicalAnd 34 Reduce 532 + 535: 71(ivec2) Select 533 534 530 + 536: 72(ptr) AccessChain 27(data) 526 38 + 537: 20(ivec4) Load 536 + 538: 20(ivec4) VectorShuffle 537 535 4 5 2 3 + Store 536 538 + 539: 6(int) Load 8(invocation) + 540: 72(ptr) AccessChain 27(data) 38 38 + 541: 20(ivec4) Load 540 + 542: 81(ivec3) VectorShuffle 541 541 0 1 2 + 545: 544(bvec3) SLessThan 542 543 + 546: 544(bvec3) GroupNonUniformLogicalAnd 34 Reduce 545 + 548: 81(ivec3) Select 546 547 543 + 549: 72(ptr) AccessChain 27(data) 539 38 + 550: 20(ivec4) Load 549 + 551: 20(ivec4) VectorShuffle 550 548 4 5 6 3 + Store 549 551 + 552: 6(int) Load 8(invocation) + 553: 72(ptr) AccessChain 27(data) 38 38 + 554: 20(ivec4) Load 553 + 557: 556(bvec4) SLessThan 554 555 + 558: 556(bvec4) GroupNonUniformLogicalAnd 34 Reduce 557 + 560: 20(ivec4) Select 558 559 555 + 561: 72(ptr) AccessChain 27(data) 552 38 + Store 561 560 + 562: 6(int) Load 8(invocation) + 563: 65(ptr) AccessChain 27(data) 29 38 30 + 564: 19(int) Load 563 + 565: 19(int) GroupNonUniformBitwiseOr 34 Reduce 564 + 566: 65(ptr) AccessChain 27(data) 562 38 30 + Store 566 565 + 567: 6(int) Load 8(invocation) + 568: 72(ptr) AccessChain 27(data) 38 38 + 569: 20(ivec4) Load 568 + 570: 71(ivec2) VectorShuffle 569 569 0 1 + 571: 71(ivec2) GroupNonUniformBitwiseOr 34 Reduce 570 + 572: 72(ptr) AccessChain 27(data) 567 38 + 573: 20(ivec4) Load 572 + 574: 20(ivec4) VectorShuffle 573 571 4 5 2 3 + Store 572 574 + 575: 6(int) Load 8(invocation) + 576: 72(ptr) AccessChain 27(data) 49 38 + 577: 20(ivec4) Load 576 + 578: 81(ivec3) VectorShuffle 577 577 0 1 2 + 579: 81(ivec3) GroupNonUniformBitwiseOr 34 Reduce 578 + 580: 72(ptr) AccessChain 27(data) 575 38 + 581: 20(ivec4) Load 580 + 582: 20(ivec4) VectorShuffle 581 579 4 5 6 3 + Store 580 582 + 583: 6(int) Load 8(invocation) + 584: 72(ptr) AccessChain 27(data) 59 38 + 585: 20(ivec4) Load 584 + 586: 20(ivec4) GroupNonUniformBitwiseOr 34 Reduce 585 + 587: 72(ptr) AccessChain 27(data) 583 38 + Store 587 586 + 588: 6(int) Load 8(invocation) + 589: 95(ptr) AccessChain 27(data) 29 49 30 + 590: 6(int) Load 589 + 591: 6(int) GroupNonUniformBitwiseOr 34 Reduce 590 + 592: 95(ptr) AccessChain 27(data) 588 49 30 + Store 592 591 + 593: 6(int) Load 8(invocation) + 594: 102(ptr) AccessChain 27(data) 38 49 + 595: 21(ivec4) Load 594 + 596: 101(ivec2) VectorShuffle 595 595 0 1 + 597: 101(ivec2) GroupNonUniformBitwiseOr 34 Reduce 596 + 598: 102(ptr) AccessChain 27(data) 593 49 + 599: 21(ivec4) Load 598 + 600: 21(ivec4) VectorShuffle 599 597 4 5 2 3 + Store 598 600 + 601: 6(int) Load 8(invocation) + 602: 102(ptr) AccessChain 27(data) 49 49 + 603: 21(ivec4) Load 602 + 604: 111(ivec3) VectorShuffle 603 603 0 1 2 + 605: 111(ivec3) GroupNonUniformBitwiseOr 34 Reduce 604 + 606: 102(ptr) AccessChain 27(data) 601 49 + 607: 21(ivec4) Load 606 + 608: 21(ivec4) VectorShuffle 607 605 4 5 6 3 + Store 606 608 + 609: 6(int) Load 8(invocation) + 610: 102(ptr) AccessChain 27(data) 59 49 + 611: 21(ivec4) Load 610 + 612: 21(ivec4) GroupNonUniformBitwiseOr 34 Reduce 611 + 613: 102(ptr) AccessChain 27(data) 609 49 + Store 613 612 + 614: 6(int) Load 8(invocation) + 615: 65(ptr) AccessChain 27(data) 29 38 30 + 616: 19(int) Load 615 + 617: 521(bool) SLessThan 616 29 + 618: 521(bool) GroupNonUniformLogicalOr 34 Reduce 617 + 619: 19(int) Select 618 38 29 + 620: 65(ptr) AccessChain 27(data) 614 38 30 + Store 620 619 + 621: 6(int) Load 8(invocation) + 622: 72(ptr) AccessChain 27(data) 38 38 + 623: 20(ivec4) Load 622 + 624: 71(ivec2) VectorShuffle 623 623 0 1 + 625: 531(bvec2) SLessThan 624 530 + 626: 531(bvec2) GroupNonUniformLogicalOr 34 Reduce 625 + 627: 71(ivec2) Select 626 534 530 + 628: 72(ptr) AccessChain 27(data) 621 38 + 629: 20(ivec4) Load 628 + 630: 20(ivec4) VectorShuffle 629 627 4 5 2 3 + Store 628 630 + 631: 6(int) Load 8(invocation) + 632: 72(ptr) AccessChain 27(data) 38 38 + 633: 20(ivec4) Load 632 + 634: 81(ivec3) VectorShuffle 633 633 0 1 2 + 635: 544(bvec3) SLessThan 634 543 + 636: 544(bvec3) GroupNonUniformLogicalOr 34 Reduce 635 + 637: 81(ivec3) Select 636 547 543 + 638: 72(ptr) AccessChain 27(data) 631 38 + 639: 20(ivec4) Load 638 + 640: 20(ivec4) VectorShuffle 639 637 4 5 6 3 + Store 638 640 + 641: 6(int) Load 8(invocation) + 642: 72(ptr) AccessChain 27(data) 38 38 + 643: 20(ivec4) Load 642 + 644: 556(bvec4) SLessThan 643 555 + 645: 556(bvec4) GroupNonUniformLogicalOr 34 Reduce 644 + 646: 20(ivec4) Select 645 559 555 + 647: 72(ptr) AccessChain 27(data) 641 38 + Store 647 646 + 648: 6(int) Load 8(invocation) + 649: 65(ptr) AccessChain 27(data) 29 38 30 + 650: 19(int) Load 649 + 651: 19(int) GroupNonUniformBitwiseXor 34 Reduce 650 + 652: 65(ptr) AccessChain 27(data) 648 38 30 + Store 652 651 + 653: 6(int) Load 8(invocation) + 654: 72(ptr) AccessChain 27(data) 38 38 + 655: 20(ivec4) Load 654 + 656: 71(ivec2) VectorShuffle 655 655 0 1 + 657: 71(ivec2) GroupNonUniformBitwiseXor 34 Reduce 656 + 658: 72(ptr) AccessChain 27(data) 653 38 + 659: 20(ivec4) Load 658 + 660: 20(ivec4) VectorShuffle 659 657 4 5 2 3 + Store 658 660 + 661: 6(int) Load 8(invocation) + 662: 72(ptr) AccessChain 27(data) 49 38 + 663: 20(ivec4) Load 662 + 664: 81(ivec3) VectorShuffle 663 663 0 1 2 + 665: 81(ivec3) GroupNonUniformBitwiseXor 34 Reduce 664 + 666: 72(ptr) AccessChain 27(data) 661 38 + 667: 20(ivec4) Load 666 + 668: 20(ivec4) VectorShuffle 667 665 4 5 6 3 + Store 666 668 + 669: 6(int) Load 8(invocation) + 670: 72(ptr) AccessChain 27(data) 59 38 + 671: 20(ivec4) Load 670 + 672: 20(ivec4) GroupNonUniformBitwiseXor 34 Reduce 671 + 673: 72(ptr) AccessChain 27(data) 669 38 + Store 673 672 + 674: 6(int) Load 8(invocation) + 675: 95(ptr) AccessChain 27(data) 29 49 30 + 676: 6(int) Load 675 + 677: 6(int) GroupNonUniformBitwiseXor 34 Reduce 676 + 678: 95(ptr) AccessChain 27(data) 674 49 30 + Store 678 677 + 679: 6(int) Load 8(invocation) + 680: 102(ptr) AccessChain 27(data) 38 49 + 681: 21(ivec4) Load 680 + 682: 101(ivec2) VectorShuffle 681 681 0 1 + 683: 101(ivec2) GroupNonUniformBitwiseXor 34 Reduce 682 + 684: 102(ptr) AccessChain 27(data) 679 49 + 685: 21(ivec4) Load 684 + 686: 21(ivec4) VectorShuffle 685 683 4 5 2 3 + Store 684 686 + 687: 6(int) Load 8(invocation) + 688: 102(ptr) AccessChain 27(data) 49 49 + 689: 21(ivec4) Load 688 + 690: 111(ivec3) VectorShuffle 689 689 0 1 2 + 691: 111(ivec3) GroupNonUniformBitwiseXor 34 Reduce 690 + 692: 102(ptr) AccessChain 27(data) 687 49 + 693: 21(ivec4) Load 692 + 694: 21(ivec4) VectorShuffle 693 691 4 5 6 3 + Store 692 694 + 695: 6(int) Load 8(invocation) + 696: 102(ptr) AccessChain 27(data) 59 49 + 697: 21(ivec4) Load 696 + 698: 21(ivec4) GroupNonUniformBitwiseXor 34 Reduce 697 + 699: 102(ptr) AccessChain 27(data) 695 49 + Store 699 698 + 700: 6(int) Load 8(invocation) + 701: 65(ptr) AccessChain 27(data) 29 38 30 + 702: 19(int) Load 701 + 703: 521(bool) SLessThan 702 29 + 704: 521(bool) GroupNonUniformLogicalXor 34 Reduce 703 + 705: 19(int) Select 704 38 29 + 706: 65(ptr) AccessChain 27(data) 700 38 30 + Store 706 705 + 707: 6(int) Load 8(invocation) + 708: 72(ptr) AccessChain 27(data) 38 38 + 709: 20(ivec4) Load 708 + 710: 71(ivec2) VectorShuffle 709 709 0 1 + 711: 531(bvec2) SLessThan 710 530 + 712: 531(bvec2) GroupNonUniformLogicalXor 34 Reduce 711 + 713: 71(ivec2) Select 712 534 530 + 714: 72(ptr) AccessChain 27(data) 707 38 + 715: 20(ivec4) Load 714 + 716: 20(ivec4) VectorShuffle 715 713 4 5 2 3 + Store 714 716 + 717: 6(int) Load 8(invocation) + 718: 72(ptr) AccessChain 27(data) 38 38 + 719: 20(ivec4) Load 718 + 720: 81(ivec3) VectorShuffle 719 719 0 1 2 + 721: 544(bvec3) SLessThan 720 543 + 722: 544(bvec3) GroupNonUniformLogicalXor 34 Reduce 721 + 723: 81(ivec3) Select 722 547 543 + 724: 72(ptr) AccessChain 27(data) 717 38 + 725: 20(ivec4) Load 724 + 726: 20(ivec4) VectorShuffle 725 723 4 5 6 3 + Store 724 726 + 727: 6(int) Load 8(invocation) + 728: 72(ptr) AccessChain 27(data) 38 38 + 729: 20(ivec4) Load 728 + 730: 556(bvec4) SLessThan 729 555 + 731: 556(bvec4) GroupNonUniformLogicalXor 34 Reduce 730 + 732: 20(ivec4) Select 731 559 555 + 733: 72(ptr) AccessChain 27(data) 727 38 + Store 733 732 + 734: 6(int) Load 8(invocation) + 735: 31(ptr) AccessChain 27(data) 29 29 30 + 736: 17(float) Load 735 + 737: 17(float) GroupNonUniformFAdd 34 InclusiveScan 736 + 738: 31(ptr) AccessChain 27(data) 734 29 30 + Store 738 737 + 739: 6(int) Load 8(invocation) + 740: 40(ptr) AccessChain 27(data) 38 29 + 741: 18(fvec4) Load 740 + 742: 39(fvec2) VectorShuffle 741 741 0 1 + 743: 39(fvec2) GroupNonUniformFAdd 34 InclusiveScan 742 + 744: 40(ptr) AccessChain 27(data) 739 29 + 745: 18(fvec4) Load 744 + 746: 18(fvec4) VectorShuffle 745 743 4 5 2 3 + Store 744 746 + 747: 6(int) Load 8(invocation) + 748: 40(ptr) AccessChain 27(data) 49 29 + 749: 18(fvec4) Load 748 + 750: 50(fvec3) VectorShuffle 749 749 0 1 2 + 751: 50(fvec3) GroupNonUniformFAdd 34 InclusiveScan 750 + 752: 40(ptr) AccessChain 27(data) 747 29 + 753: 18(fvec4) Load 752 + 754: 18(fvec4) VectorShuffle 753 751 4 5 6 3 + Store 752 754 + 755: 6(int) Load 8(invocation) + 756: 40(ptr) AccessChain 27(data) 59 29 + 757: 18(fvec4) Load 756 + 758: 18(fvec4) GroupNonUniformFAdd 34 InclusiveScan 757 + 759: 40(ptr) AccessChain 27(data) 755 29 + Store 759 758 + 760: 6(int) Load 8(invocation) + 761: 65(ptr) AccessChain 27(data) 29 38 30 + 762: 19(int) Load 761 + 763: 19(int) GroupNonUniformIAdd 34 InclusiveScan 762 + 764: 65(ptr) AccessChain 27(data) 760 38 30 + Store 764 763 + 765: 6(int) Load 8(invocation) + 766: 72(ptr) AccessChain 27(data) 38 38 + 767: 20(ivec4) Load 766 + 768: 71(ivec2) VectorShuffle 767 767 0 1 + 769: 71(ivec2) GroupNonUniformIAdd 34 InclusiveScan 768 + 770: 72(ptr) AccessChain 27(data) 765 38 + 771: 20(ivec4) Load 770 + 772: 20(ivec4) VectorShuffle 771 769 4 5 2 3 + Store 770 772 + 773: 6(int) Load 8(invocation) + 774: 72(ptr) AccessChain 27(data) 49 38 + 775: 20(ivec4) Load 774 + 776: 81(ivec3) VectorShuffle 775 775 0 1 2 + 777: 81(ivec3) GroupNonUniformIAdd 34 InclusiveScan 776 + 778: 72(ptr) AccessChain 27(data) 773 38 + 779: 20(ivec4) Load 778 + 780: 20(ivec4) VectorShuffle 779 777 4 5 6 3 + Store 778 780 + 781: 6(int) Load 8(invocation) + 782: 72(ptr) AccessChain 27(data) 59 38 + 783: 20(ivec4) Load 782 + 784: 20(ivec4) GroupNonUniformIAdd 34 InclusiveScan 783 + 785: 72(ptr) AccessChain 27(data) 781 38 + Store 785 784 + 786: 6(int) Load 8(invocation) + 787: 95(ptr) AccessChain 27(data) 29 49 30 + 788: 6(int) Load 787 + 789: 6(int) GroupNonUniformIAdd 34 InclusiveScan 788 + 790: 95(ptr) AccessChain 27(data) 786 49 30 + Store 790 789 + 791: 6(int) Load 8(invocation) + 792: 102(ptr) AccessChain 27(data) 38 49 + 793: 21(ivec4) Load 792 + 794: 101(ivec2) VectorShuffle 793 793 0 1 + 795: 101(ivec2) GroupNonUniformIAdd 34 InclusiveScan 794 + 796: 102(ptr) AccessChain 27(data) 791 49 + 797: 21(ivec4) Load 796 + 798: 21(ivec4) VectorShuffle 797 795 4 5 2 3 + Store 796 798 + 799: 6(int) Load 8(invocation) + 800: 102(ptr) AccessChain 27(data) 49 49 + 801: 21(ivec4) Load 800 + 802: 111(ivec3) VectorShuffle 801 801 0 1 2 + 803: 111(ivec3) GroupNonUniformIAdd 34 InclusiveScan 802 + 804: 102(ptr) AccessChain 27(data) 799 49 + 805: 21(ivec4) Load 804 + 806: 21(ivec4) VectorShuffle 805 803 4 5 6 3 + Store 804 806 + 807: 6(int) Load 8(invocation) + 808: 102(ptr) AccessChain 27(data) 59 49 + 809: 21(ivec4) Load 808 + 810: 21(ivec4) GroupNonUniformIAdd 34 InclusiveScan 809 + 811: 102(ptr) AccessChain 27(data) 807 49 + Store 811 810 + 812: 6(int) Load 8(invocation) + 813: 125(ptr) AccessChain 27(data) 29 59 30 + 814: 22(float) Load 813 + 815: 22(float) GroupNonUniformFAdd 34 InclusiveScan 814 + 816: 125(ptr) AccessChain 27(data) 812 59 30 + Store 816 815 + 817: 6(int) Load 8(invocation) + 818: 132(ptr) AccessChain 27(data) 38 59 + 819: 23(fvec4) Load 818 + 820: 131(fvec2) VectorShuffle 819 819 0 1 + 821: 131(fvec2) GroupNonUniformFAdd 34 InclusiveScan 820 + 822: 132(ptr) AccessChain 27(data) 817 59 + 823: 23(fvec4) Load 822 + 824: 23(fvec4) VectorShuffle 823 821 4 5 2 3 + Store 822 824 + 825: 6(int) Load 8(invocation) + 826: 132(ptr) AccessChain 27(data) 49 59 + 827: 23(fvec4) Load 826 + 828: 141(fvec3) VectorShuffle 827 827 0 1 2 + 829: 141(fvec3) GroupNonUniformFAdd 34 InclusiveScan 828 + 830: 132(ptr) AccessChain 27(data) 825 59 + 831: 23(fvec4) Load 830 + 832: 23(fvec4) VectorShuffle 831 829 4 5 6 3 + Store 830 832 + 833: 6(int) Load 8(invocation) + 834: 132(ptr) AccessChain 27(data) 59 59 + 835: 23(fvec4) Load 834 + 836: 23(fvec4) GroupNonUniformFAdd 34 InclusiveScan 835 + 837: 132(ptr) AccessChain 27(data) 833 59 + Store 837 836 + 838: 6(int) Load 8(invocation) + 839: 31(ptr) AccessChain 27(data) 29 29 30 + 840: 17(float) Load 839 + 841: 17(float) GroupNonUniformFMul 34 InclusiveScan 840 + 842: 31(ptr) AccessChain 27(data) 838 29 30 + Store 842 841 + 843: 6(int) Load 8(invocation) + 844: 40(ptr) AccessChain 27(data) 38 29 + 845: 18(fvec4) Load 844 + 846: 39(fvec2) VectorShuffle 845 845 0 1 + 847: 39(fvec2) GroupNonUniformFMul 34 InclusiveScan 846 + 848: 40(ptr) AccessChain 27(data) 843 29 + 849: 18(fvec4) Load 848 + 850: 18(fvec4) VectorShuffle 849 847 4 5 2 3 + Store 848 850 + 851: 6(int) Load 8(invocation) + 852: 40(ptr) AccessChain 27(data) 49 29 + 853: 18(fvec4) Load 852 + 854: 50(fvec3) VectorShuffle 853 853 0 1 2 + 855: 50(fvec3) GroupNonUniformFMul 34 InclusiveScan 854 + 856: 40(ptr) AccessChain 27(data) 851 29 + 857: 18(fvec4) Load 856 + 858: 18(fvec4) VectorShuffle 857 855 4 5 6 3 + Store 856 858 + 859: 6(int) Load 8(invocation) + 860: 40(ptr) AccessChain 27(data) 59 29 + 861: 18(fvec4) Load 860 + 862: 18(fvec4) GroupNonUniformFMul 34 InclusiveScan 861 + 863: 40(ptr) AccessChain 27(data) 859 29 + Store 863 862 + 864: 6(int) Load 8(invocation) + 865: 65(ptr) AccessChain 27(data) 29 38 30 + 866: 19(int) Load 865 + 867: 19(int) GroupNonUniformIMul 34 InclusiveScan 866 + 868: 65(ptr) AccessChain 27(data) 864 38 30 + Store 868 867 + 869: 6(int) Load 8(invocation) + 870: 72(ptr) AccessChain 27(data) 38 38 + 871: 20(ivec4) Load 870 + 872: 71(ivec2) VectorShuffle 871 871 0 1 + 873: 71(ivec2) GroupNonUniformIMul 34 InclusiveScan 872 + 874: 72(ptr) AccessChain 27(data) 869 38 + 875: 20(ivec4) Load 874 + 876: 20(ivec4) VectorShuffle 875 873 4 5 2 3 + Store 874 876 + 877: 6(int) Load 8(invocation) + 878: 72(ptr) AccessChain 27(data) 49 38 + 879: 20(ivec4) Load 878 + 880: 81(ivec3) VectorShuffle 879 879 0 1 2 + 881: 81(ivec3) GroupNonUniformIMul 34 InclusiveScan 880 + 882: 72(ptr) AccessChain 27(data) 877 38 + 883: 20(ivec4) Load 882 + 884: 20(ivec4) VectorShuffle 883 881 4 5 6 3 + Store 882 884 + 885: 6(int) Load 8(invocation) + 886: 72(ptr) AccessChain 27(data) 59 38 + 887: 20(ivec4) Load 886 + 888: 20(ivec4) GroupNonUniformIMul 34 InclusiveScan 887 + 889: 72(ptr) AccessChain 27(data) 885 38 + Store 889 888 + 890: 6(int) Load 8(invocation) + 891: 95(ptr) AccessChain 27(data) 29 49 30 + 892: 6(int) Load 891 + 893: 6(int) GroupNonUniformIMul 34 InclusiveScan 892 + 894: 95(ptr) AccessChain 27(data) 890 49 30 + Store 894 893 + 895: 6(int) Load 8(invocation) + 896: 102(ptr) AccessChain 27(data) 38 49 + 897: 21(ivec4) Load 896 + 898: 101(ivec2) VectorShuffle 897 897 0 1 + 899: 101(ivec2) GroupNonUniformIMul 34 InclusiveScan 898 + 900: 102(ptr) AccessChain 27(data) 895 49 + 901: 21(ivec4) Load 900 + 902: 21(ivec4) VectorShuffle 901 899 4 5 2 3 + Store 900 902 + 903: 6(int) Load 8(invocation) + 904: 102(ptr) AccessChain 27(data) 49 49 + 905: 21(ivec4) Load 904 + 906: 111(ivec3) VectorShuffle 905 905 0 1 2 + 907: 111(ivec3) GroupNonUniformIMul 34 InclusiveScan 906 + 908: 102(ptr) AccessChain 27(data) 903 49 + 909: 21(ivec4) Load 908 + 910: 21(ivec4) VectorShuffle 909 907 4 5 6 3 + Store 908 910 + 911: 6(int) Load 8(invocation) + 912: 102(ptr) AccessChain 27(data) 59 49 + 913: 21(ivec4) Load 912 + 914: 21(ivec4) GroupNonUniformIMul 34 InclusiveScan 913 + 915: 102(ptr) AccessChain 27(data) 911 49 + Store 915 914 + 916: 6(int) Load 8(invocation) + 917: 125(ptr) AccessChain 27(data) 29 59 30 + 918: 22(float) Load 917 + 919: 22(float) GroupNonUniformFMul 34 InclusiveScan 918 + 920: 125(ptr) AccessChain 27(data) 916 59 30 + Store 920 919 + 921: 6(int) Load 8(invocation) + 922: 132(ptr) AccessChain 27(data) 38 59 + 923: 23(fvec4) Load 922 + 924: 131(fvec2) VectorShuffle 923 923 0 1 + 925: 131(fvec2) GroupNonUniformFMul 34 InclusiveScan 924 + 926: 132(ptr) AccessChain 27(data) 921 59 + 927: 23(fvec4) Load 926 + 928: 23(fvec4) VectorShuffle 927 925 4 5 2 3 + Store 926 928 + 929: 6(int) Load 8(invocation) + 930: 132(ptr) AccessChain 27(data) 49 59 + 931: 23(fvec4) Load 930 + 932: 141(fvec3) VectorShuffle 931 931 0 1 2 + 933: 141(fvec3) GroupNonUniformFMul 34 InclusiveScan 932 + 934: 132(ptr) AccessChain 27(data) 929 59 + 935: 23(fvec4) Load 934 + 936: 23(fvec4) VectorShuffle 935 933 4 5 6 3 + Store 934 936 + 937: 6(int) Load 8(invocation) + 938: 132(ptr) AccessChain 27(data) 59 59 + 939: 23(fvec4) Load 938 + 940: 23(fvec4) GroupNonUniformFMul 34 InclusiveScan 939 + 941: 132(ptr) AccessChain 27(data) 937 59 + Store 941 940 + 942: 6(int) Load 8(invocation) + 943: 31(ptr) AccessChain 27(data) 29 29 30 + 944: 17(float) Load 943 + 945: 17(float) GroupNonUniformFMin 34 InclusiveScan 944 + 946: 31(ptr) AccessChain 27(data) 942 29 30 + Store 946 945 + 947: 6(int) Load 8(invocation) + 948: 40(ptr) AccessChain 27(data) 38 29 + 949: 18(fvec4) Load 948 + 950: 39(fvec2) VectorShuffle 949 949 0 1 + 951: 39(fvec2) GroupNonUniformFMin 34 InclusiveScan 950 + 952: 40(ptr) AccessChain 27(data) 947 29 + 953: 18(fvec4) Load 952 + 954: 18(fvec4) VectorShuffle 953 951 4 5 2 3 + Store 952 954 + 955: 6(int) Load 8(invocation) + 956: 40(ptr) AccessChain 27(data) 49 29 + 957: 18(fvec4) Load 956 + 958: 50(fvec3) VectorShuffle 957 957 0 1 2 + 959: 50(fvec3) GroupNonUniformFMin 34 InclusiveScan 958 + 960: 40(ptr) AccessChain 27(data) 955 29 + 961: 18(fvec4) Load 960 + 962: 18(fvec4) VectorShuffle 961 959 4 5 6 3 + Store 960 962 + 963: 6(int) Load 8(invocation) + 964: 40(ptr) AccessChain 27(data) 59 29 + 965: 18(fvec4) Load 964 + 966: 18(fvec4) GroupNonUniformFMin 34 InclusiveScan 965 + 967: 40(ptr) AccessChain 27(data) 963 29 + Store 967 966 + 968: 6(int) Load 8(invocation) + 969: 65(ptr) AccessChain 27(data) 29 38 30 + 970: 19(int) Load 969 + 971: 19(int) GroupNonUniformSMin 34 InclusiveScan 970 + 972: 65(ptr) AccessChain 27(data) 968 38 30 + Store 972 971 + 973: 6(int) Load 8(invocation) + 974: 72(ptr) AccessChain 27(data) 38 38 + 975: 20(ivec4) Load 974 + 976: 71(ivec2) VectorShuffle 975 975 0 1 + 977: 71(ivec2) GroupNonUniformSMin 34 InclusiveScan 976 + 978: 72(ptr) AccessChain 27(data) 973 38 + 979: 20(ivec4) Load 978 + 980: 20(ivec4) VectorShuffle 979 977 4 5 2 3 + Store 978 980 + 981: 6(int) Load 8(invocation) + 982: 72(ptr) AccessChain 27(data) 49 38 + 983: 20(ivec4) Load 982 + 984: 81(ivec3) VectorShuffle 983 983 0 1 2 + 985: 81(ivec3) GroupNonUniformSMin 34 InclusiveScan 984 + 986: 72(ptr) AccessChain 27(data) 981 38 + 987: 20(ivec4) Load 986 + 988: 20(ivec4) VectorShuffle 987 985 4 5 6 3 + Store 986 988 + 989: 6(int) Load 8(invocation) + 990: 72(ptr) AccessChain 27(data) 59 38 + 991: 20(ivec4) Load 990 + 992: 20(ivec4) GroupNonUniformSMin 34 InclusiveScan 991 + 993: 72(ptr) AccessChain 27(data) 989 38 + Store 993 992 + 994: 6(int) Load 8(invocation) + 995: 95(ptr) AccessChain 27(data) 29 49 30 + 996: 6(int) Load 995 + 997: 6(int) GroupNonUniformUMin 34 InclusiveScan 996 + 998: 95(ptr) AccessChain 27(data) 994 49 30 + Store 998 997 + 999: 6(int) Load 8(invocation) + 1000: 102(ptr) AccessChain 27(data) 38 49 + 1001: 21(ivec4) Load 1000 + 1002: 101(ivec2) VectorShuffle 1001 1001 0 1 + 1003: 101(ivec2) GroupNonUniformUMin 34 InclusiveScan 1002 + 1004: 102(ptr) AccessChain 27(data) 999 49 + 1005: 21(ivec4) Load 1004 + 1006: 21(ivec4) VectorShuffle 1005 1003 4 5 2 3 + Store 1004 1006 + 1007: 6(int) Load 8(invocation) + 1008: 102(ptr) AccessChain 27(data) 49 49 + 1009: 21(ivec4) Load 1008 + 1010: 111(ivec3) VectorShuffle 1009 1009 0 1 2 + 1011: 111(ivec3) GroupNonUniformUMin 34 InclusiveScan 1010 + 1012: 102(ptr) AccessChain 27(data) 1007 49 + 1013: 21(ivec4) Load 1012 + 1014: 21(ivec4) VectorShuffle 1013 1011 4 5 6 3 + Store 1012 1014 + 1015: 6(int) Load 8(invocation) + 1016: 102(ptr) AccessChain 27(data) 59 49 + 1017: 21(ivec4) Load 1016 + 1018: 21(ivec4) GroupNonUniformUMin 34 InclusiveScan 1017 + 1019: 102(ptr) AccessChain 27(data) 1015 49 + Store 1019 1018 + 1020: 6(int) Load 8(invocation) + 1021: 125(ptr) AccessChain 27(data) 29 59 30 + 1022: 22(float) Load 1021 + 1023: 22(float) GroupNonUniformFMin 34 InclusiveScan 1022 + 1024: 125(ptr) AccessChain 27(data) 1020 59 30 + Store 1024 1023 + 1025: 6(int) Load 8(invocation) + 1026: 132(ptr) AccessChain 27(data) 38 59 + 1027: 23(fvec4) Load 1026 + 1028: 131(fvec2) VectorShuffle 1027 1027 0 1 + 1029: 131(fvec2) GroupNonUniformFMin 34 InclusiveScan 1028 + 1030: 132(ptr) AccessChain 27(data) 1025 59 + 1031: 23(fvec4) Load 1030 + 1032: 23(fvec4) VectorShuffle 1031 1029 4 5 2 3 + Store 1030 1032 + 1033: 6(int) Load 8(invocation) + 1034: 132(ptr) AccessChain 27(data) 49 59 + 1035: 23(fvec4) Load 1034 + 1036: 141(fvec3) VectorShuffle 1035 1035 0 1 2 + 1037: 141(fvec3) GroupNonUniformFMin 34 InclusiveScan 1036 + 1038: 132(ptr) AccessChain 27(data) 1033 59 + 1039: 23(fvec4) Load 1038 + 1040: 23(fvec4) VectorShuffle 1039 1037 4 5 6 3 + Store 1038 1040 + 1041: 6(int) Load 8(invocation) + 1042: 132(ptr) AccessChain 27(data) 59 59 + 1043: 23(fvec4) Load 1042 + 1044: 23(fvec4) GroupNonUniformFMin 34 InclusiveScan 1043 + 1045: 132(ptr) AccessChain 27(data) 1041 59 + Store 1045 1044 + 1046: 6(int) Load 8(invocation) + 1047: 31(ptr) AccessChain 27(data) 29 29 30 + 1048: 17(float) Load 1047 + 1049: 17(float) GroupNonUniformFMax 34 InclusiveScan 1048 + 1050: 31(ptr) AccessChain 27(data) 1046 29 30 + Store 1050 1049 + 1051: 6(int) Load 8(invocation) + 1052: 40(ptr) AccessChain 27(data) 38 29 + 1053: 18(fvec4) Load 1052 + 1054: 39(fvec2) VectorShuffle 1053 1053 0 1 + 1055: 39(fvec2) GroupNonUniformFMax 34 InclusiveScan 1054 + 1056: 40(ptr) AccessChain 27(data) 1051 29 + 1057: 18(fvec4) Load 1056 + 1058: 18(fvec4) VectorShuffle 1057 1055 4 5 2 3 + Store 1056 1058 + 1059: 6(int) Load 8(invocation) + 1060: 40(ptr) AccessChain 27(data) 49 29 + 1061: 18(fvec4) Load 1060 + 1062: 50(fvec3) VectorShuffle 1061 1061 0 1 2 + 1063: 50(fvec3) GroupNonUniformFMax 34 InclusiveScan 1062 + 1064: 40(ptr) AccessChain 27(data) 1059 29 + 1065: 18(fvec4) Load 1064 + 1066: 18(fvec4) VectorShuffle 1065 1063 4 5 6 3 + Store 1064 1066 + 1067: 6(int) Load 8(invocation) + 1068: 40(ptr) AccessChain 27(data) 59 29 + 1069: 18(fvec4) Load 1068 + 1070: 18(fvec4) GroupNonUniformFMax 34 InclusiveScan 1069 + 1071: 40(ptr) AccessChain 27(data) 1067 29 + Store 1071 1070 + 1072: 6(int) Load 8(invocation) + 1073: 65(ptr) AccessChain 27(data) 29 38 30 + 1074: 19(int) Load 1073 + 1075: 19(int) GroupNonUniformSMax 34 InclusiveScan 1074 + 1076: 65(ptr) AccessChain 27(data) 1072 38 30 + Store 1076 1075 + 1077: 6(int) Load 8(invocation) + 1078: 72(ptr) AccessChain 27(data) 38 38 + 1079: 20(ivec4) Load 1078 + 1080: 71(ivec2) VectorShuffle 1079 1079 0 1 + 1081: 71(ivec2) GroupNonUniformSMax 34 InclusiveScan 1080 + 1082: 72(ptr) AccessChain 27(data) 1077 38 + 1083: 20(ivec4) Load 1082 + 1084: 20(ivec4) VectorShuffle 1083 1081 4 5 2 3 + Store 1082 1084 + 1085: 6(int) Load 8(invocation) + 1086: 72(ptr) AccessChain 27(data) 49 38 + 1087: 20(ivec4) Load 1086 + 1088: 81(ivec3) VectorShuffle 1087 1087 0 1 2 + 1089: 81(ivec3) GroupNonUniformSMax 34 InclusiveScan 1088 + 1090: 72(ptr) AccessChain 27(data) 1085 38 + 1091: 20(ivec4) Load 1090 + 1092: 20(ivec4) VectorShuffle 1091 1089 4 5 6 3 + Store 1090 1092 + 1093: 6(int) Load 8(invocation) + 1094: 72(ptr) AccessChain 27(data) 59 38 + 1095: 20(ivec4) Load 1094 + 1096: 20(ivec4) GroupNonUniformSMax 34 InclusiveScan 1095 + 1097: 72(ptr) AccessChain 27(data) 1093 38 + Store 1097 1096 + 1098: 6(int) Load 8(invocation) + 1099: 95(ptr) AccessChain 27(data) 29 49 30 + 1100: 6(int) Load 1099 + 1101: 6(int) GroupNonUniformUMax 34 InclusiveScan 1100 + 1102: 95(ptr) AccessChain 27(data) 1098 49 30 + Store 1102 1101 + 1103: 6(int) Load 8(invocation) + 1104: 102(ptr) AccessChain 27(data) 38 49 + 1105: 21(ivec4) Load 1104 + 1106: 101(ivec2) VectorShuffle 1105 1105 0 1 + 1107: 101(ivec2) GroupNonUniformUMax 34 InclusiveScan 1106 + 1108: 102(ptr) AccessChain 27(data) 1103 49 + 1109: 21(ivec4) Load 1108 + 1110: 21(ivec4) VectorShuffle 1109 1107 4 5 2 3 + Store 1108 1110 + 1111: 6(int) Load 8(invocation) + 1112: 102(ptr) AccessChain 27(data) 49 49 + 1113: 21(ivec4) Load 1112 + 1114: 111(ivec3) VectorShuffle 1113 1113 0 1 2 + 1115: 111(ivec3) GroupNonUniformUMax 34 InclusiveScan 1114 + 1116: 102(ptr) AccessChain 27(data) 1111 49 + 1117: 21(ivec4) Load 1116 + 1118: 21(ivec4) VectorShuffle 1117 1115 4 5 6 3 + Store 1116 1118 + 1119: 6(int) Load 8(invocation) + 1120: 102(ptr) AccessChain 27(data) 59 49 + 1121: 21(ivec4) Load 1120 + 1122: 21(ivec4) GroupNonUniformUMax 34 InclusiveScan 1121 + 1123: 102(ptr) AccessChain 27(data) 1119 49 + Store 1123 1122 + 1124: 6(int) Load 8(invocation) + 1125: 125(ptr) AccessChain 27(data) 29 59 30 + 1126: 22(float) Load 1125 + 1127: 22(float) GroupNonUniformFMax 34 InclusiveScan 1126 + 1128: 125(ptr) AccessChain 27(data) 1124 59 30 + Store 1128 1127 + 1129: 6(int) Load 8(invocation) + 1130: 132(ptr) AccessChain 27(data) 38 59 + 1131: 23(fvec4) Load 1130 + 1132: 131(fvec2) VectorShuffle 1131 1131 0 1 + 1133: 131(fvec2) GroupNonUniformFMax 34 InclusiveScan 1132 + 1134: 132(ptr) AccessChain 27(data) 1129 59 + 1135: 23(fvec4) Load 1134 + 1136: 23(fvec4) VectorShuffle 1135 1133 4 5 2 3 + Store 1134 1136 + 1137: 6(int) Load 8(invocation) + 1138: 132(ptr) AccessChain 27(data) 49 59 + 1139: 23(fvec4) Load 1138 + 1140: 141(fvec3) VectorShuffle 1139 1139 0 1 2 + 1141: 141(fvec3) GroupNonUniformFMax 34 InclusiveScan 1140 + 1142: 132(ptr) AccessChain 27(data) 1137 59 + 1143: 23(fvec4) Load 1142 + 1144: 23(fvec4) VectorShuffle 1143 1141 4 5 6 3 + Store 1142 1144 + 1145: 6(int) Load 8(invocation) + 1146: 132(ptr) AccessChain 27(data) 59 59 + 1147: 23(fvec4) Load 1146 + 1148: 23(fvec4) GroupNonUniformFMax 34 InclusiveScan 1147 + 1149: 132(ptr) AccessChain 27(data) 1145 59 + Store 1149 1148 + 1150: 6(int) Load 8(invocation) + 1151: 65(ptr) AccessChain 27(data) 29 38 30 + 1152: 19(int) Load 1151 + 1153: 19(int) GroupNonUniformBitwiseAnd 34 InclusiveScan 1152 + 1154: 65(ptr) AccessChain 27(data) 1150 38 30 + Store 1154 1153 + 1155: 6(int) Load 8(invocation) + 1156: 72(ptr) AccessChain 27(data) 38 38 + 1157: 20(ivec4) Load 1156 + 1158: 71(ivec2) VectorShuffle 1157 1157 0 1 + 1159: 71(ivec2) GroupNonUniformBitwiseAnd 34 InclusiveScan 1158 + 1160: 72(ptr) AccessChain 27(data) 1155 38 + 1161: 20(ivec4) Load 1160 + 1162: 20(ivec4) VectorShuffle 1161 1159 4 5 2 3 + Store 1160 1162 + 1163: 6(int) Load 8(invocation) + 1164: 72(ptr) AccessChain 27(data) 49 38 + 1165: 20(ivec4) Load 1164 + 1166: 81(ivec3) VectorShuffle 1165 1165 0 1 2 + 1167: 81(ivec3) GroupNonUniformBitwiseAnd 34 InclusiveScan 1166 + 1168: 72(ptr) AccessChain 27(data) 1163 38 + 1169: 20(ivec4) Load 1168 + 1170: 20(ivec4) VectorShuffle 1169 1167 4 5 6 3 + Store 1168 1170 + 1171: 6(int) Load 8(invocation) + 1172: 72(ptr) AccessChain 27(data) 59 38 + 1173: 20(ivec4) Load 1172 + 1174: 20(ivec4) GroupNonUniformBitwiseAnd 34 InclusiveScan 1173 + 1175: 72(ptr) AccessChain 27(data) 1171 38 + Store 1175 1174 + 1176: 6(int) Load 8(invocation) + 1177: 95(ptr) AccessChain 27(data) 29 49 30 + 1178: 6(int) Load 1177 + 1179: 6(int) GroupNonUniformBitwiseAnd 34 InclusiveScan 1178 + 1180: 95(ptr) AccessChain 27(data) 1176 49 30 + Store 1180 1179 + 1181: 6(int) Load 8(invocation) + 1182: 102(ptr) AccessChain 27(data) 38 49 + 1183: 21(ivec4) Load 1182 + 1184: 101(ivec2) VectorShuffle 1183 1183 0 1 + 1185: 101(ivec2) GroupNonUniformBitwiseAnd 34 InclusiveScan 1184 + 1186: 102(ptr) AccessChain 27(data) 1181 49 + 1187: 21(ivec4) Load 1186 + 1188: 21(ivec4) VectorShuffle 1187 1185 4 5 2 3 + Store 1186 1188 + 1189: 6(int) Load 8(invocation) + 1190: 102(ptr) AccessChain 27(data) 49 49 + 1191: 21(ivec4) Load 1190 + 1192: 111(ivec3) VectorShuffle 1191 1191 0 1 2 + 1193: 111(ivec3) GroupNonUniformBitwiseAnd 34 InclusiveScan 1192 + 1194: 102(ptr) AccessChain 27(data) 1189 49 + 1195: 21(ivec4) Load 1194 + 1196: 21(ivec4) VectorShuffle 1195 1193 4 5 6 3 + Store 1194 1196 + 1197: 6(int) Load 8(invocation) + 1198: 102(ptr) AccessChain 27(data) 59 49 + 1199: 21(ivec4) Load 1198 + 1200: 21(ivec4) GroupNonUniformBitwiseAnd 34 InclusiveScan 1199 + 1201: 102(ptr) AccessChain 27(data) 1197 49 + Store 1201 1200 + 1202: 6(int) Load 8(invocation) + 1203: 65(ptr) AccessChain 27(data) 29 38 30 + 1204: 19(int) Load 1203 + 1205: 521(bool) SLessThan 1204 29 + 1206: 521(bool) GroupNonUniformLogicalAnd 34 InclusiveScan 1205 + 1207: 19(int) Select 1206 38 29 + 1208: 65(ptr) AccessChain 27(data) 1202 38 30 + Store 1208 1207 + 1209: 6(int) Load 8(invocation) + 1210: 72(ptr) AccessChain 27(data) 38 38 + 1211: 20(ivec4) Load 1210 + 1212: 71(ivec2) VectorShuffle 1211 1211 0 1 + 1213: 531(bvec2) SLessThan 1212 530 + 1214: 531(bvec2) GroupNonUniformLogicalAnd 34 InclusiveScan 1213 + 1215: 71(ivec2) Select 1214 534 530 + 1216: 72(ptr) AccessChain 27(data) 1209 38 + 1217: 20(ivec4) Load 1216 + 1218: 20(ivec4) VectorShuffle 1217 1215 4 5 2 3 + Store 1216 1218 + 1219: 6(int) Load 8(invocation) + 1220: 72(ptr) AccessChain 27(data) 38 38 + 1221: 20(ivec4) Load 1220 + 1222: 81(ivec3) VectorShuffle 1221 1221 0 1 2 + 1223: 544(bvec3) SLessThan 1222 543 + 1224: 544(bvec3) GroupNonUniformLogicalAnd 34 InclusiveScan 1223 + 1225: 81(ivec3) Select 1224 547 543 + 1226: 72(ptr) AccessChain 27(data) 1219 38 + 1227: 20(ivec4) Load 1226 + 1228: 20(ivec4) VectorShuffle 1227 1225 4 5 6 3 + Store 1226 1228 + 1229: 6(int) Load 8(invocation) + 1230: 72(ptr) AccessChain 27(data) 38 38 + 1231: 20(ivec4) Load 1230 + 1232: 556(bvec4) SLessThan 1231 555 + 1233: 556(bvec4) GroupNonUniformLogicalAnd 34 InclusiveScan 1232 + 1234: 20(ivec4) Select 1233 559 555 + 1235: 72(ptr) AccessChain 27(data) 1229 38 + Store 1235 1234 + 1236: 6(int) Load 8(invocation) + 1237: 65(ptr) AccessChain 27(data) 29 38 30 + 1238: 19(int) Load 1237 + 1239: 19(int) GroupNonUniformBitwiseOr 34 InclusiveScan 1238 + 1240: 65(ptr) AccessChain 27(data) 1236 38 30 + Store 1240 1239 + 1241: 6(int) Load 8(invocation) + 1242: 72(ptr) AccessChain 27(data) 38 38 + 1243: 20(ivec4) Load 1242 + 1244: 71(ivec2) VectorShuffle 1243 1243 0 1 + 1245: 71(ivec2) GroupNonUniformBitwiseOr 34 InclusiveScan 1244 + 1246: 72(ptr) AccessChain 27(data) 1241 38 + 1247: 20(ivec4) Load 1246 + 1248: 20(ivec4) VectorShuffle 1247 1245 4 5 2 3 + Store 1246 1248 + 1249: 6(int) Load 8(invocation) + 1250: 72(ptr) AccessChain 27(data) 49 38 + 1251: 20(ivec4) Load 1250 + 1252: 81(ivec3) VectorShuffle 1251 1251 0 1 2 + 1253: 81(ivec3) GroupNonUniformBitwiseOr 34 InclusiveScan 1252 + 1254: 72(ptr) AccessChain 27(data) 1249 38 + 1255: 20(ivec4) Load 1254 + 1256: 20(ivec4) VectorShuffle 1255 1253 4 5 6 3 + Store 1254 1256 + 1257: 6(int) Load 8(invocation) + 1258: 72(ptr) AccessChain 27(data) 59 38 + 1259: 20(ivec4) Load 1258 + 1260: 20(ivec4) GroupNonUniformBitwiseOr 34 InclusiveScan 1259 + 1261: 72(ptr) AccessChain 27(data) 1257 38 + Store 1261 1260 + 1262: 6(int) Load 8(invocation) + 1263: 95(ptr) AccessChain 27(data) 29 49 30 + 1264: 6(int) Load 1263 + 1265: 6(int) GroupNonUniformBitwiseOr 34 InclusiveScan 1264 + 1266: 95(ptr) AccessChain 27(data) 1262 49 30 + Store 1266 1265 + 1267: 6(int) Load 8(invocation) + 1268: 102(ptr) AccessChain 27(data) 38 49 + 1269: 21(ivec4) Load 1268 + 1270: 101(ivec2) VectorShuffle 1269 1269 0 1 + 1271: 101(ivec2) GroupNonUniformBitwiseOr 34 InclusiveScan 1270 + 1272: 102(ptr) AccessChain 27(data) 1267 49 + 1273: 21(ivec4) Load 1272 + 1274: 21(ivec4) VectorShuffle 1273 1271 4 5 2 3 + Store 1272 1274 + 1275: 6(int) Load 8(invocation) + 1276: 102(ptr) AccessChain 27(data) 49 49 + 1277: 21(ivec4) Load 1276 + 1278: 111(ivec3) VectorShuffle 1277 1277 0 1 2 + 1279: 111(ivec3) GroupNonUniformBitwiseOr 34 InclusiveScan 1278 + 1280: 102(ptr) AccessChain 27(data) 1275 49 + 1281: 21(ivec4) Load 1280 + 1282: 21(ivec4) VectorShuffle 1281 1279 4 5 6 3 + Store 1280 1282 + 1283: 6(int) Load 8(invocation) + 1284: 102(ptr) AccessChain 27(data) 59 49 + 1285: 21(ivec4) Load 1284 + 1286: 21(ivec4) GroupNonUniformBitwiseOr 34 InclusiveScan 1285 + 1287: 102(ptr) AccessChain 27(data) 1283 49 + Store 1287 1286 + 1288: 6(int) Load 8(invocation) + 1289: 65(ptr) AccessChain 27(data) 29 38 30 + 1290: 19(int) Load 1289 + 1291: 521(bool) SLessThan 1290 29 + 1292: 521(bool) GroupNonUniformLogicalOr 34 InclusiveScan 1291 + 1293: 19(int) Select 1292 38 29 + 1294: 65(ptr) AccessChain 27(data) 1288 38 30 + Store 1294 1293 + 1295: 6(int) Load 8(invocation) + 1296: 72(ptr) AccessChain 27(data) 38 38 + 1297: 20(ivec4) Load 1296 + 1298: 71(ivec2) VectorShuffle 1297 1297 0 1 + 1299: 531(bvec2) SLessThan 1298 530 + 1300: 531(bvec2) GroupNonUniformLogicalOr 34 InclusiveScan 1299 + 1301: 71(ivec2) Select 1300 534 530 + 1302: 72(ptr) AccessChain 27(data) 1295 38 + 1303: 20(ivec4) Load 1302 + 1304: 20(ivec4) VectorShuffle 1303 1301 4 5 2 3 + Store 1302 1304 + 1305: 6(int) Load 8(invocation) + 1306: 72(ptr) AccessChain 27(data) 38 38 + 1307: 20(ivec4) Load 1306 + 1308: 81(ivec3) VectorShuffle 1307 1307 0 1 2 + 1309: 544(bvec3) SLessThan 1308 543 + 1310: 544(bvec3) GroupNonUniformLogicalOr 34 InclusiveScan 1309 + 1311: 81(ivec3) Select 1310 547 543 + 1312: 72(ptr) AccessChain 27(data) 1305 38 + 1313: 20(ivec4) Load 1312 + 1314: 20(ivec4) VectorShuffle 1313 1311 4 5 6 3 + Store 1312 1314 + 1315: 6(int) Load 8(invocation) + 1316: 72(ptr) AccessChain 27(data) 38 38 + 1317: 20(ivec4) Load 1316 + 1318: 556(bvec4) SLessThan 1317 555 + 1319: 556(bvec4) GroupNonUniformLogicalOr 34 InclusiveScan 1318 + 1320: 20(ivec4) Select 1319 559 555 + 1321: 72(ptr) AccessChain 27(data) 1315 38 + Store 1321 1320 + 1322: 6(int) Load 8(invocation) + 1323: 65(ptr) AccessChain 27(data) 29 38 30 + 1324: 19(int) Load 1323 + 1325: 19(int) GroupNonUniformBitwiseXor 34 InclusiveScan 1324 + 1326: 65(ptr) AccessChain 27(data) 1322 38 30 + Store 1326 1325 + 1327: 6(int) Load 8(invocation) + 1328: 72(ptr) AccessChain 27(data) 38 38 + 1329: 20(ivec4) Load 1328 + 1330: 71(ivec2) VectorShuffle 1329 1329 0 1 + 1331: 71(ivec2) GroupNonUniformBitwiseXor 34 InclusiveScan 1330 + 1332: 72(ptr) AccessChain 27(data) 1327 38 + 1333: 20(ivec4) Load 1332 + 1334: 20(ivec4) VectorShuffle 1333 1331 4 5 2 3 + Store 1332 1334 + 1335: 6(int) Load 8(invocation) + 1336: 72(ptr) AccessChain 27(data) 49 38 + 1337: 20(ivec4) Load 1336 + 1338: 81(ivec3) VectorShuffle 1337 1337 0 1 2 + 1339: 81(ivec3) GroupNonUniformBitwiseXor 34 InclusiveScan 1338 + 1340: 72(ptr) AccessChain 27(data) 1335 38 + 1341: 20(ivec4) Load 1340 + 1342: 20(ivec4) VectorShuffle 1341 1339 4 5 6 3 + Store 1340 1342 + 1343: 6(int) Load 8(invocation) + 1344: 72(ptr) AccessChain 27(data) 59 38 + 1345: 20(ivec4) Load 1344 + 1346: 20(ivec4) GroupNonUniformBitwiseXor 34 InclusiveScan 1345 + 1347: 72(ptr) AccessChain 27(data) 1343 38 + Store 1347 1346 + 1348: 6(int) Load 8(invocation) + 1349: 95(ptr) AccessChain 27(data) 29 49 30 + 1350: 6(int) Load 1349 + 1351: 6(int) GroupNonUniformBitwiseXor 34 InclusiveScan 1350 + 1352: 95(ptr) AccessChain 27(data) 1348 49 30 + Store 1352 1351 + 1353: 6(int) Load 8(invocation) + 1354: 102(ptr) AccessChain 27(data) 38 49 + 1355: 21(ivec4) Load 1354 + 1356: 101(ivec2) VectorShuffle 1355 1355 0 1 + 1357: 101(ivec2) GroupNonUniformBitwiseXor 34 InclusiveScan 1356 + 1358: 102(ptr) AccessChain 27(data) 1353 49 + 1359: 21(ivec4) Load 1358 + 1360: 21(ivec4) VectorShuffle 1359 1357 4 5 2 3 + Store 1358 1360 + 1361: 6(int) Load 8(invocation) + 1362: 102(ptr) AccessChain 27(data) 49 49 + 1363: 21(ivec4) Load 1362 + 1364: 111(ivec3) VectorShuffle 1363 1363 0 1 2 + 1365: 111(ivec3) GroupNonUniformBitwiseXor 34 InclusiveScan 1364 + 1366: 102(ptr) AccessChain 27(data) 1361 49 + 1367: 21(ivec4) Load 1366 + 1368: 21(ivec4) VectorShuffle 1367 1365 4 5 6 3 + Store 1366 1368 + 1369: 6(int) Load 8(invocation) + 1370: 102(ptr) AccessChain 27(data) 59 49 + 1371: 21(ivec4) Load 1370 + 1372: 21(ivec4) GroupNonUniformBitwiseXor 34 InclusiveScan 1371 + 1373: 102(ptr) AccessChain 27(data) 1369 49 + Store 1373 1372 + 1374: 6(int) Load 8(invocation) + 1375: 65(ptr) AccessChain 27(data) 29 38 30 + 1376: 19(int) Load 1375 + 1377: 521(bool) SLessThan 1376 29 + 1378: 521(bool) GroupNonUniformLogicalXor 34 InclusiveScan 1377 + 1379: 19(int) Select 1378 38 29 + 1380: 65(ptr) AccessChain 27(data) 1374 38 30 + Store 1380 1379 + 1381: 6(int) Load 8(invocation) + 1382: 72(ptr) AccessChain 27(data) 38 38 + 1383: 20(ivec4) Load 1382 + 1384: 71(ivec2) VectorShuffle 1383 1383 0 1 + 1385: 531(bvec2) SLessThan 1384 530 + 1386: 531(bvec2) GroupNonUniformLogicalXor 34 InclusiveScan 1385 + 1387: 71(ivec2) Select 1386 534 530 + 1388: 72(ptr) AccessChain 27(data) 1381 38 + 1389: 20(ivec4) Load 1388 + 1390: 20(ivec4) VectorShuffle 1389 1387 4 5 2 3 + Store 1388 1390 + 1391: 6(int) Load 8(invocation) + 1392: 72(ptr) AccessChain 27(data) 38 38 + 1393: 20(ivec4) Load 1392 + 1394: 81(ivec3) VectorShuffle 1393 1393 0 1 2 + 1395: 544(bvec3) SLessThan 1394 543 + 1396: 544(bvec3) GroupNonUniformLogicalXor 34 InclusiveScan 1395 + 1397: 81(ivec3) Select 1396 547 543 + 1398: 72(ptr) AccessChain 27(data) 1391 38 + 1399: 20(ivec4) Load 1398 + 1400: 20(ivec4) VectorShuffle 1399 1397 4 5 6 3 + Store 1398 1400 + 1401: 6(int) Load 8(invocation) + 1402: 72(ptr) AccessChain 27(data) 38 38 + 1403: 20(ivec4) Load 1402 + 1404: 556(bvec4) SLessThan 1403 555 + 1405: 556(bvec4) GroupNonUniformLogicalXor 34 InclusiveScan 1404 + 1406: 20(ivec4) Select 1405 559 555 + 1407: 72(ptr) AccessChain 27(data) 1401 38 + Store 1407 1406 + 1408: 6(int) Load 8(invocation) + 1409: 31(ptr) AccessChain 27(data) 29 29 30 + 1410: 17(float) Load 1409 + 1411: 17(float) GroupNonUniformFAdd 34 ExclusiveScan 1410 + 1412: 31(ptr) AccessChain 27(data) 1408 29 30 + Store 1412 1411 + 1413: 6(int) Load 8(invocation) + 1414: 40(ptr) AccessChain 27(data) 38 29 + 1415: 18(fvec4) Load 1414 + 1416: 39(fvec2) VectorShuffle 1415 1415 0 1 + 1417: 39(fvec2) GroupNonUniformFAdd 34 ExclusiveScan 1416 + 1418: 40(ptr) AccessChain 27(data) 1413 29 + 1419: 18(fvec4) Load 1418 + 1420: 18(fvec4) VectorShuffle 1419 1417 4 5 2 3 + Store 1418 1420 + 1421: 6(int) Load 8(invocation) + 1422: 40(ptr) AccessChain 27(data) 49 29 + 1423: 18(fvec4) Load 1422 + 1424: 50(fvec3) VectorShuffle 1423 1423 0 1 2 + 1425: 50(fvec3) GroupNonUniformFAdd 34 ExclusiveScan 1424 + 1426: 40(ptr) AccessChain 27(data) 1421 29 + 1427: 18(fvec4) Load 1426 + 1428: 18(fvec4) VectorShuffle 1427 1425 4 5 6 3 + Store 1426 1428 + 1429: 6(int) Load 8(invocation) + 1430: 40(ptr) AccessChain 27(data) 59 29 + 1431: 18(fvec4) Load 1430 + 1432: 18(fvec4) GroupNonUniformFAdd 34 ExclusiveScan 1431 + 1433: 40(ptr) AccessChain 27(data) 1429 29 + Store 1433 1432 + 1434: 6(int) Load 8(invocation) + 1435: 65(ptr) AccessChain 27(data) 29 38 30 + 1436: 19(int) Load 1435 + 1437: 19(int) GroupNonUniformIAdd 34 ExclusiveScan 1436 + 1438: 65(ptr) AccessChain 27(data) 1434 38 30 + Store 1438 1437 + 1439: 6(int) Load 8(invocation) + 1440: 72(ptr) AccessChain 27(data) 38 38 + 1441: 20(ivec4) Load 1440 + 1442: 71(ivec2) VectorShuffle 1441 1441 0 1 + 1443: 71(ivec2) GroupNonUniformIAdd 34 ExclusiveScan 1442 + 1444: 72(ptr) AccessChain 27(data) 1439 38 + 1445: 20(ivec4) Load 1444 + 1446: 20(ivec4) VectorShuffle 1445 1443 4 5 2 3 + Store 1444 1446 + 1447: 6(int) Load 8(invocation) + 1448: 72(ptr) AccessChain 27(data) 49 38 + 1449: 20(ivec4) Load 1448 + 1450: 81(ivec3) VectorShuffle 1449 1449 0 1 2 + 1451: 81(ivec3) GroupNonUniformIAdd 34 ExclusiveScan 1450 + 1452: 72(ptr) AccessChain 27(data) 1447 38 + 1453: 20(ivec4) Load 1452 + 1454: 20(ivec4) VectorShuffle 1453 1451 4 5 6 3 + Store 1452 1454 + 1455: 6(int) Load 8(invocation) + 1456: 72(ptr) AccessChain 27(data) 59 38 + 1457: 20(ivec4) Load 1456 + 1458: 20(ivec4) GroupNonUniformIAdd 34 ExclusiveScan 1457 + 1459: 72(ptr) AccessChain 27(data) 1455 38 + Store 1459 1458 + 1460: 6(int) Load 8(invocation) + 1461: 95(ptr) AccessChain 27(data) 29 49 30 + 1462: 6(int) Load 1461 + 1463: 6(int) GroupNonUniformIAdd 34 ExclusiveScan 1462 + 1464: 95(ptr) AccessChain 27(data) 1460 49 30 + Store 1464 1463 + 1465: 6(int) Load 8(invocation) + 1466: 102(ptr) AccessChain 27(data) 38 49 + 1467: 21(ivec4) Load 1466 + 1468: 101(ivec2) VectorShuffle 1467 1467 0 1 + 1469: 101(ivec2) GroupNonUniformIAdd 34 ExclusiveScan 1468 + 1470: 102(ptr) AccessChain 27(data) 1465 49 + 1471: 21(ivec4) Load 1470 + 1472: 21(ivec4) VectorShuffle 1471 1469 4 5 2 3 + Store 1470 1472 + 1473: 6(int) Load 8(invocation) + 1474: 102(ptr) AccessChain 27(data) 49 49 + 1475: 21(ivec4) Load 1474 + 1476: 111(ivec3) VectorShuffle 1475 1475 0 1 2 + 1477: 111(ivec3) GroupNonUniformIAdd 34 ExclusiveScan 1476 + 1478: 102(ptr) AccessChain 27(data) 1473 49 + 1479: 21(ivec4) Load 1478 + 1480: 21(ivec4) VectorShuffle 1479 1477 4 5 6 3 + Store 1478 1480 + 1481: 6(int) Load 8(invocation) + 1482: 102(ptr) AccessChain 27(data) 59 49 + 1483: 21(ivec4) Load 1482 + 1484: 21(ivec4) GroupNonUniformIAdd 34 ExclusiveScan 1483 + 1485: 102(ptr) AccessChain 27(data) 1481 49 + Store 1485 1484 + 1486: 6(int) Load 8(invocation) + 1487: 125(ptr) AccessChain 27(data) 29 59 30 + 1488: 22(float) Load 1487 + 1489: 22(float) GroupNonUniformFAdd 34 ExclusiveScan 1488 + 1490: 125(ptr) AccessChain 27(data) 1486 59 30 + Store 1490 1489 + 1491: 6(int) Load 8(invocation) + 1492: 132(ptr) AccessChain 27(data) 38 59 + 1493: 23(fvec4) Load 1492 + 1494: 131(fvec2) VectorShuffle 1493 1493 0 1 + 1495: 131(fvec2) GroupNonUniformFAdd 34 ExclusiveScan 1494 + 1496: 132(ptr) AccessChain 27(data) 1491 59 + 1497: 23(fvec4) Load 1496 + 1498: 23(fvec4) VectorShuffle 1497 1495 4 5 2 3 + Store 1496 1498 + 1499: 6(int) Load 8(invocation) + 1500: 132(ptr) AccessChain 27(data) 49 59 + 1501: 23(fvec4) Load 1500 + 1502: 141(fvec3) VectorShuffle 1501 1501 0 1 2 + 1503: 141(fvec3) GroupNonUniformFAdd 34 ExclusiveScan 1502 + 1504: 132(ptr) AccessChain 27(data) 1499 59 + 1505: 23(fvec4) Load 1504 + 1506: 23(fvec4) VectorShuffle 1505 1503 4 5 6 3 + Store 1504 1506 + 1507: 6(int) Load 8(invocation) + 1508: 132(ptr) AccessChain 27(data) 59 59 + 1509: 23(fvec4) Load 1508 + 1510: 23(fvec4) GroupNonUniformFAdd 34 ExclusiveScan 1509 + 1511: 132(ptr) AccessChain 27(data) 1507 59 + Store 1511 1510 + 1512: 6(int) Load 8(invocation) + 1513: 31(ptr) AccessChain 27(data) 29 29 30 + 1514: 17(float) Load 1513 + 1515: 17(float) GroupNonUniformFMul 34 ExclusiveScan 1514 + 1516: 31(ptr) AccessChain 27(data) 1512 29 30 + Store 1516 1515 + 1517: 6(int) Load 8(invocation) + 1518: 40(ptr) AccessChain 27(data) 38 29 + 1519: 18(fvec4) Load 1518 + 1520: 39(fvec2) VectorShuffle 1519 1519 0 1 + 1521: 39(fvec2) GroupNonUniformFMul 34 ExclusiveScan 1520 + 1522: 40(ptr) AccessChain 27(data) 1517 29 + 1523: 18(fvec4) Load 1522 + 1524: 18(fvec4) VectorShuffle 1523 1521 4 5 2 3 + Store 1522 1524 + 1525: 6(int) Load 8(invocation) + 1526: 40(ptr) AccessChain 27(data) 49 29 + 1527: 18(fvec4) Load 1526 + 1528: 50(fvec3) VectorShuffle 1527 1527 0 1 2 + 1529: 50(fvec3) GroupNonUniformFMul 34 ExclusiveScan 1528 + 1530: 40(ptr) AccessChain 27(data) 1525 29 + 1531: 18(fvec4) Load 1530 + 1532: 18(fvec4) VectorShuffle 1531 1529 4 5 6 3 + Store 1530 1532 + 1533: 6(int) Load 8(invocation) + 1534: 40(ptr) AccessChain 27(data) 59 29 + 1535: 18(fvec4) Load 1534 + 1536: 18(fvec4) GroupNonUniformFMul 34 ExclusiveScan 1535 + 1537: 40(ptr) AccessChain 27(data) 1533 29 + Store 1537 1536 + 1538: 6(int) Load 8(invocation) + 1539: 65(ptr) AccessChain 27(data) 29 38 30 + 1540: 19(int) Load 1539 + 1541: 19(int) GroupNonUniformIMul 34 ExclusiveScan 1540 + 1542: 65(ptr) AccessChain 27(data) 1538 38 30 + Store 1542 1541 + 1543: 6(int) Load 8(invocation) + 1544: 72(ptr) AccessChain 27(data) 38 38 + 1545: 20(ivec4) Load 1544 + 1546: 71(ivec2) VectorShuffle 1545 1545 0 1 + 1547: 71(ivec2) GroupNonUniformIMul 34 ExclusiveScan 1546 + 1548: 72(ptr) AccessChain 27(data) 1543 38 + 1549: 20(ivec4) Load 1548 + 1550: 20(ivec4) VectorShuffle 1549 1547 4 5 2 3 + Store 1548 1550 + 1551: 6(int) Load 8(invocation) + 1552: 72(ptr) AccessChain 27(data) 49 38 + 1553: 20(ivec4) Load 1552 + 1554: 81(ivec3) VectorShuffle 1553 1553 0 1 2 + 1555: 81(ivec3) GroupNonUniformIMul 34 ExclusiveScan 1554 + 1556: 72(ptr) AccessChain 27(data) 1551 38 + 1557: 20(ivec4) Load 1556 + 1558: 20(ivec4) VectorShuffle 1557 1555 4 5 6 3 + Store 1556 1558 + 1559: 6(int) Load 8(invocation) + 1560: 72(ptr) AccessChain 27(data) 59 38 + 1561: 20(ivec4) Load 1560 + 1562: 20(ivec4) GroupNonUniformIMul 34 ExclusiveScan 1561 + 1563: 72(ptr) AccessChain 27(data) 1559 38 + Store 1563 1562 + 1564: 6(int) Load 8(invocation) + 1565: 95(ptr) AccessChain 27(data) 29 49 30 + 1566: 6(int) Load 1565 + 1567: 6(int) GroupNonUniformIMul 34 ExclusiveScan 1566 + 1568: 95(ptr) AccessChain 27(data) 1564 49 30 + Store 1568 1567 + 1569: 6(int) Load 8(invocation) + 1570: 102(ptr) AccessChain 27(data) 38 49 + 1571: 21(ivec4) Load 1570 + 1572: 101(ivec2) VectorShuffle 1571 1571 0 1 + 1573: 101(ivec2) GroupNonUniformIMul 34 ExclusiveScan 1572 + 1574: 102(ptr) AccessChain 27(data) 1569 49 + 1575: 21(ivec4) Load 1574 + 1576: 21(ivec4) VectorShuffle 1575 1573 4 5 2 3 + Store 1574 1576 + 1577: 6(int) Load 8(invocation) + 1578: 102(ptr) AccessChain 27(data) 49 49 + 1579: 21(ivec4) Load 1578 + 1580: 111(ivec3) VectorShuffle 1579 1579 0 1 2 + 1581: 111(ivec3) GroupNonUniformIMul 34 ExclusiveScan 1580 + 1582: 102(ptr) AccessChain 27(data) 1577 49 + 1583: 21(ivec4) Load 1582 + 1584: 21(ivec4) VectorShuffle 1583 1581 4 5 6 3 + Store 1582 1584 + 1585: 6(int) Load 8(invocation) + 1586: 102(ptr) AccessChain 27(data) 59 49 + 1587: 21(ivec4) Load 1586 + 1588: 21(ivec4) GroupNonUniformIMul 34 ExclusiveScan 1587 + 1589: 102(ptr) AccessChain 27(data) 1585 49 + Store 1589 1588 + 1590: 6(int) Load 8(invocation) + 1591: 125(ptr) AccessChain 27(data) 29 59 30 + 1592: 22(float) Load 1591 + 1593: 22(float) GroupNonUniformFMul 34 ExclusiveScan 1592 + 1594: 125(ptr) AccessChain 27(data) 1590 59 30 + Store 1594 1593 + 1595: 6(int) Load 8(invocation) + 1596: 132(ptr) AccessChain 27(data) 38 59 + 1597: 23(fvec4) Load 1596 + 1598: 131(fvec2) VectorShuffle 1597 1597 0 1 + 1599: 131(fvec2) GroupNonUniformFMul 34 ExclusiveScan 1598 + 1600: 132(ptr) AccessChain 27(data) 1595 59 + 1601: 23(fvec4) Load 1600 + 1602: 23(fvec4) VectorShuffle 1601 1599 4 5 2 3 + Store 1600 1602 + 1603: 6(int) Load 8(invocation) + 1604: 132(ptr) AccessChain 27(data) 49 59 + 1605: 23(fvec4) Load 1604 + 1606: 141(fvec3) VectorShuffle 1605 1605 0 1 2 + 1607: 141(fvec3) GroupNonUniformFMul 34 ExclusiveScan 1606 + 1608: 132(ptr) AccessChain 27(data) 1603 59 + 1609: 23(fvec4) Load 1608 + 1610: 23(fvec4) VectorShuffle 1609 1607 4 5 6 3 + Store 1608 1610 + 1611: 6(int) Load 8(invocation) + 1612: 132(ptr) AccessChain 27(data) 59 59 + 1613: 23(fvec4) Load 1612 + 1614: 23(fvec4) GroupNonUniformFMul 34 ExclusiveScan 1613 + 1615: 132(ptr) AccessChain 27(data) 1611 59 + Store 1615 1614 + 1616: 6(int) Load 8(invocation) + 1617: 31(ptr) AccessChain 27(data) 29 29 30 + 1618: 17(float) Load 1617 + 1619: 17(float) GroupNonUniformFMin 34 ExclusiveScan 1618 + 1620: 31(ptr) AccessChain 27(data) 1616 29 30 + Store 1620 1619 + 1621: 6(int) Load 8(invocation) + 1622: 40(ptr) AccessChain 27(data) 38 29 + 1623: 18(fvec4) Load 1622 + 1624: 39(fvec2) VectorShuffle 1623 1623 0 1 + 1625: 39(fvec2) GroupNonUniformFMin 34 ExclusiveScan 1624 + 1626: 40(ptr) AccessChain 27(data) 1621 29 + 1627: 18(fvec4) Load 1626 + 1628: 18(fvec4) VectorShuffle 1627 1625 4 5 2 3 + Store 1626 1628 + 1629: 6(int) Load 8(invocation) + 1630: 40(ptr) AccessChain 27(data) 49 29 + 1631: 18(fvec4) Load 1630 + 1632: 50(fvec3) VectorShuffle 1631 1631 0 1 2 + 1633: 50(fvec3) GroupNonUniformFMin 34 ExclusiveScan 1632 + 1634: 40(ptr) AccessChain 27(data) 1629 29 + 1635: 18(fvec4) Load 1634 + 1636: 18(fvec4) VectorShuffle 1635 1633 4 5 6 3 + Store 1634 1636 + 1637: 6(int) Load 8(invocation) + 1638: 40(ptr) AccessChain 27(data) 59 29 + 1639: 18(fvec4) Load 1638 + 1640: 18(fvec4) GroupNonUniformFMin 34 ExclusiveScan 1639 + 1641: 40(ptr) AccessChain 27(data) 1637 29 + Store 1641 1640 + 1642: 6(int) Load 8(invocation) + 1643: 65(ptr) AccessChain 27(data) 29 38 30 + 1644: 19(int) Load 1643 + 1645: 19(int) GroupNonUniformSMin 34 ExclusiveScan 1644 + 1646: 65(ptr) AccessChain 27(data) 1642 38 30 + Store 1646 1645 + 1647: 6(int) Load 8(invocation) + 1648: 72(ptr) AccessChain 27(data) 38 38 + 1649: 20(ivec4) Load 1648 + 1650: 71(ivec2) VectorShuffle 1649 1649 0 1 + 1651: 71(ivec2) GroupNonUniformSMin 34 ExclusiveScan 1650 + 1652: 72(ptr) AccessChain 27(data) 1647 38 + 1653: 20(ivec4) Load 1652 + 1654: 20(ivec4) VectorShuffle 1653 1651 4 5 2 3 + Store 1652 1654 + 1655: 6(int) Load 8(invocation) + 1656: 72(ptr) AccessChain 27(data) 49 38 + 1657: 20(ivec4) Load 1656 + 1658: 81(ivec3) VectorShuffle 1657 1657 0 1 2 + 1659: 81(ivec3) GroupNonUniformSMin 34 ExclusiveScan 1658 + 1660: 72(ptr) AccessChain 27(data) 1655 38 + 1661: 20(ivec4) Load 1660 + 1662: 20(ivec4) VectorShuffle 1661 1659 4 5 6 3 + Store 1660 1662 + 1663: 6(int) Load 8(invocation) + 1664: 72(ptr) AccessChain 27(data) 59 38 + 1665: 20(ivec4) Load 1664 + 1666: 20(ivec4) GroupNonUniformSMin 34 ExclusiveScan 1665 + 1667: 72(ptr) AccessChain 27(data) 1663 38 + Store 1667 1666 + 1668: 6(int) Load 8(invocation) + 1669: 95(ptr) AccessChain 27(data) 29 49 30 + 1670: 6(int) Load 1669 + 1671: 6(int) GroupNonUniformUMin 34 ExclusiveScan 1670 + 1672: 95(ptr) AccessChain 27(data) 1668 49 30 + Store 1672 1671 + 1673: 6(int) Load 8(invocation) + 1674: 102(ptr) AccessChain 27(data) 38 49 + 1675: 21(ivec4) Load 1674 + 1676: 101(ivec2) VectorShuffle 1675 1675 0 1 + 1677: 101(ivec2) GroupNonUniformUMin 34 ExclusiveScan 1676 + 1678: 102(ptr) AccessChain 27(data) 1673 49 + 1679: 21(ivec4) Load 1678 + 1680: 21(ivec4) VectorShuffle 1679 1677 4 5 2 3 + Store 1678 1680 + 1681: 6(int) Load 8(invocation) + 1682: 102(ptr) AccessChain 27(data) 49 49 + 1683: 21(ivec4) Load 1682 + 1684: 111(ivec3) VectorShuffle 1683 1683 0 1 2 + 1685: 111(ivec3) GroupNonUniformUMin 34 ExclusiveScan 1684 + 1686: 102(ptr) AccessChain 27(data) 1681 49 + 1687: 21(ivec4) Load 1686 + 1688: 21(ivec4) VectorShuffle 1687 1685 4 5 6 3 + Store 1686 1688 + 1689: 6(int) Load 8(invocation) + 1690: 102(ptr) AccessChain 27(data) 59 49 + 1691: 21(ivec4) Load 1690 + 1692: 21(ivec4) GroupNonUniformUMin 34 ExclusiveScan 1691 + 1693: 102(ptr) AccessChain 27(data) 1689 49 + Store 1693 1692 + 1694: 6(int) Load 8(invocation) + 1695: 125(ptr) AccessChain 27(data) 29 59 30 + 1696: 22(float) Load 1695 + 1697: 22(float) GroupNonUniformFMin 34 ExclusiveScan 1696 + 1698: 125(ptr) AccessChain 27(data) 1694 59 30 + Store 1698 1697 + 1699: 6(int) Load 8(invocation) + 1700: 132(ptr) AccessChain 27(data) 38 59 + 1701: 23(fvec4) Load 1700 + 1702: 131(fvec2) VectorShuffle 1701 1701 0 1 + 1703: 131(fvec2) GroupNonUniformFMin 34 ExclusiveScan 1702 + 1704: 132(ptr) AccessChain 27(data) 1699 59 + 1705: 23(fvec4) Load 1704 + 1706: 23(fvec4) VectorShuffle 1705 1703 4 5 2 3 + Store 1704 1706 + 1707: 6(int) Load 8(invocation) + 1708: 132(ptr) AccessChain 27(data) 49 59 + 1709: 23(fvec4) Load 1708 + 1710: 141(fvec3) VectorShuffle 1709 1709 0 1 2 + 1711: 141(fvec3) GroupNonUniformFMin 34 ExclusiveScan 1710 + 1712: 132(ptr) AccessChain 27(data) 1707 59 + 1713: 23(fvec4) Load 1712 + 1714: 23(fvec4) VectorShuffle 1713 1711 4 5 6 3 + Store 1712 1714 + 1715: 6(int) Load 8(invocation) + 1716: 132(ptr) AccessChain 27(data) 59 59 + 1717: 23(fvec4) Load 1716 + 1718: 23(fvec4) GroupNonUniformFMin 34 ExclusiveScan 1717 + 1719: 132(ptr) AccessChain 27(data) 1715 59 + Store 1719 1718 + 1720: 6(int) Load 8(invocation) + 1721: 31(ptr) AccessChain 27(data) 29 29 30 + 1722: 17(float) Load 1721 + 1723: 17(float) GroupNonUniformFMax 34 ExclusiveScan 1722 + 1724: 31(ptr) AccessChain 27(data) 1720 29 30 + Store 1724 1723 + 1725: 6(int) Load 8(invocation) + 1726: 40(ptr) AccessChain 27(data) 38 29 + 1727: 18(fvec4) Load 1726 + 1728: 39(fvec2) VectorShuffle 1727 1727 0 1 + 1729: 39(fvec2) GroupNonUniformFMax 34 ExclusiveScan 1728 + 1730: 40(ptr) AccessChain 27(data) 1725 29 + 1731: 18(fvec4) Load 1730 + 1732: 18(fvec4) VectorShuffle 1731 1729 4 5 2 3 + Store 1730 1732 + 1733: 6(int) Load 8(invocation) + 1734: 40(ptr) AccessChain 27(data) 49 29 + 1735: 18(fvec4) Load 1734 + 1736: 50(fvec3) VectorShuffle 1735 1735 0 1 2 + 1737: 50(fvec3) GroupNonUniformFMax 34 ExclusiveScan 1736 + 1738: 40(ptr) AccessChain 27(data) 1733 29 + 1739: 18(fvec4) Load 1738 + 1740: 18(fvec4) VectorShuffle 1739 1737 4 5 6 3 + Store 1738 1740 + 1741: 6(int) Load 8(invocation) + 1742: 40(ptr) AccessChain 27(data) 59 29 + 1743: 18(fvec4) Load 1742 + 1744: 18(fvec4) GroupNonUniformFMax 34 ExclusiveScan 1743 + 1745: 40(ptr) AccessChain 27(data) 1741 29 + Store 1745 1744 + 1746: 6(int) Load 8(invocation) + 1747: 65(ptr) AccessChain 27(data) 29 38 30 + 1748: 19(int) Load 1747 + 1749: 19(int) GroupNonUniformSMax 34 ExclusiveScan 1748 + 1750: 65(ptr) AccessChain 27(data) 1746 38 30 + Store 1750 1749 + 1751: 6(int) Load 8(invocation) + 1752: 72(ptr) AccessChain 27(data) 38 38 + 1753: 20(ivec4) Load 1752 + 1754: 71(ivec2) VectorShuffle 1753 1753 0 1 + 1755: 71(ivec2) GroupNonUniformSMax 34 ExclusiveScan 1754 + 1756: 72(ptr) AccessChain 27(data) 1751 38 + 1757: 20(ivec4) Load 1756 + 1758: 20(ivec4) VectorShuffle 1757 1755 4 5 2 3 + Store 1756 1758 + 1759: 6(int) Load 8(invocation) + 1760: 72(ptr) AccessChain 27(data) 49 38 + 1761: 20(ivec4) Load 1760 + 1762: 81(ivec3) VectorShuffle 1761 1761 0 1 2 + 1763: 81(ivec3) GroupNonUniformSMax 34 ExclusiveScan 1762 + 1764: 72(ptr) AccessChain 27(data) 1759 38 + 1765: 20(ivec4) Load 1764 + 1766: 20(ivec4) VectorShuffle 1765 1763 4 5 6 3 + Store 1764 1766 + 1767: 6(int) Load 8(invocation) + 1768: 72(ptr) AccessChain 27(data) 59 38 + 1769: 20(ivec4) Load 1768 + 1770: 20(ivec4) GroupNonUniformSMax 34 ExclusiveScan 1769 + 1771: 72(ptr) AccessChain 27(data) 1767 38 + Store 1771 1770 + 1772: 6(int) Load 8(invocation) + 1773: 95(ptr) AccessChain 27(data) 29 49 30 + 1774: 6(int) Load 1773 + 1775: 6(int) GroupNonUniformUMax 34 ExclusiveScan 1774 + 1776: 95(ptr) AccessChain 27(data) 1772 49 30 + Store 1776 1775 + 1777: 6(int) Load 8(invocation) + 1778: 102(ptr) AccessChain 27(data) 38 49 + 1779: 21(ivec4) Load 1778 + 1780: 101(ivec2) VectorShuffle 1779 1779 0 1 + 1781: 101(ivec2) GroupNonUniformUMax 34 ExclusiveScan 1780 + 1782: 102(ptr) AccessChain 27(data) 1777 49 + 1783: 21(ivec4) Load 1782 + 1784: 21(ivec4) VectorShuffle 1783 1781 4 5 2 3 + Store 1782 1784 + 1785: 6(int) Load 8(invocation) + 1786: 102(ptr) AccessChain 27(data) 49 49 + 1787: 21(ivec4) Load 1786 + 1788: 111(ivec3) VectorShuffle 1787 1787 0 1 2 + 1789: 111(ivec3) GroupNonUniformUMax 34 ExclusiveScan 1788 + 1790: 102(ptr) AccessChain 27(data) 1785 49 + 1791: 21(ivec4) Load 1790 + 1792: 21(ivec4) VectorShuffle 1791 1789 4 5 6 3 + Store 1790 1792 + 1793: 6(int) Load 8(invocation) + 1794: 102(ptr) AccessChain 27(data) 59 49 + 1795: 21(ivec4) Load 1794 + 1796: 21(ivec4) GroupNonUniformUMax 34 ExclusiveScan 1795 + 1797: 102(ptr) AccessChain 27(data) 1793 49 + Store 1797 1796 + 1798: 6(int) Load 8(invocation) + 1799: 125(ptr) AccessChain 27(data) 29 59 30 + 1800: 22(float) Load 1799 + 1801: 22(float) GroupNonUniformFMax 34 ExclusiveScan 1800 + 1802: 125(ptr) AccessChain 27(data) 1798 59 30 + Store 1802 1801 + 1803: 6(int) Load 8(invocation) + 1804: 132(ptr) AccessChain 27(data) 38 59 + 1805: 23(fvec4) Load 1804 + 1806: 131(fvec2) VectorShuffle 1805 1805 0 1 + 1807: 131(fvec2) GroupNonUniformFMax 34 ExclusiveScan 1806 + 1808: 132(ptr) AccessChain 27(data) 1803 59 + 1809: 23(fvec4) Load 1808 + 1810: 23(fvec4) VectorShuffle 1809 1807 4 5 2 3 + Store 1808 1810 + 1811: 6(int) Load 8(invocation) + 1812: 132(ptr) AccessChain 27(data) 49 59 + 1813: 23(fvec4) Load 1812 + 1814: 141(fvec3) VectorShuffle 1813 1813 0 1 2 + 1815: 141(fvec3) GroupNonUniformFMax 34 ExclusiveScan 1814 + 1816: 132(ptr) AccessChain 27(data) 1811 59 + 1817: 23(fvec4) Load 1816 + 1818: 23(fvec4) VectorShuffle 1817 1815 4 5 6 3 + Store 1816 1818 + 1819: 6(int) Load 8(invocation) + 1820: 132(ptr) AccessChain 27(data) 59 59 + 1821: 23(fvec4) Load 1820 + 1822: 23(fvec4) GroupNonUniformFMax 34 ExclusiveScan 1821 + 1823: 132(ptr) AccessChain 27(data) 1819 59 + Store 1823 1822 + 1824: 6(int) Load 8(invocation) + 1825: 65(ptr) AccessChain 27(data) 29 38 30 + 1826: 19(int) Load 1825 + 1827: 19(int) GroupNonUniformBitwiseAnd 34 ExclusiveScan 1826 + 1828: 65(ptr) AccessChain 27(data) 1824 38 30 + Store 1828 1827 + 1829: 6(int) Load 8(invocation) + 1830: 72(ptr) AccessChain 27(data) 38 38 + 1831: 20(ivec4) Load 1830 + 1832: 71(ivec2) VectorShuffle 1831 1831 0 1 + 1833: 71(ivec2) GroupNonUniformBitwiseAnd 34 ExclusiveScan 1832 + 1834: 72(ptr) AccessChain 27(data) 1829 38 + 1835: 20(ivec4) Load 1834 + 1836: 20(ivec4) VectorShuffle 1835 1833 4 5 2 3 + Store 1834 1836 + 1837: 6(int) Load 8(invocation) + 1838: 72(ptr) AccessChain 27(data) 49 38 + 1839: 20(ivec4) Load 1838 + 1840: 81(ivec3) VectorShuffle 1839 1839 0 1 2 + 1841: 81(ivec3) GroupNonUniformBitwiseAnd 34 ExclusiveScan 1840 + 1842: 72(ptr) AccessChain 27(data) 1837 38 + 1843: 20(ivec4) Load 1842 + 1844: 20(ivec4) VectorShuffle 1843 1841 4 5 6 3 + Store 1842 1844 + 1845: 6(int) Load 8(invocation) + 1846: 72(ptr) AccessChain 27(data) 59 38 + 1847: 20(ivec4) Load 1846 + 1848: 20(ivec4) GroupNonUniformBitwiseAnd 34 ExclusiveScan 1847 + 1849: 72(ptr) AccessChain 27(data) 1845 38 + Store 1849 1848 + 1850: 6(int) Load 8(invocation) + 1851: 95(ptr) AccessChain 27(data) 29 49 30 + 1852: 6(int) Load 1851 + 1853: 6(int) GroupNonUniformBitwiseAnd 34 ExclusiveScan 1852 + 1854: 95(ptr) AccessChain 27(data) 1850 49 30 + Store 1854 1853 + 1855: 6(int) Load 8(invocation) + 1856: 102(ptr) AccessChain 27(data) 38 49 + 1857: 21(ivec4) Load 1856 + 1858: 101(ivec2) VectorShuffle 1857 1857 0 1 + 1859: 101(ivec2) GroupNonUniformBitwiseAnd 34 ExclusiveScan 1858 + 1860: 102(ptr) AccessChain 27(data) 1855 49 + 1861: 21(ivec4) Load 1860 + 1862: 21(ivec4) VectorShuffle 1861 1859 4 5 2 3 + Store 1860 1862 + 1863: 6(int) Load 8(invocation) + 1864: 102(ptr) AccessChain 27(data) 49 49 + 1865: 21(ivec4) Load 1864 + 1866: 111(ivec3) VectorShuffle 1865 1865 0 1 2 + 1867: 111(ivec3) GroupNonUniformBitwiseAnd 34 ExclusiveScan 1866 + 1868: 102(ptr) AccessChain 27(data) 1863 49 + 1869: 21(ivec4) Load 1868 + 1870: 21(ivec4) VectorShuffle 1869 1867 4 5 6 3 + Store 1868 1870 + 1871: 6(int) Load 8(invocation) + 1872: 102(ptr) AccessChain 27(data) 59 49 + 1873: 21(ivec4) Load 1872 + 1874: 21(ivec4) GroupNonUniformBitwiseAnd 34 ExclusiveScan 1873 + 1875: 102(ptr) AccessChain 27(data) 1871 49 + Store 1875 1874 + 1876: 6(int) Load 8(invocation) + 1877: 65(ptr) AccessChain 27(data) 29 38 30 + 1878: 19(int) Load 1877 + 1879: 521(bool) SLessThan 1878 29 + 1880: 521(bool) GroupNonUniformLogicalAnd 34 ExclusiveScan 1879 + 1881: 19(int) Select 1880 38 29 + 1882: 65(ptr) AccessChain 27(data) 1876 38 30 + Store 1882 1881 + 1883: 6(int) Load 8(invocation) + 1884: 72(ptr) AccessChain 27(data) 38 38 + 1885: 20(ivec4) Load 1884 + 1886: 71(ivec2) VectorShuffle 1885 1885 0 1 + 1887: 531(bvec2) SLessThan 1886 530 + 1888: 531(bvec2) GroupNonUniformLogicalAnd 34 ExclusiveScan 1887 + 1889: 71(ivec2) Select 1888 534 530 + 1890: 72(ptr) AccessChain 27(data) 1883 38 + 1891: 20(ivec4) Load 1890 + 1892: 20(ivec4) VectorShuffle 1891 1889 4 5 2 3 + Store 1890 1892 + 1893: 6(int) Load 8(invocation) + 1894: 72(ptr) AccessChain 27(data) 38 38 + 1895: 20(ivec4) Load 1894 + 1896: 81(ivec3) VectorShuffle 1895 1895 0 1 2 + 1897: 544(bvec3) SLessThan 1896 543 + 1898: 544(bvec3) GroupNonUniformLogicalAnd 34 ExclusiveScan 1897 + 1899: 81(ivec3) Select 1898 547 543 + 1900: 72(ptr) AccessChain 27(data) 1893 38 + 1901: 20(ivec4) Load 1900 + 1902: 20(ivec4) VectorShuffle 1901 1899 4 5 6 3 + Store 1900 1902 + 1903: 6(int) Load 8(invocation) + 1904: 72(ptr) AccessChain 27(data) 38 38 + 1905: 20(ivec4) Load 1904 + 1906: 556(bvec4) SLessThan 1905 555 + 1907: 556(bvec4) GroupNonUniformLogicalAnd 34 ExclusiveScan 1906 + 1908: 20(ivec4) Select 1907 559 555 + 1909: 72(ptr) AccessChain 27(data) 1903 38 + Store 1909 1908 + 1910: 6(int) Load 8(invocation) + 1911: 65(ptr) AccessChain 27(data) 29 38 30 + 1912: 19(int) Load 1911 + 1913: 19(int) GroupNonUniformBitwiseOr 34 ExclusiveScan 1912 + 1914: 65(ptr) AccessChain 27(data) 1910 38 30 + Store 1914 1913 + 1915: 6(int) Load 8(invocation) + 1916: 72(ptr) AccessChain 27(data) 38 38 + 1917: 20(ivec4) Load 1916 + 1918: 71(ivec2) VectorShuffle 1917 1917 0 1 + 1919: 71(ivec2) GroupNonUniformBitwiseOr 34 ExclusiveScan 1918 + 1920: 72(ptr) AccessChain 27(data) 1915 38 + 1921: 20(ivec4) Load 1920 + 1922: 20(ivec4) VectorShuffle 1921 1919 4 5 2 3 + Store 1920 1922 + 1923: 6(int) Load 8(invocation) + 1924: 72(ptr) AccessChain 27(data) 49 38 + 1925: 20(ivec4) Load 1924 + 1926: 81(ivec3) VectorShuffle 1925 1925 0 1 2 + 1927: 81(ivec3) GroupNonUniformBitwiseOr 34 ExclusiveScan 1926 + 1928: 72(ptr) AccessChain 27(data) 1923 38 + 1929: 20(ivec4) Load 1928 + 1930: 20(ivec4) VectorShuffle 1929 1927 4 5 6 3 + Store 1928 1930 + 1931: 6(int) Load 8(invocation) + 1932: 72(ptr) AccessChain 27(data) 59 38 + 1933: 20(ivec4) Load 1932 + 1934: 20(ivec4) GroupNonUniformBitwiseOr 34 ExclusiveScan 1933 + 1935: 72(ptr) AccessChain 27(data) 1931 38 + Store 1935 1934 + 1936: 6(int) Load 8(invocation) + 1937: 95(ptr) AccessChain 27(data) 29 49 30 + 1938: 6(int) Load 1937 + 1939: 6(int) GroupNonUniformBitwiseOr 34 ExclusiveScan 1938 + 1940: 95(ptr) AccessChain 27(data) 1936 49 30 + Store 1940 1939 + 1941: 6(int) Load 8(invocation) + 1942: 102(ptr) AccessChain 27(data) 38 49 + 1943: 21(ivec4) Load 1942 + 1944: 101(ivec2) VectorShuffle 1943 1943 0 1 + 1945: 101(ivec2) GroupNonUniformBitwiseOr 34 ExclusiveScan 1944 + 1946: 102(ptr) AccessChain 27(data) 1941 49 + 1947: 21(ivec4) Load 1946 + 1948: 21(ivec4) VectorShuffle 1947 1945 4 5 2 3 + Store 1946 1948 + 1949: 6(int) Load 8(invocation) + 1950: 102(ptr) AccessChain 27(data) 49 49 + 1951: 21(ivec4) Load 1950 + 1952: 111(ivec3) VectorShuffle 1951 1951 0 1 2 + 1953: 111(ivec3) GroupNonUniformBitwiseOr 34 ExclusiveScan 1952 + 1954: 102(ptr) AccessChain 27(data) 1949 49 + 1955: 21(ivec4) Load 1954 + 1956: 21(ivec4) VectorShuffle 1955 1953 4 5 6 3 + Store 1954 1956 + 1957: 6(int) Load 8(invocation) + 1958: 102(ptr) AccessChain 27(data) 59 49 + 1959: 21(ivec4) Load 1958 + 1960: 21(ivec4) GroupNonUniformBitwiseOr 34 ExclusiveScan 1959 + 1961: 102(ptr) AccessChain 27(data) 1957 49 + Store 1961 1960 + 1962: 6(int) Load 8(invocation) + 1963: 65(ptr) AccessChain 27(data) 29 38 30 + 1964: 19(int) Load 1963 + 1965: 521(bool) SLessThan 1964 29 + 1966: 521(bool) GroupNonUniformLogicalOr 34 ExclusiveScan 1965 + 1967: 19(int) Select 1966 38 29 + 1968: 65(ptr) AccessChain 27(data) 1962 38 30 + Store 1968 1967 + 1969: 6(int) Load 8(invocation) + 1970: 72(ptr) AccessChain 27(data) 38 38 + 1971: 20(ivec4) Load 1970 + 1972: 71(ivec2) VectorShuffle 1971 1971 0 1 + 1973: 531(bvec2) SLessThan 1972 530 + 1974: 531(bvec2) GroupNonUniformLogicalOr 34 ExclusiveScan 1973 + 1975: 71(ivec2) Select 1974 534 530 + 1976: 72(ptr) AccessChain 27(data) 1969 38 + 1977: 20(ivec4) Load 1976 + 1978: 20(ivec4) VectorShuffle 1977 1975 4 5 2 3 + Store 1976 1978 + 1979: 6(int) Load 8(invocation) + 1980: 72(ptr) AccessChain 27(data) 38 38 + 1981: 20(ivec4) Load 1980 + 1982: 81(ivec3) VectorShuffle 1981 1981 0 1 2 + 1983: 544(bvec3) SLessThan 1982 543 + 1984: 544(bvec3) GroupNonUniformLogicalOr 34 ExclusiveScan 1983 + 1985: 81(ivec3) Select 1984 547 543 + 1986: 72(ptr) AccessChain 27(data) 1979 38 + 1987: 20(ivec4) Load 1986 + 1988: 20(ivec4) VectorShuffle 1987 1985 4 5 6 3 + Store 1986 1988 + 1989: 6(int) Load 8(invocation) + 1990: 72(ptr) AccessChain 27(data) 38 38 + 1991: 20(ivec4) Load 1990 + 1992: 556(bvec4) SLessThan 1991 555 + 1993: 556(bvec4) GroupNonUniformLogicalOr 34 ExclusiveScan 1992 + 1994: 20(ivec4) Select 1993 559 555 + 1995: 72(ptr) AccessChain 27(data) 1989 38 + Store 1995 1994 + 1996: 6(int) Load 8(invocation) + 1997: 65(ptr) AccessChain 27(data) 29 38 30 + 1998: 19(int) Load 1997 + 1999: 19(int) GroupNonUniformBitwiseXor 34 ExclusiveScan 1998 + 2000: 65(ptr) AccessChain 27(data) 1996 38 30 + Store 2000 1999 + 2001: 6(int) Load 8(invocation) + 2002: 72(ptr) AccessChain 27(data) 38 38 + 2003: 20(ivec4) Load 2002 + 2004: 71(ivec2) VectorShuffle 2003 2003 0 1 + 2005: 71(ivec2) GroupNonUniformBitwiseXor 34 ExclusiveScan 2004 + 2006: 72(ptr) AccessChain 27(data) 2001 38 + 2007: 20(ivec4) Load 2006 + 2008: 20(ivec4) VectorShuffle 2007 2005 4 5 2 3 + Store 2006 2008 + 2009: 6(int) Load 8(invocation) + 2010: 72(ptr) AccessChain 27(data) 49 38 + 2011: 20(ivec4) Load 2010 + 2012: 81(ivec3) VectorShuffle 2011 2011 0 1 2 + 2013: 81(ivec3) GroupNonUniformBitwiseXor 34 ExclusiveScan 2012 + 2014: 72(ptr) AccessChain 27(data) 2009 38 + 2015: 20(ivec4) Load 2014 + 2016: 20(ivec4) VectorShuffle 2015 2013 4 5 6 3 + Store 2014 2016 + 2017: 6(int) Load 8(invocation) + 2018: 72(ptr) AccessChain 27(data) 59 38 + 2019: 20(ivec4) Load 2018 + 2020: 20(ivec4) GroupNonUniformBitwiseXor 34 ExclusiveScan 2019 + 2021: 72(ptr) AccessChain 27(data) 2017 38 + Store 2021 2020 + 2022: 6(int) Load 8(invocation) + 2023: 95(ptr) AccessChain 27(data) 29 49 30 + 2024: 6(int) Load 2023 + 2025: 6(int) GroupNonUniformBitwiseXor 34 ExclusiveScan 2024 + 2026: 95(ptr) AccessChain 27(data) 2022 49 30 + Store 2026 2025 + 2027: 6(int) Load 8(invocation) + 2028: 102(ptr) AccessChain 27(data) 38 49 + 2029: 21(ivec4) Load 2028 + 2030: 101(ivec2) VectorShuffle 2029 2029 0 1 + 2031: 101(ivec2) GroupNonUniformBitwiseXor 34 ExclusiveScan 2030 + 2032: 102(ptr) AccessChain 27(data) 2027 49 + 2033: 21(ivec4) Load 2032 + 2034: 21(ivec4) VectorShuffle 2033 2031 4 5 2 3 + Store 2032 2034 + 2035: 6(int) Load 8(invocation) + 2036: 102(ptr) AccessChain 27(data) 49 49 + 2037: 21(ivec4) Load 2036 + 2038: 111(ivec3) VectorShuffle 2037 2037 0 1 2 + 2039: 111(ivec3) GroupNonUniformBitwiseXor 34 ExclusiveScan 2038 + 2040: 102(ptr) AccessChain 27(data) 2035 49 + 2041: 21(ivec4) Load 2040 + 2042: 21(ivec4) VectorShuffle 2041 2039 4 5 6 3 + Store 2040 2042 + 2043: 6(int) Load 8(invocation) + 2044: 102(ptr) AccessChain 27(data) 59 49 + 2045: 21(ivec4) Load 2044 + 2046: 21(ivec4) GroupNonUniformBitwiseXor 34 ExclusiveScan 2045 + 2047: 102(ptr) AccessChain 27(data) 2043 49 + Store 2047 2046 + 2048: 6(int) Load 8(invocation) + 2049: 65(ptr) AccessChain 27(data) 29 38 30 + 2050: 19(int) Load 2049 + 2051: 521(bool) SLessThan 2050 29 + 2052: 521(bool) GroupNonUniformLogicalXor 34 ExclusiveScan 2051 + 2053: 19(int) Select 2052 38 29 + 2054: 65(ptr) AccessChain 27(data) 2048 38 30 + Store 2054 2053 + 2055: 6(int) Load 8(invocation) + 2056: 72(ptr) AccessChain 27(data) 38 38 + 2057: 20(ivec4) Load 2056 + 2058: 71(ivec2) VectorShuffle 2057 2057 0 1 + 2059: 531(bvec2) SLessThan 2058 530 + 2060: 531(bvec2) GroupNonUniformLogicalXor 34 ExclusiveScan 2059 + 2061: 71(ivec2) Select 2060 534 530 + 2062: 72(ptr) AccessChain 27(data) 2055 38 + 2063: 20(ivec4) Load 2062 + 2064: 20(ivec4) VectorShuffle 2063 2061 4 5 2 3 + Store 2062 2064 + 2065: 6(int) Load 8(invocation) + 2066: 72(ptr) AccessChain 27(data) 38 38 + 2067: 20(ivec4) Load 2066 + 2068: 81(ivec3) VectorShuffle 2067 2067 0 1 2 + 2069: 544(bvec3) SLessThan 2068 543 + 2070: 544(bvec3) GroupNonUniformLogicalXor 34 ExclusiveScan 2069 + 2071: 81(ivec3) Select 2070 547 543 + 2072: 72(ptr) AccessChain 27(data) 2065 38 + 2073: 20(ivec4) Load 2072 + 2074: 20(ivec4) VectorShuffle 2073 2071 4 5 6 3 + Store 2072 2074 + 2075: 6(int) Load 8(invocation) + 2076: 72(ptr) AccessChain 27(data) 38 38 + 2077: 20(ivec4) Load 2076 + 2078: 556(bvec4) SLessThan 2077 555 + 2079: 556(bvec4) GroupNonUniformLogicalXor 34 ExclusiveScan 2078 + 2080: 20(ivec4) Select 2079 559 555 + 2081: 72(ptr) AccessChain 27(data) 2075 38 + Store 2081 2080 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupBallot.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupBallot.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupBallot.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupBallot.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,525 @@ +spv.subgroupBallot.comp +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 417 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformBallot + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 10 12 21 23 26 29 32 + ExecutionMode 4 LocalSize 8 8 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_ballot" + SourceExtension "GL_KHR_shader_subgroup_basic" + Name 4 "main" + Name 8 "invocation" + Name 10 "gl_SubgroupInvocationID" + Name 12 "gl_SubgroupSize" + Name 19 "relMask" + Name 21 "gl_SubgroupEqMask" + Name 23 "gl_SubgroupGeMask" + Name 26 "gl_SubgroupGtMask" + Name 29 "gl_SubgroupLeMask" + Name 32 "gl_SubgroupLtMask" + Name 35 "result" + Name 46 "Buffers" + MemberName 46(Buffers) 0 "f4" + MemberName 46(Buffers) 1 "i4" + MemberName 46(Buffers) 2 "u4" + MemberName 46(Buffers) 3 "d4" + Name 49 "data" + Decorate 10(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 10(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 11 RelaxedPrecision + Decorate 12(gl_SubgroupSize) RelaxedPrecision + Decorate 12(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 13 RelaxedPrecision + Decorate 14 RelaxedPrecision + Decorate 16 RelaxedPrecision + Decorate 21(gl_SubgroupEqMask) BuiltIn SubgroupEqMaskKHR + Decorate 23(gl_SubgroupGeMask) BuiltIn SubgroupGeMaskKHR + Decorate 26(gl_SubgroupGtMask) BuiltIn SubgroupGtMaskKHR + Decorate 29(gl_SubgroupLeMask) BuiltIn SubgroupLeMaskKHR + Decorate 32(gl_SubgroupLtMask) BuiltIn SubgroupLtMaskKHR + MemberDecorate 46(Buffers) 0 Offset 0 + MemberDecorate 46(Buffers) 1 Offset 16 + MemberDecorate 46(Buffers) 2 Offset 32 + MemberDecorate 46(Buffers) 3 Offset 64 + Decorate 46(Buffers) BufferBlock + Decorate 49(data) DescriptorSet 0 + Decorate 49(data) Binding 0 + Decorate 416 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_SubgroupInvocationID): 9(ptr) Variable Input +12(gl_SubgroupSize): 9(ptr) Variable Input + 15: 6(int) Constant 4 + 17: TypeVector 6(int) 4 + 18: TypePointer Function 17(ivec4) + 20: TypePointer Input 17(ivec4) +21(gl_SubgroupEqMask): 20(ptr) Variable Input +23(gl_SubgroupGeMask): 20(ptr) Variable Input +26(gl_SubgroupGtMask): 20(ptr) Variable Input +29(gl_SubgroupLeMask): 20(ptr) Variable Input +32(gl_SubgroupLtMask): 20(ptr) Variable Input + 36: TypeBool + 37: 36(bool) ConstantTrue + 38: 6(int) Constant 3 + 40: TypeFloat 32 + 41: TypeVector 40(float) 4 + 42: TypeInt 32 1 + 43: TypeVector 42(int) 4 + 44: TypeFloat 64 + 45: TypeVector 44(float) 4 + 46(Buffers): TypeStruct 41(fvec4) 43(ivec4) 17(ivec4) 45(fvec4) + 47: TypeArray 46(Buffers) 15 + 48: TypePointer Uniform 47 + 49(data): 48(ptr) Variable Uniform + 51: 42(int) Constant 2 + 54: 6(int) Constant 0 + 55: TypePointer Uniform 6(int) + 60: 42(int) Constant 1 + 61: 42(int) Constant 0 + 64: 6(int) Constant 1 + 72: 6(int) Constant 2 + 83: TypeVector 36(bool) 4 + 88: TypePointer Uniform 17(ivec4) + 96: TypePointer Uniform 40(float) + 103: TypeVector 40(float) 2 + 104: TypePointer Uniform 41(fvec4) + 114: TypeVector 40(float) 3 + 124: 42(int) Constant 3 + 131: TypePointer Uniform 42(int) + 138: TypeVector 42(int) 2 + 139: TypePointer Uniform 43(ivec4) + 149: TypeVector 42(int) 3 + 171: TypeVector 6(int) 2 + 181: TypeVector 6(int) 3 + 197: TypePointer Uniform 44(float) + 204: TypeVector 44(float) 2 + 205: TypePointer Uniform 45(fvec4) + 215: TypeVector 44(float) 3 + 242: 138(ivec2) ConstantComposite 61 61 + 243: TypeVector 36(bool) 2 + 247: 138(ivec2) ConstantComposite 60 60 + 256: 149(ivec3) ConstantComposite 61 61 61 + 257: TypeVector 36(bool) 3 + 261: 149(ivec3) ConstantComposite 60 60 60 + 269: 43(ivec4) ConstantComposite 61 61 61 61 + 273: 43(ivec4) ConstantComposite 60 60 60 60 + 415: 6(int) Constant 8 + 416: 181(ivec3) ConstantComposite 415 415 64 + 4(main): 2 Function None 3 + 5: Label + 8(invocation): 7(ptr) Variable Function + 19(relMask): 18(ptr) Variable Function + 35(result): 18(ptr) Variable Function + 11: 6(int) Load 10(gl_SubgroupInvocationID) + 13: 6(int) Load 12(gl_SubgroupSize) + 14: 6(int) IAdd 11 13 + 16: 6(int) UMod 14 15 + Store 8(invocation) 16 + 22: 17(ivec4) Load 21(gl_SubgroupEqMask) + 24: 17(ivec4) Load 23(gl_SubgroupGeMask) + 25: 17(ivec4) IAdd 22 24 + 27: 17(ivec4) Load 26(gl_SubgroupGtMask) + 28: 17(ivec4) IAdd 25 27 + 30: 17(ivec4) Load 29(gl_SubgroupLeMask) + 31: 17(ivec4) IAdd 28 30 + 33: 17(ivec4) Load 32(gl_SubgroupLtMask) + 34: 17(ivec4) IAdd 31 33 + Store 19(relMask) 34 + 39: 17(ivec4) GroupNonUniformBallot 38 37 + Store 35(result) 39 + 50: 6(int) Load 8(invocation) + 52: 17(ivec4) Load 35(result) + 53: 6(int) GroupNonUniformBallotBitCount 38 Reduce 52 + 56: 55(ptr) AccessChain 49(data) 50 51 54 + Store 56 53 + 57: 6(int) Load 8(invocation) + 58: 17(ivec4) Load 35(result) + 59: 36(bool) GroupNonUniformBallotBitExtract 38 58 54 + 62: 42(int) Select 59 60 61 + 63: 6(int) Bitcast 62 + 65: 55(ptr) AccessChain 49(data) 57 51 64 + Store 65 63 + 66: 6(int) Load 8(invocation) + 67: 17(ivec4) Load 35(result) + 68: 6(int) GroupNonUniformBallotBitCount 38 InclusiveScan 67 + 69: 17(ivec4) Load 35(result) + 70: 6(int) GroupNonUniformBallotBitCount 38 ExclusiveScan 69 + 71: 6(int) IAdd 68 70 + 73: 55(ptr) AccessChain 49(data) 66 51 72 + Store 73 71 + 74: 6(int) Load 8(invocation) + 75: 17(ivec4) Load 35(result) + 76: 6(int) GroupNonUniformBallotFindLSB 38 75 + 77: 17(ivec4) Load 35(result) + 78: 6(int) GroupNonUniformBallotFindMSB 38 77 + 79: 6(int) IAdd 76 78 + 80: 55(ptr) AccessChain 49(data) 74 51 38 + Store 80 79 + 81: 17(ivec4) Load 19(relMask) + 82: 17(ivec4) Load 35(result) + 84: 83(bvec4) IEqual 81 82 + 85: 36(bool) All 84 + SelectionMerge 87 None + BranchConditional 85 86 87 + 86: Label + 89: 88(ptr) AccessChain 49(data) 61 51 + 90: 17(ivec4) Load 89 + 91: 36(bool) GroupNonUniformInverseBallot 38 90 + Branch 87 + 87: Label + 92: 36(bool) Phi 85 5 91 86 + SelectionMerge 94 None + BranchConditional 92 93 276 + 93: Label + 95: 6(int) Load 8(invocation) + 97: 96(ptr) AccessChain 49(data) 61 61 54 + 98: 40(float) Load 97 + 99: 6(int) Load 8(invocation) + 100: 40(float) GroupNonUniformBroadcast 38 98 99 + 101: 96(ptr) AccessChain 49(data) 95 61 54 + Store 101 100 + 102: 6(int) Load 8(invocation) + 105: 104(ptr) AccessChain 49(data) 60 61 + 106: 41(fvec4) Load 105 + 107: 103(fvec2) VectorShuffle 106 106 0 1 + 108: 6(int) Load 8(invocation) + 109: 103(fvec2) GroupNonUniformBroadcast 38 107 108 + 110: 104(ptr) AccessChain 49(data) 102 61 + 111: 41(fvec4) Load 110 + 112: 41(fvec4) VectorShuffle 111 109 4 5 2 3 + Store 110 112 + 113: 6(int) Load 8(invocation) + 115: 104(ptr) AccessChain 49(data) 51 61 + 116: 41(fvec4) Load 115 + 117: 114(fvec3) VectorShuffle 116 116 0 1 2 + 118: 6(int) Load 8(invocation) + 119: 114(fvec3) GroupNonUniformBroadcast 38 117 118 + 120: 104(ptr) AccessChain 49(data) 113 61 + 121: 41(fvec4) Load 120 + 122: 41(fvec4) VectorShuffle 121 119 4 5 6 3 + Store 120 122 + 123: 6(int) Load 8(invocation) + 125: 104(ptr) AccessChain 49(data) 124 61 + 126: 41(fvec4) Load 125 + 127: 6(int) Load 8(invocation) + 128: 41(fvec4) GroupNonUniformBroadcast 38 126 127 + 129: 104(ptr) AccessChain 49(data) 123 61 + Store 129 128 + 130: 6(int) Load 8(invocation) + 132: 131(ptr) AccessChain 49(data) 61 60 54 + 133: 42(int) Load 132 + 134: 6(int) Load 8(invocation) + 135: 42(int) GroupNonUniformBroadcast 38 133 134 + 136: 131(ptr) AccessChain 49(data) 130 60 54 + Store 136 135 + 137: 6(int) Load 8(invocation) + 140: 139(ptr) AccessChain 49(data) 60 60 + 141: 43(ivec4) Load 140 + 142: 138(ivec2) VectorShuffle 141 141 0 1 + 143: 6(int) Load 8(invocation) + 144: 138(ivec2) GroupNonUniformBroadcast 38 142 143 + 145: 139(ptr) AccessChain 49(data) 137 60 + 146: 43(ivec4) Load 145 + 147: 43(ivec4) VectorShuffle 146 144 4 5 2 3 + Store 145 147 + 148: 6(int) Load 8(invocation) + 150: 139(ptr) AccessChain 49(data) 51 60 + 151: 43(ivec4) Load 150 + 152: 149(ivec3) VectorShuffle 151 151 0 1 2 + 153: 6(int) Load 8(invocation) + 154: 149(ivec3) GroupNonUniformBroadcast 38 152 153 + 155: 139(ptr) AccessChain 49(data) 148 60 + 156: 43(ivec4) Load 155 + 157: 43(ivec4) VectorShuffle 156 154 4 5 6 3 + Store 155 157 + 158: 6(int) Load 8(invocation) + 159: 139(ptr) AccessChain 49(data) 124 60 + 160: 43(ivec4) Load 159 + 161: 6(int) Load 8(invocation) + 162: 43(ivec4) GroupNonUniformBroadcast 38 160 161 + 163: 139(ptr) AccessChain 49(data) 158 60 + Store 163 162 + 164: 6(int) Load 8(invocation) + 165: 55(ptr) AccessChain 49(data) 61 51 54 + 166: 6(int) Load 165 + 167: 6(int) Load 8(invocation) + 168: 6(int) GroupNonUniformBroadcast 38 166 167 + 169: 55(ptr) AccessChain 49(data) 164 51 54 + Store 169 168 + 170: 6(int) Load 8(invocation) + 172: 88(ptr) AccessChain 49(data) 60 51 + 173: 17(ivec4) Load 172 + 174: 171(ivec2) VectorShuffle 173 173 0 1 + 175: 6(int) Load 8(invocation) + 176: 171(ivec2) GroupNonUniformBroadcast 38 174 175 + 177: 88(ptr) AccessChain 49(data) 170 51 + 178: 17(ivec4) Load 177 + 179: 17(ivec4) VectorShuffle 178 176 4 5 2 3 + Store 177 179 + 180: 6(int) Load 8(invocation) + 182: 88(ptr) AccessChain 49(data) 51 51 + 183: 17(ivec4) Load 182 + 184: 181(ivec3) VectorShuffle 183 183 0 1 2 + 185: 6(int) Load 8(invocation) + 186: 181(ivec3) GroupNonUniformBroadcast 38 184 185 + 187: 88(ptr) AccessChain 49(data) 180 51 + 188: 17(ivec4) Load 187 + 189: 17(ivec4) VectorShuffle 188 186 4 5 6 3 + Store 187 189 + 190: 6(int) Load 8(invocation) + 191: 88(ptr) AccessChain 49(data) 124 51 + 192: 17(ivec4) Load 191 + 193: 6(int) Load 8(invocation) + 194: 17(ivec4) GroupNonUniformBroadcast 38 192 193 + 195: 88(ptr) AccessChain 49(data) 190 51 + Store 195 194 + 196: 6(int) Load 8(invocation) + 198: 197(ptr) AccessChain 49(data) 61 124 54 + 199: 44(float) Load 198 + 200: 6(int) Load 8(invocation) + 201: 44(float) GroupNonUniformBroadcast 38 199 200 + 202: 197(ptr) AccessChain 49(data) 196 124 54 + Store 202 201 + 203: 6(int) Load 8(invocation) + 206: 205(ptr) AccessChain 49(data) 60 124 + 207: 45(fvec4) Load 206 + 208: 204(fvec2) VectorShuffle 207 207 0 1 + 209: 6(int) Load 8(invocation) + 210: 204(fvec2) GroupNonUniformBroadcast 38 208 209 + 211: 205(ptr) AccessChain 49(data) 203 124 + 212: 45(fvec4) Load 211 + 213: 45(fvec4) VectorShuffle 212 210 4 5 2 3 + Store 211 213 + 214: 6(int) Load 8(invocation) + 216: 205(ptr) AccessChain 49(data) 51 124 + 217: 45(fvec4) Load 216 + 218: 215(fvec3) VectorShuffle 217 217 0 1 2 + 219: 6(int) Load 8(invocation) + 220: 215(fvec3) GroupNonUniformBroadcast 38 218 219 + 221: 205(ptr) AccessChain 49(data) 214 124 + 222: 45(fvec4) Load 221 + 223: 45(fvec4) VectorShuffle 222 220 4 5 6 3 + Store 221 223 + 224: 6(int) Load 8(invocation) + 225: 205(ptr) AccessChain 49(data) 124 124 + 226: 45(fvec4) Load 225 + 227: 6(int) Load 8(invocation) + 228: 45(fvec4) GroupNonUniformBroadcast 38 226 227 + 229: 205(ptr) AccessChain 49(data) 224 124 + Store 229 228 + 230: 6(int) Load 8(invocation) + 231: 131(ptr) AccessChain 49(data) 61 60 54 + 232: 42(int) Load 231 + 233: 36(bool) SLessThan 232 61 + 234: 6(int) Load 8(invocation) + 235: 36(bool) GroupNonUniformBroadcast 38 233 234 + 236: 42(int) Select 235 60 61 + 237: 131(ptr) AccessChain 49(data) 230 60 54 + Store 237 236 + 238: 6(int) Load 8(invocation) + 239: 139(ptr) AccessChain 49(data) 60 60 + 240: 43(ivec4) Load 239 + 241: 138(ivec2) VectorShuffle 240 240 0 1 + 244: 243(bvec2) SLessThan 241 242 + 245: 6(int) Load 8(invocation) + 246: 243(bvec2) GroupNonUniformBroadcast 38 244 245 + 248: 138(ivec2) Select 246 247 242 + 249: 139(ptr) AccessChain 49(data) 238 60 + 250: 43(ivec4) Load 249 + 251: 43(ivec4) VectorShuffle 250 248 4 5 2 3 + Store 249 251 + 252: 6(int) Load 8(invocation) + 253: 139(ptr) AccessChain 49(data) 60 60 + 254: 43(ivec4) Load 253 + 255: 149(ivec3) VectorShuffle 254 254 0 1 2 + 258: 257(bvec3) SLessThan 255 256 + 259: 6(int) Load 8(invocation) + 260: 257(bvec3) GroupNonUniformBroadcast 38 258 259 + 262: 149(ivec3) Select 260 261 256 + 263: 139(ptr) AccessChain 49(data) 252 60 + 264: 43(ivec4) Load 263 + 265: 43(ivec4) VectorShuffle 264 262 4 5 6 3 + Store 263 265 + 266: 6(int) Load 8(invocation) + 267: 139(ptr) AccessChain 49(data) 60 60 + 268: 43(ivec4) Load 267 + 270: 83(bvec4) SLessThan 268 269 + 271: 6(int) Load 8(invocation) + 272: 83(bvec4) GroupNonUniformBroadcast 38 270 271 + 274: 43(ivec4) Select 272 273 269 + 275: 139(ptr) AccessChain 49(data) 266 60 + Store 275 274 + Branch 94 + 276: Label + 277: 6(int) Load 8(invocation) + 278: 96(ptr) AccessChain 49(data) 61 61 54 + 279: 40(float) Load 278 + 280: 40(float) GroupNonUniformBroadcastFirst 38 279 + 281: 96(ptr) AccessChain 49(data) 277 61 54 + Store 281 280 + 282: 6(int) Load 8(invocation) + 283: 104(ptr) AccessChain 49(data) 60 61 + 284: 41(fvec4) Load 283 + 285: 103(fvec2) VectorShuffle 284 284 0 1 + 286: 103(fvec2) GroupNonUniformBroadcastFirst 38 285 + 287: 104(ptr) AccessChain 49(data) 282 61 + 288: 41(fvec4) Load 287 + 289: 41(fvec4) VectorShuffle 288 286 4 5 2 3 + Store 287 289 + 290: 6(int) Load 8(invocation) + 291: 104(ptr) AccessChain 49(data) 51 61 + 292: 41(fvec4) Load 291 + 293: 114(fvec3) VectorShuffle 292 292 0 1 2 + 294: 114(fvec3) GroupNonUniformBroadcastFirst 38 293 + 295: 104(ptr) AccessChain 49(data) 290 61 + 296: 41(fvec4) Load 295 + 297: 41(fvec4) VectorShuffle 296 294 4 5 6 3 + Store 295 297 + 298: 6(int) Load 8(invocation) + 299: 104(ptr) AccessChain 49(data) 124 61 + 300: 41(fvec4) Load 299 + 301: 41(fvec4) GroupNonUniformBroadcastFirst 38 300 + 302: 104(ptr) AccessChain 49(data) 298 61 + Store 302 301 + 303: 6(int) Load 8(invocation) + 304: 131(ptr) AccessChain 49(data) 61 60 54 + 305: 42(int) Load 304 + 306: 42(int) GroupNonUniformBroadcastFirst 38 305 + 307: 131(ptr) AccessChain 49(data) 303 60 54 + Store 307 306 + 308: 6(int) Load 8(invocation) + 309: 139(ptr) AccessChain 49(data) 60 60 + 310: 43(ivec4) Load 309 + 311: 138(ivec2) VectorShuffle 310 310 0 1 + 312: 138(ivec2) GroupNonUniformBroadcastFirst 38 311 + 313: 139(ptr) AccessChain 49(data) 308 60 + 314: 43(ivec4) Load 313 + 315: 43(ivec4) VectorShuffle 314 312 4 5 2 3 + Store 313 315 + 316: 6(int) Load 8(invocation) + 317: 139(ptr) AccessChain 49(data) 51 60 + 318: 43(ivec4) Load 317 + 319: 149(ivec3) VectorShuffle 318 318 0 1 2 + 320: 149(ivec3) GroupNonUniformBroadcastFirst 38 319 + 321: 139(ptr) AccessChain 49(data) 316 60 + 322: 43(ivec4) Load 321 + 323: 43(ivec4) VectorShuffle 322 320 4 5 6 3 + Store 321 323 + 324: 6(int) Load 8(invocation) + 325: 139(ptr) AccessChain 49(data) 124 60 + 326: 43(ivec4) Load 325 + 327: 43(ivec4) GroupNonUniformBroadcastFirst 38 326 + 328: 139(ptr) AccessChain 49(data) 324 60 + Store 328 327 + 329: 6(int) Load 8(invocation) + 330: 55(ptr) AccessChain 49(data) 61 51 54 + 331: 6(int) Load 330 + 332: 6(int) GroupNonUniformBroadcastFirst 38 331 + 333: 55(ptr) AccessChain 49(data) 329 51 54 + Store 333 332 + 334: 6(int) Load 8(invocation) + 335: 88(ptr) AccessChain 49(data) 60 51 + 336: 17(ivec4) Load 335 + 337: 171(ivec2) VectorShuffle 336 336 0 1 + 338: 171(ivec2) GroupNonUniformBroadcastFirst 38 337 + 339: 88(ptr) AccessChain 49(data) 334 51 + 340: 17(ivec4) Load 339 + 341: 17(ivec4) VectorShuffle 340 338 4 5 2 3 + Store 339 341 + 342: 6(int) Load 8(invocation) + 343: 88(ptr) AccessChain 49(data) 51 51 + 344: 17(ivec4) Load 343 + 345: 181(ivec3) VectorShuffle 344 344 0 1 2 + 346: 181(ivec3) GroupNonUniformBroadcastFirst 38 345 + 347: 88(ptr) AccessChain 49(data) 342 51 + 348: 17(ivec4) Load 347 + 349: 17(ivec4) VectorShuffle 348 346 4 5 6 3 + Store 347 349 + 350: 6(int) Load 8(invocation) + 351: 88(ptr) AccessChain 49(data) 124 51 + 352: 17(ivec4) Load 351 + 353: 17(ivec4) GroupNonUniformBroadcastFirst 38 352 + 354: 88(ptr) AccessChain 49(data) 350 51 + Store 354 353 + 355: 6(int) Load 8(invocation) + 356: 197(ptr) AccessChain 49(data) 61 124 54 + 357: 44(float) Load 356 + 358: 44(float) GroupNonUniformBroadcastFirst 38 357 + 359: 197(ptr) AccessChain 49(data) 355 124 54 + Store 359 358 + 360: 6(int) Load 8(invocation) + 361: 205(ptr) AccessChain 49(data) 60 124 + 362: 45(fvec4) Load 361 + 363: 204(fvec2) VectorShuffle 362 362 0 1 + 364: 204(fvec2) GroupNonUniformBroadcastFirst 38 363 + 365: 205(ptr) AccessChain 49(data) 360 124 + 366: 45(fvec4) Load 365 + 367: 45(fvec4) VectorShuffle 366 364 4 5 2 3 + Store 365 367 + 368: 6(int) Load 8(invocation) + 369: 205(ptr) AccessChain 49(data) 51 124 + 370: 45(fvec4) Load 369 + 371: 215(fvec3) VectorShuffle 370 370 0 1 2 + 372: 215(fvec3) GroupNonUniformBroadcastFirst 38 371 + 373: 205(ptr) AccessChain 49(data) 368 124 + 374: 45(fvec4) Load 373 + 375: 45(fvec4) VectorShuffle 374 372 4 5 6 3 + Store 373 375 + 376: 6(int) Load 8(invocation) + 377: 205(ptr) AccessChain 49(data) 124 124 + 378: 45(fvec4) Load 377 + 379: 45(fvec4) GroupNonUniformBroadcastFirst 38 378 + 380: 205(ptr) AccessChain 49(data) 376 124 + Store 380 379 + 381: 6(int) Load 8(invocation) + 382: 131(ptr) AccessChain 49(data) 61 60 54 + 383: 42(int) Load 382 + 384: 36(bool) SLessThan 383 61 + 385: 36(bool) GroupNonUniformBroadcastFirst 38 384 + 386: 42(int) Select 385 60 61 + 387: 131(ptr) AccessChain 49(data) 381 60 54 + Store 387 386 + 388: 6(int) Load 8(invocation) + 389: 139(ptr) AccessChain 49(data) 60 60 + 390: 43(ivec4) Load 389 + 391: 138(ivec2) VectorShuffle 390 390 0 1 + 392: 243(bvec2) SLessThan 391 242 + 393: 243(bvec2) GroupNonUniformBroadcastFirst 38 392 + 394: 138(ivec2) Select 393 247 242 + 395: 139(ptr) AccessChain 49(data) 388 60 + 396: 43(ivec4) Load 395 + 397: 43(ivec4) VectorShuffle 396 394 4 5 2 3 + Store 395 397 + 398: 6(int) Load 8(invocation) + 399: 139(ptr) AccessChain 49(data) 60 60 + 400: 43(ivec4) Load 399 + 401: 149(ivec3) VectorShuffle 400 400 0 1 2 + 402: 257(bvec3) SLessThan 401 256 + 403: 257(bvec3) GroupNonUniformBroadcastFirst 38 402 + 404: 149(ivec3) Select 403 261 256 + 405: 139(ptr) AccessChain 49(data) 398 60 + 406: 43(ivec4) Load 405 + 407: 43(ivec4) VectorShuffle 406 404 4 5 6 3 + Store 405 407 + 408: 6(int) Load 8(invocation) + 409: 139(ptr) AccessChain 49(data) 60 60 + 410: 43(ivec4) Load 409 + 411: 83(bvec4) SLessThan 410 269 + 412: 83(bvec4) GroupNonUniformBroadcastFirst 38 411 + 413: 43(ivec4) Select 412 273 269 + 414: 139(ptr) AccessChain 49(data) 408 60 + Store 414 413 + Branch 94 + 94: Label + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupBasic.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupBasic.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupBasic.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupBasic.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,84 @@ +spv.subgroupBasic.comp +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 40 + + Capability Shader + Capability GroupNonUniform + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 14 19 22 25 + ExecutionMode 4 LocalSize 8 8 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + Name 4 "main" + Name 8 "Buffer" + MemberName 8(Buffer) 0 "a" + Name 10 "data" + Name 14 "gl_SubgroupSize" + Name 19 "gl_SubgroupInvocationID" + Name 22 "gl_NumSubgroups" + Name 25 "gl_SubgroupID" + Decorate 7 ArrayStride 4 + MemberDecorate 8(Buffer) 0 Offset 0 + Decorate 8(Buffer) BufferBlock + Decorate 10(data) DescriptorSet 0 + Decorate 10(data) Binding 0 + Decorate 14(gl_SubgroupSize) RelaxedPrecision + Decorate 14(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 15 RelaxedPrecision + Decorate 19(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 19(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 20 RelaxedPrecision + Decorate 22(gl_NumSubgroups) BuiltIn NumSubgroups + Decorate 25(gl_SubgroupID) BuiltIn SubgroupId + Decorate 39 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeRuntimeArray 6(int) + 8(Buffer): TypeStruct 7 + 9: TypePointer Uniform 8(Buffer) + 10(data): 9(ptr) Variable Uniform + 11: 6(int) Constant 0 + 12: TypeInt 32 0 + 13: TypePointer Input 12(int) +14(gl_SubgroupSize): 13(ptr) Variable Input + 16: 6(int) Constant 1 + 17: TypePointer Uniform 6(int) +19(gl_SubgroupInvocationID): 13(ptr) Variable Input +22(gl_NumSubgroups): 13(ptr) Variable Input +25(gl_SubgroupID): 13(ptr) Variable Input + 27: TypeBool + 28: 12(int) Constant 3 + 32: 12(int) Constant 3400 + 33: 12(int) Constant 72 + 34: 12(int) Constant 264 + 35: 12(int) Constant 2056 + 36: TypeVector 12(int) 3 + 37: 12(int) Constant 8 + 38: 12(int) Constant 1 + 39: 36(ivec3) ConstantComposite 37 37 38 + 4(main): 2 Function None 3 + 5: Label + 15: 12(int) Load 14(gl_SubgroupSize) + 18: 17(ptr) AccessChain 10(data) 11 15 + Store 18 16 + 20: 12(int) Load 19(gl_SubgroupInvocationID) + 21: 17(ptr) AccessChain 10(data) 11 20 + Store 21 16 + 23: 12(int) Load 22(gl_NumSubgroups) + 24: 17(ptr) AccessChain 10(data) 11 23 + Store 24 16 + 26: 12(int) Load 25(gl_SubgroupID) + 29: 27(bool) GroupNonUniformElect 28 + 30: 6(int) Select 29 16 11 + 31: 17(ptr) AccessChain 10(data) 11 26 + Store 31 30 + ControlBarrier 28 28 32 + MemoryBarrier 28 32 + MemoryBarrier 28 33 + MemoryBarrier 28 34 + MemoryBarrier 28 35 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupClustered.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupClustered.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupClustered.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupClustered.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,880 @@ +spv.subgroupClustered.comp +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 737 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformClustered + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 10 12 + ExecutionMode 4 LocalSize 8 1 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + SourceExtension "GL_KHR_shader_subgroup_clustered" + Name 4 "main" + Name 8 "invocation" + Name 10 "gl_SubgroupInvocationID" + Name 12 "gl_SubgroupSize" + Name 24 "Buffers" + MemberName 24(Buffers) 0 "f4" + MemberName 24(Buffers) 1 "i4" + MemberName 24(Buffers) 2 "u4" + MemberName 24(Buffers) 3 "d4" + Name 27 "data" + Decorate 10(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 10(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 11 RelaxedPrecision + Decorate 12(gl_SubgroupSize) RelaxedPrecision + Decorate 12(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 13 RelaxedPrecision + Decorate 14 RelaxedPrecision + Decorate 16 RelaxedPrecision + MemberDecorate 24(Buffers) 0 Offset 0 + MemberDecorate 24(Buffers) 1 Offset 16 + MemberDecorate 24(Buffers) 2 Offset 32 + MemberDecorate 24(Buffers) 3 Offset 64 + Decorate 24(Buffers) BufferBlock + Decorate 27(data) DescriptorSet 0 + Decorate 27(data) Binding 0 + Decorate 736 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_SubgroupInvocationID): 9(ptr) Variable Input +12(gl_SubgroupSize): 9(ptr) Variable Input + 15: 6(int) Constant 4 + 17: TypeFloat 32 + 18: TypeVector 17(float) 4 + 19: TypeInt 32 1 + 20: TypeVector 19(int) 4 + 21: TypeVector 6(int) 4 + 22: TypeFloat 64 + 23: TypeVector 22(float) 4 + 24(Buffers): TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(fvec4) + 25: TypeArray 24(Buffers) 15 + 26: TypePointer Uniform 25 + 27(data): 26(ptr) Variable Uniform + 29: 19(int) Constant 0 + 30: 6(int) Constant 0 + 31: TypePointer Uniform 17(float) + 34: 6(int) Constant 1 + 35: 6(int) Constant 3 + 39: 19(int) Constant 1 + 40: TypeVector 17(float) 2 + 41: TypePointer Uniform 18(fvec4) + 50: 19(int) Constant 2 + 51: TypeVector 17(float) 3 + 60: 19(int) Constant 3 + 66: TypePointer Uniform 19(int) + 72: TypeVector 19(int) 2 + 73: TypePointer Uniform 20(ivec4) + 82: TypeVector 19(int) 3 + 96: TypePointer Uniform 6(int) + 102: TypeVector 6(int) 2 + 103: TypePointer Uniform 21(ivec4) + 112: TypeVector 6(int) 3 + 126: TypePointer Uniform 22(float) + 132: TypeVector 22(float) 2 + 133: TypePointer Uniform 23(fvec4) + 142: TypeVector 22(float) 3 + 522: TypeBool + 531: 72(ivec2) ConstantComposite 29 29 + 532: TypeVector 522(bool) 2 + 535: 72(ivec2) ConstantComposite 39 39 + 544: 82(ivec3) ConstantComposite 29 29 29 + 545: TypeVector 522(bool) 3 + 548: 82(ivec3) ConstantComposite 39 39 39 + 556: 20(ivec4) ConstantComposite 29 29 29 29 + 557: TypeVector 522(bool) 4 + 560: 20(ivec4) ConstantComposite 39 39 39 39 + 735: 6(int) Constant 8 + 736: 112(ivec3) ConstantComposite 735 34 34 + 4(main): 2 Function None 3 + 5: Label + 8(invocation): 7(ptr) Variable Function + 11: 6(int) Load 10(gl_SubgroupInvocationID) + 13: 6(int) Load 12(gl_SubgroupSize) + 14: 6(int) IAdd 11 13 + 16: 6(int) UMod 14 15 + Store 8(invocation) 16 + 28: 6(int) Load 8(invocation) + 32: 31(ptr) AccessChain 27(data) 29 29 30 + 33: 17(float) Load 32 + 36: 17(float) GroupNonUniformFAdd 35 ClusteredReduce 33 34 + 37: 31(ptr) AccessChain 27(data) 28 29 30 + Store 37 36 + 38: 6(int) Load 8(invocation) + 42: 41(ptr) AccessChain 27(data) 39 29 + 43: 18(fvec4) Load 42 + 44: 40(fvec2) VectorShuffle 43 43 0 1 + 45: 40(fvec2) GroupNonUniformFAdd 35 ClusteredReduce 44 34 + 46: 41(ptr) AccessChain 27(data) 38 29 + 47: 18(fvec4) Load 46 + 48: 18(fvec4) VectorShuffle 47 45 4 5 2 3 + Store 46 48 + 49: 6(int) Load 8(invocation) + 52: 41(ptr) AccessChain 27(data) 50 29 + 53: 18(fvec4) Load 52 + 54: 51(fvec3) VectorShuffle 53 53 0 1 2 + 55: 51(fvec3) GroupNonUniformFAdd 35 ClusteredReduce 54 34 + 56: 41(ptr) AccessChain 27(data) 49 29 + 57: 18(fvec4) Load 56 + 58: 18(fvec4) VectorShuffle 57 55 4 5 6 3 + Store 56 58 + 59: 6(int) Load 8(invocation) + 61: 41(ptr) AccessChain 27(data) 60 29 + 62: 18(fvec4) Load 61 + 63: 18(fvec4) GroupNonUniformFAdd 35 ClusteredReduce 62 34 + 64: 41(ptr) AccessChain 27(data) 59 29 + Store 64 63 + 65: 6(int) Load 8(invocation) + 67: 66(ptr) AccessChain 27(data) 29 39 30 + 68: 19(int) Load 67 + 69: 19(int) GroupNonUniformIAdd 35 ClusteredReduce 68 34 + 70: 66(ptr) AccessChain 27(data) 65 39 30 + Store 70 69 + 71: 6(int) Load 8(invocation) + 74: 73(ptr) AccessChain 27(data) 39 39 + 75: 20(ivec4) Load 74 + 76: 72(ivec2) VectorShuffle 75 75 0 1 + 77: 72(ivec2) GroupNonUniformIAdd 35 ClusteredReduce 76 34 + 78: 73(ptr) AccessChain 27(data) 71 39 + 79: 20(ivec4) Load 78 + 80: 20(ivec4) VectorShuffle 79 77 4 5 2 3 + Store 78 80 + 81: 6(int) Load 8(invocation) + 83: 73(ptr) AccessChain 27(data) 50 39 + 84: 20(ivec4) Load 83 + 85: 82(ivec3) VectorShuffle 84 84 0 1 2 + 86: 82(ivec3) GroupNonUniformIAdd 35 ClusteredReduce 85 34 + 87: 73(ptr) AccessChain 27(data) 81 39 + 88: 20(ivec4) Load 87 + 89: 20(ivec4) VectorShuffle 88 86 4 5 6 3 + Store 87 89 + 90: 6(int) Load 8(invocation) + 91: 73(ptr) AccessChain 27(data) 60 39 + 92: 20(ivec4) Load 91 + 93: 20(ivec4) GroupNonUniformIAdd 35 ClusteredReduce 92 34 + 94: 73(ptr) AccessChain 27(data) 90 39 + Store 94 93 + 95: 6(int) Load 8(invocation) + 97: 96(ptr) AccessChain 27(data) 29 50 30 + 98: 6(int) Load 97 + 99: 6(int) GroupNonUniformIAdd 35 ClusteredReduce 98 34 + 100: 96(ptr) AccessChain 27(data) 95 50 30 + Store 100 99 + 101: 6(int) Load 8(invocation) + 104: 103(ptr) AccessChain 27(data) 39 50 + 105: 21(ivec4) Load 104 + 106: 102(ivec2) VectorShuffle 105 105 0 1 + 107: 102(ivec2) GroupNonUniformIAdd 35 ClusteredReduce 106 34 + 108: 103(ptr) AccessChain 27(data) 101 50 + 109: 21(ivec4) Load 108 + 110: 21(ivec4) VectorShuffle 109 107 4 5 2 3 + Store 108 110 + 111: 6(int) Load 8(invocation) + 113: 103(ptr) AccessChain 27(data) 50 50 + 114: 21(ivec4) Load 113 + 115: 112(ivec3) VectorShuffle 114 114 0 1 2 + 116: 112(ivec3) GroupNonUniformIAdd 35 ClusteredReduce 115 34 + 117: 103(ptr) AccessChain 27(data) 111 50 + 118: 21(ivec4) Load 117 + 119: 21(ivec4) VectorShuffle 118 116 4 5 6 3 + Store 117 119 + 120: 6(int) Load 8(invocation) + 121: 103(ptr) AccessChain 27(data) 60 50 + 122: 21(ivec4) Load 121 + 123: 21(ivec4) GroupNonUniformIAdd 35 ClusteredReduce 122 34 + 124: 103(ptr) AccessChain 27(data) 120 50 + Store 124 123 + 125: 6(int) Load 8(invocation) + 127: 126(ptr) AccessChain 27(data) 29 60 30 + 128: 22(float) Load 127 + 129: 22(float) GroupNonUniformFAdd 35 ClusteredReduce 128 34 + 130: 126(ptr) AccessChain 27(data) 125 60 30 + Store 130 129 + 131: 6(int) Load 8(invocation) + 134: 133(ptr) AccessChain 27(data) 39 60 + 135: 23(fvec4) Load 134 + 136: 132(fvec2) VectorShuffle 135 135 0 1 + 137: 132(fvec2) GroupNonUniformFAdd 35 ClusteredReduce 136 34 + 138: 133(ptr) AccessChain 27(data) 131 60 + 139: 23(fvec4) Load 138 + 140: 23(fvec4) VectorShuffle 139 137 4 5 2 3 + Store 138 140 + 141: 6(int) Load 8(invocation) + 143: 133(ptr) AccessChain 27(data) 50 60 + 144: 23(fvec4) Load 143 + 145: 142(fvec3) VectorShuffle 144 144 0 1 2 + 146: 142(fvec3) GroupNonUniformFAdd 35 ClusteredReduce 145 34 + 147: 133(ptr) AccessChain 27(data) 141 60 + 148: 23(fvec4) Load 147 + 149: 23(fvec4) VectorShuffle 148 146 4 5 6 3 + Store 147 149 + 150: 6(int) Load 8(invocation) + 151: 133(ptr) AccessChain 27(data) 60 60 + 152: 23(fvec4) Load 151 + 153: 23(fvec4) GroupNonUniformFAdd 35 ClusteredReduce 152 34 + 154: 133(ptr) AccessChain 27(data) 150 60 + Store 154 153 + 155: 6(int) Load 8(invocation) + 156: 31(ptr) AccessChain 27(data) 29 29 30 + 157: 17(float) Load 156 + 158: 17(float) GroupNonUniformFMul 35 ClusteredReduce 157 34 + 159: 31(ptr) AccessChain 27(data) 155 29 30 + Store 159 158 + 160: 6(int) Load 8(invocation) + 161: 41(ptr) AccessChain 27(data) 39 29 + 162: 18(fvec4) Load 161 + 163: 40(fvec2) VectorShuffle 162 162 0 1 + 164: 40(fvec2) GroupNonUniformFMul 35 ClusteredReduce 163 34 + 165: 41(ptr) AccessChain 27(data) 160 29 + 166: 18(fvec4) Load 165 + 167: 18(fvec4) VectorShuffle 166 164 4 5 2 3 + Store 165 167 + 168: 6(int) Load 8(invocation) + 169: 41(ptr) AccessChain 27(data) 50 29 + 170: 18(fvec4) Load 169 + 171: 51(fvec3) VectorShuffle 170 170 0 1 2 + 172: 51(fvec3) GroupNonUniformFMul 35 ClusteredReduce 171 34 + 173: 41(ptr) AccessChain 27(data) 168 29 + 174: 18(fvec4) Load 173 + 175: 18(fvec4) VectorShuffle 174 172 4 5 6 3 + Store 173 175 + 176: 6(int) Load 8(invocation) + 177: 41(ptr) AccessChain 27(data) 60 29 + 178: 18(fvec4) Load 177 + 179: 18(fvec4) GroupNonUniformFMul 35 ClusteredReduce 178 34 + 180: 41(ptr) AccessChain 27(data) 176 29 + Store 180 179 + 181: 6(int) Load 8(invocation) + 182: 66(ptr) AccessChain 27(data) 29 39 30 + 183: 19(int) Load 182 + 184: 19(int) GroupNonUniformIMul 35 ClusteredReduce 183 34 + 185: 66(ptr) AccessChain 27(data) 181 39 30 + Store 185 184 + 186: 6(int) Load 8(invocation) + 187: 73(ptr) AccessChain 27(data) 39 39 + 188: 20(ivec4) Load 187 + 189: 72(ivec2) VectorShuffle 188 188 0 1 + 190: 72(ivec2) GroupNonUniformIMul 35 ClusteredReduce 189 34 + 191: 73(ptr) AccessChain 27(data) 186 39 + 192: 20(ivec4) Load 191 + 193: 20(ivec4) VectorShuffle 192 190 4 5 2 3 + Store 191 193 + 194: 6(int) Load 8(invocation) + 195: 73(ptr) AccessChain 27(data) 50 39 + 196: 20(ivec4) Load 195 + 197: 82(ivec3) VectorShuffle 196 196 0 1 2 + 198: 82(ivec3) GroupNonUniformIMul 35 ClusteredReduce 197 34 + 199: 73(ptr) AccessChain 27(data) 194 39 + 200: 20(ivec4) Load 199 + 201: 20(ivec4) VectorShuffle 200 198 4 5 6 3 + Store 199 201 + 202: 6(int) Load 8(invocation) + 203: 73(ptr) AccessChain 27(data) 60 39 + 204: 20(ivec4) Load 203 + 205: 20(ivec4) GroupNonUniformIMul 35 ClusteredReduce 204 34 + 206: 73(ptr) AccessChain 27(data) 202 39 + Store 206 205 + 207: 6(int) Load 8(invocation) + 208: 96(ptr) AccessChain 27(data) 29 50 30 + 209: 6(int) Load 208 + 210: 6(int) GroupNonUniformIMul 35 ClusteredReduce 209 34 + 211: 96(ptr) AccessChain 27(data) 207 50 30 + Store 211 210 + 212: 6(int) Load 8(invocation) + 213: 103(ptr) AccessChain 27(data) 39 50 + 214: 21(ivec4) Load 213 + 215: 102(ivec2) VectorShuffle 214 214 0 1 + 216: 102(ivec2) GroupNonUniformIMul 35 ClusteredReduce 215 34 + 217: 103(ptr) AccessChain 27(data) 212 50 + 218: 21(ivec4) Load 217 + 219: 21(ivec4) VectorShuffle 218 216 4 5 2 3 + Store 217 219 + 220: 6(int) Load 8(invocation) + 221: 103(ptr) AccessChain 27(data) 50 50 + 222: 21(ivec4) Load 221 + 223: 112(ivec3) VectorShuffle 222 222 0 1 2 + 224: 112(ivec3) GroupNonUniformIMul 35 ClusteredReduce 223 34 + 225: 103(ptr) AccessChain 27(data) 220 50 + 226: 21(ivec4) Load 225 + 227: 21(ivec4) VectorShuffle 226 224 4 5 6 3 + Store 225 227 + 228: 6(int) Load 8(invocation) + 229: 103(ptr) AccessChain 27(data) 60 50 + 230: 21(ivec4) Load 229 + 231: 21(ivec4) GroupNonUniformIMul 35 ClusteredReduce 230 34 + 232: 103(ptr) AccessChain 27(data) 228 50 + Store 232 231 + 233: 6(int) Load 8(invocation) + 234: 126(ptr) AccessChain 27(data) 29 60 30 + 235: 22(float) Load 234 + 236: 22(float) GroupNonUniformFMul 35 ClusteredReduce 235 34 + 237: 126(ptr) AccessChain 27(data) 233 60 30 + Store 237 236 + 238: 6(int) Load 8(invocation) + 239: 133(ptr) AccessChain 27(data) 39 60 + 240: 23(fvec4) Load 239 + 241: 132(fvec2) VectorShuffle 240 240 0 1 + 242: 132(fvec2) GroupNonUniformFMul 35 ClusteredReduce 241 34 + 243: 133(ptr) AccessChain 27(data) 238 60 + 244: 23(fvec4) Load 243 + 245: 23(fvec4) VectorShuffle 244 242 4 5 2 3 + Store 243 245 + 246: 6(int) Load 8(invocation) + 247: 133(ptr) AccessChain 27(data) 50 60 + 248: 23(fvec4) Load 247 + 249: 142(fvec3) VectorShuffle 248 248 0 1 2 + 250: 142(fvec3) GroupNonUniformFMul 35 ClusteredReduce 249 34 + 251: 133(ptr) AccessChain 27(data) 246 60 + 252: 23(fvec4) Load 251 + 253: 23(fvec4) VectorShuffle 252 250 4 5 6 3 + Store 251 253 + 254: 6(int) Load 8(invocation) + 255: 133(ptr) AccessChain 27(data) 60 60 + 256: 23(fvec4) Load 255 + 257: 23(fvec4) GroupNonUniformFMul 35 ClusteredReduce 256 34 + 258: 133(ptr) AccessChain 27(data) 254 60 + Store 258 257 + 259: 6(int) Load 8(invocation) + 260: 31(ptr) AccessChain 27(data) 29 29 30 + 261: 17(float) Load 260 + 262: 17(float) GroupNonUniformFMin 35 ClusteredReduce 261 34 + 263: 31(ptr) AccessChain 27(data) 259 29 30 + Store 263 262 + 264: 6(int) Load 8(invocation) + 265: 41(ptr) AccessChain 27(data) 39 29 + 266: 18(fvec4) Load 265 + 267: 40(fvec2) VectorShuffle 266 266 0 1 + 268: 40(fvec2) GroupNonUniformFMin 35 ClusteredReduce 267 34 + 269: 41(ptr) AccessChain 27(data) 264 29 + 270: 18(fvec4) Load 269 + 271: 18(fvec4) VectorShuffle 270 268 4 5 2 3 + Store 269 271 + 272: 6(int) Load 8(invocation) + 273: 41(ptr) AccessChain 27(data) 50 29 + 274: 18(fvec4) Load 273 + 275: 51(fvec3) VectorShuffle 274 274 0 1 2 + 276: 51(fvec3) GroupNonUniformFMin 35 ClusteredReduce 275 34 + 277: 41(ptr) AccessChain 27(data) 272 29 + 278: 18(fvec4) Load 277 + 279: 18(fvec4) VectorShuffle 278 276 4 5 6 3 + Store 277 279 + 280: 6(int) Load 8(invocation) + 281: 41(ptr) AccessChain 27(data) 60 29 + 282: 18(fvec4) Load 281 + 283: 18(fvec4) GroupNonUniformFMin 35 ClusteredReduce 282 34 + 284: 41(ptr) AccessChain 27(data) 280 29 + Store 284 283 + 285: 6(int) Load 8(invocation) + 286: 66(ptr) AccessChain 27(data) 29 39 30 + 287: 19(int) Load 286 + 288: 19(int) GroupNonUniformSMin 35 ClusteredReduce 287 34 + 289: 66(ptr) AccessChain 27(data) 285 39 30 + Store 289 288 + 290: 6(int) Load 8(invocation) + 291: 73(ptr) AccessChain 27(data) 39 39 + 292: 20(ivec4) Load 291 + 293: 72(ivec2) VectorShuffle 292 292 0 1 + 294: 72(ivec2) GroupNonUniformSMin 35 ClusteredReduce 293 34 + 295: 73(ptr) AccessChain 27(data) 290 39 + 296: 20(ivec4) Load 295 + 297: 20(ivec4) VectorShuffle 296 294 4 5 2 3 + Store 295 297 + 298: 6(int) Load 8(invocation) + 299: 73(ptr) AccessChain 27(data) 50 39 + 300: 20(ivec4) Load 299 + 301: 82(ivec3) VectorShuffle 300 300 0 1 2 + 302: 82(ivec3) GroupNonUniformSMin 35 ClusteredReduce 301 34 + 303: 73(ptr) AccessChain 27(data) 298 39 + 304: 20(ivec4) Load 303 + 305: 20(ivec4) VectorShuffle 304 302 4 5 6 3 + Store 303 305 + 306: 6(int) Load 8(invocation) + 307: 73(ptr) AccessChain 27(data) 60 39 + 308: 20(ivec4) Load 307 + 309: 20(ivec4) GroupNonUniformSMin 35 ClusteredReduce 308 34 + 310: 73(ptr) AccessChain 27(data) 306 39 + Store 310 309 + 311: 6(int) Load 8(invocation) + 312: 96(ptr) AccessChain 27(data) 29 50 30 + 313: 6(int) Load 312 + 314: 6(int) GroupNonUniformUMin 35 ClusteredReduce 313 34 + 315: 96(ptr) AccessChain 27(data) 311 50 30 + Store 315 314 + 316: 6(int) Load 8(invocation) + 317: 103(ptr) AccessChain 27(data) 39 50 + 318: 21(ivec4) Load 317 + 319: 102(ivec2) VectorShuffle 318 318 0 1 + 320: 102(ivec2) GroupNonUniformUMin 35 ClusteredReduce 319 34 + 321: 103(ptr) AccessChain 27(data) 316 50 + 322: 21(ivec4) Load 321 + 323: 21(ivec4) VectorShuffle 322 320 4 5 2 3 + Store 321 323 + 324: 6(int) Load 8(invocation) + 325: 103(ptr) AccessChain 27(data) 50 50 + 326: 21(ivec4) Load 325 + 327: 112(ivec3) VectorShuffle 326 326 0 1 2 + 328: 112(ivec3) GroupNonUniformUMin 35 ClusteredReduce 327 34 + 329: 103(ptr) AccessChain 27(data) 324 50 + 330: 21(ivec4) Load 329 + 331: 21(ivec4) VectorShuffle 330 328 4 5 6 3 + Store 329 331 + 332: 6(int) Load 8(invocation) + 333: 103(ptr) AccessChain 27(data) 60 50 + 334: 21(ivec4) Load 333 + 335: 21(ivec4) GroupNonUniformUMin 35 ClusteredReduce 334 34 + 336: 103(ptr) AccessChain 27(data) 332 50 + Store 336 335 + 337: 6(int) Load 8(invocation) + 338: 126(ptr) AccessChain 27(data) 29 60 30 + 339: 22(float) Load 338 + 340: 22(float) GroupNonUniformFMin 35 ClusteredReduce 339 34 + 341: 126(ptr) AccessChain 27(data) 337 60 30 + Store 341 340 + 342: 6(int) Load 8(invocation) + 343: 133(ptr) AccessChain 27(data) 39 60 + 344: 23(fvec4) Load 343 + 345: 132(fvec2) VectorShuffle 344 344 0 1 + 346: 132(fvec2) GroupNonUniformFMin 35 ClusteredReduce 345 34 + 347: 133(ptr) AccessChain 27(data) 342 60 + 348: 23(fvec4) Load 347 + 349: 23(fvec4) VectorShuffle 348 346 4 5 2 3 + Store 347 349 + 350: 6(int) Load 8(invocation) + 351: 133(ptr) AccessChain 27(data) 50 60 + 352: 23(fvec4) Load 351 + 353: 142(fvec3) VectorShuffle 352 352 0 1 2 + 354: 142(fvec3) GroupNonUniformFMin 35 ClusteredReduce 353 34 + 355: 133(ptr) AccessChain 27(data) 350 60 + 356: 23(fvec4) Load 355 + 357: 23(fvec4) VectorShuffle 356 354 4 5 6 3 + Store 355 357 + 358: 6(int) Load 8(invocation) + 359: 133(ptr) AccessChain 27(data) 60 60 + 360: 23(fvec4) Load 359 + 361: 23(fvec4) GroupNonUniformFMin 35 ClusteredReduce 360 34 + 362: 133(ptr) AccessChain 27(data) 358 60 + Store 362 361 + 363: 6(int) Load 8(invocation) + 364: 31(ptr) AccessChain 27(data) 29 29 30 + 365: 17(float) Load 364 + 366: 17(float) GroupNonUniformFMax 35 ClusteredReduce 365 34 + 367: 31(ptr) AccessChain 27(data) 363 29 30 + Store 367 366 + 368: 6(int) Load 8(invocation) + 369: 41(ptr) AccessChain 27(data) 39 29 + 370: 18(fvec4) Load 369 + 371: 40(fvec2) VectorShuffle 370 370 0 1 + 372: 40(fvec2) GroupNonUniformFMax 35 ClusteredReduce 371 34 + 373: 41(ptr) AccessChain 27(data) 368 29 + 374: 18(fvec4) Load 373 + 375: 18(fvec4) VectorShuffle 374 372 4 5 2 3 + Store 373 375 + 376: 6(int) Load 8(invocation) + 377: 41(ptr) AccessChain 27(data) 50 29 + 378: 18(fvec4) Load 377 + 379: 51(fvec3) VectorShuffle 378 378 0 1 2 + 380: 51(fvec3) GroupNonUniformFMax 35 ClusteredReduce 379 34 + 381: 41(ptr) AccessChain 27(data) 376 29 + 382: 18(fvec4) Load 381 + 383: 18(fvec4) VectorShuffle 382 380 4 5 6 3 + Store 381 383 + 384: 6(int) Load 8(invocation) + 385: 41(ptr) AccessChain 27(data) 60 29 + 386: 18(fvec4) Load 385 + 387: 18(fvec4) GroupNonUniformFMax 35 ClusteredReduce 386 34 + 388: 41(ptr) AccessChain 27(data) 384 29 + Store 388 387 + 389: 6(int) Load 8(invocation) + 390: 66(ptr) AccessChain 27(data) 29 39 30 + 391: 19(int) Load 390 + 392: 19(int) GroupNonUniformSMax 35 ClusteredReduce 391 34 + 393: 66(ptr) AccessChain 27(data) 389 39 30 + Store 393 392 + 394: 6(int) Load 8(invocation) + 395: 73(ptr) AccessChain 27(data) 39 39 + 396: 20(ivec4) Load 395 + 397: 72(ivec2) VectorShuffle 396 396 0 1 + 398: 72(ivec2) GroupNonUniformSMax 35 ClusteredReduce 397 34 + 399: 73(ptr) AccessChain 27(data) 394 39 + 400: 20(ivec4) Load 399 + 401: 20(ivec4) VectorShuffle 400 398 4 5 2 3 + Store 399 401 + 402: 6(int) Load 8(invocation) + 403: 73(ptr) AccessChain 27(data) 50 39 + 404: 20(ivec4) Load 403 + 405: 82(ivec3) VectorShuffle 404 404 0 1 2 + 406: 82(ivec3) GroupNonUniformSMax 35 ClusteredReduce 405 34 + 407: 73(ptr) AccessChain 27(data) 402 39 + 408: 20(ivec4) Load 407 + 409: 20(ivec4) VectorShuffle 408 406 4 5 6 3 + Store 407 409 + 410: 6(int) Load 8(invocation) + 411: 73(ptr) AccessChain 27(data) 60 39 + 412: 20(ivec4) Load 411 + 413: 20(ivec4) GroupNonUniformSMax 35 ClusteredReduce 412 34 + 414: 73(ptr) AccessChain 27(data) 410 39 + Store 414 413 + 415: 6(int) Load 8(invocation) + 416: 96(ptr) AccessChain 27(data) 29 50 30 + 417: 6(int) Load 416 + 418: 6(int) GroupNonUniformUMax 35 ClusteredReduce 417 34 + 419: 96(ptr) AccessChain 27(data) 415 50 30 + Store 419 418 + 420: 6(int) Load 8(invocation) + 421: 103(ptr) AccessChain 27(data) 39 50 + 422: 21(ivec4) Load 421 + 423: 102(ivec2) VectorShuffle 422 422 0 1 + 424: 102(ivec2) GroupNonUniformUMax 35 ClusteredReduce 423 34 + 425: 103(ptr) AccessChain 27(data) 420 50 + 426: 21(ivec4) Load 425 + 427: 21(ivec4) VectorShuffle 426 424 4 5 2 3 + Store 425 427 + 428: 6(int) Load 8(invocation) + 429: 103(ptr) AccessChain 27(data) 50 50 + 430: 21(ivec4) Load 429 + 431: 112(ivec3) VectorShuffle 430 430 0 1 2 + 432: 112(ivec3) GroupNonUniformUMax 35 ClusteredReduce 431 34 + 433: 103(ptr) AccessChain 27(data) 428 50 + 434: 21(ivec4) Load 433 + 435: 21(ivec4) VectorShuffle 434 432 4 5 6 3 + Store 433 435 + 436: 6(int) Load 8(invocation) + 437: 103(ptr) AccessChain 27(data) 60 50 + 438: 21(ivec4) Load 437 + 439: 21(ivec4) GroupNonUniformUMax 35 ClusteredReduce 438 34 + 440: 103(ptr) AccessChain 27(data) 436 50 + Store 440 439 + 441: 6(int) Load 8(invocation) + 442: 126(ptr) AccessChain 27(data) 29 60 30 + 443: 22(float) Load 442 + 444: 22(float) GroupNonUniformFMax 35 ClusteredReduce 443 34 + 445: 126(ptr) AccessChain 27(data) 441 60 30 + Store 445 444 + 446: 6(int) Load 8(invocation) + 447: 133(ptr) AccessChain 27(data) 39 60 + 448: 23(fvec4) Load 447 + 449: 132(fvec2) VectorShuffle 448 448 0 1 + 450: 132(fvec2) GroupNonUniformFMax 35 ClusteredReduce 449 34 + 451: 133(ptr) AccessChain 27(data) 446 60 + 452: 23(fvec4) Load 451 + 453: 23(fvec4) VectorShuffle 452 450 4 5 2 3 + Store 451 453 + 454: 6(int) Load 8(invocation) + 455: 133(ptr) AccessChain 27(data) 50 60 + 456: 23(fvec4) Load 455 + 457: 142(fvec3) VectorShuffle 456 456 0 1 2 + 458: 142(fvec3) GroupNonUniformFMax 35 ClusteredReduce 457 34 + 459: 133(ptr) AccessChain 27(data) 454 60 + 460: 23(fvec4) Load 459 + 461: 23(fvec4) VectorShuffle 460 458 4 5 6 3 + Store 459 461 + 462: 6(int) Load 8(invocation) + 463: 133(ptr) AccessChain 27(data) 60 60 + 464: 23(fvec4) Load 463 + 465: 23(fvec4) GroupNonUniformFMax 35 ClusteredReduce 464 34 + 466: 133(ptr) AccessChain 27(data) 462 60 + Store 466 465 + 467: 6(int) Load 8(invocation) + 468: 66(ptr) AccessChain 27(data) 29 39 30 + 469: 19(int) Load 468 + 470: 19(int) GroupNonUniformBitwiseAnd 35 ClusteredReduce 469 34 + 471: 66(ptr) AccessChain 27(data) 467 39 30 + Store 471 470 + 472: 6(int) Load 8(invocation) + 473: 73(ptr) AccessChain 27(data) 39 39 + 474: 20(ivec4) Load 473 + 475: 72(ivec2) VectorShuffle 474 474 0 1 + 476: 72(ivec2) GroupNonUniformBitwiseAnd 35 ClusteredReduce 475 34 + 477: 73(ptr) AccessChain 27(data) 472 39 + 478: 20(ivec4) Load 477 + 479: 20(ivec4) VectorShuffle 478 476 4 5 2 3 + Store 477 479 + 480: 6(int) Load 8(invocation) + 481: 73(ptr) AccessChain 27(data) 50 39 + 482: 20(ivec4) Load 481 + 483: 82(ivec3) VectorShuffle 482 482 0 1 2 + 484: 82(ivec3) GroupNonUniformBitwiseAnd 35 ClusteredReduce 483 34 + 485: 73(ptr) AccessChain 27(data) 480 39 + 486: 20(ivec4) Load 485 + 487: 20(ivec4) VectorShuffle 486 484 4 5 6 3 + Store 485 487 + 488: 6(int) Load 8(invocation) + 489: 73(ptr) AccessChain 27(data) 60 39 + 490: 20(ivec4) Load 489 + 491: 20(ivec4) GroupNonUniformBitwiseAnd 35 ClusteredReduce 490 34 + 492: 73(ptr) AccessChain 27(data) 488 39 + Store 492 491 + 493: 6(int) Load 8(invocation) + 494: 96(ptr) AccessChain 27(data) 29 50 30 + 495: 6(int) Load 494 + 496: 6(int) GroupNonUniformBitwiseAnd 35 ClusteredReduce 495 34 + 497: 96(ptr) AccessChain 27(data) 493 50 30 + Store 497 496 + 498: 6(int) Load 8(invocation) + 499: 103(ptr) AccessChain 27(data) 39 50 + 500: 21(ivec4) Load 499 + 501: 102(ivec2) VectorShuffle 500 500 0 1 + 502: 102(ivec2) GroupNonUniformBitwiseAnd 35 ClusteredReduce 501 34 + 503: 103(ptr) AccessChain 27(data) 498 50 + 504: 21(ivec4) Load 503 + 505: 21(ivec4) VectorShuffle 504 502 4 5 2 3 + Store 503 505 + 506: 6(int) Load 8(invocation) + 507: 103(ptr) AccessChain 27(data) 50 50 + 508: 21(ivec4) Load 507 + 509: 112(ivec3) VectorShuffle 508 508 0 1 2 + 510: 112(ivec3) GroupNonUniformBitwiseAnd 35 ClusteredReduce 509 34 + 511: 103(ptr) AccessChain 27(data) 506 50 + 512: 21(ivec4) Load 511 + 513: 21(ivec4) VectorShuffle 512 510 4 5 6 3 + Store 511 513 + 514: 6(int) Load 8(invocation) + 515: 103(ptr) AccessChain 27(data) 60 50 + 516: 21(ivec4) Load 515 + 517: 21(ivec4) GroupNonUniformBitwiseAnd 35 ClusteredReduce 516 34 + 518: 103(ptr) AccessChain 27(data) 514 50 + Store 518 517 + 519: 6(int) Load 8(invocation) + 520: 66(ptr) AccessChain 27(data) 29 39 30 + 521: 19(int) Load 520 + 523: 522(bool) SLessThan 521 29 + 524: 522(bool) GroupNonUniformLogicalAnd 35 ClusteredReduce 523 34 + 525: 19(int) Select 524 39 29 + 526: 66(ptr) AccessChain 27(data) 519 39 30 + Store 526 525 + 527: 6(int) Load 8(invocation) + 528: 73(ptr) AccessChain 27(data) 39 39 + 529: 20(ivec4) Load 528 + 530: 72(ivec2) VectorShuffle 529 529 0 1 + 533: 532(bvec2) SLessThan 530 531 + 534: 532(bvec2) GroupNonUniformLogicalAnd 35 ClusteredReduce 533 34 + 536: 72(ivec2) Select 534 535 531 + 537: 73(ptr) AccessChain 27(data) 527 39 + 538: 20(ivec4) Load 537 + 539: 20(ivec4) VectorShuffle 538 536 4 5 2 3 + Store 537 539 + 540: 6(int) Load 8(invocation) + 541: 73(ptr) AccessChain 27(data) 39 39 + 542: 20(ivec4) Load 541 + 543: 82(ivec3) VectorShuffle 542 542 0 1 2 + 546: 545(bvec3) SLessThan 543 544 + 547: 545(bvec3) GroupNonUniformLogicalAnd 35 ClusteredReduce 546 34 + 549: 82(ivec3) Select 547 548 544 + 550: 73(ptr) AccessChain 27(data) 540 39 + 551: 20(ivec4) Load 550 + 552: 20(ivec4) VectorShuffle 551 549 4 5 6 3 + Store 550 552 + 553: 6(int) Load 8(invocation) + 554: 73(ptr) AccessChain 27(data) 39 39 + 555: 20(ivec4) Load 554 + 558: 557(bvec4) SLessThan 555 556 + 559: 557(bvec4) GroupNonUniformLogicalAnd 35 ClusteredReduce 558 34 + 561: 20(ivec4) Select 559 560 556 + 562: 73(ptr) AccessChain 27(data) 553 39 + Store 562 561 + 563: 6(int) Load 8(invocation) + 564: 66(ptr) AccessChain 27(data) 29 39 30 + 565: 19(int) Load 564 + 566: 19(int) GroupNonUniformBitwiseOr 35 ClusteredReduce 565 34 + 567: 66(ptr) AccessChain 27(data) 563 39 30 + Store 567 566 + 568: 6(int) Load 8(invocation) + 569: 73(ptr) AccessChain 27(data) 39 39 + 570: 20(ivec4) Load 569 + 571: 72(ivec2) VectorShuffle 570 570 0 1 + 572: 72(ivec2) GroupNonUniformBitwiseOr 35 ClusteredReduce 571 34 + 573: 73(ptr) AccessChain 27(data) 568 39 + 574: 20(ivec4) Load 573 + 575: 20(ivec4) VectorShuffle 574 572 4 5 2 3 + Store 573 575 + 576: 6(int) Load 8(invocation) + 577: 73(ptr) AccessChain 27(data) 50 39 + 578: 20(ivec4) Load 577 + 579: 82(ivec3) VectorShuffle 578 578 0 1 2 + 580: 82(ivec3) GroupNonUniformBitwiseOr 35 ClusteredReduce 579 34 + 581: 73(ptr) AccessChain 27(data) 576 39 + 582: 20(ivec4) Load 581 + 583: 20(ivec4) VectorShuffle 582 580 4 5 6 3 + Store 581 583 + 584: 6(int) Load 8(invocation) + 585: 73(ptr) AccessChain 27(data) 60 39 + 586: 20(ivec4) Load 585 + 587: 20(ivec4) GroupNonUniformBitwiseOr 35 ClusteredReduce 586 34 + 588: 73(ptr) AccessChain 27(data) 584 39 + Store 588 587 + 589: 6(int) Load 8(invocation) + 590: 96(ptr) AccessChain 27(data) 29 50 30 + 591: 6(int) Load 590 + 592: 6(int) GroupNonUniformBitwiseOr 35 ClusteredReduce 591 34 + 593: 96(ptr) AccessChain 27(data) 589 50 30 + Store 593 592 + 594: 6(int) Load 8(invocation) + 595: 103(ptr) AccessChain 27(data) 39 50 + 596: 21(ivec4) Load 595 + 597: 102(ivec2) VectorShuffle 596 596 0 1 + 598: 102(ivec2) GroupNonUniformBitwiseOr 35 ClusteredReduce 597 34 + 599: 103(ptr) AccessChain 27(data) 594 50 + 600: 21(ivec4) Load 599 + 601: 21(ivec4) VectorShuffle 600 598 4 5 2 3 + Store 599 601 + 602: 6(int) Load 8(invocation) + 603: 103(ptr) AccessChain 27(data) 50 50 + 604: 21(ivec4) Load 603 + 605: 112(ivec3) VectorShuffle 604 604 0 1 2 + 606: 112(ivec3) GroupNonUniformBitwiseOr 35 ClusteredReduce 605 34 + 607: 103(ptr) AccessChain 27(data) 602 50 + 608: 21(ivec4) Load 607 + 609: 21(ivec4) VectorShuffle 608 606 4 5 6 3 + Store 607 609 + 610: 6(int) Load 8(invocation) + 611: 103(ptr) AccessChain 27(data) 60 50 + 612: 21(ivec4) Load 611 + 613: 21(ivec4) GroupNonUniformBitwiseOr 35 ClusteredReduce 612 34 + 614: 103(ptr) AccessChain 27(data) 610 50 + Store 614 613 + 615: 6(int) Load 8(invocation) + 616: 66(ptr) AccessChain 27(data) 29 39 30 + 617: 19(int) Load 616 + 618: 522(bool) SLessThan 617 29 + 619: 522(bool) GroupNonUniformLogicalOr 35 ClusteredReduce 618 34 + 620: 19(int) Select 619 39 29 + 621: 66(ptr) AccessChain 27(data) 615 39 30 + Store 621 620 + 622: 6(int) Load 8(invocation) + 623: 73(ptr) AccessChain 27(data) 39 39 + 624: 20(ivec4) Load 623 + 625: 72(ivec2) VectorShuffle 624 624 0 1 + 626: 532(bvec2) SLessThan 625 531 + 627: 532(bvec2) GroupNonUniformLogicalOr 35 ClusteredReduce 626 34 + 628: 72(ivec2) Select 627 535 531 + 629: 73(ptr) AccessChain 27(data) 622 39 + 630: 20(ivec4) Load 629 + 631: 20(ivec4) VectorShuffle 630 628 4 5 2 3 + Store 629 631 + 632: 6(int) Load 8(invocation) + 633: 73(ptr) AccessChain 27(data) 39 39 + 634: 20(ivec4) Load 633 + 635: 82(ivec3) VectorShuffle 634 634 0 1 2 + 636: 545(bvec3) SLessThan 635 544 + 637: 545(bvec3) GroupNonUniformLogicalOr 35 ClusteredReduce 636 34 + 638: 82(ivec3) Select 637 548 544 + 639: 73(ptr) AccessChain 27(data) 632 39 + 640: 20(ivec4) Load 639 + 641: 20(ivec4) VectorShuffle 640 638 4 5 6 3 + Store 639 641 + 642: 6(int) Load 8(invocation) + 643: 73(ptr) AccessChain 27(data) 39 39 + 644: 20(ivec4) Load 643 + 645: 557(bvec4) SLessThan 644 556 + 646: 557(bvec4) GroupNonUniformLogicalOr 35 ClusteredReduce 645 34 + 647: 20(ivec4) Select 646 560 556 + 648: 73(ptr) AccessChain 27(data) 642 39 + Store 648 647 + 649: 6(int) Load 8(invocation) + 650: 66(ptr) AccessChain 27(data) 29 39 30 + 651: 19(int) Load 650 + 652: 19(int) GroupNonUniformBitwiseXor 35 ClusteredReduce 651 34 + 653: 66(ptr) AccessChain 27(data) 649 39 30 + Store 653 652 + 654: 6(int) Load 8(invocation) + 655: 73(ptr) AccessChain 27(data) 39 39 + 656: 20(ivec4) Load 655 + 657: 72(ivec2) VectorShuffle 656 656 0 1 + 658: 72(ivec2) GroupNonUniformBitwiseXor 35 ClusteredReduce 657 34 + 659: 73(ptr) AccessChain 27(data) 654 39 + 660: 20(ivec4) Load 659 + 661: 20(ivec4) VectorShuffle 660 658 4 5 2 3 + Store 659 661 + 662: 6(int) Load 8(invocation) + 663: 73(ptr) AccessChain 27(data) 50 39 + 664: 20(ivec4) Load 663 + 665: 82(ivec3) VectorShuffle 664 664 0 1 2 + 666: 82(ivec3) GroupNonUniformBitwiseXor 35 ClusteredReduce 665 34 + 667: 73(ptr) AccessChain 27(data) 662 39 + 668: 20(ivec4) Load 667 + 669: 20(ivec4) VectorShuffle 668 666 4 5 6 3 + Store 667 669 + 670: 6(int) Load 8(invocation) + 671: 73(ptr) AccessChain 27(data) 60 39 + 672: 20(ivec4) Load 671 + 673: 20(ivec4) GroupNonUniformBitwiseXor 35 ClusteredReduce 672 34 + 674: 73(ptr) AccessChain 27(data) 670 39 + Store 674 673 + 675: 6(int) Load 8(invocation) + 676: 96(ptr) AccessChain 27(data) 29 50 30 + 677: 6(int) Load 676 + 678: 6(int) GroupNonUniformBitwiseXor 35 ClusteredReduce 677 34 + 679: 96(ptr) AccessChain 27(data) 675 50 30 + Store 679 678 + 680: 6(int) Load 8(invocation) + 681: 103(ptr) AccessChain 27(data) 39 50 + 682: 21(ivec4) Load 681 + 683: 102(ivec2) VectorShuffle 682 682 0 1 + 684: 102(ivec2) GroupNonUniformBitwiseXor 35 ClusteredReduce 683 34 + 685: 103(ptr) AccessChain 27(data) 680 50 + 686: 21(ivec4) Load 685 + 687: 21(ivec4) VectorShuffle 686 684 4 5 2 3 + Store 685 687 + 688: 6(int) Load 8(invocation) + 689: 103(ptr) AccessChain 27(data) 50 50 + 690: 21(ivec4) Load 689 + 691: 112(ivec3) VectorShuffle 690 690 0 1 2 + 692: 112(ivec3) GroupNonUniformBitwiseXor 35 ClusteredReduce 691 34 + 693: 103(ptr) AccessChain 27(data) 688 50 + 694: 21(ivec4) Load 693 + 695: 21(ivec4) VectorShuffle 694 692 4 5 6 3 + Store 693 695 + 696: 6(int) Load 8(invocation) + 697: 103(ptr) AccessChain 27(data) 60 50 + 698: 21(ivec4) Load 697 + 699: 21(ivec4) GroupNonUniformBitwiseXor 35 ClusteredReduce 698 34 + 700: 103(ptr) AccessChain 27(data) 696 50 + Store 700 699 + 701: 6(int) Load 8(invocation) + 702: 66(ptr) AccessChain 27(data) 29 39 30 + 703: 19(int) Load 702 + 704: 522(bool) SLessThan 703 29 + 705: 522(bool) GroupNonUniformLogicalXor 35 ClusteredReduce 704 34 + 706: 19(int) Select 705 39 29 + 707: 66(ptr) AccessChain 27(data) 701 39 30 + Store 707 706 + 708: 6(int) Load 8(invocation) + 709: 73(ptr) AccessChain 27(data) 39 39 + 710: 20(ivec4) Load 709 + 711: 72(ivec2) VectorShuffle 710 710 0 1 + 712: 532(bvec2) SLessThan 711 531 + 713: 532(bvec2) GroupNonUniformLogicalXor 35 ClusteredReduce 712 34 + 714: 72(ivec2) Select 713 535 531 + 715: 73(ptr) AccessChain 27(data) 708 39 + 716: 20(ivec4) Load 715 + 717: 20(ivec4) VectorShuffle 716 714 4 5 2 3 + Store 715 717 + 718: 6(int) Load 8(invocation) + 719: 73(ptr) AccessChain 27(data) 39 39 + 720: 20(ivec4) Load 719 + 721: 82(ivec3) VectorShuffle 720 720 0 1 2 + 722: 545(bvec3) SLessThan 721 544 + 723: 545(bvec3) GroupNonUniformLogicalXor 35 ClusteredReduce 722 34 + 724: 82(ivec3) Select 723 548 544 + 725: 73(ptr) AccessChain 27(data) 718 39 + 726: 20(ivec4) Load 725 + 727: 20(ivec4) VectorShuffle 726 724 4 5 6 3 + Store 725 727 + 728: 6(int) Load 8(invocation) + 729: 73(ptr) AccessChain 27(data) 39 39 + 730: 20(ivec4) Load 729 + 731: 557(bvec4) SLessThan 730 556 + 732: 557(bvec4) GroupNonUniformLogicalXor 35 ClusteredReduce 731 34 + 733: 20(ivec4) Select 732 560 556 + 734: 73(ptr) AccessChain 27(data) 728 39 + Store 734 733 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupClusteredNeg.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupClusteredNeg.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupClusteredNeg.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupClusteredNeg.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,13 @@ +spv.subgroupClusteredNeg.comp +ERROR: 0:22: 'cluster size' : argument must be at least 1 +ERROR: 0:24: 'cluster size' : argument must be a power of 2 +ERROR: 0:27: 'cluster size' : argument must be a power of 2 +ERROR: 0:29: 'cluster size' : argument must be at least 1 +ERROR: 0:31: 'cluster size' : argument must be at least 1 +ERROR: 0:33: 'cluster size' : argument must be compile-time constant +ERROR: 0:36: 'cluster size' : argument must be compile-time constant +ERROR: 0:37: 'cluster size' : argument must be compile-time constant +ERROR: 8 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroup.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroup.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroup.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroup.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,44 @@ +spv.subgroup.frag +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 17 + + Capability Shader + Capability GroupNonUniform + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 11 13 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + Name 4 "main" + Name 9 "data" + Name 11 "gl_SubgroupSize" + Name 13 "gl_SubgroupInvocationID" + Decorate 9(data) Location 0 + Decorate 11(gl_SubgroupSize) RelaxedPrecision + Decorate 11(gl_SubgroupSize) Flat + Decorate 11(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 12 RelaxedPrecision + Decorate 13(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 13(gl_SubgroupInvocationID) Flat + Decorate 13(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 14 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 4 + 8: TypePointer Output 7(ivec4) + 9(data): 8(ptr) Variable Output + 10: TypePointer Input 6(int) +11(gl_SubgroupSize): 10(ptr) Variable Input +13(gl_SubgroupInvocationID): 10(ptr) Variable Input + 15: 6(int) Constant 0 + 4(main): 2 Function None 3 + 5: Label + 12: 6(int) Load 11(gl_SubgroupSize) + 14: 6(int) Load 13(gl_SubgroupInvocationID) + 16: 7(ivec4) CompositeConstruct 12 14 15 15 + Store 9(data) 16 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroup.geom.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroup.geom.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroup.geom.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroup.geom.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,62 @@ +spv.subgroup.geom +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 26 + + Capability Geometry + Capability GroupNonUniform + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 15 18 20 + ExecutionMode 4 InputPoints + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputPoints + ExecutionMode 4 OutputVertices 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + Name 4 "main" + Name 9 "Output" + MemberName 9(Output) 0 "result" + Name 11 "" + Name 15 "gl_PrimitiveIDIn" + Name 18 "gl_SubgroupSize" + Name 20 "gl_SubgroupInvocationID" + Decorate 8 ArrayStride 16 + MemberDecorate 9(Output) 0 Offset 0 + Decorate 9(Output) BufferBlock + Decorate 11 DescriptorSet 0 + Decorate 11 Binding 0 + Decorate 15(gl_PrimitiveIDIn) BuiltIn PrimitiveId + Decorate 18(gl_SubgroupSize) RelaxedPrecision + Decorate 18(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 19 RelaxedPrecision + Decorate 20(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 20(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 21 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 4 + 8: TypeRuntimeArray 7(ivec4) + 9(Output): TypeStruct 8 + 10: TypePointer Uniform 9(Output) + 11: 10(ptr) Variable Uniform + 12: TypeInt 32 1 + 13: 12(int) Constant 0 + 14: TypePointer Input 12(int) +15(gl_PrimitiveIDIn): 14(ptr) Variable Input + 17: TypePointer Input 6(int) +18(gl_SubgroupSize): 17(ptr) Variable Input +20(gl_SubgroupInvocationID): 17(ptr) Variable Input + 22: 6(int) Constant 0 + 24: TypePointer Uniform 7(ivec4) + 4(main): 2 Function None 3 + 5: Label + 16: 12(int) Load 15(gl_PrimitiveIDIn) + 19: 6(int) Load 18(gl_SubgroupSize) + 21: 6(int) Load 20(gl_SubgroupInvocationID) + 23: 7(ivec4) CompositeConstruct 19 21 22 22 + 25: 24(ptr) AccessChain 11 13 16 + Store 25 23 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,2872 @@ +spv.subgroupPartitioned.comp +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 2506 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformPartitionedNV + Extension "SPV_NV_shader_subgroup_partitioned" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 10 12 + ExecutionMode 4 LocalSize 8 1 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + SourceExtension "GL_NV_shader_subgroup_partitioned" + Name 4 "main" + Name 8 "invocation" + Name 10 "gl_SubgroupInvocationID" + Name 12 "gl_SubgroupSize" + Name 19 "ballot" + Name 28 "Buffers" + MemberName 28(Buffers) 0 "f4" + MemberName 28(Buffers) 1 "i4" + MemberName 28(Buffers) 2 "u4" + MemberName 28(Buffers) 3 "d4" + Name 31 "data" + Decorate 10(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 10(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 11 RelaxedPrecision + Decorate 12(gl_SubgroupSize) RelaxedPrecision + Decorate 12(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 13 RelaxedPrecision + Decorate 14 RelaxedPrecision + Decorate 16 RelaxedPrecision + MemberDecorate 28(Buffers) 0 Offset 0 + MemberDecorate 28(Buffers) 1 Offset 16 + MemberDecorate 28(Buffers) 2 Offset 32 + MemberDecorate 28(Buffers) 3 Offset 64 + Decorate 28(Buffers) BufferBlock + Decorate 31(data) DescriptorSet 0 + Decorate 31(data) Binding 0 + Decorate 2505 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_SubgroupInvocationID): 9(ptr) Variable Input +12(gl_SubgroupSize): 9(ptr) Variable Input + 15: 6(int) Constant 4 + 17: TypeVector 6(int) 4 + 18: TypePointer Function 17(ivec4) + 22: TypeFloat 32 + 23: TypeVector 22(float) 4 + 24: TypeInt 32 1 + 25: TypeVector 24(int) 4 + 26: TypeFloat 64 + 27: TypeVector 26(float) 4 + 28(Buffers): TypeStruct 23(fvec4) 25(ivec4) 17(ivec4) 27(fvec4) + 29: TypeArray 28(Buffers) 15 + 30: TypePointer Uniform 29 + 31(data): 30(ptr) Variable Uniform + 33: 24(int) Constant 2 + 34: 24(int) Constant 0 + 35: 6(int) Constant 0 + 36: TypePointer Uniform 22(float) + 40: TypePointer Uniform 17(ivec4) + 43: TypeVector 22(float) 2 + 44: TypePointer Uniform 23(fvec4) + 51: TypeVector 22(float) 3 + 63: 24(int) Constant 1 + 64: TypePointer Uniform 24(int) + 70: TypeVector 24(int) 2 + 71: TypePointer Uniform 25(ivec4) + 78: TypeVector 24(int) 3 + 90: TypePointer Uniform 6(int) + 96: TypeVector 6(int) 2 + 103: TypeVector 6(int) 3 + 115: 24(int) Constant 3 + 116: TypePointer Uniform 26(float) + 122: TypeVector 26(float) 2 + 123: TypePointer Uniform 27(fvec4) + 130: TypeVector 26(float) 3 + 144: TypeBool + 152: TypeVector 144(bool) 2 + 153: 96(ivec2) ConstantComposite 35 35 + 161: TypeVector 144(bool) 3 + 162: 103(ivec3) ConstantComposite 35 35 35 + 169: TypeVector 144(bool) 4 + 170: 17(ivec4) ConstantComposite 35 35 35 35 + 178: 6(int) Constant 3 + 727: 70(ivec2) ConstantComposite 34 34 + 731: 70(ivec2) ConstantComposite 63 63 + 740: 78(ivec3) ConstantComposite 34 34 34 + 744: 78(ivec3) ConstantComposite 63 63 63 + 752: 25(ivec4) ConstantComposite 34 34 34 34 + 756: 25(ivec4) ConstantComposite 63 63 63 63 + 2503: 6(int) Constant 8 + 2504: 6(int) Constant 1 + 2505: 103(ivec3) ConstantComposite 2503 2504 2504 + 4(main): 2 Function None 3 + 5: Label + 8(invocation): 7(ptr) Variable Function + 19(ballot): 18(ptr) Variable Function + 11: 6(int) Load 10(gl_SubgroupInvocationID) + 13: 6(int) Load 12(gl_SubgroupSize) + 14: 6(int) IAdd 11 13 + 16: 6(int) UMod 14 15 + Store 8(invocation) 16 + 20: 6(int) Load 8(invocation) + 21: 17(ivec4) GroupNonUniformPartitionNV 20 + Store 19(ballot) 21 + 32: 6(int) Load 8(invocation) + 37: 36(ptr) AccessChain 31(data) 34 34 35 + 38: 22(float) Load 37 + 39: 17(ivec4) GroupNonUniformPartitionNV 38 + 41: 40(ptr) AccessChain 31(data) 32 33 + Store 41 39 + 42: 6(int) Load 8(invocation) + 45: 44(ptr) AccessChain 31(data) 34 34 + 46: 23(fvec4) Load 45 + 47: 43(fvec2) VectorShuffle 46 46 0 1 + 48: 17(ivec4) GroupNonUniformPartitionNV 47 + 49: 40(ptr) AccessChain 31(data) 42 33 + Store 49 48 + 50: 6(int) Load 8(invocation) + 52: 44(ptr) AccessChain 31(data) 34 34 + 53: 23(fvec4) Load 52 + 54: 51(fvec3) VectorShuffle 53 53 0 1 2 + 55: 17(ivec4) GroupNonUniformPartitionNV 54 + 56: 40(ptr) AccessChain 31(data) 50 33 + Store 56 55 + 57: 6(int) Load 8(invocation) + 58: 44(ptr) AccessChain 31(data) 34 34 + 59: 23(fvec4) Load 58 + 60: 17(ivec4) GroupNonUniformPartitionNV 59 + 61: 40(ptr) AccessChain 31(data) 57 33 + Store 61 60 + 62: 6(int) Load 8(invocation) + 65: 64(ptr) AccessChain 31(data) 34 63 35 + 66: 24(int) Load 65 + 67: 17(ivec4) GroupNonUniformPartitionNV 66 + 68: 40(ptr) AccessChain 31(data) 62 33 + Store 68 67 + 69: 6(int) Load 8(invocation) + 72: 71(ptr) AccessChain 31(data) 34 63 + 73: 25(ivec4) Load 72 + 74: 70(ivec2) VectorShuffle 73 73 0 1 + 75: 17(ivec4) GroupNonUniformPartitionNV 74 + 76: 40(ptr) AccessChain 31(data) 69 33 + Store 76 75 + 77: 6(int) Load 8(invocation) + 79: 71(ptr) AccessChain 31(data) 34 63 + 80: 25(ivec4) Load 79 + 81: 78(ivec3) VectorShuffle 80 80 0 1 2 + 82: 17(ivec4) GroupNonUniformPartitionNV 81 + 83: 40(ptr) AccessChain 31(data) 77 33 + Store 83 82 + 84: 6(int) Load 8(invocation) + 85: 71(ptr) AccessChain 31(data) 34 63 + 86: 25(ivec4) Load 85 + 87: 17(ivec4) GroupNonUniformPartitionNV 86 + 88: 40(ptr) AccessChain 31(data) 84 33 + Store 88 87 + 89: 6(int) Load 8(invocation) + 91: 90(ptr) AccessChain 31(data) 34 33 35 + 92: 6(int) Load 91 + 93: 17(ivec4) GroupNonUniformPartitionNV 92 + 94: 40(ptr) AccessChain 31(data) 89 33 + Store 94 93 + 95: 6(int) Load 8(invocation) + 97: 40(ptr) AccessChain 31(data) 34 33 + 98: 17(ivec4) Load 97 + 99: 96(ivec2) VectorShuffle 98 98 0 1 + 100: 17(ivec4) GroupNonUniformPartitionNV 99 + 101: 40(ptr) AccessChain 31(data) 95 33 + Store 101 100 + 102: 6(int) Load 8(invocation) + 104: 40(ptr) AccessChain 31(data) 34 33 + 105: 17(ivec4) Load 104 + 106: 103(ivec3) VectorShuffle 105 105 0 1 2 + 107: 17(ivec4) GroupNonUniformPartitionNV 106 + 108: 40(ptr) AccessChain 31(data) 102 33 + Store 108 107 + 109: 6(int) Load 8(invocation) + 110: 40(ptr) AccessChain 31(data) 34 33 + 111: 17(ivec4) Load 110 + 112: 17(ivec4) GroupNonUniformPartitionNV 111 + 113: 40(ptr) AccessChain 31(data) 109 33 + Store 113 112 + 114: 6(int) Load 8(invocation) + 117: 116(ptr) AccessChain 31(data) 34 115 35 + 118: 26(float) Load 117 + 119: 17(ivec4) GroupNonUniformPartitionNV 118 + 120: 40(ptr) AccessChain 31(data) 114 33 + Store 120 119 + 121: 6(int) Load 8(invocation) + 124: 123(ptr) AccessChain 31(data) 34 115 + 125: 27(fvec4) Load 124 + 126: 122(fvec2) VectorShuffle 125 125 0 1 + 127: 17(ivec4) GroupNonUniformPartitionNV 126 + 128: 40(ptr) AccessChain 31(data) 121 33 + Store 128 127 + 129: 6(int) Load 8(invocation) + 131: 123(ptr) AccessChain 31(data) 34 115 + 132: 27(fvec4) Load 131 + 133: 130(fvec3) VectorShuffle 132 132 0 1 2 + 134: 17(ivec4) GroupNonUniformPartitionNV 133 + 135: 40(ptr) AccessChain 31(data) 129 33 + Store 135 134 + 136: 6(int) Load 8(invocation) + 137: 123(ptr) AccessChain 31(data) 34 115 + 138: 27(fvec4) Load 137 + 139: 17(ivec4) GroupNonUniformPartitionNV 138 + 140: 40(ptr) AccessChain 31(data) 136 33 + Store 140 139 + 141: 6(int) Load 8(invocation) + 142: 64(ptr) AccessChain 31(data) 34 63 35 + 143: 24(int) Load 142 + 145: 144(bool) INotEqual 143 35 + 146: 17(ivec4) GroupNonUniformPartitionNV 145 + 147: 40(ptr) AccessChain 31(data) 141 33 + Store 147 146 + 148: 6(int) Load 8(invocation) + 149: 71(ptr) AccessChain 31(data) 34 63 + 150: 25(ivec4) Load 149 + 151: 70(ivec2) VectorShuffle 150 150 0 1 + 154: 152(bvec2) INotEqual 151 153 + 155: 17(ivec4) GroupNonUniformPartitionNV 154 + 156: 40(ptr) AccessChain 31(data) 148 33 + Store 156 155 + 157: 6(int) Load 8(invocation) + 158: 71(ptr) AccessChain 31(data) 34 63 + 159: 25(ivec4) Load 158 + 160: 78(ivec3) VectorShuffle 159 159 0 1 2 + 163: 161(bvec3) INotEqual 160 162 + 164: 17(ivec4) GroupNonUniformPartitionNV 163 + 165: 40(ptr) AccessChain 31(data) 157 33 + Store 165 164 + 166: 6(int) Load 8(invocation) + 167: 71(ptr) AccessChain 31(data) 34 63 + 168: 25(ivec4) Load 167 + 171: 169(bvec4) INotEqual 168 170 + 172: 17(ivec4) GroupNonUniformPartitionNV 171 + 173: 40(ptr) AccessChain 31(data) 166 33 + Store 173 172 + 174: 6(int) Load 8(invocation) + 175: 36(ptr) AccessChain 31(data) 34 34 35 + 176: 22(float) Load 175 + 177: 17(ivec4) Load 19(ballot) + 179: 22(float) GroupNonUniformFAdd 178 PartitionedReduceNV 176 177 + 180: 36(ptr) AccessChain 31(data) 174 34 35 + Store 180 179 + 181: 6(int) Load 8(invocation) + 182: 44(ptr) AccessChain 31(data) 63 34 + 183: 23(fvec4) Load 182 + 184: 43(fvec2) VectorShuffle 183 183 0 1 + 185: 17(ivec4) Load 19(ballot) + 186: 43(fvec2) GroupNonUniformFAdd 178 PartitionedReduceNV 184 185 + 187: 44(ptr) AccessChain 31(data) 181 34 + 188: 23(fvec4) Load 187 + 189: 23(fvec4) VectorShuffle 188 186 4 5 2 3 + Store 187 189 + 190: 6(int) Load 8(invocation) + 191: 44(ptr) AccessChain 31(data) 33 34 + 192: 23(fvec4) Load 191 + 193: 51(fvec3) VectorShuffle 192 192 0 1 2 + 194: 17(ivec4) Load 19(ballot) + 195: 51(fvec3) GroupNonUniformFAdd 178 PartitionedReduceNV 193 194 + 196: 44(ptr) AccessChain 31(data) 190 34 + 197: 23(fvec4) Load 196 + 198: 23(fvec4) VectorShuffle 197 195 4 5 6 3 + Store 196 198 + 199: 6(int) Load 8(invocation) + 200: 44(ptr) AccessChain 31(data) 115 34 + 201: 23(fvec4) Load 200 + 202: 17(ivec4) Load 19(ballot) + 203: 23(fvec4) GroupNonUniformFAdd 178 PartitionedReduceNV 201 202 + 204: 44(ptr) AccessChain 31(data) 199 34 + Store 204 203 + 205: 6(int) Load 8(invocation) + 206: 64(ptr) AccessChain 31(data) 34 63 35 + 207: 24(int) Load 206 + 208: 17(ivec4) Load 19(ballot) + 209: 24(int) GroupNonUniformIAdd 178 PartitionedReduceNV 207 208 + 210: 64(ptr) AccessChain 31(data) 205 63 35 + Store 210 209 + 211: 6(int) Load 8(invocation) + 212: 71(ptr) AccessChain 31(data) 63 63 + 213: 25(ivec4) Load 212 + 214: 70(ivec2) VectorShuffle 213 213 0 1 + 215: 17(ivec4) Load 19(ballot) + 216: 70(ivec2) GroupNonUniformIAdd 178 PartitionedReduceNV 214 215 + 217: 71(ptr) AccessChain 31(data) 211 63 + 218: 25(ivec4) Load 217 + 219: 25(ivec4) VectorShuffle 218 216 4 5 2 3 + Store 217 219 + 220: 6(int) Load 8(invocation) + 221: 71(ptr) AccessChain 31(data) 33 63 + 222: 25(ivec4) Load 221 + 223: 78(ivec3) VectorShuffle 222 222 0 1 2 + 224: 17(ivec4) Load 19(ballot) + 225: 78(ivec3) GroupNonUniformIAdd 178 PartitionedReduceNV 223 224 + 226: 71(ptr) AccessChain 31(data) 220 63 + 227: 25(ivec4) Load 226 + 228: 25(ivec4) VectorShuffle 227 225 4 5 6 3 + Store 226 228 + 229: 6(int) Load 8(invocation) + 230: 71(ptr) AccessChain 31(data) 115 63 + 231: 25(ivec4) Load 230 + 232: 17(ivec4) Load 19(ballot) + 233: 25(ivec4) GroupNonUniformIAdd 178 PartitionedReduceNV 231 232 + 234: 71(ptr) AccessChain 31(data) 229 63 + Store 234 233 + 235: 6(int) Load 8(invocation) + 236: 90(ptr) AccessChain 31(data) 34 33 35 + 237: 6(int) Load 236 + 238: 17(ivec4) Load 19(ballot) + 239: 6(int) GroupNonUniformIAdd 178 PartitionedReduceNV 237 238 + 240: 90(ptr) AccessChain 31(data) 235 33 35 + Store 240 239 + 241: 6(int) Load 8(invocation) + 242: 40(ptr) AccessChain 31(data) 63 33 + 243: 17(ivec4) Load 242 + 244: 96(ivec2) VectorShuffle 243 243 0 1 + 245: 17(ivec4) Load 19(ballot) + 246: 96(ivec2) GroupNonUniformIAdd 178 PartitionedReduceNV 244 245 + 247: 40(ptr) AccessChain 31(data) 241 33 + 248: 17(ivec4) Load 247 + 249: 17(ivec4) VectorShuffle 248 246 4 5 2 3 + Store 247 249 + 250: 6(int) Load 8(invocation) + 251: 40(ptr) AccessChain 31(data) 33 33 + 252: 17(ivec4) Load 251 + 253: 103(ivec3) VectorShuffle 252 252 0 1 2 + 254: 17(ivec4) Load 19(ballot) + 255: 103(ivec3) GroupNonUniformIAdd 178 PartitionedReduceNV 253 254 + 256: 40(ptr) AccessChain 31(data) 250 33 + 257: 17(ivec4) Load 256 + 258: 17(ivec4) VectorShuffle 257 255 4 5 6 3 + Store 256 258 + 259: 6(int) Load 8(invocation) + 260: 40(ptr) AccessChain 31(data) 115 33 + 261: 17(ivec4) Load 260 + 262: 17(ivec4) Load 19(ballot) + 263: 17(ivec4) GroupNonUniformIAdd 178 PartitionedReduceNV 261 262 + 264: 40(ptr) AccessChain 31(data) 259 33 + Store 264 263 + 265: 6(int) Load 8(invocation) + 266: 116(ptr) AccessChain 31(data) 34 115 35 + 267: 26(float) Load 266 + 268: 17(ivec4) Load 19(ballot) + 269: 26(float) GroupNonUniformFAdd 178 PartitionedReduceNV 267 268 + 270: 116(ptr) AccessChain 31(data) 265 115 35 + Store 270 269 + 271: 6(int) Load 8(invocation) + 272: 123(ptr) AccessChain 31(data) 63 115 + 273: 27(fvec4) Load 272 + 274: 122(fvec2) VectorShuffle 273 273 0 1 + 275: 17(ivec4) Load 19(ballot) + 276: 122(fvec2) GroupNonUniformFAdd 178 PartitionedReduceNV 274 275 + 277: 123(ptr) AccessChain 31(data) 271 115 + 278: 27(fvec4) Load 277 + 279: 27(fvec4) VectorShuffle 278 276 4 5 2 3 + Store 277 279 + 280: 6(int) Load 8(invocation) + 281: 123(ptr) AccessChain 31(data) 33 115 + 282: 27(fvec4) Load 281 + 283: 130(fvec3) VectorShuffle 282 282 0 1 2 + 284: 17(ivec4) Load 19(ballot) + 285: 130(fvec3) GroupNonUniformFAdd 178 PartitionedReduceNV 283 284 + 286: 123(ptr) AccessChain 31(data) 280 115 + 287: 27(fvec4) Load 286 + 288: 27(fvec4) VectorShuffle 287 285 4 5 6 3 + Store 286 288 + 289: 6(int) Load 8(invocation) + 290: 123(ptr) AccessChain 31(data) 115 115 + 291: 27(fvec4) Load 290 + 292: 17(ivec4) Load 19(ballot) + 293: 27(fvec4) GroupNonUniformFAdd 178 PartitionedReduceNV 291 292 + 294: 123(ptr) AccessChain 31(data) 289 115 + Store 294 293 + 295: 6(int) Load 8(invocation) + 296: 36(ptr) AccessChain 31(data) 34 34 35 + 297: 22(float) Load 296 + 298: 17(ivec4) Load 19(ballot) + 299: 22(float) GroupNonUniformFMul 178 PartitionedReduceNV 297 298 + 300: 36(ptr) AccessChain 31(data) 295 34 35 + Store 300 299 + 301: 6(int) Load 8(invocation) + 302: 44(ptr) AccessChain 31(data) 63 34 + 303: 23(fvec4) Load 302 + 304: 43(fvec2) VectorShuffle 303 303 0 1 + 305: 17(ivec4) Load 19(ballot) + 306: 43(fvec2) GroupNonUniformFMul 178 PartitionedReduceNV 304 305 + 307: 44(ptr) AccessChain 31(data) 301 34 + 308: 23(fvec4) Load 307 + 309: 23(fvec4) VectorShuffle 308 306 4 5 2 3 + Store 307 309 + 310: 6(int) Load 8(invocation) + 311: 44(ptr) AccessChain 31(data) 33 34 + 312: 23(fvec4) Load 311 + 313: 51(fvec3) VectorShuffle 312 312 0 1 2 + 314: 17(ivec4) Load 19(ballot) + 315: 51(fvec3) GroupNonUniformFMul 178 PartitionedReduceNV 313 314 + 316: 44(ptr) AccessChain 31(data) 310 34 + 317: 23(fvec4) Load 316 + 318: 23(fvec4) VectorShuffle 317 315 4 5 6 3 + Store 316 318 + 319: 6(int) Load 8(invocation) + 320: 44(ptr) AccessChain 31(data) 115 34 + 321: 23(fvec4) Load 320 + 322: 17(ivec4) Load 19(ballot) + 323: 23(fvec4) GroupNonUniformFMul 178 PartitionedReduceNV 321 322 + 324: 44(ptr) AccessChain 31(data) 319 34 + Store 324 323 + 325: 6(int) Load 8(invocation) + 326: 64(ptr) AccessChain 31(data) 34 63 35 + 327: 24(int) Load 326 + 328: 17(ivec4) Load 19(ballot) + 329: 24(int) GroupNonUniformIMul 178 PartitionedReduceNV 327 328 + 330: 64(ptr) AccessChain 31(data) 325 63 35 + Store 330 329 + 331: 6(int) Load 8(invocation) + 332: 71(ptr) AccessChain 31(data) 63 63 + 333: 25(ivec4) Load 332 + 334: 70(ivec2) VectorShuffle 333 333 0 1 + 335: 17(ivec4) Load 19(ballot) + 336: 70(ivec2) GroupNonUniformIMul 178 PartitionedReduceNV 334 335 + 337: 71(ptr) AccessChain 31(data) 331 63 + 338: 25(ivec4) Load 337 + 339: 25(ivec4) VectorShuffle 338 336 4 5 2 3 + Store 337 339 + 340: 6(int) Load 8(invocation) + 341: 71(ptr) AccessChain 31(data) 33 63 + 342: 25(ivec4) Load 341 + 343: 78(ivec3) VectorShuffle 342 342 0 1 2 + 344: 17(ivec4) Load 19(ballot) + 345: 78(ivec3) GroupNonUniformIMul 178 PartitionedReduceNV 343 344 + 346: 71(ptr) AccessChain 31(data) 340 63 + 347: 25(ivec4) Load 346 + 348: 25(ivec4) VectorShuffle 347 345 4 5 6 3 + Store 346 348 + 349: 6(int) Load 8(invocation) + 350: 71(ptr) AccessChain 31(data) 115 63 + 351: 25(ivec4) Load 350 + 352: 17(ivec4) Load 19(ballot) + 353: 25(ivec4) GroupNonUniformIMul 178 PartitionedReduceNV 351 352 + 354: 71(ptr) AccessChain 31(data) 349 63 + Store 354 353 + 355: 6(int) Load 8(invocation) + 356: 90(ptr) AccessChain 31(data) 34 33 35 + 357: 6(int) Load 356 + 358: 17(ivec4) Load 19(ballot) + 359: 6(int) GroupNonUniformIMul 178 PartitionedReduceNV 357 358 + 360: 90(ptr) AccessChain 31(data) 355 33 35 + Store 360 359 + 361: 6(int) Load 8(invocation) + 362: 40(ptr) AccessChain 31(data) 63 33 + 363: 17(ivec4) Load 362 + 364: 96(ivec2) VectorShuffle 363 363 0 1 + 365: 17(ivec4) Load 19(ballot) + 366: 96(ivec2) GroupNonUniformIMul 178 PartitionedReduceNV 364 365 + 367: 40(ptr) AccessChain 31(data) 361 33 + 368: 17(ivec4) Load 367 + 369: 17(ivec4) VectorShuffle 368 366 4 5 2 3 + Store 367 369 + 370: 6(int) Load 8(invocation) + 371: 40(ptr) AccessChain 31(data) 33 33 + 372: 17(ivec4) Load 371 + 373: 103(ivec3) VectorShuffle 372 372 0 1 2 + 374: 17(ivec4) Load 19(ballot) + 375: 103(ivec3) GroupNonUniformIMul 178 PartitionedReduceNV 373 374 + 376: 40(ptr) AccessChain 31(data) 370 33 + 377: 17(ivec4) Load 376 + 378: 17(ivec4) VectorShuffle 377 375 4 5 6 3 + Store 376 378 + 379: 6(int) Load 8(invocation) + 380: 40(ptr) AccessChain 31(data) 115 33 + 381: 17(ivec4) Load 380 + 382: 17(ivec4) Load 19(ballot) + 383: 17(ivec4) GroupNonUniformIMul 178 PartitionedReduceNV 381 382 + 384: 40(ptr) AccessChain 31(data) 379 33 + Store 384 383 + 385: 6(int) Load 8(invocation) + 386: 116(ptr) AccessChain 31(data) 34 115 35 + 387: 26(float) Load 386 + 388: 17(ivec4) Load 19(ballot) + 389: 26(float) GroupNonUniformFMul 178 PartitionedReduceNV 387 388 + 390: 116(ptr) AccessChain 31(data) 385 115 35 + Store 390 389 + 391: 6(int) Load 8(invocation) + 392: 123(ptr) AccessChain 31(data) 63 115 + 393: 27(fvec4) Load 392 + 394: 122(fvec2) VectorShuffle 393 393 0 1 + 395: 17(ivec4) Load 19(ballot) + 396: 122(fvec2) GroupNonUniformFMul 178 PartitionedReduceNV 394 395 + 397: 123(ptr) AccessChain 31(data) 391 115 + 398: 27(fvec4) Load 397 + 399: 27(fvec4) VectorShuffle 398 396 4 5 2 3 + Store 397 399 + 400: 6(int) Load 8(invocation) + 401: 123(ptr) AccessChain 31(data) 33 115 + 402: 27(fvec4) Load 401 + 403: 130(fvec3) VectorShuffle 402 402 0 1 2 + 404: 17(ivec4) Load 19(ballot) + 405: 130(fvec3) GroupNonUniformFMul 178 PartitionedReduceNV 403 404 + 406: 123(ptr) AccessChain 31(data) 400 115 + 407: 27(fvec4) Load 406 + 408: 27(fvec4) VectorShuffle 407 405 4 5 6 3 + Store 406 408 + 409: 6(int) Load 8(invocation) + 410: 123(ptr) AccessChain 31(data) 115 115 + 411: 27(fvec4) Load 410 + 412: 17(ivec4) Load 19(ballot) + 413: 27(fvec4) GroupNonUniformFMul 178 PartitionedReduceNV 411 412 + 414: 123(ptr) AccessChain 31(data) 409 115 + Store 414 413 + 415: 6(int) Load 8(invocation) + 416: 36(ptr) AccessChain 31(data) 34 34 35 + 417: 22(float) Load 416 + 418: 17(ivec4) Load 19(ballot) + 419: 22(float) GroupNonUniformFMin 178 PartitionedReduceNV 417 418 + 420: 36(ptr) AccessChain 31(data) 415 34 35 + Store 420 419 + 421: 6(int) Load 8(invocation) + 422: 44(ptr) AccessChain 31(data) 63 34 + 423: 23(fvec4) Load 422 + 424: 43(fvec2) VectorShuffle 423 423 0 1 + 425: 17(ivec4) Load 19(ballot) + 426: 43(fvec2) GroupNonUniformFMin 178 PartitionedReduceNV 424 425 + 427: 44(ptr) AccessChain 31(data) 421 34 + 428: 23(fvec4) Load 427 + 429: 23(fvec4) VectorShuffle 428 426 4 5 2 3 + Store 427 429 + 430: 6(int) Load 8(invocation) + 431: 44(ptr) AccessChain 31(data) 33 34 + 432: 23(fvec4) Load 431 + 433: 51(fvec3) VectorShuffle 432 432 0 1 2 + 434: 17(ivec4) Load 19(ballot) + 435: 51(fvec3) GroupNonUniformFMin 178 PartitionedReduceNV 433 434 + 436: 44(ptr) AccessChain 31(data) 430 34 + 437: 23(fvec4) Load 436 + 438: 23(fvec4) VectorShuffle 437 435 4 5 6 3 + Store 436 438 + 439: 6(int) Load 8(invocation) + 440: 44(ptr) AccessChain 31(data) 115 34 + 441: 23(fvec4) Load 440 + 442: 17(ivec4) Load 19(ballot) + 443: 23(fvec4) GroupNonUniformFMin 178 PartitionedReduceNV 441 442 + 444: 44(ptr) AccessChain 31(data) 439 34 + Store 444 443 + 445: 6(int) Load 8(invocation) + 446: 64(ptr) AccessChain 31(data) 34 63 35 + 447: 24(int) Load 446 + 448: 17(ivec4) Load 19(ballot) + 449: 24(int) GroupNonUniformSMin 178 PartitionedReduceNV 447 448 + 450: 64(ptr) AccessChain 31(data) 445 63 35 + Store 450 449 + 451: 6(int) Load 8(invocation) + 452: 71(ptr) AccessChain 31(data) 63 63 + 453: 25(ivec4) Load 452 + 454: 70(ivec2) VectorShuffle 453 453 0 1 + 455: 17(ivec4) Load 19(ballot) + 456: 70(ivec2) GroupNonUniformSMin 178 PartitionedReduceNV 454 455 + 457: 71(ptr) AccessChain 31(data) 451 63 + 458: 25(ivec4) Load 457 + 459: 25(ivec4) VectorShuffle 458 456 4 5 2 3 + Store 457 459 + 460: 6(int) Load 8(invocation) + 461: 71(ptr) AccessChain 31(data) 33 63 + 462: 25(ivec4) Load 461 + 463: 78(ivec3) VectorShuffle 462 462 0 1 2 + 464: 17(ivec4) Load 19(ballot) + 465: 78(ivec3) GroupNonUniformSMin 178 PartitionedReduceNV 463 464 + 466: 71(ptr) AccessChain 31(data) 460 63 + 467: 25(ivec4) Load 466 + 468: 25(ivec4) VectorShuffle 467 465 4 5 6 3 + Store 466 468 + 469: 6(int) Load 8(invocation) + 470: 71(ptr) AccessChain 31(data) 115 63 + 471: 25(ivec4) Load 470 + 472: 17(ivec4) Load 19(ballot) + 473: 25(ivec4) GroupNonUniformSMin 178 PartitionedReduceNV 471 472 + 474: 71(ptr) AccessChain 31(data) 469 63 + Store 474 473 + 475: 6(int) Load 8(invocation) + 476: 90(ptr) AccessChain 31(data) 34 33 35 + 477: 6(int) Load 476 + 478: 17(ivec4) Load 19(ballot) + 479: 6(int) GroupNonUniformUMin 178 PartitionedReduceNV 477 478 + 480: 90(ptr) AccessChain 31(data) 475 33 35 + Store 480 479 + 481: 6(int) Load 8(invocation) + 482: 40(ptr) AccessChain 31(data) 63 33 + 483: 17(ivec4) Load 482 + 484: 96(ivec2) VectorShuffle 483 483 0 1 + 485: 17(ivec4) Load 19(ballot) + 486: 96(ivec2) GroupNonUniformUMin 178 PartitionedReduceNV 484 485 + 487: 40(ptr) AccessChain 31(data) 481 33 + 488: 17(ivec4) Load 487 + 489: 17(ivec4) VectorShuffle 488 486 4 5 2 3 + Store 487 489 + 490: 6(int) Load 8(invocation) + 491: 40(ptr) AccessChain 31(data) 33 33 + 492: 17(ivec4) Load 491 + 493: 103(ivec3) VectorShuffle 492 492 0 1 2 + 494: 17(ivec4) Load 19(ballot) + 495: 103(ivec3) GroupNonUniformUMin 178 PartitionedReduceNV 493 494 + 496: 40(ptr) AccessChain 31(data) 490 33 + 497: 17(ivec4) Load 496 + 498: 17(ivec4) VectorShuffle 497 495 4 5 6 3 + Store 496 498 + 499: 6(int) Load 8(invocation) + 500: 40(ptr) AccessChain 31(data) 115 33 + 501: 17(ivec4) Load 500 + 502: 17(ivec4) Load 19(ballot) + 503: 17(ivec4) GroupNonUniformUMin 178 PartitionedReduceNV 501 502 + 504: 40(ptr) AccessChain 31(data) 499 33 + Store 504 503 + 505: 6(int) Load 8(invocation) + 506: 116(ptr) AccessChain 31(data) 34 115 35 + 507: 26(float) Load 506 + 508: 17(ivec4) Load 19(ballot) + 509: 26(float) GroupNonUniformFMin 178 PartitionedReduceNV 507 508 + 510: 116(ptr) AccessChain 31(data) 505 115 35 + Store 510 509 + 511: 6(int) Load 8(invocation) + 512: 123(ptr) AccessChain 31(data) 63 115 + 513: 27(fvec4) Load 512 + 514: 122(fvec2) VectorShuffle 513 513 0 1 + 515: 17(ivec4) Load 19(ballot) + 516: 122(fvec2) GroupNonUniformFMin 178 PartitionedReduceNV 514 515 + 517: 123(ptr) AccessChain 31(data) 511 115 + 518: 27(fvec4) Load 517 + 519: 27(fvec4) VectorShuffle 518 516 4 5 2 3 + Store 517 519 + 520: 6(int) Load 8(invocation) + 521: 123(ptr) AccessChain 31(data) 33 115 + 522: 27(fvec4) Load 521 + 523: 130(fvec3) VectorShuffle 522 522 0 1 2 + 524: 17(ivec4) Load 19(ballot) + 525: 130(fvec3) GroupNonUniformFMin 178 PartitionedReduceNV 523 524 + 526: 123(ptr) AccessChain 31(data) 520 115 + 527: 27(fvec4) Load 526 + 528: 27(fvec4) VectorShuffle 527 525 4 5 6 3 + Store 526 528 + 529: 6(int) Load 8(invocation) + 530: 123(ptr) AccessChain 31(data) 115 115 + 531: 27(fvec4) Load 530 + 532: 17(ivec4) Load 19(ballot) + 533: 27(fvec4) GroupNonUniformFMin 178 PartitionedReduceNV 531 532 + 534: 123(ptr) AccessChain 31(data) 529 115 + Store 534 533 + 535: 6(int) Load 8(invocation) + 536: 36(ptr) AccessChain 31(data) 34 34 35 + 537: 22(float) Load 536 + 538: 17(ivec4) Load 19(ballot) + 539: 22(float) GroupNonUniformFMax 178 PartitionedReduceNV 537 538 + 540: 36(ptr) AccessChain 31(data) 535 34 35 + Store 540 539 + 541: 6(int) Load 8(invocation) + 542: 44(ptr) AccessChain 31(data) 63 34 + 543: 23(fvec4) Load 542 + 544: 43(fvec2) VectorShuffle 543 543 0 1 + 545: 17(ivec4) Load 19(ballot) + 546: 43(fvec2) GroupNonUniformFMax 178 PartitionedReduceNV 544 545 + 547: 44(ptr) AccessChain 31(data) 541 34 + 548: 23(fvec4) Load 547 + 549: 23(fvec4) VectorShuffle 548 546 4 5 2 3 + Store 547 549 + 550: 6(int) Load 8(invocation) + 551: 44(ptr) AccessChain 31(data) 33 34 + 552: 23(fvec4) Load 551 + 553: 51(fvec3) VectorShuffle 552 552 0 1 2 + 554: 17(ivec4) Load 19(ballot) + 555: 51(fvec3) GroupNonUniformFMax 178 PartitionedReduceNV 553 554 + 556: 44(ptr) AccessChain 31(data) 550 34 + 557: 23(fvec4) Load 556 + 558: 23(fvec4) VectorShuffle 557 555 4 5 6 3 + Store 556 558 + 559: 6(int) Load 8(invocation) + 560: 44(ptr) AccessChain 31(data) 115 34 + 561: 23(fvec4) Load 560 + 562: 17(ivec4) Load 19(ballot) + 563: 23(fvec4) GroupNonUniformFMax 178 PartitionedReduceNV 561 562 + 564: 44(ptr) AccessChain 31(data) 559 34 + Store 564 563 + 565: 6(int) Load 8(invocation) + 566: 64(ptr) AccessChain 31(data) 34 63 35 + 567: 24(int) Load 566 + 568: 17(ivec4) Load 19(ballot) + 569: 24(int) GroupNonUniformSMax 178 PartitionedReduceNV 567 568 + 570: 64(ptr) AccessChain 31(data) 565 63 35 + Store 570 569 + 571: 6(int) Load 8(invocation) + 572: 71(ptr) AccessChain 31(data) 63 63 + 573: 25(ivec4) Load 572 + 574: 70(ivec2) VectorShuffle 573 573 0 1 + 575: 17(ivec4) Load 19(ballot) + 576: 70(ivec2) GroupNonUniformSMax 178 PartitionedReduceNV 574 575 + 577: 71(ptr) AccessChain 31(data) 571 63 + 578: 25(ivec4) Load 577 + 579: 25(ivec4) VectorShuffle 578 576 4 5 2 3 + Store 577 579 + 580: 6(int) Load 8(invocation) + 581: 71(ptr) AccessChain 31(data) 33 63 + 582: 25(ivec4) Load 581 + 583: 78(ivec3) VectorShuffle 582 582 0 1 2 + 584: 17(ivec4) Load 19(ballot) + 585: 78(ivec3) GroupNonUniformSMax 178 PartitionedReduceNV 583 584 + 586: 71(ptr) AccessChain 31(data) 580 63 + 587: 25(ivec4) Load 586 + 588: 25(ivec4) VectorShuffle 587 585 4 5 6 3 + Store 586 588 + 589: 6(int) Load 8(invocation) + 590: 71(ptr) AccessChain 31(data) 115 63 + 591: 25(ivec4) Load 590 + 592: 17(ivec4) Load 19(ballot) + 593: 25(ivec4) GroupNonUniformSMax 178 PartitionedReduceNV 591 592 + 594: 71(ptr) AccessChain 31(data) 589 63 + Store 594 593 + 595: 6(int) Load 8(invocation) + 596: 90(ptr) AccessChain 31(data) 34 33 35 + 597: 6(int) Load 596 + 598: 17(ivec4) Load 19(ballot) + 599: 6(int) GroupNonUniformUMax 178 PartitionedReduceNV 597 598 + 600: 90(ptr) AccessChain 31(data) 595 33 35 + Store 600 599 + 601: 6(int) Load 8(invocation) + 602: 40(ptr) AccessChain 31(data) 63 33 + 603: 17(ivec4) Load 602 + 604: 96(ivec2) VectorShuffle 603 603 0 1 + 605: 17(ivec4) Load 19(ballot) + 606: 96(ivec2) GroupNonUniformUMax 178 PartitionedReduceNV 604 605 + 607: 40(ptr) AccessChain 31(data) 601 33 + 608: 17(ivec4) Load 607 + 609: 17(ivec4) VectorShuffle 608 606 4 5 2 3 + Store 607 609 + 610: 6(int) Load 8(invocation) + 611: 40(ptr) AccessChain 31(data) 33 33 + 612: 17(ivec4) Load 611 + 613: 103(ivec3) VectorShuffle 612 612 0 1 2 + 614: 17(ivec4) Load 19(ballot) + 615: 103(ivec3) GroupNonUniformUMax 178 PartitionedReduceNV 613 614 + 616: 40(ptr) AccessChain 31(data) 610 33 + 617: 17(ivec4) Load 616 + 618: 17(ivec4) VectorShuffle 617 615 4 5 6 3 + Store 616 618 + 619: 6(int) Load 8(invocation) + 620: 40(ptr) AccessChain 31(data) 115 33 + 621: 17(ivec4) Load 620 + 622: 17(ivec4) Load 19(ballot) + 623: 17(ivec4) GroupNonUniformUMax 178 PartitionedReduceNV 621 622 + 624: 40(ptr) AccessChain 31(data) 619 33 + Store 624 623 + 625: 6(int) Load 8(invocation) + 626: 116(ptr) AccessChain 31(data) 34 115 35 + 627: 26(float) Load 626 + 628: 17(ivec4) Load 19(ballot) + 629: 26(float) GroupNonUniformFMax 178 PartitionedReduceNV 627 628 + 630: 116(ptr) AccessChain 31(data) 625 115 35 + Store 630 629 + 631: 6(int) Load 8(invocation) + 632: 123(ptr) AccessChain 31(data) 63 115 + 633: 27(fvec4) Load 632 + 634: 122(fvec2) VectorShuffle 633 633 0 1 + 635: 17(ivec4) Load 19(ballot) + 636: 122(fvec2) GroupNonUniformFMax 178 PartitionedReduceNV 634 635 + 637: 123(ptr) AccessChain 31(data) 631 115 + 638: 27(fvec4) Load 637 + 639: 27(fvec4) VectorShuffle 638 636 4 5 2 3 + Store 637 639 + 640: 6(int) Load 8(invocation) + 641: 123(ptr) AccessChain 31(data) 33 115 + 642: 27(fvec4) Load 641 + 643: 130(fvec3) VectorShuffle 642 642 0 1 2 + 644: 17(ivec4) Load 19(ballot) + 645: 130(fvec3) GroupNonUniformFMax 178 PartitionedReduceNV 643 644 + 646: 123(ptr) AccessChain 31(data) 640 115 + 647: 27(fvec4) Load 646 + 648: 27(fvec4) VectorShuffle 647 645 4 5 6 3 + Store 646 648 + 649: 6(int) Load 8(invocation) + 650: 123(ptr) AccessChain 31(data) 115 115 + 651: 27(fvec4) Load 650 + 652: 17(ivec4) Load 19(ballot) + 653: 27(fvec4) GroupNonUniformFMax 178 PartitionedReduceNV 651 652 + 654: 123(ptr) AccessChain 31(data) 649 115 + Store 654 653 + 655: 6(int) Load 8(invocation) + 656: 64(ptr) AccessChain 31(data) 34 63 35 + 657: 24(int) Load 656 + 658: 17(ivec4) Load 19(ballot) + 659: 24(int) GroupNonUniformBitwiseAnd 178 PartitionedReduceNV 657 658 + 660: 64(ptr) AccessChain 31(data) 655 63 35 + Store 660 659 + 661: 6(int) Load 8(invocation) + 662: 71(ptr) AccessChain 31(data) 63 63 + 663: 25(ivec4) Load 662 + 664: 70(ivec2) VectorShuffle 663 663 0 1 + 665: 17(ivec4) Load 19(ballot) + 666: 70(ivec2) GroupNonUniformBitwiseAnd 178 PartitionedReduceNV 664 665 + 667: 71(ptr) AccessChain 31(data) 661 63 + 668: 25(ivec4) Load 667 + 669: 25(ivec4) VectorShuffle 668 666 4 5 2 3 + Store 667 669 + 670: 6(int) Load 8(invocation) + 671: 71(ptr) AccessChain 31(data) 33 63 + 672: 25(ivec4) Load 671 + 673: 78(ivec3) VectorShuffle 672 672 0 1 2 + 674: 17(ivec4) Load 19(ballot) + 675: 78(ivec3) GroupNonUniformBitwiseAnd 178 PartitionedReduceNV 673 674 + 676: 71(ptr) AccessChain 31(data) 670 63 + 677: 25(ivec4) Load 676 + 678: 25(ivec4) VectorShuffle 677 675 4 5 6 3 + Store 676 678 + 679: 6(int) Load 8(invocation) + 680: 71(ptr) AccessChain 31(data) 115 63 + 681: 25(ivec4) Load 680 + 682: 17(ivec4) Load 19(ballot) + 683: 25(ivec4) GroupNonUniformBitwiseAnd 178 PartitionedReduceNV 681 682 + 684: 71(ptr) AccessChain 31(data) 679 63 + Store 684 683 + 685: 6(int) Load 8(invocation) + 686: 90(ptr) AccessChain 31(data) 34 33 35 + 687: 6(int) Load 686 + 688: 17(ivec4) Load 19(ballot) + 689: 6(int) GroupNonUniformBitwiseAnd 178 PartitionedReduceNV 687 688 + 690: 90(ptr) AccessChain 31(data) 685 33 35 + Store 690 689 + 691: 6(int) Load 8(invocation) + 692: 40(ptr) AccessChain 31(data) 63 33 + 693: 17(ivec4) Load 692 + 694: 96(ivec2) VectorShuffle 693 693 0 1 + 695: 17(ivec4) Load 19(ballot) + 696: 96(ivec2) GroupNonUniformBitwiseAnd 178 PartitionedReduceNV 694 695 + 697: 40(ptr) AccessChain 31(data) 691 33 + 698: 17(ivec4) Load 697 + 699: 17(ivec4) VectorShuffle 698 696 4 5 2 3 + Store 697 699 + 700: 6(int) Load 8(invocation) + 701: 40(ptr) AccessChain 31(data) 33 33 + 702: 17(ivec4) Load 701 + 703: 103(ivec3) VectorShuffle 702 702 0 1 2 + 704: 17(ivec4) Load 19(ballot) + 705: 103(ivec3) GroupNonUniformBitwiseAnd 178 PartitionedReduceNV 703 704 + 706: 40(ptr) AccessChain 31(data) 700 33 + 707: 17(ivec4) Load 706 + 708: 17(ivec4) VectorShuffle 707 705 4 5 6 3 + Store 706 708 + 709: 6(int) Load 8(invocation) + 710: 40(ptr) AccessChain 31(data) 115 33 + 711: 17(ivec4) Load 710 + 712: 17(ivec4) Load 19(ballot) + 713: 17(ivec4) GroupNonUniformBitwiseAnd 178 PartitionedReduceNV 711 712 + 714: 40(ptr) AccessChain 31(data) 709 33 + Store 714 713 + 715: 6(int) Load 8(invocation) + 716: 64(ptr) AccessChain 31(data) 34 63 35 + 717: 24(int) Load 716 + 718: 144(bool) SLessThan 717 34 + 719: 17(ivec4) Load 19(ballot) + 720: 144(bool) GroupNonUniformLogicalAnd 178 PartitionedReduceNV 718 719 + 721: 24(int) Select 720 63 34 + 722: 64(ptr) AccessChain 31(data) 715 63 35 + Store 722 721 + 723: 6(int) Load 8(invocation) + 724: 71(ptr) AccessChain 31(data) 63 63 + 725: 25(ivec4) Load 724 + 726: 70(ivec2) VectorShuffle 725 725 0 1 + 728: 152(bvec2) SLessThan 726 727 + 729: 17(ivec4) Load 19(ballot) + 730: 152(bvec2) GroupNonUniformLogicalAnd 178 PartitionedReduceNV 728 729 + 732: 70(ivec2) Select 730 731 727 + 733: 71(ptr) AccessChain 31(data) 723 63 + 734: 25(ivec4) Load 733 + 735: 25(ivec4) VectorShuffle 734 732 4 5 2 3 + Store 733 735 + 736: 6(int) Load 8(invocation) + 737: 71(ptr) AccessChain 31(data) 63 63 + 738: 25(ivec4) Load 737 + 739: 78(ivec3) VectorShuffle 738 738 0 1 2 + 741: 161(bvec3) SLessThan 739 740 + 742: 17(ivec4) Load 19(ballot) + 743: 161(bvec3) GroupNonUniformLogicalAnd 178 PartitionedReduceNV 741 742 + 745: 78(ivec3) Select 743 744 740 + 746: 71(ptr) AccessChain 31(data) 736 63 + 747: 25(ivec4) Load 746 + 748: 25(ivec4) VectorShuffle 747 745 4 5 6 3 + Store 746 748 + 749: 6(int) Load 8(invocation) + 750: 71(ptr) AccessChain 31(data) 63 63 + 751: 25(ivec4) Load 750 + 753: 169(bvec4) SLessThan 751 752 + 754: 17(ivec4) Load 19(ballot) + 755: 169(bvec4) GroupNonUniformLogicalAnd 178 PartitionedReduceNV 753 754 + 757: 25(ivec4) Select 755 756 752 + 758: 71(ptr) AccessChain 31(data) 749 63 + Store 758 757 + 759: 6(int) Load 8(invocation) + 760: 64(ptr) AccessChain 31(data) 34 63 35 + 761: 24(int) Load 760 + 762: 17(ivec4) Load 19(ballot) + 763: 24(int) GroupNonUniformBitwiseOr 178 PartitionedReduceNV 761 762 + 764: 64(ptr) AccessChain 31(data) 759 63 35 + Store 764 763 + 765: 6(int) Load 8(invocation) + 766: 71(ptr) AccessChain 31(data) 63 63 + 767: 25(ivec4) Load 766 + 768: 70(ivec2) VectorShuffle 767 767 0 1 + 769: 17(ivec4) Load 19(ballot) + 770: 70(ivec2) GroupNonUniformBitwiseOr 178 PartitionedReduceNV 768 769 + 771: 71(ptr) AccessChain 31(data) 765 63 + 772: 25(ivec4) Load 771 + 773: 25(ivec4) VectorShuffle 772 770 4 5 2 3 + Store 771 773 + 774: 6(int) Load 8(invocation) + 775: 71(ptr) AccessChain 31(data) 33 63 + 776: 25(ivec4) Load 775 + 777: 78(ivec3) VectorShuffle 776 776 0 1 2 + 778: 17(ivec4) Load 19(ballot) + 779: 78(ivec3) GroupNonUniformBitwiseOr 178 PartitionedReduceNV 777 778 + 780: 71(ptr) AccessChain 31(data) 774 63 + 781: 25(ivec4) Load 780 + 782: 25(ivec4) VectorShuffle 781 779 4 5 6 3 + Store 780 782 + 783: 6(int) Load 8(invocation) + 784: 71(ptr) AccessChain 31(data) 115 63 + 785: 25(ivec4) Load 784 + 786: 17(ivec4) Load 19(ballot) + 787: 25(ivec4) GroupNonUniformBitwiseOr 178 PartitionedReduceNV 785 786 + 788: 71(ptr) AccessChain 31(data) 783 63 + Store 788 787 + 789: 6(int) Load 8(invocation) + 790: 90(ptr) AccessChain 31(data) 34 33 35 + 791: 6(int) Load 790 + 792: 17(ivec4) Load 19(ballot) + 793: 6(int) GroupNonUniformBitwiseOr 178 PartitionedReduceNV 791 792 + 794: 90(ptr) AccessChain 31(data) 789 33 35 + Store 794 793 + 795: 6(int) Load 8(invocation) + 796: 40(ptr) AccessChain 31(data) 63 33 + 797: 17(ivec4) Load 796 + 798: 96(ivec2) VectorShuffle 797 797 0 1 + 799: 17(ivec4) Load 19(ballot) + 800: 96(ivec2) GroupNonUniformBitwiseOr 178 PartitionedReduceNV 798 799 + 801: 40(ptr) AccessChain 31(data) 795 33 + 802: 17(ivec4) Load 801 + 803: 17(ivec4) VectorShuffle 802 800 4 5 2 3 + Store 801 803 + 804: 6(int) Load 8(invocation) + 805: 40(ptr) AccessChain 31(data) 33 33 + 806: 17(ivec4) Load 805 + 807: 103(ivec3) VectorShuffle 806 806 0 1 2 + 808: 17(ivec4) Load 19(ballot) + 809: 103(ivec3) GroupNonUniformBitwiseOr 178 PartitionedReduceNV 807 808 + 810: 40(ptr) AccessChain 31(data) 804 33 + 811: 17(ivec4) Load 810 + 812: 17(ivec4) VectorShuffle 811 809 4 5 6 3 + Store 810 812 + 813: 6(int) Load 8(invocation) + 814: 40(ptr) AccessChain 31(data) 115 33 + 815: 17(ivec4) Load 814 + 816: 17(ivec4) Load 19(ballot) + 817: 17(ivec4) GroupNonUniformBitwiseOr 178 PartitionedReduceNV 815 816 + 818: 40(ptr) AccessChain 31(data) 813 33 + Store 818 817 + 819: 6(int) Load 8(invocation) + 820: 64(ptr) AccessChain 31(data) 34 63 35 + 821: 24(int) Load 820 + 822: 144(bool) SLessThan 821 34 + 823: 17(ivec4) Load 19(ballot) + 824: 144(bool) GroupNonUniformLogicalOr 178 PartitionedReduceNV 822 823 + 825: 24(int) Select 824 63 34 + 826: 64(ptr) AccessChain 31(data) 819 63 35 + Store 826 825 + 827: 6(int) Load 8(invocation) + 828: 71(ptr) AccessChain 31(data) 63 63 + 829: 25(ivec4) Load 828 + 830: 70(ivec2) VectorShuffle 829 829 0 1 + 831: 152(bvec2) SLessThan 830 727 + 832: 17(ivec4) Load 19(ballot) + 833: 152(bvec2) GroupNonUniformLogicalOr 178 PartitionedReduceNV 831 832 + 834: 70(ivec2) Select 833 731 727 + 835: 71(ptr) AccessChain 31(data) 827 63 + 836: 25(ivec4) Load 835 + 837: 25(ivec4) VectorShuffle 836 834 4 5 2 3 + Store 835 837 + 838: 6(int) Load 8(invocation) + 839: 71(ptr) AccessChain 31(data) 63 63 + 840: 25(ivec4) Load 839 + 841: 78(ivec3) VectorShuffle 840 840 0 1 2 + 842: 161(bvec3) SLessThan 841 740 + 843: 17(ivec4) Load 19(ballot) + 844: 161(bvec3) GroupNonUniformLogicalOr 178 PartitionedReduceNV 842 843 + 845: 78(ivec3) Select 844 744 740 + 846: 71(ptr) AccessChain 31(data) 838 63 + 847: 25(ivec4) Load 846 + 848: 25(ivec4) VectorShuffle 847 845 4 5 6 3 + Store 846 848 + 849: 6(int) Load 8(invocation) + 850: 71(ptr) AccessChain 31(data) 63 63 + 851: 25(ivec4) Load 850 + 852: 169(bvec4) SLessThan 851 752 + 853: 17(ivec4) Load 19(ballot) + 854: 169(bvec4) GroupNonUniformLogicalOr 178 PartitionedReduceNV 852 853 + 855: 25(ivec4) Select 854 756 752 + 856: 71(ptr) AccessChain 31(data) 849 63 + Store 856 855 + 857: 6(int) Load 8(invocation) + 858: 64(ptr) AccessChain 31(data) 34 63 35 + 859: 24(int) Load 858 + 860: 17(ivec4) Load 19(ballot) + 861: 24(int) GroupNonUniformBitwiseXor 178 PartitionedReduceNV 859 860 + 862: 64(ptr) AccessChain 31(data) 857 63 35 + Store 862 861 + 863: 6(int) Load 8(invocation) + 864: 71(ptr) AccessChain 31(data) 63 63 + 865: 25(ivec4) Load 864 + 866: 70(ivec2) VectorShuffle 865 865 0 1 + 867: 17(ivec4) Load 19(ballot) + 868: 70(ivec2) GroupNonUniformBitwiseXor 178 PartitionedReduceNV 866 867 + 869: 71(ptr) AccessChain 31(data) 863 63 + 870: 25(ivec4) Load 869 + 871: 25(ivec4) VectorShuffle 870 868 4 5 2 3 + Store 869 871 + 872: 6(int) Load 8(invocation) + 873: 71(ptr) AccessChain 31(data) 33 63 + 874: 25(ivec4) Load 873 + 875: 78(ivec3) VectorShuffle 874 874 0 1 2 + 876: 17(ivec4) Load 19(ballot) + 877: 78(ivec3) GroupNonUniformBitwiseXor 178 PartitionedReduceNV 875 876 + 878: 71(ptr) AccessChain 31(data) 872 63 + 879: 25(ivec4) Load 878 + 880: 25(ivec4) VectorShuffle 879 877 4 5 6 3 + Store 878 880 + 881: 6(int) Load 8(invocation) + 882: 71(ptr) AccessChain 31(data) 115 63 + 883: 25(ivec4) Load 882 + 884: 17(ivec4) Load 19(ballot) + 885: 25(ivec4) GroupNonUniformBitwiseXor 178 PartitionedReduceNV 883 884 + 886: 71(ptr) AccessChain 31(data) 881 63 + Store 886 885 + 887: 6(int) Load 8(invocation) + 888: 90(ptr) AccessChain 31(data) 34 33 35 + 889: 6(int) Load 888 + 890: 17(ivec4) Load 19(ballot) + 891: 6(int) GroupNonUniformBitwiseXor 178 PartitionedReduceNV 889 890 + 892: 90(ptr) AccessChain 31(data) 887 33 35 + Store 892 891 + 893: 6(int) Load 8(invocation) + 894: 40(ptr) AccessChain 31(data) 63 33 + 895: 17(ivec4) Load 894 + 896: 96(ivec2) VectorShuffle 895 895 0 1 + 897: 17(ivec4) Load 19(ballot) + 898: 96(ivec2) GroupNonUniformBitwiseXor 178 PartitionedReduceNV 896 897 + 899: 40(ptr) AccessChain 31(data) 893 33 + 900: 17(ivec4) Load 899 + 901: 17(ivec4) VectorShuffle 900 898 4 5 2 3 + Store 899 901 + 902: 6(int) Load 8(invocation) + 903: 40(ptr) AccessChain 31(data) 33 33 + 904: 17(ivec4) Load 903 + 905: 103(ivec3) VectorShuffle 904 904 0 1 2 + 906: 17(ivec4) Load 19(ballot) + 907: 103(ivec3) GroupNonUniformBitwiseXor 178 PartitionedReduceNV 905 906 + 908: 40(ptr) AccessChain 31(data) 902 33 + 909: 17(ivec4) Load 908 + 910: 17(ivec4) VectorShuffle 909 907 4 5 6 3 + Store 908 910 + 911: 6(int) Load 8(invocation) + 912: 40(ptr) AccessChain 31(data) 115 33 + 913: 17(ivec4) Load 912 + 914: 17(ivec4) Load 19(ballot) + 915: 17(ivec4) GroupNonUniformBitwiseXor 178 PartitionedReduceNV 913 914 + 916: 40(ptr) AccessChain 31(data) 911 33 + Store 916 915 + 917: 6(int) Load 8(invocation) + 918: 64(ptr) AccessChain 31(data) 34 63 35 + 919: 24(int) Load 918 + 920: 144(bool) SLessThan 919 34 + 921: 17(ivec4) Load 19(ballot) + 922: 144(bool) GroupNonUniformLogicalXor 178 PartitionedReduceNV 920 921 + 923: 24(int) Select 922 63 34 + 924: 64(ptr) AccessChain 31(data) 917 63 35 + Store 924 923 + 925: 6(int) Load 8(invocation) + 926: 71(ptr) AccessChain 31(data) 63 63 + 927: 25(ivec4) Load 926 + 928: 70(ivec2) VectorShuffle 927 927 0 1 + 929: 152(bvec2) SLessThan 928 727 + 930: 17(ivec4) Load 19(ballot) + 931: 152(bvec2) GroupNonUniformLogicalXor 178 PartitionedReduceNV 929 930 + 932: 70(ivec2) Select 931 731 727 + 933: 71(ptr) AccessChain 31(data) 925 63 + 934: 25(ivec4) Load 933 + 935: 25(ivec4) VectorShuffle 934 932 4 5 2 3 + Store 933 935 + 936: 6(int) Load 8(invocation) + 937: 71(ptr) AccessChain 31(data) 63 63 + 938: 25(ivec4) Load 937 + 939: 78(ivec3) VectorShuffle 938 938 0 1 2 + 940: 161(bvec3) SLessThan 939 740 + 941: 17(ivec4) Load 19(ballot) + 942: 161(bvec3) GroupNonUniformLogicalXor 178 PartitionedReduceNV 940 941 + 943: 78(ivec3) Select 942 744 740 + 944: 71(ptr) AccessChain 31(data) 936 63 + 945: 25(ivec4) Load 944 + 946: 25(ivec4) VectorShuffle 945 943 4 5 6 3 + Store 944 946 + 947: 6(int) Load 8(invocation) + 948: 71(ptr) AccessChain 31(data) 63 63 + 949: 25(ivec4) Load 948 + 950: 169(bvec4) SLessThan 949 752 + 951: 17(ivec4) Load 19(ballot) + 952: 169(bvec4) GroupNonUniformLogicalXor 178 PartitionedReduceNV 950 951 + 953: 25(ivec4) Select 952 756 752 + 954: 71(ptr) AccessChain 31(data) 947 63 + Store 954 953 + 955: 6(int) Load 8(invocation) + 956: 36(ptr) AccessChain 31(data) 34 34 35 + 957: 22(float) Load 956 + 958: 17(ivec4) Load 19(ballot) + 959: 22(float) GroupNonUniformFAdd 178 PartitionedInclusiveScanNV 957 958 + 960: 36(ptr) AccessChain 31(data) 955 34 35 + Store 960 959 + 961: 6(int) Load 8(invocation) + 962: 44(ptr) AccessChain 31(data) 63 34 + 963: 23(fvec4) Load 962 + 964: 43(fvec2) VectorShuffle 963 963 0 1 + 965: 17(ivec4) Load 19(ballot) + 966: 43(fvec2) GroupNonUniformFAdd 178 PartitionedInclusiveScanNV 964 965 + 967: 44(ptr) AccessChain 31(data) 961 34 + 968: 23(fvec4) Load 967 + 969: 23(fvec4) VectorShuffle 968 966 4 5 2 3 + Store 967 969 + 970: 6(int) Load 8(invocation) + 971: 44(ptr) AccessChain 31(data) 33 34 + 972: 23(fvec4) Load 971 + 973: 51(fvec3) VectorShuffle 972 972 0 1 2 + 974: 17(ivec4) Load 19(ballot) + 975: 51(fvec3) GroupNonUniformFAdd 178 PartitionedInclusiveScanNV 973 974 + 976: 44(ptr) AccessChain 31(data) 970 34 + 977: 23(fvec4) Load 976 + 978: 23(fvec4) VectorShuffle 977 975 4 5 6 3 + Store 976 978 + 979: 6(int) Load 8(invocation) + 980: 44(ptr) AccessChain 31(data) 115 34 + 981: 23(fvec4) Load 980 + 982: 17(ivec4) Load 19(ballot) + 983: 23(fvec4) GroupNonUniformFAdd 178 PartitionedInclusiveScanNV 981 982 + 984: 44(ptr) AccessChain 31(data) 979 34 + Store 984 983 + 985: 6(int) Load 8(invocation) + 986: 64(ptr) AccessChain 31(data) 34 63 35 + 987: 24(int) Load 986 + 988: 17(ivec4) Load 19(ballot) + 989: 24(int) GroupNonUniformIAdd 178 PartitionedInclusiveScanNV 987 988 + 990: 64(ptr) AccessChain 31(data) 985 63 35 + Store 990 989 + 991: 6(int) Load 8(invocation) + 992: 71(ptr) AccessChain 31(data) 63 63 + 993: 25(ivec4) Load 992 + 994: 70(ivec2) VectorShuffle 993 993 0 1 + 995: 17(ivec4) Load 19(ballot) + 996: 70(ivec2) GroupNonUniformIAdd 178 PartitionedInclusiveScanNV 994 995 + 997: 71(ptr) AccessChain 31(data) 991 63 + 998: 25(ivec4) Load 997 + 999: 25(ivec4) VectorShuffle 998 996 4 5 2 3 + Store 997 999 + 1000: 6(int) Load 8(invocation) + 1001: 71(ptr) AccessChain 31(data) 33 63 + 1002: 25(ivec4) Load 1001 + 1003: 78(ivec3) VectorShuffle 1002 1002 0 1 2 + 1004: 17(ivec4) Load 19(ballot) + 1005: 78(ivec3) GroupNonUniformIAdd 178 PartitionedInclusiveScanNV 1003 1004 + 1006: 71(ptr) AccessChain 31(data) 1000 63 + 1007: 25(ivec4) Load 1006 + 1008: 25(ivec4) VectorShuffle 1007 1005 4 5 6 3 + Store 1006 1008 + 1009: 6(int) Load 8(invocation) + 1010: 71(ptr) AccessChain 31(data) 115 63 + 1011: 25(ivec4) Load 1010 + 1012: 17(ivec4) Load 19(ballot) + 1013: 25(ivec4) GroupNonUniformIAdd 178 PartitionedInclusiveScanNV 1011 1012 + 1014: 71(ptr) AccessChain 31(data) 1009 63 + Store 1014 1013 + 1015: 6(int) Load 8(invocation) + 1016: 90(ptr) AccessChain 31(data) 34 33 35 + 1017: 6(int) Load 1016 + 1018: 17(ivec4) Load 19(ballot) + 1019: 6(int) GroupNonUniformIAdd 178 PartitionedInclusiveScanNV 1017 1018 + 1020: 90(ptr) AccessChain 31(data) 1015 33 35 + Store 1020 1019 + 1021: 6(int) Load 8(invocation) + 1022: 40(ptr) AccessChain 31(data) 63 33 + 1023: 17(ivec4) Load 1022 + 1024: 96(ivec2) VectorShuffle 1023 1023 0 1 + 1025: 17(ivec4) Load 19(ballot) + 1026: 96(ivec2) GroupNonUniformIAdd 178 PartitionedInclusiveScanNV 1024 1025 + 1027: 40(ptr) AccessChain 31(data) 1021 33 + 1028: 17(ivec4) Load 1027 + 1029: 17(ivec4) VectorShuffle 1028 1026 4 5 2 3 + Store 1027 1029 + 1030: 6(int) Load 8(invocation) + 1031: 40(ptr) AccessChain 31(data) 33 33 + 1032: 17(ivec4) Load 1031 + 1033: 103(ivec3) VectorShuffle 1032 1032 0 1 2 + 1034: 17(ivec4) Load 19(ballot) + 1035: 103(ivec3) GroupNonUniformIAdd 178 PartitionedInclusiveScanNV 1033 1034 + 1036: 40(ptr) AccessChain 31(data) 1030 33 + 1037: 17(ivec4) Load 1036 + 1038: 17(ivec4) VectorShuffle 1037 1035 4 5 6 3 + Store 1036 1038 + 1039: 6(int) Load 8(invocation) + 1040: 40(ptr) AccessChain 31(data) 115 33 + 1041: 17(ivec4) Load 1040 + 1042: 17(ivec4) Load 19(ballot) + 1043: 17(ivec4) GroupNonUniformIAdd 178 PartitionedInclusiveScanNV 1041 1042 + 1044: 40(ptr) AccessChain 31(data) 1039 33 + Store 1044 1043 + 1045: 6(int) Load 8(invocation) + 1046: 116(ptr) AccessChain 31(data) 34 115 35 + 1047: 26(float) Load 1046 + 1048: 17(ivec4) Load 19(ballot) + 1049: 26(float) GroupNonUniformFAdd 178 PartitionedInclusiveScanNV 1047 1048 + 1050: 116(ptr) AccessChain 31(data) 1045 115 35 + Store 1050 1049 + 1051: 6(int) Load 8(invocation) + 1052: 123(ptr) AccessChain 31(data) 63 115 + 1053: 27(fvec4) Load 1052 + 1054: 122(fvec2) VectorShuffle 1053 1053 0 1 + 1055: 17(ivec4) Load 19(ballot) + 1056: 122(fvec2) GroupNonUniformFAdd 178 PartitionedInclusiveScanNV 1054 1055 + 1057: 123(ptr) AccessChain 31(data) 1051 115 + 1058: 27(fvec4) Load 1057 + 1059: 27(fvec4) VectorShuffle 1058 1056 4 5 2 3 + Store 1057 1059 + 1060: 6(int) Load 8(invocation) + 1061: 123(ptr) AccessChain 31(data) 33 115 + 1062: 27(fvec4) Load 1061 + 1063: 130(fvec3) VectorShuffle 1062 1062 0 1 2 + 1064: 17(ivec4) Load 19(ballot) + 1065: 130(fvec3) GroupNonUniformFAdd 178 PartitionedInclusiveScanNV 1063 1064 + 1066: 123(ptr) AccessChain 31(data) 1060 115 + 1067: 27(fvec4) Load 1066 + 1068: 27(fvec4) VectorShuffle 1067 1065 4 5 6 3 + Store 1066 1068 + 1069: 6(int) Load 8(invocation) + 1070: 123(ptr) AccessChain 31(data) 115 115 + 1071: 27(fvec4) Load 1070 + 1072: 17(ivec4) Load 19(ballot) + 1073: 27(fvec4) GroupNonUniformFAdd 178 PartitionedInclusiveScanNV 1071 1072 + 1074: 123(ptr) AccessChain 31(data) 1069 115 + Store 1074 1073 + 1075: 6(int) Load 8(invocation) + 1076: 36(ptr) AccessChain 31(data) 34 34 35 + 1077: 22(float) Load 1076 + 1078: 17(ivec4) Load 19(ballot) + 1079: 22(float) GroupNonUniformFMul 178 PartitionedInclusiveScanNV 1077 1078 + 1080: 36(ptr) AccessChain 31(data) 1075 34 35 + Store 1080 1079 + 1081: 6(int) Load 8(invocation) + 1082: 44(ptr) AccessChain 31(data) 63 34 + 1083: 23(fvec4) Load 1082 + 1084: 43(fvec2) VectorShuffle 1083 1083 0 1 + 1085: 17(ivec4) Load 19(ballot) + 1086: 43(fvec2) GroupNonUniformFMul 178 PartitionedInclusiveScanNV 1084 1085 + 1087: 44(ptr) AccessChain 31(data) 1081 34 + 1088: 23(fvec4) Load 1087 + 1089: 23(fvec4) VectorShuffle 1088 1086 4 5 2 3 + Store 1087 1089 + 1090: 6(int) Load 8(invocation) + 1091: 44(ptr) AccessChain 31(data) 33 34 + 1092: 23(fvec4) Load 1091 + 1093: 51(fvec3) VectorShuffle 1092 1092 0 1 2 + 1094: 17(ivec4) Load 19(ballot) + 1095: 51(fvec3) GroupNonUniformFMul 178 PartitionedInclusiveScanNV 1093 1094 + 1096: 44(ptr) AccessChain 31(data) 1090 34 + 1097: 23(fvec4) Load 1096 + 1098: 23(fvec4) VectorShuffle 1097 1095 4 5 6 3 + Store 1096 1098 + 1099: 6(int) Load 8(invocation) + 1100: 44(ptr) AccessChain 31(data) 115 34 + 1101: 23(fvec4) Load 1100 + 1102: 17(ivec4) Load 19(ballot) + 1103: 23(fvec4) GroupNonUniformFMul 178 PartitionedInclusiveScanNV 1101 1102 + 1104: 44(ptr) AccessChain 31(data) 1099 34 + Store 1104 1103 + 1105: 6(int) Load 8(invocation) + 1106: 64(ptr) AccessChain 31(data) 34 63 35 + 1107: 24(int) Load 1106 + 1108: 17(ivec4) Load 19(ballot) + 1109: 24(int) GroupNonUniformIMul 178 PartitionedInclusiveScanNV 1107 1108 + 1110: 64(ptr) AccessChain 31(data) 1105 63 35 + Store 1110 1109 + 1111: 6(int) Load 8(invocation) + 1112: 71(ptr) AccessChain 31(data) 63 63 + 1113: 25(ivec4) Load 1112 + 1114: 70(ivec2) VectorShuffle 1113 1113 0 1 + 1115: 17(ivec4) Load 19(ballot) + 1116: 70(ivec2) GroupNonUniformIMul 178 PartitionedInclusiveScanNV 1114 1115 + 1117: 71(ptr) AccessChain 31(data) 1111 63 + 1118: 25(ivec4) Load 1117 + 1119: 25(ivec4) VectorShuffle 1118 1116 4 5 2 3 + Store 1117 1119 + 1120: 6(int) Load 8(invocation) + 1121: 71(ptr) AccessChain 31(data) 33 63 + 1122: 25(ivec4) Load 1121 + 1123: 78(ivec3) VectorShuffle 1122 1122 0 1 2 + 1124: 17(ivec4) Load 19(ballot) + 1125: 78(ivec3) GroupNonUniformIMul 178 PartitionedInclusiveScanNV 1123 1124 + 1126: 71(ptr) AccessChain 31(data) 1120 63 + 1127: 25(ivec4) Load 1126 + 1128: 25(ivec4) VectorShuffle 1127 1125 4 5 6 3 + Store 1126 1128 + 1129: 6(int) Load 8(invocation) + 1130: 71(ptr) AccessChain 31(data) 115 63 + 1131: 25(ivec4) Load 1130 + 1132: 17(ivec4) Load 19(ballot) + 1133: 25(ivec4) GroupNonUniformIMul 178 PartitionedInclusiveScanNV 1131 1132 + 1134: 71(ptr) AccessChain 31(data) 1129 63 + Store 1134 1133 + 1135: 6(int) Load 8(invocation) + 1136: 90(ptr) AccessChain 31(data) 34 33 35 + 1137: 6(int) Load 1136 + 1138: 17(ivec4) Load 19(ballot) + 1139: 6(int) GroupNonUniformIMul 178 PartitionedInclusiveScanNV 1137 1138 + 1140: 90(ptr) AccessChain 31(data) 1135 33 35 + Store 1140 1139 + 1141: 6(int) Load 8(invocation) + 1142: 40(ptr) AccessChain 31(data) 63 33 + 1143: 17(ivec4) Load 1142 + 1144: 96(ivec2) VectorShuffle 1143 1143 0 1 + 1145: 17(ivec4) Load 19(ballot) + 1146: 96(ivec2) GroupNonUniformIMul 178 PartitionedInclusiveScanNV 1144 1145 + 1147: 40(ptr) AccessChain 31(data) 1141 33 + 1148: 17(ivec4) Load 1147 + 1149: 17(ivec4) VectorShuffle 1148 1146 4 5 2 3 + Store 1147 1149 + 1150: 6(int) Load 8(invocation) + 1151: 40(ptr) AccessChain 31(data) 33 33 + 1152: 17(ivec4) Load 1151 + 1153: 103(ivec3) VectorShuffle 1152 1152 0 1 2 + 1154: 17(ivec4) Load 19(ballot) + 1155: 103(ivec3) GroupNonUniformIMul 178 PartitionedInclusiveScanNV 1153 1154 + 1156: 40(ptr) AccessChain 31(data) 1150 33 + 1157: 17(ivec4) Load 1156 + 1158: 17(ivec4) VectorShuffle 1157 1155 4 5 6 3 + Store 1156 1158 + 1159: 6(int) Load 8(invocation) + 1160: 40(ptr) AccessChain 31(data) 115 33 + 1161: 17(ivec4) Load 1160 + 1162: 17(ivec4) Load 19(ballot) + 1163: 17(ivec4) GroupNonUniformIMul 178 PartitionedInclusiveScanNV 1161 1162 + 1164: 40(ptr) AccessChain 31(data) 1159 33 + Store 1164 1163 + 1165: 6(int) Load 8(invocation) + 1166: 116(ptr) AccessChain 31(data) 34 115 35 + 1167: 26(float) Load 1166 + 1168: 17(ivec4) Load 19(ballot) + 1169: 26(float) GroupNonUniformFMul 178 PartitionedInclusiveScanNV 1167 1168 + 1170: 116(ptr) AccessChain 31(data) 1165 115 35 + Store 1170 1169 + 1171: 6(int) Load 8(invocation) + 1172: 123(ptr) AccessChain 31(data) 63 115 + 1173: 27(fvec4) Load 1172 + 1174: 122(fvec2) VectorShuffle 1173 1173 0 1 + 1175: 17(ivec4) Load 19(ballot) + 1176: 122(fvec2) GroupNonUniformFMul 178 PartitionedInclusiveScanNV 1174 1175 + 1177: 123(ptr) AccessChain 31(data) 1171 115 + 1178: 27(fvec4) Load 1177 + 1179: 27(fvec4) VectorShuffle 1178 1176 4 5 2 3 + Store 1177 1179 + 1180: 6(int) Load 8(invocation) + 1181: 123(ptr) AccessChain 31(data) 33 115 + 1182: 27(fvec4) Load 1181 + 1183: 130(fvec3) VectorShuffle 1182 1182 0 1 2 + 1184: 17(ivec4) Load 19(ballot) + 1185: 130(fvec3) GroupNonUniformFMul 178 PartitionedInclusiveScanNV 1183 1184 + 1186: 123(ptr) AccessChain 31(data) 1180 115 + 1187: 27(fvec4) Load 1186 + 1188: 27(fvec4) VectorShuffle 1187 1185 4 5 6 3 + Store 1186 1188 + 1189: 6(int) Load 8(invocation) + 1190: 123(ptr) AccessChain 31(data) 115 115 + 1191: 27(fvec4) Load 1190 + 1192: 17(ivec4) Load 19(ballot) + 1193: 27(fvec4) GroupNonUniformFMul 178 PartitionedInclusiveScanNV 1191 1192 + 1194: 123(ptr) AccessChain 31(data) 1189 115 + Store 1194 1193 + 1195: 6(int) Load 8(invocation) + 1196: 36(ptr) AccessChain 31(data) 34 34 35 + 1197: 22(float) Load 1196 + 1198: 17(ivec4) Load 19(ballot) + 1199: 22(float) GroupNonUniformFMin 178 PartitionedInclusiveScanNV 1197 1198 + 1200: 36(ptr) AccessChain 31(data) 1195 34 35 + Store 1200 1199 + 1201: 6(int) Load 8(invocation) + 1202: 44(ptr) AccessChain 31(data) 63 34 + 1203: 23(fvec4) Load 1202 + 1204: 43(fvec2) VectorShuffle 1203 1203 0 1 + 1205: 17(ivec4) Load 19(ballot) + 1206: 43(fvec2) GroupNonUniformFMin 178 PartitionedInclusiveScanNV 1204 1205 + 1207: 44(ptr) AccessChain 31(data) 1201 34 + 1208: 23(fvec4) Load 1207 + 1209: 23(fvec4) VectorShuffle 1208 1206 4 5 2 3 + Store 1207 1209 + 1210: 6(int) Load 8(invocation) + 1211: 44(ptr) AccessChain 31(data) 33 34 + 1212: 23(fvec4) Load 1211 + 1213: 51(fvec3) VectorShuffle 1212 1212 0 1 2 + 1214: 17(ivec4) Load 19(ballot) + 1215: 51(fvec3) GroupNonUniformFMin 178 PartitionedInclusiveScanNV 1213 1214 + 1216: 44(ptr) AccessChain 31(data) 1210 34 + 1217: 23(fvec4) Load 1216 + 1218: 23(fvec4) VectorShuffle 1217 1215 4 5 6 3 + Store 1216 1218 + 1219: 6(int) Load 8(invocation) + 1220: 44(ptr) AccessChain 31(data) 115 34 + 1221: 23(fvec4) Load 1220 + 1222: 17(ivec4) Load 19(ballot) + 1223: 23(fvec4) GroupNonUniformFMin 178 PartitionedInclusiveScanNV 1221 1222 + 1224: 44(ptr) AccessChain 31(data) 1219 34 + Store 1224 1223 + 1225: 6(int) Load 8(invocation) + 1226: 64(ptr) AccessChain 31(data) 34 63 35 + 1227: 24(int) Load 1226 + 1228: 17(ivec4) Load 19(ballot) + 1229: 24(int) GroupNonUniformSMin 178 PartitionedInclusiveScanNV 1227 1228 + 1230: 64(ptr) AccessChain 31(data) 1225 63 35 + Store 1230 1229 + 1231: 6(int) Load 8(invocation) + 1232: 71(ptr) AccessChain 31(data) 63 63 + 1233: 25(ivec4) Load 1232 + 1234: 70(ivec2) VectorShuffle 1233 1233 0 1 + 1235: 17(ivec4) Load 19(ballot) + 1236: 70(ivec2) GroupNonUniformSMin 178 PartitionedInclusiveScanNV 1234 1235 + 1237: 71(ptr) AccessChain 31(data) 1231 63 + 1238: 25(ivec4) Load 1237 + 1239: 25(ivec4) VectorShuffle 1238 1236 4 5 2 3 + Store 1237 1239 + 1240: 6(int) Load 8(invocation) + 1241: 71(ptr) AccessChain 31(data) 33 63 + 1242: 25(ivec4) Load 1241 + 1243: 78(ivec3) VectorShuffle 1242 1242 0 1 2 + 1244: 17(ivec4) Load 19(ballot) + 1245: 78(ivec3) GroupNonUniformSMin 178 PartitionedInclusiveScanNV 1243 1244 + 1246: 71(ptr) AccessChain 31(data) 1240 63 + 1247: 25(ivec4) Load 1246 + 1248: 25(ivec4) VectorShuffle 1247 1245 4 5 6 3 + Store 1246 1248 + 1249: 6(int) Load 8(invocation) + 1250: 71(ptr) AccessChain 31(data) 115 63 + 1251: 25(ivec4) Load 1250 + 1252: 17(ivec4) Load 19(ballot) + 1253: 25(ivec4) GroupNonUniformSMin 178 PartitionedInclusiveScanNV 1251 1252 + 1254: 71(ptr) AccessChain 31(data) 1249 63 + Store 1254 1253 + 1255: 6(int) Load 8(invocation) + 1256: 90(ptr) AccessChain 31(data) 34 33 35 + 1257: 6(int) Load 1256 + 1258: 17(ivec4) Load 19(ballot) + 1259: 6(int) GroupNonUniformUMin 178 PartitionedInclusiveScanNV 1257 1258 + 1260: 90(ptr) AccessChain 31(data) 1255 33 35 + Store 1260 1259 + 1261: 6(int) Load 8(invocation) + 1262: 40(ptr) AccessChain 31(data) 63 33 + 1263: 17(ivec4) Load 1262 + 1264: 96(ivec2) VectorShuffle 1263 1263 0 1 + 1265: 17(ivec4) Load 19(ballot) + 1266: 96(ivec2) GroupNonUniformUMin 178 PartitionedInclusiveScanNV 1264 1265 + 1267: 40(ptr) AccessChain 31(data) 1261 33 + 1268: 17(ivec4) Load 1267 + 1269: 17(ivec4) VectorShuffle 1268 1266 4 5 2 3 + Store 1267 1269 + 1270: 6(int) Load 8(invocation) + 1271: 40(ptr) AccessChain 31(data) 33 33 + 1272: 17(ivec4) Load 1271 + 1273: 103(ivec3) VectorShuffle 1272 1272 0 1 2 + 1274: 17(ivec4) Load 19(ballot) + 1275: 103(ivec3) GroupNonUniformUMin 178 PartitionedInclusiveScanNV 1273 1274 + 1276: 40(ptr) AccessChain 31(data) 1270 33 + 1277: 17(ivec4) Load 1276 + 1278: 17(ivec4) VectorShuffle 1277 1275 4 5 6 3 + Store 1276 1278 + 1279: 6(int) Load 8(invocation) + 1280: 40(ptr) AccessChain 31(data) 115 33 + 1281: 17(ivec4) Load 1280 + 1282: 17(ivec4) Load 19(ballot) + 1283: 17(ivec4) GroupNonUniformUMin 178 PartitionedInclusiveScanNV 1281 1282 + 1284: 40(ptr) AccessChain 31(data) 1279 33 + Store 1284 1283 + 1285: 6(int) Load 8(invocation) + 1286: 116(ptr) AccessChain 31(data) 34 115 35 + 1287: 26(float) Load 1286 + 1288: 17(ivec4) Load 19(ballot) + 1289: 26(float) GroupNonUniformFMin 178 PartitionedInclusiveScanNV 1287 1288 + 1290: 116(ptr) AccessChain 31(data) 1285 115 35 + Store 1290 1289 + 1291: 6(int) Load 8(invocation) + 1292: 123(ptr) AccessChain 31(data) 63 115 + 1293: 27(fvec4) Load 1292 + 1294: 122(fvec2) VectorShuffle 1293 1293 0 1 + 1295: 17(ivec4) Load 19(ballot) + 1296: 122(fvec2) GroupNonUniformFMin 178 PartitionedInclusiveScanNV 1294 1295 + 1297: 123(ptr) AccessChain 31(data) 1291 115 + 1298: 27(fvec4) Load 1297 + 1299: 27(fvec4) VectorShuffle 1298 1296 4 5 2 3 + Store 1297 1299 + 1300: 6(int) Load 8(invocation) + 1301: 123(ptr) AccessChain 31(data) 33 115 + 1302: 27(fvec4) Load 1301 + 1303: 130(fvec3) VectorShuffle 1302 1302 0 1 2 + 1304: 17(ivec4) Load 19(ballot) + 1305: 130(fvec3) GroupNonUniformFMin 178 PartitionedInclusiveScanNV 1303 1304 + 1306: 123(ptr) AccessChain 31(data) 1300 115 + 1307: 27(fvec4) Load 1306 + 1308: 27(fvec4) VectorShuffle 1307 1305 4 5 6 3 + Store 1306 1308 + 1309: 6(int) Load 8(invocation) + 1310: 123(ptr) AccessChain 31(data) 115 115 + 1311: 27(fvec4) Load 1310 + 1312: 17(ivec4) Load 19(ballot) + 1313: 27(fvec4) GroupNonUniformFMin 178 PartitionedInclusiveScanNV 1311 1312 + 1314: 123(ptr) AccessChain 31(data) 1309 115 + Store 1314 1313 + 1315: 6(int) Load 8(invocation) + 1316: 36(ptr) AccessChain 31(data) 34 34 35 + 1317: 22(float) Load 1316 + 1318: 17(ivec4) Load 19(ballot) + 1319: 22(float) GroupNonUniformFMax 178 PartitionedInclusiveScanNV 1317 1318 + 1320: 36(ptr) AccessChain 31(data) 1315 34 35 + Store 1320 1319 + 1321: 6(int) Load 8(invocation) + 1322: 44(ptr) AccessChain 31(data) 63 34 + 1323: 23(fvec4) Load 1322 + 1324: 43(fvec2) VectorShuffle 1323 1323 0 1 + 1325: 17(ivec4) Load 19(ballot) + 1326: 43(fvec2) GroupNonUniformFMax 178 PartitionedInclusiveScanNV 1324 1325 + 1327: 44(ptr) AccessChain 31(data) 1321 34 + 1328: 23(fvec4) Load 1327 + 1329: 23(fvec4) VectorShuffle 1328 1326 4 5 2 3 + Store 1327 1329 + 1330: 6(int) Load 8(invocation) + 1331: 44(ptr) AccessChain 31(data) 33 34 + 1332: 23(fvec4) Load 1331 + 1333: 51(fvec3) VectorShuffle 1332 1332 0 1 2 + 1334: 17(ivec4) Load 19(ballot) + 1335: 51(fvec3) GroupNonUniformFMax 178 PartitionedInclusiveScanNV 1333 1334 + 1336: 44(ptr) AccessChain 31(data) 1330 34 + 1337: 23(fvec4) Load 1336 + 1338: 23(fvec4) VectorShuffle 1337 1335 4 5 6 3 + Store 1336 1338 + 1339: 6(int) Load 8(invocation) + 1340: 44(ptr) AccessChain 31(data) 115 34 + 1341: 23(fvec4) Load 1340 + 1342: 17(ivec4) Load 19(ballot) + 1343: 23(fvec4) GroupNonUniformFMax 178 PartitionedInclusiveScanNV 1341 1342 + 1344: 44(ptr) AccessChain 31(data) 1339 34 + Store 1344 1343 + 1345: 6(int) Load 8(invocation) + 1346: 64(ptr) AccessChain 31(data) 34 63 35 + 1347: 24(int) Load 1346 + 1348: 17(ivec4) Load 19(ballot) + 1349: 24(int) GroupNonUniformSMax 178 PartitionedInclusiveScanNV 1347 1348 + 1350: 64(ptr) AccessChain 31(data) 1345 63 35 + Store 1350 1349 + 1351: 6(int) Load 8(invocation) + 1352: 71(ptr) AccessChain 31(data) 63 63 + 1353: 25(ivec4) Load 1352 + 1354: 70(ivec2) VectorShuffle 1353 1353 0 1 + 1355: 17(ivec4) Load 19(ballot) + 1356: 70(ivec2) GroupNonUniformSMax 178 PartitionedInclusiveScanNV 1354 1355 + 1357: 71(ptr) AccessChain 31(data) 1351 63 + 1358: 25(ivec4) Load 1357 + 1359: 25(ivec4) VectorShuffle 1358 1356 4 5 2 3 + Store 1357 1359 + 1360: 6(int) Load 8(invocation) + 1361: 71(ptr) AccessChain 31(data) 33 63 + 1362: 25(ivec4) Load 1361 + 1363: 78(ivec3) VectorShuffle 1362 1362 0 1 2 + 1364: 17(ivec4) Load 19(ballot) + 1365: 78(ivec3) GroupNonUniformSMax 178 PartitionedInclusiveScanNV 1363 1364 + 1366: 71(ptr) AccessChain 31(data) 1360 63 + 1367: 25(ivec4) Load 1366 + 1368: 25(ivec4) VectorShuffle 1367 1365 4 5 6 3 + Store 1366 1368 + 1369: 6(int) Load 8(invocation) + 1370: 71(ptr) AccessChain 31(data) 115 63 + 1371: 25(ivec4) Load 1370 + 1372: 17(ivec4) Load 19(ballot) + 1373: 25(ivec4) GroupNonUniformSMax 178 PartitionedInclusiveScanNV 1371 1372 + 1374: 71(ptr) AccessChain 31(data) 1369 63 + Store 1374 1373 + 1375: 6(int) Load 8(invocation) + 1376: 90(ptr) AccessChain 31(data) 34 33 35 + 1377: 6(int) Load 1376 + 1378: 17(ivec4) Load 19(ballot) + 1379: 6(int) GroupNonUniformUMax 178 PartitionedInclusiveScanNV 1377 1378 + 1380: 90(ptr) AccessChain 31(data) 1375 33 35 + Store 1380 1379 + 1381: 6(int) Load 8(invocation) + 1382: 40(ptr) AccessChain 31(data) 63 33 + 1383: 17(ivec4) Load 1382 + 1384: 96(ivec2) VectorShuffle 1383 1383 0 1 + 1385: 17(ivec4) Load 19(ballot) + 1386: 96(ivec2) GroupNonUniformUMax 178 PartitionedInclusiveScanNV 1384 1385 + 1387: 40(ptr) AccessChain 31(data) 1381 33 + 1388: 17(ivec4) Load 1387 + 1389: 17(ivec4) VectorShuffle 1388 1386 4 5 2 3 + Store 1387 1389 + 1390: 6(int) Load 8(invocation) + 1391: 40(ptr) AccessChain 31(data) 33 33 + 1392: 17(ivec4) Load 1391 + 1393: 103(ivec3) VectorShuffle 1392 1392 0 1 2 + 1394: 17(ivec4) Load 19(ballot) + 1395: 103(ivec3) GroupNonUniformUMax 178 PartitionedInclusiveScanNV 1393 1394 + 1396: 40(ptr) AccessChain 31(data) 1390 33 + 1397: 17(ivec4) Load 1396 + 1398: 17(ivec4) VectorShuffle 1397 1395 4 5 6 3 + Store 1396 1398 + 1399: 6(int) Load 8(invocation) + 1400: 40(ptr) AccessChain 31(data) 115 33 + 1401: 17(ivec4) Load 1400 + 1402: 17(ivec4) Load 19(ballot) + 1403: 17(ivec4) GroupNonUniformUMax 178 PartitionedInclusiveScanNV 1401 1402 + 1404: 40(ptr) AccessChain 31(data) 1399 33 + Store 1404 1403 + 1405: 6(int) Load 8(invocation) + 1406: 116(ptr) AccessChain 31(data) 34 115 35 + 1407: 26(float) Load 1406 + 1408: 17(ivec4) Load 19(ballot) + 1409: 26(float) GroupNonUniformFMax 178 PartitionedInclusiveScanNV 1407 1408 + 1410: 116(ptr) AccessChain 31(data) 1405 115 35 + Store 1410 1409 + 1411: 6(int) Load 8(invocation) + 1412: 123(ptr) AccessChain 31(data) 63 115 + 1413: 27(fvec4) Load 1412 + 1414: 122(fvec2) VectorShuffle 1413 1413 0 1 + 1415: 17(ivec4) Load 19(ballot) + 1416: 122(fvec2) GroupNonUniformFMax 178 PartitionedInclusiveScanNV 1414 1415 + 1417: 123(ptr) AccessChain 31(data) 1411 115 + 1418: 27(fvec4) Load 1417 + 1419: 27(fvec4) VectorShuffle 1418 1416 4 5 2 3 + Store 1417 1419 + 1420: 6(int) Load 8(invocation) + 1421: 123(ptr) AccessChain 31(data) 33 115 + 1422: 27(fvec4) Load 1421 + 1423: 130(fvec3) VectorShuffle 1422 1422 0 1 2 + 1424: 17(ivec4) Load 19(ballot) + 1425: 130(fvec3) GroupNonUniformFMax 178 PartitionedInclusiveScanNV 1423 1424 + 1426: 123(ptr) AccessChain 31(data) 1420 115 + 1427: 27(fvec4) Load 1426 + 1428: 27(fvec4) VectorShuffle 1427 1425 4 5 6 3 + Store 1426 1428 + 1429: 6(int) Load 8(invocation) + 1430: 123(ptr) AccessChain 31(data) 115 115 + 1431: 27(fvec4) Load 1430 + 1432: 17(ivec4) Load 19(ballot) + 1433: 27(fvec4) GroupNonUniformFMax 178 PartitionedInclusiveScanNV 1431 1432 + 1434: 123(ptr) AccessChain 31(data) 1429 115 + Store 1434 1433 + 1435: 6(int) Load 8(invocation) + 1436: 64(ptr) AccessChain 31(data) 34 63 35 + 1437: 24(int) Load 1436 + 1438: 17(ivec4) Load 19(ballot) + 1439: 24(int) GroupNonUniformBitwiseAnd 178 PartitionedInclusiveScanNV 1437 1438 + 1440: 64(ptr) AccessChain 31(data) 1435 63 35 + Store 1440 1439 + 1441: 6(int) Load 8(invocation) + 1442: 71(ptr) AccessChain 31(data) 63 63 + 1443: 25(ivec4) Load 1442 + 1444: 70(ivec2) VectorShuffle 1443 1443 0 1 + 1445: 17(ivec4) Load 19(ballot) + 1446: 70(ivec2) GroupNonUniformBitwiseAnd 178 PartitionedInclusiveScanNV 1444 1445 + 1447: 71(ptr) AccessChain 31(data) 1441 63 + 1448: 25(ivec4) Load 1447 + 1449: 25(ivec4) VectorShuffle 1448 1446 4 5 2 3 + Store 1447 1449 + 1450: 6(int) Load 8(invocation) + 1451: 71(ptr) AccessChain 31(data) 33 63 + 1452: 25(ivec4) Load 1451 + 1453: 78(ivec3) VectorShuffle 1452 1452 0 1 2 + 1454: 17(ivec4) Load 19(ballot) + 1455: 78(ivec3) GroupNonUniformBitwiseAnd 178 PartitionedInclusiveScanNV 1453 1454 + 1456: 71(ptr) AccessChain 31(data) 1450 63 + 1457: 25(ivec4) Load 1456 + 1458: 25(ivec4) VectorShuffle 1457 1455 4 5 6 3 + Store 1456 1458 + 1459: 6(int) Load 8(invocation) + 1460: 71(ptr) AccessChain 31(data) 115 63 + 1461: 25(ivec4) Load 1460 + 1462: 17(ivec4) Load 19(ballot) + 1463: 25(ivec4) GroupNonUniformBitwiseAnd 178 PartitionedInclusiveScanNV 1461 1462 + 1464: 71(ptr) AccessChain 31(data) 1459 63 + Store 1464 1463 + 1465: 6(int) Load 8(invocation) + 1466: 90(ptr) AccessChain 31(data) 34 33 35 + 1467: 6(int) Load 1466 + 1468: 17(ivec4) Load 19(ballot) + 1469: 6(int) GroupNonUniformBitwiseAnd 178 PartitionedInclusiveScanNV 1467 1468 + 1470: 90(ptr) AccessChain 31(data) 1465 33 35 + Store 1470 1469 + 1471: 6(int) Load 8(invocation) + 1472: 40(ptr) AccessChain 31(data) 63 33 + 1473: 17(ivec4) Load 1472 + 1474: 96(ivec2) VectorShuffle 1473 1473 0 1 + 1475: 17(ivec4) Load 19(ballot) + 1476: 96(ivec2) GroupNonUniformBitwiseAnd 178 PartitionedInclusiveScanNV 1474 1475 + 1477: 40(ptr) AccessChain 31(data) 1471 33 + 1478: 17(ivec4) Load 1477 + 1479: 17(ivec4) VectorShuffle 1478 1476 4 5 2 3 + Store 1477 1479 + 1480: 6(int) Load 8(invocation) + 1481: 40(ptr) AccessChain 31(data) 33 33 + 1482: 17(ivec4) Load 1481 + 1483: 103(ivec3) VectorShuffle 1482 1482 0 1 2 + 1484: 17(ivec4) Load 19(ballot) + 1485: 103(ivec3) GroupNonUniformBitwiseAnd 178 PartitionedInclusiveScanNV 1483 1484 + 1486: 40(ptr) AccessChain 31(data) 1480 33 + 1487: 17(ivec4) Load 1486 + 1488: 17(ivec4) VectorShuffle 1487 1485 4 5 6 3 + Store 1486 1488 + 1489: 6(int) Load 8(invocation) + 1490: 40(ptr) AccessChain 31(data) 115 33 + 1491: 17(ivec4) Load 1490 + 1492: 17(ivec4) Load 19(ballot) + 1493: 17(ivec4) GroupNonUniformBitwiseAnd 178 PartitionedInclusiveScanNV 1491 1492 + 1494: 40(ptr) AccessChain 31(data) 1489 33 + Store 1494 1493 + 1495: 6(int) Load 8(invocation) + 1496: 64(ptr) AccessChain 31(data) 34 63 35 + 1497: 24(int) Load 1496 + 1498: 144(bool) SLessThan 1497 34 + 1499: 17(ivec4) Load 19(ballot) + 1500: 144(bool) GroupNonUniformLogicalAnd 178 PartitionedInclusiveScanNV 1498 1499 + 1501: 24(int) Select 1500 63 34 + 1502: 64(ptr) AccessChain 31(data) 1495 63 35 + Store 1502 1501 + 1503: 6(int) Load 8(invocation) + 1504: 71(ptr) AccessChain 31(data) 63 63 + 1505: 25(ivec4) Load 1504 + 1506: 70(ivec2) VectorShuffle 1505 1505 0 1 + 1507: 152(bvec2) SLessThan 1506 727 + 1508: 17(ivec4) Load 19(ballot) + 1509: 152(bvec2) GroupNonUniformLogicalAnd 178 PartitionedInclusiveScanNV 1507 1508 + 1510: 70(ivec2) Select 1509 731 727 + 1511: 71(ptr) AccessChain 31(data) 1503 63 + 1512: 25(ivec4) Load 1511 + 1513: 25(ivec4) VectorShuffle 1512 1510 4 5 2 3 + Store 1511 1513 + 1514: 6(int) Load 8(invocation) + 1515: 71(ptr) AccessChain 31(data) 63 63 + 1516: 25(ivec4) Load 1515 + 1517: 78(ivec3) VectorShuffle 1516 1516 0 1 2 + 1518: 161(bvec3) SLessThan 1517 740 + 1519: 17(ivec4) Load 19(ballot) + 1520: 161(bvec3) GroupNonUniformLogicalAnd 178 PartitionedInclusiveScanNV 1518 1519 + 1521: 78(ivec3) Select 1520 744 740 + 1522: 71(ptr) AccessChain 31(data) 1514 63 + 1523: 25(ivec4) Load 1522 + 1524: 25(ivec4) VectorShuffle 1523 1521 4 5 6 3 + Store 1522 1524 + 1525: 6(int) Load 8(invocation) + 1526: 71(ptr) AccessChain 31(data) 63 63 + 1527: 25(ivec4) Load 1526 + 1528: 169(bvec4) SLessThan 1527 752 + 1529: 17(ivec4) Load 19(ballot) + 1530: 169(bvec4) GroupNonUniformLogicalAnd 178 PartitionedInclusiveScanNV 1528 1529 + 1531: 25(ivec4) Select 1530 756 752 + 1532: 71(ptr) AccessChain 31(data) 1525 63 + Store 1532 1531 + 1533: 6(int) Load 8(invocation) + 1534: 64(ptr) AccessChain 31(data) 34 63 35 + 1535: 24(int) Load 1534 + 1536: 17(ivec4) Load 19(ballot) + 1537: 24(int) GroupNonUniformBitwiseOr 178 PartitionedInclusiveScanNV 1535 1536 + 1538: 64(ptr) AccessChain 31(data) 1533 63 35 + Store 1538 1537 + 1539: 6(int) Load 8(invocation) + 1540: 71(ptr) AccessChain 31(data) 63 63 + 1541: 25(ivec4) Load 1540 + 1542: 70(ivec2) VectorShuffle 1541 1541 0 1 + 1543: 17(ivec4) Load 19(ballot) + 1544: 70(ivec2) GroupNonUniformBitwiseOr 178 PartitionedInclusiveScanNV 1542 1543 + 1545: 71(ptr) AccessChain 31(data) 1539 63 + 1546: 25(ivec4) Load 1545 + 1547: 25(ivec4) VectorShuffle 1546 1544 4 5 2 3 + Store 1545 1547 + 1548: 6(int) Load 8(invocation) + 1549: 71(ptr) AccessChain 31(data) 33 63 + 1550: 25(ivec4) Load 1549 + 1551: 78(ivec3) VectorShuffle 1550 1550 0 1 2 + 1552: 17(ivec4) Load 19(ballot) + 1553: 78(ivec3) GroupNonUniformBitwiseOr 178 PartitionedInclusiveScanNV 1551 1552 + 1554: 71(ptr) AccessChain 31(data) 1548 63 + 1555: 25(ivec4) Load 1554 + 1556: 25(ivec4) VectorShuffle 1555 1553 4 5 6 3 + Store 1554 1556 + 1557: 6(int) Load 8(invocation) + 1558: 71(ptr) AccessChain 31(data) 115 63 + 1559: 25(ivec4) Load 1558 + 1560: 17(ivec4) Load 19(ballot) + 1561: 25(ivec4) GroupNonUniformBitwiseOr 178 PartitionedInclusiveScanNV 1559 1560 + 1562: 71(ptr) AccessChain 31(data) 1557 63 + Store 1562 1561 + 1563: 6(int) Load 8(invocation) + 1564: 90(ptr) AccessChain 31(data) 34 33 35 + 1565: 6(int) Load 1564 + 1566: 17(ivec4) Load 19(ballot) + 1567: 6(int) GroupNonUniformBitwiseOr 178 PartitionedInclusiveScanNV 1565 1566 + 1568: 90(ptr) AccessChain 31(data) 1563 33 35 + Store 1568 1567 + 1569: 6(int) Load 8(invocation) + 1570: 40(ptr) AccessChain 31(data) 63 33 + 1571: 17(ivec4) Load 1570 + 1572: 96(ivec2) VectorShuffle 1571 1571 0 1 + 1573: 17(ivec4) Load 19(ballot) + 1574: 96(ivec2) GroupNonUniformBitwiseOr 178 PartitionedInclusiveScanNV 1572 1573 + 1575: 40(ptr) AccessChain 31(data) 1569 33 + 1576: 17(ivec4) Load 1575 + 1577: 17(ivec4) VectorShuffle 1576 1574 4 5 2 3 + Store 1575 1577 + 1578: 6(int) Load 8(invocation) + 1579: 40(ptr) AccessChain 31(data) 33 33 + 1580: 17(ivec4) Load 1579 + 1581: 103(ivec3) VectorShuffle 1580 1580 0 1 2 + 1582: 17(ivec4) Load 19(ballot) + 1583: 103(ivec3) GroupNonUniformBitwiseOr 178 PartitionedInclusiveScanNV 1581 1582 + 1584: 40(ptr) AccessChain 31(data) 1578 33 + 1585: 17(ivec4) Load 1584 + 1586: 17(ivec4) VectorShuffle 1585 1583 4 5 6 3 + Store 1584 1586 + 1587: 6(int) Load 8(invocation) + 1588: 40(ptr) AccessChain 31(data) 115 33 + 1589: 17(ivec4) Load 1588 + 1590: 17(ivec4) Load 19(ballot) + 1591: 17(ivec4) GroupNonUniformBitwiseOr 178 PartitionedInclusiveScanNV 1589 1590 + 1592: 40(ptr) AccessChain 31(data) 1587 33 + Store 1592 1591 + 1593: 6(int) Load 8(invocation) + 1594: 64(ptr) AccessChain 31(data) 34 63 35 + 1595: 24(int) Load 1594 + 1596: 144(bool) SLessThan 1595 34 + 1597: 17(ivec4) Load 19(ballot) + 1598: 144(bool) GroupNonUniformLogicalOr 178 PartitionedInclusiveScanNV 1596 1597 + 1599: 24(int) Select 1598 63 34 + 1600: 64(ptr) AccessChain 31(data) 1593 63 35 + Store 1600 1599 + 1601: 6(int) Load 8(invocation) + 1602: 71(ptr) AccessChain 31(data) 63 63 + 1603: 25(ivec4) Load 1602 + 1604: 70(ivec2) VectorShuffle 1603 1603 0 1 + 1605: 152(bvec2) SLessThan 1604 727 + 1606: 17(ivec4) Load 19(ballot) + 1607: 152(bvec2) GroupNonUniformLogicalOr 178 PartitionedInclusiveScanNV 1605 1606 + 1608: 70(ivec2) Select 1607 731 727 + 1609: 71(ptr) AccessChain 31(data) 1601 63 + 1610: 25(ivec4) Load 1609 + 1611: 25(ivec4) VectorShuffle 1610 1608 4 5 2 3 + Store 1609 1611 + 1612: 6(int) Load 8(invocation) + 1613: 71(ptr) AccessChain 31(data) 63 63 + 1614: 25(ivec4) Load 1613 + 1615: 78(ivec3) VectorShuffle 1614 1614 0 1 2 + 1616: 161(bvec3) SLessThan 1615 740 + 1617: 17(ivec4) Load 19(ballot) + 1618: 161(bvec3) GroupNonUniformLogicalOr 178 PartitionedInclusiveScanNV 1616 1617 + 1619: 78(ivec3) Select 1618 744 740 + 1620: 71(ptr) AccessChain 31(data) 1612 63 + 1621: 25(ivec4) Load 1620 + 1622: 25(ivec4) VectorShuffle 1621 1619 4 5 6 3 + Store 1620 1622 + 1623: 6(int) Load 8(invocation) + 1624: 71(ptr) AccessChain 31(data) 63 63 + 1625: 25(ivec4) Load 1624 + 1626: 169(bvec4) SLessThan 1625 752 + 1627: 17(ivec4) Load 19(ballot) + 1628: 169(bvec4) GroupNonUniformLogicalOr 178 PartitionedInclusiveScanNV 1626 1627 + 1629: 25(ivec4) Select 1628 756 752 + 1630: 71(ptr) AccessChain 31(data) 1623 63 + Store 1630 1629 + 1631: 6(int) Load 8(invocation) + 1632: 64(ptr) AccessChain 31(data) 34 63 35 + 1633: 24(int) Load 1632 + 1634: 17(ivec4) Load 19(ballot) + 1635: 24(int) GroupNonUniformBitwiseXor 178 PartitionedInclusiveScanNV 1633 1634 + 1636: 64(ptr) AccessChain 31(data) 1631 63 35 + Store 1636 1635 + 1637: 6(int) Load 8(invocation) + 1638: 71(ptr) AccessChain 31(data) 63 63 + 1639: 25(ivec4) Load 1638 + 1640: 70(ivec2) VectorShuffle 1639 1639 0 1 + 1641: 17(ivec4) Load 19(ballot) + 1642: 70(ivec2) GroupNonUniformBitwiseXor 178 PartitionedInclusiveScanNV 1640 1641 + 1643: 71(ptr) AccessChain 31(data) 1637 63 + 1644: 25(ivec4) Load 1643 + 1645: 25(ivec4) VectorShuffle 1644 1642 4 5 2 3 + Store 1643 1645 + 1646: 6(int) Load 8(invocation) + 1647: 71(ptr) AccessChain 31(data) 33 63 + 1648: 25(ivec4) Load 1647 + 1649: 78(ivec3) VectorShuffle 1648 1648 0 1 2 + 1650: 17(ivec4) Load 19(ballot) + 1651: 78(ivec3) GroupNonUniformBitwiseXor 178 PartitionedInclusiveScanNV 1649 1650 + 1652: 71(ptr) AccessChain 31(data) 1646 63 + 1653: 25(ivec4) Load 1652 + 1654: 25(ivec4) VectorShuffle 1653 1651 4 5 6 3 + Store 1652 1654 + 1655: 6(int) Load 8(invocation) + 1656: 71(ptr) AccessChain 31(data) 115 63 + 1657: 25(ivec4) Load 1656 + 1658: 17(ivec4) Load 19(ballot) + 1659: 25(ivec4) GroupNonUniformBitwiseXor 178 PartitionedInclusiveScanNV 1657 1658 + 1660: 71(ptr) AccessChain 31(data) 1655 63 + Store 1660 1659 + 1661: 6(int) Load 8(invocation) + 1662: 90(ptr) AccessChain 31(data) 34 33 35 + 1663: 6(int) Load 1662 + 1664: 17(ivec4) Load 19(ballot) + 1665: 6(int) GroupNonUniformBitwiseXor 178 PartitionedInclusiveScanNV 1663 1664 + 1666: 90(ptr) AccessChain 31(data) 1661 33 35 + Store 1666 1665 + 1667: 6(int) Load 8(invocation) + 1668: 40(ptr) AccessChain 31(data) 63 33 + 1669: 17(ivec4) Load 1668 + 1670: 96(ivec2) VectorShuffle 1669 1669 0 1 + 1671: 17(ivec4) Load 19(ballot) + 1672: 96(ivec2) GroupNonUniformBitwiseXor 178 PartitionedInclusiveScanNV 1670 1671 + 1673: 40(ptr) AccessChain 31(data) 1667 33 + 1674: 17(ivec4) Load 1673 + 1675: 17(ivec4) VectorShuffle 1674 1672 4 5 2 3 + Store 1673 1675 + 1676: 6(int) Load 8(invocation) + 1677: 40(ptr) AccessChain 31(data) 33 33 + 1678: 17(ivec4) Load 1677 + 1679: 103(ivec3) VectorShuffle 1678 1678 0 1 2 + 1680: 17(ivec4) Load 19(ballot) + 1681: 103(ivec3) GroupNonUniformBitwiseXor 178 PartitionedInclusiveScanNV 1679 1680 + 1682: 40(ptr) AccessChain 31(data) 1676 33 + 1683: 17(ivec4) Load 1682 + 1684: 17(ivec4) VectorShuffle 1683 1681 4 5 6 3 + Store 1682 1684 + 1685: 6(int) Load 8(invocation) + 1686: 40(ptr) AccessChain 31(data) 115 33 + 1687: 17(ivec4) Load 1686 + 1688: 17(ivec4) Load 19(ballot) + 1689: 17(ivec4) GroupNonUniformBitwiseXor 178 PartitionedInclusiveScanNV 1687 1688 + 1690: 40(ptr) AccessChain 31(data) 1685 33 + Store 1690 1689 + 1691: 6(int) Load 8(invocation) + 1692: 64(ptr) AccessChain 31(data) 34 63 35 + 1693: 24(int) Load 1692 + 1694: 144(bool) SLessThan 1693 34 + 1695: 17(ivec4) Load 19(ballot) + 1696: 144(bool) GroupNonUniformLogicalXor 178 PartitionedInclusiveScanNV 1694 1695 + 1697: 24(int) Select 1696 63 34 + 1698: 64(ptr) AccessChain 31(data) 1691 63 35 + Store 1698 1697 + 1699: 6(int) Load 8(invocation) + 1700: 71(ptr) AccessChain 31(data) 63 63 + 1701: 25(ivec4) Load 1700 + 1702: 70(ivec2) VectorShuffle 1701 1701 0 1 + 1703: 152(bvec2) SLessThan 1702 727 + 1704: 17(ivec4) Load 19(ballot) + 1705: 152(bvec2) GroupNonUniformLogicalXor 178 PartitionedInclusiveScanNV 1703 1704 + 1706: 70(ivec2) Select 1705 731 727 + 1707: 71(ptr) AccessChain 31(data) 1699 63 + 1708: 25(ivec4) Load 1707 + 1709: 25(ivec4) VectorShuffle 1708 1706 4 5 2 3 + Store 1707 1709 + 1710: 6(int) Load 8(invocation) + 1711: 71(ptr) AccessChain 31(data) 63 63 + 1712: 25(ivec4) Load 1711 + 1713: 78(ivec3) VectorShuffle 1712 1712 0 1 2 + 1714: 161(bvec3) SLessThan 1713 740 + 1715: 17(ivec4) Load 19(ballot) + 1716: 161(bvec3) GroupNonUniformLogicalXor 178 PartitionedInclusiveScanNV 1714 1715 + 1717: 78(ivec3) Select 1716 744 740 + 1718: 71(ptr) AccessChain 31(data) 1710 63 + 1719: 25(ivec4) Load 1718 + 1720: 25(ivec4) VectorShuffle 1719 1717 4 5 6 3 + Store 1718 1720 + 1721: 6(int) Load 8(invocation) + 1722: 71(ptr) AccessChain 31(data) 63 63 + 1723: 25(ivec4) Load 1722 + 1724: 169(bvec4) SLessThan 1723 752 + 1725: 17(ivec4) Load 19(ballot) + 1726: 169(bvec4) GroupNonUniformLogicalXor 178 PartitionedInclusiveScanNV 1724 1725 + 1727: 25(ivec4) Select 1726 756 752 + 1728: 71(ptr) AccessChain 31(data) 1721 63 + Store 1728 1727 + 1729: 6(int) Load 8(invocation) + 1730: 36(ptr) AccessChain 31(data) 34 34 35 + 1731: 22(float) Load 1730 + 1732: 17(ivec4) Load 19(ballot) + 1733: 22(float) GroupNonUniformFAdd 178 PartitionedExclusiveScanNV 1731 1732 + 1734: 36(ptr) AccessChain 31(data) 1729 34 35 + Store 1734 1733 + 1735: 6(int) Load 8(invocation) + 1736: 44(ptr) AccessChain 31(data) 63 34 + 1737: 23(fvec4) Load 1736 + 1738: 43(fvec2) VectorShuffle 1737 1737 0 1 + 1739: 17(ivec4) Load 19(ballot) + 1740: 43(fvec2) GroupNonUniformFAdd 178 PartitionedExclusiveScanNV 1738 1739 + 1741: 44(ptr) AccessChain 31(data) 1735 34 + 1742: 23(fvec4) Load 1741 + 1743: 23(fvec4) VectorShuffle 1742 1740 4 5 2 3 + Store 1741 1743 + 1744: 6(int) Load 8(invocation) + 1745: 44(ptr) AccessChain 31(data) 33 34 + 1746: 23(fvec4) Load 1745 + 1747: 51(fvec3) VectorShuffle 1746 1746 0 1 2 + 1748: 17(ivec4) Load 19(ballot) + 1749: 51(fvec3) GroupNonUniformFAdd 178 PartitionedExclusiveScanNV 1747 1748 + 1750: 44(ptr) AccessChain 31(data) 1744 34 + 1751: 23(fvec4) Load 1750 + 1752: 23(fvec4) VectorShuffle 1751 1749 4 5 6 3 + Store 1750 1752 + 1753: 6(int) Load 8(invocation) + 1754: 44(ptr) AccessChain 31(data) 115 34 + 1755: 23(fvec4) Load 1754 + 1756: 17(ivec4) Load 19(ballot) + 1757: 23(fvec4) GroupNonUniformFAdd 178 PartitionedExclusiveScanNV 1755 1756 + 1758: 44(ptr) AccessChain 31(data) 1753 34 + Store 1758 1757 + 1759: 6(int) Load 8(invocation) + 1760: 64(ptr) AccessChain 31(data) 34 63 35 + 1761: 24(int) Load 1760 + 1762: 17(ivec4) Load 19(ballot) + 1763: 24(int) GroupNonUniformIAdd 178 PartitionedExclusiveScanNV 1761 1762 + 1764: 64(ptr) AccessChain 31(data) 1759 63 35 + Store 1764 1763 + 1765: 6(int) Load 8(invocation) + 1766: 71(ptr) AccessChain 31(data) 63 63 + 1767: 25(ivec4) Load 1766 + 1768: 70(ivec2) VectorShuffle 1767 1767 0 1 + 1769: 17(ivec4) Load 19(ballot) + 1770: 70(ivec2) GroupNonUniformIAdd 178 PartitionedExclusiveScanNV 1768 1769 + 1771: 71(ptr) AccessChain 31(data) 1765 63 + 1772: 25(ivec4) Load 1771 + 1773: 25(ivec4) VectorShuffle 1772 1770 4 5 2 3 + Store 1771 1773 + 1774: 6(int) Load 8(invocation) + 1775: 71(ptr) AccessChain 31(data) 33 63 + 1776: 25(ivec4) Load 1775 + 1777: 78(ivec3) VectorShuffle 1776 1776 0 1 2 + 1778: 17(ivec4) Load 19(ballot) + 1779: 78(ivec3) GroupNonUniformIAdd 178 PartitionedExclusiveScanNV 1777 1778 + 1780: 71(ptr) AccessChain 31(data) 1774 63 + 1781: 25(ivec4) Load 1780 + 1782: 25(ivec4) VectorShuffle 1781 1779 4 5 6 3 + Store 1780 1782 + 1783: 6(int) Load 8(invocation) + 1784: 71(ptr) AccessChain 31(data) 115 63 + 1785: 25(ivec4) Load 1784 + 1786: 17(ivec4) Load 19(ballot) + 1787: 25(ivec4) GroupNonUniformIAdd 178 PartitionedExclusiveScanNV 1785 1786 + 1788: 71(ptr) AccessChain 31(data) 1783 63 + Store 1788 1787 + 1789: 6(int) Load 8(invocation) + 1790: 90(ptr) AccessChain 31(data) 34 33 35 + 1791: 6(int) Load 1790 + 1792: 17(ivec4) Load 19(ballot) + 1793: 6(int) GroupNonUniformIAdd 178 PartitionedExclusiveScanNV 1791 1792 + 1794: 90(ptr) AccessChain 31(data) 1789 33 35 + Store 1794 1793 + 1795: 6(int) Load 8(invocation) + 1796: 40(ptr) AccessChain 31(data) 63 33 + 1797: 17(ivec4) Load 1796 + 1798: 96(ivec2) VectorShuffle 1797 1797 0 1 + 1799: 17(ivec4) Load 19(ballot) + 1800: 96(ivec2) GroupNonUniformIAdd 178 PartitionedExclusiveScanNV 1798 1799 + 1801: 40(ptr) AccessChain 31(data) 1795 33 + 1802: 17(ivec4) Load 1801 + 1803: 17(ivec4) VectorShuffle 1802 1800 4 5 2 3 + Store 1801 1803 + 1804: 6(int) Load 8(invocation) + 1805: 40(ptr) AccessChain 31(data) 33 33 + 1806: 17(ivec4) Load 1805 + 1807: 103(ivec3) VectorShuffle 1806 1806 0 1 2 + 1808: 17(ivec4) Load 19(ballot) + 1809: 103(ivec3) GroupNonUniformIAdd 178 PartitionedExclusiveScanNV 1807 1808 + 1810: 40(ptr) AccessChain 31(data) 1804 33 + 1811: 17(ivec4) Load 1810 + 1812: 17(ivec4) VectorShuffle 1811 1809 4 5 6 3 + Store 1810 1812 + 1813: 6(int) Load 8(invocation) + 1814: 40(ptr) AccessChain 31(data) 115 33 + 1815: 17(ivec4) Load 1814 + 1816: 17(ivec4) Load 19(ballot) + 1817: 17(ivec4) GroupNonUniformIAdd 178 PartitionedExclusiveScanNV 1815 1816 + 1818: 40(ptr) AccessChain 31(data) 1813 33 + Store 1818 1817 + 1819: 6(int) Load 8(invocation) + 1820: 116(ptr) AccessChain 31(data) 34 115 35 + 1821: 26(float) Load 1820 + 1822: 17(ivec4) Load 19(ballot) + 1823: 26(float) GroupNonUniformFAdd 178 PartitionedExclusiveScanNV 1821 1822 + 1824: 116(ptr) AccessChain 31(data) 1819 115 35 + Store 1824 1823 + 1825: 6(int) Load 8(invocation) + 1826: 123(ptr) AccessChain 31(data) 63 115 + 1827: 27(fvec4) Load 1826 + 1828: 122(fvec2) VectorShuffle 1827 1827 0 1 + 1829: 17(ivec4) Load 19(ballot) + 1830: 122(fvec2) GroupNonUniformFAdd 178 PartitionedExclusiveScanNV 1828 1829 + 1831: 123(ptr) AccessChain 31(data) 1825 115 + 1832: 27(fvec4) Load 1831 + 1833: 27(fvec4) VectorShuffle 1832 1830 4 5 2 3 + Store 1831 1833 + 1834: 6(int) Load 8(invocation) + 1835: 123(ptr) AccessChain 31(data) 33 115 + 1836: 27(fvec4) Load 1835 + 1837: 130(fvec3) VectorShuffle 1836 1836 0 1 2 + 1838: 17(ivec4) Load 19(ballot) + 1839: 130(fvec3) GroupNonUniformFAdd 178 PartitionedExclusiveScanNV 1837 1838 + 1840: 123(ptr) AccessChain 31(data) 1834 115 + 1841: 27(fvec4) Load 1840 + 1842: 27(fvec4) VectorShuffle 1841 1839 4 5 6 3 + Store 1840 1842 + 1843: 6(int) Load 8(invocation) + 1844: 123(ptr) AccessChain 31(data) 115 115 + 1845: 27(fvec4) Load 1844 + 1846: 17(ivec4) Load 19(ballot) + 1847: 27(fvec4) GroupNonUniformFAdd 178 PartitionedExclusiveScanNV 1845 1846 + 1848: 123(ptr) AccessChain 31(data) 1843 115 + Store 1848 1847 + 1849: 6(int) Load 8(invocation) + 1850: 36(ptr) AccessChain 31(data) 34 34 35 + 1851: 22(float) Load 1850 + 1852: 17(ivec4) Load 19(ballot) + 1853: 22(float) GroupNonUniformFMul 178 PartitionedExclusiveScanNV 1851 1852 + 1854: 36(ptr) AccessChain 31(data) 1849 34 35 + Store 1854 1853 + 1855: 6(int) Load 8(invocation) + 1856: 44(ptr) AccessChain 31(data) 63 34 + 1857: 23(fvec4) Load 1856 + 1858: 43(fvec2) VectorShuffle 1857 1857 0 1 + 1859: 17(ivec4) Load 19(ballot) + 1860: 43(fvec2) GroupNonUniformFMul 178 PartitionedExclusiveScanNV 1858 1859 + 1861: 44(ptr) AccessChain 31(data) 1855 34 + 1862: 23(fvec4) Load 1861 + 1863: 23(fvec4) VectorShuffle 1862 1860 4 5 2 3 + Store 1861 1863 + 1864: 6(int) Load 8(invocation) + 1865: 44(ptr) AccessChain 31(data) 33 34 + 1866: 23(fvec4) Load 1865 + 1867: 51(fvec3) VectorShuffle 1866 1866 0 1 2 + 1868: 17(ivec4) Load 19(ballot) + 1869: 51(fvec3) GroupNonUniformFMul 178 PartitionedExclusiveScanNV 1867 1868 + 1870: 44(ptr) AccessChain 31(data) 1864 34 + 1871: 23(fvec4) Load 1870 + 1872: 23(fvec4) VectorShuffle 1871 1869 4 5 6 3 + Store 1870 1872 + 1873: 6(int) Load 8(invocation) + 1874: 44(ptr) AccessChain 31(data) 115 34 + 1875: 23(fvec4) Load 1874 + 1876: 17(ivec4) Load 19(ballot) + 1877: 23(fvec4) GroupNonUniformFMul 178 PartitionedExclusiveScanNV 1875 1876 + 1878: 44(ptr) AccessChain 31(data) 1873 34 + Store 1878 1877 + 1879: 6(int) Load 8(invocation) + 1880: 64(ptr) AccessChain 31(data) 34 63 35 + 1881: 24(int) Load 1880 + 1882: 17(ivec4) Load 19(ballot) + 1883: 24(int) GroupNonUniformIMul 178 PartitionedExclusiveScanNV 1881 1882 + 1884: 64(ptr) AccessChain 31(data) 1879 63 35 + Store 1884 1883 + 1885: 6(int) Load 8(invocation) + 1886: 71(ptr) AccessChain 31(data) 63 63 + 1887: 25(ivec4) Load 1886 + 1888: 70(ivec2) VectorShuffle 1887 1887 0 1 + 1889: 17(ivec4) Load 19(ballot) + 1890: 70(ivec2) GroupNonUniformIMul 178 PartitionedExclusiveScanNV 1888 1889 + 1891: 71(ptr) AccessChain 31(data) 1885 63 + 1892: 25(ivec4) Load 1891 + 1893: 25(ivec4) VectorShuffle 1892 1890 4 5 2 3 + Store 1891 1893 + 1894: 6(int) Load 8(invocation) + 1895: 71(ptr) AccessChain 31(data) 33 63 + 1896: 25(ivec4) Load 1895 + 1897: 78(ivec3) VectorShuffle 1896 1896 0 1 2 + 1898: 17(ivec4) Load 19(ballot) + 1899: 78(ivec3) GroupNonUniformIMul 178 PartitionedExclusiveScanNV 1897 1898 + 1900: 71(ptr) AccessChain 31(data) 1894 63 + 1901: 25(ivec4) Load 1900 + 1902: 25(ivec4) VectorShuffle 1901 1899 4 5 6 3 + Store 1900 1902 + 1903: 6(int) Load 8(invocation) + 1904: 71(ptr) AccessChain 31(data) 115 63 + 1905: 25(ivec4) Load 1904 + 1906: 17(ivec4) Load 19(ballot) + 1907: 25(ivec4) GroupNonUniformIMul 178 PartitionedExclusiveScanNV 1905 1906 + 1908: 71(ptr) AccessChain 31(data) 1903 63 + Store 1908 1907 + 1909: 6(int) Load 8(invocation) + 1910: 90(ptr) AccessChain 31(data) 34 33 35 + 1911: 6(int) Load 1910 + 1912: 17(ivec4) Load 19(ballot) + 1913: 6(int) GroupNonUniformIMul 178 PartitionedExclusiveScanNV 1911 1912 + 1914: 90(ptr) AccessChain 31(data) 1909 33 35 + Store 1914 1913 + 1915: 6(int) Load 8(invocation) + 1916: 40(ptr) AccessChain 31(data) 63 33 + 1917: 17(ivec4) Load 1916 + 1918: 96(ivec2) VectorShuffle 1917 1917 0 1 + 1919: 17(ivec4) Load 19(ballot) + 1920: 96(ivec2) GroupNonUniformIMul 178 PartitionedExclusiveScanNV 1918 1919 + 1921: 40(ptr) AccessChain 31(data) 1915 33 + 1922: 17(ivec4) Load 1921 + 1923: 17(ivec4) VectorShuffle 1922 1920 4 5 2 3 + Store 1921 1923 + 1924: 6(int) Load 8(invocation) + 1925: 40(ptr) AccessChain 31(data) 33 33 + 1926: 17(ivec4) Load 1925 + 1927: 103(ivec3) VectorShuffle 1926 1926 0 1 2 + 1928: 17(ivec4) Load 19(ballot) + 1929: 103(ivec3) GroupNonUniformIMul 178 PartitionedExclusiveScanNV 1927 1928 + 1930: 40(ptr) AccessChain 31(data) 1924 33 + 1931: 17(ivec4) Load 1930 + 1932: 17(ivec4) VectorShuffle 1931 1929 4 5 6 3 + Store 1930 1932 + 1933: 6(int) Load 8(invocation) + 1934: 40(ptr) AccessChain 31(data) 115 33 + 1935: 17(ivec4) Load 1934 + 1936: 17(ivec4) Load 19(ballot) + 1937: 17(ivec4) GroupNonUniformIMul 178 PartitionedExclusiveScanNV 1935 1936 + 1938: 40(ptr) AccessChain 31(data) 1933 33 + Store 1938 1937 + 1939: 6(int) Load 8(invocation) + 1940: 116(ptr) AccessChain 31(data) 34 115 35 + 1941: 26(float) Load 1940 + 1942: 17(ivec4) Load 19(ballot) + 1943: 26(float) GroupNonUniformFMul 178 PartitionedExclusiveScanNV 1941 1942 + 1944: 116(ptr) AccessChain 31(data) 1939 115 35 + Store 1944 1943 + 1945: 6(int) Load 8(invocation) + 1946: 123(ptr) AccessChain 31(data) 63 115 + 1947: 27(fvec4) Load 1946 + 1948: 122(fvec2) VectorShuffle 1947 1947 0 1 + 1949: 17(ivec4) Load 19(ballot) + 1950: 122(fvec2) GroupNonUniformFMul 178 PartitionedExclusiveScanNV 1948 1949 + 1951: 123(ptr) AccessChain 31(data) 1945 115 + 1952: 27(fvec4) Load 1951 + 1953: 27(fvec4) VectorShuffle 1952 1950 4 5 2 3 + Store 1951 1953 + 1954: 6(int) Load 8(invocation) + 1955: 123(ptr) AccessChain 31(data) 33 115 + 1956: 27(fvec4) Load 1955 + 1957: 130(fvec3) VectorShuffle 1956 1956 0 1 2 + 1958: 17(ivec4) Load 19(ballot) + 1959: 130(fvec3) GroupNonUniformFMul 178 PartitionedExclusiveScanNV 1957 1958 + 1960: 123(ptr) AccessChain 31(data) 1954 115 + 1961: 27(fvec4) Load 1960 + 1962: 27(fvec4) VectorShuffle 1961 1959 4 5 6 3 + Store 1960 1962 + 1963: 6(int) Load 8(invocation) + 1964: 123(ptr) AccessChain 31(data) 115 115 + 1965: 27(fvec4) Load 1964 + 1966: 17(ivec4) Load 19(ballot) + 1967: 27(fvec4) GroupNonUniformFMul 178 PartitionedExclusiveScanNV 1965 1966 + 1968: 123(ptr) AccessChain 31(data) 1963 115 + Store 1968 1967 + 1969: 6(int) Load 8(invocation) + 1970: 36(ptr) AccessChain 31(data) 34 34 35 + 1971: 22(float) Load 1970 + 1972: 17(ivec4) Load 19(ballot) + 1973: 22(float) GroupNonUniformFMin 178 PartitionedExclusiveScanNV 1971 1972 + 1974: 36(ptr) AccessChain 31(data) 1969 34 35 + Store 1974 1973 + 1975: 6(int) Load 8(invocation) + 1976: 44(ptr) AccessChain 31(data) 63 34 + 1977: 23(fvec4) Load 1976 + 1978: 43(fvec2) VectorShuffle 1977 1977 0 1 + 1979: 17(ivec4) Load 19(ballot) + 1980: 43(fvec2) GroupNonUniformFMin 178 PartitionedExclusiveScanNV 1978 1979 + 1981: 44(ptr) AccessChain 31(data) 1975 34 + 1982: 23(fvec4) Load 1981 + 1983: 23(fvec4) VectorShuffle 1982 1980 4 5 2 3 + Store 1981 1983 + 1984: 6(int) Load 8(invocation) + 1985: 44(ptr) AccessChain 31(data) 33 34 + 1986: 23(fvec4) Load 1985 + 1987: 51(fvec3) VectorShuffle 1986 1986 0 1 2 + 1988: 17(ivec4) Load 19(ballot) + 1989: 51(fvec3) GroupNonUniformFMin 178 PartitionedExclusiveScanNV 1987 1988 + 1990: 44(ptr) AccessChain 31(data) 1984 34 + 1991: 23(fvec4) Load 1990 + 1992: 23(fvec4) VectorShuffle 1991 1989 4 5 6 3 + Store 1990 1992 + 1993: 6(int) Load 8(invocation) + 1994: 44(ptr) AccessChain 31(data) 115 34 + 1995: 23(fvec4) Load 1994 + 1996: 17(ivec4) Load 19(ballot) + 1997: 23(fvec4) GroupNonUniformFMin 178 PartitionedExclusiveScanNV 1995 1996 + 1998: 44(ptr) AccessChain 31(data) 1993 34 + Store 1998 1997 + 1999: 6(int) Load 8(invocation) + 2000: 64(ptr) AccessChain 31(data) 34 63 35 + 2001: 24(int) Load 2000 + 2002: 17(ivec4) Load 19(ballot) + 2003: 24(int) GroupNonUniformSMin 178 PartitionedExclusiveScanNV 2001 2002 + 2004: 64(ptr) AccessChain 31(data) 1999 63 35 + Store 2004 2003 + 2005: 6(int) Load 8(invocation) + 2006: 71(ptr) AccessChain 31(data) 63 63 + 2007: 25(ivec4) Load 2006 + 2008: 70(ivec2) VectorShuffle 2007 2007 0 1 + 2009: 17(ivec4) Load 19(ballot) + 2010: 70(ivec2) GroupNonUniformSMin 178 PartitionedExclusiveScanNV 2008 2009 + 2011: 71(ptr) AccessChain 31(data) 2005 63 + 2012: 25(ivec4) Load 2011 + 2013: 25(ivec4) VectorShuffle 2012 2010 4 5 2 3 + Store 2011 2013 + 2014: 6(int) Load 8(invocation) + 2015: 71(ptr) AccessChain 31(data) 33 63 + 2016: 25(ivec4) Load 2015 + 2017: 78(ivec3) VectorShuffle 2016 2016 0 1 2 + 2018: 17(ivec4) Load 19(ballot) + 2019: 78(ivec3) GroupNonUniformSMin 178 PartitionedExclusiveScanNV 2017 2018 + 2020: 71(ptr) AccessChain 31(data) 2014 63 + 2021: 25(ivec4) Load 2020 + 2022: 25(ivec4) VectorShuffle 2021 2019 4 5 6 3 + Store 2020 2022 + 2023: 6(int) Load 8(invocation) + 2024: 71(ptr) AccessChain 31(data) 115 63 + 2025: 25(ivec4) Load 2024 + 2026: 17(ivec4) Load 19(ballot) + 2027: 25(ivec4) GroupNonUniformSMin 178 PartitionedExclusiveScanNV 2025 2026 + 2028: 71(ptr) AccessChain 31(data) 2023 63 + Store 2028 2027 + 2029: 6(int) Load 8(invocation) + 2030: 90(ptr) AccessChain 31(data) 34 33 35 + 2031: 6(int) Load 2030 + 2032: 17(ivec4) Load 19(ballot) + 2033: 6(int) GroupNonUniformUMin 178 PartitionedExclusiveScanNV 2031 2032 + 2034: 90(ptr) AccessChain 31(data) 2029 33 35 + Store 2034 2033 + 2035: 6(int) Load 8(invocation) + 2036: 40(ptr) AccessChain 31(data) 63 33 + 2037: 17(ivec4) Load 2036 + 2038: 96(ivec2) VectorShuffle 2037 2037 0 1 + 2039: 17(ivec4) Load 19(ballot) + 2040: 96(ivec2) GroupNonUniformUMin 178 PartitionedExclusiveScanNV 2038 2039 + 2041: 40(ptr) AccessChain 31(data) 2035 33 + 2042: 17(ivec4) Load 2041 + 2043: 17(ivec4) VectorShuffle 2042 2040 4 5 2 3 + Store 2041 2043 + 2044: 6(int) Load 8(invocation) + 2045: 40(ptr) AccessChain 31(data) 33 33 + 2046: 17(ivec4) Load 2045 + 2047: 103(ivec3) VectorShuffle 2046 2046 0 1 2 + 2048: 17(ivec4) Load 19(ballot) + 2049: 103(ivec3) GroupNonUniformUMin 178 PartitionedExclusiveScanNV 2047 2048 + 2050: 40(ptr) AccessChain 31(data) 2044 33 + 2051: 17(ivec4) Load 2050 + 2052: 17(ivec4) VectorShuffle 2051 2049 4 5 6 3 + Store 2050 2052 + 2053: 6(int) Load 8(invocation) + 2054: 40(ptr) AccessChain 31(data) 115 33 + 2055: 17(ivec4) Load 2054 + 2056: 17(ivec4) Load 19(ballot) + 2057: 17(ivec4) GroupNonUniformUMin 178 PartitionedExclusiveScanNV 2055 2056 + 2058: 40(ptr) AccessChain 31(data) 2053 33 + Store 2058 2057 + 2059: 6(int) Load 8(invocation) + 2060: 116(ptr) AccessChain 31(data) 34 115 35 + 2061: 26(float) Load 2060 + 2062: 17(ivec4) Load 19(ballot) + 2063: 26(float) GroupNonUniformFMin 178 PartitionedExclusiveScanNV 2061 2062 + 2064: 116(ptr) AccessChain 31(data) 2059 115 35 + Store 2064 2063 + 2065: 6(int) Load 8(invocation) + 2066: 123(ptr) AccessChain 31(data) 63 115 + 2067: 27(fvec4) Load 2066 + 2068: 122(fvec2) VectorShuffle 2067 2067 0 1 + 2069: 17(ivec4) Load 19(ballot) + 2070: 122(fvec2) GroupNonUniformFMin 178 PartitionedExclusiveScanNV 2068 2069 + 2071: 123(ptr) AccessChain 31(data) 2065 115 + 2072: 27(fvec4) Load 2071 + 2073: 27(fvec4) VectorShuffle 2072 2070 4 5 2 3 + Store 2071 2073 + 2074: 6(int) Load 8(invocation) + 2075: 123(ptr) AccessChain 31(data) 33 115 + 2076: 27(fvec4) Load 2075 + 2077: 130(fvec3) VectorShuffle 2076 2076 0 1 2 + 2078: 17(ivec4) Load 19(ballot) + 2079: 130(fvec3) GroupNonUniformFMin 178 PartitionedExclusiveScanNV 2077 2078 + 2080: 123(ptr) AccessChain 31(data) 2074 115 + 2081: 27(fvec4) Load 2080 + 2082: 27(fvec4) VectorShuffle 2081 2079 4 5 6 3 + Store 2080 2082 + 2083: 6(int) Load 8(invocation) + 2084: 123(ptr) AccessChain 31(data) 115 115 + 2085: 27(fvec4) Load 2084 + 2086: 17(ivec4) Load 19(ballot) + 2087: 27(fvec4) GroupNonUniformFMin 178 PartitionedExclusiveScanNV 2085 2086 + 2088: 123(ptr) AccessChain 31(data) 2083 115 + Store 2088 2087 + 2089: 6(int) Load 8(invocation) + 2090: 36(ptr) AccessChain 31(data) 34 34 35 + 2091: 22(float) Load 2090 + 2092: 17(ivec4) Load 19(ballot) + 2093: 22(float) GroupNonUniformFMax 178 PartitionedExclusiveScanNV 2091 2092 + 2094: 36(ptr) AccessChain 31(data) 2089 34 35 + Store 2094 2093 + 2095: 6(int) Load 8(invocation) + 2096: 44(ptr) AccessChain 31(data) 63 34 + 2097: 23(fvec4) Load 2096 + 2098: 43(fvec2) VectorShuffle 2097 2097 0 1 + 2099: 17(ivec4) Load 19(ballot) + 2100: 43(fvec2) GroupNonUniformFMax 178 PartitionedExclusiveScanNV 2098 2099 + 2101: 44(ptr) AccessChain 31(data) 2095 34 + 2102: 23(fvec4) Load 2101 + 2103: 23(fvec4) VectorShuffle 2102 2100 4 5 2 3 + Store 2101 2103 + 2104: 6(int) Load 8(invocation) + 2105: 44(ptr) AccessChain 31(data) 33 34 + 2106: 23(fvec4) Load 2105 + 2107: 51(fvec3) VectorShuffle 2106 2106 0 1 2 + 2108: 17(ivec4) Load 19(ballot) + 2109: 51(fvec3) GroupNonUniformFMax 178 PartitionedExclusiveScanNV 2107 2108 + 2110: 44(ptr) AccessChain 31(data) 2104 34 + 2111: 23(fvec4) Load 2110 + 2112: 23(fvec4) VectorShuffle 2111 2109 4 5 6 3 + Store 2110 2112 + 2113: 6(int) Load 8(invocation) + 2114: 44(ptr) AccessChain 31(data) 115 34 + 2115: 23(fvec4) Load 2114 + 2116: 17(ivec4) Load 19(ballot) + 2117: 23(fvec4) GroupNonUniformFMax 178 PartitionedExclusiveScanNV 2115 2116 + 2118: 44(ptr) AccessChain 31(data) 2113 34 + Store 2118 2117 + 2119: 6(int) Load 8(invocation) + 2120: 64(ptr) AccessChain 31(data) 34 63 35 + 2121: 24(int) Load 2120 + 2122: 17(ivec4) Load 19(ballot) + 2123: 24(int) GroupNonUniformSMax 178 PartitionedExclusiveScanNV 2121 2122 + 2124: 64(ptr) AccessChain 31(data) 2119 63 35 + Store 2124 2123 + 2125: 6(int) Load 8(invocation) + 2126: 71(ptr) AccessChain 31(data) 63 63 + 2127: 25(ivec4) Load 2126 + 2128: 70(ivec2) VectorShuffle 2127 2127 0 1 + 2129: 17(ivec4) Load 19(ballot) + 2130: 70(ivec2) GroupNonUniformSMax 178 PartitionedExclusiveScanNV 2128 2129 + 2131: 71(ptr) AccessChain 31(data) 2125 63 + 2132: 25(ivec4) Load 2131 + 2133: 25(ivec4) VectorShuffle 2132 2130 4 5 2 3 + Store 2131 2133 + 2134: 6(int) Load 8(invocation) + 2135: 71(ptr) AccessChain 31(data) 33 63 + 2136: 25(ivec4) Load 2135 + 2137: 78(ivec3) VectorShuffle 2136 2136 0 1 2 + 2138: 17(ivec4) Load 19(ballot) + 2139: 78(ivec3) GroupNonUniformSMax 178 PartitionedExclusiveScanNV 2137 2138 + 2140: 71(ptr) AccessChain 31(data) 2134 63 + 2141: 25(ivec4) Load 2140 + 2142: 25(ivec4) VectorShuffle 2141 2139 4 5 6 3 + Store 2140 2142 + 2143: 6(int) Load 8(invocation) + 2144: 71(ptr) AccessChain 31(data) 115 63 + 2145: 25(ivec4) Load 2144 + 2146: 17(ivec4) Load 19(ballot) + 2147: 25(ivec4) GroupNonUniformSMax 178 PartitionedExclusiveScanNV 2145 2146 + 2148: 71(ptr) AccessChain 31(data) 2143 63 + Store 2148 2147 + 2149: 6(int) Load 8(invocation) + 2150: 90(ptr) AccessChain 31(data) 34 33 35 + 2151: 6(int) Load 2150 + 2152: 17(ivec4) Load 19(ballot) + 2153: 6(int) GroupNonUniformUMax 178 PartitionedExclusiveScanNV 2151 2152 + 2154: 90(ptr) AccessChain 31(data) 2149 33 35 + Store 2154 2153 + 2155: 6(int) Load 8(invocation) + 2156: 40(ptr) AccessChain 31(data) 63 33 + 2157: 17(ivec4) Load 2156 + 2158: 96(ivec2) VectorShuffle 2157 2157 0 1 + 2159: 17(ivec4) Load 19(ballot) + 2160: 96(ivec2) GroupNonUniformUMax 178 PartitionedExclusiveScanNV 2158 2159 + 2161: 40(ptr) AccessChain 31(data) 2155 33 + 2162: 17(ivec4) Load 2161 + 2163: 17(ivec4) VectorShuffle 2162 2160 4 5 2 3 + Store 2161 2163 + 2164: 6(int) Load 8(invocation) + 2165: 40(ptr) AccessChain 31(data) 33 33 + 2166: 17(ivec4) Load 2165 + 2167: 103(ivec3) VectorShuffle 2166 2166 0 1 2 + 2168: 17(ivec4) Load 19(ballot) + 2169: 103(ivec3) GroupNonUniformUMax 178 PartitionedExclusiveScanNV 2167 2168 + 2170: 40(ptr) AccessChain 31(data) 2164 33 + 2171: 17(ivec4) Load 2170 + 2172: 17(ivec4) VectorShuffle 2171 2169 4 5 6 3 + Store 2170 2172 + 2173: 6(int) Load 8(invocation) + 2174: 40(ptr) AccessChain 31(data) 115 33 + 2175: 17(ivec4) Load 2174 + 2176: 17(ivec4) Load 19(ballot) + 2177: 17(ivec4) GroupNonUniformUMax 178 PartitionedExclusiveScanNV 2175 2176 + 2178: 40(ptr) AccessChain 31(data) 2173 33 + Store 2178 2177 + 2179: 6(int) Load 8(invocation) + 2180: 116(ptr) AccessChain 31(data) 34 115 35 + 2181: 26(float) Load 2180 + 2182: 17(ivec4) Load 19(ballot) + 2183: 26(float) GroupNonUniformFMax 178 PartitionedExclusiveScanNV 2181 2182 + 2184: 116(ptr) AccessChain 31(data) 2179 115 35 + Store 2184 2183 + 2185: 6(int) Load 8(invocation) + 2186: 123(ptr) AccessChain 31(data) 63 115 + 2187: 27(fvec4) Load 2186 + 2188: 122(fvec2) VectorShuffle 2187 2187 0 1 + 2189: 17(ivec4) Load 19(ballot) + 2190: 122(fvec2) GroupNonUniformFMax 178 PartitionedExclusiveScanNV 2188 2189 + 2191: 123(ptr) AccessChain 31(data) 2185 115 + 2192: 27(fvec4) Load 2191 + 2193: 27(fvec4) VectorShuffle 2192 2190 4 5 2 3 + Store 2191 2193 + 2194: 6(int) Load 8(invocation) + 2195: 123(ptr) AccessChain 31(data) 33 115 + 2196: 27(fvec4) Load 2195 + 2197: 130(fvec3) VectorShuffle 2196 2196 0 1 2 + 2198: 17(ivec4) Load 19(ballot) + 2199: 130(fvec3) GroupNonUniformFMax 178 PartitionedExclusiveScanNV 2197 2198 + 2200: 123(ptr) AccessChain 31(data) 2194 115 + 2201: 27(fvec4) Load 2200 + 2202: 27(fvec4) VectorShuffle 2201 2199 4 5 6 3 + Store 2200 2202 + 2203: 6(int) Load 8(invocation) + 2204: 123(ptr) AccessChain 31(data) 115 115 + 2205: 27(fvec4) Load 2204 + 2206: 17(ivec4) Load 19(ballot) + 2207: 27(fvec4) GroupNonUniformFMax 178 PartitionedExclusiveScanNV 2205 2206 + 2208: 123(ptr) AccessChain 31(data) 2203 115 + Store 2208 2207 + 2209: 6(int) Load 8(invocation) + 2210: 64(ptr) AccessChain 31(data) 34 63 35 + 2211: 24(int) Load 2210 + 2212: 17(ivec4) Load 19(ballot) + 2213: 24(int) GroupNonUniformBitwiseAnd 178 PartitionedExclusiveScanNV 2211 2212 + 2214: 64(ptr) AccessChain 31(data) 2209 63 35 + Store 2214 2213 + 2215: 6(int) Load 8(invocation) + 2216: 71(ptr) AccessChain 31(data) 63 63 + 2217: 25(ivec4) Load 2216 + 2218: 70(ivec2) VectorShuffle 2217 2217 0 1 + 2219: 17(ivec4) Load 19(ballot) + 2220: 70(ivec2) GroupNonUniformBitwiseAnd 178 PartitionedExclusiveScanNV 2218 2219 + 2221: 71(ptr) AccessChain 31(data) 2215 63 + 2222: 25(ivec4) Load 2221 + 2223: 25(ivec4) VectorShuffle 2222 2220 4 5 2 3 + Store 2221 2223 + 2224: 6(int) Load 8(invocation) + 2225: 71(ptr) AccessChain 31(data) 33 63 + 2226: 25(ivec4) Load 2225 + 2227: 78(ivec3) VectorShuffle 2226 2226 0 1 2 + 2228: 17(ivec4) Load 19(ballot) + 2229: 78(ivec3) GroupNonUniformBitwiseAnd 178 PartitionedExclusiveScanNV 2227 2228 + 2230: 71(ptr) AccessChain 31(data) 2224 63 + 2231: 25(ivec4) Load 2230 + 2232: 25(ivec4) VectorShuffle 2231 2229 4 5 6 3 + Store 2230 2232 + 2233: 6(int) Load 8(invocation) + 2234: 71(ptr) AccessChain 31(data) 115 63 + 2235: 25(ivec4) Load 2234 + 2236: 17(ivec4) Load 19(ballot) + 2237: 25(ivec4) GroupNonUniformBitwiseAnd 178 PartitionedExclusiveScanNV 2235 2236 + 2238: 71(ptr) AccessChain 31(data) 2233 63 + Store 2238 2237 + 2239: 6(int) Load 8(invocation) + 2240: 90(ptr) AccessChain 31(data) 34 33 35 + 2241: 6(int) Load 2240 + 2242: 17(ivec4) Load 19(ballot) + 2243: 6(int) GroupNonUniformBitwiseAnd 178 PartitionedExclusiveScanNV 2241 2242 + 2244: 90(ptr) AccessChain 31(data) 2239 33 35 + Store 2244 2243 + 2245: 6(int) Load 8(invocation) + 2246: 40(ptr) AccessChain 31(data) 63 33 + 2247: 17(ivec4) Load 2246 + 2248: 96(ivec2) VectorShuffle 2247 2247 0 1 + 2249: 17(ivec4) Load 19(ballot) + 2250: 96(ivec2) GroupNonUniformBitwiseAnd 178 PartitionedExclusiveScanNV 2248 2249 + 2251: 40(ptr) AccessChain 31(data) 2245 33 + 2252: 17(ivec4) Load 2251 + 2253: 17(ivec4) VectorShuffle 2252 2250 4 5 2 3 + Store 2251 2253 + 2254: 6(int) Load 8(invocation) + 2255: 40(ptr) AccessChain 31(data) 33 33 + 2256: 17(ivec4) Load 2255 + 2257: 103(ivec3) VectorShuffle 2256 2256 0 1 2 + 2258: 17(ivec4) Load 19(ballot) + 2259: 103(ivec3) GroupNonUniformBitwiseAnd 178 PartitionedExclusiveScanNV 2257 2258 + 2260: 40(ptr) AccessChain 31(data) 2254 33 + 2261: 17(ivec4) Load 2260 + 2262: 17(ivec4) VectorShuffle 2261 2259 4 5 6 3 + Store 2260 2262 + 2263: 6(int) Load 8(invocation) + 2264: 40(ptr) AccessChain 31(data) 115 33 + 2265: 17(ivec4) Load 2264 + 2266: 17(ivec4) Load 19(ballot) + 2267: 17(ivec4) GroupNonUniformBitwiseAnd 178 PartitionedExclusiveScanNV 2265 2266 + 2268: 40(ptr) AccessChain 31(data) 2263 33 + Store 2268 2267 + 2269: 6(int) Load 8(invocation) + 2270: 64(ptr) AccessChain 31(data) 34 63 35 + 2271: 24(int) Load 2270 + 2272: 144(bool) SLessThan 2271 34 + 2273: 17(ivec4) Load 19(ballot) + 2274: 144(bool) GroupNonUniformLogicalAnd 178 PartitionedExclusiveScanNV 2272 2273 + 2275: 24(int) Select 2274 63 34 + 2276: 64(ptr) AccessChain 31(data) 2269 63 35 + Store 2276 2275 + 2277: 6(int) Load 8(invocation) + 2278: 71(ptr) AccessChain 31(data) 63 63 + 2279: 25(ivec4) Load 2278 + 2280: 70(ivec2) VectorShuffle 2279 2279 0 1 + 2281: 152(bvec2) SLessThan 2280 727 + 2282: 17(ivec4) Load 19(ballot) + 2283: 152(bvec2) GroupNonUniformLogicalAnd 178 PartitionedExclusiveScanNV 2281 2282 + 2284: 70(ivec2) Select 2283 731 727 + 2285: 71(ptr) AccessChain 31(data) 2277 63 + 2286: 25(ivec4) Load 2285 + 2287: 25(ivec4) VectorShuffle 2286 2284 4 5 2 3 + Store 2285 2287 + 2288: 6(int) Load 8(invocation) + 2289: 71(ptr) AccessChain 31(data) 63 63 + 2290: 25(ivec4) Load 2289 + 2291: 78(ivec3) VectorShuffle 2290 2290 0 1 2 + 2292: 161(bvec3) SLessThan 2291 740 + 2293: 17(ivec4) Load 19(ballot) + 2294: 161(bvec3) GroupNonUniformLogicalAnd 178 PartitionedExclusiveScanNV 2292 2293 + 2295: 78(ivec3) Select 2294 744 740 + 2296: 71(ptr) AccessChain 31(data) 2288 63 + 2297: 25(ivec4) Load 2296 + 2298: 25(ivec4) VectorShuffle 2297 2295 4 5 6 3 + Store 2296 2298 + 2299: 6(int) Load 8(invocation) + 2300: 71(ptr) AccessChain 31(data) 63 63 + 2301: 25(ivec4) Load 2300 + 2302: 169(bvec4) SLessThan 2301 752 + 2303: 17(ivec4) Load 19(ballot) + 2304: 169(bvec4) GroupNonUniformLogicalAnd 178 PartitionedExclusiveScanNV 2302 2303 + 2305: 25(ivec4) Select 2304 756 752 + 2306: 71(ptr) AccessChain 31(data) 2299 63 + Store 2306 2305 + 2307: 6(int) Load 8(invocation) + 2308: 64(ptr) AccessChain 31(data) 34 63 35 + 2309: 24(int) Load 2308 + 2310: 17(ivec4) Load 19(ballot) + 2311: 24(int) GroupNonUniformBitwiseOr 178 PartitionedExclusiveScanNV 2309 2310 + 2312: 64(ptr) AccessChain 31(data) 2307 63 35 + Store 2312 2311 + 2313: 6(int) Load 8(invocation) + 2314: 71(ptr) AccessChain 31(data) 63 63 + 2315: 25(ivec4) Load 2314 + 2316: 70(ivec2) VectorShuffle 2315 2315 0 1 + 2317: 17(ivec4) Load 19(ballot) + 2318: 70(ivec2) GroupNonUniformBitwiseOr 178 PartitionedExclusiveScanNV 2316 2317 + 2319: 71(ptr) AccessChain 31(data) 2313 63 + 2320: 25(ivec4) Load 2319 + 2321: 25(ivec4) VectorShuffle 2320 2318 4 5 2 3 + Store 2319 2321 + 2322: 6(int) Load 8(invocation) + 2323: 71(ptr) AccessChain 31(data) 33 63 + 2324: 25(ivec4) Load 2323 + 2325: 78(ivec3) VectorShuffle 2324 2324 0 1 2 + 2326: 17(ivec4) Load 19(ballot) + 2327: 78(ivec3) GroupNonUniformBitwiseOr 178 PartitionedExclusiveScanNV 2325 2326 + 2328: 71(ptr) AccessChain 31(data) 2322 63 + 2329: 25(ivec4) Load 2328 + 2330: 25(ivec4) VectorShuffle 2329 2327 4 5 6 3 + Store 2328 2330 + 2331: 6(int) Load 8(invocation) + 2332: 71(ptr) AccessChain 31(data) 115 63 + 2333: 25(ivec4) Load 2332 + 2334: 17(ivec4) Load 19(ballot) + 2335: 25(ivec4) GroupNonUniformBitwiseOr 178 PartitionedExclusiveScanNV 2333 2334 + 2336: 71(ptr) AccessChain 31(data) 2331 63 + Store 2336 2335 + 2337: 6(int) Load 8(invocation) + 2338: 90(ptr) AccessChain 31(data) 34 33 35 + 2339: 6(int) Load 2338 + 2340: 17(ivec4) Load 19(ballot) + 2341: 6(int) GroupNonUniformBitwiseOr 178 PartitionedExclusiveScanNV 2339 2340 + 2342: 90(ptr) AccessChain 31(data) 2337 33 35 + Store 2342 2341 + 2343: 6(int) Load 8(invocation) + 2344: 40(ptr) AccessChain 31(data) 63 33 + 2345: 17(ivec4) Load 2344 + 2346: 96(ivec2) VectorShuffle 2345 2345 0 1 + 2347: 17(ivec4) Load 19(ballot) + 2348: 96(ivec2) GroupNonUniformBitwiseOr 178 PartitionedExclusiveScanNV 2346 2347 + 2349: 40(ptr) AccessChain 31(data) 2343 33 + 2350: 17(ivec4) Load 2349 + 2351: 17(ivec4) VectorShuffle 2350 2348 4 5 2 3 + Store 2349 2351 + 2352: 6(int) Load 8(invocation) + 2353: 40(ptr) AccessChain 31(data) 33 33 + 2354: 17(ivec4) Load 2353 + 2355: 103(ivec3) VectorShuffle 2354 2354 0 1 2 + 2356: 17(ivec4) Load 19(ballot) + 2357: 103(ivec3) GroupNonUniformBitwiseOr 178 PartitionedExclusiveScanNV 2355 2356 + 2358: 40(ptr) AccessChain 31(data) 2352 33 + 2359: 17(ivec4) Load 2358 + 2360: 17(ivec4) VectorShuffle 2359 2357 4 5 6 3 + Store 2358 2360 + 2361: 6(int) Load 8(invocation) + 2362: 40(ptr) AccessChain 31(data) 115 33 + 2363: 17(ivec4) Load 2362 + 2364: 17(ivec4) Load 19(ballot) + 2365: 17(ivec4) GroupNonUniformBitwiseOr 178 PartitionedExclusiveScanNV 2363 2364 + 2366: 40(ptr) AccessChain 31(data) 2361 33 + Store 2366 2365 + 2367: 6(int) Load 8(invocation) + 2368: 64(ptr) AccessChain 31(data) 34 63 35 + 2369: 24(int) Load 2368 + 2370: 144(bool) SLessThan 2369 34 + 2371: 17(ivec4) Load 19(ballot) + 2372: 144(bool) GroupNonUniformLogicalOr 178 PartitionedExclusiveScanNV 2370 2371 + 2373: 24(int) Select 2372 63 34 + 2374: 64(ptr) AccessChain 31(data) 2367 63 35 + Store 2374 2373 + 2375: 6(int) Load 8(invocation) + 2376: 71(ptr) AccessChain 31(data) 63 63 + 2377: 25(ivec4) Load 2376 + 2378: 70(ivec2) VectorShuffle 2377 2377 0 1 + 2379: 152(bvec2) SLessThan 2378 727 + 2380: 17(ivec4) Load 19(ballot) + 2381: 152(bvec2) GroupNonUniformLogicalOr 178 PartitionedExclusiveScanNV 2379 2380 + 2382: 70(ivec2) Select 2381 731 727 + 2383: 71(ptr) AccessChain 31(data) 2375 63 + 2384: 25(ivec4) Load 2383 + 2385: 25(ivec4) VectorShuffle 2384 2382 4 5 2 3 + Store 2383 2385 + 2386: 6(int) Load 8(invocation) + 2387: 71(ptr) AccessChain 31(data) 63 63 + 2388: 25(ivec4) Load 2387 + 2389: 78(ivec3) VectorShuffle 2388 2388 0 1 2 + 2390: 161(bvec3) SLessThan 2389 740 + 2391: 17(ivec4) Load 19(ballot) + 2392: 161(bvec3) GroupNonUniformLogicalOr 178 PartitionedExclusiveScanNV 2390 2391 + 2393: 78(ivec3) Select 2392 744 740 + 2394: 71(ptr) AccessChain 31(data) 2386 63 + 2395: 25(ivec4) Load 2394 + 2396: 25(ivec4) VectorShuffle 2395 2393 4 5 6 3 + Store 2394 2396 + 2397: 6(int) Load 8(invocation) + 2398: 71(ptr) AccessChain 31(data) 63 63 + 2399: 25(ivec4) Load 2398 + 2400: 169(bvec4) SLessThan 2399 752 + 2401: 17(ivec4) Load 19(ballot) + 2402: 169(bvec4) GroupNonUniformLogicalOr 178 PartitionedExclusiveScanNV 2400 2401 + 2403: 25(ivec4) Select 2402 756 752 + 2404: 71(ptr) AccessChain 31(data) 2397 63 + Store 2404 2403 + 2405: 6(int) Load 8(invocation) + 2406: 64(ptr) AccessChain 31(data) 34 63 35 + 2407: 24(int) Load 2406 + 2408: 17(ivec4) Load 19(ballot) + 2409: 24(int) GroupNonUniformBitwiseXor 178 PartitionedExclusiveScanNV 2407 2408 + 2410: 64(ptr) AccessChain 31(data) 2405 63 35 + Store 2410 2409 + 2411: 6(int) Load 8(invocation) + 2412: 71(ptr) AccessChain 31(data) 63 63 + 2413: 25(ivec4) Load 2412 + 2414: 70(ivec2) VectorShuffle 2413 2413 0 1 + 2415: 17(ivec4) Load 19(ballot) + 2416: 70(ivec2) GroupNonUniformBitwiseXor 178 PartitionedExclusiveScanNV 2414 2415 + 2417: 71(ptr) AccessChain 31(data) 2411 63 + 2418: 25(ivec4) Load 2417 + 2419: 25(ivec4) VectorShuffle 2418 2416 4 5 2 3 + Store 2417 2419 + 2420: 6(int) Load 8(invocation) + 2421: 71(ptr) AccessChain 31(data) 33 63 + 2422: 25(ivec4) Load 2421 + 2423: 78(ivec3) VectorShuffle 2422 2422 0 1 2 + 2424: 17(ivec4) Load 19(ballot) + 2425: 78(ivec3) GroupNonUniformBitwiseXor 178 PartitionedExclusiveScanNV 2423 2424 + 2426: 71(ptr) AccessChain 31(data) 2420 63 + 2427: 25(ivec4) Load 2426 + 2428: 25(ivec4) VectorShuffle 2427 2425 4 5 6 3 + Store 2426 2428 + 2429: 6(int) Load 8(invocation) + 2430: 71(ptr) AccessChain 31(data) 115 63 + 2431: 25(ivec4) Load 2430 + 2432: 17(ivec4) Load 19(ballot) + 2433: 25(ivec4) GroupNonUniformBitwiseXor 178 PartitionedExclusiveScanNV 2431 2432 + 2434: 71(ptr) AccessChain 31(data) 2429 63 + Store 2434 2433 + 2435: 6(int) Load 8(invocation) + 2436: 90(ptr) AccessChain 31(data) 34 33 35 + 2437: 6(int) Load 2436 + 2438: 17(ivec4) Load 19(ballot) + 2439: 6(int) GroupNonUniformBitwiseXor 178 PartitionedExclusiveScanNV 2437 2438 + 2440: 90(ptr) AccessChain 31(data) 2435 33 35 + Store 2440 2439 + 2441: 6(int) Load 8(invocation) + 2442: 40(ptr) AccessChain 31(data) 63 33 + 2443: 17(ivec4) Load 2442 + 2444: 96(ivec2) VectorShuffle 2443 2443 0 1 + 2445: 17(ivec4) Load 19(ballot) + 2446: 96(ivec2) GroupNonUniformBitwiseXor 178 PartitionedExclusiveScanNV 2444 2445 + 2447: 40(ptr) AccessChain 31(data) 2441 33 + 2448: 17(ivec4) Load 2447 + 2449: 17(ivec4) VectorShuffle 2448 2446 4 5 2 3 + Store 2447 2449 + 2450: 6(int) Load 8(invocation) + 2451: 40(ptr) AccessChain 31(data) 33 33 + 2452: 17(ivec4) Load 2451 + 2453: 103(ivec3) VectorShuffle 2452 2452 0 1 2 + 2454: 17(ivec4) Load 19(ballot) + 2455: 103(ivec3) GroupNonUniformBitwiseXor 178 PartitionedExclusiveScanNV 2453 2454 + 2456: 40(ptr) AccessChain 31(data) 2450 33 + 2457: 17(ivec4) Load 2456 + 2458: 17(ivec4) VectorShuffle 2457 2455 4 5 6 3 + Store 2456 2458 + 2459: 6(int) Load 8(invocation) + 2460: 40(ptr) AccessChain 31(data) 115 33 + 2461: 17(ivec4) Load 2460 + 2462: 17(ivec4) Load 19(ballot) + 2463: 17(ivec4) GroupNonUniformBitwiseXor 178 PartitionedExclusiveScanNV 2461 2462 + 2464: 40(ptr) AccessChain 31(data) 2459 33 + Store 2464 2463 + 2465: 6(int) Load 8(invocation) + 2466: 64(ptr) AccessChain 31(data) 34 63 35 + 2467: 24(int) Load 2466 + 2468: 144(bool) SLessThan 2467 34 + 2469: 17(ivec4) Load 19(ballot) + 2470: 144(bool) GroupNonUniformLogicalXor 178 PartitionedExclusiveScanNV 2468 2469 + 2471: 24(int) Select 2470 63 34 + 2472: 64(ptr) AccessChain 31(data) 2465 63 35 + Store 2472 2471 + 2473: 6(int) Load 8(invocation) + 2474: 71(ptr) AccessChain 31(data) 63 63 + 2475: 25(ivec4) Load 2474 + 2476: 70(ivec2) VectorShuffle 2475 2475 0 1 + 2477: 152(bvec2) SLessThan 2476 727 + 2478: 17(ivec4) Load 19(ballot) + 2479: 152(bvec2) GroupNonUniformLogicalXor 178 PartitionedExclusiveScanNV 2477 2478 + 2480: 70(ivec2) Select 2479 731 727 + 2481: 71(ptr) AccessChain 31(data) 2473 63 + 2482: 25(ivec4) Load 2481 + 2483: 25(ivec4) VectorShuffle 2482 2480 4 5 2 3 + Store 2481 2483 + 2484: 6(int) Load 8(invocation) + 2485: 71(ptr) AccessChain 31(data) 63 63 + 2486: 25(ivec4) Load 2485 + 2487: 78(ivec3) VectorShuffle 2486 2486 0 1 2 + 2488: 161(bvec3) SLessThan 2487 740 + 2489: 17(ivec4) Load 19(ballot) + 2490: 161(bvec3) GroupNonUniformLogicalXor 178 PartitionedExclusiveScanNV 2488 2489 + 2491: 78(ivec3) Select 2490 744 740 + 2492: 71(ptr) AccessChain 31(data) 2484 63 + 2493: 25(ivec4) Load 2492 + 2494: 25(ivec4) VectorShuffle 2493 2491 4 5 6 3 + Store 2492 2494 + 2495: 6(int) Load 8(invocation) + 2496: 71(ptr) AccessChain 31(data) 63 63 + 2497: 25(ivec4) Load 2496 + 2498: 169(bvec4) SLessThan 2497 752 + 2499: 17(ivec4) Load 19(ballot) + 2500: 169(bvec4) GroupNonUniformLogicalXor 178 PartitionedExclusiveScanNV 2498 2499 + 2501: 25(ivec4) Select 2500 756 752 + 2502: 71(ptr) AccessChain 31(data) 2495 63 + Store 2502 2501 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupQuad.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupQuad.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupQuad.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupQuad.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,739 @@ +spv.subgroupQuad.comp +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 616 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformQuad + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 10 12 + ExecutionMode 4 LocalSize 8 1 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + SourceExtension "GL_KHR_shader_subgroup_quad" + Name 4 "main" + Name 8 "invocation" + Name 10 "gl_SubgroupInvocationID" + Name 12 "gl_SubgroupSize" + Name 24 "Buffers" + MemberName 24(Buffers) 0 "f4" + MemberName 24(Buffers) 1 "i4" + MemberName 24(Buffers) 2 "u4" + MemberName 24(Buffers) 3 "d4" + Name 27 "data" + Decorate 10(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 10(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 11 RelaxedPrecision + Decorate 12(gl_SubgroupSize) RelaxedPrecision + Decorate 12(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 13 RelaxedPrecision + Decorate 14 RelaxedPrecision + Decorate 16 RelaxedPrecision + MemberDecorate 24(Buffers) 0 Offset 0 + MemberDecorate 24(Buffers) 1 Offset 16 + MemberDecorate 24(Buffers) 2 Offset 32 + MemberDecorate 24(Buffers) 3 Offset 64 + Decorate 24(Buffers) BufferBlock + Decorate 27(data) DescriptorSet 0 + Decorate 27(data) Binding 0 + Decorate 615 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_SubgroupInvocationID): 9(ptr) Variable Input +12(gl_SubgroupSize): 9(ptr) Variable Input + 15: 6(int) Constant 4 + 17: TypeFloat 32 + 18: TypeVector 17(float) 4 + 19: TypeInt 32 1 + 20: TypeVector 19(int) 4 + 21: TypeVector 6(int) 4 + 22: TypeFloat 64 + 23: TypeVector 22(float) 4 + 24(Buffers): TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(fvec4) + 25: TypeArray 24(Buffers) 15 + 26: TypePointer Uniform 25 + 27(data): 26(ptr) Variable Uniform + 29: 19(int) Constant 0 + 30: 6(int) Constant 0 + 31: TypePointer Uniform 17(float) + 34: 6(int) Constant 1 + 35: 6(int) Constant 3 + 39: 19(int) Constant 1 + 40: TypeVector 17(float) 2 + 41: TypePointer Uniform 18(fvec4) + 50: 19(int) Constant 2 + 51: TypeVector 17(float) 3 + 60: 19(int) Constant 3 + 66: TypePointer Uniform 19(int) + 72: TypeVector 19(int) 2 + 73: TypePointer Uniform 20(ivec4) + 82: TypeVector 19(int) 3 + 96: TypePointer Uniform 6(int) + 102: TypeVector 6(int) 2 + 103: TypePointer Uniform 21(ivec4) + 112: TypeVector 6(int) 3 + 126: TypePointer Uniform 22(float) + 132: TypeVector 22(float) 2 + 133: TypePointer Uniform 23(fvec4) + 142: TypeVector 22(float) 3 + 158: TypeBool + 167: 72(ivec2) ConstantComposite 29 29 + 168: TypeVector 158(bool) 2 + 171: 72(ivec2) ConstantComposite 39 39 + 180: 82(ivec3) ConstantComposite 29 29 29 + 181: TypeVector 158(bool) 3 + 184: 82(ivec3) ConstantComposite 39 39 39 + 192: 20(ivec4) ConstantComposite 29 29 29 29 + 193: TypeVector 158(bool) 4 + 196: 20(ivec4) ConstantComposite 39 39 39 39 + 478: 6(int) Constant 2 + 614: 6(int) Constant 8 + 615: 112(ivec3) ConstantComposite 614 34 34 + 4(main): 2 Function None 3 + 5: Label + 8(invocation): 7(ptr) Variable Function + 11: 6(int) Load 10(gl_SubgroupInvocationID) + 13: 6(int) Load 12(gl_SubgroupSize) + 14: 6(int) IAdd 11 13 + 16: 6(int) UMod 14 15 + Store 8(invocation) 16 + 28: 6(int) Load 8(invocation) + 32: 31(ptr) AccessChain 27(data) 29 29 30 + 33: 17(float) Load 32 + 36: 17(float) GroupNonUniformQuadBroadcast 35 33 34 + 37: 31(ptr) AccessChain 27(data) 28 29 30 + Store 37 36 + 38: 6(int) Load 8(invocation) + 42: 41(ptr) AccessChain 27(data) 39 29 + 43: 18(fvec4) Load 42 + 44: 40(fvec2) VectorShuffle 43 43 0 1 + 45: 40(fvec2) GroupNonUniformQuadBroadcast 35 44 34 + 46: 41(ptr) AccessChain 27(data) 38 29 + 47: 18(fvec4) Load 46 + 48: 18(fvec4) VectorShuffle 47 45 4 5 2 3 + Store 46 48 + 49: 6(int) Load 8(invocation) + 52: 41(ptr) AccessChain 27(data) 50 29 + 53: 18(fvec4) Load 52 + 54: 51(fvec3) VectorShuffle 53 53 0 1 2 + 55: 51(fvec3) GroupNonUniformQuadBroadcast 35 54 34 + 56: 41(ptr) AccessChain 27(data) 49 29 + 57: 18(fvec4) Load 56 + 58: 18(fvec4) VectorShuffle 57 55 4 5 6 3 + Store 56 58 + 59: 6(int) Load 8(invocation) + 61: 41(ptr) AccessChain 27(data) 60 29 + 62: 18(fvec4) Load 61 + 63: 18(fvec4) GroupNonUniformQuadBroadcast 35 62 34 + 64: 41(ptr) AccessChain 27(data) 59 29 + Store 64 63 + 65: 6(int) Load 8(invocation) + 67: 66(ptr) AccessChain 27(data) 29 39 30 + 68: 19(int) Load 67 + 69: 19(int) GroupNonUniformQuadBroadcast 35 68 34 + 70: 66(ptr) AccessChain 27(data) 65 39 30 + Store 70 69 + 71: 6(int) Load 8(invocation) + 74: 73(ptr) AccessChain 27(data) 39 39 + 75: 20(ivec4) Load 74 + 76: 72(ivec2) VectorShuffle 75 75 0 1 + 77: 72(ivec2) GroupNonUniformQuadBroadcast 35 76 34 + 78: 73(ptr) AccessChain 27(data) 71 39 + 79: 20(ivec4) Load 78 + 80: 20(ivec4) VectorShuffle 79 77 4 5 2 3 + Store 78 80 + 81: 6(int) Load 8(invocation) + 83: 73(ptr) AccessChain 27(data) 50 39 + 84: 20(ivec4) Load 83 + 85: 82(ivec3) VectorShuffle 84 84 0 1 2 + 86: 82(ivec3) GroupNonUniformQuadBroadcast 35 85 34 + 87: 73(ptr) AccessChain 27(data) 81 39 + 88: 20(ivec4) Load 87 + 89: 20(ivec4) VectorShuffle 88 86 4 5 6 3 + Store 87 89 + 90: 6(int) Load 8(invocation) + 91: 73(ptr) AccessChain 27(data) 60 39 + 92: 20(ivec4) Load 91 + 93: 20(ivec4) GroupNonUniformQuadBroadcast 35 92 34 + 94: 73(ptr) AccessChain 27(data) 90 39 + Store 94 93 + 95: 6(int) Load 8(invocation) + 97: 96(ptr) AccessChain 27(data) 29 50 30 + 98: 6(int) Load 97 + 99: 6(int) GroupNonUniformQuadBroadcast 35 98 34 + 100: 96(ptr) AccessChain 27(data) 95 50 30 + Store 100 99 + 101: 6(int) Load 8(invocation) + 104: 103(ptr) AccessChain 27(data) 39 50 + 105: 21(ivec4) Load 104 + 106: 102(ivec2) VectorShuffle 105 105 0 1 + 107: 102(ivec2) GroupNonUniformQuadBroadcast 35 106 34 + 108: 103(ptr) AccessChain 27(data) 101 50 + 109: 21(ivec4) Load 108 + 110: 21(ivec4) VectorShuffle 109 107 4 5 2 3 + Store 108 110 + 111: 6(int) Load 8(invocation) + 113: 103(ptr) AccessChain 27(data) 50 50 + 114: 21(ivec4) Load 113 + 115: 112(ivec3) VectorShuffle 114 114 0 1 2 + 116: 112(ivec3) GroupNonUniformQuadBroadcast 35 115 34 + 117: 103(ptr) AccessChain 27(data) 111 50 + 118: 21(ivec4) Load 117 + 119: 21(ivec4) VectorShuffle 118 116 4 5 6 3 + Store 117 119 + 120: 6(int) Load 8(invocation) + 121: 103(ptr) AccessChain 27(data) 60 50 + 122: 21(ivec4) Load 121 + 123: 21(ivec4) GroupNonUniformQuadBroadcast 35 122 34 + 124: 103(ptr) AccessChain 27(data) 120 50 + Store 124 123 + 125: 6(int) Load 8(invocation) + 127: 126(ptr) AccessChain 27(data) 29 60 30 + 128: 22(float) Load 127 + 129: 22(float) GroupNonUniformQuadBroadcast 35 128 34 + 130: 126(ptr) AccessChain 27(data) 125 60 30 + Store 130 129 + 131: 6(int) Load 8(invocation) + 134: 133(ptr) AccessChain 27(data) 39 60 + 135: 23(fvec4) Load 134 + 136: 132(fvec2) VectorShuffle 135 135 0 1 + 137: 132(fvec2) GroupNonUniformQuadBroadcast 35 136 34 + 138: 133(ptr) AccessChain 27(data) 131 60 + 139: 23(fvec4) Load 138 + 140: 23(fvec4) VectorShuffle 139 137 4 5 2 3 + Store 138 140 + 141: 6(int) Load 8(invocation) + 143: 133(ptr) AccessChain 27(data) 50 60 + 144: 23(fvec4) Load 143 + 145: 142(fvec3) VectorShuffle 144 144 0 1 2 + 146: 142(fvec3) GroupNonUniformQuadBroadcast 35 145 34 + 147: 133(ptr) AccessChain 27(data) 141 60 + 148: 23(fvec4) Load 147 + 149: 23(fvec4) VectorShuffle 148 146 4 5 6 3 + Store 147 149 + 150: 6(int) Load 8(invocation) + 151: 133(ptr) AccessChain 27(data) 60 60 + 152: 23(fvec4) Load 151 + 153: 23(fvec4) GroupNonUniformQuadBroadcast 35 152 34 + 154: 133(ptr) AccessChain 27(data) 150 60 + Store 154 153 + 155: 6(int) Load 8(invocation) + 156: 66(ptr) AccessChain 27(data) 29 39 30 + 157: 19(int) Load 156 + 159: 158(bool) SLessThan 157 29 + 160: 158(bool) GroupNonUniformQuadBroadcast 35 159 34 + 161: 19(int) Select 160 39 29 + 162: 66(ptr) AccessChain 27(data) 155 39 30 + Store 162 161 + 163: 6(int) Load 8(invocation) + 164: 73(ptr) AccessChain 27(data) 39 39 + 165: 20(ivec4) Load 164 + 166: 72(ivec2) VectorShuffle 165 165 0 1 + 169: 168(bvec2) SLessThan 166 167 + 170: 168(bvec2) GroupNonUniformQuadBroadcast 35 169 34 + 172: 72(ivec2) Select 170 171 167 + 173: 73(ptr) AccessChain 27(data) 163 39 + 174: 20(ivec4) Load 173 + 175: 20(ivec4) VectorShuffle 174 172 4 5 2 3 + Store 173 175 + 176: 6(int) Load 8(invocation) + 177: 73(ptr) AccessChain 27(data) 39 39 + 178: 20(ivec4) Load 177 + 179: 82(ivec3) VectorShuffle 178 178 0 1 2 + 182: 181(bvec3) SLessThan 179 180 + 183: 181(bvec3) GroupNonUniformQuadBroadcast 35 182 34 + 185: 82(ivec3) Select 183 184 180 + 186: 73(ptr) AccessChain 27(data) 176 39 + 187: 20(ivec4) Load 186 + 188: 20(ivec4) VectorShuffle 187 185 4 5 6 3 + Store 186 188 + 189: 6(int) Load 8(invocation) + 190: 73(ptr) AccessChain 27(data) 39 39 + 191: 20(ivec4) Load 190 + 194: 193(bvec4) SLessThan 191 192 + 195: 193(bvec4) GroupNonUniformQuadBroadcast 35 194 34 + 197: 20(ivec4) Select 195 196 192 + 198: 73(ptr) AccessChain 27(data) 189 39 + Store 198 197 + 199: 6(int) Load 8(invocation) + 200: 31(ptr) AccessChain 27(data) 29 29 30 + 201: 17(float) Load 200 + 202: 17(float) GroupNonUniformQuadSwap 35 201 30 + 203: 31(ptr) AccessChain 27(data) 199 29 30 + Store 203 202 + 204: 6(int) Load 8(invocation) + 205: 41(ptr) AccessChain 27(data) 39 29 + 206: 18(fvec4) Load 205 + 207: 40(fvec2) VectorShuffle 206 206 0 1 + 208: 40(fvec2) GroupNonUniformQuadSwap 35 207 30 + 209: 41(ptr) AccessChain 27(data) 204 29 + 210: 18(fvec4) Load 209 + 211: 18(fvec4) VectorShuffle 210 208 4 5 2 3 + Store 209 211 + 212: 6(int) Load 8(invocation) + 213: 41(ptr) AccessChain 27(data) 50 29 + 214: 18(fvec4) Load 213 + 215: 51(fvec3) VectorShuffle 214 214 0 1 2 + 216: 51(fvec3) GroupNonUniformQuadSwap 35 215 30 + 217: 41(ptr) AccessChain 27(data) 212 29 + 218: 18(fvec4) Load 217 + 219: 18(fvec4) VectorShuffle 218 216 4 5 6 3 + Store 217 219 + 220: 6(int) Load 8(invocation) + 221: 41(ptr) AccessChain 27(data) 60 29 + 222: 18(fvec4) Load 221 + 223: 18(fvec4) GroupNonUniformQuadSwap 35 222 30 + 224: 41(ptr) AccessChain 27(data) 220 29 + Store 224 223 + 225: 6(int) Load 8(invocation) + 226: 66(ptr) AccessChain 27(data) 29 39 30 + 227: 19(int) Load 226 + 228: 19(int) GroupNonUniformQuadSwap 35 227 30 + 229: 66(ptr) AccessChain 27(data) 225 39 30 + Store 229 228 + 230: 6(int) Load 8(invocation) + 231: 73(ptr) AccessChain 27(data) 39 39 + 232: 20(ivec4) Load 231 + 233: 72(ivec2) VectorShuffle 232 232 0 1 + 234: 72(ivec2) GroupNonUniformQuadSwap 35 233 30 + 235: 73(ptr) AccessChain 27(data) 230 39 + 236: 20(ivec4) Load 235 + 237: 20(ivec4) VectorShuffle 236 234 4 5 2 3 + Store 235 237 + 238: 6(int) Load 8(invocation) + 239: 73(ptr) AccessChain 27(data) 50 39 + 240: 20(ivec4) Load 239 + 241: 82(ivec3) VectorShuffle 240 240 0 1 2 + 242: 82(ivec3) GroupNonUniformQuadSwap 35 241 30 + 243: 73(ptr) AccessChain 27(data) 238 39 + 244: 20(ivec4) Load 243 + 245: 20(ivec4) VectorShuffle 244 242 4 5 6 3 + Store 243 245 + 246: 6(int) Load 8(invocation) + 247: 73(ptr) AccessChain 27(data) 60 39 + 248: 20(ivec4) Load 247 + 249: 20(ivec4) GroupNonUniformQuadSwap 35 248 30 + 250: 73(ptr) AccessChain 27(data) 246 39 + Store 250 249 + 251: 6(int) Load 8(invocation) + 252: 96(ptr) AccessChain 27(data) 29 50 30 + 253: 6(int) Load 252 + 254: 6(int) GroupNonUniformQuadSwap 35 253 30 + 255: 96(ptr) AccessChain 27(data) 251 50 30 + Store 255 254 + 256: 6(int) Load 8(invocation) + 257: 103(ptr) AccessChain 27(data) 39 50 + 258: 21(ivec4) Load 257 + 259: 102(ivec2) VectorShuffle 258 258 0 1 + 260: 102(ivec2) GroupNonUniformQuadSwap 35 259 30 + 261: 103(ptr) AccessChain 27(data) 256 50 + 262: 21(ivec4) Load 261 + 263: 21(ivec4) VectorShuffle 262 260 4 5 2 3 + Store 261 263 + 264: 6(int) Load 8(invocation) + 265: 103(ptr) AccessChain 27(data) 50 50 + 266: 21(ivec4) Load 265 + 267: 112(ivec3) VectorShuffle 266 266 0 1 2 + 268: 112(ivec3) GroupNonUniformQuadSwap 35 267 30 + 269: 103(ptr) AccessChain 27(data) 264 50 + 270: 21(ivec4) Load 269 + 271: 21(ivec4) VectorShuffle 270 268 4 5 6 3 + Store 269 271 + 272: 6(int) Load 8(invocation) + 273: 103(ptr) AccessChain 27(data) 60 50 + 274: 21(ivec4) Load 273 + 275: 21(ivec4) GroupNonUniformQuadSwap 35 274 30 + 276: 103(ptr) AccessChain 27(data) 272 50 + Store 276 275 + 277: 6(int) Load 8(invocation) + 278: 126(ptr) AccessChain 27(data) 29 60 30 + 279: 22(float) Load 278 + 280: 22(float) GroupNonUniformQuadSwap 35 279 30 + 281: 126(ptr) AccessChain 27(data) 277 60 30 + Store 281 280 + 282: 6(int) Load 8(invocation) + 283: 133(ptr) AccessChain 27(data) 39 60 + 284: 23(fvec4) Load 283 + 285: 132(fvec2) VectorShuffle 284 284 0 1 + 286: 132(fvec2) GroupNonUniformQuadSwap 35 285 30 + 287: 133(ptr) AccessChain 27(data) 282 60 + 288: 23(fvec4) Load 287 + 289: 23(fvec4) VectorShuffle 288 286 4 5 2 3 + Store 287 289 + 290: 6(int) Load 8(invocation) + 291: 133(ptr) AccessChain 27(data) 50 60 + 292: 23(fvec4) Load 291 + 293: 142(fvec3) VectorShuffle 292 292 0 1 2 + 294: 142(fvec3) GroupNonUniformQuadSwap 35 293 30 + 295: 133(ptr) AccessChain 27(data) 290 60 + 296: 23(fvec4) Load 295 + 297: 23(fvec4) VectorShuffle 296 294 4 5 6 3 + Store 295 297 + 298: 6(int) Load 8(invocation) + 299: 133(ptr) AccessChain 27(data) 60 60 + 300: 23(fvec4) Load 299 + 301: 23(fvec4) GroupNonUniformQuadSwap 35 300 30 + 302: 133(ptr) AccessChain 27(data) 298 60 + Store 302 301 + 303: 6(int) Load 8(invocation) + 304: 66(ptr) AccessChain 27(data) 29 39 30 + 305: 19(int) Load 304 + 306: 158(bool) SLessThan 305 29 + 307: 158(bool) GroupNonUniformQuadSwap 35 306 30 + 308: 19(int) Select 307 39 29 + 309: 66(ptr) AccessChain 27(data) 303 39 30 + Store 309 308 + 310: 6(int) Load 8(invocation) + 311: 73(ptr) AccessChain 27(data) 39 39 + 312: 20(ivec4) Load 311 + 313: 72(ivec2) VectorShuffle 312 312 0 1 + 314: 168(bvec2) SLessThan 313 167 + 315: 168(bvec2) GroupNonUniformQuadSwap 35 314 30 + 316: 72(ivec2) Select 315 171 167 + 317: 73(ptr) AccessChain 27(data) 310 39 + 318: 20(ivec4) Load 317 + 319: 20(ivec4) VectorShuffle 318 316 4 5 2 3 + Store 317 319 + 320: 6(int) Load 8(invocation) + 321: 73(ptr) AccessChain 27(data) 39 39 + 322: 20(ivec4) Load 321 + 323: 82(ivec3) VectorShuffle 322 322 0 1 2 + 324: 181(bvec3) SLessThan 323 180 + 325: 181(bvec3) GroupNonUniformQuadSwap 35 324 30 + 326: 82(ivec3) Select 325 184 180 + 327: 73(ptr) AccessChain 27(data) 320 39 + 328: 20(ivec4) Load 327 + 329: 20(ivec4) VectorShuffle 328 326 4 5 6 3 + Store 327 329 + 330: 6(int) Load 8(invocation) + 331: 73(ptr) AccessChain 27(data) 39 39 + 332: 20(ivec4) Load 331 + 333: 193(bvec4) SLessThan 332 192 + 334: 193(bvec4) GroupNonUniformQuadSwap 35 333 30 + 335: 20(ivec4) Select 334 196 192 + 336: 73(ptr) AccessChain 27(data) 330 39 + Store 336 335 + 337: 6(int) Load 8(invocation) + 338: 31(ptr) AccessChain 27(data) 29 29 30 + 339: 17(float) Load 338 + 340: 17(float) GroupNonUniformQuadSwap 35 339 34 + 341: 31(ptr) AccessChain 27(data) 337 29 30 + Store 341 340 + 342: 6(int) Load 8(invocation) + 343: 41(ptr) AccessChain 27(data) 39 29 + 344: 18(fvec4) Load 343 + 345: 40(fvec2) VectorShuffle 344 344 0 1 + 346: 40(fvec2) GroupNonUniformQuadSwap 35 345 34 + 347: 41(ptr) AccessChain 27(data) 342 29 + 348: 18(fvec4) Load 347 + 349: 18(fvec4) VectorShuffle 348 346 4 5 2 3 + Store 347 349 + 350: 6(int) Load 8(invocation) + 351: 41(ptr) AccessChain 27(data) 50 29 + 352: 18(fvec4) Load 351 + 353: 51(fvec3) VectorShuffle 352 352 0 1 2 + 354: 51(fvec3) GroupNonUniformQuadSwap 35 353 34 + 355: 41(ptr) AccessChain 27(data) 350 29 + 356: 18(fvec4) Load 355 + 357: 18(fvec4) VectorShuffle 356 354 4 5 6 3 + Store 355 357 + 358: 6(int) Load 8(invocation) + 359: 41(ptr) AccessChain 27(data) 60 29 + 360: 18(fvec4) Load 359 + 361: 18(fvec4) GroupNonUniformQuadSwap 35 360 34 + 362: 41(ptr) AccessChain 27(data) 358 29 + Store 362 361 + 363: 6(int) Load 8(invocation) + 364: 66(ptr) AccessChain 27(data) 29 39 30 + 365: 19(int) Load 364 + 366: 19(int) GroupNonUniformQuadSwap 35 365 34 + 367: 66(ptr) AccessChain 27(data) 363 39 30 + Store 367 366 + 368: 6(int) Load 8(invocation) + 369: 73(ptr) AccessChain 27(data) 39 39 + 370: 20(ivec4) Load 369 + 371: 72(ivec2) VectorShuffle 370 370 0 1 + 372: 72(ivec2) GroupNonUniformQuadSwap 35 371 34 + 373: 73(ptr) AccessChain 27(data) 368 39 + 374: 20(ivec4) Load 373 + 375: 20(ivec4) VectorShuffle 374 372 4 5 2 3 + Store 373 375 + 376: 6(int) Load 8(invocation) + 377: 73(ptr) AccessChain 27(data) 50 39 + 378: 20(ivec4) Load 377 + 379: 82(ivec3) VectorShuffle 378 378 0 1 2 + 380: 82(ivec3) GroupNonUniformQuadSwap 35 379 34 + 381: 73(ptr) AccessChain 27(data) 376 39 + 382: 20(ivec4) Load 381 + 383: 20(ivec4) VectorShuffle 382 380 4 5 6 3 + Store 381 383 + 384: 6(int) Load 8(invocation) + 385: 73(ptr) AccessChain 27(data) 60 39 + 386: 20(ivec4) Load 385 + 387: 20(ivec4) GroupNonUniformQuadSwap 35 386 34 + 388: 73(ptr) AccessChain 27(data) 384 39 + Store 388 387 + 389: 6(int) Load 8(invocation) + 390: 96(ptr) AccessChain 27(data) 29 50 30 + 391: 6(int) Load 390 + 392: 6(int) GroupNonUniformQuadSwap 35 391 34 + 393: 96(ptr) AccessChain 27(data) 389 50 30 + Store 393 392 + 394: 6(int) Load 8(invocation) + 395: 103(ptr) AccessChain 27(data) 39 50 + 396: 21(ivec4) Load 395 + 397: 102(ivec2) VectorShuffle 396 396 0 1 + 398: 102(ivec2) GroupNonUniformQuadSwap 35 397 34 + 399: 103(ptr) AccessChain 27(data) 394 50 + 400: 21(ivec4) Load 399 + 401: 21(ivec4) VectorShuffle 400 398 4 5 2 3 + Store 399 401 + 402: 6(int) Load 8(invocation) + 403: 103(ptr) AccessChain 27(data) 50 50 + 404: 21(ivec4) Load 403 + 405: 112(ivec3) VectorShuffle 404 404 0 1 2 + 406: 112(ivec3) GroupNonUniformQuadSwap 35 405 34 + 407: 103(ptr) AccessChain 27(data) 402 50 + 408: 21(ivec4) Load 407 + 409: 21(ivec4) VectorShuffle 408 406 4 5 6 3 + Store 407 409 + 410: 6(int) Load 8(invocation) + 411: 103(ptr) AccessChain 27(data) 60 50 + 412: 21(ivec4) Load 411 + 413: 21(ivec4) GroupNonUniformQuadSwap 35 412 34 + 414: 103(ptr) AccessChain 27(data) 410 50 + Store 414 413 + 415: 6(int) Load 8(invocation) + 416: 126(ptr) AccessChain 27(data) 29 60 30 + 417: 22(float) Load 416 + 418: 22(float) GroupNonUniformQuadSwap 35 417 34 + 419: 126(ptr) AccessChain 27(data) 415 60 30 + Store 419 418 + 420: 6(int) Load 8(invocation) + 421: 133(ptr) AccessChain 27(data) 39 60 + 422: 23(fvec4) Load 421 + 423: 132(fvec2) VectorShuffle 422 422 0 1 + 424: 132(fvec2) GroupNonUniformQuadSwap 35 423 34 + 425: 133(ptr) AccessChain 27(data) 420 60 + 426: 23(fvec4) Load 425 + 427: 23(fvec4) VectorShuffle 426 424 4 5 2 3 + Store 425 427 + 428: 6(int) Load 8(invocation) + 429: 133(ptr) AccessChain 27(data) 50 60 + 430: 23(fvec4) Load 429 + 431: 142(fvec3) VectorShuffle 430 430 0 1 2 + 432: 142(fvec3) GroupNonUniformQuadSwap 35 431 34 + 433: 133(ptr) AccessChain 27(data) 428 60 + 434: 23(fvec4) Load 433 + 435: 23(fvec4) VectorShuffle 434 432 4 5 6 3 + Store 433 435 + 436: 6(int) Load 8(invocation) + 437: 133(ptr) AccessChain 27(data) 60 60 + 438: 23(fvec4) Load 437 + 439: 23(fvec4) GroupNonUniformQuadSwap 35 438 34 + 440: 133(ptr) AccessChain 27(data) 436 60 + Store 440 439 + 441: 6(int) Load 8(invocation) + 442: 66(ptr) AccessChain 27(data) 29 39 30 + 443: 19(int) Load 442 + 444: 158(bool) SLessThan 443 29 + 445: 158(bool) GroupNonUniformQuadSwap 35 444 34 + 446: 19(int) Select 445 39 29 + 447: 66(ptr) AccessChain 27(data) 441 39 30 + Store 447 446 + 448: 6(int) Load 8(invocation) + 449: 73(ptr) AccessChain 27(data) 39 39 + 450: 20(ivec4) Load 449 + 451: 72(ivec2) VectorShuffle 450 450 0 1 + 452: 168(bvec2) SLessThan 451 167 + 453: 168(bvec2) GroupNonUniformQuadSwap 35 452 34 + 454: 72(ivec2) Select 453 171 167 + 455: 73(ptr) AccessChain 27(data) 448 39 + 456: 20(ivec4) Load 455 + 457: 20(ivec4) VectorShuffle 456 454 4 5 2 3 + Store 455 457 + 458: 6(int) Load 8(invocation) + 459: 73(ptr) AccessChain 27(data) 39 39 + 460: 20(ivec4) Load 459 + 461: 82(ivec3) VectorShuffle 460 460 0 1 2 + 462: 181(bvec3) SLessThan 461 180 + 463: 181(bvec3) GroupNonUniformQuadSwap 35 462 34 + 464: 82(ivec3) Select 463 184 180 + 465: 73(ptr) AccessChain 27(data) 458 39 + 466: 20(ivec4) Load 465 + 467: 20(ivec4) VectorShuffle 466 464 4 5 6 3 + Store 465 467 + 468: 6(int) Load 8(invocation) + 469: 73(ptr) AccessChain 27(data) 39 39 + 470: 20(ivec4) Load 469 + 471: 193(bvec4) SLessThan 470 192 + 472: 193(bvec4) GroupNonUniformQuadSwap 35 471 34 + 473: 20(ivec4) Select 472 196 192 + 474: 73(ptr) AccessChain 27(data) 468 39 + Store 474 473 + 475: 6(int) Load 8(invocation) + 476: 31(ptr) AccessChain 27(data) 29 29 30 + 477: 17(float) Load 476 + 479: 17(float) GroupNonUniformQuadSwap 35 477 478 + 480: 31(ptr) AccessChain 27(data) 475 29 30 + Store 480 479 + 481: 6(int) Load 8(invocation) + 482: 41(ptr) AccessChain 27(data) 39 29 + 483: 18(fvec4) Load 482 + 484: 40(fvec2) VectorShuffle 483 483 0 1 + 485: 40(fvec2) GroupNonUniformQuadSwap 35 484 478 + 486: 41(ptr) AccessChain 27(data) 481 29 + 487: 18(fvec4) Load 486 + 488: 18(fvec4) VectorShuffle 487 485 4 5 2 3 + Store 486 488 + 489: 6(int) Load 8(invocation) + 490: 41(ptr) AccessChain 27(data) 50 29 + 491: 18(fvec4) Load 490 + 492: 51(fvec3) VectorShuffle 491 491 0 1 2 + 493: 51(fvec3) GroupNonUniformQuadSwap 35 492 478 + 494: 41(ptr) AccessChain 27(data) 489 29 + 495: 18(fvec4) Load 494 + 496: 18(fvec4) VectorShuffle 495 493 4 5 6 3 + Store 494 496 + 497: 6(int) Load 8(invocation) + 498: 41(ptr) AccessChain 27(data) 60 29 + 499: 18(fvec4) Load 498 + 500: 18(fvec4) GroupNonUniformQuadSwap 35 499 478 + 501: 41(ptr) AccessChain 27(data) 497 29 + Store 501 500 + 502: 6(int) Load 8(invocation) + 503: 66(ptr) AccessChain 27(data) 29 39 30 + 504: 19(int) Load 503 + 505: 19(int) GroupNonUniformQuadSwap 35 504 478 + 506: 66(ptr) AccessChain 27(data) 502 39 30 + Store 506 505 + 507: 6(int) Load 8(invocation) + 508: 73(ptr) AccessChain 27(data) 39 39 + 509: 20(ivec4) Load 508 + 510: 72(ivec2) VectorShuffle 509 509 0 1 + 511: 72(ivec2) GroupNonUniformQuadSwap 35 510 478 + 512: 73(ptr) AccessChain 27(data) 507 39 + 513: 20(ivec4) Load 512 + 514: 20(ivec4) VectorShuffle 513 511 4 5 2 3 + Store 512 514 + 515: 6(int) Load 8(invocation) + 516: 73(ptr) AccessChain 27(data) 50 39 + 517: 20(ivec4) Load 516 + 518: 82(ivec3) VectorShuffle 517 517 0 1 2 + 519: 82(ivec3) GroupNonUniformQuadSwap 35 518 478 + 520: 73(ptr) AccessChain 27(data) 515 39 + 521: 20(ivec4) Load 520 + 522: 20(ivec4) VectorShuffle 521 519 4 5 6 3 + Store 520 522 + 523: 6(int) Load 8(invocation) + 524: 73(ptr) AccessChain 27(data) 60 39 + 525: 20(ivec4) Load 524 + 526: 20(ivec4) GroupNonUniformQuadSwap 35 525 478 + 527: 73(ptr) AccessChain 27(data) 523 39 + Store 527 526 + 528: 6(int) Load 8(invocation) + 529: 96(ptr) AccessChain 27(data) 29 50 30 + 530: 6(int) Load 529 + 531: 6(int) GroupNonUniformQuadSwap 35 530 478 + 532: 96(ptr) AccessChain 27(data) 528 50 30 + Store 532 531 + 533: 6(int) Load 8(invocation) + 534: 103(ptr) AccessChain 27(data) 39 50 + 535: 21(ivec4) Load 534 + 536: 102(ivec2) VectorShuffle 535 535 0 1 + 537: 102(ivec2) GroupNonUniformQuadSwap 35 536 478 + 538: 103(ptr) AccessChain 27(data) 533 50 + 539: 21(ivec4) Load 538 + 540: 21(ivec4) VectorShuffle 539 537 4 5 2 3 + Store 538 540 + 541: 6(int) Load 8(invocation) + 542: 103(ptr) AccessChain 27(data) 50 50 + 543: 21(ivec4) Load 542 + 544: 112(ivec3) VectorShuffle 543 543 0 1 2 + 545: 112(ivec3) GroupNonUniformQuadSwap 35 544 478 + 546: 103(ptr) AccessChain 27(data) 541 50 + 547: 21(ivec4) Load 546 + 548: 21(ivec4) VectorShuffle 547 545 4 5 6 3 + Store 546 548 + 549: 6(int) Load 8(invocation) + 550: 103(ptr) AccessChain 27(data) 60 50 + 551: 21(ivec4) Load 550 + 552: 21(ivec4) GroupNonUniformQuadSwap 35 551 478 + 553: 103(ptr) AccessChain 27(data) 549 50 + Store 553 552 + 554: 6(int) Load 8(invocation) + 555: 126(ptr) AccessChain 27(data) 29 60 30 + 556: 22(float) Load 555 + 557: 22(float) GroupNonUniformQuadSwap 35 556 478 + 558: 126(ptr) AccessChain 27(data) 554 60 30 + Store 558 557 + 559: 6(int) Load 8(invocation) + 560: 133(ptr) AccessChain 27(data) 39 60 + 561: 23(fvec4) Load 560 + 562: 132(fvec2) VectorShuffle 561 561 0 1 + 563: 132(fvec2) GroupNonUniformQuadSwap 35 562 478 + 564: 133(ptr) AccessChain 27(data) 559 60 + 565: 23(fvec4) Load 564 + 566: 23(fvec4) VectorShuffle 565 563 4 5 2 3 + Store 564 566 + 567: 6(int) Load 8(invocation) + 568: 133(ptr) AccessChain 27(data) 50 60 + 569: 23(fvec4) Load 568 + 570: 142(fvec3) VectorShuffle 569 569 0 1 2 + 571: 142(fvec3) GroupNonUniformQuadSwap 35 570 478 + 572: 133(ptr) AccessChain 27(data) 567 60 + 573: 23(fvec4) Load 572 + 574: 23(fvec4) VectorShuffle 573 571 4 5 6 3 + Store 572 574 + 575: 6(int) Load 8(invocation) + 576: 133(ptr) AccessChain 27(data) 60 60 + 577: 23(fvec4) Load 576 + 578: 23(fvec4) GroupNonUniformQuadSwap 35 577 478 + 579: 133(ptr) AccessChain 27(data) 575 60 + Store 579 578 + 580: 6(int) Load 8(invocation) + 581: 66(ptr) AccessChain 27(data) 29 39 30 + 582: 19(int) Load 581 + 583: 158(bool) SLessThan 582 29 + 584: 158(bool) GroupNonUniformQuadSwap 35 583 478 + 585: 19(int) Select 584 39 29 + 586: 66(ptr) AccessChain 27(data) 580 39 30 + Store 586 585 + 587: 6(int) Load 8(invocation) + 588: 73(ptr) AccessChain 27(data) 39 39 + 589: 20(ivec4) Load 588 + 590: 72(ivec2) VectorShuffle 589 589 0 1 + 591: 168(bvec2) SLessThan 590 167 + 592: 168(bvec2) GroupNonUniformQuadSwap 35 591 478 + 593: 72(ivec2) Select 592 171 167 + 594: 73(ptr) AccessChain 27(data) 587 39 + 595: 20(ivec4) Load 594 + 596: 20(ivec4) VectorShuffle 595 593 4 5 2 3 + Store 594 596 + 597: 6(int) Load 8(invocation) + 598: 73(ptr) AccessChain 27(data) 39 39 + 599: 20(ivec4) Load 598 + 600: 82(ivec3) VectorShuffle 599 599 0 1 2 + 601: 181(bvec3) SLessThan 600 180 + 602: 181(bvec3) GroupNonUniformQuadSwap 35 601 478 + 603: 82(ivec3) Select 602 184 180 + 604: 73(ptr) AccessChain 27(data) 597 39 + 605: 20(ivec4) Load 604 + 606: 20(ivec4) VectorShuffle 605 603 4 5 6 3 + Store 604 606 + 607: 6(int) Load 8(invocation) + 608: 73(ptr) AccessChain 27(data) 39 39 + 609: 20(ivec4) Load 608 + 610: 193(bvec4) SLessThan 609 192 + 611: 193(bvec4) GroupNonUniformQuadSwap 35 610 478 + 612: 20(ivec4) Select 611 196 192 + 613: 73(ptr) AccessChain 27(data) 607 39 + Store 613 612 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupShuffle.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupShuffle.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupShuffle.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupShuffle.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,462 @@ +spv.subgroupShuffle.comp +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 379 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformShuffle + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 10 12 + ExecutionMode 4 LocalSize 8 8 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + SourceExtension "GL_KHR_shader_subgroup_shuffle" + Name 4 "main" + Name 8 "invocation" + Name 10 "gl_SubgroupInvocationID" + Name 12 "gl_SubgroupSize" + Name 24 "Buffers" + MemberName 24(Buffers) 0 "f4" + MemberName 24(Buffers) 1 "i4" + MemberName 24(Buffers) 2 "u4" + MemberName 24(Buffers) 3 "d4" + Name 27 "data" + Decorate 10(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 10(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 11 RelaxedPrecision + Decorate 12(gl_SubgroupSize) RelaxedPrecision + Decorate 12(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 13 RelaxedPrecision + Decorate 14 RelaxedPrecision + Decorate 16 RelaxedPrecision + MemberDecorate 24(Buffers) 0 Offset 0 + MemberDecorate 24(Buffers) 1 Offset 16 + MemberDecorate 24(Buffers) 2 Offset 32 + MemberDecorate 24(Buffers) 3 Offset 64 + Decorate 24(Buffers) BufferBlock + Decorate 27(data) DescriptorSet 0 + Decorate 27(data) Binding 0 + Decorate 378 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_SubgroupInvocationID): 9(ptr) Variable Input +12(gl_SubgroupSize): 9(ptr) Variable Input + 15: 6(int) Constant 4 + 17: TypeFloat 32 + 18: TypeVector 17(float) 4 + 19: TypeInt 32 1 + 20: TypeVector 19(int) 4 + 21: TypeVector 6(int) 4 + 22: TypeFloat 64 + 23: TypeVector 22(float) 4 + 24(Buffers): TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(fvec4) + 25: TypeArray 24(Buffers) 15 + 26: TypePointer Uniform 25 + 27(data): 26(ptr) Variable Uniform + 29: 19(int) Constant 0 + 30: 6(int) Constant 0 + 31: TypePointer Uniform 17(float) + 35: 6(int) Constant 3 + 39: 19(int) Constant 1 + 40: TypeVector 17(float) 2 + 41: TypePointer Uniform 18(fvec4) + 51: 19(int) Constant 2 + 52: TypeVector 17(float) 3 + 62: 19(int) Constant 3 + 69: TypePointer Uniform 19(int) + 76: TypeVector 19(int) 2 + 77: TypePointer Uniform 20(ivec4) + 87: TypeVector 19(int) 3 + 103: TypePointer Uniform 6(int) + 110: TypeVector 6(int) 2 + 111: TypePointer Uniform 21(ivec4) + 121: TypeVector 6(int) 3 + 137: TypePointer Uniform 22(float) + 144: TypeVector 22(float) 2 + 145: TypePointer Uniform 23(fvec4) + 155: TypeVector 22(float) 3 + 173: TypeBool + 183: 76(ivec2) ConstantComposite 29 29 + 184: TypeVector 173(bool) 2 + 188: 76(ivec2) ConstantComposite 39 39 + 197: 87(ivec3) ConstantComposite 29 29 29 + 198: TypeVector 173(bool) 3 + 202: 87(ivec3) ConstantComposite 39 39 39 + 210: 20(ivec4) ConstantComposite 29 29 29 29 + 211: TypeVector 173(bool) 4 + 215: 20(ivec4) ConstantComposite 39 39 39 39 + 376: 6(int) Constant 8 + 377: 6(int) Constant 1 + 378: 121(ivec3) ConstantComposite 376 376 377 + 4(main): 2 Function None 3 + 5: Label + 8(invocation): 7(ptr) Variable Function + 11: 6(int) Load 10(gl_SubgroupInvocationID) + 13: 6(int) Load 12(gl_SubgroupSize) + 14: 6(int) IAdd 11 13 + 16: 6(int) UMod 14 15 + Store 8(invocation) 16 + 28: 6(int) Load 8(invocation) + 32: 31(ptr) AccessChain 27(data) 29 29 30 + 33: 17(float) Load 32 + 34: 6(int) Load 8(invocation) + 36: 17(float) GroupNonUniformShuffle 35 33 34 + 37: 31(ptr) AccessChain 27(data) 28 29 30 + Store 37 36 + 38: 6(int) Load 8(invocation) + 42: 41(ptr) AccessChain 27(data) 39 29 + 43: 18(fvec4) Load 42 + 44: 40(fvec2) VectorShuffle 43 43 0 1 + 45: 6(int) Load 8(invocation) + 46: 40(fvec2) GroupNonUniformShuffle 35 44 45 + 47: 41(ptr) AccessChain 27(data) 38 29 + 48: 18(fvec4) Load 47 + 49: 18(fvec4) VectorShuffle 48 46 4 5 2 3 + Store 47 49 + 50: 6(int) Load 8(invocation) + 53: 41(ptr) AccessChain 27(data) 51 29 + 54: 18(fvec4) Load 53 + 55: 52(fvec3) VectorShuffle 54 54 0 1 2 + 56: 6(int) Load 8(invocation) + 57: 52(fvec3) GroupNonUniformShuffle 35 55 56 + 58: 41(ptr) AccessChain 27(data) 50 29 + 59: 18(fvec4) Load 58 + 60: 18(fvec4) VectorShuffle 59 57 4 5 6 3 + Store 58 60 + 61: 6(int) Load 8(invocation) + 63: 41(ptr) AccessChain 27(data) 62 29 + 64: 18(fvec4) Load 63 + 65: 6(int) Load 8(invocation) + 66: 18(fvec4) GroupNonUniformShuffle 35 64 65 + 67: 41(ptr) AccessChain 27(data) 61 29 + Store 67 66 + 68: 6(int) Load 8(invocation) + 70: 69(ptr) AccessChain 27(data) 29 39 30 + 71: 19(int) Load 70 + 72: 6(int) Load 8(invocation) + 73: 19(int) GroupNonUniformShuffle 35 71 72 + 74: 69(ptr) AccessChain 27(data) 68 39 30 + Store 74 73 + 75: 6(int) Load 8(invocation) + 78: 77(ptr) AccessChain 27(data) 39 39 + 79: 20(ivec4) Load 78 + 80: 76(ivec2) VectorShuffle 79 79 0 1 + 81: 6(int) Load 8(invocation) + 82: 76(ivec2) GroupNonUniformShuffle 35 80 81 + 83: 77(ptr) AccessChain 27(data) 75 39 + 84: 20(ivec4) Load 83 + 85: 20(ivec4) VectorShuffle 84 82 4 5 2 3 + Store 83 85 + 86: 6(int) Load 8(invocation) + 88: 77(ptr) AccessChain 27(data) 51 39 + 89: 20(ivec4) Load 88 + 90: 87(ivec3) VectorShuffle 89 89 0 1 2 + 91: 6(int) Load 8(invocation) + 92: 87(ivec3) GroupNonUniformShuffle 35 90 91 + 93: 77(ptr) AccessChain 27(data) 86 39 + 94: 20(ivec4) Load 93 + 95: 20(ivec4) VectorShuffle 94 92 4 5 6 3 + Store 93 95 + 96: 6(int) Load 8(invocation) + 97: 77(ptr) AccessChain 27(data) 62 39 + 98: 20(ivec4) Load 97 + 99: 6(int) Load 8(invocation) + 100: 20(ivec4) GroupNonUniformShuffle 35 98 99 + 101: 77(ptr) AccessChain 27(data) 96 39 + Store 101 100 + 102: 6(int) Load 8(invocation) + 104: 103(ptr) AccessChain 27(data) 29 51 30 + 105: 6(int) Load 104 + 106: 6(int) Load 8(invocation) + 107: 6(int) GroupNonUniformShuffle 35 105 106 + 108: 103(ptr) AccessChain 27(data) 102 51 30 + Store 108 107 + 109: 6(int) Load 8(invocation) + 112: 111(ptr) AccessChain 27(data) 39 51 + 113: 21(ivec4) Load 112 + 114: 110(ivec2) VectorShuffle 113 113 0 1 + 115: 6(int) Load 8(invocation) + 116: 110(ivec2) GroupNonUniformShuffle 35 114 115 + 117: 111(ptr) AccessChain 27(data) 109 51 + 118: 21(ivec4) Load 117 + 119: 21(ivec4) VectorShuffle 118 116 4 5 2 3 + Store 117 119 + 120: 6(int) Load 8(invocation) + 122: 111(ptr) AccessChain 27(data) 51 51 + 123: 21(ivec4) Load 122 + 124: 121(ivec3) VectorShuffle 123 123 0 1 2 + 125: 6(int) Load 8(invocation) + 126: 121(ivec3) GroupNonUniformShuffle 35 124 125 + 127: 111(ptr) AccessChain 27(data) 120 51 + 128: 21(ivec4) Load 127 + 129: 21(ivec4) VectorShuffle 128 126 4 5 6 3 + Store 127 129 + 130: 6(int) Load 8(invocation) + 131: 111(ptr) AccessChain 27(data) 62 51 + 132: 21(ivec4) Load 131 + 133: 6(int) Load 8(invocation) + 134: 21(ivec4) GroupNonUniformShuffle 35 132 133 + 135: 111(ptr) AccessChain 27(data) 130 51 + Store 135 134 + 136: 6(int) Load 8(invocation) + 138: 137(ptr) AccessChain 27(data) 29 62 30 + 139: 22(float) Load 138 + 140: 6(int) Load 8(invocation) + 141: 22(float) GroupNonUniformShuffle 35 139 140 + 142: 137(ptr) AccessChain 27(data) 136 62 30 + Store 142 141 + 143: 6(int) Load 8(invocation) + 146: 145(ptr) AccessChain 27(data) 39 62 + 147: 23(fvec4) Load 146 + 148: 144(fvec2) VectorShuffle 147 147 0 1 + 149: 6(int) Load 8(invocation) + 150: 144(fvec2) GroupNonUniformShuffle 35 148 149 + 151: 145(ptr) AccessChain 27(data) 143 62 + 152: 23(fvec4) Load 151 + 153: 23(fvec4) VectorShuffle 152 150 4 5 2 3 + Store 151 153 + 154: 6(int) Load 8(invocation) + 156: 145(ptr) AccessChain 27(data) 51 62 + 157: 23(fvec4) Load 156 + 158: 155(fvec3) VectorShuffle 157 157 0 1 2 + 159: 6(int) Load 8(invocation) + 160: 155(fvec3) GroupNonUniformShuffle 35 158 159 + 161: 145(ptr) AccessChain 27(data) 154 62 + 162: 23(fvec4) Load 161 + 163: 23(fvec4) VectorShuffle 162 160 4 5 6 3 + Store 161 163 + 164: 6(int) Load 8(invocation) + 165: 145(ptr) AccessChain 27(data) 62 62 + 166: 23(fvec4) Load 165 + 167: 6(int) Load 8(invocation) + 168: 23(fvec4) GroupNonUniformShuffle 35 166 167 + 169: 145(ptr) AccessChain 27(data) 164 62 + Store 169 168 + 170: 6(int) Load 8(invocation) + 171: 69(ptr) AccessChain 27(data) 29 39 30 + 172: 19(int) Load 171 + 174: 173(bool) SLessThan 172 29 + 175: 6(int) Load 8(invocation) + 176: 173(bool) GroupNonUniformShuffle 35 174 175 + 177: 19(int) Select 176 39 29 + 178: 69(ptr) AccessChain 27(data) 170 39 30 + Store 178 177 + 179: 6(int) Load 8(invocation) + 180: 77(ptr) AccessChain 27(data) 39 39 + 181: 20(ivec4) Load 180 + 182: 76(ivec2) VectorShuffle 181 181 0 1 + 185: 184(bvec2) SLessThan 182 183 + 186: 6(int) Load 8(invocation) + 187: 184(bvec2) GroupNonUniformShuffle 35 185 186 + 189: 76(ivec2) Select 187 188 183 + 190: 77(ptr) AccessChain 27(data) 179 39 + 191: 20(ivec4) Load 190 + 192: 20(ivec4) VectorShuffle 191 189 4 5 2 3 + Store 190 192 + 193: 6(int) Load 8(invocation) + 194: 77(ptr) AccessChain 27(data) 39 39 + 195: 20(ivec4) Load 194 + 196: 87(ivec3) VectorShuffle 195 195 0 1 2 + 199: 198(bvec3) SLessThan 196 197 + 200: 6(int) Load 8(invocation) + 201: 198(bvec3) GroupNonUniformShuffle 35 199 200 + 203: 87(ivec3) Select 201 202 197 + 204: 77(ptr) AccessChain 27(data) 193 39 + 205: 20(ivec4) Load 204 + 206: 20(ivec4) VectorShuffle 205 203 4 5 6 3 + Store 204 206 + 207: 6(int) Load 8(invocation) + 208: 77(ptr) AccessChain 27(data) 39 39 + 209: 20(ivec4) Load 208 + 212: 211(bvec4) SLessThan 209 210 + 213: 6(int) Load 8(invocation) + 214: 211(bvec4) GroupNonUniformShuffle 35 212 213 + 216: 20(ivec4) Select 214 215 210 + 217: 77(ptr) AccessChain 27(data) 207 39 + Store 217 216 + 218: 6(int) Load 8(invocation) + 219: 31(ptr) AccessChain 27(data) 29 29 30 + 220: 17(float) Load 219 + 221: 6(int) Load 8(invocation) + 222: 17(float) GroupNonUniformShuffleXor 35 220 221 + 223: 31(ptr) AccessChain 27(data) 218 29 30 + Store 223 222 + 224: 6(int) Load 8(invocation) + 225: 41(ptr) AccessChain 27(data) 39 29 + 226: 18(fvec4) Load 225 + 227: 40(fvec2) VectorShuffle 226 226 0 1 + 228: 6(int) Load 8(invocation) + 229: 40(fvec2) GroupNonUniformShuffleXor 35 227 228 + 230: 41(ptr) AccessChain 27(data) 224 29 + 231: 18(fvec4) Load 230 + 232: 18(fvec4) VectorShuffle 231 229 4 5 2 3 + Store 230 232 + 233: 6(int) Load 8(invocation) + 234: 41(ptr) AccessChain 27(data) 51 29 + 235: 18(fvec4) Load 234 + 236: 52(fvec3) VectorShuffle 235 235 0 1 2 + 237: 6(int) Load 8(invocation) + 238: 52(fvec3) GroupNonUniformShuffleXor 35 236 237 + 239: 41(ptr) AccessChain 27(data) 233 29 + 240: 18(fvec4) Load 239 + 241: 18(fvec4) VectorShuffle 240 238 4 5 6 3 + Store 239 241 + 242: 6(int) Load 8(invocation) + 243: 41(ptr) AccessChain 27(data) 62 29 + 244: 18(fvec4) Load 243 + 245: 6(int) Load 8(invocation) + 246: 18(fvec4) GroupNonUniformShuffleXor 35 244 245 + 247: 41(ptr) AccessChain 27(data) 242 29 + Store 247 246 + 248: 6(int) Load 8(invocation) + 249: 69(ptr) AccessChain 27(data) 29 39 30 + 250: 19(int) Load 249 + 251: 6(int) Load 8(invocation) + 252: 19(int) GroupNonUniformShuffleXor 35 250 251 + 253: 69(ptr) AccessChain 27(data) 248 39 30 + Store 253 252 + 254: 6(int) Load 8(invocation) + 255: 77(ptr) AccessChain 27(data) 39 39 + 256: 20(ivec4) Load 255 + 257: 76(ivec2) VectorShuffle 256 256 0 1 + 258: 6(int) Load 8(invocation) + 259: 76(ivec2) GroupNonUniformShuffleXor 35 257 258 + 260: 77(ptr) AccessChain 27(data) 254 39 + 261: 20(ivec4) Load 260 + 262: 20(ivec4) VectorShuffle 261 259 4 5 2 3 + Store 260 262 + 263: 6(int) Load 8(invocation) + 264: 77(ptr) AccessChain 27(data) 51 39 + 265: 20(ivec4) Load 264 + 266: 87(ivec3) VectorShuffle 265 265 0 1 2 + 267: 6(int) Load 8(invocation) + 268: 87(ivec3) GroupNonUniformShuffleXor 35 266 267 + 269: 77(ptr) AccessChain 27(data) 263 39 + 270: 20(ivec4) Load 269 + 271: 20(ivec4) VectorShuffle 270 268 4 5 6 3 + Store 269 271 + 272: 6(int) Load 8(invocation) + 273: 77(ptr) AccessChain 27(data) 62 39 + 274: 20(ivec4) Load 273 + 275: 6(int) Load 8(invocation) + 276: 20(ivec4) GroupNonUniformShuffleXor 35 274 275 + 277: 77(ptr) AccessChain 27(data) 272 39 + Store 277 276 + 278: 6(int) Load 8(invocation) + 279: 103(ptr) AccessChain 27(data) 29 51 30 + 280: 6(int) Load 279 + 281: 6(int) Load 8(invocation) + 282: 6(int) GroupNonUniformShuffleXor 35 280 281 + 283: 103(ptr) AccessChain 27(data) 278 51 30 + Store 283 282 + 284: 6(int) Load 8(invocation) + 285: 111(ptr) AccessChain 27(data) 39 51 + 286: 21(ivec4) Load 285 + 287: 110(ivec2) VectorShuffle 286 286 0 1 + 288: 6(int) Load 8(invocation) + 289: 110(ivec2) GroupNonUniformShuffleXor 35 287 288 + 290: 111(ptr) AccessChain 27(data) 284 51 + 291: 21(ivec4) Load 290 + 292: 21(ivec4) VectorShuffle 291 289 4 5 2 3 + Store 290 292 + 293: 6(int) Load 8(invocation) + 294: 111(ptr) AccessChain 27(data) 51 51 + 295: 21(ivec4) Load 294 + 296: 121(ivec3) VectorShuffle 295 295 0 1 2 + 297: 6(int) Load 8(invocation) + 298: 121(ivec3) GroupNonUniformShuffleXor 35 296 297 + 299: 111(ptr) AccessChain 27(data) 293 51 + 300: 21(ivec4) Load 299 + 301: 21(ivec4) VectorShuffle 300 298 4 5 6 3 + Store 299 301 + 302: 6(int) Load 8(invocation) + 303: 111(ptr) AccessChain 27(data) 62 51 + 304: 21(ivec4) Load 303 + 305: 6(int) Load 8(invocation) + 306: 21(ivec4) GroupNonUniformShuffleXor 35 304 305 + 307: 111(ptr) AccessChain 27(data) 302 51 + Store 307 306 + 308: 6(int) Load 8(invocation) + 309: 137(ptr) AccessChain 27(data) 29 62 30 + 310: 22(float) Load 309 + 311: 6(int) Load 8(invocation) + 312: 22(float) GroupNonUniformShuffleXor 35 310 311 + 313: 137(ptr) AccessChain 27(data) 308 62 30 + Store 313 312 + 314: 6(int) Load 8(invocation) + 315: 145(ptr) AccessChain 27(data) 39 62 + 316: 23(fvec4) Load 315 + 317: 144(fvec2) VectorShuffle 316 316 0 1 + 318: 6(int) Load 8(invocation) + 319: 144(fvec2) GroupNonUniformShuffleXor 35 317 318 + 320: 145(ptr) AccessChain 27(data) 314 62 + 321: 23(fvec4) Load 320 + 322: 23(fvec4) VectorShuffle 321 319 4 5 2 3 + Store 320 322 + 323: 6(int) Load 8(invocation) + 324: 145(ptr) AccessChain 27(data) 51 62 + 325: 23(fvec4) Load 324 + 326: 155(fvec3) VectorShuffle 325 325 0 1 2 + 327: 6(int) Load 8(invocation) + 328: 155(fvec3) GroupNonUniformShuffleXor 35 326 327 + 329: 145(ptr) AccessChain 27(data) 323 62 + 330: 23(fvec4) Load 329 + 331: 23(fvec4) VectorShuffle 330 328 4 5 6 3 + Store 329 331 + 332: 6(int) Load 8(invocation) + 333: 145(ptr) AccessChain 27(data) 62 62 + 334: 23(fvec4) Load 333 + 335: 6(int) Load 8(invocation) + 336: 23(fvec4) GroupNonUniformShuffleXor 35 334 335 + 337: 145(ptr) AccessChain 27(data) 332 62 + Store 337 336 + 338: 6(int) Load 8(invocation) + 339: 69(ptr) AccessChain 27(data) 29 39 30 + 340: 19(int) Load 339 + 341: 173(bool) SLessThan 340 29 + 342: 6(int) Load 8(invocation) + 343: 173(bool) GroupNonUniformShuffleXor 35 341 342 + 344: 19(int) Select 343 39 29 + 345: 69(ptr) AccessChain 27(data) 338 39 30 + Store 345 344 + 346: 6(int) Load 8(invocation) + 347: 77(ptr) AccessChain 27(data) 39 39 + 348: 20(ivec4) Load 347 + 349: 76(ivec2) VectorShuffle 348 348 0 1 + 350: 184(bvec2) SLessThan 349 183 + 351: 6(int) Load 8(invocation) + 352: 184(bvec2) GroupNonUniformShuffleXor 35 350 351 + 353: 76(ivec2) Select 352 188 183 + 354: 77(ptr) AccessChain 27(data) 346 39 + 355: 20(ivec4) Load 354 + 356: 20(ivec4) VectorShuffle 355 353 4 5 2 3 + Store 354 356 + 357: 6(int) Load 8(invocation) + 358: 77(ptr) AccessChain 27(data) 39 39 + 359: 20(ivec4) Load 358 + 360: 87(ivec3) VectorShuffle 359 359 0 1 2 + 361: 198(bvec3) SLessThan 360 197 + 362: 6(int) Load 8(invocation) + 363: 198(bvec3) GroupNonUniformShuffleXor 35 361 362 + 364: 87(ivec3) Select 363 202 197 + 365: 77(ptr) AccessChain 27(data) 357 39 + 366: 20(ivec4) Load 365 + 367: 20(ivec4) VectorShuffle 366 364 4 5 6 3 + Store 365 367 + 368: 6(int) Load 8(invocation) + 369: 77(ptr) AccessChain 27(data) 39 39 + 370: 20(ivec4) Load 369 + 371: 211(bvec4) SLessThan 370 210 + 372: 6(int) Load 8(invocation) + 373: 211(bvec4) GroupNonUniformShuffleXor 35 371 372 + 374: 20(ivec4) Select 373 215 210 + 375: 77(ptr) AccessChain 27(data) 368 39 + Store 375 374 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupShuffleRelative.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupShuffleRelative.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupShuffleRelative.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupShuffleRelative.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,462 @@ +spv.subgroupShuffleRelative.comp +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 379 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformShuffleRelative + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 10 12 + ExecutionMode 4 LocalSize 8 8 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + SourceExtension "GL_KHR_shader_subgroup_shuffle_relative" + Name 4 "main" + Name 8 "invocation" + Name 10 "gl_SubgroupInvocationID" + Name 12 "gl_SubgroupSize" + Name 24 "Buffers" + MemberName 24(Buffers) 0 "f4" + MemberName 24(Buffers) 1 "i4" + MemberName 24(Buffers) 2 "u4" + MemberName 24(Buffers) 3 "d4" + Name 27 "data" + Decorate 10(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 10(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 11 RelaxedPrecision + Decorate 12(gl_SubgroupSize) RelaxedPrecision + Decorate 12(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 13 RelaxedPrecision + Decorate 14 RelaxedPrecision + Decorate 16 RelaxedPrecision + MemberDecorate 24(Buffers) 0 Offset 0 + MemberDecorate 24(Buffers) 1 Offset 16 + MemberDecorate 24(Buffers) 2 Offset 32 + MemberDecorate 24(Buffers) 3 Offset 64 + Decorate 24(Buffers) BufferBlock + Decorate 27(data) DescriptorSet 0 + Decorate 27(data) Binding 0 + Decorate 378 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_SubgroupInvocationID): 9(ptr) Variable Input +12(gl_SubgroupSize): 9(ptr) Variable Input + 15: 6(int) Constant 4 + 17: TypeFloat 32 + 18: TypeVector 17(float) 4 + 19: TypeInt 32 1 + 20: TypeVector 19(int) 4 + 21: TypeVector 6(int) 4 + 22: TypeFloat 64 + 23: TypeVector 22(float) 4 + 24(Buffers): TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(fvec4) + 25: TypeArray 24(Buffers) 15 + 26: TypePointer Uniform 25 + 27(data): 26(ptr) Variable Uniform + 29: 19(int) Constant 0 + 30: 6(int) Constant 0 + 31: TypePointer Uniform 17(float) + 35: 6(int) Constant 3 + 39: 19(int) Constant 1 + 40: TypeVector 17(float) 2 + 41: TypePointer Uniform 18(fvec4) + 51: 19(int) Constant 2 + 52: TypeVector 17(float) 3 + 62: 19(int) Constant 3 + 69: TypePointer Uniform 19(int) + 76: TypeVector 19(int) 2 + 77: TypePointer Uniform 20(ivec4) + 87: TypeVector 19(int) 3 + 103: TypePointer Uniform 6(int) + 110: TypeVector 6(int) 2 + 111: TypePointer Uniform 21(ivec4) + 121: TypeVector 6(int) 3 + 137: TypePointer Uniform 22(float) + 144: TypeVector 22(float) 2 + 145: TypePointer Uniform 23(fvec4) + 155: TypeVector 22(float) 3 + 173: TypeBool + 183: 76(ivec2) ConstantComposite 29 29 + 184: TypeVector 173(bool) 2 + 188: 76(ivec2) ConstantComposite 39 39 + 197: 87(ivec3) ConstantComposite 29 29 29 + 198: TypeVector 173(bool) 3 + 202: 87(ivec3) ConstantComposite 39 39 39 + 210: 20(ivec4) ConstantComposite 29 29 29 29 + 211: TypeVector 173(bool) 4 + 215: 20(ivec4) ConstantComposite 39 39 39 39 + 376: 6(int) Constant 8 + 377: 6(int) Constant 1 + 378: 121(ivec3) ConstantComposite 376 376 377 + 4(main): 2 Function None 3 + 5: Label + 8(invocation): 7(ptr) Variable Function + 11: 6(int) Load 10(gl_SubgroupInvocationID) + 13: 6(int) Load 12(gl_SubgroupSize) + 14: 6(int) IAdd 11 13 + 16: 6(int) UMod 14 15 + Store 8(invocation) 16 + 28: 6(int) Load 8(invocation) + 32: 31(ptr) AccessChain 27(data) 29 29 30 + 33: 17(float) Load 32 + 34: 6(int) Load 8(invocation) + 36: 17(float) GroupNonUniformShuffleUp 35 33 34 + 37: 31(ptr) AccessChain 27(data) 28 29 30 + Store 37 36 + 38: 6(int) Load 8(invocation) + 42: 41(ptr) AccessChain 27(data) 39 29 + 43: 18(fvec4) Load 42 + 44: 40(fvec2) VectorShuffle 43 43 0 1 + 45: 6(int) Load 8(invocation) + 46: 40(fvec2) GroupNonUniformShuffleUp 35 44 45 + 47: 41(ptr) AccessChain 27(data) 38 29 + 48: 18(fvec4) Load 47 + 49: 18(fvec4) VectorShuffle 48 46 4 5 2 3 + Store 47 49 + 50: 6(int) Load 8(invocation) + 53: 41(ptr) AccessChain 27(data) 51 29 + 54: 18(fvec4) Load 53 + 55: 52(fvec3) VectorShuffle 54 54 0 1 2 + 56: 6(int) Load 8(invocation) + 57: 52(fvec3) GroupNonUniformShuffleUp 35 55 56 + 58: 41(ptr) AccessChain 27(data) 50 29 + 59: 18(fvec4) Load 58 + 60: 18(fvec4) VectorShuffle 59 57 4 5 6 3 + Store 58 60 + 61: 6(int) Load 8(invocation) + 63: 41(ptr) AccessChain 27(data) 62 29 + 64: 18(fvec4) Load 63 + 65: 6(int) Load 8(invocation) + 66: 18(fvec4) GroupNonUniformShuffleUp 35 64 65 + 67: 41(ptr) AccessChain 27(data) 61 29 + Store 67 66 + 68: 6(int) Load 8(invocation) + 70: 69(ptr) AccessChain 27(data) 29 39 30 + 71: 19(int) Load 70 + 72: 6(int) Load 8(invocation) + 73: 19(int) GroupNonUniformShuffleUp 35 71 72 + 74: 69(ptr) AccessChain 27(data) 68 39 30 + Store 74 73 + 75: 6(int) Load 8(invocation) + 78: 77(ptr) AccessChain 27(data) 39 39 + 79: 20(ivec4) Load 78 + 80: 76(ivec2) VectorShuffle 79 79 0 1 + 81: 6(int) Load 8(invocation) + 82: 76(ivec2) GroupNonUniformShuffleUp 35 80 81 + 83: 77(ptr) AccessChain 27(data) 75 39 + 84: 20(ivec4) Load 83 + 85: 20(ivec4) VectorShuffle 84 82 4 5 2 3 + Store 83 85 + 86: 6(int) Load 8(invocation) + 88: 77(ptr) AccessChain 27(data) 51 39 + 89: 20(ivec4) Load 88 + 90: 87(ivec3) VectorShuffle 89 89 0 1 2 + 91: 6(int) Load 8(invocation) + 92: 87(ivec3) GroupNonUniformShuffleUp 35 90 91 + 93: 77(ptr) AccessChain 27(data) 86 39 + 94: 20(ivec4) Load 93 + 95: 20(ivec4) VectorShuffle 94 92 4 5 6 3 + Store 93 95 + 96: 6(int) Load 8(invocation) + 97: 77(ptr) AccessChain 27(data) 62 39 + 98: 20(ivec4) Load 97 + 99: 6(int) Load 8(invocation) + 100: 20(ivec4) GroupNonUniformShuffleUp 35 98 99 + 101: 77(ptr) AccessChain 27(data) 96 39 + Store 101 100 + 102: 6(int) Load 8(invocation) + 104: 103(ptr) AccessChain 27(data) 29 51 30 + 105: 6(int) Load 104 + 106: 6(int) Load 8(invocation) + 107: 6(int) GroupNonUniformShuffleUp 35 105 106 + 108: 103(ptr) AccessChain 27(data) 102 51 30 + Store 108 107 + 109: 6(int) Load 8(invocation) + 112: 111(ptr) AccessChain 27(data) 39 51 + 113: 21(ivec4) Load 112 + 114: 110(ivec2) VectorShuffle 113 113 0 1 + 115: 6(int) Load 8(invocation) + 116: 110(ivec2) GroupNonUniformShuffleUp 35 114 115 + 117: 111(ptr) AccessChain 27(data) 109 51 + 118: 21(ivec4) Load 117 + 119: 21(ivec4) VectorShuffle 118 116 4 5 2 3 + Store 117 119 + 120: 6(int) Load 8(invocation) + 122: 111(ptr) AccessChain 27(data) 51 51 + 123: 21(ivec4) Load 122 + 124: 121(ivec3) VectorShuffle 123 123 0 1 2 + 125: 6(int) Load 8(invocation) + 126: 121(ivec3) GroupNonUniformShuffleUp 35 124 125 + 127: 111(ptr) AccessChain 27(data) 120 51 + 128: 21(ivec4) Load 127 + 129: 21(ivec4) VectorShuffle 128 126 4 5 6 3 + Store 127 129 + 130: 6(int) Load 8(invocation) + 131: 111(ptr) AccessChain 27(data) 62 51 + 132: 21(ivec4) Load 131 + 133: 6(int) Load 8(invocation) + 134: 21(ivec4) GroupNonUniformShuffleUp 35 132 133 + 135: 111(ptr) AccessChain 27(data) 130 51 + Store 135 134 + 136: 6(int) Load 8(invocation) + 138: 137(ptr) AccessChain 27(data) 29 62 30 + 139: 22(float) Load 138 + 140: 6(int) Load 8(invocation) + 141: 22(float) GroupNonUniformShuffleUp 35 139 140 + 142: 137(ptr) AccessChain 27(data) 136 62 30 + Store 142 141 + 143: 6(int) Load 8(invocation) + 146: 145(ptr) AccessChain 27(data) 39 62 + 147: 23(fvec4) Load 146 + 148: 144(fvec2) VectorShuffle 147 147 0 1 + 149: 6(int) Load 8(invocation) + 150: 144(fvec2) GroupNonUniformShuffleUp 35 148 149 + 151: 145(ptr) AccessChain 27(data) 143 62 + 152: 23(fvec4) Load 151 + 153: 23(fvec4) VectorShuffle 152 150 4 5 2 3 + Store 151 153 + 154: 6(int) Load 8(invocation) + 156: 145(ptr) AccessChain 27(data) 51 62 + 157: 23(fvec4) Load 156 + 158: 155(fvec3) VectorShuffle 157 157 0 1 2 + 159: 6(int) Load 8(invocation) + 160: 155(fvec3) GroupNonUniformShuffleUp 35 158 159 + 161: 145(ptr) AccessChain 27(data) 154 62 + 162: 23(fvec4) Load 161 + 163: 23(fvec4) VectorShuffle 162 160 4 5 6 3 + Store 161 163 + 164: 6(int) Load 8(invocation) + 165: 145(ptr) AccessChain 27(data) 62 62 + 166: 23(fvec4) Load 165 + 167: 6(int) Load 8(invocation) + 168: 23(fvec4) GroupNonUniformShuffleUp 35 166 167 + 169: 145(ptr) AccessChain 27(data) 164 62 + Store 169 168 + 170: 6(int) Load 8(invocation) + 171: 69(ptr) AccessChain 27(data) 29 39 30 + 172: 19(int) Load 171 + 174: 173(bool) SLessThan 172 29 + 175: 6(int) Load 8(invocation) + 176: 173(bool) GroupNonUniformShuffleUp 35 174 175 + 177: 19(int) Select 176 39 29 + 178: 69(ptr) AccessChain 27(data) 170 39 30 + Store 178 177 + 179: 6(int) Load 8(invocation) + 180: 77(ptr) AccessChain 27(data) 39 39 + 181: 20(ivec4) Load 180 + 182: 76(ivec2) VectorShuffle 181 181 0 1 + 185: 184(bvec2) SLessThan 182 183 + 186: 6(int) Load 8(invocation) + 187: 184(bvec2) GroupNonUniformShuffleUp 35 185 186 + 189: 76(ivec2) Select 187 188 183 + 190: 77(ptr) AccessChain 27(data) 179 39 + 191: 20(ivec4) Load 190 + 192: 20(ivec4) VectorShuffle 191 189 4 5 2 3 + Store 190 192 + 193: 6(int) Load 8(invocation) + 194: 77(ptr) AccessChain 27(data) 39 39 + 195: 20(ivec4) Load 194 + 196: 87(ivec3) VectorShuffle 195 195 0 1 2 + 199: 198(bvec3) SLessThan 196 197 + 200: 6(int) Load 8(invocation) + 201: 198(bvec3) GroupNonUniformShuffleUp 35 199 200 + 203: 87(ivec3) Select 201 202 197 + 204: 77(ptr) AccessChain 27(data) 193 39 + 205: 20(ivec4) Load 204 + 206: 20(ivec4) VectorShuffle 205 203 4 5 6 3 + Store 204 206 + 207: 6(int) Load 8(invocation) + 208: 77(ptr) AccessChain 27(data) 39 39 + 209: 20(ivec4) Load 208 + 212: 211(bvec4) SLessThan 209 210 + 213: 6(int) Load 8(invocation) + 214: 211(bvec4) GroupNonUniformShuffleUp 35 212 213 + 216: 20(ivec4) Select 214 215 210 + 217: 77(ptr) AccessChain 27(data) 207 39 + Store 217 216 + 218: 6(int) Load 8(invocation) + 219: 31(ptr) AccessChain 27(data) 29 29 30 + 220: 17(float) Load 219 + 221: 6(int) Load 8(invocation) + 222: 17(float) GroupNonUniformShuffleDown 35 220 221 + 223: 31(ptr) AccessChain 27(data) 218 29 30 + Store 223 222 + 224: 6(int) Load 8(invocation) + 225: 41(ptr) AccessChain 27(data) 39 29 + 226: 18(fvec4) Load 225 + 227: 40(fvec2) VectorShuffle 226 226 0 1 + 228: 6(int) Load 8(invocation) + 229: 40(fvec2) GroupNonUniformShuffleDown 35 227 228 + 230: 41(ptr) AccessChain 27(data) 224 29 + 231: 18(fvec4) Load 230 + 232: 18(fvec4) VectorShuffle 231 229 4 5 2 3 + Store 230 232 + 233: 6(int) Load 8(invocation) + 234: 41(ptr) AccessChain 27(data) 51 29 + 235: 18(fvec4) Load 234 + 236: 52(fvec3) VectorShuffle 235 235 0 1 2 + 237: 6(int) Load 8(invocation) + 238: 52(fvec3) GroupNonUniformShuffleDown 35 236 237 + 239: 41(ptr) AccessChain 27(data) 233 29 + 240: 18(fvec4) Load 239 + 241: 18(fvec4) VectorShuffle 240 238 4 5 6 3 + Store 239 241 + 242: 6(int) Load 8(invocation) + 243: 41(ptr) AccessChain 27(data) 62 29 + 244: 18(fvec4) Load 243 + 245: 6(int) Load 8(invocation) + 246: 18(fvec4) GroupNonUniformShuffleDown 35 244 245 + 247: 41(ptr) AccessChain 27(data) 242 29 + Store 247 246 + 248: 6(int) Load 8(invocation) + 249: 69(ptr) AccessChain 27(data) 29 39 30 + 250: 19(int) Load 249 + 251: 6(int) Load 8(invocation) + 252: 19(int) GroupNonUniformShuffleDown 35 250 251 + 253: 69(ptr) AccessChain 27(data) 248 39 30 + Store 253 252 + 254: 6(int) Load 8(invocation) + 255: 77(ptr) AccessChain 27(data) 39 39 + 256: 20(ivec4) Load 255 + 257: 76(ivec2) VectorShuffle 256 256 0 1 + 258: 6(int) Load 8(invocation) + 259: 76(ivec2) GroupNonUniformShuffleDown 35 257 258 + 260: 77(ptr) AccessChain 27(data) 254 39 + 261: 20(ivec4) Load 260 + 262: 20(ivec4) VectorShuffle 261 259 4 5 2 3 + Store 260 262 + 263: 6(int) Load 8(invocation) + 264: 77(ptr) AccessChain 27(data) 51 39 + 265: 20(ivec4) Load 264 + 266: 87(ivec3) VectorShuffle 265 265 0 1 2 + 267: 6(int) Load 8(invocation) + 268: 87(ivec3) GroupNonUniformShuffleDown 35 266 267 + 269: 77(ptr) AccessChain 27(data) 263 39 + 270: 20(ivec4) Load 269 + 271: 20(ivec4) VectorShuffle 270 268 4 5 6 3 + Store 269 271 + 272: 6(int) Load 8(invocation) + 273: 77(ptr) AccessChain 27(data) 62 39 + 274: 20(ivec4) Load 273 + 275: 6(int) Load 8(invocation) + 276: 20(ivec4) GroupNonUniformShuffleDown 35 274 275 + 277: 77(ptr) AccessChain 27(data) 272 39 + Store 277 276 + 278: 6(int) Load 8(invocation) + 279: 103(ptr) AccessChain 27(data) 29 51 30 + 280: 6(int) Load 279 + 281: 6(int) Load 8(invocation) + 282: 6(int) GroupNonUniformShuffleDown 35 280 281 + 283: 103(ptr) AccessChain 27(data) 278 51 30 + Store 283 282 + 284: 6(int) Load 8(invocation) + 285: 111(ptr) AccessChain 27(data) 39 51 + 286: 21(ivec4) Load 285 + 287: 110(ivec2) VectorShuffle 286 286 0 1 + 288: 6(int) Load 8(invocation) + 289: 110(ivec2) GroupNonUniformShuffleDown 35 287 288 + 290: 111(ptr) AccessChain 27(data) 284 51 + 291: 21(ivec4) Load 290 + 292: 21(ivec4) VectorShuffle 291 289 4 5 2 3 + Store 290 292 + 293: 6(int) Load 8(invocation) + 294: 111(ptr) AccessChain 27(data) 51 51 + 295: 21(ivec4) Load 294 + 296: 121(ivec3) VectorShuffle 295 295 0 1 2 + 297: 6(int) Load 8(invocation) + 298: 121(ivec3) GroupNonUniformShuffleDown 35 296 297 + 299: 111(ptr) AccessChain 27(data) 293 51 + 300: 21(ivec4) Load 299 + 301: 21(ivec4) VectorShuffle 300 298 4 5 6 3 + Store 299 301 + 302: 6(int) Load 8(invocation) + 303: 111(ptr) AccessChain 27(data) 62 51 + 304: 21(ivec4) Load 303 + 305: 6(int) Load 8(invocation) + 306: 21(ivec4) GroupNonUniformShuffleDown 35 304 305 + 307: 111(ptr) AccessChain 27(data) 302 51 + Store 307 306 + 308: 6(int) Load 8(invocation) + 309: 137(ptr) AccessChain 27(data) 29 62 30 + 310: 22(float) Load 309 + 311: 6(int) Load 8(invocation) + 312: 22(float) GroupNonUniformShuffleDown 35 310 311 + 313: 137(ptr) AccessChain 27(data) 308 62 30 + Store 313 312 + 314: 6(int) Load 8(invocation) + 315: 145(ptr) AccessChain 27(data) 39 62 + 316: 23(fvec4) Load 315 + 317: 144(fvec2) VectorShuffle 316 316 0 1 + 318: 6(int) Load 8(invocation) + 319: 144(fvec2) GroupNonUniformShuffleDown 35 317 318 + 320: 145(ptr) AccessChain 27(data) 314 62 + 321: 23(fvec4) Load 320 + 322: 23(fvec4) VectorShuffle 321 319 4 5 2 3 + Store 320 322 + 323: 6(int) Load 8(invocation) + 324: 145(ptr) AccessChain 27(data) 51 62 + 325: 23(fvec4) Load 324 + 326: 155(fvec3) VectorShuffle 325 325 0 1 2 + 327: 6(int) Load 8(invocation) + 328: 155(fvec3) GroupNonUniformShuffleDown 35 326 327 + 329: 145(ptr) AccessChain 27(data) 323 62 + 330: 23(fvec4) Load 329 + 331: 23(fvec4) VectorShuffle 330 328 4 5 6 3 + Store 329 331 + 332: 6(int) Load 8(invocation) + 333: 145(ptr) AccessChain 27(data) 62 62 + 334: 23(fvec4) Load 333 + 335: 6(int) Load 8(invocation) + 336: 23(fvec4) GroupNonUniformShuffleDown 35 334 335 + 337: 145(ptr) AccessChain 27(data) 332 62 + Store 337 336 + 338: 6(int) Load 8(invocation) + 339: 69(ptr) AccessChain 27(data) 29 39 30 + 340: 19(int) Load 339 + 341: 173(bool) SLessThan 340 29 + 342: 6(int) Load 8(invocation) + 343: 173(bool) GroupNonUniformShuffleDown 35 341 342 + 344: 19(int) Select 343 39 29 + 345: 69(ptr) AccessChain 27(data) 338 39 30 + Store 345 344 + 346: 6(int) Load 8(invocation) + 347: 77(ptr) AccessChain 27(data) 39 39 + 348: 20(ivec4) Load 347 + 349: 76(ivec2) VectorShuffle 348 348 0 1 + 350: 184(bvec2) SLessThan 349 183 + 351: 6(int) Load 8(invocation) + 352: 184(bvec2) GroupNonUniformShuffleDown 35 350 351 + 353: 76(ivec2) Select 352 188 183 + 354: 77(ptr) AccessChain 27(data) 346 39 + 355: 20(ivec4) Load 354 + 356: 20(ivec4) VectorShuffle 355 353 4 5 2 3 + Store 354 356 + 357: 6(int) Load 8(invocation) + 358: 77(ptr) AccessChain 27(data) 39 39 + 359: 20(ivec4) Load 358 + 360: 87(ivec3) VectorShuffle 359 359 0 1 2 + 361: 198(bvec3) SLessThan 360 197 + 362: 6(int) Load 8(invocation) + 363: 198(bvec3) GroupNonUniformShuffleDown 35 361 362 + 364: 87(ivec3) Select 363 202 197 + 365: 77(ptr) AccessChain 27(data) 357 39 + 366: 20(ivec4) Load 365 + 367: 20(ivec4) VectorShuffle 366 364 4 5 6 3 + Store 365 367 + 368: 6(int) Load 8(invocation) + 369: 77(ptr) AccessChain 27(data) 39 39 + 370: 20(ivec4) Load 369 + 371: 211(bvec4) SLessThan 370 210 + 372: 6(int) Load 8(invocation) + 373: 211(bvec4) GroupNonUniformShuffleDown 35 371 372 + 374: 20(ivec4) Select 373 215 210 + 375: 77(ptr) AccessChain 27(data) 368 39 + Store 375 374 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroup.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroup.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroup.tesc.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroup.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,59 @@ +spv.subgroup.tesc +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 26 + + Capability Tessellation + Capability GroupNonUniform + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 15 18 20 + ExecutionMode 4 OutputVertices 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + Name 4 "main" + Name 9 "Output" + MemberName 9(Output) 0 "result" + Name 11 "" + Name 15 "gl_PrimitiveID" + Name 18 "gl_SubgroupSize" + Name 20 "gl_SubgroupInvocationID" + Decorate 8 ArrayStride 16 + MemberDecorate 9(Output) 0 Offset 0 + Decorate 9(Output) BufferBlock + Decorate 11 DescriptorSet 0 + Decorate 11 Binding 0 + Decorate 15(gl_PrimitiveID) BuiltIn PrimitiveId + Decorate 18(gl_SubgroupSize) RelaxedPrecision + Decorate 18(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 19 RelaxedPrecision + Decorate 20(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 20(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 21 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 4 + 8: TypeRuntimeArray 7(ivec4) + 9(Output): TypeStruct 8 + 10: TypePointer Uniform 9(Output) + 11: 10(ptr) Variable Uniform + 12: TypeInt 32 1 + 13: 12(int) Constant 0 + 14: TypePointer Input 12(int) +15(gl_PrimitiveID): 14(ptr) Variable Input + 17: TypePointer Input 6(int) +18(gl_SubgroupSize): 17(ptr) Variable Input +20(gl_SubgroupInvocationID): 17(ptr) Variable Input + 22: 6(int) Constant 0 + 24: TypePointer Uniform 7(ivec4) + 4(main): 2 Function None 3 + 5: Label + 16: 12(int) Load 15(gl_PrimitiveID) + 19: 6(int) Load 18(gl_SubgroupSize) + 21: 6(int) Load 20(gl_SubgroupInvocationID) + 23: 7(ivec4) CompositeConstruct 19 21 22 22 + 25: 24(ptr) AccessChain 11 13 16 + Store 25 23 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroup.tese.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroup.tese.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroup.tese.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroup.tese.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,61 @@ +spv.subgroup.tese +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 26 + + Capability Tessellation + Capability GroupNonUniform + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationEvaluation 4 "main" 15 18 20 + ExecutionMode 4 Isolines + ExecutionMode 4 SpacingEqual + ExecutionMode 4 VertexOrderCcw + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + Name 4 "main" + Name 9 "Output" + MemberName 9(Output) 0 "result" + Name 11 "" + Name 15 "gl_PrimitiveID" + Name 18 "gl_SubgroupSize" + Name 20 "gl_SubgroupInvocationID" + Decorate 8 ArrayStride 16 + MemberDecorate 9(Output) 0 Offset 0 + Decorate 9(Output) BufferBlock + Decorate 11 DescriptorSet 0 + Decorate 11 Binding 0 + Decorate 15(gl_PrimitiveID) BuiltIn PrimitiveId + Decorate 18(gl_SubgroupSize) RelaxedPrecision + Decorate 18(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 19 RelaxedPrecision + Decorate 20(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 20(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 21 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 4 + 8: TypeRuntimeArray 7(ivec4) + 9(Output): TypeStruct 8 + 10: TypePointer Uniform 9(Output) + 11: 10(ptr) Variable Uniform + 12: TypeInt 32 1 + 13: 12(int) Constant 0 + 14: TypePointer Input 12(int) +15(gl_PrimitiveID): 14(ptr) Variable Input + 17: TypePointer Input 6(int) +18(gl_SubgroupSize): 17(ptr) Variable Input +20(gl_SubgroupInvocationID): 17(ptr) Variable Input + 22: 6(int) Constant 0 + 24: TypePointer Uniform 7(ivec4) + 4(main): 2 Function None 3 + 5: Label + 16: 12(int) Load 15(gl_PrimitiveID) + 19: 6(int) Load 18(gl_SubgroupSize) + 21: 6(int) Load 20(gl_SubgroupInvocationID) + 23: 7(ivec4) CompositeConstruct 19 21 22 22 + 25: 24(ptr) AccessChain 11 13 16 + Store 25 23 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroup.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroup.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroup.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroup.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,58 @@ +spv.subgroup.vert +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 26 + + Capability Shader + Capability GroupNonUniform + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 15 18 20 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + Name 4 "main" + Name 9 "Output" + MemberName 9(Output) 0 "result" + Name 11 "" + Name 15 "gl_VertexIndex" + Name 18 "gl_SubgroupSize" + Name 20 "gl_SubgroupInvocationID" + Decorate 8 ArrayStride 16 + MemberDecorate 9(Output) 0 Offset 0 + Decorate 9(Output) BufferBlock + Decorate 11 DescriptorSet 0 + Decorate 11 Binding 0 + Decorate 15(gl_VertexIndex) BuiltIn VertexIndex + Decorate 18(gl_SubgroupSize) RelaxedPrecision + Decorate 18(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 19 RelaxedPrecision + Decorate 20(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 20(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 21 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 4 + 8: TypeRuntimeArray 7(ivec4) + 9(Output): TypeStruct 8 + 10: TypePointer Uniform 9(Output) + 11: 10(ptr) Variable Uniform + 12: TypeInt 32 1 + 13: 12(int) Constant 0 + 14: TypePointer Input 12(int) +15(gl_VertexIndex): 14(ptr) Variable Input + 17: TypePointer Input 6(int) +18(gl_SubgroupSize): 17(ptr) Variable Input +20(gl_SubgroupInvocationID): 17(ptr) Variable Input + 22: 6(int) Constant 0 + 24: TypePointer Uniform 7(ivec4) + 4(main): 2 Function None 3 + 5: Label + 16: 12(int) Load 15(gl_VertexIndex) + 19: 6(int) Load 18(gl_SubgroupSize) + 21: 6(int) Load 20(gl_SubgroupInvocationID) + 23: 7(ivec4) CompositeConstruct 19 21 22 22 + 25: 24(ptr) AccessChain 11 13 16 + Store 25 23 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupVote.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupVote.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subgroupVote.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subgroupVote.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,288 @@ +spv.subgroupVote.comp +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 216 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformVote + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 10 12 + ExecutionMode 4 LocalSize 8 8 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + SourceExtension "GL_KHR_shader_subgroup_vote" + Name 4 "main" + Name 8 "invocation" + Name 10 "gl_SubgroupInvocationID" + Name 12 "gl_SubgroupSize" + Name 24 "Buffers" + MemberName 24(Buffers) 0 "f4" + MemberName 24(Buffers) 1 "i4" + MemberName 24(Buffers) 2 "u4" + MemberName 24(Buffers) 3 "d4" + MemberName 24(Buffers) 4 "r" + Name 27 "data" + Decorate 10(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 10(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 11 RelaxedPrecision + Decorate 12(gl_SubgroupSize) RelaxedPrecision + Decorate 12(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 13 RelaxedPrecision + Decorate 14 RelaxedPrecision + Decorate 16 RelaxedPrecision + MemberDecorate 24(Buffers) 0 Offset 0 + MemberDecorate 24(Buffers) 1 Offset 16 + MemberDecorate 24(Buffers) 2 Offset 32 + MemberDecorate 24(Buffers) 3 Offset 64 + MemberDecorate 24(Buffers) 4 Offset 96 + Decorate 24(Buffers) BufferBlock + Decorate 27(data) DescriptorSet 0 + Decorate 27(data) Binding 0 + Decorate 215 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_SubgroupInvocationID): 9(ptr) Variable Input +12(gl_SubgroupSize): 9(ptr) Variable Input + 15: 6(int) Constant 4 + 17: TypeFloat 32 + 18: TypeVector 17(float) 4 + 19: TypeInt 32 1 + 20: TypeVector 19(int) 4 + 21: TypeVector 6(int) 4 + 22: TypeFloat 64 + 23: TypeVector 22(float) 4 + 24(Buffers): TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(fvec4) 19(int) + 25: TypeArray 24(Buffers) 15 + 26: TypePointer Uniform 25 + 27(data): 26(ptr) Variable Uniform + 29: 19(int) Constant 4 + 30: TypePointer Uniform 19(int) + 33: 19(int) Constant 0 + 34: TypeBool + 36: 6(int) Constant 3 + 41: 6(int) Constant 0 + 42: TypePointer Uniform 17(float) + 46: 19(int) Constant 1 + 50: TypeVector 17(float) 2 + 51: TypePointer Uniform 18(fvec4) + 59: 19(int) Constant 2 + 60: TypeVector 17(float) 3 + 68: 19(int) Constant 3 + 81: TypeVector 19(int) 2 + 82: TypePointer Uniform 20(ivec4) + 90: TypeVector 19(int) 3 + 104: TypePointer Uniform 6(int) + 111: TypeVector 6(int) 2 + 112: TypePointer Uniform 21(ivec4) + 120: TypeVector 6(int) 3 + 142: TypePointer Uniform 22(float) + 149: TypeVector 22(float) 2 + 150: TypePointer Uniform 23(fvec4) + 158: TypeVector 22(float) 3 + 182: 81(ivec2) ConstantComposite 33 33 + 183: TypeVector 34(bool) 2 + 194: 90(ivec3) ConstantComposite 33 33 33 + 195: TypeVector 34(bool) 3 + 205: 20(ivec4) ConstantComposite 33 33 33 33 + 206: TypeVector 34(bool) 4 + 213: 6(int) Constant 8 + 214: 6(int) Constant 1 + 215: 120(ivec3) ConstantComposite 213 213 214 + 4(main): 2 Function None 3 + 5: Label + 8(invocation): 7(ptr) Variable Function + 11: 6(int) Load 10(gl_SubgroupInvocationID) + 13: 6(int) Load 12(gl_SubgroupSize) + 14: 6(int) IAdd 11 13 + 16: 6(int) UMod 14 15 + Store 8(invocation) 16 + 28: 6(int) Load 8(invocation) + 31: 30(ptr) AccessChain 27(data) 28 29 + 32: 19(int) Load 31 + 35: 34(bool) SLessThan 32 33 + 37: 34(bool) GroupNonUniformAll 36 35 + SelectionMerge 39 None + BranchConditional 37 38 133 + 38: Label + 40: 6(int) Load 8(invocation) + 43: 42(ptr) AccessChain 27(data) 33 33 41 + 44: 17(float) Load 43 + 45: 34(bool) GroupNonUniformAllEqual 36 44 + 47: 19(int) Select 45 46 33 + 48: 30(ptr) AccessChain 27(data) 40 29 + Store 48 47 + 49: 6(int) Load 8(invocation) + 52: 51(ptr) AccessChain 27(data) 46 33 + 53: 18(fvec4) Load 52 + 54: 50(fvec2) VectorShuffle 53 53 0 1 + 55: 34(bool) GroupNonUniformAllEqual 36 54 + 56: 19(int) Select 55 46 33 + 57: 30(ptr) AccessChain 27(data) 49 29 + Store 57 56 + 58: 6(int) Load 8(invocation) + 61: 51(ptr) AccessChain 27(data) 59 33 + 62: 18(fvec4) Load 61 + 63: 60(fvec3) VectorShuffle 62 62 0 1 2 + 64: 34(bool) GroupNonUniformAllEqual 36 63 + 65: 19(int) Select 64 46 33 + 66: 30(ptr) AccessChain 27(data) 58 29 + Store 66 65 + 67: 6(int) Load 8(invocation) + 69: 51(ptr) AccessChain 27(data) 68 33 + 70: 18(fvec4) Load 69 + 71: 34(bool) GroupNonUniformAllEqual 36 70 + 72: 19(int) Select 71 46 33 + 73: 30(ptr) AccessChain 27(data) 67 29 + Store 73 72 + 74: 6(int) Load 8(invocation) + 75: 30(ptr) AccessChain 27(data) 33 46 41 + 76: 19(int) Load 75 + 77: 34(bool) GroupNonUniformAllEqual 36 76 + 78: 19(int) Select 77 46 33 + 79: 30(ptr) AccessChain 27(data) 74 29 + Store 79 78 + 80: 6(int) Load 8(invocation) + 83: 82(ptr) AccessChain 27(data) 46 46 + 84: 20(ivec4) Load 83 + 85: 81(ivec2) VectorShuffle 84 84 0 1 + 86: 34(bool) GroupNonUniformAllEqual 36 85 + 87: 19(int) Select 86 46 33 + 88: 30(ptr) AccessChain 27(data) 80 29 + Store 88 87 + 89: 6(int) Load 8(invocation) + 91: 82(ptr) AccessChain 27(data) 59 46 + 92: 20(ivec4) Load 91 + 93: 90(ivec3) VectorShuffle 92 92 0 1 2 + 94: 34(bool) GroupNonUniformAllEqual 36 93 + 95: 19(int) Select 94 46 33 + 96: 30(ptr) AccessChain 27(data) 89 29 + Store 96 95 + 97: 6(int) Load 8(invocation) + 98: 82(ptr) AccessChain 27(data) 68 46 + 99: 20(ivec4) Load 98 + 100: 34(bool) GroupNonUniformAllEqual 36 99 + 101: 19(int) Select 100 46 33 + 102: 30(ptr) AccessChain 27(data) 97 29 + Store 102 101 + 103: 6(int) Load 8(invocation) + 105: 104(ptr) AccessChain 27(data) 33 59 41 + 106: 6(int) Load 105 + 107: 34(bool) GroupNonUniformAllEqual 36 106 + 108: 19(int) Select 107 46 33 + 109: 30(ptr) AccessChain 27(data) 103 29 + Store 109 108 + 110: 6(int) Load 8(invocation) + 113: 112(ptr) AccessChain 27(data) 46 59 + 114: 21(ivec4) Load 113 + 115: 111(ivec2) VectorShuffle 114 114 0 1 + 116: 34(bool) GroupNonUniformAllEqual 36 115 + 117: 19(int) Select 116 46 33 + 118: 30(ptr) AccessChain 27(data) 110 29 + Store 118 117 + 119: 6(int) Load 8(invocation) + 121: 112(ptr) AccessChain 27(data) 59 59 + 122: 21(ivec4) Load 121 + 123: 120(ivec3) VectorShuffle 122 122 0 1 2 + 124: 34(bool) GroupNonUniformAllEqual 36 123 + 125: 19(int) Select 124 46 33 + 126: 30(ptr) AccessChain 27(data) 119 29 + Store 126 125 + 127: 6(int) Load 8(invocation) + 128: 112(ptr) AccessChain 27(data) 68 59 + 129: 21(ivec4) Load 128 + 130: 34(bool) GroupNonUniformAllEqual 36 129 + 131: 19(int) Select 130 46 33 + 132: 30(ptr) AccessChain 27(data) 127 29 + Store 132 131 + Branch 39 + 133: Label + 134: 6(int) Load 8(invocation) + 135: 30(ptr) AccessChain 27(data) 134 29 + 136: 19(int) Load 135 + 137: 34(bool) SLessThan 136 33 + 138: 34(bool) GroupNonUniformAny 36 137 + SelectionMerge 140 None + BranchConditional 138 139 140 + 139: Label + 141: 6(int) Load 8(invocation) + 143: 142(ptr) AccessChain 27(data) 33 68 41 + 144: 22(float) Load 143 + 145: 34(bool) GroupNonUniformAllEqual 36 144 + 146: 19(int) Select 145 46 33 + 147: 30(ptr) AccessChain 27(data) 141 29 + Store 147 146 + 148: 6(int) Load 8(invocation) + 151: 150(ptr) AccessChain 27(data) 46 68 + 152: 23(fvec4) Load 151 + 153: 149(fvec2) VectorShuffle 152 152 0 1 + 154: 34(bool) GroupNonUniformAllEqual 36 153 + 155: 19(int) Select 154 46 33 + 156: 30(ptr) AccessChain 27(data) 148 29 + Store 156 155 + 157: 6(int) Load 8(invocation) + 159: 150(ptr) AccessChain 27(data) 59 68 + 160: 23(fvec4) Load 159 + 161: 158(fvec3) VectorShuffle 160 160 0 1 2 + 162: 34(bool) GroupNonUniformAllEqual 36 161 + 163: 19(int) Select 162 46 33 + 164: 30(ptr) AccessChain 27(data) 157 29 + Store 164 163 + 165: 6(int) Load 8(invocation) + 166: 150(ptr) AccessChain 27(data) 68 68 + 167: 23(fvec4) Load 166 + 168: 34(bool) GroupNonUniformAllEqual 36 167 + 169: 19(int) Select 168 46 33 + 170: 30(ptr) AccessChain 27(data) 165 29 + Store 170 169 + 171: 6(int) Load 8(invocation) + 172: 30(ptr) AccessChain 27(data) 33 46 41 + 173: 19(int) Load 172 + 174: 34(bool) SLessThan 173 33 + 175: 34(bool) GroupNonUniformAllEqual 36 174 + 176: 19(int) Select 175 46 33 + 177: 30(ptr) AccessChain 27(data) 171 29 + Store 177 176 + 178: 6(int) Load 8(invocation) + 179: 82(ptr) AccessChain 27(data) 46 46 + 180: 20(ivec4) Load 179 + 181: 81(ivec2) VectorShuffle 180 180 0 1 + 184: 183(bvec2) SLessThan 181 182 + 185: 34(bool) GroupNonUniformAllEqual 36 184 + 186: 19(int) Select 185 46 33 + 187: 81(ivec2) CompositeConstruct 186 186 + 188: 19(int) CompositeExtract 187 0 + 189: 30(ptr) AccessChain 27(data) 178 29 + Store 189 188 + 190: 6(int) Load 8(invocation) + 191: 82(ptr) AccessChain 27(data) 46 46 + 192: 20(ivec4) Load 191 + 193: 90(ivec3) VectorShuffle 192 192 0 1 2 + 196: 195(bvec3) SLessThan 193 194 + 197: 34(bool) GroupNonUniformAllEqual 36 196 + 198: 19(int) Select 197 46 33 + 199: 90(ivec3) CompositeConstruct 198 198 198 + 200: 19(int) CompositeExtract 199 0 + 201: 30(ptr) AccessChain 27(data) 190 29 + Store 201 200 + 202: 6(int) Load 8(invocation) + 203: 82(ptr) AccessChain 27(data) 46 46 + 204: 20(ivec4) Load 203 + 207: 206(bvec4) SLessThan 204 205 + 208: 34(bool) GroupNonUniformAllEqual 36 207 + 209: 19(int) Select 208 46 33 + 210: 20(ivec4) CompositeConstruct 209 209 209 209 + 211: 19(int) CompositeExtract 210 0 + 212: 30(ptr) AccessChain 27(data) 202 29 + Store 212 211 + Branch 140 + 140: Label + Branch 39 + 39: Label + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subpass.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subpass.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.subpass.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.subpass.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.subpass.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 67 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.switch.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.switch.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.switch.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.switch.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -4,7 +4,7 @@ WARNING: 0:139: 'switch' : last case/default label not followed by statements // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 269 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.swizzle.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.swizzle.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.swizzle.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.swizzle.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.swizzle.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 108 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.swizzleInversion.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.swizzleInversion.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.swizzleInversion.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.swizzleInversion.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.swizzleInversion.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 46 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.test.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.test.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.test.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.test.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.test.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 55 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.test.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.test.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.test.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.test.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -2,7 +2,7 @@ WARNING: 0:5: attribute deprecated in version 130; may be removed in future release // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 24 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.textureBuffer.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.textureBuffer.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.textureBuffer.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.textureBuffer.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.textureBuffer.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 42 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.texture.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.texture.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.texture.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.texture.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -4,7 +4,7 @@ WARNING: 0:12: varying deprecated in version 130; may be removed in future release // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 305 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.textureGatherBiasLod.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.textureGatherBiasLod.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.textureGatherBiasLod.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.textureGatherBiasLod.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.textureGatherBiasLod.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 298 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.texture.sampler.transform.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.texture.sampler.transform.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.texture.sampler.transform.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.texture.sampler.transform.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.texture.sampler.transform.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 20 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.texture.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.texture.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.texture.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.texture.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.texture.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 150 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.types.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.types.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.types.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.types.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,12 +1,12 @@ spv.types.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 260 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 91 93 100 102 109 111 118 120 127 129 136 138 145 147 154 156 160 + EntryPoint Fragment 4 "main" 96 98 105 107 114 116 123 125 132 134 141 143 150 152 159 161 165 ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" @@ -15,47 +15,47 @@ Name 12 "i_b" Name 17 "b2" Name 19 "u_b2" - Name 22 "i_b2" - Name 35 "b3" - Name 37 "u_b3" - Name 40 "i_b3" - Name 59 "b4" - Name 61 "u_b4" - Name 64 "i_b4" - Name 89 "i" - Name 91 "u_i" - Name 93 "i_i" - Name 98 "i2" - Name 100 "u_i2" - Name 102 "i_i2" - Name 107 "i3" - Name 109 "u_i3" - Name 111 "i_i3" - Name 116 "i4" - Name 118 "u_i4" - Name 120 "i_i4" - Name 125 "f" - Name 127 "u_f" - Name 129 "i_f" - Name 134 "f2" - Name 136 "u_f2" - Name 138 "i_f2" - Name 143 "f3" - Name 145 "u_f3" - Name 147 "i_f3" - Name 152 "f4" - Name 154 "u_f4" - Name 156 "i_f4" - Name 160 "gl_FragColor" - Decorate 91(u_i) Flat - Decorate 93(i_i) Flat - Decorate 100(u_i2) Flat - Decorate 102(i_i2) Flat - Decorate 109(u_i3) Flat - Decorate 111(i_i3) Flat - Decorate 118(u_i4) Flat - Decorate 120(i_i4) Flat - Decorate 160(gl_FragColor) Location 0 + Name 24 "i_b2" + Name 38 "b3" + Name 40 "u_b3" + Name 43 "i_b3" + Name 63 "b4" + Name 65 "u_b4" + Name 68 "i_b4" + Name 94 "i" + Name 96 "u_i" + Name 98 "i_i" + Name 103 "i2" + Name 105 "u_i2" + Name 107 "i_i2" + Name 112 "i3" + Name 114 "u_i3" + Name 116 "i_i3" + Name 121 "i4" + Name 123 "u_i4" + Name 125 "i_i4" + Name 130 "f" + Name 132 "u_f" + Name 134 "i_f" + Name 139 "f2" + Name 141 "u_f2" + Name 143 "i_f2" + Name 148 "f3" + Name 150 "u_f3" + Name 152 "i_f3" + Name 157 "f4" + Name 159 "u_f4" + Name 161 "i_f4" + Name 165 "gl_FragColor" + Decorate 96(u_i) Flat + Decorate 98(i_i) Flat + Decorate 105(u_i2) Flat + Decorate 107(i_i2) Flat + Decorate 114(u_i3) Flat + Decorate 116(i_i3) Flat + Decorate 123(u_i4) Flat + Decorate 125(i_i4) Flat + Decorate 165(gl_FragColor) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeBool @@ -67,271 +67,271 @@ 16: TypePointer Function 15(bvec2) 18: TypePointer Private 15(bvec2) 19(u_b2): 18(ptr) Variable Private - 22(i_b2): 18(ptr) Variable Private - 33: TypeVector 6(bool) 3 - 34: TypePointer Function 33(bvec3) - 36: TypePointer Private 33(bvec3) - 37(u_b3): 36(ptr) Variable Private - 40(i_b3): 36(ptr) Variable Private - 57: TypeVector 6(bool) 4 - 58: TypePointer Function 57(bvec4) - 60: TypePointer Private 57(bvec4) - 61(u_b4): 60(ptr) Variable Private - 64(i_b4): 60(ptr) Variable Private - 87: TypeInt 32 1 - 88: TypePointer Function 87(int) - 90: TypePointer Input 87(int) - 91(u_i): 90(ptr) Variable Input - 93(i_i): 90(ptr) Variable Input - 96: TypeVector 87(int) 2 - 97: TypePointer Function 96(ivec2) - 99: TypePointer Input 96(ivec2) - 100(u_i2): 99(ptr) Variable Input - 102(i_i2): 99(ptr) Variable Input - 105: TypeVector 87(int) 3 - 106: TypePointer Function 105(ivec3) - 108: TypePointer Input 105(ivec3) - 109(u_i3): 108(ptr) Variable Input - 111(i_i3): 108(ptr) Variable Input - 114: TypeVector 87(int) 4 - 115: TypePointer Function 114(ivec4) - 117: TypePointer Input 114(ivec4) - 118(u_i4): 117(ptr) Variable Input - 120(i_i4): 117(ptr) Variable Input - 123: TypeFloat 32 - 124: TypePointer Function 123(float) - 126: TypePointer Input 123(float) - 127(u_f): 126(ptr) Variable Input - 129(i_f): 126(ptr) Variable Input - 132: TypeVector 123(float) 2 - 133: TypePointer Function 132(fvec2) - 135: TypePointer Input 132(fvec2) - 136(u_f2): 135(ptr) Variable Input - 138(i_f2): 135(ptr) Variable Input - 141: TypeVector 123(float) 3 - 142: TypePointer Function 141(fvec3) - 144: TypePointer Input 141(fvec3) - 145(u_f3): 144(ptr) Variable Input - 147(i_f3): 144(ptr) Variable Input - 150: TypeVector 123(float) 4 - 151: TypePointer Function 150(fvec4) - 153: TypePointer Input 150(fvec4) - 154(u_f4): 153(ptr) Variable Input - 156(i_f4): 153(ptr) Variable Input - 159: TypePointer Output 150(fvec4) -160(gl_FragColor): 159(ptr) Variable Output - 193: TypeInt 32 0 - 194: 193(int) Constant 0 - 198: 193(int) Constant 1 - 208: 193(int) Constant 2 - 221: 193(int) Constant 3 - 257: 123(float) Constant 1065353216 - 258: 150(fvec4) ConstantComposite 257 257 257 257 + 20: TypeInt 32 0 + 21: 20(int) Constant 0 + 24(i_b2): 18(ptr) Variable Private + 28: 20(int) Constant 1 + 36: TypeVector 6(bool) 3 + 37: TypePointer Function 36(bvec3) + 39: TypePointer Private 36(bvec3) + 40(u_b3): 39(ptr) Variable Private + 43(i_b3): 39(ptr) Variable Private + 53: 20(int) Constant 2 + 61: TypeVector 6(bool) 4 + 62: TypePointer Function 61(bvec4) + 64: TypePointer Private 61(bvec4) + 65(u_b4): 64(ptr) Variable Private + 68(i_b4): 64(ptr) Variable Private + 84: 20(int) Constant 3 + 92: TypeInt 32 1 + 93: TypePointer Function 92(int) + 95: TypePointer Input 92(int) + 96(u_i): 95(ptr) Variable Input + 98(i_i): 95(ptr) Variable Input + 101: TypeVector 92(int) 2 + 102: TypePointer Function 101(ivec2) + 104: TypePointer Input 101(ivec2) + 105(u_i2): 104(ptr) Variable Input + 107(i_i2): 104(ptr) Variable Input + 110: TypeVector 92(int) 3 + 111: TypePointer Function 110(ivec3) + 113: TypePointer Input 110(ivec3) + 114(u_i3): 113(ptr) Variable Input + 116(i_i3): 113(ptr) Variable Input + 119: TypeVector 92(int) 4 + 120: TypePointer Function 119(ivec4) + 122: TypePointer Input 119(ivec4) + 123(u_i4): 122(ptr) Variable Input + 125(i_i4): 122(ptr) Variable Input + 128: TypeFloat 32 + 129: TypePointer Function 128(float) + 131: TypePointer Input 128(float) + 132(u_f): 131(ptr) Variable Input + 134(i_f): 131(ptr) Variable Input + 137: TypeVector 128(float) 2 + 138: TypePointer Function 137(fvec2) + 140: TypePointer Input 137(fvec2) + 141(u_f2): 140(ptr) Variable Input + 143(i_f2): 140(ptr) Variable Input + 146: TypeVector 128(float) 3 + 147: TypePointer Function 146(fvec3) + 149: TypePointer Input 146(fvec3) + 150(u_f3): 149(ptr) Variable Input + 152(i_f3): 149(ptr) Variable Input + 155: TypeVector 128(float) 4 + 156: TypePointer Function 155(fvec4) + 158: TypePointer Input 155(fvec4) + 159(u_f4): 158(ptr) Variable Input + 161(i_f4): 158(ptr) Variable Input + 164: TypePointer Output 155(fvec4) +165(gl_FragColor): 164(ptr) Variable Output + 257: 128(float) Constant 1065353216 + 258: 155(fvec4) ConstantComposite 257 257 257 257 4(main): 2 Function None 3 5: Label 8(b): 7(ptr) Variable Function 17(b2): 16(ptr) Variable Function - 35(b3): 34(ptr) Variable Function - 59(b4): 58(ptr) Variable Function - 89(i): 88(ptr) Variable Function - 98(i2): 97(ptr) Variable Function - 107(i3): 106(ptr) Variable Function - 116(i4): 115(ptr) Variable Function - 125(f): 124(ptr) Variable Function - 134(f2): 133(ptr) Variable Function - 143(f3): 142(ptr) Variable Function - 152(f4): 151(ptr) Variable Function - 161: 151(ptr) Variable Function + 38(b3): 37(ptr) Variable Function + 63(b4): 62(ptr) Variable Function + 94(i): 93(ptr) Variable Function + 103(i2): 102(ptr) Variable Function + 112(i3): 111(ptr) Variable Function + 121(i4): 120(ptr) Variable Function + 130(f): 129(ptr) Variable Function + 139(f2): 138(ptr) Variable Function + 148(f3): 147(ptr) Variable Function + 157(f4): 156(ptr) Variable Function + 194: 156(ptr) Variable Function 11: 6(bool) Load 10(u_b) 13: 6(bool) Load 12(i_b) 14: 6(bool) LogicalAnd 11 13 Store 8(b) 14 - 20: 15(bvec2) Load 19(u_b2) - 21: 6(bool) CompositeExtract 20 0 - 23: 15(bvec2) Load 22(i_b2) - 24: 6(bool) CompositeExtract 23 0 - 25: 6(bool) LogicalAnd 21 24 - 26: 15(bvec2) Load 19(u_b2) - 27: 6(bool) CompositeExtract 26 1 - 28: 6(bool) LogicalAnd 25 27 - 29: 15(bvec2) Load 22(i_b2) - 30: 6(bool) CompositeExtract 29 1 - 31: 6(bool) LogicalAnd 28 30 - 32: 15(bvec2) CompositeConstruct 31 31 - Store 17(b2) 32 - 38: 33(bvec3) Load 37(u_b3) - 39: 6(bool) CompositeExtract 38 0 - 41: 33(bvec3) Load 40(i_b3) - 42: 6(bool) CompositeExtract 41 0 - 43: 6(bool) LogicalAnd 39 42 - 44: 33(bvec3) Load 37(u_b3) - 45: 6(bool) CompositeExtract 44 1 - 46: 6(bool) LogicalAnd 43 45 - 47: 33(bvec3) Load 40(i_b3) - 48: 6(bool) CompositeExtract 47 1 + 22: 9(ptr) AccessChain 19(u_b2) 21 + 23: 6(bool) Load 22 + 25: 9(ptr) AccessChain 24(i_b2) 21 + 26: 6(bool) Load 25 + 27: 6(bool) LogicalAnd 23 26 + 29: 9(ptr) AccessChain 19(u_b2) 28 + 30: 6(bool) Load 29 + 31: 6(bool) LogicalAnd 27 30 + 32: 9(ptr) AccessChain 24(i_b2) 28 + 33: 6(bool) Load 32 + 34: 6(bool) LogicalAnd 31 33 + 35: 15(bvec2) CompositeConstruct 34 34 + Store 17(b2) 35 + 41: 9(ptr) AccessChain 40(u_b3) 21 + 42: 6(bool) Load 41 + 44: 9(ptr) AccessChain 43(i_b3) 21 + 45: 6(bool) Load 44 + 46: 6(bool) LogicalAnd 42 45 + 47: 9(ptr) AccessChain 40(u_b3) 28 + 48: 6(bool) Load 47 49: 6(bool) LogicalAnd 46 48 - 50: 33(bvec3) Load 37(u_b3) - 51: 6(bool) CompositeExtract 50 2 + 50: 9(ptr) AccessChain 43(i_b3) 28 + 51: 6(bool) Load 50 52: 6(bool) LogicalAnd 49 51 - 53: 33(bvec3) Load 40(i_b3) - 54: 6(bool) CompositeExtract 53 2 - 55: 6(bool) LogicalAnd 52 54 - 56: 33(bvec3) CompositeConstruct 55 55 55 - Store 35(b3) 56 - 62: 57(bvec4) Load 61(u_b4) - 63: 6(bool) CompositeExtract 62 0 - 65: 57(bvec4) Load 64(i_b4) - 66: 6(bool) CompositeExtract 65 0 - 67: 6(bool) LogicalAnd 63 66 - 68: 57(bvec4) Load 61(u_b4) - 69: 6(bool) CompositeExtract 68 1 - 70: 6(bool) LogicalAnd 67 69 - 71: 57(bvec4) Load 64(i_b4) - 72: 6(bool) CompositeExtract 71 1 - 73: 6(bool) LogicalAnd 70 72 - 74: 57(bvec4) Load 61(u_b4) - 75: 6(bool) CompositeExtract 74 2 - 76: 6(bool) LogicalAnd 73 75 - 77: 57(bvec4) Load 64(i_b4) - 78: 6(bool) CompositeExtract 77 2 - 79: 6(bool) LogicalAnd 76 78 - 80: 57(bvec4) Load 61(u_b4) - 81: 6(bool) CompositeExtract 80 3 - 82: 6(bool) LogicalAnd 79 81 - 83: 57(bvec4) Load 64(i_b4) - 84: 6(bool) CompositeExtract 83 3 - 85: 6(bool) LogicalAnd 82 84 - 86: 57(bvec4) CompositeConstruct 85 85 85 85 - Store 59(b4) 86 - 92: 87(int) Load 91(u_i) - 94: 87(int) Load 93(i_i) - 95: 87(int) IAdd 92 94 - Store 89(i) 95 - 101: 96(ivec2) Load 100(u_i2) - 103: 96(ivec2) Load 102(i_i2) - 104: 96(ivec2) IAdd 101 103 - Store 98(i2) 104 - 110: 105(ivec3) Load 109(u_i3) - 112: 105(ivec3) Load 111(i_i3) - 113: 105(ivec3) IAdd 110 112 - Store 107(i3) 113 - 119: 114(ivec4) Load 118(u_i4) - 121: 114(ivec4) Load 120(i_i4) - 122: 114(ivec4) IAdd 119 121 - Store 116(i4) 122 - 128: 123(float) Load 127(u_f) - 130: 123(float) Load 129(i_f) - 131: 123(float) FAdd 128 130 - Store 125(f) 131 - 137: 132(fvec2) Load 136(u_f2) - 139: 132(fvec2) Load 138(i_f2) - 140: 132(fvec2) FAdd 137 139 - Store 134(f2) 140 - 146: 141(fvec3) Load 145(u_f3) - 148: 141(fvec3) Load 147(i_f3) - 149: 141(fvec3) FAdd 146 148 - Store 143(f3) 149 - 155: 150(fvec4) Load 154(u_f4) - 157: 150(fvec4) Load 156(i_f4) - 158: 150(fvec4) FAdd 155 157 - Store 152(f4) 158 - 162: 6(bool) Load 8(b) - 163: 15(bvec2) Load 17(b2) - 164: 6(bool) CompositeExtract 163 0 - 165: 6(bool) LogicalOr 162 164 - 166: 15(bvec2) Load 17(b2) - 167: 6(bool) CompositeExtract 166 1 - 168: 6(bool) LogicalOr 165 167 - 169: 33(bvec3) Load 35(b3) - 170: 6(bool) CompositeExtract 169 0 - 171: 6(bool) LogicalOr 168 170 - 172: 33(bvec3) Load 35(b3) - 173: 6(bool) CompositeExtract 172 1 - 174: 6(bool) LogicalOr 171 173 - 175: 33(bvec3) Load 35(b3) - 176: 6(bool) CompositeExtract 175 2 - 177: 6(bool) LogicalOr 174 176 - 178: 57(bvec4) Load 59(b4) - 179: 6(bool) CompositeExtract 178 0 - 180: 6(bool) LogicalOr 177 179 - 181: 57(bvec4) Load 59(b4) - 182: 6(bool) CompositeExtract 181 1 - 183: 6(bool) LogicalOr 180 182 - 184: 57(bvec4) Load 59(b4) - 185: 6(bool) CompositeExtract 184 2 - 186: 6(bool) LogicalOr 183 185 - 187: 57(bvec4) Load 59(b4) - 188: 6(bool) CompositeExtract 187 3 - 189: 6(bool) LogicalOr 186 188 - SelectionMerge 191 None - BranchConditional 189 190 256 - 190: Label - 192: 87(int) Load 89(i) - 195: 88(ptr) AccessChain 98(i2) 194 - 196: 87(int) Load 195 - 197: 87(int) IAdd 192 196 - 199: 88(ptr) AccessChain 98(i2) 198 - 200: 87(int) Load 199 - 201: 87(int) IAdd 197 200 - 202: 88(ptr) AccessChain 107(i3) 194 - 203: 87(int) Load 202 - 204: 87(int) IAdd 201 203 - 205: 88(ptr) AccessChain 107(i3) 198 - 206: 87(int) Load 205 - 207: 87(int) IAdd 204 206 - 209: 88(ptr) AccessChain 107(i3) 208 - 210: 87(int) Load 209 - 211: 87(int) IAdd 207 210 - 212: 88(ptr) AccessChain 116(i4) 194 - 213: 87(int) Load 212 - 214: 87(int) IAdd 211 213 - 215: 88(ptr) AccessChain 116(i4) 198 - 216: 87(int) Load 215 - 217: 87(int) IAdd 214 216 - 218: 88(ptr) AccessChain 116(i4) 208 - 219: 87(int) Load 218 - 220: 87(int) IAdd 217 219 - 222: 88(ptr) AccessChain 116(i4) 221 - 223: 87(int) Load 222 - 224: 87(int) IAdd 220 223 - 225: 123(float) ConvertSToF 224 - 226: 123(float) Load 125(f) - 227: 123(float) FAdd 225 226 - 228: 124(ptr) AccessChain 134(f2) 194 - 229: 123(float) Load 228 - 230: 123(float) FAdd 227 229 - 231: 124(ptr) AccessChain 134(f2) 198 - 232: 123(float) Load 231 - 233: 123(float) FAdd 230 232 - 234: 124(ptr) AccessChain 143(f3) 194 - 235: 123(float) Load 234 - 236: 123(float) FAdd 233 235 - 237: 124(ptr) AccessChain 143(f3) 198 - 238: 123(float) Load 237 - 239: 123(float) FAdd 236 238 - 240: 124(ptr) AccessChain 143(f3) 208 - 241: 123(float) Load 240 - 242: 123(float) FAdd 239 241 - 243: 124(ptr) AccessChain 152(f4) 194 - 244: 123(float) Load 243 - 245: 123(float) FAdd 242 244 - 246: 124(ptr) AccessChain 152(f4) 198 - 247: 123(float) Load 246 - 248: 123(float) FAdd 245 247 - 249: 124(ptr) AccessChain 152(f4) 208 - 250: 123(float) Load 249 - 251: 123(float) FAdd 248 250 - 252: 124(ptr) AccessChain 152(f4) 221 - 253: 123(float) Load 252 - 254: 123(float) FAdd 251 253 - 255: 150(fvec4) CompositeConstruct 254 254 254 254 - Store 161 255 - Branch 191 + 54: 9(ptr) AccessChain 40(u_b3) 53 + 55: 6(bool) Load 54 + 56: 6(bool) LogicalAnd 52 55 + 57: 9(ptr) AccessChain 43(i_b3) 53 + 58: 6(bool) Load 57 + 59: 6(bool) LogicalAnd 56 58 + 60: 36(bvec3) CompositeConstruct 59 59 59 + Store 38(b3) 60 + 66: 9(ptr) AccessChain 65(u_b4) 21 + 67: 6(bool) Load 66 + 69: 9(ptr) AccessChain 68(i_b4) 21 + 70: 6(bool) Load 69 + 71: 6(bool) LogicalAnd 67 70 + 72: 9(ptr) AccessChain 65(u_b4) 28 + 73: 6(bool) Load 72 + 74: 6(bool) LogicalAnd 71 73 + 75: 9(ptr) AccessChain 68(i_b4) 28 + 76: 6(bool) Load 75 + 77: 6(bool) LogicalAnd 74 76 + 78: 9(ptr) AccessChain 65(u_b4) 53 + 79: 6(bool) Load 78 + 80: 6(bool) LogicalAnd 77 79 + 81: 9(ptr) AccessChain 68(i_b4) 53 + 82: 6(bool) Load 81 + 83: 6(bool) LogicalAnd 80 82 + 85: 9(ptr) AccessChain 65(u_b4) 84 + 86: 6(bool) Load 85 + 87: 6(bool) LogicalAnd 83 86 + 88: 9(ptr) AccessChain 68(i_b4) 84 + 89: 6(bool) Load 88 + 90: 6(bool) LogicalAnd 87 89 + 91: 61(bvec4) CompositeConstruct 90 90 90 90 + Store 63(b4) 91 + 97: 92(int) Load 96(u_i) + 99: 92(int) Load 98(i_i) + 100: 92(int) IAdd 97 99 + Store 94(i) 100 + 106: 101(ivec2) Load 105(u_i2) + 108: 101(ivec2) Load 107(i_i2) + 109: 101(ivec2) IAdd 106 108 + Store 103(i2) 109 + 115: 110(ivec3) Load 114(u_i3) + 117: 110(ivec3) Load 116(i_i3) + 118: 110(ivec3) IAdd 115 117 + Store 112(i3) 118 + 124: 119(ivec4) Load 123(u_i4) + 126: 119(ivec4) Load 125(i_i4) + 127: 119(ivec4) IAdd 124 126 + Store 121(i4) 127 + 133: 128(float) Load 132(u_f) + 135: 128(float) Load 134(i_f) + 136: 128(float) FAdd 133 135 + Store 130(f) 136 + 142: 137(fvec2) Load 141(u_f2) + 144: 137(fvec2) Load 143(i_f2) + 145: 137(fvec2) FAdd 142 144 + Store 139(f2) 145 + 151: 146(fvec3) Load 150(u_f3) + 153: 146(fvec3) Load 152(i_f3) + 154: 146(fvec3) FAdd 151 153 + Store 148(f3) 154 + 160: 155(fvec4) Load 159(u_f4) + 162: 155(fvec4) Load 161(i_f4) + 163: 155(fvec4) FAdd 160 162 + Store 157(f4) 163 + 166: 6(bool) Load 8(b) + 167: 7(ptr) AccessChain 17(b2) 21 + 168: 6(bool) Load 167 + 169: 6(bool) LogicalOr 166 168 + 170: 7(ptr) AccessChain 17(b2) 28 + 171: 6(bool) Load 170 + 172: 6(bool) LogicalOr 169 171 + 173: 7(ptr) AccessChain 38(b3) 21 + 174: 6(bool) Load 173 + 175: 6(bool) LogicalOr 172 174 + 176: 7(ptr) AccessChain 38(b3) 28 + 177: 6(bool) Load 176 + 178: 6(bool) LogicalOr 175 177 + 179: 7(ptr) AccessChain 38(b3) 53 + 180: 6(bool) Load 179 + 181: 6(bool) LogicalOr 178 180 + 182: 7(ptr) AccessChain 63(b4) 21 + 183: 6(bool) Load 182 + 184: 6(bool) LogicalOr 181 183 + 185: 7(ptr) AccessChain 63(b4) 28 + 186: 6(bool) Load 185 + 187: 6(bool) LogicalOr 184 186 + 188: 7(ptr) AccessChain 63(b4) 53 + 189: 6(bool) Load 188 + 190: 6(bool) LogicalOr 187 189 + 191: 7(ptr) AccessChain 63(b4) 84 + 192: 6(bool) Load 191 + 193: 6(bool) LogicalOr 190 192 + SelectionMerge 196 None + BranchConditional 193 195 256 + 195: Label + 197: 92(int) Load 94(i) + 198: 93(ptr) AccessChain 103(i2) 21 + 199: 92(int) Load 198 + 200: 92(int) IAdd 197 199 + 201: 93(ptr) AccessChain 103(i2) 28 + 202: 92(int) Load 201 + 203: 92(int) IAdd 200 202 + 204: 93(ptr) AccessChain 112(i3) 21 + 205: 92(int) Load 204 + 206: 92(int) IAdd 203 205 + 207: 93(ptr) AccessChain 112(i3) 28 + 208: 92(int) Load 207 + 209: 92(int) IAdd 206 208 + 210: 93(ptr) AccessChain 112(i3) 53 + 211: 92(int) Load 210 + 212: 92(int) IAdd 209 211 + 213: 93(ptr) AccessChain 121(i4) 21 + 214: 92(int) Load 213 + 215: 92(int) IAdd 212 214 + 216: 93(ptr) AccessChain 121(i4) 28 + 217: 92(int) Load 216 + 218: 92(int) IAdd 215 217 + 219: 93(ptr) AccessChain 121(i4) 53 + 220: 92(int) Load 219 + 221: 92(int) IAdd 218 220 + 222: 93(ptr) AccessChain 121(i4) 84 + 223: 92(int) Load 222 + 224: 92(int) IAdd 221 223 + 225: 128(float) ConvertSToF 224 + 226: 128(float) Load 130(f) + 227: 128(float) FAdd 225 226 + 228: 129(ptr) AccessChain 139(f2) 21 + 229: 128(float) Load 228 + 230: 128(float) FAdd 227 229 + 231: 129(ptr) AccessChain 139(f2) 28 + 232: 128(float) Load 231 + 233: 128(float) FAdd 230 232 + 234: 129(ptr) AccessChain 148(f3) 21 + 235: 128(float) Load 234 + 236: 128(float) FAdd 233 235 + 237: 129(ptr) AccessChain 148(f3) 28 + 238: 128(float) Load 237 + 239: 128(float) FAdd 236 238 + 240: 129(ptr) AccessChain 148(f3) 53 + 241: 128(float) Load 240 + 242: 128(float) FAdd 239 241 + 243: 129(ptr) AccessChain 157(f4) 21 + 244: 128(float) Load 243 + 245: 128(float) FAdd 242 244 + 246: 129(ptr) AccessChain 157(f4) 28 + 247: 128(float) Load 246 + 248: 128(float) FAdd 245 247 + 249: 129(ptr) AccessChain 157(f4) 53 + 250: 128(float) Load 249 + 251: 128(float) FAdd 248 250 + 252: 129(ptr) AccessChain 157(f4) 84 + 253: 128(float) Load 252 + 254: 128(float) FAdd 251 253 + 255: 155(fvec4) CompositeConstruct 254 254 254 254 + Store 194 255 + Branch 196 256: Label - Store 161 258 - Branch 191 - 191: Label - 259: 150(fvec4) Load 161 - Store 160(gl_FragColor) 259 + Store 194 258 + Branch 196 + 196: Label + 259: 155(fvec4) Load 194 + Store 165(gl_FragColor) 259 Return FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.uint.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.uint.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.uint.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.uint.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.uint.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 213 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.uniformArray.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.uniformArray.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.uniformArray.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.uniformArray.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.uniformArray.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 53 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.variableArrayIndex.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.variableArrayIndex.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.variableArrayIndex.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.variableArrayIndex.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.variableArrayIndex.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 93 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.varyingArray.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.varyingArray.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.varyingArray.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.varyingArray.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.varyingArray.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 61 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.varyingArrayIndirect.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.varyingArrayIndirect.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.varyingArrayIndirect.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.varyingArrayIndirect.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.varyingArrayIndirect.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 70 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.vecMatConstruct.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.vecMatConstruct.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.vecMatConstruct.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.vecMatConstruct.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,87 @@ +spv.vecMatConstruct.frag +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 62 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "v2" + Name 13 "m" + Name 19 "v3" + Name 27 "v4" + Name 37 "iv2" + Name 45 "iv3" + Name 54 "iv4" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypePointer Function 7(fvec2) + 10: TypeVector 6(float) 3 + 11: TypeMatrix 10(fvec3) 4 + 12: TypePointer Function 11 + 18: TypePointer Function 10(fvec3) + 25: TypeVector 6(float) 4 + 26: TypePointer Function 25(fvec4) + 34: TypeInt 32 1 + 35: TypeVector 34(int) 2 + 36: TypePointer Function 35(ivec2) + 43: TypeVector 34(int) 3 + 44: TypePointer Function 43(ivec3) + 52: TypeVector 34(int) 4 + 53: TypePointer Function 52(ivec4) + 4(main): 2 Function None 3 + 5: Label + 9(v2): 8(ptr) Variable Function + 13(m): 12(ptr) Variable Function + 19(v3): 18(ptr) Variable Function + 27(v4): 26(ptr) Variable Function + 37(iv2): 36(ptr) Variable Function + 45(iv3): 44(ptr) Variable Function + 54(iv4): 53(ptr) Variable Function + 14: 11 Load 13(m) + 15: 6(float) CompositeExtract 14 0 0 + 16: 6(float) CompositeExtract 14 0 1 + 17: 7(fvec2) CompositeConstruct 15 16 + Store 9(v2) 17 + 20: 11 Load 13(m) + 21: 6(float) CompositeExtract 20 0 0 + 22: 6(float) CompositeExtract 20 0 1 + 23: 6(float) CompositeExtract 20 0 2 + 24: 10(fvec3) CompositeConstruct 21 22 23 + Store 19(v3) 24 + 28: 11 Load 13(m) + 29: 6(float) CompositeExtract 28 0 0 + 30: 6(float) CompositeExtract 28 0 1 + 31: 6(float) CompositeExtract 28 0 2 + 32: 6(float) CompositeExtract 28 1 0 + 33: 25(fvec4) CompositeConstruct 29 30 31 32 + Store 27(v4) 33 + 38: 11 Load 13(m) + 39: 6(float) CompositeExtract 38 0 0 + 40: 6(float) CompositeExtract 38 0 1 + 41: 7(fvec2) CompositeConstruct 39 40 + 42: 35(ivec2) ConvertFToS 41 + Store 37(iv2) 42 + 46: 11 Load 13(m) + 47: 6(float) CompositeExtract 46 0 0 + 48: 6(float) CompositeExtract 46 0 1 + 49: 6(float) CompositeExtract 46 0 2 + 50: 10(fvec3) CompositeConstruct 47 48 49 + 51: 43(ivec3) ConvertFToS 50 + Store 45(iv3) 51 + 55: 11 Load 13(m) + 56: 6(float) CompositeExtract 55 0 0 + 57: 6(float) CompositeExtract 55 0 1 + 58: 6(float) CompositeExtract 55 0 2 + 59: 6(float) CompositeExtract 55 1 0 + 60: 25(fvec4) CompositeConstruct 56 57 58 59 + 61: 52(ivec4) ConvertFToS 60 + Store 54(iv4) 61 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.viewportArray2.tesc.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.viewportArray2.tesc.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.viewportArray2.tesc.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.viewportArray2.tesc.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.viewportArray2.tesc // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 25 Capability Geometry diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.viewportArray2.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.viewportArray2.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.viewportArray2.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.viewportArray2.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.viewportArray2.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 19 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.voidFunction.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.voidFunction.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.voidFunction.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.voidFunction.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.voidFunction.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 43 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.vulkan100.subgroupArithmetic.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.vulkan100.subgroupArithmetic.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.vulkan100.subgroupArithmetic.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.vulkan100.subgroupArithmetic.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,305 @@ +spv.vulkan100.subgroupArithmetic.comp +ERROR: 0:19: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:20: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:21: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:22: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:24: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:25: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:26: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:27: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:29: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:30: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:31: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:32: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:34: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:35: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:36: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:37: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:39: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:40: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:41: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:42: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:44: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:45: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:46: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:47: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:49: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:50: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:51: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:52: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:54: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:55: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:56: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:57: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:59: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:60: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:61: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:62: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:64: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:65: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:66: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:67: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:69: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:70: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:71: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:72: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:74: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:75: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:76: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:77: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:79: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:80: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:81: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:82: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:84: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:85: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:86: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:87: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:89: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:90: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:91: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:92: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:94: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:95: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:96: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:97: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:99: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:100: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:101: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:102: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:104: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:105: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:106: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:107: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:109: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:110: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:111: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:112: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:114: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:115: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:116: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:117: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:119: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:120: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:121: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:122: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:124: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:125: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:126: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:127: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:129: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:130: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:131: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:132: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:134: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:135: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:136: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:137: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:139: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:140: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:141: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:142: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:144: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:145: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:146: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:147: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:149: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:150: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:151: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:152: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:154: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:155: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:156: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:157: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:159: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:160: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:161: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:162: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:164: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:165: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:166: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:167: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:169: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:170: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:171: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:172: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:174: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:175: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:176: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:177: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:179: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:180: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:181: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:182: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:184: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:185: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:186: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:187: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:189: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:190: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:191: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:192: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:194: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:195: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:196: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:197: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:199: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:200: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:201: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:202: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:204: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:205: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:206: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:207: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:209: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:210: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:211: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:212: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:214: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:215: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:216: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:217: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:219: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:220: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:221: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:222: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:224: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:225: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:226: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:227: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:229: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:230: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:231: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:232: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:234: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:235: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:236: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:237: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:239: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:240: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:241: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:242: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:244: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:245: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:246: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:247: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:249: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:250: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:251: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:252: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:254: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:255: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:256: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:257: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:259: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:260: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:261: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:262: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:264: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:265: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:266: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:267: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:269: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:270: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:271: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:272: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:274: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:275: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:276: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:277: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:279: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:280: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:281: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:282: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:284: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:285: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:286: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:287: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:289: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:290: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:291: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:292: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:294: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:295: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:296: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:297: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:299: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:300: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:301: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:302: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:304: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:305: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:306: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:307: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:309: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:310: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:311: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:312: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:314: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:315: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:316: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:317: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:319: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:320: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:321: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:322: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:324: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:325: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:326: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:327: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:329: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:330: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:331: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:332: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:334: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:335: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:336: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:337: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:339: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:340: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:341: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:342: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:344: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:345: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:346: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:347: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:349: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:350: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:351: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:352: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:354: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:355: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:356: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:357: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:359: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:360: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:361: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:362: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:364: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:365: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:366: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:367: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:369: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:370: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:371: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:372: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:374: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:375: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:376: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:377: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:379: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:380: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:381: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:382: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:384: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:385: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:386: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:387: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:389: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:390: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:391: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:392: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 300 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.vulkan100.subgroupPartitioned.comp.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.vulkan100.subgroupPartitioned.comp.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.vulkan100.subgroupPartitioned.comp.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.vulkan100.subgroupPartitioned.comp.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,326 @@ +spv.vulkan100.subgroupPartitioned.comp +ERROR: 0:19: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:21: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:22: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:23: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:24: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:26: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:27: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:28: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:29: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:31: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:32: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:33: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:34: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:36: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:37: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:38: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:39: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:41: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:42: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:43: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:44: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:46: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:47: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:48: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:49: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:51: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:52: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:53: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:54: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:56: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:57: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:58: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:59: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:61: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:62: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:63: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:64: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:66: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:67: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:68: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:69: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:71: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:72: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:73: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:74: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:76: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:77: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:78: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:79: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:81: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:82: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:83: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:84: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:86: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:87: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:88: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:89: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:91: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:92: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:93: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:94: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:96: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:97: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:98: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:99: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:101: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:102: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:103: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:104: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:106: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:107: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:108: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:109: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:111: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:112: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:113: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:114: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:116: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:117: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:118: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:119: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:121: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:122: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:123: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:124: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:126: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:127: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:128: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:129: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:131: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:132: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:133: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:134: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:136: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:137: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:138: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:139: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:141: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:142: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:143: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:144: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:146: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:147: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:148: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:149: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:151: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:152: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:153: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:154: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:156: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:157: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:158: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:159: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:161: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:162: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:163: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:164: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:166: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:167: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:168: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:169: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:171: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:172: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:173: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:174: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:176: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:177: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:178: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:179: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:181: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:182: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:183: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:184: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:186: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:187: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:188: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:189: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:191: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:192: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:193: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:194: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:196: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:197: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:198: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:199: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:201: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:202: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:203: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:204: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:206: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:207: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:208: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:209: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:211: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:212: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:213: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:214: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:216: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:217: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:218: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:219: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:221: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:222: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:223: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:224: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:226: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:227: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:228: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:229: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:231: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:232: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:233: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:234: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:236: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:237: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:238: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:239: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:241: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:242: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:243: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:244: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:246: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:247: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:248: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:249: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:251: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:252: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:253: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:254: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:256: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:257: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:258: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:259: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:261: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:262: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:263: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:264: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:266: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:267: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:268: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:269: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:271: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:272: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:273: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:274: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:276: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:277: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:278: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:279: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:281: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:282: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:283: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:284: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:286: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:287: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:288: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:289: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:291: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:292: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:293: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:294: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:296: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:297: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:298: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:299: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:301: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:302: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:303: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:304: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:306: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:307: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:308: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:309: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:311: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:312: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:313: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:314: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:316: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:317: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:318: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:319: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:321: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:322: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:323: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:324: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:326: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:327: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:328: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:329: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:331: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:332: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:333: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:334: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:336: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:337: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:338: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:339: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:341: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:342: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:343: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:344: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:346: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:347: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:348: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:349: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:351: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:352: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:353: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:354: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:356: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:357: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:358: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:359: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:361: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:362: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:363: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:364: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:366: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:367: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:368: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:369: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:371: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:372: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:373: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:374: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:376: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:377: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:378: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:379: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:381: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:382: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:383: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:384: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:386: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:387: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:388: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:389: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:391: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:392: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:393: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:394: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:396: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:397: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:398: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:399: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:401: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:402: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:403: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:404: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:406: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:407: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:408: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:409: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:411: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:412: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:413: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:414: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:416: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:417: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:418: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:419: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 321 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.vulkan110.int16.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.vulkan110.int16.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.vulkan110.int16.frag.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.vulkan110.int16.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,741 @@ +spv.vulkan110.int16.frag +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 523 + + Capability Shader + Capability Float16 + Capability Float64 + Capability Int64 + Capability Int16 + Capability Int8 + Capability StorageUniform16 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_KHX_shader_explicit_arithmetic_types" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + Name 4 "main" + Name 6 "literal(" + Name 8 "typeCast16(" + Name 10 "operators(" + Name 12 "builtinFuncs(" + Name 16 "i16" + Name 24 "Uniforms" + MemberName 24(Uniforms) 0 "index" + Name 26 "" + Name 33 "indexable" + Name 38 "u16" + Name 46 "indexable" + Name 51 "i32v" + Name 54 "i16v" + Name 59 "u16v" + Name 67 "u32v" + Name 74 "i64v" + Name 80 "u64v" + Name 94 "f16v" + Name 100 "f32v" + Name 106 "f64v" + Name 154 "i8v" + Name 163 "u8v" + Name 176 "bv" + Name 195 "u16v" + Name 200 "i16" + Name 220 "i" + Name 227 "uv" + Name 243 "i64" + Name 281 "b" + Name 343 "i16v" + Name 346 "i16" + Name 356 "u16v" + Name 358 "u16" + Name 428 "i32" + Name 431 "i64" + Name 434 "i16v4" + Name 437 "u32" + Name 438 "u16v2" + Name 442 "u64" + Name 445 "u16v4" + Name 457 "bv" + Name 518 "Block" + MemberName 518(Block) 0 "i16" + MemberName 518(Block) 1 "i16v2" + MemberName 518(Block) 2 "i16v3" + MemberName 518(Block) 3 "i16v4" + MemberName 518(Block) 4 "u16" + MemberName 518(Block) 5 "u16v2" + MemberName 518(Block) 6 "u16v3" + MemberName 518(Block) 7 "u16v4" + Name 520 "block" + Name 521 "si16" + Name 522 "su16" + MemberDecorate 24(Uniforms) 0 Offset 0 + Decorate 24(Uniforms) Block + Decorate 26 DescriptorSet 0 + Decorate 26 Binding 0 + MemberDecorate 518(Block) 0 Offset 0 + MemberDecorate 518(Block) 1 Offset 4 + MemberDecorate 518(Block) 2 Offset 8 + MemberDecorate 518(Block) 3 Offset 16 + MemberDecorate 518(Block) 4 Offset 24 + MemberDecorate 518(Block) 5 Offset 28 + MemberDecorate 518(Block) 6 Offset 32 + MemberDecorate 518(Block) 7 Offset 40 + Decorate 518(Block) Block + Decorate 520(block) DescriptorSet 0 + Decorate 520(block) Binding 1 + Decorate 521(si16) SpecId 100 + Decorate 522(su16) SpecId 101 + 2: TypeVoid + 3: TypeFunction 2 + 14: TypeInt 16 1 + 15: TypePointer Function 14(int) + 17: TypeInt 32 0 + 18: 17(int) Constant 3 + 19: TypeArray 14(int) 18 + 20: 14(int) Constant 4294962927 + 21: 14(int) Constant 4294967295 + 22: 14(int) Constant 16384 + 23: 19 ConstantComposite 20 21 22 + 24(Uniforms): TypeStruct 17(int) + 25: TypePointer Uniform 24(Uniforms) + 26: 25(ptr) Variable Uniform + 27: TypeInt 32 1 + 28: 27(int) Constant 0 + 29: TypePointer Uniform 17(int) + 32: TypePointer Function 19 + 36: TypeInt 16 0 + 37: TypePointer Function 36(int) + 39: TypeArray 36(int) 18 + 40: 36(int) Constant 65535 + 41: 36(int) Constant 32767 + 42: 39 ConstantComposite 40 40 41 + 45: TypePointer Function 39 + 49: TypeVector 27(int) 2 + 50: TypePointer Function 49(ivec2) + 52: TypeVector 14(int) 2 + 53: TypePointer Function 52(ivec2) + 57: TypeVector 36(int) 2 + 58: TypePointer Function 57(ivec2) + 65: TypeVector 17(int) 2 + 66: TypePointer Function 65(ivec2) + 71: TypeInt 64 1 + 72: TypeVector 71(int) 2 + 73: TypePointer Function 72(ivec2) + 77: TypeInt 64 0 + 78: TypeVector 77(int) 2 + 79: TypePointer Function 78(ivec2) + 91: TypeFloat 16 + 92: TypeVector 91(float) 2 + 93: TypePointer Function 92(fvec2) + 97: TypeFloat 32 + 98: TypeVector 97(float) 2 + 99: TypePointer Function 98(fvec2) + 103: TypeFloat 64 + 104: TypeVector 103(float) 2 + 105: TypePointer Function 104(fvec2) + 151: TypeInt 8 1 + 152: TypeVector 151(int) 2 + 153: TypePointer Function 152(ivec2) + 160: TypeInt 8 0 + 161: TypeVector 160(int) 2 + 162: TypePointer Function 161(ivec2) + 173: TypeBool + 174: TypeVector 173(bool) 2 + 175: TypePointer Function 174(bvec2) + 178: 14(int) Constant 0 + 179: 14(int) Constant 1 + 180: 52(ivec2) ConstantComposite 178 178 + 181: 52(ivec2) ConstantComposite 179 179 + 184: 36(int) Constant 0 + 185: 36(int) Constant 1 + 186: 57(ivec2) ConstantComposite 184 184 + 187: 57(ivec2) ConstantComposite 185 185 + 193: TypeVector 36(int) 3 + 194: TypePointer Function 193(ivec3) + 197: TypeVector 14(int) 3 + 219: TypePointer Function 27(int) + 225: TypeVector 17(int) 3 + 226: TypePointer Function 225(ivec3) + 242: TypePointer Function 71(int) + 264: 17(int) Constant 1 + 270: 17(int) Constant 2 + 276: TypeVector 27(int) 3 + 280: TypePointer Function 173(bool) + 282: 17(int) Constant 0 + 296: TypePointer Function 17(int) + 354: 52(ivec2) ConstantComposite 21 21 + 363: 193(ivec3) ConstantComposite 184 184 184 + 405: 173(bool) ConstantTrue + 412: 173(bool) ConstantFalse + 413: 174(bvec2) ConstantComposite 412 412 + 425: TypeVector 173(bool) 3 + 426: 425(bvec3) ConstantComposite 412 412 412 + 432: TypeVector 14(int) 4 + 433: TypePointer Function 432(ivec4) + 441: TypePointer Function 77(int) + 443: TypeVector 36(int) 4 + 444: TypePointer Function 443(ivec4) + 456: TypePointer Function 425(bvec3) + 518(Block): TypeStruct 14(int) 52(ivec2) 197(ivec3) 432(ivec4) 36(int) 57(ivec2) 193(ivec3) 443(ivec4) + 519: TypePointer Uniform 518(Block) + 520(block): 519(ptr) Variable Uniform + 521(si16): 14(int) SpecConstant 4294967286 + 522(su16): 36(int) SpecConstant 20 + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd + 6(literal(): 2 Function None 3 + 7: Label + 16(i16): 15(ptr) Variable Function + 33(indexable): 32(ptr) Variable Function + 38(u16): 37(ptr) Variable Function + 46(indexable): 45(ptr) Variable Function + 30: 29(ptr) AccessChain 26 28 + 31: 17(int) Load 30 + Store 33(indexable) 23 + 34: 15(ptr) AccessChain 33(indexable) 31 + 35: 14(int) Load 34 + Store 16(i16) 35 + 43: 29(ptr) AccessChain 26 28 + 44: 17(int) Load 43 + Store 46(indexable) 42 + 47: 37(ptr) AccessChain 46(indexable) 44 + 48: 36(int) Load 47 + Store 38(u16) 48 + Return + FunctionEnd + 8(typeCast16(): 2 Function None 3 + 9: Label + 51(i32v): 50(ptr) Variable Function + 54(i16v): 53(ptr) Variable Function + 59(u16v): 58(ptr) Variable Function + 67(u32v): 66(ptr) Variable Function + 74(i64v): 73(ptr) Variable Function + 80(u64v): 79(ptr) Variable Function + 94(f16v): 93(ptr) Variable Function + 100(f32v): 99(ptr) Variable Function + 106(f64v): 105(ptr) Variable Function + 154(i8v): 153(ptr) Variable Function + 163(u8v): 162(ptr) Variable Function + 176(bv): 175(ptr) Variable Function + 55: 52(ivec2) Load 54(i16v) + 56: 49(ivec2) SConvert 55 + Store 51(i32v) 56 + 60: 57(ivec2) Load 59(u16v) + 61: 49(ivec2) UConvert 60 + 62: 49(ivec2) Bitcast 61 + Store 51(i32v) 62 + 63: 52(ivec2) Load 54(i16v) + 64: 57(ivec2) Bitcast 63 + Store 59(u16v) 64 + 68: 52(ivec2) Load 54(i16v) + 69: 49(ivec2) SConvert 68 + 70: 65(ivec2) Bitcast 69 + Store 67(u32v) 70 + 75: 52(ivec2) Load 54(i16v) + 76: 72(ivec2) SConvert 75 + Store 74(i64v) 76 + 81: 52(ivec2) Load 54(i16v) + 82: 72(ivec2) SConvert 81 + 83: 78(ivec2) Bitcast 82 + Store 80(u64v) 83 + 84: 57(ivec2) Load 59(u16v) + 85: 65(ivec2) UConvert 84 + Store 67(u32v) 85 + 86: 57(ivec2) Load 59(u16v) + 87: 72(ivec2) UConvert 86 + 88: 72(ivec2) Bitcast 87 + Store 74(i64v) 88 + 89: 57(ivec2) Load 59(u16v) + 90: 78(ivec2) UConvert 89 + Store 80(u64v) 90 + 95: 52(ivec2) Load 54(i16v) + 96: 92(fvec2) ConvertSToF 95 + Store 94(f16v) 96 + 101: 52(ivec2) Load 54(i16v) + 102: 98(fvec2) ConvertSToF 101 + Store 100(f32v) 102 + 107: 52(ivec2) Load 54(i16v) + 108: 104(fvec2) ConvertSToF 107 + Store 106(f64v) 108 + 109: 57(ivec2) Load 59(u16v) + 110: 92(fvec2) ConvertUToF 109 + Store 94(f16v) 110 + 111: 57(ivec2) Load 59(u16v) + 112: 98(fvec2) ConvertUToF 111 + Store 100(f32v) 112 + 113: 57(ivec2) Load 59(u16v) + 114: 104(fvec2) ConvertUToF 113 + Store 106(f64v) 114 + 115: 52(ivec2) Load 54(i16v) + 116: 49(ivec2) SConvert 115 + Store 51(i32v) 116 + 117: 57(ivec2) Load 59(u16v) + 118: 49(ivec2) UConvert 117 + 119: 49(ivec2) Bitcast 118 + Store 51(i32v) 119 + 120: 52(ivec2) Load 54(i16v) + 121: 57(ivec2) Bitcast 120 + Store 59(u16v) 121 + 122: 52(ivec2) Load 54(i16v) + 123: 49(ivec2) SConvert 122 + 124: 65(ivec2) Bitcast 123 + Store 67(u32v) 124 + 125: 52(ivec2) Load 54(i16v) + 126: 72(ivec2) SConvert 125 + Store 74(i64v) 126 + 127: 52(ivec2) Load 54(i16v) + 128: 72(ivec2) SConvert 127 + 129: 78(ivec2) Bitcast 128 + Store 80(u64v) 129 + 130: 57(ivec2) Load 59(u16v) + 131: 65(ivec2) UConvert 130 + Store 67(u32v) 131 + 132: 57(ivec2) Load 59(u16v) + 133: 72(ivec2) UConvert 132 + 134: 72(ivec2) Bitcast 133 + Store 74(i64v) 134 + 135: 57(ivec2) Load 59(u16v) + 136: 72(ivec2) UConvert 135 + 137: 72(ivec2) Bitcast 136 + 138: 78(ivec2) Bitcast 137 + Store 80(u64v) 138 + 139: 52(ivec2) Load 54(i16v) + 140: 92(fvec2) ConvertSToF 139 + Store 94(f16v) 140 + 141: 52(ivec2) Load 54(i16v) + 142: 98(fvec2) ConvertSToF 141 + Store 100(f32v) 142 + 143: 52(ivec2) Load 54(i16v) + 144: 104(fvec2) ConvertSToF 143 + Store 106(f64v) 144 + 145: 57(ivec2) Load 59(u16v) + 146: 92(fvec2) ConvertUToF 145 + Store 94(f16v) 146 + 147: 57(ivec2) Load 59(u16v) + 148: 98(fvec2) ConvertUToF 147 + Store 100(f32v) 148 + 149: 57(ivec2) Load 59(u16v) + 150: 104(fvec2) ConvertUToF 149 + Store 106(f64v) 150 + 155: 52(ivec2) Load 54(i16v) + 156: 152(ivec2) SConvert 155 + Store 154(i8v) 156 + 157: 57(ivec2) Load 59(u16v) + 158: 152(ivec2) UConvert 157 + 159: 152(ivec2) Bitcast 158 + Store 154(i8v) 159 + 164: 52(ivec2) Load 54(i16v) + 165: 152(ivec2) SConvert 164 + 166: 161(ivec2) Bitcast 165 + Store 163(u8v) 166 + 167: 57(ivec2) Load 59(u16v) + 168: 161(ivec2) UConvert 167 + Store 163(u8v) 168 + 169: 57(ivec2) Load 59(u16v) + 170: 161(ivec2) UConvert 169 + 171: 52(ivec2) UConvert 170 + 172: 52(ivec2) Bitcast 171 + Store 54(i16v) 172 + 177: 174(bvec2) Load 176(bv) + 182: 52(ivec2) Select 177 181 180 + Store 54(i16v) 182 + 183: 174(bvec2) Load 176(bv) + 188: 57(ivec2) Select 183 187 186 + Store 59(u16v) 188 + 189: 52(ivec2) Load 54(i16v) + 190: 174(bvec2) INotEqual 189 186 + Store 176(bv) 190 + 191: 57(ivec2) Load 59(u16v) + 192: 174(bvec2) INotEqual 191 186 + Store 176(bv) 192 + Return + FunctionEnd + 10(operators(): 2 Function None 3 + 11: Label + 195(u16v): 194(ptr) Variable Function + 200(i16): 15(ptr) Variable Function + 220(i): 219(ptr) Variable Function + 227(uv): 226(ptr) Variable Function + 243(i64): 242(ptr) Variable Function + 281(b): 280(ptr) Variable Function + 196: 193(ivec3) Load 195(u16v) + 198: 197(ivec3) CompositeConstruct 179 179 179 + 199: 193(ivec3) IAdd 196 198 + Store 195(u16v) 199 + 201: 14(int) Load 200(i16) + 202: 14(int) ISub 201 179 + Store 200(i16) 202 + 203: 14(int) Load 200(i16) + 204: 14(int) IAdd 203 179 + Store 200(i16) 204 + 205: 193(ivec3) Load 195(u16v) + 206: 197(ivec3) CompositeConstruct 179 179 179 + 207: 193(ivec3) ISub 205 206 + Store 195(u16v) 207 + 208: 193(ivec3) Load 195(u16v) + 209: 193(ivec3) Not 208 + Store 195(u16v) 209 + 210: 14(int) Load 200(i16) + Store 200(i16) 210 + 211: 193(ivec3) Load 195(u16v) + 212: 193(ivec3) SNegate 211 + Store 195(u16v) 212 + 213: 14(int) Load 200(i16) + 214: 14(int) Load 200(i16) + 215: 14(int) IAdd 214 213 + Store 200(i16) 215 + 216: 193(ivec3) Load 195(u16v) + 217: 193(ivec3) Load 195(u16v) + 218: 193(ivec3) ISub 217 216 + Store 195(u16v) 218 + 221: 14(int) Load 200(i16) + 222: 27(int) SConvert 221 + 223: 27(int) Load 220(i) + 224: 27(int) IMul 223 222 + Store 220(i) 224 + 228: 193(ivec3) Load 195(u16v) + 229: 225(ivec3) UConvert 228 + 230: 225(ivec3) Load 227(uv) + 231: 225(ivec3) UDiv 230 229 + Store 227(uv) 231 + 232: 14(int) Load 200(i16) + 233: 27(int) SConvert 232 + 234: 17(int) Bitcast 233 + 235: 225(ivec3) Load 227(uv) + 236: 225(ivec3) CompositeConstruct 234 234 234 + 237: 225(ivec3) UMod 235 236 + Store 227(uv) 237 + 238: 193(ivec3) Load 195(u16v) + 239: 225(ivec3) UConvert 238 + 240: 225(ivec3) Load 227(uv) + 241: 225(ivec3) IAdd 239 240 + Store 227(uv) 241 + 244: 14(int) Load 200(i16) + 245: 71(int) SConvert 244 + 246: 71(int) Load 243(i64) + 247: 71(int) ISub 245 246 + Store 243(i64) 247 + 248: 193(ivec3) Load 195(u16v) + 249: 225(ivec3) UConvert 248 + 250: 225(ivec3) Load 227(uv) + 251: 225(ivec3) IMul 249 250 + Store 227(uv) 251 + 252: 14(int) Load 200(i16) + 253: 71(int) SConvert 252 + 254: 71(int) Load 243(i64) + 255: 71(int) IMul 253 254 + Store 243(i64) 255 + 256: 14(int) Load 200(i16) + 257: 27(int) SConvert 256 + 258: 27(int) Load 220(i) + 259: 27(int) SMod 257 258 + Store 220(i) 259 + 260: 14(int) Load 200(i16) + 261: 193(ivec3) Load 195(u16v) + 262: 197(ivec3) CompositeConstruct 260 260 260 + 263: 193(ivec3) ShiftLeftLogical 261 262 + Store 195(u16v) 263 + 265: 37(ptr) AccessChain 195(u16v) 264 + 266: 36(int) Load 265 + 267: 14(int) Load 200(i16) + 268: 14(int) ShiftRightArithmetic 267 266 + Store 200(i16) 268 + 269: 14(int) Load 200(i16) + 271: 37(ptr) AccessChain 195(u16v) 270 + 272: 36(int) Load 271 + 273: 14(int) ShiftLeftLogical 269 272 + Store 200(i16) 273 + 274: 193(ivec3) Load 195(u16v) + 275: 27(int) Load 220(i) + 277: 276(ivec3) CompositeConstruct 275 275 275 + 278: 193(ivec3) ShiftLeftLogical 274 277 + 279: 225(ivec3) UConvert 278 + Store 227(uv) 279 + 283: 37(ptr) AccessChain 195(u16v) 282 + 284: 36(int) Load 283 + 285: 14(int) Load 200(i16) + 286: 36(int) Bitcast 285 + 287: 173(bool) INotEqual 284 286 + Store 281(b) 287 + 288: 14(int) Load 200(i16) + 289: 36(int) Bitcast 288 + 290: 37(ptr) AccessChain 195(u16v) 282 + 291: 36(int) Load 290 + 292: 173(bool) IEqual 289 291 + Store 281(b) 292 + 293: 37(ptr) AccessChain 195(u16v) 282 + 294: 36(int) Load 293 + 295: 17(int) UConvert 294 + 297: 296(ptr) AccessChain 227(uv) 264 + 298: 17(int) Load 297 + 299: 173(bool) UGreaterThan 295 298 + Store 281(b) 299 + 300: 14(int) Load 200(i16) + 301: 27(int) SConvert 300 + 302: 27(int) Load 220(i) + 303: 173(bool) SLessThan 301 302 + Store 281(b) 303 + 304: 37(ptr) AccessChain 195(u16v) 264 + 305: 36(int) Load 304 + 306: 17(int) UConvert 305 + 307: 296(ptr) AccessChain 227(uv) 282 + 308: 17(int) Load 307 + 309: 173(bool) UGreaterThanEqual 306 308 + Store 281(b) 309 + 310: 14(int) Load 200(i16) + 311: 27(int) SConvert 310 + 312: 27(int) Load 220(i) + 313: 173(bool) SLessThanEqual 311 312 + Store 281(b) 313 + 314: 14(int) Load 200(i16) + 315: 27(int) SConvert 314 + 316: 17(int) Bitcast 315 + 317: 225(ivec3) Load 227(uv) + 318: 225(ivec3) CompositeConstruct 316 316 316 + 319: 225(ivec3) BitwiseOr 317 318 + Store 227(uv) 319 + 320: 14(int) Load 200(i16) + 321: 27(int) SConvert 320 + 322: 27(int) Load 220(i) + 323: 27(int) BitwiseOr 321 322 + Store 220(i) 323 + 324: 14(int) Load 200(i16) + 325: 71(int) SConvert 324 + 326: 71(int) Load 243(i64) + 327: 71(int) BitwiseAnd 326 325 + Store 243(i64) 327 + 328: 193(ivec3) Load 195(u16v) + 329: 225(ivec3) UConvert 328 + 330: 225(ivec3) Load 227(uv) + 331: 225(ivec3) BitwiseAnd 329 330 + Store 227(uv) 331 + 332: 14(int) Load 200(i16) + 333: 27(int) SConvert 332 + 334: 17(int) Bitcast 333 + 335: 225(ivec3) Load 227(uv) + 336: 225(ivec3) CompositeConstruct 334 334 334 + 337: 225(ivec3) BitwiseXor 335 336 + Store 227(uv) 337 + 338: 193(ivec3) Load 195(u16v) + 339: 14(int) Load 200(i16) + 340: 36(int) Bitcast 339 + 341: 193(ivec3) CompositeConstruct 340 340 340 + 342: 193(ivec3) BitwiseXor 338 341 + Store 195(u16v) 342 + Return + FunctionEnd +12(builtinFuncs(): 2 Function None 3 + 13: Label + 343(i16v): 53(ptr) Variable Function + 346(i16): 15(ptr) Variable Function + 356(u16v): 194(ptr) Variable Function + 358(u16): 37(ptr) Variable Function + 428(i32): 219(ptr) Variable Function + 431(i64): 242(ptr) Variable Function + 434(i16v4): 433(ptr) Variable Function + 437(u32): 296(ptr) Variable Function + 438(u16v2): 58(ptr) Variable Function + 442(u64): 441(ptr) Variable Function + 445(u16v4): 444(ptr) Variable Function + 457(bv): 456(ptr) Variable Function + 344: 52(ivec2) Load 343(i16v) + 345: 52(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 344 + Store 343(i16v) 345 + 347: 14(int) Load 346(i16) + 348: 14(int) ExtInst 1(GLSL.std.450) 7(SSign) 347 + Store 346(i16) 348 + 349: 52(ivec2) Load 343(i16v) + 350: 14(int) Load 346(i16) + 351: 52(ivec2) CompositeConstruct 350 350 + 352: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 349 351 + Store 343(i16v) 352 + 353: 52(ivec2) Load 343(i16v) + 355: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 353 354 + Store 343(i16v) 355 + 357: 193(ivec3) Load 356(u16v) + 359: 36(int) Load 358(u16) + 360: 193(ivec3) CompositeConstruct 359 359 359 + 361: 193(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 357 360 + Store 356(u16v) 361 + 362: 193(ivec3) Load 356(u16v) + 364: 193(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 362 363 + Store 356(u16v) 364 + 365: 52(ivec2) Load 343(i16v) + 366: 14(int) Load 346(i16) + 367: 52(ivec2) CompositeConstruct 366 366 + 368: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 365 367 + Store 343(i16v) 368 + 369: 52(ivec2) Load 343(i16v) + 370: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 369 354 + Store 343(i16v) 370 + 371: 193(ivec3) Load 356(u16v) + 372: 36(int) Load 358(u16) + 373: 193(ivec3) CompositeConstruct 372 372 372 + 374: 193(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 371 373 + Store 356(u16v) 374 + 375: 193(ivec3) Load 356(u16v) + 376: 193(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 375 363 + Store 356(u16v) 376 + 377: 52(ivec2) Load 343(i16v) + 378: 14(int) Load 346(i16) + 379: 14(int) SNegate 378 + 380: 14(int) Load 346(i16) + 381: 52(ivec2) CompositeConstruct 379 379 + 382: 52(ivec2) CompositeConstruct 380 380 + 383: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 377 381 382 + Store 343(i16v) 383 + 384: 52(ivec2) Load 343(i16v) + 385: 52(ivec2) Load 343(i16v) + 386: 52(ivec2) SNegate 385 + 387: 52(ivec2) Load 343(i16v) + 388: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 384 386 387 + Store 343(i16v) 388 + 389: 193(ivec3) Load 356(u16v) + 390: 36(int) Load 358(u16) + 391: 36(int) SNegate 390 + 392: 36(int) Load 358(u16) + 393: 193(ivec3) CompositeConstruct 391 391 391 + 394: 193(ivec3) CompositeConstruct 392 392 392 + 395: 193(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 389 393 394 + Store 356(u16v) 395 + 396: 193(ivec3) Load 356(u16v) + 397: 193(ivec3) Load 356(u16v) + 398: 193(ivec3) SNegate 397 + 399: 193(ivec3) Load 356(u16v) + 400: 193(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 396 398 399 + Store 356(u16v) 400 + 401: 15(ptr) AccessChain 343(i16v) 282 + 402: 14(int) Load 401 + 403: 15(ptr) AccessChain 343(i16v) 264 + 404: 14(int) Load 403 + 406: 14(int) Select 405 404 402 + Store 346(i16) 406 + 407: 14(int) Load 346(i16) + 408: 52(ivec2) CompositeConstruct 407 407 + 409: 14(int) Load 346(i16) + 410: 14(int) SNegate 409 + 411: 52(ivec2) CompositeConstruct 410 410 + 414: 52(ivec2) Select 413 411 408 + Store 343(i16v) 414 + 415: 37(ptr) AccessChain 356(u16v) 282 + 416: 36(int) Load 415 + 417: 37(ptr) AccessChain 356(u16v) 264 + 418: 36(int) Load 417 + 419: 36(int) Select 405 418 416 + Store 358(u16) 419 + 420: 36(int) Load 358(u16) + 421: 193(ivec3) CompositeConstruct 420 420 420 + 422: 36(int) Load 358(u16) + 423: 36(int) SNegate 422 + 424: 193(ivec3) CompositeConstruct 423 423 423 + 427: 193(ivec3) Select 426 424 421 + Store 356(u16v) 427 + 429: 52(ivec2) Load 343(i16v) + 430: 27(int) Bitcast 429 + Store 428(i32) 430 + 435: 432(ivec4) Load 434(i16v4) + 436: 71(int) Bitcast 435 + Store 431(i64) 436 + 439: 57(ivec2) Load 438(u16v2) + 440: 17(int) Bitcast 439 + Store 437(u32) 440 + 446: 443(ivec4) Load 445(u16v4) + 447: 77(int) Bitcast 446 + Store 442(u64) 447 + 448: 27(int) Load 428(i32) + 449: 52(ivec2) Bitcast 448 + Store 343(i16v) 449 + 450: 71(int) Load 431(i64) + 451: 432(ivec4) Bitcast 450 + Store 434(i16v4) 451 + 452: 17(int) Load 437(u32) + 453: 57(ivec2) Bitcast 452 + Store 438(u16v2) 453 + 454: 77(int) Load 442(u64) + 455: 443(ivec4) Bitcast 454 + Store 445(u16v4) 455 + 458: 193(ivec3) Load 356(u16v) + 459: 36(int) Load 358(u16) + 460: 193(ivec3) CompositeConstruct 459 459 459 + 461: 425(bvec3) ULessThan 458 460 + Store 457(bv) 461 + 462: 52(ivec2) Load 343(i16v) + 463: 14(int) Load 346(i16) + 464: 52(ivec2) CompositeConstruct 463 463 + 465: 174(bvec2) SLessThan 462 464 + 466: 425(bvec3) Load 457(bv) + 467: 425(bvec3) VectorShuffle 466 465 3 4 2 + Store 457(bv) 467 + 468: 193(ivec3) Load 356(u16v) + 469: 36(int) Load 358(u16) + 470: 193(ivec3) CompositeConstruct 469 469 469 + 471: 425(bvec3) ULessThanEqual 468 470 + Store 457(bv) 471 + 472: 52(ivec2) Load 343(i16v) + 473: 14(int) Load 346(i16) + 474: 52(ivec2) CompositeConstruct 473 473 + 475: 174(bvec2) SLessThanEqual 472 474 + 476: 425(bvec3) Load 457(bv) + 477: 425(bvec3) VectorShuffle 476 475 3 4 2 + Store 457(bv) 477 + 478: 193(ivec3) Load 356(u16v) + 479: 36(int) Load 358(u16) + 480: 193(ivec3) CompositeConstruct 479 479 479 + 481: 425(bvec3) UGreaterThan 478 480 + Store 457(bv) 481 + 482: 52(ivec2) Load 343(i16v) + 483: 14(int) Load 346(i16) + 484: 52(ivec2) CompositeConstruct 483 483 + 485: 174(bvec2) SGreaterThan 482 484 + 486: 425(bvec3) Load 457(bv) + 487: 425(bvec3) VectorShuffle 486 485 3 4 2 + Store 457(bv) 487 + 488: 193(ivec3) Load 356(u16v) + 489: 36(int) Load 358(u16) + 490: 193(ivec3) CompositeConstruct 489 489 489 + 491: 425(bvec3) UGreaterThanEqual 488 490 + Store 457(bv) 491 + 492: 52(ivec2) Load 343(i16v) + 493: 14(int) Load 346(i16) + 494: 52(ivec2) CompositeConstruct 493 493 + 495: 174(bvec2) SGreaterThanEqual 492 494 + 496: 425(bvec3) Load 457(bv) + 497: 425(bvec3) VectorShuffle 496 495 3 4 2 + Store 457(bv) 497 + 498: 193(ivec3) Load 356(u16v) + 499: 36(int) Load 358(u16) + 500: 193(ivec3) CompositeConstruct 499 499 499 + 501: 425(bvec3) IEqual 498 500 + Store 457(bv) 501 + 502: 52(ivec2) Load 343(i16v) + 503: 14(int) Load 346(i16) + 504: 52(ivec2) CompositeConstruct 503 503 + 505: 174(bvec2) IEqual 502 504 + 506: 425(bvec3) Load 457(bv) + 507: 425(bvec3) VectorShuffle 506 505 3 4 2 + Store 457(bv) 507 + 508: 193(ivec3) Load 356(u16v) + 509: 36(int) Load 358(u16) + 510: 193(ivec3) CompositeConstruct 509 509 509 + 511: 425(bvec3) INotEqual 508 510 + Store 457(bv) 511 + 512: 52(ivec2) Load 343(i16v) + 513: 14(int) Load 346(i16) + 514: 52(ivec2) CompositeConstruct 513 513 + 515: 174(bvec2) INotEqual 512 514 + 516: 425(bvec3) Load 457(bv) + 517: 425(bvec3) VectorShuffle 516 515 3 4 2 + Store 457(bv) 517 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.vulkan110.storageBuffer.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.vulkan110.storageBuffer.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.vulkan110.storageBuffer.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.vulkan110.storageBuffer.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,66 @@ +spv.vulkan110.storageBuffer.vert +// Module Version 10300 +// Generated by (magic number): 80006 +// Id's are bound by 31 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 13 + Source GLSL 450 + Name 4 "main" + Name 11 "gl_PerVertex" + MemberName 11(gl_PerVertex) 0 "gl_Position" + MemberName 11(gl_PerVertex) 1 "gl_PointSize" + MemberName 11(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 11(gl_PerVertex) 3 "gl_CullDistance" + Name 13 "" + Name 16 "ub" + MemberName 16(ub) 0 "a" + Name 18 "ubi" + Name 22 "bb" + MemberName 22(bb) 0 "b" + Name 24 "bbi" + MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 11(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 11(gl_PerVertex) Block + MemberDecorate 16(ub) 0 Offset 0 + Decorate 16(ub) Block + Decorate 18(ubi) DescriptorSet 0 + MemberDecorate 22(bb) 0 Offset 0 + Decorate 22(bb) Block + Decorate 24(bbi) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 1 + 10: TypeArray 6(float) 9 +11(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 10 + 12: TypePointer Output 11(gl_PerVertex) + 13: 12(ptr) Variable Output + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16(ub): TypeStruct 7(fvec4) + 17: TypePointer Uniform 16(ub) + 18(ubi): 17(ptr) Variable Uniform + 19: TypePointer Uniform 7(fvec4) + 22(bb): TypeStruct 7(fvec4) + 23: TypePointer StorageBuffer 22(bb) + 24(bbi): 23(ptr) Variable StorageBuffer + 25: TypePointer StorageBuffer 7(fvec4) + 29: TypePointer Output 7(fvec4) + 4(main): 2 Function None 3 + 5: Label + 20: 19(ptr) AccessChain 18(ubi) 15 + 21: 7(fvec4) Load 20 + 26: 25(ptr) AccessChain 24(bbi) 15 + 27: 7(fvec4) Load 26 + 28: 7(fvec4) FAdd 21 27 + 30: 29(ptr) AccessChain 13 15 + Store 30 28 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.while-continue-break.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.while-continue-break.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.while-continue-break.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.while-continue-break.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.while-continue-break.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 41 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.whileLoop.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.whileLoop.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.whileLoop.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.whileLoop.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.whileLoop.frag // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 35 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.while-simple.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.while-simple.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.while-simple.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.while-simple.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,6 @@ spv.while-simple.vert // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 22 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.xfb2.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.xfb2.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.xfb2.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.xfb2.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,68 @@ +spv.xfb2.vert +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 35 + + Capability Shader + Capability TransformFeedback + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 10 14 + ExecutionMode 4 Xfb + Source GLSL 450 + Name 4 "main" + Name 8 "gl_PerVertex" + MemberName 8(gl_PerVertex) 0 "gl_Position" + Name 10 "" + Name 14 "position" + Name 17 "ComponentsBlock" + MemberName 17(ComponentsBlock) 0 "c1" + MemberName 17(ComponentsBlock) 1 "c2" + Name 19 "components" + MemberDecorate 8(gl_PerVertex) 0 Offset 16 + MemberDecorate 8(gl_PerVertex) 0 BuiltIn Position + Decorate 8(gl_PerVertex) Block + Decorate 10 XfbBuffer 3 + Decorate 10 XfbStride 32 + Decorate 14(position) Location 0 + MemberDecorate 17(ComponentsBlock) 0 Offset 0 + MemberDecorate 17(ComponentsBlock) 1 Offset 16 + Decorate 17(ComponentsBlock) Block + Decorate 19(components) DescriptorSet 0 + Decorate 19(components) Binding 5 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(gl_PerVertex): TypeStruct 7(fvec4) + 9: TypePointer Output 8(gl_PerVertex) + 10: 9(ptr) Variable Output + 11: TypeInt 32 1 + 12: 11(int) Constant 0 + 13: TypePointer Input 7(fvec4) + 14(position): 13(ptr) Variable Input + 16: TypeVector 6(float) 2 +17(ComponentsBlock): TypeStruct 7(fvec4) 16(fvec2) + 18: TypePointer Uniform 17(ComponentsBlock) + 19(components): 18(ptr) Variable Uniform + 20: TypePointer Uniform 7(fvec4) + 24: 11(int) Constant 1 + 25: TypePointer Uniform 16(fvec2) + 28: 6(float) Constant 0 + 33: TypePointer Output 7(fvec4) + 4(main): 2 Function None 3 + 5: Label + 15: 7(fvec4) Load 14(position) + 21: 20(ptr) AccessChain 19(components) 12 + 22: 7(fvec4) Load 21 + 23: 7(fvec4) FAdd 15 22 + 26: 25(ptr) AccessChain 19(components) 24 + 27: 16(fvec2) Load 26 + 29: 6(float) CompositeExtract 27 0 + 30: 6(float) CompositeExtract 27 1 + 31: 7(fvec4) CompositeConstruct 29 30 28 28 + 32: 7(fvec4) FAdd 23 31 + 34: 33(ptr) AccessChain 10 12 + Store 34 32 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.xfb3.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.xfb3.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.xfb3.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.xfb3.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,68 @@ +spv.xfb3.vert +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 35 + + Capability Shader + Capability TransformFeedback + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 10 14 + ExecutionMode 4 Xfb + Source GLSL 450 + Name 4 "main" + Name 8 "gl_PerVertex" + MemberName 8(gl_PerVertex) 0 "gl_Position" + Name 10 "" + Name 14 "position" + Name 17 "ComponentsBlock" + MemberName 17(ComponentsBlock) 0 "c1" + MemberName 17(ComponentsBlock) 1 "c2" + Name 19 "components" + MemberDecorate 8(gl_PerVertex) 0 Offset 16 + MemberDecorate 8(gl_PerVertex) 0 BuiltIn Position + Decorate 8(gl_PerVertex) Block + Decorate 10 XfbBuffer 3 + Decorate 10 XfbStride 80 + Decorate 14(position) Location 0 + MemberDecorate 17(ComponentsBlock) 0 Offset 0 + MemberDecorate 17(ComponentsBlock) 1 Offset 16 + Decorate 17(ComponentsBlock) Block + Decorate 19(components) DescriptorSet 0 + Decorate 19(components) Binding 5 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(gl_PerVertex): TypeStruct 7(fvec4) + 9: TypePointer Output 8(gl_PerVertex) + 10: 9(ptr) Variable Output + 11: TypeInt 32 1 + 12: 11(int) Constant 0 + 13: TypePointer Input 7(fvec4) + 14(position): 13(ptr) Variable Input + 16: TypeVector 6(float) 2 +17(ComponentsBlock): TypeStruct 7(fvec4) 16(fvec2) + 18: TypePointer Uniform 17(ComponentsBlock) + 19(components): 18(ptr) Variable Uniform + 20: TypePointer Uniform 7(fvec4) + 24: 11(int) Constant 1 + 25: TypePointer Uniform 16(fvec2) + 28: 6(float) Constant 0 + 33: TypePointer Output 7(fvec4) + 4(main): 2 Function None 3 + 5: Label + 15: 7(fvec4) Load 14(position) + 21: 20(ptr) AccessChain 19(components) 12 + 22: 7(fvec4) Load 21 + 23: 7(fvec4) FAdd 15 22 + 26: 25(ptr) AccessChain 19(components) 24 + 27: 16(fvec2) Load 26 + 29: 6(float) CompositeExtract 27 0 + 30: 6(float) CompositeExtract 27 1 + 31: 7(fvec4) CompositeConstruct 29 30 28 28 + 32: 7(fvec4) FAdd 23 31 + 34: 33(ptr) AccessChain 10 12 + Store 34 32 + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.xfb.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.xfb.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/spv.xfb.vert.out 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/spv.xfb.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,55 @@ +spv.xfb.vert +// Module Version 10000 +// Generated by (magic number): 80006 +// Id's are bound by 16 + + Capability Shader + Capability TransformFeedback + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 8 11 14 15 + ExecutionMode 4 Xfb + Source GLSL 450 + Name 4 "main" + Name 8 "out1" + Name 9 "outXfb" + MemberName 9(outXfb) 0 "out2" + Name 11 "" + Name 12 "outXfb2" + MemberName 12(outXfb2) 0 "out3" + Name 14 "" + Name 15 "out4" + Decorate 8(out1) Location 0 + Decorate 8(out1) XfbBuffer 3 + Decorate 8(out1) XfbStride 48 + Decorate 8(out1) Offset 12 + MemberDecorate 9(outXfb) 0 Offset 8 + Decorate 9(outXfb) Block + Decorate 11 Location 1 + Decorate 11 XfbBuffer 2 + Decorate 11 XfbStride 32 + MemberDecorate 12(outXfb2) 0 Offset 60 + Decorate 12(outXfb2) Block + Decorate 14 Location 3 + Decorate 14 XfbBuffer 1 + Decorate 14 XfbStride 64 + Decorate 15(out4) Location 4 + Decorate 15(out4) XfbBuffer 0 + Decorate 15(out4) XfbStride 8 + Decorate 15(out4) Offset 4 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Output 6(float) + 8(out1): 7(ptr) Variable Output + 9(outXfb): TypeStruct 6(float) + 10: TypePointer Output 9(outXfb) + 11: 10(ptr) Variable Output + 12(outXfb2): TypeStruct 6(float) + 13: TypePointer Output 12(outXfb2) + 14: 13(ptr) Variable Output + 15(out4): 7(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/tokenLength.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/tokenLength.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/tokenLength.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/tokenLength.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -51,7 +51,7 @@ 0:13 move second child to first child ( temp highp int) 0:13 'OE' ( global highp int) 0:13 Constant: -0:13 1073741823 (const int) +0:13 -1 (const int) 0:14 Sequence 0:14 move second child to first child ( temp highp int) 0:14 'HE' ( global highp int) @@ -92,7 +92,7 @@ 0:34 move second child to first child ( temp highp int) 0:34 'superO' ( global highp int) 0:34 Constant: -0:34 1073741823 (const int) +0:34 -1 (const int) 0:35 Sequence 0:35 move second child to first child ( temp highp int) 0:35 'superI' ( global highp int) @@ -147,7 +147,7 @@ 0:13 move second child to first child ( temp highp int) 0:13 'OE' ( global highp int) 0:13 Constant: -0:13 1073741823 (const int) +0:13 -1 (const int) 0:14 Sequence 0:14 move second child to first child ( temp highp int) 0:14 'HE' ( global highp int) @@ -188,7 +188,7 @@ 0:34 move second child to first child ( temp highp int) 0:34 'superO' ( global highp int) 0:34 Constant: -0:34 1073741823 (const int) +0:34 -1 (const int) 0:35 Sequence 0:35 move second child to first child ( temp highp int) 0:35 'superI' ( global highp int) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/versionsClean.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/versionsClean.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/versionsClean.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/versionsClean.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -6,7 +6,7 @@ 0:42 Sequence 0:42 move second child to first child ( temp 4-component vector of float) 0:42 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) -0:42 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:42 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) 0:42 Constant: 0:42 0 (const uint) 0:42 Construct vec4 ( temp 4-component vector of float) @@ -16,7 +16,7 @@ 0:? Linker Objects 0:? 'color' ( in 3-component vector of float) 0:? 'foo' ( uniform sampler2DRect) -0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) 0:? 'gl_VertexID' ( gl_VertexId int VertexId) 0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/versionsErrors.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/versionsErrors.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/versionsErrors.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/versionsErrors.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -13,7 +13,7 @@ 0:44 Sequence 0:44 move second child to first child ( temp 4-component vector of float) 0:44 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) -0:44 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:44 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) 0:44 Constant: 0:44 0 (const uint) 0:44 Construct vec4 ( temp 4-component vector of float) @@ -24,7 +24,7 @@ 0:? Linker Objects 0:? 'color' ( in 3-component vector of float) 0:? 'foo' ( uniform sampler2DRect) -0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) 0:? 'gl_VertexID' ( gl_VertexId int VertexId) 0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/vulkan.ast.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/vulkan.ast.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/vulkan.ast.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/vulkan.ast.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -258,7 +258,7 @@ 0:? 2 (const int) // Module Version 10000 -// Generated by (magic number): 80002 +// Generated by (magic number): 80006 // Id's are bound by 50 Capability Shader diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/vulkan.frag.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/vulkan.frag.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/vulkan.frag.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/vulkan.frag.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,4 +1,11 @@ vulkan.frag +ERROR: 0:3: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:4: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:5: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:6: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:8: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:9: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:10: 'binding' : sampler/texture/image requires layout(binding=X) ERROR: 0:14: 'sampler2D' : sampler-constructor requires two arguments ERROR: 0:15: 'sampler2D' : sampler-constructor first argument must be a scalar textureXXX type ERROR: 0:16: 'sampler2D' : sampler-constructor first argument must be a scalar textureXXX type @@ -14,13 +21,19 @@ ERROR: 0:29: 'sampler3D' : sampler-constructor cannot make an array of samplers ERROR: 0:29: 'sampler3D' : sampler/image types can only be used in uniform variables or function parameters: s3d ERROR: 0:29: '=' : cannot convert from ' const float' to ' global 4-element array of highp sampler3D' +ERROR: 0:31: 'location' : SPIR-V requires location for user input/output ERROR: 0:39: 'push_constant' : can only be used with a uniform ERROR: 0:43: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan ERROR: 0:43: 'push_constant' : can only be used with a block ERROR: 0:45: 'push_constant' : cannot declare a default, can only be used on a block +ERROR: 0:51: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:52: 'binding' : sampler/texture/image requires layout(binding=X) ERROR: 0:52: 'input_attachment_index' : can only be used with a subpass +ERROR: 0:53: 'binding' : sampler/texture/image requires layout(binding=X) ERROR: 0:53: 'input_attachment_index' : can only be used with a subpass +ERROR: 0:54: 'binding' : sampler/texture/image requires layout(binding=X) ERROR: 0:54: 'subpass' : requires an input_attachment_index layout qualifier +ERROR: 0:55: 'binding' : sampler/texture/image requires layout(binding=X) ERROR: 0:60: 'subpassLoadMS' : no matching overloaded function found ERROR: 0:61: 'subpassLoad' : no matching overloaded function found ERROR: 0:63: 'subpassLoadMS' : no matching overloaded function found @@ -39,7 +52,11 @@ ERROR: 0:94: ':' : wrong operand types: no operation ':' exists that takes a left-hand operand of type ' temp sampler2D' and a right operand of type ' temp sampler2D' (or there is no acceptable conversion) ERROR: 0:94: 'call argument' : sampler constructor must appear at point of use ERROR: 0:96: 'gl_NumSamples' : undeclared identifier -ERROR: 38 compilation errors. No code generated. +ERROR: 0:101: 'noise1' : no matching overloaded function found +ERROR: 0:102: 'noise2' : no matching overloaded function found +ERROR: 0:103: 'noise3' : no matching overloaded function found +ERROR: 0:104: 'noise4' : no matching overloaded function found +ERROR: 55 compilation errors. No code generated. ERROR: Linking fragment stage: Only one push_constant block is allowed per stage diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/vulkan.vert.out vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/vulkan.vert.out --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/baseResults/vulkan.vert.out 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/baseResults/vulkan.vert.out 2018-04-27 11:46:26.000000000 +0000 @@ -1,12 +1,20 @@ vulkan.vert ERROR: 0:3: 'subpass input' : not supported in this stage: vertex +ERROR: 0:3: 'binding' : sampler/texture/image requires layout(binding=X) ERROR: 0:4: 'subpass input' : not supported in this stage: vertex +ERROR: 0:4: 'binding' : sampler/texture/image requires layout(binding=X) ERROR: 0:5: 'subpass input' : not supported in this stage: vertex +ERROR: 0:5: 'binding' : sampler/texture/image requires layout(binding=X) ERROR: 0:6: 'subpass input' : not supported in this stage: vertex +ERROR: 0:6: 'binding' : sampler/texture/image requires layout(binding=X) ERROR: 0:7: 'subpass input' : not supported in this stage: vertex +ERROR: 0:7: 'binding' : sampler/texture/image requires layout(binding=X) ERROR: 0:8: 'subpass input' : not supported in this stage: vertex +ERROR: 0:8: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:10: 'location' : SPIR-V requires location for user input/output ERROR: 0:12: 'constant_id' : can only be applied to a scalar ERROR: 0:13: 'constant_id' : specialization-constant id already used +ERROR: 0:13: 'binding' : sampler/texture/image requires layout(binding=X) ERROR: 0:13: 'constant_id' : can only be applied to 'const'-qualified scalar ERROR: 0:13: 'constant_id' : cannot be applied to this type ERROR: 0:14: 'constant_id' : specialization-constant id is too large @@ -26,7 +34,10 @@ ERROR: 0:50: '[]' : only outermost dimension of an array of arrays can be a specialization constant ERROR: 0:51: '[]' : only outermost dimension of an array of arrays can be a specialization constant ERROR: 0:54: '[]' : only outermost dimension of an array of arrays can be a specialization constant -ERROR: 27 compilation errors. No code generated. +ERROR: 0:54: 'location' : SPIR-V requires location for user input/output +ERROR: 0:58: 'location' : SPIR-V requires location for user input/output +ERROR: 0:65: 'location' : overlapping use of location 10 +ERROR: 38 compilation errors. No code generated. SPIR-V is not generated for failed compile or link diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/cppBad.vert vulkan-1.1.73+dfsg/external/glslang/Test/cppBad.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/cppBad.vert 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/cppBad.vert 2018-04-27 11:46:26.000000000 +0000 @@ -1,5 +1,5 @@ #define m#0# #if m - +#endif #define n() int n" \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/cppPassMacroName.frag vulkan-1.1.73+dfsg/external/glslang/Test/cppPassMacroName.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/cppPassMacroName.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/cppPassMacroName.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,12 @@ +#define f1(i) ((i)*(i)) +#define I2(f, n) f(n) + f(n+1) +#define I3(f, n) I2(f, n) + f(n+2) + +void main() +{ + int f1 = 4; + int f2 = f1; + int f3 = f1(3); + int f4 = I2(f1, 0); + int f5 = I3(f1, 0); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/cppRelaxSkipTokensErrors.vert vulkan-1.1.73+dfsg/external/glslang/Test/cppRelaxSkipTokensErrors.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/cppRelaxSkipTokensErrors.vert 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/cppRelaxSkipTokensErrors.vert 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,14 @@ +#version 110 + +#if 0 +3.5L +3.5h +2034h +1.#INF +0x1234567812345L +12323394203923879234L +0123s; +123s; +0123456712345671234L +"string" +#endif diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/findFunction.frag vulkan-1.1.73+dfsg/external/glslang/Test/findFunction.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/findFunction.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/findFunction.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,46 @@ +#version 450 + +#extension GL_KHX_shader_explicit_arithmetic_types: enable + +int64_t func(int8_t a, int16_t b, int16_t c) +{ + return int64_t(a | b + c); +} + +int64_t func(int8_t a, int16_t b, int32_t c) +{ + return int64_t(a | b - c); +} + +int64_t func(int32_t a, int32_t b, int32_t c) +{ + return int64_t(a / b + c); +} + +int64_t func(float16_t a, float16_t b, float32_t c) +{ + return int64_t(a - b * c); +} + +int64_t func(float16_t a, int16_t b, float32_t c) +{ + return int64_t(a - b * c); +} + +void main() +{ + int8_t x; + int16_t y; + int32_t z; + int64_t w; + float16_t f16; + float64_t f64; + int64_t b1 = func(x, y, z); + int64_t b2 = func(y, y, z); // tie + int64_t b3 = func(y, y, w); // No match + int64_t b4 = func(y, z, f16); // No match + int64_t b5 = func(y, y, f16); + int64_t b7 = func(f16, f16, y); + int64_t b8 = func(f16, f16, f64); // No match + int64_t b9 = func(f16, x, f16); // tie +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/glspv.frag vulkan-1.1.73+dfsg/external/glslang/Test/glspv.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/glspv.frag 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/glspv.frag 2018-04-27 11:46:26.000000000 +0000 @@ -11,9 +11,18 @@ { } -uniform float f; // ERROR, no location +uniform float f; // ERROR, no location layout(location = 2) uniform float g; -uniform sampler2D s1; -layout(location = 3) uniform sampler2D s2; +uniform sampler2D s1; // ERROR, no binding +layout(location = 3) uniform sampler2D s2; // ERROR, no binding +void noise() +{ + noise1(vec4(1)); + noise2(4.0); + noise3(vec2(3)); + noise4(1); +} + +uniform atomic_uint atomic; // ERROR, no binding layout(input_attachment_index = 1) uniform subpassInput sub; // ERROR, no inputs diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/glspv.vert vulkan-1.1.73+dfsg/external/glslang/Test/glspv.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/glspv.vert 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/glspv.vert 2018-04-27 11:46:26.000000000 +0000 @@ -5,8 +5,8 @@ layout(set = 0, binding = 0, std140) uniform Bt1 { int a; } bt1; layout(set = 1, binding = 0, std140) uniform Bt2 { int a; } bt2; // ERROR, set has to be 0 -layout(shared) uniform Bt3 { int a; } bt3; // ERROR, no shared -layout(packed) uniform Bt4 { int a; } bt4; // ERROR, no shared +layout(shared) uniform Bt3 { int a; } bt3; // ERROR, no shared, no binding +layout(packed) uniform Bt4 { int a; } bt4; // ERROR, no shared, no binding void main() { diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.attributeC11.frag vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.attributeC11.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.attributeC11.frag 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.attributeC11.frag 2018-04-27 11:46:26.000000000 +0000 @@ -11,8 +11,12 @@ [[vk::input_attachment_index(4)]] Texture2D attach; +[[vk::constant_id(13)]] const int ci = 11; + +[[vk::push_constant]] cbuffer pcBuf { int a; }; + [[vk::location(7)]] float4 main([[vk::location(8)]] float4 input: A) : B { - return input + attach.Load(float2(0.5)); + return input + attach.Load(float2(0.5));// * a; } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.boolConv.vert vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.boolConv.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.boolConv.vert 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.boolConv.vert 2018-04-27 11:46:26.000000000 +0000 @@ -1,20 +1,20 @@ -static bool a, b = true; -float4 main() : SV_Position -{ - int r = 0; - - r += a + b; - r += a - b; - r += a * b; - r += a / b; - r += a % b; - - r += a & b; - r += a | b; - r += a ^ b; - - r += a << b; - r += a >> b; - - return r; -} \ No newline at end of file +static bool a, b = true; +float4 main() : SV_Position +{ + int r = 0; + + r += a + b; + r += a - b; + r += a * b; + r += a / b; + r += a % b; + + r += a & b; + r += a | b; + r += a ^ b; + + r += a << b; + r += a >> b; + + return r; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.buffer.frag vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.buffer.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.buffer.frag 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.buffer.frag 2018-04-27 11:46:26.000000000 +0000 @@ -31,7 +31,17 @@ return 1.0; } -float4 PixelShaderFunction(float4 input : SV_POSITION) : SV_TARGET0 +struct id { + float4 a; +}; + +cbuffer cbufName2 { + float4 v24; +} + +id PixelShaderFunction(float4 input : SV_POSITION) : SV_TARGET0 // id looks like id for cbuffer name, but can't be { - return (input + v1 + v2 + v3 + v4) * foo(); + id ret; + ret.a = v24 + (input + v1 + v2 + v3 + v4) * foo(); + return ret; } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.cbuffer-identifier.vert vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.cbuffer-identifier.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.cbuffer-identifier.vert 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.cbuffer-identifier.vert 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,32 @@ + +cbuffer ConstantBuffer : register( b0 ) +{ + matrix World; + matrix View; + matrix Projection; +}; + +struct VS_INPUT +{ + float4 Pos : POSITION; + float3 Norm : NORMAL; +}; + +struct PS_INPUT +{ + float4 Pos : SV_POSITION; + float3 Norm : TEXCOORD0; +}; + +PS_INPUT main( VS_INPUT input ) +{ + int ConstantBuffer = 42; // test ConstantBuffer as an identifier + + PS_INPUT output = (PS_INPUT)0; + output.Pos = mul( input.Pos, World ); + output.Pos = mul( output.Pos, View ); + output.Pos = mul( output.Pos, Projection ); + output.Norm = mul( input.Norm, World ); // Work when output.Norm = mul( input.Norm, (float3x3)World ); + + return output; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.color.hull.tesc vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.color.hull.tesc --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.color.hull.tesc 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.color.hull.tesc 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,74 @@ +///////////// +// GLOBALS // +///////////// +cbuffer TessellationBuffer : register(b0) +{ + float tessellationAmount; + float3 padding; +}; + + +////////////// +// TYPEDEFS // +////////////// +struct HullInputType +{ + float3 position : POSITION; + float4 color : COLOR; +}; + +struct ConstantOutputType +{ + float edges[3] : SV_TessFactor; + float inside : SV_InsideTessFactor; +}; + +struct HullOutputType +{ + float3 position : POSITION; + float4 color : COLOR; +}; + + +//////////////////////////////////////////////////////////////////////////////// +// Patch Constant Function +//////////////////////////////////////////////////////////////////////////////// +ConstantOutputType ColorPatchConstantFunction(InputPatch inputPatch, uint patchId : SV_PrimitiveID) +{ + ConstantOutputType output; + + + // Set the tessellation factors for the three edges of the triangle. + output.edges[0] = tessellationAmount; + output.edges[1] = tessellationAmount; + output.edges[2] = tessellationAmount; + + // Set the tessellation factor for tessallating inside the triangle. + output.inside = tessellationAmount; + + return output; +} + + +//////////////////////////////////////////////////////////////////////////////// +// Hull Shader +//////////////////////////////////////////////////////////////////////////////// +[domain("tri")] +[partitioning("integer")] +[outputtopology("triangle_cw")] +[outputcontrolpoints(3)] +[patchconstantfunc("ColorPatchConstantFunction")] + +HullOutputType main(InputPatch patch, uint pointId : SV_OutputControlPointID, uint patchId : SV_PrimitiveID) +{ + HullOutputType output; + + // Set the position for this control point as the output position. + output.position = patch[pointId].position; + + // Set the input color as the output color. + output.color = patch[pointId].color; + + return output; +} + diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.flattenOpaqueInit.vert vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.flattenOpaqueInit.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.flattenOpaqueInit.vert 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.flattenOpaqueInit.vert 2018-04-27 11:46:26.000000000 +0000 @@ -17,7 +17,11 @@ float4 main() : SV_TARGET0 { FxaaTex tex1 = { g_tInputTexture_sampler, g_tInputTexture }; + float4 res = lookUp(tex1); FxaaTex tex2 = fillOpaque(); + res += lookUp(tex2); FxaaTex tex3 = tex1; - return lookUp(tex3); + res += lookUp(tex3); + + return res; } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.gs-hs-mix.tesc vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.gs-hs-mix.tesc --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.gs-hs-mix.tesc 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.gs-hs-mix.tesc 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,119 @@ +cbuffer UniformBlock0 : register(b0) +{ + float4x4 model_view_matrix; + float4x4 proj_matrix; + float4x4 model_view_proj_matrix; + float3x3 normal_matrix; + float3 color; + float3 view_dir; + float3 tess_factor; +}; + +// ============================================================================= +// Hull Shader +// ============================================================================= +struct HSInput { + float3 PositionWS : POSITION; + float3 NormalWS : NORMAL; +}; + +struct HSOutput { + float3 PositionWS : POSITION; +}; + +struct HSTrianglePatchConstant { + float EdgeTessFactor[3] : SV_TessFactor; + float InsideTessFactor : SV_InsideTessFactor; + float3 NormalWS[3] : NORMAL; +}; + +HSTrianglePatchConstant HSPatchConstant(InputPatch patch) +{ + float3 roundedEdgeTessFactor = tess_factor; + float roundedInsideTessFactor = 3; + float insideTessFactor = 1; + + HSTrianglePatchConstant result; + + // Edge and inside tessellation factors + result.EdgeTessFactor[0] = roundedEdgeTessFactor.x; + result.EdgeTessFactor[1] = roundedEdgeTessFactor.y; + result.EdgeTessFactor[2] = roundedEdgeTessFactor.z; + result.InsideTessFactor = roundedInsideTessFactor; + + // Constant data + result.NormalWS[0] = patch[0].NormalWS; + result.NormalWS[1] = patch[1].NormalWS; + result.NormalWS[2] = patch[2].NormalWS; + + return result; +} + +[domain("tri")] +[partitioning("fractional_odd")] +[outputtopology("triangle_ccw")] +[outputcontrolpoints(3)] +[patchconstantfunc("HSPatchConstant")] +HSOutput HSMain( + InputPatch patch, + uint id : SV_OutputControlPointID +) +{ + HSOutput output; + output.PositionWS = patch[id].PositionWS; + return output; +} + +// ============================================================================= +// Geometry Shader +// ============================================================================= +struct GSVertexInput { + float3 PositionWS : POSITION; + float3 NormalWS : NORMAL; +}; + +struct GSVertexOutput { + float4 PositionCS : SV_POSITION; +}; + +[maxvertexcount(6)] +void GSMain( + triangle GSVertexInput input[3], + inout LineStream output +) +{ + + float3 P0 = input[0].PositionWS.xyz; + float3 P1 = input[1].PositionWS.xyz; + float3 P2 = input[2].PositionWS.xyz; + + GSVertexOutput vertex; + // Totally hacky... + P0.z += 0.001; + P1.z += 0.001; + P2.z += 0.001; + float4 Q0 = mul(proj_matrix, float4(P0, 1.0)); + float4 Q1 = mul(proj_matrix, float4(P1, 1.0)); + float4 Q2 = mul(proj_matrix, float4(P2, 1.0)); + + // Edge 0 + vertex.PositionCS = Q0; + output.Append(vertex); + vertex.PositionCS = Q1; + output.Append(vertex); + output.RestartStrip(); + + // Edge 1 + vertex.PositionCS = Q1; + output.Append(vertex); + vertex.PositionCS = Q2; + output.Append(vertex); + output.RestartStrip(); + + // Edge 2 + vertex.PositionCS = Q2; + output.Append(vertex); + vertex.PositionCS = Q0; + output.Append(vertex); + output.RestartStrip(); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.imagefetch-subvec4.comp vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.imagefetch-subvec4.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.imagefetch-subvec4.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.imagefetch-subvec4.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,8 @@ +Texture3D IN: register(t0); +RWTexture3D OUT: register(u1); + +[numthreads(8,8,8)] +void main(uint3 tid: SV_DispatchThreadID) +{ + OUT[tid] = IN[tid]; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.intrinsics.frag vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.intrinsics.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.intrinsics.frag 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.intrinsics.frag 2018-04-27 11:46:26.000000000 +0000 @@ -13,7 +13,7 @@ groupshared uint4 gs_ub4; groupshared uint4 gs_uc4; -float PixelShaderFunctionS(float inF0, float inF1, float inF2, uint inU0, uint inU1) +float PixelShaderFunctionS(float inF0, float inF1, float inF2, uint inU0, int inU1) { uint out_u1; @@ -23,7 +23,7 @@ bool r003 = any(inF0); float r004 = asin(inF0); int r005 = asint(inF0); - uint r006 = asuint(inF0); + uint r006 = asuint(inU1); float r007 = asfloat(inU0); // asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics float r009 = atan(inF0); diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.layout.frag vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.layout.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.layout.frag 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.layout.frag 2018-04-27 11:46:26.000000000 +0000 @@ -14,5 +14,6 @@ float4 PixelShaderFunction(float4 input) : COLOR0 { - return input + v1 + v5 + v1PostLayout; + float4 layout = 2.0; + return input + v1 + v5 + v1PostLayout * layout; } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.layoutOverride.vert vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.layoutOverride.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.layoutOverride.vert 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.layoutOverride.vert 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,7 @@ +layout(set=2,binding=0) Texture2D tex : register(t16); +SamplerState samp; + +float4 main() : SV_Position +{ + return tex.Sample(samp, float2(0.2, 0.3)); +} \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.mul-truncate.frag vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.mul-truncate.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.mul-truncate.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.mul-truncate.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,38 @@ + +// Test v*v, v*m, m*v, and m*m argument clamping. + +cbuffer Matrix +{ + float4x4 m44; + float4x3 m43; + float3x4 m34; + float3x3 m33; + float2x4 m24; + float4x2 m42; + float4 v4; + float3 v3; + float2 v2; +} + +float4 main() : SV_Target0 +{ + // v*v: + float r00 = mul(v2, v3); // float = float2*float3; // clamp to float2 dot product + float r01 = mul(v4, v2); // float = float4*float2; // clamp to float2 dot product + + // v*m + float4 r10 = mul(v3, m44); // float4 = float3 * float4x4; // clamp mat to float3x4; + float4 r11 = mul(v4, m34); // truncate vector to vec3 + + // m*v + float4 r20 = mul(m44, v3); // float4 = float4x4 * float3; // clamp mat to float4x3; + float4 r21 = mul(m43, v4); // truncate vector to vec3 + + // m*m + float2x3 r30 = mul(m24, m33); // float2x3 = float2x4 * float3x3; + float3x4 r31 = mul(m33, m24); // float3x4 = float3x3 * float2x4; + float3x2 r32 = mul(m33, m42); // float3x2 = float3x3 * float4x2; + float4x3 r33 = mul(m42, m33); // float4x3 = float4x2 * float3x3; + + return r10 + r11 + r20 + r21 + r00 + r01 + r30[0].x + r31[0] + r32[0].x + transpose(r33)[0]; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.noSemantic.functionality1.comp vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.noSemantic.functionality1.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.noSemantic.functionality1.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.noSemantic.functionality1.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,7 @@ +AppendStructuredBuffer Buf : register(u0); + +[numthreads(1, 1, 1)] +void main() +{ + Buf.Append(1.0f.xxxx); +} \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.numthreads.comp vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.numthreads.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.numthreads.comp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.numthreads.comp 2018-04-27 11:46:26.000000000 +0000 @@ -4,11 +4,8 @@ { } -[numTHreaDs(4,4,2)] // case insensitive -void main_aux1(uint3 tid : SV_DispatchThreadID ) +[numthreads(1,4,8)] +void main_aux2(uint3 tid : SV_DispatchThreadID ) { } -[numthreads(1,4,8)] -void main_aux2(uint3 tid : SV_DispatchThreadID ); - diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.PointSize.geom vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.PointSize.geom --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.PointSize.geom 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.PointSize.geom 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,11 @@ +struct S { + [[vk::builtin("PointSize")]] float ps : PSIZE; +}; + +[maxvertexcount(4)] +void main([[vk::builtin("PointSize")]] triangle in uint ps[3], + inout LineStream OutputStream) +{ + S s; + OutputStream.Append(s); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.PointSize.vert vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.PointSize.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.PointSize.vert 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.PointSize.vert 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,4 @@ +[[vk::builtin("PointSize")]] float main() +{ + return 2.3; +} \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.snorm.uav.comp vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.snorm.uav.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.snorm.uav.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.snorm.uav.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,15 @@ + +unorm float4 uf4; + +Texture3D ResultInU: register(t0); +RWTexture3D ResultOutU: register(u0); + +Texture3D ResultInS: register(t1); +RWTexture3D ResultOutS: register(u1); + +[numthreads(16, 16, 1)] +void main(uint3 tid: SV_DispatchThreadID) +{ + ResultOutS[tid] = ResultInS[tid] + uf4; + ResultOutU[tid] = ResultInU[tid]; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.store.rwbyteaddressbuffer.type.comp vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.store.rwbyteaddressbuffer.type.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.store.rwbyteaddressbuffer.type.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.store.rwbyteaddressbuffer.type.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,8 @@ +RWByteAddressBuffer buffer; + +[numthreads(64, 1, 1)] +void main( uint3 dispatchThreadID : SV_DispatchThreadID) +{ + if(dispatchThreadID.x == 0) + buffer.Store(0, 2); +} \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.texturebuffer.frag vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.texturebuffer.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.texturebuffer.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.texturebuffer.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,17 @@ + +struct Data { + float4 f; + int4 i; +}; + +TextureBuffer TextureBuffer_var : register(t0); + +tbuffer tbuf2 { + float4 f2; + int4 i2; +}; + +float4 main(float4 pos : SV_POSITION) : SV_TARGET +{ + return TextureBuffer_var.f + f2; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.wavebroadcast.comp vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.wavebroadcast.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.wavebroadcast.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.wavebroadcast.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,53 @@ +struct Types +{ + uint4 u; + int4 i; + float4 f; + double4 d; +}; + +RWStructuredBuffer data; + +[numthreads(32, 16, 1)] +void CSMain(uint3 dti : SV_DispatchThreadID) +{ + data[dti.x].u = WaveReadLaneAt(data[dti.x].u, 13); + data[dti.x].u.x = WaveReadLaneAt(data[dti.x].u.x, 13); + data[dti.x].u.xy = WaveReadLaneAt(data[dti.x].u.xy, 13); + data[dti.x].u.xyz = WaveReadLaneAt(data[dti.x].u.xyz, 13); + + data[dti.x].i = WaveReadLaneAt(data[dti.x].i, 13); + data[dti.x].i.x = WaveReadLaneAt(data[dti.x].i.x, 13); + data[dti.x].i.xy = WaveReadLaneAt(data[dti.x].i.xy, 13); + data[dti.x].i.xyz = WaveReadLaneAt(data[dti.x].i.xyz, 13); + + data[dti.x].f = WaveReadLaneAt(data[dti.x].f, 13); + data[dti.x].f.x = WaveReadLaneAt(data[dti.x].f.x, 13); + data[dti.x].f.xy = WaveReadLaneAt(data[dti.x].f.xy, 13); + data[dti.x].f.xyz = WaveReadLaneAt(data[dti.x].f.xyz, 13); + + data[dti.x].d = WaveReadLaneFirst(data[dti.x].d); + data[dti.x].d.x = WaveReadLaneFirst(data[dti.x].d.x); + data[dti.x].d.xy = WaveReadLaneFirst(data[dti.x].d.xy); + data[dti.x].d.xyz = WaveReadLaneFirst(data[dti.x].d.xyz); + + data[dti.x].u = WaveReadLaneFirst(data[dti.x].u); + data[dti.x].u.x = WaveReadLaneFirst(data[dti.x].u.x); + data[dti.x].u.xy = WaveReadLaneFirst(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveReadLaneFirst(data[dti.x].u.xyz); + + data[dti.x].i = WaveReadLaneFirst(data[dti.x].i); + data[dti.x].i.x = WaveReadLaneFirst(data[dti.x].i.x); + data[dti.x].i.xy = WaveReadLaneFirst(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveReadLaneFirst(data[dti.x].i.xyz); + + data[dti.x].f = WaveReadLaneFirst(data[dti.x].f); + data[dti.x].f.x = WaveReadLaneFirst(data[dti.x].f.x); + data[dti.x].f.xy = WaveReadLaneFirst(data[dti.x].f.xy); + data[dti.x].f.xyz = WaveReadLaneFirst(data[dti.x].f.xyz); + + data[dti.x].d = WaveReadLaneFirst(data[dti.x].d); + data[dti.x].d.x = WaveReadLaneFirst(data[dti.x].d.x); + data[dti.x].d.xy = WaveReadLaneFirst(data[dti.x].d.xy); + data[dti.x].d.xyz = WaveReadLaneFirst(data[dti.x].d.xyz); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.waveprefix.comp vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.waveprefix.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.waveprefix.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.waveprefix.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,55 @@ +struct Types +{ + uint4 u; + int4 i; + float4 f; + double4 d; +}; + +RWStructuredBuffer data; + +[numthreads(32, 16, 1)] +void CSMain(uint3 dti : SV_DispatchThreadID) +{ + data[dti.x].u = WavePrefixSum(data[dti.x].u); + data[dti.x].u.x = WavePrefixSum(data[dti.x].u.x); + data[dti.x].u.xy = WavePrefixSum(data[dti.x].u.xy); + data[dti.x].u.xyz = WavePrefixSum(data[dti.x].u.xyz); + + data[dti.x].i = WavePrefixSum(data[dti.x].i); + data[dti.x].i.x = WavePrefixSum(data[dti.x].i.x); + data[dti.x].i.xy = WavePrefixSum(data[dti.x].i.xy); + data[dti.x].i.xyz = WavePrefixSum(data[dti.x].i.xyz); + + data[dti.x].f = WavePrefixSum(data[dti.x].f); + data[dti.x].f.x = WavePrefixSum(data[dti.x].f.x); + data[dti.x].f.xy = WavePrefixSum(data[dti.x].f.xy); + data[dti.x].f.xyz = WavePrefixSum(data[dti.x].f.xyz); + + data[dti.x].d = WavePrefixSum(data[dti.x].d); + data[dti.x].d.x = WavePrefixSum(data[dti.x].d.x); + data[dti.x].d.xy = WavePrefixSum(data[dti.x].d.xy); + data[dti.x].d.xyz = WavePrefixSum(data[dti.x].d.xyz); + + data[dti.x].u = WavePrefixProduct(data[dti.x].u); + data[dti.x].u.x = WavePrefixProduct(data[dti.x].u.x); + data[dti.x].u.xy = WavePrefixProduct(data[dti.x].u.xy); + data[dti.x].u.xyz = WavePrefixProduct(data[dti.x].u.xyz); + + data[dti.x].i = WavePrefixProduct(data[dti.x].i); + data[dti.x].i.x = WavePrefixProduct(data[dti.x].i.x); + data[dti.x].i.xy = WavePrefixProduct(data[dti.x].i.xy); + data[dti.x].i.xyz = WavePrefixProduct(data[dti.x].i.xyz); + + data[dti.x].f = WavePrefixProduct(data[dti.x].f); + data[dti.x].f.x = WavePrefixProduct(data[dti.x].f.x); + data[dti.x].f.xy = WavePrefixProduct(data[dti.x].f.xy); + data[dti.x].f.xyz = WavePrefixProduct(data[dti.x].f.xyz); + + data[dti.x].d = WavePrefixProduct(data[dti.x].d); + data[dti.x].d.x = WavePrefixProduct(data[dti.x].d.x); + data[dti.x].d.xy = WavePrefixProduct(data[dti.x].d.xy); + data[dti.x].d.xyz = WavePrefixProduct(data[dti.x].d.xyz); + + data[dti.x].u.x = WavePrefixCountBits(data[dti.x].u.x == 0); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.wavequad.comp vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.wavequad.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.wavequad.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.wavequad.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,153 @@ +struct Types +{ + uint4 u; + int4 i; + float4 f; + double4 d; +}; + +RWStructuredBuffer data; + +[numthreads(32, 16, 1)] +void CSMain(uint3 dti : SV_DispatchThreadID) +{ + data[dti.x].u = QuadReadLaneAt(data[dti.x].u, 0); + data[dti.x].u.x = QuadReadLaneAt(data[dti.x].u.x, 0); + data[dti.x].u.xy = QuadReadLaneAt(data[dti.x].u.xy, 0); + data[dti.x].u.xyz = QuadReadLaneAt(data[dti.x].u.xyz, 0); + + data[dti.x].i = QuadReadLaneAt(data[dti.x].i, 0); + data[dti.x].i.x = QuadReadLaneAt(data[dti.x].i.x, 0); + data[dti.x].i.xy = QuadReadLaneAt(data[dti.x].i.xy, 0); + data[dti.x].i.xyz = QuadReadLaneAt(data[dti.x].i.xyz, 0); + + data[dti.x].f = QuadReadLaneAt(data[dti.x].f, 0); + data[dti.x].f.x = QuadReadLaneAt(data[dti.x].f.x, 0); + data[dti.x].f.xy = QuadReadLaneAt(data[dti.x].f.xy, 0); + data[dti.x].f.xyz = QuadReadLaneAt(data[dti.x].f.xyz, 0); + + data[dti.x].d = QuadReadLaneAt(data[dti.x].d, 0); + data[dti.x].d.x = QuadReadLaneAt(data[dti.x].d.x, 0); + data[dti.x].d.xy = QuadReadLaneAt(data[dti.x].d.xy, 0); + data[dti.x].d.xyz = QuadReadLaneAt(data[dti.x].d.xyz, 0); + + data[dti.x].u = QuadReadLaneAt(data[dti.x].u, 1); + data[dti.x].u.x = QuadReadLaneAt(data[dti.x].u.x, 1); + data[dti.x].u.xy = QuadReadLaneAt(data[dti.x].u.xy, 1); + data[dti.x].u.xyz = QuadReadLaneAt(data[dti.x].u.xyz, 1); + + data[dti.x].i = QuadReadLaneAt(data[dti.x].i, 1); + data[dti.x].i.x = QuadReadLaneAt(data[dti.x].i.x, 1); + data[dti.x].i.xy = QuadReadLaneAt(data[dti.x].i.xy, 1); + data[dti.x].i.xyz = QuadReadLaneAt(data[dti.x].i.xyz, 1); + + data[dti.x].f = QuadReadLaneAt(data[dti.x].f, 1); + data[dti.x].f.x = QuadReadLaneAt(data[dti.x].f.x, 1); + data[dti.x].f.xy = QuadReadLaneAt(data[dti.x].f.xy, 1); + data[dti.x].f.xyz = QuadReadLaneAt(data[dti.x].f.xyz, 1); + + data[dti.x].d = QuadReadLaneAt(data[dti.x].d, 1); + data[dti.x].d.x = QuadReadLaneAt(data[dti.x].d.x, 1); + data[dti.x].d.xy = QuadReadLaneAt(data[dti.x].d.xy, 1); + data[dti.x].d.xyz = QuadReadLaneAt(data[dti.x].d.xyz, 1); + + data[dti.x].u = QuadReadLaneAt(data[dti.x].u, 2); + data[dti.x].u.x = QuadReadLaneAt(data[dti.x].u.x, 2); + data[dti.x].u.xy = QuadReadLaneAt(data[dti.x].u.xy, 2); + data[dti.x].u.xyz = QuadReadLaneAt(data[dti.x].u.xyz, 2); + + data[dti.x].i = QuadReadLaneAt(data[dti.x].i, 2); + data[dti.x].i.x = QuadReadLaneAt(data[dti.x].i.x, 2); + data[dti.x].i.xy = QuadReadLaneAt(data[dti.x].i.xy, 2); + data[dti.x].i.xyz = QuadReadLaneAt(data[dti.x].i.xyz, 2); + + data[dti.x].f = QuadReadLaneAt(data[dti.x].f, 2); + data[dti.x].f.x = QuadReadLaneAt(data[dti.x].f.x, 2); + data[dti.x].f.xy = QuadReadLaneAt(data[dti.x].f.xy, 2); + data[dti.x].f.xyz = QuadReadLaneAt(data[dti.x].f.xyz, 2); + + data[dti.x].d = QuadReadLaneAt(data[dti.x].d, 2); + data[dti.x].d.x = QuadReadLaneAt(data[dti.x].d.x, 2); + data[dti.x].d.xy = QuadReadLaneAt(data[dti.x].d.xy, 2); + data[dti.x].d.xyz = QuadReadLaneAt(data[dti.x].d.xyz, 2); + + data[dti.x].u = QuadReadLaneAt(data[dti.x].u, 3); + data[dti.x].u.x = QuadReadLaneAt(data[dti.x].u.x, 3); + data[dti.x].u.xy = QuadReadLaneAt(data[dti.x].u.xy, 3); + data[dti.x].u.xyz = QuadReadLaneAt(data[dti.x].u.xyz, 3); + + data[dti.x].i = QuadReadLaneAt(data[dti.x].i, 3); + data[dti.x].i.x = QuadReadLaneAt(data[dti.x].i.x, 3); + data[dti.x].i.xy = QuadReadLaneAt(data[dti.x].i.xy, 3); + data[dti.x].i.xyz = QuadReadLaneAt(data[dti.x].i.xyz, 3); + + data[dti.x].f = QuadReadLaneAt(data[dti.x].f, 3); + data[dti.x].f.x = QuadReadLaneAt(data[dti.x].f.x, 3); + data[dti.x].f.xy = QuadReadLaneAt(data[dti.x].f.xy, 3); + data[dti.x].f.xyz = QuadReadLaneAt(data[dti.x].f.xyz, 3); + + data[dti.x].d = QuadReadLaneAt(data[dti.x].d, 3); + data[dti.x].d.x = QuadReadLaneAt(data[dti.x].d.x, 3); + data[dti.x].d.xy = QuadReadLaneAt(data[dti.x].d.xy, 3); + data[dti.x].d.xyz = QuadReadLaneAt(data[dti.x].d.xyz, 3); + + data[dti.x].u = QuadReadAcrossX(data[dti.x].u); + data[dti.x].u.x = QuadReadAcrossX(data[dti.x].u.x); + data[dti.x].u.xy = QuadReadAcrossX(data[dti.x].u.xy); + data[dti.x].u.xyz = QuadReadAcrossX(data[dti.x].u.xyz); + + data[dti.x].i = QuadReadAcrossX(data[dti.x].i); + data[dti.x].i.x = QuadReadAcrossX(data[dti.x].i.x); + data[dti.x].i.xy = QuadReadAcrossX(data[dti.x].i.xy); + data[dti.x].i.xyz = QuadReadAcrossX(data[dti.x].i.xyz); + + data[dti.x].f = QuadReadAcrossX(data[dti.x].f); + data[dti.x].f.x = QuadReadAcrossX(data[dti.x].f.x); + data[dti.x].f.xy = QuadReadAcrossX(data[dti.x].f.xy); + data[dti.x].f.xyz = QuadReadAcrossX(data[dti.x].f.xyz); + + data[dti.x].d = QuadReadAcrossX(data[dti.x].d); + data[dti.x].d.x = QuadReadAcrossX(data[dti.x].d.x); + data[dti.x].d.xy = QuadReadAcrossX(data[dti.x].d.xy); + data[dti.x].d.xyz = QuadReadAcrossX(data[dti.x].d.xyz); + + data[dti.x].u = QuadReadAcrossY(data[dti.x].u); + data[dti.x].u.x = QuadReadAcrossY(data[dti.x].u.x); + data[dti.x].u.xy = QuadReadAcrossY(data[dti.x].u.xy); + data[dti.x].u.xyz = QuadReadAcrossY(data[dti.x].u.xyz); + + data[dti.x].i = QuadReadAcrossY(data[dti.x].i); + data[dti.x].i.x = QuadReadAcrossY(data[dti.x].i.x); + data[dti.x].i.xy = QuadReadAcrossY(data[dti.x].i.xy); + data[dti.x].i.xyz = QuadReadAcrossY(data[dti.x].i.xyz); + + data[dti.x].f = QuadReadAcrossY(data[dti.x].f); + data[dti.x].f.x = QuadReadAcrossY(data[dti.x].f.x); + data[dti.x].f.xy = QuadReadAcrossY(data[dti.x].f.xy); + data[dti.x].f.xyz = QuadReadAcrossY(data[dti.x].f.xyz); + + data[dti.x].d = QuadReadAcrossY(data[dti.x].d); + data[dti.x].d.x = QuadReadAcrossY(data[dti.x].d.x); + data[dti.x].d.xy = QuadReadAcrossY(data[dti.x].d.xy); + data[dti.x].d.xyz = QuadReadAcrossY(data[dti.x].d.xyz); + + data[dti.x].u = QuadReadAcrossDiagonal(data[dti.x].u); + data[dti.x].u.x = QuadReadAcrossDiagonal(data[dti.x].u.x); + data[dti.x].u.xy = QuadReadAcrossDiagonal(data[dti.x].u.xy); + data[dti.x].u.xyz = QuadReadAcrossDiagonal(data[dti.x].u.xyz); + + data[dti.x].i = QuadReadAcrossDiagonal(data[dti.x].i); + data[dti.x].i.x = QuadReadAcrossDiagonal(data[dti.x].i.x); + data[dti.x].i.xy = QuadReadAcrossDiagonal(data[dti.x].i.xy); + data[dti.x].i.xyz = QuadReadAcrossDiagonal(data[dti.x].i.xyz); + + data[dti.x].f = QuadReadAcrossDiagonal(data[dti.x].f); + data[dti.x].f.x = QuadReadAcrossDiagonal(data[dti.x].f.x); + data[dti.x].f.xy = QuadReadAcrossDiagonal(data[dti.x].f.xy); + data[dti.x].f.xyz = QuadReadAcrossDiagonal(data[dti.x].f.xyz); + + data[dti.x].d = QuadReadAcrossDiagonal(data[dti.x].d); + data[dti.x].d.x = QuadReadAcrossDiagonal(data[dti.x].d.x); + data[dti.x].d.xy = QuadReadAcrossDiagonal(data[dti.x].d.xy); + data[dti.x].d.xyz = QuadReadAcrossDiagonal(data[dti.x].d.xyz); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.wavequery.comp vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.wavequery.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.wavequery.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.wavequery.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,7 @@ +RWStructuredBuffer data; + +[numthreads(32, 16, 1)] +void CSMain() +{ + data[WaveGetLaneIndex()] = (WaveIsFirstLane()) ? WaveGetLaneCount() : 0; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.wavequery.frag vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.wavequery.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.wavequery.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.wavequery.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,11 @@ +float4 PixelShaderFunction() : COLOR0 +{ + if (WaveIsFirstLane()) + { + return float4(1, 2, 3, 4); + } + else + { + return float4(4, 3, 2, 1); + } +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.wavereduction.comp vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.wavereduction.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.wavereduction.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.wavereduction.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,125 @@ +struct Types +{ + uint4 u; + int4 i; + float4 f; + double4 d; +}; + +RWStructuredBuffer data; + +[numthreads(32, 16, 1)] +void CSMain(uint3 dti : SV_DispatchThreadID) +{ + data[dti.x].u = WaveActiveSum(data[dti.x].u); + data[dti.x].u.x = WaveActiveSum(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveSum(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveSum(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveSum(data[dti.x].i); + data[dti.x].i.x = WaveActiveSum(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveSum(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveSum(data[dti.x].i.xyz); + + data[dti.x].f = WaveActiveSum(data[dti.x].f); + data[dti.x].f.x = WaveActiveSum(data[dti.x].f.x); + data[dti.x].f.xy = WaveActiveSum(data[dti.x].f.xy); + data[dti.x].f.xyz = WaveActiveSum(data[dti.x].f.xyz); + + data[dti.x].d = WaveActiveSum(data[dti.x].d); + data[dti.x].d.x = WaveActiveSum(data[dti.x].d.x); + data[dti.x].d.xy = WaveActiveSum(data[dti.x].d.xy); + data[dti.x].d.xyz = WaveActiveSum(data[dti.x].d.xyz); + + data[dti.x].u = WaveActiveProduct(data[dti.x].u); + data[dti.x].u.x = WaveActiveProduct(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveProduct(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveProduct(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveProduct(data[dti.x].i); + data[dti.x].i.x = WaveActiveProduct(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveProduct(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveProduct(data[dti.x].i.xyz); + + data[dti.x].f = WaveActiveProduct(data[dti.x].f); + data[dti.x].f.x = WaveActiveProduct(data[dti.x].f.x); + data[dti.x].f.xy = WaveActiveProduct(data[dti.x].f.xy); + data[dti.x].f.xyz = WaveActiveProduct(data[dti.x].f.xyz); + + data[dti.x].d = WaveActiveProduct(data[dti.x].d); + data[dti.x].d.x = WaveActiveProduct(data[dti.x].d.x); + data[dti.x].d.xy = WaveActiveProduct(data[dti.x].d.xy); + data[dti.x].d.xyz = WaveActiveProduct(data[dti.x].d.xyz); + + data[dti.x].u = WaveActiveMin(data[dti.x].u); + data[dti.x].u.x = WaveActiveMin(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveMin(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveMin(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveMin(data[dti.x].i); + data[dti.x].i.x = WaveActiveMin(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveMin(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveMin(data[dti.x].i.xyz); + + data[dti.x].f = WaveActiveMin(data[dti.x].f); + data[dti.x].f.x = WaveActiveMin(data[dti.x].f.x); + data[dti.x].f.xy = WaveActiveMin(data[dti.x].f.xy); + data[dti.x].f.xyz = WaveActiveMin(data[dti.x].f.xyz); + + data[dti.x].d = WaveActiveMin(data[dti.x].d); + data[dti.x].d.x = WaveActiveMin(data[dti.x].d.x); + data[dti.x].d.xy = WaveActiveMin(data[dti.x].d.xy); + data[dti.x].d.xyz = WaveActiveMin(data[dti.x].d.xyz); + + data[dti.x].u = WaveActiveMax(data[dti.x].u); + data[dti.x].u.x = WaveActiveMax(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveMax(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveMax(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveMax(data[dti.x].i); + data[dti.x].i.x = WaveActiveMax(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveMax(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveMax(data[dti.x].i.xyz); + + data[dti.x].f = WaveActiveMax(data[dti.x].f); + data[dti.x].f.x = WaveActiveMax(data[dti.x].f.x); + data[dti.x].f.xy = WaveActiveMax(data[dti.x].f.xy); + data[dti.x].f.xyz = WaveActiveMax(data[dti.x].f.xyz); + + data[dti.x].d = WaveActiveMax(data[dti.x].d); + data[dti.x].d.x = WaveActiveMax(data[dti.x].d.x); + data[dti.x].d.xy = WaveActiveMax(data[dti.x].d.xy); + data[dti.x].d.xyz = WaveActiveMax(data[dti.x].d.xyz); + + data[dti.x].u = WaveActiveBitAnd(data[dti.x].u); + data[dti.x].u.x = WaveActiveBitAnd(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveBitAnd(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveBitAnd(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveBitAnd(data[dti.x].i); + data[dti.x].i.x = WaveActiveBitAnd(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveBitAnd(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveBitAnd(data[dti.x].i.xyz); + + data[dti.x].u = WaveActiveBitOr(data[dti.x].u); + data[dti.x].u.x = WaveActiveBitOr(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveBitOr(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveBitOr(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveBitOr(data[dti.x].i); + data[dti.x].i.x = WaveActiveBitOr(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveBitOr(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveBitOr(data[dti.x].i.xyz); + + data[dti.x].u = WaveActiveBitXor(data[dti.x].u); + data[dti.x].u.x = WaveActiveBitXor(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveBitXor(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveBitXor(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveBitXor(data[dti.x].i); + data[dti.x].i.x = WaveActiveBitXor(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveBitXor(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveBitXor(data[dti.x].i.xyz); + + data[dti.x].u.x = WaveActiveCountBits(data[dti.x].u.x == 0); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.wavevote.comp vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.wavevote.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.wavevote.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.wavevote.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,10 @@ +RWStructuredBuffer data; + +[numthreads(32, 16, 1)] +void CSMain(uint3 dti : SV_DispatchThreadID) +{ + data[dti.x] = WaveActiveBallot(WaveActiveAnyTrue(dti.x == 0)); + data[dti.y] = WaveActiveBallot(WaveActiveAllTrue(dti.y == 0)); + data[dti.z] = WaveActiveBallot(WaveActiveAllEqualBool(dti.z == 0)); + data[dti.z] = WaveActiveBallot(WaveActiveAllEqual(dti.z)); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.y-negate-1.vert vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.y-negate-1.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.y-negate-1.vert 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.y-negate-1.vert 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,9 @@ + +// Test Y negation from entry point return + +float4 pos; + +float4 main() : SV_Position +{ + return pos; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.y-negate-2.vert vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.y-negate-2.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.y-negate-2.vert 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.y-negate-2.vert 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,8 @@ +// Test Y negation from entry point out parameter + +float4 pos; + +void main(out float4 position : SV_Position) +{ + position = pos; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.y-negate-3.vert vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.y-negate-3.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/hlsl.y-negate-3.vert 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/hlsl.y-negate-3.vert 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,18 @@ +// Test Y negation from entry point out parameter + +float4 position; + +struct VS_OUT { + float4 pos : SV_Position; + int somethingelse; +}; + +VS_OUT main() +{ + VS_OUT vsout; + + vsout.pos = position; + vsout.somethingelse = 42; + + return vsout; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/implicitInnerAtomicUint.frag vulkan-1.1.73+dfsg/external/glslang/Test/implicitInnerAtomicUint.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/implicitInnerAtomicUint.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/implicitInnerAtomicUint.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,2 @@ +#version 460 +layout(binding = 0) uniform atomic_uint c[1][]; \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/link1.vk.frag vulkan-1.1.73+dfsg/external/glslang/Test/link1.vk.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/link1.vk.frag 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/link1.vk.frag 2018-04-27 11:46:26.000000000 +0000 @@ -2,9 +2,23 @@ vec4 getColor(); -out vec4 color; +layout(location=0) out vec4 color; + +int a1[]; // max size from link1 +int a2[]; // max size from link2 +int b[5]; +int c[]; +int i; + +buffer bnameRuntime { float r[]; }; +buffer bnameImplicit { float m[]; }; void main() { color = getColor(); + + a1[8] = 1; + a2[1] = 1; + b[i] = 1; + c[3] = 1; } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/link2.vk.frag vulkan-1.1.73+dfsg/external/glslang/Test/link2.vk.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/link2.vk.frag 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/link2.vk.frag 2018-04-27 11:46:26.000000000 +0000 @@ -1,8 +1,23 @@ #version 450 -uniform sampler2D s2D; +layout(binding=1) uniform sampler2D s2D; + +int a1[]; // max size from link1 +int a2[]; // max size from link2 +int b[]; +int c[7]; +int i; + +buffer bnameRuntime { float r[]; }; +buffer bnameImplicit { float m[4]; }; vec4 getColor() { - return texture(s2D, vec2(0.5)); + a1[2] = 1; + a2[9] = 1; + b[2] = 1; + c[3] = 1; + c[i] = 1; + + return texture(s2D, vec2(0.5)); } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/matrix2.frag vulkan-1.1.73+dfsg/external/glslang/Test/matrix2.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/matrix2.frag 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/matrix2.frag 2018-04-27 11:46:26.000000000 +0000 @@ -47,4 +47,5 @@ FragColor *= inv4; FragColor = vec4(FragColor * matrixCompMult(un34, un34), FragColor.w); + m34 *= colorTransform; } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/matrixError.vert vulkan-1.1.73+dfsg/external/glslang/Test/matrixError.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/matrixError.vert 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/matrixError.vert 2018-04-27 11:46:26.000000000 +0000 @@ -19,4 +19,6 @@ m23.xy; // ERROR, can't use . gl_Position = vec4(m23 * m32 * v3, m24[2][4]); // ERROR, 2 and 4 are out of range + m23 *= m23; // ERROR, right side needs to be square + m23 *= m32; // ERROR, left columns must match right rows } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/mixedArrayDecls.frag vulkan-1.1.73+dfsg/external/glslang/Test/mixedArrayDecls.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/mixedArrayDecls.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/mixedArrayDecls.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,30 @@ +#version 450 + +struct S { + int[3] a[2], b[5]; +}; + +S s; + +int[5] c[4], d[8]; +int[9] e[], f[]; +int e[11][9]; +int f[13][9]; + +int[14] g[], h[]; + +int [14][15][6] foo(int[6] p[14][15]) { return p; } + +void main() +{ + g[3]; + h[2]; +} + +float[4][3][2] bar() { float[3][2] a[4]; return a; } + +in inbname { + float[7] f[8][9]; +} inbinst[4][5][6]; + +float[3][2] barm[4]() { float[3][2] a[4]; return a; } // ERROR diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/nonuniform.frag vulkan-1.1.73+dfsg/external/glslang/Test/nonuniform.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/nonuniform.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/nonuniform.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,33 @@ +#version 450 + +int nonuniformEXT; + +#extension GL_EXT_nonuniform_qualifier : enable + +nonuniformEXT in vec4 nu_inv4; +nonuniformEXT float nu_gf; + +nonuniformEXT out vec4 nu_outv4; // ERROR, out +nonuniformEXT uniform vec4 nu_uv4; // ERROR, uniform +nonuniformEXT const float nu_constf = 1.0; // ERROR, const + +nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f) +{ + return nupi; +} + +void main() +{ + nonuniformEXT int nu_li; + nonuniformEXT const int nu_ci = 2; // ERROR, const + + foo(nu_li, nu_li); + + int a; + nu_li = nonuniformEXT(a) + nonuniformEXT(a * 2); + nu_li = nonuniformEXT(a, a); // ERROR, too many arguments + nu_li = nonuniformEXT(); // ERROR, no arguments +} + +layout(location=1) in struct S { float a; nonuniformEXT float b; } ins; // ERROR, not on member +layout(location=3) in inbName { float a; nonuniformEXT float b; } inb; // ERROR, not on member diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/nvShaderNoperspectiveInterpolation.frag vulkan-1.1.73+dfsg/external/glslang/Test/nvShaderNoperspectiveInterpolation.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/nvShaderNoperspectiveInterpolation.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/nvShaderNoperspectiveInterpolation.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,15 @@ +#version 300 es + +precision mediump float; + +noperspective in vec4 bad; // ERROR + +#extension GL_NV_shader_noperspective_interpolation : enable + +noperspective in vec4 color; + +out vec4 fragColor; + +void main() { + fragColor = color; +} \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/preprocessor.pragma.vert vulkan-1.1.73+dfsg/external/glslang/Test/preprocessor.pragma.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/preprocessor.pragma.vert 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/preprocessor.pragma.vert 2018-04-27 11:46:26.000000000 +0000 @@ -7,5 +7,7 @@ #pragma undefined_pragma(x, 4) +#pragma once + int main() { } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/runtests vulkan-1.1.73+dfsg/external/glslang/Test/runtests --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/runtests 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/runtests 2018-04-27 11:46:26.000000000 +0000 @@ -32,11 +32,11 @@ echo Running reflection... $EXE -l -q -C reflection.vert > $TARGETDIR/reflection.vert.out diff -b $BASEDIR/reflection.vert.out $TARGETDIR/reflection.vert.out || HASERROR=1 -$EXE -D -e flizv -l -q -C -V -Od hlsl.reflection.vert > $TARGETDIR/hlsl.reflection.vert.out +$EXE -D -Od -e flizv -l -q -C -V -Od hlsl.reflection.vert > $TARGETDIR/hlsl.reflection.vert.out diff -b $BASEDIR/hlsl.reflection.vert.out $TARGETDIR/hlsl.reflection.vert.out || HASERROR=1 -$EXE -D -e main -l -q -C -V -Od hlsl.reflection.binding.frag > $TARGETDIR/hlsl.reflection.binding.frag.out +$EXE -D -Od -e main -l -q -C -V -Od hlsl.reflection.binding.frag > $TARGETDIR/hlsl.reflection.binding.frag.out diff -b $BASEDIR/hlsl.reflection.binding.frag.out $TARGETDIR/hlsl.reflection.binding.frag.out || HASERROR=1 -$EXE -D -e main -l -q --hlsl-iomap --auto-map-bindings --stb 10 --sbb 20 --ssb 30 --suavb 40 --scb 50 -D -V -e main -Od hlsl.automap.frag > $TARGETDIR/hlsl.automap.frag.out +$EXE -D -Od -e main -l -q --hlsl-iomap --auto-map-bindings --stb 10 --sbb 20 --ssb 30 --suavb 40 --scb 50 -D -V -e main -Od hlsl.automap.frag > $TARGETDIR/hlsl.automap.frag.out diff -b $BASEDIR/hlsl.automap.frag.out $TARGETDIR/hlsl.automap.frag.out || HASERROR=1 # @@ -56,14 +56,14 @@ # entry point renaming tests # echo Running entry-point renaming tests -$EXE -i -H -V -D -e main_in_spv --ku --source-entrypoint main -Od hlsl.entry.rename.frag > $TARGETDIR/hlsl.entry.rename.frag.out +$EXE -i -H -V -D -Od -e main_in_spv --ku --source-entrypoint main -Od hlsl.entry.rename.frag > $TARGETDIR/hlsl.entry.rename.frag.out diff -b $BASEDIR/hlsl.entry.rename.frag.out $TARGETDIR/hlsl.entry.rename.frag.out || HASERROR=1 # # Testing ill-defined uncalled function # echo Running ill-defined uncalled function -$EXE -D -e main -H -Od hlsl.deadFunctionMissingBody.vert > $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out +$EXE -D -Od -e main -H -Od hlsl.deadFunctionMissingBody.vert > $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out diff -b $BASEDIR/hlsl.deadFunctionMissingBody.vert.out $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out || HASERROR=1 if [ $HASERROR -eq 0 ] @@ -88,27 +88,27 @@ diff -b $BASEDIR/spv.hlslOffsets.vert.out $TARGETDIR/spv.hlslOffsets.vert.out || HASERROR=1 echo Running hlsl offsets -$EXE -i --hlsl-offsets -D -e main -H -Od hlsl.hlslOffset.vert > $TARGETDIR/hlsl.hlslOffset.vert.out +$EXE -i --hlsl-offsets -D -Od -e main -H -Od hlsl.hlslOffset.vert > $TARGETDIR/hlsl.hlslOffset.vert.out diff -b $BASEDIR/hlsl.hlslOffset.vert.out $TARGETDIR/hlsl.hlslOffset.vert.out || HASERROR=1 # # Testing --resource-set-binding # echo Configuring HLSL descriptor set and binding number manually -$EXE -V -D -e main -H -Od hlsl.multiDescriptorSet.frag --rsb frag t0 0 0 t1 1 0 s0 0 1 s1 1 1 b0 2 0 b1 2 1 b2 2 2 > $TARGETDIR/hlsl.multiDescriptorSet.frag.out +$EXE -V -D -Od -e main -H -Od hlsl.multiDescriptorSet.frag --rsb frag t0 0 0 t1 1 0 s0 0 1 s1 1 1 b0 2 0 b1 2 1 b2 2 2 > $TARGETDIR/hlsl.multiDescriptorSet.frag.out diff -b $BASEDIR/hlsl.multiDescriptorSet.frag.out $TARGETDIR/hlsl.multiDescriptorSet.frag.out || HASERROR=1 -$EXE -V -D -e main -H -Od hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb 4 > $TARGETDIR/hlsl.explicitDescriptorSet.frag.out +$EXE -V -D -Od -e main -H -Od hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb 4 > $TARGETDIR/hlsl.explicitDescriptorSet.frag.out diff -b $BASEDIR/hlsl.explicitDescriptorSet.frag.out $TARGETDIR/hlsl.explicitDescriptorSet.frag.out || HASERROR=1 -$EXE -V -D -e main -H -Od hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb frag 3 > $TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out +$EXE -V -D -Od -e main -H -Od hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb frag 3 > $TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out diff -b $BASEDIR/hlsl.explicitDescriptorSet-2.frag.out $TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out || HASERROR=1 # # Testing per-descriptor-set IO map shift # echo 'Testing per-descriptor-set IO map shift' -$EXE -e main --hlsl-iomap --ssb 1 10 2 15 --stb 20 --stb 2 25 --suavb 30 --suavb 2 40 --sub 6 50 -i -q -D -V hlsl.shift.per-set.frag > $TARGETDIR/hlsl.shift.per-set.frag.out || HASERROR=1 +$EXE -e main --hlsl-iomap --ssb 10 1 15 2 --stb 20 --stb 25 2 --suavb 30 --suavb 40 2 --sub 50 6 -i -q -D -Od -V hlsl.shift.per-set.frag > $TARGETDIR/hlsl.shift.per-set.frag.out || HASERROR=1 diff -b $BASEDIR/hlsl.shift.per-set.frag.out $TARGETDIR/hlsl.shift.per-set.frag.out || HASERROR=1 # @@ -126,10 +126,13 @@ # Testing debug information # echo Testing SPV Debug Information -$EXE -g --relaxed-errors --suppress-warnings --aml --hlsl-offsets --nsf \ +$EXE -g --relaxed-errors --suppress-warnings --aml --amb --hlsl-offsets --nsf \ -G -H spv.debugInfo.frag --rsb frag 3 > $TARGETDIR/spv.debugInfo.frag.out diff -b $BASEDIR/spv.debugInfo.frag.out $TARGETDIR/spv.debugInfo.frag.out || HASERROR=1 -$EXE -g -D -e newMain -g --amb --aml --fua --hlsl-iomap --nsf --sib 1 --ssb 2 --sbb 3 --stb 4 --suavb 5 --sub 6 \ +$EXE -g -Od --target-env vulkan1.1 --relaxed-errors --suppress-warnings --aml --hlsl-offsets --nsf \ + -G -H spv.debugInfo.frag --rsb frag 3 > $TARGETDIR/spv.debugInfo.1.1.frag.out +diff -b $BASEDIR/spv.debugInfo.1.1.frag.out $TARGETDIR/spv.debugInfo.1.1.frag.out || HASERROR=1 +$EXE -g -D -Od -e newMain -g --amb --aml --fua --hlsl-iomap --nsf --sib 1 --ssb 2 --sbb 3 --stb 4 --suavb 5 --sub 6 \ --sep origMain -H -Od spv.hlslDebugInfo.vert --rsb vert t0 0 0 > $TARGETDIR/spv.hlslDebugInfo.frag.out diff -b $BASEDIR/spv.hlslDebugInfo.frag.out $TARGETDIR/spv.hlslDebugInfo.frag.out || HASERROR=1 @@ -137,13 +140,13 @@ # Testing Includer # echo Testing Includer -$EXE -D -e main -H -Od ../Test/hlsl.include.vert > $TARGETDIR/hlsl.include.vert.out +$EXE -D -Od -e main -H -Od ../Test/hlsl.include.vert > $TARGETDIR/hlsl.include.vert.out diff -b $BASEDIR/hlsl.include.vert.out $TARGETDIR/hlsl.include.vert.out || HASERROR=1 -$EXE -D -e main -H -Od hlsl.includeNegative.vert > $TARGETDIR/hlsl.includeNegative.vert.out +$EXE -D -Od -e main -H -Od hlsl.includeNegative.vert > $TARGETDIR/hlsl.includeNegative.vert.out diff -b $BASEDIR/hlsl.includeNegative.vert.out $TARGETDIR/hlsl.includeNegative.vert.out || HASERROR=1 $EXE -l -i include.vert > $TARGETDIR/include.vert.out diff -b $BASEDIR/include.vert.out $TARGETDIR/include.vert.out || HASERROR=1 -$EXE -D -e main -H -Od -Iinc1/path1 -Iinc1/path2 hlsl.dashI.vert > $TARGETDIR/hlsl.dashI.vert.out +$EXE -D -Od -e main -H -Od -Iinc1/path1 -Iinc1/path2 hlsl.dashI.vert > $TARGETDIR/hlsl.dashI.vert.out diff -b $BASEDIR/hlsl.dashI.vert.out $TARGETDIR/hlsl.dashI.vert.out || HASERROR=1 # @@ -152,7 +155,7 @@ echo "Testing -D and -U" $EXE -DUNDEFED -UIN_SHADER -DFOO=200 -i -l -UUNDEFED -DMUL=FOO*2 glsl.-D-U.frag > $TARGETDIR/glsl.-D-U.frag.out diff -b $BASEDIR/glsl.-D-U.frag.out $TARGETDIR/glsl.-D-U.frag.out || HASERROR=1 -$EXE -D -e main -V -i -DUNDEFED -UIN_SHADER -DFOO=200 -UUNDEFED -Od hlsl.-D-U.frag > $TARGETDIR/hlsl.-D-U.frag.out +$EXE -D -Od -e main -V -i -DUNDEFED -UIN_SHADER -DFOO=200 -UUNDEFED -Od hlsl.-D-U.frag > $TARGETDIR/hlsl.-D-U.frag.out diff -b $BASEDIR/hlsl.-D-U.frag.out $TARGETDIR/hlsl.-D-U.frag.out || HASERROR=1 # @@ -162,6 +165,7 @@ $EXE --client vulkan100 spv.targetVulkan.vert || HASERROR=1 $EXE --client opengl100 spv.targetOpenGL.vert || HASERROR=1 $EXE --target-env vulkan1.0 spv.targetVulkan.vert || HASERROR=1 +$EXE --target-env vulkan1.1 spv.targetVulkan.vert || HASERROR=1 $EXE --target-env opengl spv.targetOpenGL.vert || HASERROR=1 $EXE -V100 spv.targetVulkan.vert || HASERROR=1 $EXE -G100 spv.targetOpenGL.vert || HASERROR=1 @@ -187,6 +191,27 @@ diff -b $BASEDIR/remap.invalid-spirv-2.out $TARGETDIR/remap.invalid-spirv-2.out || HASERROR=1 # +# Testing position Y inversion +# +echo "Testing position Y inversion" +$EXE -H -e main -V -D -Od -H -i --iy hlsl.y-negate-1.vert > $TARGETDIR/hlsl.y-negate-1.vert.out +diff -b $BASEDIR/hlsl.y-negate-1.vert.out $TARGETDIR/hlsl.y-negate-1.vert.out || HASERROR=1 +$EXE -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-2.vert > $TARGETDIR/hlsl.y-negate-2.vert.out +diff -b $BASEDIR/hlsl.y-negate-2.vert.out $TARGETDIR/hlsl.y-negate-2.vert.out || HASERROR=1 +$EXE -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-3.vert > $TARGETDIR/hlsl.y-negate-3.vert.out +diff -b $BASEDIR/hlsl.y-negate-3.vert.out $TARGETDIR/hlsl.y-negate-3.vert.out || HASERROR=1 + +# +# Testing hlsl_functionality1 +# +$EXE -H -e main -D -Od -fhlsl_functionality1 hlsl.structbuffer.incdec.frag > \ + $TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out +diff -b $BASEDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out $TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out || HASERROR=1 +$EXE -H -e main -D -Od -fhlsl_functionality1 hlsl.noSemantic.functionality1.comp > \ + $TARGETDIR/hlsl.noSemantic.functionality1.comp.out +diff -b $BASEDIR/hlsl.noSemantic.functionality1.comp.out $TARGETDIR/hlsl.noSemantic.functionality1.comp.out || HASERROR=1 + +# # Final checking # if [ $HASERROR -eq 0 ] diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/runtimeArray.vert vulkan-1.1.73+dfsg/external/glslang/Test/runtimeArray.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/runtimeArray.vert 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/runtimeArray.vert 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,108 @@ +#version 450 core + +buffer bn { + int a[]; + float b[]; +} buf; + +uniform un { + int a[]; + float b[]; +} ubuf; + +buffer bna { + int a[]; + float b[]; +} bufa[4]; + +uniform una { + int a[]; + float b[]; +} ubufa[4]; + +buffer abn { + int aba[]; + float abb[]; +}; + +uniform aun { + int aua[]; + float aub[]; +}; + +layout(binding=1) uniform samplerBuffer uniformTexelBufferDyn[]; +layout(binding=2, r32f) uniform imageBuffer storageTexelBufferDyn[]; +layout(binding=3) uniform uname { float a; } uniformBuffer[]; +layout(binding=4) buffer bname { float b; } storageBuffer[]; +layout(binding=5) uniform sampler2D sampledImage[]; +layout(binding=6, r32f) uniform image2D storageImage[]; +layout(binding=8) uniform samplerBuffer uniformTexelBuffer[]; +layout(binding=9, r32f) uniform imageBuffer storageTexelBuffer[]; + +int i; + +void main() +{ + ubuf.a[3]; + ubuf.b[3]; + buf.a[3]; + buf.b[3]; + + ubufa[3].a[3]; + ubufa[3].b[3]; + bufa[3].a[3]; + bufa[3].b[3]; + + aua[3]; + aub[3]; + aba[3]; + abb[3]; + + ubuf.a[i]; // ERROR + ubuf.b[i]; // ERROR + buf.a[i]; // ERROR + buf.b[i]; + + ubuf.a.length(); // ERROR + ubuf.b.length(); // ERROR + buf.a.length(); // ERROR + buf.b.length(); + + ubufa[1].a[i]; // ERROR + ubufa[1].b[i]; // ERROR + bufa[1].a[i]; // ERROR + bufa[1].b[i]; + + ubufa[1].a.length(); // ERROR + ubufa[1].b.length(); // ERROR + bufa[1].a.length(); // ERROR + bufa[1].b.length(); + + aua[i]; // ERROR + aub[i]; // ERROR + aba[i]; // ERROR + abb[i]; + + aua.length(); // ERROR + aub.length(); // ERROR + aba.length(); // ERROR + abb.length(); + + uniformTexelBufferDyn[1]; + storageTexelBufferDyn[1]; + uniformBuffer[1]; + storageBuffer[1]; + sampledImage[1]; + storageImage[1]; + uniformTexelBuffer[1]; + storageTexelBuffer[1]; + + uniformTexelBufferDyn[i]; // ERROR, need extension + storageTexelBufferDyn[i]; // ERROR, need extension + uniformBuffer[i]; // ERROR, need extension + storageBuffer[i]; // ERROR, need extension + sampledImage[i]; // ERROR, need extension + storageImage[i]; // ERROR, need extension + uniformTexelBuffer[i]; // ERROR, need extension + storageTexelBuffer[i]; // ERROR, need extension +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.310.comp vulkan-1.1.73+dfsg/external/glslang/Test/spv.310.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.310.comp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.310.comp 2018-04-27 11:46:26.000000000 +0000 @@ -37,4 +37,6 @@ outnames.va[gl_LocalInvocationID.x] = vec4(s); outnames.s = outbname.uns.length(); gl_DeviceIndex; + memoryBarrierShared(); + groupMemoryBarrier(); } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.accessChain.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.accessChain.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.accessChain.frag 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.accessChain.frag 2018-04-27 11:46:26.000000000 +0000 @@ -74,6 +74,11 @@ OutColor.zy[comp] += i.color.x; } +void GetColor14(const S i, int comp) +{ + OutColor.zyx[comp] = i.color.x; +} + void main() { S s; @@ -91,4 +96,5 @@ GetColor11(s, u); GetColor12(s, u); GetColor13(s, u); + GetColor14(s, u); } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.atomicInt64.comp vulkan-1.1.73+dfsg/external/glslang/Test/spv.atomicInt64.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.atomicInt64.comp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.atomicInt64.comp 2018-04-27 11:46:26.000000000 +0000 @@ -22,7 +22,7 @@ void main() { const int64_t i64c = -24; - const uint64_t u64c = 0xF00000000F; + const uint64_t u64c = 0xF00000000Ful; // Test shader storage block int64_t i64 = 0; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.barrier.vert vulkan-1.1.73+dfsg/external/glslang/Test/spv.barrier.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.barrier.vert 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.barrier.vert 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,15 @@ +#version 450 + +layout(location=0) out vec4 c0; +layout(location=1) out vec4 c1; + +void main() +{ + c0 = vec4(1.0); + memoryBarrier(); + c1 = vec4(1.0); + memoryBarrierBuffer(); + ++c0; + memoryBarrierImage(); + ++c0; +} \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.builtInXFB.vert vulkan-1.1.73+dfsg/external/glslang/Test/spv.builtInXFB.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.builtInXFB.vert 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.builtInXFB.vert 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,15 @@ +#version 450 + +layout(xfb_buffer = 1, xfb_stride = 64) out; + +layout (xfb_buffer = 1, xfb_offset = 16) out gl_PerVertex +{ + float gl_PointSize; + vec4 gl_Position; +}; + +void main() +{ + gl_Position = vec4(1.0); + gl_PointSize = 2.0; +} \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.constStruct.vert vulkan-1.1.73+dfsg/external/glslang/Test/spv.constStruct.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.constStruct.vert 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.constStruct.vert 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,22 @@ +#version 450 + +precision highp float; + +struct U { + mat2 m; +}; + +struct T { + mat2 m; +}; + +struct S { + T t; + U u; +}; + +void main() +{ + S s1 = S(T(mat2(1.0)), U(mat2(1.0))); + S s2 = S(T(mat2(1.0)), U(mat2(1.0))); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.controlFlowAttributes.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.controlFlowAttributes.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.controlFlowAttributes.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.controlFlowAttributes.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,39 @@ +#version 450 + +#extension GL_EXT_control_flow_attributes : enable + +bool cond; + +void main() +{ + [[unroll]] for (int i = 0; i < 8; ++i) { } + [[loop]] for (;;) { } + [[dont_unroll]] while(true) { } + [[dependency_infinite]] do { } while(true); + [[dependency_length(1+3)]] for (int i = 0; i < 8; ++i) { } + [[flatten]] if (cond) { } else { } + [[branch]] if (cond) cond = false; + [[dont_flatten]] switch(3) { } // dropped + [[dont_flatten]] switch(3) { case 3: break; } + + // warnings on all these + [[unroll(2)]] for (int i = 0; i < 8; ++i) { } + [[dont_unroll(-2)]] while(true) { } + [[dependency_infinite(3)]] do { } while(true); + [[dependency_length]] for (int i = 0; i < 8; ++i) { } + [[flatten(3)]] if (cond) { } else { } + [[branch(5.2)]] if (cond) cond = false; + [[dont_flatten(3 + 7)]] switch(3) { case 3: break; } + + // other valid uses + [[ unroll, dont_unroll, dependency_length(2) ]] while(cond) { } + [ [ dont_flatten , branch ] ] switch(3) { case 3: break; } + [ + // attribute + [ + // here + flatten + ] + ] if (cond) { } else { } + [[ dependency_length(2), dependency_infinite ]] while(cond) { } +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.explicittypes.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.explicittypes.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.explicittypes.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.explicittypes.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,334 @@ +#version 450 + +#extension GL_KHX_shader_explicit_arithmetic_types: enable +#extension GL_KHX_shader_explicit_arithmetic_types_int8: require +#extension GL_KHX_shader_explicit_arithmetic_types_int16: require +#extension GL_KHX_shader_explicit_arithmetic_types_int32: require +#extension GL_KHX_shader_explicit_arithmetic_types_int64: require +#extension GL_KHX_shader_explicit_arithmetic_types_float16: require +#extension GL_KHX_shader_explicit_arithmetic_types_float32: require +#extension GL_KHX_shader_explicit_arithmetic_types_float64: require + +layout(binding = 0) uniform Uniforms +{ + uint index; +}; + +layout(std140, binding = 1) uniform Block +{ + int16_t i16; + i16vec2 i16v2; + i16vec3 i16v3; + i16vec4 i16v4; + uint16_t u16; + u16vec2 u16v2; + u16vec3 u16v3; + u16vec4 u16v4; + + int32_t i32; + i32vec2 i32v2; + i32vec3 i32v3; + i32vec4 i32v4; + uint32_t u32; + u32vec2 u32v2; + u32vec3 u32v3; + u32vec4 u32v4; +} block; + +void main() +{ +} + +void literal() +{ + const int64_t i64Const[3] = + { + -0x1111111111111111l, // Hex + -1l, // Dec + 040000000000l, // Oct + }; + + int64_t i64 = i64Const[index]; + + const uint64_t u64Const[] = + { + 0xFFFFFFFFFFFFFFFFul, // Hex + 4294967296UL, // Dec + 077777777777ul, // Oct + }; + + uint64_t u64 = u64Const[index]; + + const int32_t i32Const[3] = + { + -0x11111111, // Hex + -1, // Dec + 04000000000, // Oct + }; + + int32_t i32 = i32Const[index]; + + const uint32_t u32Const[] = + { + 0xFFFFFFFF, // Hex + 4294967295, // Dec + 017777777777, // Oct + }; + + uint32_t u32 = u32Const[index]; + + const int16_t i16Const[3] = + { + int16_t(-0x1111), // Hex + int16_t(-1), // Dec + int16_t(040000), // Oct + }; + + int16_t i16 = i16Const[index]; + + const uint16_t u16Const[] = + { + uint16_t(0xFFFF), // Hex + uint16_t(65535), // Dec + uint16_t(077777), // Oct + }; + + uint16_t u16 = u16Const[index]; + + const int8_t i8Const[3] = + { + int8_t(-0x11), // Hex + int8_t(-1), // Dec + int8_t(0400), // Oct + }; + + int8_t i8 = i8Const[index]; + + const uint8_t u8Const[] = + { + uint8_t(0xFF), // Hex + uint8_t(255), // Dec + uint8_t(0177), // Oct + }; + + uint8_t u8 = u8Const[index]; +} + +void typeCast8() +{ + i8vec2 i8v; + u8vec2 u8v; + i16vec2 i16v; + u16vec2 u16v; + i32vec2 i32v; + u32vec2 u32v; + i64vec2 i64v; + u64vec2 u64v; + f16vec2 f16v; + f32vec2 f32v; + f64vec2 f64v; + bvec2 bv; + + u8v = i8v; // int8_t -> uint8_t + i16v = i8v; // int8_t -> int16_t + i16v = u8v; // uint8_t -> int16_t + i32v = i8v; // int8_t -> int32_t + i32v = u8v; // uint8_t -> int32_t + u32v = i8v; // int8_t -> uint32_t + i64v = i8v; // int8_t -> int64_t + u64v = i8v; // int8_t -> uint64_t + u32v = u8v; // uint8_t -> uint32_t + i64v = u8v; // uint8_t -> int64_t + u64v = u8v; // uint8_t -> uint64_t + f16v = i8v; // int8_t -> float16_t + f32v = i8v; // int8_t -> float32_t + f64v = i8v; // int8_t -> float64_t + f16v = u8v; // uint8_t -> float16_t + f32v = u8v; // uint8_t -> float32_t + f64v = u8v; // uint8_t -> float64_t + + i8v = i8vec2(u8v); // uint8_t -> int8_t + i16v = i16vec2(i8v); // int8_t -> int16_t + i16v = i16vec2(u8v); // uint8_t -> int16_t + i32v = i32vec2(i8v); // int8_t -> int32_t + i32v = i32vec2(u8v); // uint8_t -> int32_t + i64v = i64vec2(i8v); // int8_t -> int64_t + u64v = i64vec2(i8v); // int8_t -> uint64_t + u16v = u16vec2(i8v); // int8_t -> uint16_t + u16v = u16vec2(u8v); // uint8_t -> uint16_t + u32v = u32vec2(u8v); // uint8_t -> uint32_t + i64v = i64vec2(u8v); // uint8_t -> int64_t + u64v = i64vec2(u8v); // uint8_t -> uint64_t + f16v = f16vec2(i8v); // int8_t -> float16_t + f32v = f32vec2(i8v); // int8_t -> float32_t + f64v = f64vec2(i8v); // int8_t -> float64_t + f16v = f16vec2(u8v); // uint8_t -> float16_t + f32v = f32vec2(u8v); // uint8_t -> float32_t + f64v = f64vec2(u8v); // uint8_t -> float64_t + + i8v = i8vec2(bv); // bool -> int8 + u8v = u8vec2(bv); // bool -> uint8 + bv = bvec2(i8v); // int8 -> bool + bv = bvec2(u8v); // uint8 -> bool +} + +void typeCast16() +{ + i8vec2 i8v; + u8vec2 u8v; + i16vec2 i16v; + u16vec2 u16v; + i32vec2 i32v; + u32vec2 u32v; + i64vec2 i64v; + u64vec2 u64v; + f16vec2 f16v; + f32vec2 f32v; + f64vec2 f64v; + bvec2 bv; + + i32v = i16v; // int16_t -> int32_t + i32v = u16v; // uint16_t -> int32_t + u16v = i16v; // int16_t -> uint16_t + u32v = i16v; // int16_t -> uint32_t + i64v = i16v; // int16_t -> int64_t + u64v = i16v; // int16_t -> uint64_t + u32v = u16v; // uint16_t -> uint32_t + i64v = u16v; // uint16_t -> int64_t + u64v = u16v; // uint16_t -> uint64_t + f16v = i16v; // int16_t -> float16_t + f32v = i16v; // int16_t -> float32_t + f64v = i16v; // int16_t -> float64_t + f16v = u16v; // uint16_t -> float16_t + f32v = u16v; // uint16_t -> float32_t + f64v = u16v; // uint16_t -> float64_t + + i32v = i32vec2(i16v); // int16_t -> int32_t + i32v = i32vec2(u16v); // uint16_t -> int32_t + u16v = u16vec2(i16v); // int16_t -> uint16_t + u32v = u32vec2(i16v); // int16_t -> uint32_t + i64v = i64vec2(i16v); // int16_t -> int64_t + u64v = i64vec2(i16v); // int16_t -> uint64_t + u32v = u32vec2(u16v); // uint16_t -> uint32_t + i64v = i64vec2(u16v); // uint16_t -> int64_t + u64v = i64vec2(u16v); // uint16_t -> uint64_t + f16v = f16vec2(i16v); // int16_t -> float16_t + f32v = f32vec2(i16v); // int16_t -> float32_t + f64v = f64vec2(i16v); // int16_t -> float64_t + f16v = f16vec2(u16v); // uint16_t -> float16_t + f32v = f32vec2(u16v); // uint16_t -> float32_t + f64v = f64vec2(u16v); // uint16_t -> float64_t + + i8v = i8vec2(i16v); // int16_t -> int8_t + i8v = i8vec2(u16v); // uint16_t -> int8_t + u8v = u8vec2(i16v); // int16_t -> uint8_t + u8v = u8vec2(u16v); // uint16_t -> uint8_t + i16v = u8vec2(u16v); // uint16_t -> int16_t + i16v = i16vec2(bv); // bool -> int16 + u16v = u16vec2(bv); // bool -> uint16 + bv = bvec2(i16v); // int16 -> bool + bv = bvec2(u16v); // uint16 -> bool +} + +void typeCast32() +{ + i8vec2 i8v; + u8vec2 u8v; + i16vec2 i16v; + u16vec2 u16v; + i32vec2 i32v; + u32vec2 u32v; + i64vec2 i64v; + u64vec2 u64v; + f16vec2 f16v; + f32vec2 f32v; + f64vec2 f64v; + bvec2 bv; + + u32v = i32v; // int32_t -> uint32_t + i64v = i32v; // int32_t -> int64_t + u64v = i32v; // int32_t -> uint64_t + i64v = u32v; // uint32_t -> int64_t + u64v = u32v; // uint32_t -> uint64_t + f32v = i32v; // int32_t -> float32_t + f64v = i32v; // int32_t -> float64_t + f32v = u32v; // uint32_t -> float32_t + f64v = u32v; // uint32_t -> float64_t + + i8v = i8vec2(i32v); // int32_t -> int8_t + i8v = i8vec2(u32v); // uint32_t -> int8_t + i16v = i16vec2(i32v); // int32_t -> int16_t + i16v = i16vec2(u32v); // uint32_t -> int16_t + i32v = i32vec2(i32v); // int32_t -> int32_t + i32v = i32vec2(u32v); // uint32_t -> int32_t + i64v = i64vec2(i32v); // int32_t -> int64_t + i64v = i64vec2(u32v); // uint32_t -> int64_t + u8v = u8vec2(i32v); // int32_t -> uint8_t + u8v = u8vec2(u32v); // uint32_t -> uint8_t + u16v = u16vec2(i32v); // int32_t -> uint16_t + u16v = u16vec2(u32v); // uint32_t -> uint16_t + u32v = u32vec2(i32v); // int32_t -> uint32_t + u32v = u32vec2(u32v); // uint32_t -> uint32_t + u64v = u64vec2(i32v); // int32_t -> uint64_t + u64v = u64vec2(u32v); // uint32_t -> uint64_t + + f16v = f16vec2(i32v); // int32_t -> float16_t + f32v = f32vec2(i32v); // int32_t -> float32_t + f64v = f64vec2(i32v); // int32_t -> float64_t + f16v = f16vec2(u32v); // uint32_t -> float16_t + f32v = f32vec2(u32v); // uint32_t -> float32_t + f64v = f64vec2(u32v); // uint32_t -> float64_t + + i32v = i32vec2(bv); // bool -> int32 + u32v = u32vec2(bv); // bool -> uint32 + bv = bvec2(i32v); // int32 -> bool + bv = bvec2(u32v); // uint32 -> bool +} + +void typeCast64() +{ + i8vec2 i8v; + u8vec2 u8v; + i16vec2 i16v; + u16vec2 u16v; + i32vec2 i32v; + u32vec2 u32v; + i64vec2 i64v; + u64vec2 u64v; + f16vec2 f16v; + f32vec2 f32v; + f64vec2 f64v; + bvec2 bv; + + u64v = i64v; // int64_t -> uint64_t + f64v = i64v; // int64_t -> float64_t + f64v = u64v; // uint64_t -> float64_t + + i8v = i8vec2(i64v); // int64_t -> int8_t + i8v = i8vec2(u64v); // uint64_t -> int8_t + i16v = i16vec2(i64v); // int64_t -> int16_t + i16v = i16vec2(u64v); // uint64_t -> int16_t + i32v = i32vec2(i64v); // int64_t -> int32_t + i32v = i32vec2(u64v); // uint64_t -> int32_t + i64v = i64vec2(u64v); // uint64_t -> int64_t + u8v = u8vec2(i64v); // int64_t -> uint8_t + u8v = u8vec2(u64v); // uint64_t -> uint8_t + u16v = u16vec2(i64v); // int64_t -> uint16_t + u16v = u16vec2(u64v); // uint64_t -> uint16_t + u32v = u32vec2(i64v); // int64_t -> uint32_t + u32v = u32vec2(u64v); // uint64_t -> uint32_t + u64v = u64vec2(i64v); // int64_t -> uint64_t + u64v = u64vec2(u64v); // uint64_t -> uint64_t + + f16v = f16vec2(i64v); // int64_t -> float16_t + f32v = f32vec2(i64v); // int64_t -> float32_t + f64v = f64vec2(i64v); // int64_t -> float64_t + f16v = f16vec2(u64v); // uint64_t -> float16_t + f32v = f32vec2(u64v); // uint64_t -> float32_t + f64v = f64vec2(u64v); // uint64_t -> float64_t + + i64v = i64vec2(bv); // bool -> int64 + u64v = u64vec2(bv); // bool -> uint64 + bv = bvec2(i64v); // int64 -> bool + bv = bvec2(u64v); // uint64 -> bool +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.float16Fetch.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.float16Fetch.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.float16Fetch.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.float16Fetch.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,1273 @@ +#version 450 core + +#extension GL_ARB_sparse_texture2: enable +#extension GL_ARB_sparse_texture_clamp: enable +#extension GL_AMD_gpu_shader_half_float: enable +#extension GL_AMD_gpu_shader_half_float_fetch: enable +#extension GL_AMD_texture_gather_bias_lod: enable + +layout(set = 0, binding = 0) uniform f16sampler1D s1D; +layout(set = 0, binding = 1) uniform f16sampler2D s2D; +layout(set = 0, binding = 2) uniform f16sampler3D s3D; +layout(set = 0, binding = 3) uniform f16sampler2DRect s2DRect; +layout(set = 0, binding = 4) uniform f16samplerCube sCube; +layout(set = 0, binding = 5) uniform f16samplerBuffer sBuffer; +layout(set = 0, binding = 6) uniform f16sampler2DMS s2DMS; +layout(set = 0, binding = 7) uniform f16sampler1DArray s1DArray; +layout(set = 0, binding = 8) uniform f16sampler2DArray s2DArray; +layout(set = 0, binding = 9) uniform f16samplerCubeArray sCubeArray; +layout(set = 0, binding = 10) uniform f16sampler2DMSArray s2DMSArray; + +layout(set = 0, binding = 11) uniform f16sampler1DShadow s1DShadow; +layout(set = 0, binding = 12) uniform f16sampler2DShadow s2DShadow; +layout(set = 0, binding = 13) uniform f16sampler2DRectShadow s2DRectShadow; +layout(set = 0, binding = 14) uniform f16samplerCubeShadow sCubeShadow; +layout(set = 0, binding = 15) uniform f16sampler1DArrayShadow s1DArrayShadow; +layout(set = 0, binding = 16) uniform f16sampler2DArrayShadow s2DArrayShadow; +layout(set = 0, binding = 17) uniform f16samplerCubeArrayShadow sCubeArrayShadow; + +layout(set = 1, binding = 0) layout(rgba16f) uniform f16image1D i1D; +layout(set = 1, binding = 1) layout(rgba16f) uniform f16image2D i2D; +layout(set = 1, binding = 2) layout(rgba16f) uniform f16image3D i3D; +layout(set = 1, binding = 3) layout(rgba16f) uniform f16image2DRect i2DRect; +layout(set = 1, binding = 4) layout(rgba16f) uniform f16imageCube iCube; +layout(set = 1, binding = 5) layout(rgba16f) uniform f16image1DArray i1DArray; +layout(set = 1, binding = 6) layout(rgba16f) uniform f16image2DArray i2DArray; +layout(set = 1, binding = 7) layout(rgba16f) uniform f16imageCubeArray iCubeArray; +layout(set = 1, binding = 8) layout(rgba16f) uniform f16imageBuffer iBuffer; +layout(set = 1, binding = 9) layout(rgba16f) uniform f16image2DMS i2DMS; +layout(set = 1, binding = 10) layout(rgba16f) uniform f16image2DMSArray i2DMSArray; + +layout(set = 2, binding = 0) uniform f16texture1D t1D; +layout(set = 2, binding = 1) uniform f16texture2D t2D; +layout(set = 2, binding = 2) uniform f16texture3D t3D; +layout(set = 2, binding = 3) uniform f16texture2DRect t2DRect; +layout(set = 2, binding = 4) uniform f16textureCube tCube; +layout(set = 2, binding = 5) uniform f16texture1DArray t1DArray; +layout(set = 2, binding = 6) uniform f16texture2DArray t2DArray; +layout(set = 2, binding = 7) uniform f16textureCubeArray tCubeArray; +layout(set = 2, binding = 8) uniform f16textureBuffer tBuffer; +layout(set = 2, binding = 9) uniform f16texture2DMS t2DMS; +layout(set = 2, binding = 10) uniform f16texture2DMSArray t2DMSArray; + +layout(set = 2, binding = 11) uniform sampler s; +layout(set = 2, binding = 12) uniform samplerShadow sShadow; + +layout(set = 3, binding = 0, input_attachment_index = 0) uniform f16subpassInput subpass; +layout(set = 3, binding = 1, input_attachment_index = 0) uniform f16subpassInputMS subpassMS; + +layout(location = 0) in float c1; +layout(location = 1) in vec2 c2; +layout(location = 2) in vec3 c3; +layout(location = 3) in vec4 c4; + +layout(location = 4) in float compare; +layout(location = 5) in float lod; +layout(location = 6) in float bias; +layout(location = 7) in float lodClamp; + +layout(location = 8) in float dPdxy1; +layout(location = 9) in vec2 dPdxy2; +layout(location = 10) in vec3 dPdxy3; + +layout(location = 11) in float16_t f16c1; +layout(location = 12) in f16vec2 f16c2; +layout(location = 13) in f16vec3 f16c3; +layout(location = 14) in f16vec4 f16c4; + +layout(location = 15) in float16_t f16lod; +layout(location = 16) in float16_t f16bias; +layout(location = 17) in float16_t f16lodClamp; + +layout(location = 18) in float16_t f16dPdxy1; +layout(location = 19) in f16vec2 f16dPdxy2; +layout(location = 20) in f16vec3 f16dPdxy3; + +const int offset1 = 1; +const ivec2 offset2 = ivec2(1); +const ivec3 offset3 = ivec3(1); +const ivec2 offsets[4] = { offset2, offset2, offset2, offset2 }; + +layout(location = 0) out vec4 fragColor; + +f16vec4 testTexture() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += texture(s1D, c1); + texel += texture(s1D, f16c1, f16bias); + texel += texture(s2D, c2); + texel += texture(s2D, f16c2, f16bias); + texel += texture(s3D, c3); + texel += texture(s3D, f16c3, f16bias); + texel += texture(sCube, c3); + texel += texture(sCube, f16c3, f16bias); + texel.x += texture(s1DShadow, c3); + texel.x += texture(s1DShadow, f16c2, compare, f16bias); + texel.x += texture(s2DShadow, c3); + texel.x += texture(s2DShadow, f16c2, compare, f16bias); + texel.x += texture(sCubeShadow, c4); + texel.x += texture(sCubeShadow, f16c3, compare, f16bias); + texel += texture(s1DArray, c2); + texel += texture(s1DArray, f16c2, f16bias); + texel += texture(s2DArray, c3); + texel += texture(s2DArray, f16c3, f16bias); + texel += texture(sCubeArray, c4); + texel += texture(sCubeArray, f16c4, f16bias); + texel.x += texture(s1DArrayShadow, c3); + texel.x += texture(s1DArrayShadow, f16c2, compare, f16bias); + texel.x += texture(s2DArrayShadow, c4); + texel.x += texture(s2DArrayShadow, f16c3, compare); + texel += texture(s2DRect, c2); + texel += texture(s2DRect, f16c2); + texel.x += texture(s2DRectShadow, c3); + texel.x += texture(s2DRectShadow, f16c2, compare); + texel.x += texture(sCubeArrayShadow, c4, compare); + texel.x += texture(sCubeArrayShadow, f16c4, compare); + + return texel; +} + +f16vec4 testTextureProj() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureProj(s1D, c2); + texel += textureProj(s1D, f16c2, f16bias); + texel += textureProj(s1D, c4); + texel += textureProj(s1D, f16c4, f16bias); + texel += textureProj(s2D, c3); + texel += textureProj(s2D, f16c3, f16bias); + texel += textureProj(s2D, c4); + texel += textureProj(s2D, f16c4, f16bias); + texel += textureProj(s3D, c4); + texel += textureProj(s3D, f16c4, f16bias); + texel.x += textureProj(s1DShadow, c4); + texel.x += textureProj(s1DShadow, f16c3, compare, f16bias); + texel.x += textureProj(s2DShadow, c4); + texel.x += textureProj(s2DShadow, f16c3, compare, f16bias); + texel += textureProj(s2DRect, c3); + texel += textureProj(s2DRect, f16c3); + texel += textureProj(s2DRect, c4); + texel += textureProj(s2DRect, f16c4); + texel.x += textureProj(s2DRectShadow, c4); + texel.x += textureProj(s2DRectShadow, f16c3, compare); + + return texel; +} + +f16vec4 testTextureLod() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureLod(s1D, c1, lod); + texel += textureLod(s1D, f16c1, f16lod); + texel += textureLod(s2D, c2, lod); + texel += textureLod(s2D, f16c2, f16lod); + texel += textureLod(s3D, c3, lod); + texel += textureLod(s3D, f16c3, f16lod); + texel += textureLod(sCube, c3, lod); + texel += textureLod(sCube, f16c3, f16lod); + texel.x += textureLod(s1DShadow, c3, lod); + texel.x += textureLod(s1DShadow, f16c2, compare, f16lod); + texel.x += textureLod(s2DShadow, c3, lod); + texel.x += textureLod(s2DShadow, f16c2, compare, f16lod); + texel += textureLod(s1DArray, c2, lod); + texel += textureLod(s1DArray, f16c2, f16lod); + texel += textureLod(s2DArray, c3, lod); + texel += textureLod(s2DArray, f16c3, f16lod); + texel.x += textureLod(s1DArrayShadow, c3, lod); + texel.x += textureLod(s1DArrayShadow, f16c2, compare, f16lod); + texel += textureLod(sCubeArray, c4, lod); + texel += textureLod(sCubeArray, f16c4, f16lod); + + return texel; +} + +f16vec4 testTextureOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureOffset(s1D, c1, offset1); + texel += textureOffset(s1D, f16c1, offset1, f16bias); + texel += textureOffset(s2D, c2, offset2); + texel += textureOffset(s2D, f16c2, offset2, f16bias); + texel += textureOffset(s3D, c3, offset3); + texel += textureOffset(s3D, f16c3, offset3, f16bias); + texel += textureOffset(s2DRect, c2, offset2); + texel += textureOffset(s2DRect, f16c2, offset2); + texel.x += textureOffset(s2DRectShadow, c3, offset2); + texel.x += textureOffset(s2DRectShadow, f16c2, compare, offset2); + texel.x += textureOffset(s1DShadow, c3, offset1); + texel.x += textureOffset(s1DShadow, f16c2, compare, offset1, f16bias); + texel.x += textureOffset(s2DShadow, c3, offset2); + texel.x += textureOffset(s2DShadow, f16c2, compare, offset2, f16bias); + texel += textureOffset(s1DArray, c2, offset1); + texel += textureOffset(s1DArray, f16c2, offset1, f16bias); + texel += textureOffset(s2DArray, c3, offset2); + texel += textureOffset(s2DArray, f16c3, offset2, f16bias); + texel.x += textureOffset(s1DArrayShadow, c3, offset1); + texel.x += textureOffset(s1DArrayShadow, f16c2, compare, offset1, f16bias); + texel.x += textureOffset(s2DArrayShadow, c4, offset2); + texel.x += textureOffset(s2DArrayShadow, f16c3, compare, offset2); + + return texel; +} + +f16vec4 testTextureProjOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureProjOffset(s1D, c2, offset1); + texel += textureProjOffset(s1D, f16c2, offset1, f16bias); + texel += textureProjOffset(s1D, c4, offset1); + texel += textureProjOffset(s1D, f16c4, offset1, f16bias); + texel += textureProjOffset(s2D, c3, offset2); + texel += textureProjOffset(s2D, f16c3, offset2, f16bias); + texel += textureProjOffset(s2D, c4, offset2); + texel += textureProjOffset(s2D, f16c4, offset2, f16bias); + texel += textureProjOffset(s3D, c4, offset3); + texel += textureProjOffset(s3D, f16c4, offset3, f16bias); + texel += textureProjOffset(s2DRect, c3, offset2); + texel += textureProjOffset(s2DRect, f16c3, offset2); + texel += textureProjOffset(s2DRect, c4, offset2); + texel += textureProjOffset(s2DRect, f16c4, offset2); + texel.x += textureProjOffset(s2DRectShadow, c4, offset2); + texel.x += textureProjOffset(s2DRectShadow, f16c3, compare, offset2); + texel.x += textureProjOffset(s1DShadow, c4, offset1); + texel.x += textureProjOffset(s1DShadow, f16c3, compare, offset1, f16bias); + texel.x += textureProjOffset(s2DShadow, c4, offset2); + texel.x += textureProjOffset(s2DShadow, f16c3, compare, offset2, f16bias); + + return texel; +} + +f16vec4 testTextureLodOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureLodOffset(s1D, c1, lod, offset1); + texel += textureLodOffset(s1D, f16c1, f16lod, offset1); + texel += textureLodOffset(s2D, c2, lod, offset2); + texel += textureLodOffset(s2D, f16c2, f16lod, offset2); + texel += textureLodOffset(s3D, c3, lod, offset3); + texel += textureLodOffset(s3D, f16c3, f16lod, offset3); + texel.x += textureLodOffset(s1DShadow, c3, lod, offset1); + texel.x += textureLodOffset(s1DShadow, f16c2, compare, f16lod, offset1); + texel.x += textureLodOffset(s2DShadow, c3, lod, offset2); + texel.x += textureLodOffset(s2DShadow, f16c2, compare, f16lod, offset2); + texel += textureLodOffset(s1DArray, c2, lod, offset1); + texel += textureLodOffset(s1DArray, f16c2, f16lod, offset1); + texel += textureLodOffset(s2DArray, c3, lod, offset2); + texel += textureLodOffset(s2DArray, f16c3, f16lod, offset2); + texel.x += textureLodOffset(s1DArrayShadow, c3, lod, offset1); + texel.x += textureLodOffset(s1DArrayShadow, f16c2, compare, f16lod, offset1); + + return texel; +} + +f16vec4 testTextureProjLodOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureProjLodOffset(s1D, c2, lod, offset1); + texel += textureProjLodOffset(s1D, f16c2, f16lod, offset1); + texel += textureProjLodOffset(s1D, c4, lod, offset1); + texel += textureProjLodOffset(s1D, f16c4, f16lod, offset1); + texel += textureProjLodOffset(s2D, c3, lod, offset2); + texel += textureProjLodOffset(s2D, f16c3, f16lod, offset2); + texel += textureProjLodOffset(s2D, c4, lod, offset2); + texel += textureProjLodOffset(s2D, f16c4, f16lod, offset2); + texel += textureProjLodOffset(s3D, c4, lod, offset3); + texel += textureProjLodOffset(s3D, f16c4, f16lod, offset3); + texel.x += textureProjLodOffset(s1DShadow, c4, lod, offset1); + texel.x += textureProjLodOffset(s1DShadow, f16c3, compare, f16lod, offset1); + texel.x += textureProjLodOffset(s2DShadow, c4, lod, offset2); + texel.x += textureProjLodOffset(s2DShadow, f16c3, compare, f16lod, offset2); + + return texel; +} + +f16vec4 testTexelFetch() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += texelFetch(s1D, int(c1), int(lod)); + texel += texelFetch(s2D, ivec2(c2), int(lod)); + texel += texelFetch(s3D, ivec3(c3), int(lod)); + texel += texelFetch(s2DRect, ivec2(c2)); + texel += texelFetch(s1DArray, ivec2(c2), int(lod)); + texel += texelFetch(s2DArray, ivec3(c3), int(lod)); + texel += texelFetch(sBuffer, int(c1)); + texel += texelFetch(s2DMS, ivec2(c2), 1); + texel += texelFetch(s2DMSArray, ivec3(c3), 2); + + return texel; +} + +f16vec4 testTexelFetchOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += texelFetchOffset(s1D, int(c1), int(lod), offset1); + texel += texelFetchOffset(s2D, ivec2(c2), int(lod), offset2); + texel += texelFetchOffset(s3D, ivec3(c3), int(lod), offset3); + texel += texelFetchOffset(s2DRect, ivec2(c2), offset2); + texel += texelFetchOffset(s1DArray, ivec2(c2), int(lod), offset1); + texel += texelFetchOffset(s2DArray, ivec3(c3), int(lod), offset2); + + return texel; +} + +f16vec4 testTextureGrad() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGrad(s1D, c1, dPdxy1, dPdxy1); + texel += textureGrad(s1D, f16c1, f16dPdxy1, f16dPdxy1); + texel += textureGrad(s2D, c2, dPdxy2, dPdxy2); + texel += textureGrad(s2D, f16c2, f16dPdxy2, f16dPdxy2); + texel += textureGrad(s3D, c3, dPdxy3, dPdxy3); + texel += textureGrad(s3D, f16c3, f16dPdxy3, f16dPdxy3); + texel += textureGrad(sCube, c3, dPdxy3, dPdxy3); + texel += textureGrad(sCube, f16c3, f16dPdxy3, f16dPdxy3); + texel += textureGrad(s2DRect, c2, dPdxy2, dPdxy2); + texel += textureGrad(s2DRect, f16c2, f16dPdxy2, f16dPdxy2); + texel.x += textureGrad(s2DRectShadow, c3, dPdxy2, dPdxy2); + texel.x += textureGrad(s2DRectShadow, f16c2, compare, f16dPdxy2, f16dPdxy2); + texel.x += textureGrad(s1DShadow, c3, dPdxy1, dPdxy1); + texel.x += textureGrad(s1DShadow, f16c2, compare, f16dPdxy1, f16dPdxy1); + texel.x += textureGrad(s2DShadow, c3, dPdxy2, dPdxy2); + texel.x += textureGrad(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2); + texel.x += textureGrad(sCubeShadow, c4, dPdxy3, dPdxy3); + texel.x += textureGrad(sCubeShadow, f16c3, compare, f16dPdxy3, f16dPdxy3); + texel += textureGrad(s1DArray, c2, dPdxy1, dPdxy1); + texel += textureGrad(s1DArray, f16c2, f16dPdxy1, f16dPdxy1); + texel += textureGrad(s2DArray, c3, dPdxy2, dPdxy2); + texel += textureGrad(s2DArray, f16c3, f16dPdxy2, f16dPdxy2); + texel.x += textureGrad(s1DArrayShadow, c3, dPdxy1, dPdxy1); + texel.x += textureGrad(s1DArrayShadow, f16c2, compare, f16dPdxy1, f16dPdxy1); + texel.x += textureGrad(s2DArrayShadow, c4, dPdxy2, dPdxy2); + texel.x += textureGrad(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2); + texel += textureGrad(sCubeArray, c4, dPdxy3, dPdxy3); + texel += textureGrad(sCubeArray, f16c4, f16dPdxy3, f16dPdxy3); + + return texel; +} + +f16vec4 testTextureGradOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGradOffset(s1D, c1, dPdxy1, dPdxy1, offset1); + texel += textureGradOffset(s1D, f16c1, f16dPdxy1, f16dPdxy1, offset1); + texel += textureGradOffset(s2D, c2, dPdxy2, dPdxy2, offset2); + texel += textureGradOffset(s2D, f16c2, f16dPdxy2, f16dPdxy2, offset2); + texel += textureGradOffset(s3D, c3, dPdxy3, dPdxy3, offset3); + texel += textureGradOffset(s3D, f16c3, f16dPdxy3, f16dPdxy3, offset3); + texel += textureGradOffset(s2DRect, c2, dPdxy2, dPdxy2, offset2); + texel += textureGradOffset(s2DRect, f16c2, f16dPdxy2, f16dPdxy2, offset2); + texel.x += textureGradOffset(s2DRectShadow, c3, dPdxy2, dPdxy2, offset2); + texel.x += textureGradOffset(s2DRectShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2); + texel.x += textureGradOffset(s1DShadow, c3, dPdxy1, dPdxy1, offset1); + texel.x += textureGradOffset(s1DShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, offset1); + texel.x += textureGradOffset(s2DShadow, c3, dPdxy2, dPdxy2, offset2); + texel.x += textureGradOffset(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2); + texel += textureGradOffset(s1DArray, c2, dPdxy1, dPdxy1, offset1); + texel += textureGradOffset(s1DArray, f16c2, f16dPdxy1, f16dPdxy1, offset1); + texel += textureGradOffset(s2DArray, c3, dPdxy2, dPdxy2, offset2); + texel += textureGradOffset(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, offset2); + texel.x += textureGradOffset(s1DArrayShadow, c3, dPdxy1, dPdxy1, offset1); + texel.x += textureGradOffset(s1DArrayShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, offset1); + texel.x += textureGradOffset(s2DArrayShadow, c4, dPdxy2, dPdxy2, offset2); + texel.x += textureGradOffset(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2); + + return texel; +} + +f16vec4 testTextureProjGrad() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureProjGrad(s1D, c2, dPdxy1, dPdxy1); + texel += textureProjGrad(s1D, f16c2, f16dPdxy1, f16dPdxy1); + texel += textureProjGrad(s1D, c4, dPdxy1, dPdxy1); + texel += textureProjGrad(s1D, f16c4, f16dPdxy1, f16dPdxy1); + texel += textureProjGrad(s2D, c3, dPdxy2, dPdxy2); + texel += textureProjGrad(s2D, f16c3, f16dPdxy2, f16dPdxy2); + texel += textureProjGrad(s2D, c4, dPdxy2, dPdxy2); + texel += textureProjGrad(s2D, f16c4, f16dPdxy2, f16dPdxy2); + texel += textureProjGrad(s3D, c4, dPdxy3, dPdxy3); + texel += textureProjGrad(s3D, f16c4, f16dPdxy3, f16dPdxy3); + texel += textureProjGrad(s2DRect, c3, dPdxy2, dPdxy2); + texel += textureProjGrad(s2DRect, f16c3, f16dPdxy2, f16dPdxy2); + texel += textureProjGrad(s2DRect, c4, dPdxy2, dPdxy2); + texel += textureProjGrad(s2DRect, f16c4, f16dPdxy2, f16dPdxy2); + texel.x += textureProjGrad(s2DRectShadow, c4, dPdxy2, dPdxy2); + texel.x += textureProjGrad(s2DRectShadow, f16c3, compare, f16dPdxy2, f16dPdxy2); + texel.x += textureProjGrad(s1DShadow, c4, dPdxy1, dPdxy1); + texel.x += textureProjGrad(s1DShadow, f16c3, compare, f16dPdxy1, f16dPdxy1); + texel.x += textureProjGrad(s2DShadow, c4, dPdxy2, dPdxy2); + texel.x += textureProjGrad(s2DShadow, f16c3, compare, f16dPdxy2, f16dPdxy2); + + return texel; +} + +f16vec4 testTextureProjGradoffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureProjGradOffset(s1D, c2, dPdxy1, dPdxy1, offset1); + texel += textureProjGradOffset(s1D, f16c2, f16dPdxy1, f16dPdxy1, offset1); + texel += textureProjGradOffset(s1D, c4, dPdxy1, dPdxy1, offset1); + texel += textureProjGradOffset(s1D, f16c4, f16dPdxy1, f16dPdxy1, offset1); + texel += textureProjGradOffset(s2D, c3, dPdxy2, dPdxy2, offset2); + texel += textureProjGradOffset(s2D, f16c3, f16dPdxy2, f16dPdxy2, offset2); + texel += textureProjGradOffset(s2D, c4, dPdxy2, dPdxy2, offset2); + texel += textureProjGradOffset(s2D, f16c4, f16dPdxy2, f16dPdxy2, offset2); + texel += textureProjGradOffset(s2DRect, c3, dPdxy2, dPdxy2, offset2); + texel += textureProjGradOffset(s2DRect, f16c3, f16dPdxy2, f16dPdxy2, offset2); + texel += textureProjGradOffset(s2DRect, c4, dPdxy2, dPdxy2, offset2); + texel += textureProjGradOffset(s2DRect, f16c4, f16dPdxy2, f16dPdxy2, offset2); + texel.x += textureProjGradOffset(s2DRectShadow, c4, dPdxy2, dPdxy2, offset2); + texel.x += textureProjGradOffset(s2DRectShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2); + texel += textureProjGradOffset(s3D, c4, dPdxy3, dPdxy3, offset3); + texel += textureProjGradOffset(s3D, f16c4, f16dPdxy3, f16dPdxy3, offset3); + texel.x += textureProjGradOffset(s1DShadow, c4, dPdxy1, dPdxy1, offset1); + texel.x += textureProjGradOffset(s1DShadow, f16c3, compare, f16dPdxy1, f16dPdxy1, offset1); + texel.x += textureProjGradOffset(s2DShadow, c4, dPdxy2, dPdxy2, offset2); + texel.x += textureProjGradOffset(s2DShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2); + + return texel; +} + +f16vec4 testTextureGather() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGather(s2D, c2, 0); + texel += textureGather(s2D, f16c2, 0, f16bias); + texel += textureGather(s2DArray, c3, 0); + texel += textureGather(s2DArray, f16c3, 0, f16bias); + texel += textureGather(sCube, c3, 0); + texel += textureGather(sCube, f16c3, 0, f16bias); + texel += textureGather(sCubeArray, c4, 0); + texel += textureGather(sCubeArray, f16c4, 0, f16bias); + texel += textureGather(s2DRect, c2, 0); + texel += textureGather(s2DRect, f16c2, 0); + texel += textureGather(s2DShadow, c2, compare); + texel += textureGather(s2DShadow, f16c2, compare); + texel += textureGather(s2DArrayShadow, c3, compare); + texel += textureGather(s2DArrayShadow, f16c3, compare); + texel += textureGather(sCubeShadow, c3, compare); + texel += textureGather(sCubeShadow, f16c3, compare); + texel += textureGather(sCubeArrayShadow, c4, compare); + texel += textureGather(sCubeArrayShadow, f16c4, compare); + texel += textureGather(s2DRectShadow, c2, compare); + texel += textureGather(s2DRectShadow, f16c2, compare); + + return texel; +} + +f16vec4 testTextureGatherOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGatherOffset(s2D, c2, offset2, 0); + texel += textureGatherOffset(s2D, f16c2, offset2, 0, f16bias); + texel += textureGatherOffset(s2DArray, c3, offset2, 0); + texel += textureGatherOffset(s2DArray, f16c3, offset2, 0, f16bias); + texel += textureGatherOffset(s2DRect, c2, offset2, 0); + texel += textureGatherOffset(s2DRect, f16c2, offset2, 0); + texel += textureGatherOffset(s2DShadow, c2, compare, offset2); + texel += textureGatherOffset(s2DShadow, f16c2, compare, offset2); + texel += textureGatherOffset(s2DArrayShadow, c3, compare, offset2); + texel += textureGatherOffset(s2DArrayShadow, f16c3, compare, offset2); + texel += textureGatherOffset(s2DRectShadow, c2, compare, offset2); + texel += textureGatherOffset(s2DRectShadow, f16c2, compare, offset2); + + return texel; +} + +f16vec4 testTextureGatherOffsets() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGatherOffsets(s2D, c2, offsets, 0); + texel += textureGatherOffsets(s2D, f16c2, offsets, 0, f16bias); + texel += textureGatherOffsets(s2DArray, c3, offsets, 0); + texel += textureGatherOffsets(s2DArray, f16c3, offsets, 0, f16bias); + texel += textureGatherOffsets(s2DRect, c2, offsets, 0); + texel += textureGatherOffsets(s2DRect, f16c2, offsets, 0); + texel += textureGatherOffsets(s2DShadow, c2, compare, offsets); + texel += textureGatherOffsets(s2DShadow, f16c2, compare, offsets); + texel += textureGatherOffsets(s2DArrayShadow, c3, compare, offsets); + texel += textureGatherOffsets(s2DArrayShadow, f16c3, compare, offsets); + texel += textureGatherOffsets(s2DRectShadow, c2, compare, offsets); + texel += textureGatherOffsets(s2DRectShadow, f16c2, compare, offsets); + + return texel; +} + +f16vec4 testTextureGatherLod() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGatherLodAMD(s2D, c2, lod, 0); + texel += textureGatherLodAMD(s2D, f16c2, f16lod, 0); + texel += textureGatherLodAMD(s2DArray, c3, lod, 0); + texel += textureGatherLodAMD(s2DArray, f16c3, f16lod, 0); + texel += textureGatherLodAMD(sCube, c3, lod, 0); + texel += textureGatherLodAMD(sCube, f16c3, f16lod, 0); + texel += textureGatherLodAMD(sCubeArray, c4, lod, 0); + texel += textureGatherLodAMD(sCubeArray, f16c4, f16lod, 0); + + return texel; +} + +f16vec4 testTextureGatherLodOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGatherLodOffsetAMD(s2D, c2, lod, offset2, 0); + texel += textureGatherLodOffsetAMD(s2D, f16c2, f16lod, offset2, 0); + texel += textureGatherLodOffsetAMD(s2DArray, c3, lod, offset2, 0); + texel += textureGatherLodOffsetAMD(s2DArray, f16c3, f16lod, offset2, 0); + + return texel; +} + +f16vec4 testTextureGatherLodOffsets() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGatherLodOffsetsAMD(s2D, c2, lod, offsets, 0); + texel += textureGatherLodOffsetsAMD(s2D, f16c2, f16lod, offsets, 0); + texel += textureGatherLodOffsetsAMD(s2DArray, c3, lod, offsets, 0); + texel += textureGatherLodOffsetsAMD(s2DArray, f16c3, f16lod, offsets, 0); + + return texel; +} + +ivec4 testTextureSize() +{ + ivec4 size = ivec4(0); + + size.x += textureSize(s1D, int(lod)); + size.xy += textureSize(s2D, int(lod)); + size.xyz += textureSize(s3D, int(lod)); + size.xy += textureSize(sCube, int(lod)); + size.x += textureSize(s1DShadow, int(lod)); + size.xy += textureSize(s2DShadow, int(lod)); + size.xy += textureSize(sCubeShadow, int(lod)); + size.xyz += textureSize(sCubeArray, int(lod)); + size.xyz += textureSize(sCubeArrayShadow, int(lod)); + size.xy += textureSize(s2DRect); + size.xy += textureSize(s2DRectShadow); + size.xy += textureSize(s1DArray, int(lod)); + size.xyz += textureSize(s2DArray, int(lod)); + size.xy += textureSize(s1DArrayShadow, int(lod)); + size.xyz += textureSize(s2DArrayShadow, int(lod)); + size.x += textureSize(sBuffer); + size.xy += textureSize(s2DMS); + size.xyz += textureSize(s2DMSArray); + + return size; +} + +vec2 testTextureQueryLod() +{ + vec2 lod = vec2(0.0); + + lod += textureQueryLod(s1D, c1); + lod += textureQueryLod(s1D, f16c1); + lod += textureQueryLod(s2D, c2); + lod += textureQueryLod(s2D, f16c2); + lod += textureQueryLod(s3D, c3); + lod += textureQueryLod(s3D, f16c3); + lod += textureQueryLod(sCube, c3); + lod += textureQueryLod(sCube, f16c3); + lod += textureQueryLod(s1DArray, c1); + lod += textureQueryLod(s1DArray, f16c1); + lod += textureQueryLod(s2DArray, c2); + lod += textureQueryLod(s2DArray, f16c2); + lod += textureQueryLod(sCubeArray, c3); + lod += textureQueryLod(sCubeArray, f16c3); + lod += textureQueryLod(s1DShadow, c1); + lod += textureQueryLod(s1DShadow, f16c1); + lod += textureQueryLod(s2DShadow, c2); + lod += textureQueryLod(s2DShadow, f16c2); + lod += textureQueryLod(sCubeArrayShadow, c3); + lod += textureQueryLod(sCubeArrayShadow, f16c3); + lod += textureQueryLod(s1DArrayShadow, c1); + lod += textureQueryLod(s1DArrayShadow, f16c1); + lod += textureQueryLod(s2DArrayShadow, c2); + lod += textureQueryLod(s2DArrayShadow, f16c2); + lod += textureQueryLod(sCubeArrayShadow, c3); + lod += textureQueryLod(sCubeArrayShadow, f16c3); + + return lod; +} + +int testTextureQueryLevels() +{ + int levels = 0; + + levels += textureQueryLevels(s1D); + levels += textureQueryLevels(s2D); + levels += textureQueryLevels(s3D); + levels += textureQueryLevels(sCube); + levels += textureQueryLevels(s1DShadow); + levels += textureQueryLevels(s2DShadow); + levels += textureQueryLevels(sCubeShadow); + levels += textureQueryLevels(sCubeArray); + levels += textureQueryLevels(sCubeArrayShadow); + levels += textureQueryLevels(s1DArray); + levels += textureQueryLevels(s2DArray); + levels += textureQueryLevels(s1DArrayShadow); + levels += textureQueryLevels(s2DArrayShadow); + + return levels; +} + +int testTextureSamples() +{ + int samples = 0; + + samples += textureSamples(s2DMS); + samples += textureSamples(s2DMSArray); + + return samples; +} + +f16vec4 testImageLoad() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += imageLoad(i1D, int(c1)); + texel += imageLoad(i2D, ivec2(c2)); + texel += imageLoad(i3D, ivec3(c3)); + texel += imageLoad(i2DRect, ivec2(c2)); + texel += imageLoad(iCube, ivec3(c3)); + texel += imageLoad(iBuffer, int(c1)); + texel += imageLoad(i1DArray, ivec2(c2)); + texel += imageLoad(i2DArray, ivec3(c3)); + texel += imageLoad(iCubeArray, ivec3(c3)); + texel += imageLoad(i2DMS, ivec2(c2), 1); + texel += imageLoad(i2DMSArray, ivec3(c3), 1); + + return texel; +} + +void testImageStore(f16vec4 data) +{ + imageStore(i1D, int(c1), data); + imageStore(i2D, ivec2(c2), data); + imageStore(i3D, ivec3(c3), data); + imageStore(i2DRect, ivec2(c2), data); + imageStore(iCube, ivec3(c3), data); + imageStore(iBuffer, int(c1), data); + imageStore(i1DArray, ivec2(c2), data); + imageStore(i2DArray, ivec3(c3), data); + imageStore(iCubeArray, ivec3(c3), data); + imageStore(i2DMS, ivec2(c2), 1, data); + imageStore(i2DMSArray, ivec3(c3), 1, data); +} + +f16vec4 testSparseTexture() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureARB(s2D, c2, texel); + sparseTextureARB(s2D, f16c2, texel, f16bias); + sparseTextureARB(s3D, c3, texel); + sparseTextureARB(s3D, f16c3, texel, f16bias); + sparseTextureARB(sCube, c3, texel); + sparseTextureARB(sCube, f16c3, texel, f16bias); + sparseTextureARB(s2DShadow, c3, texel.x); + sparseTextureARB(s2DShadow, f16c2, compare, texel.x, f16bias); + sparseTextureARB(sCubeShadow, c4, texel.x); + sparseTextureARB(sCubeShadow, f16c3, compare, texel.x, f16bias); + sparseTextureARB(s2DArray, c3, texel); + sparseTextureARB(s2DArray, f16c3, texel, f16bias); + sparseTextureARB(sCubeArray, c4, texel); + sparseTextureARB(sCubeArray, f16c4, texel, f16bias); + sparseTextureARB(s2DArrayShadow, c4, texel.x); + sparseTextureARB(s2DArrayShadow, f16c3, compare, texel.x); + sparseTextureARB(s2DRect, c2, texel); + sparseTextureARB(s2DRect, f16c2, texel); + sparseTextureARB(s2DRectShadow, c3, texel.x); + sparseTextureARB(s2DRectShadow, f16c2, compare, texel.x); + sparseTextureARB(sCubeArrayShadow, c4, compare, texel.x); + sparseTextureARB(sCubeArrayShadow, f16c4, compare, texel.x); + + return texel; +} + +f16vec4 testSparseTextureLod() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureLodARB(s2D, c2, lod, texel); + sparseTextureLodARB(s2D, f16c2, f16lod, texel); + sparseTextureLodARB(s3D, c3, lod, texel); + sparseTextureLodARB(s3D, f16c3, f16lod, texel); + sparseTextureLodARB(sCube, c3, lod, texel); + sparseTextureLodARB(sCube, f16c3, f16lod, texel); + sparseTextureLodARB(s2DShadow, c3, lod, texel.x); + sparseTextureLodARB(s2DShadow, f16c2, compare, f16lod, texel.x); + sparseTextureLodARB(s2DArray, c3, lod, texel); + sparseTextureLodARB(s2DArray, f16c3, f16lod, texel); + sparseTextureLodARB(sCubeArray, c4, lod, texel); + sparseTextureLodARB(sCubeArray, f16c4, f16lod, texel); + + return texel; +} + +f16vec4 testSparseTextureOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureOffsetARB(s2D, c2, offset2, texel); + sparseTextureOffsetARB(s2D, f16c2, offset2, texel, f16bias); + sparseTextureOffsetARB(s3D, c3, offset3, texel); + sparseTextureOffsetARB(s3D, f16c3, offset3, texel, f16bias); + sparseTextureOffsetARB(s2DRect, c2, offset2, texel); + sparseTextureOffsetARB(s2DRect, f16c2, offset2, texel); + sparseTextureOffsetARB(s2DRectShadow, c3, offset2, texel.x); + sparseTextureOffsetARB(s2DRectShadow, f16c2, compare, offset2, texel.x); + sparseTextureOffsetARB(s2DShadow, c3, offset2, texel.x); + sparseTextureOffsetARB(s2DShadow, f16c2, compare, offset2, texel.x, f16bias); + sparseTextureOffsetARB(s2DArray, c3, offset2, texel); + sparseTextureOffsetARB(s2DArray, f16c3, offset2, texel, f16bias); + sparseTextureOffsetARB(s2DArrayShadow, c4, offset2, texel.x); + sparseTextureOffsetARB(s2DArrayShadow, f16c3, compare, offset2, texel.x); + + return texel; +} + +f16vec4 testSparseTextureLodOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureLodOffsetARB(s2D, c2, lod, offset2, texel); + sparseTextureLodOffsetARB(s2D, f16c2, f16lod, offset2, texel); + sparseTextureLodOffsetARB(s3D, c3, lod, offset3, texel); + sparseTextureLodOffsetARB(s3D, f16c3, f16lod, offset3, texel); + sparseTextureLodOffsetARB(s2DShadow, c3, lod, offset2, texel.x); + sparseTextureLodOffsetARB(s2DShadow, f16c2, compare, f16lod, offset2, texel.x); + sparseTextureLodOffsetARB(s2DArray, c3, lod, offset2, texel); + sparseTextureLodOffsetARB(s2DArray, f16c3, f16lod, offset2, texel); + + return texel; +} + +f16vec4 testSparseTextureGrad() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGradARB(s2D, c2, dPdxy2, dPdxy2, texel); + sparseTextureGradARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, texel); + sparseTextureGradARB(s3D, c3, dPdxy3, dPdxy3, texel); + sparseTextureGradARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, texel); + sparseTextureGradARB(sCube, c3, dPdxy3, dPdxy3, texel); + sparseTextureGradARB(sCube, f16c3, f16dPdxy3, f16dPdxy3, texel); + sparseTextureGradARB(s2DRect, c2, dPdxy2, dPdxy2, texel); + sparseTextureGradARB(s2DRect, f16c2, f16dPdxy2, f16dPdxy2, texel); + sparseTextureGradARB(s2DRectShadow, c3, dPdxy2, dPdxy2, texel.x); + sparseTextureGradARB(s2DRectShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, texel.x); + sparseTextureGradARB(s2DShadow, c3, dPdxy2, dPdxy2, texel.x); + sparseTextureGradARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, texel.x); + sparseTextureGradARB(sCubeShadow, c4, dPdxy3, dPdxy3, texel.x); + sparseTextureGradARB(sCubeShadow, f16c3, compare, f16dPdxy3, f16dPdxy3, texel.x); + sparseTextureGradARB(s2DArray, c3, dPdxy2, dPdxy2, texel); + sparseTextureGradARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, texel); + sparseTextureGradARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, texel.x); + sparseTextureGradARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, texel.x); + sparseTextureGradARB(sCubeArray, c4, dPdxy3, dPdxy3, texel); + sparseTextureGradARB(sCubeArray, f16c4, f16dPdxy3, f16dPdxy3, texel); + + return texel; +} + +f16vec4 testSparseTextureGradOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGradOffsetARB(s2D, c2, dPdxy2, dPdxy2, offset2, texel); + sparseTextureGradOffsetARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, offset2, texel); + sparseTextureGradOffsetARB(s3D, c3, dPdxy3, dPdxy3, offset3, texel); + sparseTextureGradOffsetARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, offset3, texel); + sparseTextureGradOffsetARB(s2DRect, c2, dPdxy2, dPdxy2, offset2, texel); + sparseTextureGradOffsetARB(s2DRect, f16c2, f16dPdxy2, f16dPdxy2, offset2, texel); + sparseTextureGradOffsetARB(s2DRectShadow, c3, dPdxy2, dPdxy2, offset2, texel.x); + sparseTextureGradOffsetARB(s2DRectShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2, texel.x); + sparseTextureGradOffsetARB(s2DShadow, c3, dPdxy2, dPdxy2, offset2, texel.x); + sparseTextureGradOffsetARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2, texel.x); + sparseTextureGradOffsetARB(s2DArray, c3, dPdxy2, dPdxy2, offset2, texel); + sparseTextureGradOffsetARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, offset2, texel); + sparseTextureGradOffsetARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, offset2, texel.x); + sparseTextureGradOffsetARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2, texel.x); + + return texel; +} + +f16vec4 testSparseTexelFetch() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTexelFetchARB(s2D, ivec2(c2), int(lod), texel); + sparseTexelFetchARB(s3D, ivec3(c3), int(lod), texel); + sparseTexelFetchARB(s2DRect, ivec2(c2), texel); + sparseTexelFetchARB(s2DArray, ivec3(c3), int(lod), texel); + sparseTexelFetchARB(s2DMS, ivec2(c2), 1, texel); + sparseTexelFetchARB(s2DMSArray, ivec3(c3), 2, texel); + + return texel; +} + +f16vec4 testSparseTexelFetchOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTexelFetchOffsetARB(s2D, ivec2(c2), int(lod), offset2, texel); + sparseTexelFetchOffsetARB(s3D, ivec3(c3), int(lod), offset3, texel); + sparseTexelFetchOffsetARB(s2DRect, ivec2(c2), offset2, texel); + sparseTexelFetchOffsetARB(s2DArray, ivec3(c3), int(lod), offset2, texel); + + return texel; +} + +f16vec4 testSparseTextureGather() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGatherARB(s2D, c2, texel, 0); + sparseTextureGatherARB(s2D, f16c2, texel, 0, f16bias); + sparseTextureGatherARB(s2DArray, c3, texel, 0); + sparseTextureGatherARB(s2DArray, f16c3, texel, 0, f16bias); + sparseTextureGatherARB(sCube, c3, texel, 0); + sparseTextureGatherARB(sCube, f16c3, texel, 0, f16bias); + sparseTextureGatherARB(sCubeArray, c4, texel, 0); + sparseTextureGatherARB(sCubeArray, f16c4, texel, 0, f16bias); + sparseTextureGatherARB(s2DRect, c2, texel, 0); + sparseTextureGatherARB(s2DRect, f16c2, texel, 0); + sparseTextureGatherARB(s2DShadow, c2, compare, texel); + sparseTextureGatherARB(s2DShadow, f16c2, compare, texel); + sparseTextureGatherARB(s2DArrayShadow, c3, compare, texel); + sparseTextureGatherARB(s2DArrayShadow, f16c3, compare, texel); + sparseTextureGatherARB(sCubeShadow, c3, compare, texel); + sparseTextureGatherARB(sCubeShadow, f16c3, compare, texel); + sparseTextureGatherARB(sCubeArrayShadow, c4, compare, texel); + sparseTextureGatherARB(sCubeArrayShadow, f16c4, compare, texel); + sparseTextureGatherARB(s2DRectShadow, c2, compare, texel); + sparseTextureGatherARB(s2DRectShadow, f16c2, compare, texel); + + return texel; +} + +f16vec4 testSparseTextureGatherOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGatherOffsetARB(s2D, c2, offset2, texel, 0); + sparseTextureGatherOffsetARB(s2D, f16c2, offset2, texel, 0, f16bias); + sparseTextureGatherOffsetARB(s2DArray, c3, offset2, texel, 0); + sparseTextureGatherOffsetARB(s2DArray, f16c3, offset2, texel, 0, f16bias); + sparseTextureGatherOffsetARB(s2DRect, c2, offset2, texel, 0); + sparseTextureGatherOffsetARB(s2DRect, f16c2, offset2, texel, 0); + sparseTextureGatherOffsetARB(s2DShadow, c2, compare, offset2, texel); + sparseTextureGatherOffsetARB(s2DShadow, f16c2, compare, offset2, texel); + sparseTextureGatherOffsetARB(s2DArrayShadow, c3, compare, offset2, texel); + sparseTextureGatherOffsetARB(s2DArrayShadow, f16c3, compare, offset2, texel); + sparseTextureGatherOffsetARB(s2DRectShadow, c2, compare, offset2, texel); + sparseTextureGatherOffsetARB(s2DRectShadow, f16c2, compare, offset2, texel); + + return texel; +} + +f16vec4 testSparseTextureGatherOffsets() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGatherOffsetsARB(s2D, c2, offsets, texel, 0); + sparseTextureGatherOffsetsARB(s2D, f16c2, offsets, texel, 0, f16bias); + sparseTextureGatherOffsetsARB(s2DArray, c3, offsets, texel, 0); + sparseTextureGatherOffsetsARB(s2DArray, f16c3, offsets, texel, 0, f16bias); + sparseTextureGatherOffsetsARB(s2DRect, c2, offsets, texel, 0); + sparseTextureGatherOffsetsARB(s2DRect, f16c2, offsets, texel, 0); + sparseTextureGatherOffsetsARB(s2DShadow, c2, compare, offsets, texel); + sparseTextureGatherOffsetsARB(s2DShadow, f16c2, compare, offsets, texel); + sparseTextureGatherOffsetsARB(s2DArrayShadow, c3, compare, offsets, texel); + sparseTextureGatherOffsetsARB(s2DArrayShadow, f16c3, compare, offsets, texel); + sparseTextureGatherOffsetsARB(s2DRectShadow, c2, compare, offsets, texel); + sparseTextureGatherOffsetsARB(s2DRectShadow, f16c2, compare, offsets, texel); + + return texel; +} + +f16vec4 testSparseTextureGatherLod() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGatherLodAMD(s2D, c2, lod, texel, 0); + sparseTextureGatherLodAMD(s2D, f16c2, f16lod, texel, 0); + sparseTextureGatherLodAMD(s2DArray, c3, lod, texel, 0); + sparseTextureGatherLodAMD(s2DArray, f16c3, f16lod, texel, 0); + sparseTextureGatherLodAMD(sCube, c3, lod, texel, 0); + sparseTextureGatherLodAMD(sCube, f16c3, f16lod, texel, 0); + sparseTextureGatherLodAMD(sCubeArray, c4, lod, texel, 0); + sparseTextureGatherLodAMD(sCubeArray, f16c4, f16lod, texel, 0); + + return texel; +} + +f16vec4 testSparseTextureGatherLodOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGatherLodOffsetAMD(s2D, c2, lod, offset2, texel, 0); + sparseTextureGatherLodOffsetAMD(s2D, f16c2, f16lod, offset2, texel, 0); + sparseTextureGatherLodOffsetAMD(s2DArray, c3, lod, offset2, texel, 0); + sparseTextureGatherLodOffsetAMD(s2DArray, f16c3, f16lod, offset2, texel, 0); + + return texel; +} + +f16vec4 testSparseTextureGatherLodOffsets() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGatherLodOffsetsAMD(s2D, c2, lod, offsets, texel, 0); + sparseTextureGatherLodOffsetsAMD(s2D, f16c2, f16lod, offsets, texel, 0); + sparseTextureGatherLodOffsetsAMD(s2DArray, c3, lod, offsets, texel, 0); + sparseTextureGatherLodOffsetsAMD(s2DArray, f16c3, f16lod, offsets, texel, 0); + + return texel; +} + +f16vec4 testSparseImageLoad() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseImageLoadARB(i2D, ivec2(c2), texel); + sparseImageLoadARB(i3D, ivec3(c3), texel); + sparseImageLoadARB(i2DRect, ivec2(c2), texel); + sparseImageLoadARB(iCube, ivec3(c3), texel); + sparseImageLoadARB(i2DArray, ivec3(c3), texel); + sparseImageLoadARB(iCubeArray, ivec3(c3), texel); + sparseImageLoadARB(i2DMS, ivec2(c2), 1, texel); + sparseImageLoadARB(i2DMSArray, ivec3(c3), 2, texel); + + return texel; +} + +f16vec4 testSparseTextureClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureClampARB(s2D, c2, lodClamp, texel); + sparseTextureClampARB(s2D, f16c2, f16lodClamp, texel, f16bias); + sparseTextureClampARB(s3D, c3, lodClamp, texel); + sparseTextureClampARB(s3D, f16c3, f16lodClamp, texel, f16bias); + sparseTextureClampARB(sCube, c3, lodClamp, texel); + sparseTextureClampARB(sCube, f16c3, f16lodClamp, texel, f16bias); + sparseTextureClampARB(s2DShadow, c3, lodClamp, texel.x); + sparseTextureClampARB(s2DShadow, f16c2, compare, f16lodClamp, texel.x, f16bias); + sparseTextureClampARB(sCubeShadow, c4, lodClamp, texel.x); + sparseTextureClampARB(sCubeShadow, f16c3, compare, f16lodClamp, texel.x, f16bias); + sparseTextureClampARB(s2DArray, c3, lodClamp, texel); + sparseTextureClampARB(s2DArray, f16c3, f16lodClamp, texel, f16bias); + sparseTextureClampARB(sCubeArray, c4, lodClamp, texel); + sparseTextureClampARB(sCubeArray, f16c4, f16lodClamp, texel, f16bias); + sparseTextureClampARB(s2DArrayShadow, c4, lodClamp, texel.x); + sparseTextureClampARB(s2DArrayShadow, f16c3, compare, f16lodClamp, texel.x); + sparseTextureClampARB(sCubeArrayShadow, c4, compare, lodClamp, texel.x); + sparseTextureClampARB(sCubeArrayShadow, f16c4, compare, f16lodClamp, texel.x); + + return texel; +} + +f16vec4 testTextureClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureClampARB(s1D, c1, lodClamp); + texel += textureClampARB(s1D, f16c1, f16lodClamp, f16bias); + texel += textureClampARB(s2D, c2, lodClamp); + texel += textureClampARB(s2D, f16c2, f16lodClamp, f16bias); + texel += textureClampARB(s3D, c3, lodClamp); + texel += textureClampARB(s3D, f16c3, f16lodClamp, f16bias); + texel += textureClampARB(sCube, c3, lodClamp); + texel += textureClampARB(sCube, f16c3, f16lodClamp, f16bias); + texel.x += textureClampARB(s1DShadow, c3, lodClamp); + texel.x += textureClampARB(s1DShadow, f16c2, compare, f16lodClamp, f16bias); + texel.x += textureClampARB(s2DShadow, c3, lodClamp); + texel.x += textureClampARB(s2DShadow, f16c2, compare, f16lodClamp, f16bias); + texel.x += textureClampARB(sCubeShadow, c4, lodClamp); + texel.x += textureClampARB(sCubeShadow, f16c3, compare, f16lodClamp, f16bias); + texel += textureClampARB(s1DArray, c2, lodClamp); + texel += textureClampARB(s1DArray, f16c2, f16lodClamp, f16bias); + texel += textureClampARB(s2DArray, c3, lodClamp); + texel += textureClampARB(s2DArray, f16c3, f16lodClamp, f16bias); + texel += textureClampARB(sCubeArray, c4, lodClamp); + texel += textureClampARB(sCubeArray, f16c4, f16lodClamp, f16bias); + texel.x += textureClampARB(s1DArrayShadow, c3, lodClamp); + texel.x += textureClampARB(s1DArrayShadow, f16c2, compare, f16lodClamp, f16bias); + texel.x += textureClampARB(s2DArrayShadow, c4, lodClamp); + texel.x += textureClampARB(s2DArrayShadow, f16c3, compare, f16lodClamp); + texel.x += textureClampARB(sCubeArrayShadow, c4, compare, lodClamp); + texel.x += textureClampARB(sCubeArrayShadow, f16c4, compare, f16lodClamp); + + return texel; +} + +f16vec4 testSparseTextureOffsetClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureOffsetClampARB(s2D, c2, offset2, lodClamp, texel); + sparseTextureOffsetClampARB(s2D, f16c2, offset2, f16lodClamp, texel, f16bias); + sparseTextureOffsetClampARB(s3D, c3, offset3, lodClamp, texel); + sparseTextureOffsetClampARB(s3D, f16c3, offset3, f16lodClamp, texel, f16bias); + sparseTextureOffsetClampARB(s2DShadow, c3, offset2, lodClamp, texel.x); + sparseTextureOffsetClampARB(s2DShadow, f16c2, compare, offset2, f16lodClamp, texel.x, f16bias); + sparseTextureOffsetClampARB(s2DArray, c3, offset2, lodClamp, texel); + sparseTextureOffsetClampARB(s2DArray, f16c3, offset2, f16lodClamp, texel, f16bias); + sparseTextureOffsetClampARB(s2DArrayShadow, c4, offset2, lodClamp, texel.x); + sparseTextureOffsetClampARB(s2DArrayShadow, f16c3, compare, offset2, f16lodClamp, texel.x); + + return texel; +} + +f16vec4 testTextureOffsetClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureOffsetClampARB(s1D, c1, offset1, lodClamp); + texel += textureOffsetClampARB(s1D, f16c1, offset1, f16lodClamp, f16bias); + texel += textureOffsetClampARB(s2D, c2, offset2, lodClamp); + texel += textureOffsetClampARB(s2D, f16c2, offset2, f16lodClamp, f16bias); + texel += textureOffsetClampARB(s3D, c3, offset3, lodClamp); + texel += textureOffsetClampARB(s3D, f16c3, offset3, f16lodClamp, f16bias); + texel.x += textureOffsetClampARB(s1DShadow, c3, offset1, lodClamp); + texel.x += textureOffsetClampARB(s1DShadow, f16c2, compare, offset1, f16lodClamp, f16bias); + texel.x += textureOffsetClampARB(s2DShadow, c3, offset2, lodClamp); + texel.x += textureOffsetClampARB(s2DShadow, f16c2, compare, offset2, f16lodClamp, f16bias); + texel += textureOffsetClampARB(s1DArray, c2, offset1, lodClamp); + texel += textureOffsetClampARB(s1DArray, f16c2, offset1, f16lodClamp, f16bias); + texel += textureOffsetClampARB(s2DArray, c3, offset2, lodClamp); + texel += textureOffsetClampARB(s2DArray, f16c3, offset2, f16lodClamp, f16bias); + texel.x += textureOffsetClampARB(s1DArrayShadow, c3, offset1, lodClamp); + texel.x += textureOffsetClampARB(s1DArrayShadow, f16c2, compare, offset1, f16lodClamp, f16bias); + texel.x += textureOffsetClampARB(s2DArrayShadow, c4, offset2, lodClamp); + texel.x += textureOffsetClampARB(s2DArrayShadow, f16c3, compare, offset2, f16lodClamp); + + return texel; +} + +f16vec4 testSparseTextureGradClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGradClampARB(s2D, c2, dPdxy2, dPdxy2, lodClamp, texel); + sparseTextureGradClampARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, f16lodClamp, texel); + sparseTextureGradClampARB(s3D, c3, dPdxy3, dPdxy3, lodClamp, texel); + sparseTextureGradClampARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, f16lodClamp, texel); + sparseTextureGradClampARB(sCube, c3, dPdxy3, dPdxy3, lodClamp, texel); + sparseTextureGradClampARB(sCube, f16c3, f16dPdxy3, f16dPdxy3, f16lodClamp, texel); + sparseTextureGradClampARB(s2DShadow, c3, dPdxy2, dPdxy2, lodClamp, texel.x); + sparseTextureGradClampARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, f16lodClamp, texel.x); + sparseTextureGradClampARB(sCubeShadow, c4, dPdxy3, dPdxy3, lodClamp, texel.x); + sparseTextureGradClampARB(sCubeShadow, f16c3, compare, f16dPdxy3, f16dPdxy3, f16lodClamp, texel.x); + sparseTextureGradClampARB(s2DArray, c3, dPdxy2, dPdxy2, lodClamp, texel); + sparseTextureGradClampARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, f16lodClamp, texel); + sparseTextureGradClampARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, lodClamp, texel.x); + sparseTextureGradClampARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, f16lodClamp, texel.x); + sparseTextureGradClampARB(sCubeArray, c4, dPdxy3, dPdxy3, lodClamp, texel); + sparseTextureGradClampARB(sCubeArray, f16c4, f16dPdxy3, f16dPdxy3, f16lodClamp, texel); + + return texel; +} + +f16vec4 testTextureGradClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGradClampARB(s1D, c1, dPdxy1, dPdxy1, lodClamp); + texel += textureGradClampARB(s1D, f16c1, f16dPdxy1, f16dPdxy1, f16lodClamp); + texel += textureGradClampARB(s2D, c2, dPdxy2, dPdxy2, lodClamp); + texel += textureGradClampARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, f16lodClamp); + texel += textureGradClampARB(s3D, c3, dPdxy3, dPdxy3, lodClamp); + texel += textureGradClampARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, f16lodClamp); + texel += textureGradClampARB(sCube, c3, dPdxy3, dPdxy3, lodClamp); + texel += textureGradClampARB(sCube, f16c3, f16dPdxy3, f16dPdxy3, f16lodClamp); + texel.x += textureGradClampARB(s1DShadow, c3, dPdxy1, dPdxy1, lodClamp); + texel.x += textureGradClampARB(s1DShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, f16lodClamp); + texel.x += textureGradClampARB(s2DShadow, c3, dPdxy2, dPdxy2, lodClamp); + texel.x += textureGradClampARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, f16lodClamp); + texel.x += textureGradClampARB(sCubeShadow, c4, dPdxy3, dPdxy3, lodClamp); + texel.x += textureGradClampARB(sCubeShadow, f16c3, compare, f16dPdxy3, f16dPdxy3, f16lodClamp); + texel += textureGradClampARB(s1DArray, c2, dPdxy1, dPdxy1, lodClamp); + texel += textureGradClampARB(s1DArray, f16c2, f16dPdxy1, f16dPdxy1, f16lodClamp); + texel += textureGradClampARB(s2DArray, c3, dPdxy2, dPdxy2, lodClamp); + texel += textureGradClampARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, f16lodClamp); + texel.x += textureGradClampARB(s1DArrayShadow, c3, dPdxy1, dPdxy1, lodClamp); + texel.x += textureGradClampARB(s1DArrayShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, f16lodClamp); + texel.x += textureGradClampARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, lodClamp); + texel.x += textureGradClampARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, f16lodClamp); + texel += textureGradClampARB(sCubeArray, c4, dPdxy3, dPdxy3, lodClamp); + texel += textureGradClampARB(sCubeArray, f16c4, f16dPdxy3, f16dPdxy3, f16lodClamp); + + return texel; +} + +f16vec4 testSparseTextureGradOffsetClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGradOffsetClampARB(s2D, c2, dPdxy2, dPdxy2, offset2, lodClamp, texel); + sparseTextureGradOffsetClampARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp, texel); + sparseTextureGradOffsetClampARB(s3D, c3, dPdxy3, dPdxy3, offset3, lodClamp, texel); + sparseTextureGradOffsetClampARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, offset3, f16lodClamp, texel); + sparseTextureGradOffsetClampARB(s2DShadow, c3, dPdxy2, dPdxy2, offset2, lodClamp, texel.x); + sparseTextureGradOffsetClampARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp, texel.x); + sparseTextureGradOffsetClampARB(s2DArray, c3, dPdxy2, dPdxy2, offset2, lodClamp, texel); + sparseTextureGradOffsetClampARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp, texel); + sparseTextureGradOffsetClampARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, offset2, lodClamp, texel.x); + sparseTextureGradOffsetClampARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp, texel.x); + + return texel; +} + +f16vec4 testTextureGradOffsetClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGradOffsetClampARB(s1D, c1, dPdxy1, dPdxy1, offset1, lodClamp); + texel += textureGradOffsetClampARB(s1D, f16c1, f16dPdxy1, f16dPdxy1, offset1, f16lodClamp); + texel += textureGradOffsetClampARB(s2D, c2, dPdxy2, dPdxy2, offset2, lodClamp); + texel += textureGradOffsetClampARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp); + texel += textureGradOffsetClampARB(s3D, c3, dPdxy3, dPdxy3, offset3, lodClamp); + texel += textureGradOffsetClampARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, offset3, f16lodClamp); + texel.x += textureGradOffsetClampARB(s1DShadow, c3, dPdxy1, dPdxy1, offset1, lodClamp); + texel.x += textureGradOffsetClampARB(s1DShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, offset1, f16lodClamp); + texel.x += textureGradOffsetClampARB(s2DShadow, c3, dPdxy2, dPdxy2, offset2, lodClamp); + texel.x += textureGradOffsetClampARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp); + texel += textureGradOffsetClampARB(s1DArray, c2, dPdxy1, dPdxy1, offset1, lodClamp); + texel += textureGradOffsetClampARB(s1DArray, f16c2, f16dPdxy1, f16dPdxy1, offset1, f16lodClamp); + texel += textureGradOffsetClampARB(s2DArray, c3, dPdxy2, dPdxy2, offset2, lodClamp); + texel += textureGradOffsetClampARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp); + texel.x += textureGradOffsetClampARB(s1DArrayShadow, c3, dPdxy1, dPdxy1, offset1, lodClamp); + texel.x += textureGradOffsetClampARB(s1DArrayShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, offset1, f16lodClamp); + texel.x += textureGradOffsetClampARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, offset2, lodClamp); + texel.x += textureGradOffsetClampARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp); + + return texel; +} + +f16vec4 testCombinedTextureSampler() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += texture(f16sampler1D(t1D, s), c1); + texel += texture(f16sampler1D(t1D, s), f16c1, f16bias); + texel += texture(f16sampler2D(t2D, s), c2); + texel += texture(f16sampler2D(t2D, s), f16c2, f16bias); + texel += texture(f16sampler3D(t3D, s), c3); + texel += texture(f16sampler3D(t3D, s), f16c3, f16bias); + texel += texture(f16samplerCube(tCube, s), c3); + texel += texture(f16samplerCube(tCube, s), f16c3, f16bias); + texel.x += texture(f16sampler1DShadow(t1D, sShadow), c3); + texel.x += texture(f16sampler1DShadow(t1D, sShadow), f16c2, compare, f16bias); + texel.x += texture(f16sampler2DShadow(t2D, sShadow), c3); + texel.x += texture(f16sampler2DShadow(t2D, sShadow), f16c2, compare, f16bias); + texel.x += texture(f16samplerCubeShadow(tCube, sShadow), c4); + texel.x += texture(f16samplerCubeShadow(tCube, sShadow), f16c3, compare, f16bias); + texel += texture(f16sampler1DArray(t1DArray, s), c2); + texel += texture(f16sampler1DArray(t1DArray, s), f16c2, f16bias); + texel += texture(f16sampler2DArray(t2DArray, s), c3); + texel += texture(f16sampler2DArray(t2DArray, s), f16c3, f16bias); + texel += texture(f16samplerCubeArray(tCubeArray, s), c4); + texel += texture(f16samplerCubeArray(tCubeArray, s), f16c4, f16bias); + texel.x += texture(f16sampler1DArrayShadow(t1DArray, sShadow), c3); + texel.x += texture(f16sampler1DArrayShadow(t1DArray, sShadow), f16c2, compare, f16bias); + texel.x += texture(f16sampler2DArrayShadow(t2DArray, sShadow), c4); + texel.x += texture(f16sampler2DArrayShadow(t2DArray, sShadow), f16c3, compare); + texel += texture(f16sampler2DRect(t2DRect, s), c2); + texel += texture(f16sampler2DRect(t2DRect, s), f16c2); + texel.x += texture(f16sampler2DRectShadow(t2DRect, sShadow), c3); + texel.x += texture(f16sampler2DRectShadow(t2DRect, sShadow), f16c2, compare); + texel.x += texture(f16samplerCubeArrayShadow(tCubeArray, sShadow), c4, compare); + texel.x += texture(f16samplerCubeArrayShadow(tCubeArray, sShadow), f16c4, compare); + + return texel; +} + +f16vec4 testSubpassLoad() +{ + return subpassLoad(subpass) + subpassLoad(subpassMS, 2); +} + +void main() +{ + f16vec4 result = f16vec4(0.0hf); + + result += testTexture(); + result += testTextureProj(); + result += testTextureLod(); + result += testTextureOffset(); + result += testTextureLodOffset(); + result += testTextureProjLodOffset(); + result += testTexelFetch(); + result += testTexelFetchOffset(); + result += testTextureGrad(); + result += testTextureGradOffset(); + result += testTextureProjGrad(); + result += testTextureProjGradoffset(); + result += testTextureGather(); + result += testTextureGatherOffset(); + result += testTextureGatherOffsets(); + result += testTextureGatherLod(); + result += testTextureGatherLodOffset(); + result += testTextureGatherLodOffsets(); + + result += f16vec4(testTextureSize()); + result.xy += f16vec2(testTextureQueryLod()); + result.x += float16_t(testTextureQueryLevels()); + result.x += float16_t(testTextureSamples()); + + result += testImageLoad(); + testImageStore(result); + + result += testSparseTexture(); + result += testSparseTextureLod(); + result += testSparseTextureOffset(); + result += testSparseTextureLodOffset(); + result += testSparseTextureGrad(); + result += testSparseTextureGradOffset(); + result += testSparseTexelFetch(); + result += testSparseTexelFetchOffset(); + result += testSparseTextureGather(); + result += testSparseTextureGatherOffset(); + result += testSparseTextureGatherOffsets(); + result += testSparseTextureGatherLod(); + result += testSparseTextureGatherLodOffset(); + result += testSparseTextureGatherLodOffsets(); + + result += testSparseImageLoad(); + + result += testSparseTextureClamp(); + result += testTextureClamp(); + result += testSparseTextureOffsetClamp(); + result += testTextureOffsetClamp(); + result += testSparseTextureGrad(); + result += testTextureGrad(); + result += testSparseTextureGradOffsetClamp(); + result += testTextureGradOffsetClamp(); + + result += testCombinedTextureSampler(); + result += testSubpassLoad(); + + fragColor = result; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.float32.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.float32.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.float32.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.float32.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,277 @@ +#version 450 + +#extension GL_KHX_shader_explicit_arithmetic_types: enable +#extension GL_KHX_shader_explicit_arithmetic_types_int8: require +#extension GL_KHX_shader_explicit_arithmetic_types_int16: require +#extension GL_KHX_shader_explicit_arithmetic_types_int32: require +#extension GL_KHX_shader_explicit_arithmetic_types_int64: require +#extension GL_KHX_shader_explicit_arithmetic_types_float16: require +#extension GL_KHX_shader_explicit_arithmetic_types_float32: require +#extension GL_KHX_shader_explicit_arithmetic_types_float64: require + +void main() +{ +} + +// Single float literals +void literal() +{ + const float32_t f32c = 0.000001f; + const f32vec2 f32cv = f32vec2(-0.25F, 0.03f); + + f32vec2 f32v; + f32v.x = f32c; + f32v += f32cv; +} + +// Block memory layout +struct S +{ + float32_t x; + f32vec2 y; + f32vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + float32_t a; + f32vec2 b; + f32vec3 c; + float32_t d[2]; + f32mat2x3 e; + f32mat2x3 f[2]; + S g; + S h[2]; +}; + +// Specialization constant +layout(constant_id = 100) const float16_t sf16 = 0.125hf; +layout(constant_id = 101) const float32_t sf = 0.25; +layout(constant_id = 102) const float64_t sd = 0.5lf; + +const float f16_to_f = float(sf16); +const double f16_to_d = float(sf16); + +const float16_t f_to_f16 = float16_t(sf); +const float16_t d_to_f16 = float16_t(sd); + +void operators() +{ + float32_t f32; + f32vec2 f32v; + f32mat2x2 f32m; + bool b; + + // Arithmetic + f32v += f32v; + f32v -= f32v; + f32v *= f32v; + f32v /= f32v; + f32v++; + f32v--; + ++f32m; + --f32m; + f32v = -f32v; + f32m = -f32m; + + f32 = f32v.x + f32v.y; + f32 = f32v.x - f32v.y; + f32 = f32v.x * f32v.y; + f32 = f32v.x / f32v.y; + + // Relational + b = (f32v.x != f32); + b = (f32v.y == f32); + b = (f32v.x > f32); + b = (f32v.y < f32); + b = (f32v.x >= f32); + b = (f32v.y <= f32); + + // Vector/matrix operations + f32v = f32v * f32; + f32m = f32m * f32; + f32v = f32m * f32v; + f32v = f32v * f32m; + f32m = f32m * f32m; +} + +void typeCast() +{ + bvec3 bv; + f32vec3 f32v; + f64vec3 f64v; + i8vec3 i8v; + u8vec3 u8v; + i16vec3 i16v; + u16vec3 u16v; + i32vec3 i32v; + u32vec3 u32v; + i64vec3 i64v; + u64vec3 u64v; + f16vec3 f16v; + + f64v = f32v; // float32_t -> float64_t + + f32v = f32vec3(bv); // bool -> float32 + bv = bvec3(f32v); // float32 -> bool + + f32v = f32vec3(f64v); // double -> float32 + f64v = f64vec3(f32v); // float32 -> double + + f32v = f32vec3(f16v); // float16 -> float32 + f16v = f16vec3(f32v); // float32 -> float16 + + i8v = i8vec3(f32v); // float32 -> int8 + i16v = i16vec3(f32v); // float32 -> int16 + i32v = i32vec3(f32v); // float32 -> int32 + i64v = i64vec3(f32v); // float32 -> int64 + + u8v = u8vec3(f32v); // float32 -> uint8 + u16v = u16vec3(f32v); // float32 -> uint16 + u32v = u32vec3(f32v); // float32 -> uint32 + u64v = u64vec3(f32v); // float32 -> uint64 +} + +void builtinAngleTrigFuncs() +{ + f32vec4 f32v1, f32v2; + + f32v2 = radians(f32v1); + f32v2 = degrees(f32v1); + f32v2 = sin(f32v1); + f32v2 = cos(f32v1); + f32v2 = tan(f32v1); + f32v2 = asin(f32v1); + f32v2 = acos(f32v1); + f32v2 = atan(f32v1, f32v2); + f32v2 = atan(f32v1); + f32v2 = sinh(f32v1); + f32v2 = cosh(f32v1); + f32v2 = tanh(f32v1); + f32v2 = asinh(f32v1); + f32v2 = acosh(f32v1); + f32v2 = atanh(f32v1); +} + +void builtinExpFuncs() +{ + f32vec2 f32v1, f32v2; + + f32v2 = pow(f32v1, f32v2); + f32v2 = exp(f32v1); + f32v2 = log(f32v1); + f32v2 = exp2(f32v1); + f32v2 = log2(f32v1); + f32v2 = sqrt(f32v1); + f32v2 = inversesqrt(f32v1); +} + +void builtinCommonFuncs() +{ + f32vec3 f32v1, f32v2, f32v3; + float32_t f32; + bool b; + bvec3 bv; + ivec3 iv; + + f32v2 = abs(f32v1); + f32v2 = sign(f32v1); + f32v2 = floor(f32v1); + f32v2 = trunc(f32v1); + f32v2 = round(f32v1); + f32v2 = roundEven(f32v1); + f32v2 = ceil(f32v1); + f32v2 = fract(f32v1); + f32v2 = mod(f32v1, f32v2); + f32v2 = mod(f32v1, f32); + f32v3 = modf(f32v1, f32v2); + f32v3 = min(f32v1, f32v2); + f32v3 = min(f32v1, f32); + f32v3 = max(f32v1, f32v2); + f32v3 = max(f32v1, f32); + f32v3 = clamp(f32v1, f32, f32v2.x); + f32v3 = clamp(f32v1, f32v2, f32vec3(f32)); + f32v3 = mix(f32v1, f32v2, f32); + f32v3 = mix(f32v1, f32v2, f32v3); + f32v3 = mix(f32v1, f32v2, bv); + f32v3 = step(f32v1, f32v2); + f32v3 = step(f32, f32v3); + f32v3 = smoothstep(f32v1, f32v2, f32v3); + f32v3 = smoothstep(f32, f32v1.x, f32v2); + b = isnan(f32); + bv = isinf(f32v1); + f32v3 = fma(f32v1, f32v2, f32v3); + f32v2 = frexp(f32v1, iv); + f32v2 = ldexp(f32v1, iv); +} + +void builtinGeometryFuncs() +{ + float32_t f32; + f32vec3 f32v1, f32v2, f32v3; + + f32 = length(f32v1); + f32 = distance(f32v1, f32v2); + f32 = dot(f32v1, f32v2); + f32v3 = cross(f32v1, f32v2); + f32v2 = normalize(f32v1); + f32v3 = faceforward(f32v1, f32v2, f32v3); + f32v3 = reflect(f32v1, f32v2); + f32v3 = refract(f32v1, f32v2, f32); +} + +void builtinMatrixFuncs() +{ + f32mat2x3 f32m1, f32m2, f32m3; + f32mat3x2 f32m4; + f32mat3 f32m5; + f32mat4 f32m6, f32m7; + + f32vec3 f32v1; + f32vec2 f32v2; + + float32_t f32; + + f32m3 = matrixCompMult(f32m1, f32m2); + f32m1 = outerProduct(f32v1, f32v2); + f32m4 = transpose(f32m1); + f32 = determinant(f32m5); + f32m6 = inverse(f32m7); +} + +void builtinVecRelFuncs() +{ + f32vec3 f32v1, f32v2; + bvec3 bv; + + bv = lessThan(f32v1, f32v2); + bv = lessThanEqual(f32v1, f32v2); + bv = greaterThan(f32v1, f32v2); + bv = greaterThanEqual(f32v1, f32v2); + bv = equal(f32v1, f32v2); + bv = notEqual(f32v1, f32v2); +} + +in f32vec3 if32v; + +void builtinFragProcFuncs() +{ + f32vec3 f32v; + + // Derivative + f32v.x = dFdx(if32v.x); + f32v.y = dFdy(if32v.y); + f32v.xy = dFdxFine(if32v.xy); + f32v.xy = dFdyFine(if32v.xy); + f32v = dFdxCoarse(if32v); + f32v = dFdxCoarse(if32v); + + f32v.x = fwidth(if32v.x); + f32v.xy = fwidthFine(if32v.xy); + f32v = fwidthCoarse(if32v); + + // Interpolation + f32v.x = interpolateAtCentroid(if32v.x); + f32v.xy = interpolateAtSample(if32v.xy, 1); + f32v = interpolateAtOffset(if32v, f32vec2(0.5f)); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.float64.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.float64.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.float64.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.float64.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,272 @@ +#version 450 + +#extension GL_KHX_shader_explicit_arithmetic_types: enable +#extension GL_KHX_shader_explicit_arithmetic_types_int8: require +#extension GL_KHX_shader_explicit_arithmetic_types_int16: require +#extension GL_KHX_shader_explicit_arithmetic_types_int32: require +#extension GL_KHX_shader_explicit_arithmetic_types_int64: require +#extension GL_KHX_shader_explicit_arithmetic_types_float16: require +#extension GL_KHX_shader_explicit_arithmetic_types_float32: require +#extension GL_KHX_shader_explicit_arithmetic_types_float64: require + +void main() +{ +} + +// Single float literals +void literal() +{ + const float64_t f64c = 0.000001LF; + const f64vec2 f64cv = f64vec2(-0.25lF, 0.03Lf); + + f64vec2 f64v; + f64v.x = f64c; + f64v += f64cv; +} + +// Block memory layout +struct S +{ + float64_t x; + f64vec2 y; + f64vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + float64_t a; + f64vec2 b; + f64vec3 c; + float64_t d[2]; + f64mat2x3 e; + f64mat2x3 f[2]; + S g; + S h[2]; +}; + +// Specialization constant +layout(constant_id = 100) const float16_t sf16 = 0.125hf; +layout(constant_id = 101) const float32_t sf = 0.25; +layout(constant_id = 102) const float64_t sd = 0.5lf; + +const float f16_to_f = float(sf16); +const double f16_to_d = float(sf16); + +const float16_t f_to_f16 = float16_t(sf); +const float16_t d_to_f16 = float16_t(sd); + +void operators() +{ + float64_t f64; + f64vec2 f64v; + f64mat2x2 f64m; + bool b; + + // Arithmetic + f64v += f64v; + f64v -= f64v; + f64v *= f64v; + f64v /= f64v; + f64v++; + f64v--; + ++f64m; + --f64m; + f64v = -f64v; + f64m = -f64m; + + f64 = f64v.x + f64v.y; + f64 = f64v.x - f64v.y; + f64 = f64v.x * f64v.y; + f64 = f64v.x / f64v.y; + + // Relational + b = (f64v.x != f64); + b = (f64v.y == f64); + b = (f64v.x > f64); + b = (f64v.y < f64); + b = (f64v.x >= f64); + b = (f64v.y <= f64); + + // Vector/matrix operations + f64v = f64v * f64; + f64m = f64m * f64; + f64v = f64m * f64v; + f64v = f64v * f64m; + f64m = f64m * f64m; +} + +void typeCast() +{ + bvec3 bv; + f32vec3 f32v; + f64vec3 f64v; + i8vec3 i8v; + u8vec3 u8v; + i16vec3 i16v; + u16vec3 u16v; + i32vec3 i32v; + u32vec3 u32v; + i64vec3 i64v; + u64vec3 u64v; + f16vec3 f16v; + + f64v = f64vec3(bv); // bool -> float64 + bv = bvec3(f64v); // float64 -> bool + + f64v = f64vec3(f16v); // float16 -> float64 + f16v = f16vec3(f64v); // float64 -> float16 + + i8v = i8vec3(f64v); // float64 -> int8 + i16v = i16vec3(f64v); // float64 -> int16 + i32v = i32vec3(f64v); // float64 -> int32 + i64v = i64vec3(f64v); // float64 -> int64 + + u8v = u8vec3(f64v); // float64 -> uint8 + u16v = u16vec3(f64v); // float64 -> uint16 + u32v = u32vec3(f64v); // float64 -> uint32 + u64v = u64vec3(f64v); // float64 -> uint64 +} + +void builtinAngleTrigFuncs() +{ + f64vec4 f64v1, f64v2; + + f64v2 = radians(f64v1); + f64v2 = degrees(f64v1); + f64v2 = sin(f64v1); + f64v2 = cos(f64v1); + f64v2 = tan(f64v1); + f64v2 = asin(f64v1); + f64v2 = acos(f64v1); + f64v2 = atan(f64v1, f64v2); + f64v2 = atan(f64v1); + f64v2 = sinh(f64v1); + f64v2 = cosh(f64v1); + f64v2 = tanh(f64v1); + f64v2 = asinh(f64v1); + f64v2 = acosh(f64v1); + f64v2 = atanh(f64v1); +} + +void builtinExpFuncs() +{ + f64vec2 f64v1, f64v2; + + f64v2 = pow(f64v1, f64v2); + f64v2 = exp(f64v1); + f64v2 = log(f64v1); + f64v2 = exp2(f64v1); + f64v2 = log2(f64v1); + f64v2 = sqrt(f64v1); + f64v2 = inversesqrt(f64v1); +} + +void builtinCommonFuncs() +{ + f64vec3 f64v1, f64v2, f64v3; + float64_t f64; + bool b; + bvec3 bv; + ivec3 iv; + + f64v2 = abs(f64v1); + f64v2 = sign(f64v1); + f64v2 = floor(f64v1); + f64v2 = trunc(f64v1); + f64v2 = round(f64v1); + f64v2 = roundEven(f64v1); + f64v2 = ceil(f64v1); + f64v2 = fract(f64v1); + f64v2 = mod(f64v1, f64v2); + f64v2 = mod(f64v1, f64); + f64v3 = modf(f64v1, f64v2); + f64v3 = min(f64v1, f64v2); + f64v3 = min(f64v1, f64); + f64v3 = max(f64v1, f64v2); + f64v3 = max(f64v1, f64); + f64v3 = clamp(f64v1, f64, f64v2.x); + f64v3 = clamp(f64v1, f64v2, f64vec3(f64)); + f64v3 = mix(f64v1, f64v2, f64); + f64v3 = mix(f64v1, f64v2, f64v3); + f64v3 = mix(f64v1, f64v2, bv); + f64v3 = step(f64v1, f64v2); + f64v3 = step(f64, f64v3); + f64v3 = smoothstep(f64v1, f64v2, f64v3); + f64v3 = smoothstep(f64, f64v1.x, f64v2); + b = isnan(f64); + bv = isinf(f64v1); + f64v3 = fma(f64v1, f64v2, f64v3); + f64v2 = frexp(f64v1, iv); + f64v2 = ldexp(f64v1, iv); +} + +void builtinGeometryFuncs() +{ + float64_t f64; + f64vec3 f64v1, f64v2, f64v3; + + f64 = length(f64v1); + f64 = distance(f64v1, f64v2); + f64 = dot(f64v1, f64v2); + f64v3 = cross(f64v1, f64v2); + f64v2 = normalize(f64v1); + f64v3 = faceforward(f64v1, f64v2, f64v3); + f64v3 = reflect(f64v1, f64v2); + f64v3 = refract(f64v1, f64v2, f64); +} + +void builtinMatrixFuncs() +{ + f64mat2x3 f64m1, f64m2, f64m3; + f64mat3x2 f64m4; + f64mat3 f64m5; + f64mat4 f64m6, f64m7; + + f64vec3 f64v1; + f64vec2 f64v2; + + float64_t f64; + + f64m3 = matrixCompMult(f64m1, f64m2); + f64m1 = outerProduct(f64v1, f64v2); + f64m4 = transpose(f64m1); + f64 = determinant(f64m5); + f64m6 = inverse(f64m7); +} + +void builtinVecRelFuncs() +{ + f64vec3 f64v1, f64v2; + bvec3 bv; + + bv = lessThan(f64v1, f64v2); + bv = lessThanEqual(f64v1, f64v2); + bv = greaterThan(f64v1, f64v2); + bv = greaterThanEqual(f64v1, f64v2); + bv = equal(f64v1, f64v2); + bv = notEqual(f64v1, f64v2); +} + +in flat f64vec3 if64v; + +void builtinFragProcFuncs() +{ + f64vec3 f64v; + + // Derivative + f64v.x = dFdx(if64v.x); + f64v.y = dFdy(if64v.y); + f64v.xy = dFdxFine(if64v.xy); + f64v.xy = dFdyFine(if64v.xy); + f64v = dFdxCoarse(if64v); + f64v = dFdxCoarse(if64v); + + f64v.x = fwidth(if64v.x); + f64v.xy = fwidthFine(if64v.xy); + f64v = fwidthCoarse(if64v); + + // Interpolation + f64v.x = interpolateAtCentroid(if64v.x); + f64v.xy = interpolateAtSample(if64v.xy, 1); + f64v = interpolateAtOffset(if64v, f64vec2(0.5f)); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.fullyCovered.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.fullyCovered.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.fullyCovered.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.fullyCovered.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,9 @@ +#version 450 + +#extension GL_NV_conservative_raster_underestimation : enable + +out vec4 color; + +void main() { + color = vec4(gl_FragFullyCoveredNV, 0, 0, 0); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.glsl.register.noautoassign.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.glsl.register.noautoassign.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.glsl.register.noautoassign.frag 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.glsl.register.noautoassign.frag 2018-04-27 11:46:26.000000000 +0000 @@ -1,23 +1,23 @@ #version 450 uniform layout(binding=0) sampler g_sSamp1; -uniform sampler g_sSamp2; +uniform layout(binding=1) sampler g_sSamp2; uniform layout(binding=2) sampler g_sSamp3[2]; -uniform sampler g_sSamp4[3]; -uniform sampler g_sSamp5; +uniform layout(binding=3) sampler g_sSamp4[3]; +uniform layout(binding=4) sampler g_sSamp5; -uniform sampler g_sSamp_unused1; -uniform sampler g_sSamp_unused2; +uniform layout(binding=5) sampler g_sSamp_unused1; +uniform layout(binding=6) sampler g_sSamp_unused2; -uniform layout(binding=1) texture1D g_tTex1; -uniform texture1D g_tTex2; -uniform layout(binding=3) texture1D g_tTex3[2]; -uniform texture1D g_tTex4[3]; -uniform texture1D g_tTex5; +uniform layout(binding=7) texture1D g_tTex1; +uniform layout(binding=8) texture1D g_tTex2; +uniform layout(binding=9) texture1D g_tTex3[2]; +uniform layout(binding=10) texture1D g_tTex4[3]; +uniform layout(binding=11) texture1D g_tTex5; -uniform layout(binding=0) texture1D g_tTex_unused1; -uniform layout(binding=2) texture1D g_tTex_unused2; -uniform texture1D g_tTex_unused3; +uniform layout(binding=12) texture1D g_tTex_unused1; +uniform layout(binding=13) texture1D g_tTex_unused2; +uniform layout(binding=14) texture1D g_tTex_unused3; struct MyStruct_t { int a; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.int16.amd.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.int16.amd.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.int16.amd.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.int16.amd.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,314 @@ +#version 450 core + +#extension GL_ARB_gpu_shader_int64: enable +#extension GL_AMD_gpu_shader_half_float: enable +#extension GL_AMD_gpu_shader_int16: enable + +layout(binding = 0) uniform Uniforms +{ + uint i; +}; + +// int16/uint16 in block +layout(std140, binding = 1) uniform Block +{ + i16vec3 i16v; + uint16_t u16; +} block; + +// int16/uint16 for input +layout(location = 0) in flat u16vec3 iu16v; +layout(location = 1) in flat int16_t ii16; + +void literal() +{ + const int16_t i16c[3] = + { + 0x111S, // Hex + -2s, // Dec + 0400s, // Oct + }; + + const uint16_t u16c[] = + { + 0xFFFFus, // Hex + 65535US, // Dec + 0177777us, // Oct + }; + + uint16_t u16 = i16c[i] + u16c[i]; +} + +void operators() +{ + u16vec3 u16v; + int16_t i16; + uint16_t u16; + int i; + uint u; + bool b; + + // Unary + u16v++; + i16--; + ++i16; + --u16v; + + u16v = ~u16v; + + i16 = +i16; + u16v = -u16v; + + // Arithmetic + u16 += i16; + u16v -= u16v; + i16 *= i16; + u16v /= u16v; + u16v %= i16; + + u16v = u16v + u16v; + u16 = i16 - u16; + u16v = u16v * i16; + i16 = i16 * i16; + i16 = i16 % i16; + + // Shift + u16v <<= i16; + i16 >>= u16v.y; + + i16 = i16 << u16v.z; + u16v = u16v << i16; + + // Relational + b = (u16v.x != i16); + b = (i16 == u16v.x); + b = (u16v.x > u16v.y); + b = (i16 < u); + b = (u16v.y >= u16v.x); + b = (i16 <= i); + + // Bitwise + u16v |= i16; + u16 = i16 | u16; + i16 &= i16; + u16v = u16v & u16v; + u16v ^= i16; + u16v = u16v ^ i16; +} + +void typeCast() +{ + bvec2 bv; + ivec2 iv; + uvec2 uv; + vec2 fv; + dvec2 dv; + + f16vec2 f16v; + i64vec2 i64v; + u64vec2 u64v; + i16vec2 i16v; + u16vec2 u16v; + + i16v = i16vec2(bv); // bool -> int16 + u16v = u16vec2(bv); // bool -> uint16 + bv = bvec2(i16v); // int16 -> bool + bv = bvec2(u16v); // uint16 -> bool + + i16v = i16vec2(iv); // int -> int16 + u16v = u16vec2(iv); // int -> uint16 + iv = i16v; // int16 -> int + iv = ivec2(u16v); // uint16 -> int + + i16v = i16vec2(uv); // uint -> int16 + u16v = u16vec2(uv); // uint -> uint16 + uv = i16v; // int16 -> uint + uv = u16v; // uint16 -> uint + + i16v = i16vec2(fv); // float -> int16 + u16v = u16vec2(fv); // float -> uint16 + fv = i16v; // int16 -> float + fv = u16v; // uint16 -> float + + i16v = i16vec2(dv); // double -> int16 + u16v = u16vec2(dv); // double -> uint16 + dv = i16v; // int16 -> double + dv = u16v; // uint16 -> double + + i16v = i16vec2(f16v); // float16 -> int16 + u16v = u16vec2(f16v); // float16 -> uint16 + f16v = i16v; // int16 -> float16 + f16v = u16v; // uint16 -> float16 + + i16v = i16vec2(i64v); // int64 -> int16 + u16v = u16vec2(i64v); // int64 -> uint16 + i64v = i16v; // int16 -> int64 + i64v = i64vec2(u16v); // uint16 -> int64 + + i16v = i16vec2(u64v); // uint64 -> int16 + u16v = u16vec2(u64v); // uint64 -> uint16 + u64v = i16v; // int16 -> uint64 + u64v = u16v; // uint16 -> uint64 + + i16v = i16vec2(u16v); // uint16 -> int16 + u16v = i16v; // int16 -> uint16 +} + +void builtinFuncs() +{ + i16vec2 i16v; + u16vec3 u16v; + f16vec3 f16v; + bvec3 bv; + + int16_t i16; + uint16_t u16; + + // abs() + i16v = abs(i16v); + + // sign() + i16v = sign(i16v); + + // min() + i16v = min(i16v, i16); + i16v = min(i16v, i16vec2(-1s)); + u16v = min(u16v, u16); + u16v = min(u16v, u16vec3(0us)); + + // max() + i16v = max(i16v, i16); + i16v = max(i16v, i16vec2(-1s)); + u16v = max(u16v, u16); + u16v = max(u16v, u16vec3(0us)); + + // clamp() + i16v = clamp(i16v, -i16, i16); + i16v = clamp(i16v, -i16v, i16v); + u16v = clamp(u16v, -u16, u16); + u16v = clamp(u16v, -u16v, u16v); + + // mix() + i16 = mix(i16v.x, i16v.y, true); + i16v = mix(i16vec2(i16), i16vec2(-i16), bvec2(false)); + u16 = mix(u16v.x, u16v.y, true); + u16v = mix(u16vec3(u16), u16vec3(-u16), bvec3(false)); + + // frexp() + i16vec3 exp; + f16v = frexp(f16v, exp); + + // ldexp() + f16v = ldexp(f16v, exp); + + // float16BitsToInt16() + i16v = float16BitsToInt16(f16v.xy); + + // float16BitsToUint16() + u16v.x = float16BitsToUint16(f16v.z); + + // int16BitsToFloat16() + f16v.xy = int16BitsToFloat16(i16v); + + // uint16BitsToFloat16() + f16v = uint16BitsToFloat16(u16v); + + // packInt2x16() + int packi = packInt2x16(i16v); + + // unpackInt2x16() + i16v = unpackInt2x16(packi); + + // packUint2x16() + uint packu = packUint2x16(u16v.xy); + + // unpackUint2x16() + u16v.xy = unpackUint2x16(packu); + + // packInt4x16() + int64_t packi64 = packInt4x16(i16vec4(i16)); + + // unpackInt4x16() + i16v = unpackInt4x16(packi64).xy; + + // packUint4x16() + uint64_t packu64 = packUint4x16(u16vec4(u16)); + + // unpackUint4x16() + u16v = unpackUint4x16(packu64).xyz; + + // lessThan() + bv = lessThan(u16v, u16vec3(u16)); + bv.xy = lessThan(i16v, i16vec2(i16)); + + // lessThanEqual() + bv = lessThanEqual(u16v, u16vec3(u16)); + bv.xy = lessThanEqual(i16v, i16vec2(i16)); + + // greaterThan() + bv = greaterThan(u16v, u16vec3(u16)); + bv.xy = greaterThan(i16v, i16vec2(i16)); + + // greaterThanEqual() + bv = greaterThanEqual(u16v, u16vec3(u16)); + bv.xy = greaterThanEqual(i16v, i16vec2(i16)); + + // equal() + bv = equal(u16v, u16vec3(u16)); + bv.xy = equal(i16v, i16vec2(i16)); + + // notEqual() + bv = notEqual(u16v, u16vec3(u16)); + bv.xy = notEqual(i16v, i16vec2(i16)); +} + +// Type conversion for specialization constant +layout(constant_id = 100) const int64_t si64 = -10L; +layout(constant_id = 101) const uint64_t su64 = 20UL; +layout(constant_id = 102) const int si = -5; +layout(constant_id = 103) const uint su = 4; +layout(constant_id = 104) const bool sb = true; +layout(constant_id = 105) const int16_t si16 = -5S; +layout(constant_id = 106) const uint16_t su16 = 4US; + +// bool <-> int16/uint16 +const bool i16_to_b = bool(si16); +const bool u16_to_b = bool(su16); +const int16_t b_to_i16 = int16_t(sb); +const uint16_t b_to_u16 = uint16_t(sb); + +// int <-> int16/uint16 +const int i16_to_i = int(si16); +const int u16_to_i = int(su16); +const int16_t i_to_i16 = int16_t(si); +const uint16_t i_to_u16 = uint16_t(si); + +// uint <-> int16/uint16 +const uint i16_to_u = uint(si16); +const uint u16_to_u = uint(su16); +const int16_t u_to_i16 = int16_t(su); +const uint16_t u_to_u16 = uint16_t(su); + +// int64 <-> int16/uint16 +const int64_t i16_to_i64 = int64_t(si16); +const int64_t u16_to_i64 = int64_t(su16); +const int16_t i64_to_i16 = int16_t(si64); +const uint16_t i64_to_u16 = uint16_t(si64); + +// uint64 <-> int16/uint16 +const uint64_t i16_to_u64 = uint64_t(si16); +const uint64_t u16_to_u64 = uint64_t(su16); +const int16_t u64_to_i16 = int16_t(su64); +const uint16_t u64_to_u16 = uint16_t(su64); + +// int16 <-> uint16 +const uint16_t i16_to_u16 = uint16_t(si16); +const int16_t u16_to_i16 = int16_t(su16); + +void main() +{ + literal(); + operators(); + typeCast(); + builtinFuncs(); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.int16.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.int16.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.int16.frag 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.int16.frag 2018-04-27 11:46:26.000000000 +0000 @@ -1,314 +1,251 @@ -#version 450 core - -#extension GL_ARB_gpu_shader_int64: enable -#extension GL_AMD_gpu_shader_half_float: enable -#extension GL_AMD_gpu_shader_int16: enable - -layout(binding = 0) uniform Uniforms -{ - uint i; -}; - -// int16/uint16 in block -layout(std140, binding = 1) uniform Block -{ - i16vec3 i16v; - uint16_t u16; -} block; - -// int16/uint16 for input -layout(location = 0) in flat u16vec3 iu16v; -layout(location = 1) in flat int16_t ii16; - -void literal() -{ - const int16_t i16c[3] = - { - 0x111S, // Hex - -2s, // Dec - 0400s, // Oct - }; - - const uint16_t u16c[] = - { - 0xFFFFus, // Hex - 65535US, // Dec - 0177777us, // Oct - }; - - uint16_t u16 = i16c[i] + u16c[i]; -} - -void operators() -{ - u16vec3 u16v; - int16_t i16; - uint16_t u16; - int i; - uint u; - bool b; - - // Unary - u16v++; - i16--; - ++i16; - --u16v; - - u16v = ~u16v; - - i16 = +i16; - u16v = -u16v; - - // Arithmetic - u16 += i16; - u16v -= u16v; - i16 *= i16; - u16v /= u16v; - u16v %= i16; - - u16v = u16v + u16v; - u16 = i16 - u16; - u16v = u16v * i16; - i16 = i16 * i16; - i16 = i16 % i16; - - // Shift - u16v <<= i; - i16 >>= u16v.y; - - i16 = i16 << u16v.z; - u16v = u16v << i16; - - // Relational - b = (u16v.x != i16); - b = (i16 == u16v.x); - b = (u16v.x > u16v.y); - b = (i16 < u); - b = (u16v.y >= u16v.x); - b = (i16 <= i); - - // Bitwise - u16v |= i16; - u16 = i16 | u16; - i16 &= i16; - u16v = u16v & u16v; - u16v ^= i16; - u16v = u16v ^ i16; -} - -void typeCast() -{ - bvec2 bv; - ivec2 iv; - uvec2 uv; - vec2 fv; - dvec2 dv; - - f16vec2 f16v; - i64vec2 i64v; - u64vec2 u64v; - i16vec2 i16v; - u16vec2 u16v; - - i16v = i16vec2(bv); // bool -> int16 - u16v = u16vec2(bv); // bool -> uint16 - bv = bvec2(i16v); // int16 -> bool - bv = bvec2(u16v); // uint16 -> bool - - i16v = i16vec2(iv); // int -> int16 - u16v = u16vec2(iv); // int -> uint16 - iv = i16v; // int16 -> int - iv = ivec2(u16v); // uint16 -> int - - i16v = i16vec2(uv); // uint -> int16 - u16v = u16vec2(uv); // uint -> uint16 - uv = i16v; // int16 -> uint - uv = u16v; // uint16 -> uint - - i16v = i16vec2(fv); // float -> int16 - u16v = u16vec2(fv); // float -> uint16 - fv = i16v; // int16 -> float - fv = u16v; // uint16 -> float - - i16v = i16vec2(dv); // double -> int16 - u16v = u16vec2(dv); // double -> uint16 - dv = i16v; // int16 -> double - dv = u16v; // uint16 -> double - - i16v = i16vec2(f16v); // float16 -> int16 - u16v = u16vec2(f16v); // float16 -> uint16 - f16v = i16v; // int16 -> float16 - f16v = u16v; // uint16 -> float16 - - i16v = i16vec2(i64v); // int64 -> int16 - u16v = u16vec2(i64v); // int64 -> uint16 - i64v = i16v; // int16 -> int64 - i64v = i64vec2(u16v); // uint16 -> int64 - - i16v = i16vec2(u64v); // uint64 -> int16 - u16v = u16vec2(u64v); // uint64 -> uint16 - u64v = i16v; // int16 -> uint64 - u64v = u16v; // uint16 -> uint64 - - i16v = i16vec2(u16v); // uint16 -> int16 - u16v = i16v; // int16 -> uint16 -} - -void builtinFuncs() -{ - i16vec2 i16v; - u16vec3 u16v; - f16vec3 f16v; - bvec3 bv; - - int16_t i16; - uint16_t u16; - - // abs() - i16v = abs(i16v); - - // sign() - i16v = sign(i16v); - - // min() - i16v = min(i16v, i16); - i16v = min(i16v, i16vec2(-1s)); - u16v = min(u16v, u16); - u16v = min(u16v, u16vec3(0us)); - - // max() - i16v = max(i16v, i16); - i16v = max(i16v, i16vec2(-1s)); - u16v = max(u16v, u16); - u16v = max(u16v, u16vec3(0us)); - - // clamp() - i16v = clamp(i16v, -i16, i16); - i16v = clamp(i16v, -i16v, i16v); - u16v = clamp(u16v, -u16, u16); - u16v = clamp(u16v, -u16v, u16v); - - // mix() - i16 = mix(i16v.x, i16v.y, true); - i16v = mix(i16vec2(i16), i16vec2(-i16), bvec2(false)); - u16 = mix(u16v.x, u16v.y, true); - u16v = mix(u16vec3(u16), u16vec3(-u16), bvec3(false)); - - // frexp() - i16vec3 exp; - f16v = frexp(f16v, exp); - - // ldexp() - f16v = ldexp(f16v, exp); - - // float16BitsToInt16() - i16v = float16BitsToInt16(f16v.xy); - - // float16BitsToUint16() - u16v.x = float16BitsToUint16(f16v.z); - - // int16BitsToFloat16() - f16v.xy = int16BitsToFloat16(i16v); - - // uint16BitsToFloat16() - f16v = uint16BitsToFloat16(u16v); - - // packInt2x16() - int packi = packInt2x16(i16v); - - // unpackInt2x16() - i16v = unpackInt2x16(packi); - - // packUint2x16() - uint packu = packUint2x16(u16v.xy); - - // unpackUint2x16() - u16v.xy = unpackUint2x16(packu); - - // packInt4x16() - int64_t packi64 = packInt4x16(i16vec4(i16)); - - // unpackInt4x16() - i16v = unpackInt4x16(packi64).xy; - - // packUint4x16() - uint64_t packu64 = packUint4x16(u16vec4(u16)); - - // unpackUint4x16() - u16v = unpackUint4x16(packu64).xyz; - - // lessThan() - bv = lessThan(u16v, u16vec3(u16)); - bv.xy = lessThan(i16v, i16vec2(i16)); - - // lessThanEqual() - bv = lessThanEqual(u16v, u16vec3(u16)); - bv.xy = lessThanEqual(i16v, i16vec2(i16)); - - // greaterThan() - bv = greaterThan(u16v, u16vec3(u16)); - bv.xy = greaterThan(i16v, i16vec2(i16)); - - // greaterThanEqual() - bv = greaterThanEqual(u16v, u16vec3(u16)); - bv.xy = greaterThanEqual(i16v, i16vec2(i16)); - - // equal() - bv = equal(u16v, u16vec3(u16)); - bv.xy = equal(i16v, i16vec2(i16)); - - // notEqual() - bv = notEqual(u16v, u16vec3(u16)); - bv.xy = notEqual(i16v, i16vec2(i16)); -} - -// Type conversion for specialization constant -layout(constant_id = 100) const int64_t si64 = -10L; -layout(constant_id = 101) const uint64_t su64 = 20UL; -layout(constant_id = 102) const int si = -5; -layout(constant_id = 103) const uint su = 4; -layout(constant_id = 104) const bool sb = true; -layout(constant_id = 105) const int16_t si16 = -5S; -layout(constant_id = 106) const uint16_t su16 = 4US; - -// bool <-> int16/uint16 -const bool i16_to_b = bool(si16); -const bool u16_to_b = bool(su16); -const int16_t b_to_i16 = int16_t(sb); -const uint16_t b_to_u16 = uint16_t(sb); - -// int <-> int16/uint16 -const int i16_to_i = int(si16); -const int u16_to_i = int(su16); -const int16_t i_to_i16 = int16_t(si); -const uint16_t i_to_u16 = uint16_t(si); - -// uint <-> int16/uint16 -const uint i16_to_u = uint(si16); -const uint u16_to_u = uint(su16); -const int16_t u_to_i16 = int16_t(su); -const uint16_t u_to_u16 = uint16_t(su); - -// int64 <-> int16/uint16 -const int64_t i16_to_i64 = int64_t(si16); -const int64_t u16_to_i64 = int64_t(su16); -const int16_t i64_to_i16 = int16_t(si64); -const uint16_t i64_to_u16 = uint16_t(si64); - -// uint64 <-> int16/uint16 -const uint64_t i16_to_u64 = uint64_t(si16); -const uint64_t u16_to_u64 = uint64_t(su16); -const int16_t u64_to_i16 = int16_t(su64); -const uint16_t u64_to_u16 = uint16_t(su64); - -// int16 <-> uint16 -const uint16_t i16_to_u16 = uint16_t(si16); -const int16_t u16_to_i16 = int16_t(su16); - -void main() -{ - literal(); - operators(); - typeCast(); - builtinFuncs(); -} +#version 450 + +#extension GL_KHX_shader_explicit_arithmetic_types: enable +#extension GL_KHX_shader_explicit_arithmetic_types_int8: require +#extension GL_KHX_shader_explicit_arithmetic_types_int16: require +#extension GL_KHX_shader_explicit_arithmetic_types_int32: require +#extension GL_KHX_shader_explicit_arithmetic_types_int64: require +#extension GL_KHX_shader_explicit_arithmetic_types_float16: require +#extension GL_KHX_shader_explicit_arithmetic_types_float32: require +#extension GL_KHX_shader_explicit_arithmetic_types_float64: require + +layout(binding = 0) uniform Uniforms +{ + uint index; +}; + +layout(std140, binding = 1) uniform Block +{ + int16_t i16; + i16vec2 i16v2; + i16vec3 i16v3; + i16vec4 i16v4; + uint16_t u16; + u16vec2 u16v2; + u16vec3 u16v3; + u16vec4 u16v4; +} block; + +void main() +{ +} + +void literal() +{ + const int16_t i16Const[3] = + { + int16_t(-0x1111), // Hex + int16_t(-1), // Dec + int16_t(040000), // Oct + }; + + int16_t i16 = i16Const[index]; + + const uint16_t u16Const[] = + { + uint16_t(0xFFFF), // Hex + uint16_t(65535), // Dec + uint16_t(077777), // Oct + }; + + uint16_t u16 = u16Const[index]; +} + +void typeCast16() +{ + i8vec2 i8v; + u8vec2 u8v; + i16vec2 i16v; + u16vec2 u16v; + i32vec2 i32v; + u32vec2 u32v; + i64vec2 i64v; + u64vec2 u64v; + f16vec2 f16v; + f32vec2 f32v; + f64vec2 f64v; + bvec2 bv; + + i32v = i16v; // int16_t -> int32_t + i32v = u16v; // uint16_t -> int32_t + u16v = i16v; // int16_t -> uint16_t + u32v = i16v; // int16_t -> uint32_t + i64v = i16v; // int16_t -> int64_t + u64v = i16v; // int16_t -> uint64_t + u32v = u16v; // uint16_t -> uint32_t + i64v = u16v; // uint16_t -> int64_t + u64v = u16v; // uint16_t -> uint64_t + f16v = i16v; // int16_t -> float16_t + f32v = i16v; // int16_t -> float32_t + f64v = i16v; // int16_t -> float64_t + f16v = u16v; // uint16_t -> float16_t + f32v = u16v; // uint16_t -> float32_t + f64v = u16v; // uint16_t -> float64_t + + i32v = i32vec2(i16v); // int16_t -> int32_t + i32v = i32vec2(u16v); // uint16_t -> int32_t + u16v = u16vec2(i16v); // int16_t -> uint16_t + u32v = u32vec2(i16v); // int16_t -> uint32_t + i64v = i64vec2(i16v); // int16_t -> int64_t + u64v = i64vec2(i16v); // int16_t -> uint64_t + u32v = u32vec2(u16v); // uint16_t -> uint32_t + i64v = i64vec2(u16v); // uint16_t -> int64_t + u64v = i64vec2(u16v); // uint16_t -> uint64_t + f16v = f16vec2(i16v); // int16_t -> float16_t + f32v = f32vec2(i16v); // int16_t -> float32_t + f64v = f64vec2(i16v); // int16_t -> float64_t + f16v = f16vec2(u16v); // uint16_t -> float16_t + f32v = f32vec2(u16v); // uint16_t -> float32_t + f64v = f64vec2(u16v); // uint16_t -> float64_t + + i8v = i8vec2(i16v); // int16_t -> int8_t + i8v = i8vec2(u16v); // uint16_t -> int8_t + u8v = u8vec2(i16v); // int16_t -> uint8_t + u8v = u8vec2(u16v); // uint16_t -> uint8_t + i16v = u8vec2(u16v); // uint16_t -> int16_t + i16v = i16vec2(bv); // bool -> int16 + u16v = u16vec2(bv); // bool -> uint16 + bv = bvec2(i16v); // int16 -> bool + bv = bvec2(u16v); // uint16 -> bool +} +void operators() +{ + u16vec3 u16v; + int16_t i16; + uvec3 uv; + int32_t i; + int64_t i64; + bool b; + + // Unary + u16v++; + i16--; + ++i16; + --u16v; + + u16v = ~u16v; + + i16 = +i16; + u16v = -u16v; + + // Arithmetic + i16 += i16; + u16v -= u16v; + i *= i16; + uv /= u16v; + uv %= i16; + + uv = u16v + uv; + i64 = i16 - i64; + uv = u16v * uv; + i64 = i16 * i64; + i = i16 % i; + + // Shift + u16v <<= i16; + i16 >>= u16v.y; + + i16 = i16 << u16v.z; + uv = u16v << i; + + // Relational + b = (u16v.x != i16); + b = (i16 == u16v.x); + b = (u16v.x > uv.y); + b = (i16 < i); + b = (u16v.y >= uv.x); + b = (i16 <= i); + + // Bitwise + uv |= i16; + i = i16 | i; + i64 &= i16; + uv = u16v & uv; + uv ^= i16; + u16v = u16v ^ i16; +} + +void builtinFuncs() +{ + i16vec2 i16v; + i16vec4 i16v4; + u16vec3 u16v; + u16vec2 u16v2; + u16vec4 u16v4; + bvec3 bv; + int16_t i16; + uint16_t u16; + int32_t i32; + uint32_t u32; + int64_t i64; + uint64_t u64; + + // abs() + i16v = abs(i16v); + + // sign() + i16 = sign(i16); + + // min() + i16v = min(i16v, i16); + i16v = min(i16v, i16vec2(-1)); + u16v = min(u16v, u16); + u16v = min(u16v, u16vec3(0)); + + // max() + i16v = max(i16v, i16); + i16v = max(i16v, i16vec2(-1)); + u16v = max(u16v, u16); + u16v = max(u16v, u16vec3(0)); + + // clamp() + i16v = clamp(i16v, -i16, i16); + i16v = clamp(i16v, -i16v, i16v); + u16v = clamp(u16v, -u16, u16); + u16v = clamp(u16v, -u16v, u16v); + + // mix() + i16 = mix(i16v.x, i16v.y, true); + i16v = mix(i16vec2(i16), i16vec2(-i16), bvec2(false)); + u16 = mix(u16v.x, u16v.y, true); + u16v = mix(u16vec3(u16), u16vec3(-u16), bvec3(false)); + + //pack + i32 = pack32(i16v); + i64 = pack64(i16v4); + u32 = pack32(u16v2); + u64 = pack64(u16v4); + + i16v = unpack16(i32); + i16v4 = unpack16(i64); + u16v2 = unpack16(u32); + u16v4 = unpack16(u64); + + // lessThan() + bv = lessThan(u16v, u16vec3(u16)); + bv.xy = lessThan(i16v, i16vec2(i16)); + + // lessThanEqual() + bv = lessThanEqual(u16v, u16vec3(u16)); + bv.xy = lessThanEqual(i16v, i16vec2(i16)); + + // greaterThan() + bv = greaterThan(u16v, u16vec3(u16)); + bv.xy = greaterThan(i16v, i16vec2(i16)); + + // greaterThanEqual() + bv = greaterThanEqual(u16v, u16vec3(u16)); + bv.xy = greaterThanEqual(i16v, i16vec2(i16)); + + // equal() + bv = equal(u16v, u16vec3(u16)); + bv.xy = equal(i16v, i16vec2(i16)); + + // notEqual() + bv = notEqual(u16v, u16vec3(u16)); + bv.xy = notEqual(i16v, i16vec2(i16)); +} + +// Type conversion for specialization constant +layout(constant_id = 100) const int16_t si16 = int16_t(-10); +layout(constant_id = 101) const uint16_t su16 = uint16_t(20); diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.int32.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.int32.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.int32.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.int32.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,256 @@ +#version 450 + +#extension GL_KHX_shader_explicit_arithmetic_types: enable +#extension GL_KHX_shader_explicit_arithmetic_types_int8: require +#extension GL_KHX_shader_explicit_arithmetic_types_int16: require +#extension GL_KHX_shader_explicit_arithmetic_types_int32: require +#extension GL_KHX_shader_explicit_arithmetic_types_int64: require +#extension GL_KHX_shader_explicit_arithmetic_types_float16: require +#extension GL_KHX_shader_explicit_arithmetic_types_float32: require +#extension GL_KHX_shader_explicit_arithmetic_types_float64: require + +layout(binding = 0) uniform Uniforms +{ + uint index; +}; + +layout(std140, binding = 1) uniform Block +{ + int32_t i32; + i32vec2 i32v2; + i32vec3 i32v3; + i32vec4 i32v4; + uint32_t u32; + u32vec2 u32v2; + u32vec3 u32v3; + u32vec4 u32v4; +} block; + +void main() +{ +} + +void literal() +{ + + const int32_t i32Const[3] = + { + -0x11111111, // Hex + -1, // Dec + 04000000000, // Oct + }; + + int32_t i32 = i32Const[index]; + + const uint32_t u32Const[] = + { + 0xFFFFFFFF, // Hex + 4294967295, // Dec + 017777777777, // Oct + }; + + uint32_t u32 = u32Const[index]; +} + +void typeCast32() +{ + i8vec2 i8v; + u8vec2 u8v; + i16vec2 i16v; + u16vec2 u16v; + i32vec2 i32v; + u32vec2 u32v; + i64vec2 i64v; + u64vec2 u64v; + f16vec2 f16v; + f32vec2 f32v; + f64vec2 f64v; + bvec2 bv; + + u32v = i32v; // int32_t -> uint32_t + i64v = i32v; // int32_t -> int64_t + u64v = i32v; // int32_t -> uint64_t + i64v = u32v; // uint32_t -> int64_t + u64v = u32v; // uint32_t -> uint64_t + f32v = i32v; // int32_t -> float32_t + f64v = i32v; // int32_t -> float64_t + f32v = u32v; // uint32_t -> float32_t + f64v = u32v; // uint32_t -> float64_t + + i8v = i8vec2(i32v); // int32_t -> int8_t + i8v = i8vec2(u32v); // uint32_t -> int8_t + i16v = i16vec2(i32v); // int32_t -> int16_t + i16v = i16vec2(u32v); // uint32_t -> int16_t + i32v = i32vec2(i32v); // int32_t -> int32_t + i32v = i32vec2(u32v); // uint32_t -> int32_t + i64v = i64vec2(i32v); // int32_t -> int64_t + i64v = i64vec2(u32v); // uint32_t -> int64_t + u8v = u8vec2(i32v); // int32_t -> uint8_t + u8v = u8vec2(u32v); // uint32_t -> uint8_t + u16v = u16vec2(i32v); // int32_t -> uint16_t + u16v = u16vec2(u32v); // uint32_t -> uint16_t + u32v = u32vec2(i32v); // int32_t -> uint32_t + u32v = u32vec2(u32v); // uint32_t -> uint32_t + u64v = u64vec2(i32v); // int32_t -> uint64_t + u64v = u64vec2(u32v); // uint32_t -> uint64_t + + f16v = f16vec2(i32v); // int32_t -> float16_t + f32v = f32vec2(i32v); // int32_t -> float32_t + f64v = f64vec2(i32v); // int32_t -> float64_t + f16v = f16vec2(u32v); // uint32_t -> float16_t + f32v = f32vec2(u32v); // uint32_t -> float32_t + f64v = f64vec2(u32v); // uint32_t -> float64_t + + i32v = i32vec2(bv); // bool -> int32 + u32v = u32vec2(bv); // bool -> uint32 + bv = bvec2(i32v); // int32 -> bool + bv = bvec2(u32v); // uint32 -> bool +} + +void operators() +{ + u32vec3 u32v; + int32_t i32; + uvec3 uv; + int32_t i; + int64_t i64; + bool b; + + // Unary + u32v++; + i32--; + ++i32; + --u32v; + + u32v = ~u32v; + + i32 = +i32; + u32v = -u32v; + + // Arithmetic + i32 += i32; + u32v -= u32v; + i *= i32; + uv /= u32v; + uv %= i32; + + uv = u32v + uv; + i64 = i32 - i64; + uv = u32v * uv; + i64 = i32 * i64; + i = i32 % i; + + // Shift + u32v <<= i32; + i32 >>= u32v.y; + + i64 = i64 << u32v.z; + uv = u32v << i; + + // Relational + b = (u32v.x != i32); + b = (i32 == u32v.x); + b = (u32v.x > uv.y); + b = (i32 < i); + b = (u32v.y >= uv.x); + b = (i32 <= i); + + // Bitwise + uv |= i32; + i = i32 | i; + i64 &= i32; + uv = u32v & uv; + uv ^= i32; + u32v = u32v ^ i32; +} + +void builtinFuncs() +{ + i32vec2 i32v; + i32vec4 i32v4; + u32vec3 u32v; + u32vec2 u32v2; + u32vec4 u32v4; + bvec3 bv; + int32_t i32; + uint32_t u32; + int64_t i64; + uint64_t u64; + i8vec4 i8v4; + u8vec4 u8v4; + i16vec2 i16v2; + u16vec2 u16v2; + + // abs() + i32v = abs(i32v); + + // sign() + i32 = sign(i32); + + // min() + i32v = min(i32v, i32); + i32v = min(i32v, i32vec2(-1)); + u32v = min(u32v, u32); + u32v = min(u32v, u32vec3(0)); + + // max() + i32v = max(i32v, i32); + i32v = max(i32v, i32vec2(-1)); + u32v = max(u32v, u32); + u32v = max(u32v, u32vec3(0)); + + // clamp() + i32v = clamp(i32v, -i32, i32); + i32v = clamp(i32v, -i32v, i32v); + u32v = clamp(u32v, -u32, u32); + u32v = clamp(u32v, -u32v, u32v); + + // mix() + i32 = mix(i32v.x, i32v.y, true); + i32v = mix(i32vec2(i32), i32vec2(-i32), bvec2(false)); + u32 = mix(u32v.x, u32v.y, true); + u32v = mix(u32vec3(u32), u32vec3(-u32), bvec3(false)); + + //pack + i32 = pack32(i8v4); + i32 = pack32(i16v2); + u32 = pack32(u8v4); + u32 = pack32(u16v2); + + i32v = unpack32(i64); + u32v2 = unpack32(u64); + + // lessThan() + bv = lessThan(u32v, u32vec3(u32)); + bv.xy = lessThan(i32v, i32vec2(i32)); + + // lessThanEqual() + bv = lessThanEqual(u32v, u32vec3(u32)); + bv.xy = lessThanEqual(i32v, i32vec2(i32)); + + // greaterThan() + bv = greaterThan(u32v, u32vec3(u32)); + bv.xy = greaterThan(i32v, i32vec2(i32)); + + // greaterThanEqual() + bv = greaterThanEqual(u32v, u32vec3(u32)); + bv.xy = greaterThanEqual(i32v, i32vec2(i32)); + + // equal() + bv = equal(u32v, u32vec3(u32)); + bv.xy = equal(i32v, i32vec2(i32)); + + // notEqual() + bv = notEqual(u32v, u32vec3(u32)); + bv.xy = notEqual(i32v, i32vec2(i32)); +} + +// Type conversion for specialization constant +layout(constant_id = 100) const int32_t si32 = -10; +layout(constant_id = 101) const uint32_t su32 = 20U; +layout(constant_id = 102) const int si = -5; +layout(constant_id = 103) const uint su = 4; +layout(constant_id = 104) const bool sb = true; + +#define UINT32_MAX 4294967295u +uint32_t u32Max = UINT32_MAX; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.int64.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.int64.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.int64.frag 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.int64.frag 2018-04-27 11:46:26.000000000 +0000 @@ -1,6 +1,7 @@ #version 450 #extension GL_ARB_gpu_shader_int64: enable +#extension GL_KHX_shader_explicit_arithmetic_types_int64: require layout(binding = 0) uniform Uniforms { @@ -115,6 +116,8 @@ i64 = i64 % i; // Shift + u64v = u64v << i; + i64 = i64 >> uv.y; u64v <<= i; i64 >>= uv.y; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.int8.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.int8.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.int8.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.int8.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,253 @@ +#version 450 + +#extension GL_KHX_shader_explicit_arithmetic_types: enable +#extension GL_KHX_shader_explicit_arithmetic_types_int8: require +#extension GL_KHX_shader_explicit_arithmetic_types_int16: require +#extension GL_KHX_shader_explicit_arithmetic_types_int32: require +#extension GL_KHX_shader_explicit_arithmetic_types_int64: require +#extension GL_KHX_shader_explicit_arithmetic_types_float16: require +#extension GL_KHX_shader_explicit_arithmetic_types_float32: require +#extension GL_KHX_shader_explicit_arithmetic_types_float64: require + +layout(binding = 0) uniform Uniforms +{ + uint index; +}; + +layout(std140, binding = 1) uniform Block +{ + int8_t i8; + i8vec2 i8v2; + i8vec3 i8v3; + i8vec4 i8v4; + uint8_t u8; + u8vec2 u8v2; + u8vec3 u8v3; + u8vec4 u8v4; +} block; + +void main() +{ +} + +void literal() +{ + const int8_t i8Const[3] = + { + int8_t(-0x11), // Hex + int8_t(-1), // Dec + int8_t(0400), // Oct + }; + + int8_t i8 = i8Const[index]; + + const uint8_t u8Const[] = + { + uint8_t(0xFF), // Hex + uint8_t(255), // Dec + uint8_t(0177), // Oct + }; + + uint8_t u8 = u8Const[index]; +} + +void typeCast8() +{ + i8vec2 i8v; + u8vec2 u8v; + i16vec2 i16v; + u16vec2 u16v; + i32vec2 i32v; + u32vec2 u32v; + i64vec2 i64v; + u64vec2 u64v; + f16vec2 f16v; + f32vec2 f32v; + f64vec2 f64v; + bvec2 bv; + + u8v = i8v; // int8_t -> uint8_t + i16v = i8v; // int8_t -> int16_t + i16v = u8v; // uint8_t -> int16_t + i32v = i8v; // int8_t -> int32_t + i32v = u8v; // uint8_t -> int32_t + u32v = i8v; // int8_t -> uint32_t + i64v = i8v; // int8_t -> int64_t + u64v = i8v; // int8_t -> uint64_t + u32v = u8v; // uint8_t -> uint32_t + i64v = u8v; // uint8_t -> int64_t + u64v = u8v; // uint8_t -> uint64_t + f16v = i8v; // int8_t -> float16_t + f32v = i8v; // int8_t -> float32_t + f64v = i8v; // int8_t -> float64_t + f16v = u8v; // uint8_t -> float16_t + f32v = u8v; // uint8_t -> float32_t + f64v = u8v; // uint8_t -> float64_t + + i8v = i8vec2(u8v); // uint8_t -> int8_t + i16v = i16vec2(i8v); // int8_t -> int16_t + i16v = i16vec2(u8v); // uint8_t -> int16_t + i32v = i32vec2(i8v); // int8_t -> int32_t + i32v = i32vec2(u8v); // uint8_t -> int32_t + i64v = i64vec2(i8v); // int8_t -> int64_t + u64v = i64vec2(i8v); // int8_t -> uint64_t + u16v = u16vec2(i8v); // int8_t -> uint16_t + u16v = u16vec2(u8v); // uint8_t -> uint16_t + u32v = u32vec2(u8v); // uint8_t -> uint32_t + i64v = i64vec2(u8v); // uint8_t -> int64_t + u64v = i64vec2(u8v); // uint8_t -> uint64_t + f16v = f16vec2(i8v); // int8_t -> float16_t + f32v = f32vec2(i8v); // int8_t -> float32_t + f64v = f64vec2(i8v); // int8_t -> float64_t + f16v = f16vec2(u8v); // uint8_t -> float16_t + f32v = f32vec2(u8v); // uint8_t -> float32_t + f64v = f64vec2(u8v); // uint8_t -> float64_t + + i8v = i8vec2(bv); // bool -> int8 + u8v = u8vec2(bv); // bool -> uint8 + bv = bvec2(i8v); // int8 -> bool + bv = bvec2(u8v); // uint8 -> bool +} + +void operators() +{ + u8vec3 u8v; + int8_t i8; + uvec3 uv; + int32_t i; + int16_t i16; + bool b; + + // Unary + u8v++; + i8--; + ++i8; + --u8v; + + u8v = ~u8v; + + i8 = +i8; + u8v = -u8v; + + // Arithmetic + i8 += i8; + u8v -= u8v; + i *= i8; + uv /= u8v; + uv %= i8; + + uv = u8v + uv; + i16 = i8 - i16; + uv = u8v * uv; + i16 = i8 * i16; + i = i8 % i; + + // Shift + u8v <<= i8; + i8 >>= u8v.y; + + i8 = i8 << u8v.z; + u8v = u8v << i8; + + // Relational + b = (u8v.x != i8); + b = (i8 == u8v.x); + b = (u8v.x > uv.y); + b = (i8 < i); + b = (u8v.y >= uv.x); + b = (i8 <= i); + + // Bitwise + uv |= i8; + i = i8 | i; + i16 &= i8; + uv = u8v & uv; + uv ^= i8; + u8v = u8v ^ i8; +} + +void builtinFuncs() +{ + i8vec2 i8v; + i8vec4 i8v4; + u8vec3 u8v; + u8vec2 u8v2; + u8vec4 u8v4; + bvec3 bv; + int16_t i16; + int32_t i32; + uint16_t u16; + uint32_t u32; + + int8_t i8; + uint8_t u8; + + // abs() + i8v = abs(i8v); + + // sign() + i8 = sign(i8); + + // min() + i8v = min(i8v, i8); + i8v = min(i8v, i8vec2(-1)); + u8v = min(u8v, u8); + u8v = min(u8v, u8vec3(0)); + + // max() + i8v = max(i8v, i8); + i8v = max(i8v, i8vec2(-1)); + u8v = max(u8v, u8); + u8v = max(u8v, u8vec3(0)); + + // clamp() + i8v = clamp(i8v, -i8, i8); + i8v = clamp(i8v, -i8v, i8v); + u8v = clamp(u8v, -u8, u8); + u8v = clamp(u8v, -u8v, u8v); + + // mix() + i8 = mix(i8v.x, i8v.y, true); + i8v = mix(i8vec2(i8), i8vec2(-i8), bvec2(false)); + u8 = mix(u8v.x, u8v.y, true); + u8v = mix(u8vec3(u8), u8vec3(-u8), bvec3(false)); + + //pack + i16 = pack16(i8v); + i32 = pack32(i8v4); + u16 = pack16(u8v2); + u32 = pack32(u8v4); + + i8v = unpack8(i16); + i8v4 = unpack8(i32); + u8v2 = unpack8(u16); + u8v4 = unpack8(u32); + + // lessThan() + bv = lessThan(u8v, u8vec3(u8)); + bv.xy = lessThan(i8v, i8vec2(i8)); + + // lessThanEqual() + bv = lessThanEqual(u8v, u8vec3(u8)); + bv.xy = lessThanEqual(i8v, i8vec2(i8)); + + // greaterThan() + bv = greaterThan(u8v, u8vec3(u8)); + bv.xy = greaterThan(i8v, i8vec2(i8)); + + // greaterThanEqual() + bv = greaterThanEqual(u8v, u8vec3(u8)); + bv.xy = greaterThanEqual(i8v, i8vec2(i8)); + + // equal() + bv = equal(u8v, u8vec3(u8)); + bv.xy = equal(i8v, i8vec2(i8)); + + // notEqual() + bv = notEqual(u8v, u8vec3(u8)); + bv.xy = notEqual(i8v, i8vec2(i8)); +} + +// Type conversion for specialization constant +layout(constant_id = 100) const int8_t si8 = int8_t(-10); +layout(constant_id = 101) const uint8_t su8 = uint8_t(20); diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.noBuiltInLoc.vert vulkan-1.1.73+dfsg/external/glslang/Test/spv.noBuiltInLoc.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.noBuiltInLoc.vert 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.noBuiltInLoc.vert 2018-04-27 11:46:26.000000000 +0000 @@ -10,6 +10,8 @@ uniform float uv2; uniform vec3 uv3; +layout(binding = 0) uniform atomic_uint a_uint; + void main() { bar = foo; diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.nonuniform.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.nonuniform.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.nonuniform.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.nonuniform.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,55 @@ +#version 450 + +#extension GL_EXT_nonuniform_qualifier : enable + +layout(location=0) nonuniformEXT in vec4 nu_inv4; +nonuniformEXT float nu_gf; +layout(location=1) in nonuniformEXT flat int nu_ii; + +layout(binding=0, input_attachment_index = 0) uniform subpassInput inputAttachmentDyn[]; +layout(binding=1) uniform samplerBuffer uniformTexelBufferDyn[]; +layout(binding=2, r32f) uniform imageBuffer storageTexelBufferDyn[]; +layout(binding=3) uniform uname { float a; } uniformBuffer[]; +layout(binding=4) buffer bname { float b; } storageBuffer[]; +layout(binding=5) uniform sampler2D sampledImage[]; +layout(binding=6, r32f) uniform image2D storageImage[]; +layout(binding=7, input_attachment_index = 1) uniform subpassInput inputAttachment[]; +layout(binding=8) uniform samplerBuffer uniformTexelBuffer[]; +layout(binding=9, r32f) uniform imageBuffer storageTexelBuffer[]; + +nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f) +{ + return nupi; +} + +void main() +{ + nonuniformEXT int nu_li; + int dyn_i; + + int a = foo(nu_li, nu_li); + nu_li = nonuniformEXT(a) + nonuniformEXT(a * 2); + + float b; + b = nu_inv4.x * nu_gf; + b += subpassLoad(inputAttachmentDyn[dyn_i]).x; + b += texelFetch(uniformTexelBufferDyn[dyn_i], 1).x; + b += imageLoad(storageTexelBufferDyn[dyn_i], 1).x; + b += uniformBuffer[nu_ii].a; + b += storageBuffer[nu_ii].b; + b += texture(sampledImage[nu_ii], vec2(0.5)).x; + b += imageLoad(storageImage[nu_ii], ivec2(1)).x; + b += subpassLoad(inputAttachment[nu_ii]).x; + b += texelFetch(uniformTexelBuffer[nu_ii], 1).x; + b += imageLoad(storageTexelBuffer[nu_ii], 1).x; + + nonuniformEXT ivec4 v; + nonuniformEXT mat4 m; + nonuniformEXT struct S { int a; } s; + ivec4 uv; + b += uniformBuffer[v.y].a; + b += uniformBuffer[v[2]].a; + b += uniformBuffer[uv[nu_ii]].a; + b += uniformBuffer[int(m[2].z)].a; + b += uniformBuffer[s.a].a; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.rankShift.comp vulkan-1.1.73+dfsg/external/glslang/Test/spv.rankShift.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.rankShift.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.rankShift.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,15 @@ +#version 450 +#extension GL_ARB_gpu_shader_int64 : require + +layout(local_size_x = 54) in; + +layout(location=4) uniform int64_t arg0; +layout(location=5) uniform uint arg1; + +void main() +{ + uint64_t result = arg0 << arg1; + result = arg0 >> arg1; + result <<= arg1; + result >>= arg1; +} \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.sample.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.sample.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.sample.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.sample.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,9 @@ +#version 450 + +layout(location = 0) in sample vec4 samp; +layout(location = 0) out vec4 color; + +void main() +{ + color = samp; +} \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.sampleId.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.sampleId.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.sampleId.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.sampleId.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,12 @@ +#version 450 + +layout(location = 0) in vec4 samp; +layout(location = 0) out vec4 color; + +void main() +{ + if (gl_SampleID < 3) + color = samp; + else + color = 2 * samp; +} \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.samplePosition.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.samplePosition.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.samplePosition.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.samplePosition.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,12 @@ +#version 450 + +layout(location = 0) in vec4 samp; +layout(location = 0) out vec4 color; + +void main() +{ + if (gl_SamplePosition.y < 0.5) + color = samp; + else + color = 2 * samp; +} \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.shaderBallotAMD.comp vulkan-1.1.73+dfsg/external/glslang/Test/spv.shaderBallotAMD.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.shaderBallotAMD.comp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.shaderBallotAMD.comp 2018-04-27 11:46:26.000000000 +0000 @@ -2,6 +2,7 @@ #extension GL_ARB_gpu_shader_int64: enable #extension GL_AMD_gpu_shader_half_float: enable +#extension GL_AMD_gpu_shader_int16: enable #extension GL_AMD_shader_ballot: enable layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; @@ -15,17 +16,21 @@ int64_t i64; u64vec2 u64v; f16vec3 f16v; + i16vec4 i16v; + uint16_t u16; }; void main() { - i = minInvocationsAMD(i); + i = minInvocationsAMD(i); uv = minInvocationsAMD(uv); fv = minInvocationsAMD(fv); dv = minInvocationsAMD(dv); i64 = minInvocationsAMD(i64); u64v = minInvocationsAMD(u64v); f16v = minInvocationsAMD(f16v); + i16v = minInvocationsAMD(i16v); + u16 = minInvocationsAMD(u16); i = maxInvocationsAMD(i); uv = maxInvocationsAMD(uv); @@ -34,6 +39,8 @@ i64 = maxInvocationsAMD(i64); u64v = maxInvocationsAMD(u64v); f16v = maxInvocationsAMD(f16v); + i16v = maxInvocationsAMD(i16v); + u16 = maxInvocationsAMD(u16); i = addInvocationsAMD(i); uv = addInvocationsAMD(uv); @@ -42,6 +49,8 @@ i64 = addInvocationsAMD(i64); u64v = addInvocationsAMD(u64v); f16v = addInvocationsAMD(f16v); + i16v = addInvocationsAMD(i16v); + u16 = addInvocationsAMD(u16); i = minInvocationsNonUniformAMD(i); uv = minInvocationsNonUniformAMD(uv); @@ -50,6 +59,8 @@ i64 = minInvocationsNonUniformAMD(i64); u64v = minInvocationsNonUniformAMD(u64v); f16v = minInvocationsNonUniformAMD(f16v); + i16v = minInvocationsNonUniformAMD(i16v); + u16 = minInvocationsNonUniformAMD(u16); i = maxInvocationsNonUniformAMD(i); uv = maxInvocationsNonUniformAMD(uv); @@ -58,6 +69,8 @@ i64 = maxInvocationsNonUniformAMD(i64); u64v = maxInvocationsNonUniformAMD(u64v); f16v = maxInvocationsNonUniformAMD(f16v); + i16v = maxInvocationsNonUniformAMD(i16v); + u16 = maxInvocationsNonUniformAMD(u16); i = addInvocationsNonUniformAMD(i); uv = addInvocationsNonUniformAMD(uv); @@ -66,6 +79,8 @@ i64 = addInvocationsNonUniformAMD(i64); u64v = addInvocationsNonUniformAMD(u64v); f16v = addInvocationsNonUniformAMD(f16v); + i16v = addInvocationsNonUniformAMD(i16v); + u16 = addInvocationsNonUniformAMD(u16); i = minInvocationsInclusiveScanAMD(i); uv = minInvocationsInclusiveScanAMD(uv); @@ -74,6 +89,8 @@ i64 = minInvocationsInclusiveScanAMD(i64); u64v = minInvocationsInclusiveScanAMD(u64v); f16v = minInvocationsInclusiveScanAMD(f16v); + i16v = minInvocationsInclusiveScanAMD(i16v); + u16 = minInvocationsInclusiveScanAMD(u16); i = maxInvocationsInclusiveScanAMD(i); uv = maxInvocationsInclusiveScanAMD(uv); @@ -82,6 +99,8 @@ i64 = maxInvocationsInclusiveScanAMD(i64); u64v = maxInvocationsInclusiveScanAMD(u64v); f16v = maxInvocationsInclusiveScanAMD(f16v); + i16v = maxInvocationsInclusiveScanAMD(i16v); + u16 = maxInvocationsInclusiveScanAMD(u16); i = addInvocationsInclusiveScanAMD(i); uv = addInvocationsInclusiveScanAMD(uv); @@ -90,6 +109,8 @@ i64 = addInvocationsInclusiveScanAMD(i64); u64v = addInvocationsInclusiveScanAMD(u64v); f16v = addInvocationsInclusiveScanAMD(f16v); + i16v = addInvocationsInclusiveScanAMD(i16v); + u16 = addInvocationsInclusiveScanAMD(u16); i = minInvocationsExclusiveScanAMD(i); uv = minInvocationsExclusiveScanAMD(uv); @@ -98,6 +119,8 @@ i64 = minInvocationsExclusiveScanAMD(i64); u64v = minInvocationsExclusiveScanAMD(u64v); f16v = minInvocationsExclusiveScanAMD(f16v); + i16v = minInvocationsExclusiveScanAMD(i16v); + u16 = minInvocationsExclusiveScanAMD(u16); i = maxInvocationsExclusiveScanAMD(i); uv = maxInvocationsExclusiveScanAMD(uv); @@ -106,6 +129,8 @@ i64 = maxInvocationsExclusiveScanAMD(i64); u64v = maxInvocationsExclusiveScanAMD(u64v); f16v = maxInvocationsExclusiveScanAMD(f16v); + i16v = maxInvocationsExclusiveScanAMD(i16v); + u16 = maxInvocationsExclusiveScanAMD(u16); i = addInvocationsExclusiveScanAMD(i); uv = addInvocationsExclusiveScanAMD(uv); @@ -114,6 +139,8 @@ i64 = addInvocationsExclusiveScanAMD(i64); u64v = addInvocationsExclusiveScanAMD(u64v); f16v = addInvocationsExclusiveScanAMD(f16v); + i16v = addInvocationsExclusiveScanAMD(i16v); + u16 = addInvocationsExclusiveScanAMD(u16); i = minInvocationsInclusiveScanNonUniformAMD(i); uv = minInvocationsInclusiveScanNonUniformAMD(uv); @@ -122,6 +149,8 @@ i64 = minInvocationsInclusiveScanNonUniformAMD(i64); u64v = minInvocationsInclusiveScanNonUniformAMD(u64v); f16v = minInvocationsInclusiveScanNonUniformAMD(f16v); + i16v = minInvocationsInclusiveScanNonUniformAMD(i16v); + u16 = minInvocationsInclusiveScanNonUniformAMD(u16); i = maxInvocationsInclusiveScanNonUniformAMD(i); uv = maxInvocationsInclusiveScanNonUniformAMD(uv); @@ -130,6 +159,8 @@ i64 = maxInvocationsInclusiveScanNonUniformAMD(i64); u64v = maxInvocationsInclusiveScanNonUniformAMD(u64v); f16v = maxInvocationsInclusiveScanNonUniformAMD(f16v); + i16v = maxInvocationsInclusiveScanNonUniformAMD(i16v); + u16 = maxInvocationsInclusiveScanNonUniformAMD(u16); i = addInvocationsInclusiveScanNonUniformAMD(i); uv = addInvocationsInclusiveScanNonUniformAMD(uv); @@ -138,6 +169,8 @@ i64 = addInvocationsInclusiveScanNonUniformAMD(i64); u64v = addInvocationsInclusiveScanNonUniformAMD(u64v); f16v = addInvocationsInclusiveScanNonUniformAMD(f16v); + i16v = addInvocationsInclusiveScanNonUniformAMD(i16v); + u16 = addInvocationsInclusiveScanNonUniformAMD(u16); i = minInvocationsExclusiveScanNonUniformAMD(i); uv = minInvocationsExclusiveScanNonUniformAMD(uv); @@ -146,6 +179,8 @@ i64 = minInvocationsExclusiveScanNonUniformAMD(i64); u64v = minInvocationsExclusiveScanNonUniformAMD(u64v); f16v = minInvocationsExclusiveScanNonUniformAMD(f16v); + i16v = minInvocationsExclusiveScanNonUniformAMD(i16v); + u16 = minInvocationsExclusiveScanNonUniformAMD(u16); i = maxInvocationsExclusiveScanNonUniformAMD(i); uv = maxInvocationsExclusiveScanNonUniformAMD(uv); @@ -154,6 +189,8 @@ i64 = maxInvocationsExclusiveScanNonUniformAMD(i64); u64v = maxInvocationsExclusiveScanNonUniformAMD(u64v); f16v = maxInvocationsExclusiveScanNonUniformAMD(f16v); + i16v = maxInvocationsExclusiveScanNonUniformAMD(i16v); + u16 = maxInvocationsExclusiveScanNonUniformAMD(u16); i = addInvocationsExclusiveScanNonUniformAMD(i); uv = addInvocationsExclusiveScanNonUniformAMD(uv); @@ -162,4 +199,6 @@ i64 = addInvocationsExclusiveScanNonUniformAMD(i64); u64v = addInvocationsExclusiveScanNonUniformAMD(u64v); f16v = addInvocationsExclusiveScanNonUniformAMD(f16v); + i16v = addInvocationsExclusiveScanNonUniformAMD(i16v); + u16 = addInvocationsExclusiveScanNonUniformAMD(u16); } diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupArithmetic.comp vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupArithmetic.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupArithmetic.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupArithmetic.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,393 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_arithmetic: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupAdd(data[3].f4); + + data[invocation].i4.x = subgroupAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupAdd(data[3].i4); + + data[invocation].u4.x = subgroupAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupAdd(data[3].u4); + + data[invocation].d4.x = subgroupAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupAdd(data[3].d4); + + data[invocation].f4.x = subgroupMul(data[0].f4.x); + data[invocation].f4.xy = subgroupMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMul(data[2].f4.xyz); + data[invocation].f4 = subgroupMul(data[3].f4); + + data[invocation].i4.x = subgroupMul(data[0].i4.x); + data[invocation].i4.xy = subgroupMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMul(data[2].i4.xyz); + data[invocation].i4 = subgroupMul(data[3].i4); + + data[invocation].u4.x = subgroupMul(data[0].u4.x); + data[invocation].u4.xy = subgroupMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMul(data[2].u4.xyz); + data[invocation].u4 = subgroupMul(data[3].u4); + + data[invocation].d4.x = subgroupMul(data[0].d4.x); + data[invocation].d4.xy = subgroupMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMul(data[2].d4.xyz); + data[invocation].d4 = subgroupMul(data[3].d4); + + data[invocation].f4.x = subgroupMin(data[0].f4.x); + data[invocation].f4.xy = subgroupMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMin(data[2].f4.xyz); + data[invocation].f4 = subgroupMin(data[3].f4); + + data[invocation].i4.x = subgroupMin(data[0].i4.x); + data[invocation].i4.xy = subgroupMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMin(data[2].i4.xyz); + data[invocation].i4 = subgroupMin(data[3].i4); + + data[invocation].u4.x = subgroupMin(data[0].u4.x); + data[invocation].u4.xy = subgroupMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMin(data[2].u4.xyz); + data[invocation].u4 = subgroupMin(data[3].u4); + + data[invocation].d4.x = subgroupMin(data[0].d4.x); + data[invocation].d4.xy = subgroupMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMin(data[2].d4.xyz); + data[invocation].d4 = subgroupMin(data[3].d4); + + data[invocation].f4.x = subgroupMax(data[0].f4.x); + data[invocation].f4.xy = subgroupMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMax(data[2].f4.xyz); + data[invocation].f4 = subgroupMax(data[3].f4); + + data[invocation].i4.x = subgroupMax(data[0].i4.x); + data[invocation].i4.xy = subgroupMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMax(data[2].i4.xyz); + data[invocation].i4 = subgroupMax(data[3].i4); + + data[invocation].u4.x = subgroupMax(data[0].u4.x); + data[invocation].u4.xy = subgroupMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMax(data[2].u4.xyz); + data[invocation].u4 = subgroupMax(data[3].u4); + + data[invocation].d4.x = subgroupMax(data[0].d4.x); + data[invocation].d4.xy = subgroupMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMax(data[2].d4.xyz); + data[invocation].d4 = subgroupMax(data[3].d4); + + data[invocation].i4.x = subgroupAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupAnd(data[3].i4); + + data[invocation].u4.x = subgroupAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupOr(data[0].i4.x); + data[invocation].i4.xy = subgroupOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupOr(data[2].i4.xyz); + data[invocation].i4 = subgroupOr(data[3].i4); + + data[invocation].u4.x = subgroupOr(data[0].u4.x); + data[invocation].u4.xy = subgroupOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupOr(data[2].u4.xyz); + data[invocation].u4 = subgroupOr(data[3].u4); + + data[invocation].i4.x = int(subgroupOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupXor(data[0].i4.x); + data[invocation].i4.xy = subgroupXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupXor(data[2].i4.xyz); + data[invocation].i4 = subgroupXor(data[3].i4); + + data[invocation].u4.x = subgroupXor(data[0].u4.x); + data[invocation].u4.xy = subgroupXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupXor(data[2].u4.xyz); + data[invocation].u4 = subgroupXor(data[3].u4); + + data[invocation].i4.x = int(subgroupXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupXor(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupInclusiveAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveAdd(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveAdd(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveAdd(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveAdd(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMul(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMul(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMul(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMul(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMul(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMul(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMul(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMul(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMul(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMul(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMul(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMul(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMin(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMin(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMin(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMin(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMin(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMin(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMin(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMin(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMin(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMin(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMin(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMin(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMax(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMax(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMax(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMax(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMax(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMax(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMax(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMax(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMax(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMax(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMax(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMax(data[3].d4); + + data[invocation].i4.x = subgroupInclusiveAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveAnd(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupInclusiveOr(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveOr(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveOr(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveOr(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveOr(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveOr(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupInclusiveXor(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveXor(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveXor(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveXor(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveXor(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveXor(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveXor(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupExclusiveAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveAdd(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveAdd(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveAdd(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveAdd(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMul(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMul(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMul(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMul(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMul(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMul(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMul(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMul(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMul(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMul(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMul(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMul(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMin(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMin(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMin(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMin(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMin(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMin(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMin(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMin(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMin(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMin(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMin(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMin(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMax(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMax(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMax(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMax(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMax(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMax(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMax(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMax(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMax(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMax(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMax(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMax(data[3].d4); + + data[invocation].i4.x = subgroupExclusiveAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveAnd(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupExclusiveOr(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveOr(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveOr(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveOr(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveOr(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveOr(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupExclusiveXor(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveXor(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveXor(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveXor(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveXor(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveXor(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveXor(lessThan(data[1].i4, ivec4(0)))); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupBallot.comp vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupBallot.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupBallot.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupBallot.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,86 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_ballot: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + uvec4 relMask = gl_SubgroupEqMask + + gl_SubgroupGeMask + + gl_SubgroupGtMask + + gl_SubgroupLeMask + + gl_SubgroupLtMask; + + uvec4 result = subgroupBallot(true); + + data[invocation].u4.x = subgroupBallotBitCount(result); + data[invocation].u4.y = subgroupBallotBitExtract(result, 0) ? 1 : 0; + data[invocation].u4.z = subgroupBallotInclusiveBitCount(result) + subgroupBallotExclusiveBitCount(result); + data[invocation].u4.w = subgroupBallotFindLSB(result) + subgroupBallotFindMSB(result); + + if ((relMask == result) && subgroupInverseBallot(data[0].u4)) + { + data[invocation].f4.x = subgroupBroadcast(data[0].f4.x, invocation); + data[invocation].f4.xy = subgroupBroadcast(data[1].f4.xy, invocation); + data[invocation].f4.xyz = subgroupBroadcast(data[2].f4.xyz, invocation); + data[invocation].f4 = subgroupBroadcast(data[3].f4, invocation); + + data[invocation].i4.x = subgroupBroadcast(data[0].i4.x, invocation); + data[invocation].i4.xy = subgroupBroadcast(data[1].i4.xy, invocation); + data[invocation].i4.xyz = subgroupBroadcast(data[2].i4.xyz, invocation); + data[invocation].i4 = subgroupBroadcast(data[3].i4, invocation); + + data[invocation].u4.x = subgroupBroadcast(data[0].u4.x, invocation); + data[invocation].u4.xy = subgroupBroadcast(data[1].u4.xy, invocation); + data[invocation].u4.xyz = subgroupBroadcast(data[2].u4.xyz, invocation); + data[invocation].u4 = subgroupBroadcast(data[3].u4, invocation); + + data[invocation].d4.x = subgroupBroadcast(data[0].d4.x, invocation); + data[invocation].d4.xy = subgroupBroadcast(data[1].d4.xy, invocation); + data[invocation].d4.xyz = subgroupBroadcast(data[2].d4.xyz, invocation); + data[invocation].d4 = subgroupBroadcast(data[3].d4, invocation); + + data[invocation].i4.x = int(subgroupBroadcast(data[0].i4.x < 0, invocation)); + data[invocation].i4.xy = ivec2(subgroupBroadcast(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[invocation].i4.xyz = ivec3(subgroupBroadcast(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[invocation].i4 = ivec4(subgroupBroadcast(lessThan(data[1].i4, ivec4(0)), invocation)); + } + else + { + data[invocation].f4.x = subgroupBroadcastFirst(data[0].f4.x); + data[invocation].f4.xy = subgroupBroadcastFirst(data[1].f4.xy); + data[invocation].f4.xyz = subgroupBroadcastFirst(data[2].f4.xyz); + data[invocation].f4 = subgroupBroadcastFirst(data[3].f4); + + data[invocation].i4.x = subgroupBroadcastFirst(data[0].i4.x); + data[invocation].i4.xy = subgroupBroadcastFirst(data[1].i4.xy); + data[invocation].i4.xyz = subgroupBroadcastFirst(data[2].i4.xyz); + data[invocation].i4 = subgroupBroadcastFirst(data[3].i4); + + data[invocation].u4.x = subgroupBroadcastFirst(data[0].u4.x); + data[invocation].u4.xy = subgroupBroadcastFirst(data[1].u4.xy); + data[invocation].u4.xyz = subgroupBroadcastFirst(data[2].u4.xyz); + data[invocation].u4 = subgroupBroadcastFirst(data[3].u4); + + data[invocation].d4.x = subgroupBroadcastFirst(data[0].d4.x); + data[invocation].d4.xy = subgroupBroadcastFirst(data[1].d4.xy); + data[invocation].d4.xyz = subgroupBroadcastFirst(data[2].d4.xyz); + data[invocation].d4 = subgroupBroadcastFirst(data[3].d4); + + data[invocation].i4.x = int(subgroupBroadcastFirst(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupBroadcastFirst(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupBroadcastFirst(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupBroadcastFirst(lessThan(data[1].i4, ivec4(0)))); + } +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupBasic.comp vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupBasic.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupBasic.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupBasic.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,23 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_basic: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffer +{ + int a[]; +} data; + +void main() +{ + data.a[gl_SubgroupSize] = 1; + data.a[gl_SubgroupInvocationID] = 1; + data.a[gl_NumSubgroups] = 1; + data.a[gl_SubgroupID] = (subgroupElect()) ? 1 : 0; + subgroupBarrier(); + subgroupMemoryBarrier(); + subgroupMemoryBarrierBuffer(); + subgroupMemoryBarrierShared(); + subgroupMemoryBarrierImage(); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupClustered.comp vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupClustered.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupClustered.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupClustered.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,143 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_clustered: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupClusteredAdd(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupClusteredAdd(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupClusteredAdd(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupClusteredAdd(data[3].f4, 1); + + data[invocation].i4.x = subgroupClusteredAdd(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredAdd(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredAdd(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredAdd(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredAdd(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredAdd(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredAdd(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredAdd(data[3].u4, 1); + + data[invocation].d4.x = subgroupClusteredAdd(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupClusteredAdd(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupClusteredAdd(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupClusteredAdd(data[3].d4, 1); + + data[invocation].f4.x = subgroupClusteredMul(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupClusteredMul(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupClusteredMul(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupClusteredMul(data[3].f4, 1); + + data[invocation].i4.x = subgroupClusteredMul(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredMul(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredMul(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredMul(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredMul(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredMul(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredMul(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredMul(data[3].u4, 1); + + data[invocation].d4.x = subgroupClusteredMul(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupClusteredMul(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupClusteredMul(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupClusteredMul(data[3].d4, 1); + + data[invocation].f4.x = subgroupClusteredMin(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupClusteredMin(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupClusteredMin(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupClusteredMin(data[3].f4, 1); + + data[invocation].i4.x = subgroupClusteredMin(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredMin(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredMin(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredMin(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredMin(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredMin(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredMin(data[3].u4, 1); + + data[invocation].d4.x = subgroupClusteredMin(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupClusteredMin(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupClusteredMin(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupClusteredMin(data[3].d4, 1); + + data[invocation].f4.x = subgroupClusteredMax(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupClusteredMax(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupClusteredMax(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupClusteredMax(data[3].f4, 1); + + data[invocation].i4.x = subgroupClusteredMax(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredMax(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredMax(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredMax(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredMax(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredMax(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredMax(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredMax(data[3].u4, 1); + + data[invocation].d4.x = subgroupClusteredMax(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupClusteredMax(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupClusteredMax(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupClusteredMax(data[3].d4, 1); + + data[invocation].i4.x = subgroupClusteredAnd(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredAnd(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredAnd(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredAnd(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredAnd(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredAnd(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredAnd(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredAnd(data[3].u4, 1); + + data[invocation].i4.x = int(subgroupClusteredAnd(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupClusteredAnd(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupClusteredAnd(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupClusteredAnd(lessThan(data[1].i4, ivec4(0)), 1)); + + data[invocation].i4.x = subgroupClusteredOr(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredOr(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredOr(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredOr(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredOr(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredOr(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredOr(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredOr(data[3].u4, 1); + + data[invocation].i4.x = int(subgroupClusteredOr(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupClusteredOr(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupClusteredOr(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupClusteredOr(lessThan(data[1].i4, ivec4(0)), 1)); + + data[invocation].i4.x = subgroupClusteredXor(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredXor(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredXor(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredXor(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredXor(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredXor(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredXor(data[3].u4, 1); + + data[invocation].i4.x = int(subgroupClusteredXor(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupClusteredXor(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupClusteredXor(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupClusteredXor(lessThan(data[1].i4, ivec4(0)), 1)); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupClusteredNeg.comp vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupClusteredNeg.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupClusteredNeg.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupClusteredNeg.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,39 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_clustered: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + int a = 1; + const int aConst = 1; + + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.xy = subgroupClusteredAdd(data[1].f4.xy, 0); // ERROR, less than 1 + + data[invocation].f4.x = subgroupClusteredMul(data[0].f4.x, 3); // ERROR, not a power of 2 + + data[invocation].i4.xy = subgroupClusteredMin(data[1].i4.xy, 8); + data[invocation].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 6); // ERROR, not a power of 2 + + data[invocation].f4.x = subgroupClusteredMax(data[0].f4.x, -1); // ERROR, less than 1 + + data[invocation].i4 = subgroupClusteredAnd(data[3].i4, -3); // ERROR, less than 1 + + data[invocation].i4.x = subgroupClusteredOr(data[0].i4.x, a); // ERROR, not constant + data[invocation].i4.xy = subgroupClusteredOr(data[1].i4.xy, aConst); + + data[invocation].i4.x = subgroupClusteredXor(data[0].i4.x, 1 + a); // ERROR, not constant + data[invocation].i4.xy = subgroupClusteredXor(data[1].i4.xy, aConst + a); // ERROR, not constant + data[invocation].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, 1 + aConst); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroup.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroup.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroup.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroup.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,7 @@ +#version 450 +#extension GL_KHR_shader_subgroup_basic: enable +layout(location = 0) out uvec4 data; +void main (void) +{ + data = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroup.geom vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroup.geom --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroup.geom 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroup.geom 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,13 @@ +#version 450 +#extension GL_KHR_shader_subgroup_basic: enable +layout(points) in; +layout(points, max_vertices = 1) out; +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_PrimitiveIDIn] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupPartitioned.comp vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupPartitioned.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupPartitioned.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupPartitioned.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,420 @@ +#version 450 + +#extension GL_NV_shader_subgroup_partitioned: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + uvec4 ballot = subgroupPartitionNV(invocation); + + data[invocation].u4 = subgroupPartitionNV(data[0].f4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].f4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].f4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].f4); + + data[invocation].u4 = subgroupPartitionNV(data[0].i4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].i4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].i4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].i4); + + data[invocation].u4 = subgroupPartitionNV(data[0].u4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].u4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].u4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].u4); + + data[invocation].u4 = subgroupPartitionNV(data[0].d4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].d4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].d4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].d4); + + data[invocation].u4 = subgroupPartitionNV(bool(data[0].i4.x)); + data[invocation].u4 = subgroupPartitionNV(bvec2(data[0].i4.xy)); + data[invocation].u4 = subgroupPartitionNV(bvec3(data[0].i4.xyz)); + data[invocation].u4 = subgroupPartitionNV(bvec4(data[0].i4)); + + data[invocation].f4.x = subgroupPartitionedAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].f4.x = subgroupPartitionedInclusiveAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedInclusiveOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedInclusiveXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].f4.x = subgroupPartitionedExclusiveAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedExclusiveOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedExclusiveXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupQuad.comp vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupQuad.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupQuad.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupQuad.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,118 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_quad: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupQuadBroadcast(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupQuadBroadcast(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupQuadBroadcast(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupQuadBroadcast(data[3].f4, 1); + + data[invocation].i4.x = subgroupQuadBroadcast(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupQuadBroadcast(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupQuadBroadcast(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupQuadBroadcast(data[3].i4, 1); + + data[invocation].u4.x = subgroupQuadBroadcast(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupQuadBroadcast(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupQuadBroadcast(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupQuadBroadcast(data[3].u4, 1); + + data[invocation].d4.x = subgroupQuadBroadcast(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupQuadBroadcast(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupQuadBroadcast(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupQuadBroadcast(data[3].d4, 1); + + data[invocation].i4.x = int(subgroupQuadBroadcast(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupQuadBroadcast(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupQuadBroadcast(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupQuadBroadcast(lessThan(data[1].i4, ivec4(0)), 1)); + + data[invocation].f4.x = subgroupQuadSwapHorizontal(data[0].f4.x); + data[invocation].f4.xy = subgroupQuadSwapHorizontal(data[1].f4.xy); + data[invocation].f4.xyz = subgroupQuadSwapHorizontal(data[2].f4.xyz); + data[invocation].f4 = subgroupQuadSwapHorizontal(data[3].f4); + + data[invocation].i4.x = subgroupQuadSwapHorizontal(data[0].i4.x); + data[invocation].i4.xy = subgroupQuadSwapHorizontal(data[1].i4.xy); + data[invocation].i4.xyz = subgroupQuadSwapHorizontal(data[2].i4.xyz); + data[invocation].i4 = subgroupQuadSwapHorizontal(data[3].i4); + + data[invocation].u4.x = subgroupQuadSwapHorizontal(data[0].u4.x); + data[invocation].u4.xy = subgroupQuadSwapHorizontal(data[1].u4.xy); + data[invocation].u4.xyz = subgroupQuadSwapHorizontal(data[2].u4.xyz); + data[invocation].u4 = subgroupQuadSwapHorizontal(data[3].u4); + + data[invocation].d4.x = subgroupQuadSwapHorizontal(data[0].d4.x); + data[invocation].d4.xy = subgroupQuadSwapHorizontal(data[1].d4.xy); + data[invocation].d4.xyz = subgroupQuadSwapHorizontal(data[2].d4.xyz); + data[invocation].d4 = subgroupQuadSwapHorizontal(data[3].d4); + + data[invocation].i4.x = int(subgroupQuadSwapHorizontal(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupQuadSwapHorizontal(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupQuadSwapHorizontal(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupQuadSwapHorizontal(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupQuadSwapVertical(data[0].f4.x); + data[invocation].f4.xy = subgroupQuadSwapVertical(data[1].f4.xy); + data[invocation].f4.xyz = subgroupQuadSwapVertical(data[2].f4.xyz); + data[invocation].f4 = subgroupQuadSwapVertical(data[3].f4); + + data[invocation].i4.x = subgroupQuadSwapVertical(data[0].i4.x); + data[invocation].i4.xy = subgroupQuadSwapVertical(data[1].i4.xy); + data[invocation].i4.xyz = subgroupQuadSwapVertical(data[2].i4.xyz); + data[invocation].i4 = subgroupQuadSwapVertical(data[3].i4); + + data[invocation].u4.x = subgroupQuadSwapVertical(data[0].u4.x); + data[invocation].u4.xy = subgroupQuadSwapVertical(data[1].u4.xy); + data[invocation].u4.xyz = subgroupQuadSwapVertical(data[2].u4.xyz); + data[invocation].u4 = subgroupQuadSwapVertical(data[3].u4); + + data[invocation].d4.x = subgroupQuadSwapVertical(data[0].d4.x); + data[invocation].d4.xy = subgroupQuadSwapVertical(data[1].d4.xy); + data[invocation].d4.xyz = subgroupQuadSwapVertical(data[2].d4.xyz); + data[invocation].d4 = subgroupQuadSwapVertical(data[3].d4); + + data[invocation].i4.x = int(subgroupQuadSwapVertical(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupQuadSwapVertical(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupQuadSwapVertical(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupQuadSwapVertical(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupQuadSwapDiagonal(data[0].f4.x); + data[invocation].f4.xy = subgroupQuadSwapDiagonal(data[1].f4.xy); + data[invocation].f4.xyz = subgroupQuadSwapDiagonal(data[2].f4.xyz); + data[invocation].f4 = subgroupQuadSwapDiagonal(data[3].f4); + + data[invocation].i4.x = subgroupQuadSwapDiagonal(data[0].i4.x); + data[invocation].i4.xy = subgroupQuadSwapDiagonal(data[1].i4.xy); + data[invocation].i4.xyz = subgroupQuadSwapDiagonal(data[2].i4.xyz); + data[invocation].i4 = subgroupQuadSwapDiagonal(data[3].i4); + + data[invocation].u4.x = subgroupQuadSwapDiagonal(data[0].u4.x); + data[invocation].u4.xy = subgroupQuadSwapDiagonal(data[1].u4.xy); + data[invocation].u4.xyz = subgroupQuadSwapDiagonal(data[2].u4.xyz); + data[invocation].u4 = subgroupQuadSwapDiagonal(data[3].u4); + + data[invocation].d4.x = subgroupQuadSwapDiagonal(data[0].d4.x); + data[invocation].d4.xy = subgroupQuadSwapDiagonal(data[1].d4.xy); + data[invocation].d4.xyz = subgroupQuadSwapDiagonal(data[2].d4.xyz); + data[invocation].d4 = subgroupQuadSwapDiagonal(data[3].d4); + + data[invocation].i4.x = int(subgroupQuadSwapDiagonal(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupQuadSwapDiagonal(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupQuadSwapDiagonal(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupQuadSwapDiagonal(lessThan(data[1].i4, ivec4(0)))); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupShuffle.comp vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupShuffle.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupShuffle.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupShuffle.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,68 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_shuffle: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupShuffle(data[0].f4.x, invocation); + data[invocation].f4.xy = subgroupShuffle(data[1].f4.xy, invocation); + data[invocation].f4.xyz = subgroupShuffle(data[2].f4.xyz, invocation); + data[invocation].f4 = subgroupShuffle(data[3].f4, invocation); + + data[invocation].i4.x = subgroupShuffle(data[0].i4.x, invocation); + data[invocation].i4.xy = subgroupShuffle(data[1].i4.xy, invocation); + data[invocation].i4.xyz = subgroupShuffle(data[2].i4.xyz, invocation); + data[invocation].i4 = subgroupShuffle(data[3].i4, invocation); + + data[invocation].u4.x = subgroupShuffle(data[0].u4.x, invocation); + data[invocation].u4.xy = subgroupShuffle(data[1].u4.xy, invocation); + data[invocation].u4.xyz = subgroupShuffle(data[2].u4.xyz, invocation); + data[invocation].u4 = subgroupShuffle(data[3].u4, invocation); + + data[invocation].d4.x = subgroupShuffle(data[0].d4.x, invocation); + data[invocation].d4.xy = subgroupShuffle(data[1].d4.xy, invocation); + data[invocation].d4.xyz = subgroupShuffle(data[2].d4.xyz, invocation); + data[invocation].d4 = subgroupShuffle(data[3].d4, invocation); + + data[invocation].i4.x = int(subgroupShuffle(data[0].i4.x < 0, invocation)); + data[invocation].i4.xy = ivec2(subgroupShuffle(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[invocation].i4.xyz = ivec3(subgroupShuffle(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[invocation].i4 = ivec4(subgroupShuffle(lessThan(data[1].i4, ivec4(0)), invocation)); + + data[invocation].f4.x = subgroupShuffleXor(data[0].f4.x, invocation); + data[invocation].f4.xy = subgroupShuffleXor(data[1].f4.xy, invocation); + data[invocation].f4.xyz = subgroupShuffleXor(data[2].f4.xyz, invocation); + data[invocation].f4 = subgroupShuffleXor(data[3].f4, invocation); + + data[invocation].i4.x = subgroupShuffleXor(data[0].i4.x, invocation); + data[invocation].i4.xy = subgroupShuffleXor(data[1].i4.xy, invocation); + data[invocation].i4.xyz = subgroupShuffleXor(data[2].i4.xyz, invocation); + data[invocation].i4 = subgroupShuffleXor(data[3].i4, invocation); + + data[invocation].u4.x = subgroupShuffleXor(data[0].u4.x, invocation); + data[invocation].u4.xy = subgroupShuffleXor(data[1].u4.xy, invocation); + data[invocation].u4.xyz = subgroupShuffleXor(data[2].u4.xyz, invocation); + data[invocation].u4 = subgroupShuffleXor(data[3].u4, invocation); + + data[invocation].d4.x = subgroupShuffleXor(data[0].d4.x, invocation); + data[invocation].d4.xy = subgroupShuffleXor(data[1].d4.xy, invocation); + data[invocation].d4.xyz = subgroupShuffleXor(data[2].d4.xyz, invocation); + data[invocation].d4 = subgroupShuffleXor(data[3].d4, invocation); + + data[invocation].i4.x = int(subgroupShuffleXor(data[0].i4.x < 0, invocation)); + data[invocation].i4.xy = ivec2(subgroupShuffleXor(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[invocation].i4.xyz = ivec3(subgroupShuffleXor(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[invocation].i4 = ivec4(subgroupShuffleXor(lessThan(data[1].i4, ivec4(0)), invocation)); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupShuffleRelative.comp vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupShuffleRelative.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupShuffleRelative.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupShuffleRelative.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,68 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_shuffle_relative: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupShuffleUp(data[0].f4.x, invocation); + data[invocation].f4.xy = subgroupShuffleUp(data[1].f4.xy, invocation); + data[invocation].f4.xyz = subgroupShuffleUp(data[2].f4.xyz, invocation); + data[invocation].f4 = subgroupShuffleUp(data[3].f4, invocation); + + data[invocation].i4.x = subgroupShuffleUp(data[0].i4.x, invocation); + data[invocation].i4.xy = subgroupShuffleUp(data[1].i4.xy, invocation); + data[invocation].i4.xyz = subgroupShuffleUp(data[2].i4.xyz, invocation); + data[invocation].i4 = subgroupShuffleUp(data[3].i4, invocation); + + data[invocation].u4.x = subgroupShuffleUp(data[0].u4.x, invocation); + data[invocation].u4.xy = subgroupShuffleUp(data[1].u4.xy, invocation); + data[invocation].u4.xyz = subgroupShuffleUp(data[2].u4.xyz, invocation); + data[invocation].u4 = subgroupShuffleUp(data[3].u4, invocation); + + data[invocation].d4.x = subgroupShuffleUp(data[0].d4.x, invocation); + data[invocation].d4.xy = subgroupShuffleUp(data[1].d4.xy, invocation); + data[invocation].d4.xyz = subgroupShuffleUp(data[2].d4.xyz, invocation); + data[invocation].d4 = subgroupShuffleUp(data[3].d4, invocation); + + data[invocation].i4.x = int(subgroupShuffleUp(data[0].i4.x < 0, invocation)); + data[invocation].i4.xy = ivec2(subgroupShuffleUp(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[invocation].i4.xyz = ivec3(subgroupShuffleUp(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[invocation].i4 = ivec4(subgroupShuffleUp(lessThan(data[1].i4, ivec4(0)), invocation)); + + data[invocation].f4.x = subgroupShuffleDown(data[0].f4.x, invocation); + data[invocation].f4.xy = subgroupShuffleDown(data[1].f4.xy, invocation); + data[invocation].f4.xyz = subgroupShuffleDown(data[2].f4.xyz, invocation); + data[invocation].f4 = subgroupShuffleDown(data[3].f4, invocation); + + data[invocation].i4.x = subgroupShuffleDown(data[0].i4.x, invocation); + data[invocation].i4.xy = subgroupShuffleDown(data[1].i4.xy, invocation); + data[invocation].i4.xyz = subgroupShuffleDown(data[2].i4.xyz, invocation); + data[invocation].i4 = subgroupShuffleDown(data[3].i4, invocation); + + data[invocation].u4.x = subgroupShuffleDown(data[0].u4.x, invocation); + data[invocation].u4.xy = subgroupShuffleDown(data[1].u4.xy, invocation); + data[invocation].u4.xyz = subgroupShuffleDown(data[2].u4.xyz, invocation); + data[invocation].u4 = subgroupShuffleDown(data[3].u4, invocation); + + data[invocation].d4.x = subgroupShuffleDown(data[0].d4.x, invocation); + data[invocation].d4.xy = subgroupShuffleDown(data[1].d4.xy, invocation); + data[invocation].d4.xyz = subgroupShuffleDown(data[2].d4.xyz, invocation); + data[invocation].d4 = subgroupShuffleDown(data[3].d4, invocation); + + data[invocation].i4.x = int(subgroupShuffleDown(data[0].i4.x < 0, invocation)); + data[invocation].i4.xy = ivec2(subgroupShuffleDown(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[invocation].i4.xyz = ivec3(subgroupShuffleDown(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[invocation].i4 = ivec4(subgroupShuffleDown(lessThan(data[1].i4, ivec4(0)), invocation)); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroup.tesc vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroup.tesc --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroup.tesc 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroup.tesc 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,12 @@ +#version 450 +#extension GL_KHR_shader_subgroup_basic: enable +layout(vertices=1) out; +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_PrimitiveID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroup.tese vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroup.tese --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroup.tese 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroup.tese 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,12 @@ +#version 450 +#extension GL_KHR_shader_subgroup_basic: enable +layout(isolines) in; +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_PrimitiveID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroup.vert vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroup.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroup.vert 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroup.vert 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,11 @@ +#version 450 +#extension GL_KHR_shader_subgroup_basic: enable +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_VertexIndex] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupVote.comp vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupVote.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.subgroupVote.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.subgroupVote.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,49 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_vote: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; + int r; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + if (subgroupAll(data[invocation].r < 0)) + { + data[invocation].r = int(subgroupAllEqual(data[0].f4.x)); + data[invocation].r = int(subgroupAllEqual(data[1].f4.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].f4.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].f4)); + + data[invocation].r = int(subgroupAllEqual(data[0].i4.x)); + data[invocation].r = int(subgroupAllEqual(data[1].i4.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].i4.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].i4)); + + data[invocation].r = int(subgroupAllEqual(data[0].u4.x)); + data[invocation].r = int(subgroupAllEqual(data[1].u4.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].u4.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].u4)); + } + else if (subgroupAny(data[invocation].r < 0)) + { + data[invocation].r = int(subgroupAllEqual(data[0].d4.x)); + data[invocation].r = int(subgroupAllEqual(data[1].d4.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].d4.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].d4)); + + data[invocation].r = int(int(subgroupAllEqual(data[0].i4.x < 0))); + data[invocation].r = int(ivec2(subgroupAllEqual(lessThan(data[1].i4.xy, ivec2(0))))); + data[invocation].r = int(ivec3(subgroupAllEqual(lessThan(data[1].i4.xyz, ivec3(0))))); + data[invocation].r = int(ivec4(subgroupAllEqual(lessThan(data[1].i4, ivec4(0))))); + } +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.targetOpenGL.vert vulkan-1.1.73+dfsg/external/glslang/Test/spv.targetOpenGL.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.targetOpenGL.vert 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.targetOpenGL.vert 2018-04-27 11:46:26.000000000 +0000 @@ -2,8 +2,8 @@ layout(constant_id = 3) const int a = 2; layout(location = 2) uniform float f; -layout(location = 4) uniform sampler2D s1; -uniform sampler2D s2; +layout(location = 4, binding = 1) uniform sampler2D s1; +layout(binding = 2) uniform sampler2D s2; void main() { diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.vecMatConstruct.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.vecMatConstruct.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.vecMatConstruct.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.vecMatConstruct.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,14 @@ +#version 450 + +void main() +{ + mat4x3 m; + + vec2 v2 = vec2(m); + vec3 v3 = vec3(m); + vec4 v4 = vec4(m); + + ivec2 iv2 = ivec2(m); + ivec3 iv3 = ivec3(m); + ivec4 iv4 = ivec4(m); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.vulkan100.subgroupArithmetic.comp vulkan-1.1.73+dfsg/external/glslang/Test/spv.vulkan100.subgroupArithmetic.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.vulkan100.subgroupArithmetic.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.vulkan100.subgroupArithmetic.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,393 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_arithmetic: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupAdd(data[3].f4); + + data[invocation].i4.x = subgroupAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupAdd(data[3].i4); + + data[invocation].u4.x = subgroupAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupAdd(data[3].u4); + + data[invocation].d4.x = subgroupAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupAdd(data[3].d4); + + data[invocation].f4.x = subgroupMul(data[0].f4.x); + data[invocation].f4.xy = subgroupMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMul(data[2].f4.xyz); + data[invocation].f4 = subgroupMul(data[3].f4); + + data[invocation].i4.x = subgroupMul(data[0].i4.x); + data[invocation].i4.xy = subgroupMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMul(data[2].i4.xyz); + data[invocation].i4 = subgroupMul(data[3].i4); + + data[invocation].u4.x = subgroupMul(data[0].u4.x); + data[invocation].u4.xy = subgroupMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMul(data[2].u4.xyz); + data[invocation].u4 = subgroupMul(data[3].u4); + + data[invocation].d4.x = subgroupMul(data[0].d4.x); + data[invocation].d4.xy = subgroupMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMul(data[2].d4.xyz); + data[invocation].d4 = subgroupMul(data[3].d4); + + data[invocation].f4.x = subgroupMin(data[0].f4.x); + data[invocation].f4.xy = subgroupMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMin(data[2].f4.xyz); + data[invocation].f4 = subgroupMin(data[3].f4); + + data[invocation].i4.x = subgroupMin(data[0].i4.x); + data[invocation].i4.xy = subgroupMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMin(data[2].i4.xyz); + data[invocation].i4 = subgroupMin(data[3].i4); + + data[invocation].u4.x = subgroupMin(data[0].u4.x); + data[invocation].u4.xy = subgroupMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMin(data[2].u4.xyz); + data[invocation].u4 = subgroupMin(data[3].u4); + + data[invocation].d4.x = subgroupMin(data[0].d4.x); + data[invocation].d4.xy = subgroupMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMin(data[2].d4.xyz); + data[invocation].d4 = subgroupMin(data[3].d4); + + data[invocation].f4.x = subgroupMax(data[0].f4.x); + data[invocation].f4.xy = subgroupMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMax(data[2].f4.xyz); + data[invocation].f4 = subgroupMax(data[3].f4); + + data[invocation].i4.x = subgroupMax(data[0].i4.x); + data[invocation].i4.xy = subgroupMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMax(data[2].i4.xyz); + data[invocation].i4 = subgroupMax(data[3].i4); + + data[invocation].u4.x = subgroupMax(data[0].u4.x); + data[invocation].u4.xy = subgroupMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMax(data[2].u4.xyz); + data[invocation].u4 = subgroupMax(data[3].u4); + + data[invocation].d4.x = subgroupMax(data[0].d4.x); + data[invocation].d4.xy = subgroupMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMax(data[2].d4.xyz); + data[invocation].d4 = subgroupMax(data[3].d4); + + data[invocation].i4.x = subgroupAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupAnd(data[3].i4); + + data[invocation].u4.x = subgroupAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupOr(data[0].i4.x); + data[invocation].i4.xy = subgroupOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupOr(data[2].i4.xyz); + data[invocation].i4 = subgroupOr(data[3].i4); + + data[invocation].u4.x = subgroupOr(data[0].u4.x); + data[invocation].u4.xy = subgroupOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupOr(data[2].u4.xyz); + data[invocation].u4 = subgroupOr(data[3].u4); + + data[invocation].i4.x = int(subgroupOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupXor(data[0].i4.x); + data[invocation].i4.xy = subgroupXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupXor(data[2].i4.xyz); + data[invocation].i4 = subgroupXor(data[3].i4); + + data[invocation].u4.x = subgroupXor(data[0].u4.x); + data[invocation].u4.xy = subgroupXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupXor(data[2].u4.xyz); + data[invocation].u4 = subgroupXor(data[3].u4); + + data[invocation].i4.x = int(subgroupXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupXor(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupInclusiveAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveAdd(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveAdd(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveAdd(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveAdd(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMul(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMul(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMul(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMul(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMul(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMul(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMul(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMul(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMul(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMul(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMul(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMul(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMin(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMin(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMin(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMin(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMin(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMin(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMin(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMin(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMin(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMin(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMin(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMin(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMax(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMax(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMax(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMax(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMax(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMax(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMax(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMax(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMax(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMax(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMax(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMax(data[3].d4); + + data[invocation].i4.x = subgroupInclusiveAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveAnd(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupInclusiveOr(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveOr(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveOr(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveOr(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveOr(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveOr(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupInclusiveXor(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveXor(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveXor(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveXor(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveXor(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveXor(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveXor(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupExclusiveAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveAdd(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveAdd(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveAdd(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveAdd(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMul(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMul(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMul(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMul(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMul(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMul(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMul(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMul(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMul(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMul(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMul(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMul(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMin(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMin(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMin(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMin(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMin(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMin(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMin(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMin(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMin(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMin(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMin(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMin(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMax(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMax(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMax(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMax(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMax(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMax(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMax(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMax(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMax(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMax(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMax(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMax(data[3].d4); + + data[invocation].i4.x = subgroupExclusiveAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveAnd(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupExclusiveOr(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveOr(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveOr(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveOr(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveOr(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveOr(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupExclusiveXor(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveXor(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveXor(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveXor(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveXor(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveXor(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveXor(lessThan(data[1].i4, ivec4(0)))); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.vulkan100.subgroupPartitioned.comp vulkan-1.1.73+dfsg/external/glslang/Test/spv.vulkan100.subgroupPartitioned.comp --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.vulkan100.subgroupPartitioned.comp 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.vulkan100.subgroupPartitioned.comp 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,420 @@ +#version 450 + +#extension GL_NV_shader_subgroup_partitioned: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + uvec4 ballot = subgroupPartitionNV(invocation); + + data[invocation].u4 = subgroupPartitionNV(data[0].f4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].f4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].f4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].f4); + + data[invocation].u4 = subgroupPartitionNV(data[0].i4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].i4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].i4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].i4); + + data[invocation].u4 = subgroupPartitionNV(data[0].u4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].u4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].u4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].u4); + + data[invocation].u4 = subgroupPartitionNV(data[0].d4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].d4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].d4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].d4); + + data[invocation].u4 = subgroupPartitionNV(bool(data[0].i4.x)); + data[invocation].u4 = subgroupPartitionNV(bvec2(data[0].i4.xy)); + data[invocation].u4 = subgroupPartitionNV(bvec3(data[0].i4.xyz)); + data[invocation].u4 = subgroupPartitionNV(bvec4(data[0].i4)); + + data[invocation].f4.x = subgroupPartitionedAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].f4.x = subgroupPartitionedInclusiveAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedInclusiveOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedInclusiveXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].f4.x = subgroupPartitionedExclusiveAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedExclusiveOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedExclusiveXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.vulkan110.int16.frag vulkan-1.1.73+dfsg/external/glslang/Test/spv.vulkan110.int16.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.vulkan110.int16.frag 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.vulkan110.int16.frag 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,251 @@ +#version 450 + +#extension GL_KHX_shader_explicit_arithmetic_types: enable +#extension GL_KHX_shader_explicit_arithmetic_types_int8: require +#extension GL_KHX_shader_explicit_arithmetic_types_int16: require +#extension GL_KHX_shader_explicit_arithmetic_types_int32: require +#extension GL_KHX_shader_explicit_arithmetic_types_int64: require +#extension GL_KHX_shader_explicit_arithmetic_types_float16: require +#extension GL_KHX_shader_explicit_arithmetic_types_float32: require +#extension GL_KHX_shader_explicit_arithmetic_types_float64: require + +layout(binding = 0) uniform Uniforms +{ + uint index; +}; + +layout(std140, binding = 1) uniform Block +{ + int16_t i16; + i16vec2 i16v2; + i16vec3 i16v3; + i16vec4 i16v4; + uint16_t u16; + u16vec2 u16v2; + u16vec3 u16v3; + u16vec4 u16v4; +} block; + +void main() +{ +} + +void literal() +{ + const int16_t i16Const[3] = + { + int16_t(-0x1111), // Hex + int16_t(-1), // Dec + int16_t(040000), // Oct + }; + + int16_t i16 = i16Const[index]; + + const uint16_t u16Const[] = + { + uint16_t(0xFFFF), // Hex + uint16_t(65535), // Dec + uint16_t(077777), // Oct + }; + + uint16_t u16 = u16Const[index]; +} + +void typeCast16() +{ + i8vec2 i8v; + u8vec2 u8v; + i16vec2 i16v; + u16vec2 u16v; + i32vec2 i32v; + u32vec2 u32v; + i64vec2 i64v; + u64vec2 u64v; + f16vec2 f16v; + f32vec2 f32v; + f64vec2 f64v; + bvec2 bv; + + i32v = i16v; // int16_t -> int32_t + i32v = u16v; // uint16_t -> int32_t + u16v = i16v; // int16_t -> uint16_t + u32v = i16v; // int16_t -> uint32_t + i64v = i16v; // int16_t -> int64_t + u64v = i16v; // int16_t -> uint64_t + u32v = u16v; // uint16_t -> uint32_t + i64v = u16v; // uint16_t -> int64_t + u64v = u16v; // uint16_t -> uint64_t + f16v = i16v; // int16_t -> float16_t + f32v = i16v; // int16_t -> float32_t + f64v = i16v; // int16_t -> float64_t + f16v = u16v; // uint16_t -> float16_t + f32v = u16v; // uint16_t -> float32_t + f64v = u16v; // uint16_t -> float64_t + + i32v = i32vec2(i16v); // int16_t -> int32_t + i32v = i32vec2(u16v); // uint16_t -> int32_t + u16v = u16vec2(i16v); // int16_t -> uint16_t + u32v = u32vec2(i16v); // int16_t -> uint32_t + i64v = i64vec2(i16v); // int16_t -> int64_t + u64v = i64vec2(i16v); // int16_t -> uint64_t + u32v = u32vec2(u16v); // uint16_t -> uint32_t + i64v = i64vec2(u16v); // uint16_t -> int64_t + u64v = i64vec2(u16v); // uint16_t -> uint64_t + f16v = f16vec2(i16v); // int16_t -> float16_t + f32v = f32vec2(i16v); // int16_t -> float32_t + f64v = f64vec2(i16v); // int16_t -> float64_t + f16v = f16vec2(u16v); // uint16_t -> float16_t + f32v = f32vec2(u16v); // uint16_t -> float32_t + f64v = f64vec2(u16v); // uint16_t -> float64_t + + i8v = i8vec2(i16v); // int16_t -> int8_t + i8v = i8vec2(u16v); // uint16_t -> int8_t + u8v = u8vec2(i16v); // int16_t -> uint8_t + u8v = u8vec2(u16v); // uint16_t -> uint8_t + i16v = u8vec2(u16v); // uint16_t -> int16_t + i16v = i16vec2(bv); // bool -> int16 + u16v = u16vec2(bv); // bool -> uint16 + bv = bvec2(i16v); // int16 -> bool + bv = bvec2(u16v); // uint16 -> bool +} +void operators() +{ + u16vec3 u16v; + int16_t i16; + uvec3 uv; + int32_t i; + int64_t i64; + bool b; + + // Unary + u16v++; + i16--; + ++i16; + --u16v; + + u16v = ~u16v; + + i16 = +i16; + u16v = -u16v; + + // Arithmetic + i16 += i16; + u16v -= u16v; + i *= i16; + uv /= u16v; + uv %= i16; + + uv = u16v + uv; + i64 = i16 - i64; + uv = u16v * uv; + i64 = i16 * i64; + i = i16 % i; + + // Shift + u16v <<= i16; + i16 >>= u16v.y; + + i16 = i16 << u16v.z; + uv = u16v << i; + + // Relational + b = (u16v.x != i16); + b = (i16 == u16v.x); + b = (u16v.x > uv.y); + b = (i16 < i); + b = (u16v.y >= uv.x); + b = (i16 <= i); + + // Bitwise + uv |= i16; + i = i16 | i; + i64 &= i16; + uv = u16v & uv; + uv ^= i16; + u16v = u16v ^ i16; +} + +void builtinFuncs() +{ + i16vec2 i16v; + i16vec4 i16v4; + u16vec3 u16v; + u16vec2 u16v2; + u16vec4 u16v4; + bvec3 bv; + int16_t i16; + uint16_t u16; + int32_t i32; + uint32_t u32; + int64_t i64; + uint64_t u64; + + // abs() + i16v = abs(i16v); + + // sign() + i16 = sign(i16); + + // min() + i16v = min(i16v, i16); + i16v = min(i16v, i16vec2(-1)); + u16v = min(u16v, u16); + u16v = min(u16v, u16vec3(0)); + + // max() + i16v = max(i16v, i16); + i16v = max(i16v, i16vec2(-1)); + u16v = max(u16v, u16); + u16v = max(u16v, u16vec3(0)); + + // clamp() + i16v = clamp(i16v, -i16, i16); + i16v = clamp(i16v, -i16v, i16v); + u16v = clamp(u16v, -u16, u16); + u16v = clamp(u16v, -u16v, u16v); + + // mix() + i16 = mix(i16v.x, i16v.y, true); + i16v = mix(i16vec2(i16), i16vec2(-i16), bvec2(false)); + u16 = mix(u16v.x, u16v.y, true); + u16v = mix(u16vec3(u16), u16vec3(-u16), bvec3(false)); + + //pack + i32 = pack32(i16v); + i64 = pack64(i16v4); + u32 = pack32(u16v2); + u64 = pack64(u16v4); + + i16v = unpack16(i32); + i16v4 = unpack16(i64); + u16v2 = unpack16(u32); + u16v4 = unpack16(u64); + + // lessThan() + bv = lessThan(u16v, u16vec3(u16)); + bv.xy = lessThan(i16v, i16vec2(i16)); + + // lessThanEqual() + bv = lessThanEqual(u16v, u16vec3(u16)); + bv.xy = lessThanEqual(i16v, i16vec2(i16)); + + // greaterThan() + bv = greaterThan(u16v, u16vec3(u16)); + bv.xy = greaterThan(i16v, i16vec2(i16)); + + // greaterThanEqual() + bv = greaterThanEqual(u16v, u16vec3(u16)); + bv.xy = greaterThanEqual(i16v, i16vec2(i16)); + + // equal() + bv = equal(u16v, u16vec3(u16)); + bv.xy = equal(i16v, i16vec2(i16)); + + // notEqual() + bv = notEqual(u16v, u16vec3(u16)); + bv.xy = notEqual(i16v, i16vec2(i16)); +} + +// Type conversion for specialization constant +layout(constant_id = 100) const int16_t si16 = int16_t(-10); +layout(constant_id = 101) const uint16_t su16 = uint16_t(20); diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.vulkan110.storageBuffer.vert vulkan-1.1.73+dfsg/external/glslang/Test/spv.vulkan110.storageBuffer.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.vulkan110.storageBuffer.vert 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.vulkan110.storageBuffer.vert 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,16 @@ +#version 450 + +#pragma use_storage_buffer + +uniform ub { + vec4 a; +} ubi; + +buffer bb { + vec4 b; +} bbi; + +void main() +{ + gl_Position = ubi.a + bbi.b; +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.xfb2.vert vulkan-1.1.73+dfsg/external/glslang/Test/spv.xfb2.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.xfb2.vert 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.xfb2.vert 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,18 @@ +#version 450 + +layout (location = 0) in vec4 position; +layout (binding = 5) uniform ComponentsBlock +{ + vec4 c1; + vec2 c2; +} components; + +layout (xfb_buffer = 3, xfb_offset = 16) out gl_PerVertex +{ + vec4 gl_Position; +}; + +void main() +{ + gl_Position = position + components.c1 + vec4(components.c2, 0.0, 0.0); +} \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.xfb3.vert vulkan-1.1.73+dfsg/external/glslang/Test/spv.xfb3.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.xfb3.vert 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.xfb3.vert 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,18 @@ +#version 450 + +layout (location = 0) in vec4 position; +layout (binding = 5) uniform ComponentsBlock +{ + vec4 c1; + vec2 c2; +} components; + +layout (xfb_buffer = 3, xfb_offset = 16) out gl_PerVertex +{ + layout(xfb_stride = 80) vec4 gl_Position; +}; + +void main() +{ + gl_Position = position + components.c1 + vec4(components.c2, 0.0, 0.0); +} \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.xfb.vert vulkan-1.1.73+dfsg/external/glslang/Test/spv.xfb.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/spv.xfb.vert 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/spv.xfb.vert 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,20 @@ +#version 450 + +layout(xfb_buffer = 3) out; +layout(xfb_stride = 48) out; +layout(xfb_offset = 12, location = 0) out float out1; + +layout(xfb_buffer = 2) out; +layout(location=1) out outXfb { + layout(xfb_buffer = 2, xfb_stride = 32, xfb_offset = 8) float out2; +}; + +layout(xfb_buffer = 1, location=3) out outXfb2 { + layout(xfb_stride = 64, xfb_offset = 60) float out3; +}; + +layout(location = 4, xfb_buffer = 0, xfb_offset = 4) out float out4; + +void main() +{ +} \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/validate-shaders.sh vulkan-1.1.73+dfsg/external/glslang/Test/validate-shaders.sh --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/validate-shaders.sh 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/validate-shaders.sh 2018-04-27 11:46:26.000000000 +0000 @@ -0,0 +1,269 @@ +#!/bin/bash + +# This script validates shaders (if successfully compiled) using spirv-val. +# It is not meant to preclude the possible addition of the validator to +# glslang. + +declare -r EXE='../build/install/bin/glslangValidator' + +# search common locations for spirv-tools: keep first one +for toolsdir in '../External/spirv-tools/build/tools' '../../SPIRV-Tools/build/tools' '/usr/local/bin'; do + [[ -z "$VAL" && -x "${toolsdir}/spirv-val" ]] && declare -r VAL="${toolsdir}/spirv-val" + [[ -z "$DIS" && -x "${toolsdir}/spirv-dis" ]] && declare -r DIS="${toolsdir}/spirv-dis" +done + +declare -r gtests='../gtests/Hlsl.FromFile.cpp ../gtests/Spv.FromFile.cpp' + +declare -r targetenv='vulkan1.0' + +function fatal() { echo "ERROR: $@"; exit 5; } + +function usage +{ + echo + echo "Usage: $(basename $0) [options...] shaders..." + echo + echo " Validates shaders (if successfully compiled) through spirv-val." + echo + echo "General options:" + echo " --help prints this text" + echo " --no-color disables output colorization" + echo " --dump-asm dumps all successfully compiled shader assemblies" + echo " --dump-val dumps all validation results" + echo " --dump-comp dumps all compilation logs" + echo "Spam reduction options:" + echo " --no-summary disables result summaries" + echo " --skip-ok do not print successful validations" + echo " --skip-comperr do not print compilation errors" + echo " --skip-valerr do not print validation errors" + echo " --quiet synonym for --skip-ok --skip-comperr --skip-valerr --no-summary" + echo " --terse print terse single line progress summary" + echo "Disassembly options:" + echo " --raw-id uses raw ids for disassembly" + echo + echo "Usage examples. Note most non-hlsl tests fail to compile for expected reasons." + echo " Exercise all hlsl.* files:" + echo " $(basename $0) hlsl.*" + echo " Exercise all hlsl.* files, tersely:" + echo " $(basename $0) --terse hlsl.*" + echo " Print validator output for myfile.frag:" + echo " $(basename $0) --quiet --dump-val myfile.frag" + echo " Exercise hlsl.* files, only printing validation errors:" + echo " $(basename $0) --skip-ok --skip-comperr hlsl.*" + + exit 5 +} + +function status() +{ + printf "%-40s: %b\n" "$1" "$2" +} + +# make sure we can find glslang +[[ -x "$EXE" ]] || fatal "Unable to locate $(basename "$EXE") executable" +[[ -x "$VAL" ]] || fatal "Unable to locate spirv-val executable" +[[ -x "$DIS" ]] || fatal "Unable to locate spirv-dis executable" + +for gtest in $gtests; do + [[ -r "$gtest" ]] || fatal "Unable to locate source file: $(basename $gtest)" +done + +# temp files +declare -r spvfile='out.spv' \ + complog='comp.out' \ + vallog='val.out' \ + dislog='dis.out' \ + +# options +declare opt_vallog=false \ + opt_complog=false \ + opt_dislog=false \ + opt_summary=true \ + opt_stat_comperr=true \ + opt_stat_ok=true \ + opt_stat_valerr=true \ + opt_color=true \ + opt_raw_id=false \ + opt_quiet=false \ + opt_terse=false + +# clean up on exit +trap "rm -f ${spvfile} ${complog} ${vallog} ${dislog}" EXIT + +# Language guesser: there is no fixed mapping from filenames to language, +# so this examines the file and return one of: +# hlsl +# glsl +# bin +# unknown +# This is easier WRT future expansion than a big explicit list. +function FindLanguage() +{ + local test="$1" + + # If it starts with hlsl, assume it's hlsl. + if [[ "$test" == *hlsl.* ]]; then + echo hlsl + return + fi + + if [[ "$test" == *.spv ]]; then + echo bin + return; + fi + + # If it doesn't start with spv., assume it's GLSL. + if [[ ! "$test" == spv.* && ! "$test" == remap.* ]]; then + echo glsl + return + fi + + # Otherwise, attempt to guess from shader contents, since there's no + # fixed mapping of filenames to languages. + local contents="$(cat "$test")" + + if [[ "$contents" == *#version* ]]; then + echo glsl + return + fi + + if [[ "$contents" == *SamplerState* || + "$contents" == *cbuffer* || + "$contents" == *SV_* ]]; then + echo hlsl + return + fi + + echo unknown +} + +# Attempt to discover entry point +function FindEntryPoint() +{ + local test="$1" + + # if it's not hlsl, always use main + if [[ "$language" != 'hlsl' ]]; then + echo 'main' + return + fi + + # Try to find it in test sources + awk -F '[ (){",]+' -e "\$2 == \"${test}\" { print \$3; found=1; } END { if (found==0) print \"main\"; } " $gtests +} + +# command line options +while [ $# -gt 0 ] +do + case "$1" in + # -c) glslang="$2"; shift 2;; + --help|-?) usage;; + --no-color) opt_color=false; shift;; + --no-summary) opt_summary=false; shift;; + --skip-ok) opt_stat_ok=false; shift;; + --skip-comperr) opt_stat_comperr=false; shift;; + --skip-valerr) opt_stat_valerr=false; shift;; + --dump-asm) opt_dislog=true; shift;; + --dump-val) opt_vallog=true; shift;; + --dump-comp) opt_complog=true; shift;; + --raw-id) opt_raw_id=true; shift;; + --quiet) opt_quiet=true; shift;; + --terse) opt_quiet=true + opt_terse=true + shift;; + --*) fatal "Unknown command line option: $1";; + *) break;; + esac +done + +# this is what quiet means +if $opt_quiet; then + opt_stat_ok=false + opt_stat_comperr=false + opt_stat_valerr=false + $opt_terse || opt_summary=false +fi + +if $opt_color; then + declare -r white="\e[1;37m" cyan="\e[1;36m" red="\e[0;31m" no_color="\e[0m" +else + declare -r white="" cyan="" red="" no_color="" +fi + +# stats +declare -i count_ok=0 count_err=0 count_nocomp=0 count_total=0 + +declare -r dashsep='------------------------------------------------------------------------' + +testfiles=(${@}) +# if no shaders given, look for everything in current directory +[[ ${#testfiles[*]} == 0 ]] && testfiles=(*.frag *.vert *.tesc *.tese *.geom *.comp) + +$opt_summary && printf "\nValidating: ${#testfiles[*]} shaders\n\n" + +# Loop through the shaders we were given, compiling them if we can. +for test in ${testfiles[*]} +do + if [[ ! -r "$test" ]]; then + $opt_quiet || status "$test" "${red}FILE NOT FOUND${no_color}" + continue + fi + + ((++count_total)) + + $opt_terse && printf "\r[%-3d/%-3d : ${white}comperr=%-3d ${red}valerr=%-3d ${cyan}ok=%-3d${no_color}]" \ + ${count_total} ${#testfiles[*]} ${count_nocomp} ${count_err} ${count_ok} + + language="$(FindLanguage $test)" + entry="$(FindEntryPoint $test)" + langops='' + + case "$language" in + hlsl) langops='-D --hlsl-iomap --hlsl-offsets';; + glsl) ;; + bin) continue;; # skip binaries + *) $opt_quiet || status "$test" "${red}UNKNOWN LANGUAGE${no_color}"; continue;; + esac + + # compile the test file + if compout=$("$EXE" -e "$entry" $langops -V -o "$spvfile" "$test" 2>&1) + then + # successful compilation: validate + if valout=$("$VAL" --target-env ${targetenv} "$spvfile" 2>&1) + then + # validated OK + $opt_stat_ok && status "$test" "${cyan}OK${no_color}" + ((++count_ok)) + else + # validation failure + $opt_stat_valerr && status "$test" "${red}VAL ERROR${no_color}" + printf "%s\n%s:\n%s\n" "$dashsep" "$test" "$valout" >> "$vallog" + ((++count_err)) + fi + + if $opt_dislog; then + printf "%s\n%s:\n" "$dashsep" "$test" >> "$dislog" + $opt_raw_id && id_opt=--raw-id + "$DIS" ${id_opt} "$spvfile" >> "$dislog" + fi + else + # compile failure + $opt_stat_comperr && status "$test" "${white}COMP ERROR${no_color}" + printf "%s\n%s\n" "$dashsep" "$compout" >> "$complog" + ((++count_nocomp)) + fi +done + +$opt_terse && echo + +# summarize +$opt_summary && printf "\nSummary: ${white}${count_nocomp} compile errors${no_color}, ${red}${count_err} validation errors${no_color}, ${cyan}${count_ok} successes${no_color}\n" + +# dump logs +$opt_vallog && [[ -r $vallog ]] && cat "$vallog" +$opt_complog && [[ -r $complog ]] && cat "$complog" +$opt_dislog && [[ -r $dislog ]] && cat "$dislog" + +# exit code +[[ ${count_err} -gt 0 ]] && exit 1 +exit 0 diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/vulkan.frag vulkan-1.1.73+dfsg/external/glslang/Test/vulkan.frag --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/vulkan.frag 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/vulkan.frag 2018-04-27 11:46:26.000000000 +0000 @@ -1,9 +1,9 @@ #version 450 -uniform sampler s; -uniform sampler sA[4]; -uniform texture2D t2d; -uniform texture3D t3d[4]; +uniform sampler s; // ERROR, no binding +uniform sampler sA[4]; // ERROR, no binding +uniform texture2D t2d; // ERROR, no binding +uniform texture3D t3d[4]; // ERROR, no binding int i; uniform samplerShadow sShadow; uniform texture3D t3d5[5]; @@ -28,7 +28,7 @@ sampler2D s2D = sampler2D(t2d, s); // ERROR, no sampler constructor sampler3D s3d[4] = sampler3D[4](t3d, sA[2]); // ERROR, no sampler constructor -out vec4 color; +out vec4 color; // ERROR, no location void main() { @@ -95,3 +95,11 @@ gl_NumSamples; // ERROR, not for Vulkan } + +void noise() +{ + noise1(dv4); + noise2(4.0); + noise3(vec2(3)); + noise4(dv4); +} diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/Test/vulkan.vert vulkan-1.1.73+dfsg/external/glslang/Test/vulkan.vert --- vulkan-1.0.65.2+dfsg1/external/glslang/Test/vulkan.vert 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/Test/vulkan.vert 2018-04-27 11:46:26.000000000 +0000 @@ -58,3 +58,8 @@ out ban2 { float f; } bai2[arraySize][2]; + +layout(binding = 3000) uniform sampler2D s3000; +layout(binding = 3001) uniform b3001 { int a; }; +layout(location = 10) in vec4 in1; +layout(location = 10) in vec4 in2; // ERROR, no location aliasing diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/.travis.yml vulkan-1.1.73+dfsg/external/glslang/.travis.yml --- vulkan-1.0.65.2+dfsg1/external/glslang/.travis.yml 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/.travis.yml 2018-04-27 11:46:26.000000000 +0000 @@ -11,8 +11,11 @@ dist: trusty env: - - GLSLANG_BUILD_TYPE=Release - - GLSLANG_BUILD_TYPE=Debug + global: + - secure: aGFrgzyKp+84hKrGkxVWg8cHV61uqrKEHT38gfSQK6+WS4GfLOyH83p7WnsEBb7AMhzU7LMNFdvOFr6+NaMpVnqRvc40CEG1Q+lNg9Pq9mhIZLowvDrfqTL9kQ+8Nbw5Q6/dg6CTvY7fvRfpfCEmKIUZBRkoKUuHeuM1uy3IupFcdNuL5bSYn3Beo+apSJginh9DI4BLDXFUgBzTRSLLyCX5g3cpaeGGOCr8quJlYx75W6HRck5g9SZuLtUoH9GFEV3l+ZEWB8noErW+J56L03bwNwFuuAh321evw++oQk5KFa8rlDvar3SJ3b1RHB8u/eq5DBYMyaK/fS8+Q7QbGr8diF/wDe68bKO7U9IhpNfExXmczCpExjHomW5TQv4rYdGhygPMfW97aIsPRYyNKcl4fkmb7NDrM8w0Jscdq2g5c2Kz0ItyZoBri/NXLwFQQjaVCs7Pf97TjuMA7mK0GJmDTRzi6SrDYlWMt5BQL3y0CCojyfLIRcTh0CQjQI29s97bLfQrYAxt9GNNFR+HTXRLLrkaAlJkPGEPwUywlSfEThnvHLesNxYqemolAYpQT4ithoL4GehGIHmaxsW295aKVhuRf8K9eBODNqrfblvM42UHhjntT+92ZnQ/Gkq80GqaMxnxi4PO5FyPIxt0r981b54YBkWi8YA4P7w5pNI= + matrix: + - GLSLANG_BUILD_TYPE=Release + - GLSLANG_BUILD_TYPE=Debug compiler: - clang @@ -75,3 +78,46 @@ ctest --output-on-failure && cd ../Test && ./runtests; fi + +after_success: + # For debug build, the generated dll has a postfix "d" in its name. + - if [[ "${GLSLANG_BUILD_TYPE}" == "Debug" ]]; then + export SUFFIX="d"; + else + export SUFFIX=""; + fi + # Create tarball for deployment + - if [[ ${CC} == clang* && "${BUILD_NDK}" != "ON" ]]; then + cd ../build/install; + export TARBALL=glslang-master-${TRAVIS_OS_NAME}-${GLSLANG_BUILD_TYPE}.zip; + zip ${TARBALL} + bin/glslangValidator + include/glslang/* + include/SPIRV/* + lib/libglslang${SUFFIX}.a + lib/libHLSL${SUFFIX}.a + lib/libOGLCompiler${SUFFIX}.a + lib/libOSDependent${SUFFIX}.a + lib/libSPIRV${SUFFIX}.a + lib/libSPVRemapper${SUFFIX}.a + lib/libSPIRV-Tools${SUFFIX}.a + lib/libSPIRV-Tools-opt${SUFFIX}.a; + fi + +before_deploy: + # Tag the current top of the tree as "master-tot". + # Travis CI replies on the tag name to properly push to GitHub Releases. + - git config --global user.name "Travis CI" + - git config --global user.email "builds@travis-ci.org" + - git tag -f master-tot + - git push -q -f https://${glslangtoken}@github.com/KhronosGroup/glslang --tags + +deploy: + provider: releases + api_key: ${glslangtoken} + on: + branch: master + condition: ${CC} == clang* && ${BUILD_NDK} != ON + file: ${TARBALL} + skip_cleanup: true + overwrite: true diff -Nru vulkan-1.0.65.2+dfsg1/external/glslang/update_glslang_sources.py vulkan-1.1.73+dfsg/external/glslang/update_glslang_sources.py --- vulkan-1.0.65.2+dfsg1/external/glslang/update_glslang_sources.py 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/glslang/update_glslang_sources.py 2018-04-27 11:46:26.000000000 +0000 @@ -28,8 +28,12 @@ KNOWN_GOOD_FILE = 'known_good.json' +SITE_TO_KNOWN_GOOD_FILE = { 'github' : 'known_good.json', + 'gitlab' : 'known_good_khr.json' } + # Maps a site name to its hostname. -SITE_TO_HOST = { 'github' : 'github.com' } +SITE_TO_HOST = { 'github' : 'https://github.com/', + 'gitlab' : 'git@gitlab.khronos.org:' } VERBOSE = True @@ -82,14 +86,11 @@ self.subdir = json['subdir'] if ('subdir' in json) else '.' self.commit = json['commit'] - def GetUrl(self, style='https'): + def GetUrl(self): """Returns the URL for the repository.""" host = SITE_TO_HOST[self.site] - sep = '/' if (style is 'https') else ':' - return '{style}://{host}{sep}{subrepo}'.format( - style=style, + return '{host}{subrepo}'.format( host=host, - sep=sep, subrepo=self.subrepo) def AddRemote(self): @@ -120,9 +121,10 @@ command_output(['git', 'checkout', self.commit], self.subdir) -def GetGoodCommits(): +def GetGoodCommits(site): """Returns the latest list of GoodCommit objects.""" - with open(KNOWN_GOOD_FILE) as known_good: + known_good_file = SITE_TO_KNOWN_GOOD_FILE[site] + with open(known_good_file) as known_good: return [GoodCommit(c) for c in json.loads(known_good.read())['commits']] @@ -130,10 +132,12 @@ parser = argparse.ArgumentParser(description='Get Glslang source dependencies at a known-good commit') parser.add_argument('--dir', dest='dir', default='.', help="Set target directory for Glslang source root. Default is \'.\'.") + parser.add_argument('--site', dest='site', default='github', + help="Set git server site. Default is github.") args = parser.parse_args() - commits = GetGoodCommits() + commits = GetGoodCommits(args.site) distutils.dir_util.mkpath(args.dir) print('Change directory to {d}'.format(d=args.dir)) diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/Android.mk vulkan-1.1.73+dfsg/external/spirv-tools/Android.mk --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/Android.mk 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/Android.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,218 +0,0 @@ -LOCAL_PATH := $(call my-dir) -SPVTOOLS_OUT_PATH=$(if $(call host-path-is-absolute,$(TARGET_OUT)),$(TARGET_OUT),$(abspath $(TARGET_OUT))) -SPVHEADERS_LOCAL_PATH := $(LOCAL_PATH)/external/spirv-headers - -SPVTOOLS_SRC_FILES := \ - source/assembly_grammar.cpp \ - source/binary.cpp \ - source/diagnostic.cpp \ - source/disassemble.cpp \ - source/ext_inst.cpp \ - source/enum_string_mapping.cpp \ - source/extensions.cpp \ - source/id_descriptor.cpp \ - source/libspirv.cpp \ - source/name_mapper.cpp \ - source/opcode.cpp \ - source/operand.cpp \ - source/parsed_operand.cpp \ - source/print.cpp \ - source/software_version.cpp \ - source/spirv_endian.cpp \ - source/spirv_target_env.cpp \ - source/spirv_validator_options.cpp \ - source/table.cpp \ - source/text.cpp \ - source/text_handler.cpp \ - source/util/bit_stream.cpp \ - source/util/parse_number.cpp \ - source/util/string_utils.cpp \ - source/val/basic_block.cpp \ - source/val/construct.cpp \ - source/val/function.cpp \ - source/val/instruction.cpp \ - source/val/validation_state.cpp \ - source/validate.cpp \ - source/validate_arithmetics.cpp \ - source/validate_bitwise.cpp \ - source/validate_capability.cpp \ - source/validate_cfg.cpp \ - source/validate_conversion.cpp \ - source/validate_datarules.cpp \ - source/validate_decorations.cpp \ - source/validate_id.cpp \ - source/validate_instruction.cpp \ - source/validate_layout.cpp \ - source/validate_logicals.cpp \ - source/validate_type_unique.cpp - -SPVTOOLS_OPT_SRC_FILES := \ - source/opt/aggressive_dead_code_elim_pass.cpp \ - source/opt/basic_block.cpp \ - source/opt/block_merge_pass.cpp \ - source/opt/build_module.cpp \ - source/opt/cfg_cleanup_pass.cpp \ - source/opt/compact_ids_pass.cpp \ - source/opt/common_uniform_elim_pass.cpp \ - source/opt/dead_branch_elim_pass.cpp \ - source/opt/dead_variable_elimination.cpp \ - source/opt/decoration_manager.cpp \ - source/opt/def_use_manager.cpp \ - source/opt/eliminate_dead_constant_pass.cpp \ - source/opt/eliminate_dead_functions_pass.cpp \ - source/opt/flatten_decoration_pass.cpp \ - source/opt/fold.cpp \ - source/opt/fold_spec_constant_op_and_composite_pass.cpp \ - source/opt/freeze_spec_constant_value_pass.cpp \ - source/opt/function.cpp \ - source/opt/inline_pass.cpp \ - source/opt/inline_exhaustive_pass.cpp \ - source/opt/inline_opaque_pass.cpp \ - source/opt/insert_extract_elim.cpp \ - source/opt/instruction.cpp \ - source/opt/instruction_list.cpp \ - source/opt/ir_loader.cpp \ - source/opt/local_access_chain_convert_pass.cpp \ - source/opt/local_single_block_elim_pass.cpp \ - source/opt/local_single_store_elim_pass.cpp \ - source/opt/local_ssa_elim_pass.cpp \ - source/opt/mem_pass.cpp \ - source/opt/module.cpp \ - source/opt/optimizer.cpp \ - source/opt/pass.cpp \ - source/opt/pass_manager.cpp \ - source/opt/remove_duplicates_pass.cpp \ - source/opt/set_spec_constant_default_value_pass.cpp \ - source/opt/strength_reduction_pass.cpp \ - source/opt/strip_debug_info_pass.cpp \ - source/opt/type_manager.cpp \ - source/opt/types.cpp \ - source/opt/unify_const_pass.cpp - -# Locations of grammar files. -SPV_CORE10_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.0/spirv.core.grammar.json -SPV_CORE11_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.1/spirv.core.grammar.json -SPV_CORE12_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.2/spirv.core.grammar.json -SPV_GLSL_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.0/extinst.glsl.std.450.grammar.json -SPV_OPENCL_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.0/extinst.opencl.std.100.grammar.json - -define gen_spvtools_grammar_tables -$(call generate-file-dir,$(1)/core.insts-1.0.inc) -$(1)/core.insts-1.0.inc $(1)/operand.kinds-1.0.inc $(1)/glsl.std.450.insts-1.0.inc $(1)/opencl.std.insts-1.0.inc: \ - $(LOCAL_PATH)/utils/generate_grammar_tables.py \ - $(SPV_CORE10_GRAMMAR) \ - $(SPV_GLSL_GRAMMAR) \ - $(SPV_OPENCL_GRAMMAR) - @$(HOST_PYTHON) $(LOCAL_PATH)/utils/generate_grammar_tables.py \ - --spirv-core-grammar=$(SPV_CORE10_GRAMMAR) \ - --extinst-glsl-grammar=$(SPV_GLSL_GRAMMAR) \ - --extinst-opencl-grammar=$(SPV_OPENCL_GRAMMAR) \ - --core-insts-output=$(1)/core.insts-1.0.inc \ - --glsl-insts-output=$(1)/glsl.std.450.insts-1.0.inc \ - --opencl-insts-output=$(1)/opencl.std.insts-1.0.inc \ - --operand-kinds-output=$(1)/operand.kinds-1.0.inc - @echo "[$(TARGET_ARCH_ABI)] Grammar v1.0 : instructions & operands <= grammar JSON files" -$(1)/core.insts-1.1.inc $(1)/operand.kinds-1.1.inc: \ - $(LOCAL_PATH)/utils/generate_grammar_tables.py \ - $(SPV_CORE11_GRAMMAR) - @$(HOST_PYTHON) $(LOCAL_PATH)/utils/generate_grammar_tables.py \ - --spirv-core-grammar=$(SPV_CORE11_GRAMMAR) \ - --core-insts-output=$(1)/core.insts-1.1.inc \ - --operand-kinds-output=$(1)/operand.kinds-1.1.inc - @echo "[$(TARGET_ARCH_ABI)] Grammar v1.1 : instructions & operands <= grammar JSON files" -$(1)/core.insts-1.2.inc $(1)/operand.kinds-1.2.inc: \ - $(LOCAL_PATH)/utils/generate_grammar_tables.py \ - $(SPV_CORE12_GRAMMAR) - @$(HOST_PYTHON) $(LOCAL_PATH)/utils/generate_grammar_tables.py \ - --spirv-core-grammar=$(SPV_CORE12_GRAMMAR) \ - --core-insts-output=$(1)/core.insts-1.2.inc \ - --operand-kinds-output=$(1)/operand.kinds-1.2.inc - @echo "[$(TARGET_ARCH_ABI)] Grammar v1.2 : instructions & operands <= grammar JSON files" -$(LOCAL_PATH)/source/opcode.cpp: $(1)/core.insts-1.0.inc $(1)/core.insts-1.1.inc $(1)/core.insts-1.2.inc -$(LOCAL_PATH)/source/operand.cpp: $(1)/operand.kinds-1.0.inc $(1)/operand.kinds-1.1.inc $(1)/operand.kinds-1.2.inc -$(LOCAL_PATH)/source/ext_inst.cpp: $(1)/glsl.std.450.insts-1.0.inc $(1)/opencl.std.insts-1.0.inc -endef -$(eval $(call gen_spvtools_grammar_tables,$(SPVTOOLS_OUT_PATH))) - -define gen_spvtools_vendor_tables -$(call generate-file-dir,$(1)/$(2).insts.inc) -$(1)/$(2).insts.inc : \ - $(LOCAL_PATH)/utils/generate_grammar_tables.py \ - $(LOCAL_PATH)/source/extinst.$(2).grammar.json - @$(HOST_PYTHON) $(LOCAL_PATH)/utils/generate_grammar_tables.py \ - --extinst-vendor-grammar=$(LOCAL_PATH)/source/extinst.$(2).grammar.json \ - --vendor-insts-output=$(1)/$(2).insts.inc - @echo "[$(TARGET_ARCH_ABI)] Vendor extended instruction set: $(2) tables <= grammar" -$(LOCAL_PATH)/source/ext_inst.cpp: $(1)/$(2).insts.inc -endef -# Vendor extended instruction sets, with grammars from SPIRV-Tools source tree. -SPV_NONSTANDARD_EXTINST_GRAMMARS=$(foreach F,$(wildcard $(LOCAL_PATH)/source/extinst.*.grammar.json),$(patsubst extinst.%.grammar.json,%,$(notdir $F))) -$(foreach E,$(SPV_NONSTANDARD_EXTINST_GRAMMARS),$(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),$E))) - -define gen_spvtools_enum_string_mapping -$(call generate-file-dir,$(1)/extension_enum.inc.inc) -$(1)/extension_enum.inc $(1)/enum_string_mapping.inc: \ - $(LOCAL_PATH)/utils/generate_grammar_tables.py \ - $(SPV_CORE11_GRAMMAR) - @$(HOST_PYTHON) $(LOCAL_PATH)/utils/generate_grammar_tables.py \ - --spirv-core-grammar=$(SPV_CORE11_GRAMMAR) \ - --extension-enum-output=$(1)/extension_enum.inc \ - --enum-string-mapping-output=$(1)/enum_string_mapping.inc - @echo "[$(TARGET_ARCH_ABI)] Generate enum<->string mapping <= grammar JSON files" -# Generated header extension_enum.inc is transitively included by table.h, which is -# used pervasively. Capture the pervasive dependency. -$(foreach F,$(SPVTOOLS_SRC_FILES) $(SPVTOOLS_OPT_SRC_FILES),$(LOCAL_PATH)/$F ) \ - : $(1)/extension_enum.inc -$(LOCAL_PATH)/source/enum_string_mapping.cpp: $(1)/enum_string_mapping.inc -endef -$(eval $(call gen_spvtools_enum_string_mapping,$(SPVTOOLS_OUT_PATH))) - -define gen_spvtools_build_version_inc -$(call generate-file-dir,$(1)/dummy_filename) -$(1)/build-version.inc: \ - $(LOCAL_PATH)/utils/update_build_version.py \ - $(LOCAL_PATH)/CHANGES - @$(HOST_PYTHON) $(LOCAL_PATH)/utils/update_build_version.py \ - $(LOCAL_PATH) $(1)/build-version.inc - @echo "[$(TARGET_ARCH_ABI)] Generate : build-version.inc <= CHANGES" -$(LOCAL_PATH)/source/software_version.cpp: $(1)/build-version.inc -endef -$(eval $(call gen_spvtools_build_version_inc,$(SPVTOOLS_OUT_PATH))) - -define gen_spvtools_generators_inc -$(call generate-file-dir,$(1)/dummy_filename) -$(1)/generators.inc: \ - $(LOCAL_PATH)/utils/generate_registry_tables.py \ - $(SPVHEADERS_LOCAL_PATH)/include/spirv/spir-v.xml - @$(HOST_PYTHON) $(LOCAL_PATH)/utils/generate_registry_tables.py \ - --xml=$(SPVHEADERS_LOCAL_PATH)/include/spirv/spir-v.xml \ - --generator-output=$(1)/generators.inc - @echo "[$(TARGET_ARCH_ABI)] Generate : generators.inc <= spir-v.xml" -$(LOCAL_PATH)/source/opcode.cpp: $(1)/generators.inc -endef -$(eval $(call gen_spvtools_generators_inc,$(SPVTOOLS_OUT_PATH))) - -include $(CLEAR_VARS) -LOCAL_MODULE := SPIRV-Tools -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/source \ - $(LOCAL_PATH)/external/spirv-headers/include \ - $(SPVTOOLS_OUT_PATH) -LOCAL_EXPORT_C_INCLUDES := \ - $(LOCAL_PATH)/include -LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti -Werror -LOCAL_SRC_FILES:= $(SPVTOOLS_SRC_FILES) -include $(BUILD_STATIC_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := SPIRV-Tools-opt -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/source \ - $(LOCAL_PATH)/external/spirv-headers/include \ - $(SPVTOOLS_OUT_PATH) -LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti -Werror -LOCAL_STATIC_LIBRARIES:=SPIRV-Tools -LOCAL_SRC_FILES:= $(SPVTOOLS_OPT_SRC_FILES) -include $(BUILD_STATIC_LIBRARY) diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/android_test/Android.mk vulkan-1.1.73+dfsg/external/spirv-tools/android_test/Android.mk --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/android_test/Android.mk 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/android_test/Android.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc .cpp .cxx -LOCAL_SRC_FILES:=test.cpp -LOCAL_MODULE:=spirvtools_test -LOCAL_LDLIBS:=-landroid -LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti -Werror -LOCAL_STATIC_LIBRARIES=SPIRV-Tools SPIRV-Tools-opt -include $(BUILD_SHARED_LIBRARY) - -include $(LOCAL_PATH)/../Android.mk diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/android_test/jni/Application.mk vulkan-1.1.73+dfsg/external/spirv-tools/android_test/jni/Application.mk --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/android_test/jni/Application.mk 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/android_test/jni/Application.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -APP_ABI := all -APP_BUILD_SCRIPT := Android.mk -APP_STL := gnustl_static -APP_PLATFORM := android-9 -NDK_TOOLCHAIN_VERSION := 4.9 diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/android_test/test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/android_test/test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/android_test/test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/android_test/test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include -#include "spirv-tools/libspirv.hpp" -#include "spirv-tools/optimizer.hpp" - -void android_main(struct android_app* /*state*/) { - spvtools::SpirvTools tools(SPV_ENV_UNIVERSAL_1_2); - spvtools::Optimizer optimizer(SPV_ENV_UNIVERSAL_1_2); -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/.appveyor.yml vulkan-1.1.73+dfsg/external/spirv-tools/.appveyor.yml --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/.appveyor.yml 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/.appveyor.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -# Windows Build Configuration for AppVeyor -# http://www.appveyor.com/docs/appveyor-yml - -# version format -version: "{build}" - -os: - - Visual Studio 2013 - - Visual Studio 2015 - - Visual Studio 2017 - -platform: - - Any CPU - -configuration: - - Debug - - Release - -branches: - only: - - master - -clone_depth: 5 - -matrix: - fast_finish: true # Show final status immediately if a test fails. - -# scripts that run after cloning repository -install: - - git clone https://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers - - git clone https://github.com/google/googletest.git external/googletest - -build: - parallel: true # enable MSBuild parallel builds - verbosity: minimal - -build_script: - - mkdir build && cd build - - cmake -DSPIRV_BUILD_COMPRESSION=ON .. - - cmake --build . --config %CONFIGURATION% - -test_script: - - ctest -C %CONFIGURATION% --output-on-failure --timeout 300 diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/CHANGES vulkan-1.1.73+dfsg/external/spirv-tools/CHANGES --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/CHANGES 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/CHANGES 1970-01-01 00:00:00.000000000 +0000 @@ -1,203 +0,0 @@ -Revision history for SPIRV-Tools - -v2017.1-dev 2017-09-01 - - General: - - Avoid static-duration variables of class type (with constructors). - - Validator: - - Type check basic arithmetic operations - - Type check Relational and Logical instructions - - Type check Bit instructions - - OpModuleProcessed is only allowed after debug names section and before annotations - section. - - Recognize extensions listed on SPIR-V registry, - through #25 SPV_AMD_shader_fragment_mask - - Optimizer: - - Add eliminater-dead-function transform - - Add strength reduction transform: For now, convert multiply by power of 2 - to a bit shift. - - Extract-insert elimination: Recognize the case where the first instruction - in the sequence is an OpCompositeConstruct or OpConstantComposite - - Fixes: - #798: spirv-as should fail when given unrecognized long option - #800: Inliner: Fix inlining function into header of multi-block loop - #824: Eliminate-local-multi-store: Fix a crash - #826: Elimiante-local-multi-store: Fix a crash - #827: Fix crash when compact-ids transform runs before another transform. - #834: Add Cmake option to build the compressing codec. Off by default. - -v2017.0 2017-09-01 - - Update README to describe that assembler, disassembler, and binary parser support - are based on grammar files from the SPIRV-Headers repository. - -v2016.7 2017-09-01 - - Add SPIR-V 1.2 - - OpenCL 2.2 support is now based on SPIR-V 1.2 - - Support AMD extensions in assembler, disassembler: - SPV_AMD_gcn_shader - SPV_AMD_shader_ballot - SPV_AMD_shader_explicit_vertex_parameter - SPV_AMD_shader_trinary_minmax - SPV_AMD_gpu_shader_half_float - SPV_AMD_texture_gather_bias_lod - SPV_AMD_gpu_shader_int16 - - Optimizer: Add support for: - - Inline all function calls in entry points. - - Flatten decoration groups. Fixes #602 - - Id compaction (minimize Id bound). Fixes #624 - - Eliminate redundant composite insert followed by extract - - Simplify access chains to local variables - - Eliminate local variables with a single store, if possible - - Eliminate local variables with a several stores, if possible - - Eliminate loads and stores in same block to local variables - - Eliminate redundant insert/extract to composite values - - Aggressive dead instruction elimination - - Eliminate dead branches - - Merge blocks when the second can only be preceded by the first - - Eliminate ommon uniform loads - - Assembler: Add option to preserve numeric ids. Fixes #625 - - Add build target spirv-tools-vimsyntax to generate spvasm.vim, a SPIR-V - assembly syntax file for Vim. - - Version string: Allow overriding of wall clock timestamp with contents - of environment variable SOURCE_DATE_EPOCH. - - Validator implements relaxed rules for SPV_KHR_16bit_storage. - - CMake installation rules use GNUInstallDirs. For example, libraries - will be installed into a lib64 directory if that's the norm for the - current system. - - Fixes: - #500: Parameterize validator limit checks - #508: Support compilation under CYGWIN - #517: Fix validation when continue (or case) contstruct is also the head of a - nested control construct. - #551: If a merge block is reachable, it must be *strictly* dominated by its - header. - #548: Validator: Error when the reserved OpImageSparseSampleProj* opcodes - are used. - #611: spvtools::Optimizer was failing to save the module to the output - binary vector when all passes succeded without changes. - #629: The inline-entry-points-all optimization could generate invalidly - structured code when the inlined function had early returns. - #697: Optimizer's Instruction::ForEachInId method was skipping semantics-id - and scope-id. - #755: Inliner: Fix inlining of callee with single Return appearing before - the end of the function. - #776: Fix dead branch elimination in presence of complex but dead control - flow. - #781: SPV_KHR_variable_pointers allows duplicate pointer types - #782: Inliner: Fix remapping of non-label forward references in callee - #787: Inliner: Fix remapping of inlined entry block when called from - single block loop. - #790: Inliner: Fix remapping of inlined entry block when callee has - multiple returns. - -v2016.6 2016-12-13 - - Published the C++ interface for assembling, disassembling, validation, and - optimization. - - Support SPV_KHR_shader_draw_parameters in assembler, disassembler, parser. - - Validator: - - Add validator API accepting raw binary words - - Increased coverage: - - Checks "Data rules" in Universal Validation Rules, section 2.16.1 - - WIP: Universal Limits. - - The minimum mandated upper bounds are checked. - - TODO: Parameterize the validator to allow larger limits accepted by - a more than minimally capable implementation. - - OpSampledImage checks - - OpConstantComposite checks - - Id bound check - - Disasssembler: - - Generates friendly GLSL-based names for more builtin variables - - Generates friendly names for numeric OpConstant values - - Vendor tool info extracted from SPIR-V XML registry file. - - Fixes issues: - #429: Validator: Allow OpTypeForwardPointer and OpTypeStruct to reference - undefined IDs - #482: Validator: OpVariable initializer can be an ID of a module-scope variable - -v2016.5 2016-09-16 - - Support SPV_KHR_shader_ballot in assembler, disassembler, parser. - - Disassembler: Generate friendly names for built-in variables. - - Partial fixes: - #359: Add Emacs helper for automatically diassembling/assembling a SPIR-V - binary on file load/save. - - Fixes: - #414: Validator: Allow OpUndef for composite constants - #415: Validator: Phi can use its own value in some cases. - -v2016.4 2016-09-01 - - Relicensed under Apache 2.0 - - Add optimization passes (in API and spirv-opt command) - - Fold spec constants defined with OpSpecConstantOp and - OpSpecConstantComposite to normal constants with fixed value(s). - - Fixes issues: - #318: Relicensed under Apache 2.0 - -v2016.3 2016-08-24 - - Add target environment enums for OpenCL 2.1, OpenCL 2.2, - OpenGL 4.0, OpenGL 4.1, OpenGL 4.2, OpenGL 4.3, OpenGL 4.5. - - Add spirv-cfg, an experimental tool to dump the control flow graph - as a GraphiViz "dot" graph - - Add optimization pass: Eliminate dead constants. - - Add spirv-lesspipe.sh filter utility - - Fixes issues: - #288: Check def-use dominance rules for OpPhi (variable,parent) operands - #339: Allow OpUndef in types-constants-global-vars section, as required - by SPIR-V 1.0 Rev7, 1.1 Rev 3. - #340: Avoid race on mkdir during build - #365: Relax PointSize, ClipDistance, CullDistance capability check in all - environments not just Vulkan 1.0. - -v2016.2 2016-08-05 - - Validator is incomplete - - Checks ID use block is dominated by definition block - - Add optimization passes (in API and spirv-opt command) - - Strip debug info instructions - - Freeze spec constant to their default values - - Allow INotEqual as operation for OpSpecConstantOp - - Fixes bugs: - #270: validator: crash when continue construct is unreachable - #279: validator: infinite loop when analyzing some degenerate control - flow graphs - #286: validator: don't incorrectly generate def-use error for - (variable,parent) parameters to OpPhi - #290: disassembler: never generate bare % for an identifier - #295: validator: def-use dominance check should ignore unreachable uses - #276: validator: allow unreachable continue constructs - #297: validator: allow an unreachable block to branch to a reachable - merge block - -v2016.1 2016-07-19 - - Fix https://github.com/KhronosGroup/SPIRV-Tools/issues/261 - Turn off ClipDistance and CullDistance capability checks for Vulkan. - - The disassembler can emit friendly names based on debug info (OpName - instructions), and will infer somewhat friendly names for most types. - This is turned on by default for the spirv-dis command line tool. - - Updated to support SPIR-V 1.1 rev 2 - - Input StorageClass, Sampled1D capability, and SampledBuffer capability - do not require Shader capability anymore. - -v2016.0 2016-07-04 - - - Adds v. versioning, with "-dev" indicating - work in progress. The intent is to more easly report - and summarize functionality when SPIRV-Tools is incorporated - in downstream projects. - - - Summary of functionality (See the README.md for more): - - Supports SPIR-V 1.1 Rev 1 - - Supports SPIR-V 1.0 Rev 5 - - Supports GLSL std450 extended instructions 1.0 Rev 3 - - Supports OpenCL extended instructions 1.0 Rev 2 - - Assembler, disassembler are complete - - Supports floating point widths of 16, 32, 64 bits - - Supports integer widths up to 64 bits - - Validator is incomplete - - Checks capability requirements in most cases - - Checks module layout constraints - - Checks ID use-definition ordering constraints, - ignoring control flow - - Checks some control flow graph rules - - Optimizer is introduced, with few available transforms. - - Supported on Linux, OSX, Android, Windows - - - Fixes bugs: - - #143: OpenCL pow and pown arguments diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/.clang-format vulkan-1.1.73+dfsg/external/spirv-tools/.clang-format --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/.clang-format 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/.clang-format 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ ---- -Language: Cpp -BasedOnStyle: Google -DerivePointerAlignment: false -... diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,199 +0,0 @@ -# Copyright (c) 2015-2016 The Khronos Group Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -cmake_minimum_required(VERSION 2.8.12) -if (POLICY CMP0048) - cmake_policy(SET CMP0048 NEW) -endif() -if (POLICY CMP0054) - # Avoid dereferencing variables or interpret keywords that have been - # quoted or bracketed. - # https://cmake.org/cmake/help/v3.1/policy/CMP0054.html - cmake_policy(SET CMP0054 NEW) -endif() -set_property(GLOBAL PROPERTY USE_FOLDERS ON) - -project(spirv-tools) -enable_testing() -set(SPIRV_TOOLS "SPIRV-Tools") - -include(GNUInstallDirs) - -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") - add_definitions(-DSPIRV_LINUX) -elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") - add_definitions(-DSPIRV_WINDOWS) -elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") - add_definitions(-DSPIRV_WINDOWS) -elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") - add_definitions(-DSPIRV_MAC) -elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Android") - add_definitions(-DSPIRV_ANDROID) -elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD") - add_definitions(-DSPIRV_FREEBSD) -else() - message(FATAL_ERROR "Your platform '${CMAKE_SYSTEM_NAME}' is not supported!") -endif() - -if ("${CMAKE_BUILD_TYPE}" STREQUAL "") - message(STATUS "No build type selected, default to Debug") - set(CMAKE_BUILD_TYPE "Debug") -endif() - -option(SKIP_SPIRV_TOOLS_INSTALL "Skip installation" ${SKIP_SPIRV_TOOLS_INSTALL}) -if(NOT ${SKIP_SPIRV_TOOLS_INSTALL}) - set(ENABLE_SPIRV_TOOLS_INSTALL ON) -endif() - -option(SPIRV_BUILD_COMPRESSION "Build SPIR-V compressing codec" OFF) - -option(SPIRV_WERROR "Enable error on warning" ON) -if(("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")) - set(COMPILER_IS_LIKE_GNU TRUE) -endif() -if(${COMPILER_IS_LIKE_GNU}) - set(SPIRV_WARNINGS -Wall -Wextra -Wnon-virtual-dtor -Wno-missing-field-initializers) - - option(SPIRV_WARN_EVERYTHING "Enable -Weverything" ${SPIRV_WARN_EVERYTHING}) - if(${SPIRV_WARN_EVERYTHING}) - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(SPIRV_WARNINGS ${SPIRV_WARNINGS} - -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded) - elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - set(SPIRV_WARNINGS ${SPIRV_WARNINGS} -Wpedantic -pedantic-errors) - else() - message(STATUS "Unknown compiler ${CMAKE_CXX_COMPILER_ID}, " - "so SPIRV_WARN_EVERYTHING has no effect") - endif() - endif() - - if(${SPIRV_WERROR}) - set(SPIRV_WARNINGS ${SPIRV_WARNINGS} -Werror) - endif() -elseif(MSVC) - set(SPIRV_WARNINGS -D_CRT_SECURE_NO_WARNINGS /wd4800) - - if(${SPIRV_WERROR}) - set(SPIRV_WARNINGS ${SPIRV_WARNINGS} /WX) - endif() -endif() - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/source) - -option(SPIRV_COLOR_TERMINAL "Enable color terminal output" ON) -if(${SPIRV_COLOR_TERMINAL}) - add_definitions(-DSPIRV_COLOR_TERMINAL) -endif() - -option(SPIRV_LOG_DEBUG "Enable excessive debug output" OFF) -if(${SPIRV_LOG_DEBUG}) - add_definitions(-DSPIRV_LOG_DEBUG) -endif() - -if (DEFINED SPIRV_TOOLS_EXTRA_DEFINITIONS) - add_definitions(${SPIRV_TOOLS_EXTRA_DEFINITIONS}) -endif() - -function(spvtools_default_compile_options TARGET) - target_compile_options(${TARGET} PRIVATE ${SPIRV_WARNINGS}) - - if (${COMPILER_IS_LIKE_GNU}) - target_compile_options(${TARGET} PRIVATE - -std=c++11 -fno-exceptions -fno-rtti) - target_compile_options(${TARGET} PRIVATE - -Wall -Wextra -Wno-long-long -Wshadow -Wundef -Wconversion - -Wno-sign-conversion) - # For good call stacks in profiles, keep the frame pointers. - if(NOT "${SPIRV_PERF}" STREQUAL "") - target_compile_options(${TARGET} PRIVATE -fno-omit-frame-pointer) - endif() - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(SPIRV_USE_SANITIZER "" CACHE STRING - "Use the clang sanitizer [address|memory|thread|...]") - if(NOT "${SPIRV_USE_SANITIZER}" STREQUAL "") - target_compile_options(${TARGET} PRIVATE - -fsanitize=${SPIRV_USE_SANITIZER}) - endif() - else() - target_compile_options(${TARGET} PRIVATE - -Wno-missing-field-initializers) - endif() - endif() - - if (MSVC) - # Specify /EHs for exception handling. This makes using SPIRV-Tools as - # dependencies in other projects easier. - target_compile_options(${TARGET} PRIVATE /EHs) - endif() - - # For MinGW cross compile, statically link to the C++ runtime. - # But it still depends on MSVCRT.dll. - if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") - if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") - set_target_properties(${TARGET} PROPERTIES - LINK_FLAGS -static -static-libgcc -static-libstdc++) - endif() - endif() -endfunction() - -if(NOT COMMAND find_host_package) - macro(find_host_package) - find_package(${ARGN}) - endmacro() -endif() -if(NOT COMMAND find_host_program) - macro(find_host_program) - find_program(${ARGN}) - endmacro() -endif() - -find_host_package(PythonInterp) - - -# Defaults to OFF if the user didn't set it. -option(SPIRV_SKIP_EXECUTABLES - "Skip building the executable and tests along with the library" - ${SPIRV_SKIP_EXECUTABLES}) -option(SPIRV_SKIP_TESTS - "Skip building tests along with the library" ${SPIRV_SKIP_TESTS}) -if ("${SPIRV_SKIP_EXECUTABLES}") - set(SPIRV_SKIP_TESTS ON) -endif() - -add_subdirectory(external) - -add_subdirectory(source) -add_subdirectory(tools) - -add_subdirectory(test) -add_subdirectory(examples) - -if(ENABLE_SPIRV_TOOLS_INSTALL) - install( - FILES - ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/libspirv.h - ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/libspirv.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/optimizer.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/linker.hpp - DESTINATION - ${CMAKE_INSTALL_INCLUDEDIR}/spirv-tools/) -endif(ENABLE_SPIRV_TOOLS_INSTALL) - -if (NOT "${SPIRV_SKIP_TESTS}") - add_test(NAME spirv-tools-copyrights - COMMAND ${PYTHON_EXECUTABLE} utils/check_copyright.py - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - endif() diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/examples/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/examples/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/examples/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/examples/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -# Copyright (c) 2016 Google 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. - -# Add a SPIR-V Tools example. Signature: -# add_spvtools_example( -# TARGET target_name -# SRCS src_file1.cpp src_file2.cpp -# LIBS lib_target1 lib_target2 -# ) -function(add_spvtools_example) - if (NOT ${SPIRV_SKIP_EXECUTABLES}) - set(one_value_args TARGET) - set(multi_value_args SRCS LIBS) - cmake_parse_arguments( - ARG "" "${one_value_args}" "${multi_value_args}" ${ARGN}) - - add_executable(${ARG_TARGET} ${ARG_SRCS}) - spvtools_default_compile_options(${ARG_TARGET}) - target_link_libraries(${ARG_TARGET} PRIVATE ${ARG_LIBS}) - set_property(TARGET ${ARG_TARGET} PROPERTY FOLDER "SPIRV-Tools examples") - endif() -endfunction() - -add_subdirectory(cpp-interface) diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/examples/cpp-interface/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/examples/cpp-interface/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/examples/cpp-interface/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/examples/cpp-interface/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -# Copyright (c) 2016 Google 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. - -add_spvtools_example( - TARGET spirv-tools-cpp-example - SRCS main.cpp - LIBS SPIRV-Tools-opt -) \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/examples/cpp-interface/main.cpp vulkan-1.1.73+dfsg/external/spirv-tools/examples/cpp-interface/main.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/examples/cpp-interface/main.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/examples/cpp-interface/main.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This program demonstrates basic SPIR-V module processing using -// SPIRV-Tools C++ API: -// * Assembling -// * Validating -// * Optimizing -// * Disassembling - -#include -#include -#include - -#include "spirv-tools/libspirv.hpp" -#include "spirv-tools/optimizer.hpp" - -int main() { - const std::string source = - " OpCapability Shader " - " OpMemoryModel Logical GLSL450 " - " OpSource GLSL 450 " - " OpDecorate %spec SpecId 1 " - " %int = OpTypeInt 32 1 " - " %spec = OpSpecConstant %int 0 " - "%const = OpConstant %int 42"; - - spvtools::SpirvTools core(SPV_ENV_VULKAN_1_0); - spvtools::Optimizer opt(SPV_ENV_VULKAN_1_0); - - auto print_msg_to_stderr = [](spv_message_level_t, const char*, - const spv_position_t&, const char* m) { - std::cerr << "error: " << m << std::endl; - }; - core.SetMessageConsumer(print_msg_to_stderr); - opt.SetMessageConsumer(print_msg_to_stderr); - - std::vector spirv; - if (!core.Assemble(source, &spirv)) return 1; - if (!core.Validate(spirv)) return 1; - - opt.RegisterPass(spvtools::CreateSetSpecConstantDefaultValuePass({{1, "42"}})) - .RegisterPass(spvtools::CreateFreezeSpecConstantValuePass()) - .RegisterPass(spvtools::CreateUnifyConstantPass()) - .RegisterPass(spvtools::CreateStripDebugInfoPass()); - if (!opt.Run(spirv.data(), spirv.size(), &spirv)) return 1; - - std::string disassembly; - if (!core.Disassemble(spirv, &disassembly)) return 1; - std::cout << disassembly << "\n"; - - return 0; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/external/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -# Copyright (c) 2015-2016 The Khronos Group Inc. -# -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -if (DEFINED SPIRV-Headers_SOURCE_DIR) - # This allows flexible position of the SPIRV-Headers repo. - set(SPIRV_HEADER_DIR ${SPIRV-Headers_SOURCE_DIR}) -else() - set(SPIRV_HEADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/spirv-headers) -endif() - -if (IS_DIRECTORY ${SPIRV_HEADER_DIR}) - set(SPIRV_HEADER_INCLUDE_DIR ${SPIRV_HEADER_DIR}/include PARENT_SCOPE) -else() - message(FATAL_ERROR - "SPIRV-Headers was not found - please checkout a copy under external/.") -endif() - -if (NOT ${SPIRV_SKIP_EXECUTABLES}) - # Find gmock if we can. If it's not already configured, then try finding - # it in external/googletest. - if (TARGET gmock) - message(STATUS "Google Mock already configured") - else() - set(GMOCK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest/googlemock) - if(EXISTS ${GMOCK_DIR}) - if(WIN32) - option(gtest_force_shared_crt - "Use shared (DLL) run-time lib even when Google Test is built as static lib." - ON) - endif() - add_subdirectory(${GMOCK_DIR} EXCLUDE_FROM_ALL) - endif() - endif() - if (TARGET gmock) - set(GTEST_TARGETS - gtest - gtest_main - gmock - gmock_main - ) - foreach(target ${GTEST_TARGETS}) - set_property(TARGET ${target} PROPERTY FOLDER GoogleTest) - endforeach() - endif() -endif() diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -# Copyright (c) 2015-2016 The Khronos Group Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and/or associated documentation files (the -# "Materials"), to deal in the Materials without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Materials, and to -# permit persons to whom the Materials are furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Materials. -# -# MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS -# KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS -# SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT -# https://www.khronos.org/registry/ -# -# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. - -# -# The SPIR-V headers from the SPIR-V Registry -# https://www.khronos.org/registry/spir-v/ -# -cmake_minimum_required(VERSION 2.8) -project(SPIRV-Headers) - -# There are two ways to use this project. -# -# Using this source tree directly from a CMake-based project: -# 1. Add an add_subdirectory directive to include this sub directory. -# 2. Use ${SPIRV-Headers_SOURCE_DIR}/include} in a target_include_directories -# command. -# -# Installing the headers first, then using them with an implicit include -# directory. To install the headers: -# 1. mkdir build ; cd build -# 2. cmake .. -# 3. cmake --build . install-headers - -file(GLOB_RECURSE FILES include/spirv/*) -add_custom_target(install-headers - COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv ${CMAKE_INSTALL_PREFIX}/include/spirv) - -add_subdirectory(example) diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/example/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/example/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/example/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/example/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -add_library(SPIRV-Headers-example - ${CMAKE_CURRENT_SOURCE_DIR}/example.cpp) -target_include_directories(SPIRV-Headers-example - PRIVATE ${SPIRV-Headers_SOURCE_DIR}/include) - -add_library(SPIRV-Headers-example-1.1 - ${CMAKE_CURRENT_SOURCE_DIR}/example-1.1.cpp) -target_include_directories(SPIRV-Headers-example-1.1 - PRIVATE ${SPIRV-Headers_SOURCE_DIR}/include) diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/example/example-1.1.cpp vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/example/example-1.1.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/example/example-1.1.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/example/example-1.1.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -// Copyright (c) 2016 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and/or associated documentation files (the -// "Materials"), to deal in the Materials without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Materials, and to -// permit persons to whom the Materials are furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS -// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS -// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT -// https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. - -// Use the SPIR-V 1.1 core instruction set, but with 1.0 versions -// of the GLSL and OpenCL extended instruction sets. -#include -#include -#include - -namespace { - -const GLSLstd450 kSin = GLSLstd450Sin; -const OpenCLLIB::Entrypoints kNative_cos = OpenCLLIB::Native_cos; -const spv::Op kNop = spv::OpNop; - -// This instruction is new in SPIR-V 1.1. -const spv::Op kNamedBarrierInit = spv::OpNamedBarrierInitialize; - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/example/example.cpp vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/example/example.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/example/example.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/example/example.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -// Copyright (c) 2016 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and/or associated documentation files (the -// "Materials"), to deal in the Materials without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Materials, and to -// permit persons to whom the Materials are furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS -// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS -// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT -// https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. - -#include -#include -#include - -namespace { - -const GLSLstd450 kSin = GLSLstd450Sin; -const OpenCLLIB::Entrypoints kNative_cos = OpenCLLIB::Native_cos; -const spv::Op kNop = spv::OpNop; - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/.gitattributes vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/.gitattributes --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/.gitattributes 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/.gitattributes 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -*.json text -*.h text -*.hpp text -*.hpp11 text -*.lua text -*.py text -*.xml diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/extinst.glsl.std.450.grammar.json vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/extinst.glsl.std.450.grammar.json --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/extinst.glsl.std.450.grammar.json 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/extinst.glsl.std.450.grammar.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,642 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "version" : 100, - "revision" : 2, - "instructions" : [ - { - "opname" : "Round", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "RoundEven", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Trunc", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FAbs", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SAbs", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FSign", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SSign", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Floor", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Ceil", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Fract", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Radians", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "'degrees'" } - ] - }, - { - "opname" : "Degrees", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "'radians'" } - ] - }, - { - "opname" : "Sin", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Cos", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Tan", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Asin", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Acos", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atan", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "'y_over_x'" } - ] - }, - { - "opname" : "Sinh", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Cosh", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Tanh", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Asinh", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Acosh", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atanh", - "opcode" : 24, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atan2", - "opcode" : 25, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Pow", - "opcode" : 26, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "Exp", - "opcode" : 27, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Log", - "opcode" : 28, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Exp2", - "opcode" : 29, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Log2", - "opcode" : 30, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Sqrt", - "opcode" : 31, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "InverseSqrt", - "opcode" : 32, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Determinant", - "opcode" : 33, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "MatrixInverse", - "opcode" : 34, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Modf", - "opcode" : 35, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'i'" } - ] - }, - { - "opname" : "ModfStruct", - "opcode" : 36, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FMin", - "opcode" : 37, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "UMin", - "opcode" : 38, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "SMin", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "FMax", - "opcode" : 40, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "UMax", - "opcode" : 41, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "SMax", - "opcode" : 42, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "FClamp", - "opcode" : 43, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "UClamp", - "opcode" : 44, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "SClamp", - "opcode" : 45, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "FMix", - "opcode" : 46, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "IMix", - "opcode" : 47, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "Step", - "opcode" : 48, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SmoothStep", - "opcode" : 49, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge0'" }, - { "kind" : "IdRef", "name" : "'edge1'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Fma", - "opcode" : 50, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "Frexp", - "opcode" : 51, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "FrexpStruct", - "opcode" : 52, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Ldexp", - "opcode" : 53, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "PackSnorm4x8", - "opcode" : 54, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackUnorm4x8", - "opcode" : 55, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackSnorm2x16", - "opcode" : 56, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackUnorm2x16", - "opcode" : 57, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackHalf2x16", - "opcode" : 58, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackDouble2x32", - "opcode" : 59, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ], - "capabilities" : [ "Float64" ] - }, - { - "opname" : "UnpackSnorm2x16", - "opcode" : 60, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackUnorm2x16", - "opcode" : 61, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackHalf2x16", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "UnpackSnorm4x8", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackUnorm4x8", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackDouble2x32", - "opcode" : 65, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ], - "capabilities" : [ "Float64" ] - }, - { - "opname" : "Length", - "opcode" : 66, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Distance", - "opcode" : 67, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "Cross", - "opcode" : 68, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "Normalize", - "opcode" : 69, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FaceForward", - "opcode" : 70, - "operands" : [ - { "kind" : "IdRef", "name" : "'N'" }, - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'Nref'" } - ] - }, - { - "opname" : "Reflect", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'N'" } - ] - }, - { - "opname" : "Refract", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'N'" }, - { "kind" : "IdRef", "name" : "'eta'" } - ] - }, - { - "opname" : "FindILsb", - "opcode" : 73, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "FindSMsb", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "FindUMsb", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "InterpolateAtCentroid", - "opcode" : 76, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "InterpolateAtSample", - "opcode" : 77, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" }, - { "kind" : "IdRef", "name" : "'sample'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "InterpolateAtOffset", - "opcode" : 78, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" }, - { "kind" : "IdRef", "name" : "'offset'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "NMin", - "opcode" : 79, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "NMax", - "opcode" : 80, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "NClamp", - "opcode" : 81, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - } - ] -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/extinst.opencl.std.100.grammar.json vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/extinst.opencl.std.100.grammar.json --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/extinst.opencl.std.100.grammar.json 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/extinst.opencl.std.100.grammar.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,1279 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "version" : 100, - "revision" : 2, - "instructions" : [ - { - "opname" : "acos", - "opcode" : 0, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "acosh", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "acospi", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asin", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asinh", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asinpi", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan2", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atanh", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atanpi", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan2pi", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cbrt", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ceil", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "copysign", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "cos", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cosh", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cospi", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "erfc", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "erf", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp2", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp10", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "expm1", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fabs", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fdim", - "opcode" : 24, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "floor", - "opcode" : 25, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fma", - "opcode" : 26, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "fmax", - "opcode" : 27, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmin", - "opcode" : 28, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmod", - "opcode" : 29, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fract", - "opcode" : 30, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'ptr'" } - ] - }, - { - "opname" : "frexp", - "opcode" : 31, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "hypot", - "opcode" : 32, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "ilogb", - "opcode" : 33, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ldexp", - "opcode" : 34, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'k'" } - ] - }, - { - "opname" : "lgamma", - "opcode" : 35, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "lgamma_r", - "opcode" : 36, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'signp'" } - ] - }, - { - "opname" : "log", - "opcode" : 37, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log2", - "opcode" : 38, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log10", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log1p", - "opcode" : 40, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "logb", - "opcode" : 41, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "mad", - "opcode" : 42, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "maxmag", - "opcode" : 43, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "minmag", - "opcode" : 44, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "modf", - "opcode" : 45, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'iptr'" } - ] - }, - { - "opname" : "nan", - "opcode" : 46, - "operands" : [ - { "kind" : "IdRef", "name" : "'nancode'" } - ] - }, - { - "opname" : "nextafter", - "opcode" : 47, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "pow", - "opcode" : 48, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y" } - ] - }, - { - "opname" : "pown", - "opcode" : 49, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "powr", - "opcode" : 50, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "remainder", - "opcode" : 51, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "remquo", - "opcode" : 52, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'quo'" } - ] - }, - { - "opname" : "rint", - "opcode" : 53, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "rootn", - "opcode" : 54, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "round", - "opcode" : 55, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "rsqrt", - "opcode" : 56, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sin", - "opcode" : 57, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sincos", - "opcode" : 58, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'cosval'" } - ] - }, - { - "opname" : "sinh", - "opcode" : 59, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sinpi", - "opcode" : 60, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sqrt", - "opcode" : 61, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tan", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tanh", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tanpi", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tgamma", - "opcode" : 65, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "trunc", - "opcode" : 66, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_cos", - "opcode" : 67, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_divide", - "opcode" : 68, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "half_exp", - "opcode" : 69, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_exp2", - "opcode" : 70, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_exp10", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log2", - "opcode" : 73, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log10", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_powr", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "half_recip", - "opcode" : 76, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_rsqrt", - "opcode" : 77, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_sin", - "opcode" : 78, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_sqrt", - "opcode" : 79, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_tan", - "opcode" : 80, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_cos", - "opcode" : 81, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_divide", - "opcode" : 82, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "native_exp", - "opcode" : 83, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_exp2", - "opcode" : 84, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_exp10", - "opcode" : 85, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log", - "opcode" : 86, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log2", - "opcode" : 87, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log10", - "opcode" : 88, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_powr", - "opcode" : 89, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "native_recip", - "opcode" : 90, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_rsqrt", - "opcode" : 91, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_sin", - "opcode" : 92, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_sqrt", - "opcode" : 93, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_tan", - "opcode" : 94, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_abs", - "opcode" : 141, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_abs_diff", - "opcode" : 142, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_add_sat", - "opcode" : 143, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_add_sat", - "opcode" : 144, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_hadd", - "opcode" : 145, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_hadd", - "opcode" : 146, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_rhadd", - "opcode" : 147, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_rhadd", - "opcode" : 148, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_clamp", - "opcode" : 149, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "u_clamp", - "opcode" : 150, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "clz", - "opcode" : 151, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ctz", - "opcode" : 152, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_mad_hi", - "opcode" : 153, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "u_mad_sat", - "opcode" : 154, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_mad_sat", - "opcode" : 155, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_max", - "opcode" : 156, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_max", - "opcode" : 157, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_min", - "opcode" : 158, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_min", - "opcode" : 159, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_mul_hi", - "opcode" : 160, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "rotate", - "opcode" : 161, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" }, - { "kind" : "IdRef", "name" : "'i'" } - ] - }, - { - "opname" : "s_sub_sat", - "opcode" : 162, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_sub_sat", - "opcode" : 163, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_upsample", - "opcode" : 164, - "operands" : [ - { "kind" : "IdRef", "name" : "'hi'" }, - { "kind" : "IdRef", "name" : "'lo'" } - ] - }, - { - "opname" : "s_upsample", - "opcode" : 165, - "operands" : [ - { "kind" : "IdRef", "name" : "'hi'" }, - { "kind" : "IdRef", "name" : "'lo'" } - ] - }, - { - "opname" : "popcount", - "opcode" : 166, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_mad24", - "opcode" : 167, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "u_mad24", - "opcode" : 168, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_mul24", - "opcode" : 169, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mul24", - "opcode" : 170, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_abs", - "opcode" : 201, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "u_abs_diff", - "opcode" : 202, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mul_hi", - "opcode" : 203, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mad_hi", - "opcode" : 204, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "fclamp", - "opcode" : 95, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "degrees", - "opcode" :96, - "operands" : [ - { "kind" : "IdRef", "name" : "'radians'" } - ] - }, - { - "opname" : "fmax_common", - "opcode" : 97, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmin_common", - "opcode" : 98, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "mix", - "opcode" : 99, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "radians", - "opcode" : 100, - "operands" : [ - { "kind" : "IdRef", "name" : "'degrees'" } - ] - }, - { - "opname" : "step", - "opcode" : 101, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "smoothstep", - "opcode" : 102, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge0'" }, - { "kind" : "IdRef", "name" : "'edge1'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sign", - "opcode" : 103, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cross", - "opcode" : 104, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "distance", - "opcode" : 105, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "length", - "opcode" : 106, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "normalize", - "opcode" : 107, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "fast_distance", - "opcode" : 108, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "fast_length", - "opcode" : 109, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "fast_normalize", - "opcode" : 110, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "bitselect", - "opcode" : 186, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "select", - "opcode" : 187, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "vloadn", - "opcode" : 171, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstoren", - "opcode" : 172, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vload_half", - "opcode" : 173, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vload_halfn", - "opcode" : 174, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstore_half", - "opcode" : 175, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstore_half_r", - "opcode" : 176, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "vstore_halfn", - "opcode" : 177, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstore_halfn_r", - "opcode" : 178, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "vloada_halfn", - "opcode" : 179, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstorea_halfn", - "opcode" : 180, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstorea_halfn_r", - "opcode" : 181, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "shuffle", - "opcode" : 182, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'shuffle mask'" } - ] - }, - { - "opname" : "shuffle2", - "opcode" : 183, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'shuffle mask'" } - ] - }, - { - "opname" : "printf", - "opcode" : 184, - "operands" : [ - { "kind" : "IdRef", "name" : "'format'" }, - { "kind" : "IdRef", "name" : "'additional arguments'", "quantifier" : "*" } - ] - }, - { - "opname" : "prefetch", - "opcode" : 185, - "operands" : [ - { "kind" : "IdRef", "name" : "'ptr'" }, - { "kind" : "IdRef", "name" : "'num elements'" } - ] - } - ] -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/GLSL.std.450.h vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/GLSL.std.450.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/GLSL.std.450.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/GLSL.std.450.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,131 +0,0 @@ -/* -** Copyright (c) 2014-2016 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and/or associated documentation files (the "Materials"), -** to deal in the Materials without restriction, including without limitation -** the rights to use, copy, modify, merge, publish, distribute, sublicense, -** and/or sell copies of the Materials, and to permit persons to whom the -** Materials are furnished to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in -** all copies or substantial portions of the Materials. -** -** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -** IN THE MATERIALS. -*/ - -#ifndef GLSLstd450_H -#define GLSLstd450_H - -static const int GLSLstd450Version = 100; -static const int GLSLstd450Revision = 3; - -enum GLSLstd450 { - GLSLstd450Bad = 0, // Don't use - - GLSLstd450Round = 1, - GLSLstd450RoundEven = 2, - GLSLstd450Trunc = 3, - GLSLstd450FAbs = 4, - GLSLstd450SAbs = 5, - GLSLstd450FSign = 6, - GLSLstd450SSign = 7, - GLSLstd450Floor = 8, - GLSLstd450Ceil = 9, - GLSLstd450Fract = 10, - - GLSLstd450Radians = 11, - GLSLstd450Degrees = 12, - GLSLstd450Sin = 13, - GLSLstd450Cos = 14, - GLSLstd450Tan = 15, - GLSLstd450Asin = 16, - GLSLstd450Acos = 17, - GLSLstd450Atan = 18, - GLSLstd450Sinh = 19, - GLSLstd450Cosh = 20, - GLSLstd450Tanh = 21, - GLSLstd450Asinh = 22, - GLSLstd450Acosh = 23, - GLSLstd450Atanh = 24, - GLSLstd450Atan2 = 25, - - GLSLstd450Pow = 26, - GLSLstd450Exp = 27, - GLSLstd450Log = 28, - GLSLstd450Exp2 = 29, - GLSLstd450Log2 = 30, - GLSLstd450Sqrt = 31, - GLSLstd450InverseSqrt = 32, - - GLSLstd450Determinant = 33, - GLSLstd450MatrixInverse = 34, - - GLSLstd450Modf = 35, // second operand needs an OpVariable to write to - GLSLstd450ModfStruct = 36, // no OpVariable operand - GLSLstd450FMin = 37, - GLSLstd450UMin = 38, - GLSLstd450SMin = 39, - GLSLstd450FMax = 40, - GLSLstd450UMax = 41, - GLSLstd450SMax = 42, - GLSLstd450FClamp = 43, - GLSLstd450UClamp = 44, - GLSLstd450SClamp = 45, - GLSLstd450FMix = 46, - GLSLstd450IMix = 47, // Reserved - GLSLstd450Step = 48, - GLSLstd450SmoothStep = 49, - - GLSLstd450Fma = 50, - GLSLstd450Frexp = 51, // second operand needs an OpVariable to write to - GLSLstd450FrexpStruct = 52, // no OpVariable operand - GLSLstd450Ldexp = 53, - - GLSLstd450PackSnorm4x8 = 54, - GLSLstd450PackUnorm4x8 = 55, - GLSLstd450PackSnorm2x16 = 56, - GLSLstd450PackUnorm2x16 = 57, - GLSLstd450PackHalf2x16 = 58, - GLSLstd450PackDouble2x32 = 59, - GLSLstd450UnpackSnorm2x16 = 60, - GLSLstd450UnpackUnorm2x16 = 61, - GLSLstd450UnpackHalf2x16 = 62, - GLSLstd450UnpackSnorm4x8 = 63, - GLSLstd450UnpackUnorm4x8 = 64, - GLSLstd450UnpackDouble2x32 = 65, - - GLSLstd450Length = 66, - GLSLstd450Distance = 67, - GLSLstd450Cross = 68, - GLSLstd450Normalize = 69, - GLSLstd450FaceForward = 70, - GLSLstd450Reflect = 71, - GLSLstd450Refract = 72, - - GLSLstd450FindILsb = 73, - GLSLstd450FindSMsb = 74, - GLSLstd450FindUMsb = 75, - - GLSLstd450InterpolateAtCentroid = 76, - GLSLstd450InterpolateAtSample = 77, - GLSLstd450InterpolateAtOffset = 78, - - GLSLstd450NMin = 79, - GLSLstd450NMax = 80, - GLSLstd450NClamp = 81, - - GLSLstd450Count -}; - -#endif // #ifndef GLSLstd450_H diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/OpenCL.std.h vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/OpenCL.std.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/OpenCL.std.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/OpenCL.std.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,210 +0,0 @@ -/* -** Copyright (c) 2015-2017 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and/or associated documentation files (the "Materials"), -** to deal in the Materials without restriction, including without limitation -** the rights to use, copy, modify, merge, publish, distribute, sublicense, -** and/or sell copies of the Materials, and to permit persons to whom the -** Materials are furnished to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in -** all copies or substantial portions of the Materials. -** -** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -** IN THE MATERIALS. -*/ - -namespace OpenCLLIB { - -enum Entrypoints { - - // Section 2.1: Math extended instructions - Acos = 0, - Acosh = 1, - Acospi = 2, - Asin = 3, - Asinh = 4, - Asinpi = 5, - Atan = 6, - Atan2 = 7, - Atanh = 8, - Atanpi = 9, - Atan2pi = 10, - Cbrt = 11, - Ceil = 12, - Copysign = 13, - Cos = 14, - Cosh = 15, - Cospi = 16, - Erfc = 17, - Erf = 18, - Exp = 19, - Exp2 = 20, - Exp10 = 21, - Expm1 = 22, - Fabs = 23, - Fdim = 24, - Floor = 25, - Fma = 26, - Fmax = 27, - Fmin = 28, - Fmod = 29, - Fract = 30, - Frexp = 31, - Hypot = 32, - Ilogb = 33, - Ldexp = 34, - Lgamma = 35, - Lgamma_r = 36, - Log = 37, - Log2 = 38, - Log10 = 39, - Log1p = 40, - Logb = 41, - Mad = 42, - Maxmag = 43, - Minmag = 44, - Modf = 45, - Nan = 46, - Nextafter = 47, - Pow = 48, - Pown = 49, - Powr = 50, - Remainder = 51, - Remquo = 52, - Rint = 53, - Rootn = 54, - Round = 55, - Rsqrt = 56, - Sin = 57, - Sincos = 58, - Sinh = 59, - Sinpi = 60, - Sqrt = 61, - Tan = 62, - Tanh = 63, - Tanpi = 64, - Tgamma = 65, - Trunc = 66, - Half_cos = 67, - Half_divide = 68, - Half_exp = 69, - Half_exp2 = 70, - Half_exp10 = 71, - Half_log = 72, - Half_log2 = 73, - Half_log10 = 74, - Half_powr = 75, - Half_recip = 76, - Half_rsqrt = 77, - Half_sin = 78, - Half_sqrt = 79, - Half_tan = 80, - Native_cos = 81, - Native_divide = 82, - Native_exp = 83, - Native_exp2 = 84, - Native_exp10 = 85, - Native_log = 86, - Native_log2 = 87, - Native_log10 = 88, - Native_powr = 89, - Native_recip = 90, - Native_rsqrt = 91, - Native_sin = 92, - Native_sqrt = 93, - Native_tan = 94, - - // Section 2.2: Integer instructions - SAbs = 141, - SAbs_diff = 142, - SAdd_sat = 143, - UAdd_sat = 144, - SHadd = 145, - UHadd = 146, - SRhadd = 147, - URhadd = 148, - SClamp = 149, - UClamp = 150, - Clz = 151, - Ctz = 152, - SMad_hi = 153, - UMad_sat = 154, - SMad_sat = 155, - SMax = 156, - UMax = 157, - SMin = 158, - UMin = 159, - SMul_hi = 160, - Rotate = 161, - SSub_sat = 162, - USub_sat = 163, - U_Upsample = 164, - S_Upsample = 165, - Popcount = 166, - SMad24 = 167, - UMad24 = 168, - SMul24 = 169, - UMul24 = 170, - UAbs = 201, - UAbs_diff = 202, - UMul_hi = 203, - UMad_hi = 204, - - // Section 2.3: Common instructions - FClamp = 95, - Degrees = 96, - FMax_common = 97, - FMin_common = 98, - Mix = 99, - Radians = 100, - Step = 101, - Smoothstep = 102, - Sign = 103, - - // Section 2.4: Geometric instructions - Cross = 104, - Distance = 105, - Length = 106, - Normalize = 107, - Fast_distance = 108, - Fast_length = 109, - Fast_normalize = 110, - - // Section 2.5: Relational instructions - Bitselect = 186, - Select = 187, - - // Section 2.6: Vector Data Load and Store instructions - Vloadn = 171, - Vstoren = 172, - Vload_half = 173, - Vload_halfn = 174, - Vstore_half = 175, - Vstore_half_r = 176, - Vstore_halfn = 177, - Vstore_halfn_r = 178, - Vloada_halfn = 179, - Vstorea_halfn = 180, - Vstorea_halfn_r = 181, - - // Section 2.7: Miscellaneous Vector instructions - Shuffle = 182, - Shuffle2 = 183, - - // Section 2.8: Misc instructions - Printf = 184, - Prefetch = 185, -}; - -} // end namespace OpenCLLIB diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.core.grammar.json vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.core.grammar.json --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.core.grammar.json 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.core.grammar.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,5731 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "magic_number" : "0x07230203", - "major_version" : 1, - "minor_version" : 0, - "revision" : 12, - "instructions" : [ - { - "opname" : "OpNop", - "opcode" : 0 - }, - { - "opname" : "OpUndef", - "opcode" : 1, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSourceContinued", - "opcode" : 2, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Continued Source'" } - ] - }, - { - "opname" : "OpSource", - "opcode" : 3, - "operands" : [ - { "kind" : "SourceLanguage" }, - { "kind" : "LiteralInteger", "name" : "'Version'" }, - { "kind" : "IdRef", "quantifier" : "?", "name" : "'File'" }, - { "kind" : "LiteralString", "quantifier" : "?", "name" : "'Source'" } - ] - }, - { - "opname" : "OpSourceExtension", - "opcode" : 4, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Extension'" } - ] - }, - { - "opname" : "OpName", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpMemberName", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpString", - "opcode" : 7, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "'String'" } - ] - }, - { - "opname" : "OpLine", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'File'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" } - ] - }, - { - "opname" : "OpExtension", - "opcode" : 10, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpExtInstImport", - "opcode" : 11, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpExtInst", - "opcode" : 12, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Set'" }, - { "kind" : "LiteralExtInstInteger", "name" : "'Instruction'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Operand 1', +\n'Operand 2', +\n..." } - ] - }, - { - "opname" : "OpMemoryModel", - "opcode" : 14, - "operands" : [ - { "kind" : "AddressingModel" }, - { "kind" : "MemoryModel" } - ] - }, - { - "opname" : "OpEntryPoint", - "opcode" : 15, - "operands" : [ - { "kind" : "ExecutionModel" }, - { "kind" : "IdRef", "name" : "'Entry Point'" }, - { "kind" : "LiteralString", "name" : "'Name'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Interface'" } - ] - }, - { - "opname" : "OpExecutionMode", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'Entry Point'" }, - { "kind" : "ExecutionMode", "name" : "'Mode'" } - ] - }, - { - "opname" : "OpCapability", - "opcode" : 17, - "operands" : [ - { "kind" : "Capability", "name" : "'Capability'" } - ] - }, - { - "opname" : "OpTypeVoid", - "opcode" : 19, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeBool", - "opcode" : 20, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeInt", - "opcode" : 21, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Width'" }, - { "kind" : "LiteralInteger", "name" : "'Signedness'" } - ] - }, - { - "opname" : "OpTypeFloat", - "opcode" : 22, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Width'" } - ] - }, - { - "opname" : "OpTypeVector", - "opcode" : 23, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Component Type'" }, - { "kind" : "LiteralInteger", "name" : "'Component Count'" } - ] - }, - { - "opname" : "OpTypeMatrix", - "opcode" : 24, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Column Type'" }, - { "kind" : "LiteralInteger", "name" : "'Column Count'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpTypeImage", - "opcode" : 25, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Type'" }, - { "kind" : "Dim" }, - { "kind" : "LiteralInteger", "name" : "'Depth'" }, - { "kind" : "LiteralInteger", "name" : "'Arrayed'" }, - { "kind" : "LiteralInteger", "name" : "'MS'" }, - { "kind" : "LiteralInteger", "name" : "'Sampled'" }, - { "kind" : "ImageFormat" }, - { "kind" : "AccessQualifier", "quantifier" : "?" } - ] - }, - { - "opname" : "OpTypeSampler", - "opcode" : 26, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeSampledImage", - "opcode" : 27, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image Type'" } - ] - }, - { - "opname" : "OpTypeArray", - "opcode" : 28, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Element Type'" }, - { "kind" : "IdRef", "name" : "'Length'" } - ] - }, - { - "opname" : "OpTypeRuntimeArray", - "opcode" : 29, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Element Type'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpTypeStruct", - "opcode" : 30, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Member 0 type', +\n'member 1 type', +\n..." } - ] - }, - { - "opname" : "OpTypeOpaque", - "opcode" : 31, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "The name of the opaque type." } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpTypePointer", - "opcode" : 32, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "StorageClass" }, - { "kind" : "IdRef", "name" : "'Type'" } - ] - }, - { - "opname" : "OpTypeFunction", - "opcode" : 33, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Return Type'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Parameter 0 Type', +\n'Parameter 1 Type', +\n..." } - ] - }, - { - "opname" : "OpTypeEvent", - "opcode" : 34, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpTypeDeviceEvent", - "opcode" : 35, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpTypeReserveId", - "opcode" : 36, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpTypeQueue", - "opcode" : 37, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpTypePipe", - "opcode" : 38, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "AccessQualifier", "name" : "'Qualifier'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpTypeForwardPointer", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer Type'" }, - { "kind" : "StorageClass" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpConstantTrue", - "opcode" : 41, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpConstantFalse", - "opcode" : 42, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpConstant", - "opcode" : 43, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } - ] - }, - { - "opname" : "OpConstantComposite", - "opcode" : 44, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpConstantSampler", - "opcode" : 45, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "SamplerAddressingMode" }, - { "kind" : "LiteralInteger", "name" : "'Param'" }, - { "kind" : "SamplerFilterMode" } - ], - "capabilities" : [ "LiteralSampler" ] - }, - { - "opname" : "OpConstantNull", - "opcode" : 46, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstantTrue", - "opcode" : 48, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstantFalse", - "opcode" : 49, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstant", - "opcode" : 50, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } - ] - }, - { - "opname" : "OpSpecConstantComposite", - "opcode" : 51, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpSpecConstantOp", - "opcode" : 52, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralSpecConstantOpInteger", "name" : "'Opcode'" } - ] - }, - { - "opname" : "OpFunction", - "opcode" : 54, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "FunctionControl" }, - { "kind" : "IdRef", "name" : "'Function Type'" } - ] - }, - { - "opname" : "OpFunctionParameter", - "opcode" : 55, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpFunctionEnd", - "opcode" : 56 - }, - { - "opname" : "OpFunctionCall", - "opcode" : 57, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Function'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Argument 0', +\n'Argument 1', +\n..." } - ] - }, - { - "opname" : "OpVariable", - "opcode" : 59, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "StorageClass" }, - { "kind" : "IdRef", "quantifier" : "?", "name" : "'Initializer'" } - ] - }, - { - "opname" : "OpImageTexelPointer", - "opcode" : 60, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Sample'" } - ] - }, - { - "opname" : "OpLoad", - "opcode" : 61, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpStore", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Object'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpCopyMemory", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpCopyMemorySized", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpAccessChain", - "opcode" : 65, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpInBoundsAccessChain", - "opcode" : 66, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpPtrAccessChain", - "opcode" : 67, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Element'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ], - "capabilities" : [ - "Addresses", - "VariablePointers", - "VariablePointersStorageBuffer" - ] - }, - { - "opname" : "OpArrayLength", - "opcode" : 68, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Structure'" }, - { "kind" : "LiteralInteger", "name" : "'Array member'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpGenericPtrMemSemantics", - "opcode" : 69, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpInBoundsPtrAccessChain", - "opcode" : 70, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Element'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpDecorate", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "Decoration" } - ] - }, - { - "opname" : "OpMemberDecorate", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'Structure Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "Decoration" } - ] - }, - { - "opname" : "OpDecorationGroup", - "opcode" : 73, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpGroupDecorate", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'Decoration Group'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Targets'" } - ] - }, - { - "opname" : "OpGroupMemberDecorate", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'Decoration Group'" }, - { "kind" : "PairIdRefLiteralInteger", "quantifier" : "*", "name" : "'Targets'" } - ] - }, - { - "opname" : "OpVectorExtractDynamic", - "opcode" : 77, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ] - }, - { - "opname" : "OpVectorInsertDynamic", - "opcode" : 78, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ] - }, - { - "opname" : "OpVectorShuffle", - "opcode" : 79, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Components'" } - ] - }, - { - "opname" : "OpCompositeConstruct", - "opcode" : 80, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpCompositeExtract", - "opcode" : 81, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Composite'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpCompositeInsert", - "opcode" : 82, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Object'" }, - { "kind" : "IdRef", "name" : "'Composite'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpCopyObject", - "opcode" : 83, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpTranspose", - "opcode" : 84, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpSampledImage", - "opcode" : 86, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Sampler'" } - ] - }, - { - "opname" : "OpImageSampleImplicitLod", - "opcode" : 87, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleExplicitLod", - "opcode" : 88, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ] - }, - { - "opname" : "OpImageSampleDrefImplicitLod", - "opcode" : 89, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleDrefExplicitLod", - "opcode" : 90, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjImplicitLod", - "opcode" : 91, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjExplicitLod", - "opcode" : 92, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjDrefImplicitLod", - "opcode" : 93, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjDrefExplicitLod", - "opcode" : 94, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageFetch", - "opcode" : 95, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImageGather", - "opcode" : 96, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageDrefGather", - "opcode" : 97, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageRead", - "opcode" : 98, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImageWrite", - "opcode" : 99, - "operands" : [ - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Texel'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImage", - "opcode" : 100, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" } - ] - }, - { - "opname" : "OpImageQueryFormat", - "opcode" : 101, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageQueryOrder", - "opcode" : 102, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageQuerySizeLod", - "opcode" : 103, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Level of Detail'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQuerySize", - "opcode" : 104, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQueryLod", - "opcode" : 105, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "ImageQuery" ] - }, - { - "opname" : "OpImageQueryLevels", - "opcode" : 106, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQuerySamples", - "opcode" : 107, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpConvertFToU", - "opcode" : 109, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpConvertFToS", - "opcode" : 110, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpConvertSToF", - "opcode" : 111, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ] - }, - { - "opname" : "OpConvertUToF", - "opcode" : 112, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ] - }, - { - "opname" : "OpUConvert", - "opcode" : 113, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ] - }, - { - "opname" : "OpSConvert", - "opcode" : 114, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ] - }, - { - "opname" : "OpFConvert", - "opcode" : 115, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpQuantizeToF16", - "opcode" : 116, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpConvertPtrToU", - "opcode" : 117, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpSatConvertSToU", - "opcode" : 118, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpSatConvertUToS", - "opcode" : 119, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpConvertUToPtr", - "opcode" : 120, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Integer Value'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpPtrCastToGeneric", - "opcode" : 121, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGenericCastToPtr", - "opcode" : 122, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGenericCastToPtrExplicit", - "opcode" : 123, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "StorageClass", "name" : "'Storage'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpBitcast", - "opcode" : 124, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpSNegate", - "opcode" : 126, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpFNegate", - "opcode" : 127, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpIAdd", - "opcode" : 128, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFAdd", - "opcode" : 129, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpISub", - "opcode" : 130, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFSub", - "opcode" : 131, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpIMul", - "opcode" : 132, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFMul", - "opcode" : 133, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUDiv", - "opcode" : 134, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSDiv", - "opcode" : 135, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFDiv", - "opcode" : 136, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUMod", - "opcode" : 137, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSRem", - "opcode" : 138, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSMod", - "opcode" : 139, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFRem", - "opcode" : 140, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFMod", - "opcode" : 141, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpVectorTimesScalar", - "opcode" : 142, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Scalar'" } - ] - }, - { - "opname" : "OpMatrixTimesScalar", - "opcode" : 143, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" }, - { "kind" : "IdRef", "name" : "'Scalar'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpVectorTimesMatrix", - "opcode" : 144, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Matrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpMatrixTimesVector", - "opcode" : 145, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpMatrixTimesMatrix", - "opcode" : 146, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'LeftMatrix'" }, - { "kind" : "IdRef", "name" : "'RightMatrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpOuterProduct", - "opcode" : 147, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpDot", - "opcode" : 148, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" } - ] - }, - { - "opname" : "OpIAddCarry", - "opcode" : 149, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpISubBorrow", - "opcode" : 150, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUMulExtended", - "opcode" : 151, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSMulExtended", - "opcode" : 152, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpAny", - "opcode" : 154, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ] - }, - { - "opname" : "OpAll", - "opcode" : 155, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ] - }, - { - "opname" : "OpIsNan", - "opcode" : 156, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "OpIsInf", - "opcode" : 157, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "OpIsFinite", - "opcode" : 158, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpIsNormal", - "opcode" : 159, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpSignBitSet", - "opcode" : 160, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLessOrGreater", - "opcode" : 161, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpOrdered", - "opcode" : 162, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpUnordered", - "opcode" : 163, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLogicalEqual", - "opcode" : 164, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalNotEqual", - "opcode" : 165, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalOr", - "opcode" : 166, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalAnd", - "opcode" : 167, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalNot", - "opcode" : 168, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpSelect", - "opcode" : 169, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Condition'" }, - { "kind" : "IdRef", "name" : "'Object 1'" }, - { "kind" : "IdRef", "name" : "'Object 2'" } - ] - }, - { - "opname" : "OpIEqual", - "opcode" : 170, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpINotEqual", - "opcode" : 171, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUGreaterThan", - "opcode" : 172, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSGreaterThan", - "opcode" : 173, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUGreaterThanEqual", - "opcode" : 174, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSGreaterThanEqual", - "opcode" : 175, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpULessThan", - "opcode" : 176, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSLessThan", - "opcode" : 177, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpULessThanEqual", - "opcode" : 178, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSLessThanEqual", - "opcode" : 179, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdEqual", - "opcode" : 180, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordEqual", - "opcode" : 181, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdNotEqual", - "opcode" : 182, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordNotEqual", - "opcode" : 183, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdLessThan", - "opcode" : 184, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordLessThan", - "opcode" : 185, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdGreaterThan", - "opcode" : 186, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordGreaterThan", - "opcode" : 187, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdLessThanEqual", - "opcode" : 188, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordLessThanEqual", - "opcode" : 189, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdGreaterThanEqual", - "opcode" : 190, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordGreaterThanEqual", - "opcode" : 191, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpShiftRightLogical", - "opcode" : 194, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpShiftRightArithmetic", - "opcode" : 195, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpShiftLeftLogical", - "opcode" : 196, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpBitwiseOr", - "opcode" : 197, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpBitwiseXor", - "opcode" : 198, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpBitwiseAnd", - "opcode" : 199, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpNot", - "opcode" : 200, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpBitFieldInsert", - "opcode" : 201, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Insert'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitFieldSExtract", - "opcode" : 202, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitFieldUExtract", - "opcode" : 203, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitReverse", - "opcode" : 204, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitCount", - "opcode" : 205, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" } - ] - }, - { - "opname" : "OpDPdx", - "opcode" : 207, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpDPdy", - "opcode" : 208, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpFwidth", - "opcode" : 209, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpDPdxFine", - "opcode" : 210, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdyFine", - "opcode" : 211, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpFwidthFine", - "opcode" : 212, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdxCoarse", - "opcode" : 213, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdyCoarse", - "opcode" : 214, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpFwidthCoarse", - "opcode" : 215, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpEmitVertex", - "opcode" : 218, - "capabilities" : [ "Geometry" ] - }, - { - "opname" : "OpEndPrimitive", - "opcode" : 219, - "capabilities" : [ "Geometry" ] - }, - { - "opname" : "OpEmitStreamVertex", - "opcode" : 220, - "operands" : [ - { "kind" : "IdRef", "name" : "'Stream'" } - ], - "capabilities" : [ "GeometryStreams" ] - }, - { - "opname" : "OpEndStreamPrimitive", - "opcode" : 221, - "operands" : [ - { "kind" : "IdRef", "name" : "'Stream'" } - ], - "capabilities" : [ "GeometryStreams" ] - }, - { - "opname" : "OpControlBarrier", - "opcode" : 224, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpMemoryBarrier", - "opcode" : 225, - "operands" : [ - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicLoad", - "opcode" : 227, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicStore", - "opcode" : 228, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicExchange", - "opcode" : 229, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicCompareExchange", - "opcode" : 230, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, - { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Comparator'" } - ] - }, - { - "opname" : "OpAtomicCompareExchangeWeak", - "opcode" : 231, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, - { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Comparator'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpAtomicIIncrement", - "opcode" : 232, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicIDecrement", - "opcode" : 233, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicIAdd", - "opcode" : 234, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicISub", - "opcode" : 235, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicSMin", - "opcode" : 236, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicUMin", - "opcode" : 237, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicSMax", - "opcode" : 238, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicUMax", - "opcode" : 239, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicAnd", - "opcode" : 240, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicOr", - "opcode" : 241, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicXor", - "opcode" : 242, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpPhi", - "opcode" : 245, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "PairIdRefIdRef", "quantifier" : "*", "name" : "'Variable, Parent, ...'" } - ] - }, - { - "opname" : "OpLoopMerge", - "opcode" : 246, - "operands" : [ - { "kind" : "IdRef", "name" : "'Merge Block'" }, - { "kind" : "IdRef", "name" : "'Continue Target'" }, - { "kind" : "LoopControl" } - ] - }, - { - "opname" : "OpSelectionMerge", - "opcode" : 247, - "operands" : [ - { "kind" : "IdRef", "name" : "'Merge Block'" }, - { "kind" : "SelectionControl" } - ] - }, - { - "opname" : "OpLabel", - "opcode" : 248, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpBranch", - "opcode" : 249, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target Label'" } - ] - }, - { - "opname" : "OpBranchConditional", - "opcode" : 250, - "operands" : [ - { "kind" : "IdRef", "name" : "'Condition'" }, - { "kind" : "IdRef", "name" : "'True Label'" }, - { "kind" : "IdRef", "name" : "'False Label'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Branch weights'" } - ] - }, - { - "opname" : "OpSwitch", - "opcode" : 251, - "operands" : [ - { "kind" : "IdRef", "name" : "'Selector'" }, - { "kind" : "IdRef", "name" : "'Default'" }, - { "kind" : "PairLiteralIntegerIdRef", "quantifier" : "*", "name" : "'Target'" } - ] - }, - { - "opname" : "OpKill", - "opcode" : 252, - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpReturn", - "opcode" : 253 - }, - { - "opname" : "OpReturnValue", - "opcode" : 254, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpUnreachable", - "opcode" : 255 - }, - { - "opname" : "OpLifetimeStart", - "opcode" : 256, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "LiteralInteger", "name" : "'Size'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLifetimeStop", - "opcode" : 257, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "LiteralInteger", "name" : "'Size'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupAsyncCopy", - "opcode" : 259, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Destination'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Num Elements'" }, - { "kind" : "IdRef", "name" : "'Stride'" }, - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupWaitEvents", - "opcode" : 260, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Events List'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupAll", - "opcode" : 261, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupAny", - "opcode" : 262, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupBroadcast", - "opcode" : 263, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'LocalId'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupIAdd", - "opcode" : 264, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFAdd", - "opcode" : 265, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMin", - "opcode" : 266, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMin", - "opcode" : 267, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMin", - "opcode" : 268, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMax", - "opcode" : 269, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMax", - "opcode" : 270, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMax", - "opcode" : 271, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpReadPipe", - "opcode" : 274, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpWritePipe", - "opcode" : 275, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReservedReadPipe", - "opcode" : 276, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Index'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReservedWritePipe", - "opcode" : 277, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Index'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReserveReadPipePackets", - "opcode" : 278, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReserveWritePipePackets", - "opcode" : 279, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpCommitReadPipe", - "opcode" : 280, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpCommitWritePipe", - "opcode" : 281, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpIsValidReserveId", - "opcode" : 282, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGetNumPipePackets", - "opcode" : 283, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGetMaxPipePackets", - "opcode" : 284, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupReserveReadPipePackets", - "opcode" : 285, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupReserveWritePipePackets", - "opcode" : 286, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupCommitReadPipe", - "opcode" : 287, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupCommitWritePipe", - "opcode" : 288, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpEnqueueMarker", - "opcode" : 291, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Queue'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Wait Events'" }, - { "kind" : "IdRef", "name" : "'Ret Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpEnqueueKernel", - "opcode" : 292, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Queue'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Wait Events'" }, - { "kind" : "IdRef", "name" : "'Ret Event'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Local Size'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelNDrangeSubGroupCount", - "opcode" : 293, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelNDrangeMaxSubGroupSize", - "opcode" : 294, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelWorkGroupSize", - "opcode" : 295, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelPreferredWorkGroupSizeMultiple", - "opcode" : 296, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpRetainEvent", - "opcode" : 297, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpReleaseEvent", - "opcode" : 298, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpCreateUserEvent", - "opcode" : 299, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpIsValidEvent", - "opcode" : 300, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpSetUserEventStatus", - "opcode" : 301, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" }, - { "kind" : "IdRef", "name" : "'Status'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpCaptureEventProfilingInfo", - "opcode" : 302, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" }, - { "kind" : "IdRef", "name" : "'Profiling Info'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetDefaultQueue", - "opcode" : 303, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpBuildNDRange", - "opcode" : 304, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'GlobalWorkSize'" }, - { "kind" : "IdRef", "name" : "'LocalWorkSize'" }, - { "kind" : "IdRef", "name" : "'GlobalWorkOffset'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpImageSparseSampleImplicitLod", - "opcode" : 305, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleExplicitLod", - "opcode" : 306, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleDrefImplicitLod", - "opcode" : 307, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleDrefExplicitLod", - "opcode" : 308, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjImplicitLod", - "opcode" : 309, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjExplicitLod", - "opcode" : 310, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjDrefImplicitLod", - "opcode" : 311, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjDrefExplicitLod", - "opcode" : 312, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseFetch", - "opcode" : 313, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseGather", - "opcode" : 314, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseDrefGather", - "opcode" : 315, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseTexelsResident", - "opcode" : 316, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Resident Code'" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpNoLine", - "opcode" : 317 - }, - { - "opname" : "OpAtomicFlagTestAndSet", - "opcode" : 318, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpAtomicFlagClear", - "opcode" : 319, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageSparseRead", - "opcode" : 320, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpSubgroupBallotKHR", - "opcode" : 4421, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "opname" : "OpSubgroupFirstInvocationKHR", - "opcode" : 4422, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "opname" : "OpSubgroupAllKHR", - "opcode" : 4428, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupVoteKHR" ] - }, - { - "opname" : "OpSubgroupAnyKHR", - "opcode" : 4429, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupVoteKHR" ] - }, - { - "opname" : "OpSubgroupAllEqualKHR", - "opcode" : 4430, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupVoteKHR" ] - }, - { - "opname" : "OpSubgroupReadInvocationKHR", - "opcode" : 4432, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "opname" : "OpGroupIAddNonUniformAMD", - "opcode" : 5000, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFAddNonUniformAMD", - "opcode" : 5001, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMinNonUniformAMD", - "opcode" : 5002, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMinNonUniformAMD", - "opcode" : 5003, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMinNonUniformAMD", - "opcode" : 5004, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMaxNonUniformAMD", - "opcode" : 5005, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMaxNonUniformAMD", - "opcode" : 5006, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMaxNonUniformAMD", - "opcode" : 5007, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpFragmentMaskFetchAMD", - "opcode" : 5011, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "FragmentMaskAMD" ] - }, - { - "opname" : "OpFragmentFetchAMD", - "opcode" : 5012, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Fragment Index'" } - ], - "capabilities" : [ "FragmentMaskAMD" ] - }, - { - "opname" : "OpSubgroupShuffleINTEL", - "opcode" : 5571, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Data'" }, - { "kind" : "IdRef", "name" : "'InvocationId'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupShuffleDownINTEL", - "opcode" : 5572, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Current'" }, - { "kind" : "IdRef", "name" : "'Next'" }, - { "kind" : "IdRef", "name" : "'Delta'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupShuffleUpINTEL", - "opcode" : 5573, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Previous'" }, - { "kind" : "IdRef", "name" : "'Current'" }, - { "kind" : "IdRef", "name" : "'Delta'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupShuffleXorINTEL", - "opcode" : 5574, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Data'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupBlockReadINTEL", - "opcode" : 5575, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Ptr'" } - ], - "capabilities" : [ "SubgroupBufferBlockIOINTEL" ] - }, - { - "opname" : "OpSubgroupBlockWriteINTEL", - "opcode" : 5576, - "operands" : [ - { "kind" : "IdRef", "name" : "'Ptr'" }, - { "kind" : "IdRef", "name" : "'Data'" } - ], - "capabilities" : [ "SubgroupBufferBlockIOINTEL" ] - }, - { - "opname" : "OpSubgroupImageBlockReadINTEL", - "opcode" : 5577, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "SubgroupImageBlockIOINTEL" ] - }, - { - "opname" : "OpSubgroupImageBlockWriteINTEL", - "opcode" : 5578, - "operands" : [ - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Data'" } - ], - "capabilities" : [ "SubgroupImageBlockIOINTEL" ] - } - ], - "operand_kinds" : [ - { - "category" : "BitEnum", - "kind" : "ImageOperands", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Bias", - "value" : "0x0001", - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Lod", - "value" : "0x0002", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Grad", - "value" : "0x0004", - "parameters" : [ - { "kind" : "IdRef" }, - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "ConstOffset", - "value" : "0x0008", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Offset", - "value" : "0x0010", - "capabilities" : [ "ImageGatherExtended" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "ConstOffsets", - "value" : "0x0020", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Sample", - "value" : "0x0040", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "MinLod", - "value" : "0x0080", - "capabilities" : [ "MinLod" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - } - ] - }, - { - "category" : "BitEnum", - "kind" : "FPFastMathMode", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "NotNaN", - "value" : "0x0001", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NotInf", - "value" : "0x0002", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NSZ", - "value" : "0x0004", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "AllowRecip", - "value" : "0x0008", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Fast", - "value" : "0x0010", - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "BitEnum", - "kind" : "SelectionControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Flatten", - "value" : "0x0001" - }, - { - "enumerant" : "DontFlatten", - "value" : "0x0002" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "LoopControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Unroll", - "value" : "0x0001" - }, - { - "enumerant" : "DontUnroll", - "value" : "0x0002" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "FunctionControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Inline", - "value" : "0x0001" - }, - { - "enumerant" : "DontInline", - "value" : "0x0002" - }, - { - "enumerant" : "Pure", - "value" : "0x0004" - }, - { - "enumerant" : "Const", - "value" : "0x0008" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "MemorySemantics", - "enumerants" : [ - { - "enumerant" : "Relaxed", - "value" : "0x0000" - }, - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Acquire", - "value" : "0x0002" - }, - { - "enumerant" : "Release", - "value" : "0x0004" - }, - { - "enumerant" : "AcquireRelease", - "value" : "0x0008" - }, - { - "enumerant" : "SequentiallyConsistent", - "value" : "0x0010" - }, - { - "enumerant" : "UniformMemory", - "value" : "0x0040", - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SubgroupMemory", - "value" : "0x0080" - }, - { - "enumerant" : "WorkgroupMemory", - "value" : "0x0100" - }, - { - "enumerant" : "CrossWorkgroupMemory", - "value" : "0x0200" - }, - { - "enumerant" : "AtomicCounterMemory", - "value" : "0x0400", - "capabilities" : [ "AtomicStorage" ] - }, - { - "enumerant" : "ImageMemory", - "value" : "0x0800" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "MemoryAccess", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Volatile", - "value" : "0x0001" - }, - { - "enumerant" : "Aligned", - "value" : "0x0002", - "parameters" : [ - { "kind" : "LiteralInteger" } - ] - }, - { - "enumerant" : "Nontemporal", - "value" : "0x0004" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "KernelProfilingInfo", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "CmdExecTime", - "value" : "0x0001", - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SourceLanguage", - "enumerants" : [ - { - "enumerant" : "Unknown", - "value" : 0 - }, - { - "enumerant" : "ESSL", - "value" : 1 - }, - { - "enumerant" : "GLSL", - "value" : 2 - }, - { - "enumerant" : "OpenCL_C", - "value" : 3 - }, - { - "enumerant" : "OpenCL_CPP", - "value" : 4 - }, - { - "enumerant" : "HLSL", - "value" : 5 - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ExecutionModel", - "enumerants" : [ - { - "enumerant" : "Vertex", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "TessellationControl", - "value" : 1, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessellationEvaluation", - "value" : 2, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Geometry", - "value" : 3, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Fragment", - "value" : 4, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLCompute", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Kernel", - "value" : 6, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "AddressingModel", - "enumerants" : [ - { - "enumerant" : "Logical", - "value" : 0 - }, - { - "enumerant" : "Physical32", - "value" : 1, - "capabilities" : [ "Addresses" ] - }, - { - "enumerant" : "Physical64", - "value" : 2, - "capabilities" : [ "Addresses" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "MemoryModel", - "enumerants" : [ - { - "enumerant" : "Simple", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLSL450", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OpenCL", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ExecutionMode", - "enumerants" : [ - { - "enumerant" : "Invocations", - "value" : 0, - "capabilities" : [ "Geometry" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Number of <>'" } - ] - }, - { - "enumerant" : "SpacingEqual", - "value" : 1, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "SpacingFractionalEven", - "value" : 2, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "SpacingFractionalOdd", - "value" : 3, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "VertexOrderCw", - "value" : 4, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "VertexOrderCcw", - "value" : 5, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "PixelCenterInteger", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OriginUpperLeft", - "value" : 7, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OriginLowerLeft", - "value" : 8, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "EarlyFragmentTests", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointMode", - "value" : 10, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Xfb", - "value" : 11, - "capabilities" : [ "TransformFeedback" ] - }, - { - "enumerant" : "DepthReplacing", - "value" : 12, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthGreater", - "value" : 14, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthLess", - "value" : 15, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthUnchanged", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "LocalSize", - "value" : 17, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'x size'" }, - { "kind" : "LiteralInteger", "name" : "'y size'" }, - { "kind" : "LiteralInteger", "name" : "'z size'" } - ] - }, - { - "enumerant" : "LocalSizeHint", - "value" : 18, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'x size'" }, - { "kind" : "LiteralInteger", "name" : "'y size'" }, - { "kind" : "LiteralInteger", "name" : "'z size'" } - ] - }, - { - "enumerant" : "InputPoints", - "value" : 19, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "InputLines", - "value" : 20, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "InputLinesAdjacency", - "value" : 21, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Triangles", - "value" : 22, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "InputTrianglesAdjacency", - "value" : 23, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Quads", - "value" : 24, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Isolines", - "value" : 25, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "OutputVertices", - "value" : 26, - "capabilities" : [ "Geometry", "Tessellation" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Vertex count'" } - ] - }, - { - "enumerant" : "OutputPoints", - "value" : 27, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "OutputLineStrip", - "value" : 28, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "OutputTriangleStrip", - "value" : 29, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "VecTypeHint", - "value" : 30, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Vector type'" } - ] - }, - { - "enumerant" : "ContractionOff", - "value" : 31, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "PostDepthCoverage", - "value" : 4446, - "capabilities" : [ "SampleMaskPostDepthCoverage" ] - }, - { - "enumerant" : "StencilRefReplacingEXT", - "value" : 5027, - "capabilities" : [ "StencilExportEXT" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "StorageClass", - "enumerants" : [ - { - "enumerant" : "UniformConstant", - "value" : 0 - }, - { - "enumerant" : "Input", - "value" : 1 - }, - { - "enumerant" : "Uniform", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Output", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Workgroup", - "value" : 4 - }, - { - "enumerant" : "CrossWorkgroup", - "value" : 5 - }, - { - "enumerant" : "Private", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Function", - "value" : 7 - }, - { - "enumerant" : "Generic", - "value" : 8, - "capabilities" : [ "GenericPointer" ] - }, - { - "enumerant" : "PushConstant", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "AtomicCounter", - "value" : 10, - "capabilities" : [ "AtomicStorage" ] - }, - { - "enumerant" : "Image", - "value" : 11 - }, - { - "enumerant" : "StorageBuffer", - "value" : 12, - "extensions" : [ - "SPV_KHR_storage_buffer_storage_class", - "SPV_KHR_variable_pointers" - ], - "capabilities" : [ "Shader" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Dim", - "enumerants" : [ - { - "enumerant" : "1D", - "value" : 0, - "capabilities" : [ "Sampled1D" ] - }, - { - "enumerant" : "2D", - "value" : 1 - }, - { - "enumerant" : "3D", - "value" : 2 - }, - { - "enumerant" : "Cube", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rect", - "value" : 4, - "capabilities" : [ "SampledRect" ] - }, - { - "enumerant" : "Buffer", - "value" : 5, - "capabilities" : [ "SampledBuffer" ] - }, - { - "enumerant" : "SubpassData", - "value" : 6, - "capabilities" : [ "InputAttachment" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SamplerAddressingMode", - "enumerants" : [ - { - "enumerant" : "None", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ClampToEdge", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Clamp", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Repeat", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RepeatMirrored", - "value" : 4, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SamplerFilterMode", - "enumerants" : [ - { - "enumerant" : "Nearest", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Linear", - "value" : 1, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageFormat", - "enumerants" : [ - { - "enumerant" : "Unknown", - "value" : 0 - }, - { - "enumerant" : "Rgba32f", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16f", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32f", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8", - "value" : 4, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8Snorm", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rg32f", - "value" : 6, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16f", - "value" : 7, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R11fG11fB10f", - "value" : 8, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16f", - "value" : 9, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba16", - "value" : 10, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgb10A2", - "value" : 11, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16", - "value" : 12, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8", - "value" : 13, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16", - "value" : 14, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8", - "value" : 15, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba16Snorm", - "value" : 16, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16Snorm", - "value" : 17, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8Snorm", - "value" : 18, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16Snorm", - "value" : 19, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8Snorm", - "value" : 20, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba32i", - "value" : 21, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16i", - "value" : 22, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8i", - "value" : 23, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32i", - "value" : 24, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rg32i", - "value" : 25, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16i", - "value" : 26, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8i", - "value" : 27, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16i", - "value" : 28, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8i", - "value" : 29, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba32ui", - "value" : 30, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16ui", - "value" : 31, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8ui", - "value" : 32, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32ui", - "value" : 33, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgb10a2ui", - "value" : 34, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg32ui", - "value" : 35, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16ui", - "value" : 36, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8ui", - "value" : 37, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16ui", - "value" : 38, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8ui", - "value" : 39, - "capabilities" : [ "StorageImageExtendedFormats" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageChannelOrder", - "enumerants" : [ - { - "enumerant" : "R", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "A", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RG", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RA", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGB", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGBA", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "BGRA", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ARGB", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Intensity", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Luminance", - "value" : 9, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Rx", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGx", - "value" : 11, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGBx", - "value" : 12, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Depth", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "DepthStencil", - "value" : 14, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGB", - "value" : 15, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGBx", - "value" : 16, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGBA", - "value" : 17, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sBGRA", - "value" : 18, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ABGR", - "value" : 19, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageChannelDataType", - "enumerants" : [ - { - "enumerant" : "SnormInt8", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SnormInt16", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt8", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt16", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormShort565", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormShort555", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt101010", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt8", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt16", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt32", - "value" : 9, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt8", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt16", - "value" : 11, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt32", - "value" : 12, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "HalfFloat", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float", - "value" : 14, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt24", - "value" : 15, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt101010_2", - "value" : 16, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "FPRoundingMode", - "enumerants" : [ - { - "enumerant" : "RTE", - "value" : 0, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - }, - { - "enumerant" : "RTZ", - "value" : 1, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - }, - { - "enumerant" : "RTP", - "value" : 2, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - }, - { - "enumerant" : "RTN", - "value" : 3, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "LinkageType", - "enumerants" : [ - { - "enumerant" : "Export", - "value" : 0, - "capabilities" : [ "Linkage" ] - }, - { - "enumerant" : "Import", - "value" : 1, - "capabilities" : [ "Linkage" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "AccessQualifier", - "enumerants" : [ - { - "enumerant" : "ReadOnly", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WriteOnly", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ReadWrite", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "FunctionParameterAttribute", - "enumerants" : [ - { - "enumerant" : "Zext", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Sext", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ByVal", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Sret", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoAlias", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoCapture", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoWrite", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoReadWrite", - "value" : 7, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Decoration", - "enumerants" : [ - { - "enumerant" : "RelaxedPrecision", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SpecId", - "value" : 1, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Specialization Constant ID'" } - ] - }, - { - "enumerant" : "Block", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "BufferBlock", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "RowMajor", - "value" : 4, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "ColMajor", - "value" : 5, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "ArrayStride", - "value" : 6, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Array Stride'" } - ] - }, - { - "enumerant" : "MatrixStride", - "value" : 7, - "capabilities" : [ "Matrix" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Matrix Stride'" } - ] - }, - { - "enumerant" : "GLSLShared", - "value" : 8, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLSLPacked", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "CPacked", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "BuiltIn", - "value" : 11, - "parameters" : [ - { "kind" : "BuiltIn" } - ] - }, - { - "enumerant" : "NoPerspective", - "value" : 13, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Flat", - "value" : 14, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Patch", - "value" : 15, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Centroid", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Sample", - "value" : 17, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "Invariant", - "value" : 18, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Restrict", - "value" : 19 - }, - { - "enumerant" : "Aliased", - "value" : 20 - }, - { - "enumerant" : "Volatile", - "value" : 21 - }, - { - "enumerant" : "Constant", - "value" : 22, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Coherent", - "value" : 23 - }, - { - "enumerant" : "NonWritable", - "value" : 24 - }, - { - "enumerant" : "NonReadable", - "value" : 25 - }, - { - "enumerant" : "Uniform", - "value" : 26, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SaturatedConversion", - "value" : 28, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Stream", - "value" : 29, - "capabilities" : [ "GeometryStreams" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Stream Number'" } - ] - }, - { - "enumerant" : "Location", - "value" : 30, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Location'" } - ] - }, - { - "enumerant" : "Component", - "value" : 31, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Component'" } - ] - }, - { - "enumerant" : "Index", - "value" : 32, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Index'" } - ] - }, - { - "enumerant" : "Binding", - "value" : 33, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Binding Point'" } - ] - }, - { - "enumerant" : "DescriptorSet", - "value" : 34, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Descriptor Set'" } - ] - }, - { - "enumerant" : "Offset", - "value" : 35, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Byte Offset'" } - ] - }, - { - "enumerant" : "XfbBuffer", - "value" : 36, - "capabilities" : [ "TransformFeedback" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'XFB Buffer Number'" } - ] - }, - { - "enumerant" : "XfbStride", - "value" : 37, - "capabilities" : [ "TransformFeedback" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'XFB Stride'" } - ] - }, - { - "enumerant" : "FuncParamAttr", - "value" : 38, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "FunctionParameterAttribute", "name" : "'Function Parameter Attribute'" } - ] - }, - { - "enumerant" : "FPRoundingMode", - "value" : 39, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ], - "parameters" : [ - { "kind" : "FPRoundingMode", "name" : "'Floating-Point Rounding Mode'" } - ] - }, - { - "enumerant" : "FPFastMathMode", - "value" : 40, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "FPFastMathMode", "name" : "'Fast-Math Mode'" } - ] - }, - { - "enumerant" : "LinkageAttributes", - "value" : 41, - "capabilities" : [ "Linkage" ], - "parameters" : [ - { "kind" : "LiteralString", "name" : "'Name'" }, - { "kind" : "LinkageType", "name" : "'Linkage Type'" } - ] - }, - { - "enumerant" : "NoContraction", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InputAttachmentIndex", - "value" : 43, - "capabilities" : [ "InputAttachment" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Attachment Index'" } - ] - }, - { - "enumerant" : "Alignment", - "value" : 44, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Alignment'" } - ] - }, - { - "enumerant" : "ExplicitInterpAMD", - "value" : 4999 - }, - { - "enumerant" : "OverrideCoverageNV", - "value" : 5248, - "capabilities" : [ "SampleMaskOverrideCoverageNV" ] - }, - { - "enumerant" : "PassthroughNV", - "value" : 5250, - "capabilities" : [ "GeometryShaderPassthroughNV" ] - }, - { - "enumerant" : "ViewportRelativeNV", - "value" : 5252, - "capabilities" : [ "ShaderViewportMaskNV" ] - }, - { - "enumerant" : "SecondaryViewportRelativeNV", - "value" : 5256, - "capabilities" : [ "ShaderStereoViewNV" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Offset'" } - ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "BuiltIn", - "enumerants" : [ - { - "enumerant" : "Position", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointSize", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ClipDistance", - "value" : 3, - "capabilities" : [ "ClipDistance" ] - }, - { - "enumerant" : "CullDistance", - "value" : 4, - "capabilities" : [ "CullDistance" ] - }, - { - "enumerant" : "VertexId", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InstanceId", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PrimitiveId", - "value" : 7, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "InvocationId", - "value" : 8, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "Layer", - "value" : 9, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "ViewportIndex", - "value" : 10, - "capabilities" : [ "MultiViewport" ] - }, - { - "enumerant" : "TessLevelOuter", - "value" : 11, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessLevelInner", - "value" : 12, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessCoord", - "value" : 13, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "PatchVertices", - "value" : 14, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "FragCoord", - "value" : 15, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointCoord", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "FrontFacing", - "value" : 17, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampleId", - "value" : 18, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "SamplePosition", - "value" : 19, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "SampleMask", - "value" : 20, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "FragDepth", - "value" : 22, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "HelperInvocation", - "value" : 23, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "NumWorkgroups", - "value" : 24 - }, - { - "enumerant" : "WorkgroupSize", - "value" : 25 - }, - { - "enumerant" : "WorkgroupId", - "value" : 26 - }, - { - "enumerant" : "LocalInvocationId", - "value" : 27 - }, - { - "enumerant" : "GlobalInvocationId", - "value" : 28 - }, - { - "enumerant" : "LocalInvocationIndex", - "value" : 29 - }, - { - "enumerant" : "WorkDim", - "value" : 30, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalSize", - "value" : 31, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "EnqueuedWorkgroupSize", - "value" : 32, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalOffset", - "value" : 33, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalLinearId", - "value" : 34, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupSize", - "value" : 36, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupMaxSize", - "value" : 37, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NumSubgroups", - "value" : 38, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NumEnqueuedSubgroups", - "value" : 39, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupId", - "value" : 40, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupLocalInvocationId", - "value" : 41, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "VertexIndex", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InstanceIndex", - "value" : 43, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SubgroupEqMaskKHR", - "value" : 4416, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupGeMaskKHR", - "value" : 4417, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupGtMaskKHR", - "value" : 4418, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupLeMaskKHR", - "value" : 4419, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupLtMaskKHR", - "value" : 4420, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "BaseVertex", - "value" : 4424, - "capabilities" : [ "DrawParameters" ] - }, - { - "enumerant" : "BaseInstance", - "value" : 4425, - "capabilities" : [ "DrawParameters" ] - }, - { - "enumerant" : "DrawIndex", - "value" : 4426, - "capabilities" : [ "DrawParameters" ] - }, - { - "enumerant" : "DeviceIndex", - "value" : 4438, - "capabilities" : [ "DeviceGroup" ] - }, - { - "enumerant" : "ViewIndex", - "value" : 4440, - "capabilities" : [ "MultiView" ] - }, - { - "enumerant" : "BaryCoordNoPerspAMD", - "value" : 4992 - }, - { - "enumerant" : "BaryCoordNoPerspCentroidAMD", - "value" : 4993 - }, - { - "enumerant" : "BaryCoordNoPerspSampleAMD", - "value" : 4994 - }, - { - "enumerant" : "BaryCoordSmoothAMD", - "value" : 4995 - }, - { - "enumerant" : "BaryCoordSmoothCentroidAMD", - "value" : 4996 - }, - { - "enumerant" : "BaryCoordSmoothSampleAMD", - "value" : 4997 - }, - { - "enumerant" : "BaryCoordPullModelAMD", - "value" : 4998 - }, - { - "enumerant" : "FragStencilRefEXT", - "value" : 5014, - "capabilities" : [ "StencilExportEXT" ] - }, - { - "enumerant" : "ViewportMaskNV", - "value" : 5253, - "capabilities" : [ "ShaderViewportMaskNV" ] - }, - { - "enumerant" : "SecondaryPositionNV", - "value" : 5257, - "capabilities" : [ "ShaderStereoViewNV" ] - }, - { - "enumerant" : "SecondaryViewportMaskNV", - "value" : 5258, - "capabilities" : [ "ShaderStereoViewNV" ] - }, - { - "enumerant" : "PositionPerViewNV", - "value" : 5261, - "capabilities" : [ "PerViewAttributesNV" ] - }, - { - "enumerant" : "ViewportMaskPerViewNV", - "value" : 5262, - "capabilities" : [ "PerViewAttributesNV" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Scope", - "enumerants" : [ - { - "enumerant" : "CrossDevice", - "value" : 0 - }, - { - "enumerant" : "Device", - "value" : 1 - }, - { - "enumerant" : "Workgroup", - "value" : 2 - }, - { - "enumerant" : "Subgroup", - "value" : 3 - }, - { - "enumerant" : "Invocation", - "value" : 4 - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "GroupOperation", - "enumerants" : [ - { - "enumerant" : "Reduce", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "InclusiveScan", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ExclusiveScan", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "KernelEnqueueFlags", - "enumerants" : [ - { - "enumerant" : "NoWait", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WaitKernel", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WaitWorkGroup", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Capability", - "enumerants" : [ - { - "enumerant" : "Matrix", - "value" : 0 - }, - { - "enumerant" : "Shader", - "value" : 1, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "Geometry", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Tessellation", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Addresses", - "value" : 4 - }, - { - "enumerant" : "Linkage", - "value" : 5 - }, - { - "enumerant" : "Kernel", - "value" : 6 - }, - { - "enumerant" : "Vector16", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float16Buffer", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float16", - "value" : 9 - }, - { - "enumerant" : "Float64", - "value" : 10 - }, - { - "enumerant" : "Int64", - "value" : 11 - }, - { - "enumerant" : "Int64Atomics", - "value" : 12, - "capabilities" : [ "Int64" ] - }, - { - "enumerant" : "ImageBasic", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ImageReadWrite", - "value" : 14, - "capabilities" : [ "ImageBasic" ] - }, - { - "enumerant" : "ImageMipmap", - "value" : 15, - "capabilities" : [ "ImageBasic" ] - }, - { - "enumerant" : "Pipes", - "value" : 17, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Groups", - "value" : 18 - }, - { - "enumerant" : "DeviceEnqueue", - "value" : 19, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "LiteralSampler", - "value" : 20, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "AtomicStorage", - "value" : 21, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Int16", - "value" : 22 - }, - { - "enumerant" : "TessellationPointSize", - "value" : 23, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "GeometryPointSize", - "value" : 24, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "ImageGatherExtended", - "value" : 25, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageMultisample", - "value" : 27, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "UniformBufferArrayDynamicIndexing", - "value" : 28, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampledImageArrayDynamicIndexing", - "value" : 29, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageBufferArrayDynamicIndexing", - "value" : 30, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageArrayDynamicIndexing", - "value" : 31, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ClipDistance", - "value" : 32, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "CullDistance", - "value" : 33, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageCubeArray", - "value" : 34, - "capabilities" : [ "SampledCubeArray" ] - }, - { - "enumerant" : "SampleRateShading", - "value" : 35, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageRect", - "value" : 36, - "capabilities" : [ "SampledRect" ] - }, - { - "enumerant" : "SampledRect", - "value" : 37, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GenericPointer", - "value" : 38, - "capabilities" : [ "Addresses" ] - }, - { - "enumerant" : "Int8", - "value" : 39, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "InputAttachment", - "value" : 40, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SparseResidency", - "value" : 41, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "MinLod", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Sampled1D", - "value" : 43 - }, - { - "enumerant" : "Image1D", - "value" : 44, - "capabilities" : [ "Sampled1D" ] - }, - { - "enumerant" : "SampledCubeArray", - "value" : 45, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampledBuffer", - "value" : 46 - }, - { - "enumerant" : "ImageBuffer", - "value" : 47, - "capabilities" : [ "SampledBuffer" ] - }, - { - "enumerant" : "ImageMSArray", - "value" : 48, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageExtendedFormats", - "value" : 49, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageQuery", - "value" : 50, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DerivativeControl", - "value" : 51, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InterpolationFunction", - "value" : 52, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "TransformFeedback", - "value" : 53, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GeometryStreams", - "value" : 54, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "StorageImageReadWithoutFormat", - "value" : 55, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageWriteWithoutFormat", - "value" : 56, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "MultiViewport", - "value" : 57, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "SubgroupBallotKHR", - "value" : 4423, - "extensions" : [ "SPV_KHR_shader_ballot" ] - }, - { - "enumerant" : "DrawParameters", - "value" : 4427, - "extensions" : [ "SPV_KHR_shader_draw_parameters" ] - }, - { - "enumerant" : "SubgroupVoteKHR", - "value" : 4431, - "extensions" : [ "SPV_KHR_subgroup_vote" ] - }, - { - "enumerant" : "StorageBuffer16BitAccess", - "value" : 4433, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StorageUniformBufferBlock16", - "value" : 4433, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "UniformAndStorageBuffer16BitAccess", - "value" : 4434, - "capabilities" : [ - "StorageBuffer16BitAccess", - "StorageUniformBufferBlock16" - ], - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StorageUniform16", - "value" : 4434, - "capabilities" : [ - "StorageBuffer16BitAccess", - "StorageUniformBufferBlock16" - ], - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StoragePushConstant16", - "value" : 4435, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StorageInputOutput16", - "value" : 4436, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "DeviceGroup", - "value" : 4437, - "extensions" : [ "SPV_KHR_device_group" ] - }, - { - "enumerant" : "MultiView", - "value" : 4439, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_multiview" ] - }, - { - "enumerant" : "VariablePointersStorageBuffer", - "value" : 4441, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_variable_pointers" ] - }, - { - "enumerant" : "VariablePointers", - "value" : 4442, - "capabilities" : [ "VariablePointersStorageBuffer" ], - "extensions" : [ "SPV_KHR_variable_pointers" ] - }, - { - "enumerant": "AtomicStorageOps", - "value": 4445, - "extensions": [ "SPV_KHR_shader_atomic_counter_ops" ] - }, - { - "enumerant" : "SampleMaskPostDepthCoverage", - "value" : 4447, - "extensions" : [ "SPV_KHR_post_depth_coverage" ] - }, - { - "enumerant" : "ImageGatherBiasLodAMD", - "value" : 5009, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_texture_gather_bias_lod" ] - }, - { - "enumerant" : "FragmentMaskAMD", - "value" : 5010, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_shader_fragment_mask" ] - }, - { - "enumerant" : "StencilExportEXT", - "value" : 5013, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_shader_stencil_export" ] - }, - { - "enumerant" : "ImageReadWriteLodAMD", - "value" : 5015, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_shader_image_load_store_lod" ] - }, - { - "enumerant" : "SampleMaskOverrideCoverageNV", - "value" : 5249, - "capabilities" : [ "SampleRateShading" ], - "extensions" : [ "SPV_NV_sample_mask_override_coverage" ] - }, - { - "enumerant" : "GeometryShaderPassthroughNV", - "value" : 5251, - "capabilities" : [ "Geometry" ], - "extensions" : [ "SPV_NV_geometry_shader_passthrough" ] - }, - { - "enumerant" : "ShaderViewportIndexLayerEXT", - "value" : 5254, - "capabilities" : [ "MultiViewport" ], - "extensions" : [ "SPV_EXT_shader_viewport_index_layer" ] - }, - { - "enumerant" : "ShaderViewportIndexLayerNV", - "value" : 5254, - "capabilities" : [ "MultiViewport" ], - "extensions" : [ "SPV_NV_viewport_array2" ] - }, - { - "enumerant" : "ShaderViewportMaskNV", - "value" : 5255, - "capabilities" : [ "ShaderViewportIndexLayerNV" ], - "extensions" : [ "SPV_NV_viewport_array2" ] - }, - { - "enumerant" : "ShaderStereoViewNV", - "value" : 5259, - "capabilities" : [ "ShaderViewportMaskNV" ], - "extensions" : [ "SPV_NV_stereo_view_rendering" ] - }, - { - "enumerant" : "PerViewAttributesNV", - "value" : 5260, - "capabilities" : [ "MultiView" ], - "extensions" : [ "SPV_NVX_multiview_per_view_attributes" ] - }, - { - "enumerant" : "SubgroupShuffleINTEL", - "value" : 5568, - "extensions" : [ "SPV_INTEL_subgroups" ] - }, - { - "enumerant" : "SubgroupBufferBlockIOINTEL", - "value" : 5569, - "extensions" : [ "SPV_INTEL_subgroups" ] - }, - { - "enumerant" : "SubgroupImageBlockIOINTEL", - "value" : 5570, - "extensions" : [ "SPV_INTEL_subgroups" ] - } - ] - }, - { - "category" : "Id", - "kind" : "IdResultType", - "doc" : "Reference to an representing the result's type of the enclosing instruction" - }, - { - "category" : "Id", - "kind" : "IdResult", - "doc" : "Definition of an representing the result of the enclosing instruction" - }, - { - "category" : "Id", - "kind" : "IdMemorySemantics", - "doc" : "Reference to an representing a 32-bit integer that is a mask from the MemorySemantics operand kind" - }, - { - "category" : "Id", - "kind" : "IdScope", - "doc" : "Reference to an representing a 32-bit integer that is a mask from the Scope operand kind" - }, - { - "category" : "Id", - "kind" : "IdRef", - "doc" : "Reference to an " - }, - { - "category" : "Literal", - "kind" : "LiteralInteger", - "doc" : "An integer consuming one or more words" - }, - { - "category" : "Literal", - "kind" : "LiteralString", - "doc" : "A null-terminated stream of characters consuming an integral number of words" - }, - { - "category" : "Literal", - "kind" : "LiteralContextDependentNumber", - "doc" : "A literal number whose size and format are determined by a previous operand in the enclosing instruction" - }, - { - "category" : "Literal", - "kind" : "LiteralExtInstInteger", - "doc" : "A 32-bit unsigned integer indicating which instruction to use and determining the layout of following operands (for OpExtInst)" - }, - { - "category" : "Literal", - "kind" : "LiteralSpecConstantOpInteger", - "doc" : "An opcode indicating the operation to be performed and determining the layout of following operands (for OpSpecConstantOp)" - }, - { - "category" : "Composite", - "kind" : "PairLiteralIntegerIdRef", - "bases" : [ "LiteralInteger", "IdRef" ] - }, - { - "category" : "Composite", - "kind" : "PairIdRefLiteralInteger", - "bases" : [ "IdRef", "LiteralInteger" ] - }, - { - "category" : "Composite", - "kind" : "PairIdRefIdRef", - "bases" : [ "IdRef", "IdRef" ] - } - ] -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.h vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,988 +0,0 @@ -/* -** Copyright (c) 2014-2017 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and/or associated documentation files (the "Materials"), -** to deal in the Materials without restriction, including without limitation -** the rights to use, copy, modify, merge, publish, distribute, sublicense, -** and/or sell copies of the Materials, and to permit persons to whom the -** Materials are furnished to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in -** all copies or substantial portions of the Materials. -** -** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -** IN THE MATERIALS. -*/ - -/* -** This header is automatically generated by the same tool that creates -** the Binary Section of the SPIR-V specification. -*/ - -/* -** Enumeration tokens for SPIR-V, in various styles: -** C, C++, C++11, JSON, Lua, Python -** -** - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -** - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -** - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -** - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -** - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -** -** Some tokens act like mask values, which can be OR'd together, -** while others are mutually exclusive. The mask-like ones have -** "Mask" in their name, and a parallel enum that has the shift -** amount (1 << x) for each corresponding enumerant. -*/ - -#ifndef spirv_H -#define spirv_H - -typedef unsigned int SpvId; - -#define SPV_VERSION 0x10000 -#define SPV_REVISION 12 - -static const unsigned int SpvMagicNumber = 0x07230203; -static const unsigned int SpvVersion = 0x00010000; -static const unsigned int SpvRevision = 12; -static const unsigned int SpvOpCodeMask = 0xffff; -static const unsigned int SpvWordCountShift = 16; - -typedef enum SpvSourceLanguage_ { - SpvSourceLanguageUnknown = 0, - SpvSourceLanguageESSL = 1, - SpvSourceLanguageGLSL = 2, - SpvSourceLanguageOpenCL_C = 3, - SpvSourceLanguageOpenCL_CPP = 4, - SpvSourceLanguageHLSL = 5, - SpvSourceLanguageMax = 0x7fffffff, -} SpvSourceLanguage; - -typedef enum SpvExecutionModel_ { - SpvExecutionModelVertex = 0, - SpvExecutionModelTessellationControl = 1, - SpvExecutionModelTessellationEvaluation = 2, - SpvExecutionModelGeometry = 3, - SpvExecutionModelFragment = 4, - SpvExecutionModelGLCompute = 5, - SpvExecutionModelKernel = 6, - SpvExecutionModelMax = 0x7fffffff, -} SpvExecutionModel; - -typedef enum SpvAddressingModel_ { - SpvAddressingModelLogical = 0, - SpvAddressingModelPhysical32 = 1, - SpvAddressingModelPhysical64 = 2, - SpvAddressingModelMax = 0x7fffffff, -} SpvAddressingModel; - -typedef enum SpvMemoryModel_ { - SpvMemoryModelSimple = 0, - SpvMemoryModelGLSL450 = 1, - SpvMemoryModelOpenCL = 2, - SpvMemoryModelMax = 0x7fffffff, -} SpvMemoryModel; - -typedef enum SpvExecutionMode_ { - SpvExecutionModeInvocations = 0, - SpvExecutionModeSpacingEqual = 1, - SpvExecutionModeSpacingFractionalEven = 2, - SpvExecutionModeSpacingFractionalOdd = 3, - SpvExecutionModeVertexOrderCw = 4, - SpvExecutionModeVertexOrderCcw = 5, - SpvExecutionModePixelCenterInteger = 6, - SpvExecutionModeOriginUpperLeft = 7, - SpvExecutionModeOriginLowerLeft = 8, - SpvExecutionModeEarlyFragmentTests = 9, - SpvExecutionModePointMode = 10, - SpvExecutionModeXfb = 11, - SpvExecutionModeDepthReplacing = 12, - SpvExecutionModeDepthGreater = 14, - SpvExecutionModeDepthLess = 15, - SpvExecutionModeDepthUnchanged = 16, - SpvExecutionModeLocalSize = 17, - SpvExecutionModeLocalSizeHint = 18, - SpvExecutionModeInputPoints = 19, - SpvExecutionModeInputLines = 20, - SpvExecutionModeInputLinesAdjacency = 21, - SpvExecutionModeTriangles = 22, - SpvExecutionModeInputTrianglesAdjacency = 23, - SpvExecutionModeQuads = 24, - SpvExecutionModeIsolines = 25, - SpvExecutionModeOutputVertices = 26, - SpvExecutionModeOutputPoints = 27, - SpvExecutionModeOutputLineStrip = 28, - SpvExecutionModeOutputTriangleStrip = 29, - SpvExecutionModeVecTypeHint = 30, - SpvExecutionModeContractionOff = 31, - SpvExecutionModePostDepthCoverage = 4446, - SpvExecutionModeStencilRefReplacingEXT = 5027, - SpvExecutionModeMax = 0x7fffffff, -} SpvExecutionMode; - -typedef enum SpvStorageClass_ { - SpvStorageClassUniformConstant = 0, - SpvStorageClassInput = 1, - SpvStorageClassUniform = 2, - SpvStorageClassOutput = 3, - SpvStorageClassWorkgroup = 4, - SpvStorageClassCrossWorkgroup = 5, - SpvStorageClassPrivate = 6, - SpvStorageClassFunction = 7, - SpvStorageClassGeneric = 8, - SpvStorageClassPushConstant = 9, - SpvStorageClassAtomicCounter = 10, - SpvStorageClassImage = 11, - SpvStorageClassStorageBuffer = 12, - SpvStorageClassMax = 0x7fffffff, -} SpvStorageClass; - -typedef enum SpvDim_ { - SpvDim1D = 0, - SpvDim2D = 1, - SpvDim3D = 2, - SpvDimCube = 3, - SpvDimRect = 4, - SpvDimBuffer = 5, - SpvDimSubpassData = 6, - SpvDimMax = 0x7fffffff, -} SpvDim; - -typedef enum SpvSamplerAddressingMode_ { - SpvSamplerAddressingModeNone = 0, - SpvSamplerAddressingModeClampToEdge = 1, - SpvSamplerAddressingModeClamp = 2, - SpvSamplerAddressingModeRepeat = 3, - SpvSamplerAddressingModeRepeatMirrored = 4, - SpvSamplerAddressingModeMax = 0x7fffffff, -} SpvSamplerAddressingMode; - -typedef enum SpvSamplerFilterMode_ { - SpvSamplerFilterModeNearest = 0, - SpvSamplerFilterModeLinear = 1, - SpvSamplerFilterModeMax = 0x7fffffff, -} SpvSamplerFilterMode; - -typedef enum SpvImageFormat_ { - SpvImageFormatUnknown = 0, - SpvImageFormatRgba32f = 1, - SpvImageFormatRgba16f = 2, - SpvImageFormatR32f = 3, - SpvImageFormatRgba8 = 4, - SpvImageFormatRgba8Snorm = 5, - SpvImageFormatRg32f = 6, - SpvImageFormatRg16f = 7, - SpvImageFormatR11fG11fB10f = 8, - SpvImageFormatR16f = 9, - SpvImageFormatRgba16 = 10, - SpvImageFormatRgb10A2 = 11, - SpvImageFormatRg16 = 12, - SpvImageFormatRg8 = 13, - SpvImageFormatR16 = 14, - SpvImageFormatR8 = 15, - SpvImageFormatRgba16Snorm = 16, - SpvImageFormatRg16Snorm = 17, - SpvImageFormatRg8Snorm = 18, - SpvImageFormatR16Snorm = 19, - SpvImageFormatR8Snorm = 20, - SpvImageFormatRgba32i = 21, - SpvImageFormatRgba16i = 22, - SpvImageFormatRgba8i = 23, - SpvImageFormatR32i = 24, - SpvImageFormatRg32i = 25, - SpvImageFormatRg16i = 26, - SpvImageFormatRg8i = 27, - SpvImageFormatR16i = 28, - SpvImageFormatR8i = 29, - SpvImageFormatRgba32ui = 30, - SpvImageFormatRgba16ui = 31, - SpvImageFormatRgba8ui = 32, - SpvImageFormatR32ui = 33, - SpvImageFormatRgb10a2ui = 34, - SpvImageFormatRg32ui = 35, - SpvImageFormatRg16ui = 36, - SpvImageFormatRg8ui = 37, - SpvImageFormatR16ui = 38, - SpvImageFormatR8ui = 39, - SpvImageFormatMax = 0x7fffffff, -} SpvImageFormat; - -typedef enum SpvImageChannelOrder_ { - SpvImageChannelOrderR = 0, - SpvImageChannelOrderA = 1, - SpvImageChannelOrderRG = 2, - SpvImageChannelOrderRA = 3, - SpvImageChannelOrderRGB = 4, - SpvImageChannelOrderRGBA = 5, - SpvImageChannelOrderBGRA = 6, - SpvImageChannelOrderARGB = 7, - SpvImageChannelOrderIntensity = 8, - SpvImageChannelOrderLuminance = 9, - SpvImageChannelOrderRx = 10, - SpvImageChannelOrderRGx = 11, - SpvImageChannelOrderRGBx = 12, - SpvImageChannelOrderDepth = 13, - SpvImageChannelOrderDepthStencil = 14, - SpvImageChannelOrdersRGB = 15, - SpvImageChannelOrdersRGBx = 16, - SpvImageChannelOrdersRGBA = 17, - SpvImageChannelOrdersBGRA = 18, - SpvImageChannelOrderABGR = 19, - SpvImageChannelOrderMax = 0x7fffffff, -} SpvImageChannelOrder; - -typedef enum SpvImageChannelDataType_ { - SpvImageChannelDataTypeSnormInt8 = 0, - SpvImageChannelDataTypeSnormInt16 = 1, - SpvImageChannelDataTypeUnormInt8 = 2, - SpvImageChannelDataTypeUnormInt16 = 3, - SpvImageChannelDataTypeUnormShort565 = 4, - SpvImageChannelDataTypeUnormShort555 = 5, - SpvImageChannelDataTypeUnormInt101010 = 6, - SpvImageChannelDataTypeSignedInt8 = 7, - SpvImageChannelDataTypeSignedInt16 = 8, - SpvImageChannelDataTypeSignedInt32 = 9, - SpvImageChannelDataTypeUnsignedInt8 = 10, - SpvImageChannelDataTypeUnsignedInt16 = 11, - SpvImageChannelDataTypeUnsignedInt32 = 12, - SpvImageChannelDataTypeHalfFloat = 13, - SpvImageChannelDataTypeFloat = 14, - SpvImageChannelDataTypeUnormInt24 = 15, - SpvImageChannelDataTypeUnormInt101010_2 = 16, - SpvImageChannelDataTypeMax = 0x7fffffff, -} SpvImageChannelDataType; - -typedef enum SpvImageOperandsShift_ { - SpvImageOperandsBiasShift = 0, - SpvImageOperandsLodShift = 1, - SpvImageOperandsGradShift = 2, - SpvImageOperandsConstOffsetShift = 3, - SpvImageOperandsOffsetShift = 4, - SpvImageOperandsConstOffsetsShift = 5, - SpvImageOperandsSampleShift = 6, - SpvImageOperandsMinLodShift = 7, - SpvImageOperandsMax = 0x7fffffff, -} SpvImageOperandsShift; - -typedef enum SpvImageOperandsMask_ { - SpvImageOperandsMaskNone = 0, - SpvImageOperandsBiasMask = 0x00000001, - SpvImageOperandsLodMask = 0x00000002, - SpvImageOperandsGradMask = 0x00000004, - SpvImageOperandsConstOffsetMask = 0x00000008, - SpvImageOperandsOffsetMask = 0x00000010, - SpvImageOperandsConstOffsetsMask = 0x00000020, - SpvImageOperandsSampleMask = 0x00000040, - SpvImageOperandsMinLodMask = 0x00000080, -} SpvImageOperandsMask; - -typedef enum SpvFPFastMathModeShift_ { - SpvFPFastMathModeNotNaNShift = 0, - SpvFPFastMathModeNotInfShift = 1, - SpvFPFastMathModeNSZShift = 2, - SpvFPFastMathModeAllowRecipShift = 3, - SpvFPFastMathModeFastShift = 4, - SpvFPFastMathModeMax = 0x7fffffff, -} SpvFPFastMathModeShift; - -typedef enum SpvFPFastMathModeMask_ { - SpvFPFastMathModeMaskNone = 0, - SpvFPFastMathModeNotNaNMask = 0x00000001, - SpvFPFastMathModeNotInfMask = 0x00000002, - SpvFPFastMathModeNSZMask = 0x00000004, - SpvFPFastMathModeAllowRecipMask = 0x00000008, - SpvFPFastMathModeFastMask = 0x00000010, -} SpvFPFastMathModeMask; - -typedef enum SpvFPRoundingMode_ { - SpvFPRoundingModeRTE = 0, - SpvFPRoundingModeRTZ = 1, - SpvFPRoundingModeRTP = 2, - SpvFPRoundingModeRTN = 3, - SpvFPRoundingModeMax = 0x7fffffff, -} SpvFPRoundingMode; - -typedef enum SpvLinkageType_ { - SpvLinkageTypeExport = 0, - SpvLinkageTypeImport = 1, - SpvLinkageTypeMax = 0x7fffffff, -} SpvLinkageType; - -typedef enum SpvAccessQualifier_ { - SpvAccessQualifierReadOnly = 0, - SpvAccessQualifierWriteOnly = 1, - SpvAccessQualifierReadWrite = 2, - SpvAccessQualifierMax = 0x7fffffff, -} SpvAccessQualifier; - -typedef enum SpvFunctionParameterAttribute_ { - SpvFunctionParameterAttributeZext = 0, - SpvFunctionParameterAttributeSext = 1, - SpvFunctionParameterAttributeByVal = 2, - SpvFunctionParameterAttributeSret = 3, - SpvFunctionParameterAttributeNoAlias = 4, - SpvFunctionParameterAttributeNoCapture = 5, - SpvFunctionParameterAttributeNoWrite = 6, - SpvFunctionParameterAttributeNoReadWrite = 7, - SpvFunctionParameterAttributeMax = 0x7fffffff, -} SpvFunctionParameterAttribute; - -typedef enum SpvDecoration_ { - SpvDecorationRelaxedPrecision = 0, - SpvDecorationSpecId = 1, - SpvDecorationBlock = 2, - SpvDecorationBufferBlock = 3, - SpvDecorationRowMajor = 4, - SpvDecorationColMajor = 5, - SpvDecorationArrayStride = 6, - SpvDecorationMatrixStride = 7, - SpvDecorationGLSLShared = 8, - SpvDecorationGLSLPacked = 9, - SpvDecorationCPacked = 10, - SpvDecorationBuiltIn = 11, - SpvDecorationNoPerspective = 13, - SpvDecorationFlat = 14, - SpvDecorationPatch = 15, - SpvDecorationCentroid = 16, - SpvDecorationSample = 17, - SpvDecorationInvariant = 18, - SpvDecorationRestrict = 19, - SpvDecorationAliased = 20, - SpvDecorationVolatile = 21, - SpvDecorationConstant = 22, - SpvDecorationCoherent = 23, - SpvDecorationNonWritable = 24, - SpvDecorationNonReadable = 25, - SpvDecorationUniform = 26, - SpvDecorationSaturatedConversion = 28, - SpvDecorationStream = 29, - SpvDecorationLocation = 30, - SpvDecorationComponent = 31, - SpvDecorationIndex = 32, - SpvDecorationBinding = 33, - SpvDecorationDescriptorSet = 34, - SpvDecorationOffset = 35, - SpvDecorationXfbBuffer = 36, - SpvDecorationXfbStride = 37, - SpvDecorationFuncParamAttr = 38, - SpvDecorationFPRoundingMode = 39, - SpvDecorationFPFastMathMode = 40, - SpvDecorationLinkageAttributes = 41, - SpvDecorationNoContraction = 42, - SpvDecorationInputAttachmentIndex = 43, - SpvDecorationAlignment = 44, - SpvDecorationExplicitInterpAMD = 4999, - SpvDecorationOverrideCoverageNV = 5248, - SpvDecorationPassthroughNV = 5250, - SpvDecorationViewportRelativeNV = 5252, - SpvDecorationSecondaryViewportRelativeNV = 5256, - SpvDecorationMax = 0x7fffffff, -} SpvDecoration; - -typedef enum SpvBuiltIn_ { - SpvBuiltInPosition = 0, - SpvBuiltInPointSize = 1, - SpvBuiltInClipDistance = 3, - SpvBuiltInCullDistance = 4, - SpvBuiltInVertexId = 5, - SpvBuiltInInstanceId = 6, - SpvBuiltInPrimitiveId = 7, - SpvBuiltInInvocationId = 8, - SpvBuiltInLayer = 9, - SpvBuiltInViewportIndex = 10, - SpvBuiltInTessLevelOuter = 11, - SpvBuiltInTessLevelInner = 12, - SpvBuiltInTessCoord = 13, - SpvBuiltInPatchVertices = 14, - SpvBuiltInFragCoord = 15, - SpvBuiltInPointCoord = 16, - SpvBuiltInFrontFacing = 17, - SpvBuiltInSampleId = 18, - SpvBuiltInSamplePosition = 19, - SpvBuiltInSampleMask = 20, - SpvBuiltInFragDepth = 22, - SpvBuiltInHelperInvocation = 23, - SpvBuiltInNumWorkgroups = 24, - SpvBuiltInWorkgroupSize = 25, - SpvBuiltInWorkgroupId = 26, - SpvBuiltInLocalInvocationId = 27, - SpvBuiltInGlobalInvocationId = 28, - SpvBuiltInLocalInvocationIndex = 29, - SpvBuiltInWorkDim = 30, - SpvBuiltInGlobalSize = 31, - SpvBuiltInEnqueuedWorkgroupSize = 32, - SpvBuiltInGlobalOffset = 33, - SpvBuiltInGlobalLinearId = 34, - SpvBuiltInSubgroupSize = 36, - SpvBuiltInSubgroupMaxSize = 37, - SpvBuiltInNumSubgroups = 38, - SpvBuiltInNumEnqueuedSubgroups = 39, - SpvBuiltInSubgroupId = 40, - SpvBuiltInSubgroupLocalInvocationId = 41, - SpvBuiltInVertexIndex = 42, - SpvBuiltInInstanceIndex = 43, - SpvBuiltInSubgroupEqMaskKHR = 4416, - SpvBuiltInSubgroupGeMaskKHR = 4417, - SpvBuiltInSubgroupGtMaskKHR = 4418, - SpvBuiltInSubgroupLeMaskKHR = 4419, - SpvBuiltInSubgroupLtMaskKHR = 4420, - SpvBuiltInBaseVertex = 4424, - SpvBuiltInBaseInstance = 4425, - SpvBuiltInDrawIndex = 4426, - SpvBuiltInDeviceIndex = 4438, - SpvBuiltInViewIndex = 4440, - SpvBuiltInBaryCoordNoPerspAMD = 4992, - SpvBuiltInBaryCoordNoPerspCentroidAMD = 4993, - SpvBuiltInBaryCoordNoPerspSampleAMD = 4994, - SpvBuiltInBaryCoordSmoothAMD = 4995, - SpvBuiltInBaryCoordSmoothCentroidAMD = 4996, - SpvBuiltInBaryCoordSmoothSampleAMD = 4997, - SpvBuiltInBaryCoordPullModelAMD = 4998, - SpvBuiltInFragStencilRefEXT = 5014, - SpvBuiltInViewportMaskNV = 5253, - SpvBuiltInSecondaryPositionNV = 5257, - SpvBuiltInSecondaryViewportMaskNV = 5258, - SpvBuiltInPositionPerViewNV = 5261, - SpvBuiltInViewportMaskPerViewNV = 5262, - SpvBuiltInMax = 0x7fffffff, -} SpvBuiltIn; - -typedef enum SpvSelectionControlShift_ { - SpvSelectionControlFlattenShift = 0, - SpvSelectionControlDontFlattenShift = 1, - SpvSelectionControlMax = 0x7fffffff, -} SpvSelectionControlShift; - -typedef enum SpvSelectionControlMask_ { - SpvSelectionControlMaskNone = 0, - SpvSelectionControlFlattenMask = 0x00000001, - SpvSelectionControlDontFlattenMask = 0x00000002, -} SpvSelectionControlMask; - -typedef enum SpvLoopControlShift_ { - SpvLoopControlUnrollShift = 0, - SpvLoopControlDontUnrollShift = 1, - SpvLoopControlMax = 0x7fffffff, -} SpvLoopControlShift; - -typedef enum SpvLoopControlMask_ { - SpvLoopControlMaskNone = 0, - SpvLoopControlUnrollMask = 0x00000001, - SpvLoopControlDontUnrollMask = 0x00000002, -} SpvLoopControlMask; - -typedef enum SpvFunctionControlShift_ { - SpvFunctionControlInlineShift = 0, - SpvFunctionControlDontInlineShift = 1, - SpvFunctionControlPureShift = 2, - SpvFunctionControlConstShift = 3, - SpvFunctionControlMax = 0x7fffffff, -} SpvFunctionControlShift; - -typedef enum SpvFunctionControlMask_ { - SpvFunctionControlMaskNone = 0, - SpvFunctionControlInlineMask = 0x00000001, - SpvFunctionControlDontInlineMask = 0x00000002, - SpvFunctionControlPureMask = 0x00000004, - SpvFunctionControlConstMask = 0x00000008, -} SpvFunctionControlMask; - -typedef enum SpvMemorySemanticsShift_ { - SpvMemorySemanticsAcquireShift = 1, - SpvMemorySemanticsReleaseShift = 2, - SpvMemorySemanticsAcquireReleaseShift = 3, - SpvMemorySemanticsSequentiallyConsistentShift = 4, - SpvMemorySemanticsUniformMemoryShift = 6, - SpvMemorySemanticsSubgroupMemoryShift = 7, - SpvMemorySemanticsWorkgroupMemoryShift = 8, - SpvMemorySemanticsCrossWorkgroupMemoryShift = 9, - SpvMemorySemanticsAtomicCounterMemoryShift = 10, - SpvMemorySemanticsImageMemoryShift = 11, - SpvMemorySemanticsMax = 0x7fffffff, -} SpvMemorySemanticsShift; - -typedef enum SpvMemorySemanticsMask_ { - SpvMemorySemanticsMaskNone = 0, - SpvMemorySemanticsAcquireMask = 0x00000002, - SpvMemorySemanticsReleaseMask = 0x00000004, - SpvMemorySemanticsAcquireReleaseMask = 0x00000008, - SpvMemorySemanticsSequentiallyConsistentMask = 0x00000010, - SpvMemorySemanticsUniformMemoryMask = 0x00000040, - SpvMemorySemanticsSubgroupMemoryMask = 0x00000080, - SpvMemorySemanticsWorkgroupMemoryMask = 0x00000100, - SpvMemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, - SpvMemorySemanticsAtomicCounterMemoryMask = 0x00000400, - SpvMemorySemanticsImageMemoryMask = 0x00000800, -} SpvMemorySemanticsMask; - -typedef enum SpvMemoryAccessShift_ { - SpvMemoryAccessVolatileShift = 0, - SpvMemoryAccessAlignedShift = 1, - SpvMemoryAccessNontemporalShift = 2, - SpvMemoryAccessMax = 0x7fffffff, -} SpvMemoryAccessShift; - -typedef enum SpvMemoryAccessMask_ { - SpvMemoryAccessMaskNone = 0, - SpvMemoryAccessVolatileMask = 0x00000001, - SpvMemoryAccessAlignedMask = 0x00000002, - SpvMemoryAccessNontemporalMask = 0x00000004, -} SpvMemoryAccessMask; - -typedef enum SpvScope_ { - SpvScopeCrossDevice = 0, - SpvScopeDevice = 1, - SpvScopeWorkgroup = 2, - SpvScopeSubgroup = 3, - SpvScopeInvocation = 4, - SpvScopeMax = 0x7fffffff, -} SpvScope; - -typedef enum SpvGroupOperation_ { - SpvGroupOperationReduce = 0, - SpvGroupOperationInclusiveScan = 1, - SpvGroupOperationExclusiveScan = 2, - SpvGroupOperationMax = 0x7fffffff, -} SpvGroupOperation; - -typedef enum SpvKernelEnqueueFlags_ { - SpvKernelEnqueueFlagsNoWait = 0, - SpvKernelEnqueueFlagsWaitKernel = 1, - SpvKernelEnqueueFlagsWaitWorkGroup = 2, - SpvKernelEnqueueFlagsMax = 0x7fffffff, -} SpvKernelEnqueueFlags; - -typedef enum SpvKernelProfilingInfoShift_ { - SpvKernelProfilingInfoCmdExecTimeShift = 0, - SpvKernelProfilingInfoMax = 0x7fffffff, -} SpvKernelProfilingInfoShift; - -typedef enum SpvKernelProfilingInfoMask_ { - SpvKernelProfilingInfoMaskNone = 0, - SpvKernelProfilingInfoCmdExecTimeMask = 0x00000001, -} SpvKernelProfilingInfoMask; - -typedef enum SpvCapability_ { - SpvCapabilityMatrix = 0, - SpvCapabilityShader = 1, - SpvCapabilityGeometry = 2, - SpvCapabilityTessellation = 3, - SpvCapabilityAddresses = 4, - SpvCapabilityLinkage = 5, - SpvCapabilityKernel = 6, - SpvCapabilityVector16 = 7, - SpvCapabilityFloat16Buffer = 8, - SpvCapabilityFloat16 = 9, - SpvCapabilityFloat64 = 10, - SpvCapabilityInt64 = 11, - SpvCapabilityInt64Atomics = 12, - SpvCapabilityImageBasic = 13, - SpvCapabilityImageReadWrite = 14, - SpvCapabilityImageMipmap = 15, - SpvCapabilityPipes = 17, - SpvCapabilityGroups = 18, - SpvCapabilityDeviceEnqueue = 19, - SpvCapabilityLiteralSampler = 20, - SpvCapabilityAtomicStorage = 21, - SpvCapabilityInt16 = 22, - SpvCapabilityTessellationPointSize = 23, - SpvCapabilityGeometryPointSize = 24, - SpvCapabilityImageGatherExtended = 25, - SpvCapabilityStorageImageMultisample = 27, - SpvCapabilityUniformBufferArrayDynamicIndexing = 28, - SpvCapabilitySampledImageArrayDynamicIndexing = 29, - SpvCapabilityStorageBufferArrayDynamicIndexing = 30, - SpvCapabilityStorageImageArrayDynamicIndexing = 31, - SpvCapabilityClipDistance = 32, - SpvCapabilityCullDistance = 33, - SpvCapabilityImageCubeArray = 34, - SpvCapabilitySampleRateShading = 35, - SpvCapabilityImageRect = 36, - SpvCapabilitySampledRect = 37, - SpvCapabilityGenericPointer = 38, - SpvCapabilityInt8 = 39, - SpvCapabilityInputAttachment = 40, - SpvCapabilitySparseResidency = 41, - SpvCapabilityMinLod = 42, - SpvCapabilitySampled1D = 43, - SpvCapabilityImage1D = 44, - SpvCapabilitySampledCubeArray = 45, - SpvCapabilitySampledBuffer = 46, - SpvCapabilityImageBuffer = 47, - SpvCapabilityImageMSArray = 48, - SpvCapabilityStorageImageExtendedFormats = 49, - SpvCapabilityImageQuery = 50, - SpvCapabilityDerivativeControl = 51, - SpvCapabilityInterpolationFunction = 52, - SpvCapabilityTransformFeedback = 53, - SpvCapabilityGeometryStreams = 54, - SpvCapabilityStorageImageReadWithoutFormat = 55, - SpvCapabilityStorageImageWriteWithoutFormat = 56, - SpvCapabilityMultiViewport = 57, - SpvCapabilitySubgroupBallotKHR = 4423, - SpvCapabilityDrawParameters = 4427, - SpvCapabilitySubgroupVoteKHR = 4431, - SpvCapabilityStorageBuffer16BitAccess = 4433, - SpvCapabilityStorageUniformBufferBlock16 = 4433, - SpvCapabilityStorageUniform16 = 4434, - SpvCapabilityUniformAndStorageBuffer16BitAccess = 4434, - SpvCapabilityStoragePushConstant16 = 4435, - SpvCapabilityStorageInputOutput16 = 4436, - SpvCapabilityDeviceGroup = 4437, - SpvCapabilityMultiView = 4439, - SpvCapabilityVariablePointersStorageBuffer = 4441, - SpvCapabilityVariablePointers = 4442, - SpvCapabilityAtomicStorageOps = 4445, - SpvCapabilitySampleMaskPostDepthCoverage = 4447, - SpvCapabilityImageGatherBiasLodAMD = 5009, - SpvCapabilityFragmentMaskAMD = 5010, - SpvCapabilityStencilExportEXT = 5013, - SpvCapabilityImageReadWriteLodAMD = 5015, - SpvCapabilitySampleMaskOverrideCoverageNV = 5249, - SpvCapabilityGeometryShaderPassthroughNV = 5251, - SpvCapabilityShaderViewportIndexLayerEXT = 5254, - SpvCapabilityShaderViewportIndexLayerNV = 5254, - SpvCapabilityShaderViewportMaskNV = 5255, - SpvCapabilityShaderStereoViewNV = 5259, - SpvCapabilityPerViewAttributesNV = 5260, - SpvCapabilitySubgroupShuffleINTEL = 5568, - SpvCapabilitySubgroupBufferBlockIOINTEL = 5569, - SpvCapabilitySubgroupImageBlockIOINTEL = 5570, - SpvCapabilityMax = 0x7fffffff, -} SpvCapability; - -typedef enum SpvOp_ { - SpvOpNop = 0, - SpvOpUndef = 1, - SpvOpSourceContinued = 2, - SpvOpSource = 3, - SpvOpSourceExtension = 4, - SpvOpName = 5, - SpvOpMemberName = 6, - SpvOpString = 7, - SpvOpLine = 8, - SpvOpExtension = 10, - SpvOpExtInstImport = 11, - SpvOpExtInst = 12, - SpvOpMemoryModel = 14, - SpvOpEntryPoint = 15, - SpvOpExecutionMode = 16, - SpvOpCapability = 17, - SpvOpTypeVoid = 19, - SpvOpTypeBool = 20, - SpvOpTypeInt = 21, - SpvOpTypeFloat = 22, - SpvOpTypeVector = 23, - SpvOpTypeMatrix = 24, - SpvOpTypeImage = 25, - SpvOpTypeSampler = 26, - SpvOpTypeSampledImage = 27, - SpvOpTypeArray = 28, - SpvOpTypeRuntimeArray = 29, - SpvOpTypeStruct = 30, - SpvOpTypeOpaque = 31, - SpvOpTypePointer = 32, - SpvOpTypeFunction = 33, - SpvOpTypeEvent = 34, - SpvOpTypeDeviceEvent = 35, - SpvOpTypeReserveId = 36, - SpvOpTypeQueue = 37, - SpvOpTypePipe = 38, - SpvOpTypeForwardPointer = 39, - SpvOpConstantTrue = 41, - SpvOpConstantFalse = 42, - SpvOpConstant = 43, - SpvOpConstantComposite = 44, - SpvOpConstantSampler = 45, - SpvOpConstantNull = 46, - SpvOpSpecConstantTrue = 48, - SpvOpSpecConstantFalse = 49, - SpvOpSpecConstant = 50, - SpvOpSpecConstantComposite = 51, - SpvOpSpecConstantOp = 52, - SpvOpFunction = 54, - SpvOpFunctionParameter = 55, - SpvOpFunctionEnd = 56, - SpvOpFunctionCall = 57, - SpvOpVariable = 59, - SpvOpImageTexelPointer = 60, - SpvOpLoad = 61, - SpvOpStore = 62, - SpvOpCopyMemory = 63, - SpvOpCopyMemorySized = 64, - SpvOpAccessChain = 65, - SpvOpInBoundsAccessChain = 66, - SpvOpPtrAccessChain = 67, - SpvOpArrayLength = 68, - SpvOpGenericPtrMemSemantics = 69, - SpvOpInBoundsPtrAccessChain = 70, - SpvOpDecorate = 71, - SpvOpMemberDecorate = 72, - SpvOpDecorationGroup = 73, - SpvOpGroupDecorate = 74, - SpvOpGroupMemberDecorate = 75, - SpvOpVectorExtractDynamic = 77, - SpvOpVectorInsertDynamic = 78, - SpvOpVectorShuffle = 79, - SpvOpCompositeConstruct = 80, - SpvOpCompositeExtract = 81, - SpvOpCompositeInsert = 82, - SpvOpCopyObject = 83, - SpvOpTranspose = 84, - SpvOpSampledImage = 86, - SpvOpImageSampleImplicitLod = 87, - SpvOpImageSampleExplicitLod = 88, - SpvOpImageSampleDrefImplicitLod = 89, - SpvOpImageSampleDrefExplicitLod = 90, - SpvOpImageSampleProjImplicitLod = 91, - SpvOpImageSampleProjExplicitLod = 92, - SpvOpImageSampleProjDrefImplicitLod = 93, - SpvOpImageSampleProjDrefExplicitLod = 94, - SpvOpImageFetch = 95, - SpvOpImageGather = 96, - SpvOpImageDrefGather = 97, - SpvOpImageRead = 98, - SpvOpImageWrite = 99, - SpvOpImage = 100, - SpvOpImageQueryFormat = 101, - SpvOpImageQueryOrder = 102, - SpvOpImageQuerySizeLod = 103, - SpvOpImageQuerySize = 104, - SpvOpImageQueryLod = 105, - SpvOpImageQueryLevels = 106, - SpvOpImageQuerySamples = 107, - SpvOpConvertFToU = 109, - SpvOpConvertFToS = 110, - SpvOpConvertSToF = 111, - SpvOpConvertUToF = 112, - SpvOpUConvert = 113, - SpvOpSConvert = 114, - SpvOpFConvert = 115, - SpvOpQuantizeToF16 = 116, - SpvOpConvertPtrToU = 117, - SpvOpSatConvertSToU = 118, - SpvOpSatConvertUToS = 119, - SpvOpConvertUToPtr = 120, - SpvOpPtrCastToGeneric = 121, - SpvOpGenericCastToPtr = 122, - SpvOpGenericCastToPtrExplicit = 123, - SpvOpBitcast = 124, - SpvOpSNegate = 126, - SpvOpFNegate = 127, - SpvOpIAdd = 128, - SpvOpFAdd = 129, - SpvOpISub = 130, - SpvOpFSub = 131, - SpvOpIMul = 132, - SpvOpFMul = 133, - SpvOpUDiv = 134, - SpvOpSDiv = 135, - SpvOpFDiv = 136, - SpvOpUMod = 137, - SpvOpSRem = 138, - SpvOpSMod = 139, - SpvOpFRem = 140, - SpvOpFMod = 141, - SpvOpVectorTimesScalar = 142, - SpvOpMatrixTimesScalar = 143, - SpvOpVectorTimesMatrix = 144, - SpvOpMatrixTimesVector = 145, - SpvOpMatrixTimesMatrix = 146, - SpvOpOuterProduct = 147, - SpvOpDot = 148, - SpvOpIAddCarry = 149, - SpvOpISubBorrow = 150, - SpvOpUMulExtended = 151, - SpvOpSMulExtended = 152, - SpvOpAny = 154, - SpvOpAll = 155, - SpvOpIsNan = 156, - SpvOpIsInf = 157, - SpvOpIsFinite = 158, - SpvOpIsNormal = 159, - SpvOpSignBitSet = 160, - SpvOpLessOrGreater = 161, - SpvOpOrdered = 162, - SpvOpUnordered = 163, - SpvOpLogicalEqual = 164, - SpvOpLogicalNotEqual = 165, - SpvOpLogicalOr = 166, - SpvOpLogicalAnd = 167, - SpvOpLogicalNot = 168, - SpvOpSelect = 169, - SpvOpIEqual = 170, - SpvOpINotEqual = 171, - SpvOpUGreaterThan = 172, - SpvOpSGreaterThan = 173, - SpvOpUGreaterThanEqual = 174, - SpvOpSGreaterThanEqual = 175, - SpvOpULessThan = 176, - SpvOpSLessThan = 177, - SpvOpULessThanEqual = 178, - SpvOpSLessThanEqual = 179, - SpvOpFOrdEqual = 180, - SpvOpFUnordEqual = 181, - SpvOpFOrdNotEqual = 182, - SpvOpFUnordNotEqual = 183, - SpvOpFOrdLessThan = 184, - SpvOpFUnordLessThan = 185, - SpvOpFOrdGreaterThan = 186, - SpvOpFUnordGreaterThan = 187, - SpvOpFOrdLessThanEqual = 188, - SpvOpFUnordLessThanEqual = 189, - SpvOpFOrdGreaterThanEqual = 190, - SpvOpFUnordGreaterThanEqual = 191, - SpvOpShiftRightLogical = 194, - SpvOpShiftRightArithmetic = 195, - SpvOpShiftLeftLogical = 196, - SpvOpBitwiseOr = 197, - SpvOpBitwiseXor = 198, - SpvOpBitwiseAnd = 199, - SpvOpNot = 200, - SpvOpBitFieldInsert = 201, - SpvOpBitFieldSExtract = 202, - SpvOpBitFieldUExtract = 203, - SpvOpBitReverse = 204, - SpvOpBitCount = 205, - SpvOpDPdx = 207, - SpvOpDPdy = 208, - SpvOpFwidth = 209, - SpvOpDPdxFine = 210, - SpvOpDPdyFine = 211, - SpvOpFwidthFine = 212, - SpvOpDPdxCoarse = 213, - SpvOpDPdyCoarse = 214, - SpvOpFwidthCoarse = 215, - SpvOpEmitVertex = 218, - SpvOpEndPrimitive = 219, - SpvOpEmitStreamVertex = 220, - SpvOpEndStreamPrimitive = 221, - SpvOpControlBarrier = 224, - SpvOpMemoryBarrier = 225, - SpvOpAtomicLoad = 227, - SpvOpAtomicStore = 228, - SpvOpAtomicExchange = 229, - SpvOpAtomicCompareExchange = 230, - SpvOpAtomicCompareExchangeWeak = 231, - SpvOpAtomicIIncrement = 232, - SpvOpAtomicIDecrement = 233, - SpvOpAtomicIAdd = 234, - SpvOpAtomicISub = 235, - SpvOpAtomicSMin = 236, - SpvOpAtomicUMin = 237, - SpvOpAtomicSMax = 238, - SpvOpAtomicUMax = 239, - SpvOpAtomicAnd = 240, - SpvOpAtomicOr = 241, - SpvOpAtomicXor = 242, - SpvOpPhi = 245, - SpvOpLoopMerge = 246, - SpvOpSelectionMerge = 247, - SpvOpLabel = 248, - SpvOpBranch = 249, - SpvOpBranchConditional = 250, - SpvOpSwitch = 251, - SpvOpKill = 252, - SpvOpReturn = 253, - SpvOpReturnValue = 254, - SpvOpUnreachable = 255, - SpvOpLifetimeStart = 256, - SpvOpLifetimeStop = 257, - SpvOpGroupAsyncCopy = 259, - SpvOpGroupWaitEvents = 260, - SpvOpGroupAll = 261, - SpvOpGroupAny = 262, - SpvOpGroupBroadcast = 263, - SpvOpGroupIAdd = 264, - SpvOpGroupFAdd = 265, - SpvOpGroupFMin = 266, - SpvOpGroupUMin = 267, - SpvOpGroupSMin = 268, - SpvOpGroupFMax = 269, - SpvOpGroupUMax = 270, - SpvOpGroupSMax = 271, - SpvOpReadPipe = 274, - SpvOpWritePipe = 275, - SpvOpReservedReadPipe = 276, - SpvOpReservedWritePipe = 277, - SpvOpReserveReadPipePackets = 278, - SpvOpReserveWritePipePackets = 279, - SpvOpCommitReadPipe = 280, - SpvOpCommitWritePipe = 281, - SpvOpIsValidReserveId = 282, - SpvOpGetNumPipePackets = 283, - SpvOpGetMaxPipePackets = 284, - SpvOpGroupReserveReadPipePackets = 285, - SpvOpGroupReserveWritePipePackets = 286, - SpvOpGroupCommitReadPipe = 287, - SpvOpGroupCommitWritePipe = 288, - SpvOpEnqueueMarker = 291, - SpvOpEnqueueKernel = 292, - SpvOpGetKernelNDrangeSubGroupCount = 293, - SpvOpGetKernelNDrangeMaxSubGroupSize = 294, - SpvOpGetKernelWorkGroupSize = 295, - SpvOpGetKernelPreferredWorkGroupSizeMultiple = 296, - SpvOpRetainEvent = 297, - SpvOpReleaseEvent = 298, - SpvOpCreateUserEvent = 299, - SpvOpIsValidEvent = 300, - SpvOpSetUserEventStatus = 301, - SpvOpCaptureEventProfilingInfo = 302, - SpvOpGetDefaultQueue = 303, - SpvOpBuildNDRange = 304, - SpvOpImageSparseSampleImplicitLod = 305, - SpvOpImageSparseSampleExplicitLod = 306, - SpvOpImageSparseSampleDrefImplicitLod = 307, - SpvOpImageSparseSampleDrefExplicitLod = 308, - SpvOpImageSparseSampleProjImplicitLod = 309, - SpvOpImageSparseSampleProjExplicitLod = 310, - SpvOpImageSparseSampleProjDrefImplicitLod = 311, - SpvOpImageSparseSampleProjDrefExplicitLod = 312, - SpvOpImageSparseFetch = 313, - SpvOpImageSparseGather = 314, - SpvOpImageSparseDrefGather = 315, - SpvOpImageSparseTexelsResident = 316, - SpvOpNoLine = 317, - SpvOpAtomicFlagTestAndSet = 318, - SpvOpAtomicFlagClear = 319, - SpvOpImageSparseRead = 320, - SpvOpSubgroupBallotKHR = 4421, - SpvOpSubgroupFirstInvocationKHR = 4422, - SpvOpSubgroupAllKHR = 4428, - SpvOpSubgroupAnyKHR = 4429, - SpvOpSubgroupAllEqualKHR = 4430, - SpvOpSubgroupReadInvocationKHR = 4432, - SpvOpGroupIAddNonUniformAMD = 5000, - SpvOpGroupFAddNonUniformAMD = 5001, - SpvOpGroupFMinNonUniformAMD = 5002, - SpvOpGroupUMinNonUniformAMD = 5003, - SpvOpGroupSMinNonUniformAMD = 5004, - SpvOpGroupFMaxNonUniformAMD = 5005, - SpvOpGroupUMaxNonUniformAMD = 5006, - SpvOpGroupSMaxNonUniformAMD = 5007, - SpvOpFragmentMaskFetchAMD = 5011, - SpvOpFragmentFetchAMD = 5012, - SpvOpSubgroupShuffleINTEL = 5571, - SpvOpSubgroupShuffleDownINTEL = 5572, - SpvOpSubgroupShuffleUpINTEL = 5573, - SpvOpSubgroupShuffleXorINTEL = 5574, - SpvOpSubgroupBlockReadINTEL = 5575, - SpvOpSubgroupBlockWriteINTEL = 5576, - SpvOpSubgroupImageBlockReadINTEL = 5577, - SpvOpSubgroupImageBlockWriteINTEL = 5578, - SpvOpMax = 0x7fffffff, -} SpvOp; - -#endif // #ifndef spirv_H - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.hpp vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.hpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.hpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.hpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,997 +0,0 @@ -// Copyright (c) 2014-2017 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -#ifndef spirv_HPP -#define spirv_HPP - -namespace spv { - -typedef unsigned int Id; - -#define SPV_VERSION 0x10000 -#define SPV_REVISION 12 - -static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010000; -static const unsigned int Revision = 12; -static const unsigned int OpCodeMask = 0xffff; -static const unsigned int WordCountShift = 16; - -enum SourceLanguage { - SourceLanguageUnknown = 0, - SourceLanguageESSL = 1, - SourceLanguageGLSL = 2, - SourceLanguageOpenCL_C = 3, - SourceLanguageOpenCL_CPP = 4, - SourceLanguageHLSL = 5, - SourceLanguageMax = 0x7fffffff, -}; - -enum ExecutionModel { - ExecutionModelVertex = 0, - ExecutionModelTessellationControl = 1, - ExecutionModelTessellationEvaluation = 2, - ExecutionModelGeometry = 3, - ExecutionModelFragment = 4, - ExecutionModelGLCompute = 5, - ExecutionModelKernel = 6, - ExecutionModelMax = 0x7fffffff, -}; - -enum AddressingModel { - AddressingModelLogical = 0, - AddressingModelPhysical32 = 1, - AddressingModelPhysical64 = 2, - AddressingModelMax = 0x7fffffff, -}; - -enum MemoryModel { - MemoryModelSimple = 0, - MemoryModelGLSL450 = 1, - MemoryModelOpenCL = 2, - MemoryModelMax = 0x7fffffff, -}; - -enum ExecutionMode { - ExecutionModeInvocations = 0, - ExecutionModeSpacingEqual = 1, - ExecutionModeSpacingFractionalEven = 2, - ExecutionModeSpacingFractionalOdd = 3, - ExecutionModeVertexOrderCw = 4, - ExecutionModeVertexOrderCcw = 5, - ExecutionModePixelCenterInteger = 6, - ExecutionModeOriginUpperLeft = 7, - ExecutionModeOriginLowerLeft = 8, - ExecutionModeEarlyFragmentTests = 9, - ExecutionModePointMode = 10, - ExecutionModeXfb = 11, - ExecutionModeDepthReplacing = 12, - ExecutionModeDepthGreater = 14, - ExecutionModeDepthLess = 15, - ExecutionModeDepthUnchanged = 16, - ExecutionModeLocalSize = 17, - ExecutionModeLocalSizeHint = 18, - ExecutionModeInputPoints = 19, - ExecutionModeInputLines = 20, - ExecutionModeInputLinesAdjacency = 21, - ExecutionModeTriangles = 22, - ExecutionModeInputTrianglesAdjacency = 23, - ExecutionModeQuads = 24, - ExecutionModeIsolines = 25, - ExecutionModeOutputVertices = 26, - ExecutionModeOutputPoints = 27, - ExecutionModeOutputLineStrip = 28, - ExecutionModeOutputTriangleStrip = 29, - ExecutionModeVecTypeHint = 30, - ExecutionModeContractionOff = 31, - ExecutionModePostDepthCoverage = 4446, - ExecutionModeStencilRefReplacingEXT = 5027, - ExecutionModeMax = 0x7fffffff, -}; - -enum StorageClass { - StorageClassUniformConstant = 0, - StorageClassInput = 1, - StorageClassUniform = 2, - StorageClassOutput = 3, - StorageClassWorkgroup = 4, - StorageClassCrossWorkgroup = 5, - StorageClassPrivate = 6, - StorageClassFunction = 7, - StorageClassGeneric = 8, - StorageClassPushConstant = 9, - StorageClassAtomicCounter = 10, - StorageClassImage = 11, - StorageClassStorageBuffer = 12, - StorageClassMax = 0x7fffffff, -}; - -enum Dim { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - DimCube = 3, - DimRect = 4, - DimBuffer = 5, - DimSubpassData = 6, - DimMax = 0x7fffffff, -}; - -enum SamplerAddressingMode { - SamplerAddressingModeNone = 0, - SamplerAddressingModeClampToEdge = 1, - SamplerAddressingModeClamp = 2, - SamplerAddressingModeRepeat = 3, - SamplerAddressingModeRepeatMirrored = 4, - SamplerAddressingModeMax = 0x7fffffff, -}; - -enum SamplerFilterMode { - SamplerFilterModeNearest = 0, - SamplerFilterModeLinear = 1, - SamplerFilterModeMax = 0x7fffffff, -}; - -enum ImageFormat { - ImageFormatUnknown = 0, - ImageFormatRgba32f = 1, - ImageFormatRgba16f = 2, - ImageFormatR32f = 3, - ImageFormatRgba8 = 4, - ImageFormatRgba8Snorm = 5, - ImageFormatRg32f = 6, - ImageFormatRg16f = 7, - ImageFormatR11fG11fB10f = 8, - ImageFormatR16f = 9, - ImageFormatRgba16 = 10, - ImageFormatRgb10A2 = 11, - ImageFormatRg16 = 12, - ImageFormatRg8 = 13, - ImageFormatR16 = 14, - ImageFormatR8 = 15, - ImageFormatRgba16Snorm = 16, - ImageFormatRg16Snorm = 17, - ImageFormatRg8Snorm = 18, - ImageFormatR16Snorm = 19, - ImageFormatR8Snorm = 20, - ImageFormatRgba32i = 21, - ImageFormatRgba16i = 22, - ImageFormatRgba8i = 23, - ImageFormatR32i = 24, - ImageFormatRg32i = 25, - ImageFormatRg16i = 26, - ImageFormatRg8i = 27, - ImageFormatR16i = 28, - ImageFormatR8i = 29, - ImageFormatRgba32ui = 30, - ImageFormatRgba16ui = 31, - ImageFormatRgba8ui = 32, - ImageFormatR32ui = 33, - ImageFormatRgb10a2ui = 34, - ImageFormatRg32ui = 35, - ImageFormatRg16ui = 36, - ImageFormatRg8ui = 37, - ImageFormatR16ui = 38, - ImageFormatR8ui = 39, - ImageFormatMax = 0x7fffffff, -}; - -enum ImageChannelOrder { - ImageChannelOrderR = 0, - ImageChannelOrderA = 1, - ImageChannelOrderRG = 2, - ImageChannelOrderRA = 3, - ImageChannelOrderRGB = 4, - ImageChannelOrderRGBA = 5, - ImageChannelOrderBGRA = 6, - ImageChannelOrderARGB = 7, - ImageChannelOrderIntensity = 8, - ImageChannelOrderLuminance = 9, - ImageChannelOrderRx = 10, - ImageChannelOrderRGx = 11, - ImageChannelOrderRGBx = 12, - ImageChannelOrderDepth = 13, - ImageChannelOrderDepthStencil = 14, - ImageChannelOrdersRGB = 15, - ImageChannelOrdersRGBx = 16, - ImageChannelOrdersRGBA = 17, - ImageChannelOrdersBGRA = 18, - ImageChannelOrderABGR = 19, - ImageChannelOrderMax = 0x7fffffff, -}; - -enum ImageChannelDataType { - ImageChannelDataTypeSnormInt8 = 0, - ImageChannelDataTypeSnormInt16 = 1, - ImageChannelDataTypeUnormInt8 = 2, - ImageChannelDataTypeUnormInt16 = 3, - ImageChannelDataTypeUnormShort565 = 4, - ImageChannelDataTypeUnormShort555 = 5, - ImageChannelDataTypeUnormInt101010 = 6, - ImageChannelDataTypeSignedInt8 = 7, - ImageChannelDataTypeSignedInt16 = 8, - ImageChannelDataTypeSignedInt32 = 9, - ImageChannelDataTypeUnsignedInt8 = 10, - ImageChannelDataTypeUnsignedInt16 = 11, - ImageChannelDataTypeUnsignedInt32 = 12, - ImageChannelDataTypeHalfFloat = 13, - ImageChannelDataTypeFloat = 14, - ImageChannelDataTypeUnormInt24 = 15, - ImageChannelDataTypeUnormInt101010_2 = 16, - ImageChannelDataTypeMax = 0x7fffffff, -}; - -enum ImageOperandsShift { - ImageOperandsBiasShift = 0, - ImageOperandsLodShift = 1, - ImageOperandsGradShift = 2, - ImageOperandsConstOffsetShift = 3, - ImageOperandsOffsetShift = 4, - ImageOperandsConstOffsetsShift = 5, - ImageOperandsSampleShift = 6, - ImageOperandsMinLodShift = 7, - ImageOperandsMax = 0x7fffffff, -}; - -enum ImageOperandsMask { - ImageOperandsMaskNone = 0, - ImageOperandsBiasMask = 0x00000001, - ImageOperandsLodMask = 0x00000002, - ImageOperandsGradMask = 0x00000004, - ImageOperandsConstOffsetMask = 0x00000008, - ImageOperandsOffsetMask = 0x00000010, - ImageOperandsConstOffsetsMask = 0x00000020, - ImageOperandsSampleMask = 0x00000040, - ImageOperandsMinLodMask = 0x00000080, -}; - -enum FPFastMathModeShift { - FPFastMathModeNotNaNShift = 0, - FPFastMathModeNotInfShift = 1, - FPFastMathModeNSZShift = 2, - FPFastMathModeAllowRecipShift = 3, - FPFastMathModeFastShift = 4, - FPFastMathModeMax = 0x7fffffff, -}; - -enum FPFastMathModeMask { - FPFastMathModeMaskNone = 0, - FPFastMathModeNotNaNMask = 0x00000001, - FPFastMathModeNotInfMask = 0x00000002, - FPFastMathModeNSZMask = 0x00000004, - FPFastMathModeAllowRecipMask = 0x00000008, - FPFastMathModeFastMask = 0x00000010, -}; - -enum FPRoundingMode { - FPRoundingModeRTE = 0, - FPRoundingModeRTZ = 1, - FPRoundingModeRTP = 2, - FPRoundingModeRTN = 3, - FPRoundingModeMax = 0x7fffffff, -}; - -enum LinkageType { - LinkageTypeExport = 0, - LinkageTypeImport = 1, - LinkageTypeMax = 0x7fffffff, -}; - -enum AccessQualifier { - AccessQualifierReadOnly = 0, - AccessQualifierWriteOnly = 1, - AccessQualifierReadWrite = 2, - AccessQualifierMax = 0x7fffffff, -}; - -enum FunctionParameterAttribute { - FunctionParameterAttributeZext = 0, - FunctionParameterAttributeSext = 1, - FunctionParameterAttributeByVal = 2, - FunctionParameterAttributeSret = 3, - FunctionParameterAttributeNoAlias = 4, - FunctionParameterAttributeNoCapture = 5, - FunctionParameterAttributeNoWrite = 6, - FunctionParameterAttributeNoReadWrite = 7, - FunctionParameterAttributeMax = 0x7fffffff, -}; - -enum Decoration { - DecorationRelaxedPrecision = 0, - DecorationSpecId = 1, - DecorationBlock = 2, - DecorationBufferBlock = 3, - DecorationRowMajor = 4, - DecorationColMajor = 5, - DecorationArrayStride = 6, - DecorationMatrixStride = 7, - DecorationGLSLShared = 8, - DecorationGLSLPacked = 9, - DecorationCPacked = 10, - DecorationBuiltIn = 11, - DecorationNoPerspective = 13, - DecorationFlat = 14, - DecorationPatch = 15, - DecorationCentroid = 16, - DecorationSample = 17, - DecorationInvariant = 18, - DecorationRestrict = 19, - DecorationAliased = 20, - DecorationVolatile = 21, - DecorationConstant = 22, - DecorationCoherent = 23, - DecorationNonWritable = 24, - DecorationNonReadable = 25, - DecorationUniform = 26, - DecorationSaturatedConversion = 28, - DecorationStream = 29, - DecorationLocation = 30, - DecorationComponent = 31, - DecorationIndex = 32, - DecorationBinding = 33, - DecorationDescriptorSet = 34, - DecorationOffset = 35, - DecorationXfbBuffer = 36, - DecorationXfbStride = 37, - DecorationFuncParamAttr = 38, - DecorationFPRoundingMode = 39, - DecorationFPFastMathMode = 40, - DecorationLinkageAttributes = 41, - DecorationNoContraction = 42, - DecorationInputAttachmentIndex = 43, - DecorationAlignment = 44, - DecorationExplicitInterpAMD = 4999, - DecorationOverrideCoverageNV = 5248, - DecorationPassthroughNV = 5250, - DecorationViewportRelativeNV = 5252, - DecorationSecondaryViewportRelativeNV = 5256, - DecorationMax = 0x7fffffff, -}; - -enum BuiltIn { - BuiltInPosition = 0, - BuiltInPointSize = 1, - BuiltInClipDistance = 3, - BuiltInCullDistance = 4, - BuiltInVertexId = 5, - BuiltInInstanceId = 6, - BuiltInPrimitiveId = 7, - BuiltInInvocationId = 8, - BuiltInLayer = 9, - BuiltInViewportIndex = 10, - BuiltInTessLevelOuter = 11, - BuiltInTessLevelInner = 12, - BuiltInTessCoord = 13, - BuiltInPatchVertices = 14, - BuiltInFragCoord = 15, - BuiltInPointCoord = 16, - BuiltInFrontFacing = 17, - BuiltInSampleId = 18, - BuiltInSamplePosition = 19, - BuiltInSampleMask = 20, - BuiltInFragDepth = 22, - BuiltInHelperInvocation = 23, - BuiltInNumWorkgroups = 24, - BuiltInWorkgroupSize = 25, - BuiltInWorkgroupId = 26, - BuiltInLocalInvocationId = 27, - BuiltInGlobalInvocationId = 28, - BuiltInLocalInvocationIndex = 29, - BuiltInWorkDim = 30, - BuiltInGlobalSize = 31, - BuiltInEnqueuedWorkgroupSize = 32, - BuiltInGlobalOffset = 33, - BuiltInGlobalLinearId = 34, - BuiltInSubgroupSize = 36, - BuiltInSubgroupMaxSize = 37, - BuiltInNumSubgroups = 38, - BuiltInNumEnqueuedSubgroups = 39, - BuiltInSubgroupId = 40, - BuiltInSubgroupLocalInvocationId = 41, - BuiltInVertexIndex = 42, - BuiltInInstanceIndex = 43, - BuiltInSubgroupEqMaskKHR = 4416, - BuiltInSubgroupGeMaskKHR = 4417, - BuiltInSubgroupGtMaskKHR = 4418, - BuiltInSubgroupLeMaskKHR = 4419, - BuiltInSubgroupLtMaskKHR = 4420, - BuiltInBaseVertex = 4424, - BuiltInBaseInstance = 4425, - BuiltInDrawIndex = 4426, - BuiltInDeviceIndex = 4438, - BuiltInViewIndex = 4440, - BuiltInBaryCoordNoPerspAMD = 4992, - BuiltInBaryCoordNoPerspCentroidAMD = 4993, - BuiltInBaryCoordNoPerspSampleAMD = 4994, - BuiltInBaryCoordSmoothAMD = 4995, - BuiltInBaryCoordSmoothCentroidAMD = 4996, - BuiltInBaryCoordSmoothSampleAMD = 4997, - BuiltInBaryCoordPullModelAMD = 4998, - BuiltInFragStencilRefEXT = 5014, - BuiltInViewportMaskNV = 5253, - BuiltInSecondaryPositionNV = 5257, - BuiltInSecondaryViewportMaskNV = 5258, - BuiltInPositionPerViewNV = 5261, - BuiltInViewportMaskPerViewNV = 5262, - BuiltInMax = 0x7fffffff, -}; - -enum SelectionControlShift { - SelectionControlFlattenShift = 0, - SelectionControlDontFlattenShift = 1, - SelectionControlMax = 0x7fffffff, -}; - -enum SelectionControlMask { - SelectionControlMaskNone = 0, - SelectionControlFlattenMask = 0x00000001, - SelectionControlDontFlattenMask = 0x00000002, -}; - -enum LoopControlShift { - LoopControlUnrollShift = 0, - LoopControlDontUnrollShift = 1, - LoopControlMax = 0x7fffffff, -}; - -enum LoopControlMask { - LoopControlMaskNone = 0, - LoopControlUnrollMask = 0x00000001, - LoopControlDontUnrollMask = 0x00000002, -}; - -enum FunctionControlShift { - FunctionControlInlineShift = 0, - FunctionControlDontInlineShift = 1, - FunctionControlPureShift = 2, - FunctionControlConstShift = 3, - FunctionControlMax = 0x7fffffff, -}; - -enum FunctionControlMask { - FunctionControlMaskNone = 0, - FunctionControlInlineMask = 0x00000001, - FunctionControlDontInlineMask = 0x00000002, - FunctionControlPureMask = 0x00000004, - FunctionControlConstMask = 0x00000008, -}; - -enum MemorySemanticsShift { - MemorySemanticsAcquireShift = 1, - MemorySemanticsReleaseShift = 2, - MemorySemanticsAcquireReleaseShift = 3, - MemorySemanticsSequentiallyConsistentShift = 4, - MemorySemanticsUniformMemoryShift = 6, - MemorySemanticsSubgroupMemoryShift = 7, - MemorySemanticsWorkgroupMemoryShift = 8, - MemorySemanticsCrossWorkgroupMemoryShift = 9, - MemorySemanticsAtomicCounterMemoryShift = 10, - MemorySemanticsImageMemoryShift = 11, - MemorySemanticsMax = 0x7fffffff, -}; - -enum MemorySemanticsMask { - MemorySemanticsMaskNone = 0, - MemorySemanticsAcquireMask = 0x00000002, - MemorySemanticsReleaseMask = 0x00000004, - MemorySemanticsAcquireReleaseMask = 0x00000008, - MemorySemanticsSequentiallyConsistentMask = 0x00000010, - MemorySemanticsUniformMemoryMask = 0x00000040, - MemorySemanticsSubgroupMemoryMask = 0x00000080, - MemorySemanticsWorkgroupMemoryMask = 0x00000100, - MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, - MemorySemanticsAtomicCounterMemoryMask = 0x00000400, - MemorySemanticsImageMemoryMask = 0x00000800, -}; - -enum MemoryAccessShift { - MemoryAccessVolatileShift = 0, - MemoryAccessAlignedShift = 1, - MemoryAccessNontemporalShift = 2, - MemoryAccessMax = 0x7fffffff, -}; - -enum MemoryAccessMask { - MemoryAccessMaskNone = 0, - MemoryAccessVolatileMask = 0x00000001, - MemoryAccessAlignedMask = 0x00000002, - MemoryAccessNontemporalMask = 0x00000004, -}; - -enum Scope { - ScopeCrossDevice = 0, - ScopeDevice = 1, - ScopeWorkgroup = 2, - ScopeSubgroup = 3, - ScopeInvocation = 4, - ScopeMax = 0x7fffffff, -}; - -enum GroupOperation { - GroupOperationReduce = 0, - GroupOperationInclusiveScan = 1, - GroupOperationExclusiveScan = 2, - GroupOperationMax = 0x7fffffff, -}; - -enum KernelEnqueueFlags { - KernelEnqueueFlagsNoWait = 0, - KernelEnqueueFlagsWaitKernel = 1, - KernelEnqueueFlagsWaitWorkGroup = 2, - KernelEnqueueFlagsMax = 0x7fffffff, -}; - -enum KernelProfilingInfoShift { - KernelProfilingInfoCmdExecTimeShift = 0, - KernelProfilingInfoMax = 0x7fffffff, -}; - -enum KernelProfilingInfoMask { - KernelProfilingInfoMaskNone = 0, - KernelProfilingInfoCmdExecTimeMask = 0x00000001, -}; - -enum Capability { - CapabilityMatrix = 0, - CapabilityShader = 1, - CapabilityGeometry = 2, - CapabilityTessellation = 3, - CapabilityAddresses = 4, - CapabilityLinkage = 5, - CapabilityKernel = 6, - CapabilityVector16 = 7, - CapabilityFloat16Buffer = 8, - CapabilityFloat16 = 9, - CapabilityFloat64 = 10, - CapabilityInt64 = 11, - CapabilityInt64Atomics = 12, - CapabilityImageBasic = 13, - CapabilityImageReadWrite = 14, - CapabilityImageMipmap = 15, - CapabilityPipes = 17, - CapabilityGroups = 18, - CapabilityDeviceEnqueue = 19, - CapabilityLiteralSampler = 20, - CapabilityAtomicStorage = 21, - CapabilityInt16 = 22, - CapabilityTessellationPointSize = 23, - CapabilityGeometryPointSize = 24, - CapabilityImageGatherExtended = 25, - CapabilityStorageImageMultisample = 27, - CapabilityUniformBufferArrayDynamicIndexing = 28, - CapabilitySampledImageArrayDynamicIndexing = 29, - CapabilityStorageBufferArrayDynamicIndexing = 30, - CapabilityStorageImageArrayDynamicIndexing = 31, - CapabilityClipDistance = 32, - CapabilityCullDistance = 33, - CapabilityImageCubeArray = 34, - CapabilitySampleRateShading = 35, - CapabilityImageRect = 36, - CapabilitySampledRect = 37, - CapabilityGenericPointer = 38, - CapabilityInt8 = 39, - CapabilityInputAttachment = 40, - CapabilitySparseResidency = 41, - CapabilityMinLod = 42, - CapabilitySampled1D = 43, - CapabilityImage1D = 44, - CapabilitySampledCubeArray = 45, - CapabilitySampledBuffer = 46, - CapabilityImageBuffer = 47, - CapabilityImageMSArray = 48, - CapabilityStorageImageExtendedFormats = 49, - CapabilityImageQuery = 50, - CapabilityDerivativeControl = 51, - CapabilityInterpolationFunction = 52, - CapabilityTransformFeedback = 53, - CapabilityGeometryStreams = 54, - CapabilityStorageImageReadWithoutFormat = 55, - CapabilityStorageImageWriteWithoutFormat = 56, - CapabilityMultiViewport = 57, - CapabilitySubgroupBallotKHR = 4423, - CapabilityDrawParameters = 4427, - CapabilitySubgroupVoteKHR = 4431, - CapabilityStorageBuffer16BitAccess = 4433, - CapabilityStorageUniformBufferBlock16 = 4433, - CapabilityStorageUniform16 = 4434, - CapabilityUniformAndStorageBuffer16BitAccess = 4434, - CapabilityStoragePushConstant16 = 4435, - CapabilityStorageInputOutput16 = 4436, - CapabilityDeviceGroup = 4437, - CapabilityMultiView = 4439, - CapabilityVariablePointersStorageBuffer = 4441, - CapabilityVariablePointers = 4442, - CapabilityAtomicStorageOps = 4445, - CapabilitySampleMaskPostDepthCoverage = 4447, - CapabilityImageGatherBiasLodAMD = 5009, - CapabilityFragmentMaskAMD = 5010, - CapabilityStencilExportEXT = 5013, - CapabilityImageReadWriteLodAMD = 5015, - CapabilitySampleMaskOverrideCoverageNV = 5249, - CapabilityGeometryShaderPassthroughNV = 5251, - CapabilityShaderViewportIndexLayerEXT = 5254, - CapabilityShaderViewportIndexLayerNV = 5254, - CapabilityShaderViewportMaskNV = 5255, - CapabilityShaderStereoViewNV = 5259, - CapabilityPerViewAttributesNV = 5260, - CapabilitySubgroupShuffleINTEL = 5568, - CapabilitySubgroupBufferBlockIOINTEL = 5569, - CapabilitySubgroupImageBlockIOINTEL = 5570, - CapabilityMax = 0x7fffffff, -}; - -enum Op { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpMax = 0x7fffffff, -}; - -// Overload operator| for mask bit combining - -inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } -inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } -inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } -inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } -inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } -inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } -inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } -inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } - -} // end namespace spv - -#endif // #ifndef spirv_HPP - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.hpp11 vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.hpp11 --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.hpp11 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.hpp11 1970-01-01 00:00:00.000000000 +0000 @@ -1,997 +0,0 @@ -// Copyright (c) 2014-2017 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -#ifndef spirv_HPP -#define spirv_HPP - -namespace spv { - -typedef unsigned int Id; - -#define SPV_VERSION 0x10000 -#define SPV_REVISION 12 - -static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010000; -static const unsigned int Revision = 12; -static const unsigned int OpCodeMask = 0xffff; -static const unsigned int WordCountShift = 16; - -enum class SourceLanguage : unsigned { - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - Max = 0x7fffffff, -}; - -enum class ExecutionModel : unsigned { - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - Max = 0x7fffffff, -}; - -enum class AddressingModel : unsigned { - Logical = 0, - Physical32 = 1, - Physical64 = 2, - Max = 0x7fffffff, -}; - -enum class MemoryModel : unsigned { - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - Max = 0x7fffffff, -}; - -enum class ExecutionMode : unsigned { - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - PostDepthCoverage = 4446, - StencilRefReplacingEXT = 5027, - Max = 0x7fffffff, -}; - -enum class StorageClass : unsigned { - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - Max = 0x7fffffff, -}; - -enum class Dim : unsigned { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, - Max = 0x7fffffff, -}; - -enum class SamplerAddressingMode : unsigned { - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, - Max = 0x7fffffff, -}; - -enum class SamplerFilterMode : unsigned { - Nearest = 0, - Linear = 1, - Max = 0x7fffffff, -}; - -enum class ImageFormat : unsigned { - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - Max = 0x7fffffff, -}; - -enum class ImageChannelOrder : unsigned { - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, - Max = 0x7fffffff, -}; - -enum class ImageChannelDataType : unsigned { - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, - Max = 0x7fffffff, -}; - -enum class ImageOperandsShift : unsigned { - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - Max = 0x7fffffff, -}; - -enum class ImageOperandsMask : unsigned { - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, -}; - -enum class FPFastMathModeShift : unsigned { - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - Max = 0x7fffffff, -}; - -enum class FPFastMathModeMask : unsigned { - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, -}; - -enum class FPRoundingMode : unsigned { - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, - Max = 0x7fffffff, -}; - -enum class LinkageType : unsigned { - Export = 0, - Import = 1, - Max = 0x7fffffff, -}; - -enum class AccessQualifier : unsigned { - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, - Max = 0x7fffffff, -}; - -enum class FunctionParameterAttribute : unsigned { - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, - Max = 0x7fffffff, -}; - -enum class Decoration : unsigned { - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - Max = 0x7fffffff, -}; - -enum class BuiltIn : unsigned { - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMaskKHR = 4416, - SubgroupGeMaskKHR = 4417, - SubgroupGtMaskKHR = 4418, - SubgroupLeMaskKHR = 4419, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - DeviceIndex = 4438, - ViewIndex = 4440, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - Max = 0x7fffffff, -}; - -enum class SelectionControlShift : unsigned { - Flatten = 0, - DontFlatten = 1, - Max = 0x7fffffff, -}; - -enum class SelectionControlMask : unsigned { - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, -}; - -enum class LoopControlShift : unsigned { - Unroll = 0, - DontUnroll = 1, - Max = 0x7fffffff, -}; - -enum class LoopControlMask : unsigned { - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, -}; - -enum class FunctionControlShift : unsigned { - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - Max = 0x7fffffff, -}; - -enum class FunctionControlMask : unsigned { - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, -}; - -enum class MemorySemanticsShift : unsigned { - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - Max = 0x7fffffff, -}; - -enum class MemorySemanticsMask : unsigned { - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, -}; - -enum class MemoryAccessShift : unsigned { - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - Max = 0x7fffffff, -}; - -enum class MemoryAccessMask : unsigned { - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, -}; - -enum class Scope : unsigned { - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - Max = 0x7fffffff, -}; - -enum class GroupOperation : unsigned { - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - Max = 0x7fffffff, -}; - -enum class KernelEnqueueFlags : unsigned { - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, - Max = 0x7fffffff, -}; - -enum class KernelProfilingInfoShift : unsigned { - CmdExecTime = 0, - Max = 0x7fffffff, -}; - -enum class KernelProfilingInfoMask : unsigned { - MaskNone = 0, - CmdExecTime = 0x00000001, -}; - -enum class Capability : unsigned { - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - Max = 0x7fffffff, -}; - -enum class Op : unsigned { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - Max = 0x7fffffff, -}; - -// Overload operator| for mask bit combining - -inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } -inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } -inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } -inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } -inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } -inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } -inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } -inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } - -} // end namespace spv - -#endif // #ifndef spirv_HPP - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.json vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.json --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.json 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,1015 +0,0 @@ -{ - "spv": - { - "meta": - { - "Comment": - [ - [ - "Copyright (c) 2014-2017 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - [ - "This header is automatically generated by the same tool that creates", - "the Binary Section of the SPIR-V specification." - ], - [ - "Enumeration tokens for SPIR-V, in various styles:", - " C, C++, C++11, JSON, Lua, Python", - "", - "- C will have tokens with a \"Spv\" prefix, e.g.: SpvSourceLanguageGLSL", - "- C++ will have tokens in the \"spv\" name space, e.g.: spv::SourceLanguageGLSL", - "- C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL", - "- Lua will use tables, e.g.: spv.SourceLanguage.GLSL", - "- Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']", - "", - "Some tokens act like mask values, which can be OR'd together,", - "while others are mutually exclusive. The mask-like ones have", - "\"Mask\" in their name, and a parallel enum that has the shift", - "amount (1 << x) for each corresponding enumerant." - ] - ], - "MagicNumber": 119734787, - "Version": 65536, - "Revision": 12, - "OpCodeMask": 65535, - "WordCountShift": 16 - }, - "enum": - [ - { - "Name": "SourceLanguage", - "Type": "Value", - "Values": - { - "Unknown": 0, - "ESSL": 1, - "GLSL": 2, - "OpenCL_C": 3, - "OpenCL_CPP": 4, - "HLSL": 5 - } - }, - { - "Name": "ExecutionModel", - "Type": "Value", - "Values": - { - "Vertex": 0, - "TessellationControl": 1, - "TessellationEvaluation": 2, - "Geometry": 3, - "Fragment": 4, - "GLCompute": 5, - "Kernel": 6 - } - }, - { - "Name": "AddressingModel", - "Type": "Value", - "Values": - { - "Logical": 0, - "Physical32": 1, - "Physical64": 2 - } - }, - { - "Name": "MemoryModel", - "Type": "Value", - "Values": - { - "Simple": 0, - "GLSL450": 1, - "OpenCL": 2 - } - }, - { - "Name": "ExecutionMode", - "Type": "Value", - "Values": - { - "Invocations": 0, - "SpacingEqual": 1, - "SpacingFractionalEven": 2, - "SpacingFractionalOdd": 3, - "VertexOrderCw": 4, - "VertexOrderCcw": 5, - "PixelCenterInteger": 6, - "OriginUpperLeft": 7, - "OriginLowerLeft": 8, - "EarlyFragmentTests": 9, - "PointMode": 10, - "Xfb": 11, - "DepthReplacing": 12, - "DepthGreater": 14, - "DepthLess": 15, - "DepthUnchanged": 16, - "LocalSize": 17, - "LocalSizeHint": 18, - "InputPoints": 19, - "InputLines": 20, - "InputLinesAdjacency": 21, - "Triangles": 22, - "InputTrianglesAdjacency": 23, - "Quads": 24, - "Isolines": 25, - "OutputVertices": 26, - "OutputPoints": 27, - "OutputLineStrip": 28, - "OutputTriangleStrip": 29, - "VecTypeHint": 30, - "ContractionOff": 31, - "PostDepthCoverage": 4446, - "StencilRefReplacingEXT": 5027 - } - }, - { - "Name": "StorageClass", - "Type": "Value", - "Values": - { - "UniformConstant": 0, - "Input": 1, - "Uniform": 2, - "Output": 3, - "Workgroup": 4, - "CrossWorkgroup": 5, - "Private": 6, - "Function": 7, - "Generic": 8, - "PushConstant": 9, - "AtomicCounter": 10, - "Image": 11, - "StorageBuffer": 12 - } - }, - { - "Name": "Dim", - "Type": "Value", - "Values": - { - "Dim1D": 0, - "Dim2D": 1, - "Dim3D": 2, - "Cube": 3, - "Rect": 4, - "Buffer": 5, - "SubpassData": 6 - } - }, - { - "Name": "SamplerAddressingMode", - "Type": "Value", - "Values": - { - "None": 0, - "ClampToEdge": 1, - "Clamp": 2, - "Repeat": 3, - "RepeatMirrored": 4 - } - }, - { - "Name": "SamplerFilterMode", - "Type": "Value", - "Values": - { - "Nearest": 0, - "Linear": 1 - } - }, - { - "Name": "ImageFormat", - "Type": "Value", - "Values": - { - "Unknown": 0, - "Rgba32f": 1, - "Rgba16f": 2, - "R32f": 3, - "Rgba8": 4, - "Rgba8Snorm": 5, - "Rg32f": 6, - "Rg16f": 7, - "R11fG11fB10f": 8, - "R16f": 9, - "Rgba16": 10, - "Rgb10A2": 11, - "Rg16": 12, - "Rg8": 13, - "R16": 14, - "R8": 15, - "Rgba16Snorm": 16, - "Rg16Snorm": 17, - "Rg8Snorm": 18, - "R16Snorm": 19, - "R8Snorm": 20, - "Rgba32i": 21, - "Rgba16i": 22, - "Rgba8i": 23, - "R32i": 24, - "Rg32i": 25, - "Rg16i": 26, - "Rg8i": 27, - "R16i": 28, - "R8i": 29, - "Rgba32ui": 30, - "Rgba16ui": 31, - "Rgba8ui": 32, - "R32ui": 33, - "Rgb10a2ui": 34, - "Rg32ui": 35, - "Rg16ui": 36, - "Rg8ui": 37, - "R16ui": 38, - "R8ui": 39 - } - }, - { - "Name": "ImageChannelOrder", - "Type": "Value", - "Values": - { - "R": 0, - "A": 1, - "RG": 2, - "RA": 3, - "RGB": 4, - "RGBA": 5, - "BGRA": 6, - "ARGB": 7, - "Intensity": 8, - "Luminance": 9, - "Rx": 10, - "RGx": 11, - "RGBx": 12, - "Depth": 13, - "DepthStencil": 14, - "sRGB": 15, - "sRGBx": 16, - "sRGBA": 17, - "sBGRA": 18, - "ABGR": 19 - } - }, - { - "Name": "ImageChannelDataType", - "Type": "Value", - "Values": - { - "SnormInt8": 0, - "SnormInt16": 1, - "UnormInt8": 2, - "UnormInt16": 3, - "UnormShort565": 4, - "UnormShort555": 5, - "UnormInt101010": 6, - "SignedInt8": 7, - "SignedInt16": 8, - "SignedInt32": 9, - "UnsignedInt8": 10, - "UnsignedInt16": 11, - "UnsignedInt32": 12, - "HalfFloat": 13, - "Float": 14, - "UnormInt24": 15, - "UnormInt101010_2": 16 - } - }, - { - "Name": "ImageOperands", - "Type": "Bit", - "Values": - { - "Bias": 0, - "Lod": 1, - "Grad": 2, - "ConstOffset": 3, - "Offset": 4, - "ConstOffsets": 5, - "Sample": 6, - "MinLod": 7 - } - }, - { - "Name": "FPFastMathMode", - "Type": "Bit", - "Values": - { - "NotNaN": 0, - "NotInf": 1, - "NSZ": 2, - "AllowRecip": 3, - "Fast": 4 - } - }, - { - "Name": "FPRoundingMode", - "Type": "Value", - "Values": - { - "RTE": 0, - "RTZ": 1, - "RTP": 2, - "RTN": 3 - } - }, - { - "Name": "LinkageType", - "Type": "Value", - "Values": - { - "Export": 0, - "Import": 1 - } - }, - { - "Name": "AccessQualifier", - "Type": "Value", - "Values": - { - "ReadOnly": 0, - "WriteOnly": 1, - "ReadWrite": 2 - } - }, - { - "Name": "FunctionParameterAttribute", - "Type": "Value", - "Values": - { - "Zext": 0, - "Sext": 1, - "ByVal": 2, - "Sret": 3, - "NoAlias": 4, - "NoCapture": 5, - "NoWrite": 6, - "NoReadWrite": 7 - } - }, - { - "Name": "Decoration", - "Type": "Value", - "Values": - { - "RelaxedPrecision": 0, - "SpecId": 1, - "Block": 2, - "BufferBlock": 3, - "RowMajor": 4, - "ColMajor": 5, - "ArrayStride": 6, - "MatrixStride": 7, - "GLSLShared": 8, - "GLSLPacked": 9, - "CPacked": 10, - "BuiltIn": 11, - "NoPerspective": 13, - "Flat": 14, - "Patch": 15, - "Centroid": 16, - "Sample": 17, - "Invariant": 18, - "Restrict": 19, - "Aliased": 20, - "Volatile": 21, - "Constant": 22, - "Coherent": 23, - "NonWritable": 24, - "NonReadable": 25, - "Uniform": 26, - "SaturatedConversion": 28, - "Stream": 29, - "Location": 30, - "Component": 31, - "Index": 32, - "Binding": 33, - "DescriptorSet": 34, - "Offset": 35, - "XfbBuffer": 36, - "XfbStride": 37, - "FuncParamAttr": 38, - "FPRoundingMode": 39, - "FPFastMathMode": 40, - "LinkageAttributes": 41, - "NoContraction": 42, - "InputAttachmentIndex": 43, - "Alignment": 44, - "ExplicitInterpAMD": 4999, - "OverrideCoverageNV": 5248, - "PassthroughNV": 5250, - "ViewportRelativeNV": 5252, - "SecondaryViewportRelativeNV": 5256 - } - }, - { - "Name": "BuiltIn", - "Type": "Value", - "Values": - { - "Position": 0, - "PointSize": 1, - "ClipDistance": 3, - "CullDistance": 4, - "VertexId": 5, - "InstanceId": 6, - "PrimitiveId": 7, - "InvocationId": 8, - "Layer": 9, - "ViewportIndex": 10, - "TessLevelOuter": 11, - "TessLevelInner": 12, - "TessCoord": 13, - "PatchVertices": 14, - "FragCoord": 15, - "PointCoord": 16, - "FrontFacing": 17, - "SampleId": 18, - "SamplePosition": 19, - "SampleMask": 20, - "FragDepth": 22, - "HelperInvocation": 23, - "NumWorkgroups": 24, - "WorkgroupSize": 25, - "WorkgroupId": 26, - "LocalInvocationId": 27, - "GlobalInvocationId": 28, - "LocalInvocationIndex": 29, - "WorkDim": 30, - "GlobalSize": 31, - "EnqueuedWorkgroupSize": 32, - "GlobalOffset": 33, - "GlobalLinearId": 34, - "SubgroupSize": 36, - "SubgroupMaxSize": 37, - "NumSubgroups": 38, - "NumEnqueuedSubgroups": 39, - "SubgroupId": 40, - "SubgroupLocalInvocationId": 41, - "VertexIndex": 42, - "InstanceIndex": 43, - "SubgroupEqMaskKHR": 4416, - "SubgroupGeMaskKHR": 4417, - "SubgroupGtMaskKHR": 4418, - "SubgroupLeMaskKHR": 4419, - "SubgroupLtMaskKHR": 4420, - "BaseVertex": 4424, - "BaseInstance": 4425, - "DrawIndex": 4426, - "DeviceIndex": 4438, - "ViewIndex": 4440, - "BaryCoordNoPerspAMD": 4992, - "BaryCoordNoPerspCentroidAMD": 4993, - "BaryCoordNoPerspSampleAMD": 4994, - "BaryCoordSmoothAMD": 4995, - "BaryCoordSmoothCentroidAMD": 4996, - "BaryCoordSmoothSampleAMD": 4997, - "BaryCoordPullModelAMD": 4998, - "FragStencilRefEXT": 5014, - "ViewportMaskNV": 5253, - "SecondaryPositionNV": 5257, - "SecondaryViewportMaskNV": 5258, - "PositionPerViewNV": 5261, - "ViewportMaskPerViewNV": 5262 - } - }, - { - "Name": "SelectionControl", - "Type": "Bit", - "Values": - { - "Flatten": 0, - "DontFlatten": 1 - } - }, - { - "Name": "LoopControl", - "Type": "Bit", - "Values": - { - "Unroll": 0, - "DontUnroll": 1 - } - }, - { - "Name": "FunctionControl", - "Type": "Bit", - "Values": - { - "Inline": 0, - "DontInline": 1, - "Pure": 2, - "Const": 3 - } - }, - { - "Name": "MemorySemantics", - "Type": "Bit", - "Values": - { - "Acquire": 1, - "Release": 2, - "AcquireRelease": 3, - "SequentiallyConsistent": 4, - "UniformMemory": 6, - "SubgroupMemory": 7, - "WorkgroupMemory": 8, - "CrossWorkgroupMemory": 9, - "AtomicCounterMemory": 10, - "ImageMemory": 11 - } - }, - { - "Name": "MemoryAccess", - "Type": "Bit", - "Values": - { - "Volatile": 0, - "Aligned": 1, - "Nontemporal": 2 - } - }, - { - "Name": "Scope", - "Type": "Value", - "Values": - { - "CrossDevice": 0, - "Device": 1, - "Workgroup": 2, - "Subgroup": 3, - "Invocation": 4 - } - }, - { - "Name": "GroupOperation", - "Type": "Value", - "Values": - { - "Reduce": 0, - "InclusiveScan": 1, - "ExclusiveScan": 2 - } - }, - { - "Name": "KernelEnqueueFlags", - "Type": "Value", - "Values": - { - "NoWait": 0, - "WaitKernel": 1, - "WaitWorkGroup": 2 - } - }, - { - "Name": "KernelProfilingInfo", - "Type": "Bit", - "Values": - { - "CmdExecTime": 0 - } - }, - { - "Name": "Capability", - "Type": "Value", - "Values": - { - "Matrix": 0, - "Shader": 1, - "Geometry": 2, - "Tessellation": 3, - "Addresses": 4, - "Linkage": 5, - "Kernel": 6, - "Vector16": 7, - "Float16Buffer": 8, - "Float16": 9, - "Float64": 10, - "Int64": 11, - "Int64Atomics": 12, - "ImageBasic": 13, - "ImageReadWrite": 14, - "ImageMipmap": 15, - "Pipes": 17, - "Groups": 18, - "DeviceEnqueue": 19, - "LiteralSampler": 20, - "AtomicStorage": 21, - "Int16": 22, - "TessellationPointSize": 23, - "GeometryPointSize": 24, - "ImageGatherExtended": 25, - "StorageImageMultisample": 27, - "UniformBufferArrayDynamicIndexing": 28, - "SampledImageArrayDynamicIndexing": 29, - "StorageBufferArrayDynamicIndexing": 30, - "StorageImageArrayDynamicIndexing": 31, - "ClipDistance": 32, - "CullDistance": 33, - "ImageCubeArray": 34, - "SampleRateShading": 35, - "ImageRect": 36, - "SampledRect": 37, - "GenericPointer": 38, - "Int8": 39, - "InputAttachment": 40, - "SparseResidency": 41, - "MinLod": 42, - "Sampled1D": 43, - "Image1D": 44, - "SampledCubeArray": 45, - "SampledBuffer": 46, - "ImageBuffer": 47, - "ImageMSArray": 48, - "StorageImageExtendedFormats": 49, - "ImageQuery": 50, - "DerivativeControl": 51, - "InterpolationFunction": 52, - "TransformFeedback": 53, - "GeometryStreams": 54, - "StorageImageReadWithoutFormat": 55, - "StorageImageWriteWithoutFormat": 56, - "MultiViewport": 57, - "SubgroupBallotKHR": 4423, - "DrawParameters": 4427, - "SubgroupVoteKHR": 4431, - "StorageBuffer16BitAccess": 4433, - "StorageUniformBufferBlock16": 4433, - "StorageUniform16": 4434, - "UniformAndStorageBuffer16BitAccess": 4434, - "StoragePushConstant16": 4435, - "StorageInputOutput16": 4436, - "DeviceGroup": 4437, - "MultiView": 4439, - "VariablePointersStorageBuffer": 4441, - "VariablePointers": 4442, - "AtomicStorageOps": 4445, - "SampleMaskPostDepthCoverage": 4447, - "ImageGatherBiasLodAMD": 5009, - "FragmentMaskAMD": 5010, - "StencilExportEXT": 5013, - "ImageReadWriteLodAMD": 5015, - "SampleMaskOverrideCoverageNV": 5249, - "GeometryShaderPassthroughNV": 5251, - "ShaderViewportIndexLayerEXT": 5254, - "ShaderViewportIndexLayerNV": 5254, - "ShaderViewportMaskNV": 5255, - "ShaderStereoViewNV": 5259, - "PerViewAttributesNV": 5260, - "SubgroupShuffleINTEL": 5568, - "SubgroupBufferBlockIOINTEL": 5569, - "SubgroupImageBlockIOINTEL": 5570 - } - }, - { - "Name": "Op", - "Type": "Value", - "Values": - { - "OpNop": 0, - "OpUndef": 1, - "OpSourceContinued": 2, - "OpSource": 3, - "OpSourceExtension": 4, - "OpName": 5, - "OpMemberName": 6, - "OpString": 7, - "OpLine": 8, - "OpExtension": 10, - "OpExtInstImport": 11, - "OpExtInst": 12, - "OpMemoryModel": 14, - "OpEntryPoint": 15, - "OpExecutionMode": 16, - "OpCapability": 17, - "OpTypeVoid": 19, - "OpTypeBool": 20, - "OpTypeInt": 21, - "OpTypeFloat": 22, - "OpTypeVector": 23, - "OpTypeMatrix": 24, - "OpTypeImage": 25, - "OpTypeSampler": 26, - "OpTypeSampledImage": 27, - "OpTypeArray": 28, - "OpTypeRuntimeArray": 29, - "OpTypeStruct": 30, - "OpTypeOpaque": 31, - "OpTypePointer": 32, - "OpTypeFunction": 33, - "OpTypeEvent": 34, - "OpTypeDeviceEvent": 35, - "OpTypeReserveId": 36, - "OpTypeQueue": 37, - "OpTypePipe": 38, - "OpTypeForwardPointer": 39, - "OpConstantTrue": 41, - "OpConstantFalse": 42, - "OpConstant": 43, - "OpConstantComposite": 44, - "OpConstantSampler": 45, - "OpConstantNull": 46, - "OpSpecConstantTrue": 48, - "OpSpecConstantFalse": 49, - "OpSpecConstant": 50, - "OpSpecConstantComposite": 51, - "OpSpecConstantOp": 52, - "OpFunction": 54, - "OpFunctionParameter": 55, - "OpFunctionEnd": 56, - "OpFunctionCall": 57, - "OpVariable": 59, - "OpImageTexelPointer": 60, - "OpLoad": 61, - "OpStore": 62, - "OpCopyMemory": 63, - "OpCopyMemorySized": 64, - "OpAccessChain": 65, - "OpInBoundsAccessChain": 66, - "OpPtrAccessChain": 67, - "OpArrayLength": 68, - "OpGenericPtrMemSemantics": 69, - "OpInBoundsPtrAccessChain": 70, - "OpDecorate": 71, - "OpMemberDecorate": 72, - "OpDecorationGroup": 73, - "OpGroupDecorate": 74, - "OpGroupMemberDecorate": 75, - "OpVectorExtractDynamic": 77, - "OpVectorInsertDynamic": 78, - "OpVectorShuffle": 79, - "OpCompositeConstruct": 80, - "OpCompositeExtract": 81, - "OpCompositeInsert": 82, - "OpCopyObject": 83, - "OpTranspose": 84, - "OpSampledImage": 86, - "OpImageSampleImplicitLod": 87, - "OpImageSampleExplicitLod": 88, - "OpImageSampleDrefImplicitLod": 89, - "OpImageSampleDrefExplicitLod": 90, - "OpImageSampleProjImplicitLod": 91, - "OpImageSampleProjExplicitLod": 92, - "OpImageSampleProjDrefImplicitLod": 93, - "OpImageSampleProjDrefExplicitLod": 94, - "OpImageFetch": 95, - "OpImageGather": 96, - "OpImageDrefGather": 97, - "OpImageRead": 98, - "OpImageWrite": 99, - "OpImage": 100, - "OpImageQueryFormat": 101, - "OpImageQueryOrder": 102, - "OpImageQuerySizeLod": 103, - "OpImageQuerySize": 104, - "OpImageQueryLod": 105, - "OpImageQueryLevels": 106, - "OpImageQuerySamples": 107, - "OpConvertFToU": 109, - "OpConvertFToS": 110, - "OpConvertSToF": 111, - "OpConvertUToF": 112, - "OpUConvert": 113, - "OpSConvert": 114, - "OpFConvert": 115, - "OpQuantizeToF16": 116, - "OpConvertPtrToU": 117, - "OpSatConvertSToU": 118, - "OpSatConvertUToS": 119, - "OpConvertUToPtr": 120, - "OpPtrCastToGeneric": 121, - "OpGenericCastToPtr": 122, - "OpGenericCastToPtrExplicit": 123, - "OpBitcast": 124, - "OpSNegate": 126, - "OpFNegate": 127, - "OpIAdd": 128, - "OpFAdd": 129, - "OpISub": 130, - "OpFSub": 131, - "OpIMul": 132, - "OpFMul": 133, - "OpUDiv": 134, - "OpSDiv": 135, - "OpFDiv": 136, - "OpUMod": 137, - "OpSRem": 138, - "OpSMod": 139, - "OpFRem": 140, - "OpFMod": 141, - "OpVectorTimesScalar": 142, - "OpMatrixTimesScalar": 143, - "OpVectorTimesMatrix": 144, - "OpMatrixTimesVector": 145, - "OpMatrixTimesMatrix": 146, - "OpOuterProduct": 147, - "OpDot": 148, - "OpIAddCarry": 149, - "OpISubBorrow": 150, - "OpUMulExtended": 151, - "OpSMulExtended": 152, - "OpAny": 154, - "OpAll": 155, - "OpIsNan": 156, - "OpIsInf": 157, - "OpIsFinite": 158, - "OpIsNormal": 159, - "OpSignBitSet": 160, - "OpLessOrGreater": 161, - "OpOrdered": 162, - "OpUnordered": 163, - "OpLogicalEqual": 164, - "OpLogicalNotEqual": 165, - "OpLogicalOr": 166, - "OpLogicalAnd": 167, - "OpLogicalNot": 168, - "OpSelect": 169, - "OpIEqual": 170, - "OpINotEqual": 171, - "OpUGreaterThan": 172, - "OpSGreaterThan": 173, - "OpUGreaterThanEqual": 174, - "OpSGreaterThanEqual": 175, - "OpULessThan": 176, - "OpSLessThan": 177, - "OpULessThanEqual": 178, - "OpSLessThanEqual": 179, - "OpFOrdEqual": 180, - "OpFUnordEqual": 181, - "OpFOrdNotEqual": 182, - "OpFUnordNotEqual": 183, - "OpFOrdLessThan": 184, - "OpFUnordLessThan": 185, - "OpFOrdGreaterThan": 186, - "OpFUnordGreaterThan": 187, - "OpFOrdLessThanEqual": 188, - "OpFUnordLessThanEqual": 189, - "OpFOrdGreaterThanEqual": 190, - "OpFUnordGreaterThanEqual": 191, - "OpShiftRightLogical": 194, - "OpShiftRightArithmetic": 195, - "OpShiftLeftLogical": 196, - "OpBitwiseOr": 197, - "OpBitwiseXor": 198, - "OpBitwiseAnd": 199, - "OpNot": 200, - "OpBitFieldInsert": 201, - "OpBitFieldSExtract": 202, - "OpBitFieldUExtract": 203, - "OpBitReverse": 204, - "OpBitCount": 205, - "OpDPdx": 207, - "OpDPdy": 208, - "OpFwidth": 209, - "OpDPdxFine": 210, - "OpDPdyFine": 211, - "OpFwidthFine": 212, - "OpDPdxCoarse": 213, - "OpDPdyCoarse": 214, - "OpFwidthCoarse": 215, - "OpEmitVertex": 218, - "OpEndPrimitive": 219, - "OpEmitStreamVertex": 220, - "OpEndStreamPrimitive": 221, - "OpControlBarrier": 224, - "OpMemoryBarrier": 225, - "OpAtomicLoad": 227, - "OpAtomicStore": 228, - "OpAtomicExchange": 229, - "OpAtomicCompareExchange": 230, - "OpAtomicCompareExchangeWeak": 231, - "OpAtomicIIncrement": 232, - "OpAtomicIDecrement": 233, - "OpAtomicIAdd": 234, - "OpAtomicISub": 235, - "OpAtomicSMin": 236, - "OpAtomicUMin": 237, - "OpAtomicSMax": 238, - "OpAtomicUMax": 239, - "OpAtomicAnd": 240, - "OpAtomicOr": 241, - "OpAtomicXor": 242, - "OpPhi": 245, - "OpLoopMerge": 246, - "OpSelectionMerge": 247, - "OpLabel": 248, - "OpBranch": 249, - "OpBranchConditional": 250, - "OpSwitch": 251, - "OpKill": 252, - "OpReturn": 253, - "OpReturnValue": 254, - "OpUnreachable": 255, - "OpLifetimeStart": 256, - "OpLifetimeStop": 257, - "OpGroupAsyncCopy": 259, - "OpGroupWaitEvents": 260, - "OpGroupAll": 261, - "OpGroupAny": 262, - "OpGroupBroadcast": 263, - "OpGroupIAdd": 264, - "OpGroupFAdd": 265, - "OpGroupFMin": 266, - "OpGroupUMin": 267, - "OpGroupSMin": 268, - "OpGroupFMax": 269, - "OpGroupUMax": 270, - "OpGroupSMax": 271, - "OpReadPipe": 274, - "OpWritePipe": 275, - "OpReservedReadPipe": 276, - "OpReservedWritePipe": 277, - "OpReserveReadPipePackets": 278, - "OpReserveWritePipePackets": 279, - "OpCommitReadPipe": 280, - "OpCommitWritePipe": 281, - "OpIsValidReserveId": 282, - "OpGetNumPipePackets": 283, - "OpGetMaxPipePackets": 284, - "OpGroupReserveReadPipePackets": 285, - "OpGroupReserveWritePipePackets": 286, - "OpGroupCommitReadPipe": 287, - "OpGroupCommitWritePipe": 288, - "OpEnqueueMarker": 291, - "OpEnqueueKernel": 292, - "OpGetKernelNDrangeSubGroupCount": 293, - "OpGetKernelNDrangeMaxSubGroupSize": 294, - "OpGetKernelWorkGroupSize": 295, - "OpGetKernelPreferredWorkGroupSizeMultiple": 296, - "OpRetainEvent": 297, - "OpReleaseEvent": 298, - "OpCreateUserEvent": 299, - "OpIsValidEvent": 300, - "OpSetUserEventStatus": 301, - "OpCaptureEventProfilingInfo": 302, - "OpGetDefaultQueue": 303, - "OpBuildNDRange": 304, - "OpImageSparseSampleImplicitLod": 305, - "OpImageSparseSampleExplicitLod": 306, - "OpImageSparseSampleDrefImplicitLod": 307, - "OpImageSparseSampleDrefExplicitLod": 308, - "OpImageSparseSampleProjImplicitLod": 309, - "OpImageSparseSampleProjExplicitLod": 310, - "OpImageSparseSampleProjDrefImplicitLod": 311, - "OpImageSparseSampleProjDrefExplicitLod": 312, - "OpImageSparseFetch": 313, - "OpImageSparseGather": 314, - "OpImageSparseDrefGather": 315, - "OpImageSparseTexelsResident": 316, - "OpNoLine": 317, - "OpAtomicFlagTestAndSet": 318, - "OpAtomicFlagClear": 319, - "OpImageSparseRead": 320, - "OpSubgroupBallotKHR": 4421, - "OpSubgroupFirstInvocationKHR": 4422, - "OpSubgroupAllKHR": 4428, - "OpSubgroupAnyKHR": 4429, - "OpSubgroupAllEqualKHR": 4430, - "OpSubgroupReadInvocationKHR": 4432, - "OpGroupIAddNonUniformAMD": 5000, - "OpGroupFAddNonUniformAMD": 5001, - "OpGroupFMinNonUniformAMD": 5002, - "OpGroupUMinNonUniformAMD": 5003, - "OpGroupSMinNonUniformAMD": 5004, - "OpGroupFMaxNonUniformAMD": 5005, - "OpGroupUMaxNonUniformAMD": 5006, - "OpGroupSMaxNonUniformAMD": 5007, - "OpFragmentMaskFetchAMD": 5011, - "OpFragmentFetchAMD": 5012, - "OpSubgroupShuffleINTEL": 5571, - "OpSubgroupShuffleDownINTEL": 5572, - "OpSubgroupShuffleUpINTEL": 5573, - "OpSubgroupShuffleXorINTEL": 5574, - "OpSubgroupBlockReadINTEL": 5575, - "OpSubgroupBlockWriteINTEL": 5576, - "OpSubgroupImageBlockReadINTEL": 5577, - "OpSubgroupImageBlockWriteINTEL": 5578 - } - } - ] - } -} - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.lua vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.lua --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.lua 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.lua 1970-01-01 00:00:00.000000000 +0000 @@ -1,944 +0,0 @@ --- Copyright (c) 2014-2017 The Khronos Group Inc. --- --- Permission is hereby granted, free of charge, to any person obtaining a copy --- of this software and/or associated documentation files (the "Materials"), --- to deal in the Materials without restriction, including without limitation --- the rights to use, copy, modify, merge, publish, distribute, sublicense, --- and/or sell copies of the Materials, and to permit persons to whom the --- Materials are furnished to do so, subject to the following conditions: --- --- The above copyright notice and this permission notice shall be included in --- all copies or substantial portions of the Materials. --- --- MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS --- STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND --- HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ --- --- THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL --- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING --- FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS --- IN THE MATERIALS. - --- This header is automatically generated by the same tool that creates --- the Binary Section of the SPIR-V specification. - --- Enumeration tokens for SPIR-V, in various styles: --- C, C++, C++11, JSON, Lua, Python --- --- - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL --- - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL --- - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL --- - Lua will use tables, e.g.: spv.SourceLanguage.GLSL --- - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] --- --- Some tokens act like mask values, which can be OR'd together, --- while others are mutually exclusive. The mask-like ones have --- "Mask" in their name, and a parallel enum that has the shift --- amount (1 << x) for each corresponding enumerant. - -spv = { - MagicNumber = 0x07230203, - Version = 0x00010000, - Revision = 12, - OpCodeMask = 0xffff, - WordCountShift = 16, - - SourceLanguage = { - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - }, - - ExecutionModel = { - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - }, - - AddressingModel = { - Logical = 0, - Physical32 = 1, - Physical64 = 2, - }, - - MemoryModel = { - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - }, - - ExecutionMode = { - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - PostDepthCoverage = 4446, - StencilRefReplacingEXT = 5027, - }, - - StorageClass = { - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - }, - - Dim = { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, - }, - - SamplerAddressingMode = { - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, - }, - - SamplerFilterMode = { - Nearest = 0, - Linear = 1, - }, - - ImageFormat = { - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - }, - - ImageChannelOrder = { - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, - }, - - ImageChannelDataType = { - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, - }, - - ImageOperandsShift = { - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - }, - - ImageOperandsMask = { - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, - }, - - FPFastMathModeShift = { - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - }, - - FPFastMathModeMask = { - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, - }, - - FPRoundingMode = { - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, - }, - - LinkageType = { - Export = 0, - Import = 1, - }, - - AccessQualifier = { - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, - }, - - FunctionParameterAttribute = { - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, - }, - - Decoration = { - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - }, - - BuiltIn = { - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMaskKHR = 4416, - SubgroupGeMaskKHR = 4417, - SubgroupGtMaskKHR = 4418, - SubgroupLeMaskKHR = 4419, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - DeviceIndex = 4438, - ViewIndex = 4440, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - }, - - SelectionControlShift = { - Flatten = 0, - DontFlatten = 1, - }, - - SelectionControlMask = { - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, - }, - - LoopControlShift = { - Unroll = 0, - DontUnroll = 1, - }, - - LoopControlMask = { - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, - }, - - FunctionControlShift = { - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - }, - - FunctionControlMask = { - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, - }, - - MemorySemanticsShift = { - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - }, - - MemorySemanticsMask = { - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, - }, - - MemoryAccessShift = { - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - }, - - MemoryAccessMask = { - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, - }, - - Scope = { - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - }, - - GroupOperation = { - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - }, - - KernelEnqueueFlags = { - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, - }, - - KernelProfilingInfoShift = { - CmdExecTime = 0, - }, - - KernelProfilingInfoMask = { - MaskNone = 0, - CmdExecTime = 0x00000001, - }, - - Capability = { - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - }, - - Op = { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - }, - -} - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.py vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.py --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.py 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.0/spirv.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,944 +0,0 @@ -# Copyright (c) 2014-2017 The Khronos Group Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and/or associated documentation files (the "Materials"), -# to deal in the Materials without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Materials, and to permit persons to whom the -# Materials are furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Materials. -# -# MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -# STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -# HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -# -# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -# IN THE MATERIALS. - -# This header is automatically generated by the same tool that creates -# the Binary Section of the SPIR-V specification. - -# Enumeration tokens for SPIR-V, in various styles: -# C, C++, C++11, JSON, Lua, Python -# -# - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -# - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -# - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -# - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -# - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -# -# Some tokens act like mask values, which can be OR'd together, -# while others are mutually exclusive. The mask-like ones have -# "Mask" in their name, and a parallel enum that has the shift -# amount (1 << x) for each corresponding enumerant. - -spv = { - 'MagicNumber' : 0x07230203, - 'Version' : 0x00010000, - 'Revision' : 12, - 'OpCodeMask' : 0xffff, - 'WordCountShift' : 16, - - 'SourceLanguage' : { - 'Unknown' : 0, - 'ESSL' : 1, - 'GLSL' : 2, - 'OpenCL_C' : 3, - 'OpenCL_CPP' : 4, - 'HLSL' : 5, - }, - - 'ExecutionModel' : { - 'Vertex' : 0, - 'TessellationControl' : 1, - 'TessellationEvaluation' : 2, - 'Geometry' : 3, - 'Fragment' : 4, - 'GLCompute' : 5, - 'Kernel' : 6, - }, - - 'AddressingModel' : { - 'Logical' : 0, - 'Physical32' : 1, - 'Physical64' : 2, - }, - - 'MemoryModel' : { - 'Simple' : 0, - 'GLSL450' : 1, - 'OpenCL' : 2, - }, - - 'ExecutionMode' : { - 'Invocations' : 0, - 'SpacingEqual' : 1, - 'SpacingFractionalEven' : 2, - 'SpacingFractionalOdd' : 3, - 'VertexOrderCw' : 4, - 'VertexOrderCcw' : 5, - 'PixelCenterInteger' : 6, - 'OriginUpperLeft' : 7, - 'OriginLowerLeft' : 8, - 'EarlyFragmentTests' : 9, - 'PointMode' : 10, - 'Xfb' : 11, - 'DepthReplacing' : 12, - 'DepthGreater' : 14, - 'DepthLess' : 15, - 'DepthUnchanged' : 16, - 'LocalSize' : 17, - 'LocalSizeHint' : 18, - 'InputPoints' : 19, - 'InputLines' : 20, - 'InputLinesAdjacency' : 21, - 'Triangles' : 22, - 'InputTrianglesAdjacency' : 23, - 'Quads' : 24, - 'Isolines' : 25, - 'OutputVertices' : 26, - 'OutputPoints' : 27, - 'OutputLineStrip' : 28, - 'OutputTriangleStrip' : 29, - 'VecTypeHint' : 30, - 'ContractionOff' : 31, - 'PostDepthCoverage' : 4446, - 'StencilRefReplacingEXT' : 5027, - }, - - 'StorageClass' : { - 'UniformConstant' : 0, - 'Input' : 1, - 'Uniform' : 2, - 'Output' : 3, - 'Workgroup' : 4, - 'CrossWorkgroup' : 5, - 'Private' : 6, - 'Function' : 7, - 'Generic' : 8, - 'PushConstant' : 9, - 'AtomicCounter' : 10, - 'Image' : 11, - 'StorageBuffer' : 12, - }, - - 'Dim' : { - 'Dim1D' : 0, - 'Dim2D' : 1, - 'Dim3D' : 2, - 'Cube' : 3, - 'Rect' : 4, - 'Buffer' : 5, - 'SubpassData' : 6, - }, - - 'SamplerAddressingMode' : { - 'None' : 0, - 'ClampToEdge' : 1, - 'Clamp' : 2, - 'Repeat' : 3, - 'RepeatMirrored' : 4, - }, - - 'SamplerFilterMode' : { - 'Nearest' : 0, - 'Linear' : 1, - }, - - 'ImageFormat' : { - 'Unknown' : 0, - 'Rgba32f' : 1, - 'Rgba16f' : 2, - 'R32f' : 3, - 'Rgba8' : 4, - 'Rgba8Snorm' : 5, - 'Rg32f' : 6, - 'Rg16f' : 7, - 'R11fG11fB10f' : 8, - 'R16f' : 9, - 'Rgba16' : 10, - 'Rgb10A2' : 11, - 'Rg16' : 12, - 'Rg8' : 13, - 'R16' : 14, - 'R8' : 15, - 'Rgba16Snorm' : 16, - 'Rg16Snorm' : 17, - 'Rg8Snorm' : 18, - 'R16Snorm' : 19, - 'R8Snorm' : 20, - 'Rgba32i' : 21, - 'Rgba16i' : 22, - 'Rgba8i' : 23, - 'R32i' : 24, - 'Rg32i' : 25, - 'Rg16i' : 26, - 'Rg8i' : 27, - 'R16i' : 28, - 'R8i' : 29, - 'Rgba32ui' : 30, - 'Rgba16ui' : 31, - 'Rgba8ui' : 32, - 'R32ui' : 33, - 'Rgb10a2ui' : 34, - 'Rg32ui' : 35, - 'Rg16ui' : 36, - 'Rg8ui' : 37, - 'R16ui' : 38, - 'R8ui' : 39, - }, - - 'ImageChannelOrder' : { - 'R' : 0, - 'A' : 1, - 'RG' : 2, - 'RA' : 3, - 'RGB' : 4, - 'RGBA' : 5, - 'BGRA' : 6, - 'ARGB' : 7, - 'Intensity' : 8, - 'Luminance' : 9, - 'Rx' : 10, - 'RGx' : 11, - 'RGBx' : 12, - 'Depth' : 13, - 'DepthStencil' : 14, - 'sRGB' : 15, - 'sRGBx' : 16, - 'sRGBA' : 17, - 'sBGRA' : 18, - 'ABGR' : 19, - }, - - 'ImageChannelDataType' : { - 'SnormInt8' : 0, - 'SnormInt16' : 1, - 'UnormInt8' : 2, - 'UnormInt16' : 3, - 'UnormShort565' : 4, - 'UnormShort555' : 5, - 'UnormInt101010' : 6, - 'SignedInt8' : 7, - 'SignedInt16' : 8, - 'SignedInt32' : 9, - 'UnsignedInt8' : 10, - 'UnsignedInt16' : 11, - 'UnsignedInt32' : 12, - 'HalfFloat' : 13, - 'Float' : 14, - 'UnormInt24' : 15, - 'UnormInt101010_2' : 16, - }, - - 'ImageOperandsShift' : { - 'Bias' : 0, - 'Lod' : 1, - 'Grad' : 2, - 'ConstOffset' : 3, - 'Offset' : 4, - 'ConstOffsets' : 5, - 'Sample' : 6, - 'MinLod' : 7, - }, - - 'ImageOperandsMask' : { - 'MaskNone' : 0, - 'Bias' : 0x00000001, - 'Lod' : 0x00000002, - 'Grad' : 0x00000004, - 'ConstOffset' : 0x00000008, - 'Offset' : 0x00000010, - 'ConstOffsets' : 0x00000020, - 'Sample' : 0x00000040, - 'MinLod' : 0x00000080, - }, - - 'FPFastMathModeShift' : { - 'NotNaN' : 0, - 'NotInf' : 1, - 'NSZ' : 2, - 'AllowRecip' : 3, - 'Fast' : 4, - }, - - 'FPFastMathModeMask' : { - 'MaskNone' : 0, - 'NotNaN' : 0x00000001, - 'NotInf' : 0x00000002, - 'NSZ' : 0x00000004, - 'AllowRecip' : 0x00000008, - 'Fast' : 0x00000010, - }, - - 'FPRoundingMode' : { - 'RTE' : 0, - 'RTZ' : 1, - 'RTP' : 2, - 'RTN' : 3, - }, - - 'LinkageType' : { - 'Export' : 0, - 'Import' : 1, - }, - - 'AccessQualifier' : { - 'ReadOnly' : 0, - 'WriteOnly' : 1, - 'ReadWrite' : 2, - }, - - 'FunctionParameterAttribute' : { - 'Zext' : 0, - 'Sext' : 1, - 'ByVal' : 2, - 'Sret' : 3, - 'NoAlias' : 4, - 'NoCapture' : 5, - 'NoWrite' : 6, - 'NoReadWrite' : 7, - }, - - 'Decoration' : { - 'RelaxedPrecision' : 0, - 'SpecId' : 1, - 'Block' : 2, - 'BufferBlock' : 3, - 'RowMajor' : 4, - 'ColMajor' : 5, - 'ArrayStride' : 6, - 'MatrixStride' : 7, - 'GLSLShared' : 8, - 'GLSLPacked' : 9, - 'CPacked' : 10, - 'BuiltIn' : 11, - 'NoPerspective' : 13, - 'Flat' : 14, - 'Patch' : 15, - 'Centroid' : 16, - 'Sample' : 17, - 'Invariant' : 18, - 'Restrict' : 19, - 'Aliased' : 20, - 'Volatile' : 21, - 'Constant' : 22, - 'Coherent' : 23, - 'NonWritable' : 24, - 'NonReadable' : 25, - 'Uniform' : 26, - 'SaturatedConversion' : 28, - 'Stream' : 29, - 'Location' : 30, - 'Component' : 31, - 'Index' : 32, - 'Binding' : 33, - 'DescriptorSet' : 34, - 'Offset' : 35, - 'XfbBuffer' : 36, - 'XfbStride' : 37, - 'FuncParamAttr' : 38, - 'FPRoundingMode' : 39, - 'FPFastMathMode' : 40, - 'LinkageAttributes' : 41, - 'NoContraction' : 42, - 'InputAttachmentIndex' : 43, - 'Alignment' : 44, - 'ExplicitInterpAMD' : 4999, - 'OverrideCoverageNV' : 5248, - 'PassthroughNV' : 5250, - 'ViewportRelativeNV' : 5252, - 'SecondaryViewportRelativeNV' : 5256, - }, - - 'BuiltIn' : { - 'Position' : 0, - 'PointSize' : 1, - 'ClipDistance' : 3, - 'CullDistance' : 4, - 'VertexId' : 5, - 'InstanceId' : 6, - 'PrimitiveId' : 7, - 'InvocationId' : 8, - 'Layer' : 9, - 'ViewportIndex' : 10, - 'TessLevelOuter' : 11, - 'TessLevelInner' : 12, - 'TessCoord' : 13, - 'PatchVertices' : 14, - 'FragCoord' : 15, - 'PointCoord' : 16, - 'FrontFacing' : 17, - 'SampleId' : 18, - 'SamplePosition' : 19, - 'SampleMask' : 20, - 'FragDepth' : 22, - 'HelperInvocation' : 23, - 'NumWorkgroups' : 24, - 'WorkgroupSize' : 25, - 'WorkgroupId' : 26, - 'LocalInvocationId' : 27, - 'GlobalInvocationId' : 28, - 'LocalInvocationIndex' : 29, - 'WorkDim' : 30, - 'GlobalSize' : 31, - 'EnqueuedWorkgroupSize' : 32, - 'GlobalOffset' : 33, - 'GlobalLinearId' : 34, - 'SubgroupSize' : 36, - 'SubgroupMaxSize' : 37, - 'NumSubgroups' : 38, - 'NumEnqueuedSubgroups' : 39, - 'SubgroupId' : 40, - 'SubgroupLocalInvocationId' : 41, - 'VertexIndex' : 42, - 'InstanceIndex' : 43, - 'SubgroupEqMaskKHR' : 4416, - 'SubgroupGeMaskKHR' : 4417, - 'SubgroupGtMaskKHR' : 4418, - 'SubgroupLeMaskKHR' : 4419, - 'SubgroupLtMaskKHR' : 4420, - 'BaseVertex' : 4424, - 'BaseInstance' : 4425, - 'DrawIndex' : 4426, - 'DeviceIndex' : 4438, - 'ViewIndex' : 4440, - 'BaryCoordNoPerspAMD' : 4992, - 'BaryCoordNoPerspCentroidAMD' : 4993, - 'BaryCoordNoPerspSampleAMD' : 4994, - 'BaryCoordSmoothAMD' : 4995, - 'BaryCoordSmoothCentroidAMD' : 4996, - 'BaryCoordSmoothSampleAMD' : 4997, - 'BaryCoordPullModelAMD' : 4998, - 'FragStencilRefEXT' : 5014, - 'ViewportMaskNV' : 5253, - 'SecondaryPositionNV' : 5257, - 'SecondaryViewportMaskNV' : 5258, - 'PositionPerViewNV' : 5261, - 'ViewportMaskPerViewNV' : 5262, - }, - - 'SelectionControlShift' : { - 'Flatten' : 0, - 'DontFlatten' : 1, - }, - - 'SelectionControlMask' : { - 'MaskNone' : 0, - 'Flatten' : 0x00000001, - 'DontFlatten' : 0x00000002, - }, - - 'LoopControlShift' : { - 'Unroll' : 0, - 'DontUnroll' : 1, - }, - - 'LoopControlMask' : { - 'MaskNone' : 0, - 'Unroll' : 0x00000001, - 'DontUnroll' : 0x00000002, - }, - - 'FunctionControlShift' : { - 'Inline' : 0, - 'DontInline' : 1, - 'Pure' : 2, - 'Const' : 3, - }, - - 'FunctionControlMask' : { - 'MaskNone' : 0, - 'Inline' : 0x00000001, - 'DontInline' : 0x00000002, - 'Pure' : 0x00000004, - 'Const' : 0x00000008, - }, - - 'MemorySemanticsShift' : { - 'Acquire' : 1, - 'Release' : 2, - 'AcquireRelease' : 3, - 'SequentiallyConsistent' : 4, - 'UniformMemory' : 6, - 'SubgroupMemory' : 7, - 'WorkgroupMemory' : 8, - 'CrossWorkgroupMemory' : 9, - 'AtomicCounterMemory' : 10, - 'ImageMemory' : 11, - }, - - 'MemorySemanticsMask' : { - 'MaskNone' : 0, - 'Acquire' : 0x00000002, - 'Release' : 0x00000004, - 'AcquireRelease' : 0x00000008, - 'SequentiallyConsistent' : 0x00000010, - 'UniformMemory' : 0x00000040, - 'SubgroupMemory' : 0x00000080, - 'WorkgroupMemory' : 0x00000100, - 'CrossWorkgroupMemory' : 0x00000200, - 'AtomicCounterMemory' : 0x00000400, - 'ImageMemory' : 0x00000800, - }, - - 'MemoryAccessShift' : { - 'Volatile' : 0, - 'Aligned' : 1, - 'Nontemporal' : 2, - }, - - 'MemoryAccessMask' : { - 'MaskNone' : 0, - 'Volatile' : 0x00000001, - 'Aligned' : 0x00000002, - 'Nontemporal' : 0x00000004, - }, - - 'Scope' : { - 'CrossDevice' : 0, - 'Device' : 1, - 'Workgroup' : 2, - 'Subgroup' : 3, - 'Invocation' : 4, - }, - - 'GroupOperation' : { - 'Reduce' : 0, - 'InclusiveScan' : 1, - 'ExclusiveScan' : 2, - }, - - 'KernelEnqueueFlags' : { - 'NoWait' : 0, - 'WaitKernel' : 1, - 'WaitWorkGroup' : 2, - }, - - 'KernelProfilingInfoShift' : { - 'CmdExecTime' : 0, - }, - - 'KernelProfilingInfoMask' : { - 'MaskNone' : 0, - 'CmdExecTime' : 0x00000001, - }, - - 'Capability' : { - 'Matrix' : 0, - 'Shader' : 1, - 'Geometry' : 2, - 'Tessellation' : 3, - 'Addresses' : 4, - 'Linkage' : 5, - 'Kernel' : 6, - 'Vector16' : 7, - 'Float16Buffer' : 8, - 'Float16' : 9, - 'Float64' : 10, - 'Int64' : 11, - 'Int64Atomics' : 12, - 'ImageBasic' : 13, - 'ImageReadWrite' : 14, - 'ImageMipmap' : 15, - 'Pipes' : 17, - 'Groups' : 18, - 'DeviceEnqueue' : 19, - 'LiteralSampler' : 20, - 'AtomicStorage' : 21, - 'Int16' : 22, - 'TessellationPointSize' : 23, - 'GeometryPointSize' : 24, - 'ImageGatherExtended' : 25, - 'StorageImageMultisample' : 27, - 'UniformBufferArrayDynamicIndexing' : 28, - 'SampledImageArrayDynamicIndexing' : 29, - 'StorageBufferArrayDynamicIndexing' : 30, - 'StorageImageArrayDynamicIndexing' : 31, - 'ClipDistance' : 32, - 'CullDistance' : 33, - 'ImageCubeArray' : 34, - 'SampleRateShading' : 35, - 'ImageRect' : 36, - 'SampledRect' : 37, - 'GenericPointer' : 38, - 'Int8' : 39, - 'InputAttachment' : 40, - 'SparseResidency' : 41, - 'MinLod' : 42, - 'Sampled1D' : 43, - 'Image1D' : 44, - 'SampledCubeArray' : 45, - 'SampledBuffer' : 46, - 'ImageBuffer' : 47, - 'ImageMSArray' : 48, - 'StorageImageExtendedFormats' : 49, - 'ImageQuery' : 50, - 'DerivativeControl' : 51, - 'InterpolationFunction' : 52, - 'TransformFeedback' : 53, - 'GeometryStreams' : 54, - 'StorageImageReadWithoutFormat' : 55, - 'StorageImageWriteWithoutFormat' : 56, - 'MultiViewport' : 57, - 'SubgroupBallotKHR' : 4423, - 'DrawParameters' : 4427, - 'SubgroupVoteKHR' : 4431, - 'StorageBuffer16BitAccess' : 4433, - 'StorageUniformBufferBlock16' : 4433, - 'StorageUniform16' : 4434, - 'UniformAndStorageBuffer16BitAccess' : 4434, - 'StoragePushConstant16' : 4435, - 'StorageInputOutput16' : 4436, - 'DeviceGroup' : 4437, - 'MultiView' : 4439, - 'VariablePointersStorageBuffer' : 4441, - 'VariablePointers' : 4442, - 'AtomicStorageOps' : 4445, - 'SampleMaskPostDepthCoverage' : 4447, - 'ImageGatherBiasLodAMD' : 5009, - 'FragmentMaskAMD' : 5010, - 'StencilExportEXT' : 5013, - 'ImageReadWriteLodAMD' : 5015, - 'SampleMaskOverrideCoverageNV' : 5249, - 'GeometryShaderPassthroughNV' : 5251, - 'ShaderViewportIndexLayerEXT' : 5254, - 'ShaderViewportIndexLayerNV' : 5254, - 'ShaderViewportMaskNV' : 5255, - 'ShaderStereoViewNV' : 5259, - 'PerViewAttributesNV' : 5260, - 'SubgroupShuffleINTEL' : 5568, - 'SubgroupBufferBlockIOINTEL' : 5569, - 'SubgroupImageBlockIOINTEL' : 5570, - }, - - 'Op' : { - 'OpNop' : 0, - 'OpUndef' : 1, - 'OpSourceContinued' : 2, - 'OpSource' : 3, - 'OpSourceExtension' : 4, - 'OpName' : 5, - 'OpMemberName' : 6, - 'OpString' : 7, - 'OpLine' : 8, - 'OpExtension' : 10, - 'OpExtInstImport' : 11, - 'OpExtInst' : 12, - 'OpMemoryModel' : 14, - 'OpEntryPoint' : 15, - 'OpExecutionMode' : 16, - 'OpCapability' : 17, - 'OpTypeVoid' : 19, - 'OpTypeBool' : 20, - 'OpTypeInt' : 21, - 'OpTypeFloat' : 22, - 'OpTypeVector' : 23, - 'OpTypeMatrix' : 24, - 'OpTypeImage' : 25, - 'OpTypeSampler' : 26, - 'OpTypeSampledImage' : 27, - 'OpTypeArray' : 28, - 'OpTypeRuntimeArray' : 29, - 'OpTypeStruct' : 30, - 'OpTypeOpaque' : 31, - 'OpTypePointer' : 32, - 'OpTypeFunction' : 33, - 'OpTypeEvent' : 34, - 'OpTypeDeviceEvent' : 35, - 'OpTypeReserveId' : 36, - 'OpTypeQueue' : 37, - 'OpTypePipe' : 38, - 'OpTypeForwardPointer' : 39, - 'OpConstantTrue' : 41, - 'OpConstantFalse' : 42, - 'OpConstant' : 43, - 'OpConstantComposite' : 44, - 'OpConstantSampler' : 45, - 'OpConstantNull' : 46, - 'OpSpecConstantTrue' : 48, - 'OpSpecConstantFalse' : 49, - 'OpSpecConstant' : 50, - 'OpSpecConstantComposite' : 51, - 'OpSpecConstantOp' : 52, - 'OpFunction' : 54, - 'OpFunctionParameter' : 55, - 'OpFunctionEnd' : 56, - 'OpFunctionCall' : 57, - 'OpVariable' : 59, - 'OpImageTexelPointer' : 60, - 'OpLoad' : 61, - 'OpStore' : 62, - 'OpCopyMemory' : 63, - 'OpCopyMemorySized' : 64, - 'OpAccessChain' : 65, - 'OpInBoundsAccessChain' : 66, - 'OpPtrAccessChain' : 67, - 'OpArrayLength' : 68, - 'OpGenericPtrMemSemantics' : 69, - 'OpInBoundsPtrAccessChain' : 70, - 'OpDecorate' : 71, - 'OpMemberDecorate' : 72, - 'OpDecorationGroup' : 73, - 'OpGroupDecorate' : 74, - 'OpGroupMemberDecorate' : 75, - 'OpVectorExtractDynamic' : 77, - 'OpVectorInsertDynamic' : 78, - 'OpVectorShuffle' : 79, - 'OpCompositeConstruct' : 80, - 'OpCompositeExtract' : 81, - 'OpCompositeInsert' : 82, - 'OpCopyObject' : 83, - 'OpTranspose' : 84, - 'OpSampledImage' : 86, - 'OpImageSampleImplicitLod' : 87, - 'OpImageSampleExplicitLod' : 88, - 'OpImageSampleDrefImplicitLod' : 89, - 'OpImageSampleDrefExplicitLod' : 90, - 'OpImageSampleProjImplicitLod' : 91, - 'OpImageSampleProjExplicitLod' : 92, - 'OpImageSampleProjDrefImplicitLod' : 93, - 'OpImageSampleProjDrefExplicitLod' : 94, - 'OpImageFetch' : 95, - 'OpImageGather' : 96, - 'OpImageDrefGather' : 97, - 'OpImageRead' : 98, - 'OpImageWrite' : 99, - 'OpImage' : 100, - 'OpImageQueryFormat' : 101, - 'OpImageQueryOrder' : 102, - 'OpImageQuerySizeLod' : 103, - 'OpImageQuerySize' : 104, - 'OpImageQueryLod' : 105, - 'OpImageQueryLevels' : 106, - 'OpImageQuerySamples' : 107, - 'OpConvertFToU' : 109, - 'OpConvertFToS' : 110, - 'OpConvertSToF' : 111, - 'OpConvertUToF' : 112, - 'OpUConvert' : 113, - 'OpSConvert' : 114, - 'OpFConvert' : 115, - 'OpQuantizeToF16' : 116, - 'OpConvertPtrToU' : 117, - 'OpSatConvertSToU' : 118, - 'OpSatConvertUToS' : 119, - 'OpConvertUToPtr' : 120, - 'OpPtrCastToGeneric' : 121, - 'OpGenericCastToPtr' : 122, - 'OpGenericCastToPtrExplicit' : 123, - 'OpBitcast' : 124, - 'OpSNegate' : 126, - 'OpFNegate' : 127, - 'OpIAdd' : 128, - 'OpFAdd' : 129, - 'OpISub' : 130, - 'OpFSub' : 131, - 'OpIMul' : 132, - 'OpFMul' : 133, - 'OpUDiv' : 134, - 'OpSDiv' : 135, - 'OpFDiv' : 136, - 'OpUMod' : 137, - 'OpSRem' : 138, - 'OpSMod' : 139, - 'OpFRem' : 140, - 'OpFMod' : 141, - 'OpVectorTimesScalar' : 142, - 'OpMatrixTimesScalar' : 143, - 'OpVectorTimesMatrix' : 144, - 'OpMatrixTimesVector' : 145, - 'OpMatrixTimesMatrix' : 146, - 'OpOuterProduct' : 147, - 'OpDot' : 148, - 'OpIAddCarry' : 149, - 'OpISubBorrow' : 150, - 'OpUMulExtended' : 151, - 'OpSMulExtended' : 152, - 'OpAny' : 154, - 'OpAll' : 155, - 'OpIsNan' : 156, - 'OpIsInf' : 157, - 'OpIsFinite' : 158, - 'OpIsNormal' : 159, - 'OpSignBitSet' : 160, - 'OpLessOrGreater' : 161, - 'OpOrdered' : 162, - 'OpUnordered' : 163, - 'OpLogicalEqual' : 164, - 'OpLogicalNotEqual' : 165, - 'OpLogicalOr' : 166, - 'OpLogicalAnd' : 167, - 'OpLogicalNot' : 168, - 'OpSelect' : 169, - 'OpIEqual' : 170, - 'OpINotEqual' : 171, - 'OpUGreaterThan' : 172, - 'OpSGreaterThan' : 173, - 'OpUGreaterThanEqual' : 174, - 'OpSGreaterThanEqual' : 175, - 'OpULessThan' : 176, - 'OpSLessThan' : 177, - 'OpULessThanEqual' : 178, - 'OpSLessThanEqual' : 179, - 'OpFOrdEqual' : 180, - 'OpFUnordEqual' : 181, - 'OpFOrdNotEqual' : 182, - 'OpFUnordNotEqual' : 183, - 'OpFOrdLessThan' : 184, - 'OpFUnordLessThan' : 185, - 'OpFOrdGreaterThan' : 186, - 'OpFUnordGreaterThan' : 187, - 'OpFOrdLessThanEqual' : 188, - 'OpFUnordLessThanEqual' : 189, - 'OpFOrdGreaterThanEqual' : 190, - 'OpFUnordGreaterThanEqual' : 191, - 'OpShiftRightLogical' : 194, - 'OpShiftRightArithmetic' : 195, - 'OpShiftLeftLogical' : 196, - 'OpBitwiseOr' : 197, - 'OpBitwiseXor' : 198, - 'OpBitwiseAnd' : 199, - 'OpNot' : 200, - 'OpBitFieldInsert' : 201, - 'OpBitFieldSExtract' : 202, - 'OpBitFieldUExtract' : 203, - 'OpBitReverse' : 204, - 'OpBitCount' : 205, - 'OpDPdx' : 207, - 'OpDPdy' : 208, - 'OpFwidth' : 209, - 'OpDPdxFine' : 210, - 'OpDPdyFine' : 211, - 'OpFwidthFine' : 212, - 'OpDPdxCoarse' : 213, - 'OpDPdyCoarse' : 214, - 'OpFwidthCoarse' : 215, - 'OpEmitVertex' : 218, - 'OpEndPrimitive' : 219, - 'OpEmitStreamVertex' : 220, - 'OpEndStreamPrimitive' : 221, - 'OpControlBarrier' : 224, - 'OpMemoryBarrier' : 225, - 'OpAtomicLoad' : 227, - 'OpAtomicStore' : 228, - 'OpAtomicExchange' : 229, - 'OpAtomicCompareExchange' : 230, - 'OpAtomicCompareExchangeWeak' : 231, - 'OpAtomicIIncrement' : 232, - 'OpAtomicIDecrement' : 233, - 'OpAtomicIAdd' : 234, - 'OpAtomicISub' : 235, - 'OpAtomicSMin' : 236, - 'OpAtomicUMin' : 237, - 'OpAtomicSMax' : 238, - 'OpAtomicUMax' : 239, - 'OpAtomicAnd' : 240, - 'OpAtomicOr' : 241, - 'OpAtomicXor' : 242, - 'OpPhi' : 245, - 'OpLoopMerge' : 246, - 'OpSelectionMerge' : 247, - 'OpLabel' : 248, - 'OpBranch' : 249, - 'OpBranchConditional' : 250, - 'OpSwitch' : 251, - 'OpKill' : 252, - 'OpReturn' : 253, - 'OpReturnValue' : 254, - 'OpUnreachable' : 255, - 'OpLifetimeStart' : 256, - 'OpLifetimeStop' : 257, - 'OpGroupAsyncCopy' : 259, - 'OpGroupWaitEvents' : 260, - 'OpGroupAll' : 261, - 'OpGroupAny' : 262, - 'OpGroupBroadcast' : 263, - 'OpGroupIAdd' : 264, - 'OpGroupFAdd' : 265, - 'OpGroupFMin' : 266, - 'OpGroupUMin' : 267, - 'OpGroupSMin' : 268, - 'OpGroupFMax' : 269, - 'OpGroupUMax' : 270, - 'OpGroupSMax' : 271, - 'OpReadPipe' : 274, - 'OpWritePipe' : 275, - 'OpReservedReadPipe' : 276, - 'OpReservedWritePipe' : 277, - 'OpReserveReadPipePackets' : 278, - 'OpReserveWritePipePackets' : 279, - 'OpCommitReadPipe' : 280, - 'OpCommitWritePipe' : 281, - 'OpIsValidReserveId' : 282, - 'OpGetNumPipePackets' : 283, - 'OpGetMaxPipePackets' : 284, - 'OpGroupReserveReadPipePackets' : 285, - 'OpGroupReserveWritePipePackets' : 286, - 'OpGroupCommitReadPipe' : 287, - 'OpGroupCommitWritePipe' : 288, - 'OpEnqueueMarker' : 291, - 'OpEnqueueKernel' : 292, - 'OpGetKernelNDrangeSubGroupCount' : 293, - 'OpGetKernelNDrangeMaxSubGroupSize' : 294, - 'OpGetKernelWorkGroupSize' : 295, - 'OpGetKernelPreferredWorkGroupSizeMultiple' : 296, - 'OpRetainEvent' : 297, - 'OpReleaseEvent' : 298, - 'OpCreateUserEvent' : 299, - 'OpIsValidEvent' : 300, - 'OpSetUserEventStatus' : 301, - 'OpCaptureEventProfilingInfo' : 302, - 'OpGetDefaultQueue' : 303, - 'OpBuildNDRange' : 304, - 'OpImageSparseSampleImplicitLod' : 305, - 'OpImageSparseSampleExplicitLod' : 306, - 'OpImageSparseSampleDrefImplicitLod' : 307, - 'OpImageSparseSampleDrefExplicitLod' : 308, - 'OpImageSparseSampleProjImplicitLod' : 309, - 'OpImageSparseSampleProjExplicitLod' : 310, - 'OpImageSparseSampleProjDrefImplicitLod' : 311, - 'OpImageSparseSampleProjDrefExplicitLod' : 312, - 'OpImageSparseFetch' : 313, - 'OpImageSparseGather' : 314, - 'OpImageSparseDrefGather' : 315, - 'OpImageSparseTexelsResident' : 316, - 'OpNoLine' : 317, - 'OpAtomicFlagTestAndSet' : 318, - 'OpAtomicFlagClear' : 319, - 'OpImageSparseRead' : 320, - 'OpSubgroupBallotKHR' : 4421, - 'OpSubgroupFirstInvocationKHR' : 4422, - 'OpSubgroupAllKHR' : 4428, - 'OpSubgroupAnyKHR' : 4429, - 'OpSubgroupAllEqualKHR' : 4430, - 'OpSubgroupReadInvocationKHR' : 4432, - 'OpGroupIAddNonUniformAMD' : 5000, - 'OpGroupFAddNonUniformAMD' : 5001, - 'OpGroupFMinNonUniformAMD' : 5002, - 'OpGroupUMinNonUniformAMD' : 5003, - 'OpGroupSMinNonUniformAMD' : 5004, - 'OpGroupFMaxNonUniformAMD' : 5005, - 'OpGroupUMaxNonUniformAMD' : 5006, - 'OpGroupSMaxNonUniformAMD' : 5007, - 'OpFragmentMaskFetchAMD' : 5011, - 'OpFragmentFetchAMD' : 5012, - 'OpSubgroupShuffleINTEL' : 5571, - 'OpSubgroupShuffleDownINTEL' : 5572, - 'OpSubgroupShuffleUpINTEL' : 5573, - 'OpSubgroupShuffleXorINTEL' : 5574, - 'OpSubgroupBlockReadINTEL' : 5575, - 'OpSubgroupBlockWriteINTEL' : 5576, - 'OpSubgroupImageBlockReadINTEL' : 5577, - 'OpSubgroupImageBlockWriteINTEL' : 5578, - }, - -} - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/extinst.glsl.std.450.grammar.json vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/extinst.glsl.std.450.grammar.json --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/extinst.glsl.std.450.grammar.json 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/extinst.glsl.std.450.grammar.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,642 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "version" : 100, - "revision" : 2, - "instructions" : [ - { - "opname" : "Round", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "RoundEven", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Trunc", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FAbs", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SAbs", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FSign", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SSign", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Floor", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Ceil", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Fract", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Radians", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "'degrees'" } - ] - }, - { - "opname" : "Degrees", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "'radians'" } - ] - }, - { - "opname" : "Sin", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Cos", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Tan", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Asin", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Acos", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atan", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "'y_over_x'" } - ] - }, - { - "opname" : "Sinh", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Cosh", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Tanh", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Asinh", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Acosh", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atanh", - "opcode" : 24, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atan2", - "opcode" : 25, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Pow", - "opcode" : 26, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "Exp", - "opcode" : 27, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Log", - "opcode" : 28, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Exp2", - "opcode" : 29, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Log2", - "opcode" : 30, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Sqrt", - "opcode" : 31, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "InverseSqrt", - "opcode" : 32, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Determinant", - "opcode" : 33, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "MatrixInverse", - "opcode" : 34, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Modf", - "opcode" : 35, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'i'" } - ] - }, - { - "opname" : "ModfStruct", - "opcode" : 36, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FMin", - "opcode" : 37, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "UMin", - "opcode" : 38, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "SMin", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "FMax", - "opcode" : 40, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "UMax", - "opcode" : 41, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "SMax", - "opcode" : 42, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "FClamp", - "opcode" : 43, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "UClamp", - "opcode" : 44, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "SClamp", - "opcode" : 45, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "FMix", - "opcode" : 46, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "IMix", - "opcode" : 47, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "Step", - "opcode" : 48, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SmoothStep", - "opcode" : 49, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge0'" }, - { "kind" : "IdRef", "name" : "'edge1'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Fma", - "opcode" : 50, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "Frexp", - "opcode" : 51, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "FrexpStruct", - "opcode" : 52, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Ldexp", - "opcode" : 53, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "PackSnorm4x8", - "opcode" : 54, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackUnorm4x8", - "opcode" : 55, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackSnorm2x16", - "opcode" : 56, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackUnorm2x16", - "opcode" : 57, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackHalf2x16", - "opcode" : 58, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackDouble2x32", - "opcode" : 59, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ], - "capabilities" : [ "Float64" ] - }, - { - "opname" : "UnpackSnorm2x16", - "opcode" : 60, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackUnorm2x16", - "opcode" : 61, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackHalf2x16", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "UnpackSnorm4x8", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackUnorm4x8", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackDouble2x32", - "opcode" : 65, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ], - "capabilities" : [ "Float64" ] - }, - { - "opname" : "Length", - "opcode" : 66, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Distance", - "opcode" : 67, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "Cross", - "opcode" : 68, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "Normalize", - "opcode" : 69, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FaceForward", - "opcode" : 70, - "operands" : [ - { "kind" : "IdRef", "name" : "'N'" }, - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'Nref'" } - ] - }, - { - "opname" : "Reflect", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'N'" } - ] - }, - { - "opname" : "Refract", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'N'" }, - { "kind" : "IdRef", "name" : "'eta'" } - ] - }, - { - "opname" : "FindILsb", - "opcode" : 73, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "FindSMsb", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "FindUMsb", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "InterpolateAtCentroid", - "opcode" : 76, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "InterpolateAtSample", - "opcode" : 77, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" }, - { "kind" : "IdRef", "name" : "'sample'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "InterpolateAtOffset", - "opcode" : 78, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" }, - { "kind" : "IdRef", "name" : "'offset'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "NMin", - "opcode" : 79, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "NMax", - "opcode" : 80, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "NClamp", - "opcode" : 81, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - } - ] -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/extinst.opencl.std.100.grammar.json vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/extinst.opencl.std.100.grammar.json --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/extinst.opencl.std.100.grammar.json 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/extinst.opencl.std.100.grammar.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,1279 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "version" : 100, - "revision" : 2, - "instructions" : [ - { - "opname" : "acos", - "opcode" : 0, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "acosh", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "acospi", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asin", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asinh", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asinpi", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan2", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atanh", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atanpi", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan2pi", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cbrt", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ceil", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "copysign", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "cos", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cosh", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cospi", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "erfc", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "erf", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp2", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp10", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "expm1", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fabs", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fdim", - "opcode" : 24, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "floor", - "opcode" : 25, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fma", - "opcode" : 26, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "fmax", - "opcode" : 27, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmin", - "opcode" : 28, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmod", - "opcode" : 29, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fract", - "opcode" : 30, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'ptr'" } - ] - }, - { - "opname" : "frexp", - "opcode" : 31, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "hypot", - "opcode" : 32, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "ilogb", - "opcode" : 33, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ldexp", - "opcode" : 34, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'k'" } - ] - }, - { - "opname" : "lgamma", - "opcode" : 35, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "lgamma_r", - "opcode" : 36, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'signp'" } - ] - }, - { - "opname" : "log", - "opcode" : 37, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log2", - "opcode" : 38, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log10", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log1p", - "opcode" : 40, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "logb", - "opcode" : 41, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "mad", - "opcode" : 42, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "maxmag", - "opcode" : 43, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "minmag", - "opcode" : 44, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "modf", - "opcode" : 45, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'iptr'" } - ] - }, - { - "opname" : "nan", - "opcode" : 46, - "operands" : [ - { "kind" : "IdRef", "name" : "'nancode'" } - ] - }, - { - "opname" : "nextafter", - "opcode" : 47, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "pow", - "opcode" : 48, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y" } - ] - }, - { - "opname" : "pown", - "opcode" : 49, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "powr", - "opcode" : 50, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "remainder", - "opcode" : 51, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "remquo", - "opcode" : 52, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'quo'" } - ] - }, - { - "opname" : "rint", - "opcode" : 53, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "rootn", - "opcode" : 54, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "round", - "opcode" : 55, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "rsqrt", - "opcode" : 56, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sin", - "opcode" : 57, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sincos", - "opcode" : 58, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'cosval'" } - ] - }, - { - "opname" : "sinh", - "opcode" : 59, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sinpi", - "opcode" : 60, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sqrt", - "opcode" : 61, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tan", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tanh", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tanpi", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tgamma", - "opcode" : 65, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "trunc", - "opcode" : 66, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_cos", - "opcode" : 67, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_divide", - "opcode" : 68, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "half_exp", - "opcode" : 69, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_exp2", - "opcode" : 70, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_exp10", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log2", - "opcode" : 73, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log10", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_powr", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "half_recip", - "opcode" : 76, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_rsqrt", - "opcode" : 77, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_sin", - "opcode" : 78, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_sqrt", - "opcode" : 79, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_tan", - "opcode" : 80, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_cos", - "opcode" : 81, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_divide", - "opcode" : 82, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "native_exp", - "opcode" : 83, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_exp2", - "opcode" : 84, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_exp10", - "opcode" : 85, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log", - "opcode" : 86, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log2", - "opcode" : 87, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log10", - "opcode" : 88, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_powr", - "opcode" : 89, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "native_recip", - "opcode" : 90, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_rsqrt", - "opcode" : 91, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_sin", - "opcode" : 92, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_sqrt", - "opcode" : 93, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_tan", - "opcode" : 94, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_abs", - "opcode" : 141, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_abs_diff", - "opcode" : 142, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_add_sat", - "opcode" : 143, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_add_sat", - "opcode" : 144, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_hadd", - "opcode" : 145, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_hadd", - "opcode" : 146, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_rhadd", - "opcode" : 147, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_rhadd", - "opcode" : 148, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_clamp", - "opcode" : 149, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "u_clamp", - "opcode" : 150, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "clz", - "opcode" : 151, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ctz", - "opcode" : 152, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_mad_hi", - "opcode" : 153, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "u_mad_sat", - "opcode" : 154, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_mad_sat", - "opcode" : 155, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_max", - "opcode" : 156, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_max", - "opcode" : 157, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_min", - "opcode" : 158, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_min", - "opcode" : 159, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_mul_hi", - "opcode" : 160, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "rotate", - "opcode" : 161, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" }, - { "kind" : "IdRef", "name" : "'i'" } - ] - }, - { - "opname" : "s_sub_sat", - "opcode" : 162, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_sub_sat", - "opcode" : 163, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_upsample", - "opcode" : 164, - "operands" : [ - { "kind" : "IdRef", "name" : "'hi'" }, - { "kind" : "IdRef", "name" : "'lo'" } - ] - }, - { - "opname" : "s_upsample", - "opcode" : 165, - "operands" : [ - { "kind" : "IdRef", "name" : "'hi'" }, - { "kind" : "IdRef", "name" : "'lo'" } - ] - }, - { - "opname" : "popcount", - "opcode" : 166, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_mad24", - "opcode" : 167, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "u_mad24", - "opcode" : 168, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_mul24", - "opcode" : 169, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mul24", - "opcode" : 170, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_abs", - "opcode" : 201, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "u_abs_diff", - "opcode" : 202, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mul_hi", - "opcode" : 203, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mad_hi", - "opcode" : 204, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "fclamp", - "opcode" : 95, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "degrees", - "opcode" :96, - "operands" : [ - { "kind" : "IdRef", "name" : "'radians'" } - ] - }, - { - "opname" : "fmax_common", - "opcode" : 97, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmin_common", - "opcode" : 98, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "mix", - "opcode" : 99, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "radians", - "opcode" : 100, - "operands" : [ - { "kind" : "IdRef", "name" : "'degrees'" } - ] - }, - { - "opname" : "step", - "opcode" : 101, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "smoothstep", - "opcode" : 102, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge0'" }, - { "kind" : "IdRef", "name" : "'edge1'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sign", - "opcode" : 103, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cross", - "opcode" : 104, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "distance", - "opcode" : 105, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "length", - "opcode" : 106, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "normalize", - "opcode" : 107, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "fast_distance", - "opcode" : 108, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "fast_length", - "opcode" : 109, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "fast_normalize", - "opcode" : 110, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "bitselect", - "opcode" : 186, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "select", - "opcode" : 187, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "vloadn", - "opcode" : 171, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstoren", - "opcode" : 172, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vload_half", - "opcode" : 173, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vload_halfn", - "opcode" : 174, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstore_half", - "opcode" : 175, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstore_half_r", - "opcode" : 176, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "vstore_halfn", - "opcode" : 177, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstore_halfn_r", - "opcode" : 178, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "vloada_halfn", - "opcode" : 179, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstorea_halfn", - "opcode" : 180, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstorea_halfn_r", - "opcode" : 181, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "shuffle", - "opcode" : 182, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'shuffle mask'" } - ] - }, - { - "opname" : "shuffle2", - "opcode" : 183, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'shuffle mask'" } - ] - }, - { - "opname" : "printf", - "opcode" : 184, - "operands" : [ - { "kind" : "IdRef", "name" : "'format'" }, - { "kind" : "IdRef", "name" : "'additional arguments'", "quantifier" : "*" } - ] - }, - { - "opname" : "prefetch", - "opcode" : 185, - "operands" : [ - { "kind" : "IdRef", "name" : "'ptr'" }, - { "kind" : "IdRef", "name" : "'num elements'" } - ] - } - ] -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/GLSL.std.450.h vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/GLSL.std.450.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/GLSL.std.450.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/GLSL.std.450.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,131 +0,0 @@ -/* -** Copyright (c) 2014-2016 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and/or associated documentation files (the "Materials"), -** to deal in the Materials without restriction, including without limitation -** the rights to use, copy, modify, merge, publish, distribute, sublicense, -** and/or sell copies of the Materials, and to permit persons to whom the -** Materials are furnished to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in -** all copies or substantial portions of the Materials. -** -** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -** IN THE MATERIALS. -*/ - -#ifndef GLSLstd450_H -#define GLSLstd450_H - -static const int GLSLstd450Version = 100; -static const int GLSLstd450Revision = 3; - -enum GLSLstd450 { - GLSLstd450Bad = 0, // Don't use - - GLSLstd450Round = 1, - GLSLstd450RoundEven = 2, - GLSLstd450Trunc = 3, - GLSLstd450FAbs = 4, - GLSLstd450SAbs = 5, - GLSLstd450FSign = 6, - GLSLstd450SSign = 7, - GLSLstd450Floor = 8, - GLSLstd450Ceil = 9, - GLSLstd450Fract = 10, - - GLSLstd450Radians = 11, - GLSLstd450Degrees = 12, - GLSLstd450Sin = 13, - GLSLstd450Cos = 14, - GLSLstd450Tan = 15, - GLSLstd450Asin = 16, - GLSLstd450Acos = 17, - GLSLstd450Atan = 18, - GLSLstd450Sinh = 19, - GLSLstd450Cosh = 20, - GLSLstd450Tanh = 21, - GLSLstd450Asinh = 22, - GLSLstd450Acosh = 23, - GLSLstd450Atanh = 24, - GLSLstd450Atan2 = 25, - - GLSLstd450Pow = 26, - GLSLstd450Exp = 27, - GLSLstd450Log = 28, - GLSLstd450Exp2 = 29, - GLSLstd450Log2 = 30, - GLSLstd450Sqrt = 31, - GLSLstd450InverseSqrt = 32, - - GLSLstd450Determinant = 33, - GLSLstd450MatrixInverse = 34, - - GLSLstd450Modf = 35, // second operand needs an OpVariable to write to - GLSLstd450ModfStruct = 36, // no OpVariable operand - GLSLstd450FMin = 37, - GLSLstd450UMin = 38, - GLSLstd450SMin = 39, - GLSLstd450FMax = 40, - GLSLstd450UMax = 41, - GLSLstd450SMax = 42, - GLSLstd450FClamp = 43, - GLSLstd450UClamp = 44, - GLSLstd450SClamp = 45, - GLSLstd450FMix = 46, - GLSLstd450IMix = 47, // Reserved - GLSLstd450Step = 48, - GLSLstd450SmoothStep = 49, - - GLSLstd450Fma = 50, - GLSLstd450Frexp = 51, // second operand needs an OpVariable to write to - GLSLstd450FrexpStruct = 52, // no OpVariable operand - GLSLstd450Ldexp = 53, - - GLSLstd450PackSnorm4x8 = 54, - GLSLstd450PackUnorm4x8 = 55, - GLSLstd450PackSnorm2x16 = 56, - GLSLstd450PackUnorm2x16 = 57, - GLSLstd450PackHalf2x16 = 58, - GLSLstd450PackDouble2x32 = 59, - GLSLstd450UnpackSnorm2x16 = 60, - GLSLstd450UnpackUnorm2x16 = 61, - GLSLstd450UnpackHalf2x16 = 62, - GLSLstd450UnpackSnorm4x8 = 63, - GLSLstd450UnpackUnorm4x8 = 64, - GLSLstd450UnpackDouble2x32 = 65, - - GLSLstd450Length = 66, - GLSLstd450Distance = 67, - GLSLstd450Cross = 68, - GLSLstd450Normalize = 69, - GLSLstd450FaceForward = 70, - GLSLstd450Reflect = 71, - GLSLstd450Refract = 72, - - GLSLstd450FindILsb = 73, - GLSLstd450FindSMsb = 74, - GLSLstd450FindUMsb = 75, - - GLSLstd450InterpolateAtCentroid = 76, - GLSLstd450InterpolateAtSample = 77, - GLSLstd450InterpolateAtOffset = 78, - - GLSLstd450NMin = 79, - GLSLstd450NMax = 80, - GLSLstd450NClamp = 81, - - GLSLstd450Count -}; - -#endif // #ifndef GLSLstd450_H diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/OpenCL.std.h vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/OpenCL.std.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/OpenCL.std.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/OpenCL.std.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,210 +0,0 @@ -/* -** Copyright (c) 2015-2017 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and/or associated documentation files (the "Materials"), -** to deal in the Materials without restriction, including without limitation -** the rights to use, copy, modify, merge, publish, distribute, sublicense, -** and/or sell copies of the Materials, and to permit persons to whom the -** Materials are furnished to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in -** all copies or substantial portions of the Materials. -** -** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -** IN THE MATERIALS. -*/ - -namespace OpenCLLIB { - -enum Entrypoints { - - // Section 2.1: Math extended instructions - Acos = 0, - Acosh = 1, - Acospi = 2, - Asin = 3, - Asinh = 4, - Asinpi = 5, - Atan = 6, - Atan2 = 7, - Atanh = 8, - Atanpi = 9, - Atan2pi = 10, - Cbrt = 11, - Ceil = 12, - Copysign = 13, - Cos = 14, - Cosh = 15, - Cospi = 16, - Erfc = 17, - Erf = 18, - Exp = 19, - Exp2 = 20, - Exp10 = 21, - Expm1 = 22, - Fabs = 23, - Fdim = 24, - Floor = 25, - Fma = 26, - Fmax = 27, - Fmin = 28, - Fmod = 29, - Fract = 30, - Frexp = 31, - Hypot = 32, - Ilogb = 33, - Ldexp = 34, - Lgamma = 35, - Lgamma_r = 36, - Log = 37, - Log2 = 38, - Log10 = 39, - Log1p = 40, - Logb = 41, - Mad = 42, - Maxmag = 43, - Minmag = 44, - Modf = 45, - Nan = 46, - Nextafter = 47, - Pow = 48, - Pown = 49, - Powr = 50, - Remainder = 51, - Remquo = 52, - Rint = 53, - Rootn = 54, - Round = 55, - Rsqrt = 56, - Sin = 57, - Sincos = 58, - Sinh = 59, - Sinpi = 60, - Sqrt = 61, - Tan = 62, - Tanh = 63, - Tanpi = 64, - Tgamma = 65, - Trunc = 66, - Half_cos = 67, - Half_divide = 68, - Half_exp = 69, - Half_exp2 = 70, - Half_exp10 = 71, - Half_log = 72, - Half_log2 = 73, - Half_log10 = 74, - Half_powr = 75, - Half_recip = 76, - Half_rsqrt = 77, - Half_sin = 78, - Half_sqrt = 79, - Half_tan = 80, - Native_cos = 81, - Native_divide = 82, - Native_exp = 83, - Native_exp2 = 84, - Native_exp10 = 85, - Native_log = 86, - Native_log2 = 87, - Native_log10 = 88, - Native_powr = 89, - Native_recip = 90, - Native_rsqrt = 91, - Native_sin = 92, - Native_sqrt = 93, - Native_tan = 94, - - // Section 2.2: Integer instructions - SAbs = 141, - SAbs_diff = 142, - SAdd_sat = 143, - UAdd_sat = 144, - SHadd = 145, - UHadd = 146, - SRhadd = 147, - URhadd = 148, - SClamp = 149, - UClamp = 150, - Clz = 151, - Ctz = 152, - SMad_hi = 153, - UMad_sat = 154, - SMad_sat = 155, - SMax = 156, - UMax = 157, - SMin = 158, - UMin = 159, - SMul_hi = 160, - Rotate = 161, - SSub_sat = 162, - USub_sat = 163, - U_Upsample = 164, - S_Upsample = 165, - Popcount = 166, - SMad24 = 167, - UMad24 = 168, - SMul24 = 169, - UMul24 = 170, - UAbs = 201, - UAbs_diff = 202, - UMul_hi = 203, - UMad_hi = 204, - - // Section 2.3: Common instructions - FClamp = 95, - Degrees = 96, - FMax_common = 97, - FMin_common = 98, - Mix = 99, - Radians = 100, - Step = 101, - Smoothstep = 102, - Sign = 103, - - // Section 2.4: Geometric instructions - Cross = 104, - Distance = 105, - Length = 106, - Normalize = 107, - Fast_distance = 108, - Fast_length = 109, - Fast_normalize = 110, - - // Section 2.5: Relational instructions - Bitselect = 186, - Select = 187, - - // Section 2.6: Vector Data Load and Store instructions - Vloadn = 171, - Vstoren = 172, - Vload_half = 173, - Vload_halfn = 174, - Vstore_half = 175, - Vstore_half_r = 176, - Vstore_halfn = 177, - Vstore_halfn_r = 178, - Vloada_halfn = 179, - Vstorea_halfn = 180, - Vstorea_halfn_r = 181, - - // Section 2.7: Miscellaneous Vector instructions - Shuffle = 182, - Shuffle2 = 183, - - // Section 2.8: Misc instructions - Printf = 184, - Prefetch = 185, -}; - -} // end namespace OpenCLLIB diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.core.grammar.json vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.core.grammar.json --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.core.grammar.json 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.core.grammar.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,5894 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "magic_number" : "0x07230203", - "major_version" : 1, - "minor_version" : 1, - "revision" : 8, - "instructions" : [ - { - "opname" : "OpNop", - "opcode" : 0 - }, - { - "opname" : "OpUndef", - "opcode" : 1, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSourceContinued", - "opcode" : 2, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Continued Source'" } - ] - }, - { - "opname" : "OpSource", - "opcode" : 3, - "operands" : [ - { "kind" : "SourceLanguage" }, - { "kind" : "LiteralInteger", "name" : "'Version'" }, - { "kind" : "IdRef", "quantifier" : "?", "name" : "'File'" }, - { "kind" : "LiteralString", "quantifier" : "?", "name" : "'Source'" } - ] - }, - { - "opname" : "OpSourceExtension", - "opcode" : 4, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Extension'" } - ] - }, - { - "opname" : "OpName", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpMemberName", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpString", - "opcode" : 7, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "'String'" } - ] - }, - { - "opname" : "OpLine", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'File'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" } - ] - }, - { - "opname" : "OpExtension", - "opcode" : 10, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpExtInstImport", - "opcode" : 11, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpExtInst", - "opcode" : 12, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Set'" }, - { "kind" : "LiteralExtInstInteger", "name" : "'Instruction'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Operand 1', +\n'Operand 2', +\n..." } - ] - }, - { - "opname" : "OpMemoryModel", - "opcode" : 14, - "operands" : [ - { "kind" : "AddressingModel" }, - { "kind" : "MemoryModel" } - ] - }, - { - "opname" : "OpEntryPoint", - "opcode" : 15, - "operands" : [ - { "kind" : "ExecutionModel" }, - { "kind" : "IdRef", "name" : "'Entry Point'" }, - { "kind" : "LiteralString", "name" : "'Name'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Interface'" } - ] - }, - { - "opname" : "OpExecutionMode", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'Entry Point'" }, - { "kind" : "ExecutionMode", "name" : "'Mode'" } - ] - }, - { - "opname" : "OpCapability", - "opcode" : 17, - "operands" : [ - { "kind" : "Capability", "name" : "'Capability'" } - ] - }, - { - "opname" : "OpTypeVoid", - "opcode" : 19, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeBool", - "opcode" : 20, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeInt", - "opcode" : 21, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Width'" }, - { "kind" : "LiteralInteger", "name" : "'Signedness'" } - ] - }, - { - "opname" : "OpTypeFloat", - "opcode" : 22, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Width'" } - ] - }, - { - "opname" : "OpTypeVector", - "opcode" : 23, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Component Type'" }, - { "kind" : "LiteralInteger", "name" : "'Component Count'" } - ] - }, - { - "opname" : "OpTypeMatrix", - "opcode" : 24, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Column Type'" }, - { "kind" : "LiteralInteger", "name" : "'Column Count'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpTypeImage", - "opcode" : 25, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Type'" }, - { "kind" : "Dim" }, - { "kind" : "LiteralInteger", "name" : "'Depth'" }, - { "kind" : "LiteralInteger", "name" : "'Arrayed'" }, - { "kind" : "LiteralInteger", "name" : "'MS'" }, - { "kind" : "LiteralInteger", "name" : "'Sampled'" }, - { "kind" : "ImageFormat" }, - { "kind" : "AccessQualifier", "quantifier" : "?" } - ] - }, - { - "opname" : "OpTypeSampler", - "opcode" : 26, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeSampledImage", - "opcode" : 27, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image Type'" } - ] - }, - { - "opname" : "OpTypeArray", - "opcode" : 28, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Element Type'" }, - { "kind" : "IdRef", "name" : "'Length'" } - ] - }, - { - "opname" : "OpTypeRuntimeArray", - "opcode" : 29, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Element Type'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpTypeStruct", - "opcode" : 30, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Member 0 type', +\n'member 1 type', +\n..." } - ] - }, - { - "opname" : "OpTypeOpaque", - "opcode" : 31, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "The name of the opaque type." } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpTypePointer", - "opcode" : 32, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "StorageClass" }, - { "kind" : "IdRef", "name" : "'Type'" } - ] - }, - { - "opname" : "OpTypeFunction", - "opcode" : 33, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Return Type'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Parameter 0 Type', +\n'Parameter 1 Type', +\n..." } - ] - }, - { - "opname" : "OpTypeEvent", - "opcode" : 34, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpTypeDeviceEvent", - "opcode" : 35, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpTypeReserveId", - "opcode" : 36, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpTypeQueue", - "opcode" : 37, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpTypePipe", - "opcode" : 38, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "AccessQualifier", "name" : "'Qualifier'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpTypeForwardPointer", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer Type'" }, - { "kind" : "StorageClass" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpConstantTrue", - "opcode" : 41, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpConstantFalse", - "opcode" : 42, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpConstant", - "opcode" : 43, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } - ] - }, - { - "opname" : "OpConstantComposite", - "opcode" : 44, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpConstantSampler", - "opcode" : 45, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "SamplerAddressingMode" }, - { "kind" : "LiteralInteger", "name" : "'Param'" }, - { "kind" : "SamplerFilterMode" } - ], - "capabilities" : [ "LiteralSampler" ] - }, - { - "opname" : "OpConstantNull", - "opcode" : 46, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstantTrue", - "opcode" : 48, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstantFalse", - "opcode" : 49, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstant", - "opcode" : 50, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } - ] - }, - { - "opname" : "OpSpecConstantComposite", - "opcode" : 51, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpSpecConstantOp", - "opcode" : 52, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralSpecConstantOpInteger", "name" : "'Opcode'" } - ] - }, - { - "opname" : "OpFunction", - "opcode" : 54, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "FunctionControl" }, - { "kind" : "IdRef", "name" : "'Function Type'" } - ] - }, - { - "opname" : "OpFunctionParameter", - "opcode" : 55, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpFunctionEnd", - "opcode" : 56 - }, - { - "opname" : "OpFunctionCall", - "opcode" : 57, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Function'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Argument 0', +\n'Argument 1', +\n..." } - ] - }, - { - "opname" : "OpVariable", - "opcode" : 59, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "StorageClass" }, - { "kind" : "IdRef", "quantifier" : "?", "name" : "'Initializer'" } - ] - }, - { - "opname" : "OpImageTexelPointer", - "opcode" : 60, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Sample'" } - ] - }, - { - "opname" : "OpLoad", - "opcode" : 61, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpStore", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Object'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpCopyMemory", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpCopyMemorySized", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpAccessChain", - "opcode" : 65, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpInBoundsAccessChain", - "opcode" : 66, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpPtrAccessChain", - "opcode" : 67, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Element'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ], - "capabilities" : [ - "Addresses", - "VariablePointers", - "VariablePointersStorageBuffer" - ] - }, - { - "opname" : "OpArrayLength", - "opcode" : 68, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Structure'" }, - { "kind" : "LiteralInteger", "name" : "'Array member'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpGenericPtrMemSemantics", - "opcode" : 69, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpInBoundsPtrAccessChain", - "opcode" : 70, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Element'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpDecorate", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "Decoration" } - ] - }, - { - "opname" : "OpMemberDecorate", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'Structure Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "Decoration" } - ] - }, - { - "opname" : "OpDecorationGroup", - "opcode" : 73, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpGroupDecorate", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'Decoration Group'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Targets'" } - ] - }, - { - "opname" : "OpGroupMemberDecorate", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'Decoration Group'" }, - { "kind" : "PairIdRefLiteralInteger", "quantifier" : "*", "name" : "'Targets'" } - ] - }, - { - "opname" : "OpVectorExtractDynamic", - "opcode" : 77, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ] - }, - { - "opname" : "OpVectorInsertDynamic", - "opcode" : 78, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ] - }, - { - "opname" : "OpVectorShuffle", - "opcode" : 79, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Components'" } - ] - }, - { - "opname" : "OpCompositeConstruct", - "opcode" : 80, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpCompositeExtract", - "opcode" : 81, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Composite'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpCompositeInsert", - "opcode" : 82, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Object'" }, - { "kind" : "IdRef", "name" : "'Composite'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpCopyObject", - "opcode" : 83, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpTranspose", - "opcode" : 84, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpSampledImage", - "opcode" : 86, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Sampler'" } - ] - }, - { - "opname" : "OpImageSampleImplicitLod", - "opcode" : 87, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleExplicitLod", - "opcode" : 88, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ] - }, - { - "opname" : "OpImageSampleDrefImplicitLod", - "opcode" : 89, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleDrefExplicitLod", - "opcode" : 90, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjImplicitLod", - "opcode" : 91, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjExplicitLod", - "opcode" : 92, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjDrefImplicitLod", - "opcode" : 93, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjDrefExplicitLod", - "opcode" : 94, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageFetch", - "opcode" : 95, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImageGather", - "opcode" : 96, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageDrefGather", - "opcode" : 97, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageRead", - "opcode" : 98, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImageWrite", - "opcode" : 99, - "operands" : [ - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Texel'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImage", - "opcode" : 100, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" } - ] - }, - { - "opname" : "OpImageQueryFormat", - "opcode" : 101, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageQueryOrder", - "opcode" : 102, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageQuerySizeLod", - "opcode" : 103, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Level of Detail'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQuerySize", - "opcode" : 104, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQueryLod", - "opcode" : 105, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "ImageQuery" ] - }, - { - "opname" : "OpImageQueryLevels", - "opcode" : 106, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQuerySamples", - "opcode" : 107, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpConvertFToU", - "opcode" : 109, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpConvertFToS", - "opcode" : 110, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpConvertSToF", - "opcode" : 111, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ] - }, - { - "opname" : "OpConvertUToF", - "opcode" : 112, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ] - }, - { - "opname" : "OpUConvert", - "opcode" : 113, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ] - }, - { - "opname" : "OpSConvert", - "opcode" : 114, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ] - }, - { - "opname" : "OpFConvert", - "opcode" : 115, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpQuantizeToF16", - "opcode" : 116, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpConvertPtrToU", - "opcode" : 117, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpSatConvertSToU", - "opcode" : 118, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpSatConvertUToS", - "opcode" : 119, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpConvertUToPtr", - "opcode" : 120, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Integer Value'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpPtrCastToGeneric", - "opcode" : 121, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGenericCastToPtr", - "opcode" : 122, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGenericCastToPtrExplicit", - "opcode" : 123, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "StorageClass", "name" : "'Storage'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpBitcast", - "opcode" : 124, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpSNegate", - "opcode" : 126, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpFNegate", - "opcode" : 127, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpIAdd", - "opcode" : 128, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFAdd", - "opcode" : 129, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpISub", - "opcode" : 130, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFSub", - "opcode" : 131, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpIMul", - "opcode" : 132, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFMul", - "opcode" : 133, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUDiv", - "opcode" : 134, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSDiv", - "opcode" : 135, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFDiv", - "opcode" : 136, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUMod", - "opcode" : 137, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSRem", - "opcode" : 138, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSMod", - "opcode" : 139, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFRem", - "opcode" : 140, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFMod", - "opcode" : 141, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpVectorTimesScalar", - "opcode" : 142, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Scalar'" } - ] - }, - { - "opname" : "OpMatrixTimesScalar", - "opcode" : 143, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" }, - { "kind" : "IdRef", "name" : "'Scalar'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpVectorTimesMatrix", - "opcode" : 144, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Matrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpMatrixTimesVector", - "opcode" : 145, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpMatrixTimesMatrix", - "opcode" : 146, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'LeftMatrix'" }, - { "kind" : "IdRef", "name" : "'RightMatrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpOuterProduct", - "opcode" : 147, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpDot", - "opcode" : 148, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" } - ] - }, - { - "opname" : "OpIAddCarry", - "opcode" : 149, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpISubBorrow", - "opcode" : 150, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUMulExtended", - "opcode" : 151, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSMulExtended", - "opcode" : 152, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpAny", - "opcode" : 154, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ] - }, - { - "opname" : "OpAll", - "opcode" : 155, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ] - }, - { - "opname" : "OpIsNan", - "opcode" : 156, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "OpIsInf", - "opcode" : 157, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "OpIsFinite", - "opcode" : 158, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpIsNormal", - "opcode" : 159, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpSignBitSet", - "opcode" : 160, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLessOrGreater", - "opcode" : 161, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpOrdered", - "opcode" : 162, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpUnordered", - "opcode" : 163, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLogicalEqual", - "opcode" : 164, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalNotEqual", - "opcode" : 165, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalOr", - "opcode" : 166, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalAnd", - "opcode" : 167, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalNot", - "opcode" : 168, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpSelect", - "opcode" : 169, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Condition'" }, - { "kind" : "IdRef", "name" : "'Object 1'" }, - { "kind" : "IdRef", "name" : "'Object 2'" } - ] - }, - { - "opname" : "OpIEqual", - "opcode" : 170, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpINotEqual", - "opcode" : 171, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUGreaterThan", - "opcode" : 172, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSGreaterThan", - "opcode" : 173, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUGreaterThanEqual", - "opcode" : 174, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSGreaterThanEqual", - "opcode" : 175, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpULessThan", - "opcode" : 176, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSLessThan", - "opcode" : 177, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpULessThanEqual", - "opcode" : 178, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSLessThanEqual", - "opcode" : 179, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdEqual", - "opcode" : 180, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordEqual", - "opcode" : 181, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdNotEqual", - "opcode" : 182, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordNotEqual", - "opcode" : 183, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdLessThan", - "opcode" : 184, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordLessThan", - "opcode" : 185, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdGreaterThan", - "opcode" : 186, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordGreaterThan", - "opcode" : 187, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdLessThanEqual", - "opcode" : 188, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordLessThanEqual", - "opcode" : 189, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdGreaterThanEqual", - "opcode" : 190, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordGreaterThanEqual", - "opcode" : 191, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpShiftRightLogical", - "opcode" : 194, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpShiftRightArithmetic", - "opcode" : 195, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpShiftLeftLogical", - "opcode" : 196, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpBitwiseOr", - "opcode" : 197, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpBitwiseXor", - "opcode" : 198, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpBitwiseAnd", - "opcode" : 199, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpNot", - "opcode" : 200, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpBitFieldInsert", - "opcode" : 201, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Insert'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitFieldSExtract", - "opcode" : 202, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitFieldUExtract", - "opcode" : 203, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitReverse", - "opcode" : 204, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitCount", - "opcode" : 205, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" } - ] - }, - { - "opname" : "OpDPdx", - "opcode" : 207, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpDPdy", - "opcode" : 208, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpFwidth", - "opcode" : 209, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpDPdxFine", - "opcode" : 210, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdyFine", - "opcode" : 211, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpFwidthFine", - "opcode" : 212, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdxCoarse", - "opcode" : 213, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdyCoarse", - "opcode" : 214, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpFwidthCoarse", - "opcode" : 215, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpEmitVertex", - "opcode" : 218, - "capabilities" : [ "Geometry" ] - }, - { - "opname" : "OpEndPrimitive", - "opcode" : 219, - "capabilities" : [ "Geometry" ] - }, - { - "opname" : "OpEmitStreamVertex", - "opcode" : 220, - "operands" : [ - { "kind" : "IdRef", "name" : "'Stream'" } - ], - "capabilities" : [ "GeometryStreams" ] - }, - { - "opname" : "OpEndStreamPrimitive", - "opcode" : 221, - "operands" : [ - { "kind" : "IdRef", "name" : "'Stream'" } - ], - "capabilities" : [ "GeometryStreams" ] - }, - { - "opname" : "OpControlBarrier", - "opcode" : 224, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpMemoryBarrier", - "opcode" : 225, - "operands" : [ - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicLoad", - "opcode" : 227, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicStore", - "opcode" : 228, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicExchange", - "opcode" : 229, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicCompareExchange", - "opcode" : 230, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, - { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Comparator'" } - ] - }, - { - "opname" : "OpAtomicCompareExchangeWeak", - "opcode" : 231, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, - { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Comparator'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpAtomicIIncrement", - "opcode" : 232, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicIDecrement", - "opcode" : 233, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicIAdd", - "opcode" : 234, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicISub", - "opcode" : 235, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicSMin", - "opcode" : 236, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicUMin", - "opcode" : 237, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicSMax", - "opcode" : 238, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicUMax", - "opcode" : 239, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicAnd", - "opcode" : 240, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicOr", - "opcode" : 241, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicXor", - "opcode" : 242, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpPhi", - "opcode" : 245, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "PairIdRefIdRef", "quantifier" : "*", "name" : "'Variable, Parent, ...'" } - ] - }, - { - "opname" : "OpLoopMerge", - "opcode" : 246, - "operands" : [ - { "kind" : "IdRef", "name" : "'Merge Block'" }, - { "kind" : "IdRef", "name" : "'Continue Target'" }, - { "kind" : "LoopControl" } - ] - }, - { - "opname" : "OpSelectionMerge", - "opcode" : 247, - "operands" : [ - { "kind" : "IdRef", "name" : "'Merge Block'" }, - { "kind" : "SelectionControl" } - ] - }, - { - "opname" : "OpLabel", - "opcode" : 248, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpBranch", - "opcode" : 249, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target Label'" } - ] - }, - { - "opname" : "OpBranchConditional", - "opcode" : 250, - "operands" : [ - { "kind" : "IdRef", "name" : "'Condition'" }, - { "kind" : "IdRef", "name" : "'True Label'" }, - { "kind" : "IdRef", "name" : "'False Label'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Branch weights'" } - ] - }, - { - "opname" : "OpSwitch", - "opcode" : 251, - "operands" : [ - { "kind" : "IdRef", "name" : "'Selector'" }, - { "kind" : "IdRef", "name" : "'Default'" }, - { "kind" : "PairLiteralIntegerIdRef", "quantifier" : "*", "name" : "'Target'" } - ] - }, - { - "opname" : "OpKill", - "opcode" : 252, - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpReturn", - "opcode" : 253 - }, - { - "opname" : "OpReturnValue", - "opcode" : 254, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpUnreachable", - "opcode" : 255 - }, - { - "opname" : "OpLifetimeStart", - "opcode" : 256, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "LiteralInteger", "name" : "'Size'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLifetimeStop", - "opcode" : 257, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "LiteralInteger", "name" : "'Size'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupAsyncCopy", - "opcode" : 259, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Destination'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Num Elements'" }, - { "kind" : "IdRef", "name" : "'Stride'" }, - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupWaitEvents", - "opcode" : 260, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Events List'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupAll", - "opcode" : 261, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupAny", - "opcode" : 262, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupBroadcast", - "opcode" : 263, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'LocalId'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupIAdd", - "opcode" : 264, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFAdd", - "opcode" : 265, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMin", - "opcode" : 266, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMin", - "opcode" : 267, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMin", - "opcode" : 268, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMax", - "opcode" : 269, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMax", - "opcode" : 270, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMax", - "opcode" : 271, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpReadPipe", - "opcode" : 274, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpWritePipe", - "opcode" : 275, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReservedReadPipe", - "opcode" : 276, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Index'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReservedWritePipe", - "opcode" : 277, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Index'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReserveReadPipePackets", - "opcode" : 278, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReserveWritePipePackets", - "opcode" : 279, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpCommitReadPipe", - "opcode" : 280, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpCommitWritePipe", - "opcode" : 281, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpIsValidReserveId", - "opcode" : 282, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGetNumPipePackets", - "opcode" : 283, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGetMaxPipePackets", - "opcode" : 284, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupReserveReadPipePackets", - "opcode" : 285, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupReserveWritePipePackets", - "opcode" : 286, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupCommitReadPipe", - "opcode" : 287, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupCommitWritePipe", - "opcode" : 288, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpEnqueueMarker", - "opcode" : 291, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Queue'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Wait Events'" }, - { "kind" : "IdRef", "name" : "'Ret Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpEnqueueKernel", - "opcode" : 292, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Queue'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Wait Events'" }, - { "kind" : "IdRef", "name" : "'Ret Event'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Local Size'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelNDrangeSubGroupCount", - "opcode" : 293, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelNDrangeMaxSubGroupSize", - "opcode" : 294, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelWorkGroupSize", - "opcode" : 295, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelPreferredWorkGroupSizeMultiple", - "opcode" : 296, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpRetainEvent", - "opcode" : 297, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpReleaseEvent", - "opcode" : 298, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpCreateUserEvent", - "opcode" : 299, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpIsValidEvent", - "opcode" : 300, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpSetUserEventStatus", - "opcode" : 301, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" }, - { "kind" : "IdRef", "name" : "'Status'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpCaptureEventProfilingInfo", - "opcode" : 302, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" }, - { "kind" : "IdRef", "name" : "'Profiling Info'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetDefaultQueue", - "opcode" : 303, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpBuildNDRange", - "opcode" : 304, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'GlobalWorkSize'" }, - { "kind" : "IdRef", "name" : "'LocalWorkSize'" }, - { "kind" : "IdRef", "name" : "'GlobalWorkOffset'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpImageSparseSampleImplicitLod", - "opcode" : 305, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleExplicitLod", - "opcode" : 306, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleDrefImplicitLod", - "opcode" : 307, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleDrefExplicitLod", - "opcode" : 308, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjImplicitLod", - "opcode" : 309, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjExplicitLod", - "opcode" : 310, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjDrefImplicitLod", - "opcode" : 311, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjDrefExplicitLod", - "opcode" : 312, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseFetch", - "opcode" : 313, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseGather", - "opcode" : 314, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseDrefGather", - "opcode" : 315, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseTexelsResident", - "opcode" : 316, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Resident Code'" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpNoLine", - "opcode" : 317 - }, - { - "opname" : "OpAtomicFlagTestAndSet", - "opcode" : 318, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpAtomicFlagClear", - "opcode" : 319, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageSparseRead", - "opcode" : 320, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpSizeOf", - "opcode" : 321, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpTypePipeStorage", - "opcode" : 322, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "PipeStorage" ] - }, - { - "opname" : "OpConstantPipeStorage", - "opcode" : 323, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Packet Size'" }, - { "kind" : "LiteralInteger", "name" : "'Packet Alignment'" }, - { "kind" : "LiteralInteger", "name" : "'Capacity'" } - ], - "capabilities" : [ "PipeStorage" ] - }, - { - "opname" : "OpCreatePipeFromPipeStorage", - "opcode" : 324, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe Storage'" } - ], - "capabilities" : [ "PipeStorage" ] - }, - { - "opname" : "OpGetKernelLocalSizeForSubgroupCount", - "opcode" : 325, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Subgroup Count'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "SubgroupDispatch" ] - }, - { - "opname" : "OpGetKernelMaxNumSubgroups", - "opcode" : 326, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "SubgroupDispatch" ] - }, - { - "opname" : "OpTypeNamedBarrier", - "opcode" : 327, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "NamedBarrier" ] - }, - { - "opname" : "OpNamedBarrierInitialize", - "opcode" : 328, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Subgroup Count'" } - ], - "capabilities" : [ "NamedBarrier" ] - }, - { - "opname" : "OpMemoryNamedBarrier", - "opcode" : 329, - "operands" : [ - { "kind" : "IdRef", "name" : "'Named Barrier'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "NamedBarrier" ] - }, - { - "opname" : "OpModuleProcessed", - "opcode" : 330, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Process'" } - ] - }, - { - "opname" : "OpSubgroupBallotKHR", - "opcode" : 4421, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "opname" : "OpSubgroupFirstInvocationKHR", - "opcode" : 4422, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "opname" : "OpSubgroupAllKHR", - "opcode" : 4428, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupVoteKHR" ] - }, - { - "opname" : "OpSubgroupAnyKHR", - "opcode" : 4429, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupVoteKHR" ] - }, - { - "opname" : "OpSubgroupAllEqualKHR", - "opcode" : 4430, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupVoteKHR" ] - }, - { - "opname" : "OpSubgroupReadInvocationKHR", - "opcode" : 4432, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "opname" : "OpGroupIAddNonUniformAMD", - "opcode" : 5000, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFAddNonUniformAMD", - "opcode" : 5001, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMinNonUniformAMD", - "opcode" : 5002, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMinNonUniformAMD", - "opcode" : 5003, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMinNonUniformAMD", - "opcode" : 5004, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMaxNonUniformAMD", - "opcode" : 5005, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMaxNonUniformAMD", - "opcode" : 5006, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMaxNonUniformAMD", - "opcode" : 5007, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpFragmentMaskFetchAMD", - "opcode" : 5011, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "FragmentMaskAMD" ] - }, - { - "opname" : "OpFragmentFetchAMD", - "opcode" : 5012, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Fragment Index'" } - ], - "capabilities" : [ "FragmentMaskAMD" ] - }, - { - "opname" : "OpSubgroupShuffleINTEL", - "opcode" : 5571, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Data'" }, - { "kind" : "IdRef", "name" : "'InvocationId'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupShuffleDownINTEL", - "opcode" : 5572, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Current'" }, - { "kind" : "IdRef", "name" : "'Next'" }, - { "kind" : "IdRef", "name" : "'Delta'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupShuffleUpINTEL", - "opcode" : 5573, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Previous'" }, - { "kind" : "IdRef", "name" : "'Current'" }, - { "kind" : "IdRef", "name" : "'Delta'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupShuffleXorINTEL", - "opcode" : 5574, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Data'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupBlockReadINTEL", - "opcode" : 5575, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Ptr'" } - ], - "capabilities" : [ "SubgroupBufferBlockIOINTEL" ] - }, - { - "opname" : "OpSubgroupBlockWriteINTEL", - "opcode" : 5576, - "operands" : [ - { "kind" : "IdRef", "name" : "'Ptr'" }, - { "kind" : "IdRef", "name" : "'Data'" } - ], - "capabilities" : [ "SubgroupBufferBlockIOINTEL" ] - }, - { - "opname" : "OpSubgroupImageBlockReadINTEL", - "opcode" : 5577, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "SubgroupImageBlockIOINTEL" ] - }, - { - "opname" : "OpSubgroupImageBlockWriteINTEL", - "opcode" : 5578, - "operands" : [ - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Data'" } - ], - "capabilities" : [ "SubgroupImageBlockIOINTEL" ] - } - ], - "operand_kinds" : [ - { - "category" : "BitEnum", - "kind" : "ImageOperands", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Bias", - "value" : "0x0001", - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Lod", - "value" : "0x0002", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Grad", - "value" : "0x0004", - "parameters" : [ - { "kind" : "IdRef" }, - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "ConstOffset", - "value" : "0x0008", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Offset", - "value" : "0x0010", - "capabilities" : [ "ImageGatherExtended" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "ConstOffsets", - "value" : "0x0020", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Sample", - "value" : "0x0040", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "MinLod", - "value" : "0x0080", - "capabilities" : [ "MinLod" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - } - ] - }, - { - "category" : "BitEnum", - "kind" : "FPFastMathMode", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "NotNaN", - "value" : "0x0001", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NotInf", - "value" : "0x0002", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NSZ", - "value" : "0x0004", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "AllowRecip", - "value" : "0x0008", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Fast", - "value" : "0x0010", - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "BitEnum", - "kind" : "SelectionControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Flatten", - "value" : "0x0001" - }, - { - "enumerant" : "DontFlatten", - "value" : "0x0002" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "LoopControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Unroll", - "value" : "0x0001" - }, - { - "enumerant" : "DontUnroll", - "value" : "0x0002" - }, - { - "enumerant" : "DependencyInfinite", - "value" : "0x0004" - }, - { - "enumerant" : "DependencyLength", - "value" : "0x0008", - "parameters" : [ - { "kind" : "LiteralInteger" } - ] - - } - ] - }, - { - "category" : "BitEnum", - "kind" : "FunctionControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Inline", - "value" : "0x0001" - }, - { - "enumerant" : "DontInline", - "value" : "0x0002" - }, - { - "enumerant" : "Pure", - "value" : "0x0004" - }, - { - "enumerant" : "Const", - "value" : "0x0008" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "MemorySemantics", - "enumerants" : [ - { - "enumerant" : "Relaxed", - "value" : "0x0000" - }, - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Acquire", - "value" : "0x0002" - }, - { - "enumerant" : "Release", - "value" : "0x0004" - }, - { - "enumerant" : "AcquireRelease", - "value" : "0x0008" - }, - { - "enumerant" : "SequentiallyConsistent", - "value" : "0x0010" - }, - { - "enumerant" : "UniformMemory", - "value" : "0x0040", - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SubgroupMemory", - "value" : "0x0080" - }, - { - "enumerant" : "WorkgroupMemory", - "value" : "0x0100" - }, - { - "enumerant" : "CrossWorkgroupMemory", - "value" : "0x0200" - }, - { - "enumerant" : "AtomicCounterMemory", - "value" : "0x0400", - "capabilities" : [ "AtomicStorage" ] - }, - { - "enumerant" : "ImageMemory", - "value" : "0x0800" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "MemoryAccess", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Volatile", - "value" : "0x0001" - }, - { - "enumerant" : "Aligned", - "value" : "0x0002", - "parameters" : [ - { "kind" : "LiteralInteger" } - ] - }, - { - "enumerant" : "Nontemporal", - "value" : "0x0004" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "KernelProfilingInfo", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "CmdExecTime", - "value" : "0x0001", - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SourceLanguage", - "enumerants" : [ - { - "enumerant" : "Unknown", - "value" : 0 - }, - { - "enumerant" : "ESSL", - "value" : 1 - }, - { - "enumerant" : "GLSL", - "value" : 2 - }, - { - "enumerant" : "OpenCL_C", - "value" : 3 - }, - { - "enumerant" : "OpenCL_CPP", - "value" : 4 - }, - { - "enumerant" : "HLSL", - "value" : 5 - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ExecutionModel", - "enumerants" : [ - { - "enumerant" : "Vertex", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "TessellationControl", - "value" : 1, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessellationEvaluation", - "value" : 2, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Geometry", - "value" : 3, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Fragment", - "value" : 4, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLCompute", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Kernel", - "value" : 6, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "AddressingModel", - "enumerants" : [ - { - "enumerant" : "Logical", - "value" : 0 - }, - { - "enumerant" : "Physical32", - "value" : 1, - "capabilities" : [ "Addresses" ] - }, - { - "enumerant" : "Physical64", - "value" : 2, - "capabilities" : [ "Addresses" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "MemoryModel", - "enumerants" : [ - { - "enumerant" : "Simple", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLSL450", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OpenCL", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ExecutionMode", - "enumerants" : [ - { - "enumerant" : "Invocations", - "value" : 0, - "capabilities" : [ "Geometry" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Number of <>'" } - ] - }, - { - "enumerant" : "SpacingEqual", - "value" : 1, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "SpacingFractionalEven", - "value" : 2, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "SpacingFractionalOdd", - "value" : 3, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "VertexOrderCw", - "value" : 4, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "VertexOrderCcw", - "value" : 5, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "PixelCenterInteger", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OriginUpperLeft", - "value" : 7, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OriginLowerLeft", - "value" : 8, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "EarlyFragmentTests", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointMode", - "value" : 10, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Xfb", - "value" : 11, - "capabilities" : [ "TransformFeedback" ] - }, - { - "enumerant" : "DepthReplacing", - "value" : 12, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthGreater", - "value" : 14, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthLess", - "value" : 15, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthUnchanged", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "LocalSize", - "value" : 17, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'x size'" }, - { "kind" : "LiteralInteger", "name" : "'y size'" }, - { "kind" : "LiteralInteger", "name" : "'z size'" } - ] - }, - { - "enumerant" : "LocalSizeHint", - "value" : 18, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'x size'" }, - { "kind" : "LiteralInteger", "name" : "'y size'" }, - { "kind" : "LiteralInteger", "name" : "'z size'" } - ] - }, - { - "enumerant" : "InputPoints", - "value" : 19, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "InputLines", - "value" : 20, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "InputLinesAdjacency", - "value" : 21, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Triangles", - "value" : 22, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "InputTrianglesAdjacency", - "value" : 23, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Quads", - "value" : 24, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Isolines", - "value" : 25, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "OutputVertices", - "value" : 26, - "capabilities" : [ "Geometry", "Tessellation" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Vertex count'" } - ] - }, - { - "enumerant" : "OutputPoints", - "value" : 27, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "OutputLineStrip", - "value" : 28, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "OutputTriangleStrip", - "value" : 29, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "VecTypeHint", - "value" : 30, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Vector type'" } - ] - }, - { - "enumerant" : "ContractionOff", - "value" : 31, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Initializer", - "value" : 33, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Finalizer", - "value" : 34, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupSize", - "value" : 35, - "capabilities" : [ "SubgroupDispatch" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Subgroup Size'" } - ] - }, - { - "enumerant" : "SubgroupsPerWorkgroup", - "value" : 36, - "capabilities" : [ "SubgroupDispatch" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Subgroups Per Workgroup'" } - ] - }, - { - "enumerant" : "PostDepthCoverage", - "value" : 4446, - "capabilities" : [ "SampleMaskPostDepthCoverage" ] - }, - { - "enumerant" : "StencilRefReplacingEXT", - "value" : 5027, - "capabilities" : [ "StencilExportEXT" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "StorageClass", - "enumerants" : [ - { - "enumerant" : "UniformConstant", - "value" : 0 - }, - { - "enumerant" : "Input", - "value" : 1 - }, - { - "enumerant" : "Uniform", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Output", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Workgroup", - "value" : 4 - }, - { - "enumerant" : "CrossWorkgroup", - "value" : 5 - }, - { - "enumerant" : "Private", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Function", - "value" : 7 - }, - { - "enumerant" : "Generic", - "value" : 8, - "capabilities" : [ "GenericPointer" ] - }, - { - "enumerant" : "PushConstant", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "AtomicCounter", - "value" : 10, - "capabilities" : [ "AtomicStorage" ] - }, - { - "enumerant" : "Image", - "value" : 11 - }, - { - "enumerant" : "StorageBuffer", - "value" : 12, - "extensions" : [ - "SPV_KHR_storage_buffer_storage_class", - "SPV_KHR_variable_pointers" - ], - "capabilities" : [ "Shader" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Dim", - "enumerants" : [ - { - "enumerant" : "1D", - "value" : 0, - "capabilities" : [ "Sampled1D" ] - }, - { - "enumerant" : "2D", - "value" : 1 - }, - { - "enumerant" : "3D", - "value" : 2 - }, - { - "enumerant" : "Cube", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rect", - "value" : 4, - "capabilities" : [ "SampledRect" ] - }, - { - "enumerant" : "Buffer", - "value" : 5, - "capabilities" : [ "SampledBuffer" ] - }, - { - "enumerant" : "SubpassData", - "value" : 6, - "capabilities" : [ "InputAttachment" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SamplerAddressingMode", - "enumerants" : [ - { - "enumerant" : "None", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ClampToEdge", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Clamp", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Repeat", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RepeatMirrored", - "value" : 4, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SamplerFilterMode", - "enumerants" : [ - { - "enumerant" : "Nearest", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Linear", - "value" : 1, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageFormat", - "enumerants" : [ - { - "enumerant" : "Unknown", - "value" : 0 - }, - { - "enumerant" : "Rgba32f", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16f", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32f", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8", - "value" : 4, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8Snorm", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rg32f", - "value" : 6, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16f", - "value" : 7, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R11fG11fB10f", - "value" : 8, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16f", - "value" : 9, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba16", - "value" : 10, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgb10A2", - "value" : 11, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16", - "value" : 12, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8", - "value" : 13, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16", - "value" : 14, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8", - "value" : 15, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba16Snorm", - "value" : 16, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16Snorm", - "value" : 17, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8Snorm", - "value" : 18, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16Snorm", - "value" : 19, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8Snorm", - "value" : 20, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba32i", - "value" : 21, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16i", - "value" : 22, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8i", - "value" : 23, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32i", - "value" : 24, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rg32i", - "value" : 25, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16i", - "value" : 26, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8i", - "value" : 27, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16i", - "value" : 28, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8i", - "value" : 29, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba32ui", - "value" : 30, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16ui", - "value" : 31, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8ui", - "value" : 32, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32ui", - "value" : 33, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgb10a2ui", - "value" : 34, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg32ui", - "value" : 35, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16ui", - "value" : 36, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8ui", - "value" : 37, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16ui", - "value" : 38, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8ui", - "value" : 39, - "capabilities" : [ "StorageImageExtendedFormats" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageChannelOrder", - "enumerants" : [ - { - "enumerant" : "R", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "A", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RG", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RA", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGB", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGBA", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "BGRA", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ARGB", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Intensity", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Luminance", - "value" : 9, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Rx", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGx", - "value" : 11, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGBx", - "value" : 12, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Depth", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "DepthStencil", - "value" : 14, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGB", - "value" : 15, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGBx", - "value" : 16, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGBA", - "value" : 17, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sBGRA", - "value" : 18, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ABGR", - "value" : 19, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageChannelDataType", - "enumerants" : [ - { - "enumerant" : "SnormInt8", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SnormInt16", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt8", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt16", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormShort565", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormShort555", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt101010", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt8", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt16", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt32", - "value" : 9, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt8", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt16", - "value" : 11, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt32", - "value" : 12, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "HalfFloat", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float", - "value" : 14, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt24", - "value" : 15, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt101010_2", - "value" : 16, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "FPRoundingMode", - "enumerants" : [ - { - "enumerant" : "RTE", - "value" : 0, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - }, - { - "enumerant" : "RTZ", - "value" : 1, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - }, - { - "enumerant" : "RTP", - "value" : 2, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - }, - { - "enumerant" : "RTN", - "value" : 3, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "LinkageType", - "enumerants" : [ - { - "enumerant" : "Export", - "value" : 0, - "capabilities" : [ "Linkage" ] - }, - { - "enumerant" : "Import", - "value" : 1, - "capabilities" : [ "Linkage" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "AccessQualifier", - "enumerants" : [ - { - "enumerant" : "ReadOnly", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WriteOnly", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ReadWrite", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "FunctionParameterAttribute", - "enumerants" : [ - { - "enumerant" : "Zext", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Sext", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ByVal", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Sret", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoAlias", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoCapture", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoWrite", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoReadWrite", - "value" : 7, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Decoration", - "enumerants" : [ - { - "enumerant" : "RelaxedPrecision", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SpecId", - "value" : 1, - "capabilities" : [ "Shader", "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Specialization Constant ID'" } - ] - }, - { - "enumerant" : "Block", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "BufferBlock", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "RowMajor", - "value" : 4, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "ColMajor", - "value" : 5, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "ArrayStride", - "value" : 6, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Array Stride'" } - ] - }, - { - "enumerant" : "MatrixStride", - "value" : 7, - "capabilities" : [ "Matrix" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Matrix Stride'" } - ] - }, - { - "enumerant" : "GLSLShared", - "value" : 8, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLSLPacked", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "CPacked", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "BuiltIn", - "value" : 11, - "parameters" : [ - { "kind" : "BuiltIn" } - ] - }, - { - "enumerant" : "NoPerspective", - "value" : 13, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Flat", - "value" : 14, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Patch", - "value" : 15, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Centroid", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Sample", - "value" : 17, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "Invariant", - "value" : 18, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Restrict", - "value" : 19 - }, - { - "enumerant" : "Aliased", - "value" : 20 - }, - { - "enumerant" : "Volatile", - "value" : 21 - }, - { - "enumerant" : "Constant", - "value" : 22, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Coherent", - "value" : 23 - }, - { - "enumerant" : "NonWritable", - "value" : 24 - }, - { - "enumerant" : "NonReadable", - "value" : 25 - }, - { - "enumerant" : "Uniform", - "value" : 26, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SaturatedConversion", - "value" : 28, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Stream", - "value" : 29, - "capabilities" : [ "GeometryStreams" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Stream Number'" } - ] - }, - { - "enumerant" : "Location", - "value" : 30, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Location'" } - ] - }, - { - "enumerant" : "Component", - "value" : 31, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Component'" } - ] - }, - { - "enumerant" : "Index", - "value" : 32, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Index'" } - ] - }, - { - "enumerant" : "Binding", - "value" : 33, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Binding Point'" } - ] - }, - { - "enumerant" : "DescriptorSet", - "value" : 34, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Descriptor Set'" } - ] - }, - { - "enumerant" : "Offset", - "value" : 35, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Byte Offset'" } - ] - }, - { - "enumerant" : "XfbBuffer", - "value" : 36, - "capabilities" : [ "TransformFeedback" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'XFB Buffer Number'" } - ] - }, - { - "enumerant" : "XfbStride", - "value" : 37, - "capabilities" : [ "TransformFeedback" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'XFB Stride'" } - ] - }, - { - "enumerant" : "FuncParamAttr", - "value" : 38, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "FunctionParameterAttribute", "name" : "'Function Parameter Attribute'" } - ] - }, - { - "enumerant" : "FPRoundingMode", - "value" : 39, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ], - "parameters" : [ - { "kind" : "FPRoundingMode", "name" : "'Floating-Point Rounding Mode'" } - ] - }, - { - "enumerant" : "FPFastMathMode", - "value" : 40, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "FPFastMathMode", "name" : "'Fast-Math Mode'" } - ] - }, - { - "enumerant" : "LinkageAttributes", - "value" : 41, - "capabilities" : [ "Linkage" ], - "parameters" : [ - { "kind" : "LiteralString", "name" : "'Name'" }, - { "kind" : "LinkageType", "name" : "'Linkage Type'" } - ] - }, - { - "enumerant" : "NoContraction", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InputAttachmentIndex", - "value" : 43, - "capabilities" : [ "InputAttachment" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Attachment Index'" } - ] - }, - { - "enumerant" : "Alignment", - "value" : 44, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Alignment'" } - ] - }, - { - "enumerant" : "MaxByteOffset", - "value" : 45, - "capabilities" : [ "Addresses" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Max Byte Offset'" } - ] - }, - { - "enumerant" : "ExplicitInterpAMD", - "value" : 4999 - }, - { - "enumerant" : "OverrideCoverageNV", - "value" : 5248, - "capabilities" : [ "SampleMaskOverrideCoverageNV" ] - }, - { - "enumerant" : "PassthroughNV", - "value" : 5250, - "capabilities" : [ "GeometryShaderPassthroughNV" ] - }, - { - "enumerant" : "ViewportRelativeNV", - "value" : 5252, - "capabilities" : [ "ShaderViewportMaskNV" ] - }, - { - "enumerant" : "SecondaryViewportRelativeNV", - "value" : 5256, - "capabilities" : [ "ShaderStereoViewNV" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Offset'" } - ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "BuiltIn", - "enumerants" : [ - { - "enumerant" : "Position", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointSize", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ClipDistance", - "value" : 3, - "capabilities" : [ "ClipDistance" ] - }, - { - "enumerant" : "CullDistance", - "value" : 4, - "capabilities" : [ "CullDistance" ] - }, - { - "enumerant" : "VertexId", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InstanceId", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PrimitiveId", - "value" : 7, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "InvocationId", - "value" : 8, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "Layer", - "value" : 9, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "ViewportIndex", - "value" : 10, - "capabilities" : [ "MultiViewport" ] - }, - { - "enumerant" : "TessLevelOuter", - "value" : 11, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessLevelInner", - "value" : 12, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessCoord", - "value" : 13, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "PatchVertices", - "value" : 14, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "FragCoord", - "value" : 15, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointCoord", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "FrontFacing", - "value" : 17, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampleId", - "value" : 18, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "SamplePosition", - "value" : 19, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "SampleMask", - "value" : 20, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "FragDepth", - "value" : 22, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "HelperInvocation", - "value" : 23, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "NumWorkgroups", - "value" : 24 - }, - { - "enumerant" : "WorkgroupSize", - "value" : 25 - }, - { - "enumerant" : "WorkgroupId", - "value" : 26 - }, - { - "enumerant" : "LocalInvocationId", - "value" : 27 - }, - { - "enumerant" : "GlobalInvocationId", - "value" : 28 - }, - { - "enumerant" : "LocalInvocationIndex", - "value" : 29 - }, - { - "enumerant" : "WorkDim", - "value" : 30, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalSize", - "value" : 31, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "EnqueuedWorkgroupSize", - "value" : 32, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalOffset", - "value" : 33, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalLinearId", - "value" : 34, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupSize", - "value" : 36, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupMaxSize", - "value" : 37, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NumSubgroups", - "value" : 38, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NumEnqueuedSubgroups", - "value" : 39, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupId", - "value" : 40, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupLocalInvocationId", - "value" : 41, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "VertexIndex", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InstanceIndex", - "value" : 43, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SubgroupEqMaskKHR", - "value" : 4416, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupGeMaskKHR", - "value" : 4417, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupGtMaskKHR", - "value" : 4418, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupLeMaskKHR", - "value" : 4419, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupLtMaskKHR", - "value" : 4420, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "BaseVertex", - "value" : 4424, - "capabilities" : [ "DrawParameters" ] - }, - { - "enumerant" : "BaseInstance", - "value" : 4425, - "capabilities" : [ "DrawParameters" ] - }, - { - "enumerant" : "DrawIndex", - "value" : 4426, - "capabilities" : [ "DrawParameters" ] - }, - { - "enumerant" : "DeviceIndex", - "value" : 4438, - "capabilities" : [ "DeviceGroup" ] - }, - { - "enumerant" : "ViewIndex", - "value" : 4440, - "capabilities" : [ "MultiView" ] - }, - { - "enumerant" : "BaryCoordNoPerspAMD", - "value" : 4992 - }, - { - "enumerant" : "BaryCoordNoPerspCentroidAMD", - "value" : 4993 - }, - { - "enumerant" : "BaryCoordNoPerspSampleAMD", - "value" : 4994 - }, - { - "enumerant" : "BaryCoordSmoothAMD", - "value" : 4995 - }, - { - "enumerant" : "BaryCoordSmoothCentroidAMD", - "value" : 4996 - }, - { - "enumerant" : "BaryCoordSmoothSampleAMD", - "value" : 4997 - }, - { - "enumerant" : "BaryCoordPullModelAMD", - "value" : 4998 - }, - { - "enumerant" : "FragStencilRefEXT", - "value" : 5014, - "capabilities" : [ "StencilExportEXT" ] - }, - { - "enumerant" : "ViewportMaskNV", - "value" : 5253, - "capabilities" : [ "ShaderViewportMaskNV" ] - }, - { - "enumerant" : "SecondaryPositionNV", - "value" : 5257, - "capabilities" : [ "ShaderStereoViewNV" ] - }, - { - "enumerant" : "SecondaryViewportMaskNV", - "value" : 5258, - "capabilities" : [ "ShaderStereoViewNV" ] - }, - { - "enumerant" : "PositionPerViewNV", - "value" : 5261, - "capabilities" : [ "PerViewAttributesNV" ] - }, - { - "enumerant" : "ViewportMaskPerViewNV", - "value" : 5262, - "capabilities" : [ "PerViewAttributesNV" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Scope", - "enumerants" : [ - { - "enumerant" : "CrossDevice", - "value" : 0 - }, - { - "enumerant" : "Device", - "value" : 1 - }, - { - "enumerant" : "Workgroup", - "value" : 2 - }, - { - "enumerant" : "Subgroup", - "value" : 3 - }, - { - "enumerant" : "Invocation", - "value" : 4 - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "GroupOperation", - "enumerants" : [ - { - "enumerant" : "Reduce", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "InclusiveScan", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ExclusiveScan", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "KernelEnqueueFlags", - "enumerants" : [ - { - "enumerant" : "NoWait", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WaitKernel", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WaitWorkGroup", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Capability", - "enumerants" : [ - { - "enumerant" : "Matrix", - "value" : 0 - }, - { - "enumerant" : "Shader", - "value" : 1, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "Geometry", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Tessellation", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Addresses", - "value" : 4 - }, - { - "enumerant" : "Linkage", - "value" : 5 - }, - { - "enumerant" : "Kernel", - "value" : 6 - }, - { - "enumerant" : "Vector16", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float16Buffer", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float16", - "value" : 9 - }, - { - "enumerant" : "Float64", - "value" : 10 - }, - { - "enumerant" : "Int64", - "value" : 11 - }, - { - "enumerant" : "Int64Atomics", - "value" : 12, - "capabilities" : [ "Int64" ] - }, - { - "enumerant" : "ImageBasic", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ImageReadWrite", - "value" : 14, - "capabilities" : [ "ImageBasic" ] - }, - { - "enumerant" : "ImageMipmap", - "value" : 15, - "capabilities" : [ "ImageBasic" ] - }, - { - "enumerant" : "Pipes", - "value" : 17, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Groups", - "value" : 18 - }, - { - "enumerant" : "DeviceEnqueue", - "value" : 19, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "LiteralSampler", - "value" : 20, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "AtomicStorage", - "value" : 21, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Int16", - "value" : 22 - }, - { - "enumerant" : "TessellationPointSize", - "value" : 23, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "GeometryPointSize", - "value" : 24, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "ImageGatherExtended", - "value" : 25, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageMultisample", - "value" : 27, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "UniformBufferArrayDynamicIndexing", - "value" : 28, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampledImageArrayDynamicIndexing", - "value" : 29, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageBufferArrayDynamicIndexing", - "value" : 30, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageArrayDynamicIndexing", - "value" : 31, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ClipDistance", - "value" : 32, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "CullDistance", - "value" : 33, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageCubeArray", - "value" : 34, - "capabilities" : [ "SampledCubeArray" ] - }, - { - "enumerant" : "SampleRateShading", - "value" : 35, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageRect", - "value" : 36, - "capabilities" : [ "SampledRect" ] - }, - { - "enumerant" : "SampledRect", - "value" : 37, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GenericPointer", - "value" : 38, - "capabilities" : [ "Addresses" ] - }, - { - "enumerant" : "Int8", - "value" : 39, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "InputAttachment", - "value" : 40, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SparseResidency", - "value" : 41, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "MinLod", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Sampled1D", - "value" : 43 - }, - { - "enumerant" : "Image1D", - "value" : 44, - "capabilities" : [ "Sampled1D" ] - }, - { - "enumerant" : "SampledCubeArray", - "value" : 45, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampledBuffer", - "value" : 46 - }, - { - "enumerant" : "ImageBuffer", - "value" : 47, - "capabilities" : [ "SampledBuffer" ] - }, - { - "enumerant" : "ImageMSArray", - "value" : 48, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageExtendedFormats", - "value" : 49, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageQuery", - "value" : 50, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DerivativeControl", - "value" : 51, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InterpolationFunction", - "value" : 52, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "TransformFeedback", - "value" : 53, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GeometryStreams", - "value" : 54, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "StorageImageReadWithoutFormat", - "value" : 55, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageWriteWithoutFormat", - "value" : 56, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "MultiViewport", - "value" : 57, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "SubgroupDispatch", - "value" : 58, - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "enumerant" : "NamedBarrier", - "value" : 59, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "PipeStorage", - "value" : 60, - "capabilities" : [ "Pipes" ] - }, - { - "enumerant" : "SubgroupBallotKHR", - "value" : 4423, - "extensions" : [ "SPV_KHR_shader_ballot" ] - }, - { - "enumerant" : "DrawParameters", - "value" : 4427, - "extensions" : [ "SPV_KHR_shader_draw_parameters" ] - }, - { - "enumerant" : "SubgroupVoteKHR", - "value" : 4431, - "extensions" : [ "SPV_KHR_subgroup_vote" ] - }, - { - "enumerant" : "StorageBuffer16BitAccess", - "value" : 4433, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StorageUniformBufferBlock16", - "value" : 4433, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "UniformAndStorageBuffer16BitAccess", - "value" : 4434, - "capabilities" : [ - "StorageBuffer16BitAccess", - "StorageUniformBufferBlock16" - ], - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StorageUniform16", - "value" : 4434, - "capabilities" : [ - "StorageBuffer16BitAccess", - "StorageUniformBufferBlock16" - ], - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StoragePushConstant16", - "value" : 4435, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StorageInputOutput16", - "value" : 4436, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "DeviceGroup", - "value" : 4437, - "extensions" : [ "SPV_KHR_device_group" ] - }, - { - "enumerant" : "MultiView", - "value" : 4439, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_multiview" ] - }, - { - "enumerant" : "VariablePointersStorageBuffer", - "value" : 4441, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_variable_pointers" ] - }, - { - "enumerant" : "VariablePointers", - "value" : 4442, - "capabilities" : [ "VariablePointersStorageBuffer" ], - "extensions" : [ "SPV_KHR_variable_pointers" ] - }, - { - "enumerant": "AtomicStorageOps", - "value": 4445, - "extensions": [ "SPV_KHR_shader_atomic_counter_ops" ] - }, - { - "enumerant" : "SampleMaskPostDepthCoverage", - "value" : 4447, - "extensions" : [ "SPV_KHR_post_depth_coverage" ] - }, - { - "enumerant" : "ImageGatherBiasLodAMD", - "value" : 5009, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_texture_gather_bias_lod" ] - }, - { - "enumerant" : "FragmentMaskAMD", - "value" : 5010, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_shader_fragment_mask" ] - }, - { - "enumerant" : "StencilExportEXT", - "value" : 5013, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_shader_stencil_export" ] - }, - { - "enumerant" : "ImageReadWriteLodAMD", - "value" : 5015, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_shader_image_load_store_lod" ] - }, - { - "enumerant" : "SampleMaskOverrideCoverageNV", - "value" : 5249, - "capabilities" : [ "SampleRateShading" ], - "extensions" : [ "SPV_NV_sample_mask_override_coverage" ] - }, - { - "enumerant" : "GeometryShaderPassthroughNV", - "value" : 5251, - "capabilities" : [ "Geometry" ], - "extensions" : [ "SPV_NV_geometry_shader_passthrough" ] - }, - { - "enumerant" : "ShaderViewportIndexLayerEXT", - "value" : 5254, - "capabilities" : [ "MultiViewport" ], - "extensions" : [ "SPV_EXT_shader_viewport_index_layer" ] - }, - { - "enumerant" : "ShaderViewportIndexLayerNV", - "value" : 5254, - "capabilities" : [ "MultiViewport" ], - "extensions" : [ "SPV_NV_viewport_array2" ] - }, - { - "enumerant" : "ShaderViewportMaskNV", - "value" : 5255, - "capabilities" : [ "ShaderViewportIndexLayerNV" ], - "extensions" : [ "SPV_NV_viewport_array2" ] - }, - { - "enumerant" : "ShaderStereoViewNV", - "value" : 5259, - "capabilities" : [ "ShaderViewportMaskNV" ], - "extensions" : [ "SPV_NV_stereo_view_rendering" ] - }, - { - "enumerant" : "PerViewAttributesNV", - "value" : 5260, - "capabilities" : [ "MultiView" ], - "extensions" : [ "SPV_NVX_multiview_per_view_attributes" ] - }, - { - "enumerant" : "SubgroupShuffleINTEL", - "value" : 5568, - "extensions" : [ "SPV_INTEL_subgroups" ] - }, - { - "enumerant" : "SubgroupBufferBlockIOINTEL", - "value" : 5569, - "extensions" : [ "SPV_INTEL_subgroups" ] - }, - { - "enumerant" : "SubgroupImageBlockIOINTEL", - "value" : 5570, - "extensions" : [ "SPV_INTEL_subgroups" ] - } - ] - }, - { - "category" : "Id", - "kind" : "IdResultType", - "doc" : "Reference to an representing the result's type of the enclosing instruction" - }, - { - "category" : "Id", - "kind" : "IdResult", - "doc" : "Definition of an representing the result of the enclosing instruction" - }, - { - "category" : "Id", - "kind" : "IdMemorySemantics", - "doc" : "Reference to an representing a 32-bit integer that is a mask from the MemorySemantics operand kind" - }, - { - "category" : "Id", - "kind" : "IdScope", - "doc" : "Reference to an representing a 32-bit integer that is a mask from the Scope operand kind" - }, - { - "category" : "Id", - "kind" : "IdRef", - "doc" : "Reference to an " - }, - { - "category" : "Literal", - "kind" : "LiteralInteger", - "doc" : "An integer consuming one or more words" - }, - { - "category" : "Literal", - "kind" : "LiteralString", - "doc" : "A null-terminated stream of characters consuming an integral number of words" - }, - { - "category" : "Literal", - "kind" : "LiteralContextDependentNumber", - "doc" : "A literal number whose size and format are determined by a previous operand in the enclosing instruction" - }, - { - "category" : "Literal", - "kind" : "LiteralExtInstInteger", - "doc" : "A 32-bit unsigned integer indicating which instruction to use and determining the layout of following operands (for OpExtInst)" - }, - { - "category" : "Literal", - "kind" : "LiteralSpecConstantOpInteger", - "doc" : "An opcode indicating the operation to be performed and determining the layout of following operands (for OpSpecConstantOp)" - }, - { - "category" : "Composite", - "kind" : "PairLiteralIntegerIdRef", - "bases" : [ "LiteralInteger", "IdRef" ] - }, - { - "category" : "Composite", - "kind" : "PairIdRefLiteralInteger", - "bases" : [ "IdRef", "LiteralInteger" ] - }, - { - "category" : "Composite", - "kind" : "PairIdRefIdRef", - "bases" : [ "IdRef", "IdRef" ] - } - ] -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.h vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,1010 +0,0 @@ -/* -** Copyright (c) 2014-2017 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and/or associated documentation files (the "Materials"), -** to deal in the Materials without restriction, including without limitation -** the rights to use, copy, modify, merge, publish, distribute, sublicense, -** and/or sell copies of the Materials, and to permit persons to whom the -** Materials are furnished to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in -** all copies or substantial portions of the Materials. -** -** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -** IN THE MATERIALS. -*/ - -/* -** This header is automatically generated by the same tool that creates -** the Binary Section of the SPIR-V specification. -*/ - -/* -** Enumeration tokens for SPIR-V, in various styles: -** C, C++, C++11, JSON, Lua, Python -** -** - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -** - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -** - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -** - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -** - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -** -** Some tokens act like mask values, which can be OR'd together, -** while others are mutually exclusive. The mask-like ones have -** "Mask" in their name, and a parallel enum that has the shift -** amount (1 << x) for each corresponding enumerant. -*/ - -#ifndef spirv_H -#define spirv_H - -typedef unsigned int SpvId; - -#define SPV_VERSION 0x10100 -#define SPV_REVISION 8 - -static const unsigned int SpvMagicNumber = 0x07230203; -static const unsigned int SpvVersion = 0x00010100; -static const unsigned int SpvRevision = 8; -static const unsigned int SpvOpCodeMask = 0xffff; -static const unsigned int SpvWordCountShift = 16; - -typedef enum SpvSourceLanguage_ { - SpvSourceLanguageUnknown = 0, - SpvSourceLanguageESSL = 1, - SpvSourceLanguageGLSL = 2, - SpvSourceLanguageOpenCL_C = 3, - SpvSourceLanguageOpenCL_CPP = 4, - SpvSourceLanguageHLSL = 5, - SpvSourceLanguageMax = 0x7fffffff, -} SpvSourceLanguage; - -typedef enum SpvExecutionModel_ { - SpvExecutionModelVertex = 0, - SpvExecutionModelTessellationControl = 1, - SpvExecutionModelTessellationEvaluation = 2, - SpvExecutionModelGeometry = 3, - SpvExecutionModelFragment = 4, - SpvExecutionModelGLCompute = 5, - SpvExecutionModelKernel = 6, - SpvExecutionModelMax = 0x7fffffff, -} SpvExecutionModel; - -typedef enum SpvAddressingModel_ { - SpvAddressingModelLogical = 0, - SpvAddressingModelPhysical32 = 1, - SpvAddressingModelPhysical64 = 2, - SpvAddressingModelMax = 0x7fffffff, -} SpvAddressingModel; - -typedef enum SpvMemoryModel_ { - SpvMemoryModelSimple = 0, - SpvMemoryModelGLSL450 = 1, - SpvMemoryModelOpenCL = 2, - SpvMemoryModelMax = 0x7fffffff, -} SpvMemoryModel; - -typedef enum SpvExecutionMode_ { - SpvExecutionModeInvocations = 0, - SpvExecutionModeSpacingEqual = 1, - SpvExecutionModeSpacingFractionalEven = 2, - SpvExecutionModeSpacingFractionalOdd = 3, - SpvExecutionModeVertexOrderCw = 4, - SpvExecutionModeVertexOrderCcw = 5, - SpvExecutionModePixelCenterInteger = 6, - SpvExecutionModeOriginUpperLeft = 7, - SpvExecutionModeOriginLowerLeft = 8, - SpvExecutionModeEarlyFragmentTests = 9, - SpvExecutionModePointMode = 10, - SpvExecutionModeXfb = 11, - SpvExecutionModeDepthReplacing = 12, - SpvExecutionModeDepthGreater = 14, - SpvExecutionModeDepthLess = 15, - SpvExecutionModeDepthUnchanged = 16, - SpvExecutionModeLocalSize = 17, - SpvExecutionModeLocalSizeHint = 18, - SpvExecutionModeInputPoints = 19, - SpvExecutionModeInputLines = 20, - SpvExecutionModeInputLinesAdjacency = 21, - SpvExecutionModeTriangles = 22, - SpvExecutionModeInputTrianglesAdjacency = 23, - SpvExecutionModeQuads = 24, - SpvExecutionModeIsolines = 25, - SpvExecutionModeOutputVertices = 26, - SpvExecutionModeOutputPoints = 27, - SpvExecutionModeOutputLineStrip = 28, - SpvExecutionModeOutputTriangleStrip = 29, - SpvExecutionModeVecTypeHint = 30, - SpvExecutionModeContractionOff = 31, - SpvExecutionModeInitializer = 33, - SpvExecutionModeFinalizer = 34, - SpvExecutionModeSubgroupSize = 35, - SpvExecutionModeSubgroupsPerWorkgroup = 36, - SpvExecutionModePostDepthCoverage = 4446, - SpvExecutionModeStencilRefReplacingEXT = 5027, - SpvExecutionModeMax = 0x7fffffff, -} SpvExecutionMode; - -typedef enum SpvStorageClass_ { - SpvStorageClassUniformConstant = 0, - SpvStorageClassInput = 1, - SpvStorageClassUniform = 2, - SpvStorageClassOutput = 3, - SpvStorageClassWorkgroup = 4, - SpvStorageClassCrossWorkgroup = 5, - SpvStorageClassPrivate = 6, - SpvStorageClassFunction = 7, - SpvStorageClassGeneric = 8, - SpvStorageClassPushConstant = 9, - SpvStorageClassAtomicCounter = 10, - SpvStorageClassImage = 11, - SpvStorageClassStorageBuffer = 12, - SpvStorageClassMax = 0x7fffffff, -} SpvStorageClass; - -typedef enum SpvDim_ { - SpvDim1D = 0, - SpvDim2D = 1, - SpvDim3D = 2, - SpvDimCube = 3, - SpvDimRect = 4, - SpvDimBuffer = 5, - SpvDimSubpassData = 6, - SpvDimMax = 0x7fffffff, -} SpvDim; - -typedef enum SpvSamplerAddressingMode_ { - SpvSamplerAddressingModeNone = 0, - SpvSamplerAddressingModeClampToEdge = 1, - SpvSamplerAddressingModeClamp = 2, - SpvSamplerAddressingModeRepeat = 3, - SpvSamplerAddressingModeRepeatMirrored = 4, - SpvSamplerAddressingModeMax = 0x7fffffff, -} SpvSamplerAddressingMode; - -typedef enum SpvSamplerFilterMode_ { - SpvSamplerFilterModeNearest = 0, - SpvSamplerFilterModeLinear = 1, - SpvSamplerFilterModeMax = 0x7fffffff, -} SpvSamplerFilterMode; - -typedef enum SpvImageFormat_ { - SpvImageFormatUnknown = 0, - SpvImageFormatRgba32f = 1, - SpvImageFormatRgba16f = 2, - SpvImageFormatR32f = 3, - SpvImageFormatRgba8 = 4, - SpvImageFormatRgba8Snorm = 5, - SpvImageFormatRg32f = 6, - SpvImageFormatRg16f = 7, - SpvImageFormatR11fG11fB10f = 8, - SpvImageFormatR16f = 9, - SpvImageFormatRgba16 = 10, - SpvImageFormatRgb10A2 = 11, - SpvImageFormatRg16 = 12, - SpvImageFormatRg8 = 13, - SpvImageFormatR16 = 14, - SpvImageFormatR8 = 15, - SpvImageFormatRgba16Snorm = 16, - SpvImageFormatRg16Snorm = 17, - SpvImageFormatRg8Snorm = 18, - SpvImageFormatR16Snorm = 19, - SpvImageFormatR8Snorm = 20, - SpvImageFormatRgba32i = 21, - SpvImageFormatRgba16i = 22, - SpvImageFormatRgba8i = 23, - SpvImageFormatR32i = 24, - SpvImageFormatRg32i = 25, - SpvImageFormatRg16i = 26, - SpvImageFormatRg8i = 27, - SpvImageFormatR16i = 28, - SpvImageFormatR8i = 29, - SpvImageFormatRgba32ui = 30, - SpvImageFormatRgba16ui = 31, - SpvImageFormatRgba8ui = 32, - SpvImageFormatR32ui = 33, - SpvImageFormatRgb10a2ui = 34, - SpvImageFormatRg32ui = 35, - SpvImageFormatRg16ui = 36, - SpvImageFormatRg8ui = 37, - SpvImageFormatR16ui = 38, - SpvImageFormatR8ui = 39, - SpvImageFormatMax = 0x7fffffff, -} SpvImageFormat; - -typedef enum SpvImageChannelOrder_ { - SpvImageChannelOrderR = 0, - SpvImageChannelOrderA = 1, - SpvImageChannelOrderRG = 2, - SpvImageChannelOrderRA = 3, - SpvImageChannelOrderRGB = 4, - SpvImageChannelOrderRGBA = 5, - SpvImageChannelOrderBGRA = 6, - SpvImageChannelOrderARGB = 7, - SpvImageChannelOrderIntensity = 8, - SpvImageChannelOrderLuminance = 9, - SpvImageChannelOrderRx = 10, - SpvImageChannelOrderRGx = 11, - SpvImageChannelOrderRGBx = 12, - SpvImageChannelOrderDepth = 13, - SpvImageChannelOrderDepthStencil = 14, - SpvImageChannelOrdersRGB = 15, - SpvImageChannelOrdersRGBx = 16, - SpvImageChannelOrdersRGBA = 17, - SpvImageChannelOrdersBGRA = 18, - SpvImageChannelOrderABGR = 19, - SpvImageChannelOrderMax = 0x7fffffff, -} SpvImageChannelOrder; - -typedef enum SpvImageChannelDataType_ { - SpvImageChannelDataTypeSnormInt8 = 0, - SpvImageChannelDataTypeSnormInt16 = 1, - SpvImageChannelDataTypeUnormInt8 = 2, - SpvImageChannelDataTypeUnormInt16 = 3, - SpvImageChannelDataTypeUnormShort565 = 4, - SpvImageChannelDataTypeUnormShort555 = 5, - SpvImageChannelDataTypeUnormInt101010 = 6, - SpvImageChannelDataTypeSignedInt8 = 7, - SpvImageChannelDataTypeSignedInt16 = 8, - SpvImageChannelDataTypeSignedInt32 = 9, - SpvImageChannelDataTypeUnsignedInt8 = 10, - SpvImageChannelDataTypeUnsignedInt16 = 11, - SpvImageChannelDataTypeUnsignedInt32 = 12, - SpvImageChannelDataTypeHalfFloat = 13, - SpvImageChannelDataTypeFloat = 14, - SpvImageChannelDataTypeUnormInt24 = 15, - SpvImageChannelDataTypeUnormInt101010_2 = 16, - SpvImageChannelDataTypeMax = 0x7fffffff, -} SpvImageChannelDataType; - -typedef enum SpvImageOperandsShift_ { - SpvImageOperandsBiasShift = 0, - SpvImageOperandsLodShift = 1, - SpvImageOperandsGradShift = 2, - SpvImageOperandsConstOffsetShift = 3, - SpvImageOperandsOffsetShift = 4, - SpvImageOperandsConstOffsetsShift = 5, - SpvImageOperandsSampleShift = 6, - SpvImageOperandsMinLodShift = 7, - SpvImageOperandsMax = 0x7fffffff, -} SpvImageOperandsShift; - -typedef enum SpvImageOperandsMask_ { - SpvImageOperandsMaskNone = 0, - SpvImageOperandsBiasMask = 0x00000001, - SpvImageOperandsLodMask = 0x00000002, - SpvImageOperandsGradMask = 0x00000004, - SpvImageOperandsConstOffsetMask = 0x00000008, - SpvImageOperandsOffsetMask = 0x00000010, - SpvImageOperandsConstOffsetsMask = 0x00000020, - SpvImageOperandsSampleMask = 0x00000040, - SpvImageOperandsMinLodMask = 0x00000080, -} SpvImageOperandsMask; - -typedef enum SpvFPFastMathModeShift_ { - SpvFPFastMathModeNotNaNShift = 0, - SpvFPFastMathModeNotInfShift = 1, - SpvFPFastMathModeNSZShift = 2, - SpvFPFastMathModeAllowRecipShift = 3, - SpvFPFastMathModeFastShift = 4, - SpvFPFastMathModeMax = 0x7fffffff, -} SpvFPFastMathModeShift; - -typedef enum SpvFPFastMathModeMask_ { - SpvFPFastMathModeMaskNone = 0, - SpvFPFastMathModeNotNaNMask = 0x00000001, - SpvFPFastMathModeNotInfMask = 0x00000002, - SpvFPFastMathModeNSZMask = 0x00000004, - SpvFPFastMathModeAllowRecipMask = 0x00000008, - SpvFPFastMathModeFastMask = 0x00000010, -} SpvFPFastMathModeMask; - -typedef enum SpvFPRoundingMode_ { - SpvFPRoundingModeRTE = 0, - SpvFPRoundingModeRTZ = 1, - SpvFPRoundingModeRTP = 2, - SpvFPRoundingModeRTN = 3, - SpvFPRoundingModeMax = 0x7fffffff, -} SpvFPRoundingMode; - -typedef enum SpvLinkageType_ { - SpvLinkageTypeExport = 0, - SpvLinkageTypeImport = 1, - SpvLinkageTypeMax = 0x7fffffff, -} SpvLinkageType; - -typedef enum SpvAccessQualifier_ { - SpvAccessQualifierReadOnly = 0, - SpvAccessQualifierWriteOnly = 1, - SpvAccessQualifierReadWrite = 2, - SpvAccessQualifierMax = 0x7fffffff, -} SpvAccessQualifier; - -typedef enum SpvFunctionParameterAttribute_ { - SpvFunctionParameterAttributeZext = 0, - SpvFunctionParameterAttributeSext = 1, - SpvFunctionParameterAttributeByVal = 2, - SpvFunctionParameterAttributeSret = 3, - SpvFunctionParameterAttributeNoAlias = 4, - SpvFunctionParameterAttributeNoCapture = 5, - SpvFunctionParameterAttributeNoWrite = 6, - SpvFunctionParameterAttributeNoReadWrite = 7, - SpvFunctionParameterAttributeMax = 0x7fffffff, -} SpvFunctionParameterAttribute; - -typedef enum SpvDecoration_ { - SpvDecorationRelaxedPrecision = 0, - SpvDecorationSpecId = 1, - SpvDecorationBlock = 2, - SpvDecorationBufferBlock = 3, - SpvDecorationRowMajor = 4, - SpvDecorationColMajor = 5, - SpvDecorationArrayStride = 6, - SpvDecorationMatrixStride = 7, - SpvDecorationGLSLShared = 8, - SpvDecorationGLSLPacked = 9, - SpvDecorationCPacked = 10, - SpvDecorationBuiltIn = 11, - SpvDecorationNoPerspective = 13, - SpvDecorationFlat = 14, - SpvDecorationPatch = 15, - SpvDecorationCentroid = 16, - SpvDecorationSample = 17, - SpvDecorationInvariant = 18, - SpvDecorationRestrict = 19, - SpvDecorationAliased = 20, - SpvDecorationVolatile = 21, - SpvDecorationConstant = 22, - SpvDecorationCoherent = 23, - SpvDecorationNonWritable = 24, - SpvDecorationNonReadable = 25, - SpvDecorationUniform = 26, - SpvDecorationSaturatedConversion = 28, - SpvDecorationStream = 29, - SpvDecorationLocation = 30, - SpvDecorationComponent = 31, - SpvDecorationIndex = 32, - SpvDecorationBinding = 33, - SpvDecorationDescriptorSet = 34, - SpvDecorationOffset = 35, - SpvDecorationXfbBuffer = 36, - SpvDecorationXfbStride = 37, - SpvDecorationFuncParamAttr = 38, - SpvDecorationFPRoundingMode = 39, - SpvDecorationFPFastMathMode = 40, - SpvDecorationLinkageAttributes = 41, - SpvDecorationNoContraction = 42, - SpvDecorationInputAttachmentIndex = 43, - SpvDecorationAlignment = 44, - SpvDecorationMaxByteOffset = 45, - SpvDecorationExplicitInterpAMD = 4999, - SpvDecorationOverrideCoverageNV = 5248, - SpvDecorationPassthroughNV = 5250, - SpvDecorationViewportRelativeNV = 5252, - SpvDecorationSecondaryViewportRelativeNV = 5256, - SpvDecorationMax = 0x7fffffff, -} SpvDecoration; - -typedef enum SpvBuiltIn_ { - SpvBuiltInPosition = 0, - SpvBuiltInPointSize = 1, - SpvBuiltInClipDistance = 3, - SpvBuiltInCullDistance = 4, - SpvBuiltInVertexId = 5, - SpvBuiltInInstanceId = 6, - SpvBuiltInPrimitiveId = 7, - SpvBuiltInInvocationId = 8, - SpvBuiltInLayer = 9, - SpvBuiltInViewportIndex = 10, - SpvBuiltInTessLevelOuter = 11, - SpvBuiltInTessLevelInner = 12, - SpvBuiltInTessCoord = 13, - SpvBuiltInPatchVertices = 14, - SpvBuiltInFragCoord = 15, - SpvBuiltInPointCoord = 16, - SpvBuiltInFrontFacing = 17, - SpvBuiltInSampleId = 18, - SpvBuiltInSamplePosition = 19, - SpvBuiltInSampleMask = 20, - SpvBuiltInFragDepth = 22, - SpvBuiltInHelperInvocation = 23, - SpvBuiltInNumWorkgroups = 24, - SpvBuiltInWorkgroupSize = 25, - SpvBuiltInWorkgroupId = 26, - SpvBuiltInLocalInvocationId = 27, - SpvBuiltInGlobalInvocationId = 28, - SpvBuiltInLocalInvocationIndex = 29, - SpvBuiltInWorkDim = 30, - SpvBuiltInGlobalSize = 31, - SpvBuiltInEnqueuedWorkgroupSize = 32, - SpvBuiltInGlobalOffset = 33, - SpvBuiltInGlobalLinearId = 34, - SpvBuiltInSubgroupSize = 36, - SpvBuiltInSubgroupMaxSize = 37, - SpvBuiltInNumSubgroups = 38, - SpvBuiltInNumEnqueuedSubgroups = 39, - SpvBuiltInSubgroupId = 40, - SpvBuiltInSubgroupLocalInvocationId = 41, - SpvBuiltInVertexIndex = 42, - SpvBuiltInInstanceIndex = 43, - SpvBuiltInSubgroupEqMaskKHR = 4416, - SpvBuiltInSubgroupGeMaskKHR = 4417, - SpvBuiltInSubgroupGtMaskKHR = 4418, - SpvBuiltInSubgroupLeMaskKHR = 4419, - SpvBuiltInSubgroupLtMaskKHR = 4420, - SpvBuiltInBaseVertex = 4424, - SpvBuiltInBaseInstance = 4425, - SpvBuiltInDrawIndex = 4426, - SpvBuiltInDeviceIndex = 4438, - SpvBuiltInViewIndex = 4440, - SpvBuiltInBaryCoordNoPerspAMD = 4992, - SpvBuiltInBaryCoordNoPerspCentroidAMD = 4993, - SpvBuiltInBaryCoordNoPerspSampleAMD = 4994, - SpvBuiltInBaryCoordSmoothAMD = 4995, - SpvBuiltInBaryCoordSmoothCentroidAMD = 4996, - SpvBuiltInBaryCoordSmoothSampleAMD = 4997, - SpvBuiltInBaryCoordPullModelAMD = 4998, - SpvBuiltInFragStencilRefEXT = 5014, - SpvBuiltInViewportMaskNV = 5253, - SpvBuiltInSecondaryPositionNV = 5257, - SpvBuiltInSecondaryViewportMaskNV = 5258, - SpvBuiltInPositionPerViewNV = 5261, - SpvBuiltInViewportMaskPerViewNV = 5262, - SpvBuiltInMax = 0x7fffffff, -} SpvBuiltIn; - -typedef enum SpvSelectionControlShift_ { - SpvSelectionControlFlattenShift = 0, - SpvSelectionControlDontFlattenShift = 1, - SpvSelectionControlMax = 0x7fffffff, -} SpvSelectionControlShift; - -typedef enum SpvSelectionControlMask_ { - SpvSelectionControlMaskNone = 0, - SpvSelectionControlFlattenMask = 0x00000001, - SpvSelectionControlDontFlattenMask = 0x00000002, -} SpvSelectionControlMask; - -typedef enum SpvLoopControlShift_ { - SpvLoopControlUnrollShift = 0, - SpvLoopControlDontUnrollShift = 1, - SpvLoopControlDependencyInfiniteShift = 2, - SpvLoopControlDependencyLengthShift = 3, - SpvLoopControlMax = 0x7fffffff, -} SpvLoopControlShift; - -typedef enum SpvLoopControlMask_ { - SpvLoopControlMaskNone = 0, - SpvLoopControlUnrollMask = 0x00000001, - SpvLoopControlDontUnrollMask = 0x00000002, - SpvLoopControlDependencyInfiniteMask = 0x00000004, - SpvLoopControlDependencyLengthMask = 0x00000008, -} SpvLoopControlMask; - -typedef enum SpvFunctionControlShift_ { - SpvFunctionControlInlineShift = 0, - SpvFunctionControlDontInlineShift = 1, - SpvFunctionControlPureShift = 2, - SpvFunctionControlConstShift = 3, - SpvFunctionControlMax = 0x7fffffff, -} SpvFunctionControlShift; - -typedef enum SpvFunctionControlMask_ { - SpvFunctionControlMaskNone = 0, - SpvFunctionControlInlineMask = 0x00000001, - SpvFunctionControlDontInlineMask = 0x00000002, - SpvFunctionControlPureMask = 0x00000004, - SpvFunctionControlConstMask = 0x00000008, -} SpvFunctionControlMask; - -typedef enum SpvMemorySemanticsShift_ { - SpvMemorySemanticsAcquireShift = 1, - SpvMemorySemanticsReleaseShift = 2, - SpvMemorySemanticsAcquireReleaseShift = 3, - SpvMemorySemanticsSequentiallyConsistentShift = 4, - SpvMemorySemanticsUniformMemoryShift = 6, - SpvMemorySemanticsSubgroupMemoryShift = 7, - SpvMemorySemanticsWorkgroupMemoryShift = 8, - SpvMemorySemanticsCrossWorkgroupMemoryShift = 9, - SpvMemorySemanticsAtomicCounterMemoryShift = 10, - SpvMemorySemanticsImageMemoryShift = 11, - SpvMemorySemanticsMax = 0x7fffffff, -} SpvMemorySemanticsShift; - -typedef enum SpvMemorySemanticsMask_ { - SpvMemorySemanticsMaskNone = 0, - SpvMemorySemanticsAcquireMask = 0x00000002, - SpvMemorySemanticsReleaseMask = 0x00000004, - SpvMemorySemanticsAcquireReleaseMask = 0x00000008, - SpvMemorySemanticsSequentiallyConsistentMask = 0x00000010, - SpvMemorySemanticsUniformMemoryMask = 0x00000040, - SpvMemorySemanticsSubgroupMemoryMask = 0x00000080, - SpvMemorySemanticsWorkgroupMemoryMask = 0x00000100, - SpvMemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, - SpvMemorySemanticsAtomicCounterMemoryMask = 0x00000400, - SpvMemorySemanticsImageMemoryMask = 0x00000800, -} SpvMemorySemanticsMask; - -typedef enum SpvMemoryAccessShift_ { - SpvMemoryAccessVolatileShift = 0, - SpvMemoryAccessAlignedShift = 1, - SpvMemoryAccessNontemporalShift = 2, - SpvMemoryAccessMax = 0x7fffffff, -} SpvMemoryAccessShift; - -typedef enum SpvMemoryAccessMask_ { - SpvMemoryAccessMaskNone = 0, - SpvMemoryAccessVolatileMask = 0x00000001, - SpvMemoryAccessAlignedMask = 0x00000002, - SpvMemoryAccessNontemporalMask = 0x00000004, -} SpvMemoryAccessMask; - -typedef enum SpvScope_ { - SpvScopeCrossDevice = 0, - SpvScopeDevice = 1, - SpvScopeWorkgroup = 2, - SpvScopeSubgroup = 3, - SpvScopeInvocation = 4, - SpvScopeMax = 0x7fffffff, -} SpvScope; - -typedef enum SpvGroupOperation_ { - SpvGroupOperationReduce = 0, - SpvGroupOperationInclusiveScan = 1, - SpvGroupOperationExclusiveScan = 2, - SpvGroupOperationMax = 0x7fffffff, -} SpvGroupOperation; - -typedef enum SpvKernelEnqueueFlags_ { - SpvKernelEnqueueFlagsNoWait = 0, - SpvKernelEnqueueFlagsWaitKernel = 1, - SpvKernelEnqueueFlagsWaitWorkGroup = 2, - SpvKernelEnqueueFlagsMax = 0x7fffffff, -} SpvKernelEnqueueFlags; - -typedef enum SpvKernelProfilingInfoShift_ { - SpvKernelProfilingInfoCmdExecTimeShift = 0, - SpvKernelProfilingInfoMax = 0x7fffffff, -} SpvKernelProfilingInfoShift; - -typedef enum SpvKernelProfilingInfoMask_ { - SpvKernelProfilingInfoMaskNone = 0, - SpvKernelProfilingInfoCmdExecTimeMask = 0x00000001, -} SpvKernelProfilingInfoMask; - -typedef enum SpvCapability_ { - SpvCapabilityMatrix = 0, - SpvCapabilityShader = 1, - SpvCapabilityGeometry = 2, - SpvCapabilityTessellation = 3, - SpvCapabilityAddresses = 4, - SpvCapabilityLinkage = 5, - SpvCapabilityKernel = 6, - SpvCapabilityVector16 = 7, - SpvCapabilityFloat16Buffer = 8, - SpvCapabilityFloat16 = 9, - SpvCapabilityFloat64 = 10, - SpvCapabilityInt64 = 11, - SpvCapabilityInt64Atomics = 12, - SpvCapabilityImageBasic = 13, - SpvCapabilityImageReadWrite = 14, - SpvCapabilityImageMipmap = 15, - SpvCapabilityPipes = 17, - SpvCapabilityGroups = 18, - SpvCapabilityDeviceEnqueue = 19, - SpvCapabilityLiteralSampler = 20, - SpvCapabilityAtomicStorage = 21, - SpvCapabilityInt16 = 22, - SpvCapabilityTessellationPointSize = 23, - SpvCapabilityGeometryPointSize = 24, - SpvCapabilityImageGatherExtended = 25, - SpvCapabilityStorageImageMultisample = 27, - SpvCapabilityUniformBufferArrayDynamicIndexing = 28, - SpvCapabilitySampledImageArrayDynamicIndexing = 29, - SpvCapabilityStorageBufferArrayDynamicIndexing = 30, - SpvCapabilityStorageImageArrayDynamicIndexing = 31, - SpvCapabilityClipDistance = 32, - SpvCapabilityCullDistance = 33, - SpvCapabilityImageCubeArray = 34, - SpvCapabilitySampleRateShading = 35, - SpvCapabilityImageRect = 36, - SpvCapabilitySampledRect = 37, - SpvCapabilityGenericPointer = 38, - SpvCapabilityInt8 = 39, - SpvCapabilityInputAttachment = 40, - SpvCapabilitySparseResidency = 41, - SpvCapabilityMinLod = 42, - SpvCapabilitySampled1D = 43, - SpvCapabilityImage1D = 44, - SpvCapabilitySampledCubeArray = 45, - SpvCapabilitySampledBuffer = 46, - SpvCapabilityImageBuffer = 47, - SpvCapabilityImageMSArray = 48, - SpvCapabilityStorageImageExtendedFormats = 49, - SpvCapabilityImageQuery = 50, - SpvCapabilityDerivativeControl = 51, - SpvCapabilityInterpolationFunction = 52, - SpvCapabilityTransformFeedback = 53, - SpvCapabilityGeometryStreams = 54, - SpvCapabilityStorageImageReadWithoutFormat = 55, - SpvCapabilityStorageImageWriteWithoutFormat = 56, - SpvCapabilityMultiViewport = 57, - SpvCapabilitySubgroupDispatch = 58, - SpvCapabilityNamedBarrier = 59, - SpvCapabilityPipeStorage = 60, - SpvCapabilitySubgroupBallotKHR = 4423, - SpvCapabilityDrawParameters = 4427, - SpvCapabilitySubgroupVoteKHR = 4431, - SpvCapabilityStorageBuffer16BitAccess = 4433, - SpvCapabilityStorageUniformBufferBlock16 = 4433, - SpvCapabilityStorageUniform16 = 4434, - SpvCapabilityUniformAndStorageBuffer16BitAccess = 4434, - SpvCapabilityStoragePushConstant16 = 4435, - SpvCapabilityStorageInputOutput16 = 4436, - SpvCapabilityDeviceGroup = 4437, - SpvCapabilityMultiView = 4439, - SpvCapabilityVariablePointersStorageBuffer = 4441, - SpvCapabilityVariablePointers = 4442, - SpvCapabilityAtomicStorageOps = 4445, - SpvCapabilitySampleMaskPostDepthCoverage = 4447, - SpvCapabilityImageGatherBiasLodAMD = 5009, - SpvCapabilityFragmentMaskAMD = 5010, - SpvCapabilityStencilExportEXT = 5013, - SpvCapabilityImageReadWriteLodAMD = 5015, - SpvCapabilitySampleMaskOverrideCoverageNV = 5249, - SpvCapabilityGeometryShaderPassthroughNV = 5251, - SpvCapabilityShaderViewportIndexLayerEXT = 5254, - SpvCapabilityShaderViewportIndexLayerNV = 5254, - SpvCapabilityShaderViewportMaskNV = 5255, - SpvCapabilityShaderStereoViewNV = 5259, - SpvCapabilityPerViewAttributesNV = 5260, - SpvCapabilitySubgroupShuffleINTEL = 5568, - SpvCapabilitySubgroupBufferBlockIOINTEL = 5569, - SpvCapabilitySubgroupImageBlockIOINTEL = 5570, - SpvCapabilityMax = 0x7fffffff, -} SpvCapability; - -typedef enum SpvOp_ { - SpvOpNop = 0, - SpvOpUndef = 1, - SpvOpSourceContinued = 2, - SpvOpSource = 3, - SpvOpSourceExtension = 4, - SpvOpName = 5, - SpvOpMemberName = 6, - SpvOpString = 7, - SpvOpLine = 8, - SpvOpExtension = 10, - SpvOpExtInstImport = 11, - SpvOpExtInst = 12, - SpvOpMemoryModel = 14, - SpvOpEntryPoint = 15, - SpvOpExecutionMode = 16, - SpvOpCapability = 17, - SpvOpTypeVoid = 19, - SpvOpTypeBool = 20, - SpvOpTypeInt = 21, - SpvOpTypeFloat = 22, - SpvOpTypeVector = 23, - SpvOpTypeMatrix = 24, - SpvOpTypeImage = 25, - SpvOpTypeSampler = 26, - SpvOpTypeSampledImage = 27, - SpvOpTypeArray = 28, - SpvOpTypeRuntimeArray = 29, - SpvOpTypeStruct = 30, - SpvOpTypeOpaque = 31, - SpvOpTypePointer = 32, - SpvOpTypeFunction = 33, - SpvOpTypeEvent = 34, - SpvOpTypeDeviceEvent = 35, - SpvOpTypeReserveId = 36, - SpvOpTypeQueue = 37, - SpvOpTypePipe = 38, - SpvOpTypeForwardPointer = 39, - SpvOpConstantTrue = 41, - SpvOpConstantFalse = 42, - SpvOpConstant = 43, - SpvOpConstantComposite = 44, - SpvOpConstantSampler = 45, - SpvOpConstantNull = 46, - SpvOpSpecConstantTrue = 48, - SpvOpSpecConstantFalse = 49, - SpvOpSpecConstant = 50, - SpvOpSpecConstantComposite = 51, - SpvOpSpecConstantOp = 52, - SpvOpFunction = 54, - SpvOpFunctionParameter = 55, - SpvOpFunctionEnd = 56, - SpvOpFunctionCall = 57, - SpvOpVariable = 59, - SpvOpImageTexelPointer = 60, - SpvOpLoad = 61, - SpvOpStore = 62, - SpvOpCopyMemory = 63, - SpvOpCopyMemorySized = 64, - SpvOpAccessChain = 65, - SpvOpInBoundsAccessChain = 66, - SpvOpPtrAccessChain = 67, - SpvOpArrayLength = 68, - SpvOpGenericPtrMemSemantics = 69, - SpvOpInBoundsPtrAccessChain = 70, - SpvOpDecorate = 71, - SpvOpMemberDecorate = 72, - SpvOpDecorationGroup = 73, - SpvOpGroupDecorate = 74, - SpvOpGroupMemberDecorate = 75, - SpvOpVectorExtractDynamic = 77, - SpvOpVectorInsertDynamic = 78, - SpvOpVectorShuffle = 79, - SpvOpCompositeConstruct = 80, - SpvOpCompositeExtract = 81, - SpvOpCompositeInsert = 82, - SpvOpCopyObject = 83, - SpvOpTranspose = 84, - SpvOpSampledImage = 86, - SpvOpImageSampleImplicitLod = 87, - SpvOpImageSampleExplicitLod = 88, - SpvOpImageSampleDrefImplicitLod = 89, - SpvOpImageSampleDrefExplicitLod = 90, - SpvOpImageSampleProjImplicitLod = 91, - SpvOpImageSampleProjExplicitLod = 92, - SpvOpImageSampleProjDrefImplicitLod = 93, - SpvOpImageSampleProjDrefExplicitLod = 94, - SpvOpImageFetch = 95, - SpvOpImageGather = 96, - SpvOpImageDrefGather = 97, - SpvOpImageRead = 98, - SpvOpImageWrite = 99, - SpvOpImage = 100, - SpvOpImageQueryFormat = 101, - SpvOpImageQueryOrder = 102, - SpvOpImageQuerySizeLod = 103, - SpvOpImageQuerySize = 104, - SpvOpImageQueryLod = 105, - SpvOpImageQueryLevels = 106, - SpvOpImageQuerySamples = 107, - SpvOpConvertFToU = 109, - SpvOpConvertFToS = 110, - SpvOpConvertSToF = 111, - SpvOpConvertUToF = 112, - SpvOpUConvert = 113, - SpvOpSConvert = 114, - SpvOpFConvert = 115, - SpvOpQuantizeToF16 = 116, - SpvOpConvertPtrToU = 117, - SpvOpSatConvertSToU = 118, - SpvOpSatConvertUToS = 119, - SpvOpConvertUToPtr = 120, - SpvOpPtrCastToGeneric = 121, - SpvOpGenericCastToPtr = 122, - SpvOpGenericCastToPtrExplicit = 123, - SpvOpBitcast = 124, - SpvOpSNegate = 126, - SpvOpFNegate = 127, - SpvOpIAdd = 128, - SpvOpFAdd = 129, - SpvOpISub = 130, - SpvOpFSub = 131, - SpvOpIMul = 132, - SpvOpFMul = 133, - SpvOpUDiv = 134, - SpvOpSDiv = 135, - SpvOpFDiv = 136, - SpvOpUMod = 137, - SpvOpSRem = 138, - SpvOpSMod = 139, - SpvOpFRem = 140, - SpvOpFMod = 141, - SpvOpVectorTimesScalar = 142, - SpvOpMatrixTimesScalar = 143, - SpvOpVectorTimesMatrix = 144, - SpvOpMatrixTimesVector = 145, - SpvOpMatrixTimesMatrix = 146, - SpvOpOuterProduct = 147, - SpvOpDot = 148, - SpvOpIAddCarry = 149, - SpvOpISubBorrow = 150, - SpvOpUMulExtended = 151, - SpvOpSMulExtended = 152, - SpvOpAny = 154, - SpvOpAll = 155, - SpvOpIsNan = 156, - SpvOpIsInf = 157, - SpvOpIsFinite = 158, - SpvOpIsNormal = 159, - SpvOpSignBitSet = 160, - SpvOpLessOrGreater = 161, - SpvOpOrdered = 162, - SpvOpUnordered = 163, - SpvOpLogicalEqual = 164, - SpvOpLogicalNotEqual = 165, - SpvOpLogicalOr = 166, - SpvOpLogicalAnd = 167, - SpvOpLogicalNot = 168, - SpvOpSelect = 169, - SpvOpIEqual = 170, - SpvOpINotEqual = 171, - SpvOpUGreaterThan = 172, - SpvOpSGreaterThan = 173, - SpvOpUGreaterThanEqual = 174, - SpvOpSGreaterThanEqual = 175, - SpvOpULessThan = 176, - SpvOpSLessThan = 177, - SpvOpULessThanEqual = 178, - SpvOpSLessThanEqual = 179, - SpvOpFOrdEqual = 180, - SpvOpFUnordEqual = 181, - SpvOpFOrdNotEqual = 182, - SpvOpFUnordNotEqual = 183, - SpvOpFOrdLessThan = 184, - SpvOpFUnordLessThan = 185, - SpvOpFOrdGreaterThan = 186, - SpvOpFUnordGreaterThan = 187, - SpvOpFOrdLessThanEqual = 188, - SpvOpFUnordLessThanEqual = 189, - SpvOpFOrdGreaterThanEqual = 190, - SpvOpFUnordGreaterThanEqual = 191, - SpvOpShiftRightLogical = 194, - SpvOpShiftRightArithmetic = 195, - SpvOpShiftLeftLogical = 196, - SpvOpBitwiseOr = 197, - SpvOpBitwiseXor = 198, - SpvOpBitwiseAnd = 199, - SpvOpNot = 200, - SpvOpBitFieldInsert = 201, - SpvOpBitFieldSExtract = 202, - SpvOpBitFieldUExtract = 203, - SpvOpBitReverse = 204, - SpvOpBitCount = 205, - SpvOpDPdx = 207, - SpvOpDPdy = 208, - SpvOpFwidth = 209, - SpvOpDPdxFine = 210, - SpvOpDPdyFine = 211, - SpvOpFwidthFine = 212, - SpvOpDPdxCoarse = 213, - SpvOpDPdyCoarse = 214, - SpvOpFwidthCoarse = 215, - SpvOpEmitVertex = 218, - SpvOpEndPrimitive = 219, - SpvOpEmitStreamVertex = 220, - SpvOpEndStreamPrimitive = 221, - SpvOpControlBarrier = 224, - SpvOpMemoryBarrier = 225, - SpvOpAtomicLoad = 227, - SpvOpAtomicStore = 228, - SpvOpAtomicExchange = 229, - SpvOpAtomicCompareExchange = 230, - SpvOpAtomicCompareExchangeWeak = 231, - SpvOpAtomicIIncrement = 232, - SpvOpAtomicIDecrement = 233, - SpvOpAtomicIAdd = 234, - SpvOpAtomicISub = 235, - SpvOpAtomicSMin = 236, - SpvOpAtomicUMin = 237, - SpvOpAtomicSMax = 238, - SpvOpAtomicUMax = 239, - SpvOpAtomicAnd = 240, - SpvOpAtomicOr = 241, - SpvOpAtomicXor = 242, - SpvOpPhi = 245, - SpvOpLoopMerge = 246, - SpvOpSelectionMerge = 247, - SpvOpLabel = 248, - SpvOpBranch = 249, - SpvOpBranchConditional = 250, - SpvOpSwitch = 251, - SpvOpKill = 252, - SpvOpReturn = 253, - SpvOpReturnValue = 254, - SpvOpUnreachable = 255, - SpvOpLifetimeStart = 256, - SpvOpLifetimeStop = 257, - SpvOpGroupAsyncCopy = 259, - SpvOpGroupWaitEvents = 260, - SpvOpGroupAll = 261, - SpvOpGroupAny = 262, - SpvOpGroupBroadcast = 263, - SpvOpGroupIAdd = 264, - SpvOpGroupFAdd = 265, - SpvOpGroupFMin = 266, - SpvOpGroupUMin = 267, - SpvOpGroupSMin = 268, - SpvOpGroupFMax = 269, - SpvOpGroupUMax = 270, - SpvOpGroupSMax = 271, - SpvOpReadPipe = 274, - SpvOpWritePipe = 275, - SpvOpReservedReadPipe = 276, - SpvOpReservedWritePipe = 277, - SpvOpReserveReadPipePackets = 278, - SpvOpReserveWritePipePackets = 279, - SpvOpCommitReadPipe = 280, - SpvOpCommitWritePipe = 281, - SpvOpIsValidReserveId = 282, - SpvOpGetNumPipePackets = 283, - SpvOpGetMaxPipePackets = 284, - SpvOpGroupReserveReadPipePackets = 285, - SpvOpGroupReserveWritePipePackets = 286, - SpvOpGroupCommitReadPipe = 287, - SpvOpGroupCommitWritePipe = 288, - SpvOpEnqueueMarker = 291, - SpvOpEnqueueKernel = 292, - SpvOpGetKernelNDrangeSubGroupCount = 293, - SpvOpGetKernelNDrangeMaxSubGroupSize = 294, - SpvOpGetKernelWorkGroupSize = 295, - SpvOpGetKernelPreferredWorkGroupSizeMultiple = 296, - SpvOpRetainEvent = 297, - SpvOpReleaseEvent = 298, - SpvOpCreateUserEvent = 299, - SpvOpIsValidEvent = 300, - SpvOpSetUserEventStatus = 301, - SpvOpCaptureEventProfilingInfo = 302, - SpvOpGetDefaultQueue = 303, - SpvOpBuildNDRange = 304, - SpvOpImageSparseSampleImplicitLod = 305, - SpvOpImageSparseSampleExplicitLod = 306, - SpvOpImageSparseSampleDrefImplicitLod = 307, - SpvOpImageSparseSampleDrefExplicitLod = 308, - SpvOpImageSparseSampleProjImplicitLod = 309, - SpvOpImageSparseSampleProjExplicitLod = 310, - SpvOpImageSparseSampleProjDrefImplicitLod = 311, - SpvOpImageSparseSampleProjDrefExplicitLod = 312, - SpvOpImageSparseFetch = 313, - SpvOpImageSparseGather = 314, - SpvOpImageSparseDrefGather = 315, - SpvOpImageSparseTexelsResident = 316, - SpvOpNoLine = 317, - SpvOpAtomicFlagTestAndSet = 318, - SpvOpAtomicFlagClear = 319, - SpvOpImageSparseRead = 320, - SpvOpSizeOf = 321, - SpvOpTypePipeStorage = 322, - SpvOpConstantPipeStorage = 323, - SpvOpCreatePipeFromPipeStorage = 324, - SpvOpGetKernelLocalSizeForSubgroupCount = 325, - SpvOpGetKernelMaxNumSubgroups = 326, - SpvOpTypeNamedBarrier = 327, - SpvOpNamedBarrierInitialize = 328, - SpvOpMemoryNamedBarrier = 329, - SpvOpModuleProcessed = 330, - SpvOpSubgroupBallotKHR = 4421, - SpvOpSubgroupFirstInvocationKHR = 4422, - SpvOpSubgroupAllKHR = 4428, - SpvOpSubgroupAnyKHR = 4429, - SpvOpSubgroupAllEqualKHR = 4430, - SpvOpSubgroupReadInvocationKHR = 4432, - SpvOpGroupIAddNonUniformAMD = 5000, - SpvOpGroupFAddNonUniformAMD = 5001, - SpvOpGroupFMinNonUniformAMD = 5002, - SpvOpGroupUMinNonUniformAMD = 5003, - SpvOpGroupSMinNonUniformAMD = 5004, - SpvOpGroupFMaxNonUniformAMD = 5005, - SpvOpGroupUMaxNonUniformAMD = 5006, - SpvOpGroupSMaxNonUniformAMD = 5007, - SpvOpFragmentMaskFetchAMD = 5011, - SpvOpFragmentFetchAMD = 5012, - SpvOpSubgroupShuffleINTEL = 5571, - SpvOpSubgroupShuffleDownINTEL = 5572, - SpvOpSubgroupShuffleUpINTEL = 5573, - SpvOpSubgroupShuffleXorINTEL = 5574, - SpvOpSubgroupBlockReadINTEL = 5575, - SpvOpSubgroupBlockWriteINTEL = 5576, - SpvOpSubgroupImageBlockReadINTEL = 5577, - SpvOpSubgroupImageBlockWriteINTEL = 5578, - SpvOpMax = 0x7fffffff, -} SpvOp; - -#endif // #ifndef spirv_H - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.hpp vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.hpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.hpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.hpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1019 +0,0 @@ -// Copyright (c) 2014-2017 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -#ifndef spirv_HPP -#define spirv_HPP - -namespace spv { - -typedef unsigned int Id; - -#define SPV_VERSION 0x10100 -#define SPV_REVISION 8 - -static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010100; -static const unsigned int Revision = 8; -static const unsigned int OpCodeMask = 0xffff; -static const unsigned int WordCountShift = 16; - -enum SourceLanguage { - SourceLanguageUnknown = 0, - SourceLanguageESSL = 1, - SourceLanguageGLSL = 2, - SourceLanguageOpenCL_C = 3, - SourceLanguageOpenCL_CPP = 4, - SourceLanguageHLSL = 5, - SourceLanguageMax = 0x7fffffff, -}; - -enum ExecutionModel { - ExecutionModelVertex = 0, - ExecutionModelTessellationControl = 1, - ExecutionModelTessellationEvaluation = 2, - ExecutionModelGeometry = 3, - ExecutionModelFragment = 4, - ExecutionModelGLCompute = 5, - ExecutionModelKernel = 6, - ExecutionModelMax = 0x7fffffff, -}; - -enum AddressingModel { - AddressingModelLogical = 0, - AddressingModelPhysical32 = 1, - AddressingModelPhysical64 = 2, - AddressingModelMax = 0x7fffffff, -}; - -enum MemoryModel { - MemoryModelSimple = 0, - MemoryModelGLSL450 = 1, - MemoryModelOpenCL = 2, - MemoryModelMax = 0x7fffffff, -}; - -enum ExecutionMode { - ExecutionModeInvocations = 0, - ExecutionModeSpacingEqual = 1, - ExecutionModeSpacingFractionalEven = 2, - ExecutionModeSpacingFractionalOdd = 3, - ExecutionModeVertexOrderCw = 4, - ExecutionModeVertexOrderCcw = 5, - ExecutionModePixelCenterInteger = 6, - ExecutionModeOriginUpperLeft = 7, - ExecutionModeOriginLowerLeft = 8, - ExecutionModeEarlyFragmentTests = 9, - ExecutionModePointMode = 10, - ExecutionModeXfb = 11, - ExecutionModeDepthReplacing = 12, - ExecutionModeDepthGreater = 14, - ExecutionModeDepthLess = 15, - ExecutionModeDepthUnchanged = 16, - ExecutionModeLocalSize = 17, - ExecutionModeLocalSizeHint = 18, - ExecutionModeInputPoints = 19, - ExecutionModeInputLines = 20, - ExecutionModeInputLinesAdjacency = 21, - ExecutionModeTriangles = 22, - ExecutionModeInputTrianglesAdjacency = 23, - ExecutionModeQuads = 24, - ExecutionModeIsolines = 25, - ExecutionModeOutputVertices = 26, - ExecutionModeOutputPoints = 27, - ExecutionModeOutputLineStrip = 28, - ExecutionModeOutputTriangleStrip = 29, - ExecutionModeVecTypeHint = 30, - ExecutionModeContractionOff = 31, - ExecutionModeInitializer = 33, - ExecutionModeFinalizer = 34, - ExecutionModeSubgroupSize = 35, - ExecutionModeSubgroupsPerWorkgroup = 36, - ExecutionModePostDepthCoverage = 4446, - ExecutionModeStencilRefReplacingEXT = 5027, - ExecutionModeMax = 0x7fffffff, -}; - -enum StorageClass { - StorageClassUniformConstant = 0, - StorageClassInput = 1, - StorageClassUniform = 2, - StorageClassOutput = 3, - StorageClassWorkgroup = 4, - StorageClassCrossWorkgroup = 5, - StorageClassPrivate = 6, - StorageClassFunction = 7, - StorageClassGeneric = 8, - StorageClassPushConstant = 9, - StorageClassAtomicCounter = 10, - StorageClassImage = 11, - StorageClassStorageBuffer = 12, - StorageClassMax = 0x7fffffff, -}; - -enum Dim { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - DimCube = 3, - DimRect = 4, - DimBuffer = 5, - DimSubpassData = 6, - DimMax = 0x7fffffff, -}; - -enum SamplerAddressingMode { - SamplerAddressingModeNone = 0, - SamplerAddressingModeClampToEdge = 1, - SamplerAddressingModeClamp = 2, - SamplerAddressingModeRepeat = 3, - SamplerAddressingModeRepeatMirrored = 4, - SamplerAddressingModeMax = 0x7fffffff, -}; - -enum SamplerFilterMode { - SamplerFilterModeNearest = 0, - SamplerFilterModeLinear = 1, - SamplerFilterModeMax = 0x7fffffff, -}; - -enum ImageFormat { - ImageFormatUnknown = 0, - ImageFormatRgba32f = 1, - ImageFormatRgba16f = 2, - ImageFormatR32f = 3, - ImageFormatRgba8 = 4, - ImageFormatRgba8Snorm = 5, - ImageFormatRg32f = 6, - ImageFormatRg16f = 7, - ImageFormatR11fG11fB10f = 8, - ImageFormatR16f = 9, - ImageFormatRgba16 = 10, - ImageFormatRgb10A2 = 11, - ImageFormatRg16 = 12, - ImageFormatRg8 = 13, - ImageFormatR16 = 14, - ImageFormatR8 = 15, - ImageFormatRgba16Snorm = 16, - ImageFormatRg16Snorm = 17, - ImageFormatRg8Snorm = 18, - ImageFormatR16Snorm = 19, - ImageFormatR8Snorm = 20, - ImageFormatRgba32i = 21, - ImageFormatRgba16i = 22, - ImageFormatRgba8i = 23, - ImageFormatR32i = 24, - ImageFormatRg32i = 25, - ImageFormatRg16i = 26, - ImageFormatRg8i = 27, - ImageFormatR16i = 28, - ImageFormatR8i = 29, - ImageFormatRgba32ui = 30, - ImageFormatRgba16ui = 31, - ImageFormatRgba8ui = 32, - ImageFormatR32ui = 33, - ImageFormatRgb10a2ui = 34, - ImageFormatRg32ui = 35, - ImageFormatRg16ui = 36, - ImageFormatRg8ui = 37, - ImageFormatR16ui = 38, - ImageFormatR8ui = 39, - ImageFormatMax = 0x7fffffff, -}; - -enum ImageChannelOrder { - ImageChannelOrderR = 0, - ImageChannelOrderA = 1, - ImageChannelOrderRG = 2, - ImageChannelOrderRA = 3, - ImageChannelOrderRGB = 4, - ImageChannelOrderRGBA = 5, - ImageChannelOrderBGRA = 6, - ImageChannelOrderARGB = 7, - ImageChannelOrderIntensity = 8, - ImageChannelOrderLuminance = 9, - ImageChannelOrderRx = 10, - ImageChannelOrderRGx = 11, - ImageChannelOrderRGBx = 12, - ImageChannelOrderDepth = 13, - ImageChannelOrderDepthStencil = 14, - ImageChannelOrdersRGB = 15, - ImageChannelOrdersRGBx = 16, - ImageChannelOrdersRGBA = 17, - ImageChannelOrdersBGRA = 18, - ImageChannelOrderABGR = 19, - ImageChannelOrderMax = 0x7fffffff, -}; - -enum ImageChannelDataType { - ImageChannelDataTypeSnormInt8 = 0, - ImageChannelDataTypeSnormInt16 = 1, - ImageChannelDataTypeUnormInt8 = 2, - ImageChannelDataTypeUnormInt16 = 3, - ImageChannelDataTypeUnormShort565 = 4, - ImageChannelDataTypeUnormShort555 = 5, - ImageChannelDataTypeUnormInt101010 = 6, - ImageChannelDataTypeSignedInt8 = 7, - ImageChannelDataTypeSignedInt16 = 8, - ImageChannelDataTypeSignedInt32 = 9, - ImageChannelDataTypeUnsignedInt8 = 10, - ImageChannelDataTypeUnsignedInt16 = 11, - ImageChannelDataTypeUnsignedInt32 = 12, - ImageChannelDataTypeHalfFloat = 13, - ImageChannelDataTypeFloat = 14, - ImageChannelDataTypeUnormInt24 = 15, - ImageChannelDataTypeUnormInt101010_2 = 16, - ImageChannelDataTypeMax = 0x7fffffff, -}; - -enum ImageOperandsShift { - ImageOperandsBiasShift = 0, - ImageOperandsLodShift = 1, - ImageOperandsGradShift = 2, - ImageOperandsConstOffsetShift = 3, - ImageOperandsOffsetShift = 4, - ImageOperandsConstOffsetsShift = 5, - ImageOperandsSampleShift = 6, - ImageOperandsMinLodShift = 7, - ImageOperandsMax = 0x7fffffff, -}; - -enum ImageOperandsMask { - ImageOperandsMaskNone = 0, - ImageOperandsBiasMask = 0x00000001, - ImageOperandsLodMask = 0x00000002, - ImageOperandsGradMask = 0x00000004, - ImageOperandsConstOffsetMask = 0x00000008, - ImageOperandsOffsetMask = 0x00000010, - ImageOperandsConstOffsetsMask = 0x00000020, - ImageOperandsSampleMask = 0x00000040, - ImageOperandsMinLodMask = 0x00000080, -}; - -enum FPFastMathModeShift { - FPFastMathModeNotNaNShift = 0, - FPFastMathModeNotInfShift = 1, - FPFastMathModeNSZShift = 2, - FPFastMathModeAllowRecipShift = 3, - FPFastMathModeFastShift = 4, - FPFastMathModeMax = 0x7fffffff, -}; - -enum FPFastMathModeMask { - FPFastMathModeMaskNone = 0, - FPFastMathModeNotNaNMask = 0x00000001, - FPFastMathModeNotInfMask = 0x00000002, - FPFastMathModeNSZMask = 0x00000004, - FPFastMathModeAllowRecipMask = 0x00000008, - FPFastMathModeFastMask = 0x00000010, -}; - -enum FPRoundingMode { - FPRoundingModeRTE = 0, - FPRoundingModeRTZ = 1, - FPRoundingModeRTP = 2, - FPRoundingModeRTN = 3, - FPRoundingModeMax = 0x7fffffff, -}; - -enum LinkageType { - LinkageTypeExport = 0, - LinkageTypeImport = 1, - LinkageTypeMax = 0x7fffffff, -}; - -enum AccessQualifier { - AccessQualifierReadOnly = 0, - AccessQualifierWriteOnly = 1, - AccessQualifierReadWrite = 2, - AccessQualifierMax = 0x7fffffff, -}; - -enum FunctionParameterAttribute { - FunctionParameterAttributeZext = 0, - FunctionParameterAttributeSext = 1, - FunctionParameterAttributeByVal = 2, - FunctionParameterAttributeSret = 3, - FunctionParameterAttributeNoAlias = 4, - FunctionParameterAttributeNoCapture = 5, - FunctionParameterAttributeNoWrite = 6, - FunctionParameterAttributeNoReadWrite = 7, - FunctionParameterAttributeMax = 0x7fffffff, -}; - -enum Decoration { - DecorationRelaxedPrecision = 0, - DecorationSpecId = 1, - DecorationBlock = 2, - DecorationBufferBlock = 3, - DecorationRowMajor = 4, - DecorationColMajor = 5, - DecorationArrayStride = 6, - DecorationMatrixStride = 7, - DecorationGLSLShared = 8, - DecorationGLSLPacked = 9, - DecorationCPacked = 10, - DecorationBuiltIn = 11, - DecorationNoPerspective = 13, - DecorationFlat = 14, - DecorationPatch = 15, - DecorationCentroid = 16, - DecorationSample = 17, - DecorationInvariant = 18, - DecorationRestrict = 19, - DecorationAliased = 20, - DecorationVolatile = 21, - DecorationConstant = 22, - DecorationCoherent = 23, - DecorationNonWritable = 24, - DecorationNonReadable = 25, - DecorationUniform = 26, - DecorationSaturatedConversion = 28, - DecorationStream = 29, - DecorationLocation = 30, - DecorationComponent = 31, - DecorationIndex = 32, - DecorationBinding = 33, - DecorationDescriptorSet = 34, - DecorationOffset = 35, - DecorationXfbBuffer = 36, - DecorationXfbStride = 37, - DecorationFuncParamAttr = 38, - DecorationFPRoundingMode = 39, - DecorationFPFastMathMode = 40, - DecorationLinkageAttributes = 41, - DecorationNoContraction = 42, - DecorationInputAttachmentIndex = 43, - DecorationAlignment = 44, - DecorationMaxByteOffset = 45, - DecorationExplicitInterpAMD = 4999, - DecorationOverrideCoverageNV = 5248, - DecorationPassthroughNV = 5250, - DecorationViewportRelativeNV = 5252, - DecorationSecondaryViewportRelativeNV = 5256, - DecorationMax = 0x7fffffff, -}; - -enum BuiltIn { - BuiltInPosition = 0, - BuiltInPointSize = 1, - BuiltInClipDistance = 3, - BuiltInCullDistance = 4, - BuiltInVertexId = 5, - BuiltInInstanceId = 6, - BuiltInPrimitiveId = 7, - BuiltInInvocationId = 8, - BuiltInLayer = 9, - BuiltInViewportIndex = 10, - BuiltInTessLevelOuter = 11, - BuiltInTessLevelInner = 12, - BuiltInTessCoord = 13, - BuiltInPatchVertices = 14, - BuiltInFragCoord = 15, - BuiltInPointCoord = 16, - BuiltInFrontFacing = 17, - BuiltInSampleId = 18, - BuiltInSamplePosition = 19, - BuiltInSampleMask = 20, - BuiltInFragDepth = 22, - BuiltInHelperInvocation = 23, - BuiltInNumWorkgroups = 24, - BuiltInWorkgroupSize = 25, - BuiltInWorkgroupId = 26, - BuiltInLocalInvocationId = 27, - BuiltInGlobalInvocationId = 28, - BuiltInLocalInvocationIndex = 29, - BuiltInWorkDim = 30, - BuiltInGlobalSize = 31, - BuiltInEnqueuedWorkgroupSize = 32, - BuiltInGlobalOffset = 33, - BuiltInGlobalLinearId = 34, - BuiltInSubgroupSize = 36, - BuiltInSubgroupMaxSize = 37, - BuiltInNumSubgroups = 38, - BuiltInNumEnqueuedSubgroups = 39, - BuiltInSubgroupId = 40, - BuiltInSubgroupLocalInvocationId = 41, - BuiltInVertexIndex = 42, - BuiltInInstanceIndex = 43, - BuiltInSubgroupEqMaskKHR = 4416, - BuiltInSubgroupGeMaskKHR = 4417, - BuiltInSubgroupGtMaskKHR = 4418, - BuiltInSubgroupLeMaskKHR = 4419, - BuiltInSubgroupLtMaskKHR = 4420, - BuiltInBaseVertex = 4424, - BuiltInBaseInstance = 4425, - BuiltInDrawIndex = 4426, - BuiltInDeviceIndex = 4438, - BuiltInViewIndex = 4440, - BuiltInBaryCoordNoPerspAMD = 4992, - BuiltInBaryCoordNoPerspCentroidAMD = 4993, - BuiltInBaryCoordNoPerspSampleAMD = 4994, - BuiltInBaryCoordSmoothAMD = 4995, - BuiltInBaryCoordSmoothCentroidAMD = 4996, - BuiltInBaryCoordSmoothSampleAMD = 4997, - BuiltInBaryCoordPullModelAMD = 4998, - BuiltInFragStencilRefEXT = 5014, - BuiltInViewportMaskNV = 5253, - BuiltInSecondaryPositionNV = 5257, - BuiltInSecondaryViewportMaskNV = 5258, - BuiltInPositionPerViewNV = 5261, - BuiltInViewportMaskPerViewNV = 5262, - BuiltInMax = 0x7fffffff, -}; - -enum SelectionControlShift { - SelectionControlFlattenShift = 0, - SelectionControlDontFlattenShift = 1, - SelectionControlMax = 0x7fffffff, -}; - -enum SelectionControlMask { - SelectionControlMaskNone = 0, - SelectionControlFlattenMask = 0x00000001, - SelectionControlDontFlattenMask = 0x00000002, -}; - -enum LoopControlShift { - LoopControlUnrollShift = 0, - LoopControlDontUnrollShift = 1, - LoopControlDependencyInfiniteShift = 2, - LoopControlDependencyLengthShift = 3, - LoopControlMax = 0x7fffffff, -}; - -enum LoopControlMask { - LoopControlMaskNone = 0, - LoopControlUnrollMask = 0x00000001, - LoopControlDontUnrollMask = 0x00000002, - LoopControlDependencyInfiniteMask = 0x00000004, - LoopControlDependencyLengthMask = 0x00000008, -}; - -enum FunctionControlShift { - FunctionControlInlineShift = 0, - FunctionControlDontInlineShift = 1, - FunctionControlPureShift = 2, - FunctionControlConstShift = 3, - FunctionControlMax = 0x7fffffff, -}; - -enum FunctionControlMask { - FunctionControlMaskNone = 0, - FunctionControlInlineMask = 0x00000001, - FunctionControlDontInlineMask = 0x00000002, - FunctionControlPureMask = 0x00000004, - FunctionControlConstMask = 0x00000008, -}; - -enum MemorySemanticsShift { - MemorySemanticsAcquireShift = 1, - MemorySemanticsReleaseShift = 2, - MemorySemanticsAcquireReleaseShift = 3, - MemorySemanticsSequentiallyConsistentShift = 4, - MemorySemanticsUniformMemoryShift = 6, - MemorySemanticsSubgroupMemoryShift = 7, - MemorySemanticsWorkgroupMemoryShift = 8, - MemorySemanticsCrossWorkgroupMemoryShift = 9, - MemorySemanticsAtomicCounterMemoryShift = 10, - MemorySemanticsImageMemoryShift = 11, - MemorySemanticsMax = 0x7fffffff, -}; - -enum MemorySemanticsMask { - MemorySemanticsMaskNone = 0, - MemorySemanticsAcquireMask = 0x00000002, - MemorySemanticsReleaseMask = 0x00000004, - MemorySemanticsAcquireReleaseMask = 0x00000008, - MemorySemanticsSequentiallyConsistentMask = 0x00000010, - MemorySemanticsUniformMemoryMask = 0x00000040, - MemorySemanticsSubgroupMemoryMask = 0x00000080, - MemorySemanticsWorkgroupMemoryMask = 0x00000100, - MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, - MemorySemanticsAtomicCounterMemoryMask = 0x00000400, - MemorySemanticsImageMemoryMask = 0x00000800, -}; - -enum MemoryAccessShift { - MemoryAccessVolatileShift = 0, - MemoryAccessAlignedShift = 1, - MemoryAccessNontemporalShift = 2, - MemoryAccessMax = 0x7fffffff, -}; - -enum MemoryAccessMask { - MemoryAccessMaskNone = 0, - MemoryAccessVolatileMask = 0x00000001, - MemoryAccessAlignedMask = 0x00000002, - MemoryAccessNontemporalMask = 0x00000004, -}; - -enum Scope { - ScopeCrossDevice = 0, - ScopeDevice = 1, - ScopeWorkgroup = 2, - ScopeSubgroup = 3, - ScopeInvocation = 4, - ScopeMax = 0x7fffffff, -}; - -enum GroupOperation { - GroupOperationReduce = 0, - GroupOperationInclusiveScan = 1, - GroupOperationExclusiveScan = 2, - GroupOperationMax = 0x7fffffff, -}; - -enum KernelEnqueueFlags { - KernelEnqueueFlagsNoWait = 0, - KernelEnqueueFlagsWaitKernel = 1, - KernelEnqueueFlagsWaitWorkGroup = 2, - KernelEnqueueFlagsMax = 0x7fffffff, -}; - -enum KernelProfilingInfoShift { - KernelProfilingInfoCmdExecTimeShift = 0, - KernelProfilingInfoMax = 0x7fffffff, -}; - -enum KernelProfilingInfoMask { - KernelProfilingInfoMaskNone = 0, - KernelProfilingInfoCmdExecTimeMask = 0x00000001, -}; - -enum Capability { - CapabilityMatrix = 0, - CapabilityShader = 1, - CapabilityGeometry = 2, - CapabilityTessellation = 3, - CapabilityAddresses = 4, - CapabilityLinkage = 5, - CapabilityKernel = 6, - CapabilityVector16 = 7, - CapabilityFloat16Buffer = 8, - CapabilityFloat16 = 9, - CapabilityFloat64 = 10, - CapabilityInt64 = 11, - CapabilityInt64Atomics = 12, - CapabilityImageBasic = 13, - CapabilityImageReadWrite = 14, - CapabilityImageMipmap = 15, - CapabilityPipes = 17, - CapabilityGroups = 18, - CapabilityDeviceEnqueue = 19, - CapabilityLiteralSampler = 20, - CapabilityAtomicStorage = 21, - CapabilityInt16 = 22, - CapabilityTessellationPointSize = 23, - CapabilityGeometryPointSize = 24, - CapabilityImageGatherExtended = 25, - CapabilityStorageImageMultisample = 27, - CapabilityUniformBufferArrayDynamicIndexing = 28, - CapabilitySampledImageArrayDynamicIndexing = 29, - CapabilityStorageBufferArrayDynamicIndexing = 30, - CapabilityStorageImageArrayDynamicIndexing = 31, - CapabilityClipDistance = 32, - CapabilityCullDistance = 33, - CapabilityImageCubeArray = 34, - CapabilitySampleRateShading = 35, - CapabilityImageRect = 36, - CapabilitySampledRect = 37, - CapabilityGenericPointer = 38, - CapabilityInt8 = 39, - CapabilityInputAttachment = 40, - CapabilitySparseResidency = 41, - CapabilityMinLod = 42, - CapabilitySampled1D = 43, - CapabilityImage1D = 44, - CapabilitySampledCubeArray = 45, - CapabilitySampledBuffer = 46, - CapabilityImageBuffer = 47, - CapabilityImageMSArray = 48, - CapabilityStorageImageExtendedFormats = 49, - CapabilityImageQuery = 50, - CapabilityDerivativeControl = 51, - CapabilityInterpolationFunction = 52, - CapabilityTransformFeedback = 53, - CapabilityGeometryStreams = 54, - CapabilityStorageImageReadWithoutFormat = 55, - CapabilityStorageImageWriteWithoutFormat = 56, - CapabilityMultiViewport = 57, - CapabilitySubgroupDispatch = 58, - CapabilityNamedBarrier = 59, - CapabilityPipeStorage = 60, - CapabilitySubgroupBallotKHR = 4423, - CapabilityDrawParameters = 4427, - CapabilitySubgroupVoteKHR = 4431, - CapabilityStorageBuffer16BitAccess = 4433, - CapabilityStorageUniformBufferBlock16 = 4433, - CapabilityStorageUniform16 = 4434, - CapabilityUniformAndStorageBuffer16BitAccess = 4434, - CapabilityStoragePushConstant16 = 4435, - CapabilityStorageInputOutput16 = 4436, - CapabilityDeviceGroup = 4437, - CapabilityMultiView = 4439, - CapabilityVariablePointersStorageBuffer = 4441, - CapabilityVariablePointers = 4442, - CapabilityAtomicStorageOps = 4445, - CapabilitySampleMaskPostDepthCoverage = 4447, - CapabilityImageGatherBiasLodAMD = 5009, - CapabilityFragmentMaskAMD = 5010, - CapabilityStencilExportEXT = 5013, - CapabilityImageReadWriteLodAMD = 5015, - CapabilitySampleMaskOverrideCoverageNV = 5249, - CapabilityGeometryShaderPassthroughNV = 5251, - CapabilityShaderViewportIndexLayerEXT = 5254, - CapabilityShaderViewportIndexLayerNV = 5254, - CapabilityShaderViewportMaskNV = 5255, - CapabilityShaderStereoViewNV = 5259, - CapabilityPerViewAttributesNV = 5260, - CapabilitySubgroupShuffleINTEL = 5568, - CapabilitySubgroupBufferBlockIOINTEL = 5569, - CapabilitySubgroupImageBlockIOINTEL = 5570, - CapabilityMax = 0x7fffffff, -}; - -enum Op { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpMax = 0x7fffffff, -}; - -// Overload operator| for mask bit combining - -inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } -inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } -inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } -inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } -inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } -inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } -inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } -inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } - -} // end namespace spv - -#endif // #ifndef spirv_HPP - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.hpp11 vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.hpp11 --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.hpp11 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.hpp11 1970-01-01 00:00:00.000000000 +0000 @@ -1,1019 +0,0 @@ -// Copyright (c) 2014-2017 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -#ifndef spirv_HPP -#define spirv_HPP - -namespace spv { - -typedef unsigned int Id; - -#define SPV_VERSION 0x10100 -#define SPV_REVISION 8 - -static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010100; -static const unsigned int Revision = 8; -static const unsigned int OpCodeMask = 0xffff; -static const unsigned int WordCountShift = 16; - -enum class SourceLanguage : unsigned { - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - Max = 0x7fffffff, -}; - -enum class ExecutionModel : unsigned { - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - Max = 0x7fffffff, -}; - -enum class AddressingModel : unsigned { - Logical = 0, - Physical32 = 1, - Physical64 = 2, - Max = 0x7fffffff, -}; - -enum class MemoryModel : unsigned { - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - Max = 0x7fffffff, -}; - -enum class ExecutionMode : unsigned { - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - Initializer = 33, - Finalizer = 34, - SubgroupSize = 35, - SubgroupsPerWorkgroup = 36, - PostDepthCoverage = 4446, - StencilRefReplacingEXT = 5027, - Max = 0x7fffffff, -}; - -enum class StorageClass : unsigned { - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - Max = 0x7fffffff, -}; - -enum class Dim : unsigned { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, - Max = 0x7fffffff, -}; - -enum class SamplerAddressingMode : unsigned { - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, - Max = 0x7fffffff, -}; - -enum class SamplerFilterMode : unsigned { - Nearest = 0, - Linear = 1, - Max = 0x7fffffff, -}; - -enum class ImageFormat : unsigned { - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - Max = 0x7fffffff, -}; - -enum class ImageChannelOrder : unsigned { - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, - Max = 0x7fffffff, -}; - -enum class ImageChannelDataType : unsigned { - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, - Max = 0x7fffffff, -}; - -enum class ImageOperandsShift : unsigned { - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - Max = 0x7fffffff, -}; - -enum class ImageOperandsMask : unsigned { - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, -}; - -enum class FPFastMathModeShift : unsigned { - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - Max = 0x7fffffff, -}; - -enum class FPFastMathModeMask : unsigned { - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, -}; - -enum class FPRoundingMode : unsigned { - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, - Max = 0x7fffffff, -}; - -enum class LinkageType : unsigned { - Export = 0, - Import = 1, - Max = 0x7fffffff, -}; - -enum class AccessQualifier : unsigned { - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, - Max = 0x7fffffff, -}; - -enum class FunctionParameterAttribute : unsigned { - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, - Max = 0x7fffffff, -}; - -enum class Decoration : unsigned { - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - MaxByteOffset = 45, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - Max = 0x7fffffff, -}; - -enum class BuiltIn : unsigned { - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMaskKHR = 4416, - SubgroupGeMaskKHR = 4417, - SubgroupGtMaskKHR = 4418, - SubgroupLeMaskKHR = 4419, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - DeviceIndex = 4438, - ViewIndex = 4440, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - Max = 0x7fffffff, -}; - -enum class SelectionControlShift : unsigned { - Flatten = 0, - DontFlatten = 1, - Max = 0x7fffffff, -}; - -enum class SelectionControlMask : unsigned { - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, -}; - -enum class LoopControlShift : unsigned { - Unroll = 0, - DontUnroll = 1, - DependencyInfinite = 2, - DependencyLength = 3, - Max = 0x7fffffff, -}; - -enum class LoopControlMask : unsigned { - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, - DependencyInfinite = 0x00000004, - DependencyLength = 0x00000008, -}; - -enum class FunctionControlShift : unsigned { - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - Max = 0x7fffffff, -}; - -enum class FunctionControlMask : unsigned { - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, -}; - -enum class MemorySemanticsShift : unsigned { - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - Max = 0x7fffffff, -}; - -enum class MemorySemanticsMask : unsigned { - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, -}; - -enum class MemoryAccessShift : unsigned { - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - Max = 0x7fffffff, -}; - -enum class MemoryAccessMask : unsigned { - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, -}; - -enum class Scope : unsigned { - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - Max = 0x7fffffff, -}; - -enum class GroupOperation : unsigned { - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - Max = 0x7fffffff, -}; - -enum class KernelEnqueueFlags : unsigned { - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, - Max = 0x7fffffff, -}; - -enum class KernelProfilingInfoShift : unsigned { - CmdExecTime = 0, - Max = 0x7fffffff, -}; - -enum class KernelProfilingInfoMask : unsigned { - MaskNone = 0, - CmdExecTime = 0x00000001, -}; - -enum class Capability : unsigned { - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupDispatch = 58, - NamedBarrier = 59, - PipeStorage = 60, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - Max = 0x7fffffff, -}; - -enum class Op : unsigned { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - Max = 0x7fffffff, -}; - -// Overload operator| for mask bit combining - -inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } -inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } -inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } -inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } -inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } -inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } -inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } -inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } - -} // end namespace spv - -#endif // #ifndef spirv_HPP - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.json vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.json --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.json 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,1035 +0,0 @@ -{ - "spv": - { - "meta": - { - "Comment": - [ - [ - "Copyright (c) 2014-2017 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - [ - "This header is automatically generated by the same tool that creates", - "the Binary Section of the SPIR-V specification." - ], - [ - "Enumeration tokens for SPIR-V, in various styles:", - " C, C++, C++11, JSON, Lua, Python", - "", - "- C will have tokens with a \"Spv\" prefix, e.g.: SpvSourceLanguageGLSL", - "- C++ will have tokens in the \"spv\" name space, e.g.: spv::SourceLanguageGLSL", - "- C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL", - "- Lua will use tables, e.g.: spv.SourceLanguage.GLSL", - "- Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']", - "", - "Some tokens act like mask values, which can be OR'd together,", - "while others are mutually exclusive. The mask-like ones have", - "\"Mask\" in their name, and a parallel enum that has the shift", - "amount (1 << x) for each corresponding enumerant." - ] - ], - "MagicNumber": 119734787, - "Version": 65792, - "Revision": 8, - "OpCodeMask": 65535, - "WordCountShift": 16 - }, - "enum": - [ - { - "Name": "SourceLanguage", - "Type": "Value", - "Values": - { - "Unknown": 0, - "ESSL": 1, - "GLSL": 2, - "OpenCL_C": 3, - "OpenCL_CPP": 4, - "HLSL": 5 - } - }, - { - "Name": "ExecutionModel", - "Type": "Value", - "Values": - { - "Vertex": 0, - "TessellationControl": 1, - "TessellationEvaluation": 2, - "Geometry": 3, - "Fragment": 4, - "GLCompute": 5, - "Kernel": 6 - } - }, - { - "Name": "AddressingModel", - "Type": "Value", - "Values": - { - "Logical": 0, - "Physical32": 1, - "Physical64": 2 - } - }, - { - "Name": "MemoryModel", - "Type": "Value", - "Values": - { - "Simple": 0, - "GLSL450": 1, - "OpenCL": 2 - } - }, - { - "Name": "ExecutionMode", - "Type": "Value", - "Values": - { - "Invocations": 0, - "SpacingEqual": 1, - "SpacingFractionalEven": 2, - "SpacingFractionalOdd": 3, - "VertexOrderCw": 4, - "VertexOrderCcw": 5, - "PixelCenterInteger": 6, - "OriginUpperLeft": 7, - "OriginLowerLeft": 8, - "EarlyFragmentTests": 9, - "PointMode": 10, - "Xfb": 11, - "DepthReplacing": 12, - "DepthGreater": 14, - "DepthLess": 15, - "DepthUnchanged": 16, - "LocalSize": 17, - "LocalSizeHint": 18, - "InputPoints": 19, - "InputLines": 20, - "InputLinesAdjacency": 21, - "Triangles": 22, - "InputTrianglesAdjacency": 23, - "Quads": 24, - "Isolines": 25, - "OutputVertices": 26, - "OutputPoints": 27, - "OutputLineStrip": 28, - "OutputTriangleStrip": 29, - "VecTypeHint": 30, - "ContractionOff": 31, - "Initializer": 33, - "Finalizer": 34, - "SubgroupSize": 35, - "SubgroupsPerWorkgroup": 36, - "PostDepthCoverage": 4446, - "StencilRefReplacingEXT": 5027 - } - }, - { - "Name": "StorageClass", - "Type": "Value", - "Values": - { - "UniformConstant": 0, - "Input": 1, - "Uniform": 2, - "Output": 3, - "Workgroup": 4, - "CrossWorkgroup": 5, - "Private": 6, - "Function": 7, - "Generic": 8, - "PushConstant": 9, - "AtomicCounter": 10, - "Image": 11, - "StorageBuffer": 12 - } - }, - { - "Name": "Dim", - "Type": "Value", - "Values": - { - "Dim1D": 0, - "Dim2D": 1, - "Dim3D": 2, - "Cube": 3, - "Rect": 4, - "Buffer": 5, - "SubpassData": 6 - } - }, - { - "Name": "SamplerAddressingMode", - "Type": "Value", - "Values": - { - "None": 0, - "ClampToEdge": 1, - "Clamp": 2, - "Repeat": 3, - "RepeatMirrored": 4 - } - }, - { - "Name": "SamplerFilterMode", - "Type": "Value", - "Values": - { - "Nearest": 0, - "Linear": 1 - } - }, - { - "Name": "ImageFormat", - "Type": "Value", - "Values": - { - "Unknown": 0, - "Rgba32f": 1, - "Rgba16f": 2, - "R32f": 3, - "Rgba8": 4, - "Rgba8Snorm": 5, - "Rg32f": 6, - "Rg16f": 7, - "R11fG11fB10f": 8, - "R16f": 9, - "Rgba16": 10, - "Rgb10A2": 11, - "Rg16": 12, - "Rg8": 13, - "R16": 14, - "R8": 15, - "Rgba16Snorm": 16, - "Rg16Snorm": 17, - "Rg8Snorm": 18, - "R16Snorm": 19, - "R8Snorm": 20, - "Rgba32i": 21, - "Rgba16i": 22, - "Rgba8i": 23, - "R32i": 24, - "Rg32i": 25, - "Rg16i": 26, - "Rg8i": 27, - "R16i": 28, - "R8i": 29, - "Rgba32ui": 30, - "Rgba16ui": 31, - "Rgba8ui": 32, - "R32ui": 33, - "Rgb10a2ui": 34, - "Rg32ui": 35, - "Rg16ui": 36, - "Rg8ui": 37, - "R16ui": 38, - "R8ui": 39 - } - }, - { - "Name": "ImageChannelOrder", - "Type": "Value", - "Values": - { - "R": 0, - "A": 1, - "RG": 2, - "RA": 3, - "RGB": 4, - "RGBA": 5, - "BGRA": 6, - "ARGB": 7, - "Intensity": 8, - "Luminance": 9, - "Rx": 10, - "RGx": 11, - "RGBx": 12, - "Depth": 13, - "DepthStencil": 14, - "sRGB": 15, - "sRGBx": 16, - "sRGBA": 17, - "sBGRA": 18, - "ABGR": 19 - } - }, - { - "Name": "ImageChannelDataType", - "Type": "Value", - "Values": - { - "SnormInt8": 0, - "SnormInt16": 1, - "UnormInt8": 2, - "UnormInt16": 3, - "UnormShort565": 4, - "UnormShort555": 5, - "UnormInt101010": 6, - "SignedInt8": 7, - "SignedInt16": 8, - "SignedInt32": 9, - "UnsignedInt8": 10, - "UnsignedInt16": 11, - "UnsignedInt32": 12, - "HalfFloat": 13, - "Float": 14, - "UnormInt24": 15, - "UnormInt101010_2": 16 - } - }, - { - "Name": "ImageOperands", - "Type": "Bit", - "Values": - { - "Bias": 0, - "Lod": 1, - "Grad": 2, - "ConstOffset": 3, - "Offset": 4, - "ConstOffsets": 5, - "Sample": 6, - "MinLod": 7 - } - }, - { - "Name": "FPFastMathMode", - "Type": "Bit", - "Values": - { - "NotNaN": 0, - "NotInf": 1, - "NSZ": 2, - "AllowRecip": 3, - "Fast": 4 - } - }, - { - "Name": "FPRoundingMode", - "Type": "Value", - "Values": - { - "RTE": 0, - "RTZ": 1, - "RTP": 2, - "RTN": 3 - } - }, - { - "Name": "LinkageType", - "Type": "Value", - "Values": - { - "Export": 0, - "Import": 1 - } - }, - { - "Name": "AccessQualifier", - "Type": "Value", - "Values": - { - "ReadOnly": 0, - "WriteOnly": 1, - "ReadWrite": 2 - } - }, - { - "Name": "FunctionParameterAttribute", - "Type": "Value", - "Values": - { - "Zext": 0, - "Sext": 1, - "ByVal": 2, - "Sret": 3, - "NoAlias": 4, - "NoCapture": 5, - "NoWrite": 6, - "NoReadWrite": 7 - } - }, - { - "Name": "Decoration", - "Type": "Value", - "Values": - { - "RelaxedPrecision": 0, - "SpecId": 1, - "Block": 2, - "BufferBlock": 3, - "RowMajor": 4, - "ColMajor": 5, - "ArrayStride": 6, - "MatrixStride": 7, - "GLSLShared": 8, - "GLSLPacked": 9, - "CPacked": 10, - "BuiltIn": 11, - "NoPerspective": 13, - "Flat": 14, - "Patch": 15, - "Centroid": 16, - "Sample": 17, - "Invariant": 18, - "Restrict": 19, - "Aliased": 20, - "Volatile": 21, - "Constant": 22, - "Coherent": 23, - "NonWritable": 24, - "NonReadable": 25, - "Uniform": 26, - "SaturatedConversion": 28, - "Stream": 29, - "Location": 30, - "Component": 31, - "Index": 32, - "Binding": 33, - "DescriptorSet": 34, - "Offset": 35, - "XfbBuffer": 36, - "XfbStride": 37, - "FuncParamAttr": 38, - "FPRoundingMode": 39, - "FPFastMathMode": 40, - "LinkageAttributes": 41, - "NoContraction": 42, - "InputAttachmentIndex": 43, - "Alignment": 44, - "MaxByteOffset": 45, - "ExplicitInterpAMD": 4999, - "OverrideCoverageNV": 5248, - "PassthroughNV": 5250, - "ViewportRelativeNV": 5252, - "SecondaryViewportRelativeNV": 5256 - } - }, - { - "Name": "BuiltIn", - "Type": "Value", - "Values": - { - "Position": 0, - "PointSize": 1, - "ClipDistance": 3, - "CullDistance": 4, - "VertexId": 5, - "InstanceId": 6, - "PrimitiveId": 7, - "InvocationId": 8, - "Layer": 9, - "ViewportIndex": 10, - "TessLevelOuter": 11, - "TessLevelInner": 12, - "TessCoord": 13, - "PatchVertices": 14, - "FragCoord": 15, - "PointCoord": 16, - "FrontFacing": 17, - "SampleId": 18, - "SamplePosition": 19, - "SampleMask": 20, - "FragDepth": 22, - "HelperInvocation": 23, - "NumWorkgroups": 24, - "WorkgroupSize": 25, - "WorkgroupId": 26, - "LocalInvocationId": 27, - "GlobalInvocationId": 28, - "LocalInvocationIndex": 29, - "WorkDim": 30, - "GlobalSize": 31, - "EnqueuedWorkgroupSize": 32, - "GlobalOffset": 33, - "GlobalLinearId": 34, - "SubgroupSize": 36, - "SubgroupMaxSize": 37, - "NumSubgroups": 38, - "NumEnqueuedSubgroups": 39, - "SubgroupId": 40, - "SubgroupLocalInvocationId": 41, - "VertexIndex": 42, - "InstanceIndex": 43, - "SubgroupEqMaskKHR": 4416, - "SubgroupGeMaskKHR": 4417, - "SubgroupGtMaskKHR": 4418, - "SubgroupLeMaskKHR": 4419, - "SubgroupLtMaskKHR": 4420, - "BaseVertex": 4424, - "BaseInstance": 4425, - "DrawIndex": 4426, - "DeviceIndex": 4438, - "ViewIndex": 4440, - "BaryCoordNoPerspAMD": 4992, - "BaryCoordNoPerspCentroidAMD": 4993, - "BaryCoordNoPerspSampleAMD": 4994, - "BaryCoordSmoothAMD": 4995, - "BaryCoordSmoothCentroidAMD": 4996, - "BaryCoordSmoothSampleAMD": 4997, - "BaryCoordPullModelAMD": 4998, - "FragStencilRefEXT": 5014, - "ViewportMaskNV": 5253, - "SecondaryPositionNV": 5257, - "SecondaryViewportMaskNV": 5258, - "PositionPerViewNV": 5261, - "ViewportMaskPerViewNV": 5262 - } - }, - { - "Name": "SelectionControl", - "Type": "Bit", - "Values": - { - "Flatten": 0, - "DontFlatten": 1 - } - }, - { - "Name": "LoopControl", - "Type": "Bit", - "Values": - { - "Unroll": 0, - "DontUnroll": 1, - "DependencyInfinite": 2, - "DependencyLength": 3 - } - }, - { - "Name": "FunctionControl", - "Type": "Bit", - "Values": - { - "Inline": 0, - "DontInline": 1, - "Pure": 2, - "Const": 3 - } - }, - { - "Name": "MemorySemantics", - "Type": "Bit", - "Values": - { - "Acquire": 1, - "Release": 2, - "AcquireRelease": 3, - "SequentiallyConsistent": 4, - "UniformMemory": 6, - "SubgroupMemory": 7, - "WorkgroupMemory": 8, - "CrossWorkgroupMemory": 9, - "AtomicCounterMemory": 10, - "ImageMemory": 11 - } - }, - { - "Name": "MemoryAccess", - "Type": "Bit", - "Values": - { - "Volatile": 0, - "Aligned": 1, - "Nontemporal": 2 - } - }, - { - "Name": "Scope", - "Type": "Value", - "Values": - { - "CrossDevice": 0, - "Device": 1, - "Workgroup": 2, - "Subgroup": 3, - "Invocation": 4 - } - }, - { - "Name": "GroupOperation", - "Type": "Value", - "Values": - { - "Reduce": 0, - "InclusiveScan": 1, - "ExclusiveScan": 2 - } - }, - { - "Name": "KernelEnqueueFlags", - "Type": "Value", - "Values": - { - "NoWait": 0, - "WaitKernel": 1, - "WaitWorkGroup": 2 - } - }, - { - "Name": "KernelProfilingInfo", - "Type": "Bit", - "Values": - { - "CmdExecTime": 0 - } - }, - { - "Name": "Capability", - "Type": "Value", - "Values": - { - "Matrix": 0, - "Shader": 1, - "Geometry": 2, - "Tessellation": 3, - "Addresses": 4, - "Linkage": 5, - "Kernel": 6, - "Vector16": 7, - "Float16Buffer": 8, - "Float16": 9, - "Float64": 10, - "Int64": 11, - "Int64Atomics": 12, - "ImageBasic": 13, - "ImageReadWrite": 14, - "ImageMipmap": 15, - "Pipes": 17, - "Groups": 18, - "DeviceEnqueue": 19, - "LiteralSampler": 20, - "AtomicStorage": 21, - "Int16": 22, - "TessellationPointSize": 23, - "GeometryPointSize": 24, - "ImageGatherExtended": 25, - "StorageImageMultisample": 27, - "UniformBufferArrayDynamicIndexing": 28, - "SampledImageArrayDynamicIndexing": 29, - "StorageBufferArrayDynamicIndexing": 30, - "StorageImageArrayDynamicIndexing": 31, - "ClipDistance": 32, - "CullDistance": 33, - "ImageCubeArray": 34, - "SampleRateShading": 35, - "ImageRect": 36, - "SampledRect": 37, - "GenericPointer": 38, - "Int8": 39, - "InputAttachment": 40, - "SparseResidency": 41, - "MinLod": 42, - "Sampled1D": 43, - "Image1D": 44, - "SampledCubeArray": 45, - "SampledBuffer": 46, - "ImageBuffer": 47, - "ImageMSArray": 48, - "StorageImageExtendedFormats": 49, - "ImageQuery": 50, - "DerivativeControl": 51, - "InterpolationFunction": 52, - "TransformFeedback": 53, - "GeometryStreams": 54, - "StorageImageReadWithoutFormat": 55, - "StorageImageWriteWithoutFormat": 56, - "MultiViewport": 57, - "SubgroupDispatch": 58, - "NamedBarrier": 59, - "PipeStorage": 60, - "SubgroupBallotKHR": 4423, - "DrawParameters": 4427, - "SubgroupVoteKHR": 4431, - "StorageBuffer16BitAccess": 4433, - "StorageUniformBufferBlock16": 4433, - "StorageUniform16": 4434, - "UniformAndStorageBuffer16BitAccess": 4434, - "StoragePushConstant16": 4435, - "StorageInputOutput16": 4436, - "DeviceGroup": 4437, - "MultiView": 4439, - "VariablePointersStorageBuffer": 4441, - "VariablePointers": 4442, - "AtomicStorageOps": 4445, - "SampleMaskPostDepthCoverage": 4447, - "ImageGatherBiasLodAMD": 5009, - "FragmentMaskAMD": 5010, - "StencilExportEXT": 5013, - "ImageReadWriteLodAMD": 5015, - "SampleMaskOverrideCoverageNV": 5249, - "GeometryShaderPassthroughNV": 5251, - "ShaderViewportIndexLayerEXT": 5254, - "ShaderViewportIndexLayerNV": 5254, - "ShaderViewportMaskNV": 5255, - "ShaderStereoViewNV": 5259, - "PerViewAttributesNV": 5260, - "SubgroupShuffleINTEL": 5568, - "SubgroupBufferBlockIOINTEL": 5569, - "SubgroupImageBlockIOINTEL": 5570 - } - }, - { - "Name": "Op", - "Type": "Value", - "Values": - { - "OpNop": 0, - "OpUndef": 1, - "OpSourceContinued": 2, - "OpSource": 3, - "OpSourceExtension": 4, - "OpName": 5, - "OpMemberName": 6, - "OpString": 7, - "OpLine": 8, - "OpExtension": 10, - "OpExtInstImport": 11, - "OpExtInst": 12, - "OpMemoryModel": 14, - "OpEntryPoint": 15, - "OpExecutionMode": 16, - "OpCapability": 17, - "OpTypeVoid": 19, - "OpTypeBool": 20, - "OpTypeInt": 21, - "OpTypeFloat": 22, - "OpTypeVector": 23, - "OpTypeMatrix": 24, - "OpTypeImage": 25, - "OpTypeSampler": 26, - "OpTypeSampledImage": 27, - "OpTypeArray": 28, - "OpTypeRuntimeArray": 29, - "OpTypeStruct": 30, - "OpTypeOpaque": 31, - "OpTypePointer": 32, - "OpTypeFunction": 33, - "OpTypeEvent": 34, - "OpTypeDeviceEvent": 35, - "OpTypeReserveId": 36, - "OpTypeQueue": 37, - "OpTypePipe": 38, - "OpTypeForwardPointer": 39, - "OpConstantTrue": 41, - "OpConstantFalse": 42, - "OpConstant": 43, - "OpConstantComposite": 44, - "OpConstantSampler": 45, - "OpConstantNull": 46, - "OpSpecConstantTrue": 48, - "OpSpecConstantFalse": 49, - "OpSpecConstant": 50, - "OpSpecConstantComposite": 51, - "OpSpecConstantOp": 52, - "OpFunction": 54, - "OpFunctionParameter": 55, - "OpFunctionEnd": 56, - "OpFunctionCall": 57, - "OpVariable": 59, - "OpImageTexelPointer": 60, - "OpLoad": 61, - "OpStore": 62, - "OpCopyMemory": 63, - "OpCopyMemorySized": 64, - "OpAccessChain": 65, - "OpInBoundsAccessChain": 66, - "OpPtrAccessChain": 67, - "OpArrayLength": 68, - "OpGenericPtrMemSemantics": 69, - "OpInBoundsPtrAccessChain": 70, - "OpDecorate": 71, - "OpMemberDecorate": 72, - "OpDecorationGroup": 73, - "OpGroupDecorate": 74, - "OpGroupMemberDecorate": 75, - "OpVectorExtractDynamic": 77, - "OpVectorInsertDynamic": 78, - "OpVectorShuffle": 79, - "OpCompositeConstruct": 80, - "OpCompositeExtract": 81, - "OpCompositeInsert": 82, - "OpCopyObject": 83, - "OpTranspose": 84, - "OpSampledImage": 86, - "OpImageSampleImplicitLod": 87, - "OpImageSampleExplicitLod": 88, - "OpImageSampleDrefImplicitLod": 89, - "OpImageSampleDrefExplicitLod": 90, - "OpImageSampleProjImplicitLod": 91, - "OpImageSampleProjExplicitLod": 92, - "OpImageSampleProjDrefImplicitLod": 93, - "OpImageSampleProjDrefExplicitLod": 94, - "OpImageFetch": 95, - "OpImageGather": 96, - "OpImageDrefGather": 97, - "OpImageRead": 98, - "OpImageWrite": 99, - "OpImage": 100, - "OpImageQueryFormat": 101, - "OpImageQueryOrder": 102, - "OpImageQuerySizeLod": 103, - "OpImageQuerySize": 104, - "OpImageQueryLod": 105, - "OpImageQueryLevels": 106, - "OpImageQuerySamples": 107, - "OpConvertFToU": 109, - "OpConvertFToS": 110, - "OpConvertSToF": 111, - "OpConvertUToF": 112, - "OpUConvert": 113, - "OpSConvert": 114, - "OpFConvert": 115, - "OpQuantizeToF16": 116, - "OpConvertPtrToU": 117, - "OpSatConvertSToU": 118, - "OpSatConvertUToS": 119, - "OpConvertUToPtr": 120, - "OpPtrCastToGeneric": 121, - "OpGenericCastToPtr": 122, - "OpGenericCastToPtrExplicit": 123, - "OpBitcast": 124, - "OpSNegate": 126, - "OpFNegate": 127, - "OpIAdd": 128, - "OpFAdd": 129, - "OpISub": 130, - "OpFSub": 131, - "OpIMul": 132, - "OpFMul": 133, - "OpUDiv": 134, - "OpSDiv": 135, - "OpFDiv": 136, - "OpUMod": 137, - "OpSRem": 138, - "OpSMod": 139, - "OpFRem": 140, - "OpFMod": 141, - "OpVectorTimesScalar": 142, - "OpMatrixTimesScalar": 143, - "OpVectorTimesMatrix": 144, - "OpMatrixTimesVector": 145, - "OpMatrixTimesMatrix": 146, - "OpOuterProduct": 147, - "OpDot": 148, - "OpIAddCarry": 149, - "OpISubBorrow": 150, - "OpUMulExtended": 151, - "OpSMulExtended": 152, - "OpAny": 154, - "OpAll": 155, - "OpIsNan": 156, - "OpIsInf": 157, - "OpIsFinite": 158, - "OpIsNormal": 159, - "OpSignBitSet": 160, - "OpLessOrGreater": 161, - "OpOrdered": 162, - "OpUnordered": 163, - "OpLogicalEqual": 164, - "OpLogicalNotEqual": 165, - "OpLogicalOr": 166, - "OpLogicalAnd": 167, - "OpLogicalNot": 168, - "OpSelect": 169, - "OpIEqual": 170, - "OpINotEqual": 171, - "OpUGreaterThan": 172, - "OpSGreaterThan": 173, - "OpUGreaterThanEqual": 174, - "OpSGreaterThanEqual": 175, - "OpULessThan": 176, - "OpSLessThan": 177, - "OpULessThanEqual": 178, - "OpSLessThanEqual": 179, - "OpFOrdEqual": 180, - "OpFUnordEqual": 181, - "OpFOrdNotEqual": 182, - "OpFUnordNotEqual": 183, - "OpFOrdLessThan": 184, - "OpFUnordLessThan": 185, - "OpFOrdGreaterThan": 186, - "OpFUnordGreaterThan": 187, - "OpFOrdLessThanEqual": 188, - "OpFUnordLessThanEqual": 189, - "OpFOrdGreaterThanEqual": 190, - "OpFUnordGreaterThanEqual": 191, - "OpShiftRightLogical": 194, - "OpShiftRightArithmetic": 195, - "OpShiftLeftLogical": 196, - "OpBitwiseOr": 197, - "OpBitwiseXor": 198, - "OpBitwiseAnd": 199, - "OpNot": 200, - "OpBitFieldInsert": 201, - "OpBitFieldSExtract": 202, - "OpBitFieldUExtract": 203, - "OpBitReverse": 204, - "OpBitCount": 205, - "OpDPdx": 207, - "OpDPdy": 208, - "OpFwidth": 209, - "OpDPdxFine": 210, - "OpDPdyFine": 211, - "OpFwidthFine": 212, - "OpDPdxCoarse": 213, - "OpDPdyCoarse": 214, - "OpFwidthCoarse": 215, - "OpEmitVertex": 218, - "OpEndPrimitive": 219, - "OpEmitStreamVertex": 220, - "OpEndStreamPrimitive": 221, - "OpControlBarrier": 224, - "OpMemoryBarrier": 225, - "OpAtomicLoad": 227, - "OpAtomicStore": 228, - "OpAtomicExchange": 229, - "OpAtomicCompareExchange": 230, - "OpAtomicCompareExchangeWeak": 231, - "OpAtomicIIncrement": 232, - "OpAtomicIDecrement": 233, - "OpAtomicIAdd": 234, - "OpAtomicISub": 235, - "OpAtomicSMin": 236, - "OpAtomicUMin": 237, - "OpAtomicSMax": 238, - "OpAtomicUMax": 239, - "OpAtomicAnd": 240, - "OpAtomicOr": 241, - "OpAtomicXor": 242, - "OpPhi": 245, - "OpLoopMerge": 246, - "OpSelectionMerge": 247, - "OpLabel": 248, - "OpBranch": 249, - "OpBranchConditional": 250, - "OpSwitch": 251, - "OpKill": 252, - "OpReturn": 253, - "OpReturnValue": 254, - "OpUnreachable": 255, - "OpLifetimeStart": 256, - "OpLifetimeStop": 257, - "OpGroupAsyncCopy": 259, - "OpGroupWaitEvents": 260, - "OpGroupAll": 261, - "OpGroupAny": 262, - "OpGroupBroadcast": 263, - "OpGroupIAdd": 264, - "OpGroupFAdd": 265, - "OpGroupFMin": 266, - "OpGroupUMin": 267, - "OpGroupSMin": 268, - "OpGroupFMax": 269, - "OpGroupUMax": 270, - "OpGroupSMax": 271, - "OpReadPipe": 274, - "OpWritePipe": 275, - "OpReservedReadPipe": 276, - "OpReservedWritePipe": 277, - "OpReserveReadPipePackets": 278, - "OpReserveWritePipePackets": 279, - "OpCommitReadPipe": 280, - "OpCommitWritePipe": 281, - "OpIsValidReserveId": 282, - "OpGetNumPipePackets": 283, - "OpGetMaxPipePackets": 284, - "OpGroupReserveReadPipePackets": 285, - "OpGroupReserveWritePipePackets": 286, - "OpGroupCommitReadPipe": 287, - "OpGroupCommitWritePipe": 288, - "OpEnqueueMarker": 291, - "OpEnqueueKernel": 292, - "OpGetKernelNDrangeSubGroupCount": 293, - "OpGetKernelNDrangeMaxSubGroupSize": 294, - "OpGetKernelWorkGroupSize": 295, - "OpGetKernelPreferredWorkGroupSizeMultiple": 296, - "OpRetainEvent": 297, - "OpReleaseEvent": 298, - "OpCreateUserEvent": 299, - "OpIsValidEvent": 300, - "OpSetUserEventStatus": 301, - "OpCaptureEventProfilingInfo": 302, - "OpGetDefaultQueue": 303, - "OpBuildNDRange": 304, - "OpImageSparseSampleImplicitLod": 305, - "OpImageSparseSampleExplicitLod": 306, - "OpImageSparseSampleDrefImplicitLod": 307, - "OpImageSparseSampleDrefExplicitLod": 308, - "OpImageSparseSampleProjImplicitLod": 309, - "OpImageSparseSampleProjExplicitLod": 310, - "OpImageSparseSampleProjDrefImplicitLod": 311, - "OpImageSparseSampleProjDrefExplicitLod": 312, - "OpImageSparseFetch": 313, - "OpImageSparseGather": 314, - "OpImageSparseDrefGather": 315, - "OpImageSparseTexelsResident": 316, - "OpNoLine": 317, - "OpAtomicFlagTestAndSet": 318, - "OpAtomicFlagClear": 319, - "OpImageSparseRead": 320, - "OpSizeOf": 321, - "OpTypePipeStorage": 322, - "OpConstantPipeStorage": 323, - "OpCreatePipeFromPipeStorage": 324, - "OpGetKernelLocalSizeForSubgroupCount": 325, - "OpGetKernelMaxNumSubgroups": 326, - "OpTypeNamedBarrier": 327, - "OpNamedBarrierInitialize": 328, - "OpMemoryNamedBarrier": 329, - "OpModuleProcessed": 330, - "OpSubgroupBallotKHR": 4421, - "OpSubgroupFirstInvocationKHR": 4422, - "OpSubgroupAllKHR": 4428, - "OpSubgroupAnyKHR": 4429, - "OpSubgroupAllEqualKHR": 4430, - "OpSubgroupReadInvocationKHR": 4432, - "OpGroupIAddNonUniformAMD": 5000, - "OpGroupFAddNonUniformAMD": 5001, - "OpGroupFMinNonUniformAMD": 5002, - "OpGroupUMinNonUniformAMD": 5003, - "OpGroupSMinNonUniformAMD": 5004, - "OpGroupFMaxNonUniformAMD": 5005, - "OpGroupUMaxNonUniformAMD": 5006, - "OpGroupSMaxNonUniformAMD": 5007, - "OpFragmentMaskFetchAMD": 5011, - "OpFragmentFetchAMD": 5012, - "OpSubgroupShuffleINTEL": 5571, - "OpSubgroupShuffleDownINTEL": 5572, - "OpSubgroupShuffleUpINTEL": 5573, - "OpSubgroupShuffleXorINTEL": 5574, - "OpSubgroupBlockReadINTEL": 5575, - "OpSubgroupBlockWriteINTEL": 5576, - "OpSubgroupImageBlockReadINTEL": 5577, - "OpSubgroupImageBlockWriteINTEL": 5578 - } - } - ] - } -} - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.lua vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.lua --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.lua 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.lua 1970-01-01 00:00:00.000000000 +0000 @@ -1,966 +0,0 @@ --- Copyright (c) 2014-2017 The Khronos Group Inc. --- --- Permission is hereby granted, free of charge, to any person obtaining a copy --- of this software and/or associated documentation files (the "Materials"), --- to deal in the Materials without restriction, including without limitation --- the rights to use, copy, modify, merge, publish, distribute, sublicense, --- and/or sell copies of the Materials, and to permit persons to whom the --- Materials are furnished to do so, subject to the following conditions: --- --- The above copyright notice and this permission notice shall be included in --- all copies or substantial portions of the Materials. --- --- MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS --- STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND --- HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ --- --- THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL --- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING --- FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS --- IN THE MATERIALS. - --- This header is automatically generated by the same tool that creates --- the Binary Section of the SPIR-V specification. - --- Enumeration tokens for SPIR-V, in various styles: --- C, C++, C++11, JSON, Lua, Python --- --- - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL --- - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL --- - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL --- - Lua will use tables, e.g.: spv.SourceLanguage.GLSL --- - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] --- --- Some tokens act like mask values, which can be OR'd together, --- while others are mutually exclusive. The mask-like ones have --- "Mask" in their name, and a parallel enum that has the shift --- amount (1 << x) for each corresponding enumerant. - -spv = { - MagicNumber = 0x07230203, - Version = 0x00010100, - Revision = 8, - OpCodeMask = 0xffff, - WordCountShift = 16, - - SourceLanguage = { - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - }, - - ExecutionModel = { - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - }, - - AddressingModel = { - Logical = 0, - Physical32 = 1, - Physical64 = 2, - }, - - MemoryModel = { - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - }, - - ExecutionMode = { - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - Initializer = 33, - Finalizer = 34, - SubgroupSize = 35, - SubgroupsPerWorkgroup = 36, - PostDepthCoverage = 4446, - StencilRefReplacingEXT = 5027, - }, - - StorageClass = { - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - }, - - Dim = { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, - }, - - SamplerAddressingMode = { - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, - }, - - SamplerFilterMode = { - Nearest = 0, - Linear = 1, - }, - - ImageFormat = { - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - }, - - ImageChannelOrder = { - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, - }, - - ImageChannelDataType = { - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, - }, - - ImageOperandsShift = { - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - }, - - ImageOperandsMask = { - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, - }, - - FPFastMathModeShift = { - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - }, - - FPFastMathModeMask = { - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, - }, - - FPRoundingMode = { - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, - }, - - LinkageType = { - Export = 0, - Import = 1, - }, - - AccessQualifier = { - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, - }, - - FunctionParameterAttribute = { - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, - }, - - Decoration = { - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - MaxByteOffset = 45, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - }, - - BuiltIn = { - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMaskKHR = 4416, - SubgroupGeMaskKHR = 4417, - SubgroupGtMaskKHR = 4418, - SubgroupLeMaskKHR = 4419, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - DeviceIndex = 4438, - ViewIndex = 4440, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - }, - - SelectionControlShift = { - Flatten = 0, - DontFlatten = 1, - }, - - SelectionControlMask = { - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, - }, - - LoopControlShift = { - Unroll = 0, - DontUnroll = 1, - DependencyInfinite = 2, - DependencyLength = 3, - }, - - LoopControlMask = { - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, - DependencyInfinite = 0x00000004, - DependencyLength = 0x00000008, - }, - - FunctionControlShift = { - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - }, - - FunctionControlMask = { - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, - }, - - MemorySemanticsShift = { - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - }, - - MemorySemanticsMask = { - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, - }, - - MemoryAccessShift = { - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - }, - - MemoryAccessMask = { - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, - }, - - Scope = { - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - }, - - GroupOperation = { - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - }, - - KernelEnqueueFlags = { - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, - }, - - KernelProfilingInfoShift = { - CmdExecTime = 0, - }, - - KernelProfilingInfoMask = { - MaskNone = 0, - CmdExecTime = 0x00000001, - }, - - Capability = { - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupDispatch = 58, - NamedBarrier = 59, - PipeStorage = 60, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - }, - - Op = { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - }, - -} - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.py vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.py --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.py 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.1/spirv.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,966 +0,0 @@ -# Copyright (c) 2014-2017 The Khronos Group Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and/or associated documentation files (the "Materials"), -# to deal in the Materials without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Materials, and to permit persons to whom the -# Materials are furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Materials. -# -# MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -# STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -# HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -# -# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -# IN THE MATERIALS. - -# This header is automatically generated by the same tool that creates -# the Binary Section of the SPIR-V specification. - -# Enumeration tokens for SPIR-V, in various styles: -# C, C++, C++11, JSON, Lua, Python -# -# - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -# - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -# - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -# - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -# - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -# -# Some tokens act like mask values, which can be OR'd together, -# while others are mutually exclusive. The mask-like ones have -# "Mask" in their name, and a parallel enum that has the shift -# amount (1 << x) for each corresponding enumerant. - -spv = { - 'MagicNumber' : 0x07230203, - 'Version' : 0x00010100, - 'Revision' : 8, - 'OpCodeMask' : 0xffff, - 'WordCountShift' : 16, - - 'SourceLanguage' : { - 'Unknown' : 0, - 'ESSL' : 1, - 'GLSL' : 2, - 'OpenCL_C' : 3, - 'OpenCL_CPP' : 4, - 'HLSL' : 5, - }, - - 'ExecutionModel' : { - 'Vertex' : 0, - 'TessellationControl' : 1, - 'TessellationEvaluation' : 2, - 'Geometry' : 3, - 'Fragment' : 4, - 'GLCompute' : 5, - 'Kernel' : 6, - }, - - 'AddressingModel' : { - 'Logical' : 0, - 'Physical32' : 1, - 'Physical64' : 2, - }, - - 'MemoryModel' : { - 'Simple' : 0, - 'GLSL450' : 1, - 'OpenCL' : 2, - }, - - 'ExecutionMode' : { - 'Invocations' : 0, - 'SpacingEqual' : 1, - 'SpacingFractionalEven' : 2, - 'SpacingFractionalOdd' : 3, - 'VertexOrderCw' : 4, - 'VertexOrderCcw' : 5, - 'PixelCenterInteger' : 6, - 'OriginUpperLeft' : 7, - 'OriginLowerLeft' : 8, - 'EarlyFragmentTests' : 9, - 'PointMode' : 10, - 'Xfb' : 11, - 'DepthReplacing' : 12, - 'DepthGreater' : 14, - 'DepthLess' : 15, - 'DepthUnchanged' : 16, - 'LocalSize' : 17, - 'LocalSizeHint' : 18, - 'InputPoints' : 19, - 'InputLines' : 20, - 'InputLinesAdjacency' : 21, - 'Triangles' : 22, - 'InputTrianglesAdjacency' : 23, - 'Quads' : 24, - 'Isolines' : 25, - 'OutputVertices' : 26, - 'OutputPoints' : 27, - 'OutputLineStrip' : 28, - 'OutputTriangleStrip' : 29, - 'VecTypeHint' : 30, - 'ContractionOff' : 31, - 'Initializer' : 33, - 'Finalizer' : 34, - 'SubgroupSize' : 35, - 'SubgroupsPerWorkgroup' : 36, - 'PostDepthCoverage' : 4446, - 'StencilRefReplacingEXT' : 5027, - }, - - 'StorageClass' : { - 'UniformConstant' : 0, - 'Input' : 1, - 'Uniform' : 2, - 'Output' : 3, - 'Workgroup' : 4, - 'CrossWorkgroup' : 5, - 'Private' : 6, - 'Function' : 7, - 'Generic' : 8, - 'PushConstant' : 9, - 'AtomicCounter' : 10, - 'Image' : 11, - 'StorageBuffer' : 12, - }, - - 'Dim' : { - 'Dim1D' : 0, - 'Dim2D' : 1, - 'Dim3D' : 2, - 'Cube' : 3, - 'Rect' : 4, - 'Buffer' : 5, - 'SubpassData' : 6, - }, - - 'SamplerAddressingMode' : { - 'None' : 0, - 'ClampToEdge' : 1, - 'Clamp' : 2, - 'Repeat' : 3, - 'RepeatMirrored' : 4, - }, - - 'SamplerFilterMode' : { - 'Nearest' : 0, - 'Linear' : 1, - }, - - 'ImageFormat' : { - 'Unknown' : 0, - 'Rgba32f' : 1, - 'Rgba16f' : 2, - 'R32f' : 3, - 'Rgba8' : 4, - 'Rgba8Snorm' : 5, - 'Rg32f' : 6, - 'Rg16f' : 7, - 'R11fG11fB10f' : 8, - 'R16f' : 9, - 'Rgba16' : 10, - 'Rgb10A2' : 11, - 'Rg16' : 12, - 'Rg8' : 13, - 'R16' : 14, - 'R8' : 15, - 'Rgba16Snorm' : 16, - 'Rg16Snorm' : 17, - 'Rg8Snorm' : 18, - 'R16Snorm' : 19, - 'R8Snorm' : 20, - 'Rgba32i' : 21, - 'Rgba16i' : 22, - 'Rgba8i' : 23, - 'R32i' : 24, - 'Rg32i' : 25, - 'Rg16i' : 26, - 'Rg8i' : 27, - 'R16i' : 28, - 'R8i' : 29, - 'Rgba32ui' : 30, - 'Rgba16ui' : 31, - 'Rgba8ui' : 32, - 'R32ui' : 33, - 'Rgb10a2ui' : 34, - 'Rg32ui' : 35, - 'Rg16ui' : 36, - 'Rg8ui' : 37, - 'R16ui' : 38, - 'R8ui' : 39, - }, - - 'ImageChannelOrder' : { - 'R' : 0, - 'A' : 1, - 'RG' : 2, - 'RA' : 3, - 'RGB' : 4, - 'RGBA' : 5, - 'BGRA' : 6, - 'ARGB' : 7, - 'Intensity' : 8, - 'Luminance' : 9, - 'Rx' : 10, - 'RGx' : 11, - 'RGBx' : 12, - 'Depth' : 13, - 'DepthStencil' : 14, - 'sRGB' : 15, - 'sRGBx' : 16, - 'sRGBA' : 17, - 'sBGRA' : 18, - 'ABGR' : 19, - }, - - 'ImageChannelDataType' : { - 'SnormInt8' : 0, - 'SnormInt16' : 1, - 'UnormInt8' : 2, - 'UnormInt16' : 3, - 'UnormShort565' : 4, - 'UnormShort555' : 5, - 'UnormInt101010' : 6, - 'SignedInt8' : 7, - 'SignedInt16' : 8, - 'SignedInt32' : 9, - 'UnsignedInt8' : 10, - 'UnsignedInt16' : 11, - 'UnsignedInt32' : 12, - 'HalfFloat' : 13, - 'Float' : 14, - 'UnormInt24' : 15, - 'UnormInt101010_2' : 16, - }, - - 'ImageOperandsShift' : { - 'Bias' : 0, - 'Lod' : 1, - 'Grad' : 2, - 'ConstOffset' : 3, - 'Offset' : 4, - 'ConstOffsets' : 5, - 'Sample' : 6, - 'MinLod' : 7, - }, - - 'ImageOperandsMask' : { - 'MaskNone' : 0, - 'Bias' : 0x00000001, - 'Lod' : 0x00000002, - 'Grad' : 0x00000004, - 'ConstOffset' : 0x00000008, - 'Offset' : 0x00000010, - 'ConstOffsets' : 0x00000020, - 'Sample' : 0x00000040, - 'MinLod' : 0x00000080, - }, - - 'FPFastMathModeShift' : { - 'NotNaN' : 0, - 'NotInf' : 1, - 'NSZ' : 2, - 'AllowRecip' : 3, - 'Fast' : 4, - }, - - 'FPFastMathModeMask' : { - 'MaskNone' : 0, - 'NotNaN' : 0x00000001, - 'NotInf' : 0x00000002, - 'NSZ' : 0x00000004, - 'AllowRecip' : 0x00000008, - 'Fast' : 0x00000010, - }, - - 'FPRoundingMode' : { - 'RTE' : 0, - 'RTZ' : 1, - 'RTP' : 2, - 'RTN' : 3, - }, - - 'LinkageType' : { - 'Export' : 0, - 'Import' : 1, - }, - - 'AccessQualifier' : { - 'ReadOnly' : 0, - 'WriteOnly' : 1, - 'ReadWrite' : 2, - }, - - 'FunctionParameterAttribute' : { - 'Zext' : 0, - 'Sext' : 1, - 'ByVal' : 2, - 'Sret' : 3, - 'NoAlias' : 4, - 'NoCapture' : 5, - 'NoWrite' : 6, - 'NoReadWrite' : 7, - }, - - 'Decoration' : { - 'RelaxedPrecision' : 0, - 'SpecId' : 1, - 'Block' : 2, - 'BufferBlock' : 3, - 'RowMajor' : 4, - 'ColMajor' : 5, - 'ArrayStride' : 6, - 'MatrixStride' : 7, - 'GLSLShared' : 8, - 'GLSLPacked' : 9, - 'CPacked' : 10, - 'BuiltIn' : 11, - 'NoPerspective' : 13, - 'Flat' : 14, - 'Patch' : 15, - 'Centroid' : 16, - 'Sample' : 17, - 'Invariant' : 18, - 'Restrict' : 19, - 'Aliased' : 20, - 'Volatile' : 21, - 'Constant' : 22, - 'Coherent' : 23, - 'NonWritable' : 24, - 'NonReadable' : 25, - 'Uniform' : 26, - 'SaturatedConversion' : 28, - 'Stream' : 29, - 'Location' : 30, - 'Component' : 31, - 'Index' : 32, - 'Binding' : 33, - 'DescriptorSet' : 34, - 'Offset' : 35, - 'XfbBuffer' : 36, - 'XfbStride' : 37, - 'FuncParamAttr' : 38, - 'FPRoundingMode' : 39, - 'FPFastMathMode' : 40, - 'LinkageAttributes' : 41, - 'NoContraction' : 42, - 'InputAttachmentIndex' : 43, - 'Alignment' : 44, - 'MaxByteOffset' : 45, - 'ExplicitInterpAMD' : 4999, - 'OverrideCoverageNV' : 5248, - 'PassthroughNV' : 5250, - 'ViewportRelativeNV' : 5252, - 'SecondaryViewportRelativeNV' : 5256, - }, - - 'BuiltIn' : { - 'Position' : 0, - 'PointSize' : 1, - 'ClipDistance' : 3, - 'CullDistance' : 4, - 'VertexId' : 5, - 'InstanceId' : 6, - 'PrimitiveId' : 7, - 'InvocationId' : 8, - 'Layer' : 9, - 'ViewportIndex' : 10, - 'TessLevelOuter' : 11, - 'TessLevelInner' : 12, - 'TessCoord' : 13, - 'PatchVertices' : 14, - 'FragCoord' : 15, - 'PointCoord' : 16, - 'FrontFacing' : 17, - 'SampleId' : 18, - 'SamplePosition' : 19, - 'SampleMask' : 20, - 'FragDepth' : 22, - 'HelperInvocation' : 23, - 'NumWorkgroups' : 24, - 'WorkgroupSize' : 25, - 'WorkgroupId' : 26, - 'LocalInvocationId' : 27, - 'GlobalInvocationId' : 28, - 'LocalInvocationIndex' : 29, - 'WorkDim' : 30, - 'GlobalSize' : 31, - 'EnqueuedWorkgroupSize' : 32, - 'GlobalOffset' : 33, - 'GlobalLinearId' : 34, - 'SubgroupSize' : 36, - 'SubgroupMaxSize' : 37, - 'NumSubgroups' : 38, - 'NumEnqueuedSubgroups' : 39, - 'SubgroupId' : 40, - 'SubgroupLocalInvocationId' : 41, - 'VertexIndex' : 42, - 'InstanceIndex' : 43, - 'SubgroupEqMaskKHR' : 4416, - 'SubgroupGeMaskKHR' : 4417, - 'SubgroupGtMaskKHR' : 4418, - 'SubgroupLeMaskKHR' : 4419, - 'SubgroupLtMaskKHR' : 4420, - 'BaseVertex' : 4424, - 'BaseInstance' : 4425, - 'DrawIndex' : 4426, - 'DeviceIndex' : 4438, - 'ViewIndex' : 4440, - 'BaryCoordNoPerspAMD' : 4992, - 'BaryCoordNoPerspCentroidAMD' : 4993, - 'BaryCoordNoPerspSampleAMD' : 4994, - 'BaryCoordSmoothAMD' : 4995, - 'BaryCoordSmoothCentroidAMD' : 4996, - 'BaryCoordSmoothSampleAMD' : 4997, - 'BaryCoordPullModelAMD' : 4998, - 'FragStencilRefEXT' : 5014, - 'ViewportMaskNV' : 5253, - 'SecondaryPositionNV' : 5257, - 'SecondaryViewportMaskNV' : 5258, - 'PositionPerViewNV' : 5261, - 'ViewportMaskPerViewNV' : 5262, - }, - - 'SelectionControlShift' : { - 'Flatten' : 0, - 'DontFlatten' : 1, - }, - - 'SelectionControlMask' : { - 'MaskNone' : 0, - 'Flatten' : 0x00000001, - 'DontFlatten' : 0x00000002, - }, - - 'LoopControlShift' : { - 'Unroll' : 0, - 'DontUnroll' : 1, - 'DependencyInfinite' : 2, - 'DependencyLength' : 3, - }, - - 'LoopControlMask' : { - 'MaskNone' : 0, - 'Unroll' : 0x00000001, - 'DontUnroll' : 0x00000002, - 'DependencyInfinite' : 0x00000004, - 'DependencyLength' : 0x00000008, - }, - - 'FunctionControlShift' : { - 'Inline' : 0, - 'DontInline' : 1, - 'Pure' : 2, - 'Const' : 3, - }, - - 'FunctionControlMask' : { - 'MaskNone' : 0, - 'Inline' : 0x00000001, - 'DontInline' : 0x00000002, - 'Pure' : 0x00000004, - 'Const' : 0x00000008, - }, - - 'MemorySemanticsShift' : { - 'Acquire' : 1, - 'Release' : 2, - 'AcquireRelease' : 3, - 'SequentiallyConsistent' : 4, - 'UniformMemory' : 6, - 'SubgroupMemory' : 7, - 'WorkgroupMemory' : 8, - 'CrossWorkgroupMemory' : 9, - 'AtomicCounterMemory' : 10, - 'ImageMemory' : 11, - }, - - 'MemorySemanticsMask' : { - 'MaskNone' : 0, - 'Acquire' : 0x00000002, - 'Release' : 0x00000004, - 'AcquireRelease' : 0x00000008, - 'SequentiallyConsistent' : 0x00000010, - 'UniformMemory' : 0x00000040, - 'SubgroupMemory' : 0x00000080, - 'WorkgroupMemory' : 0x00000100, - 'CrossWorkgroupMemory' : 0x00000200, - 'AtomicCounterMemory' : 0x00000400, - 'ImageMemory' : 0x00000800, - }, - - 'MemoryAccessShift' : { - 'Volatile' : 0, - 'Aligned' : 1, - 'Nontemporal' : 2, - }, - - 'MemoryAccessMask' : { - 'MaskNone' : 0, - 'Volatile' : 0x00000001, - 'Aligned' : 0x00000002, - 'Nontemporal' : 0x00000004, - }, - - 'Scope' : { - 'CrossDevice' : 0, - 'Device' : 1, - 'Workgroup' : 2, - 'Subgroup' : 3, - 'Invocation' : 4, - }, - - 'GroupOperation' : { - 'Reduce' : 0, - 'InclusiveScan' : 1, - 'ExclusiveScan' : 2, - }, - - 'KernelEnqueueFlags' : { - 'NoWait' : 0, - 'WaitKernel' : 1, - 'WaitWorkGroup' : 2, - }, - - 'KernelProfilingInfoShift' : { - 'CmdExecTime' : 0, - }, - - 'KernelProfilingInfoMask' : { - 'MaskNone' : 0, - 'CmdExecTime' : 0x00000001, - }, - - 'Capability' : { - 'Matrix' : 0, - 'Shader' : 1, - 'Geometry' : 2, - 'Tessellation' : 3, - 'Addresses' : 4, - 'Linkage' : 5, - 'Kernel' : 6, - 'Vector16' : 7, - 'Float16Buffer' : 8, - 'Float16' : 9, - 'Float64' : 10, - 'Int64' : 11, - 'Int64Atomics' : 12, - 'ImageBasic' : 13, - 'ImageReadWrite' : 14, - 'ImageMipmap' : 15, - 'Pipes' : 17, - 'Groups' : 18, - 'DeviceEnqueue' : 19, - 'LiteralSampler' : 20, - 'AtomicStorage' : 21, - 'Int16' : 22, - 'TessellationPointSize' : 23, - 'GeometryPointSize' : 24, - 'ImageGatherExtended' : 25, - 'StorageImageMultisample' : 27, - 'UniformBufferArrayDynamicIndexing' : 28, - 'SampledImageArrayDynamicIndexing' : 29, - 'StorageBufferArrayDynamicIndexing' : 30, - 'StorageImageArrayDynamicIndexing' : 31, - 'ClipDistance' : 32, - 'CullDistance' : 33, - 'ImageCubeArray' : 34, - 'SampleRateShading' : 35, - 'ImageRect' : 36, - 'SampledRect' : 37, - 'GenericPointer' : 38, - 'Int8' : 39, - 'InputAttachment' : 40, - 'SparseResidency' : 41, - 'MinLod' : 42, - 'Sampled1D' : 43, - 'Image1D' : 44, - 'SampledCubeArray' : 45, - 'SampledBuffer' : 46, - 'ImageBuffer' : 47, - 'ImageMSArray' : 48, - 'StorageImageExtendedFormats' : 49, - 'ImageQuery' : 50, - 'DerivativeControl' : 51, - 'InterpolationFunction' : 52, - 'TransformFeedback' : 53, - 'GeometryStreams' : 54, - 'StorageImageReadWithoutFormat' : 55, - 'StorageImageWriteWithoutFormat' : 56, - 'MultiViewport' : 57, - 'SubgroupDispatch' : 58, - 'NamedBarrier' : 59, - 'PipeStorage' : 60, - 'SubgroupBallotKHR' : 4423, - 'DrawParameters' : 4427, - 'SubgroupVoteKHR' : 4431, - 'StorageBuffer16BitAccess' : 4433, - 'StorageUniformBufferBlock16' : 4433, - 'StorageUniform16' : 4434, - 'UniformAndStorageBuffer16BitAccess' : 4434, - 'StoragePushConstant16' : 4435, - 'StorageInputOutput16' : 4436, - 'DeviceGroup' : 4437, - 'MultiView' : 4439, - 'VariablePointersStorageBuffer' : 4441, - 'VariablePointers' : 4442, - 'AtomicStorageOps' : 4445, - 'SampleMaskPostDepthCoverage' : 4447, - 'ImageGatherBiasLodAMD' : 5009, - 'FragmentMaskAMD' : 5010, - 'StencilExportEXT' : 5013, - 'ImageReadWriteLodAMD' : 5015, - 'SampleMaskOverrideCoverageNV' : 5249, - 'GeometryShaderPassthroughNV' : 5251, - 'ShaderViewportIndexLayerEXT' : 5254, - 'ShaderViewportIndexLayerNV' : 5254, - 'ShaderViewportMaskNV' : 5255, - 'ShaderStereoViewNV' : 5259, - 'PerViewAttributesNV' : 5260, - 'SubgroupShuffleINTEL' : 5568, - 'SubgroupBufferBlockIOINTEL' : 5569, - 'SubgroupImageBlockIOINTEL' : 5570, - }, - - 'Op' : { - 'OpNop' : 0, - 'OpUndef' : 1, - 'OpSourceContinued' : 2, - 'OpSource' : 3, - 'OpSourceExtension' : 4, - 'OpName' : 5, - 'OpMemberName' : 6, - 'OpString' : 7, - 'OpLine' : 8, - 'OpExtension' : 10, - 'OpExtInstImport' : 11, - 'OpExtInst' : 12, - 'OpMemoryModel' : 14, - 'OpEntryPoint' : 15, - 'OpExecutionMode' : 16, - 'OpCapability' : 17, - 'OpTypeVoid' : 19, - 'OpTypeBool' : 20, - 'OpTypeInt' : 21, - 'OpTypeFloat' : 22, - 'OpTypeVector' : 23, - 'OpTypeMatrix' : 24, - 'OpTypeImage' : 25, - 'OpTypeSampler' : 26, - 'OpTypeSampledImage' : 27, - 'OpTypeArray' : 28, - 'OpTypeRuntimeArray' : 29, - 'OpTypeStruct' : 30, - 'OpTypeOpaque' : 31, - 'OpTypePointer' : 32, - 'OpTypeFunction' : 33, - 'OpTypeEvent' : 34, - 'OpTypeDeviceEvent' : 35, - 'OpTypeReserveId' : 36, - 'OpTypeQueue' : 37, - 'OpTypePipe' : 38, - 'OpTypeForwardPointer' : 39, - 'OpConstantTrue' : 41, - 'OpConstantFalse' : 42, - 'OpConstant' : 43, - 'OpConstantComposite' : 44, - 'OpConstantSampler' : 45, - 'OpConstantNull' : 46, - 'OpSpecConstantTrue' : 48, - 'OpSpecConstantFalse' : 49, - 'OpSpecConstant' : 50, - 'OpSpecConstantComposite' : 51, - 'OpSpecConstantOp' : 52, - 'OpFunction' : 54, - 'OpFunctionParameter' : 55, - 'OpFunctionEnd' : 56, - 'OpFunctionCall' : 57, - 'OpVariable' : 59, - 'OpImageTexelPointer' : 60, - 'OpLoad' : 61, - 'OpStore' : 62, - 'OpCopyMemory' : 63, - 'OpCopyMemorySized' : 64, - 'OpAccessChain' : 65, - 'OpInBoundsAccessChain' : 66, - 'OpPtrAccessChain' : 67, - 'OpArrayLength' : 68, - 'OpGenericPtrMemSemantics' : 69, - 'OpInBoundsPtrAccessChain' : 70, - 'OpDecorate' : 71, - 'OpMemberDecorate' : 72, - 'OpDecorationGroup' : 73, - 'OpGroupDecorate' : 74, - 'OpGroupMemberDecorate' : 75, - 'OpVectorExtractDynamic' : 77, - 'OpVectorInsertDynamic' : 78, - 'OpVectorShuffle' : 79, - 'OpCompositeConstruct' : 80, - 'OpCompositeExtract' : 81, - 'OpCompositeInsert' : 82, - 'OpCopyObject' : 83, - 'OpTranspose' : 84, - 'OpSampledImage' : 86, - 'OpImageSampleImplicitLod' : 87, - 'OpImageSampleExplicitLod' : 88, - 'OpImageSampleDrefImplicitLod' : 89, - 'OpImageSampleDrefExplicitLod' : 90, - 'OpImageSampleProjImplicitLod' : 91, - 'OpImageSampleProjExplicitLod' : 92, - 'OpImageSampleProjDrefImplicitLod' : 93, - 'OpImageSampleProjDrefExplicitLod' : 94, - 'OpImageFetch' : 95, - 'OpImageGather' : 96, - 'OpImageDrefGather' : 97, - 'OpImageRead' : 98, - 'OpImageWrite' : 99, - 'OpImage' : 100, - 'OpImageQueryFormat' : 101, - 'OpImageQueryOrder' : 102, - 'OpImageQuerySizeLod' : 103, - 'OpImageQuerySize' : 104, - 'OpImageQueryLod' : 105, - 'OpImageQueryLevels' : 106, - 'OpImageQuerySamples' : 107, - 'OpConvertFToU' : 109, - 'OpConvertFToS' : 110, - 'OpConvertSToF' : 111, - 'OpConvertUToF' : 112, - 'OpUConvert' : 113, - 'OpSConvert' : 114, - 'OpFConvert' : 115, - 'OpQuantizeToF16' : 116, - 'OpConvertPtrToU' : 117, - 'OpSatConvertSToU' : 118, - 'OpSatConvertUToS' : 119, - 'OpConvertUToPtr' : 120, - 'OpPtrCastToGeneric' : 121, - 'OpGenericCastToPtr' : 122, - 'OpGenericCastToPtrExplicit' : 123, - 'OpBitcast' : 124, - 'OpSNegate' : 126, - 'OpFNegate' : 127, - 'OpIAdd' : 128, - 'OpFAdd' : 129, - 'OpISub' : 130, - 'OpFSub' : 131, - 'OpIMul' : 132, - 'OpFMul' : 133, - 'OpUDiv' : 134, - 'OpSDiv' : 135, - 'OpFDiv' : 136, - 'OpUMod' : 137, - 'OpSRem' : 138, - 'OpSMod' : 139, - 'OpFRem' : 140, - 'OpFMod' : 141, - 'OpVectorTimesScalar' : 142, - 'OpMatrixTimesScalar' : 143, - 'OpVectorTimesMatrix' : 144, - 'OpMatrixTimesVector' : 145, - 'OpMatrixTimesMatrix' : 146, - 'OpOuterProduct' : 147, - 'OpDot' : 148, - 'OpIAddCarry' : 149, - 'OpISubBorrow' : 150, - 'OpUMulExtended' : 151, - 'OpSMulExtended' : 152, - 'OpAny' : 154, - 'OpAll' : 155, - 'OpIsNan' : 156, - 'OpIsInf' : 157, - 'OpIsFinite' : 158, - 'OpIsNormal' : 159, - 'OpSignBitSet' : 160, - 'OpLessOrGreater' : 161, - 'OpOrdered' : 162, - 'OpUnordered' : 163, - 'OpLogicalEqual' : 164, - 'OpLogicalNotEqual' : 165, - 'OpLogicalOr' : 166, - 'OpLogicalAnd' : 167, - 'OpLogicalNot' : 168, - 'OpSelect' : 169, - 'OpIEqual' : 170, - 'OpINotEqual' : 171, - 'OpUGreaterThan' : 172, - 'OpSGreaterThan' : 173, - 'OpUGreaterThanEqual' : 174, - 'OpSGreaterThanEqual' : 175, - 'OpULessThan' : 176, - 'OpSLessThan' : 177, - 'OpULessThanEqual' : 178, - 'OpSLessThanEqual' : 179, - 'OpFOrdEqual' : 180, - 'OpFUnordEqual' : 181, - 'OpFOrdNotEqual' : 182, - 'OpFUnordNotEqual' : 183, - 'OpFOrdLessThan' : 184, - 'OpFUnordLessThan' : 185, - 'OpFOrdGreaterThan' : 186, - 'OpFUnordGreaterThan' : 187, - 'OpFOrdLessThanEqual' : 188, - 'OpFUnordLessThanEqual' : 189, - 'OpFOrdGreaterThanEqual' : 190, - 'OpFUnordGreaterThanEqual' : 191, - 'OpShiftRightLogical' : 194, - 'OpShiftRightArithmetic' : 195, - 'OpShiftLeftLogical' : 196, - 'OpBitwiseOr' : 197, - 'OpBitwiseXor' : 198, - 'OpBitwiseAnd' : 199, - 'OpNot' : 200, - 'OpBitFieldInsert' : 201, - 'OpBitFieldSExtract' : 202, - 'OpBitFieldUExtract' : 203, - 'OpBitReverse' : 204, - 'OpBitCount' : 205, - 'OpDPdx' : 207, - 'OpDPdy' : 208, - 'OpFwidth' : 209, - 'OpDPdxFine' : 210, - 'OpDPdyFine' : 211, - 'OpFwidthFine' : 212, - 'OpDPdxCoarse' : 213, - 'OpDPdyCoarse' : 214, - 'OpFwidthCoarse' : 215, - 'OpEmitVertex' : 218, - 'OpEndPrimitive' : 219, - 'OpEmitStreamVertex' : 220, - 'OpEndStreamPrimitive' : 221, - 'OpControlBarrier' : 224, - 'OpMemoryBarrier' : 225, - 'OpAtomicLoad' : 227, - 'OpAtomicStore' : 228, - 'OpAtomicExchange' : 229, - 'OpAtomicCompareExchange' : 230, - 'OpAtomicCompareExchangeWeak' : 231, - 'OpAtomicIIncrement' : 232, - 'OpAtomicIDecrement' : 233, - 'OpAtomicIAdd' : 234, - 'OpAtomicISub' : 235, - 'OpAtomicSMin' : 236, - 'OpAtomicUMin' : 237, - 'OpAtomicSMax' : 238, - 'OpAtomicUMax' : 239, - 'OpAtomicAnd' : 240, - 'OpAtomicOr' : 241, - 'OpAtomicXor' : 242, - 'OpPhi' : 245, - 'OpLoopMerge' : 246, - 'OpSelectionMerge' : 247, - 'OpLabel' : 248, - 'OpBranch' : 249, - 'OpBranchConditional' : 250, - 'OpSwitch' : 251, - 'OpKill' : 252, - 'OpReturn' : 253, - 'OpReturnValue' : 254, - 'OpUnreachable' : 255, - 'OpLifetimeStart' : 256, - 'OpLifetimeStop' : 257, - 'OpGroupAsyncCopy' : 259, - 'OpGroupWaitEvents' : 260, - 'OpGroupAll' : 261, - 'OpGroupAny' : 262, - 'OpGroupBroadcast' : 263, - 'OpGroupIAdd' : 264, - 'OpGroupFAdd' : 265, - 'OpGroupFMin' : 266, - 'OpGroupUMin' : 267, - 'OpGroupSMin' : 268, - 'OpGroupFMax' : 269, - 'OpGroupUMax' : 270, - 'OpGroupSMax' : 271, - 'OpReadPipe' : 274, - 'OpWritePipe' : 275, - 'OpReservedReadPipe' : 276, - 'OpReservedWritePipe' : 277, - 'OpReserveReadPipePackets' : 278, - 'OpReserveWritePipePackets' : 279, - 'OpCommitReadPipe' : 280, - 'OpCommitWritePipe' : 281, - 'OpIsValidReserveId' : 282, - 'OpGetNumPipePackets' : 283, - 'OpGetMaxPipePackets' : 284, - 'OpGroupReserveReadPipePackets' : 285, - 'OpGroupReserveWritePipePackets' : 286, - 'OpGroupCommitReadPipe' : 287, - 'OpGroupCommitWritePipe' : 288, - 'OpEnqueueMarker' : 291, - 'OpEnqueueKernel' : 292, - 'OpGetKernelNDrangeSubGroupCount' : 293, - 'OpGetKernelNDrangeMaxSubGroupSize' : 294, - 'OpGetKernelWorkGroupSize' : 295, - 'OpGetKernelPreferredWorkGroupSizeMultiple' : 296, - 'OpRetainEvent' : 297, - 'OpReleaseEvent' : 298, - 'OpCreateUserEvent' : 299, - 'OpIsValidEvent' : 300, - 'OpSetUserEventStatus' : 301, - 'OpCaptureEventProfilingInfo' : 302, - 'OpGetDefaultQueue' : 303, - 'OpBuildNDRange' : 304, - 'OpImageSparseSampleImplicitLod' : 305, - 'OpImageSparseSampleExplicitLod' : 306, - 'OpImageSparseSampleDrefImplicitLod' : 307, - 'OpImageSparseSampleDrefExplicitLod' : 308, - 'OpImageSparseSampleProjImplicitLod' : 309, - 'OpImageSparseSampleProjExplicitLod' : 310, - 'OpImageSparseSampleProjDrefImplicitLod' : 311, - 'OpImageSparseSampleProjDrefExplicitLod' : 312, - 'OpImageSparseFetch' : 313, - 'OpImageSparseGather' : 314, - 'OpImageSparseDrefGather' : 315, - 'OpImageSparseTexelsResident' : 316, - 'OpNoLine' : 317, - 'OpAtomicFlagTestAndSet' : 318, - 'OpAtomicFlagClear' : 319, - 'OpImageSparseRead' : 320, - 'OpSizeOf' : 321, - 'OpTypePipeStorage' : 322, - 'OpConstantPipeStorage' : 323, - 'OpCreatePipeFromPipeStorage' : 324, - 'OpGetKernelLocalSizeForSubgroupCount' : 325, - 'OpGetKernelMaxNumSubgroups' : 326, - 'OpTypeNamedBarrier' : 327, - 'OpNamedBarrierInitialize' : 328, - 'OpMemoryNamedBarrier' : 329, - 'OpModuleProcessed' : 330, - 'OpSubgroupBallotKHR' : 4421, - 'OpSubgroupFirstInvocationKHR' : 4422, - 'OpSubgroupAllKHR' : 4428, - 'OpSubgroupAnyKHR' : 4429, - 'OpSubgroupAllEqualKHR' : 4430, - 'OpSubgroupReadInvocationKHR' : 4432, - 'OpGroupIAddNonUniformAMD' : 5000, - 'OpGroupFAddNonUniformAMD' : 5001, - 'OpGroupFMinNonUniformAMD' : 5002, - 'OpGroupUMinNonUniformAMD' : 5003, - 'OpGroupSMinNonUniformAMD' : 5004, - 'OpGroupFMaxNonUniformAMD' : 5005, - 'OpGroupUMaxNonUniformAMD' : 5006, - 'OpGroupSMaxNonUniformAMD' : 5007, - 'OpFragmentMaskFetchAMD' : 5011, - 'OpFragmentFetchAMD' : 5012, - 'OpSubgroupShuffleINTEL' : 5571, - 'OpSubgroupShuffleDownINTEL' : 5572, - 'OpSubgroupShuffleUpINTEL' : 5573, - 'OpSubgroupShuffleXorINTEL' : 5574, - 'OpSubgroupBlockReadINTEL' : 5575, - 'OpSubgroupBlockWriteINTEL' : 5576, - 'OpSubgroupImageBlockReadINTEL' : 5577, - 'OpSubgroupImageBlockWriteINTEL' : 5578, - }, - -} - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/extinst.glsl.std.450.grammar.json vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/extinst.glsl.std.450.grammar.json --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/extinst.glsl.std.450.grammar.json 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/extinst.glsl.std.450.grammar.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,642 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "version" : 100, - "revision" : 2, - "instructions" : [ - { - "opname" : "Round", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "RoundEven", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Trunc", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FAbs", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SAbs", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FSign", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SSign", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Floor", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Ceil", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Fract", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Radians", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "'degrees'" } - ] - }, - { - "opname" : "Degrees", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "'radians'" } - ] - }, - { - "opname" : "Sin", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Cos", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Tan", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Asin", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Acos", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atan", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "'y_over_x'" } - ] - }, - { - "opname" : "Sinh", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Cosh", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Tanh", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Asinh", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Acosh", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atanh", - "opcode" : 24, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Atan2", - "opcode" : 25, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Pow", - "opcode" : 26, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "Exp", - "opcode" : 27, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Log", - "opcode" : 28, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Exp2", - "opcode" : 29, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Log2", - "opcode" : 30, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Sqrt", - "opcode" : 31, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "InverseSqrt", - "opcode" : 32, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Determinant", - "opcode" : 33, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "MatrixInverse", - "opcode" : 34, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Modf", - "opcode" : 35, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'i'" } - ] - }, - { - "opname" : "ModfStruct", - "opcode" : 36, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FMin", - "opcode" : 37, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "UMin", - "opcode" : 38, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "SMin", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "FMax", - "opcode" : 40, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "UMax", - "opcode" : 41, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "SMax", - "opcode" : 42, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "FClamp", - "opcode" : 43, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "UClamp", - "opcode" : 44, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "SClamp", - "opcode" : 45, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - }, - { - "opname" : "FMix", - "opcode" : 46, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "IMix", - "opcode" : 47, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "Step", - "opcode" : 48, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "SmoothStep", - "opcode" : 49, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge0'" }, - { "kind" : "IdRef", "name" : "'edge1'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Fma", - "opcode" : 50, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "Frexp", - "opcode" : 51, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "FrexpStruct", - "opcode" : 52, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Ldexp", - "opcode" : 53, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "PackSnorm4x8", - "opcode" : 54, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackUnorm4x8", - "opcode" : 55, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackSnorm2x16", - "opcode" : 56, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackUnorm2x16", - "opcode" : 57, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackHalf2x16", - "opcode" : 58, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "PackDouble2x32", - "opcode" : 59, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ], - "capabilities" : [ "Float64" ] - }, - { - "opname" : "UnpackSnorm2x16", - "opcode" : 60, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackUnorm2x16", - "opcode" : 61, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackHalf2x16", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ] - }, - { - "opname" : "UnpackSnorm4x8", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackUnorm4x8", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "UnpackDouble2x32", - "opcode" : 65, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" } - ], - "capabilities" : [ "Float64" ] - }, - { - "opname" : "Length", - "opcode" : 66, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "Distance", - "opcode" : 67, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "Cross", - "opcode" : 68, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "Normalize", - "opcode" : 69, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "FaceForward", - "opcode" : 70, - "operands" : [ - { "kind" : "IdRef", "name" : "'N'" }, - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'Nref'" } - ] - }, - { - "opname" : "Reflect", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'N'" } - ] - }, - { - "opname" : "Refract", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'I'" }, - { "kind" : "IdRef", "name" : "'N'" }, - { "kind" : "IdRef", "name" : "'eta'" } - ] - }, - { - "opname" : "FindILsb", - "opcode" : 73, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "FindSMsb", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "FindUMsb", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "InterpolateAtCentroid", - "opcode" : 76, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "InterpolateAtSample", - "opcode" : 77, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" }, - { "kind" : "IdRef", "name" : "'sample'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "InterpolateAtOffset", - "opcode" : 78, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" }, - { "kind" : "IdRef", "name" : "'offset'" } - ], - "capabilities" : [ "InterpolationFunction" ] - }, - { - "opname" : "NMin", - "opcode" : 79, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "NMax", - "opcode" : 80, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "NClamp", - "opcode" : 81, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minVal'" }, - { "kind" : "IdRef", "name" : "'maxVal'" } - ] - } - ] -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/extinst.opencl.std.100.grammar.json vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/extinst.opencl.std.100.grammar.json --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/extinst.opencl.std.100.grammar.json 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/extinst.opencl.std.100.grammar.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,1279 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "version" : 100, - "revision" : 2, - "instructions" : [ - { - "opname" : "acos", - "opcode" : 0, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "acosh", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "acospi", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asin", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asinh", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "asinpi", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan2", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atanh", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atanpi", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "atan2pi", - "opcode" : 10, - "operands" : [ - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cbrt", - "opcode" : 11, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ceil", - "opcode" : 12, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "copysign", - "opcode" : 13, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "cos", - "opcode" : 14, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cosh", - "opcode" : 15, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cospi", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "erfc", - "opcode" : 17, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "erf", - "opcode" : 18, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp", - "opcode" : 19, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp2", - "opcode" : 20, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "exp10", - "opcode" : 21, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "expm1", - "opcode" : 22, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fabs", - "opcode" : 23, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fdim", - "opcode" : 24, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "floor", - "opcode" : 25, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "fma", - "opcode" : 26, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "fmax", - "opcode" : 27, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmin", - "opcode" : 28, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmod", - "opcode" : 29, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fract", - "opcode" : 30, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'ptr'" } - ] - }, - { - "opname" : "frexp", - "opcode" : 31, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'exp'" } - ] - }, - { - "opname" : "hypot", - "opcode" : 32, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "ilogb", - "opcode" : 33, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ldexp", - "opcode" : 34, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'k'" } - ] - }, - { - "opname" : "lgamma", - "opcode" : 35, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "lgamma_r", - "opcode" : 36, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'signp'" } - ] - }, - { - "opname" : "log", - "opcode" : 37, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log2", - "opcode" : 38, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log10", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "log1p", - "opcode" : 40, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "logb", - "opcode" : 41, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "mad", - "opcode" : 42, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "maxmag", - "opcode" : 43, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "minmag", - "opcode" : 44, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "modf", - "opcode" : 45, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'iptr'" } - ] - }, - { - "opname" : "nan", - "opcode" : 46, - "operands" : [ - { "kind" : "IdRef", "name" : "'nancode'" } - ] - }, - { - "opname" : "nextafter", - "opcode" : 47, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "pow", - "opcode" : 48, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y" } - ] - }, - { - "opname" : "pown", - "opcode" : 49, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "powr", - "opcode" : 50, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "remainder", - "opcode" : 51, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "remquo", - "opcode" : 52, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'quo'" } - ] - }, - { - "opname" : "rint", - "opcode" : 53, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "rootn", - "opcode" : 54, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "round", - "opcode" : 55, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "rsqrt", - "opcode" : 56, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sin", - "opcode" : 57, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sincos", - "opcode" : 58, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'cosval'" } - ] - }, - { - "opname" : "sinh", - "opcode" : 59, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sinpi", - "opcode" : 60, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sqrt", - "opcode" : 61, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tan", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tanh", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tanpi", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "tgamma", - "opcode" : 65, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "trunc", - "opcode" : 66, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_cos", - "opcode" : 67, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_divide", - "opcode" : 68, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "half_exp", - "opcode" : 69, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_exp2", - "opcode" : 70, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_exp10", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log2", - "opcode" : 73, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_log10", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_powr", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "half_recip", - "opcode" : 76, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_rsqrt", - "opcode" : 77, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_sin", - "opcode" : 78, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_sqrt", - "opcode" : 79, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "half_tan", - "opcode" : 80, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_cos", - "opcode" : 81, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_divide", - "opcode" : 82, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "native_exp", - "opcode" : 83, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_exp2", - "opcode" : 84, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_exp10", - "opcode" : 85, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log", - "opcode" : 86, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log2", - "opcode" : 87, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_log10", - "opcode" : 88, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_powr", - "opcode" : 89, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "native_recip", - "opcode" : 90, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_rsqrt", - "opcode" : 91, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_sin", - "opcode" : 92, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_sqrt", - "opcode" : 93, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "native_tan", - "opcode" : 94, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_abs", - "opcode" : 141, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_abs_diff", - "opcode" : 142, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_add_sat", - "opcode" : 143, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_add_sat", - "opcode" : 144, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_hadd", - "opcode" : 145, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_hadd", - "opcode" : 146, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_rhadd", - "opcode" : 147, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_rhadd", - "opcode" : 148, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_clamp", - "opcode" : 149, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "u_clamp", - "opcode" : 150, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "clz", - "opcode" : 151, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "ctz", - "opcode" : 152, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_mad_hi", - "opcode" : 153, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "u_mad_sat", - "opcode" : 154, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_mad_sat", - "opcode" : 155, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_max", - "opcode" : 156, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_max", - "opcode" : 157, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_min", - "opcode" : 158, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_min", - "opcode" : 159, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "s_mul_hi", - "opcode" : 160, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "rotate", - "opcode" : 161, - "operands" : [ - { "kind" : "IdRef", "name" : "'v'" }, - { "kind" : "IdRef", "name" : "'i'" } - ] - }, - { - "opname" : "s_sub_sat", - "opcode" : 162, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_sub_sat", - "opcode" : 163, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_upsample", - "opcode" : 164, - "operands" : [ - { "kind" : "IdRef", "name" : "'hi'" }, - { "kind" : "IdRef", "name" : "'lo'" } - ] - }, - { - "opname" : "s_upsample", - "opcode" : 165, - "operands" : [ - { "kind" : "IdRef", "name" : "'hi'" }, - { "kind" : "IdRef", "name" : "'lo'" } - ] - }, - { - "opname" : "popcount", - "opcode" : 166, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "s_mad24", - "opcode" : 167, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "u_mad24", - "opcode" : 168, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ] - }, - { - "opname" : "s_mul24", - "opcode" : 169, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mul24", - "opcode" : 170, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_abs", - "opcode" : 201, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "u_abs_diff", - "opcode" : 202, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mul_hi", - "opcode" : 203, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "u_mad_hi", - "opcode" : 204, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "fclamp", - "opcode" : 95, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'minval'" }, - { "kind" : "IdRef", "name" : "'maxval'" } - ] - }, - { - "opname" : "degrees", - "opcode" :96, - "operands" : [ - { "kind" : "IdRef", "name" : "'radians'" } - ] - }, - { - "opname" : "fmax_common", - "opcode" : 97, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "fmin_common", - "opcode" : 98, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ] - }, - { - "opname" : "mix", - "opcode" : 99, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'a'" } - ] - }, - { - "opname" : "radians", - "opcode" : 100, - "operands" : [ - { "kind" : "IdRef", "name" : "'degrees'" } - ] - }, - { - "opname" : "step", - "opcode" : 101, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "smoothstep", - "opcode" : 102, - "operands" : [ - { "kind" : "IdRef", "name" : "'edge0'" }, - { "kind" : "IdRef", "name" : "'edge1'" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "sign", - "opcode" : 103, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "cross", - "opcode" : 104, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "distance", - "opcode" : 105, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "length", - "opcode" : 106, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "normalize", - "opcode" : 107, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "fast_distance", - "opcode" : 108, - "operands" : [ - { "kind" : "IdRef", "name" : "'p0'" }, - { "kind" : "IdRef", "name" : "'p1'" } - ] - }, - { - "opname" : "fast_length", - "opcode" : 109, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "fast_normalize", - "opcode" : 110, - "operands" : [ - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "bitselect", - "opcode" : 186, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "select", - "opcode" : 187, - "operands" : [ - { "kind" : "IdRef", "name" : "'a'" }, - { "kind" : "IdRef", "name" : "'b'" }, - { "kind" : "IdRef", "name" : "'c'" } - ] - }, - { - "opname" : "vloadn", - "opcode" : 171, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstoren", - "opcode" : 172, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vload_half", - "opcode" : 173, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vload_halfn", - "opcode" : 174, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstore_half", - "opcode" : 175, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstore_half_r", - "opcode" : 176, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "vstore_halfn", - "opcode" : 177, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstore_halfn_r", - "opcode" : 178, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "vloada_halfn", - "opcode" : 179, - "operands" : [ - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "LiteralInteger", "name" : "'n'" } - ] - }, - { - "opname" : "vstorea_halfn", - "opcode" : 180, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" } - ] - }, - { - "opname" : "vstorea_halfn_r", - "opcode" : 181, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" }, - { "kind" : "IdRef", "name" : "'p'" }, - { "kind" : "FPRoundingMode", "name" : "'mode'" } - ] - }, - { - "opname" : "shuffle", - "opcode" : 182, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'shuffle mask'" } - ] - }, - { - "opname" : "shuffle2", - "opcode" : 183, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'shuffle mask'" } - ] - }, - { - "opname" : "printf", - "opcode" : 184, - "operands" : [ - { "kind" : "IdRef", "name" : "'format'" }, - { "kind" : "IdRef", "name" : "'additional arguments'", "quantifier" : "*" } - ] - }, - { - "opname" : "prefetch", - "opcode" : 185, - "operands" : [ - { "kind" : "IdRef", "name" : "'ptr'" }, - { "kind" : "IdRef", "name" : "'num elements'" } - ] - } - ] -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/GLSL.std.450.h vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/GLSL.std.450.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/GLSL.std.450.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/GLSL.std.450.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,131 +0,0 @@ -/* -** Copyright (c) 2014-2016 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and/or associated documentation files (the "Materials"), -** to deal in the Materials without restriction, including without limitation -** the rights to use, copy, modify, merge, publish, distribute, sublicense, -** and/or sell copies of the Materials, and to permit persons to whom the -** Materials are furnished to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in -** all copies or substantial portions of the Materials. -** -** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -** IN THE MATERIALS. -*/ - -#ifndef GLSLstd450_H -#define GLSLstd450_H - -static const int GLSLstd450Version = 100; -static const int GLSLstd450Revision = 3; - -enum GLSLstd450 { - GLSLstd450Bad = 0, // Don't use - - GLSLstd450Round = 1, - GLSLstd450RoundEven = 2, - GLSLstd450Trunc = 3, - GLSLstd450FAbs = 4, - GLSLstd450SAbs = 5, - GLSLstd450FSign = 6, - GLSLstd450SSign = 7, - GLSLstd450Floor = 8, - GLSLstd450Ceil = 9, - GLSLstd450Fract = 10, - - GLSLstd450Radians = 11, - GLSLstd450Degrees = 12, - GLSLstd450Sin = 13, - GLSLstd450Cos = 14, - GLSLstd450Tan = 15, - GLSLstd450Asin = 16, - GLSLstd450Acos = 17, - GLSLstd450Atan = 18, - GLSLstd450Sinh = 19, - GLSLstd450Cosh = 20, - GLSLstd450Tanh = 21, - GLSLstd450Asinh = 22, - GLSLstd450Acosh = 23, - GLSLstd450Atanh = 24, - GLSLstd450Atan2 = 25, - - GLSLstd450Pow = 26, - GLSLstd450Exp = 27, - GLSLstd450Log = 28, - GLSLstd450Exp2 = 29, - GLSLstd450Log2 = 30, - GLSLstd450Sqrt = 31, - GLSLstd450InverseSqrt = 32, - - GLSLstd450Determinant = 33, - GLSLstd450MatrixInverse = 34, - - GLSLstd450Modf = 35, // second operand needs an OpVariable to write to - GLSLstd450ModfStruct = 36, // no OpVariable operand - GLSLstd450FMin = 37, - GLSLstd450UMin = 38, - GLSLstd450SMin = 39, - GLSLstd450FMax = 40, - GLSLstd450UMax = 41, - GLSLstd450SMax = 42, - GLSLstd450FClamp = 43, - GLSLstd450UClamp = 44, - GLSLstd450SClamp = 45, - GLSLstd450FMix = 46, - GLSLstd450IMix = 47, // Reserved - GLSLstd450Step = 48, - GLSLstd450SmoothStep = 49, - - GLSLstd450Fma = 50, - GLSLstd450Frexp = 51, // second operand needs an OpVariable to write to - GLSLstd450FrexpStruct = 52, // no OpVariable operand - GLSLstd450Ldexp = 53, - - GLSLstd450PackSnorm4x8 = 54, - GLSLstd450PackUnorm4x8 = 55, - GLSLstd450PackSnorm2x16 = 56, - GLSLstd450PackUnorm2x16 = 57, - GLSLstd450PackHalf2x16 = 58, - GLSLstd450PackDouble2x32 = 59, - GLSLstd450UnpackSnorm2x16 = 60, - GLSLstd450UnpackUnorm2x16 = 61, - GLSLstd450UnpackHalf2x16 = 62, - GLSLstd450UnpackSnorm4x8 = 63, - GLSLstd450UnpackUnorm4x8 = 64, - GLSLstd450UnpackDouble2x32 = 65, - - GLSLstd450Length = 66, - GLSLstd450Distance = 67, - GLSLstd450Cross = 68, - GLSLstd450Normalize = 69, - GLSLstd450FaceForward = 70, - GLSLstd450Reflect = 71, - GLSLstd450Refract = 72, - - GLSLstd450FindILsb = 73, - GLSLstd450FindSMsb = 74, - GLSLstd450FindUMsb = 75, - - GLSLstd450InterpolateAtCentroid = 76, - GLSLstd450InterpolateAtSample = 77, - GLSLstd450InterpolateAtOffset = 78, - - GLSLstd450NMin = 79, - GLSLstd450NMax = 80, - GLSLstd450NClamp = 81, - - GLSLstd450Count -}; - -#endif // #ifndef GLSLstd450_H diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/OpenCL.std.h vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/OpenCL.std.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/OpenCL.std.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/OpenCL.std.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,210 +0,0 @@ -/* -** Copyright (c) 2015-2017 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and/or associated documentation files (the "Materials"), -** to deal in the Materials without restriction, including without limitation -** the rights to use, copy, modify, merge, publish, distribute, sublicense, -** and/or sell copies of the Materials, and to permit persons to whom the -** Materials are furnished to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in -** all copies or substantial portions of the Materials. -** -** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -** IN THE MATERIALS. -*/ - -namespace OpenCLLIB { - -enum Entrypoints { - - // Section 2.1: Math extended instructions - Acos = 0, - Acosh = 1, - Acospi = 2, - Asin = 3, - Asinh = 4, - Asinpi = 5, - Atan = 6, - Atan2 = 7, - Atanh = 8, - Atanpi = 9, - Atan2pi = 10, - Cbrt = 11, - Ceil = 12, - Copysign = 13, - Cos = 14, - Cosh = 15, - Cospi = 16, - Erfc = 17, - Erf = 18, - Exp = 19, - Exp2 = 20, - Exp10 = 21, - Expm1 = 22, - Fabs = 23, - Fdim = 24, - Floor = 25, - Fma = 26, - Fmax = 27, - Fmin = 28, - Fmod = 29, - Fract = 30, - Frexp = 31, - Hypot = 32, - Ilogb = 33, - Ldexp = 34, - Lgamma = 35, - Lgamma_r = 36, - Log = 37, - Log2 = 38, - Log10 = 39, - Log1p = 40, - Logb = 41, - Mad = 42, - Maxmag = 43, - Minmag = 44, - Modf = 45, - Nan = 46, - Nextafter = 47, - Pow = 48, - Pown = 49, - Powr = 50, - Remainder = 51, - Remquo = 52, - Rint = 53, - Rootn = 54, - Round = 55, - Rsqrt = 56, - Sin = 57, - Sincos = 58, - Sinh = 59, - Sinpi = 60, - Sqrt = 61, - Tan = 62, - Tanh = 63, - Tanpi = 64, - Tgamma = 65, - Trunc = 66, - Half_cos = 67, - Half_divide = 68, - Half_exp = 69, - Half_exp2 = 70, - Half_exp10 = 71, - Half_log = 72, - Half_log2 = 73, - Half_log10 = 74, - Half_powr = 75, - Half_recip = 76, - Half_rsqrt = 77, - Half_sin = 78, - Half_sqrt = 79, - Half_tan = 80, - Native_cos = 81, - Native_divide = 82, - Native_exp = 83, - Native_exp2 = 84, - Native_exp10 = 85, - Native_log = 86, - Native_log2 = 87, - Native_log10 = 88, - Native_powr = 89, - Native_recip = 90, - Native_rsqrt = 91, - Native_sin = 92, - Native_sqrt = 93, - Native_tan = 94, - - // Section 2.2: Integer instructions - SAbs = 141, - SAbs_diff = 142, - SAdd_sat = 143, - UAdd_sat = 144, - SHadd = 145, - UHadd = 146, - SRhadd = 147, - URhadd = 148, - SClamp = 149, - UClamp = 150, - Clz = 151, - Ctz = 152, - SMad_hi = 153, - UMad_sat = 154, - SMad_sat = 155, - SMax = 156, - UMax = 157, - SMin = 158, - UMin = 159, - SMul_hi = 160, - Rotate = 161, - SSub_sat = 162, - USub_sat = 163, - U_Upsample = 164, - S_Upsample = 165, - Popcount = 166, - SMad24 = 167, - UMad24 = 168, - SMul24 = 169, - UMul24 = 170, - UAbs = 201, - UAbs_diff = 202, - UMul_hi = 203, - UMad_hi = 204, - - // Section 2.3: Common instructions - FClamp = 95, - Degrees = 96, - FMax_common = 97, - FMin_common = 98, - Mix = 99, - Radians = 100, - Step = 101, - Smoothstep = 102, - Sign = 103, - - // Section 2.4: Geometric instructions - Cross = 104, - Distance = 105, - Length = 106, - Normalize = 107, - Fast_distance = 108, - Fast_length = 109, - Fast_normalize = 110, - - // Section 2.5: Relational instructions - Bitselect = 186, - Select = 187, - - // Section 2.6: Vector Data Load and Store instructions - Vloadn = 171, - Vstoren = 172, - Vload_half = 173, - Vload_halfn = 174, - Vstore_half = 175, - Vstore_half_r = 176, - Vstore_halfn = 177, - Vstore_halfn_r = 178, - Vloada_halfn = 179, - Vstorea_halfn = 180, - Vstorea_halfn_r = 181, - - // Section 2.7: Miscellaneous Vector instructions - Shuffle = 182, - Shuffle2 = 183, - - // Section 2.8: Misc instructions - Printf = 184, - Prefetch = 185, -}; - -} // end namespace OpenCLLIB diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.core.grammar.json vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.core.grammar.json --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.core.grammar.json 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.core.grammar.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,5951 +0,0 @@ -{ - "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - "magic_number" : "0x07230203", - "major_version" : 1, - "minor_version" : 2, - "revision" : 2, - "instructions" : [ - { - "opname" : "OpNop", - "opcode" : 0 - }, - { - "opname" : "OpUndef", - "opcode" : 1, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSourceContinued", - "opcode" : 2, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Continued Source'" } - ] - }, - { - "opname" : "OpSource", - "opcode" : 3, - "operands" : [ - { "kind" : "SourceLanguage" }, - { "kind" : "LiteralInteger", "name" : "'Version'" }, - { "kind" : "IdRef", "quantifier" : "?", "name" : "'File'" }, - { "kind" : "LiteralString", "quantifier" : "?", "name" : "'Source'" } - ] - }, - { - "opname" : "OpSourceExtension", - "opcode" : 4, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Extension'" } - ] - }, - { - "opname" : "OpName", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpMemberName", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpString", - "opcode" : 7, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "'String'" } - ] - }, - { - "opname" : "OpLine", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'File'" }, - { "kind" : "LiteralInteger", "name" : "'Line'" }, - { "kind" : "LiteralInteger", "name" : "'Column'" } - ] - }, - { - "opname" : "OpExtension", - "opcode" : 10, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpExtInstImport", - "opcode" : 11, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ] - }, - { - "opname" : "OpExtInst", - "opcode" : 12, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Set'" }, - { "kind" : "LiteralExtInstInteger", "name" : "'Instruction'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Operand 1', +\n'Operand 2', +\n..." } - ] - }, - { - "opname" : "OpMemoryModel", - "opcode" : 14, - "operands" : [ - { "kind" : "AddressingModel" }, - { "kind" : "MemoryModel" } - ] - }, - { - "opname" : "OpEntryPoint", - "opcode" : 15, - "operands" : [ - { "kind" : "ExecutionModel" }, - { "kind" : "IdRef", "name" : "'Entry Point'" }, - { "kind" : "LiteralString", "name" : "'Name'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Interface'" } - ] - }, - { - "opname" : "OpExecutionMode", - "opcode" : 16, - "operands" : [ - { "kind" : "IdRef", "name" : "'Entry Point'" }, - { "kind" : "ExecutionMode", "name" : "'Mode'" } - ] - }, - { - "opname" : "OpCapability", - "opcode" : 17, - "operands" : [ - { "kind" : "Capability", "name" : "'Capability'" } - ] - }, - { - "opname" : "OpTypeVoid", - "opcode" : 19, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeBool", - "opcode" : 20, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeInt", - "opcode" : 21, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Width'" }, - { "kind" : "LiteralInteger", "name" : "'Signedness'" } - ] - }, - { - "opname" : "OpTypeFloat", - "opcode" : 22, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Width'" } - ] - }, - { - "opname" : "OpTypeVector", - "opcode" : 23, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Component Type'" }, - { "kind" : "LiteralInteger", "name" : "'Component Count'" } - ] - }, - { - "opname" : "OpTypeMatrix", - "opcode" : 24, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Column Type'" }, - { "kind" : "LiteralInteger", "name" : "'Column Count'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpTypeImage", - "opcode" : 25, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Type'" }, - { "kind" : "Dim" }, - { "kind" : "LiteralInteger", "name" : "'Depth'" }, - { "kind" : "LiteralInteger", "name" : "'Arrayed'" }, - { "kind" : "LiteralInteger", "name" : "'MS'" }, - { "kind" : "LiteralInteger", "name" : "'Sampled'" }, - { "kind" : "ImageFormat" }, - { "kind" : "AccessQualifier", "quantifier" : "?" } - ] - }, - { - "opname" : "OpTypeSampler", - "opcode" : 26, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpTypeSampledImage", - "opcode" : 27, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image Type'" } - ] - }, - { - "opname" : "OpTypeArray", - "opcode" : 28, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Element Type'" }, - { "kind" : "IdRef", "name" : "'Length'" } - ] - }, - { - "opname" : "OpTypeRuntimeArray", - "opcode" : 29, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Element Type'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpTypeStruct", - "opcode" : 30, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Member 0 type', +\n'member 1 type', +\n..." } - ] - }, - { - "opname" : "OpTypeOpaque", - "opcode" : 31, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "LiteralString", "name" : "The name of the opaque type." } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpTypePointer", - "opcode" : 32, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "StorageClass" }, - { "kind" : "IdRef", "name" : "'Type'" } - ] - }, - { - "opname" : "OpTypeFunction", - "opcode" : 33, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Return Type'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Parameter 0 Type', +\n'Parameter 1 Type', +\n..." } - ] - }, - { - "opname" : "OpTypeEvent", - "opcode" : 34, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpTypeDeviceEvent", - "opcode" : 35, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpTypeReserveId", - "opcode" : 36, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpTypeQueue", - "opcode" : 37, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpTypePipe", - "opcode" : 38, - "operands" : [ - { "kind" : "IdResult" }, - { "kind" : "AccessQualifier", "name" : "'Qualifier'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpTypeForwardPointer", - "opcode" : 39, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer Type'" }, - { "kind" : "StorageClass" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpConstantTrue", - "opcode" : 41, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpConstantFalse", - "opcode" : 42, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpConstant", - "opcode" : 43, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } - ] - }, - { - "opname" : "OpConstantComposite", - "opcode" : 44, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpConstantSampler", - "opcode" : 45, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "SamplerAddressingMode" }, - { "kind" : "LiteralInteger", "name" : "'Param'" }, - { "kind" : "SamplerFilterMode" } - ], - "capabilities" : [ "LiteralSampler" ] - }, - { - "opname" : "OpConstantNull", - "opcode" : 46, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstantTrue", - "opcode" : 48, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstantFalse", - "opcode" : 49, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpSpecConstant", - "opcode" : 50, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" } - ] - }, - { - "opname" : "OpSpecConstantComposite", - "opcode" : 51, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpSpecConstantOp", - "opcode" : 52, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralSpecConstantOpInteger", "name" : "'Opcode'" } - ] - }, - { - "opname" : "OpFunction", - "opcode" : 54, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "FunctionControl" }, - { "kind" : "IdRef", "name" : "'Function Type'" } - ] - }, - { - "opname" : "OpFunctionParameter", - "opcode" : 55, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpFunctionEnd", - "opcode" : 56 - }, - { - "opname" : "OpFunctionCall", - "opcode" : 57, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Function'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Argument 0', +\n'Argument 1', +\n..." } - ] - }, - { - "opname" : "OpVariable", - "opcode" : 59, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "StorageClass" }, - { "kind" : "IdRef", "quantifier" : "?", "name" : "'Initializer'" } - ] - }, - { - "opname" : "OpImageTexelPointer", - "opcode" : 60, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Sample'" } - ] - }, - { - "opname" : "OpLoad", - "opcode" : 61, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpStore", - "opcode" : 62, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Object'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpCopyMemory", - "opcode" : 63, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ] - }, - { - "opname" : "OpCopyMemorySized", - "opcode" : 64, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Size'" }, - { "kind" : "MemoryAccess", "quantifier" : "?" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpAccessChain", - "opcode" : 65, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpInBoundsAccessChain", - "opcode" : 66, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpPtrAccessChain", - "opcode" : 67, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Element'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ], - "capabilities" : [ - "Addresses", - "VariablePointers", - "VariablePointersStorageBuffer" - ] - }, - { - "opname" : "OpArrayLength", - "opcode" : 68, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Structure'" }, - { "kind" : "LiteralInteger", "name" : "'Array member'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpGenericPtrMemSemantics", - "opcode" : 69, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpInBoundsPtrAccessChain", - "opcode" : 70, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Element'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpDecorate", - "opcode" : 71, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "Decoration" } - ] - }, - { - "opname" : "OpMemberDecorate", - "opcode" : 72, - "operands" : [ - { "kind" : "IdRef", "name" : "'Structure Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "Decoration" } - ] - }, - { - "opname" : "OpDecorationGroup", - "opcode" : 73, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpGroupDecorate", - "opcode" : 74, - "operands" : [ - { "kind" : "IdRef", "name" : "'Decoration Group'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Targets'" } - ] - }, - { - "opname" : "OpGroupMemberDecorate", - "opcode" : 75, - "operands" : [ - { "kind" : "IdRef", "name" : "'Decoration Group'" }, - { "kind" : "PairIdRefLiteralInteger", "quantifier" : "*", "name" : "'Targets'" } - ] - }, - { - "opname" : "OpVectorExtractDynamic", - "opcode" : 77, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ] - }, - { - "opname" : "OpVectorInsertDynamic", - "opcode" : 78, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ] - }, - { - "opname" : "OpVectorShuffle", - "opcode" : 79, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Components'" } - ] - }, - { - "opname" : "OpCompositeConstruct", - "opcode" : 80, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } - ] - }, - { - "opname" : "OpCompositeExtract", - "opcode" : 81, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Composite'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpCompositeInsert", - "opcode" : 82, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Object'" }, - { "kind" : "IdRef", "name" : "'Composite'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" } - ] - }, - { - "opname" : "OpCopyObject", - "opcode" : 83, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpTranspose", - "opcode" : 84, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpSampledImage", - "opcode" : 86, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Sampler'" } - ] - }, - { - "opname" : "OpImageSampleImplicitLod", - "opcode" : 87, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleExplicitLod", - "opcode" : 88, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ] - }, - { - "opname" : "OpImageSampleDrefImplicitLod", - "opcode" : 89, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleDrefExplicitLod", - "opcode" : 90, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjImplicitLod", - "opcode" : 91, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjExplicitLod", - "opcode" : 92, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjDrefImplicitLod", - "opcode" : 93, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageSampleProjDrefExplicitLod", - "opcode" : 94, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageFetch", - "opcode" : 95, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImageGather", - "opcode" : 96, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageDrefGather", - "opcode" : 97, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpImageRead", - "opcode" : 98, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImageWrite", - "opcode" : 99, - "operands" : [ - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Texel'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ] - }, - { - "opname" : "OpImage", - "opcode" : 100, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" } - ] - }, - { - "opname" : "OpImageQueryFormat", - "opcode" : 101, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageQueryOrder", - "opcode" : 102, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageQuerySizeLod", - "opcode" : 103, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Level of Detail'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQuerySize", - "opcode" : 104, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQueryLod", - "opcode" : 105, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "ImageQuery" ] - }, - { - "opname" : "OpImageQueryLevels", - "opcode" : 106, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpImageQuerySamples", - "opcode" : 107, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" } - ], - "capabilities" : [ "Kernel", "ImageQuery" ] - }, - { - "opname" : "OpConvertFToU", - "opcode" : 109, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpConvertFToS", - "opcode" : 110, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpConvertSToF", - "opcode" : 111, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ] - }, - { - "opname" : "OpConvertUToF", - "opcode" : 112, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ] - }, - { - "opname" : "OpUConvert", - "opcode" : 113, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ] - }, - { - "opname" : "OpSConvert", - "opcode" : 114, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ] - }, - { - "opname" : "OpFConvert", - "opcode" : 115, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Float Value'" } - ] - }, - { - "opname" : "OpQuantizeToF16", - "opcode" : 116, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpConvertPtrToU", - "opcode" : 117, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpSatConvertSToU", - "opcode" : 118, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Signed Value'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpSatConvertUToS", - "opcode" : 119, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Unsigned Value'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpConvertUToPtr", - "opcode" : 120, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Integer Value'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpPtrCastToGeneric", - "opcode" : 121, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGenericCastToPtr", - "opcode" : 122, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGenericCastToPtrExplicit", - "opcode" : 123, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "StorageClass", "name" : "'Storage'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpBitcast", - "opcode" : 124, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpSNegate", - "opcode" : 126, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpFNegate", - "opcode" : 127, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpIAdd", - "opcode" : 128, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFAdd", - "opcode" : 129, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpISub", - "opcode" : 130, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFSub", - "opcode" : 131, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpIMul", - "opcode" : 132, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFMul", - "opcode" : 133, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUDiv", - "opcode" : 134, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSDiv", - "opcode" : 135, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFDiv", - "opcode" : 136, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUMod", - "opcode" : 137, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSRem", - "opcode" : 138, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSMod", - "opcode" : 139, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFRem", - "opcode" : 140, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFMod", - "opcode" : 141, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpVectorTimesScalar", - "opcode" : 142, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Scalar'" } - ] - }, - { - "opname" : "OpMatrixTimesScalar", - "opcode" : 143, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" }, - { "kind" : "IdRef", "name" : "'Scalar'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpVectorTimesMatrix", - "opcode" : 144, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" }, - { "kind" : "IdRef", "name" : "'Matrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpMatrixTimesVector", - "opcode" : 145, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Matrix'" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpMatrixTimesMatrix", - "opcode" : 146, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'LeftMatrix'" }, - { "kind" : "IdRef", "name" : "'RightMatrix'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpOuterProduct", - "opcode" : 147, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" } - ], - "capabilities" : [ "Matrix" ] - }, - { - "opname" : "OpDot", - "opcode" : 148, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" } - ] - }, - { - "opname" : "OpIAddCarry", - "opcode" : 149, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpISubBorrow", - "opcode" : 150, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUMulExtended", - "opcode" : 151, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSMulExtended", - "opcode" : 152, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpAny", - "opcode" : 154, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ] - }, - { - "opname" : "OpAll", - "opcode" : 155, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector'" } - ] - }, - { - "opname" : "OpIsNan", - "opcode" : 156, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "OpIsInf", - "opcode" : 157, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ] - }, - { - "opname" : "OpIsFinite", - "opcode" : 158, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpIsNormal", - "opcode" : 159, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpSignBitSet", - "opcode" : 160, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLessOrGreater", - "opcode" : 161, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpOrdered", - "opcode" : 162, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpUnordered", - "opcode" : 163, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLogicalEqual", - "opcode" : 164, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalNotEqual", - "opcode" : 165, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalOr", - "opcode" : 166, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalAnd", - "opcode" : 167, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpLogicalNot", - "opcode" : 168, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpSelect", - "opcode" : 169, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Condition'" }, - { "kind" : "IdRef", "name" : "'Object 1'" }, - { "kind" : "IdRef", "name" : "'Object 2'" } - ] - }, - { - "opname" : "OpIEqual", - "opcode" : 170, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpINotEqual", - "opcode" : 171, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUGreaterThan", - "opcode" : 172, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSGreaterThan", - "opcode" : 173, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpUGreaterThanEqual", - "opcode" : 174, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSGreaterThanEqual", - "opcode" : 175, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpULessThan", - "opcode" : 176, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSLessThan", - "opcode" : 177, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpULessThanEqual", - "opcode" : 178, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpSLessThanEqual", - "opcode" : 179, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdEqual", - "opcode" : 180, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordEqual", - "opcode" : 181, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdNotEqual", - "opcode" : 182, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordNotEqual", - "opcode" : 183, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdLessThan", - "opcode" : 184, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordLessThan", - "opcode" : 185, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdGreaterThan", - "opcode" : 186, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordGreaterThan", - "opcode" : 187, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdLessThanEqual", - "opcode" : 188, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordLessThanEqual", - "opcode" : 189, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFOrdGreaterThanEqual", - "opcode" : 190, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpFUnordGreaterThanEqual", - "opcode" : 191, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpShiftRightLogical", - "opcode" : 194, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpShiftRightArithmetic", - "opcode" : 195, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpShiftLeftLogical", - "opcode" : 196, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Shift'" } - ] - }, - { - "opname" : "OpBitwiseOr", - "opcode" : 197, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpBitwiseXor", - "opcode" : 198, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpBitwiseAnd", - "opcode" : 199, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand 1'" }, - { "kind" : "IdRef", "name" : "'Operand 2'" } - ] - }, - { - "opname" : "OpNot", - "opcode" : 200, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Operand'" } - ] - }, - { - "opname" : "OpBitFieldInsert", - "opcode" : 201, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Insert'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitFieldSExtract", - "opcode" : 202, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitFieldUExtract", - "opcode" : 203, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" }, - { "kind" : "IdRef", "name" : "'Offset'" }, - { "kind" : "IdRef", "name" : "'Count'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitReverse", - "opcode" : 204, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpBitCount", - "opcode" : 205, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Base'" } - ] - }, - { - "opname" : "OpDPdx", - "opcode" : 207, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpDPdy", - "opcode" : 208, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpFwidth", - "opcode" : 209, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpDPdxFine", - "opcode" : 210, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdyFine", - "opcode" : 211, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpFwidthFine", - "opcode" : 212, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdxCoarse", - "opcode" : 213, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpDPdyCoarse", - "opcode" : 214, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpFwidthCoarse", - "opcode" : 215, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'P'" } - ], - "capabilities" : [ "DerivativeControl" ] - }, - { - "opname" : "OpEmitVertex", - "opcode" : 218, - "capabilities" : [ "Geometry" ] - }, - { - "opname" : "OpEndPrimitive", - "opcode" : 219, - "capabilities" : [ "Geometry" ] - }, - { - "opname" : "OpEmitStreamVertex", - "opcode" : 220, - "operands" : [ - { "kind" : "IdRef", "name" : "'Stream'" } - ], - "capabilities" : [ "GeometryStreams" ] - }, - { - "opname" : "OpEndStreamPrimitive", - "opcode" : 221, - "operands" : [ - { "kind" : "IdRef", "name" : "'Stream'" } - ], - "capabilities" : [ "GeometryStreams" ] - }, - { - "opname" : "OpControlBarrier", - "opcode" : 224, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpMemoryBarrier", - "opcode" : 225, - "operands" : [ - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicLoad", - "opcode" : 227, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicStore", - "opcode" : 228, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicExchange", - "opcode" : 229, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicCompareExchange", - "opcode" : 230, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, - { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Comparator'" } - ] - }, - { - "opname" : "OpAtomicCompareExchangeWeak", - "opcode" : 231, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Equal'" }, - { "kind" : "IdMemorySemantics", "name" : "'Unequal'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Comparator'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpAtomicIIncrement", - "opcode" : 232, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicIDecrement", - "opcode" : 233, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ] - }, - { - "opname" : "OpAtomicIAdd", - "opcode" : 234, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicISub", - "opcode" : 235, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicSMin", - "opcode" : 236, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicUMin", - "opcode" : 237, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicSMax", - "opcode" : 238, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicUMax", - "opcode" : 239, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicAnd", - "opcode" : 240, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicOr", - "opcode" : 241, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpAtomicXor", - "opcode" : 242, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpPhi", - "opcode" : 245, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "PairIdRefIdRef", "quantifier" : "*", "name" : "'Variable, Parent, ...'" } - ] - }, - { - "opname" : "OpLoopMerge", - "opcode" : 246, - "operands" : [ - { "kind" : "IdRef", "name" : "'Merge Block'" }, - { "kind" : "IdRef", "name" : "'Continue Target'" }, - { "kind" : "LoopControl" } - ] - }, - { - "opname" : "OpSelectionMerge", - "opcode" : 247, - "operands" : [ - { "kind" : "IdRef", "name" : "'Merge Block'" }, - { "kind" : "SelectionControl" } - ] - }, - { - "opname" : "OpLabel", - "opcode" : 248, - "operands" : [ - { "kind" : "IdResult" } - ] - }, - { - "opname" : "OpBranch", - "opcode" : 249, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target Label'" } - ] - }, - { - "opname" : "OpBranchConditional", - "opcode" : 250, - "operands" : [ - { "kind" : "IdRef", "name" : "'Condition'" }, - { "kind" : "IdRef", "name" : "'True Label'" }, - { "kind" : "IdRef", "name" : "'False Label'" }, - { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Branch weights'" } - ] - }, - { - "opname" : "OpSwitch", - "opcode" : 251, - "operands" : [ - { "kind" : "IdRef", "name" : "'Selector'" }, - { "kind" : "IdRef", "name" : "'Default'" }, - { "kind" : "PairLiteralIntegerIdRef", "quantifier" : "*", "name" : "'Target'" } - ] - }, - { - "opname" : "OpKill", - "opcode" : 252, - "capabilities" : [ "Shader" ] - }, - { - "opname" : "OpReturn", - "opcode" : 253 - }, - { - "opname" : "OpReturnValue", - "opcode" : 254, - "operands" : [ - { "kind" : "IdRef", "name" : "'Value'" } - ] - }, - { - "opname" : "OpUnreachable", - "opcode" : 255 - }, - { - "opname" : "OpLifetimeStart", - "opcode" : 256, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "LiteralInteger", "name" : "'Size'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpLifetimeStop", - "opcode" : 257, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "LiteralInteger", "name" : "'Size'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupAsyncCopy", - "opcode" : 259, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Destination'" }, - { "kind" : "IdRef", "name" : "'Source'" }, - { "kind" : "IdRef", "name" : "'Num Elements'" }, - { "kind" : "IdRef", "name" : "'Stride'" }, - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupWaitEvents", - "opcode" : 260, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Events List'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpGroupAll", - "opcode" : 261, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupAny", - "opcode" : 262, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupBroadcast", - "opcode" : 263, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'LocalId'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupIAdd", - "opcode" : 264, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFAdd", - "opcode" : 265, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMin", - "opcode" : 266, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMin", - "opcode" : 267, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMin", - "opcode" : 268, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMax", - "opcode" : 269, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMax", - "opcode" : 270, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMax", - "opcode" : 271, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpReadPipe", - "opcode" : 274, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpWritePipe", - "opcode" : 275, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReservedReadPipe", - "opcode" : 276, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Index'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReservedWritePipe", - "opcode" : 277, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Index'" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReserveReadPipePackets", - "opcode" : 278, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpReserveWritePipePackets", - "opcode" : 279, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpCommitReadPipe", - "opcode" : 280, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpCommitWritePipe", - "opcode" : 281, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpIsValidReserveId", - "opcode" : 282, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGetNumPipePackets", - "opcode" : 283, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGetMaxPipePackets", - "opcode" : 284, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupReserveReadPipePackets", - "opcode" : 285, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupReserveWritePipePackets", - "opcode" : 286, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Num Packets'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupCommitReadPipe", - "opcode" : 287, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpGroupCommitWritePipe", - "opcode" : 288, - "operands" : [ - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "IdRef", "name" : "'Pipe'" }, - { "kind" : "IdRef", "name" : "'Reserve Id'" }, - { "kind" : "IdRef", "name" : "'Packet Size'" }, - { "kind" : "IdRef", "name" : "'Packet Alignment'" } - ], - "capabilities" : [ "Pipes" ] - }, - { - "opname" : "OpEnqueueMarker", - "opcode" : 291, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Queue'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Wait Events'" }, - { "kind" : "IdRef", "name" : "'Ret Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpEnqueueKernel", - "opcode" : 292, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Queue'" }, - { "kind" : "IdRef", "name" : "'Flags'" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Num Events'" }, - { "kind" : "IdRef", "name" : "'Wait Events'" }, - { "kind" : "IdRef", "name" : "'Ret Event'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" }, - { "kind" : "IdRef", "quantifier" : "*", "name" : "'Local Size'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelNDrangeSubGroupCount", - "opcode" : 293, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelNDrangeMaxSubGroupSize", - "opcode" : 294, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'ND Range'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelWorkGroupSize", - "opcode" : 295, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetKernelPreferredWorkGroupSizeMultiple", - "opcode" : 296, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpRetainEvent", - "opcode" : 297, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpReleaseEvent", - "opcode" : 298, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpCreateUserEvent", - "opcode" : 299, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpIsValidEvent", - "opcode" : 300, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Event'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpSetUserEventStatus", - "opcode" : 301, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" }, - { "kind" : "IdRef", "name" : "'Status'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpCaptureEventProfilingInfo", - "opcode" : 302, - "operands" : [ - { "kind" : "IdRef", "name" : "'Event'" }, - { "kind" : "IdRef", "name" : "'Profiling Info'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpGetDefaultQueue", - "opcode" : 303, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpBuildNDRange", - "opcode" : 304, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'GlobalWorkSize'" }, - { "kind" : "IdRef", "name" : "'LocalWorkSize'" }, - { "kind" : "IdRef", "name" : "'GlobalWorkOffset'" } - ], - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "opname" : "OpImageSparseSampleImplicitLod", - "opcode" : 305, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleExplicitLod", - "opcode" : 306, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleDrefImplicitLod", - "opcode" : 307, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleDrefExplicitLod", - "opcode" : 308, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjImplicitLod", - "opcode" : 309, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjExplicitLod", - "opcode" : 310, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjDrefImplicitLod", - "opcode" : 311, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseSampleProjDrefExplicitLod", - "opcode" : 312, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseFetch", - "opcode" : 313, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseGather", - "opcode" : 314, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Component'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseDrefGather", - "opcode" : 315, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Sampled Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'D~ref~'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpImageSparseTexelsResident", - "opcode" : 316, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Resident Code'" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpNoLine", - "opcode" : 317 - }, - { - "opname" : "OpAtomicFlagTestAndSet", - "opcode" : 318, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpAtomicFlagClear", - "opcode" : 319, - "operands" : [ - { "kind" : "IdRef", "name" : "'Pointer'" }, - { "kind" : "IdScope", "name" : "'Scope'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "Kernel" ] - }, - { - "opname" : "OpImageSparseRead", - "opcode" : 320, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "ImageOperands", "quantifier" : "?" } - ], - "capabilities" : [ "SparseResidency" ] - }, - { - "opname" : "OpSizeOf", - "opcode" : 321, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pointer'" } - ], - "capabilities" : [ "Addresses" ] - }, - { - "opname" : "OpTypePipeStorage", - "opcode" : 322, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "PipeStorage" ] - }, - { - "opname" : "OpConstantPipeStorage", - "opcode" : 323, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Packet Size'" }, - { "kind" : "LiteralInteger", "name" : "'Packet Alignment'" }, - { "kind" : "LiteralInteger", "name" : "'Capacity'" } - ], - "capabilities" : [ "PipeStorage" ] - }, - { - "opname" : "OpCreatePipeFromPipeStorage", - "opcode" : 324, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Pipe Storage'" } - ], - "capabilities" : [ "PipeStorage" ] - }, - { - "opname" : "OpGetKernelLocalSizeForSubgroupCount", - "opcode" : 325, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Subgroup Count'" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "SubgroupDispatch" ] - }, - { - "opname" : "OpGetKernelMaxNumSubgroups", - "opcode" : 326, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Invoke'" }, - { "kind" : "IdRef", "name" : "'Param'" }, - { "kind" : "IdRef", "name" : "'Param Size'" }, - { "kind" : "IdRef", "name" : "'Param Align'" } - ], - "capabilities" : [ "SubgroupDispatch" ] - }, - { - "opname" : "OpTypeNamedBarrier", - "opcode" : 327, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "NamedBarrier" ] - }, - { - "opname" : "OpNamedBarrierInitialize", - "opcode" : 328, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Subgroup Count'" } - ], - "capabilities" : [ "NamedBarrier" ] - }, - { - "opname" : "OpMemoryNamedBarrier", - "opcode" : 329, - "operands" : [ - { "kind" : "IdRef", "name" : "'Named Barrier'" }, - { "kind" : "IdScope", "name" : "'Memory'" }, - { "kind" : "IdMemorySemantics", "name" : "'Semantics'" } - ], - "capabilities" : [ "NamedBarrier" ] - }, - { - "opname" : "OpModuleProcessed", - "opcode" : 330, - "operands" : [ - { "kind" : "LiteralString", "name" : "'Process'" } - ] - }, - { - "opname" : "OpExecutionModeId", - "opcode" : 331, - "operands" : [ - { "kind" : "IdRef", "name" : "'Entry Point'" }, - { "kind" : "ExecutionMode", "name" : "'Mode'" } - ] - }, - { - "opname" : "OpDecorateId", - "opcode" : 332, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "Decoration" } - ] - }, - { - "opname" : "OpSubgroupBallotKHR", - "opcode" : 4421, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "opname" : "OpSubgroupFirstInvocationKHR", - "opcode" : 4422, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "opname" : "OpSubgroupAllKHR", - "opcode" : 4428, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupVoteKHR" ] - }, - { - "opname" : "OpSubgroupAnyKHR", - "opcode" : 4429, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupVoteKHR" ] - }, - { - "opname" : "OpSubgroupAllEqualKHR", - "opcode" : 4430, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Predicate'" } - ], - "capabilities" : [ "SubgroupVoteKHR" ] - }, - { - "opname" : "OpSubgroupReadInvocationKHR", - "opcode" : 4432, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Value'" }, - { "kind" : "IdRef", "name" : "'Index'" } - ], - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "opname" : "OpGroupIAddNonUniformAMD", - "opcode" : 5000, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFAddNonUniformAMD", - "opcode" : 5001, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMinNonUniformAMD", - "opcode" : 5002, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMinNonUniformAMD", - "opcode" : 5003, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMinNonUniformAMD", - "opcode" : 5004, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupFMaxNonUniformAMD", - "opcode" : 5005, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupUMaxNonUniformAMD", - "opcode" : 5006, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpGroupSMaxNonUniformAMD", - "opcode" : 5007, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdScope", "name" : "'Execution'" }, - { "kind" : "GroupOperation", "name" : "'Operation'" }, - { "kind" : "IdRef", "name" : "'X'" } - ], - "capabilities" : [ "Groups" ] - }, - { - "opname" : "OpFragmentMaskFetchAMD", - "opcode" : 5011, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "FragmentMaskAMD" ] - }, - { - "opname" : "OpFragmentFetchAMD", - "opcode" : 5012, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Fragment Index'" } - ], - "capabilities" : [ "FragmentMaskAMD" ] - }, - { - "opname" : "OpSubgroupShuffleINTEL", - "opcode" : 5571, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Data'" }, - { "kind" : "IdRef", "name" : "'InvocationId'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupShuffleDownINTEL", - "opcode" : 5572, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Current'" }, - { "kind" : "IdRef", "name" : "'Next'" }, - { "kind" : "IdRef", "name" : "'Delta'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupShuffleUpINTEL", - "opcode" : 5573, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Previous'" }, - { "kind" : "IdRef", "name" : "'Current'" }, - { "kind" : "IdRef", "name" : "'Delta'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupShuffleXorINTEL", - "opcode" : 5574, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Data'" }, - { "kind" : "IdRef", "name" : "'Value'" } - ], - "capabilities" : [ "SubgroupShuffleINTEL" ] - }, - { - "opname" : "OpSubgroupBlockReadINTEL", - "opcode" : 5575, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Ptr'" } - ], - "capabilities" : [ "SubgroupBufferBlockIOINTEL" ] - }, - { - "opname" : "OpSubgroupBlockWriteINTEL", - "opcode" : 5576, - "operands" : [ - { "kind" : "IdRef", "name" : "'Ptr'" }, - { "kind" : "IdRef", "name" : "'Data'" } - ], - "capabilities" : [ "SubgroupBufferBlockIOINTEL" ] - }, - { - "opname" : "OpSubgroupImageBlockReadINTEL", - "opcode" : 5577, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" } - ], - "capabilities" : [ "SubgroupImageBlockIOINTEL" ] - }, - { - "opname" : "OpSubgroupImageBlockWriteINTEL", - "opcode" : 5578, - "operands" : [ - { "kind" : "IdRef", "name" : "'Image'" }, - { "kind" : "IdRef", "name" : "'Coordinate'" }, - { "kind" : "IdRef", "name" : "'Data'" } - ], - "capabilities" : [ "SubgroupImageBlockIOINTEL" ] - } - ], - "operand_kinds" : [ - { - "category" : "BitEnum", - "kind" : "ImageOperands", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Bias", - "value" : "0x0001", - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Lod", - "value" : "0x0002", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Grad", - "value" : "0x0004", - "parameters" : [ - { "kind" : "IdRef" }, - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "ConstOffset", - "value" : "0x0008", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Offset", - "value" : "0x0010", - "capabilities" : [ "ImageGatherExtended" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "ConstOffsets", - "value" : "0x0020", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "Sample", - "value" : "0x0040", - "parameters" : [ - { "kind" : "IdRef" } - ] - }, - { - "enumerant" : "MinLod", - "value" : "0x0080", - "capabilities" : [ "MinLod" ], - "parameters" : [ - { "kind" : "IdRef" } - ] - } - ] - }, - { - "category" : "BitEnum", - "kind" : "FPFastMathMode", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "NotNaN", - "value" : "0x0001", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NotInf", - "value" : "0x0002", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NSZ", - "value" : "0x0004", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "AllowRecip", - "value" : "0x0008", - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Fast", - "value" : "0x0010", - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "BitEnum", - "kind" : "SelectionControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Flatten", - "value" : "0x0001" - }, - { - "enumerant" : "DontFlatten", - "value" : "0x0002" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "LoopControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Unroll", - "value" : "0x0001" - }, - { - "enumerant" : "DontUnroll", - "value" : "0x0002" - }, - { - "enumerant" : "DependencyInfinite", - "value" : "0x0004" - }, - { - "enumerant" : "DependencyLength", - "value" : "0x0008", - "parameters" : [ - { "kind" : "LiteralInteger" } - ] - - } - ] - }, - { - "category" : "BitEnum", - "kind" : "FunctionControl", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Inline", - "value" : "0x0001" - }, - { - "enumerant" : "DontInline", - "value" : "0x0002" - }, - { - "enumerant" : "Pure", - "value" : "0x0004" - }, - { - "enumerant" : "Const", - "value" : "0x0008" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "MemorySemantics", - "enumerants" : [ - { - "enumerant" : "Relaxed", - "value" : "0x0000" - }, - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Acquire", - "value" : "0x0002" - }, - { - "enumerant" : "Release", - "value" : "0x0004" - }, - { - "enumerant" : "AcquireRelease", - "value" : "0x0008" - }, - { - "enumerant" : "SequentiallyConsistent", - "value" : "0x0010" - }, - { - "enumerant" : "UniformMemory", - "value" : "0x0040", - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SubgroupMemory", - "value" : "0x0080" - }, - { - "enumerant" : "WorkgroupMemory", - "value" : "0x0100" - }, - { - "enumerant" : "CrossWorkgroupMemory", - "value" : "0x0200" - }, - { - "enumerant" : "AtomicCounterMemory", - "value" : "0x0400", - "capabilities" : [ "AtomicStorage" ] - }, - { - "enumerant" : "ImageMemory", - "value" : "0x0800" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "MemoryAccess", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "Volatile", - "value" : "0x0001" - }, - { - "enumerant" : "Aligned", - "value" : "0x0002", - "parameters" : [ - { "kind" : "LiteralInteger" } - ] - }, - { - "enumerant" : "Nontemporal", - "value" : "0x0004" - } - ] - }, - { - "category" : "BitEnum", - "kind" : "KernelProfilingInfo", - "enumerants" : [ - { - "enumerant" : "None", - "value" : "0x0000" - }, - { - "enumerant" : "CmdExecTime", - "value" : "0x0001", - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SourceLanguage", - "enumerants" : [ - { - "enumerant" : "Unknown", - "value" : 0 - }, - { - "enumerant" : "ESSL", - "value" : 1 - }, - { - "enumerant" : "GLSL", - "value" : 2 - }, - { - "enumerant" : "OpenCL_C", - "value" : 3 - }, - { - "enumerant" : "OpenCL_CPP", - "value" : 4 - }, - { - "enumerant" : "HLSL", - "value" : 5 - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ExecutionModel", - "enumerants" : [ - { - "enumerant" : "Vertex", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "TessellationControl", - "value" : 1, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessellationEvaluation", - "value" : 2, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Geometry", - "value" : 3, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Fragment", - "value" : 4, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLCompute", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Kernel", - "value" : 6, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "AddressingModel", - "enumerants" : [ - { - "enumerant" : "Logical", - "value" : 0 - }, - { - "enumerant" : "Physical32", - "value" : 1, - "capabilities" : [ "Addresses" ] - }, - { - "enumerant" : "Physical64", - "value" : 2, - "capabilities" : [ "Addresses" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "MemoryModel", - "enumerants" : [ - { - "enumerant" : "Simple", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLSL450", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OpenCL", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ExecutionMode", - "enumerants" : [ - { - "enumerant" : "Invocations", - "value" : 0, - "capabilities" : [ "Geometry" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Number of <>'" } - ] - }, - { - "enumerant" : "SpacingEqual", - "value" : 1, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "SpacingFractionalEven", - "value" : 2, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "SpacingFractionalOdd", - "value" : 3, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "VertexOrderCw", - "value" : 4, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "VertexOrderCcw", - "value" : 5, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "PixelCenterInteger", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OriginUpperLeft", - "value" : 7, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "OriginLowerLeft", - "value" : 8, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "EarlyFragmentTests", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointMode", - "value" : 10, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Xfb", - "value" : 11, - "capabilities" : [ "TransformFeedback" ] - }, - { - "enumerant" : "DepthReplacing", - "value" : 12, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthGreater", - "value" : 14, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthLess", - "value" : 15, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DepthUnchanged", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "LocalSize", - "value" : 17, - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'x size'" }, - { "kind" : "LiteralInteger", "name" : "'y size'" }, - { "kind" : "LiteralInteger", "name" : "'z size'" } - ] - }, - { - "enumerant" : "LocalSizeHint", - "value" : 18, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'x size'" }, - { "kind" : "LiteralInteger", "name" : "'y size'" }, - { "kind" : "LiteralInteger", "name" : "'z size'" } - ] - }, - { - "enumerant" : "InputPoints", - "value" : 19, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "InputLines", - "value" : 20, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "InputLinesAdjacency", - "value" : 21, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Triangles", - "value" : 22, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "InputTrianglesAdjacency", - "value" : 23, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "Quads", - "value" : 24, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Isolines", - "value" : 25, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "OutputVertices", - "value" : 26, - "capabilities" : [ "Geometry", "Tessellation" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Vertex count'" } - ] - }, - { - "enumerant" : "OutputPoints", - "value" : 27, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "OutputLineStrip", - "value" : 28, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "OutputTriangleStrip", - "value" : 29, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "VecTypeHint", - "value" : 30, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Vector type'" } - ] - }, - { - "enumerant" : "ContractionOff", - "value" : 31, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Initializer", - "value" : 33, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Finalizer", - "value" : 34, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupSize", - "value" : 35, - "capabilities" : [ "SubgroupDispatch" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Subgroup Size'" } - ] - }, - { - "enumerant" : "SubgroupsPerWorkgroup", - "value" : 36, - "capabilities" : [ "SubgroupDispatch" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Subgroups Per Workgroup'" } - ] - }, - { - "enumerant" : "SubgroupsPerWorkgroupId", - "value" : 37, - "capabilities" : [ "SubgroupDispatch" ], - "parameters" : [ - { "kind" : "IdRef", "name" : "'Subgroups Per Workgroup'" } - ] - }, - { - "enumerant" : "LocalSizeId", - "value" : 38, - "parameters" : [ - { "kind" : "IdRef", "name" : "'x size'" }, - { "kind" : "IdRef", "name" : "'y size'" }, - { "kind" : "IdRef", "name" : "'z size'" } - ] - }, - { - "enumerant" : "LocalSizeHintId", - "value" : 39, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "IdRef", "name" : "'Local Size Hint'" } - ] - }, - { - "enumerant" : "PostDepthCoverage", - "value" : 4446, - "capabilities" : [ "SampleMaskPostDepthCoverage" ] - }, - { - "enumerant" : "StencilRefReplacingEXT", - "value" : 5027, - "capabilities" : [ "StencilExportEXT" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "StorageClass", - "enumerants" : [ - { - "enumerant" : "UniformConstant", - "value" : 0 - }, - { - "enumerant" : "Input", - "value" : 1 - }, - { - "enumerant" : "Uniform", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Output", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Workgroup", - "value" : 4 - }, - { - "enumerant" : "CrossWorkgroup", - "value" : 5 - }, - { - "enumerant" : "Private", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Function", - "value" : 7 - }, - { - "enumerant" : "Generic", - "value" : 8, - "capabilities" : [ "GenericPointer" ] - }, - { - "enumerant" : "PushConstant", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "AtomicCounter", - "value" : 10, - "capabilities" : [ "AtomicStorage" ] - }, - { - "enumerant" : "Image", - "value" : 11 - }, - { - "enumerant" : "StorageBuffer", - "value" : 12, - "extensions" : [ - "SPV_KHR_storage_buffer_storage_class", - "SPV_KHR_variable_pointers" - ], - "capabilities" : [ "Shader" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Dim", - "enumerants" : [ - { - "enumerant" : "1D", - "value" : 0, - "capabilities" : [ "Sampled1D" ] - }, - { - "enumerant" : "2D", - "value" : 1 - }, - { - "enumerant" : "3D", - "value" : 2 - }, - { - "enumerant" : "Cube", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rect", - "value" : 4, - "capabilities" : [ "SampledRect" ] - }, - { - "enumerant" : "Buffer", - "value" : 5, - "capabilities" : [ "SampledBuffer" ] - }, - { - "enumerant" : "SubpassData", - "value" : 6, - "capabilities" : [ "InputAttachment" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SamplerAddressingMode", - "enumerants" : [ - { - "enumerant" : "None", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ClampToEdge", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Clamp", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Repeat", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RepeatMirrored", - "value" : 4, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "SamplerFilterMode", - "enumerants" : [ - { - "enumerant" : "Nearest", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Linear", - "value" : 1, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageFormat", - "enumerants" : [ - { - "enumerant" : "Unknown", - "value" : 0 - }, - { - "enumerant" : "Rgba32f", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16f", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32f", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8", - "value" : 4, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8Snorm", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rg32f", - "value" : 6, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16f", - "value" : 7, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R11fG11fB10f", - "value" : 8, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16f", - "value" : 9, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba16", - "value" : 10, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgb10A2", - "value" : 11, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16", - "value" : 12, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8", - "value" : 13, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16", - "value" : 14, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8", - "value" : 15, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba16Snorm", - "value" : 16, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16Snorm", - "value" : 17, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8Snorm", - "value" : 18, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16Snorm", - "value" : 19, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8Snorm", - "value" : 20, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba32i", - "value" : 21, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16i", - "value" : 22, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8i", - "value" : 23, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32i", - "value" : 24, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rg32i", - "value" : 25, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16i", - "value" : 26, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8i", - "value" : 27, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16i", - "value" : 28, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8i", - "value" : 29, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rgba32ui", - "value" : 30, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba16ui", - "value" : 31, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgba8ui", - "value" : 32, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "R32ui", - "value" : 33, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Rgb10a2ui", - "value" : 34, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg32ui", - "value" : 35, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg16ui", - "value" : 36, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "Rg8ui", - "value" : 37, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R16ui", - "value" : 38, - "capabilities" : [ "StorageImageExtendedFormats" ] - }, - { - "enumerant" : "R8ui", - "value" : 39, - "capabilities" : [ "StorageImageExtendedFormats" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageChannelOrder", - "enumerants" : [ - { - "enumerant" : "R", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "A", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RG", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RA", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGB", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGBA", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "BGRA", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ARGB", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Intensity", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Luminance", - "value" : 9, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Rx", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGx", - "value" : 11, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "RGBx", - "value" : 12, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Depth", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "DepthStencil", - "value" : 14, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGB", - "value" : 15, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGBx", - "value" : 16, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sRGBA", - "value" : 17, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "sBGRA", - "value" : 18, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ABGR", - "value" : 19, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "ImageChannelDataType", - "enumerants" : [ - { - "enumerant" : "SnormInt8", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SnormInt16", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt8", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt16", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormShort565", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormShort555", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt101010", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt8", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt16", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SignedInt32", - "value" : 9, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt8", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt16", - "value" : 11, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnsignedInt32", - "value" : 12, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "HalfFloat", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float", - "value" : 14, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt24", - "value" : 15, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "UnormInt101010_2", - "value" : 16, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "FPRoundingMode", - "enumerants" : [ - { - "enumerant" : "RTE", - "value" : 0, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - }, - { - "enumerant" : "RTZ", - "value" : 1, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - }, - { - "enumerant" : "RTP", - "value" : 2, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - }, - { - "enumerant" : "RTN", - "value" : 3, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "LinkageType", - "enumerants" : [ - { - "enumerant" : "Export", - "value" : 0, - "capabilities" : [ "Linkage" ] - }, - { - "enumerant" : "Import", - "value" : 1, - "capabilities" : [ "Linkage" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "AccessQualifier", - "enumerants" : [ - { - "enumerant" : "ReadOnly", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WriteOnly", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ReadWrite", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "FunctionParameterAttribute", - "enumerants" : [ - { - "enumerant" : "Zext", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Sext", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ByVal", - "value" : 2, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Sret", - "value" : 3, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoAlias", - "value" : 4, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoCapture", - "value" : 5, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoWrite", - "value" : 6, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NoReadWrite", - "value" : 7, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Decoration", - "enumerants" : [ - { - "enumerant" : "RelaxedPrecision", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SpecId", - "value" : 1, - "capabilities" : [ "Shader", "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Specialization Constant ID'" } - ] - }, - { - "enumerant" : "Block", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "BufferBlock", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "RowMajor", - "value" : 4, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "ColMajor", - "value" : 5, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "ArrayStride", - "value" : 6, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Array Stride'" } - ] - }, - { - "enumerant" : "MatrixStride", - "value" : 7, - "capabilities" : [ "Matrix" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Matrix Stride'" } - ] - }, - { - "enumerant" : "GLSLShared", - "value" : 8, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GLSLPacked", - "value" : 9, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "CPacked", - "value" : 10, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "BuiltIn", - "value" : 11, - "parameters" : [ - { "kind" : "BuiltIn" } - ] - }, - { - "enumerant" : "NoPerspective", - "value" : 13, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Flat", - "value" : 14, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Patch", - "value" : 15, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "Centroid", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Sample", - "value" : 17, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "Invariant", - "value" : 18, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Restrict", - "value" : 19 - }, - { - "enumerant" : "Aliased", - "value" : 20 - }, - { - "enumerant" : "Volatile", - "value" : 21 - }, - { - "enumerant" : "Constant", - "value" : 22, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Coherent", - "value" : 23 - }, - { - "enumerant" : "NonWritable", - "value" : 24 - }, - { - "enumerant" : "NonReadable", - "value" : 25 - }, - { - "enumerant" : "Uniform", - "value" : 26, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SaturatedConversion", - "value" : 28, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Stream", - "value" : 29, - "capabilities" : [ "GeometryStreams" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Stream Number'" } - ] - }, - { - "enumerant" : "Location", - "value" : 30, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Location'" } - ] - }, - { - "enumerant" : "Component", - "value" : 31, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Component'" } - ] - }, - { - "enumerant" : "Index", - "value" : 32, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Index'" } - ] - }, - { - "enumerant" : "Binding", - "value" : 33, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Binding Point'" } - ] - }, - { - "enumerant" : "DescriptorSet", - "value" : 34, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Descriptor Set'" } - ] - }, - { - "enumerant" : "Offset", - "value" : 35, - "capabilities" : [ "Shader" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Byte Offset'" } - ] - }, - { - "enumerant" : "XfbBuffer", - "value" : 36, - "capabilities" : [ "TransformFeedback" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'XFB Buffer Number'" } - ] - }, - { - "enumerant" : "XfbStride", - "value" : 37, - "capabilities" : [ "TransformFeedback" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'XFB Stride'" } - ] - }, - { - "enumerant" : "FuncParamAttr", - "value" : 38, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "FunctionParameterAttribute", "name" : "'Function Parameter Attribute'" } - ] - }, - { - "enumerant" : "FPRoundingMode", - "value" : 39, - "capabilities" : [ - "Kernel", - "StorageUniformBufferBlock16", - "StorageUniform16", - "StoragePushConstant16", - "StorageInputOutput16" - ], - "parameters" : [ - { "kind" : "FPRoundingMode", "name" : "'Floating-Point Rounding Mode'" } - ] - }, - { - "enumerant" : "FPFastMathMode", - "value" : 40, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "FPFastMathMode", "name" : "'Fast-Math Mode'" } - ] - }, - { - "enumerant" : "LinkageAttributes", - "value" : 41, - "capabilities" : [ "Linkage" ], - "parameters" : [ - { "kind" : "LiteralString", "name" : "'Name'" }, - { "kind" : "LinkageType", "name" : "'Linkage Type'" } - ] - }, - { - "enumerant" : "NoContraction", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InputAttachmentIndex", - "value" : 43, - "capabilities" : [ "InputAttachment" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Attachment Index'" } - ] - }, - { - "enumerant" : "Alignment", - "value" : 44, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Alignment'" } - ] - }, - { - "enumerant" : "MaxByteOffset", - "value" : 45, - "capabilities" : [ "Addresses" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Max Byte Offset'" } - ] - }, - { - "enumerant" : "AlignmentId", - "value" : 46, - "capabilities" : [ "Kernel" ], - "parameters" : [ - { "kind" : "IdRef", "name" : "'Alignment'" } - ] - }, - { - "enumerant" : "MaxByteOffsetId", - "value" : 47, - "capabilities" : [ "Addresses" ], - "parameters" : [ - { "kind" : "IdRef", "name" : "'Max Byte Offset'" } - ] - }, - { - "enumerant" : "ExplicitInterpAMD", - "value" : 4999 - }, - { - "enumerant" : "OverrideCoverageNV", - "value" : 5248, - "capabilities" : [ "SampleMaskOverrideCoverageNV" ] - }, - { - "enumerant" : "PassthroughNV", - "value" : 5250, - "capabilities" : [ "GeometryShaderPassthroughNV" ] - }, - { - "enumerant" : "ViewportRelativeNV", - "value" : 5252, - "capabilities" : [ "ShaderViewportMaskNV" ] - }, - { - "enumerant" : "SecondaryViewportRelativeNV", - "value" : 5256, - "capabilities" : [ "ShaderStereoViewNV" ], - "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Offset'" } - ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "BuiltIn", - "enumerants" : [ - { - "enumerant" : "Position", - "value" : 0, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointSize", - "value" : 1, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ClipDistance", - "value" : 3, - "capabilities" : [ "ClipDistance" ] - }, - { - "enumerant" : "CullDistance", - "value" : 4, - "capabilities" : [ "CullDistance" ] - }, - { - "enumerant" : "VertexId", - "value" : 5, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InstanceId", - "value" : 6, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PrimitiveId", - "value" : 7, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "InvocationId", - "value" : 8, - "capabilities" : [ "Geometry", "Tessellation" ] - }, - { - "enumerant" : "Layer", - "value" : 9, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "ViewportIndex", - "value" : 10, - "capabilities" : [ "MultiViewport" ] - }, - { - "enumerant" : "TessLevelOuter", - "value" : 11, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessLevelInner", - "value" : 12, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "TessCoord", - "value" : 13, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "PatchVertices", - "value" : 14, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "FragCoord", - "value" : 15, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "PointCoord", - "value" : 16, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "FrontFacing", - "value" : 17, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampleId", - "value" : 18, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "SamplePosition", - "value" : 19, - "capabilities" : [ "SampleRateShading" ] - }, - { - "enumerant" : "SampleMask", - "value" : 20, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "FragDepth", - "value" : 22, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "HelperInvocation", - "value" : 23, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "NumWorkgroups", - "value" : 24 - }, - { - "enumerant" : "WorkgroupSize", - "value" : 25 - }, - { - "enumerant" : "WorkgroupId", - "value" : 26 - }, - { - "enumerant" : "LocalInvocationId", - "value" : 27 - }, - { - "enumerant" : "GlobalInvocationId", - "value" : 28 - }, - { - "enumerant" : "LocalInvocationIndex", - "value" : 29 - }, - { - "enumerant" : "WorkDim", - "value" : 30, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalSize", - "value" : 31, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "EnqueuedWorkgroupSize", - "value" : 32, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalOffset", - "value" : 33, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "GlobalLinearId", - "value" : 34, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupSize", - "value" : 36, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupMaxSize", - "value" : 37, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NumSubgroups", - "value" : 38, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "NumEnqueuedSubgroups", - "value" : 39, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupId", - "value" : 40, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "SubgroupLocalInvocationId", - "value" : 41, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "VertexIndex", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InstanceIndex", - "value" : 43, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SubgroupEqMaskKHR", - "value" : 4416, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupGeMaskKHR", - "value" : 4417, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupGtMaskKHR", - "value" : 4418, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupLeMaskKHR", - "value" : 4419, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "SubgroupLtMaskKHR", - "value" : 4420, - "capabilities" : [ "SubgroupBallotKHR" ] - }, - { - "enumerant" : "BaseVertex", - "value" : 4424, - "capabilities" : [ "DrawParameters" ] - }, - { - "enumerant" : "BaseInstance", - "value" : 4425, - "capabilities" : [ "DrawParameters" ] - }, - { - "enumerant" : "DrawIndex", - "value" : 4426, - "capabilities" : [ "DrawParameters" ] - }, - { - "enumerant" : "DeviceIndex", - "value" : 4438, - "capabilities" : [ "DeviceGroup" ] - }, - { - "enumerant" : "ViewIndex", - "value" : 4440, - "capabilities" : [ "MultiView" ] - }, - { - "enumerant" : "BaryCoordNoPerspAMD", - "value" : 4992 - }, - { - "enumerant" : "BaryCoordNoPerspCentroidAMD", - "value" : 4993 - }, - { - "enumerant" : "BaryCoordNoPerspSampleAMD", - "value" : 4994 - }, - { - "enumerant" : "BaryCoordSmoothAMD", - "value" : 4995 - }, - { - "enumerant" : "BaryCoordSmoothCentroidAMD", - "value" : 4996 - }, - { - "enumerant" : "BaryCoordSmoothSampleAMD", - "value" : 4997 - }, - { - "enumerant" : "BaryCoordPullModelAMD", - "value" : 4998 - }, - { - "enumerant" : "FragStencilRefEXT", - "value" : 5014, - "capabilities" : [ "StencilExportEXT" ] - }, - { - "enumerant" : "ViewportMaskNV", - "value" : 5253, - "capabilities" : [ "ShaderViewportMaskNV" ] - }, - { - "enumerant" : "SecondaryPositionNV", - "value" : 5257, - "capabilities" : [ "ShaderStereoViewNV" ] - }, - { - "enumerant" : "SecondaryViewportMaskNV", - "value" : 5258, - "capabilities" : [ "ShaderStereoViewNV" ] - }, - { - "enumerant" : "PositionPerViewNV", - "value" : 5261, - "capabilities" : [ "PerViewAttributesNV" ] - }, - { - "enumerant" : "ViewportMaskPerViewNV", - "value" : 5262, - "capabilities" : [ "PerViewAttributesNV" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Scope", - "enumerants" : [ - { - "enumerant" : "CrossDevice", - "value" : 0 - }, - { - "enumerant" : "Device", - "value" : 1 - }, - { - "enumerant" : "Workgroup", - "value" : 2 - }, - { - "enumerant" : "Subgroup", - "value" : 3 - }, - { - "enumerant" : "Invocation", - "value" : 4 - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "GroupOperation", - "enumerants" : [ - { - "enumerant" : "Reduce", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "InclusiveScan", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ExclusiveScan", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "KernelEnqueueFlags", - "enumerants" : [ - { - "enumerant" : "NoWait", - "value" : 0, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WaitKernel", - "value" : 1, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "WaitWorkGroup", - "value" : 2, - "capabilities" : [ "Kernel" ] - } - ] - }, - { - "category" : "ValueEnum", - "kind" : "Capability", - "enumerants" : [ - { - "enumerant" : "Matrix", - "value" : 0 - }, - { - "enumerant" : "Shader", - "value" : 1, - "capabilities" : [ "Matrix" ] - }, - { - "enumerant" : "Geometry", - "value" : 2, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Tessellation", - "value" : 3, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Addresses", - "value" : 4 - }, - { - "enumerant" : "Linkage", - "value" : 5 - }, - { - "enumerant" : "Kernel", - "value" : 6 - }, - { - "enumerant" : "Vector16", - "value" : 7, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float16Buffer", - "value" : 8, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Float16", - "value" : 9 - }, - { - "enumerant" : "Float64", - "value" : 10 - }, - { - "enumerant" : "Int64", - "value" : 11 - }, - { - "enumerant" : "Int64Atomics", - "value" : 12, - "capabilities" : [ "Int64" ] - }, - { - "enumerant" : "ImageBasic", - "value" : 13, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "ImageReadWrite", - "value" : 14, - "capabilities" : [ "ImageBasic" ] - }, - { - "enumerant" : "ImageMipmap", - "value" : 15, - "capabilities" : [ "ImageBasic" ] - }, - { - "enumerant" : "Pipes", - "value" : 17, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "Groups", - "value" : 18 - }, - { - "enumerant" : "DeviceEnqueue", - "value" : 19, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "LiteralSampler", - "value" : 20, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "AtomicStorage", - "value" : 21, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Int16", - "value" : 22 - }, - { - "enumerant" : "TessellationPointSize", - "value" : 23, - "capabilities" : [ "Tessellation" ] - }, - { - "enumerant" : "GeometryPointSize", - "value" : 24, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "ImageGatherExtended", - "value" : 25, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageMultisample", - "value" : 27, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "UniformBufferArrayDynamicIndexing", - "value" : 28, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampledImageArrayDynamicIndexing", - "value" : 29, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageBufferArrayDynamicIndexing", - "value" : 30, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageArrayDynamicIndexing", - "value" : 31, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ClipDistance", - "value" : 32, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "CullDistance", - "value" : 33, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageCubeArray", - "value" : 34, - "capabilities" : [ "SampledCubeArray" ] - }, - { - "enumerant" : "SampleRateShading", - "value" : 35, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageRect", - "value" : 36, - "capabilities" : [ "SampledRect" ] - }, - { - "enumerant" : "SampledRect", - "value" : 37, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GenericPointer", - "value" : 38, - "capabilities" : [ "Addresses" ] - }, - { - "enumerant" : "Int8", - "value" : 39, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "InputAttachment", - "value" : 40, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SparseResidency", - "value" : 41, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "MinLod", - "value" : 42, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "Sampled1D", - "value" : 43 - }, - { - "enumerant" : "Image1D", - "value" : 44, - "capabilities" : [ "Sampled1D" ] - }, - { - "enumerant" : "SampledCubeArray", - "value" : 45, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "SampledBuffer", - "value" : 46 - }, - { - "enumerant" : "ImageBuffer", - "value" : 47, - "capabilities" : [ "SampledBuffer" ] - }, - { - "enumerant" : "ImageMSArray", - "value" : 48, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageExtendedFormats", - "value" : 49, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "ImageQuery", - "value" : 50, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "DerivativeControl", - "value" : 51, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "InterpolationFunction", - "value" : 52, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "TransformFeedback", - "value" : 53, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "GeometryStreams", - "value" : 54, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "StorageImageReadWithoutFormat", - "value" : 55, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "StorageImageWriteWithoutFormat", - "value" : 56, - "capabilities" : [ "Shader" ] - }, - { - "enumerant" : "MultiViewport", - "value" : 57, - "capabilities" : [ "Geometry" ] - }, - { - "enumerant" : "SubgroupDispatch", - "value" : 58, - "capabilities" : [ "DeviceEnqueue" ] - }, - { - "enumerant" : "NamedBarrier", - "value" : 59, - "capabilities" : [ "Kernel" ] - }, - { - "enumerant" : "PipeStorage", - "value" : 60, - "capabilities" : [ "Pipes" ] - }, - { - "enumerant" : "SubgroupBallotKHR", - "value" : 4423, - "extensions" : [ "SPV_KHR_shader_ballot" ] - }, - { - "enumerant" : "DrawParameters", - "value" : 4427, - "extensions" : [ "SPV_KHR_shader_draw_parameters" ] - }, - { - "enumerant" : "SubgroupVoteKHR", - "value" : 4431, - "extensions" : [ "SPV_KHR_subgroup_vote" ] - }, - { - "enumerant" : "StorageBuffer16BitAccess", - "value" : 4433, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StorageUniformBufferBlock16", - "value" : 4433, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "UniformAndStorageBuffer16BitAccess", - "value" : 4434, - "capabilities" : [ - "StorageBuffer16BitAccess", - "StorageUniformBufferBlock16" - ], - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StorageUniform16", - "value" : 4434, - "capabilities" : [ - "StorageBuffer16BitAccess", - "StorageUniformBufferBlock16" - ], - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StoragePushConstant16", - "value" : 4435, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "StorageInputOutput16", - "value" : 4436, - "extensions" : [ "SPV_KHR_16bit_storage" ] - }, - { - "enumerant" : "DeviceGroup", - "value" : 4437, - "extensions" : [ "SPV_KHR_device_group" ] - }, - { - "enumerant" : "MultiView", - "value" : 4439, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_multiview" ] - }, - { - "enumerant" : "VariablePointersStorageBuffer", - "value" : 4441, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_KHR_variable_pointers" ] - }, - { - "enumerant" : "VariablePointers", - "value" : 4442, - "capabilities" : [ "VariablePointersStorageBuffer" ], - "extensions" : [ "SPV_KHR_variable_pointers" ] - }, - { - "enumerant": "AtomicStorageOps", - "value": 4445, - "extensions": [ "SPV_KHR_shader_atomic_counter_ops" ] - }, - { - "enumerant" : "SampleMaskPostDepthCoverage", - "value" : 4447, - "extensions" : [ "SPV_KHR_post_depth_coverage" ] - }, - { - "enumerant" : "ImageGatherBiasLodAMD", - "value" : 5009, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_texture_gather_bias_lod" ] - }, - { - "enumerant" : "FragmentMaskAMD", - "value" : 5010, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_shader_fragment_mask" ] - }, - { - "enumerant" : "StencilExportEXT", - "value" : 5013, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_shader_stencil_export" ] - }, - { - "enumerant" : "ImageReadWriteLodAMD", - "value" : 5015, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_AMD_shader_image_load_store_lod" ] - }, - { - "enumerant" : "SampleMaskOverrideCoverageNV", - "value" : 5249, - "capabilities" : [ "SampleRateShading" ], - "extensions" : [ "SPV_NV_sample_mask_override_coverage" ] - }, - { - "enumerant" : "GeometryShaderPassthroughNV", - "value" : 5251, - "capabilities" : [ "Geometry" ], - "extensions" : [ "SPV_NV_geometry_shader_passthrough" ] - }, - { - "enumerant" : "ShaderViewportIndexLayerEXT", - "value" : 5254, - "capabilities" : [ "MultiViewport" ], - "extensions" : [ "SPV_EXT_shader_viewport_index_layer" ] - }, - { - "enumerant" : "ShaderViewportIndexLayerNV", - "value" : 5254, - "capabilities" : [ "MultiViewport" ], - "extensions" : [ "SPV_NV_viewport_array2" ] - }, - { - "enumerant" : "ShaderViewportMaskNV", - "value" : 5255, - "capabilities" : [ "ShaderViewportIndexLayerNV" ], - "extensions" : [ "SPV_NV_viewport_array2" ] - }, - { - "enumerant" : "ShaderStereoViewNV", - "value" : 5259, - "capabilities" : [ "ShaderViewportMaskNV" ], - "extensions" : [ "SPV_NV_stereo_view_rendering" ] - }, - { - "enumerant" : "PerViewAttributesNV", - "value" : 5260, - "capabilities" : [ "MultiView" ], - "extensions" : [ "SPV_NVX_multiview_per_view_attributes" ] - }, - { - "enumerant" : "SubgroupShuffleINTEL", - "value" : 5568, - "extensions" : [ "SPV_INTEL_subgroups" ] - }, - { - "enumerant" : "SubgroupBufferBlockIOINTEL", - "value" : 5569, - "extensions" : [ "SPV_INTEL_subgroups" ] - }, - { - "enumerant" : "SubgroupImageBlockIOINTEL", - "value" : 5570, - "extensions" : [ "SPV_INTEL_subgroups" ] - } - ] - }, - { - "category" : "Id", - "kind" : "IdResultType", - "doc" : "Reference to an representing the result's type of the enclosing instruction" - }, - { - "category" : "Id", - "kind" : "IdResult", - "doc" : "Definition of an representing the result of the enclosing instruction" - }, - { - "category" : "Id", - "kind" : "IdMemorySemantics", - "doc" : "Reference to an representing a 32-bit integer that is a mask from the MemorySemantics operand kind" - }, - { - "category" : "Id", - "kind" : "IdScope", - "doc" : "Reference to an representing a 32-bit integer that is a mask from the Scope operand kind" - }, - { - "category" : "Id", - "kind" : "IdRef", - "doc" : "Reference to an " - }, - { - "category" : "Literal", - "kind" : "LiteralInteger", - "doc" : "An integer consuming one or more words" - }, - { - "category" : "Literal", - "kind" : "LiteralString", - "doc" : "A null-terminated stream of characters consuming an integral number of words" - }, - { - "category" : "Literal", - "kind" : "LiteralContextDependentNumber", - "doc" : "A literal number whose size and format are determined by a previous operand in the enclosing instruction" - }, - { - "category" : "Literal", - "kind" : "LiteralExtInstInteger", - "doc" : "A 32-bit unsigned integer indicating which instruction to use and determining the layout of following operands (for OpExtInst)" - }, - { - "category" : "Literal", - "kind" : "LiteralSpecConstantOpInteger", - "doc" : "An opcode indicating the operation to be performed and determining the layout of following operands (for OpSpecConstantOp)" - }, - { - "category" : "Composite", - "kind" : "PairLiteralIntegerIdRef", - "bases" : [ "LiteralInteger", "IdRef" ] - }, - { - "category" : "Composite", - "kind" : "PairIdRefLiteralInteger", - "bases" : [ "IdRef", "LiteralInteger" ] - }, - { - "category" : "Composite", - "kind" : "PairIdRefIdRef", - "bases" : [ "IdRef", "IdRef" ] - } - ] -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.h vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,1017 +0,0 @@ -/* -** Copyright (c) 2014-2017 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and/or associated documentation files (the "Materials"), -** to deal in the Materials without restriction, including without limitation -** the rights to use, copy, modify, merge, publish, distribute, sublicense, -** and/or sell copies of the Materials, and to permit persons to whom the -** Materials are furnished to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in -** all copies or substantial portions of the Materials. -** -** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -** IN THE MATERIALS. -*/ - -/* -** This header is automatically generated by the same tool that creates -** the Binary Section of the SPIR-V specification. -*/ - -/* -** Enumeration tokens for SPIR-V, in various styles: -** C, C++, C++11, JSON, Lua, Python -** -** - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -** - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -** - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -** - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -** - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -** -** Some tokens act like mask values, which can be OR'd together, -** while others are mutually exclusive. The mask-like ones have -** "Mask" in their name, and a parallel enum that has the shift -** amount (1 << x) for each corresponding enumerant. -*/ - -#ifndef spirv_H -#define spirv_H - -typedef unsigned int SpvId; - -#define SPV_VERSION 0x10200 -#define SPV_REVISION 2 - -static const unsigned int SpvMagicNumber = 0x07230203; -static const unsigned int SpvVersion = 0x00010200; -static const unsigned int SpvRevision = 2; -static const unsigned int SpvOpCodeMask = 0xffff; -static const unsigned int SpvWordCountShift = 16; - -typedef enum SpvSourceLanguage_ { - SpvSourceLanguageUnknown = 0, - SpvSourceLanguageESSL = 1, - SpvSourceLanguageGLSL = 2, - SpvSourceLanguageOpenCL_C = 3, - SpvSourceLanguageOpenCL_CPP = 4, - SpvSourceLanguageHLSL = 5, - SpvSourceLanguageMax = 0x7fffffff, -} SpvSourceLanguage; - -typedef enum SpvExecutionModel_ { - SpvExecutionModelVertex = 0, - SpvExecutionModelTessellationControl = 1, - SpvExecutionModelTessellationEvaluation = 2, - SpvExecutionModelGeometry = 3, - SpvExecutionModelFragment = 4, - SpvExecutionModelGLCompute = 5, - SpvExecutionModelKernel = 6, - SpvExecutionModelMax = 0x7fffffff, -} SpvExecutionModel; - -typedef enum SpvAddressingModel_ { - SpvAddressingModelLogical = 0, - SpvAddressingModelPhysical32 = 1, - SpvAddressingModelPhysical64 = 2, - SpvAddressingModelMax = 0x7fffffff, -} SpvAddressingModel; - -typedef enum SpvMemoryModel_ { - SpvMemoryModelSimple = 0, - SpvMemoryModelGLSL450 = 1, - SpvMemoryModelOpenCL = 2, - SpvMemoryModelMax = 0x7fffffff, -} SpvMemoryModel; - -typedef enum SpvExecutionMode_ { - SpvExecutionModeInvocations = 0, - SpvExecutionModeSpacingEqual = 1, - SpvExecutionModeSpacingFractionalEven = 2, - SpvExecutionModeSpacingFractionalOdd = 3, - SpvExecutionModeVertexOrderCw = 4, - SpvExecutionModeVertexOrderCcw = 5, - SpvExecutionModePixelCenterInteger = 6, - SpvExecutionModeOriginUpperLeft = 7, - SpvExecutionModeOriginLowerLeft = 8, - SpvExecutionModeEarlyFragmentTests = 9, - SpvExecutionModePointMode = 10, - SpvExecutionModeXfb = 11, - SpvExecutionModeDepthReplacing = 12, - SpvExecutionModeDepthGreater = 14, - SpvExecutionModeDepthLess = 15, - SpvExecutionModeDepthUnchanged = 16, - SpvExecutionModeLocalSize = 17, - SpvExecutionModeLocalSizeHint = 18, - SpvExecutionModeInputPoints = 19, - SpvExecutionModeInputLines = 20, - SpvExecutionModeInputLinesAdjacency = 21, - SpvExecutionModeTriangles = 22, - SpvExecutionModeInputTrianglesAdjacency = 23, - SpvExecutionModeQuads = 24, - SpvExecutionModeIsolines = 25, - SpvExecutionModeOutputVertices = 26, - SpvExecutionModeOutputPoints = 27, - SpvExecutionModeOutputLineStrip = 28, - SpvExecutionModeOutputTriangleStrip = 29, - SpvExecutionModeVecTypeHint = 30, - SpvExecutionModeContractionOff = 31, - SpvExecutionModeInitializer = 33, - SpvExecutionModeFinalizer = 34, - SpvExecutionModeSubgroupSize = 35, - SpvExecutionModeSubgroupsPerWorkgroup = 36, - SpvExecutionModeSubgroupsPerWorkgroupId = 37, - SpvExecutionModeLocalSizeId = 38, - SpvExecutionModeLocalSizeHintId = 39, - SpvExecutionModePostDepthCoverage = 4446, - SpvExecutionModeStencilRefReplacingEXT = 5027, - SpvExecutionModeMax = 0x7fffffff, -} SpvExecutionMode; - -typedef enum SpvStorageClass_ { - SpvStorageClassUniformConstant = 0, - SpvStorageClassInput = 1, - SpvStorageClassUniform = 2, - SpvStorageClassOutput = 3, - SpvStorageClassWorkgroup = 4, - SpvStorageClassCrossWorkgroup = 5, - SpvStorageClassPrivate = 6, - SpvStorageClassFunction = 7, - SpvStorageClassGeneric = 8, - SpvStorageClassPushConstant = 9, - SpvStorageClassAtomicCounter = 10, - SpvStorageClassImage = 11, - SpvStorageClassStorageBuffer = 12, - SpvStorageClassMax = 0x7fffffff, -} SpvStorageClass; - -typedef enum SpvDim_ { - SpvDim1D = 0, - SpvDim2D = 1, - SpvDim3D = 2, - SpvDimCube = 3, - SpvDimRect = 4, - SpvDimBuffer = 5, - SpvDimSubpassData = 6, - SpvDimMax = 0x7fffffff, -} SpvDim; - -typedef enum SpvSamplerAddressingMode_ { - SpvSamplerAddressingModeNone = 0, - SpvSamplerAddressingModeClampToEdge = 1, - SpvSamplerAddressingModeClamp = 2, - SpvSamplerAddressingModeRepeat = 3, - SpvSamplerAddressingModeRepeatMirrored = 4, - SpvSamplerAddressingModeMax = 0x7fffffff, -} SpvSamplerAddressingMode; - -typedef enum SpvSamplerFilterMode_ { - SpvSamplerFilterModeNearest = 0, - SpvSamplerFilterModeLinear = 1, - SpvSamplerFilterModeMax = 0x7fffffff, -} SpvSamplerFilterMode; - -typedef enum SpvImageFormat_ { - SpvImageFormatUnknown = 0, - SpvImageFormatRgba32f = 1, - SpvImageFormatRgba16f = 2, - SpvImageFormatR32f = 3, - SpvImageFormatRgba8 = 4, - SpvImageFormatRgba8Snorm = 5, - SpvImageFormatRg32f = 6, - SpvImageFormatRg16f = 7, - SpvImageFormatR11fG11fB10f = 8, - SpvImageFormatR16f = 9, - SpvImageFormatRgba16 = 10, - SpvImageFormatRgb10A2 = 11, - SpvImageFormatRg16 = 12, - SpvImageFormatRg8 = 13, - SpvImageFormatR16 = 14, - SpvImageFormatR8 = 15, - SpvImageFormatRgba16Snorm = 16, - SpvImageFormatRg16Snorm = 17, - SpvImageFormatRg8Snorm = 18, - SpvImageFormatR16Snorm = 19, - SpvImageFormatR8Snorm = 20, - SpvImageFormatRgba32i = 21, - SpvImageFormatRgba16i = 22, - SpvImageFormatRgba8i = 23, - SpvImageFormatR32i = 24, - SpvImageFormatRg32i = 25, - SpvImageFormatRg16i = 26, - SpvImageFormatRg8i = 27, - SpvImageFormatR16i = 28, - SpvImageFormatR8i = 29, - SpvImageFormatRgba32ui = 30, - SpvImageFormatRgba16ui = 31, - SpvImageFormatRgba8ui = 32, - SpvImageFormatR32ui = 33, - SpvImageFormatRgb10a2ui = 34, - SpvImageFormatRg32ui = 35, - SpvImageFormatRg16ui = 36, - SpvImageFormatRg8ui = 37, - SpvImageFormatR16ui = 38, - SpvImageFormatR8ui = 39, - SpvImageFormatMax = 0x7fffffff, -} SpvImageFormat; - -typedef enum SpvImageChannelOrder_ { - SpvImageChannelOrderR = 0, - SpvImageChannelOrderA = 1, - SpvImageChannelOrderRG = 2, - SpvImageChannelOrderRA = 3, - SpvImageChannelOrderRGB = 4, - SpvImageChannelOrderRGBA = 5, - SpvImageChannelOrderBGRA = 6, - SpvImageChannelOrderARGB = 7, - SpvImageChannelOrderIntensity = 8, - SpvImageChannelOrderLuminance = 9, - SpvImageChannelOrderRx = 10, - SpvImageChannelOrderRGx = 11, - SpvImageChannelOrderRGBx = 12, - SpvImageChannelOrderDepth = 13, - SpvImageChannelOrderDepthStencil = 14, - SpvImageChannelOrdersRGB = 15, - SpvImageChannelOrdersRGBx = 16, - SpvImageChannelOrdersRGBA = 17, - SpvImageChannelOrdersBGRA = 18, - SpvImageChannelOrderABGR = 19, - SpvImageChannelOrderMax = 0x7fffffff, -} SpvImageChannelOrder; - -typedef enum SpvImageChannelDataType_ { - SpvImageChannelDataTypeSnormInt8 = 0, - SpvImageChannelDataTypeSnormInt16 = 1, - SpvImageChannelDataTypeUnormInt8 = 2, - SpvImageChannelDataTypeUnormInt16 = 3, - SpvImageChannelDataTypeUnormShort565 = 4, - SpvImageChannelDataTypeUnormShort555 = 5, - SpvImageChannelDataTypeUnormInt101010 = 6, - SpvImageChannelDataTypeSignedInt8 = 7, - SpvImageChannelDataTypeSignedInt16 = 8, - SpvImageChannelDataTypeSignedInt32 = 9, - SpvImageChannelDataTypeUnsignedInt8 = 10, - SpvImageChannelDataTypeUnsignedInt16 = 11, - SpvImageChannelDataTypeUnsignedInt32 = 12, - SpvImageChannelDataTypeHalfFloat = 13, - SpvImageChannelDataTypeFloat = 14, - SpvImageChannelDataTypeUnormInt24 = 15, - SpvImageChannelDataTypeUnormInt101010_2 = 16, - SpvImageChannelDataTypeMax = 0x7fffffff, -} SpvImageChannelDataType; - -typedef enum SpvImageOperandsShift_ { - SpvImageOperandsBiasShift = 0, - SpvImageOperandsLodShift = 1, - SpvImageOperandsGradShift = 2, - SpvImageOperandsConstOffsetShift = 3, - SpvImageOperandsOffsetShift = 4, - SpvImageOperandsConstOffsetsShift = 5, - SpvImageOperandsSampleShift = 6, - SpvImageOperandsMinLodShift = 7, - SpvImageOperandsMax = 0x7fffffff, -} SpvImageOperandsShift; - -typedef enum SpvImageOperandsMask_ { - SpvImageOperandsMaskNone = 0, - SpvImageOperandsBiasMask = 0x00000001, - SpvImageOperandsLodMask = 0x00000002, - SpvImageOperandsGradMask = 0x00000004, - SpvImageOperandsConstOffsetMask = 0x00000008, - SpvImageOperandsOffsetMask = 0x00000010, - SpvImageOperandsConstOffsetsMask = 0x00000020, - SpvImageOperandsSampleMask = 0x00000040, - SpvImageOperandsMinLodMask = 0x00000080, -} SpvImageOperandsMask; - -typedef enum SpvFPFastMathModeShift_ { - SpvFPFastMathModeNotNaNShift = 0, - SpvFPFastMathModeNotInfShift = 1, - SpvFPFastMathModeNSZShift = 2, - SpvFPFastMathModeAllowRecipShift = 3, - SpvFPFastMathModeFastShift = 4, - SpvFPFastMathModeMax = 0x7fffffff, -} SpvFPFastMathModeShift; - -typedef enum SpvFPFastMathModeMask_ { - SpvFPFastMathModeMaskNone = 0, - SpvFPFastMathModeNotNaNMask = 0x00000001, - SpvFPFastMathModeNotInfMask = 0x00000002, - SpvFPFastMathModeNSZMask = 0x00000004, - SpvFPFastMathModeAllowRecipMask = 0x00000008, - SpvFPFastMathModeFastMask = 0x00000010, -} SpvFPFastMathModeMask; - -typedef enum SpvFPRoundingMode_ { - SpvFPRoundingModeRTE = 0, - SpvFPRoundingModeRTZ = 1, - SpvFPRoundingModeRTP = 2, - SpvFPRoundingModeRTN = 3, - SpvFPRoundingModeMax = 0x7fffffff, -} SpvFPRoundingMode; - -typedef enum SpvLinkageType_ { - SpvLinkageTypeExport = 0, - SpvLinkageTypeImport = 1, - SpvLinkageTypeMax = 0x7fffffff, -} SpvLinkageType; - -typedef enum SpvAccessQualifier_ { - SpvAccessQualifierReadOnly = 0, - SpvAccessQualifierWriteOnly = 1, - SpvAccessQualifierReadWrite = 2, - SpvAccessQualifierMax = 0x7fffffff, -} SpvAccessQualifier; - -typedef enum SpvFunctionParameterAttribute_ { - SpvFunctionParameterAttributeZext = 0, - SpvFunctionParameterAttributeSext = 1, - SpvFunctionParameterAttributeByVal = 2, - SpvFunctionParameterAttributeSret = 3, - SpvFunctionParameterAttributeNoAlias = 4, - SpvFunctionParameterAttributeNoCapture = 5, - SpvFunctionParameterAttributeNoWrite = 6, - SpvFunctionParameterAttributeNoReadWrite = 7, - SpvFunctionParameterAttributeMax = 0x7fffffff, -} SpvFunctionParameterAttribute; - -typedef enum SpvDecoration_ { - SpvDecorationRelaxedPrecision = 0, - SpvDecorationSpecId = 1, - SpvDecorationBlock = 2, - SpvDecorationBufferBlock = 3, - SpvDecorationRowMajor = 4, - SpvDecorationColMajor = 5, - SpvDecorationArrayStride = 6, - SpvDecorationMatrixStride = 7, - SpvDecorationGLSLShared = 8, - SpvDecorationGLSLPacked = 9, - SpvDecorationCPacked = 10, - SpvDecorationBuiltIn = 11, - SpvDecorationNoPerspective = 13, - SpvDecorationFlat = 14, - SpvDecorationPatch = 15, - SpvDecorationCentroid = 16, - SpvDecorationSample = 17, - SpvDecorationInvariant = 18, - SpvDecorationRestrict = 19, - SpvDecorationAliased = 20, - SpvDecorationVolatile = 21, - SpvDecorationConstant = 22, - SpvDecorationCoherent = 23, - SpvDecorationNonWritable = 24, - SpvDecorationNonReadable = 25, - SpvDecorationUniform = 26, - SpvDecorationSaturatedConversion = 28, - SpvDecorationStream = 29, - SpvDecorationLocation = 30, - SpvDecorationComponent = 31, - SpvDecorationIndex = 32, - SpvDecorationBinding = 33, - SpvDecorationDescriptorSet = 34, - SpvDecorationOffset = 35, - SpvDecorationXfbBuffer = 36, - SpvDecorationXfbStride = 37, - SpvDecorationFuncParamAttr = 38, - SpvDecorationFPRoundingMode = 39, - SpvDecorationFPFastMathMode = 40, - SpvDecorationLinkageAttributes = 41, - SpvDecorationNoContraction = 42, - SpvDecorationInputAttachmentIndex = 43, - SpvDecorationAlignment = 44, - SpvDecorationMaxByteOffset = 45, - SpvDecorationAlignmentId = 46, - SpvDecorationMaxByteOffsetId = 47, - SpvDecorationExplicitInterpAMD = 4999, - SpvDecorationOverrideCoverageNV = 5248, - SpvDecorationPassthroughNV = 5250, - SpvDecorationViewportRelativeNV = 5252, - SpvDecorationSecondaryViewportRelativeNV = 5256, - SpvDecorationMax = 0x7fffffff, -} SpvDecoration; - -typedef enum SpvBuiltIn_ { - SpvBuiltInPosition = 0, - SpvBuiltInPointSize = 1, - SpvBuiltInClipDistance = 3, - SpvBuiltInCullDistance = 4, - SpvBuiltInVertexId = 5, - SpvBuiltInInstanceId = 6, - SpvBuiltInPrimitiveId = 7, - SpvBuiltInInvocationId = 8, - SpvBuiltInLayer = 9, - SpvBuiltInViewportIndex = 10, - SpvBuiltInTessLevelOuter = 11, - SpvBuiltInTessLevelInner = 12, - SpvBuiltInTessCoord = 13, - SpvBuiltInPatchVertices = 14, - SpvBuiltInFragCoord = 15, - SpvBuiltInPointCoord = 16, - SpvBuiltInFrontFacing = 17, - SpvBuiltInSampleId = 18, - SpvBuiltInSamplePosition = 19, - SpvBuiltInSampleMask = 20, - SpvBuiltInFragDepth = 22, - SpvBuiltInHelperInvocation = 23, - SpvBuiltInNumWorkgroups = 24, - SpvBuiltInWorkgroupSize = 25, - SpvBuiltInWorkgroupId = 26, - SpvBuiltInLocalInvocationId = 27, - SpvBuiltInGlobalInvocationId = 28, - SpvBuiltInLocalInvocationIndex = 29, - SpvBuiltInWorkDim = 30, - SpvBuiltInGlobalSize = 31, - SpvBuiltInEnqueuedWorkgroupSize = 32, - SpvBuiltInGlobalOffset = 33, - SpvBuiltInGlobalLinearId = 34, - SpvBuiltInSubgroupSize = 36, - SpvBuiltInSubgroupMaxSize = 37, - SpvBuiltInNumSubgroups = 38, - SpvBuiltInNumEnqueuedSubgroups = 39, - SpvBuiltInSubgroupId = 40, - SpvBuiltInSubgroupLocalInvocationId = 41, - SpvBuiltInVertexIndex = 42, - SpvBuiltInInstanceIndex = 43, - SpvBuiltInSubgroupEqMaskKHR = 4416, - SpvBuiltInSubgroupGeMaskKHR = 4417, - SpvBuiltInSubgroupGtMaskKHR = 4418, - SpvBuiltInSubgroupLeMaskKHR = 4419, - SpvBuiltInSubgroupLtMaskKHR = 4420, - SpvBuiltInBaseVertex = 4424, - SpvBuiltInBaseInstance = 4425, - SpvBuiltInDrawIndex = 4426, - SpvBuiltInDeviceIndex = 4438, - SpvBuiltInViewIndex = 4440, - SpvBuiltInBaryCoordNoPerspAMD = 4992, - SpvBuiltInBaryCoordNoPerspCentroidAMD = 4993, - SpvBuiltInBaryCoordNoPerspSampleAMD = 4994, - SpvBuiltInBaryCoordSmoothAMD = 4995, - SpvBuiltInBaryCoordSmoothCentroidAMD = 4996, - SpvBuiltInBaryCoordSmoothSampleAMD = 4997, - SpvBuiltInBaryCoordPullModelAMD = 4998, - SpvBuiltInFragStencilRefEXT = 5014, - SpvBuiltInViewportMaskNV = 5253, - SpvBuiltInSecondaryPositionNV = 5257, - SpvBuiltInSecondaryViewportMaskNV = 5258, - SpvBuiltInPositionPerViewNV = 5261, - SpvBuiltInViewportMaskPerViewNV = 5262, - SpvBuiltInMax = 0x7fffffff, -} SpvBuiltIn; - -typedef enum SpvSelectionControlShift_ { - SpvSelectionControlFlattenShift = 0, - SpvSelectionControlDontFlattenShift = 1, - SpvSelectionControlMax = 0x7fffffff, -} SpvSelectionControlShift; - -typedef enum SpvSelectionControlMask_ { - SpvSelectionControlMaskNone = 0, - SpvSelectionControlFlattenMask = 0x00000001, - SpvSelectionControlDontFlattenMask = 0x00000002, -} SpvSelectionControlMask; - -typedef enum SpvLoopControlShift_ { - SpvLoopControlUnrollShift = 0, - SpvLoopControlDontUnrollShift = 1, - SpvLoopControlDependencyInfiniteShift = 2, - SpvLoopControlDependencyLengthShift = 3, - SpvLoopControlMax = 0x7fffffff, -} SpvLoopControlShift; - -typedef enum SpvLoopControlMask_ { - SpvLoopControlMaskNone = 0, - SpvLoopControlUnrollMask = 0x00000001, - SpvLoopControlDontUnrollMask = 0x00000002, - SpvLoopControlDependencyInfiniteMask = 0x00000004, - SpvLoopControlDependencyLengthMask = 0x00000008, -} SpvLoopControlMask; - -typedef enum SpvFunctionControlShift_ { - SpvFunctionControlInlineShift = 0, - SpvFunctionControlDontInlineShift = 1, - SpvFunctionControlPureShift = 2, - SpvFunctionControlConstShift = 3, - SpvFunctionControlMax = 0x7fffffff, -} SpvFunctionControlShift; - -typedef enum SpvFunctionControlMask_ { - SpvFunctionControlMaskNone = 0, - SpvFunctionControlInlineMask = 0x00000001, - SpvFunctionControlDontInlineMask = 0x00000002, - SpvFunctionControlPureMask = 0x00000004, - SpvFunctionControlConstMask = 0x00000008, -} SpvFunctionControlMask; - -typedef enum SpvMemorySemanticsShift_ { - SpvMemorySemanticsAcquireShift = 1, - SpvMemorySemanticsReleaseShift = 2, - SpvMemorySemanticsAcquireReleaseShift = 3, - SpvMemorySemanticsSequentiallyConsistentShift = 4, - SpvMemorySemanticsUniformMemoryShift = 6, - SpvMemorySemanticsSubgroupMemoryShift = 7, - SpvMemorySemanticsWorkgroupMemoryShift = 8, - SpvMemorySemanticsCrossWorkgroupMemoryShift = 9, - SpvMemorySemanticsAtomicCounterMemoryShift = 10, - SpvMemorySemanticsImageMemoryShift = 11, - SpvMemorySemanticsMax = 0x7fffffff, -} SpvMemorySemanticsShift; - -typedef enum SpvMemorySemanticsMask_ { - SpvMemorySemanticsMaskNone = 0, - SpvMemorySemanticsAcquireMask = 0x00000002, - SpvMemorySemanticsReleaseMask = 0x00000004, - SpvMemorySemanticsAcquireReleaseMask = 0x00000008, - SpvMemorySemanticsSequentiallyConsistentMask = 0x00000010, - SpvMemorySemanticsUniformMemoryMask = 0x00000040, - SpvMemorySemanticsSubgroupMemoryMask = 0x00000080, - SpvMemorySemanticsWorkgroupMemoryMask = 0x00000100, - SpvMemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, - SpvMemorySemanticsAtomicCounterMemoryMask = 0x00000400, - SpvMemorySemanticsImageMemoryMask = 0x00000800, -} SpvMemorySemanticsMask; - -typedef enum SpvMemoryAccessShift_ { - SpvMemoryAccessVolatileShift = 0, - SpvMemoryAccessAlignedShift = 1, - SpvMemoryAccessNontemporalShift = 2, - SpvMemoryAccessMax = 0x7fffffff, -} SpvMemoryAccessShift; - -typedef enum SpvMemoryAccessMask_ { - SpvMemoryAccessMaskNone = 0, - SpvMemoryAccessVolatileMask = 0x00000001, - SpvMemoryAccessAlignedMask = 0x00000002, - SpvMemoryAccessNontemporalMask = 0x00000004, -} SpvMemoryAccessMask; - -typedef enum SpvScope_ { - SpvScopeCrossDevice = 0, - SpvScopeDevice = 1, - SpvScopeWorkgroup = 2, - SpvScopeSubgroup = 3, - SpvScopeInvocation = 4, - SpvScopeMax = 0x7fffffff, -} SpvScope; - -typedef enum SpvGroupOperation_ { - SpvGroupOperationReduce = 0, - SpvGroupOperationInclusiveScan = 1, - SpvGroupOperationExclusiveScan = 2, - SpvGroupOperationMax = 0x7fffffff, -} SpvGroupOperation; - -typedef enum SpvKernelEnqueueFlags_ { - SpvKernelEnqueueFlagsNoWait = 0, - SpvKernelEnqueueFlagsWaitKernel = 1, - SpvKernelEnqueueFlagsWaitWorkGroup = 2, - SpvKernelEnqueueFlagsMax = 0x7fffffff, -} SpvKernelEnqueueFlags; - -typedef enum SpvKernelProfilingInfoShift_ { - SpvKernelProfilingInfoCmdExecTimeShift = 0, - SpvKernelProfilingInfoMax = 0x7fffffff, -} SpvKernelProfilingInfoShift; - -typedef enum SpvKernelProfilingInfoMask_ { - SpvKernelProfilingInfoMaskNone = 0, - SpvKernelProfilingInfoCmdExecTimeMask = 0x00000001, -} SpvKernelProfilingInfoMask; - -typedef enum SpvCapability_ { - SpvCapabilityMatrix = 0, - SpvCapabilityShader = 1, - SpvCapabilityGeometry = 2, - SpvCapabilityTessellation = 3, - SpvCapabilityAddresses = 4, - SpvCapabilityLinkage = 5, - SpvCapabilityKernel = 6, - SpvCapabilityVector16 = 7, - SpvCapabilityFloat16Buffer = 8, - SpvCapabilityFloat16 = 9, - SpvCapabilityFloat64 = 10, - SpvCapabilityInt64 = 11, - SpvCapabilityInt64Atomics = 12, - SpvCapabilityImageBasic = 13, - SpvCapabilityImageReadWrite = 14, - SpvCapabilityImageMipmap = 15, - SpvCapabilityPipes = 17, - SpvCapabilityGroups = 18, - SpvCapabilityDeviceEnqueue = 19, - SpvCapabilityLiteralSampler = 20, - SpvCapabilityAtomicStorage = 21, - SpvCapabilityInt16 = 22, - SpvCapabilityTessellationPointSize = 23, - SpvCapabilityGeometryPointSize = 24, - SpvCapabilityImageGatherExtended = 25, - SpvCapabilityStorageImageMultisample = 27, - SpvCapabilityUniformBufferArrayDynamicIndexing = 28, - SpvCapabilitySampledImageArrayDynamicIndexing = 29, - SpvCapabilityStorageBufferArrayDynamicIndexing = 30, - SpvCapabilityStorageImageArrayDynamicIndexing = 31, - SpvCapabilityClipDistance = 32, - SpvCapabilityCullDistance = 33, - SpvCapabilityImageCubeArray = 34, - SpvCapabilitySampleRateShading = 35, - SpvCapabilityImageRect = 36, - SpvCapabilitySampledRect = 37, - SpvCapabilityGenericPointer = 38, - SpvCapabilityInt8 = 39, - SpvCapabilityInputAttachment = 40, - SpvCapabilitySparseResidency = 41, - SpvCapabilityMinLod = 42, - SpvCapabilitySampled1D = 43, - SpvCapabilityImage1D = 44, - SpvCapabilitySampledCubeArray = 45, - SpvCapabilitySampledBuffer = 46, - SpvCapabilityImageBuffer = 47, - SpvCapabilityImageMSArray = 48, - SpvCapabilityStorageImageExtendedFormats = 49, - SpvCapabilityImageQuery = 50, - SpvCapabilityDerivativeControl = 51, - SpvCapabilityInterpolationFunction = 52, - SpvCapabilityTransformFeedback = 53, - SpvCapabilityGeometryStreams = 54, - SpvCapabilityStorageImageReadWithoutFormat = 55, - SpvCapabilityStorageImageWriteWithoutFormat = 56, - SpvCapabilityMultiViewport = 57, - SpvCapabilitySubgroupDispatch = 58, - SpvCapabilityNamedBarrier = 59, - SpvCapabilityPipeStorage = 60, - SpvCapabilitySubgroupBallotKHR = 4423, - SpvCapabilityDrawParameters = 4427, - SpvCapabilitySubgroupVoteKHR = 4431, - SpvCapabilityStorageBuffer16BitAccess = 4433, - SpvCapabilityStorageUniformBufferBlock16 = 4433, - SpvCapabilityStorageUniform16 = 4434, - SpvCapabilityUniformAndStorageBuffer16BitAccess = 4434, - SpvCapabilityStoragePushConstant16 = 4435, - SpvCapabilityStorageInputOutput16 = 4436, - SpvCapabilityDeviceGroup = 4437, - SpvCapabilityMultiView = 4439, - SpvCapabilityVariablePointersStorageBuffer = 4441, - SpvCapabilityVariablePointers = 4442, - SpvCapabilityAtomicStorageOps = 4445, - SpvCapabilitySampleMaskPostDepthCoverage = 4447, - SpvCapabilityImageGatherBiasLodAMD = 5009, - SpvCapabilityFragmentMaskAMD = 5010, - SpvCapabilityStencilExportEXT = 5013, - SpvCapabilityImageReadWriteLodAMD = 5015, - SpvCapabilitySampleMaskOverrideCoverageNV = 5249, - SpvCapabilityGeometryShaderPassthroughNV = 5251, - SpvCapabilityShaderViewportIndexLayerEXT = 5254, - SpvCapabilityShaderViewportIndexLayerNV = 5254, - SpvCapabilityShaderViewportMaskNV = 5255, - SpvCapabilityShaderStereoViewNV = 5259, - SpvCapabilityPerViewAttributesNV = 5260, - SpvCapabilitySubgroupShuffleINTEL = 5568, - SpvCapabilitySubgroupBufferBlockIOINTEL = 5569, - SpvCapabilitySubgroupImageBlockIOINTEL = 5570, - SpvCapabilityMax = 0x7fffffff, -} SpvCapability; - -typedef enum SpvOp_ { - SpvOpNop = 0, - SpvOpUndef = 1, - SpvOpSourceContinued = 2, - SpvOpSource = 3, - SpvOpSourceExtension = 4, - SpvOpName = 5, - SpvOpMemberName = 6, - SpvOpString = 7, - SpvOpLine = 8, - SpvOpExtension = 10, - SpvOpExtInstImport = 11, - SpvOpExtInst = 12, - SpvOpMemoryModel = 14, - SpvOpEntryPoint = 15, - SpvOpExecutionMode = 16, - SpvOpCapability = 17, - SpvOpTypeVoid = 19, - SpvOpTypeBool = 20, - SpvOpTypeInt = 21, - SpvOpTypeFloat = 22, - SpvOpTypeVector = 23, - SpvOpTypeMatrix = 24, - SpvOpTypeImage = 25, - SpvOpTypeSampler = 26, - SpvOpTypeSampledImage = 27, - SpvOpTypeArray = 28, - SpvOpTypeRuntimeArray = 29, - SpvOpTypeStruct = 30, - SpvOpTypeOpaque = 31, - SpvOpTypePointer = 32, - SpvOpTypeFunction = 33, - SpvOpTypeEvent = 34, - SpvOpTypeDeviceEvent = 35, - SpvOpTypeReserveId = 36, - SpvOpTypeQueue = 37, - SpvOpTypePipe = 38, - SpvOpTypeForwardPointer = 39, - SpvOpConstantTrue = 41, - SpvOpConstantFalse = 42, - SpvOpConstant = 43, - SpvOpConstantComposite = 44, - SpvOpConstantSampler = 45, - SpvOpConstantNull = 46, - SpvOpSpecConstantTrue = 48, - SpvOpSpecConstantFalse = 49, - SpvOpSpecConstant = 50, - SpvOpSpecConstantComposite = 51, - SpvOpSpecConstantOp = 52, - SpvOpFunction = 54, - SpvOpFunctionParameter = 55, - SpvOpFunctionEnd = 56, - SpvOpFunctionCall = 57, - SpvOpVariable = 59, - SpvOpImageTexelPointer = 60, - SpvOpLoad = 61, - SpvOpStore = 62, - SpvOpCopyMemory = 63, - SpvOpCopyMemorySized = 64, - SpvOpAccessChain = 65, - SpvOpInBoundsAccessChain = 66, - SpvOpPtrAccessChain = 67, - SpvOpArrayLength = 68, - SpvOpGenericPtrMemSemantics = 69, - SpvOpInBoundsPtrAccessChain = 70, - SpvOpDecorate = 71, - SpvOpMemberDecorate = 72, - SpvOpDecorationGroup = 73, - SpvOpGroupDecorate = 74, - SpvOpGroupMemberDecorate = 75, - SpvOpVectorExtractDynamic = 77, - SpvOpVectorInsertDynamic = 78, - SpvOpVectorShuffle = 79, - SpvOpCompositeConstruct = 80, - SpvOpCompositeExtract = 81, - SpvOpCompositeInsert = 82, - SpvOpCopyObject = 83, - SpvOpTranspose = 84, - SpvOpSampledImage = 86, - SpvOpImageSampleImplicitLod = 87, - SpvOpImageSampleExplicitLod = 88, - SpvOpImageSampleDrefImplicitLod = 89, - SpvOpImageSampleDrefExplicitLod = 90, - SpvOpImageSampleProjImplicitLod = 91, - SpvOpImageSampleProjExplicitLod = 92, - SpvOpImageSampleProjDrefImplicitLod = 93, - SpvOpImageSampleProjDrefExplicitLod = 94, - SpvOpImageFetch = 95, - SpvOpImageGather = 96, - SpvOpImageDrefGather = 97, - SpvOpImageRead = 98, - SpvOpImageWrite = 99, - SpvOpImage = 100, - SpvOpImageQueryFormat = 101, - SpvOpImageQueryOrder = 102, - SpvOpImageQuerySizeLod = 103, - SpvOpImageQuerySize = 104, - SpvOpImageQueryLod = 105, - SpvOpImageQueryLevels = 106, - SpvOpImageQuerySamples = 107, - SpvOpConvertFToU = 109, - SpvOpConvertFToS = 110, - SpvOpConvertSToF = 111, - SpvOpConvertUToF = 112, - SpvOpUConvert = 113, - SpvOpSConvert = 114, - SpvOpFConvert = 115, - SpvOpQuantizeToF16 = 116, - SpvOpConvertPtrToU = 117, - SpvOpSatConvertSToU = 118, - SpvOpSatConvertUToS = 119, - SpvOpConvertUToPtr = 120, - SpvOpPtrCastToGeneric = 121, - SpvOpGenericCastToPtr = 122, - SpvOpGenericCastToPtrExplicit = 123, - SpvOpBitcast = 124, - SpvOpSNegate = 126, - SpvOpFNegate = 127, - SpvOpIAdd = 128, - SpvOpFAdd = 129, - SpvOpISub = 130, - SpvOpFSub = 131, - SpvOpIMul = 132, - SpvOpFMul = 133, - SpvOpUDiv = 134, - SpvOpSDiv = 135, - SpvOpFDiv = 136, - SpvOpUMod = 137, - SpvOpSRem = 138, - SpvOpSMod = 139, - SpvOpFRem = 140, - SpvOpFMod = 141, - SpvOpVectorTimesScalar = 142, - SpvOpMatrixTimesScalar = 143, - SpvOpVectorTimesMatrix = 144, - SpvOpMatrixTimesVector = 145, - SpvOpMatrixTimesMatrix = 146, - SpvOpOuterProduct = 147, - SpvOpDot = 148, - SpvOpIAddCarry = 149, - SpvOpISubBorrow = 150, - SpvOpUMulExtended = 151, - SpvOpSMulExtended = 152, - SpvOpAny = 154, - SpvOpAll = 155, - SpvOpIsNan = 156, - SpvOpIsInf = 157, - SpvOpIsFinite = 158, - SpvOpIsNormal = 159, - SpvOpSignBitSet = 160, - SpvOpLessOrGreater = 161, - SpvOpOrdered = 162, - SpvOpUnordered = 163, - SpvOpLogicalEqual = 164, - SpvOpLogicalNotEqual = 165, - SpvOpLogicalOr = 166, - SpvOpLogicalAnd = 167, - SpvOpLogicalNot = 168, - SpvOpSelect = 169, - SpvOpIEqual = 170, - SpvOpINotEqual = 171, - SpvOpUGreaterThan = 172, - SpvOpSGreaterThan = 173, - SpvOpUGreaterThanEqual = 174, - SpvOpSGreaterThanEqual = 175, - SpvOpULessThan = 176, - SpvOpSLessThan = 177, - SpvOpULessThanEqual = 178, - SpvOpSLessThanEqual = 179, - SpvOpFOrdEqual = 180, - SpvOpFUnordEqual = 181, - SpvOpFOrdNotEqual = 182, - SpvOpFUnordNotEqual = 183, - SpvOpFOrdLessThan = 184, - SpvOpFUnordLessThan = 185, - SpvOpFOrdGreaterThan = 186, - SpvOpFUnordGreaterThan = 187, - SpvOpFOrdLessThanEqual = 188, - SpvOpFUnordLessThanEqual = 189, - SpvOpFOrdGreaterThanEqual = 190, - SpvOpFUnordGreaterThanEqual = 191, - SpvOpShiftRightLogical = 194, - SpvOpShiftRightArithmetic = 195, - SpvOpShiftLeftLogical = 196, - SpvOpBitwiseOr = 197, - SpvOpBitwiseXor = 198, - SpvOpBitwiseAnd = 199, - SpvOpNot = 200, - SpvOpBitFieldInsert = 201, - SpvOpBitFieldSExtract = 202, - SpvOpBitFieldUExtract = 203, - SpvOpBitReverse = 204, - SpvOpBitCount = 205, - SpvOpDPdx = 207, - SpvOpDPdy = 208, - SpvOpFwidth = 209, - SpvOpDPdxFine = 210, - SpvOpDPdyFine = 211, - SpvOpFwidthFine = 212, - SpvOpDPdxCoarse = 213, - SpvOpDPdyCoarse = 214, - SpvOpFwidthCoarse = 215, - SpvOpEmitVertex = 218, - SpvOpEndPrimitive = 219, - SpvOpEmitStreamVertex = 220, - SpvOpEndStreamPrimitive = 221, - SpvOpControlBarrier = 224, - SpvOpMemoryBarrier = 225, - SpvOpAtomicLoad = 227, - SpvOpAtomicStore = 228, - SpvOpAtomicExchange = 229, - SpvOpAtomicCompareExchange = 230, - SpvOpAtomicCompareExchangeWeak = 231, - SpvOpAtomicIIncrement = 232, - SpvOpAtomicIDecrement = 233, - SpvOpAtomicIAdd = 234, - SpvOpAtomicISub = 235, - SpvOpAtomicSMin = 236, - SpvOpAtomicUMin = 237, - SpvOpAtomicSMax = 238, - SpvOpAtomicUMax = 239, - SpvOpAtomicAnd = 240, - SpvOpAtomicOr = 241, - SpvOpAtomicXor = 242, - SpvOpPhi = 245, - SpvOpLoopMerge = 246, - SpvOpSelectionMerge = 247, - SpvOpLabel = 248, - SpvOpBranch = 249, - SpvOpBranchConditional = 250, - SpvOpSwitch = 251, - SpvOpKill = 252, - SpvOpReturn = 253, - SpvOpReturnValue = 254, - SpvOpUnreachable = 255, - SpvOpLifetimeStart = 256, - SpvOpLifetimeStop = 257, - SpvOpGroupAsyncCopy = 259, - SpvOpGroupWaitEvents = 260, - SpvOpGroupAll = 261, - SpvOpGroupAny = 262, - SpvOpGroupBroadcast = 263, - SpvOpGroupIAdd = 264, - SpvOpGroupFAdd = 265, - SpvOpGroupFMin = 266, - SpvOpGroupUMin = 267, - SpvOpGroupSMin = 268, - SpvOpGroupFMax = 269, - SpvOpGroupUMax = 270, - SpvOpGroupSMax = 271, - SpvOpReadPipe = 274, - SpvOpWritePipe = 275, - SpvOpReservedReadPipe = 276, - SpvOpReservedWritePipe = 277, - SpvOpReserveReadPipePackets = 278, - SpvOpReserveWritePipePackets = 279, - SpvOpCommitReadPipe = 280, - SpvOpCommitWritePipe = 281, - SpvOpIsValidReserveId = 282, - SpvOpGetNumPipePackets = 283, - SpvOpGetMaxPipePackets = 284, - SpvOpGroupReserveReadPipePackets = 285, - SpvOpGroupReserveWritePipePackets = 286, - SpvOpGroupCommitReadPipe = 287, - SpvOpGroupCommitWritePipe = 288, - SpvOpEnqueueMarker = 291, - SpvOpEnqueueKernel = 292, - SpvOpGetKernelNDrangeSubGroupCount = 293, - SpvOpGetKernelNDrangeMaxSubGroupSize = 294, - SpvOpGetKernelWorkGroupSize = 295, - SpvOpGetKernelPreferredWorkGroupSizeMultiple = 296, - SpvOpRetainEvent = 297, - SpvOpReleaseEvent = 298, - SpvOpCreateUserEvent = 299, - SpvOpIsValidEvent = 300, - SpvOpSetUserEventStatus = 301, - SpvOpCaptureEventProfilingInfo = 302, - SpvOpGetDefaultQueue = 303, - SpvOpBuildNDRange = 304, - SpvOpImageSparseSampleImplicitLod = 305, - SpvOpImageSparseSampleExplicitLod = 306, - SpvOpImageSparseSampleDrefImplicitLod = 307, - SpvOpImageSparseSampleDrefExplicitLod = 308, - SpvOpImageSparseSampleProjImplicitLod = 309, - SpvOpImageSparseSampleProjExplicitLod = 310, - SpvOpImageSparseSampleProjDrefImplicitLod = 311, - SpvOpImageSparseSampleProjDrefExplicitLod = 312, - SpvOpImageSparseFetch = 313, - SpvOpImageSparseGather = 314, - SpvOpImageSparseDrefGather = 315, - SpvOpImageSparseTexelsResident = 316, - SpvOpNoLine = 317, - SpvOpAtomicFlagTestAndSet = 318, - SpvOpAtomicFlagClear = 319, - SpvOpImageSparseRead = 320, - SpvOpSizeOf = 321, - SpvOpTypePipeStorage = 322, - SpvOpConstantPipeStorage = 323, - SpvOpCreatePipeFromPipeStorage = 324, - SpvOpGetKernelLocalSizeForSubgroupCount = 325, - SpvOpGetKernelMaxNumSubgroups = 326, - SpvOpTypeNamedBarrier = 327, - SpvOpNamedBarrierInitialize = 328, - SpvOpMemoryNamedBarrier = 329, - SpvOpModuleProcessed = 330, - SpvOpExecutionModeId = 331, - SpvOpDecorateId = 332, - SpvOpSubgroupBallotKHR = 4421, - SpvOpSubgroupFirstInvocationKHR = 4422, - SpvOpSubgroupAllKHR = 4428, - SpvOpSubgroupAnyKHR = 4429, - SpvOpSubgroupAllEqualKHR = 4430, - SpvOpSubgroupReadInvocationKHR = 4432, - SpvOpGroupIAddNonUniformAMD = 5000, - SpvOpGroupFAddNonUniformAMD = 5001, - SpvOpGroupFMinNonUniformAMD = 5002, - SpvOpGroupUMinNonUniformAMD = 5003, - SpvOpGroupSMinNonUniformAMD = 5004, - SpvOpGroupFMaxNonUniformAMD = 5005, - SpvOpGroupUMaxNonUniformAMD = 5006, - SpvOpGroupSMaxNonUniformAMD = 5007, - SpvOpFragmentMaskFetchAMD = 5011, - SpvOpFragmentFetchAMD = 5012, - SpvOpSubgroupShuffleINTEL = 5571, - SpvOpSubgroupShuffleDownINTEL = 5572, - SpvOpSubgroupShuffleUpINTEL = 5573, - SpvOpSubgroupShuffleXorINTEL = 5574, - SpvOpSubgroupBlockReadINTEL = 5575, - SpvOpSubgroupBlockWriteINTEL = 5576, - SpvOpSubgroupImageBlockReadINTEL = 5577, - SpvOpSubgroupImageBlockWriteINTEL = 5578, - SpvOpMax = 0x7fffffff, -} SpvOp; - -#endif // #ifndef spirv_H - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.hpp vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.hpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.hpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.hpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1026 +0,0 @@ -// Copyright (c) 2014-2017 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -#ifndef spirv_HPP -#define spirv_HPP - -namespace spv { - -typedef unsigned int Id; - -#define SPV_VERSION 0x10200 -#define SPV_REVISION 2 - -static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010200; -static const unsigned int Revision = 2; -static const unsigned int OpCodeMask = 0xffff; -static const unsigned int WordCountShift = 16; - -enum SourceLanguage { - SourceLanguageUnknown = 0, - SourceLanguageESSL = 1, - SourceLanguageGLSL = 2, - SourceLanguageOpenCL_C = 3, - SourceLanguageOpenCL_CPP = 4, - SourceLanguageHLSL = 5, - SourceLanguageMax = 0x7fffffff, -}; - -enum ExecutionModel { - ExecutionModelVertex = 0, - ExecutionModelTessellationControl = 1, - ExecutionModelTessellationEvaluation = 2, - ExecutionModelGeometry = 3, - ExecutionModelFragment = 4, - ExecutionModelGLCompute = 5, - ExecutionModelKernel = 6, - ExecutionModelMax = 0x7fffffff, -}; - -enum AddressingModel { - AddressingModelLogical = 0, - AddressingModelPhysical32 = 1, - AddressingModelPhysical64 = 2, - AddressingModelMax = 0x7fffffff, -}; - -enum MemoryModel { - MemoryModelSimple = 0, - MemoryModelGLSL450 = 1, - MemoryModelOpenCL = 2, - MemoryModelMax = 0x7fffffff, -}; - -enum ExecutionMode { - ExecutionModeInvocations = 0, - ExecutionModeSpacingEqual = 1, - ExecutionModeSpacingFractionalEven = 2, - ExecutionModeSpacingFractionalOdd = 3, - ExecutionModeVertexOrderCw = 4, - ExecutionModeVertexOrderCcw = 5, - ExecutionModePixelCenterInteger = 6, - ExecutionModeOriginUpperLeft = 7, - ExecutionModeOriginLowerLeft = 8, - ExecutionModeEarlyFragmentTests = 9, - ExecutionModePointMode = 10, - ExecutionModeXfb = 11, - ExecutionModeDepthReplacing = 12, - ExecutionModeDepthGreater = 14, - ExecutionModeDepthLess = 15, - ExecutionModeDepthUnchanged = 16, - ExecutionModeLocalSize = 17, - ExecutionModeLocalSizeHint = 18, - ExecutionModeInputPoints = 19, - ExecutionModeInputLines = 20, - ExecutionModeInputLinesAdjacency = 21, - ExecutionModeTriangles = 22, - ExecutionModeInputTrianglesAdjacency = 23, - ExecutionModeQuads = 24, - ExecutionModeIsolines = 25, - ExecutionModeOutputVertices = 26, - ExecutionModeOutputPoints = 27, - ExecutionModeOutputLineStrip = 28, - ExecutionModeOutputTriangleStrip = 29, - ExecutionModeVecTypeHint = 30, - ExecutionModeContractionOff = 31, - ExecutionModeInitializer = 33, - ExecutionModeFinalizer = 34, - ExecutionModeSubgroupSize = 35, - ExecutionModeSubgroupsPerWorkgroup = 36, - ExecutionModeSubgroupsPerWorkgroupId = 37, - ExecutionModeLocalSizeId = 38, - ExecutionModeLocalSizeHintId = 39, - ExecutionModePostDepthCoverage = 4446, - ExecutionModeStencilRefReplacingEXT = 5027, - ExecutionModeMax = 0x7fffffff, -}; - -enum StorageClass { - StorageClassUniformConstant = 0, - StorageClassInput = 1, - StorageClassUniform = 2, - StorageClassOutput = 3, - StorageClassWorkgroup = 4, - StorageClassCrossWorkgroup = 5, - StorageClassPrivate = 6, - StorageClassFunction = 7, - StorageClassGeneric = 8, - StorageClassPushConstant = 9, - StorageClassAtomicCounter = 10, - StorageClassImage = 11, - StorageClassStorageBuffer = 12, - StorageClassMax = 0x7fffffff, -}; - -enum Dim { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - DimCube = 3, - DimRect = 4, - DimBuffer = 5, - DimSubpassData = 6, - DimMax = 0x7fffffff, -}; - -enum SamplerAddressingMode { - SamplerAddressingModeNone = 0, - SamplerAddressingModeClampToEdge = 1, - SamplerAddressingModeClamp = 2, - SamplerAddressingModeRepeat = 3, - SamplerAddressingModeRepeatMirrored = 4, - SamplerAddressingModeMax = 0x7fffffff, -}; - -enum SamplerFilterMode { - SamplerFilterModeNearest = 0, - SamplerFilterModeLinear = 1, - SamplerFilterModeMax = 0x7fffffff, -}; - -enum ImageFormat { - ImageFormatUnknown = 0, - ImageFormatRgba32f = 1, - ImageFormatRgba16f = 2, - ImageFormatR32f = 3, - ImageFormatRgba8 = 4, - ImageFormatRgba8Snorm = 5, - ImageFormatRg32f = 6, - ImageFormatRg16f = 7, - ImageFormatR11fG11fB10f = 8, - ImageFormatR16f = 9, - ImageFormatRgba16 = 10, - ImageFormatRgb10A2 = 11, - ImageFormatRg16 = 12, - ImageFormatRg8 = 13, - ImageFormatR16 = 14, - ImageFormatR8 = 15, - ImageFormatRgba16Snorm = 16, - ImageFormatRg16Snorm = 17, - ImageFormatRg8Snorm = 18, - ImageFormatR16Snorm = 19, - ImageFormatR8Snorm = 20, - ImageFormatRgba32i = 21, - ImageFormatRgba16i = 22, - ImageFormatRgba8i = 23, - ImageFormatR32i = 24, - ImageFormatRg32i = 25, - ImageFormatRg16i = 26, - ImageFormatRg8i = 27, - ImageFormatR16i = 28, - ImageFormatR8i = 29, - ImageFormatRgba32ui = 30, - ImageFormatRgba16ui = 31, - ImageFormatRgba8ui = 32, - ImageFormatR32ui = 33, - ImageFormatRgb10a2ui = 34, - ImageFormatRg32ui = 35, - ImageFormatRg16ui = 36, - ImageFormatRg8ui = 37, - ImageFormatR16ui = 38, - ImageFormatR8ui = 39, - ImageFormatMax = 0x7fffffff, -}; - -enum ImageChannelOrder { - ImageChannelOrderR = 0, - ImageChannelOrderA = 1, - ImageChannelOrderRG = 2, - ImageChannelOrderRA = 3, - ImageChannelOrderRGB = 4, - ImageChannelOrderRGBA = 5, - ImageChannelOrderBGRA = 6, - ImageChannelOrderARGB = 7, - ImageChannelOrderIntensity = 8, - ImageChannelOrderLuminance = 9, - ImageChannelOrderRx = 10, - ImageChannelOrderRGx = 11, - ImageChannelOrderRGBx = 12, - ImageChannelOrderDepth = 13, - ImageChannelOrderDepthStencil = 14, - ImageChannelOrdersRGB = 15, - ImageChannelOrdersRGBx = 16, - ImageChannelOrdersRGBA = 17, - ImageChannelOrdersBGRA = 18, - ImageChannelOrderABGR = 19, - ImageChannelOrderMax = 0x7fffffff, -}; - -enum ImageChannelDataType { - ImageChannelDataTypeSnormInt8 = 0, - ImageChannelDataTypeSnormInt16 = 1, - ImageChannelDataTypeUnormInt8 = 2, - ImageChannelDataTypeUnormInt16 = 3, - ImageChannelDataTypeUnormShort565 = 4, - ImageChannelDataTypeUnormShort555 = 5, - ImageChannelDataTypeUnormInt101010 = 6, - ImageChannelDataTypeSignedInt8 = 7, - ImageChannelDataTypeSignedInt16 = 8, - ImageChannelDataTypeSignedInt32 = 9, - ImageChannelDataTypeUnsignedInt8 = 10, - ImageChannelDataTypeUnsignedInt16 = 11, - ImageChannelDataTypeUnsignedInt32 = 12, - ImageChannelDataTypeHalfFloat = 13, - ImageChannelDataTypeFloat = 14, - ImageChannelDataTypeUnormInt24 = 15, - ImageChannelDataTypeUnormInt101010_2 = 16, - ImageChannelDataTypeMax = 0x7fffffff, -}; - -enum ImageOperandsShift { - ImageOperandsBiasShift = 0, - ImageOperandsLodShift = 1, - ImageOperandsGradShift = 2, - ImageOperandsConstOffsetShift = 3, - ImageOperandsOffsetShift = 4, - ImageOperandsConstOffsetsShift = 5, - ImageOperandsSampleShift = 6, - ImageOperandsMinLodShift = 7, - ImageOperandsMax = 0x7fffffff, -}; - -enum ImageOperandsMask { - ImageOperandsMaskNone = 0, - ImageOperandsBiasMask = 0x00000001, - ImageOperandsLodMask = 0x00000002, - ImageOperandsGradMask = 0x00000004, - ImageOperandsConstOffsetMask = 0x00000008, - ImageOperandsOffsetMask = 0x00000010, - ImageOperandsConstOffsetsMask = 0x00000020, - ImageOperandsSampleMask = 0x00000040, - ImageOperandsMinLodMask = 0x00000080, -}; - -enum FPFastMathModeShift { - FPFastMathModeNotNaNShift = 0, - FPFastMathModeNotInfShift = 1, - FPFastMathModeNSZShift = 2, - FPFastMathModeAllowRecipShift = 3, - FPFastMathModeFastShift = 4, - FPFastMathModeMax = 0x7fffffff, -}; - -enum FPFastMathModeMask { - FPFastMathModeMaskNone = 0, - FPFastMathModeNotNaNMask = 0x00000001, - FPFastMathModeNotInfMask = 0x00000002, - FPFastMathModeNSZMask = 0x00000004, - FPFastMathModeAllowRecipMask = 0x00000008, - FPFastMathModeFastMask = 0x00000010, -}; - -enum FPRoundingMode { - FPRoundingModeRTE = 0, - FPRoundingModeRTZ = 1, - FPRoundingModeRTP = 2, - FPRoundingModeRTN = 3, - FPRoundingModeMax = 0x7fffffff, -}; - -enum LinkageType { - LinkageTypeExport = 0, - LinkageTypeImport = 1, - LinkageTypeMax = 0x7fffffff, -}; - -enum AccessQualifier { - AccessQualifierReadOnly = 0, - AccessQualifierWriteOnly = 1, - AccessQualifierReadWrite = 2, - AccessQualifierMax = 0x7fffffff, -}; - -enum FunctionParameterAttribute { - FunctionParameterAttributeZext = 0, - FunctionParameterAttributeSext = 1, - FunctionParameterAttributeByVal = 2, - FunctionParameterAttributeSret = 3, - FunctionParameterAttributeNoAlias = 4, - FunctionParameterAttributeNoCapture = 5, - FunctionParameterAttributeNoWrite = 6, - FunctionParameterAttributeNoReadWrite = 7, - FunctionParameterAttributeMax = 0x7fffffff, -}; - -enum Decoration { - DecorationRelaxedPrecision = 0, - DecorationSpecId = 1, - DecorationBlock = 2, - DecorationBufferBlock = 3, - DecorationRowMajor = 4, - DecorationColMajor = 5, - DecorationArrayStride = 6, - DecorationMatrixStride = 7, - DecorationGLSLShared = 8, - DecorationGLSLPacked = 9, - DecorationCPacked = 10, - DecorationBuiltIn = 11, - DecorationNoPerspective = 13, - DecorationFlat = 14, - DecorationPatch = 15, - DecorationCentroid = 16, - DecorationSample = 17, - DecorationInvariant = 18, - DecorationRestrict = 19, - DecorationAliased = 20, - DecorationVolatile = 21, - DecorationConstant = 22, - DecorationCoherent = 23, - DecorationNonWritable = 24, - DecorationNonReadable = 25, - DecorationUniform = 26, - DecorationSaturatedConversion = 28, - DecorationStream = 29, - DecorationLocation = 30, - DecorationComponent = 31, - DecorationIndex = 32, - DecorationBinding = 33, - DecorationDescriptorSet = 34, - DecorationOffset = 35, - DecorationXfbBuffer = 36, - DecorationXfbStride = 37, - DecorationFuncParamAttr = 38, - DecorationFPRoundingMode = 39, - DecorationFPFastMathMode = 40, - DecorationLinkageAttributes = 41, - DecorationNoContraction = 42, - DecorationInputAttachmentIndex = 43, - DecorationAlignment = 44, - DecorationMaxByteOffset = 45, - DecorationAlignmentId = 46, - DecorationMaxByteOffsetId = 47, - DecorationExplicitInterpAMD = 4999, - DecorationOverrideCoverageNV = 5248, - DecorationPassthroughNV = 5250, - DecorationViewportRelativeNV = 5252, - DecorationSecondaryViewportRelativeNV = 5256, - DecorationMax = 0x7fffffff, -}; - -enum BuiltIn { - BuiltInPosition = 0, - BuiltInPointSize = 1, - BuiltInClipDistance = 3, - BuiltInCullDistance = 4, - BuiltInVertexId = 5, - BuiltInInstanceId = 6, - BuiltInPrimitiveId = 7, - BuiltInInvocationId = 8, - BuiltInLayer = 9, - BuiltInViewportIndex = 10, - BuiltInTessLevelOuter = 11, - BuiltInTessLevelInner = 12, - BuiltInTessCoord = 13, - BuiltInPatchVertices = 14, - BuiltInFragCoord = 15, - BuiltInPointCoord = 16, - BuiltInFrontFacing = 17, - BuiltInSampleId = 18, - BuiltInSamplePosition = 19, - BuiltInSampleMask = 20, - BuiltInFragDepth = 22, - BuiltInHelperInvocation = 23, - BuiltInNumWorkgroups = 24, - BuiltInWorkgroupSize = 25, - BuiltInWorkgroupId = 26, - BuiltInLocalInvocationId = 27, - BuiltInGlobalInvocationId = 28, - BuiltInLocalInvocationIndex = 29, - BuiltInWorkDim = 30, - BuiltInGlobalSize = 31, - BuiltInEnqueuedWorkgroupSize = 32, - BuiltInGlobalOffset = 33, - BuiltInGlobalLinearId = 34, - BuiltInSubgroupSize = 36, - BuiltInSubgroupMaxSize = 37, - BuiltInNumSubgroups = 38, - BuiltInNumEnqueuedSubgroups = 39, - BuiltInSubgroupId = 40, - BuiltInSubgroupLocalInvocationId = 41, - BuiltInVertexIndex = 42, - BuiltInInstanceIndex = 43, - BuiltInSubgroupEqMaskKHR = 4416, - BuiltInSubgroupGeMaskKHR = 4417, - BuiltInSubgroupGtMaskKHR = 4418, - BuiltInSubgroupLeMaskKHR = 4419, - BuiltInSubgroupLtMaskKHR = 4420, - BuiltInBaseVertex = 4424, - BuiltInBaseInstance = 4425, - BuiltInDrawIndex = 4426, - BuiltInDeviceIndex = 4438, - BuiltInViewIndex = 4440, - BuiltInBaryCoordNoPerspAMD = 4992, - BuiltInBaryCoordNoPerspCentroidAMD = 4993, - BuiltInBaryCoordNoPerspSampleAMD = 4994, - BuiltInBaryCoordSmoothAMD = 4995, - BuiltInBaryCoordSmoothCentroidAMD = 4996, - BuiltInBaryCoordSmoothSampleAMD = 4997, - BuiltInBaryCoordPullModelAMD = 4998, - BuiltInFragStencilRefEXT = 5014, - BuiltInViewportMaskNV = 5253, - BuiltInSecondaryPositionNV = 5257, - BuiltInSecondaryViewportMaskNV = 5258, - BuiltInPositionPerViewNV = 5261, - BuiltInViewportMaskPerViewNV = 5262, - BuiltInMax = 0x7fffffff, -}; - -enum SelectionControlShift { - SelectionControlFlattenShift = 0, - SelectionControlDontFlattenShift = 1, - SelectionControlMax = 0x7fffffff, -}; - -enum SelectionControlMask { - SelectionControlMaskNone = 0, - SelectionControlFlattenMask = 0x00000001, - SelectionControlDontFlattenMask = 0x00000002, -}; - -enum LoopControlShift { - LoopControlUnrollShift = 0, - LoopControlDontUnrollShift = 1, - LoopControlDependencyInfiniteShift = 2, - LoopControlDependencyLengthShift = 3, - LoopControlMax = 0x7fffffff, -}; - -enum LoopControlMask { - LoopControlMaskNone = 0, - LoopControlUnrollMask = 0x00000001, - LoopControlDontUnrollMask = 0x00000002, - LoopControlDependencyInfiniteMask = 0x00000004, - LoopControlDependencyLengthMask = 0x00000008, -}; - -enum FunctionControlShift { - FunctionControlInlineShift = 0, - FunctionControlDontInlineShift = 1, - FunctionControlPureShift = 2, - FunctionControlConstShift = 3, - FunctionControlMax = 0x7fffffff, -}; - -enum FunctionControlMask { - FunctionControlMaskNone = 0, - FunctionControlInlineMask = 0x00000001, - FunctionControlDontInlineMask = 0x00000002, - FunctionControlPureMask = 0x00000004, - FunctionControlConstMask = 0x00000008, -}; - -enum MemorySemanticsShift { - MemorySemanticsAcquireShift = 1, - MemorySemanticsReleaseShift = 2, - MemorySemanticsAcquireReleaseShift = 3, - MemorySemanticsSequentiallyConsistentShift = 4, - MemorySemanticsUniformMemoryShift = 6, - MemorySemanticsSubgroupMemoryShift = 7, - MemorySemanticsWorkgroupMemoryShift = 8, - MemorySemanticsCrossWorkgroupMemoryShift = 9, - MemorySemanticsAtomicCounterMemoryShift = 10, - MemorySemanticsImageMemoryShift = 11, - MemorySemanticsMax = 0x7fffffff, -}; - -enum MemorySemanticsMask { - MemorySemanticsMaskNone = 0, - MemorySemanticsAcquireMask = 0x00000002, - MemorySemanticsReleaseMask = 0x00000004, - MemorySemanticsAcquireReleaseMask = 0x00000008, - MemorySemanticsSequentiallyConsistentMask = 0x00000010, - MemorySemanticsUniformMemoryMask = 0x00000040, - MemorySemanticsSubgroupMemoryMask = 0x00000080, - MemorySemanticsWorkgroupMemoryMask = 0x00000100, - MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, - MemorySemanticsAtomicCounterMemoryMask = 0x00000400, - MemorySemanticsImageMemoryMask = 0x00000800, -}; - -enum MemoryAccessShift { - MemoryAccessVolatileShift = 0, - MemoryAccessAlignedShift = 1, - MemoryAccessNontemporalShift = 2, - MemoryAccessMax = 0x7fffffff, -}; - -enum MemoryAccessMask { - MemoryAccessMaskNone = 0, - MemoryAccessVolatileMask = 0x00000001, - MemoryAccessAlignedMask = 0x00000002, - MemoryAccessNontemporalMask = 0x00000004, -}; - -enum Scope { - ScopeCrossDevice = 0, - ScopeDevice = 1, - ScopeWorkgroup = 2, - ScopeSubgroup = 3, - ScopeInvocation = 4, - ScopeMax = 0x7fffffff, -}; - -enum GroupOperation { - GroupOperationReduce = 0, - GroupOperationInclusiveScan = 1, - GroupOperationExclusiveScan = 2, - GroupOperationMax = 0x7fffffff, -}; - -enum KernelEnqueueFlags { - KernelEnqueueFlagsNoWait = 0, - KernelEnqueueFlagsWaitKernel = 1, - KernelEnqueueFlagsWaitWorkGroup = 2, - KernelEnqueueFlagsMax = 0x7fffffff, -}; - -enum KernelProfilingInfoShift { - KernelProfilingInfoCmdExecTimeShift = 0, - KernelProfilingInfoMax = 0x7fffffff, -}; - -enum KernelProfilingInfoMask { - KernelProfilingInfoMaskNone = 0, - KernelProfilingInfoCmdExecTimeMask = 0x00000001, -}; - -enum Capability { - CapabilityMatrix = 0, - CapabilityShader = 1, - CapabilityGeometry = 2, - CapabilityTessellation = 3, - CapabilityAddresses = 4, - CapabilityLinkage = 5, - CapabilityKernel = 6, - CapabilityVector16 = 7, - CapabilityFloat16Buffer = 8, - CapabilityFloat16 = 9, - CapabilityFloat64 = 10, - CapabilityInt64 = 11, - CapabilityInt64Atomics = 12, - CapabilityImageBasic = 13, - CapabilityImageReadWrite = 14, - CapabilityImageMipmap = 15, - CapabilityPipes = 17, - CapabilityGroups = 18, - CapabilityDeviceEnqueue = 19, - CapabilityLiteralSampler = 20, - CapabilityAtomicStorage = 21, - CapabilityInt16 = 22, - CapabilityTessellationPointSize = 23, - CapabilityGeometryPointSize = 24, - CapabilityImageGatherExtended = 25, - CapabilityStorageImageMultisample = 27, - CapabilityUniformBufferArrayDynamicIndexing = 28, - CapabilitySampledImageArrayDynamicIndexing = 29, - CapabilityStorageBufferArrayDynamicIndexing = 30, - CapabilityStorageImageArrayDynamicIndexing = 31, - CapabilityClipDistance = 32, - CapabilityCullDistance = 33, - CapabilityImageCubeArray = 34, - CapabilitySampleRateShading = 35, - CapabilityImageRect = 36, - CapabilitySampledRect = 37, - CapabilityGenericPointer = 38, - CapabilityInt8 = 39, - CapabilityInputAttachment = 40, - CapabilitySparseResidency = 41, - CapabilityMinLod = 42, - CapabilitySampled1D = 43, - CapabilityImage1D = 44, - CapabilitySampledCubeArray = 45, - CapabilitySampledBuffer = 46, - CapabilityImageBuffer = 47, - CapabilityImageMSArray = 48, - CapabilityStorageImageExtendedFormats = 49, - CapabilityImageQuery = 50, - CapabilityDerivativeControl = 51, - CapabilityInterpolationFunction = 52, - CapabilityTransformFeedback = 53, - CapabilityGeometryStreams = 54, - CapabilityStorageImageReadWithoutFormat = 55, - CapabilityStorageImageWriteWithoutFormat = 56, - CapabilityMultiViewport = 57, - CapabilitySubgroupDispatch = 58, - CapabilityNamedBarrier = 59, - CapabilityPipeStorage = 60, - CapabilitySubgroupBallotKHR = 4423, - CapabilityDrawParameters = 4427, - CapabilitySubgroupVoteKHR = 4431, - CapabilityStorageBuffer16BitAccess = 4433, - CapabilityStorageUniformBufferBlock16 = 4433, - CapabilityStorageUniform16 = 4434, - CapabilityUniformAndStorageBuffer16BitAccess = 4434, - CapabilityStoragePushConstant16 = 4435, - CapabilityStorageInputOutput16 = 4436, - CapabilityDeviceGroup = 4437, - CapabilityMultiView = 4439, - CapabilityVariablePointersStorageBuffer = 4441, - CapabilityVariablePointers = 4442, - CapabilityAtomicStorageOps = 4445, - CapabilitySampleMaskPostDepthCoverage = 4447, - CapabilityImageGatherBiasLodAMD = 5009, - CapabilityFragmentMaskAMD = 5010, - CapabilityStencilExportEXT = 5013, - CapabilityImageReadWriteLodAMD = 5015, - CapabilitySampleMaskOverrideCoverageNV = 5249, - CapabilityGeometryShaderPassthroughNV = 5251, - CapabilityShaderViewportIndexLayerEXT = 5254, - CapabilityShaderViewportIndexLayerNV = 5254, - CapabilityShaderViewportMaskNV = 5255, - CapabilityShaderStereoViewNV = 5259, - CapabilityPerViewAttributesNV = 5260, - CapabilitySubgroupShuffleINTEL = 5568, - CapabilitySubgroupBufferBlockIOINTEL = 5569, - CapabilitySubgroupImageBlockIOINTEL = 5570, - CapabilityMax = 0x7fffffff, -}; - -enum Op { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpExecutionModeId = 331, - OpDecorateId = 332, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - OpMax = 0x7fffffff, -}; - -// Overload operator| for mask bit combining - -inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } -inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } -inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } -inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } -inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } -inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } -inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } -inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } - -} // end namespace spv - -#endif // #ifndef spirv_HPP - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.hpp11 vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.hpp11 --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.hpp11 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.hpp11 1970-01-01 00:00:00.000000000 +0000 @@ -1,1026 +0,0 @@ -// Copyright (c) 2014-2017 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -#ifndef spirv_HPP -#define spirv_HPP - -namespace spv { - -typedef unsigned int Id; - -#define SPV_VERSION 0x10200 -#define SPV_REVISION 2 - -static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010200; -static const unsigned int Revision = 2; -static const unsigned int OpCodeMask = 0xffff; -static const unsigned int WordCountShift = 16; - -enum class SourceLanguage : unsigned { - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - Max = 0x7fffffff, -}; - -enum class ExecutionModel : unsigned { - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - Max = 0x7fffffff, -}; - -enum class AddressingModel : unsigned { - Logical = 0, - Physical32 = 1, - Physical64 = 2, - Max = 0x7fffffff, -}; - -enum class MemoryModel : unsigned { - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - Max = 0x7fffffff, -}; - -enum class ExecutionMode : unsigned { - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - Initializer = 33, - Finalizer = 34, - SubgroupSize = 35, - SubgroupsPerWorkgroup = 36, - SubgroupsPerWorkgroupId = 37, - LocalSizeId = 38, - LocalSizeHintId = 39, - PostDepthCoverage = 4446, - StencilRefReplacingEXT = 5027, - Max = 0x7fffffff, -}; - -enum class StorageClass : unsigned { - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - Max = 0x7fffffff, -}; - -enum class Dim : unsigned { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, - Max = 0x7fffffff, -}; - -enum class SamplerAddressingMode : unsigned { - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, - Max = 0x7fffffff, -}; - -enum class SamplerFilterMode : unsigned { - Nearest = 0, - Linear = 1, - Max = 0x7fffffff, -}; - -enum class ImageFormat : unsigned { - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - Max = 0x7fffffff, -}; - -enum class ImageChannelOrder : unsigned { - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, - Max = 0x7fffffff, -}; - -enum class ImageChannelDataType : unsigned { - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, - Max = 0x7fffffff, -}; - -enum class ImageOperandsShift : unsigned { - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - Max = 0x7fffffff, -}; - -enum class ImageOperandsMask : unsigned { - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, -}; - -enum class FPFastMathModeShift : unsigned { - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - Max = 0x7fffffff, -}; - -enum class FPFastMathModeMask : unsigned { - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, -}; - -enum class FPRoundingMode : unsigned { - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, - Max = 0x7fffffff, -}; - -enum class LinkageType : unsigned { - Export = 0, - Import = 1, - Max = 0x7fffffff, -}; - -enum class AccessQualifier : unsigned { - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, - Max = 0x7fffffff, -}; - -enum class FunctionParameterAttribute : unsigned { - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, - Max = 0x7fffffff, -}; - -enum class Decoration : unsigned { - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - MaxByteOffset = 45, - AlignmentId = 46, - MaxByteOffsetId = 47, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - Max = 0x7fffffff, -}; - -enum class BuiltIn : unsigned { - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMaskKHR = 4416, - SubgroupGeMaskKHR = 4417, - SubgroupGtMaskKHR = 4418, - SubgroupLeMaskKHR = 4419, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - DeviceIndex = 4438, - ViewIndex = 4440, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - Max = 0x7fffffff, -}; - -enum class SelectionControlShift : unsigned { - Flatten = 0, - DontFlatten = 1, - Max = 0x7fffffff, -}; - -enum class SelectionControlMask : unsigned { - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, -}; - -enum class LoopControlShift : unsigned { - Unroll = 0, - DontUnroll = 1, - DependencyInfinite = 2, - DependencyLength = 3, - Max = 0x7fffffff, -}; - -enum class LoopControlMask : unsigned { - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, - DependencyInfinite = 0x00000004, - DependencyLength = 0x00000008, -}; - -enum class FunctionControlShift : unsigned { - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - Max = 0x7fffffff, -}; - -enum class FunctionControlMask : unsigned { - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, -}; - -enum class MemorySemanticsShift : unsigned { - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - Max = 0x7fffffff, -}; - -enum class MemorySemanticsMask : unsigned { - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, -}; - -enum class MemoryAccessShift : unsigned { - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - Max = 0x7fffffff, -}; - -enum class MemoryAccessMask : unsigned { - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, -}; - -enum class Scope : unsigned { - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - Max = 0x7fffffff, -}; - -enum class GroupOperation : unsigned { - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - Max = 0x7fffffff, -}; - -enum class KernelEnqueueFlags : unsigned { - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, - Max = 0x7fffffff, -}; - -enum class KernelProfilingInfoShift : unsigned { - CmdExecTime = 0, - Max = 0x7fffffff, -}; - -enum class KernelProfilingInfoMask : unsigned { - MaskNone = 0, - CmdExecTime = 0x00000001, -}; - -enum class Capability : unsigned { - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupDispatch = 58, - NamedBarrier = 59, - PipeStorage = 60, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - Max = 0x7fffffff, -}; - -enum class Op : unsigned { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpExecutionModeId = 331, - OpDecorateId = 332, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - Max = 0x7fffffff, -}; - -// Overload operator| for mask bit combining - -inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } -inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } -inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } -inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } -inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } -inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } -inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } -inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } - -} // end namespace spv - -#endif // #ifndef spirv_HPP - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.json vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.json --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.json 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,1042 +0,0 @@ -{ - "spv": - { - "meta": - { - "Comment": - [ - [ - "Copyright (c) 2014-2017 The Khronos Group Inc.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and/or associated documentation files (the \"Materials\"),", - "to deal in the Materials without restriction, including without limitation", - "the rights to use, copy, modify, merge, publish, distribute, sublicense,", - "and/or sell copies of the Materials, and to permit persons to whom the", - "Materials are furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Materials.", - "", - "MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS", - "STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND", - "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ", - "", - "THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS", - "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL", - "THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", - "FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS", - "IN THE MATERIALS." - ], - [ - "This header is automatically generated by the same tool that creates", - "the Binary Section of the SPIR-V specification." - ], - [ - "Enumeration tokens for SPIR-V, in various styles:", - " C, C++, C++11, JSON, Lua, Python", - "", - "- C will have tokens with a \"Spv\" prefix, e.g.: SpvSourceLanguageGLSL", - "- C++ will have tokens in the \"spv\" name space, e.g.: spv::SourceLanguageGLSL", - "- C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL", - "- Lua will use tables, e.g.: spv.SourceLanguage.GLSL", - "- Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']", - "", - "Some tokens act like mask values, which can be OR'd together,", - "while others are mutually exclusive. The mask-like ones have", - "\"Mask\" in their name, and a parallel enum that has the shift", - "amount (1 << x) for each corresponding enumerant." - ] - ], - "MagicNumber": 119734787, - "Version": 66048, - "Revision": 2, - "OpCodeMask": 65535, - "WordCountShift": 16 - }, - "enum": - [ - { - "Name": "SourceLanguage", - "Type": "Value", - "Values": - { - "Unknown": 0, - "ESSL": 1, - "GLSL": 2, - "OpenCL_C": 3, - "OpenCL_CPP": 4, - "HLSL": 5 - } - }, - { - "Name": "ExecutionModel", - "Type": "Value", - "Values": - { - "Vertex": 0, - "TessellationControl": 1, - "TessellationEvaluation": 2, - "Geometry": 3, - "Fragment": 4, - "GLCompute": 5, - "Kernel": 6 - } - }, - { - "Name": "AddressingModel", - "Type": "Value", - "Values": - { - "Logical": 0, - "Physical32": 1, - "Physical64": 2 - } - }, - { - "Name": "MemoryModel", - "Type": "Value", - "Values": - { - "Simple": 0, - "GLSL450": 1, - "OpenCL": 2 - } - }, - { - "Name": "ExecutionMode", - "Type": "Value", - "Values": - { - "Invocations": 0, - "SpacingEqual": 1, - "SpacingFractionalEven": 2, - "SpacingFractionalOdd": 3, - "VertexOrderCw": 4, - "VertexOrderCcw": 5, - "PixelCenterInteger": 6, - "OriginUpperLeft": 7, - "OriginLowerLeft": 8, - "EarlyFragmentTests": 9, - "PointMode": 10, - "Xfb": 11, - "DepthReplacing": 12, - "DepthGreater": 14, - "DepthLess": 15, - "DepthUnchanged": 16, - "LocalSize": 17, - "LocalSizeHint": 18, - "InputPoints": 19, - "InputLines": 20, - "InputLinesAdjacency": 21, - "Triangles": 22, - "InputTrianglesAdjacency": 23, - "Quads": 24, - "Isolines": 25, - "OutputVertices": 26, - "OutputPoints": 27, - "OutputLineStrip": 28, - "OutputTriangleStrip": 29, - "VecTypeHint": 30, - "ContractionOff": 31, - "Initializer": 33, - "Finalizer": 34, - "SubgroupSize": 35, - "SubgroupsPerWorkgroup": 36, - "SubgroupsPerWorkgroupId": 37, - "LocalSizeId": 38, - "LocalSizeHintId": 39, - "PostDepthCoverage": 4446, - "StencilRefReplacingEXT": 5027 - } - }, - { - "Name": "StorageClass", - "Type": "Value", - "Values": - { - "UniformConstant": 0, - "Input": 1, - "Uniform": 2, - "Output": 3, - "Workgroup": 4, - "CrossWorkgroup": 5, - "Private": 6, - "Function": 7, - "Generic": 8, - "PushConstant": 9, - "AtomicCounter": 10, - "Image": 11, - "StorageBuffer": 12 - } - }, - { - "Name": "Dim", - "Type": "Value", - "Values": - { - "Dim1D": 0, - "Dim2D": 1, - "Dim3D": 2, - "Cube": 3, - "Rect": 4, - "Buffer": 5, - "SubpassData": 6 - } - }, - { - "Name": "SamplerAddressingMode", - "Type": "Value", - "Values": - { - "None": 0, - "ClampToEdge": 1, - "Clamp": 2, - "Repeat": 3, - "RepeatMirrored": 4 - } - }, - { - "Name": "SamplerFilterMode", - "Type": "Value", - "Values": - { - "Nearest": 0, - "Linear": 1 - } - }, - { - "Name": "ImageFormat", - "Type": "Value", - "Values": - { - "Unknown": 0, - "Rgba32f": 1, - "Rgba16f": 2, - "R32f": 3, - "Rgba8": 4, - "Rgba8Snorm": 5, - "Rg32f": 6, - "Rg16f": 7, - "R11fG11fB10f": 8, - "R16f": 9, - "Rgba16": 10, - "Rgb10A2": 11, - "Rg16": 12, - "Rg8": 13, - "R16": 14, - "R8": 15, - "Rgba16Snorm": 16, - "Rg16Snorm": 17, - "Rg8Snorm": 18, - "R16Snorm": 19, - "R8Snorm": 20, - "Rgba32i": 21, - "Rgba16i": 22, - "Rgba8i": 23, - "R32i": 24, - "Rg32i": 25, - "Rg16i": 26, - "Rg8i": 27, - "R16i": 28, - "R8i": 29, - "Rgba32ui": 30, - "Rgba16ui": 31, - "Rgba8ui": 32, - "R32ui": 33, - "Rgb10a2ui": 34, - "Rg32ui": 35, - "Rg16ui": 36, - "Rg8ui": 37, - "R16ui": 38, - "R8ui": 39 - } - }, - { - "Name": "ImageChannelOrder", - "Type": "Value", - "Values": - { - "R": 0, - "A": 1, - "RG": 2, - "RA": 3, - "RGB": 4, - "RGBA": 5, - "BGRA": 6, - "ARGB": 7, - "Intensity": 8, - "Luminance": 9, - "Rx": 10, - "RGx": 11, - "RGBx": 12, - "Depth": 13, - "DepthStencil": 14, - "sRGB": 15, - "sRGBx": 16, - "sRGBA": 17, - "sBGRA": 18, - "ABGR": 19 - } - }, - { - "Name": "ImageChannelDataType", - "Type": "Value", - "Values": - { - "SnormInt8": 0, - "SnormInt16": 1, - "UnormInt8": 2, - "UnormInt16": 3, - "UnormShort565": 4, - "UnormShort555": 5, - "UnormInt101010": 6, - "SignedInt8": 7, - "SignedInt16": 8, - "SignedInt32": 9, - "UnsignedInt8": 10, - "UnsignedInt16": 11, - "UnsignedInt32": 12, - "HalfFloat": 13, - "Float": 14, - "UnormInt24": 15, - "UnormInt101010_2": 16 - } - }, - { - "Name": "ImageOperands", - "Type": "Bit", - "Values": - { - "Bias": 0, - "Lod": 1, - "Grad": 2, - "ConstOffset": 3, - "Offset": 4, - "ConstOffsets": 5, - "Sample": 6, - "MinLod": 7 - } - }, - { - "Name": "FPFastMathMode", - "Type": "Bit", - "Values": - { - "NotNaN": 0, - "NotInf": 1, - "NSZ": 2, - "AllowRecip": 3, - "Fast": 4 - } - }, - { - "Name": "FPRoundingMode", - "Type": "Value", - "Values": - { - "RTE": 0, - "RTZ": 1, - "RTP": 2, - "RTN": 3 - } - }, - { - "Name": "LinkageType", - "Type": "Value", - "Values": - { - "Export": 0, - "Import": 1 - } - }, - { - "Name": "AccessQualifier", - "Type": "Value", - "Values": - { - "ReadOnly": 0, - "WriteOnly": 1, - "ReadWrite": 2 - } - }, - { - "Name": "FunctionParameterAttribute", - "Type": "Value", - "Values": - { - "Zext": 0, - "Sext": 1, - "ByVal": 2, - "Sret": 3, - "NoAlias": 4, - "NoCapture": 5, - "NoWrite": 6, - "NoReadWrite": 7 - } - }, - { - "Name": "Decoration", - "Type": "Value", - "Values": - { - "RelaxedPrecision": 0, - "SpecId": 1, - "Block": 2, - "BufferBlock": 3, - "RowMajor": 4, - "ColMajor": 5, - "ArrayStride": 6, - "MatrixStride": 7, - "GLSLShared": 8, - "GLSLPacked": 9, - "CPacked": 10, - "BuiltIn": 11, - "NoPerspective": 13, - "Flat": 14, - "Patch": 15, - "Centroid": 16, - "Sample": 17, - "Invariant": 18, - "Restrict": 19, - "Aliased": 20, - "Volatile": 21, - "Constant": 22, - "Coherent": 23, - "NonWritable": 24, - "NonReadable": 25, - "Uniform": 26, - "SaturatedConversion": 28, - "Stream": 29, - "Location": 30, - "Component": 31, - "Index": 32, - "Binding": 33, - "DescriptorSet": 34, - "Offset": 35, - "XfbBuffer": 36, - "XfbStride": 37, - "FuncParamAttr": 38, - "FPRoundingMode": 39, - "FPFastMathMode": 40, - "LinkageAttributes": 41, - "NoContraction": 42, - "InputAttachmentIndex": 43, - "Alignment": 44, - "MaxByteOffset": 45, - "AlignmentId": 46, - "MaxByteOffsetId": 47, - "ExplicitInterpAMD": 4999, - "OverrideCoverageNV": 5248, - "PassthroughNV": 5250, - "ViewportRelativeNV": 5252, - "SecondaryViewportRelativeNV": 5256 - } - }, - { - "Name": "BuiltIn", - "Type": "Value", - "Values": - { - "Position": 0, - "PointSize": 1, - "ClipDistance": 3, - "CullDistance": 4, - "VertexId": 5, - "InstanceId": 6, - "PrimitiveId": 7, - "InvocationId": 8, - "Layer": 9, - "ViewportIndex": 10, - "TessLevelOuter": 11, - "TessLevelInner": 12, - "TessCoord": 13, - "PatchVertices": 14, - "FragCoord": 15, - "PointCoord": 16, - "FrontFacing": 17, - "SampleId": 18, - "SamplePosition": 19, - "SampleMask": 20, - "FragDepth": 22, - "HelperInvocation": 23, - "NumWorkgroups": 24, - "WorkgroupSize": 25, - "WorkgroupId": 26, - "LocalInvocationId": 27, - "GlobalInvocationId": 28, - "LocalInvocationIndex": 29, - "WorkDim": 30, - "GlobalSize": 31, - "EnqueuedWorkgroupSize": 32, - "GlobalOffset": 33, - "GlobalLinearId": 34, - "SubgroupSize": 36, - "SubgroupMaxSize": 37, - "NumSubgroups": 38, - "NumEnqueuedSubgroups": 39, - "SubgroupId": 40, - "SubgroupLocalInvocationId": 41, - "VertexIndex": 42, - "InstanceIndex": 43, - "SubgroupEqMaskKHR": 4416, - "SubgroupGeMaskKHR": 4417, - "SubgroupGtMaskKHR": 4418, - "SubgroupLeMaskKHR": 4419, - "SubgroupLtMaskKHR": 4420, - "BaseVertex": 4424, - "BaseInstance": 4425, - "DrawIndex": 4426, - "DeviceIndex": 4438, - "ViewIndex": 4440, - "BaryCoordNoPerspAMD": 4992, - "BaryCoordNoPerspCentroidAMD": 4993, - "BaryCoordNoPerspSampleAMD": 4994, - "BaryCoordSmoothAMD": 4995, - "BaryCoordSmoothCentroidAMD": 4996, - "BaryCoordSmoothSampleAMD": 4997, - "BaryCoordPullModelAMD": 4998, - "FragStencilRefEXT": 5014, - "ViewportMaskNV": 5253, - "SecondaryPositionNV": 5257, - "SecondaryViewportMaskNV": 5258, - "PositionPerViewNV": 5261, - "ViewportMaskPerViewNV": 5262 - } - }, - { - "Name": "SelectionControl", - "Type": "Bit", - "Values": - { - "Flatten": 0, - "DontFlatten": 1 - } - }, - { - "Name": "LoopControl", - "Type": "Bit", - "Values": - { - "Unroll": 0, - "DontUnroll": 1, - "DependencyInfinite": 2, - "DependencyLength": 3 - } - }, - { - "Name": "FunctionControl", - "Type": "Bit", - "Values": - { - "Inline": 0, - "DontInline": 1, - "Pure": 2, - "Const": 3 - } - }, - { - "Name": "MemorySemantics", - "Type": "Bit", - "Values": - { - "Acquire": 1, - "Release": 2, - "AcquireRelease": 3, - "SequentiallyConsistent": 4, - "UniformMemory": 6, - "SubgroupMemory": 7, - "WorkgroupMemory": 8, - "CrossWorkgroupMemory": 9, - "AtomicCounterMemory": 10, - "ImageMemory": 11 - } - }, - { - "Name": "MemoryAccess", - "Type": "Bit", - "Values": - { - "Volatile": 0, - "Aligned": 1, - "Nontemporal": 2 - } - }, - { - "Name": "Scope", - "Type": "Value", - "Values": - { - "CrossDevice": 0, - "Device": 1, - "Workgroup": 2, - "Subgroup": 3, - "Invocation": 4 - } - }, - { - "Name": "GroupOperation", - "Type": "Value", - "Values": - { - "Reduce": 0, - "InclusiveScan": 1, - "ExclusiveScan": 2 - } - }, - { - "Name": "KernelEnqueueFlags", - "Type": "Value", - "Values": - { - "NoWait": 0, - "WaitKernel": 1, - "WaitWorkGroup": 2 - } - }, - { - "Name": "KernelProfilingInfo", - "Type": "Bit", - "Values": - { - "CmdExecTime": 0 - } - }, - { - "Name": "Capability", - "Type": "Value", - "Values": - { - "Matrix": 0, - "Shader": 1, - "Geometry": 2, - "Tessellation": 3, - "Addresses": 4, - "Linkage": 5, - "Kernel": 6, - "Vector16": 7, - "Float16Buffer": 8, - "Float16": 9, - "Float64": 10, - "Int64": 11, - "Int64Atomics": 12, - "ImageBasic": 13, - "ImageReadWrite": 14, - "ImageMipmap": 15, - "Pipes": 17, - "Groups": 18, - "DeviceEnqueue": 19, - "LiteralSampler": 20, - "AtomicStorage": 21, - "Int16": 22, - "TessellationPointSize": 23, - "GeometryPointSize": 24, - "ImageGatherExtended": 25, - "StorageImageMultisample": 27, - "UniformBufferArrayDynamicIndexing": 28, - "SampledImageArrayDynamicIndexing": 29, - "StorageBufferArrayDynamicIndexing": 30, - "StorageImageArrayDynamicIndexing": 31, - "ClipDistance": 32, - "CullDistance": 33, - "ImageCubeArray": 34, - "SampleRateShading": 35, - "ImageRect": 36, - "SampledRect": 37, - "GenericPointer": 38, - "Int8": 39, - "InputAttachment": 40, - "SparseResidency": 41, - "MinLod": 42, - "Sampled1D": 43, - "Image1D": 44, - "SampledCubeArray": 45, - "SampledBuffer": 46, - "ImageBuffer": 47, - "ImageMSArray": 48, - "StorageImageExtendedFormats": 49, - "ImageQuery": 50, - "DerivativeControl": 51, - "InterpolationFunction": 52, - "TransformFeedback": 53, - "GeometryStreams": 54, - "StorageImageReadWithoutFormat": 55, - "StorageImageWriteWithoutFormat": 56, - "MultiViewport": 57, - "SubgroupDispatch": 58, - "NamedBarrier": 59, - "PipeStorage": 60, - "SubgroupBallotKHR": 4423, - "DrawParameters": 4427, - "SubgroupVoteKHR": 4431, - "StorageBuffer16BitAccess": 4433, - "StorageUniformBufferBlock16": 4433, - "StorageUniform16": 4434, - "UniformAndStorageBuffer16BitAccess": 4434, - "StoragePushConstant16": 4435, - "StorageInputOutput16": 4436, - "DeviceGroup": 4437, - "MultiView": 4439, - "VariablePointersStorageBuffer": 4441, - "VariablePointers": 4442, - "AtomicStorageOps": 4445, - "SampleMaskPostDepthCoverage": 4447, - "ImageGatherBiasLodAMD": 5009, - "FragmentMaskAMD": 5010, - "StencilExportEXT": 5013, - "ImageReadWriteLodAMD": 5015, - "SampleMaskOverrideCoverageNV": 5249, - "GeometryShaderPassthroughNV": 5251, - "ShaderViewportIndexLayerEXT": 5254, - "ShaderViewportIndexLayerNV": 5254, - "ShaderViewportMaskNV": 5255, - "ShaderStereoViewNV": 5259, - "PerViewAttributesNV": 5260, - "SubgroupShuffleINTEL": 5568, - "SubgroupBufferBlockIOINTEL": 5569, - "SubgroupImageBlockIOINTEL": 5570 - } - }, - { - "Name": "Op", - "Type": "Value", - "Values": - { - "OpNop": 0, - "OpUndef": 1, - "OpSourceContinued": 2, - "OpSource": 3, - "OpSourceExtension": 4, - "OpName": 5, - "OpMemberName": 6, - "OpString": 7, - "OpLine": 8, - "OpExtension": 10, - "OpExtInstImport": 11, - "OpExtInst": 12, - "OpMemoryModel": 14, - "OpEntryPoint": 15, - "OpExecutionMode": 16, - "OpCapability": 17, - "OpTypeVoid": 19, - "OpTypeBool": 20, - "OpTypeInt": 21, - "OpTypeFloat": 22, - "OpTypeVector": 23, - "OpTypeMatrix": 24, - "OpTypeImage": 25, - "OpTypeSampler": 26, - "OpTypeSampledImage": 27, - "OpTypeArray": 28, - "OpTypeRuntimeArray": 29, - "OpTypeStruct": 30, - "OpTypeOpaque": 31, - "OpTypePointer": 32, - "OpTypeFunction": 33, - "OpTypeEvent": 34, - "OpTypeDeviceEvent": 35, - "OpTypeReserveId": 36, - "OpTypeQueue": 37, - "OpTypePipe": 38, - "OpTypeForwardPointer": 39, - "OpConstantTrue": 41, - "OpConstantFalse": 42, - "OpConstant": 43, - "OpConstantComposite": 44, - "OpConstantSampler": 45, - "OpConstantNull": 46, - "OpSpecConstantTrue": 48, - "OpSpecConstantFalse": 49, - "OpSpecConstant": 50, - "OpSpecConstantComposite": 51, - "OpSpecConstantOp": 52, - "OpFunction": 54, - "OpFunctionParameter": 55, - "OpFunctionEnd": 56, - "OpFunctionCall": 57, - "OpVariable": 59, - "OpImageTexelPointer": 60, - "OpLoad": 61, - "OpStore": 62, - "OpCopyMemory": 63, - "OpCopyMemorySized": 64, - "OpAccessChain": 65, - "OpInBoundsAccessChain": 66, - "OpPtrAccessChain": 67, - "OpArrayLength": 68, - "OpGenericPtrMemSemantics": 69, - "OpInBoundsPtrAccessChain": 70, - "OpDecorate": 71, - "OpMemberDecorate": 72, - "OpDecorationGroup": 73, - "OpGroupDecorate": 74, - "OpGroupMemberDecorate": 75, - "OpVectorExtractDynamic": 77, - "OpVectorInsertDynamic": 78, - "OpVectorShuffle": 79, - "OpCompositeConstruct": 80, - "OpCompositeExtract": 81, - "OpCompositeInsert": 82, - "OpCopyObject": 83, - "OpTranspose": 84, - "OpSampledImage": 86, - "OpImageSampleImplicitLod": 87, - "OpImageSampleExplicitLod": 88, - "OpImageSampleDrefImplicitLod": 89, - "OpImageSampleDrefExplicitLod": 90, - "OpImageSampleProjImplicitLod": 91, - "OpImageSampleProjExplicitLod": 92, - "OpImageSampleProjDrefImplicitLod": 93, - "OpImageSampleProjDrefExplicitLod": 94, - "OpImageFetch": 95, - "OpImageGather": 96, - "OpImageDrefGather": 97, - "OpImageRead": 98, - "OpImageWrite": 99, - "OpImage": 100, - "OpImageQueryFormat": 101, - "OpImageQueryOrder": 102, - "OpImageQuerySizeLod": 103, - "OpImageQuerySize": 104, - "OpImageQueryLod": 105, - "OpImageQueryLevels": 106, - "OpImageQuerySamples": 107, - "OpConvertFToU": 109, - "OpConvertFToS": 110, - "OpConvertSToF": 111, - "OpConvertUToF": 112, - "OpUConvert": 113, - "OpSConvert": 114, - "OpFConvert": 115, - "OpQuantizeToF16": 116, - "OpConvertPtrToU": 117, - "OpSatConvertSToU": 118, - "OpSatConvertUToS": 119, - "OpConvertUToPtr": 120, - "OpPtrCastToGeneric": 121, - "OpGenericCastToPtr": 122, - "OpGenericCastToPtrExplicit": 123, - "OpBitcast": 124, - "OpSNegate": 126, - "OpFNegate": 127, - "OpIAdd": 128, - "OpFAdd": 129, - "OpISub": 130, - "OpFSub": 131, - "OpIMul": 132, - "OpFMul": 133, - "OpUDiv": 134, - "OpSDiv": 135, - "OpFDiv": 136, - "OpUMod": 137, - "OpSRem": 138, - "OpSMod": 139, - "OpFRem": 140, - "OpFMod": 141, - "OpVectorTimesScalar": 142, - "OpMatrixTimesScalar": 143, - "OpVectorTimesMatrix": 144, - "OpMatrixTimesVector": 145, - "OpMatrixTimesMatrix": 146, - "OpOuterProduct": 147, - "OpDot": 148, - "OpIAddCarry": 149, - "OpISubBorrow": 150, - "OpUMulExtended": 151, - "OpSMulExtended": 152, - "OpAny": 154, - "OpAll": 155, - "OpIsNan": 156, - "OpIsInf": 157, - "OpIsFinite": 158, - "OpIsNormal": 159, - "OpSignBitSet": 160, - "OpLessOrGreater": 161, - "OpOrdered": 162, - "OpUnordered": 163, - "OpLogicalEqual": 164, - "OpLogicalNotEqual": 165, - "OpLogicalOr": 166, - "OpLogicalAnd": 167, - "OpLogicalNot": 168, - "OpSelect": 169, - "OpIEqual": 170, - "OpINotEqual": 171, - "OpUGreaterThan": 172, - "OpSGreaterThan": 173, - "OpUGreaterThanEqual": 174, - "OpSGreaterThanEqual": 175, - "OpULessThan": 176, - "OpSLessThan": 177, - "OpULessThanEqual": 178, - "OpSLessThanEqual": 179, - "OpFOrdEqual": 180, - "OpFUnordEqual": 181, - "OpFOrdNotEqual": 182, - "OpFUnordNotEqual": 183, - "OpFOrdLessThan": 184, - "OpFUnordLessThan": 185, - "OpFOrdGreaterThan": 186, - "OpFUnordGreaterThan": 187, - "OpFOrdLessThanEqual": 188, - "OpFUnordLessThanEqual": 189, - "OpFOrdGreaterThanEqual": 190, - "OpFUnordGreaterThanEqual": 191, - "OpShiftRightLogical": 194, - "OpShiftRightArithmetic": 195, - "OpShiftLeftLogical": 196, - "OpBitwiseOr": 197, - "OpBitwiseXor": 198, - "OpBitwiseAnd": 199, - "OpNot": 200, - "OpBitFieldInsert": 201, - "OpBitFieldSExtract": 202, - "OpBitFieldUExtract": 203, - "OpBitReverse": 204, - "OpBitCount": 205, - "OpDPdx": 207, - "OpDPdy": 208, - "OpFwidth": 209, - "OpDPdxFine": 210, - "OpDPdyFine": 211, - "OpFwidthFine": 212, - "OpDPdxCoarse": 213, - "OpDPdyCoarse": 214, - "OpFwidthCoarse": 215, - "OpEmitVertex": 218, - "OpEndPrimitive": 219, - "OpEmitStreamVertex": 220, - "OpEndStreamPrimitive": 221, - "OpControlBarrier": 224, - "OpMemoryBarrier": 225, - "OpAtomicLoad": 227, - "OpAtomicStore": 228, - "OpAtomicExchange": 229, - "OpAtomicCompareExchange": 230, - "OpAtomicCompareExchangeWeak": 231, - "OpAtomicIIncrement": 232, - "OpAtomicIDecrement": 233, - "OpAtomicIAdd": 234, - "OpAtomicISub": 235, - "OpAtomicSMin": 236, - "OpAtomicUMin": 237, - "OpAtomicSMax": 238, - "OpAtomicUMax": 239, - "OpAtomicAnd": 240, - "OpAtomicOr": 241, - "OpAtomicXor": 242, - "OpPhi": 245, - "OpLoopMerge": 246, - "OpSelectionMerge": 247, - "OpLabel": 248, - "OpBranch": 249, - "OpBranchConditional": 250, - "OpSwitch": 251, - "OpKill": 252, - "OpReturn": 253, - "OpReturnValue": 254, - "OpUnreachable": 255, - "OpLifetimeStart": 256, - "OpLifetimeStop": 257, - "OpGroupAsyncCopy": 259, - "OpGroupWaitEvents": 260, - "OpGroupAll": 261, - "OpGroupAny": 262, - "OpGroupBroadcast": 263, - "OpGroupIAdd": 264, - "OpGroupFAdd": 265, - "OpGroupFMin": 266, - "OpGroupUMin": 267, - "OpGroupSMin": 268, - "OpGroupFMax": 269, - "OpGroupUMax": 270, - "OpGroupSMax": 271, - "OpReadPipe": 274, - "OpWritePipe": 275, - "OpReservedReadPipe": 276, - "OpReservedWritePipe": 277, - "OpReserveReadPipePackets": 278, - "OpReserveWritePipePackets": 279, - "OpCommitReadPipe": 280, - "OpCommitWritePipe": 281, - "OpIsValidReserveId": 282, - "OpGetNumPipePackets": 283, - "OpGetMaxPipePackets": 284, - "OpGroupReserveReadPipePackets": 285, - "OpGroupReserveWritePipePackets": 286, - "OpGroupCommitReadPipe": 287, - "OpGroupCommitWritePipe": 288, - "OpEnqueueMarker": 291, - "OpEnqueueKernel": 292, - "OpGetKernelNDrangeSubGroupCount": 293, - "OpGetKernelNDrangeMaxSubGroupSize": 294, - "OpGetKernelWorkGroupSize": 295, - "OpGetKernelPreferredWorkGroupSizeMultiple": 296, - "OpRetainEvent": 297, - "OpReleaseEvent": 298, - "OpCreateUserEvent": 299, - "OpIsValidEvent": 300, - "OpSetUserEventStatus": 301, - "OpCaptureEventProfilingInfo": 302, - "OpGetDefaultQueue": 303, - "OpBuildNDRange": 304, - "OpImageSparseSampleImplicitLod": 305, - "OpImageSparseSampleExplicitLod": 306, - "OpImageSparseSampleDrefImplicitLod": 307, - "OpImageSparseSampleDrefExplicitLod": 308, - "OpImageSparseSampleProjImplicitLod": 309, - "OpImageSparseSampleProjExplicitLod": 310, - "OpImageSparseSampleProjDrefImplicitLod": 311, - "OpImageSparseSampleProjDrefExplicitLod": 312, - "OpImageSparseFetch": 313, - "OpImageSparseGather": 314, - "OpImageSparseDrefGather": 315, - "OpImageSparseTexelsResident": 316, - "OpNoLine": 317, - "OpAtomicFlagTestAndSet": 318, - "OpAtomicFlagClear": 319, - "OpImageSparseRead": 320, - "OpSizeOf": 321, - "OpTypePipeStorage": 322, - "OpConstantPipeStorage": 323, - "OpCreatePipeFromPipeStorage": 324, - "OpGetKernelLocalSizeForSubgroupCount": 325, - "OpGetKernelMaxNumSubgroups": 326, - "OpTypeNamedBarrier": 327, - "OpNamedBarrierInitialize": 328, - "OpMemoryNamedBarrier": 329, - "OpModuleProcessed": 330, - "OpExecutionModeId": 331, - "OpDecorateId": 332, - "OpSubgroupBallotKHR": 4421, - "OpSubgroupFirstInvocationKHR": 4422, - "OpSubgroupAllKHR": 4428, - "OpSubgroupAnyKHR": 4429, - "OpSubgroupAllEqualKHR": 4430, - "OpSubgroupReadInvocationKHR": 4432, - "OpGroupIAddNonUniformAMD": 5000, - "OpGroupFAddNonUniformAMD": 5001, - "OpGroupFMinNonUniformAMD": 5002, - "OpGroupUMinNonUniformAMD": 5003, - "OpGroupSMinNonUniformAMD": 5004, - "OpGroupFMaxNonUniformAMD": 5005, - "OpGroupUMaxNonUniformAMD": 5006, - "OpGroupSMaxNonUniformAMD": 5007, - "OpFragmentMaskFetchAMD": 5011, - "OpFragmentFetchAMD": 5012, - "OpSubgroupShuffleINTEL": 5571, - "OpSubgroupShuffleDownINTEL": 5572, - "OpSubgroupShuffleUpINTEL": 5573, - "OpSubgroupShuffleXorINTEL": 5574, - "OpSubgroupBlockReadINTEL": 5575, - "OpSubgroupBlockWriteINTEL": 5576, - "OpSubgroupImageBlockReadINTEL": 5577, - "OpSubgroupImageBlockWriteINTEL": 5578 - } - } - ] - } -} - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.lua vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.lua --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.lua 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.lua 1970-01-01 00:00:00.000000000 +0000 @@ -1,973 +0,0 @@ --- Copyright (c) 2014-2017 The Khronos Group Inc. --- --- Permission is hereby granted, free of charge, to any person obtaining a copy --- of this software and/or associated documentation files (the "Materials"), --- to deal in the Materials without restriction, including without limitation --- the rights to use, copy, modify, merge, publish, distribute, sublicense, --- and/or sell copies of the Materials, and to permit persons to whom the --- Materials are furnished to do so, subject to the following conditions: --- --- The above copyright notice and this permission notice shall be included in --- all copies or substantial portions of the Materials. --- --- MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS --- STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND --- HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ --- --- THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL --- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING --- FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS --- IN THE MATERIALS. - --- This header is automatically generated by the same tool that creates --- the Binary Section of the SPIR-V specification. - --- Enumeration tokens for SPIR-V, in various styles: --- C, C++, C++11, JSON, Lua, Python --- --- - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL --- - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL --- - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL --- - Lua will use tables, e.g.: spv.SourceLanguage.GLSL --- - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] --- --- Some tokens act like mask values, which can be OR'd together, --- while others are mutually exclusive. The mask-like ones have --- "Mask" in their name, and a parallel enum that has the shift --- amount (1 << x) for each corresponding enumerant. - -spv = { - MagicNumber = 0x07230203, - Version = 0x00010200, - Revision = 2, - OpCodeMask = 0xffff, - WordCountShift = 16, - - SourceLanguage = { - Unknown = 0, - ESSL = 1, - GLSL = 2, - OpenCL_C = 3, - OpenCL_CPP = 4, - HLSL = 5, - }, - - ExecutionModel = { - Vertex = 0, - TessellationControl = 1, - TessellationEvaluation = 2, - Geometry = 3, - Fragment = 4, - GLCompute = 5, - Kernel = 6, - }, - - AddressingModel = { - Logical = 0, - Physical32 = 1, - Physical64 = 2, - }, - - MemoryModel = { - Simple = 0, - GLSL450 = 1, - OpenCL = 2, - }, - - ExecutionMode = { - Invocations = 0, - SpacingEqual = 1, - SpacingFractionalEven = 2, - SpacingFractionalOdd = 3, - VertexOrderCw = 4, - VertexOrderCcw = 5, - PixelCenterInteger = 6, - OriginUpperLeft = 7, - OriginLowerLeft = 8, - EarlyFragmentTests = 9, - PointMode = 10, - Xfb = 11, - DepthReplacing = 12, - DepthGreater = 14, - DepthLess = 15, - DepthUnchanged = 16, - LocalSize = 17, - LocalSizeHint = 18, - InputPoints = 19, - InputLines = 20, - InputLinesAdjacency = 21, - Triangles = 22, - InputTrianglesAdjacency = 23, - Quads = 24, - Isolines = 25, - OutputVertices = 26, - OutputPoints = 27, - OutputLineStrip = 28, - OutputTriangleStrip = 29, - VecTypeHint = 30, - ContractionOff = 31, - Initializer = 33, - Finalizer = 34, - SubgroupSize = 35, - SubgroupsPerWorkgroup = 36, - SubgroupsPerWorkgroupId = 37, - LocalSizeId = 38, - LocalSizeHintId = 39, - PostDepthCoverage = 4446, - StencilRefReplacingEXT = 5027, - }, - - StorageClass = { - UniformConstant = 0, - Input = 1, - Uniform = 2, - Output = 3, - Workgroup = 4, - CrossWorkgroup = 5, - Private = 6, - Function = 7, - Generic = 8, - PushConstant = 9, - AtomicCounter = 10, - Image = 11, - StorageBuffer = 12, - }, - - Dim = { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - Cube = 3, - Rect = 4, - Buffer = 5, - SubpassData = 6, - }, - - SamplerAddressingMode = { - None = 0, - ClampToEdge = 1, - Clamp = 2, - Repeat = 3, - RepeatMirrored = 4, - }, - - SamplerFilterMode = { - Nearest = 0, - Linear = 1, - }, - - ImageFormat = { - Unknown = 0, - Rgba32f = 1, - Rgba16f = 2, - R32f = 3, - Rgba8 = 4, - Rgba8Snorm = 5, - Rg32f = 6, - Rg16f = 7, - R11fG11fB10f = 8, - R16f = 9, - Rgba16 = 10, - Rgb10A2 = 11, - Rg16 = 12, - Rg8 = 13, - R16 = 14, - R8 = 15, - Rgba16Snorm = 16, - Rg16Snorm = 17, - Rg8Snorm = 18, - R16Snorm = 19, - R8Snorm = 20, - Rgba32i = 21, - Rgba16i = 22, - Rgba8i = 23, - R32i = 24, - Rg32i = 25, - Rg16i = 26, - Rg8i = 27, - R16i = 28, - R8i = 29, - Rgba32ui = 30, - Rgba16ui = 31, - Rgba8ui = 32, - R32ui = 33, - Rgb10a2ui = 34, - Rg32ui = 35, - Rg16ui = 36, - Rg8ui = 37, - R16ui = 38, - R8ui = 39, - }, - - ImageChannelOrder = { - R = 0, - A = 1, - RG = 2, - RA = 3, - RGB = 4, - RGBA = 5, - BGRA = 6, - ARGB = 7, - Intensity = 8, - Luminance = 9, - Rx = 10, - RGx = 11, - RGBx = 12, - Depth = 13, - DepthStencil = 14, - sRGB = 15, - sRGBx = 16, - sRGBA = 17, - sBGRA = 18, - ABGR = 19, - }, - - ImageChannelDataType = { - SnormInt8 = 0, - SnormInt16 = 1, - UnormInt8 = 2, - UnormInt16 = 3, - UnormShort565 = 4, - UnormShort555 = 5, - UnormInt101010 = 6, - SignedInt8 = 7, - SignedInt16 = 8, - SignedInt32 = 9, - UnsignedInt8 = 10, - UnsignedInt16 = 11, - UnsignedInt32 = 12, - HalfFloat = 13, - Float = 14, - UnormInt24 = 15, - UnormInt101010_2 = 16, - }, - - ImageOperandsShift = { - Bias = 0, - Lod = 1, - Grad = 2, - ConstOffset = 3, - Offset = 4, - ConstOffsets = 5, - Sample = 6, - MinLod = 7, - }, - - ImageOperandsMask = { - MaskNone = 0, - Bias = 0x00000001, - Lod = 0x00000002, - Grad = 0x00000004, - ConstOffset = 0x00000008, - Offset = 0x00000010, - ConstOffsets = 0x00000020, - Sample = 0x00000040, - MinLod = 0x00000080, - }, - - FPFastMathModeShift = { - NotNaN = 0, - NotInf = 1, - NSZ = 2, - AllowRecip = 3, - Fast = 4, - }, - - FPFastMathModeMask = { - MaskNone = 0, - NotNaN = 0x00000001, - NotInf = 0x00000002, - NSZ = 0x00000004, - AllowRecip = 0x00000008, - Fast = 0x00000010, - }, - - FPRoundingMode = { - RTE = 0, - RTZ = 1, - RTP = 2, - RTN = 3, - }, - - LinkageType = { - Export = 0, - Import = 1, - }, - - AccessQualifier = { - ReadOnly = 0, - WriteOnly = 1, - ReadWrite = 2, - }, - - FunctionParameterAttribute = { - Zext = 0, - Sext = 1, - ByVal = 2, - Sret = 3, - NoAlias = 4, - NoCapture = 5, - NoWrite = 6, - NoReadWrite = 7, - }, - - Decoration = { - RelaxedPrecision = 0, - SpecId = 1, - Block = 2, - BufferBlock = 3, - RowMajor = 4, - ColMajor = 5, - ArrayStride = 6, - MatrixStride = 7, - GLSLShared = 8, - GLSLPacked = 9, - CPacked = 10, - BuiltIn = 11, - NoPerspective = 13, - Flat = 14, - Patch = 15, - Centroid = 16, - Sample = 17, - Invariant = 18, - Restrict = 19, - Aliased = 20, - Volatile = 21, - Constant = 22, - Coherent = 23, - NonWritable = 24, - NonReadable = 25, - Uniform = 26, - SaturatedConversion = 28, - Stream = 29, - Location = 30, - Component = 31, - Index = 32, - Binding = 33, - DescriptorSet = 34, - Offset = 35, - XfbBuffer = 36, - XfbStride = 37, - FuncParamAttr = 38, - FPRoundingMode = 39, - FPFastMathMode = 40, - LinkageAttributes = 41, - NoContraction = 42, - InputAttachmentIndex = 43, - Alignment = 44, - MaxByteOffset = 45, - AlignmentId = 46, - MaxByteOffsetId = 47, - ExplicitInterpAMD = 4999, - OverrideCoverageNV = 5248, - PassthroughNV = 5250, - ViewportRelativeNV = 5252, - SecondaryViewportRelativeNV = 5256, - }, - - BuiltIn = { - Position = 0, - PointSize = 1, - ClipDistance = 3, - CullDistance = 4, - VertexId = 5, - InstanceId = 6, - PrimitiveId = 7, - InvocationId = 8, - Layer = 9, - ViewportIndex = 10, - TessLevelOuter = 11, - TessLevelInner = 12, - TessCoord = 13, - PatchVertices = 14, - FragCoord = 15, - PointCoord = 16, - FrontFacing = 17, - SampleId = 18, - SamplePosition = 19, - SampleMask = 20, - FragDepth = 22, - HelperInvocation = 23, - NumWorkgroups = 24, - WorkgroupSize = 25, - WorkgroupId = 26, - LocalInvocationId = 27, - GlobalInvocationId = 28, - LocalInvocationIndex = 29, - WorkDim = 30, - GlobalSize = 31, - EnqueuedWorkgroupSize = 32, - GlobalOffset = 33, - GlobalLinearId = 34, - SubgroupSize = 36, - SubgroupMaxSize = 37, - NumSubgroups = 38, - NumEnqueuedSubgroups = 39, - SubgroupId = 40, - SubgroupLocalInvocationId = 41, - VertexIndex = 42, - InstanceIndex = 43, - SubgroupEqMaskKHR = 4416, - SubgroupGeMaskKHR = 4417, - SubgroupGtMaskKHR = 4418, - SubgroupLeMaskKHR = 4419, - SubgroupLtMaskKHR = 4420, - BaseVertex = 4424, - BaseInstance = 4425, - DrawIndex = 4426, - DeviceIndex = 4438, - ViewIndex = 4440, - BaryCoordNoPerspAMD = 4992, - BaryCoordNoPerspCentroidAMD = 4993, - BaryCoordNoPerspSampleAMD = 4994, - BaryCoordSmoothAMD = 4995, - BaryCoordSmoothCentroidAMD = 4996, - BaryCoordSmoothSampleAMD = 4997, - BaryCoordPullModelAMD = 4998, - FragStencilRefEXT = 5014, - ViewportMaskNV = 5253, - SecondaryPositionNV = 5257, - SecondaryViewportMaskNV = 5258, - PositionPerViewNV = 5261, - ViewportMaskPerViewNV = 5262, - }, - - SelectionControlShift = { - Flatten = 0, - DontFlatten = 1, - }, - - SelectionControlMask = { - MaskNone = 0, - Flatten = 0x00000001, - DontFlatten = 0x00000002, - }, - - LoopControlShift = { - Unroll = 0, - DontUnroll = 1, - DependencyInfinite = 2, - DependencyLength = 3, - }, - - LoopControlMask = { - MaskNone = 0, - Unroll = 0x00000001, - DontUnroll = 0x00000002, - DependencyInfinite = 0x00000004, - DependencyLength = 0x00000008, - }, - - FunctionControlShift = { - Inline = 0, - DontInline = 1, - Pure = 2, - Const = 3, - }, - - FunctionControlMask = { - MaskNone = 0, - Inline = 0x00000001, - DontInline = 0x00000002, - Pure = 0x00000004, - Const = 0x00000008, - }, - - MemorySemanticsShift = { - Acquire = 1, - Release = 2, - AcquireRelease = 3, - SequentiallyConsistent = 4, - UniformMemory = 6, - SubgroupMemory = 7, - WorkgroupMemory = 8, - CrossWorkgroupMemory = 9, - AtomicCounterMemory = 10, - ImageMemory = 11, - }, - - MemorySemanticsMask = { - MaskNone = 0, - Acquire = 0x00000002, - Release = 0x00000004, - AcquireRelease = 0x00000008, - SequentiallyConsistent = 0x00000010, - UniformMemory = 0x00000040, - SubgroupMemory = 0x00000080, - WorkgroupMemory = 0x00000100, - CrossWorkgroupMemory = 0x00000200, - AtomicCounterMemory = 0x00000400, - ImageMemory = 0x00000800, - }, - - MemoryAccessShift = { - Volatile = 0, - Aligned = 1, - Nontemporal = 2, - }, - - MemoryAccessMask = { - MaskNone = 0, - Volatile = 0x00000001, - Aligned = 0x00000002, - Nontemporal = 0x00000004, - }, - - Scope = { - CrossDevice = 0, - Device = 1, - Workgroup = 2, - Subgroup = 3, - Invocation = 4, - }, - - GroupOperation = { - Reduce = 0, - InclusiveScan = 1, - ExclusiveScan = 2, - }, - - KernelEnqueueFlags = { - NoWait = 0, - WaitKernel = 1, - WaitWorkGroup = 2, - }, - - KernelProfilingInfoShift = { - CmdExecTime = 0, - }, - - KernelProfilingInfoMask = { - MaskNone = 0, - CmdExecTime = 0x00000001, - }, - - Capability = { - Matrix = 0, - Shader = 1, - Geometry = 2, - Tessellation = 3, - Addresses = 4, - Linkage = 5, - Kernel = 6, - Vector16 = 7, - Float16Buffer = 8, - Float16 = 9, - Float64 = 10, - Int64 = 11, - Int64Atomics = 12, - ImageBasic = 13, - ImageReadWrite = 14, - ImageMipmap = 15, - Pipes = 17, - Groups = 18, - DeviceEnqueue = 19, - LiteralSampler = 20, - AtomicStorage = 21, - Int16 = 22, - TessellationPointSize = 23, - GeometryPointSize = 24, - ImageGatherExtended = 25, - StorageImageMultisample = 27, - UniformBufferArrayDynamicIndexing = 28, - SampledImageArrayDynamicIndexing = 29, - StorageBufferArrayDynamicIndexing = 30, - StorageImageArrayDynamicIndexing = 31, - ClipDistance = 32, - CullDistance = 33, - ImageCubeArray = 34, - SampleRateShading = 35, - ImageRect = 36, - SampledRect = 37, - GenericPointer = 38, - Int8 = 39, - InputAttachment = 40, - SparseResidency = 41, - MinLod = 42, - Sampled1D = 43, - Image1D = 44, - SampledCubeArray = 45, - SampledBuffer = 46, - ImageBuffer = 47, - ImageMSArray = 48, - StorageImageExtendedFormats = 49, - ImageQuery = 50, - DerivativeControl = 51, - InterpolationFunction = 52, - TransformFeedback = 53, - GeometryStreams = 54, - StorageImageReadWithoutFormat = 55, - StorageImageWriteWithoutFormat = 56, - MultiViewport = 57, - SubgroupDispatch = 58, - NamedBarrier = 59, - PipeStorage = 60, - SubgroupBallotKHR = 4423, - DrawParameters = 4427, - SubgroupVoteKHR = 4431, - StorageBuffer16BitAccess = 4433, - StorageUniformBufferBlock16 = 4433, - StorageUniform16 = 4434, - UniformAndStorageBuffer16BitAccess = 4434, - StoragePushConstant16 = 4435, - StorageInputOutput16 = 4436, - DeviceGroup = 4437, - MultiView = 4439, - VariablePointersStorageBuffer = 4441, - VariablePointers = 4442, - AtomicStorageOps = 4445, - SampleMaskPostDepthCoverage = 4447, - ImageGatherBiasLodAMD = 5009, - FragmentMaskAMD = 5010, - StencilExportEXT = 5013, - ImageReadWriteLodAMD = 5015, - SampleMaskOverrideCoverageNV = 5249, - GeometryShaderPassthroughNV = 5251, - ShaderViewportIndexLayerEXT = 5254, - ShaderViewportIndexLayerNV = 5254, - ShaderViewportMaskNV = 5255, - ShaderStereoViewNV = 5259, - PerViewAttributesNV = 5260, - SubgroupShuffleINTEL = 5568, - SubgroupBufferBlockIOINTEL = 5569, - SubgroupImageBlockIOINTEL = 5570, - }, - - Op = { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, - OpImageSparseRead = 320, - OpSizeOf = 321, - OpTypePipeStorage = 322, - OpConstantPipeStorage = 323, - OpCreatePipeFromPipeStorage = 324, - OpGetKernelLocalSizeForSubgroupCount = 325, - OpGetKernelMaxNumSubgroups = 326, - OpTypeNamedBarrier = 327, - OpNamedBarrierInitialize = 328, - OpMemoryNamedBarrier = 329, - OpModuleProcessed = 330, - OpExecutionModeId = 331, - OpDecorateId = 332, - OpSubgroupBallotKHR = 4421, - OpSubgroupFirstInvocationKHR = 4422, - OpSubgroupAllKHR = 4428, - OpSubgroupAnyKHR = 4429, - OpSubgroupAllEqualKHR = 4430, - OpSubgroupReadInvocationKHR = 4432, - OpGroupIAddNonUniformAMD = 5000, - OpGroupFAddNonUniformAMD = 5001, - OpGroupFMinNonUniformAMD = 5002, - OpGroupUMinNonUniformAMD = 5003, - OpGroupSMinNonUniformAMD = 5004, - OpGroupFMaxNonUniformAMD = 5005, - OpGroupUMaxNonUniformAMD = 5006, - OpGroupSMaxNonUniformAMD = 5007, - OpFragmentMaskFetchAMD = 5011, - OpFragmentFetchAMD = 5012, - OpSubgroupShuffleINTEL = 5571, - OpSubgroupShuffleDownINTEL = 5572, - OpSubgroupShuffleUpINTEL = 5573, - OpSubgroupShuffleXorINTEL = 5574, - OpSubgroupBlockReadINTEL = 5575, - OpSubgroupBlockWriteINTEL = 5576, - OpSubgroupImageBlockReadINTEL = 5577, - OpSubgroupImageBlockWriteINTEL = 5578, - }, - -} - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.py vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.py --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.py 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/1.2/spirv.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,973 +0,0 @@ -# Copyright (c) 2014-2017 The Khronos Group Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and/or associated documentation files (the "Materials"), -# to deal in the Materials without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Materials, and to permit persons to whom the -# Materials are furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Materials. -# -# MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -# STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -# HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -# -# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -# IN THE MATERIALS. - -# This header is automatically generated by the same tool that creates -# the Binary Section of the SPIR-V specification. - -# Enumeration tokens for SPIR-V, in various styles: -# C, C++, C++11, JSON, Lua, Python -# -# - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -# - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -# - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -# - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -# - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -# -# Some tokens act like mask values, which can be OR'd together, -# while others are mutually exclusive. The mask-like ones have -# "Mask" in their name, and a parallel enum that has the shift -# amount (1 << x) for each corresponding enumerant. - -spv = { - 'MagicNumber' : 0x07230203, - 'Version' : 0x00010200, - 'Revision' : 2, - 'OpCodeMask' : 0xffff, - 'WordCountShift' : 16, - - 'SourceLanguage' : { - 'Unknown' : 0, - 'ESSL' : 1, - 'GLSL' : 2, - 'OpenCL_C' : 3, - 'OpenCL_CPP' : 4, - 'HLSL' : 5, - }, - - 'ExecutionModel' : { - 'Vertex' : 0, - 'TessellationControl' : 1, - 'TessellationEvaluation' : 2, - 'Geometry' : 3, - 'Fragment' : 4, - 'GLCompute' : 5, - 'Kernel' : 6, - }, - - 'AddressingModel' : { - 'Logical' : 0, - 'Physical32' : 1, - 'Physical64' : 2, - }, - - 'MemoryModel' : { - 'Simple' : 0, - 'GLSL450' : 1, - 'OpenCL' : 2, - }, - - 'ExecutionMode' : { - 'Invocations' : 0, - 'SpacingEqual' : 1, - 'SpacingFractionalEven' : 2, - 'SpacingFractionalOdd' : 3, - 'VertexOrderCw' : 4, - 'VertexOrderCcw' : 5, - 'PixelCenterInteger' : 6, - 'OriginUpperLeft' : 7, - 'OriginLowerLeft' : 8, - 'EarlyFragmentTests' : 9, - 'PointMode' : 10, - 'Xfb' : 11, - 'DepthReplacing' : 12, - 'DepthGreater' : 14, - 'DepthLess' : 15, - 'DepthUnchanged' : 16, - 'LocalSize' : 17, - 'LocalSizeHint' : 18, - 'InputPoints' : 19, - 'InputLines' : 20, - 'InputLinesAdjacency' : 21, - 'Triangles' : 22, - 'InputTrianglesAdjacency' : 23, - 'Quads' : 24, - 'Isolines' : 25, - 'OutputVertices' : 26, - 'OutputPoints' : 27, - 'OutputLineStrip' : 28, - 'OutputTriangleStrip' : 29, - 'VecTypeHint' : 30, - 'ContractionOff' : 31, - 'Initializer' : 33, - 'Finalizer' : 34, - 'SubgroupSize' : 35, - 'SubgroupsPerWorkgroup' : 36, - 'SubgroupsPerWorkgroupId' : 37, - 'LocalSizeId' : 38, - 'LocalSizeHintId' : 39, - 'PostDepthCoverage' : 4446, - 'StencilRefReplacingEXT' : 5027, - }, - - 'StorageClass' : { - 'UniformConstant' : 0, - 'Input' : 1, - 'Uniform' : 2, - 'Output' : 3, - 'Workgroup' : 4, - 'CrossWorkgroup' : 5, - 'Private' : 6, - 'Function' : 7, - 'Generic' : 8, - 'PushConstant' : 9, - 'AtomicCounter' : 10, - 'Image' : 11, - 'StorageBuffer' : 12, - }, - - 'Dim' : { - 'Dim1D' : 0, - 'Dim2D' : 1, - 'Dim3D' : 2, - 'Cube' : 3, - 'Rect' : 4, - 'Buffer' : 5, - 'SubpassData' : 6, - }, - - 'SamplerAddressingMode' : { - 'None' : 0, - 'ClampToEdge' : 1, - 'Clamp' : 2, - 'Repeat' : 3, - 'RepeatMirrored' : 4, - }, - - 'SamplerFilterMode' : { - 'Nearest' : 0, - 'Linear' : 1, - }, - - 'ImageFormat' : { - 'Unknown' : 0, - 'Rgba32f' : 1, - 'Rgba16f' : 2, - 'R32f' : 3, - 'Rgba8' : 4, - 'Rgba8Snorm' : 5, - 'Rg32f' : 6, - 'Rg16f' : 7, - 'R11fG11fB10f' : 8, - 'R16f' : 9, - 'Rgba16' : 10, - 'Rgb10A2' : 11, - 'Rg16' : 12, - 'Rg8' : 13, - 'R16' : 14, - 'R8' : 15, - 'Rgba16Snorm' : 16, - 'Rg16Snorm' : 17, - 'Rg8Snorm' : 18, - 'R16Snorm' : 19, - 'R8Snorm' : 20, - 'Rgba32i' : 21, - 'Rgba16i' : 22, - 'Rgba8i' : 23, - 'R32i' : 24, - 'Rg32i' : 25, - 'Rg16i' : 26, - 'Rg8i' : 27, - 'R16i' : 28, - 'R8i' : 29, - 'Rgba32ui' : 30, - 'Rgba16ui' : 31, - 'Rgba8ui' : 32, - 'R32ui' : 33, - 'Rgb10a2ui' : 34, - 'Rg32ui' : 35, - 'Rg16ui' : 36, - 'Rg8ui' : 37, - 'R16ui' : 38, - 'R8ui' : 39, - }, - - 'ImageChannelOrder' : { - 'R' : 0, - 'A' : 1, - 'RG' : 2, - 'RA' : 3, - 'RGB' : 4, - 'RGBA' : 5, - 'BGRA' : 6, - 'ARGB' : 7, - 'Intensity' : 8, - 'Luminance' : 9, - 'Rx' : 10, - 'RGx' : 11, - 'RGBx' : 12, - 'Depth' : 13, - 'DepthStencil' : 14, - 'sRGB' : 15, - 'sRGBx' : 16, - 'sRGBA' : 17, - 'sBGRA' : 18, - 'ABGR' : 19, - }, - - 'ImageChannelDataType' : { - 'SnormInt8' : 0, - 'SnormInt16' : 1, - 'UnormInt8' : 2, - 'UnormInt16' : 3, - 'UnormShort565' : 4, - 'UnormShort555' : 5, - 'UnormInt101010' : 6, - 'SignedInt8' : 7, - 'SignedInt16' : 8, - 'SignedInt32' : 9, - 'UnsignedInt8' : 10, - 'UnsignedInt16' : 11, - 'UnsignedInt32' : 12, - 'HalfFloat' : 13, - 'Float' : 14, - 'UnormInt24' : 15, - 'UnormInt101010_2' : 16, - }, - - 'ImageOperandsShift' : { - 'Bias' : 0, - 'Lod' : 1, - 'Grad' : 2, - 'ConstOffset' : 3, - 'Offset' : 4, - 'ConstOffsets' : 5, - 'Sample' : 6, - 'MinLod' : 7, - }, - - 'ImageOperandsMask' : { - 'MaskNone' : 0, - 'Bias' : 0x00000001, - 'Lod' : 0x00000002, - 'Grad' : 0x00000004, - 'ConstOffset' : 0x00000008, - 'Offset' : 0x00000010, - 'ConstOffsets' : 0x00000020, - 'Sample' : 0x00000040, - 'MinLod' : 0x00000080, - }, - - 'FPFastMathModeShift' : { - 'NotNaN' : 0, - 'NotInf' : 1, - 'NSZ' : 2, - 'AllowRecip' : 3, - 'Fast' : 4, - }, - - 'FPFastMathModeMask' : { - 'MaskNone' : 0, - 'NotNaN' : 0x00000001, - 'NotInf' : 0x00000002, - 'NSZ' : 0x00000004, - 'AllowRecip' : 0x00000008, - 'Fast' : 0x00000010, - }, - - 'FPRoundingMode' : { - 'RTE' : 0, - 'RTZ' : 1, - 'RTP' : 2, - 'RTN' : 3, - }, - - 'LinkageType' : { - 'Export' : 0, - 'Import' : 1, - }, - - 'AccessQualifier' : { - 'ReadOnly' : 0, - 'WriteOnly' : 1, - 'ReadWrite' : 2, - }, - - 'FunctionParameterAttribute' : { - 'Zext' : 0, - 'Sext' : 1, - 'ByVal' : 2, - 'Sret' : 3, - 'NoAlias' : 4, - 'NoCapture' : 5, - 'NoWrite' : 6, - 'NoReadWrite' : 7, - }, - - 'Decoration' : { - 'RelaxedPrecision' : 0, - 'SpecId' : 1, - 'Block' : 2, - 'BufferBlock' : 3, - 'RowMajor' : 4, - 'ColMajor' : 5, - 'ArrayStride' : 6, - 'MatrixStride' : 7, - 'GLSLShared' : 8, - 'GLSLPacked' : 9, - 'CPacked' : 10, - 'BuiltIn' : 11, - 'NoPerspective' : 13, - 'Flat' : 14, - 'Patch' : 15, - 'Centroid' : 16, - 'Sample' : 17, - 'Invariant' : 18, - 'Restrict' : 19, - 'Aliased' : 20, - 'Volatile' : 21, - 'Constant' : 22, - 'Coherent' : 23, - 'NonWritable' : 24, - 'NonReadable' : 25, - 'Uniform' : 26, - 'SaturatedConversion' : 28, - 'Stream' : 29, - 'Location' : 30, - 'Component' : 31, - 'Index' : 32, - 'Binding' : 33, - 'DescriptorSet' : 34, - 'Offset' : 35, - 'XfbBuffer' : 36, - 'XfbStride' : 37, - 'FuncParamAttr' : 38, - 'FPRoundingMode' : 39, - 'FPFastMathMode' : 40, - 'LinkageAttributes' : 41, - 'NoContraction' : 42, - 'InputAttachmentIndex' : 43, - 'Alignment' : 44, - 'MaxByteOffset' : 45, - 'AlignmentId' : 46, - 'MaxByteOffsetId' : 47, - 'ExplicitInterpAMD' : 4999, - 'OverrideCoverageNV' : 5248, - 'PassthroughNV' : 5250, - 'ViewportRelativeNV' : 5252, - 'SecondaryViewportRelativeNV' : 5256, - }, - - 'BuiltIn' : { - 'Position' : 0, - 'PointSize' : 1, - 'ClipDistance' : 3, - 'CullDistance' : 4, - 'VertexId' : 5, - 'InstanceId' : 6, - 'PrimitiveId' : 7, - 'InvocationId' : 8, - 'Layer' : 9, - 'ViewportIndex' : 10, - 'TessLevelOuter' : 11, - 'TessLevelInner' : 12, - 'TessCoord' : 13, - 'PatchVertices' : 14, - 'FragCoord' : 15, - 'PointCoord' : 16, - 'FrontFacing' : 17, - 'SampleId' : 18, - 'SamplePosition' : 19, - 'SampleMask' : 20, - 'FragDepth' : 22, - 'HelperInvocation' : 23, - 'NumWorkgroups' : 24, - 'WorkgroupSize' : 25, - 'WorkgroupId' : 26, - 'LocalInvocationId' : 27, - 'GlobalInvocationId' : 28, - 'LocalInvocationIndex' : 29, - 'WorkDim' : 30, - 'GlobalSize' : 31, - 'EnqueuedWorkgroupSize' : 32, - 'GlobalOffset' : 33, - 'GlobalLinearId' : 34, - 'SubgroupSize' : 36, - 'SubgroupMaxSize' : 37, - 'NumSubgroups' : 38, - 'NumEnqueuedSubgroups' : 39, - 'SubgroupId' : 40, - 'SubgroupLocalInvocationId' : 41, - 'VertexIndex' : 42, - 'InstanceIndex' : 43, - 'SubgroupEqMaskKHR' : 4416, - 'SubgroupGeMaskKHR' : 4417, - 'SubgroupGtMaskKHR' : 4418, - 'SubgroupLeMaskKHR' : 4419, - 'SubgroupLtMaskKHR' : 4420, - 'BaseVertex' : 4424, - 'BaseInstance' : 4425, - 'DrawIndex' : 4426, - 'DeviceIndex' : 4438, - 'ViewIndex' : 4440, - 'BaryCoordNoPerspAMD' : 4992, - 'BaryCoordNoPerspCentroidAMD' : 4993, - 'BaryCoordNoPerspSampleAMD' : 4994, - 'BaryCoordSmoothAMD' : 4995, - 'BaryCoordSmoothCentroidAMD' : 4996, - 'BaryCoordSmoothSampleAMD' : 4997, - 'BaryCoordPullModelAMD' : 4998, - 'FragStencilRefEXT' : 5014, - 'ViewportMaskNV' : 5253, - 'SecondaryPositionNV' : 5257, - 'SecondaryViewportMaskNV' : 5258, - 'PositionPerViewNV' : 5261, - 'ViewportMaskPerViewNV' : 5262, - }, - - 'SelectionControlShift' : { - 'Flatten' : 0, - 'DontFlatten' : 1, - }, - - 'SelectionControlMask' : { - 'MaskNone' : 0, - 'Flatten' : 0x00000001, - 'DontFlatten' : 0x00000002, - }, - - 'LoopControlShift' : { - 'Unroll' : 0, - 'DontUnroll' : 1, - 'DependencyInfinite' : 2, - 'DependencyLength' : 3, - }, - - 'LoopControlMask' : { - 'MaskNone' : 0, - 'Unroll' : 0x00000001, - 'DontUnroll' : 0x00000002, - 'DependencyInfinite' : 0x00000004, - 'DependencyLength' : 0x00000008, - }, - - 'FunctionControlShift' : { - 'Inline' : 0, - 'DontInline' : 1, - 'Pure' : 2, - 'Const' : 3, - }, - - 'FunctionControlMask' : { - 'MaskNone' : 0, - 'Inline' : 0x00000001, - 'DontInline' : 0x00000002, - 'Pure' : 0x00000004, - 'Const' : 0x00000008, - }, - - 'MemorySemanticsShift' : { - 'Acquire' : 1, - 'Release' : 2, - 'AcquireRelease' : 3, - 'SequentiallyConsistent' : 4, - 'UniformMemory' : 6, - 'SubgroupMemory' : 7, - 'WorkgroupMemory' : 8, - 'CrossWorkgroupMemory' : 9, - 'AtomicCounterMemory' : 10, - 'ImageMemory' : 11, - }, - - 'MemorySemanticsMask' : { - 'MaskNone' : 0, - 'Acquire' : 0x00000002, - 'Release' : 0x00000004, - 'AcquireRelease' : 0x00000008, - 'SequentiallyConsistent' : 0x00000010, - 'UniformMemory' : 0x00000040, - 'SubgroupMemory' : 0x00000080, - 'WorkgroupMemory' : 0x00000100, - 'CrossWorkgroupMemory' : 0x00000200, - 'AtomicCounterMemory' : 0x00000400, - 'ImageMemory' : 0x00000800, - }, - - 'MemoryAccessShift' : { - 'Volatile' : 0, - 'Aligned' : 1, - 'Nontemporal' : 2, - }, - - 'MemoryAccessMask' : { - 'MaskNone' : 0, - 'Volatile' : 0x00000001, - 'Aligned' : 0x00000002, - 'Nontemporal' : 0x00000004, - }, - - 'Scope' : { - 'CrossDevice' : 0, - 'Device' : 1, - 'Workgroup' : 2, - 'Subgroup' : 3, - 'Invocation' : 4, - }, - - 'GroupOperation' : { - 'Reduce' : 0, - 'InclusiveScan' : 1, - 'ExclusiveScan' : 2, - }, - - 'KernelEnqueueFlags' : { - 'NoWait' : 0, - 'WaitKernel' : 1, - 'WaitWorkGroup' : 2, - }, - - 'KernelProfilingInfoShift' : { - 'CmdExecTime' : 0, - }, - - 'KernelProfilingInfoMask' : { - 'MaskNone' : 0, - 'CmdExecTime' : 0x00000001, - }, - - 'Capability' : { - 'Matrix' : 0, - 'Shader' : 1, - 'Geometry' : 2, - 'Tessellation' : 3, - 'Addresses' : 4, - 'Linkage' : 5, - 'Kernel' : 6, - 'Vector16' : 7, - 'Float16Buffer' : 8, - 'Float16' : 9, - 'Float64' : 10, - 'Int64' : 11, - 'Int64Atomics' : 12, - 'ImageBasic' : 13, - 'ImageReadWrite' : 14, - 'ImageMipmap' : 15, - 'Pipes' : 17, - 'Groups' : 18, - 'DeviceEnqueue' : 19, - 'LiteralSampler' : 20, - 'AtomicStorage' : 21, - 'Int16' : 22, - 'TessellationPointSize' : 23, - 'GeometryPointSize' : 24, - 'ImageGatherExtended' : 25, - 'StorageImageMultisample' : 27, - 'UniformBufferArrayDynamicIndexing' : 28, - 'SampledImageArrayDynamicIndexing' : 29, - 'StorageBufferArrayDynamicIndexing' : 30, - 'StorageImageArrayDynamicIndexing' : 31, - 'ClipDistance' : 32, - 'CullDistance' : 33, - 'ImageCubeArray' : 34, - 'SampleRateShading' : 35, - 'ImageRect' : 36, - 'SampledRect' : 37, - 'GenericPointer' : 38, - 'Int8' : 39, - 'InputAttachment' : 40, - 'SparseResidency' : 41, - 'MinLod' : 42, - 'Sampled1D' : 43, - 'Image1D' : 44, - 'SampledCubeArray' : 45, - 'SampledBuffer' : 46, - 'ImageBuffer' : 47, - 'ImageMSArray' : 48, - 'StorageImageExtendedFormats' : 49, - 'ImageQuery' : 50, - 'DerivativeControl' : 51, - 'InterpolationFunction' : 52, - 'TransformFeedback' : 53, - 'GeometryStreams' : 54, - 'StorageImageReadWithoutFormat' : 55, - 'StorageImageWriteWithoutFormat' : 56, - 'MultiViewport' : 57, - 'SubgroupDispatch' : 58, - 'NamedBarrier' : 59, - 'PipeStorage' : 60, - 'SubgroupBallotKHR' : 4423, - 'DrawParameters' : 4427, - 'SubgroupVoteKHR' : 4431, - 'StorageBuffer16BitAccess' : 4433, - 'StorageUniformBufferBlock16' : 4433, - 'StorageUniform16' : 4434, - 'UniformAndStorageBuffer16BitAccess' : 4434, - 'StoragePushConstant16' : 4435, - 'StorageInputOutput16' : 4436, - 'DeviceGroup' : 4437, - 'MultiView' : 4439, - 'VariablePointersStorageBuffer' : 4441, - 'VariablePointers' : 4442, - 'AtomicStorageOps' : 4445, - 'SampleMaskPostDepthCoverage' : 4447, - 'ImageGatherBiasLodAMD' : 5009, - 'FragmentMaskAMD' : 5010, - 'StencilExportEXT' : 5013, - 'ImageReadWriteLodAMD' : 5015, - 'SampleMaskOverrideCoverageNV' : 5249, - 'GeometryShaderPassthroughNV' : 5251, - 'ShaderViewportIndexLayerEXT' : 5254, - 'ShaderViewportIndexLayerNV' : 5254, - 'ShaderViewportMaskNV' : 5255, - 'ShaderStereoViewNV' : 5259, - 'PerViewAttributesNV' : 5260, - 'SubgroupShuffleINTEL' : 5568, - 'SubgroupBufferBlockIOINTEL' : 5569, - 'SubgroupImageBlockIOINTEL' : 5570, - }, - - 'Op' : { - 'OpNop' : 0, - 'OpUndef' : 1, - 'OpSourceContinued' : 2, - 'OpSource' : 3, - 'OpSourceExtension' : 4, - 'OpName' : 5, - 'OpMemberName' : 6, - 'OpString' : 7, - 'OpLine' : 8, - 'OpExtension' : 10, - 'OpExtInstImport' : 11, - 'OpExtInst' : 12, - 'OpMemoryModel' : 14, - 'OpEntryPoint' : 15, - 'OpExecutionMode' : 16, - 'OpCapability' : 17, - 'OpTypeVoid' : 19, - 'OpTypeBool' : 20, - 'OpTypeInt' : 21, - 'OpTypeFloat' : 22, - 'OpTypeVector' : 23, - 'OpTypeMatrix' : 24, - 'OpTypeImage' : 25, - 'OpTypeSampler' : 26, - 'OpTypeSampledImage' : 27, - 'OpTypeArray' : 28, - 'OpTypeRuntimeArray' : 29, - 'OpTypeStruct' : 30, - 'OpTypeOpaque' : 31, - 'OpTypePointer' : 32, - 'OpTypeFunction' : 33, - 'OpTypeEvent' : 34, - 'OpTypeDeviceEvent' : 35, - 'OpTypeReserveId' : 36, - 'OpTypeQueue' : 37, - 'OpTypePipe' : 38, - 'OpTypeForwardPointer' : 39, - 'OpConstantTrue' : 41, - 'OpConstantFalse' : 42, - 'OpConstant' : 43, - 'OpConstantComposite' : 44, - 'OpConstantSampler' : 45, - 'OpConstantNull' : 46, - 'OpSpecConstantTrue' : 48, - 'OpSpecConstantFalse' : 49, - 'OpSpecConstant' : 50, - 'OpSpecConstantComposite' : 51, - 'OpSpecConstantOp' : 52, - 'OpFunction' : 54, - 'OpFunctionParameter' : 55, - 'OpFunctionEnd' : 56, - 'OpFunctionCall' : 57, - 'OpVariable' : 59, - 'OpImageTexelPointer' : 60, - 'OpLoad' : 61, - 'OpStore' : 62, - 'OpCopyMemory' : 63, - 'OpCopyMemorySized' : 64, - 'OpAccessChain' : 65, - 'OpInBoundsAccessChain' : 66, - 'OpPtrAccessChain' : 67, - 'OpArrayLength' : 68, - 'OpGenericPtrMemSemantics' : 69, - 'OpInBoundsPtrAccessChain' : 70, - 'OpDecorate' : 71, - 'OpMemberDecorate' : 72, - 'OpDecorationGroup' : 73, - 'OpGroupDecorate' : 74, - 'OpGroupMemberDecorate' : 75, - 'OpVectorExtractDynamic' : 77, - 'OpVectorInsertDynamic' : 78, - 'OpVectorShuffle' : 79, - 'OpCompositeConstruct' : 80, - 'OpCompositeExtract' : 81, - 'OpCompositeInsert' : 82, - 'OpCopyObject' : 83, - 'OpTranspose' : 84, - 'OpSampledImage' : 86, - 'OpImageSampleImplicitLod' : 87, - 'OpImageSampleExplicitLod' : 88, - 'OpImageSampleDrefImplicitLod' : 89, - 'OpImageSampleDrefExplicitLod' : 90, - 'OpImageSampleProjImplicitLod' : 91, - 'OpImageSampleProjExplicitLod' : 92, - 'OpImageSampleProjDrefImplicitLod' : 93, - 'OpImageSampleProjDrefExplicitLod' : 94, - 'OpImageFetch' : 95, - 'OpImageGather' : 96, - 'OpImageDrefGather' : 97, - 'OpImageRead' : 98, - 'OpImageWrite' : 99, - 'OpImage' : 100, - 'OpImageQueryFormat' : 101, - 'OpImageQueryOrder' : 102, - 'OpImageQuerySizeLod' : 103, - 'OpImageQuerySize' : 104, - 'OpImageQueryLod' : 105, - 'OpImageQueryLevels' : 106, - 'OpImageQuerySamples' : 107, - 'OpConvertFToU' : 109, - 'OpConvertFToS' : 110, - 'OpConvertSToF' : 111, - 'OpConvertUToF' : 112, - 'OpUConvert' : 113, - 'OpSConvert' : 114, - 'OpFConvert' : 115, - 'OpQuantizeToF16' : 116, - 'OpConvertPtrToU' : 117, - 'OpSatConvertSToU' : 118, - 'OpSatConvertUToS' : 119, - 'OpConvertUToPtr' : 120, - 'OpPtrCastToGeneric' : 121, - 'OpGenericCastToPtr' : 122, - 'OpGenericCastToPtrExplicit' : 123, - 'OpBitcast' : 124, - 'OpSNegate' : 126, - 'OpFNegate' : 127, - 'OpIAdd' : 128, - 'OpFAdd' : 129, - 'OpISub' : 130, - 'OpFSub' : 131, - 'OpIMul' : 132, - 'OpFMul' : 133, - 'OpUDiv' : 134, - 'OpSDiv' : 135, - 'OpFDiv' : 136, - 'OpUMod' : 137, - 'OpSRem' : 138, - 'OpSMod' : 139, - 'OpFRem' : 140, - 'OpFMod' : 141, - 'OpVectorTimesScalar' : 142, - 'OpMatrixTimesScalar' : 143, - 'OpVectorTimesMatrix' : 144, - 'OpMatrixTimesVector' : 145, - 'OpMatrixTimesMatrix' : 146, - 'OpOuterProduct' : 147, - 'OpDot' : 148, - 'OpIAddCarry' : 149, - 'OpISubBorrow' : 150, - 'OpUMulExtended' : 151, - 'OpSMulExtended' : 152, - 'OpAny' : 154, - 'OpAll' : 155, - 'OpIsNan' : 156, - 'OpIsInf' : 157, - 'OpIsFinite' : 158, - 'OpIsNormal' : 159, - 'OpSignBitSet' : 160, - 'OpLessOrGreater' : 161, - 'OpOrdered' : 162, - 'OpUnordered' : 163, - 'OpLogicalEqual' : 164, - 'OpLogicalNotEqual' : 165, - 'OpLogicalOr' : 166, - 'OpLogicalAnd' : 167, - 'OpLogicalNot' : 168, - 'OpSelect' : 169, - 'OpIEqual' : 170, - 'OpINotEqual' : 171, - 'OpUGreaterThan' : 172, - 'OpSGreaterThan' : 173, - 'OpUGreaterThanEqual' : 174, - 'OpSGreaterThanEqual' : 175, - 'OpULessThan' : 176, - 'OpSLessThan' : 177, - 'OpULessThanEqual' : 178, - 'OpSLessThanEqual' : 179, - 'OpFOrdEqual' : 180, - 'OpFUnordEqual' : 181, - 'OpFOrdNotEqual' : 182, - 'OpFUnordNotEqual' : 183, - 'OpFOrdLessThan' : 184, - 'OpFUnordLessThan' : 185, - 'OpFOrdGreaterThan' : 186, - 'OpFUnordGreaterThan' : 187, - 'OpFOrdLessThanEqual' : 188, - 'OpFUnordLessThanEqual' : 189, - 'OpFOrdGreaterThanEqual' : 190, - 'OpFUnordGreaterThanEqual' : 191, - 'OpShiftRightLogical' : 194, - 'OpShiftRightArithmetic' : 195, - 'OpShiftLeftLogical' : 196, - 'OpBitwiseOr' : 197, - 'OpBitwiseXor' : 198, - 'OpBitwiseAnd' : 199, - 'OpNot' : 200, - 'OpBitFieldInsert' : 201, - 'OpBitFieldSExtract' : 202, - 'OpBitFieldUExtract' : 203, - 'OpBitReverse' : 204, - 'OpBitCount' : 205, - 'OpDPdx' : 207, - 'OpDPdy' : 208, - 'OpFwidth' : 209, - 'OpDPdxFine' : 210, - 'OpDPdyFine' : 211, - 'OpFwidthFine' : 212, - 'OpDPdxCoarse' : 213, - 'OpDPdyCoarse' : 214, - 'OpFwidthCoarse' : 215, - 'OpEmitVertex' : 218, - 'OpEndPrimitive' : 219, - 'OpEmitStreamVertex' : 220, - 'OpEndStreamPrimitive' : 221, - 'OpControlBarrier' : 224, - 'OpMemoryBarrier' : 225, - 'OpAtomicLoad' : 227, - 'OpAtomicStore' : 228, - 'OpAtomicExchange' : 229, - 'OpAtomicCompareExchange' : 230, - 'OpAtomicCompareExchangeWeak' : 231, - 'OpAtomicIIncrement' : 232, - 'OpAtomicIDecrement' : 233, - 'OpAtomicIAdd' : 234, - 'OpAtomicISub' : 235, - 'OpAtomicSMin' : 236, - 'OpAtomicUMin' : 237, - 'OpAtomicSMax' : 238, - 'OpAtomicUMax' : 239, - 'OpAtomicAnd' : 240, - 'OpAtomicOr' : 241, - 'OpAtomicXor' : 242, - 'OpPhi' : 245, - 'OpLoopMerge' : 246, - 'OpSelectionMerge' : 247, - 'OpLabel' : 248, - 'OpBranch' : 249, - 'OpBranchConditional' : 250, - 'OpSwitch' : 251, - 'OpKill' : 252, - 'OpReturn' : 253, - 'OpReturnValue' : 254, - 'OpUnreachable' : 255, - 'OpLifetimeStart' : 256, - 'OpLifetimeStop' : 257, - 'OpGroupAsyncCopy' : 259, - 'OpGroupWaitEvents' : 260, - 'OpGroupAll' : 261, - 'OpGroupAny' : 262, - 'OpGroupBroadcast' : 263, - 'OpGroupIAdd' : 264, - 'OpGroupFAdd' : 265, - 'OpGroupFMin' : 266, - 'OpGroupUMin' : 267, - 'OpGroupSMin' : 268, - 'OpGroupFMax' : 269, - 'OpGroupUMax' : 270, - 'OpGroupSMax' : 271, - 'OpReadPipe' : 274, - 'OpWritePipe' : 275, - 'OpReservedReadPipe' : 276, - 'OpReservedWritePipe' : 277, - 'OpReserveReadPipePackets' : 278, - 'OpReserveWritePipePackets' : 279, - 'OpCommitReadPipe' : 280, - 'OpCommitWritePipe' : 281, - 'OpIsValidReserveId' : 282, - 'OpGetNumPipePackets' : 283, - 'OpGetMaxPipePackets' : 284, - 'OpGroupReserveReadPipePackets' : 285, - 'OpGroupReserveWritePipePackets' : 286, - 'OpGroupCommitReadPipe' : 287, - 'OpGroupCommitWritePipe' : 288, - 'OpEnqueueMarker' : 291, - 'OpEnqueueKernel' : 292, - 'OpGetKernelNDrangeSubGroupCount' : 293, - 'OpGetKernelNDrangeMaxSubGroupSize' : 294, - 'OpGetKernelWorkGroupSize' : 295, - 'OpGetKernelPreferredWorkGroupSizeMultiple' : 296, - 'OpRetainEvent' : 297, - 'OpReleaseEvent' : 298, - 'OpCreateUserEvent' : 299, - 'OpIsValidEvent' : 300, - 'OpSetUserEventStatus' : 301, - 'OpCaptureEventProfilingInfo' : 302, - 'OpGetDefaultQueue' : 303, - 'OpBuildNDRange' : 304, - 'OpImageSparseSampleImplicitLod' : 305, - 'OpImageSparseSampleExplicitLod' : 306, - 'OpImageSparseSampleDrefImplicitLod' : 307, - 'OpImageSparseSampleDrefExplicitLod' : 308, - 'OpImageSparseSampleProjImplicitLod' : 309, - 'OpImageSparseSampleProjExplicitLod' : 310, - 'OpImageSparseSampleProjDrefImplicitLod' : 311, - 'OpImageSparseSampleProjDrefExplicitLod' : 312, - 'OpImageSparseFetch' : 313, - 'OpImageSparseGather' : 314, - 'OpImageSparseDrefGather' : 315, - 'OpImageSparseTexelsResident' : 316, - 'OpNoLine' : 317, - 'OpAtomicFlagTestAndSet' : 318, - 'OpAtomicFlagClear' : 319, - 'OpImageSparseRead' : 320, - 'OpSizeOf' : 321, - 'OpTypePipeStorage' : 322, - 'OpConstantPipeStorage' : 323, - 'OpCreatePipeFromPipeStorage' : 324, - 'OpGetKernelLocalSizeForSubgroupCount' : 325, - 'OpGetKernelMaxNumSubgroups' : 326, - 'OpTypeNamedBarrier' : 327, - 'OpNamedBarrierInitialize' : 328, - 'OpMemoryNamedBarrier' : 329, - 'OpModuleProcessed' : 330, - 'OpExecutionModeId' : 331, - 'OpDecorateId' : 332, - 'OpSubgroupBallotKHR' : 4421, - 'OpSubgroupFirstInvocationKHR' : 4422, - 'OpSubgroupAllKHR' : 4428, - 'OpSubgroupAnyKHR' : 4429, - 'OpSubgroupAllEqualKHR' : 4430, - 'OpSubgroupReadInvocationKHR' : 4432, - 'OpGroupIAddNonUniformAMD' : 5000, - 'OpGroupFAddNonUniformAMD' : 5001, - 'OpGroupFMinNonUniformAMD' : 5002, - 'OpGroupUMinNonUniformAMD' : 5003, - 'OpGroupSMinNonUniformAMD' : 5004, - 'OpGroupFMaxNonUniformAMD' : 5005, - 'OpGroupUMaxNonUniformAMD' : 5006, - 'OpGroupSMaxNonUniformAMD' : 5007, - 'OpFragmentMaskFetchAMD' : 5011, - 'OpFragmentFetchAMD' : 5012, - 'OpSubgroupShuffleINTEL' : 5571, - 'OpSubgroupShuffleDownINTEL' : 5572, - 'OpSubgroupShuffleUpINTEL' : 5573, - 'OpSubgroupShuffleXorINTEL' : 5574, - 'OpSubgroupBlockReadINTEL' : 5575, - 'OpSubgroupBlockWriteINTEL' : 5576, - 'OpSubgroupImageBlockReadINTEL' : 5577, - 'OpSubgroupImageBlockWriteINTEL' : 5578, - }, - -} - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/spir-v.xml vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/spir-v.xml --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/include/spirv/spir-v.xml 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/include/spirv/spir-v.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/LICENSE vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/LICENSE --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/LICENSE 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/LICENSE 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -Copyright (c) 2015-2016 The Khronos Group Inc. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and/or associated documentation files (the -"Materials"), to deal in the Materials without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Materials, and to -permit persons to whom the Materials are furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Materials. - -MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS -KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS -SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT - https://www.khronos.org/registry/ - -THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/README.md vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/README.md --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/external/spirv-headers/README.md 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/external/spirv-headers/README.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,123 +0,0 @@ -# SPIR-V Headers - -This repository contains machine-readable files from the -[SPIR-V Registry](https://www.khronos.org/registry/spir-v/). -This includes: - -* Header files for various languages. -* JSON files describing the grammar for the SPIR-V core instruction set, - and for the GLSL.std.450 extended instruction set. -* The XML registry file. - -Under the [include](include) directory, header files are provided according to -their own version. Only major and minor version numbers count. -For example, the headers for SPIR-V 1.1 are in -[include/spirv/1.1](include/spirv/1.1). Also, the headers for the 1.0 versions -of the GLSL.std.450 and OpenCL extended instruction sets are in -[include/spirv/1.0](include/spirv/1.0). - -In contrast, the XML registry file has a linear history, so it is -not tied to SPIR-V specification versions. - -## How is this repository updated? - -When a new version or revision of the SPIR-V header files are published, -the SPIR Working Group will push new commits onto master, updating -the files under [include](include). -A newer revision of a header file always replaces an older revision of -the same version. For example, verison 1.0 Rev 4 of `spirv.h` is placed in -`include/spirv/1.0/spirv.h` and if there is a Rev 5, then it will be placed -in the same location. - -The SPIR-V XML registry file is updated by the Khronos registrar whenever -a new enum range is allocated. - -In particular, pull requests that update header files will not be accepted. -Issues with the header files should be filed in the [issue -tracker](https://github.com/KhronosGroup/SPIRV-Headers/issues). - -## How to install the headers - -``` -mkdir build -cd build -cmake .. -# Linux -cmake --build . --target install-headers -# Windows -cmake --build . --config Debug --target install-headers -``` - -Then, for example, you will have `/usr/local/include/spirv/1.0/spirv.h` - -If you want to install them somewhere else, then use -`-DCMAKE_INSTALL_PREFIX=/other/path` on the first `cmake` command. - -## Using the headers without installing - -A CMake-based project can use the headers without installing, as follows: - -1. Add an `add_subdirectory` directive to include this source tree. -2. Use `${SPIRV-Headers_SOURCE_DIR}/include}` in a `target_include_directories` - directive. -3. In your C or C++ source code use `#include` directives that explicitly mention - the `spirv` path component. For example the following uses SPIR-V 1.1 - core instructions, and the 1.0 versions of the GLSL.std.450 and OpenCL - extended instructions. -``` -#include "spirv/1.0/GLSL.std.450.h" -#include "spirv/1.0/OpenCL.std.h" -#include "spirv/1.1/spirv.hpp" -``` - -See also the [example](example/) subdirectory. But since that example is -*inside* this repostory, it doesn't use and `add_subdirectory` directive. - -## FAQ - -* *How are different versions published?* - - All versions are present in the master branch of the repository. - They are located in different subdirectories under - [include/spirv](include/spirv), where the subdirectory at that - level encodes the major and minor version number of the relevant spec. - - An application should consciously select the targeted spec version - number, by naming the specific version in its `#include` directives, - as above and in the examples. - -* *How do you handle the evolution of extended instruction sets?* - - Extended instruction sets evolve asynchronously from the core spec. - Right now there is only a single version of both the GLSL and OpenCL - headers. So we don't yet have a problematic example to resolve. - -## License - -``` -Copyright (c) 2015-2016 The Khronos Group Inc. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and/or associated documentation files (the -"Materials"), to deal in the Materials without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Materials, and to -permit persons to whom the Materials are furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Materials. - -MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS -KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS -SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT - https://www.khronos.org/registry/ - -THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -``` diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/.gitattributes vulkan-1.1.73+dfsg/external/spirv-tools/.gitattributes --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/.gitattributes 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/.gitattributes 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -*.json text -*.h text -*.hpp text -*.hpp11 text -*.lua text -*.py text -*.xml diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/include/spirv-tools/libspirv.h vulkan-1.1.73+dfsg/external/spirv-tools/include/spirv-tools/libspirv.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/include/spirv-tools/libspirv.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/include/spirv-tools/libspirv.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,531 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SPIRV_TOOLS_LIBSPIRV_H_ -#define SPIRV_TOOLS_LIBSPIRV_H_ - -#ifdef __cplusplus -extern "C" { -#else -#include -#endif - -#include -#include - -// Helpers - -#define SPV_BIT(shift) (1 << (shift)) - -#define SPV_FORCE_16_BIT_ENUM(name) _##name = 0x7fff -#define SPV_FORCE_32_BIT_ENUM(name) _##name = 0x7fffffff - -// Enumerations - -typedef enum spv_result_t { - SPV_SUCCESS = 0, - SPV_UNSUPPORTED = 1, - SPV_END_OF_STREAM = 2, - SPV_WARNING = 3, - SPV_FAILED_MATCH = 4, - SPV_REQUESTED_TERMINATION = 5, // Success, but signals early termination. - SPV_ERROR_INTERNAL = -1, - SPV_ERROR_OUT_OF_MEMORY = -2, - SPV_ERROR_INVALID_POINTER = -3, - SPV_ERROR_INVALID_BINARY = -4, - SPV_ERROR_INVALID_TEXT = -5, - SPV_ERROR_INVALID_TABLE = -6, - SPV_ERROR_INVALID_VALUE = -7, - SPV_ERROR_INVALID_DIAGNOSTIC = -8, - SPV_ERROR_INVALID_LOOKUP = -9, - SPV_ERROR_INVALID_ID = -10, - SPV_ERROR_INVALID_CFG = -11, - SPV_ERROR_INVALID_LAYOUT = -12, - SPV_ERROR_INVALID_CAPABILITY = -13, - SPV_ERROR_INVALID_DATA = -14, // Indicates data rules validation failure. - SPV_ERROR_MISSING_EXTENSION = -15, - SPV_FORCE_32_BIT_ENUM(spv_result_t) -} spv_result_t; - -// Severity levels of messages communicated to the consumer. -typedef enum spv_message_level_t { - SPV_MSG_FATAL, // Unrecoverable error due to environment. - // Will exit the program immediately. E.g., - // out of memory. - SPV_MSG_INTERNAL_ERROR, // Unrecoverable error due to SPIRV-Tools - // internals. - // Will exit the program immediately. E.g., - // unimplemented feature. - SPV_MSG_ERROR, // Normal error due to user input. - SPV_MSG_WARNING, // Warning information. - SPV_MSG_INFO, // General information. - SPV_MSG_DEBUG, // Debug information. -} spv_message_level_t; - -typedef enum spv_endianness_t { - SPV_ENDIANNESS_LITTLE, - SPV_ENDIANNESS_BIG, - SPV_FORCE_32_BIT_ENUM(spv_endianness_t) -} spv_endianness_t; - -// The kinds of operands that an instruction may have. -// -// Some operand types are "concrete". The binary parser uses a concrete -// operand type to describe an operand of a parsed instruction. -// -// The assembler uses all operand types. In addition to determining what -// kind of value an operand may be, non-concrete operand types capture the -// fact that an operand might be optional (may be absent, or present exactly -// once), or might occur zero or more times. -// -// Sometimes we also need to be able to express the fact that an operand -// is a member of an optional tuple of values. In that case the first member -// would be optional, and the subsequent members would be required. -typedef enum spv_operand_type_t { - // A sentinel value. - SPV_OPERAND_TYPE_NONE = 0, - -#define FIRST_CONCRETE(ENUM) ENUM, SPV_OPERAND_TYPE_FIRST_CONCRETE_TYPE = ENUM -#define LAST_CONCRETE(ENUM) ENUM, SPV_OPERAND_TYPE_LAST_CONCRETE_TYPE = ENUM - - // Set 1: Operands that are IDs. - FIRST_CONCRETE(SPV_OPERAND_TYPE_ID), - SPV_OPERAND_TYPE_TYPE_ID, - SPV_OPERAND_TYPE_RESULT_ID, - SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, // SPIR-V Sec 3.25 - SPV_OPERAND_TYPE_SCOPE_ID, // SPIR-V Sec 3.27 - - // Set 2: Operands that are literal numbers. - SPV_OPERAND_TYPE_LITERAL_INTEGER, // Always unsigned 32-bits. - // The Instruction argument to OpExtInst. It's an unsigned 32-bit literal - // number indicating which instruction to use from an extended instruction - // set. - SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER, - // The Opcode argument to OpSpecConstantOp. It determines the operation - // to be performed on constant operands to compute a specialization constant - // result. - SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER, - // A literal number whose format and size are determined by a previous operand - // in the same instruction. It's a signed integer, an unsigned integer, or a - // floating point number. It also has a specified bit width. The width - // may be larger than 32, which would require such a typed literal value to - // occupy multiple SPIR-V words. - SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER, - - // Set 3: The literal string operand type. - SPV_OPERAND_TYPE_LITERAL_STRING, - - // Set 4: Operands that are a single word enumerated value. - SPV_OPERAND_TYPE_SOURCE_LANGUAGE, // SPIR-V Sec 3.2 - SPV_OPERAND_TYPE_EXECUTION_MODEL, // SPIR-V Sec 3.3 - SPV_OPERAND_TYPE_ADDRESSING_MODEL, // SPIR-V Sec 3.4 - SPV_OPERAND_TYPE_MEMORY_MODEL, // SPIR-V Sec 3.5 - SPV_OPERAND_TYPE_EXECUTION_MODE, // SPIR-V Sec 3.6 - SPV_OPERAND_TYPE_STORAGE_CLASS, // SPIR-V Sec 3.7 - SPV_OPERAND_TYPE_DIMENSIONALITY, // SPIR-V Sec 3.8 - SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE, // SPIR-V Sec 3.9 - SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE, // SPIR-V Sec 3.10 - SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT, // SPIR-V Sec 3.11 - SPV_OPERAND_TYPE_IMAGE_CHANNEL_ORDER, // SPIR-V Sec 3.12 - SPV_OPERAND_TYPE_IMAGE_CHANNEL_DATA_TYPE, // SPIR-V Sec 3.13 - SPV_OPERAND_TYPE_FP_ROUNDING_MODE, // SPIR-V Sec 3.16 - SPV_OPERAND_TYPE_LINKAGE_TYPE, // SPIR-V Sec 3.17 - SPV_OPERAND_TYPE_ACCESS_QUALIFIER, // SPIR-V Sec 3.18 - SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE, // SPIR-V Sec 3.19 - SPV_OPERAND_TYPE_DECORATION, // SPIR-V Sec 3.20 - SPV_OPERAND_TYPE_BUILT_IN, // SPIR-V Sec 3.21 - SPV_OPERAND_TYPE_GROUP_OPERATION, // SPIR-V Sec 3.28 - SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS, // SPIR-V Sec 3.29 - SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO, // SPIR-V Sec 3.30 - SPV_OPERAND_TYPE_CAPABILITY, // SPIR-V Sec 3.31 - -// Set 5: Operands that are a single word bitmask. -// Sometimes a set bit indicates the instruction requires still more operands. -#define FIRST_CONCRETE_MASK(ENUM) \ - ENUM, SPV_OPERAND_TYPE_FIRST_CONCRETE_MASK_TYPE = ENUM - FIRST_CONCRETE_MASK(SPV_OPERAND_TYPE_IMAGE), // SPIR-V Sec 3.14 - SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, // SPIR-V Sec 3.15 - SPV_OPERAND_TYPE_SELECTION_CONTROL, // SPIR-V Sec 3.22 - SPV_OPERAND_TYPE_LOOP_CONTROL, // SPIR-V Sec 3.23 - SPV_OPERAND_TYPE_FUNCTION_CONTROL, // SPIR-V Sec 3.24 - LAST_CONCRETE(SPV_OPERAND_TYPE_MEMORY_ACCESS), // SPIR-V Sec 3.26 - SPV_OPERAND_TYPE_LAST_CONCRETE_MASK_TYPE = - SPV_OPERAND_TYPE_LAST_CONCRETE_TYPE, -#undef FIRST_CONCRETE_MASK -#undef FIRST_CONCRETE -#undef LAST_CONCRETE - -// The remaining operand types are only used internally by the assembler. -// There are two categories: -// Optional : expands to 0 or 1 operand, like ? in regular expressions. -// Variable : expands to 0, 1 or many operands or pairs of operands. -// This is similar to * in regular expressions. - -// Macros for defining bounds on optional and variable operand types. -// Any variable operand type is also optional. -#define FIRST_OPTIONAL(ENUM) ENUM, SPV_OPERAND_TYPE_FIRST_OPTIONAL_TYPE = ENUM -#define FIRST_VARIABLE(ENUM) ENUM, SPV_OPERAND_TYPE_FIRST_VARIABLE_TYPE = ENUM -#define LAST_VARIABLE(ENUM) \ - ENUM, SPV_OPERAND_TYPE_LAST_VARIABLE_TYPE = ENUM, \ - SPV_OPERAND_TYPE_LAST_OPTIONAL_TYPE = ENUM - - // An optional operand represents zero or one logical operands. - // In an instruction definition, this may only appear at the end of the - // operand types. - FIRST_OPTIONAL(SPV_OPERAND_TYPE_OPTIONAL_ID), - // An optional image operand type. - SPV_OPERAND_TYPE_OPTIONAL_IMAGE, - // An optional memory access type. - SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, - // An optional literal integer. - SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER, - // An optional literal number, which may be either integer or floating point. - SPV_OPERAND_TYPE_OPTIONAL_LITERAL_NUMBER, - // Like SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER, but optional, and integral. - SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER, - // An optional literal string. - SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING, - // An optional access qualifier - SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER, - // An optional context-independent value, or CIV. CIVs are tokens that we can - // assemble regardless of where they occur -- literals, IDs, immediate - // integers, etc. - SPV_OPERAND_TYPE_OPTIONAL_CIV, - - // A variable operand represents zero or more logical operands. - // In an instruction definition, this may only appear at the end of the - // operand types. - FIRST_VARIABLE(SPV_OPERAND_TYPE_VARIABLE_ID), - SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER, - // A sequence of zero or more pairs of (typed literal integer, Id). - // Expands to zero or more: - // (SPV_OPERAND_TYPE_TYPED_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID) - // where the literal number must always be an integer of some sort. - SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER_ID, - // A sequence of zero or more pairs of (Id, Literal integer) - LAST_VARIABLE(SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER), - - // This is a sentinel value, and does not represent an operand type. - // It should come last. - SPV_OPERAND_TYPE_NUM_OPERAND_TYPES, - - SPV_FORCE_32_BIT_ENUM(spv_operand_type_t) -} spv_operand_type_t; - -typedef enum spv_ext_inst_type_t { - SPV_EXT_INST_TYPE_NONE = 0, - SPV_EXT_INST_TYPE_GLSL_STD_450, - SPV_EXT_INST_TYPE_OPENCL_STD, - SPV_EXT_INST_TYPE_SPV_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER, - SPV_EXT_INST_TYPE_SPV_AMD_SHADER_TRINARY_MINMAX, - SPV_EXT_INST_TYPE_SPV_AMD_GCN_SHADER, - SPV_EXT_INST_TYPE_SPV_AMD_SHADER_BALLOT, - - SPV_FORCE_32_BIT_ENUM(spv_ext_inst_type_t) -} spv_ext_inst_type_t; - -// This determines at a high level the kind of a binary-encoded literal -// number, but not the bit width. -// In principle, these could probably be folded into new entries in -// spv_operand_type_t. But then we'd have some special case differences -// between the assembler and disassembler. -typedef enum spv_number_kind_t { - SPV_NUMBER_NONE = 0, // The default for value initialization. - SPV_NUMBER_UNSIGNED_INT, - SPV_NUMBER_SIGNED_INT, - SPV_NUMBER_FLOATING, -} spv_number_kind_t; - -typedef enum spv_text_to_binary_options_t { - SPV_TEXT_TO_BINARY_OPTION_NONE = SPV_BIT(0), - // Numeric IDs in the binary will have the same values as in the source. - // Non-numeric IDs are allocated by filling in the gaps, starting with 1 - // and going up. - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS = SPV_BIT(1), - SPV_FORCE_32_BIT_ENUM(spv_text_to_binary_options_t) -} spv_text_to_binary_options_t; - -typedef enum spv_binary_to_text_options_t { - SPV_BINARY_TO_TEXT_OPTION_NONE = SPV_BIT(0), - SPV_BINARY_TO_TEXT_OPTION_PRINT = SPV_BIT(1), - SPV_BINARY_TO_TEXT_OPTION_COLOR = SPV_BIT(2), - SPV_BINARY_TO_TEXT_OPTION_INDENT = SPV_BIT(3), - SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET = SPV_BIT(4), - // Do not output the module header as leading comments in the assembly. - SPV_BINARY_TO_TEXT_OPTION_NO_HEADER = SPV_BIT(5), - // Use friendly names where possible. The heuristic may expand over - // time, but will use common names for scalar types, and debug names from - // OpName instructions. - SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES = SPV_BIT(6), - SPV_FORCE_32_BIT_ENUM(spv_binary_to_text_options_t) -} spv_binary_to_text_options_t; - -// Structures - -// Information about an operand parsed from a binary SPIR-V module. -// Note that the values are not included. You still need access to the binary -// to extract the values. -typedef struct spv_parsed_operand_t { - // Location of the operand, in words from the start of the instruction. - uint16_t offset; - // Number of words occupied by this operand. - uint16_t num_words; - // The "concrete" operand type. See the definition of spv_operand_type_t - // for details. - spv_operand_type_t type; - // If type is a literal number type, then number_kind says whether it's - // a signed integer, an unsigned integer, or a floating point number. - spv_number_kind_t number_kind; - // The number of bits for a literal number type. - uint32_t number_bit_width; -} spv_parsed_operand_t; - -// An instruction parsed from a binary SPIR-V module. -typedef struct spv_parsed_instruction_t { - // An array of words for this instruction, in native endianness. - const uint32_t* words; - // The number of words in this instruction. - uint16_t num_words; - uint16_t opcode; - // The extended instruction type, if opcode is OpExtInst. Otherwise - // this is the "none" value. - spv_ext_inst_type_t ext_inst_type; - // The type id, or 0 if this instruction doesn't have one. - uint32_t type_id; - // The result id, or 0 if this instruction doesn't have one. - uint32_t result_id; - // The array of parsed operands. - const spv_parsed_operand_t* operands; - uint16_t num_operands; -} spv_parsed_instruction_t; - -typedef struct spv_const_binary_t { - const uint32_t* code; - const size_t wordCount; -} spv_const_binary_t; - -typedef struct spv_binary_t { - uint32_t* code; - size_t wordCount; -} spv_binary_t; - -typedef struct spv_text_t { - const char* str; - size_t length; -} spv_text_t; - -typedef struct spv_position_t { - size_t line; - size_t column; - size_t index; -} spv_position_t; - -typedef struct spv_diagnostic_t { - spv_position_t position; - char* error; - bool isTextSource; -} spv_diagnostic_t; - -// Opaque struct containing the context used to operate on a SPIR-V module. -// Its object is used by various translation API functions. -typedef struct spv_context_t spv_context_t; - -typedef struct spv_validator_options_t spv_validator_options_t; - -// Type Definitions - -typedef spv_const_binary_t* spv_const_binary; -typedef spv_binary_t* spv_binary; -typedef spv_text_t* spv_text; -typedef spv_position_t* spv_position; -typedef spv_diagnostic_t* spv_diagnostic; -typedef const spv_context_t* spv_const_context; -typedef spv_context_t* spv_context; -typedef spv_validator_options_t* spv_validator_options; -typedef const spv_validator_options_t* spv_const_validator_options; - -// Platform API - -// Returns the SPIRV-Tools software version as a null-terminated string. -// The contents of the underlying storage is valid for the remainder of -// the process. -const char* spvSoftwareVersionString(); -// Returns a null-terminated string containing the name of the project, -// the software version string, and commit details. -// The contents of the underlying storage is valid for the remainder of -// the process. -const char* spvSoftwareVersionDetailsString(); - -// Certain target environments impose additional restrictions on SPIR-V, so it's -// often necessary to specify which one applies. SPV_ENV_UNIVERSAL means -// environment-agnostic SPIR-V. -typedef enum { - SPV_ENV_UNIVERSAL_1_0, // SPIR-V 1.0 latest revision, no other restrictions. - SPV_ENV_VULKAN_1_0, // Vulkan 1.0 latest revision. - SPV_ENV_UNIVERSAL_1_1, // SPIR-V 1.1 latest revision, no other restrictions. - SPV_ENV_OPENCL_2_1, // OpenCL 2.1 latest revision. - SPV_ENV_OPENCL_2_2, // OpenCL 2.2 latest revision. - SPV_ENV_OPENGL_4_0, // OpenGL 4.0 plus GL_ARB_gl_spirv, latest revisions. - SPV_ENV_OPENGL_4_1, // OpenGL 4.1 plus GL_ARB_gl_spirv, latest revisions. - SPV_ENV_OPENGL_4_2, // OpenGL 4.2 plus GL_ARB_gl_spirv, latest revisions. - SPV_ENV_OPENGL_4_3, // OpenGL 4.3 plus GL_ARB_gl_spirv, latest revisions. - // There is no variant for OpenGL 4.4. - SPV_ENV_OPENGL_4_5, // OpenGL 4.5 plus GL_ARB_gl_spirv, latest revisions. - SPV_ENV_UNIVERSAL_1_2, // SPIR-V 1.2, latest revision, no other restrictions. -} spv_target_env; - -// SPIR-V Validator can be parameterized with the following Universal Limits. -typedef enum { - spv_validator_limit_max_struct_members, - spv_validator_limit_max_struct_depth, - spv_validator_limit_max_local_variables, - spv_validator_limit_max_global_variables, - spv_validator_limit_max_switch_branches, - spv_validator_limit_max_function_args, - spv_validator_limit_max_control_flow_nesting_depth, - spv_validator_limit_max_access_chain_indexes, -} spv_validator_limit; - -// Returns a string describing the given SPIR-V target environment. -const char* spvTargetEnvDescription(spv_target_env env); - -// Creates a context object. Returns null if env is invalid. -spv_context spvContextCreate(spv_target_env env); - -// Destroys the given context object. -void spvContextDestroy(spv_context context); - -// Creates a Validator options object with default options. Returns a valid -// options object. The object remains valid until it is passed into -// spvValidatorOptionsDestroy. -spv_validator_options spvValidatorOptionsCreate(); - -// Destroys the given Validator options object. -void spvValidatorOptionsDestroy(spv_validator_options options); - -// Records the maximum Universal Limit that is considered valid in the given -// Validator options object. argument must be a valid options object. -void spvValidatorOptionsSetUniversalLimit(spv_validator_options options, - spv_validator_limit limit_type, - uint32_t limit); - -// Encodes the given SPIR-V assembly text to its binary representation. The -// length parameter specifies the number of bytes for text. Encoded binary will -// be stored into *binary. Any error will be written into *diagnostic if -// diagnostic is non-null. The generated binary is independent of the context -// and may outlive it. -spv_result_t spvTextToBinary(const spv_const_context context, const char* text, - const size_t length, spv_binary* binary, - spv_diagnostic* diagnostic); - -// Encodes the given SPIR-V assembly text to its binary representation. Same as -// spvTextToBinary but with options. The options parameter is a bit field of -// spv_text_to_binary_options_t. -spv_result_t spvTextToBinaryWithOptions( - const spv_const_context context, const char* text, const size_t length, - const uint32_t options, spv_binary* binary, spv_diagnostic* diagnostic); - -// Frees an allocated text stream. This is a no-op if the text parameter -// is a null pointer. -void spvTextDestroy(spv_text text); - -// Decodes the given SPIR-V binary representation to its assembly text. The -// word_count parameter specifies the number of words for binary. The options -// parameter is a bit field of spv_binary_to_text_options_t. Decoded text will -// be stored into *text. Any error will be written into *diagnostic if -// diagnostic is non-null. -spv_result_t spvBinaryToText(const spv_const_context context, - const uint32_t* binary, const size_t word_count, - const uint32_t options, spv_text* text, - spv_diagnostic* diagnostic); - -// Frees a binary stream from memory. This is a no-op if binary is a null -// pointer. -void spvBinaryDestroy(spv_binary binary); - -// Validates a SPIR-V binary for correctness. Any errors will be written into -// *diagnostic if diagnostic is non-null. -spv_result_t spvValidate(const spv_const_context context, - const spv_const_binary binary, - spv_diagnostic* diagnostic); - -// Validates a SPIR-V binary for correctness. Uses the provided Validator -// options. Any errors will be written into *diagnostic if diagnostic is -// non-null. -spv_result_t spvValidateWithOptions(const spv_const_context context, - const spv_const_validator_options options, - const spv_const_binary binary, - spv_diagnostic* diagnostic); - -// Validates a raw SPIR-V binary for correctness. Any errors will be written -// into *diagnostic if diagnostic is non-null. -spv_result_t spvValidateBinary(const spv_const_context context, - const uint32_t* words, const size_t num_words, - spv_diagnostic* diagnostic); - -// Creates a diagnostic object. The position parameter specifies the location in -// the text/binary stream. The message parameter, copied into the diagnostic -// object, contains the error message to display. -spv_diagnostic spvDiagnosticCreate(const spv_position position, - const char* message); - -// Destroys a diagnostic object. This is a no-op if diagnostic is a null -// pointer. -void spvDiagnosticDestroy(spv_diagnostic diagnostic); - -// Prints the diagnostic to stderr. -spv_result_t spvDiagnosticPrint(const spv_diagnostic diagnostic); - -// The binary parser interface. - -// A pointer to a function that accepts a parsed SPIR-V header. -// The integer arguments are the 32-bit words from the header, as specified -// in SPIR-V 1.0 Section 2.3 Table 1. -// The function should return SPV_SUCCESS if parsing should continue. -typedef spv_result_t (*spv_parsed_header_fn_t)( - void* user_data, spv_endianness_t endian, uint32_t magic, uint32_t version, - uint32_t generator, uint32_t id_bound, uint32_t reserved); - -// A pointer to a function that accepts a parsed SPIR-V instruction. -// The parsed_instruction value is transient: it may be overwritten -// or released immediately after the function has returned. That also -// applies to the words array member of the parsed instruction. The -// function should return SPV_SUCCESS if and only if parsing should -// continue. -typedef spv_result_t (*spv_parsed_instruction_fn_t)( - void* user_data, const spv_parsed_instruction_t* parsed_instruction); - -// Parses a SPIR-V binary, specified as counted sequence of 32-bit words. -// Parsing feedback is provided via two callbacks provided as function -// pointers. Each callback function pointer can be a null pointer, in -// which case it is never called. Otherwise, in a valid parse the -// parsed-header callback is called once, and then the parsed-instruction -// callback once for each instruction in the stream. The user_data parameter -// is supplied as context to the callbacks. Returns SPV_SUCCESS on successful -// parse where the callbacks always return SPV_SUCCESS. For an invalid parse, -// returns a status code other than SPV_SUCCESS, and if diagnostic is non-null -// also emits a diagnostic. If a callback returns anything other than -// SPV_SUCCESS, then that status code is returned, no further callbacks are -// issued, and no additional diagnostics are emitted. -spv_result_t spvBinaryParse(const spv_const_context context, void* user_data, - const uint32_t* words, const size_t num_words, - spv_parsed_header_fn_t parse_header, - spv_parsed_instruction_fn_t parse_instruction, - spv_diagnostic* diagnostic); - -#ifdef __cplusplus -} -#endif - -#endif // SPIRV_TOOLS_LIBSPIRV_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/include/spirv-tools/libspirv.hpp vulkan-1.1.73+dfsg/external/spirv-tools/include/spirv-tools/libspirv.hpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/include/spirv-tools/libspirv.hpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/include/spirv-tools/libspirv.hpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,127 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SPIRV_TOOLS_LIBSPIRV_HPP_ -#define SPIRV_TOOLS_LIBSPIRV_HPP_ - -#include -#include -#include -#include - -#include "spirv-tools/libspirv.h" - -namespace spvtools { - -// Message consumer. The C strings for source and message are only alive for the -// specific invocation. -using MessageConsumer = std::function; - -// A RAII wrapper around a validator options object. -class ValidatorOptions { - public: - ValidatorOptions() : options_(spvValidatorOptionsCreate()) {} - ~ValidatorOptions() { spvValidatorOptionsDestroy(options_); } - // Allow implicit conversion to the underlying object. - operator spv_validator_options() const { return options_; } - - // Sets a limit. - void SetUniversalLimit(spv_validator_limit limit_type, uint32_t limit) { - spvValidatorOptionsSetUniversalLimit(options_, limit_type, limit); - } - - private: - spv_validator_options options_; -}; - -// C++ interface for SPIRV-Tools functionalities. It wraps the context -// (including target environment and the corresponding SPIR-V grammar) and -// provides methods for assembling, disassembling, and validating. -// -// Instances of this class provide basic thread-safety guarantee. -class SpirvTools { - public: - enum { - // Default assembling option used by assemble(): - kDefaultAssembleOption = SPV_TEXT_TO_BINARY_OPTION_NONE, - - // Default disassembling option used by Disassemble(): - // * Avoid prefix comments from decoding the SPIR-V module header, and - // * Use friendly names for variables. - kDefaultDisassembleOption = SPV_BINARY_TO_TEXT_OPTION_NO_HEADER | - SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES - }; - - // Constructs an instance targeting the given environment |env|. - // - // The constructed instance will have an empty message consumer, which just - // ignores all messages from the library. Use SetMessageConsumer() to supply - // one if messages are of concern. - explicit SpirvTools(spv_target_env env); - - // Disables copy/move constructor/assignment operations. - SpirvTools(const SpirvTools&) = delete; - SpirvTools(SpirvTools&&) = delete; - SpirvTools& operator=(const SpirvTools&) = delete; - SpirvTools& operator=(SpirvTools&&) = delete; - - // Destructs this instance. - ~SpirvTools(); - - // Sets the message consumer to the given |consumer|. The |consumer| will be - // invoked once for each message communicated from the library. - void SetMessageConsumer(MessageConsumer consumer); - - // Assembles the given assembly |text| and writes the result to |binary|. - // Returns true on successful assembling. |binary| will be kept untouched if - // assembling is unsuccessful. - bool Assemble(const std::string& text, std::vector* binary, - uint32_t options = kDefaultAssembleOption) const; - // |text_size| specifies the number of bytes in |text|. A terminating null - // character is not required to present in |text| as long as |text| is valid. - bool Assemble(const char* text, size_t text_size, - std::vector* binary, - uint32_t options = kDefaultAssembleOption) const; - - // Disassembles the given SPIR-V |binary| with the given |options| and writes - // the assembly to |text|. Returns ture on successful disassembling. |text| - // will be kept untouched if diassembling is unsuccessful. - bool Disassemble(const std::vector& binary, std::string* text, - uint32_t options = kDefaultDisassembleOption) const; - // |binary_size| specifies the number of words in |binary|. - bool Disassemble(const uint32_t* binary, size_t binary_size, - std::string* text, - uint32_t options = kDefaultDisassembleOption) const; - - // Validates the given SPIR-V |binary|. Returns true if no issues are found. - // Otherwise, returns false and communicates issues via the message consumer - // registered. - bool Validate(const std::vector& binary) const; - // |binary_size| specifies the number of words in |binary|. - bool Validate(const uint32_t* binary, size_t binary_size) const; - // Like the previous overload, but takes an options object. - bool Validate(const uint32_t* binary, size_t binary_size, - const ValidatorOptions& options) const; - - private: - struct Impl; // Opaque struct for holding the data fields used by this class. - std::unique_ptr impl_; // Unique pointer to implementation data. -}; - -} // namespace spvtools - -#endif // SPIRV_TOOLS_LIBSPIRV_HPP_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/include/spirv-tools/linker.hpp vulkan-1.1.73+dfsg/external/spirv-tools/include/spirv-tools/linker.hpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/include/spirv-tools/linker.hpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/include/spirv-tools/linker.hpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,98 +0,0 @@ -// Copyright (c) 2017 Pierre Moreau -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SPIRV_TOOLS_LINKER_HPP_ -#define SPIRV_TOOLS_LINKER_HPP_ - -#include - -#include -#include - -#include "libspirv.hpp" - -namespace spvtools { - -class LinkerOptions { - public: - LinkerOptions() : createLibrary_(false) {} - - // Returns whether a library or an executable should be produced by the - // linking phase. - // - // All exported symbols are kept when creating a library, whereas they will - // be removed when creating an executable. - // The returned value will be true if creating a library, and false if - // creating an executable. - bool GetCreateLibrary() const { return createLibrary_; } - // Sets whether a library or an executable should be produced. - void SetCreateLibrary(bool create_library) { - createLibrary_ = create_library; - } - - private: - bool createLibrary_; -}; - -class Linker { - public: - // Constructs an instance targeting the given environment |env|. - // - // The constructed instance will have an empty message consumer, which just - // ignores all messages from the library. Use SetMessageConsumer() to supply - // one if messages are of concern. - explicit Linker(spv_target_env env); - - // Disables copy/move constructor/assignment operations. - Linker(const Linker&) = delete; - Linker(Linker&&) = delete; - Linker& operator=(const Linker&) = delete; - Linker& operator=(Linker&&) = delete; - - // Destructs this instance. - ~Linker(); - - // Sets the message consumer to the given |consumer|. The |consumer| will be - // invoked once for each message communicated from the library. - void SetMessageConsumer(MessageConsumer consumer); - - // Links one or more SPIR-V modules into a new SPIR-V module. That is, - // combine several SPIR-V modules into one, resolving link dependencies - // between them. - // - // At least one binary has to be provided in |binaries|. Those binaries do - // not have to be valid, but they should be at least parseable. - // The functions can fail due to the following: - // * No input modules were given; - // * One or more of those modules were not parseable; - // * The input modules used different addressing or memory models; - // * The ID or global variable number limit were exceeded; - // * Some entry points were defined multiple times; - // * Some imported symbols did not have an exported counterpart; - // * Possibly other reasons. - spv_result_t Link(const std::vector>& binaries, - std::vector& linked_binary, - const LinkerOptions& options = LinkerOptions()) const; - spv_result_t Link(const uint32_t* const* binaries, const size_t* binary_sizes, - size_t num_binaries, std::vector& linked_binary, - const LinkerOptions& options = LinkerOptions()) const; - - private: - struct Impl; // Opaque struct for holding the data fields used by this class. - std::unique_ptr impl_; // Unique pointer to implementation data. -}; - -} // namespace spvtools - -#endif // SPIRV_TOOLS_LINKER_HPP_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/include/spirv-tools/markv.h vulkan-1.1.73+dfsg/external/spirv-tools/include/spirv-tools/markv.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/include/spirv-tools/markv.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/include/spirv-tools/markv.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// MARK-V is a compression format for SPIR-V binaries. It strips away -// non-essential information (such as result ids which can be regenerated) and -// uses various bit reduction techiniques to reduce the size of the binary. -// -// WIP: MARK-V codec is in early stages of development. At the moment it only -// can encode and decode some SPIR-V files and only if exacly the same build of -// software is used (is doesn't write or handle version numbers yet). - -#ifndef SPIRV_TOOLS_MARKV_H_ -#define SPIRV_TOOLS_MARKV_H_ - -#include "libspirv.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct spv_markv_binary_t { - uint8_t* data; - size_t length; -} spv_markv_binary_t; - -typedef spv_markv_binary_t* spv_markv_binary; -typedef const spv_markv_binary_t* const_spv_markv_binary; - -typedef struct spv_markv_encoder_options_t spv_markv_encoder_options_t; -typedef spv_markv_encoder_options_t* spv_markv_encoder_options; -typedef const spv_markv_encoder_options_t* spv_const_markv_encoder_options; - -typedef struct spv_markv_decoder_options_t spv_markv_decoder_options_t; -typedef spv_markv_decoder_options_t* spv_markv_decoder_options; -typedef const spv_markv_decoder_options_t* spv_const_markv_decoder_options; - -// Creates spv_markv_encoder_options with default options. Returns a valid -// options object. The object remains valid until it is passed into -// spvMarkvEncoderOptionsDestroy. -spv_markv_encoder_options spvMarkvEncoderOptionsCreate(); - -// Destroys the given spv_markv_encoder_options object. -void spvMarkvEncoderOptionsDestroy(spv_markv_encoder_options options); - -// Creates spv_markv_decoder_options with default options. Returns a valid -// options object. The object remains valid until it is passed into -// spvMarkvDecoderOptionsDestroy. -spv_markv_decoder_options spvMarkvDecoderOptionsCreate(); - -// Destroys the given spv_markv_decoder_options object. -void spvMarkvDecoderOptionsDestroy(spv_markv_decoder_options options); - -// Encodes the given SPIR-V binary to MARK-V binary. -// If |comments| is not nullptr, it would contain a textual description of -// how encoding was done (with snippets of disassembly and bit sequences). -spv_result_t spvSpirvToMarkv(spv_const_context context, - const uint32_t* spirv_words, - size_t spirv_num_words, - spv_const_markv_encoder_options options, - spv_markv_binary* markv_binary, - spv_text* comments, spv_diagnostic* diagnostic); - -// Decodes a SPIR-V binary from the given MARK-V binary. -// If |comments| is not nullptr, it would contain a textual description of -// how decoding was done (with snippets of disassembly and bit sequences). -spv_result_t spvMarkvToSpirv(spv_const_context context, - const uint8_t* markv_data, - size_t markv_size_bytes, - spv_const_markv_decoder_options options, - spv_binary* spirv_binary, - spv_text* comments, spv_diagnostic* diagnostic); - -// Destroys MARK-V binary created by spvSpirvToMarkv(). -void spvMarkvBinaryDestroy(spv_markv_binary binary); - -#ifdef __cplusplus -} -#endif - -#endif // SPIRV_TOOLS_MARKV_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/include/spirv-tools/optimizer.hpp vulkan-1.1.73+dfsg/external/spirv-tools/include/spirv-tools/optimizer.hpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/include/spirv-tools/optimizer.hpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/include/spirv-tools/optimizer.hpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,411 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SPIRV_TOOLS_OPTIMIZER_HPP_ -#define SPIRV_TOOLS_OPTIMIZER_HPP_ - -#include -#include -#include -#include - -#include "libspirv.hpp" - -namespace spvtools { - -// C++ interface for SPIR-V optimization functionalities. It wraps the context -// (including target environment and the corresponding SPIR-V grammar) and -// provides methods for registering optimization passes and optimizing. -// -// Instances of this class provides basic thread-safety guarantee. -class Optimizer { - public: - // The token for an optimization pass. It is returned via one of the - // Create*Pass() standalone functions at the end of this header file and - // consumed by the RegisterPass() method. Tokens are one-time objects that - // only support move; copying is not allowed. - struct PassToken { - struct Impl; // Opaque struct for holding inernal data. - - PassToken(std::unique_ptr); - - // Tokens can only be moved. Copying is disabled. - PassToken(const PassToken&) = delete; - PassToken(PassToken&&); - PassToken& operator=(const PassToken&) = delete; - PassToken& operator=(PassToken&&); - - ~PassToken(); - - std::unique_ptr impl_; // Unique pointer to internal data. - }; - - // Constructs an instance with the given target |env|, which is used to decode - // the binaries to be optimized later. - // - // The constructed instance will have an empty message consumer, which just - // ignores all messages from the library. Use SetMessageConsumer() to supply - // one if messages are of concern. - explicit Optimizer(spv_target_env env); - - // Disables copy/move constructor/assignment operations. - Optimizer(const Optimizer&) = delete; - Optimizer(Optimizer&&) = delete; - Optimizer& operator=(const Optimizer&) = delete; - Optimizer& operator=(Optimizer&&) = delete; - - // Destructs this instance. - ~Optimizer(); - - // Sets the message consumer to the given |consumer|. The |consumer| will be - // invoked once for each message communicated from the library. - void SetMessageConsumer(MessageConsumer consumer); - - // Registers the given |pass| to this optimizer. Passes will be run in the - // exact order of registration. The token passed in will be consumed by this - // method. - Optimizer& RegisterPass(PassToken&& pass); - - // Registers passes that attempt to improve performance of generated code. - // This sequence of passes is subject to constant review and will change - // from time to time. - Optimizer& RegisterPerformancePasses(); - - // Registers passes that attempt to improve the size of generated code. - // This sequence of passes is subject to constant review and will change - // from time to time. - Optimizer& RegisterSizePasses(); - - // Optimizes the given SPIR-V module |original_binary| and writes the - // optimized binary into |optimized_binary|. - // Returns true on successful optimization, whether or not the module is - // modified. Returns false if errors occur when processing |original_binary| - // using any of the registered passes. In that case, no further passes are - // executed and the contents in |optimized_binary| may be invalid. - // - // It's allowed to alias |original_binary| to the start of |optimized_binary|. - bool Run(const uint32_t* original_binary, size_t original_binary_size, - std::vector* optimized_binary) const; - - // Returns a vector of strings with all the pass names added to this - // optimizer's pass manager. These strings are valid until the associated - // pass manager is destroyed. - std::vector GetPassNames() const; - - private: - struct Impl; // Opaque struct for holding internal data. - std::unique_ptr impl_; // Unique pointer to internal data. -}; - -// Creates a null pass. -// A null pass does nothing to the SPIR-V module to be optimized. -Optimizer::PassToken CreateNullPass(); - -// Creates a strip-debug-info pass. -// A strip-debug-info pass removes all debug instructions (as documented in -// Section 3.32.2 of the SPIR-V spec) of the SPIR-V module to be optimized. -Optimizer::PassToken CreateStripDebugInfoPass(); - -// Creates an eliminate-dead-functions pass. -// An eliminate-dead-functions pass will remove all functions that are not in -// the call trees rooted at entry points and exported functions. These -// functions are not needed because they will never be called. -Optimizer::PassToken CreateEliminateDeadFunctionsPass(); - -// Creates a set-spec-constant-default-value pass from a mapping from spec-ids -// to the default values in the form of string. -// A set-spec-constant-default-value pass sets the default values for the -// spec constants that have SpecId decorations (i.e., those defined by -// OpSpecConstant{|True|False} instructions). -Optimizer::PassToken CreateSetSpecConstantDefaultValuePass( - const std::unordered_map& id_value_map); - -// Creates a set-spec-constant-default-value pass from a mapping from spec-ids -// to the default values in the form of bit pattern. -// A set-spec-constant-default-value pass sets the default values for the -// spec constants that have SpecId decorations (i.e., those defined by -// OpSpecConstant{|True|False} instructions). -Optimizer::PassToken CreateSetSpecConstantDefaultValuePass( - const std::unordered_map>& id_value_map); - -// Creates a flatten-decoration pass. -// A flatten-decoration pass replaces grouped decorations with equivalent -// ungrouped decorations. That is, it replaces each OpDecorationGroup -// instruction and associated OpGroupDecorate and OpGroupMemberDecorate -// instructions with equivalent OpDecorate and OpMemberDecorate instructions. -// The pass does not attempt to preserve debug information for instructions -// it removes. -Optimizer::PassToken CreateFlattenDecorationPass(); - -// Creates a freeze-spec-constant-value pass. -// A freeze-spec-constant pass specializes the value of spec constants to -// their default values. This pass only processes the spec constants that have -// SpecId decorations (defined by OpSpecConstant, OpSpecConstantTrue, or -// OpSpecConstantFalse instructions) and replaces them with their normal -// counterparts (OpConstant, OpConstantTrue, or OpConstantFalse). The -// corresponding SpecId annotation instructions will also be removed. This -// pass does not fold the newly added normal constants and does not process -// other spec constants defined by OpSpecConstantComposite or -// OpSpecConstantOp. -Optimizer::PassToken CreateFreezeSpecConstantValuePass(); - -// Creates a fold-spec-constant-op-and-composite pass. -// A fold-spec-constant-op-and-composite pass folds spec constants defined by -// OpSpecConstantOp or OpSpecConstantComposite instruction, to normal Constants -// defined by OpConstantTrue, OpConstantFalse, OpConstant, OpConstantNull, or -// OpConstantComposite instructions. Note that spec constants defined with -// OpSpecConstant, OpSpecConstantTrue, or OpSpecConstantFalse instructions are -// not handled, as these instructions indicate their value are not determined -// and can be changed in future. A spec constant is foldable if all of its -// value(s) can be determined from the module. E.g., an integer spec constant -// defined with OpSpecConstantOp instruction can be folded if its value won't -// change later. This pass will replace the original OpSpecContantOp instruction -// with an OpConstant instruction. When folding composite spec constants, -// new instructions may be inserted to define the components of the composite -// constant first, then the original spec constants will be replaced by -// OpConstantComposite instructions. -// -// There are some operations not supported yet: -// OpSConvert, OpFConvert, OpQuantizeToF16 and -// all the operations under Kernel capability. -// TODO(qining): Add support for the operations listed above. -Optimizer::PassToken CreateFoldSpecConstantOpAndCompositePass(); - -// Creates a unify-constant pass. -// A unify-constant pass de-duplicates the constants. Constants with the exact -// same value and identical form will be unified and only one constant will -// be kept for each unique pair of type and value. -// There are several cases not handled by this pass: -// 1) Constants defined by OpConstantNull instructions (null constants) and -// constants defined by OpConstantFalse, OpConstant or OpConstantComposite -// with value 0 (zero-valued normal constants) are not considered equivalent. -// So null constants won't be used to replace zero-valued normal constants, -// vice versa. -// 2) Whenever there are decorations to the constant's result id id, the -// constant won't be handled, which means, it won't be used to replace any -// other constants, neither can other constants replace it. -// 3) NaN in float point format with different bit patterns are not unified. -Optimizer::PassToken CreateUnifyConstantPass(); - -// Creates a eliminate-dead-constant pass. -// A eliminate-dead-constant pass removes dead constants, including normal -// contants defined by OpConstant, OpConstantComposite, OpConstantTrue, or -// OpConstantFalse and spec constants defined by OpSpecConstant, -// OpSpecConstantComposite, OpSpecConstantTrue, OpSpecConstantFalse or -// OpSpecConstantOp. -Optimizer::PassToken CreateEliminateDeadConstantPass(); - -// Creates a strength-reduction pass. -// A strength-reduction pass will look for opportunities to replace an -// instruction with an equivalent and less expensive one. For example, -// multiplying by a power of 2 can be replaced by a bit shift. -Optimizer::PassToken CreateStrengthReductionPass(); - -// Creates a block merge pass. -// This pass searches for blocks with a single Branch to a block with no -// other predecessors and merges the blocks into a single block. Continue -// blocks and Merge blocks are not candidates for the second block. -// -// The pass is most useful after Dead Branch Elimination, which can leave -// such sequences of blocks. Merging them makes subsequent passes more -// effective, such as single block local store-load elimination. -// -// While this pass reduces the number of occurrences of this sequence, at -// this time it does not guarantee all such sequences are eliminated. -// -// Presence of phi instructions can inhibit this optimization. Handling -// these is left for future improvements. -Optimizer::PassToken CreateBlockMergePass(); - -// Creates an exhaustive inline pass. -// An exhaustive inline pass attempts to exhaustively inline all function -// calls in all functions in an entry point call tree. The intent is to enable, -// albeit through brute force, analysis and optimization across function -// calls by subsequent optimization passes. As the inlining is exhaustive, -// there is no attempt to optimize for size or runtime performance. Functions -// that are not in the call tree of an entry point are not changed. -Optimizer::PassToken CreateInlineExhaustivePass(); - -// Creates an opaque inline pass. -// An opaque inline pass inlines all function calls in all functions in all -// entry point call trees where the called function contains an opaque type -// in either its parameter types or return type. An opaque type is currently -// defined as Image, Sampler or SampledImage. The intent is to enable, albeit -// through brute force, analysis and optimization across these function calls -// by subsequent passes in order to remove the storing of opaque types which is -// not legal in Vulkan. Functions that are not in the call tree of an entry -// point are not changed. -Optimizer::PassToken CreateInlineOpaquePass(); - -// Creates a single-block local variable load/store elimination pass. -// For every entry point function, do single block memory optimization of -// function variables referenced only with non-access-chain loads and stores. -// For each targeted variable load, if previous store to that variable in the -// block, replace the load's result id with the value id of the store. -// If previous load within the block, replace the current load's result id -// with the previous load's result id. In either case, delete the current -// load. Finally, check if any remaining stores are useless, and delete store -// and variable if possible. -// -// The presence of access chain references and function calls can inhibit -// the above optimization. -// -// Only modules with logical addressing are currently processed. -// -// This pass is most effective if preceeded by Inlining and -// LocalAccessChainConvert. This pass will reduce the work needed to be done -// by LocalSingleStoreElim and LocalMultiStoreElim. -// -// Only functions in the call tree of an entry point are processed. -Optimizer::PassToken CreateLocalSingleBlockLoadStoreElimPass(); - -// Create dead branch elimination pass. -// For each entry point function, this pass will look for SelectionMerge -// BranchConditionals with constant condition and convert to a Branch to -// the indicated label. It will delete resulting dead blocks. -// -// For all phi functions in merge block, replace all uses with the id -// corresponding to the living predecessor. -// -// This pass only works on shaders (guaranteed to have structured control -// flow). Note that some such branches and blocks may be left to avoid -// creating invalid control flow. Improving this is left to future work. -// -// This pass is most effective when preceeded by passes which eliminate -// local loads and stores, effectively propagating constant values where -// possible. -Optimizer::PassToken CreateDeadBranchElimPass(); - -// Creates an SSA local variable load/store elimination pass. -// For every entry point function, eliminate all loads and stores of function -// scope variables only referenced with non-access-chain loads and stores. -// Eliminate the variables as well. -// -// The presence of access chain references and function calls can inhibit -// the above optimization. -// -// Only shader modules with logical addressing are currently processed. -// Currently modules with any extensions enabled are not processed. This -// is left for future work. -// -// This pass is most effective if preceeded by Inlining and -// LocalAccessChainConvert. LocalSingleStoreElim and LocalSingleBlockElim -// will reduce the work that this pass has to do. -Optimizer::PassToken CreateLocalMultiStoreElimPass(); - -// Creates a local access chain conversion pass. -// A local access chain conversion pass identifies all function scope -// variables which are accessed only with loads, stores and access chains -// with constant indices. It then converts all loads and stores of such -// variables into equivalent sequences of loads, stores, extracts and inserts. -// -// This pass only processes entry point functions. It currently only converts -// non-nested, non-ptr access chains. It does not process modules with -// non-32-bit integer types present. Optional memory access options on loads -// and stores are ignored as we are only processing function scope variables. -// -// This pass unifies access to these variables to a single mode and simplifies -// subsequent analysis and elimination of these variables along with their -// loads and stores allowing values to propagate to their points of use where -// possible. -Optimizer::PassToken CreateLocalAccessChainConvertPass(); - -// Creates a local single store elimination pass. -// For each entry point function, this pass eliminates loads and stores for -// function scope variable that are stored to only once, where possible. Only -// whole variable loads and stores are eliminated; access-chain references are -// not optimized. Replace all loads of such variables with the value that is -// stored and eliminate any resulting dead code. -// -// Currently, the presence of access chains and function calls can inhibit this -// pass, however the Inlining and LocalAccessChainConvert passes can make it -// more effective. In additional, many non-load/store memory operations are -// not supported and will prohibit optimization of a function. Support of -// these operations are future work. -// -// This pass will reduce the work needed to be done by LocalSingleBlockElim -// and LocalMultiStoreElim and can improve the effectiveness of other passes -// such as DeadBranchElimination which depend on values for their analysis. -Optimizer::PassToken CreateLocalSingleStoreElimPass(); - -// Creates an insert/extract elimination pass. -// This pass processes each entry point function in the module, searching for -// extracts on a sequence of inserts. It further searches the sequence for an -// insert with indices identical to the extract. If such an insert can be -// found before hitting a conflicting insert, the extract's result id is -// replaced with the id of the values from the insert. -// -// Besides removing extracts this pass enables subsequent dead code elimination -// passes to delete the inserts. This pass performs best after access chains are -// converted to inserts and extracts and local loads and stores are eliminated. -Optimizer::PassToken CreateInsertExtractElimPass(); - -// Creates a pass to consolidate uniform references. -// For each entry point function in the module, first change all constant index -// access chain loads into equivalent composite extracts. Then consolidate -// identical uniform loads into one uniform load. Finally, consolidate -// identical uniform extracts into one uniform extract. This may require -// moving a load or extract to a point which dominates all uses. -// -// This pass requires a module to have structured control flow ie shader -// capability. It also requires logical addressing ie Addresses capability -// is not enabled. It also currently does not support any extensions. -// -// This pass currently only optimizes loads with a single index. -Optimizer::PassToken CreateCommonUniformElimPass(); - -// Create aggressive dead code elimination pass -// This pass eliminates unused code from functions. In addition, -// it detects and eliminates code which may have spurious uses but which do -// not contribute to the output of the function. The most common cause of -// such code sequences is summations in loops whose result is no longer used -// due to dead code elimination. This optimization has additional compile -// time cost over standard dead code elimination. -// -// This pass only processes entry point functions. It also only processes -// shaders with logical addressing. It currently will not process functions -// with function calls. -// -// This pass will be made more effective by first running passes that remove -// dead control flow and inlines function calls. -// -// This pass can be especially useful after running Local Access Chain -// Conversion, which tends to cause cycles of dead code to be left after -// Store/Load elimination passes are completed. These cycles cannot be -// eliminated with standard dead code elimination. -Optimizer::PassToken CreateAggressiveDCEPass(); - -// Creates a compact ids pass. -// The pass remaps result ids to a compact and gapless range starting from %1. -Optimizer::PassToken CreateCompactIdsPass(); - -// Creates a remove duplicate capabilities pass. -Optimizer::PassToken CreateRemoveDuplicatesPass(); - -// Creates a CFG cleanup pass. -// This pass removes cruft from the control flow graph of functions that are -// reachable from entry points and exported functions. It currently includes the -// following functionality: -// -// - Removal of unreachable basic blocks. -Optimizer::PassToken CreateCFGCleanupPass(); - -// Create dead variable elimination pass. -// This pass will delete module scope variables, along with their decorations, -// that are not referenced. -Optimizer::PassToken CreateDeadVariableEliminationPass(); - -} // namespace spvtools - -#endif // SPIRV_TOOLS_OPTIMIZER_HPP_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/LICENSE vulkan-1.1.73+dfsg/external/spirv-tools/LICENSE --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/LICENSE 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/LICENSE 1970-01-01 00:00:00.000000000 +0000 @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/projects.md vulkan-1.1.73+dfsg/external/spirv-tools/projects.md --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/projects.md 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/projects.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -# Tracking SPIRV-Tools work with GitHub projects - -We are experimenting with using the [GitHub Project -feature](https://help.github.com/articles/tracking-the-progress-of-your-work-with-projects/) -to track progress toward large goals. - -For more on GitHub Projects in general, see: -* [Introductory blog post](https://github.com/blog/2256-a-whole-new-github-universe-announcing-new-tools-forums-and-features) -* [Introductory video](https://www.youtube.com/watch?v=C6MGKHkNtxU) - -The current SPIRV-Tools project list can be found at -[https://github.com/KhronosGroup/SPIRV-Tools/projects](https://github.com/KhronosGroup/SPIRV-Tools/projects) - -## How we use a Project - -A GitHub Project is a set of work with an overall purpose, and -consists of a collection of *Cards*. -Each card is either a *Note* or a regular GitHub *Issue.* -A Note can be converted to an Issue. - -In our projects, a card represents work, i.e. a change that can -be applied to the repository. -The work could be a feature, a bug to be fixed, documentation to be -updated, etc. - -A project and its cards are used as a [Kanban -board](https://en.wikipedia.org/wiki/Kanban_board), where cards progress -through a workflow starting with ideas through to implementation and completion. - -In our usage, a *project manager* is someone who organizes the work. -They manage the creation and movement of cards -through the project workflow: -* They create cards to capture ideas, or to decompose large ideas into smaller - ones. -* They determine if the work for a card has been completed. -* Normally they are the person (or persons) who can approve and merge a pull - request into the `master` branch. - -Our projects organize cards into the following columns: -* `Ideas`: Work which could be done, captured either as Cards or Notes. - * A card in this column could be marked as a [PLACEHOLDER](#placeholders). -* `Ready to start`: Issues which represent work we'd like to do, and which - are not blocked by other work. - * The issue should be narrow enough that it can usually be addressed by a - single pull request. - * We want these to be Issues (not Notes) so that someone can claim the work - by updating the Issue with their intent to do the work. - Once an Issue is claimed, the project manager moves the corresponding card - from `Ready to start` to `In progress`. -* `In progress`: Issues which were in `Ready to start` but which have been - claimed by someone. -* `Done`: Issues which have been resolved, by completing their work. - * The changes have been applied to the repository, typically by being pushed - into the `master` branch. - * Other kinds of work could update repository settings, for example. -* `Rejected ideas`: Work which has been considered, but which we don't want - implemented. - * We keep rejected ideas so they are not proposed again. This serves - as a form of institutional memory. - * We should record why an idea is rejected. For this reason, a rejected - idea is likely to be an Issue which has been closed. - -## Prioritization - -We are considering prioritizing cards in the `Ideas` and `Ready to start` -columns so that things that should be considered first float up to the top. - -Experience will tell us if we stick to that rule, and if it proves helpful. - -## Placeholders - -A *placeholder* is a Note or Issue that represents a possibly large amount -of work that can be broadly defined but which may not have been broken down -into small implementable pieces of work. - -Use a placeholder to capture a big idea, but without doing the upfront work -to consider all the details of how it should be implemented. -Over time, break off pieces of the placeholder into implementable Issues. -Move those Issues into the `Ready to start` column when they become unblocked. - -We delete the placeholder when all its work has been decomposed into -implementable cards. diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/README.md vulkan-1.1.73+dfsg/external/spirv-tools/README.md --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/README.md 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/README.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,461 +0,0 @@ -# SPIR-V Tools - -[![Build Status](https://travis-ci.org/KhronosGroup/SPIRV-Tools.svg?branch=master)](https://travis-ci.org/KhronosGroup/SPIRV-Tools) -[![Build status](https://ci.appveyor.com/api/projects/status/gpue87cesrx3pi0d/branch/master?svg=true)](https://ci.appveyor.com/project/Khronoswebmaster/spirv-tools/branch/master) - -## Overview - -The SPIR-V Tools project provides an API and commands for processing SPIR-V -modules. - -The project includes an assembler, binary module parser, disassembler, -validator, and optimizer for SPIR-V. Except for the optimizer, all are based -on a common static library. The library contains all of the implementation -details, and is used in the standalone tools whilst also enabling integration -into other code bases directly. The optimizer implementation resides in its -own library, which depends on the core library. - -The interfaces have stabilized: -We don't anticipate making a breaking change for existing features. - -See [`projects.md`](projects.md) to see how we use the -[GitHub Project -feature](https://help.github.com/articles/tracking-the-progress-of-your-work-with-projects/) -to organize planned and in-progress work. - -SPIR-V is defined by the Khronos Group Inc. -See the [SPIR-V Registry][spirv-registry] for the SPIR-V specification, -headers, and XML registry. - -## Verisoning SPIRV-Tools - -See [`CHANGES`](CHANGES) for a high level summary of recent changes, by version. - -SPIRV-Tools project version numbers are of the form `v`*year*`.`*index* and with -an optional `-dev` suffix to indicate work in progress. For exampe, the -following versions are ordered from oldest to newest: - -* `v2016.0` -* `v2016.1-dev` -* `v2016.1` -* `v2016.2-dev` -* `v2016.2` - -Use the `--version` option on each command line tool to see the software -version. An API call reports the software version as a C-style string. - -## Supported features - -### Assembler, binary parser, and disassembler - -* Support for SPIR-V 1.0, 1.1, 1.2 - * Based on SPIR-V syntax described by JSON grammar files in the - [SPIRV-Headers](spirv-headers) repository. -* Support for extended instruction sets: - * GLSL std450 version 1.0 Rev 3 - * OpenCL version 1.0 Rev 2 -* Assembler only does basic syntax checking. No cross validation of - IDs or types is performed, except to check literal arguments to - `OpConstant`, `OpSpecConstant`, and `OpSwitch`. - -See [`syntax.md`](syntax.md) for the assembly language syntax. - -### Validator - -The validator checks validation rules described by the SPIR-V specification. - -Khronos recommends that tools that create or transform SPIR-V modules use the -validator to ensure their outputs are valid, and that tools that consume SPIR-V -modules optionally use the validator to protect themselves from bad inputs. -This is especially encouraged for debug and development scenarios. - -The validator has one-sided error: it will only return an error when it has -implemented a rule check and the module violates that rule. - -The validator is incomplete. -See the [CHANGES](CHANGES) file for reports on completed work, and -the [Validator -sub-project](https://github.com/KhronosGroup/SPIRV-Tools/projects/1) for planned -and in-progress work. - -*Note*: The validator checks some Universal Limits, from section 2.17 of the SPIR-V spec. -The validator will fail on a module that exceeds those minimum upper bound limits. -It is [future work](https://github.com/KhronosGroup/SPIRV-Tools/projects/1#card-1052403) -to parameterize the validator to allow larger -limits accepted by a more than minimally capable SPIR-V consumer. - - -### Optimizer - -*Note:* The optimizer is still under development. - -Currently supported optimizations: -* General - * Strip debug info -* Specialization Constants - * Set spec constant default value - * Freeze spec constant - * Fold `OpSpecConstantOp` and `OpSpecConstantComposite` - * Unify constants - * Eliminate dead constant -* Code Reduction - * Inline all function calls exhaustively - * Convert local access chains to inserts/extracts - * Eliminate local load/store in single block - * Eliminate local load/store with single store - * Eliminate local load/store with multiple stores - * Eliminate local extract from insert - * Eliminate dead instructions (aggressive) - * Eliminate dead branches - * Merge single successor / single predecessor block pairs - * Eliminate common uniform loads - * Remove duplicates: Capabilities, extended instruction imports, types, and - decorations. - -For the latest list with detailed documentation, please refer to -[`include/spirv-tools/optimizer.hpp`](include/spirv-tools/optimizer.hpp). - -For suggestions on using the code reduction options, please refer to this [white paper](https://www.lunarg.com/shader-compiler-technologies/white-paper-spirv-opt/). - - -### Linker - -*Note:* The linker is still under development. - -Current features: -* Combine multiple SPIR-V binary modules together. -* Combine into a library (exports are retained) or an executable (no symbols - are exported). - -See the [CHANGES](CHANGES) file for reports on completed work, and the [General -sub-project](https://github.com/KhronosGroup/SPIRV-Tools/projects/2) for -planned and in-progress work. - -### Extras - -* [Utility filters](#utility-filters) -* Build target `spirv-tools-vimsyntax` generates file `spvasm.vim`. - Copy that file into your `$HOME/.vim/syntax` directory to get SPIR-V assembly syntax - highlighting in Vim. This build target is not built by default. - -## Source code - -The SPIR-V Tools are maintained by members of the The Khronos Group Inc., -at https://github.com/KhronosGroup/SPIRV-Tools. - -Contributions via merge request are welcome. Changes should: -* Be provided under the [Apache 2.0](#license). - You'll be prompted with a one-time "click-through" Contributor's License - Agreement (CLA) dialog as part of submitting your pull request or - other contribution to GitHub. -* Include tests to cover updated functionality. -* C++ code should follow the [Google C++ Style Guide][cpp-style-guide]. -* Code should be formatted with `clang-format`. Settings are defined by - the included [.clang-format](.clang-format) file. - -We intend to maintain a linear history on the GitHub `master` branch. - -### Source code organization - -* `example`: demo code of using SPIRV-Tools APIs -* `external/googletest`: Intended location for the - [googletest][googletest] sources, not provided -* `include/`: API clients should add this directory to the include search path -* `external/spirv-headers`: Intended location for - [SPIR-V headers][spirv-headers], not provided -* `include/spirv-tools/libspirv.h`: C API public interface -* `source/`: API implementation -* `test/`: Tests, using the [googletest][googletest] framework -* `tools/`: Command line executables - -### Tests - -The project contains a number of tests, used to drive development -and ensure correctness. The tests are written using the -[googletest][googletest] framework. The `googletest` -source is not provided with this project. There are two ways to enable -tests: -* If SPIR-V Tools is configured as part of an enclosing project, then the - enclosing project should configure `googletest` before configuring SPIR-V Tools. -* If SPIR-V Tools is configured as a standalone project, then download the - `googletest` source into the `/external/googletest` directory before - configuring and building the project. - -*Note*: You must use a version of googletest that includes -[a fix][googletest-pull-612] for [googletest issue 610][googletest-issue-610]. -The fix is included on the googletest master branch any time after 2015-11-10. -In particular, googletest must be newer than version 1.7.0. - -## Build - -The project uses [CMake][cmake] to generate platform-specific build -configurations. Assume that `` is the root directory of the checked -out code: - -```sh -cd -git clone https://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers -git clone https://github.com/google/googletest.git external/googletest # optional - -mkdir build && cd build -cmake [-G ] -``` - -Once the build files have been generated, build using your preferred -development environment. - -### CMake options - -The following CMake options are supported: - -* `SPIRV_COLOR_TERMINAL={ON|OFF}`, default `ON` - Enables color console output. -* `SPIRV_SKIP_TESTS={ON|OFF}`, default `OFF`- Build only the library and - the command line tools. This will prevent the tests from being built. -* `SPIRV_SKIP_EXECUTABLES={ON|OFF}`, default `OFF`- Build only the library, not - the command line tools and tests. -* `SPIRV_BUILD_COMPRESSION={ON|OFF}`, default `OFF`- Build SPIR-V compressing - codec. -* `SPIRV_USE_SANITIZER=`, default is no sanitizing - On UNIX - platforms with an appropriate version of `clang` this option enables the use - of the sanitizers documented [here][clang-sanitizers]. - This should only be used with a debug build. -* `SPIRV_WARN_EVERYTHING={ON|OFF}`, default `OFF` - On UNIX platforms enable - more strict warnings. The code might not compile with this option enabled. - For Clang, enables `-Weverything`. For GCC, enables `-Wpedantic`. - See [`CMakeLists.txt`](CMakeLists.txt) for details. -* `SPIRV_WERROR={ON|OFF}`, default `ON` - Forces a compilation error on any - warnings encountered by enabling the compiler-specific compiler front-end - option. - -Additionally, you can pass additional C preprocessor definitions to SPIRV-Tools -via setting `SPIRV_TOOLS_EXTRA_DEFINITIONS`. For example, by setting it to -`/D_ITERATOR_DEBUG_LEVEL=0` on Windows, you can disable checked iterators and -iterator debugging. - -## Library - -### Usage - -The internals of the library use C++11 features, and are exposed via both a C -and C++ API. - -In order to use the library from an application, the include path should point -to `/include`, which will enable the application to include the -header `/include/spirv-tools/libspirv.h{|pp}` then linking against -the static library in `/source/libSPIRV-Tools.a` or -`/source/SPIRV-Tools.lib`. -For optimization, the header file is -`/include/spirv-tools/optimizer.hpp`, and the static library is -`/source/libSPIRV-Tools-opt.a` or -`/source/SPIRV-Tools-opt.lib`. - -* `SPIRV-Tools` CMake target: Creates the static library: - * `/source/libSPIRV-Tools.a` on Linux and OS X. - * `/source/libSPIRV-Tools.lib` on Windows. -* `SPIRV-Tools-opt` CMake target: Creates the static library: - * `/source/libSPIRV-Tools-opt.a` on Linux and OS X. - * `/source/libSPIRV-Tools-opt.lib` on Windows. - -#### Entry points - -The interfaces are still under development, and are expected to change. - -There are five main entry points into the library in the C interface: - -* `spvTextToBinary`: An assembler, translating text to a binary SPIR-V module. -* `spvBinaryToText`: A disassembler, translating a binary SPIR-V module to - text. -* `spvBinaryParse`: The entry point to a binary parser API. It issues callbacks - for the header and each parsed instruction. The disassembler is implemented - as a client of `spvBinaryParse`. -* `spvValidate` implements the validator functionality. *Incomplete* -* `spvValidateBinary` implements the validator functionality. *Incomplete* - -The C++ interface is comprised of three classes, `SpirvTools`, `Optimizer` and -`Linker`, all in the `spvtools` namespace. -* `SpirvTools` provides `Assemble`, `Disassemble`, and `Validate` methods. -* `Optimizer` provides methods for registering and running optimization passes. -* `Linker` provides methods for combining together multiple binaries. - -## Command line tools - -Command line tools, which wrap the above library functions, are provided to -assemble or disassemble shader files. It's a convention to name SPIR-V -assembly and binary files with suffix `.spvasm` and `.spv`, respectively. - -### Assembler tool - -The assembler reads the assembly language text, and emits the binary form. - -The standalone assembler is the exectuable called `spirv-as`, and is located in -`/tools/spirv-as`. The functionality of the assembler is implemented -by the `spvTextToBinary` library function. - -* `spirv-as` - the standalone assembler - * `/tools/as` - -Use option `-h` to print help. - -### Disassembler tool - -The disassembler reads the binary form, and emits assembly language text. - -The standalone disassembler is the executable called `spirv-dis`, and is located in -`/tools/spirv-dis`. The functionality of the disassembler is implemented -by the `spvBinaryToText` library function. - -* `spirv-dis` - the standalone disassembler - * `/tools/dis` - -Use option `-h` to print help. - -The output includes syntax colouring when printing to the standard output stream, -on Linux, Windows, and OS X. - -### Linker tool - -The linker combines multiple SPIR-V binary modules together, resulting in a single -binary module as output. - -This is a work in progress. -The linker does not support OpenCL program linking options related to math -flags. (See section 5.6.5.2 in OpenCL 1.2) - -* `spirv-link` - the standalone linker - * `/tools/link` - -### Optimizer tool - -The optimizer processes a SPIR-V binary module, applying transformations -in the specified order. - -This is a work in progress, with initially only few available transformations. - -* `spirv-opt` - the standalone optimizer - * `/tools/opt` - -### Validator tool - -*Warning:* This functionality is under development, and is incomplete. - -The standalone validator is the executable called `spirv-val`, and is located in -`/tools/spirv-val`. The functionality of the validator is implemented -by the `spvValidate` library function. - -The validator operates on the binary form. - -* `spirv-val` - the standalone validator - * `/tools/val` - -### Control flow dumper tool - -The control flow dumper prints the control flow graph for a SPIR-V module as a -[GraphViz](http://www.graphviz.org/) graph. - -This is experimental. - -* `spirv-cfg` - the control flow graph dumper - * `/tools/cfg` - -### Utility filters - -* `spirv-lesspipe.sh` - Automatically disassembles `.spv` binary files for the - `less` program, on compatible systems. For example, set the `LESSOPEN` - environment variable as follows, assuming both `spirv-lesspipe.sh` and - `spirv-dis` are on your executable search path: - ``` - export LESSOPEN='| spirv-lesspipe.sh "%s"' - ``` - Then you page through a disassembled module as follows: - ``` - less foo.spv - ``` - * The `spirv-lesspipe.sh` script will pass through any extra arguments to - `spirv-dis`. So, for example, you can turn off colours and friendly ID - naming as follows: - ``` - export LESSOPEN='| spirv-lesspipe.sh "%s" --no-color --raw-id' - ``` - -* [vim-spirv](https://github.com/kbenzie/vim-spirv) - A vim plugin which - supports automatic disassembly of `.spv` files using the `:edit` command and - assembly using the `:write` command. The plugin also provides additional - features which include; syntax highlighting; highlighting of all ID's matching - the ID under the cursor; and highlighting errors where the `Instruction` - operand of `OpExtInst` is used without an appropriate `OpExtInstImport`. - -* `50spirv-tools.el` - Automatically disassembles '.spv' binary files when - loaded into the emacs text editor, and re-assembles them when saved, - provided any modifications to the file are valid. This functionality - must be explicitly requested by defining the symbol - SPIRV_TOOLS_INSTALL_EMACS_HELPERS as follows: - ``` - cmake -DSPIRV_TOOLS_INSTALL_EMACS_HELPERS=true ... - ``` - - In addition, this helper is only installed if the directory /etc/emacs/site-start.d - exists, which is typically true if emacs is installed on the system. - - Note that symbol IDs are not currently preserved through a load/edit/save operation. - This may change if the ability is added to spirv-as. - - -### Tests - -Tests are only built when googletest is found. Use `ctest` to run all the -tests. - -## Future Work - - -_See the [projects pages](https://github.com/KhronosGroup/SPIRV-Tools/projects) -for more information._ - -### Assembler and disassembler - -* The disassembler could emit helpful annotations in comments. For example: - * Use variable name information from debug instructions to annotate - key operations on variables. - * Show control flow information by annotating `OpLabel` instructions with - that basic block's predecessors. -* Error messages could be improved. - -### Validator - -This is a work in progress. - -### Linker - -* The linker could accept math transformations such as allowing MADs, or other - math flags passed at linking-time in OpenCL. -* Linkage attributes can not be applied through a group. -* Check decorations of linked functions attributes. -* Remove dead instructions, such as OpName targeting imported symbols. - -## Licence - -Full license terms are in [LICENSE](LICENSE) -``` -Copyright (c) 2015-2016 The Khronos Group Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -``` - -[spirv-registry]: https://www.khronos.org/registry/spir-v/ -[spirv-headers]: https://github.com/KhronosGroup/SPIRV-Headers -[googletest]: https://github.com/google/googletest -[googletest-pull-612]: https://github.com/google/googletest/pull/612 -[googletest-issue-610]: https://github.com/google/googletest/issues/610 -[CMake]: https://cmake.org/ -[cpp-style-guide]: https://google.github.io/styleguide/cppguide.html -[clang-sanitizers]: http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/assembly_grammar.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/assembly_grammar.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/assembly_grammar.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/assembly_grammar.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,242 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "assembly_grammar.h" - -#include -#include -#include - -#include "ext_inst.h" -#include "opcode.h" -#include "operand.h" -#include "table.h" - -namespace { - -/// @brief Parses a mask expression string for the given operand type. -/// -/// A mask expression is a sequence of one or more terms separated by '|', -/// where each term a named enum value for the given type. No whitespace -/// is permitted. -/// -/// On success, the value is written to pValue. -/// -/// @param[in] operandTable operand lookup table -/// @param[in] type of the operand -/// @param[in] textValue word of text to be parsed -/// @param[out] pValue where the resulting value is written -/// -/// @return result code -spv_result_t spvTextParseMaskOperand(const spv_operand_table operandTable, - const spv_operand_type_t type, - const char* textValue, uint32_t* pValue) { - if (textValue == nullptr) return SPV_ERROR_INVALID_TEXT; - size_t text_length = strlen(textValue); - if (text_length == 0) return SPV_ERROR_INVALID_TEXT; - const char* text_end = textValue + text_length; - - // We only support mask expressions in ASCII, so the separator value is a - // char. - const char separator = '|'; - - // Accumulate the result by interpreting one word at a time, scanning - // from left to right. - uint32_t value = 0; - const char* begin = textValue; // The left end of the current word. - const char* end = nullptr; // One character past the end of the current word. - do { - end = std::find(begin, text_end, separator); - - spv_operand_desc entry = nullptr; - if (spvOperandTableNameLookup(operandTable, type, begin, end - begin, - &entry)) { - return SPV_ERROR_INVALID_TEXT; - } - value |= entry->value; - - // Advance to the next word by skipping over the separator. - begin = end + 1; - } while (end != text_end); - - *pValue = value; - return SPV_SUCCESS; -} - -// Associates an opcode with its name. -struct SpecConstantOpcodeEntry { - SpvOp opcode; - const char* name; -}; - -// All the opcodes allowed as the operation for OpSpecConstantOp. -// The name does not have the usual "Op" prefix. For example opcode SpvOpIAdd -// is associated with the name "IAdd". -// -// clang-format off -#define CASE(NAME) { SpvOp##NAME, #NAME } -const SpecConstantOpcodeEntry kOpSpecConstantOpcodes[] = { - // Conversion - CASE(SConvert), - CASE(FConvert), - CASE(ConvertFToS), - CASE(ConvertSToF), - CASE(ConvertFToU), - CASE(ConvertUToF), - CASE(UConvert), - CASE(ConvertPtrToU), - CASE(ConvertUToPtr), - CASE(GenericCastToPtr), - CASE(PtrCastToGeneric), - CASE(Bitcast), - CASE(QuantizeToF16), - // Arithmetic - CASE(SNegate), - CASE(Not), - CASE(IAdd), - CASE(ISub), - CASE(IMul), - CASE(UDiv), - CASE(SDiv), - CASE(UMod), - CASE(SRem), - CASE(SMod), - CASE(ShiftRightLogical), - CASE(ShiftRightArithmetic), - CASE(ShiftLeftLogical), - CASE(BitwiseOr), - CASE(BitwiseAnd), - CASE(BitwiseXor), - CASE(FNegate), - CASE(FAdd), - CASE(FSub), - CASE(FMul), - CASE(FDiv), - CASE(FRem), - CASE(FMod), - // Composite - CASE(VectorShuffle), - CASE(CompositeExtract), - CASE(CompositeInsert), - // Logical - CASE(LogicalOr), - CASE(LogicalAnd), - CASE(LogicalNot), - CASE(LogicalEqual), - CASE(LogicalNotEqual), - CASE(Select), - // Comparison - CASE(IEqual), - CASE(INotEqual), - CASE(ULessThan), - CASE(SLessThan), - CASE(UGreaterThan), - CASE(SGreaterThan), - CASE(ULessThanEqual), - CASE(SLessThanEqual), - CASE(UGreaterThanEqual), - CASE(SGreaterThanEqual), - // Memory - CASE(AccessChain), - CASE(InBoundsAccessChain), - CASE(PtrAccessChain), - CASE(InBoundsPtrAccessChain), -}; - -// The 59 is determined by counting the opcodes listed in the spec. -static_assert(59 == sizeof(kOpSpecConstantOpcodes)/sizeof(kOpSpecConstantOpcodes[0]), - "OpSpecConstantOp opcode table is incomplete"); -#undef CASE -// clang-format on - -const size_t kNumOpSpecConstantOpcodes = - sizeof(kOpSpecConstantOpcodes) / sizeof(kOpSpecConstantOpcodes[0]); - -} // anonymous namespace - -namespace libspirv { - -bool AssemblyGrammar::isValid() const { - return operandTable_ && opcodeTable_ && extInstTable_; -} - -spv_result_t AssemblyGrammar::lookupOpcode(const char* name, - spv_opcode_desc* desc) const { - return spvOpcodeTableNameLookup(opcodeTable_, name, desc); -} - -spv_result_t AssemblyGrammar::lookupOpcode(SpvOp opcode, - spv_opcode_desc* desc) const { - return spvOpcodeTableValueLookup(opcodeTable_, opcode, desc); -} - -spv_result_t AssemblyGrammar::lookupOperand(spv_operand_type_t type, - const char* name, size_t name_len, - spv_operand_desc* desc) const { - return spvOperandTableNameLookup(operandTable_, type, name, name_len, desc); -} - -spv_result_t AssemblyGrammar::lookupOperand(spv_operand_type_t type, - uint32_t operand, - spv_operand_desc* desc) const { - return spvOperandTableValueLookup(operandTable_, type, operand, desc); -} - -spv_result_t AssemblyGrammar::lookupSpecConstantOpcode(const char* name, - SpvOp* opcode) const { - const auto* last = kOpSpecConstantOpcodes + kNumOpSpecConstantOpcodes; - const auto* found = - std::find_if(kOpSpecConstantOpcodes, last, - [name](const SpecConstantOpcodeEntry& entry) { - return 0 == strcmp(name, entry.name); - }); - if (found == last) return SPV_ERROR_INVALID_LOOKUP; - *opcode = found->opcode; - return SPV_SUCCESS; -} - -spv_result_t AssemblyGrammar::lookupSpecConstantOpcode(SpvOp opcode) const { - const auto* last = kOpSpecConstantOpcodes + kNumOpSpecConstantOpcodes; - const auto* found = - std::find_if(kOpSpecConstantOpcodes, last, - [opcode](const SpecConstantOpcodeEntry& entry) { - return opcode == entry.opcode; - }); - if (found == last) return SPV_ERROR_INVALID_LOOKUP; - return SPV_SUCCESS; -} - -spv_result_t AssemblyGrammar::parseMaskOperand(const spv_operand_type_t type, - const char* textValue, - uint32_t* pValue) const { - return spvTextParseMaskOperand(operandTable_, type, textValue, pValue); -} -spv_result_t AssemblyGrammar::lookupExtInst(spv_ext_inst_type_t type, - const char* textValue, - spv_ext_inst_desc* extInst) const { - return spvExtInstTableNameLookup(extInstTable_, type, textValue, extInst); -} - -spv_result_t AssemblyGrammar::lookupExtInst(spv_ext_inst_type_t type, - uint32_t firstWord, - spv_ext_inst_desc* extInst) const { - return spvExtInstTableValueLookup(extInstTable_, type, firstWord, extInst); -} - -void AssemblyGrammar::pushOperandTypesForMask( - const spv_operand_type_t type, const uint32_t mask, - spv_operand_pattern_t* pattern) const { - spvPushOperandTypesForMask(operandTable_, type, mask, pattern); -} -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/assembly_grammar.h vulkan-1.1.73+dfsg/external/spirv-tools/source/assembly_grammar.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/assembly_grammar.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/assembly_grammar.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,120 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_ASSEMBLY_GRAMMAR_H_ -#define LIBSPIRV_ASSEMBLY_GRAMMAR_H_ - -#include "operand.h" -#include "spirv-tools/libspirv.h" -#include "spirv/1.2/spirv.h" -#include "table.h" - -namespace libspirv { - -// Encapsulates the grammar to use for SPIR-V assembly. -// Contains methods to query for valid instructions and operands. -class AssemblyGrammar { - public: - explicit AssemblyGrammar(const spv_const_context context) - : target_env_(context->target_env), - operandTable_(context->operand_table), - opcodeTable_(context->opcode_table), - extInstTable_(context->ext_inst_table) {} - - // Returns true if the internal tables have been initialized with valid data. - bool isValid() const; - - // Returns the SPIR-V target environment. - spv_target_env target_env() const { return target_env_; } - - // Fills in the desc parameter with the information about the opcode - // of the given name. Returns SPV_SUCCESS if the opcode was found, and - // SPV_ERROR_INVALID_LOOKUP if the opcode does not exist. - spv_result_t lookupOpcode(const char* name, spv_opcode_desc* desc) const; - - // Fills in the desc parameter with the information about the opcode - // of the valid. Returns SPV_SUCCESS if the opcode was found, and - // SPV_ERROR_INVALID_LOOKUP if the opcode does not exist. - spv_result_t lookupOpcode(SpvOp opcode, spv_opcode_desc* desc) const; - - // Fills in the desc parameter with the information about the given - // operand. Returns SPV_SUCCESS if the operand was found, and - // SPV_ERROR_INVALID_LOOKUP otherwise. - spv_result_t lookupOperand(spv_operand_type_t type, const char* name, - size_t name_len, spv_operand_desc* desc) const; - - // Fills in the desc parameter with the information about the given - // operand. Returns SPV_SUCCESS if the operand was found, and - // SPV_ERROR_INVALID_LOOKUP otherwise. - spv_result_t lookupOperand(spv_operand_type_t type, uint32_t operand, - spv_operand_desc* desc) const; - - // Finds the opcode for the given OpSpecConstantOp opcode name. The name - // should not have the "Op" prefix. For example, "IAdd" corresponds to - // the integer add opcode for OpSpecConstantOp. On success, returns - // SPV_SUCCESS and sends the discovered operation code through the opcode - // parameter. On failure, returns SPV_ERROR_INVALID_LOOKUP. - spv_result_t lookupSpecConstantOpcode(const char* name, SpvOp* opcode) const; - - // Returns SPV_SUCCESS if the given opcode is valid as the opcode operand - // to OpSpecConstantOp. - spv_result_t lookupSpecConstantOpcode(SpvOp opcode) const; - - // Parses a mask expression string for the given operand type. - // - // A mask expression is a sequence of one or more terms separated by '|', - // where each term is a named enum value for a given type. No whitespace - // is permitted. - // - // On success, the value is written to pValue, and SPV_SUCCESS is returned. - // The operand type is defined by the type parameter, and the text to be - // parsed is defined by the textValue parameter. - spv_result_t parseMaskOperand(const spv_operand_type_t type, - const char* textValue, uint32_t* pValue) const; - - // Writes the extended operand with the given type and text to the *extInst - // parameter. - // Returns SPV_SUCCESS if the value could be found. - spv_result_t lookupExtInst(spv_ext_inst_type_t type, const char* textValue, - spv_ext_inst_desc* extInst) const; - - // Writes the extended operand with the given type and first encoded word - // to the *extInst parameter. - // Returns SPV_SUCCESS if the value could be found. - spv_result_t lookupExtInst(spv_ext_inst_type_t type, uint32_t firstWord, - spv_ext_inst_desc* extInst) const; - - // Inserts the operands expected after the given typed mask onto the end - // of the given pattern. - // - // Each set bit in the mask represents zero or more operand types that - // should be appended onto the pattern. Operands for a less significant - // bit must always match before operands for a more significant bit, so - // the operands for a less significant bit must appear closer to the end - // of the pattern stack. - // - // If a set bit is unknown, then we assume it has no operands. - void pushOperandTypesForMask(const spv_operand_type_t type, - const uint32_t mask, - spv_operand_pattern_t* pattern) const; - - private: - const spv_target_env target_env_; - const spv_operand_table operandTable_; - const spv_opcode_table opcodeTable_; - const spv_ext_inst_table extInstTable_; -}; -} - -#endif // LIBSPIRV_ASSEMBLY_GRAMMAR_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/binary.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/binary.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/binary.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/binary.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,783 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "binary.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "assembly_grammar.h" -#include "diagnostic.h" -#include "ext_inst.h" -#include "opcode.h" -#include "operand.h" -#include "spirv/1.2/spirv.h" -#include "spirv_constant.h" -#include "spirv_endian.h" - -spv_result_t spvBinaryHeaderGet(const spv_const_binary binary, - const spv_endianness_t endian, - spv_header_t* pHeader) { - if (!binary->code) return SPV_ERROR_INVALID_BINARY; - if (binary->wordCount < SPV_INDEX_INSTRUCTION) - return SPV_ERROR_INVALID_BINARY; - if (!pHeader) return SPV_ERROR_INVALID_POINTER; - - // TODO: Validation checking? - pHeader->magic = spvFixWord(binary->code[SPV_INDEX_MAGIC_NUMBER], endian); - pHeader->version = spvFixWord(binary->code[SPV_INDEX_VERSION_NUMBER], endian); - pHeader->generator = - spvFixWord(binary->code[SPV_INDEX_GENERATOR_NUMBER], endian); - pHeader->bound = spvFixWord(binary->code[SPV_INDEX_BOUND], endian); - pHeader->schema = spvFixWord(binary->code[SPV_INDEX_SCHEMA], endian); - pHeader->instructions = &binary->code[SPV_INDEX_INSTRUCTION]; - - return SPV_SUCCESS; -} - -namespace { - -// A SPIR-V binary parser. A parser instance communicates detailed parse -// results via callbacks. -class Parser { - public: - // The user_data value is provided to the callbacks as context. - Parser(const spv_const_context context, void* user_data, - spv_parsed_header_fn_t parsed_header_fn, - spv_parsed_instruction_fn_t parsed_instruction_fn) - : grammar_(context), - consumer_(context->consumer), - user_data_(user_data), - parsed_header_fn_(parsed_header_fn), - parsed_instruction_fn_(parsed_instruction_fn) {} - - // Parses the specified binary SPIR-V module, issuing callbacks on a parsed - // header and for each parsed instruction. Returns SPV_SUCCESS on success. - // Otherwise returns an error code and issues a diagnostic. - spv_result_t parse(const uint32_t* words, size_t num_words, - spv_diagnostic* diagnostic); - - private: - // All remaining methods work on the current module parse state. - - // Like the parse method, but works on the current module parse state. - spv_result_t parseModule(); - - // Parses an instruction at the current position of the binary. Assumes - // the header has been parsed, the endian has been set, and the word index is - // still in range. Advances the parsing position past the instruction, and - // updates other parsing state for the current module. - // On success, returns SPV_SUCCESS and issues the parsed-instruction callback. - // On failure, returns an error code and issues a diagnostic. - spv_result_t parseInstruction(); - - // Parses an instruction operand with the given type, for an instruction - // starting at inst_offset words into the SPIR-V binary. - // If the SPIR-V binary is the same endianness as the host, then the - // endian_converted_inst_words parameter is ignored. Otherwise, this method - // appends the words for this operand, converted to host native endianness, - // to the end of endian_converted_inst_words. This method also updates the - // expected_operands parameter, and the scalar members of the inst parameter. - // On success, returns SPV_SUCCESS, advances past the operand, and pushes a - // new entry on to the operands vector. Otherwise returns an error code and - // issues a diagnostic. - spv_result_t parseOperand(size_t inst_offset, spv_parsed_instruction_t* inst, - const spv_operand_type_t type, - std::vector* endian_converted_inst_words, - std::vector* operands, - spv_operand_pattern_t* expected_operands); - - // Records the numeric type for an operand according to the type information - // associated with the given non-zero type Id. This can fail if the type Id - // is not a type Id, or if the type Id does not reference a scalar numeric - // type. On success, return SPV_SUCCESS and populates the num_words, - // number_kind, and number_bit_width fields of parsed_operand. - spv_result_t setNumericTypeInfoForType(spv_parsed_operand_t* parsed_operand, - uint32_t type_id); - - // Records the number type for an instruction at the given offset, if that - // instruction generates a type. For types that aren't scalar numbers, - // record something with number kind SPV_NUMBER_NONE. - void recordNumberType(size_t inst_offset, - const spv_parsed_instruction_t* inst); - - // Returns a diagnostic stream object initialized with current position in - // the input stream, and for the given error code. Any data written to the - // returned object will be propagated to the current parse's diagnostic - // object. - libspirv::DiagnosticStream diagnostic(spv_result_t error) { - return libspirv::DiagnosticStream({0, 0, _.word_index}, consumer_, error); - } - - // Returns a diagnostic stream object with the default parse error code. - libspirv::DiagnosticStream diagnostic() { - // The default failure for parsing is invalid binary. - return diagnostic(SPV_ERROR_INVALID_BINARY); - } - - // Issues a diagnostic describing an exhaustion of input condition when - // trying to decode an instruction operand, and returns - // SPV_ERROR_INVALID_BINARY. - spv_result_t exhaustedInputDiagnostic(size_t inst_offset, SpvOp opcode, - spv_operand_type_t type) { - return diagnostic() << "End of input reached while decoding Op" - << spvOpcodeString(opcode) << " starting at word " - << inst_offset - << ((_.word_index < _.num_words) ? ": truncated " - : ": missing ") - << spvOperandTypeStr(type) << " operand at word offset " - << _.word_index - inst_offset << "."; - } - - // Returns the endian-corrected word at the current position. - uint32_t peek() const { return peekAt(_.word_index); } - - // Returns the endian-corrected word at the given position. - uint32_t peekAt(size_t index) const { - assert(index < _.num_words); - return spvFixWord(_.words[index], _.endian); - } - - // Data members - - const libspirv::AssemblyGrammar grammar_; // SPIR-V syntax utility. - const spvtools::MessageConsumer& consumer_; // Message consumer callback. - void* const user_data_; // Context for the callbacks - const spv_parsed_header_fn_t parsed_header_fn_; // Parsed header callback - const spv_parsed_instruction_fn_t - parsed_instruction_fn_; // Parsed instruction callback - - // Describes the format of a typed literal number. - struct NumberType { - spv_number_kind_t type; - uint32_t bit_width; - }; - - // The state used to parse a single SPIR-V binary module. - struct State { - State(const uint32_t* words_arg, size_t num_words_arg, - spv_diagnostic* diagnostic_arg) - : words(words_arg), - num_words(num_words_arg), - diagnostic(diagnostic_arg), - word_index(0), - endian(), - requires_endian_conversion(false) { - - // Temporary storage for parser state within a single instruction. - // Most instructions require fewer than 25 words or operands. - operands.reserve(25); - endian_converted_words.reserve(25); - expected_operands.reserve(25); - } - State() : State(0, 0, nullptr) {} - const uint32_t* words; // Words in the binary SPIR-V module. - size_t num_words; // Number of words in the module. - spv_diagnostic* diagnostic; // Where diagnostics go. - size_t word_index; // The current position in words. - spv_endianness_t endian; // The endianness of the binary. - // Is the SPIR-V binary in a different endiannes from the host native - // endianness? - bool requires_endian_conversion; - - // Maps a result ID to its type ID. By convention: - // - a result ID that is a type definition maps to itself. - // - a result ID without a type maps to 0. (E.g. for OpLabel) - std::unordered_map id_to_type_id; - // Maps a type ID to its number type description. - std::unordered_map type_id_to_number_type_info; - // Maps an ExtInstImport id to the extended instruction type. - std::unordered_map - import_id_to_ext_inst_type; - - // Used by parseOperand - std::vector operands; - std::vector endian_converted_words; - spv_operand_pattern_t expected_operands; - } _; -}; - -spv_result_t Parser::parse(const uint32_t* words, size_t num_words, - spv_diagnostic* diagnostic_arg) { - _ = State(words, num_words, diagnostic_arg); - - const spv_result_t result = parseModule(); - - // Clear the module state. The tables might be big. - _ = State(); - - return result; -} - -spv_result_t Parser::parseModule() { - if (!_.words) return diagnostic() << "Missing module."; - - if (_.num_words < SPV_INDEX_INSTRUCTION) - return diagnostic() << "Module has incomplete header: only " << _.num_words - << " words instead of " << SPV_INDEX_INSTRUCTION; - - // Check the magic number and detect the module's endianness. - spv_const_binary_t binary{_.words, _.num_words}; - if (spvBinaryEndianness(&binary, &_.endian)) { - return diagnostic() << "Invalid SPIR-V magic number '" << std::hex - << _.words[0] << "'."; - } - _.requires_endian_conversion = !spvIsHostEndian(_.endian); - - // Process the header. - spv_header_t header; - if (spvBinaryHeaderGet(&binary, _.endian, &header)) { - // It turns out there is no way to trigger this error since the only - // failure cases are already handled above, with better messages. - return diagnostic(SPV_ERROR_INTERNAL) - << "Internal error: unhandled header parse failure"; - } - if (parsed_header_fn_) { - if (auto error = parsed_header_fn_(user_data_, _.endian, header.magic, - header.version, header.generator, - header.bound, header.schema)) { - return error; - } - } - - // Process the instructions. - _.word_index = SPV_INDEX_INSTRUCTION; - while (_.word_index < _.num_words) - if (auto error = parseInstruction()) return error; - - // Running off the end should already have been reported earlier. - assert(_.word_index == _.num_words); - - return SPV_SUCCESS; -} - -spv_result_t Parser::parseInstruction() { - // The zero values for all members except for opcode are the - // correct initial values. - spv_parsed_instruction_t inst = {}; - - const uint32_t first_word = peek(); - - // If the module's endianness is different from the host native endianness, - // then converted_words contains the the endian-translated words in the - // instruction. - _.endian_converted_words.clear(); - _.endian_converted_words.push_back(first_word); - - // After a successful parse of the instruction, the inst.operands member - // will point to this vector's storage. - _.operands.clear(); - - assert(_.word_index < _.num_words); - // Decompose and check the first word. - uint16_t inst_word_count = 0; - spvOpcodeSplit(first_word, &inst_word_count, &inst.opcode); - if (inst_word_count < 1) { - return diagnostic() << "Invalid instruction word count: " - << inst_word_count; - } - spv_opcode_desc opcode_desc; - if (grammar_.lookupOpcode(static_cast(inst.opcode), &opcode_desc)) - return diagnostic() << "Invalid opcode: " << inst.opcode; - - // Advance past the opcode word. But remember the of the start - // of the instruction. - const size_t inst_offset = _.word_index; - _.word_index++; - - // Maintains the ordered list of expected operand types. - // For many instructions we only need the {numTypes, operandTypes} - // entries in opcode_desc. However, sometimes we need to modify - // the list as we parse the operands. This occurs when an operand - // has its own logical operands (such as the LocalSize operand for - // ExecutionMode), or for extended instructions that may have their - // own operands depending on the selected extended instruction. - _.expected_operands.clear(); - for (auto i = 0; i < opcode_desc->numTypes; i++) - _.expected_operands.push_back(opcode_desc->operandTypes[opcode_desc->numTypes - i - 1]); - - while (_.word_index < inst_offset + inst_word_count) { - const uint16_t inst_word_index = uint16_t(_.word_index - inst_offset); - if (_.expected_operands.empty()) { - return diagnostic() << "Invalid instruction Op" << opcode_desc->name - << " starting at word " << inst_offset - << ": expected no more operands after " - << inst_word_index - << " words, but stated word count is " - << inst_word_count << "."; - } - - spv_operand_type_t type = spvTakeFirstMatchableOperand(&_.expected_operands); - - if (auto error = - parseOperand(inst_offset, &inst, type, &_.endian_converted_words, - &_.operands, &_.expected_operands)) { - return error; - } - } - - if (!_.expected_operands.empty() && - !spvOperandIsOptional(_.expected_operands.back())) { - return diagnostic() << "End of input reached while decoding Op" - << opcode_desc->name << " starting at word " - << inst_offset << ": expected more operands after " - << inst_word_count << " words."; - } - - if ((inst_offset + inst_word_count) != _.word_index) { - return diagnostic() << "Invalid word count: Op" << opcode_desc->name - << " starting at word " << inst_offset - << " says it has " << inst_word_count - << " words, but found " << _.word_index - inst_offset - << " words instead."; - } - - // Check the computed length of the endian-converted words vector against - // the declared number of words in the instruction. If endian conversion - // is required, then they should match. If no endian conversion was - // performed, then the vector only contains the initial opcode/word-count - // word. - assert(!_.requires_endian_conversion || - (inst_word_count == _.endian_converted_words.size())); - assert(_.requires_endian_conversion || (_.endian_converted_words.size() == 1)); - - recordNumberType(inst_offset, &inst); - - if (_.requires_endian_conversion) { - // We must wait until here to set this pointer, because the vector might - // have been be resized while we accumulated its elements. - inst.words = _.endian_converted_words.data(); - } else { - // If no conversion is required, then just point to the underlying binary. - // This saves time and space. - inst.words = _.words + inst_offset; - } - inst.num_words = inst_word_count; - - // We must wait until here to set this pointer, because the vector might - // have been be resized while we accumulated its elements. - inst.operands = _.operands.data(); - inst.num_operands = uint16_t(_.operands.size()); - - // Issue the callback. The callee should know that all the storage in inst - // is transient, and will disappear immediately afterward. - if (parsed_instruction_fn_) { - if (auto error = parsed_instruction_fn_(user_data_, &inst)) return error; - } - - return SPV_SUCCESS; -} - -spv_result_t Parser::parseOperand(size_t inst_offset, - spv_parsed_instruction_t* inst, - const spv_operand_type_t type, - std::vector* words, - std::vector* operands, - spv_operand_pattern_t* expected_operands) { - const SpvOp opcode = static_cast(inst->opcode); - // We'll fill in this result as we go along. - spv_parsed_operand_t parsed_operand; - parsed_operand.offset = uint16_t(_.word_index - inst_offset); - // Most operands occupy one word. This might be be adjusted later. - parsed_operand.num_words = 1; - // The type argument is the one used by the grammar to parse the instruction. - // But it can exposes internal parser details such as whether an operand is - // optional or actually represents a variable-length sequence of operands. - // The resulting type should be adjusted to avoid those internal details. - // In most cases, the resulting operand type is the same as the grammar type. - parsed_operand.type = type; - - // Assume non-numeric values. This will be updated for literal numbers. - parsed_operand.number_kind = SPV_NUMBER_NONE; - parsed_operand.number_bit_width = 0; - - if (_.word_index >= _.num_words) - return exhaustedInputDiagnostic(inst_offset, opcode, type); - - const uint32_t word = peek(); - - // Do the words in this operand have to be converted to native endianness? - // True for all but literal strings. - bool convert_operand_endianness = true; - - switch (type) { - case SPV_OPERAND_TYPE_TYPE_ID: - if (!word) - return diagnostic(SPV_ERROR_INVALID_ID) << "Error: Type Id is 0"; - inst->type_id = word; - break; - - case SPV_OPERAND_TYPE_RESULT_ID: - if (!word) - return diagnostic(SPV_ERROR_INVALID_ID) << "Error: Result Id is 0"; - inst->result_id = word; - // Save the result ID to type ID mapping. - // In the grammar, type ID always appears before result ID. - if (_.id_to_type_id.find(inst->result_id) != _.id_to_type_id.end()) - return diagnostic(SPV_ERROR_INVALID_ID) << "Id " << inst->result_id - << " is defined more than once"; - // Record it. - // A regular value maps to its type. Some instructions (e.g. OpLabel) - // have no type Id, and will map to 0. The result Id for a - // type-generating instruction (e.g. OpTypeInt) maps to itself. - _.id_to_type_id[inst->result_id] = - spvOpcodeGeneratesType(opcode) ? inst->result_id : inst->type_id; - break; - - case SPV_OPERAND_TYPE_ID: - case SPV_OPERAND_TYPE_OPTIONAL_ID: - if (!word) return diagnostic(SPV_ERROR_INVALID_ID) << "Id is 0"; - parsed_operand.type = SPV_OPERAND_TYPE_ID; - - if (opcode == SpvOpExtInst && parsed_operand.offset == 3) { - // The current word is the extended instruction set Id. - // Set the extended instruction set type for the current instruction. - auto ext_inst_type_iter = _.import_id_to_ext_inst_type.find(word); - if (ext_inst_type_iter == _.import_id_to_ext_inst_type.end()) { - return diagnostic(SPV_ERROR_INVALID_ID) - << "OpExtInst set Id " << word - << " does not reference an OpExtInstImport result Id"; - } - inst->ext_inst_type = ext_inst_type_iter->second; - } - break; - - case SPV_OPERAND_TYPE_SCOPE_ID: - case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: - // Check for trivially invalid values. The operand descriptions already - // have the word "ID" in them. - if (!word) return diagnostic() << spvOperandTypeStr(type) << " is 0"; - break; - - case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: { - assert(SpvOpExtInst == opcode); - assert(inst->ext_inst_type != SPV_EXT_INST_TYPE_NONE); - spv_ext_inst_desc ext_inst; - if (grammar_.lookupExtInst(inst->ext_inst_type, word, &ext_inst)) - return diagnostic() << "Invalid extended instruction number: " << word; - spvPushOperandTypes(ext_inst->operandTypes, expected_operands); - } break; - - case SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER: { - assert(SpvOpSpecConstantOp == opcode); - if (grammar_.lookupSpecConstantOpcode(SpvOp(word))) { - return diagnostic() << "Invalid " << spvOperandTypeStr(type) << ": " - << word; - } - spv_opcode_desc opcode_entry = nullptr; - if (grammar_.lookupOpcode(SpvOp(word), &opcode_entry)) { - return diagnostic(SPV_ERROR_INTERNAL) - << "OpSpecConstant opcode table out of sync"; - } - // OpSpecConstant opcodes must have a type and result. We've already - // processed them, so skip them when preparing to parse the other - // operants for the opcode. - assert(opcode_entry->hasType); - assert(opcode_entry->hasResult); - assert(opcode_entry->numTypes >= 2); - spvPushOperandTypes(opcode_entry->operandTypes + 2, expected_operands); - } break; - - case SPV_OPERAND_TYPE_LITERAL_INTEGER: - case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER: - // These are regular single-word literal integer operands. - // Post-parsing validation should check the range of the parsed value. - parsed_operand.type = SPV_OPERAND_TYPE_LITERAL_INTEGER; - // It turns out they are always unsigned integers! - parsed_operand.number_kind = SPV_NUMBER_UNSIGNED_INT; - parsed_operand.number_bit_width = 32; - break; - - case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: - case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER: - parsed_operand.type = SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER; - if (opcode == SpvOpSwitch) { - // The literal operands have the same type as the value - // referenced by the selector Id. - const uint32_t selector_id = peekAt(inst_offset + 1); - const auto type_id_iter = _.id_to_type_id.find(selector_id); - if (type_id_iter == _.id_to_type_id.end() || - type_id_iter->second == 0) { - return diagnostic() << "Invalid OpSwitch: selector id " << selector_id - << " has no type"; - } - uint32_t type_id = type_id_iter->second; - - if (selector_id == type_id) { - // Recall that by convention, a result ID that is a type definition - // maps to itself. - return diagnostic() << "Invalid OpSwitch: selector id " << selector_id - << " is a type, not a value"; - } - if (auto error = setNumericTypeInfoForType(&parsed_operand, type_id)) - return error; - if (parsed_operand.number_kind != SPV_NUMBER_UNSIGNED_INT && - parsed_operand.number_kind != SPV_NUMBER_SIGNED_INT) { - return diagnostic() << "Invalid OpSwitch: selector id " << selector_id - << " is not a scalar integer"; - } - } else { - assert(opcode == SpvOpConstant || opcode == SpvOpSpecConstant); - // The literal number type is determined by the type Id for the - // constant. - assert(inst->type_id); - if (auto error = - setNumericTypeInfoForType(&parsed_operand, inst->type_id)) - return error; - } - break; - - case SPV_OPERAND_TYPE_LITERAL_STRING: - case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING: { - convert_operand_endianness = false; - const char* string = - reinterpret_cast(_.words + _.word_index); - // Compute the length of the string, but make sure we don't run off the - // end of the input. - const size_t remaining_input_bytes = - sizeof(uint32_t) * (_.num_words - _.word_index); - const size_t string_num_content_bytes = - spv_strnlen_s(string, remaining_input_bytes); - // If there was no terminating null byte, then that's an end-of-input - // error. - if (string_num_content_bytes == remaining_input_bytes) - return exhaustedInputDiagnostic(inst_offset, opcode, type); - // Account for null in the word length, so add 1 for null, then add 3 to - // make sure we round up. The following is equivalent to: - // (string_num_content_bytes + 1 + 3) / 4 - const size_t string_num_words = string_num_content_bytes / 4 + 1; - // Make sure we can record the word count without overflow. - // - // This error can't currently be triggered because of validity - // checks elsewhere. - if (string_num_words > std::numeric_limits::max()) { - return diagnostic() << "Literal string is longer than " - << std::numeric_limits::max() - << " words: " << string_num_words << " words long"; - } - parsed_operand.num_words = uint16_t(string_num_words); - parsed_operand.type = SPV_OPERAND_TYPE_LITERAL_STRING; - - if (SpvOpExtInstImport == opcode) { - // Record the extended instruction type for the ID for this import. - // There is only one string literal argument to OpExtInstImport, - // so it's sufficient to guard this just on the opcode. - const spv_ext_inst_type_t ext_inst_type = - spvExtInstImportTypeGet(string); - if (SPV_EXT_INST_TYPE_NONE == ext_inst_type) { - return diagnostic() << "Invalid extended instruction import '" - << string << "'"; - } - // We must have parsed a valid result ID. It's a condition - // of the grammar, and we only accept non-zero result Ids. - assert(inst->result_id); - _.import_id_to_ext_inst_type[inst->result_id] = ext_inst_type; - } - } break; - - case SPV_OPERAND_TYPE_CAPABILITY: - case SPV_OPERAND_TYPE_SOURCE_LANGUAGE: - case SPV_OPERAND_TYPE_EXECUTION_MODEL: - case SPV_OPERAND_TYPE_ADDRESSING_MODEL: - case SPV_OPERAND_TYPE_MEMORY_MODEL: - case SPV_OPERAND_TYPE_EXECUTION_MODE: - case SPV_OPERAND_TYPE_STORAGE_CLASS: - case SPV_OPERAND_TYPE_DIMENSIONALITY: - case SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE: - case SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE: - case SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT: - case SPV_OPERAND_TYPE_FP_ROUNDING_MODE: - case SPV_OPERAND_TYPE_LINKAGE_TYPE: - case SPV_OPERAND_TYPE_ACCESS_QUALIFIER: - case SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER: - case SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE: - case SPV_OPERAND_TYPE_DECORATION: - case SPV_OPERAND_TYPE_BUILT_IN: - case SPV_OPERAND_TYPE_GROUP_OPERATION: - case SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS: - case SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO: { - // A single word that is a plain enum value. - - // Map an optional operand type to its corresponding concrete type. - if (type == SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER) - parsed_operand.type = SPV_OPERAND_TYPE_ACCESS_QUALIFIER; - - spv_operand_desc entry; - if (grammar_.lookupOperand(type, word, &entry)) { - return diagnostic() << "Invalid " - << spvOperandTypeStr(parsed_operand.type) - << " operand: " << word; - } - // Prepare to accept operands to this operand, if needed. - spvPushOperandTypes(entry->operandTypes, expected_operands); - } break; - - case SPV_OPERAND_TYPE_FP_FAST_MATH_MODE: - case SPV_OPERAND_TYPE_FUNCTION_CONTROL: - case SPV_OPERAND_TYPE_LOOP_CONTROL: - case SPV_OPERAND_TYPE_IMAGE: - case SPV_OPERAND_TYPE_OPTIONAL_IMAGE: - case SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS: - case SPV_OPERAND_TYPE_SELECTION_CONTROL: { - // This operand is a mask. - - // Map an optional operand type to its corresponding concrete type. - if (type == SPV_OPERAND_TYPE_OPTIONAL_IMAGE) - parsed_operand.type = SPV_OPERAND_TYPE_IMAGE; - else if (type == SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS) - parsed_operand.type = SPV_OPERAND_TYPE_MEMORY_ACCESS; - - // Check validity of set mask bits. Also prepare for operands for those - // masks if they have any. To get operand order correct, scan from - // MSB to LSB since we can only prepend operands to a pattern. - // The only case in the grammar where you have more than one mask bit - // having an operand is for image operands. See SPIR-V 3.14 Image - // Operands. - uint32_t remaining_word = word; - for (uint32_t mask = (1u << 31); remaining_word; mask >>= 1) { - if (remaining_word & mask) { - spv_operand_desc entry; - if (grammar_.lookupOperand(type, mask, &entry)) { - return diagnostic() - << "Invalid " << spvOperandTypeStr(parsed_operand.type) - << " operand: " << word << " has invalid mask component " - << mask; - } - remaining_word ^= mask; - spvPushOperandTypes(entry->operandTypes, expected_operands); - } - } - if (word == 0) { - // An all-zeroes mask *might* also be valid. - spv_operand_desc entry; - if (SPV_SUCCESS == grammar_.lookupOperand(type, 0, &entry)) { - // Prepare for its operands, if any. - spvPushOperandTypes(entry->operandTypes, expected_operands); - } - } - } break; - default: - return diagnostic() << "Internal error: Unhandled operand type: " << type; - } - - assert(int(SPV_OPERAND_TYPE_FIRST_CONCRETE_TYPE) <= int(parsed_operand.type)); - assert(int(SPV_OPERAND_TYPE_LAST_CONCRETE_TYPE) >= int(parsed_operand.type)); - - operands->push_back(parsed_operand); - - const size_t index_after_operand = _.word_index + parsed_operand.num_words; - - // Avoid buffer overrun for the cases where the operand has more than one - // word, and where it isn't a string. (Those other cases have already been - // handled earlier.) For example, this error can occur for a multi-word - // argument to OpConstant, or a multi-word case literal operand for OpSwitch. - if (_.num_words < index_after_operand) - return exhaustedInputDiagnostic(inst_offset, opcode, type); - - if (_.requires_endian_conversion) { - // Copy instruction words. Translate to native endianness as needed. - if (convert_operand_endianness) { - const spv_endianness_t endianness = _.endian; - std::transform(_.words + _.word_index, _.words + index_after_operand, - std::back_inserter(*words), - [endianness](const uint32_t raw_word) { - return spvFixWord(raw_word, endianness); - }); - } else { - words->insert(words->end(), _.words + _.word_index, - _.words + index_after_operand); - } - } - - // Advance past the operand. - _.word_index = index_after_operand; - - return SPV_SUCCESS; -} - -spv_result_t Parser::setNumericTypeInfoForType( - spv_parsed_operand_t* parsed_operand, uint32_t type_id) { - assert(type_id != 0); - auto type_info_iter = _.type_id_to_number_type_info.find(type_id); - if (type_info_iter == _.type_id_to_number_type_info.end()) { - return diagnostic() << "Type Id " << type_id << " is not a type"; - } - const NumberType& info = type_info_iter->second; - if (info.type == SPV_NUMBER_NONE) { - // This is a valid type, but for something other than a scalar number. - return diagnostic() << "Type Id " << type_id - << " is not a scalar numeric type"; - } - - parsed_operand->number_kind = info.type; - parsed_operand->number_bit_width = info.bit_width; - // Round up the word count. - parsed_operand->num_words = static_cast((info.bit_width + 31) / 32); - return SPV_SUCCESS; -} - -void Parser::recordNumberType(size_t inst_offset, - const spv_parsed_instruction_t* inst) { - const SpvOp opcode = static_cast(inst->opcode); - if (spvOpcodeGeneratesType(opcode)) { - NumberType info = {SPV_NUMBER_NONE, 0}; - if (SpvOpTypeInt == opcode) { - const bool is_signed = peekAt(inst_offset + 3) != 0; - info.type = is_signed ? SPV_NUMBER_SIGNED_INT : SPV_NUMBER_UNSIGNED_INT; - info.bit_width = peekAt(inst_offset + 2); - } else if (SpvOpTypeFloat == opcode) { - info.type = SPV_NUMBER_FLOATING; - info.bit_width = peekAt(inst_offset + 2); - } - // The *result* Id of a type generating instruction is the type Id. - _.type_id_to_number_type_info[inst->result_id] = info; - } -} - -} // anonymous namespace - -spv_result_t spvBinaryParse(const spv_const_context context, void* user_data, - const uint32_t* code, const size_t num_words, - spv_parsed_header_fn_t parsed_header, - spv_parsed_instruction_fn_t parsed_instruction, - spv_diagnostic* diagnostic) { - spv_context_t hijack_context = *context; - if (diagnostic) { - *diagnostic = nullptr; - libspirv::UseDiagnosticAsMessageConsumer(&hijack_context, diagnostic); - } - Parser parser(&hijack_context, user_data, parsed_header, parsed_instruction); - return parser.parse(code, num_words, diagnostic); -} - -// TODO(dneto): This probably belongs in text.cpp since that's the only place -// that a spv_binary_t value is created. -void spvBinaryDestroy(spv_binary binary) { - if (!binary) return; - delete[] binary->code; - delete binary; -} - -size_t spv_strnlen_s(const char* str, size_t strsz) { - if (!str) return 0; - for (size_t i = 0; i < strsz; i++) { - if (!str[i]) return i; - } - return strsz; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/binary.h vulkan-1.1.73+dfsg/external/spirv-tools/source/binary.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/binary.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/binary.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_BINARY_H_ -#define LIBSPIRV_BINARY_H_ - -#include "spirv-tools/libspirv.h" -#include "spirv_definition.h" - -// Functions - -// Grabs the header from the SPIR-V module given in the binary parameter. The -// endian parameter specifies the endianness of the binary module. On success, -// returns SPV_SUCCESS and writes the parsed header into *header. -spv_result_t spvBinaryHeaderGet(const spv_const_binary binary, - const spv_endianness_t endian, - spv_header_t* header); - -// Returns the number of non-null characters in str before the first null -// character, or strsz if there is no null character. Examines at most the -// first strsz characters in str. Returns 0 if str is nullptr. This is a -// replacement for C11's strnlen_s which might not exist in all environments. -size_t spv_strnlen_s(const char* str, size_t strsz); - -#endif // LIBSPIRV_BINARY_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/cfa.h vulkan-1.1.73+dfsg/external/spirv-tools/source/cfa.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/cfa.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/cfa.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,336 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SPVTOOLS_CFA_H_ -#define SPVTOOLS_CFA_H_ - -#include -#include -#include -#include -#include -#include -#include -#include - -using std::find; -using std::function; -using std::get; -using std::pair; -using std::unordered_map; -using std::unordered_set; -using std::vector; - -namespace spvtools { - -// Control Flow Analysis of control flow graphs of basic block nodes |BB|. -template class CFA { - using bb_ptr = BB*; - using cbb_ptr = const BB*; - using bb_iter = typename std::vector::const_iterator; - using get_blocks_func = - std::function*(const BB*)>; - - struct block_info { - cbb_ptr block; ///< pointer to the block - bb_iter iter; ///< Iterator to the current child node being processed - }; - - /// Returns true if a block with @p id is found in the @p work_list vector - /// - /// @param[in] work_list Set of blocks visited in the the depth first traversal - /// of the CFG - /// @param[in] id The ID of the block being checked - /// - /// @return true if the edge work_list.back().block->id() => id is a back-edge - static bool FindInWorkList( - const std::vector& work_list, uint32_t id); - -public: - /// @brief Depth first traversal starting from the \p entry BasicBlock - /// - /// This function performs a depth first traversal from the \p entry - /// BasicBlock and calls the pre/postorder functions when it needs to process - /// the node in pre order, post order. It also calls the backedge function - /// when a back edge is encountered. - /// - /// @param[in] entry The root BasicBlock of a CFG - /// @param[in] successor_func A function which will return a pointer to the - /// successor nodes - /// @param[in] preorder A function that will be called for every block in a - /// CFG following preorder traversal semantics - /// @param[in] postorder A function that will be called for every block in a - /// CFG following postorder traversal semantics - /// @param[in] backedge A function that will be called when a backedge is - /// encountered during a traversal - /// NOTE: The @p successor_func and predecessor_func each return a pointer to a - /// collection such that iterators to that collection remain valid for the - /// lifetime of the algorithm. - static void DepthFirstTraversal(const BB* entry, - get_blocks_func successor_func, - std::function preorder, - std::function postorder, - std::function backedge); - - /// @brief Calculates dominator edges for a set of blocks - /// - /// Computes dominators using the algorithm of Cooper, Harvey, and Kennedy - /// "A Simple, Fast Dominance Algorithm", 2001. - /// - /// The algorithm assumes there is a unique root node (a node without - /// predecessors), and it is therefore at the end of the postorder vector. - /// - /// This function calculates the dominator edges for a set of blocks in the CFG. - /// Uses the dominator algorithm by Cooper et al. - /// - /// @param[in] postorder A vector of blocks in post order traversal order - /// in a CFG - /// @param[in] predecessor_func Function used to get the predecessor nodes of a - /// block - /// - /// @return the dominator tree of the graph, as a vector of pairs of nodes. - /// The first node in the pair is a node in the graph. The second node in the - /// pair is its immediate dominator in the sense of Cooper et.al., where a block - /// without predecessors (such as the root node) is its own immediate dominator. - static vector> CalculateDominators( - const vector& postorder, get_blocks_func predecessor_func); - - // Computes a minimal set of root nodes required to traverse, in the forward - // direction, the CFG represented by the given vector of blocks, and successor - // and predecessor functions. When considering adding two nodes, each having - // predecessors, favour using the one that appears earlier on the input blocks - // list. - static std::vector TraversalRoots( - const std::vector& blocks, - get_blocks_func succ_func, - get_blocks_func pred_func); - - static void ComputeAugmentedCFG( - std::vector& ordered_blocks, - BB* pseudo_entry_block, - BB* pseudo_exit_block, - std::unordered_map>* augmented_successors_map, - std::unordered_map>* augmented_predecessors_map, - get_blocks_func succ_func, - get_blocks_func pred_func); -}; - -template bool CFA::FindInWorkList(const vector& work_list, - uint32_t id) { - for (const auto b : work_list) { - if (b.block->id() == id) return true; - } - return false; -} - -template void CFA::DepthFirstTraversal(const BB* entry, - get_blocks_func successor_func, - function preorder, - function postorder, - function backedge) { - unordered_set processed; - - /// NOTE: work_list is the sequence of nodes from the root node to the node - /// being processed in the traversal - vector work_list; - work_list.reserve(10); - - work_list.push_back({ entry, begin(*successor_func(entry)) }); - preorder(entry); - processed.insert(entry->id()); - - while (!work_list.empty()) { - block_info& top = work_list.back(); - if (top.iter == end(*successor_func(top.block))) { - postorder(top.block); - work_list.pop_back(); - } - else { - BB* child = *top.iter; - top.iter++; - if (FindInWorkList(work_list, child->id())) { - backedge(top.block, child); - } - if (processed.count(child->id()) == 0) { - preorder(child); - work_list.emplace_back( - block_info{ child, begin(*successor_func(child)) }); - processed.insert(child->id()); - } - } - } -} - -template -vector> CFA::CalculateDominators( - const vector& postorder, get_blocks_func predecessor_func) { - struct block_detail { - size_t dominator; ///< The index of blocks's dominator in post order array - size_t postorder_index; ///< The index of the block in the post order array - }; - const size_t undefined_dom = postorder.size(); - - unordered_map idoms; - for (size_t i = 0; i < postorder.size(); i++) { - idoms[postorder[i]] = { undefined_dom, i }; - } - idoms[postorder.back()].dominator = idoms[postorder.back()].postorder_index; - - bool changed = true; - while (changed) { - changed = false; - for (auto b = postorder.rbegin() + 1; b != postorder.rend(); ++b) { - const vector& predecessors = *predecessor_func(*b); - // Find the first processed/reachable predecessor that is reachable - // in the forward traversal. - auto res = find_if(begin(predecessors), end(predecessors), - [&idoms, undefined_dom](BB* pred) { - return idoms.count(pred) && - idoms[pred].dominator != undefined_dom; - }); - if (res == end(predecessors)) continue; - const BB* idom = *res; - size_t idom_idx = idoms[idom].postorder_index; - - // all other predecessors - for (const auto* p : predecessors) { - if (idom == p) continue; - // Only consider nodes reachable in the forward traversal. - // Otherwise the intersection doesn't make sense and will never - // terminate. - if (!idoms.count(p)) continue; - if (idoms[p].dominator != undefined_dom) { - size_t finger1 = idoms[p].postorder_index; - size_t finger2 = idom_idx; - while (finger1 != finger2) { - while (finger1 < finger2) { - finger1 = idoms[postorder[finger1]].dominator; - } - while (finger2 < finger1) { - finger2 = idoms[postorder[finger2]].dominator; - } - } - idom_idx = finger1; - } - } - if (idoms[*b].dominator != idom_idx) { - idoms[*b].dominator = idom_idx; - changed = true; - } - } - } - - vector> out; - for (auto idom : idoms) { - // NOTE: performing a const cast for convenient usage with - // UpdateImmediateDominators - out.push_back({ const_cast(get<0>(idom)), - const_cast(postorder[get<1>(idom).dominator]) }); - } - return out; -} - -template -std::vector CFA::TraversalRoots( - const std::vector& blocks, - get_blocks_func succ_func, - get_blocks_func pred_func) { - // The set of nodes which have been visited from any of the roots so far. - std::unordered_set visited; - - auto mark_visited = [&visited](const BB* b) { visited.insert(b); }; - auto ignore_block = [](const BB*) {}; - auto ignore_blocks = [](const BB*, const BB*) {}; - - - auto traverse_from_root = [&mark_visited, &succ_func, &ignore_block, - &ignore_blocks](const BB* entry) { - DepthFirstTraversal( - entry, succ_func, mark_visited, ignore_block, ignore_blocks); - }; - - std::vector result; - - // First collect nodes without predecessors. - for (auto block : blocks) { - if (pred_func(block)->empty()) { - assert(visited.count(block) == 0 && "Malformed graph!"); - result.push_back(block); - traverse_from_root(block); - } - } - - // Now collect other stranded nodes. These must be in unreachable cycles. - for (auto block : blocks) { - if (visited.count(block) == 0) { - result.push_back(block); - traverse_from_root(block); - } - } - - return result; -} - -template -void CFA::ComputeAugmentedCFG( - std::vector& ordered_blocks, - BB* pseudo_entry_block, BB* pseudo_exit_block, - std::unordered_map>* augmented_successors_map, - std::unordered_map>* augmented_predecessors_map, - get_blocks_func succ_func, - get_blocks_func pred_func) { - - // Compute the successors of the pseudo-entry block, and - // the predecessors of the pseudo exit block. - auto sources = TraversalRoots(ordered_blocks, succ_func, pred_func); - - // For the predecessor traversals, reverse the order of blocks. This - // will affect the post-dominance calculation as follows: - // - Suppose you have blocks A and B, with A appearing before B in - // the list of blocks. - // - Also, A branches only to B, and B branches only to A. - // - We want to compute A as dominating B, and B as post-dominating B. - // By using reversed blocks for predecessor traversal roots discovery, - // we'll add an edge from B to the pseudo-exit node, rather than from A. - // All this is needed to correctly process the dominance/post-dominance - // constraint when A is a loop header that points to itself as its - // own continue target, and B is the latch block for the loop. - std::vector reversed_blocks(ordered_blocks.rbegin(), - ordered_blocks.rend()); - auto sinks = TraversalRoots(reversed_blocks, pred_func, succ_func); - - // Wire up the pseudo entry block. - (*augmented_successors_map)[pseudo_entry_block] = sources; - for (auto block : sources) { - auto& augmented_preds = (*augmented_predecessors_map)[block]; - const auto preds = pred_func(block); - augmented_preds.reserve(1 + preds->size()); - augmented_preds.push_back(pseudo_entry_block); - augmented_preds.insert(augmented_preds.end(), preds->begin(), preds->end()); - } - - // Wire up the pseudo exit block. - (*augmented_predecessors_map)[pseudo_exit_block] = sinks; - for (auto block : sinks) { - auto& augmented_succ = (*augmented_successors_map)[block]; - const auto succ = succ_func(block); - augmented_succ.reserve(1 + succ->size()); - augmented_succ.push_back(pseudo_exit_block); - augmented_succ.insert(augmented_succ.end(), succ->begin(), succ->end()); - } -}; - -} // namespace spvtools - -#endif // SPVTOOLS_CFA_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/source/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,304 +0,0 @@ -# Copyright (c) 2015-2016 The Khronos Group Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set(GRAMMAR_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_grammar_tables.py") -set(VIMSYNTAX_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_vim_syntax.py") -set(XML_REGISTRY_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_registry_tables.py") - -# macro() definitions are used in the following because we need to append .inc -# file paths into some global lists (*_CPP_DEPENDS). And those global lists are -# later used by set_source_files_properties() calls. -# function() definitions are not suitable because they create new scopes. -macro(spvtools_core_tables VERSION) - set(GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/spirv.core.grammar.json") - set(GRAMMAR_INSTS_INC_FILE "${spirv-tools_BINARY_DIR}/core.insts-${VERSION}.inc") - set(GRAMMAR_KINDS_INC_FILE "${spirv-tools_BINARY_DIR}/operand.kinds-${VERSION}.inc") - add_custom_command(OUTPUT ${GRAMMAR_INSTS_INC_FILE} ${GRAMMAR_KINDS_INC_FILE} - COMMAND ${PYTHON_EXECUTABLE} ${GRAMMAR_PROCESSING_SCRIPT} - --spirv-core-grammar=${GRAMMAR_JSON_FILE} - --core-insts-output=${GRAMMAR_INSTS_INC_FILE} - --operand-kinds-output=${GRAMMAR_KINDS_INC_FILE} - DEPENDS ${GRAMMAR_PROCESSING_SCRIPT} ${GRAMMAR_JSON_FILE} - COMMENT "Generate info tables for SPIR-V v${VERSION} core instructions and operands.") - list(APPEND OPCODE_CPP_DEPENDS ${GRAMMAR_INSTS_INC_FILE}) - list(APPEND OPERAND_CPP_DEPENDS ${GRAMMAR_KINDS_INC_FILE}) -endmacro(spvtools_core_tables) - -macro(spvtools_enum_string_mapping VERSION) - set(GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/spirv.core.grammar.json") - set(GRAMMAR_EXTENSION_ENUM_INC_FILE "${spirv-tools_BINARY_DIR}/extension_enum.inc") - set(GRAMMAR_ENUM_STRING_MAPPING_INC_FILE "${spirv-tools_BINARY_DIR}/enum_string_mapping.inc") - add_custom_command(OUTPUT ${GRAMMAR_EXTENSION_ENUM_INC_FILE} - ${GRAMMAR_ENUM_STRING_MAPPING_INC_FILE} - COMMAND ${PYTHON_EXECUTABLE} ${GRAMMAR_PROCESSING_SCRIPT} - --spirv-core-grammar=${GRAMMAR_JSON_FILE} - --extension-enum-output=${GRAMMAR_EXTENSION_ENUM_INC_FILE} - --enum-string-mapping-output=${GRAMMAR_ENUM_STRING_MAPPING_INC_FILE} - DEPENDS ${GRAMMAR_PROCESSING_SCRIPT} ${GRAMMAR_JSON_FILE} - COMMENT "Generate enum-string mapping for SPIR-V v${VERSION}.") - list(APPEND EXTENSION_H_DEPENDS ${GRAMMAR_EXTENSION_ENUM_INC_FILE}) - list(APPEND ENUM_STRING_MAPPING_CPP_DEPENDS ${GRAMMAR_ENUM_STRING_MAPPING_INC_FILE}) -endmacro(spvtools_enum_string_mapping) - -macro(spvtools_vimsyntax VERSION CLVERSION) - set(GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/spirv.core.grammar.json") - set(GLSL_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/extinst.glsl.std.450.grammar.json") - set(OPENCL_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/extinst.opencl.std.100.grammar.json") - set(VIMSYNTAX_FILE "${spirv-tools_BINARY_DIR}/spvasm.vim") - add_custom_command(OUTPUT ${VIMSYNTAX_FILE} - COMMAND ${PYTHON_EXECUTABLE} ${VIMSYNTAX_PROCESSING_SCRIPT} - --spirv-core-grammar=${GRAMMAR_JSON_FILE} - --extinst-glsl-grammar=${GLSL_GRAMMAR_JSON_FILE} - --extinst-opencl-grammar=${OPENCL_GRAMMAR_JSON_FILE} - >${VIMSYNTAX_FILE} - DEPENDS ${VIMSYNTAX_PROCESSING_SCRIPT} ${GRAMMAR_JSON_FILE} - ${GLSL_GRAMMAR_JSON_FILE} ${OPENCL_GRAMMAR_JSON_FILE} - COMMENT "Generate spvasm.vim: Vim syntax file for SPIR-V assembly.") -endmacro(spvtools_vimsyntax) - -macro(spvtools_glsl_tables VERSION) - set(CORE_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/spirv.core.grammar.json") - set(GLSL_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/extinst.glsl.std.450.grammar.json") - set(GRAMMAR_INC_FILE "${spirv-tools_BINARY_DIR}/glsl.std.450.insts-${VERSION}.inc") - add_custom_command(OUTPUT ${GRAMMAR_INC_FILE} - COMMAND ${PYTHON_EXECUTABLE} ${GRAMMAR_PROCESSING_SCRIPT} - --spirv-core-grammar=${CORE_GRAMMAR_JSON_FILE} - --extinst-glsl-grammar=${GLSL_GRAMMAR_JSON_FILE} - --glsl-insts-output=${GRAMMAR_INC_FILE} - DEPENDS ${GRAMMAR_PROCESSING_SCRIPT} ${CORE_GRAMMAR_JSON_FILE} ${GLSL_GRAMMAR_JSON_FILE} - COMMENT "Generate info tables for GLSL extended instructions and operands v${VERSION}.") - list(APPEND EXTINST_CPP_DEPENDS ${GRAMMAR_INC_FILE}) -endmacro(spvtools_glsl_tables) - -macro(spvtools_opencl_tables VERSION) - set(CORE_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/spirv.core.grammar.json") - set(OPENCL_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/extinst.opencl.std.100.grammar.json") - set(GRAMMAR_INC_FILE "${spirv-tools_BINARY_DIR}/opencl.std.insts-${VERSION}.inc") - add_custom_command(OUTPUT ${GRAMMAR_INC_FILE} - COMMAND ${PYTHON_EXECUTABLE} ${GRAMMAR_PROCESSING_SCRIPT} - --spirv-core-grammar=${CORE_GRAMMAR_JSON_FILE} - --extinst-opencl-grammar=${OPENCL_GRAMMAR_JSON_FILE} - --opencl-insts-output=${GRAMMAR_INC_FILE} - DEPENDS ${GRAMMAR_PROCESSING_SCRIPT} ${CORE_GRAMMAR_JSON_FILE} ${OPENCL_GRAMMAR_JSON_FILE} - COMMENT "Generate info tables for OpenCL extended instructions and operands v${VERSION}.") - list(APPEND EXTINST_CPP_DEPENDS ${GRAMMAR_INC_FILE}) -endmacro(spvtools_opencl_tables) - -macro(spvtools_vendor_tables VENDOR_TABLE) - set(INSTS_FILE "${spirv-tools_BINARY_DIR}/${VENDOR_TABLE}.insts.inc") - set(GRAMMAR_FILE "${spirv-tools_SOURCE_DIR}/source/extinst.${VENDOR_TABLE}.grammar.json") - add_custom_command(OUTPUT ${INSTS_FILE} - COMMAND ${PYTHON_EXECUTABLE} ${GRAMMAR_PROCESSING_SCRIPT} - --extinst-vendor-grammar=${GRAMMAR_FILE} - --vendor-insts-output=${INSTS_FILE} - DEPENDS ${GRAMMAR_PROCESSING_SCRIPT} ${GRAMMAR_FILE} - COMMENT "Generate extended instruction tables for ${VENDOR_TABLE}.") - list(APPEND EXTINST_CPP_DEPENDS ${INSTS_FILE}) - add_custom_target(spirv-tools-${VENDOR_TABLE} DEPENDS ${INSTS_FILE}) - set_property(TARGET spirv-tools-${VENDOR_TABLE} PROPERTY FOLDER "SPIRV-Tools build") -endmacro(spvtools_vendor_tables) - -spvtools_core_tables("1.0") -spvtools_core_tables("1.1") -spvtools_core_tables("1.2") -spvtools_enum_string_mapping("1.2") -spvtools_opencl_tables("1.0") -spvtools_glsl_tables("1.0") -spvtools_vendor_tables("spv-amd-shader-explicit-vertex-parameter") -spvtools_vendor_tables("spv-amd-shader-trinary-minmax") -spvtools_vendor_tables("spv-amd-gcn-shader") -spvtools_vendor_tables("spv-amd-shader-ballot") - -spvtools_vimsyntax("1.2" "1.0") -add_custom_target(spirv-tools-vimsyntax DEPENDS ${VIMSYNTAX_FILE}) -set_property(TARGET spirv-tools-vimsyntax PROPERTY FOLDER "SPIRV-Tools utilities") - -# Extract the list of known generators from the SPIR-V XML registry file. -set(GENERATOR_INC_FILE ${spirv-tools_BINARY_DIR}/generators.inc) -set(SPIRV_XML_REGISTRY_FILE ${SPIRV_HEADER_INCLUDE_DIR}/spirv/spir-v.xml) -add_custom_command(OUTPUT ${GENERATOR_INC_FILE} - COMMAND ${PYTHON_EXECUTABLE} ${XML_REGISTRY_PROCESSING_SCRIPT} - --xml=${SPIRV_XML_REGISTRY_FILE} - --generator-output=${GENERATOR_INC_FILE} - DEPENDS ${XML_REGISTRY_PROCESSING_SCRIPT} ${SPIRV_XML_REGISTRY_FILE} - COMMENT "Generate tables based on the SPIR-V XML registry.") -list(APPEND OPCODE_CPP_DEPENDS ${GENERATOR_INC_FILE}) - -# The following .cpp files include the above generated .inc files. -# Add those .inc files as their dependencies. -# -# Why using such an awkward way? -# * If we use add_custom_target() to define a target to generate all .inc files -# and let ${SPIRV_TOOLS} depend on it, then we need to run ninja twice every -# time the grammar is updated: the first time is for generating those .inc -# files, and the second time is for rebuilding .cpp files, when ninja finds -# out that .inc files are updated. -# * If we use add_custom_command() with PRE_BUILD, then the grammar processing -# script will always run no matter whether the grammar is updated. -# * add_dependencies() is used to add *target* dependencies to a target. -# * The following solution only generates .inc files when the script or the -# grammar files is updated, and in a single ninja run. -set_source_files_properties( - ${CMAKE_CURRENT_SOURCE_DIR}/opcode.cpp - PROPERTIES OBJECT_DEPENDS "${OPCODE_CPP_DEPENDS}") -set_source_files_properties( - ${CMAKE_CURRENT_SOURCE_DIR}/operand.cpp - PROPERTIES OBJECT_DEPENDS "${OPERAND_CPP_DEPENDS}") -set_source_files_properties( - ${CMAKE_CURRENT_SOURCE_DIR}/ext_inst.cpp - PROPERTIES OBJECT_DEPENDS "${EXTINST_CPP_DEPENDS}") -set_source_files_properties( - ${CMAKE_CURRENT_SOURCE_DIR}/enum_string_mapping.cpp - PROPERTIES OBJECT_DEPENDS "${ENUM_STRING_MAPPING_CPP_DEPENDS}") - -set_source_files_properties( - ${CMAKE_CURRENT_SOURCE_DIR}/extension.h - PROPERTIES HEADER_FILE_ONLY TRUE) -set_source_files_properties( - ${CMAKE_CURRENT_SOURCE_DIR}/extension.h - PROPERTIES OBJECT_DEPENDS "${EXTENSION_H_DEPENDS}") - -set(SPIRV_TOOLS_BUILD_VERSION_INC - ${spirv-tools_BINARY_DIR}/build-version.inc) -set(SPIRV_TOOLS_BUILD_VERSION_INC_GENERATOR - ${spirv-tools_SOURCE_DIR}/utils/update_build_version.py) -set(SPIRV_TOOLS_CHANGES_FILE - ${spirv-tools_SOURCE_DIR}/CHANGES) -add_custom_command(OUTPUT ${SPIRV_TOOLS_BUILD_VERSION_INC} - COMMAND ${PYTHON_EXECUTABLE} - ${SPIRV_TOOLS_BUILD_VERSION_INC_GENERATOR} - ${spirv-tools_SOURCE_DIR} ${SPIRV_TOOLS_BUILD_VERSION_INC} - DEPENDS ${SPIRV_TOOLS_BUILD_VERSION_INC_GENERATOR} - ${SPIRV_TOOLS_CHANGES_FILE} - COMMENT "Update build-version.inc in the SPIRV-Tools build directory (if necessary).") -# Convenience target for standalone generation of the build-version.inc file. -# This is not required for any dependence chain. -add_custom_target(spirv-tools-build-version - DEPENDS ${SPIRV_TOOLS_BUILD_VERSION_INC}) -set_property(TARGET spirv-tools-build-version PROPERTY FOLDER "SPIRV-Tools build") - -add_subdirectory(comp) -add_subdirectory(opt) -add_subdirectory(link) - -set(SPIRV_SOURCES - ${spirv-tools_SOURCE_DIR}/include/spirv-tools/libspirv.h - - ${CMAKE_CURRENT_SOURCE_DIR}/util/bitutils.h - ${CMAKE_CURRENT_SOURCE_DIR}/util/bit_stream.h - ${CMAKE_CURRENT_SOURCE_DIR}/util/hex_float.h - ${CMAKE_CURRENT_SOURCE_DIR}/util/parse_number.h - ${CMAKE_CURRENT_SOURCE_DIR}/util/string_utils.h - ${CMAKE_CURRENT_SOURCE_DIR}/assembly_grammar.h - ${CMAKE_CURRENT_SOURCE_DIR}/binary.h - ${CMAKE_CURRENT_SOURCE_DIR}/cfa.h - ${CMAKE_CURRENT_SOURCE_DIR}/diagnostic.h - ${CMAKE_CURRENT_SOURCE_DIR}/enum_set.h - ${CMAKE_CURRENT_SOURCE_DIR}/enum_string_mapping.h - ${CMAKE_CURRENT_SOURCE_DIR}/ext_inst.h - ${CMAKE_CURRENT_SOURCE_DIR}/extensions.h - ${CMAKE_CURRENT_SOURCE_DIR}/id_descriptor.h - ${CMAKE_CURRENT_SOURCE_DIR}/instruction.h - ${CMAKE_CURRENT_SOURCE_DIR}/macro.h - ${CMAKE_CURRENT_SOURCE_DIR}/name_mapper.h - ${CMAKE_CURRENT_SOURCE_DIR}/opcode.h - ${CMAKE_CURRENT_SOURCE_DIR}/operand.h - ${CMAKE_CURRENT_SOURCE_DIR}/parsed_operand.h - ${CMAKE_CURRENT_SOURCE_DIR}/print.h - ${CMAKE_CURRENT_SOURCE_DIR}/spirv_constant.h - ${CMAKE_CURRENT_SOURCE_DIR}/spirv_definition.h - ${CMAKE_CURRENT_SOURCE_DIR}/spirv_endian.h - ${CMAKE_CURRENT_SOURCE_DIR}/spirv_target_env.h - ${CMAKE_CURRENT_SOURCE_DIR}/spirv_validator_options.h - ${CMAKE_CURRENT_SOURCE_DIR}/table.h - ${CMAKE_CURRENT_SOURCE_DIR}/text.h - ${CMAKE_CURRENT_SOURCE_DIR}/text_handler.h - ${CMAKE_CURRENT_SOURCE_DIR}/validate.h - - ${CMAKE_CURRENT_SOURCE_DIR}/util/bit_stream.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/util/parse_number.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/util/string_utils.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/assembly_grammar.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/binary.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/diagnostic.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/disassemble.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/enum_string_mapping.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/ext_inst.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extensions.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/id_descriptor.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/libspirv.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/message.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/name_mapper.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/opcode.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/operand.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/parsed_operand.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/print.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/software_version.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/spirv_endian.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/spirv_stats.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/spirv_target_env.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/spirv_validator_options.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/table.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/text.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/text_handler.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/validate.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/validate_arithmetics.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/validate_bitwise.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/validate_capability.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/validate_cfg.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/validate_conversion.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/validate_datarules.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/validate_decorations.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/validate_id.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/validate_instruction.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/validate_layout.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/validate_logicals.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/validate_type_unique.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/val/decoration.h - ${CMAKE_CURRENT_SOURCE_DIR}/val/basic_block.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/val/construct.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/val/function.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/val/instruction.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/val/validation_state.cpp) - -# The software_version.cpp file includes build-version.inc. -# Rebuild the software_version.cpp object file if it is older than -# build-version.inc or whenever build-version.inc itself is out of -# date. In the latter case, rebuild build-version.inc first. -# CMake is not smart enough to detect this dependency automatically. -# Without this, the dependency detection system for #included files -# does not kick in on a clean build for the following reason: The -# build will fail early because it doesn't know how to build the -# missing source file build-version.inc. That occurs before the -# preprocessor is run on software_version.cpp to detect the -# #include dependency. -set_source_files_properties( - ${CMAKE_CURRENT_SOURCE_DIR}/software_version.cpp - PROPERTIES OBJECT_DEPENDS "${SPIRV_TOOLS_BUILD_VERSION_INC}") - -add_library(${SPIRV_TOOLS} ${SPIRV_SOURCES}) -spvtools_default_compile_options(${SPIRV_TOOLS}) -target_include_directories(${SPIRV_TOOLS} - PUBLIC ${spirv-tools_SOURCE_DIR}/include - PRIVATE ${spirv-tools_BINARY_DIR} - PRIVATE ${SPIRV_HEADER_INCLUDE_DIR} - ) -set_property(TARGET ${SPIRV_TOOLS} PROPERTY FOLDER "SPIRV-Tools libraries") - -if(ENABLE_SPIRV_TOOLS_INSTALL) - install(TARGETS ${SPIRV_TOOLS} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -endif(ENABLE_SPIRV_TOOLS_INSTALL) diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/comp/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/source/comp/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/comp/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/comp/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -# Copyright (c) 2017 Google 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. - -if(SPIRV_BUILD_COMPRESSION) - add_library(SPIRV-Tools-comp markv_codec.cpp) - - spvtools_default_compile_options(SPIRV-Tools-comp) - target_include_directories(SPIRV-Tools-comp - PUBLIC ${spirv-tools_SOURCE_DIR}/include - PUBLIC ${SPIRV_HEADER_INCLUDE_DIR} - PRIVATE ${spirv-tools_BINARY_DIR} - ) - - target_link_libraries(SPIRV-Tools-comp - PUBLIC ${SPIRV_TOOLS}) - - set_property(TARGET SPIRV-Tools-comp PROPERTY FOLDER "SPIRV-Tools libraries") - - if(ENABLE_SPIRV_TOOLS_INSTALL) - install(TARGETS SPIRV-Tools-comp - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(ENABLE_SPIRV_TOOLS_INSTALL) - -endif(SPIRV_BUILD_COMPRESSION) diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/comp/markv_codec.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/comp/markv_codec.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/comp/markv_codec.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/comp/markv_codec.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,2923 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Contains -// - SPIR-V to MARK-V encoder -// - MARK-V to SPIR-V decoder -// -// MARK-V is a compression format for SPIR-V binaries. It strips away -// non-essential information (such as result ids which can be regenerated) and -// uses various bit reduction techiniques to reduce the size of the binary. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "spirv/1.2/GLSL.std.450.h" -#include "spirv/1.2/OpenCL.std.h" -#include "spirv/1.2/spirv.h" - -#include "binary.h" -#include "diagnostic.h" -#include "enum_string_mapping.h" -#include "extensions.h" -#include "ext_inst.h" -#include "id_descriptor.h" -#include "instruction.h" -#include "markv.h" -#include "markv_model.h" -#include "opcode.h" -#include "operand.h" -#include "spirv-tools/libspirv.h" -#include "spirv_endian.h" -#include "spirv_validator_options.h" -#include "util/bit_stream.h" -#include "util/huffman_codec.h" -#include "util/move_to_front.h" -#include "util/parse_number.h" -#include "validate.h" -#include "val/instruction.h" -#include "val/validation_state.h" - -using libspirv::IdDescriptorCollection; -using libspirv::Instruction; -using libspirv::ValidationState_t; -using libspirv::DiagnosticStream; -using spvtools::ValidateInstructionAndUpdateValidationState; -using spvutils::BitReaderWord64; -using spvutils::BitWriterWord64; -using spvutils::HuffmanCodec; -using MoveToFront = spvutils::MoveToFront; -using MultiMoveToFront = spvutils::MultiMoveToFront; - -namespace spvtools { - -namespace { - -const uint32_t kSpirvMagicNumber = SpvMagicNumber; -const uint32_t kMarkvMagicNumber = 0x07230303; - -// Handles for move-to-front sequences. Enums which end with "Begin" define -// handle spaces which start at that value and span 16 or 32 bit wide. -enum : uint64_t { - kMtfNone = 0, - // All ids. - kMtfAll, - // All forward declared ids. - kMtfForwardDeclared, - // All type ids except for generated by OpTypeFunction. - kMtfTypeNonFunction, - // All labels. - kMtfLabel, - // All ids created by instructions which had type_id. - kMtfObject, - // All types generated by OpTypeFloat, OpTypeInt, OpTypeBool. - kMtfTypeScalar, - // All composite types. - kMtfTypeComposite, - // Boolean type or any vector type of it. - kMtfTypeBoolScalarOrVector, - // All float types or any vector floats type. - kMtfTypeFloatScalarOrVector, - // All int types or any vector int type. - kMtfTypeIntScalarOrVector, - // All types declared as return types in OpTypeFunction. - kMtfTypeReturnedByFunction, - // All object ids which are integer constants. - kMtfConstInteger, - // All composite objects. - kMtfComposite, - // All bool objects or vectors of bools. - kMtfBoolScalarOrVector, - // All float objects or vectors of float. - kMtfFloatScalarOrVector, - // All int objects or vectors of int. - kMtfIntScalarOrVector, - // All pointer types which point to composited. - kMtfTypePointerToComposite, - // Used by EncodeMtfRankHuffman. - kMtfGenericNonZeroRank, - // Handle space for ids of specific type. - kMtfIdOfTypeBegin = 0x10000, - // Handle space for ids generated by specific opcode. - kMtfIdGeneratedByOpcode = 0x20000, - // Handle space for ids of objects with type generated by specific opcode. - kMtfIdWithTypeGeneratedByOpcodeBegin = 0x30000, - // All vectors of specific component type. - kMtfVectorOfComponentTypeBegin = 0x40000, - // All vector types of specific size. - kMtfTypeVectorOfSizeBegin = 0x50000, - // All pointer types to specific type. - kMtfPointerToTypeBegin = 0x60000, - // All function types which return specific type. - kMtfFunctionTypeWithReturnTypeBegin = 0x70000, - // All function objects which return specific type. - kMtfFunctionWithReturnTypeBegin = 0x80000, - // All float vectors of specific size. - kMtfFloatVectorOfSizeBegin = 0x90000, - // Id descriptor space (32-bit). - kMtfIdDescriptorSpaceBegin = 0x100000000, -}; - -// Used by "presumed index" technique which does special treatment of integer -// constants no greater than this value. -const uint32_t kMarkvMaxPresumedAccessIndex = 31; - -// Signals that the value is not in the coding scheme and a fallback method -// needs to be used. -const uint64_t kMarkvNoneOfTheAbove = MarkvModel::GetMarkvNoneOfTheAbove(); - -// Mtf ranks smaller than this are encoded with Huffman coding. -const uint32_t kMtfSmallestRankEncodedByValue = 10; - -// Signals that the mtf rank is too large to be encoded with Huffman. -const uint32_t kMtfRankEncodedByValueSignal = - std::numeric_limits::max(); - -const size_t kCommentNumWhitespaces = 2; - -const size_t kByteBreakAfterInstIfLessThanUntilNextByte = 8; - -// Returns a set of mtf rank codecs based on a plausible hand-coded -// distribution. -std::map>> -GetMtfHuffmanCodecs() { - std::map>> codecs; - - std::unique_ptr> codec; - - codec.reset(new HuffmanCodec(std::map({ - { 0, 5 }, - { 1, 40 }, - { 2, 10 }, - { 3, 5 }, - { 4, 5 }, - { 5, 5 }, - { 6, 3 }, - { 7, 3 }, - { 8, 3 }, - { 9, 3 }, - { kMtfRankEncodedByValueSignal, 10 }, - }))); - codecs.emplace(kMtfAll, std::move(codec)); - - codec.reset(new HuffmanCodec(std::map({ - { 1, 50 }, - { 2, 20 }, - { 3, 5 }, - { 4, 5 }, - { 5, 2 }, - { 6, 1 }, - { 7, 1 }, - { 8, 1 }, - { 9, 1 }, - { kMtfRankEncodedByValueSignal, 10 }, - }))); - codecs.emplace(kMtfGenericNonZeroRank, std::move(codec)); - - return codecs; -} - -// Returns true if the opcode has a fixed number of operands. May return a -// false negative. -bool OpcodeHasFixedNumberOfOperands(SpvOp opcode) { - switch (opcode) { - // TODO(atgoo@github.com) This is not a complete list. - case SpvOpNop: - case SpvOpName: - case SpvOpUndef: - case SpvOpSizeOf: - case SpvOpLine: - case SpvOpNoLine: - case SpvOpDecorationGroup: - case SpvOpExtension: - case SpvOpExtInstImport: - case SpvOpMemoryModel: - case SpvOpCapability: - case SpvOpTypeVoid: - case SpvOpTypeBool: - case SpvOpTypeInt: - case SpvOpTypeFloat: - case SpvOpTypeVector: - case SpvOpTypeMatrix: - case SpvOpTypeSampler: - case SpvOpTypeSampledImage: - case SpvOpTypeArray: - case SpvOpTypePointer: - case SpvOpConstantTrue: - case SpvOpConstantFalse: - case SpvOpLabel: - case SpvOpBranch: - case SpvOpFunction: - case SpvOpFunctionParameter: - case SpvOpFunctionEnd: - case SpvOpBitcast: - case SpvOpCopyObject: - case SpvOpTranspose: - case SpvOpSNegate: - case SpvOpFNegate: - case SpvOpIAdd: - case SpvOpFAdd: - case SpvOpISub: - case SpvOpFSub: - case SpvOpIMul: - case SpvOpFMul: - case SpvOpUDiv: - case SpvOpSDiv: - case SpvOpFDiv: - case SpvOpUMod: - case SpvOpSRem: - case SpvOpSMod: - case SpvOpFRem: - case SpvOpFMod: - case SpvOpVectorTimesScalar: - case SpvOpMatrixTimesScalar: - case SpvOpVectorTimesMatrix: - case SpvOpMatrixTimesVector: - case SpvOpMatrixTimesMatrix: - case SpvOpOuterProduct: - case SpvOpDot: - return true; - default: - break; - } - return false; -} - -size_t GetNumBitsToNextByte(size_t bit_pos) { - return (8 - (bit_pos % 8)) % 8; -} - -// Defines and returns current MARK-V version. -uint32_t GetMarkvVersion() { - const uint32_t kVersionMajor = 1; - const uint32_t kVersionMinor = 2; - return kVersionMinor | (kVersionMajor << 16); -} - -class CommentLogger { - public: - void AppendText(const std::string& str) { - Append(str); - use_delimiter_ = false; - } - - void AppendTextNewLine(const std::string& str) { - Append(str); - Append("\n"); - use_delimiter_ = false; - } - - void AppendBitSequence(const std::string& str) { - if (use_delimiter_) - Append("-"); - Append(str); - use_delimiter_ = true; - } - - void AppendWhitespaces(size_t num) { - Append(std::string(num, ' ')); - use_delimiter_ = false; - } - - void NewLine() { - Append("\n"); - use_delimiter_ = false; - } - - std::string GetText() const { - return ss_.str(); - } - - private: - void Append(const std::string& str) { - ss_ << str; - // std::cerr << str; - } - - std::stringstream ss_; - - // If true a delimiter will be appended before the next bit sequence. - // Used to generate outputs like: 1100-0 1110-1-1100-1-1111-0 110-0. - bool use_delimiter_ = false; -}; - -// Base class for MARK-V encoder and decoder. Contains common functionality -// such as: -// - Validator connection and validation state. -// - SPIR-V grammar and helper functions. -class MarkvCodecBase { - public: - virtual ~MarkvCodecBase() { - spvValidatorOptionsDestroy(validator_options_); - } - - MarkvCodecBase() = delete; - - protected: - struct MarkvHeader { - MarkvHeader() { - magic_number = kMarkvMagicNumber; - markv_version = GetMarkvVersion(); - markv_model = 0; - markv_length_in_bits = 0; - spirv_version = 0; - spirv_generator = 0; - } - - uint32_t magic_number; - uint32_t markv_version; - // Magic number to identify or verify MarkvModel used for encoding. - uint32_t markv_model; - uint32_t markv_length_in_bits; - uint32_t spirv_version; - uint32_t spirv_generator; - }; - - // |model| is owned by the caller, must be not null and valid during the - // lifetime of the codec. - explicit MarkvCodecBase(spv_const_context context, - spv_validator_options validator_options, - const MarkvModel* model) - : validator_options_(validator_options), grammar_(context), - model_(model), mtf_huffman_codecs_(GetMtfHuffmanCodecs()), - context_(context), - vstate_(validator_options ? - new ValidationState_t(context, validator_options_) : nullptr) {} - - // Validates a single instruction and updates validation state of the module. - // Does nothing and returns SPV_SUCCESS if validator was not created. - spv_result_t UpdateValidationState(const spv_parsed_instruction_t& inst) { - if (!vstate_) - return SPV_SUCCESS; - - return ValidateInstructionAndUpdateValidationState(vstate_.get(), &inst); - } - - // Returns instruction which created |id| or nullptr if such instruction was - // not registered. - const Instruction* FindDef(uint32_t id) const { - const auto it = id_to_def_instruction_.find(id); - if (it == id_to_def_instruction_.end()) - return nullptr; - return it->second; - } - - // Returns type id of vector type component. - uint32_t GetVectorComponentType(uint32_t vector_type_id) const { - const Instruction* type_inst = FindDef(vector_type_id); - assert(type_inst); - assert(type_inst->opcode() == SpvOpTypeVector); - - const uint32_t component_type = - type_inst->word(type_inst->operands()[1].offset); - return component_type; - } - - // Returns mtf handle for ids of given type. - uint64_t GetMtfIdOfType(uint32_t type_id) const { - return kMtfIdOfTypeBegin + type_id; - } - - // Returns mtf handle for ids generated by given opcode. - uint64_t GetMtfIdGeneratedByOpcode(SpvOp opcode) const { - return kMtfIdGeneratedByOpcode + opcode; - } - - // Returns mtf handle for ids of type generated by given opcode. - uint64_t GetMtfIdWithTypeGeneratedByOpcode(SpvOp opcode) const { - return kMtfIdWithTypeGeneratedByOpcodeBegin + opcode; - } - - // Returns mtf handle for vectors of specific component type. - uint64_t GetMtfVectorOfComponentType(uint32_t type_id) const { - return kMtfVectorOfComponentTypeBegin + type_id; - } - - // Returns mtf handle for float vectors of specific size. - uint64_t GetMtfFloatVectorOfSize(uint32_t size) const { - return kMtfFloatVectorOfSizeBegin + size; - } - - // Returns mtf handle for vector type of specific size. - uint64_t GetMtfTypeVectorOfSize(uint32_t size) const { - return kMtfTypeVectorOfSizeBegin + size; - } - - // Returns mtf handle for pointers to specific size. - uint64_t GetMtfPointerToType(uint32_t type_id) const { - return kMtfPointerToTypeBegin + type_id; - } - - // Returns mtf handle for function types with given return type. - uint64_t GetMtfFunctionTypeWithReturnType(uint32_t type_id) const { - return kMtfFunctionTypeWithReturnTypeBegin + type_id; - } - - // Returns mtf handle for functions with given return type. - uint64_t GetMtfFunctionWithReturnType(uint32_t type_id) const { - return kMtfFunctionWithReturnTypeBegin + type_id; - } - - // Returns mtf handle for the given id descriptor. - uint64_t GetMtfIdDescriptor(uint32_t descriptor) const { - return kMtfIdDescriptorSpaceBegin + descriptor; - } - - // Process data from the current instruction. This would update MTFs and - // other data containers. - void ProcessCurInstruction(); - - // Returns move-to-front handle to be used for the current operand slot. - // Mtf handle is chosen based on a set of rules defined by SPIR-V grammar. - uint64_t GetRuleBasedMtf(); - - // Returns words of the current instruction. Decoder has a different - // implementation and the array is valid only until the previously decoded - // word. - virtual const uint32_t* GetInstWords() const { - return inst_.words; - } - - // Returns the opcode of the previous instruction. - SpvOp GetPrevOpcode() const { - if (instructions_.empty()) - return SpvOpNop; - - return instructions_.back()->opcode(); - } - - // Returns diagnostic stream, position index is set to instruction number. - DiagnosticStream Diag(spv_result_t error_code) const { - return DiagnosticStream({0, 0, instructions_.size()}, - context_->consumer, error_code); - } - - // Returns current id bound. - uint32_t GetIdBound() const { - return id_bound_; - } - - // Sets current id bound, expected to be no lower than the previous one. - void SetIdBound(uint32_t id_bound) { - assert(id_bound >= id_bound_); - id_bound_ = id_bound; - if (vstate_) - vstate_->setIdBound(id_bound); - } - - // Returns Huffman codec for ranks of the mtf with given |handle|. - // Different mtfs can use different rank distributions. - // May return nullptr if the codec doesn't exist. - const spvutils::HuffmanCodec* GetMtfHuffmanCodec(uint64_t handle) const { - const auto it = mtf_huffman_codecs_.find(handle); - if (it == mtf_huffman_codecs_.end()) - return nullptr; - return it->second.get(); - } - - spv_validator_options validator_options_ = nullptr; - const libspirv::AssemblyGrammar grammar_; - MarkvHeader header_; - - // MARK-V model, not owned. - const MarkvModel* model_ = nullptr; - - // Current instruction, current operand and current operand index. - spv_parsed_instruction_t inst_; - spv_parsed_operand_t operand_; - uint32_t operand_index_; - - // Maps a result ID to its type ID. By convention: - // - a result ID that is a type definition maps to itself. - // - a result ID without a type maps to 0. (E.g. for OpLabel) - std::unordered_map id_to_type_id_; - - // Container for all move-to-front sequences. - MultiMoveToFront multi_mtf_; - - // Id of the current function or zero if outside of function. - uint32_t cur_function_id_ = 0; - - // Return type of the current function. - uint32_t cur_function_return_type_ = 0; - - // Remaining function parameter types. This container is filled on OpFunction, - // and drained on OpFunctionParameter. - std::list remaining_function_parameter_types_; - - // List of ids local to the current function. - std::vector ids_local_to_cur_function_; - - // List of instructions in the order they are given in the module. - std::vector> instructions_; - - // Maps used for the 'presumed id' techniques. Maps small constant integer - // value to its id and back. - std::map presumed_index_to_id_; - std::map id_to_presumed_index_; - - // Container/computer for id descriptors. - IdDescriptorCollection id_descriptors_; - - // Huffman codecs for move-to-front ranks. The map key is mtf handle. Doesn't - // need to contain a different codec for every handle as most use one and the - // same. - std::map>> - mtf_huffman_codecs_; - - private: - spv_const_context context_ = nullptr; - - std::unique_ptr vstate_; - - // Maps result id to the instruction which defined it. - std::unordered_map id_to_def_instruction_; - - uint32_t id_bound_ = 1; -}; - -// SPIR-V to MARK-V encoder. Exposes functions EncodeHeader and -// EncodeInstruction which can be used as callback by spvBinaryParse. -// Encoded binary is written to an internally maintained bitstream. -// After the last instruction is encoded, the resulting MARK-V binary can be -// acquired by calling GetMarkvBinary(). -// The encoder uses SPIR-V validator to keep internal state, therefore -// SPIR-V binary needs to be able to pass validator checks. -// CreateCommentsLogger() can be used to enable the encoder to write comments -// on how encoding was done, which can later be accessed with GetComments(). -class MarkvEncoder : public MarkvCodecBase { - public: - // |model| is owned by the caller, must be not null and valid during the - // lifetime of MarkvEncoder. - MarkvEncoder(spv_const_context context, - const MarkvEncoderOptions& options, - const MarkvModel* model) - : MarkvCodecBase(context, GetValidatorOptions(options), model), - options_(options) { - (void) options_; - } - - // Writes data from SPIR-V header to MARK-V header. - spv_result_t EncodeHeader( - spv_endianness_t /* endian */, uint32_t /* magic */, - uint32_t version, uint32_t generator, uint32_t id_bound, - uint32_t /* schema */) { - SetIdBound(id_bound); - header_.spirv_version = version; - header_.spirv_generator = generator; - return SPV_SUCCESS; - } - - // Encodes SPIR-V instruction to MARK-V and writes to bit stream. - // Operation can fail if the instruction fails to pass the validator or if - // the encoder stubmles on something unexpected. - spv_result_t EncodeInstruction(const spv_parsed_instruction_t& inst); - - // Concatenates MARK-V header and the bit stream with encoded instructions - // into a single buffer and returns it as spv_markv_binary. The returned - // value is owned by the caller and needs to be destroyed with - // spvMarkvBinaryDestroy(). - std::vector GetMarkvBinary() { - header_.markv_length_in_bits = - static_cast(sizeof(header_) * 8 + writer_.GetNumBits()); - header_.markv_model = - (model_->model_type() << 16) | model_->model_version(); - - const size_t num_bytes = sizeof(header_) + writer_.GetDataSizeBytes(); - std::vector markv(num_bytes); - - assert(writer_.GetData()); - std::memcpy(markv.data(), &header_, sizeof(header_)); - std::memcpy(markv.data() + sizeof(header_), - writer_.GetData(), writer_.GetDataSizeBytes()); - return markv; - } - - // Creates an internal logger which writes comments on the encoding process. - // Output can later be accessed with GetComments(). - void CreateCommentsLogger() { - logger_.reset(new CommentLogger()); - writer_.SetCallback([this](const std::string& str){ - logger_->AppendBitSequence(str); - }); - } - - // Optionally adds disassembly to the comments. - // Disassembly should contain all instructions in the module separated by - // \n, and no header. - void SetDisassembly(std::string&& disassembly) { - disassembly_.reset(new std::stringstream(std::move(disassembly))); - } - - // Extracts the next instruction line from the disassembly and logs it. - void LogDisassemblyInstruction() { - if (logger_ && disassembly_) { - std::string line; - std::getline(*disassembly_, line, '\n'); - logger_->AppendTextNewLine(line); - } - } - - // Extracts the text from the comment logger. - std::string GetComments() const { - if (!logger_) - return ""; - return logger_->GetText(); - } - - private: - // Creates and returns validator options. Returned value owned by the caller. - static spv_validator_options GetValidatorOptions( - const MarkvEncoderOptions& options) { - return options.validate_spirv_binary ? - spvValidatorOptionsCreate() : nullptr; - } - - // Writes a single word to bit stream. operand_.type determines if the word is - // encoded and how. - spv_result_t EncodeNonIdWord(uint32_t word); - - // Writes both opcode and num_operands as a single code. - // Returns SPV_UNSUPPORTED iff no suitable codec was found. - spv_result_t EncodeOpcodeAndNumOperands(uint32_t opcode, uint32_t num_operands); - - // Writes mtf rank to bit stream. |mtf| is used to determine the codec - // scheme. |fallback_method| is used if no codec defined for |mtf|. - spv_result_t EncodeMtfRankHuffman(uint32_t rank, uint64_t mtf, - uint64_t fallback_method); - - // Writes id using coding based on mtf associated with the id descriptor. - // Returns SPV_UNSUPPORTED iff fallback method needs to be used. - spv_result_t EncodeIdWithDescriptor(uint32_t id); - - // Writes id using coding based on the given |mtf|, which is expected to - // contain the given |id|. - spv_result_t EncodeExistingId(uint64_t mtf, uint32_t id); - - // Writes type id of the current instruction if can't be inferred. - spv_result_t EncodeTypeId(); - - // Writes result id of the current instruction if can't be inferred. - spv_result_t EncodeResultId(); - - // Writes ids which are neither type nor result ids. - spv_result_t EncodeRefId(uint32_t id); - - // Writes bits to the stream until the beginning of the next byte if the - // number of bits until the next byte is less than |byte_break_if_less_than|. - void AddByteBreak(size_t byte_break_if_less_than); - - // Encodes a literal number operand and writes it to the bit stream. - spv_result_t EncodeLiteralNumber(const spv_parsed_operand_t& operand); - - MarkvEncoderOptions options_; - - // Bit stream where encoded instructions are written. - BitWriterWord64 writer_; - - // If not nullptr, encoder will write comments. - std::unique_ptr logger_; - - // If not nullptr, disassembled instruction lines will be written to comments. - // Format: \n separated instruction lines, no header. - std::unique_ptr disassembly_; -}; - -// Decodes MARK-V buffers written by MarkvEncoder. -class MarkvDecoder : public MarkvCodecBase { - public: - // |model| is owned by the caller, must be not null and valid during the - // lifetime of MarkvEncoder. - MarkvDecoder(spv_const_context context, - const std::vector& markv, - const MarkvDecoderOptions& options, - const MarkvModel* model) - : MarkvCodecBase(context, GetValidatorOptions(options), model), - options_(options), reader_(markv) { - (void) options_; - SetIdBound(1); - parsed_operands_.reserve(25); - inst_words_.reserve(25); - } - - // Decodes SPIR-V from MARK-V and stores the words in |spirv_binary|. - // Can be called only once. Fails if data of wrong format or ends prematurely, - // of if validation fails. - spv_result_t DecodeModule(std::vector* spirv_binary); - - private: - // Describes the format of a typed literal number. - struct NumberType { - spv_number_kind_t type; - uint32_t bit_width; - }; - - // Creates and returns validator options. Returned value owned by the caller. - static spv_validator_options GetValidatorOptions( - const MarkvDecoderOptions& options) { - return options.validate_spirv_binary ? - spvValidatorOptionsCreate() : nullptr; - } - - // Reads a single bit from reader_. The read bit is stored in |bit|. - // Returns false iff reader_ fails. - bool ReadBit(bool* bit) { - uint64_t bits = 0; - const bool result = reader_.ReadBits(&bits, 1); - if (result) - *bit = bits ? true : false; - return result; - }; - - // Returns ReadBit bound to the class object. - std::function GetReadBitCallback() { - return std::bind(&MarkvDecoder::ReadBit, this, std::placeholders::_1); - } - - // Reads a single non-id word from bit stream. operand_.type determines if - // the word needs to be decoded and how. - spv_result_t DecodeNonIdWord(uint32_t* word); - - // Reads and decodes both opcode and num_operands as a single code. - // Returns SPV_UNSUPPORTED iff no suitable codec was found. - spv_result_t DecodeOpcodeAndNumberOfOperands(uint32_t* opcode, - uint32_t* num_operands); - - // Reads mtf rank from bit stream. |mtf| is used to determine the codec - // scheme. |fallback_method| is used if no codec defined for |mtf|. - spv_result_t DecodeMtfRankHuffman(uint64_t mtf, uint32_t fallback_method, - uint32_t* rank); - - // Reads id using coding based on mtf associated with the id descriptor. - // Returns SPV_UNSUPPORTED iff fallback method needs to be used. - spv_result_t DecodeIdWithDescriptor(uint32_t* id); - - // Reads id using coding based on the given |mtf|, which is expected to - // contain the needed |id|. - spv_result_t DecodeExistingId(uint64_t mtf, uint32_t* id); - - // Reads type id of the current instruction if can't be inferred. - spv_result_t DecodeTypeId(); - - // Reads result id of the current instruction if can't be inferred. - spv_result_t DecodeResultId(); - - // Reads id which is neither type nor result id. - spv_result_t DecodeRefId(uint32_t* id); - - // Reads and discards bits until the beginning of the next byte if the - // number of bits until the next byte is less than |byte_break_if_less_than|. - bool ReadToByteBreak(size_t byte_break_if_less_than); - - // Returns instruction words decoded up to this point. - const uint32_t* GetInstWords() const override { - return inst_words_.data(); - } - - // Reads a literal number as it is described in |operand| from the bit stream, - // decodes and writes it to spirv_. - spv_result_t DecodeLiteralNumber(const spv_parsed_operand_t& operand); - - // Reads instruction from bit stream, decodes and validates it. - // Decoded instruction is valid until the next call of DecodeInstruction(). - spv_result_t DecodeInstruction(); - - // Read operand from the stream decodes and validates it. - spv_result_t DecodeOperand(size_t operand_offset, - const spv_operand_type_t type, - spv_operand_pattern_t* expected_operands); - - // Records the numeric type for an operand according to the type information - // associated with the given non-zero type Id. This can fail if the type Id - // is not a type Id, or if the type Id does not reference a scalar numeric - // type. On success, return SPV_SUCCESS and populates the num_words, - // number_kind, and number_bit_width fields of parsed_operand. - spv_result_t SetNumericTypeInfoForType(spv_parsed_operand_t* parsed_operand, - uint32_t type_id); - - // Records the number type for the current instruction, if it generates a - // type. For types that aren't scalar numbers, record something with number - // kind SPV_NUMBER_NONE. - void RecordNumberType(); - - MarkvDecoderOptions options_; - - // Temporary sink where decoded SPIR-V words are written. Once it contains the - // entire module, the container is moved and returned. - std::vector spirv_; - - // Bit stream containing encoded data. - BitReaderWord64 reader_; - - // Temporary storage for operands of the currently parsed instruction. - // Valid until next DecodeInstruction call. - std::vector parsed_operands_; - - // Temporary storage for current instruction words. - // Valid until next DecodeInstruction call. - std::vector inst_words_; - - // Maps a type ID to its number type description. - std::unordered_map type_id_to_number_type_info_; - - // Maps an ExtInstImport id to the extended instruction type. - std::unordered_map import_id_to_ext_inst_type_; -}; - -void MarkvCodecBase::ProcessCurInstruction() { - instructions_.emplace_back(new Instruction(&inst_)); - - const SpvOp opcode = SpvOp(inst_.opcode); - - if (inst_.result_id) { - id_to_def_instruction_.emplace(inst_.result_id, instructions_.back().get()); - - // Collect ids local to the current function. - if (cur_function_id_){ - ids_local_to_cur_function_.push_back(inst_.result_id); - } - - // Starting new function. - if (opcode == SpvOpFunction) { - cur_function_id_ = inst_.result_id; - cur_function_return_type_ = inst_.type_id; - multi_mtf_.Insert(GetMtfFunctionWithReturnType(inst_.type_id), - inst_.result_id); - - // Store function parameter types in a queue, so that we know which types - // to expect in the following OpFunctionParameter instructions. - const Instruction* def_inst = FindDef(inst_.words[4]); - assert(def_inst); - assert(def_inst->opcode() == SpvOpTypeFunction); - for (uint32_t i = 3; i < def_inst->words().size(); ++i) { - remaining_function_parameter_types_.push_back(def_inst->word(i)); - } - } - } - - // Remove local ids from MTFs if function end. - if (opcode == SpvOpFunctionEnd) { - cur_function_id_ = 0; - for (uint32_t id : ids_local_to_cur_function_) - multi_mtf_.RemoveFromAll(id); - ids_local_to_cur_function_.clear(); - assert(remaining_function_parameter_types_.empty()); - } - - if (!inst_.result_id) - return; - - { - // Save the result ID to type ID mapping. - // In the grammar, type ID always appears before result ID. - // A regular value maps to its type. Some instructions (e.g. OpLabel) - // have no type Id, and will map to 0. The result Id for a - // type-generating instruction (e.g. OpTypeInt) maps to itself. - auto insertion_result = id_to_type_id_.emplace( - inst_.result_id, - spvOpcodeGeneratesType(SpvOp(inst_.opcode)) ? - inst_.result_id : inst_.type_id); - (void)insertion_result; - assert(insertion_result.second); - } - - // Add result_id to MTFs. - - switch (opcode) { - case SpvOpTypeFloat: - case SpvOpTypeInt: - case SpvOpTypeBool: - case SpvOpTypeVector: - case SpvOpTypePointer: - case SpvOpExtInstImport: - case SpvOpTypeSampledImage: - case SpvOpTypeImage: - case SpvOpTypeSampler: - multi_mtf_.Insert(GetMtfIdGeneratedByOpcode(opcode), inst_.result_id); - break; - default: - break; - } - - if (spvOpcodeIsComposite(opcode)) { - multi_mtf_.Insert(kMtfTypeComposite, inst_.result_id); - } - - if (opcode == SpvOpLabel) { - multi_mtf_.InsertOrPromote(kMtfLabel, inst_.result_id); - } - - if (opcode == SpvOpTypeInt) { - multi_mtf_.Insert(kMtfTypeScalar, inst_.result_id); - multi_mtf_.Insert(kMtfTypeIntScalarOrVector, inst_.result_id); - } - - if (opcode == SpvOpTypeFloat) { - multi_mtf_.Insert(kMtfTypeScalar, inst_.result_id); - multi_mtf_.Insert(kMtfTypeFloatScalarOrVector, inst_.result_id); - } - - if (opcode == SpvOpTypeBool) { - multi_mtf_.Insert(kMtfTypeScalar, inst_.result_id); - multi_mtf_.Insert(kMtfTypeBoolScalarOrVector, inst_.result_id); - } - - if (opcode == SpvOpTypeVector) { - const uint32_t component_type_id = inst_.words[2]; - const uint32_t size = inst_.words[3]; - if (multi_mtf_.HasValue(GetMtfIdGeneratedByOpcode(SpvOpTypeFloat), - component_type_id)) { - multi_mtf_.Insert(kMtfTypeFloatScalarOrVector, inst_.result_id); - } else if (multi_mtf_.HasValue(GetMtfIdGeneratedByOpcode(SpvOpTypeInt), - component_type_id)) { - multi_mtf_.Insert(kMtfTypeIntScalarOrVector, inst_.result_id); - } else if (multi_mtf_.HasValue(GetMtfIdGeneratedByOpcode(SpvOpTypeBool), - component_type_id)) { - multi_mtf_.Insert(kMtfTypeBoolScalarOrVector, inst_.result_id); - } - multi_mtf_.Insert(GetMtfTypeVectorOfSize(size), inst_.result_id); - } - - if (inst_.opcode == SpvOpTypeFunction) { - const uint32_t return_type = inst_.words[2]; - multi_mtf_.Insert(kMtfTypeReturnedByFunction, return_type); - multi_mtf_.Insert(GetMtfFunctionTypeWithReturnType(return_type), - inst_.result_id); - } - - if (inst_.type_id) { - const Instruction* type_inst = FindDef(inst_.type_id); - assert(type_inst); - - multi_mtf_.Insert(kMtfObject, inst_.result_id); - - multi_mtf_.Insert(GetMtfIdOfType(inst_.type_id), inst_.result_id); - - if (multi_mtf_.HasValue(kMtfTypeFloatScalarOrVector, inst_.type_id)) { - multi_mtf_.Insert(kMtfFloatScalarOrVector, inst_.result_id); - } - - if (multi_mtf_.HasValue(kMtfTypeIntScalarOrVector, inst_.type_id)) - multi_mtf_.Insert(kMtfIntScalarOrVector, inst_.result_id); - - if (multi_mtf_.HasValue(kMtfTypeBoolScalarOrVector, inst_.type_id)) - multi_mtf_.Insert(kMtfBoolScalarOrVector, inst_.result_id); - - if (multi_mtf_.HasValue(kMtfTypeComposite, inst_.type_id)) - multi_mtf_.Insert(kMtfComposite, inst_.result_id); - - if (inst_.opcode == SpvOpConstant) { - if (multi_mtf_.HasValue( - GetMtfIdGeneratedByOpcode(SpvOpTypeInt), inst_.type_id)) { - multi_mtf_.Insert(kMtfConstInteger, inst_.result_id); - const uint32_t presumed_index = inst_.words[3]; - if (presumed_index <= kMarkvMaxPresumedAccessIndex) { - const auto result = - presumed_index_to_id_.emplace(presumed_index, inst_.result_id); - if (result.second) { - id_to_presumed_index_.emplace(inst_.result_id, presumed_index); - } - } - } - } - - switch (type_inst->opcode()) { - case SpvOpTypeInt: - case SpvOpTypeBool: - case SpvOpTypePointer: - case SpvOpTypeVector: - case SpvOpTypeImage: - case SpvOpTypeSampledImage: - case SpvOpTypeSampler: - multi_mtf_.Insert(GetMtfIdWithTypeGeneratedByOpcode( - type_inst->opcode()), inst_.result_id); - break; - default: - break; - } - - if (type_inst->opcode() == SpvOpTypeVector) { - const uint32_t component_type = type_inst->word(2); - multi_mtf_.Insert(GetMtfVectorOfComponentType(component_type), - inst_.result_id); - } - - if (type_inst->opcode() == SpvOpTypePointer) { - assert(type_inst->operands().size() > 2); - assert(type_inst->words().size() > type_inst->operands()[2].offset); - const uint32_t data_type = - type_inst->word(type_inst->operands()[2].offset); - multi_mtf_.Insert(GetMtfPointerToType(data_type), inst_.result_id); - - if (multi_mtf_.HasValue(kMtfTypeComposite, data_type)) - multi_mtf_.Insert(kMtfTypePointerToComposite, inst_.result_id); - } - } - - if (spvOpcodeGeneratesType(opcode)) { - if (opcode != SpvOpTypeFunction) { - multi_mtf_.Insert(kMtfTypeNonFunction, inst_.result_id); - } - } - - const uint32_t descriptor = id_descriptors_.ProcessInstruction(inst_); - if (model_->DescriptorHasCodingScheme(descriptor)) - multi_mtf_.Insert(GetMtfIdDescriptor(descriptor), inst_.result_id); -} - -uint64_t MarkvCodecBase::GetRuleBasedMtf() { - // This function is only called for id operands (but not result ids). - assert(spvIsIdType(operand_.type) || - operand_.type == SPV_OPERAND_TYPE_OPTIONAL_ID); - assert(operand_.type != SPV_OPERAND_TYPE_RESULT_ID); - - const SpvOp opcode = static_cast(inst_.opcode); - - // All operand slots which expect label id. - if ((inst_.opcode == SpvOpLoopMerge && operand_index_ <= 1) || - (inst_.opcode == SpvOpSelectionMerge && operand_index_ == 0) || - (inst_.opcode == SpvOpBranch && operand_index_ == 0) || - (inst_.opcode == SpvOpBranchConditional && - (operand_index_ == 1 || operand_index_ == 2 )) || - (inst_.opcode == SpvOpPhi && operand_index_ >= 3 && - operand_index_ % 2 == 1) || - (inst_.opcode == SpvOpSwitch && operand_index_ > 0)) { - return kMtfLabel; - } - - switch (opcode) { - case SpvOpFAdd: - case SpvOpFSub: - case SpvOpFMul: - case SpvOpFDiv: - case SpvOpFRem: - case SpvOpFMod: - case SpvOpFNegate: { - if (operand_index_ == 0) - return kMtfTypeFloatScalarOrVector; - - return GetMtfIdOfType(inst_.type_id); - } - - case SpvOpISub: - case SpvOpIAdd: - case SpvOpIMul: - case SpvOpSDiv: - case SpvOpUDiv: - case SpvOpSMod: - case SpvOpUMod: - case SpvOpSRem: - case SpvOpSNegate: { - if (operand_index_ == 0) - return kMtfTypeIntScalarOrVector; - - return kMtfIntScalarOrVector; - } - - // TODO(atgoo@github.com) Add OpConvertFToU and other opcodes. - - case SpvOpFOrdEqual: - case SpvOpFUnordEqual: - case SpvOpFOrdNotEqual: - case SpvOpFUnordNotEqual: - case SpvOpFOrdLessThan: - case SpvOpFUnordLessThan: - case SpvOpFOrdGreaterThan: - case SpvOpFUnordGreaterThan: - case SpvOpFOrdLessThanEqual: - case SpvOpFUnordLessThanEqual: - case SpvOpFOrdGreaterThanEqual: - case SpvOpFUnordGreaterThanEqual: { - if (operand_index_ == 0) - return kMtfTypeBoolScalarOrVector; - if (operand_index_ == 2) - return kMtfFloatScalarOrVector; - if (operand_index_ == 3) { - const uint32_t first_operand_id = GetInstWords()[3]; - const uint32_t first_operand_type = - id_to_type_id_.at(first_operand_id); - return GetMtfIdOfType(first_operand_type); - } - break; - } - - case SpvOpVectorShuffle: { - if (operand_index_ == 0) { - assert(inst_.num_operands > 4); - return GetMtfTypeVectorOfSize(inst_.num_operands - 4); - } - - assert(inst_.type_id); - if (operand_index_ == 2 || operand_index_ == 3) - return GetMtfVectorOfComponentType( - GetVectorComponentType(inst_.type_id)); - break; - } - - case SpvOpVectorTimesScalar: { - if (operand_index_ == 0) { - // TODO(atgoo@github.com) Could be narrowed to vector of floats. - return GetMtfIdGeneratedByOpcode(SpvOpTypeVector); - } - - assert(inst_.type_id); - if (operand_index_ == 2) - return GetMtfIdOfType(inst_.type_id); - if (operand_index_ == 3) - return GetMtfIdOfType(GetVectorComponentType(inst_.type_id)); - break; - } - - case SpvOpDot: { - if (operand_index_ == 0) - return GetMtfIdGeneratedByOpcode(SpvOpTypeFloat); - - assert(inst_.type_id); - if (operand_index_ == 2) - return GetMtfVectorOfComponentType(inst_.type_id); - if (operand_index_ == 3) { - const uint32_t vector_id = GetInstWords()[3]; - const uint32_t vector_type = id_to_type_id_.at(vector_id); - return GetMtfIdOfType(vector_type); - } - break; - } - - case SpvOpTypeVector: { - if (operand_index_ == 1) { - return kMtfTypeScalar; - } - break; - } - - case SpvOpTypeMatrix: { - if (operand_index_ == 1) { - return GetMtfIdGeneratedByOpcode(SpvOpTypeVector); - } - break; - } - - case SpvOpTypePointer: { - if (operand_index_ == 2) { - return kMtfTypeNonFunction; - } - break; - } - - case SpvOpTypeStruct: { - if (operand_index_ >= 1) { - return kMtfTypeNonFunction; - } - break; - } - - case SpvOpTypeFunction: { - if (operand_index_ == 1) { - return kMtfTypeNonFunction; - } - - if (operand_index_ >= 2) { - return kMtfTypeNonFunction; - } - break; - } - - case SpvOpLoad: { - if (operand_index_ == 0) - return kMtfTypeNonFunction; - - if (operand_index_ == 2) { - assert(inst_.type_id); - return GetMtfPointerToType(inst_.type_id); - } - break; - } - - case SpvOpStore: { - if (operand_index_ == 0) - return GetMtfIdWithTypeGeneratedByOpcode(SpvOpTypePointer); - if (operand_index_ == 1) { - const uint32_t pointer_id = GetInstWords()[1]; - const uint32_t pointer_type = id_to_type_id_.at(pointer_id); - const Instruction* pointer_inst = FindDef(pointer_type); - assert(pointer_inst); - assert(pointer_inst->opcode() == SpvOpTypePointer); - const uint32_t data_type = - pointer_inst->word(pointer_inst->operands()[2].offset); - return GetMtfIdOfType(data_type); - } - break; - } - - case SpvOpVariable: { - if (operand_index_ == 0) - return GetMtfIdGeneratedByOpcode(SpvOpTypePointer); - break; - } - - case SpvOpAccessChain: { - if (operand_index_ == 0) - return GetMtfIdGeneratedByOpcode(SpvOpTypePointer); - if (operand_index_ == 2) - return kMtfTypePointerToComposite; - if (operand_index_ >= 3) - return GetMtfIdWithTypeGeneratedByOpcode(SpvOpTypeInt); - break; - } - - case SpvOpCompositeConstruct: { - if (operand_index_ == 0) - return kMtfTypeComposite; - if (operand_index_ >= 2) { - const uint32_t composite_type = GetInstWords()[1]; - if (multi_mtf_.HasValue(kMtfTypeFloatScalarOrVector, composite_type)) - return kMtfFloatScalarOrVector; - if (multi_mtf_.HasValue(kMtfTypeIntScalarOrVector, composite_type)) - return kMtfIntScalarOrVector; - if (multi_mtf_.HasValue(kMtfTypeBoolScalarOrVector, composite_type)) - return kMtfBoolScalarOrVector; - } - break; - } - - case SpvOpCompositeExtract: { - if (operand_index_ == 2) - return kMtfComposite; - break; - } - - case SpvOpConstantComposite: { - if (operand_index_ == 0) - return kMtfTypeComposite; - if (operand_index_ >= 2) { - const Instruction* composite_type_inst = FindDef(inst_.type_id); - assert(composite_type_inst); - if (composite_type_inst->opcode() == SpvOpTypeVector) { - return GetMtfIdOfType(composite_type_inst->word(2)); - } - } - break; - } - - case SpvOpExtInst: { - if (operand_index_ == 2) - return GetMtfIdGeneratedByOpcode(SpvOpExtInstImport); - if (operand_index_ >= 4) { - const uint32_t return_type = GetInstWords()[1]; - const uint32_t ext_inst_type = inst_.ext_inst_type; - const uint32_t ext_inst_index = GetInstWords()[4]; - // TODO(atgoo@github.com) The list of extended instructions is - // incomplete. Only common instructions and low-hanging fruits listed. - if (ext_inst_type == SPV_EXT_INST_TYPE_GLSL_STD_450) { - switch (ext_inst_index) { - case GLSLstd450FAbs: - case GLSLstd450FClamp: - case GLSLstd450FMax: - case GLSLstd450FMin: - case GLSLstd450FMix: - case GLSLstd450Step: - case GLSLstd450SmoothStep: - case GLSLstd450Fma: - case GLSLstd450Pow: - case GLSLstd450Exp: - case GLSLstd450Exp2: - case GLSLstd450Log: - case GLSLstd450Log2: - case GLSLstd450Sqrt: - case GLSLstd450InverseSqrt: - case GLSLstd450Fract: - case GLSLstd450Floor: - case GLSLstd450Ceil: - case GLSLstd450Radians: - case GLSLstd450Degrees: - case GLSLstd450Sin: - case GLSLstd450Cos: - case GLSLstd450Tan: - case GLSLstd450Sinh: - case GLSLstd450Cosh: - case GLSLstd450Tanh: - case GLSLstd450Asin: - case GLSLstd450Acos: - case GLSLstd450Atan: - case GLSLstd450Atan2: - case GLSLstd450Asinh: - case GLSLstd450Acosh: - case GLSLstd450Atanh: - case GLSLstd450MatrixInverse: - case GLSLstd450Cross: - case GLSLstd450Normalize: - case GLSLstd450Reflect: - case GLSLstd450FaceForward: - return GetMtfIdOfType(return_type); - case GLSLstd450Length: - case GLSLstd450Distance: - case GLSLstd450Refract: - return kMtfFloatScalarOrVector; - default: - break; - } - } else if (ext_inst_type == SPV_EXT_INST_TYPE_OPENCL_STD) { - switch (ext_inst_index) { - case OpenCLLIB::Fabs: - case OpenCLLIB::FClamp: - case OpenCLLIB::Fmax: - case OpenCLLIB::Fmin: - case OpenCLLIB::Step: - case OpenCLLIB::Smoothstep: - case OpenCLLIB::Fma: - case OpenCLLIB::Pow: - case OpenCLLIB::Exp: - case OpenCLLIB::Exp2: - case OpenCLLIB::Log: - case OpenCLLIB::Log2: - case OpenCLLIB::Sqrt: - case OpenCLLIB::Rsqrt: - case OpenCLLIB::Fract: - case OpenCLLIB::Floor: - case OpenCLLIB::Ceil: - case OpenCLLIB::Radians: - case OpenCLLIB::Degrees: - case OpenCLLIB::Sin: - case OpenCLLIB::Cos: - case OpenCLLIB::Tan: - case OpenCLLIB::Sinh: - case OpenCLLIB::Cosh: - case OpenCLLIB::Tanh: - case OpenCLLIB::Asin: - case OpenCLLIB::Acos: - case OpenCLLIB::Atan: - case OpenCLLIB::Atan2: - case OpenCLLIB::Asinh: - case OpenCLLIB::Acosh: - case OpenCLLIB::Atanh: - case OpenCLLIB::Cross: - case OpenCLLIB::Normalize: - return GetMtfIdOfType(return_type); - case OpenCLLIB::Length: - case OpenCLLIB::Distance: - return kMtfFloatScalarOrVector; - default: - break; - } - } - } - break; - } - - case SpvOpFunction: { - if (operand_index_ == 0) - return kMtfTypeReturnedByFunction; - - if (operand_index_ == 3) { - const uint32_t return_type = GetInstWords()[1]; - return GetMtfFunctionTypeWithReturnType(return_type); - } - break; - } - - case SpvOpFunctionCall: { - if (operand_index_ == 0) - return kMtfTypeReturnedByFunction; - - if (operand_index_ == 2) { - const uint32_t return_type = GetInstWords()[1]; - return GetMtfFunctionWithReturnType(return_type); - } - - if (operand_index_ >= 3) { - const uint32_t function_id = GetInstWords()[3]; - const Instruction* function_inst = FindDef(function_id); - if (!function_inst) - return kMtfObject; - - assert(function_inst->opcode() == SpvOpFunction); - - const uint32_t function_type_id = function_inst->word(4); - const Instruction* function_type_inst = FindDef(function_type_id); - assert(function_type_inst); - assert(function_type_inst->opcode() == SpvOpTypeFunction); - - const uint32_t argument_type = - function_type_inst->word(operand_index_); - return GetMtfIdOfType(argument_type); - } - break; - } - - case SpvOpReturnValue: { - if (operand_index_ == 0) - return GetMtfIdOfType(cur_function_return_type_); - break; - } - - case SpvOpBranchConditional: { - if (operand_index_ == 0) - return GetMtfIdWithTypeGeneratedByOpcode(SpvOpTypeBool); - break; - } - - case SpvOpSampledImage: { - if (operand_index_ == 0) - return GetMtfIdGeneratedByOpcode(SpvOpTypeSampledImage); - if (operand_index_ == 2) - return GetMtfIdWithTypeGeneratedByOpcode(SpvOpTypeImage); - if (operand_index_ == 3) - return GetMtfIdWithTypeGeneratedByOpcode(SpvOpTypeSampler); - break; - } - - case SpvOpImageSampleImplicitLod: { - if (operand_index_ == 0) - return GetMtfIdGeneratedByOpcode(SpvOpTypeVector); - if (operand_index_ == 2) - return GetMtfIdWithTypeGeneratedByOpcode(SpvOpTypeSampledImage); - if (operand_index_ == 3) - return GetMtfIdWithTypeGeneratedByOpcode(SpvOpTypeVector); - break; - } - - default: - break; - } - - return kMtfNone; -} - -spv_result_t MarkvEncoder::EncodeNonIdWord(uint32_t word) { - auto* codec = model_->GetNonIdWordHuffmanCodec(inst_.opcode, operand_index_); - - if (codec) { - uint64_t bits = 0; - size_t num_bits = 0; - if (codec->Encode(word, &bits, &num_bits)) { - // Encoding successful. - writer_.WriteBits(bits, num_bits); - return SPV_SUCCESS; - } else { - // Encoding failed, write kMarkvNoneOfTheAbove flag. - if (!codec->Encode(kMarkvNoneOfTheAbove, &bits, &num_bits)) - return Diag(SPV_ERROR_INTERNAL) - << "Non-id word Huffman table for " - << spvOpcodeString(SpvOp(inst_.opcode)) - << " operand index " << operand_index_ - << " is missing kMarkvNoneOfTheAbove"; - writer_.WriteBits(bits, num_bits); - } - } - - // Fallback encoding. - const size_t chunk_length = - model_->GetOperandVariableWidthChunkLength(operand_.type); - if (chunk_length) { - writer_.WriteVariableWidthU32(word, chunk_length); - } else { - writer_.WriteUnencoded(word); - } - return SPV_SUCCESS; -} - -spv_result_t MarkvDecoder::DecodeNonIdWord(uint32_t* word) { - auto* codec = model_->GetNonIdWordHuffmanCodec(inst_.opcode, operand_index_); - - if (codec) { - uint64_t decoded_value = 0; - if (!codec->DecodeFromStream(GetReadBitCallback(), &decoded_value)) - return Diag(SPV_ERROR_INVALID_BINARY) - << "Failed to decode non-id word with Huffman"; - - if (decoded_value != kMarkvNoneOfTheAbove) { - // The word decoded successfully. - *word = uint32_t(decoded_value); - assert(*word == decoded_value); - return SPV_SUCCESS; - } - - // Received kMarkvNoneOfTheAbove signal, use fallback decoding. - } - - const size_t chunk_length = - model_->GetOperandVariableWidthChunkLength(operand_.type); - if (chunk_length) { - if (!reader_.ReadVariableWidthU32(word, chunk_length)) - return Diag(SPV_ERROR_INVALID_BINARY) - << "Failed to decode non-id word with varint"; - } else { - if (!reader_.ReadUnencoded(word)) - return Diag(SPV_ERROR_INVALID_BINARY) - << "Failed to read unencoded non-id word"; - } - return SPV_SUCCESS; -} - -spv_result_t MarkvEncoder::EncodeOpcodeAndNumOperands( - uint32_t opcode, uint32_t num_operands) { - uint64_t bits = 0; - size_t num_bits = 0; - - const uint32_t word = opcode | (num_operands << 16); - - // First try to use the Markov chain codec. - auto* codec = model_->GetOpcodeAndNumOperandsMarkovHuffmanCodec(GetPrevOpcode()); - if (codec) { - if (codec->Encode(word, &bits, &num_bits)) { - // The word was successfully encoded into bits/num_bits. - writer_.WriteBits(bits, num_bits); - return SPV_SUCCESS; - } else { - // The word is not in the Huffman table. Write kMarkvNoneOfTheAbove - // and use fallback encoding. - if (!codec->Encode(kMarkvNoneOfTheAbove, &bits, &num_bits)) - return Diag(SPV_ERROR_INTERNAL) - << "opcode_and_num_operands Huffman table for " - << spvOpcodeString(GetPrevOpcode()) - << "is missing kMarkvNoneOfTheAbove"; - writer_.WriteBits(bits, num_bits); - } - } - - // Fallback to base-rate codec. - codec = model_->GetOpcodeAndNumOperandsMarkovHuffmanCodec(SpvOpNop); - assert(codec); - if (codec->Encode(word, &bits, &num_bits)) { - // The word was successfully encoded into bits/num_bits. - writer_.WriteBits(bits, num_bits); - return SPV_SUCCESS; - } else { - // The word is not in the Huffman table. Write kMarkvNoneOfTheAbove - // and return false. - if (!codec->Encode(kMarkvNoneOfTheAbove, &bits, &num_bits)) - return Diag(SPV_ERROR_INTERNAL) - << "Global opcode_and_num_operands Huffman table is missing " - << "kMarkvNoneOfTheAbove"; - writer_.WriteBits(bits, num_bits); - return SPV_UNSUPPORTED; - } -} - -spv_result_t MarkvDecoder::DecodeOpcodeAndNumberOfOperands( - uint32_t* opcode, uint32_t* num_operands) { - // First try to use the Markov chain codec. - auto* codec = model_->GetOpcodeAndNumOperandsMarkovHuffmanCodec(GetPrevOpcode()); - if (codec) { - uint64_t decoded_value = 0; - if (!codec->DecodeFromStream(GetReadBitCallback(), &decoded_value)) - return Diag(SPV_ERROR_INTERNAL) - << "Failed to decode opcode_and_num_operands, previous opcode is " - << spvOpcodeString(GetPrevOpcode()); - - if (decoded_value != kMarkvNoneOfTheAbove) { - // The word was successfully decoded. - *opcode = uint32_t(decoded_value & 0xFFFF); - *num_operands = uint32_t(decoded_value >> 16); - return SPV_SUCCESS; - } - - // Received kMarkvNoneOfTheAbove signal, use fallback decoding. - } - - // Fallback to base-rate codec. - codec = model_->GetOpcodeAndNumOperandsMarkovHuffmanCodec(SpvOpNop); - assert(codec); - uint64_t decoded_value = 0; - if (!codec->DecodeFromStream(GetReadBitCallback(), &decoded_value)) - return Diag(SPV_ERROR_INTERNAL) - << "Failed to decode opcode_and_num_operands with global codec"; - - if (decoded_value == kMarkvNoneOfTheAbove) { - // Received kMarkvNoneOfTheAbove signal, fallback further. - return SPV_UNSUPPORTED; - } - - *opcode = uint32_t(decoded_value & 0xFFFF); - *num_operands = uint32_t(decoded_value >> 16); - return SPV_SUCCESS; -} - -spv_result_t MarkvEncoder::EncodeMtfRankHuffman(uint32_t rank, uint64_t mtf, - uint64_t fallback_method) { - const auto* codec = GetMtfHuffmanCodec(mtf); - if (!codec) { - assert(fallback_method != kMtfNone); - codec = GetMtfHuffmanCodec(fallback_method); - } - - if (!codec) - return Diag(SPV_ERROR_INTERNAL) << "No codec to encode MTF rank"; - - uint64_t bits = 0; - size_t num_bits = 0; - if (rank < kMtfSmallestRankEncodedByValue) { - // Encode using Huffman coding. - if (!codec->Encode(rank, &bits, &num_bits)) - return Diag(SPV_ERROR_INTERNAL) - << "Failed to encode MTF rank with Huffman"; - - writer_.WriteBits(bits, num_bits); - } else { - // Encode by value. - if (!codec->Encode(kMtfRankEncodedByValueSignal, &bits, &num_bits)) - return Diag(SPV_ERROR_INTERNAL) - << "Failed to encode kMtfRankEncodedByValueSignal"; - - writer_.WriteBits(bits, num_bits); - writer_.WriteVariableWidthU32(rank - kMtfSmallestRankEncodedByValue, - model_->mtf_rank_chunk_length()); - } - return SPV_SUCCESS; -} - -spv_result_t MarkvDecoder::DecodeMtfRankHuffman( - uint64_t mtf, uint32_t fallback_method, uint32_t* rank) { - const auto* codec = GetMtfHuffmanCodec(mtf); - if (!codec) { - assert(fallback_method != kMtfNone); - codec = GetMtfHuffmanCodec(fallback_method); - } - - if (!codec) - return Diag(SPV_ERROR_INTERNAL) << "No codec to decode MTF rank"; - - uint32_t decoded_value = 0; - if (!codec->DecodeFromStream(GetReadBitCallback(), &decoded_value)) - return Diag(SPV_ERROR_INTERNAL) - << "Failed to decode MTF rank with Huffman"; - - if (decoded_value == kMtfRankEncodedByValueSignal) { - // Decode by value. - if (!reader_.ReadVariableWidthU32(rank, model_->mtf_rank_chunk_length())) - return Diag(SPV_ERROR_INTERNAL) - << "Failed to decode MTF rank with varint"; - *rank += kMtfSmallestRankEncodedByValue; - } else { - // Decode using Huffman coding. - assert(decoded_value < kMtfSmallestRankEncodedByValue); - *rank = decoded_value; - } - return SPV_SUCCESS; -} - -spv_result_t MarkvEncoder::EncodeIdWithDescriptor(uint32_t id) { - auto* codec = model_->GetIdDescriptorHuffmanCodec(inst_.opcode, - operand_index_); - if (!codec) - return SPV_UNSUPPORTED; - - uint64_t bits = 0; - size_t num_bits = 0; - - // Get the descriptor for id. - const uint32_t descriptor = id_descriptors_.GetDescriptor(id); - - if (descriptor && codec->Encode(descriptor, &bits, &num_bits)) { - // If the descriptor exists and is in the table, write the descriptor and - // proceed to encoding the rank. - writer_.WriteBits(bits, num_bits); - } else { - // The descriptor doesn't exist or we have no coding for it. Write - // kMarkvNoneOfTheAbove and go to fallback method. - if (!codec->Encode(kMarkvNoneOfTheAbove, &bits, &num_bits)) - return Diag(SPV_ERROR_INTERNAL) - << "Descriptor Huffman table for " - << spvOpcodeString(SpvOp(inst_.opcode)) - << " operand index " << operand_index_ - << " is missing kMarkvNoneOfTheAbove"; - - writer_.WriteBits(bits, num_bits); - return SPV_UNSUPPORTED; - } - - // Descriptor has been encoded. Now encode the rank of the id in the - // associated mtf sequence. - const uint64_t mtf = GetMtfIdDescriptor(descriptor); - return EncodeExistingId(mtf, id); -} - -spv_result_t MarkvDecoder::DecodeIdWithDescriptor(uint32_t* id) { - auto* codec = model_->GetIdDescriptorHuffmanCodec(inst_.opcode, - operand_index_); - if (!codec) - return SPV_UNSUPPORTED; - - uint64_t decoded_value = 0; - if (!codec->DecodeFromStream(GetReadBitCallback(), &decoded_value)) - return Diag(SPV_ERROR_INTERNAL) - << "Failed to decode descriptor with Huffman"; - - if (decoded_value == kMarkvNoneOfTheAbove) - return SPV_UNSUPPORTED; - - // If descriptor exists then the id was encoded through descriptor mtf. - const uint32_t descriptor = uint32_t(decoded_value); - assert(descriptor == decoded_value); - assert(descriptor); - - const uint64_t mtf = GetMtfIdDescriptor(descriptor); - return DecodeExistingId(mtf, id); -} - -spv_result_t MarkvEncoder::EncodeExistingId(uint64_t mtf, uint32_t id) { - assert(multi_mtf_.GetSize(mtf) > 0); - if (multi_mtf_.GetSize(mtf) == 1) { - // If the sequence has only one element no need to write rank, the decoder - // would make the same decision. - return SPV_SUCCESS; - } - - uint32_t rank = 0; - if (!multi_mtf_.RankFromValue(mtf, id, &rank)) - return Diag(SPV_ERROR_INTERNAL) - << "Id is not in the MTF sequence"; - - return EncodeMtfRankHuffman(rank, mtf, kMtfGenericNonZeroRank); -} - -spv_result_t MarkvDecoder::DecodeExistingId(uint64_t mtf, uint32_t* id) { - assert(multi_mtf_.GetSize(mtf) > 0); - *id = 0; - - uint32_t rank = 0; - - if (multi_mtf_.GetSize(mtf) == 1) { - rank = 1; - } else { - const spv_result_t result = - DecodeMtfRankHuffman(mtf, kMtfGenericNonZeroRank, &rank); - if (result != SPV_SUCCESS) - return result; - } - - assert(rank); - if (!multi_mtf_.ValueFromRank(mtf, rank, id)) - return Diag(SPV_ERROR_INTERNAL) - << "MTF rank is out of bounds"; - - return SPV_SUCCESS; -} - -spv_result_t MarkvEncoder::EncodeRefId(uint32_t id) { - // TODO(atgoo@github.com) This might not be needed as EncodeIdWithDescriptor - // can handle SpvOpAccessChain indices if enough statistics is collected. - if (inst_.opcode == SpvOpAccessChain && operand_index_ >= 3) { - const auto it = id_to_presumed_index_.find(id); - if (it != id_to_presumed_index_.end()) { - writer_.WriteBits(1, 1); - writer_.WriteFixedWidth(it->second, kMarkvMaxPresumedAccessIndex); - return SPV_SUCCESS; - } - - writer_.WriteBits(0, 1); - } - - { - // Try to encode using id descriptor mtfs. - const spv_result_t result = EncodeIdWithDescriptor(id); - if (result != SPV_UNSUPPORTED) - return result; - // If can't be done continue with other methods. - } - - // Encode using rule-based mtf. - uint64_t mtf = GetRuleBasedMtf(); - const bool can_forward_declare = - spvOperandCanBeForwardDeclaredFunction( - SpvOp(inst_.opcode))(operand_index_); - - if (mtf != kMtfNone && !can_forward_declare) { - assert(multi_mtf_.HasValue(kMtfAll, id)); - return EncodeExistingId(mtf, id); - } - - if (mtf == kMtfNone) - mtf = kMtfAll; - - uint32_t rank = 0; - - if (!multi_mtf_.RankFromValue(mtf, id, &rank)) { - // This is the first occurrence of a forward declared id. - multi_mtf_.Insert(kMtfAll, id); - multi_mtf_.Insert(kMtfForwardDeclared, id); - if (mtf != kMtfAll) - multi_mtf_.Insert(mtf, id); - rank = 0; - } - - return EncodeMtfRankHuffman(rank, mtf, kMtfAll); -} - -spv_result_t MarkvDecoder::DecodeRefId(uint32_t* id) { - if (inst_.opcode == SpvOpAccessChain && operand_index_ >= 3) { - uint64_t use_presumed_index_technique = 0; - if (!reader_.ReadBits(&use_presumed_index_technique, 1)) - return Diag(SPV_ERROR_INVALID_BINARY) - << "Failed to read use_presumed_index_technique flag"; - - if (use_presumed_index_technique) { - uint64_t value = 0; - if (!reader_.ReadFixedWidth(&value, kMarkvMaxPresumedAccessIndex)) - return Diag(SPV_ERROR_INVALID_BINARY) - << "Failed to read presumed_index"; - - const uint32_t presumed_index = static_cast(value); - - const auto it = presumed_index_to_id_.find(presumed_index); - if (it == presumed_index_to_id_.end()) { - assert(0); - return Diag(SPV_ERROR_INTERNAL) - << "Presumed index id not found"; - } - - *id = it->second; - return SPV_SUCCESS; - } - } - - { - const spv_result_t result = DecodeIdWithDescriptor(id); - if (result != SPV_UNSUPPORTED) - return result; - } - - uint64_t mtf = GetRuleBasedMtf(); - const bool can_forward_declare = - spvOperandCanBeForwardDeclaredFunction( - SpvOp(inst_.opcode))(operand_index_); - - if (mtf != kMtfNone && !can_forward_declare) { - return DecodeExistingId(mtf, id); - } - - if (mtf == kMtfNone) - mtf = kMtfAll; - - *id = 0; - - uint32_t rank = 0; - - { - const spv_result_t result = DecodeMtfRankHuffman(mtf, kMtfAll, &rank); - if (result != SPV_SUCCESS) - return result; - } - - if (rank == 0) { - // This is the first occurrence of a forward declared id. - *id = GetIdBound(); - SetIdBound(*id + 1); - multi_mtf_.Insert(kMtfAll, *id); - multi_mtf_.Insert(kMtfForwardDeclared, *id); - if (mtf != kMtfAll) - multi_mtf_.Insert(mtf, *id); - } else { - if (!multi_mtf_.ValueFromRank(mtf, rank, id)) - return Diag(SPV_ERROR_INTERNAL) << "MTF rank out of bounds"; - } - - assert(*id); - return SPV_SUCCESS; -} - -spv_result_t MarkvEncoder::EncodeTypeId() { - if (inst_.opcode == SpvOpFunctionParameter) { - assert(!remaining_function_parameter_types_.empty()); - assert(inst_.type_id == remaining_function_parameter_types_.front()); - remaining_function_parameter_types_.pop_front(); - return SPV_SUCCESS; - } - - { - // Try to encode using id descriptor mtfs. - const spv_result_t result = EncodeIdWithDescriptor(inst_.type_id); - if (result != SPV_UNSUPPORTED) - return result; - // If can't be done continue with other methods. - } - - uint64_t mtf = GetRuleBasedMtf(); - assert(!spvOperandCanBeForwardDeclaredFunction( - SpvOp(inst_.opcode))(operand_index_)); - - if (mtf == kMtfNone) { - mtf = kMtfTypeNonFunction; - // Function types should have been handled by GetRuleBasedMtf. - assert(inst_.opcode != SpvOpFunction); - } - - return EncodeExistingId(mtf, inst_.type_id); -} - -spv_result_t MarkvDecoder::DecodeTypeId() { - if (inst_.opcode == SpvOpFunctionParameter) { - assert(!remaining_function_parameter_types_.empty()); - inst_.type_id = remaining_function_parameter_types_.front(); - remaining_function_parameter_types_.pop_front(); - return SPV_SUCCESS; - } - - { - const spv_result_t result = DecodeIdWithDescriptor(&inst_.type_id); - if (result != SPV_UNSUPPORTED) - return result; - } - - uint64_t mtf = GetRuleBasedMtf(); - assert(!spvOperandCanBeForwardDeclaredFunction( - SpvOp(inst_.opcode))(operand_index_)); - - if (mtf == kMtfNone) { - mtf = kMtfTypeNonFunction; - // Function types should have been handled by GetRuleBasedMtf. - assert(inst_.opcode != SpvOpFunction); - } - - return DecodeExistingId(mtf, &inst_.type_id); -} - -spv_result_t MarkvEncoder::EncodeResultId() { - uint32_t rank = 0; - - const uint64_t num_still_forward_declared = - multi_mtf_.GetSize(kMtfForwardDeclared); - - if (num_still_forward_declared) { - // We write the rank only if kMtfForwardDeclared is not empty. If it is - // empty the decoder knows that there are no forward declared ids to expect. - if (multi_mtf_.RankFromValue(kMtfForwardDeclared, - inst_.result_id, &rank)) { - // This is a definition of a forward declared id. We can remove the id - // from kMtfForwardDeclared. - if (!multi_mtf_.Remove(kMtfForwardDeclared, inst_.result_id)) - return Diag(SPV_ERROR_INTERNAL) - << "Failed to remove id from kMtfForwardDeclared"; - writer_.WriteBits(1, 1); - writer_.WriteVariableWidthU32( - rank, model_->mtf_rank_chunk_length()); - } else { - rank = 0; - writer_.WriteBits(0, 1); - } - } - - if (!rank) { - multi_mtf_.Insert(kMtfAll, inst_.result_id); - } - - return SPV_SUCCESS; -} - -spv_result_t MarkvDecoder::DecodeResultId() { - uint32_t rank = 0; - - const uint64_t num_still_forward_declared = - multi_mtf_.GetSize(kMtfForwardDeclared); - - if (num_still_forward_declared) { - // Some ids were forward declared. Check if this id is one of them. - uint64_t id_was_forward_declared; - if (!reader_.ReadBits(&id_was_forward_declared, 1)) - return Diag(SPV_ERROR_INVALID_BINARY) - << "Failed to read id_was_forward_declared flag"; - - if (id_was_forward_declared) { - if (!reader_.ReadVariableWidthU32( - &rank, model_->mtf_rank_chunk_length())) - return Diag(SPV_ERROR_INVALID_BINARY) - << "Failed to read MTF rank of forward declared id"; - - if (rank) { - // The id was forward declared, recover it from kMtfForwardDeclared. - if (!multi_mtf_.ValueFromRank(kMtfForwardDeclared, - rank, &inst_.result_id)) - return Diag(SPV_ERROR_INTERNAL) - << "Forward declared MTF rank is out of bounds"; - - // We can now remove the id from kMtfForwardDeclared. - if (!multi_mtf_.Remove(kMtfForwardDeclared, inst_.result_id)) - return Diag(SPV_ERROR_INTERNAL) - << "Failed to remove id from kMtfForwardDeclared"; - } - } - } - - if (inst_.result_id == 0) { - // The id was not forward declared, issue a new id. - inst_.result_id = GetIdBound(); - SetIdBound(inst_.result_id + 1); - } - - if (!rank) { - multi_mtf_.Insert(kMtfAll, inst_.result_id); - } - - return SPV_SUCCESS; -} - -spv_result_t MarkvEncoder::EncodeLiteralNumber( - const spv_parsed_operand_t& operand) { - if (operand.number_bit_width <= 32) { - const uint32_t word = inst_.words[operand.offset]; - return EncodeNonIdWord(word); - } else { - assert(operand.number_bit_width <= 64); - const uint64_t word = - uint64_t(inst_.words[operand.offset]) | - (uint64_t(inst_.words[operand.offset + 1]) << 32); - if (operand.number_kind == SPV_NUMBER_UNSIGNED_INT) { - writer_.WriteVariableWidthU64(word, model_->u64_chunk_length()); - } else if (operand.number_kind == SPV_NUMBER_SIGNED_INT) { - int64_t val = 0; - std::memcpy(&val, &word, 8); - writer_.WriteVariableWidthS64(val, model_->s64_chunk_length(), - model_->s64_block_exponent()); - } else if (operand.number_kind == SPV_NUMBER_FLOATING) { - writer_.WriteUnencoded(word); - } else { - return Diag(SPV_ERROR_INTERNAL) << "Unsupported bit length"; - } - } - return SPV_SUCCESS; -} - -spv_result_t MarkvDecoder::DecodeLiteralNumber( - const spv_parsed_operand_t& operand) { - if (operand.number_bit_width <= 32) { - uint32_t word = 0; - const spv_result_t result = DecodeNonIdWord(&word); - if (result != SPV_SUCCESS) - return result; - inst_words_.push_back(word); - } else { - assert(operand.number_bit_width <= 64); - uint64_t word = 0; - if (operand.number_kind == SPV_NUMBER_UNSIGNED_INT) { - if (!reader_.ReadVariableWidthU64(&word, model_->u64_chunk_length())) - return Diag(SPV_ERROR_INVALID_BINARY) - << "Failed to read literal U64"; - } else if (operand.number_kind == SPV_NUMBER_SIGNED_INT) { - int64_t val = 0; - if (!reader_.ReadVariableWidthS64(&val, model_->s64_chunk_length(), - model_->s64_block_exponent())) - return Diag(SPV_ERROR_INVALID_BINARY) - << "Failed to read literal S64"; - std::memcpy(&word, &val, 8); - } else if (operand.number_kind == SPV_NUMBER_FLOATING) { - if (!reader_.ReadUnencoded(&word)) - return Diag(SPV_ERROR_INVALID_BINARY) - << "Failed to read literal F64"; - } else { - return Diag(SPV_ERROR_INTERNAL) << "Unsupported bit length"; - } - inst_words_.push_back(static_cast(word)); - inst_words_.push_back(static_cast(word >> 32)); - } - return SPV_SUCCESS; -} - -void MarkvEncoder::AddByteBreak(size_t byte_break_if_less_than) { - const size_t num_bits_to_next_byte = - GetNumBitsToNextByte(writer_.GetNumBits()); - if (num_bits_to_next_byte == 0 || - num_bits_to_next_byte > byte_break_if_less_than) - return; - - if (logger_) { - logger_->AppendWhitespaces(kCommentNumWhitespaces); - logger_->AppendText(""); - } - - writer_.WriteBits(0, num_bits_to_next_byte); -} - -bool MarkvDecoder::ReadToByteBreak(size_t byte_break_if_less_than) { - const size_t num_bits_to_next_byte = - GetNumBitsToNextByte(reader_.GetNumReadBits()); - if (num_bits_to_next_byte == 0 || - num_bits_to_next_byte > byte_break_if_less_than) - return true; - - - uint64_t bits = 0; - if (!reader_.ReadBits(&bits, num_bits_to_next_byte)) - return false; - - assert(bits == 0); - if (bits != 0) - return false; - - return true; -} - -spv_result_t MarkvEncoder::EncodeInstruction( - const spv_parsed_instruction_t& inst) { - SpvOp opcode = SpvOp(inst.opcode); - inst_ = inst; - - const spv_result_t validation_result = UpdateValidationState(inst); - if (validation_result != SPV_SUCCESS) - return validation_result; - - LogDisassemblyInstruction(); - - const spv_result_t opcode_encodig_result = - EncodeOpcodeAndNumOperands(opcode, inst.num_operands); - if (opcode_encodig_result < 0) - return opcode_encodig_result; - - if (opcode_encodig_result != SPV_SUCCESS) { - // Fallback encoding for opcode and num_operands. - writer_.WriteVariableWidthU32(opcode, model_->opcode_chunk_length()); - - if (!OpcodeHasFixedNumberOfOperands(opcode)) { - // If the opcode has a variable number of operands, encode the number of - // operands with the instruction. - - if (logger_) - logger_->AppendWhitespaces(kCommentNumWhitespaces); - - writer_.WriteVariableWidthU16(inst.num_operands, - model_->num_operands_chunk_length()); - } - } - - // Write operands. - const uint32_t num_operands = inst_.num_operands; - for (operand_index_ = 0; operand_index_ < num_operands; ++operand_index_) { - operand_ = inst_.operands[operand_index_]; - - if (logger_) { - logger_->AppendWhitespaces(kCommentNumWhitespaces); - logger_->AppendText("<"); - logger_->AppendText(spvOperandTypeStr(operand_.type)); - logger_->AppendText(">"); - } - - switch (operand_.type) { - case SPV_OPERAND_TYPE_RESULT_ID: - case SPV_OPERAND_TYPE_TYPE_ID: - case SPV_OPERAND_TYPE_ID: - case SPV_OPERAND_TYPE_OPTIONAL_ID: - case SPV_OPERAND_TYPE_SCOPE_ID: - case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: { - const uint32_t id = inst_.words[operand_.offset]; - if (operand_.type == SPV_OPERAND_TYPE_TYPE_ID) { - const spv_result_t result = EncodeTypeId(); - if (result != SPV_SUCCESS) - return result; - } else if (operand_.type == SPV_OPERAND_TYPE_RESULT_ID) { - const spv_result_t result = EncodeResultId(); - if (result != SPV_SUCCESS) - return result; - } else { - const spv_result_t result = EncodeRefId(id); - if (result != SPV_SUCCESS) - return result; - } - - multi_mtf_.Promote(id); - break; - } - - case SPV_OPERAND_TYPE_LITERAL_INTEGER: { - const spv_result_t result = - EncodeNonIdWord(inst_.words[operand_.offset]); - if (result != SPV_SUCCESS) - return result; - break; - } - - case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: { - const spv_result_t result = EncodeLiteralNumber(operand_); - if (result != SPV_SUCCESS) - return result; - break; - } - - case SPV_OPERAND_TYPE_LITERAL_STRING: { - const char* src = reinterpret_cast( - &inst_.words[operand_.offset]); - - auto* codec = model_->GetLiteralStringHuffmanCodec(opcode); - if (codec) { - uint64_t bits = 0; - size_t num_bits = 0; - const std::string str = src; - if (codec->Encode(str, &bits, &num_bits)) { - writer_.WriteBits(bits, num_bits); - break; - } else { - bool result = codec->Encode("kMarkvNoneOfTheAbove", - &bits, &num_bits); - (void)result; - assert(result); - writer_.WriteBits(bits, num_bits); - } - } - - const size_t length = spv_strnlen_s(src, operand_.num_words * 4); - if (length == operand_.num_words * 4) - return Diag(SPV_ERROR_INVALID_BINARY) - << "Failed to find terminal character of literal string"; - for (size_t i = 0; i < length + 1; ++i) - writer_.WriteUnencoded(src[i]); - break; - } - - default: { - for (int i = 0; i < operand_.num_words; ++i) { - const uint32_t word = inst_.words[operand_.offset + i]; - const spv_result_t result = EncodeNonIdWord(word); - if (result != SPV_SUCCESS) - return result; - } - break; - } - } - } - - AddByteBreak(kByteBreakAfterInstIfLessThanUntilNextByte); - - if (logger_) { - logger_->NewLine(); - logger_->NewLine(); - } - - ProcessCurInstruction(); - - return SPV_SUCCESS; -} - -spv_result_t MarkvDecoder::DecodeModule(std::vector* spirv_binary) { - const bool header_read_success = - reader_.ReadUnencoded(&header_.magic_number) && - reader_.ReadUnencoded(&header_.markv_version) && - reader_.ReadUnencoded(&header_.markv_model) && - reader_.ReadUnencoded(&header_.markv_length_in_bits) && - reader_.ReadUnencoded(&header_.spirv_version) && - reader_.ReadUnencoded(&header_.spirv_generator); - - if (!header_read_success) - return Diag(SPV_ERROR_INVALID_BINARY) - << "Unable to read MARK-V header"; - - if (header_.markv_length_in_bits == 0) - return Diag(SPV_ERROR_INVALID_BINARY) - << "Header markv_length_in_bits field is zero"; - - if (header_.magic_number != kMarkvMagicNumber) - return Diag(SPV_ERROR_INVALID_BINARY) - << "MARK-V binary has incorrect magic number"; - - // TODO(atgoo@github.com): Print version strings. - if (header_.markv_version != GetMarkvVersion()) - return Diag(SPV_ERROR_INVALID_BINARY) - << "MARK-V binary and the codec have different versions"; - - const uint32_t model_type = header_.markv_model >> 16; - const uint32_t model_version = header_.markv_model & 0xFFFF; - if (model_type != model_->model_type()) - return Diag(SPV_ERROR_INVALID_BINARY) - << "MARK-V binary and the codec use different MARK-V models"; - - if (model_version != model_->model_version()) - return Diag(SPV_ERROR_INVALID_BINARY) - << "MARK-V binary and the codec use different versions if the same " - << "MARK-V model"; - - spirv_.reserve(header_.markv_length_in_bits / 2); // Heuristic. - spirv_.resize(5, 0); - spirv_[0] = kSpirvMagicNumber; - spirv_[1] = header_.spirv_version; - spirv_[2] = header_.spirv_generator; - - while (reader_.GetNumReadBits() < header_.markv_length_in_bits) { - inst_ = {}; - const spv_result_t decode_result = DecodeInstruction(); - if (decode_result != SPV_SUCCESS) - return decode_result; - - const spv_result_t validation_result = UpdateValidationState(inst_); - if (validation_result != SPV_SUCCESS) - return validation_result; - } - - - if (reader_.GetNumReadBits() != header_.markv_length_in_bits || - !reader_.OnlyZeroesLeft()) { - return Diag(SPV_ERROR_INVALID_BINARY) - << "MARK-V binary has wrong stated bit length " - << reader_.GetNumReadBits() << " " << header_.markv_length_in_bits; - } - - // Decoding of the module is finished, validation state should have correct - // id bound. - spirv_[3] = GetIdBound(); - - *spirv_binary = std::move(spirv_); - return SPV_SUCCESS; -} - -// TODO(atgoo@github.com): The implementation borrows heavily from -// Parser::parseOperand. -// Consider coupling them together in some way once MARK-V codec is more mature. -// For now it's better to keep the code independent for experimentation -// purposes. -spv_result_t MarkvDecoder::DecodeOperand( - size_t operand_offset, - const spv_operand_type_t type, - spv_operand_pattern_t* expected_operands) { - const SpvOp opcode = static_cast(inst_.opcode); - - memset(&operand_, 0, sizeof(operand_)); - - assert((operand_offset >> 16) == 0); - operand_.offset = static_cast(operand_offset); - operand_.type = type; - - // Set default values, may be updated later. - operand_.number_kind = SPV_NUMBER_NONE; - operand_.number_bit_width = 0; - - const size_t first_word_index = inst_words_.size(); - - switch (type) { - case SPV_OPERAND_TYPE_RESULT_ID: { - const spv_result_t result = DecodeResultId(); - if (result != SPV_SUCCESS) - return result; - - inst_words_.push_back(inst_.result_id); - SetIdBound(std::max(GetIdBound(), inst_.result_id + 1)); - multi_mtf_.Promote(inst_.result_id); - break; - } - - case SPV_OPERAND_TYPE_TYPE_ID: { - const spv_result_t result = DecodeTypeId(); - if (result != SPV_SUCCESS) - return result; - - inst_words_.push_back(inst_.type_id); - SetIdBound(std::max(GetIdBound(), inst_.type_id + 1)); - multi_mtf_.Promote(inst_.type_id); - break; - } - - case SPV_OPERAND_TYPE_ID: - case SPV_OPERAND_TYPE_OPTIONAL_ID: - case SPV_OPERAND_TYPE_SCOPE_ID: - case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: { - uint32_t id = 0; - const spv_result_t result = DecodeRefId(&id); - if (result != SPV_SUCCESS) - return result; - - if (id == 0) - return Diag(SPV_ERROR_INVALID_BINARY) << "Decoded id is 0"; - - if (type == SPV_OPERAND_TYPE_ID || - type == SPV_OPERAND_TYPE_OPTIONAL_ID) { - - operand_.type = SPV_OPERAND_TYPE_ID; - - if (opcode == SpvOpExtInst && operand_.offset == 3) { - // The current word is the extended instruction set id. - // Set the extended instruction set type for the current - // instruction. - auto ext_inst_type_iter = import_id_to_ext_inst_type_.find(id); - if (ext_inst_type_iter == import_id_to_ext_inst_type_.end()) { - return Diag(SPV_ERROR_INVALID_ID) - << "OpExtInst set id " << id - << " does not reference an OpExtInstImport result Id"; - } - inst_.ext_inst_type = ext_inst_type_iter->second; - } - } - - inst_words_.push_back(id); - SetIdBound(std::max(GetIdBound(), id + 1)); - multi_mtf_.Promote(id); - break; - } - - case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: { - uint32_t word = 0; - const spv_result_t result = DecodeNonIdWord(&word); - if (result != SPV_SUCCESS) - return result; - - inst_words_.push_back(word); - - assert(SpvOpExtInst == opcode); - assert(inst_.ext_inst_type != SPV_EXT_INST_TYPE_NONE); - spv_ext_inst_desc ext_inst; - if (grammar_.lookupExtInst(inst_.ext_inst_type, word, &ext_inst)) - return Diag(SPV_ERROR_INVALID_BINARY) - << "Invalid extended instruction number: " << word; - spvPushOperandTypes(ext_inst->operandTypes, expected_operands); - break; - } - - case SPV_OPERAND_TYPE_LITERAL_INTEGER: - case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER: { - // These are regular single-word literal integer operands. - // Post-parsing validation should check the range of the parsed value. - operand_.type = SPV_OPERAND_TYPE_LITERAL_INTEGER; - // It turns out they are always unsigned integers! - operand_.number_kind = SPV_NUMBER_UNSIGNED_INT; - operand_.number_bit_width = 32; - - uint32_t word = 0; - const spv_result_t result = DecodeNonIdWord(&word); - if (result != SPV_SUCCESS) - return result; - - inst_words_.push_back(word); - break; - } - - case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: - case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER: { - operand_.type = SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER; - if (opcode == SpvOpSwitch) { - // The literal operands have the same type as the value - // referenced by the selector Id. - const uint32_t selector_id = inst_words_.at(1); - const auto type_id_iter = id_to_type_id_.find(selector_id); - if (type_id_iter == id_to_type_id_.end() || - type_id_iter->second == 0) { - return Diag(SPV_ERROR_INVALID_BINARY) - << "Invalid OpSwitch: selector id " << selector_id - << " has no type"; - } - uint32_t type_id = type_id_iter->second; - - if (selector_id == type_id) { - // Recall that by convention, a result ID that is a type definition - // maps to itself. - return Diag(SPV_ERROR_INVALID_BINARY) - << "Invalid OpSwitch: selector id " << selector_id - << " is a type, not a value"; - } - if (auto error = SetNumericTypeInfoForType(&operand_, type_id)) - return error; - if (operand_.number_kind != SPV_NUMBER_UNSIGNED_INT && - operand_.number_kind != SPV_NUMBER_SIGNED_INT) { - return Diag(SPV_ERROR_INVALID_BINARY) - << "Invalid OpSwitch: selector id " << selector_id - << " is not a scalar integer"; - } - } else { - assert(opcode == SpvOpConstant || opcode == SpvOpSpecConstant); - // The literal number type is determined by the type Id for the - // constant. - assert(inst_.type_id); - if (auto error = SetNumericTypeInfoForType(&operand_, inst_.type_id)) - return error; - } - - if (auto error = DecodeLiteralNumber(operand_)) - return error; - - break; - } - - case SPV_OPERAND_TYPE_LITERAL_STRING: - case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING: { - operand_.type = SPV_OPERAND_TYPE_LITERAL_STRING; - std::vector str; - auto* codec = model_->GetLiteralStringHuffmanCodec(inst_.opcode); - - if (codec) { - std::string decoded_string; - const bool huffman_result = - codec->DecodeFromStream(GetReadBitCallback(), &decoded_string); - assert(huffman_result); - if (!huffman_result) - return Diag(SPV_ERROR_INVALID_BINARY) - << "Failed to read literal string"; - - if (decoded_string != "kMarkvNoneOfTheAbove") { - std::copy(decoded_string.begin(), decoded_string.end(), - std::back_inserter(str)); - str.push_back('\0'); - } - } - - // The loop is expected to terminate once we encounter '\0' or exhaust - // the bit stream. - if (str.empty()) { - while (true) { - char ch = 0; - if (!reader_.ReadUnencoded(&ch)) - return Diag(SPV_ERROR_INVALID_BINARY) - << "Failed to read literal string"; - - str.push_back(ch); - - if (ch == '\0') - break; - } - } - - while (str.size() % 4 != 0) - str.push_back('\0'); - - inst_words_.resize(inst_words_.size() + str.size() / 4); - std::memcpy(&inst_words_[first_word_index], str.data(), str.size()); - - if (SpvOpExtInstImport == opcode) { - // Record the extended instruction type for the ID for this import. - // There is only one string literal argument to OpExtInstImport, - // so it's sufficient to guard this just on the opcode. - const spv_ext_inst_type_t ext_inst_type = - spvExtInstImportTypeGet(str.data()); - if (SPV_EXT_INST_TYPE_NONE == ext_inst_type) { - return Diag(SPV_ERROR_INVALID_BINARY) - << "Invalid extended instruction import '" << str.data() << "'"; - } - // We must have parsed a valid result ID. It's a condition - // of the grammar, and we only accept non-zero result Ids. - assert(inst_.result_id); - const bool inserted = import_id_to_ext_inst_type_.emplace( - inst_.result_id, ext_inst_type).second; - (void)inserted; - assert(inserted); - } - break; - } - - case SPV_OPERAND_TYPE_CAPABILITY: - case SPV_OPERAND_TYPE_SOURCE_LANGUAGE: - case SPV_OPERAND_TYPE_EXECUTION_MODEL: - case SPV_OPERAND_TYPE_ADDRESSING_MODEL: - case SPV_OPERAND_TYPE_MEMORY_MODEL: - case SPV_OPERAND_TYPE_EXECUTION_MODE: - case SPV_OPERAND_TYPE_STORAGE_CLASS: - case SPV_OPERAND_TYPE_DIMENSIONALITY: - case SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE: - case SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE: - case SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT: - case SPV_OPERAND_TYPE_FP_ROUNDING_MODE: - case SPV_OPERAND_TYPE_LINKAGE_TYPE: - case SPV_OPERAND_TYPE_ACCESS_QUALIFIER: - case SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER: - case SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE: - case SPV_OPERAND_TYPE_DECORATION: - case SPV_OPERAND_TYPE_BUILT_IN: - case SPV_OPERAND_TYPE_GROUP_OPERATION: - case SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS: - case SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO: { - // A single word that is a plain enum value. - uint32_t word = 0; - const spv_result_t result = DecodeNonIdWord(&word); - if (result != SPV_SUCCESS) - return result; - - inst_words_.push_back(word); - - // Map an optional operand type to its corresponding concrete type. - if (type == SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER) - operand_.type = SPV_OPERAND_TYPE_ACCESS_QUALIFIER; - - spv_operand_desc entry; - if (grammar_.lookupOperand(type, word, &entry)) { - return Diag(SPV_ERROR_INVALID_BINARY) - << "Invalid " - << spvOperandTypeStr(operand_.type) - << " operand: " << word; - } - - // Prepare to accept operands to this operand, if needed. - spvPushOperandTypes(entry->operandTypes, expected_operands); - break; - } - - case SPV_OPERAND_TYPE_FP_FAST_MATH_MODE: - case SPV_OPERAND_TYPE_FUNCTION_CONTROL: - case SPV_OPERAND_TYPE_LOOP_CONTROL: - case SPV_OPERAND_TYPE_IMAGE: - case SPV_OPERAND_TYPE_OPTIONAL_IMAGE: - case SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS: - case SPV_OPERAND_TYPE_SELECTION_CONTROL: { - // This operand is a mask. - uint32_t word = 0; - const spv_result_t result = DecodeNonIdWord(&word); - if (result != SPV_SUCCESS) - return result; - - inst_words_.push_back(word); - - // Map an optional operand type to its corresponding concrete type. - if (type == SPV_OPERAND_TYPE_OPTIONAL_IMAGE) - operand_.type = SPV_OPERAND_TYPE_IMAGE; - else if (type == SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS) - operand_.type = SPV_OPERAND_TYPE_MEMORY_ACCESS; - - // Check validity of set mask bits. Also prepare for operands for those - // masks if they have any. To get operand order correct, scan from - // MSB to LSB since we can only prepend operands to a pattern. - // The only case in the grammar where you have more than one mask bit - // having an operand is for image operands. See SPIR-V 3.14 Image - // Operands. - uint32_t remaining_word = word; - for (uint32_t mask = (1u << 31); remaining_word; mask >>= 1) { - if (remaining_word & mask) { - spv_operand_desc entry; - if (grammar_.lookupOperand(type, mask, &entry)) { - return Diag(SPV_ERROR_INVALID_BINARY) - << "Invalid " << spvOperandTypeStr(operand_.type) - << " operand: " << word << " has invalid mask component " - << mask; - } - remaining_word ^= mask; - spvPushOperandTypes(entry->operandTypes, expected_operands); - } - } - if (word == 0) { - // An all-zeroes mask *might* also be valid. - spv_operand_desc entry; - if (SPV_SUCCESS == grammar_.lookupOperand(type, 0, &entry)) { - // Prepare for its operands, if any. - spvPushOperandTypes(entry->operandTypes, expected_operands); - } - } - break; - } - default: - return Diag(SPV_ERROR_INVALID_BINARY) - << "Internal error: Unhandled operand type: " << type; - } - - operand_.num_words = uint16_t(inst_words_.size() - first_word_index); - - assert(int(SPV_OPERAND_TYPE_FIRST_CONCRETE_TYPE) <= int(operand_.type)); - assert(int(SPV_OPERAND_TYPE_LAST_CONCRETE_TYPE) >= int(operand_.type)); - - parsed_operands_.push_back(operand_); - - return SPV_SUCCESS; -} - -spv_result_t MarkvDecoder::DecodeInstruction() { - parsed_operands_.clear(); - inst_words_.clear(); - - // Opcode/num_words placeholder, the word will be filled in later. - inst_words_.push_back(0); - - bool num_operands_still_unknown = true; - { - uint32_t opcode = 0; - uint32_t num_operands = 0; - - const spv_result_t opcode_decoding_result = - DecodeOpcodeAndNumberOfOperands(&opcode, &num_operands); - if (opcode_decoding_result < 0) - return opcode_decoding_result; - - if (opcode_decoding_result == SPV_SUCCESS) { - inst_.num_operands = static_cast(num_operands); - num_operands_still_unknown = false; - } else { - if (!reader_.ReadVariableWidthU32( - &opcode, model_->opcode_chunk_length())) { - return Diag(SPV_ERROR_INVALID_BINARY) - << "Failed to read opcode of instruction"; - } - } - - inst_.opcode = static_cast(opcode); - } - - const SpvOp opcode = static_cast(inst_.opcode); - - spv_opcode_desc opcode_desc; - if (grammar_.lookupOpcode(opcode, &opcode_desc) != SPV_SUCCESS) { - return Diag(SPV_ERROR_INVALID_BINARY) << "Invalid opcode"; - } - - spv_operand_pattern_t expected_operands; - expected_operands.reserve(opcode_desc->numTypes); - for (auto i = 0; i < opcode_desc->numTypes; i++) { - expected_operands.push_back( - opcode_desc->operandTypes[opcode_desc->numTypes - i - 1]); - } - - if (num_operands_still_unknown) { - if (!OpcodeHasFixedNumberOfOperands(opcode)) { - if (!reader_.ReadVariableWidthU16(&inst_.num_operands, - model_->num_operands_chunk_length())) - return Diag(SPV_ERROR_INVALID_BINARY) - << "Failed to read num_operands of instruction"; - } else { - inst_.num_operands = static_cast(expected_operands.size()); - } - } - - for (operand_index_ = 0; - operand_index_ < static_cast(inst_.num_operands); - ++operand_index_) { - assert(!expected_operands.empty()); - const spv_operand_type_t type = - spvTakeFirstMatchableOperand(&expected_operands); - - const size_t operand_offset = inst_words_.size(); - - const spv_result_t decode_result = DecodeOperand( - operand_offset, type, &expected_operands); - - if (decode_result != SPV_SUCCESS) - return decode_result; - } - - - assert(inst_.num_operands == parsed_operands_.size()); - - // Only valid while inst_words_ and parsed_operands_ remain unchanged (until - // next DecodeInstruction call). - inst_.words = inst_words_.data(); - inst_.operands = parsed_operands_.empty() ? nullptr : parsed_operands_.data(); - inst_.num_words = static_cast(inst_words_.size()); - inst_words_[0] = spvOpcodeMake(inst_.num_words, SpvOp(inst_.opcode)); - - std::copy(inst_words_.begin(), inst_words_.end(), std::back_inserter(spirv_)); - - assert(inst_.num_words == std::accumulate( - parsed_operands_.begin(), parsed_operands_.end(), 1, - [](int num_words, const spv_parsed_operand_t& operand) { - return num_words += operand.num_words; - }) && "num_words in instruction doesn't correspond to the sum of num_words" - "in the operands"); - - RecordNumberType(); - ProcessCurInstruction(); - - if (!ReadToByteBreak(kByteBreakAfterInstIfLessThanUntilNextByte)) - return Diag(SPV_ERROR_INVALID_BINARY) - << "Failed to read to byte break"; - - return SPV_SUCCESS; -} - -spv_result_t MarkvDecoder::SetNumericTypeInfoForType( - spv_parsed_operand_t* parsed_operand, uint32_t type_id) { - assert(type_id != 0); - auto type_info_iter = type_id_to_number_type_info_.find(type_id); - if (type_info_iter == type_id_to_number_type_info_.end()) { - return Diag(SPV_ERROR_INVALID_BINARY) - << "Type Id " << type_id << " is not a type"; - } - - const NumberType& info = type_info_iter->second; - if (info.type == SPV_NUMBER_NONE) { - // This is a valid type, but for something other than a scalar number. - return Diag(SPV_ERROR_INVALID_BINARY) - << "Type Id " << type_id << " is not a scalar numeric type"; - } - - parsed_operand->number_kind = info.type; - parsed_operand->number_bit_width = info.bit_width; - // Round up the word count. - parsed_operand->num_words = static_cast((info.bit_width + 31) / 32); - return SPV_SUCCESS; -} - -void MarkvDecoder::RecordNumberType() { - const SpvOp opcode = static_cast(inst_.opcode); - if (spvOpcodeGeneratesType(opcode)) { - NumberType info = {SPV_NUMBER_NONE, 0}; - if (SpvOpTypeInt == opcode) { - info.bit_width = inst_.words[inst_.operands[1].offset]; - info.type = inst_.words[inst_.operands[2].offset] ? - SPV_NUMBER_SIGNED_INT : SPV_NUMBER_UNSIGNED_INT; - } else if (SpvOpTypeFloat == opcode) { - info.bit_width = inst_.words[inst_.operands[1].offset]; - info.type = SPV_NUMBER_FLOATING; - } - // The *result* Id of a type generating instruction is the type Id. - type_id_to_number_type_info_[inst_.result_id] = info; - } -} - -spv_result_t EncodeHeader( - void* user_data, spv_endianness_t endian, uint32_t magic, - uint32_t version, uint32_t generator, uint32_t id_bound, - uint32_t schema) { - MarkvEncoder* encoder = reinterpret_cast(user_data); - return encoder->EncodeHeader( - endian, magic, version, generator, id_bound, schema); -} - -spv_result_t EncodeInstruction( - void* user_data, const spv_parsed_instruction_t* inst) { - MarkvEncoder* encoder = reinterpret_cast(user_data); - return encoder->EncodeInstruction(*inst); -} - -} // namespace - -spv_result_t SpirvToMarkv(spv_const_context context, - const std::vector& spirv, - const MarkvEncoderOptions& options, - const MarkvModel& markv_model, - MessageConsumer message_consumer, - std::vector* markv, - std::string* comments) { - spv_context_t hijack_context = *context; - SetContextMessageConsumer(&hijack_context, message_consumer); - - spv_const_binary_t spirv_binary = {spirv.data(), spirv.size()}; - - spv_endianness_t endian; - spv_position_t position = {}; - if (spvBinaryEndianness(&spirv_binary, &endian)) { - return DiagnosticStream(position, hijack_context.consumer, - SPV_ERROR_INVALID_BINARY) - << "Invalid SPIR-V magic number."; - } - - spv_header_t header; - if (spvBinaryHeaderGet(&spirv_binary, endian, &header)) { - return DiagnosticStream(position, hijack_context.consumer, - SPV_ERROR_INVALID_BINARY) - << "Invalid SPIR-V header."; - } - - MarkvEncoder encoder(&hijack_context, options, &markv_model); - - if (comments) { - encoder.CreateCommentsLogger(); - - spv_text text = nullptr; - if (spvBinaryToText(&hijack_context, spirv.data(), spirv.size(), - SPV_BINARY_TO_TEXT_OPTION_NO_HEADER, &text, nullptr) - != SPV_SUCCESS) { - return DiagnosticStream(position, hijack_context.consumer, - SPV_ERROR_INVALID_BINARY) - << "Failed to disassemble SPIR-V binary."; - } - assert(text); - encoder.SetDisassembly(std::string(text->str, text->length)); - spvTextDestroy(text); - } - - if (spvBinaryParse( - &hijack_context, &encoder, spirv.data(), spirv.size(), EncodeHeader, - EncodeInstruction, nullptr) != SPV_SUCCESS) { - return DiagnosticStream(position, hijack_context.consumer, - SPV_ERROR_INVALID_BINARY) - << "Unable to encode to MARK-V."; - } - - if (comments) - *comments = encoder.GetComments(); - - *markv = encoder.GetMarkvBinary(); - return SPV_SUCCESS; -} - -spv_result_t MarkvToSpirv(spv_const_context context, - const std::vector& markv, - const MarkvDecoderOptions& options, - const MarkvModel& markv_model, - MessageConsumer message_consumer, - std::vector* spirv, - std::string* /* comments */) { - spv_position_t position = {}; - spv_context_t hijack_context = *context; - SetContextMessageConsumer(&hijack_context, message_consumer); - - MarkvDecoder decoder(&hijack_context, markv, options, &markv_model); - - if (decoder.DecodeModule(spirv) != SPV_SUCCESS) { - return DiagnosticStream(position, hijack_context.consumer, - SPV_ERROR_INVALID_BINARY) - << "Unable to decode MARK-V."; - } - - assert(!spirv->empty()); - return SPV_SUCCESS; -} - -} // namespave spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/comp/markv.h vulkan-1.1.73+dfsg/external/spirv-tools/source/comp/markv.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/comp/markv.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/comp/markv.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// MARK-V is a compression format for SPIR-V binaries. It strips away -// non-essential information (such as result ids which can be regenerated) and -// uses various bit reduction techiniques to reduce the size of the binary and -// make it more similar to other compressed SPIR-V files to further improve -// compression of the dataset. - -#ifndef SPIRV_TOOLS_MARKV_HPP_ -#define SPIRV_TOOLS_MARKV_HPP_ - -#include -#include - -#include "markv_model.h" -#include "spirv-tools/libspirv.hpp" - -namespace spvtools { - -struct MarkvEncoderOptions { - bool validate_spirv_binary = false; -}; - -struct MarkvDecoderOptions { - bool validate_spirv_binary = false; -}; - -// Encodes the given SPIR-V binary to MARK-V binary. -// If |comments| is not nullptr, it would contain a textual description of -// how encoding was done (with snippets of disassembly and bit sequences). -spv_result_t SpirvToMarkv(spv_const_context context, - const std::vector& spirv, - const MarkvEncoderOptions& options, - const MarkvModel& markv_model, - MessageConsumer message_consumer, - std::vector* markv, - std::string* comments); - -// Decodes a SPIR-V binary from the given MARK-V binary. -// If |comments| is not nullptr, it would contain a textual description of -// how decoding was done (with snippets of disassembly and bit sequences). -spv_result_t MarkvToSpirv(spv_const_context context, - const std::vector& markv, - const MarkvDecoderOptions& options, - const MarkvModel& markv_model, - MessageConsumer message_consumer, - std::vector* spirv, - std::string* comments); - -} // namespace spvtools - -#endif // SPIRV_TOOLS_MARKV_HPP_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/comp/markv_model.h vulkan-1.1.73+dfsg/external/spirv-tools/source/comp/markv_model.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/comp/markv_model.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/comp/markv_model.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,176 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_COMP_MARKV_MODEL_H_ -#define LIBSPIRV_COMP_MARKV_MODEL_H_ - -#include -#include -#include - -#include "spirv/1.2/spirv.h" -#include "spirv-tools/libspirv.h" -#include "util/huffman_codec.h" - -namespace spvtools { - -// Base class for MARK-V models. -// The class contains encoding/decoding model with various constants and -// codecs used by the compression algorithm. -class MarkvModel { - public: - MarkvModel() : operand_chunk_lengths_( - static_cast(SPV_OPERAND_TYPE_NUM_OPERAND_TYPES), 0) {} - - uint32_t model_type() const { return model_type_; } - uint32_t model_version() const { return model_version_; } - - uint32_t opcode_chunk_length() const { return opcode_chunk_length_; } - uint32_t num_operands_chunk_length() const { return num_operands_chunk_length_; } - uint32_t mtf_rank_chunk_length() const { return mtf_rank_chunk_length_; } - - uint32_t u64_chunk_length() const { return u64_chunk_length_; } - uint32_t s64_chunk_length() const { return s64_chunk_length_; } - uint32_t s64_block_exponent() const { return s64_block_exponent_; } - - // Returns a codec for common opcode_and_num_operands words for the given - // previous opcode. May return nullptr if the codec doesn't exist. - const spvutils::HuffmanCodec* GetOpcodeAndNumOperandsMarkovHuffmanCodec( - uint32_t prev_opcode) const { - if (prev_opcode == SpvOpNop) - return opcode_and_num_operands_huffman_codec_.get(); - - const auto it = - opcode_and_num_operands_markov_huffman_codecs_.find(prev_opcode); - if (it == opcode_and_num_operands_markov_huffman_codecs_.end()) - return nullptr; - return it->second.get(); - } - - // Returns a codec for common non-id words used for given operand slot. - // Operand slot is defined by the opcode and the operand index. - // May return nullptr if the codec doesn't exist. - const spvutils::HuffmanCodec* GetNonIdWordHuffmanCodec( - uint32_t opcode, uint32_t operand_index) const { - const auto it = non_id_word_huffman_codecs_.find( - std::pair(opcode, operand_index)); - if (it == non_id_word_huffman_codecs_.end()) - return nullptr; - return it->second.get(); - } - - // Returns a codec for common id descriptos used for given operand slot. - // Operand slot is defined by the opcode and the operand index. - // May return nullptr if the codec doesn't exist. - const spvutils::HuffmanCodec* GetIdDescriptorHuffmanCodec( - uint32_t opcode, uint32_t operand_index) const { - const auto it = id_descriptor_huffman_codecs_.find( - std::pair(opcode, operand_index)); - if (it == id_descriptor_huffman_codecs_.end()) - return nullptr; - return it->second.get(); - } - - // Returns a codec for common strings used by the given opcode. - // Operand slot is defined by the opcode and the operand index. - // May return nullptr if the codec doesn't exist. - const spvutils::HuffmanCodec* GetLiteralStringHuffmanCodec( - uint32_t opcode) const { - const auto it = literal_string_huffman_codecs_.find(opcode); - if (it == literal_string_huffman_codecs_.end()) - return nullptr; - return it->second.get(); - } - - // Checks if |descriptor| has a coding scheme in any of - // id_descriptor_huffman_codecs_. - bool DescriptorHasCodingScheme(uint32_t descriptor) const { - return descriptors_with_coding_scheme_.count(descriptor); - } - - // Returns chunk length used for variable length encoding of spirv operand - // words. - uint32_t GetOperandVariableWidthChunkLength(spv_operand_type_t type) const { - return operand_chunk_lengths_.at(static_cast(type)); - } - - // Sets model type. - void SetModelType(uint32_t in_model_type) { - model_type_ = in_model_type; - } - - // Sets model version. - void SetModelVersion(uint32_t in_model_version) { - model_version_ = in_model_version; - } - - // Returns value used by Huffman codecs as a signal that a value is not in the - // coding table. - static uint64_t GetMarkvNoneOfTheAbove() { - // Magic number. - return 1111111111111111111; - } - - MarkvModel(const MarkvModel&) = delete; - const MarkvModel& operator=(const MarkvModel&) = delete; - - protected: - // Huffman codec for base-rate of opcode_and_num_operands. - std::unique_ptr> - opcode_and_num_operands_huffman_codec_; - - // Huffman codecs for opcode_and_num_operands. The map key is previous opcode. - std::map>> - opcode_and_num_operands_markov_huffman_codecs_; - - // Huffman codecs for non-id single-word operand values. - // The map key is pair . - std::map, - std::unique_ptr>> non_id_word_huffman_codecs_; - - // Huffman codecs for id descriptors. The map key is pair - // . - std::map, - std::unique_ptr>> id_descriptor_huffman_codecs_; - - // Set of all descriptors which have a coding scheme in any of - // id_descriptor_huffman_codecs_. - std::unordered_set descriptors_with_coding_scheme_; - - // Huffman codecs for literal strings. The map key is the opcode of the - // current instruction. This assumes, that there is no more than one literal - // string operand per instruction, but would still work even if this is not - // the case. Names and debug information strings are not collected. - std::map>> - literal_string_huffman_codecs_; - - // Chunk lengths used for variable width encoding of operands (index is - // spv_operand_type of the operand). - std::vector operand_chunk_lengths_; - - uint32_t opcode_chunk_length_ = 7; - uint32_t num_operands_chunk_length_ = 3; - uint32_t mtf_rank_chunk_length_ = 5; - - uint32_t u64_chunk_length_ = 8; - uint32_t s64_chunk_length_ = 8; - uint32_t s64_block_exponent_ = 10; - - uint32_t model_type_ = 0; - uint32_t model_version_ = 0; -}; - -} // namespace spvtools - -#endif // LIBSPIRV_COMP_MARKV_MODEL_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/diagnostic.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/diagnostic.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/diagnostic.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/diagnostic.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,186 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "diagnostic.h" - -#include -#include -#include -#include - -#include "table.h" - -// Diagnostic API - -spv_diagnostic spvDiagnosticCreate(const spv_position position, - const char* message) { - spv_diagnostic diagnostic = new spv_diagnostic_t; - if (!diagnostic) return nullptr; - size_t length = strlen(message) + 1; - diagnostic->error = new char[length]; - if (!diagnostic->error) { - delete diagnostic; - return nullptr; - } - diagnostic->position = *position; - diagnostic->isTextSource = false; - memset(diagnostic->error, 0, length); - strncpy(diagnostic->error, message, length); - return diagnostic; -} - -void spvDiagnosticDestroy(spv_diagnostic diagnostic) { - if (!diagnostic) return; - delete[] diagnostic->error; - delete diagnostic; -} - -spv_result_t spvDiagnosticPrint(const spv_diagnostic diagnostic) { - if (!diagnostic) return SPV_ERROR_INVALID_DIAGNOSTIC; - - if (diagnostic->isTextSource) { - // NOTE: This is a text position - // NOTE: add 1 to the line as editors start at line 1, we are counting new - // line characters to start at line 0 - std::cerr << "error: " << diagnostic->position.line + 1 << ": " - << diagnostic->position.column + 1 << ": " << diagnostic->error - << "\n"; - return SPV_SUCCESS; - } else { - // NOTE: Assume this is a binary position - std::cerr << "error: " << diagnostic->position.index << ": " - << diagnostic->error << "\n"; - return SPV_SUCCESS; - } -} - -namespace libspirv { - -DiagnosticStream::DiagnosticStream(DiagnosticStream&& other) - : stream_(), - position_(other.position_), - consumer_(other.consumer_), - error_(other.error_) { - // Prevent the other object from emitting output during destruction. - other.error_ = SPV_FAILED_MATCH; - // Some platforms are missing support for std::ostringstream functionality, - // including: move constructor, swap method. Either would have been a - // better choice than copying the string. - stream_ << other.stream_.str(); -} - -DiagnosticStream::~DiagnosticStream() { - if (error_ != SPV_FAILED_MATCH && consumer_ != nullptr) { - auto level = SPV_MSG_ERROR; - switch (error_) { - case SPV_SUCCESS: - case SPV_REQUESTED_TERMINATION: // Essentially success. - level = SPV_MSG_INFO; - break; - case SPV_WARNING: - level = SPV_MSG_WARNING; - break; - case SPV_UNSUPPORTED: - case SPV_ERROR_INTERNAL: - case SPV_ERROR_INVALID_TABLE: - level = SPV_MSG_INTERNAL_ERROR; - break; - case SPV_ERROR_OUT_OF_MEMORY: - level = SPV_MSG_FATAL; - break; - default: - break; - } - consumer_(level, "input", position_, stream_.str().c_str()); - } -} - -void UseDiagnosticAsMessageConsumer(spv_context context, - spv_diagnostic* diagnostic) { - assert(diagnostic && *diagnostic == nullptr); - - auto create_diagnostic = [diagnostic](spv_message_level_t, const char*, - const spv_position_t& position, - const char* message) { - auto p = position; - spvDiagnosticDestroy(*diagnostic); // Avoid memory leak. - *diagnostic = spvDiagnosticCreate(&p, message); - }; - SetContextMessageConsumer(context, std::move(create_diagnostic)); -} - -std::string spvResultToString(spv_result_t res) { - std::string out; - switch (res) { - case SPV_SUCCESS: - out = "SPV_SUCCESS"; - break; - case SPV_UNSUPPORTED: - out = "SPV_UNSUPPORTED"; - break; - case SPV_END_OF_STREAM: - out = "SPV_END_OF_STREAM"; - break; - case SPV_WARNING: - out = "SPV_WARNING"; - break; - case SPV_FAILED_MATCH: - out = "SPV_FAILED_MATCH"; - break; - case SPV_REQUESTED_TERMINATION: - out = "SPV_REQUESTED_TERMINATION"; - break; - case SPV_ERROR_INTERNAL: - out = "SPV_ERROR_INTERNAL"; - break; - case SPV_ERROR_OUT_OF_MEMORY: - out = "SPV_ERROR_OUT_OF_MEMORY"; - break; - case SPV_ERROR_INVALID_POINTER: - out = "SPV_ERROR_INVALID_POINTER"; - break; - case SPV_ERROR_INVALID_BINARY: - out = "SPV_ERROR_INVALID_BINARY"; - break; - case SPV_ERROR_INVALID_TEXT: - out = "SPV_ERROR_INVALID_TEXT"; - break; - case SPV_ERROR_INVALID_TABLE: - out = "SPV_ERROR_INVALID_TABLE"; - break; - case SPV_ERROR_INVALID_VALUE: - out = "SPV_ERROR_INVALID_VALUE"; - break; - case SPV_ERROR_INVALID_DIAGNOSTIC: - out = "SPV_ERROR_INVALID_DIAGNOSTIC"; - break; - case SPV_ERROR_INVALID_LOOKUP: - out = "SPV_ERROR_INVALID_LOOKUP"; - break; - case SPV_ERROR_INVALID_ID: - out = "SPV_ERROR_INVALID_ID"; - break; - case SPV_ERROR_INVALID_CFG: - out = "SPV_ERROR_INVALID_CFG"; - break; - case SPV_ERROR_INVALID_LAYOUT: - out = "SPV_ERROR_INVALID_LAYOUT"; - break; - default: - out = "Unknown Error"; - } - return out; -} - -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/diagnostic.h vulkan-1.1.73+dfsg/external/spirv-tools/source/diagnostic.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/diagnostic.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/diagnostic.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_DIAGNOSTIC_H_ -#define LIBSPIRV_DIAGNOSTIC_H_ - -#include -#include - -#include "spirv-tools/libspirv.hpp" - -namespace libspirv { - -// A DiagnosticStream remembers the current position of the input and an error -// code, and captures diagnostic messages via the left-shift operator. -// If the error code is not SPV_FAILED_MATCH, then captured messages are -// emitted during the destructor. -class DiagnosticStream { - public: - DiagnosticStream(spv_position_t position, - const spvtools::MessageConsumer& consumer, - spv_result_t error) - : position_(position), consumer_(consumer), error_(error) {} - - // Creates a DiagnosticStream from an expiring DiagnosticStream. - // The new object takes the contents of the other, and prevents the - // other from emitting anything during destruction. - DiagnosticStream(DiagnosticStream&& other); - - // Destroys a DiagnosticStream. - // If its status code is something other than SPV_FAILED_MATCH - // then emit the accumulated message to the consumer. - ~DiagnosticStream(); - - // Adds the given value to the diagnostic message to be written. - template - DiagnosticStream& operator<<(const T& val) { - stream_ << val; - return *this; - } - - // Conversion operator to spv_result, returning the error code. - operator spv_result_t() { return error_; } - - private: - std::ostringstream stream_; - spv_position_t position_; - spvtools::MessageConsumer consumer_; // Message consumer callback. - spv_result_t error_; -}; - -// Changes the MessageConsumer in |context| to one that updates |diagnostic| -// with the last message received. -// -// This function expects that |diagnostic| is not nullptr and its content is a -// nullptr. -void UseDiagnosticAsMessageConsumer(spv_context context, - spv_diagnostic* diagnostic); - -std::string spvResultToString(spv_result_t res); - -} // namespace libspirv - -#endif // LIBSPIRV_DIAGNOSTIC_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/disassemble.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/disassemble.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/disassemble.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/disassemble.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,384 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file contains a disassembler: It converts a SPIR-V binary -// to text. - -#include -#include -#include -#include -#include -#include - -#include "assembly_grammar.h" -#include "binary.h" -#include "diagnostic.h" -#include "ext_inst.h" -#include "name_mapper.h" -#include "opcode.h" -#include "parsed_operand.h" -#include "print.h" -#include "spirv-tools/libspirv.h" -#include "spirv_constant.h" -#include "spirv_endian.h" -#include "util/hex_float.h" - -namespace { - -// A Disassembler instance converts a SPIR-V binary to its assembly -// representation. -class Disassembler { - public: - Disassembler(const libspirv::AssemblyGrammar& grammar, uint32_t options, - libspirv::NameMapper name_mapper) - : grammar_(grammar), - print_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_PRINT, options)), - color_(print_ && - spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_COLOR, options)), - indent_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_INDENT, options) - ? kStandardIndent - : 0), - text_(), - out_(print_ ? out_stream() : out_stream(text_)), - stream_(out_.get()), - header_(!spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER, options)), - show_byte_offset_(spvIsInBitfield( - SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET, options)), - byte_offset_(0), - name_mapper_(std::move(name_mapper)) {} - - // Emits the assembly header for the module, and sets up internal state - // so subsequent callbacks can handle the cases where the entire module - // is either big-endian or little-endian. - spv_result_t HandleHeader(spv_endianness_t endian, uint32_t version, - uint32_t generator, uint32_t id_bound, - uint32_t schema); - // Emits the assembly text for the given instruction. - spv_result_t HandleInstruction(const spv_parsed_instruction_t& inst); - - // If not printing, populates text_result with the accumulated text. - // Returns SPV_SUCCESS on success. - spv_result_t SaveTextResult(spv_text* text_result) const; - - private: - enum { kStandardIndent = 15 }; - - using out_stream = libspirv::out_stream; - - // Emits an operand for the given instruction, where the instruction - // is at offset words from the start of the binary. - void EmitOperand(const spv_parsed_instruction_t& inst, - const uint16_t operand_index); - - // Emits a mask expression for the given mask word of the specified type. - void EmitMaskOperand(const spv_operand_type_t type, const uint32_t word); - - // Resets the output color, if color is turned on. - void ResetColor() { - if (color_) out_.get() << libspirv::clr::reset(); - } - // Sets the output to grey, if color is turned on. - void SetGrey() { - if (color_) out_.get() << libspirv::clr::grey(); - } - // Sets the output to blue, if color is turned on. - void SetBlue() { - if (color_) out_.get() << libspirv::clr::blue(); - } - // Sets the output to yellow, if color is turned on. - void SetYellow() { - if (color_) out_.get() << libspirv::clr::yellow(); - } - // Sets the output to red, if color is turned on. - void SetRed() { - if (color_) out_.get() << libspirv::clr::red(); - } - // Sets the output to green, if color is turned on. - void SetGreen() { - if (color_) out_.get() << libspirv::clr::green(); - } - - const libspirv::AssemblyGrammar& grammar_; - const bool print_; // Should we also print to the standard output stream? - const bool color_; // Should we print in colour? - const int indent_; // How much to indent. 0 means don't indent - spv_endianness_t endian_; // The detected endianness of the binary. - std::stringstream text_; // Captures the text, if not printing. - out_stream out_; // The Output stream. Either to text_ or standard output. - std::ostream& stream_; // The output std::stream. - const bool header_; // Should we output header as the leading comment? - const bool show_byte_offset_; // Should we print byte offset, in hex? - size_t byte_offset_; // The number of bytes processed so far. - libspirv::NameMapper name_mapper_; -}; - -spv_result_t Disassembler::HandleHeader(spv_endianness_t endian, - uint32_t version, uint32_t generator, - uint32_t id_bound, uint32_t schema) { - endian_ = endian; - - if (header_) { - SetGrey(); - const char* generator_tool = - spvGeneratorStr(SPV_GENERATOR_TOOL_PART(generator)); - stream_ << "; SPIR-V\n" - << "; Version: " << SPV_SPIRV_VERSION_MAJOR_PART(version) << "." - << SPV_SPIRV_VERSION_MINOR_PART(version) << "\n" - << "; Generator: " << generator_tool; - // For unknown tools, print the numeric tool value. - if (0 == strcmp("Unknown", generator_tool)) { - stream_ << "(" << SPV_GENERATOR_TOOL_PART(generator) << ")"; - } - // Print the miscellaneous part of the generator word on the same - // line as the tool name. - stream_ << "; " << SPV_GENERATOR_MISC_PART(generator) << "\n" - << "; Bound: " << id_bound << "\n" - << "; Schema: " << schema << "\n"; - ResetColor(); - } - - byte_offset_ = SPV_INDEX_INSTRUCTION * sizeof(uint32_t); - - return SPV_SUCCESS; -} - -spv_result_t Disassembler::HandleInstruction( - const spv_parsed_instruction_t& inst) { - if (inst.result_id) { - SetBlue(); - const std::string id_name = name_mapper_(inst.result_id); - if (indent_) - stream_ << std::setw(std::max(0, indent_ - 3 - int(id_name.size()))); - stream_ << "%" << id_name; - ResetColor(); - stream_ << " = "; - } else { - stream_ << std::string(indent_, ' '); - } - - stream_ << "Op" << spvOpcodeString(static_cast(inst.opcode)); - - for (uint16_t i = 0; i < inst.num_operands; i++) { - const spv_operand_type_t type = inst.operands[i].type; - assert(type != SPV_OPERAND_TYPE_NONE); - if (type == SPV_OPERAND_TYPE_RESULT_ID) continue; - stream_ << " "; - EmitOperand(inst, i); - } - - if (show_byte_offset_) { - SetGrey(); - auto saved_flags = stream_.flags(); - auto saved_fill = stream_.fill(); - stream_ << " ; 0x" << std::setw(8) << std::hex << std::setfill('0') - << byte_offset_; - stream_.flags(saved_flags); - stream_.fill(saved_fill); - ResetColor(); - } - - byte_offset_ += inst.num_words * sizeof(uint32_t); - - stream_ << "\n"; - return SPV_SUCCESS; -} - -void Disassembler::EmitOperand(const spv_parsed_instruction_t& inst, - const uint16_t operand_index) { - assert(operand_index < inst.num_operands); - const spv_parsed_operand_t& operand = inst.operands[operand_index]; - const uint32_t word = inst.words[operand.offset]; - switch (operand.type) { - case SPV_OPERAND_TYPE_RESULT_ID: - assert(false && " is not supposed to be handled here"); - SetBlue(); - stream_ << "%" << name_mapper_(word); - break; - case SPV_OPERAND_TYPE_ID: - case SPV_OPERAND_TYPE_TYPE_ID: - case SPV_OPERAND_TYPE_SCOPE_ID: - case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: - SetYellow(); - stream_ << "%" << name_mapper_(word); - break; - case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: { - spv_ext_inst_desc ext_inst; - if (grammar_.lookupExtInst(inst.ext_inst_type, word, &ext_inst)) - assert(false && "should have caught this earlier"); - SetRed(); - stream_ << ext_inst->name; - } break; - case SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER: { - spv_opcode_desc opcode_desc; - if (grammar_.lookupOpcode(SpvOp(word), &opcode_desc)) - assert(false && "should have caught this earlier"); - SetRed(); - stream_ << opcode_desc->name; - } break; - case SPV_OPERAND_TYPE_LITERAL_INTEGER: - case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: { - SetRed(); - libspirv::EmitNumericLiteral(&stream_, inst, operand); - ResetColor(); - } break; - case SPV_OPERAND_TYPE_LITERAL_STRING: { - stream_ << "\""; - SetGreen(); - // Strings are always little-endian, and null-terminated. - // Write out the characters, escaping as needed, and without copying - // the entire string. - auto c_str = reinterpret_cast(inst.words + operand.offset); - for (auto p = c_str; *p; ++p) { - if (*p == '"' || *p == '\\') stream_ << '\\'; - stream_ << *p; - } - ResetColor(); - stream_ << '"'; - } break; - case SPV_OPERAND_TYPE_CAPABILITY: - case SPV_OPERAND_TYPE_SOURCE_LANGUAGE: - case SPV_OPERAND_TYPE_EXECUTION_MODEL: - case SPV_OPERAND_TYPE_ADDRESSING_MODEL: - case SPV_OPERAND_TYPE_MEMORY_MODEL: - case SPV_OPERAND_TYPE_EXECUTION_MODE: - case SPV_OPERAND_TYPE_STORAGE_CLASS: - case SPV_OPERAND_TYPE_DIMENSIONALITY: - case SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE: - case SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE: - case SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT: - case SPV_OPERAND_TYPE_FP_ROUNDING_MODE: - case SPV_OPERAND_TYPE_LINKAGE_TYPE: - case SPV_OPERAND_TYPE_ACCESS_QUALIFIER: - case SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE: - case SPV_OPERAND_TYPE_DECORATION: - case SPV_OPERAND_TYPE_BUILT_IN: - case SPV_OPERAND_TYPE_GROUP_OPERATION: - case SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS: - case SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO: { - spv_operand_desc entry; - if (grammar_.lookupOperand(operand.type, word, &entry)) - assert(false && "should have caught this earlier"); - stream_ << entry->name; - } break; - case SPV_OPERAND_TYPE_FP_FAST_MATH_MODE: - case SPV_OPERAND_TYPE_FUNCTION_CONTROL: - case SPV_OPERAND_TYPE_LOOP_CONTROL: - case SPV_OPERAND_TYPE_IMAGE: - case SPV_OPERAND_TYPE_MEMORY_ACCESS: - case SPV_OPERAND_TYPE_SELECTION_CONTROL: - EmitMaskOperand(operand.type, word); - break; - default: - assert(false && "unhandled or invalid case"); - } - ResetColor(); -} - -void Disassembler::EmitMaskOperand(const spv_operand_type_t type, - const uint32_t word) { - // Scan the mask from least significant bit to most significant bit. For each - // set bit, emit the name of that bit. Separate multiple names with '|'. - uint32_t remaining_word = word; - uint32_t mask; - int num_emitted = 0; - for (mask = 1; remaining_word; mask <<= 1) { - if (remaining_word & mask) { - remaining_word ^= mask; - spv_operand_desc entry; - if (grammar_.lookupOperand(type, mask, &entry)) - assert(false && "should have caught this earlier"); - if (num_emitted) stream_ << "|"; - stream_ << entry->name; - num_emitted++; - } - } - if (!num_emitted) { - // An operand value of 0 was provided, so represent it by the name - // of the 0 value. In many cases, that's "None". - spv_operand_desc entry; - if (SPV_SUCCESS == grammar_.lookupOperand(type, 0, &entry)) - stream_ << entry->name; - } -} - -spv_result_t Disassembler::SaveTextResult(spv_text* text_result) const { - if (!print_) { - size_t length = text_.str().size(); - char* str = new char[length + 1]; - if (!str) return SPV_ERROR_OUT_OF_MEMORY; - strncpy(str, text_.str().c_str(), length + 1); - spv_text text = new spv_text_t(); - if (!text) { - delete[] str; - return SPV_ERROR_OUT_OF_MEMORY; - } - text->str = str; - text->length = length; - *text_result = text; - } - return SPV_SUCCESS; -} - -spv_result_t DisassembleHeader(void* user_data, spv_endianness_t endian, - uint32_t /* magic */, uint32_t version, - uint32_t generator, uint32_t id_bound, - uint32_t schema) { - assert(user_data); - auto disassembler = static_cast(user_data); - return disassembler->HandleHeader(endian, version, generator, id_bound, - schema); -} - -spv_result_t DisassembleInstruction( - void* user_data, const spv_parsed_instruction_t* parsed_instruction) { - assert(user_data); - auto disassembler = static_cast(user_data); - return disassembler->HandleInstruction(*parsed_instruction); -} - -} // anonymous namespace - -spv_result_t spvBinaryToText(const spv_const_context context, - const uint32_t* code, const size_t wordCount, - const uint32_t options, spv_text* pText, - spv_diagnostic* pDiagnostic) { - spv_context_t hijack_context = *context; - if (pDiagnostic) { - *pDiagnostic = nullptr; - libspirv::UseDiagnosticAsMessageConsumer(&hijack_context, pDiagnostic); - } - - const libspirv::AssemblyGrammar grammar(&hijack_context); - if (!grammar.isValid()) return SPV_ERROR_INVALID_TABLE; - - // Generate friendly names for Ids if requested. - std::unique_ptr friendly_mapper; - libspirv::NameMapper name_mapper = libspirv::GetTrivialNameMapper(); - if (options & SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES) { - friendly_mapper.reset( - new libspirv::FriendlyNameMapper(&hijack_context, code, wordCount)); - name_mapper = friendly_mapper->GetNameMapper(); - } - - // Now disassemble! - Disassembler disassembler(grammar, options, name_mapper); - if (auto error = spvBinaryParse(&hijack_context, &disassembler, code, - wordCount, DisassembleHeader, - DisassembleInstruction, pDiagnostic)) { - return error; - } - - return disassembler.SaveTextResult(pText); -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/enum_set.h vulkan-1.1.73+dfsg/external/spirv-tools/source/enum_set.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/enum_set.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/enum_set.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,172 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_ENUM_SET_H -#define LIBSPIRV_ENUM_SET_H - -#include -#include -#include -#include -#include - -#include "spirv/1.2/spirv.h" - -namespace libspirv { - -// A set of values of a 32-bit enum type. -// It is fast and compact for the common case, where enum values -// are at most 63. But it can represent enums with larger values, -// as may appear in extensions. -template -class EnumSet { - private: - // The ForEach method will call the functor on enum values in - // enum value order (lowest to highest). To make that easier, use - // an ordered set for the overflow values. - using OverflowSetType = std::set; - - public: - // Construct an empty set. - EnumSet() {} - // Construct an set with just the given enum value. - explicit EnumSet(EnumType c) { Add(c); } - // Construct an set from an initializer list of enum values. - EnumSet(std::initializer_list cs) { - for (auto c : cs) Add(c); - } - // Copy constructor. - EnumSet(const EnumSet& other) { *this = other; } - // Move constructor. The moved-from set is emptied. - EnumSet(EnumSet&& other) { - mask_ = other.mask_; - overflow_ = std::move(other.overflow_); - other.mask_ = 0; - other.overflow_.reset(nullptr); - } - // Assignment operator. - EnumSet& operator=(const EnumSet& other) { - if (&other != this) { - mask_ = other.mask_; - overflow_.reset(other.overflow_ ? new OverflowSetType(*other.overflow_) - : nullptr); - } - return *this; - } - - // Adds the given enum value to the set. This has no effect if the - // enum value is already in the set. - void Add(EnumType c) { AddWord(ToWord(c)); } - - // Returns true if this enum value is in the set. - bool Contains(EnumType c) const { return ContainsWord(ToWord(c)); } - - // Applies f to each enum in the set, in order from smallest enum - // value to largest. - void ForEach(std::function f) const { - for (uint32_t i = 0; i < 64; ++i) { - if (mask_ & AsMask(i)) f(static_cast(i)); - } - if (overflow_) { - for (uint32_t c : *overflow_) f(static_cast(c)); - } - } - - // Returns true if the set is empty. - bool IsEmpty() const { - if (mask_) return false; - if (overflow_ && !overflow_->empty()) return false; - return true; - } - - // Returns true if the set contains ANY of the elements of |in_set|, - // or if |in_set| is empty. - bool HasAnyOf(const EnumSet& in_set) const { - if (in_set.IsEmpty()) return true; - - if (mask_ & in_set.mask_) - return true; - - if (!overflow_ || !in_set.overflow_) - return false; - - for (uint32_t item : *in_set.overflow_) { - if (overflow_->find(item) != overflow_->end()) - return true; - } - - return false; - } - - private: - // Adds the given enum value (as a 32-bit word) to the set. This has no - // effect if the enum value is already in the set. - void AddWord(uint32_t word) { - if (auto new_bits = AsMask(word)) { - mask_ |= new_bits; - } else { - Overflow().insert(word); - } - } - - // Returns true if the enum represented as a 32-bit word is in the set. - bool ContainsWord(uint32_t word) const { - // We shouldn't call Overflow() since this is a const method. - if (auto bits = AsMask(word)) { - return (mask_ & bits) != 0; - } else if (auto overflow = overflow_.get()) { - return overflow->find(word) != overflow->end(); - } - // The word is large, but the set doesn't have large members, so - // it doesn't have an overflow set. - return false; - } - - // Returns the enum value as a uint32_t. - uint32_t ToWord(EnumType value) const { - static_assert(sizeof(EnumType) <= sizeof(uint32_t), - "EnumType must statically castable to uint32_t"); - return static_cast(value); - } - - // Determines whether the given enum value can be represented - // as a bit in a uint64_t mask. If so, then returns that mask bit. - // Otherwise, returns 0. - uint64_t AsMask(uint32_t word) const { - if (word > 63) return 0; - return uint64_t(1) << word; - } - - // Ensures that overflow_set_ references a set. A new empty set is - // allocated if one doesn't exist yet. Returns overflow_set_. - OverflowSetType& Overflow() { - if (overflow_.get() == nullptr) { - overflow_.reset(new OverflowSetType); - } - return *overflow_; - } - - // Enums with values up to 63 are stored as bits in this mask. - uint64_t mask_ = 0; - // Enums with values larger than 63 are stored in this set. - // This set should normally be empty or very small. - std::unique_ptr overflow_ = {}; -}; - -// A set of SpvCapability, optimized for small capability values. -using CapabilitySet = EnumSet; - -} // namespace libspirv - -#endif // LIBSPIRV_ENUM_SET_H diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/enum_string_mapping.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/enum_string_mapping.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/enum_string_mapping.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/enum_string_mapping.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include "enum_string_mapping.h" - -#include -#include -#include - -#include "extensions.h" - -namespace libspirv { - -#include "enum_string_mapping.inc" - -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/enum_string_mapping.h vulkan-1.1.73+dfsg/external/spirv-tools/source/enum_string_mapping.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/enum_string_mapping.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/enum_string_mapping.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_ENUM_STRING_MAPPING_H_ -#define LIBSPIRV_ENUM_STRING_MAPPING_H_ - -#include - -#include "spirv/1.1/spirv.h" - -namespace libspirv { - -enum class Extension; - -// Finds Extension enum corresponding to |str|. Returns false if not found. -bool GetExtensionFromString(const std::string& str, Extension* extension); - -// Returns text string corresponding to |extension|. -std::string ExtensionToString(Extension extension); - -// Returns text string corresponding to |capability|. -std::string CapabilityToString(SpvCapability capability); - -} // namespace libspirv - -#endif // LIBSPIRV_ENUM_STRING_MAPPING_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/extensions.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/extensions.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/extensions.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/extensions.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include "extensions.h" - -#include -#include -#include - -#include "enum_string_mapping.h" - -namespace libspirv { - -std::string GetExtensionString(const spv_parsed_instruction_t* inst) { - if (inst->opcode != SpvOpExtension) - return "ERROR_not_op_extension"; - - assert(inst->num_operands == 1); - - const auto& operand = inst->operands[0]; - assert(operand.type == SPV_OPERAND_TYPE_LITERAL_STRING); - assert(inst->num_words > operand.offset); - - return reinterpret_cast(inst->words + operand.offset); -} - -std::string ExtensionSetToString(const ExtensionSet& extensions) { - std::stringstream ss; - extensions.ForEach([&ss](Extension ext) { - ss << ExtensionToString(ext) << " "; - }); - return ss.str(); -} - -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/extensions.h vulkan-1.1.73+dfsg/external/spirv-tools/source/extensions.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/extensions.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/extensions.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_EXTENSIONS_H_ -#define LIBSPIRV_EXTENSIONS_H_ - -#include - -#include "enum_set.h" -#include "spirv-tools/libspirv.h" - -namespace libspirv { - -// The known SPIR-V extensions. -enum class Extension { -#include "extension_enum.inc" -}; - -using ExtensionSet = EnumSet; - -// Returns literal string operand of OpExtension instruction. -std::string GetExtensionString(const spv_parsed_instruction_t* inst); - -// Returns text string listing |extensions| separated by whitespace. -std::string ExtensionSetToString(const ExtensionSet& extensions); - -} // namespace libspirv - -#endif // LIBSPIRV_EXTENSIONS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/extinst.amd-gcn-shader.grammar.json vulkan-1.1.73+dfsg/external/spirv-tools/source/extinst.amd-gcn-shader.grammar.json --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/extinst.amd-gcn-shader.grammar.json 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/extinst.amd-gcn-shader.grammar.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -{ - "revision" : 2, - "instructions" : [ - { - "opname" : "CubeFaceIndexAMD", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'P'" } - ], - "extensions" : [ "SPV_KHR_gcn_shader" ] - }, - { - "opname" : "CubeFaceCoordAMD", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'P'" } - ], - "extensions" : [ "SPV_KHR_gcn_shader" ] - }, - { - "opname" : "TimeAMD", - "opcode" : 3, - "extensions" : [ "SPV_KHR_gcn_shader" ] - } - ] -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/ext_inst.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/ext_inst.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/ext_inst.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/ext_inst.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,163 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "ext_inst.h" - -#include -#include - -#include "spirv/1.0/GLSL.std.450.h" -#include "spirv/1.0/OpenCL.std.h" -#include "spirv_definition.h" - -#include "macro.h" - -spv_result_t spvExtInstTableGet(spv_ext_inst_table* pExtInstTable, - spv_target_env env) { - if (!pExtInstTable) return SPV_ERROR_INVALID_POINTER; - - static const spv_ext_inst_desc_t glslStd450Entries_1_0[] = { -#include "glsl.std.450.insts-1.0.inc" - }; - - static const spv_ext_inst_desc_t openclEntries_1_0[] = { -#include "opencl.std.insts-1.0.inc" - }; - - static const spv_ext_inst_desc_t - spv_amd_shader_explicit_vertex_parameter_entries[] = { -#include "spv-amd-shader-explicit-vertex-parameter.insts.inc" - }; - - static const spv_ext_inst_desc_t spv_amd_shader_trinary_minmax_entries[] = { -#include "spv-amd-shader-trinary-minmax.insts.inc" - }; - - static const spv_ext_inst_desc_t spv_amd_gcn_shader_entries[] = { -#include "spv-amd-gcn-shader.insts.inc" - }; - - static const spv_ext_inst_desc_t spv_amd_shader_ballot_entries[] = { -#include "spv-amd-shader-ballot.insts.inc" - }; - - static const spv_ext_inst_group_t groups_1_0[] = { - {SPV_EXT_INST_TYPE_GLSL_STD_450, ARRAY_SIZE(glslStd450Entries_1_0), - glslStd450Entries_1_0}, - {SPV_EXT_INST_TYPE_OPENCL_STD, ARRAY_SIZE(openclEntries_1_0), - openclEntries_1_0}, - {SPV_EXT_INST_TYPE_SPV_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER, - ARRAY_SIZE(spv_amd_shader_explicit_vertex_parameter_entries), - spv_amd_shader_explicit_vertex_parameter_entries}, - {SPV_EXT_INST_TYPE_SPV_AMD_SHADER_TRINARY_MINMAX, - ARRAY_SIZE(spv_amd_shader_trinary_minmax_entries), - spv_amd_shader_trinary_minmax_entries}, - {SPV_EXT_INST_TYPE_SPV_AMD_GCN_SHADER, - ARRAY_SIZE(spv_amd_gcn_shader_entries), spv_amd_gcn_shader_entries}, - {SPV_EXT_INST_TYPE_SPV_AMD_SHADER_BALLOT, - ARRAY_SIZE(spv_amd_shader_ballot_entries), - spv_amd_shader_ballot_entries}, - }; - - static const spv_ext_inst_table_t table_1_0 = {ARRAY_SIZE(groups_1_0), - groups_1_0}; - - switch (env) { - // The extended instruction sets are all version 1.0 so far. - case SPV_ENV_UNIVERSAL_1_0: - case SPV_ENV_VULKAN_1_0: - case SPV_ENV_UNIVERSAL_1_1: - case SPV_ENV_UNIVERSAL_1_2: - case SPV_ENV_OPENCL_2_1: - case SPV_ENV_OPENCL_2_2: - case SPV_ENV_OPENGL_4_0: - case SPV_ENV_OPENGL_4_1: - case SPV_ENV_OPENGL_4_2: - case SPV_ENV_OPENGL_4_3: - case SPV_ENV_OPENGL_4_5: - *pExtInstTable = &table_1_0; - return SPV_SUCCESS; - default: - assert(0 && "Unknown spv_target_env in spvExtInstTableGet()"); - return SPV_ERROR_INVALID_TABLE; - } -} - -spv_ext_inst_type_t spvExtInstImportTypeGet(const char* name) { - // The names are specified by the respective extension instruction - // specifications. - if (!strcmp("GLSL.std.450", name)) { - return SPV_EXT_INST_TYPE_GLSL_STD_450; - } - if (!strcmp("OpenCL.std", name)) { - return SPV_EXT_INST_TYPE_OPENCL_STD; - } - if (!strcmp("SPV_AMD_shader_explicit_vertex_parameter", name)) { - return SPV_EXT_INST_TYPE_SPV_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER; - } - if (!strcmp("SPV_AMD_shader_trinary_minmax", name)) { - return SPV_EXT_INST_TYPE_SPV_AMD_SHADER_TRINARY_MINMAX; - } - if (!strcmp("SPV_AMD_gcn_shader", name)) { - return SPV_EXT_INST_TYPE_SPV_AMD_GCN_SHADER; - } - if (!strcmp("SPV_AMD_shader_ballot", name)) { - return SPV_EXT_INST_TYPE_SPV_AMD_SHADER_BALLOT; - } - return SPV_EXT_INST_TYPE_NONE; -} - -spv_result_t spvExtInstTableNameLookup(const spv_ext_inst_table table, - const spv_ext_inst_type_t type, - const char* name, - spv_ext_inst_desc* pEntry) { - if (!table) return SPV_ERROR_INVALID_TABLE; - if (!pEntry) return SPV_ERROR_INVALID_POINTER; - - for (uint32_t groupIndex = 0; groupIndex < table->count; groupIndex++) { - const auto& group = table->groups[groupIndex]; - if (type != group.type) continue; - for (uint32_t index = 0; index < group.count; index++) { - const auto& entry = group.entries[index]; - if (!strcmp(name, entry.name)) { - *pEntry = &entry; - return SPV_SUCCESS; - } - } - } - - return SPV_ERROR_INVALID_LOOKUP; -} - -spv_result_t spvExtInstTableValueLookup(const spv_ext_inst_table table, - const spv_ext_inst_type_t type, - const uint32_t value, - spv_ext_inst_desc* pEntry) { - if (!table) return SPV_ERROR_INVALID_TABLE; - if (!pEntry) return SPV_ERROR_INVALID_POINTER; - - for (uint32_t groupIndex = 0; groupIndex < table->count; groupIndex++) { - const auto& group = table->groups[groupIndex]; - if (type != group.type) continue; - for (uint32_t index = 0; index < group.count; index++) { - const auto& entry = group.entries[index]; - if (value == entry.ext_inst) { - *pEntry = &entry; - return SPV_SUCCESS; - } - } - } - - return SPV_ERROR_INVALID_LOOKUP; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/ext_inst.h vulkan-1.1.73+dfsg/external/spirv-tools/source/ext_inst.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/ext_inst.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/ext_inst.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_EXT_INST_H_ -#define LIBSPIRV_EXT_INST_H_ - -#include "spirv-tools/libspirv.h" -#include "table.h" - -// Gets the type of the extended instruction set with the specified name. -spv_ext_inst_type_t spvExtInstImportTypeGet(const char* name); - -// Finds the named extented instruction of the given type in the given extended -// instruction table. On success, returns SPV_SUCCESS and writes a handle of -// the instruction entry into *entry. -spv_result_t spvExtInstTableNameLookup(const spv_ext_inst_table table, - const spv_ext_inst_type_t type, - const char* name, - spv_ext_inst_desc* entry); - -// Finds the extented instruction of the given type in the given extended -// instruction table by value. On success, returns SPV_SUCCESS and writes a -// handle of the instruction entry into *entry. -spv_result_t spvExtInstTableValueLookup(const spv_ext_inst_table table, - const spv_ext_inst_type_t type, - const uint32_t value, - spv_ext_inst_desc* pEntry); - -#endif // LIBSPIRV_EXT_INST_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/extinst.spv-amd-gcn-shader.grammar.json vulkan-1.1.73+dfsg/external/spirv-tools/source/extinst.spv-amd-gcn-shader.grammar.json --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/extinst.spv-amd-gcn-shader.grammar.json 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/extinst.spv-amd-gcn-shader.grammar.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -{ - "revision" : 2, - "instructions" : [ - { - "opname" : "CubeFaceIndexAMD", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'P'" } - ], - "extensions" : [ "SPV_AMD_gcn_shader" ] - }, - { - "opname" : "CubeFaceCoordAMD", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'P'" } - ], - "extensions" : [ "SPV_AMD_gcn_shader" ] - }, - { - "opname" : "TimeAMD", - "opcode" : 3, - "extensions" : [ "SPV_AMD_gcn_shader" ] - } - ] -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/extinst.spv-amd-shader-ballot.grammar.json vulkan-1.1.73+dfsg/external/spirv-tools/source/extinst.spv-amd-shader-ballot.grammar.json --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/extinst.spv-amd-shader-ballot.grammar.json 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/extinst.spv-amd-shader-ballot.grammar.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -{ - "revision" : 5, - "instructions" : [ - { - "opname" : "SwizzleInvocationsAMD", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'offset'" } - ], - "extensions" : [ "SPV_AMD_shader_ballot" ] - }, - { - "opname" : "SwizzleInvocationsMaskedAMD", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'data'" }, - { "kind" : "IdRef", "name" : "'mask'" } - ], - "extensions" : [ "SPV_AMD_shader_ballot" ] - }, - { - "opname" : "WriteInvocationAMD", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'inputValue'" }, - { "kind" : "IdRef", "name" : "'writeValue'" }, - { "kind" : "IdRef", "name" : "'invocationIndex'" } - ], - "extensions" : [ "SPV_AMD_shader_ballot" ] - }, - { - "opname" : "MbcntAMD", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'mask'" } - ], - "extensions" : [ "SPV_AMD_shader_ballot" ] - } - ] -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json vulkan-1.1.73+dfsg/external/spirv-tools/source/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -{ - "revision" : 4, - "instructions" : [ - { - "opname" : "InterpolateAtVertexAMD", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'interpolant'" }, - { "kind" : "IdRef", "name" : "'vertexIdx'" } - ], - "extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ] - } - ] -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/extinst.spv-amd-shader-trinary-minmax.grammar.json vulkan-1.1.73+dfsg/external/spirv-tools/source/extinst.spv-amd-shader-trinary-minmax.grammar.json --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/extinst.spv-amd-shader-trinary-minmax.grammar.json 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/extinst.spv-amd-shader-trinary-minmax.grammar.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,95 +0,0 @@ -{ - "revision" : 4, - "instructions" : [ - { - "opname" : "FMin3AMD", - "opcode" : 1, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ], - "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] - }, - { - "opname" : "UMin3AMD", - "opcode" : 2, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ], - "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] - }, - { - "opname" : "SMin3AMD", - "opcode" : 3, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ], - "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] - }, - { - "opname" : "FMax3AMD", - "opcode" : 4, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ], - "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] - }, - { - "opname" : "UMax3AMD", - "opcode" : 5, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ], - "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] - }, - { - "opname" : "SMax3AMD", - "opcode" : 6, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ], - "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] - }, - { - "opname" : "FMid3AMD", - "opcode" : 7, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ], - "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] - }, - { - "opname" : "UMid3AMD", - "opcode" : 8, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ], - "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] - }, - { - "opname" : "SMid3AMD", - "opcode" : 9, - "operands" : [ - { "kind" : "IdRef", "name" : "'x'" }, - { "kind" : "IdRef", "name" : "'y'" }, - { "kind" : "IdRef", "name" : "'z'" } - ], - "extensions" : [ "SPV_AMD_shader_trinary_minmax" ] - } - ] -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/id_descriptor.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/id_descriptor.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/id_descriptor.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/id_descriptor.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include "id_descriptor.h" - -#include -#include - -#include "opcode.h" -#include "operand.h" - -namespace libspirv { - -namespace { - -// Hashes an array of words. Order of words is important. -uint32_t HashU32Array(const std::vector& words) { - // The hash function is a sum of hashes of each word seeded by word index. - // Knuth's multiplicative hash is used to hash the words. - const uint32_t kKnuthMulHash = 2654435761; - uint32_t val = 0; - for (uint32_t i = 0; i < words.size(); ++i) { - val += (words[i] + i + 123) * kKnuthMulHash; - } - return val; -} - -} // namespace - -uint32_t IdDescriptorCollection::ProcessInstruction( - const spv_parsed_instruction_t& inst) { - if (!inst.result_id) - return 0; - - assert(words_.empty()); - words_.push_back(inst.words[0]); - - for (size_t operand_index = 0; operand_index < inst.num_operands; - ++operand_index) { - const auto &operand = inst.operands[operand_index]; - if (spvIsIdType(operand.type)) { - const uint32_t id = inst.words[operand.offset]; - const auto it = id_to_descriptor_.find(id); - // Forward declared ids are not hashed. - if (it != id_to_descriptor_.end()) { - words_.push_back(it->second); - } - } else { - for (size_t operand_word_index = 0; - operand_word_index < operand.num_words; ++operand_word_index) { - words_.push_back(inst.words[operand.offset + operand_word_index]); - } - } - } - - const uint32_t descriptor = HashU32Array(words_); - assert(descriptor); - - words_.clear(); - - const auto result = id_to_descriptor_.emplace(inst.result_id, descriptor); - assert(result.second); - (void)result; - return descriptor; -} - -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/id_descriptor.h vulkan-1.1.73+dfsg/external/spirv-tools/source/id_descriptor.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/id_descriptor.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/id_descriptor.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_ID_DESCRIPTOR_H_ -#define LIBSPIRV_ID_DESCRIPTOR_H_ - -#include -#include - -#include "spirv-tools/libspirv.hpp" - -namespace libspirv { - -// Computes and stores id descriptors. -// -// Descriptors are computed as hash of all words in the instruction where ids -// were substituted with previously computed descriptors. -class IdDescriptorCollection { - public: - IdDescriptorCollection() { - words_.reserve(16); - } - - // Computes descriptor for the result id of the given instruction and - // registers it in id_to_descriptor_. Returns the computed descriptor. - // This function needs to be sequentially called for every instruction in the - // module. - uint32_t ProcessInstruction(const spv_parsed_instruction_t& inst); - - // Returns a previously computed descriptor id. - uint32_t GetDescriptor(uint32_t id) const { - const auto it = id_to_descriptor_.find(id); - if (it == id_to_descriptor_.end()) - return 0; - return it->second; - } - - private: - std::unordered_map id_to_descriptor_; - - // Scratch buffer used for hashing. Class member to optimize on allocation. - std::vector words_; -}; - -} // namespace libspirv - -#endif // LIBSPIRV_ID_DESCRIPTOR_H_ - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/instruction.h vulkan-1.1.73+dfsg/external/spirv-tools/source/instruction.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/instruction.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/instruction.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_INSTRUCTION_H_ -#define LIBSPIRV_INSTRUCTION_H_ - -#include -#include - -#include "spirv-tools/libspirv.h" -#include "spirv/1.2/spirv.h" - -// Describes an instruction. -struct spv_instruction_t { - // Normally, both opcode and extInstType contain valid data. - // However, when the assembler parses ! as the first word in - // an instruction and opcode and extInstType are invalid. - SpvOp opcode; - spv_ext_inst_type_t extInstType; - - // The Id of the result type, if this instruction has one. Zero otherwise. - uint32_t resultTypeId; - - // The instruction, as a sequence of 32-bit words. - // For a regular instruction the opcode and word count are combined - // in words[0], as described in the SPIR-V spec. - // Otherwise, the first token was !, and that number appears - // in words[0]. Subsequent elements are the result of parsing - // tokens in the alternate parsing mode as described in syntax.md. - std::vector words; -}; - -// Appends a word to an instruction, without checking for overflow. -inline void spvInstructionAddWord(spv_instruction_t* inst, uint32_t value) { - inst->words.push_back(value); -} - -#endif // LIBSPIRV_INSTRUCTION_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/libspirv.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/libspirv.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/libspirv.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/libspirv.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,94 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "spirv-tools/libspirv.hpp" - -#include "table.h" - -namespace spvtools { - -// Structs for holding the data members for SpvTools. -struct SpirvTools::Impl { - explicit Impl(spv_target_env env) : context(spvContextCreate(env)) { - // The default consumer in spv_context_t is a null consumer, which provides - // equivalent functionality (from the user's perspective) as a real consumer - // does nothing. - } - ~Impl() { spvContextDestroy(context); } - - spv_context context; // C interface context object. -}; - -SpirvTools::SpirvTools(spv_target_env env) : impl_(new Impl(env)) {} - -SpirvTools::~SpirvTools() {} - -void SpirvTools::SetMessageConsumer(MessageConsumer consumer) { - SetContextMessageConsumer(impl_->context, std::move(consumer)); -} - -bool SpirvTools::Assemble(const std::string& text, - std::vector* binary, - uint32_t options) const { - return Assemble(text.data(), text.size(), binary, options); -} - -bool SpirvTools::Assemble(const char* text, const size_t text_size, - std::vector* binary, - uint32_t options) const { - spv_binary spvbinary = nullptr; - spv_result_t status = spvTextToBinaryWithOptions( - impl_->context, text, text_size, options, &spvbinary, nullptr); - if (status == SPV_SUCCESS) { - binary->assign(spvbinary->code, spvbinary->code + spvbinary->wordCount); - } - spvBinaryDestroy(spvbinary); - return status == SPV_SUCCESS; -} - -bool SpirvTools::Disassemble(const std::vector& binary, - std::string* text, uint32_t options) const { - return Disassemble(binary.data(), binary.size(), text, options); -} - -bool SpirvTools::Disassemble(const uint32_t* binary, const size_t binary_size, - std::string* text, uint32_t options) const { - spv_text spvtext = nullptr; - spv_result_t status = spvBinaryToText(impl_->context, binary, binary_size, - options, &spvtext, nullptr); - if (status == SPV_SUCCESS) { - text->assign(spvtext->str, spvtext->str + spvtext->length); - } - spvTextDestroy(spvtext); - return status == SPV_SUCCESS; -} - -bool SpirvTools::Validate(const std::vector& binary) const { - return Validate(binary.data(), binary.size()); -} - -bool SpirvTools::Validate(const uint32_t* binary, - const size_t binary_size) const { - return spvValidateBinary(impl_->context, binary, binary_size, nullptr) == - SPV_SUCCESS; -} - -bool SpirvTools::Validate(const uint32_t* binary, const size_t binary_size, - const spvtools::ValidatorOptions& options) const { - spv_const_binary_t the_binary{binary, binary_size}; - return spvValidateWithOptions(impl_->context, options, &the_binary, - nullptr) == SPV_SUCCESS; -} - -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/link/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/source/link/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/link/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/link/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -# Copyright (c) 2017 Pierre Moreau - -# 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. -add_library(SPIRV-Tools-link - linker.cpp -) - -spvtools_default_compile_options(SPIRV-Tools-link) -target_include_directories(SPIRV-Tools-link - PUBLIC ${spirv-tools_SOURCE_DIR}/include - PUBLIC ${SPIRV_HEADER_INCLUDE_DIR} - PRIVATE ${spirv-tools_BINARY_DIR} -) -# We need the IR functionnalities from the optimizer -target_link_libraries(SPIRV-Tools-link - PUBLIC SPIRV-Tools-opt) - -set_property(TARGET SPIRV-Tools-link PROPERTY FOLDER "SPIRV-Tools libraries") - -if(ENABLE_SPIRV_TOOLS_INSTALL) - install(TARGETS SPIRV-Tools-link - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -endif(ENABLE_SPIRV_TOOLS_INSTALL) diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/link/linker.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/link/linker.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/link/linker.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/link/linker.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,716 +0,0 @@ -// Copyright (c) 2017 Pierre Moreau -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "spirv-tools/linker.hpp" - -#include -#include - -#include -#include -#include -#include -#include - -#include "assembly_grammar.h" -#include "diagnostic.h" -#include "opt/build_module.h" -#include "opt/compact_ids_pass.h" -#include "opt/decoration_manager.h" -#include "opt/ir_loader.h" -#include "opt/make_unique.h" -#include "opt/pass_manager.h" -#include "opt/remove_duplicates_pass.h" -#include "spirv-tools/libspirv.hpp" -#include "spirv_target_env.h" - -namespace spvtools { - -using ir::Instruction; -using ir::Module; -using ir::Operand; -using opt::PassManager; -using opt::RemoveDuplicatesPass; -using opt::analysis::DecorationManager; -using opt::analysis::DefUseManager; - -// Stores various information about an imported or exported symbol. -struct LinkageSymbolInfo { - SpvId id; // ID of the symbol - SpvId type_id; // ID of the type of the symbol - std::string name; // unique name defining the symbol and used for matching - // imports and exports together - std::vector parameter_ids; // ID of the parameters of the symbol, if - // it is a function -}; -struct LinkageEntry { - LinkageSymbolInfo imported_symbol; - LinkageSymbolInfo exported_symbol; - - LinkageEntry(const LinkageSymbolInfo& import_info, - const LinkageSymbolInfo& export_info) - : imported_symbol(import_info), exported_symbol(export_info) {} -}; -using LinkageTable = std::vector; - -// Shifts the IDs used in each binary of |modules| so that they occupy a -// disjoint range from the other binaries, and compute the new ID bound which -// is returned in |max_id_bound|. -// -// Both |modules| and |max_id_bound| should not be null, and |modules| should -// not be empty either. -static spv_result_t ShiftIdsInModules( - const MessageConsumer& consumer, - std::vector>* modules, uint32_t* max_id_bound); - -// Generates the header for the linked module and returns it in |header|. -// -// |header| should not be null, |modules| should not be empty and -// |max_id_bound| should be strictly greater than 0. -// -// TODO(pierremoreau): What to do when binaries use different versions of -// SPIR-V? For now, use the max of all versions found in -// the input modules. -static spv_result_t GenerateHeader( - const MessageConsumer& consumer, - const std::vector>& modules, - uint32_t max_id_bound, ir::ModuleHeader* header); - -// Merge all the modules from |inModules| into |linked_module|. -// -// |linked_module| should not be null. -static spv_result_t MergeModules( - const MessageConsumer& consumer, - const std::vector>& inModules, - const libspirv::AssemblyGrammar& grammar, Module* linked_module); - -// Compute all pairs of import and export and return it in |linkings_to_do|. -// -// |linkings_to_do should not be null. Built-in symbols will be ignored. -// -// TODO(pierremoreau): Linkage attributes applied by a group decoration are -// currently not handled. (You could have a group being -// applied to a single ID.) -// TODO(pierremoreau): What should be the proper behaviour with built-in -// symbols? -static spv_result_t GetImportExportPairs(const MessageConsumer& consumer, - const Module& linked_module, - const DefUseManager& def_use_manager, - const DecorationManager& decoration_manager, - LinkageTable* linkings_to_do); - -// Checks that for each pair of import and export, the import and export have -// the same type as well as the same decorations. -// -// TODO(pierremoreau): Decorations on functions parameters are currently not -// checked. -static spv_result_t CheckImportExportCompatibility( - const MessageConsumer& consumer, const LinkageTable& linkings_to_do, - const DefUseManager& def_use_manager, - const DecorationManager& decoration_manager); - -// Remove linkage specific instructions, such as prototypes of imported -// functions, declarations of imported variables, import (and export if -// necessary) linkage attribtes. -// -// |linked_module| and |decoration_manager| should not be null, and the -// 'RemoveDuplicatePass' should be run first. -// -// TODO(pierremoreau): Linkage attributes applied by a group decoration are -// currently not handled. (You could have a group being -// applied to a single ID.) -// TODO(pierremoreau): Run a pass for removing dead instructions, for example -// OpName for prototypes of imported funcions. -static spv_result_t RemoveLinkageSpecificInstructions( - const MessageConsumer& consumer, bool create_executable, - const LinkageTable& linkings_to_do, DecorationManager* decoration_manager, - Module* linked_module); - -// Structs for holding the data members for SpvLinker. -struct Linker::Impl { - explicit Impl(spv_target_env env) : context(spvContextCreate(env)) { - // The default consumer in spv_context_t is a null consumer, which provides - // equivalent functionality (from the user's perspective) as a real consumer - // does nothing. - } - ~Impl() { spvContextDestroy(context); } - - spv_context context; // C interface context object. -}; - -Linker::Linker(spv_target_env env) : impl_(new Impl(env)) {} - -Linker::~Linker() {} - -void Linker::SetMessageConsumer(MessageConsumer consumer) { - SetContextMessageConsumer(impl_->context, std::move(consumer)); -} - -spv_result_t Linker::Link(const std::vector>& binaries, - std::vector& linked_binary, - const LinkerOptions& options) const { - std::vector binary_ptrs; - binary_ptrs.reserve(binaries.size()); - std::vector binary_sizes; - binary_sizes.reserve(binaries.size()); - - for (const auto& binary : binaries) { - binary_ptrs.push_back(binary.data()); - binary_sizes.push_back(binary.size()); - } - - return Link(binary_ptrs.data(), binary_sizes.data(), binaries.size(), - linked_binary, options); -} - -spv_result_t Linker::Link(const uint32_t* const* binaries, - const size_t* binary_sizes, size_t num_binaries, - std::vector& linked_binary, - const LinkerOptions& options) const { - spv_position_t position = {}; - const MessageConsumer& consumer = impl_->context->consumer; - - linked_binary.clear(); - if (num_binaries == 0u) - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_BINARY) - << "No modules were given."; - - std::vector> modules; - modules.reserve(num_binaries); - for (size_t i = 0u; i < num_binaries; ++i) { - const uint32_t schema = binaries[i][4u]; - if (schema != 0u) { - position.index = 4u; - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_BINARY) - << "Schema is non-zero for module " << i << "."; - } - - std::unique_ptr module = BuildModule( - impl_->context->target_env, consumer, binaries[i], binary_sizes[i]); - if (module == nullptr) - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_BINARY) - << "Failed to build a module out of " << modules.size() << "."; - modules.push_back(std::move(module)); - } - - // Phase 1: Shift the IDs used in each binary so that they occupy a disjoint - // range from the other binaries, and compute the new ID bound. - uint32_t max_id_bound = 0u; - spv_result_t res = ShiftIdsInModules(consumer, &modules, &max_id_bound); - if (res != SPV_SUCCESS) return res; - - // Phase 2: Generate the header - ir::ModuleHeader header; - res = GenerateHeader(consumer, modules, max_id_bound, &header); - if (res != SPV_SUCCESS) return res; - auto linked_module = MakeUnique(); - linked_module->SetHeader(header); - - // Phase 3: Merge all the binaries into a single one. - libspirv::AssemblyGrammar grammar(impl_->context); - res = MergeModules(consumer, modules, grammar, linked_module.get()); - if (res != SPV_SUCCESS) return res; - - DefUseManager def_use_manager(consumer, linked_module.get()); - - // Phase 4: Find the import/export pairs - LinkageTable linkings_to_do; - DecorationManager decoration_manager(linked_module.get()); - res = GetImportExportPairs(consumer, *linked_module, def_use_manager, - decoration_manager, &linkings_to_do); - if (res != SPV_SUCCESS) return res; - - // Phase 5: Ensure the import and export have the same types and decorations. - res = CheckImportExportCompatibility(consumer, linkings_to_do, - def_use_manager, decoration_manager); - if (res != SPV_SUCCESS) return res; - - // Phase 6: Remove duplicates - PassManager manager; - manager.SetMessageConsumer(consumer); - manager.AddPass(); - opt::Pass::Status pass_res = manager.Run(linked_module.get()); - if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA; - - // Phase 7: Remove linkage specific instructions, such as import/export - // attributes, linkage capability, etc. if applicable - res = RemoveLinkageSpecificInstructions(consumer, !options.GetCreateLibrary(), - linkings_to_do, &decoration_manager, - linked_module.get()); - if (res != SPV_SUCCESS) return res; - - // Phase 8: Rematch import variables/functions to export variables/functions - // TODO(pierremoreau): Keep the previous DefUseManager up-to-date - DefUseManager def_use_manager2(consumer, linked_module.get()); - for (const auto& linking_entry : linkings_to_do) - def_use_manager2.ReplaceAllUsesWith(linking_entry.imported_symbol.id, - linking_entry.exported_symbol.id); - - // Phase 9: Compact the IDs used in the module - manager.AddPass(); - pass_res = manager.Run(linked_module.get()); - if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA; - - // Phase 10: Output the module - linked_module->ToBinary(&linked_binary, true); - - return SPV_SUCCESS; -} - -static spv_result_t ShiftIdsInModules( - const MessageConsumer& consumer, - std::vector>* modules, uint32_t* max_id_bound) { - spv_position_t position = {}; - - if (modules == nullptr) - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_DATA) - << "|modules| of ShiftIdsInModules should not be null."; - if (modules->empty()) - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_DATA) - << "|modules| of ShiftIdsInModules should not be empty."; - if (max_id_bound == nullptr) - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_DATA) - << "|max_id_bound| of ShiftIdsInModules should not be null."; - - uint32_t id_bound = modules->front()->IdBound() - 1u; - for (auto module_iter = modules->begin() + 1; module_iter != modules->end(); - ++module_iter) { - Module* module = module_iter->get(); - module->ForEachInst([&id_bound](Instruction* insn) { - insn->ForEachId([&id_bound](uint32_t* id) { *id += id_bound; }); - }); - id_bound += module->IdBound() - 1u; - if (id_bound > 0x3FFFFF) - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_ID) - << "The limit of IDs, 4194303, was exceeded:" - << " " << id_bound << " is the current ID bound."; - } - ++id_bound; - if (id_bound > 0x3FFFFF) - return libspirv::DiagnosticStream(position, consumer, SPV_ERROR_INVALID_ID) - << "The limit of IDs, 4194303, was exceeded:" - << " " << id_bound << " is the current ID bound."; - - *max_id_bound = id_bound; - - return SPV_SUCCESS; -} - -static spv_result_t GenerateHeader( - const MessageConsumer& consumer, - const std::vector>& modules, - uint32_t max_id_bound, ir::ModuleHeader* header) { - spv_position_t position = {}; - - if (modules.empty()) - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_DATA) - << "|modules| of GenerateHeader should not be empty."; - if (max_id_bound == 0u) - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_DATA) - << "|max_id_bound| of GenerateHeader should not be null."; - - uint32_t version = 0u; - for (const auto& module : modules) - version = std::max(version, module->version()); - - header->magic_number = SpvMagicNumber; - header->version = version; - header->generator = 17u; - header->bound = max_id_bound; - header->reserved = 0u; - - return SPV_SUCCESS; -} - -static spv_result_t MergeModules( - const MessageConsumer& consumer, - const std::vector>& input_modules, - const libspirv::AssemblyGrammar& grammar, Module* linked_module) { - spv_position_t position = {}; - - if (linked_module == nullptr) - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_DATA) - << "|linked_module| of MergeModules should not be null."; - - if (input_modules.empty()) return SPV_SUCCESS; - - for (const auto& module : input_modules) - for (const auto& inst : module->capabilities()) - linked_module->AddCapability(MakeUnique(inst)); - - for (const auto& module : input_modules) - for (const auto& inst : module->extensions()) - linked_module->AddExtension(MakeUnique(inst)); - - for (const auto& module : input_modules) - for (const auto& inst : module->ext_inst_imports()) - linked_module->AddExtInstImport(MakeUnique(inst)); - - do { - const Instruction* memory_model_inst = input_modules[0]->GetMemoryModel(); - if (memory_model_inst == nullptr) break; - - uint32_t addressing_model = memory_model_inst->GetSingleWordOperand(0u); - uint32_t memory_model = memory_model_inst->GetSingleWordOperand(1u); - for (const auto& module : input_modules) { - memory_model_inst = module->GetMemoryModel(); - if (memory_model_inst == nullptr) continue; - - if (addressing_model != memory_model_inst->GetSingleWordOperand(0u)) { - spv_operand_desc initial_desc = nullptr, current_desc = nullptr; - grammar.lookupOperand(SPV_OPERAND_TYPE_ADDRESSING_MODEL, - addressing_model, &initial_desc); - grammar.lookupOperand(SPV_OPERAND_TYPE_ADDRESSING_MODEL, - memory_model_inst->GetSingleWordOperand(0u), - ¤t_desc); - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INTERNAL) - << "Conflicting addressing models: " << initial_desc->name - << " vs " << current_desc->name << "."; - } - if (memory_model != memory_model_inst->GetSingleWordOperand(1u)) { - spv_operand_desc initial_desc = nullptr, current_desc = nullptr; - grammar.lookupOperand(SPV_OPERAND_TYPE_MEMORY_MODEL, memory_model, - &initial_desc); - grammar.lookupOperand(SPV_OPERAND_TYPE_MEMORY_MODEL, - memory_model_inst->GetSingleWordOperand(1u), - ¤t_desc); - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INTERNAL) - << "Conflicting memory models: " << initial_desc->name << " vs " - << current_desc->name << "."; - } - } - - if (memory_model_inst != nullptr) - linked_module->SetMemoryModel( - MakeUnique(*memory_model_inst)); - } while (false); - - std::vector> entry_points; - for (const auto& module : input_modules) - for (const auto& inst : module->entry_points()) { - const uint32_t model = inst.GetSingleWordInOperand(0); - const char* const name = - reinterpret_cast(inst.GetInOperand(2).words.data()); - const auto i = std::find_if( - entry_points.begin(), entry_points.end(), - [model, name](const std::pair& v) { - return v.first == model && strcmp(name, v.second) == 0; - }); - if (i != entry_points.end()) { - spv_operand_desc desc = nullptr; - grammar.lookupOperand(SPV_OPERAND_TYPE_EXECUTION_MODEL, model, &desc); - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INTERNAL) - << "The entry point \"" << name << "\", with execution model " - << desc->name << ", was already defined."; - } - linked_module->AddEntryPoint(MakeUnique(inst)); - entry_points.emplace_back(model, name); - } - - for (const auto& module : input_modules) - for (const auto& inst : module->execution_modes()) - linked_module->AddExecutionMode(MakeUnique(inst)); - - for (const auto& module : input_modules) - for (const auto& inst : module->debugs1()) - linked_module->AddDebug1Inst(MakeUnique(inst)); - - for (const auto& module : input_modules) - for (const auto& inst : module->debugs2()) - linked_module->AddDebug2Inst(MakeUnique(inst)); - - for (const auto& module : input_modules) - for (const auto& inst : module->annotations()) - linked_module->AddAnnotationInst(MakeUnique(inst)); - - // TODO(pierremoreau): Since the modules have not been validate, should we - // expect SpvStorageClassFunction variables outside - // functions? - uint32_t num_global_values = 0u; - for (const auto& module : input_modules) { - for (const auto& inst : module->types_values()) { - linked_module->AddType(MakeUnique(inst)); - num_global_values += inst.opcode() == SpvOpVariable; - } - } - if (num_global_values > 0xFFFF) - return libspirv::DiagnosticStream(position, consumer, SPV_ERROR_INTERNAL) - << "The limit of global values, 65535, was exceeded;" - << " " << num_global_values << " global values were found."; - - // Process functions and their basic blocks - for (const auto& module : input_modules) { - for (const auto& func : *module) { - std::unique_ptr cloned_func = - MakeUnique(func); - cloned_func->SetParent(linked_module); - linked_module->AddFunction(std::move(cloned_func)); - } - } - - return SPV_SUCCESS; -} - -static spv_result_t GetImportExportPairs(const MessageConsumer& consumer, - const Module& linked_module, - const DefUseManager& def_use_manager, - const DecorationManager& decoration_manager, - LinkageTable* linkings_to_do) { - spv_position_t position = {}; - - if (linkings_to_do == nullptr) - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_DATA) - << "|linkings_to_do| of GetImportExportPairs should not be empty."; - - std::vector imports; - std::unordered_map> exports; - - // Figure out the imports and exports - for (const auto& decoration : linked_module.annotations()) { - if (decoration.opcode() != SpvOpDecorate || - decoration.GetSingleWordInOperand(1u) != SpvDecorationLinkageAttributes) - continue; - - const SpvId id = decoration.GetSingleWordInOperand(0u); - // Ignore if the targeted symbol is a built-in - bool is_built_in = false; - for (const auto& id_decoration : decoration_manager.GetDecorationsFor(id, false)) { - if (id_decoration->GetSingleWordInOperand(1u) == SpvDecorationBuiltIn) { - is_built_in = true; - break; - } - } - if (is_built_in) - continue; - - const uint32_t type = decoration.GetSingleWordInOperand(3u); - - LinkageSymbolInfo symbol_info; - symbol_info.name = - reinterpret_cast(decoration.GetInOperand(2u).words.data()); - symbol_info.id = id; - symbol_info.type_id = 0u; - - // Retrieve the type of the current symbol. This information will be used - // when checking that the imported and exported symbols have the same - // types. - const Instruction* def_inst = def_use_manager.GetDef(id); - if (def_inst == nullptr) - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_BINARY) - << "ID " << id << " is never defined:\n"; - - if (def_inst->opcode() == SpvOpVariable) { - symbol_info.type_id = def_inst->type_id(); - } else if (def_inst->opcode() == SpvOpFunction) { - symbol_info.type_id = def_inst->GetSingleWordInOperand(1u); - - // range-based for loop calls begin()/end(), but never cbegin()/cend(), - // which will not work here. - for (auto func_iter = linked_module.cbegin(); - func_iter != linked_module.cend(); ++func_iter) { - if (func_iter->result_id() != id) continue; - func_iter->ForEachParam([&symbol_info](const Instruction* inst) { - symbol_info.parameter_ids.push_back(inst->result_id()); - }); - } - } else { - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_BINARY) - << "Only global variables and functions can be decorated using" - << " LinkageAttributes; " << id << " is neither of them.\n"; - } - - if (type == SpvLinkageTypeImport) - imports.push_back(symbol_info); - else if (type == SpvLinkageTypeExport) - exports[symbol_info.name].push_back(symbol_info); - } - - // Find the import/export pairs - for (const auto& import : imports) { - std::vector possible_exports; - const auto& exp = exports.find(import.name); - if (exp != exports.end()) possible_exports = exp->second; - if (possible_exports.empty()) - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_BINARY) - << "No export linkage was found for \"" << import.name << "\"."; - else if (possible_exports.size() > 1u) - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_BINARY) - << "Too many export linkages, " << possible_exports.size() - << ", were found for \"" << import.name << "\"."; - - linkings_to_do->emplace_back(import, possible_exports.front()); - } - - return SPV_SUCCESS; -} - -static spv_result_t CheckImportExportCompatibility( - const MessageConsumer& consumer, const LinkageTable& linkings_to_do, - const DefUseManager& def_use_manager, - const DecorationManager& decoration_manager) { - spv_position_t position = {}; - - // Ensure th import and export types are the same. - for (const auto& linking_entry : linkings_to_do) { - if (!RemoveDuplicatesPass::AreTypesEqual( - *def_use_manager.GetDef(linking_entry.imported_symbol.type_id), - *def_use_manager.GetDef(linking_entry.exported_symbol.type_id), - def_use_manager, decoration_manager)) - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_BINARY) - << "Type mismatch between imported variable/function %" - << linking_entry.imported_symbol.id - << " and exported variable/function %" - << linking_entry.exported_symbol.id << "."; - } - - // Ensure the import and export decorations are similar - for (const auto& linking_entry : linkings_to_do) { - if (!decoration_manager.HaveTheSameDecorations( - linking_entry.imported_symbol.id, linking_entry.exported_symbol.id)) - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_BINARY) - << "Decorations mismatch between imported variable/function %" - << linking_entry.imported_symbol.id - << " and exported variable/function %" - << linking_entry.exported_symbol.id << "."; - // TODO(pierremoreau): Decorations on function parameters should probably - // match, except for FuncParamAttr if I understand the - // spec correctly, which makes the code more - // complicated. - // for (uint32_t i = 0u; i < - // linking_entry.imported_symbol.parameter_ids.size(); ++i) - // if - // (!decoration_manager.HaveTheSameDecorations(linking_entry.imported_symbol.parameter_ids[i], - // linking_entry.exported_symbol.parameter_ids[i])) - // return libspirv::DiagnosticStream(position, - // impl_->context->consumer, - // SPV_ERROR_INVALID_BINARY) - // << "Decorations mismatch between imported function %" << - // linking_entry.imported_symbol.id << "'s" - // << " and exported function %" << - // linking_entry.exported_symbol.id << "'s " << (i + 1u) << - // "th parameter."; - } - - return SPV_SUCCESS; -} - -static spv_result_t RemoveLinkageSpecificInstructions( - const MessageConsumer& consumer, bool create_executable, - const LinkageTable& linkings_to_do, DecorationManager* decoration_manager, - Module* linked_module) { - spv_position_t position = {}; - - if (decoration_manager == nullptr) - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_DATA) - << "|decoration_manager| of RemoveLinkageSpecificInstructions " - "should " - "not " - "be empty."; - if (linked_module == nullptr) - return libspirv::DiagnosticStream(position, consumer, - SPV_ERROR_INVALID_DATA) - << "|linked_module| of RemoveLinkageSpecificInstructions should not " - "be empty."; - - // Remove FuncParamAttr decorations of imported functions' parameters. - // From the SPIR-V specification, Sec. 2.13: - // When resolving imported functions, the Function Control and all Function - // Parameter Attributes are taken from the function definition, and not - // from the function declaration. - for (const auto& linking_entry : linkings_to_do) { - for (const auto parameter_id : - linking_entry.imported_symbol.parameter_ids) { - for (ir::Instruction* decoration : - decoration_manager->GetDecorationsFor(parameter_id, false)) { - switch (decoration->opcode()) { - case SpvOpDecorate: - case SpvOpMemberDecorate: - if (decoration->GetSingleWordInOperand(1u) == - SpvDecorationFuncParamAttr) - decoration->ToNop(); - break; - default: - break; - } - } - } - } - - // Remove prototypes of imported functions - for (const auto& linking_entry : linkings_to_do) { - for (auto func_iter = linked_module->begin(); - func_iter != linked_module->end();) { - if (func_iter->result_id() == linking_entry.imported_symbol.id) - func_iter = func_iter.Erase(); - else - ++func_iter; - } - } - - // Remove declarations of imported variables - for (const auto& linking_entry : linkings_to_do) { - for (auto& inst : linked_module->types_values()) - if (inst.result_id() == linking_entry.imported_symbol.id) inst.ToNop(); - } - - // Remove import linkage attributes - for (auto& inst : linked_module->annotations()) - if (inst.opcode() == SpvOpDecorate && - inst.GetSingleWordOperand(1u) == SpvDecorationLinkageAttributes && - inst.GetSingleWordOperand(3u) == SpvLinkageTypeImport) - inst.ToNop(); - - // Remove export linkage attributes and Linkage capability if making an - // executable - if (create_executable) { - for (auto& inst : linked_module->annotations()) - if (inst.opcode() == SpvOpDecorate && - inst.GetSingleWordOperand(1u) == SpvDecorationLinkageAttributes && - inst.GetSingleWordOperand(3u) == SpvLinkageTypeExport) - inst.ToNop(); - - for (auto& inst : linked_module->capabilities()) - if (inst.GetSingleWordInOperand(0u) == SpvCapabilityLinkage) { - inst.ToNop(); - // The RemoveDuplicatesPass did remove duplicated capabilities, so we - // now there aren’t more SpvCapabilityLinkage further down. - break; - } - } - - return SPV_SUCCESS; -} - -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/macro.h vulkan-1.1.73+dfsg/external/spirv-tools/source/macro.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/macro.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/macro.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_MACRO_H_ -#define LIBSPIRV_MACRO_H_ - -// Evaluates to the number of elements of array A. -// -// If we could use constexpr, then we could make this a template function. -// If the source arrays were std::array, then we could have used -// std::array::size. -#define ARRAY_SIZE(A) (static_cast(sizeof(A) / sizeof(A[0]))) - -#endif // LIBSPIRV_MACRO_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/message.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/message.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/message.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/message.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "message.h" - -#include - -namespace spvtools { - -std::string StringifyMessage(spv_message_level_t level, const char* source, - const spv_position_t& position, - const char* message) { - const char* level_string = nullptr; - switch (level) { - case SPV_MSG_FATAL: - level_string = "fatal"; - break; - case SPV_MSG_INTERNAL_ERROR: - level_string = "internal error"; - break; - case SPV_MSG_ERROR: - level_string = "error"; - break; - case SPV_MSG_WARNING: - level_string = "warning"; - break; - case SPV_MSG_INFO: - level_string = "info"; - break; - case SPV_MSG_DEBUG: - level_string = "debug"; - break; - } - std::ostringstream oss; - oss << level_string << ": "; - if (source) oss << source << ":"; - oss << position.line << ":" << position.column << ":"; - oss << position.index << ": "; - if (message) oss << message; - return oss.str(); -} - -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/message.h vulkan-1.1.73+dfsg/external/spirv-tools/source/message.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/message.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/message.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SPIRV_TOOLS_MESSAGE_H_ -#define SPIRV_TOOLS_MESSAGE_H_ - -#include - -#include "spirv-tools/libspirv.h" - -namespace spvtools { - -// A helper function to compose and return a string from the message in the -// following format: -// ": :::: " -std::string StringifyMessage(spv_message_level_t level, const char* source, - const spv_position_t& position, - const char* message); - -} // namespace spvtools - -#endif // SPIRV_TOOLS_MESSAGE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/name_mapper.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/name_mapper.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/name_mapper.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/name_mapper.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,332 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "name_mapper.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "spirv-tools/libspirv.h" -#include "spirv/1.2/spirv.h" - -#include "parsed_operand.h" - -namespace { - -// Converts a uint32_t to its string decimal representation. -std::string to_string(uint32_t id) { - // Use stringstream, since some versions of Android compilers lack - // std::to_string. - std::stringstream os; - os << id; - return os.str(); -} - -} // anonymous namespace - -namespace libspirv { - -NameMapper GetTrivialNameMapper() { return to_string; } - -FriendlyNameMapper::FriendlyNameMapper(const spv_const_context context, - const uint32_t* code, - const size_t wordCount) - : grammar_(libspirv::AssemblyGrammar(context)) { - spv_diagnostic diag = nullptr; - // We don't care if the parse fails. - spvBinaryParse(context, this, code, wordCount, nullptr, - ParseInstructionForwarder, &diag); - spvDiagnosticDestroy(diag); -} - -std::string FriendlyNameMapper::NameForId(uint32_t id) { - auto iter = name_for_id_.find(id); - if (iter == name_for_id_.end()) { - // It must have been an invalid module, so just return a trivial mapping. - // We don't care about uniqueness. - return to_string(id); - } else { - return iter->second; - } -} - -std::string FriendlyNameMapper::Sanitize(const std::string& suggested_name) { - if (suggested_name.empty()) return "_"; - // Otherwise, replace invalid characters by '_'. - std::string result; - std::string valid = - "abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "_0123456789"; - std::transform(suggested_name.begin(), suggested_name.end(), - std::back_inserter(result), [&valid](const char c) { - return (std::string::npos == valid.find(c)) ? '_' : c; - }); - return result; -} - -void FriendlyNameMapper::SaveName(uint32_t id, - const std::string& suggested_name) { - if (name_for_id_.find(id) != name_for_id_.end()) return; - - const std::string sanitized_suggested_name = Sanitize(suggested_name); - std::string name = sanitized_suggested_name; - auto inserted = used_names_.insert(name); - if (!inserted.second) { - const std::string base_name = sanitized_suggested_name + "_"; - for (uint32_t index = 0; !inserted.second; ++index) { - name = base_name + to_string(index); - inserted = used_names_.insert(name); - } - } - name_for_id_[id] = name; -} - -void FriendlyNameMapper::SaveBuiltInName(uint32_t target_id, - uint32_t built_in) { -#define GLCASE(name) \ - case SpvBuiltIn##name: \ - SaveName(target_id, "gl_" #name); \ - return; -#define GLCASE2(name, suggested) \ - case SpvBuiltIn##name: \ - SaveName(target_id, "gl_" #suggested); \ - return; -#define CASE(name) \ - case SpvBuiltIn##name: \ - SaveName(target_id, #name); \ - return; - switch (built_in) { - GLCASE(Position) - GLCASE(PointSize) - GLCASE(ClipDistance) - GLCASE(CullDistance) - GLCASE2(VertexId, VertexID) - GLCASE2(InstanceId, InstanceID) - GLCASE2(PrimitiveId, PrimitiveID) - GLCASE2(InvocationId, InvocationID) - GLCASE(Layer) - GLCASE(ViewportIndex) - GLCASE(TessLevelOuter) - GLCASE(TessLevelInner) - GLCASE(TessCoord) - GLCASE(PatchVertices) - GLCASE(FragCoord) - GLCASE(PointCoord) - GLCASE(FrontFacing) - GLCASE2(SampleId, SampleID) - GLCASE(SamplePosition) - GLCASE(SampleMask) - GLCASE(FragDepth) - GLCASE(HelperInvocation) - GLCASE2(NumWorkgroups, NumWorkGroups) - GLCASE2(WorkgroupSize, WorkGroupSize) - GLCASE2(WorkgroupId, WorkGroupID) - GLCASE2(LocalInvocationId, LocalInvocationID) - GLCASE2(GlobalInvocationId, GlobalInvocationID) - GLCASE(LocalInvocationIndex) - CASE(WorkDim) - CASE(GlobalSize) - CASE(EnqueuedWorkgroupSize) - CASE(GlobalOffset) - CASE(GlobalLinearId) - CASE(SubgroupSize) - CASE(SubgroupMaxSize) - CASE(NumSubgroups) - CASE(NumEnqueuedSubgroups) - CASE(SubgroupId) - CASE(SubgroupLocalInvocationId) - GLCASE(VertexIndex) - GLCASE(InstanceIndex) - CASE(SubgroupEqMaskKHR) - CASE(SubgroupGeMaskKHR) - CASE(SubgroupGtMaskKHR) - CASE(SubgroupLeMaskKHR) - CASE(SubgroupLtMaskKHR) - default: - break; - } -#undef GLCASE -#undef GLCASE2 -#undef CASE -} - -spv_result_t FriendlyNameMapper::ParseInstruction( - const spv_parsed_instruction_t& inst) { - const auto result_id = inst.result_id; - switch (inst.opcode) { - case SpvOpName: - SaveName(inst.words[1], reinterpret_cast(inst.words + 2)); - break; - case SpvOpDecorate: - // Decorations come after OpName. So OpName will take precedence over - // decorations. - // - // In theory, we should also handle OpGroupDecorate. But that's unlikely - // to occur. - if (inst.words[2] == SpvDecorationBuiltIn) { - assert(inst.num_words > 3); - SaveBuiltInName(inst.words[1], inst.words[3]); - } - break; - case SpvOpTypeVoid: - SaveName(result_id, "void"); - break; - case SpvOpTypeBool: - SaveName(result_id, "bool"); - break; - case SpvOpTypeInt: { - std::string signedness; - std::string root; - const auto bit_width = inst.words[2]; - switch (bit_width) { - case 8: - root = "char"; - break; - case 16: - root = "short"; - break; - case 32: - root = "int"; - break; - case 64: - root = "long"; - break; - default: - root = to_string(bit_width); - signedness = "i"; - break; - } - if (0 == inst.words[3]) signedness = "u"; - SaveName(result_id, signedness + root); - } break; - case SpvOpTypeFloat: { - const auto bit_width = inst.words[2]; - switch (bit_width) { - case 16: - SaveName(result_id, "half"); - break; - case 32: - SaveName(result_id, "float"); - break; - case 64: - SaveName(result_id, "double"); - break; - default: - SaveName(result_id, std::string("fp") + to_string(bit_width)); - break; - } - } break; - case SpvOpTypeVector: - SaveName(result_id, std::string("v") + to_string(inst.words[3]) + - NameForId(inst.words[2])); - break; - case SpvOpTypeMatrix: - SaveName(result_id, std::string("mat") + to_string(inst.words[3]) + - NameForId(inst.words[2])); - break; - case SpvOpTypeArray: - SaveName(result_id, std::string("_arr_") + NameForId(inst.words[2]) + - "_" + NameForId(inst.words[3])); - break; - case SpvOpTypeRuntimeArray: - SaveName(result_id, - std::string("_runtimearr_") + NameForId(inst.words[2])); - break; - case SpvOpTypePointer: - SaveName(result_id, std::string("_ptr_") + - NameForEnumOperand(SPV_OPERAND_TYPE_STORAGE_CLASS, - inst.words[2]) + - "_" + NameForId(inst.words[3])); - break; - case SpvOpTypePipe: - SaveName(result_id, - std::string("Pipe") + - NameForEnumOperand(SPV_OPERAND_TYPE_ACCESS_QUALIFIER, - inst.words[2])); - break; - case SpvOpTypeEvent: - SaveName(result_id, "Event"); - break; - case SpvOpTypeDeviceEvent: - SaveName(result_id, "DeviceEvent"); - break; - case SpvOpTypeReserveId: - SaveName(result_id, "ReserveId"); - break; - case SpvOpTypeQueue: - SaveName(result_id, "Queue"); - break; - case SpvOpTypeOpaque: - SaveName(result_id, - std::string("Opaque_") + - Sanitize(reinterpret_cast(inst.words + 2))); - break; - case SpvOpTypePipeStorage: - SaveName(result_id, "PipeStorage"); - break; - case SpvOpTypeNamedBarrier: - SaveName(result_id, "NamedBarrier"); - break; - case SpvOpTypeStruct: - // Structs are mapped rather simplisitically. Just indicate that they - // are a struct and then give the raw Id number. - SaveName(result_id, std::string("_struct_") + to_string(result_id)); - break; - case SpvOpConstantTrue: - SaveName(result_id, "true"); - break; - case SpvOpConstantFalse: - SaveName(result_id, "false"); - break; - case SpvOpConstant: { - std::ostringstream value; - EmitNumericLiteral(&value, inst, inst.operands[2]); - auto value_str = value.str(); - // Use 'n' to signify negative. Other invalid characters will be mapped - // to underscore. - for (auto& c : value_str) - if (c == '-') c = 'n'; - SaveName(result_id, NameForId(inst.type_id) + "_" + value_str); - } break; - default: - // If this instruction otherwise defines an Id, then save a mapping for - // it. This is needed to ensure uniqueness in there is an OpName with - // string something like "1" that might collide with this result_id. - // We should only do this if a name hasn't already been registered by some - // previous forward reference. - if (result_id && name_for_id_.find(result_id) == name_for_id_.end()) - SaveName(result_id, to_string(result_id)); - break; - } - return SPV_SUCCESS; -} - -std::string FriendlyNameMapper::NameForEnumOperand(spv_operand_type_t type, - uint32_t word) { - spv_operand_desc desc = nullptr; - if (SPV_SUCCESS == grammar_.lookupOperand(type, word, &desc)) { - return desc->name; - } else { - // Invalid input. Just give something sane. - return std::string("StorageClass") + to_string(word); - } -} - -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/name_mapper.h vulkan-1.1.73+dfsg/external/spirv-tools/source/name_mapper.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/name_mapper.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/name_mapper.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_NAME_MAPPER_H_ -#define LIBSPIRV_NAME_MAPPER_H_ - -#include -#include -#include -#include - -#include "spirv-tools/libspirv.h" -#include "assembly_grammar.h" - -namespace libspirv { - -// A NameMapper maps SPIR-V Id values to names. Each name is valid to use in -// SPIR-V assembly. The mapping is one-to-one, i.e. no two Ids map to the same -// name. -using NameMapper = std::function; - -// Returns a NameMapper which always maps an Id to its decimal representation. -NameMapper GetTrivialNameMapper(); - -// A FriendlyNameMapper parses a module upon construction. If the parse is -// successful, then the NameForId method maps an Id to a friendly name -// while also satisfying the constraints on a NameMapper. -// -// The mapping is friendly in the following sense: -// - If an Id has a debug name (via OpName), then that will be used when -// possible. -// - Well known scalar types map to friendly names. For example, -// OpTypeVoid should be %void. Scalar types map to their names in OpenCL when -// there is a correspondence, and otherwise as follows: -// - unsigned integer type of n bits map to "u" followed by n -// - signed integer type of n bits map to "i" followed by n -// - floating point type of n bits map to "fp" followed by n -// - Vector type names map to "v" followed by the number of components, -// followed by the friendly name for the base type. -// - Matrix type names map to "mat" followed by the number of columns, -// followed by the friendly name for the base vector type. -// - Pointer types map to "_ptr_", then the name of the storage class, then the -// name for the pointee type. -// - Exotic types like event, pipe, opaque, queue, reserve-id map to their own -// human readable names. -// - A struct type maps to "_struct_" followed by the raw Id number. That's -// pretty simplistic, but workable. -// - A built-in variable maps to its GLSL variable name. -// - Numeric literals in OpConstant map to a human-friendly name. -class FriendlyNameMapper { - public: - // Construct a friendly name mapper, and determine friendly names for each - // defined Id in the specified module. The module is specified by the code - // wordCount, and should be parseable in the specified context. - FriendlyNameMapper(const spv_const_context context, const uint32_t* code, - const size_t wordCount); - - // Returns a NameMapper which maps ids to the friendly names parsed from the - // module provided to the constructor. - NameMapper GetNameMapper() { - return [this](uint32_t id) { return this->NameForId(id); }; - } - - // Returns the friendly name for the given id. If the module parsed during - // construction is valid, then the mapping satisfies the rules for a - // NameMapper. - std::string NameForId(uint32_t id); - - private: - // Transforms the given string so that it is acceptable as an Id name in - // assembly language. Two distinct inputs can map to the same output. - std::string Sanitize(const std::string& suggested_name); - - // Records a name for the given id. If this id already has a name, then - // this is a no-op. If the id doesn't have a name, use the given - // suggested_name if it hasn't already been taken, and otherwise generate - // a new (unused) name based on the suggested name. - void SaveName(uint32_t id, const std::string& suggested_name); - - // Records a built-in variable name for target_id. If target_id already - // has a name then this is a no-op. - void SaveBuiltInName(uint32_t target_id, uint32_t built_in); - - // Collects information from the given parsed instruction to populate - // name_for_id_. Returns SPV_SUCCESS; - spv_result_t ParseInstruction(const spv_parsed_instruction_t& inst); - - // Forwards a parsed-instruction callback from the binary parser into the - // FriendlyNameMapper hidden inside the user_data parameter. - static spv_result_t ParseInstructionForwarder( - void* user_data, const spv_parsed_instruction_t* parsed_instruction) { - return reinterpret_cast(user_data)->ParseInstruction( - *parsed_instruction); - } - - // Returns the friendly name for an enumerant. - std::string NameForEnumOperand(spv_operand_type_t type, uint32_t word); - - // Maps an id to its friendly name. This will have an entry for each Id - // defined in the module. - std::unordered_map name_for_id_; - // The set of names that have a mapping in name_for_id_; - std::unordered_set used_names_; - // The assembly grammar for the current context. - const libspirv::AssemblyGrammar grammar_; -}; - -} // namespace libspirv - -#endif // _LIBSPIRV_NAME_MAPPER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opcode.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opcode.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opcode.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opcode.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,319 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "opcode.h" - -#include -#include - -#include -#include - -#include "instruction.h" -#include "macro.h" -#include "spirv-tools/libspirv.h" -#include "spirv_constant.h" -#include "spirv_endian.h" - -namespace { -struct OpcodeDescPtrLen { - const spv_opcode_desc_t* ptr; - uint32_t len; -}; - -OpcodeDescPtrLen getOpcodeTableEntries_1_2() { - static const spv_opcode_desc_t opcodeTableEntries_1_2[] = { -#include "core.insts-1.2.inc" - }; - - return {opcodeTableEntries_1_2, ARRAY_SIZE(opcodeTableEntries_1_2)}; -} - -// Represents a vendor tool entry in the SPIR-V XML Regsitry. -struct VendorTool { - uint32_t value; - const char* vendor; - const char* tool; // Might be empty string. - const char* vendor_tool; // Combiantion of vendor and tool. -}; - -const VendorTool vendor_tools[] = { -#include "generators.inc" -}; - -} // anonymous namespace - -// TODO(dneto): Move this to another file. It doesn't belong with opcode -// processing. -const char* spvGeneratorStr(uint32_t generator) { - auto where = std::find_if( - std::begin(vendor_tools), std::end(vendor_tools), - [generator](const VendorTool& vt) { return generator == vt.value; }); - if (where != std::end(vendor_tools)) return where->vendor_tool; - return "Unknown"; -} - -uint32_t spvOpcodeMake(uint16_t wordCount, SpvOp opcode) { - return ((uint32_t)opcode) | (((uint32_t)wordCount) << 16); -} - -void spvOpcodeSplit(const uint32_t word, uint16_t* pWordCount, - uint16_t* pOpcode) { - if (pWordCount) { - *pWordCount = (uint16_t)((0xffff0000 & word) >> 16); - } - if (pOpcode) { - *pOpcode = 0x0000ffff & word; - } -} - -spv_result_t spvOpcodeTableGet(spv_opcode_table* pInstTable, - spv_target_env env) { - if (!pInstTable) return SPV_ERROR_INVALID_POINTER; - - // Descriptions of each opcode. Each entry describes the format of the - // instruction that follows a particular opcode. - static const spv_opcode_desc_t opcodeTableEntries_1_0[] = { -#include "core.insts-1.0.inc" - }; - static const spv_opcode_desc_t opcodeTableEntries_1_1[] = { -#include "core.insts-1.1.inc" - }; - - const auto ptr_len = getOpcodeTableEntries_1_2(); - - static const spv_opcode_table_t table_1_0 = { - ARRAY_SIZE(opcodeTableEntries_1_0), opcodeTableEntries_1_0}; - static const spv_opcode_table_t table_1_1 = { - ARRAY_SIZE(opcodeTableEntries_1_1), opcodeTableEntries_1_1}; - static const spv_opcode_table_t table_1_2 = {ptr_len.len, ptr_len.ptr}; - - switch (env) { - case SPV_ENV_UNIVERSAL_1_0: - case SPV_ENV_VULKAN_1_0: - case SPV_ENV_OPENCL_2_1: - case SPV_ENV_OPENGL_4_0: - case SPV_ENV_OPENGL_4_1: - case SPV_ENV_OPENGL_4_2: - case SPV_ENV_OPENGL_4_3: - case SPV_ENV_OPENGL_4_5: - *pInstTable = &table_1_0; - return SPV_SUCCESS; - case SPV_ENV_UNIVERSAL_1_1: - *pInstTable = &table_1_1; - return SPV_SUCCESS; - case SPV_ENV_UNIVERSAL_1_2: - case SPV_ENV_OPENCL_2_2: - *pInstTable = &table_1_2; - return SPV_SUCCESS; - } - assert(0 && "Unknown spv_target_env in spvOpcodeTableGet()"); - return SPV_ERROR_INVALID_TABLE; -} - -spv_result_t spvOpcodeTableNameLookup(const spv_opcode_table table, - const char* name, - spv_opcode_desc* pEntry) { - if (!name || !pEntry) return SPV_ERROR_INVALID_POINTER; - if (!table) return SPV_ERROR_INVALID_TABLE; - - // TODO: This lookup of the Opcode table is suboptimal! Binary sort would be - // preferable but the table requires sorting on the Opcode name, but it's - // static - // const initialized and matches the order of the spec. - const size_t nameLength = strlen(name); - for (uint64_t opcodeIndex = 0; opcodeIndex < table->count; ++opcodeIndex) { - if (nameLength == strlen(table->entries[opcodeIndex].name) && - !strncmp(name, table->entries[opcodeIndex].name, nameLength)) { - // NOTE: Found out Opcode! - *pEntry = &table->entries[opcodeIndex]; - return SPV_SUCCESS; - } - } - - return SPV_ERROR_INVALID_LOOKUP; -} - -spv_result_t spvOpcodeTableValueLookup(const spv_opcode_table table, - const SpvOp opcode, - spv_opcode_desc* pEntry) { - if (!table) return SPV_ERROR_INVALID_TABLE; - if (!pEntry) return SPV_ERROR_INVALID_POINTER; - - // TODO: As above this lookup is not optimal. - for (uint64_t opcodeIndex = 0; opcodeIndex < table->count; ++opcodeIndex) { - if (opcode == table->entries[opcodeIndex].opcode) { - // NOTE: Found the Opcode! - *pEntry = &table->entries[opcodeIndex]; - return SPV_SUCCESS; - } - } - - return SPV_ERROR_INVALID_LOOKUP; -} - -void spvInstructionCopy(const uint32_t* words, const SpvOp opcode, - const uint16_t wordCount, const spv_endianness_t endian, - spv_instruction_t* pInst) { - pInst->opcode = opcode; - pInst->words.resize(wordCount); - for (uint16_t wordIndex = 0; wordIndex < wordCount; ++wordIndex) { - pInst->words[wordIndex] = spvFixWord(words[wordIndex], endian); - if (!wordIndex) { - uint16_t thisWordCount; - uint16_t thisOpcode; - spvOpcodeSplit(pInst->words[wordIndex], &thisWordCount, &thisOpcode); - assert(opcode == static_cast(thisOpcode) && - wordCount == thisWordCount && "Endianness failed!"); - } - } -} - -const char* spvOpcodeString(const SpvOp opcode) { - // Use the latest SPIR-V version, which should be backward-compatible with all - // previous ones. - const auto entries = getOpcodeTableEntries_1_2(); - - for (uint32_t i = 0; i < entries.len; ++i) { - if (entries.ptr[i].opcode == opcode) return entries.ptr[i].name; - } - - assert(0 && "Unreachable!"); - return "unknown"; -} - -int32_t spvOpcodeIsScalarType(const SpvOp opcode) { - switch (opcode) { - case SpvOpTypeInt: - case SpvOpTypeFloat: - case SpvOpTypeBool: - return true; - default: - return false; - } -} - -int32_t spvOpcodeIsConstant(const SpvOp opcode) { - switch (opcode) { - case SpvOpConstantTrue: - case SpvOpConstantFalse: - case SpvOpConstant: - case SpvOpConstantComposite: - case SpvOpConstantSampler: - case SpvOpConstantNull: - case SpvOpSpecConstantTrue: - case SpvOpSpecConstantFalse: - case SpvOpSpecConstant: - case SpvOpSpecConstantComposite: - case SpvOpSpecConstantOp: - return true; - default: - return false; - } -} - -bool spvOpcodeIsConstantOrUndef(const SpvOp opcode) { - return opcode == SpvOpUndef || spvOpcodeIsConstant(opcode); -} - -bool spvOpcodeIsScalarSpecConstant(const SpvOp opcode) { - switch (opcode) { - case SpvOpSpecConstantTrue: - case SpvOpSpecConstantFalse: - case SpvOpSpecConstant: - return true; - default: - return false; - } -} - -int32_t spvOpcodeIsComposite(const SpvOp opcode) { - switch (opcode) { - case SpvOpTypeVector: - case SpvOpTypeMatrix: - case SpvOpTypeArray: - case SpvOpTypeStruct: - return true; - default: - return false; - } -} - -bool spvOpcodeReturnsLogicalVariablePointer(const SpvOp opcode) { - switch (opcode) { - case SpvOpVariable: - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpFunctionParameter: - case SpvOpImageTexelPointer: - case SpvOpCopyObject: - case SpvOpSelect: - case SpvOpPhi: - case SpvOpFunctionCall: - case SpvOpPtrAccessChain: - case SpvOpLoad: - case SpvOpConstantNull: - return true; - default: - return false; - } -} - -int32_t spvOpcodeReturnsLogicalPointer(const SpvOp opcode) { - switch (opcode) { - case SpvOpVariable: - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpFunctionParameter: - case SpvOpImageTexelPointer: - case SpvOpCopyObject: - return true; - default: - return false; - } -} - -int32_t spvOpcodeGeneratesType(SpvOp op) { - switch (op) { - case SpvOpTypeVoid: - case SpvOpTypeBool: - case SpvOpTypeInt: - case SpvOpTypeFloat: - case SpvOpTypeVector: - case SpvOpTypeMatrix: - case SpvOpTypeImage: - case SpvOpTypeSampler: - case SpvOpTypeSampledImage: - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: - case SpvOpTypeStruct: - case SpvOpTypeOpaque: - case SpvOpTypePointer: - case SpvOpTypeFunction: - case SpvOpTypeEvent: - case SpvOpTypeDeviceEvent: - case SpvOpTypeReserveId: - case SpvOpTypeQueue: - case SpvOpTypePipe: - case SpvOpTypePipeStorage: - case SpvOpTypeNamedBarrier: - return true; - default: - // In particular, OpTypeForwardPointer does not generate a type, - // but declares a storage class for a pointer type generated - // by a different instruction. - break; - } - return 0; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opcode.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opcode.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opcode.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opcode.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,90 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPCODE_H_ -#define LIBSPIRV_OPCODE_H_ - -#include "instruction.h" -#include "spirv-tools/libspirv.h" -#include "spirv/1.2/spirv.h" -#include "table.h" - -// Returns the name of a registered SPIR-V generator as a null-terminated -// string. If the generator is not known, then returns the string "Unknown". -// The generator parameter should be most significant 16-bits of the generator -// word in the SPIR-V module header. -// -// See the registry at https://www.khronos.org/registry/spir-v/api/spir-v.xml. -const char* spvGeneratorStr(uint32_t generator); - -// Combines word_count and opcode enumerant in single word. -uint32_t spvOpcodeMake(uint16_t word_count, SpvOp opcode); - -// Splits word into into two constituent parts: word_count and opcode. -void spvOpcodeSplit(const uint32_t word, uint16_t* word_count, - uint16_t* opcode); - -// Finds the named opcode in the given opcode table. On success, returns -// SPV_SUCCESS and writes a handle of the table entry into *entry. -spv_result_t spvOpcodeTableNameLookup(const spv_opcode_table table, - const char* name, spv_opcode_desc* entry); - -// Finds the opcode by enumerant in the given opcode table. On success, returns -// SPV_SUCCESS and writes a handle of the table entry into *entry. -spv_result_t spvOpcodeTableValueLookup(const spv_opcode_table table, - const SpvOp opcode, - spv_opcode_desc* entry); - -// Copies an instruction's word and fixes the endianness to host native. The -// source instruction's stream/opcode/endianness is in the words/opcode/endian -// parameter. The word_count parameter specifies the number of words to copy. -// Writes copied instruction into *inst. -void spvInstructionCopy(const uint32_t* words, const SpvOp opcode, - const uint16_t word_count, - const spv_endianness_t endian, spv_instruction_t* inst); - -// Gets the name of an instruction, without the "Op" prefix. -const char* spvOpcodeString(const SpvOp opcode); - -// Determine if the given opcode is a scalar type. Returns zero if false, -// non-zero otherwise. -int32_t spvOpcodeIsScalarType(const SpvOp opcode); - -// Determines if the given opcode is a constant. Returns zero if false, non-zero -// otherwise. -int32_t spvOpcodeIsConstant(const SpvOp opcode); - -// Returns true if the given opcode is a constant or undef. -bool spvOpcodeIsConstantOrUndef(const SpvOp opcode); - -// Returns true if the given opcode is a scalar specialization constant. -bool spvOpcodeIsScalarSpecConstant(const SpvOp opcode); - -// Determines if the given opcode is a composite type. Returns zero if false, -// non-zero otherwise. -int32_t spvOpcodeIsComposite(const SpvOp opcode); - -// Determines if the given opcode results in a pointer when using the logical -// addressing model. Returns zero if false, non-zero otherwise. -int32_t spvOpcodeReturnsLogicalPointer(const SpvOp opcode); - -// Returns whether the given opcode could result in a pointer or a variable -// pointer when using the logical addressing model. -bool spvOpcodeReturnsLogicalVariablePointer(const SpvOp opcode); - -// Determines if the given opcode generates a type. Returns zero if false, -// non-zero otherwise. -int32_t spvOpcodeGeneratesType(SpvOp opcode); - -#endif // LIBSPIRV_OPCODE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/operand.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/operand.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/operand.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/operand.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,383 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "operand.h" - -#include -#include -#include - -#include "macro.h" - -spv_result_t spvOperandTableGet(spv_operand_table* pOperandTable, - spv_target_env env) { - if (!pOperandTable) return SPV_ERROR_INVALID_POINTER; - -#include "operand.kinds-1.0.inc" -#include "operand.kinds-1.1.inc" -#include "operand.kinds-1.2.inc" - - static const spv_operand_table_t table_1_0 = { - ARRAY_SIZE(pygen_variable_OperandInfoTable_1_0), - pygen_variable_OperandInfoTable_1_0}; - static const spv_operand_table_t table_1_1 = { - ARRAY_SIZE(pygen_variable_OperandInfoTable_1_1), - pygen_variable_OperandInfoTable_1_1}; - static const spv_operand_table_t table_1_2 = { - ARRAY_SIZE(pygen_variable_OperandInfoTable_1_2), - pygen_variable_OperandInfoTable_1_2}; - - switch (env) { - case SPV_ENV_UNIVERSAL_1_0: - case SPV_ENV_VULKAN_1_0: - case SPV_ENV_OPENCL_2_1: - case SPV_ENV_OPENGL_4_0: - case SPV_ENV_OPENGL_4_1: - case SPV_ENV_OPENGL_4_2: - case SPV_ENV_OPENGL_4_3: - case SPV_ENV_OPENGL_4_5: - *pOperandTable = &table_1_0; - return SPV_SUCCESS; - case SPV_ENV_UNIVERSAL_1_1: - *pOperandTable = &table_1_1; - return SPV_SUCCESS; - case SPV_ENV_UNIVERSAL_1_2: - case SPV_ENV_OPENCL_2_2: - *pOperandTable = &table_1_2; - return SPV_SUCCESS; - } - assert(0 && "Unknown spv_target_env in spvOperandTableGet()"); - return SPV_ERROR_INVALID_TABLE; -} - -#undef ARRAY_SIZE - -spv_result_t spvOperandTableNameLookup(const spv_operand_table table, - const spv_operand_type_t type, - const char* name, - const size_t nameLength, - spv_operand_desc* pEntry) { - if (!table) return SPV_ERROR_INVALID_TABLE; - if (!name || !pEntry) return SPV_ERROR_INVALID_POINTER; - - for (uint64_t typeIndex = 0; typeIndex < table->count; ++typeIndex) { - const auto& group = table->types[typeIndex]; - if (type != group.type) continue; - for (uint64_t index = 0; index < group.count; ++index) { - const auto& entry = group.entries[index]; - if (nameLength == strlen(entry.name) && - !strncmp(entry.name, name, nameLength)) { - *pEntry = &entry; - return SPV_SUCCESS; - } - } - } - - return SPV_ERROR_INVALID_LOOKUP; -} - -spv_result_t spvOperandTableValueLookup(const spv_operand_table table, - const spv_operand_type_t type, - const uint32_t value, - spv_operand_desc* pEntry) { - if (!table) return SPV_ERROR_INVALID_TABLE; - if (!pEntry) return SPV_ERROR_INVALID_POINTER; - - for (uint64_t typeIndex = 0; typeIndex < table->count; ++typeIndex) { - const auto& group = table->types[typeIndex]; - if (type != group.type) continue; - for (uint64_t index = 0; index < group.count; ++index) { - const auto& entry = group.entries[index]; - if (value == entry.value) { - *pEntry = &entry; - return SPV_SUCCESS; - } - } - } - - return SPV_ERROR_INVALID_LOOKUP; -} - -const char* spvOperandTypeStr(spv_operand_type_t type) { - switch (type) { - case SPV_OPERAND_TYPE_ID: - case SPV_OPERAND_TYPE_OPTIONAL_ID: - return "ID"; - case SPV_OPERAND_TYPE_TYPE_ID: - return "type ID"; - case SPV_OPERAND_TYPE_RESULT_ID: - return "result ID"; - case SPV_OPERAND_TYPE_LITERAL_INTEGER: - case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER: - case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_NUMBER: - return "literal number"; - case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER: - return "possibly multi-word literal integer"; - case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: - return "possibly multi-word literal number"; - case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: - return "extension instruction number"; - case SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER: - return "OpSpecConstantOp opcode"; - case SPV_OPERAND_TYPE_LITERAL_STRING: - case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING: - return "literal string"; - case SPV_OPERAND_TYPE_SOURCE_LANGUAGE: - return "source language"; - case SPV_OPERAND_TYPE_EXECUTION_MODEL: - return "execution model"; - case SPV_OPERAND_TYPE_ADDRESSING_MODEL: - return "addressing model"; - case SPV_OPERAND_TYPE_MEMORY_MODEL: - return "memory model"; - case SPV_OPERAND_TYPE_EXECUTION_MODE: - return "execution mode"; - case SPV_OPERAND_TYPE_STORAGE_CLASS: - return "storage class"; - case SPV_OPERAND_TYPE_DIMENSIONALITY: - return "dimensionality"; - case SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE: - return "sampler addressing mode"; - case SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE: - return "sampler filter mode"; - case SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT: - return "image format"; - case SPV_OPERAND_TYPE_FP_FAST_MATH_MODE: - return "floating-point fast math mode"; - case SPV_OPERAND_TYPE_FP_ROUNDING_MODE: - return "floating-point rounding mode"; - case SPV_OPERAND_TYPE_LINKAGE_TYPE: - return "linkage type"; - case SPV_OPERAND_TYPE_ACCESS_QUALIFIER: - case SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER: - return "access qualifier"; - case SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE: - return "function parameter attribute"; - case SPV_OPERAND_TYPE_DECORATION: - return "decoration"; - case SPV_OPERAND_TYPE_BUILT_IN: - return "built-in"; - case SPV_OPERAND_TYPE_SELECTION_CONTROL: - return "selection control"; - case SPV_OPERAND_TYPE_LOOP_CONTROL: - return "loop control"; - case SPV_OPERAND_TYPE_FUNCTION_CONTROL: - return "function control"; - case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: - return "memory semantics ID"; - case SPV_OPERAND_TYPE_MEMORY_ACCESS: - case SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS: - return "memory access"; - case SPV_OPERAND_TYPE_SCOPE_ID: - return "scope ID"; - case SPV_OPERAND_TYPE_GROUP_OPERATION: - return "group operation"; - case SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS: - return "kernel enqeue flags"; - case SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO: - return "kernel profiling info"; - case SPV_OPERAND_TYPE_CAPABILITY: - return "capability"; - case SPV_OPERAND_TYPE_IMAGE: - case SPV_OPERAND_TYPE_OPTIONAL_IMAGE: - return "image"; - case SPV_OPERAND_TYPE_OPTIONAL_CIV: - return "context-insensitive value"; - - // The next values are for values returned from an instruction, not actually - // an operand. So the specific strings don't matter. But let's add them - // for completeness and ease of testing. - case SPV_OPERAND_TYPE_IMAGE_CHANNEL_ORDER: - return "image channel order"; - case SPV_OPERAND_TYPE_IMAGE_CHANNEL_DATA_TYPE: - return "image channel data type"; - - case SPV_OPERAND_TYPE_NONE: - return "NONE"; - default: - assert(0 && "Unhandled operand type!"); - break; - } - return "unknown"; -} - -void spvPushOperandTypes(const spv_operand_type_t* types, - spv_operand_pattern_t* pattern) { - const spv_operand_type_t* endTypes; - for (endTypes = types; *endTypes != SPV_OPERAND_TYPE_NONE; ++endTypes) - ; - while (endTypes-- != types) { - pattern->push_back(*endTypes); - } -} - -void spvPushOperandTypesForMask(const spv_operand_table operandTable, - const spv_operand_type_t type, - const uint32_t mask, - spv_operand_pattern_t* pattern) { - // Scan from highest bits to lowest bits because we will append in LIFO - // fashion, and we need the operands for lower order bits to be consumed first - for (uint32_t candidate_bit = (1u << 31u); candidate_bit; - candidate_bit >>= 1) { - if (candidate_bit & mask) { - spv_operand_desc entry = nullptr; - if (SPV_SUCCESS == spvOperandTableValueLookup(operandTable, type, - candidate_bit, &entry)) { - spvPushOperandTypes(entry->operandTypes, pattern); - } - } - } -} - -bool spvOperandIsConcreteMask(spv_operand_type_t type) { - return SPV_OPERAND_TYPE_FIRST_CONCRETE_MASK_TYPE <= type && - type <= SPV_OPERAND_TYPE_LAST_CONCRETE_MASK_TYPE; -} - -bool spvOperandIsOptional(spv_operand_type_t type) { - return SPV_OPERAND_TYPE_FIRST_OPTIONAL_TYPE <= type && - type <= SPV_OPERAND_TYPE_LAST_OPTIONAL_TYPE; -} - -bool spvOperandIsVariable(spv_operand_type_t type) { - return SPV_OPERAND_TYPE_FIRST_VARIABLE_TYPE <= type && - type <= SPV_OPERAND_TYPE_LAST_VARIABLE_TYPE; -} - -bool spvExpandOperandSequenceOnce(spv_operand_type_t type, - spv_operand_pattern_t* pattern) { - switch (type) { - case SPV_OPERAND_TYPE_VARIABLE_ID: - pattern->push_back(type); - pattern->push_back(SPV_OPERAND_TYPE_OPTIONAL_ID); - return true; - case SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER: - pattern->push_back(type); - pattern->push_back(SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER); - return true; - case SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER_ID: - // Represents Zero or more (Literal number, Id) pairs, - // where the literal number must be a scalar integer. - pattern->push_back(type); - pattern->push_back(SPV_OPERAND_TYPE_ID); - pattern->push_back(SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER); - return true; - case SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER: - // Represents Zero or more (Id, Literal number) pairs. - pattern->push_back(type); - pattern->push_back(SPV_OPERAND_TYPE_LITERAL_INTEGER); - pattern->push_back(SPV_OPERAND_TYPE_OPTIONAL_ID); - return true; - default: - break; - } - return false; -} - -spv_operand_type_t spvTakeFirstMatchableOperand( - spv_operand_pattern_t* pattern) { - assert(!pattern->empty()); - spv_operand_type_t result; - do { - result = pattern->back(); - pattern->pop_back(); - } while (spvExpandOperandSequenceOnce(result, pattern)); - return result; -} - -spv_operand_pattern_t spvAlternatePatternFollowingImmediate( - const spv_operand_pattern_t& pattern) { - auto it = - std::find(pattern.crbegin(), pattern.crend(), SPV_OPERAND_TYPE_RESULT_ID); - if (it != pattern.crend()) { - spv_operand_pattern_t alternatePattern(it - pattern.crbegin() + 2, - SPV_OPERAND_TYPE_OPTIONAL_CIV); - alternatePattern[1] = SPV_OPERAND_TYPE_RESULT_ID; - return alternatePattern; - } - - // No result-id found, so just expect CIVs. - return {SPV_OPERAND_TYPE_OPTIONAL_CIV}; -} - -bool spvIsIdType(spv_operand_type_t type) { - switch (type) { - case SPV_OPERAND_TYPE_ID: - case SPV_OPERAND_TYPE_TYPE_ID: - case SPV_OPERAND_TYPE_RESULT_ID: - case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: - case SPV_OPERAND_TYPE_SCOPE_ID: - return true; - default: - return false; - } -} - -std::function spvOperandCanBeForwardDeclaredFunction( - SpvOp opcode) { - std::function out; - switch (opcode) { - case SpvOpExecutionMode: - case SpvOpEntryPoint: - case SpvOpName: - case SpvOpMemberName: - case SpvOpSelectionMerge: - case SpvOpDecorate: - case SpvOpMemberDecorate: - case SpvOpTypeStruct: - case SpvOpBranch: - case SpvOpLoopMerge: - out = [](unsigned) { return true; }; - break; - case SpvOpGroupDecorate: - case SpvOpGroupMemberDecorate: - case SpvOpBranchConditional: - case SpvOpSwitch: - out = [](unsigned index) { return index != 0; }; - break; - - case SpvOpFunctionCall: - // The Function parameter. - out = [](unsigned index) { return index == 2; }; - break; - - case SpvOpPhi: - out = [](unsigned index) { return index > 1; }; - break; - - case SpvOpEnqueueKernel: - // The Invoke parameter. - out = [](unsigned index) { return index == 8; }; - break; - - case SpvOpGetKernelNDrangeSubGroupCount: - case SpvOpGetKernelNDrangeMaxSubGroupSize: - // The Invoke parameter. - out = [](unsigned index) { return index == 3; }; - break; - - case SpvOpGetKernelWorkGroupSize: - case SpvOpGetKernelPreferredWorkGroupSizeMultiple: - // The Invoke parameter. - out = [](unsigned index) { return index == 2; }; - break; - case SpvOpTypeForwardPointer: - out = [](unsigned index) { return index == 0; }; - break; - default: - out = [](unsigned) { return false; }; - break; - } - return out; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/operand.h vulkan-1.1.73+dfsg/external/spirv-tools/source/operand.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/operand.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/operand.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,135 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPERAND_H_ -#define LIBSPIRV_OPERAND_H_ - -#include -#include - -#include "spirv-tools/libspirv.h" -#include "table.h" - -// A sequence of operand types. -// -// A SPIR-V parser uses an operand pattern to describe what is expected -// next on the input. -// -// As we parse an instruction in text or binary form from left to right, -// we pop and push at the end of the pattern vector. Symbols later in the -// pattern vector are matched against the input before symbols earlier in the -// pattern vector are matched. - -// Using a vector in this way reduces memory traffic, which is good for -// performance. -using spv_operand_pattern_t = std::vector; - -// Finds the named operand in the table. The type parameter specifies the -// operand's group. A handle of the operand table entry for this operand will -// be written into *entry. -spv_result_t spvOperandTableNameLookup(const spv_operand_table table, - const spv_operand_type_t type, - const char* name, - const size_t name_length, - spv_operand_desc* entry); - -// Finds the operand with value in the table. The type parameter specifies the -// operand's group. A handle of the operand table entry for this operand will -// be written into *entry. -spv_result_t spvOperandTableValueLookup(const spv_operand_table table, - const spv_operand_type_t type, - const uint32_t value, - spv_operand_desc* entry); - -// Gets the name string of the non-variable operand type. -const char* spvOperandTypeStr(spv_operand_type_t type); - -// Returns true if the given type is a concrete and also a mask. -bool spvOperandIsConcreteMask(spv_operand_type_t type); - -// Returns true if an operand of the given type is optional. -bool spvOperandIsOptional(spv_operand_type_t type); - -// Returns true if an operand type represents zero or more logical operands. -// -// Note that a single logical operand may still be a variable number of words. -// For example, a literal string may be many words, but is just one logical -// operand. -bool spvOperandIsVariable(spv_operand_type_t type); - -// Append a list of operand types to the end of the pattern vector. -// The types parameter specifies the source array of types, ending with -// SPV_OPERAND_TYPE_NONE. -void spvPushOperandTypes(const spv_operand_type_t* types, - spv_operand_pattern_t* pattern); - -// Appends the operands expected after the given typed mask onto the -// end of the given pattern. -// -// Each set bit in the mask represents zero or more operand types that should -// be appended onto the pattern. Operands for a less significant bit always -// appear after operands for a more significant bit. -// -// If a set bit is unknown, then we assume it has no operands. -void spvPushOperandTypesForMask(const spv_operand_table operand_table, - const spv_operand_type_t mask_type, - const uint32_t mask, - spv_operand_pattern_t* pattern); - -// Expands an operand type representing zero or more logical operands, -// exactly once. -// -// If the given type represents potentially several logical operands, -// then prepend the given pattern with the first expansion of the logical -// operands, followed by original type. Otherwise, don't modify the pattern. -// -// For example, the SPV_OPERAND_TYPE_VARIABLE_ID represents zero or more -// IDs. In that case we would prepend the pattern with SPV_OPERAND_TYPE_ID -// followed by SPV_OPERAND_TYPE_VARIABLE_ID again. -// -// This also applies to zero or more tuples of logical operands. In that case -// we prepend pattern with for the members of the tuple, followed by the -// original type argument. The pattern must encode the fact that if any part -// of the tuple is present, then all tuple members should be. So the first -// member of the tuple must be optional, and the remaining members -// non-optional. -// -// Returns true if we modified the pattern. -bool spvExpandOperandSequenceOnce(spv_operand_type_t type, - spv_operand_pattern_t* pattern); - -// Expands the first element in the pattern until it is a matchable operand -// type, then pops it off the front and returns it. The pattern must not be -// empty. -// -// A matchable operand type is anything other than a zero-or-more-items -// operand type. -spv_operand_type_t spvTakeFirstMatchableOperand(spv_operand_pattern_t* pattern); - -// Calculates the corresponding post-immediate alternate pattern, which allows -// a limited set of operand types. -spv_operand_pattern_t spvAlternatePatternFollowingImmediate( - const spv_operand_pattern_t& pattern); - -// Is the operand an ID? -bool spvIsIdType(spv_operand_type_t type); - -// Takes the opcode of an instruction and returns -// a function object that will return true if the index -// of the operand can be forward declared. This function will -// used in the SSA validation stage of the pipeline -std::function spvOperandCanBeForwardDeclaredFunction( - SpvOp opcode); - -#endif // LIBSPIRV_OPERAND_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,560 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "aggressive_dead_code_elim_pass.h" - -#include "iterator.h" -#include "spirv/1.0/GLSL.std.450.h" - -namespace spvtools { -namespace opt { - -namespace { - -const uint32_t kTypePointerStorageClassInIdx = 0; -const uint32_t kExtInstSetIdInIndx = 0; -const uint32_t kExtInstInstructionInIndx = 1; -const uint32_t kEntryPointFunctionIdInIdx = 1; - -} // namespace anonymous - -bool AggressiveDCEPass::IsVarOfStorage(uint32_t varId, - uint32_t storageClass) { - const ir::Instruction* varInst = def_use_mgr_->GetDef(varId); - const SpvOp op = varInst->opcode(); - if (op != SpvOpVariable) - return false; - const uint32_t varTypeId = varInst->type_id(); - const ir::Instruction* varTypeInst = def_use_mgr_->GetDef(varTypeId); - if (varTypeInst->opcode() != SpvOpTypePointer) - return false; - return varTypeInst->GetSingleWordInOperand(kTypePointerStorageClassInIdx) == - storageClass; -} - -bool AggressiveDCEPass::IsLocalVar(uint32_t varId) { - return IsVarOfStorage(varId, SpvStorageClassFunction) || - (IsVarOfStorage(varId, SpvStorageClassPrivate) && private_like_local_); -} - -void AggressiveDCEPass::AddStores(uint32_t ptrId) { - const analysis::UseList* uses = def_use_mgr_->GetUses(ptrId); - if (uses == nullptr) - return; - for (const auto u : *uses) { - const SpvOp op = u.inst->opcode(); - switch (op) { - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpCopyObject: { - AddStores(u.inst->result_id()); - } break; - case SpvOpLoad: - break; - // If default, assume it stores eg frexp, modf, function call - case SpvOpStore: - default: { - if (live_insts_.find(u.inst) == live_insts_.end()) - worklist_.push(u.inst); - } break; - } - } -} - -bool AggressiveDCEPass::IsCombinator(uint32_t op) const { - return combinator_ops_shader_.find(op) != combinator_ops_shader_.end(); -} - -bool AggressiveDCEPass::IsCombinatorExt(ir::Instruction* inst) const { - assert(inst->opcode() == SpvOpExtInst); - if (inst->GetSingleWordInOperand(kExtInstSetIdInIndx) == glsl_std_450_id_) { - uint32_t op = inst->GetSingleWordInOperand(kExtInstInstructionInIndx); - return combinator_ops_glsl_std_450_.find(op) != - combinator_ops_glsl_std_450_.end(); - } - else - return false; -} - -bool AggressiveDCEPass::AllExtensionsSupported() const { - // If any extension not in whitelist, return false - for (auto& ei : module_->extensions()) { - const char* extName = reinterpret_cast( - &ei.GetInOperand(0).words[0]); - if (extensions_whitelist_.find(extName) == extensions_whitelist_.end()) - return false; - } - return true; -} - -bool AggressiveDCEPass::KillInstIfTargetDead(ir::Instruction* inst) { - const uint32_t tId = inst->GetSingleWordInOperand(0); - const ir::Instruction* tInst = def_use_mgr_->GetDef(tId); - if (dead_insts_.find(tInst) != dead_insts_.end()) { - def_use_mgr_->KillInst(inst); - return true; - } - return false; -} - -void AggressiveDCEPass::ProcessLoad(uint32_t varId) { - // Only process locals - if (!IsLocalVar(varId)) - return; - // Return if already processed - if (live_local_vars_.find(varId) != live_local_vars_.end()) - return; - // Mark all stores to varId as live - AddStores(varId); - // Cache varId as processed - live_local_vars_.insert(varId); -} - -bool AggressiveDCEPass::AggressiveDCE(ir::Function* func) { - bool modified = false; - // Add all control flow and instructions with external side effects - // to worklist - // TODO(greg-lunarg): Handle Frexp, Modf more optimally - call_in_func_ = false; - func_is_entry_point_ = false; - private_stores_.clear(); - for (auto& blk : *func) { - for (auto& inst : blk) { - uint32_t op = inst.opcode(); - switch (op) { - case SpvOpStore: { - uint32_t varId; - (void) GetPtr(&inst, &varId); - // Mark stores as live if their variable is not function scope - // and is not private scope. Remember private stores for possible - // later inclusion - if (IsVarOfStorage(varId, SpvStorageClassPrivate)) - private_stores_.push_back(&inst); - else if (!IsVarOfStorage(varId, SpvStorageClassFunction)) - worklist_.push(&inst); - } break; - case SpvOpExtInst: { - // eg. GLSL frexp, modf - if (!IsCombinatorExt(&inst)) - worklist_.push(&inst); - } break; - default: { - // eg. control flow, function call, atomics, function param, - // function return - // TODO(greg-lunarg): function calls live only if write to non-local - if (!IsCombinator(op)) - worklist_.push(&inst); - // Remember function calls - if (op == SpvOpFunctionCall) - call_in_func_ = true; - } break; - } - } - } - // See if current function is an entry point - for (auto& ei : module_->entry_points()) { - if (ei.GetSingleWordInOperand(kEntryPointFunctionIdInIdx) == - func->result_id()) { - func_is_entry_point_ = true; - break; - } - } - // If the current function is an entry point and has no function calls, - // we can optimize private variables as locals - private_like_local_ = func_is_entry_point_ && !call_in_func_; - // If privates are not like local, add their stores to worklist - if (!private_like_local_) - for (auto& ps : private_stores_) - worklist_.push(ps); - // Add OpGroupDecorates to worklist because they are a pain to remove - // ids from. - // TODO(greg-lunarg): Handle dead ids in OpGroupDecorate - for (auto& ai : module_->annotations()) { - if (ai.opcode() == SpvOpGroupDecorate) - worklist_.push(&ai); - } - // Perform closure on live instruction set. - while (!worklist_.empty()) { - ir::Instruction* liveInst = worklist_.front(); - live_insts_.insert(liveInst); - // Add all operand instructions if not already live - liveInst->ForEachInId([this](const uint32_t* iid) { - ir::Instruction* inInst = def_use_mgr_->GetDef(*iid); - if (live_insts_.find(inInst) == live_insts_.end()) - worklist_.push(inInst); - }); - // If local load, add all variable's stores if variable not already live - if (liveInst->opcode() == SpvOpLoad) { - uint32_t varId; - (void) GetPtr(liveInst, &varId); - ProcessLoad(varId); - } - // If function call, treat as if it loads from all pointer arguments - else if (liveInst->opcode() == SpvOpFunctionCall) { - liveInst->ForEachInId([this](const uint32_t* iid) { - // Skip non-ptr args - if (!IsPtr(*iid)) return; - uint32_t varId; - (void) GetPtr(*iid, &varId); - ProcessLoad(varId); - }); - } - // If function parameter, treat as if it's result id is loaded from - else if (liveInst->opcode() == SpvOpFunctionParameter) { - ProcessLoad(liveInst->result_id()); - } - worklist_.pop(); - } - // Mark all non-live instructions dead - for (auto& blk : *func) { - for (auto& inst : blk) { - if (live_insts_.find(&inst) != live_insts_.end()) - continue; - dead_insts_.insert(&inst); - } - } - // Remove debug and annotation statements referencing dead instructions. - // This must be done before killing the instructions, otherwise there are - // dead objects in the def/use database. - for (auto& di : module_->debugs2()) { - if (di.opcode() != SpvOpName) - continue; - if (KillInstIfTargetDead(&di)) - modified = true; - } - for (auto& ai : module_->annotations()) { - if (ai.opcode() != SpvOpDecorate && ai.opcode() != SpvOpDecorateId) - continue; - if (KillInstIfTargetDead(&ai)) - modified = true; - } - // Kill dead instructions - for (auto& blk : *func) { - for (auto& inst : blk) { - if (dead_insts_.find(&inst) == dead_insts_.end()) - continue; - def_use_mgr_->KillInst(&inst); - modified = true; - } - } - return modified; -} - -void AggressiveDCEPass::Initialize(ir::Module* module) { - module_ = module; - - // Clear collections - worklist_ = std::queue{}; - live_insts_.clear(); - live_local_vars_.clear(); - dead_insts_.clear(); - combinator_ops_shader_.clear(); - combinator_ops_glsl_std_450_.clear(); - - // TODO(greg-lunarg): Reuse def/use from previous passes - def_use_mgr_.reset(new analysis::DefUseManager(consumer(), module_)); - - // Initialize extensions whitelist - InitExtensions(); -} - -Pass::Status AggressiveDCEPass::ProcessImpl() { - // Current functionality assumes shader capability - // TODO(greg-lunarg): Handle additional capabilities - if (!module_->HasCapability(SpvCapabilityShader)) - return Status::SuccessWithoutChange; - // Current functionality assumes logical addressing only - // TODO(greg-lunarg): Handle non-logical addressing - if (module_->HasCapability(SpvCapabilityAddresses)) - return Status::SuccessWithoutChange; - // If any extensions in the module are not explicitly supported, - // return unmodified. - if (!AllExtensionsSupported()) - return Status::SuccessWithoutChange; - // Initialize combinator whitelists - InitCombinatorSets(); - // Process all entry point functions - ProcessFunction pfn = [this](ir::Function* fp) { - return AggressiveDCE(fp); - }; - bool modified = ProcessEntryPointCallTree(pfn, module_); - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -AggressiveDCEPass::AggressiveDCEPass() {} - -Pass::Status AggressiveDCEPass::Process(ir::Module* module) { - Initialize(module); - return ProcessImpl(); -} - -void AggressiveDCEPass::InitCombinatorSets() { - combinator_ops_shader_ = { - SpvOpNop, - SpvOpUndef, - SpvOpVariable, - SpvOpImageTexelPointer, - SpvOpLoad, - SpvOpAccessChain, - SpvOpInBoundsAccessChain, - SpvOpArrayLength, - SpvOpVectorExtractDynamic, - SpvOpVectorInsertDynamic, - SpvOpVectorShuffle, - SpvOpCompositeConstruct, - SpvOpCompositeExtract, - SpvOpCompositeInsert, - SpvOpCopyObject, - SpvOpTranspose, - SpvOpSampledImage, - SpvOpImageSampleImplicitLod, - SpvOpImageSampleExplicitLod, - SpvOpImageSampleDrefImplicitLod, - SpvOpImageSampleDrefExplicitLod, - SpvOpImageSampleProjImplicitLod, - SpvOpImageSampleProjExplicitLod, - SpvOpImageSampleProjDrefImplicitLod, - SpvOpImageSampleProjDrefExplicitLod, - SpvOpImageFetch, - SpvOpImageGather, - SpvOpImageDrefGather, - SpvOpImageRead, - SpvOpImage, - SpvOpConvertFToU, - SpvOpConvertFToS, - SpvOpConvertSToF, - SpvOpConvertUToF, - SpvOpUConvert, - SpvOpSConvert, - SpvOpFConvert, - SpvOpQuantizeToF16, - SpvOpBitcast, - SpvOpSNegate, - SpvOpFNegate, - SpvOpIAdd, - SpvOpFAdd, - SpvOpISub, - SpvOpFSub, - SpvOpIMul, - SpvOpFMul, - SpvOpUDiv, - SpvOpSDiv, - SpvOpFDiv, - SpvOpUMod, - SpvOpSRem, - SpvOpSMod, - SpvOpFRem, - SpvOpFMod, - SpvOpVectorTimesScalar, - SpvOpMatrixTimesScalar, - SpvOpVectorTimesMatrix, - SpvOpMatrixTimesVector, - SpvOpMatrixTimesMatrix, - SpvOpOuterProduct, - SpvOpDot, - SpvOpIAddCarry, - SpvOpISubBorrow, - SpvOpUMulExtended, - SpvOpSMulExtended, - SpvOpAny, - SpvOpAll, - SpvOpIsNan, - SpvOpIsInf, - SpvOpLogicalEqual, - SpvOpLogicalNotEqual, - SpvOpLogicalOr, - SpvOpLogicalAnd, - SpvOpLogicalNot, - SpvOpSelect, - SpvOpIEqual, - SpvOpINotEqual, - SpvOpUGreaterThan, - SpvOpSGreaterThan, - SpvOpUGreaterThanEqual, - SpvOpSGreaterThanEqual, - SpvOpULessThan, - SpvOpSLessThan, - SpvOpULessThanEqual, - SpvOpSLessThanEqual, - SpvOpFOrdEqual, - SpvOpFUnordEqual, - SpvOpFOrdNotEqual, - SpvOpFUnordNotEqual, - SpvOpFOrdLessThan, - SpvOpFUnordLessThan, - SpvOpFOrdGreaterThan, - SpvOpFUnordGreaterThan, - SpvOpFOrdLessThanEqual, - SpvOpFUnordLessThanEqual, - SpvOpFOrdGreaterThanEqual, - SpvOpFUnordGreaterThanEqual, - SpvOpShiftRightLogical, - SpvOpShiftRightArithmetic, - SpvOpShiftLeftLogical, - SpvOpBitwiseOr, - SpvOpBitwiseXor, - SpvOpBitwiseAnd, - SpvOpNot, - SpvOpBitFieldInsert, - SpvOpBitFieldSExtract, - SpvOpBitFieldUExtract, - SpvOpBitReverse, - SpvOpBitCount, - SpvOpDPdx, - SpvOpDPdy, - SpvOpFwidth, - SpvOpDPdxFine, - SpvOpDPdyFine, - SpvOpFwidthFine, - SpvOpDPdxCoarse, - SpvOpDPdyCoarse, - SpvOpFwidthCoarse, - SpvOpPhi, - SpvOpImageSparseSampleImplicitLod, - SpvOpImageSparseSampleExplicitLod, - SpvOpImageSparseSampleDrefImplicitLod, - SpvOpImageSparseSampleDrefExplicitLod, - SpvOpImageSparseSampleProjImplicitLod, - SpvOpImageSparseSampleProjExplicitLod, - SpvOpImageSparseSampleProjDrefImplicitLod, - SpvOpImageSparseSampleProjDrefExplicitLod, - SpvOpImageSparseFetch, - SpvOpImageSparseGather, - SpvOpImageSparseDrefGather, - SpvOpImageSparseTexelsResident, - SpvOpImageSparseRead, - SpvOpSizeOf - // TODO(dneto): Add instructions enabled by ImageQuery - }; - - // Find supported extension instruction set ids - glsl_std_450_id_ = module_->GetExtInstImportId("GLSL.std.450"); - - combinator_ops_glsl_std_450_ = { - GLSLstd450Round, - GLSLstd450RoundEven, - GLSLstd450Trunc, - GLSLstd450FAbs, - GLSLstd450SAbs, - GLSLstd450FSign, - GLSLstd450SSign, - GLSLstd450Floor, - GLSLstd450Ceil, - GLSLstd450Fract, - GLSLstd450Radians, - GLSLstd450Degrees, - GLSLstd450Sin, - GLSLstd450Cos, - GLSLstd450Tan, - GLSLstd450Asin, - GLSLstd450Acos, - GLSLstd450Atan, - GLSLstd450Sinh, - GLSLstd450Cosh, - GLSLstd450Tanh, - GLSLstd450Asinh, - GLSLstd450Acosh, - GLSLstd450Atanh, - GLSLstd450Atan2, - GLSLstd450Pow, - GLSLstd450Exp, - GLSLstd450Log, - GLSLstd450Exp2, - GLSLstd450Log2, - GLSLstd450Sqrt, - GLSLstd450InverseSqrt, - GLSLstd450Determinant, - GLSLstd450MatrixInverse, - GLSLstd450ModfStruct, - GLSLstd450FMin, - GLSLstd450UMin, - GLSLstd450SMin, - GLSLstd450FMax, - GLSLstd450UMax, - GLSLstd450SMax, - GLSLstd450FClamp, - GLSLstd450UClamp, - GLSLstd450SClamp, - GLSLstd450FMix, - GLSLstd450IMix, - GLSLstd450Step, - GLSLstd450SmoothStep, - GLSLstd450Fma, - GLSLstd450FrexpStruct, - GLSLstd450Ldexp, - GLSLstd450PackSnorm4x8, - GLSLstd450PackUnorm4x8, - GLSLstd450PackSnorm2x16, - GLSLstd450PackUnorm2x16, - GLSLstd450PackHalf2x16, - GLSLstd450PackDouble2x32, - GLSLstd450UnpackSnorm2x16, - GLSLstd450UnpackUnorm2x16, - GLSLstd450UnpackHalf2x16, - GLSLstd450UnpackSnorm4x8, - GLSLstd450UnpackUnorm4x8, - GLSLstd450UnpackDouble2x32, - GLSLstd450Length, - GLSLstd450Distance, - GLSLstd450Cross, - GLSLstd450Normalize, - GLSLstd450FaceForward, - GLSLstd450Reflect, - GLSLstd450Refract, - GLSLstd450FindILsb, - GLSLstd450FindSMsb, - GLSLstd450FindUMsb, - GLSLstd450InterpolateAtCentroid, - GLSLstd450InterpolateAtSample, - GLSLstd450InterpolateAtOffset, - GLSLstd450NMin, - GLSLstd450NMax, - GLSLstd450NClamp - }; -} - -void AggressiveDCEPass::InitExtensions() { - extensions_whitelist_.clear(); - extensions_whitelist_.insert({ - "SPV_AMD_shader_explicit_vertex_parameter", - "SPV_AMD_shader_trinary_minmax", - "SPV_AMD_gcn_shader", - "SPV_KHR_shader_ballot", - "SPV_AMD_shader_ballot", - "SPV_AMD_gpu_shader_half_float", - "SPV_KHR_shader_draw_parameters", - "SPV_KHR_subgroup_vote", - "SPV_KHR_16bit_storage", - "SPV_KHR_device_group", - "SPV_KHR_multiview", - "SPV_NVX_multiview_per_view_attributes", - "SPV_NV_viewport_array2", - "SPV_NV_stereo_view_rendering", - "SPV_NV_sample_mask_override_coverage", - "SPV_NV_geometry_shader_passthrough", - "SPV_AMD_texture_gather_bias_lod", - "SPV_KHR_storage_buffer_storage_class", - // SPV_KHR_variable_pointers - // Currently do not support extended pointer expressions - "SPV_AMD_gpu_shader_int16", - "SPV_KHR_post_depth_coverage", - "SPV_KHR_shader_atomic_counter_ops", - }); -} - -} // namespace opt -} // namespace spvtools - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/aggressive_dead_code_elim_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/aggressive_dead_code_elim_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/aggressive_dead_code_elim_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/aggressive_dead_code_elim_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,152 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#ifndef LIBSPIRV_OPT_AGGRESSIVE_DCE_PASS_H_ -#define LIBSPIRV_OPT_AGGRESSIVE_DCE_PASS_H_ - -#include -#include -#include -#include -#include -#include - -#include "basic_block.h" -#include "def_use_manager.h" -#include "module.h" -#include "mem_pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class AggressiveDCEPass : public MemPass { - - using cbb_ptr = const ir::BasicBlock*; - - public: - using GetBlocksFunction = - std::function*(const ir::BasicBlock*)>; - - AggressiveDCEPass(); - const char* name() const override { return "eliminate-dead-code-aggressive"; } - Status Process(ir::Module*) override; - - private: - // Return true if |varId| is variable of |storageClass|. - bool IsVarOfStorage(uint32_t varId, uint32_t storageClass); - - // Return true if |varId| is variable of function storage class or is - // private variable and privates can be optimized like locals (see - // privates_like_local_) - bool IsLocalVar(uint32_t varId); - - // Add all store instruction which use |ptrId|, directly or indirectly, - // to the live instruction worklist. - void AddStores(uint32_t ptrId); - - // Initialize combinator data structures - void InitCombinatorSets(); - - // Return true if core operator |op| has no side-effects. Currently returns - // true only for shader capability operations. - // TODO(greg-lunarg): Add kernel and other operators - bool IsCombinator(uint32_t op) const; - - // Return true if OpExtInst |inst| has no side-effects. Currently returns - // true only for std.GLSL.450 extensions - // TODO(greg-lunarg): Add support for other extensions - bool IsCombinatorExt(ir::Instruction* inst) const; - - // Initialize extensions whitelist - void InitExtensions(); - - // Return true if all extensions in this module are supported by this pass. - bool AllExtensionsSupported() const; - - // Kill debug or annotation |inst| if target operand is dead. Return true - // if inst killed. - bool KillInstIfTargetDead(ir::Instruction* inst); - - // If |varId| is local, mark all stores of varId as live. - void ProcessLoad(uint32_t varId); - - // For function |func|, mark all Stores to non-function-scope variables - // and block terminating instructions as live. Recursively mark the values - // they use. When complete, delete any non-live instructions. Return true - // if the function has been modified. - // - // Note: This function does not delete useless control structures. All - // existing control structures will remain. This can leave not-insignificant - // sequences of ultimately useless code. - // TODO(): Remove useless control constructs. - bool AggressiveDCE(ir::Function* func); - - void Initialize(ir::Module* module); - Pass::Status ProcessImpl(); - - // True if current function has a call instruction contained in it - bool call_in_func_; - - // True if current function is an entry point - bool func_is_entry_point_; - - // True if current function is entry point and has no function calls. - bool private_like_local_; - - // Live Instruction Worklist. An instruction is added to this list - // if it might have a side effect, either directly or indirectly. - // If we don't know, then add it to this list. Instructions are - // removed from this list as the algorithm traces side effects, - // building up the live instructions set |live_insts_|. - std::queue worklist_; - - // Store instructions to variables of private storage - std::vector private_stores_; - - // Live Instructions - std::unordered_set live_insts_; - - // Live Local Variables - std::unordered_set live_local_vars_; - - // Dead instructions. Use for debug cleanup. - std::unordered_set dead_insts_; - - // Opcodes of shader capability core executable instructions - // without side-effect. This is a whitelist of operators - // that can safely be left unmarked as live at the beginning of - // aggressive DCE. - std::unordered_set combinator_ops_shader_; - - // Opcodes of GLSL_std_450 extension executable instructions - // without side-effect. This is a whitelist of operators - // that can safely be left unmarked as live at the beginning of - // aggressive DCE. - std::unordered_set combinator_ops_glsl_std_450_; - - // Extensions supported by this pass. - std::unordered_set extensions_whitelist_; - - // Set id for glsl_std_450 extension instructions - uint32_t glsl_std_450_id_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_AGGRESSIVE_DCE_PASS_H_ - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/basic_block.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/basic_block.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/basic_block.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/basic_block.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "basic_block.h" - -#include "make_unique.h" - -namespace spvtools { -namespace ir { - -BasicBlock::BasicBlock(const BasicBlock& bb) - : function_(nullptr), - label_(MakeUnique(bb.GetLabelInst())), - insts_() { - for (auto& inst : bb.insts_) - AddInstruction(std::unique_ptr(inst.Clone())); -} - -const Instruction* BasicBlock::GetMergeInst() const { - const Instruction* result = nullptr; - // If it exists, the merge instruction immediately precedes the - // terminator. - auto iter = ctail(); - if (iter != cbegin()) { - --iter; - const auto opcode = iter->opcode(); - if (opcode == SpvOpLoopMerge || opcode == SpvOpSelectionMerge) { - result = &*iter; - } - } - return result; -} - -Instruction* BasicBlock::GetMergeInst() { - Instruction* result = nullptr; - // If it exists, the merge instruction immediately precedes the - // terminator. - auto iter = tail(); - if (iter != begin()) { - --iter; - const auto opcode = iter->opcode(); - if (opcode == SpvOpLoopMerge || opcode == SpvOpSelectionMerge) { - result = &*iter; - } - } - return result; -} - -const Instruction* BasicBlock::GetLoopMergeInst() const { - if (auto* merge = GetMergeInst()) { - if (merge->opcode() == SpvOpLoopMerge) { - return merge; - } - } - return nullptr; -} - -Instruction* BasicBlock::GetLoopMergeInst() { - if (auto* merge = GetMergeInst()) { - if (merge->opcode() == SpvOpLoopMerge) { - return merge; - } - } - return nullptr; -} - -void BasicBlock::ForEachSuccessorLabel( - const std::function& f) { - const auto br = &insts_.back(); - switch (br->opcode()) { - case SpvOpBranch: { - f(br->GetOperand(0).words[0]); - } break; - case SpvOpBranchConditional: - case SpvOpSwitch: { - bool is_first = true; - br->ForEachInId([&is_first, &f](const uint32_t* idp) { - if (!is_first) f(*idp); - is_first = false; - }); - } break; - default: - break; - } -} - -void BasicBlock::ForMergeAndContinueLabel( - const std::function& f) { - auto ii = insts_.end(); - --ii; - if (ii == insts_.begin()) return; - --ii; - if (ii->opcode() == SpvOpSelectionMerge || - ii->opcode() == SpvOpLoopMerge) - ii->ForEachInId([&f](const uint32_t* idp) { - f(*idp); - }); -} - -} // namespace ir -} // namespace spvtools - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/basic_block.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/basic_block.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/basic_block.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/basic_block.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,170 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file defines the language constructs for representing a SPIR-V -// module in memory. - -#ifndef LIBSPIRV_OPT_BASIC_BLOCK_H_ -#define LIBSPIRV_OPT_BASIC_BLOCK_H_ - -#include -#include -#include -#include - -#include "instruction.h" -#include "instruction_list.h" -#include "iterator.h" - -namespace spvtools { -namespace ir { - -class Function; - -// A SPIR-V basic block. -class BasicBlock { - public: - using iterator = InstructionList::iterator; - using const_iterator = InstructionList::const_iterator; - - // Creates a basic block with the given starting |label|. - inline explicit BasicBlock(std::unique_ptr label); - - // Creates a basic block from the given basic block |bb|. - // - // The parent function will default to null and needs to be explicitly set by - // the user. - explicit BasicBlock(const BasicBlock& bb); - - // Sets the enclosing function for this basic block. - void SetParent(Function* function) { function_ = function; } - - // Appends an instruction to this basic block. - inline void AddInstruction(std::unique_ptr i); - - // Appends all of block's instructions (except label) to this block - inline void AddInstructions(BasicBlock* bp); - - // The label starting this basic block. - Instruction* GetLabelInst() { return label_.get(); } - const Instruction& GetLabelInst() const { return *label_; } - - // Returns the merge instruction in this basic block, if it exists. - // Otherwise return null. May be used whenever tail() can be used. - const Instruction* GetMergeInst() const; - Instruction* GetMergeInst(); - // Returns the OpLoopMerge instruciton in this basic block, if it exists. - // Otherwise return null. May be used whenever tail() can be used. - const Instruction* GetLoopMergeInst() const; - Instruction* GetLoopMergeInst(); - - // Returns the id of the label at the top of this block - inline uint32_t id() const { return label_->result_id(); } - - iterator begin() { return insts_.begin(); } - iterator end() { return insts_.end(); } - const_iterator cbegin() const { return insts_.cbegin(); } - const_iterator cend() const { return insts_.cend(); } - - // Returns an iterator pointing to the last instruction. This may only - // be used if this block has an instruction other than the OpLabel - // that defines it. - iterator tail() { - assert(!insts_.empty()); - return --end(); - } - // Returns a const iterator, but othewrise similar to tail(). - const_iterator ctail() const { - assert(!insts_.empty()); - return --insts_.cend(); - } - - // Runs the given function |f| on each instruction in this basic block, and - // optionally on the debug line instructions that might precede them. - inline void ForEachInst(const std::function& f, - bool run_on_debug_line_insts = false); - inline void ForEachInst(const std::function& f, - bool run_on_debug_line_insts = false) const; - - // Runs the given function |f| on each Phi instruction in this basic block, - // and optionally on the debug line instructions that might precede them. - inline void ForEachPhiInst(const std::function& f, - bool run_on_debug_line_insts = false); - - // Runs the given function |f| on each label id of each successor block - void ForEachSuccessorLabel(const std::function& f); - - // Runs the given function |f| on the merge and continue label, if any - void ForMergeAndContinueLabel(const std::function& f); - - // Returns true if this basic block has any Phi instructions. - bool HasPhiInstructions() { - int count = 0; - ForEachPhiInst([&count](ir::Instruction*) { - ++count; - return; - }); - return count > 0; - } - - private: - // The enclosing function. - Function* function_; - // The label starting this basic block. - std::unique_ptr label_; - // Instructions inside this basic block, but not the OpLabel. - InstructionList insts_; -}; - -inline BasicBlock::BasicBlock(std::unique_ptr label) - : function_(nullptr), label_(std::move(label)) {} - -inline void BasicBlock::AddInstruction(std::unique_ptr i) { - insts_.push_back(i.release()); -} - -inline void BasicBlock::AddInstructions(BasicBlock* bp) { - auto bEnd = end(); - (void) bEnd.MoveBefore(&bp->insts_); -} - -inline void BasicBlock::ForEachInst(const std::function& f, - bool run_on_debug_line_insts) { - if (label_) label_->ForEachInst(f, run_on_debug_line_insts); - for (auto& inst : insts_) inst.ForEachInst(f, run_on_debug_line_insts); -} - -inline void BasicBlock::ForEachInst( - const std::function& f, - bool run_on_debug_line_insts) const { - if (label_) - static_cast(label_.get()) - ->ForEachInst(f, run_on_debug_line_insts); - for (const auto& inst : insts_) - static_cast(&inst) - ->ForEachInst(f, run_on_debug_line_insts); -} - -inline void BasicBlock::ForEachPhiInst( - const std::function& f, bool run_on_debug_line_insts) { - for (auto& inst : insts_) { - if (inst.opcode() != SpvOpPhi) break; - inst.ForEachInst(f, run_on_debug_line_insts); - } -} - -} // namespace ir -} // namespace spvtools - -#endif // LIBSPIRV_OPT_BASIC_BLOCK_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/block_merge_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/block_merge_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/block_merge_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/block_merge_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,177 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "block_merge_pass.h" - -#include "iterator.h" - -namespace spvtools { -namespace opt { - -bool BlockMergePass::IsLoopHeader(ir::BasicBlock* block_ptr) { - auto iItr = block_ptr->tail(); - if (iItr == block_ptr->begin()) - return false; - --iItr; - return iItr->opcode() == SpvOpLoopMerge; -} - -bool BlockMergePass::HasMultipleRefs(uint32_t labId) { - const analysis::UseList* uses = def_use_mgr_->GetUses(labId); - int rcnt = 0; - for (const auto u : *uses) { - // Don't count OpName - if (u.inst->opcode() == SpvOpName) - continue; - if (rcnt == 1) - return true; - ++rcnt; - } - return false; -} - -void BlockMergePass::KillInstAndName(ir::Instruction* inst) { - const uint32_t id = inst->result_id(); - if (id != 0) { - analysis::UseList* uses = def_use_mgr_->GetUses(id); - if (uses != nullptr) - for (auto u : *uses) - if (u.inst->opcode() == SpvOpName) { - def_use_mgr_->KillInst(u.inst); - break; - } - } - def_use_mgr_->KillInst(inst); -} - -bool BlockMergePass::MergeBlocks(ir::Function* func) { - bool modified = false; - for (auto bi = func->begin(); bi != func->end(); ) { - // Do not merge loop header blocks, at least for now. - if (IsLoopHeader(&*bi)) { - ++bi; - continue; - } - // Find block with single successor which has no other predecessors. - // Continue and Merge blocks are currently ruled out as second blocks. - // Happily any such candidate blocks will have >1 uses due to their - // LoopMerge instruction. - // TODO(): Deal with phi instructions that reference the - // second block. Happily, these references currently inhibit - // the merge. - auto ii = bi->end(); - --ii; - ir::Instruction* br = &*ii; - if (br->opcode() != SpvOpBranch) { - ++bi; - continue; - } - const uint32_t labId = br->GetSingleWordInOperand(0); - if (HasMultipleRefs(labId)) { - ++bi; - continue; - } - // Merge blocks - def_use_mgr_->KillInst(br); - auto sbi = bi; - for (; sbi != func->end(); ++sbi) - if (sbi->id() == labId) - break; - // If bi is sbi's only predecessor, it dominates sbi and thus - // sbi must follow bi in func's ordering. - assert(sbi != func->end()); - bi->AddInstructions(&*sbi); - KillInstAndName(sbi->GetLabelInst()); - (void) sbi.Erase(); - // reprocess block - modified = true; - } - return modified; -} - -void BlockMergePass::Initialize(ir::Module* module) { - - module_ = module; - - // TODO(greg-lunarg): Reuse def/use from previous passes - def_use_mgr_.reset(new analysis::DefUseManager(consumer(), module_)); - - // Initialize extension whitelist - InitExtensions(); -}; - -bool BlockMergePass::AllExtensionsSupported() const { - // If any extension not in whitelist, return false - for (auto& ei : module_->extensions()) { - const char* extName = reinterpret_cast( - &ei.GetInOperand(0).words[0]); - if (extensions_whitelist_.find(extName) == extensions_whitelist_.end()) - return false; - } - return true; -} - -Pass::Status BlockMergePass::ProcessImpl() { - // Do not process if any disallowed extensions are enabled - if (!AllExtensionsSupported()) - return Status::SuccessWithoutChange; - // Process all entry point functions. - ProcessFunction pfn = [this](ir::Function* fp) { - return MergeBlocks(fp); - }; - bool modified = ProcessEntryPointCallTree(pfn, module_); - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -BlockMergePass::BlockMergePass() - : module_(nullptr), def_use_mgr_(nullptr) {} - -Pass::Status BlockMergePass::Process(ir::Module* module) { - Initialize(module); - return ProcessImpl(); -} - -void BlockMergePass::InitExtensions() { - extensions_whitelist_.clear(); - extensions_whitelist_.insert({ - "SPV_AMD_shader_explicit_vertex_parameter", - "SPV_AMD_shader_trinary_minmax", - "SPV_AMD_gcn_shader", - "SPV_KHR_shader_ballot", - "SPV_AMD_shader_ballot", - "SPV_AMD_gpu_shader_half_float", - "SPV_KHR_shader_draw_parameters", - "SPV_KHR_subgroup_vote", - "SPV_KHR_16bit_storage", - "SPV_KHR_device_group", - "SPV_KHR_multiview", - "SPV_NVX_multiview_per_view_attributes", - "SPV_NV_viewport_array2", - "SPV_NV_stereo_view_rendering", - "SPV_NV_sample_mask_override_coverage", - "SPV_NV_geometry_shader_passthrough", - "SPV_AMD_texture_gather_bias_lod", - "SPV_KHR_storage_buffer_storage_class", - "SPV_KHR_variable_pointers", - "SPV_AMD_gpu_shader_int16", - "SPV_KHR_post_depth_coverage", - "SPV_KHR_shader_atomic_counter_ops", - }); -} - -} // namespace opt -} // namespace spvtools - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/block_merge_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/block_merge_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/block_merge_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/block_merge_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,79 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#ifndef LIBSPIRV_OPT_BLOCK_MERGE_PASS_H_ -#define LIBSPIRV_OPT_BLOCK_MERGE_PASS_H_ - -#include -#include -#include -#include -#include -#include - -#include "basic_block.h" -#include "def_use_manager.h" -#include "module.h" -#include "pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class BlockMergePass : public Pass { - public: - BlockMergePass(); - const char* name() const override { return "merge-blocks"; } - Status Process(ir::Module*) override; - - private: - // Return true if |block_ptr| is loop header block - bool IsLoopHeader(ir::BasicBlock* block_ptr); - - // Return true if |labId| has multiple refs. Do not count OpName. - bool HasMultipleRefs(uint32_t labId); - - // Kill any OpName instruction referencing |inst|, then kill |inst|. - void KillInstAndName(ir::Instruction* inst); - - // Search |func| for blocks which have a single Branch to a block - // with no other predecessors. Merge these blocks into a single block. - bool MergeBlocks(ir::Function* func); - - // Initialize extensions whitelist - void InitExtensions(); - - // Return true if all extensions in this module are allowed by this pass. - bool AllExtensionsSupported() const; - - void Initialize(ir::Module* module); - Pass::Status ProcessImpl(); - - // Module this pass is processing - ir::Module* module_; - - // Def-Uses for the module we are processing - std::unique_ptr def_use_mgr_; - - // Extensions supported by this pass. - std::unordered_set extensions_whitelist_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_BLOCK_MERGE_PASS_H_ - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/build_module.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/build_module.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/build_module.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/build_module.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "build_module.h" - -#include "ir_loader.h" -#include "make_unique.h" -#include "table.h" - -namespace spvtools { - -namespace { - -// Sets the module header for IrLoader. Meets the interface requirement of -// spvBinaryParse(). -spv_result_t SetSpvHeader(void* builder, spv_endianness_t, uint32_t magic, - uint32_t version, uint32_t generator, - uint32_t id_bound, uint32_t reserved) { - reinterpret_cast(builder) - ->SetModuleHeader(magic, version, generator, id_bound, reserved); - return SPV_SUCCESS; -}; - -// Processes a parsed instruction for IrLoader. Meets the interface requirement -// of spvBinaryParse(). -spv_result_t SetSpvInst(void* builder, const spv_parsed_instruction_t* inst) { - if (reinterpret_cast(builder)->AddInstruction(inst)) { - return SPV_SUCCESS; - } - return SPV_ERROR_INVALID_BINARY; -}; - -} // annoymous namespace - -std::unique_ptr BuildModule(spv_target_env env, - MessageConsumer consumer, - const uint32_t* binary, - const size_t size) { - auto context = spvContextCreate(env); - SetContextMessageConsumer(context, consumer); - - auto module = MakeUnique(); - ir::IrLoader loader(context->consumer, module.get()); - - spv_result_t status = spvBinaryParse(context, &loader, binary, size, - SetSpvHeader, SetSpvInst, nullptr); - loader.EndModule(); - - spvContextDestroy(context); - - return status == SPV_SUCCESS ? std::move(module) : nullptr; -} - -std::unique_ptr BuildModule(spv_target_env env, - MessageConsumer consumer, - const std::string& text, - uint32_t assemble_options) { - SpirvTools t(env); - t.SetMessageConsumer(consumer); - std::vector binary; - if (!t.Assemble(text, &binary, assemble_options)) return nullptr; - return BuildModule(env, consumer, binary.data(), binary.size()); -} - -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/build_module.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/build_module.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/build_module.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/build_module.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SPIRV_TOOLS_OPT_BUILD_MODULE_H_ -#define SPIRV_TOOLS_OPT_BUILD_MODULE_H_ - -#include -#include - -#include "module.h" -#include "spirv-tools/libspirv.hpp" - -namespace spvtools { - -// Builds and returns an ir::Module from the given SPIR-V |binary|. |size| -// specifies number of words in |binary|. The |binary| will be decoded -// according to the given target |env|. Returns nullptr if erors occur and -// sends the errors to |consumer|. -std::unique_ptr BuildModule( - spv_target_env env, MessageConsumer consumer, const uint32_t* binary, - size_t size); - -// Builds and returns an ir::Module from the given SPIR-V assembly |text|. -// The |text| will be encoded according to the given target |env|. Returns -// nullptr if erors occur and sends the errors to |consumer|. -std::unique_ptr BuildModule( - spv_target_env env, MessageConsumer consumer, const std::string& text, - uint32_t assemble_options = SpirvTools::kDefaultAssembleOption); - -} // namespace spvtools - -#endif // SPIRV_TOOLS_OPT_BUILD_MODULE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/cfg_cleanup_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/cfg_cleanup_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/cfg_cleanup_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/cfg_cleanup_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,285 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file implements a pass to cleanup the CFG to remove superfluous -// constructs (e.g., unreachable basic blocks, empty control flow structures, -// etc) - -#include -#include - -#include "cfg_cleanup_pass.h" - -#include "function.h" -#include "module.h" - -namespace spvtools { -namespace opt { - -uint32_t CFGCleanupPass::TypeToUndef(uint32_t type_id) { - const auto uitr = type2undefs_.find(type_id); - if (uitr != type2undefs_.end()) { - return uitr->second; - } - - const uint32_t undefId = TakeNextId(); - std::unique_ptr undef_inst( - new ir::Instruction(SpvOpUndef, type_id, undefId, {})); - def_use_mgr_->AnalyzeInstDefUse(&*undef_inst); - module_->AddGlobalValue(std::move(undef_inst)); - type2undefs_[type_id] = undefId; - - return undefId; -} - -// Remove all |phi| operands coming from unreachable blocks (i.e., blocks not in -// |reachable_blocks|). There are two types of removal that this function can -// perform: -// -// 1- Any operand that comes directly from an unreachable block is completely -// removed. Since the block is unreachable, the edge between the unreachable -// block and the block holding |phi| has been removed. -// -// 2- Any operand that comes via a live block and was defined at an unreachable -// block gets its value replaced with an OpUndef value. Since the argument -// was generated in an unreachable block, it no longer exists, so it cannot -// be referenced. However, since the value does not reach |phi| directly -// from the unreachable block, the operand cannot be removed from |phi|. -// Therefore, we replace the argument value with OpUndef. -// -// For example, in the switch() below, assume that we want to remove the -// argument with value %11 coming from block %41. -// -// [ ... ] -// %41 = OpLabel <--- Unreachable block -// %11 = OpLoad %int %y -// [ ... ] -// OpSelectionMerge %16 None -// OpSwitch %12 %16 10 %13 13 %14 18 %15 -// %13 = OpLabel -// OpBranch %16 -// %14 = OpLabel -// OpStore %outparm %int_14 -// OpBranch %16 -// %15 = OpLabel -// OpStore %outparm %int_15 -// OpBranch %16 -// %16 = OpLabel -// %30 = OpPhi %int %11 %41 %int_42 %13 %11 %14 %11 %15 -// -// Since %41 is now an unreachable block, the first operand of |phi| needs to -// be removed completely. But the operands (%11 %14) and (%11 %15) cannot be -// removed because %14 and %15 are reachable blocks. Since %11 no longer exist, -// in those arguments, we replace all references to %11 with an OpUndef value. -// This results in |phi| looking like: -// -// %50 = OpUndef %int -// [ ... ] -// %30 = OpPhi %int %int_42 %13 %50 %14 %50 %15 -void CFGCleanupPass::RemovePhiOperands( - ir::Instruction* phi, - std::unordered_set reachable_blocks) { - std::vector keep_operands; - uint32_t type_id = 0; - // The id of an undefined value we've generated. - uint32_t undef_id = 0; - - // Traverse all the operands in |phi|. Build the new operand vector by adding - // all the original operands from |phi| except the unwanted ones. - for (uint32_t i = 0; i < phi->NumOperands();) { - if (i < 2) { - // The first two arguments are always preserved. - keep_operands.push_back(phi->GetOperand(i)); - ++i; - continue; - } - - // The remaining Phi arguments come in pairs. Index 'i' contains the - // variable id, index 'i + 1' is the originating block id. - assert(i % 2 == 0 && i < phi->NumOperands() - 1 && - "malformed Phi arguments"); - - ir::BasicBlock *in_block = label2block_[phi->GetSingleWordOperand(i + 1)]; - if (reachable_blocks.find(in_block) == reachable_blocks.end()) { - // If the incoming block is unreachable, remove both operands as this - // means that the |phi| has lost an incoming edge. - i += 2; - continue; - } - - // In all other cases, the operand must be kept but may need to be changed. - uint32_t arg_id = phi->GetSingleWordOperand(i); - ir::BasicBlock *def_block = def_block_[arg_id]; - if (def_block && - reachable_blocks.find(def_block_[arg_id]) == reachable_blocks.end()) { - // If the current |phi| argument was defined in an unreachable block, it - // means that this |phi| argument is no longer defined. Replace it with - // |undef_id|. - if (!undef_id) { - type_id = def_use_mgr_->GetDef(arg_id)->type_id(); - undef_id = TypeToUndef(type_id); - } - keep_operands.push_back( - ir::Operand(spv_operand_type_t::SPV_OPERAND_TYPE_ID, {undef_id})); - } else { - // Otherwise, the argument comes from a reachable block or from no block - // at all (meaning that it was defined in the global section of the - // program). In both cases, keep the argument intact. - keep_operands.push_back(phi->GetOperand(i)); - } - - keep_operands.push_back(phi->GetOperand(i + 1)); - - i += 2; - } - - phi->ReplaceOperands(keep_operands); -} - -void CFGCleanupPass::RemoveBlock(ir::Function::iterator* bi) { - auto& rm_block = **bi; - - // Remove instructions from the block. - rm_block.ForEachInst([&rm_block, this](ir::Instruction* inst) { - // Note that we do not kill the block label instruction here. The label - // instruction is needed to identify the block, which is needed by the - // removal of phi operands. - if (inst != rm_block.GetLabelInst()) { - KillNamesAndDecorates(inst); - def_use_mgr_->KillInst(inst); - } - }); - - // Remove the label instruction last. - auto label = rm_block.GetLabelInst(); - KillNamesAndDecorates(label); - def_use_mgr_->KillInst(label); - - *bi = bi->Erase(); -} - -bool CFGCleanupPass::RemoveUnreachableBlocks(ir::Function* func) { - bool modified = false; - - // Mark reachable all blocks reachable from the function's entry block. - std::unordered_set reachable_blocks; - std::unordered_set visited_blocks; - std::queue worklist; - reachable_blocks.insert(func->entry().get()); - - // Initially mark the function entry point as reachable. - worklist.push(func->entry().get()); - - auto mark_reachable = [&reachable_blocks, &visited_blocks, &worklist, - this](uint32_t label_id) { - auto successor = label2block_[label_id]; - if (visited_blocks.count(successor) == 0) { - reachable_blocks.insert(successor); - worklist.push(successor); - visited_blocks.insert(successor); - } - }; - - // Transitively mark all blocks reachable from the entry as reachable. - while (!worklist.empty()) { - ir::BasicBlock* block = worklist.front(); - worklist.pop(); - - // All the successors of a live block are also live. - block->ForEachSuccessorLabel(mark_reachable); - - // All the Merge and ContinueTarget blocks of a live block are also live. - block->ForMergeAndContinueLabel(mark_reachable); - } - - // Update operands of Phi nodes that reference unreachable blocks. - for (auto& block : *func) { - // If the block is about to be removed, don't bother updating its - // Phi instructions. - if (reachable_blocks.count(&block) == 0) { - continue; - } - - // If the block is reachable and has Phi instructions, remove all - // operands from its Phi instructions that reference unreachable blocks. - // If the block has no Phi instructions, this is a no-op. - block.ForEachPhiInst( - [&block, &reachable_blocks, this](ir::Instruction* phi) { - RemovePhiOperands(phi, reachable_blocks); - }); - } - - // Erase unreachable blocks. - for (auto ebi = func->begin(); ebi != func->end();) { - if (reachable_blocks.count(&*ebi) == 0) { - RemoveBlock(&ebi); - modified = true; - } else { - ++ebi; - } - } - - return modified; -} - -bool CFGCleanupPass::CFGCleanup(ir::Function* func) { - bool modified = false; - modified |= RemoveUnreachableBlocks(func); - return modified; -} - -void CFGCleanupPass::Initialize(ir::Module* module) { - // Initialize the DefUse manager. TODO(dnovillo): Re-factor all this into the - // module or some other context class for the optimizer. - module_ = module; - def_use_mgr_.reset(new analysis::DefUseManager(consumer(), module)); - FindNamedOrDecoratedIds(); - - // Initialize next unused Id. TODO(dnovillo): Re-factor into the module or - // some other context class for the optimizer. - next_id_ = module_->id_bound(); - - // Initialize block lookup map. - label2block_.clear(); - for (auto& fn : *module) { - for (auto& block : fn) { - label2block_[block.id()] = █ - - // Build a map between SSA names to the block they are defined in. - // TODO(dnovillo): This is expensive and unnecessary if ir::Instruction - // instances could figure out what basic block they belong to. Remove this - // once this is possible. - block.ForEachInst([this, &block](ir::Instruction* inst) { - uint32_t result_id = inst->result_id(); - if (result_id > 0) { - def_block_[result_id] = █ - } - }); - } - } -} - -Pass::Status CFGCleanupPass::Process(ir::Module* module) { - Initialize(module); - - // Process all entry point functions. - ProcessFunction pfn = [this](ir::Function* fp) { return CFGCleanup(fp); }; - bool modified = ProcessReachableCallTree(pfn, module); - FinalizeNextId(module_); - return modified ? Pass::Status::SuccessWithChange - : Pass::Status::SuccessWithoutChange; -} - -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/cfg_cleanup_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/cfg_cleanup_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/cfg_cleanup_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/cfg_cleanup_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_CFG_CLEANUP_PASS_H_ -#define LIBSPIRV_OPT_CFG_CLEANUP_PASS_H_ - -#include "function.h" -#include "mem_pass.h" -#include "module.h" - -namespace spvtools { -namespace opt { - -class CFGCleanupPass : public MemPass { - public: - CFGCleanupPass() = default; - const char* name() const override { return "cfg-cleanup"; } - Status Process(ir::Module*) override; - - private: - // Call all the cleanup helper functions on |func|. - bool CFGCleanup(ir::Function* func); - - // Remove all the unreachable basic blocks in |func|. - bool RemoveUnreachableBlocks(ir::Function* func); - - // Remove the block pointed by the iterator |*bi|. This also removes - // all the instructions in the pointed-to block. - void RemoveBlock(ir::Function::iterator* bi); - - // Initialize the pass. - void Initialize(ir::Module* module); - - // Remove Phi operands in |phi| that are coming from blocks not in - // |reachable_blocks|. - void RemovePhiOperands(ir::Instruction* phi, - std::unordered_set reachable_blocks); - - // Return the next available Id and increment it. TODO(dnovillo): Refactor - // into a new type pool manager to be used for all passes. - inline uint32_t TakeNextId() { return next_id_++; } - - // Save next available id into |module|. TODO(dnovillo): Refactor - // into a new type pool manager to be used for all passes. - inline void FinalizeNextId(ir::Module* module) { - module->SetIdBound(next_id_); - } - - // Return undef in function for type. Create and insert an undef after the - // first non-variable in the function if it doesn't already exist. Add - // undef to function undef map. TODO(dnovillo): Refactor into a new - // type pool manager to be used for all passes. - uint32_t TypeToUndef(uint32_t type_id); - - // Map from block's label id to block. TODO(dnovillo): Basic blocks ought to - // have basic blocks in their pred/succ list. - std::unordered_map label2block_; - - // Map from an instruction result ID to the block that holds it. - // TODO(dnovillo): This would be unnecessary if ir::Instruction instances - // knew what basic block they belong to. - std::unordered_map def_block_; - - // Map from type to undef values. TODO(dnovillo): This is replicated from - // class LocalMultiStoreElimPass. It should be refactored into a type - // pool manager. - std::unordered_map type2undefs_; - - // Next unused ID. TODO(dnovillo): Refactor this to some common utility class. - // Seems to be implemented in very many passes. - uint32_t next_id_; -}; - -} // namespace opt -} // namespace spvtools - -#endif diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,120 +0,0 @@ -# Copyright (c) 2016 Google 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. -add_library(SPIRV-Tools-opt - aggressive_dead_code_elim_pass.h - basic_block.h - block_merge_pass.h - build_module.h - cfg_cleanup_pass.h - common_uniform_elim_pass.h - compact_ids_pass.h - constants.h - dead_branch_elim_pass.h - dead_variable_elimination.h - decoration_manager.h - def_use_manager.h - eliminate_dead_constant_pass.h - flatten_decoration_pass.h - function.h - fold.h - fold_spec_constant_op_and_composite_pass.h - freeze_spec_constant_value_pass.h - inline_pass.h - inline_exhaustive_pass.h - inline_opaque_pass.h - insert_extract_elim.h - instruction.h - ir_loader.h - local_access_chain_convert_pass.h - local_single_block_elim_pass.h - local_single_store_elim_pass.h - local_ssa_elim_pass.h - log.h - module.h - null_pass.h - reflect.h - mem_pass.h - pass.h - passes.h - pass_manager.h - eliminate_dead_functions_pass.h - remove_duplicates_pass.h - set_spec_constant_default_value_pass.h - strength_reduction_pass.h - strip_debug_info_pass.h - types.h - type_manager.h - unify_const_pass.h - - aggressive_dead_code_elim_pass.cpp - basic_block.cpp - block_merge_pass.cpp - build_module.cpp - cfg_cleanup_pass.cpp - common_uniform_elim_pass.cpp - compact_ids_pass.cpp - decoration_manager.cpp - def_use_manager.cpp - dead_branch_elim_pass.cpp - dead_variable_elimination.cpp - eliminate_dead_constant_pass.cpp - flatten_decoration_pass.cpp - fold.cpp - fold_spec_constant_op_and_composite_pass.cpp - freeze_spec_constant_value_pass.cpp - function.cpp - inline_pass.cpp - inline_exhaustive_pass.cpp - inline_opaque_pass.cpp - insert_extract_elim.cpp - instruction.cpp - ir_loader.cpp - local_access_chain_convert_pass.cpp - local_single_block_elim_pass.cpp - local_single_store_elim_pass.cpp - local_ssa_elim_pass.cpp - module.cpp - eliminate_dead_functions_pass.cpp - remove_duplicates_pass.cpp - set_spec_constant_default_value_pass.cpp - optimizer.cpp - mem_pass.cpp - pass.cpp - pass_manager.cpp - strength_reduction_pass.cpp - strip_debug_info_pass.cpp - types.cpp - type_manager.cpp - unify_const_pass.cpp - instruction_list.cpp) - -spvtools_default_compile_options(SPIRV-Tools-opt) -target_include_directories(SPIRV-Tools-opt - PUBLIC ${spirv-tools_SOURCE_DIR}/include - PUBLIC ${SPIRV_HEADER_INCLUDE_DIR} - PRIVATE ${spirv-tools_BINARY_DIR} -) -# We need the assembling and disassembling functionalities in the main library. -target_link_libraries(SPIRV-Tools-opt - PUBLIC ${SPIRV_TOOLS}) - -set_property(TARGET SPIRV-Tools-opt PROPERTY FOLDER "SPIRV-Tools libraries") - -if(ENABLE_SPIRV_TOOLS_INSTALL) - install(TARGETS SPIRV-Tools-opt - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -endif(ENABLE_SPIRV_TOOLS_INSTALL) - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/common_uniform_elim_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/common_uniform_elim_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/common_uniform_elim_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/common_uniform_elim_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,622 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "common_uniform_elim_pass.h" - -#include "cfa.h" -#include "iterator.h" - -namespace spvtools { -namespace opt { - -namespace { - -const uint32_t kAccessChainPtrIdInIdx = 0; -const uint32_t kTypePointerStorageClassInIdx = 0; -const uint32_t kTypePointerTypeIdInIdx = 1; -const uint32_t kConstantValueInIdx = 0; -const uint32_t kExtractCompositeIdInIdx = 0; -const uint32_t kExtractIdx0InIdx = 1; -const uint32_t kSelectionMergeMergeBlockIdInIdx = 0; -const uint32_t kLoopMergeMergeBlockIdInIdx = 0; -const uint32_t kLoopMergeContinueBlockIdInIdx = 1; -const uint32_t kStorePtrIdInIdx = 0; -const uint32_t kLoadPtrIdInIdx = 0; -const uint32_t kCopyObjectOperandInIdx = 0; -const uint32_t kTypeIntWidthInIdx = 0; - -} // anonymous namespace - -bool CommonUniformElimPass::IsNonPtrAccessChain(const SpvOp opcode) const { - return opcode == SpvOpAccessChain || opcode == SpvOpInBoundsAccessChain; -} - -bool CommonUniformElimPass::IsSamplerOrImageType( - const ir::Instruction* typeInst) const { - switch (typeInst->opcode()) { - case SpvOpTypeSampler: - case SpvOpTypeImage: - case SpvOpTypeSampledImage: - return true; - default: - break; - } - if (typeInst->opcode() != SpvOpTypeStruct) - return false; - // Return true if any member is a sampler or image - int samplerOrImageCnt = 0; - typeInst->ForEachInId([&samplerOrImageCnt, this](const uint32_t* tid) { - const ir::Instruction* compTypeInst = def_use_mgr_->GetDef(*tid); - if (IsSamplerOrImageType(compTypeInst)) ++samplerOrImageCnt; - }); - return samplerOrImageCnt > 0; -} - -bool CommonUniformElimPass::IsSamplerOrImageVar( - uint32_t varId) const { - const ir::Instruction* varInst = def_use_mgr_->GetDef(varId); - assert(varInst->opcode() == SpvOpVariable); - const uint32_t varTypeId = varInst->type_id(); - const ir::Instruction* varTypeInst = def_use_mgr_->GetDef(varTypeId); - const uint32_t varPteTypeId = - varTypeInst->GetSingleWordInOperand(kTypePointerTypeIdInIdx); - ir::Instruction* varPteTypeInst = def_use_mgr_->GetDef(varPteTypeId); - return IsSamplerOrImageType(varPteTypeInst); -} - -bool CommonUniformElimPass::IsLoopHeader(ir::BasicBlock* block_ptr) { - auto iItr = block_ptr->tail(); - if (iItr == block_ptr->begin()) - return false; - --iItr; - return iItr->opcode() == SpvOpLoopMerge; -} - -uint32_t CommonUniformElimPass::MergeBlockIdIfAny(const ir::BasicBlock& blk, - uint32_t* cbid) { - auto merge_ii = blk.cend(); - --merge_ii; - *cbid = 0; - uint32_t mbid = 0; - if (merge_ii != blk.cbegin()) { - --merge_ii; - if (merge_ii->opcode() == SpvOpLoopMerge) { - mbid = merge_ii->GetSingleWordInOperand(kLoopMergeMergeBlockIdInIdx); - *cbid = merge_ii->GetSingleWordInOperand(kLoopMergeContinueBlockIdInIdx); - } - else if (merge_ii->opcode() == SpvOpSelectionMerge) { - mbid = merge_ii->GetSingleWordInOperand(kSelectionMergeMergeBlockIdInIdx); - } - } - return mbid; -} - -ir::Instruction* CommonUniformElimPass::GetPtr( - ir::Instruction* ip, uint32_t* objId) { - const SpvOp op = ip->opcode(); - assert(op == SpvOpStore || op == SpvOpLoad); - *objId = ip->GetSingleWordInOperand( - op == SpvOpStore ? kStorePtrIdInIdx : kLoadPtrIdInIdx); - ir::Instruction* ptrInst = def_use_mgr_->GetDef(*objId); - while (ptrInst->opcode() == SpvOpCopyObject) { - *objId = ptrInst->GetSingleWordInOperand(kCopyObjectOperandInIdx); - ptrInst = def_use_mgr_->GetDef(*objId); - } - ir::Instruction* objInst = ptrInst; - while (objInst->opcode() != SpvOpVariable && - objInst->opcode() != SpvOpFunctionParameter) { - if (IsNonPtrAccessChain(objInst->opcode())) { - *objId = objInst->GetSingleWordInOperand(kAccessChainPtrIdInIdx); - } - else { - assert(objInst->opcode() == SpvOpCopyObject); - *objId = objInst->GetSingleWordInOperand(kCopyObjectOperandInIdx); - } - objInst = def_use_mgr_->GetDef(*objId); - } - return ptrInst; -} - -bool CommonUniformElimPass::IsUniformVar(uint32_t varId) { - const ir::Instruction* varInst = - def_use_mgr_->id_to_defs().find(varId)->second; - if (varInst->opcode() != SpvOpVariable) - return false; - const uint32_t varTypeId = varInst->type_id(); - const ir::Instruction* varTypeInst = - def_use_mgr_->id_to_defs().find(varTypeId)->second; - return varTypeInst->GetSingleWordInOperand(kTypePointerStorageClassInIdx) == - SpvStorageClassUniform || - varTypeInst->GetSingleWordInOperand(kTypePointerStorageClassInIdx) == - SpvStorageClassUniformConstant; -} - -bool CommonUniformElimPass::HasUnsupportedDecorates(uint32_t id) const { - analysis::UseList* uses = def_use_mgr_->GetUses(id); - if (uses == nullptr) - return false; - for (auto u : *uses) { - const SpvOp op = u.inst->opcode(); - if (IsNonTypeDecorate(op)) - return true; - } - return false; -} - -bool CommonUniformElimPass::HasOnlyNamesAndDecorates(uint32_t id) const { - analysis::UseList* uses = def_use_mgr_->GetUses(id); - if (uses == nullptr) - return true; - for (auto u : *uses) { - const SpvOp op = u.inst->opcode(); - if (op != SpvOpName && !IsNonTypeDecorate(op)) - return false; - } - return true; -} - -void CommonUniformElimPass::KillNamesAndDecorates(uint32_t id) { - // TODO(greg-lunarg): Remove id from any OpGroupDecorate and - // kill if no other operands. - analysis::UseList* uses = def_use_mgr_->GetUses(id); - if (uses == nullptr) - return; - std::list killList; - for (auto u : *uses) { - const SpvOp op = u.inst->opcode(); - if (op != SpvOpName && !IsNonTypeDecorate(op)) - continue; - killList.push_back(u.inst); - } - for (auto kip : killList) - def_use_mgr_->KillInst(kip); -} - -void CommonUniformElimPass::KillNamesAndDecorates(ir::Instruction* inst) { - // TODO(greg-lunarg): Remove inst from any OpGroupDecorate and - // kill if not other operands. - const uint32_t rId = inst->result_id(); - if (rId == 0) - return; - KillNamesAndDecorates(rId); -} - -void CommonUniformElimPass::DeleteIfUseless(ir::Instruction* inst) { - const uint32_t resId = inst->result_id(); - assert(resId != 0); - if (HasOnlyNamesAndDecorates(resId)) { - KillNamesAndDecorates(resId); - def_use_mgr_->KillInst(inst); - } -} - -void CommonUniformElimPass::ReplaceAndDeleteLoad(ir::Instruction* loadInst, - uint32_t replId, - ir::Instruction* ptrInst) { - const uint32_t loadId = loadInst->result_id(); - KillNamesAndDecorates(loadId); - (void) def_use_mgr_->ReplaceAllUsesWith(loadId, replId); - // remove load instruction - def_use_mgr_->KillInst(loadInst); - // if access chain, see if it can be removed as well - if (IsNonPtrAccessChain(ptrInst->opcode())) - DeleteIfUseless(ptrInst); -} - -uint32_t CommonUniformElimPass::GetPointeeTypeId(const ir::Instruction* ptrInst) { - const uint32_t ptrTypeId = ptrInst->type_id(); - const ir::Instruction* ptrTypeInst = def_use_mgr_->GetDef(ptrTypeId); - return ptrTypeInst->GetSingleWordInOperand(kTypePointerTypeIdInIdx); -} - -void CommonUniformElimPass::GenACLoadRepl(const ir::Instruction* ptrInst, - std::vector>* newInsts, - uint32_t* resultId) { - - // Build and append Load - const uint32_t ldResultId = TakeNextId(); - const uint32_t varId = - ptrInst->GetSingleWordInOperand(kAccessChainPtrIdInIdx); - const ir::Instruction* varInst = def_use_mgr_->GetDef(varId); - assert(varInst->opcode() == SpvOpVariable); - const uint32_t varPteTypeId = GetPointeeTypeId(varInst); - std::vector load_in_operands; - load_in_operands.push_back( - ir::Operand(spv_operand_type_t::SPV_OPERAND_TYPE_ID, - std::initializer_list{varId})); - std::unique_ptr newLoad(new ir::Instruction(SpvOpLoad, - varPteTypeId, ldResultId, load_in_operands)); - def_use_mgr_->AnalyzeInstDefUse(&*newLoad); - newInsts->emplace_back(std::move(newLoad)); - - // Build and append Extract - const uint32_t extResultId = TakeNextId(); - const uint32_t ptrPteTypeId = GetPointeeTypeId(ptrInst); - std::vector ext_in_opnds; - ext_in_opnds.push_back( - ir::Operand(spv_operand_type_t::SPV_OPERAND_TYPE_ID, - std::initializer_list{ldResultId})); - uint32_t iidIdx = 0; - ptrInst->ForEachInId([&iidIdx, &ext_in_opnds, this](const uint32_t *iid) { - if (iidIdx > 0) { - const ir::Instruction* cInst = def_use_mgr_->GetDef(*iid); - uint32_t val = cInst->GetSingleWordInOperand(kConstantValueInIdx); - ext_in_opnds.push_back( - ir::Operand(spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - std::initializer_list{val})); - } - ++iidIdx; - }); - std::unique_ptr newExt(new ir::Instruction( - SpvOpCompositeExtract, ptrPteTypeId, extResultId, ext_in_opnds)); - def_use_mgr_->AnalyzeInstDefUse(&*newExt); - newInsts->emplace_back(std::move(newExt)); - *resultId = extResultId; -} - -bool CommonUniformElimPass::IsConstantIndexAccessChain(ir::Instruction* acp) { - uint32_t inIdx = 0; - uint32_t nonConstCnt = 0; - acp->ForEachInId([&inIdx, &nonConstCnt, this](uint32_t* tid) { - if (inIdx > 0) { - ir::Instruction* opInst = def_use_mgr_->GetDef(*tid); - if (opInst->opcode() != SpvOpConstant) ++nonConstCnt; - } - ++inIdx; - }); - return nonConstCnt == 0; -} - -bool CommonUniformElimPass::UniformAccessChainConvert(ir::Function* func) { - bool modified = false; - for (auto bi = func->begin(); bi != func->end(); ++bi) { - for (auto ii = bi->begin(); ii != bi->end(); ++ii) { - if (ii->opcode() != SpvOpLoad) - continue; - uint32_t varId; - ir::Instruction* ptrInst = GetPtr(&*ii, &varId); - if (!IsNonPtrAccessChain(ptrInst->opcode())) - continue; - // Do not convert nested access chains - if (ptrInst->GetSingleWordInOperand(kAccessChainPtrIdInIdx) != varId) - continue; - if (!IsUniformVar(varId)) - continue; - if (!IsConstantIndexAccessChain(ptrInst)) - continue; - if (HasUnsupportedDecorates(ii->result_id())) - continue; - if (HasUnsupportedDecorates(ptrInst->result_id())) - continue; - std::vector> newInsts; - uint32_t replId; - GenACLoadRepl(ptrInst, &newInsts, &replId); - ReplaceAndDeleteLoad(&*ii, replId, ptrInst); - ++ii; - ii = ii.InsertBefore(std::move(newInsts)); - ++ii; - modified = true; - } - } - return modified; -} - -void CommonUniformElimPass::ComputeStructuredSuccessors(ir::Function* func) { - for (auto& blk : *func) { - // If header, make merge block first successor. - uint32_t cbid; - const uint32_t mbid = MergeBlockIdIfAny(blk, &cbid); - if (mbid != 0) { - block2structured_succs_[&blk].push_back(id2block_[mbid]); - if (cbid != 0) - block2structured_succs_[&blk].push_back(id2block_[cbid]); - } - // add true successors - blk.ForEachSuccessorLabel([&blk, this](uint32_t sbid) { - block2structured_succs_[&blk].push_back(id2block_[sbid]); - }); - } -} - -void CommonUniformElimPass::ComputeStructuredOrder( - ir::Function* func, std::list* order) { - // Compute structured successors and do DFS - ComputeStructuredSuccessors(func); - auto ignore_block = [](cbb_ptr) {}; - auto ignore_edge = [](cbb_ptr, cbb_ptr) {}; - auto get_structured_successors = [this](const ir::BasicBlock* block) { - return &(block2structured_succs_[block]); }; - // TODO(greg-lunarg): Get rid of const_cast by making moving const - // out of the cfa.h prototypes and into the invoking code. - auto post_order = [&](cbb_ptr b) { - order->push_front(const_cast(b)); }; - - order->clear(); - spvtools::CFA::DepthFirstTraversal( - &*func->begin(), get_structured_successors, ignore_block, - post_order, ignore_edge); -} - -bool CommonUniformElimPass::CommonUniformLoadElimination(ir::Function* func) { - // Process all blocks in structured order. This is just one way (the - // simplest?) to keep track of the most recent block outside of control - // flow, used to copy common instructions, guaranteed to dominate all - // following load sites. - std::list structuredOrder; - ComputeStructuredOrder(func, &structuredOrder); - uniform2load_id_.clear(); - bool modified = false; - // Find insertion point in first block to copy non-dominating loads. - auto insertItr = func->begin()->begin(); - while (insertItr->opcode() == SpvOpVariable || - insertItr->opcode() == SpvOpNop) - ++insertItr; - uint32_t mergeBlockId = 0; - for (auto bi = structuredOrder.begin(); bi != structuredOrder.end(); ++bi) { - ir::BasicBlock* bp = *bi; - // Check if we are exiting outermost control construct. If so, remember - // new load insertion point. Trying to keep register pressure down. - if (mergeBlockId == bp->id()) { - mergeBlockId = 0; - insertItr = bp->begin(); - } - for (auto ii = bp->begin(); ii != bp->end(); ++ii) { - if (ii->opcode() != SpvOpLoad) - continue; - uint32_t varId; - ir::Instruction* ptrInst = GetPtr(&*ii, &varId); - if (ptrInst->opcode() != SpvOpVariable) - continue; - if (!IsUniformVar(varId)) - continue; - if (IsSamplerOrImageVar(varId)) - continue; - if (HasUnsupportedDecorates(ii->result_id())) - continue; - uint32_t replId; - const auto uItr = uniform2load_id_.find(varId); - if (uItr != uniform2load_id_.end()) { - replId = uItr->second; - } - else { - if (mergeBlockId == 0) { - // Load is in dominating block; just remember it - uniform2load_id_[varId] = ii->result_id(); - continue; - } - else { - // Copy load into most recent dominating block and remember it - replId = TakeNextId(); - std::unique_ptr newLoad(new ir::Instruction(SpvOpLoad, - ii->type_id(), replId, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {varId}}})); - def_use_mgr_->AnalyzeInstDefUse(&*newLoad); - insertItr = insertItr.InsertBefore(std::move(newLoad)); - ++insertItr; - uniform2load_id_[varId] = replId; - } - } - ReplaceAndDeleteLoad(&*ii, replId, ptrInst); - modified = true; - } - // If we are outside of any control construct and entering one, remember - // the id of the merge block - if (mergeBlockId == 0) { - uint32_t dummy; - mergeBlockId = MergeBlockIdIfAny(*bp, &dummy); - } - } - return modified; -} - -bool CommonUniformElimPass::CommonUniformLoadElimBlock(ir::Function* func) { - bool modified = false; - for (auto& blk : *func) { - uniform2load_id_.clear(); - for (auto ii = blk.begin(); ii != blk.end(); ++ii) { - if (ii->opcode() != SpvOpLoad) - continue; - uint32_t varId; - ir::Instruction* ptrInst = GetPtr(&*ii, &varId); - if (ptrInst->opcode() != SpvOpVariable) - continue; - if (!IsUniformVar(varId)) - continue; - if (!IsSamplerOrImageVar(varId)) - continue; - if (HasUnsupportedDecorates(ii->result_id())) - continue; - uint32_t replId; - const auto uItr = uniform2load_id_.find(varId); - if (uItr != uniform2load_id_.end()) { - replId = uItr->second; - } - else { - uniform2load_id_[varId] = ii->result_id(); - continue; - } - ReplaceAndDeleteLoad(&*ii, replId, ptrInst); - modified = true; - } - } - return modified; -} - -bool CommonUniformElimPass::CommonExtractElimination(ir::Function* func) { - // Find all composite ids with duplicate extracts. - for (auto bi = func->begin(); bi != func->end(); ++bi) { - for (auto ii = bi->begin(); ii != bi->end(); ++ii) { - if (ii->opcode() != SpvOpCompositeExtract) - continue; - // TODO(greg-lunarg): Support multiple indices - if (ii->NumInOperands() > 2) - continue; - if (HasUnsupportedDecorates(ii->result_id())) - continue; - uint32_t compId = ii->GetSingleWordInOperand(kExtractCompositeIdInIdx); - uint32_t idx = ii->GetSingleWordInOperand(kExtractIdx0InIdx); - comp2idx2inst_[compId][idx].push_back(&*ii); - } - } - // For all defs of ids with duplicate extracts, insert new extracts - // after def, and replace and delete old extracts - bool modified = false; - for (auto bi = func->begin(); bi != func->end(); ++bi) { - for (auto ii = bi->begin(); ii != bi->end(); ++ii) { - const auto cItr = comp2idx2inst_.find(ii->result_id()); - if (cItr == comp2idx2inst_.end()) - continue; - for (auto idxItr : cItr->second) { - if (idxItr.second.size() < 2) - continue; - uint32_t replId = TakeNextId(); - std::unique_ptr newExtract(new ir::Instruction(*idxItr.second.front())); - newExtract->SetResultId(replId); - def_use_mgr_->AnalyzeInstDefUse(&*newExtract); - ++ii; - ii = ii.InsertBefore(std::move(newExtract)); - for (auto instItr : idxItr.second) { - uint32_t resId = instItr->result_id(); - KillNamesAndDecorates(resId); - (void)def_use_mgr_->ReplaceAllUsesWith(resId, replId); - def_use_mgr_->KillInst(instItr); - } - modified = true; - } - } - } - return modified; -} - -bool CommonUniformElimPass::EliminateCommonUniform(ir::Function* func) { - bool modified = false; - modified |= UniformAccessChainConvert(func); - modified |= CommonUniformLoadElimination(func); - modified |= CommonExtractElimination(func); - - modified |= CommonUniformLoadElimBlock(func); - return modified; -} - -void CommonUniformElimPass::Initialize(ir::Module* module) { - - module_ = module; - - // Initialize function and block maps - id2block_.clear(); - for (auto& fn : *module_) - for (auto& blk : fn) - id2block_[blk.id()] = &blk; - - // Clear collections - block2structured_succs_.clear(); - label2preds_.clear(); - comp2idx2inst_.clear(); - - // TODO(greg-lunarg): Use def/use from previous pass - def_use_mgr_.reset(new analysis::DefUseManager(consumer(), module_)); - - // Initialize next unused Id. - next_id_ = module->id_bound(); - - // Initialize extension whitelist - InitExtensions(); -}; - - -bool CommonUniformElimPass::AllExtensionsSupported() const { - // If any extension not in whitelist, return false - for (auto& ei : module_->extensions()) { - const char* extName = reinterpret_cast( - &ei.GetInOperand(0).words[0]); - if (extensions_whitelist_.find(extName) == extensions_whitelist_.end()) - return false; - } - return true; -} - -Pass::Status CommonUniformElimPass::ProcessImpl() { - // Assumes all control flow structured. - // TODO(greg-lunarg): Do SSA rewrite for non-structured control flow - if (!module_->HasCapability(SpvCapabilityShader)) - return Status::SuccessWithoutChange; - // Assumes logical addressing only - // TODO(greg-lunarg): Add support for physical addressing - if (module_->HasCapability(SpvCapabilityAddresses)) - return Status::SuccessWithoutChange; - // Do not process if any disallowed extensions are enabled - if (!AllExtensionsSupported()) - return Status::SuccessWithoutChange; - // Do not process if module contains OpGroupDecorate. Additional - // support required in KillNamesAndDecorates(). - // TODO(greg-lunarg): Add support for OpGroupDecorate - for (auto& ai : module_->annotations()) - if (ai.opcode() == SpvOpGroupDecorate) - return Status::SuccessWithoutChange; - // If non-32-bit integer type in module, terminate processing - // TODO(): Handle non-32-bit integer constants in access chains - for (const ir::Instruction& inst : module_->types_values()) - if (inst.opcode() == SpvOpTypeInt && - inst.GetSingleWordInOperand(kTypeIntWidthInIdx) != 32) - return Status::SuccessWithoutChange; - // Process entry point functions - ProcessFunction pfn = [this](ir::Function* fp) { - return EliminateCommonUniform(fp); - }; - bool modified = ProcessEntryPointCallTree(pfn, module_); - FinalizeNextId(module_); - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -CommonUniformElimPass::CommonUniformElimPass() - : module_(nullptr), def_use_mgr_(nullptr), next_id_(0) {} - -Pass::Status CommonUniformElimPass::Process(ir::Module* module) { - Initialize(module); - return ProcessImpl(); -} - -void CommonUniformElimPass::InitExtensions() { - extensions_whitelist_.clear(); - extensions_whitelist_.insert({ - "SPV_AMD_shader_explicit_vertex_parameter", - "SPV_AMD_shader_trinary_minmax", - "SPV_AMD_gcn_shader", - "SPV_KHR_shader_ballot", - "SPV_AMD_shader_ballot", - "SPV_AMD_gpu_shader_half_float", - "SPV_KHR_shader_draw_parameters", - "SPV_KHR_subgroup_vote", - "SPV_KHR_16bit_storage", - "SPV_KHR_device_group", - "SPV_KHR_multiview", - "SPV_NVX_multiview_per_view_attributes", - "SPV_NV_viewport_array2", - "SPV_NV_stereo_view_rendering", - "SPV_NV_sample_mask_override_coverage", - "SPV_NV_geometry_shader_passthrough", - "SPV_AMD_texture_gather_bias_lod", - "SPV_KHR_storage_buffer_storage_class", - // SPV_KHR_variable_pointers - // Currently do not support extended pointer expressions - "SPV_AMD_gpu_shader_int16", - "SPV_KHR_post_depth_coverage", - "SPV_KHR_shader_atomic_counter_ops", - }); -} - -} // namespace opt -} // namespace spvtools - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/common_uniform_elim_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/common_uniform_elim_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/common_uniform_elim_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/common_uniform_elim_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,212 +0,0 @@ -// Copyright (c) 2016 The Khronos Group Inc. -// Copyright (c) 2016 Valve Corporation -// Copyright (c) 2016 LunarG Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_COMMON_UNIFORM_ELIM_PASS_H_ -#define LIBSPIRV_OPT_COMMON_UNIFORM_ELIM_PASS_H_ - -#include -#include -#include -#include -#include -#include - -#include "def_use_manager.h" -#include "module.h" -#include "basic_block.h" -#include "pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class CommonUniformElimPass : public Pass { - using cbb_ptr = const ir::BasicBlock*; - - public: - using GetBlocksFunction = - std::function*(const ir::BasicBlock*)>; - - CommonUniformElimPass(); - const char* name() const override { return "eliminate-common-uniform"; } - Status Process(ir::Module*) override; - - private: - // Returns true if |opcode| is a non-ptr access chain op - bool IsNonPtrAccessChain(const SpvOp opcode) const; - - // Returns true if |typeInst| is a sampler or image type or a struct - // containing one, recursively. - bool IsSamplerOrImageType(const ir::Instruction* typeInst) const; - - // Returns true if |varId| is a variable containing a sampler or image. - bool IsSamplerOrImageVar(uint32_t varId) const; - - // Return true if |block_ptr| is loop header block - bool IsLoopHeader(ir::BasicBlock* block_ptr); - - // Given a load or store pointed at by |ip|, return the top-most - // non-CopyObj in its pointer operand. Also return the base pointer - // in |objId|. - ir::Instruction* GetPtr(ir::Instruction* ip, uint32_t* objId); - - // Return true if variable is uniform - bool IsUniformVar(uint32_t varId); - - // Return true if any uses of |id| are decorate ops. - bool HasUnsupportedDecorates(uint32_t id) const; - - // Return true if all uses of |id| are only name or decorate ops. - bool HasOnlyNamesAndDecorates(uint32_t id) const; - - // Kill all name and decorate ops using |inst| - void KillNamesAndDecorates(ir::Instruction* inst); - - // Kill all name and decorate ops using |id| - void KillNamesAndDecorates(uint32_t id); - - // Delete inst if it has no uses. Assumes inst has a resultId. - void DeleteIfUseless(ir::Instruction* inst); - - // Replace all instances of load's id with replId and delete load - // and its access chain, if any - void ReplaceAndDeleteLoad(ir::Instruction* loadInst, - uint32_t replId, - ir::Instruction* ptrInst); - - // Return type id for pointer's pointee - uint32_t GetPointeeTypeId(const ir::Instruction* ptrInst); - - // For the (constant index) access chain ptrInst, create an - // equivalent load and extract - void GenACLoadRepl(const ir::Instruction* ptrInst, - std::vector>* newInsts, - uint32_t* resultId); - - // Return true if all indices are constant - bool IsConstantIndexAccessChain(ir::Instruction* acp); - - // Convert all uniform access chain loads into load/extract. - bool UniformAccessChainConvert(ir::Function* func); - - // Returns the id of the merge block declared by a merge instruction in - // this block, if any. If none, returns zero. - uint32_t MergeBlockIdIfAny(const ir::BasicBlock& blk, uint32_t* cbid); - - // Compute structured successors for function |func|. - // A block's structured successors are the blocks it branches to - // together with its declared merge block if it has one. - // When order matters, the merge block always appears first. - // This assures correct depth first search in the presence of early - // returns and kills. If the successor vector contain duplicates - // if the merge block, they are safely ignored by DFS. - void ComputeStructuredSuccessors(ir::Function* func); - - // Compute structured block order for |func| into |structuredOrder|. This - // order has the property that dominators come before all blocks they - // dominate and merge blocks come after all blocks that are in the control - // constructs of their header. - void ComputeStructuredOrder(ir::Function* func, - std::list* order); - - // Eliminate loads of uniform variables which have previously been loaded. - // If first load is in control flow, move it to first block of function. - // Most effective if preceded by UniformAccessChainRemoval(). - bool CommonUniformLoadElimination(ir::Function* func); - - // Eliminate loads of uniform sampler and image variables which have previously - // been loaded in the same block for types whose loads cannot cross blocks. - bool CommonUniformLoadElimBlock(ir::Function* func); - - // Eliminate duplicated extracts of same id. Extract may be moved to same - // block as the id definition. This is primarily intended for extracts - // from uniform loads. Most effective if preceded by - // CommonUniformLoadElimination(). - bool CommonExtractElimination(ir::Function* func); - - // For function |func|, first change all uniform constant index - // access chain loads into equivalent composite extracts. Then consolidate - // identical uniform loads into one uniform load. Finally, consolidate - // identical uniform extracts into one uniform extract. This may require - // moving a load or extract to a point which dominates all uses. - // Return true if func is modified. - // - // This pass requires the function to have structured control flow ie shader - // capability. It also requires logical addressing ie Addresses capability - // is not enabled. It also currently does not support any extensions. - // - // This function currently only optimizes loads with a single index. - bool EliminateCommonUniform(ir::Function* func); - - // Initialize extensions whitelist - void InitExtensions(); - - // Return true if all extensions in this module are allowed by this pass. - bool AllExtensionsSupported() const; - - // Return true if |op| is a decorate for non-type instruction - inline bool IsNonTypeDecorate(uint32_t op) const { - return (op == SpvOpDecorate || op == SpvOpDecorateId); - } - - inline void FinalizeNextId(ir::Module* module) { - module->SetIdBound(next_id_); - } - - inline uint32_t TakeNextId() { - return next_id_++; - } - - void Initialize(ir::Module* module); - Pass::Status ProcessImpl(); - - // Module this pass is processing - ir::Module* module_; - - // Def-Uses for the module we are processing - std::unique_ptr def_use_mgr_; - - // Map from block's label id to block. - std::unordered_map id2block_; - - // Map from block to its structured successor blocks. See - // ComputeStructuredSuccessors() for definition. - std::unordered_map> - block2structured_succs_; - - // Map from block's label id to its predecessor blocks ids - std::unordered_map> label2preds_; - - // Map from uniform variable id to its common load id - std::unordered_map uniform2load_id_; - - // Map of extract composite ids to map of indices to insts - // TODO(greg-lunarg): Consider std::vector. - std::unordered_map>> comp2idx2inst_; - - // Extensions supported by this pass. - std::unordered_set extensions_whitelist_; - - // Next unused ID - uint32_t next_id_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_SSAMEM_PASS_H_ - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/compact_ids_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/compact_ids_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/compact_ids_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/compact_ids_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include "compact_ids_pass.h" - -#include -#include - -namespace spvtools { -namespace opt { - -using ir::Instruction; -using ir::Operand; - -Pass::Status CompactIdsPass::Process(ir::Module* module) { - bool modified = false; - std::unordered_map result_id_mapping; - - module->ForEachInst([&result_id_mapping, &modified] (Instruction* inst) { - auto operand = inst->begin(); - while (operand != inst->end()) { - const auto type = operand->type; - if (spvIsIdType(type)) { - assert(operand->words.size() == 1); - uint32_t& id = operand->words[0]; - auto it = result_id_mapping.find(id); - if (it == result_id_mapping.end()) { - const uint32_t new_id = - static_cast(result_id_mapping.size()) + 1; - const auto insertion_result = result_id_mapping.emplace(id, new_id); - it = insertion_result.first; - assert(insertion_result.second); - } - if (id != it->second) { - modified = true; - id = it->second; - // Update data cached in the instruction object. - if (type == SPV_OPERAND_TYPE_RESULT_ID) { - inst->SetResultId(id); - } else if (type == SPV_OPERAND_TYPE_TYPE_ID) { - inst->SetResultType(id); - } - } - } - ++operand; - } - }, true); - - if (modified) - module->SetIdBound(static_cast(result_id_mapping.size() + 1)); - - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/compact_ids_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/compact_ids_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/compact_ids_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/compact_ids_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_COMPACT_IDS_PASS_H_ -#define LIBSPIRV_OPT_COMPACT_IDS_PASS_H_ - -#include "module.h" -#include "pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class CompactIdsPass : public Pass { - public: - const char* name() const override { return "compact-ids"; } - Status Process(ir::Module*) override; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_COMPACT_IDS_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/constants.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/constants.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/constants.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/constants.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,291 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_CONSTANTS_H_ -#define LIBSPIRV_OPT_CONSTANTS_H_ - -#include -#include -#include - -#include "make_unique.h" -#include "types.h" - -namespace spvtools { -namespace opt { -namespace analysis { - -// Class hierarchy to represent the normal constants defined through -// OpConstantTrue, OpConstantFalse, OpConstant, OpConstantNull and -// OpConstantComposite instructions. -// TODO(qining): Add class for constants defined with OpConstantSampler. -class Constant; -class ScalarConstant; -class IntConstant; -class FloatConstant; -class BoolConstant; -class CompositeConstant; -class StructConstant; -class VectorConstant; -class ArrayConstant; -class NullConstant; - -// Abstract class for a SPIR-V constant. It has a bunch of As methods, -// which is used as a way to probe the actual -class Constant { - public: - Constant() = delete; - virtual ~Constant() {} - - // Make a deep copy of this constant. - virtual std::unique_ptr Copy() const = 0; - - // reflections - virtual ScalarConstant* AsScalarConstant() { return nullptr; } - virtual IntConstant* AsIntConstant() { return nullptr; } - virtual FloatConstant* AsFloatConstant() { return nullptr; } - virtual BoolConstant* AsBoolConstant() { return nullptr; } - virtual CompositeConstant* AsCompositeConstant() { return nullptr; } - virtual StructConstant* AsStructConstant() { return nullptr; } - virtual VectorConstant* AsVectorConstant() { return nullptr; } - virtual ArrayConstant* AsArrayConstant() { return nullptr; } - virtual NullConstant* AsNullConstant() { return nullptr; } - - virtual const ScalarConstant* AsScalarConstant() const { return nullptr; } - virtual const IntConstant* AsIntConstant() const { return nullptr; } - virtual const FloatConstant* AsFloatConstant() const { return nullptr; } - virtual const BoolConstant* AsBoolConstant() const { return nullptr; } - virtual const CompositeConstant* AsCompositeConstant() const { - return nullptr; - } - virtual const StructConstant* AsStructConstant() const { return nullptr; } - virtual const VectorConstant* AsVectorConstant() const { return nullptr; } - virtual const ArrayConstant* AsArrayConstant() const { return nullptr; } - virtual const NullConstant* AsNullConstant() const { return nullptr; } - - const analysis::Type* type() const { return type_; } - - protected: - Constant(const analysis::Type* ty) : type_(ty) {} - - // The type of this constant. - const analysis::Type* type_; -}; - -// Abstract class for scalar type constants. -class ScalarConstant : public Constant { - public: - ScalarConstant() = delete; - ScalarConstant* AsScalarConstant() override { return this; } - const ScalarConstant* AsScalarConstant() const override { return this; } - - // Returns a const reference of the value of this constant in 32-bit words. - virtual const std::vector& words() const { return words_; } - - protected: - ScalarConstant(const analysis::Type* ty, const std::vector& w) - : Constant(ty), words_(w) {} - ScalarConstant(const analysis::Type* ty, std::vector&& w) - : Constant(ty), words_(std::move(w)) {} - std::vector words_; -}; - -// Integer type constant. -class IntConstant : public ScalarConstant { - public: - IntConstant(const analysis::Integer* ty, const std::vector& w) - : ScalarConstant(ty, w) {} - IntConstant(const analysis::Integer* ty, std::vector&& w) - : ScalarConstant(ty, std::move(w)) {} - - IntConstant* AsIntConstant() override { return this; } - const IntConstant* AsIntConstant() const override { return this; } - - // Make a copy of this IntConstant instance. - std::unique_ptr CopyIntConstant() const { - return MakeUnique(type_->AsInteger(), words_); - } - std::unique_ptr Copy() const override { - return std::unique_ptr(CopyIntConstant().release()); - } -}; - -// Float type constant. -class FloatConstant : public ScalarConstant { - public: - FloatConstant(const analysis::Float* ty, const std::vector& w) - : ScalarConstant(ty, w) {} - FloatConstant(const analysis::Float* ty, std::vector&& w) - : ScalarConstant(ty, std::move(w)) {} - - FloatConstant* AsFloatConstant() override { return this; } - const FloatConstant* AsFloatConstant() const override { return this; } - - // Make a copy of this FloatConstant instance. - std::unique_ptr CopyFloatConstant() const { - return MakeUnique(type_->AsFloat(), words_); - } - std::unique_ptr Copy() const override { - return std::unique_ptr(CopyFloatConstant().release()); - } -}; - -// Bool type constant. -class BoolConstant : public ScalarConstant { - public: - BoolConstant(const analysis::Bool* ty, bool v) - : ScalarConstant(ty, {static_cast(v)}), value_(v) {} - - BoolConstant* AsBoolConstant() override { return this; } - const BoolConstant* AsBoolConstant() const override { return this; } - - // Make a copy of this BoolConstant instance. - std::unique_ptr CopyBoolConstant() const { - return MakeUnique(type_->AsBool(), value_); - } - std::unique_ptr Copy() const override { - return std::unique_ptr(CopyBoolConstant().release()); - } - - bool value() const { return value_; } - - private: - bool value_; -}; - -// Abstract class for composite constants. -class CompositeConstant : public Constant { - public: - CompositeConstant() = delete; - CompositeConstant* AsCompositeConstant() override { return this; } - const CompositeConstant* AsCompositeConstant() const override { return this; } - - // Returns a const reference of the components holded in this composite - // constant. - virtual const std::vector& GetComponents() const { - return components_; - } - - protected: - CompositeConstant(const analysis::Type* ty) : Constant(ty), components_() {} - CompositeConstant(const analysis::Type* ty, - const std::vector& components) - : Constant(ty), components_(components) {} - CompositeConstant(const analysis::Type* ty, - std::vector&& components) - : Constant(ty), components_(std::move(components)) {} - std::vector components_; -}; - -// Struct type constant. -class StructConstant : public CompositeConstant { - public: - StructConstant(const analysis::Struct* ty) : CompositeConstant(ty) {} - StructConstant(const analysis::Struct* ty, - const std::vector& components) - : CompositeConstant(ty, components) {} - StructConstant(const analysis::Struct* ty, - std::vector&& components) - : CompositeConstant(ty, std::move(components)) {} - - StructConstant* AsStructConstant() override { return this; } - const StructConstant* AsStructConstant() const override { return this; } - - // Make a copy of this StructConstant instance. - std::unique_ptr CopyStructConstant() const { - return MakeUnique(type_->AsStruct(), components_); - } - std::unique_ptr Copy() const override { - return std::unique_ptr(CopyStructConstant().release()); - } -}; - -// Vector type constant. -class VectorConstant : public CompositeConstant { - public: - VectorConstant(const analysis::Vector* ty) - : CompositeConstant(ty), component_type_(ty->element_type()) {} - VectorConstant(const analysis::Vector* ty, - const std::vector& components) - : CompositeConstant(ty, components), - component_type_(ty->element_type()) {} - VectorConstant(const analysis::Vector* ty, - std::vector&& components) - : CompositeConstant(ty, std::move(components)), - component_type_(ty->element_type()) {} - - VectorConstant* AsVectorConstant() override { return this; } - const VectorConstant* AsVectorConstant() const override { return this; } - - // Make a copy of this VectorConstant instance. - std::unique_ptr CopyVectorConstant() const { - auto another = MakeUnique(type_->AsVector()); - another->components_.insert(another->components_.end(), components_.begin(), - components_.end()); - return another; - } - std::unique_ptr Copy() const override { - return std::unique_ptr(CopyVectorConstant().release()); - } - - const analysis::Type* component_type() { return component_type_; } - - private: - const analysis::Type* component_type_; -}; - -// Array type constant. -class ArrayConstant : public CompositeConstant { - public: - ArrayConstant(const analysis::Array* ty) : CompositeConstant(ty) {} - ArrayConstant(const analysis::Array* ty, - const std::vector& components) - : CompositeConstant(ty, components) {} - ArrayConstant(const analysis::Array* ty, - std::vector&& components) - : CompositeConstant(ty, std::move(components)) {} - - ArrayConstant* AsArrayConstant() override { return this; } - const ArrayConstant* AsArrayConstant() const override { return this; } - - // Make a copy of this ArrayConstant instance. - std::unique_ptr CopyArrayConstant() const { - return MakeUnique(type_->AsArray(), components_); - } - std::unique_ptr Copy() const override { - return std::unique_ptr(CopyArrayConstant().release()); - } -}; - -// Null type constant. -class NullConstant : public Constant { - public: - NullConstant(const analysis::Type* ty) : Constant(ty) {} - NullConstant* AsNullConstant() override { return this; } - const NullConstant* AsNullConstant() const override { return this; } - - // Make a copy of this NullConstant instance. - std::unique_ptr CopyNullConstant() const { - return MakeUnique(type_); - } - std::unique_ptr Copy() const override { - return std::unique_ptr(CopyNullConstant().release()); - } -}; - -} // namespace analysis -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_CONSTANTS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/dead_branch_elim_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/dead_branch_elim_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/dead_branch_elim_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/dead_branch_elim_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,485 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "dead_branch_elim_pass.h" - -#include "cfa.h" -#include "iterator.h" - -namespace spvtools { -namespace opt { - -namespace { - -const uint32_t kBranchCondTrueLabIdInIdx = 1; -const uint32_t kBranchCondFalseLabIdInIdx = 2; -const uint32_t kSelectionMergeMergeBlockIdInIdx = 0; -const uint32_t kLoopMergeMergeBlockIdInIdx = 0; -const uint32_t kLoopMergeContinueBlockIdInIdx = 1; - -} // anonymous namespace - -uint32_t DeadBranchElimPass::MergeBlockIdIfAny( - const ir::BasicBlock& blk, uint32_t* cbid) const { - auto merge_ii = blk.cend(); - --merge_ii; - uint32_t mbid = 0; - *cbid = 0; - if (merge_ii != blk.cbegin()) { - --merge_ii; - if (merge_ii->opcode() == SpvOpLoopMerge) { - mbid = merge_ii->GetSingleWordInOperand(kLoopMergeMergeBlockIdInIdx); - *cbid = merge_ii->GetSingleWordInOperand(kLoopMergeContinueBlockIdInIdx); - } - else if (merge_ii->opcode() == SpvOpSelectionMerge) { - mbid = merge_ii->GetSingleWordInOperand( - kSelectionMergeMergeBlockIdInIdx); - } - } - return mbid; -} - -void DeadBranchElimPass::ComputeStructuredSuccessors(ir::Function* func) { - // If header, make merge block first successor. If a loop header, make - // the second successor the continue target. - for (auto& blk : *func) { - uint32_t cbid; - uint32_t mbid = MergeBlockIdIfAny(blk, &cbid); - if (mbid != 0) { - block2structured_succs_[&blk].push_back(id2block_[mbid]); - if (cbid != 0) - block2structured_succs_[&blk].push_back(id2block_[cbid]); - } - // add true successors - blk.ForEachSuccessorLabel([&blk, this](uint32_t sbid) { - block2structured_succs_[&blk].push_back(id2block_[sbid]); - }); - } -} - -void DeadBranchElimPass::ComputeStructuredOrder( - ir::Function* func, std::list* order) { - // Compute structured successors and do DFS - ComputeStructuredSuccessors(func); - auto ignore_block = [](cbb_ptr) {}; - auto ignore_edge = [](cbb_ptr, cbb_ptr) {}; - auto get_structured_successors = [this](const ir::BasicBlock* block) { - return &(block2structured_succs_[block]); }; - // TODO(greg-lunarg): Get rid of const_cast by making moving const - // out of the cfa.h prototypes and into the invoking code. - auto post_order = [&](cbb_ptr b) { - order->push_front(const_cast(b)); }; - - spvtools::CFA::DepthFirstTraversal( - &*func->begin(), get_structured_successors, ignore_block, post_order, - ignore_edge); -} - -bool DeadBranchElimPass::GetConstCondition(uint32_t condId, bool* condVal) { - bool condIsConst; - ir::Instruction* cInst = def_use_mgr_->GetDef(condId); - switch (cInst->opcode()) { - case SpvOpConstantFalse: { - *condVal = false; - condIsConst = true; - } break; - case SpvOpConstantTrue: { - *condVal = true; - condIsConst = true; - } break; - case SpvOpLogicalNot: { - bool negVal; - condIsConst = GetConstCondition(cInst->GetSingleWordInOperand(0), - &negVal); - if (condIsConst) - *condVal = !negVal; - } break; - default: { - condIsConst = false; - } break; - } - return condIsConst; -} - -bool DeadBranchElimPass::GetConstInteger(uint32_t selId, uint32_t* selVal) { - ir::Instruction* sInst = def_use_mgr_->GetDef(selId); - uint32_t typeId = sInst->type_id(); - ir::Instruction* typeInst = def_use_mgr_->GetDef(typeId); - if (!typeInst || (typeInst->opcode() != SpvOpTypeInt)) return false; - // TODO(greg-lunarg): Support non-32 bit ints - if (typeInst->GetSingleWordInOperand(0) != 32) - return false; - if (sInst->opcode() == SpvOpConstant) { - *selVal = sInst->GetSingleWordInOperand(0); - return true; - } - else if (sInst->opcode() == SpvOpConstantNull) { - *selVal = 0; - return true; - } - return false; -} - -void DeadBranchElimPass::AddBranch(uint32_t labelId, ir::BasicBlock* bp) { - std::unique_ptr newBranch( - new ir::Instruction(SpvOpBranch, 0, 0, - {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {labelId}}})); - def_use_mgr_->AnalyzeInstDefUse(&*newBranch); - bp->AddInstruction(std::move(newBranch)); -} - -void DeadBranchElimPass::AddSelectionMerge(uint32_t labelId, - ir::BasicBlock* bp) { - std::unique_ptr newMerge( - new ir::Instruction(SpvOpSelectionMerge, 0, 0, - {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {labelId}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, {0}}})); - def_use_mgr_->AnalyzeInstDefUse(&*newMerge); - bp->AddInstruction(std::move(newMerge)); -} - -void DeadBranchElimPass::AddBranchConditional(uint32_t condId, - uint32_t trueLabId, uint32_t falseLabId, ir::BasicBlock* bp) { - std::unique_ptr newBranchCond( - new ir::Instruction(SpvOpBranchConditional, 0, 0, - {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {condId}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {trueLabId}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {falseLabId}}})); - def_use_mgr_->AnalyzeInstDefUse(&*newBranchCond); - bp->AddInstruction(std::move(newBranchCond)); -} - -void DeadBranchElimPass::KillAllInsts(ir::BasicBlock* bp) { - bp->ForEachInst([this](ir::Instruction* ip) { - KillNamesAndDecorates(ip); - def_use_mgr_->KillInst(ip); - }); -} - -bool DeadBranchElimPass::GetSelectionBranch(ir::BasicBlock* bp, - ir::Instruction** branchInst, ir::Instruction** mergeInst, - uint32_t *condId) { - auto ii = bp->end(); - --ii; - *branchInst = &*ii; - if (ii == bp->begin()) - return false; - --ii; - *mergeInst = &*ii; - if ((*mergeInst)->opcode() != SpvOpSelectionMerge) - return false; - // SPIR-V says the terminator for an OpSelectionMerge must be - // either a conditional branch or a switch. - assert((*branchInst)->opcode() == SpvOpBranchConditional || - (*branchInst)->opcode() == SpvOpSwitch); - // Both BranchConidtional and Switch have their conditional value at 0. - *condId = (*branchInst)->GetSingleWordInOperand(0); - return true; -} - -bool DeadBranchElimPass::HasNonPhiRef(uint32_t labelId) { - analysis::UseList* uses = def_use_mgr_->GetUses(labelId); - if (uses == nullptr) - return false; - for (auto u : *uses) - if (u.inst->opcode() != SpvOpPhi) - return true; - return false; -} - -bool DeadBranchElimPass::EliminateDeadBranches(ir::Function* func) { - // Traverse blocks in structured order - std::list structuredOrder; - ComputeStructuredOrder(func, &structuredOrder); - std::unordered_set elimBlocks; - bool modified = false; - for (auto bi = structuredOrder.begin(); bi != structuredOrder.end(); ++bi) { - // Skip blocks that are already in the elimination set - if (elimBlocks.find(*bi) != elimBlocks.end()) - continue; - // Skip blocks that don't have conditional branch preceded - // by OpSelectionMerge - ir::Instruction* br; - ir::Instruction* mergeInst; - uint32_t condId; - if (!GetSelectionBranch(*bi, &br, &mergeInst, &condId)) - continue; - - // If constant condition/selector, replace conditional branch/switch - // with unconditional branch and delete merge - uint32_t liveLabId; - if (br->opcode() == SpvOpBranchConditional) { - bool condVal; - if (!GetConstCondition(condId, &condVal)) - continue; - liveLabId = (condVal == true) ? - br->GetSingleWordInOperand(kBranchCondTrueLabIdInIdx) : - br->GetSingleWordInOperand(kBranchCondFalseLabIdInIdx); - } - else { - assert(br->opcode() == SpvOpSwitch); - // Search switch operands for selector value, set liveLabId to - // corresponding label, use default if not found - uint32_t selVal; - if (!GetConstInteger(condId, &selVal)) - continue; - uint32_t icnt = 0; - uint32_t caseVal; - br->ForEachInOperand( - [&icnt,&caseVal,&selVal,&liveLabId](const uint32_t* idp) { - if (icnt == 1) { - // Start with default label - liveLabId = *idp; - } - else if (icnt > 1) { - if (icnt % 2 == 0) { - caseVal = *idp; - } - else { - if (caseVal == selVal) - liveLabId = *idp; - } - } - ++icnt; - }); - } - - const uint32_t mergeLabId = - mergeInst->GetSingleWordInOperand(kSelectionMergeMergeBlockIdInIdx); - AddBranch(liveLabId, *bi); - def_use_mgr_->KillInst(br); - def_use_mgr_->KillInst(mergeInst); - - modified = true; - - // Initialize live block set to the live label - std::unordered_set liveLabIds; - liveLabIds.insert(liveLabId); - - // Iterate to merge block adding dead blocks to elimination set - auto dbi = bi; - ++dbi; - uint32_t dLabId = (*dbi)->id(); - while (dLabId != mergeLabId) { - if (liveLabIds.find(dLabId) == liveLabIds.end()) { - // Kill use/def for all instructions and mark block for elimination - KillAllInsts(*dbi); - elimBlocks.insert(*dbi); - } - else { - // Mark all successors as live - (*dbi)->ForEachSuccessorLabel([&liveLabIds](const uint32_t succId){ - liveLabIds.insert(succId); - }); - // Mark merge and continue blocks as live - (*dbi)->ForMergeAndContinueLabel([&liveLabIds](const uint32_t succId){ - liveLabIds.insert(succId); - }); - } - ++dbi; - dLabId = (*dbi)->id(); - } - - // If merge block is unreachable, continue eliminating blocks until - // a live block or last block is reached. - while (!HasNonPhiRef(dLabId)) { - KillAllInsts(*dbi); - elimBlocks.insert(*dbi); - ++dbi; - if (dbi == structuredOrder.end()) - break; - dLabId = (*dbi)->id(); - } - - // If last block reached, look for next dead branch - if (dbi == structuredOrder.end()) - continue; - - // Create set of dead predecessors in preparation for phi update. - // Add the header block if the live branch is not the merge block. - std::unordered_set deadPreds(elimBlocks); - if (liveLabId != dLabId) - deadPreds.insert(*bi); - - // Update phi instructions in terminating block. - for (auto pii = (*dbi)->begin(); ; ++pii) { - // Skip NoOps, break at end of phis - SpvOp op = pii->opcode(); - if (op == SpvOpNop) - continue; - if (op != SpvOpPhi) - break; - // Count phi's live predecessors with lcnt and remember last one - // with lidx. - uint32_t lcnt = 0; - uint32_t lidx = 0; - uint32_t icnt = 0; - pii->ForEachInId( - [&deadPreds,&icnt,&lcnt,&lidx,this](uint32_t* idp) { - if (icnt % 2 == 1) { - if (deadPreds.find(id2block_[*idp]) == deadPreds.end()) { - ++lcnt; - lidx = icnt - 1; - } - } - ++icnt; - }); - // If just one live predecessor, replace resultid with live value id. - uint32_t replId; - if (lcnt == 1) { - replId = pii->GetSingleWordInOperand(lidx); - } - else { - // Otherwise create new phi eliminating dead predecessor entries - assert(lcnt > 1); - replId = TakeNextId(); - std::vector phi_in_opnds; - icnt = 0; - uint32_t lastId; - pii->ForEachInId( - [&deadPreds,&icnt,&phi_in_opnds,&lastId,this](uint32_t* idp) { - if (icnt % 2 == 1) { - if (deadPreds.find(id2block_[*idp]) == deadPreds.end()) { - phi_in_opnds.push_back( - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {lastId}}); - phi_in_opnds.push_back( - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {*idp}}); - } - } - else { - lastId = *idp; - } - ++icnt; - }); - std::unique_ptr newPhi(new ir::Instruction( - SpvOpPhi, pii->type_id(), replId, phi_in_opnds)); - def_use_mgr_->AnalyzeInstDefUse(&*newPhi); - pii = pii.InsertBefore(std::move(newPhi)); - ++pii; - } - const uint32_t phiId = pii->result_id(); - KillNamesAndDecorates(phiId); - (void)def_use_mgr_->ReplaceAllUsesWith(phiId, replId); - def_use_mgr_->KillInst(&*pii); - } - } - - // Erase dead blocks - for (auto ebi = func->begin(); ebi != func->end(); ) - if (elimBlocks.find(&*ebi) != elimBlocks.end()) - ebi = ebi.Erase(); - else - ++ebi; - return modified; -} - -void DeadBranchElimPass::Initialize(ir::Module* module) { - - module_ = module; - - // Initialize function and block maps - id2block_.clear(); - block2structured_succs_.clear(); - - // Initialize block map - for (auto& fn : *module_) - for (auto& blk : fn) - id2block_[blk.id()] = &blk; - - // TODO(greg-lunarg): Reuse def/use from previous passes - def_use_mgr_.reset(new analysis::DefUseManager(consumer(), module_)); - - // Initialize next unused Id. - InitNextId(); - - // Initialize extension whitelist - InitExtensions(); -}; - -bool DeadBranchElimPass::AllExtensionsSupported() const { - // If any extension not in whitelist, return false - for (auto& ei : module_->extensions()) { - const char* extName = reinterpret_cast( - &ei.GetInOperand(0).words[0]); - if (extensions_whitelist_.find(extName) == extensions_whitelist_.end()) - return false; - } - return true; -} - -Pass::Status DeadBranchElimPass::ProcessImpl() { - // Current functionality assumes structured control flow. - // TODO(greg-lunarg): Handle non-structured control-flow. - if (!module_->HasCapability(SpvCapabilityShader)) - return Status::SuccessWithoutChange; - // Do not process if module contains OpGroupDecorate. Additional - // support required in KillNamesAndDecorates(). - // TODO(greg-lunarg): Add support for OpGroupDecorate - for (auto& ai : module_->annotations()) - if (ai.opcode() == SpvOpGroupDecorate) - return Status::SuccessWithoutChange; - // Do not process if any disallowed extensions are enabled - if (!AllExtensionsSupported()) - return Status::SuccessWithoutChange; - // Collect all named and decorated ids - FindNamedOrDecoratedIds(); - // Process all entry point functions - ProcessFunction pfn = [this](ir::Function* fp) { - return EliminateDeadBranches(fp); - }; - bool modified = ProcessEntryPointCallTree(pfn, module_); - FinalizeNextId(); - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -DeadBranchElimPass::DeadBranchElimPass() {} - -Pass::Status DeadBranchElimPass::Process(ir::Module* module) { - Initialize(module); - return ProcessImpl(); -} - -void DeadBranchElimPass::InitExtensions() { - extensions_whitelist_.clear(); - extensions_whitelist_.insert({ - "SPV_AMD_shader_explicit_vertex_parameter", - "SPV_AMD_shader_trinary_minmax", - "SPV_AMD_gcn_shader", - "SPV_KHR_shader_ballot", - "SPV_AMD_shader_ballot", - "SPV_AMD_gpu_shader_half_float", - "SPV_KHR_shader_draw_parameters", - "SPV_KHR_subgroup_vote", - "SPV_KHR_16bit_storage", - "SPV_KHR_device_group", - "SPV_KHR_multiview", - "SPV_NVX_multiview_per_view_attributes", - "SPV_NV_viewport_array2", - "SPV_NV_stereo_view_rendering", - "SPV_NV_sample_mask_override_coverage", - "SPV_NV_geometry_shader_passthrough", - "SPV_AMD_texture_gather_bias_lod", - "SPV_KHR_storage_buffer_storage_class", - "SPV_KHR_variable_pointers", - "SPV_AMD_gpu_shader_int16", - "SPV_KHR_post_depth_coverage", - "SPV_KHR_shader_atomic_counter_ops", - }); -} - -} // namespace opt -} // namespace spvtools - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/dead_branch_elim_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/dead_branch_elim_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/dead_branch_elim_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/dead_branch_elim_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,136 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#ifndef LIBSPIRV_OPT_DEAD_BRANCH_ELIM_PASS_H_ -#define LIBSPIRV_OPT_DEAD_BRANCH_ELIM_PASS_H_ - - -#include -#include -#include -#include -#include -#include - -#include "basic_block.h" -#include "def_use_manager.h" -#include "module.h" -#include "mem_pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class DeadBranchElimPass : public MemPass { - - using cbb_ptr = const ir::BasicBlock*; - - public: - using GetBlocksFunction = - std::function*(const ir::BasicBlock*)>; - - DeadBranchElimPass(); - const char* name() const override { return "eliminate-dead-branches"; } - Status Process(ir::Module*) override; - - private: - // Returns the id of the merge block declared by a merge instruction in - // this block |blk|, if any. If none, returns zero. If loop merge, returns - // the continue target id in |cbid|. Otherwise sets to zero. - uint32_t MergeBlockIdIfAny(const ir::BasicBlock& blk, uint32_t* cbid) const; - - // Compute structured successors for function |func|. - // A block's structured successors are the blocks it branches to - // together with its declared merge block if it has one. - // When order matters, the merge block always appears first and if - // a loop merge block, the continue target always appears second. - // This assures correct depth first search in the presence of early - // returns and kills. If the successor vector contain duplicates - // of the merge and continue blocks, they are safely ignored by DFS. - void ComputeStructuredSuccessors(ir::Function* func); - - // Compute structured block order |order| for function |func|. This order - // has the property that dominators are before all blocks they dominate and - // merge blocks are after all blocks that are in the control constructs of - // their header. - void ComputeStructuredOrder( - ir::Function* func, std::list* order); - - // If |condId| is boolean constant, return conditional value in |condVal| and - // return true, otherwise return false. - bool GetConstCondition(uint32_t condId, bool* condVal); - - // If |valId| is a 32-bit integer constant, return value via |value| and - // return true, otherwise return false. - bool GetConstInteger(uint32_t valId, uint32_t* value); - - // Add branch to |labelId| to end of block |bp|. - void AddBranch(uint32_t labelId, ir::BasicBlock* bp); - - // Add selction merge of |labelId| to end of block |bp|. - void AddSelectionMerge(uint32_t labelId, ir::BasicBlock* bp); - - // Add conditional branch of |condId|, |trueLabId| and |falseLabId| to end - // of block |bp|. - void AddBranchConditional(uint32_t condId, uint32_t trueLabId, - uint32_t falseLabId, ir::BasicBlock* bp); - - // Kill all instructions in block |bp|. - void KillAllInsts(ir::BasicBlock* bp); - - // If block |bp| contains conditional branch or switch preceeded by an - // OpSelctionMerge, return true and return branch and merge instructions - // in |branchInst| and |mergeInst| and the conditional id in |condId|. - bool GetSelectionBranch(ir::BasicBlock* bp, ir::Instruction** branchInst, - ir::Instruction** mergeInst, uint32_t *condId); - - // Return true if |labelId| has any non-phi references - bool HasNonPhiRef(uint32_t labelId); - - // For function |func|, look for BranchConditionals with constant condition - // and convert to a Branch to the indicated label. Delete resulting dead - // blocks. Assumes only structured control flow in shader. Note some such - // branches and blocks may be left to avoid creating invalid control flow. - // TODO(greg-lunarg): Remove remaining constant conditional branches and - // dead blocks. - bool EliminateDeadBranches(ir::Function* func); - - // Initialize extensions whitelist - void InitExtensions(); - - // Return true if all extensions in this module are allowed by this pass. - bool AllExtensionsSupported() const; - - void Initialize(ir::Module* module); - Pass::Status ProcessImpl(); - - // Map from block's label id to block. - std::unordered_map id2block_; - - // Map from block to its structured successor blocks. See - // ComputeStructuredSuccessors() for definition. - std::unordered_map> - block2structured_succs_; - - // Extensions supported by this pass. - std::unordered_set extensions_whitelist_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_DEAD_BRANCH_ELIM_PASS_H_ - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/dead_variable_elimination.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/dead_variable_elimination.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/dead_variable_elimination.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/dead_variable_elimination.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include "dead_variable_elimination.h" - -#include "reflect.h" - -namespace spvtools { -namespace opt { - -// This optimization removes global variables that are not needed because they -// are definitely not accessed. -Pass::Status DeadVariableElimination::Process(spvtools::ir::Module* module) { - // The algorithm will compute the reference count for every global variable. - // Anything with a reference count of 0 will then be deleted. For variables - // that might have references that are not explicit in this module, we use the - // value kMustKeep as the reference count. - - bool modified = false; - module_ = module; - def_use_mgr_.reset(new analysis::DefUseManager(consumer(), module)); - FindNamedOrDecoratedIds(); - - // Decoration manager to help organize decorations. - analysis::DecorationManager decoration_manager(module); - - std::vector ids_to_remove; - - // Get the reference count for all of the global OpVariable instructions. - for (auto& inst : module->types_values()) { - if (inst.opcode() != SpvOp::SpvOpVariable) { - continue; - } - - size_t count = 0; - uint32_t result_id = inst.result_id(); - - // Check the linkage. If it is exported, it could be reference somewhere - // else, so we must keep the variable around. - decoration_manager.ForEachDecoration( - result_id, SpvDecorationLinkageAttributes, - [&count](const ir::Instruction& linkage_instruction) { - uint32_t last_operand = linkage_instruction.NumOperands() - 1; - if (linkage_instruction.GetSingleWordOperand(last_operand) == - SpvLinkageTypeExport) { - count = kMustKeep; - } - }); - - if (count != kMustKeep) { - // If we don't have to keep the instruction for other reasons, then look - // at the uses and count the number of real references. - if (analysis::UseList* uses = def_use_mgr_->GetUses(result_id)) { - count = std::count_if( - uses->begin(), uses->end(), [](const analysis::Use& u) { - return (!ir::IsAnnotationInst(u.inst->opcode()) && - u.inst->opcode() != SpvOpName); - }); - } - } - reference_count_[result_id] = count; - if (count == 0) { - ids_to_remove.push_back(result_id); - } - } - - // Remove all of the variables that have a reference count of 0. - if (!ids_to_remove.empty()) { - modified = true; - for (auto result_id : ids_to_remove) { - DeleteVariable(result_id); - } - } - return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange); -} - -void DeadVariableElimination::DeleteVariable(uint32_t result_id) { - ir::Instruction* inst = def_use_mgr_->GetDef(result_id); - assert(inst->opcode() == SpvOpVariable && - "Should not be trying to delete anything other than an OpVariable."); - - // Look for an initializer that references another variable. We need to know - // if that variable can be deleted after the reference is removed. - if (inst->NumOperands() == 4) { - ir::Instruction* initializer = - def_use_mgr_->GetDef(inst->GetSingleWordOperand(3)); - - // TODO: Handle OpSpecConstantOP which might be defined in terms of other - // variables. Will probably require a unified dead code pass that does all - // instruction types. (Issue 906) - if (initializer->opcode() == SpvOpVariable) { - uint32_t initializer_id = initializer->result_id(); - size_t& count = reference_count_[initializer_id]; - if (count != kMustKeep) { - --count; - } - - if (count == 0) { - DeleteVariable(initializer_id); - } - } - } - this->KillNamesAndDecorates(result_id); - def_use_mgr_->KillDef(result_id); -} -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/dead_variable_elimination.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/dead_variable_elimination.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/dead_variable_elimination.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/dead_variable_elimination.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SPIRV_TOOLS_DEAD_VARIABLE_ELIMINATION_H -#define SPIRV_TOOLS_DEAD_VARIABLE_ELIMINATION_H - -#include -#include - -#include "decoration_manager.h" -#include "mem_pass.h" - -namespace spvtools { -namespace opt { - -class DeadVariableElimination : public MemPass { - public: - const char* name() const override { return "dead-variable-elimination"; } - Status Process(ir::Module*) override; - - private: - // Deletes the OpVariable instruction who result id is |result_id|. - void DeleteVariable(uint32_t result_id); - - // Keeps track of the number of references of an id. Once that value is 0, it - // is safe to remove the corresponding instruction. - // - // Note that the special value kMustKeep is used to indicate that the - // instruction cannot be deleted for reasons other that is being explicitly - // referenced. - std::unordered_map reference_count_; - - // Special value used to indicate that an id cannot be safely deleted. - enum { kMustKeep = INT_MAX }; -}; - -} // namespace opt -} // namespace spvtools - -#endif // SPIRV_TOOLS_DEAD_VARIABLE_ELIMINATION_H diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/decoration_manager.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/decoration_manager.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/decoration_manager.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/decoration_manager.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,263 +0,0 @@ -// Copyright (c) 2017 Pierre Moreau -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "decoration_manager.h" - -#include - -namespace spvtools { -namespace opt { -namespace analysis { - -void DecorationManager::RemoveDecorationsFrom(uint32_t id, bool keep_linkage) { - auto const ids_iter = id_to_decoration_insts_.find(id); - if (ids_iter == id_to_decoration_insts_.end()) return; - - for (ir::Instruction* inst : ids_iter->second) { - switch (inst->opcode()) { - case SpvOpDecorate: - case SpvOpDecorateId: - case SpvOpMemberDecorate: - if (!(keep_linkage && inst->GetSingleWordInOperand(1u) == - SpvDecorationLinkageAttributes)) - inst->ToNop(); - break; - case SpvOpGroupDecorate: - for (uint32_t i = 1u; i < inst->NumInOperands(); ++i) { - if (inst->GetSingleWordInOperand(i) == inst->result_id()) { - // TODO(pierremoreau): This could be optimised by copying the last - // operand over this one, or using a compacting - // filtering algorithm over all other IDs - inst->RemoveInOperand(i); - } - } - break; - case SpvOpGroupMemberDecorate: - for (uint32_t i = 1u; i < inst->NumInOperands(); i += 2u) { - if (inst->GetSingleWordInOperand(i) == inst->result_id()) { - // TODO(pierremoreau): Same optimisation opportunity as above. - inst->RemoveInOperand(i); - } - } - break; - default: - break; - } - } -} - -std::vector DecorationManager::GetDecorationsFor( - uint32_t id, bool include_linkage) { - return InternalGetDecorationsFor(id, include_linkage); -} - -std::vector DecorationManager::GetDecorationsFor( - uint32_t id, bool include_linkage) const { - return const_cast(this) - ->InternalGetDecorationsFor(id, include_linkage); -} - -// TODO(pierremoreau): The code will return true for { deco1, deco1 }, { deco1, -// deco2 } when it should return false. -bool DecorationManager::HaveTheSameDecorations(uint32_t id1, - uint32_t id2) const { - const auto decorationsFor1 = GetDecorationsFor(id1, false); - const auto decorationsFor2 = GetDecorationsFor(id2, false); - if (decorationsFor1.size() != decorationsFor2.size()) return false; - - for (const ir::Instruction* inst1 : decorationsFor1) { - bool didFindAMatch = false; - for (const ir::Instruction* inst2 : decorationsFor2) { - if (AreDecorationsTheSame(inst1, inst2)) { - didFindAMatch = true; - break; - } - } - if (!didFindAMatch) return false; - } - return true; -} - -// TODO(pierremoreau): Handle SpvOpDecorateId by converting them to a regular -// SpvOpDecorate. -bool DecorationManager::AreDecorationsTheSame( - const ir::Instruction* inst1, const ir::Instruction* inst2) const { - // const auto decorateIdToDecorate = [&constants](const Instruction& inst) { - // std::vector operands; - // operands.reserve(inst.NumInOperands()); - // for (uint32_t i = 2u; i < inst.NumInOperands(); ++i) { - // const auto& j = constants.find(inst.GetSingleWordInOperand(i)); - // if (j == constants.end()) - // return Instruction(); - // const auto operand = j->second->GetOperand(0u); - // operands.emplace_back(operand.type, operand.words); - // } - // return Instruction(SpvOpDecorate, 0u, 0u, operands); - // }; - // Instruction tmpA = (deco1.opcode() == SpvOpDecorateId) ? - // decorateIdToDecorate(deco1) : deco1; - // Instruction tmpB = (deco2.opcode() == SpvOpDecorateId) ? - // decorateIdToDecorate(deco2) : deco2; - // - if (inst1->opcode() == SpvOpDecorateId || inst2->opcode() == SpvOpDecorateId) - return false; - - ir::Instruction tmpA = *inst1, tmpB = *inst2; - if (tmpA.opcode() != tmpB.opcode() || - tmpA.NumInOperands() != tmpB.NumInOperands() || - tmpA.opcode() == SpvOpNop || tmpB.opcode() == SpvOpNop) - return false; - - for (uint32_t i = (tmpA.opcode() == SpvOpDecorate) ? 1u : 2u; - i < tmpA.NumInOperands(); ++i) - if (tmpA.GetInOperand(i) != tmpB.GetInOperand(i)) return false; - - return true; -} - -void DecorationManager::AnalyzeDecorations(ir::Module* module) { - if (!module) return; - - // Collect all group ids. - for (const ir::Instruction& inst : module->annotations()) { - switch (inst.opcode()) { - case SpvOpDecorationGroup: - group_to_decoration_insts_.insert({inst.result_id(), {}}); - break; - default: - break; - } - } - - // For each group and instruction, collect all their decoration instructions. - for (ir::Instruction& inst : module->annotations()) { - switch (inst.opcode()) { - case SpvOpDecorate: - case SpvOpDecorateId: - case SpvOpMemberDecorate: { - auto const target_id = inst.GetSingleWordInOperand(0u); - auto const group_iter = group_to_decoration_insts_.find(target_id); - if (group_iter != group_to_decoration_insts_.end()) - group_iter->second.push_back(&inst); - else - id_to_decoration_insts_[target_id].push_back(&inst); - break; - } - case SpvOpGroupDecorate: - for (uint32_t i = 1u; i < inst.NumInOperands(); ++i) { - auto const target_id = inst.GetSingleWordInOperand(i); - auto const group_iter = group_to_decoration_insts_.find(target_id); - if (group_iter != group_to_decoration_insts_.end()) - group_iter->second.push_back(&inst); - else - id_to_decoration_insts_[target_id].push_back(&inst); - } - break; - case SpvOpGroupMemberDecorate: - for (uint32_t i = 1u; i < inst.NumInOperands(); i += 2u) { - auto const target_id = inst.GetSingleWordInOperand(i); - auto const group_iter = group_to_decoration_insts_.find(target_id); - if (group_iter != group_to_decoration_insts_.end()) - group_iter->second.push_back(&inst); - else - id_to_decoration_insts_[target_id].push_back(&inst); - } - break; - default: - break; - } - } -} - -template -std::vector DecorationManager::InternalGetDecorationsFor( - uint32_t id, bool include_linkage) { - std::vector decorations; - std::stack ids_to_process; - - const auto process = [&ids_to_process, &decorations](T inst) { - if (inst->opcode() == SpvOpGroupDecorate || - inst->opcode() == SpvOpGroupMemberDecorate) - ids_to_process.push(inst->GetSingleWordInOperand(0u)); - else - decorations.push_back(inst); - }; - - const auto ids_iter = id_to_decoration_insts_.find(id); - // |id| has no decorations - if (ids_iter == id_to_decoration_insts_.end()) return decorations; - - // Process |id|'s decorations. Some of them might be groups, in which case - // add them to the stack. - for (ir::Instruction* inst : ids_iter->second) { - const bool is_linkage = - inst->opcode() == SpvOpDecorate && - inst->GetSingleWordInOperand(1u) == SpvDecorationLinkageAttributes; - if (include_linkage || !is_linkage) process(inst); - } - - // If the stack is not empty, then it contains groups ID: retrieve their - // decorations and process them. If any of those decorations is applying a - // group, push that group ID onto the stack. - while (!ids_to_process.empty()) { - const uint32_t id_to_process = ids_to_process.top(); - ids_to_process.pop(); - - // Retrieve the decorations of that group - const auto group_iter = group_to_decoration_insts_.find(id_to_process); - if (group_iter != group_to_decoration_insts_.end()) { - // Process all the decorations applied by the group. - for (T inst : group_iter->second) process(inst); - } else { - // Something went wrong. - assert(false); - return std::vector(); - } - } - - return decorations; -} - -void DecorationManager::ForEachDecoration(uint32_t id, - uint32_t decoration, - std::function f) const { - auto decoration_list = id_to_decoration_insts_.find(id); - if (decoration_list != id_to_decoration_insts_.end()) { - for (const ir::Instruction* inst : decoration_list->second) { - switch (inst->opcode()) { - case SpvOpDecorate: - if (inst->GetSingleWordInOperand(1) == decoration) { - f(*inst); - } - break; - case SpvOpMemberDecorate: - if (inst->GetSingleWordInOperand(2) == decoration) { - f(*inst); - } - break; - case SpvOpDecorateId: - if (inst->GetSingleWordInOperand(1) == decoration) { - f(*inst); - } - break; - default: - assert(false && "Unexpected decoration instruction"); - } - } - } -} - -} // namespace analysis -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/decoration_manager.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/decoration_manager.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/decoration_manager.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/decoration_manager.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -// Copyright (c) 2017 Pierre Moreau -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_DECORATION_MANAGER_H_ -#define LIBSPIRV_OPT_DECORATION_MANAGER_H_ - -#include -#include -#include - -#include "instruction.h" -#include "module.h" - -namespace spvtools { -namespace opt { -namespace analysis { - -// A class for analyzing and managing decorations in an ir::Module. -class DecorationManager { - public: - // Constructs a decoration manager from the given |module| - DecorationManager(ir::Module* module) { AnalyzeDecorations(module); } - // Removes all decorations from |id|, which should not be a group ID, except - // for linkage decorations if |keep_linkage| is set. - void RemoveDecorationsFrom(uint32_t id, bool keep_linkage); - // Returns a vector of all decorations affecting |id|. If a group is applied - // to |id|, the decorations of that group are returned rather than the group - // decoration instruction. If |include_linkage| is not set, linkage - // decorations won't be returned. - std::vector GetDecorationsFor(uint32_t id, - bool include_linkage); - std::vector GetDecorationsFor( - uint32_t id, bool include_linkage) const; - // Returns whether two IDs have the same decorations. Two SpvOpGroupDecorate - // instructions that apply the same decorations but to different IDs, still - // count as being the same. - bool HaveTheSameDecorations(uint32_t id1, uint32_t id2) const; - // Returns whether two decorations are the same. SpvOpDecorateId is currently - // not handled and will return false no matter what. - bool AreDecorationsTheSame(const ir::Instruction* inst1, - const ir::Instruction* inst2) const; - - // |f| is run on each decoration instruction for |id| with decoration - // |decoration|. - void ForEachDecoration(uint32_t id, uint32_t decoration, - std::function) const; - - private: - using IdToDecorationInstsMap = - std::unordered_map>; - // Analyzes the defs and uses in the given |module| and populates data - // structures in this class. Does nothing if |module| is nullptr. - void AnalyzeDecorations(ir::Module* module); - - template - std::vector InternalGetDecorationsFor(uint32_t id, bool include_linkage); - - // Mapping from ids to the instructions applying a decoration to them. In - // other words, for each id you get all decoration instructions referencing - // that id, be it directly (SpvOpDecorate, SpvOpMemberDecorate and - // SpvOpDecorateId), or indirectly (SpvOpGroupDecorate, - // SpvOpMemberGroupDecorate). - IdToDecorationInstsMap id_to_decoration_insts_; - // Mapping from group ids to all the decoration instructions they apply. - IdToDecorationInstsMap group_to_decoration_insts_; -}; - -} // namespace analysis -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_DECORATION_MANAGER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/def_use_manager.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/def_use_manager.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/def_use_manager.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/def_use_manager.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,213 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "def_use_manager.h" - -#include "log.h" -#include "reflect.h" - -namespace spvtools { -namespace opt { -namespace analysis { - -void DefUseManager::AnalyzeInstDef(ir::Instruction* inst) { - const uint32_t def_id = inst->result_id(); - if (def_id != 0) { - auto iter = id_to_def_.find(def_id); - if (iter != id_to_def_.end()) { - // Clear the original instruction that defining the same result id of the - // new instruction. - ClearInst(iter->second); - } - id_to_def_[def_id] = inst; - } - else { - ClearInst(inst); - } -} - -void DefUseManager::AnalyzeInstUse(ir::Instruction* inst) { - // Create entry for the given instruction. Note that the instruction may - // not have any in-operands. In such cases, we still need a entry for those - // instructions so this manager knows it has seen the instruction later. - inst_to_used_ids_[inst] = {}; - - for (uint32_t i = 0; i < inst->NumOperands(); ++i) { - switch (inst->GetOperand(i).type) { - // For any id type but result id type - case SPV_OPERAND_TYPE_ID: - case SPV_OPERAND_TYPE_TYPE_ID: - case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: - case SPV_OPERAND_TYPE_SCOPE_ID: { - uint32_t use_id = inst->GetSingleWordOperand(i); - // use_id is used by the instruction generating def_id. - id_to_uses_[use_id].push_back({ inst, i }); - inst_to_used_ids_[inst].push_back(use_id); - } break; - default: - break; - } - } -} - -void DefUseManager::AnalyzeInstDefUse(ir::Instruction* inst) { - AnalyzeInstDef(inst); - AnalyzeInstUse(inst); -} - -ir::Instruction* DefUseManager::GetDef(uint32_t id) { - auto iter = id_to_def_.find(id); - if (iter == id_to_def_.end()) return nullptr; - return iter->second; -} - -const ir::Instruction* DefUseManager::GetDef(uint32_t id) const { - const auto iter = id_to_def_.find(id); - if (iter == id_to_def_.end()) return nullptr; - return iter->second; -} - -UseList* DefUseManager::GetUses(uint32_t id) { - auto iter = id_to_uses_.find(id); - if (iter == id_to_uses_.end()) return nullptr; - return &iter->second; -} - -const UseList* DefUseManager::GetUses(uint32_t id) const { - const auto iter = id_to_uses_.find(id); - if (iter == id_to_uses_.end()) return nullptr; - return &iter->second; -} - -std::vector DefUseManager::GetAnnotations(uint32_t id) const { - std::vector annos; - const auto* uses = GetUses(id); - if (!uses) return annos; - for (const auto& c : *uses) { - if (ir::IsAnnotationInst(c.inst->opcode())) { - annos.push_back(c.inst); - } - } - return annos; -} - -bool DefUseManager::KillDef(uint32_t id) { - auto iter = id_to_def_.find(id); - if (iter == id_to_def_.end()) return false; - KillInst(iter->second); - return true; -} - -void DefUseManager::KillInst(ir::Instruction* inst) { - if (!inst) return; - ClearInst(inst); - inst->ToNop(); -} - -bool DefUseManager::ReplaceAllUsesWith(uint32_t before, uint32_t after) { - if (before == after) return false; - if (id_to_uses_.count(before) == 0) return false; - - for (auto it = id_to_uses_[before].cbegin(); it != id_to_uses_[before].cend(); - ++it) { - const uint32_t type_result_id_count = - (it->inst->result_id() != 0) + (it->inst->type_id() != 0); - - if (it->operand_index < type_result_id_count) { - // Update the type_id. Note that result id is immutable so it should - // never be updated. - if (it->inst->type_id() != 0 && it->operand_index == 0) { - it->inst->SetResultType(after); - } else if (it->inst->type_id() == 0) { - SPIRV_ASSERT(consumer_, false, - "Result type id considered as use while the instruction " - "doesn't have a result type id."); - (void)consumer_; // Makes the compiler happy for release build. - } else { - SPIRV_ASSERT(consumer_, false, - "Trying setting the immutable result id."); - } - } else { - // Update an in-operand. - uint32_t in_operand_pos = it->operand_index - type_result_id_count; - // Make the modification in the instruction. - it->inst->SetInOperand(in_operand_pos, {after}); - } - // Update inst to used ids map - auto iter = inst_to_used_ids_.find(it->inst); - if (iter != inst_to_used_ids_.end()) - for (auto uit = iter->second.begin(); uit != iter->second.end(); uit++) - if (*uit == before) *uit = after; - // Register the use of |after| id into id_to_uses_. - // TODO(antiagainst): de-duplication. - id_to_uses_[after].push_back({it->inst, it->operand_index}); - } - id_to_uses_.erase(before); - return true; -} - -void DefUseManager::AnalyzeDefUse(ir::Module* module) { - if (!module) return; - module->ForEachInst(std::bind(&DefUseManager::AnalyzeInstDefUse, this, - std::placeholders::_1)); -} - -void DefUseManager::ClearInst(ir::Instruction* inst) { - auto iter = inst_to_used_ids_.find(inst); - if (iter != inst_to_used_ids_.end()) { - EraseUseRecordsOfOperandIds(inst); - if (inst->result_id() != 0) { - id_to_uses_.erase(inst->result_id()); // Remove all uses of this id. - id_to_def_.erase(inst->result_id()); - } - } -} - -void DefUseManager::EraseUseRecordsOfOperandIds(const ir::Instruction* inst) { - // Go through all ids used by this instruction, remove this instruction's - // uses of them. - // - // We cache end iterators to avoid the cost of repeatedly constructing - // and destructing their value. This cuts runtime on some examples by - // a factor of about 3 (e.g. on Windows debug builds, with many thousands - // of instructions). - auto iter = inst_to_used_ids_.find(inst); - if (iter != inst_to_used_ids_.end()) { - // Cache the end iterator on the map. The end iterator on - // an unordered map does not get invalidated when erasing an - // element. - const auto& id_to_uses_end = id_to_uses_.end(); - for (const auto use_id : iter->second) { - auto uses_iter = id_to_uses_.find(use_id); - if (uses_iter == id_to_uses_end) continue; - auto& uses = uses_iter->second; - // Similarly, cache this end iterator. It is not invalidated - // by erasure of an element from the list. - const auto& uses_end = uses.end(); - for (auto it = uses.begin(); it != uses_end;) { - if (it->inst == inst) { - it = uses.erase(it); - } else { - ++it; - } - } - if (uses.empty()) id_to_uses_.erase(use_id); - } - inst_to_used_ids_.erase(inst); - } -} - -} // namespace analysis -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/def_use_manager.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/def_use_manager.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/def_use_manager.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/def_use_manager.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,136 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_DEF_USE_MANAGER_H_ -#define LIBSPIRV_OPT_DEF_USE_MANAGER_H_ - -#include -#include -#include - -#include "instruction.h" -#include "module.h" -#include "spirv-tools/libspirv.hpp" - -namespace spvtools { -namespace opt { -namespace analysis { - -// Class for representing a use of id. Note that: -// * Result type id is a use. -// * Ids referenced in OpSectionMerge & OpLoopMerge are considered as use. -// * Ids referenced in OpPhi's in operands are considered as use. -struct Use { - ir::Instruction* inst; // Instruction using the id. - uint32_t operand_index; // logical operand index of the id use. This can be - // the index of result type id. -}; - -using UseList = std::list; - -// A class for analyzing and managing defs and uses in an ir::Module. -class DefUseManager { - public: - using IdToDefMap = std::unordered_map; - using IdToUsesMap = std::unordered_map; - - // Constructs a def-use manager from the given |module|. All internal messages - // will be communicated to the outside via the given message |consumer|. This - // instance only keeps a reference to the |consumer|, so the |consumer| should - // outlive this instance. - DefUseManager(const MessageConsumer& consumer, ir::Module* module) - : consumer_(consumer) { - AnalyzeDefUse(module); - } - - DefUseManager(const DefUseManager&) = delete; - DefUseManager(DefUseManager&&) = delete; - DefUseManager& operator=(const DefUseManager&) = delete; - DefUseManager& operator=(DefUseManager&&) = delete; - - // Analyzes the defs in the given |inst|. - void AnalyzeInstDef(ir::Instruction* inst); - - // Analyzes the uses in the given |inst|. - void AnalyzeInstUse(ir::Instruction* inst); - - // Analyzes the defs and uses in the given |inst|. - void AnalyzeInstDefUse(ir::Instruction* inst); - - // Returns the def instruction for the given |id|. If there is no instruction - // defining |id|, returns nullptr. - ir::Instruction* GetDef(uint32_t id); - const ir::Instruction* GetDef(uint32_t id) const; - // Returns the use instructions for the given |id|. If there is no uses of - // |id|, returns nullptr. - UseList* GetUses(uint32_t id); - const UseList* GetUses(uint32_t id) const; - // Returns the annotation instrunctions which are a direct use of the given - // |id|. This means when the decorations are applied through decoration - // group(s), this function will just return the OpGroupDecorate - // instrcution(s) which refer to the given id as an operand. The OpDecorate - // instructions which decorate the decoration group will not be returned. - std::vector GetAnnotations(uint32_t id) const; - - // Returns the map from ids to their def instructions. - const IdToDefMap& id_to_defs() const { return id_to_def_; } - // Returns the map from ids to their uses in instructions. - const IdToUsesMap& id_to_uses() const { return id_to_uses_; } - - // Turns the instruction defining the given |id| into a Nop. Returns true on - // success, false if the given |id| is not defined at all. This method also - // erases both the uses of |id| and the information of this |id|-generating - // instruction's uses of its operands. - bool KillDef(uint32_t id); - // Turns the given instruction |inst| to a Nop. This method erases the - // information of the given instruction's uses of its operands. If |inst| - // defines an result id, the uses of the result id will also be erased. - void KillInst(ir::Instruction* inst); - // Replaces all uses of |before| id with |after| id. Returns true if any - // replacement happens. This method does not kill the definition of the - // |before| id. If |after| is the same as |before|, does nothing and returns - // false. - bool ReplaceAllUsesWith(uint32_t before, uint32_t after); - - private: - using InstToUsedIdsMap = - std::unordered_map>; - - // Analyzes the defs and uses in the given |module| and populates data - // structures in this class. Does nothing if |module| is nullptr. - void AnalyzeDefUse(ir::Module* module); - - // Clear the internal def-use record of the given instruction |inst|. This - // method will update the use information of the operand ids of |inst|. The - // record: |inst| uses an |id|, will be removed from the use records of |id|. - // If |inst| defines an result id, the use record of this result id will also - // be removed. Does nothing if |inst| was not analyzed before. - void ClearInst(ir::Instruction* inst); - - // Erases the records that a given instruction uses its operand ids. - void EraseUseRecordsOfOperandIds(const ir::Instruction* inst); - - const MessageConsumer& consumer_; // Message consumer. - IdToDefMap id_to_def_; // Mapping from ids to their definitions - IdToUsesMap id_to_uses_; // Mapping from ids to their uses - // Mapping from instructions to the ids used in the instructions generating - // the result ids. - InstToUsedIdsMap inst_to_used_ids_; -}; - -} // namespace analysis -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_DEF_USE_MANAGER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/eliminate_dead_constant_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/eliminate_dead_constant_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/eliminate_dead_constant_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/eliminate_dead_constant_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "eliminate_dead_constant_pass.h" - -#include -#include -#include - -#include "def_use_manager.h" -#include "log.h" -#include "reflect.h" - -namespace spvtools { -namespace opt { - -Pass::Status EliminateDeadConstantPass::Process(ir::Module* module) { - analysis::DefUseManager def_use(consumer(), module); - std::unordered_set working_list; - // Traverse all the instructions to get the initial set of dead constants as - // working list and count number of real uses for constants. Uses in - // annotation instructions do not count. - std::unordered_map use_counts; - std::vector constants = module->GetConstants(); - for (auto* c : constants) { - uint32_t const_id = c->result_id(); - size_t count = 0; - if (analysis::UseList* uses = def_use.GetUses(const_id)) { - count = - std::count_if(uses->begin(), uses->end(), [](const analysis::Use& u) { - return !(ir::IsAnnotationInst(u.inst->opcode()) || - ir::IsDebug1Inst(u.inst->opcode()) || - ir::IsDebug2Inst(u.inst->opcode()) || - ir::IsDebug3Inst(u.inst->opcode())); - }); - } - use_counts[c] = count; - if (!count) { - working_list.insert(c); - } - } - - // Start from the constants with 0 uses, back trace through the def-use chain - // to find all dead constants. - std::unordered_set dead_consts; - while (!working_list.empty()) { - ir::Instruction* inst = *working_list.begin(); - // Back propagate if the instruction contains IDs in its operands. - switch (inst->opcode()) { - case SpvOp::SpvOpConstantComposite: - case SpvOp::SpvOpSpecConstantComposite: - case SpvOp::SpvOpSpecConstantOp: - for (uint32_t i = 0; i < inst->NumInOperands(); i++) { - // SpecConstantOp instruction contains 'opcode' as its operand. Need - // to exclude such operands when decreasing uses. - if (inst->GetInOperand(i).type != SPV_OPERAND_TYPE_ID) { - continue; - } - uint32_t operand_id = inst->GetSingleWordInOperand(i); - ir::Instruction* def_inst = def_use.GetDef(operand_id); - // If the use_count does not have any count for the def_inst, - // def_inst must not be a constant, and should be ignored here. - if (!use_counts.count(def_inst)) { - continue; - } - // The number of uses should never be less then 0, so it can not be - // less than 1 before it decreases. - SPIRV_ASSERT(consumer(), use_counts[def_inst] > 0); - --use_counts[def_inst]; - if (!use_counts[def_inst]) { - working_list.insert(def_inst); - } - } - break; - default: - break; - } - dead_consts.insert(inst); - working_list.erase(inst); - } - - // Find all annotation and debug instructions that are referencing dead - // constants. - std::unordered_set dead_others; - for (auto* dc : dead_consts) { - if (analysis::UseList* uses = def_use.GetUses(dc->result_id())) { - for (const auto& u : *uses) { - if (ir::IsAnnotationInst(u.inst->opcode()) || - ir::IsDebug1Inst(u.inst->opcode()) || - ir::IsDebug2Inst(u.inst->opcode()) || - ir::IsDebug3Inst(u.inst->opcode())) { - dead_others.insert(u.inst); - } - } - } - } - - // Turn all dead instructions and uses of them to nop - for (auto* dc : dead_consts) { - def_use.KillDef(dc->result_id()); - } - for (auto* da : dead_others) { - da->ToNop(); - } - return dead_consts.empty() ? Status::SuccessWithoutChange - : Status::SuccessWithChange; -} - -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/eliminate_dead_constant_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/eliminate_dead_constant_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/eliminate_dead_constant_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/eliminate_dead_constant_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_ELIMINATE_DEAD_CONSTANT_PASS_H_ -#define LIBSPIRV_OPT_ELIMINATE_DEAD_CONSTANT_PASS_H_ - -#include "module.h" -#include "pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class EliminateDeadConstantPass : public Pass { - public: - const char* name() const override { return "eliminate-dead-const"; } - Status Process(ir::Module*) override; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_ELIMINATE_DEAD_CONSTANT_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/eliminate_dead_functions_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/eliminate_dead_functions_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/eliminate_dead_functions_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/eliminate_dead_functions_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include "eliminate_dead_functions_pass.h" - -#include - -namespace spvtools { -namespace opt { - -Pass::Status EliminateDeadFunctionsPass::Process(ir::Module* module) { - bool modified = false; - module_ = module; - - // Identify live functions first. Those that are not live - // are dead. - std::unordered_set live_function_set; - ProcessFunction mark_live = [&live_function_set](ir::Function* fp) { - live_function_set.insert(fp); - return false; - }; - ProcessReachableCallTree(mark_live, module); - - def_use_mgr_.reset(new analysis::DefUseManager(consumer(), module)); - FindNamedOrDecoratedIds(); - for (auto funcIter = module->begin(); funcIter != module->end();) { - if (live_function_set.count(&*funcIter) == 0) { - modified = true; - EliminateFunction(&*funcIter); - funcIter = funcIter.Erase(); - } else { - ++funcIter; - } - } - - return modified ? Pass::Status::SuccessWithChange - : Pass::Status::SuccessWithoutChange; -} - -void EliminateDeadFunctionsPass::EliminateFunction(ir::Function* func) { - // Remove all of the instruction in the function body - func->ForEachInst( - [this](ir::Instruction* inst) { - KillNamesAndDecorates(inst); - def_use_mgr_->KillInst(inst); - }, - true); -} -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/eliminate_dead_functions_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/eliminate_dead_functions_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/eliminate_dead_functions_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/eliminate_dead_functions_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_ELIMINATE_DEAD_FUNCTIONS_PASS_H_ -#define LIBSPIRV_OPT_ELIMINATE_DEAD_FUNCTIONS_PASS_H_ - -#include "def_use_manager.h" -#include "function.h" -#include "mem_pass.h" -#include "module.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class EliminateDeadFunctionsPass : public MemPass { - public: - const char* name() const override { return "eliminate-dead-functions"; } - Status Process(ir::Module*) override; - - private: - void EliminateFunction(ir::Function* func); -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_ELIMINATE_DEAD_FUNCTIONS_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/flatten_decoration_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/flatten_decoration_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/flatten_decoration_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/flatten_decoration_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,164 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include "flatten_decoration_pass.h" - -#include -#include -#include -#include - -namespace spvtools { -namespace opt { - -using ir::Instruction; -using ir::Operand; - -using Words = std::vector; -using OrderedUsesMap = std::unordered_map; - -Pass::Status FlattenDecorationPass::Process(ir::Module* module) { - bool modified = false; - - // The target Id of OpDecorationGroup instructions. - // We have to track this separately from its uses, in case it - // has no uses. - std::unordered_set group_ids; - // Maps a decoration group Id to its GroupDecorate targets, in order - // of appearance. - OrderedUsesMap normal_uses; - // Maps a decoration group Id to its GroupMemberDecorate targets and - // their indices, in of appearance. - OrderedUsesMap member_uses; - - auto annotations = module->annotations(); - - // On the first pass, record each OpDecorationGroup with its ordered uses. - // Rely on unordered_map::operator[] to create its entries on first access. - for (const auto& inst : annotations) { - switch (inst.opcode()) { - case SpvOp::SpvOpDecorationGroup: - group_ids.insert(inst.result_id()); - break; - case SpvOp::SpvOpGroupDecorate: { - Words& words = normal_uses[inst.GetSingleWordInOperand(0)]; - for (uint32_t i = 1; i < inst.NumInOperandWords(); i++) { - words.push_back(inst.GetSingleWordInOperand(i)); - } - } break; - case SpvOp::SpvOpGroupMemberDecorate: { - Words& words = member_uses[inst.GetSingleWordInOperand(0)]; - for (uint32_t i = 1; i < inst.NumInOperandWords(); i++) { - words.push_back(inst.GetSingleWordInOperand(i)); - } - } break; - default: - break; - } - } - - // On the second pass, replace OpDecorationGroup and its uses with - // equivalent normal and struct member uses. - auto inst_iter = annotations.begin(); - // We have to re-evaluate the end pointer - while (inst_iter != module->annotations().end()) { - // Should we replace this instruction? - bool replace = false; - switch (inst_iter->opcode()) { - case SpvOp::SpvOpDecorationGroup: - case SpvOp::SpvOpGroupDecorate: - case SpvOp::SpvOpGroupMemberDecorate: - replace = true; - break; - case SpvOp::SpvOpDecorate: { - // If this decoration targets a group, then replace it - // by sets of normal and member decorations. - const uint32_t group = inst_iter->GetSingleWordOperand(0); - const auto normal_uses_iter = normal_uses.find(group); - if (normal_uses_iter != normal_uses.end()) { - for (auto target : normal_uses[group]) { - std::unique_ptr new_inst(new Instruction(*inst_iter)); - new_inst->SetInOperand(0, Words{target}); - inst_iter = inst_iter.InsertBefore(std::move(new_inst)); - ++inst_iter; - replace = true; - } - } - const auto member_uses_iter = member_uses.find(group); - if (member_uses_iter != member_uses.end()) { - const Words& member_id_pairs = (*member_uses_iter).second; - // The collection is a sequence of pairs. - assert((member_id_pairs.size() % 2) == 0); - for (size_t i = 0; i < member_id_pairs.size(); i += 2) { - // Make an OpMemberDecorate instruction for each (target, member) - // pair. - const uint32_t target = member_id_pairs[i]; - const uint32_t member = member_id_pairs[i + 1]; - std::vector operands; - operands.push_back(Operand(SPV_OPERAND_TYPE_ID, {target})); - operands.push_back( - Operand(SPV_OPERAND_TYPE_LITERAL_INTEGER, {member})); - auto decoration_operands_iter = inst_iter->begin(); - decoration_operands_iter++; // Skip the group target. - operands.insert(operands.end(), decoration_operands_iter, - inst_iter->end()); - std::unique_ptr new_inst( - new Instruction(SpvOp::SpvOpMemberDecorate, 0, 0, operands)); - inst_iter = inst_iter.InsertBefore(std::move(new_inst)); - ++inst_iter; - replace = true; - } - } - // If this is an OpDecorate targeting the OpDecorationGroup itself, - // remove it even if that decoration group itself is not the target of - // any OpGroupDecorate or OpGroupMemberDecorate. - if (!replace && group_ids.count(group)) { - replace = true; - } - } break; - default: - break; - } - if (replace) { - inst_iter = inst_iter.Erase(); - modified = true; - } else { - // Handle the case of decorations unrelated to decoration groups. - ++inst_iter; - } - } - - // Remove OpName instructions which reference the removed group decorations. - // An OpDecorationGroup instruction might not have been used by an - // OpGroupDecorate or OpGroupMemberDecorate instruction. - if (!group_ids.empty()) { - for (auto debug_inst_iter = module->debug2_begin(); - debug_inst_iter != module->debug2_end();) { - if (debug_inst_iter->opcode() == SpvOp::SpvOpName) { - const uint32_t target = debug_inst_iter->GetSingleWordOperand(0); - if (group_ids.count(target)) { - debug_inst_iter = debug_inst_iter.Erase(); - modified = true; - } else { - ++debug_inst_iter; - } - } - } - } - - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/flatten_decoration_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/flatten_decoration_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/flatten_decoration_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/flatten_decoration_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_FLATTEN_DECORATION_PASS_H_ -#define LIBSPIRV_OPT_FLATTEN_DECORATION_PASS_H_ - -#include "module.h" -#include "pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class FlattenDecorationPass : public Pass { - public: - const char* name() const override { return "flatten-decoration"; } - Status Process(ir::Module*) override; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_FLATTEN_DECORATION_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/fold.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/fold.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/fold.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/fold.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,244 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include "fold.h" -#include "def_use_manager.h" - -#include -#include - -namespace spvtools { -namespace opt { - -namespace { - -// Returns the single-word result from performing the given unary operation on -// the operand value which is passed in as a 32-bit word. -uint32_t UnaryOperate(SpvOp opcode, uint32_t operand) { - switch (opcode) { - // Arthimetics - case SpvOp::SpvOpSNegate: - return -static_cast(operand); - case SpvOp::SpvOpNot: - return ~operand; - case SpvOp::SpvOpLogicalNot: - return !static_cast(operand); - default: - assert(false && - "Unsupported unary operation for OpSpecConstantOp instruction"); - return 0u; - } -} - -// Returns the single-word result from performing the given binary operation on -// the operand values which are passed in as two 32-bit word. -uint32_t BinaryOperate(SpvOp opcode, uint32_t a, uint32_t b) { - switch (opcode) { - // Arthimetics - case SpvOp::SpvOpIAdd: - return a + b; - case SpvOp::SpvOpISub: - return a - b; - case SpvOp::SpvOpIMul: - return a * b; - case SpvOp::SpvOpUDiv: - assert(b != 0); - return a / b; - case SpvOp::SpvOpSDiv: - assert(b != 0u); - return (static_cast(a)) / (static_cast(b)); - case SpvOp::SpvOpSRem: { - // The sign of non-zero result comes from the first operand: a. This is - // guaranteed by C++11 rules for integer division operator. The division - // result is rounded toward zero, so the result of '%' has the sign of - // the first operand. - assert(b != 0u); - return static_cast(a) % static_cast(b); - } - case SpvOp::SpvOpSMod: { - // The sign of non-zero result comes from the second operand: b - assert(b != 0u); - int32_t rem = BinaryOperate(SpvOp::SpvOpSRem, a, b); - int32_t b_prim = static_cast(b); - return (rem + b_prim) % b_prim; - } - case SpvOp::SpvOpUMod: - assert(b != 0u); - return (a % b); - - // Shifting - case SpvOp::SpvOpShiftRightLogical: { - return a >> b; - } - case SpvOp::SpvOpShiftRightArithmetic: - return (static_cast(a)) >> b; - case SpvOp::SpvOpShiftLeftLogical: - return a << b; - - // Bitwise operations - case SpvOp::SpvOpBitwiseOr: - return a | b; - case SpvOp::SpvOpBitwiseAnd: - return a & b; - case SpvOp::SpvOpBitwiseXor: - return a ^ b; - - // Logical - case SpvOp::SpvOpLogicalEqual: - return (static_cast(a)) == (static_cast(b)); - case SpvOp::SpvOpLogicalNotEqual: - return (static_cast(a)) != (static_cast(b)); - case SpvOp::SpvOpLogicalOr: - return (static_cast(a)) || (static_cast(b)); - case SpvOp::SpvOpLogicalAnd: - return (static_cast(a)) && (static_cast(b)); - - // Comparison - case SpvOp::SpvOpIEqual: - return a == b; - case SpvOp::SpvOpINotEqual: - return a != b; - case SpvOp::SpvOpULessThan: - return a < b; - case SpvOp::SpvOpSLessThan: - return (static_cast(a)) < (static_cast(b)); - case SpvOp::SpvOpUGreaterThan: - return a > b; - case SpvOp::SpvOpSGreaterThan: - return (static_cast(a)) > (static_cast(b)); - case SpvOp::SpvOpULessThanEqual: - return a <= b; - case SpvOp::SpvOpSLessThanEqual: - return (static_cast(a)) <= (static_cast(b)); - case SpvOp::SpvOpUGreaterThanEqual: - return a >= b; - case SpvOp::SpvOpSGreaterThanEqual: - return (static_cast(a)) >= (static_cast(b)); - default: - assert(false && - "Unsupported binary operation for OpSpecConstantOp instruction"); - return 0u; - } -} - -// Returns the single-word result from performing the given ternary operation -// on the operand values which are passed in as three 32-bit word. -uint32_t TernaryOperate(SpvOp opcode, uint32_t a, uint32_t b, uint32_t c) { - switch (opcode) { - case SpvOp::SpvOpSelect: - return (static_cast(a)) ? b : c; - default: - assert(false && - "Unsupported ternary operation for OpSpecConstantOp instruction"); - return 0u; - } -} - -// Returns the single-word result from performing the given operation on the -// operand words. This only works with 32-bit operations and uses boolean -// convention that 0u is false, and anything else is boolean true. -// TODO(qining): Support operands other than 32-bit wide. -uint32_t OperateWords(SpvOp opcode, - const std::vector& operand_words) { - switch (operand_words.size()) { - case 1: - return UnaryOperate(opcode, operand_words.front()); - case 2: - return BinaryOperate(opcode, operand_words.front(), operand_words.back()); - case 3: - return TernaryOperate(opcode, operand_words[0], operand_words[1], - operand_words[2]); - default: - assert(false && "Invalid number of operands"); - return 0; - } -} - -} // namespace - -// Returns the result of performing an operation on scalar constant operands. -// This function extracts the operand values as 32 bit words and returns the -// result in 32 bit word. Scalar constants with longer than 32-bit width are -// not accepted in this function. -uint32_t FoldScalars(SpvOp opcode, - const std::vector& operands) { - std::vector operand_values_in_raw_words; - for (analysis::Constant* operand : operands) { - if (analysis::ScalarConstant* scalar = operand->AsScalarConstant()) { - const auto& scalar_words = scalar->words(); - assert(scalar_words.size() == 1 && - "Scalar constants with longer than 32-bit width are not allowed " - "in FoldScalars()"); - operand_values_in_raw_words.push_back(scalar_words.front()); - } else if (operand->AsNullConstant()) { - operand_values_in_raw_words.push_back(0u); - } else { - assert(false && - "FoldScalars() only accepts ScalarConst or NullConst type of " - "constant"); - } - } - return OperateWords(opcode, operand_values_in_raw_words); -} - -// Returns the result of performing an operation over constant vectors. This -// function iterates through the given vector type constant operands and -// calculates the result for each element of the result vector to return. -// Vectors with longer than 32-bit scalar components are not accepted in this -// function. -std::vector FoldVectors( - SpvOp opcode, uint32_t num_dims, - const std::vector& operands) { - std::vector result; - for (uint32_t d = 0; d < num_dims; d++) { - std::vector operand_values_for_one_dimension; - for (analysis::Constant* operand : operands) { - if (analysis::VectorConstant* vector_operand = - operand->AsVectorConstant()) { - // Extract the raw value of the scalar component constants - // in 32-bit words here. The reason of not using FoldScalars() here - // is that we do not create temporary null constants as components - // when the vector operand is a NullConstant because Constant creation - // may need extra checks for the validity and that is not manageed in - // here. - if (const analysis::ScalarConstant* scalar_component = - vector_operand->GetComponents().at(d)->AsScalarConstant()) { - const auto& scalar_words = scalar_component->words(); - assert( - scalar_words.size() == 1 && - "Vector components with longer than 32-bit width are not allowed " - "in FoldVectors()"); - operand_values_for_one_dimension.push_back(scalar_words.front()); - } else if (operand->AsNullConstant()) { - operand_values_for_one_dimension.push_back(0u); - } else { - assert(false && - "VectorConst should only has ScalarConst or NullConst as " - "components"); - } - } else if (operand->AsNullConstant()) { - operand_values_for_one_dimension.push_back(0u); - } else { - assert(false && - "FoldVectors() only accepts VectorConst or NullConst type of " - "constant"); - } - } - result.push_back(OperateWords(opcode, operand_values_for_one_dimension)); - } - return result; -} - -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/fold.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/fold.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/fold.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/fold.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_UTIL_FOLD_H_ -#define LIBSPIRV_UTIL_FOLD_H_ - -#include "def_use_manager.h" -#include "constants.h" - -#include -#include - -namespace spvtools { -namespace opt { - -uint32_t FoldScalars(SpvOp opcode, - const std::vector& operands); - -std::vector FoldVectors( - SpvOp opcode, uint32_t num_dims, - const std::vector& operands); - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_UTIL_FOLD_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,777 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "fold_spec_constant_op_and_composite_pass.h" - -#include -#include -#include - -#include "constants.h" -#include "make_unique.h" - -namespace spvtools { -namespace opt { - -namespace { -// Returns the single-word result from performing the given unary operation on -// the operand value which is passed in as a 32-bit word. -uint32_t UnaryOperate(SpvOp opcode, uint32_t operand) { - switch (opcode) { - // Arthimetics - case SpvOp::SpvOpSNegate: - return -static_cast(operand); - case SpvOp::SpvOpNot: - return ~operand; - case SpvOp::SpvOpLogicalNot: - return !static_cast(operand); - default: - assert(false && - "Unsupported unary operation for OpSpecConstantOp instruction"); - return 0u; - } -} - -// Returns the single-word result from performing the given binary operation on -// the operand values which are passed in as two 32-bit word. -uint32_t BinaryOperate(SpvOp opcode, uint32_t a, uint32_t b) { - switch (opcode) { - // Arthimetics - case SpvOp::SpvOpIAdd: - return a + b; - case SpvOp::SpvOpISub: - return a - b; - case SpvOp::SpvOpIMul: - return a * b; - case SpvOp::SpvOpUDiv: - assert(b != 0); - return a / b; - case SpvOp::SpvOpSDiv: - assert(b != 0u); - return (static_cast(a)) / (static_cast(b)); - case SpvOp::SpvOpSRem: { - // The sign of non-zero result comes from the first operand: a. This is - // guaranteed by C++11 rules for integer division operator. The division - // result is rounded toward zero, so the result of '%' has the sign of - // the first operand. - assert(b != 0u); - return static_cast(a) % static_cast(b); - } - case SpvOp::SpvOpSMod: { - // The sign of non-zero result comes from the second operand: b - assert(b != 0u); - int32_t rem = BinaryOperate(SpvOp::SpvOpSRem, a, b); - int32_t b_prim = static_cast(b); - return (rem + b_prim) % b_prim; - } - case SpvOp::SpvOpUMod: - assert(b != 0u); - return (a % b); - - // Shifting - case SpvOp::SpvOpShiftRightLogical: { - return a >> b; - } - case SpvOp::SpvOpShiftRightArithmetic: - return (static_cast(a)) >> b; - case SpvOp::SpvOpShiftLeftLogical: - return a << b; - - // Bitwise operations - case SpvOp::SpvOpBitwiseOr: - return a | b; - case SpvOp::SpvOpBitwiseAnd: - return a & b; - case SpvOp::SpvOpBitwiseXor: - return a ^ b; - - // Logical - case SpvOp::SpvOpLogicalEqual: - return (static_cast(a)) == (static_cast(b)); - case SpvOp::SpvOpLogicalNotEqual: - return (static_cast(a)) != (static_cast(b)); - case SpvOp::SpvOpLogicalOr: - return (static_cast(a)) || (static_cast(b)); - case SpvOp::SpvOpLogicalAnd: - return (static_cast(a)) && (static_cast(b)); - - // Comparison - case SpvOp::SpvOpIEqual: - return a == b; - case SpvOp::SpvOpINotEqual: - return a != b; - case SpvOp::SpvOpULessThan: - return a < b; - case SpvOp::SpvOpSLessThan: - return (static_cast(a)) < (static_cast(b)); - case SpvOp::SpvOpUGreaterThan: - return a > b; - case SpvOp::SpvOpSGreaterThan: - return (static_cast(a)) > (static_cast(b)); - case SpvOp::SpvOpULessThanEqual: - return a <= b; - case SpvOp::SpvOpSLessThanEqual: - return (static_cast(a)) <= (static_cast(b)); - case SpvOp::SpvOpUGreaterThanEqual: - return a >= b; - case SpvOp::SpvOpSGreaterThanEqual: - return (static_cast(a)) >= (static_cast(b)); - default: - assert(false && - "Unsupported binary operation for OpSpecConstantOp instruction"); - return 0u; - } -} - -// Returns the single-word result from performing the given ternary operation -// on the operand values which are passed in as three 32-bit word. -uint32_t TernaryOperate(SpvOp opcode, uint32_t a, uint32_t b, uint32_t c) { - switch (opcode) { - case SpvOp::SpvOpSelect: - return (static_cast(a)) ? b : c; - default: - assert(false && - "Unsupported ternary operation for OpSpecConstantOp instruction"); - return 0u; - } -} - -// Returns the single-word result from performing the given operation on the -// operand words. This only works with 32-bit operations and uses boolean -// convention that 0u is false, and anything else is boolean true. -// TODO(qining): Support operands other than 32-bit wide. -uint32_t OperateWords(SpvOp opcode, - const std::vector& operand_words) { - switch (operand_words.size()) { - case 1: - return UnaryOperate(opcode, operand_words.front()); - case 2: - return BinaryOperate(opcode, operand_words.front(), operand_words.back()); - case 3: - return TernaryOperate(opcode, operand_words[0], operand_words[1], - operand_words[2]); - default: - assert(false && "Invalid number of operands"); - return 0; - } -} - -// Returns the result of performing an operation on scalar constant operands. -// This function extracts the operand values as 32 bit words and returns the -// result in 32 bit word. Scalar constants with longer than 32-bit width are -// not accepted in this function. -uint32_t OperateScalars(SpvOp opcode, - const std::vector& operands) { - std::vector operand_values_in_raw_words; - for (analysis::Constant* operand : operands) { - if (analysis::ScalarConstant* scalar = operand->AsScalarConstant()) { - const auto& scalar_words = scalar->words(); - assert(scalar_words.size() == 1 && - "Scalar constants with longer than 32-bit width are not allowed " - "in OperateScalars()"); - operand_values_in_raw_words.push_back(scalar_words.front()); - } else if (operand->AsNullConstant()) { - operand_values_in_raw_words.push_back(0u); - } else { - assert(false && - "OperateScalars() only accepts ScalarConst or NullConst type of " - "constant"); - } - } - return OperateWords(opcode, operand_values_in_raw_words); -} - -// Returns the result of performing an operation over constant vectors. This -// function iterates through the given vector type constant operands and -// calculates the result for each element of the result vector to return. -// Vectors with longer than 32-bit scalar components are not accepted in this -// function. -std::vector OperateVectors( - SpvOp opcode, uint32_t num_dims, - const std::vector& operands) { - std::vector result; - for (uint32_t d = 0; d < num_dims; d++) { - std::vector operand_values_for_one_dimension; - for (analysis::Constant* operand : operands) { - if (analysis::VectorConstant* vector_operand = - operand->AsVectorConstant()) { - // Extract the raw value of the scalar component constants - // in 32-bit words here. The reason of not using OperateScalars() here - // is that we do not create temporary null constants as components - // when the vector operand is a NullConstant because Constant creation - // may need extra checks for the validity and that is not manageed in - // here. - if (const analysis::ScalarConstant* scalar_component = - vector_operand->GetComponents().at(d)->AsScalarConstant()) { - const auto& scalar_words = scalar_component->words(); - assert( - scalar_words.size() == 1 && - "Vector components with longer than 32-bit width are not allowed " - "in OperateVectors()"); - operand_values_for_one_dimension.push_back(scalar_words.front()); - } else if (operand->AsNullConstant()) { - operand_values_for_one_dimension.push_back(0u); - } else { - assert(false && - "VectorConst should only has ScalarConst or NullConst as " - "components"); - } - } else if (operand->AsNullConstant()) { - operand_values_for_one_dimension.push_back(0u); - } else { - assert(false && - "OperateVectors() only accepts VectorConst or NullConst type of " - "constant"); - } - } - result.push_back(OperateWords(opcode, operand_values_for_one_dimension)); - } - return result; -} -} // anonymous namespace - -FoldSpecConstantOpAndCompositePass::FoldSpecConstantOpAndCompositePass() - : max_id_(0), - module_(nullptr), - def_use_mgr_(nullptr), - type_mgr_(nullptr), - id_to_const_val_() {} - -Pass::Status FoldSpecConstantOpAndCompositePass::Process(ir::Module* module) { - Initialize(module); - return ProcessImpl(module); -} - -void FoldSpecConstantOpAndCompositePass::Initialize(ir::Module* module) { - type_mgr_.reset(new analysis::TypeManager(consumer(), *module)); - def_use_mgr_.reset(new analysis::DefUseManager(consumer(), module)); - for (const auto& id_def : def_use_mgr_->id_to_defs()) { - max_id_ = std::max(max_id_, id_def.first); - } - module_ = module; -}; - -Pass::Status FoldSpecConstantOpAndCompositePass::ProcessImpl( - ir::Module* module) { - bool modified = false; - // Traverse through all the constant defining instructions. For Normal - // Constants whose values are determined and do not depend on OpUndef - // instructions, records their values in two internal maps: id_to_const_val_ - // and const_val_to_id_ so that we can use them to infer the value of Spec - // Constants later. - // For Spec Constants defined with OpSpecConstantComposite instructions, if - // all of their components are Normal Constants, they will be turned into - // Normal Constants too. For Spec Constants defined with OpSpecConstantOp - // instructions, we check if they only depends on Normal Constants and fold - // them when possible. The two maps for Normal Constants: id_to_const_val_ - // and const_val_to_id_ will be updated along the traversal so that the new - // Normal Constants generated from folding can be used to fold following Spec - // Constants. - // This algorithm depends on the SSA property of SPIR-V when - // defining constants. The dependent constants must be defined before the - // dependee constants. So a dependent Spec Constant must be defined and - // will be processed before its dependee Spec Constant. When we encounter - // the dependee Spec Constants, all its dependent constants must have been - // processed and all its dependent Spec Constants should have been folded if - // possible. - for (ir::Module::inst_iterator inst_iter = module->types_values_begin(); - // Need to re-evaluate the end iterator since we may modify the list of - // instructions in this section of the module as the process goes. - inst_iter != module->types_values_end(); ++inst_iter) { - ir::Instruction* inst = &*inst_iter; - // Collect constant values of normal constants and process the - // OpSpecConstantOp and OpSpecConstantComposite instructions if possible. - // The constant values will be stored in analysis::Constant instances. - // OpConstantSampler instruction is not collected here because it cannot be - // used in OpSpecConstant{Composite|Op} instructions. - // TODO(qining): If the constant or its type has decoration, we may need - // to skip it. - if (GetType(inst) && !GetType(inst)->decoration_empty()) continue; - switch (SpvOp opcode = inst->opcode()) { - // Records the values of Normal Constants. - case SpvOp::SpvOpConstantTrue: - case SpvOp::SpvOpConstantFalse: - case SpvOp::SpvOpConstant: - case SpvOp::SpvOpConstantNull: - case SpvOp::SpvOpConstantComposite: - case SpvOp::SpvOpSpecConstantComposite: { - // A Constant instance will be created if the given instruction is a - // Normal Constant whose value(s) are fixed. Note that for a composite - // Spec Constant defined with OpSpecConstantComposite instruction, if - // all of its components are Normal Constants already, the Spec - // Constant will be turned in to a Normal Constant. In that case, a - // Constant instance should also be created successfully and recorded - // in the id_to_const_val_ and const_val_to_id_ mapps. - if (auto const_value = CreateConstFromInst(inst)) { - // Need to replace the OpSpecConstantComposite instruction with a - // corresponding OpConstantComposite instruction. - if (opcode == SpvOp::SpvOpSpecConstantComposite) { - inst->SetOpcode(SpvOp::SpvOpConstantComposite); - modified = true; - } - const_val_to_id_[const_value.get()] = inst->result_id(); - id_to_const_val_[inst->result_id()] = std::move(const_value); - } - break; - } - // For a Spec Constants defined with OpSpecConstantOp instruction, check - // if it only depends on Normal Constants. If so, the Spec Constant will - // be folded. The original Spec Constant defining instruction will be - // replaced by Normal Constant defining instructions, and the new Normal - // Constants will be added to id_to_const_val_ and const_val_to_id_ so - // that we can use the new Normal Constants when folding following Spec - // Constants. - case SpvOp::SpvOpSpecConstantOp: - modified |= ProcessOpSpecConstantOp(&inst_iter); - break; - default: - break; - } - } - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -bool FoldSpecConstantOpAndCompositePass::ProcessOpSpecConstantOp( - ir::Module::inst_iterator* pos) { - ir::Instruction* inst = &**pos; - ir::Instruction* folded_inst = nullptr; - assert(inst->GetInOperand(0).type == - SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER && - "The first in-operand of OpSpecContantOp instruction must be of " - "SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER type"); - - switch (static_cast(inst->GetSingleWordInOperand(0))) { - case SpvOp::SpvOpCompositeExtract: - folded_inst = DoCompositeExtract(pos); - break; - case SpvOp::SpvOpVectorShuffle: - folded_inst = DoVectorShuffle(pos); - break; - - case SpvOp::SpvOpCompositeInsert: - // Current Glslang does not generate code with OpSpecConstantOp - // CompositeInsert instruction, so this is not implmented so far. - // TODO(qining): Implement CompositeInsert case. - return false; - - default: - // Component-wise operations. - folded_inst = DoComponentWiseOperation(pos); - break; - } - if (!folded_inst) return false; - - // Replace the original constant with the new folded constant, kill the - // original constant. - uint32_t new_id = folded_inst->result_id(); - uint32_t old_id = inst->result_id(); - def_use_mgr_->ReplaceAllUsesWith(old_id, new_id); - def_use_mgr_->KillDef(old_id); - return true; -} - -ir::Instruction* FoldSpecConstantOpAndCompositePass::DoCompositeExtract( - ir::Module::inst_iterator* pos) { - ir::Instruction* inst = &**pos; - assert(inst->NumInOperands() - 1 >= 2 && - "OpSpecConstantOp CompositeExtract requires at least two non-type " - "non-opcode operands."); - assert(inst->GetInOperand(1).type == SPV_OPERAND_TYPE_ID && - "The vector operand must have a SPV_OPERAND_TYPE_ID type"); - assert( - inst->GetInOperand(2).type == SPV_OPERAND_TYPE_LITERAL_INTEGER && - "The literal operand must have a SPV_OPERAND_TYPE_LITERAL_INTEGER type"); - - // Note that for OpSpecConstantOp, the second in-operand is the first id - // operand. The first in-operand is the spec opcode. - analysis::Constant* first_operand_const = - FindRecordedConst(inst->GetSingleWordInOperand(1)); - if (!first_operand_const) return nullptr; - - const analysis::Constant* current_const = first_operand_const; - for (uint32_t i = 2; i < inst->NumInOperands(); i++) { - uint32_t literal = inst->GetSingleWordInOperand(i); - if (const analysis::CompositeConstant* composite_const = - current_const->AsCompositeConstant()) { - // Case 1: current constant is a non-null composite type constant. - assert(literal < composite_const->GetComponents().size() && - "Literal index out of bound of the composite constant"); - current_const = composite_const->GetComponents().at(literal); - } else if (current_const->AsNullConstant()) { - // Case 2: current constant is a constant created with OpConstantNull. - // Because components of a NullConstant are always NullConstants, we can - // return early with a NullConstant in the result type. - return BuildInstructionAndAddToModule(CreateConst(GetType(inst), {}), - pos); - } else { - // Dereferencing a non-composite constant. Invalid case. - return nullptr; - } - } - return BuildInstructionAndAddToModule(current_const->Copy(), pos); -} - -ir::Instruction* FoldSpecConstantOpAndCompositePass::DoVectorShuffle( - ir::Module::inst_iterator* pos) { - ir::Instruction* inst = &**pos; - analysis::Vector* result_vec_type = GetType(inst)->AsVector(); - assert(inst->NumInOperands() - 1 > 2 && - "OpSpecConstantOp DoVectorShuffle instruction requires more than 2 " - "operands (2 vector ids and at least one literal operand"); - assert(result_vec_type && - "The result of VectorShuffle must be of type vector"); - - // A temporary null constants that can be used as the components fo the - // result vector. This is needed when any one of the vector operands are null - // constant. - std::unique_ptr null_component_constants; - - // Get a concatenated vector of scalar constants. The vector should be built - // with the components from the first and the second operand of VectorShuffle. - std::vector concatenated_components; - // Note that for OpSpecConstantOp, the second in-operand is the first id - // operand. The first in-operand is the spec opcode. - for (uint32_t i : {1, 2}) { - assert(inst->GetInOperand(i).type == SPV_OPERAND_TYPE_ID && - "The vector operand must have a SPV_OPERAND_TYPE_ID type"); - uint32_t operand_id = inst->GetSingleWordInOperand(i); - analysis::Constant* operand_const = FindRecordedConst(operand_id); - if (!operand_const) return nullptr; - const analysis::Type* operand_type = operand_const->type(); - assert(operand_type->AsVector() && - "The first two operand of VectorShuffle must be of vector type"); - if (analysis::VectorConstant* vec_const = - operand_const->AsVectorConstant()) { - // case 1: current operand is a non-null vector constant. - concatenated_components.insert(concatenated_components.end(), - vec_const->GetComponents().begin(), - vec_const->GetComponents().end()); - } else if (operand_const->AsNullConstant()) { - // case 2: current operand is a null vector constant. Create a temporary - // null scalar constant as the component. - if (!null_component_constants) { - const analysis::Type* component_type = - operand_type->AsVector()->element_type(); - null_component_constants = CreateConst(component_type, {}); - } - // Append the null scalar consts to the concatenated components - // vector. - concatenated_components.insert(concatenated_components.end(), - operand_type->AsVector()->element_count(), - null_component_constants.get()); - } else { - // no other valid cases - return nullptr; - } - } - // Create null component constants if there are any. The component constants - // must be added to the module before the dependee composite constants to - // satisfy SSA def-use dominance. - if (null_component_constants) { - BuildInstructionAndAddToModule(std::move(null_component_constants), pos); - } - // Create the new vector constant with the selected components. - std::vector selected_components; - for (uint32_t i = 3; i < inst->NumInOperands(); i++) { - assert(inst->GetInOperand(i).type == SPV_OPERAND_TYPE_LITERAL_INTEGER && - "The literal operand must of type SPV_OPERAND_TYPE_LITERAL_INTEGER"); - uint32_t literal = inst->GetSingleWordInOperand(i); - assert(literal < concatenated_components.size() && - "Literal index out of bound of the concatenated vector"); - selected_components.push_back(concatenated_components[literal]); - } - auto new_vec_const = MakeUnique( - result_vec_type, selected_components); - return BuildInstructionAndAddToModule(std::move(new_vec_const), pos); -} - -namespace { -// A helper function to check the type for component wise operations. Returns -// true if the type: -// 1) is bool type; -// 2) is 32-bit int type; -// 3) is vector of bool type; -// 4) is vector of 32-bit integer type. -// Otherwise returns false. -bool IsValidTypeForComponentWiseOperation(const analysis::Type* type) { - if (type->AsBool()) { - return true; - } else if (auto* it = type->AsInteger()) { - if (it->width() == 32) return true; - } else if (auto* vt = type->AsVector()) { - if (vt->element_type()->AsBool()) - return true; - else if (auto* vit = vt->element_type()->AsInteger()) { - if (vit->width() == 32) return true; - } - } - return false; -} -} - -ir::Instruction* FoldSpecConstantOpAndCompositePass::DoComponentWiseOperation( - ir::Module::inst_iterator* pos) { - const ir::Instruction* inst = &**pos; - const analysis::Type* result_type = GetType(inst); - SpvOp spec_opcode = static_cast(inst->GetSingleWordInOperand(0)); - // Check and collect operands. - std::vector operands; - - if (!std::all_of(inst->cbegin(), inst->cend(), - [&operands, this](const ir::Operand& o) { - // skip the operands that is not an id. - if (o.type != spv_operand_type_t::SPV_OPERAND_TYPE_ID) - return true; - uint32_t id = o.words.front(); - if (analysis::Constant* c = FindRecordedConst(id)) { - if (IsValidTypeForComponentWiseOperation(c->type())) { - operands.push_back(c); - return true; - } - } - return false; - })) - return nullptr; - - if (result_type->AsInteger() || result_type->AsBool()) { - // Scalar operation - uint32_t result_val = OperateScalars(spec_opcode, operands); - auto result_const = CreateConst(result_type, {result_val}); - return BuildInstructionAndAddToModule(std::move(result_const), pos); - } else if (result_type->AsVector()) { - // Vector operation - const analysis::Type* element_type = - result_type->AsVector()->element_type(); - uint32_t num_dims = result_type->AsVector()->element_count(); - std::vector result_vec = - OperateVectors(spec_opcode, num_dims, operands); - std::vector result_vector_components; - for (uint32_t r : result_vec) { - if (auto rc = CreateConst(element_type, {r})) { - result_vector_components.push_back(rc.get()); - if (!BuildInstructionAndAddToModule(std::move(rc), pos)) { - assert(false && - "Failed to build and insert constant declaring instruction " - "for the given vector component constant"); - } - } else { - assert(false && "Failed to create constants with 32-bit word"); - } - } - auto new_vec_const = MakeUnique( - result_type->AsVector(), result_vector_components); - return BuildInstructionAndAddToModule(std::move(new_vec_const), pos); - } else { - // Cannot process invalid component wise operation. The result of component - // wise operation must be of integer or bool scalar or vector of - // integer/bool type. - return nullptr; - } -} - -ir::Instruction* -FoldSpecConstantOpAndCompositePass::BuildInstructionAndAddToModule( - std::unique_ptr c, ir::Module::inst_iterator* pos) { - analysis::Constant* new_const = c.get(); - uint32_t new_id = ++max_id_; - module_->SetIdBound(new_id + 1); - const_val_to_id_[new_const] = new_id; - id_to_const_val_[new_id] = std::move(c); - auto new_inst = CreateInstruction(new_id, new_const); - if (!new_inst) return nullptr; - auto* new_inst_ptr = new_inst.get(); - *pos = pos->InsertBefore(std::move(new_inst)); - (*pos)++; - def_use_mgr_->AnalyzeInstDefUse(new_inst_ptr); - return new_inst_ptr; -} - -std::unique_ptr -FoldSpecConstantOpAndCompositePass::CreateConstFromInst(ir::Instruction* inst) { - std::vector literal_words_or_ids; - std::unique_ptr new_const; - // Collect the constant defining literals or component ids. - for (uint32_t i = 0; i < inst->NumInOperands(); i++) { - literal_words_or_ids.insert(literal_words_or_ids.end(), - inst->GetInOperand(i).words.begin(), - inst->GetInOperand(i).words.end()); - } - switch (inst->opcode()) { - // OpConstant{True|Flase} have the value embedded in the opcode. So they - // are not handled by the for-loop above. Here we add the value explicitly. - case SpvOp::SpvOpConstantTrue: - literal_words_or_ids.push_back(true); - break; - case SpvOp::SpvOpConstantFalse: - literal_words_or_ids.push_back(false); - break; - case SpvOp::SpvOpConstantNull: - case SpvOp::SpvOpConstant: - case SpvOp::SpvOpConstantComposite: - case SpvOp::SpvOpSpecConstantComposite: - break; - default: - return nullptr; - } - return CreateConst(GetType(inst), literal_words_or_ids); -} - -analysis::Constant* FoldSpecConstantOpAndCompositePass::FindRecordedConst( - uint32_t id) { - auto iter = id_to_const_val_.find(id); - if (iter == id_to_const_val_.end()) { - return nullptr; - } else { - return iter->second.get(); - } -} - -uint32_t FoldSpecConstantOpAndCompositePass::FindRecordedConst( - const analysis::Constant* c) { - auto iter = const_val_to_id_.find(c); - if (iter == const_val_to_id_.end()) { - return 0; - } else { - return iter->second; - } -} - -std::vector -FoldSpecConstantOpAndCompositePass::GetConstsFromIds( - const std::vector& ids) { - std::vector constants; - for (uint32_t id : ids) { - if (analysis::Constant* c = FindRecordedConst(id)) { - constants.push_back(c); - } else { - return {}; - } - } - return constants; -} - -std::unique_ptr -FoldSpecConstantOpAndCompositePass::CreateConst( - const analysis::Type* type, - const std::vector& literal_words_or_ids) { - std::unique_ptr new_const; - if (literal_words_or_ids.size() == 0) { - // Constant declared with OpConstantNull - return MakeUnique(type); - } else if (auto* bt = type->AsBool()) { - assert(literal_words_or_ids.size() == 1 && - "Bool constant should be declared with one operand"); - return MakeUnique(bt, literal_words_or_ids.front()); - } else if (auto* it = type->AsInteger()) { - return MakeUnique(it, literal_words_or_ids); - } else if (auto* ft = type->AsFloat()) { - return MakeUnique(ft, literal_words_or_ids); - } else if (auto* vt = type->AsVector()) { - auto components = GetConstsFromIds(literal_words_or_ids); - if (components.empty()) return nullptr; - // All components of VectorConstant must be of type Bool, Integer or Float. - if (!std::all_of(components.begin(), components.end(), - [](const analysis::Constant* c) { - if (c->type()->AsBool() || c->type()->AsInteger() || - c->type()->AsFloat()) { - return true; - } else { - return false; - } - })) - return nullptr; - // All components of VectorConstant must be in the same type. - const auto* component_type = components.front()->type(); - if (!std::all_of(components.begin(), components.end(), - [&component_type](const analysis::Constant* c) { - if (c->type() == component_type) return true; - return false; - })) - return nullptr; - return MakeUnique(vt, components); - } else if (auto* st = type->AsStruct()) { - auto components = GetConstsFromIds(literal_words_or_ids); - if (components.empty()) return nullptr; - return MakeUnique(st, components); - } else if (auto* at = type->AsArray()) { - auto components = GetConstsFromIds(literal_words_or_ids); - if (components.empty()) return nullptr; - return MakeUnique(at, components); - } else { - return nullptr; - } -} - -std::vector BuildOperandsFromIds( - const std::vector& ids) { - std::vector operands; - for (uint32_t id : ids) { - operands.emplace_back(spv_operand_type_t::SPV_OPERAND_TYPE_ID, - std::initializer_list{id}); - } - return operands; -} - -std::unique_ptr -FoldSpecConstantOpAndCompositePass::CreateInstruction(uint32_t id, - analysis::Constant* c) { - if (c->AsNullConstant()) { - return MakeUnique(SpvOp::SpvOpConstantNull, - type_mgr_->GetId(c->type()), id, - std::initializer_list{}); - } else if (analysis::BoolConstant* bc = c->AsBoolConstant()) { - return MakeUnique( - bc->value() ? SpvOp::SpvOpConstantTrue : SpvOp::SpvOpConstantFalse, - type_mgr_->GetId(c->type()), id, std::initializer_list{}); - } else if (analysis::IntConstant* ic = c->AsIntConstant()) { - return MakeUnique( - SpvOp::SpvOpConstant, type_mgr_->GetId(c->type()), id, - std::initializer_list{ir::Operand( - spv_operand_type_t::SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER, - ic->words())}); - } else if (analysis::FloatConstant* fc = c->AsFloatConstant()) { - return MakeUnique( - SpvOp::SpvOpConstant, type_mgr_->GetId(c->type()), id, - std::initializer_list{ir::Operand( - spv_operand_type_t::SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER, - fc->words())}); - } else if (analysis::CompositeConstant* cc = c->AsCompositeConstant()) { - return CreateCompositeInstruction(id, cc); - } else { - return nullptr; - } -} - -std::unique_ptr -FoldSpecConstantOpAndCompositePass::CreateCompositeInstruction( - uint32_t result_id, analysis::CompositeConstant* cc) { - std::vector operands; - for (const analysis::Constant* component_const : cc->GetComponents()) { - uint32_t id = FindRecordedConst(component_const); - if (id == 0) { - // Cannot get the id of the component constant, while all components - // should have been added to the module prior to the composite constant. - // Cannot create OpConstantComposite instruction in this case. - return nullptr; - } - operands.emplace_back(spv_operand_type_t::SPV_OPERAND_TYPE_ID, - std::initializer_list{id}); - } - return MakeUnique(SpvOp::SpvOpConstantComposite, - type_mgr_->GetId(cc->type()), result_id, - std::move(operands)); -} - -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,175 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_FOLD_SPEC_CONSTANT_OP_AND_COMPOSITE_PASS_H_ -#define LIBSPIRV_OPT_FOLD_SPEC_CONSTANT_OP_AND_COMPOSITE_PASS_H_ - -#include -#include -#include - -#include "constants.h" -#include "def_use_manager.h" -#include "module.h" -#include "pass.h" -#include "type_manager.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class FoldSpecConstantOpAndCompositePass : public Pass { - public: - FoldSpecConstantOpAndCompositePass(); - - const char* name() const override { return "fold-spec-const-op-composite"; } - - Status Process(ir::Module* module) override; - - private: - // Initializes the type manager, def-use manager and get the maximal id used - // in the module. - void Initialize(ir::Module* module); - - // The real entry of processing. Iterates through the types-constants-globals - // section of the given module, finds the Spec Constants defined with - // OpSpecConstantOp and OpSpecConstantComposite instructions. If the result - // value of those spec constants can be folded, fold them to their - // corresponding normal constants. - Status ProcessImpl(ir::Module*); - - // Processes the OpSpecConstantOp instruction pointed by the given - // instruction iterator, folds it to normal constants if possible. Returns - // true if the spec constant is folded to normal constants. New instructions - // will be inserted before the OpSpecConstantOp instruction pointed by the - // instruction iterator. The instruction iterator, which is passed by - // pointer, will still point to the original OpSpecConstantOp instruction. If - // folding is done successfully, the original OpSpecConstantOp instruction - // will be changed to Nop and new folded instruction will be inserted before - // it. - bool ProcessOpSpecConstantOp(ir::Module::inst_iterator* pos); - - // Try to fold the OpSpecConstantOp CompositeExtract instruction pointed by - // the given instruction iterator to a normal constant defining instruction. - // Returns the pointer to the new constant defining instruction if succeeded. - // Otherwise returns nullptr. - ir::Instruction* DoCompositeExtract(ir::Module::inst_iterator* inst_iter_ptr); - - // Try to fold the OpSpecConstantOp VectorShuffle instruction pointed by the - // given instruction iterator to a normal constant defining instruction. - // Returns the pointer to the new constant defining instruction if succeeded. - // Otherwise return nullptr. - ir::Instruction* DoVectorShuffle(ir::Module::inst_iterator* inst_iter_ptr); - - // Try to fold the OpSpecConstantOp instruction - // pointed by the given instruction iterator to a normal constant defining - // instruction. Returns the pointer to the new constant defining instruction - // if succeeded, otherwise return nullptr. - ir::Instruction* DoComponentWiseOperation( - ir::Module::inst_iterator* inst_iter_ptr); - - // Creates a constant defining instruction for the given Constant instance - // and inserts the instruction at the position specified by the given - // instruction iterator. Returns a pointer to the created instruction if - // succeeded, otherwise returns a null pointer. The instruction iterator - // points to the same instruction before and after the insertion. This is the - // only method that actually manages id creation/assignment and instruction - // creation/insertion for a new Constant instance. - ir::Instruction* BuildInstructionAndAddToModule( - std::unique_ptr c, ir::Module::inst_iterator* pos); - - // Creates a Constant instance to hold the constant value of the given - // instruction. If the given instruction defines a normal constants whose - // value is already known in the module, returns the unique pointer to the - // created Constant instance. Otherwise does not create anything and returns a - // nullptr. - std::unique_ptr CreateConstFromInst( - ir::Instruction* inst); - - // Creates a Constant instance with the given type and a vector of constant - // defining words. Returns an unique pointer to the created Constant instance - // if the Constant instance can be created successfully. To create scalar - // type constants, the vector should contain the constant value in 32 bit - // words and the given type must be of type Bool, Integer or Float. To create - // composite type constants, the vector should contain the component ids, and - // those component ids should have been recorded before as Normal Constants. - // And the given type must be of type Struct, Vector or Array. When creating - // VectorType Constant instance, the components must be scalars of the same - // type, either Bool, Integer or Float. If any of the rules above failed, the - // creation will fail and nullptr will be returned. If the vector is empty, - // a NullConstant instance will be created with the given type. - std::unique_ptr CreateConst( - const analysis::Type* type, - const std::vector& literal_words_or_ids); - - // Creates an instruction with the given result id to declare a constant - // represented by the given Constant instance. Returns an unique pointer to - // the created instruction if the instruction can be created successfully. - // Otherwise, returns a null pointer. - std::unique_ptr CreateInstruction(uint32_t result_id, - analysis::Constant* c); - - // Creates an OpConstantComposite instruction with the given result id and - // the CompositeConst instance which represents a composite constant. Returns - // an unique pointer to the created instruction if succeeded. Otherwise - // returns a null pointer. - std::unique_ptr CreateCompositeInstruction( - uint32_t result_id, analysis::CompositeConstant* cc); - - // A helper function to get the collected normal constant with the given id. - // Returns the pointer to the Constant instance in case it is found. - // Otherwise, returns null pointer. - analysis::Constant* FindRecordedConst(uint32_t id); - // A helper function to get the id of a collected constant with the pointer - // to the Constant instance. Returns 0 in case the constant is not found. - uint32_t FindRecordedConst(const analysis::Constant* c); - - // A helper function to get a vector of Constant instances with the specified - // ids. If can not find the Constant instance for any one of the ids, returns - // an empty vector. - std::vector GetConstsFromIds( - const std::vector& ids); - - // A helper function to get the result type of the given instrution. Returns - // nullptr if the instruction does not have a type id (type id is 0). - analysis::Type* GetType(const ir::Instruction* inst) { - return type_mgr_->GetType(inst->type_id()); - } - - // The maximum used ID. - uint32_t max_id_; - // A pointer to the module under process. - ir::Module* module_; - // DefUse manager - std::unique_ptr def_use_mgr_; - // Type manager - std::unique_ptr type_mgr_; - - // A mapping from the result ids of Normal Constants to their - // analysis::Constant instances. All Normal Constants in the module, either - // existing ones before optimization or the newly generated ones, should have - // their Constant instance stored and their result id registered in this map. - std::unordered_map> - id_to_const_val_; - // A mapping from the analsis::Constant instance of Normal Contants to their - // result id in the module. This is a mirror map of id_to_const_val_. All - // Normal Constants that defining instructions in the module should have - // their analysis::Constant and their result id registered here. - std::unordered_map const_val_to_id_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_FOLD_SPEC_CONSTANT_OP_AND_COMPOSITE_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/freeze_spec_constant_value_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/freeze_spec_constant_value_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/freeze_spec_constant_value_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/freeze_spec_constant_value_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "freeze_spec_constant_value_pass.h" - -namespace spvtools { -namespace opt { - -Pass::Status FreezeSpecConstantValuePass::Process(ir::Module* module) { - bool modified = false; - module->ForEachInst([&modified](ir::Instruction* inst) { - switch (inst->opcode()) { - case SpvOp::SpvOpSpecConstant: - inst->SetOpcode(SpvOp::SpvOpConstant); - modified = true; - break; - case SpvOp::SpvOpSpecConstantTrue: - inst->SetOpcode(SpvOp::SpvOpConstantTrue); - modified = true; - break; - case SpvOp::SpvOpSpecConstantFalse: - inst->SetOpcode(SpvOp::SpvOpConstantFalse); - modified = true; - break; - case SpvOp::SpvOpDecorate: - if (inst->GetSingleWordInOperand(1) == - SpvDecoration::SpvDecorationSpecId) { - inst->ToNop(); - modified = true; - } - break; - default: - break; - } - }); - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/freeze_spec_constant_value_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/freeze_spec_constant_value_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/freeze_spec_constant_value_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/freeze_spec_constant_value_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_FREEZE_SPEC_CONSTANT_VALUE_PASS_H_ -#define LIBSPIRV_OPT_FREEZE_SPEC_CONSTANT_VALUE_PASS_H_ - -#include "module.h" -#include "pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class FreezeSpecConstantValuePass : public Pass { - public: - const char* name() const override { return "freeze-spec-const"; } - Status Process(ir::Module*) override; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_FREEZE_SPEC_CONSTANT_VALUE_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/function.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/function.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/function.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/function.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "function.h" - -#include "make_unique.h" - -namespace spvtools { -namespace ir { - -Function::Function(const Function& f) - : module_(nullptr), - def_inst_(MakeUnique(f.DefInst())), - params_(), - blocks_(), - end_inst_() { - params_.reserve(f.params_.size()); - f.ForEachParam( - [this](const Instruction* insn) { - AddParameter(MakeUnique(*insn)); - }, - true); - - blocks_.reserve(f.blocks_.size()); - for (const auto& b : f.blocks_) { - std::unique_ptr bb = MakeUnique(*b); - bb->SetParent(this); - AddBasicBlock(std::move(bb)); - } - - SetFunctionEnd(MakeUnique(f.function_end())); -} - -void Function::ForEachInst(const std::function& f, - bool run_on_debug_line_insts) { - if (def_inst_) def_inst_->ForEachInst(f, run_on_debug_line_insts); - for (auto& param : params_) param->ForEachInst(f, run_on_debug_line_insts); - for (auto& bb : blocks_) bb->ForEachInst(f, run_on_debug_line_insts); - if (end_inst_) end_inst_->ForEachInst(f, run_on_debug_line_insts); -} - -void Function::ForEachInst(const std::function& f, - bool run_on_debug_line_insts) const { - if (def_inst_) - static_cast(def_inst_.get()) - ->ForEachInst(f, run_on_debug_line_insts); - - for (const auto& param : params_) - static_cast(param.get()) - ->ForEachInst(f, run_on_debug_line_insts); - - for (const auto& bb : blocks_) - static_cast(bb.get())->ForEachInst( - f, run_on_debug_line_insts); - - if (end_inst_) - static_cast(end_inst_.get()) - ->ForEachInst(f, run_on_debug_line_insts); -} - -void Function::ForEachParam(const std::function& f, - bool run_on_debug_line_insts) const { - for (const auto& param : params_) - static_cast(param.get()) - ->ForEachInst(f, run_on_debug_line_insts); -} - -} // namespace ir -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/function.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/function.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/function.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/function.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,128 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_CONSTRUCTS_H_ -#define LIBSPIRV_OPT_CONSTRUCTS_H_ - -#include -#include -#include -#include - -#include "basic_block.h" -#include "instruction.h" -#include "iterator.h" - -namespace spvtools { -namespace ir { - -class Module; - -// A SPIR-V function. -class Function { - public: - using iterator = UptrVectorIterator; - using const_iterator = UptrVectorIterator; - - // Creates a function instance declared by the given OpFunction instruction - // |def_inst|. - inline explicit Function(std::unique_ptr def_inst); - // Creates a function instance based on the given function |f|. - // - // The parent module will default to null and needs to be explicitly set by - // the user. - explicit Function(const Function& f); - // The OpFunction instruction that begins the definition of this function. - Instruction& DefInst() { return *def_inst_; } - const Instruction& DefInst() const { return *def_inst_; } - - // Sets the enclosing module for this function. - void SetParent(Module* module) { module_ = module; } - // Appends a parameter to this function. - inline void AddParameter(std::unique_ptr p); - // Appends a basic block to this function. - inline void AddBasicBlock(std::unique_ptr b); - - // Saves the given function end instruction. - inline void SetFunctionEnd(std::unique_ptr end_inst); - - // Returns the given function end instruction. - inline Instruction* function_end() { return end_inst_.get(); } - inline const Instruction& function_end() const { return *end_inst_; } - - // Returns function's id - inline uint32_t result_id() const { return def_inst_->result_id(); } - -// // Returns function's type id -// inline uint32_t type_id() const { return def_inst_->GetSingleWordInOperand(1u); } - - // Returns function's return type id - inline uint32_t type_id() const { return def_inst_->type_id(); } - - // Returns the entry basic block for this function. - const std::unique_ptr& entry() const { return blocks_.front(); } - - iterator begin() { return iterator(&blocks_, blocks_.begin()); } - iterator end() { return iterator(&blocks_, blocks_.end()); } - const_iterator cbegin() const { - return const_iterator(&blocks_, blocks_.cbegin()); - } - const_iterator cend() const { - return const_iterator(&blocks_, blocks_.cend()); - } - - // Runs the given function |f| on each instruction in this function, and - // optionally on debug line instructions that might precede them. - void ForEachInst(const std::function& f, - bool run_on_debug_line_insts = false); - void ForEachInst(const std::function& f, - bool run_on_debug_line_insts = false) const; - - // Runs the given function |f| on each parameter instruction in this function, - // and optionally on debug line instructions that might precede them. - void ForEachParam(const std::function& f, - bool run_on_debug_line_insts = false) const; - - private: - // The enclosing module. - Module* module_; - // The OpFunction instruction that begins the definition of this function. - std::unique_ptr def_inst_; - // All parameters to this function. - std::vector> params_; - // All basic blocks inside this function in specification order - std::vector> blocks_; - // The OpFunctionEnd instruction. - std::unique_ptr end_inst_; -}; - -inline Function::Function(std::unique_ptr def_inst) - : module_(nullptr), def_inst_(std::move(def_inst)), end_inst_() {} - -inline void Function::AddParameter(std::unique_ptr p) { - params_.emplace_back(std::move(p)); -} - -inline void Function::AddBasicBlock(std::unique_ptr b) { - blocks_.emplace_back(std::move(b)); -} - -inline void Function::SetFunctionEnd(std::unique_ptr end_inst) { - end_inst_ = std::move(end_inst); -} - -} // namespace ir -} // namespace spvtools - -#endif // LIBSPIRV_OPT_CONSTRUCTS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/inline_exhaustive_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/inline_exhaustive_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/inline_exhaustive_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/inline_exhaustive_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "inline_exhaustive_pass.h" - -namespace spvtools { -namespace opt { - -bool InlineExhaustivePass::InlineExhaustive(ir::Function* func) { - bool modified = false; - // Using block iterators here because of block erasures and insertions. - for (auto bi = func->begin(); bi != func->end(); ++bi) { - for (auto ii = bi->begin(); ii != bi->end();) { - if (IsInlinableFunctionCall(&*ii)) { - // Inline call. - std::vector> newBlocks; - std::vector> newVars; - GenInlineCode(&newBlocks, &newVars, ii, bi); - // If call block is replaced with more than one block, point - // succeeding phis at new last block. - if (newBlocks.size() > 1) - UpdateSucceedingPhis(newBlocks); - // Replace old calling block with new block(s). - bi = bi.Erase(); - bi = bi.InsertBefore(&newBlocks); - // Insert new function variables. - if (newVars.size() > 0) func->begin()->begin().InsertBefore(std::move(newVars)); - // Restart inlining at beginning of calling block. - ii = bi->begin(); - modified = true; - } else { - ++ii; - } - } - } - return modified; -} - -void InlineExhaustivePass::Initialize(ir::Module* module) { - InitializeInline(module); -}; - -Pass::Status InlineExhaustivePass::ProcessImpl() { - // Attempt exhaustive inlining on each entry point function in module - ProcessFunction pfn = [this](ir::Function* fp) { - return InlineExhaustive(fp); - }; - bool modified = ProcessEntryPointCallTree(pfn, module_); - FinalizeNextId(module_); - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -InlineExhaustivePass::InlineExhaustivePass() {} - -Pass::Status InlineExhaustivePass::Process(ir::Module* module) { - Initialize(module); - return ProcessImpl(); -} - -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/inline_exhaustive_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/inline_exhaustive_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/inline_exhaustive_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/inline_exhaustive_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#ifndef LIBSPIRV_OPT_INLINE_EXHAUSTIVE_PASS_H_ -#define LIBSPIRV_OPT_INLINE_EXHAUSTIVE_PASS_H_ - -#include -#include -#include -#include -#include - -#include "def_use_manager.h" -#include "module.h" -#include "inline_pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class InlineExhaustivePass : public InlinePass { - - public: - InlineExhaustivePass(); - Status Process(ir::Module*) override; - - const char* name() const override { return "inline-entry-points-exhaustive"; } - - private: - // Exhaustively inline all function calls in func as well as in - // all code that is inlined into func. Return true if func is modified. - bool InlineExhaustive(ir::Function* func); - - void Initialize(ir::Module* module); - Pass::Status ProcessImpl(); -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_INLINE_EXHAUSTIVE_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/inline_opaque_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/inline_opaque_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/inline_opaque_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/inline_opaque_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "inline_opaque_pass.h" - -namespace spvtools { -namespace opt { - -namespace { - - const uint32_t kTypePointerTypeIdInIdx = 1; - -} // anonymous namespace - -bool InlineOpaquePass::IsOpaqueType(uint32_t typeId) { - const ir::Instruction* typeInst = def_use_mgr_->GetDef(typeId); - switch (typeInst->opcode()) { - case SpvOpTypeSampler: - case SpvOpTypeImage: - case SpvOpTypeSampledImage: - return true; - case SpvOpTypePointer: - return IsOpaqueType(typeInst->GetSingleWordInOperand( - kTypePointerTypeIdInIdx)); - default: - break; - } - // TODO(greg-lunarg): Handle arrays containing opaque type - if (typeInst->opcode() != SpvOpTypeStruct) - return false; - // Return true if any member is opaque - int ocnt = 0; - typeInst->ForEachInId([&ocnt,this](const uint32_t* tid) { - if (ocnt == 0 && IsOpaqueType(*tid)) ++ocnt; - }); - return ocnt > 0; -} - -bool InlineOpaquePass::HasOpaqueArgsOrReturn(const ir::Instruction* callInst) { - // Check return type - if (IsOpaqueType(callInst->type_id())) - return true; - // Check args - int icnt = 0; - int ocnt = 0; - callInst->ForEachInId([&icnt,&ocnt,this](const uint32_t *iid) { - if (icnt > 0) { - const ir::Instruction* argInst = def_use_mgr_->GetDef(*iid); - if (IsOpaqueType(argInst->type_id())) - ++ocnt; - } - ++icnt; - }); - return ocnt > 0; -} - -bool InlineOpaquePass::InlineOpaque(ir::Function* func) { - bool modified = false; - // Using block iterators here because of block erasures and insertions. - for (auto bi = func->begin(); bi != func->end(); ++bi) { - for (auto ii = bi->begin(); ii != bi->end();) { - if (IsInlinableFunctionCall(&*ii) && HasOpaqueArgsOrReturn(&*ii)) { - // Inline call. - std::vector> newBlocks; - std::vector> newVars; - GenInlineCode(&newBlocks, &newVars, ii, bi); - // If call block is replaced with more than one block, point - // succeeding phis at new last block. - if (newBlocks.size() > 1) - UpdateSucceedingPhis(newBlocks); - // Replace old calling block with new block(s). - bi = bi.Erase(); - bi = bi.InsertBefore(&newBlocks); - // Insert new function variables. - if (newVars.size() > 0) func->begin()->begin().InsertBefore(std::move(newVars)); - // Restart inlining at beginning of calling block. - ii = bi->begin(); - modified = true; - } else { - ++ii; - } - } - } - return modified; -} - -void InlineOpaquePass::Initialize(ir::Module* module) { - InitializeInline(module); -}; - -Pass::Status InlineOpaquePass::ProcessImpl() { - // Do opaque inlining on each function in entry point call tree - ProcessFunction pfn = [this](ir::Function* fp) { - return InlineOpaque(fp); - }; - bool modified = ProcessEntryPointCallTree(pfn, module_); - FinalizeNextId(module_); - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -InlineOpaquePass::InlineOpaquePass() {} - -Pass::Status InlineOpaquePass::Process(ir::Module* module) { - Initialize(module); - return ProcessImpl(); -} - -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/inline_opaque_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/inline_opaque_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/inline_opaque_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/inline_opaque_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#ifndef LIBSPIRV_OPT_INLINE_OPAQUE_PASS_H_ -#define LIBSPIRV_OPT_INLINE_OPAQUE_PASS_H_ - -#include -#include -#include -#include -#include - -#include "def_use_manager.h" -#include "module.h" -#include "inline_pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class InlineOpaquePass : public InlinePass { - - public: - InlineOpaquePass(); - Status Process(ir::Module*) override; - - const char* name() const override { return "inline-entry-points-opaque"; } - - private: - // Return true if |typeId| is or contains opaque type - bool IsOpaqueType(uint32_t typeId); - - // Return true if function call |callInst| has opaque argument or return type - bool HasOpaqueArgsOrReturn(const ir::Instruction* callInst); - - // Inline all function calls in |func| that have opaque params or return - // type. Inline similarly all code that is inlined into func. Return true - // if func is modified. - bool InlineOpaque(ir::Function* func); - - void Initialize(ir::Module* module); - Pass::Status ProcessImpl(); -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_INLINE_OPAQUE_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/inline_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/inline_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/inline_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/inline_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,702 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "inline_pass.h" - -#include "cfa.h" - -// Indices of operands in SPIR-V instructions - -static const int kSpvFunctionCallFunctionId = 2; -static const int kSpvFunctionCallArgumentId = 3; -static const int kSpvReturnValueId = 0; -static const int kSpvTypePointerStorageClass = 1; -static const int kSpvTypePointerTypeId = 2; -static const int kSpvLoopMergeMergeBlockId = 0; -static const int kSpvLoopMergeContinueTargetIdInIdx = 1; -static const int kSpvSelectionMergeMergeBlockId = 0; - -namespace spvtools { -namespace opt { - -uint32_t InlinePass::FindPointerToType(uint32_t type_id, - SpvStorageClass storage_class) { - ir::Module::inst_iterator type_itr = module_->types_values_begin(); - for (; type_itr != module_->types_values_end(); ++type_itr) { - const ir::Instruction* type_inst = &*type_itr; - if (type_inst->opcode() == SpvOpTypePointer && - type_inst->GetSingleWordOperand(kSpvTypePointerTypeId) == type_id && - type_inst->GetSingleWordOperand(kSpvTypePointerStorageClass) == - storage_class) - return type_inst->result_id(); - } - return 0; -} - -uint32_t InlinePass::AddPointerToType(uint32_t type_id, - SpvStorageClass storage_class) { - uint32_t resultId = TakeNextId(); - std::unique_ptr type_inst(new ir::Instruction( - SpvOpTypePointer, 0, resultId, - {{spv_operand_type_t::SPV_OPERAND_TYPE_STORAGE_CLASS, - {uint32_t(storage_class)}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {type_id}}})); - module_->AddType(std::move(type_inst)); - return resultId; -} - -void InlinePass::AddBranch(uint32_t label_id, - std::unique_ptr* block_ptr) { - std::unique_ptr newBranch(new ir::Instruction( - SpvOpBranch, 0, 0, - {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {label_id}}})); - (*block_ptr)->AddInstruction(std::move(newBranch)); -} - -void InlinePass::AddBranchCond(uint32_t cond_id, uint32_t true_id, - uint32_t false_id, std::unique_ptr* block_ptr) { - std::unique_ptr newBranch(new ir::Instruction( - SpvOpBranchConditional, 0, 0, - {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {cond_id}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {true_id}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {false_id}}})); - (*block_ptr)->AddInstruction(std::move(newBranch)); -} - -void InlinePass::AddLoopMerge(uint32_t merge_id, uint32_t continue_id, - std::unique_ptr* block_ptr) { - std::unique_ptr newLoopMerge(new ir::Instruction( - SpvOpLoopMerge, 0, 0, - {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {merge_id}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {continue_id}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_LOOP_CONTROL, {0}}})); - (*block_ptr)->AddInstruction(std::move(newLoopMerge)); -} - -void InlinePass::AddStore(uint32_t ptr_id, uint32_t val_id, - std::unique_ptr* block_ptr) { - std::unique_ptr newStore(new ir::Instruction( - SpvOpStore, 0, 0, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {ptr_id}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {val_id}}})); - (*block_ptr)->AddInstruction(std::move(newStore)); -} - -void InlinePass::AddLoad(uint32_t type_id, uint32_t resultId, uint32_t ptr_id, - std::unique_ptr* block_ptr) { - std::unique_ptr newLoad(new ir::Instruction( - SpvOpLoad, type_id, resultId, - {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {ptr_id}}})); - (*block_ptr)->AddInstruction(std::move(newLoad)); -} - -std::unique_ptr InlinePass::NewLabel(uint32_t label_id) { - std::unique_ptr newLabel( - new ir::Instruction(SpvOpLabel, 0, label_id, {})); - return newLabel; -} - -uint32_t InlinePass::GetFalseId() { - if (false_id_ != 0) - return false_id_; - false_id_ = module_->GetGlobalValue(SpvOpConstantFalse); - if (false_id_ != 0) - return false_id_; - uint32_t boolId = module_->GetGlobalValue(SpvOpTypeBool); - if (boolId == 0) { - boolId = TakeNextId(); - module_->AddGlobalValue(SpvOpTypeBool, boolId, 0); - } - false_id_ = TakeNextId(); - module_->AddGlobalValue(SpvOpConstantFalse, false_id_, boolId); - return false_id_; -} - -void InlinePass::MapParams( - ir::Function* calleeFn, - ir::BasicBlock::iterator call_inst_itr, - std::unordered_map* callee2caller) { - int param_idx = 0; - calleeFn->ForEachParam( - [&call_inst_itr, ¶m_idx, &callee2caller](const ir::Instruction* cpi) { - const uint32_t pid = cpi->result_id(); - (*callee2caller)[pid] = call_inst_itr->GetSingleWordOperand( - kSpvFunctionCallArgumentId + param_idx); - ++param_idx; - }); -} - -void InlinePass::CloneAndMapLocals( - ir::Function* calleeFn, - std::vector>* new_vars, - std::unordered_map* callee2caller) { - auto callee_block_itr = calleeFn->begin(); - auto callee_var_itr = callee_block_itr->begin(); - while (callee_var_itr->opcode() == SpvOp::SpvOpVariable) { - std::unique_ptr var_inst(callee_var_itr->Clone()); - uint32_t newId = TakeNextId(); - var_inst->SetResultId(newId); - (*callee2caller)[callee_var_itr->result_id()] = newId; - new_vars->push_back(std::move(var_inst)); - ++callee_var_itr; - } -} - -uint32_t InlinePass::CreateReturnVar( - ir::Function* calleeFn, - std::vector>* new_vars) { - uint32_t returnVarId = 0; - const uint32_t calleeTypeId = calleeFn->type_id(); - const ir::Instruction* calleeType = - def_use_mgr_->id_to_defs().find(calleeTypeId)->second; - if (calleeType->opcode() != SpvOpTypeVoid) { - // Find or create ptr to callee return type. - uint32_t returnVarTypeId = - FindPointerToType(calleeTypeId, SpvStorageClassFunction); - if (returnVarTypeId == 0) - returnVarTypeId = AddPointerToType(calleeTypeId, SpvStorageClassFunction); - // Add return var to new function scope variables. - returnVarId = TakeNextId(); - std::unique_ptr var_inst(new ir::Instruction( - SpvOpVariable, returnVarTypeId, returnVarId, - {{spv_operand_type_t::SPV_OPERAND_TYPE_STORAGE_CLASS, - {SpvStorageClassFunction}}})); - new_vars->push_back(std::move(var_inst)); - } - return returnVarId; -} - -bool InlinePass::IsSameBlockOp(const ir::Instruction* inst) const { - return inst->opcode() == SpvOpSampledImage || inst->opcode() == SpvOpImage; -} - -void InlinePass::CloneSameBlockOps( - std::unique_ptr* inst, - std::unordered_map* postCallSB, - std::unordered_map* preCallSB, - std::unique_ptr* block_ptr) { - (*inst) - ->ForEachInId([&postCallSB, &preCallSB, &block_ptr, this](uint32_t* iid) { - const auto mapItr = (*postCallSB).find(*iid); - if (mapItr == (*postCallSB).end()) { - const auto mapItr2 = (*preCallSB).find(*iid); - if (mapItr2 != (*preCallSB).end()) { - // Clone pre-call same-block ops, map result id. - const ir::Instruction* inInst = mapItr2->second; - std::unique_ptr sb_inst(inInst->Clone()); - CloneSameBlockOps(&sb_inst, postCallSB, preCallSB, block_ptr); - const uint32_t rid = sb_inst->result_id(); - const uint32_t nid = this->TakeNextId(); - sb_inst->SetResultId(nid); - (*postCallSB)[rid] = nid; - *iid = nid; - (*block_ptr)->AddInstruction(std::move(sb_inst)); - } - } else { - // Reset same-block op operand. - *iid = mapItr->second; - } - }); -} - -void InlinePass::GenInlineCode( - std::vector>* new_blocks, - std::vector>* new_vars, - ir::BasicBlock::iterator call_inst_itr, - ir::UptrVectorIterator call_block_itr) { - // Map from all ids in the callee to their equivalent id in the caller - // as callee instructions are copied into caller. - std::unordered_map callee2caller; - // Pre-call same-block insts - std::unordered_map preCallSB; - // Post-call same-block op ids - std::unordered_map postCallSB; - - ir::Function* calleeFn = id2function_[call_inst_itr->GetSingleWordOperand( - kSpvFunctionCallFunctionId)]; - - // Check for multiple returns in the callee. - auto fi = multi_return_funcs_.find(calleeFn->result_id()); - const bool multiReturn = fi != multi_return_funcs_.end(); - - // Map parameters to actual arguments. - MapParams(calleeFn, call_inst_itr, &callee2caller); - - // Define caller local variables for all callee variables and create map to - // them. - CloneAndMapLocals(calleeFn, new_vars, &callee2caller); - - // Create return var if needed. - uint32_t returnVarId = CreateReturnVar(calleeFn, new_vars); - - // Create set of callee result ids. Used to detect forward references - std::unordered_set callee_result_ids; - calleeFn->ForEachInst([&callee_result_ids]( - const ir::Instruction* cpi) { - const uint32_t rid = cpi->result_id(); - if (rid != 0) - callee_result_ids.insert(rid); - }); - - // If the caller is in a single-block loop, and the callee has multiple - // blocks, then the normal inlining logic will place the OpLoopMerge in - // the last of several blocks in the loop. Instead, it should be placed - // at the end of the first block. First determine if the caller is in a - // single block loop. We'll wait to move the OpLoopMerge until the end - // of the regular inlining logic, and only if necessary. - bool caller_is_single_block_loop = false; - bool caller_is_loop_header = false; - if (auto* loop_merge = call_block_itr->GetLoopMergeInst()) { - caller_is_loop_header = true; - caller_is_single_block_loop = - call_block_itr->id() == - loop_merge->GetSingleWordInOperand(kSpvLoopMergeContinueTargetIdInIdx); - } - - bool callee_begins_with_structured_header = - (*(calleeFn->begin())).GetMergeInst() != nullptr; - - // Clone and map callee code. Copy caller block code to beginning of - // first block and end of last block. - bool prevInstWasReturn = false; - uint32_t singleTripLoopHeaderId = 0; - uint32_t singleTripLoopContinueId = 0; - uint32_t returnLabelId = 0; - bool multiBlocks = false; - const uint32_t calleeTypeId = calleeFn->type_id(); - // new_blk_ptr is a new basic block in the caller. New instructions are - // written to it. It is created when we encounter the OpLabel - // of the first callee block. It is appended to new_blocks only when - // it is complete. - std::unique_ptr new_blk_ptr; - calleeFn->ForEachInst([&new_blocks, &callee2caller, &call_block_itr, - &call_inst_itr, &new_blk_ptr, &prevInstWasReturn, - &returnLabelId, &returnVarId, caller_is_loop_header, - callee_begins_with_structured_header, &calleeTypeId, - &multiBlocks, &postCallSB, &preCallSB, multiReturn, - &singleTripLoopHeaderId, &singleTripLoopContinueId, - &callee_result_ids, this](const ir::Instruction* cpi) { - switch (cpi->opcode()) { - case SpvOpFunction: - case SpvOpFunctionParameter: - case SpvOpVariable: - // Already processed - break; - case SpvOpLabel: { - // If previous instruction was early return, insert branch - // instruction to return block. - if (prevInstWasReturn) { - if (returnLabelId == 0) returnLabelId = this->TakeNextId(); - AddBranch(returnLabelId, &new_blk_ptr); - prevInstWasReturn = false; - } - // Finish current block (if it exists) and get label for next block. - uint32_t labelId; - bool firstBlock = false; - if (new_blk_ptr != nullptr) { - new_blocks->push_back(std::move(new_blk_ptr)); - // If result id is already mapped, use it, otherwise get a new - // one. - const uint32_t rid = cpi->result_id(); - const auto mapItr = callee2caller.find(rid); - labelId = (mapItr != callee2caller.end()) ? mapItr->second - : this->TakeNextId(); - } else { - // First block needs to use label of original block - // but map callee label in case of phi reference. - labelId = call_block_itr->id(); - callee2caller[cpi->result_id()] = labelId; - firstBlock = true; - } - // Create first/next block. - new_blk_ptr.reset(new ir::BasicBlock(NewLabel(labelId))); - if (firstBlock) { - // Copy contents of original caller block up to call instruction. - for (auto cii = call_block_itr->begin(); cii != call_inst_itr; - ++cii) { - std::unique_ptr cp_inst(cii->Clone()); - // Remember same-block ops for possible regeneration. - if (IsSameBlockOp(&*cp_inst)) { - auto* sb_inst_ptr = cp_inst.get(); - preCallSB[cp_inst->result_id()] = sb_inst_ptr; - } - new_blk_ptr->AddInstruction(std::move(cp_inst)); - } - if (caller_is_loop_header && - callee_begins_with_structured_header) { - // We can't place both the caller's merge instruction and another - // merge instruction in the same block. So split the calling block. - // Insert an unconditional branch to a new guard block. Later, - // once we know the ID of the last block, we will move the caller's - // OpLoopMerge from the last generated block into the first block. - // We also wait to avoid invalidating various iterators. - const auto guard_block_id = this->TakeNextId(); - AddBranch(guard_block_id, &new_blk_ptr); - new_blocks->push_back(std::move(new_blk_ptr)); - // Start the next block. - new_blk_ptr.reset(new ir::BasicBlock(NewLabel(guard_block_id))); - // Reset the mapping of the callee's entry block to point to - // the guard block. Do this so we can fix up phis later on to - // satisfy dominance. - callee2caller[cpi->result_id()] = guard_block_id; - } - // If callee has multiple returns, insert a header block for - // single-trip loop that will encompass callee code. Start postheader - // block. - // - // Note: Consider the following combination: - // - the caller is a single block loop - // - the callee does not begin with a structure header - // - the callee has multiple returns. - // We still need to split the caller block and insert a guard block. - // But we only need to do it once. We haven't done it yet, but the - // single-trip loop header will serve the same purpose. - if (multiReturn) { - singleTripLoopHeaderId = this->TakeNextId(); - AddBranch(singleTripLoopHeaderId, &new_blk_ptr); - new_blocks->push_back(std::move(new_blk_ptr)); - new_blk_ptr.reset(new ir::BasicBlock(NewLabel( - singleTripLoopHeaderId))); - returnLabelId = this->TakeNextId(); - singleTripLoopContinueId = this->TakeNextId(); - AddLoopMerge(returnLabelId, singleTripLoopContinueId, &new_blk_ptr); - uint32_t postHeaderId = this->TakeNextId(); - AddBranch(postHeaderId, &new_blk_ptr); - new_blocks->push_back(std::move(new_blk_ptr)); - new_blk_ptr.reset(new ir::BasicBlock(NewLabel(postHeaderId))); - multiBlocks = true; - // Reset the mapping of the callee's entry block to point to - // the post-header block. Do this so we can fix up phis later - // on to satisfy dominance. - callee2caller[cpi->result_id()] = postHeaderId; - } - } else { - multiBlocks = true; - } - } break; - case SpvOpReturnValue: { - // Store return value to return variable. - assert(returnVarId != 0); - uint32_t valId = cpi->GetInOperand(kSpvReturnValueId).words[0]; - const auto mapItr = callee2caller.find(valId); - if (mapItr != callee2caller.end()) { - valId = mapItr->second; - } - AddStore(returnVarId, valId, &new_blk_ptr); - - // Remember we saw a return; if followed by a label, will need to - // insert branch. - prevInstWasReturn = true; - } break; - case SpvOpReturn: { - // Remember we saw a return; if followed by a label, will need to - // insert branch. - prevInstWasReturn = true; - } break; - case SpvOpFunctionEnd: { - // If there was an early return, we generated a return label id - // for it. Now we have to generate the return block with that Id. - if (returnLabelId != 0) { - // If previous instruction was return, insert branch instruction - // to return block. - if (prevInstWasReturn) AddBranch(returnLabelId, &new_blk_ptr); - if (multiReturn) { - // If we generated a loop header to for the single-trip loop - // to accommodate multiple returns, insert the continue - // target block now, with a false branch back to the loop header. - new_blocks->push_back(std::move(new_blk_ptr)); - new_blk_ptr.reset( - new ir::BasicBlock(NewLabel(singleTripLoopContinueId))); - AddBranchCond(GetFalseId(), singleTripLoopHeaderId, returnLabelId, - &new_blk_ptr); - } - // Generate the return block. - new_blocks->push_back(std::move(new_blk_ptr)); - new_blk_ptr.reset(new ir::BasicBlock(NewLabel(returnLabelId))); - multiBlocks = true; - } - // Load return value into result id of call, if it exists. - if (returnVarId != 0) { - const uint32_t resId = call_inst_itr->result_id(); - assert(resId != 0); - AddLoad(calleeTypeId, resId, returnVarId, &new_blk_ptr); - } - // Copy remaining instructions from caller block. - auto cii = call_inst_itr; - for (++cii; cii != call_block_itr->end(); ++cii) { - std::unique_ptr cp_inst(cii->Clone()); - // If multiple blocks generated, regenerate any same-block - // instruction that has not been seen in this last block. - if (multiBlocks) { - CloneSameBlockOps(&cp_inst, &postCallSB, &preCallSB, &new_blk_ptr); - // Remember same-block ops in this block. - if (IsSameBlockOp(&*cp_inst)) { - const uint32_t rid = cp_inst->result_id(); - postCallSB[rid] = rid; - } - } - new_blk_ptr->AddInstruction(std::move(cp_inst)); - } - // Finalize inline code. - new_blocks->push_back(std::move(new_blk_ptr)); - } break; - default: { - // Copy callee instruction and remap all input Ids. - std::unique_ptr cp_inst(cpi->Clone()); - cp_inst->ForEachInId([&callee2caller, &callee_result_ids, - this](uint32_t* iid) { - const auto mapItr = callee2caller.find(*iid); - if (mapItr != callee2caller.end()) { - *iid = mapItr->second; - } else if (callee_result_ids.find(*iid) != callee_result_ids.end()) { - // Forward reference. Allocate a new id, map it, - // use it and check for it when remapping result ids - const uint32_t nid = this->TakeNextId(); - callee2caller[*iid] = nid; - *iid = nid; - } - }); - // If result id is non-zero, remap it. If already mapped, use mapped - // value, else use next id. - const uint32_t rid = cp_inst->result_id(); - if (rid != 0) { - const auto mapItr = callee2caller.find(rid); - uint32_t nid; - if (mapItr != callee2caller.end()) { - nid = mapItr->second; - } - else { - nid = this->TakeNextId(); - callee2caller[rid] = nid; - } - cp_inst->SetResultId(nid); - } - new_blk_ptr->AddInstruction(std::move(cp_inst)); - } break; - } - }); - - if (caller_is_loop_header && (new_blocks->size() > 1)) { - // Move the OpLoopMerge from the last block back to the first, where - // it belongs. - auto& first = new_blocks->front(); - auto& last = new_blocks->back(); - assert(first != last); - - // Insert a modified copy of the loop merge into the first block. - auto loop_merge_itr = last->tail(); - --loop_merge_itr; - assert(loop_merge_itr->opcode() == SpvOpLoopMerge); - std::unique_ptr cp_inst(loop_merge_itr->Clone()); - if (caller_is_single_block_loop) { - // Also, update its continue target to point to the last block. - cp_inst->SetInOperand(kSpvLoopMergeContinueTargetIdInIdx, {last->id()}); - } - first->tail().InsertBefore(std::move(cp_inst)); - - // Remove the loop merge from the last block. - loop_merge_itr->RemoveFromList(); - delete &*loop_merge_itr; - } - - // Update block map given replacement blocks. - for (auto& blk : *new_blocks) { - id2block_[blk->id()] = &*blk; - } -} - -bool InlinePass::IsInlinableFunctionCall(const ir::Instruction* inst) { - if (inst->opcode() != SpvOp::SpvOpFunctionCall) return false; - const uint32_t calleeFnId = - inst->GetSingleWordOperand(kSpvFunctionCallFunctionId); - const auto ci = inlinable_.find(calleeFnId); - return ci != inlinable_.cend(); -} - -void InlinePass::UpdateSucceedingPhis( - std::vector>& new_blocks) { - const auto firstBlk = new_blocks.begin(); - const auto lastBlk = new_blocks.end() - 1; - const uint32_t firstId = (*firstBlk)->id(); - const uint32_t lastId = (*lastBlk)->id(); - (*lastBlk)->ForEachSuccessorLabel( - [&firstId, &lastId, this](uint32_t succ) { - ir::BasicBlock* sbp = this->id2block_[succ]; - sbp->ForEachPhiInst([&firstId, &lastId](ir::Instruction* phi) { - phi->ForEachInId([&firstId, &lastId](uint32_t* id) { - if (*id == firstId) *id = lastId; - }); - }); - }); -} - -bool InlinePass::HasMultipleReturns(ir::Function* func) { - bool seenReturn = false; - bool multipleReturns = false; - for (auto& blk : *func) { - auto terminal_ii = blk.cend(); - --terminal_ii; - if (terminal_ii->opcode() == SpvOpReturn || - terminal_ii->opcode() == SpvOpReturnValue) { - if (seenReturn) { - multipleReturns = true; - break; - } - seenReturn = true; - } - } - return multipleReturns; -} - -uint32_t InlinePass::MergeBlockIdIfAny(const ir::BasicBlock& blk) { - auto merge_ii = blk.cend(); - --merge_ii; - uint32_t mbid = 0; - if (merge_ii != blk.cbegin()) { - --merge_ii; - if (merge_ii->opcode() == SpvOpLoopMerge) - mbid = merge_ii->GetSingleWordOperand(kSpvLoopMergeMergeBlockId); - else if (merge_ii->opcode() == SpvOpSelectionMerge) - mbid = merge_ii->GetSingleWordOperand(kSpvSelectionMergeMergeBlockId); - } - return mbid; -} - -void InlinePass::ComputeStructuredSuccessors(ir::Function* func) { - // If header, make merge block first successor. - for (auto& blk : *func) { - uint32_t mbid = MergeBlockIdIfAny(blk); - if (mbid != 0) - block2structured_succs_[&blk].push_back(id2block_[mbid]); - // add true successors - blk.ForEachSuccessorLabel([&blk, this](uint32_t sbid) { - block2structured_succs_[&blk].push_back(id2block_[sbid]); - }); - } -} - -InlinePass::GetBlocksFunction InlinePass::StructuredSuccessorsFunction() { - return [this](const ir::BasicBlock* block) { - return &(block2structured_succs_[block]); - }; -} - -bool InlinePass::HasNoReturnInLoop(ir::Function* func) { - // If control not structured, do not do loop/return analysis - // TODO: Analyze returns in non-structured control flow - if (!module_->HasCapability(SpvCapabilityShader)) - return false; - // Compute structured block order. This order has the property - // that dominators are before all blocks they dominate and merge blocks - // are after all blocks that are in the control constructs of their header. - ComputeStructuredSuccessors(func); - auto ignore_block = [](cbb_ptr) {}; - auto ignore_edge = [](cbb_ptr, cbb_ptr) {}; - std::list structuredOrder; - spvtools::CFA::DepthFirstTraversal( - &*func->begin(), StructuredSuccessorsFunction(), ignore_block, - [&](cbb_ptr b) { structuredOrder.push_front(b); }, ignore_edge); - // Search for returns in loops. Only need to track outermost loop - bool return_in_loop = false; - uint32_t outerLoopMergeId = 0; - for (auto& blk : structuredOrder) { - // Exiting current outer loop - if (blk->id() == outerLoopMergeId) - outerLoopMergeId = 0; - // Return block - auto terminal_ii = blk->cend(); - --terminal_ii; - if (terminal_ii->opcode() == SpvOpReturn || - terminal_ii->opcode() == SpvOpReturnValue) { - if (outerLoopMergeId != 0) { - return_in_loop = true; - break; - } - } - else if (terminal_ii != blk->cbegin()) { - auto merge_ii = terminal_ii; - --merge_ii; - // Entering outermost loop - if (merge_ii->opcode() == SpvOpLoopMerge && outerLoopMergeId == 0) - outerLoopMergeId = merge_ii->GetSingleWordOperand( - kSpvLoopMergeMergeBlockId); - } - } - return !return_in_loop; -} - -void InlinePass::AnalyzeReturns(ir::Function* func) { - // Look for multiple returns - if (!HasMultipleReturns(func)) { - no_return_in_loop_.insert(func->result_id()); - return; - } - multi_return_funcs_.insert(func->result_id()); - // If multiple returns, see if any are in a loop - if (HasNoReturnInLoop(func)) - no_return_in_loop_.insert(func->result_id()); -} - -bool InlinePass::IsInlinableFunction(ir::Function* func) { - // We can only inline a function if it has blocks. - if (func->cbegin() == func->cend()) - return false; - // Do not inline functions with returns in loops. Currently early return - // functions are inlined by wrapping them in a one trip loop and implementing - // the returns as a branch to the loop's merge block. However, this can only - // done validly if the return was not in a loop in the original function. - // Also remember functions with multiple (early) returns. - AnalyzeReturns(func); - return no_return_in_loop_.find(func->result_id()) != - no_return_in_loop_.cend(); -} - -void InlinePass::InitializeInline(ir::Module* module) { - def_use_mgr_.reset(new analysis::DefUseManager(consumer(), module)); - - // Initialize next unused Id. - next_id_ = module->id_bound(); - - // Save module. - module_ = module; - - false_id_ = 0; - - // clear collections - id2function_.clear(); - id2block_.clear(); - block2structured_succs_.clear(); - inlinable_.clear(); - no_return_in_loop_.clear(); - multi_return_funcs_.clear(); - - for (auto& fn : *module_) { - // Initialize function and block maps. - id2function_[fn.result_id()] = &fn; - for (auto& blk : fn) { - id2block_[blk.id()] = &blk; - } - // Compute inlinability - if (IsInlinableFunction(&fn)) - inlinable_.insert(fn.result_id()); - } -}; - - -InlinePass::InlinePass() - : module_(nullptr), def_use_mgr_(nullptr), next_id_(0) {} - -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/inline_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/inline_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/inline_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/inline_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,214 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#ifndef LIBSPIRV_OPT_INLINE_PASS_H_ -#define LIBSPIRV_OPT_INLINE_PASS_H_ - -#include -#include -#include -#include -#include - -#include "def_use_manager.h" -#include "module.h" -#include "pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class InlinePass : public Pass { - - using cbb_ptr = const ir::BasicBlock*; - - public: - using GetBlocksFunction = - std::function*(const ir::BasicBlock*)>; - - InlinePass(); - virtual ~InlinePass() = default; - - protected: - // Return the next available Id and increment it. - inline uint32_t TakeNextId() { return next_id_++; } - - // Write the next available Id back to the module. - inline void FinalizeNextId(ir::Module* module) { - module->SetIdBound(next_id_); - } - - // Find pointer to type and storage in module, return its resultId, - // 0 if not found. TODO(greg-lunarg): Move this into type manager. - uint32_t FindPointerToType(uint32_t type_id, SpvStorageClass storage_class); - - // Add pointer to type to module and return resultId. - uint32_t AddPointerToType(uint32_t type_id, SpvStorageClass storage_class); - - // Add unconditional branch to labelId to end of block block_ptr. - void AddBranch(uint32_t labelId, std::unique_ptr* block_ptr); - - // Add conditional branch to end of block |block_ptr|. - void AddBranchCond(uint32_t cond_id, uint32_t true_id, - uint32_t false_id, std::unique_ptr* block_ptr); - - // Add unconditional branch to labelId to end of block block_ptr. - void AddLoopMerge(uint32_t merge_id, uint32_t continue_id, - std::unique_ptr* block_ptr); - - // Add store of valId to ptrId to end of block block_ptr. - void AddStore(uint32_t ptrId, uint32_t valId, - std::unique_ptr* block_ptr); - - // Add load of ptrId into resultId to end of block block_ptr. - void AddLoad(uint32_t typeId, uint32_t resultId, uint32_t ptrId, - std::unique_ptr* block_ptr); - - // Return new label. - std::unique_ptr NewLabel(uint32_t label_id); - - // Returns the id for the boolean false value. Looks in the module first - // and creates it if not found. Remembers it for future calls. - uint32_t GetFalseId(); - - // Map callee params to caller args - void MapParams(ir::Function* calleeFn, - ir::BasicBlock::iterator call_inst_itr, - std::unordered_map* callee2caller); - - // Clone and map callee locals - void CloneAndMapLocals( - ir::Function* calleeFn, - std::vector>* new_vars, - std::unordered_map* callee2caller); - - // Create return variable for callee clone code if needed. Return id - // if created, otherwise 0. - uint32_t CreateReturnVar( - ir::Function* calleeFn, - std::vector>* new_vars); - - // Return true if instruction must be in the same block that its result - // is used. - bool IsSameBlockOp(const ir::Instruction* inst) const; - - // Clone operands which must be in same block as consumer instructions. - // Look in preCallSB for instructions that need cloning. Look in - // postCallSB for instructions already cloned. Add cloned instruction - // to postCallSB. - void CloneSameBlockOps( - std::unique_ptr* inst, - std::unordered_map* postCallSB, - std::unordered_map* preCallSB, - std::unique_ptr* block_ptr); - - // Return in new_blocks the result of inlining the call at call_inst_itr - // within its block at call_block_itr. The block at call_block_itr can - // just be replaced with the blocks in new_blocks. Any additional branches - // are avoided. Debug instructions are cloned along with their callee - // instructions. Early returns are replaced by a store to a local return - // variable and a branch to a (created) exit block where the local variable - // is returned. Formal parameters are trivially mapped to their actual - // parameters. Note that the first block in new_blocks retains the label - // of the original calling block. Also note that if an exit block is - // created, it is the last block of new_blocks. - // - // Also return in new_vars additional OpVariable instructions required by - // and to be inserted into the caller function after the block at - // call_block_itr is replaced with new_blocks. - void GenInlineCode(std::vector>* new_blocks, - std::vector>* new_vars, - ir::BasicBlock::iterator call_inst_itr, - ir::UptrVectorIterator call_block_itr); - - // Return true if |inst| is a function call that can be inlined. - bool IsInlinableFunctionCall(const ir::Instruction* inst); - - // Returns the id of the merge block declared by a merge instruction in - // this block, if any. If none, returns zero. - uint32_t MergeBlockIdIfAny(const ir::BasicBlock& blk); - - // Compute structured successors for function |func|. - // A block's structured successors are the blocks it branches to - // together with its declared merge block if it has one. - // When order matters, the merge block always appears first. - // This assures correct depth first search in the presence of early - // returns and kills. If the successor vector contain duplicates - // if the merge block, they are safely ignored by DFS. - void ComputeStructuredSuccessors(ir::Function* func); - - // Return function to return ordered structure successors for a given block - // Assumes ComputeStructuredSuccessors() has been called. - GetBlocksFunction StructuredSuccessorsFunction(); - - // Return true if |func| has multiple returns - bool HasMultipleReturns(ir::Function* func); - - // Return true if |func| has no return in a loop. The current analysis - // requires structured control flow, so return false if control flow not - // structured ie. module is not a shader. - bool HasNoReturnInLoop(ir::Function* func); - - // Find all functions with multiple returns and no returns in loops - void AnalyzeReturns(ir::Function* func); - - // Return true if |func| is a function that can be inlined. - bool IsInlinableFunction(ir::Function* func); - - // Update phis in succeeding blocks to point to new last block - void UpdateSucceedingPhis( - std::vector>& new_blocks); - - // Initialize state for optimization of |module| - void InitializeInline(ir::Module* module); - - // Module being processed by this pass - ir::Module* module_; - - // Def/Use database - std::unique_ptr def_use_mgr_; - - // Map from function's result id to function. - std::unordered_map id2function_; - - // Map from block's label id to block. - std::unordered_map id2block_; - - // Set of ids of functions with multiple returns. - std::set multi_return_funcs_; - - // Set of ids of functions with no returns in loop - std::set no_return_in_loop_; - - // Set of ids of inlinable functions - std::set inlinable_; - - // Map from block to its structured successor blocks. See - // ComputeStructuredSuccessors() for definition. - std::unordered_map> - block2structured_succs_; - - // result id for OpConstantFalse - uint32_t false_id_; - - // Next unused ID - uint32_t next_id_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_INLINE_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/insert_extract_elim.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/insert_extract_elim.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/insert_extract_elim.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/insert_extract_elim.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,196 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "insert_extract_elim.h" - -#include "iterator.h" - -namespace spvtools { -namespace opt { - -namespace { - -const uint32_t kExtractCompositeIdInIdx = 0; -const uint32_t kInsertObjectIdInIdx = 0; -const uint32_t kInsertCompositeIdInIdx = 1; - -} // anonymous namespace - -bool InsertExtractElimPass::ExtInsMatch(const ir::Instruction* extInst, - const ir::Instruction* insInst) const { - if (extInst->NumInOperands() != insInst->NumInOperands() - 1) - return false; - uint32_t numIdx = extInst->NumInOperands() - 1; - for (uint32_t i = 0; i < numIdx; ++i) - if (extInst->GetSingleWordInOperand(i + 1) != - insInst->GetSingleWordInOperand(i + 2)) - return false; - return true; -} - -bool InsertExtractElimPass::ExtInsConflict(const ir::Instruction* extInst, - const ir::Instruction* insInst) const { - if (extInst->NumInOperands() == insInst->NumInOperands() - 1) - return false; - uint32_t extNumIdx = extInst->NumInOperands() - 1; - uint32_t insNumIdx = insInst->NumInOperands() - 2; - uint32_t numIdx = std::min(extNumIdx, insNumIdx); - for (uint32_t i = 0; i < numIdx; ++i) - if (extInst->GetSingleWordInOperand(i + 1) != - insInst->GetSingleWordInOperand(i + 2)) - return false; - return true; -} - -bool InsertExtractElimPass::IsVectorType(uint32_t typeId) { - ir::Instruction* typeInst = def_use_mgr_->GetDef(typeId); - return typeInst->opcode() == SpvOpTypeVector; -} - -bool InsertExtractElimPass::EliminateInsertExtract(ir::Function* func) { - bool modified = false; - for (auto bi = func->begin(); bi != func->end(); ++bi) { - for (auto ii = bi->begin(); ii != bi->end(); ++ii) { - switch (ii->opcode()) { - case SpvOpCompositeExtract: { - uint32_t cid = ii->GetSingleWordInOperand(kExtractCompositeIdInIdx); - ir::Instruction* cinst = def_use_mgr_->GetDef(cid); - uint32_t replId = 0; - while (cinst->opcode() == SpvOpCompositeInsert) { - if (ExtInsConflict(&*ii, cinst)) - break; - if (ExtInsMatch(&*ii, cinst)) { - replId = cinst->GetSingleWordInOperand(kInsertObjectIdInIdx); - break; - } - cid = cinst->GetSingleWordInOperand(kInsertCompositeIdInIdx); - cinst = def_use_mgr_->GetDef(cid); - } - // If search ended with CompositeConstruct or ConstantComposite - // and the extract has one index, return the appropriate component. - // If a vector CompositeConstruct we make sure all preceding - // components are of component type (not vector composition). - // TODO(greg-lunarg): Handle multiple-indices, ConstantNull, special - // vector composition, and additional CompositeInsert. - if ((cinst->opcode() == SpvOpCompositeConstruct || - cinst->opcode() == SpvOpConstantComposite) && - (*ii).NumInOperands() == 2) { - uint32_t compIdx = (*ii).GetSingleWordInOperand(1); - if (IsVectorType(cinst->type_id())) { - if (compIdx < cinst->NumInOperands()) { - uint32_t i = 0; - for (; i <= compIdx; i++) { - uint32_t compId = cinst->GetSingleWordInOperand(i); - ir::Instruction* compInst = def_use_mgr_->GetDef(compId); - if (compInst->type_id() != (*ii).type_id()) - break; - } - if (i > compIdx) - replId = cinst->GetSingleWordInOperand(compIdx); - } - } - else { - replId = cinst->GetSingleWordInOperand(compIdx); - } - } - if (replId != 0) { - const uint32_t extId = ii->result_id(); - (void)def_use_mgr_->ReplaceAllUsesWith(extId, replId); - def_use_mgr_->KillInst(&*ii); - modified = true; - } - } break; - default: - break; - } - } - } - return modified; -} - -void InsertExtractElimPass::Initialize(ir::Module* module) { - - module_ = module; - - // Do def/use on whole module - def_use_mgr_.reset(new analysis::DefUseManager(consumer(), module_)); - - // Initialize extension whitelist - InitExtensions(); -}; - -bool InsertExtractElimPass::AllExtensionsSupported() const { - // If any extension not in whitelist, return false - for (auto& ei : module_->extensions()) { - const char* extName = reinterpret_cast( - &ei.GetInOperand(0).words[0]); - if (extensions_whitelist_.find(extName) == extensions_whitelist_.end()) - return false; - } - return true; -} - -Pass::Status InsertExtractElimPass::ProcessImpl() { - // Do not process if any disallowed extensions are enabled - if (!AllExtensionsSupported()) - return Status::SuccessWithoutChange; - // Process all entry point functions. - ProcessFunction pfn = [this](ir::Function* fp) { - return EliminateInsertExtract(fp); - }; - bool modified = ProcessEntryPointCallTree(pfn, module_); - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -InsertExtractElimPass::InsertExtractElimPass() - : module_(nullptr), def_use_mgr_(nullptr) {} - -Pass::Status InsertExtractElimPass::Process(ir::Module* module) { - Initialize(module); - return ProcessImpl(); -} - -void InsertExtractElimPass::InitExtensions() { - extensions_whitelist_.clear(); - extensions_whitelist_.insert({ - "SPV_AMD_shader_explicit_vertex_parameter", - "SPV_AMD_shader_trinary_minmax", - "SPV_AMD_gcn_shader", - "SPV_KHR_shader_ballot", - "SPV_AMD_shader_ballot", - "SPV_AMD_gpu_shader_half_float", - "SPV_KHR_shader_draw_parameters", - "SPV_KHR_subgroup_vote", - "SPV_KHR_16bit_storage", - "SPV_KHR_device_group", - "SPV_KHR_multiview", - "SPV_NVX_multiview_per_view_attributes", - "SPV_NV_viewport_array2", - "SPV_NV_stereo_view_rendering", - "SPV_NV_sample_mask_override_coverage", - "SPV_NV_geometry_shader_passthrough", - "SPV_AMD_texture_gather_bias_lod", - "SPV_KHR_storage_buffer_storage_class", - "SPV_KHR_variable_pointers", - "SPV_AMD_gpu_shader_int16", - "SPV_KHR_post_depth_coverage", - "SPV_KHR_shader_atomic_counter_ops", - }); -} - -} // namespace opt -} // namespace spvtools - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/insert_extract_elim.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/insert_extract_elim.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/insert_extract_elim.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/insert_extract_elim.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#ifndef LIBSPIRV_OPT_INSERT_EXTRACT_ELIM_PASS_H_ -#define LIBSPIRV_OPT_INSERT_EXTRACT_ELIM_PASS_H_ - - -#include -#include -#include -#include -#include - -#include "basic_block.h" -#include "def_use_manager.h" -#include "module.h" -#include "pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class InsertExtractElimPass : public Pass { - public: - InsertExtractElimPass(); - const char* name() const override { return "eliminate-insert-extract"; } - Status Process(ir::Module*) override; - - private: - // Return true if indices of extract |extInst| and insert |insInst| match - bool ExtInsMatch( - const ir::Instruction* extInst, const ir::Instruction* insInst) const; - - // Return true if indices of extract |extInst| and insert |insInst| conflict, - // specifically, if the insert changes bits specified by the extract, but - // changes either more bits or less bits than the extract specifies, - // meaning the exact value being inserted cannot be used to replace - // the extract. - bool ExtInsConflict( - const ir::Instruction* extInst, const ir::Instruction* insInst) const; - - // Return true if |typeId| is a vector type - bool IsVectorType(uint32_t typeId); - - // Look for OpExtract on sequence of OpInserts in |func|. If there is an - // insert with identical indices, replace the extract with the value - // that is inserted if possible. Specifically, replace if there is no - // intervening insert which conflicts. - bool EliminateInsertExtract(ir::Function* func); - - // Initialize extensions whitelist - void InitExtensions(); - - // Return true if all extensions in this module are allowed by this pass. - bool AllExtensionsSupported() const; - - void Initialize(ir::Module* module); - Pass::Status ProcessImpl(); - - // Module this pass is processing - ir::Module* module_; - - // Def-Uses for the module we are processing - std::unique_ptr def_use_mgr_; - - // Extensions supported by this pass. - std::unordered_set extensions_whitelist_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_INSERT_EXTRACT_ELIM_PASS_H_ - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/instruction.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/instruction.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/instruction.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/instruction.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,114 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "instruction.h" - -#include - -#include "reflect.h" - -namespace spvtools { -namespace ir { - -Instruction::Instruction(const spv_parsed_instruction_t& inst, - std::vector&& dbg_line) - : opcode_(static_cast(inst.opcode)), - type_id_(inst.type_id), - result_id_(inst.result_id), - dbg_line_insts_(std::move(dbg_line)) { - assert((!IsDebugLineInst(opcode_) || dbg_line.empty()) && - "Op(No)Line attaching to Op(No)Line found"); - for (uint32_t i = 0; i < inst.num_operands; ++i) { - const auto& current_payload = inst.operands[i]; - std::vector words( - inst.words + current_payload.offset, - inst.words + current_payload.offset + current_payload.num_words); - operands_.emplace_back(current_payload.type, std::move(words)); - } -} - -Instruction::Instruction(SpvOp op, uint32_t ty_id, uint32_t res_id, - const std::vector& in_operands) - : utils::IntrusiveNodeBase(), - opcode_(op), - type_id_(ty_id), - result_id_(res_id), - operands_() { - if (type_id_ != 0) { - operands_.emplace_back(spv_operand_type_t::SPV_OPERAND_TYPE_TYPE_ID, - std::initializer_list{type_id_}); - } - if (result_id_ != 0) { - operands_.emplace_back(spv_operand_type_t::SPV_OPERAND_TYPE_RESULT_ID, - std::initializer_list{result_id_}); - } - operands_.insert(operands_.end(), in_operands.begin(), in_operands.end()); -} - -Instruction::Instruction(Instruction&& that) - : utils::IntrusiveNodeBase(), - opcode_(that.opcode_), - type_id_(that.type_id_), - result_id_(that.result_id_), - operands_(std::move(that.operands_)), - dbg_line_insts_(std::move(that.dbg_line_insts_)) {} - -Instruction& Instruction::operator=(Instruction&& that) { - opcode_ = that.opcode_; - type_id_ = that.type_id_; - result_id_ = that.result_id_; - operands_ = std::move(that.operands_); - dbg_line_insts_ = std::move(that.dbg_line_insts_); - return *this; -} - -Instruction* Instruction::Clone() const { - Instruction* clone = new Instruction(); - clone->opcode_ = opcode_; - clone->type_id_ = type_id_; - clone->result_id_ = result_id_; - clone->operands_ = operands_; - clone->dbg_line_insts_ = dbg_line_insts_; - return clone; -} - -uint32_t Instruction::GetSingleWordOperand(uint32_t index) const { - const auto& words = GetOperand(index).words; - assert(words.size() == 1 && "expected the operand only taking one word"); - return words.front(); -} - -uint32_t Instruction::NumInOperandWords() const { - uint32_t size = 0; - for (uint32_t i = TypeResultIdCount(); i < operands_.size(); ++i) - size += static_cast(operands_[i].words.size()); - return size; -} - -void Instruction::ToBinaryWithoutAttachedDebugInsts( - std::vector* binary) const { - const uint32_t num_words = 1 + NumOperandWords(); - binary->push_back((num_words << 16) | static_cast(opcode_)); - for (const auto& operand : operands_) - binary->insert(binary->end(), operand.words.begin(), operand.words.end()); -} - -void Instruction::ReplaceOperands(const std::vector& new_operands) { - operands_.clear(); - operands_.insert(operands_.begin(), new_operands.begin(), new_operands.end()); - operands_.shrink_to_fit(); -} - -} // namespace ir -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/instruction.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/instruction.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/instruction.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/instruction.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,396 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_INSTRUCTION_H_ -#define LIBSPIRV_OPT_INSTRUCTION_H_ - -#include -#include -#include -#include - -#include "operand.h" -#include "util/ilist_node.h" - -#include "spirv-tools/libspirv.h" -#include "spirv/1.2/spirv.h" - -namespace spvtools { -namespace ir { - -class Function; -class Module; -class InstructionList; - -// About operand: -// -// In the SPIR-V specification, the term "operand" is used to mean any single -// SPIR-V word following the leading wordcount-opcode word. Here, the term -// "operand" is used to mean a *logical* operand. A logical operand may consist -// of multiple SPIR-V words, which together make up the same component. For -// example, a logical operand of a 64-bit integer needs two words to express. -// -// Further, we categorize logical operands into *in* and *out* operands. -// In operands are operands actually serve as input to operations, while out -// operands are operands that represent ids generated from operations (result -// type id or result id). For example, for "OpIAdd %rtype %rid %inop1 %inop2", -// "%inop1" and "%inop2" are in operands, while "%rtype" and "%rid" are out -// operands. - -// A *logical* operand to a SPIR-V instruction. It can be the type id, result -// id, or other additional operands carried in an instruction. -struct Operand { - Operand(spv_operand_type_t t, std::vector&& w) - : type(t), words(std::move(w)) {} - - Operand(spv_operand_type_t t, const std::vector& w) - : type(t), words(w) {} - - spv_operand_type_t type; // Type of this logical operand. - std::vector words; // Binary segments of this logical operand. - - friend bool operator==(const Operand& o1, const Operand& o2) { - return o1.type == o2.type && o1.words == o2.words; - } - - // TODO(antiagainst): create fields for literal number kind, width, etc. -}; - -inline bool operator!=(const Operand& o1, const Operand& o2) { - return !(o1 == o2); -} - -// A SPIR-V instruction. It contains the opcode and any additional logical -// operand, including the result id (if any) and result type id (if any). It -// may also contain line-related debug instruction (OpLine, OpNoLine) directly -// appearing before this instruction. Note that the result id of an instruction -// should never change after the instruction being built. If the result id -// needs to change, the user should create a new instruction instead. -class Instruction : public utils::IntrusiveNodeBase { - public: - using iterator = std::vector::iterator; - using const_iterator = std::vector::const_iterator; - - // Creates a default OpNop instruction. - Instruction() - : utils::IntrusiveNodeBase(), - opcode_(SpvOpNop), - type_id_(0), - result_id_(0) {} - // Creates an instruction with the given opcode |op| and no additional logical - // operands. - Instruction(SpvOp op) - : utils::IntrusiveNodeBase(), - opcode_(op), - type_id_(0), - result_id_(0) {} - // Creates an instruction using the given spv_parsed_instruction_t |inst|. All - // the data inside |inst| will be copied and owned in this instance. And keep - // record of line-related debug instructions |dbg_line| ahead of this - // instruction, if any. - Instruction(const spv_parsed_instruction_t& inst, - std::vector&& dbg_line = {}); - - // Creates an instruction with the given opcode |op|, type id: |ty_id|, - // result id: |res_id| and input operands: |in_operands|. - Instruction(SpvOp op, uint32_t ty_id, uint32_t res_id, - const std::vector& in_operands); - - // TODO: I will want to remove these, but will first have to remove the use of - // std::vector. - Instruction(const Instruction&) = default; - Instruction& operator=(const Instruction&) = default; - - Instruction(Instruction&&); - Instruction& operator=(Instruction&&); - - virtual ~Instruction() = default; - - // Returns a newly allocated instruction that has the same operands, result, - // and type as |this|. The new instruction is not linked into any list. - // It is the responsibility of the caller to make sure that the storage is - // removed. It is the caller's responsibility to make sure that there is only - // one instruction for each result id. - Instruction* Clone() const; - - SpvOp opcode() const { return opcode_; } - // Sets the opcode of this instruction to a specific opcode. Note this may - // invalidate the instruction. - // TODO(qining): Remove this function when instruction building and insertion - // is well implemented. - void SetOpcode(SpvOp op) { opcode_ = op; } - uint32_t type_id() const { return type_id_; } - uint32_t result_id() const { return result_id_; } - // Returns the vector of line-related debug instructions attached to this - // instruction and the caller can directly modify them. - std::vector& dbg_line_insts() { return dbg_line_insts_; } - const std::vector& dbg_line_insts() const { - return dbg_line_insts_; - } - - // Same semantics as in the base class except the list the InstructionList - // containing |pos| will now assume ownership of |this|. - // inline void MoveBefore(Instruction* pos); - // inline void InsertAfter(Instruction* pos); - - // Begin and end iterators for operands. - iterator begin() { return operands_.begin(); } - iterator end() { return operands_.end(); } - const_iterator begin() const { return operands_.cbegin(); } - const_iterator end() const { return operands_.cend(); } - // Const begin and end iterators for operands. - const_iterator cbegin() const { return operands_.cbegin(); } - const_iterator cend() const { return operands_.cend(); } - - // Gets the number of logical operands. - uint32_t NumOperands() const { - return static_cast(operands_.size()); - } - // Gets the number of SPIR-V words occupied by all logical operands. - uint32_t NumOperandWords() const { - return NumInOperandWords() + TypeResultIdCount(); - } - // Gets the |index|-th logical operand. - inline const Operand& GetOperand(uint32_t index) const; - // Gets the |index|-th logical operand as a single SPIR-V word. This method is - // not expected to be used with logical operands consisting of multiple SPIR-V - // words. - uint32_t GetSingleWordOperand(uint32_t index) const; - // Sets the |index|-th in-operand's data to the given |data|. - inline void SetInOperand(uint32_t index, std::vector&& data); - // Sets the result type id. - inline void SetResultType(uint32_t ty_id); - // Sets the result id - inline void SetResultId(uint32_t res_id); - // Remove the |index|-th operand - void RemoveOperand(uint32_t index) { - operands_.erase(operands_.begin() + index); - } - - // The following methods are similar to the above, but are for in operands. - uint32_t NumInOperands() const { - return static_cast(operands_.size() - TypeResultIdCount()); - } - uint32_t NumInOperandWords() const; - const Operand& GetInOperand(uint32_t index) const { - return GetOperand(index + TypeResultIdCount()); - } - uint32_t GetSingleWordInOperand(uint32_t index) const { - return GetSingleWordOperand(index + TypeResultIdCount()); - } - void RemoveInOperand(uint32_t index) { - operands_.erase(operands_.begin() + index + TypeResultIdCount()); - } - - // Returns true if this instruction is OpNop. - inline bool IsNop() const; - // Turns this instruction to OpNop. This does not clear out all preceding - // line-related debug instructions. - inline void ToNop(); - - // Runs the given function |f| on this instruction and optionally on the - // preceding debug line instructions. The function will always be run - // if this is itself a debug line instruction. - inline void ForEachInst(const std::function& f, - bool run_on_debug_line_insts = false); - inline void ForEachInst(const std::function& f, - bool run_on_debug_line_insts = false) const; - - // Runs the given function |f| on all operand ids. - // - // |f| should not transform an ID into 0, as 0 is an invalid ID. - inline void ForEachId(const std::function& f); - inline void ForEachId(const std::function& f) const; - - // Runs the given function |f| on all "in" operand ids - inline void ForEachInId(const std::function& f); - inline void ForEachInId(const std::function& f) const; - - // Runs the given function |f| on all "in" operands - inline void ForEachInOperand(const std::function& f); - inline void ForEachInOperand(const std::function& f) - const; - - // Returns true if any operands can be labels - inline bool HasLabels() const; - - // Pushes the binary segments for this instruction into the back of *|binary|. - void ToBinaryWithoutAttachedDebugInsts(std::vector* binary) const; - - // Replaces the operands to the instruction with |new_operands|. The caller - // is responsible for building a complete and valid list of operands for - // this instruction. - void ReplaceOperands(const std::vector& new_operands); - - private: - // Returns the total count of result type id and result id. - uint32_t TypeResultIdCount() const { - return (type_id_ != 0) + (result_id_ != 0); - } - - SpvOp opcode_; // Opcode - uint32_t type_id_; // Result type id. A value of 0 means no result type id. - uint32_t result_id_; // Result id. A value of 0 means no result id. - // All logical operands, including result type id and result id. - std::vector operands_; - // Opline and OpNoLine instructions preceding this instruction. Note that for - // Instructions representing OpLine or OpNonLine itself, this field should be - // empty. - std::vector dbg_line_insts_; - - friend InstructionList; -}; - -inline const Operand& Instruction::GetOperand(uint32_t index) const { - assert(index < operands_.size() && "operand index out of bound"); - return operands_[index]; -}; - -inline void Instruction::SetInOperand(uint32_t index, - std::vector&& data) { - assert(index + TypeResultIdCount() < operands_.size() && - "operand index out of bound"); - operands_[index + TypeResultIdCount()].words = std::move(data); -} - -inline void Instruction::SetResultId(uint32_t res_id) { - result_id_ = res_id; - auto ridx = (type_id_ != 0) ? 1 : 0; - assert(operands_[ridx].type == SPV_OPERAND_TYPE_RESULT_ID); - operands_[ridx].words = {res_id}; -} - -inline void Instruction::SetResultType(uint32_t ty_id) { - if (type_id_ != 0) { - type_id_ = ty_id; - assert(operands_.front().type == SPV_OPERAND_TYPE_TYPE_ID); - operands_.front().words = {ty_id}; - } -} - -inline bool Instruction::IsNop() const { - return opcode_ == SpvOpNop && type_id_ == 0 && result_id_ == 0 && - operands_.empty(); -} - -inline void Instruction::ToNop() { - opcode_ = SpvOpNop; - type_id_ = result_id_ = 0; - operands_.clear(); -} - -inline void Instruction::ForEachInst(const std::function& f, - bool run_on_debug_line_insts) { - if (run_on_debug_line_insts) - for (auto& dbg_line : dbg_line_insts_) f(&dbg_line); - f(this); -} - -inline void Instruction::ForEachInst( - const std::function& f, - bool run_on_debug_line_insts) const { - if (run_on_debug_line_insts) - for (auto& dbg_line : dbg_line_insts_) f(&dbg_line); - f(this); -} - -inline void Instruction::ForEachId(const std::function& f) { - for (auto& opnd : operands_) - if (spvIsIdType(opnd.type)) f(&opnd.words[0]); - if (type_id_ != 0u) - type_id_ = GetSingleWordOperand(0u); - if (result_id_ != 0u) result_id_ = GetSingleWordOperand(type_id_ == 0u ? 0u : 1u); -} - -inline void Instruction::ForEachId( - const std::function& f) const { - for (const auto& opnd : operands_) - if (spvIsIdType(opnd.type)) f(&opnd.words[0]); -} - -inline void Instruction::ForEachInId(const std::function& f) { - for (auto& opnd : operands_) { - switch (opnd.type) { - case SPV_OPERAND_TYPE_RESULT_ID: - case SPV_OPERAND_TYPE_TYPE_ID: - break; - default: - if (spvIsIdType(opnd.type)) f(&opnd.words[0]); - break; - } - } -} - -inline void Instruction::ForEachInId( - const std::function& f) const { - for (const auto& opnd : operands_) { - switch (opnd.type) { - case SPV_OPERAND_TYPE_RESULT_ID: - case SPV_OPERAND_TYPE_TYPE_ID: - break; - default: - if (spvIsIdType(opnd.type)) f(&opnd.words[0]); - break; - } - } -} - -inline void Instruction::ForEachInOperand( - const std::function& f) { - for (auto& opnd : operands_) { - switch (opnd.type) { - case SPV_OPERAND_TYPE_RESULT_ID: - case SPV_OPERAND_TYPE_TYPE_ID: - break; - default: - f(&opnd.words[0]); - break; - } - } -} - -inline void Instruction::ForEachInOperand( - const std::function& f) const { - for (const auto& opnd : operands_) { - switch (opnd.type) { - case SPV_OPERAND_TYPE_RESULT_ID: - case SPV_OPERAND_TYPE_TYPE_ID: - break; - default: - f(&opnd.words[0]); - break; - } - } -} - -inline bool Instruction::HasLabels() const { - switch (opcode_) { - case SpvOpSelectionMerge: - case SpvOpBranch: - case SpvOpLoopMerge: - case SpvOpBranchConditional: - case SpvOpSwitch: - case SpvOpPhi: - return true; - break; - default: - break; - } - return false; -} - -} // namespace ir -} // namespace spvtools - -#endif // LIBSPIRV_OPT_INSTRUCTION_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/instruction_list.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/instruction_list.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/instruction_list.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/instruction_list.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include "instruction_list.h" - -namespace spvtools { -namespace ir { - -InstructionList::~InstructionList() { - while (!empty()) { - Instruction* inst = &front(); - inst->RemoveFromList(); - delete inst; - } -} - -InstructionList::iterator InstructionList::iterator::InsertBefore( - std::vector>&& list) { - Instruction* first_node = list.front().get(); - for (auto& i : list) { - i.release()->InsertBefore(node_); - } - list.clear(); - return iterator(first_node); -} - -InstructionList::iterator InstructionList::iterator::InsertBefore( - std::unique_ptr&& i) { - i.get()->InsertBefore(node_); - return iterator(i.release()); -} -} // namespace ir -} // namespace spvtools \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/instruction_list.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/instruction_list.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/instruction_list.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/instruction_list.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ - -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_INSTRUCTION_LIST_H_ -#define LIBSPIRV_OPT_INSTRUCTION_LIST_H_ - -#include -#include -#include -#include - -#include "instruction.h" -#include "operand.h" -#include "util/ilist.h" - -#include "spirv-tools/libspirv.h" -#include "spirv/1.2/spirv.h" - -namespace spvtools { -namespace ir { - -// This class is intended to be the container for Instructions. This container -// owns the instructions that are in it. When removing an Instruction from the -// list, the caller is assuming responsibility for deleting the storage. -// -// TODO: Because there are a number of other data structures that will want -// pointers to instruction, ownership should probably be moved to the module. -// Because of that I have not made the ownership passing in this class fully -// explicit. For example, RemoveFromList takes ownership from the list, but -// does not return an std::unique_ptr to signal that. When we fully decide on -// ownership, this will have to be fixed up one way or the other. -class InstructionList : public utils::IntrusiveList { - public: - InstructionList() = default; - InstructionList(InstructionList&& that) - : utils::IntrusiveList(std::move(that)) {} - InstructionList& operator=(InstructionList&& that) { - auto p = static_cast*>(this); - *p = std::move(that); - return *this; - } - - // Destroy this list and any instructions in the list. - virtual ~InstructionList(); - - class iterator : public utils::IntrusiveList::iterator { - public: - iterator(const utils::IntrusiveList::iterator& i) - : utils::IntrusiveList::iterator(&*i) {} - iterator(Instruction* i) : utils::IntrusiveList::iterator(i) {} - - // DEPRECATED: Please use MoveBefore with an InstructionList instead. - // - // Moves the nodes in |list| to the list that |this| points to. The - // positions of the nodes will be immediately before the element pointed to - // by the iterator. The return value will be an iterator pointing to the - // first of the newly inserted elements. Ownership of the elements in - // |list| is now passed on to |*this|. - iterator InsertBefore(std::vector>&& list); - - // The node |i| will be inserted immediately before |this|. The return value - // will be an iterator pointing to the newly inserted node. The owner of - // |*i| becomes |*this| - iterator InsertBefore(std::unique_ptr&& i); - }; - - iterator begin() { return utils::IntrusiveList::begin(); } - iterator end() { return utils::IntrusiveList::end(); } - const_iterator begin() const { - return utils::IntrusiveList::begin(); - } - const_iterator end() const { - return utils::IntrusiveList::end(); - } -}; - -} // namespace ir -} // namespace spvtools - -#endif // LIBSPIRV_OPT_INSTRUCTION_LIST_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/ir_loader.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/ir_loader.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/ir_loader.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/ir_loader.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,161 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "ir_loader.h" - -#include "log.h" -#include "reflect.h" - -namespace spvtools { -namespace ir { - -IrLoader::IrLoader(const MessageConsumer& consumer, Module* module) - : consumer_(consumer), - module_(module), - source_(""), - inst_index_(0) {} - -bool IrLoader::AddInstruction(const spv_parsed_instruction_t* inst) { - ++inst_index_; - const auto opcode = static_cast(inst->opcode); - if (IsDebugLineInst(opcode)) { - dbg_line_info_.push_back(Instruction(*inst)); - return true; - } - - std::unique_ptr spv_inst( - new Instruction(*inst, std::move(dbg_line_info_))); - dbg_line_info_.clear(); - - const char* src = source_.c_str(); - spv_position_t loc = {inst_index_, 0, 0}; - - // Handle function and basic block boundaries first, then normal - // instructions. - if (opcode == SpvOpFunction) { - if (function_ != nullptr) { - Error(consumer_, src, loc, "function inside function"); - return false; - } - function_.reset(new Function(std::move(spv_inst))); - } else if (opcode == SpvOpFunctionEnd) { - if (function_ == nullptr) { - Error(consumer_, src, loc, - "OpFunctionEnd without corresponding OpFunction"); - return false; - } - if (block_ != nullptr) { - Error(consumer_, src, loc, "OpFunctionEnd inside basic block"); - return false; - } - function_->SetFunctionEnd(std::move(spv_inst)); - module_->AddFunction(std::move(function_)); - function_ = nullptr; - } else if (opcode == SpvOpLabel) { - if (function_ == nullptr) { - Error(consumer_, src, loc, "OpLabel outside function"); - return false; - } - if (block_ != nullptr) { - Error(consumer_, src, loc, "OpLabel inside basic block"); - return false; - } - block_.reset(new BasicBlock(std::move(spv_inst))); - } else if (IsTerminatorInst(opcode)) { - if (function_ == nullptr) { - Error(consumer_, src, loc, "terminator instruction outside function"); - return false; - } - if (block_ == nullptr) { - Error(consumer_, src, loc, "terminator instruction outside basic block"); - return false; - } - block_->AddInstruction(std::move(spv_inst)); - function_->AddBasicBlock(std::move(block_)); - block_ = nullptr; - } else { - if (function_ == nullptr) { // Outside function definition - SPIRV_ASSERT(consumer_, block_ == nullptr); - if (opcode == SpvOpCapability) { - module_->AddCapability(std::move(spv_inst)); - } else if (opcode == SpvOpExtension) { - module_->AddExtension(std::move(spv_inst)); - } else if (opcode == SpvOpExtInstImport) { - module_->AddExtInstImport(std::move(spv_inst)); - } else if (opcode == SpvOpMemoryModel) { - module_->SetMemoryModel(std::move(spv_inst)); - } else if (opcode == SpvOpEntryPoint) { - module_->AddEntryPoint(std::move(spv_inst)); - } else if (opcode == SpvOpExecutionMode) { - module_->AddExecutionMode(std::move(spv_inst)); - } else if (IsDebug1Inst(opcode)) { - module_->AddDebug1Inst(std::move(spv_inst)); - } else if (IsDebug2Inst(opcode)) { - module_->AddDebug2Inst(std::move(spv_inst)); - } else if (IsDebug3Inst(opcode)) { - module_->AddDebug3Inst(std::move(spv_inst)); - } else if (IsAnnotationInst(opcode)) { - module_->AddAnnotationInst(std::move(spv_inst)); - } else if (IsTypeInst(opcode)) { - module_->AddType(std::move(spv_inst)); - } else if (IsConstantInst(opcode) || opcode == SpvOpVariable || - opcode == SpvOpUndef) { - module_->AddGlobalValue(std::move(spv_inst)); - } else { - SPIRV_UNIMPLEMENTED(consumer_, - "unhandled inst type outside function defintion"); - } - } else { - if (block_ == nullptr) { // Inside function but outside blocks - if (opcode != SpvOpFunctionParameter) { - Errorf(consumer_, src, loc, - "Non-OpFunctionParameter (opcode: %d) found inside " - "function but outside basic block", - opcode); - return false; - } - function_->AddParameter(std::move(spv_inst)); - } else { - block_->AddInstruction(std::move(spv_inst)); - } - } - } - return true; -} - -// Resolves internal references among the module, functions, basic blocks, etc. -// This function should be called after adding all instructions. -void IrLoader::EndModule() { - if (block_ && function_) { - // We're in the middle of a basic block, but the terminator is missing. - // Register the block anyway. This lets us write tests with less - // boilerplate. - function_->AddBasicBlock(std::move(block_)); - block_ = nullptr; - } - if (function_) { - // We're in the middle of a function, but the OpFunctionEnd is missing. - // Register the function anyway. This lets us write tests with less - // boilerplate. - module_->AddFunction(std::move(function_)); - function_ = nullptr; - } - for (auto& function : *module_) { - for (auto& bb : function) bb.SetParent(&function); - function.SetParent(module_); - } -} - -} // namespace ir -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/ir_loader.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/ir_loader.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/ir_loader.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/ir_loader.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_IR_LOADER_H_ -#define LIBSPIRV_OPT_IR_LOADER_H_ - -#include - -#include "basic_block.h" -#include "instruction.h" -#include "module.h" -#include "spirv-tools/libspirv.hpp" - -namespace spvtools { -namespace ir { - -// Loader class for constructing SPIR-V in-memory IR representation. Methods in -// this class are designed to work with the interface for spvBinaryParse() in -// libspirv.h so that we can leverage the syntax checks implemented behind it. -// -// The user is expected to call SetModuleHeader() to fill in the module's -// header, and then AddInstruction() for each decoded instruction, and finally -// EndModule() to finalize the module. The instructions processed in sequence -// by AddInstruction() should comprise a valid SPIR-V module. -class IrLoader { - public: - // Instantiates a builder to construct the given |module| gradually. - // All internal messages will be communicated to the outside via the given - // message |consumer|. This instance only keeps a reference to the |consumer|, - // so the |consumer| should outlive this instance. - IrLoader(const MessageConsumer& consumer, Module* module); - - // Sets the source name of the module. - void SetSource(const std::string& src) { source_ = src; } - - // Sets the fields in the module's header to the given parameters. - void SetModuleHeader(uint32_t magic, uint32_t version, uint32_t generator, - uint32_t bound, uint32_t reserved) { - module_->SetHeader({magic, version, generator, bound, reserved}); - } - // Adds an instruction to the module. Returns true if no error occurs. This - // method will properly capture and store the data provided in |inst| so that - // |inst| is no longer needed after returning. - bool AddInstruction(const spv_parsed_instruction_t* inst); - // Finalizes the module construction. This must be called after the module - // header has been set and all instructions have been added. This is - // forgiving in the case of a missing terminator instruction on a basic block, - // or a missing OpFunctionEnd. Resolves internal bookkeeping. - void EndModule(); - - private: - // Consumer for communicating messages to outside. - const MessageConsumer& consumer_; - // The module to be built. - Module* module_; - // The source name of the module. - std::string source_; - // The last used instruction index. - uint32_t inst_index_; - // The current Function under construction. - std::unique_ptr function_; - // The current BasicBlock under construction. - std::unique_ptr block_; - // Line related debug instructions accumulated thus far. - std::vector dbg_line_info_; -}; - -} // namespace ir -} // namespace spvtools - -#endif // LIBSPIRV_OPT_IR_LOADER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/iterator.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/iterator.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/iterator.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/iterator.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,231 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_ITERATOR_H_ -#define LIBSPIRV_OPT_ITERATOR_H_ - -#include // for ptrdiff_t -#include -#include -#include -#include - -namespace spvtools { -namespace ir { - -// An ad hoc iterator class for std::vector>. The -// purpose of this iterator class is to provide transparent access to those -// std::unique_ptr managed elements in the vector, behaving like we are using -// std::vector<|ValueType|>. -template -class UptrVectorIterator - : public std::iterator::type> { - public: - using super = std::iterator< - std::random_access_iterator_tag, - typename std::conditional::type>; - - using pointer = typename super::pointer; - using reference = typename super::reference; - using difference_type = typename super::difference_type; - - // Type aliases. We need to apply constness properly if |IsConst| is true. - using Uptr = std::unique_ptr; - using UptrVector = typename std::conditional, - std::vector>::type; - using UnderlyingIterator = - typename std::conditional::type; - - // Creates a new iterator from the given |container| and its raw iterator - // |it|. - UptrVectorIterator(UptrVector* container, const UnderlyingIterator& it) - : container_(container), iterator_(it) {} - UptrVectorIterator(const UptrVectorIterator&) = default; - UptrVectorIterator& operator=(const UptrVectorIterator&) = default; - - inline UptrVectorIterator& operator++(); - inline UptrVectorIterator operator++(int); - inline UptrVectorIterator& operator--(); - inline UptrVectorIterator operator--(int); - - reference operator*() const { return **iterator_; } - pointer operator->() { return (*iterator_).get(); } - reference operator[](ptrdiff_t index) { return **(iterator_ + index); } - - inline bool operator==(const UptrVectorIterator& that) const; - inline bool operator!=(const UptrVectorIterator& that) const; - - inline ptrdiff_t operator-(const UptrVectorIterator& that) const; - inline bool operator<(const UptrVectorIterator& that) const; - - // Inserts the given |value| to the position pointed to by this iterator - // and returns an iterator to the newly iserted |value|. - // If the underlying vector changes capacity, all previous iterators will be - // invalidated. Otherwise, those previous iterators pointing to after the - // insertion point will be invalidated. - template - inline typename std::enable_if::type - InsertBefore(Uptr value); - - // Inserts the given |valueVector| to the position pointed to by this iterator - // and returns an iterator to the first newly inserted value. - // If the underlying vector changes capacity, all previous iterators will be - // invalidated. Otherwise, those previous iterators pointing to after the - // insertion point will be invalidated. - template - inline typename std::enable_if::type - InsertBefore(UptrVector* valueVector); - - // Erases the value at the position pointed to by this iterator - // and returns an iterator to the following value. - // If the underlying vector changes capacity, all previous iterators will be - // invalidated. Otherwise, those previous iterators pointing to after the - // erasure point will be invalidated. - template - inline typename std::enable_if::type - Erase(); - - private: - UptrVector* container_; // The container we are manipulating. - UnderlyingIterator iterator_; // The raw iterator from the container. -}; - -// Handy class for a (begin, end) iterator pair. -template -class IteratorRange { - public: - IteratorRange(IteratorType b, IteratorType e) : begin_(b), end_(e) {} - - IteratorType begin() const { return begin_; } - IteratorType end() const { return end_; } - - bool empty() const { return begin_ == end_; } - size_t size() const { return end_ - begin_; } - - private: - IteratorType begin_; - IteratorType end_; -}; - -// Returns a (begin, end) iterator pair for the given container. -template > -inline IteratorRange make_range( - std::vector>& container) { - return {IteratorType(&container, container.begin()), - IteratorType(&container, container.end())}; -} - -// Returns a const (begin, end) iterator pair for the given container. -template > -inline IteratorRange make_const_range( - const std::vector>& container) { - return {IteratorType(&container, container.cbegin()), - IteratorType(&container, container.cend())}; -} - -template -inline UptrVectorIterator& UptrVectorIterator::operator++() { - ++iterator_; - return *this; -} - -template -inline UptrVectorIterator UptrVectorIterator::operator++(int) { - auto it = *this; - ++(*this); - return it; -} - -template -inline UptrVectorIterator& UptrVectorIterator::operator--() { - --iterator_; - return *this; -} - -template -inline UptrVectorIterator UptrVectorIterator::operator--(int) { - auto it = *this; - --(*this); - return it; -} - -template -inline bool UptrVectorIterator::operator==( - const UptrVectorIterator& that) const { - return container_ == that.container_ && iterator_ == that.iterator_; -} - -template -inline bool UptrVectorIterator::operator!=( - const UptrVectorIterator& that) const { - return !(*this == that); -} - -template -inline ptrdiff_t UptrVectorIterator::operator-( - const UptrVectorIterator& that) const { - assert(container_ == that.container_); - return iterator_ - that.iterator_; -} - -template -inline bool UptrVectorIterator::operator<( - const UptrVectorIterator& that) const { - assert(container_ == that.container_); - return iterator_ < that.iterator_; -} - -template -template -inline - typename std::enable_if>::type - UptrVectorIterator::InsertBefore(Uptr value) { - auto index = iterator_ - container_->begin(); - container_->insert(iterator_, std::move(value)); - return UptrVectorIterator(container_, container_->begin() + index); -} - -template -template -inline - typename std::enable_if>::type - UptrVectorIterator::InsertBefore(UptrVector* values) { - const auto pos = iterator_ - container_->begin(); - const auto origsz = container_->size(); - container_->resize(origsz + values->size()); - std::move_backward(container_->begin() + pos, container_->begin() + origsz, - container_->end()); - std::move(values->begin(), values->end(), container_->begin() + pos); - return UptrVectorIterator(container_, container_->begin() + pos); -} - -template -template -inline - typename std::enable_if>::type - UptrVectorIterator::Erase() { - auto index = iterator_ - container_->begin(); - (void)container_->erase(iterator_); - return UptrVectorIterator(container_, container_->begin() + index); -} - -} // namespace ir -} // namespace spvtools - -#endif // LIBSPIRV_OPT_ITERATOR_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/local_access_chain_convert_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/local_access_chain_convert_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/local_access_chain_convert_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/local_access_chain_convert_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,356 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "local_access_chain_convert_pass.h" - -#include "iterator.h" - -namespace spvtools { -namespace opt { - -namespace { - -const uint32_t kStoreValIdInIdx = 1; -const uint32_t kAccessChainPtrIdInIdx = 0; -const uint32_t kTypePointerTypeIdInIdx = 1; -const uint32_t kConstantValueInIdx = 0; -const uint32_t kTypeIntWidthInIdx = 0; - -} // anonymous namespace - -void LocalAccessChainConvertPass::DeleteIfUseless(ir::Instruction* inst) { - const uint32_t resId = inst->result_id(); - assert(resId != 0); - if (HasOnlyNamesAndDecorates(resId)) { - KillNamesAndDecorates(resId); - def_use_mgr_->KillInst(inst); - } -} - -uint32_t LocalAccessChainConvertPass::GetPointeeTypeId( - const ir::Instruction* ptrInst) const { - const uint32_t ptrTypeId = ptrInst->type_id(); - const ir::Instruction* ptrTypeInst = def_use_mgr_->GetDef(ptrTypeId); - return ptrTypeInst->GetSingleWordInOperand(kTypePointerTypeIdInIdx); -} - -void LocalAccessChainConvertPass::BuildAndAppendInst( - SpvOp opcode, - uint32_t typeId, - uint32_t resultId, - const std::vector& in_opnds, - std::vector>* newInsts) { - std::unique_ptr newInst(new ir::Instruction( - opcode, typeId, resultId, in_opnds)); - def_use_mgr_->AnalyzeInstDefUse(&*newInst); - newInsts->emplace_back(std::move(newInst)); -} - -uint32_t LocalAccessChainConvertPass::BuildAndAppendVarLoad( - const ir::Instruction* ptrInst, - uint32_t* varId, - uint32_t* varPteTypeId, - std::vector>* newInsts) { - const uint32_t ldResultId = TakeNextId(); - *varId = ptrInst->GetSingleWordInOperand(kAccessChainPtrIdInIdx); - const ir::Instruction* varInst = def_use_mgr_->GetDef(*varId); - assert(varInst->opcode() == SpvOpVariable); - *varPteTypeId = GetPointeeTypeId(varInst); - BuildAndAppendInst(SpvOpLoad, *varPteTypeId, ldResultId, - {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {*varId}}}, newInsts); - return ldResultId; -} - -void LocalAccessChainConvertPass::AppendConstantOperands( - const ir::Instruction* ptrInst, - std::vector* in_opnds) { - uint32_t iidIdx = 0; - ptrInst->ForEachInId([&iidIdx, &in_opnds, this](const uint32_t *iid) { - if (iidIdx > 0) { - const ir::Instruction* cInst = def_use_mgr_->GetDef(*iid); - uint32_t val = cInst->GetSingleWordInOperand(kConstantValueInIdx); - in_opnds->push_back( - {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, {val}}); - } - ++iidIdx; - }); -} - -uint32_t LocalAccessChainConvertPass::GenAccessChainLoadReplacement( - const ir::Instruction* ptrInst, - std::vector>* newInsts) { - - // Build and append load of variable in ptrInst - uint32_t varId; - uint32_t varPteTypeId; - const uint32_t ldResultId = BuildAndAppendVarLoad(ptrInst, &varId, - &varPteTypeId, newInsts); - - // Build and append Extract - const uint32_t extResultId = TakeNextId(); - const uint32_t ptrPteTypeId = GetPointeeTypeId(ptrInst); - std::vector ext_in_opnds = - {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {ldResultId}}}; - AppendConstantOperands(ptrInst, &ext_in_opnds); - BuildAndAppendInst(SpvOpCompositeExtract, ptrPteTypeId, extResultId, - ext_in_opnds, newInsts); - return extResultId; -} - -void LocalAccessChainConvertPass::GenAccessChainStoreReplacement( - const ir::Instruction* ptrInst, - uint32_t valId, - std::vector>* newInsts) { - - // Build and append load of variable in ptrInst - uint32_t varId; - uint32_t varPteTypeId; - const uint32_t ldResultId = BuildAndAppendVarLoad(ptrInst, &varId, - &varPteTypeId, newInsts); - - // Build and append Insert - const uint32_t insResultId = TakeNextId(); - std::vector ins_in_opnds = - {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {valId}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {ldResultId}}}; - AppendConstantOperands(ptrInst, &ins_in_opnds); - BuildAndAppendInst( - SpvOpCompositeInsert, varPteTypeId, insResultId, ins_in_opnds, newInsts); - - // Build and append Store - BuildAndAppendInst(SpvOpStore, 0, 0, - {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {varId}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {insResultId}}}, - newInsts); -} - -bool LocalAccessChainConvertPass::IsConstantIndexAccessChain( - const ir::Instruction* acp) const { - uint32_t inIdx = 0; - uint32_t nonConstCnt = 0; - acp->ForEachInId([&inIdx, &nonConstCnt, this](const uint32_t* tid) { - if (inIdx > 0) { - ir::Instruction* opInst = def_use_mgr_->GetDef(*tid); - if (opInst->opcode() != SpvOpConstant) ++nonConstCnt; - } - ++inIdx; - }); - return nonConstCnt == 0; -} - -bool LocalAccessChainConvertPass::HasOnlySupportedRefs(uint32_t ptrId) { - if (supported_ref_ptrs_.find(ptrId) != supported_ref_ptrs_.end()) - return true; - analysis::UseList* uses = def_use_mgr_->GetUses(ptrId); - assert(uses != nullptr); - for (auto u : *uses) { - SpvOp op = u.inst->opcode(); - if (IsNonPtrAccessChain(op) || op == SpvOpCopyObject) { - if (!HasOnlySupportedRefs(u.inst->result_id())) return false; - } else if (op != SpvOpStore && op != SpvOpLoad && op != SpvOpName && - !IsNonTypeDecorate(op)) - return false; - } - supported_ref_ptrs_.insert(ptrId); - return true; -} - -void LocalAccessChainConvertPass::FindTargetVars(ir::Function* func) { - for (auto bi = func->begin(); bi != func->end(); ++bi) { - for (auto ii = bi->begin(); ii != bi->end(); ++ii) { - switch (ii->opcode()) { - case SpvOpStore: - case SpvOpLoad: { - uint32_t varId; - ir::Instruction* ptrInst = GetPtr(&*ii, &varId); - if (!IsTargetVar(varId)) - break; - const SpvOp op = ptrInst->opcode(); - // Rule out variables with non-supported refs eg function calls - if (!HasOnlySupportedRefs(varId)) { - seen_non_target_vars_.insert(varId); - seen_target_vars_.erase(varId); - break; - } - // Rule out variables with nested access chains - // TODO(): Convert nested access chains - if (IsNonPtrAccessChain(op) && - ptrInst->GetSingleWordInOperand(kAccessChainPtrIdInIdx) != varId) { - seen_non_target_vars_.insert(varId); - seen_target_vars_.erase(varId); - break; - } - // Rule out variables accessed with non-constant indices - if (!IsConstantIndexAccessChain(ptrInst)) { - seen_non_target_vars_.insert(varId); - seen_target_vars_.erase(varId); - break; - } - } break; - default: - break; - } - } - } -} - -bool LocalAccessChainConvertPass::ConvertLocalAccessChains(ir::Function* func) { - FindTargetVars(func); - // Replace access chains of all targeted variables with equivalent - // extract and insert sequences - bool modified = false; - for (auto bi = func->begin(); bi != func->end(); ++bi) { - for (auto ii = bi->begin(); ii != bi->end(); ++ii) { - switch (ii->opcode()) { - case SpvOpLoad: { - uint32_t varId; - ir::Instruction* ptrInst = GetPtr(&*ii, &varId); - if (!IsNonPtrAccessChain(ptrInst->opcode())) - break; - if (!IsTargetVar(varId)) - break; - std::vector> newInsts; - uint32_t replId = - GenAccessChainLoadReplacement(ptrInst, &newInsts); - ReplaceAndDeleteLoad(&*ii, replId); - ++ii; - ii = ii.InsertBefore(std::move(newInsts)); - ++ii; - modified = true; - } break; - case SpvOpStore: { - uint32_t varId; - ir::Instruction* ptrInst = GetPtr(&*ii, &varId); - if (!IsNonPtrAccessChain(ptrInst->opcode())) - break; - if (!IsTargetVar(varId)) - break; - std::vector> newInsts; - uint32_t valId = ii->GetSingleWordInOperand(kStoreValIdInIdx); - GenAccessChainStoreReplacement(ptrInst, valId, &newInsts); - def_use_mgr_->KillInst(&*ii); - DeleteIfUseless(ptrInst); - ++ii; - ii = ii.InsertBefore(std::move(newInsts)); - ++ii; - ++ii; - modified = true; - } break; - default: - break; - } - } - } - return modified; -} - -void LocalAccessChainConvertPass::Initialize(ir::Module* module) { - - module_ = module; - - // Initialize Target Variable Caches - seen_target_vars_.clear(); - seen_non_target_vars_.clear(); - - // Initialize collections - supported_ref_ptrs_.clear(); - - def_use_mgr_.reset(new analysis::DefUseManager(consumer(), module_)); - - // Initialize next unused Id. - InitNextId(); - - // Initialize extension whitelist - InitExtensions(); -}; - -bool LocalAccessChainConvertPass::AllExtensionsSupported() const { - // If any extension not in whitelist, return false - for (auto& ei : module_->extensions()) { - const char* extName = reinterpret_cast( - &ei.GetInOperand(0).words[0]); - if (extensions_whitelist_.find(extName) == extensions_whitelist_.end()) - return false; - } - return true; -} - -Pass::Status LocalAccessChainConvertPass::ProcessImpl() { - // If non-32-bit integer type in module, terminate processing - // TODO(): Handle non-32-bit integer constants in access chains - for (const ir::Instruction& inst : module_->types_values()) - if (inst.opcode() == SpvOpTypeInt && - inst.GetSingleWordInOperand(kTypeIntWidthInIdx) != 32) - return Status::SuccessWithoutChange; - // Do not process if module contains OpGroupDecorate. Additional - // support required in KillNamesAndDecorates(). - // TODO(greg-lunarg): Add support for OpGroupDecorate - for (auto& ai : module_->annotations()) - if (ai.opcode() == SpvOpGroupDecorate) - return Status::SuccessWithoutChange; - // Do not process if any disallowed extensions are enabled - if (!AllExtensionsSupported()) - return Status::SuccessWithoutChange; - // Collect all named and decorated ids - FindNamedOrDecoratedIds(); - // Process all entry point functions. - ProcessFunction pfn = [this](ir::Function* fp) { - return ConvertLocalAccessChains(fp); - }; - bool modified = ProcessEntryPointCallTree(pfn, module_); - FinalizeNextId(); - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -LocalAccessChainConvertPass::LocalAccessChainConvertPass() {} - -Pass::Status LocalAccessChainConvertPass::Process(ir::Module* module) { - Initialize(module); - return ProcessImpl(); -} - -void LocalAccessChainConvertPass::InitExtensions() { - extensions_whitelist_.clear(); - extensions_whitelist_.insert({ - "SPV_AMD_shader_explicit_vertex_parameter", - "SPV_AMD_shader_trinary_minmax", - "SPV_AMD_gcn_shader", - "SPV_KHR_shader_ballot", - "SPV_AMD_shader_ballot", - "SPV_AMD_gpu_shader_half_float", - "SPV_KHR_shader_draw_parameters", - "SPV_KHR_subgroup_vote", - "SPV_KHR_16bit_storage", - "SPV_KHR_device_group", - "SPV_KHR_multiview", - "SPV_NVX_multiview_per_view_attributes", - "SPV_NV_viewport_array2", - "SPV_NV_stereo_view_rendering", - "SPV_NV_sample_mask_override_coverage", - "SPV_NV_geometry_shader_passthrough", - "SPV_AMD_texture_gather_bias_lod", - "SPV_KHR_storage_buffer_storage_class", - // SPV_KHR_variable_pointers - // Currently do not support extended pointer expressions - "SPV_AMD_gpu_shader_int16", - "SPV_KHR_post_depth_coverage", - "SPV_KHR_shader_atomic_counter_ops", - }); -} - -} // namespace opt -} // namespace spvtools - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/local_access_chain_convert_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/local_access_chain_convert_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/local_access_chain_convert_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/local_access_chain_convert_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,126 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#ifndef LIBSPIRV_OPT_LOCAL_ACCESS_CHAIN_CONVERT_PASS_H_ -#define LIBSPIRV_OPT_LOCAL_ACCESS_CHAIN_CONVERT_PASS_H_ - - -#include -#include -#include -#include -#include -#include - -#include "basic_block.h" -#include "def_use_manager.h" -#include "module.h" -#include "mem_pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class LocalAccessChainConvertPass : public MemPass { - public: - LocalAccessChainConvertPass(); - const char* name() const override { return "convert-local-access-chains"; } - Status Process(ir::Module*) override; - - using ProcessFunction = std::function; - - private: - // Return true if all refs through |ptrId| are only loads or stores and - // cache ptrId in supported_ref_ptrs_. - bool HasOnlySupportedRefs(uint32_t ptrId); - - // Search |func| and cache function scope variables of target type that are - // not accessed with non-constant-index access chains. Also cache non-target - // variables. - void FindTargetVars(ir::Function* func); - - // Delete |inst| if it has no uses. Assumes |inst| has a non-zero resultId. - void DeleteIfUseless(ir::Instruction* inst); - - // Return type id for |ptrInst|'s pointee - uint32_t GetPointeeTypeId(const ir::Instruction* ptrInst) const; - - // Build instruction from |opcode|, |typeId|, |resultId|, and |in_opnds|. - // Append to |newInsts|. - void BuildAndAppendInst(SpvOp opcode, uint32_t typeId, uint32_t resultId, - const std::vector& in_opnds, - std::vector>* newInsts); - - // Build load of variable in |ptrInst| and append to |newInsts|. - // Return var in |varId| and its pointee type in |varPteTypeId|. - uint32_t BuildAndAppendVarLoad(const ir::Instruction* ptrInst, - uint32_t* varId, uint32_t* varPteTypeId, - std::vector>* newInsts); - - // Append literal integer operands to |in_opnds| corresponding to constant - // integer operands from access chain |ptrInst|. Assumes all indices in - // access chains are OpConstant. - void AppendConstantOperands( const ir::Instruction* ptrInst, - std::vector* in_opnds); - - // Create a load/insert/store equivalent to a store of - // |valId| through (constant index) access chaing |ptrInst|. - // Append to |newInsts|. - void GenAccessChainStoreReplacement(const ir::Instruction* ptrInst, - uint32_t valId, - std::vector>* newInsts); - - // For the (constant index) access chain |ptrInst|, create an - // equivalent load and extract. Append to |newInsts|. - uint32_t GenAccessChainLoadReplacement(const ir::Instruction* ptrInst, - std::vector>* newInsts); - - // Return true if all indices of access chain |acp| are OpConstant integers - bool IsConstantIndexAccessChain(const ir::Instruction* acp) const; - - // Identify all function scope variables of target type which are - // accessed only with loads, stores and access chains with constant - // indices. Convert all loads and stores of such variables into equivalent - // loads, stores, extracts and inserts. This unifies access to these - // variables to a single mode and simplifies analysis and optimization. - // See IsTargetType() for targeted types. - // - // Nested access chains and pointer access chains are not currently - // converted. - bool ConvertLocalAccessChains(ir::Function* func); - - // Initialize extensions whitelist - void InitExtensions(); - - // Return true if all extensions in this module are allowed by this pass. - bool AllExtensionsSupported() const; - - void Initialize(ir::Module* module); - Pass::Status ProcessImpl(); - - // Variables with only supported references, ie. loads and stores using - // variable directly or through non-ptr access chains. - std::unordered_set supported_ref_ptrs_; - - // Extensions supported by this pass. - std::unordered_set extensions_whitelist_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_LOCAL_ACCESS_CHAIN_CONVERT_PASS_H_ - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/local_single_block_elim_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/local_single_block_elim_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/local_single_block_elim_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/local_single_block_elim_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,234 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "local_single_block_elim_pass.h" - -#include "iterator.h" - -namespace spvtools { -namespace opt { - -namespace { - -const uint32_t kStoreValIdInIdx = 1; - -} // anonymous namespace - -bool LocalSingleBlockLoadStoreElimPass::HasOnlySupportedRefs(uint32_t ptrId) { - if (supported_ref_ptrs_.find(ptrId) != supported_ref_ptrs_.end()) - return true; - analysis::UseList* uses = def_use_mgr_->GetUses(ptrId); - assert(uses != nullptr); - for (auto u : *uses) { - SpvOp op = u.inst->opcode(); - if (IsNonPtrAccessChain(op) || op == SpvOpCopyObject) { - if (!HasOnlySupportedRefs(u.inst->result_id())) return false; - } else if (op != SpvOpStore && op != SpvOpLoad && op != SpvOpName && - !IsNonTypeDecorate(op)) - return false; - } - supported_ref_ptrs_.insert(ptrId); - return true; -} - -bool LocalSingleBlockLoadStoreElimPass::LocalSingleBlockLoadStoreElim( - ir::Function* func) { - // Perform local store/load and load/load elimination on each block - bool modified = false; - for (auto bi = func->begin(); bi != func->end(); ++bi) { - var2store_.clear(); - var2load_.clear(); - pinned_vars_.clear(); - for (auto ii = bi->begin(); ii != bi->end(); ++ii) { - switch (ii->opcode()) { - case SpvOpStore: { - // Verify store variable is target type - uint32_t varId; - ir::Instruction* ptrInst = GetPtr(&*ii, &varId); - if (!IsTargetVar(varId)) - continue; - if (!HasOnlySupportedRefs(varId)) - continue; - // Register the store - if (ptrInst->opcode() == SpvOpVariable) { - // if not pinned, look for WAW - if (pinned_vars_.find(varId) == pinned_vars_.end()) { - auto si = var2store_.find(varId); - if (si != var2store_.end()) { - def_use_mgr_->KillInst(si->second); - } - } - var2store_[varId] = &*ii; - } - else { - assert(IsNonPtrAccessChain(ptrInst->opcode())); - var2store_.erase(varId); - } - pinned_vars_.erase(varId); - var2load_.erase(varId); - } break; - case SpvOpLoad: { - // Verify store variable is target type - uint32_t varId; - ir::Instruction* ptrInst = GetPtr(&*ii, &varId); - if (!IsTargetVar(varId)) - continue; - if (!HasOnlySupportedRefs(varId)) - continue; - // Look for previous store or load - uint32_t replId = 0; - if (ptrInst->opcode() == SpvOpVariable) { - auto si = var2store_.find(varId); - if (si != var2store_.end()) { - replId = si->second->GetSingleWordInOperand(kStoreValIdInIdx); - } - else { - auto li = var2load_.find(varId); - if (li != var2load_.end()) { - replId = li->second->result_id(); - } - } - } - if (replId != 0) { - // replace load's result id and delete load - ReplaceAndDeleteLoad(&*ii, replId); - modified = true; - } - else { - if (ptrInst->opcode() == SpvOpVariable) - var2load_[varId] = &*ii; // register load - pinned_vars_.insert(varId); - } - } break; - case SpvOpFunctionCall: { - // Conservatively assume all locals are redefined for now. - // TODO(): Handle more optimally - var2store_.clear(); - var2load_.clear(); - pinned_vars_.clear(); - } break; - default: - break; - } - } - // Go back and delete useless stores in block - // TODO(greg-lunarg): Consider moving DCE into separate pass - for (auto ii = bi->begin(); ii != bi->end(); ++ii) { - if (ii->opcode() != SpvOpStore) - continue; - if (IsLiveStore(&*ii)) - continue; - DCEInst(&*ii); - } - } - return modified; -} - -void LocalSingleBlockLoadStoreElimPass::Initialize(ir::Module* module) { - - module_ = module; - - // Initialize Target Type Caches - seen_target_vars_.clear(); - seen_non_target_vars_.clear(); - - // Clear collections - supported_ref_ptrs_.clear(); - - // TODO(greg-lunarg): Reuse def/use from previous passes - def_use_mgr_.reset(new analysis::DefUseManager(consumer(), module_)); - - // Start new ids with next availablein module - InitNextId(); - - // Initialize extensions whitelist - InitExtensions(); -}; - -bool LocalSingleBlockLoadStoreElimPass::AllExtensionsSupported() const { - // If any extension not in whitelist, return false - for (auto& ei : module_->extensions()) { - const char* extName = reinterpret_cast( - &ei.GetInOperand(0).words[0]); - if (extensions_whitelist_.find(extName) == extensions_whitelist_.end()) - return false; - } - return true; -} - -Pass::Status LocalSingleBlockLoadStoreElimPass::ProcessImpl() { - // Assumes logical addressing only - if (module_->HasCapability(SpvCapabilityAddresses)) - return Status::SuccessWithoutChange; - // Do not process if module contains OpGroupDecorate. Additional - // support required in KillNamesAndDecorates(). - // TODO(greg-lunarg): Add support for OpGroupDecorate - for (auto& ai : module_->annotations()) - if (ai.opcode() == SpvOpGroupDecorate) - return Status::SuccessWithoutChange; - // If any extensions in the module are not explicitly supported, - // return unmodified. - if (!AllExtensionsSupported()) - return Status::SuccessWithoutChange; - // Collect all named and decorated ids - FindNamedOrDecoratedIds(); - // Process all entry point functions - ProcessFunction pfn = [this](ir::Function* fp) { - return LocalSingleBlockLoadStoreElim(fp); - }; - bool modified = ProcessEntryPointCallTree(pfn, module_); - FinalizeNextId(); - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -LocalSingleBlockLoadStoreElimPass::LocalSingleBlockLoadStoreElimPass() {} - -Pass::Status LocalSingleBlockLoadStoreElimPass::Process(ir::Module* module) { - Initialize(module); - return ProcessImpl(); -} - -void LocalSingleBlockLoadStoreElimPass::InitExtensions() { - extensions_whitelist_.clear(); - extensions_whitelist_.insert({ - "SPV_AMD_shader_explicit_vertex_parameter", - "SPV_AMD_shader_trinary_minmax", - "SPV_AMD_gcn_shader", - "SPV_KHR_shader_ballot", - "SPV_AMD_shader_ballot", - "SPV_AMD_gpu_shader_half_float", - "SPV_KHR_shader_draw_parameters", - "SPV_KHR_subgroup_vote", - "SPV_KHR_16bit_storage", - "SPV_KHR_device_group", - "SPV_KHR_multiview", - "SPV_NVX_multiview_per_view_attributes", - "SPV_NV_viewport_array2", - "SPV_NV_stereo_view_rendering", - "SPV_NV_sample_mask_override_coverage", - "SPV_NV_geometry_shader_passthrough", - "SPV_AMD_texture_gather_bias_lod", - "SPV_KHR_storage_buffer_storage_class", - // SPV_KHR_variable_pointers - // Currently do not support extended pointer expressions - "SPV_AMD_gpu_shader_int16", - "SPV_KHR_post_depth_coverage", - "SPV_KHR_shader_atomic_counter_ops", - }); -} - -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/local_single_block_elim_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/local_single_block_elim_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/local_single_block_elim_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/local_single_block_elim_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,98 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#ifndef LIBSPIRV_OPT_LOCAL_SINGLE_BLOCK_ELIM_PASS_H_ -#define LIBSPIRV_OPT_LOCAL_SINGLE_BLOCK_ELIM_PASS_H_ - - -#include -#include -#include -#include -#include -#include - -#include "basic_block.h" -#include "def_use_manager.h" -#include "module.h" -#include "mem_pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class LocalSingleBlockLoadStoreElimPass : public MemPass { - public: - LocalSingleBlockLoadStoreElimPass(); - const char* name() const override { return "eliminate-local-single-block"; } - Status Process(ir::Module*) override; - - private: - // Return true if all uses of |varId| are only through supported reference - // operations ie. loads and store. Also cache in supported_ref_ptrs_; - bool HasOnlySupportedRefs(uint32_t varId); - - // On all entry point functions, within each basic block, eliminate - // loads and stores to function variables where possible. For - // loads, if previous load or store to same variable, replace - // load id with previous id and delete load. Finally, check if - // remaining stores are useless, and delete store and variable - // where possible. Assumes logical addressing. - bool LocalSingleBlockLoadStoreElim(ir::Function* func); - - // Initialize extensions whitelist - void InitExtensions(); - - // Return true if all extensions in this module are supported by this pass. - bool AllExtensionsSupported() const; - - void Initialize(ir::Module* module); - Pass::Status ProcessImpl(); - - // Map from function scope variable to a store of that variable in the - // current block whose value is currently valid. This map is cleared - // at the start of each block and incrementally updated as the block - // is scanned. The stores are candidates for elimination. The map is - // conservatively cleared when a function call is encountered. - std::unordered_map var2store_; - - // Map from function scope variable to a load of that variable in the - // current block whose value is currently valid. This map is cleared - // at the start of each block and incrementally updated as the block - // is scanned. The stores are candidates for elimination. The map is - // conservatively cleared when a function call is encountered. - std::unordered_map var2load_; - - // Set of variables whose most recent store in the current block cannot be - // deleted, for example, if there is a load of the variable which is - // dependent on the store and is not replaced and deleted by this pass, - // for example, a load through an access chain. A variable is removed - // from this set each time a new store of that variable is encountered. - std::unordered_set pinned_vars_; - - // Extensions supported by this pass. - std::unordered_set extensions_whitelist_; - - // Variables that are only referenced by supported operations for this - // pass ie. loads and stores. - std::unordered_set supported_ref_ptrs_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_LOCAL_SINGLE_BLOCK_ELIM_PASS_H_ - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/local_single_store_elim_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/local_single_store_elim_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/local_single_store_elim_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/local_single_store_elim_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,343 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "local_single_store_elim_pass.h" - -#include "cfa.h" -#include "iterator.h" -#include "spirv/1.0/GLSL.std.450.h" - -// Universal Limit of ResultID + 1 -static const int kInvalidId = 0x400000; - -namespace spvtools { -namespace opt { - -namespace { - -const uint32_t kStoreValIdInIdx = 1; - -} // anonymous namespace - -bool LocalSingleStoreElimPass::HasOnlySupportedRefs(uint32_t ptrId) { - if (supported_ref_ptrs_.find(ptrId) != supported_ref_ptrs_.end()) - return true; - analysis::UseList* uses = def_use_mgr_->GetUses(ptrId); - assert(uses != nullptr); - for (auto u : *uses) { - SpvOp op = u.inst->opcode(); - if (IsNonPtrAccessChain(op) || op == SpvOpCopyObject) { - if (!HasOnlySupportedRefs(u.inst->result_id())) return false; - } else if (op != SpvOpStore && op != SpvOpLoad && op != SpvOpName && - !IsNonTypeDecorate(op)) - return false; - } - supported_ref_ptrs_.insert(ptrId); - return true; -} - -void LocalSingleStoreElimPass::SingleStoreAnalyze(ir::Function* func) { - ssa_var2store_.clear(); - non_ssa_vars_.clear(); - store2idx_.clear(); - store2blk_.clear(); - for (auto bi = func->begin(); bi != func->end(); ++bi) { - uint32_t instIdx = 0; - for (auto ii = bi->begin(); ii != bi->end(); ++ii, ++instIdx) { - switch (ii->opcode()) { - case SpvOpStore: { - // Verify store variable is target type - uint32_t varId; - ir::Instruction* ptrInst = GetPtr(&*ii, &varId); - if (non_ssa_vars_.find(varId) != non_ssa_vars_.end()) - continue; - if (ptrInst->opcode() != SpvOpVariable) { - non_ssa_vars_.insert(varId); - ssa_var2store_.erase(varId); - continue; - } - // Verify target type and function storage class - if (!IsTargetVar(varId)) { - non_ssa_vars_.insert(varId); - continue; - } - if (!HasOnlySupportedRefs(varId)) { - non_ssa_vars_.insert(varId); - continue; - } - // Ignore variables with multiple stores - if (ssa_var2store_.find(varId) != ssa_var2store_.end()) { - non_ssa_vars_.insert(varId); - ssa_var2store_.erase(varId); - continue; - } - // Remember pointer to variable's store and it's - // ordinal position in block - ssa_var2store_[varId] = &*ii; - store2idx_[&*ii] = instIdx; - store2blk_[&*ii] = &*bi; - } break; - default: - break; - } // switch - } - } -} - -LocalSingleStoreElimPass::GetBlocksFunction -LocalSingleStoreElimPass::AugmentedCFGSuccessorsFunction() const { - return [this](const ir::BasicBlock* block) { - auto asmi = augmented_successors_map_.find(block); - if (asmi != augmented_successors_map_.end()) - return &(*asmi).second; - auto smi = successors_map_.find(block); - return &(*smi).second; - }; -} - -LocalSingleStoreElimPass::GetBlocksFunction -LocalSingleStoreElimPass::AugmentedCFGPredecessorsFunction() const { - return [this](const ir::BasicBlock* block) { - auto apmi = augmented_predecessors_map_.find(block); - if (apmi != augmented_predecessors_map_.end()) - return &(*apmi).second; - auto pmi = predecessors_map_.find(block); - return &(*pmi).second; - }; -} - -void LocalSingleStoreElimPass::CalculateImmediateDominators( - ir::Function* func) { - // Compute CFG - vector ordered_blocks; - predecessors_map_.clear(); - successors_map_.clear(); - for (auto& blk : *func) { - ordered_blocks.push_back(&blk); - blk.ForEachSuccessorLabel([&blk, &ordered_blocks, this](uint32_t sbid) { - successors_map_[&blk].push_back(label2block_[sbid]); - predecessors_map_[label2block_[sbid]].push_back(&blk); - }); - } - // Compute Augmented CFG - augmented_successors_map_.clear(); - augmented_predecessors_map_.clear(); - successors_map_[&pseudo_exit_block_] = {}; - predecessors_map_[&pseudo_entry_block_] = {}; - auto succ_func = [this](const ir::BasicBlock* b) - { return &successors_map_[b]; }; - auto pred_func = [this](const ir::BasicBlock* b) - { return &predecessors_map_[b]; }; - CFA::ComputeAugmentedCFG( - ordered_blocks, - &pseudo_entry_block_, - &pseudo_exit_block_, - &augmented_successors_map_, - &augmented_predecessors_map_, - succ_func, - pred_func); - // Compute Dominators - vector postorder; - auto ignore_block = [](cbb_ptr) {}; - auto ignore_edge = [](cbb_ptr, cbb_ptr) {}; - spvtools::CFA::DepthFirstTraversal( - ordered_blocks[0], AugmentedCFGSuccessorsFunction(), - ignore_block, [&](cbb_ptr b) { postorder.push_back(b); }, - ignore_edge); - auto edges = spvtools::CFA::CalculateDominators( - postorder, AugmentedCFGPredecessorsFunction()); - idom_.clear(); - for (auto edge : edges) - idom_[edge.first] = edge.second; -} - -bool LocalSingleStoreElimPass::Dominates( - ir::BasicBlock* blk0, uint32_t idx0, - ir::BasicBlock* blk1, uint32_t idx1) { - if (blk0 == blk1) - return idx0 <= idx1; - ir::BasicBlock* b = blk1; - while (idom_[b] != b) { - b = idom_[b]; - if (b == blk0) - return true; - } - return false; -} - -bool LocalSingleStoreElimPass::SingleStoreProcess(ir::Function* func) { - CalculateImmediateDominators(func); - bool modified = false; - for (auto bi = func->begin(); bi != func->end(); ++bi) { - uint32_t instIdx = 0; - for (auto ii = bi->begin(); ii != bi->end(); ++ii, ++instIdx) { - if (ii->opcode() != SpvOpLoad) - continue; - uint32_t varId; - ir::Instruction* ptrInst = GetPtr(&*ii, &varId); - // Skip access chain loads - if (ptrInst->opcode() != SpvOpVariable) - continue; - const auto vsi = ssa_var2store_.find(varId); - if (vsi == ssa_var2store_.end()) - continue; - if (non_ssa_vars_.find(varId) != non_ssa_vars_.end()) - continue; - // store must dominate load - if (!Dominates(store2blk_[vsi->second], store2idx_[vsi->second], &*bi, instIdx)) - continue; - // Use store value as replacement id - uint32_t replId = vsi->second->GetSingleWordInOperand(kStoreValIdInIdx); - // replace all instances of the load's id with the SSA value's id - ReplaceAndDeleteLoad(&*ii, replId); - modified = true; - } - } - return modified; -} - -bool LocalSingleStoreElimPass::SingleStoreDCE() { - bool modified = false; - for (auto v : ssa_var2store_) { - // check that it hasn't already been DCE'd - if (v.second->opcode() != SpvOpStore) - continue; - if (non_ssa_vars_.find(v.first) != non_ssa_vars_.end()) - continue; - if (!IsLiveStore(v.second)) { - DCEInst(v.second); - modified = true; - } - } - return modified; -} - -bool LocalSingleStoreElimPass::LocalSingleStoreElim(ir::Function* func) { - bool modified = false; - SingleStoreAnalyze(func); - if (ssa_var2store_.empty()) - return false; - modified |= SingleStoreProcess(func); - modified |= SingleStoreDCE(); - return modified; -} - -void LocalSingleStoreElimPass::Initialize(ir::Module* module) { - module_ = module; - - // Initialize function and block maps - label2block_.clear(); - for (auto& fn : *module_) { - for (auto& blk : fn) { - uint32_t bid = blk.id(); - label2block_[bid] = &blk; - } - } - - // Initialize Target Type Caches - seen_target_vars_.clear(); - seen_non_target_vars_.clear(); - - // Initialize Supported Ref Pointer Cache - supported_ref_ptrs_.clear(); - - // TODO: Reuse def/use (and other state) from previous passes - def_use_mgr_.reset(new analysis::DefUseManager(consumer(), module_)); - - // Initialize next unused Id - InitNextId(); - - // Initialize extension whitelist - InitExtensions(); -}; - -bool LocalSingleStoreElimPass::AllExtensionsSupported() const { - // If any extension not in whitelist, return false - for (auto& ei : module_->extensions()) { - const char* extName = reinterpret_cast( - &ei.GetInOperand(0).words[0]); - if (extensions_whitelist_.find(extName) == extensions_whitelist_.end()) - return false; - } - return true; -} - -Pass::Status LocalSingleStoreElimPass::ProcessImpl() { - // Assumes logical addressing only - if (module_->HasCapability(SpvCapabilityAddresses)) - return Status::SuccessWithoutChange; - // Do not process if module contains OpGroupDecorate. Additional - // support required in KillNamesAndDecorates(). - // TODO(greg-lunarg): Add support for OpGroupDecorate - for (auto& ai : module_->annotations()) - if (ai.opcode() == SpvOpGroupDecorate) - return Status::SuccessWithoutChange; - // Do not process if any disallowed extensions are enabled - if (!AllExtensionsSupported()) - return Status::SuccessWithoutChange; - // Collect all named and decorated ids - FindNamedOrDecoratedIds(); - // Process all entry point functions - ProcessFunction pfn = [this](ir::Function* fp) { - return LocalSingleStoreElim(fp); - }; - bool modified = ProcessEntryPointCallTree(pfn, module_); - FinalizeNextId(); - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -LocalSingleStoreElimPass::LocalSingleStoreElimPass() - : pseudo_entry_block_(std::unique_ptr( - new ir::Instruction(SpvOpLabel, 0, 0, {}))), - pseudo_exit_block_(std::unique_ptr( - new ir::Instruction(SpvOpLabel, 0, kInvalidId, {}))) {} - -Pass::Status LocalSingleStoreElimPass::Process(ir::Module* module) { - Initialize(module); - return ProcessImpl(); -} - -void LocalSingleStoreElimPass::InitExtensions() { - extensions_whitelist_.clear(); - extensions_whitelist_.insert({ - "SPV_AMD_shader_explicit_vertex_parameter", - "SPV_AMD_shader_trinary_minmax", - "SPV_AMD_gcn_shader", - "SPV_KHR_shader_ballot", - "SPV_AMD_shader_ballot", - "SPV_AMD_gpu_shader_half_float", - "SPV_KHR_shader_draw_parameters", - "SPV_KHR_subgroup_vote", - "SPV_KHR_16bit_storage", - "SPV_KHR_device_group", - "SPV_KHR_multiview", - "SPV_NVX_multiview_per_view_attributes", - "SPV_NV_viewport_array2", - "SPV_NV_stereo_view_rendering", - "SPV_NV_sample_mask_override_coverage", - "SPV_NV_geometry_shader_passthrough", - "SPV_AMD_texture_gather_bias_lod", - "SPV_KHR_storage_buffer_storage_class", - // SPV_KHR_variable_pointers - // Currently do not support extended pointer expressions - "SPV_AMD_gpu_shader_int16", - "SPV_KHR_post_depth_coverage", - "SPV_KHR_shader_atomic_counter_ops", - }); -} - -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/local_single_store_elim_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/local_single_store_elim_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/local_single_store_elim_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/local_single_store_elim_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,155 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#ifndef LIBSPIRV_OPT_LOCAL_SINGLE_STORE_ELIM_PASS_H_ -#define LIBSPIRV_OPT_LOCAL_SINGLE_STORE_ELIM_PASS_H_ - - -#include -#include -#include -#include -#include -#include - -#include "basic_block.h" -#include "def_use_manager.h" -#include "module.h" -#include "mem_pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class LocalSingleStoreElimPass : public MemPass { - using cbb_ptr = const ir::BasicBlock*; - - public: - LocalSingleStoreElimPass(); - const char* name() const override { return "eliminate-local-single-store"; } - Status Process(ir::Module*) override; - - private: - // Return true if all refs through |ptrId| are only loads or stores and - // cache ptrId in supported_ref_ptrs_. - bool HasOnlySupportedRefs(uint32_t ptrId); - - // Find all function scope variables in |func| that are stored to - // only once (SSA) and map to their stored value id. Only analyze - // variables of scalar, vector, matrix types and struct and array - // types comprising only these types. Currently this analysis is - // is not done in the presence of function calls. TODO(): Allow - // analysis in the presence of function calls. - void SingleStoreAnalyze(ir::Function* func); - - using GetBlocksFunction = - std::function*(const ir::BasicBlock*)>; - - /// Returns the block successors function for the augmented CFG. - GetBlocksFunction AugmentedCFGSuccessorsFunction() const; - - /// Returns the block predecessors function for the augmented CFG. - GetBlocksFunction AugmentedCFGPredecessorsFunction() const; - - // Calculate immediate dominators for |func|'s CFG. Leaves result - // in idom_. Entries for augmented CFG (pseudo blocks) are not created. - void CalculateImmediateDominators(ir::Function* func); - - // Return true if instruction in |blk0| at ordinal position |idx0| - // dominates instruction in |blk1| at position |idx1|. - bool Dominates(ir::BasicBlock* blk0, uint32_t idx0, - ir::BasicBlock* blk1, uint32_t idx1); - - // For each load of an SSA variable in |func|, replace all uses of - // the load with the value stored if the store dominates the load. - // Assumes that SingleStoreAnalyze() has just been run. Return true - // if any instructions are modified. - bool SingleStoreProcess(ir::Function* func); - - // Remove all stores to useless SSA variables. Remove useless - // access chains and variables as well. Assumes SingleStoreAnalyze - // and SingleStoreProcess has been run. - bool SingleStoreDCE(); - - // Do "single-store" optimization of function variables defined only - // with a single non-access-chain store in |func|. Replace all their - // non-access-chain loads with the value that is stored and eliminate - // any resulting dead code. - bool LocalSingleStoreElim(ir::Function* func); - - // Initialize extensions whitelist - void InitExtensions(); - - // Return true if all extensions in this module are allowed by this pass. - bool AllExtensionsSupported() const; - - void Initialize(ir::Module* module); - Pass::Status ProcessImpl(); - - // Map from block's label id to block - std::unordered_map label2block_; - - // Map from SSA Variable to its single store - std::unordered_map ssa_var2store_; - - // Map from store to its ordinal position in its block. - std::unordered_map store2idx_; - - // Map from store to its block. - std::unordered_map store2blk_; - - // Set of non-SSA Variables - std::unordered_set non_ssa_vars_; - - // Variables with only supported references, ie. loads and stores using - // variable directly or through non-ptr access chains. - std::unordered_set supported_ref_ptrs_; - - // Augmented CFG Entry Block - ir::BasicBlock pseudo_entry_block_; - - // Augmented CFG Exit Block - ir::BasicBlock pseudo_exit_block_; - - // CFG Predecessors - std::unordered_map> - predecessors_map_; - - // CFG Successors - std::unordered_map> - successors_map_; - - // CFG Augmented Predecessors - std::unordered_map> - augmented_predecessors_map_; - - // CFG Augmented Successors - std::unordered_map> - augmented_successors_map_; - - // Immediate Dominator Map - // If block has no idom it points to itself. - std::unordered_map idom_; - - // Extensions supported by this pass. - std::unordered_set extensions_whitelist_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_LOCAL_SINGLE_STORE_ELIM_PASS_H_ - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/local_ssa_elim_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/local_ssa_elim_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/local_ssa_elim_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/local_ssa_elim_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,608 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "local_ssa_elim_pass.h" - -#include "iterator.h" -#include "cfa.h" - -namespace spvtools { -namespace opt { - -namespace { - -const uint32_t kStoreValIdInIdx = 1; -const uint32_t kTypePointerTypeIdInIdx = 1; -const uint32_t kSelectionMergeMergeBlockIdInIdx = 0; -const uint32_t kLoopMergeMergeBlockIdInIdx = 0; -const uint32_t kLoopMergeContinueBlockIdInIdx = 1; - -} // anonymous namespace - -bool LocalMultiStoreElimPass::HasOnlySupportedRefs(uint32_t varId) { - if (supported_ref_vars_.find(varId) != supported_ref_vars_.end()) - return true; - analysis::UseList* uses = def_use_mgr_->GetUses(varId); - if (uses == nullptr) - return true; - for (auto u : *uses) { - const SpvOp op = u.inst->opcode(); - if (op != SpvOpStore && op != SpvOpLoad && op != SpvOpName && - !IsNonTypeDecorate(op)) - return false; - } - supported_ref_vars_.insert(varId); - return true; -} - -void LocalMultiStoreElimPass::InitSSARewrite(ir::Function& func) { - // Init predecessors - label2preds_.clear(); - for (auto& blk : func) { - uint32_t blkId = blk.id(); - blk.ForEachSuccessorLabel([&blkId, this](uint32_t sbid) { - label2preds_[sbid].push_back(blkId); - }); - } - // Collect target (and non-) variable sets. Remove variables with - // non-load/store refs from target variable set - for (auto& blk : func) { - for (auto& inst : blk) { - switch (inst.opcode()) { - case SpvOpStore: - case SpvOpLoad: { - uint32_t varId; - (void) GetPtr(&inst, &varId); - if (!IsTargetVar(varId)) - break; - if (HasOnlySupportedRefs(varId)) - break; - seen_non_target_vars_.insert(varId); - seen_target_vars_.erase(varId); - } break; - default: - break; - } - } - } -} - -uint32_t LocalMultiStoreElimPass::MergeBlockIdIfAny(const ir::BasicBlock& blk, - uint32_t* cbid) { - auto merge_ii = blk.cend(); - --merge_ii; - *cbid = 0; - uint32_t mbid = 0; - if (merge_ii != blk.cbegin()) { - --merge_ii; - if (merge_ii->opcode() == SpvOpLoopMerge) { - mbid = merge_ii->GetSingleWordInOperand(kLoopMergeMergeBlockIdInIdx); - *cbid = merge_ii->GetSingleWordInOperand(kLoopMergeContinueBlockIdInIdx); - } - else if (merge_ii->opcode() == SpvOpSelectionMerge) { - mbid = merge_ii->GetSingleWordInOperand(kSelectionMergeMergeBlockIdInIdx); - } - } - return mbid; -} - -void LocalMultiStoreElimPass::ComputeStructuredSuccessors(ir::Function* func) { - block2structured_succs_.clear(); - for (auto& blk : *func) { - // If no predecessors in function, make successor to pseudo entry - if (label2preds_[blk.id()].size() == 0) - block2structured_succs_[&pseudo_entry_block_].push_back(&blk); - // If header, make merge block first successor. - uint32_t cbid; - const uint32_t mbid = MergeBlockIdIfAny(blk, &cbid); - if (mbid != 0) { - block2structured_succs_[&blk].push_back(id2block_[mbid]); - if (cbid != 0) - block2structured_succs_[&blk].push_back(id2block_[cbid]); - } - // add true successors - blk.ForEachSuccessorLabel([&blk, this](uint32_t sbid) { - block2structured_succs_[&blk].push_back(id2block_[sbid]); - }); - } -} - -void LocalMultiStoreElimPass::ComputeStructuredOrder( - ir::Function* func, std::list* order) { - // Compute structured successors and do DFS - ComputeStructuredSuccessors(func); - auto ignore_block = [](cbb_ptr) {}; - auto ignore_edge = [](cbb_ptr, cbb_ptr) {}; - auto get_structured_successors = [this](const ir::BasicBlock* block) { - return &(block2structured_succs_[block]); }; - // TODO(greg-lunarg): Get rid of const_cast by making moving const - // out of the cfa.h prototypes and into the invoking code. - auto post_order = [&](cbb_ptr b) { - order->push_front(const_cast(b)); }; - - spvtools::CFA::DepthFirstTraversal( - &pseudo_entry_block_, get_structured_successors, ignore_block, - post_order, ignore_edge); -} - -void LocalMultiStoreElimPass::SSABlockInitSinglePred(ir::BasicBlock* block_ptr) { - // Copy map entry from single predecessor - const uint32_t label = block_ptr->id(); - const uint32_t predLabel = label2preds_[label].front(); - assert(visitedBlocks_.find(predLabel) != visitedBlocks_.end()); - label2ssa_map_[label] = label2ssa_map_[predLabel]; -} - -bool LocalMultiStoreElimPass::IsLiveAfter(uint32_t var_id, uint32_t label) const { - // For now, return very conservative result: true. This will result in - // correct, but possibly usused, phi code to be generated. A subsequent - // DCE pass should eliminate this code. - // TODO(greg-lunarg): Return more accurate information - (void) var_id; - (void) label; - return true; -} - -uint32_t LocalMultiStoreElimPass::Type2Undef(uint32_t type_id) { - const auto uitr = type2undefs_.find(type_id); - if (uitr != type2undefs_.end()) - return uitr->second; - const uint32_t undefId = TakeNextId(); - std::unique_ptr undef_inst( - new ir::Instruction(SpvOpUndef, type_id, undefId, {})); - def_use_mgr_->AnalyzeInstDefUse(&*undef_inst); - module_->AddGlobalValue(std::move(undef_inst)); - type2undefs_[type_id] = undefId; - return undefId; -} - -uint32_t LocalMultiStoreElimPass::GetPointeeTypeId( - const ir::Instruction* ptrInst) const { - const uint32_t ptrTypeId = ptrInst->type_id(); - const ir::Instruction* ptrTypeInst = def_use_mgr_->GetDef(ptrTypeId); - return ptrTypeInst->GetSingleWordInOperand(kTypePointerTypeIdInIdx); -} - -void LocalMultiStoreElimPass::SSABlockInitLoopHeader( - std::list::iterator block_itr) { - const uint32_t label = (*block_itr)->id(); - // Determine backedge label. - uint32_t backLabel = 0; - for (uint32_t predLabel : label2preds_[label]) - if (visitedBlocks_.find(predLabel) == visitedBlocks_.end()) { - assert(backLabel == 0); - backLabel = predLabel; - break; - } - assert(backLabel != 0); - // Determine merge block. - auto mergeInst = (*block_itr)->end(); - --mergeInst; - --mergeInst; - uint32_t mergeLabel = mergeInst->GetSingleWordInOperand( - kLoopMergeMergeBlockIdInIdx); - // Collect all live variables and a default value for each across all - // non-backedge predecesors. Must be ordered map because phis are - // generated based on order and test results will otherwise vary across - // platforms. - std::map liveVars; - for (uint32_t predLabel : label2preds_[label]) { - for (auto var_val : label2ssa_map_[predLabel]) { - uint32_t varId = var_val.first; - liveVars[varId] = var_val.second; - } - } - // Add all stored variables in loop. Set their default value id to zero. - for (auto bi = block_itr; (*bi)->id() != mergeLabel; ++bi) { - ir::BasicBlock* bp = *bi; - for (auto ii = bp->begin(); ii != bp->end(); ++ii) { - if (ii->opcode() != SpvOpStore) - continue; - uint32_t varId; - (void) GetPtr(&*ii, &varId); - if (!IsTargetVar(varId)) - continue; - liveVars[varId] = 0; - } - } - // Insert phi for all live variables that require them. All variables - // defined in loop require a phi. Otherwise all variables - // with differing predecessor values require a phi. - auto insertItr = (*block_itr)->begin(); - for (auto var_val : liveVars) { - const uint32_t varId = var_val.first; - if (!IsLiveAfter(varId, label)) - continue; - const uint32_t val0Id = var_val.second; - bool needsPhi = false; - if (val0Id != 0) { - for (uint32_t predLabel : label2preds_[label]) { - // Skip back edge predecessor. - if (predLabel == backLabel) - continue; - const auto var_val_itr = label2ssa_map_[predLabel].find(varId); - // Missing (undef) values always cause difference with (defined) value - if (var_val_itr == label2ssa_map_[predLabel].end()) { - needsPhi = true; - break; - } - if (var_val_itr->second != val0Id) { - needsPhi = true; - break; - } - } - } - else { - needsPhi = true; - } - // If val is the same for all predecessors, enter it in map - if (!needsPhi) { - label2ssa_map_[label].insert(var_val); - continue; - } - // Val differs across predecessors. Add phi op to block and - // add its result id to the map. For back edge predecessor, - // use the variable id. We will patch this after visiting back - // edge predecessor. For predecessors that do not define a value, - // use undef. - std::vector phi_in_operands; - uint32_t typeId = GetPointeeTypeId(def_use_mgr_->GetDef(varId)); - for (uint32_t predLabel : label2preds_[label]) { - uint32_t valId; - if (predLabel == backLabel) { - valId = varId; - } - else { - const auto var_val_itr = label2ssa_map_[predLabel].find(varId); - if (var_val_itr == label2ssa_map_[predLabel].end()) - valId = Type2Undef(typeId); - else - valId = var_val_itr->second; - } - phi_in_operands.push_back( - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {valId}}); - phi_in_operands.push_back( - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {predLabel}}); - } - const uint32_t phiId = TakeNextId(); - std::unique_ptr newPhi( - new ir::Instruction(SpvOpPhi, typeId, phiId, phi_in_operands)); - // The only phis requiring patching are the ones we create. - phis_to_patch_.insert(phiId); - // Only analyze the phi define now; analyze the phi uses after the - // phi backedge predecessor value is patched. - def_use_mgr_->AnalyzeInstDef(&*newPhi); - insertItr = insertItr.InsertBefore(std::move(newPhi)); - ++insertItr; - label2ssa_map_[label].insert({ varId, phiId }); - } -} - -void LocalMultiStoreElimPass::SSABlockInitMultiPred(ir::BasicBlock* block_ptr) { - const uint32_t label = block_ptr->id(); - // Collect all live variables and a default value for each across all - // predecesors. Must be ordered map because phis are generated based on - // order and test results will otherwise vary across platforms. - std::map liveVars; - for (uint32_t predLabel : label2preds_[label]) { - assert(visitedBlocks_.find(predLabel) != visitedBlocks_.end()); - for (auto var_val : label2ssa_map_[predLabel]) { - const uint32_t varId = var_val.first; - liveVars[varId] = var_val.second; - } - } - // For each live variable, look for a difference in values across - // predecessors that would require a phi and insert one. - auto insertItr = block_ptr->begin(); - for (auto var_val : liveVars) { - const uint32_t varId = var_val.first; - if (!IsLiveAfter(varId, label)) - continue; - const uint32_t val0Id = var_val.second; - bool differs = false; - for (uint32_t predLabel : label2preds_[label]) { - const auto var_val_itr = label2ssa_map_[predLabel].find(varId); - // Missing values cause a difference because we'll need to create an - // undef for that predecessor. - if (var_val_itr == label2ssa_map_[predLabel].end()) { - differs = true; - break; - } - if (var_val_itr->second != val0Id) { - differs = true; - break; - } - } - // If val is the same for all predecessors, enter it in map - if (!differs) { - label2ssa_map_[label].insert(var_val); - continue; - } - // Val differs across predecessors. Add phi op to block and - // add its result id to the map - std::vector phi_in_operands; - const uint32_t typeId = GetPointeeTypeId(def_use_mgr_->GetDef(varId)); - for (uint32_t predLabel : label2preds_[label]) { - const auto var_val_itr = label2ssa_map_[predLabel].find(varId); - // If variable not defined on this path, use undef - const uint32_t valId = (var_val_itr != label2ssa_map_[predLabel].end()) ? - var_val_itr->second : Type2Undef(typeId); - phi_in_operands.push_back( - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {valId}}); - phi_in_operands.push_back( - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {predLabel}}); - } - const uint32_t phiId = TakeNextId(); - std::unique_ptr newPhi( - new ir::Instruction(SpvOpPhi, typeId, phiId, phi_in_operands)); - def_use_mgr_->AnalyzeInstDefUse(&*newPhi); - insertItr = insertItr.InsertBefore(std::move(newPhi)); - ++insertItr; - label2ssa_map_[label].insert({varId, phiId}); - } -} - -bool LocalMultiStoreElimPass::IsLoopHeader(ir::BasicBlock* block_ptr) const { - auto iItr = block_ptr->end(); - --iItr; - if (iItr == block_ptr->begin()) - return false; - --iItr; - return iItr->opcode() == SpvOpLoopMerge; -} - -void LocalMultiStoreElimPass::SSABlockInit( - std::list::iterator block_itr) { - const size_t numPreds = label2preds_[(*block_itr)->id()].size(); - if (numPreds == 0) - return; - if (numPreds == 1) - SSABlockInitSinglePred(*block_itr); - else if (IsLoopHeader(*block_itr)) - SSABlockInitLoopHeader(block_itr); - else - SSABlockInitMultiPred(*block_itr); -} - -void LocalMultiStoreElimPass::PatchPhis(uint32_t header_id, uint32_t back_id) { - ir::BasicBlock* header = id2block_[header_id]; - auto phiItr = header->begin(); - for (; phiItr->opcode() == SpvOpPhi; ++phiItr) { - // Only patch phis that we created in a loop header. - // There might be other phis unrelated to our optimizations. - if (0 == phis_to_patch_.count(phiItr->result_id())) continue; - - // Find phi operand index for back edge - uint32_t cnt = 0; - uint32_t idx = phiItr->NumInOperands(); - phiItr->ForEachInId([&cnt,&back_id,&idx](uint32_t* iid) { - if (cnt % 2 == 1 && *iid == back_id) idx = cnt - 1; - ++cnt; - }); - assert(idx != phiItr->NumInOperands()); - // Replace temporary phi operand with variable's value in backedge block - // map. Use undef if variable not in map. - const uint32_t varId = phiItr->GetSingleWordInOperand(idx); - const auto valItr = label2ssa_map_[back_id].find(varId); - uint32_t valId = - (valItr != label2ssa_map_[back_id].end()) - ? valItr->second - : Type2Undef(GetPointeeTypeId(def_use_mgr_->GetDef(varId))); - phiItr->SetInOperand(idx, {valId}); - // Analyze uses now that they are complete - def_use_mgr_->AnalyzeInstUse(&*phiItr); - } -} - -bool LocalMultiStoreElimPass::EliminateMultiStoreLocal(ir::Function* func) { - InitSSARewrite(*func); - // Process all blocks in structured order. This is just one way (the - // simplest?) to make sure all predecessors blocks are processed before - // a block itself. - std::list structuredOrder; - ComputeStructuredOrder(func, &structuredOrder); - bool modified = false; - for (auto bi = structuredOrder.begin(); bi != structuredOrder.end(); ++bi) { - // Skip pseudo entry block - if (*bi == &pseudo_entry_block_) - continue; - // Initialize this block's label2ssa_map_ entry using predecessor maps. - // Then process all stores and loads of targeted variables. - SSABlockInit(bi); - ir::BasicBlock* bp = *bi; - const uint32_t label = bp->id(); - for (auto ii = bp->begin(); ii != bp->end(); ++ii) { - switch (ii->opcode()) { - case SpvOpStore: { - uint32_t varId; - (void) GetPtr(&*ii, &varId); - if (!IsTargetVar(varId)) - break; - // Register new stored value for the variable - label2ssa_map_[label][varId] = - ii->GetSingleWordInOperand(kStoreValIdInIdx); - } break; - case SpvOpLoad: { - uint32_t varId; - (void) GetPtr(&*ii, &varId); - if (!IsTargetVar(varId)) - break; - uint32_t replId = 0; - const auto ssaItr = label2ssa_map_.find(label); - if (ssaItr != label2ssa_map_.end()) { - const auto valItr = ssaItr->second.find(varId); - if (valItr != ssaItr->second.end()) - replId = valItr->second; - } - // If variable is not defined, use undef - if (replId == 0) { - replId = Type2Undef(GetPointeeTypeId(def_use_mgr_->GetDef(varId))); - } - // Replace load's id with the last stored value id for variable - // and delete load. Kill any names or decorates using id before - // replacing to prevent incorrect replacement in those instructions. - const uint32_t loadId = ii->result_id(); - KillNamesAndDecorates(loadId); - (void)def_use_mgr_->ReplaceAllUsesWith(loadId, replId); - def_use_mgr_->KillInst(&*ii); - modified = true; - } break; - default: { - } break; - } - } - visitedBlocks_.insert(label); - // Look for successor backedge and patch phis in loop header - // if found. - uint32_t header = 0; - bp->ForEachSuccessorLabel([&header,this](uint32_t succ) { - if (visitedBlocks_.find(succ) == visitedBlocks_.end()) return; - assert(header == 0); - header = succ; - }); - if (header != 0) - PatchPhis(header, label); - } - // Remove all target variable stores. - for (auto bi = func->begin(); bi != func->end(); ++bi) { - for (auto ii = bi->begin(); ii != bi->end(); ++ii) { - if (ii->opcode() != SpvOpStore) - continue; - uint32_t varId; - (void) GetPtr(&*ii, &varId); - if (!IsTargetVar(varId)) - continue; - assert(!HasLoads(varId)); - DCEInst(&*ii); - modified = true; - } - } - return modified; -} - -void LocalMultiStoreElimPass::Initialize(ir::Module* module) { - - module_ = module; - - // TODO(greg-lunarg): Reuse def/use from previous passes - def_use_mgr_.reset(new analysis::DefUseManager(consumer(), module_)); - - // Initialize function and block maps - id2block_.clear(); - block2structured_succs_.clear(); - for (auto& fn : *module_) - for (auto& blk : fn) - id2block_[blk.id()] = &blk; - - // Clear collections - seen_target_vars_.clear(); - seen_non_target_vars_.clear(); - visitedBlocks_.clear(); - type2undefs_.clear(); - supported_ref_vars_.clear(); - block2structured_succs_.clear(); - label2preds_.clear(); - label2ssa_map_.clear(); - phis_to_patch_.clear(); - - // Start new ids with next availablein module - InitNextId(); - - // Initialize extension whitelist - InitExtensions(); -}; - -bool LocalMultiStoreElimPass::AllExtensionsSupported() const { - // If any extension not in whitelist, return false - for (auto& ei : module_->extensions()) { - const char* extName = reinterpret_cast( - &ei.GetInOperand(0).words[0]); - if (extensions_whitelist_.find(extName) == extensions_whitelist_.end()) - return false; - } - return true; -} - -Pass::Status LocalMultiStoreElimPass::ProcessImpl() { - // Assumes all control flow structured. - // TODO(greg-lunarg): Do SSA rewrite for non-structured control flow - if (!module_->HasCapability(SpvCapabilityShader)) - return Status::SuccessWithoutChange; - // Assumes logical addressing only - // TODO(greg-lunarg): Add support for physical addressing - if (module_->HasCapability(SpvCapabilityAddresses)) - return Status::SuccessWithoutChange; - // Do not process if module contains OpGroupDecorate. Additional - // support required in KillNamesAndDecorates(). - // TODO(greg-lunarg): Add support for OpGroupDecorate - for (auto& ai : module_->annotations()) - if (ai.opcode() == SpvOpGroupDecorate) - return Status::SuccessWithoutChange; - // Do not process if any disallowed extensions are enabled - if (!AllExtensionsSupported()) - return Status::SuccessWithoutChange; - // Collect all named and decorated ids - FindNamedOrDecoratedIds(); - // Process functions - ProcessFunction pfn = [this](ir::Function* fp) { - return EliminateMultiStoreLocal(fp); - }; - bool modified = ProcessEntryPointCallTree(pfn, module_); - FinalizeNextId(); - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -LocalMultiStoreElimPass::LocalMultiStoreElimPass() - : pseudo_entry_block_(std::unique_ptr( - new ir::Instruction(SpvOpLabel, 0, 0, {}))) {} - -Pass::Status LocalMultiStoreElimPass::Process(ir::Module* module) { - Initialize(module); - return ProcessImpl(); -} - -void LocalMultiStoreElimPass::InitExtensions() { - extensions_whitelist_.clear(); - extensions_whitelist_.insert({ - "SPV_AMD_shader_explicit_vertex_parameter", - "SPV_AMD_shader_trinary_minmax", - "SPV_AMD_gcn_shader", - "SPV_KHR_shader_ballot", - "SPV_AMD_shader_ballot", - "SPV_AMD_gpu_shader_half_float", - "SPV_KHR_shader_draw_parameters", - "SPV_KHR_subgroup_vote", - "SPV_KHR_16bit_storage", - "SPV_KHR_device_group", - "SPV_KHR_multiview", - "SPV_NVX_multiview_per_view_attributes", - "SPV_NV_viewport_array2", - "SPV_NV_stereo_view_rendering", - "SPV_NV_sample_mask_override_coverage", - "SPV_NV_geometry_shader_passthrough", - "SPV_AMD_texture_gather_bias_lod", - "SPV_KHR_storage_buffer_storage_class", - // SPV_KHR_variable_pointers - // Currently do not support extended pointer expressions - "SPV_AMD_gpu_shader_int16", - "SPV_KHR_post_depth_coverage", - "SPV_KHR_shader_atomic_counter_ops", - }); -} - -} // namespace opt -} // namespace spvtools - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/local_ssa_elim_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/local_ssa_elim_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/local_ssa_elim_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/local_ssa_elim_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,185 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#ifndef LIBSPIRV_OPT_LOCAL_SSA_ELIM_PASS_H_ -#define LIBSPIRV_OPT_LOCAL_SSA_ELIM_PASS_H_ - - -#include -#include -#include -#include -#include -#include - -#include "basic_block.h" -#include "def_use_manager.h" -#include "module.h" -#include "mem_pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class LocalMultiStoreElimPass : public MemPass { - using cbb_ptr = const ir::BasicBlock*; - - public: - using GetBlocksFunction = - std::function*(const ir::BasicBlock*)>; - - LocalMultiStoreElimPass(); - const char* name() const override { return "eliminate-local-multi-store"; } - Status Process(ir::Module*) override; - - private: - // Return type id for |ptrInst|'s pointee - uint32_t GetPointeeTypeId(const ir::Instruction* ptrInst) const; - - // Return true if all uses of |varId| are only through supported reference - // operations ie. loads and store. Also cache in supported_ref_vars_; - bool HasOnlySupportedRefs(uint32_t varId); - - // Initialize data structures used by EliminateLocalMultiStore for - // function |func|, specifically block predecessors and target variables. - void InitSSARewrite(ir::Function& func); - - // Returns the id of the merge block declared by a merge instruction in - // this block, if any. If none, returns zero. - uint32_t MergeBlockIdIfAny(const ir::BasicBlock& blk, uint32_t* cbid); - - // Compute structured successors for function |func|. - // A block's structured successors are the blocks it branches to - // together with its declared merge block if it has one. - // When order matters, the merge block always appears first. - // This assures correct depth first search in the presence of early - // returns and kills. If the successor vector contain duplicates - // if the merge block, they are safely ignored by DFS. - void ComputeStructuredSuccessors(ir::Function* func); - - // Compute structured block order for |func| into |structuredOrder|. This - // order has the property that dominators come before all blocks they - // dominate and merge blocks come after all blocks that are in the control - // constructs of their header. - void ComputeStructuredOrder(ir::Function* func, - std::list* order); - - // Return true if loop header block - bool IsLoopHeader(ir::BasicBlock* block_ptr) const; - - // Initialize label2ssa_map_ entry for block |block_ptr| with single - // predecessor. - void SSABlockInitSinglePred(ir::BasicBlock* block_ptr); - - // Return true if variable is loaded in block with |label| or in - // any succeeding block in structured order. - bool IsLiveAfter(uint32_t var_id, uint32_t label) const; - - // Initialize label2ssa_map_ entry for loop header block pointed to - // |block_itr| by merging entries from all predecessors. If any value - // ids differ for any variable across predecessors, create a phi function - // in the block and use that value id for the variable in the new map. - // Assumes all predecessors have been visited by EliminateLocalMultiStore - // except the back edge. Use a dummy value in the phi for the back edge - // until the back edge block is visited and patch the phi value then. - void SSABlockInitLoopHeader(std::list::iterator block_itr); - - // Initialize label2ssa_map_ entry for multiple predecessor block - // |block_ptr| by merging label2ssa_map_ entries for all predecessors. - // If any value ids differ for any variable across predecessors, create - // a phi function in the block and use that value id for the variable in - // the new map. Assumes all predecessors have been visited by - // EliminateLocalMultiStore. - void SSABlockInitMultiPred(ir::BasicBlock* block_ptr); - - // Initialize the label2ssa_map entry for a block pointed to by |block_itr|. - // Insert phi instructions into block when necessary. All predecessor - // blocks must have been visited by EliminateLocalMultiStore except for - // backedges. - void SSABlockInit(std::list::iterator block_itr); - - // Return undef in function for type. Create and insert an undef after the - // first non-variable in the function if it doesn't already exist. Add - // undef to function undef map. - uint32_t Type2Undef(uint32_t type_id); - - // Patch phis in loop header block |header_id| now that the map is complete - // for the backedge predecessor |back_id|. Specifically, for each phi, find - // the value corresponding to the backedge predecessor. That was temporarily - // set with the variable id that this phi corresponds to. Change this phi - // operand to the the value which corresponds to that variable in the - // predecessor map. - void PatchPhis(uint32_t header_id, uint32_t back_id); - - // Initialize extensions whitelist - void InitExtensions(); - - // Return true if all extensions in this module are allowed by this pass. - bool AllExtensionsSupported() const; - - // Remove remaining loads and stores of function scope variables only - // referenced with non-access-chain loads and stores from function |func|. - // Insert Phi functions where necessary. Running LocalAccessChainRemoval, - // SingleBlockLocalElim and SingleStoreLocalElim beforehand will improve - // the runtime and effectiveness of this function. - bool EliminateMultiStoreLocal(ir::Function* func); - - void Initialize(ir::Module* module); - Pass::Status ProcessImpl(); - - // Map from block's label id to block. - std::unordered_map id2block_; - - // Set of label ids of visited blocks - std::unordered_set visitedBlocks_; - - // Map from type to undef - std::unordered_map type2undefs_; - - // Variables that are only referenced by supported operations for this - // pass ie. loads and stores. - std::unordered_set supported_ref_vars_; - - // Map from block to its structured successor blocks. See - // ComputeStructuredSuccessors() for definition. - std::unordered_map> - block2structured_succs_; - - // Map from block's label id to its predecessor blocks ids - std::unordered_map> label2preds_; - - // Map from block's label id to a map of a variable to its value at the - // end of the block. - std::unordered_map> - label2ssa_map_; - - // The Ids of OpPhi instructions that are in a loop header and which require - // patching of the value for the loop back-edge. - std::unordered_set phis_to_patch_; - - // Extra block whose successors are all blocks with no predecessors - // in function. - ir::BasicBlock pseudo_entry_block_; - - // Extensions supported by this pass. - std::unordered_set extensions_whitelist_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_LOCAL_SSA_ELIM_PASS_H_ - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/log.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/log.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/log.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/log.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,231 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SPIRV_TOOLS_LOG_H_ -#define SPIRV_TOOLS_LOG_H_ - -#include -#include -#include -#include - -#include "spirv-tools/libspirv.hpp" - -// Asserts the given condition is true. Otherwise, sends a message to the -// consumer and exits the problem with failure code. Accepts the following -// formats: -// -// SPIRV_ASSERT(, ); -// SPIRV_ASSERT(, , ); -// SPIRV_ASSERT(, , -// , ); -// -// In the third format, the number of cannot exceed (5 - -// 2). If more arguments are wanted, grow PP_ARG_N and PP_NARGS in the below. -#if !defined(NDEBUG) -#define SPIRV_ASSERT(consumer, ...) SPIRV_ASSERT_IMPL(consumer, __VA_ARGS__) -#else -#define SPIRV_ASSERT(consumer, ...) -#endif - -// Logs a debug message to the consumer. Accepts the following formats: -// -// SPIRV_DEBUG(, ); -// SPIRV_DEBUG(, , ); -// -// In the second format, the number of cannot exceed (5 - -// 1). If more arguments are wanted, grow PP_ARG_N and PP_NARGS in the below. -#if !defined(NDEBUG) && defined(SPIRV_LOG_DEBUG) -#define SPIRV_DEBUG(consumer, ...) SPIRV_DEBUG_IMPL(consumer, __VA_ARGS__) -#else -#define SPIRV_DEBUG(consumer, ...) -#endif - -// Logs an error message to the consumer saying the given feature is -// unimplemented. -#define SPIRV_UNIMPLEMENTED(consumer, feature) \ - do { \ - spvtools::Log(consumer, SPV_MSG_INTERNAL_ERROR, __FILE__, \ - {__LINE__, 0, 0}, "unimplemented: " feature); \ - } while (0) - -// Logs an error message to the consumer saying the code location -// should be unreachable. -#define SPIRV_UNREACHABLE(consumer) \ - do { \ - spvtools::Log(consumer, SPV_MSG_INTERNAL_ERROR, __FILE__, \ - {__LINE__, 0, 0}, "unreachable"); \ - } while (0) - -// Helper macros for concatenating arguments. -#define SPIRV_CONCATENATE(a, b) SPIRV_CONCATENATE_(a, b) -#define SPIRV_CONCATENATE_(a, b) a##b - -// Helper macro to force expanding __VA_ARGS__ to satisfy MSVC compiler. -#define PP_EXPAND(x) x - -namespace spvtools { - -// Calls the given |consumer| by supplying the |message|. The |message| is from -// the given |source| and |location| and of the given severity |level|. -inline void Log(const MessageConsumer& consumer, spv_message_level_t level, - const char* source, const spv_position_t& position, - const char* message) { - if (consumer != nullptr) consumer(level, source, position, message); -} - -// Calls the given |consumer| by supplying the message composed according to the -// given |format|. The |message| is from the given |source| and |location| and -// of the given severity |level|. -template -void Logf(const MessageConsumer& consumer, spv_message_level_t level, - const char* source, const spv_position_t& position, - const char* format, Args&&... args) { -#if defined(_MSC_VER) && _MSC_VER < 1900 -// Sadly, snprintf() is not supported until Visual Studio 2015! -#define snprintf _snprintf -#endif - - enum { kInitBufferSize = 256 }; - - char message[kInitBufferSize]; - const int size = - snprintf(message, kInitBufferSize, format, std::forward(args)...); - - if (size >= 0 && size < kInitBufferSize) { - Log(consumer, level, source, position, message); - return; - } - - if (size >= 0) { - // The initial buffer is insufficient. Allocate a buffer of a larger size, - // and write to it instead. Force the size to be unsigned to avoid a - // warning in GCC 7.1. - std::vector longer_message(size + 1u); - snprintf(longer_message.data(), longer_message.size(), format, - std::forward(args)...); - Log(consumer, level, source, position, longer_message.data()); - return; - } - - Log(consumer, level, source, position, "cannot compose log message"); - -#if defined(_MSC_VER) && _MSC_VER < 1900 -#undef snprintf -#endif -} - -// Calls the given |consumer| by supplying the given error |message|. The -// |message| is from the given |source| and |location|. -inline void Error(const MessageConsumer& consumer, const char* source, - const spv_position_t& position, const char* message) { - Log(consumer, SPV_MSG_ERROR, source, position, message); -} - -// Calls the given |consumer| by supplying the error message composed according -// to the given |format|. The |message| is from the given |source| and -// |location|. -template -inline void Errorf(const MessageConsumer& consumer, const char* source, - const spv_position_t& position, const char* format, - Args&&... args) { - Logf(consumer, SPV_MSG_ERROR, source, position, format, - std::forward(args)...); -} - -} // namespace spvtools - -#define SPIRV_ASSERT_IMPL(consumer, ...) \ - PP_EXPAND(SPIRV_CONCATENATE(SPIRV_ASSERT_, PP_NARGS(__VA_ARGS__))( \ - consumer, __VA_ARGS__)) - -#define SPIRV_DEBUG_IMPL(consumer, ...) \ - PP_EXPAND(SPIRV_CONCATENATE(SPIRV_DEBUG_, PP_NARGS(__VA_ARGS__))( \ - consumer, __VA_ARGS__)) - -#define SPIRV_ASSERT_1(consumer, condition) \ - do { \ - if (!(condition)) { \ - spvtools::Log(consumer, SPV_MSG_INTERNAL_ERROR, __FILE__, \ - {__LINE__, 0, 0}, "assertion failed: " #condition); \ - std::exit(EXIT_FAILURE); \ - } \ - } while (0) - -#define SPIRV_ASSERT_2(consumer, condition, message) \ - do { \ - if (!(condition)) { \ - spvtools::Log(consumer, SPV_MSG_INTERNAL_ERROR, __FILE__, \ - {__LINE__, 0, 0}, "assertion failed: " message); \ - std::exit(EXIT_FAILURE); \ - } \ - } while (0) - -#define SPIRV_ASSERT_more(consumer, condition, format, ...) \ - do { \ - if (!(condition)) { \ - spvtools::Logf(consumer, SPV_MSG_INTERNAL_ERROR, __FILE__, \ - {__LINE__, 0, 0}, "assertion failed: " format, \ - __VA_ARGS__); \ - std::exit(EXIT_FAILURE); \ - } \ - } while (0) - -#define SPIRV_ASSERT_3(consumer, condition, format, ...) \ - SPIRV_ASSERT_more(consumer, condition, format, __VA_ARGS__) - -#define SPIRV_ASSERT_4(consumer, condition, format, ...) \ - SPIRV_ASSERT_more(consumer, condition, format, __VA_ARGS__) - -#define SPIRV_ASSERT_5(consumer, condition, format, ...) \ - SPIRV_ASSERT_more(consumer, condition, format, __VA_ARGS__) - -#define SPIRV_DEBUG_1(consumer, message) \ - do { \ - spvtools::Log(consumer, SPV_MSG_DEBUG, __FILE__, {__LINE__, 0, 0}, \ - message); \ - } while (0) - -#define SPIRV_DEBUG_more(consumer, format, ...) \ - do { \ - spvtools::Logf(consumer, SPV_MSG_DEBUG, __FILE__, {__LINE__, 0, 0}, \ - format, __VA_ARGS__); \ - } while (0) - -#define SPIRV_DEBUG_2(consumer, format, ...) \ - SPIRV_DEBUG_more(consumer, format, __VA_ARGS__) - -#define SPIRV_DEBUG_3(consumer, format, ...) \ - SPIRV_DEBUG_more(consumer, format, __VA_ARGS__) - -#define SPIRV_DEBUG_4(consumer, format, ...) \ - SPIRV_DEBUG_more(consumer, format, __VA_ARGS__) - -#define SPIRV_DEBUG_5(consumer, format, ...) \ - SPIRV_DEBUG_more(consumer, format, __VA_ARGS__) - -// Macros for counting the number of arguments passed in. -#define PP_NARGS(...) PP_EXPAND(PP_ARG_N(__VA_ARGS__, 5, 4, 3, 2, 1, 0)) -#define PP_ARG_N(_1, _2, _3, _4, _5, N, ...) N - -// Tests for making sure that PP_NARGS() behaves as expected. -static_assert(PP_NARGS(0) == 1, "PP_NARGS macro error"); -static_assert(PP_NARGS(0, 0) == 2, "PP_NARGS macro error"); -static_assert(PP_NARGS(0, 0, 0) == 3, "PP_NARGS macro error"); -static_assert(PP_NARGS(0, 0, 0, 0) == 4, "PP_NARGS macro error"); -static_assert(PP_NARGS(0, 0, 0, 0, 0) == 5, "PP_NARGS macro error"); -static_assert(PP_NARGS(1 + 1, 2, 3 / 3) == 3, "PP_NARGS macro error"); -static_assert(PP_NARGS((1, 1), 2, (3, 3)) == 3, "PP_NARGS macro error"); - -#endif // SPIRV_TOOLS_LOG_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/make_unique.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/make_unique.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/make_unique.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/make_unique.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_MAKE_UNIQUE_H_ -#define LIBSPIRV_OPT_MAKE_UNIQUE_H_ - -#include -#include - -namespace spvtools { - -template -std::unique_ptr MakeUnique(Args&&... args) { - return std::unique_ptr(new T(std::forward(args)...)); -} - -} // namespace spvtools - -#endif // LIBSPIRV_OPT_MAKE_UNIQUE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/mem_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/mem_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/mem_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/mem_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,299 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "mem_pass.h" - -#include "iterator.h" - -namespace spvtools { -namespace opt { - -namespace { - -const uint32_t kStorePtrIdInIdx = 0; -const uint32_t kLoadPtrIdInIdx = 0; -const uint32_t kAccessChainPtrIdInIdx = 0; -const uint32_t kCopyObjectOperandInIdx = 0; -const uint32_t kTypePointerStorageClassInIdx = 0; -const uint32_t kTypePointerTypeIdInIdx = 1; - -} // namespace anonymous - - -bool MemPass::IsBaseTargetType( - const ir::Instruction* typeInst) const { - switch (typeInst->opcode()) { - case SpvOpTypeInt: - case SpvOpTypeFloat: - case SpvOpTypeBool: - case SpvOpTypeVector: - case SpvOpTypeMatrix: - case SpvOpTypeImage: - case SpvOpTypeSampler: - case SpvOpTypeSampledImage: - return true; - default: - break; - } - return false; -} - -bool MemPass::IsTargetType( - const ir::Instruction* typeInst) const { - if (IsBaseTargetType(typeInst)) - return true; - if (typeInst->opcode() == SpvOpTypeArray) - return IsBaseTargetType( - def_use_mgr_->GetDef(typeInst->GetSingleWordOperand(1))); - if (typeInst->opcode() != SpvOpTypeStruct) - return false; - // All struct members must be math type - int nonMathComp = 0; - typeInst->ForEachInId([&nonMathComp,this](const uint32_t* tid) { - ir::Instruction* compTypeInst = def_use_mgr_->GetDef(*tid); - if (!IsBaseTargetType(compTypeInst)) ++nonMathComp; - }); - return nonMathComp == 0; -} - -bool MemPass::IsNonPtrAccessChain(const SpvOp opcode) const { - return opcode == SpvOpAccessChain || opcode == SpvOpInBoundsAccessChain; -} - -bool MemPass::IsPtr(uint32_t ptrId) { - uint32_t varId = ptrId; - ir::Instruction* ptrInst = def_use_mgr_->GetDef(varId); - while (ptrInst->opcode() == SpvOpCopyObject) { - varId = ptrInst->GetSingleWordInOperand(kCopyObjectOperandInIdx); - ptrInst = def_use_mgr_->GetDef(varId); - } - const SpvOp op = ptrInst->opcode(); - if (op == SpvOpVariable || IsNonPtrAccessChain(op)) - return true; - if (op != SpvOpFunctionParameter) - return false; - const uint32_t varTypeId = ptrInst->type_id(); - const ir::Instruction* varTypeInst = def_use_mgr_->GetDef(varTypeId); - return varTypeInst->opcode() == SpvOpTypePointer; -} - -ir::Instruction* MemPass::GetPtr( - uint32_t ptrId, uint32_t* varId) { - *varId = ptrId; - ir::Instruction* ptrInst = def_use_mgr_->GetDef(*varId); - while (ptrInst->opcode() == SpvOpCopyObject) { - *varId = ptrInst->GetSingleWordInOperand(kCopyObjectOperandInIdx); - ptrInst = def_use_mgr_->GetDef(*varId); - } - ir::Instruction* varInst = ptrInst; - while (varInst->opcode() != SpvOpVariable && - varInst->opcode() != SpvOpFunctionParameter) { - if (IsNonPtrAccessChain(varInst->opcode())) { - *varId = varInst->GetSingleWordInOperand(kAccessChainPtrIdInIdx); - } - else { - assert(varInst->opcode() == SpvOpCopyObject); - *varId = varInst->GetSingleWordInOperand(kCopyObjectOperandInIdx); - } - varInst = def_use_mgr_->GetDef(*varId); - } - return ptrInst; -} - -ir::Instruction* MemPass::GetPtr( - ir::Instruction* ip, uint32_t* varId) { - const SpvOp op = ip->opcode(); - assert(op == SpvOpStore || op == SpvOpLoad); - const uint32_t ptrId = ip->GetSingleWordInOperand( - op == SpvOpStore ? kStorePtrIdInIdx : kLoadPtrIdInIdx); - return GetPtr(ptrId, varId); -} - -bool MemPass::IsTargetVar(uint32_t varId) { - if (seen_non_target_vars_.find(varId) != seen_non_target_vars_.end()) - return false; - if (seen_target_vars_.find(varId) != seen_target_vars_.end()) - return true; - const ir::Instruction* varInst = def_use_mgr_->GetDef(varId); - if (varInst->opcode() != SpvOpVariable) - return false;; - const uint32_t varTypeId = varInst->type_id(); - const ir::Instruction* varTypeInst = def_use_mgr_->GetDef(varTypeId); - if (varTypeInst->GetSingleWordInOperand(kTypePointerStorageClassInIdx) != - SpvStorageClassFunction) { - seen_non_target_vars_.insert(varId); - return false; - } - const uint32_t varPteTypeId = - varTypeInst->GetSingleWordInOperand(kTypePointerTypeIdInIdx); - ir::Instruction* varPteTypeInst = def_use_mgr_->GetDef(varPteTypeId); - if (!IsTargetType(varPteTypeInst)) { - seen_non_target_vars_.insert(varId); - return false; - } - seen_target_vars_.insert(varId); - return true; -} - -void MemPass::FindNamedOrDecoratedIds() { - named_or_decorated_ids_.clear(); - for (auto& di : module_->debugs2()) - if (di.opcode() == SpvOpName) - named_or_decorated_ids_.insert(di.GetSingleWordInOperand(0)); - for (auto& ai : module_->annotations()) - if (ai.opcode() == SpvOpDecorate || ai.opcode() == SpvOpDecorateId) - named_or_decorated_ids_.insert(ai.GetSingleWordInOperand(0)); -} - -bool MemPass::HasOnlyNamesAndDecorates(uint32_t id) const { - analysis::UseList* uses = def_use_mgr_->GetUses(id); - if (uses == nullptr) - return true; - if (named_or_decorated_ids_.find(id) == named_or_decorated_ids_.end()) - return false; - for (auto u : *uses) { - const SpvOp op = u.inst->opcode(); - if (op != SpvOpName && !IsNonTypeDecorate(op)) - return false; - } - return true; -} - -void MemPass::KillNamesAndDecorates(uint32_t id) { - // TODO(greg-lunarg): Remove id from any OpGroupDecorate and - // kill if no other operands. - if (named_or_decorated_ids_.find(id) == named_or_decorated_ids_.end()) - return; - analysis::UseList* uses = def_use_mgr_->GetUses(id); - if (uses == nullptr) - return; - std::list killList; - for (auto u : *uses) { - const SpvOp op = u.inst->opcode(); - if (op == SpvOpName || IsNonTypeDecorate(op)) - killList.push_back(u.inst); - } - for (auto kip : killList) - def_use_mgr_->KillInst(kip); -} - -void MemPass::KillNamesAndDecorates(ir::Instruction* inst) { - const uint32_t rId = inst->result_id(); - if (rId == 0) - return; - KillNamesAndDecorates(rId); -} - -bool MemPass::HasLoads(uint32_t varId) const { - analysis::UseList* uses = def_use_mgr_->GetUses(varId); - if (uses == nullptr) - return false; - for (auto u : *uses) { - SpvOp op = u.inst->opcode(); - // TODO(): The following is slightly conservative. Could be - // better handling of non-store/name. - if (IsNonPtrAccessChain(op) || op == SpvOpCopyObject) { - if (HasLoads(u.inst->result_id())) - return true; - } - else if (op != SpvOpStore && op != SpvOpName) - return true; - } - return false; -} - -bool MemPass::IsLiveVar(uint32_t varId) const { - const ir::Instruction* varInst = def_use_mgr_->GetDef(varId); - // assume live if not a variable eg. function parameter - if (varInst->opcode() != SpvOpVariable) - return true; - // non-function scope vars are live - const uint32_t varTypeId = varInst->type_id(); - const ir::Instruction* varTypeInst = def_use_mgr_->GetDef(varTypeId); - if (varTypeInst->GetSingleWordInOperand(kTypePointerStorageClassInIdx) != - SpvStorageClassFunction) - return true; - // test if variable is loaded from - return HasLoads(varId); -} - -bool MemPass::IsLiveStore(ir::Instruction* storeInst) { - // get store's variable - uint32_t varId; - (void) GetPtr(storeInst, &varId); - return IsLiveVar(varId); -} - -void MemPass::AddStores( - uint32_t ptr_id, std::queue* insts) { - analysis::UseList* uses = def_use_mgr_->GetUses(ptr_id); - if (uses != nullptr) { - for (auto u : *uses) { - if (IsNonPtrAccessChain(u.inst->opcode())) - AddStores(u.inst->result_id(), insts); - else if (u.inst->opcode() == SpvOpStore) - insts->push(u.inst); - } - } -} - -void MemPass::DCEInst(ir::Instruction* inst) { - std::queue deadInsts; - deadInsts.push(inst); - while (!deadInsts.empty()) { - ir::Instruction* di = deadInsts.front(); - // Don't delete labels - if (di->opcode() == SpvOpLabel) { - deadInsts.pop(); - continue; - } - // Remember operands - std::vector ids; - di->ForEachInId([&ids](uint32_t* iid) { - ids.push_back(*iid); - }); - uint32_t varId = 0; - // Remember variable if dead load - if (di->opcode() == SpvOpLoad) - (void) GetPtr(di, &varId); - KillNamesAndDecorates(di); - def_use_mgr_->KillInst(di); - // For all operands with no remaining uses, add their instruction - // to the dead instruction queue. - for (auto id : ids) - if (HasOnlyNamesAndDecorates(id)) - deadInsts.push(def_use_mgr_->GetDef(id)); - // if a load was deleted and it was the variable's - // last load, add all its stores to dead queue - if (varId != 0 && !IsLiveVar(varId)) - AddStores(varId, &deadInsts); - deadInsts.pop(); - } -} - -void MemPass::ReplaceAndDeleteLoad( - ir::Instruction* loadInst, uint32_t replId) { - const uint32_t loadId = loadInst->result_id(); - KillNamesAndDecorates(loadId); - (void) def_use_mgr_->ReplaceAllUsesWith(loadId, replId); - DCEInst(loadInst); -} - -MemPass::MemPass() : module_(nullptr), def_use_mgr_(nullptr), next_id_(0) {} - -} // namespace opt -} // namespace spvtools - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/mem_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/mem_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/mem_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/mem_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,154 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#ifndef LIBSPIRV_OPT_OPT_PASS_H_ -#define LIBSPIRV_OPT_OPT_PASS_H_ - - -#include -#include -#include -#include -#include -#include - -#include "basic_block.h" -#include "def_use_manager.h" -#include "module.h" -#include "pass.h" - -namespace spvtools { -namespace opt { - -// A common base class for mem2reg-type passes. Provides common -// utility functions and supporting state. -class MemPass : public Pass { - public: - MemPass(); - virtual ~MemPass() = default; - - protected: - // Returns true if |typeInst| is a scalar type - // or a vector or matrix - bool IsBaseTargetType(const ir::Instruction* typeInst) const; - - // Returns true if |typeInst| is a math type or a struct or array - // of a math type. - // TODO(): Add more complex types to convert - bool IsTargetType(const ir::Instruction* typeInst) const; - - // Returns true if |opcode| is a non-ptr access chain op - bool IsNonPtrAccessChain(const SpvOp opcode) const; - - // Given the id |ptrId|, return true if the top-most non-CopyObj is - // a variable, a non-ptr access chain or a parameter of pointer type. - bool IsPtr(uint32_t ptrId); - - // Given the id of a pointer |ptrId|, return the top-most non-CopyObj. - // Also return the base variable's id in |varId|. - ir::Instruction* GetPtr(uint32_t ptrId, uint32_t* varId); - - // Given a load or store |ip|, return the pointer instruction. - // Also return the base variable's id in |varId|. - ir::Instruction* GetPtr(ir::Instruction* ip, uint32_t* varId); - - // Return true if |varId| is a previously identified target variable. - // Return false if |varId| is a previously identified non-target variable. - // See FindTargetVars() for definition of target variable. If variable is - // not cached, return true if variable is a function scope variable of - // target type, false otherwise. Updates caches of target and non-target - // variables. - bool IsTargetVar(uint32_t varId); - - // Return true if all uses of |id| are only name or decorate ops. - bool HasOnlyNamesAndDecorates(uint32_t id) const; - - // Kill all name and decorate ops using |inst| - void KillNamesAndDecorates(ir::Instruction* inst); - - // Kill all name and decorate ops using |id| - void KillNamesAndDecorates(uint32_t id); - - // Collect all named or decorated ids in module - void FindNamedOrDecoratedIds(); - - // Return true if any instruction loads from |varId| - bool HasLoads(uint32_t varId) const; - - // Return true if |varId| is not a function variable or if it has - // a load - bool IsLiveVar(uint32_t varId) const; - - // Return true if |storeInst| is not a function variable or if its - // base variable has a load - bool IsLiveStore(ir::Instruction* storeInst); - - // Add stores using |ptr_id| to |insts| - void AddStores(uint32_t ptr_id, std::queue* insts); - - // Delete |inst| and iterate DCE on all its operands if they are now - // useless. If a load is deleted and its variable has no other loads, - // delete all its variable's stores. - void DCEInst(ir::Instruction* inst); - - // Replace all instances of |loadInst|'s id with |replId| and delete - // |loadInst|. - void ReplaceAndDeleteLoad(ir::Instruction* loadInst, uint32_t replId); - - // Return true if |op| is supported decorate. - inline bool IsNonTypeDecorate(uint32_t op) const { - return (op == SpvOpDecorate || op == SpvOpDecorateId); - } - - // Initialize next available id from |module|. - void InitNextId() { - next_id_ = module_->IdBound(); - } - - // Save next available id into |module|. - void FinalizeNextId() { - module_->SetIdBound(next_id_); - } - - // Return next available id and calculate next. - inline uint32_t TakeNextId() { - return next_id_++; - } - - // Module this pass is processing - ir::Module* module_; - - // Def-Uses for the module we are processing - std::unique_ptr def_use_mgr_; - - // Cache of verified target vars - std::unordered_set seen_target_vars_; - - // Cache of verified non-target vars - std::unordered_set seen_non_target_vars_; - - // named or decorated ids - std::unordered_set named_or_decorated_ids_; - - // Next unused ID - uint32_t next_id_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_OPT_PASS_H_ - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/module.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/module.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/module.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/module.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,167 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "module.h" - -#include -#include - -#include "operand.h" -#include "reflect.h" - -namespace spvtools { -namespace ir { - -std::vector Module::GetTypes() { - std::vector insts; - for (uint32_t i = 0; i < types_values_.size(); ++i) { - if (IsTypeInst(types_values_[i]->opcode())) - insts.push_back(types_values_[i].get()); - } - return insts; -}; - -std::vector Module::GetTypes() const { - std::vector insts; - for (uint32_t i = 0; i < types_values_.size(); ++i) { - if (IsTypeInst(types_values_[i]->opcode())) - insts.push_back(types_values_[i].get()); - } - return insts; -}; - -std::vector Module::GetConstants() { - std::vector insts; - for (uint32_t i = 0; i < types_values_.size(); ++i) { - if (IsConstantInst(types_values_[i]->opcode())) - insts.push_back(types_values_[i].get()); - } - return insts; -}; - -std::vector Module::GetConstants() const { - std::vector insts; - for (uint32_t i = 0; i < types_values_.size(); ++i) { - if (IsConstantInst(types_values_[i]->opcode())) - insts.push_back(types_values_[i].get()); - } - return insts; -}; - -uint32_t Module::GetGlobalValue(SpvOp opcode) const { - for (uint32_t i = 0; i < types_values_.size(); ++i) { - if (types_values_[i]->opcode() == opcode) - return types_values_[i]->result_id(); - } - return 0; -} - -void Module::AddGlobalValue(SpvOp opcode, uint32_t result_id, - uint32_t type_id) { - std::unique_ptr newGlobal( - new ir::Instruction(opcode, type_id, result_id, {})); - AddGlobalValue(std::move(newGlobal)); -} - -void Module::ForEachInst(const std::function& f, - bool run_on_debug_line_insts) { -#define DELEGATE(i) i->ForEachInst(f, run_on_debug_line_insts) - for (auto& i : capabilities_) DELEGATE(i); - for (auto& i : extensions_) DELEGATE(i); - for (auto& i : ext_inst_imports_) DELEGATE(i); - if (memory_model_) DELEGATE(memory_model_); - for (auto& i : entry_points_) DELEGATE(i); - for (auto& i : execution_modes_) DELEGATE(i); - for (auto& i : debugs1_) DELEGATE(i); - for (auto& i : debugs2_) DELEGATE(i); - for (auto& i : debugs3_) DELEGATE(i); - for (auto& i : annotations_) DELEGATE(i); - for (auto& i : types_values_) DELEGATE(i); - for (auto& i : functions_) DELEGATE(i); -#undef DELEGATE -} - -void Module::ForEachInst(const std::function& f, - bool run_on_debug_line_insts) const { -#define DELEGATE(i) \ - static_cast(i.get())->ForEachInst( \ - f, run_on_debug_line_insts) - for (auto& i : capabilities_) DELEGATE(i); - for (auto& i : extensions_) DELEGATE(i); - for (auto& i : ext_inst_imports_) DELEGATE(i); - if (memory_model_) DELEGATE(memory_model_); - for (auto& i : entry_points_) DELEGATE(i); - for (auto& i : execution_modes_) DELEGATE(i); - for (auto& i : debugs1_) DELEGATE(i); - for (auto& i : debugs2_) DELEGATE(i); - for (auto& i : debugs3_) DELEGATE(i); - for (auto& i : annotations_) DELEGATE(i); - for (auto& i : types_values_) DELEGATE(i); - for (auto& i : functions_) { - static_cast(i.get())->ForEachInst(f, - run_on_debug_line_insts); - } -#undef DELEGATE -} - -void Module::ToBinary(std::vector* binary, bool skip_nop) const { - binary->push_back(header_.magic_number); - binary->push_back(header_.version); - // TODO(antiagainst): should we change the generator number? - binary->push_back(header_.generator); - binary->push_back(header_.bound); - binary->push_back(header_.reserved); - - auto write_inst = [binary, skip_nop](const Instruction* i) { - if (!(skip_nop && i->IsNop())) i->ToBinaryWithoutAttachedDebugInsts(binary); - }; - ForEachInst(write_inst, true); -} - -uint32_t Module::ComputeIdBound() const { - uint32_t highest = 0; - - ForEachInst( - [&highest](const Instruction* inst) { - for (const auto& operand : *inst) { - if (spvIsIdType(operand.type)) { - highest = std::max(highest, operand.words[0]); - } - } - }, - true /* scan debug line insts as well */); - - return highest + 1; -} - -bool Module::HasCapability(uint32_t cap) { - for (auto& ci : capabilities_) { - uint32_t tcap = ci->GetSingleWordOperand(0); - if (tcap == cap) { - return true; - } - } - return false; -} - -uint32_t Module::GetExtInstImportId(const char* extstr) { - for (auto& ei : ext_inst_imports_) - if (!strcmp(extstr, reinterpret_cast( - &ei->GetInOperand(0).words[0]))) - return ei->result_id(); - return 0; -} - -} // namespace ir -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/module.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/module.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/module.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/module.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,448 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_MODULE_H_ -#define LIBSPIRV_OPT_MODULE_H_ - -#include -#include -#include -#include - -#include "function.h" -#include "instruction.h" -#include "iterator.h" - -namespace spvtools { -namespace ir { - -// A struct for containing the module header information. -struct ModuleHeader { - uint32_t magic_number; - uint32_t version; - uint32_t generator; - uint32_t bound; - uint32_t reserved; -}; - -// A SPIR-V module. It contains all the information for a SPIR-V module and -// serves as the backbone of optimization transformations. -class Module { - public: - using iterator = UptrVectorIterator; - using const_iterator = UptrVectorIterator; - using inst_iterator = UptrVectorIterator; - using const_inst_iterator = UptrVectorIterator; - - // Creates an empty module with zero'd header. - Module() : header_({}) {} - - // Sets the header to the given |header|. - void SetHeader(const ModuleHeader& header) { header_ = header; } - // Sets the Id bound. - void SetIdBound(uint32_t bound) { header_.bound = bound; } - // Returns the Id bound. - uint32_t IdBound() { return header_.bound; } - // Appends a capability instruction to this module. - inline void AddCapability(std::unique_ptr c); - // Appends an extension instruction to this module. - inline void AddExtension(std::unique_ptr e); - // Appends an extended instruction set instruction to this module. - inline void AddExtInstImport(std::unique_ptr e); - // Set the memory model for this module. - inline void SetMemoryModel(std::unique_ptr m); - // Appends an entry point instruction to this module. - inline void AddEntryPoint(std::unique_ptr e); - // Appends an execution mode instruction to this module. - inline void AddExecutionMode(std::unique_ptr e); - // Appends a debug 1 instruction (excluding OpLine & OpNoLine) to this module. - // "debug 1" instructions are the ones in layout section 7.a), see section - // 2.4 Logical Layout of a Module from the SPIR-V specification. - inline void AddDebug1Inst(std::unique_ptr d); - // Appends a debug 2 instruction (excluding OpLine & OpNoLine) to this module. - // "debug 2" instructions are the ones in layout section 7.b), see section - // 2.4 Logical Layout of a Module from the SPIR-V specification. - inline void AddDebug2Inst(std::unique_ptr d); - // Appends a debug 3 instruction (OpModuleProcessed) to this module. - // This is due to decision by the SPIR Working Group, pending publication. - inline void AddDebug3Inst(std::unique_ptr d); - // Appends an annotation instruction to this module. - inline void AddAnnotationInst(std::unique_ptr a); - // Appends a type-declaration instruction to this module. - inline void AddType(std::unique_ptr t); - // Appends a constant, global variable, or OpUndef instruction to this module. - inline void AddGlobalValue(std::unique_ptr v); - // Appends a function to this module. - inline void AddFunction(std::unique_ptr f); - - // Returns a vector of pointers to type-declaration instructions in this - // module. - std::vector GetTypes(); - std::vector GetTypes() const; - // Returns a vector of pointers to constant-creation instructions in this - // module. - std::vector GetConstants(); - std::vector GetConstants() const; - - // Return result id of global value with |opcode|, 0 if not present. - uint32_t GetGlobalValue(SpvOp opcode) const; - - // Add global value with |opcode|, |result_id| and |type_id| - void AddGlobalValue(SpvOp opcode, uint32_t result_id, uint32_t type_id); - - inline uint32_t id_bound() const { return header_.bound; } - - inline uint32_t version() const { return header_.version; } - - // Iterators for capabilities instructions contained in this module. - inline inst_iterator capability_begin(); - inline inst_iterator capability_end(); - inline IteratorRange capabilities(); - inline IteratorRange capabilities() const; - - // Iterators for ext_inst_imports instructions contained in this module. - inline inst_iterator ext_inst_import_begin(); - inline inst_iterator ext_inst_import_end(); - inline IteratorRange ext_inst_imports(); - inline IteratorRange ext_inst_imports() const; - - // Return the memory model instruction contained inthis module. - inline Instruction* GetMemoryModel() { return memory_model_.get(); } - inline const Instruction* GetMemoryModel() const { return memory_model_.get(); } - - // There are several kinds of debug instructions, according to where they can - // appear in the logical layout of a module: - // - Section 7a: OpString, OpSourceExtension, OpSource, OpSourceContinued - // - Section 7b: OpName, OpMemberName - // - Section 7c: OpModuleProcessed - // - Mostly anywhere: OpLine and OpNoLine - // - - // Iterators for debug 1 instructions (excluding OpLine & OpNoLine) contained - // in this module. These are for layout section 7a. - inline inst_iterator debug1_begin(); - inline inst_iterator debug1_end(); - inline IteratorRange debugs1(); - inline IteratorRange debugs1() const; - - // Iterators for debug 2 instructions (excluding OpLine & OpNoLine) contained - // in this module. These are for layout section 7b. - inline inst_iterator debug2_begin(); - inline inst_iterator debug2_end(); - inline IteratorRange debugs2(); - inline IteratorRange debugs2() const; - - // Iterators for debug 3 instructions (excluding OpLine & OpNoLine) contained - // in this module. These are for layout section 7c. - inline inst_iterator debug3_begin(); - inline inst_iterator debug3_end(); - inline IteratorRange debugs3(); - inline IteratorRange debugs3() const; - - // Iterators for entry point instructions contained in this module - inline IteratorRange entry_points(); - inline IteratorRange entry_points() const; - - // Iterators for execution_modes instructions contained in this module. - inline inst_iterator execution_mode_begin(); - inline inst_iterator execution_mode_end(); - inline IteratorRange execution_modes(); - inline IteratorRange execution_modes() const; - - // Clears all debug instructions (excluding OpLine & OpNoLine). - void debug_clear() { debug1_clear(); debug2_clear(); debug3_clear(); } - - // Clears all debug 1 instructions (excluding OpLine & OpNoLine). - void debug1_clear() { debugs1_.clear(); } - - // Clears all debug 2 instructions (excluding OpLine & OpNoLine). - void debug2_clear() { debugs2_.clear(); } - - // Clears all debug 3 instructions (excluding OpLine & OpNoLine). - void debug3_clear() { debugs3_.clear(); } - - // Iterators for annotation instructions contained in this module. - inline inst_iterator annotation_begin(); - inline inst_iterator annotation_end(); - IteratorRange annotations(); - IteratorRange annotations() const; - - // Iterators for extension instructions contained in this module. - inline inst_iterator extension_begin(); - inline inst_iterator extension_end(); - IteratorRange extensions(); - IteratorRange extensions() const; - - // Iterators for types, constants and global variables instructions. - inline inst_iterator types_values_begin(); - inline inst_iterator types_values_end(); - inline IteratorRange types_values(); - inline IteratorRange types_values() const; - - // Iterators for functions contained in this module. - iterator begin() { return iterator(&functions_, functions_.begin()); } - iterator end() { return iterator(&functions_, functions_.end()); } - inline const_iterator cbegin() const; - inline const_iterator cend() const; - - // Invokes function |f| on all instructions in this module, and optionally on - // the debug line instructions that precede them. - void ForEachInst(const std::function& f, - bool run_on_debug_line_insts = false); - void ForEachInst(const std::function& f, - bool run_on_debug_line_insts = false) const; - - // Pushes the binary segments for this instruction into the back of *|binary|. - // If |skip_nop| is true and this is a OpNop, do nothing. - void ToBinary(std::vector* binary, bool skip_nop) const; - - // Returns 1 more than the maximum Id value mentioned in the module. - uint32_t ComputeIdBound() const; - - // Returns true if module has capability |cap| - bool HasCapability(uint32_t cap); - - // Returns id for OpExtInst instruction for extension |extstr|. - // Returns 0 if not found. - uint32_t GetExtInstImportId(const char* extstr); - - private: - ModuleHeader header_; // Module header - - // The following fields respect the "Logical Layout of a Module" in - // Section 2.4 of the SPIR-V specification. - std::vector> capabilities_; - std::vector> extensions_; - std::vector> ext_inst_imports_; - // A module only has one memory model instruction. - std::unique_ptr memory_model_; - std::vector> entry_points_; - std::vector> execution_modes_; - std::vector> debugs1_; - std::vector> debugs2_; - std::vector> debugs3_; - std::vector> annotations_; - // Type declarations, constants, and global variable declarations. - std::vector> types_values_; - std::vector> functions_; -}; - -inline void Module::AddCapability(std::unique_ptr c) { - capabilities_.emplace_back(std::move(c)); -} - -inline void Module::AddExtension(std::unique_ptr e) { - extensions_.emplace_back(std::move(e)); -} - -inline void Module::AddExtInstImport(std::unique_ptr e) { - ext_inst_imports_.emplace_back(std::move(e)); -} - -inline void Module::SetMemoryModel(std::unique_ptr m) { - memory_model_ = std::move(m); -} - -inline void Module::AddEntryPoint(std::unique_ptr e) { - entry_points_.emplace_back(std::move(e)); -} - -inline void Module::AddExecutionMode(std::unique_ptr e) { - execution_modes_.emplace_back(std::move(e)); -} - -inline void Module::AddDebug1Inst(std::unique_ptr d) { - debugs1_.emplace_back(std::move(d)); -} - -inline void Module::AddDebug2Inst(std::unique_ptr d) { - debugs2_.emplace_back(std::move(d)); -} - -inline void Module::AddDebug3Inst(std::unique_ptr d) { - debugs3_.emplace_back(std::move(d)); -} - -inline void Module::AddAnnotationInst(std::unique_ptr a) { - annotations_.emplace_back(std::move(a)); -} - -inline void Module::AddType(std::unique_ptr t) { - types_values_.emplace_back(std::move(t)); -} - -inline void Module::AddGlobalValue(std::unique_ptr v) { - types_values_.emplace_back(std::move(v)); -} - -inline void Module::AddFunction(std::unique_ptr f) { - functions_.emplace_back(std::move(f)); -} - -inline Module::inst_iterator Module::capability_begin() { - return inst_iterator(&capabilities_, capabilities_.begin()); -} -inline Module::inst_iterator Module::capability_end() { - return inst_iterator(&capabilities_, capabilities_.end()); -} - -inline IteratorRange Module::capabilities() { - return make_range(capabilities_); -} - -inline IteratorRange Module::capabilities() const { - return make_const_range(capabilities_); -} - -inline Module::inst_iterator Module::ext_inst_import_begin() { - return inst_iterator(&ext_inst_imports_, ext_inst_imports_.begin()); -} -inline Module::inst_iterator Module::ext_inst_import_end() { - return inst_iterator(&ext_inst_imports_, ext_inst_imports_.end()); -} - -inline IteratorRange Module::ext_inst_imports() { - return make_range(ext_inst_imports_); -} - -inline IteratorRange Module::ext_inst_imports() const { - return make_const_range(ext_inst_imports_); -} - -inline Module::inst_iterator Module::debug1_begin() { - return inst_iterator(&debugs1_, debugs1_.begin()); -} -inline Module::inst_iterator Module::debug1_end() { - return inst_iterator(&debugs1_, debugs1_.end()); -} - -inline IteratorRange Module::debugs1() { - return make_range(debugs1_); -} - -inline IteratorRange Module::debugs1() const { - return make_const_range(debugs1_); -} - -inline Module::inst_iterator Module::debug2_begin() { - return inst_iterator(&debugs2_, debugs2_.begin()); -} -inline Module::inst_iterator Module::debug2_end() { - return inst_iterator(&debugs2_, debugs2_.end()); -} - -inline IteratorRange Module::debugs2() { - return make_range(debugs2_); -} - -inline IteratorRange Module::debugs2() const { - return make_const_range(debugs2_); -} - -inline Module::inst_iterator Module::debug3_begin() { - return inst_iterator(&debugs3_, debugs3_.begin()); -} -inline Module::inst_iterator Module::debug3_end() { - return inst_iterator(&debugs3_, debugs3_.end()); -} - -inline IteratorRange Module::debugs3() { - return make_range(debugs3_); -} - -inline IteratorRange Module::debugs3() const { - return make_const_range(debugs3_); -} - -inline IteratorRange Module::entry_points() { - return make_range(entry_points_); -} - -inline IteratorRange Module::entry_points() const { - return make_const_range(entry_points_); -} - -inline Module::inst_iterator Module::execution_mode_begin() { - return inst_iterator(&execution_modes_, execution_modes_.begin()); -} -inline Module::inst_iterator Module::execution_mode_end() { - return inst_iterator(&execution_modes_, execution_modes_.end()); -} - -inline IteratorRange Module::execution_modes() { - return make_range(execution_modes_); -} - -inline IteratorRange Module::execution_modes() const { - return make_const_range(execution_modes_); -} - -inline Module::inst_iterator Module::annotation_begin() { - return inst_iterator(&annotations_, annotations_.begin()); -} -inline Module::inst_iterator Module::annotation_end() { - return inst_iterator(&annotations_, annotations_.end()); -} - -inline IteratorRange Module::annotations() { - return make_range(annotations_); -} - -inline IteratorRange Module::annotations() const { - return make_const_range(annotations_); -} - -inline Module::inst_iterator Module::extension_begin() { - return inst_iterator(&extensions_, extensions_.begin()); -} -inline Module::inst_iterator Module::extension_end() { - return inst_iterator(&extensions_, extensions_.end()); -} - -inline IteratorRange Module::extensions() { - return make_range(extensions_); -} - -inline IteratorRange Module::extensions() const { - return make_const_range(extensions_); -} - -inline Module::inst_iterator Module::types_values_begin() { - return inst_iterator(&types_values_, types_values_.begin()); -} - -inline Module::inst_iterator Module::types_values_end() { - return inst_iterator(&types_values_, types_values_.end()); -} - -inline IteratorRange Module::types_values() { - return make_range(types_values_); -} - -inline IteratorRange Module::types_values() const { - return make_const_range(types_values_); -} - -inline Module::const_iterator Module::cbegin() const { - return const_iterator(&functions_, functions_.cbegin()); -} - -inline Module::const_iterator Module::cend() const { - return const_iterator(&functions_, functions_.cend()); -} - -} // namespace ir -} // namespace spvtools - -#endif // LIBSPIRV_OPT_MODULE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/null_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/null_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/null_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/null_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_NULL_PASS_H_ -#define LIBSPIRV_OPT_NULL_PASS_H_ - -#include "module.h" -#include "pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class NullPass : public Pass { - public: - const char* name() const override { return "null"; } - Status Process(ir::Module*) override { return Status::SuccessWithoutChange; } -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_NULL_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/optimizer.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/optimizer.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/optimizer.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/optimizer.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,251 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "spirv-tools/optimizer.hpp" - -#include "build_module.h" -#include "make_unique.h" -#include "pass_manager.h" -#include "passes.h" - -namespace spvtools { - -struct Optimizer::PassToken::Impl { - Impl(std::unique_ptr p) : pass(std::move(p)) {} - - std::unique_ptr pass; // Internal implementation pass. -}; - -Optimizer::PassToken::PassToken( - std::unique_ptr impl) - : impl_(std::move(impl)) {} -Optimizer::PassToken::PassToken(PassToken&& that) - : impl_(std::move(that.impl_)) {} - -Optimizer::PassToken& Optimizer::PassToken::operator=(PassToken&& that) { - impl_ = std::move(that.impl_); - return *this; -} - -Optimizer::PassToken::~PassToken() {} - -struct Optimizer::Impl { - explicit Impl(spv_target_env env) : target_env(env), pass_manager() {} - - const spv_target_env target_env; // Target environment. - opt::PassManager pass_manager; // Internal implementation pass manager. -}; - -Optimizer::Optimizer(spv_target_env env) : impl_(new Impl(env)) {} - -Optimizer::~Optimizer() {} - -void Optimizer::SetMessageConsumer(MessageConsumer c) { - // All passes' message consumer needs to be updated. - for (uint32_t i = 0; i < impl_->pass_manager.NumPasses(); ++i) { - impl_->pass_manager.GetPass(i)->SetMessageConsumer(c); - } - impl_->pass_manager.SetMessageConsumer(std::move(c)); -} - -Optimizer& Optimizer::RegisterPass(PassToken&& p) { - // Change to use the pass manager's consumer. - p.impl_->pass->SetMessageConsumer(impl_->pass_manager.consumer()); - impl_->pass_manager.AddPass(std::move(p.impl_->pass)); - return *this; -} - -Optimizer& Optimizer::RegisterPerformancePasses() { - return RegisterPass(CreateInlineExhaustivePass()) - .RegisterPass(CreateLocalAccessChainConvertPass()) - .RegisterPass(CreateLocalSingleBlockLoadStoreElimPass()) - .RegisterPass(CreateLocalSingleStoreElimPass()) - .RegisterPass(CreateInsertExtractElimPass()) - .RegisterPass(CreateAggressiveDCEPass()) - .RegisterPass(CreateDeadBranchElimPass()) - .RegisterPass(CreateBlockMergePass()) - .RegisterPass(CreateLocalMultiStoreElimPass()) - .RegisterPass(CreateInsertExtractElimPass()) - .RegisterPass(CreateCommonUniformElimPass()); -} - -Optimizer& Optimizer::RegisterSizePasses() { - return RegisterPass(CreateInlineExhaustivePass()) - .RegisterPass(CreateLocalAccessChainConvertPass()) - .RegisterPass(CreateLocalSingleBlockLoadStoreElimPass()) - .RegisterPass(CreateLocalSingleStoreElimPass()) - .RegisterPass(CreateInsertExtractElimPass()) - .RegisterPass(CreateAggressiveDCEPass()) - .RegisterPass(CreateDeadBranchElimPass()) - .RegisterPass(CreateBlockMergePass()) - .RegisterPass(CreateLocalMultiStoreElimPass()) - .RegisterPass(CreateInsertExtractElimPass()) - .RegisterPass(CreateCommonUniformElimPass()); -} - -bool Optimizer::Run(const uint32_t* original_binary, - const size_t original_binary_size, - std::vector* optimized_binary) const { - std::unique_ptr module = - BuildModule(impl_->target_env, impl_->pass_manager.consumer(), - original_binary, original_binary_size); - if (module == nullptr) return false; - - auto status = impl_->pass_manager.Run(module.get()); - if (status == opt::Pass::Status::SuccessWithChange || - (status == opt::Pass::Status::SuccessWithoutChange && - (optimized_binary->data() != original_binary || - optimized_binary->size() != original_binary_size))) { - optimized_binary->clear(); - module->ToBinary(optimized_binary, /* skip_nop = */ true); - } - - return status != opt::Pass::Status::Failure; -} - -Optimizer::PassToken CreateNullPass() { - return MakeUnique(MakeUnique()); -} - -Optimizer::PassToken CreateStripDebugInfoPass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateEliminateDeadFunctionsPass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateSetSpecConstantDefaultValuePass( - const std::unordered_map& id_value_map) { - return MakeUnique( - MakeUnique(id_value_map)); -} - -Optimizer::PassToken CreateSetSpecConstantDefaultValuePass( - const std::unordered_map>& id_value_map) { - return MakeUnique( - MakeUnique(id_value_map)); -} - -Optimizer::PassToken CreateFlattenDecorationPass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateFreezeSpecConstantValuePass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateFoldSpecConstantOpAndCompositePass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateUnifyConstantPass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateEliminateDeadConstantPass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateDeadVariableEliminationPass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateStrengthReductionPass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateBlockMergePass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateInlineExhaustivePass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateInlineOpaquePass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateLocalAccessChainConvertPass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateLocalSingleBlockLoadStoreElimPass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateLocalSingleStoreElimPass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateInsertExtractElimPass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateDeadBranchElimPass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateLocalMultiStoreElimPass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateAggressiveDCEPass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateCommonUniformElimPass() { - return MakeUnique( - MakeUnique()); -} - -Optimizer::PassToken CreateCompactIdsPass() { - return MakeUnique( - MakeUnique()); -} - -std::vector Optimizer::GetPassNames() const { - std::vector v; - for (uint32_t i = 0; i < impl_->pass_manager.NumPasses(); i++) { - v.push_back(impl_->pass_manager.GetPass(i)->name()); - } - return v; -} - -Optimizer::PassToken CreateCFGCleanupPass() { - return MakeUnique( - MakeUnique()); -} - -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,102 +0,0 @@ -// Copyright (c) 2017 The Khronos Group Inc. -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "pass.h" - -#include "iterator.h" - -namespace spvtools { -namespace opt { - -namespace { - -const uint32_t kEntryPointFunctionIdInIdx = 1; - -} // namespace - -void Pass::AddCalls(ir::Function* func, std::queue* todo) { - for (auto bi = func->begin(); bi != func->end(); ++bi) - for (auto ii = bi->begin(); ii != bi->end(); ++ii) - if (ii->opcode() == SpvOpFunctionCall) - todo->push(ii->GetSingleWordInOperand(0)); -} - -bool Pass::ProcessEntryPointCallTree(ProcessFunction& pfn, ir::Module* module) { - // Map from function's result id to function - std::unordered_map id2function; - for (auto& fn : *module) id2function[fn.result_id()] = &fn; - - // Collect all of the entry points as the roots. - std::queue roots; - for (auto& e : module->entry_points()) - roots.push(e.GetSingleWordInOperand(kEntryPointFunctionIdInIdx)); - return ProcessCallTreeFromRoots(pfn, id2function, &roots); -} - -bool Pass::ProcessReachableCallTree(ProcessFunction& pfn, ir::Module* module) { - // Map from function's result id to function - std::unordered_map id2function; - for (auto& fn : *module) id2function[fn.result_id()] = &fn; - - std::queue roots; - - // Add all entry points since they can be reached from outside the module. - for (auto& e : module->entry_points()) - roots.push(e.GetSingleWordInOperand(kEntryPointFunctionIdInIdx)); - - // Add all exported functions since they can be reached from outside the - // module. - for (auto& a : module->annotations()) { - // TODO: Handle group decorations as well. Currently not generate by any - // front-end, but could be coming. - if (a.opcode() == SpvOp::SpvOpDecorate) { - if (a.GetSingleWordOperand(1) == - SpvDecoration::SpvDecorationLinkageAttributes) { - uint32_t lastOperand = a.NumOperands() - 1; - if (a.GetSingleWordOperand(lastOperand) == - SpvLinkageType::SpvLinkageTypeExport) { - uint32_t id = a.GetSingleWordOperand(0); - if (id2function.count(id) != 0) roots.push(id); - } - } - } - } - - return ProcessCallTreeFromRoots(pfn, id2function, &roots); -} - -bool Pass::ProcessCallTreeFromRoots( - ProcessFunction& pfn, - const std::unordered_map& id2function, - std::queue* roots) { - // Process call tree - bool modified = false; - std::unordered_set done; - - while (!roots->empty()) { - const uint32_t fi = roots->front(); - roots->pop(); - if (done.insert(fi).second) { - ir::Function* fn = id2function.at(fi); - modified = pfn(fn) || modified; - AddCalls(fn, roots); - } - } - return modified; -} -} // namespace opt -} // namespace spvtools - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/passes.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/passes.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/passes.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/passes.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_PASSES_H_ -#define LIBSPIRV_OPT_PASSES_H_ - -// A single header to include all passes. - -#include "block_merge_pass.h" -#include "cfg_cleanup_pass.h" -#include "common_uniform_elim_pass.h" -#include "compact_ids_pass.h" -#include "dead_branch_elim_pass.h" -#include "dead_variable_elimination.h" -#include "eliminate_dead_constant_pass.h" -#include "flatten_decoration_pass.h" -#include "fold_spec_constant_op_and_composite_pass.h" -#include "inline_exhaustive_pass.h" -#include "inline_opaque_pass.h" -#include "insert_extract_elim.h" -#include "local_single_block_elim_pass.h" -#include "local_single_store_elim_pass.h" -#include "local_ssa_elim_pass.h" -#include "freeze_spec_constant_value_pass.h" -#include "local_access_chain_convert_pass.h" -#include "aggressive_dead_code_elim_pass.h" -#include "null_pass.h" -#include "set_spec_constant_default_value_pass.h" -#include "strength_reduction_pass.h" -#include "strip_debug_info_pass.h" -#include "unify_const_pass.h" -#include "eliminate_dead_functions_pass.h" - -#endif // LIBSPIRV_OPT_PASSES_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,106 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_PASS_H_ -#define LIBSPIRV_OPT_PASS_H_ - -#include -#include -#include -#include -#include - -#include - -#include "module.h" -#include "spirv-tools/libspirv.hpp" - -namespace spvtools { -namespace opt { - -// Abstract class of a pass. All passes should implement this abstract class -// and all analysis and transformation is done via the Process() method. -class Pass { - public: - // The status of processing a module using a pass. - // - // The numbers for the cases are assigned to make sure that Failure & anything - // is Failure, SuccessWithChange & any success is SuccessWithChange. - enum class Status { - Failure = 0x00, - SuccessWithChange = 0x10, - SuccessWithoutChange = 0x11, - }; - - using ProcessFunction = std::function; - - // Constructs a new pass. - // - // The constructed instance will have an empty message consumer, which just - // ignores all messages from the library. Use SetMessageConsumer() to supply - // one if messages are of concern. - Pass() : consumer_(nullptr) {} - - // Destructs the pass. - virtual ~Pass() = default; - - // Returns a descriptive name for this pass. - // - // NOTE: When deriving a new pass class, make sure you make the name - // compatible with the corresponding spirv-opt command-line flag. For example, - // if you add the flag --my-pass to spirv-opt, make this function return - // "my-pass" (no leading hyphens). - virtual const char* name() const = 0; - - // Sets the message consumer to the given |consumer|. |consumer| which will be - // invoked every time there is a message to be communicated to the outside. - void SetMessageConsumer(MessageConsumer c) { consumer_ = std::move(c); } - // Returns the reference to the message consumer for this pass. - const MessageConsumer& consumer() const { return consumer_; } - - // Add to |todo| all ids of functions called in |func|. - void AddCalls(ir::Function* func, std::queue* todo); - - // Applies |pfn| to every function in the call trees that are rooted at the - // entry points. Returns true if any call |pfn| returns true. By convention - // |pfn| should return true if it modified the module. - bool ProcessEntryPointCallTree(ProcessFunction& pfn, ir::Module* module); - - // Applies |pfn| to every function in the call trees rooted at the entry - // points and exported functions. Returns true if any call |pfn| returns - // true. By convention |pfn| should return true if it modified the module. - bool ProcessReachableCallTree(ProcessFunction& pfn, ir::Module* module); - - // Applies |pfn| to every function in the call trees rooted at the elements of - // |roots|. Returns true if any call to |pfn| returns true. By convention - // |pfn| should return true if it modified the module. After returning - // |roots| will be empty. - bool ProcessCallTreeFromRoots( - ProcessFunction& pfn, - const std::unordered_map& id2function, - std::queue* roots); - - // Processes the given |module|. Returns Status::Failure if errors occur when - // processing. Returns the corresponding Status::Success if processing is - // succesful to indicate whether changes are made to the module. - virtual Status Process(ir::Module* module) = 0; - - private: - MessageConsumer consumer_; // Message consumer. -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/pass_manager.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/pass_manager.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/pass_manager.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/pass_manager.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "pass_manager.h" - -namespace spvtools { -namespace opt { - -Pass::Status PassManager::Run(ir::Module* module) { - auto status = Pass::Status::SuccessWithoutChange; - for (const auto& pass : passes_) { - const auto one_status = pass->Process(module); - if (one_status == Pass::Status::Failure) return one_status; - if (one_status == Pass::Status::SuccessWithChange) status = one_status; - } - // Set the Id bound in the header in case a pass forgot to do so. - if (status == Pass::Status::SuccessWithChange) { - module->SetIdBound(module->ComputeIdBound()); - } - passes_.clear(); - return status; -} - -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/pass_manager.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/pass_manager.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/pass_manager.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/pass_manager.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,103 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_PASS_MANAGER_H_ -#define LIBSPIRV_OPT_PASS_MANAGER_H_ - -#include -#include - -#include "log.h" -#include "module.h" -#include "pass.h" - -#include "spirv-tools/libspirv.hpp" - -namespace spvtools { -namespace opt { - -// The pass manager, responsible for tracking and running passes. -// Clients should first call AddPass() to add passes and then call Run() -// to run on a module. Passes are executed in the exact order of addition. -class PassManager { - public: - // Constructs a pass manager. - // - // The constructed instance will have an empty message consumer, which just - // ignores all messages from the library. Use SetMessageConsumer() to supply - // one if messages are of concern. - PassManager() : consumer_(nullptr) {} - - // Sets the message consumer to the given |consumer|. - void SetMessageConsumer(MessageConsumer c) { consumer_ = std::move(c); } - - // Adds an externally constructed pass. - void AddPass(std::unique_ptr pass); - // Uses the argument |args| to construct a pass instance of type |T|, and adds - // the pass instance to this pass manger. The pass added will use this pass - // manager's message consumer. - template - void AddPass(Args&&... args); - - // Returns the number of passes added. - uint32_t NumPasses() const; - // Returns a pointer to the |index|th pass added. - inline Pass* GetPass(uint32_t index) const; - - // Returns the message consumer. - inline const MessageConsumer& consumer() const; - - // Runs all passes on the given |module|. Returns Status::Failure if errors - // occur when processing using one of the registered passes. All passes - // registered after the error-reporting pass will be skipped. Returns the - // corresponding Status::Success if processing is succesful to indicate - // whether changes are made to the module. - // - // After running all the passes, they are removed from the list. - Pass::Status Run(ir::Module* module); - - private: - // Consumer for messages. - MessageConsumer consumer_; - // A vector of passes. Order matters. - std::vector> passes_; -}; - -inline void PassManager::AddPass(std::unique_ptr pass) { - passes_.push_back(std::move(pass)); -} - -template -inline void PassManager::AddPass(Args&&... args) { - passes_.emplace_back(new T(std::forward(args)...)); - passes_.back()->SetMessageConsumer(consumer_); -} - -inline uint32_t PassManager::NumPasses() const { - return static_cast(passes_.size()); -} - -inline Pass* PassManager::GetPass(uint32_t index) const { - SPIRV_ASSERT(consumer_, index < passes_.size(), "index out of bound"); - return passes_[index].get(); -} - -inline const MessageConsumer& PassManager::consumer() const { - return consumer_; -} - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_PASS_MANAGER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/reflect.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/reflect.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/reflect.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/reflect.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_REFLECT_H_ -#define LIBSPIRV_OPT_REFLECT_H_ - -#include "spirv/1.2/spirv.h" - -namespace spvtools { -namespace ir { - -// Note that as SPIR-V evolves over time, new opcodes may appear. So the -// following functions tend to be outdated and should be updated when SPIR-V -// version bumps. - -inline bool IsDebug1Inst(SpvOp opcode) { - return (opcode >= SpvOpSourceContinued && opcode <= SpvOpSourceExtension) || - opcode == SpvOpString || opcode == SpvOpLine || opcode == SpvOpNoLine; -} -inline bool IsDebug2Inst(SpvOp opcode) { - return opcode == SpvOpName || opcode == SpvOpMemberName || - opcode == SpvOpNoLine; -} -inline bool IsDebug3Inst(SpvOp opcode) { - return opcode == SpvOpModuleProcessed; -} -inline bool IsDebugLineInst(SpvOp opcode) { - return opcode == SpvOpLine || opcode == SpvOpNoLine; -} -inline bool IsAnnotationInst(SpvOp opcode) { - return opcode >= SpvOpDecorate && opcode <= SpvOpGroupMemberDecorate; -} -inline bool IsTypeInst(SpvOp opcode) { - return (opcode >= SpvOpTypeVoid && opcode <= SpvOpTypeForwardPointer) || - opcode == SpvOpTypePipeStorage || opcode == SpvOpTypeNamedBarrier; -} -inline bool IsConstantInst(SpvOp opcode) { - return opcode >= SpvOpConstantTrue && opcode <= SpvOpSpecConstantOp; -} -inline bool IsTerminatorInst(SpvOp opcode) { - return opcode >= SpvOpBranch && opcode <= SpvOpUnreachable; -} - -} // namespace ir -} // namespace spvtools - -#endif // LIBSPIRV_OPT_REFLECT_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/remove_duplicates_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/remove_duplicates_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/remove_duplicates_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/remove_duplicates_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,274 +0,0 @@ -// Copyright (c) 2017 Pierre Moreau -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "remove_duplicates_pass.h" - -#include - -#include -#include -#include -#include -#include - -#include "decoration_manager.h" -#include "opcode.h" - -namespace spvtools { -namespace opt { - -using ir::Instruction; -using ir::Module; -using ir::Operand; -using opt::analysis::DefUseManager; -using opt::analysis::DecorationManager; - -Pass::Status RemoveDuplicatesPass::Process(Module* module) { - DefUseManager defUseManager(consumer(), module); - DecorationManager decManager(module); - - bool modified = RemoveDuplicateCapabilities(module); - modified |= RemoveDuplicatesExtInstImports(module, defUseManager); - modified |= RemoveDuplicateTypes(module, defUseManager, decManager); - modified |= RemoveDuplicateDecorations(module); - - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -bool RemoveDuplicatesPass::RemoveDuplicateCapabilities(Module* module) const { - bool modified = false; - - std::unordered_set capabilities; - for (auto i = module->capability_begin(); i != module->capability_end();) { - auto res = capabilities.insert(i->GetSingleWordOperand(0u)); - - if (res.second) { - // Never seen before, keep it. - ++i; - } else { - // It's a duplicate, remove it. - i = i.Erase(); - modified = true; - } - } - - return modified; -} - -bool RemoveDuplicatesPass::RemoveDuplicatesExtInstImports( - Module* module, analysis::DefUseManager& defUseManager) const { - bool modified = false; - - std::unordered_map extInstImports; - for (auto i = module->ext_inst_import_begin(); - i != module->ext_inst_import_end();) { - auto res = extInstImports.emplace( - reinterpret_cast(i->GetInOperand(0u).words.data()), - i->result_id()); - if (res.second) { - // Never seen before, keep it. - ++i; - } else { - // It's a duplicate, remove it. - defUseManager.ReplaceAllUsesWith(i->result_id(), res.first->second); - i = i.Erase(); - modified = true; - } - } - - return modified; -} - -bool RemoveDuplicatesPass::RemoveDuplicateTypes( - Module* module, DefUseManager& defUseManager, - DecorationManager& decManager) const { - bool modified = false; - - std::vector visitedTypes; - visitedTypes.reserve(module->types_values().size()); - - for (auto i = module->types_values_begin(); - i != module->types_values_end();) { - // We only care about types. - if (!spvOpcodeGeneratesType((i->opcode())) && - i->opcode() != SpvOpTypeForwardPointer) { - ++i; - continue; - } - - // Is the current type equal to one of the types we have aready visited? - SpvId idToKeep = 0u; - for (auto j : visitedTypes) { - if (AreTypesEqual(*i, j, defUseManager, decManager)) { - idToKeep = j.result_id(); - break; - } - } - - if (idToKeep == 0u) { - // This is a never seen before type, keep it around. - visitedTypes.emplace_back(*i); - ++i; - } else { - // The same type has already been seen before, remove this one. - defUseManager.ReplaceAllUsesWith(i->result_id(), idToKeep); - modified = true; - i = i.Erase(); - } - } - - return modified; -} - -bool RemoveDuplicatesPass::RemoveDuplicateDecorations( - ir::Module* module) const { - bool modified = false; - - std::unordered_map constants; - for (const auto& i : module->types_values()) - if (i.opcode() == SpvOpConstant) constants[i.result_id()] = &i; - for (const auto& i : module->types_values()) - if (i.opcode() == SpvOpConstant) constants[i.result_id()] = &i; - - std::vector visitedDecorations; - visitedDecorations.reserve(module->annotations().size()); - - opt::analysis::DecorationManager decorationManager(module); - for (auto i = module->annotation_begin(); i != module->annotation_end();) { - // Is the current decoration equal to one of the decorations we have aready - // visited? - bool alreadyVisited = false; - for (const Instruction* j : visitedDecorations) { - if (decorationManager.AreDecorationsTheSame(&*i, j)) { - alreadyVisited = true; - break; - } - } - - if (!alreadyVisited) { - // This is a never seen before decoration, keep it around. - visitedDecorations.emplace_back(&*i); - ++i; - } else { - // The same decoration has already been seen before, remove this one. - modified = true; - i = i.Erase(); - } - } - - return modified; -} - -bool RemoveDuplicatesPass::AreTypesEqual(const Instruction& inst1, - const Instruction& inst2, - const DefUseManager& defUseManager, - const DecorationManager& decManager) { - if (inst1.opcode() != inst2.opcode()) return false; - if (!decManager.HaveTheSameDecorations(inst1.result_id(), inst2.result_id())) - return false; - - switch (inst1.opcode()) { - case SpvOpTypeVoid: - case SpvOpTypeBool: - case SpvOpTypeSampler: - case SpvOpTypeEvent: - case SpvOpTypeDeviceEvent: - case SpvOpTypeReserveId: - case SpvOpTypeQueue: - case SpvOpTypePipeStorage: - case SpvOpTypeNamedBarrier: - return true; - case SpvOpTypeInt: - return inst1.GetSingleWordInOperand(0u) == - inst2.GetSingleWordInOperand(0u) && - inst1.GetSingleWordInOperand(1u) == - inst2.GetSingleWordInOperand(1u); - case SpvOpTypeFloat: - case SpvOpTypePipe: - case SpvOpTypeForwardPointer: - return inst1.GetSingleWordInOperand(0u) == - inst2.GetSingleWordInOperand(0u); - case SpvOpTypeVector: - case SpvOpTypeMatrix: - return AreTypesEqual( - *defUseManager.GetDef(inst1.GetSingleWordInOperand(0u)), - *defUseManager.GetDef(inst2.GetSingleWordInOperand(0u)), - defUseManager, decManager) && - inst1.GetSingleWordInOperand(1u) == - inst2.GetSingleWordInOperand(1u); - case SpvOpTypeImage: - return AreTypesEqual( - *defUseManager.GetDef(inst1.GetSingleWordInOperand(0u)), - *defUseManager.GetDef(inst2.GetSingleWordInOperand(0u)), - defUseManager, decManager) && - inst1.GetSingleWordInOperand(1u) == - inst2.GetSingleWordInOperand(1u) && - inst1.GetSingleWordInOperand(2u) == - inst2.GetSingleWordInOperand(2u) && - inst1.GetSingleWordInOperand(3u) == - inst2.GetSingleWordInOperand(3u) && - inst1.GetSingleWordInOperand(4u) == - inst2.GetSingleWordInOperand(4u) && - inst1.GetSingleWordInOperand(5u) == - inst2.GetSingleWordInOperand(5u) && - inst1.GetSingleWordInOperand(6u) == - inst2.GetSingleWordInOperand(6u) && - inst1.NumOperands() == inst2.NumOperands() && - (inst1.NumInOperands() == 7u || - inst1.GetSingleWordInOperand(7u) == - inst2.GetSingleWordInOperand(7u)); - case SpvOpTypeSampledImage: - case SpvOpTypeRuntimeArray: - return AreTypesEqual( - *defUseManager.GetDef(inst1.GetSingleWordInOperand(0u)), - *defUseManager.GetDef(inst2.GetSingleWordInOperand(0u)), - defUseManager, decManager); - case SpvOpTypeArray: - return AreTypesEqual( - *defUseManager.GetDef(inst1.GetSingleWordInOperand(0u)), - *defUseManager.GetDef(inst2.GetSingleWordInOperand(0u)), - defUseManager, decManager) && - AreTypesEqual( - *defUseManager.GetDef(inst1.GetSingleWordInOperand(1u)), - *defUseManager.GetDef(inst2.GetSingleWordInOperand(1u)), - defUseManager, decManager); - case SpvOpTypeStruct: - case SpvOpTypeFunction: { - bool res = inst1.NumInOperands() == inst2.NumInOperands(); - for (uint32_t i = 0u; i < inst1.NumInOperands() && res; ++i) - res &= AreTypesEqual( - *defUseManager.GetDef(inst1.GetSingleWordInOperand(i)), - *defUseManager.GetDef(inst2.GetSingleWordInOperand(i)), - defUseManager, decManager); - return res; - } - case SpvOpTypeOpaque: - return std::strcmp(reinterpret_cast( - inst1.GetInOperand(0u).words.data()), - reinterpret_cast( - inst2.GetInOperand(0u).words.data())) == 0; - case SpvOpTypePointer: - return inst1.GetSingleWordInOperand(0u) == - inst2.GetSingleWordInOperand(0u) && - AreTypesEqual( - *defUseManager.GetDef(inst1.GetSingleWordInOperand(1u)), - *defUseManager.GetDef(inst2.GetSingleWordInOperand(1u)), - defUseManager, decManager); - default: - return false; - } -} - -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/remove_duplicates_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/remove_duplicates_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/remove_duplicates_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/remove_duplicates_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -// Copyright (c) 2017 Pierre Moreau -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_REMOVE_DUPLICATES_PASS_H_ -#define LIBSPIRV_OPT_REMOVE_DUPLICATES_PASS_H_ - -#include - -#include "decoration_manager.h" -#include "def_use_manager.h" -#include "module.h" -#include "pass.h" - -namespace spvtools { -namespace opt { - -using IdDecorationsList = - std::unordered_map>; - -// See optimizer.hpp for documentation. -class RemoveDuplicatesPass : public Pass { - public: - const char* name() const override { return "remove-duplicates"; } - Status Process(ir::Module*) override; - // Returns whether two types are equal, and have the same decorations. - static bool AreTypesEqual(const ir::Instruction& inst1, - const ir::Instruction& inst2, - const analysis::DefUseManager& defUseManager, - const analysis::DecorationManager& decoManager); - - private: - bool RemoveDuplicateCapabilities(ir::Module* module) const; - bool RemoveDuplicatesExtInstImports( - ir::Module* module, analysis::DefUseManager& defUseManager) const; - bool RemoveDuplicateTypes(ir::Module* module, - analysis::DefUseManager& defUseManager, - analysis::DecorationManager& decManager) const; - bool RemoveDuplicateDecorations(ir::Module* module) const; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_REMOVE_DUPLICATES_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,365 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "set_spec_constant_default_value_pass.h" - -#include -#include -#include -#include -#include - -#include "def_use_manager.h" -#include "make_unique.h" -#include "spirv-tools/libspirv.h" -#include "type_manager.h" -#include "types.h" -#include "util/parse_number.h" - -namespace spvtools { -namespace opt { - -namespace { -using spvutils::NumberType; -using spvutils::EncodeNumberStatus; -using spvutils::ParseNumber; -using spvutils::ParseAndEncodeNumber; - -// Given a numeric value in a null-terminated c string and the expected type of -// the value, parses the string and encodes it in a vector of words. If the -// value is a scalar integer or floating point value, encodes the value in -// SPIR-V encoding format. If the value is 'false' or 'true', returns a vector -// with single word with value 0 or 1 respectively. Returns the vector -// containing the encoded value on success. Otherwise returns an empty vector. -std::vector ParseDefaultValueStr(const char* text, - const analysis::Type* type) { - std::vector result; - if (!strcmp(text, "true") && type->AsBool()) { - result.push_back(1u); - } else if (!strcmp(text, "false") && type->AsBool()) { - result.push_back(0u); - } else { - NumberType number_type = {32, SPV_NUMBER_UNSIGNED_INT}; - if (const auto* IT = type->AsInteger()) { - number_type.bitwidth = IT->width(); - number_type.kind = - IT->IsSigned() ? SPV_NUMBER_SIGNED_INT : SPV_NUMBER_UNSIGNED_INT; - } else if (const auto* FT = type->AsFloat()) { - number_type.bitwidth = FT->width(); - number_type.kind = SPV_NUMBER_FLOATING; - } else { - // Does not handle types other then boolean, integer or float. Returns - // empty vector. - result.clear(); - return result; - } - EncodeNumberStatus rc = ParseAndEncodeNumber( - text, number_type, [&result](uint32_t word) { result.push_back(word); }, - nullptr); - // Clear the result vector on failure. - if (rc != EncodeNumberStatus::kSuccess) { - result.clear(); - } - } - return result; -} - -// Given a bit pattern and a type, checks if the bit pattern is compatible -// with the type. If so, returns the bit pattern, otherwise returns an empty -// bit pattern. If the given bit pattern is empty, returns an empty bit -// pattern. If the given type represents a SPIR-V Boolean type, the bit pattern -// to be returned is determined with the following standard: -// If any words in the input bit pattern are non zero, returns a bit pattern -// with 0x1, which represents a 'true'. -// If all words in the bit pattern are zero, returns a bit pattern with 0x0, -// which represents a 'false'. -std::vector ParseDefaultValueBitPattern( - const std::vector& input_bit_pattern, - const analysis::Type* type) { - std::vector result; - if (type->AsBool()) { - if (std::any_of(input_bit_pattern.begin(), input_bit_pattern.end(), - [](uint32_t i) { return i != 0; })) { - result.push_back(1u); - } else { - result.push_back(0u); - } - return result; - } else if (const auto* IT = type->AsInteger()) { - if (IT->width() == input_bit_pattern.size() * sizeof(uint32_t) * 8) { - return std::vector(input_bit_pattern); - } - } else if (const auto* FT = type->AsFloat()) { - if (FT->width() == input_bit_pattern.size() * sizeof(uint32_t) * 8) { - return std::vector(input_bit_pattern); - } - } - result.clear(); - return result; -} - -// Returns true if the given instruction's result id could have a SpecId -// decoration. -bool CanHaveSpecIdDecoration(const ir::Instruction& inst) { - switch (inst.opcode()) { - case SpvOp::SpvOpSpecConstant: - case SpvOp::SpvOpSpecConstantFalse: - case SpvOp::SpvOpSpecConstantTrue: - return true; - default: - return false; - } -} - -// Given a decoration group defining instruction that is decorated with SpecId -// decoration, finds the spec constant defining instruction which is the real -// target of the SpecId decoration. Returns the spec constant defining -// instruction if such an instruction is found, otherwise returns a nullptr. -ir::Instruction* GetSpecIdTargetFromDecorationGroup( - const ir::Instruction& decoration_group_defining_inst, - analysis::DefUseManager* def_use_mgr) { - // Find the OpGroupDecorate instruction which consumes the given decoration - // group. Note that the given decoration group has SpecId decoration, which - // is unique for different spec constants. So the decoration group cannot be - // consumed by different OpGroupDecorate instructions. Therefore we only need - // the first OpGroupDecoration instruction that uses the given decoration - // group. - ir::Instruction* group_decorate_inst = nullptr; - for (const auto& u : - *def_use_mgr->GetUses(decoration_group_defining_inst.result_id())) { - if (u.inst->opcode() == SpvOp::SpvOpGroupDecorate) { - group_decorate_inst = u.inst; - break; - } - } - if (!group_decorate_inst) return nullptr; - - // Scan through the target ids of the OpGroupDecorate instruction. There - // should be only one spec constant target consumes the SpecId decoration. - // If multiple target ids are presented in the OpGroupDecorate instruction, - // they must be the same one that defined by an eligible spec constant - // instruction. If the OpGroupDecorate instruction has different target ids - // or a target id is not defined by an eligible spec cosntant instruction, - // returns a nullptr. - ir::Instruction* target_inst = nullptr; - for (uint32_t i = 1; i < group_decorate_inst->NumInOperands(); i++) { - // All the operands of a OpGroupDecorate instruction should be of type - // SPV_OPERAND_TYPE_ID. - uint32_t candidate_id = group_decorate_inst->GetSingleWordInOperand(i); - ir::Instruction* candidate_inst = def_use_mgr->GetDef(candidate_id); - - if (!candidate_inst) { - continue; - } - - if (!target_inst) { - // If the spec constant target has not been found yet, check if the - // candidate instruction is the target. - if (CanHaveSpecIdDecoration(*candidate_inst)) { - target_inst = candidate_inst; - } else { - // Spec id decoration should not be applied on other instructions. - // TODO(qining): Emit an error message in the invalid case once the - // error handling is done. - return nullptr; - } - } else { - // If the spec constant target has been found, check if the candidate - // instruction is the same one as the target. The module is invalid if - // the candidate instruction is different with the found target. - // TODO(qining): Emit an error messaage in the invalid case once the - // error handling is done. - if (candidate_inst != target_inst) return nullptr; - } - } - return target_inst; -} -}; - -Pass::Status SetSpecConstantDefaultValuePass::Process(ir::Module* module) { - // The operand index of decoration target in an OpDecorate instruction. - const uint32_t kTargetIdOperandIndex = 0; - // The operand index of the decoration literal in an OpDecorate instruction. - const uint32_t kDecorationOperandIndex = 1; - // The operand index of Spec id literal value in an OpDecorate SpecId - // instruction. - const uint32_t kSpecIdLiteralOperandIndex = 2; - // The number of operands in an OpDecorate SpecId instruction. - const uint32_t kOpDecorateSpecIdNumOperands = 3; - // The in-operand index of the default value in a OpSpecConstant instruction. - const uint32_t kOpSpecConstantLiteralInOperandIndex = 0; - - bool modified = false; - analysis::DefUseManager def_use_mgr(consumer(), module); - analysis::TypeManager type_mgr(consumer(), *module); - // Scan through all the annotation instructions to find 'OpDecorate SpecId' - // instructions. Then extract the decoration target of those instructions. - // The decoration targets should be spec constant defining instructions with - // opcode: OpSpecConstant{|True|False}. The spec id of those spec constants - // will be used to look up their new default values in the mapping from - // spec id to new default value strings. Once a new default value string - // is found for a spec id, the string will be parsed according to the target - // spec constant type. The parsed value will be used to replace the original - // default value of the target spec constant. - for (ir::Instruction& inst : module->annotations()) { - // Only process 'OpDecorate SpecId' instructions - if (inst.opcode() != SpvOp::SpvOpDecorate) continue; - if (inst.NumOperands() != kOpDecorateSpecIdNumOperands) continue; - if (inst.GetSingleWordInOperand(kDecorationOperandIndex) != - uint32_t(SpvDecoration::SpvDecorationSpecId)) { - continue; - } - - // 'inst' is an OpDecorate SpecId instruction. - uint32_t spec_id = inst.GetSingleWordOperand(kSpecIdLiteralOperandIndex); - uint32_t target_id = inst.GetSingleWordOperand(kTargetIdOperandIndex); - - // Find the spec constant defining instruction. Note that the - // target_id might be a decoration group id. - ir::Instruction* spec_inst = nullptr; - if (ir::Instruction* target_inst = def_use_mgr.GetDef(target_id)) { - if (target_inst->opcode() == SpvOp::SpvOpDecorationGroup) { - spec_inst = - GetSpecIdTargetFromDecorationGroup(*target_inst, &def_use_mgr); - } else { - spec_inst = target_inst; - } - } else { - continue; - } - if (!spec_inst) continue; - - // Get the default value bit pattern for this spec id. - std::vector bit_pattern; - - if (spec_id_to_value_str_.size() != 0) { - // Search for the new string-form default value for this spec id. - auto iter = spec_id_to_value_str_.find(spec_id); - if (iter == spec_id_to_value_str_.end()) { - continue; - } - - // Gets the string of the default value and parses it to bit pattern - // with the type of the spec constant. - const std::string& default_value_str = iter->second; - bit_pattern = ParseDefaultValueStr(default_value_str.c_str(), - type_mgr.GetType(spec_inst->type_id())); - - } else { - // Search for the new bit-pattern-form default value for this spec id. - auto iter = spec_id_to_value_bit_pattern_.find(spec_id); - if (iter == spec_id_to_value_bit_pattern_.end()) { - continue; - } - - // Gets the bit-pattern of the default value from the map directly. - bit_pattern = ParseDefaultValueBitPattern( - iter->second, type_mgr.GetType(spec_inst->type_id())); - } - - if (bit_pattern.empty()) continue; - - // Update the operand bit patterns of the spec constant defining - // instruction. - switch (spec_inst->opcode()) { - case SpvOp::SpvOpSpecConstant: - // If the new value is the same with the original value, no - // need to do anything. Otherwise update the operand words. - if (spec_inst->GetInOperand(kOpSpecConstantLiteralInOperandIndex) - .words != bit_pattern) { - spec_inst->SetInOperand(kOpSpecConstantLiteralInOperandIndex, - std::move(bit_pattern)); - modified = true; - } - break; - case SpvOp::SpvOpSpecConstantTrue: - // If the new value is also 'true', no need to change anything. - // Otherwise, set the opcode to OpSpecConstantFalse; - if (!static_cast(bit_pattern.front())) { - spec_inst->SetOpcode(SpvOp::SpvOpSpecConstantFalse); - modified = true; - } - break; - case SpvOp::SpvOpSpecConstantFalse: - // If the new value is also 'false', no need to change anything. - // Otherwise, set the opcode to OpSpecConstantTrue; - if (static_cast(bit_pattern.front())) { - spec_inst->SetOpcode(SpvOp::SpvOpSpecConstantTrue); - modified = true; - } - break; - default: - break; - } - // No need to update the DefUse manager, as this pass does not change any - // ids. - } - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -// Returns true if the given char is ':', '\0' or considered as blank space -// (i.e.: '\n', '\r', '\v', '\t', '\f' and ' '). -bool IsSeparator(char ch) { - return std::strchr(":\0", ch) || std::isspace(ch) != 0; -} - -std::unique_ptr -SetSpecConstantDefaultValuePass::ParseDefaultValuesString(const char* str) { - if (!str) return nullptr; - - auto spec_id_to_value = MakeUnique(); - - // The parsing loop, break when points to the end. - while (*str) { - // Find the spec id. - while (std::isspace(*str)) str++; // skip leading spaces. - const char* entry_begin = str; - while (!IsSeparator(*str)) str++; - const char* entry_end = str; - std::string spec_id_str(entry_begin, entry_end - entry_begin); - uint32_t spec_id = 0; - if (!ParseNumber(spec_id_str.c_str(), &spec_id)) { - // The spec id is not a valid uint32 number. - return nullptr; - } - auto iter = spec_id_to_value->find(spec_id); - if (iter != spec_id_to_value->end()) { - // Same spec id has been defined before - return nullptr; - } - // Find the ':', spaces between the spec id and the ':' are not allowed. - if (*str++ != ':') { - // ':' not found - return nullptr; - } - // Find the value string - const char* val_begin = str; - while (!IsSeparator(*str)) str++; - const char* val_end = str; - if (val_end == val_begin) { - // Value string is empty. - return nullptr; - } - // Update the mapping with spec id and value string. - (*spec_id_to_value)[spec_id] = std::string(val_begin, val_end - val_begin); - - // Skip trailing spaces. - while (std::isspace(*str)) str++; - } - - return spec_id_to_value; -} - -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/set_spec_constant_default_value_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/set_spec_constant_default_value_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/set_spec_constant_default_value_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/set_spec_constant_default_value_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_SET_SPEC_CONSTANT_DEFAULT_VALUE_PASS_H_ -#define LIBSPIRV_OPT_SET_SPEC_CONSTANT_DEFAULT_VALUE_PASS_H_ - -#include -#include -#include - -#include "module.h" -#include "pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class SetSpecConstantDefaultValuePass : public Pass { - public: - using SpecIdToValueStrMap = std::unordered_map; - using SpecIdToValueBitPatternMap = - std::unordered_map>; - using SpecIdToInstMap = std::unordered_map; - - // Constructs a pass instance with a map from spec ids to default values - // in the form of string. - explicit SetSpecConstantDefaultValuePass( - const SpecIdToValueStrMap& default_values) - : spec_id_to_value_str_(default_values), spec_id_to_value_bit_pattern_() {} - explicit SetSpecConstantDefaultValuePass(SpecIdToValueStrMap&& default_values) - : spec_id_to_value_str_(std::move(default_values)), spec_id_to_value_bit_pattern_() {} - - // Constructs a pass instance with a map from spec ids to default values in - // the form of bit pattern. - explicit SetSpecConstantDefaultValuePass( - const SpecIdToValueBitPatternMap& default_values) - : spec_id_to_value_str_(), spec_id_to_value_bit_pattern_(default_values) {} - explicit SetSpecConstantDefaultValuePass(SpecIdToValueBitPatternMap&& default_values) - : spec_id_to_value_str_(), spec_id_to_value_bit_pattern_(std::move(default_values)) {} - - const char* name() const override { return "set-spec-const-default-value"; } - Status Process(ir::Module*) override; - - // Parses the given null-terminated C string to get a mapping from Spec Id to - // default value strings. Returns a unique pointer of the mapping from spec - // ids to spec constant default value strings built from the given |str| on - // success. Returns a nullptr if the given string is not valid for building - // the mapping. - // A valid string for building the mapping should follow the rule below: - // - // ": : ..." - // Example: - // "200:0x11 201:3.14 202:1.4728" - // - // Entries are separated with blank spaces (i.e.:' ', '\n', '\r', '\t', - // '\f', '\v'). Each entry corresponds to a Spec Id and default value pair. - // Multiple spaces between, before or after entries are allowed. However, - // spaces are not allowed within spec id or the default value string because - // spaces are always considered as delimiter to separate entries. - // - // In each entry, the spec id and value string is separated by ':'. Missing - // ':' in any entry is invalid. And it is invalid to have blank spaces in - // between the spec id and ':' or the default value and ':'. - // - // : specifies the spec id value. - // The text must represent a valid uint32_t number. - // Hex format with '0x' prefix is allowed. - // Empty is not allowed. - // One spec id value can only be defined once, multiple default values - // defined for the same spec id is not allowed. Spec ids with same value - // but different formats (e.g. 0x100 and 256) are considered the same. - // - // : the default value string. - // Spaces before and after default value text is allowed. - // Spaces within the text is not allowed. - // Empty is not allowed. - static std::unique_ptr ParseDefaultValuesString( - const char* str); - - private: - // The mappings from spec ids to default values. Two maps are defined here, - // each to be used for one specific form of the default values. Only one of - // them will be populated in practice. - - // The mapping from spec ids to their string-form default values to be set. - const SpecIdToValueStrMap spec_id_to_value_str_; - // The mapping from spec ids to their bitpattern-form default values to be set. - const SpecIdToValueBitPatternMap spec_id_to_value_bit_pattern_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_SET_SPEC_CONSTANT_DEFAULT_VALUE_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/strength_reduction_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/strength_reduction_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/strength_reduction_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/strength_reduction_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,210 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include "strength_reduction_pass.h" - -#include -#include -#include -#include -#include - -#include "def_use_manager.h" -#include "log.h" -#include "reflect.h" - -namespace { -// Count the number of trailing zeros in the binary representation of -// |constVal|. -uint32_t CountTrailingZeros(uint32_t constVal) { - // Faster if we use the hardware count trailing zeros instruction. - // If not available, we could create a table. - uint32_t shiftAmount = 0; - while ((constVal & 1) == 0) { - ++shiftAmount; - constVal = (constVal >> 1); - } - return shiftAmount; -} - -// Return true if |val| is a power of 2. -bool IsPowerOf2(uint32_t val) { - // The idea is that the & will clear out the least - // significant 1 bit. If it is a power of 2, then - // there is exactly 1 bit set, and the value becomes 0. - if (val == 0) return false; - return ((val - 1) & val) == 0; -} - -} // namespace - -namespace spvtools { -namespace opt { - -Pass::Status StrengthReductionPass::Process(ir::Module* module) { - // Initialize the member variables on a per module basis. - bool modified = false; - def_use_mgr_.reset(new analysis::DefUseManager(consumer(), module)); - int32_type_id_ = 0; - uint32_type_id_ = 0; - std::memset(constant_ids_, 0, sizeof(constant_ids_)); - next_id_ = module->IdBound(); - module_ = module; - - FindIntTypesAndConstants(); - modified = ScanFunctions(); - // Have to reset the id bound. - module->SetIdBound(next_id_); - return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange); -} - -bool StrengthReductionPass::ReplaceMultiplyByPowerOf2( - ir::BasicBlock::iterator* instPtr) { - ir::BasicBlock::iterator& inst = *instPtr; - assert(inst->opcode() == SpvOp::SpvOpIMul && - "Only works for multiplication of integers."); - bool modified = false; - - // Currently only works on 32-bit integers. - if (inst->type_id() != int32_type_id_ && inst->type_id() != uint32_type_id_) { - return modified; - } - - // Check the operands for a constant that is a power of 2. - for (int i = 0; i < 2; i++) { - uint32_t opId = inst->GetSingleWordInOperand(i); - ir::Instruction* opInst = def_use_mgr_->GetDef(opId); - if (opInst->opcode() == SpvOp::SpvOpConstant) { - // We found a constant operand. - uint32_t constVal = opInst->GetSingleWordOperand(2); - - if (IsPowerOf2(constVal)) { - modified = true; - uint32_t shiftAmount = CountTrailingZeros(constVal); - uint32_t shiftConstResultId = GetConstantId(shiftAmount); - - // Create the new instruction. - uint32_t newResultId = next_id_++; - std::vector newOperands; - newOperands.push_back(inst->GetInOperand(1 - i)); - ir::Operand shiftOperand(spv_operand_type_t::SPV_OPERAND_TYPE_ID, - {shiftConstResultId}); - newOperands.push_back(shiftOperand); - std::unique_ptr newInstruction( - new ir::Instruction(SpvOp::SpvOpShiftLeftLogical, inst->type_id(), - newResultId, newOperands)); - - // Insert the new instruction and update the data structures. - def_use_mgr_->AnalyzeInstDefUse(&*newInstruction); - inst = inst.InsertBefore(std::move(newInstruction)); - ++inst; - def_use_mgr_->ReplaceAllUsesWith(inst->result_id(), newResultId); - - // Remove the old instruction. - def_use_mgr_->KillInst(&*inst); - - // We do not want to replace the instruction twice if both operands - // are constants that are a power of 2. So we break here. - break; - } - } - } - - return modified; -} - -void StrengthReductionPass::FindIntTypesAndConstants() { - for (auto iter = module_->types_values_begin(); - iter != module_->types_values_end(); ++iter) { - switch (iter->opcode()) { - case SpvOp::SpvOpTypeInt: - if (iter->GetSingleWordOperand(1) == 32) { - if (iter->GetSingleWordOperand(2) == 1) { - int32_type_id_ = iter->result_id(); - } else { - uint32_type_id_ = iter->result_id(); - } - } - break; - case SpvOp::SpvOpConstant: - if (iter->type_id() == uint32_type_id_) { - uint32_t value = iter->GetSingleWordOperand(2); - if (value <= 32) constant_ids_[value] = iter->result_id(); - } - break; - default: - break; - } - } -} - -uint32_t StrengthReductionPass::GetConstantId(uint32_t val) { - assert(val <= 32 && - "This function does not handle constants larger than 32."); - - if (constant_ids_[val] == 0) { - if (uint32_type_id_ == 0) { - uint32_type_id_ = CreateUint32Type(); - } - - // Construct the constant. - uint32_t resultId = next_id_++; - ir::Operand constant(spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - {val}); - std::unique_ptr newConstant(new ir::Instruction( - SpvOp::SpvOpConstant, uint32_type_id_, resultId, {constant})); - module_->AddGlobalValue(std::move(newConstant)); - - // Store the result id for next time. - constant_ids_[val] = resultId; - } - - return constant_ids_[val]; -} - -bool StrengthReductionPass::ScanFunctions() { - // I did not use |ForEachInst| in the module because the function that acts on - // the instruction gets a pointer to the instruction. We cannot use that to - // insert a new instruction. I want an iterator. - bool modified = false; - for (auto& func : *module_) { - for (auto& bb : func) { - for (auto inst = bb.begin(); inst != bb.end(); ++inst) { - switch (inst->opcode()) { - case SpvOp::SpvOpIMul: - if (ReplaceMultiplyByPowerOf2(&inst)) modified = true; - break; - default: - break; - } - } - } - } - return modified; -} - -uint32_t StrengthReductionPass::CreateUint32Type() { - uint32_t type_id = next_id_++; - ir::Operand widthOperand(spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - {32}); - ir::Operand signOperand(spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - {0}); - std::unique_ptr newType(new ir::Instruction( - SpvOp::SpvOpTypeInt, type_id, 0, {widthOperand, signOperand})); - module_->AddType(std::move(newType)); - return type_id; -} - -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/strength_reduction_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/strength_reduction_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/strength_reduction_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/strength_reduction_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_STRENGTH_REDUCTION_PASS_H_ -#define LIBSPIRV_OPT_STRENGTH_REDUCTION_PASS_H_ - -#include "def_use_manager.h" -#include "module.h" -#include "pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class StrengthReductionPass : public Pass { - public: - const char* name() const override { return "strength-reduction"; } - Status Process(ir::Module*) override; - - private: - // Replaces multiple by power of 2 with an equivalent bit shift. - // Returns true if something changed. - bool ReplaceMultiplyByPowerOf2(ir::BasicBlock::iterator*); - - // Scan the types and constants in the module looking for the the integer types that we are - // interested in. The shift operation needs a small unsigned integer. We need to find - // them or create them. We do not want duplicates. - void FindIntTypesAndConstants(); - - // Get the id for the given constant. If it does not exist, it will be - // created. The parameter must be between 0 and 32 inclusive. - uint32_t GetConstantId(uint32_t); - - // Replaces certain instructions in function bodies with presumably cheaper - // ones. Returns true if something changed. - bool ScanFunctions(); - - // Will create the type for an unsigned 32-bit integer and return the id. - // This functions assumes one does not already exist. - uint32_t CreateUint32Type(); - - // Def-Uses for the module we are processing - std::unique_ptr def_use_mgr_; - - // Type ids for the types of interest, or 0 if they do not exist. - uint32_t int32_type_id_; - uint32_t uint32_type_id_; - - // constant_ids[i] is the id for unsigned integer constant i. - // We set the limit at 32 because a bit shift of a 32-bit integer does not - // need a value larger than 32. - uint32_t constant_ids_[33]; - - // Next unused ID - uint32_t next_id_; - - // The module that the pass is being applied to. - ir::Module* module_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_STRENGTH_REDUCTION_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/strip_debug_info_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/strip_debug_info_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/strip_debug_info_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/strip_debug_info_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "strip_debug_info_pass.h" - -namespace spvtools { -namespace opt { - -Pass::Status StripDebugInfoPass::Process(ir::Module* module) { - bool modified = !module->debugs1().empty() || !module->debugs2().empty() || - !module->debugs3().empty(); - module->debug_clear(); - - module->ForEachInst([&modified](ir::Instruction* inst) { - modified |= !inst->dbg_line_insts().empty(); - inst->dbg_line_insts().clear(); - }); - - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/strip_debug_info_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/strip_debug_info_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/strip_debug_info_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/strip_debug_info_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_STRIP_DEBUG_INFO_PASS_H_ -#define LIBSPIRV_OPT_STRIP_DEBUG_INFO_PASS_H_ - -#include "module.h" -#include "pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class StripDebugInfoPass : public Pass { - public: - const char* name() const override { return "strip-debug"; } - Status Process(ir::Module* module) override; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_STRIP_DEBUG_INFO_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/type_manager.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/type_manager.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/type_manager.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/type_manager.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,225 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "type_manager.h" - -#include - -#include "log.h" -#include "reflect.h" - -namespace spvtools { -namespace opt { -namespace analysis { - -Type* TypeManager::GetType(uint32_t id) const { - auto iter = id_to_type_.find(id); - if (iter != id_to_type_.end()) return (*iter).second.get(); - return nullptr; -} - -uint32_t TypeManager::GetId(const Type* type) const { - auto iter = type_to_id_.find(type); - if (iter != type_to_id_.end()) return (*iter).second; - return 0; -} - -ForwardPointer* TypeManager::GetForwardPointer(uint32_t index) const { - if (index >= forward_pointers_.size()) return nullptr; - return forward_pointers_.at(index).get(); -} - -void TypeManager::AnalyzeTypes(const spvtools::ir::Module& module) { - for (const auto* inst : module.GetTypes()) RecordIfTypeDefinition(*inst); - for (const auto& inst : module.annotations()) AttachIfTypeDecoration(inst); -} - -Type* TypeManager::RecordIfTypeDefinition( - const spvtools::ir::Instruction& inst) { - if (!spvtools::ir::IsTypeInst(inst.opcode())) return nullptr; - - Type* type = nullptr; - switch (inst.opcode()) { - case SpvOpTypeVoid: - type = new Void(); - break; - case SpvOpTypeBool: - type = new Bool(); - break; - case SpvOpTypeInt: - type = new Integer(inst.GetSingleWordInOperand(0), - inst.GetSingleWordInOperand(1)); - break; - case SpvOpTypeFloat: - type = new Float(inst.GetSingleWordInOperand(0)); - break; - case SpvOpTypeVector: - type = new Vector(GetType(inst.GetSingleWordInOperand(0)), - inst.GetSingleWordInOperand(1)); - break; - case SpvOpTypeMatrix: - type = new Matrix(GetType(inst.GetSingleWordInOperand(0)), - inst.GetSingleWordInOperand(1)); - break; - case SpvOpTypeImage: { - const SpvAccessQualifier access = - inst.NumInOperands() < 8 - ? SpvAccessQualifierReadOnly - : static_cast(inst.GetSingleWordInOperand(7)); - type = new Image( - GetType(inst.GetSingleWordInOperand(0)), - static_cast(inst.GetSingleWordInOperand(1)), - inst.GetSingleWordInOperand(2), inst.GetSingleWordInOperand(3), - inst.GetSingleWordInOperand(4), inst.GetSingleWordInOperand(5), - static_cast(inst.GetSingleWordInOperand(6)), access); - } break; - case SpvOpTypeSampler: - type = new Sampler(); - break; - case SpvOpTypeSampledImage: - type = new SampledImage(GetType(inst.GetSingleWordInOperand(0))); - break; - case SpvOpTypeArray: - type = new Array(GetType(inst.GetSingleWordInOperand(0)), - inst.GetSingleWordInOperand(1)); - break; - case SpvOpTypeRuntimeArray: - type = new RuntimeArray(GetType(inst.GetSingleWordInOperand(0))); - break; - case SpvOpTypeStruct: { - std::vector element_types; - for (uint32_t i = 0; i < inst.NumInOperands(); ++i) { - element_types.push_back(GetType(inst.GetSingleWordInOperand(i))); - } - type = new Struct(element_types); - } break; - case SpvOpTypeOpaque: { - const uint32_t* data = inst.GetInOperand(0).words.data(); - type = new Opaque(reinterpret_cast(data)); - } break; - case SpvOpTypePointer: { - auto* ptr = new Pointer( - GetType(inst.GetSingleWordInOperand(1)), - static_cast(inst.GetSingleWordInOperand(0))); - // Let's see if somebody forward references this pointer. - for (auto* fp : unresolved_forward_pointers_) { - if (fp->target_id() == inst.result_id()) { - fp->SetTargetPointer(ptr); - unresolved_forward_pointers_.erase(fp); - break; - } - } - type = ptr; - } break; - case SpvOpTypeFunction: { - Type* return_type = GetType(inst.GetSingleWordInOperand(0)); - std::vector param_types; - for (uint32_t i = 1; i < inst.NumInOperands(); ++i) { - param_types.push_back(GetType(inst.GetSingleWordInOperand(i))); - } - type = new Function(return_type, param_types); - } break; - case SpvOpTypeEvent: - type = new Event(); - break; - case SpvOpTypeDeviceEvent: - type = new DeviceEvent(); - break; - case SpvOpTypeReserveId: - type = new ReserveId(); - break; - case SpvOpTypeQueue: - type = new Queue(); - break; - case SpvOpTypePipe: - type = new Pipe( - static_cast(inst.GetSingleWordInOperand(0))); - break; - case SpvOpTypeForwardPointer: { - // Handling of forward pointers is different from the other types. - auto* fp = new ForwardPointer( - inst.GetSingleWordInOperand(0), - static_cast(inst.GetSingleWordInOperand(1))); - forward_pointers_.emplace_back(fp); - unresolved_forward_pointers_.insert(fp); - return fp; - } - case SpvOpTypePipeStorage: - type = new PipeStorage(); - break; - case SpvOpTypeNamedBarrier: - type = new NamedBarrier(); - break; - default: - SPIRV_UNIMPLEMENTED(consumer_, "unhandled type"); - break; - } - - uint32_t id = inst.result_id(); - if (id == 0) { - SPIRV_ASSERT(consumer_, inst.opcode() == SpvOpTypeForwardPointer, - "instruction without result id found"); - } else { - SPIRV_ASSERT(consumer_, type != nullptr, - "type should not be nullptr at this point"); - id_to_type_[id].reset(type); - type_to_id_[type] = id; - } - return type; -} - -void TypeManager::AttachIfTypeDecoration(const ir::Instruction& inst) { - const SpvOp opcode = inst.opcode(); - if (!ir::IsAnnotationInst(opcode)) return; - const uint32_t id = inst.GetSingleWordOperand(0); - // Do nothing if the id to be decorated is not for a known type. - if (!id_to_type_.count(id)) return; - - Type* target_type = id_to_type_[id].get(); - switch (opcode) { - case SpvOpDecorate: { - const auto count = inst.NumOperands(); - std::vector data; - for (uint32_t i = 1; i < count; ++i) { - data.push_back(inst.GetSingleWordOperand(i)); - } - target_type->AddDecoration(std::move(data)); - } break; - case SpvOpMemberDecorate: { - const auto count = inst.NumOperands(); - const uint32_t index = inst.GetSingleWordOperand(1); - std::vector data; - for (uint32_t i = 2; i < count; ++i) { - data.push_back(inst.GetSingleWordOperand(i)); - } - if (Struct* st = target_type->AsStruct()) { - st->AddMemberDecoration(index, std::move(data)); - } else { - SPIRV_UNIMPLEMENTED(consumer_, "OpMemberDecorate non-struct type"); - } - } break; - case SpvOpDecorationGroup: - case SpvOpGroupDecorate: - case SpvOpGroupMemberDecorate: - SPIRV_UNIMPLEMENTED(consumer_, "unhandled decoration"); - break; - default: - SPIRV_UNREACHABLE(consumer_); - break; - } -} - -} // namespace analysis -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/type_manager.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/type_manager.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/type_manager.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/type_manager.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,98 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_TYPE_MANAGER_H_ -#define LIBSPIRV_OPT_TYPE_MANAGER_H_ - -#include -#include -#include -#include - -#include "module.h" -#include "spirv-tools/libspirv.hpp" -#include "types.h" - -namespace spvtools { -namespace opt { -namespace analysis { - -// A class for managing the SPIR-V type hierarchy. -class TypeManager { - public: - using IdToTypeMap = std::unordered_map>; - - // Constructs a type manager from the given |module|. All internal messages - // will be communicated to the outside via the given message |consumer|. - // This instance only keeps a reference to the |consumer|, so the |consumer| - // should outlive this instance. - TypeManager(const MessageConsumer& consumer, - const spvtools::ir::Module& module); - - TypeManager(const TypeManager&) = delete; - TypeManager(TypeManager&&) = delete; - TypeManager& operator=(const TypeManager&) = delete; - TypeManager& operator=(TypeManager&&) = delete; - - // Returns the type for the given type |id|. Returns nullptr if the given |id| - // does not define a type. - Type* GetType(uint32_t id) const; - // Returns the id for the given |type|. Returns 0 if can not find the given - // |type|. - uint32_t GetId(const Type* type) const; - // Returns the number of types hold in this manager. - size_t NumTypes() const { return id_to_type_.size(); } - // Iterators for all types contained in this manager. - IdToTypeMap::const_iterator begin() const { return id_to_type_.cbegin(); } - IdToTypeMap::const_iterator end() const { return id_to_type_.cend(); } - - // Returns the forward pointer type at the given |index|. - ForwardPointer* GetForwardPointer(uint32_t index) const; - // Returns the number of forward pointer types hold in this manager. - size_t NumForwardPointers() const { return forward_pointers_.size(); } - - private: - using TypeToIdMap = std::unordered_map; - using ForwardPointerVector = std::vector>; - - // Analyzes the types and decorations on types in the given |module|. - void AnalyzeTypes(const spvtools::ir::Module& module); - - // Creates and returns a type from the given SPIR-V |inst|. Returns nullptr if - // the given instruction is not for defining a type. - Type* RecordIfTypeDefinition(const spvtools::ir::Instruction& inst); - // Attaches the decoration encoded in |inst| to a type. Does nothing if the - // given instruction is not a decoration instruction or not decorating a type. - void AttachIfTypeDecoration(const spvtools::ir::Instruction& inst); - - const MessageConsumer& consumer_; // Message consumer. - IdToTypeMap id_to_type_; // Mapping from ids to their type representations. - TypeToIdMap type_to_id_; // Mapping from types to their defining ids. - ForwardPointerVector forward_pointers_; // All forward pointer declarations. - // All unresolved forward pointer declarations. - // Refers the contents in the above vector. - std::unordered_set unresolved_forward_pointers_; -}; - -inline TypeManager::TypeManager(const spvtools::MessageConsumer& consumer, - const spvtools::ir::Module& module) - : consumer_(consumer) { - AnalyzeTypes(module); -} - -} // namespace analysis -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_TYPE_MANAGER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/types.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/types.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/types.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/types.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,355 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include -#include -#include - -#include "types.h" - -namespace spvtools { -namespace opt { -namespace analysis { - -using U32VecVec = std::vector>; - -namespace { - -// Returns true if the two vector of vectors are identical. -bool CompareTwoVectors(const U32VecVec a, const U32VecVec b) { - const auto size = a.size(); - if (size != b.size()) return false; - - if (size == 0) return true; - if (size == 1) return a.front() == b.front(); - - std::vector*> a_ptrs, b_ptrs; - a_ptrs.reserve(size); - a_ptrs.reserve(size); - for (uint32_t i = 0; i < size; ++i) { - a_ptrs.push_back(&a[i]); - b_ptrs.push_back(&b[i]); - } - - const auto cmp = - [](const std::vector* m, const std::vector* n) { - return m->front() < n->front(); - }; - - std::sort(a_ptrs.begin(), a_ptrs.end(), cmp); - std::sort(b_ptrs.begin(), b_ptrs.end(), cmp); - - for (uint32_t i = 0; i < size; ++i) { - if (*a_ptrs[i] != *b_ptrs[i]) return false; - } - return true; -} - -} // anonymous namespace - -std::string Type::GetDecorationStr() const { - std::ostringstream oss; - oss << "[["; - for (const auto& decoration : decorations_) { - oss << "("; - for (size_t i = 0; i < decoration.size(); ++i) { - oss << (i > 0 ? ", " : ""); - oss << decoration.at(i); - } - oss << ")"; - } - oss << "]]"; - return oss.str(); -} - -bool Type::HasSameDecorations(const Type* that) const { - return CompareTwoVectors(decorations_, that->decorations_); -} - -bool Integer::IsSame(Type* that) const { - const Integer* it = that->AsInteger(); - return it && width_ == it->width_ && signed_ == it->signed_ && - HasSameDecorations(that); -} - -std::string Integer::str() const { - std::ostringstream oss; - oss << (signed_ ? "s" : "u") << "int" << width_; - return oss.str(); -} - -bool Float::IsSame(Type* that) const { - const Float* ft = that->AsFloat(); - return ft && width_ == ft->width_ && HasSameDecorations(that); -} - -std::string Float::str() const { - std::ostringstream oss; - oss << "float" << width_; - return oss.str(); -} - -Vector::Vector(Type* type, uint32_t count) - : element_type_(type), count_(count) { - assert(type->AsBool() || type->AsInteger() || type->AsFloat()); -} - -bool Vector::IsSame(Type* that) const { - const Vector* vt = that->AsVector(); - if (!vt) return false; - return count_ == vt->count_ && element_type_->IsSame(vt->element_type_) && - HasSameDecorations(that); -} - -std::string Vector::str() const { - std::ostringstream oss; - oss << "<" << element_type_->str() << ", " << count_ << ">"; - return oss.str(); -} - -Matrix::Matrix(Type* type, uint32_t count) - : element_type_(type), count_(count) { - assert(type->AsVector()); -} - -bool Matrix::IsSame(Type* that) const { - const Matrix* mt = that->AsMatrix(); - if (!mt) return false; - return count_ == mt->count_ && element_type_->IsSame(mt->element_type_) && - HasSameDecorations(that); -} - -std::string Matrix::str() const { - std::ostringstream oss; - oss << "<" << element_type_->str() << ", " << count_ << ">"; - return oss.str(); -} - -Image::Image(Type* sampled_type, SpvDim dim, uint32_t depth, uint32_t arrayed, - uint32_t ms, uint32_t sampled, SpvImageFormat format, - SpvAccessQualifier access_qualifier) - : sampled_type_(sampled_type), - dim_(dim), - depth_(depth), - arrayed_(arrayed), - ms_(ms), - sampled_(sampled), - format_(format), - access_qualifier_(access_qualifier) { - // TODO(antiagainst): check sampled_type -} - -bool Image::IsSame(Type* that) const { - const Image* it = that->AsImage(); - if (!it) return false; - return dim_ == it->dim_ && depth_ == it->depth_ && arrayed_ == it->arrayed_ && - ms_ == it->ms_ && sampled_ == it->sampled_ && format_ == it->format_ && - access_qualifier_ == it->access_qualifier_ && - sampled_type_->IsSame(it->sampled_type_) && HasSameDecorations(that); -} - -std::string Image::str() const { - std::ostringstream oss; - oss << "image(" << sampled_type_->str() << ", " << dim_ << ", " << depth_ - << ", " << arrayed_ << ", " << ms_ << ", " << sampled_ << ", " << format_ - << ", " << access_qualifier_ << ")"; - return oss.str(); -} - -bool SampledImage::IsSame(Type* that) const { - const SampledImage* sit = that->AsSampledImage(); - if (!sit) return false; - return image_type_->IsSame(sit->image_type_) && HasSameDecorations(that); -} - -std::string SampledImage::str() const { - std::ostringstream oss; - oss << "sampled_image(" << image_type_->str() << ")"; - return oss.str(); -} - -Array::Array(Type* type, uint32_t length_id) - : element_type_(type), length_id_(length_id) { - assert(!type->AsVoid()); -} - -bool Array::IsSame(Type* that) const { - const Array* at = that->AsArray(); - if (!at) return false; - return length_id_ == at->length_id_ && - element_type_->IsSame(at->element_type_) && HasSameDecorations(that); -} - -std::string Array::str() const { - std::ostringstream oss; - oss << "[" << element_type_->str() << ", id(" << length_id_ << ")]"; - return oss.str(); -} - -RuntimeArray::RuntimeArray(Type* type) : element_type_(type) { - assert(!type->AsVoid()); -} - -bool RuntimeArray::IsSame(Type* that) const { - const RuntimeArray* rat = that->AsRuntimeArray(); - if (!rat) return false; - return element_type_->IsSame(rat->element_type_) && HasSameDecorations(that); -} - -std::string RuntimeArray::str() const { - std::ostringstream oss; - oss << "[" << element_type_->str() << "]"; - return oss.str(); -} - -Struct::Struct(const std::vector& types) : element_types_(types) { - for (auto* t : types) { - (void)t; - assert(!t->AsVoid()); - } -} - -void Struct::AddMemberDecoration(uint32_t index, - std::vector&& decoration) { - if (index >= element_types_.size()) { - assert(0 && "index out of bound"); - return; - } - - element_decorations_[index].push_back(std::move(decoration)); -} - -bool Struct::IsSame(Type* that) const { - const Struct* st = that->AsStruct(); - if (!st) return false; - if (element_types_.size() != st->element_types_.size()) return false; - const auto size = element_decorations_.size(); - if (size != st->element_decorations_.size()) return false; - if (!HasSameDecorations(that)) return false; - - for (size_t i = 0; i < element_types_.size(); ++i) { - if (!element_types_[i]->IsSame(st->element_types_[i])) return false; - } - for (const auto& p : element_decorations_) { - if (st->element_decorations_.count(p.first) == 0) return false; - if (!CompareTwoVectors(p.second, st->element_decorations_.at(p.first))) - return false; - } - return true; -} - -std::string Struct::str() const { - std::ostringstream oss; - oss << "{"; - const size_t count = element_types_.size(); - for (size_t i = 0; i < count; ++i) { - oss << element_types_[i]->str(); - if (i + 1 != count) oss << ", "; - } - oss << "}"; - return oss.str(); -} - -bool Opaque::IsSame(Type* that) const { - const Opaque* ot = that->AsOpaque(); - if (!ot) return false; - return name_ == ot->name_ && HasSameDecorations(that); -} - -std::string Opaque::str() const { - std::ostringstream oss; - oss << "opaque('" << name_ << "')"; - return oss.str(); -} - -Pointer::Pointer(Type* type, SpvStorageClass storage_class) - : pointee_type_(type), storage_class_(storage_class) { - assert(!type->AsVoid()); -} - -bool Pointer::IsSame(Type* that) const { - const Pointer* pt = that->AsPointer(); - if (!pt) return false; - if (storage_class_ != pt->storage_class_) return false; - if (!pointee_type_->IsSame(pt->pointee_type_)) return false; - return HasSameDecorations(that); -} - -std::string Pointer::str() const { return pointee_type_->str() + "*"; } - -Function::Function(Type* return_type, const std::vector& param_types) - : return_type_(return_type), param_types_(param_types) { - for (auto* t : param_types) { - (void)t; - assert(!t->AsVoid()); - } -} - -bool Function::IsSame(Type* that) const { - const Function* ft = that->AsFunction(); - if (!ft) return false; - if (!return_type_->IsSame(ft->return_type_)) return false; - if (param_types_.size() != ft->param_types_.size()) return false; - for (size_t i = 0; i < param_types_.size(); ++i) { - if (!param_types_[i]->IsSame(ft->param_types_[i])) return false; - } - return HasSameDecorations(that); -} - -std::string Function::str() const { - std::ostringstream oss; - const size_t count = param_types_.size(); - oss << "("; - for (size_t i = 0; i < count; ++i) { - oss << param_types_[i]->str(); - if (i + 1 != count) oss << ", "; - } - oss << ") -> " << return_type_->str(); - return oss.str(); -} - -bool Pipe::IsSame(Type* that) const { - const Pipe* pt = that->AsPipe(); - if (!pt) return false; - return access_qualifier_ == pt->access_qualifier_ && HasSameDecorations(that); -} - -std::string Pipe::str() const { - std::ostringstream oss; - oss << "pipe(" << access_qualifier_ << ")"; - return oss.str(); -} - -bool ForwardPointer::IsSame(Type* that) const { - const ForwardPointer* fpt = that->AsForwardPointer(); - if (!fpt) return false; - return target_id_ == fpt->target_id_ && - storage_class_ == fpt->storage_class_ && HasSameDecorations(that); -} - -std::string ForwardPointer::str() const { - std::ostringstream oss; - oss << "forward_pointer("; - if (pointer_ != nullptr) { - oss << pointer_->str(); - } else { - oss << target_id_; - } - oss << ")"; - return oss.str(); -} - -} // namespace analysis -} // namespace opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/types.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/types.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/types.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/types.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,402 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file provides a class hierarchy for representing SPIR-V types. - -#ifndef LIBSPIRV_OPT_TYPES_H_ -#define LIBSPIRV_OPT_TYPES_H_ - -#include -#include -#include - -#include "spirv-tools/libspirv.h" -#include "spirv/1.2/spirv.h" - -namespace spvtools { -namespace opt { -namespace analysis { - -class Void; -class Bool; -class Integer; -class Float; -class Vector; -class Matrix; -class Image; -class Sampler; -class SampledImage; -class Array; -class RuntimeArray; -class Struct; -class Opaque; -class Pointer; -class Function; -class Event; -class DeviceEvent; -class ReserveId; -class Queue; -class Pipe; -class ForwardPointer; -class PipeStorage; -class NamedBarrier; - -// Abstract class for a SPIR-V type. It has a bunch of As() methods, -// which is used as a way to probe the actual . -class Type { - public: - virtual ~Type() {} - - // Attaches a decoration directly on this type. - void AddDecoration(std::vector&& d) { - decorations_.push_back(std::move(d)); - } - // Returns the decorations on this type as a string. - std::string GetDecorationStr() const; - // Returns true if this type has exactly the same decorations as |that| type. - bool HasSameDecorations(const Type* that) const; - // Returns true if this type is exactly the same as |that| type, including - // decorations. - virtual bool IsSame(Type* that) const = 0; - // Returns a human-readable string to represent this type. - virtual std::string str() const = 0; - - // Returns true if there is no decoration on this type. For struct types, - // returns true only when there is no decoration for both the struct type - // and the struct members. - virtual bool decoration_empty() const { return decorations_.empty(); } - -// A bunch of methods for casting this type to a given type. Returns this if the -// cast can be done, nullptr otherwise. -#define DeclareCastMethod(target) \ - virtual target* As##target() { return nullptr; } \ - virtual const target* As##target() const { return nullptr; } - DeclareCastMethod(Void); - DeclareCastMethod(Bool); - DeclareCastMethod(Integer); - DeclareCastMethod(Float); - DeclareCastMethod(Vector); - DeclareCastMethod(Matrix); - DeclareCastMethod(Image); - DeclareCastMethod(Sampler); - DeclareCastMethod(SampledImage); - DeclareCastMethod(Array); - DeclareCastMethod(RuntimeArray); - DeclareCastMethod(Struct); - DeclareCastMethod(Opaque); - DeclareCastMethod(Pointer); - DeclareCastMethod(Function); - DeclareCastMethod(Event); - DeclareCastMethod(DeviceEvent); - DeclareCastMethod(ReserveId); - DeclareCastMethod(Queue); - DeclareCastMethod(Pipe); - DeclareCastMethod(ForwardPointer); - DeclareCastMethod(PipeStorage); - DeclareCastMethod(NamedBarrier); -#undef DeclareCastMethod - - protected: - // Decorations attached to this type. Each decoration is encoded as a vector - // of uint32_t numbers. The first uint32_t number is the decoration value, - // and the rest are the parameters to the decoration (if exists). - std::vector> decorations_; -}; - -class Integer : public Type { - public: - Integer(uint32_t w, bool is_signed) : width_(w), signed_(is_signed) {} - Integer(const Integer&) = default; - - bool IsSame(Type* that) const override; - std::string str() const override; - - Integer* AsInteger() override { return this; } - const Integer* AsInteger() const override { return this; } - uint32_t width() const { return width_; } - bool IsSigned() const { return signed_; } - - private: - uint32_t width_; // bit width - bool signed_; // true if this integer is signed -}; - -class Float : public Type { - public: - Float(uint32_t w) : width_(w) {} - Float(const Float&) = default; - - bool IsSame(Type* that) const override; - std::string str() const override; - - Float* AsFloat() override { return this; } - const Float* AsFloat() const override { return this; } - uint32_t width() const { return width_; } - - private: - uint32_t width_; // bit width -}; - -class Vector : public Type { - public: - Vector(Type* element_type, uint32_t count); - Vector(const Vector&) = default; - - bool IsSame(Type* that) const override; - std::string str() const override; - const Type* element_type() const { return element_type_; } - uint32_t element_count() const { return count_; } - - Vector* AsVector() override { return this; } - const Vector* AsVector() const override { return this; } - - private: - Type* element_type_; - uint32_t count_; -}; - -class Matrix : public Type { - public: - Matrix(Type* element_type, uint32_t count); - Matrix(const Matrix&) = default; - - bool IsSame(Type* that) const override; - std::string str() const override; - const Type* element_type() const { return element_type_; } - uint32_t element_count() const { return count_; } - - Matrix* AsMatrix() override { return this; } - const Matrix* AsMatrix() const override { return this; } - - private: - Type* element_type_; - uint32_t count_; -}; - -class Image : public Type { - public: - Image(Type* sampled_type, SpvDim dim, uint32_t depth, uint32_t arrayed, - uint32_t ms, uint32_t sampled, SpvImageFormat format, - SpvAccessQualifier access_qualifier = SpvAccessQualifierReadOnly); - Image(const Image&) = default; - - bool IsSame(Type* that) const override; - std::string str() const override; - - Image* AsImage() override { return this; } - const Image* AsImage() const override { return this; } - - private: - Type* sampled_type_; - SpvDim dim_; - uint32_t depth_; - uint32_t arrayed_; - uint32_t ms_; - uint32_t sampled_; - SpvImageFormat format_; - SpvAccessQualifier access_qualifier_; -}; - -class SampledImage : public Type { - public: - SampledImage(Type* image_type) : image_type_(image_type) {} - SampledImage(const SampledImage&) = default; - - bool IsSame(Type* that) const override; - std::string str() const override; - - SampledImage* AsSampledImage() override { return this; } - const SampledImage* AsSampledImage() const override { return this; } - - private: - Type* image_type_; -}; - -class Array : public Type { - public: - Array(Type* element_type, uint32_t length_id); - Array(const Array&) = default; - - bool IsSame(Type* that) const override; - std::string str() const override; - const Type* element_type() const { return element_type_; } - uint32_t LengthId() const { return length_id_; } - - Array* AsArray() override { return this; } - const Array* AsArray() const override { return this; } - - private: - Type* element_type_; - uint32_t length_id_; -}; - -class RuntimeArray : public Type { - public: - RuntimeArray(Type* element_type); - RuntimeArray(const RuntimeArray&) = default; - - bool IsSame(Type* that) const override; - std::string str() const override; - const Type* element_type() const { return element_type_; } - - RuntimeArray* AsRuntimeArray() override { return this; } - const RuntimeArray* AsRuntimeArray() const override { return this; } - - private: - Type* element_type_; -}; - -class Struct : public Type { - public: - Struct(const std::vector& element_types); - Struct(const Struct&) = default; - - // Adds a decoration to the member at the given index. The first word is the - // decoration enum, and the remaining words, if any, are its operands. - void AddMemberDecoration(uint32_t index, std::vector&& decoration); - - bool IsSame(Type* that) const override; - std::string str() const override; - const std::vector& element_types() const { return element_types_; } - bool decoration_empty() const override { - return decorations_.empty() && element_decorations_.empty(); - } - - Struct* AsStruct() override { return this; } - const Struct* AsStruct() const override { return this; } - - private: - std::vector element_types_; - // We can attach decorations to struct members and that should not affect the - // underlying element type. So we need an extra data structure here to keep - // track of element type decorations. - std::unordered_map>> - element_decorations_; -}; - -class Opaque : public Type { - public: - Opaque(std::string name) : name_(std::move(name)) {} - Opaque(const Opaque&) = default; - - bool IsSame(Type* that) const override; - std::string str() const override; - - Opaque* AsOpaque() override { return this; } - const Opaque* AsOpaque() const override { return this; } - - private: - std::string name_; -}; - -class Pointer : public Type { - public: - Pointer(Type* pointee_type, SpvStorageClass storage_class); - Pointer(const Pointer&) = default; - - bool IsSame(Type* that) const override; - std::string str() const override; - const Type* pointee_type() const { return pointee_type_; } - - Pointer* AsPointer() override { return this; } - const Pointer* AsPointer() const override { return this; } - - private: - Type* pointee_type_; - SpvStorageClass storage_class_; -}; - -class Function : public Type { - public: - Function(Type* return_type, const std::vector& param_types); - Function(const Function&) = default; - - bool IsSame(Type* that) const override; - std::string str() const override; - - Function* AsFunction() override { return this; } - const Function* AsFunction() const override { return this; } - - private: - Type* return_type_; - std::vector param_types_; -}; - -class Pipe : public Type { - public: - Pipe(SpvAccessQualifier access_qualifier) - : access_qualifier_(access_qualifier) {} - Pipe(const Pipe&) = default; - - bool IsSame(Type* that) const override; - std::string str() const override; - - Pipe* AsPipe() override { return this; } - const Pipe* AsPipe() const override { return this; } - - private: - SpvAccessQualifier access_qualifier_; -}; - -class ForwardPointer : public Type { - public: - ForwardPointer(uint32_t id, SpvStorageClass storage_class) - : target_id_(id), storage_class_(storage_class), pointer_(nullptr) {} - ForwardPointer(const ForwardPointer&) = default; - - uint32_t target_id() const { return target_id_; } - void SetTargetPointer(Pointer* pointer) { pointer_ = pointer; } - - bool IsSame(Type* that) const override; - std::string str() const override; - - ForwardPointer* AsForwardPointer() override { return this; } - const ForwardPointer* AsForwardPointer() const override { return this; } - - private: - uint32_t target_id_; - SpvStorageClass storage_class_; - Pointer* pointer_; -}; - -#define DefineParameterlessType(type, name) \ - class type : public Type { \ - public: \ - type() = default; \ - type(const type&) = default; \ - \ - bool IsSame(Type* that) const override { \ - return that->As##type() && HasSameDecorations(that); \ - } \ - std::string str() const override { return #name; } \ - \ - type* As##type() override { return this; } \ - const type* As##type() const override { return this; } \ - }; -DefineParameterlessType(Void, void); -DefineParameterlessType(Bool, bool); -DefineParameterlessType(Sampler, sampler); -DefineParameterlessType(Event, event); -DefineParameterlessType(DeviceEvent, device_event); -DefineParameterlessType(ReserveId, reserve_id); -DefineParameterlessType(Queue, queue); -DefineParameterlessType(PipeStorage, pipe_storage); -DefineParameterlessType(NamedBarrier, named_barrier); -#undef DefineParameterlessType - -} // namespace analysis -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_TYPES_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/unify_const_pass.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/unify_const_pass.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/unify_const_pass.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/unify_const_pass.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,171 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "unify_const_pass.h" - -#include -#include - -#include "def_use_manager.h" -#include "make_unique.h" - -namespace spvtools { -namespace opt { - -namespace { - -// The trie that stores a bunch of result ids and, for a given instruction, -// searches the result id that has been defined with the same opcode, type and -// operands. -class ResultIdTrie { - public: - ResultIdTrie() : root_(new Node) {} - - // For a given instruction, extracts its opcode, type id and operand words - // as an array of keys, looks up the trie to find a result id which is stored - // with the same opcode, type id and operand words. If none of such result id - // is found, creates a trie node with those keys, stores the instruction's - // result id and returns that result id. If an existing result id is found, - // returns the existing result id. - uint32_t LookupEquivalentResultFor(const ir::Instruction& inst) { - auto keys = GetLookUpKeys(inst); - auto* node = root_.get(); - for (uint32_t key : keys) { - node = node->GetOrCreateTrieNodeFor(key); - } - if (node->result_id() == 0) { - node->SetResultId(inst.result_id()); - } - return node->result_id(); - } - - private: - // The trie node to store result ids. - class Node { - public: - using TrieNodeMap = std::unordered_map>; - - Node() : result_id_(0), next_() {} - uint32_t result_id() const { return result_id_; } - - // Sets the result id stored in this node. - void SetResultId(uint32_t id) { result_id_ = id; } - - // Searches for the child trie node with the given key. If the node is - // found, returns that node. Otherwise creates an empty child node with - // that key and returns that newly created node. - Node* GetOrCreateTrieNodeFor(uint32_t key) { - auto iter = next_.find(key); - if (iter == next_.end()) { - // insert a new node and return the node. - return next_.insert(std::make_pair(key, MakeUnique())) - .first->second.get(); - } - return iter->second.get(); - } - - private: - // The result id stored in this node. 0 means this node is empty. - uint32_t result_id_; - // The mapping from the keys to the child nodes of this node. - TrieNodeMap next_; - }; - - // Returns a vector of the opcode followed by the words in the raw SPIR-V - // instruction encoding but without the result id. - std::vector GetLookUpKeys(const ir::Instruction& inst) { - std::vector keys; - // Need to use the opcode, otherwise there might be a conflict with the - // following case when 's binary value equals xx's id: - // OpSpecConstantOp tt yy zz - // OpSpecConstantComposite tt xx yy zz; - keys.push_back(static_cast(inst.opcode())); - for (const auto& operand : inst) { - if (operand.type == SPV_OPERAND_TYPE_RESULT_ID) continue; - keys.insert(keys.end(), operand.words.cbegin(), operand.words.cend()); - } - return keys; - } - - std::unique_ptr root_; // The root node of the trie. -}; -} // anonymous namespace - -Pass::Status UnifyConstantPass::Process(ir::Module* module) { - bool modified = false; - ResultIdTrie defined_constants; - analysis::DefUseManager def_use_mgr(consumer(), module); - - for (ir::Instruction& inst : module->types_values()) { - // Do not handle the instruction when there are decorations upon the result - // id. - if (def_use_mgr.GetAnnotations(inst.result_id()).size() != 0) { - continue; - } - - // The overall algorithm is to store the result ids of all the eligible - // constants encountered so far in a trie. For a constant defining - // instruction under consideration, use its opcode, result type id and - // words in operands as an array of keys to lookup the trie. If a result id - // can be found for that array of keys, a constant with exactly the same - // value must has been defined before, the constant under processing - // should be replaced by the constant previously defined. If no such result - // id can be found for that array of keys, this must be the first time a - // constant with its value be defined, we then create a new trie node to - // store the result id with the keys. When replacing a duplicated constant - // with a previously defined constant, all the uses of the duplicated - // constant, which must be placed after the duplicated constant defining - // instruction, will be updated. This way, the descendants of the - // previously defined constant and the duplicated constant will both refer - // to the previously defined constant. So that the operand ids which are - // used in key arrays will be the ids of the unified constants, when - // processing is up to a descendant. This makes comparing the key array - // always valid for judging duplication. - switch (inst.opcode()) { - case SpvOp::SpvOpConstantTrue: - case SpvOp::SpvOpConstantFalse: - case SpvOp::SpvOpConstant: - case SpvOp::SpvOpConstantNull: - case SpvOp::SpvOpConstantSampler: - case SpvOp::SpvOpConstantComposite: - // Only spec constants defined with OpSpecConstantOp and - // OpSpecConstantComposite should be processed in this pass. Spec - // constants defined with OpSpecConstant{|True|False} are decorated with - // 'SpecId' decoration and all of them should be treated as unique. - // 'SpecId' is not applicable to SpecConstants defined with - // OpSpecConstant{Op|Composite}, their values are not necessary to be - // unique. When all the operands/compoents are the same between two - // OpSpecConstant{Op|Composite} results, their result values must be the - // same so are unifiable. - case SpvOp::SpvOpSpecConstantOp: - case SpvOp::SpvOpSpecConstantComposite: { - uint32_t id = defined_constants.LookupEquivalentResultFor(inst); - if (id != inst.result_id()) { - // The constant is a duplicated one, use the cached constant to - // replace the uses of this duplicated one, then turn it to nop. - def_use_mgr.ReplaceAllUsesWith(inst.result_id(), id); - def_use_mgr.KillInst(&inst); - modified = true; - } - break; - } - default: - break; - } - } - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -} // opt -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/unify_const_pass.h vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/unify_const_pass.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/opt/unify_const_pass.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/opt/unify_const_pass.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_UNIFY_CONSTANT_PASS_H_ -#define LIBSPIRV_OPT_UNIFY_CONSTANT_PASS_H_ - -#include "module.h" -#include "pass.h" - -namespace spvtools { -namespace opt { - -// See optimizer.hpp for documentation. -class UnifyConstantPass : public Pass { - public: - const char* name() const override { return "unify-const"; } - Status Process(ir::Module*) override; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_UNIFY_CONSTANT_PASS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/parsed_operand.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/parsed_operand.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/parsed_operand.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/parsed_operand.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file contains utility functions for spv_parsed_operand_t. - -#include "parsed_operand.h" - -#include -#include "util/hex_float.h" - -namespace libspirv { - -void EmitNumericLiteral(std::ostream* out, const spv_parsed_instruction_t& inst, - const spv_parsed_operand_t& operand) { - assert(operand.type == SPV_OPERAND_TYPE_LITERAL_INTEGER || - operand.type == SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER); - assert(1 <= operand.num_words); - assert(operand.num_words <= 2); - - const uint32_t word = inst.words[operand.offset]; - if (operand.num_words == 1) { - switch (operand.number_kind) { - case SPV_NUMBER_SIGNED_INT: - *out << int32_t(word); - break; - case SPV_NUMBER_UNSIGNED_INT: - *out << word; - break; - case SPV_NUMBER_FLOATING: - if (operand.number_bit_width == 16) { - *out << spvutils::FloatProxy( - uint16_t(word & 0xFFFF)); - } else { - // Assume 32-bit floats. - *out << spvutils::FloatProxy(word); - } - break; - default: - assert(false && "Unreachable"); - } - } else if (operand.num_words == 2) { - // Multi-word numbers are presented with lower order words first. - uint64_t bits = - uint64_t(word) | (uint64_t(inst.words[operand.offset + 1]) << 32); - switch (operand.number_kind) { - case SPV_NUMBER_SIGNED_INT: - *out << int64_t(bits); - break; - case SPV_NUMBER_UNSIGNED_INT: - *out << bits; - break; - case SPV_NUMBER_FLOATING: - // Assume only 64-bit floats. - *out << spvutils::FloatProxy(bits); - break; - default: - assert(false && "Unreachable"); - } - } else { - // TODO(dneto): Support more than 64-bits at a time. - assert(false && "Unhandled"); - } -} -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/parsed_operand.h vulkan-1.1.73+dfsg/external/spirv-tools/source/parsed_operand.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/parsed_operand.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/parsed_operand.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_PARSED_OPERAND_H_ -#define LIBSPIRV_PARSED_OPERAND_H_ - -#include -#include "spirv-tools/libspirv.h" - -namespace libspirv { - -// Emits the numeric literal representation of the given instruction operand -// to the stream. The operand must be of numeric type. If integral it may -// be up to 64 bits wide. If floating point, then it must be 16, 32, or 64 -// bits wide. -void EmitNumericLiteral(std::ostream* out, const spv_parsed_instruction_t& inst, - const spv_parsed_operand_t& operand); - -} // namespace libspirv - -#endif // LIBSPIRV_BINARY_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/print.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/print.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/print.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/print.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,107 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "print.h" - -#if defined(SPIRV_ANDROID) || defined(SPIRV_LINUX) || defined(SPIRV_MAC) || defined(SPIRV_FREEBSD) -namespace libspirv { - -clr::reset::operator const char*() { return "\x1b[0m"; } - -clr::grey::operator const char*() { return "\x1b[1;30m"; } - -clr::red::operator const char*() { return "\x1b[31m"; } - -clr::green::operator const char*() { return "\x1b[32m"; } - -clr::yellow::operator const char*() { return "\x1b[33m"; } - -clr::blue::operator const char*() { return "\x1b[34m"; } - -} // namespace libspirv -#elif defined(SPIRV_WINDOWS) -#include - -namespace libspirv { - -static void SetConsoleForegroundColorPrimary(HANDLE hConsole, WORD color) -{ - // Get screen buffer information from console handle - CONSOLE_SCREEN_BUFFER_INFO bufInfo; - GetConsoleScreenBufferInfo(hConsole, &bufInfo); - - // Get background color - color = WORD(color | (bufInfo.wAttributes & 0xfff0)); - - // Set foreground color - SetConsoleTextAttribute(hConsole, color); -} - -static void SetConsoleForegroundColor(WORD color) -{ - SetConsoleForegroundColorPrimary(GetStdHandle(STD_OUTPUT_HANDLE), color); - SetConsoleForegroundColorPrimary(GetStdHandle(STD_ERROR_HANDLE), color); -} - -clr::reset::operator const char*() { - SetConsoleForegroundColor(0xf); - return ""; -} - -clr::grey::operator const char*() { - SetConsoleForegroundColor(FOREGROUND_INTENSITY); - return ""; -} - -clr::red::operator const char*() { - SetConsoleForegroundColor(FOREGROUND_RED); - return ""; -} - -clr::green::operator const char*() { - SetConsoleForegroundColor(FOREGROUND_GREEN); - return ""; -} - -clr::yellow::operator const char*() { - SetConsoleForegroundColor(FOREGROUND_RED | FOREGROUND_GREEN); - return ""; -} - -clr::blue::operator const char*() { - // Blue all by itself is hard to see against a black background (the - // default on command shell), or a medium blue background (the default - // on PowerShell). So increase its intensity. - SetConsoleForegroundColor(FOREGROUND_BLUE | FOREGROUND_INTENSITY); - return ""; -} - -} // namespace libspirv -#else -namespace libspirv { - -clr::reset::operator const char*() { return ""; } - -clr::grey::operator const char*() { return ""; } - -clr::red::operator const char*() { return ""; } - -clr::green::operator const char*() { return ""; } - -clr::yellow::operator const char*() { return ""; } - -clr::blue::operator const char*() { return ""; } - -} // namespace libspirv -#endif diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/print.h vulkan-1.1.73+dfsg/external/spirv-tools/source/print.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/print.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/print.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_PRINT_H_ -#define LIBSPIRV_PRINT_H_ - -#include -#include - -namespace libspirv { - -// Wrapper for out stream selection. -class out_stream { - public: - out_stream() : pStream(nullptr) {} - explicit out_stream(std::stringstream& stream) : pStream(&stream) {} - - std::ostream& get() { - if (pStream) { - return *pStream; - } - return std::cout; - } - - private: - std::stringstream* pStream; -}; - -namespace clr { -// Resets console color. -struct reset { - operator const char*(); -}; -// Sets console color to grey. -struct grey { - operator const char*(); -}; -// Sets console color to red. -struct red { - operator const char*(); -}; -// Sets console color to green. -struct green { - operator const char*(); -}; -// Sets console color to yellow. -struct yellow { - operator const char*(); -}; -// Sets console color to blue. -struct blue { - operator const char*(); -}; -} // namespace clr - -} // namespace libspirv - -#endif // LIBSPIRV_PRINT_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/software_version.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/software_version.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/software_version.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/software_version.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -// Copyright (c) 2015-2016 Google 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. - -#include "spirv-tools/libspirv.h" - -namespace { - -const char* kBuildVersions[] = { -#include "build-version.inc" -}; - -} // anonymous namespace - -const char* spvSoftwareVersionString() { - return kBuildVersions[0]; -} - -const char* spvSoftwareVersionDetailsString() { - return kBuildVersions[1]; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_constant.h vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_constant.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_constant.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_constant.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,103 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_SPIRV_CONSTANT_H_ -#define LIBSPIRV_SPIRV_CONSTANT_H_ - -#include "spirv-tools/libspirv.h" -#include "spirv/1.2/spirv.h" - -// Version number macros. - -// Evaluates to a well-formed version header word, given valid -// SPIR-V version major and minor version numbers. -#define SPV_SPIRV_VERSION_WORD(MAJOR, MINOR) \ - ((uint32_t(uint8_t(MAJOR)) << 16) | (uint32_t(uint8_t(MINOR)) << 8)) -// Returns the major version extracted from a version header word. -#define SPV_SPIRV_VERSION_MAJOR_PART(WORD) ((uint32_t(WORD) >> 16) & 0xff) -// Returns the minor version extracted from a version header word. -#define SPV_SPIRV_VERSION_MINOR_PART(WORD) ((uint32_t(WORD) >> 8) & 0xff) - -// Returns the version number for the given SPIR-V target environment. -uint32_t spvVersionForTargetEnv(spv_target_env env); - -// Header indices - -#define SPV_INDEX_MAGIC_NUMBER 0u -#define SPV_INDEX_VERSION_NUMBER 1u -#define SPV_INDEX_GENERATOR_NUMBER 2u -#define SPV_INDEX_BOUND 3u -#define SPV_INDEX_SCHEMA 4u -#define SPV_INDEX_INSTRUCTION 5u - -// Universal limits - -// SPIR-V 1.0 limits -#define SPV_LIMIT_INSTRUCTION_WORD_COUNT_MAX 0xffff -#define SPV_LIMIT_LITERAL_STRING_UTF8_CHARS_MAX 0xffff - -// A single Unicode character in UTF-8 encoding can take -// up 4 bytes. -#define SPV_LIMIT_LITERAL_STRING_BYTES_MAX \ - (SPV_LIMIT_LITERAL_STRING_UTF8_CHARS_MAX * 4) - -// NOTE: These are set to the minimum maximum values -// TODO(dneto): Check these. - -// libspirv limits. -#define SPV_LIMIT_RESULT_ID_BOUND 0x00400000 -#define SPV_LIMIT_CONTROL_FLOW_NEST_DEPTH 0x00000400 -#define SPV_LIMIT_GLOBAL_VARIABLES_MAX 0x00010000 -#define SPV_LIMIT_LOCAL_VARIABLES_MAX 0x00080000 -// TODO: Decorations per target ID max, depends on decoration table size -#define SPV_LIMIT_EXECUTION_MODE_PER_ENTRY_POINT_MAX 0x00000100 -#define SPV_LIMIT_INDICIES_MAX_ACCESS_CHAIN_COMPOSITE_MAX 0x00000100 -#define SPV_LIMIT_FUNCTION_PARAMETERS_PER_FUNCTION_DECL 0x00000100 -#define SPV_LIMIT_FUNCTION_CALL_ARGUMENTS_MAX 0x00000100 -#define SPV_LIMIT_EXT_FUNCTION_CALL_ARGUMENTS_MAX 0x00000100 -#define SPV_LIMIT_SWITCH_LITERAL_LABEL_PAIRS_MAX 0x00004000 -#define SPV_LIMIT_STRUCT_MEMBERS_MAX 0x0000400 -#define SPV_LIMIT_STRUCT_NESTING_DEPTH_MAX 0x00000100 - -// Enumerations - -// Values mapping to registered tools. See the registry at -// https://www.khronos.org/registry/spir-v/api/spir-v.xml -// These values occupy the higher order 16 bits of the generator magic word. -typedef enum spv_generator_t { - // TODO(dneto) Values 0 through 5 were registered only as vendor. - SPV_GENERATOR_KHRONOS = 0, - SPV_GENERATOR_LUNARG = 1, - SPV_GENERATOR_VALVE = 2, - SPV_GENERATOR_CODEPLAY = 3, - SPV_GENERATOR_NVIDIA = 4, - SPV_GENERATOR_ARM = 5, - // These are vendor and tool. - SPV_GENERATOR_KHRONOS_LLVM_TRANSLATOR = 6, - SPV_GENERATOR_KHRONOS_ASSEMBLER = 7, - SPV_GENERATOR_KHRONOS_GLSLANG = 8, - SPV_GENERATOR_NUM_ENTRIES, - SPV_FORCE_16_BIT_ENUM(spv_generator_t) -} spv_generator_t; - -// Evaluates to a well-formed generator magic word from a tool value and -// miscellaneous 16-bit value. -#define SPV_GENERATOR_WORD(TOOL, MISC) \ - ((uint32_t(uint16_t(TOOL)) << 16) | uint16_t(MISC)) -// Returns the tool component of the generator word. -#define SPV_GENERATOR_TOOL_PART(WORD) (uint32_t(WORD) >> 16) -// Returns the misc part of the generator word. -#define SPV_GENERATOR_MISC_PART(WORD) (uint32_t(WORD) & 0xFFFF) - -#endif // LIBSPIRV_SPIRV_CONSTANT_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_definition.h vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_definition.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_definition.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_definition.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_SPIRV_DEFINITION_H_ -#define LIBSPIRV_SPIRV_DEFINITION_H_ - -#include - -#include "spirv/1.2/spirv.h" - -#define spvIsInBitfield(value, bitfield) ((value) == ((value)&bitfield)) - -typedef struct spv_header_t { - uint32_t magic; - uint32_t version; - uint32_t generator; - uint32_t bound; - uint32_t schema; // NOTE: Reserved - const uint32_t* instructions; // NOTE: Unfixed pointer to instruciton stream -} spv_header_t; - -#endif // LIBSPIRV_SPIRV_DEFINITION_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_endian.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_endian.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_endian.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_endian.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "spirv_endian.h" - -#include - -enum { - I32_ENDIAN_LITTLE = 0x03020100ul, - I32_ENDIAN_BIG = 0x00010203ul, -}; - -// This constant value allows the detection of the host machine's endianness. -// Accessing it through the "value" member is valid due to C++11 section 3.10 -// paragraph 10. -static const union { - unsigned char bytes[4]; - uint32_t value; -} o32_host_order = {{0, 1, 2, 3}}; - -#define I32_ENDIAN_HOST (o32_host_order.value) - -uint32_t spvFixWord(const uint32_t word, const spv_endianness_t endian) { - if ((SPV_ENDIANNESS_LITTLE == endian && I32_ENDIAN_HOST == I32_ENDIAN_BIG) || - (SPV_ENDIANNESS_BIG == endian && I32_ENDIAN_HOST == I32_ENDIAN_LITTLE)) { - return (word & 0x000000ff) << 24 | (word & 0x0000ff00) << 8 | - (word & 0x00ff0000) >> 8 | (word & 0xff000000) >> 24; - } - - return word; -} - -uint64_t spvFixDoubleWord(const uint32_t low, const uint32_t high, - const spv_endianness_t endian) { - return (uint64_t(spvFixWord(high, endian)) << 32) | spvFixWord(low, endian); -} - -spv_result_t spvBinaryEndianness(spv_const_binary binary, - spv_endianness_t* pEndian) { - if (!binary->code || !binary->wordCount) return SPV_ERROR_INVALID_BINARY; - if (!pEndian) return SPV_ERROR_INVALID_POINTER; - - uint8_t bytes[4]; - memcpy(bytes, binary->code, sizeof(uint32_t)); - - if (0x03 == bytes[0] && 0x02 == bytes[1] && 0x23 == bytes[2] && - 0x07 == bytes[3]) { - *pEndian = SPV_ENDIANNESS_LITTLE; - return SPV_SUCCESS; - } - - if (0x07 == bytes[0] && 0x23 == bytes[1] && 0x02 == bytes[2] && - 0x03 == bytes[3]) { - *pEndian = SPV_ENDIANNESS_BIG; - return SPV_SUCCESS; - } - - return SPV_ERROR_INVALID_BINARY; -} - -bool spvIsHostEndian(spv_endianness_t endian) { - return ((SPV_ENDIANNESS_LITTLE == endian) && - (I32_ENDIAN_LITTLE == I32_ENDIAN_HOST)) || - ((SPV_ENDIANNESS_BIG == endian) && - (I32_ENDIAN_BIG == I32_ENDIAN_HOST)); -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_endian.h vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_endian.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_endian.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_endian.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_SPIRV_ENDIAN_H_ -#define LIBSPIRV_SPIRV_ENDIAN_H_ - -#include "spirv-tools/libspirv.h" - -// Converts a word in the specified endianness to the host native endianness. -uint32_t spvFixWord(const uint32_t word, const spv_endianness_t endianness); - -// Converts a pair of words in the specified endianness to the host native -// endianness. -uint64_t spvFixDoubleWord(const uint32_t low, const uint32_t high, - const spv_endianness_t endianness); - -// Gets the endianness of the SPIR-V module given in the binary parameter. -// Returns SPV_ENDIANNESS_UNKNOWN if the SPIR-V magic number is invalid, -// otherwise writes the determined endianness into *endian. -spv_result_t spvBinaryEndianness(const spv_const_binary binary, - spv_endianness_t* endian); - -// Returns true if the given endianness matches the host's native endiannes. -bool spvIsHostEndian(spv_endianness_t endian); - -#endif // LIBSPIRV_SPIRV_ENDIAN_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_stats.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_stats.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_stats.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_stats.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,326 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include "spirv_stats.h" - -#include - -#include -#include -#include -#include - -#include "binary.h" -#include "diagnostic.h" -#include "enum_string_mapping.h" -#include "extensions.h" -#include "instruction.h" -#include "id_descriptor.h" -#include "opcode.h" -#include "operand.h" -#include "spirv-tools/libspirv.h" -#include "spirv_endian.h" -#include "spirv_validator_options.h" -#include "validate.h" -#include "val/instruction.h" -#include "val/validation_state.h" - -using libspirv::IdDescriptorCollection; -using libspirv::Instruction; -using libspirv::SpirvStats; -using libspirv::ValidationState_t; - -namespace { - -// Helper class for stats aggregation. Receives as in/out parameter. -// Constructs ValidationState and updates it by running validator for each -// instruction. -class StatsAggregator { - public: - StatsAggregator(SpirvStats* in_out_stats, const spv_const_context context) { - stats_ = in_out_stats; - vstate_.reset(new ValidationState_t(context, &validator_options_)); - } - - // Collects header statistics and sets correct id_bound. - spv_result_t ProcessHeader( - spv_endianness_t /* endian */, uint32_t /* magic */, - uint32_t version, uint32_t generator, uint32_t id_bound, - uint32_t /* schema */) { - vstate_->setIdBound(id_bound); - ++stats_->version_hist[version]; - ++stats_->generator_hist[generator]; - return SPV_SUCCESS; - } - - // Runs validator to validate the instruction and update vstate_, - // then procession the instruction to collect stats. - spv_result_t ProcessInstruction(const spv_parsed_instruction_t* inst) { - const spv_result_t validation_result = - spvtools::ValidateInstructionAndUpdateValidationState(vstate_.get(), inst); - if (validation_result != SPV_SUCCESS) - return validation_result; - - ProcessOpcode(); - ProcessCapability(); - ProcessExtension(); - ProcessConstant(); - ProcessEnums(); - ProcessLiteralStrings(); - ProcessNonIdWords(); - ProcessIdDescriptors(); - - return SPV_SUCCESS; - } - - // Collects statistics of descriptors generated by IdDescriptorCollection. - void ProcessIdDescriptors() { - const Instruction& inst = GetCurrentInstruction(); - const uint32_t new_descriptor = - id_descriptors_.ProcessInstruction(inst.c_inst()); - - if (new_descriptor) { - std::stringstream ss; - ss << spvOpcodeString(inst.opcode()); - for (size_t i = 1; i < inst.words().size(); ++i) { - ss << " " << inst.word(i); - } - stats_->id_descriptor_labels.emplace(new_descriptor, ss.str()); - } - - uint32_t index = 0; - for (const auto& operand : inst.operands()) { - if (spvIsIdType(operand.type)) { - const uint32_t descriptor = - id_descriptors_.GetDescriptor(inst.word(operand.offset)); - if (descriptor) { - ++stats_->id_descriptor_hist[descriptor]; - ++stats_->operand_slot_id_descriptor_hist[ - std::pair(inst.opcode(), index)][descriptor]; - } - } - ++index; - } - } - - // Collects statistics of enum words for operands of specific types. - void ProcessEnums() { - const Instruction& inst = GetCurrentInstruction(); - for (const auto& operand : inst.operands()) { - switch (operand.type) { - case SPV_OPERAND_TYPE_SOURCE_LANGUAGE: - case SPV_OPERAND_TYPE_EXECUTION_MODEL: - case SPV_OPERAND_TYPE_ADDRESSING_MODEL: - case SPV_OPERAND_TYPE_MEMORY_MODEL: - case SPV_OPERAND_TYPE_EXECUTION_MODE: - case SPV_OPERAND_TYPE_STORAGE_CLASS: - case SPV_OPERAND_TYPE_DIMENSIONALITY: - case SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE: - case SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE: - case SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT: - case SPV_OPERAND_TYPE_IMAGE_CHANNEL_ORDER: - case SPV_OPERAND_TYPE_IMAGE_CHANNEL_DATA_TYPE: - case SPV_OPERAND_TYPE_FP_ROUNDING_MODE: - case SPV_OPERAND_TYPE_LINKAGE_TYPE: - case SPV_OPERAND_TYPE_ACCESS_QUALIFIER: - case SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE: - case SPV_OPERAND_TYPE_DECORATION: - case SPV_OPERAND_TYPE_BUILT_IN: - case SPV_OPERAND_TYPE_GROUP_OPERATION: - case SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS: - case SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO: - case SPV_OPERAND_TYPE_CAPABILITY: { - ++stats_->enum_hist[operand.type][inst.word(operand.offset)]; - break; - } - default: - break; - } - } - } - - // Collects statistics of literal strings used by opcodes. - void ProcessLiteralStrings() { - const Instruction& inst = GetCurrentInstruction(); - for (const auto& operand : inst.operands()) { - if (operand.type == SPV_OPERAND_TYPE_LITERAL_STRING) { - const std::string str = - reinterpret_cast(&inst.words()[operand.offset]); - ++stats_->literal_strings_hist[inst.opcode()][str]; - } - } - } - - // Collects statistics of all single word non-id operand slots. - void ProcessNonIdWords() { - const Instruction& inst = GetCurrentInstruction(); - uint32_t index = 0; - for (const auto& operand : inst.operands()) { - if (operand.num_words == 1 && !spvIsIdType(operand.type)) { - ++stats_->operand_slot_non_id_words_hist[std::pair( - inst.opcode(), index)][inst.word(operand.offset)]; - } - ++index; - } - } - - // Collects OpCapability statistics. - void ProcessCapability() { - const Instruction& inst = GetCurrentInstruction(); - if (inst.opcode() != SpvOpCapability) return; - const uint32_t capability = inst.word(inst.operands()[0].offset); - ++stats_->capability_hist[capability]; - } - - // Collects OpExtension statistics. - void ProcessExtension() { - const Instruction& inst = GetCurrentInstruction(); - if (inst.opcode() != SpvOpExtension) return; - const std::string extension = libspirv::GetExtensionString(&inst.c_inst()); - ++stats_->extension_hist[extension]; - } - - // Collects OpCode statistics. - void ProcessOpcode() { - auto inst_it = vstate_->ordered_instructions().rbegin(); - const SpvOp opcode = inst_it->opcode(); - ++stats_->opcode_hist[opcode]; - - const uint32_t opcode_and_num_operands = - (uint32_t(inst_it->operands().size()) << 16) | uint32_t(opcode); - ++stats_->opcode_and_num_operands_hist[opcode_and_num_operands]; - - ++inst_it; - - if (inst_it != vstate_->ordered_instructions().rend()) { - const SpvOp prev_opcode = inst_it->opcode(); - ++stats_->opcode_and_num_operands_markov_hist[prev_opcode][ - opcode_and_num_operands]; - } - - auto step_it = stats_->opcode_markov_hist.begin(); - for (; inst_it != vstate_->ordered_instructions().rend() && - step_it != stats_->opcode_markov_hist.end(); ++inst_it, ++step_it) { - auto& hist = (*step_it)[inst_it->opcode()]; - ++hist[opcode]; - } - } - - // Collects OpConstant statistics. - void ProcessConstant() { - const Instruction& inst = GetCurrentInstruction(); - if (inst.opcode() != SpvOpConstant) return; - const uint32_t type_id = inst.GetOperandAs(0); - const auto type_decl_it = vstate_->all_definitions().find(type_id); - assert(type_decl_it != vstate_->all_definitions().end()); - const Instruction& type_decl_inst = *type_decl_it->second; - const SpvOp type_op = type_decl_inst.opcode(); - if (type_op == SpvOpTypeInt) { - const uint32_t bit_width = type_decl_inst.GetOperandAs(1); - const uint32_t is_signed = type_decl_inst.GetOperandAs(2); - assert(is_signed == 0 || is_signed == 1); - if (bit_width == 16) { - if (is_signed) - ++stats_->s16_constant_hist[inst.GetOperandAs(2)]; - else - ++stats_->u16_constant_hist[inst.GetOperandAs(2)]; - } else if (bit_width == 32) { - if (is_signed) - ++stats_->s32_constant_hist[inst.GetOperandAs(2)]; - else - ++stats_->u32_constant_hist[inst.GetOperandAs(2)]; - } else if (bit_width == 64) { - if (is_signed) - ++stats_->s64_constant_hist[inst.GetOperandAs(2)]; - else - ++stats_->u64_constant_hist[inst.GetOperandAs(2)]; - } else { - assert(false && "TypeInt bit width is not 16, 32 or 64"); - } - } else if (type_op == SpvOpTypeFloat) { - const uint32_t bit_width = type_decl_inst.GetOperandAs(1); - if (bit_width == 32) { - ++stats_->f32_constant_hist[inst.GetOperandAs(2)]; - } else if (bit_width == 64) { - ++stats_->f64_constant_hist[inst.GetOperandAs(2)]; - } else { - assert(bit_width == 16); - } - } - } - - SpirvStats* stats() { - return stats_; - } - - private: - // Returns the current instruction (the one last processed by the validator). - const Instruction& GetCurrentInstruction() const { - return vstate_->ordered_instructions().back(); - } - - SpirvStats* stats_; - spv_validator_options_t validator_options_; - std::unique_ptr vstate_; - IdDescriptorCollection id_descriptors_; -}; - -spv_result_t ProcessHeader( - void* user_data, spv_endianness_t endian, uint32_t magic, - uint32_t version, uint32_t generator, uint32_t id_bound, - uint32_t schema) { - StatsAggregator* stats_aggregator = - reinterpret_cast(user_data); - return stats_aggregator->ProcessHeader( - endian, magic, version, generator, id_bound, schema); -} - -spv_result_t ProcessInstruction( - void* user_data, const spv_parsed_instruction_t* inst) { - StatsAggregator* stats_aggregator = - reinterpret_cast(user_data); - return stats_aggregator->ProcessInstruction(inst); -} - -} // namespace - -namespace libspirv { - -spv_result_t AggregateStats( - const spv_context_t& context, const uint32_t* words, const size_t num_words, - spv_diagnostic* pDiagnostic, SpirvStats* stats) { - spv_const_binary_t binary = {words, num_words}; - - spv_endianness_t endian; - spv_position_t position = {}; - if (spvBinaryEndianness(&binary, &endian)) { - return libspirv::DiagnosticStream(position, context.consumer, - SPV_ERROR_INVALID_BINARY) - << "Invalid SPIR-V magic number."; - } - - spv_header_t header; - if (spvBinaryHeaderGet(&binary, endian, &header)) { - return libspirv::DiagnosticStream(position, context.consumer, - SPV_ERROR_INVALID_BINARY) - << "Invalid SPIR-V header."; - } - - StatsAggregator stats_aggregator(stats, &context); - - return spvBinaryParse(&context, &stats_aggregator, words, num_words, - ProcessHeader, ProcessInstruction, pDiagnostic); -} - -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_stats.h vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_stats.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_stats.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_stats.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,128 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_SPIRV_STATS_H_ -#define LIBSPIRV_SPIRV_STATS_H_ - -#include -#include -#include -#include - -#include "spirv-tools/libspirv.hpp" - -namespace libspirv { - -struct SpirvStats { - // Version histogram, version_word -> count. - std::unordered_map version_hist; - - // Generator histogram, generator_word -> count. - std::unordered_map generator_hist; - - // Capability histogram, SpvCapabilityXXX -> count. - std::unordered_map capability_hist; - - // Extension histogram, extension_string -> count. - std::unordered_map extension_hist; - - // Opcode histogram, SpvOpXXX -> count. - std::unordered_map opcode_hist; - - // Histogram of words combining opcode and number of operands, - // opcode | (num_operands << 16) -> count. - std::unordered_map opcode_and_num_operands_hist; - - // OpConstant u16 histogram, value -> count. - std::unordered_map u16_constant_hist; - - // OpConstant u32 histogram, value -> count. - std::unordered_map u32_constant_hist; - - // OpConstant u64 histogram, value -> count. - std::unordered_map u64_constant_hist; - - // OpConstant s16 histogram, value -> count. - std::unordered_map s16_constant_hist; - - // OpConstant s32 histogram, value -> count. - std::unordered_map s32_constant_hist; - - // OpConstant s64 histogram, value -> count. - std::unordered_map s64_constant_hist; - - // OpConstant f32 histogram, value -> count. - std::unordered_map f32_constant_hist; - - // OpConstant f64 histogram, value -> count. - std::unordered_map f64_constant_hist; - - // Enum histogram, operand type -> operand value -> count. - std::unordered_map> enum_hist; - - // Histogram of all non-id single words. - // pair -> value -> count. - // This is a generalization of enum_hist, also includes literal integers and - // masks. - std::map, - std::map> operand_slot_non_id_words_hist; - - // Historgam of descriptors generated by IdDescriptorCollection. - // Descriptor -> count. - std::unordered_map id_descriptor_hist; - - // Debut labels for id descriptors, descriptor -> label. - std::unordered_map id_descriptor_labels; - - // Historgam of descriptors generated by IdDescriptorCollection for every - // operand slot. pair -> descriptor -> count. - std::map, - std::map> operand_slot_id_descriptor_hist; - - // Histogram of literal strings, sharded by opcodes, opcode -> string -> count. - // This is suboptimal if an opcode has multiple literal string operands, - // as it wouldn't differentiate between operands. - std::unordered_map> - literal_strings_hist; - - // Markov chain histograms: - // opcode -> next(opcode | (num_operands << 16)) -> count. - // See also opcode_and_num_operands_hist, which collects global statistics. - std::unordered_map> - opcode_and_num_operands_markov_hist; - - // Used to collect statistics on opcodes triggering other opcodes. - // Container scheme: gap between instructions -> cue opcode -> later opcode - // -> count. - // For example opcode_markov_hist[2][OpFMul][OpFAdd] corresponds to - // the number of times an OpMul appears, followed by 2 other instructions, - // followed by OpFAdd. - // opcode_markov_hist[0][OpFMul][OpFAdd] corresponds to how many times - // OpFMul appears, directly followed by OpFAdd. - // The size of the outer std::vector also serves as an input parameter, - // determining how many steps will be collected. - // I.e. do opcode_markov_hist.resize(1) to collect data for one step only. - std::vector>> opcode_markov_hist; -}; - -// Aggregates existing |stats| with new stats extracted from |binary|. -spv_result_t AggregateStats( - const spv_context_t& context, const uint32_t* words, const size_t num_words, - spv_diagnostic* pDiagnostic, SpirvStats* stats); - -} // namespace libspirv - -#endif // LIBSPIRV_SPIRV_STATS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_target_env.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_target_env.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_target_env.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_target_env.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include - -#include "spirv-tools/libspirv.h" -#include "spirv_constant.h" - -const char* spvTargetEnvDescription(spv_target_env env) { - switch (env) { - case SPV_ENV_UNIVERSAL_1_0: - return "SPIR-V 1.0"; - case SPV_ENV_VULKAN_1_0: - return "SPIR-V 1.0 (under Vulkan 1.0 semantics)"; - case SPV_ENV_UNIVERSAL_1_1: - return "SPIR-V 1.1"; - case SPV_ENV_OPENCL_2_1: - return "SPIR-V 1.0 (under OpenCL 2.1 semantics)"; - case SPV_ENV_OPENCL_2_2: - return "SPIR-V 1.1 (under OpenCL 2.2 semantics)"; - case SPV_ENV_OPENGL_4_0: - return "SPIR-V 1.0 (under OpenCL 4.0 semantics)"; - case SPV_ENV_OPENGL_4_1: - return "SPIR-V 1.0 (under OpenCL 4.1 semantics)"; - case SPV_ENV_OPENGL_4_2: - return "SPIR-V 1.0 (under OpenCL 4.2 semantics)"; - case SPV_ENV_OPENGL_4_3: - return "SPIR-V 1.0 (under OpenCL 4.3 semantics)"; - case SPV_ENV_OPENGL_4_5: - return "SPIR-V 1.0 (under OpenCL 4.5 semantics)"; - case SPV_ENV_UNIVERSAL_1_2: - return "SPIR-V 1.2"; - } - assert(0 && "Unhandled SPIR-V target environment"); - return ""; -} - -uint32_t spvVersionForTargetEnv(spv_target_env env) { - switch (env) { - case SPV_ENV_UNIVERSAL_1_0: - case SPV_ENV_VULKAN_1_0: - case SPV_ENV_OPENCL_2_1: - case SPV_ENV_OPENGL_4_0: - case SPV_ENV_OPENGL_4_1: - case SPV_ENV_OPENGL_4_2: - case SPV_ENV_OPENGL_4_3: - case SPV_ENV_OPENGL_4_5: - return SPV_SPIRV_VERSION_WORD(1, 0); - case SPV_ENV_UNIVERSAL_1_1: - return SPV_SPIRV_VERSION_WORD(1, 1); - case SPV_ENV_UNIVERSAL_1_2: - case SPV_ENV_OPENCL_2_2: - return SPV_SPIRV_VERSION_WORD(1, 2); - } - assert(0 && "Unhandled SPIR-V target environment"); - return SPV_SPIRV_VERSION_WORD(0, 0); -} - -bool spvParseTargetEnv(const char* s, spv_target_env* env) { - auto match = [s](const char* b) { - return s && (0 == strncmp(s, b, strlen(b))); - }; - if (match("vulkan1.0")) { - if (env) *env = SPV_ENV_VULKAN_1_0; - return true; - } else if (match("spv1.0")) { - if (env) *env = SPV_ENV_UNIVERSAL_1_0; - return true; - } else if (match("spv1.1")) { - if (env) *env = SPV_ENV_UNIVERSAL_1_1; - return true; - } else if (match("spv1.2")) { - if (env) *env = SPV_ENV_UNIVERSAL_1_2; - return true; - } else if (match("opencl2.1")) { - if (env) *env = SPV_ENV_OPENCL_2_1; - return true; - } else if (match("opencl2.2")) { - if (env) *env = SPV_ENV_OPENCL_2_2; - return true; - } else if (match("opengl4.0")) { - if (env) *env = SPV_ENV_OPENGL_4_0; - return true; - } else if (match("opengl4.1")) { - if (env) *env = SPV_ENV_OPENGL_4_1; - return true; - } else if (match("opengl4.2")) { - if (env) *env = SPV_ENV_OPENGL_4_2; - return true; - } else if (match("opengl4.3")) { - if (env) *env = SPV_ENV_OPENGL_4_3; - return true; - } else if (match("opengl4.5")) { - if (env) *env = SPV_ENV_OPENGL_4_5; - return true; - } else { - if (env) *env = SPV_ENV_UNIVERSAL_1_0; - return false; - } -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_target_env.h vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_target_env.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_target_env.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_target_env.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_SPIRV_TARGET_ENV_H_ -#define LIBSPIRV_SPIRV_TARGET_ENV_H_ - -#include "spirv-tools/libspirv.h" - -// Parses s into *env and returns true if successful. If unparsable, returns -// false and sets *env to SPV_ENV_UNIVERSAL_1_0. -bool spvParseTargetEnv(const char* s, spv_target_env* env); - -#endif // LIBSPIRV_SPIRV_TARGET_ENV_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_validator_options.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_validator_options.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_validator_options.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_validator_options.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include -#include - -#include "spirv_validator_options.h" - -bool spvParseUniversalLimitsOptions(const char* s, spv_validator_limit* type) { - auto match = [s](const char* b) { - return s && (0 == strncmp(s, b, strlen(b))); - }; - if (match("--max-struct-members")) { - *type = spv_validator_limit_max_struct_members; - } else if (match("--max-struct_depth")) { - *type = spv_validator_limit_max_struct_depth; - } else if (match("--max-local-variables")) { - *type = spv_validator_limit_max_local_variables; - } else if (match("--max-global-variables")) { - *type = spv_validator_limit_max_global_variables; - } else if (match("--max-switch-branches")) { - *type = spv_validator_limit_max_global_variables; - } else if (match("--max-function-args")) { - *type = spv_validator_limit_max_function_args; - } else if (match("--max-control-flow-nesting-depth")) { - *type = spv_validator_limit_max_control_flow_nesting_depth; - } else if (match("--max-access-chain-indexes")) { - *type = spv_validator_limit_max_access_chain_indexes; - } else { - // The command line option for this validator limit has not been added. - // Therefore we return false. - return false; - } - - return true; -} - -spv_validator_options spvValidatorOptionsCreate() { - return new spv_validator_options_t; -} - -void spvValidatorOptionsDestroy(spv_validator_options options) { - delete options; -} - -void spvValidatorOptionsSetUniversalLimit(spv_validator_options options, - spv_validator_limit limit_type, - uint32_t limit) { - assert(options && "Validator options object may not be Null"); - switch(limit_type) { -#define LIMIT(TYPE, FIELD) \ - case TYPE: \ - options->universal_limits_.FIELD = limit; \ - break; - LIMIT(spv_validator_limit_max_struct_members, max_struct_members) - LIMIT(spv_validator_limit_max_struct_depth, max_struct_depth) - LIMIT(spv_validator_limit_max_local_variables, max_local_variables) - LIMIT(spv_validator_limit_max_global_variables, max_global_variables) - LIMIT(spv_validator_limit_max_switch_branches, max_switch_branches) - LIMIT(spv_validator_limit_max_function_args, max_function_args) - LIMIT(spv_validator_limit_max_control_flow_nesting_depth, - max_control_flow_nesting_depth) - LIMIT(spv_validator_limit_max_access_chain_indexes, max_access_chain_indexes) -#undef LIMIT - } -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_validator_options.h vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_validator_options.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/spirv_validator_options.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/spirv_validator_options.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_SPIRV_VALIDATOR_OPTIONS_H_ -#define LIBSPIRV_SPIRV_VALIDATOR_OPTIONS_H_ - -#include "spirv-tools/libspirv.h" - -// Return true if the command line option for the validator limit is valid (Also -// returns the Enum for option in this case). Returns false otherwise. -bool spvParseUniversalLimitsOptions(const char* s, spv_validator_limit* limit); - -// Default initialization of this structure is to the default Universal Limits -// described in the SPIR-V Spec. -struct validator_universal_limits_t { - uint32_t max_struct_members{16383}; - uint32_t max_struct_depth{255}; - uint32_t max_local_variables{524287}; - uint32_t max_global_variables{65535}; - uint32_t max_switch_branches{16383}; - uint32_t max_function_args{255}; - uint32_t max_control_flow_nesting_depth{1023}; - uint32_t max_access_chain_indexes{255}; -}; - -// Manages command line options passed to the SPIR-V Validator. New struct -// members may be added for any new option. -struct spv_validator_options_t { - spv_validator_options_t() - : universal_limits_() {} - - validator_universal_limits_t universal_limits_; -}; - -#endif // LIBSPIRV_SPIRV_VALIDATOR_OPTIONS_H_ - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/table.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/table.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/table.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/table.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "table.h" - -#include - -spv_context spvContextCreate(spv_target_env env) { - switch (env) { - case SPV_ENV_UNIVERSAL_1_0: - case SPV_ENV_VULKAN_1_0: - case SPV_ENV_UNIVERSAL_1_1: - case SPV_ENV_OPENCL_2_1: - case SPV_ENV_OPENCL_2_2: - case SPV_ENV_OPENGL_4_0: - case SPV_ENV_OPENGL_4_1: - case SPV_ENV_OPENGL_4_2: - case SPV_ENV_OPENGL_4_3: - case SPV_ENV_OPENGL_4_5: - case SPV_ENV_UNIVERSAL_1_2: - break; - default: - return nullptr; - } - - spv_opcode_table opcode_table; - spv_operand_table operand_table; - spv_ext_inst_table ext_inst_table; - - spvOpcodeTableGet(&opcode_table, env); - spvOperandTableGet(&operand_table, env); - spvExtInstTableGet(&ext_inst_table, env); - - return new spv_context_t{env, opcode_table, operand_table, ext_inst_table, - nullptr /* a null default consumer */}; -} - -void spvContextDestroy(spv_context context) { delete context; } - -void SetContextMessageConsumer(spv_context context, - spvtools::MessageConsumer consumer) { - context->consumer = std::move(consumer); -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/table.h vulkan-1.1.73+dfsg/external/spirv-tools/source/table.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/table.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/table.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_TABLE_H_ -#define LIBSPIRV_TABLE_H_ - -#include "spirv/1.2/spirv.h" - -#include "extensions.h" -#include "message.h" -#include "spirv-tools/libspirv.hpp" - -typedef struct spv_opcode_desc_t { - const char* name; - const SpvOp opcode; - const libspirv::CapabilitySet capabilities; - // operandTypes[0..numTypes-1] describe logical operands for the instruction. - // The operand types include result id and result-type id, followed by - // the types of arguments. - uint16_t numTypes; - spv_operand_type_t operandTypes[16]; // TODO: Smaller/larger? - const bool hasResult; // Does the instruction have a result ID operand? - const bool hasType; // Does the instruction have a type ID operand? -} spv_opcode_desc_t; - -typedef struct spv_operand_desc_t { - const char* name; - const uint32_t value; - const libspirv::CapabilitySet capabilities; - // A set of extensions that enable this feature. If empty then this operand - // value is always enabled, i.e. it's in core. The assembler, binary parser, - // and disassembler ignore this rule, so you can freely process invalid - // modules. - const libspirv::ExtensionSet extensions; - const spv_operand_type_t operandTypes[16]; // TODO: Smaller/larger? -} spv_operand_desc_t; - -typedef struct spv_operand_desc_group_t { - const spv_operand_type_t type; - const uint32_t count; - const spv_operand_desc_t* entries; -} spv_operand_desc_group_t; - -typedef struct spv_ext_inst_desc_t { - const char* name; - const uint32_t ext_inst; - const libspirv::CapabilitySet capabilities; - const spv_operand_type_t operandTypes[16]; // TODO: Smaller/larger? -} spv_ext_inst_desc_t; - -typedef struct spv_ext_inst_group_t { - const spv_ext_inst_type_t type; - const uint32_t count; - const spv_ext_inst_desc_t* entries; -} spv_ext_inst_group_t; - -typedef struct spv_opcode_table_t { - const uint32_t count; - const spv_opcode_desc_t* entries; -} spv_opcode_table_t; - -typedef struct spv_operand_table_t { - const uint32_t count; - const spv_operand_desc_group_t* types; -} spv_operand_table_t; - -typedef struct spv_ext_inst_table_t { - const uint32_t count; - const spv_ext_inst_group_t* groups; -} spv_ext_inst_table_t; - -typedef const spv_opcode_desc_t* spv_opcode_desc; -typedef const spv_operand_desc_t* spv_operand_desc; -typedef const spv_ext_inst_desc_t* spv_ext_inst_desc; - -typedef const spv_opcode_table_t* spv_opcode_table; -typedef const spv_operand_table_t* spv_operand_table; -typedef const spv_ext_inst_table_t* spv_ext_inst_table; - -struct spv_context_t { - const spv_target_env target_env; - const spv_opcode_table opcode_table; - const spv_operand_table operand_table; - const spv_ext_inst_table ext_inst_table; - spvtools::MessageConsumer consumer; -}; - -// Sets the message consumer to |consumer| in the given |context|. The original -// message consumer will be overwritten. -void SetContextMessageConsumer(spv_context context, - spvtools::MessageConsumer consumer); - -// Populates *table with entries for env. -spv_result_t spvOpcodeTableGet(spv_opcode_table* table, spv_target_env env); - -// Populates *table with entries for env. -spv_result_t spvOperandTableGet(spv_operand_table* table, spv_target_env env); - -// Populates *table with entries for env. -spv_result_t spvExtInstTableGet(spv_ext_inst_table* table, spv_target_env env); - -#endif // LIBSPIRV_TABLE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/text.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/text.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/text.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/text.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,802 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "text.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "assembly_grammar.h" -#include "binary.h" -#include "diagnostic.h" -#include "ext_inst.h" -#include "instruction.h" -#include "message.h" -#include "opcode.h" -#include "operand.h" -#include "spirv-tools/libspirv.h" -#include "spirv_constant.h" -#include "table.h" -#include "text_handler.h" -#include "util/bitutils.h" -#include "util/parse_number.h" - -bool spvIsValidIDCharacter(const char value) { - return value == '_' || 0 != ::isalnum(value); -} - -// Returns true if the given string represents a valid ID name. -bool spvIsValidID(const char* textValue) { - const char* c = textValue; - for (; *c != '\0'; ++c) { - if (!spvIsValidIDCharacter(*c)) { - return false; - } - } - // If the string was empty, then the ID also is not valid. - return c != textValue; -} - -// Text API - -spv_result_t spvTextToLiteral(const char* textValue, spv_literal_t* pLiteral) { - bool isSigned = false; - int numPeriods = 0; - bool isString = false; - - const size_t len = strlen(textValue); - if (len == 0) return SPV_FAILED_MATCH; - - for (uint64_t index = 0; index < len; ++index) { - switch (textValue[index]) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - break; - case '.': - numPeriods++; - break; - case '-': - if (index == 0) { - isSigned = true; - } else { - isString = true; - } - break; - default: - isString = true; - index = len; // break out of the loop too. - break; - } - } - - pLiteral->type = spv_literal_type_t(99); - - if (isString || numPeriods > 1 || (isSigned && len == 1)) { - if (len < 2 || textValue[0] != '"' || textValue[len - 1] != '"') - return SPV_FAILED_MATCH; - bool escaping = false; - for (const char* val = textValue + 1; val != textValue + len - 1; ++val) { - if ((*val == '\\') && (!escaping)) { - escaping = true; - } else { - // Have to save space for the null-terminator - if (pLiteral->str.size() >= SPV_LIMIT_LITERAL_STRING_BYTES_MAX) - return SPV_ERROR_OUT_OF_MEMORY; - pLiteral->str.push_back(*val); - escaping = false; - } - } - - pLiteral->type = SPV_LITERAL_TYPE_STRING; - } else if (numPeriods == 1) { - double d = std::strtod(textValue, nullptr); - float f = (float)d; - if (d == (double)f) { - pLiteral->type = SPV_LITERAL_TYPE_FLOAT_32; - pLiteral->value.f = f; - } else { - pLiteral->type = SPV_LITERAL_TYPE_FLOAT_64; - pLiteral->value.d = d; - } - } else if (isSigned) { - int64_t i64 = strtoll(textValue, nullptr, 10); - int32_t i32 = (int32_t)i64; - if (i64 == (int64_t)i32) { - pLiteral->type = SPV_LITERAL_TYPE_INT_32; - pLiteral->value.i32 = i32; - } else { - pLiteral->type = SPV_LITERAL_TYPE_INT_64; - pLiteral->value.i64 = i64; - } - } else { - uint64_t u64 = strtoull(textValue, nullptr, 10); - uint32_t u32 = (uint32_t)u64; - if (u64 == (uint64_t)u32) { - pLiteral->type = SPV_LITERAL_TYPE_UINT_32; - pLiteral->value.u32 = u32; - } else { - pLiteral->type = SPV_LITERAL_TYPE_UINT_64; - pLiteral->value.u64 = u64; - } - } - - return SPV_SUCCESS; -} - -namespace { - -/// Parses an immediate integer from text, guarding against overflow. If -/// successful, adds the parsed value to pInst, advances the context past it, -/// and returns SPV_SUCCESS. Otherwise, leaves pInst alone, emits diagnostics, -/// and returns SPV_ERROR_INVALID_TEXT. -spv_result_t encodeImmediate(libspirv::AssemblyContext* context, - const char* text, spv_instruction_t* pInst) { - assert(*text == '!'); - uint32_t parse_result; - if (!spvutils::ParseNumber(text + 1, &parse_result)) { - return context->diagnostic(SPV_ERROR_INVALID_TEXT) - << "Invalid immediate integer: !" << text + 1; - } - context->binaryEncodeU32(parse_result, pInst); - context->seekForward(static_cast(strlen(text))); - return SPV_SUCCESS; -} - -} // anonymous namespace - -/// @brief Translate an Opcode operand to binary form -/// -/// @param[in] grammar the grammar to use for compilation -/// @param[in, out] context the dynamic compilation info -/// @param[in] type of the operand -/// @param[in] textValue word of text to be parsed -/// @param[out] pInst return binary Opcode -/// @param[in,out] pExpectedOperands the operand types expected -/// -/// @return result code -spv_result_t spvTextEncodeOperand(const libspirv::AssemblyGrammar& grammar, - libspirv::AssemblyContext* context, - const spv_operand_type_t type, - const char* textValue, - spv_instruction_t* pInst, - spv_operand_pattern_t* pExpectedOperands) { - // NOTE: Handle immediate int in the stream - if ('!' == textValue[0]) { - if (auto error = encodeImmediate(context, textValue, pInst)) { - return error; - } - *pExpectedOperands = - spvAlternatePatternFollowingImmediate(*pExpectedOperands); - return SPV_SUCCESS; - } - - // Optional literal operands can fail to parse. In that case use - // SPV_FAILED_MATCH to avoid emitting a diagostic. Use the following - // for those situations. - spv_result_t error_code_for_literals = - spvOperandIsOptional(type) ? SPV_FAILED_MATCH : SPV_ERROR_INVALID_TEXT; - - switch (type) { - case SPV_OPERAND_TYPE_ID: - case SPV_OPERAND_TYPE_TYPE_ID: - case SPV_OPERAND_TYPE_RESULT_ID: - case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: - case SPV_OPERAND_TYPE_SCOPE_ID: - case SPV_OPERAND_TYPE_OPTIONAL_ID: { - if ('%' == textValue[0]) { - textValue++; - } else { - return context->diagnostic() << "Expected id to start with %."; - } - if (!spvIsValidID(textValue)) { - return context->diagnostic() << "Invalid ID " << textValue; - } - const uint32_t id = context->spvNamedIdAssignOrGet(textValue); - if (type == SPV_OPERAND_TYPE_TYPE_ID) pInst->resultTypeId = id; - spvInstructionAddWord(pInst, id); - - // Set the extended instruction type. - // The import set id is the 3rd operand of OpExtInst. - if (pInst->opcode == SpvOpExtInst && pInst->words.size() == 4) { - auto ext_inst_type = context->getExtInstTypeForId(pInst->words[3]); - if (ext_inst_type == SPV_EXT_INST_TYPE_NONE) { - return context->diagnostic() - << "Invalid extended instruction import Id " - << pInst->words[2]; - } - pInst->extInstType = ext_inst_type; - } - } break; - - case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: { - // The assembler accepts the symbolic name for an extended instruction, - // and emits its corresponding number. - spv_ext_inst_desc extInst; - if (grammar.lookupExtInst(pInst->extInstType, textValue, &extInst)) { - return context->diagnostic() << "Invalid extended instruction name '" - << textValue << "'."; - } - spvInstructionAddWord(pInst, extInst->ext_inst); - - // Prepare to parse the operands for the extended instructions. - spvPushOperandTypes(extInst->operandTypes, pExpectedOperands); - } break; - - case SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER: { - // The assembler accepts the symbolic name for the opcode, but without - // the "Op" prefix. For example, "IAdd" is accepted. The number - // of the opcode is emitted. - SpvOp opcode; - if (grammar.lookupSpecConstantOpcode(textValue, &opcode)) { - return context->diagnostic() << "Invalid " << spvOperandTypeStr(type) - << " '" << textValue << "'."; - } - spv_opcode_desc opcodeEntry = nullptr; - if (grammar.lookupOpcode(opcode, &opcodeEntry)) { - return context->diagnostic(SPV_ERROR_INTERNAL) - << "OpSpecConstant opcode table out of sync"; - } - spvInstructionAddWord(pInst, uint32_t(opcodeEntry->opcode)); - - // Prepare to parse the operands for the opcode. Except skip the - // type Id and result Id, since they've already been processed. - assert(opcodeEntry->hasType); - assert(opcodeEntry->hasResult); - assert(opcodeEntry->numTypes >= 2); - spvPushOperandTypes(opcodeEntry->operandTypes + 2, pExpectedOperands); - } break; - - case SPV_OPERAND_TYPE_LITERAL_INTEGER: - case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER: { - // The current operand is an *unsigned* 32-bit integer. - // That's just how the grammar works. - libspirv::IdType expected_type = { - 32, false, libspirv::IdTypeClass::kScalarIntegerType}; - if (auto error = context->binaryEncodeNumericLiteral( - textValue, error_code_for_literals, expected_type, pInst)) { - return error; - } - } break; - - case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_NUMBER: - // This is a context-independent literal number which can be a 32-bit - // number of floating point value. - if (auto error = context->binaryEncodeNumericLiteral( - textValue, error_code_for_literals, libspirv::kUnknownType, - pInst)) { - return error; - } - break; - - case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER: - case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: { - libspirv::IdType expected_type = libspirv::kUnknownType; - // The encoding for OpConstant, OpSpecConstant and OpSwitch all - // depend on either their own result-id or the result-id of - // one of their parameters. - if (SpvOpConstant == pInst->opcode || - SpvOpSpecConstant == pInst->opcode) { - // The type of the literal is determined by the type Id of the - // instruction. - expected_type = - context->getTypeOfTypeGeneratingValue(pInst->resultTypeId); - if (!libspirv::isScalarFloating(expected_type) && - !libspirv::isScalarIntegral(expected_type)) { - spv_opcode_desc d; - const char* opcode_name = "opcode"; - if (SPV_SUCCESS == grammar.lookupOpcode(pInst->opcode, &d)) { - opcode_name = d->name; - } - return context->diagnostic() - << "Type for " << opcode_name - << " must be a scalar floating point or integer type"; - } - } else if (pInst->opcode == SpvOpSwitch) { - // The type of the literal is the same as the type of the selector. - expected_type = context->getTypeOfValueInstruction(pInst->words[1]); - if (!libspirv::isScalarIntegral(expected_type)) { - return context->diagnostic() - << "The selector operand for OpSwitch must be the result" - " of an instruction that generates an integer scalar"; - } - } - if (auto error = context->binaryEncodeNumericLiteral( - textValue, error_code_for_literals, expected_type, pInst)) { - return error; - } - } break; - - case SPV_OPERAND_TYPE_LITERAL_STRING: - case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING: { - spv_literal_t literal = {}; - spv_result_t error = spvTextToLiteral(textValue, &literal); - if (error != SPV_SUCCESS) { - if (error == SPV_ERROR_OUT_OF_MEMORY) return error; - return context->diagnostic(error_code_for_literals) - << "Invalid literal string '" << textValue << "'."; - } - if (literal.type != SPV_LITERAL_TYPE_STRING) { - return context->diagnostic() - << "Expected literal string, found literal number '" << textValue - << "'."; - } - - // NOTE: Special case for extended instruction library import - if (SpvOpExtInstImport == pInst->opcode) { - const spv_ext_inst_type_t ext_inst_type = - spvExtInstImportTypeGet(literal.str.c_str()); - if (SPV_EXT_INST_TYPE_NONE == ext_inst_type) { - return context->diagnostic() - << "Invalid extended instruction import '" << literal.str - << "'"; - } - if ((error = context->recordIdAsExtInstImport(pInst->words[1], - ext_inst_type))) - return error; - } - - if (context->binaryEncodeString(literal.str.c_str(), pInst)) - return SPV_ERROR_INVALID_TEXT; - } break; - case SPV_OPERAND_TYPE_FP_FAST_MATH_MODE: - case SPV_OPERAND_TYPE_FUNCTION_CONTROL: - case SPV_OPERAND_TYPE_LOOP_CONTROL: - case SPV_OPERAND_TYPE_IMAGE: - case SPV_OPERAND_TYPE_OPTIONAL_IMAGE: - case SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS: - case SPV_OPERAND_TYPE_SELECTION_CONTROL: { - uint32_t value; - if (grammar.parseMaskOperand(type, textValue, &value)) { - return context->diagnostic() << "Invalid " << spvOperandTypeStr(type) - << " operand '" << textValue << "'."; - } - if (auto error = context->binaryEncodeU32(value, pInst)) return error; - // Prepare to parse the operands for this logical operand. - grammar.pushOperandTypesForMask(type, value, pExpectedOperands); - } break; - case SPV_OPERAND_TYPE_OPTIONAL_CIV: { - auto error = spvTextEncodeOperand( - grammar, context, SPV_OPERAND_TYPE_OPTIONAL_LITERAL_NUMBER, textValue, - pInst, pExpectedOperands); - if (error == SPV_FAILED_MATCH) { - // It's not a literal number -- is it a literal string? - error = spvTextEncodeOperand(grammar, context, - SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING, - textValue, pInst, pExpectedOperands); - } - if (error == SPV_FAILED_MATCH) { - // It's not a literal -- is it an ID? - error = - spvTextEncodeOperand(grammar, context, SPV_OPERAND_TYPE_OPTIONAL_ID, - textValue, pInst, pExpectedOperands); - } - if (error) { - return context->diagnostic(error) - << "Invalid word following !: " << textValue; - } - if (pExpectedOperands->empty()) { - pExpectedOperands->push_back(SPV_OPERAND_TYPE_OPTIONAL_CIV); - } - } break; - default: { - // NOTE: All non literal operands are handled here using the operand - // table. - spv_operand_desc entry; - if (grammar.lookupOperand(type, textValue, strlen(textValue), &entry)) { - return context->diagnostic() << "Invalid " << spvOperandTypeStr(type) - << " '" << textValue << "'."; - } - if (context->binaryEncodeU32(entry->value, pInst)) { - return context->diagnostic() << "Invalid " << spvOperandTypeStr(type) - << " '" << textValue << "'."; - } - - // Prepare to parse the operands for this logical operand. - spvPushOperandTypes(entry->operandTypes, pExpectedOperands); - } break; - } - return SPV_SUCCESS; -} - -namespace { - -/// Encodes an instruction started by ! at the given position in text. -/// -/// Puts the encoded words into *pInst. If successful, moves position past the -/// instruction and returns SPV_SUCCESS. Otherwise, returns an error code and -/// leaves position pointing to the error in text. -spv_result_t encodeInstructionStartingWithImmediate( - const libspirv::AssemblyGrammar& grammar, - libspirv::AssemblyContext* context, spv_instruction_t* pInst) { - std::string firstWord; - spv_position_t nextPosition = {}; - auto error = context->getWord(&firstWord, &nextPosition); - if (error) return context->diagnostic(error) << "Internal Error"; - - if ((error = encodeImmediate(context, firstWord.c_str(), pInst))) { - return error; - } - while (context->advance() != SPV_END_OF_STREAM) { - // A beginning of a new instruction means we're done. - if (context->isStartOfNewInst()) return SPV_SUCCESS; - - // Otherwise, there must be an operand that's either a literal, an ID, or - // an immediate. - std::string operandValue; - if ((error = context->getWord(&operandValue, &nextPosition))) - return context->diagnostic(error) << "Internal Error"; - - if (operandValue == "=") - return context->diagnostic() << firstWord << " not allowed before =."; - - // Needed to pass to spvTextEncodeOpcode(), but it shouldn't ever be - // expanded. - spv_operand_pattern_t dummyExpectedOperands; - error = spvTextEncodeOperand( - grammar, context, SPV_OPERAND_TYPE_OPTIONAL_CIV, operandValue.c_str(), - pInst, &dummyExpectedOperands); - if (error) return error; - context->setPosition(nextPosition); - } - return SPV_SUCCESS; -} - -/// @brief Translate single Opcode and operands to binary form -/// -/// @param[in] grammar the grammar to use for compilation -/// @param[in, out] context the dynamic compilation info -/// @param[in] text stream to translate -/// @param[out] pInst returned binary Opcode -/// @param[in,out] pPosition in the text stream -/// -/// @return result code -spv_result_t spvTextEncodeOpcode(const libspirv::AssemblyGrammar& grammar, - libspirv::AssemblyContext* context, - spv_instruction_t* pInst) { - // Check for ! first. - if ('!' == context->peek()) { - return encodeInstructionStartingWithImmediate(grammar, context, pInst); - } - - std::string firstWord; - spv_position_t nextPosition = {}; - spv_result_t error = context->getWord(&firstWord, &nextPosition); - if (error) return context->diagnostic() << "Internal Error"; - - std::string opcodeName; - std::string result_id; - spv_position_t result_id_position = {}; - if (context->startsWithOp()) { - opcodeName = firstWord; - } else { - result_id = firstWord; - if ('%' != result_id.front()) { - return context->diagnostic() - << "Expected or at the beginning " - "of an instruction, found '" - << result_id << "'."; - } - result_id_position = context->position(); - - // The '=' sign. - context->setPosition(nextPosition); - if (context->advance()) - return context->diagnostic() << "Expected '=', found end of stream."; - std::string equal_sign; - error = context->getWord(&equal_sign, &nextPosition); - if ("=" != equal_sign) - return context->diagnostic() << "'=' expected after result id."; - - // The after the '=' sign. - context->setPosition(nextPosition); - if (context->advance()) - return context->diagnostic() << "Expected opcode, found end of stream."; - error = context->getWord(&opcodeName, &nextPosition); - if (error) return context->diagnostic(error) << "Internal Error"; - if (!context->startsWithOp()) { - return context->diagnostic() << "Invalid Opcode prefix '" << opcodeName - << "'."; - } - } - - // NOTE: The table contains Opcode names without the "Op" prefix. - const char* pInstName = opcodeName.data() + 2; - - spv_opcode_desc opcodeEntry; - error = grammar.lookupOpcode(pInstName, &opcodeEntry); - if (error) { - return context->diagnostic(error) << "Invalid Opcode name '" << opcodeName - << "'"; - } - if (opcodeEntry->hasResult && result_id.empty()) { - return context->diagnostic() - << "Expected at the beginning of an instruction, found '" - << firstWord << "'."; - } - pInst->opcode = opcodeEntry->opcode; - context->setPosition(nextPosition); - // Reserve the first word for the instruction. - spvInstructionAddWord(pInst, 0); - - // Maintains the ordered list of expected operand types. - // For many instructions we only need the {numTypes, operandTypes} - // entries in opcodeEntry. However, sometimes we need to modify - // the list as we parse the operands. This occurs when an operand - // has its own logical operands (such as the LocalSize operand for - // ExecutionMode), or for extended instructions that may have their - // own operands depending on the selected extended instruction. - spv_operand_pattern_t expectedOperands; - expectedOperands.reserve(opcodeEntry->numTypes); - for (auto i = 0; i < opcodeEntry->numTypes; i++) - expectedOperands.push_back(opcodeEntry->operandTypes[opcodeEntry->numTypes - i - 1]); - - while (!expectedOperands.empty()) { - const spv_operand_type_t type = expectedOperands.back(); - expectedOperands.pop_back(); - - // Expand optional tuples lazily. - if (spvExpandOperandSequenceOnce(type, &expectedOperands)) continue; - - if (type == SPV_OPERAND_TYPE_RESULT_ID && !result_id.empty()) { - // Handle the for value generating instructions. - // We've already consumed it from the text stream. Here - // we inject its words into the instruction. - spv_position_t temp_pos = context->position(); - error = spvTextEncodeOperand(grammar, context, SPV_OPERAND_TYPE_RESULT_ID, - result_id.c_str(), pInst, nullptr); - result_id_position = context->position(); - // Because we are injecting we have to reset the position afterwards. - context->setPosition(temp_pos); - if (error) return error; - } else { - // Find the next word. - error = context->advance(); - if (error == SPV_END_OF_STREAM) { - if (spvOperandIsOptional(type)) { - // This would have been the last potential operand for the - // instruction, - // and we didn't find one. We're finished parsing this instruction. - break; - } else { - return context->diagnostic() - << "Expected operand, found end of stream."; - } - } - assert(error == SPV_SUCCESS && "Somebody added another way to fail"); - - if (context->isStartOfNewInst()) { - if (spvOperandIsOptional(type)) { - break; - } else { - return context->diagnostic() - << "Expected operand, found next instruction instead."; - } - } - - std::string operandValue; - error = context->getWord(&operandValue, &nextPosition); - if (error) return context->diagnostic(error) << "Internal Error"; - - error = spvTextEncodeOperand(grammar, context, type, operandValue.c_str(), - pInst, &expectedOperands); - - if (error == SPV_FAILED_MATCH && spvOperandIsOptional(type)) - return SPV_SUCCESS; - - if (error) return error; - - context->setPosition(nextPosition); - } - } - - if (spvOpcodeGeneratesType(pInst->opcode)) { - if (context->recordTypeDefinition(pInst) != SPV_SUCCESS) { - return SPV_ERROR_INVALID_TEXT; - } - } else if (opcodeEntry->hasType) { - // SPIR-V dictates that if an instruction has both a return value and a - // type ID then the type id is first, and the return value is second. - assert(opcodeEntry->hasResult && - "Unknown opcode: has a type but no result."); - context->recordTypeIdForValue(pInst->words[2], pInst->words[1]); - } - - if (pInst->words.size() > SPV_LIMIT_INSTRUCTION_WORD_COUNT_MAX) { - return context->diagnostic() - << "Instruction too long: " << pInst->words.size() - << " words, but the limit is " - << SPV_LIMIT_INSTRUCTION_WORD_COUNT_MAX; - } - - pInst->words[0] = - spvOpcodeMake(uint16_t(pInst->words.size()), opcodeEntry->opcode); - - return SPV_SUCCESS; -} - -enum { kAssemblerVersion = 0 }; - -// Populates a binary stream's |header|. The target environment is specified via -// |env| and Id bound is via |bound|. -spv_result_t SetHeader(spv_target_env env, const uint32_t bound, - uint32_t* header) { - if (!header) return SPV_ERROR_INVALID_BINARY; - - header[SPV_INDEX_MAGIC_NUMBER] = SpvMagicNumber; - header[SPV_INDEX_VERSION_NUMBER] = spvVersionForTargetEnv(env); - header[SPV_INDEX_GENERATOR_NUMBER] = - SPV_GENERATOR_WORD(SPV_GENERATOR_KHRONOS_ASSEMBLER, kAssemblerVersion); - header[SPV_INDEX_BOUND] = bound; - header[SPV_INDEX_SCHEMA] = 0; // NOTE: Reserved - - return SPV_SUCCESS; -} - -// Collects all numeric ids in the module source into |numeric_ids|. -// This function is essentially a dry-run of spvTextToBinary. -spv_result_t GetNumericIds(const libspirv::AssemblyGrammar& grammar, - const spvtools::MessageConsumer& consumer, - const spv_text text, - std::set* numeric_ids) { - libspirv::AssemblyContext context(text, consumer); - - if (!text->str) return context.diagnostic() << "Missing assembly text."; - - if (!grammar.isValid()) { - return SPV_ERROR_INVALID_TABLE; - } - - // Skip past whitespace and comments. - context.advance(); - - while (context.hasText()) { - spv_instruction_t inst; - - if (spvTextEncodeOpcode(grammar, &context, &inst)) { - return SPV_ERROR_INVALID_TEXT; - } - - if (context.advance()) break; - } - - *numeric_ids = context.GetNumericIds(); - return SPV_SUCCESS; -} - -// Translates a given assembly language module into binary form. -// If a diagnostic is generated, it is not yet marked as being -// for a text-based input. -spv_result_t spvTextToBinaryInternal( - const libspirv::AssemblyGrammar& grammar, - const spvtools::MessageConsumer& consumer, const spv_text text, - const uint32_t options, spv_binary* pBinary) { - // The ids in this set will have the same values both in source and binary. - // All other ids will be generated by filling in the gaps. - std::set ids_to_preserve; - - if (options & SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS) { - // Collect all numeric ids from the source into ids_to_preserve. - const spv_result_t result = - GetNumericIds(grammar, consumer, text, &ids_to_preserve); - if (result != SPV_SUCCESS) return result; - } - - libspirv::AssemblyContext context(text, consumer, std::move(ids_to_preserve)); - - if (!text->str) return context.diagnostic() << "Missing assembly text."; - - if (!grammar.isValid()) { - return SPV_ERROR_INVALID_TABLE; - } - if (!pBinary) return SPV_ERROR_INVALID_POINTER; - - std::vector instructions; - - // Skip past whitespace and comments. - context.advance(); - - while (context.hasText()) { - instructions.push_back({}); - spv_instruction_t& inst = instructions.back(); - - if (spvTextEncodeOpcode(grammar, &context, &inst)) { - return SPV_ERROR_INVALID_TEXT; - } - - if (context.advance()) break; - } - - size_t totalSize = SPV_INDEX_INSTRUCTION; - for (auto& inst : instructions) { - totalSize += inst.words.size(); - } - - uint32_t* data = new uint32_t[totalSize]; - if (!data) return SPV_ERROR_OUT_OF_MEMORY; - uint64_t currentIndex = SPV_INDEX_INSTRUCTION; - for (auto& inst : instructions) { - memcpy(data + currentIndex, inst.words.data(), - sizeof(uint32_t) * inst.words.size()); - currentIndex += inst.words.size(); - } - - if (auto error = SetHeader(grammar.target_env(), context.getBound(), data)) - return error; - - spv_binary binary = new spv_binary_t(); - if (!binary) { - delete[] data; - return SPV_ERROR_OUT_OF_MEMORY; - } - binary->code = data; - binary->wordCount = totalSize; - - *pBinary = binary; - - return SPV_SUCCESS; -} - -} // anonymous namespace - -spv_result_t spvTextToBinary(const spv_const_context context, - const char* input_text, - const size_t input_text_size, spv_binary* pBinary, - spv_diagnostic* pDiagnostic) { - return spvTextToBinaryWithOptions( - context, input_text, input_text_size, SPV_BINARY_TO_TEXT_OPTION_NONE, - pBinary, pDiagnostic); -} - -spv_result_t spvTextToBinaryWithOptions( - const spv_const_context context, const char* input_text, - const size_t input_text_size, const uint32_t options, spv_binary* pBinary, - spv_diagnostic* pDiagnostic) { - spv_context_t hijack_context = *context; - if (pDiagnostic) { - *pDiagnostic = nullptr; - libspirv::UseDiagnosticAsMessageConsumer(&hijack_context, pDiagnostic); - } - - spv_text_t text = {input_text, input_text_size}; - libspirv::AssemblyGrammar grammar(&hijack_context); - - spv_result_t result = spvTextToBinaryInternal( - grammar, hijack_context.consumer, &text, options, pBinary); - if (pDiagnostic && *pDiagnostic) (*pDiagnostic)->isTextSource = true; - - return result; -} - -void spvTextDestroy(spv_text text) { - if (!text) return; - delete[] text->str; - delete text; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/text.h vulkan-1.1.73+dfsg/external/spirv-tools/source/text.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/text.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/text.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_TEXT_H_ -#define LIBSPIRV_TEXT_H_ - -#include - -#include "operand.h" -#include "spirv-tools/libspirv.h" -#include "spirv_constant.h" - -typedef enum spv_literal_type_t { - SPV_LITERAL_TYPE_INT_32, - SPV_LITERAL_TYPE_INT_64, - SPV_LITERAL_TYPE_UINT_32, - SPV_LITERAL_TYPE_UINT_64, - SPV_LITERAL_TYPE_FLOAT_32, - SPV_LITERAL_TYPE_FLOAT_64, - SPV_LITERAL_TYPE_STRING, - SPV_FORCE_32_BIT_ENUM(spv_literal_type_t) -} spv_literal_type_t; - -typedef struct spv_literal_t { - spv_literal_type_t type; - union value_t { - int32_t i32; - int64_t i64; - uint32_t u32; - uint64_t u64; - float f; - double d; - } value; - std::string str; // Special field for literal string. -} spv_literal_t; - -// Converts the given text string to a number/string literal and writes the -// result to *literal. String literals must be surrounded by double-quotes ("), -// which are then stripped. -spv_result_t spvTextToLiteral(const char* text, spv_literal_t* literal); - -#endif // LIBSPIRV_TEXT_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/text_handler.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/text_handler.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/text_handler.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/text_handler.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,398 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "text_handler.h" - -#include -#include -#include -#include -#include - -#include "assembly_grammar.h" -#include "binary.h" -#include "ext_inst.h" -#include "instruction.h" -#include "opcode.h" -#include "text.h" -#include "util/bitutils.h" -#include "util/hex_float.h" -#include "util/parse_number.h" - -namespace { -// Advances |text| to the start of the next line and writes the new position to -// |position|. -spv_result_t advanceLine(spv_text text, spv_position position) { - while (true) { - if (position->index >= text->length) return SPV_END_OF_STREAM; - switch (text->str[position->index]) { - case '\0': - return SPV_END_OF_STREAM; - case '\n': - position->column = 0; - position->line++; - position->index++; - return SPV_SUCCESS; - default: - position->column++; - position->index++; - break; - } - } -} - -// Advances |text| to first non white space character and writes the new -// position to |position|. -// If a null terminator is found during the text advance, SPV_END_OF_STREAM is -// returned, SPV_SUCCESS otherwise. No error checking is performed on the -// parameters, its the users responsibility to ensure these are non null. -spv_result_t advance(spv_text text, spv_position position) { - // NOTE: Consume white space, otherwise don't advance. - if (position->index >= text->length) return SPV_END_OF_STREAM; - switch (text->str[position->index]) { - case '\0': - return SPV_END_OF_STREAM; - case ';': - if (spv_result_t error = advanceLine(text, position)) return error; - return advance(text, position); - case ' ': - case '\t': - case '\r': - position->column++; - position->index++; - return advance(text, position); - case '\n': - position->column = 0; - position->line++; - position->index++; - return advance(text, position); - default: - break; - } - return SPV_SUCCESS; -} - -// Fetches the next word from the given text stream starting from the given -// *position. On success, writes the decoded word into *word and updates -// *position to the location past the returned word. -// -// A word ends at the next comment or whitespace. However, double-quoted -// strings remain intact, and a backslash always escapes the next character. -spv_result_t getWord(spv_text text, spv_position position, std::string* word) { - if (!text->str || !text->length) return SPV_ERROR_INVALID_TEXT; - if (!position) return SPV_ERROR_INVALID_POINTER; - - const size_t start_index = position->index; - - bool quoting = false; - bool escaping = false; - - // NOTE: Assumes first character is not white space! - while (true) { - if (position->index >= text->length) { - word->assign(text->str + start_index, text->str + position->index); - return SPV_SUCCESS; - } - const char ch = text->str[position->index]; - if (ch == '\\') - escaping = !escaping; - else { - switch (ch) { - case '"': - if (!escaping) quoting = !quoting; - break; - case ' ': - case ';': - case '\t': - case '\n': - case '\r': - if (escaping || quoting) break; - // Fall through. - case '\0': { // NOTE: End of word found! - word->assign(text->str + start_index, text->str + position->index); - return SPV_SUCCESS; - } - default: - break; - } - escaping = false; - } - - position->column++; - position->index++; - } -} - -// Returns true if the characters in the text as position represent -// the start of an Opcode. -bool startsWithOp(spv_text text, spv_position position) { - if (text->length < position->index + 3) return false; - char ch0 = text->str[position->index]; - char ch1 = text->str[position->index + 1]; - char ch2 = text->str[position->index + 2]; - return ('O' == ch0 && 'p' == ch1 && ('A' <= ch2 && ch2 <= 'Z')); -} - -} // anonymous namespace - -namespace libspirv { - -const IdType kUnknownType = {0, false, IdTypeClass::kBottom}; - -// TODO(dneto): Reorder AssemblyContext definitions to match declaration order. - -// This represents all of the data that is only valid for the duration of -// a single compilation. -uint32_t AssemblyContext::spvNamedIdAssignOrGet(const char* textValue) { - if (!ids_to_preserve_.empty()) { - uint32_t id = 0; - if (spvutils::ParseNumber(textValue, &id)) { - if (ids_to_preserve_.find(id) != ids_to_preserve_.end()) { - bound_ = std::max(bound_, id + 1); - return id; - } - } - } - - const auto it = named_ids_.find(textValue); - if (it == named_ids_.end()) { - uint32_t id = next_id_++; - if (!ids_to_preserve_.empty()) { - while (ids_to_preserve_.find(id) != ids_to_preserve_.end()) { - id = next_id_++; - } - } - - named_ids_.emplace(textValue, id); - bound_ = std::max(bound_, id + 1); - return id; - } - - return it->second; -} - -uint32_t AssemblyContext::getBound() const { return bound_; } - -spv_result_t AssemblyContext::advance() { - return ::advance(text_, ¤t_position_); -} - -spv_result_t AssemblyContext::getWord(std::string* word, - spv_position next_position) { - *next_position = current_position_; - return ::getWord(text_, next_position, word); -} - -bool AssemblyContext::startsWithOp() { - return ::startsWithOp(text_, ¤t_position_); -} - -bool AssemblyContext::isStartOfNewInst() { - spv_position_t pos = current_position_; - if (::advance(text_, &pos)) return false; - if (::startsWithOp(text_, &pos)) return true; - - std::string word; - pos = current_position_; - if (::getWord(text_, &pos, &word)) return false; - if ('%' != word.front()) return false; - - if (::advance(text_, &pos)) return false; - if (::getWord(text_, &pos, &word)) return false; - if ("=" != word) return false; - - if (::advance(text_, &pos)) return false; - if (::startsWithOp(text_, &pos)) return true; - return false; -} - -char AssemblyContext::peek() const { - return text_->str[current_position_.index]; -} - -bool AssemblyContext::hasText() const { - return text_->length > current_position_.index; -} - -void AssemblyContext::seekForward(uint32_t size) { - current_position_.index += size; - current_position_.column += size; -} - -spv_result_t AssemblyContext::binaryEncodeU32(const uint32_t value, - spv_instruction_t* pInst) { - pInst->words.insert(pInst->words.end(), value); - return SPV_SUCCESS; -} - -spv_result_t AssemblyContext::binaryEncodeNumericLiteral( - const char* val, spv_result_t error_code, const IdType& type, - spv_instruction_t* pInst) { - using spvutils::EncodeNumberStatus; - // Populate the NumberType from the IdType for parsing. - spvutils::NumberType number_type; - switch (type.type_class) { - case IdTypeClass::kOtherType: - return diagnostic(SPV_ERROR_INTERNAL) - << "Unexpected numeric literal type"; - case IdTypeClass::kScalarIntegerType: - if (type.isSigned) { - number_type = {type.bitwidth, SPV_NUMBER_SIGNED_INT}; - } else { - number_type = {type.bitwidth, SPV_NUMBER_UNSIGNED_INT}; - } - break; - case IdTypeClass::kScalarFloatType: - number_type = {type.bitwidth, SPV_NUMBER_FLOATING}; - break; - case IdTypeClass::kBottom: - // kBottom means the type is unknown and we need to infer the type before - // parsing the number. The rule is: If there is a decimal point, treat - // the value as a floating point value, otherwise a integer value, then - // if the first char of the integer text is '-', treat the integer as a - // signed integer, otherwise an unsigned integer. - uint32_t bitwidth = static_cast(assumedBitWidth(type)); - if (strchr(val, '.')) { - number_type = {bitwidth, SPV_NUMBER_FLOATING}; - } else if (type.isSigned || val[0] == '-') { - number_type = {bitwidth, SPV_NUMBER_SIGNED_INT}; - } else { - number_type = {bitwidth, SPV_NUMBER_UNSIGNED_INT}; - } - break; - } - - std::string error_msg; - EncodeNumberStatus parse_status = ParseAndEncodeNumber( - val, number_type, - [this, pInst](uint32_t d) { this->binaryEncodeU32(d, pInst); }, - &error_msg); - switch (parse_status) { - case EncodeNumberStatus::kSuccess: - return SPV_SUCCESS; - case EncodeNumberStatus::kInvalidText: - return diagnostic(error_code) << error_msg; - case EncodeNumberStatus::kUnsupported: - return diagnostic(SPV_ERROR_INTERNAL) << error_msg; - case EncodeNumberStatus::kInvalidUsage: - return diagnostic(SPV_ERROR_INVALID_TEXT) << error_msg; - } - // This line is not reachable, only added to satisfy the compiler. - return diagnostic(SPV_ERROR_INTERNAL) - << "Unexpected result code from ParseAndEncodeNumber()"; -} - -spv_result_t AssemblyContext::binaryEncodeString(const char* value, - spv_instruction_t* pInst) { - const size_t length = strlen(value); - const size_t wordCount = (length / 4) + 1; - const size_t oldWordCount = pInst->words.size(); - const size_t newWordCount = oldWordCount + wordCount; - - // TODO(dneto): We can just defer this check until later. - if (newWordCount > SPV_LIMIT_INSTRUCTION_WORD_COUNT_MAX) { - return diagnostic() << "Instruction too long: more than " - << SPV_LIMIT_INSTRUCTION_WORD_COUNT_MAX << " words."; - } - - pInst->words.resize(newWordCount); - - // Make sure all the bytes in the last word are 0, in case we only - // write a partial word at the end. - pInst->words.back() = 0; - - char* dest = (char*)&pInst->words[oldWordCount]; - strncpy(dest, value, length); - - return SPV_SUCCESS; -} - -spv_result_t AssemblyContext::recordTypeDefinition( - const spv_instruction_t* pInst) { - uint32_t value = pInst->words[1]; - if (types_.find(value) != types_.end()) { - return diagnostic() << "Value " << value - << " has already been used to generate a type"; - } - - if (pInst->opcode == SpvOpTypeInt) { - if (pInst->words.size() != 4) - return diagnostic() << "Invalid OpTypeInt instruction"; - types_[value] = {pInst->words[2], pInst->words[3] != 0, - IdTypeClass::kScalarIntegerType}; - } else if (pInst->opcode == SpvOpTypeFloat) { - if (pInst->words.size() != 3) - return diagnostic() << "Invalid OpTypeFloat instruction"; - types_[value] = {pInst->words[2], false, IdTypeClass::kScalarFloatType}; - } else { - types_[value] = {0, false, IdTypeClass::kOtherType}; - } - return SPV_SUCCESS; -} - -IdType AssemblyContext::getTypeOfTypeGeneratingValue(uint32_t value) const { - auto type = types_.find(value); - if (type == types_.end()) { - return kUnknownType; - } - return std::get<1>(*type); -} - -IdType AssemblyContext::getTypeOfValueInstruction(uint32_t value) const { - auto type_value = value_types_.find(value); - if (type_value == value_types_.end()) { - return {0, false, IdTypeClass::kBottom}; - } - return getTypeOfTypeGeneratingValue(std::get<1>(*type_value)); -} - -spv_result_t AssemblyContext::recordTypeIdForValue(uint32_t value, - uint32_t type) { - bool successfully_inserted = false; - std::tie(std::ignore, successfully_inserted) = - value_types_.insert(std::make_pair(value, type)); - if (!successfully_inserted) - return diagnostic() << "Value is being defined a second time"; - return SPV_SUCCESS; -} - -spv_result_t AssemblyContext::recordIdAsExtInstImport( - uint32_t id, spv_ext_inst_type_t type) { - bool successfully_inserted = false; - std::tie(std::ignore, successfully_inserted) = - import_id_to_ext_inst_type_.insert(std::make_pair(id, type)); - if (!successfully_inserted) - return diagnostic() << "Import Id is being defined a second time"; - return SPV_SUCCESS; -} - -spv_ext_inst_type_t AssemblyContext::getExtInstTypeForId(uint32_t id) const { - auto type = import_id_to_ext_inst_type_.find(id); - if (type == import_id_to_ext_inst_type_.end()) { - return SPV_EXT_INST_TYPE_NONE; - } - return std::get<1>(*type); -} - -std::set AssemblyContext::GetNumericIds() const { - std::set ids; - for (const auto& kv : named_ids_) { - uint32_t id; - if (spvutils::ParseNumber(kv.first.c_str(), &id)) - ids.insert(id); - } - return ids; -} - -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/text_handler.h vulkan-1.1.73+dfsg/external/spirv-tools/source/text_handler.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/text_handler.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/text_handler.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,255 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_TEXT_HANDLER_H_ -#define LIBSPIRV_TEXT_HANDLER_H_ - -#include -#include -#include -#include - -#include "diagnostic.h" -#include "instruction.h" -#include "message.h" -#include "spirv-tools/libspirv.h" -#include "text.h" - -namespace libspirv { -// Structures - -// This is a lattice for tracking types. -enum class IdTypeClass { - kBottom = 0, // We have no information yet. - kScalarIntegerType, - kScalarFloatType, - kOtherType -}; - -// Contains ID type information that needs to be tracked across all Ids. -// Bitwidth is only valid when type_class is kScalarIntegerType or -// kScalarFloatType. -struct IdType { - uint32_t bitwidth; // Safe to assume that we will not have > 2^32 bits. - bool isSigned; // This is only significant if type_class is integral. - IdTypeClass type_class; -}; - -// Default equality operator for IdType. Tests if all members are the same. -inline bool operator==(const IdType& first, const IdType& second) { - return (first.bitwidth == second.bitwidth) && - (first.isSigned == second.isSigned) && - (first.type_class == second.type_class); -} - -// Tests whether any member of the IdTypes do not match. -inline bool operator!=(const IdType& first, const IdType& second) { - return !(first == second); -} - -// A value representing an unknown type. -extern const IdType kUnknownType; - -// Returns true if the type is a scalar integer type. -inline bool isScalarIntegral(const IdType& type) { - return type.type_class == IdTypeClass::kScalarIntegerType; -} - -// Returns true if the type is a scalar floating point type. -inline bool isScalarFloating(const IdType& type) { - return type.type_class == IdTypeClass::kScalarFloatType; -} - -// Returns the number of bits in the type. -// This is only valid for bottom, scalar integer, and scalar floating -// classes. For bottom, assume 32 bits. -inline int assumedBitWidth(const IdType& type) { - switch (type.type_class) { - case IdTypeClass::kBottom: - return 32; - case IdTypeClass::kScalarIntegerType: - case IdTypeClass::kScalarFloatType: - return type.bitwidth; - default: - break; - } - // We don't care about this case. - return 0; -} - -// A templated class with a static member function Clamp, where Clamp -// sets a referenced value of type T to 0 if T is an unsigned -// integer type, and returns true if it modified the referenced -// value. -template -class ClampToZeroIfUnsignedType { - public: - // The default specialization does not clamp the value. - static bool Clamp(T*) { return false; } -}; - -// The specialization of ClampToZeroIfUnsignedType for unsigned integer -// types. -template -class ClampToZeroIfUnsignedType< - T, typename std::enable_if::value>::type> { - public: - static bool Clamp(T* value_pointer) { - if (*value_pointer) { - *value_pointer = 0; - return true; - } - return false; - } -}; - -// Encapsulates the data used during the assembly of a SPIR-V module. -class AssemblyContext { - public: - AssemblyContext(spv_text text, const spvtools::MessageConsumer& consumer, - std::set&& ids_to_preserve = std::set()) - : current_position_({}), consumer_(consumer), text_(text), bound_(1), - next_id_(1), ids_to_preserve_(std::move(ids_to_preserve)) {} - - // Assigns a new integer value to the given text ID, or returns the previously - // assigned integer value if the ID has been seen before. - uint32_t spvNamedIdAssignOrGet(const char* textValue); - - // Returns the largest largest numeric ID that has been assigned. - uint32_t getBound() const; - - // Advances position to point to the next word in the input stream. - // Returns SPV_SUCCESS on success. - spv_result_t advance(); - - // Sets word to the next word in the input text. Fills next_position with - // the next location past the end of the word. - spv_result_t getWord(std::string* word, spv_position next_position); - - // Returns true if the next word in the input is the start of a new Opcode. - bool startsWithOp(); - - // Returns true if the next word in the input is the start of a new - // instruction. - bool isStartOfNewInst(); - - // Returns a diagnostic object initialized with current position in the input - // stream, and for the given error code. Any data written to this object will - // show up in pDiagnsotic on destruction. - DiagnosticStream diagnostic(spv_result_t error) { - return DiagnosticStream(current_position_, consumer_, error); - } - - // Returns a diagnostic object with the default assembly error code. - DiagnosticStream diagnostic() { - // The default failure for assembly is invalid text. - return diagnostic(SPV_ERROR_INVALID_TEXT); - } - - // Returns then next character in the input stream. - char peek() const; - - // Returns true if there is more text in the input stream. - bool hasText() const; - - // Seeks the input stream forward by 'size' characters. - void seekForward(uint32_t size); - - // Sets the current position in the input stream to the given position. - void setPosition(const spv_position_t& newPosition) { - current_position_ = newPosition; - } - - // Returns the current position in the input stream. - const spv_position_t& position() const { return current_position_; } - - // Appends the given 32-bit value to the given instruction. - // Returns SPV_SUCCESS if the value could be correctly inserted in the - // instruction. - spv_result_t binaryEncodeU32(const uint32_t value, spv_instruction_t* pInst); - - // Appends the given string to the given instruction. - // Returns SPV_SUCCESS if the value could be correctly inserted in the - // instruction. - spv_result_t binaryEncodeString(const char* value, spv_instruction_t* pInst); - - // Appends the given numeric literal to the given instruction. - // Validates and respects the bitwidth supplied in the IdType argument. - // If the type is of class kBottom the value will be encoded as a - // 32-bit integer. - // Returns SPV_SUCCESS if the value could be correctly added to the - // instruction. Returns the given error code on failure, and emits - // a diagnostic if that error code is not SPV_FAILED_MATCH. - spv_result_t binaryEncodeNumericLiteral(const char* numeric_literal, - spv_result_t error_code, - const IdType& type, - spv_instruction_t* pInst); - - // Returns the IdType associated with this type-generating value. - // If the type has not been previously recorded with recordTypeDefinition, - // kUnknownType will be returned. - IdType getTypeOfTypeGeneratingValue(uint32_t value) const; - - // Returns the IdType that represents the return value of this Value - // generating instruction. - // If the value has not been recorded with recordTypeIdForValue, or the type - // could not be determined kUnknownType will be returned. - IdType getTypeOfValueInstruction(uint32_t value) const; - - // Tracks the type-defining instruction. The result of the tracking can - // later be queried using getValueType. - // pInst is expected to be completely filled in by the time this instruction - // is called. - // Returns SPV_SUCCESS on success, or SPV_ERROR_INVALID_VALUE on error. - spv_result_t recordTypeDefinition(const spv_instruction_t* pInst); - - // Tracks the relationship between the value and its type. - spv_result_t recordTypeIdForValue(uint32_t value, uint32_t type); - - // Records the given Id as being the import of the given extended instruction - // type. - spv_result_t recordIdAsExtInstImport(uint32_t id, spv_ext_inst_type_t type); - - // Returns the extended instruction type corresponding to the import with - // the given Id, if it exists. Returns SPV_EXT_INST_TYPE_NONE if the - // id is not the id for an extended instruction type. - spv_ext_inst_type_t getExtInstTypeForId(uint32_t id) const; - - // Returns a set consisting of each ID generated by spvNamedIdAssignOrGet from - // a numeric ID text representation. For example, generated from "%12" but not - // from "%foo". - std::set GetNumericIds() const; - - private: - // Maps ID names to their corresponding numerical ids. - using spv_named_id_table = std::unordered_map; - // Maps type-defining IDs to their IdType. - using spv_id_to_type_map = std::unordered_map; - // Maps Ids to the id of their type. - using spv_id_to_type_id = std::unordered_map; - - spv_named_id_table named_ids_; - spv_id_to_type_map types_; - spv_id_to_type_id value_types_; - // Maps an extended instruction import Id to the extended instruction type. - std::unordered_map import_id_to_ext_inst_type_; - spv_position_t current_position_; - spvtools::MessageConsumer consumer_; - spv_text text_; - uint32_t bound_; - uint32_t next_id_; - std::set ids_to_preserve_; -}; -} -#endif // _LIBSPIRV_TEXT_HANDLER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/bit_stream.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/util/bit_stream.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/bit_stream.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/util/bit_stream.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,451 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include -#include -#include -#include -#include - -#include "util/bit_stream.h" - -namespace spvutils { - -namespace { - -// Returns if the system is little-endian. Unfortunately only works during -// runtime. -bool IsLittleEndian() { - // This constant value allows the detection of the host machine's endianness. - // Accessing it as an array of bytes is valid due to C++11 section 3.10 - // paragraph 10. - static const uint16_t kFF00 = 0xff00; - return reinterpret_cast(&kFF00)[0] == 0; -} - -// Copies bytes from the given buffer to a uint64_t buffer. -// Motivation: casting uint64_t* to uint8_t* is ok. Casting in the other -// direction is only advisable if uint8_t* is aligned to 64-bit word boundary. -std::vector ToBuffer64(const void* buffer, size_t num_bytes) { - std::vector out; - out.resize((num_bytes + 7) / 8, 0); - memcpy(out.data(), buffer, num_bytes); - return out; -} - -// Copies uint8_t buffer to a uint64_t buffer. -std::vector ToBuffer64(const std::vector& in) { - return ToBuffer64(in.data(), in.size()); -} - -// Returns uint64_t containing the same bits as |val|. -// Type size must be less than 8 bytes. -template -uint64_t ToU64(T val) { - static_assert(sizeof(T) <= 8, "Type size too big"); - uint64_t val64 = 0; - std::memcpy(&val64, &val, sizeof(T)); - return val64; -} - -// Returns value of type T containing the same bits as |val64|. -// Type size must be less than 8 bytes. Upper (unused) bits of |val64| must be -// zero (irrelevant, but is checked with assertion). -template -T FromU64(uint64_t val64) { - assert(sizeof(T) == 8 || (val64 >> (sizeof(T) * 8)) == 0); - static_assert(sizeof(T) <= 8, "Type size too big"); - T val = 0; - std::memcpy(&val, &val64, sizeof(T)); - return val; -} - -// Writes bits from |val| to |writer| in chunks of size |chunk_length|. -// Signal bit is used to signal if the reader should expect another chunk: -// 0 - no more chunks to follow -// 1 - more chunks to follow -// If number of written bits reaches |max_payload| last chunk is truncated. -void WriteVariableWidthInternal(BitWriterInterface* writer, uint64_t val, - size_t chunk_length, size_t max_payload) { - assert(chunk_length > 0); - assert(chunk_length < max_payload); - assert(max_payload == 64 || (val >> max_payload) == 0); - - if (val == 0) { - // Split in two writes for more readable logging. - writer->WriteBits(0, chunk_length); - writer->WriteBits(0, 1); - return; - } - - size_t payload_written = 0; - - while (val) { - if (payload_written + chunk_length >= max_payload) { - // This has to be the last chunk. - // There is no need for the signal bit and the chunk can be truncated. - const size_t left_to_write = max_payload - payload_written; - assert((val >> left_to_write) == 0); - writer->WriteBits(val, left_to_write); - break; - } - - writer->WriteBits(val, chunk_length); - payload_written += chunk_length; - val = val >> chunk_length; - - // Write a single bit to signal if there is more to come. - writer->WriteBits(val ? 1 : 0, 1); - } -} - -// Reads data written with WriteVariableWidthInternal. |chunk_length| and -// |max_payload| should be identical to those used to write the data. -// Returns false if the stream ends prematurely. -bool ReadVariableWidthInternal(BitReaderInterface* reader, uint64_t* val, - size_t chunk_length, size_t max_payload) { - assert(chunk_length > 0); - assert(chunk_length <= max_payload); - size_t payload_read = 0; - - while (payload_read + chunk_length < max_payload) { - uint64_t bits = 0; - if (reader->ReadBits(&bits, chunk_length) != chunk_length) - return false; - - *val |= bits << payload_read; - payload_read += chunk_length; - - uint64_t more_to_come = 0; - if (reader->ReadBits(&more_to_come, 1) != 1) - return false; - - if (!more_to_come) { - return true; - } - } - - // Need to read the last chunk which may be truncated. No signal bit follows. - uint64_t bits = 0; - const size_t left_to_read = max_payload - payload_read; - if (reader->ReadBits(&bits, left_to_read) != left_to_read) - return false; - - *val |= bits << payload_read; - return true; -} - -// Calls WriteVariableWidthInternal with the right max_payload argument. -template -void WriteVariableWidthUnsigned(BitWriterInterface* writer, T val, - size_t chunk_length) { - static_assert(std::is_unsigned::value, "Type must be unsigned"); - static_assert(std::is_integral::value, "Type must be integral"); - WriteVariableWidthInternal(writer, val, chunk_length, sizeof(T) * 8); -} - -// Calls ReadVariableWidthInternal with the right max_payload argument. -template -bool ReadVariableWidthUnsigned(BitReaderInterface* reader, T* val, - size_t chunk_length) { - static_assert(std::is_unsigned::value, "Type must be unsigned"); - static_assert(std::is_integral::value, "Type must be integral"); - uint64_t val64 = 0; - if (!ReadVariableWidthInternal(reader, &val64, chunk_length, sizeof(T) * 8)) - return false; - *val = static_cast(val64); - assert(*val == val64); - return true; -} - -// Encodes signed |val| to an unsigned value and calls -// WriteVariableWidthInternal with the right max_payload argument. -template -void WriteVariableWidthSigned(BitWriterInterface* writer, T val, - size_t chunk_length, size_t zigzag_exponent) { - static_assert(std::is_signed::value, "Type must be signed"); - static_assert(std::is_integral::value, "Type must be integral"); - WriteVariableWidthInternal(writer, EncodeZigZag(val, zigzag_exponent), - chunk_length, sizeof(T) * 8); -} - -// Calls ReadVariableWidthInternal with the right max_payload argument -// and decodes the value. -template -bool ReadVariableWidthSigned(BitReaderInterface* reader, T* val, - size_t chunk_length, size_t zigzag_exponent) { - static_assert(std::is_signed::value, "Type must be signed"); - static_assert(std::is_integral::value, "Type must be integral"); - uint64_t encoded = 0; - if (!ReadVariableWidthInternal(reader, &encoded, chunk_length, sizeof(T) * 8)) - return false; - - const int64_t decoded = DecodeZigZag(encoded, zigzag_exponent); - - *val = static_cast(decoded); - assert(*val == decoded); - return true; -} - -} // namespace - -size_t Log2U64(uint64_t val) { - size_t res = 0; - - if (val & 0xFFFFFFFF00000000) { - val >>= 32; - res |= 32; - } - - if (val & 0xFFFF0000) { - val >>= 16; - res |= 16; - } - - if (val & 0xFF00) { - val >>= 8; - res |= 8; - } - - if (val & 0xF0) { - val >>= 4; - res |= 4; - } - - if (val & 0xC) { - val >>= 2; - res |= 2; - } - - if (val & 0x2) { - res |= 1; - } - - return res; -} - -void BitWriterInterface::WriteVariableWidthU64(uint64_t val, - size_t chunk_length) { - WriteVariableWidthUnsigned(this, val, chunk_length); -} - -void BitWriterInterface::WriteVariableWidthU32(uint32_t val, - size_t chunk_length) { - WriteVariableWidthUnsigned(this, val, chunk_length); -} - -void BitWriterInterface::WriteVariableWidthU16(uint16_t val, - size_t chunk_length) { - WriteVariableWidthUnsigned(this, val, chunk_length); -} - -void BitWriterInterface::WriteVariableWidthU8(uint8_t val, - size_t chunk_length) { - WriteVariableWidthUnsigned(this, val, chunk_length); -} - -void BitWriterInterface::WriteVariableWidthS64(int64_t val, - size_t chunk_length, - size_t zigzag_exponent) { - WriteVariableWidthSigned(this, val, chunk_length, zigzag_exponent); -} - -void BitWriterInterface::WriteVariableWidthS32(int32_t val, - size_t chunk_length, - size_t zigzag_exponent) { - WriteVariableWidthSigned(this, val, chunk_length, zigzag_exponent); -} - -void BitWriterInterface::WriteVariableWidthS16(int16_t val, - size_t chunk_length, - size_t zigzag_exponent) { - WriteVariableWidthSigned(this, val, chunk_length, zigzag_exponent); -} - -void BitWriterInterface::WriteVariableWidthS8(int8_t val, - size_t chunk_length, - size_t zigzag_exponent) { - WriteVariableWidthSigned(this, val, chunk_length, zigzag_exponent); -} - -void BitWriterInterface::WriteFixedWidth(uint64_t val, uint64_t max_val) { - if (val > max_val) { - assert(0 && "WriteFixedWidth: value too wide"); - return; - } - - const size_t num_bits = 1 + Log2U64(max_val); - WriteBits(val, num_bits); -} - -BitWriterWord64::BitWriterWord64(size_t reserve_bits) : end_(0) { - buffer_.reserve(NumBitsToNumWords<64>(reserve_bits)); -} - -void BitWriterWord64::WriteBits(uint64_t bits, size_t num_bits) { - // Check that |bits| and |num_bits| are valid and consistent. - assert(num_bits <= 64); - const bool is_little_endian = IsLittleEndian(); - assert(is_little_endian && "Big-endian architecture support not implemented"); - if (!is_little_endian) return; - - if (num_bits == 0) return; - - bits = GetLowerBits(bits, num_bits); - - EmitSequence(bits, num_bits); - - // Offset from the start of the current word. - const size_t offset = end_ % 64; - - if (offset == 0) { - // If no offset, simply add |bits| as a new word to the buffer_. - buffer_.push_back(bits); - } else { - // Shift bits and add them to the current word after offset. - const uint64_t first_word = bits << offset; - buffer_.back() |= first_word; - - // If we don't overflow to the next word, there is nothing more to do. - - if (offset + num_bits > 64) { - // We overflow to the next word. - const uint64_t second_word = bits >> (64 - offset); - // Add remaining bits as a new word to buffer_. - buffer_.push_back(second_word); - } - } - - // Move end_ into position for next write. - end_ += num_bits; - assert(buffer_.size() * 64 >= end_); -} - -bool BitReaderInterface::ReadVariableWidthU64(uint64_t* val, - size_t chunk_length) { - return ReadVariableWidthUnsigned(this, val, chunk_length); -} - -bool BitReaderInterface::ReadVariableWidthU32(uint32_t* val, - size_t chunk_length) { - return ReadVariableWidthUnsigned(this, val, chunk_length); -} - -bool BitReaderInterface::ReadVariableWidthU16(uint16_t* val, - size_t chunk_length) { - return ReadVariableWidthUnsigned(this, val, chunk_length); -} - -bool BitReaderInterface::ReadVariableWidthU8(uint8_t* val, - size_t chunk_length) { - return ReadVariableWidthUnsigned(this, val, chunk_length); -} - -bool BitReaderInterface::ReadVariableWidthS64(int64_t* val, - size_t chunk_length, - size_t zigzag_exponent) { - return ReadVariableWidthSigned(this, val, chunk_length, zigzag_exponent); -} - -bool BitReaderInterface::ReadVariableWidthS32(int32_t* val, - size_t chunk_length, - size_t zigzag_exponent) { - return ReadVariableWidthSigned(this, val, chunk_length, zigzag_exponent); -} - -bool BitReaderInterface::ReadVariableWidthS16(int16_t* val, - size_t chunk_length, - size_t zigzag_exponent) { - return ReadVariableWidthSigned(this, val, chunk_length, zigzag_exponent); -} - -bool BitReaderInterface::ReadVariableWidthS8(int8_t* val, - size_t chunk_length, - size_t zigzag_exponent) { - return ReadVariableWidthSigned(this, val, chunk_length, zigzag_exponent); -} - -bool BitReaderInterface::ReadFixedWidth(uint64_t* val, uint64_t max_val) { - const size_t num_bits = 1 + Log2U64(max_val); - return ReadBits(val, num_bits) == num_bits; -} - -BitReaderWord64::BitReaderWord64(std::vector&& buffer) - : buffer_(std::move(buffer)), pos_(0) {} - -BitReaderWord64::BitReaderWord64(const std::vector& buffer) - : buffer_(ToBuffer64(buffer)), pos_(0) {} - -BitReaderWord64::BitReaderWord64(const void* buffer, size_t num_bytes) - : buffer_(ToBuffer64(buffer, num_bytes)), pos_(0) {} - -size_t BitReaderWord64::ReadBits(uint64_t* bits, size_t num_bits) { - assert(num_bits <= 64); - const bool is_little_endian = IsLittleEndian(); - assert(is_little_endian && "Big-endian architecture support not implemented"); - if (!is_little_endian) return 0; - - if (ReachedEnd()) - return 0; - - // Index of the current word. - const size_t index = pos_ / 64; - - // Bit position in the current word where we start reading. - const size_t offset = pos_ % 64; - - // Read all bits from the current word (it might be too much, but - // excessive bits will be removed later). - *bits = buffer_[index] >> offset; - - const size_t num_read_from_first_word = std::min(64 - offset, num_bits); - pos_ += num_read_from_first_word; - - if (pos_ >= buffer_.size() * 64) { - // Reached end of buffer_. - return num_read_from_first_word; - } - - if (offset + num_bits > 64) { - // Requested |num_bits| overflows to next word. - // Write all bits from the beginning of next word to *bits after offset. - *bits |= buffer_[index + 1] << (64 - offset); - pos_ += offset + num_bits - 64; - } - - // We likely have written more bits than requested. Clear excessive bits. - *bits = GetLowerBits(*bits, num_bits); - return num_bits; -} - -bool BitReaderWord64::ReachedEnd() const { - return pos_ >= buffer_.size() * 64; -} - -bool BitReaderWord64::OnlyZeroesLeft() const { - if (ReachedEnd()) - return true; - - const size_t index = pos_ / 64; - if (index < buffer_.size() - 1) - return false; - - assert(index == buffer_.size() - 1); - - const size_t offset = pos_ % 64; - const uint64_t remaining_bits = buffer_[index] >> offset; - return !remaining_bits; -} - -} // namespace spvutils diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/bit_stream.h vulkan-1.1.73+dfsg/external/spirv-tools/source/util/bit_stream.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/bit_stream.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/util/bit_stream.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,446 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Contains utils for reading, writing and debug printing bit streams. - -#ifndef LIBSPIRV_UTIL_BIT_STREAM_H_ -#define LIBSPIRV_UTIL_BIT_STREAM_H_ - -#include -#include -#include -#include -#include -#include -#include - -namespace spvutils { - -// Returns rounded down log2(val). log2(0) is considered 0. -size_t Log2U64(uint64_t val); - -// Terminology: -// Bits - usually used for a uint64 word, first bit is the lowest. -// Stream - std::string of '0' and '1', read left-to-right, -// i.e. first bit is at the front and not at the end as in -// std::bitset::to_string(). -// Bitset - std::bitset corresponding to uint64 bits and to reverse(stream). - -// Converts number of bits to a respective number of chunks of size N. -// For example NumBitsToNumWords<8> returns how many bytes are needed to store -// |num_bits|. -template -inline size_t NumBitsToNumWords(size_t num_bits) { - return (num_bits + (N - 1)) / N; -} - -// Returns value of the same type as |in|, where all but the first |num_bits| -// are set to zero. -template -inline T GetLowerBits(T in, size_t num_bits) { - return sizeof(T) * 8 == num_bits ? in : in & T((T(1) << num_bits) - T(1)); -} - -// Encodes signed integer as unsigned in zigzag order: -// 0 -> 0 -// -1 -> 1 -// 1 -> 2 -// -2 -> 3 -// 2 -> 4 -// Motivation: -1 is 0xFF...FF what doesn't work very well with -// WriteVariableWidth which prefers to have as many 0 bits as possible. -inline uint64_t EncodeZigZag(int64_t val) { - return (val << 1) ^ (val >> 63); -} - -// Decodes signed integer encoded with EncodeZigZag. -inline int64_t DecodeZigZag(uint64_t val) { - if (val & 1) { - // Negative. - // 1 -> -1 - // 3 -> -2 - // 5 -> -3 - return -1 - (val >> 1); - } else { - // Non-negative. - // 0 -> 0 - // 2 -> 1 - // 4 -> 2 - return val >> 1; - } -} - -// Encodes signed integer as unsigned. This is a generalized version of -// EncodeZigZag, designed to favor small positive numbers. -// Values are transformed in blocks of 2^|block_exponent|. -// If |block_exponent| is zero, then this degenerates into normal EncodeZigZag. -// Example when |block_exponent| is 1 (return value is the index): -// 0, 1, -1, -2, 2, 3, -3, -4, 4, 5, -5, -6, 6, 7, -7, -8 -// Example when |block_exponent| is 2: -// 0, 1, 2, 3, -1, -2, -3, -4, 4, 5, 6, 7, -5, -6, -7, -8 -inline uint64_t EncodeZigZag(int64_t val, size_t block_exponent) { - assert(block_exponent < 64); - const uint64_t uval = static_cast(val >= 0 ? val : -val - 1); - const uint64_t block_num = ((uval >> block_exponent) << 1) + (val >= 0 ? 0 : 1); - const uint64_t pos = GetLowerBits(uval, block_exponent); - return (block_num << block_exponent) + pos; -} - -// Decodes signed integer encoded with EncodeZigZag. |block_exponent| must be -// the same. -inline int64_t DecodeZigZag(uint64_t val, size_t block_exponent) { - assert(block_exponent < 64); - const uint64_t block_num = val >> block_exponent; - const uint64_t pos = GetLowerBits(val, block_exponent); - if (block_num & 1) { - // Negative. - return -1LL - ((block_num >> 1) << block_exponent) - pos; - } else { - // Positive. - return ((block_num >> 1) << block_exponent) + pos; - } -} - -// Converts |buffer| to a stream of '0' and '1'. -template -std::string BufferToStream(const std::vector& buffer) { - std::stringstream ss; - for (auto it = buffer.begin(); it != buffer.end(); ++it) { - std::string str = std::bitset(*it).to_string(); - // Strings generated by std::bitset::to_string are read right to left. - // Reversing to left to right. - std::reverse(str.begin(), str.end()); - ss << str; - } - return ss.str(); -} - -// Converts a left-to-right input string of '0' and '1' to a buffer of |T| -// words. -template -std::vector StreamToBuffer(std::string str) { - // The input string is left-to-right, the input argument of std::bitset needs - // to right-to-left. Instead of reversing tokens, reverse the entire string - // and iterate tokens from end to begin. - std::reverse(str.begin(), str.end()); - const int word_size = static_cast(sizeof(T) * 8); - const int str_length = static_cast(str.length()); - std::vector buffer; - buffer.reserve(NumBitsToNumWords(str.length())); - for (int index = str_length - word_size; index >= 0; index -= word_size) { - buffer.push_back(static_cast(std::bitset( - str, index, word_size).to_ullong())); - } - const size_t suffix_length = str.length() % word_size; - if (suffix_length != 0) { - buffer.push_back(static_cast(std::bitset( - str, 0, suffix_length).to_ullong())); - } - return buffer; -} - -// Adds '0' chars at the end of the string until the size is a multiple of N. -template -inline std::string PadToWord(std::string&& str) { - const size_t tail_length = str.size() % N; - if (tail_length != 0) - str += std::string(N - tail_length, '0'); - return str; -} - -// Adds '0' chars at the end of the string until the size is a multiple of N. -template -inline std::string PadToWord(const std::string& str) { - return PadToWord(std::string(str)); -} - -// Converts a left-to-right stream of bits to std::bitset. -template -inline std::bitset StreamToBitset(std::string str) { - std::reverse(str.begin(), str.end()); - return std::bitset(str); -} - -// Converts first |num_bits| of std::bitset to a left-to-right stream of bits. -template -inline std::string BitsetToStream(const std::bitset& bits, size_t num_bits = N) { - std::string str = bits.to_string().substr(N - num_bits); - std::reverse(str.begin(), str.end()); - return str; -} - -// Converts a left-to-right stream of bits to uint64. -inline uint64_t StreamToBits(std::string str) { - std::reverse(str.begin(), str.end()); - return std::bitset<64>(str).to_ullong(); -} - -// Converts first |num_bits| stored in uint64 to a left-to-right stream of bits. -inline std::string BitsToStream(uint64_t bits, size_t num_bits = 64) { - std::bitset<64> bitset(bits); - return BitsetToStream(bitset, num_bits); -} - -// Base class for writing sequences of bits. -class BitWriterInterface { - public: - BitWriterInterface() {} - virtual ~BitWriterInterface() {} - - // Writes lower |num_bits| in |bits| to the stream. - // |num_bits| must be no greater than 64. - virtual void WriteBits(uint64_t bits, size_t num_bits) = 0; - - // Writes left-to-right string of '0' and '1' to stream. - // String length must be no greater than 64. - // Note: "01" will be writen as 0x2, not 0x1. The string doesn't represent - // numbers but a stream of bits in the order they come from encoder. - virtual void WriteStream(const std::string& bits) { - WriteBits(StreamToBits(bits), bits.length()); - } - - // Writes lower |num_bits| in |bits| to the stream. - // |num_bits| must be no greater than 64. - template - void WriteBitset(const std::bitset& bits, size_t num_bits = N) { - WriteBits(bits.to_ullong(), num_bits); - } - - // Writes bits from value of type |T| to the stream. No encoding is done. - // Always writes 8 * sizeof(T) bits. - template - void WriteUnencoded(T val) { - static_assert(sizeof(T) <= 64, "Type size too large"); - uint64_t bits = 0; - memcpy(&bits, &val, sizeof(T)); - WriteBits(bits, sizeof(T) * 8); - } - - // Writes |val| in chunks of size |chunk_length| followed by a signal bit: - // 0 - no more chunks to follow - // 1 - more chunks to follow - // for example 255 is encoded into 1111 1 1111 0 for chunk length 4. - // The last chunk can be truncated and signal bit omitted, if the entire - // payload (for example 16 bit for uint16_t has already been written). - void WriteVariableWidthU64(uint64_t val, size_t chunk_length); - void WriteVariableWidthU32(uint32_t val, size_t chunk_length); - void WriteVariableWidthU16(uint16_t val, size_t chunk_length); - void WriteVariableWidthU8(uint8_t val, size_t chunk_length); - void WriteVariableWidthS64( - int64_t val, size_t chunk_length, size_t zigzag_exponent); - void WriteVariableWidthS32( - int32_t val, size_t chunk_length, size_t zigzag_exponent); - void WriteVariableWidthS16( - int16_t val, size_t chunk_length, size_t zigzag_exponent); - void WriteVariableWidthS8( - int8_t val, size_t chunk_length, size_t zigzag_exponent); - - // Writes |val| using fixed bit width. Bit width is determined by |max_val|: - // max_val 0 -> bit width 1 - // max_val 1 -> bit width 1 - // max_val 2 -> bit width 2 - // max_val 3 -> bit width 2 - // max_val 4 -> bit width 3 - // max_val 5 -> bit width 3 - // max_val 8 -> bit width 4 - // max_val n -> bit width 1 + floor(log2(n)) - // |val| needs to be <= |max_val|. - void WriteFixedWidth(uint64_t val, uint64_t max_val); - - // Returns number of bits written. - virtual size_t GetNumBits() const = 0; - - // Provides direct access to the buffer data if implemented. - virtual const uint8_t* GetData() const { - return nullptr; - } - - // Returns buffer size in bytes. - size_t GetDataSizeBytes() const { - return NumBitsToNumWords<8>(GetNumBits()); - } - - // Generates and returns byte array containing written bits. - virtual std::vector GetDataCopy() const = 0; - - BitWriterInterface(const BitWriterInterface&) = delete; - BitWriterInterface& operator=(const BitWriterInterface&) = delete; -}; - -// This class is an implementation of BitWriterInterface, using -// std::vector to store written bits. -class BitWriterWord64 : public BitWriterInterface { - public: - explicit BitWriterWord64(size_t reserve_bits = 64); - - void WriteBits(uint64_t bits, size_t num_bits) override; - - size_t GetNumBits() const override { - return end_; - } - - const uint8_t* GetData() const override { - return reinterpret_cast(buffer_.data()); - } - - std::vector GetDataCopy() const override { - return std::vector(GetData(), GetData() + GetDataSizeBytes()); - } - - // Returns written stream as std::string, padded with zeroes so that the - // length is a multiple of 64. - std::string GetStreamPadded64() const { - return BufferToStream(buffer_); - } - - // Sets callback to emit bit sequences after every write. - void SetCallback(std::function callback) { - callback_ = callback; - } - - protected: - // Sends string generated from arguments to callback_ if defined. - void EmitSequence(uint64_t bits, size_t num_bits) const { - if (callback_) - callback_(BitsToStream(bits, num_bits)); - } - - private: - std::vector buffer_; - // Total number of bits written so far. Named 'end' as analogy to std::end(). - size_t end_; - - // If not null, the writer will use the callback to emit the written bit - // sequence as a string of '0' and '1'. - std::function callback_; -}; - -// Base class for reading sequences of bits. -class BitReaderInterface { - public: - BitReaderInterface() {} - virtual ~BitReaderInterface() {} - - // Reads |num_bits| from the stream, stores them in |bits|. - // Returns number of read bits. |num_bits| must be no greater than 64. - virtual size_t ReadBits(uint64_t* bits, size_t num_bits) = 0; - - // Reads |num_bits| from the stream, stores them in |bits|. - // Returns number of read bits. |num_bits| must be no greater than 64. - template - size_t ReadBitset(std::bitset* bits, size_t num_bits = N) { - uint64_t val = 0; - size_t num_read = ReadBits(&val, num_bits); - if (num_read) { - *bits = std::bitset(val); - } - return num_read; - } - - // Reads |num_bits| from the stream, returns string in left-to-right order. - // The length of the returned string may be less than |num_bits| if end was - // reached. - std::string ReadStream(size_t num_bits) { - uint64_t bits = 0; - size_t num_read = ReadBits(&bits, num_bits); - return BitsToStream(bits, num_read); - } - - // Reads 8 * sizeof(T) bits and stores them in |val|. - template - bool ReadUnencoded(T* val) { - static_assert(sizeof(T) <= 64, "Type size too large"); - uint64_t bits = 0; - const size_t num_read = ReadBits(&bits, sizeof(T) * 8); - if (num_read != sizeof(T) * 8) - return false; - memcpy(val, &bits, sizeof(T)); - return true; - } - - // Returns number of bits already read. - virtual size_t GetNumReadBits() const = 0; - - // These two functions define 'hard' and 'soft' EOF. - // - // Returns true if the end of the buffer was reached. - virtual bool ReachedEnd() const = 0; - // Returns true if we reached the end of the buffer or are nearing it and only - // zero bits are left to read. Implementations of this function are allowed to - // commit a "false negative" error if the end of the buffer was not reached, - // i.e. it can return false even if indeed only zeroes are left. - // It is assumed that the consumer expects that - // the buffer stream ends with padding zeroes, and would accept this as a - // 'soft' EOF. Implementations of this class do not necessarily need to - // implement this, default behavior can simply delegate to ReachedEnd(). - virtual bool OnlyZeroesLeft() const { - return ReachedEnd(); - } - - // Reads value encoded with WriteVariableWidthXXX (see BitWriterInterface). - // Reader and writer must use the same |chunk_length| and variable type. - // Returns true on success, false if the bit stream ends prematurely. - bool ReadVariableWidthU64(uint64_t* val, size_t chunk_length); - bool ReadVariableWidthU32(uint32_t* val, size_t chunk_length); - bool ReadVariableWidthU16(uint16_t* val, size_t chunk_length); - bool ReadVariableWidthU8(uint8_t* val, size_t chunk_length); - bool ReadVariableWidthS64( - int64_t* val, size_t chunk_length, size_t zigzag_exponent); - bool ReadVariableWidthS32( - int32_t* val, size_t chunk_length, size_t zigzag_exponent); - bool ReadVariableWidthS16( - int16_t* val, size_t chunk_length, size_t zigzag_exponent); - bool ReadVariableWidthS8( - int8_t* val, size_t chunk_length, size_t zigzag_exponent); - - // Reads value written by WriteFixedWidth (|max_val| needs to be the same). - // Returns true on success, false if the bit stream ends prematurely. - bool ReadFixedWidth(uint64_t* val, uint64_t max_val); - - BitReaderInterface(const BitReaderInterface&) = delete; - BitReaderInterface& operator=(const BitReaderInterface&) = delete; -}; - -// This class is an implementation of BitReaderInterface which accepts both -// uint8_t and uint64_t buffers as input. uint64_t buffers are consumed and -// owned. uint8_t buffers are copied. -class BitReaderWord64 : public BitReaderInterface { - public: - // Consumes and owns the buffer. - explicit BitReaderWord64(std::vector&& buffer); - - // Copies the buffer and casts it to uint64. - // Consuming the original buffer and casting it to uint64 is difficult, - // as it would potentially cause data misalignment and poor performance. - explicit BitReaderWord64(const std::vector& buffer); - BitReaderWord64(const void* buffer, size_t num_bytes); - - size_t ReadBits(uint64_t* bits, size_t num_bits) override; - - size_t GetNumReadBits() const override { - return pos_; - } - - bool ReachedEnd() const override; - bool OnlyZeroesLeft() const override; - - BitReaderWord64() = delete; - private: - const std::vector buffer_; - size_t pos_; -}; - -} // namespace spvutils - -#endif // LIBSPIRV_UTIL_BIT_STREAM_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/bitutils.h vulkan-1.1.73+dfsg/external/spirv-tools/source/util/bitutils.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/bitutils.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/util/bitutils.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_UTIL_BITUTILS_H_ -#define LIBSPIRV_UTIL_BITUTILS_H_ - -#include -#include - -namespace spvutils { - -// Performs a bitwise copy of source to the destination type Dest. -template -Dest BitwiseCast(Src source) { - Dest dest; - static_assert(sizeof(source) == sizeof(dest), - "BitwiseCast: Source and destination must have the same size"); - std::memcpy(&dest, &source, sizeof(dest)); - return dest; -} - -// SetBits returns an integer of type with bits set -// for position through , counting from the least -// significant bit. In particular when Num == 0, no positions are set to 1. -// A static assert will be triggered if First + Num > sizeof(T) * 8, that is, -// a bit that will not fit in the underlying type is set. -template -struct SetBits { - static_assert(First < sizeof(T) * 8, - "Tried to set a bit that is shifted too far."); - const static T get = (T(1) << First) | SetBits::get; -}; - -template -struct SetBits { - const static T get = T(0); -}; - -// This is all compile-time so we can put our tests right here. -static_assert(SetBits::get == uint32_t(0x00000000), - "SetBits failed"); -static_assert(SetBits::get == uint32_t(0x00000001), - "SetBits failed"); -static_assert(SetBits::get == uint32_t(0x80000000), - "SetBits failed"); -static_assert(SetBits::get == uint32_t(0x00000006), - "SetBits failed"); -static_assert(SetBits::get == uint32_t(0xc0000000), - "SetBits failed"); -static_assert(SetBits::get == uint32_t(0x7FFFFFFF), - "SetBits failed"); -static_assert(SetBits::get == uint32_t(0xFFFFFFFF), - "SetBits failed"); -static_assert(SetBits::get == uint32_t(0xFFFF0000), - "SetBits failed"); - -static_assert(SetBits::get == uint64_t(0x0000000000000001LL), - "SetBits failed"); -static_assert(SetBits::get == uint64_t(0x8000000000000000LL), - "SetBits failed"); -static_assert(SetBits::get == uint64_t(0xc000000000000000LL), - "SetBits failed"); -static_assert(SetBits::get == uint64_t(0x0000000080000000LL), - "SetBits failed"); -static_assert(SetBits::get == uint64_t(0x00000000FFFF0000LL), - "SetBits failed"); - -} // namespace spvutils - -#endif // LIBSPIRV_UTIL_BITUTILS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/hex_float.h vulkan-1.1.73+dfsg/external/spirv-tools/source/util/hex_float.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/hex_float.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/util/hex_float.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,1111 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_UTIL_HEX_FLOAT_H_ -#define LIBSPIRV_UTIL_HEX_FLOAT_H_ - -#include -#include -#include -#include -#include -#include -#include - -#include "bitutils.h" - -#ifndef __GNUC__ -#define GCC_VERSION 0 -#else -#define GCC_VERSION \ - (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) -#endif - -namespace spvutils { - -class Float16 { - public: - Float16(uint16_t v) : val(v) {} - Float16() = default; - static bool isNan(const Float16& val) { - return ((val.val & 0x7C00) == 0x7C00) && ((val.val & 0x3FF) != 0); - } - // Returns true if the given value is any kind of infinity. - static bool isInfinity(const Float16& val) { - return ((val.val & 0x7C00) == 0x7C00) && ((val.val & 0x3FF) == 0); - } - Float16(const Float16& other) { val = other.val; } - uint16_t get_value() const { return val; } - - // Returns the maximum normal value. - static Float16 max() { return Float16(0x7bff); } - // Returns the lowest normal value. - static Float16 lowest() { return Float16(0xfbff); } - - private: - uint16_t val; -}; - -// To specialize this type, you must override uint_type to define -// an unsigned integer that can fit your floating point type. -// You must also add a isNan function that returns true if -// a value is Nan. -template -struct FloatProxyTraits { - using uint_type = void; -}; - -template <> -struct FloatProxyTraits { - using uint_type = uint32_t; - static bool isNan(float f) { return std::isnan(f); } - // Returns true if the given value is any kind of infinity. - static bool isInfinity(float f) { return std::isinf(f); } - // Returns the maximum normal value. - static float max() { return std::numeric_limits::max(); } - // Returns the lowest normal value. - static float lowest() { return std::numeric_limits::lowest(); } -}; - -template <> -struct FloatProxyTraits { - using uint_type = uint64_t; - static bool isNan(double f) { return std::isnan(f); } - // Returns true if the given value is any kind of infinity. - static bool isInfinity(double f) { return std::isinf(f); } - // Returns the maximum normal value. - static double max() { return std::numeric_limits::max(); } - // Returns the lowest normal value. - static double lowest() { return std::numeric_limits::lowest(); } -}; - -template <> -struct FloatProxyTraits { - using uint_type = uint16_t; - static bool isNan(Float16 f) { return Float16::isNan(f); } - // Returns true if the given value is any kind of infinity. - static bool isInfinity(Float16 f) { return Float16::isInfinity(f); } - // Returns the maximum normal value. - static Float16 max() { return Float16::max(); } - // Returns the lowest normal value. - static Float16 lowest() { return Float16::lowest(); } -}; - -// Since copying a floating point number (especially if it is NaN) -// does not guarantee that bits are preserved, this class lets us -// store the type and use it as a float when necessary. -template -class FloatProxy { - public: - using uint_type = typename FloatProxyTraits::uint_type; - - // Since this is to act similar to the normal floats, - // do not initialize the data by default. - FloatProxy() = default; - - // Intentionally non-explicit. This is a proxy type so - // implicit conversions allow us to use it more transparently. - FloatProxy(T val) { data_ = BitwiseCast(val); } - - // Intentionally non-explicit. This is a proxy type so - // implicit conversions allow us to use it more transparently. - FloatProxy(uint_type val) { data_ = val; } - - // This is helpful to have and is guaranteed not to stomp bits. - FloatProxy operator-() const { - return static_cast(data_ ^ - (uint_type(0x1) << (sizeof(T) * 8 - 1))); - } - - // Returns the data as a floating point value. - T getAsFloat() const { return BitwiseCast(data_); } - - // Returns the raw data. - uint_type data() const { return data_; } - - // Returns true if the value represents any type of NaN. - bool isNan() { return FloatProxyTraits::isNan(getAsFloat()); } - // Returns true if the value represents any type of infinity. - bool isInfinity() { return FloatProxyTraits::isInfinity(getAsFloat()); } - - // Returns the maximum normal value. - static FloatProxy max() { - return FloatProxy(FloatProxyTraits::max()); - } - // Returns the lowest normal value. - static FloatProxy lowest() { - return FloatProxy(FloatProxyTraits::lowest()); - } - - private: - uint_type data_; -}; - -template -bool operator==(const FloatProxy& first, const FloatProxy& second) { - return first.data() == second.data(); -} - -// Reads a FloatProxy value as a normal float from a stream. -template -std::istream& operator>>(std::istream& is, FloatProxy& value) { - T float_val; - is >> float_val; - value = FloatProxy(float_val); - return is; -} - -// This is an example traits. It is not meant to be used in practice, but will -// be the default for any non-specialized type. -template -struct HexFloatTraits { - // Integer type that can store this hex-float. - using uint_type = void; - // Signed integer type that can store this hex-float. - using int_type = void; - // The numerical type that this HexFloat represents. - using underlying_type = void; - // The type needed to construct the underlying type. - using native_type = void; - // The number of bits that are actually relevant in the uint_type. - // This allows us to deal with, for example, 24-bit values in a 32-bit - // integer. - static const uint32_t num_used_bits = 0; - // Number of bits that represent the exponent. - static const uint32_t num_exponent_bits = 0; - // Number of bits that represent the fractional part. - static const uint32_t num_fraction_bits = 0; - // The bias of the exponent. (How much we need to subtract from the stored - // value to get the correct value.) - static const uint32_t exponent_bias = 0; -}; - -// Traits for IEEE float. -// 1 sign bit, 8 exponent bits, 23 fractional bits. -template <> -struct HexFloatTraits> { - using uint_type = uint32_t; - using int_type = int32_t; - using underlying_type = FloatProxy; - using native_type = float; - static const uint_type num_used_bits = 32; - static const uint_type num_exponent_bits = 8; - static const uint_type num_fraction_bits = 23; - static const uint_type exponent_bias = 127; -}; - -// Traits for IEEE double. -// 1 sign bit, 11 exponent bits, 52 fractional bits. -template <> -struct HexFloatTraits> { - using uint_type = uint64_t; - using int_type = int64_t; - using underlying_type = FloatProxy; - using native_type = double; - static const uint_type num_used_bits = 64; - static const uint_type num_exponent_bits = 11; - static const uint_type num_fraction_bits = 52; - static const uint_type exponent_bias = 1023; -}; - -// Traits for IEEE half. -// 1 sign bit, 5 exponent bits, 10 fractional bits. -template <> -struct HexFloatTraits> { - using uint_type = uint16_t; - using int_type = int16_t; - using underlying_type = uint16_t; - using native_type = uint16_t; - static const uint_type num_used_bits = 16; - static const uint_type num_exponent_bits = 5; - static const uint_type num_fraction_bits = 10; - static const uint_type exponent_bias = 15; -}; - -enum class round_direction { - kToZero, - kToNearestEven, - kToPositiveInfinity, - kToNegativeInfinity, - max = kToNegativeInfinity -}; - -// Template class that houses a floating pointer number. -// It exposes a number of constants based on the provided traits to -// assist in interpreting the bits of the value. -template > -class HexFloat { - public: - using uint_type = typename Traits::uint_type; - using int_type = typename Traits::int_type; - using underlying_type = typename Traits::underlying_type; - using native_type = typename Traits::native_type; - - explicit HexFloat(T f) : value_(f) {} - - T value() const { return value_; } - void set_value(T f) { value_ = f; } - - // These are all written like this because it is convenient to have - // compile-time constants for all of these values. - - // Pass-through values to save typing. - static const uint32_t num_used_bits = Traits::num_used_bits; - static const uint32_t exponent_bias = Traits::exponent_bias; - static const uint32_t num_exponent_bits = Traits::num_exponent_bits; - static const uint32_t num_fraction_bits = Traits::num_fraction_bits; - - // Number of bits to shift left to set the highest relevant bit. - static const uint32_t top_bit_left_shift = num_used_bits - 1; - // How many nibbles (hex characters) the fractional part takes up. - static const uint32_t fraction_nibbles = (num_fraction_bits + 3) / 4; - // If the fractional part does not fit evenly into a hex character (4-bits) - // then we have to left-shift to get rid of leading 0s. This is the amount - // we have to shift (might be 0). - static const uint32_t num_overflow_bits = - fraction_nibbles * 4 - num_fraction_bits; - - // The representation of the fraction, not the actual bits. This - // includes the leading bit that is usually implicit. - static const uint_type fraction_represent_mask = - spvutils::SetBits::get; - - // The topmost bit in the nibble-aligned fraction. - static const uint_type fraction_top_bit = - uint_type(1) << (num_fraction_bits + num_overflow_bits - 1); - - // The least significant bit in the exponent, which is also the bit - // immediately to the left of the significand. - static const uint_type first_exponent_bit = uint_type(1) - << (num_fraction_bits); - - // The mask for the encoded fraction. It does not include the - // implicit bit. - static const uint_type fraction_encode_mask = - spvutils::SetBits::get; - - // The bit that is used as a sign. - static const uint_type sign_mask = uint_type(1) << top_bit_left_shift; - - // The bits that represent the exponent. - static const uint_type exponent_mask = - spvutils::SetBits::get; - - // How far left the exponent is shifted. - static const uint32_t exponent_left_shift = num_fraction_bits; - - // How far from the right edge the fraction is shifted. - static const uint32_t fraction_right_shift = - static_cast(sizeof(uint_type) * 8) - num_fraction_bits; - - // The maximum representable unbiased exponent. - static const int_type max_exponent = - (exponent_mask >> num_fraction_bits) - exponent_bias; - // The minimum representable exponent for normalized numbers. - static const int_type min_exponent = -static_cast(exponent_bias); - - // Returns the bits associated with the value. - uint_type getBits() const { return spvutils::BitwiseCast(value_); } - - // Returns the bits associated with the value, without the leading sign bit. - uint_type getUnsignedBits() const { - return static_cast(spvutils::BitwiseCast(value_) & - ~sign_mask); - } - - // Returns the bits associated with the exponent, shifted to start at the - // lsb of the type. - const uint_type getExponentBits() const { - return static_cast((getBits() & exponent_mask) >> - num_fraction_bits); - } - - // Returns the exponent in unbiased form. This is the exponent in the - // human-friendly form. - const int_type getUnbiasedExponent() const { - return static_cast(getExponentBits() - exponent_bias); - } - - // Returns just the significand bits from the value. - const uint_type getSignificandBits() const { - return getBits() & fraction_encode_mask; - } - - // If the number was normalized, returns the unbiased exponent. - // If the number was denormal, normalize the exponent first. - const int_type getUnbiasedNormalizedExponent() const { - if ((getBits() & ~sign_mask) == 0) { // special case if everything is 0 - return 0; - } - int_type exp = getUnbiasedExponent(); - if (exp == min_exponent) { // We are in denorm land. - uint_type significand_bits = getSignificandBits(); - while ((significand_bits & (first_exponent_bit >> 1)) == 0) { - significand_bits = static_cast(significand_bits << 1); - exp = static_cast(exp - 1); - } - significand_bits &= fraction_encode_mask; - } - return exp; - } - - // Returns the signficand after it has been normalized. - const uint_type getNormalizedSignificand() const { - int_type unbiased_exponent = getUnbiasedNormalizedExponent(); - uint_type significand = getSignificandBits(); - for (int_type i = unbiased_exponent; i <= min_exponent; ++i) { - significand = static_cast(significand << 1); - } - significand &= fraction_encode_mask; - return significand; - } - - // Returns true if this number represents a negative value. - bool isNegative() const { return (getBits() & sign_mask) != 0; } - - // Sets this HexFloat from the individual components. - // Note this assumes EVERY significand is normalized, and has an implicit - // leading one. This means that the only way that this method will set 0, - // is if you set a number so denormalized that it underflows. - // Do not use this method with raw bits extracted from a subnormal number, - // since subnormals do not have an implicit leading 1 in the significand. - // The significand is also expected to be in the - // lowest-most num_fraction_bits of the uint_type. - // The exponent is expected to be unbiased, meaning an exponent of - // 0 actually means 0. - // If underflow_round_up is set, then on underflow, if a number is non-0 - // and would underflow, we round up to the smallest denorm. - void setFromSignUnbiasedExponentAndNormalizedSignificand( - bool negative, int_type exponent, uint_type significand, - bool round_denorm_up) { - bool significand_is_zero = significand == 0; - - if (exponent <= min_exponent) { - // If this was denormalized, then we have to shift the bit on, meaning - // the significand is not zero. - significand_is_zero = false; - significand |= first_exponent_bit; - significand = static_cast(significand >> 1); - } - - while (exponent < min_exponent) { - significand = static_cast(significand >> 1); - ++exponent; - } - - if (exponent == min_exponent) { - if (significand == 0 && !significand_is_zero && round_denorm_up) { - significand = static_cast(0x1); - } - } - - uint_type new_value = 0; - if (negative) { - new_value = static_cast(new_value | sign_mask); - } - exponent = static_cast(exponent + exponent_bias); - assert(exponent >= 0); - - // put it all together - exponent = static_cast((exponent << exponent_left_shift) & - exponent_mask); - significand = static_cast(significand & fraction_encode_mask); - new_value = static_cast(new_value | (exponent | significand)); - value_ = BitwiseCast(new_value); - } - - // Increments the significand of this number by the given amount. - // If this would spill the significand into the implicit bit, - // carry is set to true and the significand is shifted to fit into - // the correct location, otherwise carry is set to false. - // All significands and to_increment are assumed to be within the bounds - // for a valid significand. - static uint_type incrementSignificand(uint_type significand, - uint_type to_increment, bool* carry) { - significand = static_cast(significand + to_increment); - *carry = false; - if (significand & first_exponent_bit) { - *carry = true; - // The implicit 1-bit will have carried, so we should zero-out the - // top bit and shift back. - significand = static_cast(significand & ~first_exponent_bit); - significand = static_cast(significand >> 1); - } - return significand; - } - -#if GCC_VERSION == 40801 - // These exist because MSVC throws warnings on negative right-shifts - // even if they are not going to be executed. Eg: - // constant_number < 0? 0: constant_number - // These convert the negative left-shifts into right shifts. - template - struct negatable_left_shift { - static uint_type val(uint_type val) { - if (N > 0) { - return static_cast(val << N); - } else { - return static_cast(val >> N); - } - } - }; - - template - struct negatable_right_shift { - static uint_type val(uint_type val) { - if (N > 0) { - return static_cast(val >> N); - } else { - return static_cast(val << N); - } - } - }; - -#else - // These exist because MSVC throws warnings on negative right-shifts - // even if they are not going to be executed. Eg: - // constant_number < 0? 0: constant_number - // These convert the negative left-shifts into right shifts. - template - struct negatable_left_shift { - static uint_type val(uint_type val) { - return static_cast(val >> -N); - } - }; - - template - struct negatable_left_shift= 0>::type> { - static uint_type val(uint_type val) { - return static_cast(val << N); - } - }; - - template - struct negatable_right_shift { - static uint_type val(uint_type val) { - return static_cast(val << -N); - } - }; - - template - struct negatable_right_shift= 0>::type> { - static uint_type val(uint_type val) { - return static_cast(val >> N); - } - }; -#endif - - // Returns the significand, rounded to fit in a significand in - // other_T. This is shifted so that the most significant - // bit of the rounded number lines up with the most significant bit - // of the returned significand. - template - typename other_T::uint_type getRoundedNormalizedSignificand( - round_direction dir, bool* carry_bit) { - using other_uint_type = typename other_T::uint_type; - static const int_type num_throwaway_bits = - static_cast(num_fraction_bits) - - static_cast(other_T::num_fraction_bits); - - static const uint_type last_significant_bit = - (num_throwaway_bits < 0) - ? 0 - : negatable_left_shift::val(1u); - static const uint_type first_rounded_bit = - (num_throwaway_bits < 1) - ? 0 - : negatable_left_shift::val(1u); - - static const uint_type throwaway_mask_bits = - num_throwaway_bits > 0 ? num_throwaway_bits : 0; - static const uint_type throwaway_mask = - spvutils::SetBits::get; - - *carry_bit = false; - other_uint_type out_val = 0; - uint_type significand = getNormalizedSignificand(); - // If we are up-casting, then we just have to shift to the right location. - if (num_throwaway_bits <= 0) { - out_val = static_cast(significand); - uint_type shift_amount = static_cast(-num_throwaway_bits); - out_val = static_cast(out_val << shift_amount); - return out_val; - } - - // If every non-representable bit is 0, then we don't have any casting to - // do. - if ((significand & throwaway_mask) == 0) { - return static_cast( - negatable_right_shift::val(significand)); - } - - bool round_away_from_zero = false; - // We actually have to narrow the significand here, so we have to follow the - // rounding rules. - switch (dir) { - case round_direction::kToZero: - break; - case round_direction::kToPositiveInfinity: - round_away_from_zero = !isNegative(); - break; - case round_direction::kToNegativeInfinity: - round_away_from_zero = isNegative(); - break; - case round_direction::kToNearestEven: - // Have to round down, round bit is 0 - if ((first_rounded_bit & significand) == 0) { - break; - } - if (((significand & throwaway_mask) & ~first_rounded_bit) != 0) { - // If any subsequent bit of the rounded portion is non-0 then we round - // up. - round_away_from_zero = true; - break; - } - // We are exactly half-way between 2 numbers, pick even. - if ((significand & last_significant_bit) != 0) { - // 1 for our last bit, round up. - round_away_from_zero = true; - break; - } - break; - } - - if (round_away_from_zero) { - return static_cast( - negatable_right_shift::val(incrementSignificand( - significand, last_significant_bit, carry_bit))); - } else { - return static_cast( - negatable_right_shift::val(significand)); - } - } - - // Casts this value to another HexFloat. If the cast is widening, - // then round_dir is ignored. If the cast is narrowing, then - // the result is rounded in the direction specified. - // This number will retain Nan and Inf values. - // It will also saturate to Inf if the number overflows, and - // underflow to (0 or min depending on rounding) if the number underflows. - template - void castTo(other_T& other, round_direction round_dir) { - other = other_T(static_cast(0)); - bool negate = isNegative(); - if (getUnsignedBits() == 0) { - if (negate) { - other.set_value(-other.value()); - } - return; - } - uint_type significand = getSignificandBits(); - bool carried = false; - typename other_T::uint_type rounded_significand = - getRoundedNormalizedSignificand(round_dir, &carried); - - int_type exponent = getUnbiasedExponent(); - if (exponent == min_exponent) { - // If we are denormal, normalize the exponent, so that we can encode - // easily. - exponent = static_cast(exponent + 1); - for (uint_type check_bit = first_exponent_bit >> 1; check_bit != 0; - check_bit = static_cast(check_bit >> 1)) { - exponent = static_cast(exponent - 1); - if (check_bit & significand) break; - } - } - - bool is_nan = - (getBits() & exponent_mask) == exponent_mask && significand != 0; - bool is_inf = - !is_nan && - ((exponent + carried) > static_cast(other_T::exponent_bias) || - (significand == 0 && (getBits() & exponent_mask) == exponent_mask)); - - // If we are Nan or Inf we should pass that through. - if (is_inf) { - other.set_value(BitwiseCast( - static_cast( - (negate ? other_T::sign_mask : 0) | other_T::exponent_mask))); - return; - } - if (is_nan) { - typename other_T::uint_type shifted_significand; - shifted_significand = static_cast( - negatable_left_shift< - static_cast(other_T::num_fraction_bits) - - static_cast(num_fraction_bits)>::val(significand)); - - // We are some sort of Nan. We try to keep the bit-pattern of the Nan - // as close as possible. If we had to shift off bits so we are 0, then we - // just set the last bit. - other.set_value(BitwiseCast( - static_cast( - (negate ? other_T::sign_mask : 0) | other_T::exponent_mask | - (shifted_significand == 0 ? 0x1 : shifted_significand)))); - return; - } - - bool round_underflow_up = - isNegative() ? round_dir == round_direction::kToNegativeInfinity - : round_dir == round_direction::kToPositiveInfinity; - using other_int_type = typename other_T::int_type; - // setFromSignUnbiasedExponentAndNormalizedSignificand will - // zero out any underflowing value (but retain the sign). - other.setFromSignUnbiasedExponentAndNormalizedSignificand( - negate, static_cast(exponent), rounded_significand, - round_underflow_up); - return; - } - - private: - T value_; - - static_assert(num_used_bits == - Traits::num_exponent_bits + Traits::num_fraction_bits + 1, - "The number of bits do not fit"); - static_assert(sizeof(T) == sizeof(uint_type), "The type sizes do not match"); -}; - -// Returns 4 bits represented by the hex character. -inline uint8_t get_nibble_from_character(int character) { - const char* dec = "0123456789"; - const char* lower = "abcdef"; - const char* upper = "ABCDEF"; - const char* p = nullptr; - if ((p = strchr(dec, character))) { - return static_cast(p - dec); - } else if ((p = strchr(lower, character))) { - return static_cast(p - lower + 0xa); - } else if ((p = strchr(upper, character))) { - return static_cast(p - upper + 0xa); - } - - assert(false && "This was called with a non-hex character"); - return 0; -} - -// Outputs the given HexFloat to the stream. -template -std::ostream& operator<<(std::ostream& os, const HexFloat& value) { - using HF = HexFloat; - using uint_type = typename HF::uint_type; - using int_type = typename HF::int_type; - - static_assert(HF::num_used_bits != 0, - "num_used_bits must be non-zero for a valid float"); - static_assert(HF::num_exponent_bits != 0, - "num_exponent_bits must be non-zero for a valid float"); - static_assert(HF::num_fraction_bits != 0, - "num_fractin_bits must be non-zero for a valid float"); - - const uint_type bits = spvutils::BitwiseCast(value.value()); - const char* const sign = (bits & HF::sign_mask) ? "-" : ""; - const uint_type exponent = static_cast( - (bits & HF::exponent_mask) >> HF::num_fraction_bits); - - uint_type fraction = static_cast((bits & HF::fraction_encode_mask) - << HF::num_overflow_bits); - - const bool is_zero = exponent == 0 && fraction == 0; - const bool is_denorm = exponent == 0 && !is_zero; - - // exponent contains the biased exponent we have to convert it back into - // the normal range. - int_type int_exponent = static_cast(exponent - HF::exponent_bias); - // If the number is all zeros, then we actually have to NOT shift the - // exponent. - int_exponent = is_zero ? 0 : int_exponent; - - // If we are denorm, then start shifting, and decreasing the exponent until - // our leading bit is 1. - - if (is_denorm) { - while ((fraction & HF::fraction_top_bit) == 0) { - fraction = static_cast(fraction << 1); - int_exponent = static_cast(int_exponent - 1); - } - // Since this is denormalized, we have to consume the leading 1 since it - // will end up being implicit. - fraction = static_cast(fraction << 1); // eat the leading 1 - fraction &= HF::fraction_represent_mask; - } - - uint_type fraction_nibbles = HF::fraction_nibbles; - // We do not have to display any trailing 0s, since this represents the - // fractional part. - while (fraction_nibbles > 0 && (fraction & 0xF) == 0) { - // Shift off any trailing values; - fraction = static_cast(fraction >> 4); - --fraction_nibbles; - } - - const auto saved_flags = os.flags(); - const auto saved_fill = os.fill(); - - os << sign << "0x" << (is_zero ? '0' : '1'); - if (fraction_nibbles) { - // Make sure to keep the leading 0s in place, since this is the fractional - // part. - os << "." << std::setw(static_cast(fraction_nibbles)) - << std::setfill('0') << std::hex << fraction; - } - os << "p" << std::dec << (int_exponent >= 0 ? "+" : "") << int_exponent; - - os.flags(saved_flags); - os.fill(saved_fill); - - return os; -} - -// Returns true if negate_value is true and the next character on the -// input stream is a plus or minus sign. In that case we also set the fail bit -// on the stream and set the value to the zero value for its type. -template -inline bool RejectParseDueToLeadingSign(std::istream& is, bool negate_value, - HexFloat& value) { - if (negate_value) { - auto next_char = is.peek(); - if (next_char == '-' || next_char == '+') { - // Fail the parse. Emulate standard behaviour by setting the value to - // the zero value, and set the fail bit on the stream. - value = HexFloat(typename HexFloat::uint_type{0}); - is.setstate(std::ios_base::failbit); - return true; - } - } - return false; -} - -// Parses a floating point number from the given stream and stores it into the -// value parameter. -// If negate_value is true then the number may not have a leading minus or -// plus, and if it successfully parses, then the number is negated before -// being stored into the value parameter. -// If the value cannot be correctly parsed or overflows the target floating -// point type, then set the fail bit on the stream. -// TODO(dneto): Promise C++11 standard behavior in how the value is set in -// the error case, but only after all target platforms implement it correctly. -// In particular, the Microsoft C++ runtime appears to be out of spec. -template -inline std::istream& ParseNormalFloat(std::istream& is, bool negate_value, - HexFloat& value) { - if (RejectParseDueToLeadingSign(is, negate_value, value)) { - return is; - } - T val; - is >> val; - if (negate_value) { - val = -val; - } - value.set_value(val); - // In the failure case, map -0.0 to 0.0. - if (is.fail() && value.getUnsignedBits() == 0u) { - value = HexFloat(typename HexFloat::uint_type{0}); - } - if (val.isInfinity()) { - // Fail the parse. Emulate standard behaviour by setting the value to - // the closest normal value, and set the fail bit on the stream. - value.set_value((value.isNegative() | negate_value) ? T::lowest() - : T::max()); - is.setstate(std::ios_base::failbit); - } - return is; -} - -// Specialization of ParseNormalFloat for FloatProxy values. -// This will parse the float as it were a 32-bit floating point number, -// and then round it down to fit into a Float16 value. -// The number is rounded towards zero. -// If negate_value is true then the number may not have a leading minus or -// plus, and if it successfully parses, then the number is negated before -// being stored into the value parameter. -// If the value cannot be correctly parsed or overflows the target floating -// point type, then set the fail bit on the stream. -// TODO(dneto): Promise C++11 standard behavior in how the value is set in -// the error case, but only after all target platforms implement it correctly. -// In particular, the Microsoft C++ runtime appears to be out of spec. -template <> -inline std::istream& -ParseNormalFloat, HexFloatTraits>>( - std::istream& is, bool negate_value, - HexFloat, HexFloatTraits>>& value) { - // First parse as a 32-bit float. - HexFloat> float_val(0.0f); - ParseNormalFloat(is, negate_value, float_val); - - // Then convert to 16-bit float, saturating at infinities, and - // rounding toward zero. - float_val.castTo(value, round_direction::kToZero); - - // Overflow on 16-bit behaves the same as for 32- and 64-bit: set the - // fail bit and set the lowest or highest value. - if (Float16::isInfinity(value.value().getAsFloat())) { - value.set_value(value.isNegative() ? Float16::lowest() : Float16::max()); - is.setstate(std::ios_base::failbit); - } - return is; -} - -// Reads a HexFloat from the given stream. -// If the float is not encoded as a hex-float then it will be parsed -// as a regular float. -// This may fail if your stream does not support at least one unget. -// Nan values can be encoded with "0x1.p+exponent_bias". -// This would normally overflow a float and round to -// infinity but this special pattern is the exact representation for a NaN, -// and therefore is actually encoded as the correct NaN. To encode inf, -// either 0x0p+exponent_bias can be specified or any exponent greater than -// exponent_bias. -// Examples using IEEE 32-bit float encoding. -// 0x1.0p+128 (+inf) -// -0x1.0p-128 (-inf) -// -// 0x1.1p+128 (+Nan) -// -0x1.1p+128 (-Nan) -// -// 0x1p+129 (+inf) -// -0x1p+129 (-inf) -template -std::istream& operator>>(std::istream& is, HexFloat& value) { - using HF = HexFloat; - using uint_type = typename HF::uint_type; - using int_type = typename HF::int_type; - - value.set_value(static_cast(0.f)); - - if (is.flags() & std::ios::skipws) { - // If the user wants to skip whitespace , then we should obey that. - while (std::isspace(is.peek())) { - is.get(); - } - } - - auto next_char = is.peek(); - bool negate_value = false; - - if (next_char != '-' && next_char != '0') { - return ParseNormalFloat(is, negate_value, value); - } - - if (next_char == '-') { - negate_value = true; - is.get(); - next_char = is.peek(); - } - - if (next_char == '0') { - is.get(); // We may have to unget this. - auto maybe_hex_start = is.peek(); - if (maybe_hex_start != 'x' && maybe_hex_start != 'X') { - is.unget(); - return ParseNormalFloat(is, negate_value, value); - } else { - is.get(); // Throw away the 'x'; - } - } else { - return ParseNormalFloat(is, negate_value, value); - } - - // This "looks" like a hex-float so treat it as one. - bool seen_p = false; - bool seen_dot = false; - uint_type fraction_index = 0; - - uint_type fraction = 0; - int_type exponent = HF::exponent_bias; - - // Strip off leading zeros so we don't have to special-case them later. - while ((next_char = is.peek()) == '0') { - is.get(); - } - - bool is_denorm = - true; // Assume denorm "representation" until we hear otherwise. - // NB: This does not mean the value is actually denorm, - // it just means that it was written 0. - bool bits_written = false; // Stays false until we write a bit. - while (!seen_p && !seen_dot) { - // Handle characters that are left of the fractional part. - if (next_char == '.') { - seen_dot = true; - } else if (next_char == 'p') { - seen_p = true; - } else if (::isxdigit(next_char)) { - // We know this is not denormalized since we have stripped all leading - // zeroes and we are not a ".". - is_denorm = false; - int number = get_nibble_from_character(next_char); - for (int i = 0; i < 4; ++i, number <<= 1) { - uint_type write_bit = (number & 0x8) ? 0x1 : 0x0; - if (bits_written) { - // If we are here the bits represented belong in the fractional - // part of the float, and we have to adjust the exponent accordingly. - fraction = static_cast( - fraction | - static_cast( - write_bit << (HF::top_bit_left_shift - fraction_index++))); - exponent = static_cast(exponent + 1); - } - bits_written |= write_bit != 0; - } - } else { - // We have not found our exponent yet, so we have to fail. - is.setstate(std::ios::failbit); - return is; - } - is.get(); - next_char = is.peek(); - } - bits_written = false; - while (seen_dot && !seen_p) { - // Handle only fractional parts now. - if (next_char == 'p') { - seen_p = true; - } else if (::isxdigit(next_char)) { - int number = get_nibble_from_character(next_char); - for (int i = 0; i < 4; ++i, number <<= 1) { - uint_type write_bit = (number & 0x8) ? 0x01 : 0x00; - bits_written |= write_bit != 0; - if (is_denorm && !bits_written) { - // Handle modifying the exponent here this way we can handle - // an arbitrary number of hex values without overflowing our - // integer. - exponent = static_cast(exponent - 1); - } else { - fraction = static_cast( - fraction | - static_cast( - write_bit << (HF::top_bit_left_shift - fraction_index++))); - } - } - } else { - // We still have not found our 'p' exponent yet, so this is not a valid - // hex-float. - is.setstate(std::ios::failbit); - return is; - } - is.get(); - next_char = is.peek(); - } - - bool seen_sign = false; - int8_t exponent_sign = 1; - int_type written_exponent = 0; - while (true) { - if ((next_char == '-' || next_char == '+')) { - if (seen_sign) { - is.setstate(std::ios::failbit); - return is; - } - seen_sign = true; - exponent_sign = (next_char == '-') ? -1 : 1; - } else if (::isdigit(next_char)) { - // Hex-floats express their exponent as decimal. - written_exponent = static_cast(written_exponent * 10); - written_exponent = - static_cast(written_exponent + (next_char - '0')); - } else { - break; - } - is.get(); - next_char = is.peek(); - } - - written_exponent = static_cast(written_exponent * exponent_sign); - exponent = static_cast(exponent + written_exponent); - - bool is_zero = is_denorm && (fraction == 0); - if (is_denorm && !is_zero) { - fraction = static_cast(fraction << 1); - exponent = static_cast(exponent - 1); - } else if (is_zero) { - exponent = 0; - } - - if (exponent <= 0 && !is_zero) { - fraction = static_cast(fraction >> 1); - fraction |= static_cast(1) << HF::top_bit_left_shift; - } - - fraction = (fraction >> HF::fraction_right_shift) & HF::fraction_encode_mask; - - const int_type max_exponent = - SetBits::get; - - // Handle actual denorm numbers - while (exponent < 0 && !is_zero) { - fraction = static_cast(fraction >> 1); - exponent = static_cast(exponent + 1); - - fraction &= HF::fraction_encode_mask; - if (fraction == 0) { - // We have underflowed our fraction. We should clamp to zero. - is_zero = true; - exponent = 0; - } - } - - // We have overflowed so we should be inf/-inf. - if (exponent > max_exponent) { - exponent = max_exponent; - fraction = 0; - } - - uint_type output_bits = static_cast( - static_cast(negate_value ? 1 : 0) << HF::top_bit_left_shift); - output_bits |= fraction; - - uint_type shifted_exponent = static_cast( - static_cast(exponent << HF::exponent_left_shift) & - HF::exponent_mask); - output_bits |= shifted_exponent; - - T output_float = spvutils::BitwiseCast(output_bits); - value.set_value(output_float); - - return is; -} - -// Writes a FloatProxy value to a stream. -// Zero and normal numbers are printed in the usual notation, but with -// enough digits to fully reproduce the value. Other values (subnormal, -// NaN, and infinity) are printed as a hex float. -template -std::ostream& operator<<(std::ostream& os, const FloatProxy& value) { - auto float_val = value.getAsFloat(); - switch (std::fpclassify(float_val)) { - case FP_ZERO: - case FP_NORMAL: { - auto saved_precision = os.precision(); - os.precision(std::numeric_limits::digits10); - os << float_val; - os.precision(saved_precision); - } break; - default: - os << HexFloat>(value); - break; - } - return os; -} - -template <> -inline std::ostream& operator<<(std::ostream& os, - const FloatProxy& value) { - os << HexFloat>(value); - return os; -} -} // namespace spvutils - -#endif // LIBSPIRV_UTIL_HEX_FLOAT_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/huffman_codec.h vulkan-1.1.73+dfsg/external/spirv-tools/source/util/huffman_codec.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/huffman_codec.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/util/huffman_codec.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,410 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Contains utils for reading, writing and debug printing bit streams. - -#ifndef LIBSPIRV_UTIL_HUFFMAN_CODEC_H_ -#define LIBSPIRV_UTIL_HUFFMAN_CODEC_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace spvutils { - -// Used to generate and apply a Huffman coding scheme. -// |Val| is the type of variable being encoded (for example a string or a -// literal). -template -class HuffmanCodec { - public: - // Huffman tree node. - struct Node { - Node() {} - - // Creates Node from serialization leaving weight and id undefined. - Node(const Val& in_value, uint32_t in_left, uint32_t in_right) - : value(in_value), left(in_left), right(in_right) {} - - Val value = Val(); - uint32_t weight = 0; - // Ids are issued sequentially starting from 1. Ids are used as an ordering - // tie-breaker, to make sure that the ordering (and resulting coding scheme) - // are consistent accross multiple platforms. - uint32_t id = 0; - // Handles of children. - uint32_t left = 0; - uint32_t right = 0; - }; - - // Creates Huffman codec from a histogramm. - // Histogramm counts must not be zero. - explicit HuffmanCodec(const std::map& hist) { - if (hist.empty()) return; - - // Heuristic estimate. - nodes_.reserve(3 * hist.size()); - - // Create NIL. - CreateNode(); - - // The queue is sorted in ascending order by weight (or by node id if - // weights are equal). - std::vector queue_vector; - queue_vector.reserve(hist.size()); - std::priority_queue, - std::function> - queue(std::bind(&HuffmanCodec::LeftIsBigger, this, - std::placeholders::_1, std::placeholders::_2), - std::move(queue_vector)); - - // Put all leaves in the queue. - for (const auto& pair : hist) { - const uint32_t node = CreateNode(); - MutableValueOf(node) = pair.first; - MutableWeightOf(node) = pair.second; - assert(WeightOf(node)); - queue.push(node); - } - - // Form the tree by combining two subtrees with the least weight, - // and pushing the root of the new tree in the queue. - while (true) { - // We push a node at the end of each iteration, so the queue is never - // supposed to be empty at this point, unless there are no leaves, but - // that case was already handled. - assert(!queue.empty()); - const uint32_t right = queue.top(); - queue.pop(); - - // If the queue is empty at this point, then the last node is - // the root of the complete Huffman tree. - if (queue.empty()) { - root_ = right; - break; - } - - const uint32_t left = queue.top(); - queue.pop(); - - // Combine left and right into a new tree and push it into the queue. - const uint32_t parent = CreateNode(); - MutableWeightOf(parent) = WeightOf(right) + WeightOf(left); - MutableLeftOf(parent) = left; - MutableRightOf(parent) = right; - queue.push(parent); - } - - // Traverse the tree and form encoding table. - CreateEncodingTable(); - } - - // Creates Huffman codec from saved tree structure. - // |nodes| is the list of nodes of the tree, nodes[0] being NIL. - // |root_handle| is the index of the root node. - HuffmanCodec(uint32_t root_handle, std::vector&& nodes) { - nodes_ = std::move(nodes); - assert(!nodes_.empty()); - assert(root_handle > 0 && root_handle < nodes_.size()); - assert(!LeftOf(0) && !RightOf(0)); - - root_ = root_handle; - - // Traverse the tree and form encoding table. - CreateEncodingTable(); - } - - // Serializes the codec in the following text format: - // (, { - // {0, 0, 0}, - // {val1, left1, right1}, - // {val2, left2, right2}, - // ... - // }) - std::string SerializeToText(int indent_num_whitespaces) const { - const bool value_is_text = std::is_same::value; - - const std::string indent1 = std::string(indent_num_whitespaces, ' '); - const std::string indent2 = std::string(indent_num_whitespaces + 2, ' '); - - std::stringstream code; - code << "(" << root_ << ", {\n"; - - for (const Node& node : nodes_) { - code << indent2 << "{"; - if (value_is_text) - code << "\""; - code << node.value; - if (value_is_text) - code << "\""; - code << ", " << node.left << ", " << node.right << "},\n"; - } - - code << indent1 << "})"; - - return code.str(); - } - - // Prints the Huffman tree in the following format: - // w------w------'x' - // w------'y' - // Where w stands for the weight of the node. - // Right tree branches appear above left branches. Taking the right path - // adds 1 to the code, taking the left adds 0. - void PrintTree(std::ostream& out) const { - PrintTreeInternal(out, root_, 0); - } - - // Traverses the tree and prints the Huffman table: value, code - // and optionally node weight for every leaf. - void PrintTable(std::ostream& out, bool print_weights = true) { - std::queue> queue; - queue.emplace(root_, ""); - - while (!queue.empty()) { - const uint32_t node = queue.front().first; - const std::string code = queue.front().second; - queue.pop(); - if (!RightOf(node) && !LeftOf(node)) { - out << ValueOf(node); - if (print_weights) - out << " " << WeightOf(node); - out << " " << code << std::endl; - } else { - if (LeftOf(node)) - queue.emplace(LeftOf(node), code + "0"); - - if (RightOf(node)) - queue.emplace(RightOf(node), code + "1"); - } - } - } - - // Returns the Huffman table. The table was built at at construction time, - // this function just returns a const reference. - const std::unordered_map>& - GetEncodingTable() const { - return encoding_table_; - } - - // Encodes |val| and stores its Huffman code in the lower |num_bits| of - // |bits|. Returns false of |val| is not in the Huffman table. - bool Encode(const Val& val, uint64_t* bits, size_t* num_bits) const { - auto it = encoding_table_.find(val); - if (it == encoding_table_.end()) - return false; - *bits = it->second.first; - *num_bits = it->second.second; - return true; - } - - // Reads bits one-by-one using callback |read_bit| until a match is found. - // Matching value is stored in |val|. Returns false if |read_bit| terminates - // before a code was mathced. - // |read_bit| has type bool func(bool* bit). When called, the next bit is - // stored in |bit|. |read_bit| returns false if the stream terminates - // prematurely. - bool DecodeFromStream( - const std::function& read_bit, Val* val) const { - uint32_t node = root_; - while (true) { - assert(node); - - if (!RightOf(node) && !LeftOf(node)) { - *val = ValueOf(node); - return true; - } - - bool go_right; - if (!read_bit(&go_right)) - return false; - - if (go_right) - node = RightOf(node); - else - node = LeftOf(node); - } - - assert (0); - return false; - } - - private: - // Returns value of the node referenced by |handle|. - Val ValueOf(uint32_t node) const { - return nodes_.at(node).value; - } - - // Returns left child of |node|. - uint32_t LeftOf(uint32_t node) const { - return nodes_.at(node).left; - } - - // Returns right child of |node|. - uint32_t RightOf(uint32_t node) const { - return nodes_.at(node).right; - } - - // Returns weight of |node|. - uint32_t WeightOf(uint32_t node) const { - return nodes_.at(node).weight; - } - - // Returns id of |node|. - uint32_t IdOf(uint32_t node) const { - return nodes_.at(node).id; - } - - // Returns mutable reference to value of |node|. - Val& MutableValueOf(uint32_t node) { - assert(node); - return nodes_.at(node).value; - } - - // Returns mutable reference to handle of left child of |node|. - uint32_t& MutableLeftOf(uint32_t node) { - assert(node); - return nodes_.at(node).left; - } - - // Returns mutable reference to handle of right child of |node|. - uint32_t& MutableRightOf(uint32_t node) { - assert(node); - return nodes_.at(node).right; - } - - // Returns mutable reference to weight of |node|. - uint32_t& MutableWeightOf(uint32_t node) { - return nodes_.at(node).weight; - } - - // Returns mutable reference to id of |node|. - uint32_t& MutableIdOf(uint32_t node) { - return nodes_.at(node).id; - } - - // Returns true if |left| has bigger weight than |right|. Node ids are - // used as tie-breaker. - bool LeftIsBigger(uint32_t left, uint32_t right) const { - if (WeightOf(left) == WeightOf(right)) { - assert (IdOf(left) != IdOf(right)); - return IdOf(left) > IdOf(right); - } - return WeightOf(left) > WeightOf(right); - } - - // Prints subtree (helper function used by PrintTree). - void PrintTreeInternal(std::ostream& out, uint32_t node, size_t depth) const { - if (!node) - return; - - const size_t kTextFieldWidth = 7; - - if (!RightOf(node) && !LeftOf(node)) { - out << ValueOf(node) << std::endl; - } else { - if (RightOf(node)) { - std::stringstream label; - label << std::setfill('-') << std::left << std::setw(kTextFieldWidth) - << WeightOf(RightOf(node)); - out << label.str(); - PrintTreeInternal(out, RightOf(node), depth + 1); - } - - if (LeftOf(node)) { - out << std::string(depth * kTextFieldWidth, ' '); - std::stringstream label; - label << std::setfill('-') << std::left << std::setw(kTextFieldWidth) - << WeightOf(LeftOf(node)); - out << label.str(); - PrintTreeInternal(out, LeftOf(node), depth + 1); - } - } - } - - // Traverses the Huffman tree and saves paths to the leaves as bit - // sequences to encoding_table_. - void CreateEncodingTable() { - struct Context { - Context(uint32_t in_node, uint64_t in_bits, size_t in_depth) - : node(in_node), bits(in_bits), depth(in_depth) {} - uint32_t node; - // Huffman tree depth cannot exceed 64 as histogramm counts are expected - // to be positive and limited by numeric_limits::max(). - // For practical applications tree depth would be much smaller than 64. - uint64_t bits; - size_t depth; - }; - - std::queue queue; - queue.emplace(root_, 0, 0); - - while (!queue.empty()) { - const Context& context = queue.front(); - const uint32_t node = context.node; - const uint64_t bits = context.bits; - const size_t depth = context.depth; - queue.pop(); - - if (!RightOf(node) && !LeftOf(node)) { - auto insertion_result = encoding_table_.emplace( - ValueOf(node), std::pair(bits, depth)); - assert(insertion_result.second); - (void)insertion_result; - } else { - if (LeftOf(node)) - queue.emplace(LeftOf(node), bits, depth + 1); - - if (RightOf(node)) - queue.emplace(RightOf(node), bits | (1ULL << depth), depth + 1); - } - } - } - - // Creates new Huffman tree node and stores it in the deleter array. - uint32_t CreateNode() { - const uint32_t handle = static_cast(nodes_.size()); - nodes_.emplace_back(Node()); - nodes_.back().id = next_node_id_++; - return handle; - } - - // Huffman tree root handle. - uint32_t root_ = 0; - - // Huffman tree deleter. - std::vector nodes_; - - // Encoding table value -> {bits, num_bits}. - // Huffman codes are expected to never exceed 64 bit length (this is in fact - // impossible if frequencies are stored as uint32_t). - std::unordered_map> encoding_table_; - - // Next node id issued by CreateNode(); - uint32_t next_node_id_ = 1; -}; - -} // namespace spvutils - -#endif // LIBSPIRV_UTIL_HUFFMAN_CODEC_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/ilist.h vulkan-1.1.73+dfsg/external/spirv-tools/source/util/ilist.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/ilist.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/util/ilist.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,317 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_ILIST_H_ -#define LIBSPIRV_OPT_ILIST_H_ - -#include -#include -#include -#include - -#include "ilist_node.h" - -namespace spvtools { -namespace utils { - -// An IntrusiveList is a generic implementation of a doubly-linked list. The -// intended convention for using this container is: -// -// class Node : public IntrusiveNodeBase { -// // Note that "Node", the class being defined is the template. -// // Must have a default constructor accessible to List. -// // Add whatever data is needed in the node -// }; -// -// using List = IntrusiveList; -// -// You can also inherit from IntrusiveList instead of a typedef if you want to -// add more functionality. -// -// The condition on the template for IntrusiveNodeBase is there to add some type -// checking to the container. The compiler will still allow inserting elements -// of type IntrusiveNodeBase, but that would be an error. This assumption -// allows NextNode and PreviousNode to return pointers to Node, and casting will -// not be required by the user. - -template -class IntrusiveList { - public: - static_assert( - std::is_base_of, NodeType>::value, - "The type from the node must be derived from IntrusiveNodeBase, with " - "itself in the template."); - - // Creates an empty list. - inline IntrusiveList(); - - // Moves the contents of the given list to the list being constructed. - IntrusiveList(IntrusiveList&&); - - // Destorys the list. Note that the elements of the list will not be deleted, - // but they will be removed from the list. - virtual ~IntrusiveList(); - - // Moves all of the elements in the list on the RHS to the list on the LHS. - IntrusiveList& operator=(IntrusiveList&&); - - // Basetype for iterators so an IntrusiveList can be traversed like STL - // containers. - template - class iterator_template { - public: - iterator_template(const iterator_template& i) : node_(i.node_) {} - - iterator_template& operator++() { - node_ = node_->next_node_; - return *this; - } - - iterator_template& operator--() { - node_ = node_->previous_node_; - return *this; - } - - iterator_template& operator=(const iterator_template& i) { - node_ = i.node_; - return *this; - } - - T& operator*() const { return *node_; } - T* operator->() const { return node_; } - - friend inline bool operator==(const iterator_template& lhs, - const iterator_template& rhs) { - return lhs.node_ == rhs.node_; - } - friend inline bool operator!=(const iterator_template& lhs, - const iterator_template& rhs) { - return !(lhs == rhs); - } - - // Moves the nodes in |list| to the list that |this| points to. The - // positions of the nodes will be immediately before the element pointed to - // by the iterator. The return value will be an iterator pointing to the - // first of the newly inserted elements. - iterator_template MoveBefore(IntrusiveList* list) { - if (list->empty()) return *this; - - NodeType* first_node = list->sentinel_.next_node_; - NodeType* last_node = list->sentinel_.previous_node_; - - this->node_->previous_node_->next_node_ = first_node; - first_node->previous_node_ = this->node_->previous_node_; - - last_node->next_node_ = this->node_; - this->node_->previous_node_ = last_node; - - list->sentinel_.next_node_ = &list->sentinel_; - list->sentinel_.previous_node_ = &list->sentinel_; - - return iterator(first_node); - } - - protected: - iterator_template() = delete; - inline iterator_template(T* node) { node_ = node; } - T* node_; - - friend IntrusiveList; - }; - - using iterator = iterator_template; - using const_iterator = iterator_template; - - // Various types of iterators for the start (begin) and one past the end (end) - // of the list. - // - // Decrementing |end()| iterator will give and iterator pointing to the last - // element in the list, if one exists. - // - // Incrementing |end()| iterator will give |begin()|. - // - // Decrementing |begin()| will give |end()|. - // - // TODO: Not marking these functions as noexcept because Visual Studio 2013 - // does not support it. When we no longer care about that compiler, we should - // mark these as noexcept. - iterator begin(); - iterator end(); - const_iterator begin() const; - const_iterator end() const; - const_iterator cbegin() const; - const_iterator cend() const; - - // Appends |node| to the end of the list. If |node| is already in a list, it - // will be removed from that list first. - void push_back(NodeType* node); - - // Returns true if the list is empty. - bool empty() const; - - // Returns references to the first or last element in the list. It is an - // error to call these functions on an empty list. - NodeType& front(); - NodeType& back(); - const NodeType& front() const; - const NodeType& back() const; - - protected: - // Doing a deep copy of the list does not make sense if the list does not own - // the data. It is not clear who will own the newly created data. Making - // copies illegal for that reason. - IntrusiveList(const IntrusiveList&) = delete; - IntrusiveList& operator=(const IntrusiveList&) = delete; - - // This function will assert if it finds the list containing |node| is not in - // a valid state. - static void Check(NodeType* node); - - // A special node used to represent both the start and end of the list, - // without being part of the list. - NodeType sentinel_; -}; - -// Implementation of IntrusiveList - -template -inline IntrusiveList::IntrusiveList() : sentinel_() { - sentinel_.next_node_ = &sentinel_; - sentinel_.previous_node_ = &sentinel_; - sentinel_.is_sentinel_ = true; -} - -template -IntrusiveList::IntrusiveList(IntrusiveList&& list) : sentinel_() { - sentinel_.next_node_ = &sentinel_; - sentinel_.previous_node_ = &sentinel_; - sentinel_.is_sentinel_ = true; - list.sentinel_.ReplaceWith(&sentinel_); -} - -template -IntrusiveList::~IntrusiveList() { - while (!empty()) { - front().RemoveFromList(); - } -} - -template -IntrusiveList& IntrusiveList::operator=( - IntrusiveList&& list) { - list.sentinel_.ReplaceWith(&sentinel_); - return *this; -} - -template -inline typename IntrusiveList::iterator -IntrusiveList::begin() { - return iterator(sentinel_.next_node_); -} - -template -inline typename IntrusiveList::iterator -IntrusiveList::end() { - return iterator(&sentinel_); -} - -template -inline typename IntrusiveList::const_iterator -IntrusiveList::begin() const { - return const_iterator(sentinel_.next_node_); -} - -template -inline typename IntrusiveList::const_iterator -IntrusiveList::end() const { - return const_iterator(&sentinel_); -} - -template -inline typename IntrusiveList::const_iterator -IntrusiveList::cbegin() const { - return const_iterator(sentinel_.next_node_); -} - -template -inline typename IntrusiveList::const_iterator -IntrusiveList::cend() const { - return const_iterator(&sentinel_); -} - -template -void IntrusiveList::push_back(NodeType* node) { - node->InsertBefore(&sentinel_); -} - -template -bool IntrusiveList::empty() const { - return sentinel_.NextNode() == nullptr; -} - -template -NodeType& IntrusiveList::front() { - NodeType* node = sentinel_.NextNode(); - assert(node != nullptr && "Can't get the front of an empty list."); - return *node; -} - -template -NodeType& IntrusiveList::back() { - NodeType* node = sentinel_.PreviousNode(); - assert(node != nullptr && "Can't get the back of an empty list."); - return *node; -} - -template -const NodeType& IntrusiveList::front() const { - NodeType* node = sentinel_.NextNode(); - assert(node != nullptr && "Can't get the front of an empty list."); - return *node; -} - -template -const NodeType& IntrusiveList::back() const { - NodeType* node = sentinel_.PreviousNode(); - assert(node != nullptr && "Can't get the back of an empty list."); - return *node; -} - -template -void IntrusiveList::Check(NodeType* start) { - int sentinel_count = 0; - NodeType* p = start; - do { - assert(p != nullptr); - assert(p->next_node_->previous_node_ == p); - assert(p->previous_node_->next_node_ == p); - if (p->is_sentinel_) sentinel_count++; - p = p->next_node_; - } while (p != start); - assert(sentinel_count == 1 && "List should have exactly 1 sentinel node."); - - p = start; - do { - assert(p != nullptr); - assert(p->previous_node_->next_node_ == p); - assert(p->next_node_->previous_node_ == p); - if (p->is_sentinel_) sentinel_count++; - p = p->previous_node_; - } while (p != start); -} - -} // namespace utils -} // namespace spvtools - -#endif // LIBSPIRV_OPT_ILIST_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/ilist_node.h vulkan-1.1.73+dfsg/external/spirv-tools/source/util/ilist_node.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/ilist_node.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/util/ilist_node.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,261 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_ILIST_NODE_H_ -#define LIBSPIRV_OPT_ILIST_NODE_H_ - -#include - -namespace spvtools { -namespace utils { - -template -class IntrusiveList; - -// IntrusiveNodeBase is the base class for nodes in an IntrusiveList. -// See the comments in ilist.h on how to use the class. - -template -class IntrusiveNodeBase { - public: - // Creates a new node that is not in a list. - inline IntrusiveNodeBase(); - inline IntrusiveNodeBase(const IntrusiveNodeBase&); - inline IntrusiveNodeBase& operator=(const IntrusiveNodeBase&); - inline IntrusiveNodeBase(IntrusiveNodeBase&& that); - - // Destroys a node. It is an error to destroy a node that is part of a - // list, unless it is a sentinel. - virtual ~IntrusiveNodeBase(); - - IntrusiveNodeBase& operator=(IntrusiveNodeBase&& that); - - // Returns true if |this| is in a list. - inline bool IsInAList() const; - - // Returns the node that comes after the given node in the list, if one - // exists. If the given node is not in a list or is at the end of the list, - // the return value is nullptr. - inline NodeType* NextNode() const; - - // Returns the node that comes before the given node in the list, if one - // exists. If the given node is not in a list or is at the start of the - // list, the return value is nullptr. - inline NodeType* PreviousNode() const; - - // Inserts the given node immediately before |pos| in the list. - // If the given node is already in a list, it will first be removed - // from that list. - // - // It is assumed that the given node is of type NodeType. It is an error if - // |pos| is not already in a list. - inline void InsertBefore(NodeType* pos); - - // Inserts the given node immediately after |pos| in the list. - // If the given node is already in a list, it will first be removed - // from that list. - // - // It is assumed that the given node is of type NodeType. It is an error if - // |pos| is not already in a list. - inline void InsertAfter(NodeType* pos); - - // Removes the given node from the list. It is assumed that the node is - // in a list. Note that this does not free any storage related to the node, - // it becomes the caller's responsibility to free the storage. - inline void RemoveFromList(); - - protected: - // Replaces |this| with |target|. |this| is a sentinel if and only if - // |target| is also a sentinel. - // - // If neither node is a sentinel, |target| takes - // the place of |this|. It is assumed that |target| is not in a list. - // - // If both are sentinels, then it will cause all of the - // nodes in the list containing |this| to be moved to the list containing - // |target|. In this case, it is assumed that |target| is an empty list. - // - // No storage will be deleted. - void ReplaceWith(NodeType* target); - - // Returns true if |this| is the sentinel node of an empty list. - bool IsEmptyList(); - - // The pointers to the next and previous nodes in the list. - // If the current node is not part of a list, then |next_node_| and - // |previous_node_| are equal to |nullptr|. - NodeType* next_node_; - NodeType* previous_node_; - - // Only true for the sentinel node stored in the list itself. - bool is_sentinel_; - - friend IntrusiveList; -}; - -// Implementation of IntrusiveNodeBase - -template -inline IntrusiveNodeBase::IntrusiveNodeBase() - : next_node_(nullptr), previous_node_(nullptr), is_sentinel_(false) {} - -template -inline IntrusiveNodeBase::IntrusiveNodeBase( - const IntrusiveNodeBase&) { - next_node_ = nullptr; - previous_node_ = nullptr; - is_sentinel_ = false; -} - -template -inline IntrusiveNodeBase& IntrusiveNodeBase::operator=( - const IntrusiveNodeBase&) { - assert(!is_sentinel_); - if (IsInAList()) RemoveFromList(); - return *this; -} - -template -inline IntrusiveNodeBase::IntrusiveNodeBase(IntrusiveNodeBase&& that) - : next_node_(nullptr), - previous_node_(nullptr), - is_sentinel_(that.is_sentinel_) { - if (is_sentinel_) { - next_node_ = this; - previous_node_ = this; - } - that.ReplaceWith(this); -} - -template -IntrusiveNodeBase::~IntrusiveNodeBase() { - assert(is_sentinel_ || !IsInAList()); -} - -template -IntrusiveNodeBase& IntrusiveNodeBase::operator=( - IntrusiveNodeBase&& that) { - that.ReplaceWith(this); - return *this; -} - -template -inline bool IntrusiveNodeBase::IsInAList() const { - return next_node_ != nullptr; -} - -template -inline NodeType* IntrusiveNodeBase::NextNode() const { - if (!next_node_->is_sentinel_) return next_node_; - return nullptr; -} - -template -inline NodeType* IntrusiveNodeBase::PreviousNode() const { - if (!previous_node_->is_sentinel_) return previous_node_; - return nullptr; -} - -template -inline void IntrusiveNodeBase::InsertBefore(NodeType* pos) { - assert(!this->is_sentinel_ && "Sentinel nodes cannot be moved around."); - assert(pos->IsInAList() && "Pos should already be in a list."); - if (this->IsInAList()) this->RemoveFromList(); - - this->next_node_ = pos; - this->previous_node_ = pos->previous_node_; - pos->previous_node_ = static_cast(this); - this->previous_node_->next_node_ = static_cast(this); -} - -template -inline void IntrusiveNodeBase::InsertAfter(NodeType* pos) { - assert(!this->is_sentinel_ && "Sentinel nodes cannot be moved around."); - assert(pos->IsInAList() && "Pos should already be in a list."); - if (this->IsInAList()) { - this->RemoveFromList(); - } - - this->previous_node_ = pos; - this->next_node_ = pos->next_node_; - pos->next_node_ = static_cast(this); - this->next_node_->previous_node_ = static_cast(this); -} - -template -inline void IntrusiveNodeBase::RemoveFromList() { - assert(!this->is_sentinel_ && "Sentinel nodes cannot be moved around."); - assert(this->IsInAList() && - "Cannot remove a node from a list if it is not in a list."); - - this->next_node_->previous_node_ = this->previous_node_; - this->previous_node_->next_node_ = this->next_node_; - this->next_node_ = nullptr; - this->previous_node_ = nullptr; -} - -template -void IntrusiveNodeBase::ReplaceWith(NodeType* target) { - if (this->is_sentinel_) { - assert(target->IsEmptyList() && - "If target is not an empty list, the nodes in that list would not " - "be linked to a sentinel."); - } else { - assert(IsInAList() && "The node being replaced must be in a list."); - assert(!target->is_sentinel_ && - "Cannot turn a sentinel node into one that is not."); - } - - if (!this->IsEmptyList()) { - // Link target into the same position that |this| was in. - target->next_node_ = this->next_node_; - target->previous_node_ = this->previous_node_; - target->next_node_->previous_node_ = target; - target->previous_node_->next_node_ = target; - - // Reset |this| to itself default value. - if (!this->is_sentinel_) { - // Reset |this| so that it is not in a list. - this->next_node_ = nullptr; - this->previous_node_ = nullptr; - } else { - // Set |this| so that it is the head of an empty list. - // We cannot treat sentinel nodes like others because it is invalid for - // a sentinel node to not be in a list. - this->next_node_ = static_cast(this); - this->previous_node_ = static_cast(this); - } - } else { - // If |this| points to itself, it must be a sentinel node with an empty - // list. Reset |this| so that it is the head of an empty list. We want - // |target| to be the same. The asserts above guarantee that. - } -} - -template -bool IntrusiveNodeBase::IsEmptyList() { - if (next_node_ == this) { - assert(is_sentinel_ && - "None sentinel nodes should never point to themselves."); - assert(previous_node_ == this && - "Inconsistency with the previous and next nodes."); - return true; - } - return false; -} - -} // namespace utils -} // namespace spvtools - -#endif // LIBSPIRV_OPT_ILIST_NODE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/move_to_front.h vulkan-1.1.73+dfsg/external/spirv-tools/source/util/move_to_front.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/move_to_front.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/util/move_to_front.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,851 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_UTIL_MOVE_TO_FRONT_H_ -#define LIBSPIRV_UTIL_MOVE_TO_FRONT_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace spvutils { - -// Log(n) move-to-front implementation. Implements the following functions: -// Insert - pushes value to the front of the mtf sequence -// (only unique values allowed). -// Remove - remove value from the sequence. -// ValueFromRank - access value by its 1-indexed rank in the sequence. -// RankFromValue - get the rank of the given value in the sequence. -// Accessing a value with ValueFromRank or RankFromValue moves the value to the -// front of the sequence (rank of 1). -// -// The implementation is based on an AVL-based order statistic tree. The tree -// is ordered by timestamps issued when values are inserted or accessed (recent -// values go to the left side of the tree, old values are gradually rotated to -// the right side). -// -// Terminology -// rank: 1-indexed rank showing how recently the value was inserted or accessed. -// node: handle used internally to access node data. -// size: size of the subtree of a node (including the node). -// height: distance from a node to the farthest leaf. -template -class MoveToFront { - public: - explicit MoveToFront(size_t reserve_capacity = 128) { - nodes_.reserve(reserve_capacity); - - // Create NIL node. - nodes_.emplace_back(Node()); - } - - virtual ~MoveToFront() {} - - // Inserts value in the move-to-front sequence. Does nothing if the value is - // already in the sequence. Returns true if insertion was successful. - // The inserted value is placed at the front of the sequence (rank 1). - bool Insert(const Val& value); - - // Removes value from move-to-front sequence. Returns false iff the value - // was not found. - bool Remove(const Val& value); - - // Computes 1-indexed rank of value in the move-to-front sequence and moves - // the value to the front. Example: - // Before the call: 4 8 2 1 7 - // RankFromValue(8) returns 1 - // After the call: 8 4 2 1 7 - // Returns true iff the value was found in the sequence. - bool RankFromValue(const Val& value, uint32_t* rank); - - // Returns value corresponding to a 1-indexed rank in the move-to-front - // sequence and moves the value to the front. Example: - // Before the call: 4 8 2 1 7 - // ValueFromRank(1) returns 8 - // After the call: 8 4 2 1 7 - // Returns true iff the rank is within bounds [1, GetSize()]. - bool ValueFromRank(uint32_t rank, Val* value); - - // Moves the value to the front of the sequence. - // Returns false iff value is not in the sequence. - bool Promote(const Val& value); - - // Returns true iff the move-to-front sequence contains the value. - bool HasValue(const Val& value) const; - - // Returns the number of elements in the move-to-front sequence. - uint32_t GetSize() const { - return SizeOf(root_); - } - - protected: - // Internal tree data structure uses handles instead of pointers. Leaves and - // root parent reference a singleton under handle 0. Although dereferencing - // a null pointer is not possible, inappropriate access to handle 0 would - // cause an assertion. Handles are not garbage collected if value was deprecated - // with DeprecateValue(). But handles are recycled when a node is repositioned. - - // Internal tree data structure node. - struct Node { - // Timestamp from a logical clock which updates every time the element is - // accessed through ValueFromRank or RankFromValue. - uint32_t timestamp = 0; - // The size of the node's subtree, including the node. - // SizeOf(LeftOf(node)) + SizeOf(RightOf(node)) + 1. - uint32_t size = 0; - // Handles to connected nodes. - uint32_t left = 0; - uint32_t right = 0; - uint32_t parent = 0; - // Distance to the farthest leaf. - // Leaves have height 0, real nodes at least 1. - uint32_t height = 0; - // Stored value. - Val value = Val(); - }; - - // Creates node and sets correct values. Non-NIL nodes should be created only - // through this function. If the node with this value has been created previously - // and since orphaned, reuses the old node instead of creating a new one. - uint32_t CreateNode(uint32_t timestamp, const Val& value) { - uint32_t handle = static_cast(nodes_.size()); - const auto result = value_to_node_.emplace(value, handle); - if (result.second) { - // Create new node. - nodes_.emplace_back(Node()); - Node& node = nodes_.back(); - node.timestamp = timestamp; - node.value = value; - node.size = 1; - // Non-NIL nodes start with height 1 because their NIL children are leaves. - node.height = 1; - } else { - // Reuse old node. - handle = result.first->second; - assert(!IsInTree(handle)); - assert(ValueOf(handle) == value); - assert(SizeOf(handle) == 1); - assert(HeightOf(handle) == 1); - MutableTimestampOf(handle) = timestamp; - } - - return handle; - } - - // Node accessor methods. Naming is designed to be similar to natural - // language as these functions tend to be used in sequences, for example: - // ParentOf(LeftestDescendentOf(RightOf(node))) - - // Returns value of the node referenced by |handle|. - Val ValueOf(uint32_t node) const { - return nodes_.at(node).value; - } - - // Returns left child of |node|. - uint32_t LeftOf(uint32_t node) const { - return nodes_.at(node).left; - } - - // Returns right child of |node|. - uint32_t RightOf(uint32_t node) const { - return nodes_.at(node).right; - } - - // Returns parent of |node|. - uint32_t ParentOf(uint32_t node) const { - return nodes_.at(node).parent; - } - - // Returns timestamp of |node|. - uint32_t TimestampOf(uint32_t node) const { - assert(node); - return nodes_.at(node).timestamp; - } - - // Returns size of |node|. - uint32_t SizeOf(uint32_t node) const { - return nodes_.at(node).size; - } - - // Returns height of |node|. - uint32_t HeightOf(uint32_t node) const { - return nodes_.at(node).height; - } - - // Returns mutable reference to value of |node|. - Val& MutableValueOf(uint32_t node) { - assert(node); - return nodes_.at(node).value; - } - - // Returns mutable reference to handle of left child of |node|. - uint32_t& MutableLeftOf(uint32_t node) { - assert(node); - return nodes_.at(node).left; - } - - // Returns mutable reference to handle of right child of |node|. - uint32_t& MutableRightOf(uint32_t node) { - assert(node); - return nodes_.at(node).right; - } - - // Returns mutable reference to handle of parent of |node|. - uint32_t& MutableParentOf(uint32_t node) { - assert(node); - return nodes_.at(node).parent; - } - - // Returns mutable reference to timestamp of |node|. - uint32_t& MutableTimestampOf(uint32_t node) { - assert(node); - return nodes_.at(node).timestamp; - } - - // Returns mutable reference to size of |node|. - uint32_t& MutableSizeOf(uint32_t node) { - assert(node); - return nodes_.at(node).size; - } - - // Returns mutable reference to height of |node|. - uint32_t& MutableHeightOf(uint32_t node) { - assert(node); - return nodes_.at(node).height; - } - - // Returns true iff |node| is left child of its parent. - bool IsLeftChild(uint32_t node) const { - assert(node); - return LeftOf(ParentOf(node)) == node; - } - - // Returns true iff |node| is right child of its parent. - bool IsRightChild(uint32_t node) const { - assert(node); - return RightOf(ParentOf(node)) == node; - } - - // Returns true iff |node| has no relatives. - bool IsOrphan(uint32_t node) const { - assert(node); - return !ParentOf(node) && !LeftOf(node) && !RightOf(node); - } - - // Returns true iff |node| is in the tree. - bool IsInTree(uint32_t node) const { - assert(node); - return node == root_ || !IsOrphan(node); - } - - // Returns the height difference between right and left subtrees. - int BalanceOf(uint32_t node) const { - return int(HeightOf(RightOf(node))) - int(HeightOf(LeftOf(node))); - } - - // Updates size and height of the node, assuming that the children have - // correct values. - void UpdateNode(uint32_t node); - - // Returns the most LeftOf(LeftOf(... descendent which is not leaf. - uint32_t LeftestDescendantOf(uint32_t node) const { - uint32_t parent = 0; - while (node) { - parent = node; - node = LeftOf(node); - } - return parent; - } - - // Returns the most RightOf(RightOf(... descendent which is not leaf. - uint32_t RightestDescendantOf(uint32_t node) const { - uint32_t parent = 0; - while (node) { - parent = node; - node = RightOf(node); - } - return parent; - } - - // Inserts node in the tree. The node must be an orphan. - void InsertNode(uint32_t node); - - // Removes node from the tree. May change value_to_node_ if removal uses a - // scapegoat. Returns the removed (orphaned) handle for recycling. The - // returned handle may not be equal to |node| if scapegoat was used. - uint32_t RemoveNode(uint32_t node); - - // Rotates |node| left, reassigns all connections and returns the node - // which takes place of the |node|. - uint32_t RotateLeft(const uint32_t node); - - // Rotates |node| right, reassigns all connections and returns the node - // which takes place of the |node|. - uint32_t RotateRight(const uint32_t node); - - // Root node handle. The tree is empty if root_ is 0. - uint32_t root_ = 0; - - // Incremented counters for next timestamp and value. - uint32_t next_timestamp_ = 1; - - // Holds all tree nodes. Indices of this vector are node handles. - std::vector nodes_; - - // Maps ids to node handles. - std::unordered_map value_to_node_; - - // Cache for the last accessed value in the sequence. - Val last_accessed_value_ = Val(); - bool last_accessed_value_valid_ = false; -}; - -template -class MultiMoveToFront { - public: - // Inserts |value| to sequence with handle |mtf|. - // Returns false if |mtf| already has |value|. - bool Insert(uint64_t mtf, const Val& value) { - if (GetMtf(mtf).Insert(value)) { - val_to_mtfs_[value].insert(mtf); - return true; - } - return false; - } - - // Removes |value| from sequence with handle |mtf|. - // Returns false if |mtf| doesn't have |value|. - bool Remove(uint64_t mtf, const Val& value) { - if (GetMtf(mtf).Remove(value)) { - val_to_mtfs_[value].erase(mtf); - return true; - } - assert(val_to_mtfs_[value].count(mtf) == 0); - return false; - } - - // Removes |value| from all sequences which have it. - void RemoveFromAll(const Val& value) { - auto it = val_to_mtfs_.find(value); - if (it == val_to_mtfs_.end()) - return; - - auto& mtfs_containing_value = it->second; - for (uint64_t mtf : mtfs_containing_value) { - GetMtf(mtf).Remove(value); - } - - val_to_mtfs_.erase(value); - } - - // Computes rank of |value| in sequence |mtf|. - // Returns false if |mtf| doesn't have |value|. - bool RankFromValue(uint64_t mtf, const Val& value, uint32_t* rank) { - return GetMtf(mtf).RankFromValue(value, rank); - } - - // Finds |value| with |rank| in sequence |mtf|. - // Returns false if |rank| is out of bounds. - bool ValueFromRank(uint64_t mtf, uint32_t rank, Val* value) { - return GetMtf(mtf).ValueFromRank(rank, value); - } - - // Returns size of |mtf| sequence. - uint32_t GetSize(uint64_t mtf) { - return GetMtf(mtf).GetSize(); - } - - // Promotes |value| in all sequences which have it. - void Promote(const Val& value) { - const auto it = val_to_mtfs_.find(value); - if (it == val_to_mtfs_.end()) - return; - - const auto& mtfs_containing_value = it->second; - for (uint64_t mtf : mtfs_containing_value) { - GetMtf(mtf).Promote(value); - } - } - - // Inserts |value| in sequence |mtf| or promotes if it's already there. - void InsertOrPromote(uint64_t mtf, const Val& value) { - if (!Insert(mtf, value)) { - GetMtf(mtf).Promote(value); - } - } - - // Returns if |mtf| sequence has |value|. - bool HasValue(uint64_t mtf, const Val& value) { - return GetMtf(mtf).HasValue(value); - } - - private: - // Returns actual MoveToFront object corresponding to |handle|. - // As multiple operations are often performed consecutively for the same - // sequence, the last returned value is cached. - MoveToFront& GetMtf(uint64_t handle) { - if (!cached_mtf_ || cached_handle_ != handle) { - cached_handle_ = handle; - cached_mtf_ = &mtfs_[handle]; - } - - return *cached_mtf_; - } - - // Container holding MoveToFront objects. Map key is sequence handle. - std::map> mtfs_; - - // Container mapping value to sequences which contain that value. - std::unordered_map> val_to_mtfs_; - - // Cache for the last accessed sequence. - uint64_t cached_handle_ = 0; - MoveToFront* cached_mtf_ = nullptr; -}; - -template -bool MoveToFront::Insert(const Val& value) { - auto it = value_to_node_.find(value); - if (it != value_to_node_.end() && IsInTree(it->second)) - return false; - - const uint32_t old_size = GetSize(); - (void)old_size; - - InsertNode(CreateNode(next_timestamp_++, value)); - - last_accessed_value_ = value; - last_accessed_value_valid_ = true; - - assert(value_to_node_.count(value)); - assert(old_size + 1 == GetSize()); - return true; -} - -template -bool MoveToFront::Remove(const Val& value) { - auto it = value_to_node_.find(value); - if (it == value_to_node_.end()) - return false; - - if (!IsInTree(it->second)) - return false; - - if (last_accessed_value_ == value) - last_accessed_value_valid_ = false; - - const uint32_t orphan = RemoveNode(it->second); - (void)orphan; - // The node of |value| is still alive but it's orphaned now. Can still be - // reused later. - assert(!IsInTree(orphan)); - assert(ValueOf(orphan) == value); - return true; -} - -template -bool MoveToFront::RankFromValue(const Val& value, uint32_t* rank) { - if (last_accessed_value_valid_ && last_accessed_value_ == value) { - *rank = 1; - return true; - } - - const uint32_t old_size = GetSize(); - if (old_size == 1) { - if (ValueOf(root_) == value) { - *rank = 1; - return true; - } else { - return false; - } - } - - const auto it = value_to_node_.find(value); - if (it == value_to_node_.end()) { - return false; - } - - uint32_t target = it->second; - - if (!IsInTree(target)) { - return false; - } - - uint32_t node = target; - *rank = 1 + SizeOf(LeftOf(node)); - while (node) { - if (IsRightChild(node)) - *rank += 1 + SizeOf(LeftOf(ParentOf(node))); - node = ParentOf(node); - } - - // Don't update timestamp if the node has rank 1. - if (*rank != 1) { - // Update timestamp and reposition the node. - target = RemoveNode(target); - assert(ValueOf(target) == value); - assert(old_size == GetSize() + 1); - MutableTimestampOf(target) = next_timestamp_++; - InsertNode(target); - assert(old_size == GetSize()); - } - - last_accessed_value_ = value; - last_accessed_value_valid_ = true; - return true; -} - -template -bool MoveToFront::HasValue(const Val& value) const { - const auto it = value_to_node_.find(value); - if (it == value_to_node_.end()) { - return false; - } - - return IsInTree(it->second); -} - -template -bool MoveToFront::Promote(const Val& value) { - if (last_accessed_value_valid_ && last_accessed_value_ == value) { - return true; - } - - const uint32_t old_size = GetSize(); - if (old_size == 1) - return ValueOf(root_) == value; - - const auto it = value_to_node_.find(value); - if (it == value_to_node_.end()) { - return false; - } - - uint32_t target = it->second; - - if (!IsInTree(target)) { - return false; - } - - // Update timestamp and reposition the node. - target = RemoveNode(target); - assert(ValueOf(target) == value); - assert(old_size == GetSize() + 1); - MutableTimestampOf(target) = next_timestamp_++; - InsertNode(target); - assert(old_size == GetSize()); - - last_accessed_value_ = value; - last_accessed_value_valid_ = true; - return true; -} - -template -bool MoveToFront::ValueFromRank(uint32_t rank, Val* value) { - if (last_accessed_value_valid_ && rank == 1) { - *value = last_accessed_value_; - return true; - } - - const uint32_t old_size = GetSize(); - if (rank <= 0 || rank > old_size) { - return false; - } - - if (old_size == 1) { - *value = ValueOf(root_); - return true; - } - - const bool update_timestamp = (rank != 1); - - uint32_t node = root_; - while (node) { - const uint32_t left_subtree_num_nodes = SizeOf(LeftOf(node)); - if (rank == left_subtree_num_nodes + 1) { - // This is the node we are looking for. - // Don't update timestamp if the node has rank 1. - if (update_timestamp) { - node = RemoveNode(node); - assert(old_size == GetSize() + 1); - MutableTimestampOf(node) = next_timestamp_++; - InsertNode(node); - assert(old_size == GetSize()); - } - *value = ValueOf(node); - last_accessed_value_ = *value; - last_accessed_value_valid_ = true; - return true; - } - - if (rank < left_subtree_num_nodes + 1) { - // Descend into the left subtree. The rank is still valid. - node = LeftOf(node); - } else { - // Descend into the right subtree. We leave behind the left subtree and - // the current node, adjust the |rank| accordingly. - rank -= left_subtree_num_nodes + 1; - node = RightOf(node); - } - } - - assert(0); - return false; -} - -template -void MoveToFront::InsertNode(uint32_t node) { - assert(!IsInTree(node)); - assert(SizeOf(node) == 1); - assert(HeightOf(node) == 1); - assert(TimestampOf(node)); - - if (!root_) { - root_ = node; - return; - } - - uint32_t iter = root_; - uint32_t parent = 0; - - // Will determine if |node| will become the right or left child after - // insertion (but before balancing). - bool right_child; - - // Find the node which will become |node|'s parent after insertion - // (but before balancing). - while (iter) { - parent = iter; - assert(TimestampOf(iter) != TimestampOf(node)); - right_child = TimestampOf(iter) > TimestampOf(node); - iter = right_child ? RightOf(iter) : LeftOf(iter); - } - - assert(parent); - - // Connect node and parent. - MutableParentOf(node) = parent; - if (right_child) - MutableRightOf(parent) = node; - else - MutableLeftOf(parent) = node; - - // Insertion is finished. Start the balancing process. - bool needs_rebalancing = true; - parent = ParentOf(node); - - while (parent) { - UpdateNode(parent); - - if (needs_rebalancing) { - const int parent_balance = BalanceOf(parent); - - if (RightOf(parent) == node) { - // Added node to the right subtree. - if (parent_balance > 1) { - // Parent is right heavy, rotate left. - if (BalanceOf(node) < 0) - RotateRight(node); - parent = RotateLeft(parent); - } else if (parent_balance == 0 || parent_balance == -1) { - // Parent is balanced or left heavy, no need to balance further. - needs_rebalancing = false; - } - } else { - // Added node to the left subtree. - if (parent_balance < -1) { - // Parent is left heavy, rotate right. - if (BalanceOf(node) > 0) - RotateLeft(node); - parent = RotateRight(parent); - } else if (parent_balance == 0 || parent_balance == 1) { - // Parent is balanced or right heavy, no need to balance further. - needs_rebalancing = false; - } - } - } - - assert(BalanceOf(parent) >= -1 && (BalanceOf(parent) <= 1)); - - node = parent; - parent = ParentOf(parent); - } -} - -template -uint32_t MoveToFront::RemoveNode(uint32_t node) { - if (LeftOf(node) && RightOf(node)) { - // If |node| has two children, then use another node as scapegoat and swap - // their contents. We pick the scapegoat on the side of the tree which has more nodes. - const uint32_t scapegoat = SizeOf(LeftOf(node)) >= SizeOf(RightOf(node)) ? - RightestDescendantOf(LeftOf(node)) : LeftestDescendantOf(RightOf(node)); - assert(scapegoat); - std::swap(MutableValueOf(node), MutableValueOf(scapegoat)); - std::swap(MutableTimestampOf(node), MutableTimestampOf(scapegoat)); - value_to_node_[ValueOf(node)] = node; - value_to_node_[ValueOf(scapegoat)] = scapegoat; - node = scapegoat; - } - - // |node| may have only one child at this point. - assert(!RightOf(node) || !LeftOf(node)); - - uint32_t parent = ParentOf(node); - uint32_t child = RightOf(node) ? RightOf(node) : LeftOf(node); - - // Orphan |node| and reconnect parent and child. - if (child) - MutableParentOf(child) = parent; - - if (parent) { - if (LeftOf(parent) == node) - MutableLeftOf(parent) = child; - else - MutableRightOf(parent) = child; - } - - MutableParentOf(node) = 0; - MutableLeftOf(node) = 0; - MutableRightOf(node) = 0; - UpdateNode(node); - const uint32_t orphan = node; - - if (root_ == node) - root_ = child; - - // Removal is finished. Start the balancing process. - bool needs_rebalancing = true; - node = child; - - while (parent) { - UpdateNode(parent); - - if (needs_rebalancing) { - const int parent_balance = BalanceOf(parent); - - if (parent_balance == 1 || parent_balance == -1) { - // The height of the subtree was not changed. - needs_rebalancing = false; - } else { - if (RightOf(parent) == node) { - // Removed node from the right subtree. - if (parent_balance < -1) { - // Parent is left heavy, rotate right. - const uint32_t sibling = LeftOf(parent); - if (BalanceOf(sibling) > 0) - RotateLeft(sibling); - parent = RotateRight(parent); - } - } else { - // Removed node from the left subtree. - if (parent_balance > 1) { - // Parent is right heavy, rotate left. - const uint32_t sibling = RightOf(parent); - if (BalanceOf(sibling) < 0) - RotateRight(sibling); - parent = RotateLeft(parent); - } - } - } - } - - assert(BalanceOf(parent) >= -1 && (BalanceOf(parent) <= 1)); - - node = parent; - parent = ParentOf(parent); - } - - return orphan; -} - -template -uint32_t MoveToFront::RotateLeft(const uint32_t node) { - const uint32_t pivot = RightOf(node); - assert(pivot); - - // LeftOf(pivot) gets attached to node in place of pivot. - MutableRightOf(node) = LeftOf(pivot); - if (RightOf(node)) - MutableParentOf(RightOf(node)) = node; - - // Pivot gets attached to ParentOf(node) in place of node. - MutableParentOf(pivot) = ParentOf(node); - if (!ParentOf(node)) - root_ = pivot; - else if (IsLeftChild(node)) - MutableLeftOf(ParentOf(node)) = pivot; - else - MutableRightOf(ParentOf(node)) = pivot; - - // Node is child of pivot. - MutableLeftOf(pivot) = node; - MutableParentOf(node) = pivot; - - // Update both node and pivot. Pivot is the new parent of node, so node should - // be updated first. - UpdateNode(node); - UpdateNode(pivot); - - return pivot; -} - -template -uint32_t MoveToFront::RotateRight(const uint32_t node) { - const uint32_t pivot = LeftOf(node); - assert(pivot); - - // RightOf(pivot) gets attached to node in place of pivot. - MutableLeftOf(node) = RightOf(pivot); - if (LeftOf(node)) - MutableParentOf(LeftOf(node)) = node; - - // Pivot gets attached to ParentOf(node) in place of node. - MutableParentOf(pivot) = ParentOf(node); - if (!ParentOf(node)) - root_ = pivot; - else if (IsLeftChild(node)) - MutableLeftOf(ParentOf(node)) = pivot; - else - MutableRightOf(ParentOf(node)) = pivot; - - // Node is child of pivot. - MutableRightOf(pivot) = node; - MutableParentOf(node) = pivot; - - // Update both node and pivot. Pivot is the new parent of node, so node should - // be updated first. - UpdateNode(node); - UpdateNode(pivot); - - return pivot; -} - -template -void MoveToFront::UpdateNode(uint32_t node) { - MutableSizeOf(node) = 1 + SizeOf(LeftOf(node)) + SizeOf(RightOf(node)); - MutableHeightOf(node) = - 1 + std::max(HeightOf(LeftOf(node)), HeightOf(RightOf(node))); -} - -} // namespace spvutils - -#endif // LIBSPIRV_UTIL_MOVE_TO_FRONT_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/parse_number.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/util/parse_number.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/parse_number.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/util/parse_number.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,214 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "util/parse_number.h" - -#include -#include -#include -#include -#include -#include - -#include "util/hex_float.h" - -namespace spvutils { - -namespace { -// A helper class that temporarily stores error messages and dump the messages -// to a string which given as as pointer when it is destructed. If the given -// pointer is a nullptr, this class does not store error message. -class ErrorMsgStream { - public: - explicit ErrorMsgStream(std::string* error_msg_sink) - : error_msg_sink_(error_msg_sink) { - if (error_msg_sink_) stream_.reset(new std::ostringstream()); - } - ~ErrorMsgStream() { - if (error_msg_sink_ && stream_) *error_msg_sink_ = stream_->str(); - } - template - ErrorMsgStream& operator<<(T val) { - if (stream_) *stream_ << val; - return *this; - } - - private: - std::unique_ptr stream_; - // The destination string to which this class dump the error message when - // destructor is called. - std::string* error_msg_sink_; -}; -} - -EncodeNumberStatus ParseAndEncodeIntegerNumber( - const char* text, const NumberType& type, - std::function emit, std::string* error_msg) { - if (!text) { - ErrorMsgStream(error_msg) << "The given text is a nullptr"; - return EncodeNumberStatus::kInvalidText; - } - - if (!IsIntegral(type)) { - ErrorMsgStream(error_msg) << "The expected type is not a integer type"; - return EncodeNumberStatus::kInvalidUsage; - } - - const uint32_t bit_width = AssumedBitWidth(type); - - if (bit_width > 64) { - ErrorMsgStream(error_msg) << "Unsupported " << bit_width - << "-bit integer literals"; - return EncodeNumberStatus::kUnsupported; - } - - // Either we are expecting anything or integer. - bool is_negative = text[0] == '-'; - bool can_be_signed = IsSigned(type); - - if (is_negative && !can_be_signed) { - ErrorMsgStream(error_msg) - << "Cannot put a negative number in an unsigned literal"; - return EncodeNumberStatus::kInvalidUsage; - } - - const bool is_hex = text[0] == '0' && (text[1] == 'x' || text[1] == 'X'); - - uint64_t decoded_bits; - if (is_negative) { - int64_t decoded_signed = 0; - - if (!ParseNumber(text, &decoded_signed)) { - ErrorMsgStream(error_msg) << "Invalid signed integer literal: " << text; - return EncodeNumberStatus::kInvalidText; - } - - if (!CheckRangeAndIfHexThenSignExtend(decoded_signed, type, is_hex, - &decoded_signed)) { - ErrorMsgStream(error_msg) - << "Integer " << (is_hex ? std::hex : std::dec) << std::showbase - << decoded_signed << " does not fit in a " << std::dec << bit_width - << "-bit " << (IsSigned(type) ? "signed" : "unsigned") << " integer"; - return EncodeNumberStatus::kInvalidText; - } - decoded_bits = decoded_signed; - } else { - // There's no leading minus sign, so parse it as an unsigned integer. - if (!ParseNumber(text, &decoded_bits)) { - ErrorMsgStream(error_msg) << "Invalid unsigned integer literal: " << text; - return EncodeNumberStatus::kInvalidText; - } - if (!CheckRangeAndIfHexThenSignExtend(decoded_bits, type, is_hex, - &decoded_bits)) { - ErrorMsgStream(error_msg) - << "Integer " << (is_hex ? std::hex : std::dec) << std::showbase - << decoded_bits << " does not fit in a " << std::dec << bit_width - << "-bit " << (IsSigned(type) ? "signed" : "unsigned") << " integer"; - return EncodeNumberStatus::kInvalidText; - } - } - if (bit_width > 32) { - uint32_t low = uint32_t(0x00000000ffffffff & decoded_bits); - uint32_t high = uint32_t((0xffffffff00000000 & decoded_bits) >> 32); - emit(low); - emit(high); - } else { - emit(uint32_t(decoded_bits)); - } - return EncodeNumberStatus::kSuccess; -} - -EncodeNumberStatus ParseAndEncodeFloatingPointNumber( - const char* text, const NumberType& type, - std::function emit, std::string* error_msg) { - if (!text) { - ErrorMsgStream(error_msg) << "The given text is a nullptr"; - return EncodeNumberStatus::kInvalidText; - } - - if (!IsFloating(type)) { - ErrorMsgStream(error_msg) << "The expected type is not a float type"; - return EncodeNumberStatus::kInvalidUsage; - } - - const auto bit_width = AssumedBitWidth(type); - switch (bit_width) { - case 16: { - HexFloat> hVal(0); - if (!ParseNumber(text, &hVal)) { - ErrorMsgStream(error_msg) << "Invalid 16-bit float literal: " << text; - return EncodeNumberStatus::kInvalidText; - } - // getAsFloat will return the spvutils::Float16 value, and get_value - // will return a uint16_t representing the bits of the float. - // The encoding is therefore correct from the perspective of the SPIR-V - // spec since the top 16 bits will be 0. - emit(static_cast(hVal.value().getAsFloat().get_value())); - return EncodeNumberStatus::kSuccess; - } break; - case 32: { - HexFloat> fVal(0.0f); - if (!ParseNumber(text, &fVal)) { - ErrorMsgStream(error_msg) << "Invalid 32-bit float literal: " << text; - return EncodeNumberStatus::kInvalidText; - } - emit(BitwiseCast(fVal)); - return EncodeNumberStatus::kSuccess; - } break; - case 64: { - HexFloat> dVal(0.0); - if (!ParseNumber(text, &dVal)) { - ErrorMsgStream(error_msg) << "Invalid 64-bit float literal: " << text; - return EncodeNumberStatus::kInvalidText; - } - uint64_t decoded_val = BitwiseCast(dVal); - uint32_t low = uint32_t(0x00000000ffffffff & decoded_val); - uint32_t high = uint32_t((0xffffffff00000000 & decoded_val) >> 32); - emit(low); - emit(high); - return EncodeNumberStatus::kSuccess; - } break; - default: - break; - } - ErrorMsgStream(error_msg) << "Unsupported " << bit_width - << "-bit float literals"; - return EncodeNumberStatus::kUnsupported; -} - -EncodeNumberStatus ParseAndEncodeNumber(const char* text, - const NumberType& type, - std::function emit, - std::string* error_msg) { - if (!text) { - ErrorMsgStream(error_msg) << "The given text is a nullptr"; - return EncodeNumberStatus::kInvalidText; - } - - if (IsUnknown(type)) { - ErrorMsgStream(error_msg) - << "The expected type is not a integer or float type"; - return EncodeNumberStatus::kInvalidUsage; - } - - // If we explicitly expect a floating-point number, we should handle that - // first. - if (IsFloating(type)) { - return ParseAndEncodeFloatingPointNumber(text, type, emit, error_msg); - } - - return ParseAndEncodeIntegerNumber(text, type, emit, error_msg); -} - -} // namespace spvutils diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/parse_number.h vulkan-1.1.73+dfsg/external/spirv-tools/source/util/parse_number.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/parse_number.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/util/parse_number.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,250 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_UTIL_PARSE_NUMBER_H_ -#define LIBSPIRV_UTIL_PARSE_NUMBER_H_ - -#include -#include -#include - -#include "spirv-tools/libspirv.h" -#include "util/hex_float.h" - -namespace spvutils { - -// A struct to hold the expected type information for the number in text to be -// parsed. -struct NumberType { - uint32_t bitwidth; - // SPV_NUMBER_NONE means the type is unknown and is invalid to be used with - // ParseAndEncode{|Integer|Floating}Number(). - spv_number_kind_t kind; -}; - -// Returns true if the type is a scalar integer type. -inline bool IsIntegral(const NumberType& type) { - return type.kind == SPV_NUMBER_UNSIGNED_INT || - type.kind == SPV_NUMBER_SIGNED_INT; -} - -// Returns true if the type is a scalar floating point type. -inline bool IsFloating(const NumberType& type) { - return type.kind == SPV_NUMBER_FLOATING; -} - -// Returns true if the type is a signed value. -inline bool IsSigned(const NumberType& type) { - return type.kind == SPV_NUMBER_FLOATING || type.kind == SPV_NUMBER_SIGNED_INT; -} - -// Returns true if the type is unknown. -inline bool IsUnknown(const NumberType& type) { - return type.kind == SPV_NUMBER_NONE; -} - -// Returns the number of bits in the type. This is only valid for integer and -// floating types. -inline int AssumedBitWidth(const NumberType& type) { - switch (type.kind) { - case SPV_NUMBER_SIGNED_INT: - case SPV_NUMBER_UNSIGNED_INT: - case SPV_NUMBER_FLOATING: - return type.bitwidth; - default: - break; - } - // We don't care about this case. - return 0; -} - -// A templated class with a static member function Clamp, where Clamp sets a -// referenced value of type T to 0 if T is an unsigned integer type, and -// returns true if it modified the referenced value. -template -class ClampToZeroIfUnsignedType { - public: - // The default specialization does not clamp the value. - static bool Clamp(T*) { return false; } -}; - -// The specialization of ClampToZeroIfUnsignedType for unsigned integer types. -template -class ClampToZeroIfUnsignedType< - T, typename std::enable_if::value>::type> { - public: - static bool Clamp(T* value_pointer) { - if (*value_pointer) { - *value_pointer = 0; - return true; - } - return false; - } -}; - -// Returns true if the given value fits within the target scalar integral type. -// The target type may have an unusual bit width. If the value was originally -// specified as a hexadecimal number, then the overflow bits should be zero. -// If it was hex and the target type is signed, then return the sign-extended -// value through the updated_value_for_hex pointer argument. On failure, -// returns false. -template -bool CheckRangeAndIfHexThenSignExtend(T value, const NumberType& type, - bool is_hex, T* updated_value_for_hex) { - // The encoded result has three regions of bits that are of interest, from - // least to most significant: - // - magnitude bits, where the magnitude of the number would be stored if - // we were using a signed-magnitude representation. - // - an optional sign bit - // - overflow bits, up to bit 63 of a 64-bit number - // For example: - // Type Overflow Sign Magnitude - // --------------- -------- ---- --------- - // unsigned 8 bit 8-63 n/a 0-7 - // signed 8 bit 8-63 7 0-6 - // unsigned 16 bit 16-63 n/a 0-15 - // signed 16 bit 16-63 15 0-14 - - // We'll use masks to define the three regions. - // At first we'll assume the number is unsigned. - const uint32_t bit_width = AssumedBitWidth(type); - uint64_t magnitude_mask = - (bit_width == 64) ? -1 : ((uint64_t(1) << bit_width) - 1); - uint64_t sign_mask = 0; - uint64_t overflow_mask = ~magnitude_mask; - - if (value < 0 || IsSigned(type)) { - // Accommodate the sign bit. - magnitude_mask >>= 1; - sign_mask = magnitude_mask + 1; - } - - bool failed = false; - if (value < 0) { - // The top bits must all be 1 for a negative signed value. - failed = ((value & overflow_mask) != overflow_mask) || - ((value & sign_mask) != sign_mask); - } else { - if (is_hex) { - // Hex values are a bit special. They decode as unsigned values, but may - // represent a negative number. In this case, the overflow bits should - // be zero. - failed = (value & overflow_mask) != 0; - } else { - const uint64_t value_as_u64 = static_cast(value); - // Check overflow in the ordinary case. - failed = (value_as_u64 & magnitude_mask) != value_as_u64; - } - } - - if (failed) { - return false; - } - - // Sign extend hex the number. - if (is_hex && (value & sign_mask)) - *updated_value_for_hex = (value | overflow_mask); - - return true; -} - -// Parses a numeric value of a given type from the given text. The number -// should take up the entire string, and should be within bounds for the target -// type. On success, returns true and populates the object referenced by -// value_pointer. On failure, returns false. -template -bool ParseNumber(const char* text, T* value_pointer) { - // C++11 doesn't define std::istringstream(int8_t&), so calling this method - // with a single-byte type leads to implementation-defined behaviour. - // Similarly for uint8_t. - static_assert(sizeof(T) > 1, - "Single-byte types are not supported in this parse method"); - - if (!text) return false; - std::istringstream text_stream(text); - // Allow both decimal and hex input for integers. - // It also allows octal input, but we don't care about that case. - text_stream >> std::setbase(0); - text_stream >> *value_pointer; - - // We should have read something. - bool ok = (text[0] != 0) && !text_stream.bad(); - // It should have been all the text. - ok = ok && text_stream.eof(); - // It should have been in range. - ok = ok && !text_stream.fail(); - - // Work around a bug in the GNU C++11 library. It will happily parse - // "-1" for uint16_t as 65535. - if (ok && text[0] == '-') - ok = !ClampToZeroIfUnsignedType::Clamp(value_pointer); - - return ok; -} - -// Enum to indicate the parsing and encoding status. -enum class EncodeNumberStatus { - kSuccess = 0, - // Unsupported bit width etc. - kUnsupported, - // Expected type (NumberType) is not a scalar int or float, or putting a - // negative number in an unsigned literal. - kInvalidUsage, - // Number value does not fit the bit width of the expected type etc. - kInvalidText, -}; - -// Parses an integer value of a given |type| from the given |text| and encodes -// the number by the given |emit| function. On success, returns -// EncodeNumberStatus::kSuccess and the parsed number will be consumed by the -// given |emit| function word by word (least significant word first). On -// failure, this function returns the error code of the encoding status and -// |emit| function will not be called. If the string pointer |error_msg| is not -// a nullptr, it will be overwritten with error messages in case of failure. In -// case of success, |error_msg| will not be touched. Integers up to 64 bits are -// supported. -EncodeNumberStatus ParseAndEncodeIntegerNumber( - const char* text, const NumberType& type, - std::function emit, std::string* error_msg); - -// Parses a floating point value of a given |type| from the given |text| and -// encodes the number by the given |emit| funciton. On success, returns -// EncodeNumberStatus::kSuccess and the parsed number will be consumed by the -// given |emit| function word by word (least significant word first). On -// failure, this function returns the error code of the encoding status and -// |emit| function will not be called. If the string pointer |error_msg| is not -// a nullptr, it will be overwritten with error messages in case of failure. In -// case of success, |error_msg| will not be touched. Only 16, 32 and 64 bit -// floating point numbers are supported. -EncodeNumberStatus ParseAndEncodeFloatingPointNumber( - const char* text, const NumberType& type, - std::function emit, std::string* error_msg); - -// Parses an integer or floating point number of a given |type| from the given -// |text| and encodes the number by the given |emit| function. On success, -// returns EncodeNumberStatus::kSuccess and the parsed number will be consumed -// by the given |emit| function word by word (least significant word first). On -// failure, this function returns the error code of the encoding status and -// |emit| function will not be called. If the string pointer |error_msg| is not -// a nullptr, it will be overwritten with error messages in case of failure. In -// case of success, |error_msg| will not be touched. Integers up to 64 bits -// and 16/32/64 bit floating point values are supported. -EncodeNumberStatus ParseAndEncodeNumber(const char* text, - const NumberType& type, - std::function emit, - std::string* error_msg); - -} // namespace spvutils - -#endif // LIBSPIRV_UTIL_PARSE_NUMBER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/string_utils.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/util/string_utils.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/string_utils.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/util/string_utils.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include -#include -#include - -#include "util/string_utils.h" - -namespace spvutils { - -std::string CardinalToOrdinal(size_t cardinal) { - const size_t mod10 = cardinal % 10; - const size_t mod100 = cardinal % 100; - std::string suffix; - if (mod10 == 1 && mod100 != 11) - suffix = "st"; - else if (mod10 == 2 && mod100 != 12) - suffix = "nd"; - else if (mod10 == 3 && mod100 != 13) - suffix = "rd"; - else - suffix = "th"; - - return ToString(cardinal) + suffix; -} - -} // namespace spvutils diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/string_utils.h vulkan-1.1.73+dfsg/external/spirv-tools/source/util/string_utils.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/util/string_utils.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/util/string_utils.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_UTIL_STRING_UTILS_H_ -#define LIBSPIRV_UTIL_STRING_UTILS_H_ - -#include -#include - -#include "util/string_utils.h" - -namespace spvutils { - -// Converts arithmetic value |val| to its default string representation. -template -std::string ToString(T val) { - static_assert(std::is_arithmetic::value, - "spvutils::ToString is restricted to only arithmetic values"); - std::stringstream os; - os << val; - return os.str(); -} - -// Converts cardinal number to ordinal number string. -std::string CardinalToOrdinal(size_t cardinal); - -} // namespace spvutils - -#endif // LIBSPIRV_UTIL_STRING_UTILS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/basic_block.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/val/basic_block.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/basic_block.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/val/basic_block.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,145 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "val/basic_block.h" - -#include -#include -#include - -using std::vector; - -namespace libspirv { - -BasicBlock::BasicBlock(uint32_t label_id) - : id_(label_id), - immediate_dominator_(nullptr), - immediate_post_dominator_(nullptr), - predecessors_(), - successors_(), - type_(0), - reachable_(false) {} - -void BasicBlock::SetImmediateDominator(BasicBlock* dom_block) { - immediate_dominator_ = dom_block; -} - -void BasicBlock::SetImmediatePostDominator(BasicBlock* pdom_block) { - immediate_post_dominator_ = pdom_block; -} - -const BasicBlock* BasicBlock::immediate_dominator() const { - return immediate_dominator_; -} - -const BasicBlock* BasicBlock::immediate_post_dominator() const { - return immediate_post_dominator_; -} - -BasicBlock* BasicBlock::immediate_dominator() { return immediate_dominator_; } -BasicBlock* BasicBlock::immediate_post_dominator() { - return immediate_post_dominator_; -} - -void BasicBlock::RegisterSuccessors(const vector& next_blocks) { - for (auto& block : next_blocks) { - block->predecessors_.push_back(this); - successors_.push_back(block); - if (block->reachable_ == false) block->set_reachable(reachable_); - } -} - -void BasicBlock::RegisterBranchInstruction(SpvOp branch_instruction) { - if (branch_instruction == SpvOpUnreachable) reachable_ = false; - return; -} - -bool BasicBlock::dominates(const BasicBlock& other) const { - return (this == &other) || - !(other.dom_end() == - std::find(other.dom_begin(), other.dom_end(), this)); -} - -bool BasicBlock::postdominates(const BasicBlock& other) const { - return (this == &other) || - !(other.pdom_end() == - std::find(other.pdom_begin(), other.pdom_end(), this)); -} - -BasicBlock::DominatorIterator::DominatorIterator() : current_(nullptr) {} - -BasicBlock::DominatorIterator::DominatorIterator( - const BasicBlock* block, - std::function dominator_func) - : current_(block), dom_func_(dominator_func) {} - -BasicBlock::DominatorIterator& BasicBlock::DominatorIterator::operator++() { - if (current_ == dom_func_(current_)) { - current_ = nullptr; - } else { - current_ = dom_func_(current_); - } - return *this; -} - -const BasicBlock::DominatorIterator BasicBlock::dom_begin() const { - return DominatorIterator( - this, [](const BasicBlock* b) { return b->immediate_dominator(); }); -} - -BasicBlock::DominatorIterator BasicBlock::dom_begin() { - return DominatorIterator( - this, [](const BasicBlock* b) { return b->immediate_dominator(); }); -} - -const BasicBlock::DominatorIterator BasicBlock::dom_end() const { - return DominatorIterator(); -} - -BasicBlock::DominatorIterator BasicBlock::dom_end() { - return DominatorIterator(); -} - -const BasicBlock::DominatorIterator BasicBlock::pdom_begin() const { - return DominatorIterator( - this, [](const BasicBlock* b) { return b->immediate_post_dominator(); }); -} - -BasicBlock::DominatorIterator BasicBlock::pdom_begin() { - return DominatorIterator( - this, [](const BasicBlock* b) { return b->immediate_post_dominator(); }); -} - -const BasicBlock::DominatorIterator BasicBlock::pdom_end() const { - return DominatorIterator(); -} - -BasicBlock::DominatorIterator BasicBlock::pdom_end() { - return DominatorIterator(); -} - -bool operator==(const BasicBlock::DominatorIterator& lhs, - const BasicBlock::DominatorIterator& rhs) { - return lhs.current_ == rhs.current_; -} - -bool operator!=(const BasicBlock::DominatorIterator& lhs, - const BasicBlock::DominatorIterator& rhs) { - return !(lhs == rhs); -} - -const BasicBlock*& BasicBlock::DominatorIterator::operator*() { - return current_; -} -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/basic_block.h vulkan-1.1.73+dfsg/external/spirv-tools/source/val/basic_block.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/basic_block.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/val/basic_block.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,225 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_VAL_BASICBLOCK_H_ -#define LIBSPIRV_VAL_BASICBLOCK_H_ - -#include "spirv/1.2/spirv.h" - -#include - -#include -#include -#include -#include - -namespace libspirv { - -enum BlockType : uint32_t { - kBlockTypeUndefined, - kBlockTypeHeader, - kBlockTypeLoop, - kBlockTypeMerge, - kBlockTypeBreak, - kBlockTypeContinue, - kBlockTypeReturn, - kBlockTypeCOUNT ///< Total number of block types. (must be the last element) -}; - -// This class represents a basic block in a SPIR-V module -class BasicBlock { - public: - /// Constructor for a BasicBlock - /// - /// @param[in] id The ID of the basic block - explicit BasicBlock(uint32_t id); - - /// Returns the id of the BasicBlock - uint32_t id() const { return id_; } - - /// Returns the predecessors of the BasicBlock - const std::vector* predecessors() const { - return &predecessors_; - } - - /// Returns the predecessors of the BasicBlock - std::vector* predecessors() { return &predecessors_; } - - /// Returns the successors of the BasicBlock - const std::vector* successors() const { return &successors_; } - - /// Returns the successors of the BasicBlock - std::vector* successors() { return &successors_; } - - /// Returns true if the block is reachable in the CFG - bool reachable() const { return reachable_; } - - /// Returns true if BasicBlock is of the given type - bool is_type(BlockType type) const { - if (type == kBlockTypeUndefined) return type_.none(); - return type_.test(type); - } - - /// Sets the reachability of the basic block in the CFG - void set_reachable(bool reachability) { reachable_ = reachability; } - - /// Sets the type of the BasicBlock - void set_type(BlockType type) { - if (type == kBlockTypeUndefined) - type_.reset(); - else - type_.set(type); - } - - /// Sets the immedate dominator of this basic block - /// - /// @param[in] dom_block The dominator block - void SetImmediateDominator(BasicBlock* dom_block); - - /// Sets the immedate post dominator of this basic block - /// - /// @param[in] pdom_block The post dominator block - void SetImmediatePostDominator(BasicBlock* pdom_block); - - /// Returns the immedate dominator of this basic block - BasicBlock* immediate_dominator(); - - /// Returns the immedate dominator of this basic block - const BasicBlock* immediate_dominator() const; - - /// Returns the immedate post dominator of this basic block - BasicBlock* immediate_post_dominator(); - - /// Returns the immedate post dominator of this basic block - const BasicBlock* immediate_post_dominator() const; - - /// Ends the block without a successor - void RegisterBranchInstruction(SpvOp branch_instruction); - - /// Adds @p next BasicBlocks as successors of this BasicBlock - void RegisterSuccessors(const std::vector& next = std::vector()); - - /// Returns true if the id of the BasicBlock matches - bool operator==(const BasicBlock& other) const { return other.id_ == id_; } - - /// Returns true if the id of the BasicBlock matches - bool operator==(const uint32_t& other_id) const { return other_id == id_; } - - /// Returns true if this block dominates the other block. - /// Assumes dominators have been computed. - bool dominates(const BasicBlock& other) const; - - /// Returns true if this block postdominates the other block. - /// Assumes dominators have been computed. - bool postdominates(const BasicBlock& other) const; - - /// @brief A BasicBlock dominator iterator class - /// - /// This iterator will iterate over the (post)dominators of the block - class DominatorIterator - : public std::iterator { - public: - /// @brief Constructs the end of dominator iterator - /// - /// This will create an iterator which will represent the element - /// before the root node of the dominator tree - DominatorIterator(); - - /// @brief Constructs an iterator for the given block which points to - /// @p block - /// - /// @param block The block which is referenced by the iterator - /// @param dominator_func This function will be called to get the immediate - /// (post)dominator of the current block - DominatorIterator( - const BasicBlock* block, - std::function dominator_func); - - /// @brief Advances the iterator - DominatorIterator& operator++(); - - /// @brief Returns the current element - const BasicBlock*& operator*(); - - friend bool operator==(const DominatorIterator& lhs, - const DominatorIterator& rhs); - - private: - const BasicBlock* current_; - std::function dom_func_; - }; - - /// Returns a dominator iterator which points to the current block - const DominatorIterator dom_begin() const; - - /// Returns a dominator iterator which points to the current block - DominatorIterator dom_begin(); - - /// Returns a dominator iterator which points to one element past the first - /// block - const DominatorIterator dom_end() const; - - /// Returns a dominator iterator which points to one element past the first - /// block - DominatorIterator dom_end(); - - /// Returns a post dominator iterator which points to the current block - const DominatorIterator pdom_begin() const; - /// Returns a post dominator iterator which points to the current block - DominatorIterator pdom_begin(); - - /// Returns a post dominator iterator which points to one element past the - /// last block - const DominatorIterator pdom_end() const; - - /// Returns a post dominator iterator which points to one element past the - /// last block - DominatorIterator pdom_end(); - - private: - /// Id of the BasicBlock - const uint32_t id_; - - /// Pointer to the immediate dominator of the BasicBlock - BasicBlock* immediate_dominator_; - - /// Pointer to the immediate dominator of the BasicBlock - BasicBlock* immediate_post_dominator_; - - /// The set of predecessors of the BasicBlock - std::vector predecessors_; - - /// The set of successors of the BasicBlock - std::vector successors_; - - /// The type of the block - std::bitset type_; - - /// True if the block is reachable in the CFG - bool reachable_; -}; - -/// @brief Returns true if the iterators point to the same element or if both -/// iterators point to the @p dom_end block -bool operator==(const BasicBlock::DominatorIterator& lhs, - const BasicBlock::DominatorIterator& rhs); - -/// @brief Returns true if the iterators point to different elements and they -/// do not both point to the @p dom_end block -bool operator!=(const BasicBlock::DominatorIterator& lhs, - const BasicBlock::DominatorIterator& rhs); - -} /// namespace libspirv - -#endif /// LIBSPIRV_VAL_BASICBLOCK_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/construct.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/val/construct.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/construct.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/val/construct.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "val/construct.h" - -#include -#include - -namespace libspirv { - -Construct::Construct(ConstructType construct_type, - BasicBlock* entry, BasicBlock* exit, - std::vector constructs) - : type_(construct_type), - corresponding_constructs_(constructs), - entry_block_(entry), - exit_block_(exit) {} - -ConstructType Construct::type() const { return type_; } - -const std::vector& Construct::corresponding_constructs() const { - return corresponding_constructs_; -} -std::vector& Construct::corresponding_constructs() { - return corresponding_constructs_; -} - -bool ValidateConstructSize(ConstructType type, size_t size) { - switch (type) { - case ConstructType::kSelection: return size == 0; - case ConstructType::kContinue: return size == 1; - case ConstructType::kLoop: return size == 1; - case ConstructType::kCase: return size >= 1; - default: assert(1 == 0 && "Type not defined"); - } - return false; -} - -void Construct::set_corresponding_constructs( - std::vector constructs) { - assert(ValidateConstructSize(type_, constructs.size())); - corresponding_constructs_ = constructs; -} - -const BasicBlock* Construct::entry_block() const { return entry_block_; } -BasicBlock* Construct::entry_block() { return entry_block_; } - -const BasicBlock* Construct::exit_block() const { return exit_block_; } -BasicBlock* Construct::exit_block() { return exit_block_; } - -void Construct::set_exit(BasicBlock* block) { exit_block_ = block; } -} /// namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/construct.h vulkan-1.1.73+dfsg/external/spirv-tools/source/val/construct.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/construct.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/val/construct.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,132 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_VAL_CONSTRUCT_H_ -#define LIBSPIRV_VAL_CONSTRUCT_H_ - -#include -#include - -namespace libspirv { - -enum class ConstructType : int { - kNone = 0, - /// The set of blocks dominated by a selection header, minus the set of blocks - /// dominated by the header's merge block - kSelection, - /// The set of blocks dominated by an OpLoopMerge's Continue Target and post - /// dominated by the corresponding back - kContinue, - /// The set of blocks dominated by a loop header, minus the set of blocks - /// dominated by the loop's merge block, minus the loop's corresponding - /// continue construct - kLoop, - /// The set of blocks dominated by an OpSwitch's Target or Default, minus the - /// set of blocks dominated by the OpSwitch's merge block (this construct is - /// only defined for those OpSwitch Target or Default that are not equal to - /// the OpSwitch's corresponding merge block) - kCase -}; - -class BasicBlock; - -/// @brief This class tracks the CFG constructs as defined in the SPIR-V spec -class Construct { - public: - Construct(ConstructType type, BasicBlock* dominator, - BasicBlock* exit = nullptr, - std::vector constructs = std::vector()); - - /// Returns the type of the construct - ConstructType type() const; - - const std::vector& corresponding_constructs() const; - std::vector& corresponding_constructs(); - void set_corresponding_constructs(std::vector constructs); - - /// Returns the dominator block of the construct. - /// - /// This is usually the header block or the first block of the construct. - const BasicBlock* entry_block() const; - - /// Returns the dominator block of the construct. - /// - /// This is usually the header block or the first block of the construct. - BasicBlock* entry_block(); - - /// Returns the exit block of the construct. - /// - /// For a continue construct it is the backedge block of the corresponding - /// loop construct. For the case construct it is the block that branches to - /// the OpSwitch merge block or other case blocks. Otherwise it is the merge - /// block of the corresponding header block - const BasicBlock* exit_block() const; - - /// Returns the exit block of the construct. - /// - /// For a continue construct it is the backedge block of the corresponding - /// loop construct. For the case construct it is the block that branches to - /// the OpSwitch merge block or other case blocks. Otherwise it is the merge - /// block of the corresponding header block - BasicBlock* exit_block(); - - /// Sets the exit block for this construct. This is useful for continue - /// constructs which do not know the back-edge block during construction - void set_exit(BasicBlock* exit_block); - - // Returns whether the exit block of this construct is the merge block - // for an OpLoopMerge or OpSelectionMerge - bool ExitBlockIsMergeBlock() const { - return type_ == ConstructType::kLoop || type_ == ConstructType::kSelection; - } - - private: - /// The type of the construct - ConstructType type_; - - /// These are the constructs that are related to this construct. These - /// constructs can be the continue construct, for the corresponding loop - /// construct, the case construct that are part of the same OpSwitch - /// instruction - /// - /// Here is a table that describes what constructs are included in - /// @p corresponding_constructs_ - /// | this construct | corresponding construct | - /// |----------------|----------------------------------| - /// | loop | continue | - /// | continue | loop | - /// | case | other cases in the same OpSwitch | - /// - /// kContinue and kLoop constructs will always have corresponding - /// constructs even if they are represented by the same block - std::vector corresponding_constructs_; - - /// @brief Dominator block for the construct - /// - /// The dominator block for the construct. Depending on the construct this may - /// be a selection header, a continue target of a loop, a loop header or a - /// Target or Default block of a switch - BasicBlock* entry_block_; - - /// @brief Exiting block for the construct - /// - /// The exit block for the construct. This can be a merge block for the loop - /// and selection constructs, a back-edge block for a continue construct, or - /// the branching block for the case construct - BasicBlock* exit_block_; -}; - -} /// namespace libspirv - -#endif /// LIBSPIRV_VAL_CONSTRUCT_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/decoration.h vulkan-1.1.73+dfsg/external/spirv-tools/source/val/decoration.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/decoration.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/val/decoration.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_VAL_DECORATION_H_ -#define LIBSPIRV_VAL_DECORATION_H_ - -#include -#include - -namespace libspirv { - -// An object of this class represents a specific decoration including its -// parameters (if any). Decorations are used by OpDecorate and OpMemberDecorate, -// and they describe certain properties that can be assigned to one or several -// s. -// -// A Decoration object contains the decoration type (an enum), associated -// literal parameters, and struct member index. If the decoration does not apply -// to a struct member, then the index is kInvalidIndex. A Decoration object does -// not store the target Id, i.e. the Id to which it applies. It is -// possible for the same decoration to be applied to several s (and they -// might be assigned using separate SPIR-V instructions, possibly using an -// assignment through GroupDecorate). -// -// Example 1: Decoration for an object with no parameters: -// OpDecorate %obj Flat -// dec_type_ = SpvDecorationFlat -// params_ = empty vector -// struct_member_index_ = kInvalidMember -// -// Example 2: Decoration for an object with two parameters: -// OpDecorate %obj LinkageAttributes "link" Import -// dec_type_ = SpvDecorationLinkageAttributes -// params_ = vector { link, Import } -// struct_member_index_ = kInvalidMember -// -// Example 3: Decoration for a member of a structure with one parameter: -// OpMemberDecorate %struct 2 Offset 2 -// dec_type_ = SpvDecorationOffset -// params_ = vector { 2 } -// struct_member_index_ = 2 -// -class Decoration { - public: - enum { kInvalidMember = -1 }; - Decoration(SpvDecoration t, - const std::vector& parameters = std::vector(), - uint32_t member_index = kInvalidMember) - : dec_type_(t), params_(parameters), struct_member_index_(member_index) {} - - void set_struct_member_index(uint32_t index) { struct_member_index_ = index; } - int struct_member_index() { return struct_member_index_; } - int struct_member_index() const { return struct_member_index_; } - SpvDecoration dec_type() { return dec_type_; } - SpvDecoration dec_type() const { return dec_type_; } - std::vector& params() { return params_; } - const std::vector& params() const { return params_; } - - inline bool operator==(const Decoration& rhs) const { - return (dec_type_ == rhs.dec_type_ && params_ == rhs.params_ && - struct_member_index_ == rhs.struct_member_index_); - } - - private: - SpvDecoration dec_type_; - std::vector params_; - - // If the decoration applies to a member of a structure type, then the index - // of the member is stored here. Otherwise, this is kInvalidIndex. - int struct_member_index_; -}; - -} // namespace libspirv - -#endif /// LIBSPIRV_VAL_DECORATION_H_ - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/function.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/val/function.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/function.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/val/function.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,355 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "val/function.h" - -#include - -#include -#include -#include -#include - -#include "val/basic_block.h" -#include "val/construct.h" -#include "validate.h" -#include "cfa.h" - -using std::ignore; -using std::list; -using std::make_pair; -using std::pair; -using std::tie; -using std::vector; - -namespace libspirv { - -// Universal Limit of ResultID + 1 -static const uint32_t kInvalidId = 0x400000; - -Function::Function(uint32_t function_id, uint32_t result_type_id, - SpvFunctionControlMask function_control, - uint32_t function_type_id) - : id_(function_id), - function_type_id_(function_type_id), - result_type_id_(result_type_id), - function_control_(function_control), - declaration_type_(FunctionDecl::kFunctionDeclUnknown), - end_has_been_registered_(false), - blocks_(), - current_block_(nullptr), - pseudo_entry_block_(0), - pseudo_exit_block_(kInvalidId), - cfg_constructs_(), - variable_ids_(), - parameter_ids_() {} - -bool Function::IsFirstBlock(uint32_t block_id) const { - return !ordered_blocks_.empty() && *first_block() == block_id; -} - -spv_result_t Function::RegisterFunctionParameter(uint32_t parameter_id, - uint32_t type_id) { - assert(current_block_ == nullptr && - "RegisterFunctionParameter can only be called when parsing the binary " - "ouside of a block"); - // TODO(umar): Validate function parameter type order and count - // TODO(umar): Use these variables to validate parameter type - (void)parameter_id; - (void)type_id; - return SPV_SUCCESS; -} - -spv_result_t Function::RegisterLoopMerge(uint32_t merge_id, - uint32_t continue_id) { - RegisterBlock(merge_id, false); - RegisterBlock(continue_id, false); - BasicBlock& merge_block = blocks_.at(merge_id); - BasicBlock& continue_target_block = blocks_.at(continue_id); - assert(current_block_ && - "RegisterLoopMerge must be called when called within a block"); - - current_block_->set_type(kBlockTypeLoop); - merge_block.set_type(kBlockTypeMerge); - continue_target_block.set_type(kBlockTypeContinue); - Construct& loop_construct = - AddConstruct({ConstructType::kLoop, current_block_, &merge_block}); - Construct& continue_construct = - AddConstruct({ConstructType::kContinue, &continue_target_block}); - - continue_construct.set_corresponding_constructs({&loop_construct}); - loop_construct.set_corresponding_constructs({&continue_construct}); - merge_block_header_[&merge_block] = current_block_; - - return SPV_SUCCESS; -} - -spv_result_t Function::RegisterSelectionMerge(uint32_t merge_id) { - RegisterBlock(merge_id, false); - BasicBlock& merge_block = blocks_.at(merge_id); - current_block_->set_type(kBlockTypeHeader); - merge_block.set_type(kBlockTypeMerge); - merge_block_header_[&merge_block] = current_block_; - - AddConstruct({ConstructType::kSelection, current_block(), &merge_block}); - - return SPV_SUCCESS; -} - -spv_result_t Function::RegisterSetFunctionDeclType(FunctionDecl type) { - assert(declaration_type_ == FunctionDecl::kFunctionDeclUnknown); - declaration_type_ = type; - return SPV_SUCCESS; -} - -spv_result_t Function::RegisterBlock(uint32_t block_id, bool is_definition) { - assert( - declaration_type_ == FunctionDecl::kFunctionDeclDefinition && - "RegisterBlocks can only be called after declaration_type_ is defined"); - - std::unordered_map::iterator inserted_block; - bool success = false; - tie(inserted_block, success) = - blocks_.insert({block_id, BasicBlock(block_id)}); - if (is_definition) { // new block definition - assert(current_block_ == nullptr && - "Register Block can only be called when parsing a binary outside of " - "a BasicBlock"); - - undefined_blocks_.erase(block_id); - current_block_ = &inserted_block->second; - ordered_blocks_.push_back(current_block_); - if (IsFirstBlock(block_id)) current_block_->set_reachable(true); - } else if (success) { // Block doesn't exsist but this is not a definition - undefined_blocks_.insert(block_id); - } - - return SPV_SUCCESS; -} - -void Function::RegisterBlockEnd(vector next_list, - SpvOp branch_instruction) { - assert( - current_block_ && - "RegisterBlockEnd can only be called when parsing a binary in a block"); - vector next_blocks; - next_blocks.reserve(next_list.size()); - - std::unordered_map::iterator inserted_block; - bool success; - for (uint32_t successor_id : next_list) { - tie(inserted_block, success) = - blocks_.insert({successor_id, BasicBlock(successor_id)}); - if (success) { - undefined_blocks_.insert(successor_id); - } - next_blocks.push_back(&inserted_block->second); - } - - if (current_block_->is_type(kBlockTypeLoop)) { - // For each loop header, record the set of its successors, and include - // its continue target if the continue target is not the loop header - // itself. - std::vector& next_blocks_plus_continue_target = - loop_header_successors_plus_continue_target_map_[current_block_]; - next_blocks_plus_continue_target = next_blocks; - auto continue_target = - FindConstructForEntryBlock(current_block_, ConstructType::kLoop) - .corresponding_constructs() - .back() - ->entry_block(); - if (continue_target != current_block_) { - next_blocks_plus_continue_target.push_back(continue_target); - } - } - - current_block_->RegisterBranchInstruction(branch_instruction); - current_block_->RegisterSuccessors(next_blocks); - current_block_ = nullptr; - return; -} - -void Function::RegisterFunctionEnd() { - if (!end_has_been_registered_) { - end_has_been_registered_ = true; - - ComputeAugmentedCFG(); - } -} - -size_t Function::block_count() const { return blocks_.size(); } - -size_t Function::undefined_block_count() const { - return undefined_blocks_.size(); -} - -const vector& Function::ordered_blocks() const { - return ordered_blocks_; -} -vector& Function::ordered_blocks() { return ordered_blocks_; } - -const BasicBlock* Function::current_block() const { return current_block_; } -BasicBlock* Function::current_block() { return current_block_; } - -const list& Function::constructs() const { return cfg_constructs_; } -list& Function::constructs() { return cfg_constructs_; } - -const BasicBlock* Function::first_block() const { - if (ordered_blocks_.empty()) return nullptr; - return ordered_blocks_[0]; -} -BasicBlock* Function::first_block() { - if (ordered_blocks_.empty()) return nullptr; - return ordered_blocks_[0]; -} - -bool Function::IsBlockType(uint32_t merge_block_id, BlockType type) const { - bool ret = false; - const BasicBlock* block; - tie(block, ignore) = GetBlock(merge_block_id); - if (block) { - ret = block->is_type(type); - } - return ret; -} - -pair Function::GetBlock(uint32_t block_id) const { - const auto b = blocks_.find(block_id); - if (b != end(blocks_)) { - const BasicBlock* block = &(b->second); - bool defined = - undefined_blocks_.find(block->id()) == end(undefined_blocks_); - return make_pair(block, defined); - } else { - return make_pair(nullptr, false); - } -} - -pair Function::GetBlock(uint32_t block_id) { - const BasicBlock* out; - bool defined; - tie(out, defined) = const_cast(this)->GetBlock(block_id); - return make_pair(const_cast(out), defined); -} - -Function::GetBlocksFunction Function::AugmentedCFGSuccessorsFunction() const { - return [this](const BasicBlock* block) { - auto where = augmented_successors_map_.find(block); - return where == augmented_successors_map_.end() ? block->successors() - : &(*where).second; - }; -} - -Function::GetBlocksFunction -Function::AugmentedCFGSuccessorsFunctionIncludingHeaderToContinueEdge() const { - return [this](const BasicBlock* block) { - auto where = loop_header_successors_plus_continue_target_map_.find(block); - return where == loop_header_successors_plus_continue_target_map_.end() - ? AugmentedCFGSuccessorsFunction()(block) - : &(*where).second; - }; -} - -Function::GetBlocksFunction Function::AugmentedCFGPredecessorsFunction() const { - return [this](const BasicBlock* block) { - auto where = augmented_predecessors_map_.find(block); - return where == augmented_predecessors_map_.end() ? block->predecessors() - : &(*where).second; - }; -} - -void Function::ComputeAugmentedCFG() { - // Compute the successors of the pseudo-entry block, and - // the predecessors of the pseudo exit block. - auto succ_func = [](const BasicBlock* b) { return b->successors(); }; - auto pred_func = [](const BasicBlock* b) { return b->predecessors(); }; - spvtools::CFA::ComputeAugmentedCFG( - ordered_blocks_, - &pseudo_entry_block_, - &pseudo_exit_block_, - &augmented_successors_map_, - &augmented_predecessors_map_, - succ_func, - pred_func); -}; - -Construct& Function::AddConstruct(const Construct& new_construct) { - cfg_constructs_.push_back(new_construct); - auto& result = cfg_constructs_.back(); - entry_block_to_construct_[std::make_pair(new_construct.entry_block(), - new_construct.type())] = &result; - return result; -} - -Construct& Function::FindConstructForEntryBlock(const BasicBlock* entry_block, - ConstructType type) { - auto where = - entry_block_to_construct_.find(std::make_pair(entry_block, type)); - assert(where != entry_block_to_construct_.end()); - auto construct_ptr = (*where).second; - assert(construct_ptr); - return *construct_ptr; -} - -int Function::GetBlockDepth(BasicBlock* bb) { - // Guard against nullptr. - if (!bb) { - return 0; - } - // Only calculate the depth if it's not already calculated. - // This function uses memoization to avoid duplicate CFG depth calculations. - if (block_depth_.find(bb) != block_depth_.end()) { - return block_depth_[bb]; - } - - BasicBlock* bb_dom = bb->immediate_dominator(); - if (!bb_dom || bb == bb_dom) { - // This block has no dominator, so it's at depth 0. - block_depth_[bb] = 0; - } else if (bb->is_type(kBlockTypeMerge)) { - // If this is a merge block, its depth is equal to the block before - // branching. - BasicBlock* header = merge_block_header_[bb]; - assert(header); - block_depth_[bb] = GetBlockDepth(header); - } else if (bb->is_type(kBlockTypeContinue)) { - // The depth of the continue block entry point is 1 + loop header depth. - Construct* continue_construct = - entry_block_to_construct_[std::make_pair(bb, ConstructType::kContinue)]; - assert(continue_construct); - // Continue construct has only 1 corresponding construct (loop header). - Construct* loop_construct = - continue_construct->corresponding_constructs()[0]; - assert(loop_construct); - BasicBlock* loop_header = loop_construct->entry_block(); - // The continue target may be the loop itself (while 1). - // In such cases, the depth of the continue block is: 1 + depth of the - // loop's dominator block. - if (loop_header == bb) { - block_depth_[bb] = 1 + GetBlockDepth(bb_dom); - } else { - block_depth_[bb] = 1 + GetBlockDepth(loop_header); - } - } else if (bb_dom->is_type(kBlockTypeHeader) || - bb_dom->is_type(kBlockTypeLoop)) { - // The dominator of the given block is a header block. So, the nesting - // depth of this block is: 1 + nesting depth of the header. - block_depth_[bb] = 1 + GetBlockDepth(bb_dom); - } else { - block_depth_[bb] = GetBlockDepth(bb_dom); - } - return block_depth_[bb]; -} - -} /// namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/function.h vulkan-1.1.73+dfsg/external/spirv-tools/source/val/function.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/function.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/val/function.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,316 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_VAL_FUNCTION_H_ -#define LIBSPIRV_VAL_FUNCTION_H_ - -#include -#include -#include -#include -#include - -#include "spirv-tools/libspirv.h" -#include "spirv/1.2/spirv.h" -#include "val/basic_block.h" -#include "val/construct.h" - -namespace libspirv { - -struct bb_constr_type_pair_hash { - std::size_t operator()( - const std::pair& p) const { - auto h1 = std::hash{}(p.first); - auto h2 = std::hash::type>{}( - static_cast::type>(p.second)); - return (h1 ^ h2); - } -}; - -enum class FunctionDecl { - kFunctionDeclUnknown, /// < Unknown function declaration - kFunctionDeclDeclaration, /// < Function declaration - kFunctionDeclDefinition /// < Function definition -}; - -/// This class manages all function declaration and definitions in a module. It -/// handles the state and id information while parsing a function in the SPIR-V -/// binary. -class Function { - public: - Function(uint32_t id, uint32_t result_type_id, - SpvFunctionControlMask function_control, uint32_t function_type_id); - - /// Registers a function parameter in the current function - /// @return Returns SPV_SUCCESS if the call was successful - spv_result_t RegisterFunctionParameter(uint32_t id, uint32_t type_id); - - /// Sets the declaration type of the current function - /// @return Returns SPV_SUCCESS if the call was successful - spv_result_t RegisterSetFunctionDeclType(FunctionDecl type); - - /// Registers a block in the current function. Subsequent block instructions - /// will target this block - /// @param id The ID of the label of the block - /// @return Returns SPV_SUCCESS if the call was successful - spv_result_t RegisterBlock(uint32_t id, bool is_definition = true); - - /// Registers a variable in the current block - /// - /// @param[in] type_id The type ID of the varaible - /// @param[in] id The ID of the varaible - /// @param[in] storage The storage of the variable - /// @param[in] init_id The initializer ID of the variable - /// - /// @return Returns SPV_SUCCESS if the call was successful - spv_result_t RegisterBlockVariable(uint32_t type_id, uint32_t id, - SpvStorageClass storage, uint32_t init_id); - - /// Registers a loop merge construct in the function - /// - /// @param[in] merge_id The merge block ID of the loop - /// @param[in] continue_id The continue block ID of the loop - /// - /// @return Returns SPV_SUCCESS if the call was successful - spv_result_t RegisterLoopMerge(uint32_t merge_id, uint32_t continue_id); - - /// Registers a selection merge construct in the function - /// @return Returns SPV_SUCCESS if the call was successful - spv_result_t RegisterSelectionMerge(uint32_t merge_id); - - /// Registers the end of the block - /// - /// @param[in] successors_list A list of ids to the block's successors - /// @param[in] branch_instruction the branch instruction that ended the block - void RegisterBlockEnd(std::vector successors_list, - SpvOp branch_instruction); - - /// Registers the end of the function. This is idempotent. - void RegisterFunctionEnd(); - - /// Returns true if the \p id block is the first block of this function - bool IsFirstBlock(uint32_t id) const; - - /// Returns true if the \p merge_block_id is a BlockType of \p type - bool IsBlockType(uint32_t merge_block_id, BlockType type) const; - - /// Returns a pair consisting of the BasicBlock with \p id and a bool - /// which is true if the block has been defined, and false if it is - /// declared but not defined. This function will return nullptr if the - /// \p id was not declared and not defined at the current point in the binary - std::pair GetBlock(uint32_t id) const; - std::pair GetBlock(uint32_t id); - - /// Returns the first block of the current function - const BasicBlock* first_block() const; - - /// Returns the first block of the current function - BasicBlock* first_block(); - - /// Returns a vector of all the blocks in the function - const std::vector& ordered_blocks() const; - - /// Returns a vector of all the blocks in the function - std::vector& ordered_blocks(); - - /// Returns a list of all the cfg constructs in the function - const std::list& constructs() const; - - /// Returns a list of all the cfg constructs in the function - std::list& constructs(); - - /// Returns the number of blocks in the current function being parsed - size_t block_count() const; - - /// Returns the id of the function - uint32_t id() const { return id_; } - - /// Returns return type id of the function - uint32_t GetResultTypeId() const { return result_type_id_; } - - /// Returns the number of blocks in the current function being parsed - size_t undefined_block_count() const; - const std::unordered_set& undefined_blocks() const { - return undefined_blocks_; - } - - /// Returns the block that is currently being parsed in the binary - BasicBlock* current_block(); - - /// Returns the block that is currently being parsed in the binary - const BasicBlock* current_block() const; - - // For dominance calculations, we want to analyze all the - // blocks in the function, even in degenerate control flow cases - // including unreachable blocks. We therefore make an "augmented CFG" - // which is the same as the ordinary CFG but adds: - // - A pseudo-entry node. - // - A pseudo-exit node. - // - A minimal set of edges so that a forward traversal from the - // pseudo-entry node will visit all nodes. - // - A minimal set of edges so that a backward traversal from the - // pseudo-exit node will visit all nodes. - // In particular, the pseudo-entry node is the unique source of the - // augmented CFG, and the psueo-exit node is the unique sink of the - // augmented CFG. - - /// Returns the pseudo exit block - BasicBlock* pseudo_entry_block() { return &pseudo_entry_block_; } - - /// Returns the pseudo exit block - const BasicBlock* pseudo_entry_block() const { return &pseudo_entry_block_; } - - /// Returns the pseudo exit block - BasicBlock* pseudo_exit_block() { return &pseudo_exit_block_; } - - /// Returns the pseudo exit block - const BasicBlock* pseudo_exit_block() const { return &pseudo_exit_block_; } - - using GetBlocksFunction = - std::function*(const BasicBlock*)>; - /// Returns the block successors function for the augmented CFG. - GetBlocksFunction AugmentedCFGSuccessorsFunction() const; - /// Like AugmentedCFGSuccessorsFunction, but also includes a forward edge from - /// a loop header block to its continue target, if they are different blocks. - GetBlocksFunction AugmentedCFGSuccessorsFunctionIncludingHeaderToContinueEdge() const; - /// Returns the block predecessors function for the augmented CFG. - GetBlocksFunction AugmentedCFGPredecessorsFunction() const; - - /// Returns the control flow nesting depth of the given basic block. - /// This function only works when you have structured control flow. - /// This function should only be called after the control flow constructs have - /// been identified and dominators have been computed. - int GetBlockDepth(BasicBlock* bb); - - /// Prints a GraphViz digraph of the CFG of the current funciton - void PrintDotGraph() const; - - /// Prints a directed graph of the CFG of the current funciton - void PrintBlocks() const; - - private: - // Computes the representation of the augmented CFG. - // Populates augmented_successors_map_ and augmented_predecessors_map_. - void ComputeAugmentedCFG(); - - // Adds a copy of the given Construct, and tracks it by its entry block. - // Returns a reference to the stored construct. - Construct& AddConstruct(const Construct& new_construct); - - // Returns a reference to the construct corresponding to the given entry - // block. - Construct& FindConstructForEntryBlock(const BasicBlock* entry_block, - ConstructType t); - - /// The result id of the OpLabel that defined this block - uint32_t id_; - - /// The type of the function - uint32_t function_type_id_; - - /// The type of the return value - uint32_t result_type_id_; - - /// The control fo the funciton - SpvFunctionControlMask function_control_; - - /// The type of declaration of each function - FunctionDecl declaration_type_; - - // Have we finished parsing this function? - bool end_has_been_registered_; - - /// The blocks in the function mapped by block ID - std::unordered_map blocks_; - - /// A list of blocks in the order they appeared in the binary - std::vector ordered_blocks_; - - /// Blocks which are forward referenced by blocks but not defined - std::unordered_set undefined_blocks_; - - /// The block that is currently being parsed - BasicBlock* current_block_; - - /// A pseudo entry node used in dominance analysis. - /// After the function end has been registered, the successor list of the - /// pseudo entry node is the minimal set of nodes such that all nodes in the - /// CFG can be reached by following successor lists. That is, the successors - /// will be: - /// - Any basic block without predecessors. This includes the entry - /// block to the function. - /// - A single node from each otherwise unreachable cycle in the CFG, if - /// such cycles exist. - /// The pseudo entry node does not appear in the predecessor or successor - /// list of any ordinary block. - /// It has no predecessors. - /// It has Id 0. - BasicBlock pseudo_entry_block_; - - /// A pseudo exit block used in dominance analysis. - /// After the function end has been registered, the predecessor list of the - /// pseudo exit node is the minimal set of nodes such that all nodes in the - /// CFG can be reached by following predecessor lists. That is, the - /// predecessors will be: - /// - Any basic block without successors. This includes any basic block - /// ending with an OpReturn, OpReturnValue or similar instructions. - /// - A single node from each otherwise unreachable cycle in the CFG, if - /// such cycles exist. - /// The pseudo exit node does not appear in the predecessor or successor - /// list of any ordinary block. - /// It has no successors. - BasicBlock pseudo_exit_block_; - - // Maps a block to its successors in the augmented CFG, if that set is - // different from its successors in the ordinary CFG. - std::unordered_map> - augmented_successors_map_; - // Maps a block to its predecessors in the augmented CFG, if that set is - // different from its predecessors in the ordinary CFG. - std::unordered_map> - augmented_predecessors_map_; - - // Maps a structured loop header to its CFG successors and also its - // continue target if that continue target is not the loop header - // itself. This might have duplicates. - std::unordered_map> - loop_header_successors_plus_continue_target_map_; - - /// The constructs that are available in this function - std::list cfg_constructs_; - - /// The variable IDs of the functions - std::vector variable_ids_; - - /// The function parameter ids of the functions - std::vector parameter_ids_; - - /// Maps a construct's entry block to the construct(s). - /// Since a basic block may be the entry block of different types of - /// constructs, the type of the construct should also be specified in order to - /// get the unique construct. - std::unordered_map, Construct*, - libspirv::bb_constr_type_pair_hash> - entry_block_to_construct_; - - /// This map provides the header block for a given merge block. - std::unordered_map merge_block_header_; - - /// Stores the control flow nesting depth of a given basic block - std::unordered_map block_depth_; -}; - -} /// namespace libspirv - -#endif /// LIBSPIRV_VAL_FUNCTION_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/instruction.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/val/instruction.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/instruction.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/val/instruction.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "val/instruction.h" - -#include - -using std::make_pair; - -namespace libspirv { -#define OPERATOR(OP) \ - bool operator OP(const Instruction& lhs, const Instruction& rhs) { \ - return lhs.id() OP rhs.id(); \ - } \ - bool operator OP(const Instruction& lhs, uint32_t rhs) { \ - return lhs.id() OP rhs; \ - } - -OPERATOR(<) -OPERATOR(==) -#undef OPERATOR - -Instruction::Instruction(const spv_parsed_instruction_t* inst, - Function* defining_function, - BasicBlock* defining_block) - : words_(inst->words, inst->words + inst->num_words), - operands_(inst->operands, inst->operands + inst->num_operands), - inst_({words_.data(), inst->num_words, inst->opcode, inst->ext_inst_type, - inst->type_id, inst->result_id, operands_.data(), - inst->num_operands}), - function_(defining_function), - block_(defining_block), - uses_() {} - -void Instruction::RegisterUse(const Instruction* inst, uint32_t index) { - uses_.push_back(make_pair(inst, index)); -} -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/instruction.h vulkan-1.1.73+dfsg/external/spirv-tools/source/val/instruction.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/instruction.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/val/instruction.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,128 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_VAL_INSTRUCTION_H_ -#define LIBSPIRV_VAL_INSTRUCTION_H_ - -#include -#include -#include -#include -#include - -#include "spirv-tools/libspirv.h" -#include "table.h" - -namespace libspirv { - -class BasicBlock; -class Function; - -/// Wraps the spv_parsed_instruction struct along with use and definition of the -/// instruction's result id -class Instruction { - public: - explicit Instruction(const spv_parsed_instruction_t* inst, - Function* defining_function = nullptr, - BasicBlock* defining_block = nullptr); - - /// Registers the use of the Instruction in instruction \p inst at \p index - void RegisterUse(const Instruction* inst, uint32_t index); - - uint32_t id() const { return inst_.result_id; } - uint32_t type_id() const { return inst_.type_id; } - SpvOp opcode() const { return static_cast(inst_.opcode); } - - /// Returns the Function where the instruction was defined. nullptr if it was - /// defined outside of a Function - const Function* function() const { return function_; } - - /// Returns the BasicBlock where the instruction was defined. nullptr if it - /// was defined outside of a BasicBlock - const BasicBlock* block() const { return block_; } - - /// Returns a vector of pairs of all references to this instruction's result - /// id. The first element is the instruction in which this result id was - /// referenced and the second is the index of the word in that instruction - /// where this result id appeared - const std::vector>& uses() const { - return uses_; - } - - /// The word used to define the Instruction - uint32_t word(size_t index) const { return words_[index]; } - - /// The words used to define the Instruction - const std::vector& words() const { return words_; } - - /// The operands of the Instruction - const std::vector& operands() const { - return operands_; - } - - /// Provides direct access to the stored C instruction object. - const spv_parsed_instruction_t& c_inst() const { - return inst_; - } - - // Casts the words belonging to the operand under |index| to |T| and returns. - template - T GetOperandAs(size_t index) const { - const spv_parsed_operand_t& operand = operands_.at(index); - assert(operand.num_words * 4 >= sizeof(T)); - assert(operand.offset + operand.num_words <= inst_.num_words); - return *reinterpret_cast(&words_[operand.offset]); - } - - private: - const std::vector words_; - const std::vector operands_; - spv_parsed_instruction_t inst_; - - /// The function in which this instruction was declared - Function* function_; - - /// The basic block in which this instruction was declared - BasicBlock* block_; - - /// This is a vector of pairs of all references to this instruction's result - /// id. The first element is the instruction in which this result id was - /// referenced and the second is the index of the word in the referencing - /// instruction where this instruction appeared - std::vector> uses_; -}; - -#define OPERATOR(OP) \ - bool operator OP(const Instruction& lhs, const Instruction& rhs); \ - bool operator OP(const Instruction& lhs, uint32_t rhs) - -OPERATOR(<); -OPERATOR(==); -#undef OPERATOR - -} // namespace libspirv - -// custom specialization of std::hash for Instruction -namespace std { -template <> -struct hash { - typedef libspirv::Instruction argument_type; - typedef std::size_t result_type; - result_type operator()(const argument_type& inst) const { - return hash()(inst.id()); - } -}; -} /// namespace std - -#endif // LIBSPIRV_VAL_INSTRUCTION_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/validation_state.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/val/validation_state.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/validation_state.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/val/validation_state.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,688 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "val/validation_state.h" - -#include - -#include "opcode.h" -#include "val/basic_block.h" -#include "val/construct.h" -#include "val/function.h" - -using std::deque; -using std::make_pair; -using std::pair; -using std::string; -using std::unordered_map; -using std::vector; - -namespace libspirv { - -namespace { -bool IsInstructionInLayoutSection(ModuleLayoutSection layout, SpvOp op) { - // See Section 2.4 - bool out = false; - // clang-format off - switch (layout) { - case kLayoutCapabilities: out = op == SpvOpCapability; break; - case kLayoutExtensions: out = op == SpvOpExtension; break; - case kLayoutExtInstImport: out = op == SpvOpExtInstImport; break; - case kLayoutMemoryModel: out = op == SpvOpMemoryModel; break; - case kLayoutEntryPoint: out = op == SpvOpEntryPoint; break; - case kLayoutExecutionMode: out = op == SpvOpExecutionMode; break; - case kLayoutDebug1: - switch (op) { - case SpvOpSourceContinued: - case SpvOpSource: - case SpvOpSourceExtension: - case SpvOpString: - out = true; - break; - default: break; - } - break; - case kLayoutDebug2: - switch (op) { - case SpvOpName: - case SpvOpMemberName: - out = true; - break; - default: break; - } - break; - case kLayoutDebug3: - // Only OpModuleProcessed is allowed here. - out = (op == SpvOpModuleProcessed); - break; - case kLayoutAnnotations: - switch (op) { - case SpvOpDecorate: - case SpvOpMemberDecorate: - case SpvOpGroupDecorate: - case SpvOpGroupMemberDecorate: - case SpvOpDecorationGroup: - out = true; - break; - default: break; - } - break; - case kLayoutTypes: - if (spvOpcodeGeneratesType(op) || spvOpcodeIsConstant(op)) { - out = true; - break; - } - switch (op) { - case SpvOpTypeForwardPointer: - case SpvOpVariable: - case SpvOpLine: - case SpvOpNoLine: - case SpvOpUndef: - out = true; - break; - default: break; - } - break; - case kLayoutFunctionDeclarations: - case kLayoutFunctionDefinitions: - // NOTE: These instructions should NOT be in these layout sections - if (spvOpcodeGeneratesType(op) || spvOpcodeIsConstant(op)) { - out = false; - break; - } - switch (op) { - case SpvOpCapability: - case SpvOpExtension: - case SpvOpExtInstImport: - case SpvOpMemoryModel: - case SpvOpEntryPoint: - case SpvOpExecutionMode: - case SpvOpSourceContinued: - case SpvOpSource: - case SpvOpSourceExtension: - case SpvOpString: - case SpvOpName: - case SpvOpMemberName: - case SpvOpModuleProcessed: - case SpvOpDecorate: - case SpvOpMemberDecorate: - case SpvOpGroupDecorate: - case SpvOpGroupMemberDecorate: - case SpvOpDecorationGroup: - case SpvOpTypeForwardPointer: - out = false; - break; - default: - out = true; - break; - } - } - // clang-format on - return out; -} - -} // anonymous namespace - -ValidationState_t::ValidationState_t(const spv_const_context ctx, - const spv_const_validator_options opt) - : context_(ctx), - options_(opt), - instruction_counter_(0), - unresolved_forward_ids_{}, - operand_names_{}, - current_layout_section_(kLayoutCapabilities), - module_functions_(), - module_capabilities_(), - module_extensions_(), - ordered_instructions_(), - all_definitions_(), - global_vars_(), - local_vars_(), - struct_nesting_depth_(), - grammar_(ctx), - addressing_model_(SpvAddressingModelLogical), - memory_model_(SpvMemoryModelSimple), - in_function_(false) { - assert(opt && "Validator options may not be Null."); -} - -spv_result_t ValidationState_t::ForwardDeclareId(uint32_t id) { - unresolved_forward_ids_.insert(id); - return SPV_SUCCESS; -} - -spv_result_t ValidationState_t::RemoveIfForwardDeclared(uint32_t id) { - unresolved_forward_ids_.erase(id); - return SPV_SUCCESS; -} - -spv_result_t ValidationState_t::RegisterForwardPointer(uint32_t id) { - forward_pointer_ids_.insert(id); - return SPV_SUCCESS; -} - -bool ValidationState_t::IsForwardPointer(uint32_t id) const { - return (forward_pointer_ids_.find(id) != forward_pointer_ids_.end()); -} - -void ValidationState_t::AssignNameToId(uint32_t id, string name) { - operand_names_[id] = name; -} - -string ValidationState_t::getIdName(uint32_t id) const { - std::stringstream out; - out << id; - if (operand_names_.find(id) != end(operand_names_)) { - out << "[" << operand_names_.at(id) << "]"; - } - return out.str(); -} - -string ValidationState_t::getIdOrName(uint32_t id) const { - std::stringstream out; - if (operand_names_.find(id) != end(operand_names_)) { - out << operand_names_.at(id); - } else { - out << id; - } - return out.str(); -} - -size_t ValidationState_t::unresolved_forward_id_count() const { - return unresolved_forward_ids_.size(); -} - -vector ValidationState_t::UnresolvedForwardIds() const { - vector out(begin(unresolved_forward_ids_), - end(unresolved_forward_ids_)); - return out; -} - -bool ValidationState_t::IsDefinedId(uint32_t id) const { - return all_definitions_.find(id) != end(all_definitions_); -} - -const Instruction* ValidationState_t::FindDef(uint32_t id) const { - auto it = all_definitions_.find(id); - if (it == all_definitions_.end()) - return nullptr; - return it->second; -} - -Instruction* ValidationState_t::FindDef(uint32_t id) { - auto it = all_definitions_.find(id); - if (it == all_definitions_.end()) - return nullptr; - return it->second; -} - -// Increments the instruction count. Used for diagnostic -int ValidationState_t::increment_instruction_count() { - return instruction_counter_++; -} - -ModuleLayoutSection ValidationState_t::current_layout_section() const { - return current_layout_section_; -} - -void ValidationState_t::ProgressToNextLayoutSectionOrder() { - // Guard against going past the last element(kLayoutFunctionDefinitions) - if (current_layout_section_ <= kLayoutFunctionDefinitions) { - current_layout_section_ = - static_cast(current_layout_section_ + 1); - } -} - -bool ValidationState_t::IsOpcodeInCurrentLayoutSection(SpvOp op) { - return IsInstructionInLayoutSection(current_layout_section_, op); -} - -DiagnosticStream ValidationState_t::diag(spv_result_t error_code) const { - return libspirv::DiagnosticStream( - {0, 0, static_cast(instruction_counter_)}, context_->consumer, - error_code); -} - -deque& ValidationState_t::functions() { return module_functions_; } - -Function& ValidationState_t::current_function() { - assert(in_function_body()); - return module_functions_.back(); -} - -const Function& ValidationState_t::current_function() const { - assert(in_function_body()); - return module_functions_.back(); -} - -bool ValidationState_t::in_function_body() const { return in_function_; } - -bool ValidationState_t::in_block() const { - return module_functions_.empty() == false && - module_functions_.back().current_block() != nullptr; -} - -void ValidationState_t::RegisterCapability(SpvCapability cap) { - // Avoid redundant work. Otherwise the recursion could induce work - // quadrdatic in the capability dependency depth. (Ok, not much, but - // it's something.) - if (module_capabilities_.Contains(cap)) return; - - module_capabilities_.Add(cap); - spv_operand_desc desc; - if (SPV_SUCCESS == - grammar_.lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, cap, &desc)) { - desc->capabilities.ForEach( - [this](SpvCapability c) { RegisterCapability(c); }); - } - - switch (cap) { - case SpvCapabilityInt16: - features_.declare_int16_type = true; - break; - case SpvCapabilityFloat16: - case SpvCapabilityFloat16Buffer: - features_.declare_float16_type = true; - break; - case SpvCapabilityStorageUniformBufferBlock16: - case SpvCapabilityStorageUniform16: - case SpvCapabilityStoragePushConstant16: - case SpvCapabilityStorageInputOutput16: - features_.declare_int16_type = true; - features_.declare_float16_type = true; - features_.free_fp_rounding_mode = true; - break; - case SpvCapabilityVariablePointers: - features_.variable_pointers = true; - features_.variable_pointers_storage_buffer = true; - break; - case SpvCapabilityVariablePointersStorageBuffer: - features_.variable_pointers_storage_buffer = true; - break; - default: - break; - } -} - -void ValidationState_t::RegisterExtension(Extension ext) { - if (module_extensions_.Contains(ext)) return; - - module_extensions_.Add(ext); -} - -bool ValidationState_t::HasAnyOfCapabilities( - const CapabilitySet& capabilities) const { - return module_capabilities_.HasAnyOf(capabilities); -} - -bool ValidationState_t::HasAnyOfExtensions( - const ExtensionSet& extensions) const { - return module_extensions_.HasAnyOf(extensions); -} - -void ValidationState_t::set_addressing_model(SpvAddressingModel am) { - addressing_model_ = am; -} - -SpvAddressingModel ValidationState_t::addressing_model() const { - return addressing_model_; -} - -void ValidationState_t::set_memory_model(SpvMemoryModel mm) { - memory_model_ = mm; -} - -SpvMemoryModel ValidationState_t::memory_model() const { return memory_model_; } - -spv_result_t ValidationState_t::RegisterFunction( - uint32_t id, uint32_t ret_type_id, SpvFunctionControlMask function_control, - uint32_t function_type_id) { - assert(in_function_body() == false && - "RegisterFunction can only be called when parsing the binary outside " - "of another function"); - in_function_ = true; - module_functions_.emplace_back(id, ret_type_id, function_control, - function_type_id); - - // TODO(umar): validate function type and type_id - - return SPV_SUCCESS; -} - -spv_result_t ValidationState_t::RegisterFunctionEnd() { - assert(in_function_body() == true && - "RegisterFunctionEnd can only be called when parsing the binary " - "inside of another function"); - assert(in_block() == false && - "RegisterFunctionParameter can only be called when parsing the binary " - "ouside of a block"); - current_function().RegisterFunctionEnd(); - in_function_ = false; - return SPV_SUCCESS; -} - -void ValidationState_t::RegisterInstruction( - const spv_parsed_instruction_t& inst) { - if (in_function_body()) { - ordered_instructions_.emplace_back(&inst, ¤t_function(), - current_function().current_block()); - } else { - ordered_instructions_.emplace_back(&inst, nullptr, nullptr); - } - uint32_t id = ordered_instructions_.back().id(); - if (id) { - all_definitions_.insert(make_pair(id, &ordered_instructions_.back())); - } - - // If the instruction is using an OpTypeSampledImage as an operand, it should - // be recorded. The validator will ensure that all usages of an - // OpTypeSampledImage and its definition are in the same basic block. - for (uint16_t i = 0; i < inst.num_operands; ++i) { - const spv_parsed_operand_t& operand = inst.operands[i]; - if (SPV_OPERAND_TYPE_ID == operand.type) { - const uint32_t operand_word = inst.words[operand.offset]; - Instruction* operand_inst = FindDef(operand_word); - if (operand_inst && SpvOpSampledImage == operand_inst->opcode()) { - RegisterSampledImageConsumer(operand_word, inst.result_id); - } - } - } -} - -std::vector ValidationState_t::getSampledImageConsumers( - uint32_t sampled_image_id) const { - std::vector result; - auto iter = sampled_image_consumers_.find(sampled_image_id); - if (iter != sampled_image_consumers_.end()) { - result = iter->second; - } - return result; -} - -void ValidationState_t::RegisterSampledImageConsumer(uint32_t sampled_image_id, - uint32_t consumer_id) { - sampled_image_consumers_[sampled_image_id].push_back(consumer_id); -} - -uint32_t ValidationState_t::getIdBound() const { return id_bound_; } - -void ValidationState_t::setIdBound(const uint32_t bound) { id_bound_ = bound; } - -bool ValidationState_t::RegisterUniqueTypeDeclaration( - const spv_parsed_instruction_t& inst) { - std::vector key; - key.push_back(static_cast(inst.opcode)); - for (int index = 0; index < inst.num_operands; ++index) { - const spv_parsed_operand_t& operand = inst.operands[index]; - - if (operand.type == SPV_OPERAND_TYPE_RESULT_ID) continue; - - const int words_begin = operand.offset; - const int words_end = words_begin + operand.num_words; - assert(words_end <= static_cast(inst.num_words)); - - key.insert(key.end(), inst.words + words_begin, inst.words + words_end); - } - - return unique_type_declarations_.insert(std::move(key)).second; -} - -uint32_t ValidationState_t::GetTypeId(uint32_t id) const { - const Instruction* inst = FindDef(id); - assert(inst); - return inst->type_id(); -} - -uint32_t ValidationState_t::GetComponentType(uint32_t id) const { - const Instruction* inst = FindDef(id); - assert(inst); - - switch (inst->opcode()) { - case SpvOpTypeFloat: - case SpvOpTypeInt: - case SpvOpTypeBool: - return id; - - case SpvOpTypeVector: - return inst->word(2); - - case SpvOpTypeMatrix: - return GetComponentType(inst->word(2)); - - default: - break; - } - - if (inst->type_id()) - return GetComponentType(inst->type_id()); - - assert(0); - return 0; -} - -uint32_t ValidationState_t::GetDimension(uint32_t id) const { - const Instruction* inst = FindDef(id); - assert(inst); - - switch (inst->opcode()) { - case SpvOpTypeFloat: - case SpvOpTypeInt: - case SpvOpTypeBool: - return 1; - - case SpvOpTypeVector: - case SpvOpTypeMatrix: - return inst->word(3); - - default: - break; - } - - if (inst->type_id()) - return GetDimension(inst->type_id()); - - assert(0); - return 0; -} - -uint32_t ValidationState_t::GetBitWidth(uint32_t id) const { - const uint32_t component_type_id = GetComponentType(id); - const Instruction* inst = FindDef(component_type_id); - assert(inst); - - if (inst->opcode() == SpvOpTypeFloat || inst->opcode() == SpvOpTypeInt) - return inst->word(2); - - if (inst->opcode() == SpvOpTypeBool) - return 1; - - assert(0); - return 0; -} - -bool ValidationState_t::IsFloatScalarType(uint32_t id) const { - const Instruction* inst = FindDef(id); - assert(inst); - return inst->opcode() == SpvOpTypeFloat; -} - -bool ValidationState_t::IsFloatVectorType(uint32_t id) const { - const Instruction* inst = FindDef(id); - assert(inst); - - if (inst->opcode() == SpvOpTypeVector) { - return IsFloatScalarType(GetComponentType(id)); - } - - return false; -} - -bool ValidationState_t::IsIntScalarType(uint32_t id) const { - const Instruction* inst = FindDef(id); - assert(inst); - return inst->opcode() == SpvOpTypeInt; -} - -bool ValidationState_t::IsIntVectorType(uint32_t id) const { - const Instruction* inst = FindDef(id); - assert(inst); - - if (inst->opcode() == SpvOpTypeVector) { - return IsIntScalarType(GetComponentType(id)); - } - - return false; -} - -bool ValidationState_t::IsUnsignedIntScalarType(uint32_t id) const { - const Instruction* inst = FindDef(id); - assert(inst); - return inst->opcode() == SpvOpTypeInt && inst->word(3) == 0; -} - -bool ValidationState_t::IsUnsignedIntVectorType(uint32_t id) const { - const Instruction* inst = FindDef(id); - assert(inst); - - if (inst->opcode() == SpvOpTypeVector) { - return IsUnsignedIntScalarType(GetComponentType(id)); - } - - return false; -} - -bool ValidationState_t::IsSignedIntScalarType(uint32_t id) const { - const Instruction* inst = FindDef(id); - assert(inst); - return inst->opcode() == SpvOpTypeInt && inst->word(3) == 1; -} - -bool ValidationState_t::IsSignedIntVectorType(uint32_t id) const { - const Instruction* inst = FindDef(id); - assert(inst); - - if (inst->opcode() == SpvOpTypeVector) { - return IsSignedIntScalarType(GetComponentType(id)); - } - - return false; -} - -bool ValidationState_t::IsBoolScalarType(uint32_t id) const { - const Instruction* inst = FindDef(id); - assert(inst); - return inst->opcode() == SpvOpTypeBool; -} - -bool ValidationState_t::IsBoolVectorType(uint32_t id) const { - const Instruction* inst = FindDef(id); - assert(inst); - - if (inst->opcode() == SpvOpTypeVector) { - return IsBoolScalarType(GetComponentType(id)); - } - - return false; -} - -bool ValidationState_t::IsFloatMatrixType(uint32_t id) const { - const Instruction* inst = FindDef(id); - assert(inst); - - if (inst->opcode() == SpvOpTypeMatrix) { - return IsFloatScalarType(GetComponentType(id)); - } - - return false; -} - -bool ValidationState_t::GetMatrixTypeInfo( - uint32_t id, uint32_t* num_rows, uint32_t* num_cols, - uint32_t* column_type, uint32_t* component_type) const { - if (!id) - return false; - - const Instruction* mat_inst = FindDef(id); - assert(mat_inst); - if (mat_inst->opcode() != SpvOpTypeMatrix) - return false; - - const uint32_t vec_type = mat_inst->word(2); - const Instruction* vec_inst = FindDef(vec_type); - assert(vec_inst); - - if (vec_inst->opcode() != SpvOpTypeVector) { - assert(0); - return false; - } - - *num_cols = mat_inst->word(3); - *num_rows = vec_inst->word(3); - *column_type = mat_inst->word(2); - *component_type = vec_inst->word(2); - - return true; -} - -bool ValidationState_t::GetStructMemberTypes( - uint32_t struct_type_id, std::vector* member_types) const { - member_types->clear(); - if (!struct_type_id) - return false; - - const Instruction* inst = FindDef(struct_type_id); - assert(inst); - if (inst->opcode() != SpvOpTypeStruct) - return false; - - *member_types = std::vector(inst->words().cbegin() + 2, - inst->words().cend()); - - if (member_types->empty()) - return false; - - return true; -} - -bool ValidationState_t::IsPointerType(uint32_t id) const { - const Instruction* inst = FindDef(id); - assert(inst); - return inst->opcode() == SpvOpTypePointer; -} - -bool ValidationState_t::GetPointerTypeInfo( - uint32_t id, uint32_t* data_type, uint32_t* storage_class) const { - if (!id) - return false; - - const Instruction* inst = FindDef(id); - assert(inst); - if (inst->opcode() != SpvOpTypePointer) - return false; - - *storage_class = inst->word(2); - *data_type = inst->word(3); - return true; -} - -uint32_t ValidationState_t::GetOperandTypeId( - const spv_parsed_instruction_t* inst, - size_t operand_index) const { - assert(operand_index < inst->num_operands); - const spv_parsed_operand_t& operand = inst->operands[operand_index]; - assert(operand.num_words == 1); - return GetTypeId(inst->words[operand.offset]); -} - -} /// namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/validation_state.h vulkan-1.1.73+dfsg/external/spirv-tools/source/val/validation_state.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/val/validation_state.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/val/validation_state.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,486 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_VAL_VALIDATIONSTATE_H_ -#define LIBSPIRV_VAL_VALIDATIONSTATE_H_ - -#include -#include -#include -#include -#include -#include - -#include "assembly_grammar.h" -#include "decoration.h" -#include "diagnostic.h" -#include "enum_set.h" -#include "spirv-tools/libspirv.h" -#include "spirv/1.2/spirv.h" -#include "spirv_definition.h" -#include "val/function.h" -#include "val/instruction.h" - -namespace libspirv { - -/// This enum represents the sections of a SPIRV module. See section 2.4 -/// of the SPIRV spec for additional details of the order. The enumerant values -/// are in the same order as the vector returned by GetModuleOrder -enum ModuleLayoutSection { - kLayoutCapabilities, /// < Section 2.4 #1 - kLayoutExtensions, /// < Section 2.4 #2 - kLayoutExtInstImport, /// < Section 2.4 #3 - kLayoutMemoryModel, /// < Section 2.4 #4 - kLayoutEntryPoint, /// < Section 2.4 #5 - kLayoutExecutionMode, /// < Section 2.4 #6 - kLayoutDebug1, /// < Section 2.4 #7 > 1 - kLayoutDebug2, /// < Section 2.4 #7 > 2 - kLayoutDebug3, /// < Section 2.4 #7 > 3 - kLayoutAnnotations, /// < Section 2.4 #8 - kLayoutTypes, /// < Section 2.4 #9 - kLayoutFunctionDeclarations, /// < Section 2.4 #10 - kLayoutFunctionDefinitions /// < Section 2.4 #11 -}; - -/// This class manages the state of the SPIR-V validation as it is being parsed. -class ValidationState_t { - public: - // Features that can optionally be turned on by a capability. - struct Feature { - bool declare_int16_type = false; // Allow OpTypeInt with 16 bit width? - bool declare_float16_type = false; // Allow OpTypeFloat with 16 bit width? - bool free_fp_rounding_mode = false; // Allow the FPRoundingMode decoration - // and its vaules to be used without - // requiring any capability - - // Allow functionalities enabled by VariablePointers capability. - bool variable_pointers = false; - // Allow functionalities enabled by VariablePointersStorageBuffer - // capability. - bool variable_pointers_storage_buffer = false; - }; - - ValidationState_t(const spv_const_context context, - const spv_const_validator_options opt); - - /// Returns the context - spv_const_context context() const { return context_; } - - /// Returns the command line options - spv_const_validator_options options() const { return options_; } - - /// Forward declares the id in the module - spv_result_t ForwardDeclareId(uint32_t id); - - /// Removes a forward declared ID if it has been defined - spv_result_t RemoveIfForwardDeclared(uint32_t id); - - /// Registers an ID as a forward pointer - spv_result_t RegisterForwardPointer(uint32_t id); - - /// Returns whether or not an ID is a forward pointer - bool IsForwardPointer(uint32_t id) const; - - /// Assigns a name to an ID - void AssignNameToId(uint32_t id, std::string name); - - /// Returns a string representation of the ID in the format [Name] where - /// the is the numeric valid of the id and the Name is a name assigned by - /// the OpName instruction - std::string getIdName(uint32_t id) const; - - /// Accessor function for ID bound. - uint32_t getIdBound() const; - - /// Mutator function for ID bound. - void setIdBound(uint32_t bound); - - /// Like getIdName but does not display the id if the \p id has a name - std::string getIdOrName(uint32_t id) const; - - /// Returns the number of ID which have been forward referenced but not - /// defined - size_t unresolved_forward_id_count() const; - - /// Returns a vector of unresolved forward ids. - std::vector UnresolvedForwardIds() const; - - /// Returns true if the id has been defined - bool IsDefinedId(uint32_t id) const; - - /// Increments the instruction count. Used for diagnostic - int increment_instruction_count(); - - /// Returns the current layout section which is being processed - ModuleLayoutSection current_layout_section() const; - - /// Increments the module_layout_order_section_ - void ProgressToNextLayoutSectionOrder(); - - /// Determines if the op instruction is part of the current section - bool IsOpcodeInCurrentLayoutSection(SpvOp op); - - libspirv::DiagnosticStream diag(spv_result_t error_code) const; - - /// Returns the function states - std::deque& functions(); - - /// Returns the function states - Function& current_function(); - const Function& current_function() const; - - /// Returns true if the called after a function instruction but before the - /// function end instruction - bool in_function_body() const; - - /// Returns true if called after a label instruction but before a branch - /// instruction - bool in_block() const; - - /// Registers the given as an Entry Point. - void RegisterEntryPointId(const uint32_t id) { - entry_points_.push_back(id); - entry_point_interfaces_.insert(std::make_pair(id, std::vector())); - } - - /// Returns a list of entry point function ids - const std::vector& entry_points() const { return entry_points_; } - - /// Adds a new interface id to the interfaces of the given entry point. - void RegisterInterfaceForEntryPoint(uint32_t entry_point, - uint32_t interface) { - entry_point_interfaces_[entry_point].push_back(interface); - } - - /// Returns the interfaces of a given entry point. If the given id is not a - /// valid Entry Point id, std::out_of_range exception is thrown. - const std::vector& entry_point_interfaces( - uint32_t entry_point) const { - return entry_point_interfaces_.at(entry_point); - } - - /// Inserts an to the set of functions that are target of OpFunctionCall. - void AddFunctionCallTarget(const uint32_t id) { - function_call_targets_.insert(id); - } - - /// Returns whether or not a function is the target of OpFunctionCall. - bool IsFunctionCallTarget(const uint32_t id) { - return (function_call_targets_.find(id) != function_call_targets_.end()); - } - - /// Registers the capability and its dependent capabilities - void RegisterCapability(SpvCapability cap); - - /// Registers the extension. - void RegisterExtension(Extension ext); - - /// Registers the function in the module. Subsequent instructions will be - /// called against this function - spv_result_t RegisterFunction(uint32_t id, uint32_t ret_type_id, - SpvFunctionControlMask function_control, - uint32_t function_type_id); - - /// Register a function end instruction - spv_result_t RegisterFunctionEnd(); - - /// Returns true if the capability is enabled in the module. - bool HasCapability(SpvCapability cap) const { - return module_capabilities_.Contains(cap); - } - - /// Returns true if the extension is enabled in the module. - bool HasExtension(Extension ext) const { - return module_extensions_.Contains(ext); - } - - /// Returns true if any of the capabilities is enabled, or if |capabilities| - /// is an empty set. - bool HasAnyOfCapabilities(const libspirv::CapabilitySet& capabilities) const; - - /// Returns true if any of the extensions is enabled, or if |extensions| - /// is an empty set. - bool HasAnyOfExtensions(const libspirv::ExtensionSet& extensions) const; - - /// Sets the addressing model of this module (logical/physical). - void set_addressing_model(SpvAddressingModel am); - - /// Returns the addressing model of this module, or Logical if uninitialized. - SpvAddressingModel addressing_model() const; - - /// Sets the memory model of this module. - void set_memory_model(SpvMemoryModel mm); - - /// Returns the memory model of this module, or Simple if uninitialized. - SpvMemoryModel memory_model() const; - - const AssemblyGrammar& grammar() const { return grammar_; } - - /// Registers the instruction - void RegisterInstruction(const spv_parsed_instruction_t& inst); - - /// Registers the decoration for the given - void RegisterDecorationForId(uint32_t id, const Decoration& dec) { - id_decorations_[id].push_back(dec); - } - - /// Registers the list of decorations for the given - template - void RegisterDecorationsForId(uint32_t id, InputIt begin, InputIt end) { - std::vector& cur_decs = id_decorations_[id]; - cur_decs.insert(cur_decs.end(), begin, end); - } - - /// Registers the list of decorations for the given member of the given - /// structure. - template - void RegisterDecorationsForStructMember(uint32_t struct_id, - uint32_t member_index, InputIt begin, - InputIt end) { - RegisterDecorationsForId(struct_id, begin, end); - for (auto& decoration : id_decorations_[struct_id]) { - decoration.set_struct_member_index(member_index); - } - } - - /// Returns all the decorations for the given . If no decorations exist - /// for the , it registers an empty vector for it in the map and - /// returns the empty vector. - std::vector& id_decorations(uint32_t id) { - return id_decorations_[id]; - } - - /// Finds id's def, if it exists. If found, returns the definition otherwise - /// nullptr - const Instruction* FindDef(uint32_t id) const; - - /// Finds id's def, if it exists. If found, returns the definition otherwise - /// nullptr - Instruction* FindDef(uint32_t id); - - /// Returns a deque of instructions in the order they appear in the binary - const std::deque& ordered_instructions() const { - return ordered_instructions_; - } - - /// Returns a map of instructions mapped by their result id - const std::unordered_map& all_definitions() const { - return all_definitions_; - } - - /// Returns a vector containing the Ids of instructions that consume the given - /// SampledImage id. - std::vector getSampledImageConsumers(uint32_t id) const; - - /// Records cons_id as a consumer of sampled_image_id. - void RegisterSampledImageConsumer(uint32_t sampled_image_id, - uint32_t cons_id); - - /// Returns the set of Global Variables. - std::unordered_set& global_vars() { return global_vars_; } - - /// Returns the set of Local Variables. - std::unordered_set& local_vars() { return local_vars_; } - - /// Returns the number of Global Variables. - size_t num_global_vars() { return global_vars_.size(); } - - /// Returns the number of Local Variables. - size_t num_local_vars() { return local_vars_.size(); } - - /// Inserts a new to the set of Global Variables. - void registerGlobalVariable(const uint32_t id) { global_vars_.insert(id); } - - /// Inserts a new to the set of Local Variables. - void registerLocalVariable(const uint32_t id) { local_vars_.insert(id); } - - /// Sets the struct nesting depth for a given struct ID - void set_struct_nesting_depth(uint32_t id, uint32_t depth) { - struct_nesting_depth_[id] = depth; - } - - /// Returns the nesting depth of a given structure ID - uint32_t struct_nesting_depth(uint32_t id) { - return struct_nesting_depth_[id]; - } - - /// Records that the structure type has a member decorated with a built-in. - void RegisterStructTypeWithBuiltInMember(uint32_t id) { - builtin_structs_.insert(id); - } - - /// Returns true if the struct type with the given Id has a BuiltIn member. - bool IsStructTypeWithBuiltInMember(uint32_t id) const { - return (builtin_structs_.find(id) != builtin_structs_.end()); - } - - // Returns the state of optional features. - const Feature& features() const { return features_; } - - /// Adds the instruction data to unique_type_declarations_. - /// Returns false if an identical type declaration already exists. - bool RegisterUniqueTypeDeclaration(const spv_parsed_instruction_t& inst); - - // Returns type_id of the scalar component of |id|. - // |id| can be either - // - scalar, vector or matrix type - // - object of either scalar, vector or matrix type - uint32_t GetComponentType(uint32_t id) const; - - // Returns - // - 1 for scalar types or objects - // - vector size for vector types or objects - // - num columns for matrix types or objects - // Should not be called with any other arguments (will return zero and invoke - // assertion). - uint32_t GetDimension(uint32_t id) const; - - // Returns bit width of scalar or component. - // |id| can be - // - scalar, vector or matrix type - // - object of either scalar, vector or matrix type - // Will invoke assertion and return 0 if |id| is none of the above. - uint32_t GetBitWidth(uint32_t id) const; - - // Provides detailed information on matrix type. - // Returns false iff |id| is not matrix type. - bool GetMatrixTypeInfo( - uint32_t id, uint32_t* num_rows, uint32_t* num_cols, - uint32_t* column_type, uint32_t* component_type) const; - - // Collects struct member types into |member_types|. - // Returns false iff not struct type or has no members. - // Deletes prior contents of |member_types|. - bool GetStructMemberTypes( - uint32_t struct_type_id, std::vector* member_types) const; - - // Returns true iff |id| is a type corresponding to the name of the function. - // Only works for types not for objects. - bool IsFloatScalarType(uint32_t id) const; - bool IsFloatVectorType(uint32_t id) const; - bool IsFloatMatrixType(uint32_t id) const; - bool IsIntScalarType(uint32_t id) const; - bool IsIntVectorType(uint32_t id) const; - bool IsUnsignedIntScalarType(uint32_t id) const; - bool IsUnsignedIntVectorType(uint32_t id) const; - bool IsSignedIntScalarType(uint32_t id) const; - bool IsSignedIntVectorType(uint32_t id) const; - bool IsBoolScalarType(uint32_t id) const; - bool IsBoolVectorType(uint32_t id) const; - bool IsPointerType(uint32_t id) const; - - // Returns type_id if id has type or zero otherwise. - uint32_t GetTypeId(uint32_t id) const; - - // Returns type_id for given id operand if it has a type or zero otherwise. - // |operand_index| is expected to be pointing towards an operand which is an - // id. - uint32_t GetOperandTypeId(const spv_parsed_instruction_t* inst, - size_t operand_index) const; - - // Provides information on pointer type. Returns false iff not pointer type. - bool GetPointerTypeInfo( - uint32_t id, uint32_t* data_type, uint32_t* storage_class) const; - - private: - ValidationState_t(const ValidationState_t&); - - const spv_const_context context_; - - /// Stores the Validator command line options. Must be a valid options object. - const spv_const_validator_options options_; - - /// Tracks the number of instructions evaluated by the validator - int instruction_counter_; - - /// IDs which have been forward declared but have not been defined - std::unordered_set unresolved_forward_ids_; - - /// IDs that have been declared as forward pointers. - std::unordered_set forward_pointer_ids_; - - /// Stores a vector of instructions that use the result of a given - /// OpSampledImage instruction. - std::unordered_map> sampled_image_consumers_; - - /// A map of operand IDs and their names defined by the OpName instruction - std::unordered_map operand_names_; - - /// The section of the code being processed - ModuleLayoutSection current_layout_section_; - - /// A list of functions in the module - std::deque module_functions_; - - /// Capabilities declared in the module - libspirv::CapabilitySet module_capabilities_; - - /// Extensions declared in the module - libspirv::ExtensionSet module_extensions_; - - /// List of all instructions in the order they appear in the binary - std::deque ordered_instructions_; - - /// Instructions that can be referenced by Ids - std::unordered_map all_definitions_; - - /// IDs that are entry points, ie, arguments to OpEntryPoint. - std::vector entry_points_; - - /// Maps an entry point id to its interfaces. - std::unordered_map> entry_point_interfaces_; - - /// Functions IDs that are target of OpFunctionCall. - std::unordered_set function_call_targets_; - - /// ID Bound from the Header - uint32_t id_bound_; - - /// Set of Global Variable IDs (Storage Class other than 'Function') - std::unordered_set global_vars_; - - /// Set of Local Variable IDs ('Function' Storage Class) - std::unordered_set local_vars_; - - /// Set of struct types that have members with a BuiltIn decoration. - std::unordered_set builtin_structs_; - - /// Structure Nesting Depth - std::unordered_map struct_nesting_depth_; - - /// Stores the list of decorations for a given - std::unordered_map> id_decorations_; - - /// Stores type declarations which need to be unique (i.e. non-aggregates), - /// in the form [opcode, operand words], result_id is not stored. - /// Using ordered set to avoid the need for a vector hash function. - /// The size of this container is expected not to exceed double-digits. - std::set> unique_type_declarations_; - - AssemblyGrammar grammar_; - - SpvAddressingModel addressing_model_; - SpvMemoryModel memory_model_; - - /// NOTE: See correspoding getter functions - bool in_function_; - - // The state of optional features. These are determined by capabilities - // declared by the module. - Feature features_; -}; - -} /// namespace libspirv - -#endif /// LIBSPIRV_VAL_VALIDATIONSTATE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_arithmetics.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_arithmetics.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_arithmetics.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_arithmetics.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,467 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Ensures type declarations are unique unless allowed by the specification. - -#include "validate.h" - -#include "diagnostic.h" -#include "opcode.h" -#include "val/instruction.h" -#include "val/validation_state.h" - -namespace libspirv { - -namespace { - -// Returns operand word for given instruction and operand index. -// The operand is expected to only have one word. -inline uint32_t GetOperandWord(const spv_parsed_instruction_t* inst, - size_t operand_index) { - assert(operand_index < inst->num_operands); - const spv_parsed_operand_t& operand = inst->operands[operand_index]; - assert(operand.num_words == 1); - return inst->words[operand.offset]; -} - -// Returns the type id of instruction operand at |operand_index|. -// The operand is expected to be an id. -inline uint32_t GetOperandTypeId(ValidationState_t& _, - const spv_parsed_instruction_t* inst, - size_t operand_index) { - return _.GetTypeId(GetOperandWord(inst, operand_index)); -} - -} - -// Validates correctness of arithmetic instructions. -spv_result_t ArithmeticsPass(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - const SpvOp opcode = static_cast(inst->opcode); - const uint32_t result_type = inst->type_id; - - switch (opcode) { - case SpvOpFAdd: - case SpvOpFSub: - case SpvOpFMul: - case SpvOpFDiv: - case SpvOpFRem: - case SpvOpFMod: - case SpvOpFNegate: { - if (!_.IsFloatScalarType(result_type) && - !_.IsFloatVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected floating scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - for (size_t operand_index = 2; operand_index < inst->num_operands; - ++operand_index) { - if (GetOperandTypeId(_, inst, operand_index) != result_type) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected arithmetic operands to be of Result Type: " - << spvOpcodeString(opcode) << " operand index " << operand_index; - } - break; - } - - case SpvOpUDiv: - case SpvOpUMod: { - if (!_.IsUnsignedIntScalarType(result_type) && - !_.IsUnsignedIntVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected unsigned int scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - for (size_t operand_index = 2; operand_index < inst->num_operands; - ++operand_index) { - if (GetOperandTypeId(_, inst, operand_index) != result_type) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected arithmetic operands to be of Result Type: " - << spvOpcodeString(opcode) << " operand index " << operand_index; - } - break; - } - - case SpvOpISub: - case SpvOpIAdd: - case SpvOpIMul: - case SpvOpSDiv: - case SpvOpSMod: - case SpvOpSRem: - case SpvOpSNegate: { - if (!_.IsIntScalarType(result_type) && - !_.IsIntVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected int scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t dimension = _.GetDimension(result_type); - const uint32_t bit_width = _.GetBitWidth(result_type); - - for (size_t operand_index = 2; operand_index < inst->num_operands; - ++operand_index) { - - const uint32_t type_id = GetOperandTypeId(_, inst, operand_index); - if (!type_id || - (!_.IsIntScalarType(type_id) && !_.IsIntVectorType(type_id))) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected int scalar or vector type as operand: " - << spvOpcodeString(opcode) << " operand index " << operand_index; - - if (_.GetDimension(type_id) != dimension) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected arithmetic operands to have the same dimension " - << "as Result Type: " - << spvOpcodeString(opcode) << " operand index " << operand_index; - - if (_.GetBitWidth(type_id) != bit_width) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected arithmetic operands to have the same bit width " - << "as Result Type: " - << spvOpcodeString(opcode) << " operand index " << operand_index; - } - break; - } - - case SpvOpDot: { - if (!_.IsFloatScalarType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected float scalar type as Result Type: " - << spvOpcodeString(opcode); - - uint32_t first_vector_num_components = 0; - - for (size_t operand_index = 2; operand_index < inst->num_operands; - ++operand_index) { - const uint32_t type_id = GetOperandTypeId(_, inst, operand_index); - - if (!type_id || !_.IsFloatVectorType(type_id)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected float vector as operand: " - << spvOpcodeString(opcode) << " operand index " << operand_index; - - - const uint32_t component_type = _.GetComponentType(type_id); - if (component_type != result_type) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected component type to be equal to Result Type: " - << spvOpcodeString(opcode) << " operand index " << operand_index; - - const uint32_t num_components = _.GetDimension(type_id); - if (operand_index == 2) { - first_vector_num_components = num_components; - } else if (num_components != first_vector_num_components) { - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected operands to have the same number of componenets: " - << spvOpcodeString(opcode); - } - } - break; - } - - case SpvOpVectorTimesScalar: { - if (!_.IsFloatVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected float vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t vector_type_id = GetOperandTypeId(_, inst, 2); - if (result_type != vector_type_id) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected vector operand type to be equal to Result Type: " - << spvOpcodeString(opcode); - - const uint32_t component_type = _.GetComponentType(vector_type_id); - - const uint32_t scalar_type_id = GetOperandTypeId(_, inst, 3); - if (component_type != scalar_type_id) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected scalar operand type to be equal to the component " - << "type of the vector operand: " - << spvOpcodeString(opcode); - - break; - } - - case SpvOpMatrixTimesScalar: { - if (!_.IsFloatMatrixType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected float matrix type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t matrix_type_id = GetOperandTypeId(_, inst, 2); - if (result_type != matrix_type_id) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected matrix operand type to be equal to Result Type: " - << spvOpcodeString(opcode); - - const uint32_t component_type = _.GetComponentType(matrix_type_id); - - const uint32_t scalar_type_id = GetOperandTypeId(_, inst, 3); - if (component_type != scalar_type_id) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected scalar operand type to be equal to the component " - << "type of the matrix operand: " - << spvOpcodeString(opcode); - - break; - } - - case SpvOpVectorTimesMatrix: { - const uint32_t vector_type_id = GetOperandTypeId(_, inst, 2); - const uint32_t matrix_type_id = GetOperandTypeId(_, inst, 3); - - if (!_.IsFloatVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected float vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t res_component_type = _.GetComponentType(result_type); - - if (!vector_type_id || !_.IsFloatVectorType(vector_type_id)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected float vector type as left operand: " - << spvOpcodeString(opcode); - - if (res_component_type != _.GetComponentType(vector_type_id)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected component types of Result Type and vector to be " - << "equal: " << spvOpcodeString(opcode); - - uint32_t matrix_num_rows = 0; - uint32_t matrix_num_cols = 0; - uint32_t matrix_col_type = 0; - uint32_t matrix_component_type = 0; - if (!_.GetMatrixTypeInfo(matrix_type_id, &matrix_num_rows, - &matrix_num_cols, &matrix_col_type, - &matrix_component_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected float matrix type as right operand: " - << spvOpcodeString(opcode); - - if (res_component_type != matrix_component_type) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected component types of Result Type and matrix to be " - << "equal: " << spvOpcodeString(opcode); - - if (matrix_num_cols != _.GetDimension(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected number of columns of the matrix to be equal to " - << "Result Type vector size: " << spvOpcodeString(opcode); - - if (matrix_num_rows != _.GetDimension(vector_type_id)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected number of rows of the matrix to be equal to the " - << "vector operand size: " << spvOpcodeString(opcode); - - break; - } - - case SpvOpMatrixTimesVector: { - const uint32_t matrix_type_id = GetOperandTypeId(_, inst, 2); - const uint32_t vector_type_id = GetOperandTypeId(_, inst, 3); - - if (!_.IsFloatVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected float vector type as Result Type: " - << spvOpcodeString(opcode); - - uint32_t matrix_num_rows = 0; - uint32_t matrix_num_cols = 0; - uint32_t matrix_col_type = 0; - uint32_t matrix_component_type = 0; - if (!_.GetMatrixTypeInfo(matrix_type_id, &matrix_num_rows, - &matrix_num_cols, &matrix_col_type, - &matrix_component_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected float matrix type as left operand: " - << spvOpcodeString(opcode); - - if (result_type != matrix_col_type) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected column type of the matrix to be equal to Result Type: " - << spvOpcodeString(opcode); - - if (!vector_type_id || !_.IsFloatVectorType(vector_type_id)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected float vector type as right operand: " - << spvOpcodeString(opcode); - - if (matrix_component_type != _.GetComponentType(vector_type_id)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected component types of the operands to be equal: " - << spvOpcodeString(opcode); - - if (matrix_num_cols != _.GetDimension(vector_type_id)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected number of columns of the matrix to be equal to the " - << "vector size: " << spvOpcodeString(opcode); - - break; - } - - case SpvOpMatrixTimesMatrix: { - const uint32_t left_type_id = GetOperandTypeId(_, inst, 2); - const uint32_t right_type_id = GetOperandTypeId(_, inst, 3); - - uint32_t res_num_rows = 0; - uint32_t res_num_cols = 0; - uint32_t res_col_type = 0; - uint32_t res_component_type = 0; - if (!_.GetMatrixTypeInfo(result_type, &res_num_rows, &res_num_cols, - &res_col_type, &res_component_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected float matrix type as Result Type: " - << spvOpcodeString(opcode); - - uint32_t left_num_rows = 0; - uint32_t left_num_cols = 0; - uint32_t left_col_type = 0; - uint32_t left_component_type = 0; - if (!_.GetMatrixTypeInfo(left_type_id, &left_num_rows, &left_num_cols, - &left_col_type, &left_component_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected float matrix type as left operand: " - << spvOpcodeString(opcode); - - uint32_t right_num_rows = 0; - uint32_t right_num_cols = 0; - uint32_t right_col_type = 0; - uint32_t right_component_type = 0; - if (!_.GetMatrixTypeInfo(right_type_id, &right_num_rows, &right_num_cols, - &right_col_type, &right_component_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected float matrix type as right operand: " - << spvOpcodeString(opcode); - - if (!_.IsFloatScalarType(res_component_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected float matrix type as Result Type: " - << spvOpcodeString(opcode); - - if (res_col_type != left_col_type) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected column types of Result Type and left matrix to be " - << "equal: " << spvOpcodeString(opcode); - - if (res_component_type != right_component_type) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected component types of Result Type and right matrix to be " - << "equal: " << spvOpcodeString(opcode); - - if (res_num_cols != right_num_cols) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected number of columns of Result Type and right matrix to " - << "be equal: " << spvOpcodeString(opcode); - - if (left_num_cols != right_num_rows) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected number of columns of left matrix and number of rows " - << "of right matrix to be equal: " << spvOpcodeString(opcode); - - assert(left_num_rows == res_num_rows); - break; - } - - case SpvOpOuterProduct: { - const uint32_t left_type_id = GetOperandTypeId(_, inst, 2); - const uint32_t right_type_id = GetOperandTypeId(_, inst, 3); - - uint32_t res_num_rows = 0; - uint32_t res_num_cols = 0; - uint32_t res_col_type = 0; - uint32_t res_component_type = 0; - if (!_.GetMatrixTypeInfo(result_type, &res_num_rows, &res_num_cols, - &res_col_type, &res_component_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected float matrix type as Result Type: " - << spvOpcodeString(opcode); - - if (left_type_id != res_col_type) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected column type of Result Type to be equal to the type " - << "of the left operand: " - << spvOpcodeString(opcode); - - if (!right_type_id || !_.IsFloatVectorType(right_type_id)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected float vector type as right operand: " - << spvOpcodeString(opcode); - - if (res_component_type != _.GetComponentType(right_type_id)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected component types of the operands to be equal: " - << spvOpcodeString(opcode); - - if (res_num_cols != _.GetDimension(right_type_id)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected number of columns of the matrix to be equal to the " - << "vector size of the right operand: " << spvOpcodeString(opcode); - - break; - } - - case SpvOpIAddCarry: - case SpvOpISubBorrow: - case SpvOpUMulExtended: - case SpvOpSMulExtended: { - std::vector result_types; - if (!_.GetStructMemberTypes(result_type, &result_types)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected a struct as Result Type: " - << spvOpcodeString(opcode); - - if (result_types.size() != 2) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Result Type struct to have two members: " - << spvOpcodeString(opcode); - - if (opcode == SpvOpSMulExtended) { - if (!_.IsIntScalarType(result_types[0]) && - !_.IsIntVectorType(result_types[0])) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Result Type struct member types to be integer scalar " - << "or vector: " << spvOpcodeString(opcode); - } else { - if (!_.IsUnsignedIntScalarType(result_types[0]) && - !_.IsUnsignedIntVectorType(result_types[0])) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Result Type struct member types to be unsigned " - << "integer scalar or vector: " << spvOpcodeString(opcode); - } - - if (result_types[0] != result_types[1]) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Result Type struct member types to be identical: " - << spvOpcodeString(opcode); - - const uint32_t left_type_id = GetOperandTypeId(_, inst, 2); - const uint32_t right_type_id = GetOperandTypeId(_, inst, 3); - - if (left_type_id != result_types[0] || right_type_id != result_types[0]) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected both operands to be of Result Type member type: " - << spvOpcodeString(opcode); - - break; - } - - default: - break; - } - - return SPV_SUCCESS; -} - -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_bitwise.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_bitwise.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_bitwise.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_bitwise.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,248 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Validates correctness of bitwise instructions. - -#include "validate.h" - -#include "diagnostic.h" -#include "opcode.h" -#include "val/instruction.h" -#include "val/validation_state.h" - -namespace libspirv { - -namespace { - -// Returns operand word for given instruction and operand index. -// The operand is expected to only have one word. -inline uint32_t GetOperandWord(const spv_parsed_instruction_t* inst, - size_t operand_index) { - assert(operand_index < inst->num_operands); - const spv_parsed_operand_t& operand = inst->operands[operand_index]; - assert(operand.num_words == 1); - return inst->words[operand.offset]; -} - -// Returns the type id of instruction operand at |operand_index|. -// The operand is expected to be an id. -inline uint32_t GetOperandTypeId(ValidationState_t& _, - const spv_parsed_instruction_t* inst, - size_t operand_index) { - return _.GetTypeId(GetOperandWord(inst, operand_index)); -} - -} - -// Validates correctness of bitwise instructions. -spv_result_t BitwisePass(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - const SpvOp opcode = static_cast(inst->opcode); - const uint32_t result_type = inst->type_id; - - switch (opcode) { - case SpvOpShiftRightLogical: - case SpvOpShiftRightArithmetic: - case SpvOpShiftLeftLogical: { - if (!_.IsIntScalarType(result_type) && - !_.IsIntVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected int scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t result_dimension = _.GetDimension(result_type); - const uint32_t base_type = GetOperandTypeId(_, inst, 2); - const uint32_t shift_type = GetOperandTypeId(_, inst, 3); - - if (!base_type || - (!_.IsIntScalarType(base_type) && !_.IsIntVectorType(base_type))) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Base to be int scalar or vector: " - << spvOpcodeString(opcode); - - if (_.GetDimension(base_type) != result_dimension) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Base to have the same dimension " - << "as Result Type: " - << spvOpcodeString(opcode); - - if (_.GetBitWidth(base_type) != _.GetBitWidth(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Base to have the same bit width " - << "as Result Type: " - << spvOpcodeString(opcode); - - if (!shift_type || - (!_.IsIntScalarType(shift_type) && !_.IsIntVectorType(shift_type))) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Shift to be int scalar or vector: " - << spvOpcodeString(opcode); - - if (_.GetDimension(shift_type) != result_dimension) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Shift to have the same dimension " - << "as Result Type: " - << spvOpcodeString(opcode); - break; - } - - case SpvOpBitwiseOr: - case SpvOpBitwiseXor: - case SpvOpBitwiseAnd: - case SpvOpNot: { - if (!_.IsIntScalarType(result_type) && - !_.IsIntVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected int scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t result_dimension = _.GetDimension(result_type); - const uint32_t result_bit_width = _.GetBitWidth(result_type); - - for (size_t operand_index = 2; operand_index < inst->num_operands; - ++operand_index) { - - const uint32_t type_id = GetOperandTypeId(_, inst, operand_index); - if (!type_id || - (!_.IsIntScalarType(type_id) && !_.IsIntVectorType(type_id))) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected int scalar or vector as operand: " - << spvOpcodeString(opcode) << " operand index " << operand_index; - - if (_.GetDimension(type_id) != result_dimension) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected operands to have the same dimension " - << "as Result Type: " - << spvOpcodeString(opcode) << " operand index " << operand_index; - - if (_.GetBitWidth(type_id) != result_bit_width) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected operands to have the same bit width " - << "as Result Type: " - << spvOpcodeString(opcode) << " operand index " << operand_index; - } - break; - } - - case SpvOpBitFieldInsert: { - if (!_.IsIntScalarType(result_type) && - !_.IsIntVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected int scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t base_type = GetOperandTypeId(_, inst, 2); - const uint32_t insert_type = GetOperandTypeId(_, inst, 3); - const uint32_t offset_type = GetOperandTypeId(_, inst, 4); - const uint32_t count_type = GetOperandTypeId(_, inst, 5); - - if (base_type != result_type) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Base Type to be equal to Result Type: " - << spvOpcodeString(opcode); - - if (insert_type != result_type) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Insert Type to be equal to Result Type: " - << spvOpcodeString(opcode); - - if (!offset_type || !_.IsIntScalarType(offset_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Offset Type to be int scalar: " - << spvOpcodeString(opcode); - - if (!count_type || !_.IsIntScalarType(count_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Count Type to be int scalar: " - << spvOpcodeString(opcode); - break; - } - - case SpvOpBitFieldSExtract: - case SpvOpBitFieldUExtract: { - if (!_.IsIntScalarType(result_type) && - !_.IsIntVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected int scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t base_type = GetOperandTypeId(_, inst, 2); - const uint32_t offset_type = GetOperandTypeId(_, inst, 3); - const uint32_t count_type = GetOperandTypeId(_, inst, 4); - - if (base_type != result_type) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Base Type to be equal to Result Type: " - << spvOpcodeString(opcode); - - if (!offset_type || !_.IsIntScalarType(offset_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Offset Type to be int scalar: " - << spvOpcodeString(opcode); - - if (!count_type || !_.IsIntScalarType(count_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Count Type to be int scalar: " - << spvOpcodeString(opcode); - break; - } - - case SpvOpBitReverse: { - if (!_.IsIntScalarType(result_type) && - !_.IsIntVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected int scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t base_type = GetOperandTypeId(_, inst, 2); - - if (base_type != result_type) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Base Type to be equal to Result Type: " - << spvOpcodeString(opcode); - break; - } - - case SpvOpBitCount: { - if (!_.IsIntScalarType(result_type) && - !_.IsIntVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected int scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t base_type = GetOperandTypeId(_, inst, 2); - if (!base_type || - (!_.IsIntScalarType(base_type) && !_.IsIntVectorType(base_type))) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Base Type to be int scalar or vector: " - << spvOpcodeString(opcode); - - const uint32_t base_dimension = _.GetDimension(base_type); - const uint32_t result_dimension = _.GetDimension(result_type); - - if (base_dimension != result_dimension) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Base dimension to be equal to Result Type dimension: " - << spvOpcodeString(opcode); - break; - } - - default: - break; - } - - return SPV_SUCCESS; -} - -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_capability.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_capability.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_capability.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_capability.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,130 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Validates OpCapability instruction. - -#include "validate.h" - -#include -#include - -#include "diagnostic.h" -#include "opcode.h" -#include "val/instruction.h" -#include "val/validation_state.h" - -namespace libspirv { - -namespace { - -bool IsSupportGuaranteedVulkan_1_0(uint32_t capability) { - switch (capability) { - case SpvCapabilityMatrix: - case SpvCapabilityShader: - case SpvCapabilityInputAttachment: - case SpvCapabilitySampled1D: - case SpvCapabilityImage1D: - case SpvCapabilitySampledBuffer: - case SpvCapabilityImageBuffer: - case SpvCapabilityImageQuery: - case SpvCapabilityDerivativeControl: - return true; - } - return false; -} - -bool IsSupportOptionalVulkan_1_0(uint32_t capability) { - switch (capability) { - case SpvCapabilityGeometry: - case SpvCapabilityTessellation: - case SpvCapabilityFloat64: - case SpvCapabilityInt64: - case SpvCapabilityInt16: - case SpvCapabilityTessellationPointSize: - case SpvCapabilityGeometryPointSize: - case SpvCapabilityImageGatherExtended: - case SpvCapabilityStorageImageMultisample: - case SpvCapabilityUniformBufferArrayDynamicIndexing: - case SpvCapabilitySampledImageArrayDynamicIndexing: - case SpvCapabilityStorageBufferArrayDynamicIndexing: - case SpvCapabilityStorageImageArrayDynamicIndexing: - case SpvCapabilityClipDistance: - case SpvCapabilityCullDistance: - case SpvCapabilityImageCubeArray: - case SpvCapabilitySampleRateShading: - case SpvCapabilitySparseResidency: - case SpvCapabilityMinLod: - case SpvCapabilitySampledCubeArray: - case SpvCapabilityImageMSArray: - case SpvCapabilityStorageImageExtendedFormats: - case SpvCapabilityInterpolationFunction: - case SpvCapabilityStorageImageReadWithoutFormat: - case SpvCapabilityStorageImageWriteWithoutFormat: - case SpvCapabilityMultiViewport: - return true; - } - return false; -} - -// Checks if |capability| was enabled by extension. -bool IsEnabledByExtension(ValidationState_t& _, uint32_t capability) { - spv_operand_desc operand_desc = nullptr; - _.grammar().lookupOperand( - SPV_OPERAND_TYPE_CAPABILITY, capability, &operand_desc); - - // operand_desc is expected to be not null, otherwise validator would have - // failed at an earlier stage. This 'assert' is 'just in case'. - assert(operand_desc); - - if (operand_desc->extensions.IsEmpty()) - return false; - - return _.HasAnyOfExtensions(operand_desc->extensions); -} - -} // namespace - -// Validates that capability declarations use operands allowed in the current -// context. -spv_result_t CapabilityPass(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - const SpvOp opcode = static_cast(inst->opcode); - if (opcode != SpvOpCapability) - return SPV_SUCCESS; - - assert(inst->num_operands == 1); - - const spv_parsed_operand_t& operand = inst->operands[0]; - - assert(operand.num_words == 1); - assert(operand.offset < inst->num_words); - - const uint32_t capability = inst->words[operand.offset]; - - const auto env = _.context()->target_env; - if (env == SPV_ENV_VULKAN_1_0) { - if (!IsSupportGuaranteedVulkan_1_0(capability) && - !IsSupportOptionalVulkan_1_0(capability) && - !IsEnabledByExtension(_, capability)) { - return _.diag(SPV_ERROR_INVALID_CAPABILITY) - << "Capability value " << capability - << " is not allowed by Vulkan 1.0 specification" - << " (or requires extension)"; - } - } - - return SPV_SUCCESS; -} - -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_cfg.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_cfg.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_cfg.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_cfg.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,424 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "validate.h" -#include "cfa.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "spirv_validator_options.h" -#include "val/basic_block.h" -#include "val/construct.h" -#include "val/function.h" -#include "val/validation_state.h" - -using std::find; -using std::function; -using std::get; -using std::ignore; -using std::make_pair; -using std::make_tuple; -using std::numeric_limits; -using std::pair; -using std::string; -using std::tie; -using std::transform; -using std::tuple; -using std::unordered_map; -using std::unordered_set; -using std::vector; - -using libspirv::BasicBlock; - -namespace libspirv { - -namespace { - -using bb_ptr = BasicBlock*; -using cbb_ptr = const BasicBlock*; -using bb_iter = vector::const_iterator; - -} // namespace - -void printDominatorList(const BasicBlock& b) { - std::cout << b.id() << " is dominated by: "; - const BasicBlock* bb = &b; - while (bb->immediate_dominator() != bb) { - bb = bb->immediate_dominator(); - std::cout << bb->id() << " "; - } -} - -#define CFG_ASSERT(ASSERT_FUNC, TARGET) \ - if (spv_result_t rcode = ASSERT_FUNC(_, TARGET)) return rcode - -spv_result_t FirstBlockAssert(ValidationState_t& _, uint32_t target) { - if (_.current_function().IsFirstBlock(target)) { - return _.diag(SPV_ERROR_INVALID_CFG) - << "First block " << _.getIdName(target) << " of function " - << _.getIdName(_.current_function().id()) << " is targeted by block " - << _.getIdName(_.current_function().current_block()->id()); - } - return SPV_SUCCESS; -} - -spv_result_t MergeBlockAssert(ValidationState_t& _, uint32_t merge_block) { - if (_.current_function().IsBlockType(merge_block, kBlockTypeMerge)) { - return _.diag(SPV_ERROR_INVALID_CFG) - << "Block " << _.getIdName(merge_block) - << " is already a merge block for another header"; - } - return SPV_SUCCESS; -} - -/// Update the continue construct's exit blocks once the backedge blocks are -/// identified in the CFG. -void UpdateContinueConstructExitBlocks( - Function& function, const vector>& back_edges) { - auto& constructs = function.constructs(); - // TODO(umar): Think of a faster way to do this - for (auto& edge : back_edges) { - uint32_t back_edge_block_id; - uint32_t loop_header_block_id; - tie(back_edge_block_id, loop_header_block_id) = edge; - auto is_this_header = [=](Construct& c) { - return c.type() == ConstructType::kLoop && - c.entry_block()->id() == loop_header_block_id; - }; - - for (auto construct : constructs) { - if (is_this_header(construct)) { - Construct* continue_construct = - construct.corresponding_constructs().back(); - assert(continue_construct->type() == ConstructType::kContinue); - - BasicBlock* back_edge_block; - tie(back_edge_block, ignore) = function.GetBlock(back_edge_block_id); - continue_construct->set_exit(back_edge_block); - } - } - } -} - -tuple ConstructNames(ConstructType type) { - string construct_name, header_name, exit_name; - - switch (type) { - case ConstructType::kSelection: - construct_name = "selection"; - header_name = "selection header"; - exit_name = "merge block"; - break; - case ConstructType::kLoop: - construct_name = "loop"; - header_name = "loop header"; - exit_name = "merge block"; - break; - case ConstructType::kContinue: - construct_name = "continue"; - header_name = "continue target"; - exit_name = "back-edge block"; - break; - case ConstructType::kCase: - construct_name = "case"; - header_name = "case entry block"; - exit_name = "case exit block"; - break; - default: - assert(1 == 0 && "Not defined type"); - } - - return make_tuple(construct_name, header_name, exit_name); -} - -/// Constructs an error message for construct validation errors -string ConstructErrorString(const Construct& construct, - const string& header_string, - const string& exit_string, - const string& dominate_text) { - string construct_name, header_name, exit_name; - tie(construct_name, header_name, exit_name) = - ConstructNames(construct.type()); - - // TODO(umar): Add header block for continue constructs to error message - return "The " + construct_name + " construct with the " + header_name + " " + - header_string + " " + dominate_text + " the " + exit_name + " " + - exit_string; -} - -spv_result_t StructuredControlFlowChecks( - const ValidationState_t& _, const Function& function, - const vector>& back_edges) { - /// Check all backedges target only loop headers and have exactly one - /// back-edge branching to it - - // Map a loop header to blocks with back-edges to the loop header. - std::map> loop_latch_blocks; - for (auto back_edge : back_edges) { - uint32_t back_edge_block; - uint32_t header_block; - tie(back_edge_block, header_block) = back_edge; - if (!function.IsBlockType(header_block, kBlockTypeLoop)) { - return _.diag(SPV_ERROR_INVALID_CFG) - << "Back-edges (" << _.getIdName(back_edge_block) << " -> " - << _.getIdName(header_block) - << ") can only be formed between a block and a loop header."; - } - loop_latch_blocks[header_block].insert(back_edge_block); - } - - // Check the loop headers have exactly one back-edge branching to it - for (BasicBlock* loop_header : function.ordered_blocks()) { - if (!loop_header->reachable()) continue; - if (!loop_header->is_type(kBlockTypeLoop)) continue; - auto loop_header_id = loop_header->id(); - auto num_latch_blocks = loop_latch_blocks[loop_header_id].size(); - if (num_latch_blocks != 1) { - return _.diag(SPV_ERROR_INVALID_CFG) - << "Loop header " << _.getIdName(loop_header_id) - << " is targeted by " << num_latch_blocks - << " back-edge blocks but the standard requires exactly one"; - } - } - - // Check construct rules - for (const Construct& construct : function.constructs()) { - auto header = construct.entry_block(); - auto merge = construct.exit_block(); - - if (header->reachable() && !merge) { - string construct_name, header_name, exit_name; - tie(construct_name, header_name, exit_name) = - ConstructNames(construct.type()); - return _.diag(SPV_ERROR_INTERNAL) - << "Construct " + construct_name + " with " + header_name + " " + - _.getIdName(header->id()) + " does not have a " + - exit_name + ". This may be a bug in the validator."; - } - - // If the exit block is reachable then it's dominated by the - // header. - if (merge && merge->reachable()) { - if (!header->dominates(*merge)) { - return _.diag(SPV_ERROR_INVALID_CFG) << ConstructErrorString( - construct, _.getIdName(header->id()), - _.getIdName(merge->id()), "does not dominate"); - } - // If it's really a merge block for a selection or loop, then it must be - // *strictly* dominated by the header. - if (construct.ExitBlockIsMergeBlock() && (header == merge)) { - return _.diag(SPV_ERROR_INVALID_CFG) << ConstructErrorString( - construct, _.getIdName(header->id()), - _.getIdName(merge->id()), "does not strictly dominate"); - } - } - // Check post-dominance for continue constructs. But dominance and - // post-dominance only make sense when the construct is reachable. - if (header->reachable() && construct.type() == ConstructType::kContinue) { - if (!merge->postdominates(*header)) { - return _.diag(SPV_ERROR_INVALID_CFG) << ConstructErrorString( - construct, _.getIdName(header->id()), - _.getIdName(merge->id()), "is not post dominated by"); - } - } - // TODO(umar): an OpSwitch block dominates all its defined case - // constructs - // TODO(umar): each case construct has at most one branch to another - // case construct - // TODO(umar): each case construct is branched to by at most one other - // case construct - // TODO(umar): if Target T1 branches to Target T2, or if Target T1 - // branches to the Default and the Default branches to Target T2, then - // T1 must immediately precede T2 in the list of the OpSwitch Target - // operands - } - return SPV_SUCCESS; -} - -spv_result_t PerformCfgChecks(ValidationState_t& _) { - for (auto& function : _.functions()) { - // Check all referenced blocks are defined within a function - if (function.undefined_block_count() != 0) { - string undef_blocks("{"); - for (auto undefined_block : function.undefined_blocks()) { - undef_blocks += _.getIdName(undefined_block) + " "; - } - return _.diag(SPV_ERROR_INVALID_CFG) - << "Block(s) " << undef_blocks << "\b}" - << " are referenced but not defined in function " - << _.getIdName(function.id()); - } - - // Set each block's immediate dominator and immediate postdominator, - // and find all back-edges. - // - // We want to analyze all the blocks in the function, even in degenerate - // control flow cases including unreachable blocks. So use the augmented - // CFG to ensure we cover all the blocks. - vector postorder; - vector postdom_postorder; - vector> back_edges; - auto ignore_block = [](cbb_ptr) {}; - auto ignore_edge = [](cbb_ptr, cbb_ptr) {}; - if (!function.ordered_blocks().empty()) { - /// calculate dominators - spvtools::CFA::DepthFirstTraversal( - function.first_block(), function.AugmentedCFGSuccessorsFunction(), - ignore_block, [&](cbb_ptr b) { postorder.push_back(b); }, - ignore_edge); - auto edges = spvtools::CFA::CalculateDominators( - postorder, function.AugmentedCFGPredecessorsFunction()); - for (auto edge : edges) { - edge.first->SetImmediateDominator(edge.second); - } - - /// calculate post dominators - spvtools::CFA::DepthFirstTraversal( - function.pseudo_exit_block(), - function.AugmentedCFGPredecessorsFunction(), ignore_block, - [&](cbb_ptr b) { postdom_postorder.push_back(b); }, ignore_edge); - auto postdom_edges = spvtools::CFA::CalculateDominators( - postdom_postorder, function.AugmentedCFGSuccessorsFunction()); - for (auto edge : postdom_edges) { - edge.first->SetImmediatePostDominator(edge.second); - } - /// calculate back edges. - spvtools::CFA::DepthFirstTraversal( - function.pseudo_entry_block(), - function - .AugmentedCFGSuccessorsFunctionIncludingHeaderToContinueEdge(), - ignore_block, ignore_block, [&](cbb_ptr from, cbb_ptr to) { - back_edges.emplace_back(from->id(), to->id()); - }); - } - UpdateContinueConstructExitBlocks(function, back_edges); - - auto& blocks = function.ordered_blocks(); - if (!blocks.empty()) { - // Check if the order of blocks in the binary appear before the blocks - // they dominate - for (auto block = begin(blocks) + 1; block != end(blocks); ++block) { - if (auto idom = (*block)->immediate_dominator()) { - if (idom != function.pseudo_entry_block() && - block == std::find(begin(blocks), block, idom)) { - return _.diag(SPV_ERROR_INVALID_CFG) - << "Block " << _.getIdName((*block)->id()) - << " appears in the binary before its dominator " - << _.getIdName(idom->id()); - } - } - } - // If we have structed control flow, check that no block has a control - // flow nesting depth larger than the limit. - if (_.HasCapability(SpvCapabilityShader)) { - const int control_flow_nesting_depth_limit = - _.options()->universal_limits_.max_control_flow_nesting_depth; - for (auto block = begin(blocks); block != end(blocks); ++block) { - if (function.GetBlockDepth(*block) > - control_flow_nesting_depth_limit) { - return _.diag(SPV_ERROR_INVALID_CFG) - << "Maximum Control Flow nesting depth exceeded."; - } - } - } - } - - /// Structured control flow checks are only required for shader capabilities - if (_.HasCapability(SpvCapabilityShader)) { - if (auto error = StructuredControlFlowChecks(_, function, back_edges)) - return error; - } - } - return SPV_SUCCESS; -} - -spv_result_t CfgPass(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - SpvOp opcode = static_cast(inst->opcode); - switch (opcode) { - case SpvOpLabel: - if (auto error = _.current_function().RegisterBlock(inst->result_id)) - return error; - break; - case SpvOpLoopMerge: { - uint32_t merge_block = inst->words[inst->operands[0].offset]; - uint32_t continue_block = inst->words[inst->operands[1].offset]; - CFG_ASSERT(MergeBlockAssert, merge_block); - - if (auto error = _.current_function().RegisterLoopMerge(merge_block, - continue_block)) - return error; - } break; - case SpvOpSelectionMerge: { - uint32_t merge_block = inst->words[inst->operands[0].offset]; - CFG_ASSERT(MergeBlockAssert, merge_block); - - if (auto error = _.current_function().RegisterSelectionMerge(merge_block)) - return error; - } break; - case SpvOpBranch: { - uint32_t target = inst->words[inst->operands[0].offset]; - CFG_ASSERT(FirstBlockAssert, target); - - _.current_function().RegisterBlockEnd({target}, opcode); - } break; - case SpvOpBranchConditional: { - uint32_t tlabel = inst->words[inst->operands[1].offset]; - uint32_t flabel = inst->words[inst->operands[2].offset]; - CFG_ASSERT(FirstBlockAssert, tlabel); - CFG_ASSERT(FirstBlockAssert, flabel); - - _.current_function().RegisterBlockEnd({tlabel, flabel}, opcode); - } break; - - case SpvOpSwitch: { - vector cases; - for (int i = 1; i < inst->num_operands; i += 2) { - uint32_t target = inst->words[inst->operands[i].offset]; - CFG_ASSERT(FirstBlockAssert, target); - cases.push_back(target); - } - _.current_function().RegisterBlockEnd({cases}, opcode); - } break; - case SpvOpReturn: { - const uint32_t return_type = _.current_function().GetResultTypeId(); - const Instruction* return_type_inst = _.FindDef(return_type); - assert(return_type_inst); - if (return_type_inst->opcode() != SpvOpTypeVoid) - return _.diag(SPV_ERROR_INVALID_CFG) - << "OpReturn can only be called from a function with void " - << "return type."; - } - // Fallthrough. - case SpvOpKill: - case SpvOpReturnValue: - case SpvOpUnreachable: - _.current_function().RegisterBlockEnd(vector(), opcode); - break; - default: - break; - } - return SPV_SUCCESS; -} -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_conversion.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_conversion.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_conversion.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_conversion.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,419 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Validates correctness of conversion instructions. - -#include "validate.h" - -#include "diagnostic.h" -#include "opcode.h" -#include "val/instruction.h" -#include "val/validation_state.h" - -namespace libspirv { - -// Validates correctness of conversion instructions. -spv_result_t ConversionPass(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - const SpvOp opcode = static_cast(inst->opcode); - const uint32_t result_type = inst->type_id; - - switch (opcode) { - case SpvOpConvertFToU: { - if (!_.IsUnsignedIntScalarType(result_type) && - !_.IsUnsignedIntVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected unsigned int scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t input_type = _.GetOperandTypeId(inst, 2); - if (!input_type || (!_.IsFloatScalarType(input_type) && - !_.IsFloatVectorType(input_type))) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to be float scalar or vector: " - << spvOpcodeString(opcode); - - if (_.GetDimension(result_type) != _.GetDimension(input_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to have the same dimension as Result Type: " - << spvOpcodeString(opcode); - - break; - } - - case SpvOpConvertFToS: { - if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected int scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t input_type = _.GetOperandTypeId(inst, 2); - if (!input_type || (!_.IsFloatScalarType(input_type) && - !_.IsFloatVectorType(input_type))) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to be float scalar or vector: " - << spvOpcodeString(opcode); - - if (_.GetDimension(result_type) != _.GetDimension(input_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to have the same dimension as Result Type: " - << spvOpcodeString(opcode); - - break; - } - - case SpvOpConvertSToF: - case SpvOpConvertUToF: { - if (!_.IsFloatScalarType(result_type) && - !_.IsFloatVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected float scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t input_type = _.GetOperandTypeId(inst, 2); - if (!input_type || (!_.IsIntScalarType(input_type) && - !_.IsIntVectorType(input_type))) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to be int scalar or vector: " - << spvOpcodeString(opcode); - - if (_.GetDimension(result_type) != _.GetDimension(input_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to have the same dimension as Result Type: " - << spvOpcodeString(opcode); - - break; - } - -#if 0 - // TODO(atgoo@github.com) Reenable this once VulkanCTS can pass this test. - case SpvOpUConvert: { - if (!_.IsUnsignedIntScalarType(result_type) && - !_.IsUnsignedIntVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected unsigned int scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t input_type = _.GetOperandTypeId(inst, 2); - if (!input_type || (!_.IsIntScalarType(input_type) && - !_.IsIntVectorType(input_type))) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to be int scalar or vector: " - << spvOpcodeString(opcode); - - if (_.GetDimension(result_type) != _.GetDimension(input_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to have the same dimension as Result Type: " - << spvOpcodeString(opcode); - - if (_.GetBitWidth(result_type) == _.GetBitWidth(input_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to have different bit width from Result Type: " - << spvOpcodeString(opcode); - break; - } -#endif - - case SpvOpSConvert: { - if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected int scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t input_type = _.GetOperandTypeId(inst, 2); - if (!input_type || (!_.IsIntScalarType(input_type) && - !_.IsIntVectorType(input_type))) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to be int scalar or vector: " - << spvOpcodeString(opcode); - - if (_.GetDimension(result_type) != _.GetDimension(input_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to have the same dimension as Result Type: " - << spvOpcodeString(opcode); - - if (_.GetBitWidth(result_type) == _.GetBitWidth(input_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to have different bit width from Result Type: " - << spvOpcodeString(opcode); - break; - } - - case SpvOpFConvert: { - if (!_.IsFloatScalarType(result_type) && - !_.IsFloatVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected float scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t input_type = _.GetOperandTypeId(inst, 2); - if (!input_type || (!_.IsFloatScalarType(input_type) && - !_.IsFloatVectorType(input_type))) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to be float scalar or vector: " - << spvOpcodeString(opcode); - - if (_.GetDimension(result_type) != _.GetDimension(input_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to have the same dimension as Result Type: " - << spvOpcodeString(opcode); - - if (_.GetBitWidth(result_type) == _.GetBitWidth(input_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to have different bit width from Result Type: " - << spvOpcodeString(opcode); - break; - } - - case SpvOpQuantizeToF16: { - if ((!_.IsFloatScalarType(result_type) && - !_.IsFloatVectorType(result_type)) || - _.GetBitWidth(result_type) != 32) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected 32-bit float scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t input_type = _.GetOperandTypeId(inst, 2); - if (input_type != result_type) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input type to be equal to Result Type: " - << spvOpcodeString(opcode); - break; - } - - case SpvOpConvertPtrToU: { - if (!_.IsUnsignedIntScalarType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected unsigned int scalar type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t input_type = _.GetOperandTypeId(inst, 2); - if (!_.IsPointerType(input_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to be a pointer: " << spvOpcodeString(opcode); - break; - } - - case SpvOpSatConvertSToU: - case SpvOpSatConvertUToS: { - if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected int scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t input_type = _.GetOperandTypeId(inst, 2); - if (!input_type || (!_.IsIntScalarType(input_type) && - !_.IsIntVectorType(input_type))) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected int scalar or vector as input: " - << spvOpcodeString(opcode); - - if (_.GetDimension(result_type) != _.GetDimension(input_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to have the same dimension as Result Type: " - << spvOpcodeString(opcode); - break; - } - - case SpvOpConvertUToPtr: { - if (!_.IsPointerType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Result Type to be a pointer: " - << spvOpcodeString(opcode); - - const uint32_t input_type = _.GetOperandTypeId(inst, 2); - if (!_.IsIntScalarType(input_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected int scalar as input: " << spvOpcodeString(opcode); - break; - } - - case SpvOpPtrCastToGeneric: { - uint32_t result_storage_class = 0; - uint32_t result_data_type = 0; - if (!_.GetPointerTypeInfo(result_type, &result_data_type, - &result_storage_class)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Result Type to be a pointer: " - << spvOpcodeString(opcode); - - if (result_storage_class != SpvStorageClassGeneric) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Result Type to have storage class Generic: " - << spvOpcodeString(opcode); - - const uint32_t input_type = _.GetOperandTypeId(inst, 2); - uint32_t input_storage_class = 0; - uint32_t input_data_type = 0; - if (!_.GetPointerTypeInfo(input_type, &input_data_type, - &input_storage_class)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to be a pointer: " - << spvOpcodeString(opcode); - - if (input_storage_class != SpvStorageClassWorkgroup && - input_storage_class != SpvStorageClassCrossWorkgroup && - input_storage_class != SpvStorageClassFunction) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to have storage class Workgroup, " - << "CrossWorkgroup or Function: " - << spvOpcodeString(opcode); - - if (result_data_type != input_data_type) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input and Result Type to point to the same type: " - << spvOpcodeString(opcode); - break; - } - - case SpvOpGenericCastToPtr: { - uint32_t result_storage_class = 0; - uint32_t result_data_type = 0; - if (!_.GetPointerTypeInfo(result_type, &result_data_type, - &result_storage_class)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Result Type to be a pointer: " - << spvOpcodeString(opcode); - - if (result_storage_class != SpvStorageClassWorkgroup && - result_storage_class != SpvStorageClassCrossWorkgroup && - result_storage_class != SpvStorageClassFunction) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Result Type to have storage class Workgroup, " - << "CrossWorkgroup or Function: " - << spvOpcodeString(opcode); - - const uint32_t input_type = _.GetOperandTypeId(inst, 2); - uint32_t input_storage_class = 0; - uint32_t input_data_type = 0; - if (!_.GetPointerTypeInfo(input_type, &input_data_type, - &input_storage_class)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to be a pointer: " - << spvOpcodeString(opcode); - - if (input_storage_class != SpvStorageClassGeneric) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to have storage class Generic: " - << spvOpcodeString(opcode); - - if (result_data_type != input_data_type) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input and Result Type to point to the same type: " - << spvOpcodeString(opcode); - break; - } - - case SpvOpGenericCastToPtrExplicit: { - uint32_t result_storage_class = 0; - uint32_t result_data_type = 0; - if (!_.GetPointerTypeInfo(result_type, &result_data_type, - &result_storage_class)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Result Type to be a pointer: " - << spvOpcodeString(opcode); - - const uint32_t target_storage_class = inst->words[4]; - if (result_storage_class != target_storage_class) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Result Type to be of target storage class: " - << spvOpcodeString(opcode); - - const uint32_t input_type = _.GetOperandTypeId(inst, 2); - uint32_t input_storage_class = 0; - uint32_t input_data_type = 0; - if (!_.GetPointerTypeInfo(input_type, &input_data_type, - &input_storage_class)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to be a pointer: " - << spvOpcodeString(opcode); - - if (input_storage_class != SpvStorageClassGeneric) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to have storage class Generic: " - << spvOpcodeString(opcode); - - if (result_data_type != input_data_type) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input and Result Type to point to the same type: " - << spvOpcodeString(opcode); - - if (target_storage_class != SpvStorageClassWorkgroup && - target_storage_class != SpvStorageClassCrossWorkgroup && - target_storage_class != SpvStorageClassFunction) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected target storage class to be Workgroup, " - << "CrossWorkgroup or Function: " - << spvOpcodeString(opcode); - break; - } - - case SpvOpBitcast: { - const uint32_t input_type = _.GetOperandTypeId(inst, 2); - if (!input_type) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to have a type: " << spvOpcodeString(opcode); - - const bool result_is_pointer = _.IsPointerType(result_type); - const bool result_is_int_scalar = _.IsIntScalarType(result_type); - const bool input_is_pointer = _.IsPointerType(input_type); - const bool input_is_int_scalar = _.IsIntScalarType(input_type); - - if (!result_is_pointer && !result_is_int_scalar && - !_.IsIntVectorType(result_type) && - !_.IsFloatScalarType(result_type) && - !_.IsFloatVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected Result Type to be a pointer or int or float vector " - << "or scalar type: " << spvOpcodeString(opcode); - - if (!input_is_pointer && !input_is_int_scalar && - !_.IsIntVectorType(input_type) && - !_.IsFloatScalarType(input_type) && - !_.IsFloatVectorType(input_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to be a pointer or int or float vector " - << "or scalar: " << spvOpcodeString(opcode); - - if (result_is_pointer && !input_is_pointer && !input_is_int_scalar) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to be a pointer or int scalar if Result Type " - << "is pointer: " << spvOpcodeString(opcode); - - if (input_is_pointer && !result_is_pointer && !result_is_int_scalar) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Pointer can only be converted to another pointer or int " - << "scalar: " << spvOpcodeString(opcode); - - if (!result_is_pointer && !input_is_pointer) { - const uint32_t result_size = - _.GetBitWidth(result_type) * _.GetDimension(result_type); - const uint32_t input_size = - _.GetBitWidth(input_type) * _.GetDimension(input_type); - if (result_size != input_size) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected input to have the same total bit width as " - << "Result Type: " << spvOpcodeString(opcode); - } - break; - } - - default: - break; - } - - return SPV_SUCCESS; -} - -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/validate.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/validate.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,408 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "validate.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "binary.h" -#include "diagnostic.h" -#include "enum_string_mapping.h" -#include "extensions.h" -#include "instruction.h" -#include "opcode.h" -#include "operand.h" -#include "spirv-tools/libspirv.h" -#include "spirv_constant.h" -#include "spirv_endian.h" -#include "spirv_validator_options.h" -#include "val/construct.h" -#include "val/function.h" -#include "val/validation_state.h" - -using std::function; -using std::ostream_iterator; -using std::placeholders::_1; -using std::string; -using std::stringstream; -using std::transform; -using std::vector; - -using libspirv::CfgPass; -using libspirv::Extension; -using libspirv::InstructionPass; -using libspirv::ModuleLayoutPass; -using libspirv::DataRulesPass; -using libspirv::IdPass; -using libspirv::ValidationState_t; - -spv_result_t spvValidateIDs(const spv_instruction_t* pInsts, - const uint64_t count, - const spv_opcode_table opcodeTable, - const spv_operand_table operandTable, - const spv_ext_inst_table extInstTable, - const ValidationState_t& state, - spv_position position) { - position->index = SPV_INDEX_INSTRUCTION; - if (auto error = - spvValidateInstructionIDs(pInsts, count, opcodeTable, operandTable, - extInstTable, state, position)) - return error; - return SPV_SUCCESS; -} - -namespace { - -// TODO(umar): Validate header -// TODO(umar): The binary parser validates the magic word, and the length of the -// header, but nothing else. -spv_result_t setHeader(void* user_data, spv_endianness_t endian, uint32_t magic, - uint32_t version, uint32_t generator, uint32_t id_bound, - uint32_t reserved) { - // Record the ID bound so that the validator can ensure no ID is out of bound. - ValidationState_t& _ = *(reinterpret_cast(user_data)); - _.setIdBound(id_bound); - - (void)endian; - (void)magic; - (void)version; - (void)generator; - (void)id_bound; - (void)reserved; - return SPV_SUCCESS; -} - -// Improves diagnostic messages by collecting names of IDs -// NOTE: This function returns void and is not involved in validation -void DebugInstructionPass(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - switch (inst->opcode) { - case SpvOpName: { - const uint32_t target = *(inst->words + inst->operands[0].offset); - const char* str = - reinterpret_cast(inst->words + inst->operands[1].offset); - _.AssignNameToId(target, str); - } break; - case SpvOpMemberName: { - const uint32_t target = *(inst->words + inst->operands[0].offset); - const char* str = - reinterpret_cast(inst->words + inst->operands[2].offset); - _.AssignNameToId(target, str); - } break; - case SpvOpSourceContinued: - case SpvOpSource: - case SpvOpSourceExtension: - case SpvOpString: - case SpvOpLine: - case SpvOpNoLine: - - default: - break; - } -} - -// Parses OpExtension instruction and registers extension. -void RegisterExtension(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - const std::string extension_str = libspirv::GetExtensionString(inst); - Extension extension; - if (!GetExtensionFromString(extension_str, &extension)) { - // The error will be logged in the ProcessInstruction pass. - return; - } - - _.RegisterExtension(extension); -} - -// Parses the beginning of the module searching for OpExtension instructions. -// Registers extensions if recognized. Returns SPV_REQUESTED_TERMINATION -// once an instruction which is not SpvOpCapability and SpvOpExtension is -// encountered. According to the SPIR-V spec extensions are declared after -// capabilities and before everything else. -spv_result_t ProcessExtensions( - void* user_data, const spv_parsed_instruction_t* inst) { - const SpvOp opcode = static_cast(inst->opcode); - if (opcode == SpvOpCapability) - return SPV_SUCCESS; - - if (opcode == SpvOpExtension) { - ValidationState_t& _ = *(reinterpret_cast(user_data)); - RegisterExtension(_, inst); - return SPV_SUCCESS; - } - - // OpExtension block is finished, requesting termination. - return SPV_REQUESTED_TERMINATION; -} - -spv_result_t ProcessInstruction(void* user_data, - const spv_parsed_instruction_t* inst) { - ValidationState_t& _ = *(reinterpret_cast(user_data)); - _.increment_instruction_count(); - if (static_cast(inst->opcode) == SpvOpEntryPoint) { - const auto entry_point = inst->words[2]; - _.RegisterEntryPointId(entry_point); - // Operand 3 and later are the of interfaces for the entry point. - for (int i = 3; i < inst->num_operands; ++i) { - _.RegisterInterfaceForEntryPoint(entry_point, - inst->words[inst->operands[i].offset]); - } - } - if (static_cast(inst->opcode) == SpvOpFunctionCall) { - _.AddFunctionCallTarget(inst->words[3]); - } - - DebugInstructionPass(_, inst); - if (auto error = CapabilityPass(_, inst)) return error; - if (auto error = DataRulesPass(_, inst)) return error; - if (auto error = IdPass(_, inst)) return error; - if (auto error = ModuleLayoutPass(_, inst)) return error; - if (auto error = CfgPass(_, inst)) return error; - if (auto error = InstructionPass(_, inst)) return error; - if (auto error = TypeUniquePass(_, inst)) return error; - if (auto error = ArithmeticsPass(_, inst)) return error; - if (auto error = ConversionPass(_, inst)) return error; - if (auto error = LogicalsPass(_, inst)) return error; - if (auto error = BitwisePass(_, inst)) return error; - - return SPV_SUCCESS; -} - -void printDot(const ValidationState_t& _, const libspirv::BasicBlock& other) { - string block_string; - if (other.successors()->empty()) { - block_string += "end "; - } else { - for (auto block : *other.successors()) { - block_string += _.getIdOrName(block->id()) + " "; - } - } - printf("%10s -> {%s\b}\n", _.getIdOrName(other.id()).c_str(), - block_string.c_str()); -} - -void PrintBlocks(ValidationState_t& _, libspirv::Function func) { - assert(func.first_block()); - - printf("%10s -> %s\n", _.getIdOrName(func.id()).c_str(), - _.getIdOrName(func.first_block()->id()).c_str()); - for (const auto& block : func.ordered_blocks()) { - printDot(_, *block); - } -} - -#ifdef __clang__ -#define UNUSED(func) [[gnu::unused]] func -#elif defined(__GNUC__) -#define UNUSED(func) \ - func __attribute__((unused)); \ - func -#elif defined(_MSC_VER) -#define UNUSED(func) func -#endif - -UNUSED(void PrintDotGraph(ValidationState_t& _, libspirv::Function func)) { - if (func.first_block()) { - string func_name(_.getIdOrName(func.id())); - printf("digraph %s {\n", func_name.c_str()); - PrintBlocks(_, func); - printf("}\n"); - } -} -} // anonymous namespace - -spv_result_t spvValidate(const spv_const_context context, - const spv_const_binary binary, - spv_diagnostic* pDiagnostic) { - return spvValidateBinary(context, binary->code, binary->wordCount, - pDiagnostic); -} - -spv_result_t ValidateBinaryUsingContextAndValidationState( - const spv_context_t& context, const uint32_t* words, const size_t num_words, - spv_diagnostic* pDiagnostic, ValidationState_t* vstate) { - auto binary = std::unique_ptr( - new spv_const_binary_t{words, num_words}); - - spv_endianness_t endian; - spv_position_t position = {}; - if (spvBinaryEndianness(binary.get(), &endian)) { - return libspirv::DiagnosticStream(position, context.consumer, - SPV_ERROR_INVALID_BINARY) - << "Invalid SPIR-V magic number."; - } - - spv_header_t header; - if (spvBinaryHeaderGet(binary.get(), endian, &header)) { - return libspirv::DiagnosticStream(position, context.consumer, - SPV_ERROR_INVALID_BINARY) - << "Invalid SPIR-V header."; - } - - // Look for OpExtension instructions and register extensions. - // Diagnostics if any will be produced in the next pass (ProcessInstruction). - spvBinaryParse(&context, vstate, words, num_words, - /* parsed_header = */ nullptr, ProcessExtensions, - /* diagnostic = */ nullptr); - - // NOTE: Parse the module and perform inline validation checks. These - // checks do not require the the knowledge of the whole module. - if (auto error = spvBinaryParse(&context, vstate, words, num_words, - setHeader, ProcessInstruction, pDiagnostic)) - return error; - - if (vstate->in_function_body()) - return vstate->diag(SPV_ERROR_INVALID_LAYOUT) - << "Missing OpFunctionEnd at end of module."; - - // TODO(umar): Add validation checks which require the parsing of the entire - // module. Use the information from the ProcessInstruction pass to make the - // checks. - if (vstate->unresolved_forward_id_count() > 0) { - stringstream ss; - vector ids = vstate->UnresolvedForwardIds(); - - transform(begin(ids), end(ids), ostream_iterator(ss, " "), - bind(&ValidationState_t::getIdName, std::ref(*vstate), _1)); - - auto id_str = ss.str(); - return vstate->diag(SPV_ERROR_INVALID_ID) - << "The following forward referenced IDs have not been defined:\n" - << id_str.substr(0, id_str.size() - 1); - } - - // CFG checks are performed after the binary has been parsed - // and the CFGPass has collected information about the control flow - if (auto error = PerformCfgChecks(*vstate)) return error; - if (auto error = UpdateIdUse(*vstate)) return error; - if (auto error = CheckIdDefinitionDominateUse(*vstate)) return error; - if (auto error = ValidateDecorations(*vstate)) return error; - - // Entry point validation. Based on 2.16.1 (Universal Validation Rules) of the - // SPIRV spec: - // * There is at least one OpEntryPoint instruction, unless the Linkage - // capability is being used. - // * No function can be targeted by both an OpEntryPoint instruction and an - // OpFunctionCall instruction. - if (vstate->entry_points().empty() && - !vstate->HasCapability(SpvCapabilityLinkage)) { - return vstate->diag(SPV_ERROR_INVALID_BINARY) - << "No OpEntryPoint instruction was found. This is only allowed if " - "the Linkage capability is being used."; - } - for (const auto& entry_point : vstate->entry_points()) { - if (vstate->IsFunctionCallTarget(entry_point)) { - return vstate->diag(SPV_ERROR_INVALID_BINARY) - << "A function (" << entry_point - << ") may not be targeted by both an OpEntryPoint instruction and " - "an OpFunctionCall instruction."; - } - } - - // NOTE: Copy each instruction for easier processing - std::vector instructions; - // Expect average instruction length to be a bit over 2 words. - instructions.reserve(binary->wordCount / 2); - uint64_t index = SPV_INDEX_INSTRUCTION; - while (index < binary->wordCount) { - uint16_t wordCount; - uint16_t opcode; - spvOpcodeSplit(spvFixWord(binary->code[index], endian), &wordCount, - &opcode); - spv_instruction_t inst; - spvInstructionCopy(&binary->code[index], static_cast(opcode), - wordCount, endian, &inst); - instructions.emplace_back(std::move(inst)); - index += wordCount; - } - - position.index = SPV_INDEX_INSTRUCTION; - return spvValidateIDs(instructions.data(), instructions.size(), - context.opcode_table, - context.operand_table, - context.ext_inst_table, *vstate, &position); -} - -spv_result_t spvValidateBinary(const spv_const_context context, - const uint32_t* words, const size_t num_words, - spv_diagnostic* pDiagnostic) { - spv_context_t hijack_context = *context; - if (pDiagnostic) { - *pDiagnostic = nullptr; - libspirv::UseDiagnosticAsMessageConsumer(&hijack_context, pDiagnostic); - } - - // This interface is used for default command line options. - spv_validator_options default_options = spvValidatorOptionsCreate(); - - // Create the ValidationState using the context and default options. - ValidationState_t vstate(&hijack_context, default_options); - - spv_result_t result = ValidateBinaryUsingContextAndValidationState( - hijack_context, words, num_words, pDiagnostic, &vstate); - - spvValidatorOptionsDestroy(default_options); - return result; -} - -spv_result_t spvValidateWithOptions(const spv_const_context context, - spv_const_validator_options options, - const spv_const_binary binary, - spv_diagnostic* pDiagnostic) { - spv_context_t hijack_context = *context; - if (pDiagnostic) { - *pDiagnostic = nullptr; - libspirv::UseDiagnosticAsMessageConsumer(&hijack_context, pDiagnostic); - } - - // Create the ValidationState using the context. - ValidationState_t vstate(&hijack_context, options); - - return ValidateBinaryUsingContextAndValidationState( - hijack_context, binary->code, binary->wordCount, pDiagnostic, &vstate); -} - -namespace spvtools { - -spv_result_t ValidateBinaryAndKeepValidationState( - const spv_const_context context, spv_const_validator_options options, - const uint32_t* words, const size_t num_words, spv_diagnostic* pDiagnostic, - std::unique_ptr* vstate) { - spv_context_t hijack_context = *context; - if (pDiagnostic) { - *pDiagnostic = nullptr; - libspirv::UseDiagnosticAsMessageConsumer(&hijack_context, pDiagnostic); - } - - vstate->reset(new ValidationState_t(&hijack_context, options)); - - return ValidateBinaryUsingContextAndValidationState( - hijack_context, words, num_words, pDiagnostic, vstate->get()); -} - -spv_result_t ValidateInstructionAndUpdateValidationState( - ValidationState_t* vstate, const spv_parsed_instruction_t* inst) { - return ProcessInstruction(vstate, inst); -} - -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_datarules.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_datarules.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_datarules.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_datarules.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,273 +0,0 @@ -// Copyright (c) 2016 Google 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. - -// Ensures Data Rules are followed according to the specifications. - -#include "validate.h" - -#include -#include -#include - -#include "diagnostic.h" -#include "opcode.h" -#include "operand.h" -#include "val/instruction.h" -#include "val/validation_state.h" - -using libspirv::CapabilitySet; -using libspirv::DiagnosticStream; -using libspirv::ValidationState_t; - -namespace { - -// Validates that the number of components in the vector is valid. -// Vector types can only be parameterized as having 2, 3, or 4 components. -// If the Vector16 capability is added, 8 and 16 components are also allowed. -spv_result_t ValidateVecNumComponents(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - // Operand 2 specifies the number of components in the vector. - const uint32_t num_components = inst->words[inst->operands[2].offset]; - if (num_components == 2 || num_components == 3 || num_components == 4) { - return SPV_SUCCESS; - } - if (num_components == 8 || num_components == 16) { - if (_.HasCapability(SpvCapabilityVector16)) { - return SPV_SUCCESS; - } - return _.diag(SPV_ERROR_INVALID_DATA) - << "Having " << num_components << " components for " - << spvOpcodeString(static_cast(inst->opcode)) - << " requires the Vector16 capability"; - } - return _.diag(SPV_ERROR_INVALID_DATA) - << "Illegal number of components (" << num_components << ") for " - << spvOpcodeString(static_cast(inst->opcode)); -} - -// Validates that the number of bits specifed for a float type is valid. -// Scalar floating-point types can be parameterized only with 32-bits. -// Float16 capability allows using a 16-bit OpTypeFloat. -// Float16Buffer capability allows creation of a 16-bit OpTypeFloat. -// Float64 capability allows using a 64-bit OpTypeFloat. -spv_result_t ValidateFloatSize(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - // Operand 1 is the number of bits for this float - const uint32_t num_bits = inst->words[inst->operands[1].offset]; - if (num_bits == 32) { - return SPV_SUCCESS; - } - if (num_bits == 16) { - if (_.features().declare_float16_type) { - return SPV_SUCCESS; - } - return _.diag(SPV_ERROR_INVALID_DATA) - << "Using a 16-bit floating point " - << "type requires the Float16 or Float16Buffer capability," - " or an extension that explicitly enables 16-bit floating point."; - } - if (num_bits == 64) { - if (_.HasCapability(SpvCapabilityFloat64)) { - return SPV_SUCCESS; - } - return _.diag(SPV_ERROR_INVALID_DATA) - << "Using a 64-bit floating point " - << "type requires the Float64 capability."; - } - return _.diag(SPV_ERROR_INVALID_DATA) - << "Invalid number of bits (" << num_bits << ") used for OpTypeFloat."; -} - -// Validates that the number of bits specified for an Int type is valid. -// Scalar integer types can be parameterized only with 32-bits. -// Int8, Int16, and Int64 capabilities allow using 8-bit, 16-bit, and 64-bit -// integers, respectively. -spv_result_t ValidateIntSize(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - // Operand 1 is the number of bits for this integer. - const uint32_t num_bits = inst->words[inst->operands[1].offset]; - if (num_bits == 32) { - return SPV_SUCCESS; - } - if (num_bits == 8) { - if (_.HasCapability(SpvCapabilityInt8)) { - return SPV_SUCCESS; - } - return _.diag(SPV_ERROR_INVALID_DATA) - << "Using an 8-bit integer type requires the Int8 capability."; - } - if (num_bits == 16) { - if (_.features().declare_int16_type) { - return SPV_SUCCESS; - } - return _.diag(SPV_ERROR_INVALID_DATA) - << "Using a 16-bit integer type requires the Int16 capability," - " or an extension that explicitly enables 16-bit integers."; - } - if (num_bits == 64) { - if (_.HasCapability(SpvCapabilityInt64)) { - return SPV_SUCCESS; - } - return _.diag(SPV_ERROR_INVALID_DATA) - << "Using a 64-bit integer type requires the Int64 capability."; - } - return _.diag(SPV_ERROR_INVALID_DATA) << "Invalid number of bits (" - << num_bits << ") used for OpTypeInt."; -} - -// Validates that the matrix is parameterized with floating-point types. -spv_result_t ValidateMatrixColumnType(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - // Find the component type of matrix columns (must be vector). - // Operand 1 is the of the type specified for matrix columns. - auto type_id = inst->words[inst->operands[1].offset]; - auto col_type_instr = _.FindDef(type_id); - if (col_type_instr->opcode() != SpvOpTypeVector) { - return _.diag(SPV_ERROR_INVALID_ID) - << "Columns in a matrix must be of type vector."; - } - - // Trace back once more to find out the type of components in the vector. - // Operand 1 is the of the type of data in the vector. - auto comp_type_id = - col_type_instr->words()[col_type_instr->operands()[1].offset]; - auto comp_type_instruction = _.FindDef(comp_type_id); - if (comp_type_instruction->opcode() != SpvOpTypeFloat) { - return _.diag(SPV_ERROR_INVALID_DATA) << "Matrix types can only be " - "parameterized with " - "floating-point types."; - } - return SPV_SUCCESS; -} - -// Validates that the matrix has 2,3, or 4 columns. -spv_result_t ValidateMatrixNumCols(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - // Operand 2 is the number of columns in the matrix. - const uint32_t num_cols = inst->words[inst->operands[2].offset]; - if (num_cols != 2 && num_cols != 3 && num_cols != 4) { - return _.diag(SPV_ERROR_INVALID_DATA) << "Matrix types can only be " - "parameterized as having only 2, " - "3, or 4 columns."; - } - return SPV_SUCCESS; -} - -// Validates that OpSpecConstant specializes to either int or float type. -spv_result_t ValidateSpecConstNumerical(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - // Operand 0 is the of the type that we're specializing to. - auto type_id = inst->words[inst->operands[0].offset]; - auto type_instruction = _.FindDef(type_id); - auto type_opcode = type_instruction->opcode(); - if (type_opcode != SpvOpTypeInt && type_opcode != SpvOpTypeFloat) { - return _.diag(SPV_ERROR_INVALID_DATA) << "Specialization constant must be " - "an integer or floating-point " - "number."; - } - return SPV_SUCCESS; -} - -// Validates that OpSpecConstantTrue and OpSpecConstantFalse specialize to bool. -spv_result_t ValidateSpecConstBoolean(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - // Find out the type that we're specializing to. - auto type_instruction = _.FindDef(inst->type_id); - if (type_instruction->opcode() != SpvOpTypeBool) { - return _.diag(SPV_ERROR_INVALID_ID) << "Specialization constant must be " - "a boolean type."; - } - return SPV_SUCCESS; -} - -// Records the of the forward pointer to be used for validation. -spv_result_t ValidateForwardPointer(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - // Record the (which is operand 0) to ensure it's used properly. - // OpTypeStruct can only include undefined pointers that are - // previously declared as a ForwardPointer - return (_.RegisterForwardPointer(inst->words[inst->operands[0].offset])); -} - -// Validates that any undefined component of the struct is a forward pointer. -// It is valid to declare a forward pointer, and use its as one of the -// components of a struct. -spv_result_t ValidateStruct(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - // Struct components are operands 1, 2, etc. - for (unsigned i = 1; i < inst->num_operands; i++) { - auto type_id = inst->words[inst->operands[i].offset]; - auto type_instruction = _.FindDef(type_id); - if (type_instruction == nullptr && !_.IsForwardPointer(type_id)) { - return _.diag(SPV_ERROR_INVALID_ID) - << "Forward reference operands in an OpTypeStruct must first be " - "declared using OpTypeForwardPointer."; - } - } - return SPV_SUCCESS; -} - -} // anonymous namespace - -namespace libspirv { - -// Validates that Data Rules are followed according to the specifications. -// (Data Rules subsection of 2.16.1 Universal Validation Rules) -spv_result_t DataRulesPass(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - switch (inst->opcode) { - case SpvOpTypeVector: { - if (auto error = ValidateVecNumComponents(_, inst)) return error; - break; - } - case SpvOpTypeFloat: { - if (auto error = ValidateFloatSize(_, inst)) return error; - break; - } - case SpvOpTypeInt: { - if (auto error = ValidateIntSize(_, inst)) return error; - break; - } - case SpvOpTypeMatrix: { - if (auto error = ValidateMatrixColumnType(_, inst)) return error; - if (auto error = ValidateMatrixNumCols(_, inst)) return error; - break; - } - // TODO(ehsan): Add OpSpecConstantComposite validation code. - // TODO(ehsan): Add OpSpecConstantOp validation code (if any). - case SpvOpSpecConstant: { - if (auto error = ValidateSpecConstNumerical(_, inst)) return error; - break; - } - case SpvOpSpecConstantFalse: - case SpvOpSpecConstantTrue: { - if (auto error = ValidateSpecConstBoolean(_, inst)) return error; - break; - } - case SpvOpTypeForwardPointer: { - if (auto error = ValidateForwardPointer(_, inst)) return error; - break; - } - case SpvOpTypeStruct: { - if (auto error = ValidateStruct(_, inst)) return error; - break; - } - // TODO(ehsan): add more data rules validation here. - default: { break; } - } - - return SPV_SUCCESS; -} - -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_decorations.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_decorations.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_decorations.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_decorations.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,168 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include "validate.h" - -#include -#include - -#include "diagnostic.h" -#include "opcode.h" -#include "val/validation_state.h" - -using libspirv::Decoration; -using libspirv::DiagnosticStream; -using libspirv::Instruction; -using libspirv::ValidationState_t; - -namespace { - -// Returns whether the given structure type has any members with BuiltIn -// decoration. -bool isBuiltInStruct(uint32_t struct_id, ValidationState_t& vstate) { - const auto& decorations = vstate.id_decorations(struct_id); - return std::any_of( - decorations.begin(), decorations.end(), [](const Decoration& d) { - return SpvDecorationBuiltIn == d.dec_type() && - Decoration::kInvalidMember != d.struct_member_index(); - }); -} - -// Returns true if the given ID has the Import LinkageAttributes decoration. -bool hasImportLinkageAttribute(uint32_t id, ValidationState_t& vstate) { - const auto& decorations = vstate.id_decorations(id); - return std::any_of(decorations.begin(), decorations.end(), - [](const Decoration& d) { - return SpvDecorationLinkageAttributes == d.dec_type() && - d.params().size() >= 2u && - d.params().back() == SpvLinkageTypeImport; - }); -} - -spv_result_t CheckLinkageAttrOfFunctions(ValidationState_t& vstate) { - for (const auto& function : vstate.functions()) { - if (function.block_count() == 0u) { - // A function declaration (an OpFunction with no basic blocks), must have - // a Linkage Attributes Decoration with the Import Linkage Type. - if (!hasImportLinkageAttribute(function.id(), vstate)) { - return vstate.diag(SPV_ERROR_INVALID_BINARY) - << "Function declaration (id " << function.id() - << ") must have a LinkageAttributes decoration with the Import " - "Linkage type."; - } - } else { - if (hasImportLinkageAttribute(function.id(), vstate)) { - return vstate.diag(SPV_ERROR_INVALID_BINARY) - << "Function definition (id " << function.id() - << ") may not be decorated with Import Linkage type."; - } - } - } - return SPV_SUCCESS; -} - -// Checks whether an imported variable is initialized by this module. -spv_result_t CheckImportedVariableInitialization(ValidationState_t& vstate) { - // According the SPIR-V Spec 2.16.1, it is illegal to initialize an imported - // variable. This means that a module-scope OpVariable with initialization - // value cannot be marked with the Import Linkage Type (import type id = 1). - for (auto global_var_id : vstate.global_vars()) { - // Initializer is an optional argument for OpVariable. If initializer - // is present, the instruction will have 5 words. - auto variable_instr = vstate.FindDef(global_var_id); - if (variable_instr->words().size() == 5u && - hasImportLinkageAttribute(global_var_id, vstate)) { - return vstate.diag(SPV_ERROR_INVALID_ID) - << "A module-scope OpVariable with initialization value " - "cannot be marked with the Import Linkage Type."; - } - } - return SPV_SUCCESS; -} - -// Checks whether proper decorations have been appied to the entry points. -spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) { - for (uint32_t entry_point : vstate.entry_points()) { - const auto& interfaces = vstate.entry_point_interfaces(entry_point); - int num_builtin_inputs = 0; - int num_builtin_outputs = 0; - for (auto interface : interfaces) { - Instruction* var_instr = vstate.FindDef(interface); - if (SpvOpVariable != var_instr->opcode()) { - return vstate.diag(SPV_ERROR_INVALID_ID) - << "Interfaces passed to OpEntryPoint must be of type " - "OpTypeVariable. Found Op" - << spvOpcodeString(static_cast(var_instr->opcode())) - << "."; - } - const uint32_t ptr_id = var_instr->word(1); - Instruction* ptr_instr = vstate.FindDef(ptr_id); - // It is guaranteed (by validator ID checks) that ptr_instr is - // OpTypePointer. Word 3 of this instruction is the type being pointed to. - const uint32_t type_id = ptr_instr->word(3); - Instruction* type_instr = vstate.FindDef(type_id); - const auto storage_class = - static_cast(var_instr->word(3)); - if (storage_class != SpvStorageClassInput && - storage_class != SpvStorageClassOutput) { - return vstate.diag(SPV_ERROR_INVALID_ID) - << "OpEntryPoint interfaces must be OpVariables with " - "Storage Class of Input(1) or Output(3). Found Storage Class " - << storage_class << " for Entry Point id " << entry_point << "."; - } - if (type_instr && SpvOpTypeStruct == type_instr->opcode() && - isBuiltInStruct(type_id, vstate)) { - if (storage_class == SpvStorageClassInput) ++num_builtin_inputs; - if (storage_class == SpvStorageClassOutput) ++num_builtin_outputs; - if (num_builtin_inputs > 1 || num_builtin_outputs > 1) break; - } - } - if (num_builtin_inputs > 1 || num_builtin_outputs > 1) { - return vstate.diag(SPV_ERROR_INVALID_BINARY) - << "There must be at most one object per Storage Class that can " - "contain a structure type containing members decorated with " - "BuiltIn, consumed per entry-point. Entry Point id " - << entry_point << " does not meet this requirement."; - } - // The LinkageAttributes Decoration cannot be applied to functions targeted - // by an OpEntryPoint instruction - for (auto& decoration : vstate.id_decorations(entry_point)) { - if (SpvDecorationLinkageAttributes == decoration.dec_type()) { - const char* linkage_name = - reinterpret_cast(&decoration.params()[0]); - return vstate.diag(SPV_ERROR_INVALID_BINARY) - << "The LinkageAttributes Decoration (Linkage name: " - << linkage_name << ") cannot be applied to function id " - << entry_point - << " because it is targeted by an OpEntryPoint instruction."; - } - } - } - return SPV_SUCCESS; -} - -} // anonymous namespace - -namespace libspirv { - -// Validates that decorations have been applied properly. -spv_result_t ValidateDecorations(ValidationState_t& vstate) { - if (auto error = CheckImportedVariableInitialization(vstate)) return error; - if (auto error = CheckDecorationsOfEntryPoints(vstate)) return error; - if (auto error = CheckLinkageAttrOfFunctions(vstate)) return error; - return SPV_SUCCESS; -} - -} // namespace libspirv - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate.h vulkan-1.1.73+dfsg/external/spirv-tools/source/validate.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/validate.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,191 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_VALIDATE_H_ -#define LIBSPIRV_VALIDATE_H_ - -#include -#include -#include - -#include "instruction.h" -#include "message.h" -#include "spirv-tools/libspirv.h" -#include "table.h" - -namespace libspirv { - -class ValidationState_t; -class BasicBlock; - -/// A function that returns a vector of BasicBlocks given a BasicBlock. Used to -/// get the successor and predecessor nodes of a CFG block -using get_blocks_func = - std::function*(const BasicBlock*)>; - -/// @brief Performs the Control Flow Graph checks -/// -/// @param[in] _ the validation state of the module -/// -/// @return SPV_SUCCESS if no errors are found. SPV_ERROR_INVALID_CFG otherwise -spv_result_t PerformCfgChecks(ValidationState_t& _); - -/// @brief Updates the use vectors of all instructions that can be referenced -/// -/// This function will update the vector which define where an instruction was -/// referenced in the binary. -/// -/// @param[in] _ the validation state of the module -/// -/// @return SPV_SUCCESS if no errors are found. -spv_result_t UpdateIdUse(ValidationState_t& _); - -/// @brief This function checks all ID definitions dominate their use in the -/// CFG. -/// -/// This function will iterate over all ID definitions that are defined in the -/// functions of a module and make sure that the definitions appear in a -/// block that dominates their use. -/// -/// @param[in] _ the validation state of the module -/// -/// @return SPV_SUCCESS if no errors are found. SPV_ERROR_INVALID_ID otherwise -spv_result_t CheckIdDefinitionDominateUse(const ValidationState_t& _); - -/// @brief Updates the immediate dominator for each of the block edges -/// -/// Updates the immediate dominator of the blocks for each of the edges -/// provided by the @p dom_edges parameter -/// -/// @param[in,out] dom_edges The edges of the dominator tree -/// @param[in] set_func This function will be called to updated the Immediate -/// dominator -void UpdateImmediateDominators( - const std::vector>& dom_edges, - std::function set_func); - -/// @brief Prints all of the dominators of a BasicBlock -/// -/// @param[in] block The dominators of this block will be printed -void printDominatorList(BasicBlock& block); - -/// Performs logical layout validation as described in section 2.4 of the SPIR-V -/// spec. -spv_result_t ModuleLayoutPass(ValidationState_t& _, - const spv_parsed_instruction_t* inst); - -/// Performs Control Flow Graph validation of a module -spv_result_t CfgPass(ValidationState_t& _, - const spv_parsed_instruction_t* inst); - -/// Performs Id and SSA validation of a module -spv_result_t IdPass(ValidationState_t& _, const spv_parsed_instruction_t* inst); - -/// Performs validation of the Data Rules subsection of 2.16.1 Universal -/// Validation Rules. -/// TODO(ehsann): add more comments here as more validation code is added. -spv_result_t DataRulesPass(ValidationState_t& _, - const spv_parsed_instruction_t* inst); - -/// Performs instruction validation. -spv_result_t InstructionPass(ValidationState_t& _, - const spv_parsed_instruction_t* inst); - -/// Performs decoration validation. -spv_result_t ValidateDecorations(ValidationState_t& _); - -/// Validates that type declarations are unique, unless multiple declarations -/// of the same data type are allowed by the specification. -/// (see section 2.8 Types and Variables) -spv_result_t TypeUniquePass(ValidationState_t& _, - const spv_parsed_instruction_t* inst); - -/// Validates correctness of arithmetic instructions. -spv_result_t ArithmeticsPass(ValidationState_t& _, - const spv_parsed_instruction_t* inst); - -/// Validates correctness of conversion instructions. -spv_result_t ConversionPass(ValidationState_t& _, - const spv_parsed_instruction_t* inst); - -/// Validates correctness of logical instructions. -spv_result_t LogicalsPass(ValidationState_t& _, - const spv_parsed_instruction_t* inst); - -/// Validates correctness of bitwise instructions. -spv_result_t BitwisePass(ValidationState_t& _, - const spv_parsed_instruction_t* inst); - -// Validates that capability declarations use operands allowed in the current -// context. -spv_result_t CapabilityPass(ValidationState_t& _, - const spv_parsed_instruction_t* inst); - -} // namespace libspirv - -/// @brief Validate the ID usage of the instruction stream -/// -/// @param[in] pInsts stream of instructions -/// @param[in] instCount number of instructions -/// @param[in] opcodeTable table of specified Opcodes -/// @param[in] operandTable table of specified operands -/// @param[in] usedefs use-def info from module parsing -/// @param[in,out] position current position in the stream -/// -/// @return result code -spv_result_t spvValidateInstructionIDs(const spv_instruction_t* pInsts, - const uint64_t instCount, - const spv_opcode_table opcodeTable, - const spv_operand_table operandTable, - const spv_ext_inst_table extInstTable, - const libspirv::ValidationState_t& state, - spv_position position); - -/// @brief Validate the ID's within a SPIR-V binary -/// -/// @param[in] pInstructions array of instructions -/// @param[in] count number of elements in instruction array -/// @param[in] bound the binary header -/// @param[in] opcodeTable table of specified Opcodes -/// @param[in] operandTable table of specified operands -/// @param[in,out] position current word in the binary -/// @param[in] consumer message consumer callback -/// -/// @return result code -spv_result_t spvValidateIDs(const spv_instruction_t* pInstructions, - const uint64_t count, const uint32_t bound, - const spv_opcode_table opcodeTable, - const spv_operand_table operandTable, - const spv_ext_inst_table extInstTable, - spv_position position, - const spvtools::MessageConsumer& consumer); - -namespace spvtools { -// Performs validation for the SPIRV-V module binary. -// The main difference between this API and spvValidateBinary is that the -// "Validation State" is not destroyed upon function return; it lives on and is -// pointed to by the vstate unique_ptr. -spv_result_t ValidateBinaryAndKeepValidationState( - const spv_const_context context, spv_const_validator_options options, - const uint32_t* words, const size_t num_words, spv_diagnostic* pDiagnostic, - std::unique_ptr* vstate); - -// Performs validation for a single instruction and updates given validation -// state. -spv_result_t ValidateInstructionAndUpdateValidationState( - libspirv::ValidationState_t* vstate, const spv_parsed_instruction_t* inst); - -} // namespace spvtools - -#endif // LIBSPIRV_VALIDATE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_id.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_id.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_id.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_id.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,2671 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "validate.h" - -#include - -#include -#include -#include -#include -#include - -#include "diagnostic.h" -#include "instruction.h" -#include "message.h" -#include "opcode.h" -#include "operand.h" -#include "spirv_validator_options.h" -#include "spirv-tools/libspirv.h" -#include "val/function.h" -#include "val/validation_state.h" - -using libspirv::ValidationState_t; -using libspirv::Decoration; -using std::function; -using std::ignore; -using std::make_pair; -using std::pair; -using std::unordered_set; -using std::vector; - -namespace { - -class idUsage { - public: - idUsage(const spv_opcode_table opcodeTableArg, - const spv_operand_table operandTableArg, - const spv_ext_inst_table extInstTableArg, - const spv_instruction_t* pInsts, const uint64_t instCountArg, - const SpvMemoryModel memoryModelArg, - const SpvAddressingModel addressingModelArg, - const ValidationState_t& module, const vector& entry_points, - spv_position positionArg, const spvtools::MessageConsumer& consumer) - : opcodeTable(opcodeTableArg), - operandTable(operandTableArg), - extInstTable(extInstTableArg), - firstInst(pInsts), - instCount(instCountArg), - memoryModel(memoryModelArg), - addressingModel(addressingModelArg), - position(positionArg), - consumer_(consumer), - module_(module), - entry_points_(entry_points) {} - - bool isValid(const spv_instruction_t* inst); - - template - bool isValid(const spv_instruction_t* inst, const spv_opcode_desc); - - private: - const spv_opcode_table opcodeTable; - const spv_operand_table operandTable; - const spv_ext_inst_table extInstTable; - const spv_instruction_t* const firstInst; - const uint64_t instCount; - const SpvMemoryModel memoryModel; - const SpvAddressingModel addressingModel; - spv_position position; - const spvtools::MessageConsumer& consumer_; - const ValidationState_t& module_; - vector entry_points_; -}; - -#define DIAG(INDEX) \ - position->index += INDEX; \ - libspirv::DiagnosticStream helper(*position, consumer_, \ - SPV_ERROR_INVALID_DIAGNOSTIC); \ - helper - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc) { - assert(0 && "Unimplemented!"); - return false; -} -#endif // 0 - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto typeIndex = 1; - auto type = module_.FindDef(inst->words[typeIndex]); - if (!type || SpvOpTypeStruct != type->opcode()) { - DIAG(typeIndex) << "OpMemberName Type '" << inst->words[typeIndex] - << "' is not a struct type."; - return false; - } - auto memberIndex = 2; - auto member = inst->words[memberIndex]; - auto memberCount = (uint32_t)(type->words().size() - 2); - if (memberCount <= member) { - DIAG(memberIndex) << "OpMemberName Member '" - << inst->words[memberIndex] - << "' index is larger than Type '" << type->id() - << "'s member count."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto fileIndex = 1; - auto file = module_.FindDef(inst->words[fileIndex]); - if (!file || SpvOpString != file->opcode()) { - DIAG(fileIndex) << "OpLine Target '" << inst->words[fileIndex] - << "' is not an OpString."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto decorationIndex = 2; - auto decoration = inst->words[decorationIndex]; - if (decoration == SpvDecorationSpecId) { - auto targetIndex = 1; - auto target = module_.FindDef(inst->words[targetIndex]); - if (!target || !spvOpcodeIsScalarSpecConstant(target->opcode())) { - DIAG(targetIndex) << "OpDecorate SpectId decoration target '" - << inst->words[decorationIndex] - << "' is not a scalar specialization constant."; - return false; - } - } - // TODO: Add validations for all decorations. - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto structTypeIndex = 1; - auto structType = module_.FindDef(inst->words[structTypeIndex]); - if (!structType || SpvOpTypeStruct != structType->opcode()) { - DIAG(structTypeIndex) << "OpMemberDecorate Structure type '" - << inst->words[structTypeIndex] - << "' is not a struct type."; - return false; - } - auto memberIndex = 2; - auto member = inst->words[memberIndex]; - auto memberCount = static_cast(structType->words().size() - 2); - if (memberCount < member) { - DIAG(memberIndex) << "Index " << member - << " provided in OpMemberDecorate for struct " - << inst->words[structTypeIndex] - << " is out of bounds. The structure has " << memberCount - << " members. Largest valid index is " << memberCount - 1 - << "."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto decorationGroupIndex = 1; - auto decorationGroup = module_.FindDef(inst->words[decorationGroupIndex]); - if (!decorationGroup || SpvOpDecorationGroup != decorationGroup->opcode()) { - DIAG(decorationGroupIndex) << "OpGroupDecorate Decoration group '" - << inst->words[decorationGroupIndex] - << "' is not a decoration group."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid( - const spv_instruction_t* inst, const spv_opcode_desc) { - auto decorationGroupIndex = 1; - auto decorationGroup = module_.FindDef(inst->words[decorationGroupIndex]); - if (!decorationGroup || SpvOpDecorationGroup != decorationGroup->opcode()) { - DIAG(decorationGroupIndex) - << "OpGroupMemberDecorate Decoration group '" - << inst->words[decorationGroupIndex] << "' is not a decoration group."; - return false; - } - // Grammar checks ensures that the number of arguments to this instruction - // is an odd number: 1 decoration group + (id,literal) pairs. - for (size_t i = 2; i + 1 < inst->words.size(); i = i + 2) { - const uint32_t struct_id = inst->words[i]; - const uint32_t index = inst->words[i + 1]; - auto struct_instr = module_.FindDef(struct_id); - if (!struct_instr || SpvOpTypeStruct != struct_instr->opcode()) { - DIAG(i) << "OpGroupMemberDecorate Structure type '" << struct_id - << "' is not a struct type."; - return false; - } - const uint32_t num_struct_members = - static_cast(struct_instr->words().size() - 2); - if (index >= num_struct_members) { - DIAG(i) << "Index " << index - << " provided in OpGroupMemberDecorate for struct " - << struct_id << " is out of bounds. The structure has " - << num_struct_members << " members. Largest valid index is " - << num_struct_members - 1 << "."; - return false; - } - } - return true; -} - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif // 0 - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto entryPointIndex = 2; - auto entryPoint = module_.FindDef(inst->words[entryPointIndex]); - if (!entryPoint || SpvOpFunction != entryPoint->opcode()) { - DIAG(entryPointIndex) << "OpEntryPoint Entry Point '" - << inst->words[entryPointIndex] - << "' is not a function."; - return false; - } - // don't check kernel function signatures - auto executionModel = inst->words[1]; - if (executionModel != SpvExecutionModelKernel) { - // TODO: Check the entry point signature is void main(void), may be subject - // to change - auto entryPointType = module_.FindDef(entryPoint->words()[4]); - if (!entryPointType || 3 != entryPointType->words().size()) { - DIAG(entryPointIndex) << "OpEntryPoint Entry Point '" - << inst->words[entryPointIndex] - << "'s function parameter count is not zero."; - return false; - } - } - auto returnType = module_.FindDef(entryPoint->type_id()); - if (!returnType || SpvOpTypeVoid != returnType->opcode()) { - DIAG(entryPointIndex) << "OpEntryPoint Entry Point '" - << inst->words[entryPointIndex] - << "'s function return type is not void."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto entryPointIndex = 1; - auto entryPointID = inst->words[entryPointIndex]; - auto found = - std::find(entry_points_.cbegin(), entry_points_.cend(), entryPointID); - if (found == entry_points_.cend()) { - DIAG(entryPointIndex) << "OpExecutionMode Entry Point '" - << inst->words[entryPointIndex] - << "' is not the Entry Point " - "operand of an OpEntryPoint."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto componentIndex = 2; - auto componentType = module_.FindDef(inst->words[componentIndex]); - if (!componentType || !spvOpcodeIsScalarType(componentType->opcode())) { - DIAG(componentIndex) << "OpTypeVector Component Type '" - << inst->words[componentIndex] - << "' is not a scalar type."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto columnTypeIndex = 2; - auto columnType = module_.FindDef(inst->words[columnTypeIndex]); - if (!columnType || SpvOpTypeVector != columnType->opcode()) { - DIAG(columnTypeIndex) << "OpTypeMatrix Column Type '" - << inst->words[columnTypeIndex] - << "' is not a vector."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t*, - const spv_opcode_desc) { - // OpTypeSampler takes no arguments in Rev31 and beyond. - return true; -} - -// True if the integer constant is > 0. constWords are words of the -// constant-defining instruction (either OpConstant or -// OpSpecConstant). typeWords are the words of the constant's-type-defining -// OpTypeInt. -bool aboveZero(const vector& constWords, - const vector& typeWords) { - const uint32_t width = typeWords[2]; - const bool is_signed = typeWords[3] > 0; - const uint32_t loWord = constWords[3]; - if (width > 32) { - // The spec currently doesn't allow integers wider than 64 bits. - const uint32_t hiWord = constWords[4]; // Must exist, per spec. - if (is_signed && (hiWord >> 31)) return false; - return (loWord | hiWord) > 0; - } else { - if (is_signed && (loWord >> 31)) return false; - return loWord > 0; - } -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto elementTypeIndex = 2; - auto elementType = module_.FindDef(inst->words[elementTypeIndex]); - if (!elementType || !spvOpcodeGeneratesType(elementType->opcode())) { - DIAG(elementTypeIndex) << "OpTypeArray Element Type '" - << inst->words[elementTypeIndex] - << "' is not a type."; - return false; - } - auto lengthIndex = 3; - auto length = module_.FindDef(inst->words[lengthIndex]); - if (!length || !spvOpcodeIsConstant(length->opcode())) { - DIAG(lengthIndex) << "OpTypeArray Length '" << inst->words[lengthIndex] - << "' is not a scalar constant type."; - return false; - } - - // NOTE: Check the initialiser value of the constant - auto constInst = length->words(); - auto constResultTypeIndex = 1; - auto constResultType = module_.FindDef(constInst[constResultTypeIndex]); - if (!constResultType || SpvOpTypeInt != constResultType->opcode()) { - DIAG(lengthIndex) << "OpTypeArray Length '" << inst->words[lengthIndex] - << "' is not a constant integer type."; - return false; - } - - switch (length->opcode()) { - case SpvOpSpecConstant: - case SpvOpConstant: - if (aboveZero(length->words(), constResultType->words())) break; - // Else fall through! - case SpvOpConstantNull: { - DIAG(lengthIndex) << "OpTypeArray Length '" - << inst->words[lengthIndex] - << "' default value must be at least 1."; - return false; - } - case SpvOpSpecConstantOp: - // Assume it's OK, rather than try to evaluate the operation. - break; - default: - assert(0 && "bug in spvOpcodeIsConstant() or result type isn't int"); - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto elementTypeIndex = 2; - auto elementType = module_.FindDef(inst->words[elementTypeIndex]); - if (!elementType || !spvOpcodeGeneratesType(elementType->opcode())) { - DIAG(elementTypeIndex) << "OpTypeRuntimeArray Element Type '" - << inst->words[elementTypeIndex] - << "' is not a type."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - ValidationState_t& vstate = const_cast(module_); - const uint32_t struct_id = inst->words[1]; - for (size_t memberTypeIndex = 2; memberTypeIndex < inst->words.size(); - ++memberTypeIndex) { - auto memberTypeId = inst->words[memberTypeIndex]; - auto memberType = module_.FindDef(memberTypeId); - if (!memberType || !spvOpcodeGeneratesType(memberType->opcode())) { - DIAG(memberTypeIndex) << "OpTypeStruct Member Type '" - << inst->words[memberTypeIndex] - << "' is not a type."; - return false; - } - if (SpvOpTypeStruct == memberType->opcode() && - module_.IsStructTypeWithBuiltInMember(memberTypeId)) { - DIAG(memberTypeIndex) - << "Structure " << memberTypeId - << " contains members with BuiltIn decoration. Therefore this " - "structure may not be contained as a member of another structure " - "type. Structure " - << struct_id << " contains structure " << memberTypeId << "."; - return false; - } - if (module_.IsForwardPointer(memberTypeId)) { - if (memberType->opcode() != SpvOpTypePointer) { - DIAG(memberTypeIndex) << "Found a forward reference to a non-pointer " - "type in OpTypeStruct instruction."; - return false; - } - // If we're dealing with a forward pointer: - // Find out the type that the pointer is pointing to (must be struct) - // word 3 is the of the type being pointed to. - auto typePointingTo = module_.FindDef(memberType->words()[3]); - if (typePointingTo && typePointingTo->opcode() != SpvOpTypeStruct) { - // Forward declared operands of a struct may only point to a struct. - DIAG(memberTypeIndex) - << "A forward reference operand in an OpTypeStruct must be an " - "OpTypePointer that points to an OpTypeStruct. " - "Found OpTypePointer that points to Op" - << spvOpcodeString(static_cast(typePointingTo->opcode())) - << "."; - return false; - } - } - } - std::unordered_set built_in_members; - for (auto decoration : vstate.id_decorations(struct_id)) { - if (decoration.dec_type() == SpvDecorationBuiltIn && - decoration.struct_member_index() != Decoration::kInvalidMember) { - built_in_members.insert(decoration.struct_member_index()); - } - } - int num_struct_members = static_cast(inst->words.size() - 2); - int num_builtin_members = static_cast(built_in_members.size()); - if (num_builtin_members > 0 && num_builtin_members != num_struct_members) { - DIAG(0) - << "When BuiltIn decoration is applied to a structure-type member, " - "all members of that structure type must also be decorated with " - "BuiltIn (No allowed mixing of built-in variables and " - "non-built-in variables within a single structure). Structure id " - << struct_id << " does not meet this requirement."; - return false; - } - if (num_builtin_members > 0) { - vstate.RegisterStructTypeWithBuiltInMember(struct_id); - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto typeIndex = 3; - auto type = module_.FindDef(inst->words[typeIndex]); - if (!type || !spvOpcodeGeneratesType(type->opcode())) { - DIAG(typeIndex) << "OpTypePointer Type '" << inst->words[typeIndex] - << "' is not a type."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto returnTypeIndex = 2; - auto returnType = module_.FindDef(inst->words[returnTypeIndex]); - if (!returnType || !spvOpcodeGeneratesType(returnType->opcode())) { - DIAG(returnTypeIndex) << "OpTypeFunction Return Type '" - << inst->words[returnTypeIndex] << "' is not a type."; - return false; - } - size_t num_args = 0; - for (size_t paramTypeIndex = 3; paramTypeIndex < inst->words.size(); - ++paramTypeIndex, ++num_args) { - auto paramType = module_.FindDef(inst->words[paramTypeIndex]); - if (!paramType || !spvOpcodeGeneratesType(paramType->opcode())) { - DIAG(paramTypeIndex) << "OpTypeFunction Parameter Type '" - << inst->words[paramTypeIndex] << "' is not a type."; - return false; - } - } - const uint32_t num_function_args_limit = - module_.options()->universal_limits_.max_function_args; - if (num_args > num_function_args_limit) { - DIAG(returnTypeIndex) << "OpTypeFunction may not take more than " - << num_function_args_limit - << " arguments. OpTypeFunction '" - << inst->words[1] << "' has " << num_args - << " arguments."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t*, - const spv_opcode_desc) { - // OpTypePipe has no ID arguments. - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto resultTypeIndex = 1; - auto resultType = module_.FindDef(inst->words[resultTypeIndex]); - if (!resultType || SpvOpTypeBool != resultType->opcode()) { - DIAG(resultTypeIndex) << "OpConstantTrue Result Type '" - << inst->words[resultTypeIndex] - << "' is not a boolean type."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto resultTypeIndex = 1; - auto resultType = module_.FindDef(inst->words[resultTypeIndex]); - if (!resultType || SpvOpTypeBool != resultType->opcode()) { - DIAG(resultTypeIndex) << "OpConstantFalse Result Type '" - << inst->words[resultTypeIndex] - << "' is not a boolean type."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto resultTypeIndex = 1; - auto resultType = module_.FindDef(inst->words[resultTypeIndex]); - if (!resultType || !spvOpcodeIsComposite(resultType->opcode())) { - DIAG(resultTypeIndex) << "OpConstantComposite Result Type '" - << inst->words[resultTypeIndex] - << "' is not a composite type."; - return false; - } - - auto constituentCount = inst->words.size() - 3; - switch (resultType->opcode()) { - case SpvOpTypeVector: { - auto componentCount = resultType->words()[3]; - if (componentCount != constituentCount) { - // TODO: Output ID's on diagnostic - DIAG(inst->words.size() - 1) - << "OpConstantComposite Constituent count does not match " - "Result Type '" - << resultType->id() << "'s vector component count."; - return false; - } - auto componentType = module_.FindDef(resultType->words()[2]); - assert(componentType); - for (size_t constituentIndex = 3; constituentIndex < inst->words.size(); - constituentIndex++) { - auto constituent = module_.FindDef(inst->words[constituentIndex]); - if (!constituent || - !spvOpcodeIsConstantOrUndef(constituent->opcode())) { - DIAG(constituentIndex) << "OpConstantComposite Constituent '" - << inst->words[constituentIndex] - << "' is not a constant or undef."; - return false; - } - auto constituentResultType = module_.FindDef(constituent->type_id()); - if (!constituentResultType || - componentType->opcode() != constituentResultType->opcode()) { - DIAG(constituentIndex) << "OpConstantComposite Constituent '" - << inst->words[constituentIndex] - << "'s type does not match Result Type '" - << resultType->id() - << "'s vector element type."; - return false; - } - } - } break; - case SpvOpTypeMatrix: { - auto columnCount = resultType->words()[3]; - if (columnCount != constituentCount) { - // TODO: Output ID's on diagnostic - DIAG(inst->words.size() - 1) - << "OpConstantComposite Constituent count does not match " - "Result Type '" - << resultType->id() << "'s matrix column count."; - return false; - } - - auto columnType = module_.FindDef(resultType->words()[2]); - assert(columnType); - auto componentCount = columnType->words()[3]; - auto componentType = module_.FindDef(columnType->words()[2]); - assert(componentType); - - for (size_t constituentIndex = 3; constituentIndex < inst->words.size(); - constituentIndex++) { - auto constituent = module_.FindDef(inst->words[constituentIndex]); - if (!constituent || - !(SpvOpConstantComposite == constituent->opcode() || - SpvOpUndef == constituent->opcode())) { - // The message says "... or undef" because the spec does not say - // undef is a constant. - DIAG(constituentIndex) << "OpConstantComposite Constituent '" - << inst->words[constituentIndex] - << "' is not a constant composite or undef."; - return false; - } - auto vector = module_.FindDef(constituent->type_id()); - assert(vector); - if (columnType->opcode() != vector->opcode()) { - DIAG(constituentIndex) << "OpConstantComposite Constituent '" - << inst->words[constituentIndex] - << "' type does not match Result Type '" - << resultType->id() - << "'s matrix column type."; - return false; - } - auto vectorComponentType = module_.FindDef(vector->words()[2]); - assert(vectorComponentType); - if (componentType->id() != vectorComponentType->id()) { - DIAG(constituentIndex) - << "OpConstantComposite Constituent '" - << inst->words[constituentIndex] - << "' component type does not match Result Type '" - << resultType->id() << "'s matrix column component type."; - return false; - } - if (componentCount != vector->words()[3]) { - DIAG(constituentIndex) - << "OpConstantComposite Constituent '" - << inst->words[constituentIndex] - << "' vector component count does not match Result Type '" - << resultType->id() << "'s vector component count."; - return false; - } - } - } break; - case SpvOpTypeArray: { - auto elementType = module_.FindDef(resultType->words()[2]); - assert(elementType); - auto length = module_.FindDef(resultType->words()[3]); - assert(length); - if (length->words()[3] != constituentCount) { - DIAG(inst->words.size() - 1) - << "OpConstantComposite Constituent count does not match " - "Result Type '" - << resultType->id() << "'s array length."; - return false; - } - for (size_t constituentIndex = 3; constituentIndex < inst->words.size(); - constituentIndex++) { - auto constituent = module_.FindDef(inst->words[constituentIndex]); - if (!constituent || - !spvOpcodeIsConstantOrUndef(constituent->opcode())) { - DIAG(constituentIndex) << "OpConstantComposite Constituent '" - << inst->words[constituentIndex] - << "' is not a constant or undef."; - return false; - } - auto constituentType = module_.FindDef(constituent->type_id()); - assert(constituentType); - if (elementType->id() != constituentType->id()) { - DIAG(constituentIndex) << "OpConstantComposite Constituent '" - << inst->words[constituentIndex] - << "'s type does not match Result Type '" - << resultType->id() - << "'s array element type."; - return false; - } - } - } break; - case SpvOpTypeStruct: { - auto memberCount = resultType->words().size() - 2; - if (memberCount != constituentCount) { - DIAG(resultTypeIndex) << "OpConstantComposite Constituent '" - << inst->words[resultTypeIndex] - << "' count does not match Result Type '" - << resultType->id() << "'s struct member count."; - return false; - } - for (uint32_t constituentIndex = 3, memberIndex = 2; - constituentIndex < inst->words.size(); - constituentIndex++, memberIndex++) { - auto constituent = module_.FindDef(inst->words[constituentIndex]); - if (!constituent || - !spvOpcodeIsConstantOrUndef(constituent->opcode())) { - DIAG(constituentIndex) << "OpConstantComposite Constituent '" - << inst->words[constituentIndex] - << "' is not a constant or undef."; - return false; - } - auto constituentType = module_.FindDef(constituent->type_id()); - assert(constituentType); - - auto memberType = module_.FindDef(resultType->words()[memberIndex]); - assert(memberType); - if (memberType->id() != constituentType->id()) { - DIAG(constituentIndex) - << "OpConstantComposite Constituent '" - << inst->words[constituentIndex] - << "' type does not match the Result Type '" - << resultType->id() << "'s member type."; - return false; - } - } - } break; - default: { assert(0 && "Unreachable!"); } break; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto resultTypeIndex = 1; - auto resultType = module_.FindDef(inst->words[resultTypeIndex]); - if (!resultType || SpvOpTypeSampler != resultType->opcode()) { - DIAG(resultTypeIndex) << "OpConstantSampler Result Type '" - << inst->words[resultTypeIndex] - << "' is not a sampler type."; - return false; - } - return true; -} - -// True if instruction defines a type that can have a null value, as defined by -// the SPIR-V spec. Tracks composite-type components through module to check -// nullability transitively. -bool IsTypeNullable(const vector& instruction, - const ValidationState_t& module) { - uint16_t opcode; - uint16_t word_count; - spvOpcodeSplit(instruction[0], &word_count, &opcode); - switch (static_cast(opcode)) { - case SpvOpTypeBool: - case SpvOpTypeInt: - case SpvOpTypeFloat: - case SpvOpTypePointer: - case SpvOpTypeEvent: - case SpvOpTypeDeviceEvent: - case SpvOpTypeReserveId: - case SpvOpTypeQueue: - return true; - case SpvOpTypeArray: - case SpvOpTypeMatrix: - case SpvOpTypeVector: { - auto base_type = module.FindDef(instruction[2]); - return base_type && IsTypeNullable(base_type->words(), module); - } - case SpvOpTypeStruct: { - for (size_t elementIndex = 2; elementIndex < instruction.size(); - ++elementIndex) { - auto element = module.FindDef(instruction[elementIndex]); - if (!element || !IsTypeNullable(element->words(), module)) return false; - } - return true; - } - default: - return false; - } -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto resultTypeIndex = 1; - auto resultType = module_.FindDef(inst->words[resultTypeIndex]); - if (!resultType || !IsTypeNullable(resultType->words(), module_)) { - DIAG(resultTypeIndex) << "OpConstantNull Result Type '" - << inst->words[resultTypeIndex] - << "' cannot have a null value."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto resultTypeIndex = 1; - auto resultType = module_.FindDef(inst->words[resultTypeIndex]); - if (!resultType || SpvOpTypeBool != resultType->opcode()) { - DIAG(resultTypeIndex) << "OpSpecConstantTrue Result Type '" - << inst->words[resultTypeIndex] - << "' is not a boolean type."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto resultTypeIndex = 1; - auto resultType = module_.FindDef(inst->words[resultTypeIndex]); - if (!resultType || SpvOpTypeBool != resultType->opcode()) { - DIAG(resultTypeIndex) << "OpSpecConstantFalse Result Type '" - << inst->words[resultTypeIndex] - << "' is not a boolean type."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto resultTypeIndex = 2; - auto resultID = inst->words[resultTypeIndex]; - auto sampledImageInstr = module_.FindDef(resultID); - // We need to validate 2 things: - // * All OpSampledImage instructions must be in the same block in which their - // Result are consumed. - // * Result from OpSampledImage instructions must not appear as operands - // to OpPhi instructions or OpSelect instructions, or any instructions other - // than the image lookup and query instructions specified to take an operand - // whose type is OpTypeSampledImage. - std::vector consumers = module_.getSampledImageConsumers(resultID); - if (!consumers.empty()) { - for (auto consumer_id : consumers) { - auto consumer_instr = module_.FindDef(consumer_id); - auto consumer_opcode = consumer_instr->opcode(); - if (consumer_instr->block() != sampledImageInstr->block()) { - DIAG(resultTypeIndex) - << "All OpSampledImage instructions must be in the same block in " - "which their Result are consumed. OpSampledImage Result " - "Type '" - << resultID << "' has a consumer in a different basic " - "block. The consumer instruction is '" - << consumer_id << "'."; - return false; - } - // TODO: The following check is incomplete. We should also check that the - // Sampled Image is not used by instructions that should not take - // SampledImage as an argument. We could find the list of valid - // instructions by scanning for "Sampled Image" in the operand description - // field in the grammar file. - if (consumer_opcode == SpvOpPhi || consumer_opcode == SpvOpSelect) { - DIAG(resultTypeIndex) - << "Result from OpSampledImage instruction must not appear as " - "operands of Op" - << spvOpcodeString(static_cast(consumer_opcode)) << "." - << " Found result '" << resultID << "' as an operand of '" - << consumer_id << "'."; - return false; - } - } - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - // The result type must be a composite type. - auto resultTypeIndex = 1; - auto resultType = module_.FindDef(inst->words[resultTypeIndex]); - if (!resultType || !spvOpcodeIsComposite(resultType->opcode())) { - DIAG(resultTypeIndex) << "OpSpecConstantComposite Result Type '" - << inst->words[resultTypeIndex] - << "' is not a composite type."; - return false; - } - // Validation checks differ based on the type of composite type. - auto constituentCount = inst->words.size() - 3; - switch (resultType->opcode()) { - // For Vectors, the following must be met: - // * Number of constituents in the result type and the vector must match. - // * All the components of the vector must have the same type (or specialize - // to the same type). OpConstant and OpSpecConstant are allowed. - // To check that condition, we check each supplied value argument's type - // against the element type of the result type. - case SpvOpTypeVector: { - auto componentCount = resultType->words()[3]; - if (componentCount != constituentCount) { - DIAG(inst->words.size() - 1) - << "OpSpecConstantComposite Constituent count does not match " - "Result Type '" - << resultType->id() << "'s vector component count."; - return false; - } - auto componentType = module_.FindDef(resultType->words()[2]); - assert(componentType); - for (size_t constituentIndex = 3; constituentIndex < inst->words.size(); - constituentIndex++) { - auto constituent = module_.FindDef(inst->words[constituentIndex]); - if (!constituent || - !spvOpcodeIsConstantOrUndef(constituent->opcode())) { - DIAG(constituentIndex) << "OpSpecConstantComposite Constituent '" - << inst->words[constituentIndex] - << "' is not a constant or undef."; - return false; - } - auto constituentResultType = module_.FindDef(constituent->type_id()); - if (!constituentResultType || - componentType->opcode() != constituentResultType->opcode()) { - DIAG(constituentIndex) << "OpSpecConstantComposite Constituent '" - << inst->words[constituentIndex] - << "'s type does not match Result Type '" - << resultType->id() - << "'s vector element type."; - return false; - } - } - break; - } - case SpvOpTypeMatrix: { - auto columnCount = resultType->words()[3]; - if (columnCount != constituentCount) { - DIAG(inst->words.size() - 1) - << "OpSpecConstantComposite Constituent count does not match " - "Result Type '" - << resultType->id() << "'s matrix column count."; - return false; - } - - auto columnType = module_.FindDef(resultType->words()[2]); - assert(columnType); - auto componentCount = columnType->words()[3]; - auto componentType = module_.FindDef(columnType->words()[2]); - assert(componentType); - - for (size_t constituentIndex = 3; constituentIndex < inst->words.size(); - constituentIndex++) { - auto constituent = module_.FindDef(inst->words[constituentIndex]); - auto constituentOpCode = constituent->opcode(); - if (!constituent || - !(SpvOpSpecConstantComposite == constituentOpCode || - SpvOpConstantComposite == constituentOpCode || - SpvOpUndef == constituentOpCode)) { - // The message says "... or undef" because the spec does not say - // undef is a constant. - DIAG(constituentIndex) << "OpSpecConstantComposite Constituent '" - << inst->words[constituentIndex] - << "' is not a constant composite or undef."; - return false; - } - auto vector = module_.FindDef(constituent->type_id()); - assert(vector); - if (columnType->opcode() != vector->opcode()) { - DIAG(constituentIndex) << "OpSpecConstantComposite Constituent '" - << inst->words[constituentIndex] - << "' type does not match Result Type '" - << resultType->id() - << "'s matrix column type."; - return false; - } - auto vectorComponentType = module_.FindDef(vector->words()[2]); - assert(vectorComponentType); - if (componentType->id() != vectorComponentType->id()) { - DIAG(constituentIndex) - << "OpSpecConstantComposite Constituent '" - << inst->words[constituentIndex] - << "' component type does not match Result Type '" - << resultType->id() << "'s matrix column component type."; - return false; - } - if (componentCount != vector->words()[3]) { - DIAG(constituentIndex) - << "OpSpecConstantComposite Constituent '" - << inst->words[constituentIndex] - << "' vector component count does not match Result Type '" - << resultType->id() << "'s vector component count."; - return false; - } - } - break; - } - case SpvOpTypeArray: { - auto elementType = module_.FindDef(resultType->words()[2]); - assert(elementType); - auto length = module_.FindDef(resultType->words()[3]); - assert(length); - if (length->words()[3] != constituentCount) { - DIAG(inst->words.size() - 1) - << "OpSpecConstantComposite Constituent count does not match " - "Result Type '" - << resultType->id() << "'s array length."; - return false; - } - for (size_t constituentIndex = 3; constituentIndex < inst->words.size(); - constituentIndex++) { - auto constituent = module_.FindDef(inst->words[constituentIndex]); - if (!constituent || - !spvOpcodeIsConstantOrUndef(constituent->opcode())) { - DIAG(constituentIndex) << "OpSpecConstantComposite Constituent '" - << inst->words[constituentIndex] - << "' is not a constant or undef."; - return false; - } - auto constituentType = module_.FindDef(constituent->type_id()); - assert(constituentType); - if (elementType->id() != constituentType->id()) { - DIAG(constituentIndex) << "OpSpecConstantComposite Constituent '" - << inst->words[constituentIndex] - << "'s type does not match Result Type '" - << resultType->id() - << "'s array element type."; - return false; - } - } - break; - } - case SpvOpTypeStruct: { - auto memberCount = resultType->words().size() - 2; - if (memberCount != constituentCount) { - DIAG(resultTypeIndex) << "OpSpecConstantComposite Constituent '" - << inst->words[resultTypeIndex] - << "' count does not match Result Type '" - << resultType->id() << "'s struct member count."; - return false; - } - for (uint32_t constituentIndex = 3, memberIndex = 2; - constituentIndex < inst->words.size(); - constituentIndex++, memberIndex++) { - auto constituent = module_.FindDef(inst->words[constituentIndex]); - if (!constituent || - !spvOpcodeIsConstantOrUndef(constituent->opcode())) { - DIAG(constituentIndex) << "OpSpecConstantComposite Constituent '" - << inst->words[constituentIndex] - << "' is not a constant or undef."; - return false; - } - auto constituentType = module_.FindDef(constituent->type_id()); - assert(constituentType); - - auto memberType = module_.FindDef(resultType->words()[memberIndex]); - assert(memberType); - if (memberType->id() != constituentType->id()) { - DIAG(constituentIndex) - << "OpSpecConstantComposite Constituent '" - << inst->words[constituentIndex] - << "' type does not match the Result Type '" - << resultType->id() << "'s member type."; - return false; - } - } - break; - } - default: { assert(0 && "Unreachable!"); } break; - } - return true; -} - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst) {} -#endif - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto resultTypeIndex = 1; - auto resultType = module_.FindDef(inst->words[resultTypeIndex]); - if (!resultType || SpvOpTypePointer != resultType->opcode()) { - DIAG(resultTypeIndex) << "OpVariable Result Type '" - << inst->words[resultTypeIndex] - << "' is not a pointer type."; - return false; - } - const auto initialiserIndex = 4; - if (initialiserIndex < inst->words.size()) { - const auto initialiser = module_.FindDef(inst->words[initialiserIndex]); - const auto storageClassIndex = 3; - const auto is_module_scope_var = - initialiser && (initialiser->opcode() == SpvOpVariable) && - (initialiser->word(storageClassIndex) != SpvStorageClassFunction); - const auto is_constant = - initialiser && spvOpcodeIsConstant(initialiser->opcode()); - if (!initialiser || !(is_constant || is_module_scope_var)) { - DIAG(initialiserIndex) << "OpVariable Initializer '" - << inst->words[initialiserIndex] - << "' is not a constant or module-scope variable."; - return false; - } - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto resultTypeIndex = 1; - auto resultType = module_.FindDef(inst->words[resultTypeIndex]); - if (!resultType) { - DIAG(resultTypeIndex) << "OpLoad Result Type '" - << inst->words[resultTypeIndex] << "' is not defind."; - return false; - } - const bool uses_variable_pointer = - module_.features().variable_pointers || - module_.features().variable_pointers_storage_buffer; - auto pointerIndex = 3; - auto pointer = module_.FindDef(inst->words[pointerIndex]); - if (!pointer || - (addressingModel == SpvAddressingModelLogical && - ((!uses_variable_pointer && - !spvOpcodeReturnsLogicalPointer(pointer->opcode())) || - (uses_variable_pointer && - !spvOpcodeReturnsLogicalVariablePointer(pointer->opcode()))))) { - DIAG(pointerIndex) << "OpLoad Pointer '" << inst->words[pointerIndex] - << "' is not a logical pointer."; - return false; - } - auto pointerType = module_.FindDef(pointer->type_id()); - if (!pointerType || pointerType->opcode() != SpvOpTypePointer) { - DIAG(pointerIndex) << "OpLoad type for pointer '" - << inst->words[pointerIndex] - << "' is not a pointer type."; - return false; - } - auto pointeeType = module_.FindDef(pointerType->words()[3]); - if (!pointeeType || resultType->id() != pointeeType->id()) { - DIAG(resultTypeIndex) << "OpLoad Result Type '" - << inst->words[resultTypeIndex] - << "' does not match Pointer '" << pointer->id() - << "'s type."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - const bool uses_variable_pointer = - module_.features().variable_pointers || - module_.features().variable_pointers_storage_buffer; - const auto pointerIndex = 1; - auto pointer = module_.FindDef(inst->words[pointerIndex]); - if (!pointer || - (addressingModel == SpvAddressingModelLogical && - ((!uses_variable_pointer && - !spvOpcodeReturnsLogicalPointer(pointer->opcode())) || - (uses_variable_pointer && - !spvOpcodeReturnsLogicalVariablePointer(pointer->opcode()))))) { - DIAG(pointerIndex) << "OpStore Pointer '" << inst->words[pointerIndex] - << "' is not a logical pointer."; - return false; - } - auto pointerType = module_.FindDef(pointer->type_id()); - if (!pointer || pointerType->opcode() != SpvOpTypePointer) { - DIAG(pointerIndex) << "OpStore type for pointer '" - << inst->words[pointerIndex] - << "' is not a pointer type."; - return false; - } - auto type = module_.FindDef(pointerType->words()[3]); - assert(type); - if (SpvOpTypeVoid == type->opcode()) { - DIAG(pointerIndex) << "OpStore Pointer '" << inst->words[pointerIndex] - << "'s type is void."; - return false; - } - - auto objectIndex = 2; - auto object = module_.FindDef(inst->words[objectIndex]); - if (!object || !object->type_id()) { - DIAG(objectIndex) << "OpStore Object '" << inst->words[objectIndex] - << "' is not an object."; - return false; - } - auto objectType = module_.FindDef(object->type_id()); - assert(objectType); - if (SpvOpTypeVoid == objectType->opcode()) { - DIAG(objectIndex) << "OpStore Object '" << inst->words[objectIndex] - << "'s type is void."; - return false; - } - - if (type->id() != objectType->id()) { - DIAG(pointerIndex) << "OpStore Pointer '" << inst->words[pointerIndex] - << "'s type does not match Object '" - << objectType->id() << "'s type."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto targetIndex = 1; - auto target = module_.FindDef(inst->words[targetIndex]); - if (!target) return false; - auto sourceIndex = 2; - auto source = module_.FindDef(inst->words[sourceIndex]); - if (!source) return false; - auto targetPointerType = module_.FindDef(target->type_id()); - assert(targetPointerType); - auto targetType = module_.FindDef(targetPointerType->words()[3]); - assert(targetType); - auto sourcePointerType = module_.FindDef(source->type_id()); - assert(sourcePointerType); - auto sourceType = module_.FindDef(sourcePointerType->words()[3]); - assert(sourceType); - if (targetType->id() != sourceType->id()) { - DIAG(sourceIndex) << "OpCopyMemory Target '" - << inst->words[sourceIndex] - << "'s type does not match Source '" - << sourceType->id() << "'s type."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto targetIndex = 1; - auto target = module_.FindDef(inst->words[targetIndex]); - if (!target) return false; - auto sourceIndex = 2; - auto source = module_.FindDef(inst->words[sourceIndex]); - if (!source) return false; - auto sizeIndex = 3; - auto size = module_.FindDef(inst->words[sizeIndex]); - if (!size) return false; - auto targetPointerType = module_.FindDef(target->type_id()); - if (!targetPointerType || SpvOpTypePointer != targetPointerType->opcode()) { - DIAG(targetIndex) << "OpCopyMemorySized Target '" - << inst->words[targetIndex] << "' is not a pointer."; - return false; - } - auto sourcePointerType = module_.FindDef(source->type_id()); - if (!sourcePointerType || SpvOpTypePointer != sourcePointerType->opcode()) { - DIAG(sourceIndex) << "OpCopyMemorySized Source '" - << inst->words[sourceIndex] << "' is not a pointer."; - return false; - } - switch (size->opcode()) { - // TODO: The following opcode's are assumed to be valid, refer to the - // following bug https://cvs.khronos.org/bugzilla/show_bug.cgi?id=13871 for - // clarification - case SpvOpConstant: - case SpvOpSpecConstant: { - auto sizeType = module_.FindDef(size->type_id()); - assert(sizeType); - if (SpvOpTypeInt != sizeType->opcode()) { - DIAG(sizeIndex) << "OpCopyMemorySized Size '" - << inst->words[sizeIndex] - << "'s type is not an integer type."; - return false; - } - } break; - case SpvOpVariable: { - auto pointerType = module_.FindDef(size->type_id()); - assert(pointerType); - auto sizeType = module_.FindDef(pointerType->type_id()); - if (!sizeType || SpvOpTypeInt != sizeType->opcode()) { - DIAG(sizeIndex) << "OpCopyMemorySized Size '" - << inst->words[sizeIndex] - << "'s variable type is not an integer type."; - return false; - } - } break; - default: - DIAG(sizeIndex) << "OpCopyMemorySized Size '" - << inst->words[sizeIndex] - << "' is not a constant or variable."; - return false; - } - // TODO: Check that consant is a least size 1, see the same bug as above for - // clarification? - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - std::string instr_name = - "Op" + std::string(spvOpcodeString(static_cast(inst->opcode))); - - // The result type must be OpTypePointer. Result Type is at word 1. - auto resultTypeIndex = 1; - auto resultTypeInstr = module_.FindDef(inst->words[resultTypeIndex]); - if (SpvOpTypePointer != resultTypeInstr->opcode()) { - DIAG(resultTypeIndex) << "The Result Type of " << instr_name << " '" - << inst->words[2] - << "' must be OpTypePointer. Found Op" - << spvOpcodeString( - static_cast(resultTypeInstr->opcode())) - << "."; - return false; - } - - // Result type is a pointer. Find out what it's pointing to. - // This will be used to make sure the indexing results in the same type. - // OpTypePointer word 3 is the type being pointed to. - auto resultTypePointedTo = module_.FindDef(resultTypeInstr->word(3)); - - // Base must be a pointer, pointing to the base of a composite object. - auto baseIdIndex = 3; - auto baseInstr = module_.FindDef(inst->words[baseIdIndex]); - auto baseTypeInstr = module_.FindDef(baseInstr->type_id()); - if (!baseTypeInstr || SpvOpTypePointer != baseTypeInstr->opcode()) { - DIAG(baseIdIndex) << "The Base '" << inst->words[baseIdIndex] - << "' in " << instr_name - << " instruction must be a pointer."; - return false; - } - - // The result pointer storage class and base pointer storage class must match. - // Word 2 of OpTypePointer is the Storage Class. - auto resultTypeStorageClass = resultTypeInstr->word(2); - auto baseTypeStorageClass = baseTypeInstr->word(2); - if (resultTypeStorageClass != baseTypeStorageClass) { - DIAG(resultTypeIndex) << "The result pointer storage class and base " - "pointer storage class in " - << instr_name << " do not match."; - return false; - } - - // The type pointed to by OpTypePointer (word 3) must be a composite type. - auto typePointedTo = module_.FindDef(baseTypeInstr->word(3)); - - // Check Universal Limit (SPIR-V Spec. Section 2.17). - // The number of indexes passed to OpAccessChain may not exceed 255 - // The instruction includes 4 words + N words (for N indexes) - const size_t num_indexes = inst->words.size() - 4; - const size_t num_indexes_limit = - module_.options()->universal_limits_.max_access_chain_indexes; - if (num_indexes > num_indexes_limit) { - DIAG(resultTypeIndex) << "The number of indexes in " << instr_name - << " may not exceed " << num_indexes_limit - << ". Found " << num_indexes << " indexes."; - return false; - } - // Indexes walk the type hierarchy to the desired depth, potentially down to - // scalar granularity. The first index in Indexes will select the top-level - // member/element/component/element of the base composite. All composite - // constituents use zero-based numbering, as described by their OpType... - // instruction. The second index will apply similarly to that result, and so - // on. Once any non-composite type is reached, there must be no remaining - // (unused) indexes. - for (size_t i = 4; i < inst->words.size(); ++i) { - const uint32_t cur_word = inst->words[i]; - // Earlier ID checks ensure that cur_word definition exists. - auto cur_word_instr = module_.FindDef(cur_word); - // The index must be a scalar integer type (See OpAccessChain in the Spec.) - auto indexTypeInstr = module_.FindDef(cur_word_instr->type_id()); - if (!indexTypeInstr || SpvOpTypeInt != indexTypeInstr->opcode()) { - DIAG(i) << "Indexes passed to " << instr_name - << " must be of type integer."; - return false; - } - switch (typePointedTo->opcode()) { - case SpvOpTypeMatrix: - case SpvOpTypeVector: - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: { - // In OpTypeMatrix, OpTypeVector, OpTypeArray, and OpTypeRuntimeArray, - // word 2 is the Element Type. - typePointedTo = module_.FindDef(typePointedTo->word(2)); - break; - } - case SpvOpTypeStruct: { - // In case of structures, there is an additional constraint on the - // index: the index must be an OpConstant. - if (SpvOpConstant != cur_word_instr->opcode()) { - DIAG(i) << "The passed to " << instr_name - << " to index into a " - "structure must be an OpConstant."; - return false; - } - // Get the index value from the OpConstant (word 3 of OpConstant). - // OpConstant could be a signed integer. But it's okay to treat it as - // unsigned because a negative constant int would never be seen as - // correct as a struct offset, since structs can't have more than 2 - // billion members. - const uint32_t cur_index = cur_word_instr->word(3); - // The index points to the struct member we want, therefore, the index - // should be less than the number of struct members. - const uint32_t num_struct_members = - static_cast(typePointedTo->words().size() - 2); - if (cur_index >= num_struct_members) { - DIAG(i) << "Index is out of bounds: " << instr_name - << " can not find index " << cur_index - << " into the structure '" << typePointedTo->id() - << "'. This structure has " << num_struct_members - << " members. Largest valid index is " - << num_struct_members - 1 << "."; - return false; - } - // Struct members IDs start at word 2 of OpTypeStruct. - auto structMemberId = typePointedTo->word(cur_index + 2); - typePointedTo = module_.FindDef(structMemberId); - break; - } - default: { - // Give an error. reached non-composite type while indexes still remain. - DIAG(i) << instr_name << " reached non-composite type while indexes " - "still remain to be traversed."; - return false; - } - } - } - // At this point, we have fully walked down from the base using the indeces. - // The type being pointed to should be the same as the result type. - if (typePointedTo->id() != resultTypePointedTo->id()) { - DIAG(resultTypeIndex) - << instr_name << " result type (Op" - << spvOpcodeString(static_cast(resultTypePointedTo->opcode())) - << ") does not match the type that results from indexing into the base " - " (Op" - << spvOpcodeString(static_cast(typePointedTo->opcode())) << ")."; - return false; - } - - return true; -} - -template <> -bool idUsage::isValid( - const spv_instruction_t* inst, const spv_opcode_desc opcodeEntry) { - return isValid(inst, opcodeEntry); -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc opcodeEntry) { - // OpPtrAccessChain's validation rules are similar to OpAccessChain, with one - // difference: word 4 must be id of an integer (Element ). - // The grammar guarantees that there are at least 5 words in the instruction - // (i.e. if there are fewer than 5 words, the SPIR-V code will not compile.) - int elem_index = 4; - // We can remove the Element from the instruction words, and simply call - // the validation code of OpAccessChain. - spv_instruction_t new_inst = *inst; - new_inst.words.erase(new_inst.words.begin() + elem_index); - return isValid(&new_inst, opcodeEntry); -} - -template <> -bool idUsage::isValid( - const spv_instruction_t* inst, const spv_opcode_desc opcodeEntry) { - // Has the same validation rules as OpPtrAccessChain - return isValid(inst, opcodeEntry); -} - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto resultTypeIndex = 1; - auto resultType = module_.FindDef(inst->words[resultTypeIndex]); - if (!resultType) return false; - auto functionTypeIndex = 4; - auto functionType = module_.FindDef(inst->words[functionTypeIndex]); - if (!functionType || SpvOpTypeFunction != functionType->opcode()) { - DIAG(functionTypeIndex) << "OpFunction Function Type '" - << inst->words[functionTypeIndex] - << "' is not a function type."; - return false; - } - auto returnType = module_.FindDef(functionType->words()[2]); - assert(returnType); - if (returnType->id() != resultType->id()) { - DIAG(resultTypeIndex) << "OpFunction Result Type '" - << inst->words[resultTypeIndex] - << "' does not match the Function Type '" - << resultType->id() << "'s return type."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto resultTypeIndex = 1; - auto resultType = module_.FindDef(inst->words[resultTypeIndex]); - if (!resultType) return false; - // NOTE: Find OpFunction & ensure OpFunctionParameter is not out of place. - size_t paramIndex = 0; - assert(firstInst < inst && "Invalid instruction pointer"); - while (firstInst != --inst) { - if (SpvOpFunction == inst->opcode) { - break; - } else if (SpvOpFunctionParameter == inst->opcode) { - paramIndex++; - } - } - auto functionType = module_.FindDef(inst->words[4]); - assert(functionType); - if (paramIndex >= functionType->words().size() - 3) { - DIAG(0) << "Too many OpFunctionParameters for " << inst->words[2] - << ": expected " << functionType->words().size() - 3 - << " based on the function's type"; - return false; - } - auto paramType = module_.FindDef(functionType->words()[paramIndex + 3]); - assert(paramType); - if (resultType->id() != paramType->id()) { - DIAG(resultTypeIndex) << "OpFunctionParameter Result Type '" - << inst->words[resultTypeIndex] - << "' does not match the OpTypeFunction parameter " - "type of the same index."; - return false; - } - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto resultTypeIndex = 1; - auto resultType = module_.FindDef(inst->words[resultTypeIndex]); - if (!resultType) return false; - auto functionIndex = 3; - auto function = module_.FindDef(inst->words[functionIndex]); - if (!function || SpvOpFunction != function->opcode()) { - DIAG(functionIndex) << "OpFunctionCall Function '" - << inst->words[functionIndex] << "' is not a function."; - return false; - } - auto returnType = module_.FindDef(function->type_id()); - assert(returnType); - if (returnType->id() != resultType->id()) { - DIAG(resultTypeIndex) << "OpFunctionCall Result Type '" - << inst->words[resultTypeIndex] - << "'s type does not match Function '" - << returnType->id() << "'s return type."; - return false; - } - auto functionType = module_.FindDef(function->words()[4]); - assert(functionType); - auto functionCallArgCount = inst->words.size() - 4; - auto functionParamCount = functionType->words().size() - 3; - if (functionParamCount != functionCallArgCount) { - DIAG(inst->words.size() - 1) - << "OpFunctionCall Function 's parameter count does not match " - "the argument count."; - return false; - } - for (size_t argumentIndex = 4, paramIndex = 3; - argumentIndex < inst->words.size(); argumentIndex++, paramIndex++) { - auto argument = module_.FindDef(inst->words[argumentIndex]); - if (!argument) return false; - auto argumentType = module_.FindDef(argument->type_id()); - assert(argumentType); - auto parameterType = module_.FindDef(functionType->words()[paramIndex]); - assert(parameterType); - if (argumentType->id() != parameterType->id()) { - DIAG(argumentIndex) << "OpFunctionCall Argument '" - << inst->words[argumentIndex] - << "'s type does not match Function '" - << parameterType->id() << "'s parameter type."; - return false; - } - } - return true; -} - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) { -} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -// Walks the composite type hierarchy starting from the base. -// At each step, the iterator is dereferenced to get the next literal index. -// Indexes walk the type hierarchy to the desired depth, potentially down to -// scalar granularity. The first index in Indexes will select the top-level -// member/element/component/element of the base composite. All composite -// constituents use zero-based numbering, as described by their OpType... -// instruction. The second index will apply similarly to that result, and so -// on. Once any non-composite type is reached, there must be no remaining -// (unused) indexes. -// Returns true on success and false otherwise. -// If successful, the final type reached by indexing is returned by reference. -// If an error occurs, the error string is returned by reference. -bool walkCompositeTypeHierarchy( - const ValidationState_t& module, - std::vector::const_iterator word_iter, - std::vector::const_iterator word_iter_end, - const libspirv::Instruction* base, - const libspirv::Instruction** result_type_instr, - std::function instr_name, std::ostream* error) { - auto cur_type = base; - for (; word_iter != word_iter_end; ++word_iter) { - switch (cur_type->opcode()) { - case SpvOpTypeMatrix: - case SpvOpTypeVector: - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: { - // In OpTypeMatrix, OpTypeVector, OpTypeArray, and OpTypeRuntimeArray, - // word 2 is the Element Type. - cur_type = module.FindDef(cur_type->word(2)); - break; - } - case SpvOpTypeStruct: { - // Get the index into the structure. - const uint32_t cur_index = *word_iter; - // The index points to the struct member we want, therefore, the index - // should be less than the number of struct members. - const uint32_t num_struct_members = - static_cast(cur_type->words().size() - 2); - if (cur_index >= num_struct_members) { - *error << "Index is out of bounds: " << instr_name() - << " can not find index " << cur_index - << " into the structure '" << cur_type->id() - << "'. This structure has " << num_struct_members - << " members. Largest valid index is " - << num_struct_members - 1 << "."; - return false; - } - // Struct members IDs start at word 2 of OpTypeStruct. - auto structMemberId = cur_type->word(cur_index + 2); - cur_type = module.FindDef(structMemberId); - break; - } - default: { - // Give an error. reached non-composite type while indexes still remain. - *error << instr_name() << " reached non-composite type while indexes " - "still remain to be traversed."; - return false; - } - } - } - *result_type_instr = cur_type; - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto instr_name = [&inst]() { - std::string name = - "Op" + std::string(spvOpcodeString(static_cast(inst->opcode))); - return name; - }; - - // Remember the result type. Result Type is at word 1. - // This will be used to make sure the indexing results in the same type. - const size_t resultTypeIndex = 1; - auto resultTypeInstr = module_.FindDef(inst->words[resultTypeIndex]); - - // The Composite is at word 3. ID definition checks ensure this id is - // already defined. - auto baseInstr = module_.FindDef(inst->words[3]); - auto curTypeInstr = module_.FindDef(baseInstr->type_id()); - - // Check Universal Limit (SPIR-V Spec. Section 2.17). - // The number of indexes passed to OpCompositeExtract may not exceed 255. - // The instruction includes 4 words + N words (for N indexes) - const size_t num_indexes = inst->words.size() - 4; - const size_t num_indexes_limit = 255; - if (num_indexes > num_indexes_limit) { - DIAG(resultTypeIndex) << "The number of indexes in " << instr_name() - << " may not exceed " << num_indexes_limit - << ". Found " << num_indexes << " indexes."; - return false; - } - - // Walk down the composite type structure. Indexes start at word 4. - const libspirv::Instruction* indexedTypeInstr = nullptr; - std::ostringstream error; - bool success = walkCompositeTypeHierarchy( - module_, inst->words.begin() + 4, inst->words.end(), curTypeInstr, - &indexedTypeInstr, instr_name, &error); - if (!success) { - DIAG(resultTypeIndex) << error.str(); - return success; - } - - // At this point, we have fully walked down from the base using the indexes. - // The type being pointed to should be the same as the result type. - if (indexedTypeInstr->id() != resultTypeInstr->id()) { - DIAG(resultTypeIndex) - << instr_name() << " result type (Op" - << spvOpcodeString(static_cast(resultTypeInstr->opcode())) - << ") does not match the type that results from indexing into the " - "composite (Op" - << spvOpcodeString(static_cast(indexedTypeInstr->opcode())) - << ")."; - return false; - } - - return true; -} - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto instr_name = [&inst]() { - std::string name = - "Op" + std::string(spvOpcodeString(static_cast(inst->opcode))); - return name; - }; - - // Result Type must be the same as Composite type. Result Type is the - // word at index 1. Composite is at word 4. - // The grammar guarantees that the instruction has at least 5 words. - // ID definition checks ensure these IDs are already defined. - const size_t resultTypeIndex = 1; - const size_t resultIdIndex = 2; - const size_t compositeIndex = 4; - auto resultTypeInstr = module_.FindDef(inst->words[resultTypeIndex]); - auto compositeInstr = module_.FindDef(inst->words[compositeIndex]); - auto compositeTypeInstr = module_.FindDef(compositeInstr->type_id()); - if (resultTypeInstr != compositeTypeInstr) { - DIAG(resultTypeIndex) - << "The Result Type must be the same as Composite type in " - << instr_name() << " yielding Result Id " << inst->words[resultIdIndex] - << "."; - return false; - } - - // Check Universal Limit (SPIR-V Spec. Section 2.17). - // The number of indexes passed to OpCompositeInsert may not exceed 255. - // The instruction includes 5 words + N words (for N indexes) - const size_t num_indexes = inst->words.size() - 5; - const size_t num_indexes_limit = 255; - if (num_indexes > num_indexes_limit) { - DIAG(resultTypeIndex) << "The number of indexes in " << instr_name() - << " may not exceed " << num_indexes_limit - << ". Found " << num_indexes << " indexes."; - return false; - } - - // Walk the composite type structure. Indexes start at word 5. - const libspirv::Instruction* indexedTypeInstr = nullptr; - std::ostringstream error; - bool success = walkCompositeTypeHierarchy( - module_, inst->words.begin() + 5, inst->words.end(), compositeTypeInstr, - &indexedTypeInstr, instr_name, &error); - if (!success) { - DIAG(resultTypeIndex) << error.str(); - return success; - } - - // At this point, we have fully walked down from the base using the indexes. - // The type being pointed to should be the same as the object type that is - // about to be inserted. - auto objectIdIndex = 3; - auto objectInstr = module_.FindDef(inst->words[objectIdIndex]); - auto objectTypeInstr = module_.FindDef(objectInstr->type_id()); - if (indexedTypeInstr->id() != objectTypeInstr->id()) { - DIAG(objectIdIndex) - << "The Object type (Op" - << spvOpcodeString(static_cast(objectTypeInstr->opcode())) - << ") in " << instr_name() << " does not match the type that results " - "from indexing into the Composite (Op" - << spvOpcodeString(static_cast(indexedTypeInstr->opcode())) - << ")."; - return false; - } - - return true; -} - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -template <> -bool idUsage::isValid(const spv_instruction_t* inst, - const spv_opcode_desc) { - auto valueIndex = 1; - auto value = module_.FindDef(inst->words[valueIndex]); - if (!value || !value->type_id()) { - DIAG(valueIndex) << "OpReturnValue Value '" << inst->words[valueIndex] - << "' does not represent a value."; - return false; - } - auto valueType = module_.FindDef(value->type_id()); - if (!valueType || SpvOpTypeVoid == valueType->opcode()) { - DIAG(valueIndex) << "OpReturnValue value's type '" << value->type_id() - << "' is missing or void."; - return false; - } - const bool uses_variable_pointer = - module_.features().variable_pointers || - module_.features().variable_pointers_storage_buffer; - if (addressingModel == SpvAddressingModelLogical && - SpvOpTypePointer == valueType->opcode() && !uses_variable_pointer) { - DIAG(valueIndex) - << "OpReturnValue value's type '" << value->type_id() - << "' is a pointer, which is invalid in the Logical addressing model."; - return false; - } - // NOTE: Find OpFunction - const spv_instruction_t* function = inst - 1; - while (firstInst != function) { - if (SpvOpFunction == function->opcode) break; - function--; - } - if (SpvOpFunction != function->opcode) { - DIAG(valueIndex) << "OpReturnValue is not in a basic block."; - return false; - } - auto returnType = module_.FindDef(function->words[1]); - if (!returnType || returnType->id() != valueType->id()) { - DIAG(valueIndex) << "OpReturnValue Value '" << inst->words[valueIndex] - << "'s type does not match OpFunction's return type."; - return false; - } - return true; -} - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) { -} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) { -} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) { -} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid(const spv_instruction_t *inst, - const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#if 0 -template <> -bool idUsage::isValid( - const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {} -#endif - -#undef DIAG - -bool idUsage::isValid(const spv_instruction_t* inst) { - spv_opcode_desc opcodeEntry = nullptr; - if (spvOpcodeTableValueLookup(opcodeTable, inst->opcode, &opcodeEntry)) - return false; -#define CASE(OpCode) \ - case Spv##OpCode: \ - return isValid(inst, opcodeEntry); -#define TODO(OpCode) \ - case Spv##OpCode: \ - return true; - switch (inst->opcode) { - TODO(OpUndef) - CASE(OpMemberName) - CASE(OpLine) - CASE(OpDecorate) - CASE(OpMemberDecorate) - CASE(OpGroupDecorate) - CASE(OpGroupMemberDecorate) - TODO(OpExtInst) - CASE(OpEntryPoint) - CASE(OpExecutionMode) - CASE(OpTypeVector) - CASE(OpTypeMatrix) - CASE(OpTypeSampler) - CASE(OpTypeArray) - CASE(OpTypeRuntimeArray) - CASE(OpTypeStruct) - CASE(OpTypePointer) - CASE(OpTypeFunction) - CASE(OpTypePipe) - CASE(OpConstantTrue) - CASE(OpConstantFalse) - CASE(OpConstantComposite) - CASE(OpConstantSampler) - CASE(OpConstantNull) - CASE(OpSpecConstantTrue) - CASE(OpSpecConstantFalse) - CASE(OpSpecConstantComposite) - CASE(OpSampledImage) - TODO(OpSpecConstantOp) - CASE(OpVariable) - CASE(OpLoad) - CASE(OpStore) - CASE(OpCopyMemory) - CASE(OpCopyMemorySized) - CASE(OpAccessChain) - CASE(OpInBoundsAccessChain) - CASE(OpPtrAccessChain) - CASE(OpInBoundsPtrAccessChain) - TODO(OpArrayLength) - TODO(OpGenericPtrMemSemantics) - CASE(OpFunction) - CASE(OpFunctionParameter) - CASE(OpFunctionCall) - // Conversion opcodes are validated in validate_conversion.cpp. - TODO(OpVectorExtractDynamic) - TODO(OpVectorInsertDynamic) - TODO(OpVectorShuffle) - TODO(OpCompositeConstruct) - CASE(OpCompositeExtract) - CASE(OpCompositeInsert) - TODO(OpCopyObject) - TODO(OpTranspose) - // Arithmetic opcodes are validated in validate_arithmetics.cpp. - // Bitwise opcodes are validated in validate_bitwise.cpp. - // Logical opcodes are validated in validate_logicals.cpp. - TODO(OpDPdx) - TODO(OpDPdy) - TODO(OpFwidth) - TODO(OpDPdxFine) - TODO(OpDPdyFine) - TODO(OpFwidthFine) - TODO(OpDPdxCoarse) - TODO(OpDPdyCoarse) - TODO(OpFwidthCoarse) - TODO(OpPhi) - TODO(OpLoopMerge) - TODO(OpSelectionMerge) - TODO(OpBranch) - TODO(OpBranchConditional) - TODO(OpSwitch) - CASE(OpReturnValue) - TODO(OpLifetimeStart) - TODO(OpLifetimeStop) - TODO(OpAtomicLoad) - TODO(OpAtomicStore) - TODO(OpAtomicExchange) - TODO(OpAtomicCompareExchange) - TODO(OpAtomicCompareExchangeWeak) - TODO(OpAtomicIIncrement) - TODO(OpAtomicIDecrement) - TODO(OpAtomicIAdd) - TODO(OpAtomicISub) - TODO(OpAtomicUMin) - TODO(OpAtomicUMax) - TODO(OpAtomicAnd) - TODO(OpAtomicOr) - TODO(OpAtomicSMin) - TODO(OpAtomicSMax) - TODO(OpEmitStreamVertex) - TODO(OpEndStreamPrimitive) - TODO(OpGroupAsyncCopy) - TODO(OpGroupWaitEvents) - TODO(OpGroupAll) - TODO(OpGroupAny) - TODO(OpGroupBroadcast) - TODO(OpGroupIAdd) - TODO(OpGroupFAdd) - TODO(OpGroupFMin) - TODO(OpGroupUMin) - TODO(OpGroupSMin) - TODO(OpGroupFMax) - TODO(OpGroupUMax) - TODO(OpGroupSMax) - TODO(OpEnqueueMarker) - TODO(OpEnqueueKernel) - TODO(OpGetKernelNDrangeSubGroupCount) - TODO(OpGetKernelNDrangeMaxSubGroupSize) - TODO(OpGetKernelWorkGroupSize) - TODO(OpGetKernelPreferredWorkGroupSizeMultiple) - TODO(OpRetainEvent) - TODO(OpReleaseEvent) - TODO(OpCreateUserEvent) - TODO(OpIsValidEvent) - TODO(OpSetUserEventStatus) - TODO(OpCaptureEventProfilingInfo) - TODO(OpGetDefaultQueue) - TODO(OpBuildNDRange) - TODO(OpReadPipe) - TODO(OpWritePipe) - TODO(OpReservedReadPipe) - TODO(OpReservedWritePipe) - TODO(OpReserveReadPipePackets) - TODO(OpReserveWritePipePackets) - TODO(OpCommitReadPipe) - TODO(OpCommitWritePipe) - TODO(OpIsValidReserveId) - TODO(OpGetNumPipePackets) - TODO(OpGetMaxPipePackets) - TODO(OpGroupReserveReadPipePackets) - TODO(OpGroupReserveWritePipePackets) - TODO(OpGroupCommitReadPipe) - TODO(OpGroupCommitWritePipe) - default: - return true; - } -#undef TODO -#undef CASE -} -} // anonymous namespace - -namespace libspirv { - -spv_result_t UpdateIdUse(ValidationState_t& _) { - for (const auto& inst : _.ordered_instructions()) { - for (auto& operand : inst.operands()) { - const spv_operand_type_t& type = operand.type; - const uint32_t operand_id = inst.word(operand.offset); - if (spvIsIdType(type) && type != SPV_OPERAND_TYPE_RESULT_ID) { - if (auto def = _.FindDef(operand_id)) - def->RegisterUse(&inst, operand.offset); - } - } - } - return SPV_SUCCESS; -} - -/// This function checks all ID definitions dominate their use in the CFG. -/// -/// This function will iterate over all ID definitions that are defined in the -/// functions of a module and make sure that the definitions appear in a -/// block that dominates their use. -/// -/// NOTE: This function does NOT check module scoped functions which are -/// checked during the initial binary parse in the IdPass below -spv_result_t CheckIdDefinitionDominateUse(const ValidationState_t& _) { - unordered_set phi_instructions; - for (const auto& definition : _.all_definitions()) { - // Check only those definitions defined in a function - if (const Function* func = definition.second->function()) { - if (const BasicBlock* block = definition.second->block()) { - if (!block->reachable()) continue; - // If the Id is defined within a block then make sure all references to - // that Id appear in a blocks that are dominated by the defining block - for (auto& use_index_pair : definition.second->uses()) { - const Instruction* use = use_index_pair.first; - if (const BasicBlock* use_block = use->block()) { - if (use_block->reachable() == false) continue; - if (use->opcode() == SpvOpPhi) { - phi_instructions.insert(use); - } else if (!block->dominates(*use->block())) { - return _.diag(SPV_ERROR_INVALID_ID) - << "ID " << _.getIdName(definition.first) - << " defined in block " << _.getIdName(block->id()) - << " does not dominate its use in block " - << _.getIdName(use_block->id()); - } - } - } - } else { - // If the Ids defined within a function but not in a block(i.e. function - // parameters, block ids), then make sure all references to that Id - // appear within the same function - for (auto use : definition.second->uses()) { - const Instruction* inst = use.first; - if (inst->function() && inst->function() != func) { - return _.diag(SPV_ERROR_INVALID_ID) - << "ID " << _.getIdName(definition.first) - << " used in function " - << _.getIdName(inst->function()->id()) - << " is used outside of it's defining function " - << _.getIdName(func->id()); - } - } - } - } - // NOTE: Ids defined outside of functions must appear before they are used - // This check is being performed in the IdPass function - } - - // Check all OpPhi parent blocks are dominated by the variable's defining - // blocks - for (const Instruction* phi : phi_instructions) { - if (phi->block()->reachable() == false) continue; - for (size_t i = 3; i < phi->operands().size(); i += 2) { - const Instruction* variable = _.FindDef(phi->word(i)); - const BasicBlock* parent = - phi->function()->GetBlock(phi->word(i + 1)).first; - if (variable->block() && !variable->block()->dominates(*parent)) { - return _.diag(SPV_ERROR_INVALID_ID) - << "In OpPhi instruction " << _.getIdName(phi->id()) << ", ID " - << _.getIdName(variable->id()) - << " definition does not dominate its parent " - << _.getIdName(parent->id()); - } - } - } - - return SPV_SUCCESS; -} - -// Performs SSA validation on the IDs of an instruction. The -// can_have_forward_declared_ids functor should return true if the -// instruction operand's ID can be forward referenced. -spv_result_t IdPass(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - auto can_have_forward_declared_ids = - spvOperandCanBeForwardDeclaredFunction(static_cast(inst->opcode)); - - // Keep track of a result id defined by this instruction. 0 means it - // does not define an id. - uint32_t result_id = 0; - - for (unsigned i = 0; i < inst->num_operands; i++) { - const spv_parsed_operand_t& operand = inst->operands[i]; - const spv_operand_type_t& type = operand.type; - // We only care about Id operands, which are a single word. - const uint32_t operand_word = inst->words[operand.offset]; - - auto ret = SPV_ERROR_INTERNAL; - switch (type) { - case SPV_OPERAND_TYPE_RESULT_ID: - // NOTE: Multiple Id definitions are being checked by the binary parser. - // - // Defer undefined-forward-reference removal until after we've analyzed - // the remaining operands to this instruction. Deferral only matters - // for - // OpPhi since it's the only case where it defines its own forward - // reference. Other instructions that can have forward references - // either don't define a value or the forward reference is to a function - // Id (and hence defined outside of a function body). - result_id = operand_word; - // NOTE: The result Id is added (in RegisterInstruction) *after* all of - // the other Ids have been checked to avoid premature use in the same - // instruction. - ret = SPV_SUCCESS; - break; - case SPV_OPERAND_TYPE_ID: - case SPV_OPERAND_TYPE_TYPE_ID: - case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: - case SPV_OPERAND_TYPE_SCOPE_ID: - if (_.IsDefinedId(operand_word)) { - ret = SPV_SUCCESS; - } else if (can_have_forward_declared_ids(i)) { - ret = _.ForwardDeclareId(operand_word); - } else { - ret = _.diag(SPV_ERROR_INVALID_ID) << "ID " - << _.getIdName(operand_word) - << " has not been defined"; - } - break; - default: - ret = SPV_SUCCESS; - break; - } - if (SPV_SUCCESS != ret) { - return ret; - } - } - if (result_id) { - _.RemoveIfForwardDeclared(result_id); - } - _.RegisterInstruction(*inst); - return SPV_SUCCESS; -} -} // namespace libspirv - -spv_result_t spvValidateInstructionIDs(const spv_instruction_t* pInsts, - const uint64_t instCount, - const spv_opcode_table opcodeTable, - const spv_operand_table operandTable, - const spv_ext_inst_table extInstTable, - const libspirv::ValidationState_t& state, - spv_position position) { - idUsage idUsage(opcodeTable, operandTable, extInstTable, pInsts, instCount, - state.memory_model(), state.addressing_model(), state, - state.entry_points(), position, state.context()->consumer); - for (uint64_t instIndex = 0; instIndex < instCount; ++instIndex) { - if (!idUsage.isValid(&pInsts[instIndex])) return SPV_ERROR_INVALID_ID; - position->index += pInsts[instIndex].words.size(); - } - return SPV_SUCCESS; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_instruction.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_instruction.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_instruction.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_instruction.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,461 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Performs validation on instructions that appear inside of a SPIR-V block. - -#include "validate.h" - -#include -#include - -#include -#include - -#include "binary.h" -#include "diagnostic.h" -#include "enum_set.h" -#include "enum_string_mapping.h" -#include "extensions.h" -#include "opcode.h" -#include "operand.h" -#include "spirv_definition.h" -#include "spirv_validator_options.h" -#include "util/string_utils.h" -#include "val/function.h" -#include "val/validation_state.h" - -using libspirv::AssemblyGrammar; -using libspirv::CapabilitySet; -using libspirv::DiagnosticStream; -using libspirv::ExtensionSet; -using libspirv::ValidationState_t; - -namespace { - -std::string ToString(const CapabilitySet& capabilities, - const AssemblyGrammar& grammar) { - std::stringstream ss; - capabilities.ForEach([&grammar, &ss](SpvCapability cap) { - spv_operand_desc desc; - if (SPV_SUCCESS == - grammar.lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, cap, &desc)) - ss << desc->name << " "; - else - ss << cap << " "; - }); - return ss.str(); -} - -// Reports a missing-capability error to _'s diagnostic stream and returns -// SPV_ERROR_INVALID_CAPABILITY. -spv_result_t CapabilityError(ValidationState_t& _, int which_operand, - SpvOp opcode, - const std::string& required_capabilities) { - return _.diag(SPV_ERROR_INVALID_CAPABILITY) - << "Operand " << which_operand << " of " << spvOpcodeString(opcode) - << " requires one of these capabilities: " << required_capabilities; -} - -// Returns an operand's required capabilities. -CapabilitySet RequiredCapabilities(const ValidationState_t& state, - spv_operand_type_t type, uint32_t operand) { - // Mere mention of PointSize, ClipDistance, or CullDistance in a Builtin - // decoration does not require the associated capability. The use of such - // a variable value should trigger the capability requirement, but that's - // not implemented yet. This rule is independent of target environment. - // See https://github.com/KhronosGroup/SPIRV-Tools/issues/365 - if (type == SPV_OPERAND_TYPE_BUILT_IN) { - switch (operand) { - case SpvBuiltInPointSize: - case SpvBuiltInClipDistance: - case SpvBuiltInCullDistance: - return CapabilitySet(); - default: - break; - } - } else if (type == SPV_OPERAND_TYPE_FP_ROUNDING_MODE) { - // Allow all FP rounding modes if requested - if (state.features().free_fp_rounding_mode) { - return CapabilitySet(); - } - } - - spv_operand_desc operand_desc; - const auto ret = state.grammar().lookupOperand(type, operand, &operand_desc); - if (ret == SPV_SUCCESS) { - CapabilitySet result = operand_desc->capabilities; - - // Allow FPRoundingMode decoration if requested - if (state.features().free_fp_rounding_mode && - type == SPV_OPERAND_TYPE_DECORATION && - operand_desc->value == SpvDecorationFPRoundingMode) { - return CapabilitySet(); - } - return result; - } - - return CapabilitySet(); -} - -// Returns operand's required extensions. -ExtensionSet RequiredExtensions(const ValidationState_t& state, - spv_operand_type_t type, uint32_t operand) { - spv_operand_desc operand_desc; - if (state.grammar().lookupOperand(type, operand, &operand_desc) == - SPV_SUCCESS) { - assert(operand_desc); - return operand_desc->extensions; - } - - return ExtensionSet(); -} - -} // namespace - -namespace libspirv { - -spv_result_t CapabilityCheck(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - spv_opcode_desc opcode_desc; - const SpvOp opcode = static_cast(inst->opcode); - if (SPV_SUCCESS == _.grammar().lookupOpcode(opcode, &opcode_desc) && - !_.HasAnyOfCapabilities(opcode_desc->capabilities)) - return _.diag(SPV_ERROR_INVALID_CAPABILITY) - << "Opcode " << spvOpcodeString(opcode) - << " requires one of these capabilities: " - << ToString(opcode_desc->capabilities, _.grammar()); - for (int i = 0; i < inst->num_operands; ++i) { - const auto& operand = inst->operands[i]; - const auto word = inst->words[operand.offset]; - if (spvOperandIsConcreteMask(operand.type)) { - // Check for required capabilities for each bit position of the mask. - for (uint32_t mask_bit = 0x80000000; mask_bit; mask_bit >>= 1) { - if (word & mask_bit) { - const auto caps = RequiredCapabilities(_, operand.type, mask_bit); - if (!_.HasAnyOfCapabilities(caps)) { - return CapabilityError(_, i + 1, opcode, - ToString(caps, _.grammar())); - } - } - } - } else if (spvIsIdType(operand.type)) { - // TODO(dneto): Check the value referenced by this Id, if we can compute - // it. For now, just punt, to fix issue 248: - // https://github.com/KhronosGroup/SPIRV-Tools/issues/248 - } else { - // Check the operand word as a whole. - const auto caps = RequiredCapabilities(_, operand.type, word); - if (!_.HasAnyOfCapabilities(caps)) { - return CapabilityError(_, i + 1, opcode, ToString(caps, _.grammar())); - } - } - } - return SPV_SUCCESS; -} - -// Checks that all required extensions were declared in the module. -spv_result_t ExtensionCheck(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - const SpvOp opcode = static_cast(inst->opcode); - for (size_t operand_index = 0; operand_index < inst->num_operands; - ++operand_index) { - const auto& operand = inst->operands[operand_index]; - const uint32_t word = inst->words[operand.offset]; - const ExtensionSet required_extensions = - RequiredExtensions(_, operand.type, word); - if (!_.HasAnyOfExtensions(required_extensions)) { - return _.diag(SPV_ERROR_MISSING_EXTENSION) - << spvutils::CardinalToOrdinal(operand_index + 1) << " operand of " - << spvOpcodeString(opcode) << ": operand " << word - << " requires one of these extensions: " - << ExtensionSetToString(required_extensions); - } - } - return SPV_SUCCESS; -} - -// Checks that the instruction is not reserved for future use. -spv_result_t ReservedCheck(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - const SpvOp opcode = static_cast(inst->opcode); - switch (opcode) { - case SpvOpImageSparseSampleProjImplicitLod: - case SpvOpImageSparseSampleProjExplicitLod: - case SpvOpImageSparseSampleProjDrefImplicitLod: - case SpvOpImageSparseSampleProjDrefExplicitLod: - return _.diag(SPV_ERROR_INVALID_VALUE) << spvOpcodeString(opcode) - << " is reserved for future use."; - default: - return SPV_SUCCESS; - } -} - -// Checks that the Resuld is within the valid bound. -spv_result_t LimitCheckIdBound(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - if (inst->result_id >= _.getIdBound()) { - return _.diag(SPV_ERROR_INVALID_BINARY) - << "Result '" << inst->result_id - << "' must be less than the ID bound '" << _.getIdBound() << "'."; - } - return SPV_SUCCESS; -} - -// Checks that the number of OpTypeStruct members is within the limit. -spv_result_t LimitCheckStruct(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - if (SpvOpTypeStruct != inst->opcode) { - return SPV_SUCCESS; - } - - // Number of members is the number of operands of the instruction minus 1. - // One operand is the result ID. - const uint16_t limit = - static_cast(_.options()->universal_limits_.max_struct_members); - if (inst->num_operands - 1 > limit) { - return _.diag(SPV_ERROR_INVALID_BINARY) - << "Number of OpTypeStruct members (" << inst->num_operands - 1 - << ") has exceeded the limit (" << limit << ")."; - } - - // Section 2.17 of SPIRV Spec specifies that the "Structure Nesting Depth" - // must be less than or equal to 255. - // This is interpreted as structures including other structures as members. - // The code does not follow pointers or look into arrays to see if we reach a - // structure downstream. - // The nesting depth of a struct is 1+(largest depth of any member). - // Scalars are at depth 0. - uint32_t max_member_depth = 0; - // Struct members start at word 2 of OpTypeStruct instruction. - for (size_t word_i = 2; word_i < inst->num_words; ++word_i) { - auto member = inst->words[word_i]; - auto memberTypeInstr = _.FindDef(member); - if (memberTypeInstr && SpvOpTypeStruct == memberTypeInstr->opcode()) { - max_member_depth = std::max( - max_member_depth, _.struct_nesting_depth(memberTypeInstr->id())); - } - } - - const uint32_t depth_limit = _.options()->universal_limits_.max_struct_depth; - const uint32_t cur_depth = 1 + max_member_depth; - _.set_struct_nesting_depth(inst->result_id, cur_depth); - if (cur_depth > depth_limit) { - return _.diag(SPV_ERROR_INVALID_BINARY) - << "Structure Nesting Depth may not be larger than " << depth_limit - << ". Found " << cur_depth << "."; - } - return SPV_SUCCESS; -} - -// Checks that the number of (literal, label) pairs in OpSwitch is within the -// limit. -spv_result_t LimitCheckSwitch(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - if (SpvOpSwitch == inst->opcode) { - // The instruction syntax is as follows: - // OpSwitch literal label literal label ... - // literal,label pairs come after the first 2 operands. - // It is guaranteed at this point that num_operands is an even numner. - unsigned int num_pairs = (inst->num_operands - 2) / 2; - const unsigned int num_pairs_limit = - _.options()->universal_limits_.max_switch_branches; - if (num_pairs > num_pairs_limit) { - return _.diag(SPV_ERROR_INVALID_BINARY) - << "Number of (literal, label) pairs in OpSwitch (" << num_pairs - << ") exceeds the limit (" << num_pairs_limit << ")."; - } - } - return SPV_SUCCESS; -} - -// Ensure the number of variables of the given class does not exceed the limit. -spv_result_t LimitCheckNumVars(ValidationState_t& _, const uint32_t var_id, - const SpvStorageClass storage_class) { - if (SpvStorageClassFunction == storage_class) { - _.registerLocalVariable(var_id); - const uint32_t num_local_vars_limit = - _.options()->universal_limits_.max_local_variables; - if (_.num_local_vars() > num_local_vars_limit) { - return _.diag(SPV_ERROR_INVALID_BINARY) - << "Number of local variables ('Function' Storage Class) " - "exceeded the valid limit (" - << num_local_vars_limit << ")."; - } - } else { - _.registerGlobalVariable(var_id); - const uint32_t num_global_vars_limit = - _.options()->universal_limits_.max_global_variables; - if (_.num_global_vars() > num_global_vars_limit) { - return _.diag(SPV_ERROR_INVALID_BINARY) - << "Number of Global Variables (Storage Class other than " - "'Function') exceeded the valid limit (" - << num_global_vars_limit << ")."; - } - } - return SPV_SUCCESS; -} - -// Registers necessary decoration(s) for the appropriate IDs based on the -// instruction. -spv_result_t RegisterDecorations(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - switch (inst->opcode) { - case SpvOpDecorate: { - const uint32_t target_id = inst->words[1]; - const SpvDecoration dec_type = static_cast(inst->words[2]); - std::vector dec_params; - if (inst->num_words > 3) { - dec_params.insert(dec_params.end(), inst->words + 3, - inst->words + inst->num_words); - } - _.RegisterDecorationForId(target_id, Decoration(dec_type, dec_params)); - break; - } - case SpvOpMemberDecorate: { - const uint32_t struct_id = inst->words[1]; - const uint32_t index = inst->words[2]; - const SpvDecoration dec_type = static_cast(inst->words[3]); - std::vector dec_params; - if (inst->num_words > 4) { - dec_params.insert(dec_params.end(), inst->words + 4, - inst->words + inst->num_words); - } - _.RegisterDecorationForId(struct_id, - Decoration(dec_type, dec_params, index)); - break; - } - case SpvOpDecorationGroup: { - // We don't need to do anything right now. Assigning decorations to groups - // will be taken care of via OpGroupDecorate. - break; - } - case SpvOpGroupDecorate: { - // Word 1 is the group . All subsequent words are target s that - // are going to be decorated with the decorations. - const uint32_t decoration_group_id = inst->words[1]; - std::vector& group_decorations = - _.id_decorations(decoration_group_id); - for (int i = 2; i < inst->num_words; ++i) { - const uint32_t target_id = inst->words[i]; - _.RegisterDecorationsForId(target_id, group_decorations.begin(), - group_decorations.end()); - } - break; - } - case SpvOpGroupMemberDecorate: { - // Word 1 is the Decoration Group followed by (struct,literal) - // pairs. All decorations of the group should be applied to all the struct - // members that are specified in the instructions. - const uint32_t decoration_group_id = inst->words[1]; - std::vector& group_decorations = - _.id_decorations(decoration_group_id); - // Grammar checks ensures that the number of arguments to this instruction - // is an odd number: 1 decoration group + (id,literal) pairs. - for (int i = 2; i + 1 < inst->num_words; i = i + 2) { - const uint32_t struct_id = inst->words[i]; - const uint32_t index = inst->words[i + 1]; - // ID validation phase ensures this is in fact a struct instruction and - // that the index is not out of bound. - _.RegisterDecorationsForStructMember(struct_id, index, - group_decorations.begin(), - group_decorations.end()); - } - break; - } - default: - break; - } - return SPV_SUCCESS; -} - -// Parses OpExtension instruction and logs warnings if unsuccessful. -void CheckIfKnownExtension(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - const std::string extension_str = GetExtensionString(inst); - Extension extension; - if (!GetExtensionFromString(extension_str, &extension)) { - _.diag(SPV_SUCCESS) << "Found unrecognized extension " << extension_str; - return; - } -} - -spv_result_t InstructionPass(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - const SpvOp opcode = static_cast(inst->opcode); - if (opcode == SpvOpExtension) - CheckIfKnownExtension(_, inst); - if (opcode == SpvOpCapability) { - _.RegisterCapability( - static_cast(inst->words[inst->operands[0].offset])); - } - if (opcode == SpvOpMemoryModel) { - _.set_addressing_model( - static_cast(inst->words[inst->operands[0].offset])); - _.set_memory_model( - static_cast(inst->words[inst->operands[1].offset])); - } - if (opcode == SpvOpVariable) { - const auto storage_class = - static_cast(inst->words[inst->operands[2].offset]); - if (auto error = LimitCheckNumVars(_, inst->result_id, storage_class)) { - return error; - } - if (storage_class == SpvStorageClassGeneric) - return _.diag(SPV_ERROR_INVALID_BINARY) - << "OpVariable storage class cannot be Generic"; - if (_.current_layout_section() == kLayoutFunctionDefinitions) { - if (storage_class != SpvStorageClassFunction) { - return _.diag(SPV_ERROR_INVALID_LAYOUT) - << "Variables must have a function[7] storage class inside" - " of a function"; - } - if (_.current_function().IsFirstBlock( - _.current_function().current_block()->id()) == false) { - return _.diag(SPV_ERROR_INVALID_CFG) << "Variables can only be defined " - "in the first block of a " - "function"; - } - } else { - if (storage_class == SpvStorageClassFunction) { - return _.diag(SPV_ERROR_INVALID_LAYOUT) - << "Variables can not have a function[7] storage class " - "outside of a function"; - } - } - } - - // SPIR-V Spec 2.16.3: Validation Rules for Kernel Capabilities: The - // Signedness in OpTypeInt must always be 0. - if (SpvOpTypeInt == inst->opcode && _.HasCapability(SpvCapabilityKernel) && - inst->words[inst->operands[2].offset] != 0u) { - return _.diag(SPV_ERROR_INVALID_BINARY) << "The Signedness in OpTypeInt " - "must always be 0 when Kernel " - "capability is used."; - } - - // In order to validate decoration rules, we need to know all the decorations - // that are applied to any given . - RegisterDecorations(_, inst); - - if (auto error = ExtensionCheck(_, inst)) return error; - if (auto error = CapabilityCheck(_, inst)) return error; - if (auto error = LimitCheckIdBound(_, inst)) return error; - if (auto error = LimitCheckStruct(_, inst)) return error; - if (auto error = LimitCheckSwitch(_, inst)) return error; - if (auto error = ReservedCheck(_, inst)) return error; - - // All instruction checks have passed. - return SPV_SUCCESS; -} -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_layout.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_layout.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_layout.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_layout.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,207 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Source code for logical layout validation as described in section 2.4 - -#include "validate.h" - -#include - -#include "diagnostic.h" -#include "opcode.h" -#include "operand.h" -#include "spirv-tools/libspirv.h" -#include "val/function.h" -#include "val/validation_state.h" - -using libspirv::ValidationState_t; -using libspirv::kLayoutMemoryModel; -using libspirv::kLayoutFunctionDeclarations; -using libspirv::kLayoutFunctionDefinitions; -using libspirv::FunctionDecl; - -namespace { -// Module scoped instructions are processed by determining if the opcode -// is part of the current layout section. If it is not then the next sections is -// checked. -spv_result_t ModuleScopedInstructions(ValidationState_t& _, - const spv_parsed_instruction_t* inst, - SpvOp opcode) { - while (_.IsOpcodeInCurrentLayoutSection(opcode) == false) { - _.ProgressToNextLayoutSectionOrder(); - - switch (_.current_layout_section()) { - case kLayoutMemoryModel: - if (opcode != SpvOpMemoryModel) { - return _.diag(SPV_ERROR_INVALID_LAYOUT) - << spvOpcodeString(opcode) - << " cannot appear before the memory model instruction"; - } - break; - case kLayoutFunctionDeclarations: - // All module sections have been processed. Recursively call - // ModuleLayoutPass to process the next section of the module - return libspirv::ModuleLayoutPass(_, inst); - default: - break; - } - } - return SPV_SUCCESS; -} - -// Function declaration validation is performed by making sure that the -// FunctionParameter and FunctionEnd instructions only appear inside of -// functions. It also ensures that the Function instruction does not appear -// inside of another function. This stage ends when the first label is -// encountered inside of a function. -spv_result_t FunctionScopedInstructions(ValidationState_t& _, - const spv_parsed_instruction_t* inst, - SpvOp opcode) { - if (_.IsOpcodeInCurrentLayoutSection(opcode)) { - switch (opcode) { - case SpvOpFunction: { - if (_.in_function_body()) { - return _.diag(SPV_ERROR_INVALID_LAYOUT) - << "Cannot declare a function in a function body"; - } - auto control_mask = static_cast( - inst->words[inst->operands[2].offset]); - if (auto error = - _.RegisterFunction(inst->result_id, inst->type_id, control_mask, - inst->words[inst->operands[3].offset])) - return error; - if (_.current_layout_section() == kLayoutFunctionDefinitions) { - if (auto error = _.current_function().RegisterSetFunctionDeclType( - FunctionDecl::kFunctionDeclDefinition)) - return error; - } - } break; - - case SpvOpFunctionParameter: - if (_.in_function_body() == false) { - return _.diag(SPV_ERROR_INVALID_LAYOUT) << "Function parameter " - "instructions must be in " - "a function body"; - } - if (_.current_function().block_count() != 0) { - return _.diag(SPV_ERROR_INVALID_LAYOUT) - << "Function parameters must only appear immediately after " - "the function definition"; - } - if (auto error = _.current_function().RegisterFunctionParameter( - inst->result_id, inst->type_id)) - return error; - break; - - case SpvOpFunctionEnd: - if (_.in_function_body() == false) { - return _.diag(SPV_ERROR_INVALID_LAYOUT) - << "Function end instructions must be in a function body"; - } - if (_.in_block()) { - return _.diag(SPV_ERROR_INVALID_LAYOUT) - << "Function end cannot be called in blocks"; - } - if (_.current_function().block_count() == 0 && - _.current_layout_section() == kLayoutFunctionDefinitions) { - return _.diag(SPV_ERROR_INVALID_LAYOUT) << "Function declarations " - "must appear before " - "function definitions."; - } - if (_.current_layout_section() == kLayoutFunctionDeclarations) { - if (auto error = _.current_function().RegisterSetFunctionDeclType( - FunctionDecl::kFunctionDeclDeclaration)) - return error; - } - if (auto error = _.RegisterFunctionEnd()) return error; - break; - - case SpvOpLine: - case SpvOpNoLine: - break; - case SpvOpLabel: - // If the label is encountered then the current function is a - // definition so set the function to a declaration and update the - // module section - if (_.in_function_body() == false) { - return _.diag(SPV_ERROR_INVALID_LAYOUT) - << "Label instructions must be in a function body"; - } - if (_.in_block()) { - return _.diag(SPV_ERROR_INVALID_LAYOUT) - << "A block must end with a branch instruction."; - } - if (_.current_layout_section() == kLayoutFunctionDeclarations) { - _.ProgressToNextLayoutSectionOrder(); - if (auto error = _.current_function().RegisterSetFunctionDeclType( - FunctionDecl::kFunctionDeclDefinition)) - return error; - } - break; - - default: - if (_.current_layout_section() == kLayoutFunctionDeclarations && - _.in_function_body()) { - return _.diag(SPV_ERROR_INVALID_LAYOUT) - << "A function must begin with a label"; - } else { - if (_.in_block() == false) { - return _.diag(SPV_ERROR_INVALID_LAYOUT) - << spvOpcodeString(opcode) << " must appear in a block"; - } - } - break; - } - } else { - return _.diag(SPV_ERROR_INVALID_LAYOUT) - << spvOpcodeString(opcode) - << " cannot appear in a function declaration"; - } - return SPV_SUCCESS; -} -} /// namespace - -namespace libspirv { -// TODO(umar): Check linkage capabilities for function declarations -// TODO(umar): Better error messages -// NOTE: This function does not handle CFG related validation -// Performs logical layout validation. See Section 2.4 -spv_result_t ModuleLayoutPass(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - const SpvOp opcode = static_cast(inst->opcode); - - switch (_.current_layout_section()) { - case kLayoutCapabilities: - case kLayoutExtensions: - case kLayoutExtInstImport: - case kLayoutMemoryModel: - case kLayoutEntryPoint: - case kLayoutExecutionMode: - case kLayoutDebug1: - case kLayoutDebug2: - case kLayoutDebug3: - case kLayoutAnnotations: - case kLayoutTypes: - if (auto error = ModuleScopedInstructions(_, inst, opcode)) return error; - break; - case kLayoutFunctionDeclarations: - case kLayoutFunctionDefinitions: - if (auto error = FunctionScopedInstructions(_, inst, opcode)) { - return error; - } - break; - } - return SPV_SUCCESS; -} -} /// namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_logicals.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_logicals.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_logicals.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_logicals.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,288 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Validates correctness of logical SPIR-V instructions. - -#include "validate.h" - -#include "diagnostic.h" -#include "opcode.h" -#include "val/instruction.h" -#include "val/validation_state.h" - -namespace libspirv { - -namespace { - -// Returns operand word for given instruction and operand index. -// The operand is expected to only have one word. -inline uint32_t GetOperandWord(const spv_parsed_instruction_t* inst, - size_t operand_index) { - assert(operand_index < inst->num_operands); - const spv_parsed_operand_t& operand = inst->operands[operand_index]; - assert(operand.num_words == 1); - return inst->words[operand.offset]; -} - -// Returns the type id of instruction operand at |operand_index|. -// The operand is expected to be an id. -inline uint32_t GetOperandTypeId(ValidationState_t& _, - const spv_parsed_instruction_t* inst, - size_t operand_index) { - return _.GetTypeId(GetOperandWord(inst, operand_index)); -} - -} - -// Validates correctness of logical instructions. -spv_result_t LogicalsPass(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - const SpvOp opcode = static_cast(inst->opcode); - const uint32_t result_type = inst->type_id; - - switch (opcode) { - case SpvOpAny: - case SpvOpAll: { - if (!_.IsBoolScalarType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected bool scalar type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t vector_type = GetOperandTypeId(_, inst, 2); - if (!vector_type || !_.IsBoolVectorType(vector_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected operand to be vector bool: " - << spvOpcodeString(opcode); - - break; - } - - case SpvOpIsNan: - case SpvOpIsInf: - case SpvOpIsFinite: - case SpvOpIsNormal: - case SpvOpSignBitSet: { - if (!_.IsBoolScalarType(result_type) && - !_.IsBoolVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected bool scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t operand_type = GetOperandTypeId(_, inst, 2); - if (!operand_type || (!_.IsFloatScalarType(operand_type) && - !_.IsFloatVectorType(operand_type))) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected operand to be scalar or vector float: " - << spvOpcodeString(opcode); - - if (_.GetDimension(result_type) != _.GetDimension(operand_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected vector sizes of Result Type and the operand to be equal: " - << spvOpcodeString(opcode); - - break; - } - - - case SpvOpFOrdEqual: - case SpvOpFUnordEqual: - case SpvOpFOrdNotEqual: - case SpvOpFUnordNotEqual: - case SpvOpFOrdLessThan: - case SpvOpFUnordLessThan: - case SpvOpFOrdGreaterThan: - case SpvOpFUnordGreaterThan: - case SpvOpFOrdLessThanEqual: - case SpvOpFUnordLessThanEqual: - case SpvOpFOrdGreaterThanEqual: - case SpvOpFUnordGreaterThanEqual: - case SpvOpLessOrGreater: - case SpvOpOrdered: - case SpvOpUnordered: { - if (!_.IsBoolScalarType(result_type) && - !_.IsBoolVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected bool scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t left_operand_type = GetOperandTypeId(_, inst, 2); - if (!left_operand_type || (!_.IsFloatScalarType(left_operand_type) && - !_.IsFloatVectorType(left_operand_type))) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected operands to be scalar or vector float: " - << spvOpcodeString(opcode); - - if (_.GetDimension(result_type) != _.GetDimension(left_operand_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected vector sizes of Result Type and the operands to be equal: " - << spvOpcodeString(opcode); - - if (left_operand_type != GetOperandTypeId(_, inst, 3)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected left and right operands to have the same type: " - << spvOpcodeString(opcode); - - break; - } - - case SpvOpLogicalEqual: - case SpvOpLogicalNotEqual: - case SpvOpLogicalOr: - case SpvOpLogicalAnd: { - if (!_.IsBoolScalarType(result_type) && - !_.IsBoolVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected bool scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - if (result_type != GetOperandTypeId(_, inst, 2) || - result_type != GetOperandTypeId(_, inst, 3)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected both operands to be of Result Type: " - << spvOpcodeString(opcode); - - break; - } - - case SpvOpLogicalNot: { - if (!_.IsBoolScalarType(result_type) && - !_.IsBoolVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected bool scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - if (result_type != GetOperandTypeId(_, inst, 2)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected operand to be of Result Type: " - << spvOpcodeString(opcode); - - break; - } - - case SpvOpSelect: { - uint32_t dimension = 1; - { - const Instruction* type_inst = _.FindDef(result_type); - assert(type_inst); - - const SpvOp type_opcode = type_inst->opcode(); - switch (type_opcode) { - case SpvOpTypePointer: { - if (!_.features().variable_pointers && - !_.features().variable_pointers_storage_buffer) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Using pointers with OpSelect requires capability " - << "VariablePointers or VariablePointersStorageBuffer"; - break; - } - - case SpvOpTypeVector: { - dimension = type_inst->word(3); - break; - } - - case SpvOpTypeBool: - case SpvOpTypeInt: - case SpvOpTypeFloat: { - break; - } - - default: { - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - } - } - } - - const uint32_t condition_type = GetOperandTypeId(_, inst, 2); - const uint32_t left_type = GetOperandTypeId(_, inst, 3); - const uint32_t right_type = GetOperandTypeId(_, inst, 4); - - if (!condition_type || (!_.IsBoolScalarType(condition_type) && - !_.IsBoolVectorType(condition_type))) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected bool scalar or vector type as condition: " - << spvOpcodeString(opcode); - - if (_.GetDimension(condition_type) != dimension) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected vector sizes of Result Type and the condition to be" - << " equal: " << spvOpcodeString(opcode); - - if (result_type != left_type || result_type != right_type) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected both objects to be of Result Type: " - << spvOpcodeString(opcode); - - break; - } - - case SpvOpIEqual: - case SpvOpINotEqual: - case SpvOpUGreaterThan: - case SpvOpUGreaterThanEqual: - case SpvOpULessThan: - case SpvOpULessThanEqual: - case SpvOpSGreaterThan: - case SpvOpSGreaterThanEqual: - case SpvOpSLessThan: - case SpvOpSLessThanEqual: { - if (!_.IsBoolScalarType(result_type) && - !_.IsBoolVectorType(result_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected bool scalar or vector type as Result Type: " - << spvOpcodeString(opcode); - - const uint32_t left_type = GetOperandTypeId(_, inst, 2); - const uint32_t right_type = GetOperandTypeId(_, inst, 3); - - if (!left_type || (!_.IsIntScalarType(left_type) && - !_.IsIntVectorType(left_type))) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected operands to be scalar or vector int: " - << spvOpcodeString(opcode); - - if (_.GetDimension(result_type) != _.GetDimension(left_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected vector sizes of Result Type and the operands to be" - << " equal: " << spvOpcodeString(opcode); - - if (!right_type || (!_.IsIntScalarType(right_type) && - !_.IsIntVectorType(right_type))) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected operands to be scalar or vector int: " - << spvOpcodeString(opcode); - - if (_.GetDimension(result_type) != _.GetDimension(right_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected vector sizes of Result Type and the operands to be" - << " equal: " << spvOpcodeString(opcode); - - if (_.GetBitWidth(left_type) != _.GetBitWidth(right_type)) - return _.diag(SPV_ERROR_INVALID_DATA) - << "Expected both operands to have the same component bit width: " - << spvOpcodeString(opcode); - - break; - } - - default: - break; - } - - return SPV_SUCCESS; -} - -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_type_unique.cpp vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_type_unique.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/source/validate_type_unique.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/source/validate_type_unique.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Ensures type declarations are unique unless allowed by the specification. - -#include "validate.h" - -#include "diagnostic.h" -#include "opcode.h" -#include "val/instruction.h" -#include "val/validation_state.h" - -namespace libspirv { - -// Validates that type declarations are unique, unless multiple declarations -// of the same data type are allowed by the specification. -// (see section 2.8 Types and Variables) -// Doesn't do anything if SPV_VAL_ignore_type_decl_unique was declared in the -// module. -spv_result_t TypeUniquePass(ValidationState_t& _, - const spv_parsed_instruction_t* inst) { - if (_.HasExtension(Extension::kSPV_VALIDATOR_ignore_type_decl_unique)) - return SPV_SUCCESS; - - const SpvOp opcode = static_cast(inst->opcode); - - if (spvOpcodeGeneratesType(opcode)) { - if (opcode == SpvOpTypeArray || opcode == SpvOpTypeRuntimeArray || - opcode == SpvOpTypeStruct) { - // Duplicate declarations of aggregates are allowed. - return SPV_SUCCESS; - } - - if (inst->opcode == SpvOpTypePointer && - _.HasExtension(Extension::kSPV_KHR_variable_pointers)) { - // Duplicate pointer types are allowed with this extension. - return SPV_SUCCESS; - } - - if (!_.RegisterUniqueTypeDeclaration(*inst)) { - return _.diag(SPV_ERROR_INVALID_DATA) - << "Duplicate non-aggregate type declarations are not allowed." - << " Opcode: " << spvOpcodeString(SpvOp(inst->opcode)) - << " id: " << inst->result_id; - } - } - - return SPV_SUCCESS; -} - -} // namespace libspirv diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/syntax.md vulkan-1.1.73+dfsg/external/spirv-tools/syntax.md --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/syntax.md 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/syntax.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,238 +0,0 @@ -# SPIR-V Assembly language syntax - -## Overview - -The assembly attempts to adhere to the binary form from Section 3 of the SPIR-V -spec as closely as possible, with one exception aiming at improving the text's -readability. The `` generated by an instruction is moved to the -beginning of that instruction and followed by an `=` sign. This allows us to -distinguish between variable definitions and uses and locate value definitions -more easily. - -Here is an example: - -``` - OpCapability Shader - OpMemoryModel Logical Simple - OpEntryPoint GLCompute %3 "main" - OpExecutionMode %3 LocalSize 64 64 1 -%1 = OpTypeVoid -%2 = OpTypeFunction %1 -%3 = OpFunction %1 None %2 -%4 = OpLabel - OpReturn - OpFunctionEnd -``` - -A module is a sequence of instructions, separated by whitespace. -An instruction is an opcode name followed by operands, separated by -whitespace. Typically each instruction is presented on its own line, -but the assembler does not enforce this rule. - -The opcode names and expected operands are described in Section 3 of -the SPIR-V specification. An operand is one of: -* a literal integer: A decimal integer, or a hexadecimal integer. - A hexadecimal integer is indicated by a leading `0x` or `0X`. A hex - integer supplied for a signed integer value will be sign-extended. - For example, `0xffff` supplied as the literal for an `OpConstant` - on a signed 16-bit integer type will be interpreted as the value `-1`. -* a literal floating point number, in decimal or hexadecimal form. - See [below](#floats). -* a literal string. - * A literal string is everything following a double-quote `"` until the - following un-escaped double-quote. This includes special characters such - as newlines. - * A backslash `\` may be used to escape characters in the string. The `\` - may be used to escape a double-quote or a `\` but is simply ignored when - preceding any other character. -* a named enumerated value, specific to that operand position. For example, - the `OpMemoryModel` takes a named Addressing Model operand (e.g. `Logical` or - `Physical32`), and a named Memory Model operand (e.g. `Simple` or `OpenCL`). - Named enumerated values are only meaningful in specific positions, and will - otherwise generate an error. -* a mask expression, consisting of one or more mask enum names separated - by `|`. For example, the expression `NotNaN|NotInf|NSZ` denotes the mask - which is the combination of the `NotNaN`, `NotInf`, and `NSZ` flags. -* an injected immediate integer: `!`. See [below](#immediate). -* an ID, e.g. `%foo`. See [below](#id). -* the name of an extended instruction. For example, `sqrt` in an extended - instruction such as `%f = OpExtInst %f32 %OpenCLImport sqrt %arg` -* the name of an opcode for OpSpecConstantOp, but where the `Op` prefix - is removed. For example, the following indicates the use of an integer - addition in a specialization constant computation: - `%sum = OpSpecConstantOp %i32 IAdd %a %b` - -## ID Definitions & Usage - - -An ID _definition_ pertains to the `` of an instruction, and ID -_usage_ is a use of an ID as an input to an instruction. - -An ID in the assembly language begins with `%` and must be followed by a name -consisting of one or more letters, numbers or underscore characters. - -For every ID in the assembly program, the assembler generates a unique number -called the ID's internal number. Then each ID reference translates into its -internal number in the SPIR-V output. Internal numbers are unique within the -compilation unit: no two IDs in the same unit will share internal numbers. - -The disassembler generates IDs where the name is always a decimal number -greater than 0. - -So the example can be rewritten using more user-friendly names, as follows: -``` - OpCapability Shader - OpMemoryModel Logical Simple - OpEntryPoint GLCompute %main "main" - OpExecutionMode %main LocalSize 64 64 1 - %void = OpTypeVoid -%fnMain = OpTypeFunction %void - %main = OpFunction %void None %fnMain -%lbMain = OpLabel - OpReturn - OpFunctionEnd -``` - -## Floating point literals - - -The assembler and disassembler support floating point literals in both -decimal and hexadecimal form. - -The syntax for a floating point literal is the same as floating point -constants in the C programming language, except: -* An optional leading minus (`-`) is part of the literal. -* An optional type specifier suffix is not allowed. -Infinity and NaN values are expressed in hexadecimal float literals -by using the maximum representable exponent for the bit width. - -For example, in 32-bit floating point, 8 bits are used for the exponent, and the -exponent bias is 127. So the maximum representable unbiased exponent is 128. -Therefore, we represent the infinities and some NaNs as follows: - -``` -%float32 = OpTypeFloat 32 -%inf = OpConstant %float32 0x1p+128 -%neginf = OpConstant %float32 -0x1p+128 -%aNaN = OpConstant %float32 0x1.8p+128 -%moreNaN = OpConstant %float32 -0x1.0002p+128 -``` -The assembler preserves all the bits of a NaN value. For example, the encoding -of `%aNaN` in the previous example is the same as the word with bits -`0x7fc00000`, and `%moreNaN` is encoded as `0xff800100`. - -The disassembler prints infinite, NaN, and subnormal values in hexadecimal form. -Zero and normal values are printed in decimal form with enough digits -to preserve all significand bits. - -## Arbitrary Integers - - -When writing tests it can be useful to emit an invalid 32 bit word into the -binary stream at arbitrary positions within the assembly. To specify an -arbitrary word into the stream the prefix `!` is used, this takes the form -`!`. Here is an example. - -``` -OpCapability !0x0000FF00 -``` - -Any token in a valid assembly program may be replaced by `!` -- even -tokens that dictate how the rest of the instruction is parsed. Consider, for -example, the following assembly program: - -``` -%4 = OpConstant %1 123 456 789 OpExecutionMode %2 LocalSize 11 22 33 -OpExecutionMode %3 InputLines -``` - -The tokens `OpConstant`, `LocalSize`, and `InputLines` may be replaced by random -`!` values, and the assembler will still assemble an output binary with -three instructions. It will not necessarily be valid SPIR-V, but it will -faithfully reflect the input text. - -You may wonder how the assembler recognizes the instruction structure (including -instruction boundaries) in the text with certain crucial tokens replaced by -arbitrary integers. If, say, `OpConstant` becomes a `!` whose value -differs from the binary representation of `OpConstant` (remember that this -feature is intended for fine-grain control in SPIR-V testing), the assembler -generally has no idea what that value stands for. So how does it know there is -exactly one `` and three number literals following in that instruction, -before the next one begins? And if `LocalSize` is replaced by an arbitrary -`!`, how does it know to take the next three tokens (instead of zero or -one, both of which are possible in the absence of certainty that `LocalSize` -provided)? The answer is a simple rule governing the parsing of instructions -with `!` in them: - -When a token in the assembly program is a `!`, that integer value is -emitted into the binary output, and parsing proceeds differently than before: -each subsequent token not recognized as an OpCode or a is emitted -into the binary output without any checking; when a recognizable OpCode or a - is eventually encountered, it begins a new instruction and parsing -returns to normal. (If a subsequent OpCode is never found, then this alternate -parsing mode handles all the remaining tokens in the program.) - -The assembler processes the tokens encountered in alternate parsing mode as -follows: - -* If the token is a number literal, since context may be lost, the number - is interpreted as a 32-bit value and output as a single word. In order to - specify multiple-word literals in alternate-parsing mode, further uses of - `!` tokens may be required. - All formats supported by `strtoul()` are accepted. -* If the token is a string literal, it outputs a sequence of words representing - the string as defined in the SPIR-V specification for Literal String. -* If the token is an ID, it outputs the ID's internal number. -* If the token is another `!`, it outputs that integer. -* Any other token causes the assembler to quit with an error. - -Note that this has some interesting consequences, including: - -* When an OpCode is replaced by `!`, the integer value should encode - the instruction's word count, as specified in the physical-layout section of - the SPIR-V specification. - -* Consecutive instructions may have their OpCode replaced by `!` and - still produce valid SPIR-V. For example, `!262187 %1 %2 "abc" !327739 %1 %3 6 - %2` will successfully assemble into SPIR-V declaring a constant and a - PrivateGlobal variable. - -* Enums (such as `DontInline` or `SubgroupMemory`, for instance) are not handled - by the alternate parsing mode. They must be replaced by `!` for - successful assembly. - -* The `` on the left-hand side of an assignment cannot be a - `!`. The `` can be still be manually controlled if desired - by expressing the entire instruction as `!` tokens for its opcode and - operands. - -* The `=` sign cannot be processed by the alternate parsing mode if the OpCode - following it is a `!`. - -* When replacing a named ID with `!`, it is possible to generate - unintentionally valid SPIR-V. If the integer provided happens to equal a - number generated for an existing named ID, it will result in a reference to - that named ID being output. This may be valid SPIR-V, contrary to the - presumed intention of the writer. - -## Notes - -* Some enumerants cannot be used by name, because the target instruction -in which they are meaningful take an ID reference instead of a literal value. -For example: - * Named enumerated value `CmdExecTime` from section 3.30 Kernel - Profiling Info is used in constructing a mask value supplied as - an ID for `OpCaptureEventProfilingInfo`. But no other instruction - has enough context to bring the enumerant names from section 3.30 - into scope. - * Similarly, the names in section 3.29 Kernel Enqueue Flags are used to - construct a value supplied as an ID to the Flags argument of - OpEnqueueKernel. - * Similarly for the names in section 3.25 Memory Semantics. - * Similarly for the names in section 3.27 Scope. -* Some enumerants cannot be used by name, because they only name values -returned by an instruction: - * Enumerants from 3.12 Image Channel Order name possible values returned - by the `OpImageQueryOrder` instruction. - * Enumerants from 3.13 Image Channel Data Type name possible values - returned by the `OpImageQueryFormat` instruction. diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/assembly_context_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/assembly_context_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/assembly_context_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/assembly_context_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -#include -#include - -#include "source/instruction.h" - -using libspirv::AssemblyContext; -using spvtest::AutoText; -using spvtest::Concatenate; -using ::testing::Eq; - -namespace { - -struct EncodeStringCase { - std::string str; - std::vector initial_contents; -}; - -using EncodeStringTest = ::testing::TestWithParam; - -TEST_P(EncodeStringTest, Sample) { - AssemblyContext context(AutoText(""), nullptr); - spv_instruction_t inst; - inst.words = GetParam().initial_contents; - ASSERT_EQ(SPV_SUCCESS, - context.binaryEncodeString(GetParam().str.c_str(), &inst)); - // We already trust MakeVector - EXPECT_THAT(inst.words, - Eq(Concatenate({GetParam().initial_contents, - spvtest::MakeVector(GetParam().str)}))); -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - BinaryEncodeString, EncodeStringTest, - ::testing::ValuesIn(std::vector{ - // Use cases that exercise at least one to two words, - // and both empty and non-empty initial contents. - {"", {}}, - {"", {1,2,3}}, - {"a", {}}, - {"a", {4}}, - {"ab", {4}}, - {"abc", {}}, - {"abc", {18}}, - {"abcd", {}}, - {"abcd", {22}}, - {"abcde", {4}}, - {"abcdef", {}}, - {"abcdef", {99,42}}, - {"abcdefg", {}}, - {"abcdefg", {101}}, - {"abcdefgh", {}}, - {"abcdefgh", {102, 103, 104}}, - // A very long string, encoded after an initial word. - // SPIR-V limits strings to 65535 characters. - {std::string(65535, 'a'), {1}}, - }),); -// clang-format on - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/assembly_format_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/assembly_format_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/assembly_format_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/assembly_format_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "test_fixture.h" - -namespace { - -using spvtest::ScopedContext; -using spvtest::TextToBinaryTest; - -TEST_F(TextToBinaryTest, NotPlacingResultIDAtTheBeginning) { - SetText("OpTypeMatrix %1 %2 1000"); - EXPECT_EQ(SPV_ERROR_INVALID_TEXT, - spvTextToBinary(ScopedContext().context, text.str, text.length, - &binary, &diagnostic)); - ASSERT_NE(nullptr, diagnostic); - EXPECT_STREQ( - "Expected at the beginning of an instruction, found " - "'OpTypeMatrix'.", - diagnostic->error); - EXPECT_EQ(0u, diagnostic->position.line); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/binary_destroy_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/binary_destroy_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/binary_destroy_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/binary_destroy_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -#include "test_fixture.h" - -namespace { - -using spvtest::ScopedContext; - -TEST(BinaryDestroy, Null) { - // There is no state or return value to check. Just check - // for the ability to call the API without abnormal termination. - spvBinaryDestroy(nullptr); -} - -using BinaryDestroySomething = spvtest::TextToBinaryTest; - -// Checks safety of destroying a validly constructed binary. -TEST_F(BinaryDestroySomething, Default) { - // Use a binary object constructed by the API instead of rolling our own. - SetText("OpSource OpenCL_C 120"); - spv_binary my_binary = nullptr; - ASSERT_EQ(SPV_SUCCESS, spvTextToBinary(ScopedContext().context, text.str, - text.length, &my_binary, &diagnostic)); - ASSERT_NE(nullptr, my_binary); - spvBinaryDestroy(my_binary); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/binary_endianness_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/binary_endianness_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/binary_endianness_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/binary_endianness_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -namespace { - -TEST(BinaryEndianness, InvalidCode) { - uint32_t invalidMagicNumber[] = {0}; - spv_const_binary_t binary = {invalidMagicNumber, 1}; - spv_endianness_t endian; - ASSERT_EQ(SPV_ERROR_INVALID_BINARY, spvBinaryEndianness(&binary, &endian)); -} - -TEST(BinaryEndianness, Little) { - uint32_t magicNumber; - if (I32_ENDIAN_HOST == I32_ENDIAN_LITTLE) { - magicNumber = 0x07230203; - } else { - magicNumber = 0x03022307; - } - spv_const_binary_t binary = {&magicNumber, 1}; - spv_endianness_t endian; - ASSERT_EQ(SPV_SUCCESS, spvBinaryEndianness(&binary, &endian)); - ASSERT_EQ(SPV_ENDIANNESS_LITTLE, endian); -} - -TEST(BinaryEndianness, Big) { - uint32_t magicNumber; - if (I32_ENDIAN_HOST == I32_ENDIAN_BIG) { - magicNumber = 0x07230203; - } else { - magicNumber = 0x03022307; - } - spv_const_binary_t binary = {&magicNumber, 1}; - spv_endianness_t endian; - ASSERT_EQ(SPV_SUCCESS, spvBinaryEndianness(&binary, &endian)); - ASSERT_EQ(SPV_ENDIANNESS_BIG, endian); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/binary_header_get_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/binary_header_get_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/binary_header_get_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/binary_header_get_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/spirv_constant.h" -#include "unit_spirv.h" - -namespace { - -class BinaryHeaderGet : public ::testing::Test { - public: - BinaryHeaderGet() { memset(code, 0, sizeof(code)); } - - virtual void SetUp() { - code[0] = SpvMagicNumber; - code[1] = SpvVersion; - code[2] = SPV_GENERATOR_CODEPLAY; - code[3] = 1; // NOTE: Bound - code[4] = 0; // NOTE: Schema; reserved - code[5] = 0; // NOTE: Instructions - - binary.code = code; - binary.wordCount = 6; - } - spv_const_binary_t get_const_binary() { - return spv_const_binary_t{binary.code, binary.wordCount}; - } - virtual void TearDown() {} - - uint32_t code[6]; - spv_binary_t binary; -}; - -TEST_F(BinaryHeaderGet, Default) { - spv_endianness_t endian; - spv_const_binary_t const_bin = get_const_binary(); - ASSERT_EQ(SPV_SUCCESS, spvBinaryEndianness(&const_bin, &endian)); - - spv_header_t header; - ASSERT_EQ(SPV_SUCCESS, spvBinaryHeaderGet(&const_bin, endian, &header)); - - ASSERT_EQ(static_cast(SpvMagicNumber), header.magic); - ASSERT_EQ(0x00010200u, header.version); - ASSERT_EQ(static_cast(SPV_GENERATOR_CODEPLAY), header.generator); - ASSERT_EQ(1u, header.bound); - ASSERT_EQ(0u, header.schema); - ASSERT_EQ(&code[5], header.instructions); -} - -TEST_F(BinaryHeaderGet, InvalidCode) { - spv_const_binary_t my_binary = {nullptr, 0}; - spv_header_t header; - ASSERT_EQ(SPV_ERROR_INVALID_BINARY, - spvBinaryHeaderGet(&my_binary, SPV_ENDIANNESS_LITTLE, &header)); -} - -TEST_F(BinaryHeaderGet, InvalidPointerHeader) { - spv_const_binary_t const_bin = get_const_binary(); - ASSERT_EQ(SPV_ERROR_INVALID_POINTER, - spvBinaryHeaderGet(&const_bin, SPV_ENDIANNESS_LITTLE, nullptr)); -} - -TEST_F(BinaryHeaderGet, TruncatedHeader) { - for (uint8_t i = 1; i < SPV_INDEX_INSTRUCTION; i++) { - binary.wordCount = i; - spv_const_binary_t const_bin = get_const_binary(); - ASSERT_EQ(SPV_ERROR_INVALID_BINARY, - spvBinaryHeaderGet(&const_bin, SPV_ENDIANNESS_LITTLE, nullptr)); - } -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/binary_parse_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/binary_parse_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/binary_parse_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/binary_parse_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,896 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include - -#include "test_fixture.h" -#include "unit_spirv.h" -#include "gmock/gmock.h" -#include "source/message.h" -#include "source/table.h" -#include "spirv/1.0/OpenCL.std.h" - -// Returns true if two spv_parsed_operand_t values are equal. -// To use this operator, this definition must appear in the same namespace -// as spv_parsed_operand_t. -static bool operator==(const spv_parsed_operand_t& a, - const spv_parsed_operand_t& b) { - return a.offset == b.offset && a.num_words == b.num_words && - a.type == b.type && a.number_kind == b.number_kind && - a.number_bit_width == b.number_bit_width; -} - -namespace { - -using ::spvtest::Concatenate; -using ::spvtest::MakeInstruction; -using ::spvtest::MakeVector; -using ::spvtest::ScopedContext; -using ::testing::AnyOf; -using ::testing::Eq; -using ::testing::InSequence; -using ::testing::Return; -using ::testing::_; - -// An easily-constructible and comparable object for the contents of an -// spv_parsed_instruction_t. Unlike spv_parsed_instruction_t, owns the memory -// of its components. -struct ParsedInstruction { - explicit ParsedInstruction(const spv_parsed_instruction_t& inst) - : words(inst.words, inst.words + inst.num_words), - opcode(static_cast(inst.opcode)), - ext_inst_type(inst.ext_inst_type), - type_id(inst.type_id), - result_id(inst.result_id), - operands(inst.operands, inst.operands + inst.num_operands) {} - - std::vector words; - SpvOp opcode; - spv_ext_inst_type_t ext_inst_type; - uint32_t type_id; - uint32_t result_id; - std::vector operands; - - bool operator==(const ParsedInstruction& b) const { - return words == b.words && opcode == b.opcode && - ext_inst_type == b.ext_inst_type && type_id == b.type_id && - result_id == b.result_id && operands == b.operands; - } -}; - -// Prints a ParsedInstruction object to the given output stream, and returns -// the stream. -std::ostream& operator<<(std::ostream& os, const ParsedInstruction& inst) { - os << "\nParsedInstruction( {"; - spvtest::PrintTo(spvtest::WordVector(inst.words), &os); - os << "}, opcode: " << int(inst.opcode) - << " ext_inst_type: " << int(inst.ext_inst_type) - << " type_id: " << inst.type_id << " result_id: " << inst.result_id; - for (const auto& operand : inst.operands) { - os << " { offset: " << operand.offset << " num_words: " << operand.num_words - << " type: " << int(operand.type) - << " number_kind: " << int(operand.number_kind) - << " number_bit_width: " << int(operand.number_bit_width) << "}"; - } - os << ")"; - return os; -} - -// Sanity check for the equality operator on ParsedInstruction. -TEST(ParsedInstruction, ZeroInitializedAreEqual) { - spv_parsed_instruction_t pi = {}; - ParsedInstruction a(pi); - ParsedInstruction b(pi); - EXPECT_THAT(a, ::testing::TypedEq(b)); -} - -// Googlemock class receiving Header/Instruction calls from spvBinaryParse(). -class MockParseClient { - public: - MOCK_METHOD6(Header, spv_result_t(spv_endianness_t endian, uint32_t magic, - uint32_t version, uint32_t generator, - uint32_t id_bound, uint32_t reserved)); - MOCK_METHOD1(Instruction, spv_result_t(const ParsedInstruction&)); -}; - -// Casts user_data as MockParseClient and invokes its Header(). -spv_result_t invoke_header(void* user_data, spv_endianness_t endian, - uint32_t magic, uint32_t version, uint32_t generator, - uint32_t id_bound, uint32_t reserved) { - return static_cast(user_data)->Header( - endian, magic, version, generator, id_bound, reserved); -} - -// Casts user_data as MockParseClient and invokes its Instruction(). -spv_result_t invoke_instruction( - void* user_data, const spv_parsed_instruction_t* parsed_instruction) { - return static_cast(user_data)->Instruction( - ParsedInstruction(*parsed_instruction)); -} - -// The SPIR-V module header words for the Khronos Assembler generator, -// for a module with an ID bound of 1. -const uint32_t kHeaderForBound1[] = { - SpvMagicNumber, SpvVersion, - SPV_GENERATOR_WORD(SPV_GENERATOR_KHRONOS_ASSEMBLER, 0), 1 /*bound*/, - 0 /*schema*/}; - -// Returns the expected SPIR-V module header words for the Khronos -// Assembler generator, and with a given Id bound. -std::vector ExpectedHeaderForBound(uint32_t bound) { - return {SpvMagicNumber, 0x10000, - SPV_GENERATOR_WORD(SPV_GENERATOR_KHRONOS_ASSEMBLER, 0), bound, 0}; -} - -// Returns a parsed operand for a non-number value at the given word offset -// within an instruction. -spv_parsed_operand_t MakeSimpleOperand(uint16_t offset, - spv_operand_type_t type) { - return {offset, 1, type, SPV_NUMBER_NONE, 0}; -} - -// Returns a parsed operand for a literal unsigned integer value at the given -// word offset within an instruction. -spv_parsed_operand_t MakeLiteralNumberOperand(uint16_t offset) { - return {offset, 1, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_NUMBER_UNSIGNED_INT, - 32}; -} - -// Returns a parsed operand for a literal string value at the given -// word offset within an instruction. -spv_parsed_operand_t MakeLiteralStringOperand(uint16_t offset, - uint16_t length) { - return {offset, length, SPV_OPERAND_TYPE_LITERAL_STRING, SPV_NUMBER_NONE, 0}; -} - -// Returns a ParsedInstruction for an OpTypeVoid instruction that would -// generate the given result Id. -ParsedInstruction MakeParsedVoidTypeInstruction(uint32_t result_id) { - const auto void_inst = MakeInstruction(SpvOpTypeVoid, {result_id}); - const auto void_operands = std::vector{ - MakeSimpleOperand(1, SPV_OPERAND_TYPE_RESULT_ID)}; - const spv_parsed_instruction_t parsed_void_inst = { - void_inst.data(), - static_cast(void_inst.size()), - SpvOpTypeVoid, - SPV_EXT_INST_TYPE_NONE, - 0, // type id - result_id, - void_operands.data(), - static_cast(void_operands.size())}; - return ParsedInstruction(parsed_void_inst); -} - -// Returns a ParsedInstruction for an OpTypeInt instruction that generates -// the given result Id for a 32-bit signed integer scalar type. -ParsedInstruction MakeParsedInt32TypeInstruction(uint32_t result_id) { - const auto i32_inst = MakeInstruction(SpvOpTypeInt, {result_id, 32, 1}); - const auto i32_operands = std::vector{ - MakeSimpleOperand(1, SPV_OPERAND_TYPE_RESULT_ID), - MakeLiteralNumberOperand(2), MakeLiteralNumberOperand(3)}; - spv_parsed_instruction_t parsed_i32_inst = { - i32_inst.data(), - static_cast(i32_inst.size()), - SpvOpTypeInt, - SPV_EXT_INST_TYPE_NONE, - 0, // type id - result_id, - i32_operands.data(), - static_cast(i32_operands.size())}; - return ParsedInstruction(parsed_i32_inst); -} - -class BinaryParseTest : public spvtest::TextToBinaryTestBase<::testing::Test> { - protected: - void Parse(const SpirvVector& words, spv_result_t expected_result, - bool flip_words = false) { - SpirvVector flipped_words(words); - SCOPED_TRACE(flip_words ? "Flipped Endianness" : "Normal Endianness"); - if (flip_words) { - std::transform(flipped_words.begin(), flipped_words.end(), - flipped_words.begin(), [](const uint32_t raw_word) { - return spvFixWord(raw_word, - I32_ENDIAN_HOST == I32_ENDIAN_BIG - ? SPV_ENDIANNESS_LITTLE - : SPV_ENDIANNESS_BIG); - }); - } - EXPECT_EQ(expected_result, - spvBinaryParse(ScopedContext().context, &client_, - flipped_words.data(), flipped_words.size(), - invoke_header, invoke_instruction, &diagnostic_)); - } - - spv_diagnostic diagnostic_ = nullptr; - MockParseClient client_; -}; - -// Adds an EXPECT_CALL to client_->Header() with appropriate parameters, -// including bound. Returns the EXPECT_CALL result. -#define EXPECT_HEADER(bound) \ - EXPECT_CALL( \ - client_, \ - Header(AnyOf(SPV_ENDIANNESS_LITTLE, SPV_ENDIANNESS_BIG), SpvMagicNumber, \ - 0x10000, SPV_GENERATOR_WORD(SPV_GENERATOR_KHRONOS_ASSEMBLER, 0), \ - bound, 0 /*reserved*/)) - -static const bool kSwapEndians[] = {false, true}; - -TEST_F(BinaryParseTest, EmptyModuleHasValidHeaderAndNoInstructionCallbacks) { - for (bool endian_swap : kSwapEndians) { - const auto words = CompileSuccessfully(""); - EXPECT_HEADER(1).WillOnce(Return(SPV_SUCCESS)); - EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. - Parse(words, SPV_SUCCESS, endian_swap); - EXPECT_EQ(nullptr, diagnostic_); - } -} - -TEST_F(BinaryParseTest, NullDiagnosticsIsOkForGoodParse) { - const auto words = CompileSuccessfully(""); - EXPECT_HEADER(1).WillOnce(Return(SPV_SUCCESS)); - EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. - EXPECT_EQ( - SPV_SUCCESS, - spvBinaryParse(ScopedContext().context, &client_, words.data(), - words.size(), invoke_header, invoke_instruction, nullptr)); -} - -TEST_F(BinaryParseTest, NullDiagnosticsIsOkForBadParse) { - auto words = CompileSuccessfully(""); - words.push_back(0xffffffff); // Certainly invalid instruction header. - EXPECT_HEADER(1).WillOnce(Return(SPV_SUCCESS)); - EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. - EXPECT_EQ( - SPV_ERROR_INVALID_BINARY, - spvBinaryParse(ScopedContext().context, &client_, words.data(), - words.size(), invoke_header, invoke_instruction, nullptr)); -} - -// Make sure that we don't blow up when both the consumer and the diagnostic are -// null. -TEST_F(BinaryParseTest, NullConsumerNullDiagnosticsForBadParse) { - auto words = CompileSuccessfully(""); - - auto ctx = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); - SetContextMessageConsumer(ctx, nullptr); - - words.push_back(0xffffffff); // Certainly invalid instruction header. - EXPECT_HEADER(1).WillOnce(Return(SPV_SUCCESS)); - EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, - spvBinaryParse(ctx, &client_, words.data(), words.size(), - invoke_header, invoke_instruction, nullptr)); - - spvContextDestroy(ctx); -} - -TEST_F(BinaryParseTest, SpecifyConsumerNullDiagnosticsForGoodParse) { - const auto words = CompileSuccessfully(""); - - auto ctx = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); - int invocation = 0; - SetContextMessageConsumer( - ctx, [&invocation](spv_message_level_t, const char*, - const spv_position_t&, const char*) { ++invocation; }); - - EXPECT_HEADER(1).WillOnce(Return(SPV_SUCCESS)); - EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. - EXPECT_EQ(SPV_SUCCESS, - spvBinaryParse(ctx, &client_, words.data(), words.size(), - invoke_header, invoke_instruction, nullptr)); - EXPECT_EQ(0, invocation); - - spvContextDestroy(ctx); -} - -TEST_F(BinaryParseTest, SpecifyConsumerNullDiagnosticsForBadParse) { - auto words = CompileSuccessfully(""); - - auto ctx = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); - int invocation = 0; - SetContextMessageConsumer( - ctx, [&invocation](spv_message_level_t level, const char* source, - const spv_position_t& position, const char* message) { - ++invocation; - EXPECT_EQ(SPV_MSG_ERROR, level); - EXPECT_STREQ("input", source); - EXPECT_EQ(0u, position.line); - EXPECT_EQ(0u, position.column); - EXPECT_EQ(5u, position.index); - EXPECT_STREQ("Invalid opcode: 65535", message); - }); - - words.push_back(0xffffffff); // Certainly invalid instruction header. - EXPECT_HEADER(1).WillOnce(Return(SPV_SUCCESS)); - EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, - spvBinaryParse(ctx, &client_, words.data(), words.size(), - invoke_header, invoke_instruction, nullptr)); - EXPECT_EQ(1, invocation); - - spvContextDestroy(ctx); -} - -TEST_F(BinaryParseTest, SpecifyConsumerSpecifyDiagnosticsForGoodParse) { - const auto words = CompileSuccessfully(""); - - auto ctx = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); - int invocation = 0; - SetContextMessageConsumer( - ctx, [&invocation](spv_message_level_t, const char*, - const spv_position_t&, const char*) { ++invocation; }); - - EXPECT_HEADER(1).WillOnce(Return(SPV_SUCCESS)); - EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. - EXPECT_EQ(SPV_SUCCESS, - spvBinaryParse(ctx, &client_, words.data(), words.size(), - invoke_header, invoke_instruction, &diagnostic_)); - EXPECT_EQ(0, invocation); - EXPECT_EQ(nullptr, diagnostic_); - - spvContextDestroy(ctx); -} - -TEST_F(BinaryParseTest, SpecifyConsumerSpecifyDiagnosticsForBadParse) { - auto words = CompileSuccessfully(""); - - auto ctx = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); - int invocation = 0; - SetContextMessageConsumer( - ctx, [&invocation](spv_message_level_t, const char*, - const spv_position_t&, const char*) { ++invocation; }); - - words.push_back(0xffffffff); // Certainly invalid instruction header. - EXPECT_HEADER(1).WillOnce(Return(SPV_SUCCESS)); - EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, - spvBinaryParse(ctx, &client_, words.data(), words.size(), - invoke_header, invoke_instruction, &diagnostic_)); - EXPECT_EQ(0, invocation); - EXPECT_STREQ("Invalid opcode: 65535", diagnostic_->error); - - spvContextDestroy(ctx); -} - -TEST_F(BinaryParseTest, - ModuleWithSingleInstructionHasValidHeaderAndInstructionCallback) { - for (bool endian_swap : kSwapEndians) { - const auto words = CompileSuccessfully("%1 = OpTypeVoid"); - InSequence calls_expected_in_specific_order; - EXPECT_HEADER(2).WillOnce(Return(SPV_SUCCESS)); - EXPECT_CALL(client_, Instruction(MakeParsedVoidTypeInstruction(1))) - .WillOnce(Return(SPV_SUCCESS)); - Parse(words, SPV_SUCCESS, endian_swap); - EXPECT_EQ(nullptr, diagnostic_); - } -} - -TEST_F(BinaryParseTest, NullHeaderCallbackIsIgnored) { - const auto words = CompileSuccessfully("%1 = OpTypeVoid"); - EXPECT_CALL(client_, Header(_, _, _, _, _, _)) - .Times(0); // No header callback. - EXPECT_CALL(client_, Instruction(MakeParsedVoidTypeInstruction(1))) - .WillOnce(Return(SPV_SUCCESS)); - EXPECT_EQ(SPV_SUCCESS, spvBinaryParse(ScopedContext().context, &client_, - words.data(), words.size(), nullptr, - invoke_instruction, &diagnostic_)); - EXPECT_EQ(nullptr, diagnostic_); -} - -TEST_F(BinaryParseTest, NullInstructionCallbackIsIgnored) { - const auto words = CompileSuccessfully("%1 = OpTypeVoid"); - EXPECT_HEADER((2)).WillOnce(Return(SPV_SUCCESS)); - EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. - EXPECT_EQ(SPV_SUCCESS, - spvBinaryParse(ScopedContext().context, &client_, words.data(), - words.size(), invoke_header, nullptr, &diagnostic_)); - EXPECT_EQ(nullptr, diagnostic_); -} - -// Check the result of multiple instruction callbacks. -// -// This test exercises non-default values for the following members of the -// spv_parsed_instruction_t struct: words, num_words, opcode, result_id, -// operands, num_operands. -TEST_F(BinaryParseTest, TwoScalarTypesGenerateTwoInstructionCallbacks) { - for (bool endian_swap : kSwapEndians) { - const auto words = CompileSuccessfully( - "%1 = OpTypeVoid " - "%2 = OpTypeInt 32 1"); - InSequence calls_expected_in_specific_order; - EXPECT_HEADER(3).WillOnce(Return(SPV_SUCCESS)); - EXPECT_CALL(client_, Instruction(MakeParsedVoidTypeInstruction(1))) - .WillOnce(Return(SPV_SUCCESS)); - EXPECT_CALL(client_, Instruction(MakeParsedInt32TypeInstruction(2))) - .WillOnce(Return(SPV_SUCCESS)); - Parse(words, SPV_SUCCESS, endian_swap); - EXPECT_EQ(nullptr, diagnostic_); - } -} - -TEST_F(BinaryParseTest, EarlyReturnWithZeroPassingCallbacks) { - for (bool endian_swap : kSwapEndians) { - const auto words = CompileSuccessfully( - "%1 = OpTypeVoid " - "%2 = OpTypeInt 32 1"); - InSequence calls_expected_in_specific_order; - EXPECT_HEADER(3).WillOnce(Return(SPV_ERROR_INVALID_BINARY)); - // Early exit means no calls to Instruction(). - EXPECT_CALL(client_, Instruction(_)).Times(0); - Parse(words, SPV_ERROR_INVALID_BINARY, endian_swap); - // On error, the binary parser doesn't generate its own diagnostics. - EXPECT_EQ(nullptr, diagnostic_); - } -} - -TEST_F(BinaryParseTest, - EarlyReturnWithZeroPassingCallbacksAndSpecifiedResultCode) { - for (bool endian_swap : kSwapEndians) { - const auto words = CompileSuccessfully( - "%1 = OpTypeVoid " - "%2 = OpTypeInt 32 1"); - InSequence calls_expected_in_specific_order; - EXPECT_HEADER(3).WillOnce(Return(SPV_REQUESTED_TERMINATION)); - // Early exit means no calls to Instruction(). - EXPECT_CALL(client_, Instruction(_)).Times(0); - Parse(words, SPV_REQUESTED_TERMINATION, endian_swap); - // On early termination, the binary parser doesn't generate its own - // diagnostics. - EXPECT_EQ(nullptr, diagnostic_); - } -} - -TEST_F(BinaryParseTest, EarlyReturnWithOnePassingCallback) { - for (bool endian_swap : kSwapEndians) { - const auto words = CompileSuccessfully( - "%1 = OpTypeVoid " - "%2 = OpTypeInt 32 1 " - "%3 = OpTypeFloat 32"); - InSequence calls_expected_in_specific_order; - EXPECT_HEADER(4).WillOnce(Return(SPV_SUCCESS)); - EXPECT_CALL(client_, Instruction(MakeParsedVoidTypeInstruction(1))) - .WillOnce(Return(SPV_REQUESTED_TERMINATION)); - Parse(words, SPV_REQUESTED_TERMINATION, endian_swap); - // On early termination, the binary parser doesn't generate its own - // diagnostics. - EXPECT_EQ(nullptr, diagnostic_); - } -} - -TEST_F(BinaryParseTest, EarlyReturnWithTwoPassingCallbacks) { - for (bool endian_swap : kSwapEndians) { - const auto words = CompileSuccessfully( - "%1 = OpTypeVoid " - "%2 = OpTypeInt 32 1 " - "%3 = OpTypeFloat 32"); - InSequence calls_expected_in_specific_order; - EXPECT_HEADER(4).WillOnce(Return(SPV_SUCCESS)); - EXPECT_CALL(client_, Instruction(MakeParsedVoidTypeInstruction(1))) - .WillOnce(Return(SPV_SUCCESS)); - EXPECT_CALL(client_, Instruction(MakeParsedInt32TypeInstruction(2))) - .WillOnce(Return(SPV_REQUESTED_TERMINATION)); - Parse(words, SPV_REQUESTED_TERMINATION, endian_swap); - // On early termination, the binary parser doesn't generate its own - // diagnostics. - EXPECT_EQ(nullptr, diagnostic_); - } -} - -TEST_F(BinaryParseTest, InstructionWithStringOperand) { - const std::string str = - "the future is already here, it's just not evenly distributed"; - const auto str_words = MakeVector(str); - const auto instruction = MakeInstruction(SpvOpName, {99}, str_words); - const auto words = Concatenate({ExpectedHeaderForBound(100), instruction}); - InSequence calls_expected_in_specific_order; - EXPECT_HEADER(100).WillOnce(Return(SPV_SUCCESS)); - const auto operands = std::vector{ - MakeSimpleOperand(1, SPV_OPERAND_TYPE_ID), - MakeLiteralStringOperand(2, static_cast(str_words.size()))}; - EXPECT_CALL(client_, - Instruction(ParsedInstruction(spv_parsed_instruction_t{ - instruction.data(), static_cast(instruction.size()), - SpvOpName, SPV_EXT_INST_TYPE_NONE, 0 /*type id*/, - 0 /* No result id for OpName*/, operands.data(), - static_cast(operands.size())}))) - .WillOnce(Return(SPV_SUCCESS)); - // Since we are actually checking the output, don't test the - // endian-swapped version. - Parse(words, SPV_SUCCESS, false); - EXPECT_EQ(nullptr, diagnostic_); -} - -// Checks for non-zero values for the result_id and ext_inst_type members -// spv_parsed_instruction_t. -TEST_F(BinaryParseTest, ExtendedInstruction) { - const auto words = CompileSuccessfully( - "%extcl = OpExtInstImport \"OpenCL.std\" " - "%result = OpExtInst %float %extcl sqrt %x"); - EXPECT_HEADER(5).WillOnce(Return(SPV_SUCCESS)); - EXPECT_CALL(client_, Instruction(_)).WillOnce(Return(SPV_SUCCESS)); - // We're only interested in the second call to Instruction(): - const auto operands = std::vector{ - MakeSimpleOperand(1, SPV_OPERAND_TYPE_TYPE_ID), - MakeSimpleOperand(2, SPV_OPERAND_TYPE_RESULT_ID), - MakeSimpleOperand(3, - SPV_OPERAND_TYPE_ID), // Extended instruction set Id - MakeSimpleOperand(4, SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER), - MakeSimpleOperand(5, SPV_OPERAND_TYPE_ID), // Id of the argument - }; - const auto instruction = MakeInstruction( - SpvOpExtInst, - {2, 3, 1, static_cast(OpenCLLIB::Entrypoints::Sqrt), 4}); - EXPECT_CALL(client_, - Instruction(ParsedInstruction(spv_parsed_instruction_t{ - instruction.data(), static_cast(instruction.size()), - SpvOpExtInst, SPV_EXT_INST_TYPE_OPENCL_STD, 2 /*type id*/, - 3 /*result id*/, operands.data(), - static_cast(operands.size())}))) - .WillOnce(Return(SPV_SUCCESS)); - // Since we are actually checking the output, don't test the - // endian-swapped version. - Parse(words, SPV_SUCCESS, false); - EXPECT_EQ(nullptr, diagnostic_); -} - -// A binary parser diagnostic test case where we provide the words array -// pointer and word count explicitly. -struct WordsAndCountDiagnosticCase { - const uint32_t* words; - size_t num_words; - std::string expected_diagnostic; -}; - -using BinaryParseWordsAndCountDiagnosticTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>; - -TEST_P(BinaryParseWordsAndCountDiagnosticTest, WordAndCountCases) { - EXPECT_EQ( - SPV_ERROR_INVALID_BINARY, - spvBinaryParse(ScopedContext().context, nullptr, GetParam().words, - GetParam().num_words, nullptr, nullptr, &diagnostic)); - ASSERT_NE(nullptr, diagnostic); - EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic)); -} - -INSTANTIATE_TEST_CASE_P( - BinaryParseDiagnostic, BinaryParseWordsAndCountDiagnosticTest, - ::testing::ValuesIn(std::vector{ - {nullptr, 0, "Missing module."}, - {kHeaderForBound1, 0, - "Module has incomplete header: only 0 words instead of 5"}, - {kHeaderForBound1, 1, - "Module has incomplete header: only 1 words instead of 5"}, - {kHeaderForBound1, 2, - "Module has incomplete header: only 2 words instead of 5"}, - {kHeaderForBound1, 3, - "Module has incomplete header: only 3 words instead of 5"}, - {kHeaderForBound1, 4, - "Module has incomplete header: only 4 words instead of 5"}, - }), ); - -// A binary parser diagnostic test case where a vector of words is -// provided. We'll use this to express cases that can't be created -// via the assembler. Either we want to make a malformed instruction, -// or an invalid case the assembler would reject. -struct WordVectorDiagnosticCase { - std::vector words; - std::string expected_diagnostic; -}; - -using BinaryParseWordVectorDiagnosticTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>; - -TEST_P(BinaryParseWordVectorDiagnosticTest, WordVectorCases) { - const auto& words = GetParam().words; - EXPECT_THAT(spvBinaryParse(ScopedContext().context, nullptr, words.data(), - words.size(), nullptr, nullptr, &diagnostic), - AnyOf(SPV_ERROR_INVALID_BINARY, SPV_ERROR_INVALID_ID)); - ASSERT_NE(nullptr, diagnostic); - EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic)); -} - -INSTANTIATE_TEST_CASE_P( - BinaryParseDiagnostic, BinaryParseWordVectorDiagnosticTest, - ::testing::ValuesIn(std::vector{ - {Concatenate({ExpectedHeaderForBound(1), {spvOpcodeMake(0, SpvOpNop)}}), - "Invalid instruction word count: 0"}, - {Concatenate( - {ExpectedHeaderForBound(1), - {spvOpcodeMake(1, static_cast( - std::numeric_limits::max()))}}), - "Invalid opcode: 65535"}, - {Concatenate({ExpectedHeaderForBound(1), - MakeInstruction(SpvOpNop, {42})}), - "Invalid instruction OpNop starting at word 5: expected " - "no more operands after 1 words, but stated word count is 2."}, - // Supply several more unexpectd words. - {Concatenate({ExpectedHeaderForBound(1), - MakeInstruction(SpvOpNop, {42, 43, 44, 45, 46, 47})}), - "Invalid instruction OpNop starting at word 5: expected " - "no more operands after 1 words, but stated word count is 7."}, - {Concatenate({ExpectedHeaderForBound(1), - MakeInstruction(SpvOpTypeVoid, {1, 2})}), - "Invalid instruction OpTypeVoid starting at word 5: expected " - "no more operands after 2 words, but stated word count is 3."}, - {Concatenate({ExpectedHeaderForBound(1), - MakeInstruction(SpvOpTypeVoid, {1, 2, 5, 9, 10})}), - "Invalid instruction OpTypeVoid starting at word 5: expected " - "no more operands after 2 words, but stated word count is 6."}, - {Concatenate({ExpectedHeaderForBound(1), - MakeInstruction(SpvOpTypeInt, {1, 32, 1, 9})}), - "Invalid instruction OpTypeInt starting at word 5: expected " - "no more operands after 4 words, but stated word count is 5."}, - {Concatenate({ExpectedHeaderForBound(1), - MakeInstruction(SpvOpTypeInt, {1})}), - "End of input reached while decoding OpTypeInt starting at word 5:" - " expected more operands after 2 words."}, - - // Check several cases for running off the end of input. - - // Detect a missing single word operand. - {Concatenate({ExpectedHeaderForBound(1), - {spvOpcodeMake(2, SpvOpTypeStruct)}}), - "End of input reached while decoding OpTypeStruct starting at word" - " 5: missing result ID operand at word offset 1."}, - // Detect this a missing a multi-word operand to OpConstant. - // We also lie and say the OpConstant instruction has 5 words when - // it only has 3. Corresponds to something like this: - // %1 = OpTypeInt 64 0 - // %2 = OpConstant %1 - {Concatenate({ExpectedHeaderForBound(3), - {MakeInstruction(SpvOpTypeInt, {1, 64, 0})}, - {spvOpcodeMake(5, SpvOpConstant), 1, 2}}), - "End of input reached while decoding OpConstant starting at word" - " 9: missing possibly multi-word literal number operand at word " - "offset 3."}, - // Detect when we provide only one word from the 64-bit literal, - // and again lie about the number of words in the instruction. - {Concatenate({ExpectedHeaderForBound(3), - {MakeInstruction(SpvOpTypeInt, {1, 64, 0})}, - {spvOpcodeMake(5, SpvOpConstant), 1, 2, 42}}), - "End of input reached while decoding OpConstant starting at word" - " 9: truncated possibly multi-word literal number operand at word " - "offset 3."}, - // Detect when a required string operand is missing. - // Also, lie about the length of the instruction. - {Concatenate({ExpectedHeaderForBound(3), - {spvOpcodeMake(3, SpvOpString), 1}}), - "End of input reached while decoding OpString starting at word" - " 5: missing literal string operand at word offset 2."}, - // Detect when a required string operand is truncated: it's missing - // a null terminator. Catching the error avoids a buffer overrun. - {Concatenate({ExpectedHeaderForBound(3), - {spvOpcodeMake(4, SpvOpString), 1, 0x41414141, - 0x41414141}}), - "End of input reached while decoding OpString starting at word" - " 5: truncated literal string operand at word offset 2."}, - // Detect when an optional string operand is truncated: it's missing - // a null terminator. Catching the error avoids a buffer overrun. - // (It is valid for an optional string operand to be absent.) - {Concatenate({ExpectedHeaderForBound(3), - {spvOpcodeMake(6, SpvOpSource), - static_cast(SpvSourceLanguageOpenCL_C), 210, - 1 /* file id */, - /*start of string*/ 0x41414141, 0x41414141}}), - "End of input reached while decoding OpSource starting at word" - " 5: truncated literal string operand at word offset 4."}, - - // (End of input exhaustion test cases.) - - // In this case the instruction word count is too small, where - // it would truncate a multi-word operand to OpConstant. - {Concatenate({ExpectedHeaderForBound(3), - {MakeInstruction(SpvOpTypeInt, {1, 64, 0})}, - {spvOpcodeMake(4, SpvOpConstant), 1, 2, 44, 44}}), - "Invalid word count: OpConstant starting at word 9 says it has 4" - " words, but found 5 words instead."}, - // Word count is to small, where it would truncate a literal string. - {Concatenate({ExpectedHeaderForBound(2), - {spvOpcodeMake(3, SpvOpString), 1, 0x41414141, 0}}), - "Invalid word count: OpString starting at word 5 says it has 3" - " words, but found 4 words instead."}, - // Word count is too large. The string terminates before the last - // word. - {Concatenate({ExpectedHeaderForBound(2), - {spvOpcodeMake(4, SpvOpString), 1 /* result id */}, - MakeVector("abc"), - {0 /* this word does not belong*/}}), - "Invalid instruction OpString starting at word 5: expected no more" - " operands after 3 words, but stated word count is 4."}, - // Word count is too large. There are too many words after the string - // literal. A linkage attribute decoration is the only case in SPIR-V - // where a string operand is followed by another operand. - {Concatenate({ExpectedHeaderForBound(2), - {spvOpcodeMake(6, SpvOpDecorate), 1 /* target id */, - static_cast(SpvDecorationLinkageAttributes)}, - MakeVector("abc"), - {static_cast(SpvLinkageTypeImport), - 0 /* does not belong */}}), - "Invalid instruction OpDecorate starting at word 5: expected no more" - " operands after 5 words, but stated word count is 6."}, - // Like the previous case, but with 5 extra words. - {Concatenate({ExpectedHeaderForBound(2), - {spvOpcodeMake(10, SpvOpDecorate), 1 /* target id */, - static_cast(SpvDecorationLinkageAttributes)}, - MakeVector("abc"), - {static_cast(SpvLinkageTypeImport), - /* don't belong */ 0, 1, 2, 3, 4}}), - "Invalid instruction OpDecorate starting at word 5: expected no more" - " operands after 5 words, but stated word count is 10."}, - // Like the previous two cases, but with OpMemberDecorate. - {Concatenate({ExpectedHeaderForBound(2), - {spvOpcodeMake(7, SpvOpMemberDecorate), 1 /* target id */, - 42 /* member index */, - static_cast(SpvDecorationLinkageAttributes)}, - MakeVector("abc"), - {static_cast(SpvLinkageTypeImport), - 0 /* does not belong */}}), - "Invalid instruction OpMemberDecorate starting at word 5: expected no" - " more operands after 6 words, but stated word count is 7."}, - {Concatenate({ExpectedHeaderForBound(2), - {spvOpcodeMake(11, SpvOpMemberDecorate), - 1 /* target id */, 42 /* member index */, - static_cast(SpvDecorationLinkageAttributes)}, - MakeVector("abc"), - {static_cast(SpvLinkageTypeImport), - /* don't belong */ 0, 1, 2, 3, 4}}), - "Invalid instruction OpMemberDecorate starting at word 5: expected no" - " more operands after 6 words, but stated word count is 11."}, - // Word count is too large. There should be no more words - // after the RelaxedPrecision decoration. - {Concatenate({ExpectedHeaderForBound(2), - {spvOpcodeMake(4, SpvOpDecorate), 1 /* target id */, - static_cast(SpvDecorationRelaxedPrecision), - 0 /* does not belong */}}), - "Invalid instruction OpDecorate starting at word 5: expected no" - " more operands after 3 words, but stated word count is 4."}, - // Word count is too large. There should be only one word after - // the SpecId decoration enum word. - {Concatenate({ExpectedHeaderForBound(2), - {spvOpcodeMake(5, SpvOpDecorate), 1 /* target id */, - static_cast(SpvDecorationSpecId), - 42 /* the spec id */, 0 /* does not belong */}}), - "Invalid instruction OpDecorate starting at word 5: expected no" - " more operands after 4 words, but stated word count is 5."}, - {Concatenate({ExpectedHeaderForBound(2), - {spvOpcodeMake(2, SpvOpTypeVoid), 0}}), - "Error: Result Id is 0"}, - {Concatenate({ - ExpectedHeaderForBound(2), - {spvOpcodeMake(2, SpvOpTypeVoid), 1}, - {spvOpcodeMake(2, SpvOpTypeBool), 1}, - }), - "Id 1 is defined more than once"}, - {Concatenate({ExpectedHeaderForBound(3), - MakeInstruction(SpvOpExtInst, {2, 3, 100, 4, 5})}), - "OpExtInst set Id 100 does not reference an OpExtInstImport result " - "Id"}, - {Concatenate({ExpectedHeaderForBound(101), - MakeInstruction(SpvOpExtInstImport, {100}, - MakeVector("OpenCL.std")), - // OpenCL cos is #14 - MakeInstruction(SpvOpExtInst, {2, 3, 100, 14, 5, 999})}), - "Invalid instruction OpExtInst starting at word 10: expected no " - "more operands after 6 words, but stated word count is 7."}, - // In this case, the OpSwitch selector refers to an invalid ID. - {Concatenate({ExpectedHeaderForBound(3), - MakeInstruction(SpvOpSwitch, {1, 2, 42, 3})}), - "Invalid OpSwitch: selector id 1 has no type"}, - // In this case, the OpSwitch selector refers to an ID that has - // no type. - {Concatenate({ExpectedHeaderForBound(3), - MakeInstruction(SpvOpLabel, {1}), - MakeInstruction(SpvOpSwitch, {1, 2, 42, 3})}), - "Invalid OpSwitch: selector id 1 has no type"}, - {Concatenate({ExpectedHeaderForBound(3), - MakeInstruction(SpvOpTypeInt, {1, 32, 0}), - MakeInstruction(SpvOpSwitch, {1, 3, 42, 3})}), - "Invalid OpSwitch: selector id 1 is a type, not a value"}, - {Concatenate({ExpectedHeaderForBound(3), - MakeInstruction(SpvOpTypeFloat, {1, 32}), - MakeInstruction(SpvOpConstant, {1, 2, 0x78f00000}), - MakeInstruction(SpvOpSwitch, {2, 3, 42, 3})}), - "Invalid OpSwitch: selector id 2 is not a scalar integer"}, - {Concatenate({ExpectedHeaderForBound(3), - MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("invalid-import"))}), - "Invalid extended instruction import 'invalid-import'"}, - {Concatenate({ - ExpectedHeaderForBound(3), - MakeInstruction(SpvOpTypeInt, {1, 32, 0}), - MakeInstruction(SpvOpConstant, {2, 2, 42}), - }), - "Type Id 2 is not a type"}, - {Concatenate({ - ExpectedHeaderForBound(3), MakeInstruction(SpvOpTypeBool, {1}), - MakeInstruction(SpvOpConstant, {1, 2, 42}), - }), - "Type Id 1 is not a scalar numeric type"}, - }), ); - -// A binary parser diagnostic case generated from an assembly text input. -struct AssemblyDiagnosticCase { - std::string assembly; - std::string expected_diagnostic; -}; - -using BinaryParseAssemblyDiagnosticTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>; - -TEST_P(BinaryParseAssemblyDiagnosticTest, AssemblyCases) { - auto words = CompileSuccessfully(GetParam().assembly); - EXPECT_THAT(spvBinaryParse(ScopedContext().context, nullptr, words.data(), - words.size(), nullptr, nullptr, &diagnostic), - AnyOf(SPV_ERROR_INVALID_BINARY, SPV_ERROR_INVALID_ID)); - ASSERT_NE(nullptr, diagnostic); - EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic)); -} - -INSTANTIATE_TEST_CASE_P( - BinaryParseDiagnostic, BinaryParseAssemblyDiagnosticTest, - ::testing::ValuesIn(std::vector{ - {"%1 = OpConstant !0 42", "Error: Type Id is 0"}, - // A required id is 0. - {"OpName !0 \"foo\"", "Id is 0"}, - // An optional id is 0, in this case the optional - // initializer. - {"%2 = OpVariable %1 CrossWorkgroup !0", "Id is 0"}, - {"OpControlBarrier !0 %1 %2", "scope ID is 0"}, - {"OpControlBarrier %1 !0 %2", "scope ID is 0"}, - {"OpControlBarrier %1 %2 !0", "memory semantics ID is 0"}, - {"%import = OpExtInstImport \"GLSL.std.450\" " - "%result = OpExtInst %type %import !999999 %x", - "Invalid extended instruction number: 999999"}, - {"%2 = OpSpecConstantOp %1 !1000 %2", - "Invalid OpSpecConstantOp opcode: 1000"}, - {"OpCapability !9999", "Invalid capability operand: 9999"}, - {"OpSource !9999 100", "Invalid source language operand: 9999"}, - {"OpEntryPoint !9999", "Invalid execution model operand: 9999"}, - {"OpMemoryModel !9999", "Invalid addressing model operand: 9999"}, - {"OpMemoryModel Logical !9999", "Invalid memory model operand: 9999"}, - {"OpExecutionMode %1 !9999", "Invalid execution mode operand: 9999"}, - {"OpTypeForwardPointer %1 !9999", - "Invalid storage class operand: 9999"}, - {"%2 = OpTypeImage %1 !9999", "Invalid dimensionality operand: 9999"}, - {"%2 = OpTypeImage %1 1D 0 0 0 0 !9999", - "Invalid image format operand: 9999"}, - {"OpDecorate %1 FPRoundingMode !9999", - "Invalid floating-point rounding mode operand: 9999"}, - {"OpDecorate %1 LinkageAttributes \"C\" !9999", - "Invalid linkage type operand: 9999"}, - {"%1 = OpTypePipe !9999", "Invalid access qualifier operand: 9999"}, - {"OpDecorate %1 FuncParamAttr !9999", - "Invalid function parameter attribute operand: 9999"}, - {"OpDecorate %1 !9999", "Invalid decoration operand: 9999"}, - {"OpDecorate %1 BuiltIn !9999", "Invalid built-in operand: 9999"}, - {"%2 = OpGroupIAdd %1 %3 !9999", - "Invalid group operation operand: 9999"}, - {"OpDecorate %1 FPFastMathMode !63", - "Invalid floating-point fast math mode operand: 63 has invalid mask " - "component 32"}, - {"%2 = OpFunction %2 !31", - "Invalid function control operand: 31 has invalid mask component 16"}, - {"OpLoopMerge %1 %2 !7", - "Invalid loop control operand: 7 has invalid mask component 4"}, - {"%2 = OpImageFetch %1 %image %coord !511", - "Invalid image operand: 511 has invalid mask component 256"}, - {"OpSelectionMerge %1 !7", - "Invalid selection control operand: 7 has invalid mask component 4"}, - }), ); - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/binary_strnlen_s_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/binary_strnlen_s_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/binary_strnlen_s_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/binary_strnlen_s_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "unit_spirv.h" - -namespace { - -TEST(Strnlen, Samples) { - EXPECT_EQ(0u, spv_strnlen_s(nullptr, 0)); - EXPECT_EQ(0u, spv_strnlen_s(nullptr, 5)); - EXPECT_EQ(0u, spv_strnlen_s("abc", 0)); - EXPECT_EQ(1u, spv_strnlen_s("abc", 1)); - EXPECT_EQ(3u, spv_strnlen_s("abc", 3)); - EXPECT_EQ(3u, spv_strnlen_s("abc\0", 5)); - EXPECT_EQ(0u, spv_strnlen_s("\0", 5)); - EXPECT_EQ(1u, spv_strnlen_s("a\0c", 5)); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/binary_to_text.literal_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/binary_to_text.literal_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/binary_to_text.literal_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/binary_to_text.literal_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -#include "gmock/gmock.h" -#include "test_fixture.h" - -using ::testing::Eq; - -namespace { - -using RoundTripLiteralsTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(RoundTripLiteralsTest, Sample) { - EXPECT_THAT(EncodeAndDecodeSuccessfully(GetParam()), Eq(GetParam())); -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - StringLiterals, RoundTripLiteralsTest, - ::testing::ValuesIn(std::vector{ - "OpName %1 \"\"\n", // empty - "OpName %1 \"foo\"\n", // normal - "OpName %1 \"foo bar\"\n", // string with spaces - "OpName %1 \"foo\tbar\"\n", // string with tab - "OpName %1 \"\tfoo\"\n", // starts with tab - "OpName %1 \" foo\"\n", // starts with space - "OpName %1 \"foo \"\n", // ends with space - "OpName %1 \"foo\t\"\n", // ends with tab - "OpName %1 \"foo\nbar\"\n", // contains newline - "OpName %1 \"\nfoo\nbar\"\n", // starts with newline - "OpName %1 \"\n\n\nfoo\nbar\"\n", // multiple newlines - "OpName %1 \"\\\"foo\nbar\\\"\"\n", // escaped quote - "OpName %1 \"\\\\foo\nbar\\\\\"\n", // escaped backslash - "OpName %1 \"\xE4\xBA\xB2\"\n", // UTF-8 - }),); -// clang-format on - -using RoundTripSpecialCaseLiteralsTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>>; - -// Test case where the generated disassembly is not the same as the -// assembly passed in. -TEST_P(RoundTripSpecialCaseLiteralsTest, Sample) { - EXPECT_THAT(EncodeAndDecodeSuccessfully(std::get<0>(GetParam())), - Eq(std::get<1>(GetParam()))); -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - StringLiterals, RoundTripSpecialCaseLiteralsTest, - ::testing::ValuesIn(std::vector>{ - {"OpName %1 \"\\foo\"\n", "OpName %1 \"foo\"\n"}, // Escape f - {"OpName %1 \"\\\nfoo\"\n", "OpName %1 \"\nfoo\"\n"}, // Escape newline - {"OpName %1 \"\\\xE4\xBA\xB2\"\n", "OpName %1 \"\xE4\xBA\xB2\"\n"}, // Escape utf-8 - }),); -// clang-format on - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/binary_to_text_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/binary_to_text_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/binary_to_text_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/binary_to_text_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,547 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -#include - -#include "gmock/gmock.h" - -#include "test_fixture.h" -#include "source/spirv_constant.h" - -namespace { - -using ::testing::Combine; -using ::testing::Eq; -using ::testing::HasSubstr; -using spvtest::AutoText; -using spvtest::ScopedContext; -using spvtest::TextToBinaryTest; -using std::get; -using std::tuple; - -class BinaryToText : public ::testing::Test { - public: - BinaryToText() : context(spvContextCreate(SPV_ENV_UNIVERSAL_1_0)) {} - ~BinaryToText() { spvContextDestroy(context); } - - virtual void SetUp() { - const char* textStr = R"( - OpSource OpenCL_C 12 - OpMemoryModel Physical64 OpenCL - OpSourceExtension "PlaceholderExtensionName" - OpEntryPoint Kernel %1 "foo" - OpExecutionMode %1 LocalSizeHint 1 1 1 - %2 = OpTypeVoid - %3 = OpTypeBool - %4 = OpTypeInt 8 0 - %5 = OpTypeInt 8 1 - %6 = OpTypeInt 16 0 - %7 = OpTypeInt 16 1 - %8 = OpTypeInt 32 0 - %9 = OpTypeInt 32 1 -%10 = OpTypeInt 64 0 -%11 = OpTypeInt 64 1 -%12 = OpTypeFloat 16 -%13 = OpTypeFloat 32 -%14 = OpTypeFloat 64 -%15 = OpTypeVector %4 2 -)"; - spv_text_t text = {textStr, strlen(textStr)}; - spv_diagnostic diagnostic = nullptr; - spv_result_t error = - spvTextToBinary(context, text.str, text.length, &binary, &diagnostic); - if (error) { - spvDiagnosticPrint(diagnostic); - spvDiagnosticDestroy(diagnostic); - ASSERT_EQ(SPV_SUCCESS, error); - } - } - - virtual void TearDown() { spvBinaryDestroy(binary); } - - // Compiles the given assembly text, and saves it into 'binary'. - void CompileSuccessfully(std::string text) { - spv_diagnostic diagnostic = nullptr; - EXPECT_EQ(SPV_SUCCESS, spvTextToBinary(context, text.c_str(), text.size(), - &binary, &diagnostic)); - } - - spv_context context; - spv_binary binary; -}; - -TEST_F(BinaryToText, Default) { - spv_text text = nullptr; - spv_diagnostic diagnostic = nullptr; - ASSERT_EQ( - SPV_SUCCESS, - spvBinaryToText(context, binary->code, binary->wordCount, - SPV_BINARY_TO_TEXT_OPTION_NONE, &text, &diagnostic)); - printf("%s", text->str); - spvTextDestroy(text); -} - -TEST_F(BinaryToText, MissingModule) { - spv_text text; - spv_diagnostic diagnostic = nullptr; - EXPECT_EQ( - SPV_ERROR_INVALID_BINARY, - spvBinaryToText(context, nullptr, 42, SPV_BINARY_TO_TEXT_OPTION_NONE, - &text, &diagnostic)); - EXPECT_THAT(diagnostic->error, Eq(std::string("Missing module."))); - if (diagnostic) { - spvDiagnosticPrint(diagnostic); - spvDiagnosticDestroy(diagnostic); - } -} - -TEST_F(BinaryToText, TruncatedModule) { - // Make a valid module with zero instructions. - CompileSuccessfully(""); - EXPECT_EQ(SPV_INDEX_INSTRUCTION, binary->wordCount); - - for (size_t length = 0; length < SPV_INDEX_INSTRUCTION; length++) { - spv_text text = nullptr; - spv_diagnostic diagnostic = nullptr; - EXPECT_EQ( - SPV_ERROR_INVALID_BINARY, - spvBinaryToText(context, binary->code, length, - SPV_BINARY_TO_TEXT_OPTION_NONE, &text, &diagnostic)); - ASSERT_NE(nullptr, diagnostic); - std::stringstream expected; - expected << "Module has incomplete header: only " << length - << " words instead of " << SPV_INDEX_INSTRUCTION; - EXPECT_THAT(diagnostic->error, Eq(expected.str())); - spvDiagnosticDestroy(diagnostic); - } -} - -TEST_F(BinaryToText, InvalidMagicNumber) { - CompileSuccessfully(""); - std::vector damaged_binary(binary->code, - binary->code + binary->wordCount); - damaged_binary[SPV_INDEX_MAGIC_NUMBER] ^= 123; - - spv_diagnostic diagnostic = nullptr; - spv_text text; - EXPECT_EQ( - SPV_ERROR_INVALID_BINARY, - spvBinaryToText(context, damaged_binary.data(), damaged_binary.size(), - SPV_BINARY_TO_TEXT_OPTION_NONE, &text, &diagnostic)); - ASSERT_NE(nullptr, diagnostic); - std::stringstream expected; - expected << "Invalid SPIR-V magic number '" << std::hex - << damaged_binary[SPV_INDEX_MAGIC_NUMBER] << "'."; - EXPECT_THAT(diagnostic->error, Eq(expected.str())); - spvDiagnosticDestroy(diagnostic); -} - -struct FailedDecodeCase { - std::string source_text; - std::vector appended_instruction; - std::string expected_error_message; -}; - -using BinaryToTextFail = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(BinaryToTextFail, EncodeSuccessfullyDecodeFailed) { - EXPECT_THAT(EncodeSuccessfullyDecodeFailed(GetParam().source_text, - GetParam().appended_instruction), - Eq(GetParam().expected_error_message)); -} - -INSTANTIATE_TEST_CASE_P( - InvalidIds, BinaryToTextFail, - ::testing::ValuesIn(std::vector{ - {"", spvtest::MakeInstruction(SpvOpTypeVoid, {0}), - "Error: Result Id is 0"}, - {"", spvtest::MakeInstruction(SpvOpConstant, {0, 1, 42}), - "Error: Type Id is 0"}, - {"%1 = OpTypeVoid", spvtest::MakeInstruction(SpvOpTypeVoid, {1}), - "Id 1 is defined more than once"}, - {"%1 = OpTypeVoid\n" - "%2 = OpNot %1 %foo", - spvtest::MakeInstruction(SpvOpNot, {1, 2, 3}), - "Id 2 is defined more than once"}, - {"%1 = OpTypeVoid\n" - "%2 = OpNot %1 %foo", - spvtest::MakeInstruction(SpvOpNot, {1, 1, 3}), - "Id 1 is defined more than once"}, - // The following are the two failure cases for - // Parser::setNumericTypeInfoForType. - {"", spvtest::MakeInstruction(SpvOpConstant, {500, 1, 42}), - "Type Id 500 is not a type"}, - {"%1 = OpTypeInt 32 0\n" - "%2 = OpTypeVector %1 4", - spvtest::MakeInstruction(SpvOpConstant, {2, 3, 999}), - "Type Id 2 is not a scalar numeric type"}, - }), ); - -INSTANTIATE_TEST_CASE_P( - InvalidIdsCheckedDuringLiteralCaseParsing, BinaryToTextFail, - ::testing::ValuesIn(std::vector{ - {"", spvtest::MakeInstruction(SpvOpSwitch, {1, 2, 3, 4}), - "Invalid OpSwitch: selector id 1 has no type"}, - {"%1 = OpTypeVoid\n", - spvtest::MakeInstruction(SpvOpSwitch, {1, 2, 3, 4}), - "Invalid OpSwitch: selector id 1 is a type, not a value"}, - {"%1 = OpConstantTrue !500", - spvtest::MakeInstruction(SpvOpSwitch, {1, 2, 3, 4}), - "Type Id 500 is not a type"}, - {"%1 = OpTypeFloat 32\n%2 = OpConstant %1 1.5", - spvtest::MakeInstruction(SpvOpSwitch, {2, 3, 4, 5}), - "Invalid OpSwitch: selector id 2 is not a scalar integer"}, - }), ); - -TEST_F(TextToBinaryTest, OneInstruction) { - const std::string input = "OpSource OpenCL_C 12\n"; - EXPECT_EQ(input, EncodeAndDecodeSuccessfully(input)); -} - -// Exercise the case where an operand itself has operands. -// This could detect problems in updating the expected-set-of-operands -// list. -TEST_F(TextToBinaryTest, OperandWithOperands) { - const std::string input = R"(OpEntryPoint Kernel %1 "foo" -OpExecutionMode %1 LocalSizeHint 100 200 300 -%2 = OpTypeVoid -%3 = OpTypeFunction %2 -%1 = OpFunction %1 None %3 -)"; - EXPECT_EQ(input, EncodeAndDecodeSuccessfully(input)); -} - -using RoundTripInstructionsTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>>; - -TEST_P(RoundTripInstructionsTest, Sample) { - EXPECT_THAT(EncodeAndDecodeSuccessfully(get<1>(GetParam()), - SPV_BINARY_TO_TEXT_OPTION_NONE, - get<0>(GetParam())), - Eq(get<1>(GetParam()))); -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - NumericLiterals, RoundTripInstructionsTest, - // This test is independent of environment, so just test the one. - Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_UNIVERSAL_1_2), - ::testing::ValuesIn(std::vector{ - "%1 = OpTypeInt 12 0\n%2 = OpConstant %1 1867\n", - "%1 = OpTypeInt 12 1\n%2 = OpConstant %1 1867\n", - "%1 = OpTypeInt 12 1\n%2 = OpConstant %1 -1867\n", - "%1 = OpTypeInt 32 0\n%2 = OpConstant %1 1867\n", - "%1 = OpTypeInt 32 1\n%2 = OpConstant %1 1867\n", - "%1 = OpTypeInt 32 1\n%2 = OpConstant %1 -1867\n", - "%1 = OpTypeInt 64 0\n%2 = OpConstant %1 18446744073709551615\n", - "%1 = OpTypeInt 64 1\n%2 = OpConstant %1 9223372036854775807\n", - "%1 = OpTypeInt 64 1\n%2 = OpConstant %1 -9223372036854775808\n", - // 16-bit floats print as hex floats. - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.ff4p+16\n", - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.d2cp-10\n", - // 32-bit floats - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -3.275\n", - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1.8p+128\n", // NaN - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1.0002p+128\n", // NaN - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1p+128\n", // Inf - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1p+128\n", // -Inf - // 64-bit floats - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -3.275\n", - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.ffffffffffffap-1023\n", // small normal - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.ffffffffffffap-1023\n", - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.8p+1024\n", // NaN - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.0002p+1024\n", // NaN - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1p+1024\n", // Inf - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1p+1024\n", // -Inf - })), ); -// clang-format on - -INSTANTIATE_TEST_CASE_P( - MemoryAccessMasks, RoundTripInstructionsTest, - Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_UNIVERSAL_1_2), - ::testing::ValuesIn(std::vector{ - "OpStore %1 %2\n", // 3 words long. - "OpStore %1 %2 None\n", // 4 words long, explicit final 0. - "OpStore %1 %2 Volatile\n", "OpStore %1 %2 Aligned 8\n", - "OpStore %1 %2 Nontemporal\n", - // Combinations show the names from LSB to MSB - "OpStore %1 %2 Volatile|Aligned 16\n", - "OpStore %1 %2 Volatile|Nontemporal\n", - "OpStore %1 %2 Volatile|Aligned|Nontemporal 32\n", - })), ); - -INSTANTIATE_TEST_CASE_P( - FPFastMathModeMasks, RoundTripInstructionsTest, - Combine( - ::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_UNIVERSAL_1_2), - ::testing::ValuesIn(std::vector{ - "OpDecorate %1 FPFastMathMode None\n", - "OpDecorate %1 FPFastMathMode NotNaN\n", - "OpDecorate %1 FPFastMathMode NotInf\n", - "OpDecorate %1 FPFastMathMode NSZ\n", - "OpDecorate %1 FPFastMathMode AllowRecip\n", - "OpDecorate %1 FPFastMathMode Fast\n", - // Combinations show the names from LSB to MSB - "OpDecorate %1 FPFastMathMode NotNaN|NotInf\n", - "OpDecorate %1 FPFastMathMode NSZ|AllowRecip\n", - "OpDecorate %1 FPFastMathMode NotNaN|NotInf|NSZ|AllowRecip|Fast\n", - })), ); - -INSTANTIATE_TEST_CASE_P( - LoopControlMasks, RoundTripInstructionsTest, - Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_UNIVERSAL_1_2), - ::testing::ValuesIn(std::vector{ - "OpLoopMerge %1 %2 None\n", "OpLoopMerge %1 %2 Unroll\n", - "OpLoopMerge %1 %2 DontUnroll\n", - "OpLoopMerge %1 %2 Unroll|DontUnroll\n", - })), ); - -INSTANTIATE_TEST_CASE_P(LoopControlMasksV11, RoundTripInstructionsTest, - Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_UNIVERSAL_1_2), - ::testing::ValuesIn(std::vector{ - "OpLoopMerge %1 %2 DependencyInfinite\n", - "OpLoopMerge %1 %2 DependencyLength 8\n", - })), ); - -INSTANTIATE_TEST_CASE_P( - SelectionControlMasks, RoundTripInstructionsTest, - Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_UNIVERSAL_1_2), - ::testing::ValuesIn(std::vector{ - "OpSelectionMerge %1 None\n", "OpSelectionMerge %1 Flatten\n", - "OpSelectionMerge %1 DontFlatten\n", - "OpSelectionMerge %1 Flatten|DontFlatten\n", - })), ); - -INSTANTIATE_TEST_CASE_P( - FunctionControlMasks, RoundTripInstructionsTest, - Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_UNIVERSAL_1_2), - ::testing::ValuesIn(std::vector{ - "%2 = OpFunction %1 None %3\n", - "%2 = OpFunction %1 Inline %3\n", - "%2 = OpFunction %1 DontInline %3\n", - "%2 = OpFunction %1 Pure %3\n", "%2 = OpFunction %1 Const %3\n", - "%2 = OpFunction %1 Inline|Pure|Const %3\n", - "%2 = OpFunction %1 DontInline|Const %3\n", - })), ); - -INSTANTIATE_TEST_CASE_P( - ImageMasks, RoundTripInstructionsTest, - Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_UNIVERSAL_1_2), - ::testing::ValuesIn(std::vector{ - "%2 = OpImageFetch %1 %3 %4\n", - "%2 = OpImageFetch %1 %3 %4 None\n", - "%2 = OpImageFetch %1 %3 %4 Bias %5\n", - "%2 = OpImageFetch %1 %3 %4 Lod %5\n", - "%2 = OpImageFetch %1 %3 %4 Grad %5 %6\n", - "%2 = OpImageFetch %1 %3 %4 ConstOffset %5\n", - "%2 = OpImageFetch %1 %3 %4 Offset %5\n", - "%2 = OpImageFetch %1 %3 %4 ConstOffsets %5\n", - "%2 = OpImageFetch %1 %3 %4 Sample %5\n", - "%2 = OpImageFetch %1 %3 %4 MinLod %5\n", - "%2 = OpImageFetch %1 %3 %4 Bias|Lod|Grad %5 %6 %7 %8\n", - "%2 = OpImageFetch %1 %3 %4 ConstOffset|Offset|ConstOffsets" - " %5 %6 %7\n", - "%2 = OpImageFetch %1 %3 %4 Sample|MinLod %5 %6\n", - "%2 = OpImageFetch %1 %3 %4" - " Bias|Lod|Grad|ConstOffset|Offset|ConstOffsets|Sample|MinLod" - " %5 %6 %7 %8 %9 %10 %11 %12 %13\n"})), ); - -INSTANTIATE_TEST_CASE_P( - NewInstructionsInSPIRV1_2, RoundTripInstructionsTest, - Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_2), - ::testing::ValuesIn(std::vector{ - "OpExecutionModeId %1 SubgroupsPerWorkgroupId %2\n", - "OpExecutionModeId %1 LocalSizeId %2 %3 %4\n", - "OpExecutionModeId %1 LocalSizeHintId %2\n", - "OpDecorateId %1 AlignmentId %2\n", - "OpDecorateId %1 MaxByteOffsetId %2\n", - })), ); - -using MaskSorting = TextToBinaryTest; - -TEST_F(MaskSorting, MasksAreSortedFromLSBToMSB) { - EXPECT_THAT(EncodeAndDecodeSuccessfully( - "OpStore %1 %2 Nontemporal|Aligned|Volatile 32"), - Eq("OpStore %1 %2 Volatile|Aligned|Nontemporal 32\n")); - EXPECT_THAT( - EncodeAndDecodeSuccessfully( - "OpDecorate %1 FPFastMathMode NotInf|Fast|AllowRecip|NotNaN|NSZ"), - Eq("OpDecorate %1 FPFastMathMode NotNaN|NotInf|NSZ|AllowRecip|Fast\n")); - EXPECT_THAT( - EncodeAndDecodeSuccessfully("OpLoopMerge %1 %2 DontUnroll|Unroll"), - Eq("OpLoopMerge %1 %2 Unroll|DontUnroll\n")); - EXPECT_THAT( - EncodeAndDecodeSuccessfully("OpSelectionMerge %1 DontFlatten|Flatten"), - Eq("OpSelectionMerge %1 Flatten|DontFlatten\n")); - EXPECT_THAT(EncodeAndDecodeSuccessfully( - "%2 = OpFunction %1 DontInline|Const|Pure|Inline %3"), - Eq("%2 = OpFunction %1 Inline|DontInline|Pure|Const %3\n")); - EXPECT_THAT(EncodeAndDecodeSuccessfully( - "%2 = OpImageFetch %1 %3 %4" - " MinLod|Sample|Offset|Lod|Grad|ConstOffsets|ConstOffset|Bias" - " %5 %6 %7 %8 %9 %10 %11 %12 %13\n"), - Eq("%2 = OpImageFetch %1 %3 %4" - " Bias|Lod|Grad|ConstOffset|Offset|ConstOffsets|Sample|MinLod" - " %5 %6 %7 %8 %9 %10 %11 %12 %13\n")); -} - -using OperandTypeTest = TextToBinaryTest; - -TEST_F(OperandTypeTest, OptionalTypedLiteralNumber) { - const std::string input = - "%1 = OpTypeInt 32 0\n" - "%2 = OpConstant %1 42\n" - "OpSwitch %2 %3 100 %4\n"; - EXPECT_EQ(input, EncodeAndDecodeSuccessfully(input)); -} - -using IndentTest = spvtest::TextToBinaryTest; - -TEST_F(IndentTest, Sample) { - const std::string input = R"( -OpCapability Shader -OpMemoryModel Logical GLSL450 -%1 = OpTypeInt 32 0 -%2 = OpTypeStruct %1 %3 %4 %5 %6 %7 %8 %9 %10 ; force IDs into double digits -%11 = OpConstant %1 42 -OpStore %2 %3 Aligned|Volatile 4 ; bogus, but not indented -)"; - const std::string expected = - R"( OpCapability Shader - OpMemoryModel Logical GLSL450 - %1 = OpTypeInt 32 0 - %2 = OpTypeStruct %1 %3 %4 %5 %6 %7 %8 %9 %10 - %11 = OpConstant %1 42 - OpStore %2 %3 Volatile|Aligned 4 -)"; - EXPECT_THAT( - EncodeAndDecodeSuccessfully(input, SPV_BINARY_TO_TEXT_OPTION_INDENT), - expected); -} - -using FriendlyNameDisassemblyTest = spvtest::TextToBinaryTest; - -TEST_F(FriendlyNameDisassemblyTest, Sample) { - const std::string input = R"( -OpCapability Shader -OpMemoryModel Logical GLSL450 -%1 = OpTypeInt 32 0 -%2 = OpTypeStruct %1 %3 %4 %5 %6 %7 %8 %9 %10 ; force IDs into double digits -%11 = OpConstant %1 42 -)"; - const std::string expected = - R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -%uint = OpTypeInt 32 0 -%_struct_2 = OpTypeStruct %uint %3 %4 %5 %6 %7 %8 %9 %10 -%uint_42 = OpConstant %uint 42 -)"; - EXPECT_THAT(EncodeAndDecodeSuccessfully( - input, SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES), - expected); -} - -TEST_F(TextToBinaryTest, ShowByteOffsetsWhenRequested) { - const std::string input = R"( -OpCapability Shader -OpMemoryModel Logical GLSL450 -%1 = OpTypeInt 32 0 -%2 = OpTypeVoid -)"; - const std::string expected = - R"(OpCapability Shader ; 0x00000014 -OpMemoryModel Logical GLSL450 ; 0x0000001c -%1 = OpTypeInt 32 0 ; 0x00000028 -%2 = OpTypeVoid ; 0x00000038 -)"; - EXPECT_THAT(EncodeAndDecodeSuccessfully( - input, SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET), - expected); -} - -// Test version string. -TEST_F(TextToBinaryTest, VersionString) { - auto words = CompileSuccessfully(""); - spv_text decoded_text = nullptr; - EXPECT_THAT(spvBinaryToText(ScopedContext().context, words.data(), - words.size(), SPV_BINARY_TO_TEXT_OPTION_NONE, - &decoded_text, &diagnostic), - Eq(SPV_SUCCESS)); - EXPECT_EQ(nullptr, diagnostic); - - EXPECT_THAT(decoded_text->str, HasSubstr("Version: 1.0\n")) - << EncodeAndDecodeSuccessfully(""); - spvTextDestroy(decoded_text); -} - -// Test generator string. - -// A test case for the generator string. This allows us to -// test both of the 16-bit components of the generator word. -struct GeneratorStringCase { - uint16_t generator; - uint16_t misc; - std::string expected; -}; - -using GeneratorStringTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>; - -TEST_P(GeneratorStringTest, Sample) { - auto words = CompileSuccessfully(""); - EXPECT_EQ(2u, SPV_INDEX_GENERATOR_NUMBER); - words[SPV_INDEX_GENERATOR_NUMBER] = - SPV_GENERATOR_WORD(GetParam().generator, GetParam().misc); - - spv_text decoded_text = nullptr; - EXPECT_THAT(spvBinaryToText(ScopedContext().context, words.data(), - words.size(), SPV_BINARY_TO_TEXT_OPTION_NONE, - &decoded_text, &diagnostic), - Eq(SPV_SUCCESS)); - EXPECT_THAT(diagnostic, Eq(nullptr)); - EXPECT_THAT(std::string(decoded_text->str), HasSubstr(GetParam().expected)); - spvTextDestroy(decoded_text); -} - -INSTANTIATE_TEST_CASE_P(GeneratorStrings, GeneratorStringTest, - ::testing::ValuesIn(std::vector{ - {SPV_GENERATOR_KHRONOS, 12, "Khronos; 12"}, - {SPV_GENERATOR_LUNARG, 99, "LunarG; 99"}, - {SPV_GENERATOR_VALVE, 1, "Valve; 1"}, - {SPV_GENERATOR_CODEPLAY, 65535, - "Codeplay; 65535"}, - {SPV_GENERATOR_NVIDIA, 19, "NVIDIA; 19"}, - {SPV_GENERATOR_ARM, 1000, "ARM; 1000"}, - {SPV_GENERATOR_KHRONOS_LLVM_TRANSLATOR, 38, - "Khronos LLVM/SPIR-V Translator; 38"}, - {SPV_GENERATOR_KHRONOS_ASSEMBLER, 2, - "Khronos SPIR-V Tools Assembler; 2"}, - {SPV_GENERATOR_KHRONOS_GLSLANG, 1, - "Khronos Glslang Reference Front End; 1"}, - {1000, 18, "Unknown(1000); 18"}, - {65535, 32767, "Unknown(65535); 32767"}, - }), ); - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/bit_stream.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/bit_stream.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/bit_stream.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/bit_stream.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1305 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include -#include -#include - -#include "gmock/gmock.h" -#include "util/bit_stream.h" - -namespace { - -using spvutils::BitWriterInterface; -using spvutils::BitReaderInterface; -using spvutils::BitWriterWord64; -using spvutils::BitReaderWord64; -using spvutils::StreamToBuffer; -using spvutils::BufferToStream; -using spvutils::NumBitsToNumWords; -using spvutils::PadToWord; -using spvutils::StreamToBitset; -using spvutils::BitsetToStream; -using spvutils::BitsToStream; -using spvutils::StreamToBits; -using spvutils::GetLowerBits; -using spvutils::EncodeZigZag; -using spvutils::DecodeZigZag; -using spvutils::Log2U64; - -// A simple and inefficient implementatition of BitWriterInterface, -// using std::stringstream. Intended for tests only. -class BitWriterStringStream : public BitWriterInterface { - public: - void WriteStream(const std::string& bits) override { - ss_ << bits; - } - - void WriteBits(uint64_t bits, size_t num_bits) override { - assert(num_bits <= 64); - ss_ << BitsToStream(bits, num_bits); - } - - size_t GetNumBits() const override { - return ss_.str().size(); - } - - std::vector GetDataCopy() const override { - return StreamToBuffer(ss_.str()); - } - - std::string GetStreamRaw() const { - return ss_.str(); - } - - private: - std::stringstream ss_; -}; - -// A simple and inefficient implementatition of BitReaderInterface. -// Intended for tests only. -class BitReaderFromString : public BitReaderInterface { - public: - explicit BitReaderFromString(std::string&& str) - : str_(std::move(str)), pos_(0) {} - - explicit BitReaderFromString(const std::vector& buffer) - : str_(BufferToStream(buffer)), pos_(0) {} - - explicit BitReaderFromString(const std::vector& buffer) - : str_(PadToWord<64>(BufferToStream(buffer))), pos_(0) {} - - size_t ReadBits(uint64_t* bits, size_t num_bits) override { - if (ReachedEnd()) - return 0; - std::string sub = str_.substr(pos_, num_bits); - *bits = StreamToBits(sub); - pos_ += sub.length(); - return sub.length(); - } - - size_t GetNumReadBits() const override { - return pos_; - } - - bool ReachedEnd() const override { - return pos_ >= str_.length(); - } - - const std::string& GetStreamPadded64() const { - return str_; - } - - private: - std::string str_; - size_t pos_; -}; - -TEST(Log2U16, Test) { - EXPECT_EQ(0u, Log2U64(0)); - EXPECT_EQ(0u, Log2U64(1)); - EXPECT_EQ(1u, Log2U64(2)); - EXPECT_EQ(1u, Log2U64(3)); - EXPECT_EQ(2u, Log2U64(4)); - EXPECT_EQ(2u, Log2U64(5)); - EXPECT_EQ(2u, Log2U64(6)); - EXPECT_EQ(2u, Log2U64(7)); - EXPECT_EQ(3u, Log2U64(8)); - EXPECT_EQ(3u, Log2U64(9)); - EXPECT_EQ(3u, Log2U64(10)); - EXPECT_EQ(3u, Log2U64(11)); - EXPECT_EQ(3u, Log2U64(12)); - EXPECT_EQ(3u, Log2U64(13)); - EXPECT_EQ(3u, Log2U64(14)); - EXPECT_EQ(3u, Log2U64(15)); - EXPECT_EQ(4u, Log2U64(16)); - EXPECT_EQ(4u, Log2U64(17)); - EXPECT_EQ(5u, Log2U64(35)); - EXPECT_EQ(6u, Log2U64(72)); - EXPECT_EQ(7u, Log2U64(255)); - EXPECT_EQ(8u, Log2U64(256)); - EXPECT_EQ(15u, Log2U64(65535)); - EXPECT_EQ(16u, Log2U64(65536)); - EXPECT_EQ(19u, Log2U64(0xFFFFF)); - EXPECT_EQ(23u, Log2U64(0xFFFFFF)); - EXPECT_EQ(27u, Log2U64(0xFFFFFFF)); - EXPECT_EQ(31u, Log2U64(0xFFFFFFFF)); - EXPECT_EQ(35u, Log2U64(0xFFFFFFFFF)); - EXPECT_EQ(39u, Log2U64(0xFFFFFFFFFF)); - EXPECT_EQ(43u, Log2U64(0xFFFFFFFFFFF)); - EXPECT_EQ(47u, Log2U64(0xFFFFFFFFFFFF)); - EXPECT_EQ(51u, Log2U64(0xFFFFFFFFFFFFF)); - EXPECT_EQ(55u, Log2U64(0xFFFFFFFFFFFFFF)); - EXPECT_EQ(59u, Log2U64(0xFFFFFFFFFFFFFFF)); - EXPECT_EQ(63u, Log2U64(0xFFFFFFFFFFFFFFFF)); -} - -TEST(NumBitsToNumWords, Word8) { - EXPECT_EQ(0u, NumBitsToNumWords<8>(0)); - EXPECT_EQ(1u, NumBitsToNumWords<8>(1)); - EXPECT_EQ(1u, NumBitsToNumWords<8>(7)); - EXPECT_EQ(1u, NumBitsToNumWords<8>(8)); - EXPECT_EQ(2u, NumBitsToNumWords<8>(9)); - EXPECT_EQ(2u, NumBitsToNumWords<8>(16)); - EXPECT_EQ(3u, NumBitsToNumWords<8>(17)); - EXPECT_EQ(3u, NumBitsToNumWords<8>(23)); - EXPECT_EQ(3u, NumBitsToNumWords<8>(24)); - EXPECT_EQ(4u, NumBitsToNumWords<8>(25)); -} - -TEST(NumBitsToNumWords, Word64) { - EXPECT_EQ(0u, NumBitsToNumWords<64>(0)); - EXPECT_EQ(1u, NumBitsToNumWords<64>(1)); - EXPECT_EQ(1u, NumBitsToNumWords<64>(64)); - EXPECT_EQ(2u, NumBitsToNumWords<64>(65)); - EXPECT_EQ(2u, NumBitsToNumWords<64>(128)); - EXPECT_EQ(3u, NumBitsToNumWords<64>(129)); -} - -TEST(ZigZagCoding, Encode) { - EXPECT_EQ(0u, EncodeZigZag(0)); - EXPECT_EQ(1u, EncodeZigZag(-1)); - EXPECT_EQ(2u, EncodeZigZag(1)); - EXPECT_EQ(3u, EncodeZigZag(-2)); - EXPECT_EQ(4u, EncodeZigZag(2)); - EXPECT_EQ(5u, EncodeZigZag(-3)); - EXPECT_EQ(6u, EncodeZigZag(3)); - EXPECT_EQ(std::numeric_limits::max() - 1, - EncodeZigZag(std::numeric_limits::max())); - EXPECT_EQ(std::numeric_limits::max(), - EncodeZigZag(std::numeric_limits::min())); -} - -TEST(ZigZagCoding, Decode) { - EXPECT_EQ(0, DecodeZigZag(0)); - EXPECT_EQ(-1, DecodeZigZag(1)); - EXPECT_EQ(1, DecodeZigZag(2)); - EXPECT_EQ(-2, DecodeZigZag(3)); - EXPECT_EQ(2, DecodeZigZag(4)); - EXPECT_EQ(-3, DecodeZigZag(5)); - EXPECT_EQ(3, DecodeZigZag(6)); - EXPECT_EQ(std::numeric_limits::min(), - DecodeZigZag(std::numeric_limits::max())); - EXPECT_EQ(std::numeric_limits::max(), - DecodeZigZag(std::numeric_limits::max() - 1)); -} - -TEST(ZigZagCoding, Encode0) { - EXPECT_EQ(0u, EncodeZigZag(0, 0)); - EXPECT_EQ(1u, EncodeZigZag(-1, 0)); - EXPECT_EQ(2u, EncodeZigZag(1, 0)); - EXPECT_EQ(3u, EncodeZigZag(-2, 0)); - EXPECT_EQ(std::numeric_limits::max() - 1, - EncodeZigZag(std::numeric_limits::max(), 0)); - EXPECT_EQ(std::numeric_limits::max(), - EncodeZigZag(std::numeric_limits::min(), 0)); -} - -TEST(ZigZagCoding, Decode0) { - EXPECT_EQ(0, DecodeZigZag(0, 0)); - EXPECT_EQ(-1, DecodeZigZag(1, 0)); - EXPECT_EQ(1, DecodeZigZag(2, 0)); - EXPECT_EQ(-2, DecodeZigZag(3, 0)); - EXPECT_EQ(std::numeric_limits::min(), - DecodeZigZag(std::numeric_limits::max(), 0)); - EXPECT_EQ(std::numeric_limits::max(), - DecodeZigZag(std::numeric_limits::max() - 1, 0)); -} - -TEST(ZigZagCoding, Decode0SameAsNormalZigZag) { - for (int32_t i = -10000; i < 10000; i += 123) { - ASSERT_EQ(DecodeZigZag(i), DecodeZigZag(i, 0)); - } -} - -TEST(ZigZagCoding, Encode0SameAsNormalZigZag) { - for (uint32_t i = 0; i < 10000; i += 123) { - ASSERT_EQ(EncodeZigZag(i), EncodeZigZag(i, 0)); - } -} - -TEST(ZigZagCoding, Encode1) { - EXPECT_EQ(0u, EncodeZigZag(0, 1)); - EXPECT_EQ(1u, EncodeZigZag(1, 1)); - EXPECT_EQ(2u, EncodeZigZag(-1, 1)); - EXPECT_EQ(3u, EncodeZigZag(-2, 1)); - EXPECT_EQ(4u, EncodeZigZag(2, 1)); - EXPECT_EQ(5u, EncodeZigZag(3, 1)); - EXPECT_EQ(6u, EncodeZigZag(-3, 1)); - EXPECT_EQ(7u, EncodeZigZag(-4, 1)); - EXPECT_EQ(std::numeric_limits::max() - 2, - EncodeZigZag(std::numeric_limits::max(), 1)); - EXPECT_EQ(std::numeric_limits::max() - 1, - EncodeZigZag(std::numeric_limits::min() + 1, 1)); - EXPECT_EQ(std::numeric_limits::max(), - EncodeZigZag(std::numeric_limits::min(), 1)); -} - -TEST(ZigZagCoding, Decode1) { - EXPECT_EQ(0, DecodeZigZag(0, 1)); - EXPECT_EQ(1, DecodeZigZag(1, 1)); - EXPECT_EQ(-1, DecodeZigZag(2, 1)); - EXPECT_EQ(-2, DecodeZigZag(3, 1)); - EXPECT_EQ(2, DecodeZigZag(4, 1)); - EXPECT_EQ(3, DecodeZigZag(5, 1)); - EXPECT_EQ(-3, DecodeZigZag(6, 1)); - EXPECT_EQ(-4, DecodeZigZag(7, 1)); - EXPECT_EQ(std::numeric_limits::min(), - DecodeZigZag(std::numeric_limits::max(), 1)); - EXPECT_EQ(std::numeric_limits::min() + 1, - DecodeZigZag(std::numeric_limits::max() - 1, 1)); - EXPECT_EQ(std::numeric_limits::max(), - DecodeZigZag(std::numeric_limits::max() - 2, 1)); -} - -TEST(ZigZagCoding, Encode2) { - EXPECT_EQ(0u, EncodeZigZag(0, 2)); - EXPECT_EQ(1u, EncodeZigZag(1, 2)); - EXPECT_EQ(2u, EncodeZigZag(2, 2)); - EXPECT_EQ(3u, EncodeZigZag(3, 2)); - EXPECT_EQ(4u, EncodeZigZag(-1, 2)); - EXPECT_EQ(5u, EncodeZigZag(-2, 2)); - EXPECT_EQ(6u, EncodeZigZag(-3, 2)); - EXPECT_EQ(7u, EncodeZigZag(-4, 2)); - EXPECT_EQ(8u, EncodeZigZag(4, 2)); - EXPECT_EQ(9u, EncodeZigZag(5, 2)); - EXPECT_EQ(10u, EncodeZigZag(6, 2)); - EXPECT_EQ(11u, EncodeZigZag(7, 2)); - EXPECT_EQ(12u, EncodeZigZag(-5, 2)); - EXPECT_EQ(13u, EncodeZigZag(-6, 2)); - EXPECT_EQ(14u, EncodeZigZag(-7, 2)); - EXPECT_EQ(15u, EncodeZigZag(-8, 2)); - EXPECT_EQ(std::numeric_limits::max() - 4, - EncodeZigZag(std::numeric_limits::max(), 2)); - EXPECT_EQ(std::numeric_limits::max() - 3, - EncodeZigZag(std::numeric_limits::min() + 3, 2)); - EXPECT_EQ(std::numeric_limits::max() - 2, - EncodeZigZag(std::numeric_limits::min() + 2, 2)); - EXPECT_EQ(std::numeric_limits::max() - 1, - EncodeZigZag(std::numeric_limits::min() + 1, 2)); - EXPECT_EQ(std::numeric_limits::max(), - EncodeZigZag(std::numeric_limits::min(), 2)); -} - -TEST(ZigZagCoding, Decode2) { - EXPECT_EQ(0, DecodeZigZag(0, 2)); - EXPECT_EQ(1, DecodeZigZag(1, 2)); - EXPECT_EQ(2, DecodeZigZag(2, 2)); - EXPECT_EQ(3, DecodeZigZag(3, 2)); - EXPECT_EQ(-1, DecodeZigZag(4, 2)); - EXPECT_EQ(-2, DecodeZigZag(5, 2)); - EXPECT_EQ(-3, DecodeZigZag(6, 2)); - EXPECT_EQ(-4, DecodeZigZag(7, 2)); - EXPECT_EQ(4, DecodeZigZag(8, 2)); - EXPECT_EQ(5, DecodeZigZag(9, 2)); - EXPECT_EQ(6, DecodeZigZag(10, 2)); - EXPECT_EQ(7, DecodeZigZag(11, 2)); - EXPECT_EQ(-5, DecodeZigZag(12, 2)); - EXPECT_EQ(-6, DecodeZigZag(13, 2)); - EXPECT_EQ(-7, DecodeZigZag(14, 2)); - EXPECT_EQ(-8, DecodeZigZag(15, 2)); - EXPECT_EQ(std::numeric_limits::min(), - DecodeZigZag(std::numeric_limits::max(), 2)); - EXPECT_EQ(std::numeric_limits::min() + 1, - DecodeZigZag(std::numeric_limits::max() - 1, 2)); - EXPECT_EQ(std::numeric_limits::min() + 2, - DecodeZigZag(std::numeric_limits::max() - 2, 2)); - EXPECT_EQ(std::numeric_limits::min() + 3, - DecodeZigZag(std::numeric_limits::max() - 3, 2)); - EXPECT_EQ(std::numeric_limits::max(), - DecodeZigZag(std::numeric_limits::max() - 4, 2)); -} - -TEST(ZigZagCoding, Encode63) { - EXPECT_EQ(0u, EncodeZigZag(0, 63)); - - for (int64_t i = 0; i < 0xFFFFFFFF; i += 1234567) { - const int64_t positive_val = GetLowerBits(i * i * i + i * i, 63) | 1UL; - ASSERT_EQ(static_cast(positive_val), - EncodeZigZag(positive_val, 63)); - ASSERT_EQ((1ULL << 63) - 1 + positive_val, EncodeZigZag(-positive_val, 63)); - } - - EXPECT_EQ((1ULL << 63) - 1, - EncodeZigZag(std::numeric_limits::max(), 63)); - EXPECT_EQ(std::numeric_limits::max() - 1, - EncodeZigZag(std::numeric_limits::min() + 1, 63)); - EXPECT_EQ(std::numeric_limits::max(), - EncodeZigZag(std::numeric_limits::min(), 63)); -} - -TEST(BufToStream, UInt8_Empty) { - const std::string expected_bits = ""; - std::vector buffer = StreamToBuffer(expected_bits); - EXPECT_TRUE(buffer.empty()); - const std::string result_bits = BufferToStream(buffer); - EXPECT_EQ(expected_bits, result_bits); -} - -TEST(BufToStream, UInt8_OneWord) { - const std::string expected_bits = "00101100"; - std::vector buffer = StreamToBuffer(expected_bits); - EXPECT_EQ( - std::vector( - {static_cast(StreamToBitset<8>(expected_bits).to_ulong())}), - buffer); - const std::string result_bits = BufferToStream(buffer); - EXPECT_EQ(expected_bits, result_bits); -} - -TEST(BufToStream, UInt8_MultipleWords) { - const std::string expected_bits = "00100010""01101010""01111101""00100010"; - std::vector buffer = StreamToBuffer(expected_bits); - EXPECT_EQ( - std::vector({ - static_cast(StreamToBitset<8>("00100010").to_ulong()), - static_cast(StreamToBitset<8>("01101010").to_ulong()), - static_cast(StreamToBitset<8>("01111101").to_ulong()), - static_cast(StreamToBitset<8>("00100010").to_ulong()), - }), buffer); - const std::string result_bits = BufferToStream(buffer); - EXPECT_EQ(expected_bits, result_bits); -} - -TEST(BufToStream, UInt64_Empty) { - const std::string expected_bits = ""; - std::vector buffer = StreamToBuffer(expected_bits); - EXPECT_TRUE(buffer.empty()); - const std::string result_bits = BufferToStream(buffer); - EXPECT_EQ(expected_bits, result_bits); -} - -TEST(BufToStream, UInt64_OneWord) { - const std::string expected_bits = - "0001000111101110011001101010101000100010110011000100010010001000"; - std::vector buffer = StreamToBuffer(expected_bits); - ASSERT_EQ(1u, buffer.size()); - EXPECT_EQ(0x1122334455667788u, buffer[0]); - const std::string result_bits = BufferToStream(buffer); - EXPECT_EQ(expected_bits, result_bits); -} - -TEST(BufToStream, UInt64_Unaligned) { - const std::string expected_bits = - "0010001001101010011111010010001001001010000111110010010010010101" - "0010001001101010011111111111111111111111"; - std::vector buffer = StreamToBuffer(expected_bits); - EXPECT_EQ(std::vector({ - StreamToBits(expected_bits.substr(0, 64)), - StreamToBits(expected_bits.substr(64, 64)), - }), buffer); - const std::string result_bits = BufferToStream(buffer); - EXPECT_EQ(PadToWord<64>(expected_bits), result_bits); -} - -TEST(BufToStream, UInt64_MultipleWords) { - const std::string expected_bits = - "0010001001101010011111010010001001001010000111110010010010010101" - "0010001001101010011111111111111111111111000111110010010010010111" - "0000000000000000000000000000000000000000000000000010010011111111"; - std::vector buffer = StreamToBuffer(expected_bits); - EXPECT_EQ(std::vector({ - StreamToBits(expected_bits.substr(0, 64)), - StreamToBits(expected_bits.substr(64, 64)), - StreamToBits(expected_bits.substr(128, 64)), - }), buffer); - const std::string result_bits = BufferToStream(buffer); - EXPECT_EQ(expected_bits, result_bits); -} - -TEST(PadToWord, Test) { - EXPECT_EQ("10100000", PadToWord<8>("101")); - EXPECT_EQ("10100000""00000000", PadToWord<16>("101")); - EXPECT_EQ("10100000""00000000""00000000""00000000", - PadToWord<32>("101")); - EXPECT_EQ("10100000""00000000""00000000""00000000" - "00000000""00000000""00000000""00000000", - PadToWord<64>("101")); -} - -TEST(BitWriterStringStream, Empty) { - BitWriterStringStream writer; - EXPECT_EQ(0u, writer.GetNumBits()); - EXPECT_EQ(0u, writer.GetDataSizeBytes()); - EXPECT_EQ("", writer.GetStreamRaw()); -} - -TEST(BitWriterStringStream, WriteStream) { - BitWriterStringStream writer; - const std::string bits1 = "1011111111111111111"; - writer.WriteStream(bits1); - EXPECT_EQ(19u, writer.GetNumBits()); - EXPECT_EQ(3u, writer.GetDataSizeBytes()); - EXPECT_EQ(bits1, writer.GetStreamRaw()); - - const std::string bits2 = "10100001010101010000111111111111111111111111111"; - writer.WriteStream(bits2); - EXPECT_EQ(66u, writer.GetNumBits()); - EXPECT_EQ(9u, writer.GetDataSizeBytes()); - EXPECT_EQ(bits1 + bits2, writer.GetStreamRaw()); -} - -TEST(BitWriterStringStream, WriteBitSet) { - BitWriterStringStream writer; - const std::string bits1 = "10101"; - writer.WriteBitset(StreamToBitset<16>(bits1)); - EXPECT_EQ(16u, writer.GetNumBits()); - EXPECT_EQ(2u, writer.GetDataSizeBytes()); - EXPECT_EQ(PadToWord<16>(bits1), writer.GetStreamRaw()); -} - -TEST(BitWriterStringStream, WriteBits) { - BitWriterStringStream writer; - const uint64_t bits1 = 0x1 | 0x2 | 0x10; - writer.WriteBits(bits1, 5); - EXPECT_EQ(5u, writer.GetNumBits()); - EXPECT_EQ(1u, writer.GetDataSizeBytes()); - EXPECT_EQ("11001", writer.GetStreamRaw()); -} - -TEST(BitWriterStringStream, WriteUnencodedU8) { - BitWriterStringStream writer; - const uint8_t bits = 127; - writer.WriteUnencoded(bits); - EXPECT_EQ(8u, writer.GetNumBits()); - EXPECT_EQ("11111110", writer.GetStreamRaw()); -} - -TEST(BitWriterStringStream, WriteUnencodedS64) { - BitWriterStringStream writer; - const int64_t bits = std::numeric_limits::min() + 7; - writer.WriteUnencoded(bits); - EXPECT_EQ(64u, writer.GetNumBits()); - EXPECT_EQ("1110000000000000000000000000000000000000000000000000000000000001", - writer.GetStreamRaw()); -} - -TEST(BitWriterStringStream, WriteMultiple) { - BitWriterStringStream writer; - - std::string expected_result; - const std::string bits1 = "101001111111001100010000001110001111111100"; - writer.WriteStream(bits1); - - const std::string bits2 = "10100011000010010101"; - writer.WriteBitset(StreamToBitset<20>(bits2)); - - const uint64_t val = 0x1 | 0x2 | 0x10; - const std::string bits3 = BitsToStream(val, 8); - writer.WriteBits(val, 8); - - const std::string expected = bits1 + bits2 + bits3; - - EXPECT_EQ(expected.length(), writer.GetNumBits()); - EXPECT_EQ(9u, writer.GetDataSizeBytes()); - EXPECT_EQ(expected, writer.GetStreamRaw()); - - EXPECT_EQ(PadToWord<8>(expected), BufferToStream(writer.GetDataCopy())); -} - -TEST(BitWriterWord64, Empty) { - BitWriterWord64 writer; - EXPECT_EQ(0u, writer.GetNumBits()); - EXPECT_EQ(0u, writer.GetDataSizeBytes()); - EXPECT_EQ("", writer.GetStreamPadded64()); -} - -TEST(BitWriterWord64, WriteStream) { - BitWriterWord64 writer; - std::string expected; - - { - const std::string bits = "101"; - expected += bits; - writer.WriteStream(bits); - EXPECT_EQ(expected.length(), writer.GetNumBits()); - EXPECT_EQ(1u, writer.GetDataSizeBytes()); - EXPECT_EQ(PadToWord<64>(expected), writer.GetStreamPadded64()); - } - - { - const std::string bits = "10000111111111110000000"; - expected += bits; - writer.WriteStream(bits); - EXPECT_EQ(expected.length(), writer.GetNumBits()); - EXPECT_EQ(PadToWord<64>(expected), writer.GetStreamPadded64()); - } - - { - const std::string bits = "101001111111111100000111111111111100"; - expected += bits; - writer.WriteStream(bits); - EXPECT_EQ(expected.length(), writer.GetNumBits()); - EXPECT_EQ(PadToWord<64>(expected), writer.GetStreamPadded64()); - } -} - -TEST(BitWriterWord64, WriteBitset) { - BitWriterWord64 writer; - const std::string bits1 = "10101"; - writer.WriteBitset(StreamToBitset<16>(bits1), 12); - EXPECT_EQ(12u, writer.GetNumBits()); - EXPECT_EQ(2u, writer.GetDataSizeBytes()); - EXPECT_EQ(PadToWord<64>(bits1), writer.GetStreamPadded64()); -} - -TEST(BitWriterWord64, WriteBits) { - BitWriterWord64 writer; - const uint64_t bits1 = 0x1 | 0x2 | 0x10; - writer.WriteBits(bits1, 5); - writer.WriteBits(bits1, 5); - writer.WriteBits(bits1, 5); - EXPECT_EQ(15u, writer.GetNumBits()); - EXPECT_EQ(2u, writer.GetDataSizeBytes()); - EXPECT_EQ(PadToWord<64>("110011100111001"), writer.GetStreamPadded64()); -} - -TEST(BitWriterWord64, WriteZeroBits) { - BitWriterWord64 writer; - writer.WriteBits(0, 0); - writer.WriteBits(1, 0); - EXPECT_EQ(0u, writer.GetNumBits()); - writer.WriteBits(1, 1); - writer.WriteBits(0, 0); - EXPECT_EQ(PadToWord<64>("1"), writer.GetStreamPadded64()); - writer.WriteBits(0, 63); - EXPECT_EQ(64u, writer.GetNumBits()); - writer.WriteBits(0, 0); - writer.WriteBits(7, 3); - writer.WriteBits(0, 0); - EXPECT_EQ(PadToWord<64>( - "1" - "000000000000000000000000000000000000000000000000000000000000000" - "111"), writer.GetStreamPadded64()); -} - -TEST(BitWriterWord64, ComparisonTestWriteLotsOfBits) { - BitWriterStringStream writer1; - BitWriterWord64 writer2(16384); - - for (uint64_t i = 0; i < 65000; i += 25) { - writer1.WriteBits(i, 16); - writer2.WriteBits(i, 16); - ASSERT_EQ(writer1.GetNumBits(), writer2.GetNumBits()); - } - - EXPECT_EQ(PadToWord<64>(writer1.GetStreamRaw()), - writer2.GetStreamPadded64()); -} - -TEST(BitWriterWord64, ComparisonTestWriteLotsOfStreams) { - BitWriterStringStream writer1; - BitWriterWord64 writer2(16384); - - for (int i = 0; i < 1000; ++i) { - std::string bits = "1111100000"; - if (i % 2) - bits += "101010"; - if (i % 3) - bits += "1110100"; - if (i % 5) - bits += "1110100111111111111"; - writer1.WriteStream(bits); - writer2.WriteStream(bits); - ASSERT_EQ(writer1.GetNumBits(), writer2.GetNumBits()); - } - - EXPECT_EQ(PadToWord<64>(writer1.GetStreamRaw()), - writer2.GetStreamPadded64()); -} - -TEST(BitWriterWord64, ComparisonTestWriteLotsOfBitsets) { - BitWriterStringStream writer1; - BitWriterWord64 writer2(16384); - - for (uint64_t i = 0; i < 65000; i += 25) { - std::bitset<16> bits1(i); - std::bitset<24> bits2(i); - writer1.WriteBitset(bits1); - writer1.WriteBitset(bits2); - writer2.WriteBitset(bits1); - writer2.WriteBitset(bits2); - ASSERT_EQ(writer1.GetNumBits(), writer2.GetNumBits()); - } - - EXPECT_EQ(PadToWord<64>(writer1.GetStreamRaw()), - writer2.GetStreamPadded64()); -} - -TEST(GetLowerBits, Test) { - EXPECT_EQ(0u, GetLowerBits(255, 0)); - EXPECT_EQ(1u, GetLowerBits(255, 1)); - EXPECT_EQ(3u, GetLowerBits(255, 2)); - EXPECT_EQ(7u, GetLowerBits(255, 3)); - EXPECT_EQ(15u, GetLowerBits(255, 4)); - EXPECT_EQ(31u, GetLowerBits(255, 5)); - EXPECT_EQ(63u, GetLowerBits(255, 6)); - EXPECT_EQ(127u, GetLowerBits(255, 7)); - EXPECT_EQ(255u, GetLowerBits(255, 8)); - EXPECT_EQ(0xFFu, GetLowerBits(0xFFFFFFFF, 8)); - EXPECT_EQ(0xFFFFu, GetLowerBits(0xFFFFFFFF, 16)); - EXPECT_EQ(0xFFFFFFu, GetLowerBits(0xFFFFFFFF, 24)); - EXPECT_EQ(0xFFFFFFu, GetLowerBits(0xFFFFFFFFFFFF, 24)); - EXPECT_EQ(0xFFFFFFFFFFFFFFFFu, - GetLowerBits(0xFFFFFFFFFFFFFFFFu, 64)); - EXPECT_EQ(StreamToBits("1010001110"), - GetLowerBits( - StreamToBits("1010001110111101111111"), 10)); -} - -TEST(BitReaderFromString, FromU8) { - std::vector buffer = { - 0xAA, 0xBB, 0xCC, 0xDD, - }; - - const std::string total_stream = - "01010101""11011101""00110011""10111011"; - - BitReaderFromString reader(buffer); - EXPECT_EQ(PadToWord<64>(total_stream), reader.GetStreamPadded64()); - - uint64_t bits = 0; - EXPECT_EQ(2u, reader.ReadBits(&bits, 2)); - EXPECT_EQ(PadToWord<64>("01"), BitsToStream(bits)); - EXPECT_EQ(20u, reader.ReadBits(&bits, 20)); - EXPECT_EQ(PadToWord<64>("01010111011101001100"), BitsToStream(bits)); - EXPECT_EQ(20u, reader.ReadBits(&bits, 20)); - EXPECT_EQ(PadToWord<64>("11101110110000000000"), BitsToStream(bits)); - EXPECT_EQ(22u, reader.ReadBits(&bits, 30)); - EXPECT_EQ(PadToWord<64>("0000000000000000000000"), BitsToStream(bits)); - EXPECT_TRUE(reader.ReachedEnd()); -} - -TEST(BitReaderFromString, FromU64) { - std::vector buffer = { - 0xAAAAAAAAAAAAAAAA, - 0xBBBBBBBBBBBBBBBB, - 0xCCCCCCCCCCCCCCCC, - 0xDDDDDDDDDDDDDDDD, - }; - - const std::string total_stream = - "0101010101010101010101010101010101010101010101010101010101010101" - "1101110111011101110111011101110111011101110111011101110111011101" - "0011001100110011001100110011001100110011001100110011001100110011" - "1011101110111011101110111011101110111011101110111011101110111011"; - - BitReaderFromString reader(buffer); - EXPECT_EQ(total_stream, reader.GetStreamPadded64()); - - uint64_t bits = 0; - size_t pos = 0; - size_t to_read = 5; - while (reader.ReadBits(&bits, to_read) > 0) { - EXPECT_EQ(BitsToStream(bits), - PadToWord<64>(total_stream.substr(pos, to_read))); - pos += to_read; - to_read = (to_read + 35) % 64 + 1; - } - EXPECT_TRUE(reader.ReachedEnd()); -} - -TEST(BitReaderWord64, ReadBitsSingleByte) { - BitReaderWord64 reader(std::vector({uint8_t(0xF0)})); - EXPECT_FALSE(reader.ReachedEnd()); - - uint64_t bits = 0; - EXPECT_EQ(1u, reader.ReadBits(&bits, 1)); - EXPECT_EQ(0u, bits); - EXPECT_EQ(2u, reader.ReadBits(&bits, 2)); - EXPECT_EQ(0u, bits); - EXPECT_EQ(2u, reader.ReadBits(&bits, 2)); - EXPECT_EQ(2u, bits); - EXPECT_EQ(2u, reader.ReadBits(&bits, 2)); - EXPECT_EQ(3u, bits); - EXPECT_FALSE(reader.OnlyZeroesLeft()); - EXPECT_FALSE(reader.ReachedEnd()); - EXPECT_EQ(2u, reader.ReadBits(&bits, 2)); - EXPECT_EQ(1u, bits); - EXPECT_TRUE(reader.OnlyZeroesLeft()); - EXPECT_FALSE(reader.ReachedEnd()); - EXPECT_EQ(55u, reader.ReadBits(&bits, 64)); - EXPECT_EQ(0u, bits); - EXPECT_TRUE(reader.ReachedEnd()); -} - -TEST(BitReaderWord64, ReadBitsetSingleByte) { - BitReaderWord64 reader(std::vector({uint8_t(0xCC)})); - std::bitset<4> bits; - EXPECT_EQ(2u, reader.ReadBitset(&bits, 2)); - EXPECT_EQ(0u, bits.to_ullong()); - EXPECT_EQ(2u, reader.ReadBitset(&bits, 2)); - EXPECT_EQ(3u, bits.to_ullong()); - EXPECT_FALSE(reader.OnlyZeroesLeft()); - EXPECT_EQ(4u, reader.ReadBitset(&bits, 4)); - EXPECT_EQ(12u, bits.to_ullong()); - EXPECT_TRUE(reader.OnlyZeroesLeft()); -} - -TEST(BitReaderWord64, ReadStreamSingleByte) { - BitReaderWord64 reader(std::vector({uint8_t(0xAA)})); - EXPECT_EQ("", reader.ReadStream(0)); - EXPECT_EQ("0", reader.ReadStream(1)); - EXPECT_EQ("101", reader.ReadStream(3)); - EXPECT_EQ("01010000", reader.ReadStream(8)); - EXPECT_TRUE(reader.OnlyZeroesLeft()); - EXPECT_EQ("0000000000000000000000000000000000000000000000000000", - reader.ReadStream(64)); - EXPECT_TRUE(reader.ReachedEnd()); -} - -TEST(BitReaderWord64, ReadStreamEmpty) { - std::vector buffer; - BitReaderWord64 reader(std::move(buffer)); - EXPECT_TRUE(reader.OnlyZeroesLeft()); - EXPECT_TRUE(reader.ReachedEnd()); - EXPECT_EQ("", reader.ReadStream(10)); - EXPECT_TRUE(reader.ReachedEnd()); -} - -TEST(BitReaderWord64, ReadBitsTwoWords) { - std::vector buffer = { - 0x0000000000000001, - 0x0000000000FFFFFF - }; - - BitReaderWord64 reader(std::move(buffer)); - - uint64_t bits = 0; - EXPECT_EQ(1u, reader.ReadBits(&bits, 1)); - EXPECT_EQ(1u, bits); - EXPECT_EQ(62u, reader.ReadBits(&bits, 62)); - EXPECT_EQ(0u, bits); - EXPECT_EQ(2u, reader.ReadBits(&bits, 2)); - EXPECT_EQ(2u, bits); - EXPECT_EQ(3u, reader.ReadBits(&bits, 3)); - EXPECT_EQ(7u, bits); - EXPECT_FALSE(reader.OnlyZeroesLeft()); - EXPECT_EQ(32u, reader.ReadBits(&bits, 32)); - EXPECT_EQ(0xFFFFFu, bits); - EXPECT_TRUE(reader.OnlyZeroesLeft()); - EXPECT_FALSE(reader.ReachedEnd()); - EXPECT_EQ(28u, reader.ReadBits(&bits, 32)); - EXPECT_EQ(0u, bits); - EXPECT_TRUE(reader.ReachedEnd()); -} - -TEST(BitReaderFromString, ReadUnencodedU8) { - BitReaderFromString reader("11111110"); - uint8_t val = 0; - ASSERT_TRUE(reader.ReadUnencoded(&val)); - EXPECT_EQ(8u, reader.GetNumReadBits()); - EXPECT_EQ(127, val); -} - -TEST(BitReaderFromString, ReadUnencodedU16Fail) { - BitReaderFromString reader("11111110"); - uint16_t val = 0; - ASSERT_FALSE(reader.ReadUnencoded(&val)); -} - -TEST(BitReaderFromString, ReadUnencodedS64) { - BitReaderFromString reader( - "1110000000000000000000000000000000000000000000000000000000000001"); - int64_t val = 0; - ASSERT_TRUE(reader.ReadUnencoded(&val)); - EXPECT_EQ(64u, reader.GetNumReadBits()); - EXPECT_EQ(std::numeric_limits::min() + 7, val); -} - -TEST(BitReaderWord64, FromU8) { - std::vector buffer = { - 0xAA, 0xBB, 0xCC, 0xDD, - }; - - BitReaderWord64 reader(std::move(buffer)); - - uint64_t bits = 0; - EXPECT_EQ(2u, reader.ReadBits(&bits, 2)); - EXPECT_EQ(PadToWord<64>("01"), BitsToStream(bits)); - EXPECT_EQ(20u, reader.ReadBits(&bits, 20)); - EXPECT_EQ(PadToWord<64>("01010111011101001100"), BitsToStream(bits)); - EXPECT_EQ(20u, reader.ReadBits(&bits, 20)); - EXPECT_EQ(PadToWord<64>("11101110110000000000"), BitsToStream(bits)); - EXPECT_EQ(22u, reader.ReadBits(&bits, 30)); - EXPECT_EQ(PadToWord<64>("0000000000000000000000"), BitsToStream(bits)); - EXPECT_TRUE(reader.ReachedEnd()); -} - -TEST(BitReaderWord64, FromU64) { - std::vector buffer = { - 0xAAAAAAAAAAAAAAAA, - 0xBBBBBBBBBBBBBBBB, - 0xCCCCCCCCCCCCCCCC, - 0xDDDDDDDDDDDDDDDD, - }; - - const std::string total_stream = - "0101010101010101010101010101010101010101010101010101010101010101" - "1101110111011101110111011101110111011101110111011101110111011101" - "0011001100110011001100110011001100110011001100110011001100110011" - "1011101110111011101110111011101110111011101110111011101110111011"; - - BitReaderWord64 reader(std::move(buffer)); - - uint64_t bits = 0; - size_t pos = 0; - size_t to_read = 5; - while (reader.ReadBits(&bits, to_read) > 0) { - EXPECT_EQ(BitsToStream(bits), - PadToWord<64>(total_stream.substr(pos, to_read))); - pos += to_read; - to_read = (to_read + 35) % 64 + 1; - } - EXPECT_TRUE(reader.ReachedEnd()); -} - -TEST(BitReaderWord64, ComparisonLotsOfU8) { - std::vector buffer; - for(uint32_t i = 0; i < 10003; ++i) { - buffer.push_back(static_cast(i % 255)); - } - - BitReaderFromString reader1(buffer); - BitReaderWord64 reader2(std::move(buffer)); - - uint64_t bits1 = 0, bits2 = 0; - size_t to_read = 5; - while (reader1.ReadBits(&bits1, to_read) > 0) { - reader2.ReadBits(&bits2, to_read); - EXPECT_EQ(bits1, bits2); - to_read = (to_read + 35) % 64 + 1; - } - - EXPECT_EQ(0u, reader2.ReadBits(&bits2, 1)); -} - -TEST(BitReaderWord64, ComparisonLotsOfU64) { - std::vector buffer; - for(uint64_t i = 0; i < 1000; ++i) { - buffer.push_back(i); - } - - BitReaderFromString reader1(buffer); - BitReaderWord64 reader2(std::move(buffer)); - - uint64_t bits1 = 0, bits2 = 0; - size_t to_read = 5; - while (reader1.ReadBits(&bits1, to_read) > 0) { - reader2.ReadBits(&bits2, to_read); - EXPECT_EQ(bits1, bits2); - to_read = (to_read + 35) % 64 + 1; - } - - EXPECT_EQ(0u, reader2.ReadBits(&bits2, 1)); -} - -TEST(ReadWriteWord64, ReadWriteLotsOfBits) { - BitWriterWord64 writer(16384); - for (uint64_t i = 0; i < 65000; i += 25) { - const uint64_t num_bits = i % 64 + 1; - const uint64_t bits = i >> (64 - num_bits); - writer.WriteBits(bits, size_t(num_bits)); - } - - BitReaderWord64 reader(writer.GetDataCopy()); - for (uint64_t i = 0; i < 65000; i += 25) { - const uint64_t num_bits = i % 64 + 1; - const uint64_t expected_bits = i >> (64 - num_bits); - uint64_t bits = 0; - reader.ReadBits(&bits, size_t(num_bits)); - EXPECT_EQ(expected_bits, bits); - } - - EXPECT_TRUE(reader.OnlyZeroesLeft()); -} - -TEST(VariableWidthWrite, Write0U) { - BitWriterStringStream writer; - writer.WriteVariableWidthU64(0, 2); - EXPECT_EQ("000", writer.GetStreamRaw ()); - writer.WriteVariableWidthU32(0, 2); - EXPECT_EQ("000""000", writer.GetStreamRaw()); - writer.WriteVariableWidthU16(0, 2); - EXPECT_EQ("000""000""000", writer.GetStreamRaw()); - writer.WriteVariableWidthU8(0, 2); - EXPECT_EQ("000""000""000""000", writer.GetStreamRaw()); -} - -TEST(VariableWidthWrite, Write0S) { - BitWriterStringStream writer; - writer.WriteVariableWidthS64(0, 2, 0); - EXPECT_EQ("000", writer.GetStreamRaw ()); - writer.WriteVariableWidthS32(0, 2, 0); - EXPECT_EQ("000""000", writer.GetStreamRaw()); - writer.WriteVariableWidthS16(0, 2, 0); - EXPECT_EQ("000""000""000", writer.GetStreamRaw()); - writer.WriteVariableWidthS8(0, 2, 0); - EXPECT_EQ("000""000""000""000", writer.GetStreamRaw()); -} - -TEST(VariableWidthWrite, WriteSmallUnsigned) { - BitWriterStringStream writer; - writer.WriteVariableWidthU64(1, 2); - EXPECT_EQ("100", writer.GetStreamRaw ()); - writer.WriteVariableWidthU32(2, 2); - EXPECT_EQ("100""010", writer.GetStreamRaw()); - writer.WriteVariableWidthU16(3, 2); - EXPECT_EQ("100""010""110", writer.GetStreamRaw()); - writer.WriteVariableWidthU8(4, 2); - EXPECT_EQ("100""010""110""001100", writer.GetStreamRaw()); -} - -TEST(VariableWidthWrite, WriteSmallSigned) { - BitWriterStringStream writer; - writer.WriteVariableWidthS64(1, 2, 0); - EXPECT_EQ("010", writer.GetStreamRaw ()); - writer.WriteVariableWidthS64(-1, 2, 0); - EXPECT_EQ("010""100", writer.GetStreamRaw()); - writer.WriteVariableWidthS16(3, 2, 0); - EXPECT_EQ("010""100""011100", writer.GetStreamRaw()); - writer.WriteVariableWidthS8(-4, 2, 0); - EXPECT_EQ("010""100""011100""111100", writer.GetStreamRaw()); -} - -TEST(VariableWidthWrite, U64Val127ChunkLength7) { - BitWriterStringStream writer; - writer.WriteVariableWidthU64(127, 7); - EXPECT_EQ("1111111""0", writer.GetStreamRaw()); -} - -TEST(VariableWidthWrite, U32Val255ChunkLength7) { - BitWriterStringStream writer; - writer.WriteVariableWidthU32(255, 7); - EXPECT_EQ("1111111""1""1000000""0", writer.GetStreamRaw()); -} - -TEST(VariableWidthWrite, U16Val2ChunkLength4) { - BitWriterStringStream writer; - writer.WriteVariableWidthU16(2, 4); - EXPECT_EQ("0100""0", writer.GetStreamRaw()); -} - -TEST(VariableWidthWrite, U8Val128ChunkLength7) { - BitWriterStringStream writer; - writer.WriteVariableWidthU8(128, 7); - EXPECT_EQ("0000000""1""1", writer.GetStreamRaw()); -} - -TEST(VariableWidthWrite, U64ValAAAAChunkLength2) { - BitWriterStringStream writer; - writer.WriteVariableWidthU64(0xAAAA, 2); - EXPECT_EQ("01""1""01""1""01""1""01""1" - "01""1""01""1""01""1""01""0", writer.GetStreamRaw()); -} - -TEST(VariableWidthWrite, S8ValM128ChunkLength7) { - BitWriterStringStream writer; - writer.WriteVariableWidthS8(-128, 7, 0); - EXPECT_EQ("1111111""1""1", writer.GetStreamRaw()); -} - -TEST(VariableWidthRead, U64Val127ChunkLength7) { - BitReaderFromString reader("1111111""0"); - uint64_t val = 0; - ASSERT_TRUE(reader.ReadVariableWidthU64(&val, 7)); - EXPECT_EQ(127u, val); -} - -TEST(VariableWidthRead, U32Val255ChunkLength7) { - BitReaderFromString reader("1111111""1""1000000""0"); - uint32_t val = 0; - ASSERT_TRUE(reader.ReadVariableWidthU32(&val, 7)); - EXPECT_EQ(255u, val); -} - -TEST(VariableWidthRead, U16Val2ChunkLength4) { - BitReaderFromString reader("0100""0"); - uint16_t val = 0; - ASSERT_TRUE(reader.ReadVariableWidthU16(&val, 4)); - EXPECT_EQ(2u, val); -} - -TEST(VariableWidthRead, U8Val128ChunkLength7) { - BitReaderFromString reader("0000000""1""1"); - uint8_t val = 0; - ASSERT_TRUE(reader.ReadVariableWidthU8(&val, 7)); - EXPECT_EQ(128u, val); -} - -TEST(VariableWidthRead, U64ValAAAAChunkLength2) { - BitReaderFromString reader("01""1""01""1""01""1""01""1" - "01""1""01""1""01""1""01""0"); - uint64_t val = 0; - ASSERT_TRUE(reader.ReadVariableWidthU64(&val, 2)); - EXPECT_EQ(0xAAAAu, val); -} - -TEST(VariableWidthRead, S8ValM128ChunkLength7) { - BitReaderFromString reader("1111111""1""1"); - int8_t val = 0; - ASSERT_TRUE(reader.ReadVariableWidthS8(&val, 7, 0)); - EXPECT_EQ(-128, val); -} - -TEST(VariableWidthRead, FailTooShort) { - BitReaderFromString reader("00000001100000"); - uint64_t val = 0; - ASSERT_FALSE(reader.ReadVariableWidthU64(&val, 7)); -} - -TEST(VariableWidthWriteRead, SingleWriteReadU64) { - for (uint64_t i = 0; i < 1000000; i += 1234) { - const uint64_t val = i * i * i; - const size_t chunk_length = size_t(i % 16 + 1); - - BitWriterWord64 writer; - writer.WriteVariableWidthU64(val, chunk_length); - - BitReaderWord64 reader(writer.GetDataCopy()); - uint64_t read_val = 0; - ASSERT_TRUE(reader.ReadVariableWidthU64(&read_val, chunk_length)); - - ASSERT_EQ(val, read_val) << "Chunk length " << chunk_length; - } -} - -TEST(VariableWidthWriteRead, SingleWriteReadS64) { - for (int64_t i = 0; i < 1000000; i += 4321) { - const int64_t val = i * i * (i % 2 ? -i : i); - const size_t chunk_length = size_t(i % 16 + 1); - const size_t zigzag_exponent = size_t(i % 13); - - BitWriterWord64 writer; - writer.WriteVariableWidthS64(val, chunk_length, zigzag_exponent); - - BitReaderWord64 reader(writer.GetDataCopy()); - int64_t read_val = 0; - ASSERT_TRUE(reader.ReadVariableWidthS64(&read_val, chunk_length, - zigzag_exponent)); - - ASSERT_EQ(val, read_val) << "Chunk length " << chunk_length; - } -} - -TEST(VariableWidthWriteRead, SingleWriteReadU32) { - for (uint32_t i = 0; i < 100000; i += 123) { - const uint32_t val = i * i; - const size_t chunk_length = i % 16 + 1; - - BitWriterWord64 writer; - writer.WriteVariableWidthU32(val, chunk_length); - - BitReaderWord64 reader(writer.GetDataCopy()); - uint32_t read_val = 0; - ASSERT_TRUE(reader.ReadVariableWidthU32(&read_val, chunk_length)); - - ASSERT_EQ(val, read_val) << "Chunk length " << chunk_length; - } -} - -TEST(VariableWidthWriteRead, SingleWriteReadS32) { - for (int32_t i = 0; i < 100000; i += 123) { - const int32_t val = i * (i % 2 ? -i : i); - const size_t chunk_length = i % 16 + 1; - const size_t zigzag_exponent = i % 11; - - BitWriterWord64 writer; - writer.WriteVariableWidthS32(val, chunk_length, zigzag_exponent); - - BitReaderWord64 reader(writer.GetDataCopy()); - int32_t read_val = 0; - ASSERT_TRUE(reader.ReadVariableWidthS32( - &read_val, chunk_length, zigzag_exponent)); - - ASSERT_EQ(val, read_val) << "Chunk length " << chunk_length; - } -} - -TEST(VariableWidthWriteRead, SingleWriteReadU16) { - for (int i = 0; i < 65536; i += 123) { - const uint16_t val = static_cast(i); - const size_t chunk_length = val % 10 + 1; - - BitWriterWord64 writer; - writer.WriteVariableWidthU16(val, chunk_length); - - BitReaderWord64 reader(writer.GetDataCopy()); - uint16_t read_val = 0; - ASSERT_TRUE(reader.ReadVariableWidthU16(&read_val, chunk_length)); - - ASSERT_EQ(val, read_val) << "Chunk length " << chunk_length; - } -} - -TEST(VariableWidthWriteRead, SingleWriteReadS16) { - for (int i = -32768; i < 32768; i += 123) { - const int16_t val = static_cast(i); - const size_t chunk_length = std::abs(i) % 10 + 1; - const size_t zigzag_exponent = std::abs(i) % 7; - - BitWriterWord64 writer; - writer.WriteVariableWidthS16(val, chunk_length, zigzag_exponent); - - BitReaderWord64 reader(writer.GetDataCopy()); - int16_t read_val = 0; - ASSERT_TRUE(reader.ReadVariableWidthS16(&read_val, chunk_length, - zigzag_exponent)); - - ASSERT_EQ(val, read_val) << "Chunk length " << chunk_length; - } -} - -TEST(VariableWidthWriteRead, SingleWriteReadU8) { - for (int i = 0; i < 256; ++i) { - const uint8_t val = static_cast(i); - const size_t chunk_length = val % 5 + 1; - - BitWriterWord64 writer; - writer.WriteVariableWidthU8(val, chunk_length); - - BitReaderWord64 reader(writer.GetDataCopy()); - uint8_t read_val = 0; - ASSERT_TRUE(reader.ReadVariableWidthU8(&read_val, chunk_length)); - - ASSERT_EQ(val, read_val) << "Chunk length " << chunk_length; - } -} - -TEST(VariableWidthWriteRead, SingleWriteReadS8) { - for (int i = -128; i < 128; ++i) { - const int8_t val = static_cast(i); - const size_t chunk_length = std::abs(i) % 5 + 1; - const size_t zigzag_exponent = std::abs(i) % 3; - - BitWriterWord64 writer; - writer.WriteVariableWidthS8(val, chunk_length, zigzag_exponent); - - BitReaderWord64 reader(writer.GetDataCopy()); - int8_t read_val = 0; - ASSERT_TRUE(reader.ReadVariableWidthS8(&read_val, chunk_length, - zigzag_exponent)); - - ASSERT_EQ(val, read_val) << "Chunk length " << chunk_length; - } -} - -TEST(VariableWidthWriteRead, SmallNumbersChunkLength4) { - const std::vector expected_values = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; - - BitWriterWord64 writer; - for (uint64_t val : expected_values) { - writer.WriteVariableWidthU64(val, 4); - } - - EXPECT_EQ(50u, writer.GetNumBits()); - - std::vector actual_values; - BitReaderWord64 reader(writer.GetDataCopy()); - while(!reader.OnlyZeroesLeft()) { - uint64_t val = 0; - ASSERT_TRUE(reader.ReadVariableWidthU64(&val, 4)); - actual_values.push_back(val); - } - - EXPECT_EQ(expected_values, actual_values); -} - -TEST(VariableWidthWriteRead, VariedNumbersChunkLength8) { - const std::vector expected_values = {1000, 0, 255, 4294967296}; - const size_t kExpectedNumBits = 9 * (2 + 1 + 1 + 5); - - BitWriterWord64 writer; - for (uint64_t val : expected_values) { - writer.WriteVariableWidthU64(val, 8); - } - - EXPECT_EQ(kExpectedNumBits, writer.GetNumBits()); - - std::vector actual_values; - BitReaderWord64 reader(writer.GetDataCopy()); - while (!reader.OnlyZeroesLeft()) { - uint64_t val = 0; - ASSERT_TRUE(reader.ReadVariableWidthU64(&val, 8)); - actual_values.push_back(val); - } - - EXPECT_EQ(expected_values, actual_values); -} - -TEST(FixedWidthWrite, Val0Max3) { - BitWriterStringStream writer; - writer.WriteFixedWidth(0, 3); - EXPECT_EQ("00", writer.GetStreamRaw()); -} - -TEST(FixedWidthWrite, Val0Max5) { - BitWriterStringStream writer; - writer.WriteFixedWidth(0, 5); - EXPECT_EQ("000", writer.GetStreamRaw()); -} - -TEST(FixedWidthWrite, Val0Max255) { - BitWriterStringStream writer; - writer.WriteFixedWidth(0, 255); - EXPECT_EQ("00000000", writer.GetStreamRaw()); -} - -TEST(FixedWidthWrite, Val3Max8) { - BitWriterStringStream writer; - writer.WriteFixedWidth(3, 8); - EXPECT_EQ("1100", writer.GetStreamRaw()); -} - -TEST(FixedWidthWrite, Val15Max127) { - BitWriterStringStream writer; - writer.WriteFixedWidth(15, 127); - EXPECT_EQ("1111000", writer.GetStreamRaw()); -} - -TEST(FixedWidthRead, Val0Max3) { - BitReaderFromString reader("0011111"); - uint64_t val = 0; - ASSERT_TRUE(reader.ReadFixedWidth(&val, 3)); - EXPECT_EQ(0u, val); -} - -TEST(FixedWidthRead, Val0Max5) { - BitReaderFromString reader("0001010101"); - uint64_t val = 0; - ASSERT_TRUE(reader.ReadFixedWidth(&val, 5)); - EXPECT_EQ(0u, val); -} - -TEST(FixedWidthRead, Val3Max8) { - BitReaderFromString reader("11001010101"); - uint64_t val = 0; - ASSERT_TRUE(reader.ReadFixedWidth(&val, 8)); - EXPECT_EQ(3u, val); -} - -TEST(FixedWidthRead, Val15Max127) { - BitReaderFromString reader("111100010101"); - uint64_t val = 0; - ASSERT_TRUE(reader.ReadFixedWidth(&val, 127)); - EXPECT_EQ(15u, val); -} - -TEST(FixedWidthRead, Fail) { - BitReaderFromString reader("111100"); - uint64_t val = 0; - ASSERT_FALSE(reader.ReadFixedWidth(&val, 127)); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/c_interface_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/c_interface_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/c_interface_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/c_interface_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,283 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include - -#include "message.h" -#include "spirv-tools/libspirv.h" -#include "table.h" - -namespace { - -using namespace spvtools; - -// The default consumer is a null std::function. -TEST(CInterface, DefaultConsumerNullDiagnosticForValidInput) { - auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); - const char input_text[] = - "OpCapability Shader\n" - "OpCapability Linkage\n" - "OpMemoryModel Logical GLSL450"; - - spv_binary binary = nullptr; - EXPECT_EQ(SPV_SUCCESS, spvTextToBinary(context, input_text, - sizeof(input_text), &binary, nullptr)); - - { - // Sadly the compiler don't allow me to feed binary directly to - // spvValidate(). - spv_const_binary_t b{binary->code, binary->wordCount}; - EXPECT_EQ(SPV_SUCCESS, spvValidate(context, &b, nullptr)); - } - - spv_text text = nullptr; - EXPECT_EQ(SPV_SUCCESS, spvBinaryToText(context, binary->code, - binary->wordCount, 0, &text, nullptr)); - - spvTextDestroy(text); - spvBinaryDestroy(binary); - spvContextDestroy(context); -} - -// The default consumer is a null std::function. -TEST(CInterface, DefaultConsumerNullDiagnosticForInvalidAssembling) { - auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); - const char input_text[] = "%1 = OpName"; - - spv_binary binary = nullptr; - EXPECT_EQ(SPV_ERROR_INVALID_TEXT, - spvTextToBinary(context, input_text, sizeof(input_text), &binary, - nullptr)); - spvBinaryDestroy(binary); - spvContextDestroy(context); -} - -// The default consumer is a null std::function. -TEST(CInterface, DefaultConsumerNullDiagnosticForInvalidDiassembling) { - auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); - const char input_text[] = "OpNop"; - - spv_binary binary = nullptr; - ASSERT_EQ(SPV_SUCCESS, spvTextToBinary(context, input_text, - sizeof(input_text), &binary, nullptr)); - // Change OpNop to an invalid (wordcount|opcode) word. - binary->code[binary->wordCount - 1] = 0xffffffff; - - spv_text text = nullptr; - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, - spvBinaryToText(context, binary->code, binary->wordCount, 0, &text, - nullptr)); - - spvTextDestroy(text); - spvBinaryDestroy(binary); - spvContextDestroy(context); -} - -// The default consumer is a null std::function. -TEST(CInterface, DefaultConsumerNullDiagnosticForInvalidValidating) { - auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); - const char input_text[] = "OpNop"; - - spv_binary binary = nullptr; - ASSERT_EQ(SPV_SUCCESS, spvTextToBinary(context, input_text, - sizeof(input_text), &binary, nullptr)); - - spv_const_binary_t b{binary->code, binary->wordCount}; - EXPECT_EQ(SPV_ERROR_INVALID_LAYOUT, spvValidate(context, &b, nullptr)); - - spvBinaryDestroy(binary); - spvContextDestroy(context); -} - -TEST(CInterface, SpecifyConsumerNullDiagnosticForAssembling) { - const char input_text[] = "%1 = OpName\n"; - - auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); - int invocation = 0; - // TODO(antiagainst): Use public C API for setting the consumer once exists. - SetContextMessageConsumer( - context, - [&invocation](spv_message_level_t level, const char* source, - const spv_position_t& position, const char* message) { - ++invocation; - EXPECT_EQ(SPV_MSG_ERROR, level); - // The error happens at scanning the begining of second line. - EXPECT_STREQ("input", source); - EXPECT_EQ(1u, position.line); - EXPECT_EQ(0u, position.column); - EXPECT_EQ(12u, position.index); - EXPECT_STREQ("Expected operand, found end of stream.", message); - }); - - spv_binary binary = nullptr; - EXPECT_EQ(SPV_ERROR_INVALID_TEXT, - spvTextToBinary(context, input_text, sizeof(input_text), &binary, - nullptr)); - EXPECT_EQ(1, invocation); - spvBinaryDestroy(binary); - spvContextDestroy(context); -} - -TEST(CInterface, SpecifyConsumerNullDiagnosticForDisassembling) { - const char input_text[] = "OpNop"; - - auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); - int invocation = 0; - SetContextMessageConsumer( - context, - [&invocation](spv_message_level_t level, const char* source, - const spv_position_t& position, const char* message) { - ++invocation; - EXPECT_EQ(SPV_MSG_ERROR, level); - EXPECT_STREQ("input", source); - EXPECT_EQ(0u, position.line); - EXPECT_EQ(0u, position.column); - EXPECT_EQ(5u, position.index); - EXPECT_STREQ("Invalid opcode: 65535", message); - }); - - spv_binary binary = nullptr; - ASSERT_EQ(SPV_SUCCESS, spvTextToBinary(context, input_text, - sizeof(input_text), &binary, nullptr)); - // Change OpNop to an invalid (wordcount|opcode) word. - binary->code[binary->wordCount - 1] = 0xffffffff; - - spv_text text = nullptr; - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, - spvBinaryToText(context, binary->code, binary->wordCount, 0, &text, - nullptr)); - EXPECT_EQ(1, invocation); - - spvTextDestroy(text); - spvBinaryDestroy(binary); - spvContextDestroy(context); -} - -TEST(CInterface, SpecifyConsumerNullDiagnosticForValidating) { - const char input_text[] = "OpNop"; - - auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); - int invocation = 0; - SetContextMessageConsumer( - context, - [&invocation](spv_message_level_t level, const char* source, - const spv_position_t& position, const char* message) { - ++invocation; - EXPECT_EQ(SPV_MSG_ERROR, level); - EXPECT_STREQ("input", source); - EXPECT_EQ(0u, position.line); - EXPECT_EQ(0u, position.column); - // TODO(antiagainst): what validation reports is not a word offset here. - // It is inconsistent with diassembler. Should be fixed. - EXPECT_EQ(1u, position.index); - EXPECT_STREQ("Nop cannot appear before the memory model instruction", - message); - }); - - spv_binary binary = nullptr; - ASSERT_EQ(SPV_SUCCESS, spvTextToBinary(context, input_text, - sizeof(input_text), &binary, nullptr)); - - spv_const_binary_t b{binary->code, binary->wordCount}; - EXPECT_EQ(SPV_ERROR_INVALID_LAYOUT, spvValidate(context, &b, nullptr)); - EXPECT_EQ(1, invocation); - - spvBinaryDestroy(binary); - spvContextDestroy(context); -} - -// When having both a consumer and an diagnostic object, the diagnostic object -// should take priority. -TEST(CInterface, SpecifyConsumerSpecifyDiagnosticForAssembling) { - const char input_text[] = "%1 = OpName"; - - auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); - int invocation = 0; - SetContextMessageConsumer( - context, - [&invocation](spv_message_level_t, const char*, const spv_position_t&, - const char*) { ++invocation; }); - - spv_binary binary = nullptr; - spv_diagnostic diagnostic = nullptr; - EXPECT_EQ(SPV_ERROR_INVALID_TEXT, - spvTextToBinary(context, input_text, sizeof(input_text), &binary, - &diagnostic)); - EXPECT_EQ(0, invocation); // Consumer should not be invoked at all. - EXPECT_STREQ("Expected operand, found end of stream.", diagnostic->error); - - spvDiagnosticDestroy(diagnostic); - spvBinaryDestroy(binary); - spvContextDestroy(context); -} - -TEST(CInterface, SpecifyConsumerSpecifyDiagnosticForDisassembling) { - const char input_text[] = "OpNop"; - - auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); - int invocation = 0; - SetContextMessageConsumer( - context, - [&invocation](spv_message_level_t, const char*, const spv_position_t&, - const char*) { ++invocation; }); - - spv_binary binary = nullptr; - ASSERT_EQ(SPV_SUCCESS, spvTextToBinary(context, input_text, - sizeof(input_text), &binary, nullptr)); - // Change OpNop to an invalid (wordcount|opcode) word. - binary->code[binary->wordCount - 1] = 0xffffffff; - - spv_diagnostic diagnostic = nullptr; - spv_text text = nullptr; - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, - spvBinaryToText(context, binary->code, binary->wordCount, 0, &text, - &diagnostic)); - - EXPECT_EQ(0, invocation); // Consumer should not be invoked at all. - EXPECT_STREQ("Invalid opcode: 65535", diagnostic->error); - - spvTextDestroy(text); - spvDiagnosticDestroy(diagnostic); - spvBinaryDestroy(binary); - spvContextDestroy(context); -} - -TEST(CInterface, SpecifyConsumerSpecifyDiagnosticForValidating) { - const char input_text[] = "OpNop"; - - auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); - int invocation = 0; - SetContextMessageConsumer( - context, - [&invocation](spv_message_level_t, const char*, const spv_position_t&, - const char*) { ++invocation; }); - - spv_binary binary = nullptr; - ASSERT_EQ(SPV_SUCCESS, spvTextToBinary(context, input_text, - sizeof(input_text), &binary, nullptr)); - - spv_diagnostic diagnostic = nullptr; - spv_const_binary_t b{binary->code, binary->wordCount}; - EXPECT_EQ(SPV_ERROR_INVALID_LAYOUT, spvValidate(context, &b, &diagnostic)); - - EXPECT_EQ(0, invocation); // Consumer should not be invoked at all. - EXPECT_STREQ("Nop cannot appear before the memory model instruction", - diagnostic->error); - - spvDiagnosticDestroy(diagnostic); - spvBinaryDestroy(binary); - spvContextDestroy(context); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/test/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,187 +0,0 @@ -# Copyright (c) 2015-2016 The Khronos Group Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Add a SPIR-V Tools unit test. Signature: -# add_spvtools_unittest( -# TARGET target_name -# SRCS src_file.h src_file.cpp -# LIBS lib1 lib2 -# ) - -if (NOT "${SPIRV_SKIP_TESTS}") - if (TARGET gmock_main) - message(STATUS "Found Google Mock, building tests.") - else() - message(STATUS "Did not find googletest, tests will not be built." - "To enable tests place googletest in '/external/googletest'.") - endif() -endif() - -function(add_spvtools_unittest) - if (NOT "${SPIRV_SKIP_TESTS}" AND TARGET gmock_main) - set(one_value_args TARGET) - set(multi_value_args SRCS LIBS) - cmake_parse_arguments( - ARG "" "${one_value_args}" "${multi_value_args}" ${ARGN}) - set(target test_${ARG_TARGET}) - add_executable(${target} ${ARG_SRCS}) - spvtools_default_compile_options(${target}) - if(${COMPILER_IS_LIKE_GNU}) - target_compile_options(${target} PRIVATE -Wno-undef) - endif() - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") - # Disable C4503 "decorated name length exceeded" warning, - # triggered by some heavily templated types. - # We don't care much about that in test code. - # Important to do since we have warnings-as-errors. - target_compile_options(${target} PRIVATE /wd4503) - endif() - target_include_directories(${target} PRIVATE - ${SPIRV_HEADER_INCLUDE_DIR} - ${spirv-tools_SOURCE_DIR} - ${spirv-tools_SOURCE_DIR}/include - ${spirv-tools_SOURCE_DIR}/test - ${spirv-tools_BINARY_DIR} - ${gtest_SOURCE_DIR}/include - ${gmock_SOURCE_DIR}/include - ) - target_link_libraries(${target} PRIVATE ${ARG_LIBS}) - target_link_libraries(${target} PRIVATE gmock_main) - add_test(NAME spirv-tools-${target} COMMAND ${target}) - set_property(TARGET ${target} PROPERTY FOLDER "SPIRV-Tools tests") - endif() -endfunction() - -set(TEST_SOURCES - test_fixture.h - unit_spirv.h - - assembly_context_test.cpp - assembly_format_test.cpp - binary_destroy_test.cpp - binary_endianness_test.cpp - binary_header_get_test.cpp - binary_parse_test.cpp - binary_strnlen_s_test.cpp - binary_to_text_test.cpp - binary_to_text.literal_test.cpp - comment_test.cpp - enum_string_mapping_test.cpp - enum_set_test.cpp - ext_inst.glsl_test.cpp - ext_inst.opencl_test.cpp - fix_word_test.cpp - generator_magic_number_test.cpp - hex_float_test.cpp - immediate_int_test.cpp - libspirv_macros_test.cpp - named_id_test.cpp - name_mapper_test.cpp - opcode_make_test.cpp - opcode_require_capabilities_test.cpp - opcode_split_test.cpp - opcode_table_get_test.cpp - operand_capabilities_test.cpp - operand_test.cpp - operand_pattern_test.cpp - software_version_test.cpp - target_env_test.cpp - text_advance_test.cpp - text_destroy_test.cpp - text_literal_test.cpp - text_start_new_inst_test.cpp - text_to_binary.annotation_test.cpp - text_to_binary.barrier_test.cpp - text_to_binary.constant_test.cpp - text_to_binary.control_flow_test.cpp - text_to_binary_test.cpp - text_to_binary.debug_test.cpp - text_to_binary.device_side_enqueue_test.cpp - text_to_binary.extension_test.cpp - text_to_binary.function_test.cpp - text_to_binary.group_test.cpp - text_to_binary.image_test.cpp - text_to_binary.literal_test.cpp - text_to_binary.memory_test.cpp - text_to_binary.misc_test.cpp - text_to_binary.mode_setting_test.cpp - text_to_binary.pipe_storage_test.cpp - text_to_binary.type_declaration_test.cpp - text_to_binary.subgroup_dispatch_test.cpp - text_word_get_test.cpp - - unit_spirv.cpp -) - -add_spvtools_unittest( - TARGET spirv_unit_tests - SRCS ${TEST_SOURCES} - LIBS ${SPIRV_TOOLS}) - -add_spvtools_unittest( - TARGET diagnostic - SRCS diagnostic_test.cpp - LIBS ${SPIRV_TOOLS}) - -add_spvtools_unittest( - TARGET c_interface - SRCS c_interface_test.cpp - LIBS ${SPIRV_TOOLS}) - -add_spvtools_unittest( - TARGET cpp_interface - SRCS cpp_interface_test.cpp - LIBS SPIRV-Tools-opt) - -add_spvtools_unittest( - TARGET parse_number - SRCS parse_number_test.cpp - LIBS ${SPIRV_TOOLS}) - -add_spvtools_unittest( - TARGET string_utils - SRCS string_utils_test.cpp - LIBS ${SPIRV_TOOLS}) - -add_spvtools_unittest( - TARGET log - SRCS log_test.cpp - LIBS ${SPIRV_TOOLS}) - -add_spvtools_unittest( - TARGET preserve_numeric_ids - SRCS preserve_numeric_ids_test.cpp - LIBS ${SPIRV_TOOLS}) - -add_spvtools_unittest( - TARGET bit_stream - SRCS bit_stream.cpp - LIBS ${SPIRV_TOOLS}) - -add_spvtools_unittest( - TARGET huffman_codec - SRCS huffman_codec.cpp - LIBS ${SPIRV_TOOLS}) - -add_spvtools_unittest( - TARGET move_to_front - SRCS move_to_front_test.cpp - LIBS ${SPIRV_TOOLS}) - -add_subdirectory(comp) -add_subdirectory(link) -add_subdirectory(opt) -add_subdirectory(stats) -add_subdirectory(util) -add_subdirectory(val) diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/comment_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/comment_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/comment_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/comment_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "gmock/gmock.h" -#include "test_fixture.h" -#include "unit_spirv.h" - -namespace { - -using spvtest::Concatenate; -using spvtest::MakeInstruction; -using spvtest::MakeVector; -using spvtest::TextToBinaryTest; -using testing::Eq; - -TEST_F(TextToBinaryTest, Whitespace) { - std::string input = R"( -; I'm a proud comment at the beginning of the file -; I hide: OpCapability Shader - OpMemoryModel Logical Simple ; comment after instruction -;;;;;;;; many ;'s - %glsl450 = OpExtInstImport "GLSL.std.450" - ; comment indented -)"; - - EXPECT_THAT( - CompiledInstructions(input), - Eq(Concatenate({MakeInstruction(SpvOpMemoryModel, - {uint32_t(SpvAddressingModelLogical), - uint32_t(SpvMemoryModelSimple)}), - MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("GLSL.std.450"))}))); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/comp/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/test/comp/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/comp/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/comp/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -# Copyright (c) 2017 Google 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. - -set(VAL_TEST_COMMON_SRCS - ${CMAKE_CURRENT_SOURCE_DIR}/../test_fixture.h - ${CMAKE_CURRENT_SOURCE_DIR}/../unit_spirv.h -) - -if(SPIRV_BUILD_COMPRESSION) - add_spvtools_unittest(TARGET markv_codec - SRCS - markv_codec_test.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/../../tools/comp/markv_model_factory.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/../../tools/comp/markv_model_shader_default.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS SPIRV-Tools-comp ${SPIRV_TOOLS} - ) -endif(SPIRV_BUILD_COMPRESSION) diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/comp/markv_codec_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/comp/markv_codec_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/comp/markv_codec_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/comp/markv_codec_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,812 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Tests for unique type declaration rules validator. - -#include -#include -#include - -#include "gmock/gmock.h" -#include "source/comp/markv.h" -#include "test_fixture.h" -#include "tools/comp/markv_model_factory.h" -#include "unit_spirv.h" - -namespace { - -using spvtest::ScopedContext; - -void DiagnosticsMessageHandler(spv_message_level_t level, const char*, - const spv_position_t& position, - const char* message) { - switch (level) { - case SPV_MSG_FATAL: - case SPV_MSG_INTERNAL_ERROR: - case SPV_MSG_ERROR: - std::cerr << "error: " << position.index << ": " << message - << std::endl; - break; - case SPV_MSG_WARNING: - std::cout << "warning: " << position.index << ": " << message - << std::endl; - break; - case SPV_MSG_INFO: - std::cout << "info: " << position.index << ": " << message << std::endl; - break; - default: - break; - } -} - -// Compiles |code| to SPIR-V |words|. -void Compile(const std::string& code, std::vector* words, - uint32_t options = SPV_TEXT_TO_BINARY_OPTION_NONE, - spv_target_env env = SPV_ENV_UNIVERSAL_1_2) { - ScopedContext ctx(env); - SetContextMessageConsumer(ctx.context, DiagnosticsMessageHandler); - - spv_binary spirv_binary; - ASSERT_EQ(SPV_SUCCESS, spvTextToBinaryWithOptions( - ctx.context, code.c_str(), code.size(), options, &spirv_binary, nullptr)); - - *words = std::vector( - spirv_binary->code, spirv_binary->code + spirv_binary->wordCount); - - spvBinaryDestroy(spirv_binary); -} - -// Disassembles SPIR-V |words| to |out_text|. -void Disassemble(const std::vector& words, - std::string* out_text, - spv_target_env env = SPV_ENV_UNIVERSAL_1_2) { - ScopedContext ctx(env); - SetContextMessageConsumer(ctx.context, DiagnosticsMessageHandler); - - spv_text text = nullptr; - ASSERT_EQ(SPV_SUCCESS, spvBinaryToText(ctx.context, words.data(), - words.size(), 0, &text, nullptr)); - assert(text); - - *out_text = std::string(text->str, text->length); - spvTextDestroy(text); -} - -// Encodes/decodes |original|, assembles/dissasembles |original|, then compares -// the results of the two operations. -void TestEncodeDecode(const std::string& original_text) { - ScopedContext ctx(SPV_ENV_UNIVERSAL_1_2); - std::unique_ptr model = - spvtools::CreateMarkvModel(spvtools::kMarkvModelShaderDefault); - spvtools::MarkvEncoderOptions encoder_options; - spvtools::MarkvDecoderOptions decoder_options; - - std::vector expected_binary; - Compile(original_text, &expected_binary); - ASSERT_FALSE(expected_binary.empty()); - - std::string expected_text; - Disassemble(expected_binary, &expected_text); - ASSERT_FALSE(expected_text.empty()); - - std::vector binary_to_encode; - Compile(original_text, &binary_to_encode, - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - ASSERT_FALSE(binary_to_encode.empty()); - - std::vector markv; - std::string encoder_comments; - ASSERT_EQ(SPV_SUCCESS, spvtools::SpirvToMarkv( - ctx.context, binary_to_encode, encoder_options, *model, - DiagnosticsMessageHandler, &markv, &encoder_comments)); - ASSERT_FALSE(markv.empty()); - - std::vector decoded_binary; - ASSERT_EQ(SPV_SUCCESS, spvtools::MarkvToSpirv( - ctx.context, markv, decoder_options, *model, - DiagnosticsMessageHandler, &decoded_binary, nullptr)); - ASSERT_FALSE(decoded_binary.empty()); - - EXPECT_EQ(expected_binary, decoded_binary) << encoder_comments; - - std::string decoded_text; - Disassemble(decoded_binary, &decoded_text); - ASSERT_FALSE(decoded_text.empty()); - - EXPECT_EQ(expected_text, decoded_text) << encoder_comments; -} - -void TestEncodeDecodeShaderMainBody(const std::string& body) { - const std::string prefix = -R"( -OpCapability Shader -OpCapability Int64 -OpCapability Float64 -%ext_inst = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -%void = OpTypeVoid -%func = OpTypeFunction %void -%bool = OpTypeBool -%f32 = OpTypeFloat 32 -%u32 = OpTypeInt 32 0 -%s32 = OpTypeInt 32 1 -%f64 = OpTypeFloat 64 -%u64 = OpTypeInt 64 0 -%s64 = OpTypeInt 64 1 -%boolvec2 = OpTypeVector %bool 2 -%s32vec2 = OpTypeVector %s32 2 -%u32vec2 = OpTypeVector %u32 2 -%f32vec2 = OpTypeVector %f32 2 -%f64vec2 = OpTypeVector %f64 2 -%boolvec3 = OpTypeVector %bool 3 -%u32vec3 = OpTypeVector %u32 3 -%s32vec3 = OpTypeVector %s32 3 -%f32vec3 = OpTypeVector %f32 3 -%f64vec3 = OpTypeVector %f64 3 -%boolvec4 = OpTypeVector %bool 4 -%u32vec4 = OpTypeVector %u32 4 -%s32vec4 = OpTypeVector %s32 4 -%f32vec4 = OpTypeVector %f32 4 -%f64vec4 = OpTypeVector %f64 4 - -%f32_0 = OpConstant %f32 0 -%f32_1 = OpConstant %f32 1 -%f32_2 = OpConstant %f32 2 -%f32_3 = OpConstant %f32 3 -%f32_4 = OpConstant %f32 4 -%f32_pi = OpConstant %f32 3.14159 - -%s32_0 = OpConstant %s32 0 -%s32_1 = OpConstant %s32 1 -%s32_2 = OpConstant %s32 2 -%s32_3 = OpConstant %s32 3 -%s32_4 = OpConstant %s32 4 -%s32_m1 = OpConstant %s32 -1 - -%u32_0 = OpConstant %u32 0 -%u32_1 = OpConstant %u32 1 -%u32_2 = OpConstant %u32 2 -%u32_3 = OpConstant %u32 3 -%u32_4 = OpConstant %u32 4 - -%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 -%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 -%u32vec3_012 = OpConstantComposite %u32vec3 %u32_0 %u32_1 %u32_2 -%u32vec3_123 = OpConstantComposite %u32vec3 %u32_1 %u32_2 %u32_3 -%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 -%u32vec4_1234 = OpConstantComposite %u32vec4 %u32_1 %u32_2 %u32_3 %u32_4 - -%s32vec2_01 = OpConstantComposite %s32vec2 %s32_0 %s32_1 -%s32vec2_12 = OpConstantComposite %s32vec2 %s32_1 %s32_2 -%s32vec3_012 = OpConstantComposite %s32vec3 %s32_0 %s32_1 %s32_2 -%s32vec3_123 = OpConstantComposite %s32vec3 %s32_1 %s32_2 %s32_3 -%s32vec4_0123 = OpConstantComposite %s32vec4 %s32_0 %s32_1 %s32_2 %s32_3 -%s32vec4_1234 = OpConstantComposite %s32vec4 %s32_1 %s32_2 %s32_3 %s32_4 - -%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 -%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 -%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 -%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 -%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 -%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 - -%main = OpFunction %void None %func -%main_entry = OpLabel)"; - - const std::string suffix = -R"( -OpReturn -OpFunctionEnd)"; - - TestEncodeDecode(prefix + body + suffix); -} - -TEST(Markv, U32Literal) { - TestEncodeDecode(R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -%u32 = OpTypeInt 32 0 -%100 = OpConstant %u32 0 -%200 = OpConstant %u32 1 -%300 = OpConstant %u32 4294967295 -)"); -} - -TEST(Markv, S32Literal) { - TestEncodeDecode(R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -%s32 = OpTypeInt 32 1 -%100 = OpConstant %s32 0 -%200 = OpConstant %s32 1 -%300 = OpConstant %s32 -1 -%400 = OpConstant %s32 2147483647 -%500 = OpConstant %s32 -2147483648 -)"); -} - -TEST(Markv, U64Literal) { - TestEncodeDecode(R"( -OpCapability Shader -OpCapability Linkage -OpCapability Int64 -OpMemoryModel Logical GLSL450 -%u64 = OpTypeInt 64 0 -%100 = OpConstant %u64 0 -%200 = OpConstant %u64 1 -%300 = OpConstant %u64 18446744073709551615 -)"); -} - -TEST(Markv, S64Literal) { - TestEncodeDecode(R"( -OpCapability Shader -OpCapability Linkage -OpCapability Int64 -OpMemoryModel Logical GLSL450 -%s64 = OpTypeInt 64 1 -%100 = OpConstant %s64 0 -%200 = OpConstant %s64 1 -%300 = OpConstant %s64 -1 -%400 = OpConstant %s64 9223372036854775807 -%500 = OpConstant %s64 -9223372036854775808 -)"); -} - -TEST(Markv, U16Literal) { - TestEncodeDecode(R"( -OpCapability Shader -OpCapability Linkage -OpCapability Int16 -OpMemoryModel Logical GLSL450 -%u16 = OpTypeInt 16 0 -%100 = OpConstant %u16 0 -%200 = OpConstant %u16 1 -%300 = OpConstant %u16 65535 -)"); -} - -TEST(Markv, S16Literal) { - TestEncodeDecode(R"( -OpCapability Shader -OpCapability Linkage -OpCapability Int16 -OpMemoryModel Logical GLSL450 -%s16 = OpTypeInt 16 1 -%100 = OpConstant %s16 0 -%200 = OpConstant %s16 1 -%300 = OpConstant %s16 -1 -%400 = OpConstant %s16 32767 -%500 = OpConstant %s16 -32768 -)"); -} - -TEST(Markv, F32Literal) { - TestEncodeDecode(R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -%f32 = OpTypeFloat 32 -%100 = OpConstant %f32 0 -%200 = OpConstant %f32 1 -%300 = OpConstant %f32 0.1 -%400 = OpConstant %f32 -0.1 -)"); -} - -TEST(Markv, F64Literal) { - TestEncodeDecode(R"( -OpCapability Shader -OpCapability Linkage -OpCapability Float64 -OpMemoryModel Logical GLSL450 -%f64 = OpTypeFloat 64 -%100 = OpConstant %f64 0 -%200 = OpConstant %f64 1 -%300 = OpConstant %f64 0.1 -%400 = OpConstant %f64 -0.1 -)"); -} - -TEST(Markv, F16Literal) { - TestEncodeDecode(R"( -OpCapability Shader -OpCapability Linkage -OpCapability Float16 -OpMemoryModel Logical GLSL450 -%f16 = OpTypeFloat 16 -%100 = OpConstant %f16 0 -%200 = OpConstant %f16 1 -%300 = OpConstant %f16 0.1 -%400 = OpConstant %f16 -0.1 -)"); -} - -TEST(Markv, StringLiteral) { - TestEncodeDecode(R"( -OpCapability Shader -OpCapability Linkage -OpExtension "SPV_KHR_16bit_storage" -OpExtension "xxx" -OpExtension "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -OpExtension "" -OpMemoryModel Logical GLSL450 -)"); -} - -TEST(Markv, WithFunction) { - TestEncodeDecode(R"( -OpCapability Addresses -OpCapability Kernel -OpCapability GenericPointer -OpCapability Linkage -OpExtension "SPV_KHR_16bit_storage" -OpMemoryModel Physical32 OpenCL -%f32 = OpTypeFloat 32 -%u32 = OpTypeInt 32 0 -%void = OpTypeVoid -%void_func = OpTypeFunction %void -%100 = OpConstant %u32 1 -%200 = OpConstant %u32 2 -%main = OpFunction %void None %void_func -%entry_main = OpLabel -%300 = OpIAdd %u32 %100 %200 -OpReturn -OpFunctionEnd -)"); -} - -TEST(Markv, WithMultipleFunctions) { - TestEncodeDecode(R"( -OpCapability Addresses -OpCapability Kernel -OpCapability GenericPointer -OpCapability Linkage -OpMemoryModel Physical32 OpenCL -%f32 = OpTypeFloat 32 -%one = OpConstant %f32 1 -%void = OpTypeVoid -%void_func = OpTypeFunction %void -%f32_func = OpTypeFunction %f32 %f32 -%sqr_plus_one = OpFunction %f32 None %f32_func -%x = OpFunctionParameter %f32 -%100 = OpLabel -%x2 = OpFMul %f32 %x %x -%x2p1 = OpFunctionCall %f32 %plus_one %x2 -OpReturnValue %x2p1 -OpFunctionEnd -%plus_one = OpFunction %f32 None %f32_func -%y = OpFunctionParameter %f32 -%200 = OpLabel -%yp1 = OpFAdd %f32 %y %one -OpReturnValue %yp1 -OpFunctionEnd -%main = OpFunction %void None %void_func -%entry_main = OpLabel -%1p1 = OpFunctionCall %f32 %sqr_plus_one %one -OpReturn -OpFunctionEnd -)"); -} - -TEST(Markv, ForwardDeclaredId) { - TestEncodeDecode(R"( -OpCapability Addresses -OpCapability Kernel -OpCapability GenericPointer -OpCapability Linkage -OpMemoryModel Physical32 OpenCL -OpEntryPoint Kernel %1 "simple_kernel" -%2 = OpTypeInt 32 0 -%3 = OpTypeVector %2 2 -%4 = OpConstant %2 2 -%5 = OpTypeArray %2 %4 -%6 = OpTypeVoid -%7 = OpTypeFunction %6 -%1 = OpFunction %6 None %7 -%8 = OpLabel -OpReturn -OpFunctionEnd -)"); -} - -TEST(Markv, WithSwitch) { - TestEncodeDecode(R"( -OpCapability Addresses -OpCapability Kernel -OpCapability GenericPointer -OpCapability Linkage -OpCapability Int64 -OpMemoryModel Physical32 OpenCL -%u64 = OpTypeInt 64 0 -%void = OpTypeVoid -%void_func = OpTypeFunction %void -%val = OpConstant %u64 1 -%main = OpFunction %void None %void_func -%entry_main = OpLabel -OpSwitch %val %default 1 %case1 1000000000000 %case2 -%case1 = OpLabel -OpNop -OpBranch %after_switch -%case2 = OpLabel -OpNop -OpBranch %after_switch -%default = OpLabel -OpNop -OpBranch %after_switch -%after_switch = OpLabel -OpReturn -OpFunctionEnd -)"); -} - -TEST(Markv, WithLoop) { - TestEncodeDecode(R"( -OpCapability Addresses -OpCapability Kernel -OpCapability GenericPointer -OpCapability Linkage -OpMemoryModel Physical32 OpenCL -%void = OpTypeVoid -%void_func = OpTypeFunction %void -%main = OpFunction %void None %void_func -%entry_main = OpLabel -OpLoopMerge %merge %continue DontUnroll|DependencyLength 10 -OpBranch %begin_loop -%begin_loop = OpLabel -OpNop -OpBranch %continue -%continue = OpLabel -OpNop -OpBranch %begin_loop -%merge = OpLabel -OpReturn -OpFunctionEnd -)"); -} - -TEST(Markv, WithDecorate) { - TestEncodeDecode(R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -OpDecorate %1 ArrayStride 4 -OpDecorate %1 Uniform -%2 = OpTypeFloat 32 -%1 = OpTypeRuntimeArray %2 -)"); -} - -TEST(Markv, WithExtInst) { - TestEncodeDecode(R"( -OpCapability Addresses -OpCapability Kernel -OpCapability GenericPointer -OpCapability Linkage -%opencl = OpExtInstImport "OpenCL.std" -OpMemoryModel Physical32 OpenCL -%f32 = OpTypeFloat 32 -%void = OpTypeVoid -%void_func = OpTypeFunction %void -%100 = OpConstant %f32 1.1 -%main = OpFunction %void None %void_func -%entry_main = OpLabel -%200 = OpExtInst %f32 %opencl cos %100 -OpReturn -OpFunctionEnd -)"); -} - -TEST(Markv, F32Mul) { - TestEncodeDecodeShaderMainBody(R"( -%val1 = OpFMul %f32 %f32_0 %f32_1 -%val2 = OpFMul %f32 %f32_2 %f32_0 -%val3 = OpFMul %f32 %f32_pi %f32_2 -%val4 = OpFMul %f32 %f32_1 %f32_1 -)"); -} - -TEST(Markv, U32Mul) { - TestEncodeDecodeShaderMainBody(R"( -%val1 = OpIMul %u32 %u32_0 %u32_1 -%val2 = OpIMul %u32 %u32_2 %u32_0 -%val3 = OpIMul %u32 %u32_3 %u32_2 -%val4 = OpIMul %u32 %u32_1 %u32_1 -)"); -} - -TEST(Markv, S32Mul) { - TestEncodeDecodeShaderMainBody(R"( -%val1 = OpIMul %s32 %s32_0 %s32_1 -%val2 = OpIMul %s32 %s32_2 %s32_0 -%val3 = OpIMul %s32 %s32_m1 %s32_2 -%val4 = OpIMul %s32 %s32_1 %s32_1 -)"); -} - -TEST(Markv, F32Add) { - TestEncodeDecodeShaderMainBody(R"( -%val1 = OpFAdd %f32 %f32_0 %f32_1 -%val2 = OpFAdd %f32 %f32_2 %f32_0 -%val3 = OpFAdd %f32 %f32_pi %f32_2 -%val4 = OpFAdd %f32 %f32_1 %f32_1 -)"); -} - -TEST(Markv, U32Add) { - TestEncodeDecodeShaderMainBody(R"( -%val1 = OpIAdd %u32 %u32_0 %u32_1 -%val2 = OpIAdd %u32 %u32_2 %u32_0 -%val3 = OpIAdd %u32 %u32_3 %u32_2 -%val4 = OpIAdd %u32 %u32_1 %u32_1 -)"); -} - -TEST(Markv, S32Add) { - TestEncodeDecodeShaderMainBody(R"( -%val1 = OpIAdd %s32 %s32_0 %s32_1 -%val2 = OpIAdd %s32 %s32_2 %s32_0 -%val3 = OpIAdd %s32 %s32_m1 %s32_2 -%val4 = OpIAdd %s32 %s32_1 %s32_1 -)"); -} - -TEST(Markv, F32Dot) { - TestEncodeDecodeShaderMainBody(R"( -%dot2_1 = OpDot %f32 %f32vec2_01 %f32vec2_12 -%dot2_2 = OpDot %f32 %f32vec2_01 %f32vec2_01 -%dot2_3 = OpDot %f32 %f32vec2_12 %f32vec2_12 -%dot3_1 = OpDot %f32 %f32vec3_012 %f32vec3_123 -%dot3_2 = OpDot %f32 %f32vec3_012 %f32vec3_012 -%dot3_3 = OpDot %f32 %f32vec3_123 %f32vec3_123 -%dot4_1 = OpDot %f32 %f32vec4_0123 %f32vec4_1234 -%dot4_2 = OpDot %f32 %f32vec4_0123 %f32vec4_0123 -%dot4_3 = OpDot %f32 %f32vec4_1234 %f32vec4_1234 -)"); -} - -TEST(Markv, F32VectorCompositeConstruct) { - TestEncodeDecodeShaderMainBody(R"( -%cc1 = OpCompositeConstruct %f32vec4 %f32vec2_01 %f32vec2_12 -%cc2 = OpCompositeConstruct %f32vec3 %f32vec2_01 %f32_2 -%cc3 = OpCompositeConstruct %f32vec2 %f32_1 %f32_2 -%cc4 = OpCompositeConstruct %f32vec4 %f32_1 %f32_2 %cc3 -)"); -} - -TEST(Markv, U32VectorCompositeConstruct) { - TestEncodeDecodeShaderMainBody(R"( -%cc1 = OpCompositeConstruct %u32vec4 %u32vec2_01 %u32vec2_12 -%cc2 = OpCompositeConstruct %u32vec3 %u32vec2_01 %u32_2 -%cc3 = OpCompositeConstruct %u32vec2 %u32_1 %u32_2 -%cc4 = OpCompositeConstruct %u32vec4 %u32_1 %u32_2 %cc3 -)"); -} - -TEST(Markv, S32VectorCompositeConstruct) { - TestEncodeDecodeShaderMainBody(R"( -%cc1 = OpCompositeConstruct %u32vec4 %u32vec2_01 %u32vec2_12 -%cc2 = OpCompositeConstruct %u32vec3 %u32vec2_01 %u32_2 -%cc3 = OpCompositeConstruct %u32vec2 %u32_1 %u32_2 -%cc4 = OpCompositeConstruct %u32vec4 %u32_1 %u32_2 %cc3 -)"); -} - -TEST(Markv, F32VectorCompositeExtract) { - TestEncodeDecodeShaderMainBody(R"( -%f32vec4_3210 = OpCompositeConstruct %f32vec4 %f32_3 %f32_2 %f32_1 %f32_0 -%f32vec3_013 = OpCompositeExtract %f32vec3 %f32vec4_0123 0 1 3 -)"); -} - -TEST(Markv, F32VectorComparison) { - TestEncodeDecodeShaderMainBody(R"( -%f32vec4_3210 = OpCompositeConstruct %f32vec4 %f32_3 %f32_2 %f32_1 %f32_0 -%c1 = OpFOrdEqual %boolvec4 %f32vec4_0123 %f32vec4_3210 -%c2 = OpFUnordEqual %boolvec4 %f32vec4_0123 %f32vec4_3210 -%c3 = OpFOrdNotEqual %boolvec4 %f32vec4_0123 %f32vec4_3210 -%c4 = OpFUnordNotEqual %boolvec4 %f32vec4_0123 %f32vec4_3210 -%c5 = OpFOrdLessThan %boolvec4 %f32vec4_0123 %f32vec4_3210 -%c6 = OpFUnordLessThan %boolvec4 %f32vec4_0123 %f32vec4_3210 -%c7 = OpFOrdGreaterThan %boolvec4 %f32vec4_0123 %f32vec4_3210 -%c8 = OpFUnordGreaterThan %boolvec4 %f32vec4_0123 %f32vec4_3210 -%c9 = OpFOrdLessThanEqual %boolvec4 %f32vec4_0123 %f32vec4_3210 -%c10 = OpFUnordLessThanEqual %boolvec4 %f32vec4_0123 %f32vec4_3210 -%c11 = OpFOrdGreaterThanEqual %boolvec4 %f32vec4_0123 %f32vec4_3210 -%c12 = OpFUnordGreaterThanEqual %boolvec4 %f32vec4_0123 %f32vec4_3210 -)"); -} - -TEST(Markv, VectorShuffle) { - TestEncodeDecodeShaderMainBody(R"( -%f32vec4_3210 = OpCompositeConstruct %f32vec4 %f32_3 %f32_2 %f32_1 %f32_0 -%sh1 = OpVectorShuffle %f32vec2 %f32vec4_0123 %f32vec4_3210 3 6 -%sh2 = OpVectorShuffle %f32vec3 %f32vec2_01 %f32vec4_3210 0 3 4 -)"); -} - -TEST(Markv, VectorTimesScalar) { - TestEncodeDecodeShaderMainBody(R"( -%f32vec4_3210 = OpCompositeConstruct %f32vec4 %f32_3 %f32_2 %f32_1 %f32_0 -%res1 = OpVectorTimesScalar %f32vec4 %f32vec4_0123 %f32_2 -%res2 = OpVectorTimesScalar %f32vec4 %f32vec4_3210 %f32_2 -)"); -} - -TEST(Markv, SpirvSpecSample) { - TestEncodeDecode(R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %4 "main" %31 %33 %42 %57 - OpExecutionMode %4 OriginLowerLeft - -; Debug information - OpSource GLSL 450 - OpName %4 "main" - OpName %9 "scale" - OpName %17 "S" - OpMemberName %17 0 "b" - OpMemberName %17 1 "v" - OpMemberName %17 2 "i" - OpName %18 "blockName" - OpMemberName %18 0 "s" - OpMemberName %18 1 "cond" - OpName %20 "" - OpName %31 "color" - OpName %33 "color1" - OpName %42 "color2" - OpName %48 "i" - OpName %57 "multiplier" - -; Annotations (non-debug) - OpDecorate %15 ArrayStride 16 - OpMemberDecorate %17 0 Offset 0 - OpMemberDecorate %17 1 Offset 16 - OpMemberDecorate %17 2 Offset 96 - OpMemberDecorate %18 0 Offset 0 - OpMemberDecorate %18 1 Offset 112 - OpDecorate %18 Block - OpDecorate %20 DescriptorSet 0 - OpDecorate %42 NoPerspective - -; All types, variables, and constants - %2 = OpTypeVoid - %3 = OpTypeFunction %2 ; void () - %6 = OpTypeFloat 32 ; 32-bit float - %7 = OpTypeVector %6 4 ; vec4 - %8 = OpTypePointer Function %7 ; function-local vec4* - %10 = OpConstant %6 1 - %11 = OpConstant %6 2 - %12 = OpConstantComposite %7 %10 %10 %11 %10 ; vec4(1.0, 1.0, 2.0, 1.0) - %13 = OpTypeInt 32 0 ; 32-bit int, sign-less - %14 = OpConstant %13 5 - %15 = OpTypeArray %7 %14 - %16 = OpTypeInt 32 1 - %17 = OpTypeStruct %13 %15 %16 - %18 = OpTypeStruct %17 %13 - %19 = OpTypePointer Uniform %18 - %20 = OpVariable %19 Uniform - %21 = OpConstant %16 1 - %22 = OpTypePointer Uniform %13 - %25 = OpTypeBool - %26 = OpConstant %13 0 - %30 = OpTypePointer Output %7 - %31 = OpVariable %30 Output - %32 = OpTypePointer Input %7 - %33 = OpVariable %32 Input - %35 = OpConstant %16 0 - %36 = OpConstant %16 2 - %37 = OpTypePointer Uniform %7 - %42 = OpVariable %32 Input - %47 = OpTypePointer Function %16 - %55 = OpConstant %16 4 - %57 = OpVariable %32 Input - -; All functions - %4 = OpFunction %2 None %3 ; main() - %5 = OpLabel - %9 = OpVariable %8 Function - %48 = OpVariable %47 Function - OpStore %9 %12 - %23 = OpAccessChain %22 %20 %21 ; location of cond - %24 = OpLoad %13 %23 ; load 32-bit int from cond - %27 = OpINotEqual %25 %24 %26 ; convert to bool - OpSelectionMerge %29 None ; structured if - OpBranchConditional %27 %28 %41 ; if cond - %28 = OpLabel ; then - %34 = OpLoad %7 %33 - %38 = OpAccessChain %37 %20 %35 %21 %36 ; s.v[2] - %39 = OpLoad %7 %38 - %40 = OpFAdd %7 %34 %39 - OpStore %31 %40 - OpBranch %29 - %41 = OpLabel ; else - %43 = OpLoad %7 %42 - %44 = OpExtInst %7 %1 Sqrt %43 ; extended instruction sqrt - %45 = OpLoad %7 %9 - %46 = OpFMul %7 %44 %45 - OpStore %31 %46 - OpBranch %29 - %29 = OpLabel ; endif - OpStore %48 %35 - OpBranch %49 - %49 = OpLabel - OpLoopMerge %51 %52 None ; structured loop - OpBranch %53 - %53 = OpLabel - %54 = OpLoad %16 %48 - %56 = OpSLessThan %25 %54 %55 ; i < 4 ? - OpBranchConditional %56 %50 %51 ; body or break - %50 = OpLabel ; body - %58 = OpLoad %7 %57 - %59 = OpLoad %7 %31 - %60 = OpFMul %7 %59 %58 - OpStore %31 %60 - OpBranch %52 - %52 = OpLabel ; continue target - %61 = OpLoad %16 %48 - %62 = OpIAdd %16 %61 %21 ; ++i - OpStore %48 %62 - OpBranch %49 ; loop back - %51 = OpLabel ; loop merge point - OpReturn - OpFunctionEnd -)"); -} - -TEST(Markv, SampleFromDeadBranchEliminationTest) { - TestEncodeDecode(R"( -OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%5 = OpTypeFunction %void -%bool = OpTypeBool -%true = OpConstantTrue %bool -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%float_0 = OpConstant %float 0 -%12 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 -%float_1 = OpConstant %float 1 -%14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%_ptr_Input_v4float = OpTypePointer Input %v4float -%main = OpFunction %void None %5 -%17 = OpLabel -OpSelectionMerge %18 None -OpBranchConditional %true %19 %20 -%19 = OpLabel -OpBranch %18 -%20 = OpLabel -OpBranch %18 -%18 = OpLabel -%21 = OpPhi %v4float %12 %19 %14 %20 -OpStore %gl_FragColor %21 -OpReturn -OpFunctionEnd -)"); -} - -} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/cpp_interface_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/cpp_interface_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/cpp_interface_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/cpp_interface_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,365 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include -#include - -#include "spirv-tools/optimizer.hpp" -#include "spirv/1.1/spirv.h" - -namespace { - -using namespace spvtools; -using ::testing::ContainerEq; -using ::testing::HasSubstr; - -TEST(CppInterface, SuccessfulRoundTrip) { - const std::string input_text = "%2 = OpSizeOf %1 %3\n"; - SpirvTools t(SPV_ENV_UNIVERSAL_1_1); - - std::vector binary; - EXPECT_TRUE(t.Assemble(input_text, &binary)); - EXPECT_TRUE(binary.size() > 5u); - EXPECT_EQ(SpvMagicNumber, binary[0]); - EXPECT_EQ(SpvVersion, binary[1]); - - // This cannot pass validation since %1 is not defined. - t.SetMessageConsumer([](spv_message_level_t level, const char* source, - const spv_position_t& position, const char* message) { - EXPECT_EQ(SPV_MSG_ERROR, level); - EXPECT_STREQ("input", source); - EXPECT_EQ(0u, position.line); - EXPECT_EQ(0u, position.column); - EXPECT_EQ(1u, position.index); - EXPECT_STREQ("ID 1 has not been defined", message); - }); - EXPECT_FALSE(t.Validate(binary)); - - std::string output_text; - EXPECT_TRUE(t.Disassemble(binary, &output_text)); - EXPECT_EQ(input_text, output_text); -} - -TEST(CppInterface, AssembleEmptyModule) { - std::vector binary(10, 42); - SpirvTools t(SPV_ENV_UNIVERSAL_1_1); - EXPECT_TRUE(t.Assemble("", &binary)); - // We only have the header. - EXPECT_EQ(5u, binary.size()); - EXPECT_EQ(SpvMagicNumber, binary[0]); - EXPECT_EQ(SpvVersion, binary[1]); -} - -TEST(CppInterface, AssembleOverloads) { - const std::string input_text = "%2 = OpSizeOf %1 %3\n"; - SpirvTools t(SPV_ENV_UNIVERSAL_1_1); - { - std::vector binary; - EXPECT_TRUE(t.Assemble(input_text, &binary)); - EXPECT_TRUE(binary.size() > 5u); - EXPECT_EQ(SpvMagicNumber, binary[0]); - EXPECT_EQ(SpvVersion, binary[1]); - } - { - std::vector binary; - EXPECT_TRUE(t.Assemble(input_text.data(), input_text.size(), &binary)); - EXPECT_TRUE(binary.size() > 5u); - EXPECT_EQ(SpvMagicNumber, binary[0]); - EXPECT_EQ(SpvVersion, binary[1]); - } - { // Ignore the last newline. - std::vector binary; - EXPECT_TRUE(t.Assemble(input_text.data(), input_text.size() - 1, &binary)); - EXPECT_TRUE(binary.size() > 5u); - EXPECT_EQ(SpvMagicNumber, binary[0]); - EXPECT_EQ(SpvVersion, binary[1]); - } -} - -TEST(CppInterface, AssembleWithWrongTargetEnv) { - const std::string input_text = "%r = OpSizeOf %type %pointer"; - SpirvTools t(SPV_ENV_UNIVERSAL_1_0); - int invocation_count = 0; - t.SetMessageConsumer( - [&invocation_count](spv_message_level_t level, const char* source, - const spv_position_t& position, const char* message) { - ++invocation_count; - EXPECT_EQ(SPV_MSG_ERROR, level); - EXPECT_STREQ("input", source); - EXPECT_EQ(0u, position.line); - EXPECT_EQ(5u, position.column); - EXPECT_EQ(5u, position.index); - EXPECT_STREQ("Invalid Opcode name 'OpSizeOf'", message); - }); - - std::vector binary = {42, 42}; - EXPECT_FALSE(t.Assemble(input_text, &binary)); - EXPECT_THAT(binary, ContainerEq(std::vector{42, 42})); - EXPECT_EQ(1, invocation_count); -} - -TEST(CppInterface, DisassembleEmptyModule) { - std::string text(10, 'x'); - SpirvTools t(SPV_ENV_UNIVERSAL_1_1); - int invocation_count = 0; - t.SetMessageConsumer( - [&invocation_count](spv_message_level_t level, const char* source, - const spv_position_t& position, const char* message) { - ++invocation_count; - EXPECT_EQ(SPV_MSG_ERROR, level); - EXPECT_STREQ("input", source); - EXPECT_EQ(0u, position.line); - EXPECT_EQ(0u, position.column); - EXPECT_EQ(0u, position.index); - EXPECT_STREQ("Missing module.", message); - }); - EXPECT_FALSE(t.Disassemble({}, &text)); - EXPECT_EQ("xxxxxxxxxx", text); // The original string is unmodified. - EXPECT_EQ(1, invocation_count); -} - -TEST(CppInterface, DisassembleOverloads) { - const std::string input_text = "%2 = OpSizeOf %1 %3\n"; - SpirvTools t(SPV_ENV_UNIVERSAL_1_1); - - std::vector binary; - EXPECT_TRUE(t.Assemble(input_text, &binary)); - - { - std::string output_text; - EXPECT_TRUE(t.Disassemble(binary, &output_text)); - EXPECT_EQ(input_text, output_text); - } - { - std::string output_text; - EXPECT_TRUE(t.Disassemble(binary.data(), binary.size(), &output_text)); - EXPECT_EQ(input_text, output_text); - } -} - -TEST(CppInterface, DisassembleWithWrongTargetEnv) { - const std::string input_text = "%r = OpSizeOf %type %pointer"; - SpirvTools t11(SPV_ENV_UNIVERSAL_1_1); - SpirvTools t10(SPV_ENV_UNIVERSAL_1_0); - int invocation_count = 0; - t10.SetMessageConsumer( - [&invocation_count](spv_message_level_t level, const char* source, - const spv_position_t& position, const char* message) { - ++invocation_count; - EXPECT_EQ(SPV_MSG_ERROR, level); - EXPECT_STREQ("input", source); - EXPECT_EQ(0u, position.line); - EXPECT_EQ(0u, position.column); - EXPECT_EQ(5u, position.index); - EXPECT_STREQ("Invalid opcode: 321", message); - }); - - std::vector binary; - EXPECT_TRUE(t11.Assemble(input_text, &binary)); - - std::string output_text(10, 'x'); - EXPECT_FALSE(t10.Disassemble(binary, &output_text)); - EXPECT_EQ("xxxxxxxxxx", output_text); // The original string is unmodified. -} - -TEST(CppInterface, SuccessfulValidation) { - const std::string input_text = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450)"; - SpirvTools t(SPV_ENV_UNIVERSAL_1_1); - int invocation_count = 0; - t.SetMessageConsumer([&invocation_count](spv_message_level_t, const char*, - const spv_position_t&, const char*) { - ++invocation_count; - }); - - std::vector binary; - EXPECT_TRUE(t.Assemble(input_text, &binary)); - EXPECT_TRUE(t.Validate(binary)); - EXPECT_EQ(0, invocation_count); -} - -TEST(CppInterface, ValidateOverloads) { - const std::string input_text = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450)"; - SpirvTools t(SPV_ENV_UNIVERSAL_1_1); - std::vector binary; - EXPECT_TRUE(t.Assemble(input_text, &binary)); - - { EXPECT_TRUE(t.Validate(binary)); } - { EXPECT_TRUE(t.Validate(binary.data(), binary.size())); } -} - -TEST(CppInterface, ValidateEmptyModule) { - SpirvTools t(SPV_ENV_UNIVERSAL_1_1); - int invocation_count = 0; - t.SetMessageConsumer( - [&invocation_count](spv_message_level_t level, const char* source, - const spv_position_t& position, const char* message) { - ++invocation_count; - EXPECT_EQ(SPV_MSG_ERROR, level); - EXPECT_STREQ("input", source); - EXPECT_EQ(0u, position.line); - EXPECT_EQ(0u, position.column); - EXPECT_EQ(0u, position.index); - EXPECT_STREQ("Invalid SPIR-V magic number.", message); - }); - EXPECT_FALSE(t.Validate({})); - EXPECT_EQ(1, invocation_count); -} - -// Returns the assembly for a SPIR-V module with a struct declaration -// with the given number of members. -std::string MakeModuleHavingStruct(int num_members) { - std::stringstream os; - os << R"(OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - %1 = OpTypeInt 32 0 - %2 = OpTypeStruct)"; - for (int i = 0; i < num_members; i++) os << " %1"; - return os.str(); -} - -TEST(CppInterface, ValidateWithOptionsPass) { - SpirvTools t(SPV_ENV_UNIVERSAL_1_1); - std::vector binary; - EXPECT_TRUE(t.Assemble(MakeModuleHavingStruct(10), &binary)); - const spvtools::ValidatorOptions opts; - - EXPECT_TRUE(t.Validate(binary.data(), binary.size(), opts)); -} - -TEST(CppInterface, ValidateWithOptionsFail) { - SpirvTools t(SPV_ENV_UNIVERSAL_1_1); - std::vector binary; - EXPECT_TRUE(t.Assemble(MakeModuleHavingStruct(10), &binary)); - spvtools::ValidatorOptions opts; - opts.SetUniversalLimit(spv_validator_limit_max_struct_members, 9); - std::stringstream os; - t.SetMessageConsumer([&os](spv_message_level_t, const char*, - const spv_position_t&, - const char* message) { os << message; }); - - EXPECT_FALSE(t.Validate(binary.data(), binary.size(), opts)); - EXPECT_THAT( - os.str(), - HasSubstr( - "Number of OpTypeStruct members (10) has exceeded the limit (9)")); -} - -// Checks that after running the given optimizer |opt| on the given |original| -// source code, we can get the given |optimized| source code. -void CheckOptimization(const char* original, const char* optimized, - const Optimizer& opt) { - SpirvTools t(SPV_ENV_UNIVERSAL_1_1); - std::vector original_binary; - ASSERT_TRUE(t.Assemble(original, &original_binary)); - - std::vector optimized_binary; - EXPECT_TRUE(opt.Run(original_binary.data(), original_binary.size(), - &optimized_binary)); - - std::string optimized_text; - EXPECT_TRUE(t.Disassemble(optimized_binary, &optimized_text)); - EXPECT_EQ(optimized, optimized_text); -} - -TEST(CppInterface, OptimizeEmptyModule) { - SpirvTools t(SPV_ENV_UNIVERSAL_1_1); - std::vector binary; - EXPECT_TRUE(t.Assemble("", &binary)); - - Optimizer o(SPV_ENV_UNIVERSAL_1_1); - o.RegisterPass(CreateStripDebugInfoPass()); - EXPECT_TRUE(o.Run(binary.data(), binary.size(), &binary)); -} - -TEST(CppInterface, OptimizeModifiedModule) { - Optimizer o(SPV_ENV_UNIVERSAL_1_1); - o.RegisterPass(CreateStripDebugInfoPass()); - CheckOptimization("OpSource GLSL 450", "", o); -} - -TEST(CppInterface, OptimizeMulitplePasses) { - const char* original_text = - "OpSource GLSL 450 " - "OpDecorate %true SpecId 1 " - "%bool = OpTypeBool " - "%true = OpSpecConstantTrue %bool"; - - Optimizer o(SPV_ENV_UNIVERSAL_1_1); - o.RegisterPass(CreateStripDebugInfoPass()) - .RegisterPass(CreateFreezeSpecConstantValuePass()); - - const char* expected_text = - "%bool = OpTypeBool\n" - "%true = OpConstantTrue %bool\n"; - - CheckOptimization(original_text, expected_text, o); -} - -TEST(CppInterface, OptimizeDoNothingWithPassToken) { - CreateFreezeSpecConstantValuePass(); - auto token = CreateUnifyConstantPass(); -} - -TEST(CppInterface, OptimizeReassignPassToken) { - auto token = CreateNullPass(); - token = CreateStripDebugInfoPass(); - - CheckOptimization( - "OpSource GLSL 450", "", - Optimizer(SPV_ENV_UNIVERSAL_1_1).RegisterPass(std::move(token))); -} - -TEST(CppInterface, OptimizeMoveConstructPassToken) { - auto token1 = CreateStripDebugInfoPass(); - Optimizer::PassToken token2(std::move(token1)); - - CheckOptimization( - "OpSource GLSL 450", "", - Optimizer(SPV_ENV_UNIVERSAL_1_1).RegisterPass(std::move(token2))); -} - -TEST(CppInterface, OptimizeMoveAssignPassToken) { - auto token1 = CreateStripDebugInfoPass(); - auto token2 = CreateNullPass(); - token2 = std::move(token1); - - CheckOptimization( - "OpSource GLSL 450", "", - Optimizer(SPV_ENV_UNIVERSAL_1_1).RegisterPass(std::move(token2))); -} - -TEST(CppInterface, OptimizeSameAddressForOriginalOptimizedBinary) { - SpirvTools t(SPV_ENV_UNIVERSAL_1_1); - std::vector binary; - ASSERT_TRUE(t.Assemble("OpSource GLSL 450", &binary)); - - EXPECT_TRUE(Optimizer(SPV_ENV_UNIVERSAL_1_1) - .RegisterPass(CreateStripDebugInfoPass()) - .Run(binary.data(), binary.size(), &binary)); - - std::string optimized_text; - EXPECT_TRUE(t.Disassemble(binary, &optimized_text)); - EXPECT_EQ("", optimized_text); -} - -// TODO(antiagainst): tests for SetMessageConsumer(). - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/diagnostic_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/diagnostic_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/diagnostic_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/diagnostic_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include - -#include "gmock/gmock.h" -#include "unit_spirv.h" - -namespace { - -using libspirv::DiagnosticStream; -using ::testing::Eq; - -// Returns a newly created diagnostic value. -spv_diagnostic MakeValidDiagnostic() { - spv_position_t position = {}; - spv_diagnostic diagnostic = spvDiagnosticCreate(&position, ""); - EXPECT_NE(nullptr, diagnostic); - return diagnostic; -} - -TEST(Diagnostic, DestroyNull) { spvDiagnosticDestroy(nullptr); } - -TEST(Diagnostic, DestroyValidDiagnostic) { - spv_diagnostic diagnostic = MakeValidDiagnostic(); - spvDiagnosticDestroy(diagnostic); - // We aren't allowed to use the diagnostic pointer anymore. - // So we can't test its behaviour. -} - -TEST(Diagnostic, DestroyValidDiagnosticAfterReassignment) { - spv_diagnostic diagnostic = MakeValidDiagnostic(); - spv_diagnostic second_diagnostic = MakeValidDiagnostic(); - EXPECT_TRUE(diagnostic != second_diagnostic); - spvDiagnosticDestroy(diagnostic); - diagnostic = second_diagnostic; - spvDiagnosticDestroy(diagnostic); -} - -TEST(Diagnostic, PrintDefault) { - char message[] = "Test Diagnostic!"; - spv_diagnostic_t diagnostic = {{2, 3, 5}, message}; - // TODO: Redirect stderr - ASSERT_EQ(SPV_SUCCESS, spvDiagnosticPrint(&diagnostic)); - // TODO: Validate the output of spvDiagnosticPrint() - // TODO: Remove the redirection of stderr -} - -TEST(Diagnostic, PrintInvalidDiagnostic) { - ASSERT_EQ(SPV_ERROR_INVALID_DIAGNOSTIC, spvDiagnosticPrint(nullptr)); -} - -// TODO(dneto): We should be able to redirect the diagnostic printing. -// Once we do that, we can test diagnostic corner cases. - -TEST(DiagnosticStream, ConversionToResultType) { - // Check after the DiagnosticStream object is destroyed. - spv_result_t value; - { value = DiagnosticStream({}, nullptr, SPV_ERROR_INVALID_TEXT); } - EXPECT_EQ(SPV_ERROR_INVALID_TEXT, value); - - // Check implicit conversion via plain assignment. - value = DiagnosticStream({}, nullptr, SPV_SUCCESS); - EXPECT_EQ(SPV_SUCCESS, value); - - // Check conversion via constructor. - EXPECT_EQ(SPV_FAILED_MATCH, - spv_result_t(DiagnosticStream({}, nullptr, SPV_FAILED_MATCH))); -} - -TEST(DiagnosticStream, MoveConstructorPreservesPreviousMessagesAndPreventsOutputFromExpiringValue) { - std::ostringstream messages; - int message_count = 0; - auto consumer = [&messages, &message_count](spv_message_level_t, const char*, - const spv_position_t&, - const char* msg) { - message_count++; - messages << msg; - }; - - // Enclose the DiagnosticStream variables in a scope to force destruction. - { - DiagnosticStream ds0({}, consumer, SPV_ERROR_INVALID_BINARY); - ds0 << "First"; - DiagnosticStream ds1(std::move(ds0)); - ds1 << "Second"; - } - EXPECT_THAT(message_count, Eq(1)); - EXPECT_THAT(messages.str(), Eq("FirstSecond")); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/enum_set_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/enum_set_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/enum_set_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/enum_set_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,288 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include -#include "gmock/gmock.h" - -#include "enum_set.h" -#include "unit_spirv.h" - -namespace { - -using libspirv::EnumSet; -using libspirv::CapabilitySet; -using spvtest::ElementsIn; -using ::testing::Eq; -using ::testing::ValuesIn; - -TEST(EnumSet, IsEmpty1) { - EnumSet set; - EXPECT_TRUE(set.IsEmpty()); - set.Add(0); - EXPECT_FALSE(set.IsEmpty()); -} - -TEST(EnumSet, IsEmpty2) { - EnumSet set; - EXPECT_TRUE(set.IsEmpty()); - set.Add(150); - EXPECT_FALSE(set.IsEmpty()); -} - -TEST(EnumSet, IsEmpty3) { - EnumSet set(4); - EXPECT_FALSE(set.IsEmpty()); -} - -TEST(EnumSet, IsEmpty4) { - EnumSet set(300); - EXPECT_FALSE(set.IsEmpty()); -} - -TEST(EnumSetHasAnyOf, EmptySetEmptyQuery) { - const EnumSet set; - const EnumSet empty; - EXPECT_TRUE(set.HasAnyOf(empty)); - EXPECT_TRUE(EnumSet().HasAnyOf(EnumSet())); -} - -TEST(EnumSetHasAnyOf, MaskSetEmptyQuery) { - EnumSet set; - const EnumSet empty; - set.Add(5); - set.Add(8); - EXPECT_TRUE(set.HasAnyOf(empty)); -} - -TEST(EnumSetHasAnyOf, OverflowSetEmptyQuery) { - EnumSet set; - const EnumSet empty; - set.Add(200); - set.Add(300); - EXPECT_TRUE(set.HasAnyOf(empty)); -} - -TEST(EnumSetHasAnyOf, EmptyQuery) { - EnumSet set; - const EnumSet empty; - set.Add(5); - set.Add(8); - set.Add(200); - set.Add(300); - EXPECT_TRUE(set.HasAnyOf(empty)); -} - -TEST(EnumSetHasAnyOf, EmptyQueryAlwaysTrue) { - EnumSet set; - const EnumSet empty; - EXPECT_TRUE(set.HasAnyOf(empty)); - set.Add(5); - EXPECT_TRUE(set.HasAnyOf(empty)); - - EXPECT_TRUE(EnumSet(100).HasAnyOf(EnumSet())); -} - -TEST(EnumSetHasAnyOf, ReflexiveMask) { - EnumSet set(3); - set.Add(24); - set.Add(30); - EXPECT_TRUE(set.HasAnyOf(set)); -} - -TEST(EnumSetHasAnyOf, ReflexiveOverflow) { - EnumSet set(200); - set.Add(300); - set.Add(400); - EXPECT_TRUE(set.HasAnyOf(set)); -} - -TEST(EnumSetHasAnyOf, Reflexive) { - EnumSet set(3); - set.Add(24); - set.Add(300); - set.Add(400); - EXPECT_TRUE(set.HasAnyOf(set)); -} - -TEST(EnumSetHasAnyOf, EmptySetHasNone) { - EnumSet set; - EnumSet items; - for (uint32_t i = 0; i < 200; ++i) { - items.Add(i); - EXPECT_FALSE(set.HasAnyOf(items)); - EXPECT_FALSE(set.HasAnyOf(EnumSet(i))); - } -} - -TEST(EnumSetHasAnyOf, MaskSetMaskQuery) { - EnumSet set(0); - EnumSet items(1); - EXPECT_FALSE(set.HasAnyOf(items)); - set.Add(2); - items.Add(3); - EXPECT_FALSE(set.HasAnyOf(items)); - set.Add(3); - EXPECT_TRUE(set.HasAnyOf(items)); - set.Add(4); - EXPECT_TRUE(set.HasAnyOf(items)); -} - -TEST(EnumSetHasAnyOf, OverflowSetOverflowQuery) { - EnumSet set(100); - EnumSet items(200); - EXPECT_FALSE(set.HasAnyOf(items)); - set.Add(300); - items.Add(400); - EXPECT_FALSE(set.HasAnyOf(items)); - set.Add(200); - EXPECT_TRUE(set.HasAnyOf(items)); - set.Add(500); - EXPECT_TRUE(set.HasAnyOf(items)); -} - -TEST(EnumSetHasAnyOf, GeneralCase) { - EnumSet set(0); - EnumSet items(100); - EXPECT_FALSE(set.HasAnyOf(items)); - set.Add(300); - items.Add(4); - EXPECT_FALSE(set.HasAnyOf(items)); - set.Add(5); - items.Add(500); - EXPECT_FALSE(set.HasAnyOf(items)); - set.Add(500); - EXPECT_TRUE(set.HasAnyOf(items)); - EXPECT_FALSE(set.HasAnyOf(EnumSet(20))); - EXPECT_FALSE(set.HasAnyOf(EnumSet(600))); - EXPECT_TRUE(set.HasAnyOf(EnumSet(5))); - EXPECT_TRUE(set.HasAnyOf(EnumSet(300))); - EXPECT_TRUE(set.HasAnyOf(EnumSet(0))); -} - -TEST(EnumSet, DefaultIsEmpty) { - EnumSet set; - for (uint32_t i = 0; i < 1000; ++i) { - EXPECT_FALSE(set.Contains(i)); - } -} - -TEST(CapabilitySet, ConstructSingleMemberMatrix) { - CapabilitySet s(SpvCapabilityMatrix); - EXPECT_TRUE(s.Contains(SpvCapabilityMatrix)); - EXPECT_FALSE(s.Contains(SpvCapabilityShader)); - EXPECT_FALSE(s.Contains(static_cast(1000))); -} - -TEST(CapabilitySet, ConstructSingleMemberMaxInMask) { - CapabilitySet s(static_cast(63)); - EXPECT_FALSE(s.Contains(SpvCapabilityMatrix)); - EXPECT_FALSE(s.Contains(SpvCapabilityShader)); - EXPECT_TRUE(s.Contains(static_cast(63))); - EXPECT_FALSE(s.Contains(static_cast(64))); - EXPECT_FALSE(s.Contains(static_cast(1000))); -} - -TEST(CapabilitySet, ConstructSingleMemberMinOverflow) { - // Check the first one that forces overflow beyond the mask. - CapabilitySet s(static_cast(64)); - EXPECT_FALSE(s.Contains(SpvCapabilityMatrix)); - EXPECT_FALSE(s.Contains(SpvCapabilityShader)); - EXPECT_FALSE(s.Contains(static_cast(63))); - EXPECT_TRUE(s.Contains(static_cast(64))); - EXPECT_FALSE(s.Contains(static_cast(1000))); -} - -TEST(CapabilitySet, ConstructSingleMemberMaxOverflow) { - // Check the max 32-bit signed int. - CapabilitySet s(static_cast(0x7fffffffu)); - EXPECT_FALSE(s.Contains(SpvCapabilityMatrix)); - EXPECT_FALSE(s.Contains(SpvCapabilityShader)); - EXPECT_FALSE(s.Contains(static_cast(1000))); - EXPECT_TRUE(s.Contains(static_cast(0x7fffffffu))); -} - -TEST(CapabilitySet, AddEnum) { - CapabilitySet s(SpvCapabilityShader); - s.Add(SpvCapabilityKernel); - s.Add(static_cast(42)); - EXPECT_FALSE(s.Contains(SpvCapabilityMatrix)); - EXPECT_TRUE(s.Contains(SpvCapabilityShader)); - EXPECT_TRUE(s.Contains(SpvCapabilityKernel)); - EXPECT_TRUE(s.Contains(static_cast(42))); -} - -TEST(CapabilitySet, InitializerListEmpty) { - CapabilitySet s{}; - for (uint32_t i = 0; i < 1000; i++) { - EXPECT_FALSE(s.Contains(static_cast(i))); - } -} - -struct ForEachCase { - CapabilitySet capabilities; - std::vector expected; -}; - -using CapabilitySetForEachTest = ::testing::TestWithParam; - -TEST_P(CapabilitySetForEachTest, CallsAsExpected) { - EXPECT_THAT(ElementsIn(GetParam().capabilities), Eq(GetParam().expected)); -} - -TEST_P(CapabilitySetForEachTest, CopyConstructor) { - CapabilitySet copy(GetParam().capabilities); - EXPECT_THAT(ElementsIn(copy), Eq(GetParam().expected)); -} - -TEST_P(CapabilitySetForEachTest, MoveConstructor) { - // We need a writable copy to move from. - CapabilitySet copy(GetParam().capabilities); - CapabilitySet moved(std::move(copy)); - EXPECT_THAT(ElementsIn(moved), Eq(GetParam().expected)); - - // The moved-from set is empty. - EXPECT_THAT(ElementsIn(copy), Eq(std::vector{})); -} - -TEST_P(CapabilitySetForEachTest, OperatorEquals) { - CapabilitySet assigned = GetParam().capabilities; - EXPECT_THAT(ElementsIn(assigned), Eq(GetParam().expected)); -} - -TEST_P(CapabilitySetForEachTest, OperatorEqualsSelfAssign) { - CapabilitySet assigned{GetParam().capabilities}; - assigned = assigned; - EXPECT_THAT(ElementsIn(assigned), Eq(GetParam().expected)); -} - -INSTANTIATE_TEST_CASE_P(Samples, CapabilitySetForEachTest, - ValuesIn(std::vector{ - {{}, {}}, - {{SpvCapabilityMatrix}, {SpvCapabilityMatrix}}, - {{SpvCapabilityKernel, SpvCapabilityShader}, - {SpvCapabilityShader, SpvCapabilityKernel}}, - {{static_cast(999)}, - {static_cast(999)}}, - {{static_cast(0x7fffffff)}, - {static_cast(0x7fffffff)}}, - // Mixture and out of order - {{static_cast(0x7fffffff), - static_cast(100), - SpvCapabilityShader, SpvCapabilityMatrix}, - {SpvCapabilityMatrix, SpvCapabilityShader, - static_cast(100), - static_cast(0x7fffffff)}}, - }), ); - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/enum_string_mapping_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/enum_string_mapping_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/enum_string_mapping_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/enum_string_mapping_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,256 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Tests for OpExtension validator rules. - -#include - -#include "enum_string_mapping.h" -#include "extensions.h" -#include "gtest/gtest.h" - -namespace { - -using ::libspirv::Extension; - -using ::testing::Values; -using ::testing::ValuesIn; - -using ExtensionTest = ::testing::TestWithParam>; -using UnknownExtensionTest = ::testing::TestWithParam; -using CapabilityTest = ::testing::TestWithParam>; - -TEST_P(ExtensionTest, TestExtensionFromString) { - const std::pair& param = GetParam(); - const Extension extension = param.first; - const std::string extension_str = param.second; - Extension result_extension; - ASSERT_TRUE(libspirv::GetExtensionFromString(extension_str, &result_extension)); - EXPECT_EQ(extension, result_extension); -} - -TEST_P(ExtensionTest, TestExtensionToString) { - const std::pair& param = GetParam(); - const Extension extension = param.first; - const std::string extension_str = param.second; - const std::string result_str = libspirv::ExtensionToString(extension); - EXPECT_EQ(extension_str, result_str); -} - -TEST_P(UnknownExtensionTest, TestExtensionFromStringFails) { - Extension result_extension; - ASSERT_FALSE(libspirv::GetExtensionFromString(GetParam(), &result_extension)); -} - -TEST_P(CapabilityTest, TestCapabilityToString) { - const std::pair& param = GetParam(); - const SpvCapability capability = param.first; - const std::string capability_str = param.second; - const std::string result_str = libspirv::CapabilityToString(capability); - EXPECT_EQ(capability_str, result_str); -} - -INSTANTIATE_TEST_CASE_P(AllExtensions, ExtensionTest, - ValuesIn(std::vector>({ - {Extension::kSPV_KHR_16bit_storage, - "SPV_KHR_16bit_storage"}, - {Extension::kSPV_KHR_device_group, - "SPV_KHR_device_group"}, - {Extension::kSPV_KHR_multiview, - "SPV_KHR_multiview"}, - {Extension::kSPV_KHR_shader_ballot, - "SPV_KHR_shader_ballot"}, - {Extension::kSPV_KHR_shader_draw_parameters, - "SPV_KHR_shader_draw_parameters"}, - {Extension::kSPV_KHR_subgroup_vote, - "SPV_KHR_subgroup_vote"}, - {Extension::kSPV_NVX_multiview_per_view_attributes, - "SPV_NVX_multiview_per_view_attributes"}, - {Extension::kSPV_NV_geometry_shader_passthrough, - "SPV_NV_geometry_shader_passthrough"}, - {Extension::kSPV_NV_sample_mask_override_coverage, - "SPV_NV_sample_mask_override_coverage"}, - {Extension::kSPV_NV_stereo_view_rendering, - "SPV_NV_stereo_view_rendering"}, - {Extension::kSPV_NV_viewport_array2, - "SPV_NV_viewport_array2"} - }))); - -INSTANTIATE_TEST_CASE_P(UnknownExtensions, UnknownExtensionTest, Values( - "", - "SPV_KHR_", - "SPV_KHR_device_group_ERROR", - "SPV_ERROR_random_string_hfsdklhlktherh" - )); - -INSTANTIATE_TEST_CASE_P(AllCapabilities, CapabilityTest, - ValuesIn(std::vector>({ - {SpvCapabilityMatrix, - "Matrix"}, - {SpvCapabilityShader, - "Shader"}, - {SpvCapabilityGeometry, - "Geometry"}, - {SpvCapabilityTessellation, - "Tessellation"}, - {SpvCapabilityAddresses, - "Addresses"}, - {SpvCapabilityLinkage, - "Linkage"}, - {SpvCapabilityKernel, - "Kernel"}, - {SpvCapabilityVector16, - "Vector16"}, - {SpvCapabilityFloat16Buffer, - "Float16Buffer"}, - {SpvCapabilityFloat16, - "Float16"}, - {SpvCapabilityFloat64, - "Float64"}, - {SpvCapabilityInt64, - "Int64"}, - {SpvCapabilityInt64Atomics, - "Int64Atomics"}, - {SpvCapabilityImageBasic, - "ImageBasic"}, - {SpvCapabilityImageReadWrite, - "ImageReadWrite"}, - {SpvCapabilityImageMipmap, - "ImageMipmap"}, - {SpvCapabilityPipes, - "Pipes"}, - {SpvCapabilityGroups, - "Groups"}, - {SpvCapabilityDeviceEnqueue, - "DeviceEnqueue"}, - {SpvCapabilityLiteralSampler, - "LiteralSampler"}, - {SpvCapabilityAtomicStorage, - "AtomicStorage"}, - {SpvCapabilityInt16, - "Int16"}, - {SpvCapabilityTessellationPointSize, - "TessellationPointSize"}, - {SpvCapabilityGeometryPointSize, - "GeometryPointSize"}, - {SpvCapabilityImageGatherExtended, - "ImageGatherExtended"}, - {SpvCapabilityStorageImageMultisample, - "StorageImageMultisample"}, - {SpvCapabilityUniformBufferArrayDynamicIndexing, - "UniformBufferArrayDynamicIndexing"}, - {SpvCapabilitySampledImageArrayDynamicIndexing, - "SampledImageArrayDynamicIndexing"}, - {SpvCapabilityStorageBufferArrayDynamicIndexing, - "StorageBufferArrayDynamicIndexing"}, - {SpvCapabilityStorageImageArrayDynamicIndexing, - "StorageImageArrayDynamicIndexing"}, - {SpvCapabilityClipDistance, - "ClipDistance"}, - {SpvCapabilityCullDistance, - "CullDistance"}, - {SpvCapabilityImageCubeArray, - "ImageCubeArray"}, - {SpvCapabilitySampleRateShading, - "SampleRateShading"}, - {SpvCapabilityImageRect, - "ImageRect"}, - {SpvCapabilitySampledRect, - "SampledRect"}, - {SpvCapabilityGenericPointer, - "GenericPointer"}, - {SpvCapabilityInt8, - "Int8"}, - {SpvCapabilityInputAttachment, - "InputAttachment"}, - {SpvCapabilitySparseResidency, - "SparseResidency"}, - {SpvCapabilityMinLod, - "MinLod"}, - {SpvCapabilitySampled1D, - "Sampled1D"}, - {SpvCapabilityImage1D, - "Image1D"}, - {SpvCapabilitySampledCubeArray, - "SampledCubeArray"}, - {SpvCapabilitySampledBuffer, - "SampledBuffer"}, - {SpvCapabilityImageBuffer, - "ImageBuffer"}, - {SpvCapabilityImageMSArray, - "ImageMSArray"}, - {SpvCapabilityStorageImageExtendedFormats, - "StorageImageExtendedFormats"}, - {SpvCapabilityImageQuery, - "ImageQuery"}, - {SpvCapabilityDerivativeControl, - "DerivativeControl"}, - {SpvCapabilityInterpolationFunction, - "InterpolationFunction"}, - {SpvCapabilityTransformFeedback, - "TransformFeedback"}, - {SpvCapabilityGeometryStreams, - "GeometryStreams"}, - {SpvCapabilityStorageImageReadWithoutFormat, - "StorageImageReadWithoutFormat"}, - {SpvCapabilityStorageImageWriteWithoutFormat, - "StorageImageWriteWithoutFormat"}, - {SpvCapabilityMultiViewport, - "MultiViewport"}, - {SpvCapabilitySubgroupDispatch, - "SubgroupDispatch"}, - {SpvCapabilityNamedBarrier, - "NamedBarrier"}, - {SpvCapabilityPipeStorage, - "PipeStorage"}, - {SpvCapabilitySubgroupBallotKHR, - "SubgroupBallotKHR"}, - {SpvCapabilityDrawParameters, - "DrawParameters"}, - {SpvCapabilitySubgroupVoteKHR, - "SubgroupVoteKHR"}, - {SpvCapabilityStorageBuffer16BitAccess, - "StorageBuffer16BitAccess"}, - {SpvCapabilityStorageUniformBufferBlock16, - "StorageBuffer16BitAccess"}, // Preferred name - {SpvCapabilityUniformAndStorageBuffer16BitAccess, - "UniformAndStorageBuffer16BitAccess"}, - {SpvCapabilityStorageUniform16, - "UniformAndStorageBuffer16BitAccess"}, // Preferred name - {SpvCapabilityStoragePushConstant16, - "StoragePushConstant16"}, - {SpvCapabilityStorageInputOutput16, - "StorageInputOutput16"}, - {SpvCapabilityDeviceGroup, - "DeviceGroup"}, - {SpvCapabilityMultiView, - "MultiView"}, - {SpvCapabilitySampleMaskOverrideCoverageNV, - "SampleMaskOverrideCoverageNV"}, - {SpvCapabilityGeometryShaderPassthroughNV, - "GeometryShaderPassthroughNV"}, - // The next two are different names for the same token. - {SpvCapabilityShaderViewportIndexLayerNV, - "ShaderViewportIndexLayerEXT"}, - {SpvCapabilityShaderViewportIndexLayerEXT, - "ShaderViewportIndexLayerEXT"}, - {SpvCapabilityShaderViewportMaskNV, - "ShaderViewportMaskNV"}, - {SpvCapabilityShaderStereoViewNV, - "ShaderStereoViewNV"}, - {SpvCapabilityPerViewAttributesNV, - "PerViewAttributesNV"} - })), ); - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/ext_inst.glsl_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/ext_inst.glsl_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/ext_inst.glsl_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/ext_inst.glsl_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,200 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include - -#include "unit_spirv.h" -#include "spirv/1.0/GLSL.std.450.h" - -namespace { - -/// Context for an extended instruction. -/// -/// Information about a GLSL extended instruction (including its opname, return -/// type, etc.) and related instructions used to generate the return type and -/// constant as the operands. Used in generating extended instruction tests. -struct ExtInstContext { - const char* extInstOpName; - const char* extInstOperandVars; - /// The following fields are used to check the SPIR-V binary representation - /// of this instruction. - uint32_t extInstOpcode; ///< Opcode value for this extended instruction. - uint32_t extInstLength; ///< Wordcount of this extended instruction. - std::vector extInstOperandIds; ///< Ids for operands. -}; - -using ExtInstGLSLstd450RoundTripTest = ::testing::TestWithParam; - -TEST_P(ExtInstGLSLstd450RoundTripTest, ParameterizedExtInst) { - spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_0); - const std::string spirv = R"( -OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical Simple -OpEntryPoint Vertex %2 "main" -%3 = OpTypeVoid -%4 = OpTypeFunction %3 -%2 = OpFunction %3 None %5 -%6 = OpLabel -%8 = OpExtInst %7 %1 )" + std::string(GetParam().extInstOpName) + - " " + GetParam().extInstOperandVars + R"( -OpReturn -OpFunctionEnd -)"; - const std::string spirv_header = - R"(; SPIR-V -; Version: 1.0 -; Generator: Khronos SPIR-V Tools Assembler; 0 -; Bound: 9 -; Schema: 0)"; - spv_binary binary; - spv_diagnostic diagnostic; - spv_result_t error = spvTextToBinary(context, spirv.c_str(), spirv.size(), - &binary, &diagnostic); - if (error) { - spvDiagnosticPrint(diagnostic); - spvDiagnosticDestroy(diagnostic); - ASSERT_EQ(SPV_SUCCESS, error) - << "Source was: " << std::endl - << spirv << std::endl - << "Test case for : " << GetParam().extInstOpName << std::endl; - } - - // Check we do have the extended instruction's corresponding binary code in - // the generated SPIR-V binary. - std::vector expected_contains( - {12 /*OpExtInst*/ | GetParam().extInstLength << 16, 7 /*return type*/, - 8 /*result id*/, 1 /*glsl450 import*/, GetParam().extInstOpcode}); - for (uint32_t operand : GetParam().extInstOperandIds) { - expected_contains.push_back(operand); - } - EXPECT_NE(binary->code + binary->wordCount, - std::search(binary->code, binary->code + binary->wordCount, - expected_contains.begin(), expected_contains.end())) - << "Cannot find\n" - << spvtest::WordVector(expected_contains).str() << "in\n" - << spvtest::WordVector(*binary).str(); - - // Check round trip gives the same text. - spv_text output_text = nullptr; - error = spvBinaryToText(context, binary->code, binary->wordCount, - SPV_BINARY_TO_TEXT_OPTION_NONE, &output_text, - &diagnostic); - - if (error) { - spvDiagnosticPrint(diagnostic); - spvDiagnosticDestroy(diagnostic); - ASSERT_EQ(SPV_SUCCESS, error); - } - EXPECT_EQ(spirv_header + spirv, output_text->str); - spvTextDestroy(output_text); - spvContextDestroy(context); -} - -INSTANTIATE_TEST_CASE_P( - ExtInstParameters, ExtInstGLSLstd450RoundTripTest, - ::testing::ValuesIn(std::vector({ - // We are only testing the correctness of encoding and decoding here. - // Semantic correctness should be the responsibility of validator. So - // some of the instructions below have incorrect operand and/or return - // types, e.g, Modf, ModfStruct, etc. - {"Round", "%5", 1, 6, {5}}, - {"RoundEven", "%5", 2, 6, {5}}, - {"Trunc", "%5", 3, 6, {5}}, - {"FAbs", "%5", 4, 6, {5}}, - {"SAbs", "%5", 5, 6, {5}}, - {"FSign", "%5", 6, 6, {5}}, - {"SSign", "%5", 7, 6, {5}}, - {"Floor", "%5", 8, 6, {5}}, - {"Ceil", "%5", 9, 6, {5}}, - {"Fract", "%5", 10, 6, {5}}, - {"Radians", "%5", 11, 6, {5}}, - {"Degrees", "%5", 12, 6, {5}}, - {"Sin", "%5", 13, 6, {5}}, - {"Cos", "%5", 14, 6, {5}}, - {"Tan", "%5", 15, 6, {5}}, - {"Asin", "%5", 16, 6, {5}}, - {"Acos", "%5", 17, 6, {5}}, - {"Atan", "%5", 18, 6, {5}}, - {"Sinh", "%5", 19, 6, {5}}, - {"Cosh", "%5", 20, 6, {5}}, - {"Tanh", "%5", 21, 6, {5}}, - {"Asinh", "%5", 22, 6, {5}}, - {"Acosh", "%5", 23, 6, {5}}, - {"Atanh", "%5", 24, 6, {5}}, - {"Atan2", "%5 %5", 25, 7, {5, 5}}, - {"Pow", "%5 %5", 26, 7, {5, 5}}, - {"Exp", "%5", 27, 6, {5}}, - {"Log", "%5", 28, 6, {5}}, - {"Exp2", "%5", 29, 6, {5}}, - {"Log2", "%5", 30, 6, {5}}, - {"Sqrt", "%5", 31, 6, {5}}, - {"InverseSqrt", "%5", 32, 6, {5}}, - {"Determinant", "%5", 33, 6, {5}}, - {"MatrixInverse", "%5", 34, 6, {5}}, - {"Modf", "%5 %5", 35, 7, {5, 5}}, - {"ModfStruct", "%5", 36, 6, {5}}, - {"FMin", "%5 %5", 37, 7, {5, 5}}, - {"UMin", "%5 %5", 38, 7, {5, 5}}, - {"SMin", "%5 %5", 39, 7, {5, 5}}, - {"FMax", "%5 %5", 40, 7, {5, 5}}, - {"UMax", "%5 %5", 41, 7, {5, 5}}, - {"SMax", "%5 %5", 42, 7, {5, 5}}, - {"FClamp", "%5 %5 %5", 43, 8, {5, 5, 5}}, - {"UClamp", "%5 %5 %5", 44, 8, {5, 5, 5}}, - {"SClamp", "%5 %5 %5", 45, 8, {5, 5, 5}}, - {"FMix", "%5 %5 %5", 46, 8, {5, 5, 5}}, - {"IMix", "%5 %5 %5", 47, 8, {5, 5, 5}}, // Bug 15452. Reserved. - {"Step", "%5 %5", 48, 7, {5, 5}}, - {"SmoothStep", "%5 %5 %5", 49, 8, {5, 5, 5}}, - {"Fma", "%5 %5 %5", 50, 8, {5, 5, 5}}, - {"Frexp", "%5 %5", 51, 7, {5, 5}}, - {"FrexpStruct", "%5", 52, 6, {5}}, - {"Ldexp", "%5 %5", 53, 7, {5, 5}}, - {"PackSnorm4x8", "%5", 54, 6, {5}}, - {"PackUnorm4x8", "%5", 55, 6, {5}}, - {"PackSnorm2x16", "%5", 56, 6, {5}}, - {"PackUnorm2x16", "%5", 57, 6, {5}}, - {"PackHalf2x16", "%5", 58, 6, {5}}, - {"PackDouble2x32", "%5", 59, 6, {5}}, - {"UnpackSnorm2x16", "%5", 60, 6, {5}}, - {"UnpackUnorm2x16", "%5", 61, 6, {5}}, - {"UnpackHalf2x16", "%5", 62, 6, {5}}, - {"UnpackSnorm4x8", "%5", 63, 6, {5}}, - {"UnpackUnorm4x8", "%5", 64, 6, {5}}, - {"UnpackDouble2x32", "%5", 65, 6, {5}}, - {"Length", "%5", 66, 6, {5}}, - {"Distance", "%5 %5", 67, 7, {5, 5}}, - {"Cross", "%5 %5", 68, 7, {5, 5}}, - {"Normalize", "%5", 69, 6, {5}}, - // clang-format off - {"FaceForward", "%5 %5 %5", 70, 8, {5, 5, 5}}, - // clang-format on - {"Reflect", "%5 %5", 71, 7, {5, 5}}, - {"Refract", "%5 %5 %5", 72, 8, {5, 5, 5}}, - {"FindILsb", "%5", 73, 6, {5}}, - {"FindSMsb", "%5", 74, 6, {5}}, - {"FindUMsb", "%5", 75, 6, {5}}, - {"InterpolateAtCentroid", "%5", 76, 6, {5}}, - // clang-format off - {"InterpolateAtSample", "%5 %5", 77, 7, {5, 5}}, - {"InterpolateAtOffset", "%5 %5", 78, 7, {5, 5}}, - // clang-format on - {"NMin", "%5 %5", 79, 7, {5, 5}}, - {"NMax", "%5 %5", 80, 7, {5, 5}}, - {"NClamp", "%5 %5 %5", 81, 8, {5, 5, 5}}, - })), ); - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/ext_inst.opencl_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/ext_inst.opencl_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/ext_inst.opencl_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/ext_inst.opencl_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,369 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -#include -#include "test_fixture.h" -#include "spirv/1.0/OpenCL.std.h" - -namespace { - -using spvtest::Concatenate; -using spvtest::MakeInstruction; -using spvtest::MakeVector; -using spvtest::TextToBinaryTest; -using testing::Eq; - -struct InstructionCase { - uint32_t opcode; - std::string name; - std::string operands; - std::vector expected_operands; -}; - -using ExtInstOpenCLStdRoundTripTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(ExtInstOpenCLStdRoundTripTest, ParameterizedExtInst) { - // This example should not validate. - const std::string input = - "%1 = OpExtInstImport \"OpenCL.std\"\n" - "%3 = OpExtInst %2 %1 " + - GetParam().name + " " + GetParam().operands + "\n"; - // First make sure it assembles correctly. - EXPECT_THAT( - CompiledInstructions(input), - Eq(Concatenate( - {MakeInstruction(SpvOpExtInstImport, {1}, MakeVector("OpenCL.std")), - MakeInstruction(SpvOpExtInst, {2, 3, 1, GetParam().opcode}, - GetParam().expected_operands)}))) - << input; - // Now check the round trip through the disassembler. - EXPECT_THAT(EncodeAndDecodeSuccessfully(input), input) << input; -} - -#define CASE1(Enum, Name) \ - { \ - uint32_t(OpenCLLIB::Entrypoints::Enum), #Name, "%4", { 4 } \ - } -#define CASE2(Enum, Name) \ - { \ - uint32_t(OpenCLLIB::Entrypoints::Enum), #Name, "%4 %5", { 4, 5 } \ - } -#define CASE3(Enum, Name) \ - { \ - uint32_t(OpenCLLIB::Entrypoints::Enum), #Name, "%4 %5 %6", { 4, 5, 6 } \ - } -#define CASE4(Enum, Name) \ - { \ - uint32_t(OpenCLLIB::Entrypoints::Enum), #Name, "%4 %5 %6 %7", { \ - 4, 5, 6, 7 \ - } \ - } -#define CASE2Lit(Enum, Name, LiteralNumber) \ - { \ - uint32_t(OpenCLLIB::Entrypoints::Enum), #Name, "%4 %5 " #LiteralNumber, { \ - 4, 5, LiteralNumber \ - } \ - } -#define CASE3Round(Enum, Name, Mode) \ - { \ - uint32_t(OpenCLLIB::Entrypoints::Enum), #Name, "%4 %5 %6 " #Mode, { \ - 4, 5, 6, uint32_t(SpvFPRoundingMode##Mode) \ - } \ - } - -// clang-format off -// OpenCL.std: 2.1 Math extended instructions -INSTANTIATE_TEST_CASE_P( - OpenCLMath, ExtInstOpenCLStdRoundTripTest, - ::testing::ValuesIn(std::vector({ - // We are only testing the correctness of encoding and decoding here. - // Semantic correctness should be the responsibility of validator. - CASE1(Acos, acos), // enum value 0 - CASE1(Acosh, acosh), - CASE1(Acospi, acospi), - CASE1(Asin, asin), - CASE1(Asinh, asinh), - CASE1(Asinh, asinh), - CASE1(Asinpi, asinpi), - CASE1(Atan, atan), - CASE2(Atan2, atan2), - CASE1(Atanh, atanh), - CASE1(Atanpi, atanpi), - CASE2(Atan2pi, atan2pi), - CASE1(Cbrt, cbrt), - CASE1(Ceil, ceil), - CASE1(Ceil, ceil), - CASE2(Copysign, copysign), - CASE1(Cos, cos), - CASE1(Cosh, cosh), - CASE1(Cospi, cospi), - CASE1(Erfc, erfc), - CASE1(Erf, erf), - CASE1(Exp, exp), - CASE1(Exp2, exp2), - CASE1(Exp10, exp10), - CASE1(Expm1, expm1), - CASE1(Fabs, fabs), - CASE2(Fdim, fdim), - CASE1(Floor, floor), - CASE3(Fma, fma), - CASE2(Fmax, fmax), - CASE2(Fmin, fmin), - CASE2(Fmod, fmod), - CASE2(Fract, fract), - CASE2(Frexp, frexp), - CASE2(Hypot, hypot), - CASE1(Ilogb, ilogb), - CASE2(Ldexp, ldexp), - CASE1(Lgamma, lgamma), - CASE2(Lgamma_r, lgamma_r), - CASE1(Log, log), - CASE1(Log2, log2), - CASE1(Log10, log10), - CASE1(Log1p, log1p), - CASE3(Mad, mad), - CASE2(Maxmag, maxmag), - CASE2(Minmag, minmag), - CASE2(Modf, modf), - CASE1(Nan, nan), - CASE2(Nextafter, nextafter), - CASE2(Pow, pow), - CASE2(Pown, pown), - CASE2(Powr, powr), - CASE2(Remainder, remainder), - CASE3(Remquo, remquo), - CASE1(Rint, rint), - CASE2(Rootn, rootn), - CASE1(Round, round), - CASE1(Rsqrt, rsqrt), - CASE1(Sin, sin), - CASE2(Sincos, sincos), - CASE1(Sinh, sinh), - CASE1(Sinpi, sinpi), - CASE1(Sqrt, sqrt), - CASE1(Tan, tan), - CASE1(Tanh, tanh), - CASE1(Tanpi, tanpi), - CASE1(Tgamma, tgamma), - CASE1(Trunc, trunc), - CASE1(Half_cos, half_cos), - CASE2(Half_divide, half_divide), - CASE1(Half_exp, half_exp), - CASE1(Half_exp2, half_exp2), - CASE1(Half_exp10, half_exp10), - CASE1(Half_log, half_log), - CASE1(Half_log2, half_log2), - CASE1(Half_log10, half_log10), - CASE2(Half_powr, half_powr), - CASE1(Half_recip, half_recip), - CASE1(Half_rsqrt, half_rsqrt), - CASE1(Half_sin, half_sin), - CASE1(Half_sqrt, half_sqrt), - CASE1(Half_tan, half_tan), - CASE1(Native_cos, native_cos), - CASE2(Native_divide, native_divide), - CASE1(Native_exp, native_exp), - CASE1(Native_exp2, native_exp2), - CASE1(Native_exp10, native_exp10), - CASE1(Native_log, native_log), - CASE1(Native_log10, native_log10), - CASE2(Native_powr, native_powr), - CASE1(Native_recip, native_recip), - CASE1(Native_rsqrt, native_rsqrt), - CASE1(Native_sin, native_sin), - CASE1(Native_sqrt, native_sqrt), - CASE1(Native_tan, native_tan), // enum value 94 - })),); - -// OpenCL.std: 2.1 Integer instructions -INSTANTIATE_TEST_CASE_P( - OpenCLInteger, ExtInstOpenCLStdRoundTripTest, - ::testing::ValuesIn(std::vector({ - CASE1(SAbs, s_abs), // enum value 141 - CASE2(SAbs_diff, s_abs_diff), - CASE2(SAdd_sat, s_add_sat), - CASE2(UAdd_sat, u_add_sat), - CASE2(SHadd, s_hadd), - CASE2(UHadd, u_hadd), - CASE2(SRhadd, s_rhadd), - CASE2(SRhadd, s_rhadd), - CASE3(SClamp, s_clamp), - CASE3(UClamp, u_clamp), - CASE1(Clz, clz), - CASE1(Ctz, ctz), - CASE3(SMad_hi, s_mad_hi), - CASE3(UMad_sat, u_mad_sat), - CASE3(SMad_sat, s_mad_sat), - CASE2(SMax, s_max), - CASE2(UMax, u_max), - CASE2(SMin, s_min), - CASE2(UMin, u_min), - CASE2(SMul_hi, s_mul_hi), - CASE2(Rotate, rotate), - CASE2(SSub_sat, s_sub_sat), - CASE2(USub_sat, u_sub_sat), - CASE2(U_Upsample, u_upsample), - CASE2(S_Upsample, s_upsample), - CASE1(Popcount, popcount), - CASE3(SMad24, s_mad24), - CASE3(UMad24, u_mad24), - CASE2(SMul24, s_mul24), - CASE2(UMul24, u_mul24), // enum value 170 - CASE1(UAbs, u_abs), // enum value 201 - CASE2(UAbs_diff, u_abs_diff), - CASE2(UMul_hi, u_mul_hi), - CASE3(UMad_hi, u_mad_hi), // enum value 204 - })),); - -// OpenCL.std: 2.3 Common instrucitons -INSTANTIATE_TEST_CASE_P( - OpenCLCommon, ExtInstOpenCLStdRoundTripTest, - ::testing::ValuesIn(std::vector({ - CASE3(FClamp, fclamp), // enum value 95 - CASE1(Degrees, degrees), - CASE2(FMax_common, fmax_common), - CASE2(FMin_common, fmin_common), - CASE3(Mix, mix), - CASE1(Radians, radians), - CASE2(Step, step), - CASE3(Smoothstep, smoothstep), - CASE1(Sign, sign), // enum value 103 - })),); - -// OpenCL.std: 2.4 Geometric instructions -INSTANTIATE_TEST_CASE_P( - OpenCLGeometric, ExtInstOpenCLStdRoundTripTest, - ::testing::ValuesIn(std::vector({ - CASE2(Cross, cross), // enum value 104 - CASE2(Distance, distance), - CASE1(Length, length), - CASE1(Normalize, normalize), - CASE2(Fast_distance, fast_distance), - CASE1(Fast_length, fast_length), - CASE1(Fast_normalize, fast_normalize), // enum value 110 - })),); - -// OpenCL.std: 2.5 Relational instructions -INSTANTIATE_TEST_CASE_P( - OpenCLRelational, ExtInstOpenCLStdRoundTripTest, - ::testing::ValuesIn(std::vector({ - CASE3(Bitselect, bitselect), // enum value 186 - CASE3(Select, select), // enum value 187 - })),); - -// OpenCL.std: 2.6 Vector data load and store instructions -INSTANTIATE_TEST_CASE_P( - OpenCLVectorLoadStore, ExtInstOpenCLStdRoundTripTest, - ::testing::ValuesIn(std::vector({ - // The last argument to Vloadn must be one of 2, 3, 4, 8, 16. - CASE2Lit(Vloadn, vloadn, 2), - CASE2Lit(Vloadn, vloadn, 3), - CASE2Lit(Vloadn, vloadn, 4), - CASE2Lit(Vloadn, vloadn, 8), - CASE2Lit(Vloadn, vloadn, 16), - CASE3(Vstoren, vstoren), - CASE2(Vload_half, vload_half), - CASE2Lit(Vload_halfn, vload_halfn, 2), - CASE2Lit(Vload_halfn, vload_halfn, 3), - CASE2Lit(Vload_halfn, vload_halfn, 4), - CASE2Lit(Vload_halfn, vload_halfn, 8), - CASE2Lit(Vload_halfn, vload_halfn, 16), - CASE3(Vstore_half, vstore_half), - // Try all the rounding modes. - CASE3Round(Vstore_half_r, vstore_half_r, RTE), - CASE3Round(Vstore_half_r, vstore_half_r, RTZ), - CASE3Round(Vstore_half_r, vstore_half_r, RTP), - CASE3Round(Vstore_half_r, vstore_half_r, RTN), - CASE3(Vstore_halfn, vstore_halfn), - CASE3Round(Vstore_halfn_r, vstore_halfn_r, RTE), - CASE3Round(Vstore_halfn_r, vstore_halfn_r, RTZ), - CASE3Round(Vstore_halfn_r, vstore_halfn_r, RTP), - CASE3Round(Vstore_halfn_r, vstore_halfn_r, RTN), - CASE2Lit(Vloada_halfn, vloada_halfn, 2), - CASE2Lit(Vloada_halfn, vloada_halfn, 3), - CASE2Lit(Vloada_halfn, vloada_halfn, 4), - CASE2Lit(Vloada_halfn, vloada_halfn, 8), - CASE2Lit(Vloada_halfn, vloada_halfn, 16), - CASE3(Vstorea_halfn, vstorea_halfn), - CASE3Round(Vstorea_halfn_r, vstorea_halfn_r, RTE), - CASE3Round(Vstorea_halfn_r, vstorea_halfn_r, RTZ), - CASE3Round(Vstorea_halfn_r, vstorea_halfn_r, RTP), - CASE3Round(Vstorea_halfn_r, vstorea_halfn_r, RTN), - })),); - -// OpenCL.std: 2.7 Miscellaneous vector instructions -INSTANTIATE_TEST_CASE_P( - OpenCLMiscellaneousVector, ExtInstOpenCLStdRoundTripTest, - ::testing::ValuesIn(std::vector({ - CASE2(Shuffle, shuffle), - CASE3(Shuffle2, shuffle2), - })),); - -// OpenCL.std: 2.8 Miscellaneous instructions - -#define PREFIX uint32_t(OpenCLLIB::Entrypoints::Printf), "printf" -INSTANTIATE_TEST_CASE_P( - OpenCLMiscPrintf, ExtInstOpenCLStdRoundTripTest, - ::testing::ValuesIn(std::vector({ - // Printf is interesting because it takes a variable number of arguments. - // Start with zero optional arguments. - {PREFIX, "%4", {4}}, - {PREFIX, "%4 %5", {4, 5}}, - {PREFIX, "%4 %5 %6", {4, 5, 6}}, - {PREFIX, "%4 %5 %6 %7", {4, 5, 6, 7}}, - {PREFIX, "%4 %5 %6 %7 %8", {4, 5, 6, 7, 8}}, - {PREFIX, "%4 %5 %6 %7 %8 %9", {4, 5, 6, 7, 8, 9}}, - {PREFIX, "%4 %5 %6 %7 %8 %9 %10", {4, 5, 6, 7, 8, 9, 10}}, - {PREFIX, "%4 %5 %6 %7 %8 %9 %10 %11", {4, 5, 6, 7, 8, 9, 10, 11}}, - {PREFIX, "%4 %5 %6 %7 %8 %9 %10 %11 %12", - {4, 5, 6, 7, 8, 9, 10, 11, 12}}, - {PREFIX, "%4 %5 %6 %7 %8 %9 %10 %11 %12 %13", - {4, 5, 6, 7, 8, 9, 10, 11, 12, 13}}, - {PREFIX, "%4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14", - {4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}}, - })),); -#undef PREFIX - -INSTANTIATE_TEST_CASE_P( - OpenCLMiscPrefetch, ExtInstOpenCLStdRoundTripTest, - ::testing::ValuesIn(std::vector({ - CASE2(Prefetch, prefetch), - })),); - -// OpenCL.std: 2.9.1 Image encoding -// No new instructions defined in this section. - -// OpenCL.std: 2.9.2 Sampler encoding -// No new instructions defined in this section. - -// OpenCL.std: 2.9.3 Image read -// No new instructions defined in this section. -// Use core instruction OpImageSampleExplicitLod instead. - -// OpenCL.std: 2.9.4 Image write -// No new instructions defined in this section. - -// clang-format on - -#undef CASE1 -#undef CASE2 -#undef CASE3 -#undef CASE4 -#undef CASE2Lit -#undef CASE3Round - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/fix_word_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/fix_word_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/fix_word_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/fix_word_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -namespace { - -TEST(FixWord, Default) { - spv_endianness_t endian; - if (I32_ENDIAN_HOST == I32_ENDIAN_LITTLE) { - endian = SPV_ENDIANNESS_LITTLE; - } else { - endian = SPV_ENDIANNESS_BIG; - } - uint32_t word = 0x53780921; - ASSERT_EQ(word, spvFixWord(word, endian)); -} - -TEST(FixWord, Reorder) { - spv_endianness_t endian; - if (I32_ENDIAN_HOST == I32_ENDIAN_LITTLE) { - endian = SPV_ENDIANNESS_BIG; - } else { - endian = SPV_ENDIANNESS_LITTLE; - } - uint32_t word = 0x53780921; - uint32_t result = 0x21097853; - ASSERT_EQ(result, spvFixWord(word, endian)); -} - -TEST(FixDoubleWord, Default) { - spv_endianness_t endian = - (I32_ENDIAN_HOST == I32_ENDIAN_LITTLE ? SPV_ENDIANNESS_LITTLE - : SPV_ENDIANNESS_BIG); - uint32_t low = 0x53780921; - uint32_t high = 0xdeadbeef; - uint64_t result = 0xdeadbeef53780921; - ASSERT_EQ(result, spvFixDoubleWord(low, high, endian)); -} - -TEST(FixDoubleWord, Reorder) { - spv_endianness_t endian = - (I32_ENDIAN_HOST == I32_ENDIAN_LITTLE ? SPV_ENDIANNESS_BIG - : SPV_ENDIANNESS_LITTLE); - uint32_t low = 0x53780921; - uint32_t high = 0xdeadbeef; - uint64_t result = 0xefbeadde21097853; - ASSERT_EQ(result, spvFixDoubleWord(low, high, endian)); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/generator_magic_number_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/generator_magic_number_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/generator_magic_number_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/generator_magic_number_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -#include - -#include "source/opcode.h" - -using ::spvtest::EnumCase; -using ::testing::Eq; - -namespace { - -using GeneratorMagicNumberTest = - ::testing::TestWithParam>; - -TEST_P(GeneratorMagicNumberTest, Single) { - EXPECT_THAT(std::string(spvGeneratorStr(GetParam().value())), - GetParam().name()); -} - -INSTANTIATE_TEST_CASE_P( - Registered, GeneratorMagicNumberTest, - ::testing::ValuesIn(std::vector>{ - {SPV_GENERATOR_KHRONOS, "Khronos"}, - {SPV_GENERATOR_LUNARG, "LunarG"}, - {SPV_GENERATOR_VALVE, "Valve"}, - {SPV_GENERATOR_CODEPLAY, "Codeplay"}, - {SPV_GENERATOR_NVIDIA, "NVIDIA"}, - {SPV_GENERATOR_ARM, "ARM"}, - {SPV_GENERATOR_KHRONOS_LLVM_TRANSLATOR, - "Khronos LLVM/SPIR-V Translator"}, - {SPV_GENERATOR_KHRONOS_ASSEMBLER, "Khronos SPIR-V Tools Assembler"}, - {SPV_GENERATOR_KHRONOS_GLSLANG, "Khronos Glslang Reference Front End"}, - }),); - -INSTANTIATE_TEST_CASE_P( - Unregistered, GeneratorMagicNumberTest, - ::testing::ValuesIn(std::vector>{ - // We read registered entries from the SPIR-V XML Registry file - // which can change over time. - {spv_generator_t(1000), "Unknown"}, - {spv_generator_t(9999), "Unknown"}, - }),); -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/hex_float_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/hex_float_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/hex_float_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/hex_float_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1234 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include -#include -#include - -#include - -#include "source/util/hex_float.h" -#include "unit_spirv.h" - -namespace { -using ::testing::Eq; -using spvutils::BitwiseCast; -using spvutils::Float16; -using spvutils::FloatProxy; -using spvutils::HexFloat; -using spvutils::ParseNormalFloat; - -// In this file "encode" means converting a number into a string, -// and "decode" means converting a string into a number. - -using HexFloatTest = - ::testing::TestWithParam, std::string>>; -using DecodeHexFloatTest = - ::testing::TestWithParam>>; -using HexDoubleTest = - ::testing::TestWithParam, std::string>>; -using DecodeHexDoubleTest = - ::testing::TestWithParam>>; - -// Hex-encodes a float value. -template -std::string EncodeViaHexFloat(const T& value) { - std::stringstream ss; - ss << spvutils::HexFloat(value); - return ss.str(); -} - -// The following two tests can't be DRY because they take different parameter -// types. - -TEST_P(HexFloatTest, EncodeCorrectly) { - EXPECT_THAT(EncodeViaHexFloat(GetParam().first), Eq(GetParam().second)); -} - -TEST_P(HexDoubleTest, EncodeCorrectly) { - EXPECT_THAT(EncodeViaHexFloat(GetParam().first), Eq(GetParam().second)); -} - -// Decodes a hex-float string. -template -FloatProxy Decode(const std::string& str) { - spvutils::HexFloat> decoded(0.f); - EXPECT_TRUE((std::stringstream(str) >> decoded).eof()); - return decoded.value(); -} - -TEST_P(HexFloatTest, DecodeCorrectly) { - EXPECT_THAT(Decode(GetParam().second), Eq(GetParam().first)); -} - -TEST_P(HexDoubleTest, DecodeCorrectly) { - EXPECT_THAT(Decode(GetParam().second), Eq(GetParam().first)); -} - -INSTANTIATE_TEST_CASE_P( - Float32Tests, HexFloatTest, - ::testing::ValuesIn(std::vector, std::string>>({ - {0.f, "0x0p+0"}, - {1.f, "0x1p+0"}, - {2.f, "0x1p+1"}, - {3.f, "0x1.8p+1"}, - {0.5f, "0x1p-1"}, - {0.25f, "0x1p-2"}, - {0.75f, "0x1.8p-1"}, - {-0.f, "-0x0p+0"}, - {-1.f, "-0x1p+0"}, - {-0.5f, "-0x1p-1"}, - {-0.25f, "-0x1p-2"}, - {-0.75f, "-0x1.8p-1"}, - - // Larger numbers - {512.f, "0x1p+9"}, - {-512.f, "-0x1p+9"}, - {1024.f, "0x1p+10"}, - {-1024.f, "-0x1p+10"}, - {1024.f + 8.f, "0x1.02p+10"}, - {-1024.f - 8.f, "-0x1.02p+10"}, - - // Small numbers - {1.0f / 512.f, "0x1p-9"}, - {1.0f / -512.f, "-0x1p-9"}, - {1.0f / 1024.f, "0x1p-10"}, - {1.0f / -1024.f, "-0x1p-10"}, - {1.0f / 1024.f + 1.0f / 8.f, "0x1.02p-3"}, - {1.0f / -1024.f - 1.0f / 8.f, "-0x1.02p-3"}, - - // lowest non-denorm - {float(ldexp(1.0f, -126)), "0x1p-126"}, - {float(ldexp(-1.0f, -126)), "-0x1p-126"}, - - // Denormalized values - {float(ldexp(1.0f, -127)), "0x1p-127"}, - {float(ldexp(1.0f, -127) / 2.0f), "0x1p-128"}, - {float(ldexp(1.0f, -127) / 4.0f), "0x1p-129"}, - {float(ldexp(1.0f, -127) / 8.0f), "0x1p-130"}, - {float(ldexp(-1.0f, -127)), "-0x1p-127"}, - {float(ldexp(-1.0f, -127) / 2.0f), "-0x1p-128"}, - {float(ldexp(-1.0f, -127) / 4.0f), "-0x1p-129"}, - {float(ldexp(-1.0f, -127) / 8.0f), "-0x1p-130"}, - - {float(ldexp(1.0, -127) + (ldexp(1.0, -127) / 2.0f)), "0x1.8p-127"}, - {float(ldexp(1.0, -127) / 2.0 + (ldexp(1.0, -127) / 4.0f)), - "0x1.8p-128"}, - - })),); - -INSTANTIATE_TEST_CASE_P( - Float32NanTests, HexFloatTest, - ::testing::ValuesIn(std::vector, std::string>>({ - // Various NAN and INF cases - {uint32_t(0xFF800000), "-0x1p+128"}, // -inf - {uint32_t(0x7F800000), "0x1p+128"}, // inf - {uint32_t(0xFFC00000), "-0x1.8p+128"}, // -nan - {uint32_t(0xFF800100), "-0x1.0002p+128"}, // -nan - {uint32_t(0xFF800c00), "-0x1.0018p+128"}, // -nan - {uint32_t(0xFF80F000), "-0x1.01ep+128"}, // -nan - {uint32_t(0xFFFFFFFF), "-0x1.fffffep+128"}, // -nan - {uint32_t(0x7FC00000), "0x1.8p+128"}, // +nan - {uint32_t(0x7F800100), "0x1.0002p+128"}, // +nan - {uint32_t(0x7f800c00), "0x1.0018p+128"}, // +nan - {uint32_t(0x7F80F000), "0x1.01ep+128"}, // +nan - {uint32_t(0x7FFFFFFF), "0x1.fffffep+128"}, // +nan - })),); - -INSTANTIATE_TEST_CASE_P( - Float64Tests, HexDoubleTest, - ::testing::ValuesIn( - std::vector, std::string>>({ - {0., "0x0p+0"}, - {1., "0x1p+0"}, - {2., "0x1p+1"}, - {3., "0x1.8p+1"}, - {0.5, "0x1p-1"}, - {0.25, "0x1p-2"}, - {0.75, "0x1.8p-1"}, - {-0., "-0x0p+0"}, - {-1., "-0x1p+0"}, - {-0.5, "-0x1p-1"}, - {-0.25, "-0x1p-2"}, - {-0.75, "-0x1.8p-1"}, - - // Larger numbers - {512., "0x1p+9"}, - {-512., "-0x1p+9"}, - {1024., "0x1p+10"}, - {-1024., "-0x1p+10"}, - {1024. + 8., "0x1.02p+10"}, - {-1024. - 8., "-0x1.02p+10"}, - - // Large outside the range of normal floats - {ldexp(1.0, 128), "0x1p+128"}, - {ldexp(1.0, 129), "0x1p+129"}, - {ldexp(-1.0, 128), "-0x1p+128"}, - {ldexp(-1.0, 129), "-0x1p+129"}, - {ldexp(1.0, 128) + ldexp(1.0, 90), "0x1.0000000004p+128"}, - {ldexp(1.0, 129) + ldexp(1.0, 120), "0x1.008p+129"}, - {ldexp(-1.0, 128) + ldexp(1.0, 90), "-0x1.fffffffff8p+127"}, - {ldexp(-1.0, 129) + ldexp(1.0, 120), "-0x1.ffp+128"}, - - // Small numbers - {1.0 / 512., "0x1p-9"}, - {1.0 / -512., "-0x1p-9"}, - {1.0 / 1024., "0x1p-10"}, - {1.0 / -1024., "-0x1p-10"}, - {1.0 / 1024. + 1.0 / 8., "0x1.02p-3"}, - {1.0 / -1024. - 1.0 / 8., "-0x1.02p-3"}, - - // Small outside the range of normal floats - {ldexp(1.0, -128), "0x1p-128"}, - {ldexp(1.0, -129), "0x1p-129"}, - {ldexp(-1.0, -128), "-0x1p-128"}, - {ldexp(-1.0, -129), "-0x1p-129"}, - {ldexp(1.0, -128) + ldexp(1.0, -90), "0x1.0000000004p-90"}, - {ldexp(1.0, -129) + ldexp(1.0, -120), "0x1.008p-120"}, - {ldexp(-1.0, -128) + ldexp(1.0, -90), "0x1.fffffffff8p-91"}, - {ldexp(-1.0, -129) + ldexp(1.0, -120), "0x1.ffp-121"}, - - // lowest non-denorm - {ldexp(1.0, -1022), "0x1p-1022"}, - {ldexp(-1.0, -1022), "-0x1p-1022"}, - - // Denormalized values - {ldexp(1.0, -1023), "0x1p-1023"}, - {ldexp(1.0, -1023) / 2.0, "0x1p-1024"}, - {ldexp(1.0, -1023) / 4.0, "0x1p-1025"}, - {ldexp(1.0, -1023) / 8.0, "0x1p-1026"}, - {ldexp(-1.0, -1024), "-0x1p-1024"}, - {ldexp(-1.0, -1024) / 2.0, "-0x1p-1025"}, - {ldexp(-1.0, -1024) / 4.0, "-0x1p-1026"}, - {ldexp(-1.0, -1024) / 8.0, "-0x1p-1027"}, - - {ldexp(1.0, -1023) + (ldexp(1.0, -1023) / 2.0), "0x1.8p-1023"}, - {ldexp(1.0, -1023) / 2.0 + (ldexp(1.0, -1023) / 4.0), - "0x1.8p-1024"}, - - })),); - -INSTANTIATE_TEST_CASE_P( - Float64NanTests, HexDoubleTest, - ::testing::ValuesIn(std::vector< - std::pair, std::string>>({ - // Various NAN and INF cases - {uint64_t(0xFFF0000000000000LL), "-0x1p+1024"}, //-inf - {uint64_t(0x7FF0000000000000LL), "0x1p+1024"}, //+inf - {uint64_t(0xFFF8000000000000LL), "-0x1.8p+1024"}, // -nan - {uint64_t(0xFFF0F00000000000LL), "-0x1.0fp+1024"}, // -nan - {uint64_t(0xFFF0000000000001LL), "-0x1.0000000000001p+1024"}, // -nan - {uint64_t(0xFFF0000300000000LL), "-0x1.00003p+1024"}, // -nan - {uint64_t(0xFFFFFFFFFFFFFFFFLL), "-0x1.fffffffffffffp+1024"}, // -nan - {uint64_t(0x7FF8000000000000LL), "0x1.8p+1024"}, // +nan - {uint64_t(0x7FF0F00000000000LL), "0x1.0fp+1024"}, // +nan - {uint64_t(0x7FF0000000000001LL), "0x1.0000000000001p+1024"}, // -nan - {uint64_t(0x7FF0000300000000LL), "0x1.00003p+1024"}, // -nan - {uint64_t(0x7FFFFFFFFFFFFFFFLL), "0x1.fffffffffffffp+1024"}, // -nan - })),); - -TEST(HexFloatStreamTest, OperatorLeftShiftPreservesFloatAndFill) { - std::stringstream s; - s << std::setw(4) << std::oct << std::setfill('x') << 8 << " " - << FloatProxy(uint32_t(0xFF800100)) << " " << std::setw(4) << 9; - EXPECT_THAT(s.str(), Eq(std::string("xx10 -0x1.0002p+128 xx11"))); -} - -TEST(HexDoubleStreamTest, OperatorLeftShiftPreservesFloatAndFill) { - std::stringstream s; - s << std::setw(4) << std::oct << std::setfill('x') << 8 << " " - << FloatProxy(uint64_t(0x7FF0F00000000000LL)) << " " << std::setw(4) - << 9; - EXPECT_THAT(s.str(), Eq(std::string("xx10 0x1.0fp+1024 xx11"))); -} - -TEST_P(DecodeHexFloatTest, DecodeCorrectly) { - EXPECT_THAT(Decode(GetParam().first), Eq(GetParam().second)); -} - -TEST_P(DecodeHexDoubleTest, DecodeCorrectly) { - EXPECT_THAT(Decode(GetParam().first), Eq(GetParam().second)); -} - -INSTANTIATE_TEST_CASE_P( - Float32DecodeTests, DecodeHexFloatTest, - ::testing::ValuesIn(std::vector>>({ - {"0x0p+000", 0.f}, - {"0x0p0", 0.f}, - {"0x0p-0", 0.f}, - - // flush to zero cases - {"0x1p-500", 0.f}, // Exponent underflows. - {"-0x1p-500", -0.f}, - {"0x0.00000000001p-126", 0.f}, // Fraction causes underflow. - {"-0x0.0000000001p-127", -0.f}, - {"-0x0.01p-142", -0.f}, // Fraction causes additional underflow. - {"0x0.01p-142", 0.f}, - - // Some floats that do not encode the same way as they decode. - {"0x2p+0", 2.f}, - {"0xFFp+0", 255.f}, - {"0x0.8p+0", 0.5f}, - {"0x0.4p+0", 0.25f}, - })),); - -INSTANTIATE_TEST_CASE_P( - Float32DecodeInfTests, DecodeHexFloatTest, - ::testing::ValuesIn(std::vector>>({ - // inf cases - {"-0x1p+128", uint32_t(0xFF800000)}, // -inf - {"0x32p+127", uint32_t(0x7F800000)}, // inf - {"0x32p+500", uint32_t(0x7F800000)}, // inf - {"-0x32p+127", uint32_t(0xFF800000)}, // -inf - })),); - -INSTANTIATE_TEST_CASE_P( - Float64DecodeTests, DecodeHexDoubleTest, - ::testing::ValuesIn( - std::vector>>({ - {"0x0p+000", 0.}, - {"0x0p0", 0.}, - {"0x0p-0", 0.}, - - // flush to zero cases - {"0x1p-5000", 0.}, // Exponent underflows. - {"-0x1p-5000", -0.}, - {"0x0.0000000000000001p-1023", 0.}, // Fraction causes underflow. - {"-0x0.000000000000001p-1024", -0.}, - {"-0x0.01p-1090", -0.f}, // Fraction causes additional underflow. - {"0x0.01p-1090", 0.}, - - // Some floats that do not encode the same way as they decode. - {"0x2p+0", 2.}, - {"0xFFp+0", 255.}, - {"0x0.8p+0", 0.5}, - {"0x0.4p+0", 0.25}, - })),); - -INSTANTIATE_TEST_CASE_P( - Float64DecodeInfTests, DecodeHexDoubleTest, - ::testing::ValuesIn( - std::vector>>({ - // inf cases - {"-0x1p+1024", uint64_t(0xFFF0000000000000)}, // -inf - {"0x32p+1023", uint64_t(0x7FF0000000000000)}, // inf - {"0x32p+5000", uint64_t(0x7FF0000000000000)}, // inf - {"-0x32p+1023", uint64_t(0xFFF0000000000000)}, // -inf - })),); - -TEST(FloatProxy, ValidConversion) { - EXPECT_THAT(FloatProxy(1.f).getAsFloat(), Eq(1.0f)); - EXPECT_THAT(FloatProxy(32.f).getAsFloat(), Eq(32.0f)); - EXPECT_THAT(FloatProxy(-1.f).getAsFloat(), Eq(-1.0f)); - EXPECT_THAT(FloatProxy(0.f).getAsFloat(), Eq(0.0f)); - EXPECT_THAT(FloatProxy(-0.f).getAsFloat(), Eq(-0.0f)); - EXPECT_THAT(FloatProxy(1.2e32f).getAsFloat(), Eq(1.2e32f)); - - EXPECT_TRUE(std::isinf(FloatProxy(uint32_t(0xFF800000)).getAsFloat())); - EXPECT_TRUE(std::isinf(FloatProxy(uint32_t(0x7F800000)).getAsFloat())); - EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0xFFC00000)).getAsFloat())); - EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0xFF800100)).getAsFloat())); - EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0xFF800c00)).getAsFloat())); - EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0xFF80F000)).getAsFloat())); - EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0xFFFFFFFF)).getAsFloat())); - EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0x7FC00000)).getAsFloat())); - EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0x7F800100)).getAsFloat())); - EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0x7f800c00)).getAsFloat())); - EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0x7F80F000)).getAsFloat())); - EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0x7FFFFFFF)).getAsFloat())); - - EXPECT_THAT(FloatProxy(uint32_t(0xFF800000)).data(), Eq(0xFF800000u)); - EXPECT_THAT(FloatProxy(uint32_t(0x7F800000)).data(), Eq(0x7F800000u)); - EXPECT_THAT(FloatProxy(uint32_t(0xFFC00000)).data(), Eq(0xFFC00000u)); - EXPECT_THAT(FloatProxy(uint32_t(0xFF800100)).data(), Eq(0xFF800100u)); - EXPECT_THAT(FloatProxy(uint32_t(0xFF800c00)).data(), Eq(0xFF800c00u)); - EXPECT_THAT(FloatProxy(uint32_t(0xFF80F000)).data(), Eq(0xFF80F000u)); - EXPECT_THAT(FloatProxy(uint32_t(0xFFFFFFFF)).data(), Eq(0xFFFFFFFFu)); - EXPECT_THAT(FloatProxy(uint32_t(0x7FC00000)).data(), Eq(0x7FC00000u)); - EXPECT_THAT(FloatProxy(uint32_t(0x7F800100)).data(), Eq(0x7F800100u)); - EXPECT_THAT(FloatProxy(uint32_t(0x7f800c00)).data(), Eq(0x7f800c00u)); - EXPECT_THAT(FloatProxy(uint32_t(0x7F80F000)).data(), Eq(0x7F80F000u)); - EXPECT_THAT(FloatProxy(uint32_t(0x7FFFFFFF)).data(), Eq(0x7FFFFFFFu)); -} - -TEST(FloatProxy, Nan) { - EXPECT_TRUE(FloatProxy(uint32_t(0xFFC00000)).isNan()); - EXPECT_TRUE(FloatProxy(uint32_t(0xFF800100)).isNan()); - EXPECT_TRUE(FloatProxy(uint32_t(0xFF800c00)).isNan()); - EXPECT_TRUE(FloatProxy(uint32_t(0xFF80F000)).isNan()); - EXPECT_TRUE(FloatProxy(uint32_t(0xFFFFFFFF)).isNan()); - EXPECT_TRUE(FloatProxy(uint32_t(0x7FC00000)).isNan()); - EXPECT_TRUE(FloatProxy(uint32_t(0x7F800100)).isNan()); - EXPECT_TRUE(FloatProxy(uint32_t(0x7f800c00)).isNan()); - EXPECT_TRUE(FloatProxy(uint32_t(0x7F80F000)).isNan()); - EXPECT_TRUE(FloatProxy(uint32_t(0x7FFFFFFF)).isNan()); -} - -TEST(FloatProxy, Negation) { - EXPECT_THAT((-FloatProxy(1.f)).getAsFloat(), Eq(-1.0f)); - EXPECT_THAT((-FloatProxy(0.f)).getAsFloat(), Eq(-0.0f)); - - EXPECT_THAT((-FloatProxy(-1.f)).getAsFloat(), Eq(1.0f)); - EXPECT_THAT((-FloatProxy(-0.f)).getAsFloat(), Eq(0.0f)); - - EXPECT_THAT((-FloatProxy(32.f)).getAsFloat(), Eq(-32.0f)); - EXPECT_THAT((-FloatProxy(-32.f)).getAsFloat(), Eq(32.0f)); - - EXPECT_THAT((-FloatProxy(1.2e32f)).getAsFloat(), Eq(-1.2e32f)); - EXPECT_THAT((-FloatProxy(-1.2e32f)).getAsFloat(), Eq(1.2e32f)); - - EXPECT_THAT( - (-FloatProxy(std::numeric_limits::infinity())).getAsFloat(), - Eq(-std::numeric_limits::infinity())); - EXPECT_THAT((-FloatProxy(-std::numeric_limits::infinity())) - .getAsFloat(), - Eq(std::numeric_limits::infinity())); -} - -// Test conversion of FloatProxy values to strings. -// -// In previous cases, we always wrapped the FloatProxy value in a HexFloat -// before conversion to a string. In the following cases, the FloatProxy -// decides for itself whether to print as a regular number or as a hex float. - -using FloatProxyFloatTest = - ::testing::TestWithParam, std::string>>; -using FloatProxyDoubleTest = - ::testing::TestWithParam, std::string>>; - -// Converts a float value to a string via a FloatProxy. -template -std::string EncodeViaFloatProxy(const T& value) { - std::stringstream ss; - ss << value; - return ss.str(); -} - -// Converts a floating point string so that the exponent prefix -// is 'e', and the exponent value does not have leading zeros. -// The Microsoft runtime library likes to write things like "2.5E+010". -// Convert that to "2.5e+10". -// We don't care what happens to strings that are not floating point -// strings. -std::string NormalizeExponentInFloatString(std::string in) { - std::string result; - // Reserve one spot for the terminating null, even when the sscanf fails. - std::vector prefix(in.size() + 1); - char e; - char plus_or_minus; - int exponent; // in base 10 - if ((4 == std::sscanf(in.c_str(), "%[-+.0123456789]%c%c%d", prefix.data(), &e, - &plus_or_minus, &exponent)) && - (e == 'e' || e == 'E') && - (plus_or_minus == '-' || plus_or_minus == '+')) { - // It looks like a floating point value with exponent. - std::stringstream out; - out << prefix.data() << 'e' << plus_or_minus << exponent; - result = out.str(); - } else { - result = in; - } - return result; -} - -TEST(NormalizeFloat, Sample) { - EXPECT_THAT(NormalizeExponentInFloatString(""), Eq("")); - EXPECT_THAT(NormalizeExponentInFloatString("1e-12"), Eq("1e-12")); - EXPECT_THAT(NormalizeExponentInFloatString("1E+14"), Eq("1e+14")); - EXPECT_THAT(NormalizeExponentInFloatString("1e-0012"), Eq("1e-12")); - EXPECT_THAT(NormalizeExponentInFloatString("1.263E+014"), Eq("1.263e+14")); -} - -// The following two tests can't be DRY because they take different parameter -// types. -TEST_P(FloatProxyFloatTest, EncodeCorrectly) { - EXPECT_THAT( - NormalizeExponentInFloatString(EncodeViaFloatProxy(GetParam().first)), - Eq(GetParam().second)); -} - -TEST_P(FloatProxyDoubleTest, EncodeCorrectly) { - EXPECT_THAT( - NormalizeExponentInFloatString(EncodeViaFloatProxy(GetParam().first)), - Eq(GetParam().second)); -} - -INSTANTIATE_TEST_CASE_P( - Float32Tests, FloatProxyFloatTest, - ::testing::ValuesIn(std::vector, std::string>>({ - // Zero - {0.f, "0"}, - // Normal numbers - {1.f, "1"}, - {-0.25f, "-0.25"}, - {1000.0f, "1000"}, - - // Still normal numbers, but with large magnitude exponents. - {float(ldexp(1.f, 126)), "8.50706e+37"}, - {float(ldexp(-1.f, -126)), "-1.17549e-38"}, - - // denormalized values are printed as hex floats. - {float(ldexp(1.0f, -127)), "0x1p-127"}, - {float(ldexp(1.5f, -128)), "0x1.8p-128"}, - {float(ldexp(1.25, -129)), "0x1.4p-129"}, - {float(ldexp(1.125, -130)), "0x1.2p-130"}, - {float(ldexp(-1.0f, -127)), "-0x1p-127"}, - {float(ldexp(-1.0f, -128)), "-0x1p-128"}, - {float(ldexp(-1.0f, -129)), "-0x1p-129"}, - {float(ldexp(-1.5f, -130)), "-0x1.8p-130"}, - - // NaNs - {FloatProxy(uint32_t(0xFFC00000)), "-0x1.8p+128"}, - {FloatProxy(uint32_t(0xFF800100)), "-0x1.0002p+128"}, - - {std::numeric_limits::infinity(), "0x1p+128"}, - {-std::numeric_limits::infinity(), "-0x1p+128"}, - })),); - -INSTANTIATE_TEST_CASE_P( - Float64Tests, FloatProxyDoubleTest, - ::testing::ValuesIn( - std::vector, std::string>>({ - {0., "0"}, - {1., "1"}, - {-0.25, "-0.25"}, - {1000.0, "1000"}, - - // Large outside the range of normal floats - {ldexp(1.0, 128), "3.40282366920938e+38"}, - {ldexp(1.5, 129), "1.02084710076282e+39"}, - {ldexp(-1.0, 128), "-3.40282366920938e+38"}, - {ldexp(-1.5, 129), "-1.02084710076282e+39"}, - - // Small outside the range of normal floats - {ldexp(1.5, -129), "2.20405190779179e-39"}, - {ldexp(-1.5, -129), "-2.20405190779179e-39"}, - - // lowest non-denorm - {ldexp(1.0, -1022), "2.2250738585072e-308"}, - {ldexp(-1.0, -1022), "-2.2250738585072e-308"}, - - // Denormalized values - {ldexp(1.125, -1023), "0x1.2p-1023"}, - {ldexp(-1.375, -1024), "-0x1.6p-1024"}, - - // NaNs - {uint64_t(0x7FF8000000000000LL), "0x1.8p+1024"}, - {uint64_t(0xFFF0F00000000000LL), "-0x1.0fp+1024"}, - - // Infinity - {std::numeric_limits::infinity(), "0x1p+1024"}, - {-std::numeric_limits::infinity(), "-0x1p+1024"}, - - })),); - -// double is used so that unbiased_exponent can be used with the output -// of ldexp directly. -int32_t unbiased_exponent(double f) { - return spvutils::HexFloat>( - static_cast(f)).getUnbiasedNormalizedExponent(); -} - -int16_t unbiased_half_exponent(uint16_t f) { - return spvutils::HexFloat>(f) - .getUnbiasedNormalizedExponent(); -} - -TEST(HexFloatOperationTest, UnbiasedExponent) { - // Float cases - EXPECT_EQ(0, unbiased_exponent(ldexp(1.0f, 0))); - EXPECT_EQ(-32, unbiased_exponent(ldexp(1.0f, -32))); - EXPECT_EQ(42, unbiased_exponent(ldexp(1.0f, 42))); - EXPECT_EQ(125, unbiased_exponent(ldexp(1.0f, 125))); - // Saturates to 128 - EXPECT_EQ(128, unbiased_exponent(ldexp(1.0f, 256))); - - EXPECT_EQ(-100, unbiased_exponent(ldexp(1.0f, -100))); - EXPECT_EQ(-127, unbiased_exponent(ldexp(1.0f, -127))); // First denorm - EXPECT_EQ(-128, unbiased_exponent(ldexp(1.0f, -128))); - EXPECT_EQ(-129, unbiased_exponent(ldexp(1.0f, -129))); - EXPECT_EQ(-140, unbiased_exponent(ldexp(1.0f, -140))); - // Smallest representable number - EXPECT_EQ(-126 - 23, unbiased_exponent(ldexp(1.0f, -126 - 23))); - // Should get rounded to 0 first. - EXPECT_EQ(0, unbiased_exponent(ldexp(1.0f, -127 - 23))); - - // Float16 cases - // The exponent is represented in the bits 0x7C00 - // The offset is -15 - EXPECT_EQ(0, unbiased_half_exponent(0x3C00)); - EXPECT_EQ(3, unbiased_half_exponent(0x4800)); - EXPECT_EQ(-1, unbiased_half_exponent(0x3800)); - EXPECT_EQ(-14, unbiased_half_exponent(0x0400)); - EXPECT_EQ(16, unbiased_half_exponent(0x7C00)); - EXPECT_EQ(10, unbiased_half_exponent(0x6400)); - - // Smallest representable number - EXPECT_EQ(-24, unbiased_half_exponent(0x0001)); -} - -// Creates a float that is the sum of 1/(2 ^ fractions[i]) for i in factions -float float_fractions(const std::vector& fractions) { - float f = 0; - for(int32_t i: fractions) { - f += std::ldexp(1.0f, -i); - } - return f; -} - -// Returns the normalized significand of a HexFloat> -// that was created by calling float_fractions with the input fractions, -// raised to the power of exp. -uint32_t normalized_significand(const std::vector& fractions, uint32_t exp) { - return spvutils::HexFloat>( - static_cast(ldexp(float_fractions(fractions), exp))) - .getNormalizedSignificand(); -} - -// Sets the bits from MSB to LSB of the significand part of a float. -// For example 0 would set the bit 23 (counting from LSB to MSB), -// and 1 would set the 22nd bit. -uint32_t bits_set(const std::vector& bits) { - const uint32_t top_bit = 1u << 22u; - uint32_t val= 0; - for(uint32_t i: bits) { - val |= top_bit >> i; - } - return val; -} - -// The same as bits_set but for a Float16 value instead of 32-bit floating -// point. -uint16_t half_bits_set(const std::vector& bits) { - const uint32_t top_bit = 1u << 9u; - uint32_t val= 0; - for(uint32_t i: bits) { - val |= top_bit >> i; - } - return static_cast(val); -} - -TEST(HexFloatOperationTest, NormalizedSignificand) { - // For normalized numbers (the following) it should be a simple matter - // of getting rid of the top implicit bit - EXPECT_EQ(bits_set({}), normalized_significand({0}, 0)); - EXPECT_EQ(bits_set({0}), normalized_significand({0, 1}, 0)); - EXPECT_EQ(bits_set({0, 1}), normalized_significand({0, 1, 2}, 0)); - EXPECT_EQ(bits_set({1}), normalized_significand({0, 2}, 0)); - EXPECT_EQ(bits_set({1}), normalized_significand({0, 2}, 32)); - EXPECT_EQ(bits_set({1}), normalized_significand({0, 2}, 126)); - - // For denormalized numbers we expect the normalized significand to - // shift as if it were normalized. This means, in practice that the - // top_most set bit will be cut off. Looks very similar to above (on purpose) - EXPECT_EQ(bits_set({}), normalized_significand({0}, -127)); - EXPECT_EQ(bits_set({3}), normalized_significand({0, 4}, -128)); - EXPECT_EQ(bits_set({3}), normalized_significand({0, 4}, -127)); - EXPECT_EQ(bits_set({}), normalized_significand({22}, -127)); - EXPECT_EQ(bits_set({0}), normalized_significand({21, 22}, -127)); -} - -// Returns the 32-bit floating point value created by -// calling setFromSignUnbiasedExponentAndNormalizedSignificand -// on a HexFloat> -float set_from_sign(bool negative, int32_t unbiased_exponent, - uint32_t significand, bool round_denorm_up) { - spvutils::HexFloat> f(0.f); - f.setFromSignUnbiasedExponentAndNormalizedSignificand( - negative, unbiased_exponent, significand, round_denorm_up); - return f.value().getAsFloat(); -} - -TEST(HexFloatOperationTests, - SetFromSignUnbiasedExponentAndNormalizedSignificand) { - - EXPECT_EQ(1.f, set_from_sign(false, 0, 0, false)); - - // Tests insertion of various denormalized numbers with and without round up. - EXPECT_EQ(static_cast(ldexp(1.f, -149)), set_from_sign(false, -149, 0, false)); - EXPECT_EQ(static_cast(ldexp(1.f, -149)), set_from_sign(false, -149, 0, true)); - EXPECT_EQ(0.f, set_from_sign(false, -150, 1, false)); - EXPECT_EQ(static_cast(ldexp(1.f, -149)), set_from_sign(false, -150, 1, true)); - - EXPECT_EQ(ldexp(1.0f, -127), set_from_sign(false, -127, 0, false)); - EXPECT_EQ(ldexp(1.0f, -128), set_from_sign(false, -128, 0, false)); - EXPECT_EQ(float_fractions({0, 1, 2, 5}), - set_from_sign(false, 0, bits_set({0, 1, 4}), false)); - EXPECT_EQ(ldexp(float_fractions({0, 1, 2, 5}), -32), - set_from_sign(false, -32, bits_set({0, 1, 4}), false)); - EXPECT_EQ(ldexp(float_fractions({0, 1, 2, 5}), -128), - set_from_sign(false, -128, bits_set({0, 1, 4}), false)); - - // The negative cases from above. - EXPECT_EQ(-1.f, set_from_sign(true, 0, 0, false)); - EXPECT_EQ(-ldexp(1.0, -127), set_from_sign(true, -127, 0, false)); - EXPECT_EQ(-ldexp(1.0, -128), set_from_sign(true, -128, 0, false)); - EXPECT_EQ(-float_fractions({0, 1, 2, 5}), - set_from_sign(true, 0, bits_set({0, 1, 4}), false)); - EXPECT_EQ(-ldexp(float_fractions({0, 1, 2, 5}), -32), - set_from_sign(true, -32, bits_set({0, 1, 4}), false)); - EXPECT_EQ(-ldexp(float_fractions({0, 1, 2, 5}), -128), - set_from_sign(true, -128, bits_set({0, 1, 4}), false)); -} - -TEST(HexFloatOperationTests, NonRounding) { - // Rounding from 32-bit hex-float to 32-bit hex-float should be trivial, - // except in the denorm case which is a bit more complex. - using HF = spvutils::HexFloat>; - bool carry_bit = false; - - spvutils::round_direction rounding[] = { - spvutils::round_direction::kToZero, - spvutils::round_direction::kToNearestEven, - spvutils::round_direction::kToPositiveInfinity, - spvutils::round_direction::kToNegativeInfinity}; - - // Everything fits, so this should be straight-forward - for (spvutils::round_direction round : rounding) { - EXPECT_EQ(bits_set({}), HF(0.f).getRoundedNormalizedSignificand( - round, &carry_bit)); - EXPECT_FALSE(carry_bit); - - EXPECT_EQ(bits_set({0}), - HF(float_fractions({0, 1})) - .getRoundedNormalizedSignificand(round, &carry_bit)); - EXPECT_FALSE(carry_bit); - - EXPECT_EQ(bits_set({1, 3}), - HF(float_fractions({0, 2, 4})) - .getRoundedNormalizedSignificand(round, &carry_bit)); - EXPECT_FALSE(carry_bit); - - EXPECT_EQ( - bits_set({0, 1, 4}), - HF(static_cast(-ldexp(float_fractions({0, 1, 2, 5}), -128))) - .getRoundedNormalizedSignificand(round, &carry_bit)); - EXPECT_FALSE(carry_bit); - - EXPECT_EQ( - bits_set({0, 1, 4, 22}), - HF(static_cast(float_fractions({0, 1, 2, 5, 23}))) - .getRoundedNormalizedSignificand(round, &carry_bit)); - EXPECT_FALSE(carry_bit); - } -} - -using RD = spvutils::round_direction; -struct RoundSignificandCase { - float source_float; - std::pair expected_results; - spvutils::round_direction round; -}; - -using HexFloatRoundTest = - ::testing::TestWithParam; - -TEST_P(HexFloatRoundTest, RoundDownToFP16) { - using HF = spvutils::HexFloat>; - using HF16 = spvutils::HexFloat>; - - HF input_value(GetParam().source_float); - bool carry_bit = false; - EXPECT_EQ(GetParam().expected_results.first, - input_value.getRoundedNormalizedSignificand( - GetParam().round, &carry_bit)); - EXPECT_EQ(carry_bit, GetParam().expected_results.second); -} - -// clang-format off -INSTANTIATE_TEST_CASE_P(F32ToF16, HexFloatRoundTest, - ::testing::ValuesIn(std::vector( - { - {float_fractions({0}), std::make_pair(half_bits_set({}), false), RD::kToZero}, - {float_fractions({0}), std::make_pair(half_bits_set({}), false), RD::kToNearestEven}, - {float_fractions({0}), std::make_pair(half_bits_set({}), false), RD::kToPositiveInfinity}, - {float_fractions({0}), std::make_pair(half_bits_set({}), false), RD::kToNegativeInfinity}, - {float_fractions({0, 1}), std::make_pair(half_bits_set({0}), false), RD::kToZero}, - - {float_fractions({0, 1, 11}), std::make_pair(half_bits_set({0}), false), RD::kToZero}, - {float_fractions({0, 1, 11}), std::make_pair(half_bits_set({0, 9}), false), RD::kToPositiveInfinity}, - {float_fractions({0, 1, 11}), std::make_pair(half_bits_set({0}), false), RD::kToNegativeInfinity}, - {float_fractions({0, 1, 11}), std::make_pair(half_bits_set({0}), false), RD::kToNearestEven}, - - {float_fractions({0, 1, 10, 11}), std::make_pair(half_bits_set({0, 9}), false), RD::kToZero}, - {float_fractions({0, 1, 10, 11}), std::make_pair(half_bits_set({0, 8}), false), RD::kToPositiveInfinity}, - {float_fractions({0, 1, 10, 11}), std::make_pair(half_bits_set({0, 9}), false), RD::kToNegativeInfinity}, - {float_fractions({0, 1, 10, 11}), std::make_pair(half_bits_set({0, 8}), false), RD::kToNearestEven}, - - {float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0}), false), RD::kToZero}, - {float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0, 9}), false), RD::kToPositiveInfinity}, - {float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0}), false), RD::kToNegativeInfinity}, - {float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0, 9}), false), RD::kToNearestEven}, - - {-float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0}), false), RD::kToZero}, - {-float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0}), false), RD::kToPositiveInfinity}, - {-float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0, 9}), false), RD::kToNegativeInfinity}, - {-float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0, 9}), false), RD::kToNearestEven}, - - {float_fractions({0, 1, 11, 22}), std::make_pair(half_bits_set({0}), false), RD::kToZero}, - {float_fractions({0, 1, 11, 22}), std::make_pair(half_bits_set({0, 9}), false), RD::kToPositiveInfinity}, - {float_fractions({0, 1, 11, 22}), std::make_pair(half_bits_set({0}), false), RD::kToNegativeInfinity}, - {float_fractions({0, 1, 11, 22}), std::make_pair(half_bits_set({0, 9}), false), RD::kToNearestEven}, - - // Carries - {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(half_bits_set({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}), false), RD::kToZero}, - {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(half_bits_set({}), true), RD::kToPositiveInfinity}, - {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(half_bits_set({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}), false), RD::kToNegativeInfinity}, - {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(half_bits_set({}), true), RD::kToNearestEven}, - - // Cases where original number was denorm. Note: this should have no effect - // the number is pre-normalized. - {static_cast(ldexp(float_fractions({0, 1, 11, 13}), -128)), std::make_pair(half_bits_set({0}), false), RD::kToZero}, - {static_cast(ldexp(float_fractions({0, 1, 11, 13}), -129)), std::make_pair(half_bits_set({0, 9}), false), RD::kToPositiveInfinity}, - {static_cast(ldexp(float_fractions({0, 1, 11, 13}), -131)), std::make_pair(half_bits_set({0}), false), RD::kToNegativeInfinity}, - {static_cast(ldexp(float_fractions({0, 1, 11, 13}), -130)), std::make_pair(half_bits_set({0, 9}), false), RD::kToNearestEven}, - })),); -// clang-format on - -struct UpCastSignificandCase { - uint16_t source_half; - uint32_t expected_result; -}; - -using HexFloatRoundUpSignificandTest = - ::testing::TestWithParam; -TEST_P(HexFloatRoundUpSignificandTest, Widening) { - using HF = spvutils::HexFloat>; - using HF16 = spvutils::HexFloat>; - bool carry_bit = false; - - spvutils::round_direction rounding[] = { - spvutils::round_direction::kToZero, - spvutils::round_direction::kToNearestEven, - spvutils::round_direction::kToPositiveInfinity, - spvutils::round_direction::kToNegativeInfinity}; - - // Everything fits, so everything should just be bit-shifts. - for (spvutils::round_direction round : rounding) { - carry_bit = false; - HF16 input_value(GetParam().source_half); - EXPECT_EQ( - GetParam().expected_result, - input_value.getRoundedNormalizedSignificand(round, &carry_bit)) - << std::hex << "0x" - << input_value.getRoundedNormalizedSignificand(round, &carry_bit) - << " 0x" << GetParam().expected_result; - EXPECT_FALSE(carry_bit); - } -} - -INSTANTIATE_TEST_CASE_P(F16toF32, HexFloatRoundUpSignificandTest, - // 0xFC00 of the source 16-bit hex value cover the sign and the exponent. - // They are ignored for this test. - ::testing::ValuesIn(std::vector( - { - {0x3F00, 0x600000}, - {0x0F00, 0x600000}, - {0x0F01, 0x602000}, - {0x0FFF, 0x7FE000}, - })),); - -struct DownCastTest { - float source_float; - uint16_t expected_half; - std::vector directions; -}; - -std::string get_round_text(spvutils::round_direction direction) { -#define CASE(round_direction) \ - case round_direction: \ - return #round_direction - - switch (direction) { - CASE(spvutils::round_direction::kToZero); - CASE(spvutils::round_direction::kToPositiveInfinity); - CASE(spvutils::round_direction::kToNegativeInfinity); - CASE(spvutils::round_direction::kToNearestEven); - } -#undef CASE - return ""; -} - -using HexFloatFP32To16Tests = ::testing::TestWithParam; - -TEST_P(HexFloatFP32To16Tests, NarrowingCasts) { - using HF = spvutils::HexFloat>; - using HF16 = spvutils::HexFloat>; - HF f(GetParam().source_float); - for (auto round : GetParam().directions) { - HF16 half(0); - f.castTo(half, round); - EXPECT_EQ(GetParam().expected_half, half.value().getAsFloat().get_value()) - << get_round_text(round) << " " << std::hex - << spvutils::BitwiseCast(GetParam().source_float) - << " cast to: " << half.value().getAsFloat().get_value(); - } -} - -const uint16_t positive_infinity = 0x7C00; -const uint16_t negative_infinity = 0xFC00; - -INSTANTIATE_TEST_CASE_P(F32ToF16, HexFloatFP32To16Tests, - ::testing::ValuesIn(std::vector( - { - // Exactly representable as half. - {0.f, 0x0, {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, RD::kToNearestEven}}, - {-0.f, 0x8000, {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, RD::kToNearestEven}}, - {1.0f, 0x3C00, {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, RD::kToNearestEven}}, - {-1.0f, 0xBC00, {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, RD::kToNearestEven}}, - - {float_fractions({0, 1, 10}) , 0x3E01, {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, RD::kToNearestEven}}, - {-float_fractions({0, 1, 10}) , 0xBE01, {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, RD::kToNearestEven}}, - {static_cast(ldexp(float_fractions({0, 1, 10}), 3)), 0x4A01, {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, RD::kToNearestEven}}, - {static_cast(-ldexp(float_fractions({0, 1, 10}), 3)), 0xCA01, {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, RD::kToNearestEven}}, - - - // Underflow - {static_cast(ldexp(1.0f, -25)), 0x0, {RD::kToZero, RD::kToNegativeInfinity, RD::kToNearestEven}}, - {static_cast(ldexp(1.0f, -25)), 0x1, {RD::kToPositiveInfinity}}, - {static_cast(-ldexp(1.0f, -25)), 0x8000, {RD::kToZero, RD::kToPositiveInfinity, RD::kToNearestEven}}, - {static_cast(-ldexp(1.0f, -25)), 0x8001, {RD::kToNegativeInfinity}}, - {static_cast(ldexp(1.0f, -24)), 0x1, {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, RD::kToNearestEven}}, - - // Overflow - {static_cast(ldexp(1.0f, 16)), positive_infinity, {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, RD::kToNearestEven}}, - {static_cast(ldexp(1.0f, 18)), positive_infinity, {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, RD::kToNearestEven}}, - {static_cast(ldexp(1.3f, 16)), positive_infinity, {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, RD::kToNearestEven}}, - {static_cast(-ldexp(1.0f, 16)), negative_infinity, {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, RD::kToNearestEven}}, - {static_cast(-ldexp(1.0f, 18)), negative_infinity, {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, RD::kToNearestEven}}, - {static_cast(-ldexp(1.3f, 16)), negative_infinity, {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, RD::kToNearestEven}}, - - // Transfer of Infinities - {std::numeric_limits::infinity(), positive_infinity, {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, RD::kToNearestEven}}, - {-std::numeric_limits::infinity(), negative_infinity, {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity, RD::kToNearestEven}}, - - // Nans are below because we cannot test for equality. - })),); - -struct UpCastCase{ - uint16_t source_half; - float expected_float; -}; - -using HexFloatFP16To32Tests = ::testing::TestWithParam; -TEST_P(HexFloatFP16To32Tests, WideningCasts) { - using HF = spvutils::HexFloat>; - using HF16 = spvutils::HexFloat>; - HF16 f(GetParam().source_half); - - spvutils::round_direction rounding[] = { - spvutils::round_direction::kToZero, - spvutils::round_direction::kToNearestEven, - spvutils::round_direction::kToPositiveInfinity, - spvutils::round_direction::kToNegativeInfinity}; - - // Everything fits, so everything should just be bit-shifts. - for (spvutils::round_direction round : rounding) { - HF flt(0.f); - f.castTo(flt, round); - EXPECT_EQ(GetParam().expected_float, flt.value().getAsFloat()) - << get_round_text(round) << " " << std::hex - << spvutils::BitwiseCast(GetParam().source_half) - << " cast to: " << flt.value().getAsFloat(); - } -} - -INSTANTIATE_TEST_CASE_P(F16ToF32, HexFloatFP16To32Tests, - ::testing::ValuesIn(std::vector( - { - {0x0000, 0.f}, - {0x8000, -0.f}, - {0x3C00, 1.0f}, - {0xBC00, -1.0f}, - {0x3F00, float_fractions({0, 1, 2})}, - {0xBF00, -float_fractions({0, 1, 2})}, - {0x3F01, float_fractions({0, 1, 2, 10})}, - {0xBF01, -float_fractions({0, 1, 2, 10})}, - - // denorm - {0x0001, static_cast(ldexp(1.0, -24))}, - {0x0002, static_cast(ldexp(1.0, -23))}, - {0x8001, static_cast(-ldexp(1.0, -24))}, - {0x8011, static_cast(-ldexp(1.0, -20) + -ldexp(1.0, -24))}, - - // inf - {0x7C00, std::numeric_limits::infinity()}, - {0xFC00, -std::numeric_limits::infinity()}, - })),); - -TEST(HexFloatOperationTests, NanTests) { - using HF = spvutils::HexFloat>; - using HF16 = spvutils::HexFloat>; - spvutils::round_direction rounding[] = { - spvutils::round_direction::kToZero, - spvutils::round_direction::kToNearestEven, - spvutils::round_direction::kToPositiveInfinity, - spvutils::round_direction::kToNegativeInfinity}; - - // Everything fits, so everything should just be bit-shifts. - for (spvutils::round_direction round : rounding) { - HF16 f16(0); - HF f(0.f); - HF(std::numeric_limits::quiet_NaN()).castTo(f16, round); - EXPECT_TRUE(f16.value().isNan()); - HF(std::numeric_limits::signaling_NaN()).castTo(f16, round); - EXPECT_TRUE(f16.value().isNan()); - - HF16(0x7C01).castTo(f, round); - EXPECT_TRUE(f.value().isNan()); - HF16(0x7C11).castTo(f, round); - EXPECT_TRUE(f.value().isNan()); - HF16(0xFC01).castTo(f, round); - EXPECT_TRUE(f.value().isNan()); - HF16(0x7C10).castTo(f, round); - EXPECT_TRUE(f.value().isNan()); - HF16(0xFF00).castTo(f, round); - EXPECT_TRUE(f.value().isNan()); - } -} - -// A test case for parsing good and bad HexFloat> literals. -template -struct FloatParseCase { - std::string literal; - bool negate_value; - bool expect_success; - HexFloat> expected_value; -}; - -using ParseNormalFloatTest = ::testing::TestWithParam>; - -TEST_P(ParseNormalFloatTest, Samples) { - std::stringstream input(GetParam().literal); - HexFloat> parsed_value(0.0f); - ParseNormalFloat(input, GetParam().negate_value, parsed_value); - EXPECT_NE(GetParam().expect_success, input.fail()) - << " literal: " << GetParam().literal - << " negate: " << GetParam().negate_value; - if (GetParam().expect_success) { - EXPECT_THAT(parsed_value.value(), Eq(GetParam().expected_value.value())) - << " literal: " << GetParam().literal - << " negate: " << GetParam().negate_value; - } -} - -// Returns a FloatParseCase with expected failure. -template -FloatParseCase BadFloatParseCase(std::string literal, bool negate_value, - T expected_value) { - HexFloat> proxy_expected_value(expected_value); - return FloatParseCase{literal, negate_value, false, proxy_expected_value}; -} - -// Returns a FloatParseCase that should successfully parse to a given value. -template -FloatParseCase GoodFloatParseCase(std::string literal, bool negate_value, - T expected_value) { - HexFloat> proxy_expected_value(expected_value); - return FloatParseCase{literal, negate_value, true, proxy_expected_value}; -} - -INSTANTIATE_TEST_CASE_P( - FloatParse, ParseNormalFloatTest, - ::testing::ValuesIn(std::vector>{ - // Failing cases due to trivially incorrect syntax. - BadFloatParseCase("abc", false, 0.0f), - BadFloatParseCase("abc", true, 0.0f), - - // Valid cases. - GoodFloatParseCase("0", false, 0.0f), - GoodFloatParseCase("0.0", false, 0.0f), - GoodFloatParseCase("-0.0", false, -0.0f), - GoodFloatParseCase("2.0", false, 2.0f), - GoodFloatParseCase("-2.0", false, -2.0f), - GoodFloatParseCase("+2.0", false, 2.0f), - // Cases with negate_value being true. - GoodFloatParseCase("0.0", true, -0.0f), - GoodFloatParseCase("2.0", true, -2.0f), - - // When negate_value is true, we should not accept a - // leading minus or plus. - BadFloatParseCase("-0.0", true, 0.0f), - BadFloatParseCase("-2.0", true, 0.0f), - BadFloatParseCase("+0.0", true, 0.0f), - BadFloatParseCase("+2.0", true, 0.0f), - - // Overflow is an error for 32-bit float parsing. - BadFloatParseCase("1e40", false, FLT_MAX), - BadFloatParseCase("1e40", true, -FLT_MAX), - BadFloatParseCase("-1e40", false, -FLT_MAX), - // We can't have -1e40 and negate_value == true since - // that represents an original case of "--1e40" which - // is invalid. - }),); - -using ParseNormalFloat16Test = - ::testing::TestWithParam>; - -TEST_P(ParseNormalFloat16Test, Samples) { - std::stringstream input(GetParam().literal); - HexFloat> parsed_value(0); - ParseNormalFloat(input, GetParam().negate_value, parsed_value); - EXPECT_NE(GetParam().expect_success, input.fail()) - << " literal: " << GetParam().literal - << " negate: " << GetParam().negate_value; - if (GetParam().expect_success) { - EXPECT_THAT(parsed_value.value(), Eq(GetParam().expected_value.value())) - << " literal: " << GetParam().literal - << " negate: " << GetParam().negate_value; - } -} - -INSTANTIATE_TEST_CASE_P( - Float16Parse, ParseNormalFloat16Test, - ::testing::ValuesIn(std::vector>{ - // Failing cases due to trivially incorrect syntax. - BadFloatParseCase("abc", false, uint16_t{0}), - BadFloatParseCase("abc", true, uint16_t{0}), - - // Valid cases. - GoodFloatParseCase("0", false, uint16_t{0}), - GoodFloatParseCase("0.0", false, uint16_t{0}), - GoodFloatParseCase("-0.0", false, uint16_t{0x8000}), - GoodFloatParseCase("2.0", false, uint16_t{0x4000}), - GoodFloatParseCase("-2.0", false, uint16_t{0xc000}), - GoodFloatParseCase("+2.0", false, uint16_t{0x4000}), - // Cases with negate_value being true. - GoodFloatParseCase("0.0", true, uint16_t{0x8000}), - GoodFloatParseCase("2.0", true, uint16_t{0xc000}), - - // When negate_value is true, we should not accept a leading minus or - // plus. - BadFloatParseCase("-0.0", true, uint16_t{0}), - BadFloatParseCase("-2.0", true, uint16_t{0}), - BadFloatParseCase("+0.0", true, uint16_t{0}), - BadFloatParseCase("+2.0", true, uint16_t{0}), - }),); - -// A test case for detecting infinities. -template -struct OverflowParseCase { - std::string input; - bool expect_success; - T expected_value; -}; - -using FloatProxyParseOverflowFloatTest = - ::testing::TestWithParam>; - -TEST_P(FloatProxyParseOverflowFloatTest, Sample) { - std::istringstream input(GetParam().input); - HexFloat> value(0.0f); - input >> value; - EXPECT_NE(GetParam().expect_success, input.fail()); - if (GetParam().expect_success) { - EXPECT_THAT(value.value().getAsFloat(), GetParam().expected_value); - } -} - -INSTANTIATE_TEST_CASE_P( - FloatOverflow, FloatProxyParseOverflowFloatTest, - ::testing::ValuesIn(std::vector>({ - {"0", true, 0.0f}, - {"0.0", true, 0.0f}, - {"1.0", true, 1.0f}, - {"1e38", true, 1e38f}, - {"-1e38", true, -1e38f}, - {"1e40", false, FLT_MAX}, - {"-1e40", false, -FLT_MAX}, - {"1e400", false, FLT_MAX}, - {"-1e400", false, -FLT_MAX}, - })),); - -using FloatProxyParseOverflowDoubleTest = - ::testing::TestWithParam>; - -TEST_P(FloatProxyParseOverflowDoubleTest, Sample) { - std::istringstream input(GetParam().input); - HexFloat> value(0.0); - input >> value; - EXPECT_NE(GetParam().expect_success, input.fail()); - if (GetParam().expect_success) { - EXPECT_THAT(value.value().getAsFloat(), Eq(GetParam().expected_value)); - } -} - -INSTANTIATE_TEST_CASE_P( - DoubleOverflow, FloatProxyParseOverflowDoubleTest, - ::testing::ValuesIn(std::vector>({ - {"0", true, 0.0}, - {"0.0", true, 0.0}, - {"1.0", true, 1.0}, - {"1e38", true, 1e38}, - {"-1e38", true, -1e38}, - {"1e40", true, 1e40}, - {"-1e40", true, -1e40}, - {"1e400", false, DBL_MAX}, - {"-1e400", false, -DBL_MAX}, - })),); - -using FloatProxyParseOverflowFloat16Test = - ::testing::TestWithParam>; - -TEST_P(FloatProxyParseOverflowFloat16Test, Sample) { - std::istringstream input(GetParam().input); - HexFloat> value(0); - input >> value; - EXPECT_NE(GetParam().expect_success, input.fail()) << " literal: " - << GetParam().input; - if (GetParam().expect_success) { - EXPECT_THAT(value.value().data(), Eq(GetParam().expected_value)) - << " literal: " << GetParam().input; - } -} - -INSTANTIATE_TEST_CASE_P( - Float16Overflow, FloatProxyParseOverflowFloat16Test, - ::testing::ValuesIn(std::vector>({ - {"0", true, uint16_t{0}}, - {"0.0", true, uint16_t{0}}, - {"1.0", true, uint16_t{0x3c00}}, - // Overflow for 16-bit float is an error, and returns max or - // lowest value. - {"1e38", false, uint16_t{0x7bff}}, - {"1e40", false, uint16_t{0x7bff}}, - {"1e400", false, uint16_t{0x7bff}}, - {"-1e38", false, uint16_t{0xfbff}}, - {"-1e40", false, uint16_t{0xfbff}}, - {"-1e400", false, uint16_t{0xfbff}}, - })),); - -TEST(FloatProxy, Max) { - EXPECT_THAT(FloatProxy::max().getAsFloat().get_value(), - Eq(uint16_t{0x7bff})); - EXPECT_THAT(FloatProxy::max().getAsFloat(), - Eq(std::numeric_limits::max())); - EXPECT_THAT(FloatProxy::max().getAsFloat(), - Eq(std::numeric_limits::max())); -} - -TEST(FloatProxy, Lowest) { - EXPECT_THAT(FloatProxy::lowest().getAsFloat().get_value(), - Eq(uint16_t{0xfbff})); - EXPECT_THAT(FloatProxy::lowest().getAsFloat(), - Eq(std::numeric_limits::lowest())); - EXPECT_THAT(FloatProxy::lowest().getAsFloat(), - Eq(std::numeric_limits::lowest())); -} - -// TODO(awoloszyn): Add fp16 tests and HexFloatTraits. -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/huffman_codec.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/huffman_codec.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/huffman_codec.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/huffman_codec.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,318 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Contains utils for reading, writing and debug printing bit streams. - -#include -#include -#include -#include - -#include "util/huffman_codec.h" -#include "util/bit_stream.h" -#include "gmock/gmock.h" - -namespace { - -using spvutils::HuffmanCodec; -using spvutils::BitsToStream; - -const std::map& GetTestSet() { - static const std::map hist = { - {"a", 4}, - {"e", 7}, - {"f", 3}, - {"h", 2}, - {"i", 3}, - {"m", 2}, - {"n", 2}, - {"s", 2}, - {"t", 2}, - {"l", 1}, - {"o", 2}, - {"p", 1}, - {"r", 1}, - {"u", 1}, - {"x", 1}, - }; - - return hist; -} - -class TestBitReader { - public: - TestBitReader(const std::string& bits) : bits_(bits) {} - - bool ReadBit(bool* bit) { - if (pos_ < bits_.length()) { - *bit = bits_[pos_++] == '0' ? false : true; - return true; - } - return false; - } - - private: - std::string bits_; - size_t pos_ = 0; -}; - -TEST(Huffman, PrintTree) { - HuffmanCodec huffman(GetTestSet()); - std::stringstream ss; - huffman.PrintTree(ss); - - const std::string expected = std::string(R"( -15-----7------e - 8------4------a - 4------2------m - 2------n -19-----8------4------2------o - 2------s - 4------2------t - 2------1------l - 1------p - 11-----5------2------1------r - 1------u - 3------f - 6------3------i - 3------1------x - 2------h -)").substr(1); - - EXPECT_EQ(expected, ss.str()); -} - -TEST(Huffman, PrintTable) { - HuffmanCodec huffman(GetTestSet()); - std::stringstream ss; - huffman.PrintTable(ss); - - const std::string expected = std::string(R"( -e 7 11 -a 4 101 -i 3 0001 -f 3 0010 -t 2 0101 -s 2 0110 -o 2 0111 -n 2 1000 -m 2 1001 -h 2 00000 -x 1 00001 -u 1 00110 -r 1 00111 -p 1 01000 -l 1 01001 -)").substr(1); - - EXPECT_EQ(expected, ss.str()); -} - -TEST(Huffman, TestValidity) { - HuffmanCodec huffman(GetTestSet()); - const auto& encoding_table = huffman.GetEncodingTable(); - std::vector codes; - for (const auto& entry : encoding_table) { - codes.push_back(BitsToStream(entry.second.first, entry.second.second)); - } - - std::sort(codes.begin(), codes.end()); - - ASSERT_LT(codes.size(), 20u) << "Inefficient test ahead"; - - for (size_t i = 0; i < codes.size(); ++i) { - for (size_t j = i + 1; j < codes.size(); ++j) { - ASSERT_FALSE(codes[i] == codes[j].substr(0, codes[i].length())) - << codes[i] << " is prefix of " << codes[j]; - } - } -} - -TEST(Huffman, TestEncode) { - HuffmanCodec huffman(GetTestSet()); - - uint64_t bits = 0; - size_t num_bits = 0; - - EXPECT_TRUE(huffman.Encode("e", &bits, &num_bits)); - EXPECT_EQ(2u, num_bits); - EXPECT_EQ("11", BitsToStream(bits, num_bits)); - - EXPECT_TRUE(huffman.Encode("a", &bits, &num_bits)); - EXPECT_EQ(3u, num_bits); - EXPECT_EQ("101", BitsToStream(bits, num_bits)); - - EXPECT_TRUE(huffman.Encode("x", &bits, &num_bits)); - EXPECT_EQ(5u, num_bits); - EXPECT_EQ("00001", BitsToStream(bits, num_bits)); - - EXPECT_FALSE(huffman.Encode("y", &bits, &num_bits)); -} - -TEST(Huffman, TestDecode) { - HuffmanCodec huffman(GetTestSet()); - TestBitReader bit_reader("01001""0001""1000""00110""00001""00"); - auto read_bit = [&bit_reader](bool* bit) { - return bit_reader.ReadBit(bit); - }; - - std::string decoded; - - ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); - EXPECT_EQ("l", decoded); - - ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); - EXPECT_EQ("i", decoded); - - ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); - EXPECT_EQ("n", decoded); - - ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); - EXPECT_EQ("u", decoded); - - ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); - EXPECT_EQ("x", decoded); - - ASSERT_FALSE(huffman.DecodeFromStream(read_bit, &decoded)); -} - -TEST(Huffman, TestDecodeNumbers) { - const std::map hist = { {1, 10}, {2, 5}, {3, 15} }; - HuffmanCodec huffman(hist); - - TestBitReader bit_reader("1""1""01""00""01""1"); - auto read_bit = [&bit_reader](bool* bit) { - return bit_reader.ReadBit(bit); - }; - - uint32_t decoded; - - ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); - EXPECT_EQ(3u, decoded); - - ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); - EXPECT_EQ(3u, decoded); - - ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); - EXPECT_EQ(2u, decoded); - - ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); - EXPECT_EQ(1u, decoded); - - ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); - EXPECT_EQ(2u, decoded); - - ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); - EXPECT_EQ(3u, decoded); -} - -TEST(Huffman, SerializeToTextU64) { - const std::map hist = - { {1001, 10}, {1002, 5}, {1003, 15} }; - HuffmanCodec huffman(hist); - - const std::string code = huffman.SerializeToText(2); - - const std::string expected = R"((5, { - {0, 0, 0}, - {1001, 0, 0}, - {1002, 0, 0}, - {1003, 0, 0}, - {0, 1, 2}, - {0, 4, 3}, - }))"; - - - ASSERT_EQ(expected, code); -} - -TEST(Huffman, SerializeToTextString) { - const std::map hist = - { {"aaa", 10}, {"bbb", 20}, {"ccc", 15} }; - HuffmanCodec huffman(hist); - - const std::string code = huffman.SerializeToText(4); - - const std::string expected = R"((5, { - {"", 0, 0}, - {"aaa", 0, 0}, - {"bbb", 0, 0}, - {"ccc", 0, 0}, - {"", 3, 1}, - {"", 4, 2}, - }))"; - - ASSERT_EQ(expected, code); -} - -TEST(Huffman, CreateFromTextString) { - std::vector::Node> nodes = { - {}, - {"root", 2, 3}, - {"left", 0, 0}, - {"right", 0, 0}, - }; - - HuffmanCodec huffman(1, std::move(nodes)); - - std::stringstream ss; - huffman.PrintTree(ss); - - const std::string expected = std::string(R"( -0------right -0------left -)").substr(1); - - EXPECT_EQ(expected, ss.str()); -} - -TEST(Huffman, CreateFromTextU64) { - HuffmanCodec huffman(5, { - {0, 0, 0}, - {1001, 0, 0}, - {1002, 0, 0}, - {1003, 0, 0}, - {0, 1, 2}, - {0, 4, 3}, - }); - - std::stringstream ss; - huffman.PrintTree(ss); - - const std::string expected = std::string(R"( -0------1003 -0------0------1002 - 0------1001 -)").substr(1); - - EXPECT_EQ(expected, ss.str()); - - TestBitReader bit_reader("01"); - auto read_bit = [&bit_reader](bool* bit) { - return bit_reader.ReadBit(bit); - }; - - uint64_t decoded = 0; - ASSERT_TRUE(huffman.DecodeFromStream(read_bit, &decoded)); - EXPECT_EQ(1002u, decoded); - - uint64_t bits = 0; - size_t num_bits = 0; - - EXPECT_TRUE(huffman.Encode(1001, &bits, &num_bits)); - EXPECT_EQ(2u, num_bits); - EXPECT_EQ("00", BitsToStream(bits, num_bits)); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/immediate_int_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/immediate_int_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/immediate_int_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/immediate_int_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,289 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include - -#include - -#include "test_fixture.h" -#include "source/util/bitutils.h" - -namespace { - -using spvtest::Concatenate; -using spvtest::MakeInstruction; -using spvtest::ScopedContext; -using spvtest::TextToBinaryTest; -using spvutils::BitwiseCast; -using ::testing::ElementsAre; -using ::testing::Eq; -using ::testing::HasSubstr; -using ::testing::StrEq; - -TEST_F(TextToBinaryTest, ImmediateIntOpCode) { - SetText("!0x00FF00FF"); - ASSERT_EQ(SPV_SUCCESS, spvTextToBinary(ScopedContext().context, text.str, - text.length, &binary, &diagnostic)); - EXPECT_EQ(0x00FF00FFu, binary->code[5]); - if (diagnostic) { - spvDiagnosticPrint(diagnostic); - } -} - -TEST_F(TextToBinaryTest, ImmediateIntOperand) { - SetText("OpCapability !0x00FF00FF"); - EXPECT_EQ(SPV_SUCCESS, spvTextToBinary(ScopedContext().context, text.str, - text.length, &binary, &diagnostic)); - EXPECT_EQ(0x00FF00FFu, binary->code[6]); - if (diagnostic) { - spvDiagnosticPrint(diagnostic); - } -} - -using ImmediateIntTest = TextToBinaryTest; - -TEST_F(ImmediateIntTest, AnyWordInSimpleStatement) { - EXPECT_THAT(CompiledInstructions("!0x00040018 %a %b %123"), - Eq(MakeInstruction(SpvOpTypeMatrix, {1, 2, 3}))); - EXPECT_THAT(CompiledInstructions("!0x00040018 !1 %b %123"), - Eq(MakeInstruction(SpvOpTypeMatrix, {1, 1, 2}))); - EXPECT_THAT(CompiledInstructions("%a = OpTypeMatrix !2 %123"), - Eq(MakeInstruction(SpvOpTypeMatrix, {1, 2, 2}))); - EXPECT_THAT(CompiledInstructions("%a = OpTypeMatrix %b !123"), - Eq(MakeInstruction(SpvOpTypeMatrix, {1, 2, 123}))); - EXPECT_THAT(CompiledInstructions("!0x00040018 %a !2 %123"), - Eq(MakeInstruction(SpvOpTypeMatrix, {1, 2, 2}))); - EXPECT_THAT(CompiledInstructions("!0x00040018 !1 %b !123"), - Eq(MakeInstruction(SpvOpTypeMatrix, {1, 1, 123}))); - EXPECT_THAT(CompiledInstructions("!0x00040018 !1 !2 !123"), - Eq(MakeInstruction(SpvOpTypeMatrix, {1, 2, 123}))); -} - -TEST_F(ImmediateIntTest, AnyWordAfterEqualsAndOpCode) { - EXPECT_THAT(CompiledInstructions("%a = OpArrayLength !2 %c 123"), - Eq(MakeInstruction(SpvOpArrayLength, {2, 1, 2, 123}))); - EXPECT_THAT(CompiledInstructions("%a = OpArrayLength %b !3 123"), - Eq(MakeInstruction(SpvOpArrayLength, {1, 2, 3, 123}))); - EXPECT_THAT(CompiledInstructions("%a = OpArrayLength %b %c !123"), - Eq(MakeInstruction(SpvOpArrayLength, {1, 2, 3, 123}))); - EXPECT_THAT(CompiledInstructions("%a = OpArrayLength %b !3 !123"), - Eq(MakeInstruction(SpvOpArrayLength, {1, 2, 3, 123}))); - EXPECT_THAT(CompiledInstructions("%a = OpArrayLength !2 !3 123"), - Eq(MakeInstruction(SpvOpArrayLength, {2, 1, 3, 123}))); - EXPECT_THAT(CompiledInstructions("%a = OpArrayLength !2 !3 !123"), - Eq(MakeInstruction(SpvOpArrayLength, {2, 1, 3, 123}))); -} - -TEST_F(ImmediateIntTest, ResultIdInAssignment) { - EXPECT_EQ("!2 not allowed before =.", - CompileFailure("!2 = OpArrayLength %12 %1 123")); - EXPECT_EQ("!2 not allowed before =.", - CompileFailure("!2 = !0x00040044 %12 %1 123")); -} - -TEST_F(ImmediateIntTest, OpCodeInAssignment) { - EXPECT_EQ("Invalid Opcode prefix '!0x00040044'.", - CompileFailure("%2 = !0x00040044 %12 %1 123")); -} - -// Literal integers after ! are handled correctly. -TEST_F(ImmediateIntTest, IntegerFollowingImmediate) { - const SpirvVector original = CompiledInstructions("%1 = OpTypeInt 8 1"); - EXPECT_EQ(original, CompiledInstructions("!0x00040015 1 8 1")); - EXPECT_EQ(original, CompiledInstructions("!0x00040015 !1 8 1")); - - // With !, we can (and can only) accept 32-bit number literals, - // even when we declare the return type is 64-bit. - EXPECT_EQ(Concatenate({ - MakeInstruction(SpvOpTypeInt, {1, 64, 0}), - MakeInstruction(SpvOpConstant, {1, 2, 4294967295}), - }), - CompiledInstructions("%i64 = OpTypeInt 64 0\n" - "!0x0004002b %i64 !2 4294967295")); - // 64-bit integer literal. - EXPECT_EQ("Invalid word following !: 5000000000", - CompileFailure("%2 = OpConstant !1 5000000000")); - EXPECT_EQ("Invalid word following !: 5000000000", - CompileFailure("%i64 = OpTypeInt 64 0\n" - "!0x0005002b %i64 !2 5000000000")); - - // Negative integer. - EXPECT_EQ(CompiledInstructions("%i64 = OpTypeInt 32 1\n" - "%2 = OpConstant %i64 -123"), - CompiledInstructions("%i64 = OpTypeInt 32 1\n" - "!0x0004002b %i64 !2 -123")); - - // TODO(deki): uncomment assertions below and make them pass. - // Hex value(s). - // EXPECT_EQ(CompileSuccessfully("%1 = OpConstant %10 0x12345678"), - // CompileSuccessfully("OpConstant %10 !1 0x12345678", kCAF)); - // EXPECT_EQ( - // CompileSuccessfully("%1 = OpConstant %10 0x12345678 0x87654321"), - // CompileSuccessfully("OpConstant %10 !1 0x12345678 0x87654321", kCAF)); -} - -// Literal floats after ! are handled correctly. -TEST_F(ImmediateIntTest, FloatFollowingImmediate) { - EXPECT_EQ( - CompiledInstructions("%1 = OpTypeFloat 32\n%2 = OpConstant %1 0.123"), - CompiledInstructions("%1 = OpTypeFloat 32\n!0x0004002b %1 !2 0.123")); - EXPECT_EQ( - CompiledInstructions("%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0.5"), - CompiledInstructions("%1 = OpTypeFloat 32\n!0x0004002b %1 !2 -0.5")); - EXPECT_EQ( - CompiledInstructions("%1 = OpTypeFloat 32\n%2 = OpConstant %1 0.123"), - CompiledInstructions("%1 = OpTypeFloat 32\n!0x0004002b %1 %2 0.123")); - EXPECT_EQ( - CompiledInstructions("%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0.5"), - CompiledInstructions("%1 = OpTypeFloat 32\n!0x0004002b %1 %2 -0.5")); - - EXPECT_EQ(Concatenate({ - MakeInstruction(SpvOpTypeInt, {1, 64, 0}), - MakeInstruction(SpvOpConstant, {1, 2, 0xb, 0xa}), - MakeInstruction(SpvOpSwitch, - {2, 1234, BitwiseCast(2.5f), 3}), - }), - CompiledInstructions("%i64 = OpTypeInt 64 0\n" - "%big = OpConstant %i64 0xa0000000b\n" - "OpSwitch %big !1234 2.5 %target\n")); -} - -// Literal strings after ! are handled correctly. -TEST_F(ImmediateIntTest, StringFollowingImmediate) { - // Try a variety of strings, including empty and single-character. - for (std::string name : {"", "s", "longish", "really looooooooooooooooong"}) { - const SpirvVector original = - CompiledInstructions("OpMemberName %10 4 \"" + name + "\""); - EXPECT_EQ(original, - CompiledInstructions("OpMemberName %10 !4 \"" + name + "\"")) - << name; - EXPECT_EQ(original, - CompiledInstructions("OpMemberName !1 !4 \"" + name + "\"")) - << name; - const uint16_t wordCount = static_cast(4 + name.size() / 4); - const uint32_t firstWord = spvOpcodeMake(wordCount, SpvOpMemberName); - EXPECT_EQ(original, CompiledInstructions("!" + std::to_string(firstWord) + - " %10 !4 \"" + name + "\"")) - << name; - } -} - -// IDs after ! are handled correctly. -TEST_F(ImmediateIntTest, IdFollowingImmediate) { - EXPECT_EQ(CompileSuccessfully("%123 = OpDecorationGroup"), - CompileSuccessfully("!0x00020049 %123")); - EXPECT_EQ(CompileSuccessfully("%group = OpDecorationGroup"), - CompileSuccessfully("!0x00020049 %group")); -} - -// ! after ! is handled correctly. -TEST_F(ImmediateIntTest, ImmediateFollowingImmediate) { - const SpirvVector original = CompiledInstructions("%a = OpTypeMatrix %b 7"); - EXPECT_EQ(original, CompiledInstructions("%a = OpTypeMatrix !2 !7")); - EXPECT_EQ(original, CompiledInstructions("!0x00040018 %a !2 !7")); -} - -TEST_F(ImmediateIntTest, InvalidStatement) { - EXPECT_THAT(Subvector(CompileSuccessfully("!4 !3 !2 !1"), kFirstInstruction), - ElementsAre(4, 3, 2, 1)); -} - -TEST_F(ImmediateIntTest, InvalidStatementBetweenValidOnes) { - EXPECT_THAT(Subvector(CompileSuccessfully( - "%10 = OpTypeFloat 32 !5 !6 !7 OpEmitVertex"), - kFirstInstruction), - ElementsAre(spvOpcodeMake(3, SpvOpTypeFloat), 1, 32, 5, 6, 7, - spvOpcodeMake(1, SpvOpEmitVertex))); -} - -TEST_F(ImmediateIntTest, NextOpcodeRecognized) { - const SpirvVector original = CompileSuccessfully(R"( -%1 = OpLoad %10 %2 Volatile -%4 = OpCompositeInsert %11 %1 %3 0 1 2 -)"); - const SpirvVector alternate = CompileSuccessfully(R"( -%1 = OpLoad %10 %2 !1 -%4 = OpCompositeInsert %11 %1 %3 0 1 2 -)"); - EXPECT_EQ(original, alternate); -} - -TEST_F(ImmediateIntTest, WrongLengthButNextOpcodeStillRecognized) { - const SpirvVector original = CompileSuccessfully(R"( -%1 = OpLoad %10 %2 Volatile -OpCopyMemorySized %3 %4 %1 -)"); - const SpirvVector alternate = CompileSuccessfully(R"( -!0x0002003D %10 %1 %2 !1 -OpCopyMemorySized %3 %4 %1 -)"); - EXPECT_EQ(0x0002003Du, alternate[kFirstInstruction]); - EXPECT_EQ(Subvector(original, kFirstInstruction + 1), - Subvector(alternate, kFirstInstruction + 1)); -} - -// Like NextOpcodeRecognized, but next statement is in assignment form. -TEST_F(ImmediateIntTest, NextAssignmentRecognized) { - const SpirvVector original = CompileSuccessfully(R"( -%1 = OpLoad %10 %2 None -%4 = OpFunctionCall %10 %3 %123 -)"); - const SpirvVector alternate = CompileSuccessfully(R"( -%1 = OpLoad %10 %2 !0 -%4 = OpFunctionCall %10 %3 %123 -)"); - EXPECT_EQ(original, alternate); -} - -// Two instructions in a row each have ! opcode. -TEST_F(ImmediateIntTest, ConsecutiveImmediateOpcodes) { - const SpirvVector original = CompileSuccessfully(R"( -%1 = OpConstantSampler %10 Clamp 78 Linear -%4 = OpFRem %11 %3 %2 -%5 = OpIsValidEvent %12 %2 -)"); - const SpirvVector alternate = CompileSuccessfully(R"( -!0x0006002D %10 %1 !2 78 !1 -!0x0005008C %11 %4 %3 %2 -%5 = OpIsValidEvent %12 %2 -)"); - EXPECT_EQ(original, alternate); -} - -// ! followed by, eg, an enum or '=' or a random bareword. -TEST_F(ImmediateIntTest, ForbiddenOperands) { - EXPECT_THAT(CompileFailure("OpMemoryModel !0 OpenCL"), HasSubstr("OpenCL")); - EXPECT_THAT(CompileFailure("!1 %0 = !2"), HasSubstr("=")); - EXPECT_THAT(CompileFailure("OpMemoryModel !0 random_bareword"), - HasSubstr("random_bareword")); - // Immediate integers longer than one 32-bit word. - EXPECT_THAT(CompileFailure("!5000000000"), HasSubstr("5000000000")); - EXPECT_THAT(CompileFailure("!999999999999999999"), - HasSubstr("999999999999999999")); - EXPECT_THAT(CompileFailure("!0x00020049 !5000000000"), - HasSubstr("5000000000")); - // Negative numbers. - EXPECT_THAT(CompileFailure("!0x00020049 !-123"), HasSubstr("-123")); -} - -TEST_F(ImmediateIntTest, NotInteger) { - EXPECT_THAT(CompileFailure("!abc"), StrEq("Invalid immediate integer: !abc")); - EXPECT_THAT(CompileFailure("!12.3"), - StrEq("Invalid immediate integer: !12.3")); - EXPECT_THAT(CompileFailure("!12K"), StrEq("Invalid immediate integer: !12K")); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/libspirv_macros_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/libspirv_macros_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/libspirv_macros_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/libspirv_macros_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -namespace { - -TEST(Macros, BitShiftInnerParens) { ASSERT_EQ(65536, SPV_BIT(2 << 3)); } - -TEST(Macros, BitShiftOuterParens) { ASSERT_EQ(15, SPV_BIT(4) - 1); } - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/link/binary_version_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/link/binary_version_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/link/binary_version_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/link/binary_version_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -// Copyright (c) 2017 Pierre Moreau -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "gmock/gmock.h" -#include "linker_fixture.h" - -namespace { - -using BinaryVersion = spvtest::LinkerTest; - -TEST_F(BinaryVersion, LinkerChoosesMaxSpirvVersion) { - spvtest::Binaries binaries = { - { - SpvMagicNumber, - 0x00000300u, - SPV_GENERATOR_CODEPLAY, - 1u, // NOTE: Bound - 0u // NOTE: Schema; reserved - }, - { - SpvMagicNumber, - 0x00000600u, - SPV_GENERATOR_CODEPLAY, - 1u, // NOTE: Bound - 0u // NOTE: Schema; reserved - }, - { - SpvMagicNumber, - 0x00000100u, - SPV_GENERATOR_CODEPLAY, - 1u, // NOTE: Bound - 0u // NOTE: Schema; reserved - } - }; - spvtest::Binary linked_binary; - - ASSERT_EQ(SPV_SUCCESS, Link(binaries, &linked_binary)); - EXPECT_THAT(GetErrorMessage(), std::string()); - - ASSERT_EQ(0x00000600u, linked_binary[1]); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/link/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/test/link/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/link/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/link/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -# Copyright (c) 2017 Pierre Moreau -# -# 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. - -add_spvtools_unittest(TARGET link_binary_version - SRCS binary_version_test.cpp - LIBS SPIRV-Tools-opt SPIRV-Tools-link -) - -add_spvtools_unittest(TARGET link_memory_model - SRCS memory_model_test.cpp - LIBS SPIRV-Tools-opt SPIRV-Tools-link -) - -add_spvtools_unittest(TARGET link_entry_points - SRCS entry_points_test.cpp - LIBS SPIRV-Tools-opt SPIRV-Tools-link -) - -add_spvtools_unittest(TARGET link_global_values_amount - SRCS global_values_amount_test.cpp - LIBS SPIRV-Tools-opt SPIRV-Tools-link -) - -add_spvtools_unittest(TARGET link_ids_limit - SRCS ids_limit_test.cpp - LIBS SPIRV-Tools-opt SPIRV-Tools-link -) - -add_spvtools_unittest(TARGET link_matching_imports_to_exports - SRCS matching_imports_to_exports_test.cpp - LIBS SPIRV-Tools-opt SPIRV-Tools-link -) diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/link/entry_points_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/link/entry_points_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/link/entry_points_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/link/entry_points_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ -// Copyright (c) 2017 Pierre Moreau -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "gmock/gmock.h" -#include "linker_fixture.h" - -namespace { - -using ::testing::HasSubstr; - -class EntryPoints : public spvtest::LinkerTest {}; - -TEST_F(EntryPoints, SameModelDifferentName) { - const std::string body1 = R"( -OpEntryPoint GLCompute %1 "foo" -)"; - const std::string body2 = R"( -OpEntryPoint GLCompute %1 "bar" -)"; - - spvtest::Binary linked_binary; - ASSERT_EQ(SPV_SUCCESS, AssembleAndLink({body1, body2}, &linked_binary)); - EXPECT_THAT(GetErrorMessage(), std::string()); -} - -TEST_F(EntryPoints, DifferentModelSameName) { - const std::string body1 = R"( -OpEntryPoint GLCompute %1 "foo" -)"; - const std::string body2 = R"( -OpEntryPoint Vertex %1 "foo" -)"; - - spvtest::Binary linked_binary; - ASSERT_EQ(SPV_SUCCESS, AssembleAndLink({body1, body2}, &linked_binary)); - EXPECT_THAT(GetErrorMessage(), std::string()); -} - -TEST_F(EntryPoints, SameModelAndName) { - const std::string body1 = R"( -OpEntryPoint GLCompute %1 "foo" -)"; - const std::string body2 = R"( -OpEntryPoint GLCompute %1 "foo" -)"; - - spvtest::Binary linked_binary; - ASSERT_EQ(SPV_ERROR_INTERNAL, - AssembleAndLink({body1, body2}, &linked_binary)); - EXPECT_THAT(GetErrorMessage(), - HasSubstr("The entry point \"foo\", with execution model " - "GLCompute, was already defined.")); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/link/global_values_amount_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/link/global_values_amount_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/link/global_values_amount_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/link/global_values_amount_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,153 +0,0 @@ -// Copyright (c) 2017 Pierre Moreau -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "gmock/gmock.h" -#include "linker_fixture.h" - -namespace { - -using ::testing::HasSubstr; - -class EntryPoints : public spvtest::LinkerTest { - public: - EntryPoints() { binaries.reserve(0xFFFF); } - - virtual void SetUp() override { - binaries.push_back({SpvMagicNumber, - SpvVersion, - SPV_GENERATOR_CODEPLAY, - 10u, // NOTE: Bound - 0u, // NOTE: Schema; reserved - - 3u << SpvWordCountShift | SpvOpTypeFloat, - 1u, // NOTE: Result ID - 32u, // NOTE: Width - - 4u << SpvWordCountShift | SpvOpTypePointer, - 2u, // NOTE: Result ID - SpvStorageClassInput, - 1u, // NOTE: Type ID - - 2u << SpvWordCountShift | SpvOpTypeVoid, - 3u, // NOTE: Result ID - - 3u << SpvWordCountShift | SpvOpTypeFunction, - 4u, // NOTE: Result ID - 3u, // NOTE: Return type - - 5u << SpvWordCountShift | SpvOpFunction, - 3u, // NOTE: Result type - 5u, // NOTE: Result ID - SpvFunctionControlMaskNone, - 4u, // NOTE: Function type - - 2u << SpvWordCountShift | SpvOpLabel, - 6u, // NOTE: Result ID - - 4u << SpvWordCountShift | SpvOpVariable, - 2u, // NOTE: Type ID - 7u, // NOTE: Result ID - SpvStorageClassFunction, - - 4u << SpvWordCountShift | SpvOpVariable, - 2u, // NOTE: Type ID - 8u, // NOTE: Result ID - SpvStorageClassFunction, - - 4u << SpvWordCountShift | SpvOpVariable, - 2u, // NOTE: Type ID - 9u, // NOTE: Result ID - SpvStorageClassFunction, - - 1u << SpvWordCountShift | SpvOpReturn, - - 1u << SpvWordCountShift | SpvOpFunctionEnd}); - for (size_t i = 0u; i < 2u; ++i) { - spvtest::Binary binary = { - SpvMagicNumber, - SpvVersion, - SPV_GENERATOR_CODEPLAY, - 103u, // NOTE: Bound - 0u, // NOTE: Schema; reserved - - 3u << SpvWordCountShift | SpvOpTypeFloat, - 1u, // NOTE: Result ID - 32u, // NOTE: Width - - 4u << SpvWordCountShift | SpvOpTypePointer, - 2u, // NOTE: Result ID - SpvStorageClassInput, - 1u // NOTE: Type ID - }; - - for (uint32_t j = 0u; j < 0xFFFFu / 2u; ++j) { - binary.push_back(4u << SpvWordCountShift | SpvOpVariable); - binary.push_back(2u); // NOTE: Type ID - binary.push_back(j + 3u); // NOTE: Result ID - binary.push_back(SpvStorageClassInput); - } - binaries.push_back(binary); - } - } - virtual void TearDown() override { binaries.clear(); } - - spvtest::Binaries binaries; -}; - -// TODO(dneto): Fix performance issue for debug builds on Windows -#if !(defined(SPIRV_WINDOWS) && defined(_DEBUG)) - -TEST_F(EntryPoints, UnderLimit) { - spvtest::Binary linked_binary; - - ASSERT_EQ(SPV_SUCCESS, Link(binaries, &linked_binary)); - EXPECT_THAT(GetErrorMessage(), std::string()); -} - -TEST_F(EntryPoints, OverLimit) { - binaries.push_back({SpvMagicNumber, - SpvVersion, - SPV_GENERATOR_CODEPLAY, - 5u, // NOTE: Bound - 0u, // NOTE: Schema; reserved - - 3u << SpvWordCountShift | SpvOpTypeFloat, - 1u, // NOTE: Result ID - 32u, // NOTE: Width - - 4u << SpvWordCountShift | SpvOpTypePointer, - 2u, // NOTE: Result ID - SpvStorageClassInput, - 1u, // NOTE: Type ID - - 4u << SpvWordCountShift | SpvOpVariable, - 2u, // NOTE: Type ID - 3u, // NOTE: Result ID - SpvStorageClassInput, - - 4u << SpvWordCountShift | SpvOpVariable, - 2u, // NOTE: Type ID - 4u, // NOTE: Result ID - SpvStorageClassInput}); - - spvtest::Binary linked_binary; - - ASSERT_EQ(SPV_ERROR_INTERNAL, Link(binaries, &linked_binary)); - EXPECT_THAT(GetErrorMessage(), - HasSubstr("The limit of global values, 65535, was exceeded; " - "65536 global values were found.")); -} -#endif // !(defined(SPIRV_WINDOWS) && defined(_DEBUG)) - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/link/ids_limit_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/link/ids_limit_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/link/ids_limit_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/link/ids_limit_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -// Copyright (c) 2017 Pierre Moreau -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "gmock/gmock.h" -#include "linker_fixture.h" - -namespace { - -using ::testing::HasSubstr; - -using IdsLimit = spvtest::LinkerTest; - -TEST_F(IdsLimit, UnderLimit) { - spvtest::Binaries binaries = { - { - SpvMagicNumber, - SpvVersion, - SPV_GENERATOR_CODEPLAY, - 0x2FFFFFu, // NOTE: Bound - 0u, // NOTE: Schema; reserved - }, - { - SpvMagicNumber, - SpvVersion, - SPV_GENERATOR_CODEPLAY, - 0x100000u, // NOTE: Bound - 0u, // NOTE: Schema; reserved - } - }; - spvtest::Binary linked_binary; - - ASSERT_EQ(SPV_SUCCESS, Link(binaries, &linked_binary)); - EXPECT_THAT(GetErrorMessage(), std::string()); - ASSERT_EQ(0x3FFFFEu, linked_binary[3]); -} - -TEST_F(IdsLimit, OverLimit) { - spvtest::Binaries binaries = { - { - SpvMagicNumber, - SpvVersion, - SPV_GENERATOR_CODEPLAY, - 0x2FFFFFu, // NOTE: Bound - 0u, // NOTE: Schema; reserved - }, - { - SpvMagicNumber, - SpvVersion, - SPV_GENERATOR_CODEPLAY, - 0x100000u, // NOTE: Bound - 0u, // NOTE: Schema; reserved - }, - { - SpvMagicNumber, - SpvVersion, - SPV_GENERATOR_CODEPLAY, - 3u, // NOTE: Bound - 0u, // NOTE: Schema; reserved - } - }; - - spvtest::Binary linked_binary; - - ASSERT_EQ(SPV_ERROR_INVALID_ID, Link(binaries, &linked_binary)); - EXPECT_THAT(GetErrorMessage(), - HasSubstr("The limit of IDs, 4194303, was exceeded: 4194304 is " - "the current ID bound.")); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/link/linker_fixture.h vulkan-1.1.73+dfsg/external/spirv-tools/test/link/linker_fixture.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/link/linker_fixture.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/link/linker_fixture.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,124 +0,0 @@ -// Copyright (c) 2017 Pierre Moreau -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_TEST_LINK_LINK_TEST -#define LIBSPIRV_TEST_LINK_LINK_TEST - -#include - -#include "source/spirv_constant.h" -#include "unit_spirv.h" - -#include "spirv-tools/linker.hpp" - -namespace spvtest { - -using Binary = std::vector; -using Binaries = std::vector; - -class LinkerTest : public ::testing::Test { - public: - LinkerTest() - : tools_(SPV_ENV_UNIVERSAL_1_2), - linker_(SPV_ENV_UNIVERSAL_1_2), - assemble_options_(spvtools::SpirvTools::kDefaultAssembleOption), - disassemble_options_(spvtools::SpirvTools::kDefaultDisassembleOption) { - const auto consumer = [this](spv_message_level_t level, const char*, - const spv_position_t& position, - const char* message) { - if (!error_message_.empty()) error_message_ += "\n"; - switch (level) { - case SPV_MSG_FATAL: - case SPV_MSG_INTERNAL_ERROR: - case SPV_MSG_ERROR: - error_message_ += "ERROR"; - break; - case SPV_MSG_WARNING: - error_message_ += "WARNING"; - break; - case SPV_MSG_INFO: - error_message_ += "INFO"; - break; - case SPV_MSG_DEBUG: - error_message_ += "DEBUG"; - break; - } - error_message_ += ": " + std::to_string(position.index) + ": " + message; - }; - tools_.SetMessageConsumer(consumer); - linker_.SetMessageConsumer(consumer); - } - - virtual void TearDown() override { error_message_.clear(); } - - // Assembles each of the given strings into SPIR-V binaries before linking - // them together. SPV_ERROR_INVALID_TEXT is returned if the assembling failed - // for any of the input strings, and SPV_ERROR_INVALID_POINTER if - // |linked_binary| is a null pointer. - spv_result_t AssembleAndLink( - const std::vector& bodies, spvtest::Binary* linked_binary, - spvtools::LinkerOptions options = spvtools::LinkerOptions()) { - if (!linked_binary) return SPV_ERROR_INVALID_POINTER; - - spvtest::Binaries binaries(bodies.size()); - for (size_t i = 0u; i < bodies.size(); ++i) - if (!tools_.Assemble(bodies[i], binaries.data() + i, assemble_options_)) - return SPV_ERROR_INVALID_TEXT; - - return linker_.Link(binaries, *linked_binary, options); - } - - // Links the given SPIR-V binaries together; SPV_ERROR_INVALID_POINTER is - // returned if |linked_binary| is a null pointer. - spv_result_t Link( - const spvtest::Binaries& binaries, spvtest::Binary* linked_binary, - spvtools::LinkerOptions options = spvtools::LinkerOptions()) { - if (!linked_binary) return SPV_ERROR_INVALID_POINTER; - return linker_.Link(binaries, *linked_binary, options); - } - - // Disassembles |binary| and outputs the result in |text|. If |text| is a - // null pointer, SPV_ERROR_INVALID_POINTER is returned. - spv_result_t Disassemble(const spvtest::Binary& binary, std::string* text) { - if (!text) return SPV_ERROR_INVALID_POINTER; - return tools_.Disassemble(binary, text, disassemble_options_) - ? SPV_SUCCESS - : SPV_ERROR_INVALID_BINARY; - } - - // Sets the options for the assembler. - void SetAssembleOptions(uint32_t assemble_options) { - assemble_options_ = assemble_options; - } - - // Sets the options used by the disassembler. - void SetDisassembleOptions(uint32_t disassemble_options) { - disassemble_options_ = disassemble_options; - } - - // Returns the accumulated error messages for the test. - std::string GetErrorMessage() const { return error_message_; } - - private: - spvtools::SpirvTools - tools_; // An instance for calling SPIRV-Tools functionalities. - spvtools::Linker linker_; - uint32_t assemble_options_; - uint32_t disassemble_options_; - std::string error_message_; -}; - -} // namespace spvtest - -#endif // LIBSPIRV_TEST_LINK_LINK_TEST diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/link/matching_imports_to_exports_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/link/matching_imports_to_exports_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/link/matching_imports_to_exports_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/link/matching_imports_to_exports_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,326 +0,0 @@ -// Copyright (c) 2017 Pierre Moreau -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "gmock/gmock.h" -#include "linker_fixture.h" - -namespace { - -using ::testing::HasSubstr; -using MatchingImportsToExports = spvtest::LinkerTest; - -TEST_F(MatchingImportsToExports, Default) { - const std::string body1 = R"( -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Import -%2 = OpTypeFloat 32 -%1 = OpVariable %2 Uniform -%3 = OpVariable %2 Input -)"; - const std::string body2 = R"( -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Export -%2 = OpTypeFloat 32 -%3 = OpConstant %2 42 -%1 = OpVariable %2 Uniform %3 -)"; - - spvtest::Binary linked_binary; - ASSERT_EQ(SPV_SUCCESS, AssembleAndLink({body1, body2}, &linked_binary)) - << GetErrorMessage(); - - const std::string expected_res = R"(%1 = OpTypeFloat 32 -%2 = OpVariable %1 Input -%3 = OpConstant %1 42 -%4 = OpVariable %1 Uniform %3 -)"; - std::string res_body; - SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); - ASSERT_EQ(SPV_SUCCESS, Disassemble(linked_binary, &res_body)) - << GetErrorMessage(); - ASSERT_EQ(expected_res, res_body); -} - -TEST_F(MatchingImportsToExports, NotALibraryExtraExports) { - const std::string body = R"( -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Export -%2 = OpTypeFloat 32 -%1 = OpVariable %2 Uniform -)"; - - spvtest::Binary linked_binary; - ASSERT_EQ(SPV_SUCCESS, AssembleAndLink({body}, &linked_binary)) - << GetErrorMessage(); - - const std::string expected_res = R"(%1 = OpTypeFloat 32 -%2 = OpVariable %1 Uniform -)"; - std::string res_body; - SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); - ASSERT_EQ(SPV_SUCCESS, Disassemble(linked_binary, &res_body)) - << GetErrorMessage(); - ASSERT_EQ(expected_res, res_body); -} - -TEST_F(MatchingImportsToExports, LibraryExtraExports) { - const std::string body = R"( -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Export -%2 = OpTypeFloat 32 -%1 = OpVariable %2 Uniform -)"; - - spvtest::Binary linked_binary; - spvtools::LinkerOptions options; - options.SetCreateLibrary(true); - ASSERT_EQ(SPV_SUCCESS, AssembleAndLink({body}, &linked_binary, options)) - << GetErrorMessage(); - - const std::string expected_res = R"(OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Export -%2 = OpTypeFloat 32 -%1 = OpVariable %2 Uniform -)"; - std::string res_body; - SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); - ASSERT_EQ(SPV_SUCCESS, Disassemble(linked_binary, &res_body)) - << GetErrorMessage(); - ASSERT_EQ(expected_res, res_body); -} - -TEST_F(MatchingImportsToExports, UnresolvedImports) { - const std::string body1 = R"( -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Import -%2 = OpTypeFloat 32 -%1 = OpVariable %2 Uniform -)"; - const std::string body2 = R"()"; - - spvtest::Binary linked_binary; - ASSERT_EQ(SPV_ERROR_INVALID_BINARY, - AssembleAndLink({body1, body2}, &linked_binary)); - EXPECT_THAT(GetErrorMessage(), - HasSubstr("No export linkage was found for \"foo\".")); -} - -TEST_F(MatchingImportsToExports, TypeMismatch) { - const std::string body1 = R"( -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Import -%2 = OpTypeFloat 32 -%1 = OpVariable %2 Uniform -%3 = OpVariable %2 Input -)"; - const std::string body2 = R"( -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Export -%2 = OpTypeInt 32 0 -%3 = OpConstant %2 42 -%1 = OpVariable %2 Uniform %3 -)"; - - spvtest::Binary linked_binary; - ASSERT_EQ(SPV_ERROR_INVALID_BINARY, - AssembleAndLink({body1, body2}, &linked_binary)) - << GetErrorMessage(); - EXPECT_THAT(GetErrorMessage(), - HasSubstr("Type mismatch between imported variable/function %1 " - "and exported variable/function %4")); -} - -TEST_F(MatchingImportsToExports, MultipleDefinitions) { - const std::string body1 = R"( -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Import -%2 = OpTypeFloat 32 -%1 = OpVariable %2 Uniform -%3 = OpVariable %2 Input -)"; - const std::string body2 = R"( -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Export -%2 = OpTypeFloat 32 -%3 = OpConstant %2 42 -%1 = OpVariable %2 Uniform %3 -)"; - const std::string body3 = R"( -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Export -%2 = OpTypeFloat 32 -%3 = OpConstant %2 -1 -%1 = OpVariable %2 Uniform %3 -)"; - - spvtest::Binary linked_binary; - ASSERT_EQ(SPV_ERROR_INVALID_BINARY, - AssembleAndLink({body1, body2, body3}, &linked_binary)) - << GetErrorMessage(); - EXPECT_THAT( - GetErrorMessage(), - HasSubstr("Too many export linkages, 2, were found for \"foo\".")); -} - -TEST_F(MatchingImportsToExports, SameNameDifferentTypes) { - const std::string body1 = R"( -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Import -%2 = OpTypeFloat 32 -%1 = OpVariable %2 Uniform -%3 = OpVariable %2 Input -)"; - const std::string body2 = R"( -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Export -%2 = OpTypeInt 32 0 -%3 = OpConstant %2 42 -%1 = OpVariable %2 Uniform %3 -)"; - const std::string body3 = R"( -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Export -%2 = OpTypeFloat 32 -%3 = OpConstant %2 12 -%1 = OpVariable %2 Uniform %3 -)"; - - spvtest::Binary linked_binary; - ASSERT_EQ(SPV_ERROR_INVALID_BINARY, - AssembleAndLink({body1, body2, body3}, &linked_binary)) - << GetErrorMessage(); - EXPECT_THAT( - GetErrorMessage(), - HasSubstr("Too many export linkages, 2, were found for \"foo\".")); -} - -TEST_F(MatchingImportsToExports, DecorationMismatch) { - const std::string body1 = R"( -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Import -OpDecorate %2 Constant -%2 = OpTypeFloat 32 -%1 = OpVariable %2 Uniform -%3 = OpVariable %2 Input -)"; - const std::string body2 = R"( -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Export -%2 = OpTypeFloat 32 -%3 = OpConstant %2 42 -%1 = OpVariable %2 Uniform %3 -)"; - - spvtest::Binary linked_binary; - ASSERT_EQ(SPV_ERROR_INVALID_BINARY, - AssembleAndLink({body1, body2}, &linked_binary)) - << GetErrorMessage(); - EXPECT_THAT(GetErrorMessage(), - HasSubstr("Type mismatch between imported variable/function %1 " - "and exported variable/function %4.")); -} - -TEST_F(MatchingImportsToExports, FuncParamAttr) { - const std::string body1 = R"( -OpCapability Kernel -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Import -OpDecorate %2 FuncParamAttr Zext -%3 = OpTypeVoid -%4 = OpTypeInt 32 0 -%5 = OpTypeFunction %3 %4 -%1 = OpFunction %3 None %5 -%2 = OpFunctionParameter %4 -OpFunctionEnd -)"; - const std::string body2 = R"( -OpCapability Kernel -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Export -OpDecorate %2 FuncParamAttr Sext -%3 = OpTypeVoid -%4 = OpTypeInt 32 0 -%5 = OpTypeFunction %3 %4 -%1 = OpFunction %3 None %5 -%2 = OpFunctionParameter %4 -%6 = OpLabel -OpReturn -OpFunctionEnd -)"; - - spvtest::Binary linked_binary; - ASSERT_EQ(SPV_SUCCESS, AssembleAndLink({body1, body2}, &linked_binary)) - << GetErrorMessage(); - - const std::string expected_res = R"(OpCapability Kernel -OpDecorate %1 FuncParamAttr Sext -%2 = OpTypeVoid -%3 = OpTypeInt 32 0 -%4 = OpTypeFunction %2 %3 -%5 = OpFunction %2 None %4 -%1 = OpFunctionParameter %3 -%6 = OpLabel -OpReturn -OpFunctionEnd -)"; - std::string res_body; - SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); - ASSERT_EQ(SPV_SUCCESS, Disassemble(linked_binary, &res_body)) - << GetErrorMessage(); - ASSERT_EQ(expected_res, res_body); -} - -TEST_F(MatchingImportsToExports, FunctionCtrl) { - const std::string body1 = R"( -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Import -%2 = OpTypeVoid -%3 = OpTypeFunction %2 -%4 = OpTypeFloat 32 -%5 = OpVariable %4 Uniform -%1 = OpFunction %2 None %3 -OpFunctionEnd -)"; - const std::string body2 = R"( -OpCapability Linkage -OpDecorate %1 LinkageAttributes "foo" Export -%2 = OpTypeVoid -%3 = OpTypeFunction %2 -%1 = OpFunction %2 Inline %3 -%4 = OpLabel -OpReturn -OpFunctionEnd -)"; - - spvtest::Binary linked_binary; - ASSERT_EQ(SPV_SUCCESS, AssembleAndLink({body1, body2}, &linked_binary)) - << GetErrorMessage(); - - const std::string expected_res = R"(%1 = OpTypeVoid -%2 = OpTypeFunction %1 -%3 = OpTypeFloat 32 -%4 = OpVariable %3 Uniform -%5 = OpFunction %1 Inline %2 -%6 = OpLabel -OpReturn -OpFunctionEnd -)"; - std::string res_body; - SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); - ASSERT_EQ(SPV_SUCCESS, Disassemble(linked_binary, &res_body)) - << GetErrorMessage(); - ASSERT_EQ(expected_res, res_body); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/link/memory_model_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/link/memory_model_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/link/memory_model_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/link/memory_model_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -// Copyright (c) 2017 Pierre Moreau -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "gmock/gmock.h" -#include "linker_fixture.h" - -namespace { - -using ::testing::HasSubstr; - -using MemoryModel = spvtest::LinkerTest; - -TEST_F(MemoryModel, Default) { - const std::string body1 = R"( -OpMemoryModel Logical Simple -)"; - const std::string body2 = R"( -OpMemoryModel Logical Simple -)"; - - spvtest::Binary linked_binary; - ASSERT_EQ(SPV_SUCCESS, AssembleAndLink({body1, body2}, &linked_binary)); - EXPECT_THAT(GetErrorMessage(), std::string()); - - ASSERT_EQ(SpvAddressingModelLogical, linked_binary[6]); - ASSERT_EQ(SpvMemoryModelSimple, linked_binary[7]); -} - -TEST_F(MemoryModel, AddressingMismatch) { - const std::string body1 = R"( -OpMemoryModel Logical Simple -)"; - const std::string body2 = R"( -OpMemoryModel Physical32 Simple -)"; - - spvtest::Binary linked_binary; - ASSERT_EQ(SPV_ERROR_INTERNAL, - AssembleAndLink({body1, body2}, &linked_binary)); - EXPECT_THAT( - GetErrorMessage(), - HasSubstr("Conflicting addressing models: Logical vs Physical32.")); -} - -TEST_F(MemoryModel, MemoryMismatch) { - const std::string body1 = R"( -OpMemoryModel Logical Simple -)"; - const std::string body2 = R"( -OpMemoryModel Logical GLSL450 -)"; - - spvtest::Binary linked_binary; - ASSERT_EQ(SPV_ERROR_INTERNAL, - AssembleAndLink({body1, body2}, &linked_binary)); - EXPECT_THAT(GetErrorMessage(), - HasSubstr("Conflicting memory models: Simple vs GLSL450.")); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/log_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/log_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/log_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/log_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include -#include - -#include "message.h" -#include "opt/log.h" - -namespace { - -using namespace spvtools; -using ::testing::MatchesRegex; - -TEST(Log, Unimplemented) { - int invocation = 0; - auto consumer = [&invocation](spv_message_level_t level, const char* source, - const spv_position_t&, const char* message) { - ++invocation; - EXPECT_EQ(SPV_MSG_INTERNAL_ERROR, level); - EXPECT_THAT(source, MatchesRegex(".*log_test.cpp$")); - EXPECT_STREQ("unimplemented: the-ultimite-feature", message); - }; - - SPIRV_UNIMPLEMENTED(consumer, "the-ultimite-feature"); - EXPECT_EQ(1, invocation); -} - -TEST(Log, Unreachable) { - int invocation = 0; - auto consumer = [&invocation](spv_message_level_t level, const char* source, - const spv_position_t&, const char* message) { - ++invocation; - EXPECT_EQ(SPV_MSG_INTERNAL_ERROR, level); - EXPECT_THAT(source, MatchesRegex(".*log_test.cpp$")); - EXPECT_STREQ("unreachable", message); - }; - - SPIRV_UNREACHABLE(consumer); - EXPECT_EQ(1, invocation); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/move_to_front_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/move_to_front_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/move_to_front_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/move_to_front_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,885 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include -#include -#include - -#include "gmock/gmock.h" -#include "util/move_to_front.h" - -namespace { - -using spvutils::MoveToFront; -using spvutils::MultiMoveToFront; - -// Class used to test the inner workings of MoveToFront. -class MoveToFrontTester : public MoveToFront { - public: - // Inserts the value in the internal tree data structure. For testing only. - void TestInsert(uint32_t val) { - InsertNode(CreateNode(val, val)); - } - - // Removes the value from the internal tree data structure. For testing only. - void TestRemove(uint32_t val) { - const auto it = value_to_node_.find(val); - assert(it != value_to_node_.end()); - RemoveNode(it->second); - } - - // Prints the internal tree data structure to |out|. For testing only. - void PrintTree(std::ostream& out, bool print_timestamp = false) const { - if (root_) - PrintTreeInternal(out, root_, 1, print_timestamp); - } - - // Returns node handle corresponding to the value. The value may not be in the tree. - uint32_t GetNodeHandle(uint32_t value) const { - const auto it = value_to_node_.find(value); - if (it == value_to_node_.end()) - return 0; - - return it->second; - } - - // Returns total node count (both those in the tree and removed, - // but not the NIL singleton). - size_t GetTotalNodeCount() const { - assert(nodes_.size()); - return nodes_.size() - 1; - } - - uint32_t GetLastAccessedValue() const { - return last_accessed_value_; - } - - private: - // Prints the internal tree data structure for debug purposes in the following - // format: - // 10H3S4----5H1S1-----D2 - // 15H2S2----12H1S1----D3 - // Right links are horizontal, left links step down one line. - // 5H1S1 is read as value 5, height 1, size 1. Optionally node label can also - // contain timestamp (5H1S1T15). D3 stands for depth 3. - void PrintTreeInternal(std::ostream& out, uint32_t node, size_t depth, - bool print_timestamp) const; -}; - -void MoveToFrontTester::PrintTreeInternal( - std::ostream& out, uint32_t node, - size_t depth, bool print_timestamp) const { - if (!node) { - out << "D" << depth - 1 << std::endl; - return; - } - - const size_t kTextFieldWvaluethWithoutTimestamp = 10; - const size_t kTextFieldWvaluethWithTimestamp = 14; - const size_t text_field_wvalueth = print_timestamp ? - kTextFieldWvaluethWithTimestamp : kTextFieldWvaluethWithoutTimestamp; - - std::stringstream label; - label << ValueOf(node) << "H" << HeightOf(node) << "S" << SizeOf(node); - if (print_timestamp) - label << "T" << TimestampOf(node); - const size_t label_length = label.str().length(); - if (label_length < text_field_wvalueth) - label << std::string(text_field_wvalueth - label_length, '-'); - - out << label.str(); - - PrintTreeInternal(out, RightOf(node), depth + 1, print_timestamp); - - if (LeftOf(node)) { - out << std::string(depth * text_field_wvalueth, ' '); - PrintTreeInternal(out, LeftOf(node), depth + 1, print_timestamp); - } -} - -void CheckTree(const MoveToFrontTester& mtf, const std::string& expected, - bool print_timestamp = false) { - std::stringstream ss; - mtf.PrintTree(ss, print_timestamp); - EXPECT_EQ(expected, ss.str()); -} - -TEST(MoveToFront, EmptyTree) { - MoveToFrontTester mtf; - CheckTree(mtf, std::string()); -} - -TEST(MoveToFront, InsertLeftRotation) { - MoveToFrontTester mtf; - - mtf.TestInsert(30); - mtf.TestInsert(20); - - CheckTree(mtf, std::string(R"( -30H2S2----20H1S1----D2 -)").substr(1)); - - mtf.TestInsert(10); - CheckTree(mtf, std::string(R"( -20H2S3----10H1S1----D2 - 30H1S1----D2 -)").substr(1)); -} - -TEST(MoveToFront, InsertRightRotation) { - MoveToFrontTester mtf; - - mtf.TestInsert(10); - mtf.TestInsert(20); - - CheckTree(mtf, std::string(R"( -10H2S2----D1 - 20H1S1----D2 -)").substr(1)); - - mtf.TestInsert(30); - CheckTree(mtf, std::string(R"( -20H2S3----10H1S1----D2 - 30H1S1----D2 -)").substr(1)); -} - -TEST(MoveToFront, InsertRightLeftRotation) { - MoveToFrontTester mtf; - - mtf.TestInsert(30); - mtf.TestInsert(20); - - CheckTree(mtf, std::string(R"( -30H2S2----20H1S1----D2 -)").substr(1)); - - mtf.TestInsert(25); - CheckTree(mtf, std::string(R"( -25H2S3----20H1S1----D2 - 30H1S1----D2 -)").substr(1)); -} - -TEST(MoveToFront, InsertLeftRightRotation) { - MoveToFrontTester mtf; - - mtf.TestInsert(10); - mtf.TestInsert(20); - - CheckTree(mtf, std::string(R"( -10H2S2----D1 - 20H1S1----D2 -)").substr(1)); - - mtf.TestInsert(15); - CheckTree(mtf, std::string(R"( -15H2S3----10H1S1----D2 - 20H1S1----D2 -)").substr(1)); -} - -TEST(MoveToFront, RemoveSingleton) { - MoveToFrontTester mtf; - - mtf.TestInsert(10); - CheckTree(mtf, std::string(R"( -10H1S1----D1 -)").substr(1)); - - mtf.TestRemove(10); - CheckTree(mtf, ""); -} - -TEST(MoveToFront, RemoveRootWithScapegoat) { - MoveToFrontTester mtf; - - mtf.TestInsert(10); - mtf.TestInsert(5); - mtf.TestInsert(15); - CheckTree(mtf, std::string(R"( -10H2S3----5H1S1-----D2 - 15H1S1----D2 -)").substr(1)); - - mtf.TestRemove(10); - CheckTree(mtf, std::string(R"( -15H2S2----5H1S1-----D2 -)").substr(1)); -} - -TEST(MoveToFront, RemoveRightRotation) { - MoveToFrontTester mtf; - - mtf.TestInsert(10); - mtf.TestInsert(5); - mtf.TestInsert(15); - mtf.TestInsert(20); - CheckTree(mtf, std::string(R"( -10H3S4----5H1S1-----D2 - 15H2S2----D2 - 20H1S1----D3 -)").substr(1)); - - mtf.TestRemove(5); - - CheckTree(mtf, std::string(R"( -15H2S3----10H1S1----D2 - 20H1S1----D2 -)").substr(1)); -} - -TEST(MoveToFront, RemoveLeftRotation) { - MoveToFrontTester mtf; - - mtf.TestInsert(10); - mtf.TestInsert(15); - mtf.TestInsert(5); - mtf.TestInsert(1); - CheckTree(mtf, std::string(R"( -10H3S4----5H2S2-----1H1S1-----D3 - 15H1S1----D2 -)").substr(1)); - - mtf.TestRemove(15); - - CheckTree(mtf, std::string(R"( -5H2S3-----1H1S1-----D2 - 10H1S1----D2 -)").substr(1)); -} - -TEST(MoveToFront, RemoveLeftRightRotation) { - MoveToFrontTester mtf; - - mtf.TestInsert(10); - mtf.TestInsert(15); - mtf.TestInsert(5); - mtf.TestInsert(12); - CheckTree(mtf, std::string(R"( -10H3S4----5H1S1-----D2 - 15H2S2----12H1S1----D3 -)").substr(1)); - - mtf.TestRemove(5); - - CheckTree(mtf, std::string(R"( -12H2S3----10H1S1----D2 - 15H1S1----D2 -)").substr(1)); -} - -TEST(MoveToFront, RemoveRightLeftRotation) { - MoveToFrontTester mtf; - - mtf.TestInsert(10); - mtf.TestInsert(15); - mtf.TestInsert(5); - mtf.TestInsert(8); - CheckTree(mtf, std::string(R"( -10H3S4----5H2S2-----D2 - 8H1S1-----D3 - 15H1S1----D2 -)").substr(1)); - - mtf.TestRemove(15); - - CheckTree(mtf, std::string(R"( -8H2S3-----5H1S1-----D2 - 10H1S1----D2 -)").substr(1)); -} - -TEST(MoveToFront, MultipleOperations) { - MoveToFrontTester mtf; - std::vector vals = - { 5, 11, 12, 16, 15, 6, 14, 2, 7, 10, 4, 8, 9, 3, 1, 13 }; - - for (uint32_t i : vals) { - mtf.TestInsert(i); - } - - CheckTree(mtf, std::string(R"( -11H5S16---5H4S10----3H3S4-----2H2S2-----1H1S1-----D5 - 4H1S1-----D4 - 7H3S5-----6H1S1-----D4 - 9H2S3-----8H1S1-----D5 - 10H1S1----D5 - 15H3S5----13H2S3----12H1S1----D4 - 14H1S1----D4 - 16H1S1----D3 -)").substr(1)); - - mtf.TestRemove(11); - - CheckTree(mtf, std::string(R"( -10H5S15---5H4S9-----3H3S4-----2H2S2-----1H1S1-----D5 - 4H1S1-----D4 - 7H3S4-----6H1S1-----D4 - 9H2S2-----8H1S1-----D5 - 15H3S5----13H2S3----12H1S1----D4 - 14H1S1----D4 - 16H1S1----D3 -)").substr(1)); - - mtf.TestInsert(11); - - CheckTree(mtf, std::string(R"( -10H5S16---5H4S9-----3H3S4-----2H2S2-----1H1S1-----D5 - 4H1S1-----D4 - 7H3S4-----6H1S1-----D4 - 9H2S2-----8H1S1-----D5 - 13H3S6----12H2S2----11H1S1----D4 - 15H2S3----14H1S1----D4 - 16H1S1----D4 -)").substr(1)); - - mtf.TestRemove(5); - - CheckTree(mtf, std::string(R"( -10H5S15---6H4S8-----3H3S4-----2H2S2-----1H1S1-----D5 - 4H1S1-----D4 - 8H2S3-----7H1S1-----D4 - 9H1S1-----D4 - 13H3S6----12H2S2----11H1S1----D4 - 15H2S3----14H1S1----D4 - 16H1S1----D4 -)").substr(1)); - - mtf.TestInsert(5); - - CheckTree(mtf, std::string(R"( -10H5S16---6H4S9-----3H3S5-----2H2S2-----1H1S1-----D5 - 4H2S2-----D4 - 5H1S1-----D5 - 8H2S3-----7H1S1-----D4 - 9H1S1-----D4 - 13H3S6----12H2S2----11H1S1----D4 - 15H2S3----14H1S1----D4 - 16H1S1----D4 -)").substr(1)); - - mtf.TestRemove(2); - mtf.TestRemove(1); - mtf.TestRemove(4); - mtf.TestRemove(3); - mtf.TestRemove(6); - mtf.TestRemove(5); - mtf.TestRemove(7); - mtf.TestRemove(9); - - CheckTree(mtf, std::string(R"( -13H4S8----10H3S4----8H1S1-----D3 - 12H2S2----11H1S1----D4 - 15H2S3----14H1S1----D3 - 16H1S1----D3 -)").substr(1)); -} - -TEST(MoveToFront, BiggerScaleTreeTest) { - MoveToFrontTester mtf; - std::set all_vals; - - const uint32_t kMagic1 = 2654435761; - const uint32_t kMagic2 = 10000; - - for (uint32_t i = 1; i < 1000; ++i) { - const uint32_t val = (i * kMagic1) % kMagic2; - if (!all_vals.count(val)) { - mtf.TestInsert(val); - all_vals.insert(val); - } - } - - for (uint32_t i = 1; i < 1000; ++i) { - const uint32_t val = (i * kMagic1) % kMagic2; - if (val % 2 == 0) { - mtf.TestRemove(val); - all_vals.erase(val); - } - } - - for (uint32_t i = 1000; i < 2000; ++i) { - const uint32_t val = (i * kMagic1) % kMagic2; - if (!all_vals.count(val)) { - mtf.TestInsert(val); - all_vals.insert(val); - } - } - - for (uint32_t i = 1; i < 2000; ++i) { - const uint32_t val = (i * kMagic1) % kMagic2; - if (val > 50) { - mtf.TestRemove(val); - all_vals.erase(val); - } - } - - EXPECT_EQ(all_vals, std::set({2, 4, 11, 13, 24, 33, 35, 37, 46})); - - CheckTree(mtf, std::string(R"( -33H4S9----11H3S5----2H2S2-----D3 - 4H1S1-----D4 - 13H2S2----D3 - 24H1S1----D4 - 37H2S3----35H1S1----D3 - 46H1S1----D3 -)").substr(1)); -} - -TEST(MoveToFront, RankFromValue) { - MoveToFrontTester mtf; - - uint32_t rank = 0; - EXPECT_FALSE(mtf.RankFromValue(1, &rank)); - - EXPECT_TRUE(mtf.Insert(1)); - EXPECT_TRUE(mtf.Insert(2)); - EXPECT_TRUE(mtf.Insert(3)); - EXPECT_FALSE(mtf.Insert(2)); - CheckTree(mtf, std::string(R"( -2H2S3T2-------1H1S1T1-------D2 - 3H1S1T3-------D2 -)").substr(1), /* print_timestamp = */ true); - - EXPECT_FALSE(mtf.RankFromValue(4, &rank)); - - EXPECT_TRUE(mtf.RankFromValue(1, &rank)); - EXPECT_EQ(3u, rank); - - CheckTree(mtf, std::string(R"( -3H2S3T3-------2H1S1T2-------D2 - 1H1S1T4-------D2 -)").substr(1), /* print_timestamp = */ true); - - EXPECT_TRUE(mtf.RankFromValue(1, &rank)); - EXPECT_EQ(1u, rank); - - EXPECT_TRUE(mtf.RankFromValue(3, &rank)); - EXPECT_EQ(2u, rank); - - EXPECT_TRUE(mtf.RankFromValue(2, &rank)); - EXPECT_EQ(3u, rank); - - EXPECT_TRUE(mtf.Insert(40)); - - EXPECT_TRUE(mtf.RankFromValue(1, &rank)); - EXPECT_EQ(4u, rank); - - EXPECT_TRUE(mtf.Insert(50)); - - EXPECT_TRUE(mtf.RankFromValue(1, &rank)); - EXPECT_EQ(2u, rank); - - CheckTree(mtf, std::string(R"( -2H3S5T6-------3H1S1T5-------D2 - 50H2S3T9------40H1S1T7------D3 - 1H1S1T10------D3 -)").substr(1), /* print_timestamp = */ true); - - EXPECT_TRUE(mtf.RankFromValue(50, &rank)); - EXPECT_EQ(2u, rank); - - EXPECT_EQ(5u, mtf.GetSize()); - CheckTree(mtf, std::string(R"( -2H3S5T6-------3H1S1T5-------D2 - 1H2S3T10------40H1S1T7------D3 - 50H1S1T11-----D3 -)").substr(1), /* print_timestamp = */ true); - - EXPECT_FALSE(mtf.RankFromValue(0, &rank)); - EXPECT_FALSE(mtf.RankFromValue(20, &rank)); -} - -TEST(MoveToFront, ValueFromRank) { - MoveToFrontTester mtf; - - uint32_t value = 0; - EXPECT_FALSE(mtf.ValueFromRank(0, &value)); - EXPECT_FALSE(mtf.ValueFromRank(1, &value)); - - EXPECT_TRUE(mtf.Insert(1)); - EXPECT_EQ(1u, mtf.GetLastAccessedValue()); - EXPECT_TRUE(mtf.Insert(2)); - EXPECT_EQ(2u, mtf.GetLastAccessedValue()); - EXPECT_TRUE(mtf.Insert(3)); - EXPECT_EQ(3u, mtf.GetLastAccessedValue()); - - EXPECT_TRUE(mtf.ValueFromRank(3, &value)); - EXPECT_EQ(1u, value); - EXPECT_EQ(1u, mtf.GetLastAccessedValue()); - - EXPECT_TRUE(mtf.ValueFromRank(1, &value)); - EXPECT_EQ(1u, value); - EXPECT_EQ(1u, mtf.GetLastAccessedValue()); - - CheckTree(mtf, std::string(R"( -3H2S3T3-------2H1S1T2-------D2 - 1H1S1T4-------D2 -)").substr(1), /* print_timestamp = */ true); - - EXPECT_TRUE(mtf.ValueFromRank(2, &value)); - EXPECT_EQ(3u, value); - - EXPECT_EQ(3u, mtf.GetSize()); - - CheckTree(mtf, std::string(R"( -1H2S3T4-------2H1S1T2-------D2 - 3H1S1T5-------D2 -)").substr(1), /* print_timestamp = */ true); - - EXPECT_TRUE(mtf.ValueFromRank(3, &value)); - EXPECT_EQ(2u, value); - - CheckTree(mtf, std::string(R"( -3H2S3T5-------1H1S1T4-------D2 - 2H1S1T6-------D2 -)").substr(1), /* print_timestamp = */ true); - - EXPECT_TRUE(mtf.Insert(10)); - CheckTree(mtf, std::string(R"( -3H3S4T5-------1H1S1T4-------D2 - 2H2S2T6-------D2 - 10H1S1T7------D3 -)").substr(1), /* print_timestamp = */ true); - - EXPECT_TRUE(mtf.ValueFromRank(1, &value)); - EXPECT_EQ(10u, value); -} - -TEST(MoveToFront, Remove) { - MoveToFrontTester mtf; - - EXPECT_FALSE(mtf.Remove(1)); - EXPECT_EQ(0u, mtf.GetTotalNodeCount()); - - EXPECT_TRUE(mtf.Insert(1)); - EXPECT_TRUE(mtf.Insert(2)); - EXPECT_TRUE(mtf.Insert(3)); - - CheckTree(mtf, std::string(R"( -2H2S3T2-------1H1S1T1-------D2 - 3H1S1T3-------D2 -)").substr(1), /* print_timestamp = */ true); - - EXPECT_EQ(1u, mtf.GetNodeHandle(1)); - EXPECT_EQ(3u, mtf.GetTotalNodeCount()); - EXPECT_TRUE(mtf.Remove(1)); - EXPECT_EQ(3u, mtf.GetTotalNodeCount()); - - CheckTree(mtf, std::string(R"( -2H2S2T2-------D1 - 3H1S1T3-------D2 -)").substr(1), /* print_timestamp = */ true); - - uint32_t value = 0; - EXPECT_TRUE(mtf.ValueFromRank(2, &value)); - EXPECT_EQ(2u, value); - - CheckTree(mtf, std::string(R"( -3H2S2T3-------D1 - 2H1S1T4-------D2 -)").substr(1), /* print_timestamp = */ true); - - EXPECT_TRUE(mtf.Insert(1)); - EXPECT_EQ(1u, mtf.GetNodeHandle(1)); - EXPECT_EQ(3u, mtf.GetTotalNodeCount()); -} - -TEST(MoveToFront, LargerScale) { - MoveToFrontTester mtf; - uint32_t value = 0; - uint32_t rank = 0; - - for (uint32_t i = 1; i < 1000; ++i) { - ASSERT_TRUE(mtf.Insert(i)); - ASSERT_EQ(i, mtf.GetSize()); - - ASSERT_TRUE(mtf.RankFromValue(i, &rank)); - ASSERT_EQ(1u, rank); - - ASSERT_TRUE(mtf.ValueFromRank(1, &value)); - ASSERT_EQ(i, value); - } - - ASSERT_TRUE(mtf.ValueFromRank(999, &value)); - ASSERT_EQ(1u, value); - - ASSERT_TRUE(mtf.ValueFromRank(999, &value)); - ASSERT_EQ(2u, value); - - ASSERT_TRUE(mtf.ValueFromRank(999, &value)); - ASSERT_EQ(3u, value); - - ASSERT_TRUE(mtf.ValueFromRank(999, &value)); - ASSERT_EQ(4u, value); - - ASSERT_TRUE(mtf.ValueFromRank(999, &value)); - ASSERT_EQ(5u, value); - - ASSERT_TRUE(mtf.ValueFromRank(999, &value)); - ASSERT_EQ(6u, value); - - ASSERT_TRUE(mtf.ValueFromRank(101, &value)); - ASSERT_EQ(905u, value); - - ASSERT_TRUE(mtf.ValueFromRank(101, &value)); - ASSERT_EQ(906u, value); - - ASSERT_TRUE(mtf.ValueFromRank(101, &value)); - ASSERT_EQ(907u, value); - - ASSERT_TRUE(mtf.ValueFromRank(201, &value)); - ASSERT_EQ(805u, value); - - ASSERT_TRUE(mtf.ValueFromRank(201, &value)); - ASSERT_EQ(806u, value); - - ASSERT_TRUE(mtf.ValueFromRank(201, &value)); - ASSERT_EQ(807u, value); - - ASSERT_TRUE(mtf.ValueFromRank(301, &value)); - ASSERT_EQ(705u, value); - - ASSERT_TRUE(mtf.ValueFromRank(301, &value)); - ASSERT_EQ(706u, value); - - ASSERT_TRUE(mtf.ValueFromRank(301, &value)); - ASSERT_EQ(707u, value); - - ASSERT_TRUE(mtf.RankFromValue(605, &rank)); - ASSERT_EQ(401u, rank); - - ASSERT_TRUE(mtf.RankFromValue(606, &rank)); - ASSERT_EQ(401u, rank); - - ASSERT_TRUE(mtf.RankFromValue(607, &rank)); - ASSERT_EQ(401u, rank); - - ASSERT_TRUE(mtf.ValueFromRank(1, &value)); - ASSERT_EQ(607u, value); - - ASSERT_TRUE(mtf.ValueFromRank(2, &value)); - ASSERT_EQ(606u, value); - - ASSERT_TRUE(mtf.ValueFromRank(3, &value)); - ASSERT_EQ(605u, value); - - ASSERT_TRUE(mtf.ValueFromRank(4, &value)); - ASSERT_EQ(707u, value); - - ASSERT_TRUE(mtf.ValueFromRank(5, &value)); - ASSERT_EQ(706u, value); - - ASSERT_TRUE(mtf.ValueFromRank(6, &value)); - ASSERT_EQ(705u, value); - - ASSERT_TRUE(mtf.ValueFromRank(7, &value)); - ASSERT_EQ(807u, value); - - ASSERT_TRUE(mtf.ValueFromRank(8, &value)); - ASSERT_EQ(806u, value); - - ASSERT_TRUE(mtf.ValueFromRank(9, &value)); - ASSERT_EQ(805u, value); - - ASSERT_TRUE(mtf.ValueFromRank(10, &value)); - ASSERT_EQ(907u, value); - - ASSERT_TRUE(mtf.ValueFromRank(11, &value)); - ASSERT_EQ(906u, value); - - ASSERT_TRUE(mtf.ValueFromRank(12, &value)); - ASSERT_EQ(905u, value); - - ASSERT_TRUE(mtf.ValueFromRank(13, &value)); - ASSERT_EQ(6u, value); - - ASSERT_TRUE(mtf.ValueFromRank(14, &value)); - ASSERT_EQ(5u, value); - - ASSERT_TRUE(mtf.ValueFromRank(15, &value)); - ASSERT_EQ(4u, value); - - ASSERT_TRUE(mtf.ValueFromRank(16, &value)); - ASSERT_EQ(3u, value); - - ASSERT_TRUE(mtf.ValueFromRank(17, &value)); - ASSERT_EQ(2u, value); - - ASSERT_TRUE(mtf.ValueFromRank(18, &value)); - ASSERT_EQ(1u, value); - - ASSERT_TRUE(mtf.ValueFromRank(19, &value)); - ASSERT_EQ(999u, value); - - ASSERT_TRUE(mtf.ValueFromRank(20, &value)); - ASSERT_EQ(998u, value); - - ASSERT_TRUE(mtf.ValueFromRank(21, &value)); - ASSERT_EQ(997u, value); - - ASSERT_TRUE(mtf.RankFromValue(997, &rank)); - ASSERT_EQ(1u, rank); - - ASSERT_TRUE(mtf.RankFromValue(998, &rank)); - ASSERT_EQ(2u, rank); - - ASSERT_TRUE(mtf.RankFromValue(996, &rank)); - ASSERT_EQ(22u, rank); - - ASSERT_TRUE(mtf.Remove(995)); - - ASSERT_TRUE(mtf.RankFromValue(994, &rank)); - ASSERT_EQ(23u, rank); - - for (uint32_t i = 10; i < 1000; ++i) { - if (i != 995) { - ASSERT_TRUE(mtf.Remove(i)); - } else { - ASSERT_FALSE(mtf.Remove(i)); - } - } - - CheckTree(mtf, std::string(R"( -6H4S9T1029----8H2S3T8-------7H1S1T7-------D3 - 9H1S1T9-------D3 - 2H3S5T1033----4H2S3T1031----5H1S1T1030----D4 - 3H1S1T1032----D4 - 1H1S1T1034----D3 -)").substr(1), /* print_timestamp = */ true); - - ASSERT_TRUE(mtf.Insert(1000)); - ASSERT_TRUE(mtf.ValueFromRank(1, &value)); - ASSERT_EQ(1000u, value); -} - -TEST(MoveToFront, String) { - MoveToFront mtf; - - EXPECT_TRUE(mtf.Insert("AAA")); - EXPECT_TRUE(mtf.Insert("BBB")); - EXPECT_TRUE(mtf.Insert("CCC")); - EXPECT_FALSE(mtf.Insert("AAA")); - - EXPECT_TRUE(mtf.HasValue("AAA")); - EXPECT_FALSE(mtf.HasValue("DDD")); - - std::string value; - EXPECT_TRUE(mtf.ValueFromRank(2, &value)); - EXPECT_EQ("BBB", value); - - EXPECT_TRUE(mtf.ValueFromRank(2, &value)); - EXPECT_EQ("CCC", value); - - uint32_t rank = 0; - EXPECT_TRUE(mtf.RankFromValue("AAA", &rank)); - EXPECT_EQ(3u, rank); - - EXPECT_FALSE(mtf.ValueFromRank(0, &value)); - EXPECT_FALSE(mtf.RankFromValue("ABC", &rank)); - EXPECT_FALSE(mtf.Remove("ABC")); - - EXPECT_TRUE(mtf.Remove("AAA")); - EXPECT_FALSE(mtf.Remove("AAA")); - EXPECT_FALSE(mtf.RankFromValue("AAA", &rank)); - - EXPECT_TRUE(mtf.Insert("AAA")); - EXPECT_TRUE(mtf.RankFromValue("AAA", &rank)); - EXPECT_EQ(1u, rank); - - EXPECT_TRUE(mtf.Promote("BBB")); - EXPECT_TRUE(mtf.RankFromValue("BBB", &rank)); - EXPECT_EQ(1u, rank); -} - -TEST(MultiMoveToFront, Empty) { - MultiMoveToFront multi_mtf; - - uint32_t rank = 0; - std::string value; - - EXPECT_EQ(0u, multi_mtf.GetSize(1001)); - EXPECT_FALSE(multi_mtf.RankFromValue(1001, "AAA", &rank)); - EXPECT_FALSE(multi_mtf.ValueFromRank(1001, 1, &value)); - EXPECT_FALSE(multi_mtf.HasValue(1001, "AAA")); - EXPECT_FALSE(multi_mtf.Remove(1001, "AAA")); -} - - -TEST(MultiMoveToFront, TwoSequences) { - MultiMoveToFront multi_mtf; - - uint32_t rank = 0; - std::string value; - - EXPECT_TRUE(multi_mtf.Insert(1001, "AAA")); - - EXPECT_EQ(1u, multi_mtf.GetSize(1001)); - EXPECT_EQ(0u, multi_mtf.GetSize(1002)); - EXPECT_TRUE(multi_mtf.HasValue(1001, "AAA")); - EXPECT_FALSE(multi_mtf.HasValue(1002, "AAA")); - - EXPECT_TRUE(multi_mtf.RankFromValue(1001, "AAA", &rank)); - EXPECT_EQ(1u, rank); - EXPECT_FALSE(multi_mtf.RankFromValue(1002, "AAA", &rank)); - - EXPECT_TRUE(multi_mtf.ValueFromRank(1001, rank, &value)); - EXPECT_EQ("AAA", value); - EXPECT_FALSE(multi_mtf.ValueFromRank(1002, rank, &value)); - - EXPECT_TRUE(multi_mtf.Insert(1001, "BBB")); - - EXPECT_EQ(2u, multi_mtf.GetSize(1001)); - EXPECT_EQ(0u, multi_mtf.GetSize(1002)); - EXPECT_TRUE(multi_mtf.HasValue(1001, "BBB")); - EXPECT_FALSE(multi_mtf.HasValue(1002, "BBB")); - - EXPECT_TRUE(multi_mtf.RankFromValue(1001, "BBB", &rank)); - EXPECT_EQ(1u, rank); - EXPECT_FALSE(multi_mtf.RankFromValue(1002, "BBB", &rank)); - - EXPECT_TRUE(multi_mtf.ValueFromRank(1001, rank, &value)); - EXPECT_EQ("BBB", value); - EXPECT_FALSE(multi_mtf.ValueFromRank(1002, rank, &value)); - - EXPECT_TRUE(multi_mtf.Insert(1002, "AAA")); - - EXPECT_EQ(2u, multi_mtf.GetSize(1001)); - EXPECT_EQ(1u, multi_mtf.GetSize(1002)); - EXPECT_TRUE(multi_mtf.HasValue(1002, "AAA")); - - EXPECT_TRUE(multi_mtf.RankFromValue(1002, "AAA", &rank)); - EXPECT_EQ(1u, rank); - - EXPECT_TRUE(multi_mtf.RankFromValue(1001, "AAA", &rank)); - EXPECT_EQ(2u, rank); - - multi_mtf.Promote("BBB"); - - EXPECT_TRUE(multi_mtf.RankFromValue(1001, "BBB", &rank)); - EXPECT_EQ(1u, rank); - - EXPECT_TRUE(multi_mtf.Insert(1002, "CCC")); - EXPECT_TRUE(multi_mtf.RankFromValue(1002, "CCC", &rank)); - EXPECT_EQ(1u, rank); - - multi_mtf.Promote("AAA"); - EXPECT_TRUE(multi_mtf.RankFromValue(1001, "AAA", &rank)); - EXPECT_EQ(1u, rank); - EXPECT_TRUE(multi_mtf.RankFromValue(1002, "AAA", &rank)); - EXPECT_EQ(1u, rank); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/named_id_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/named_id_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/named_id_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/named_id_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,102 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include - -#include "test_fixture.h" -#include "unit_spirv.h" - -namespace { - -using NamedIdTest = spvtest::TextToBinaryTest; - -TEST_F(NamedIdTest, Default) { - const std::string input = R"( - OpCapability Shader - OpMemoryModel Logical Simple - OpEntryPoint Vertex %main "foo" - %void = OpTypeVoid -%fnMain = OpTypeFunction %void - %main = OpFunction %void None %fnMain -%lbMain = OpLabel - OpReturn - OpFunctionEnd)"; - const std::string output = - "OpCapability Shader\n" - "OpMemoryModel Logical Simple\n" - "OpEntryPoint Vertex %1 \"foo\"\n" - "%2 = OpTypeVoid\n" - "%3 = OpTypeFunction %2\n" - "%1 = OpFunction %2 None %3\n" - "%4 = OpLabel\n" - "OpReturn\n" - "OpFunctionEnd\n"; - EXPECT_EQ(output, EncodeAndDecodeSuccessfully(input)); -} - -struct IdCheckCase { - std::string id; - bool valid; -}; - -using IdValidityTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(IdValidityTest, IdTypes) { - const std::string input = GetParam().id + " = OpTypeVoid"; - SetText(input); - if (GetParam().valid) { - CompileSuccessfully(input); - } else { - CompileFailure(input); - } -} - -INSTANTIATE_TEST_CASE_P( - ValidAndInvalidIds, IdValidityTest, - ::testing::ValuesIn(std::vector({{"%1", true}, - {"%2abc", true}, - {"%3Def", true}, - {"%4GHI", true}, - {"%5_j_k", true}, - {"%6J_M", true}, - {"%n", true}, - {"%O", true}, - {"%p7", true}, - {"%Q8", true}, - {"%R_S", true}, - {"%T_10_U", true}, - {"%V_11", true}, - {"%W_X_13", true}, - {"%_A", true}, - {"%_", true}, - {"%__", true}, - {"%A_", true}, - {"%_A_", true}, - - {"%@", false}, - {"%!", false}, - {"%ABC!", false}, - {"%__A__@", false}, - {"%%", false}, - {"%-", false}, - {"%foo_@_bar", false}, - {"%", false}, - - {"5", false}, - {"32", false}, - {"foo", false}, - {"a%bar", false}})),); - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/name_mapper_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/name_mapper_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/name_mapper_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/name_mapper_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,345 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "gmock/gmock.h" - -#include "test_fixture.h" -#include "unit_spirv.h" - -#include "source/name_mapper.h" - -using libspirv::NameMapper; -using libspirv::FriendlyNameMapper; -using spvtest::ScopedContext; -using ::testing::Eq; - -namespace { - -TEST(TrivialNameTest, Samples) { - auto mapper = libspirv::GetTrivialNameMapper(); - EXPECT_EQ(mapper(1), "1"); - EXPECT_EQ(mapper(1999), "1999"); - EXPECT_EQ(mapper(1024), "1024"); -} - -// A test case for the name mappers that actually look at an assembled module. -struct NameIdCase { - std::string assembly; // Input assembly text - uint32_t id; - std::string expected_name; -}; - -using FriendlyNameTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(FriendlyNameTest, SingleMapping) { - ScopedContext context(SPV_ENV_UNIVERSAL_1_1); - auto words = CompileSuccessfully(GetParam().assembly, SPV_ENV_UNIVERSAL_1_1); - auto friendly_mapper = - FriendlyNameMapper(context.context, words.data(), words.size()); - NameMapper mapper = friendly_mapper.GetNameMapper(); - EXPECT_THAT(mapper(GetParam().id), Eq(GetParam().expected_name)) - << GetParam().assembly << std::endl - << " for id " << GetParam().id; -} - -INSTANTIATE_TEST_CASE_P(ScalarType, FriendlyNameTest, - ::testing::ValuesIn(std::vector{ - {"%1 = OpTypeVoid", 1, "void"}, - {"%1 = OpTypeBool", 1, "bool"}, - {"%1 = OpTypeInt 8 0", 1, "uchar"}, - {"%1 = OpTypeInt 8 1", 1, "char"}, - {"%1 = OpTypeInt 16 0", 1, "ushort"}, - {"%1 = OpTypeInt 16 1", 1, "short"}, - {"%1 = OpTypeInt 32 0", 1, "uint"}, - {"%1 = OpTypeInt 32 1", 1, "int"}, - {"%1 = OpTypeInt 64 0", 1, "ulong"}, - {"%1 = OpTypeInt 64 1", 1, "long"}, - {"%1 = OpTypeInt 1 0", 1, "u1"}, - {"%1 = OpTypeInt 1 1", 1, "i1"}, - {"%1 = OpTypeInt 33 0", 1, "u33"}, - {"%1 = OpTypeInt 33 1", 1, "i33"}, - - {"%1 = OpTypeFloat 16", 1, "half"}, - {"%1 = OpTypeFloat 32", 1, "float"}, - {"%1 = OpTypeFloat 64", 1, "double"}, - {"%1 = OpTypeFloat 10", 1, "fp10"}, - {"%1 = OpTypeFloat 55", 1, "fp55"}, - }), ); - -INSTANTIATE_TEST_CASE_P( - VectorType, FriendlyNameTest, - ::testing::ValuesIn(std::vector{ - {"%1 = OpTypeBool %2 = OpTypeVector %1 1", 2, "v1bool"}, - {"%1 = OpTypeBool %2 = OpTypeVector %1 2", 2, "v2bool"}, - {"%1 = OpTypeBool %2 = OpTypeVector %1 3", 2, "v3bool"}, - {"%1 = OpTypeBool %2 = OpTypeVector %1 4", 2, "v4bool"}, - - {"%1 = OpTypeInt 8 0 %2 = OpTypeVector %1 2", 2, "v2uchar"}, - {"%1 = OpTypeInt 16 1 %2 = OpTypeVector %1 3", 2, "v3short"}, - {"%1 = OpTypeInt 32 0 %2 = OpTypeVector %1 4", 2, "v4uint"}, - {"%1 = OpTypeInt 64 1 %2 = OpTypeVector %1 3", 2, "v3long"}, - {"%1 = OpTypeInt 20 0 %2 = OpTypeVector %1 4", 2, "v4u20"}, - {"%1 = OpTypeInt 21 1 %2 = OpTypeVector %1 3", 2, "v3i21"}, - - {"%1 = OpTypeFloat 32 %2 = OpTypeVector %1 2", 2, "v2float"}, - // OpName overrides the element name. - {"OpName %1 \"time\" %1 = OpTypeFloat 32 %2 = OpTypeVector %1 2", 2, - "v2time"}, - }), ); - -INSTANTIATE_TEST_CASE_P( - MatrixType, FriendlyNameTest, - ::testing::ValuesIn(std::vector{ - {"%1 = OpTypeBool %2 = OpTypeVector %1 2 %3 = OpTypeMatrix %2 2", 3, - "mat2v2bool"}, - {"%1 = OpTypeFloat 32 %2 = OpTypeVector %1 2 %3 = OpTypeMatrix %2 3", 3, - "mat3v2float"}, - {"%1 = OpTypeFloat 32 %2 = OpTypeVector %1 2 %3 = OpTypeMatrix %2 4", 3, - "mat4v2float"}, - {"OpName %1 \"time\" %1 = OpTypeFloat 32 %2 = OpTypeVector %1 2 %3 = " - "OpTypeMatrix %2 4", - 3, "mat4v2time"}, - {"OpName %2 \"lat_long\" %1 = OpTypeFloat 32 %2 = OpTypeVector %1 2 %3 " - "= OpTypeMatrix %2 4", - 3, "mat4lat_long"}, - }), ); - -INSTANTIATE_TEST_CASE_P( - OpName, FriendlyNameTest, - ::testing::ValuesIn(std::vector{ - {"OpName %1 \"abcdefg\"", 1, "abcdefg"}, - {"OpName %1 \"Hello world!\"", 1, "Hello_world_"}, - {"OpName %1 \"0123456789\"", 1, "0123456789"}, - {"OpName %1 \"_\"", 1, "_"}, - // An empty string is not valid for SPIR-V assembly IDs. - {"OpName %1 \"\"", 1, "_"}, - // Test uniqueness when presented with things mapping to "_" - {"OpName %1 \"\" OpName %2 \"\"", 1, "_"}, - {"OpName %1 \"\" OpName %2 \"\"", 2, "__0"}, - {"OpName %1 \"\" OpName %2 \"\" OpName %3 \"_\"", 3, "__1"}, - // Test uniqueness of names that are forced to be - // numbers. - {"OpName %1 \"2\" OpName %2 \"2\"", 1, "2"}, - {"OpName %1 \"2\" OpName %2 \"2\"", 2, "2_0"}, - // Test uniqueness in the face of forward references - // for Ids that don't already have friendly names. - // In particular, the first OpDecorate assigns the name, and - // the second one can't override it. - {"OpDecorate %1 Volatile OpDecorate %1 Restrict", 1, "1"}, - // But a forced name can override the name that - // would have been assigned via the OpDecorate - // forward reference. - {"OpName %1 \"mememe\" OpDecorate %1 Volatile OpDecorate %1 Restrict", - 1, "mememe"}, - // OpName can override other inferences. We assume valid instruction - // ordering, where OpName precedes type definitions. - {"OpName %1 \"myfloat\" %1 = OpTypeFloat 32", 1, "myfloat"}, - }), ); - -INSTANTIATE_TEST_CASE_P( - UniquenessHeuristic, FriendlyNameTest, - ::testing::ValuesIn(std::vector{ - {"%1 = OpTypeVoid %2 = OpTypeVoid %3 = OpTypeVoid", 1, "void"}, - {"%1 = OpTypeVoid %2 = OpTypeVoid %3 = OpTypeVoid", 2, "void_0"}, - {"%1 = OpTypeVoid %2 = OpTypeVoid %3 = OpTypeVoid", 3, "void_1"}, - }), ); - -INSTANTIATE_TEST_CASE_P(Arrays, FriendlyNameTest, - ::testing::ValuesIn(std::vector{ - {"OpName %2 \"FortyTwo\" %1 = OpTypeFloat 32 " - "%2 = OpConstant %1 42 %3 = OpTypeArray %1 %2", - 3, "_arr_float_FortyTwo"}, - {"%1 = OpTypeInt 32 0 " - "%2 = OpTypeRuntimeArray %1", - 2, "_runtimearr_uint"}, - }), ); - -INSTANTIATE_TEST_CASE_P(Structs, FriendlyNameTest, - ::testing::ValuesIn(std::vector{ - {"%1 = OpTypeBool " - "%2 = OpTypeStruct %1 %1 %1", - 2, "_struct_2"}, - {"%1 = OpTypeBool " - "%2 = OpTypeStruct %1 %1 %1 " - "%3 = OpTypeStruct %2 %2", - 3, "_struct_3"}, - }), ); - -INSTANTIATE_TEST_CASE_P( - Pointer, FriendlyNameTest, - ::testing::ValuesIn(std::vector{ - {"%1 = OpTypeFloat 32 %2 = OpTypePointer Workgroup %1", 2, - "_ptr_Workgroup_float"}, - {"%1 = OpTypeBool %2 = OpTypePointer Private %1", 2, - "_ptr_Private_bool"}, - // OpTypeForwardPointer doesn't force generation of the name for its - // target type. - {"%1 = OpTypeBool OpTypeForwardPointer %2 Private %2 = OpTypePointer " - "Private %1", - 2, "_ptr_Private_bool"}, - }), ); - -INSTANTIATE_TEST_CASE_P(ExoticTypes, FriendlyNameTest, - ::testing::ValuesIn(std::vector{ - {"%1 = OpTypeEvent", 1, "Event"}, - {"%1 = OpTypeDeviceEvent", 1, "DeviceEvent"}, - {"%1 = OpTypeReserveId", 1, "ReserveId"}, - {"%1 = OpTypeQueue", 1, "Queue"}, - {"%1 = OpTypeOpaque \"hello world!\"", 1, "Opaque_hello_world_"}, - {"%1 = OpTypePipe ReadOnly", 1, "PipeReadOnly"}, - {"%1 = OpTypePipe WriteOnly", 1, "PipeWriteOnly"}, - {"%1 = OpTypePipe ReadWrite", 1, "PipeReadWrite"}, - {"%1 = OpTypePipeStorage", 1, "PipeStorage"}, - {"%1 = OpTypeNamedBarrier", 1, "NamedBarrier"}, - }), ); - -// Makes a test case for a BuiltIn variable declaration. -NameIdCase BuiltInCase(std::string assembly_name, std::string expected) { - return NameIdCase{std::string("OpDecorate %1 BuiltIn ") + assembly_name + - " %1 = OpVariable %2 Input", - 1, expected}; -} - -// Makes a test case for a BuiltIn variable declaration. In this overload, -// the expected result is the same as the assembly name. -NameIdCase BuiltInCase(std::string assembly_name) { - return BuiltInCase(assembly_name, assembly_name); -} - -// Makes a test case for a BuiltIn variable declaration. In this overload, -// the expected result is the same as the assembly name, but with a "gl_" -// prefix. -NameIdCase BuiltInGLCase(std::string assembly_name) { - return BuiltInCase(assembly_name, std::string("gl_") + assembly_name); -} - -INSTANTIATE_TEST_CASE_P( - BuiltIns, FriendlyNameTest, - ::testing::ValuesIn(std::vector{ - BuiltInGLCase("Position"), - BuiltInGLCase("PointSize"), - BuiltInGLCase("ClipDistance"), - BuiltInGLCase("CullDistance"), - BuiltInCase("VertexId", "gl_VertexID"), - BuiltInCase("InstanceId", "gl_InstanceID"), - BuiltInCase("PrimitiveId", "gl_PrimitiveID"), - BuiltInCase("InvocationId", "gl_InvocationID"), - BuiltInGLCase("Layer"), - BuiltInGLCase("ViewportIndex"), - BuiltInGLCase("TessLevelOuter"), - BuiltInGLCase("TessLevelInner"), - BuiltInGLCase("TessCoord"), - BuiltInGLCase("PatchVertices"), - BuiltInGLCase("FragCoord"), - BuiltInGLCase("PointCoord"), - BuiltInGLCase("FrontFacing"), - BuiltInCase("SampleId", "gl_SampleID"), - BuiltInGLCase("SamplePosition"), - BuiltInGLCase("SampleMask"), - BuiltInGLCase("FragDepth"), - BuiltInGLCase("HelperInvocation"), - BuiltInCase("NumWorkgroups", "gl_NumWorkGroups"), - BuiltInCase("WorkgroupSize", "gl_WorkGroupSize"), - BuiltInCase("WorkgroupId", "gl_WorkGroupID"), - BuiltInCase("LocalInvocationId", "gl_LocalInvocationID"), - BuiltInCase("GlobalInvocationId", "gl_GlobalInvocationID"), - BuiltInGLCase("LocalInvocationIndex"), - BuiltInCase("WorkDim"), - BuiltInCase("GlobalSize"), - BuiltInCase("EnqueuedWorkgroupSize"), - BuiltInCase("GlobalOffset"), - BuiltInCase("GlobalLinearId"), - BuiltInCase("SubgroupSize"), - BuiltInCase("SubgroupMaxSize"), - BuiltInCase("NumSubgroups"), - BuiltInCase("NumEnqueuedSubgroups"), - BuiltInCase("SubgroupId"), - BuiltInCase("SubgroupLocalInvocationId"), - BuiltInGLCase("VertexIndex"), - BuiltInGLCase("InstanceIndex"), - BuiltInCase("SubgroupEqMaskKHR"), - BuiltInCase("SubgroupGeMaskKHR"), - BuiltInCase("SubgroupGtMaskKHR"), - BuiltInCase("SubgroupLeMaskKHR"), - BuiltInCase("SubgroupLtMaskKHR"), - }), ); - -INSTANTIATE_TEST_CASE_P(DebugNameOverridesBuiltin, FriendlyNameTest, - ::testing::ValuesIn(std::vector{ - {"OpName %1 \"foo\" OpDecorate %1 BuiltIn WorkDim " - "%1 = OpVariable %2 Input", - 1, "foo"}}), ); - -INSTANTIATE_TEST_CASE_P( - SimpleIntegralConstants, FriendlyNameTest, - ::testing::ValuesIn(std::vector{ - {"%1 = OpTypeInt 32 0 %2 = OpConstant %1 0", 2, "uint_0"}, - {"%1 = OpTypeInt 32 0 %2 = OpConstant %1 1", 2, "uint_1"}, - {"%1 = OpTypeInt 32 0 %2 = OpConstant %1 2", 2, "uint_2"}, - {"%1 = OpTypeInt 32 0 %2 = OpConstant %1 9", 2, "uint_9"}, - {"%1 = OpTypeInt 32 0 %2 = OpConstant %1 42", 2, "uint_42"}, - {"%1 = OpTypeInt 32 1 %2 = OpConstant %1 0", 2, "int_0"}, - {"%1 = OpTypeInt 32 1 %2 = OpConstant %1 1", 2, "int_1"}, - {"%1 = OpTypeInt 32 1 %2 = OpConstant %1 2", 2, "int_2"}, - {"%1 = OpTypeInt 32 1 %2 = OpConstant %1 9", 2, "int_9"}, - {"%1 = OpTypeInt 32 1 %2 = OpConstant %1 42", 2, "int_42"}, - {"%1 = OpTypeInt 32 1 %2 = OpConstant %1 -42", 2, "int_n42"}, - // Exotic bit widths - {"%1 = OpTypeInt 33 0 %2 = OpConstant %1 0", 2, "u33_0"}, - {"%1 = OpTypeInt 33 1 %2 = OpConstant %1 10", 2, "i33_10"}, - {"%1 = OpTypeInt 33 1 %2 = OpConstant %1 -19", 2, "i33_n19"}, - }), ); - -INSTANTIATE_TEST_CASE_P( - SimpleFloatConstants, FriendlyNameTest, - ::testing::ValuesIn(std::vector{ - {"%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.ff4p+16", 2, - "half_0x1_ff4p_16"}, - {"%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.d2cp-10", 2, - "half_n0x1_d2cpn10"}, - // 32-bit floats - {"%1 = OpTypeFloat 32\n%2 = OpConstant %1 -3.275", 2, "float_n3_275"}, - {"%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1.8p+128", 2, - "float_0x1_8p_128"}, // NaN - {"%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1.0002p+128", 2, - "float_n0x1_0002p_128"}, // NaN - {"%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1p+128", 2, - "float_0x1p_128"}, // Inf - {"%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1p+128", 2, - "float_n0x1p_128"}, // -Inf - // 64-bit floats - {"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -3.275", 2, "double_n3_275"}, - {"%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.ffffffffffffap-1023", 2, - "double_0x1_ffffffffffffapn1023"}, // small normal - {"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.ffffffffffffap-1023", 2, - "double_n0x1_ffffffffffffapn1023"}, - {"%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.8p+1024", 2, - "double_0x1_8p_1024"}, // NaN - {"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.0002p+1024", 2, - "double_n0x1_0002p_1024"}, // NaN - {"%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1p+1024", 2, - "double_0x1p_1024"}, // Inf - {"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1p+1024", 2, - "double_n0x1p_1024"}, // -Inf - }), ); - -INSTANTIATE_TEST_CASE_P( - BooleanConstants, FriendlyNameTest, - ::testing::ValuesIn(std::vector{ - {"%1 = OpTypeBool\n%2 = OpConstantTrue %1", 2, "true"}, - {"%1 = OpTypeBool\n%2 = OpConstantFalse %1", 2, "false"}, - }), ); - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opcode_make_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opcode_make_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opcode_make_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opcode_make_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -namespace { - -// A sampling of word counts. Covers extreme points well, and all bit -// positions, and some combinations of bit positions. -const uint16_t kSampleWordCounts[] = { - 0, 1, 2, 3, 4, 8, 16, 32, 64, 127, 128, - 256, 511, 512, 1024, 2048, 4096, 8192, 16384, 32768, 0xfffe, 0xffff}; - -// A sampling of opcode values. Covers the lower values well, a few samples -// around the number of core instructions (as of this writing), and some -// higher values. -const uint16_t kSampleOpcodes[] = {0, 1, 2, 3, 4, 100, - 300, 305, 1023, 0xfffe, 0xffff}; - -TEST(OpcodeMake, Samples) { - for (auto wordCount : kSampleWordCounts) { - for (auto opcode : kSampleOpcodes) { - uint32_t word = 0; - word |= uint32_t(opcode); - word |= uint32_t(wordCount) << 16; - EXPECT_EQ(word, spvOpcodeMake(wordCount, SpvOp(opcode))); - } - } -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opcode_require_capabilities_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opcode_require_capabilities_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opcode_require_capabilities_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opcode_require_capabilities_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -#include "enum_set.h" - -namespace { - -using libspirv::CapabilitySet; -using spvtest::ElementsIn; - -// Capabilities required by an Opcode. -struct ExpectedOpCodeCapabilities { - SpvOp opcode; - CapabilitySet capabilities; -}; - -using OpcodeTableCapabilitiesTest = - ::testing::TestWithParam; - -TEST_P(OpcodeTableCapabilitiesTest, TableEntryMatchesExpectedCapabilities) { - spv_opcode_table opcodeTable; - ASSERT_EQ(SPV_SUCCESS, - spvOpcodeTableGet(&opcodeTable, SPV_ENV_UNIVERSAL_1_1)); - spv_opcode_desc entry; - ASSERT_EQ(SPV_SUCCESS, - spvOpcodeTableValueLookup(opcodeTable, GetParam().opcode, &entry)); - EXPECT_EQ(ElementsIn(GetParam().capabilities), - ElementsIn(entry->capabilities)); -} - -INSTANTIATE_TEST_CASE_P( - TableRowTest, OpcodeTableCapabilitiesTest, - // Spot-check a few opcodes. - ::testing::Values( - ExpectedOpCodeCapabilities{ - SpvOpImageQuerySize, - CapabilitySet{SpvCapabilityKernel, SpvCapabilityImageQuery}}, - ExpectedOpCodeCapabilities{ - SpvOpImageQuerySizeLod, - CapabilitySet{SpvCapabilityKernel, SpvCapabilityImageQuery}}, - ExpectedOpCodeCapabilities{ - SpvOpImageQueryLevels, - CapabilitySet{SpvCapabilityKernel, SpvCapabilityImageQuery}}, - ExpectedOpCodeCapabilities{ - SpvOpImageQuerySamples, - CapabilitySet{SpvCapabilityKernel, SpvCapabilityImageQuery}}, - ExpectedOpCodeCapabilities{SpvOpImageSparseSampleImplicitLod, - CapabilitySet{SpvCapabilitySparseResidency}}, - ExpectedOpCodeCapabilities{SpvOpCopyMemorySized, - CapabilitySet{SpvCapabilityAddresses}}, - ExpectedOpCodeCapabilities{SpvOpArrayLength, - CapabilitySet{SpvCapabilityShader}}, - ExpectedOpCodeCapabilities{SpvOpFunction, CapabilitySet()}, - ExpectedOpCodeCapabilities{SpvOpConvertFToS, CapabilitySet()}, - ExpectedOpCodeCapabilities{SpvOpEmitStreamVertex, - CapabilitySet{SpvCapabilityGeometryStreams}}, - ExpectedOpCodeCapabilities{SpvOpTypeNamedBarrier, - CapabilitySet{SpvCapabilityNamedBarrier}}, - ExpectedOpCodeCapabilities{ - SpvOpGetKernelMaxNumSubgroups, - CapabilitySet{SpvCapabilitySubgroupDispatch}}), ); - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opcode_split_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opcode_split_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opcode_split_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opcode_split_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -namespace { - -TEST(OpcodeSplit, Default) { - uint32_t word = spvOpcodeMake(42, (SpvOp)23); - uint16_t wordCount = 0; - uint16_t opcode; - spvOpcodeSplit(word, &wordCount, &opcode); - ASSERT_EQ(42, wordCount); - ASSERT_EQ(23, opcode); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opcode_table_get_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opcode_table_get_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opcode_table_get_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opcode_table_get_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include - -#include "unit_spirv.h" - -namespace { - -using GetTargetOpcodeTableGetTest = ::testing::TestWithParam; -using ::testing::ValuesIn; - -TEST_P(GetTargetOpcodeTableGetTest, SanityCheck) { - spv_opcode_table table; - ASSERT_EQ(SPV_SUCCESS, spvOpcodeTableGet(&table, GetParam())); - ASSERT_NE(0u, table->count); - ASSERT_NE(nullptr, table->entries); -} - -TEST_P(GetTargetOpcodeTableGetTest, InvalidPointerTable) { - ASSERT_EQ(SPV_ERROR_INVALID_POINTER, spvOpcodeTableGet(nullptr, GetParam())); -} - -INSTANTIATE_TEST_CASE_P(OpcodeTableGet, GetTargetOpcodeTableGetTest, - ValuesIn(spvtest::AllTargetEnvironments())); - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/operand_capabilities_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/operand_capabilities_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/operand_capabilities_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/operand_capabilities_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,737 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Test capability dependencies for enums. - -#include - -#include "gmock/gmock.h" - -#include "enum_set.h" -#include "unit_spirv.h" - -namespace { - -using libspirv::CapabilitySet; -using spvtest::ElementsIn; -using std::get; -using std::tuple; -using ::testing::Combine; -using ::testing::Eq; -using ::testing::TestWithParam; -using ::testing::Values; -using ::testing::ValuesIn; - -// A test case for mapping an enum to a capability mask. -struct EnumCapabilityCase { - spv_operand_type_t type; - uint32_t value; - CapabilitySet expected_capabilities; -}; - -// Test fixture for testing EnumCapabilityCases. -using EnumCapabilityTest = - TestWithParam>; - -TEST_P(EnumCapabilityTest, Sample) { - spv_operand_table operandTable; - ASSERT_EQ(SPV_SUCCESS, spvOperandTableGet(&operandTable, get<0>(GetParam()))); - spv_operand_desc entry; - ASSERT_EQ(SPV_SUCCESS, - spvOperandTableValueLookup(operandTable, get<1>(GetParam()).type, - get<1>(GetParam()).value, &entry)); - EXPECT_THAT(ElementsIn(entry->capabilities), - Eq(ElementsIn(get<1>(GetParam()).expected_capabilities))) - << " capability value " << get<1>(GetParam()).value; -} - -#define CASE0(TYPE, VALUE) \ - { \ - SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), {} \ - } -#define CASE1(TYPE, VALUE, CAP) \ - { \ - SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), CapabilitySet { \ - SpvCapability##CAP \ - } \ - } -#define CASE2(TYPE, VALUE, CAP1, CAP2) \ - { \ - SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), CapabilitySet { \ - SpvCapability##CAP1, SpvCapability##CAP2 \ - } \ - } -#define CASE5(TYPE, VALUE, CAP1, CAP2, CAP3, CAP4, CAP5) \ - { \ - SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), CapabilitySet { \ - SpvCapability##CAP1, SpvCapability##CAP2, SpvCapability##CAP3, \ - SpvCapability##CAP4, SpvCapability##CAP5 \ - } \ - } - -// See SPIR-V Section 3.3 Execution Model -INSTANTIATE_TEST_CASE_P( - ExecutionModel, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE1(EXECUTION_MODEL, ExecutionModelVertex, Shader), - CASE1(EXECUTION_MODEL, ExecutionModelTessellationControl, - Tessellation), - CASE1(EXECUTION_MODEL, ExecutionModelTessellationEvaluation, - Tessellation), - CASE1(EXECUTION_MODEL, ExecutionModelGeometry, Geometry), - CASE1(EXECUTION_MODEL, ExecutionModelFragment, Shader), - CASE1(EXECUTION_MODEL, ExecutionModelGLCompute, Shader), - CASE1(EXECUTION_MODEL, ExecutionModelKernel, Kernel), - })), ); - -// See SPIR-V Section 3.4 Addressing Model -INSTANTIATE_TEST_CASE_P( - AddressingModel, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE0(ADDRESSING_MODEL, AddressingModelLogical), - CASE1(ADDRESSING_MODEL, AddressingModelPhysical32, Addresses), - CASE1(ADDRESSING_MODEL, AddressingModelPhysical64, Addresses), - })), ); - -// See SPIR-V Section 3.5 Memory Model -INSTANTIATE_TEST_CASE_P( - MemoryModel, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE1(MEMORY_MODEL, MemoryModelSimple, Shader), - CASE1(MEMORY_MODEL, MemoryModelGLSL450, Shader), - CASE1(MEMORY_MODEL, MemoryModelOpenCL, Kernel), - })), ); - -// See SPIR-V Section 3.6 Execution Mode -INSTANTIATE_TEST_CASE_P( - ExecutionMode, EnumCapabilityTest, - Combine( - Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE1(EXECUTION_MODE, ExecutionModeInvocations, Geometry), - CASE1(EXECUTION_MODE, ExecutionModeSpacingEqual, Tessellation), - CASE1(EXECUTION_MODE, ExecutionModeSpacingFractionalEven, - Tessellation), - CASE1(EXECUTION_MODE, ExecutionModeSpacingFractionalOdd, - Tessellation), - CASE1(EXECUTION_MODE, ExecutionModeVertexOrderCw, Tessellation), - CASE1(EXECUTION_MODE, ExecutionModeVertexOrderCcw, Tessellation), - CASE1(EXECUTION_MODE, ExecutionModePixelCenterInteger, Shader), - CASE1(EXECUTION_MODE, ExecutionModeOriginUpperLeft, Shader), - CASE1(EXECUTION_MODE, ExecutionModeOriginLowerLeft, Shader), - CASE1(EXECUTION_MODE, ExecutionModeEarlyFragmentTests, Shader), - CASE1(EXECUTION_MODE, ExecutionModePointMode, Tessellation), - CASE1(EXECUTION_MODE, ExecutionModeXfb, TransformFeedback), - CASE1(EXECUTION_MODE, ExecutionModeDepthReplacing, Shader), - CASE1(EXECUTION_MODE, ExecutionModeDepthGreater, Shader), - CASE1(EXECUTION_MODE, ExecutionModeDepthLess, Shader), - CASE1(EXECUTION_MODE, ExecutionModeDepthUnchanged, Shader), - CASE0(EXECUTION_MODE, ExecutionModeLocalSize), - CASE1(EXECUTION_MODE, ExecutionModeLocalSizeHint, Kernel), - CASE1(EXECUTION_MODE, ExecutionModeInputPoints, Geometry), - CASE1(EXECUTION_MODE, ExecutionModeInputLines, Geometry), - CASE1(EXECUTION_MODE, ExecutionModeInputLinesAdjacency, Geometry), - CASE2(EXECUTION_MODE, ExecutionModeTriangles, Geometry, - Tessellation), - CASE1(EXECUTION_MODE, ExecutionModeInputTrianglesAdjacency, - Geometry), - CASE1(EXECUTION_MODE, ExecutionModeQuads, Tessellation), - CASE1(EXECUTION_MODE, ExecutionModeIsolines, Tessellation), - CASE2(EXECUTION_MODE, ExecutionModeOutputVertices, Geometry, - Tessellation), - CASE1(EXECUTION_MODE, ExecutionModeOutputPoints, Geometry), - CASE1(EXECUTION_MODE, ExecutionModeOutputLineStrip, Geometry), - CASE1(EXECUTION_MODE, ExecutionModeOutputTriangleStrip, Geometry), - CASE1(EXECUTION_MODE, ExecutionModeVecTypeHint, Kernel), - CASE1(EXECUTION_MODE, ExecutionModeContractionOff, Kernel), - })), ); - -INSTANTIATE_TEST_CASE_P( - ExecutionModeV11, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE1(EXECUTION_MODE, ExecutionModeInitializer, Kernel), - CASE1(EXECUTION_MODE, ExecutionModeFinalizer, Kernel), - CASE1(EXECUTION_MODE, ExecutionModeSubgroupSize, - SubgroupDispatch), - CASE1(EXECUTION_MODE, ExecutionModeSubgroupsPerWorkgroup, - SubgroupDispatch)})), ); - -// See SPIR-V Section 3.7 Storage Class -INSTANTIATE_TEST_CASE_P( - StorageClass, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE0(STORAGE_CLASS, StorageClassUniformConstant), - CASE1(STORAGE_CLASS, StorageClassUniform, Shader), - CASE1(STORAGE_CLASS, StorageClassOutput, Shader), - CASE0(STORAGE_CLASS, StorageClassWorkgroup), - CASE0(STORAGE_CLASS, StorageClassCrossWorkgroup), - CASE1(STORAGE_CLASS, StorageClassPrivate, Shader), - CASE0(STORAGE_CLASS, StorageClassFunction), - CASE1(STORAGE_CLASS, StorageClassGeneric, - GenericPointer), // Bug 14287 - CASE1(STORAGE_CLASS, StorageClassPushConstant, Shader), - CASE1(STORAGE_CLASS, StorageClassAtomicCounter, AtomicStorage), - CASE0(STORAGE_CLASS, StorageClassImage), - })), ); - -// See SPIR-V Section 3.8 Dim -INSTANTIATE_TEST_CASE_P( - Dim, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE1(DIMENSIONALITY, Dim1D, Sampled1D), - CASE0(DIMENSIONALITY, Dim2D), CASE0(DIMENSIONALITY, Dim3D), - CASE1(DIMENSIONALITY, DimCube, Shader), - CASE1(DIMENSIONALITY, DimRect, SampledRect), - CASE1(DIMENSIONALITY, DimBuffer, SampledBuffer), - CASE1(DIMENSIONALITY, DimSubpassData, InputAttachment), - })), ); - -// See SPIR-V Section 3.9 Sampler Addressing Mode -INSTANTIATE_TEST_CASE_P( - SamplerAddressingMode, EnumCapabilityTest, - Combine( - Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeNone, Kernel), - CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeClampToEdge, - Kernel), - CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeClamp, Kernel), - CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeRepeat, Kernel), - CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeRepeatMirrored, - Kernel), - })), ); - -// See SPIR-V Section 3.10 Sampler Filter Mode -INSTANTIATE_TEST_CASE_P( - SamplerFilterMode, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE1(SAMPLER_FILTER_MODE, SamplerFilterModeNearest, Kernel), - CASE1(SAMPLER_FILTER_MODE, SamplerFilterModeLinear, Kernel), - })), ); - -// See SPIR-V Section 3.11 Image Format -INSTANTIATE_TEST_CASE_P( - ImageFormat, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - // clang-format off - CASE0(SAMPLER_IMAGE_FORMAT, ImageFormatUnknown), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba32f, Shader), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16f, Shader), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR32f, Shader), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8, Shader), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8Snorm, Shader), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg32f, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16f, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR11fG11fB10f, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16f, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgb10A2, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg8, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16Snorm, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16Snorm, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg8Snorm, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16Snorm, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8Snorm, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba32i, Shader), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16i, Shader), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8i, Shader), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR32i, Shader), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg32i, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16i, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg8i, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16i, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8i, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba32ui, Shader), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16ui, Shader), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8ui, Shader), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8ui, Shader), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgb10a2ui, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg32ui, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16ui, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg8ui, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16ui, StorageImageExtendedFormats), - CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8ui, StorageImageExtendedFormats), - // clang-format on - })), ); - -// See SPIR-V Section 3.12 Image Channel Order -INSTANTIATE_TEST_CASE_P( - ImageChannelOrder, EnumCapabilityTest, - Combine( - Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderR, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderA, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRG, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRA, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRGB, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRGBA, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderBGRA, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderARGB, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderIntensity, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderLuminance, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRx, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRGx, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRGBx, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderDepth, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderDepthStencil, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersRGB, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersRGBx, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersRGBA, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersBGRA, Kernel), - CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderABGR, Kernel), - })), ); - -// See SPIR-V Section 3.13 Image Channel Data Type -INSTANTIATE_TEST_CASE_P( - ImageChannelDataType, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - // clang-format off - CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSnormInt8, Kernel), - CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSnormInt16, Kernel), - CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt8, Kernel), - CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt16, Kernel), - CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormShort565, Kernel), - CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormShort555, Kernel), - CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt101010, Kernel), - CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSignedInt8, Kernel), - CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSignedInt16, Kernel), - CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSignedInt32, Kernel), - CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnsignedInt8, Kernel), - CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnsignedInt16, Kernel), - CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnsignedInt32, Kernel), - CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeHalfFloat, Kernel), - CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeFloat, Kernel), - CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt24, Kernel), - CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt101010_2, Kernel), - // clang-format on - })), ); - -// See SPIR-V Section 3.14 Image Operands -INSTANTIATE_TEST_CASE_P( - ImageOperands, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - // clang-format off - CASE0(OPTIONAL_IMAGE, ImageOperandsMaskNone), - CASE1(OPTIONAL_IMAGE, ImageOperandsBiasMask, Shader), - CASE0(OPTIONAL_IMAGE, ImageOperandsLodMask), - CASE0(OPTIONAL_IMAGE, ImageOperandsGradMask), - CASE0(OPTIONAL_IMAGE, ImageOperandsConstOffsetMask), - CASE1(OPTIONAL_IMAGE, ImageOperandsOffsetMask, ImageGatherExtended), - CASE0(OPTIONAL_IMAGE, ImageOperandsConstOffsetsMask), - CASE0(OPTIONAL_IMAGE, ImageOperandsSampleMask), - CASE1(OPTIONAL_IMAGE, ImageOperandsMinLodMask, MinLod), - // clang-format on - })), ); - -// See SPIR-V Section 3.15 FP Fast Math Mode -INSTANTIATE_TEST_CASE_P( - FPFastMathMode, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE0(FP_FAST_MATH_MODE, FPFastMathModeMaskNone), - CASE1(FP_FAST_MATH_MODE, FPFastMathModeNotNaNMask, Kernel), - CASE1(FP_FAST_MATH_MODE, FPFastMathModeNotInfMask, Kernel), - CASE1(FP_FAST_MATH_MODE, FPFastMathModeNSZMask, Kernel), - CASE1(FP_FAST_MATH_MODE, FPFastMathModeAllowRecipMask, Kernel), - CASE1(FP_FAST_MATH_MODE, FPFastMathModeFastMask, Kernel), - })), ); - -// See SPIR-V Section 3.16 FP Rounding Mode -INSTANTIATE_TEST_CASE_P( - FPRoundingMode, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE5(FP_ROUNDING_MODE, FPRoundingModeRTE, Kernel, - StorageUniformBufferBlock16, StorageUniform16, - StoragePushConstant16, StorageInputOutput16), - CASE5(FP_ROUNDING_MODE, FPRoundingModeRTZ, Kernel, - StorageUniformBufferBlock16, StorageUniform16, - StoragePushConstant16, StorageInputOutput16), - CASE5(FP_ROUNDING_MODE, FPRoundingModeRTP, Kernel, - StorageUniformBufferBlock16, StorageUniform16, - StoragePushConstant16, StorageInputOutput16), - CASE5(FP_ROUNDING_MODE, FPRoundingModeRTN, Kernel, - StorageUniformBufferBlock16, StorageUniform16, - StoragePushConstant16, StorageInputOutput16), - })), ); - -// See SPIR-V Section 3.17 Linkage Type -INSTANTIATE_TEST_CASE_P( - LinkageType, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE1(LINKAGE_TYPE, LinkageTypeExport, Linkage), - CASE1(LINKAGE_TYPE, LinkageTypeImport, Linkage), - })), ); - -// See SPIR-V Section 3.18 Access Qualifier -INSTANTIATE_TEST_CASE_P( - AccessQualifier, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE1(ACCESS_QUALIFIER, AccessQualifierReadOnly, Kernel), - CASE1(ACCESS_QUALIFIER, AccessQualifierWriteOnly, Kernel), - CASE1(ACCESS_QUALIFIER, AccessQualifierReadWrite, Kernel), - })), ); - -// See SPIR-V Section 3.19 Function Parameter Attribute -INSTANTIATE_TEST_CASE_P( - FunctionParameterAttribute, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - // clang-format off - CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeZext, Kernel), - CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeSext, Kernel), - CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeByVal, Kernel), - CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeSret, Kernel), - CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoAlias, Kernel), - CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoCapture, Kernel), - CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoWrite, Kernel), - CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoReadWrite, Kernel), - // clang-format on - })), ); - -// See SPIR-V Section 3.20 Decoration -INSTANTIATE_TEST_CASE_P( - Decoration, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE1(DECORATION, DecorationRelaxedPrecision, Shader), - // DecorationSpecId handled below. - CASE1(DECORATION, DecorationBlock, Shader), - CASE1(DECORATION, DecorationBufferBlock, Shader), - CASE1(DECORATION, DecorationRowMajor, Matrix), - CASE1(DECORATION, DecorationColMajor, Matrix), - CASE1(DECORATION, DecorationArrayStride, Shader), - CASE1(DECORATION, DecorationMatrixStride, Matrix), // Bug 15234 - CASE1(DECORATION, DecorationGLSLShared, Shader), - CASE1(DECORATION, DecorationGLSLPacked, Shader), - CASE1(DECORATION, DecorationCPacked, Kernel), - CASE0(DECORATION, DecorationBuiltIn), // Bug 15248 - // Value 12 placeholder - CASE1(DECORATION, DecorationNoPerspective, Shader), - CASE1(DECORATION, DecorationFlat, Shader), - CASE1(DECORATION, DecorationPatch, Tessellation), - CASE1(DECORATION, DecorationCentroid, Shader), - CASE1(DECORATION, DecorationSample, - SampleRateShading), // Bug 15234 - CASE1(DECORATION, DecorationInvariant, Shader), - CASE0(DECORATION, DecorationRestrict), - CASE0(DECORATION, DecorationAliased), - CASE0(DECORATION, DecorationVolatile), - CASE1(DECORATION, DecorationConstant, Kernel), - CASE0(DECORATION, DecorationCoherent), - CASE0(DECORATION, DecorationNonWritable), - CASE0(DECORATION, DecorationNonReadable), - CASE1(DECORATION, DecorationUniform, Shader), - // Value 27 is an intentional gap in the spec numbering. - CASE1(DECORATION, DecorationSaturatedConversion, Kernel), - CASE1(DECORATION, DecorationStream, GeometryStreams), - CASE1(DECORATION, DecorationLocation, Shader), - CASE1(DECORATION, DecorationComponent, Shader), - CASE1(DECORATION, DecorationIndex, Shader), - CASE1(DECORATION, DecorationBinding, Shader), - CASE1(DECORATION, DecorationDescriptorSet, Shader), - CASE1(DECORATION, DecorationOffset, Shader), // Bug 15268 - CASE1(DECORATION, DecorationXfbBuffer, TransformFeedback), - CASE1(DECORATION, DecorationXfbStride, TransformFeedback), - CASE1(DECORATION, DecorationFuncParamAttr, Kernel), - CASE5(DECORATION, DecorationFPRoundingMode, Kernel, - StorageUniformBufferBlock16, StorageUniform16, - StoragePushConstant16, StorageInputOutput16), - CASE1(DECORATION, DecorationFPFastMathMode, Kernel), - CASE1(DECORATION, DecorationLinkageAttributes, Linkage), - CASE1(DECORATION, DecorationNoContraction, Shader), - CASE1(DECORATION, DecorationInputAttachmentIndex, - InputAttachment), - CASE1(DECORATION, DecorationAlignment, Kernel), - })), ); - -#if 0 -// SpecId has different requirements in v1.0 and v1.1: -INSTANTIATE_TEST_CASE_P(DecorationSpecIdV10, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0), - ValuesIn(std::vector{CASE1( - DECORATION, DecorationSpecId, Shader)})), ); -#endif - -INSTANTIATE_TEST_CASE_P( - DecorationV11, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE2(DECORATION, DecorationSpecId, Shader, Kernel), - CASE1(DECORATION, DecorationMaxByteOffset, Addresses)})), ); - -// See SPIR-V Section 3.21 BuiltIn -INSTANTIATE_TEST_CASE_P( - BuiltIn, EnumCapabilityTest, - Combine( - Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - // clang-format off - CASE1(BUILT_IN, BuiltInPosition, Shader), - CASE1(BUILT_IN, BuiltInPointSize, Shader), - // 2 is an intentional gap in the spec numbering. - CASE1(BUILT_IN, BuiltInClipDistance, ClipDistance), // Bug 1407, 15234 - CASE1(BUILT_IN, BuiltInCullDistance, CullDistance), // Bug 1407, 15234 - CASE1(BUILT_IN, BuiltInVertexId, Shader), - CASE1(BUILT_IN, BuiltInInstanceId, Shader), - CASE2(BUILT_IN, BuiltInPrimitiveId, Geometry, Tessellation), - CASE2(BUILT_IN, BuiltInInvocationId, Geometry, Tessellation), - CASE1(BUILT_IN, BuiltInLayer, Geometry), - CASE1(BUILT_IN, BuiltInViewportIndex, MultiViewport), // Bug 15234 - CASE1(BUILT_IN, BuiltInTessLevelOuter, Tessellation), - CASE1(BUILT_IN, BuiltInTessLevelInner, Tessellation), - CASE1(BUILT_IN, BuiltInTessCoord, Tessellation), - CASE1(BUILT_IN, BuiltInPatchVertices, Tessellation), - CASE1(BUILT_IN, BuiltInFragCoord, Shader), - CASE1(BUILT_IN, BuiltInPointCoord, Shader), - CASE1(BUILT_IN, BuiltInFrontFacing, Shader), - CASE1(BUILT_IN, BuiltInSampleId, SampleRateShading), // Bug 15234 - CASE1(BUILT_IN, BuiltInSamplePosition, SampleRateShading), // Bug 15234 - CASE1(BUILT_IN, BuiltInSampleMask, Shader), // Bug 15234, Issue 182 - // Value 21 intentionally missing - CASE1(BUILT_IN, BuiltInFragDepth, Shader), - CASE1(BUILT_IN, BuiltInHelperInvocation, Shader), - CASE0(BUILT_IN, BuiltInNumWorkgroups), - CASE0(BUILT_IN, BuiltInWorkgroupSize), - CASE0(BUILT_IN, BuiltInWorkgroupId), - CASE0(BUILT_IN, BuiltInLocalInvocationId), - CASE0(BUILT_IN, BuiltInGlobalInvocationId), - CASE0(BUILT_IN, BuiltInLocalInvocationIndex), - CASE1(BUILT_IN, BuiltInWorkDim, Kernel), - CASE1(BUILT_IN, BuiltInGlobalSize, Kernel), - CASE1(BUILT_IN, BuiltInEnqueuedWorkgroupSize, Kernel), - CASE1(BUILT_IN, BuiltInGlobalOffset, Kernel), - CASE1(BUILT_IN, BuiltInGlobalLinearId, Kernel), - // Value 35 intentionally missing - CASE1(BUILT_IN, BuiltInSubgroupSize, Kernel), - CASE1(BUILT_IN, BuiltInSubgroupMaxSize, Kernel), - CASE1(BUILT_IN, BuiltInNumSubgroups, Kernel), - CASE1(BUILT_IN, BuiltInNumEnqueuedSubgroups, Kernel), - CASE1(BUILT_IN, BuiltInSubgroupId, Kernel), - CASE1(BUILT_IN, BuiltInSubgroupLocalInvocationId, Kernel), - CASE1(BUILT_IN, BuiltInVertexIndex, Shader), - CASE1(BUILT_IN, BuiltInInstanceIndex, Shader), - // clang-format on - })), ); - -// See SPIR-V Section 3.22 Selection Control -INSTANTIATE_TEST_CASE_P( - SelectionControl, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE0(SELECTION_CONTROL, SelectionControlMaskNone), - CASE0(SELECTION_CONTROL, SelectionControlFlattenMask), - CASE0(SELECTION_CONTROL, SelectionControlDontFlattenMask), - })), ); - -// See SPIR-V Section 3.23 Loop Control -INSTANTIATE_TEST_CASE_P( - LoopControl, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE0(LOOP_CONTROL, LoopControlMaskNone), - CASE0(LOOP_CONTROL, LoopControlUnrollMask), - CASE0(LOOP_CONTROL, LoopControlDontUnrollMask), - })), ); - -INSTANTIATE_TEST_CASE_P( - LoopControlV11, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE0(LOOP_CONTROL, LoopControlDependencyInfiniteMask), - CASE0(LOOP_CONTROL, LoopControlDependencyLengthMask), - })), ); - -// See SPIR-V Section 3.24 Function Control -INSTANTIATE_TEST_CASE_P( - FunctionControl, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE0(FUNCTION_CONTROL, FunctionControlMaskNone), - CASE0(FUNCTION_CONTROL, FunctionControlInlineMask), - CASE0(FUNCTION_CONTROL, FunctionControlDontInlineMask), - CASE0(FUNCTION_CONTROL, FunctionControlPureMask), - CASE0(FUNCTION_CONTROL, FunctionControlConstMask), - })), ); - -// See SPIR-V Section 3.25 Memory Semantics -INSTANTIATE_TEST_CASE_P( - MemorySemantics, EnumCapabilityTest, - Combine( - Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsMaskNone), - CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsAcquireMask), - CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsReleaseMask), - CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsAcquireReleaseMask), - CASE0(MEMORY_SEMANTICS_ID, - MemorySemanticsSequentiallyConsistentMask), - CASE1(MEMORY_SEMANTICS_ID, MemorySemanticsUniformMemoryMask, - Shader), - CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsSubgroupMemoryMask), - CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsWorkgroupMemoryMask), - CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsCrossWorkgroupMemoryMask), - CASE1(MEMORY_SEMANTICS_ID, MemorySemanticsAtomicCounterMemoryMask, - AtomicStorage), // Bug 15234 - CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsImageMemoryMask), - })), ); - -// See SPIR-V Section 3.26 Memory Access -INSTANTIATE_TEST_CASE_P( - MemoryAccess, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessMaskNone), - CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessVolatileMask), - CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessAlignedMask), - CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessNontemporalMask), - })), ); - -// See SPIR-V Section 3.27 Scope -INSTANTIATE_TEST_CASE_P( - Scope, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE0(SCOPE_ID, ScopeCrossDevice), CASE0(SCOPE_ID, ScopeDevice), - CASE0(SCOPE_ID, ScopeWorkgroup), CASE0(SCOPE_ID, ScopeSubgroup), - CASE0(SCOPE_ID, ScopeInvocation), - })), ); - -// See SPIR-V Section 3.28 Group Operation -INSTANTIATE_TEST_CASE_P( - GroupOperation, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE1(GROUP_OPERATION, GroupOperationReduce, Kernel), - CASE1(GROUP_OPERATION, GroupOperationInclusiveScan, Kernel), - CASE1(GROUP_OPERATION, GroupOperationExclusiveScan, Kernel), - })), ); - -// See SPIR-V Section 3.29 Kernel Enqueue Flags -INSTANTIATE_TEST_CASE_P( - KernelEnqueueFlags, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsNoWait, Kernel), - CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsWaitKernel, Kernel), - CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsWaitWorkGroup, - Kernel), - })), ); - -// See SPIR-V Section 3.30 Kernel Profiling Info -INSTANTIATE_TEST_CASE_P( - KernelProfilingInfo, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE0(KERNEL_PROFILING_INFO, KernelProfilingInfoMaskNone), - CASE1(KERNEL_PROFILING_INFO, KernelProfilingInfoCmdExecTimeMask, - Kernel), - })), ); - -// See SPIR-V Section 3.31 Capability -INSTANTIATE_TEST_CASE_P( - CapabilityDependsOn, EnumCapabilityTest, - Combine( - Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - // clang-format off - CASE0(CAPABILITY, CapabilityMatrix), - CASE1(CAPABILITY, CapabilityShader, Matrix), - CASE1(CAPABILITY, CapabilityGeometry, Shader), - CASE1(CAPABILITY, CapabilityTessellation, Shader), - CASE0(CAPABILITY, CapabilityAddresses), - CASE0(CAPABILITY, CapabilityLinkage), - CASE0(CAPABILITY, CapabilityKernel), - CASE1(CAPABILITY, CapabilityVector16, Kernel), - CASE1(CAPABILITY, CapabilityFloat16Buffer, Kernel), - CASE0(CAPABILITY, CapabilityFloat16), // Bug 15234 - CASE0(CAPABILITY, CapabilityFloat64), - CASE0(CAPABILITY, CapabilityInt64), - CASE1(CAPABILITY, CapabilityInt64Atomics, Int64), - CASE1(CAPABILITY, CapabilityImageBasic, Kernel), - CASE1(CAPABILITY, CapabilityImageReadWrite, ImageBasic), - CASE1(CAPABILITY, CapabilityImageMipmap, ImageBasic), - // Value 16 intentionally missing. - CASE1(CAPABILITY, CapabilityPipes, Kernel), - CASE0(CAPABILITY, CapabilityGroups), - CASE1(CAPABILITY, CapabilityDeviceEnqueue, Kernel), - CASE1(CAPABILITY, CapabilityLiteralSampler, Kernel), - CASE1(CAPABILITY, CapabilityAtomicStorage, Shader), - CASE0(CAPABILITY, CapabilityInt16), - CASE1(CAPABILITY, CapabilityTessellationPointSize, Tessellation), - CASE1(CAPABILITY, CapabilityGeometryPointSize, Geometry), - CASE1(CAPABILITY, CapabilityImageGatherExtended, Shader), - // Value 26 intentionally missing. - CASE1(CAPABILITY, CapabilityStorageImageMultisample, Shader), - CASE1(CAPABILITY, CapabilityUniformBufferArrayDynamicIndexing, Shader), - CASE1(CAPABILITY, CapabilitySampledImageArrayDynamicIndexing, Shader), - CASE1(CAPABILITY, CapabilityStorageBufferArrayDynamicIndexing, Shader), - CASE1(CAPABILITY, CapabilityStorageImageArrayDynamicIndexing, Shader), - CASE1(CAPABILITY, CapabilityClipDistance, Shader), - CASE1(CAPABILITY, CapabilityCullDistance, Shader), - CASE1(CAPABILITY, CapabilityImageCubeArray, SampledCubeArray), - CASE1(CAPABILITY, CapabilitySampleRateShading, Shader), - CASE1(CAPABILITY, CapabilityImageRect, SampledRect), - CASE1(CAPABILITY, CapabilitySampledRect, Shader), - CASE1(CAPABILITY, CapabilityGenericPointer, Addresses), - CASE1(CAPABILITY, CapabilityInt8, Kernel), - CASE1(CAPABILITY, CapabilityInputAttachment, Shader), - CASE1(CAPABILITY, CapabilitySparseResidency, Shader), - CASE1(CAPABILITY, CapabilityMinLod, Shader), - CASE1(CAPABILITY, CapabilityImage1D, Sampled1D), - CASE1(CAPABILITY, CapabilitySampledCubeArray, Shader), - CASE1(CAPABILITY, CapabilityImageBuffer, SampledBuffer), - CASE1(CAPABILITY, CapabilityImageMSArray, Shader), - CASE1(CAPABILITY, CapabilityStorageImageExtendedFormats, Shader), - CASE1(CAPABILITY, CapabilityImageQuery, Shader), - CASE1(CAPABILITY, CapabilityDerivativeControl, Shader), - CASE1(CAPABILITY, CapabilityInterpolationFunction, Shader), - CASE1(CAPABILITY, CapabilityTransformFeedback, Shader), - CASE1(CAPABILITY, CapabilityGeometryStreams, Geometry), - CASE1(CAPABILITY, CapabilityStorageImageReadWithoutFormat, Shader), - CASE1(CAPABILITY, CapabilityStorageImageWriteWithoutFormat, Shader), - CASE1(CAPABILITY, CapabilityMultiViewport, Geometry), - // clang-format on - })), ); - -INSTANTIATE_TEST_CASE_P( - CapabilityDependsOnV11, EnumCapabilityTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector{ - CASE1(CAPABILITY, CapabilitySubgroupDispatch, DeviceEnqueue), - CASE1(CAPABILITY, CapabilityNamedBarrier, Kernel), - CASE1(CAPABILITY, CapabilityPipeStorage, Pipes), - })), ); - -#undef CASE0 -#undef CASE1 -#undef CASE2 - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/operand-class-test-coverage.csv vulkan-1.1.73+dfsg/external/spirv-tools/test/operand-class-test-coverage.csv --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/operand-class-test-coverage.csv 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/operand-class-test-coverage.csv 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -Operand class,Example instruction,Notes,example unit test,negative-enum coverage location -" OperandNone,",UNUSED,not in grammar,,not enum -" OperandId,",many,ID,too many to count,not enum -" OperandOptionalId,","Source, Variable",OPTIONAL_ID,OpSourceAcceptsOptionalFileId,not enum -" OperandOptionalImage,",ImageFetch,,ImageOperandsTest,"TEST_F(ImageOperandsTest, WrongOperand)" -" OperandVariableIds,",ExtInst,,,not enum -" OperandOptionalLiteral,",ExecutionMode,,AnyExecutionMode,not enum -" OperandOptionalLiteralString,",Source,,OpSourceAcceptsOptionalSourceText,not enum -" OperandVariableLiterals,",Decorate,,OpDecorateSimpleTest,not enum -" OperandVariableIdLiteral,",GroupMemberDecorate,,GroupMemberDecorate*,not enum -" OperandVariableLiteralId,",Switch,,Switch*,not enum -" OperandLiteralNumber,","Source, Switch, ...",,Switch*,not enum -" OperandLiteralString,",SourceContinued,,OpSourceContinued,not enum -" OperandSource,",Source,,OpSource,not enum -" OperandExecutionModel,",EntryPoint,,OpEntryPointTest,"TEST_F(OpEntryPointTest, WrongModel)" -" OperandAddressing,",OpMemoryModel,,OpMemoryModelTest,"TEST_F(OpMemoryModelTest, WrongModel)" -" OperandMemory,",OpMemoryModel,,OpMemoryModelTest,"TEST_F(OpMemoryModelTest, WrongModel)" -" OperandExecutionMode,",OpExecutionMode,,OpExecutionModeTest,"TEST_F(OpExecutionModeTest, WrongMode)" -" OperandStorage,","TypePointer, TypeForwardPointer, Variable",,StorageClassTest,"TEST_F(OpTypeForwardPointerTest, WrongClass)" -" OperandDimensionality,",TypeImage,,DimTest/AnyDim,"TEST_F(DimTest, WrongDim)" -" OperandSamplerAddressingMode,",ConstantSampler,,SamplerAddressingModeTest,"TEST_F(SamplerAddressingModeTest, WrongMode)" -" OperandSamplerFilterMode,",ConstantSampler,,AnySamplerFilterMode,"TEST_F(SamplerFilterModeTest, WrongMode)" -" OperandSamplerImageFormat,",TypeImage,SAMPLER_IMAGE_FORMAT,ImageFormatTest,"TEST_F(ImageFormatTest, WrongFormat)" -" OperandImageChannelOrder,",UNUSED,returned as result value only,, -" OperandImageChannelDataType,",UNUSED,returned as result value only,, -" OperandImageOperands,",UNUSED,used to make a spec section,,see OperandOptionalImage -" OperandFPFastMath,",OpDecorate,,CombinedFPFastMathMask,"TEST_F(OpDecorateEnumTest, WrongFPFastMathMode)" -" OperandFPRoundingMode,",OpDecorate,,,"TEST_F(OpDecorateEnumTest, WrongFPRoundingMode)" -" OperandLinkageType,",OpDecorate,,OpDecorateLinkageTest,"TEST_F(OpDecorateLinkageTest, WrongType)" -" OperandAccessQualifier,",OpTypePipe,,AnyAccessQualifier,"TEST_F(OpTypePipeTest, WrongAccessQualifier)" -" OperandFuncParamAttr,",OpDecorate,,TextToBinaryDecorateFuncParamAttr,"TEST_F(OpDecorateEnumTest, WrongFuncParamAttr)" -" OperandDecoration,",OpDecorate,,AnyAccessQualifier,"TEST_F(OpTypePipeTest, WrongAccessQualifier)" -" OperandBuiltIn,",OpDecorate,,TextToBinaryDecorateBultIn,"TEST_F(OpDecorateEnumTest, WrongBuiltIn)" -" OperandSelect,",SelectionMerge,,TextToBinarySelectionMerge,"TEST_F(OpSelectionMergeTest, WrongSelectionControl)" -" OperandLoop,",LoopMerge,,CombinedLoopControlMask,"TEST_F(OpLoopMergeTest, WrongLoopControl)" -" OperandFunction,",Function,,AnySingleFunctionControlMask,"TEST_F(OpFunctionControlTest, WrongFunctionControl)" -" OperandMemorySemantics,",OpMemoryBarrier,"it's an ID, not in grammar",OpMemoryBarrier*,not enum -" OperandMemoryAccess,",UNUSED,"should be on opstore, but hacked in opcode.cpp",,not enum -" OperandScope,",MemoryBarrier,"it's an ID, not in grammar",OpMemoryBarrier*,not enum -" OperandGroupOperation,",GroupIAdd,,GroupOperationTest,"TEST_F(GroupOperationTest, WrongGroupOperation)" -" OperandKernelEnqueueFlags,",OpEnqueueKernel,"it's an ID, not in grammar",should not have one,not enum -" OperandKernelProfilingInfo,",OpCaptureEventProfilingInfo,"it's an ID, not in grammar",should not have one,not enum -" OperandCapability,",Capability,,OpCapabilityTest,"TEST_F(TextToBinaryCapability, BadInvalidCapability)" diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/operand_pattern_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/operand_pattern_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/operand_pattern_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/operand_pattern_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,267 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -#include "gmock/gmock.h" -#include "source/operand.h" - -using ::testing::Eq; - -namespace { - -TEST(OperandPattern, InitiallyEmpty) { - spv_operand_pattern_t empty; - EXPECT_THAT(empty, Eq(spv_operand_pattern_t{})); - EXPECT_EQ(0u, empty.size()); - EXPECT_TRUE(empty.empty()); -} - -TEST(OperandPattern, PushBacksAreOnTheRight) { - spv_operand_pattern_t pattern; - - pattern.push_back(SPV_OPERAND_TYPE_ID); - EXPECT_THAT(pattern, Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_ID})); - EXPECT_EQ(1u, pattern.size()); - EXPECT_TRUE(!pattern.empty()); - EXPECT_EQ(SPV_OPERAND_TYPE_ID, pattern.back()); - - pattern.push_back(SPV_OPERAND_TYPE_NONE); - EXPECT_THAT(pattern, Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_ID, - SPV_OPERAND_TYPE_NONE})); - EXPECT_EQ(2u, pattern.size()); - EXPECT_TRUE(!pattern.empty()); - EXPECT_EQ(SPV_OPERAND_TYPE_NONE, pattern.back()); -} - -TEST(OperandPattern, PopBacksAreOnTheRight) { - spv_operand_pattern_t pattern{SPV_OPERAND_TYPE_ID, - SPV_OPERAND_TYPE_LITERAL_INTEGER}; - - pattern.pop_back(); - EXPECT_THAT(pattern, Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_ID})); - - pattern.pop_back(); - EXPECT_THAT(pattern, Eq(spv_operand_pattern_t{})); -} - -// A test case for typed mask expansion -struct MaskExpansionCase { - spv_operand_type_t type; - uint32_t mask; - spv_operand_pattern_t initial; - spv_operand_pattern_t expected; -}; - -using MaskExpansionTest = ::testing::TestWithParam; - -TEST_P(MaskExpansionTest, Sample) { - spv_operand_table operandTable = nullptr; - ASSERT_EQ(SPV_SUCCESS, - spvOperandTableGet(&operandTable, SPV_ENV_UNIVERSAL_1_0)); - - spv_operand_pattern_t pattern(GetParam().initial); - spvPushOperandTypesForMask(operandTable, GetParam().type, GetParam().mask, - &pattern); - EXPECT_THAT(pattern, Eq(GetParam().expected)); -} - -// These macros let us write non-trivial examples without too much text. -#define PREFIX0 SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE -#define PREFIX1 \ - SPV_OPERAND_TYPE_STORAGE_CLASS, SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE, \ - SPV_OPERAND_TYPE_ID -INSTANTIATE_TEST_CASE_P( - OperandPattern, MaskExpansionTest, - ::testing::ValuesIn(std::vector{ - // No bits means no change. - {SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, 0, {PREFIX0}, {PREFIX0}}, - // Unknown bits means no change. - {SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, - 0xfffffffc, - {PREFIX1}, - {PREFIX1}}, - // Volatile has no operands. - {SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, - SpvMemoryAccessVolatileMask, - {PREFIX0}, - {PREFIX0}}, - // Aligned has one literal number operand. - {SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, - SpvMemoryAccessAlignedMask, - {PREFIX1}, - {PREFIX1, SPV_OPERAND_TYPE_LITERAL_INTEGER}}, - // Volatile with Aligned still has just one literal number operand. - {SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, - SpvMemoryAccessVolatileMask | SpvMemoryAccessAlignedMask, - {PREFIX1}, - {PREFIX1, SPV_OPERAND_TYPE_LITERAL_INTEGER}}, - }), ); -#undef PREFIX0 -#undef PREFIX1 - -// Returns a vector of all operand types that can be used in a pattern. -std::vector allOperandTypes() { - std::vector result; - for (int i = 0; i < SPV_OPERAND_TYPE_NUM_OPERAND_TYPES; i++) { - result.push_back(spv_operand_type_t(i)); - } - return result; -} - -using MatchableOperandExpansionTest = - ::testing::TestWithParam; - -TEST_P(MatchableOperandExpansionTest, MatchableOperandsDontExpand) { - const spv_operand_type_t type = GetParam(); - if (!spvOperandIsVariable(type)) { - spv_operand_pattern_t pattern; - const bool did_expand = spvExpandOperandSequenceOnce(type, &pattern); - EXPECT_FALSE(did_expand); - EXPECT_THAT(pattern, Eq(spv_operand_pattern_t{})); - } -} - -INSTANTIATE_TEST_CASE_P(MatchableOperandExpansion, - MatchableOperandExpansionTest, - ::testing::ValuesIn(allOperandTypes()), ); - -using VariableOperandExpansionTest = - ::testing::TestWithParam; - -TEST_P(VariableOperandExpansionTest, NonMatchableOperandsExpand) { - const spv_operand_type_t type = GetParam(); - if (spvOperandIsVariable(type)) { - spv_operand_pattern_t pattern; - const bool did_expand = spvExpandOperandSequenceOnce(type, &pattern); - EXPECT_TRUE(did_expand); - EXPECT_FALSE(pattern.empty()); - // For the existing rules, the first expansion of a zero-or-more operand - // type yields a matchable operand type. This isn't strictly necessary. - EXPECT_FALSE(spvOperandIsVariable(pattern.back())); - } -} - -INSTANTIATE_TEST_CASE_P(NonMatchableOperandExpansion, - VariableOperandExpansionTest, - ::testing::ValuesIn(allOperandTypes()), ); - -TEST(AlternatePatternFollowingImmediate, Empty) { - EXPECT_THAT(spvAlternatePatternFollowingImmediate({}), - Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV})); -} - -TEST(AlternatePatternFollowingImmediate, SingleElement) { - // Spot-check a random selection of types. - EXPECT_THAT(spvAlternatePatternFollowingImmediate( - {SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER}), - Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV})); - EXPECT_THAT( - spvAlternatePatternFollowingImmediate({SPV_OPERAND_TYPE_CAPABILITY}), - Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV})); - EXPECT_THAT( - spvAlternatePatternFollowingImmediate({SPV_OPERAND_TYPE_LOOP_CONTROL}), - Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV})); - EXPECT_THAT(spvAlternatePatternFollowingImmediate( - {SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER}), - Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV})); - EXPECT_THAT(spvAlternatePatternFollowingImmediate({SPV_OPERAND_TYPE_ID}), - Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV})); -} - -TEST(AlternatePatternFollowingImmediate, SingleResultId) { - EXPECT_THAT( - spvAlternatePatternFollowingImmediate({SPV_OPERAND_TYPE_RESULT_ID}), - Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV, - SPV_OPERAND_TYPE_RESULT_ID})); -} - -TEST(AlternatePatternFollowingImmediate, MultipleNonResultIds) { - EXPECT_THAT( - spvAlternatePatternFollowingImmediate( - {SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER, - SPV_OPERAND_TYPE_CAPABILITY, SPV_OPERAND_TYPE_LOOP_CONTROL, - SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID}), - Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV})); -} - -TEST(AlternatePatternFollowingImmediate, ResultIdFront) { - EXPECT_THAT(spvAlternatePatternFollowingImmediate( - {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}), - Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV, - SPV_OPERAND_TYPE_RESULT_ID, - SPV_OPERAND_TYPE_OPTIONAL_CIV})); - EXPECT_THAT(spvAlternatePatternFollowingImmediate( - {SPV_OPERAND_TYPE_RESULT_ID, - SPV_OPERAND_TYPE_FP_ROUNDING_MODE, SPV_OPERAND_TYPE_ID}), - Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV, - SPV_OPERAND_TYPE_RESULT_ID, - SPV_OPERAND_TYPE_OPTIONAL_CIV, - SPV_OPERAND_TYPE_OPTIONAL_CIV})); - EXPECT_THAT(spvAlternatePatternFollowingImmediate( - {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_DIMENSIONALITY, - SPV_OPERAND_TYPE_LINKAGE_TYPE, - SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE, - SPV_OPERAND_TYPE_FP_ROUNDING_MODE, SPV_OPERAND_TYPE_ID, - SPV_OPERAND_TYPE_VARIABLE_ID}), - Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV, - SPV_OPERAND_TYPE_RESULT_ID, - SPV_OPERAND_TYPE_OPTIONAL_CIV, - SPV_OPERAND_TYPE_OPTIONAL_CIV, - SPV_OPERAND_TYPE_OPTIONAL_CIV, - SPV_OPERAND_TYPE_OPTIONAL_CIV, - SPV_OPERAND_TYPE_OPTIONAL_CIV, - SPV_OPERAND_TYPE_OPTIONAL_CIV})); -} - -TEST(AlternatePatternFollowingImmediate, ResultIdMiddle) { - EXPECT_THAT(spvAlternatePatternFollowingImmediate( - {SPV_OPERAND_TYPE_FP_ROUNDING_MODE, - SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}), - Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV, - SPV_OPERAND_TYPE_RESULT_ID, - SPV_OPERAND_TYPE_OPTIONAL_CIV})); - EXPECT_THAT( - spvAlternatePatternFollowingImmediate( - {SPV_OPERAND_TYPE_DIMENSIONALITY, SPV_OPERAND_TYPE_LINKAGE_TYPE, - SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE, - SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_FP_ROUNDING_MODE, - SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}), - Eq(spv_operand_pattern_t{ - SPV_OPERAND_TYPE_OPTIONAL_CIV, SPV_OPERAND_TYPE_RESULT_ID, - SPV_OPERAND_TYPE_OPTIONAL_CIV, SPV_OPERAND_TYPE_OPTIONAL_CIV, - SPV_OPERAND_TYPE_OPTIONAL_CIV})); -} - -TEST(AlternatePatternFollowingImmediate, ResultIdBack) { - EXPECT_THAT(spvAlternatePatternFollowingImmediate( - {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}), - Eq(spv_operand_pattern_t{SPV_OPERAND_TYPE_OPTIONAL_CIV, - SPV_OPERAND_TYPE_RESULT_ID})); - EXPECT_THAT(spvAlternatePatternFollowingImmediate( - {SPV_OPERAND_TYPE_FP_ROUNDING_MODE, SPV_OPERAND_TYPE_ID, - SPV_OPERAND_TYPE_RESULT_ID}), - Eq(spv_operand_pattern_t{ - SPV_OPERAND_TYPE_OPTIONAL_CIV, SPV_OPERAND_TYPE_RESULT_ID})); - EXPECT_THAT( - spvAlternatePatternFollowingImmediate( - {SPV_OPERAND_TYPE_DIMENSIONALITY, SPV_OPERAND_TYPE_LINKAGE_TYPE, - SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE, - SPV_OPERAND_TYPE_FP_ROUNDING_MODE, SPV_OPERAND_TYPE_ID, - SPV_OPERAND_TYPE_VARIABLE_ID, SPV_OPERAND_TYPE_RESULT_ID}), - Eq(spv_operand_pattern_t{ - SPV_OPERAND_TYPE_OPTIONAL_CIV, SPV_OPERAND_TYPE_RESULT_ID})); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/operand_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/operand_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/operand_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/operand_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -namespace { - -using GetTargetTest = ::testing::TestWithParam; -using ::testing::ValuesIn; -using std::vector; - -TEST_P(GetTargetTest, Default) { - spv_operand_table table; - ASSERT_EQ(SPV_SUCCESS, spvOperandTableGet(&table, GetParam())); - ASSERT_NE(0u, table->count); - ASSERT_NE(nullptr, table->types); -} - -TEST_P(GetTargetTest, InvalidPointerTable) { - ASSERT_EQ(SPV_ERROR_INVALID_POINTER, spvOperandTableGet(nullptr, GetParam())); -} - -INSTANTIATE_TEST_CASE_P(OperandTableGet, GetTargetTest, - ValuesIn(vector{SPV_ENV_UNIVERSAL_1_0, - SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_VULKAN_1_0}), ); - -TEST(OperandString, AllAreDefinedExceptVariable) { - // None has no string, so don't test it. - EXPECT_EQ(0u, SPV_OPERAND_TYPE_NONE); - // Start testing at enum with value 1, skipping None. - for (int i = 1; i < int(SPV_OPERAND_TYPE_FIRST_VARIABLE_TYPE); i++) { - EXPECT_NE(nullptr, spvOperandTypeStr(static_cast(i))) - << " Operand type " << i; - } -} - -TEST(OperandIsConcreteMask, Sample) { - // Check a few operand types preceding the concrete mask types. - EXPECT_FALSE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_NONE)); - EXPECT_FALSE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_ID)); - EXPECT_FALSE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_LITERAL_INTEGER)); - EXPECT_FALSE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_CAPABILITY)); - - // Check all the concrete mask operand types. - EXPECT_TRUE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_IMAGE)); - EXPECT_TRUE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_FP_FAST_MATH_MODE)); - EXPECT_TRUE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_SELECTION_CONTROL)); - EXPECT_TRUE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_LOOP_CONTROL)); - EXPECT_TRUE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_FUNCTION_CONTROL)); - EXPECT_TRUE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_MEMORY_ACCESS)); - - // Check a few operand types after the concrete mask types, including the - // optional forms for Image and MemoryAccess. - EXPECT_FALSE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_OPTIONAL_ID)); - EXPECT_FALSE(spvOperandIsConcreteMask(SPV_OPERAND_TYPE_OPTIONAL_IMAGE)); - EXPECT_FALSE( - spvOperandIsConcreteMask(SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS)); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/aggressive_dead_code_elim_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/aggressive_dead_code_elim_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/aggressive_dead_code_elim_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/aggressive_dead_code_elim_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1398 +0,0 @@ -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; - -using AggressiveDCETest = PassTest<::testing::Test>; - -TEST_F(AggressiveDCETest, EliminateExtendedInst) { - // #version 140 - // - // in vec4 BaseColor; - // in vec4 Dead; - // - // void main() - // { - // vec4 v = BaseColor; - // vec4 dv = sqrt(Dead); - // gl_FragColor = v; - // } - - const std::string predefs1 = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %Dead %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -)"; - - const std::string names_before = - R"(OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %dv "dv" -OpName %Dead "Dead" -OpName %gl_FragColor "gl_FragColor" -)"; - - const std::string names_after = - R"(OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %Dead "Dead" -OpName %gl_FragColor "gl_FragColor" -)"; - - const std::string predefs2 = - R"(%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%Dead = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string func_before = - R"(%main = OpFunction %void None %9 -%15 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%dv = OpVariable %_ptr_Function_v4float Function -%16 = OpLoad %v4float %BaseColor -OpStore %v %16 -%17 = OpLoad %v4float %Dead -%18 = OpExtInst %v4float %1 Sqrt %17 -OpStore %dv %18 -%19 = OpLoad %v4float %v -OpStore %gl_FragColor %19 -OpReturn -OpFunctionEnd -)"; - - const std::string func_after = - R"(%main = OpFunction %void None %9 -%15 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%16 = OpLoad %v4float %BaseColor -OpStore %v %16 -%19 = OpLoad %v4float %v -OpStore %gl_FragColor %19 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs1 + names_before + predefs2 + func_before, - predefs1 + names_after + predefs2 + func_after, - true, true); -} - -TEST_F(AggressiveDCETest, NoEliminateFrexp) { - // Note: SPIR-V hand-edited to utilize Frexp - // - // #version 450 - // - // in vec4 BaseColor; - // in vec4 Dead; - // out vec4 Color; - // out ivec4 iv2; - // - // void main() - // { - // vec4 v = BaseColor; - // vec4 dv = frexp(Dead, iv2); - // Color = v; - // } - - const std::string predefs1 = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %Dead %iv2 %Color -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 450 -)"; - - const std::string names_before = - R"(OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %dv "dv" -OpName %Dead "Dead" -OpName %iv2 "iv2" -OpName %ResType "ResType" -OpName %Color "Color" -)"; - - const std::string names_after = - R"(OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %Dead "Dead" -OpName %iv2 "iv2" -OpName %ResType "ResType" -OpName %Color "Color" -)"; - - const std::string predefs2 = - R"(%void = OpTypeVoid -%11 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%Dead = OpVariable %_ptr_Input_v4float Input -%int = OpTypeInt 32 1 -%v4int = OpTypeVector %int 4 -%_ptr_Output_v4int = OpTypePointer Output %v4int -%iv2 = OpVariable %_ptr_Output_v4int Output -%ResType = OpTypeStruct %v4float %v4int -%_ptr_Output_v4float = OpTypePointer Output %v4float -%Color = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string func_before = - R"(%main = OpFunction %void None %11 -%20 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%dv = OpVariable %_ptr_Function_v4float Function -%21 = OpLoad %v4float %BaseColor -OpStore %v %21 -%22 = OpLoad %v4float %Dead -%23 = OpExtInst %v4float %1 Frexp %22 %iv2 -OpStore %dv %23 -%24 = OpLoad %v4float %v -OpStore %Color %24 -OpReturn -OpFunctionEnd -)"; - - const std::string func_after = - R"(%main = OpFunction %void None %11 -%20 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%21 = OpLoad %v4float %BaseColor -OpStore %v %21 -%22 = OpLoad %v4float %Dead -%23 = OpExtInst %v4float %1 Frexp %22 %iv2 -%24 = OpLoad %v4float %v -OpStore %Color %24 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs1 + names_before + predefs2 + func_before, - predefs1 + names_after + predefs2 + func_after, - true, true); -} - -TEST_F(AggressiveDCETest, EliminateDecorate) { - // Note: The SPIR-V was hand-edited to add the OpDecorate - // - // #version 140 - // - // in vec4 BaseColor; - // in vec4 Dead; - // - // void main() - // { - // vec4 v = BaseColor; - // vec4 dv = Dead * 0.5; - // gl_FragColor = v; - // } - - const std::string predefs1 = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %Dead %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -)"; - - const std::string names_before = - R"(OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %dv "dv" -OpName %Dead "Dead" -OpName %gl_FragColor "gl_FragColor" -OpDecorate %8 RelaxedPrecision -)"; - - const std::string names_after = - R"(OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %Dead "Dead" -OpName %gl_FragColor "gl_FragColor" -)"; - - const std::string predefs2 = - R"(%void = OpTypeVoid -%10 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%Dead = OpVariable %_ptr_Input_v4float Input -%float_0_5 = OpConstant %float 0.5 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string func_before = - R"(%main = OpFunction %void None %10 -%17 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%dv = OpVariable %_ptr_Function_v4float Function -%18 = OpLoad %v4float %BaseColor -OpStore %v %18 -%19 = OpLoad %v4float %Dead -%8 = OpVectorTimesScalar %v4float %19 %float_0_5 -OpStore %dv %8 -%20 = OpLoad %v4float %v -OpStore %gl_FragColor %20 -OpReturn -OpFunctionEnd -)"; - - const std::string func_after = - R"(%main = OpFunction %void None %10 -%17 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%18 = OpLoad %v4float %BaseColor -OpStore %v %18 -%20 = OpLoad %v4float %v -OpStore %gl_FragColor %20 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs1 + names_before + predefs2 + func_before, - predefs1 + names_after + predefs2 + func_after, - true, true); -} - -TEST_F(AggressiveDCETest, Simple) { - // #version 140 - // - // in vec4 BaseColor; - // in vec4 Dead; - // - // void main() - // { - // vec4 v = BaseColor; - // vec4 dv = Dead; - // gl_FragColor = v; - // } - - const std::string predefs1 = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %Dead %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -)"; - - const std::string names_before = - R"(OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %dv "dv" -OpName %Dead "Dead" -OpName %gl_FragColor "gl_FragColor" -)"; - - const std::string names_after = - R"(OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %Dead "Dead" -OpName %gl_FragColor "gl_FragColor" -)"; - - const std::string predefs2 = - R"(%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%Dead = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string func_before = - R"(%main = OpFunction %void None %9 -%15 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%dv = OpVariable %_ptr_Function_v4float Function -%16 = OpLoad %v4float %BaseColor -OpStore %v %16 -%17 = OpLoad %v4float %Dead -OpStore %dv %17 -%18 = OpLoad %v4float %v -OpStore %gl_FragColor %18 -OpReturn -OpFunctionEnd -)"; - - const std::string func_after = - R"(%main = OpFunction %void None %9 -%15 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%16 = OpLoad %v4float %BaseColor -OpStore %v %16 -%18 = OpLoad %v4float %v -OpStore %gl_FragColor %18 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs1 + names_before + predefs2 + func_before, - predefs1 + names_after + predefs2 + func_after, - true, true); -} - -TEST_F(AggressiveDCETest, DeadCycle) { - // #version 140 - // in vec4 BaseColor; - // - // layout(std140) uniform U_t - // { - // int g_I ; - // } ; - // - // void main() - // { - // vec4 v = BaseColor; - // float df = 0.0; - // int i = 0; - // while (i < g_I) { - // df = df * 0.5; - // i = i + 1; - // } - // gl_FragColor = v; - // } - - const std::string predefs1 = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -)"; - - const std::string names_before = - R"(OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %df "df" -OpName %i "i" -OpName %U_t "U_t" -OpMemberName %U_t 0 "g_I" -OpName %_ "" -OpName %gl_FragColor "gl_FragColor" -)"; - - const std::string names_after = - R"(OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %i "i" -OpName %U_t "U_t" -OpMemberName %U_t 0 "g_I" -OpName %_ "" -OpName %gl_FragColor "gl_FragColor" -)"; - - const std::string predefs2 = - R"(OpMemberDecorate %U_t 0 Offset 0 -OpDecorate %U_t Block -OpDecorate %_ DescriptorSet 0 -%void = OpTypeVoid -%11 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_float = OpTypePointer Function %float -%float_0 = OpConstant %float 0 -%int = OpTypeInt 32 1 -%_ptr_Function_int = OpTypePointer Function %int -%int_0 = OpConstant %int 0 -%U_t = OpTypeStruct %int -%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t -%_ = OpVariable %_ptr_Uniform_U_t Uniform -%_ptr_Uniform_int = OpTypePointer Uniform %int -%bool = OpTypeBool -%float_0_5 = OpConstant %float 0.5 -%int_1 = OpConstant %int 1 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string func_before = - R"(%main = OpFunction %void None %11 -%27 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%df = OpVariable %_ptr_Function_float Function -%i = OpVariable %_ptr_Function_int Function -%28 = OpLoad %v4float %BaseColor -OpStore %v %28 -OpStore %df %float_0 -OpStore %i %int_0 -OpBranch %29 -%29 = OpLabel -OpLoopMerge %30 %31 None -OpBranch %32 -%32 = OpLabel -%33 = OpLoad %int %i -%34 = OpAccessChain %_ptr_Uniform_int %_ %int_0 -%35 = OpLoad %int %34 -%36 = OpSLessThan %bool %33 %35 -OpBranchConditional %36 %37 %30 -%37 = OpLabel -%38 = OpLoad %float %df -%39 = OpFMul %float %38 %float_0_5 -OpStore %df %39 -%40 = OpLoad %int %i -%41 = OpIAdd %int %40 %int_1 -OpStore %i %41 -OpBranch %31 -%31 = OpLabel -OpBranch %29 -%30 = OpLabel -%42 = OpLoad %v4float %v -OpStore %gl_FragColor %42 -OpReturn -OpFunctionEnd -)"; - - const std::string func_after = - R"(%main = OpFunction %void None %11 -%27 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%i = OpVariable %_ptr_Function_int Function -%28 = OpLoad %v4float %BaseColor -OpStore %v %28 -OpStore %i %int_0 -OpBranch %29 -%29 = OpLabel -OpLoopMerge %30 %31 None -OpBranch %32 -%32 = OpLabel -%33 = OpLoad %int %i -%34 = OpAccessChain %_ptr_Uniform_int %_ %int_0 -%35 = OpLoad %int %34 -%36 = OpSLessThan %bool %33 %35 -OpBranchConditional %36 %37 %30 -%37 = OpLabel -%40 = OpLoad %int %i -%41 = OpIAdd %int %40 %int_1 -OpStore %i %41 -OpBranch %31 -%31 = OpLabel -OpBranch %29 -%30 = OpLabel -%42 = OpLoad %v4float %v -OpStore %gl_FragColor %42 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs1 + names_before + predefs2 + func_before, - predefs1 + names_after + predefs2 + func_after, - true, true); -} - -TEST_F(AggressiveDCETest, OptWhitelistExtension) { - // #version 140 - // - // in vec4 BaseColor; - // in vec4 Dead; - // - // void main() - // { - // vec4 v = BaseColor; - // vec4 dv = Dead; - // gl_FragColor = v; - // } - - const std::string predefs1 = - R"(OpCapability Shader -OpExtension "SPV_AMD_gpu_shader_int16" -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %Dead %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -)"; - - const std::string names_before = - R"(OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %dv "dv" -OpName %Dead "Dead" -OpName %gl_FragColor "gl_FragColor" -)"; - - const std::string names_after = - R"(OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %Dead "Dead" -OpName %gl_FragColor "gl_FragColor" -)"; - - const std::string predefs2 = - R"(%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%Dead = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string func_before = - R"(%main = OpFunction %void None %9 -%15 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%dv = OpVariable %_ptr_Function_v4float Function -%16 = OpLoad %v4float %BaseColor -OpStore %v %16 -%17 = OpLoad %v4float %Dead -OpStore %dv %17 -%18 = OpLoad %v4float %v -OpStore %gl_FragColor %18 -OpReturn -OpFunctionEnd -)"; - - const std::string func_after = - R"(%main = OpFunction %void None %9 -%15 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%16 = OpLoad %v4float %BaseColor -OpStore %v %16 -%18 = OpLoad %v4float %v -OpStore %gl_FragColor %18 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs1 + names_before + predefs2 + func_before, - predefs1 + names_after + predefs2 + func_after, - true, true); -} - -TEST_F(AggressiveDCETest, NoOptBlacklistExtension) { - // #version 140 - // - // in vec4 BaseColor; - // in vec4 Dead; - // - // void main() - // { - // vec4 v = BaseColor; - // vec4 dv = Dead; - // gl_FragColor = v; - // } - - const std::string assembly = - R"(OpCapability Shader -OpExtension "SPV_KHR_variable_pointers" -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %Dead %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %dv "dv" -OpName %Dead "Dead" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%Dead = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%main = OpFunction %void None %9 -%15 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%dv = OpVariable %_ptr_Function_v4float Function -%16 = OpLoad %v4float %BaseColor -OpStore %v %16 -%17 = OpLoad %v4float %Dead -OpStore %dv %17 -%18 = OpLoad %v4float %v -OpStore %gl_FragColor %18 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - assembly, assembly, true, true); -} - -TEST_F(AggressiveDCETest, ElimWithCall) { - // This demonstrates that "dead" function calls are not eliminated. - // Also demonstrates that DCE will happen in presence of function call. - // #version 140 - // in vec4 i1; - // in vec4 i2; - // - // void nothing(vec4 v) - // { - // } - // - // void main() - // { - // vec4 v1 = i1; - // vec4 v2 = i2; - // nothing(v1); - // gl_FragColor = vec4(0.0); - // } - - const std::string defs_before = - R"( OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %i1 %i2 %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %nothing_vf4_ "nothing(vf4;" -OpName %v "v" -OpName %v1 "v1" -OpName %i1 "i1" -OpName %v2 "v2" -OpName %i2 "i2" -OpName %param "param" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%12 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%16 = OpTypeFunction %void %_ptr_Function_v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%i1 = OpVariable %_ptr_Input_v4float Input -%i2 = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%float_0 = OpConstant %float 0 -%20 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 -)"; - - const std::string defs_after = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %i1 %i2 %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %nothing_vf4_ "nothing(vf4;" -OpName %v "v" -OpName %v1 "v1" -OpName %i1 "i1" -OpName %i2 "i2" -OpName %param "param" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%12 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%16 = OpTypeFunction %void %_ptr_Function_v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%i1 = OpVariable %_ptr_Input_v4float Input -%i2 = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%float_0 = OpConstant %float 0 -%20 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 -)"; - - const std::string func_before = - R"(%main = OpFunction %void None %12 -%21 = OpLabel -%v1 = OpVariable %_ptr_Function_v4float Function -%v2 = OpVariable %_ptr_Function_v4float Function -%param = OpVariable %_ptr_Function_v4float Function -%22 = OpLoad %v4float %i1 -OpStore %v1 %22 -%23 = OpLoad %v4float %i2 -OpStore %v2 %23 -%24 = OpLoad %v4float %v1 -OpStore %param %24 -%25 = OpFunctionCall %void %nothing_vf4_ %param -OpStore %gl_FragColor %20 -OpReturn -OpFunctionEnd -%nothing_vf4_ = OpFunction %void None %16 -%v = OpFunctionParameter %_ptr_Function_v4float -%26 = OpLabel -OpReturn -OpFunctionEnd -)"; - - const std::string func_after = - R"(%main = OpFunction %void None %12 -%21 = OpLabel -%v1 = OpVariable %_ptr_Function_v4float Function -%param = OpVariable %_ptr_Function_v4float Function -%22 = OpLoad %v4float %i1 -OpStore %v1 %22 -%24 = OpLoad %v4float %v1 -OpStore %param %24 -%25 = OpFunctionCall %void %nothing_vf4_ %param -OpStore %gl_FragColor %20 -OpReturn -OpFunctionEnd -%nothing_vf4_ = OpFunction %void None %16 -%v = OpFunctionParameter %_ptr_Function_v4float -%26 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - defs_before + func_before, defs_after + func_after, true, true); -} - -TEST_F(AggressiveDCETest, NoParamElim) { - // This demonstrates that unused parameters are not eliminated, but - // dead uses of them are. - // #version 140 - // - // in vec4 BaseColor; - // - // vec4 foo(vec4 v1, vec4 v2) - // { - // vec4 t = -v1; - // return v2; - // } - // - // void main() - // { - // vec4 dead; - // gl_FragColor = foo(dead, BaseColor); - // } - - const std::string defs_before = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %gl_FragColor %BaseColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %foo_vf4_vf4_ "foo(vf4;vf4;" -OpName %v1 "v1" -OpName %v2 "v2" -OpName %t "t" -OpName %gl_FragColor "gl_FragColor" -OpName %dead "dead" -OpName %BaseColor "BaseColor" -OpName %param "param" -OpName %param_0 "param" -%void = OpTypeVoid -%13 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%17 = OpTypeFunction %v4float %_ptr_Function_v4float %_ptr_Function_v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%main = OpFunction %void None %13 -%20 = OpLabel -%dead = OpVariable %_ptr_Function_v4float Function -%param = OpVariable %_ptr_Function_v4float Function -%param_0 = OpVariable %_ptr_Function_v4float Function -%21 = OpLoad %v4float %dead -OpStore %param %21 -%22 = OpLoad %v4float %BaseColor -OpStore %param_0 %22 -%23 = OpFunctionCall %v4float %foo_vf4_vf4_ %param %param_0 -OpStore %gl_FragColor %23 -OpReturn -OpFunctionEnd -)"; - - const std::string defs_after = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %gl_FragColor %BaseColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %foo_vf4_vf4_ "foo(vf4;vf4;" -OpName %v1 "v1" -OpName %v2 "v2" -OpName %gl_FragColor "gl_FragColor" -OpName %dead "dead" -OpName %BaseColor "BaseColor" -OpName %param "param" -OpName %param_0 "param" -%void = OpTypeVoid -%13 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%17 = OpTypeFunction %v4float %_ptr_Function_v4float %_ptr_Function_v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%main = OpFunction %void None %13 -%20 = OpLabel -%dead = OpVariable %_ptr_Function_v4float Function -%param = OpVariable %_ptr_Function_v4float Function -%param_0 = OpVariable %_ptr_Function_v4float Function -%21 = OpLoad %v4float %dead -OpStore %param %21 -%22 = OpLoad %v4float %BaseColor -OpStore %param_0 %22 -%23 = OpFunctionCall %v4float %foo_vf4_vf4_ %param %param_0 -OpStore %gl_FragColor %23 -OpReturn -OpFunctionEnd -)"; - - const std::string func_before = - R"(%foo_vf4_vf4_ = OpFunction %v4float None %17 -%v1 = OpFunctionParameter %_ptr_Function_v4float -%v2 = OpFunctionParameter %_ptr_Function_v4float -%24 = OpLabel -%t = OpVariable %_ptr_Function_v4float Function -%25 = OpLoad %v4float %v1 -%26 = OpFNegate %v4float %25 -OpStore %t %26 -%27 = OpLoad %v4float %v2 -OpReturnValue %27 -OpFunctionEnd -)"; - - const std::string func_after = - R"(%foo_vf4_vf4_ = OpFunction %v4float None %17 -%v1 = OpFunctionParameter %_ptr_Function_v4float -%v2 = OpFunctionParameter %_ptr_Function_v4float -%24 = OpLabel -%27 = OpLoad %v4float %v2 -OpReturnValue %27 -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - defs_before + func_before, defs_after + func_after, true, true); -} - -TEST_F(AggressiveDCETest, ElimOpaque) { - // SPIR-V not representable from GLSL; not generatable from HLSL - // for the moment. - - const std::string defs_before = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %outColor %texCoords -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpMemberName %S_t 2 "smp" -OpName %outColor "outColor" -OpName %sampler15 "sampler15" -OpName %s0 "s0" -OpName %texCoords "texCoords" -OpDecorate %sampler15 DescriptorSet 0 -%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v2float = OpTypeVector %float 2 -%v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%outColor = OpVariable %_ptr_Output_v4float Output -%14 = OpTypeImage %float 2D 0 0 0 1 Unknown -%15 = OpTypeSampledImage %14 -%S_t = OpTypeStruct %v2float %v2float %15 -%_ptr_Function_S_t = OpTypePointer Function %S_t -%17 = OpTypeFunction %void %_ptr_Function_S_t -%_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15 -%_ptr_Function_15 = OpTypePointer Function %15 -%sampler15 = OpVariable %_ptr_UniformConstant_15 UniformConstant -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%int_2 = OpConstant %int 2 -%_ptr_Function_v2float = OpTypePointer Function %v2float -%_ptr_Input_v2float = OpTypePointer Input %v2float -%texCoords = OpVariable %_ptr_Input_v2float Input -)"; - - const std::string defs_after = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %outColor %texCoords -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpMemberName %S_t 2 "smp" -OpName %outColor "outColor" -OpName %sampler15 "sampler15" -OpName %texCoords "texCoords" -OpDecorate %sampler15 DescriptorSet 0 -%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v2float = OpTypeVector %float 2 -%v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%outColor = OpVariable %_ptr_Output_v4float Output -%14 = OpTypeImage %float 2D 0 0 0 1 Unknown -%15 = OpTypeSampledImage %14 -%S_t = OpTypeStruct %v2float %v2float %15 -%_ptr_Function_S_t = OpTypePointer Function %S_t -%17 = OpTypeFunction %void %_ptr_Function_S_t -%_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15 -%_ptr_Function_15 = OpTypePointer Function %15 -%sampler15 = OpVariable %_ptr_UniformConstant_15 UniformConstant -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%int_2 = OpConstant %int 2 -%_ptr_Function_v2float = OpTypePointer Function %v2float -%_ptr_Input_v2float = OpTypePointer Input %v2float -%texCoords = OpVariable %_ptr_Input_v2float Input -)"; - - const std::string func_before = - R"(%main = OpFunction %void None %9 -%25 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%26 = OpLoad %v2float %texCoords -%27 = OpLoad %S_t %s0 -%28 = OpCompositeInsert %S_t %26 %27 0 -%29 = OpLoad %15 %sampler15 -%30 = OpCompositeInsert %S_t %29 %28 2 -OpStore %s0 %30 -%31 = OpImageSampleImplicitLod %v4float %29 %26 -OpStore %outColor %31 -OpReturn -OpFunctionEnd -)"; - - const std::string func_after = - R"(%main = OpFunction %void None %9 -%25 = OpLabel -%26 = OpLoad %v2float %texCoords -%29 = OpLoad %15 %sampler15 -%31 = OpImageSampleImplicitLod %v4float %29 %26 -OpStore %outColor %31 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - defs_before + func_before, defs_after + func_after, true, true); -} - -TEST_F(AggressiveDCETest, NoParamStoreElim) { - // Should not eliminate stores to params - // - // #version 450 - // - // layout(location = 0) in vec4 BaseColor; - // layout(location = 0) out vec4 OutColor; - // - // void foo(in vec4 v1, out vec4 v2) - // { - // v2 = -v1; - // } - // - // void main() - // { - // foo(BaseColor, OutColor); - // } - - const std::string assembly = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %OutColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 450 -OpName %main "main" -OpName %foo_vf4_vf4_ "foo(vf4;vf4;" -OpName %v1 "v1" -OpName %v2 "v2" -OpName %BaseColor "BaseColor" -OpName %OutColor "OutColor" -OpName %param "param" -OpName %param_0 "param" -OpDecorate %BaseColor Location 0 -OpDecorate %OutColor Location 0 -%void = OpTypeVoid -%11 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%15 = OpTypeFunction %void %_ptr_Function_v4float %_ptr_Function_v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%OutColor = OpVariable %_ptr_Output_v4float Output -%main = OpFunction %void None %11 -%18 = OpLabel -%param = OpVariable %_ptr_Function_v4float Function -%param_0 = OpVariable %_ptr_Function_v4float Function -%19 = OpLoad %v4float %BaseColor -OpStore %param %19 -%20 = OpFunctionCall %void %foo_vf4_vf4_ %param %param_0 -%21 = OpLoad %v4float %param_0 -OpStore %OutColor %21 -OpReturn -OpFunctionEnd -%foo_vf4_vf4_ = OpFunction %void None %15 -%v1 = OpFunctionParameter %_ptr_Function_v4float -%v2 = OpFunctionParameter %_ptr_Function_v4float -%22 = OpLabel -%23 = OpLoad %v4float %v1 -%24 = OpFNegate %v4float %23 -OpStore %v2 %24 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - assembly, assembly, true, true); -} - -TEST_F(AggressiveDCETest, PrivateStoreElimInEntryNoCalls) { - // Eliminate stores to private in entry point with no calls - // Note: Not legal GLSL - // - // layout(location = 0) in vec4 BaseColor; - // layout(location = 1) in vec4 Dead; - // layout(location = 0) out vec4 OutColor; - // - // private vec4 dv; - // - // void main() - // { - // vec4 v = BaseColor; - // dv = Dead; - // OutColor = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %Dead %OutColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 450 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %dv "dv" -OpName %Dead "Dead" -OpName %OutColor "OutColor" -OpDecorate %BaseColor Location 0 -OpDecorate %Dead Location 1 -OpDecorate %OutColor Location 0 -%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Private_v4float = OpTypePointer Private %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%Dead = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%dv = OpVariable %_ptr_Private_v4float Private -%OutColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string main_before = - R"(%main = OpFunction %void None %9 -%16 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%17 = OpLoad %v4float %BaseColor -OpStore %v %17 -%18 = OpLoad %v4float %Dead -OpStore %dv %18 -%19 = OpLoad %v4float %v -%20 = OpFNegate %v4float %19 -OpStore %OutColor %20 -OpReturn -OpFunctionEnd -)"; - - const std::string main_after = - R"(%main = OpFunction %void None %9 -%16 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%17 = OpLoad %v4float %BaseColor -OpStore %v %17 -%19 = OpLoad %v4float %v -%20 = OpFNegate %v4float %19 -OpStore %OutColor %20 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + main_before, predefs + main_after, true, true); -} - -TEST_F(AggressiveDCETest, NoPrivateStoreElimIfLoad) { - // Should not eliminate stores to private when there is a load - // Note: Not legal GLSL - // - // #version 450 - // - // layout(location = 0) in vec4 BaseColor; - // layout(location = 0) out vec4 OutColor; - // - // private vec4 pv; - // - // void main() - // { - // pv = BaseColor; - // OutColor = pv; - // } - - const std::string assembly = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %OutColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 450 -OpName %main "main" -OpName %pv "pv" -OpName %BaseColor "BaseColor" -OpName %OutColor "OutColor" -OpDecorate %BaseColor Location 0 -OpDecorate %OutColor Location 0 -%void = OpTypeVoid -%7 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Private_v4float = OpTypePointer Private %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%OutColor = OpVariable %_ptr_Output_v4float Output -%pv = OpVariable %_ptr_Private_v4float Private -%main = OpFunction %void None %7 -%13 = OpLabel -%14 = OpLoad %v4float %BaseColor -OpStore %pv %14 -%15 = OpLoad %v4float %pv -%16 = OpFNegate %v4float %15 -OpStore %OutColor %16 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - assembly, assembly, true, true); -} - -TEST_F(AggressiveDCETest, NoPrivateStoreElimWithCall) { - // Should not eliminate stores to private when function contains call - // Note: Not legal GLSL - // - // #version 450 - // - // layout(location = 0) in vec4 BaseColor; - // layout(location = 0) out vec4 OutColor; - // - // private vec4 v1; - // - // void foo() - // { - // OutColor = -v1; - // } - // - // void main() - // { - // v1 = BaseColor; - // foo(); - // } - - const std::string assembly = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %OutColor %BaseColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 450 -OpName %main "main" -OpName %foo_ "foo(" -OpName %OutColor "OutColor" -OpName %v1 "v1" -OpName %BaseColor "BaseColor" -OpDecorate %OutColor Location 0 -OpDecorate %BaseColor Location 0 -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%OutColor = OpVariable %_ptr_Output_v4float Output -%_ptr_Private_v4float = OpTypePointer Private %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%v1 = OpVariable %_ptr_Private_v4float Private -%BaseColor = OpVariable %_ptr_Input_v4float Input -%main = OpFunction %void None %8 -%14 = OpLabel -%15 = OpLoad %v4float %BaseColor -OpStore %v1 %15 -%16 = OpFunctionCall %void %foo_ -OpReturn -OpFunctionEnd -%foo_ = OpFunction %void None %8 -%17 = OpLabel -%18 = OpLoad %v4float %v1 -%19 = OpFNegate %v4float %18 -OpStore %OutColor %19 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - assembly, assembly, true, true); -} - -TEST_F(AggressiveDCETest, NoPrivateStoreElimInNonEntry) { - // Should not eliminate stores to private when function is not entry point - // Note: Not legal GLSL - // - // #version 450 - // - // layout(location = 0) in vec4 BaseColor; - // layout(location = 0) out vec4 OutColor; - // - // private vec4 v1; - // - // void foo() - // { - // v1 = BaseColor; - // } - // - // void main() - // { - // foo(); - // OutColor = -v1; - // } - - const std::string assembly = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %OutColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 450 -OpName %main "main" -OpName %foo_ "foo(" -OpName %v1 "v1" -OpName %BaseColor "BaseColor" -OpName %OutColor "OutColor" -OpDecorate %BaseColor Location 0 -OpDecorate %OutColor Location 0 -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Private_v4float = OpTypePointer Private %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%v1 = OpVariable %_ptr_Private_v4float Private -%OutColor = OpVariable %_ptr_Output_v4float Output -%main = OpFunction %void None %8 -%14 = OpLabel -%15 = OpFunctionCall %void %foo_ -%16 = OpLoad %v4float %v1 -%17 = OpFNegate %v4float %16 -OpStore %OutColor %17 -OpReturn -OpFunctionEnd -%foo_ = OpFunction %void None %8 -%18 = OpLabel -%19 = OpLoad %v4float %BaseColor -OpStore %v1 %19 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - assembly, assembly, true, true); -} - - -// TODO(greg-lunarg): Add tests to verify handling of these cases: -// -// Check that logical addressing required -// Check that function calls inhibit optimization -// Others? - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/assembly_builder.h vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/assembly_builder.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/assembly_builder.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/assembly_builder.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,251 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_TEST_OPT_ASSEMBLY_BUILDER -#define LIBSPIRV_TEST_OPT_ASSEMBLY_BUILDER - -#include -#include -#include -#include -#include -#include - -namespace spvtools { - -// A simple SPIR-V assembly code builder for test uses. It builds an SPIR-V -// assembly module from vectors of assembly strings. It allows users to add -// instructions to the main function and the type-constants-globals section -// directly. It relies on OpName instructions and friendly-name disassembling -// to keep the ID names unchanged after assembling. -// -// An assembly module is divided into several sections, matching with the -// SPIR-V Logical Layout: -// Global Preamble: -// OpCapability instructions; -// OpExtension instructions and OpExtInstImport instructions; -// OpMemoryModel instruction; -// OpEntryPoint and OpExecutionMode instruction; -// OpString, OpSourceExtension, OpSource and OpSourceContinued instructions. -// Names: -// OpName instructions. -// Annotations: -// OpDecorate, OpMemberDecorate, OpGroupDecorate, OpGroupMemberDecorate and -// OpDecorationGroup. -// Types, Constants and Global variables: -// Types, constants and global variables declaration instructions. -// Main Function: -// Main function instructions. -// Main Function Postamble: -// The return and function end instructions. -// -// The assembly code is built by concatenating all the strings in the above -// sections. -// -// Users define the contents in section -// and
. The section is to hold the names for IDs to -// keep them unchanged before and after assembling. All defined IDs to be added -// to this code builder will be assigned with a global name through OpName -// instruction. The name is extracted from the definition instruction. -// E.g. adding instruction: %var_a = OpConstant %int 2, will also add an -// instruction: OpName %var_a, "var_a". -// -// Note that the name must not be used on more than one defined IDs and -// friendly-name disassembling must be enabled so that OpName instructions will -// be respected. -class AssemblyBuilder { - // The base ID value for spec constants. - static const uint32_t SPEC_ID_BASE = 200; - - public: - // Initalize a minimal SPIR-V assembly code as the template. The minimal - // module contains an empty main function and some predefined names for the - // main function. - AssemblyBuilder() - : spec_id_counter_(SPEC_ID_BASE), - global_preamble_({ - // clang-format off - "OpCapability Shader", - "OpCapability Float64", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %main \"main\"", - // clang-format on - }), - names_(), - annotations_(), - types_consts_globals_(), - main_func_(), - main_func_postamble_({ - "OpReturn", "OpFunctionEnd", - }) { - AppendTypesConstantsGlobals({ - "%void = OpTypeVoid", "%main_func_type = OpTypeFunction %void", - }); - AppendInMain({ - "%main = OpFunction %void None %main_func_type", - "%main_func_entry_block = OpLabel", - }); - } - - // Appends OpName instructions to this builder. Instrcution strings that do - // not start with 'OpName ' will be skipped. Returns the references of this - // assembly builder. - AssemblyBuilder& AppendNames(const std::vector& vec_asm_code) { - for (auto& inst_str : vec_asm_code) { - if (inst_str.find("OpName ") == 0) { - names_.push_back(inst_str); - } - } - return *this; - } - - // Appends instructions to the types-constants-globals section and returns - // the reference of this assembly builder. IDs defined in the given code will - // be added to the Names section and then be registered with OpName - // instruction. Corresponding decoration instruction will be added for spec - // constants defined with opcode: 'OpSpecConstant'. - AssemblyBuilder& AppendTypesConstantsGlobals( - const std::vector& vec_asm_code) { - AddNamesForResultIDsIn(vec_asm_code); - // Check spec constants defined with OpSpecConstant. - for (auto& inst_str : vec_asm_code) { - if (inst_str.find("= OpSpecConstant ") != std::string::npos || - inst_str.find("= OpSpecConstantTrue ") != std::string::npos || - inst_str.find("= OpSpecConstantFalse ") != std::string::npos) { - AddSpecIDFor(GetResultIDName(inst_str)); - } - } - types_consts_globals_.insert(types_consts_globals_.end(), - vec_asm_code.begin(), vec_asm_code.end()); - return *this; - } - - // Appends instructions to the main function block, which is already labelled - // with "main_func_entry_block". Returns the reference of this assembly - // builder. IDs defined in the given code will be added to the Names section - // and then be registered with OpName instruction. - AssemblyBuilder& AppendInMain(const std::vector& vec_asm_code) { - AddNamesForResultIDsIn(vec_asm_code); - main_func_.insert(main_func_.end(), vec_asm_code.begin(), - vec_asm_code.end()); - return *this; - } - - // Appends annotation instructions to the annotation section, and returns the - // reference of this assembly builder. - AssemblyBuilder& AppendAnnotations( - const std::vector& vec_annotations) { - annotations_.insert(annotations_.end(), vec_annotations.begin(), - vec_annotations.end()); - return *this; - } - - // Get the SPIR-V assembly code as string. - std::string GetCode() const { - std::ostringstream ss; - for (const auto& line : global_preamble_) { - ss << line << std::endl; - } - for (const auto& line : names_) { - ss << line << std::endl; - } - for (const auto& line : annotations_) { - ss << line << std::endl; - } - for (const auto& line : types_consts_globals_) { - ss << line << std::endl; - } - for (const auto& line : main_func_) { - ss << line << std::endl; - } - for (const auto& line : main_func_postamble_) { - ss << line << std::endl; - } - return ss.str(); - } - - private: - // Adds a given name to the Name section with OpName. If the given name has - // been added before, does nothing. - void AddOpNameIfNotExist(const std::string& id_name) { - if (!used_names_.count(id_name)) { - std::stringstream opname_inst; - opname_inst << "OpName " - << "%" << id_name << " \"" << id_name << "\""; - names_.emplace_back(opname_inst.str()); - used_names_.insert(id_name); - } - } - - // Adds the names in a vector of assembly code strings to the Names section. - // If a '=' sign is found in an instruction, this instruction will be treated - // as an ID defining instruction. The ID name used in the instruction will be - // extracted and added to the Names section. - void AddNamesForResultIDsIn(const std::vector& vec_asm_code) { - for (const auto& line : vec_asm_code) { - std::string name = GetResultIDName(line); - if (!name.empty()) { - AddOpNameIfNotExist(name); - } - } - } - - // Adds an OpDecorate SpecId instruction for the given ID name. - void AddSpecIDFor(const std::string& id_name) { - std::stringstream decorate_inst; - decorate_inst << "OpDecorate " - << "%" << id_name << " SpecId " << spec_id_counter_; - spec_id_counter_ += 1; - annotations_.emplace_back(decorate_inst.str()); - } - - // Extracts the ID name from a SPIR-V assembly instruction string. If the - // instruction is an ID-defining instruction (has result ID), returns the - // name of the result ID in string. If the instruction does not have result - // ID, returns an empty string. - std::string GetResultIDName(const std::string inst_str) { - std::string name; - if (inst_str.find('=') != std::string::npos) { - size_t assign_sign = inst_str.find('='); - name = inst_str.substr(0, assign_sign); - name.erase(remove_if(name.begin(), name.end(), - [](char c) { return c == ' ' || c == '%'; }), - name.end()); - } - return name; - } - - uint32_t spec_id_counter_; - // The vector that contains common preambles shared across all test SPIR-V - // code. - std::vector global_preamble_; - // The vector that contains OpName instructions. - std::vector names_; - // The vector that contains annotation instructions. - std::vector annotations_; - // The vector that contains the code to declare types, constants and global - // variables (aka. the Types-Constants-Globals section). - std::vector types_consts_globals_; - // The vector that contains the code in main function's entry block. - std::vector main_func_; - // The vector that contains the postamble of main function body. - std::vector main_func_postamble_; - // All of the defined variable names. - std::unordered_set used_names_; -}; - -} // namespace spvtools - -#endif // LIBSPIRV_TEST_OPT_ASSEMBLY_BUILDER diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/assembly_builder_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/assembly_builder_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/assembly_builder_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/assembly_builder_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,281 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "assembly_builder.h" - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; -using AssemblyBuilderTest = PassTest<::testing::Test>; - -TEST_F(AssemblyBuilderTest, MinimalShader) { - AssemblyBuilder builder; - std::vector expected = { - // clang-format off - "OpCapability Shader", - "OpCapability Float64", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %main \"main\"", - "OpName %void \"void\"", - "OpName %main_func_type \"main_func_type\"", - "OpName %main \"main\"", - "OpName %main_func_entry_block \"main_func_entry_block\"", - "%void = OpTypeVoid", - "%main_func_type = OpTypeFunction %void", - "%main = OpFunction %void None %main_func_type", -"%main_func_entry_block = OpLabel", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - - SinglePassRunAndCheck(builder.GetCode(), - JoinAllInsts(expected), - /* skip_nop = */ false); -} - -TEST_F(AssemblyBuilderTest, ShaderWithConstants) { - AssemblyBuilder builder; - builder - .AppendTypesConstantsGlobals({ - // clang-format off - "%bool = OpTypeBool", - "%_PF_bool = OpTypePointer Function %bool", - "%bt = OpConstantTrue %bool", - "%bf = OpConstantFalse %bool", - "%int = OpTypeInt 32 1", - "%_PF_int = OpTypePointer Function %int", - "%si = OpConstant %int 1", - "%uint = OpTypeInt 32 0", - "%_PF_uint = OpTypePointer Function %uint", - "%ui = OpConstant %uint 2", - "%float = OpTypeFloat 32", - "%_PF_float = OpTypePointer Function %float", - "%f = OpConstant %float 3.14", - "%double = OpTypeFloat 64", - "%_PF_double = OpTypePointer Function %double", - "%d = OpConstant %double 3.14159265358979", - // clang-format on - }) - .AppendInMain({ - // clang-format off - "%btv = OpVariable %_PF_bool Function", - "%bfv = OpVariable %_PF_bool Function", - "%iv = OpVariable %_PF_int Function", - "%uv = OpVariable %_PF_uint Function", - "%fv = OpVariable %_PF_float Function", - "%dv = OpVariable %_PF_double Function", - "OpStore %btv %bt", - "OpStore %bfv %bf", - "OpStore %iv %si", - "OpStore %uv %ui", - "OpStore %fv %f", - "OpStore %dv %d", - // clang-format on - }); - - std::vector expected = { - // clang-format off - "OpCapability Shader", - "OpCapability Float64", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %main \"main\"", - "OpName %void \"void\"", - "OpName %main_func_type \"main_func_type\"", - "OpName %main \"main\"", - "OpName %main_func_entry_block \"main_func_entry_block\"", - "OpName %bool \"bool\"", - "OpName %_PF_bool \"_PF_bool\"", - "OpName %bt \"bt\"", - "OpName %bf \"bf\"", - "OpName %int \"int\"", - "OpName %_PF_int \"_PF_int\"", - "OpName %si \"si\"", - "OpName %uint \"uint\"", - "OpName %_PF_uint \"_PF_uint\"", - "OpName %ui \"ui\"", - "OpName %float \"float\"", - "OpName %_PF_float \"_PF_float\"", - "OpName %f \"f\"", - "OpName %double \"double\"", - "OpName %_PF_double \"_PF_double\"", - "OpName %d \"d\"", - "OpName %btv \"btv\"", - "OpName %bfv \"bfv\"", - "OpName %iv \"iv\"", - "OpName %uv \"uv\"", - "OpName %fv \"fv\"", - "OpName %dv \"dv\"", - "%void = OpTypeVoid", -"%main_func_type = OpTypeFunction %void", - "%bool = OpTypeBool", - "%_PF_bool = OpTypePointer Function %bool", - "%bt = OpConstantTrue %bool", - "%bf = OpConstantFalse %bool", - "%int = OpTypeInt 32 1", - "%_PF_int = OpTypePointer Function %int", - "%si = OpConstant %int 1", - "%uint = OpTypeInt 32 0", - "%_PF_uint = OpTypePointer Function %uint", - "%ui = OpConstant %uint 2", - "%float = OpTypeFloat 32", - "%_PF_float = OpTypePointer Function %float", - "%f = OpConstant %float 3.14", - "%double = OpTypeFloat 64", - "%_PF_double = OpTypePointer Function %double", - "%d = OpConstant %double 3.14159265358979", - "%main = OpFunction %void None %main_func_type", -"%main_func_entry_block = OpLabel", - "%btv = OpVariable %_PF_bool Function", - "%bfv = OpVariable %_PF_bool Function", - "%iv = OpVariable %_PF_int Function", - "%uv = OpVariable %_PF_uint Function", - "%fv = OpVariable %_PF_float Function", - "%dv = OpVariable %_PF_double Function", - "OpStore %btv %bt", - "OpStore %bfv %bf", - "OpStore %iv %si", - "OpStore %uv %ui", - "OpStore %fv %f", - "OpStore %dv %d", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - SinglePassRunAndCheck(builder.GetCode(), - JoinAllInsts(expected), - /* skip_nop = */ false); -} - -TEST_F(AssemblyBuilderTest, SpecConstants) { - AssemblyBuilder builder; - builder.AppendTypesConstantsGlobals({ - "%bool = OpTypeBool", "%uint = OpTypeInt 32 0", "%int = OpTypeInt 32 1", - "%float = OpTypeFloat 32", "%double = OpTypeFloat 64", - "%v2int = OpTypeVector %int 2", - - "%spec_true = OpSpecConstantTrue %bool", - "%spec_false = OpSpecConstantFalse %bool", - "%spec_uint = OpSpecConstant %uint 1", - "%spec_int = OpSpecConstant %int 1", - "%spec_float = OpSpecConstant %float 1.2", - "%spec_double = OpSpecConstant %double 1.23456789", - - // Spec constants defined below should not have SpecID. - "%spec_add_op = OpSpecConstantOp %int IAdd %spec_int %spec_int", - "%spec_vec = OpSpecConstantComposite %v2int %spec_int %spec_int", - "%spec_vec_x = OpSpecConstantOp %int CompositeExtract %spec_vec 0", - }); - std::vector expected = { - // clang-format off - "OpCapability Shader", - "OpCapability Float64", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %main \"main\"", - "OpName %void \"void\"", - "OpName %main_func_type \"main_func_type\"", - "OpName %main \"main\"", - "OpName %main_func_entry_block \"main_func_entry_block\"", - "OpName %bool \"bool\"", - "OpName %uint \"uint\"", - "OpName %int \"int\"", - "OpName %float \"float\"", - "OpName %double \"double\"", - "OpName %v2int \"v2int\"", - "OpName %spec_true \"spec_true\"", - "OpName %spec_false \"spec_false\"", - "OpName %spec_uint \"spec_uint\"", - "OpName %spec_int \"spec_int\"", - "OpName %spec_float \"spec_float\"", - "OpName %spec_double \"spec_double\"", - "OpName %spec_add_op \"spec_add_op\"", - "OpName %spec_vec \"spec_vec\"", - "OpName %spec_vec_x \"spec_vec_x\"", - "OpDecorate %spec_true SpecId 200", - "OpDecorate %spec_false SpecId 201", - "OpDecorate %spec_uint SpecId 202", - "OpDecorate %spec_int SpecId 203", - "OpDecorate %spec_float SpecId 204", - "OpDecorate %spec_double SpecId 205", - "%void = OpTypeVoid", - "%main_func_type = OpTypeFunction %void", - "%bool = OpTypeBool", - "%uint = OpTypeInt 32 0", - "%int = OpTypeInt 32 1", - "%float = OpTypeFloat 32", - "%double = OpTypeFloat 64", - "%v2int = OpTypeVector %int 2", - "%spec_true = OpSpecConstantTrue %bool", - "%spec_false = OpSpecConstantFalse %bool", - "%spec_uint = OpSpecConstant %uint 1", - "%spec_int = OpSpecConstant %int 1", - "%spec_float = OpSpecConstant %float 1.2", - "%spec_double = OpSpecConstant %double 1.23456789", - "%spec_add_op = OpSpecConstantOp %int IAdd %spec_int %spec_int", - "%spec_vec = OpSpecConstantComposite %v2int %spec_int %spec_int", - "%spec_vec_x = OpSpecConstantOp %int CompositeExtract %spec_vec 0", - "%main = OpFunction %void None %main_func_type", -"%main_func_entry_block = OpLabel", - "OpReturn", - "OpFunctionEnd", - - // clang-format on - }; - - SinglePassRunAndCheck(builder.GetCode(), - JoinAllInsts(expected), - /* skip_nop = */ false); -} - -TEST_F(AssemblyBuilderTest, AppendNames) { - AssemblyBuilder builder; - builder.AppendNames({ - "OpName %void \"another_name_for_void\"", - "I am an invalid OpName instruction and should not be added", - "OpName %main \"another name for main\"", - }); - std::vector expected = { - // clang-format off - "OpCapability Shader", - "OpCapability Float64", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %main \"main\"", - "OpName %void \"void\"", - "OpName %main_func_type \"main_func_type\"", - "OpName %main \"main\"", - "OpName %main_func_entry_block \"main_func_entry_block\"", - "OpName %void \"another_name_for_void\"", - "OpName %main \"another name for main\"", - "%void = OpTypeVoid", - "%main_func_type = OpTypeFunction %void", - "%main = OpFunction %void None %main_func_type", -"%main_func_entry_block = OpLabel", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - - SinglePassRunAndCheck(builder.GetCode(), - JoinAllInsts(expected), - /* skip_nop = */ false); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/block_merge_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/block_merge_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/block_merge_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/block_merge_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,337 +0,0 @@ -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; - -using BlockMergeTest = PassTest<::testing::Test>; - -TEST_F(BlockMergeTest, Simple) { - // Note: SPIR-V hand edited to insert block boundary - // between two statements in main. - // - // #version 140 - // - // in vec4 BaseColor; - // - // void main() - // { - // vec4 v = BaseColor; - // gl_FragColor = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%7 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %7 -%13 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%14 = OpLoad %v4float %BaseColor -OpStore %v %14 -OpBranch %15 -%15 = OpLabel -%16 = OpLoad %v4float %v -OpStore %gl_FragColor %16 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %7 -%13 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%14 = OpLoad %v4float %BaseColor -OpStore %v %14 -%16 = OpLoad %v4float %v -OpStore %gl_FragColor %16 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(BlockMergeTest, EmptyBlock) { - // Note: SPIR-V hand edited to insert empty block - // after two statements in main. - // - // #version 140 - // - // in vec4 BaseColor; - // - // void main() - // { - // vec4 v = BaseColor; - // gl_FragColor = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%7 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %7 -%13 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%14 = OpLoad %v4float %BaseColor -OpStore %v %14 -OpBranch %15 -%15 = OpLabel -%16 = OpLoad %v4float %v -OpStore %gl_FragColor %16 -OpBranch %17 -%17 = OpLabel -OpBranch %18 -%18 = OpLabel -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %7 -%13 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%14 = OpLoad %v4float %BaseColor -OpStore %v %14 -%16 = OpLoad %v4float %v -OpStore %gl_FragColor %16 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(BlockMergeTest, NoOptOfMergeOrContinueBlock) { - // Note: SPIR-V hand edited remove dead branch and add block - // before continue block - // - // #version 140 - // in vec4 BaseColor; - // - // void main() - // { - // while (true) { - // break; - // } - // gl_FragColor = BaseColor; - // } - - const std::string assembly = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %gl_FragColor %BaseColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %gl_FragColor "gl_FragColor" -OpName %BaseColor "BaseColor" -%void = OpTypeVoid -%6 = OpTypeFunction %void -%bool = OpTypeBool -%true = OpConstantTrue %bool -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%main = OpFunction %void None %6 -%13 = OpLabel -OpBranch %14 -%14 = OpLabel -OpLoopMerge %15 %16 None -OpBranch %17 -%17 = OpLabel -OpBranch %15 -%18 = OpLabel -OpBranch %16 -%16 = OpLabel -OpBranch %14 -%15 = OpLabel -%19 = OpLoad %v4float %BaseColor -OpStore %gl_FragColor %19 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - assembly, assembly, true, true); -} - -TEST_F(BlockMergeTest, NestedInControlFlow) { - // Note: SPIR-V hand edited to insert block boundary - // between OpFMul and OpStore in then-part. - // - // #version 140 - // in vec4 BaseColor; - // - // layout(std140) uniform U_t - // { - // bool g_B ; - // } ; - // - // void main() - // { - // vec4 v = BaseColor; - // if (g_B) - // vec4 v = v * 0.25; - // gl_FragColor = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %U_t "U_t" -OpMemberName %U_t 0 "g_B" -OpName %_ "" -OpName %v_0 "v" -OpName %gl_FragColor "gl_FragColor" -OpMemberDecorate %U_t 0 Offset 0 -OpDecorate %U_t Block -OpDecorate %_ DescriptorSet 0 -%void = OpTypeVoid -%10 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%uint = OpTypeInt 32 0 -%U_t = OpTypeStruct %uint -%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t -%_ = OpVariable %_ptr_Uniform_U_t Uniform -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%_ptr_Uniform_uint = OpTypePointer Uniform %uint -%bool = OpTypeBool -%uint_0 = OpConstant %uint 0 -%float_0_25 = OpConstant %float 0.25 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %10 -%24 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%v_0 = OpVariable %_ptr_Function_v4float Function -%25 = OpLoad %v4float %BaseColor -OpStore %v %25 -%26 = OpAccessChain %_ptr_Uniform_uint %_ %int_0 -%27 = OpLoad %uint %26 -%28 = OpINotEqual %bool %27 %uint_0 -OpSelectionMerge %29 None -OpBranchConditional %28 %30 %29 -%30 = OpLabel -%31 = OpLoad %v4float %v -%32 = OpVectorTimesScalar %v4float %31 %float_0_25 -OpBranch %33 -%33 = OpLabel -OpStore %v_0 %32 -OpBranch %29 -%29 = OpLabel -%34 = OpLoad %v4float %v -OpStore %gl_FragColor %34 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %10 -%24 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%v_0 = OpVariable %_ptr_Function_v4float Function -%25 = OpLoad %v4float %BaseColor -OpStore %v %25 -%26 = OpAccessChain %_ptr_Uniform_uint %_ %int_0 -%27 = OpLoad %uint %26 -%28 = OpINotEqual %bool %27 %uint_0 -OpSelectionMerge %29 None -OpBranchConditional %28 %30 %29 -%30 = OpLabel -%31 = OpLoad %v4float %v -%32 = OpVectorTimesScalar %v4float %31 %float_0_25 -OpStore %v_0 %32 -OpBranch %29 -%29 = OpLabel -%34 = OpLoad %v4float %v -OpStore %gl_FragColor %34 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -// TODO(greg-lunarg): Add tests to verify handling of these cases: -// -// More complex control flow -// Others? - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/cfg_cleanup_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/cfg_cleanup_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/cfg_cleanup_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/cfg_cleanup_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,448 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; - -using CFGCleanupTest = PassTest<::testing::Test>; - -TEST_F(CFGCleanupTest, RemoveUnreachableBlocks) { - const std::string declarations = R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %inf %outf4 -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 450 -OpName %main "main" -OpName %inf "inf" -OpName %outf4 "outf4" -OpDecorate %inf Location 0 -OpDecorate %outf4 Location 0 -%void = OpTypeVoid -%6 = OpTypeFunction %void -%float = OpTypeFloat 32 -%_ptr_Input_float = OpTypePointer Input %float -%inf = OpVariable %_ptr_Input_float Input -%float_2 = OpConstant %float 2 -%bool = OpTypeBool -%v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%outf4 = OpVariable %_ptr_Output_v4float Output -%float_n0_5 = OpConstant %float -0.5 -)"; - - const std::string body_before = R"(%main = OpFunction %void None %6 -%14 = OpLabel -OpSelectionMerge %17 None -OpBranch %18 -%19 = OpLabel -%20 = OpLoad %float %inf -%21 = OpCompositeConstruct %v4float %20 %20 %20 %20 -OpStore %outf4 %21 -OpBranch %17 -%18 = OpLabel -%22 = OpLoad %float %inf -%23 = OpFAdd %float %22 %float_n0_5 -%24 = OpCompositeConstruct %v4float %23 %23 %23 %23 -OpStore %outf4 %24 -OpBranch %17 -%17 = OpLabel -OpReturn -OpFunctionEnd -)"; - - const std::string body_after = R"(%main = OpFunction %void None %6 -%14 = OpLabel -OpSelectionMerge %15 None -OpBranch %16 -%16 = OpLabel -%20 = OpLoad %float %inf -%21 = OpFAdd %float %20 %float_n0_5 -%22 = OpCompositeConstruct %v4float %21 %21 %21 %21 -OpStore %outf4 %22 -OpBranch %15 -%15 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - declarations + body_before, declarations + body_after, true, true); -} - -TEST_F(CFGCleanupTest, RemoveDecorations) { - const std::string before = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" - OpName %main "main" - OpName %x "x" - OpName %dead "dead" - OpDecorate %x RelaxedPrecision - OpDecorate %dead RelaxedPrecision - %void = OpTypeVoid - %6 = OpTypeFunction %void - %float = OpTypeFloat 32 -%_ptr_Function_float = OpTypePointer Function %float - %float_2 = OpConstant %float 2 - %float_4 = OpConstant %float 4 - - %main = OpFunction %void None %6 - %14 = OpLabel - %x = OpVariable %_ptr_Function_float Function - OpSelectionMerge %17 None - OpBranch %18 - %19 = OpLabel - %dead = OpVariable %_ptr_Function_float Function - OpStore %dead %float_2 - OpBranch %17 - %18 = OpLabel - OpStore %x %float_4 - OpBranch %17 - %17 = OpLabel - OpReturn - OpFunctionEnd -)"; - - const std::string after = R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -OpName %main "main" -OpName %x "x" -OpDecorate %x RelaxedPrecision -%void = OpTypeVoid -%6 = OpTypeFunction %void -%float = OpTypeFloat 32 -%_ptr_Function_float = OpTypePointer Function %float -%float_2 = OpConstant %float 2 -%float_4 = OpConstant %float 4 -%main = OpFunction %void None %6 -%11 = OpLabel -%x = OpVariable %_ptr_Function_float Function -OpSelectionMerge %12 None -OpBranch %13 -%13 = OpLabel -OpStore %x %float_4 -OpBranch %12 -%12 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck(before, after, true, true); -} - - -TEST_F(CFGCleanupTest, UpdatePhis) { - const std::string before = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" %y %outparm - OpName %main "main" - OpName %y "y" - OpName %outparm "outparm" - OpDecorate %y Flat - OpDecorate %y Location 0 - OpDecorate %outparm Location 0 - %void = OpTypeVoid - %3 = OpTypeFunction %void - %int = OpTypeInt 32 1 -%_ptr_Function_int = OpTypePointer Function %int -%_ptr_Input_int = OpTypePointer Input %int - %y = OpVariable %_ptr_Input_int Input - %int_10 = OpConstant %int 10 - %bool = OpTypeBool - %int_42 = OpConstant %int 42 - %int_23 = OpConstant %int 23 - %int_5 = OpConstant %int 5 -%_ptr_Output_int = OpTypePointer Output %int - %outparm = OpVariable %_ptr_Output_int Output - %main = OpFunction %void None %3 - %5 = OpLabel - %11 = OpLoad %int %y - OpBranch %21 - %16 = OpLabel - %20 = OpIAdd %int %11 %int_42 - OpBranch %17 - %21 = OpLabel - %24 = OpISub %int %11 %int_23 - OpBranch %17 - %17 = OpLabel - %31 = OpPhi %int %20 %16 %24 %21 - %27 = OpIAdd %int %31 %int_5 - OpStore %outparm %27 - OpReturn - OpFunctionEnd -)"; - - const std::string after = R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %y %outparm -OpName %main "main" -OpName %y "y" -OpName %outparm "outparm" -OpDecorate %y Flat -OpDecorate %y Location 0 -OpDecorate %outparm Location 0 -%void = OpTypeVoid -%6 = OpTypeFunction %void -%int = OpTypeInt 32 1 -%_ptr_Function_int = OpTypePointer Function %int -%_ptr_Input_int = OpTypePointer Input %int -%y = OpVariable %_ptr_Input_int Input -%int_10 = OpConstant %int 10 -%bool = OpTypeBool -%int_42 = OpConstant %int 42 -%int_23 = OpConstant %int 23 -%int_5 = OpConstant %int 5 -%_ptr_Output_int = OpTypePointer Output %int -%outparm = OpVariable %_ptr_Output_int Output -%main = OpFunction %void None %6 -%16 = OpLabel -%17 = OpLoad %int %y -OpBranch %18 -%18 = OpLabel -%22 = OpISub %int %17 %int_23 -OpBranch %21 -%21 = OpLabel -%23 = OpPhi %int %22 %18 -%24 = OpIAdd %int %23 %int_5 -OpStore %outparm %24 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck(before, after, true, true); -} - -TEST_F(CFGCleanupTest, RemoveNamedLabels) { - const std::string before = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %main "main" - OpSource GLSL 430 - OpName %main "main" - OpName %dead "dead" - %void = OpTypeVoid - %5 = OpTypeFunction %void - %main = OpFunction %void None %5 - %6 = OpLabel - OpReturn - %dead = OpLabel - OpReturn - OpFunctionEnd)"; - - const std::string after = R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %main "main" -OpSource GLSL 430 -OpName %main "main" -%void = OpTypeVoid -%5 = OpTypeFunction %void -%main = OpFunction %void None %5 -%6 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck(before, after, true, true); -} - -TEST_F(CFGCleanupTest, RemovePhiArgsFromFarBlocks) { - const std::string before = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" %y %outparm - OpName %main "main" - OpName %y "y" - OpName %outparm "outparm" - OpDecorate %y Flat - OpDecorate %y Location 0 - OpDecorate %outparm Location 0 - %void = OpTypeVoid - %3 = OpTypeFunction %void - %int = OpTypeInt 32 1 -%_ptr_Function_int = OpTypePointer Function %int -%_ptr_Input_int = OpTypePointer Input %int - %y = OpVariable %_ptr_Input_int Input - %int_42 = OpConstant %int 42 -%_ptr_Output_int = OpTypePointer Output %int - %outparm = OpVariable %_ptr_Output_int Output - %int_14 = OpConstant %int 14 - %int_15 = OpConstant %int 15 - %int_5 = OpConstant %int 5 - %main = OpFunction %void None %3 - %5 = OpLabel - OpBranch %40 - %41 = OpLabel - %11 = OpLoad %int %y - OpBranch %40 - %40 = OpLabel - %12 = OpLoad %int %y - OpSelectionMerge %16 None - OpSwitch %12 %16 10 %13 13 %14 18 %15 - %13 = OpLabel - OpBranch %16 - %14 = OpLabel - OpStore %outparm %int_14 - OpBranch %16 - %15 = OpLabel - OpStore %outparm %int_15 - OpBranch %16 - %16 = OpLabel - %30 = OpPhi %int %11 %41 %int_42 %13 %11 %14 %11 %15 - %28 = OpIAdd %int %30 %int_5 - OpStore %outparm %28 - OpReturn - OpFunctionEnd)"; - - const std::string after = R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %y %outparm -OpName %main "main" -OpName %y "y" -OpName %outparm "outparm" -OpDecorate %y Flat -OpDecorate %y Location 0 -OpDecorate %outparm Location 0 -%void = OpTypeVoid -%6 = OpTypeFunction %void -%int = OpTypeInt 32 1 -%_ptr_Function_int = OpTypePointer Function %int -%_ptr_Input_int = OpTypePointer Input %int -%y = OpVariable %_ptr_Input_int Input -%int_42 = OpConstant %int 42 -%_ptr_Output_int = OpTypePointer Output %int -%outparm = OpVariable %_ptr_Output_int Output -%int_14 = OpConstant %int 14 -%int_15 = OpConstant %int 15 -%int_5 = OpConstant %int 5 -%26 = OpUndef %int -%main = OpFunction %void None %6 -%15 = OpLabel -OpBranch %16 -%16 = OpLabel -%19 = OpLoad %int %y -OpSelectionMerge %20 None -OpSwitch %19 %20 10 %21 13 %22 18 %23 -%21 = OpLabel -OpBranch %20 -%22 = OpLabel -OpStore %outparm %int_14 -OpBranch %20 -%23 = OpLabel -OpStore %outparm %int_15 -OpBranch %20 -%20 = OpLabel -%24 = OpPhi %int %int_42 %21 %26 %22 %26 %23 -%25 = OpIAdd %int %24 %int_5 -OpStore %outparm %25 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck(before, after, true, true); -} - -TEST_F(CFGCleanupTest, RemovePhiConstantArgs) { - const std::string before = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" %y %outparm - OpName %main "main" - OpName %y "y" - OpName %outparm "outparm" - OpDecorate %y Flat - OpDecorate %y Location 0 - OpDecorate %outparm Location 0 - %void = OpTypeVoid - %3 = OpTypeFunction %void - %int = OpTypeInt 32 1 -%_ptr_Input_int = OpTypePointer Input %int - %y = OpVariable %_ptr_Input_int Input - %int_10 = OpConstant %int 10 - %bool = OpTypeBool -%_ptr_Function_int = OpTypePointer Function %int - %int_23 = OpConstant %int 23 - %int_5 = OpConstant %int 5 -%_ptr_Output_int = OpTypePointer Output %int - %outparm = OpVariable %_ptr_Output_int Output - %24 = OpUndef %int - %main = OpFunction %void None %3 - %5 = OpLabel - OpBranch %14 - %40 = OpLabel - %9 = OpLoad %int %y - %12 = OpSGreaterThan %bool %9 %int_10 - OpSelectionMerge %14 None - OpBranchConditional %12 %13 %14 - %13 = OpLabel - OpBranch %14 - %14 = OpLabel - %25 = OpPhi %int %24 %5 %int_23 %13 - %20 = OpIAdd %int %25 %int_5 - OpStore %outparm %20 - OpReturn - OpFunctionEnd)"; - - const std::string after = R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %y %outparm -OpName %main "main" -OpName %y "y" -OpName %outparm "outparm" -OpDecorate %y Flat -OpDecorate %y Location 0 -OpDecorate %outparm Location 0 -%void = OpTypeVoid -%6 = OpTypeFunction %void -%int = OpTypeInt 32 1 -%_ptr_Input_int = OpTypePointer Input %int -%y = OpVariable %_ptr_Input_int Input -%int_10 = OpConstant %int 10 -%bool = OpTypeBool -%_ptr_Function_int = OpTypePointer Function %int -%int_23 = OpConstant %int 23 -%int_5 = OpConstant %int 5 -%_ptr_Output_int = OpTypePointer Output %int -%outparm = OpVariable %_ptr_Output_int Output -%15 = OpUndef %int -%main = OpFunction %void None %6 -%16 = OpLabel -OpBranch %17 -%17 = OpLabel -%22 = OpPhi %int %15 %16 -%23 = OpIAdd %int %22 %int_5 -OpStore %outparm %23 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck(before, after, true, true); -} -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,200 +0,0 @@ -# Copyright (c) 2016 Google 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. - -add_spvtools_unittest(TARGET instruction - SRCS instruction_test.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET instruction_list - SRCS instruction_list_test.cpp - LIBS SPIRV-Tools-opt - ) - -add_spvtools_unittest(TARGET ir_loader - SRCS ir_loader_test.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_manager - SRCS module_utils.h - pass_manager_test.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET optimizer - SRCS optimizer_test.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_strip_debug_info - SRCS strip_debug_info_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_compact_ids - SRCS compact_ids_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_flatten_decoration - SRCS flatten_decoration_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_freeze_spec_const - SRCS freeze_spec_const_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_block_merge - SRCS block_merge_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_inline - SRCS inline_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_inline_opaque - SRCS inline_opaque_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_insert_extract_elim - SRCS insert_extract_elim_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_local_ssa_elim - SRCS local_ssa_elim_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_local_single_block_elim - SRCS local_single_block_elim.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_local_access_chain_convert - SRCS local_access_chain_convert_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_local_single_store_elim - SRCS local_single_store_elim_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_dead_branch_elim - SRCS dead_branch_elim_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_dead_variable_elim - SRCS dead_variable_elim_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt - ) - -add_spvtools_unittest(TARGET pass_aggressive_dce - SRCS aggressive_dead_code_elim_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_common_uniform_elim - SRCS common_uniform_elim_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_eliminate_dead_const - SRCS eliminate_dead_const_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_eliminate_dead_functions - SRCS eliminate_dead_functions_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_pass - SRCS pass_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_utils - SRCS utils_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET def_use - SRCS def_use_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET assembly_builder - SRCS assembly_builder_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET types - SRCS types_test.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET type_manager - SRCS type_manager_test.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET iterator - SRCS iterator_test.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET module - SRCS module_utils.h - module_test.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_fold_spec_const_op_composite - SRCS fold_spec_const_op_composite_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_unify_const - SRCS unify_const_test.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_set_spec_const_default_value - SRCS set_spec_const_default_value_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET line_debug_info - SRCS line_debug_info_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET pass_strength_reduction - SRCS strength_reduction_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) - -add_spvtools_unittest(TARGET cfg_cleanup - SRCS cfg_cleanup_test.cpp pass_utils.cpp - LIBS SPIRV-Tools-opt -) diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/common_uniform_elim_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/common_uniform_elim_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/common_uniform_elim_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/common_uniform_elim_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,673 +0,0 @@ -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; - -using CommonUniformElimTest = PassTest<::testing::Test>; - -TEST_F(CommonUniformElimTest, Basic1) { - // Note: This test exemplifies the following: - // - Common uniform (%_) load floated to nearest non-controlled block - // - Common extract (g_F) floated to non-controlled block - // - Non-common extract (g_F2) not floated, but common uniform load shared - // - // #version 140 - // in vec4 BaseColor; - // in float fi; - // - // layout(std140) uniform U_t - // { - // float g_F; - // float g_F2; - // } ; - // - // void main() - // { - // vec4 v = BaseColor; - // if (fi > 0) { - // v = v * g_F; - // } - // else { - // float f2 = g_F2 - g_F; - // v = v * f2; - // } - // gl_FragColor = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %fi %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %fi "fi" -OpName %U_t "U_t" -OpMemberName %U_t 0 "g_F" -OpMemberName %U_t 1 "g_F2" -OpName %_ "" -OpName %f2 "f2" -OpName %gl_FragColor "gl_FragColor" -OpMemberDecorate %U_t 0 Offset 0 -OpMemberDecorate %U_t 1 Offset 4 -OpDecorate %U_t Block -OpDecorate %_ DescriptorSet 0 -%void = OpTypeVoid -%11 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Input_float = OpTypePointer Input %float -%fi = OpVariable %_ptr_Input_float Input -%float_0 = OpConstant %float 0 -%bool = OpTypeBool -%U_t = OpTypeStruct %float %float -%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t -%_ = OpVariable %_ptr_Uniform_U_t Uniform -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%_ptr_Uniform_float = OpTypePointer Uniform %float -%_ptr_Function_float = OpTypePointer Function %float -%int_1 = OpConstant %int 1 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %11 -%26 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%f2 = OpVariable %_ptr_Function_float Function -%27 = OpLoad %v4float %BaseColor -OpStore %v %27 -%28 = OpLoad %float %fi -%29 = OpFOrdGreaterThan %bool %28 %float_0 -OpSelectionMerge %30 None -OpBranchConditional %29 %31 %32 -%31 = OpLabel -%33 = OpLoad %v4float %v -%34 = OpAccessChain %_ptr_Uniform_float %_ %int_0 -%35 = OpLoad %float %34 -%36 = OpVectorTimesScalar %v4float %33 %35 -OpStore %v %36 -OpBranch %30 -%32 = OpLabel -%37 = OpAccessChain %_ptr_Uniform_float %_ %int_1 -%38 = OpLoad %float %37 -%39 = OpAccessChain %_ptr_Uniform_float %_ %int_0 -%40 = OpLoad %float %39 -%41 = OpFSub %float %38 %40 -OpStore %f2 %41 -%42 = OpLoad %v4float %v -%43 = OpLoad %float %f2 -%44 = OpVectorTimesScalar %v4float %42 %43 -OpStore %v %44 -OpBranch %30 -%30 = OpLabel -%45 = OpLoad %v4float %v -OpStore %gl_FragColor %45 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %11 -%26 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%f2 = OpVariable %_ptr_Function_float Function -%52 = OpLoad %U_t %_ -%53 = OpCompositeExtract %float %52 0 -%27 = OpLoad %v4float %BaseColor -OpStore %v %27 -%28 = OpLoad %float %fi -%29 = OpFOrdGreaterThan %bool %28 %float_0 -OpSelectionMerge %30 None -OpBranchConditional %29 %31 %32 -%31 = OpLabel -%33 = OpLoad %v4float %v -%36 = OpVectorTimesScalar %v4float %33 %53 -OpStore %v %36 -OpBranch %30 -%32 = OpLabel -%49 = OpCompositeExtract %float %52 1 -%41 = OpFSub %float %49 %53 -OpStore %f2 %41 -%42 = OpLoad %v4float %v -%43 = OpLoad %float %f2 -%44 = OpVectorTimesScalar %v4float %42 %43 -OpStore %v %44 -OpBranch %30 -%30 = OpLabel -%45 = OpLoad %v4float %v -OpStore %gl_FragColor %45 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(CommonUniformElimTest, Basic2) { - // Note: This test exemplifies the following: - // - Common uniform (%_) load floated to nearest non-controlled block - // - Common extract (g_F) floated to non-controlled block - // - Non-common extract (g_F2) not floated, but common uniform load shared - // - // #version 140 - // in vec4 BaseColor; - // in float fi; - // in float fi2; - // - // layout(std140) uniform U_t - // { - // float g_F; - // float g_F2; - // } ; - // - // void main() - // { - // float f = fi; - // if (f < 0) - // f = -f; - // if (fi2 > 0) { - // f = f * g_F; - // } - // else { - // f = g_F2 - g_F; - // } - // gl_FragColor = f * BaseColor; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %fi %fi2 %gl_FragColor %BaseColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %f "f" -OpName %fi "fi" -OpName %fi2 "fi2" -OpName %U_t "U_t" -OpMemberName %U_t 0 "g_F" -OpMemberName %U_t 1 "g_F2" -OpName %_ "" -OpName %gl_FragColor "gl_FragColor" -OpName %BaseColor "BaseColor" -OpMemberDecorate %U_t 0 Offset 0 -OpMemberDecorate %U_t 1 Offset 4 -OpDecorate %U_t Block -OpDecorate %_ DescriptorSet 0 -%void = OpTypeVoid -%11 = OpTypeFunction %void -%float = OpTypeFloat 32 -%_ptr_Function_float = OpTypePointer Function %float -%_ptr_Input_float = OpTypePointer Input %float -%fi = OpVariable %_ptr_Input_float Input -%float_0 = OpConstant %float 0 -%bool = OpTypeBool -%fi2 = OpVariable %_ptr_Input_float Input -%U_t = OpTypeStruct %float %float -%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t -%_ = OpVariable %_ptr_Uniform_U_t Uniform -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%_ptr_Uniform_float = OpTypePointer Uniform %float -%int_1 = OpConstant %int 1 -%v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -)"; - - const std::string before = - R"(%main = OpFunction %void None %11 -%25 = OpLabel -%f = OpVariable %_ptr_Function_float Function -%26 = OpLoad %float %fi -OpStore %f %26 -%27 = OpLoad %float %f -%28 = OpFOrdLessThan %bool %27 %float_0 -OpSelectionMerge %29 None -OpBranchConditional %28 %30 %29 -%30 = OpLabel -%31 = OpLoad %float %f -%32 = OpFNegate %float %31 -OpStore %f %32 -OpBranch %29 -%29 = OpLabel -%33 = OpLoad %float %fi2 -%34 = OpFOrdGreaterThan %bool %33 %float_0 -OpSelectionMerge %35 None -OpBranchConditional %34 %36 %37 -%36 = OpLabel -%38 = OpLoad %float %f -%39 = OpAccessChain %_ptr_Uniform_float %_ %int_0 -%40 = OpLoad %float %39 -%41 = OpFMul %float %38 %40 -OpStore %f %41 -OpBranch %35 -%37 = OpLabel -%42 = OpAccessChain %_ptr_Uniform_float %_ %int_1 -%43 = OpLoad %float %42 -%44 = OpAccessChain %_ptr_Uniform_float %_ %int_0 -%45 = OpLoad %float %44 -%46 = OpFSub %float %43 %45 -OpStore %f %46 -OpBranch %35 -%35 = OpLabel -%47 = OpLoad %v4float %BaseColor -%48 = OpLoad %float %f -%49 = OpVectorTimesScalar %v4float %47 %48 -OpStore %gl_FragColor %49 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %11 -%25 = OpLabel -%f = OpVariable %_ptr_Function_float Function -%26 = OpLoad %float %fi -OpStore %f %26 -%27 = OpLoad %float %f -%28 = OpFOrdLessThan %bool %27 %float_0 -OpSelectionMerge %29 None -OpBranchConditional %28 %30 %29 -%30 = OpLabel -%31 = OpLoad %float %f -%32 = OpFNegate %float %31 -OpStore %f %32 -OpBranch %29 -%29 = OpLabel -%56 = OpLoad %U_t %_ -%57 = OpCompositeExtract %float %56 0 -%33 = OpLoad %float %fi2 -%34 = OpFOrdGreaterThan %bool %33 %float_0 -OpSelectionMerge %35 None -OpBranchConditional %34 %36 %37 -%36 = OpLabel -%38 = OpLoad %float %f -%41 = OpFMul %float %38 %57 -OpStore %f %41 -OpBranch %35 -%37 = OpLabel -%53 = OpCompositeExtract %float %56 1 -%46 = OpFSub %float %53 %57 -OpStore %f %46 -OpBranch %35 -%35 = OpLabel -%47 = OpLoad %v4float %BaseColor -%48 = OpLoad %float %f -%49 = OpVectorTimesScalar %v4float %47 %48 -OpStore %gl_FragColor %49 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(CommonUniformElimTest, Basic3) { - // Note: This test exemplifies the following: - // - Existing common uniform (%_) load kept in place and shared - // - // #version 140 - // in vec4 BaseColor; - // in float fi; - // - // layout(std140) uniform U_t - // { - // bool g_B; - // float g_F; - // } ; - // - // void main() - // { - // vec4 v = BaseColor; - // if (g_B) - // v = v * g_F; - // gl_FragColor = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor %fi -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %U_t "U_t" -OpMemberName %U_t 0 "g_B" -OpMemberName %U_t 1 "g_F" -OpName %_ "" -OpName %gl_FragColor "gl_FragColor" -OpName %fi "fi" -OpMemberDecorate %U_t 0 Offset 0 -OpMemberDecorate %U_t 1 Offset 4 -OpDecorate %U_t Block -OpDecorate %_ DescriptorSet 0 -%void = OpTypeVoid -%10 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%uint = OpTypeInt 32 0 -%U_t = OpTypeStruct %uint %float -%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t -%_ = OpVariable %_ptr_Uniform_U_t Uniform -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%_ptr_Uniform_uint = OpTypePointer Uniform %uint -%bool = OpTypeBool -%uint_0 = OpConstant %uint 0 -%int_1 = OpConstant %int 1 -%_ptr_Uniform_float = OpTypePointer Uniform %float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%_ptr_Input_float = OpTypePointer Input %float -%fi = OpVariable %_ptr_Input_float Input -)"; - - const std::string before = - R"(%main = OpFunction %void None %10 -%26 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%27 = OpLoad %v4float %BaseColor -OpStore %v %27 -%28 = OpAccessChain %_ptr_Uniform_uint %_ %int_0 -%29 = OpLoad %uint %28 -%30 = OpINotEqual %bool %29 %uint_0 -OpSelectionMerge %31 None -OpBranchConditional %30 %32 %31 -%32 = OpLabel -%33 = OpLoad %v4float %v -%34 = OpAccessChain %_ptr_Uniform_float %_ %int_1 -%35 = OpLoad %float %34 -%36 = OpVectorTimesScalar %v4float %33 %35 -OpStore %v %36 -OpBranch %31 -%31 = OpLabel -%37 = OpLoad %v4float %v -OpStore %gl_FragColor %37 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %10 -%26 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%27 = OpLoad %v4float %BaseColor -OpStore %v %27 -%38 = OpLoad %U_t %_ -%39 = OpCompositeExtract %uint %38 0 -%30 = OpINotEqual %bool %39 %uint_0 -OpSelectionMerge %31 None -OpBranchConditional %30 %32 %31 -%32 = OpLabel -%33 = OpLoad %v4float %v -%41 = OpCompositeExtract %float %38 1 -%36 = OpVectorTimesScalar %v4float %33 %41 -OpStore %v %36 -OpBranch %31 -%31 = OpLabel -%37 = OpLoad %v4float %v -OpStore %gl_FragColor %37 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(CommonUniformElimTest, Loop) { - // Note: This test exemplifies the following: - // - Common extract (g_F) shared between two loops - // #version 140 - // in vec4 BC; - // in vec4 BC2; - // - // layout(std140) uniform U_t - // { - // float g_F; - // } ; - // - // void main() - // { - // vec4 v = BC; - // for (int i = 0; i < 4; i++) - // v[i] = v[i] / g_F; - // vec4 v2 = BC2; - // for (int i = 0; i < 4; i++) - // v2[i] = v2[i] * g_F; - // gl_FragColor = v + v2; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BC %BC2 %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BC "BC" -OpName %i "i" -OpName %U_t "U_t" -OpMemberName %U_t 0 "g_F" -OpName %_ "" -OpName %v2 "v2" -OpName %BC2 "BC2" -OpName %i_0 "i" -OpName %gl_FragColor "gl_FragColor" -OpMemberDecorate %U_t 0 Offset 0 -OpDecorate %U_t Block -OpDecorate %_ DescriptorSet 0 -%void = OpTypeVoid -%13 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BC = OpVariable %_ptr_Input_v4float Input -%int = OpTypeInt 32 1 -%_ptr_Function_int = OpTypePointer Function %int -%int_0 = OpConstant %int 0 -%int_4 = OpConstant %int 4 -%bool = OpTypeBool -%_ptr_Function_float = OpTypePointer Function %float -%U_t = OpTypeStruct %float -%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t -%_ = OpVariable %_ptr_Uniform_U_t Uniform -%_ptr_Uniform_float = OpTypePointer Uniform %float -%int_1 = OpConstant %int 1 -%BC2 = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %13 -%28 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%i = OpVariable %_ptr_Function_int Function -%v2 = OpVariable %_ptr_Function_v4float Function -%i_0 = OpVariable %_ptr_Function_int Function -%29 = OpLoad %v4float %BC -OpStore %v %29 -OpStore %i %int_0 -OpBranch %30 -%30 = OpLabel -OpLoopMerge %31 %32 None -OpBranch %33 -%33 = OpLabel -%34 = OpLoad %int %i -%35 = OpSLessThan %bool %34 %int_4 -OpBranchConditional %35 %36 %31 -%36 = OpLabel -%37 = OpLoad %int %i -%38 = OpLoad %int %i -%39 = OpAccessChain %_ptr_Function_float %v %38 -%40 = OpLoad %float %39 -%41 = OpAccessChain %_ptr_Uniform_float %_ %int_0 -%42 = OpLoad %float %41 -%43 = OpFDiv %float %40 %42 -%44 = OpAccessChain %_ptr_Function_float %v %37 -OpStore %44 %43 -OpBranch %32 -%32 = OpLabel -%45 = OpLoad %int %i -%46 = OpIAdd %int %45 %int_1 -OpStore %i %46 -OpBranch %30 -%31 = OpLabel -%47 = OpLoad %v4float %BC2 -OpStore %v2 %47 -OpStore %i_0 %int_0 -OpBranch %48 -%48 = OpLabel -OpLoopMerge %49 %50 None -OpBranch %51 -%51 = OpLabel -%52 = OpLoad %int %i_0 -%53 = OpSLessThan %bool %52 %int_4 -OpBranchConditional %53 %54 %49 -%54 = OpLabel -%55 = OpLoad %int %i_0 -%56 = OpLoad %int %i_0 -%57 = OpAccessChain %_ptr_Function_float %v2 %56 -%58 = OpLoad %float %57 -%59 = OpAccessChain %_ptr_Uniform_float %_ %int_0 -%60 = OpLoad %float %59 -%61 = OpFMul %float %58 %60 -%62 = OpAccessChain %_ptr_Function_float %v2 %55 -OpStore %62 %61 -OpBranch %50 -%50 = OpLabel -%63 = OpLoad %int %i_0 -%64 = OpIAdd %int %63 %int_1 -OpStore %i_0 %64 -OpBranch %48 -%49 = OpLabel -%65 = OpLoad %v4float %v -%66 = OpLoad %v4float %v2 -%67 = OpFAdd %v4float %65 %66 -OpStore %gl_FragColor %67 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %13 -%28 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%i = OpVariable %_ptr_Function_int Function -%v2 = OpVariable %_ptr_Function_v4float Function -%i_0 = OpVariable %_ptr_Function_int Function -%72 = OpLoad %U_t %_ -%73 = OpCompositeExtract %float %72 0 -%29 = OpLoad %v4float %BC -OpStore %v %29 -OpStore %i %int_0 -OpBranch %30 -%30 = OpLabel -OpLoopMerge %31 %32 None -OpBranch %33 -%33 = OpLabel -%34 = OpLoad %int %i -%35 = OpSLessThan %bool %34 %int_4 -OpBranchConditional %35 %36 %31 -%36 = OpLabel -%37 = OpLoad %int %i -%38 = OpLoad %int %i -%39 = OpAccessChain %_ptr_Function_float %v %38 -%40 = OpLoad %float %39 -%43 = OpFDiv %float %40 %73 -%44 = OpAccessChain %_ptr_Function_float %v %37 -OpStore %44 %43 -OpBranch %32 -%32 = OpLabel -%45 = OpLoad %int %i -%46 = OpIAdd %int %45 %int_1 -OpStore %i %46 -OpBranch %30 -%31 = OpLabel -%47 = OpLoad %v4float %BC2 -OpStore %v2 %47 -OpStore %i_0 %int_0 -OpBranch %48 -%48 = OpLabel -OpLoopMerge %49 %50 None -OpBranch %51 -%51 = OpLabel -%52 = OpLoad %int %i_0 -%53 = OpSLessThan %bool %52 %int_4 -OpBranchConditional %53 %54 %49 -%54 = OpLabel -%55 = OpLoad %int %i_0 -%56 = OpLoad %int %i_0 -%57 = OpAccessChain %_ptr_Function_float %v2 %56 -%58 = OpLoad %float %57 -%61 = OpFMul %float %58 %73 -%62 = OpAccessChain %_ptr_Function_float %v2 %55 -OpStore %62 %61 -OpBranch %50 -%50 = OpLabel -%63 = OpLoad %int %i_0 -%64 = OpIAdd %int %63 %int_1 -OpStore %i_0 %64 -OpBranch %48 -%49 = OpLabel -%65 = OpLoad %v4float %v -%66 = OpLoad %v4float %v2 -%67 = OpFAdd %v4float %65 %66 -OpStore %gl_FragColor %67 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -// TODO(greg-lunarg): Add tests to verify handling of these cases: -// -// Disqualifying cases: extensions, decorations, non-logical addressing, -// non-structured control flow -// Others? - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/compact_ids_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/compact_ids_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/compact_ids_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/compact_ids_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,195 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include - -#include "spirv-tools/libspirv.hpp" -#include "spirv-tools/optimizer.hpp" - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; - -using CompactIdsTest = PassTest<::testing::Test>; - -TEST_F(CompactIdsTest, PassOff) { - const std::string before = -R"(OpCapability Addresses -OpCapability Kernel -OpCapability GenericPointer -OpCapability Linkage -OpMemoryModel Physical32 OpenCL -%99 = OpTypeInt 32 0 -%10 = OpTypeVector %99 2 -%20 = OpConstant %99 2 -%30 = OpTypeArray %99 %20 -)"; - - const std::string after = before; - - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); - SinglePassRunAndCheck(before, after, false, false); -} - -TEST_F(CompactIdsTest, PassOn) { - const std::string before = -R"(OpCapability Addresses -OpCapability Kernel -OpCapability GenericPointer -OpCapability Linkage -OpMemoryModel Physical32 OpenCL -OpEntryPoint Kernel %3 "simple_kernel" -%99 = OpTypeInt 32 0 -%10 = OpTypeVector %99 2 -%20 = OpConstant %99 2 -%30 = OpTypeArray %99 %20 -%40 = OpTypeVoid -%50 = OpTypeFunction %40 - %3 = OpFunction %40 None %50 -%70 = OpLabel -OpReturn -OpFunctionEnd -)"; - - const std::string after = -R"(OpCapability Addresses -OpCapability Kernel -OpCapability GenericPointer -OpCapability Linkage -OpMemoryModel Physical32 OpenCL -OpEntryPoint Kernel %1 "simple_kernel" -%2 = OpTypeInt 32 0 -%3 = OpTypeVector %2 2 -%4 = OpConstant %2 2 -%5 = OpTypeArray %2 %4 -%6 = OpTypeVoid -%7 = OpTypeFunction %6 -%1 = OpFunction %6 None %7 -%8 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); - SinglePassRunAndCheck(before, after, false, false); -} - -TEST(CompactIds, InstructionResultIsUpdated) { - // For https://github.com/KhronosGroup/SPIRV-Tools/issues/827 - // In that bug, the compact Ids pass was directly updating the result Id - // word for an OpFunction instruction, but not updating the cached - // result_id_ in that Instruction object. - // - // This test is a bit cheesy. We don't expose internal interfaces enough - // to see the inconsistency. So reproduce the original scenario, with - // compact ids followed by a pass that trips up on the inconsistency. - - const std::string input(R"(OpCapability Shader -OpMemoryModel Logical Simple -OpEntryPoint GLCompute %100 "main" -%200 = OpTypeVoid -%300 = OpTypeFunction %200 -%100 = OpFunction %300 None %200 -%400 = OpLabel -OpReturn -OpFunctionEnd -)"); - - std::vector binary; - const spv_target_env env = SPV_ENV_UNIVERSAL_1_0; - spvtools::SpirvTools tools(env); - auto assembled = tools.Assemble( - input, &binary, SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - EXPECT_TRUE(assembled); - - spvtools::Optimizer optimizer(env); - optimizer.RegisterPass(CreateCompactIdsPass()); - // The exhaustive inliner will use the result_id - optimizer.RegisterPass(CreateInlineExhaustivePass()); - - // This should not crash! - optimizer.Run(binary.data(), binary.size(), &binary); - - std::string disassembly; - tools.Disassemble(binary, &disassembly, SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); - - const std::string expected(R"(OpCapability Shader -OpMemoryModel Logical Simple -OpEntryPoint GLCompute %1 "main" -%2 = OpTypeVoid -%3 = OpTypeFunction %2 -%1 = OpFunction %3 None %2 -%4 = OpLabel -OpReturn -OpFunctionEnd -)"); - - EXPECT_THAT(disassembly, ::testing::Eq(expected)); -} - -TEST(CompactIds, HeaderIsUpdated) { - const std::string input(R"(OpCapability Shader -OpMemoryModel Logical Simple -OpEntryPoint GLCompute %100 "main" -%200 = OpTypeVoid -%300 = OpTypeFunction %200 -%100 = OpFunction %300 None %200 -%400 = OpLabel -OpReturn -OpFunctionEnd -)"); - - std::vector binary; - const spv_target_env env = SPV_ENV_UNIVERSAL_1_0; - spvtools::SpirvTools tools(env); - auto assembled = tools.Assemble( - input, &binary, SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - EXPECT_TRUE(assembled); - - spvtools::Optimizer optimizer(env); - optimizer.RegisterPass(CreateCompactIdsPass()); - // The exhaustive inliner will use the result_id - optimizer.RegisterPass(CreateInlineExhaustivePass()); - - // This should not crash! - optimizer.Run(binary.data(), binary.size(), &binary); - - std::string disassembly; - tools.Disassemble(binary, &disassembly, SPV_BINARY_TO_TEXT_OPTION_NONE); - - const std::string expected(R"(; SPIR-V -; Version: 1.0 -; Generator: Khronos SPIR-V Tools Assembler; 0 -; Bound: 5 -; Schema: 0 -OpCapability Shader -OpMemoryModel Logical Simple -OpEntryPoint GLCompute %1 "main" -%2 = OpTypeVoid -%3 = OpTypeFunction %2 -%1 = OpFunction %3 None %2 -%4 = OpLabel -OpReturn -OpFunctionEnd -)"); - - EXPECT_THAT(disassembly, ::testing::Eq(expected)); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/dead_branch_elim_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/dead_branch_elim_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/dead_branch_elim_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/dead_branch_elim_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1356 +0,0 @@ -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; - -using DeadBranchElimTest = PassTest<::testing::Test>; - -TEST_F(DeadBranchElimTest, IfThenElseTrue) { - // #version 140 - // - // in vec4 BaseColor; - // - // void main() - // { - // vec4 v; - // if (true) - // v = vec4(0.0,0.0,0.0,0.0); - // else - // v = vec4(1.0,1.0,1.0,1.0); - // gl_FragColor = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %gl_FragColor %BaseColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %gl_FragColor "gl_FragColor" -OpName %BaseColor "BaseColor" -%void = OpTypeVoid -%7 = OpTypeFunction %void -%bool = OpTypeBool -%true = OpConstantTrue %bool -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%float_0 = OpConstant %float 0 -%14 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 -%float_1 = OpConstant %float 1 -%16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -)"; - - const std::string before = - R"(%main = OpFunction %void None %7 -%19 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -OpSelectionMerge %20 None -OpBranchConditional %true %21 %22 -%21 = OpLabel -OpStore %v %14 -OpBranch %20 -%22 = OpLabel -OpStore %v %16 -OpBranch %20 -%20 = OpLabel -%23 = OpLoad %v4float %v -OpStore %gl_FragColor %23 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %7 -%19 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -OpBranch %21 -%21 = OpLabel -OpStore %v %14 -OpBranch %20 -%20 = OpLabel -%23 = OpLoad %v4float %v -OpStore %gl_FragColor %23 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(DeadBranchElimTest, IfThenElseFalse) { - // #version 140 - // - // in vec4 BaseColor; - // - // void main() - // { - // vec4 v; - // if (false) - // v = vec4(0.0,0.0,0.0,0.0); - // else - // v = vec4(1.0,1.0,1.0,1.0); - // gl_FragColor = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %gl_FragColor %BaseColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %gl_FragColor "gl_FragColor" -OpName %BaseColor "BaseColor" -%void = OpTypeVoid -%7 = OpTypeFunction %void -%bool = OpTypeBool -%false = OpConstantFalse %bool -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%float_0 = OpConstant %float 0 -%14 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 -%float_1 = OpConstant %float 1 -%16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -)"; - - const std::string before = - R"(%main = OpFunction %void None %7 -%19 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -OpSelectionMerge %20 None -OpBranchConditional %false %21 %22 -%21 = OpLabel -OpStore %v %14 -OpBranch %20 -%22 = OpLabel -OpStore %v %16 -OpBranch %20 -%20 = OpLabel -%23 = OpLoad %v4float %v -OpStore %gl_FragColor %23 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %7 -%19 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -OpBranch %22 -%22 = OpLabel -OpStore %v %16 -OpBranch %20 -%20 = OpLabel -%23 = OpLoad %v4float %v -OpStore %gl_FragColor %23 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(DeadBranchElimTest, IfThenTrue) { - // #version 140 - // - // in vec4 BaseColor; - // - // void main() - // { - // vec4 v = BaseColor; - // if (true) - // v = v * vec4(0.5,0.5,0.5,0.5); - // gl_FragColor = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%7 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%bool = OpTypeBool -%true = OpConstantTrue %bool -%float_0_5 = OpConstant %float 0.5 -%15 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %7 -%17 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%18 = OpLoad %v4float %BaseColor -OpStore %v %18 -OpSelectionMerge %19 None -OpBranchConditional %true %20 %19 -%20 = OpLabel -%21 = OpLoad %v4float %v -%22 = OpFMul %v4float %21 %15 -OpStore %v %22 -OpBranch %19 -%19 = OpLabel -%23 = OpLoad %v4float %v -OpStore %gl_FragColor %23 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %7 -%17 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%18 = OpLoad %v4float %BaseColor -OpStore %v %18 -OpBranch %20 -%20 = OpLabel -%21 = OpLoad %v4float %v -%22 = OpFMul %v4float %21 %15 -OpStore %v %22 -OpBranch %19 -%19 = OpLabel -%23 = OpLoad %v4float %v -OpStore %gl_FragColor %23 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(DeadBranchElimTest, IfThenFalse) { - // #version 140 - // - // in vec4 BaseColor; - // - // void main() - // { - // vec4 v = BaseColor; - // if (false) - // v = v * vec4(0.5,0.5,0.5,0.5); - // gl_FragColor = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%7 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%bool = OpTypeBool -%false = OpConstantFalse %bool -%float_0_5 = OpConstant %float 0.5 -%15 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %7 -%17 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%18 = OpLoad %v4float %BaseColor -OpStore %v %18 -OpSelectionMerge %19 None -OpBranchConditional %false %20 %19 -%20 = OpLabel -%21 = OpLoad %v4float %v -%22 = OpFMul %v4float %21 %15 -OpStore %v %22 -OpBranch %19 -%19 = OpLabel -%23 = OpLoad %v4float %v -OpStore %gl_FragColor %23 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %7 -%17 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%18 = OpLoad %v4float %BaseColor -OpStore %v %18 -OpBranch %19 -%19 = OpLabel -%23 = OpLoad %v4float %v -OpStore %gl_FragColor %23 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(DeadBranchElimTest, IfThenElsePhiTrue) { - // Test handling of phi in merge block after dead branch elimination. - // Note: The SPIR-V has had store/load elimination and phi insertion - // - // #version 140 - // - // void main() - // { - // vec4 v; - // if (true) - // v = vec4(0.0,0.0,0.0,0.0); - // else - // v = vec4(1.0,1.0,1.0,1.0); - // gl_FragColor = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%5 = OpTypeFunction %void -%bool = OpTypeBool -%true = OpConstantTrue %bool -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%float_0 = OpConstant %float 0 -%12 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 -%float_1 = OpConstant %float 1 -%14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%_ptr_Input_v4float = OpTypePointer Input %v4float -)"; - - const std::string before = - R"(%main = OpFunction %void None %5 -%17 = OpLabel -OpSelectionMerge %18 None -OpBranchConditional %true %19 %20 -%19 = OpLabel -OpBranch %18 -%20 = OpLabel -OpBranch %18 -%18 = OpLabel -%21 = OpPhi %v4float %12 %19 %14 %20 -OpStore %gl_FragColor %21 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %5 -%17 = OpLabel -OpBranch %19 -%19 = OpLabel -OpBranch %18 -%18 = OpLabel -OpStore %gl_FragColor %12 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(DeadBranchElimTest, IfThenElsePhiFalse) { - // Test handling of phi in merge block after dead branch elimination. - // Note: The SPIR-V has had store/load elimination and phi insertion - // - // #version 140 - // - // void main() - // { - // vec4 v; - // if (true) - // v = vec4(0.0,0.0,0.0,0.0); - // else - // v = vec4(1.0,1.0,1.0,1.0); - // gl_FragColor = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%5 = OpTypeFunction %void -%bool = OpTypeBool -%false = OpConstantFalse %bool -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%float_0 = OpConstant %float 0 -%12 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 -%float_1 = OpConstant %float 1 -%14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%_ptr_Input_v4float = OpTypePointer Input %v4float -)"; - - const std::string before = - R"(%main = OpFunction %void None %5 -%17 = OpLabel -OpSelectionMerge %18 None -OpBranchConditional %false %19 %20 -%19 = OpLabel -OpBranch %18 -%20 = OpLabel -OpBranch %18 -%18 = OpLabel -%21 = OpPhi %v4float %12 %19 %14 %20 -OpStore %gl_FragColor %21 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %5 -%17 = OpLabel -OpBranch %20 -%20 = OpLabel -OpBranch %18 -%18 = OpLabel -OpStore %gl_FragColor %14 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(DeadBranchElimTest, CompoundIfThenElseFalse) { - // #version 140 - // - // layout(std140) uniform U_t - // { - // bool g_B ; - // } ; - // - // void main() - // { - // vec4 v; - // if (false) { - // if (g_B) - // v = vec4(0.0,0.0,0.0,0.0); - // else - // v = vec4(1.0,1.0,1.0,1.0); - // } else { - // if (g_B) - // v = vec4(1.0,1.0,1.0,1.0); - // else - // v = vec4(0.0,0.0,0.0,0.0); - // } - // gl_FragColor = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %U_t "U_t" -OpMemberName %U_t 0 "g_B" -OpName %_ "" -OpName %v "v" -OpName %gl_FragColor "gl_FragColor" -OpMemberDecorate %U_t 0 Offset 0 -OpDecorate %U_t Block -OpDecorate %_ DescriptorSet 0 -%void = OpTypeVoid -%8 = OpTypeFunction %void -%bool = OpTypeBool -%false = OpConstantFalse %bool -%uint = OpTypeInt 32 0 -%U_t = OpTypeStruct %uint -%_ptr_Uniform_U_t = OpTypePointer Uniform %U_t -%_ = OpVariable %_ptr_Uniform_U_t Uniform -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%_ptr_Uniform_uint = OpTypePointer Uniform %uint -%uint_0 = OpConstant %uint 0 -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%float_0 = OpConstant %float 0 -%21 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 -%float_1 = OpConstant %float 1 -%23 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %8 -%25 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -OpSelectionMerge %26 None -OpBranchConditional %false %27 %28 -%27 = OpLabel -%29 = OpAccessChain %_ptr_Uniform_uint %_ %int_0 -%30 = OpLoad %uint %29 -%31 = OpINotEqual %bool %30 %uint_0 -OpSelectionMerge %32 None -OpBranchConditional %31 %33 %34 -%33 = OpLabel -OpStore %v %21 -OpBranch %32 -%34 = OpLabel -OpStore %v %23 -OpBranch %32 -%32 = OpLabel -OpBranch %26 -%28 = OpLabel -%35 = OpAccessChain %_ptr_Uniform_uint %_ %int_0 -%36 = OpLoad %uint %35 -%37 = OpINotEqual %bool %36 %uint_0 -OpSelectionMerge %38 None -OpBranchConditional %37 %39 %40 -%39 = OpLabel -OpStore %v %23 -OpBranch %38 -%40 = OpLabel -OpStore %v %21 -OpBranch %38 -%38 = OpLabel -OpBranch %26 -%26 = OpLabel -%41 = OpLoad %v4float %v -OpStore %gl_FragColor %41 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %8 -%25 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -OpBranch %28 -%28 = OpLabel -%35 = OpAccessChain %_ptr_Uniform_uint %_ %int_0 -%36 = OpLoad %uint %35 -%37 = OpINotEqual %bool %36 %uint_0 -OpSelectionMerge %38 None -OpBranchConditional %37 %39 %40 -%39 = OpLabel -OpStore %v %23 -OpBranch %38 -%40 = OpLabel -OpStore %v %21 -OpBranch %38 -%38 = OpLabel -OpBranch %26 -%26 = OpLabel -%41 = OpLoad %v4float %v -OpStore %gl_FragColor %41 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(DeadBranchElimTest, PreventOrphanMerge) { - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%7 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%bool = OpTypeBool -%true = OpConstantTrue %bool -%float_0_5 = OpConstant %float 0.5 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %7 -%16 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%17 = OpLoad %v4float %BaseColor -OpStore %v %17 -OpSelectionMerge %18 None -OpBranchConditional %true %19 %20 -%19 = OpLabel -OpKill -%20 = OpLabel -%21 = OpLoad %v4float %v -%22 = OpVectorTimesScalar %v4float %21 %float_0_5 -OpStore %v %22 -OpBranch %18 -%18 = OpLabel -%23 = OpLoad %v4float %v -OpStore %gl_FragColor %23 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %7 -%16 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%17 = OpLoad %v4float %BaseColor -OpStore %v %17 -OpBranch %19 -%19 = OpLabel -OpKill -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(DeadBranchElimTest, HandleOrphanMerge) { - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %foo_ "foo(" -OpName %gl_FragColor "gl_FragColor" -OpDecorate %gl_FragColor Location 0 -%void = OpTypeVoid -%6 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%9 = OpTypeFunction %v4float -%bool = OpTypeBool -%true = OpConstantTrue %bool -%float_0 = OpConstant %float 0 -%13 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 -%float_1 = OpConstant %float 1 -%15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%main = OpFunction %void None %6 -%17 = OpLabel -%18 = OpFunctionCall %v4float %foo_ -OpStore %gl_FragColor %18 -OpReturn -OpFunctionEnd -)"; - - const std::string before = - R"(%foo_ = OpFunction %v4float None %9 -%19 = OpLabel -OpSelectionMerge %20 None -OpBranchConditional %true %21 %22 -%21 = OpLabel -OpReturnValue %13 -%22 = OpLabel -OpReturnValue %15 -%20 = OpLabel -%23 = OpUndef %v4float -OpReturnValue %23 -OpFunctionEnd -)"; - - const std::string after = - R"(%foo_ = OpFunction %v4float None %9 -%19 = OpLabel -OpBranch %21 -%21 = OpLabel -OpReturnValue %13 -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(DeadBranchElimTest, KeepContinueTargetWhenKillAfterMerge) { - // #version 450 - // void main() { - // bool c; - // bool d; - // while(c) { - // if(d) { - // continue; - // } - // if(false) { - // continue; - // } - // discard; - // } - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 450 -OpName %main "main" -OpName %c "c" -OpName %d "d" -%void = OpTypeVoid -%6 = OpTypeFunction %void -%bool = OpTypeBool -%_ptr_Function_bool = OpTypePointer Function %bool -%false = OpConstantFalse %bool -)"; - - const std::string before = - R"(%main = OpFunction %void None %6 -%10 = OpLabel -%c = OpVariable %_ptr_Function_bool Function -%d = OpVariable %_ptr_Function_bool Function -OpBranch %11 -%11 = OpLabel -OpLoopMerge %12 %13 None -OpBranch %14 -%14 = OpLabel -%15 = OpLoad %bool %c -OpBranchConditional %15 %16 %12 -%16 = OpLabel -%17 = OpLoad %bool %d -OpSelectionMerge %18 None -OpBranchConditional %17 %19 %18 -%19 = OpLabel -OpBranch %13 -%18 = OpLabel -OpSelectionMerge %20 None -OpBranchConditional %false %21 %20 -%21 = OpLabel -OpBranch %13 -%20 = OpLabel -OpKill -%13 = OpLabel -OpBranch %11 -%12 = OpLabel -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %6 -%10 = OpLabel -%c = OpVariable %_ptr_Function_bool Function -%d = OpVariable %_ptr_Function_bool Function -OpBranch %11 -%11 = OpLabel -OpLoopMerge %12 %13 None -OpBranch %14 -%14 = OpLabel -%15 = OpLoad %bool %c -OpBranchConditional %15 %16 %12 -%16 = OpLabel -%17 = OpLoad %bool %d -OpSelectionMerge %18 None -OpBranchConditional %17 %19 %18 -%19 = OpLabel -OpBranch %13 -%18 = OpLabel -OpBranch %20 -%20 = OpLabel -OpKill -%13 = OpLabel -OpBranch %11 -%12 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(DeadBranchElimTest, DecorateDeleted) { - // Note: SPIR-V hand-edited to add decoration - // #version 140 - // - // in vec4 BaseColor; - // - // void main() - // { - // vec4 v = BaseColor; - // if (false) - // v = v * vec4(0.5,0.5,0.5,0.5); - // gl_FragColor = v; - // } - - const std::string predefs_before = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -OpDecorate %22 RelaxedPrecision -%void = OpTypeVoid -%7 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%bool = OpTypeBool -%false = OpConstantFalse %bool -%float_0_5 = OpConstant %float 0.5 -%15 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string predefs_after = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%bool = OpTypeBool -%false = OpConstantFalse %bool -%float_0_5 = OpConstant %float 0.5 -%16 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %7 -%17 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%18 = OpLoad %v4float %BaseColor -OpStore %v %18 -OpSelectionMerge %19 None -OpBranchConditional %false %20 %19 -%20 = OpLabel -%21 = OpLoad %v4float %v -%22 = OpFMul %v4float %21 %15 -OpStore %v %22 -OpBranch %19 -%19 = OpLabel -%23 = OpLoad %v4float %v -OpStore %gl_FragColor %23 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %8 -%18 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%19 = OpLoad %v4float %BaseColor -OpStore %v %19 -OpBranch %20 -%20 = OpLabel -%23 = OpLoad %v4float %v -OpStore %gl_FragColor %23 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs_before + before, predefs_after + after, true, true); -} - -TEST_F(DeadBranchElimTest, LoopInDeadBranch) { - // #version 450 - // - // layout(location = 0) in vec4 BaseColor; - // layout(location = 0) out vec4 OutColor; - // - // void main() - // { - // vec4 v = BaseColor; - // if (false) - // for (int i=0; i<3; i++) - // v = v * 0.5; - // OutColor = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %OutColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 450 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %i "i" -OpName %OutColor "OutColor" -OpDecorate %BaseColor Location 0 -OpDecorate %OutColor Location 0 -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%bool = OpTypeBool -%false = OpConstantFalse %bool -%int = OpTypeInt 32 1 -%_ptr_Function_int = OpTypePointer Function %int -%int_0 = OpConstant %int 0 -%int_3 = OpConstant %int 3 -%float_0_5 = OpConstant %float 0.5 -%int_1 = OpConstant %int 1 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%OutColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %8 -%22 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%i = OpVariable %_ptr_Function_int Function -%23 = OpLoad %v4float %BaseColor -OpStore %v %23 -OpSelectionMerge %24 None -OpBranchConditional %false %25 %24 -%25 = OpLabel -OpStore %i %int_0 -OpBranch %26 -%26 = OpLabel -OpLoopMerge %27 %28 None -OpBranch %29 -%29 = OpLabel -%30 = OpLoad %int %i -%31 = OpSLessThan %bool %30 %int_3 -OpBranchConditional %31 %32 %27 -%32 = OpLabel -%33 = OpLoad %v4float %v -%34 = OpVectorTimesScalar %v4float %33 %float_0_5 -OpStore %v %34 -OpBranch %28 -%28 = OpLabel -%35 = OpLoad %int %i -%36 = OpIAdd %int %35 %int_1 -OpStore %i %36 -OpBranch %26 -%27 = OpLabel -OpBranch %24 -%24 = OpLabel -%37 = OpLoad %v4float %v -OpStore %OutColor %37 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %8 -%22 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%i = OpVariable %_ptr_Function_int Function -%23 = OpLoad %v4float %BaseColor -OpStore %v %23 -OpBranch %24 -%24 = OpLabel -%37 = OpLoad %v4float %v -OpStore %OutColor %37 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(DeadBranchElimTest, SwitchLiveCase) { - // #version 450 - // - // layout (location=0) in vec4 BaseColor; - // layout (location=0) out vec4 OutColor; - // - // void main() - // { - // switch (1) { - // case 0: - // OutColor = vec4(0.0,0.0,0.0,0.0); - // break; - // case 1: - // OutColor = vec4(0.1,0.1,0.1,0.1); - // break; - // case 2: - // OutColor = vec4(0.2,0.2,0.2,0.2); - // break; - // default: - // OutColor = vec4(1.0,1.0,1.0,1.0); - // } - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %OutColor %BaseColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 450 -OpName %main "main" -OpName %OutColor "OutColor" -OpName %BaseColor "BaseColor" -OpDecorate %OutColor Location 0 -OpDecorate %BaseColor Location 0 -%void = OpTypeVoid -%6 = OpTypeFunction %void -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%OutColor = OpVariable %_ptr_Output_v4float Output -%float_0 = OpConstant %float 0 -%13 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 -%float_0_1 = OpConstant %float 0.1 -%15 = OpConstantComposite %v4float %float_0_1 %float_0_1 %float_0_1 %float_0_1 -%float_0_2 = OpConstant %float 0.2 -%17 = OpConstantComposite %v4float %float_0_2 %float_0_2 %float_0_2 %float_0_2 -%float_1 = OpConstant %float 1 -%19 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -)"; - - const std::string before = - R"(%main = OpFunction %void None %6 -%21 = OpLabel -OpSelectionMerge %22 None -OpSwitch %int_1 %23 0 %24 1 %25 2 %26 -%23 = OpLabel -OpStore %OutColor %19 -OpBranch %22 -%24 = OpLabel -OpStore %OutColor %13 -OpBranch %22 -%25 = OpLabel -OpStore %OutColor %15 -OpBranch %22 -%26 = OpLabel -OpStore %OutColor %17 -OpBranch %22 -%22 = OpLabel -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %6 -%21 = OpLabel -OpBranch %25 -%25 = OpLabel -OpStore %OutColor %15 -OpBranch %22 -%22 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(DeadBranchElimTest, SwitchLiveDefault) { - // #version 450 - // - // layout (location=0) in vec4 BaseColor; - // layout (location=0) out vec4 OutColor; - // - // void main() - // { - // switch (7) { - // case 0: - // OutColor = vec4(0.0,0.0,0.0,0.0); - // break; - // case 1: - // OutColor = vec4(0.1,0.1,0.1,0.1); - // break; - // case 2: - // OutColor = vec4(0.2,0.2,0.2,0.2); - // break; - // default: - // OutColor = vec4(1.0,1.0,1.0,1.0); - // } - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %OutColor %BaseColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 450 -OpName %main "main" -OpName %OutColor "OutColor" -OpName %BaseColor "BaseColor" -OpDecorate %OutColor Location 0 -OpDecorate %BaseColor Location 0 -%void = OpTypeVoid -%6 = OpTypeFunction %void -%int = OpTypeInt 32 1 -%int_7 = OpConstant %int 7 -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%OutColor = OpVariable %_ptr_Output_v4float Output -%float_0 = OpConstant %float 0 -%13 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 -%float_0_1 = OpConstant %float 0.1 -%15 = OpConstantComposite %v4float %float_0_1 %float_0_1 %float_0_1 %float_0_1 -%float_0_2 = OpConstant %float 0.2 -%17 = OpConstantComposite %v4float %float_0_2 %float_0_2 %float_0_2 %float_0_2 -%float_1 = OpConstant %float 1 -%19 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -)"; - - const std::string before = - R"(%main = OpFunction %void None %6 -%21 = OpLabel -OpSelectionMerge %22 None -OpSwitch %int_7 %23 0 %24 1 %25 2 %26 -%23 = OpLabel -OpStore %OutColor %19 -OpBranch %22 -%24 = OpLabel -OpStore %OutColor %13 -OpBranch %22 -%25 = OpLabel -OpStore %OutColor %15 -OpBranch %22 -%26 = OpLabel -OpStore %OutColor %17 -OpBranch %22 -%22 = OpLabel -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %6 -%21 = OpLabel -OpBranch %23 -%23 = OpLabel -OpStore %OutColor %19 -OpBranch %22 -%22 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(DeadBranchElimTest, SwitchLiveCaseBreakFromLoop) { - // This sample does not directly translate to GLSL/HLSL as - // direct breaks from a loop cannot be made from a switch. - // This construct is currently formed by inlining a function - // containing early returns from the cases of a switch. The - // function is wrapped in a one-trip loop and returns are - // translated to branches to the loop's merge block. - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %OutColor %BaseColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 450 -OpName %main "main" -OpName %oc "oc" -OpName %OutColor "OutColor" -OpName %BaseColor "BaseColor" -OpDecorate %OutColor Location 0 -OpDecorate %BaseColor Location 0 -%void = OpTypeVoid -%7 = OpTypeFunction %void -%bool = OpTypeBool -%true = OpConstantTrue %bool -%false = OpConstantFalse %bool -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%float_0 = OpConstant %float 0 -%17 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 -%float_0_1 = OpConstant %float 0.1 -%19 = OpConstantComposite %v4float %float_0_1 %float_0_1 %float_0_1 %float_0_1 -%float_0_2 = OpConstant %float 0.2 -%21 = OpConstantComposite %v4float %float_0_2 %float_0_2 %float_0_2 %float_0_2 -%float_1 = OpConstant %float 1 -%23 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%OutColor = OpVariable %_ptr_Output_v4float Output -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -)"; - - const std::string before = - R"(%main = OpFunction %void None %7 -%26 = OpLabel -%oc = OpVariable %_ptr_Function_v4float Function -OpBranch %27 -%27 = OpLabel -OpLoopMerge %28 %29 None -OpBranch %30 -%30 = OpLabel -OpSelectionMerge %31 None -OpSwitch %int_1 %31 0 %32 1 %33 2 %34 -%32 = OpLabel -OpStore %oc %17 -OpBranch %28 -%33 = OpLabel -OpStore %oc %19 -OpBranch %28 -%34 = OpLabel -OpStore %oc %21 -OpBranch %28 -%31 = OpLabel -OpStore %oc %23 -OpBranch %28 -%29 = OpLabel -OpBranchConditional %false %27 %28 -%28 = OpLabel -%35 = OpLoad %v4float %oc -OpStore %OutColor %35 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %7 -%26 = OpLabel -%oc = OpVariable %_ptr_Function_v4float Function -OpBranch %27 -%27 = OpLabel -OpLoopMerge %28 %29 None -OpBranch %30 -%30 = OpLabel -OpBranch %33 -%33 = OpLabel -OpStore %oc %19 -OpBranch %28 -%29 = OpLabel -OpBranchConditional %false %27 %28 -%28 = OpLabel -%35 = OpLoad %v4float %oc -OpStore %OutColor %35 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -// TODO(greg-lunarg): Add tests to verify handling of these cases: -// -// More complex control flow -// Others? - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/dead_variable_elim_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/dead_variable_elim_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/dead_variable_elim_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/dead_variable_elim_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,299 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; - -using DeadVariableElimTest = PassTest<::testing::Test>; - -// %dead is unused. Make sure we remove it along with its name. -TEST_F(DeadVariableElimTest, RemoveUnreferenced) { - const std::string before = - R"(OpCapability Shader -OpCapability Linkage -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 150 -OpName %main "main" -OpName %dead "dead" -%void = OpTypeVoid -%5 = OpTypeFunction %void -%float = OpTypeFloat 32 -%_ptr_Private_float = OpTypePointer Private %float -%dead = OpVariable %_ptr_Private_float Private -%main = OpFunction %void None %5 -%8 = OpLabel -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(OpCapability Shader -OpCapability Linkage -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 150 -OpName %main "main" -%void = OpTypeVoid -%5 = OpTypeFunction %void -%float = OpTypeFloat 32 -%_ptr_Private_float = OpTypePointer Private %float -%main = OpFunction %void None %5 -%8 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - SinglePassRunAndCheck(before, after, true, - true); -} - -// Since %dead is exported, make sure we keep it. It could be referenced -// somewhere else. -TEST_F(DeadVariableElimTest, KeepExported) { - const std::string before = - R"(OpCapability Shader -OpCapability Linkage -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 150 -OpName %main "main" -OpName %dead "dead" -OpDecorate %dead LinkageAttributes "dead" Export -%void = OpTypeVoid -%5 = OpTypeFunction %void -%float = OpTypeFloat 32 -%_ptr_Private_float = OpTypePointer Private %float -%dead = OpVariable %_ptr_Private_float Private -%main = OpFunction %void None %5 -%8 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - SinglePassRunAndCheck(before, before, true, - true); -} - -// Delete %dead because it is unreferenced. Then %initializer becomes -// unreferenced, so remove it as well. -TEST_F(DeadVariableElimTest, RemoveUnreferencedWithInit1) { - const std::string before = - R"(OpCapability Shader -OpCapability Linkage -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 150 -OpName %main "main" -OpName %dead "dead" -OpName %initializer "initializer" -%void = OpTypeVoid -%6 = OpTypeFunction %void -%float = OpTypeFloat 32 -%_ptr_Private_float = OpTypePointer Private %float -%initializer = OpVariable %_ptr_Private_float Private -%dead = OpVariable %_ptr_Private_float Private %initializer -%main = OpFunction %void None %6 -%9 = OpLabel -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(OpCapability Shader -OpCapability Linkage -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 150 -OpName %main "main" -%void = OpTypeVoid -%6 = OpTypeFunction %void -%float = OpTypeFloat 32 -%_ptr_Private_float = OpTypePointer Private %float -%main = OpFunction %void None %6 -%9 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - SinglePassRunAndCheck(before, after, true, - true); -} - -// Delete %dead because it is unreferenced. In this case, the initialized has -// another reference, and should not be removed. -TEST_F(DeadVariableElimTest, RemoveUnreferencedWithInit2) { - const std::string before = - R"(OpCapability Shader -OpCapability Linkage -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 150 -OpName %main "main" -OpName %dead "dead" -OpName %initializer "initializer" -%void = OpTypeVoid -%6 = OpTypeFunction %void -%float = OpTypeFloat 32 -%_ptr_Private_float = OpTypePointer Private %float -%initializer = OpVariable %_ptr_Private_float Private -%dead = OpVariable %_ptr_Private_float Private %initializer -%main = OpFunction %void None %6 -%9 = OpLabel -%10 = OpLoad %float %initializer -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(OpCapability Shader -OpCapability Linkage -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 150 -OpName %main "main" -OpName %initializer "initializer" -%void = OpTypeVoid -%6 = OpTypeFunction %void -%float = OpTypeFloat 32 -%_ptr_Private_float = OpTypePointer Private %float -%initializer = OpVariable %_ptr_Private_float Private -%main = OpFunction %void None %6 -%9 = OpLabel -%10 = OpLoad %float %initializer -OpReturn -OpFunctionEnd -)"; - - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - SinglePassRunAndCheck(before, after, true, - true); -} - -// Keep %live because it is used, and its initializer. -TEST_F(DeadVariableElimTest, KeepReferenced) { - const std::string before = - R"(OpCapability Shader -OpCapability Linkage -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 150 -OpName %main "main" -OpName %live "live" -OpName %initializer "initializer" -%void = OpTypeVoid -%6 = OpTypeFunction %void -%float = OpTypeFloat 32 -%_ptr_Private_float = OpTypePointer Private %float -%initializer = OpVariable %_ptr_Private_float Private -%live = OpVariable %_ptr_Private_float Private %initializer -%main = OpFunction %void None %6 -%9 = OpLabel -%10 = OpLoad %float %live -OpReturn -OpFunctionEnd -)"; - - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - SinglePassRunAndCheck(before, before, true, - true); -} - -// This test that the decoration associated with a variable are removed when the -// variable is removed. -TEST_F(DeadVariableElimTest, RemoveVariableAndDecorations) { - const std::string before = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %main "main" -OpSource GLSL 450 -OpName %main "main" -OpName %B "B" -OpMemberName %B 0 "a" -OpName %Bdat "Bdat" -OpMemberDecorate %B 0 Offset 0 -OpDecorate %B BufferBlock -OpDecorate %Bdat DescriptorSet 0 -OpDecorate %Bdat Binding 0 -%void = OpTypeVoid -%6 = OpTypeFunction %void -%uint = OpTypeInt 32 0 -%B = OpTypeStruct %uint -%_ptr_Uniform_B = OpTypePointer Uniform %B -%Bdat = OpVariable %_ptr_Uniform_B Uniform -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%uint_1 = OpConstant %uint 1 -%_ptr_Uniform_uint = OpTypePointer Uniform %uint -%main = OpFunction %void None %6 -%13 = OpLabel -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %main "main" -OpSource GLSL 450 -OpName %main "main" -OpName %B "B" -OpMemberName %B 0 "a" -OpMemberDecorate %B 0 Offset 0 -OpDecorate %B BufferBlock -%void = OpTypeVoid -%6 = OpTypeFunction %void -%uint = OpTypeInt 32 0 -%B = OpTypeStruct %uint -%_ptr_Uniform_B = OpTypePointer Uniform %B -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%uint_1 = OpConstant %uint 1 -%_ptr_Uniform_uint = OpTypePointer Uniform %uint -%main = OpFunction %void None %6 -%13 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - SinglePassRunAndCheck(before, after, true, - true); -} -} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/def_use_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/def_use_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/def_use_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/def_use_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1521 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include -#include - -#include -#include - -#include "opt/build_module.h" -#include "opt/def_use_manager.h" -#include "pass_utils.h" -#include "spirv-tools/libspirv.hpp" - -namespace { - -using ::testing::ElementsAre; - -using namespace spvtools; -using spvtools::opt::analysis::DefUseManager; - -// Disassembles the given |inst| and returns the disassembly. -std::string DisassembleInst(ir::Instruction* inst) { - SpirvTools tools(SPV_ENV_UNIVERSAL_1_1); - - std::vector binary; - // We need this to generate the necessary header in the binary. - tools.Assemble("", &binary); - inst->ToBinaryWithoutAttachedDebugInsts(&binary); - - std::string text; - // We'll need to check the underlying id numbers. - // So turn off friendly names for ids. - tools.Disassemble(binary, &text, SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); - while (!text.empty() && text.back() == '\n') text.pop_back(); - return text; -} - -// A struct for holding expected id defs and uses. -struct InstDefUse { - using IdInstPair = std::pair; - using IdInstsPair = std::pair>; - - // Ids and their corresponding def instructions. - std::vector defs; - // Ids and their corresponding use instructions. - std::vector uses; -}; - -// Checks that the |actual_defs| and |actual_uses| are in accord with -// |expected_defs_uses|. -void CheckDef(const InstDefUse& expected_defs_uses, - const DefUseManager::IdToDefMap& actual_defs) { - // Check defs. - ASSERT_EQ(expected_defs_uses.defs.size(), actual_defs.size()); - for (uint32_t i = 0; i < expected_defs_uses.defs.size(); ++i) { - const auto id = expected_defs_uses.defs[i].first; - const auto expected_def = expected_defs_uses.defs[i].second; - ASSERT_EQ(1u, actual_defs.count(id)) << "expected to def id [" << id << "]"; - EXPECT_EQ(expected_def, DisassembleInst(actual_defs.at(id))); - } -} - -void CheckUse(const InstDefUse& expected_defs_uses, - const DefUseManager::IdToUsesMap& actual_uses) { - // Check uses. - ASSERT_EQ(expected_defs_uses.uses.size(), actual_uses.size()); - for (uint32_t i = 0; i < expected_defs_uses.uses.size(); ++i) { - const auto id = expected_defs_uses.uses[i].first; - const auto& expected_uses = expected_defs_uses.uses[i].second; - - ASSERT_EQ(1u, actual_uses.count(id)) << "expected to use id [" << id << "]"; - const auto& uses = actual_uses.at(id); - - ASSERT_EQ(expected_uses.size(), uses.size()) - << "id [" << id << "] # uses: expected: " << expected_uses.size() - << " actual: " << uses.size(); - auto it = uses.cbegin(); - for (const auto expected_use : expected_uses) { - EXPECT_EQ(expected_use, DisassembleInst(it->inst)) - << "id [" << id << "] use instruction mismatch"; - ++it; - } - } -} - -// The following test case mimics how LLVM handles induction variables. -// But, yeah, it's not very readable. However, we only care about the id -// defs and uses. So, no need to make sure this is valid OpPhi construct. -const char kOpPhiTestFunction[] = - " %2 = OpFunction %1 None %3 " - " %4 = OpLabel " - " OpBranch %5 " - - " %5 = OpLabel " - " %7 = OpPhi %6 %8 %4 %9 %5 " - "%11 = OpPhi %10 %12 %4 %13 %5 " - " %9 = OpIAdd %6 %7 %14 " - "%13 = OpFAdd %10 %11 %15 " - "%17 = OpSLessThan %16 %7 %18 " - " OpLoopMerge %19 %5 None " - " OpBranchConditional %17 %5 %19 " - - "%19 = OpLabel " - " OpReturn " - " OpFunctionEnd"; - -struct ParseDefUseCase { - const char* text; - InstDefUse du; -}; - -using ParseDefUseTest = ::testing::TestWithParam; - -TEST_P(ParseDefUseTest, Case) { - const auto& tc = GetParam(); - - // Build module. - const std::vector text = {tc.text}; - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, JoinAllInsts(text)); - ASSERT_NE(nullptr, module); - - // Analyze def and use. - opt::analysis::DefUseManager manager(nullptr, module.get()); - - CheckDef(tc.du, manager.id_to_defs()); - CheckUse(tc.du, manager.id_to_uses()); -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - TestCase, ParseDefUseTest, - ::testing::ValuesIn(std::vector{ - {"", {{}, {}}}, // no instruction - {"OpMemoryModel Logical GLSL450", {{}, {}}}, // no def and use - { // single def, no use - "%1 = OpString \"wow\"", - { - {{1, "%1 = OpString \"wow\""}}, // defs - {} // uses - } - }, - { // multiple def, no use - "%1 = OpString \"hello\" " - "%2 = OpString \"world\" " - "%3 = OpTypeVoid", - { - { // defs - {1, "%1 = OpString \"hello\""}, - {2, "%2 = OpString \"world\""}, - {3, "%3 = OpTypeVoid"}, - }, - {} // uses - } - }, - { // single use, no def - "OpTypeForwardPointer %1 Input", - { - {}, // defs - { // uses - {1, {"OpTypeForwardPointer %1 Input"}}, - } - } - }, - { // multiple use, no def - "OpEntryPoint Fragment %1 \"main\" " - "OpTypeForwardPointer %2 Input " - "OpTypeForwardPointer %3 Output", - { - {}, // defs - { // uses - {1, {"OpEntryPoint Fragment %1 \"main\""}}, - {2, {"OpTypeForwardPointer %2 Input"}}, - {3, {"OpTypeForwardPointer %3 Output"}}, - } - } - }, - { // multiple def, multiple use - "%1 = OpTypeBool " - "%2 = OpTypeVector %1 3 " - "%3 = OpTypeMatrix %2 3", - { - { // defs - {1, "%1 = OpTypeBool"}, - {2, "%2 = OpTypeVector %1 3"}, - {3, "%3 = OpTypeMatrix %2 3"}, - }, - { // uses - {1, {"%2 = OpTypeVector %1 3"}}, - {2, {"%3 = OpTypeMatrix %2 3"}}, - } - } - }, - { // multiple use of the same id - "%1 = OpTypeBool " - "%2 = OpTypeVector %1 2 " - "%3 = OpTypeVector %1 3 " - "%4 = OpTypeVector %1 4", - { - { // defs - {1, "%1 = OpTypeBool"}, - {2, "%2 = OpTypeVector %1 2"}, - {3, "%3 = OpTypeVector %1 3"}, - {4, "%4 = OpTypeVector %1 4"}, - }, - { // uses - {1, - { - "%2 = OpTypeVector %1 2", - "%3 = OpTypeVector %1 3", - "%4 = OpTypeVector %1 4", - } - }, - } - } - }, - { // labels - "%2 = OpFunction %1 None %3 " - - "%4 = OpLabel " - "OpBranchConditional %5 %6 %7 " - - "%6 = OpLabel " - "OpBranch %7 " - - "%7 = OpLabel " - "OpReturn " - - "OpFunctionEnd", - { - { // defs - {2, "%2 = OpFunction %1 None %3"}, - {4, "%4 = OpLabel"}, - {6, "%6 = OpLabel"}, - {7, "%7 = OpLabel"}, - }, - { // uses - {1, {"%2 = OpFunction %1 None %3"}}, - {3, {"%2 = OpFunction %1 None %3"}}, - {5, {"OpBranchConditional %5 %6 %7"}}, - {6, {"OpBranchConditional %5 %6 %7"}}, - {7, - { - "OpBranchConditional %5 %6 %7", - "OpBranch %7", - } - }, - } - } - }, - { // cross function - "%1 = OpTypeBool " - - "%2 = OpFunction %1 None %3 " - - "%4 = OpLabel " - "%5 = OpVariable %1 Function " - "%6 = OpFunctionCall %1 %2 %5 " - "OpReturnValue %6 " - - "OpFunctionEnd", - { - { // defs - {1, "%1 = OpTypeBool"}, - {2, "%2 = OpFunction %1 None %3"}, - {4, "%4 = OpLabel"}, - {5, "%5 = OpVariable %1 Function"}, - {6, "%6 = OpFunctionCall %1 %2 %5"}, - }, - { // uses - {1, - { - "%2 = OpFunction %1 None %3", - "%5 = OpVariable %1 Function", - "%6 = OpFunctionCall %1 %2 %5", - } - }, - {2, {"%6 = OpFunctionCall %1 %2 %5"}}, - {5, {"%6 = OpFunctionCall %1 %2 %5"}}, - {3, {"%2 = OpFunction %1 None %3"}}, - {6, {"OpReturnValue %6"}}, - } - } - }, - { // selection merge and loop merge - "%2 = OpFunction %1 None %3 " - - "%4 = OpLabel " - "OpLoopMerge %5 %4 None " - "OpBranch %6 " - - "%5 = OpLabel " - "OpReturn " - - "%6 = OpLabel " - "OpSelectionMerge %7 None " - "OpBranchConditional %8 %9 %7 " - - "%7 = OpLabel " - "OpReturn " - - "%9 = OpLabel " - "OpReturn " - - "OpFunctionEnd", - { - { // defs - {2, "%2 = OpFunction %1 None %3"}, - {4, "%4 = OpLabel"}, - {5, "%5 = OpLabel"}, - {6, "%6 = OpLabel"}, - {7, "%7 = OpLabel"}, - {9, "%9 = OpLabel"}, - }, - { // uses - {1, {"%2 = OpFunction %1 None %3"}}, - {3, {"%2 = OpFunction %1 None %3"}}, - {4, {"OpLoopMerge %5 %4 None"}}, - {5, {"OpLoopMerge %5 %4 None"}}, - {6, {"OpBranch %6"}}, - {7, - { - "OpSelectionMerge %7 None", - "OpBranchConditional %8 %9 %7", - } - }, - {8, {"OpBranchConditional %8 %9 %7"}}, - {9, {"OpBranchConditional %8 %9 %7"}}, - } - } - }, - { // Forward reference - "OpDecorate %1 Block " - "OpTypeForwardPointer %2 Input " - "%3 = OpTypeInt 32 0 " - "%1 = OpTypeStruct %3 " - "%2 = OpTypePointer Input %3", - { - { // defs - {1, "%1 = OpTypeStruct %3"}, - {2, "%2 = OpTypePointer Input %3"}, - {3, "%3 = OpTypeInt 32 0"}, - }, - { // uses - {1, {"OpDecorate %1 Block"}}, - {2, {"OpTypeForwardPointer %2 Input"}}, - {3, - { - "%1 = OpTypeStruct %3", - "%2 = OpTypePointer Input %3", - } - } - }, - }, - }, - { // OpPhi - kOpPhiTestFunction, - { - { // defs - {2, "%2 = OpFunction %1 None %3"}, - {4, "%4 = OpLabel"}, - {5, "%5 = OpLabel"}, - {7, "%7 = OpPhi %6 %8 %4 %9 %5"}, - {9, "%9 = OpIAdd %6 %7 %14"}, - {11, "%11 = OpPhi %10 %12 %4 %13 %5"}, - {13, "%13 = OpFAdd %10 %11 %15"}, - {17, "%17 = OpSLessThan %16 %7 %18"}, - {19, "%19 = OpLabel"}, - }, - { // uses - {1, {"%2 = OpFunction %1 None %3"}}, - {3, {"%2 = OpFunction %1 None %3"}}, - {4, - { - "%7 = OpPhi %6 %8 %4 %9 %5", - "%11 = OpPhi %10 %12 %4 %13 %5", - } - }, - {5, - { - "OpBranch %5", - "%7 = OpPhi %6 %8 %4 %9 %5", - "%11 = OpPhi %10 %12 %4 %13 %5", - "OpLoopMerge %19 %5 None", - "OpBranchConditional %17 %5 %19", - } - }, - {6, - { - "%7 = OpPhi %6 %8 %4 %9 %5", - "%9 = OpIAdd %6 %7 %14", - } - }, - {7, - { - "%9 = OpIAdd %6 %7 %14", - "%17 = OpSLessThan %16 %7 %18", - } - }, - {8, {"%7 = OpPhi %6 %8 %4 %9 %5"}}, - {9, {"%7 = OpPhi %6 %8 %4 %9 %5"}}, - {10, - { - "%11 = OpPhi %10 %12 %4 %13 %5", - "%13 = OpFAdd %10 %11 %15", - } - }, - {11, {"%13 = OpFAdd %10 %11 %15"}}, - {12, {"%11 = OpPhi %10 %12 %4 %13 %5"}}, - {13, {"%11 = OpPhi %10 %12 %4 %13 %5"}}, - {14, {"%9 = OpIAdd %6 %7 %14"}}, - {15, {"%13 = OpFAdd %10 %11 %15"}}, - {16, {"%17 = OpSLessThan %16 %7 %18"}}, - {17, {"OpBranchConditional %17 %5 %19"}}, - {18, {"%17 = OpSLessThan %16 %7 %18"}}, - {19, - { - "OpLoopMerge %19 %5 None", - "OpBranchConditional %17 %5 %19", - } - }, - }, - }, - }, - { // OpPhi defining and referencing the same id. - "%1 = OpTypeBool " - "%2 = OpConstantTrue %1 " - - "%4 = OpFunction %3 None %5 " - "%6 = OpLabel " - " OpBranch %7 " - "%7 = OpLabel " - "%8 = OpPhi %1 %8 %7 %2 %6 " // both defines and uses %8 - " OpBranch %7 " - " OpFunctionEnd", - { - { // defs - {1, "%1 = OpTypeBool"}, - {2, "%2 = OpConstantTrue %1"}, - {4, "%4 = OpFunction %3 None %5"}, - {6, "%6 = OpLabel"}, - {7, "%7 = OpLabel"}, - {8, "%8 = OpPhi %1 %8 %7 %2 %6"}, - }, - { // uses - {1, - { - "%2 = OpConstantTrue %1", - "%8 = OpPhi %1 %8 %7 %2 %6", - } - }, - {2, {"%8 = OpPhi %1 %8 %7 %2 %6"}}, - {3, {"%4 = OpFunction %3 None %5"}}, - {5, {"%4 = OpFunction %3 None %5"}}, - {6, {"%8 = OpPhi %1 %8 %7 %2 %6"}}, - {7, - { - "OpBranch %7", - "%8 = OpPhi %1 %8 %7 %2 %6", - "OpBranch %7", - } - }, - {8, {"%8 = OpPhi %1 %8 %7 %2 %6"}}, - }, - }, - }, - }) -); -// clang-format on - -struct ReplaceUseCase { - const char* before; - std::vector> candidates; - const char* after; - InstDefUse du; -}; - -using ReplaceUseTest = ::testing::TestWithParam; - -// Disassembles the given |module| and returns the disassembly. -std::string DisassembleModule(ir::Module* module) { - SpirvTools tools(SPV_ENV_UNIVERSAL_1_1); - - std::vector binary; - module->ToBinary(&binary, /* skip_nop = */ false); - - std::string text; - // We'll need to check the underlying id numbers. - // So turn off friendly names for ids. - tools.Disassemble(binary, &text, SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); - while (!text.empty() && text.back() == '\n') text.pop_back(); - return text; -} - -TEST_P(ReplaceUseTest, Case) { - const auto& tc = GetParam(); - - // Build module. - const std::vector text = {tc.before}; - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, JoinAllInsts(text)); - ASSERT_NE(nullptr, module); - - // Analyze def and use. - opt::analysis::DefUseManager manager(nullptr, module.get()); - - // Do the substitution. - for (const auto& candiate : tc.candidates) { - manager.ReplaceAllUsesWith(candiate.first, candiate.second); - } - - EXPECT_EQ(tc.after, DisassembleModule(module.get())); - CheckDef(tc.du, manager.id_to_defs()); - CheckUse(tc.du, manager.id_to_uses()); -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - TestCase, ReplaceUseTest, - ::testing::ValuesIn(std::vector{ - { // no use, no replace request - "", {}, "", {}, - }, - { // no use, some replace requests - "OpMemoryModel Logical GLSL450", - {{1, 2}, {3, 4}, {7, 8}, {7, 9}, {7, 10}, {2, 10}, {3, 10}}, - "OpMemoryModel Logical GLSL450", - {}, - }, - { // replace one use - "%1 = OpTypeBool " - "%2 = OpTypeVector %1 3", - {{1, 3}}, - "%1 = OpTypeBool\n" - "%2 = OpTypeVector %3 3", - { - { // defs - {1, "%1 = OpTypeBool"}, - {2, "%2 = OpTypeVector %3 3"}, - }, - { // uses - {3, {"%2 = OpTypeVector %3 3"}}, - }, - }, - }, - { // replace and then replace back - "%1 = OpTypeBool " - "%2 = OpTypeVector %1 3", - {{1, 3}, {3, 1}}, - "%1 = OpTypeBool\n" - "%2 = OpTypeVector %1 3", - { - { // defs - {1, "%1 = OpTypeBool"}, - {2, "%2 = OpTypeVector %1 3"}, - }, - { // uses - {1, {"%2 = OpTypeVector %1 3"}}, - }, - }, - }, - { // replace with the same id - "%1 = OpTypeBool " - "%2 = OpTypeVector %1 3", - {{1, 1}, {2, 2}, {3, 3}}, - "%1 = OpTypeBool\n" - "%2 = OpTypeVector %1 3", - { - { // defs - {1, "%1 = OpTypeBool"}, - {2, "%2 = OpTypeVector %1 3"}, - }, - { // uses - {1, {"%2 = OpTypeVector %1 3"}}, - }, - }, - }, - { // replace in sequence - "%1 = OpTypeBool " - "%2 = OpTypeVector %1 3", - {{1, 3}, {3, 4}, {4, 5}, {5, 100}}, - "%1 = OpTypeBool\n" - "%2 = OpTypeVector %100 3", - { - { // defs - {1, "%1 = OpTypeBool"}, - {2, "%2 = OpTypeVector %100 3"}, - }, - { // uses - {100, {"%2 = OpTypeVector %100 3"}}, - }, - }, - }, - { // replace multiple uses - "%1 = OpTypeBool " - "%2 = OpTypeVector %1 2 " - "%3 = OpTypeVector %1 3 " - "%4 = OpTypeVector %1 4 " - "%5 = OpTypeMatrix %2 2 " - "%6 = OpTypeMatrix %3 3 " - "%7 = OpTypeMatrix %4 4", - {{1, 10}, {2, 20}, {4, 40}}, - "%1 = OpTypeBool\n" - "%2 = OpTypeVector %10 2\n" - "%3 = OpTypeVector %10 3\n" - "%4 = OpTypeVector %10 4\n" - "%5 = OpTypeMatrix %20 2\n" - "%6 = OpTypeMatrix %3 3\n" - "%7 = OpTypeMatrix %40 4", - { - { // defs - {1, "%1 = OpTypeBool"}, - {2, "%2 = OpTypeVector %10 2"}, - {3, "%3 = OpTypeVector %10 3"}, - {4, "%4 = OpTypeVector %10 4"}, - {5, "%5 = OpTypeMatrix %20 2"}, - {6, "%6 = OpTypeMatrix %3 3"}, - {7, "%7 = OpTypeMatrix %40 4"}, - }, - { // uses - {10, - { - "%2 = OpTypeVector %10 2", - "%3 = OpTypeVector %10 3", - "%4 = OpTypeVector %10 4", - } - }, - {20, {"%5 = OpTypeMatrix %20 2"}}, - {3, {"%6 = OpTypeMatrix %3 3"}}, - {40, {"%7 = OpTypeMatrix %40 4"}}, - }, - }, - }, - { // OpPhi. - kOpPhiTestFunction, - // replace one id used by OpPhi, replace one id generated by OpPhi - {{9, 9000}, {11, 9}}, - "%2 = OpFunction %1 None %3\n" - "%4 = OpLabel\n" - "OpBranch %5\n" - - "%5 = OpLabel\n" - "%7 = OpPhi %6 %8 %4 %9000 %5\n" // %9 -> %9000 - "%11 = OpPhi %10 %12 %4 %13 %5\n" - "%9 = OpIAdd %6 %7 %14\n" - "%13 = OpFAdd %10 %9 %15\n" // %11 -> %9 - "%17 = OpSLessThan %16 %7 %18\n" - "OpLoopMerge %19 %5 None\n" - "OpBranchConditional %17 %5 %19\n" - - "%19 = OpLabel\n" - "OpReturn\n" - "OpFunctionEnd", - { - { // defs. - {2, "%2 = OpFunction %1 None %3"}, - {4, "%4 = OpLabel"}, - {5, "%5 = OpLabel"}, - {7, "%7 = OpPhi %6 %8 %4 %9000 %5"}, - {9, "%9 = OpIAdd %6 %7 %14"}, - {11, "%11 = OpPhi %10 %12 %4 %13 %5"}, - {13, "%13 = OpFAdd %10 %9 %15"}, - {17, "%17 = OpSLessThan %16 %7 %18"}, - {19, "%19 = OpLabel"}, - }, - { // uses - {1, {"%2 = OpFunction %1 None %3"}}, - {3, {"%2 = OpFunction %1 None %3"}}, - {4, - { - "%7 = OpPhi %6 %8 %4 %9000 %5", - "%11 = OpPhi %10 %12 %4 %13 %5", - } - }, - {5, - { - "OpBranch %5", - "%7 = OpPhi %6 %8 %4 %9000 %5", - "%11 = OpPhi %10 %12 %4 %13 %5", - "OpLoopMerge %19 %5 None", - "OpBranchConditional %17 %5 %19", - } - }, - {6, - { - "%7 = OpPhi %6 %8 %4 %9000 %5", - "%9 = OpIAdd %6 %7 %14", - } - }, - {7, - { - "%9 = OpIAdd %6 %7 %14", - "%17 = OpSLessThan %16 %7 %18", - } - }, - {8, {"%7 = OpPhi %6 %8 %4 %9000 %5"}}, - {9, {"%13 = OpFAdd %10 %9 %15"}}, // uses of %9 changed from %7 to %13 - {10, - { - "%11 = OpPhi %10 %12 %4 %13 %5", - "%13 = OpFAdd %10 %9 %15", - } - }, - // no more uses of %11 - {12, {"%11 = OpPhi %10 %12 %4 %13 %5"}}, - {13, {"%11 = OpPhi %10 %12 %4 %13 %5"}}, - {14, {"%9 = OpIAdd %6 %7 %14"}}, - {15, {"%13 = OpFAdd %10 %9 %15"}}, - {16, {"%17 = OpSLessThan %16 %7 %18"}}, - {17, {"OpBranchConditional %17 %5 %19"}}, - {18, {"%17 = OpSLessThan %16 %7 %18"}}, - {19, - { - "OpLoopMerge %19 %5 None", - "OpBranchConditional %17 %5 %19", - } - }, - // new uses of %9000 - {9000, {"%7 = OpPhi %6 %8 %4 %9000 %5"}}, - }, - }, - }, - { // OpPhi defining and referencing the same id. - "%1 = OpTypeBool " - "%2 = OpConstantTrue %1 " - - "%4 = OpFunction %3 None %5 " - "%6 = OpLabel " - " OpBranch %7 " - "%7 = OpLabel " - "%8 = OpPhi %1 %8 %7 %2 %6 " // both defines and uses %8 - " OpBranch %7 " - " OpFunctionEnd", - {{8, 2}}, - "%1 = OpTypeBool\n" - "%2 = OpConstantTrue %1\n" - - "%4 = OpFunction %3 None %5\n" - "%6 = OpLabel\n" - "OpBranch %7\n" - "%7 = OpLabel\n" - "%8 = OpPhi %1 %2 %7 %2 %6\n" // use of %8 changed to %2 - "OpBranch %7\n" - "OpFunctionEnd", - { - { // defs - {1, "%1 = OpTypeBool"}, - {2, "%2 = OpConstantTrue %1"}, - {4, "%4 = OpFunction %3 None %5"}, - {6, "%6 = OpLabel"}, - {7, "%7 = OpLabel"}, - {8, "%8 = OpPhi %1 %2 %7 %2 %6"}, - }, - { // uses - {1, - { - "%2 = OpConstantTrue %1", - "%8 = OpPhi %1 %2 %7 %2 %6", - } - }, - {2, - { - // TODO(antiagainst): address this. - // We have duplication here because we didn't check existence - // before inserting uses. - "%8 = OpPhi %1 %2 %7 %2 %6", - "%8 = OpPhi %1 %2 %7 %2 %6", - } - }, - {3, {"%4 = OpFunction %3 None %5"}}, - {5, {"%4 = OpFunction %3 None %5"}}, - {6, {"%8 = OpPhi %1 %2 %7 %2 %6"}}, - {7, - { - "OpBranch %7", - "%8 = OpPhi %1 %2 %7 %2 %6", - "OpBranch %7", - } - }, - // {8, {"%8 = OpPhi %1 %8 %7 %2 %6"}}, - }, - }, - }, - }) -); -// clang-format on - -struct KillDefCase { - const char* before; - std::vector ids_to_kill; - const char* after; - InstDefUse du; -}; - -using KillDefTest = ::testing::TestWithParam; - -TEST_P(KillDefTest, Case) { - const auto& tc = GetParam(); - - // Build module. - const std::vector text = {tc.before}; - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, JoinAllInsts(text)); - ASSERT_NE(nullptr, module); - - // Analyze def and use. - opt::analysis::DefUseManager manager(nullptr, module.get()); - - // Do the substitution. - for (const auto id : tc.ids_to_kill) manager.KillDef(id); - - EXPECT_EQ(tc.after, DisassembleModule(module.get())); - CheckDef(tc.du, manager.id_to_defs()); - CheckUse(tc.du, manager.id_to_uses()); -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - TestCase, KillDefTest, - ::testing::ValuesIn(std::vector{ - { // no def, no use, no kill - "", {}, "", {} - }, - { // kill nothing - "%1 = OpTypeBool " - "%2 = OpTypeVector %1 2 " - "%3 = OpTypeVector %1 3 ", - {}, - "%1 = OpTypeBool\n" - "%2 = OpTypeVector %1 2\n" - "%3 = OpTypeVector %1 3", - { - { // defs - {1, "%1 = OpTypeBool"}, - {2, "%2 = OpTypeVector %1 2"}, - {3, "%3 = OpTypeVector %1 3"}, - }, - { // uses - {1, - { - "%2 = OpTypeVector %1 2", - "%3 = OpTypeVector %1 3", - } - }, - }, - }, - }, - { // kill id used, kill id not used, kill id not defined - "%1 = OpTypeBool " - "%2 = OpTypeVector %1 2 " - "%3 = OpTypeVector %1 3 " - "%4 = OpTypeVector %1 4 " - "%5 = OpTypeMatrix %3 3 " - "%6 = OpTypeMatrix %2 3", - {1, 3, 5, 10}, // ids to kill - "OpNop\n" - "%2 = OpTypeVector %1 2\n" - "OpNop\n" - "%4 = OpTypeVector %1 4\n" - "OpNop\n" - "%6 = OpTypeMatrix %2 3", - { - { // defs - {2, "%2 = OpTypeVector %1 2"}, - {4, "%4 = OpTypeVector %1 4"}, - {6, "%6 = OpTypeMatrix %2 3"}, - }, - { // uses. %1 and %3 are both killed, so no uses - // recorded for them anymore. - {2, {"%6 = OpTypeMatrix %2 3"}}, - } - }, - }, - { // OpPhi. - kOpPhiTestFunction, - {9, 11}, // kill one id used by OpPhi, kill one id generated by OpPhi - "%2 = OpFunction %1 None %3\n" - "%4 = OpLabel\n" - "OpBranch %5\n" - - "%5 = OpLabel\n" - "%7 = OpPhi %6 %8 %4 %9 %5\n" - "OpNop\n" - "OpNop\n" - "%13 = OpFAdd %10 %11 %15\n" - "%17 = OpSLessThan %16 %7 %18\n" - "OpLoopMerge %19 %5 None\n" - "OpBranchConditional %17 %5 %19\n" - - "%19 = OpLabel\n" - "OpReturn\n" - "OpFunctionEnd", - { - { // defs. %9 & %11 are killed. - {2, "%2 = OpFunction %1 None %3"}, - {4, "%4 = OpLabel"}, - {5, "%5 = OpLabel"}, - {7, "%7 = OpPhi %6 %8 %4 %9 %5"}, - {13, "%13 = OpFAdd %10 %11 %15"}, - {17, "%17 = OpSLessThan %16 %7 %18"}, - {19, "%19 = OpLabel"}, - }, - { // uses - {1, {"%2 = OpFunction %1 None %3"}}, - {3, {"%2 = OpFunction %1 None %3"}}, - {4, - { - "%7 = OpPhi %6 %8 %4 %9 %5", - // "%11 = OpPhi %10 %12 %4 %13 %5", - } - }, - {5, - { - "OpBranch %5", - "%7 = OpPhi %6 %8 %4 %9 %5", - // "%11 = OpPhi %10 %12 %4 %13 %5", - "OpLoopMerge %19 %5 None", - "OpBranchConditional %17 %5 %19", - } - }, - {6, - { - "%7 = OpPhi %6 %8 %4 %9 %5", - // "%9 = OpIAdd %6 %7 %14", - } - }, - {7, - { - // "%9 = OpIAdd %6 %7 %14", - "%17 = OpSLessThan %16 %7 %18", - } - }, - {8, {"%7 = OpPhi %6 %8 %4 %9 %5"}}, - // {9, {"%7 = OpPhi %6 %8 %4 %9 %5"}}, - {10, - { - // "%11 = OpPhi %10 %12 %4 %13 %5", - "%13 = OpFAdd %10 %11 %15", - } - }, - // {11, {"%13 = OpFAdd %10 %11 %15"}}, - // {12, {"%11 = OpPhi %10 %12 %4 %13 %5"}}, - // {13, {"%11 = OpPhi %10 %12 %4 %13 %5"}}, - // {14, {"%9 = OpIAdd %6 %7 %14"}}, - {15, {"%13 = OpFAdd %10 %11 %15"}}, - {16, {"%17 = OpSLessThan %16 %7 %18"}}, - {17, {"OpBranchConditional %17 %5 %19"}}, - {18, {"%17 = OpSLessThan %16 %7 %18"}}, - {19, - { - "OpLoopMerge %19 %5 None", - "OpBranchConditional %17 %5 %19", - } - }, - }, - }, - }, - { // OpPhi defining and referencing the same id. - "%1 = OpTypeBool " - "%2 = OpConstantTrue %1 " - - "%4 = OpFunction %3 None %5 " - "%6 = OpLabel " - " OpBranch %7 " - "%7 = OpLabel " - "%8 = OpPhi %1 %8 %7 %2 %6 " // both defines and uses %8 - " OpBranch %7 " - " OpFunctionEnd", - {8}, - "%1 = OpTypeBool\n" - "%2 = OpConstantTrue %1\n" - - "%4 = OpFunction %3 None %5\n" - "%6 = OpLabel\n" - "OpBranch %7\n" - "%7 = OpLabel\n" - "OpNop\n" - "OpBranch %7\n" - "OpFunctionEnd", - { - { // defs - {1, "%1 = OpTypeBool"}, - {2, "%2 = OpConstantTrue %1"}, - {4, "%4 = OpFunction %3 None %5"}, - {6, "%6 = OpLabel"}, - {7, "%7 = OpLabel"}, - // {8, "%8 = OpPhi %1 %8 %7 %2 %6"}, - }, - { // uses - {1, - { - "%2 = OpConstantTrue %1", - // "%8 = OpPhi %1 %8 %7 %2 %6", - } - }, - // {2, {"%8 = OpPhi %1 %8 %7 %2 %6"}}, - {3, {"%4 = OpFunction %3 None %5"}}, - {5, {"%4 = OpFunction %3 None %5"}}, - // {6, {"%8 = OpPhi %1 %8 %7 %2 %6"}}, - {7, - { - "OpBranch %7", - // "%8 = OpPhi %1 %8 %7 %2 %6", - "OpBranch %7", - } - }, - // {8, {"%8 = OpPhi %1 %8 %7 %2 %6"}}, - }, - }, - }, - }) -); -// clang-format on -// -TEST(DefUseTest, OpSwitch) { - // Because disassembler has basic type check for OpSwitch's selector, we - // cannot use the DisassembleInst() in the above. Thus, this special spotcheck - // test case. - - const char original_text[] = - // int64 f(int64 v) { - // switch (v) { - // case 1: break; - // case -4294967296: break; - // case 9223372036854775807: break; - // default: break; - // } - // return v; - // } - " %1 = OpTypeInt 64 1 " - " %2 = OpFunction %1 None %3 " // %3 is int64(int64)* - " %4 = OpFunctionParameter %1 " - " %5 = OpLabel " - " %6 = OpLoad %1 %4 " // selector value - " OpSelectionMerge %7 None " - " OpSwitch %6 %8 " - " 1 %9 " // 1 - " -4294967296 %10 " // -2^32 - " 9223372036854775807 %11 " // 2^63-1 - " %8 = OpLabel " // default - " OpBranch %7 " - " %9 = OpLabel " - " OpBranch %7 " - "%10 = OpLabel " - " OpBranch %7 " - "%11 = OpLabel " - " OpBranch %7 " - " %7 = OpLabel " - " OpReturnValue %6 " - " OpFunctionEnd"; - - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, original_text); - ASSERT_NE(nullptr, module); - - // Analyze def and use. - opt::analysis::DefUseManager manager(nullptr, module.get()); - - // Do a bunch replacements. - manager.ReplaceAllUsesWith(9, 900); // to unused id - manager.ReplaceAllUsesWith(10, 1000); // to unused id - manager.ReplaceAllUsesWith(11, 7); // to existing id - - // clang-format off - const char modified_text[] = - "%1 = OpTypeInt 64 1\n" - "%2 = OpFunction %1 None %3\n" // %3 is int64(int64)* - "%4 = OpFunctionParameter %1\n" - "%5 = OpLabel\n" - "%6 = OpLoad %1 %4\n" // selector value - "OpSelectionMerge %7 None\n" - "OpSwitch %6 %8 1 %900 -4294967296 %1000 9223372036854775807 %7\n" // changed! - "%8 = OpLabel\n" // default - "OpBranch %7\n" - "%9 = OpLabel\n" - "OpBranch %7\n" - "%10 = OpLabel\n" - "OpBranch %7\n" - "%11 = OpLabel\n" - "OpBranch %7\n" - "%7 = OpLabel\n" - "OpReturnValue %6\n" - "OpFunctionEnd"; - // clang-format on - - EXPECT_EQ(modified_text, DisassembleModule(module.get())); - - InstDefUse def_uses = {}; - def_uses.defs = { - {1, "%1 = OpTypeInt 64 1"}, - {2, "%2 = OpFunction %1 None %3"}, - {4, "%4 = OpFunctionParameter %1"}, - {5, "%5 = OpLabel"}, - {6, "%6 = OpLoad %1 %4"}, - {7, "%7 = OpLabel"}, - {8, "%8 = OpLabel"}, - {9, "%9 = OpLabel"}, - {10, "%10 = OpLabel"}, - {11, "%11 = OpLabel"}, - }; - CheckDef(def_uses, manager.id_to_defs()); - - { - auto* use_list = manager.GetUses(6); - ASSERT_NE(nullptr, use_list); - EXPECT_EQ(2u, use_list->size()); - EXPECT_EQ(SpvOpSwitch, use_list->front().inst->opcode()); - EXPECT_EQ(SpvOpReturnValue, use_list->back().inst->opcode()); - } - { - auto* use_list = manager.GetUses(7); - ASSERT_NE(nullptr, use_list); - EXPECT_EQ(6u, use_list->size()); - std::vector opcodes; - for (const auto& use : *use_list) { - opcodes.push_back(use.inst->opcode()); - } - // OpSwitch is now a user of %7. - EXPECT_THAT(opcodes, - ElementsAre(SpvOpSelectionMerge, SpvOpBranch, SpvOpBranch, - SpvOpBranch, SpvOpBranch, SpvOpSwitch)); - } - // Check all ids only used by OpSwitch after replacement. - for (const auto id : {8, 900, 1000}) { - auto* use_list = manager.GetUses(id); - ASSERT_NE(nullptr, use_list); - EXPECT_EQ(1u, use_list->size()); - EXPECT_EQ(SpvOpSwitch, use_list->front().inst->opcode()); - } -} - -// Creates an |result_id| = OpTypeInt 32 1 instruction. -ir::Instruction Int32TypeInstruction(uint32_t result_id) { - return ir::Instruction(SpvOp::SpvOpTypeInt, 0, result_id, - {ir::Operand(SPV_OPERAND_TYPE_LITERAL_INTEGER, {32}), - ir::Operand(SPV_OPERAND_TYPE_LITERAL_INTEGER, {1})}); -} - -// Creates an |result_id| = OpConstantTrue/Flase |type_id| instruction. -ir::Instruction ConstantBoolInstruction(bool value, uint32_t type_id, - uint32_t result_id) { - return ir::Instruction( - value ? SpvOp::SpvOpConstantTrue : SpvOp::SpvOpConstantFalse, type_id, - result_id, {}); -} - -// Creates an |result_id| = OpLabel instruction. -ir::Instruction LabelInstruction(uint32_t result_id) { - return ir::Instruction(SpvOp::SpvOpLabel, 0, result_id, {}); -} - -// Creates an OpBranch |target_id| instruction. -ir::Instruction BranchInstruction(uint32_t target_id) { - return ir::Instruction(SpvOp::SpvOpBranch, 0, 0, - { - ir::Operand(SPV_OPERAND_TYPE_ID, {target_id}), - }); -} - -// Test case for analyzing individual instructions. -struct AnalyzeInstDefUseTestCase { - std::vector insts; // instrutions to be analyzed in order. - const char* module_text; - InstDefUse expected_define_use; -}; - -using AnalyzeInstDefUseTest = - ::testing::TestWithParam; - -// Test the analyzing result for individual instructions. -TEST_P(AnalyzeInstDefUseTest, Case) { - auto tc = GetParam(); - - // Build module. - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, tc.module_text); - ASSERT_NE(nullptr, module); - - // Analyze the instructions. - opt::analysis::DefUseManager manager(nullptr, module.get()); - for (ir::Instruction& inst : tc.insts) { - manager.AnalyzeInstDefUse(&inst); - } - - CheckDef(tc.expected_define_use, manager.id_to_defs()); - CheckUse(tc.expected_define_use, manager.id_to_uses()); -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - TestCase, AnalyzeInstDefUseTest, - ::testing::ValuesIn(std::vector{ - { // A type declaring instruction. - {Int32TypeInstruction(1)}, - "", - { - // defs - {{1, "%1 = OpTypeInt 32 1"}}, - {}, // no uses - }, - }, - { // A type declaring instruction and a constant value. - { - Int32TypeInstruction(1), - ConstantBoolInstruction(true, 1, 2), - }, - "", - { - { // defs - {1, "%1 = OpTypeInt 32 1"}, - {2, "%2 = OpConstantTrue %1"}, // It is fine the SPIR-V code here is invalid. - }, - { // uses - {1, {"%2 = OpConstantTrue %1"}}, - }, - }, - }, - { // Analyze two instrutions that have same result id. The def use info - // of the result id from the first instruction should be overwritten by - // the second instruction. - { - ConstantBoolInstruction(true, 1, 2), - // The def-use info of the following instruction should overwrite the - // records of the above one. - ConstantBoolInstruction(false, 3, 2), - }, - "", - { - // defs - {{2, "%2 = OpConstantFalse %3"}}, - // uses - {{3, {"%2 = OpConstantFalse %3"}}} - } - }, - { // Analyze forward reference instruction, also instruction that does - // not have result id. - { - BranchInstruction(2), - LabelInstruction(2), - }, - "", - { - // defs - {{2, "%2 = OpLabel"}}, - // uses - {{2, {"OpBranch %2"}}}, - } - }, - { // Analyzing an additional instruction with new result id to an - // existing module. - { - ConstantBoolInstruction(true, 1, 2), - }, - "%1 = OpTypeInt 32 1 ", - { - { // defs - {1, "%1 = OpTypeInt 32 1"}, - {2, "%2 = OpConstantTrue %1"}, - }, - { // uses - {1, {"%2 = OpConstantTrue %1"}}, - }, - } - }, - { // Analyzing an additional instruction with existing result id to an - // existing module. - { - ConstantBoolInstruction(true, 1, 2), - }, - "%1 = OpTypeInt 32 1 " - "%2 = OpTypeBool ", - { - { // defs - {1, "%1 = OpTypeInt 32 1"}, - {2, "%2 = OpConstantTrue %1"}, - }, - { // uses - {1, {"%2 = OpConstantTrue %1"}}, - }, - } - }, - })); -// clang-format on - -struct KillInstTestCase { - const char* before; - std::unordered_set indices_for_inst_to_kill; - const char* after; - InstDefUse expected_define_use; -}; - -using KillInstTest = ::testing::TestWithParam; - -TEST_P(KillInstTest, Case) { - auto tc = GetParam(); - - // Build module. - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, tc.before); - ASSERT_NE(nullptr, module); - - // KillInst - uint32_t index = 0; - opt::analysis::DefUseManager manager(nullptr, module.get()); - module->ForEachInst([&index, &tc, &manager](ir::Instruction* inst) { - if (tc.indices_for_inst_to_kill.count(index) != 0) { - manager.KillInst(inst); - } - index++; - }); - - EXPECT_EQ(tc.after, DisassembleModule(module.get())); - CheckDef(tc.expected_define_use, manager.id_to_defs()); - CheckUse(tc.expected_define_use, manager.id_to_uses()); -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - TestCase, KillInstTest, - ::testing::ValuesIn(std::vector{ - // Kill id defining instructions. - { - "%2 = OpFunction %1 None %3 " - "%4 = OpLabel " - " OpBranch %5 " - "%5 = OpLabel " - " OpBranch %6 " - "%6 = OpLabel " - " OpBranch %4 " - "%7 = OpLabel " - " OpReturn " - " OpFunctionEnd", - {0, 3, 5, 7}, - "OpNop\n" - "%4 = OpLabel\n" - "OpBranch %5\n" - "OpNop\n" - "OpBranch %6\n" - "OpNop\n" - "OpBranch %4\n" - "OpNop\n" - "OpReturn\n" - "OpFunctionEnd", - { - // defs - {{4, "%4 = OpLabel"}}, - // uses - {{4, {"OpBranch %4"}}} - } - }, - // Kill instructions that do not have result ids. - { - "%2 = OpFunction %1 None %3 " - "%4 = OpLabel " - " OpBranch %5 " - "%5 = OpLabel " - " OpBranch %6 " - "%6 = OpLabel " - " OpBranch %4 " - "%7 = OpLabel " - " OpReturn " - " OpFunctionEnd", - {2, 4}, - "%2 = OpFunction %1 None %3\n" - "%4 = OpLabel\n" - "OpNop\n" - "%5 = OpLabel\n" - "OpNop\n" - "%6 = OpLabel\n" - "OpBranch %4\n" - "%7 = OpLabel\n" - "OpReturn\n" - "OpFunctionEnd", - { - // defs - { - {2, "%2 = OpFunction %1 None %3"}, - {4, "%4 = OpLabel"}, - {5, "%5 = OpLabel"}, - {6, "%6 = OpLabel"}, - {7, "%7 = OpLabel"}, - }, - // uses - { - {1, {"%2 = OpFunction %1 None %3"}}, - {3, {"%2 = OpFunction %1 None %3"}}, - {4, {"OpBranch %4"}}, - } - } - }, - })); -// clang-format on - -struct GetAnnotationsTestCase { - const char* code; - uint32_t id; - std::vector annotations; -}; - -using GetAnnotationsTest = ::testing::TestWithParam; - -TEST_P(GetAnnotationsTest, Case) { - const GetAnnotationsTestCase& tc = GetParam(); - - // Build module. - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, tc.code); - ASSERT_NE(nullptr, module); - - // Get annotations - opt::analysis::DefUseManager manager(nullptr, module.get()); - auto insts = manager.GetAnnotations(tc.id); - - // Check - ASSERT_EQ(tc.annotations.size(), insts.size()) - << "wrong number of annotation instructions"; - auto inst_iter = insts.begin(); - for (const std::string& expected_anno_inst : tc.annotations) { - EXPECT_EQ(expected_anno_inst, DisassembleInst(*inst_iter)) - << "annotation instruction mismatch"; - inst_iter++; - } -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - TestCase, GetAnnotationsTest, - ::testing::ValuesIn(std::vector{ - // empty - {"", 0, {}}, - // basic - { - // code - "OpDecorate %1 Block " - "OpDecorate %1 RelaxedPrecision " - "%3 = OpTypeInt 32 0 " - "%1 = OpTypeStruct %3", - // id - 1, - // annotations - { - "OpDecorate %1 Block", - "OpDecorate %1 RelaxedPrecision", - }, - }, - // with debug instructions - { - // code - "OpName %1 \"struct_type\" " - "OpName %3 \"int_type\" " - "OpDecorate %1 Block " - "OpDecorate %1 RelaxedPrecision " - "%3 = OpTypeInt 32 0 " - "%1 = OpTypeStruct %3", - // id - 1, - // annotations - { - "OpDecorate %1 Block", - "OpDecorate %1 RelaxedPrecision", - }, - }, - // no annotations - { - // code - "OpName %1 \"struct_type\" " - "OpName %3 \"int_type\" " - "OpDecorate %1 Block " - "OpDecorate %1 RelaxedPrecision " - "%3 = OpTypeInt 32 0 " - "%1 = OpTypeStruct %3", - // id - 3, - // annotations - {}, - }, - // decoration group - { - // code - "OpDecorate %1 Block " - "OpDecorate %1 RelaxedPrecision " - "%1 = OpDecorationGroup " - "OpGroupDecorate %1 %2 %3 " - "%4 = OpTypeInt 32 0 " - "%2 = OpTypeStruct %4 " - "%3 = OpTypeStruct %4 %4", - // id - 3, - // annotations - { - "OpGroupDecorate %1 %2 %3", - }, - }, - // memeber decorate - { - // code - "OpMemberDecorate %1 0 RelaxedPrecision " - "%2 = OpTypeInt 32 0 " - "%1 = OpTypeStruct %2 %2", - // id - 1, - // annotations - { - "OpMemberDecorate %1 0 RelaxedPrecision", - }, - }, - })); -// clang-format on -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/eliminate_dead_const_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/eliminate_dead_const_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/eliminate_dead_const_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/eliminate_dead_const_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,840 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "assembly_builder.h" -#include "pass_fixture.h" -#include "pass_utils.h" - -#include -#include -#include -#include -#include - -namespace { - -using namespace spvtools; - -using EliminateDeadConstantBasicTest = PassTest<::testing::Test>; - -TEST_F(EliminateDeadConstantBasicTest, BasicAllDeadConstants) { - const std::vector text = { - // clang-format off - "OpCapability Shader", - "OpCapability Float64", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %main \"main\"", - "OpName %main \"main\"", - "%void = OpTypeVoid", - "%4 = OpTypeFunction %void", - "%bool = OpTypeBool", - "%true = OpConstantTrue %bool", - "%false = OpConstantFalse %bool", - "%int = OpTypeInt 32 1", - "%9 = OpConstant %int 1", - "%uint = OpTypeInt 32 0", - "%11 = OpConstant %uint 2", - "%float = OpTypeFloat 32", - "%13 = OpConstant %float 3.14", - "%double = OpTypeFloat 64", - "%15 = OpConstant %double 3.14159265358979", - "%main = OpFunction %void None %4", - "%16 = OpLabel", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - // None of the above constants is ever used, so all of them should be - // eliminated. - const char* const_decl_opcodes[] = { - " OpConstantTrue ", " OpConstantFalse ", " OpConstant ", - }; - // Skip lines that have any one of const_decl_opcodes. - const std::string expected_disassembly = - SelectiveJoin(text, [&const_decl_opcodes](const char* line) { - return std::any_of( - std::begin(const_decl_opcodes), std::end(const_decl_opcodes), - [&line](const char* const_decl_op) { - return std::string(line).find(const_decl_op) != std::string::npos; - }); - }); - - SinglePassRunAndCheck( - JoinAllInsts(text), expected_disassembly, /* skip_nop = */ true); -} - -TEST_F(EliminateDeadConstantBasicTest, BasicNoneDeadConstants) { - const std::vector text = { - // clang-format off - "OpCapability Shader", - "OpCapability Float64", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %main \"main\"", - "OpName %main \"main\"", - "OpName %btv \"btv\"", - "OpName %bfv \"bfv\"", - "OpName %iv \"iv\"", - "OpName %uv \"uv\"", - "OpName %fv \"fv\"", - "OpName %dv \"dv\"", - "%void = OpTypeVoid", - "%10 = OpTypeFunction %void", - "%bool = OpTypeBool", - "%_ptr_Function_bool = OpTypePointer Function %bool", - "%true = OpConstantTrue %bool", - "%false = OpConstantFalse %bool", - "%int = OpTypeInt 32 1", - "%_ptr_Function_int = OpTypePointer Function %int", - "%int_1 = OpConstant %int 1", - "%uint = OpTypeInt 32 0", - "%_ptr_Function_uint = OpTypePointer Function %uint", - "%uint_2 = OpConstant %uint 2", - "%float = OpTypeFloat 32", - "%_ptr_Function_float = OpTypePointer Function %float", - "%float_3_14 = OpConstant %float 3.14", - "%double = OpTypeFloat 64", - "%_ptr_Function_double = OpTypePointer Function %double", - "%double_3_14159265358979 = OpConstant %double 3.14159265358979", - "%main = OpFunction %void None %10", - "%27 = OpLabel", - "%btv = OpVariable %_ptr_Function_bool Function", - "%bfv = OpVariable %_ptr_Function_bool Function", - "%iv = OpVariable %_ptr_Function_int Function", - "%uv = OpVariable %_ptr_Function_uint Function", - "%fv = OpVariable %_ptr_Function_float Function", - "%dv = OpVariable %_ptr_Function_double Function", - "OpStore %btv %true", - "OpStore %bfv %false", - "OpStore %iv %int_1", - "OpStore %uv %uint_2", - "OpStore %fv %float_3_14", - "OpStore %dv %double_3_14159265358979", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - // All constants are used, so none of them should be eliminated. - SinglePassRunAndCheck( - JoinAllInsts(text), JoinAllInsts(text), /* skip_nop = */ true); -} - -struct EliminateDeadConstantTestCase { - // Type declarations and constants that should be kept. - std::vector used_consts; - // Instructions that refer to constants, this is added to create uses for - // some constants so they won't be treated as dead constants. - std::vector main_insts; - // Dead constants that should be removed. - std::vector dead_consts; -}; - -// All types that are potentially required in EliminateDeadConstantTest. -const std::vector CommonTypes = { - // clang-format off - // scalar types - "%bool = OpTypeBool", - "%uint = OpTypeInt 32 0", - "%int = OpTypeInt 32 1", - "%float = OpTypeFloat 32", - "%double = OpTypeFloat 64", - // vector types - "%v2bool = OpTypeVector %bool 2", - "%v2uint = OpTypeVector %uint 2", - "%v2int = OpTypeVector %int 2", - "%v3int = OpTypeVector %int 3", - "%v4int = OpTypeVector %int 4", - "%v2float = OpTypeVector %float 2", - "%v3float = OpTypeVector %float 3", - "%v2double = OpTypeVector %double 2", - // variable pointer types - "%_pf_bool = OpTypePointer Function %bool", - "%_pf_uint = OpTypePointer Function %uint", - "%_pf_int = OpTypePointer Function %int", - "%_pf_float = OpTypePointer Function %float", - "%_pf_double = OpTypePointer Function %double", - "%_pf_v2int = OpTypePointer Function %v2int", - "%_pf_v3int = OpTypePointer Function %v3int", - "%_pf_v2float = OpTypePointer Function %v2float", - "%_pf_v3float = OpTypePointer Function %v3float", - "%_pf_v2double = OpTypePointer Function %v2double", - // struct types - "%inner_struct = OpTypeStruct %bool %int %float %double", - "%outer_struct = OpTypeStruct %inner_struct %int %double", - "%flat_struct = OpTypeStruct %bool %int %float %double", - // clang-format on -}; - -using EliminateDeadConstantTest = - PassTest<::testing::TestWithParam>; - -TEST_P(EliminateDeadConstantTest, Custom) { - auto& tc = GetParam(); - AssemblyBuilder builder; - builder.AppendTypesConstantsGlobals(CommonTypes) - .AppendTypesConstantsGlobals(tc.used_consts) - .AppendInMain(tc.main_insts); - const std::string expected = builder.GetCode(); - builder.AppendTypesConstantsGlobals(tc.dead_consts); - const std::string assembly_with_dead_const = builder.GetCode(); - SinglePassRunAndCheck( - assembly_with_dead_const, expected, /* skip_nop = */ true); -} - -INSTANTIATE_TEST_CASE_P( - ScalarTypeConstants, EliminateDeadConstantTest, - ::testing::ValuesIn(std::vector({ - // clang-format off - // Scalar type constants, one dead constant and one used constant. - { - /* .used_consts = */ - { - "%used_const_int = OpConstant %int 1", - }, - /* .main_insts = */ - { - "%int_var = OpVariable %_pf_int Function", - "OpStore %int_var %used_const_int", - }, - /* .dead_consts = */ - { - "%dead_const_int = OpConstant %int 1", - }, - }, - { - /* .used_consts = */ - { - "%used_const_uint = OpConstant %uint 1", - }, - /* .main_insts = */ - { - "%uint_var = OpVariable %_pf_uint Function", - "OpStore %uint_var %used_const_uint", - }, - /* .dead_consts = */ - { - "%dead_const_uint = OpConstant %uint 1", - }, - }, - { - /* .used_consts = */ - { - "%used_const_float = OpConstant %float 3.14", - }, - /* .main_insts = */ - { - "%float_var = OpVariable %_pf_float Function", - "OpStore %float_var %used_const_float", - }, - /* .dead_consts = */ - { - "%dead_const_float = OpConstant %float 3.14", - }, - }, - { - /* .used_consts = */ - { - "%used_const_double = OpConstant %double 3.14", - }, - /* .main_insts = */ - { - "%double_var = OpVariable %_pf_double Function", - "OpStore %double_var %used_const_double", - }, - /* .dead_consts = */ - { - "%dead_const_double = OpConstant %double 3.14", - }, - }, - // clang-format on - }))); - -INSTANTIATE_TEST_CASE_P( - VectorTypeConstants, EliminateDeadConstantTest, - ::testing::ValuesIn(std::vector({ - // clang-format off - // Tests eliminating dead constant type ivec2. One dead constant vector - // and one used constant vector, each built from its own group of - // scalar constants. - { - /* .used_consts = */ - { - "%used_int_x = OpConstant %int 1", - "%used_int_y = OpConstant %int 2", - "%used_v2int = OpConstantComposite %v2int %used_int_x %used_int_y", - }, - /* .main_insts = */ - { - "%v2int_var = OpVariable %_pf_v2int Function", - "OpStore %v2int_var %used_v2int", - }, - /* .dead_consts = */ - { - "%dead_int_x = OpConstant %int 1", - "%dead_int_y = OpConstant %int 2", - "%dead_v2int = OpConstantComposite %v2int %dead_int_x %dead_int_y", - }, - }, - // Tests eliminating dead constant ivec2. One dead constant vector and - // one used constant vector. But both built from a same group of - // scalar constants. - { - /* .used_consts = */ - { - "%used_int_x = OpConstant %int 1", - "%used_int_y = OpConstant %int 2", - "%used_int_z = OpConstant %int 3", - "%used_v3int = OpConstantComposite %v3int %used_int_x %used_int_y %used_int_z", - }, - /* .main_insts = */ - { - "%v3int_var = OpVariable %_pf_v3int Function", - "OpStore %v3int_var %used_v3int", - }, - /* .dead_consts = */ - { - "%dead_v3int = OpConstantComposite %v3int %used_int_x %used_int_y %used_int_z", - }, - }, - // Tests eliminating dead cosntant vec2. One dead constant vector and - // one used constant vector. Each built from its own group of scalar - // constants. - { - /* .used_consts = */ - { - "%used_float_x = OpConstant %float 3.14", - "%used_float_y = OpConstant %float 4.13", - "%used_v2float = OpConstantComposite %v2float %used_float_x %used_float_y", - }, - /* .main_insts = */ - { - "%v2float_var = OpVariable %_pf_v2float Function", - "OpStore %v2float_var %used_v2float", - }, - /* .dead_consts = */ - { - "%dead_float_x = OpConstant %float 3.14", - "%dead_float_y = OpConstant %float 4.13", - "%dead_v2float = OpConstantComposite %v2float %dead_float_x %dead_float_y", - }, - }, - // Tests eliminating dead cosntant vec2. One dead constant vector and - // one used constant vector. Both built from a same group of scalar - // constants. - { - /* .used_consts = */ - { - "%used_float_x = OpConstant %float 3.14", - "%used_float_y = OpConstant %float 4.13", - "%used_float_z = OpConstant %float 4.31", - "%used_v3float = OpConstantComposite %v3float %used_float_x %used_float_y %used_float_z", - }, - /* .main_insts = */ - { - "%v3float_var = OpVariable %_pf_v3float Function", - "OpStore %v3float_var %used_v3float", - }, - /* .dead_consts = */ - { - "%dead_v3float = OpConstantComposite %v3float %used_float_x %used_float_y %used_float_z", - }, - }, - // clang-format on - }))); - -INSTANTIATE_TEST_CASE_P( - StructTypeConstants, EliminateDeadConstantTest, - ::testing::ValuesIn(std::vector({ - // clang-format off - // A plain struct type dead constants. All of its components are dead - // constants too. - { - /* .used_consts = */ {}, - /* .main_insts = */ {}, - /* .dead_consts = */ - { - "%dead_bool = OpConstantTrue %bool", - "%dead_int = OpConstant %int 1", - "%dead_float = OpConstant %float 2.5", - "%dead_double = OpConstant %double 3.14159265358979", - "%dead_struct = OpConstantComposite %flat_struct %dead_bool %dead_int %dead_float %dead_double", - }, - }, - // A plain struct type dead constants. Some of its components are dead - // constants while others are not. - { - /* .used_consts = */ - { - "%used_int = OpConstant %int 1", - "%used_double = OpConstant %double 3.14159265358979", - }, - /* .main_insts = */ - { - "%int_var = OpVariable %_pf_int Function", - "OpStore %int_var %used_int", - "%double_var = OpVariable %_pf_double Function", - "OpStore %double_var %used_double", - }, - /* .dead_consts = */ - { - "%dead_bool = OpConstantTrue %bool", - "%dead_float = OpConstant %float 2.5", - "%dead_struct = OpConstantComposite %flat_struct %dead_bool %used_int %dead_float %used_double", - }, - }, - // A nesting struct type dead constants. All components of both outer - // and inner structs are dead and should be removed after dead constant - // elimination. - { - /* .used_consts = */ {}, - /* .main_insts = */ {}, - /* .dead_consts = */ - { - "%dead_bool = OpConstantTrue %bool", - "%dead_int = OpConstant %int 1", - "%dead_float = OpConstant %float 2.5", - "%dead_double = OpConstant %double 3.1415926535", - "%dead_inner_struct = OpConstantComposite %inner_struct %dead_bool %dead_int %dead_float %dead_double", - "%dead_int2 = OpConstant %int 2", - "%dead_double2 = OpConstant %double 1.428571428514", - "%dead_outer_struct = OpConstantComposite %outer_struct %dead_inner_struct %dead_int2 %dead_double2", - }, - }, - // A nesting struct type dead constants. Some of its components are - // dead constants while others are not. - { - /* .used_consts = */ - { - "%used_int = OpConstant %int 1", - "%used_double = OpConstant %double 3.14159265358979", - }, - /* .main_insts = */ - { - "%int_var = OpVariable %_pf_int Function", - "OpStore %int_var %used_int", - "%double_var = OpVariable %_pf_double Function", - "OpStore %double_var %used_double", - }, - /* .dead_consts = */ - { - "%dead_bool = OpConstantTrue %bool", - "%dead_float = OpConstant %float 2.5", - "%dead_inner_struct = OpConstantComposite %inner_struct %dead_bool %used_int %dead_float %used_double", - "%dead_int = OpConstant %int 2", - "%dead_outer_struct = OpConstantComposite %outer_struct %dead_inner_struct %dead_int %used_double", - }, - }, - // A nesting struct case. The inner struct is used while the outer struct is not - { - /* .used_const = */ - { - "%used_bool = OpConstantTrue %bool", - "%used_int = OpConstant %int 1", - "%used_float = OpConstant %float 1.23", - "%used_double = OpConstant %double 1.2345678901234", - "%used_inner_struct = OpConstantComposite %inner_struct %used_bool %used_int %used_float %used_double", - }, - /* .main_insts = */ - { - "%bool_var = OpVariable %_pf_bool Function", - "%bool_from_inner_struct = OpCompositeExtract %bool %used_inner_struct 0", - "OpStore %bool_var %bool_from_inner_struct", - }, - /* .dead_consts = */ - { - "%dead_int = OpConstant %int 2", - "%dead_outer_struct = OpConstantComposite %outer_struct %used_inner_struct %dead_int %used_double" - }, - }, - // A nesting struct case. The outer struct is used, so the inner struct should not - // be removed even though it is not used anywhere. - { - /* .used_const = */ - { - "%used_bool = OpConstantTrue %bool", - "%used_int = OpConstant %int 1", - "%used_float = OpConstant %float 1.23", - "%used_double = OpConstant %double 1.2345678901234", - "%used_inner_struct = OpConstantComposite %inner_struct %used_bool %used_int %used_float %used_double", - "%used_outer_struct = OpConstantComposite %outer_struct %used_inner_struct %used_int %used_double" - }, - /* .main_insts = */ - { - "%int_var = OpVariable %_pf_int Function", - "%int_from_outer_struct = OpCompositeExtract %int %used_outer_struct 1", - "OpStore %int_var %int_from_outer_struct", - }, - /* .dead_consts = */ {}, - }, - // clang-format on - }))); - -INSTANTIATE_TEST_CASE_P( - ScalarTypeSpecConstants, EliminateDeadConstantTest, - ::testing::ValuesIn(std::vector({ - // clang-format off - // All scalar type spec constants. - { - /* .used_consts = */ - { - "%used_bool = OpSpecConstantTrue %bool", - "%used_uint = OpSpecConstant %uint 2", - "%used_int = OpSpecConstant %int 2", - "%used_float = OpSpecConstant %float 2.5", - "%used_double = OpSpecConstant %double 1.428571428514", - }, - /* .main_insts = */ - { - "%bool_var = OpVariable %_pf_bool Function", - "%uint_var = OpVariable %_pf_uint Function", - "%int_var = OpVariable %_pf_int Function", - "%float_var = OpVariable %_pf_float Function", - "%double_var = OpVariable %_pf_double Function", - "OpStore %bool_var %used_bool", "OpStore %uint_var %used_uint", - "OpStore %int_var %used_int", "OpStore %float_var %used_float", - "OpStore %double_var %used_double", - }, - /* .dead_consts = */ - { - "%dead_bool = OpSpecConstantTrue %bool", - "%dead_uint = OpSpecConstant %uint 2", - "%dead_int = OpSpecConstant %int 2", - "%dead_float = OpSpecConstant %float 2.5", - "%dead_double = OpSpecConstant %double 1.428571428514", - }, - }, - // clang-format on - }))); - -INSTANTIATE_TEST_CASE_P( - VectorTypeSpecConstants, EliminateDeadConstantTest, - ::testing::ValuesIn(std::vector({ - // clang-format off - // Bool vector type spec constants. One vector has all component dead, - // another vector has one dead boolean and one used boolean. - { - /* .used_consts = */ - { - "%used_bool = OpSpecConstantTrue %bool", - }, - /* .main_insts = */ - { - "%bool_var = OpVariable %_pf_bool Function", - "OpStore %bool_var %used_bool", - }, - /* .dead_consts = */ - { - "%dead_bool = OpSpecConstantFalse %bool", - "%dead_bool_vec1 = OpSpecConstantComposite %v2bool %dead_bool %dead_bool", - "%dead_bool_vec2 = OpSpecConstantComposite %v2bool %dead_bool %used_bool", - }, - }, - - // Uint vector type spec constants. One vector has all component dead, - // another vector has one dead unsigend integer and one used unsigned - // integer. - { - /* .used_consts = */ - { - "%used_uint = OpSpecConstant %uint 3", - }, - /* .main_insts = */ - { - "%uint_var = OpVariable %_pf_uint Function", - "OpStore %uint_var %used_uint", - }, - /* .dead_consts = */ - { - "%dead_uint = OpSpecConstant %uint 1", - "%dead_uint_vec1 = OpSpecConstantComposite %v2uint %dead_uint %dead_uint", - "%dead_uint_vec2 = OpSpecConstantComposite %v2uint %dead_uint %used_uint", - }, - }, - - // Int vector type spec constants. One vector has all component dead, - // another vector has one dead integer and one used integer. - { - /* .used_consts = */ - { - "%used_int = OpSpecConstant %int 3", - }, - /* .main_insts = */ - { - "%int_var = OpVariable %_pf_int Function", - "OpStore %int_var %used_int", - }, - /* .dead_consts = */ - { - "%dead_int = OpSpecConstant %int 1", - "%dead_int_vec1 = OpSpecConstantComposite %v2int %dead_int %dead_int", - "%dead_int_vec2 = OpSpecConstantComposite %v2int %dead_int %used_int", - }, - }, - - // Int vector type spec constants built with both spec constants and - // front-end constants. - { - /* .used_consts = */ - { - "%used_spec_int = OpSpecConstant %int 3", - "%used_front_end_int = OpConstant %int 3", - }, - /* .main_insts = */ - { - "%int_var1 = OpVariable %_pf_int Function", - "OpStore %int_var1 %used_spec_int", - "%int_var2 = OpVariable %_pf_int Function", - "OpStore %int_var2 %used_front_end_int", - }, - /* .dead_consts = */ - { - "%dead_spec_int = OpSpecConstant %int 1", - "%dead_front_end_int = OpConstant %int 1", - // Dead front-end and dead spec constants - "%dead_int_vec1 = OpSpecConstantComposite %v2int %dead_spec_int %dead_front_end_int", - // Used front-end and dead spec constants - "%dead_int_vec2 = OpSpecConstantComposite %v2int %dead_spec_int %used_front_end_int", - // Dead front-end and used spec constants - "%dead_int_vec3 = OpSpecConstantComposite %v2int %dead_front_end_int %used_spec_int", - }, - }, - // clang-format on - }))); - -INSTANTIATE_TEST_CASE_P( - SpecConstantOp, EliminateDeadConstantTest, - ::testing::ValuesIn(std::vector({ - // clang-format off - // Cast operations: uint <-> int <-> bool - { - /* .used_consts = */ {}, - /* .main_insts = */ {}, - /* .dead_consts = */ - { - // Assistant constants, only used in dead spec constant - // operations. - "%signed_zero = OpConstant %int 0", - "%signed_zero_vec = OpConstantComposite %v2int %signed_zero %signed_zero", - "%unsigned_zero = OpConstant %uint 0", - "%unsigned_zero_vec = OpConstantComposite %v2uint %unsigned_zero %unsigned_zero", - "%signed_one = OpConstant %int 1", - "%signed_one_vec = OpConstantComposite %v2int %signed_one %signed_one", - "%unsigned_one = OpConstant %uint 1", - "%unsigned_one_vec = OpConstantComposite %v2uint %unsigned_one %unsigned_one", - - // Spec constants that support casting to each other. - "%dead_bool = OpSpecConstantTrue %bool", - "%dead_uint = OpSpecConstant %uint 1", - "%dead_int = OpSpecConstant %int 2", - "%dead_bool_vec = OpSpecConstantComposite %v2bool %dead_bool %dead_bool", - "%dead_uint_vec = OpSpecConstantComposite %v2uint %dead_uint %dead_uint", - "%dead_int_vec = OpSpecConstantComposite %v2int %dead_int %dead_int", - - // Scalar cast to boolean spec constant. - "%int_to_bool = OpSpecConstantOp %bool INotEqual %dead_int %signed_zero", - "%uint_to_bool = OpSpecConstantOp %bool INotEqual %dead_uint %unsigned_zero", - - // Vector cast to boolean spec constant. - "%int_to_bool_vec = OpSpecConstantOp %v2bool INotEqual %dead_int_vec %signed_zero_vec", - "%uint_to_bool_vec = OpSpecConstantOp %v2bool INotEqual %dead_uint_vec %unsigned_zero_vec", - - // Scalar cast to int spec constant. - "%bool_to_int = OpSpecConstantOp %int Select %dead_bool %signed_one %signed_zero", - "%uint_to_int = OpSpecConstantOp %uint IAdd %dead_uint %unsigned_zero", - - // Vector cast to int spec constant. - "%bool_to_int_vec = OpSpecConstantOp %v2int Select %dead_bool_vec %signed_one_vec %signed_zero_vec", - "%uint_to_int_vec = OpSpecConstantOp %v2uint IAdd %dead_uint_vec %unsigned_zero_vec", - - // Scalar cast to uint spec constant. - "%bool_to_uint = OpSpecConstantOp %uint Select %dead_bool %unsigned_one %unsigned_zero", - "%int_to_uint_vec = OpSpecConstantOp %uint IAdd %dead_int %signed_zero", - - // Vector cast to uint spec constant. - "%bool_to_uint_vec = OpSpecConstantOp %v2uint Select %dead_bool_vec %unsigned_one_vec %unsigned_zero_vec", - "%int_to_uint = OpSpecConstantOp %v2uint IAdd %dead_int_vec %signed_zero_vec", - }, - }, - - // Add, sub, mul, div, rem. - { - /* .used_consts = */ {}, - /* .main_insts = */ {}, - /* .dead_consts = */ - { - "%dead_spec_int_a = OpSpecConstant %int 1", - "%dead_spec_int_a_vec = OpSpecConstantComposite %v2int %dead_spec_int_a %dead_spec_int_a", - - "%dead_spec_int_b = OpSpecConstant %int 2", - "%dead_spec_int_b_vec = OpSpecConstantComposite %v2int %dead_spec_int_b %dead_spec_int_b", - - "%dead_const_int_c = OpConstant %int 3", - "%dead_const_int_c_vec = OpConstantComposite %v2int %dead_const_int_c %dead_const_int_c", - - // Add - "%add_a_b = OpSpecConstantOp %int IAdd %dead_spec_int_a %dead_spec_int_b", - "%add_a_b_vec = OpSpecConstantOp %v2int IAdd %dead_spec_int_a_vec %dead_spec_int_b_vec", - - // Sub - "%sub_a_b = OpSpecConstantOp %int ISub %dead_spec_int_a %dead_spec_int_b", - "%sub_a_b_vec = OpSpecConstantOp %v2int ISub %dead_spec_int_a_vec %dead_spec_int_b_vec", - - // Mul - "%mul_a_b = OpSpecConstantOp %int IMul %dead_spec_int_a %dead_spec_int_b", - "%mul_a_b_vec = OpSpecConstantOp %v2int IMul %dead_spec_int_a_vec %dead_spec_int_b_vec", - - // Div - "%div_a_b = OpSpecConstantOp %int SDiv %dead_spec_int_a %dead_spec_int_b", - "%div_a_b_vec = OpSpecConstantOp %v2int SDiv %dead_spec_int_a_vec %dead_spec_int_b_vec", - - // Bitwise Xor - "%xor_a_b = OpSpecConstantOp %int BitwiseXor %dead_spec_int_a %dead_spec_int_b", - "%xor_a_b_vec = OpSpecConstantOp %v2int BitwiseXor %dead_spec_int_a_vec %dead_spec_int_b_vec", - - // Scalar Comparison - "%less_a_b = OpSpecConstantOp %bool SLessThan %dead_spec_int_a %dead_spec_int_b", - }, - }, - - // Vectors without used swizzles should be removed. - { - /* .used_consts = */ - { - "%used_int = OpConstant %int 3", - }, - /* .main_insts = */ - { - "%int_var = OpVariable %_pf_int Function", - "OpStore %int_var %used_int", - }, - /* .dead_consts = */ - { - "%dead_int = OpConstant %int 3", - - "%dead_spec_int_a = OpSpecConstant %int 1", - "%vec_a = OpSpecConstantComposite %v4int %dead_spec_int_a %dead_spec_int_a %dead_int %dead_int", - - "%dead_spec_int_b = OpSpecConstant %int 2", - "%vec_b = OpSpecConstantComposite %v4int %dead_spec_int_b %dead_spec_int_b %used_int %used_int", - - // Extract scalar - "%a_x = OpSpecConstantOp %int CompositeExtract %vec_a 0", - "%b_x = OpSpecConstantOp %int CompositeExtract %vec_b 0", - - // Extract vector - "%a_xy = OpSpecConstantOp %v2int VectorShuffle %vec_a %vec_a 0 1", - "%b_xy = OpSpecConstantOp %v2int VectorShuffle %vec_b %vec_b 0 1", - }, - }, - // Vectors with used swizzles should not be removed. - { - /* .used_consts = */ - { - "%used_int = OpConstant %int 3", - "%used_spec_int_a = OpSpecConstant %int 1", - "%used_spec_int_b = OpSpecConstant %int 2", - // Create vectors - "%vec_a = OpSpecConstantComposite %v4int %used_spec_int_a %used_spec_int_a %used_int %used_int", - "%vec_b = OpSpecConstantComposite %v4int %used_spec_int_b %used_spec_int_b %used_int %used_int", - // Extract vector - "%a_xy = OpSpecConstantOp %v2int VectorShuffle %vec_a %vec_a 0 1", - "%b_xy = OpSpecConstantOp %v2int VectorShuffle %vec_b %vec_b 0 1", - }, - /* .main_insts = */ - { - "%v2int_var_a = OpVariable %_pf_v2int Function", - "%v2int_var_b = OpVariable %_pf_v2int Function", - "OpStore %v2int_var_a %a_xy", - "OpStore %v2int_var_b %b_xy", - }, - /* .dead_consts = */ {}, - }, - // clang-format on - }))); - -INSTANTIATE_TEST_CASE_P( - LongDefUseChain, EliminateDeadConstantTest, - ::testing::ValuesIn(std::vector({ - // clang-format off - // Long Def-Use chain with binary operations. - { - /* .used_consts = */ - { - "%array_size = OpConstant %int 4", - "%type_arr_int_4 = OpTypeArray %int %array_size", - "%used_int_0 = OpConstant %int 100", - "%used_int_1 = OpConstant %int 1", - "%used_int_2 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_1", - "%used_int_3 = OpSpecConstantOp %int ISub %used_int_0 %used_int_2", - "%used_int_4 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_3", - "%used_int_5 = OpSpecConstantOp %int ISub %used_int_0 %used_int_4", - "%used_int_6 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_5", - "%used_int_7 = OpSpecConstantOp %int ISub %used_int_0 %used_int_6", - "%used_int_8 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_7", - "%used_int_9 = OpSpecConstantOp %int ISub %used_int_0 %used_int_8", - "%used_int_10 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_9", - "%used_int_11 = OpSpecConstantOp %int ISub %used_int_0 %used_int_10", - "%used_int_12 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_11", - "%used_int_13 = OpSpecConstantOp %int ISub %used_int_0 %used_int_12", - "%used_int_14 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_13", - "%used_int_15 = OpSpecConstantOp %int ISub %used_int_0 %used_int_14", - "%used_int_16 = OpSpecConstantOp %int ISub %used_int_0 %used_int_15", - "%used_int_17 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_16", - "%used_int_18 = OpSpecConstantOp %int ISub %used_int_0 %used_int_17", - "%used_int_19 = OpSpecConstantOp %int IAdd %used_int_0 %used_int_18", - "%used_int_20 = OpSpecConstantOp %int ISub %used_int_0 %used_int_19", - "%used_vec_a = OpSpecConstantComposite %v2int %used_int_18 %used_int_19", - "%used_vec_b = OpSpecConstantOp %v2int IMul %used_vec_a %used_vec_a", - "%used_int_21 = OpSpecConstantOp %int CompositeExtract %used_vec_b 0", - "%used_array = OpConstantComposite %type_arr_int_4 %used_int_20 %used_int_20 %used_int_21 %used_int_21", - }, - /* .main_insts = */ - { - "%int_var = OpVariable %_pf_int Function", - "%used_array_2 = OpCompositeExtract %int %used_array 2", - "OpStore %int_var %used_array_2", - }, - /* .dead_consts = */ - { - "%dead_int_1 = OpConstant %int 2", - "%dead_int_2 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_1", - "%dead_int_3 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_2", - "%dead_int_4 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_3", - "%dead_int_5 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_4", - "%dead_int_6 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_5", - "%dead_int_7 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_6", - "%dead_int_8 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_7", - "%dead_int_9 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_8", - "%dead_int_10 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_9", - "%dead_int_11 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_10", - "%dead_int_12 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_11", - "%dead_int_13 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_12", - "%dead_int_14 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_13", - "%dead_int_15 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_14", - "%dead_int_16 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_15", - "%dead_int_17 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_16", - "%dead_int_18 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_17", - "%dead_int_19 = OpSpecConstantOp %int IAdd %used_int_0 %dead_int_18", - "%dead_int_20 = OpSpecConstantOp %int ISub %used_int_0 %dead_int_19", - "%dead_vec_a = OpSpecConstantComposite %v2int %dead_int_18 %dead_int_19", - "%dead_vec_b = OpSpecConstantOp %v2int IMul %dead_vec_a %dead_vec_a", - "%dead_int_21 = OpSpecConstantOp %int CompositeExtract %dead_vec_b 0", - "%dead_array = OpConstantComposite %type_arr_int_4 %dead_int_20 %used_int_20 %dead_int_19 %used_int_19", - }, - }, - // Long Def-Use chain with swizzle - // clang-format on - }))); -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/eliminate_dead_functions_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/eliminate_dead_functions_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/eliminate_dead_functions_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/eliminate_dead_functions_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,206 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include - -#include - -#include "assembly_builder.h" -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; -using ::testing::HasSubstr; - -using EliminateDeadFunctionsBasicTest = PassTest<::testing::Test>; - -TEST_F(EliminateDeadFunctionsBasicTest, BasicDeleteDeadFunction) { - // The function Dead should be removed because it is never called. - const std::vector common_code = { - // clang-format off - "OpCapability Shader", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Fragment %main \"main\"", - "OpName %main \"main\"", - "OpName %Live \"Live\"", - "%void = OpTypeVoid", - "%7 = OpTypeFunction %void", - "%main = OpFunction %void None %7", - "%15 = OpLabel", - "%16 = OpFunctionCall %void %Live", - "%17 = OpFunctionCall %void %Live", - "OpReturn", - "OpFunctionEnd", - "%Live = OpFunction %void None %7", - "%20 = OpLabel", - "OpReturn", - "OpFunctionEnd" - // clang-format on - }; - - const std::vector dead_function = { - // clang-format off - "%Dead = OpFunction %void None %7", - "%19 = OpLabel", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - SinglePassRunAndCheck( - JoinAllInsts(Concat(common_code, dead_function)), - JoinAllInsts(common_code), /* skip_nop = */ true); -} - -TEST_F(EliminateDeadFunctionsBasicTest, BasicKeepLiveFunction) { - // Everything is reachable from an entry point, so no functions should be - // deleted. - const std::vector text = { - // clang-format off - "OpCapability Shader", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Fragment %main \"main\"", - "OpName %main \"main\"", - "OpName %Live1 \"Live1\"", - "OpName %Live2 \"Live2\"", - "%void = OpTypeVoid", - "%7 = OpTypeFunction %void", - "%main = OpFunction %void None %7", - "%15 = OpLabel", - "%16 = OpFunctionCall %void %Live2", - "%17 = OpFunctionCall %void %Live1", - "OpReturn", - "OpFunctionEnd", - "%Live1 = OpFunction %void None %7", - "%19 = OpLabel", - "OpReturn", - "OpFunctionEnd", - "%Live2 = OpFunction %void None %7", - "%20 = OpLabel", - "OpReturn", - "OpFunctionEnd" - // clang-format on - }; - - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - std::string assembly = JoinAllInsts(text); - auto result = SinglePassRunAndDisassemble( - assembly, /* skip_nop = */ true); - EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); - EXPECT_EQ(assembly, std::get<0>(result)); -} - -TEST_F(EliminateDeadFunctionsBasicTest, BasicKeepExportFunctions) { - // All functions are reachable. In particular, ExportedFunc and Constant are - // reachable because ExportedFunc is exported. Nothing should be removed. - const std::vector text = { - // clang-format off - "OpCapability Shader", - "OpCapability Linkage", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Fragment %main \"main\"", - "OpName %main \"main\"", - "OpName %ExportedFunc \"ExportedFunc\"", - "OpName %Live \"Live\"", - "OpDecorate %ExportedFunc LinkageAttributes \"ExportedFunc\" Export", - "%void = OpTypeVoid", - "%7 = OpTypeFunction %void", - "%main = OpFunction %void None %7", - "%15 = OpLabel", - "OpReturn", - "OpFunctionEnd", -"%ExportedFunc = OpFunction %void None %7", - "%19 = OpLabel", - "%16 = OpFunctionCall %void %Live", - "OpReturn", - "OpFunctionEnd", - "%Live = OpFunction %void None %7", - "%20 = OpLabel", - "OpReturn", - "OpFunctionEnd" - // clang-format on - }; - - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - std::string assembly = JoinAllInsts(text); - auto result = SinglePassRunAndDisassemble( - assembly, /* skip_nop = */ true); - EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); - EXPECT_EQ(assembly, std::get<0>(result)); -} - -TEST_F(EliminateDeadFunctionsBasicTest, BasicRemoveDecorationsAndNames) { - // We want to remove the names and decorations associated with results that - // are removed. This test will check for that. - const std::string text = R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %main "main" - OpName %main "main" - OpName %Dead "Dead" - OpName %x "x" - OpName %y "y" - OpName %z "z" - OpDecorate %x RelaxedPrecision - OpDecorate %y RelaxedPrecision - OpDecorate %z RelaxedPrecision - OpDecorate %6 RelaxedPrecision - OpDecorate %7 RelaxedPrecision - OpDecorate %8 RelaxedPrecision - %void = OpTypeVoid - %10 = OpTypeFunction %void - %float = OpTypeFloat 32 -%_ptr_Function_float = OpTypePointer Function %float - %float_1 = OpConstant %float 1 - %main = OpFunction %void None %10 - %14 = OpLabel - OpReturn - OpFunctionEnd - %Dead = OpFunction %void None %10 - %15 = OpLabel - %x = OpVariable %_ptr_Function_float Function - %y = OpVariable %_ptr_Function_float Function - %z = OpVariable %_ptr_Function_float Function - OpStore %x %float_1 - OpStore %y %float_1 - %6 = OpLoad %float %x - %7 = OpLoad %float %y - %8 = OpFAdd %float %6 %7 - OpStore %z %8 - OpReturn - OpFunctionEnd)"; - - const std::string expected_output = R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %main "main" -OpName %main "main" -%void = OpTypeVoid -%10 = OpTypeFunction %void -%float = OpTypeFloat 32 -%_ptr_Function_float = OpTypePointer Function %float -%float_1 = OpConstant %float 1 -%main = OpFunction %void None %10 -%14 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - SinglePassRunAndCheck(text, expected_output, - /* skip_nop = */ true); -} -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/flatten_decoration_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/flatten_decoration_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/flatten_decoration_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/flatten_decoration_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,234 +0,0 @@ -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; - -// Returns the initial part of the assembly text for a valid -// SPIR-V module, including instructions prior to decorations. -std::string PreambleAssembly() { - return - R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %hue %saturation %value -OpName %main "main" -OpName %void_fn "void_fn" -OpName %hue "hue" -OpName %saturation "saturation" -OpName %value "value" -OpName %entry "entry" -OpName %Point "Point" -OpName %Camera "Camera" -)"; -} - -// Retuns types -std::string TypesAndFunctionsAssembly() { - return - R"(%void = OpTypeVoid -%void_fn = OpTypeFunction %void -%float = OpTypeFloat 32 -%Point = OpTypeStruct %float %float %float -%Camera = OpTypeStruct %float %float -%_ptr_Input_float = OpTypePointer Input %float -%hue = OpVariable %_ptr_Input_float Input -%saturation = OpVariable %_ptr_Input_float Input -%value = OpVariable %_ptr_Input_float Input -%main = OpFunction %void None %void_fn -%entry = OpLabel -OpReturn -OpFunctionEnd -)"; -} - -struct FlattenDecorationCase { - // Names and decorations before the pass. - std::string input; - // Names and decorations after the pass. - std::string expected; -}; - -using FlattenDecorationTest = - PassTest<::testing::TestWithParam>; - -TEST_P(FlattenDecorationTest, TransformsDecorations) { - const auto before = - PreambleAssembly() + GetParam().input + TypesAndFunctionsAssembly(); - const auto after = - PreambleAssembly() + GetParam().expected + TypesAndFunctionsAssembly(); - - SinglePassRunAndCheck(before, after, false, true); -} - -INSTANTIATE_TEST_CASE_P(NoUses, FlattenDecorationTest, - ::testing::ValuesIn(std::vector{ - // No OpDecorationGroup - {"", ""}, - - // OpDecorationGroup without any uses, and - // no OpName. - {"%group = OpDecorationGroup\n", ""}, - - // OpDecorationGroup without any uses, and - // with OpName targeting it. Proves you must - // remove the names as well. - {"OpName %group \"group\"\n" - "%group = OpDecorationGroup\n", - ""}, - - // OpDecorationGroup with decorations that - // target it, but no uses in OpGroupDecorate - // or OpGroupMemberDecorate instructions. - {"OpDecorate %group Flat\n" - "OpDecorate %group NoPerspective\n" - "%group = OpDecorationGroup\n", - ""}, - }), ); - -INSTANTIATE_TEST_CASE_P(OpGroupDecorate, FlattenDecorationTest, - ::testing::ValuesIn(std::vector{ - // One OpGroupDecorate - {"OpName %group \"group\"\n" - "OpDecorate %group Flat\n" - "OpDecorate %group NoPerspective\n" - "%group = OpDecorationGroup\n" - "OpGroupDecorate %group %hue %saturation\n", - "OpDecorate %hue Flat\n" - "OpDecorate %saturation Flat\n" - "OpDecorate %hue NoPerspective\n" - "OpDecorate %saturation NoPerspective\n"}, - // Multiple OpGroupDecorate - {"OpName %group \"group\"\n" - "OpDecorate %group Flat\n" - "OpDecorate %group NoPerspective\n" - "%group = OpDecorationGroup\n" - "OpGroupDecorate %group %hue %value\n" - "OpGroupDecorate %group %saturation\n", - "OpDecorate %hue Flat\n" - "OpDecorate %value Flat\n" - "OpDecorate %saturation Flat\n" - "OpDecorate %hue NoPerspective\n" - "OpDecorate %value NoPerspective\n" - "OpDecorate %saturation NoPerspective\n"}, - // Two group decorations, interleaved - {"OpName %group0 \"group0\"\n" - "OpName %group1 \"group1\"\n" - "OpDecorate %group0 Flat\n" - "OpDecorate %group1 NoPerspective\n" - "%group0 = OpDecorationGroup\n" - "%group1 = OpDecorationGroup\n" - "OpGroupDecorate %group0 %hue %value\n" - "OpGroupDecorate %group1 %saturation\n", - "OpDecorate %hue Flat\n" - "OpDecorate %value Flat\n" - "OpDecorate %saturation NoPerspective\n"}, - // Decoration with operands - {"OpName %group \"group\"\n" - "OpDecorate %group Location 42\n" - "%group = OpDecorationGroup\n" - "OpGroupDecorate %group %hue %saturation\n", - "OpDecorate %hue Location 42\n" - "OpDecorate %saturation Location 42\n"}, - }), ); - -INSTANTIATE_TEST_CASE_P(OpGroupMemberDecorate, FlattenDecorationTest, - ::testing::ValuesIn(std::vector{ - // One OpGroupMemberDecorate - {"OpName %group \"group\"\n" - "OpDecorate %group Flat\n" - "OpDecorate %group Offset 16\n" - "%group = OpDecorationGroup\n" - "OpGroupMemberDecorate %group %Point 1\n", - "OpMemberDecorate %Point 1 Flat\n" - "OpMemberDecorate %Point 1 Offset 16\n"}, - // Multiple OpGroupMemberDecorate using the same - // decoration group. - {"OpName %group \"group\"\n" - "OpDecorate %group Flat\n" - "OpDecorate %group NoPerspective\n" - "OpDecorate %group Offset 8\n" - "%group = OpDecorationGroup\n" - "OpGroupMemberDecorate %group %Point 2\n" - "OpGroupMemberDecorate %group %Camera 1\n", - "OpMemberDecorate %Point 2 Flat\n" - "OpMemberDecorate %Camera 1 Flat\n" - "OpMemberDecorate %Point 2 NoPerspective\n" - "OpMemberDecorate %Camera 1 NoPerspective\n" - "OpMemberDecorate %Point 2 Offset 8\n" - "OpMemberDecorate %Camera 1 Offset 8\n"}, - // Two groups of member decorations, interleaved. - // Decoration is with and without operands. - {"OpName %group0 \"group0\"\n" - "OpName %group1 \"group1\"\n" - "OpDecorate %group0 Flat\n" - "OpDecorate %group0 Offset 8\n" - "OpDecorate %group1 NoPerspective\n" - "OpDecorate %group1 Offset 16\n" - "%group0 = OpDecorationGroup\n" - "%group1 = OpDecorationGroup\n" - "OpGroupMemberDecorate %group0 %Point 0\n" - "OpGroupMemberDecorate %group1 %Point 2\n", - "OpMemberDecorate %Point 0 Flat\n" - "OpMemberDecorate %Point 0 Offset 8\n" - "OpMemberDecorate %Point 2 NoPerspective\n" - "OpMemberDecorate %Point 2 Offset 16\n"}, - }), ); - -INSTANTIATE_TEST_CASE_P(UnrelatedDecorations, FlattenDecorationTest, - ::testing::ValuesIn(std::vector{ - // A non-group non-member decoration is untouched. - {"OpDecorate %hue Centroid\n" - "OpDecorate %saturation Flat\n", - "OpDecorate %hue Centroid\n" - "OpDecorate %saturation Flat\n"}, - // A non-group member decoration is untouched. - {"OpMemberDecorate %Point 0 Offset 0\n" - "OpMemberDecorate %Point 1 Offset 4\n" - "OpMemberDecorate %Point 1 Flat\n", - "OpMemberDecorate %Point 0 Offset 0\n" - "OpMemberDecorate %Point 1 Offset 4\n" - "OpMemberDecorate %Point 1 Flat\n"}, - // A non-group non-member decoration survives any - // replacement of group decorations. - {"OpName %group \"group\"\n" - "OpDecorate %group Flat\n" - "OpDecorate %hue Centroid\n" - "OpDecorate %group NoPerspective\n" - "%group = OpDecorationGroup\n" - "OpGroupDecorate %group %hue %saturation\n", - "OpDecorate %hue Flat\n" - "OpDecorate %saturation Flat\n" - "OpDecorate %hue Centroid\n" - "OpDecorate %hue NoPerspective\n" - "OpDecorate %saturation NoPerspective\n"}, - // A non-group member decoration survives any - // replacement of group decorations. - {"OpDecorate %group Offset 0\n" - "OpDecorate %group Flat\n" - "OpMemberDecorate %Point 1 Offset 4\n" - "%group = OpDecorationGroup\n" - "OpGroupMemberDecorate %group %Point 0\n", - "OpMemberDecorate %Point 0 Offset 0\n" - "OpMemberDecorate %Point 0 Flat\n" - "OpMemberDecorate %Point 1 Offset 4\n"}, - }), ); - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/fold_spec_const_op_composite_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/fold_spec_const_op_composite_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/fold_spec_const_op_composite_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/fold_spec_const_op_composite_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1389 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "assembly_builder.h" - -#include - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { -using namespace spvtools; - -using FoldSpecConstantOpAndCompositePassBasicTest = PassTest<::testing::Test>; - -TEST_F(FoldSpecConstantOpAndCompositePassBasicTest, Empty) { - SinglePassRunAndCheck( - "", "", /* skip_nop = */ true); -} - -// A test of the basic functionality of FoldSpecConstantOpAndCompositePass. -// A spec constant defined with an integer addition operation should be folded -// to a normal constant with fixed value. -TEST_F(FoldSpecConstantOpAndCompositePassBasicTest, Basic) { - AssemblyBuilder builder; - builder.AppendTypesConstantsGlobals({ - // clang-format off - "%int = OpTypeInt 32 1", - "%frozen_spec_const_int = OpConstant %int 1", - "%const_int = OpConstant %int 2", - // Folding target: - "%spec_add = OpSpecConstantOp %int IAdd %frozen_spec_const_int %const_int", - // clang-format on - }); - - std::vector expected = { - // clang-format off - "OpCapability Shader", - "OpCapability Float64", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %main \"main\"", - "OpName %void \"void\"", - "OpName %main_func_type \"main_func_type\"", - "OpName %main \"main\"", - "OpName %main_func_entry_block \"main_func_entry_block\"", - "OpName %int \"int\"", - "OpName %frozen_spec_const_int \"frozen_spec_const_int\"", - "OpName %const_int \"const_int\"", - "OpName %spec_add \"spec_add\"", - "%void = OpTypeVoid", - "%main_func_type = OpTypeFunction %void", - "%int = OpTypeInt 32 1", -"%frozen_spec_const_int = OpConstant %int 1", - "%const_int = OpConstant %int 2", - // The SpecConstantOp IAdd instruction should be replace by OpConstant - // instruction: - "%spec_add = OpConstant %int 3", - "%main = OpFunction %void None %main_func_type", -"%main_func_entry_block = OpLabel", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - SinglePassRunAndCheck( - builder.GetCode(), JoinAllInsts(expected), /* skip_nop = */ true); -} - -// A test of skipping folding an instruction when the instruction result type -// has decorations. -TEST_F(FoldSpecConstantOpAndCompositePassBasicTest, - SkipWhenTypeHasDecorations) { - AssemblyBuilder builder; - builder - .AppendAnnotations({ - // clang-format off - "OpDecorate %int RelaxedPrecision", - // clang-format on - }) - .AppendTypesConstantsGlobals({ - // clang-format off - "%int = OpTypeInt 32 1", - "%frozen_spec_const_int = OpConstant %int 1", - "%const_int = OpConstant %int 2", - // The following spec constant should not be folded as the result type - // has relaxed precision decoration. - "%spec_add = OpSpecConstantOp %int IAdd %frozen_spec_const_int %const_int", - // clang-format on - }); - - SinglePassRunAndCheck( - builder.GetCode(), builder.GetCode(), /* skip_nop = */ true); -} - -// All types and some common constants that are potentially required in -// FoldSpecConstantOpAndCompositeTest. -std::vector CommonTypesAndConstants() { - return std::vector{ - // clang-format off - // scalar types - "%bool = OpTypeBool", - "%uint = OpTypeInt 32 0", - "%int = OpTypeInt 32 1", - "%float = OpTypeFloat 32", - "%double = OpTypeFloat 64", - // vector types - "%v2bool = OpTypeVector %bool 2", - "%v2uint = OpTypeVector %uint 2", - "%v2int = OpTypeVector %int 2", - "%v3int = OpTypeVector %int 3", - "%v4int = OpTypeVector %int 4", - "%v2float = OpTypeVector %float 2", - "%v2double = OpTypeVector %double 2", - // variable pointer types - "%_pf_bool = OpTypePointer Function %bool", - "%_pf_uint = OpTypePointer Function %uint", - "%_pf_int = OpTypePointer Function %int", - "%_pf_float = OpTypePointer Function %float", - "%_pf_double = OpTypePointer Function %double", - "%_pf_v2int = OpTypePointer Function %v2int", - "%_pf_v2float = OpTypePointer Function %v2float", - "%_pf_v2double = OpTypePointer Function %v2double", - // struct types - "%inner_struct = OpTypeStruct %bool %int %float", - "%outer_struct = OpTypeStruct %inner_struct %int", - "%flat_struct = OpTypeStruct %bool %int %float", - - // common constants - // scalar constants: - "%bool_true = OpConstantTrue %bool", - "%bool_false = OpConstantFalse %bool", - "%bool_null = OpConstantNull %bool", - "%signed_zero = OpConstant %int 0", - "%unsigned_zero = OpConstant %uint 0", - "%signed_one = OpConstant %int 1", - "%unsigned_one = OpConstant %uint 1", - "%signed_two = OpConstant %int 2", - "%unsigned_two = OpConstant %uint 2", - "%signed_three = OpConstant %int 3", - "%unsigned_three = OpConstant %uint 3", - "%signed_null = OpConstantNull %int", - "%unsigned_null = OpConstantNull %uint", - // vector constants: - "%bool_true_vec = OpConstantComposite %v2bool %bool_true %bool_true", - "%bool_false_vec = OpConstantComposite %v2bool %bool_false %bool_false", - "%bool_null_vec = OpConstantNull %v2bool", - "%signed_zero_vec = OpConstantComposite %v2int %signed_zero %signed_zero", - "%unsigned_zero_vec = OpConstantComposite %v2uint %unsigned_zero %unsigned_zero", - "%signed_one_vec = OpConstantComposite %v2int %signed_one %signed_one", - "%unsigned_one_vec = OpConstantComposite %v2uint %unsigned_one %unsigned_one", - "%signed_two_vec = OpConstantComposite %v2int %signed_two %signed_two", - "%unsigned_two_vec = OpConstantComposite %v2uint %unsigned_two %unsigned_two", - "%signed_three_vec = OpConstantComposite %v2int %signed_three %signed_three", - "%unsigned_three_vec = OpConstantComposite %v2uint %unsigned_three %unsigned_three", - "%signed_null_vec = OpConstantNull %v2int", - "%unsigned_null_vec = OpConstantNull %v2uint", - "%v4int_0_1_2_3 = OpConstantComposite %v4int %signed_zero %signed_one %signed_two %signed_three", - // clang-format on - }; -} - -// A helper function to strip OpName instructions from the given string of -// disassembly code. Returns the string with all OpName instruction stripped. -std::string StripOpNameInstructions(const std::string& str) { - std::stringstream ss(str); - std::ostringstream oss; - std::string inst_str; - while (std::getline(ss, inst_str, '\n')) { - if (inst_str.find("OpName %") == std::string::npos) { - oss << inst_str << '\n'; - } - } - return oss.str(); -} - -struct FoldSpecConstantOpAndCompositePassTestCase { - // Original constants with unfolded spec constants. - std::vector original; - // Expected cosntants after folding. - std::vector expected; -}; - -using FoldSpecConstantOpAndCompositePassTest = PassTest< - ::testing::TestWithParam>; - -TEST_P(FoldSpecConstantOpAndCompositePassTest, ParamTestCase) { - AssemblyBuilder test_code_builder, expected_code_builder; - const auto& tc = GetParam(); - test_code_builder.AppendTypesConstantsGlobals(CommonTypesAndConstants()); - test_code_builder.AppendTypesConstantsGlobals(tc.original); - expected_code_builder.AppendTypesConstantsGlobals(CommonTypesAndConstants()); - expected_code_builder.AppendTypesConstantsGlobals(tc.expected); - const std::string original = test_code_builder.GetCode(); - const std::string expected = expected_code_builder.GetCode(); - - // Run the optimization and get the result code in disassembly. - std::string optimized; - auto status = opt::Pass::Status::SuccessWithoutChange; - std::tie(optimized, status) = - SinglePassRunAndDisassemble( - original, /* skip_nop = */ true); - - // Check the optimized code, but ignore the OpName instructions. - EXPECT_NE(opt::Pass::Status::Failure, status); - EXPECT_EQ( - StripOpNameInstructions(expected) == StripOpNameInstructions(original), - status == opt::Pass::Status::SuccessWithoutChange); - EXPECT_EQ(StripOpNameInstructions(expected), - StripOpNameInstructions(optimized)); -} - -// Tests that OpSpecConstantComposite opcodes are replace with -// OpConstantComposite correctly. -INSTANTIATE_TEST_CASE_P( - Composite, FoldSpecConstantOpAndCompositePassTest, - ::testing::ValuesIn(std::vector< - FoldSpecConstantOpAndCompositePassTestCase>({ - // clang-format off - // normal vector - { - // original - { - "%spec_v2bool = OpSpecConstantComposite %v2bool %bool_true %bool_false", - "%spec_v2uint = OpSpecConstantComposite %v2uint %unsigned_one %unsigned_one", - "%spec_v2int_a = OpSpecConstantComposite %v2int %signed_one %signed_two", - // Spec constants whose value can not be fully resolved should - // not be processed. - "%spec_int = OpSpecConstant %int 99", - "%spec_v2int_b = OpSpecConstantComposite %v2int %signed_one %spec_int", - }, - // expected - { - "%spec_v2bool = OpConstantComposite %v2bool %bool_true %bool_false", - "%spec_v2uint = OpConstantComposite %v2uint %unsigned_one %unsigned_one", - "%spec_v2int_a = OpConstantComposite %v2int %signed_one %signed_two", - "%spec_int = OpSpecConstant %int 99", - "%spec_v2int_b = OpSpecConstantComposite %v2int %signed_one %spec_int", - }, - }, - // vector with null constants - { - // original - { - "%null_bool = OpConstantNull %bool", - "%null_int = OpConstantNull %int", - "%spec_v2bool = OpSpecConstantComposite %v2bool %null_bool %null_bool", - "%spec_v3int = OpSpecConstantComposite %v3int %null_int %null_int %null_int", - "%spec_v4int = OpSpecConstantComposite %v4int %null_int %null_int %null_int %null_int", - }, - // expected - { - "%null_bool = OpConstantNull %bool", - "%null_int = OpConstantNull %int", - "%spec_v2bool = OpConstantComposite %v2bool %null_bool %null_bool", - "%spec_v3int = OpConstantComposite %v3int %null_int %null_int %null_int", - "%spec_v4int = OpConstantComposite %v4int %null_int %null_int %null_int %null_int", - }, - }, - // flat struct - { - // original - { - "%float_1 = OpConstant %float 1", - "%flat_1 = OpSpecConstantComposite %flat_struct %bool_true %signed_null %float_1", - // following struct should not be folded as the value of - // %spec_float is not determined. - "%spec_float = OpSpecConstant %float 1", - "%flat_2 = OpSpecConstantComposite %flat_struct %bool_true %signed_one %spec_float", - }, - // expected - { - "%float_1 = OpConstant %float 1", - "%flat_1 = OpConstantComposite %flat_struct %bool_true %signed_null %float_1", - "%spec_float = OpSpecConstant %float 1", - "%flat_2 = OpSpecConstantComposite %flat_struct %bool_true %signed_one %spec_float", - } - }, - // nested struct - { - // original - { - "%float_1 = OpConstant %float 1", - "%inner_1 = OpSpecConstantComposite %inner_struct %bool_true %signed_null %float_1", - "%outer_1 = OpSpecConstantComposite %outer_struct %inner_1 %signed_one", - // following structs should not be folded as the value of - // %spec_float is not determined. - "%spec_float = OpSpecConstant %float 1", - "%inner_2 = OpSpecConstantComposite %inner_struct %bool_true %signed_null %spec_float", - "%outer_2 = OpSpecConstantComposite %outer_struct %inner_2 %signed_one", - }, - // expected - { - "%float_1 = OpConstant %float 1", - "%inner_1 = OpConstantComposite %inner_struct %bool_true %signed_null %float_1", - "%outer_1 = OpConstantComposite %outer_struct %inner_1 %signed_one", - "%spec_float = OpSpecConstant %float 1", - "%inner_2 = OpSpecConstantComposite %inner_struct %bool_true %signed_null %spec_float", - "%outer_2 = OpSpecConstantComposite %outer_struct %inner_2 %signed_one", - } - }, - // composite constants touched by OpUndef should be skipped - { - // original - { - "%undef = OpUndef %float", - "%inner = OpConstantComposite %inner_struct %bool_true %signed_one %undef", - "%outer = OpSpecConstantComposite %outer_struct %inner %signed_one", - }, - // expected - { - "%undef = OpUndef %float", - "%inner = OpConstantComposite %inner_struct %bool_true %signed_one %undef", - "%outer = OpSpecConstantComposite %outer_struct %inner %signed_one", - }, - } - // clang-format on - }))); - -// Tests for operations that resulting in different types. -INSTANTIATE_TEST_CASE_P( - Cast, FoldSpecConstantOpAndCompositePassTest, - ::testing::ValuesIn(std::vector< - FoldSpecConstantOpAndCompositePassTestCase>({ - // clang-format off - // int -> bool scalar - { - // original - { - "%spec_bool_t = OpSpecConstantOp %bool INotEqual %signed_three %signed_zero", - "%spec_bool_f = OpSpecConstantOp %bool INotEqual %signed_zero %signed_zero", - "%spec_bool_from_null = OpSpecConstantOp %bool INotEqual %signed_null %signed_zero", - }, - // expected - { - "%spec_bool_t = OpConstantTrue %bool", - "%spec_bool_f = OpConstantFalse %bool", - "%spec_bool_from_null = OpConstantFalse %bool", - }, - }, - - // uint -> bool scalar - { - // original - { - "%spec_bool_t = OpSpecConstantOp %bool INotEqual %unsigned_three %unsigned_zero", - "%spec_bool_f = OpSpecConstantOp %bool INotEqual %unsigned_zero %unsigned_zero", - "%spec_bool_from_null = OpSpecConstantOp %bool INotEqual %unsigned_null %unsigned_zero", - }, - // expected - { - "%spec_bool_t = OpConstantTrue %bool", - "%spec_bool_f = OpConstantFalse %bool", - "%spec_bool_from_null = OpConstantFalse %bool", - }, - }, - - // bool -> int scalar - { - // original - { - "%spec_int_one = OpSpecConstantOp %int Select %bool_true %signed_one %signed_zero", - "%spec_int_zero = OpSpecConstantOp %int Select %bool_false %signed_one %signed_zero", - "%spec_int_from_null = OpSpecConstantOp %int Select %bool_null %signed_one %signed_zero", - }, - // expected - { - "%spec_int_one = OpConstant %int 1", - "%spec_int_zero = OpConstant %int 0", - "%spec_int_from_null = OpConstant %int 0", - }, - }, - - // uint -> int scalar - { - // original - { - "%spec_int_one = OpSpecConstantOp %int IAdd %unsigned_one %signed_zero", - "%spec_int_zero = OpSpecConstantOp %int IAdd %unsigned_zero %signed_zero", - "%spec_int_from_null = OpSpecConstantOp %int IAdd %unsigned_null %unsigned_zero", - }, - // expected - { - "%spec_int_one = OpConstant %int 1", - "%spec_int_zero = OpConstant %int 0", - "%spec_int_from_null = OpConstant %int 0", - }, - }, - - // bool -> uint scalar - { - // original - { - "%spec_uint_one = OpSpecConstantOp %uint Select %bool_true %unsigned_one %unsigned_zero", - "%spec_uint_zero = OpSpecConstantOp %uint Select %bool_false %unsigned_one %unsigned_zero", - "%spec_uint_from_null = OpSpecConstantOp %uint Select %bool_null %unsigned_one %unsigned_zero", - }, - // expected - { - "%spec_uint_one = OpConstant %uint 1", - "%spec_uint_zero = OpConstant %uint 0", - "%spec_uint_from_null = OpConstant %uint 0", - }, - }, - - // int -> uint scalar - { - // original - { - "%spec_uint_one = OpSpecConstantOp %uint IAdd %signed_one %unsigned_zero", - "%spec_uint_zero = OpSpecConstantOp %uint IAdd %signed_zero %unsigned_zero", - "%spec_uint_from_null = OpSpecConstantOp %uint IAdd %signed_null %unsigned_zero", - }, - // expected - { - "%spec_uint_one = OpConstant %uint 1", - "%spec_uint_zero = OpConstant %uint 0", - "%spec_uint_from_null = OpConstant %uint 0", - }, - }, - - // int -> bool vector - { - // original - { - "%spec_bool_t_vec = OpSpecConstantOp %v2bool INotEqual %signed_three_vec %signed_zero_vec", - "%spec_bool_f_vec = OpSpecConstantOp %v2bool INotEqual %signed_zero_vec %signed_zero_vec", - "%spec_bool_from_null = OpSpecConstantOp %v2bool INotEqual %signed_null_vec %signed_zero_vec", - }, - // expected - { - "%true = OpConstantTrue %bool", - "%true_0 = OpConstantTrue %bool", - "%spec_bool_t_vec = OpConstantComposite %v2bool %true %true_0", - "%false = OpConstantFalse %bool", - "%false_0 = OpConstantFalse %bool", - "%spec_bool_f_vec = OpConstantComposite %v2bool %false %false_0", - "%false_1 = OpConstantFalse %bool", - "%false_2 = OpConstantFalse %bool", - "%spec_bool_from_null = OpConstantComposite %v2bool %false_1 %false_2", - }, - }, - - // uint -> bool vector - { - // original - { - "%spec_bool_t_vec = OpSpecConstantOp %v2bool INotEqual %unsigned_three_vec %unsigned_zero_vec", - "%spec_bool_f_vec = OpSpecConstantOp %v2bool INotEqual %unsigned_zero_vec %unsigned_zero_vec", - "%spec_bool_from_null = OpSpecConstantOp %v2bool INotEqual %unsigned_null_vec %unsigned_zero_vec", - }, - // expected - { - "%true = OpConstantTrue %bool", - "%true_0 = OpConstantTrue %bool", - "%spec_bool_t_vec = OpConstantComposite %v2bool %true %true_0", - "%false = OpConstantFalse %bool", - "%false_0 = OpConstantFalse %bool", - "%spec_bool_f_vec = OpConstantComposite %v2bool %false %false_0", - "%false_1 = OpConstantFalse %bool", - "%false_2 = OpConstantFalse %bool", - "%spec_bool_from_null = OpConstantComposite %v2bool %false_1 %false_2", - }, - }, - - // bool -> int vector - { - // original - { - "%spec_int_one_vec = OpSpecConstantOp %v2int Select %bool_true_vec %signed_one_vec %signed_zero_vec", - "%spec_int_zero_vec = OpSpecConstantOp %v2int Select %bool_false_vec %signed_one_vec %signed_zero_vec", - "%spec_int_from_null = OpSpecConstantOp %v2int Select %bool_null_vec %signed_one_vec %signed_zero_vec", - }, - // expected - { - "%int_1 = OpConstant %int 1", - "%int_1_0 = OpConstant %int 1", - "%spec_int_one_vec = OpConstantComposite %v2int %int_1 %int_1_0", - "%int_0 = OpConstant %int 0", - "%int_0_0 = OpConstant %int 0", - "%spec_int_zero_vec = OpConstantComposite %v2int %int_0 %int_0_0", - "%int_0_1 = OpConstant %int 0", - "%int_0_2 = OpConstant %int 0", - "%spec_int_from_null = OpConstantComposite %v2int %int_0_1 %int_0_2", - }, - }, - - // uint -> int vector - { - // original - { - "%spec_int_one_vec = OpSpecConstantOp %v2int IAdd %unsigned_one_vec %signed_zero_vec", - "%spec_int_zero_vec = OpSpecConstantOp %v2int IAdd %unsigned_zero_vec %signed_zero_vec", - "%spec_int_from_null = OpSpecConstantOp %v2int IAdd %unsigned_null_vec %signed_zero_vec", - }, - // expected - { - "%int_1 = OpConstant %int 1", - "%int_1_0 = OpConstant %int 1", - "%spec_int_one_vec = OpConstantComposite %v2int %int_1 %int_1_0", - "%int_0 = OpConstant %int 0", - "%int_0_0 = OpConstant %int 0", - "%spec_int_zero_vec = OpConstantComposite %v2int %int_0 %int_0_0", - "%int_0_1 = OpConstant %int 0", - "%int_0_2 = OpConstant %int 0", - "%spec_int_from_null = OpConstantComposite %v2int %int_0_1 %int_0_2", - }, - }, - - // bool -> uint vector - { - // original - { - "%spec_uint_one_vec = OpSpecConstantOp %v2uint Select %bool_true_vec %unsigned_one_vec %unsigned_zero_vec", - "%spec_uint_zero_vec = OpSpecConstantOp %v2uint Select %bool_false_vec %unsigned_one_vec %unsigned_zero_vec", - "%spec_uint_from_null = OpSpecConstantOp %v2uint Select %bool_null_vec %unsigned_one_vec %unsigned_zero_vec", - }, - // expected - { - "%uint_1 = OpConstant %uint 1", - "%uint_1_0 = OpConstant %uint 1", - "%spec_uint_one_vec = OpConstantComposite %v2uint %uint_1 %uint_1_0", - "%uint_0 = OpConstant %uint 0", - "%uint_0_0 = OpConstant %uint 0", - "%spec_uint_zero_vec = OpConstantComposite %v2uint %uint_0 %uint_0_0", - "%uint_0_1 = OpConstant %uint 0", - "%uint_0_2 = OpConstant %uint 0", - "%spec_uint_from_null = OpConstantComposite %v2uint %uint_0_1 %uint_0_2", - }, - }, - - // int -> uint vector - { - // original - { - "%spec_uint_one_vec = OpSpecConstantOp %v2uint IAdd %signed_one_vec %unsigned_zero_vec", - "%spec_uint_zero_vec = OpSpecConstantOp %v2uint IAdd %signed_zero_vec %unsigned_zero_vec", - "%spec_uint_from_null = OpSpecConstantOp %v2uint IAdd %signed_null_vec %unsigned_zero_vec", - }, - // expected - { - "%uint_1 = OpConstant %uint 1", - "%uint_1_0 = OpConstant %uint 1", - "%spec_uint_one_vec = OpConstantComposite %v2uint %uint_1 %uint_1_0", - "%uint_0 = OpConstant %uint 0", - "%uint_0_0 = OpConstant %uint 0", - "%spec_uint_zero_vec = OpConstantComposite %v2uint %uint_0 %uint_0_0", - "%uint_0_1 = OpConstant %uint 0", - "%uint_0_2 = OpConstant %uint 0", - "%spec_uint_from_null = OpConstantComposite %v2uint %uint_0_1 %uint_0_2", - }, - }, - // clang-format on - }))); - -// Tests about boolean scalar logical operations and comparison operations with -// scalar int/uint type. -INSTANTIATE_TEST_CASE_P( - Logical, FoldSpecConstantOpAndCompositePassTest, - ::testing::ValuesIn(std::vector< - FoldSpecConstantOpAndCompositePassTestCase>({ - // clang-format off - // scalar integer comparison - { - // original - { - "%int_minus_1 = OpConstant %int -1", - - "%slt_0_1 = OpSpecConstantOp %bool SLessThan %signed_zero %signed_one", - "%sgt_0_1 = OpSpecConstantOp %bool SGreaterThan %signed_zero %signed_one", - "%sle_2_2 = OpSpecConstantOp %bool SLessThanEqual %signed_two %signed_two", - "%sge_2_1 = OpSpecConstantOp %bool SGreaterThanEqual %signed_two %signed_one", - "%sge_2_null = OpSpecConstantOp %bool SGreaterThanEqual %signed_two %signed_null", - "%sge_minus_1_null = OpSpecConstantOp %bool SGreaterThanEqual %int_minus_1 %signed_null", - - "%ult_0_1 = OpSpecConstantOp %bool ULessThan %unsigned_zero %unsigned_one", - "%ugt_0_1 = OpSpecConstantOp %bool UGreaterThan %unsigned_zero %unsigned_one", - "%ule_2_3 = OpSpecConstantOp %bool ULessThanEqual %unsigned_two %unsigned_three", - "%uge_1_1 = OpSpecConstantOp %bool UGreaterThanEqual %unsigned_one %unsigned_one", - "%uge_2_null = OpSpecConstantOp %bool UGreaterThanEqual %unsigned_two %unsigned_null", - "%uge_minus_1_null = OpSpecConstantOp %bool UGreaterThanEqual %int_minus_1 %unsigned_null", - }, - // expected - { - "%int_minus_1 = OpConstant %int -1", - - "%slt_0_1 = OpConstantTrue %bool", - "%sgt_0_1 = OpConstantFalse %bool", - "%sle_2_2 = OpConstantTrue %bool", - "%sge_2_1 = OpConstantTrue %bool", - "%sge_2_null = OpConstantTrue %bool", - "%sge_minus_1_null = OpConstantFalse %bool", - - "%ult_0_1 = OpConstantTrue %bool", - "%ugt_0_1 = OpConstantFalse %bool", - "%ule_2_3 = OpConstantTrue %bool", - "%uge_1_1 = OpConstantTrue %bool", - "%uge_2_null = OpConstantTrue %bool", - "%uge_minus_1_null = OpConstantTrue %bool", - }, - }, - // Logical and, or, xor. - { - // original - { - "%logical_or = OpSpecConstantOp %bool LogicalOr %bool_true %bool_false", - "%logical_and = OpSpecConstantOp %bool LogicalAnd %bool_true %bool_false", - "%logical_not = OpSpecConstantOp %bool LogicalNot %bool_true", - "%logical_eq = OpSpecConstantOp %bool LogicalEqual %bool_true %bool_true", - "%logical_neq = OpSpecConstantOp %bool LogicalNotEqual %bool_true %bool_true", - "%logical_and_null = OpSpecConstantOp %bool LogicalAnd %bool_true %bool_null", - }, - // expected - { - "%logical_or = OpConstantTrue %bool", - "%logical_and = OpConstantFalse %bool", - "%logical_not = OpConstantFalse %bool", - "%logical_eq = OpConstantTrue %bool", - "%logical_neq = OpConstantFalse %bool", - "%logical_and_null = OpConstantFalse %bool", - }, - }, - // clang-format on - }))); - -// Tests about arithmetic operations for scalar int and uint types. -INSTANTIATE_TEST_CASE_P( - ScalarArithmetic, FoldSpecConstantOpAndCompositePassTest, - ::testing::ValuesIn(std::vector< - FoldSpecConstantOpAndCompositePassTestCase>({ - // clang-format off - // scalar integer negate - { - // original - { - "%int_minus_1 = OpSpecConstantOp %int SNegate %signed_one", - "%int_minus_2 = OpSpecConstantOp %int SNegate %signed_two", - "%int_neg_null = OpSpecConstantOp %int SNegate %signed_null", - "%int_max = OpConstant %int 2147483647", - "%int_neg_max = OpSpecConstantOp %int SNegate %int_max", - }, - // expected - { - "%int_minus_1 = OpConstant %int -1", - "%int_minus_2 = OpConstant %int -2", - "%int_neg_null = OpConstant %int 0", - "%int_max = OpConstant %int 2147483647", - "%int_neg_max = OpConstant %int -2147483647", - }, - }, - // scalar integer not - { - // original - { - "%uint_4294967294 = OpSpecConstantOp %uint Not %unsigned_one", - "%uint_4294967293 = OpSpecConstantOp %uint Not %unsigned_two", - "%uint_neg_null = OpSpecConstantOp %uint Not %unsigned_null", - }, - // expected - { - "%uint_4294967294 = OpConstant %uint 4294967294", - "%uint_4294967293 = OpConstant %uint 4294967293", - "%uint_neg_null = OpConstant %uint 4294967295", - }, - }, - // scalar integer add, sub, mul, div - { - // original - { - "%signed_max = OpConstant %int 2147483647", - "%signed_min = OpConstant %int -2147483648", - - "%spec_int_iadd = OpSpecConstantOp %int IAdd %signed_three %signed_two", - "%spec_int_isub = OpSpecConstantOp %int ISub %signed_one %spec_int_iadd", - "%spec_int_sdiv = OpSpecConstantOp %int SDiv %spec_int_isub %signed_two", - "%spec_int_imul = OpSpecConstantOp %int IMul %spec_int_sdiv %signed_three", - "%spec_int_iadd_null = OpSpecConstantOp %int IAdd %spec_int_imul %signed_null", - "%spec_int_imul_null = OpSpecConstantOp %int IMul %spec_int_iadd_null %signed_null", - "%spec_int_iadd_overflow = OpSpecConstantOp %int IAdd %signed_max %signed_three", - "%spec_int_isub_overflow = OpSpecConstantOp %int ISub %signed_min %signed_three", - - "%spec_uint_iadd = OpSpecConstantOp %uint IAdd %unsigned_three %unsigned_two", - "%spec_uint_isub = OpSpecConstantOp %uint ISub %unsigned_one %spec_uint_iadd", - "%spec_uint_udiv = OpSpecConstantOp %uint UDiv %spec_uint_isub %unsigned_three", - "%spec_uint_imul = OpSpecConstantOp %uint IMul %spec_uint_udiv %unsigned_two", - "%spec_uint_isub_null = OpSpecConstantOp %uint ISub %spec_uint_imul %signed_null", - }, - // expected - { - "%signed_max = OpConstant %int 2147483647", - "%signed_min = OpConstant %int -2147483648", - - "%spec_int_iadd = OpConstant %int 5", - "%spec_int_isub = OpConstant %int -4", - "%spec_int_sdiv = OpConstant %int -2", - "%spec_int_imul = OpConstant %int -6", - "%spec_int_iadd_null = OpConstant %int -6", - "%spec_int_imul_null = OpConstant %int 0", - "%spec_int_iadd_overflow = OpConstant %int -2147483646", - "%spec_int_isub_overflow = OpConstant %int 2147483645", - - "%spec_uint_iadd = OpConstant %uint 5", - "%spec_uint_isub = OpConstant %uint 4294967292", - "%spec_uint_udiv = OpConstant %uint 1431655764", - "%spec_uint_imul = OpConstant %uint 2863311528", - "%spec_uint_isub_null = OpConstant %uint 2863311528", - }, - }, - // scalar integer rem, mod - { - // original - { - // common constants - "%int_7 = OpConstant %int 7", - "%uint_7 = OpConstant %uint 7", - "%int_minus_7 = OpConstant %int -7", - "%int_minus_3 = OpConstant %int -3", - - // srem - "%7_srem_3 = OpSpecConstantOp %int SRem %int_7 %signed_three", - "%minus_7_srem_3 = OpSpecConstantOp %int SRem %int_minus_7 %signed_three", - "%7_srem_minus_3 = OpSpecConstantOp %int SRem %int_7 %int_minus_3", - "%minus_7_srem_minus_3 = OpSpecConstantOp %int SRem %int_minus_7 %int_minus_3", - // smod - "%7_smod_3 = OpSpecConstantOp %int SMod %int_7 %signed_three", - "%minus_7_smod_3 = OpSpecConstantOp %int SMod %int_minus_7 %signed_three", - "%7_smod_minus_3 = OpSpecConstantOp %int SMod %int_7 %int_minus_3", - "%minus_7_smod_minus_3 = OpSpecConstantOp %int SMod %int_minus_7 %int_minus_3", - // umod - "%7_umod_3 = OpSpecConstantOp %uint UMod %uint_7 %unsigned_three", - // null constant - "%null_srem_3 = OpSpecConstantOp %int SRem %signed_null %signed_three", - "%null_smod_3 = OpSpecConstantOp %int SMod %signed_null %signed_three", - "%null_umod_3 = OpSpecConstantOp %uint UMod %unsigned_null %unsigned_three", - }, - // expected - { - // common constants - "%int_7 = OpConstant %int 7", - "%uint_7 = OpConstant %uint 7", - "%int_minus_7 = OpConstant %int -7", - "%int_minus_3 = OpConstant %int -3", - - // srem - "%7_srem_3 = OpConstant %int 1", - "%minus_7_srem_3 = OpConstant %int -1", - "%7_srem_minus_3 = OpConstant %int 1", - "%minus_7_srem_minus_3 = OpConstant %int -1", - // smod - "%7_smod_3 = OpConstant %int 1", - "%minus_7_smod_3 = OpConstant %int 2", - "%7_smod_minus_3 = OpConstant %int -2", - "%minus_7_smod_minus_3 = OpConstant %int -1", - // umod - "%7_umod_3 = OpConstant %uint 1", - // null constant - "%null_srem_3 = OpConstant %int 0", - "%null_smod_3 = OpConstant %int 0", - "%null_umod_3 = OpConstant %uint 0", - }, - }, - // scalar integer bitwise and shift - { - // original - { - // bitwise - "%xor_1_3 = OpSpecConstantOp %int BitwiseXor %signed_one %signed_three", - "%and_1_2 = OpSpecConstantOp %int BitwiseAnd %signed_one %xor_1_3", - "%or_1_2 = OpSpecConstantOp %int BitwiseOr %signed_one %xor_1_3", - "%xor_3_null = OpSpecConstantOp %int BitwiseXor %or_1_2 %signed_null", - - // shift - "%unsigned_31 = OpConstant %uint 31", - "%unsigned_left_shift_max = OpSpecConstantOp %uint ShiftLeftLogical %unsigned_one %unsigned_31", - "%unsigned_right_shift_logical = OpSpecConstantOp %uint ShiftRightLogical %unsigned_left_shift_max %unsigned_31", - "%signed_right_shift_arithmetic = OpSpecConstantOp %int ShiftRightArithmetic %unsigned_left_shift_max %unsigned_31", - "%left_shift_null_31 = OpSpecConstantOp %uint ShiftLeftLogical %unsigned_null %unsigned_31", - "%right_shift_31_null = OpSpecConstantOp %uint ShiftRightLogical %unsigned_31 %unsigned_null", - }, - // expected - { - "%xor_1_3 = OpConstant %int 2", - "%and_1_2 = OpConstant %int 0", - "%or_1_2 = OpConstant %int 3", - "%xor_3_null = OpConstant %int 3", - - "%unsigned_31 = OpConstant %uint 31", - "%unsigned_left_shift_max = OpConstant %uint 2147483648", - "%unsigned_right_shift_logical = OpConstant %uint 1", - "%signed_right_shift_arithmetic = OpConstant %int -1", - "%left_shift_null_31 = OpConstant %uint 0", - "%right_shift_31_null = OpConstant %uint 31", - }, - }, - // Skip folding if any operands have undetermined value. - { - // original - { - "%spec_int = OpSpecConstant %int 1", - "%spec_iadd = OpSpecConstantOp %int IAdd %signed_three %spec_int", - }, - // expected - { - "%spec_int = OpSpecConstant %int 1", - "%spec_iadd = OpSpecConstantOp %int IAdd %signed_three %spec_int", - }, - }, - // clang-format on - }))); - -// Tests about arithmetic operations for vector int and uint types. -INSTANTIATE_TEST_CASE_P( - VectorArithmetic, FoldSpecConstantOpAndCompositePassTest, - ::testing::ValuesIn(std::vector< - FoldSpecConstantOpAndCompositePassTestCase>({ - // clang-format off - // vector integer negate - { - // original - { - "%v2int_minus_1 = OpSpecConstantOp %v2int SNegate %signed_one_vec", - "%v2int_minus_2 = OpSpecConstantOp %v2int SNegate %signed_two_vec", - "%v2int_neg_null = OpSpecConstantOp %v2int SNegate %signed_null_vec", - }, - // expected - { - "%int_n1 = OpConstant %int -1", - "%int_n1_0 = OpConstant %int -1", - "%v2int_minus_1 = OpConstantComposite %v2int %int_n1 %int_n1_0", - "%int_n2 = OpConstant %int -2", - "%int_n2_0 = OpConstant %int -2", - "%v2int_minus_2 = OpConstantComposite %v2int %int_n2 %int_n2_0", - "%int_0 = OpConstant %int 0", - "%int_0_0 = OpConstant %int 0", - "%v2int_neg_null = OpConstantComposite %v2int %int_0 %int_0_0", - }, - }, - // vector integer (including null vetors) add, sub, div, mul - { - // original - { - "%spec_v2int_iadd = OpSpecConstantOp %v2int IAdd %signed_three_vec %signed_two_vec", - "%spec_v2int_isub = OpSpecConstantOp %v2int ISub %signed_one_vec %spec_v2int_iadd", - "%spec_v2int_sdiv = OpSpecConstantOp %v2int SDiv %spec_v2int_isub %signed_two_vec", - "%spec_v2int_imul = OpSpecConstantOp %v2int IMul %spec_v2int_sdiv %signed_three_vec", - "%spec_v2int_iadd_null = OpSpecConstantOp %v2int IAdd %spec_v2int_imul %signed_null_vec", - - "%spec_v2uint_iadd = OpSpecConstantOp %v2uint IAdd %unsigned_three_vec %unsigned_two_vec", - "%spec_v2uint_isub = OpSpecConstantOp %v2uint ISub %unsigned_one_vec %spec_v2uint_iadd", - "%spec_v2uint_udiv = OpSpecConstantOp %v2uint UDiv %spec_v2uint_isub %unsigned_three_vec", - "%spec_v2uint_imul = OpSpecConstantOp %v2uint IMul %spec_v2uint_udiv %unsigned_two_vec", - "%spec_v2uint_isub_null = OpSpecConstantOp %v2uint ISub %spec_v2uint_imul %signed_null_vec", - }, - // expected - { - "%int_5 = OpConstant %int 5", - "%int_5_0 = OpConstant %int 5", - "%spec_v2int_iadd = OpConstantComposite %v2int %int_5 %int_5_0", - "%int_n4 = OpConstant %int -4", - "%int_n4_0 = OpConstant %int -4", - "%spec_v2int_isub = OpConstantComposite %v2int %int_n4 %int_n4_0", - "%int_n2 = OpConstant %int -2", - "%int_n2_0 = OpConstant %int -2", - "%spec_v2int_sdiv = OpConstantComposite %v2int %int_n2 %int_n2_0", - "%int_n6 = OpConstant %int -6", - "%int_n6_0 = OpConstant %int -6", - "%spec_v2int_imul = OpConstantComposite %v2int %int_n6 %int_n6_0", - "%int_n6_1 = OpConstant %int -6", - "%int_n6_2 = OpConstant %int -6", - "%spec_v2int_iadd_null = OpConstantComposite %v2int %int_n6_1 %int_n6_2", - - "%uint_5 = OpConstant %uint 5", - "%uint_5_0 = OpConstant %uint 5", - "%spec_v2uint_iadd = OpConstantComposite %v2uint %uint_5 %uint_5_0", - "%uint_4294967292 = OpConstant %uint 4294967292", - "%uint_4294967292_0 = OpConstant %uint 4294967292", - "%spec_v2uint_isub = OpConstantComposite %v2uint %uint_4294967292 %uint_4294967292_0", - "%uint_1431655764 = OpConstant %uint 1431655764", - "%uint_1431655764_0 = OpConstant %uint 1431655764", - "%spec_v2uint_udiv = OpConstantComposite %v2uint %uint_1431655764 %uint_1431655764_0", - "%uint_2863311528 = OpConstant %uint 2863311528", - "%uint_2863311528_0 = OpConstant %uint 2863311528", - "%spec_v2uint_imul = OpConstantComposite %v2uint %uint_2863311528 %uint_2863311528_0", - "%uint_2863311528_1 = OpConstant %uint 2863311528", - "%uint_2863311528_2 = OpConstant %uint 2863311528", - "%spec_v2uint_isub_null = OpConstantComposite %v2uint %uint_2863311528_1 %uint_2863311528_2", - }, - }, - // vector integer rem, mod - { - // original - { - // common constants - "%int_7 = OpConstant %int 7", - "%v2int_7 = OpConstantComposite %v2int %int_7 %int_7", - "%uint_7 = OpConstant %uint 7", - "%v2uint_7 = OpConstantComposite %v2uint %uint_7 %uint_7", - "%int_minus_7 = OpConstant %int -7", - "%v2int_minus_7 = OpConstantComposite %v2int %int_minus_7 %int_minus_7", - "%int_minus_3 = OpConstant %int -3", - "%v2int_minus_3 = OpConstantComposite %v2int %int_minus_3 %int_minus_3", - - // srem - "%7_srem_3 = OpSpecConstantOp %v2int SRem %v2int_7 %signed_three_vec", - "%minus_7_srem_3 = OpSpecConstantOp %v2int SRem %v2int_minus_7 %signed_three_vec", - "%7_srem_minus_3 = OpSpecConstantOp %v2int SRem %v2int_7 %v2int_minus_3", - "%minus_7_srem_minus_3 = OpSpecConstantOp %v2int SRem %v2int_minus_7 %v2int_minus_3", - // smod - "%7_smod_3 = OpSpecConstantOp %v2int SMod %v2int_7 %signed_three_vec", - "%minus_7_smod_3 = OpSpecConstantOp %v2int SMod %v2int_minus_7 %signed_three_vec", - "%7_smod_minus_3 = OpSpecConstantOp %v2int SMod %v2int_7 %v2int_minus_3", - "%minus_7_smod_minus_3 = OpSpecConstantOp %v2int SMod %v2int_minus_7 %v2int_minus_3", - // umod - "%7_umod_3 = OpSpecConstantOp %v2uint UMod %v2uint_7 %unsigned_three_vec", - }, - // expected - { - // common constants - "%int_7 = OpConstant %int 7", - "%v2int_7 = OpConstantComposite %v2int %int_7 %int_7", - "%uint_7 = OpConstant %uint 7", - "%v2uint_7 = OpConstantComposite %v2uint %uint_7 %uint_7", - "%int_minus_7 = OpConstant %int -7", - "%v2int_minus_7 = OpConstantComposite %v2int %int_minus_7 %int_minus_7", - "%int_minus_3 = OpConstant %int -3", - "%v2int_minus_3 = OpConstantComposite %v2int %int_minus_3 %int_minus_3", - - // srem - "%int_1 = OpConstant %int 1", - "%int_1_0 = OpConstant %int 1", - "%7_srem_3 = OpConstantComposite %v2int %int_1 %int_1_0", - "%int_n1 = OpConstant %int -1", - "%int_n1_0 = OpConstant %int -1", - "%minus_7_srem_3 = OpConstantComposite %v2int %int_n1 %int_n1_0", - "%int_1_1 = OpConstant %int 1", - "%int_1_2 = OpConstant %int 1", - "%7_srem_minus_3 = OpConstantComposite %v2int %int_1_1 %int_1_2", - "%int_n1_1 = OpConstant %int -1", - "%int_n1_2 = OpConstant %int -1", - "%minus_7_srem_minus_3 = OpConstantComposite %v2int %int_n1_1 %int_n1_2", - // smod - "%int_1_3 = OpConstant %int 1", - "%int_1_4 = OpConstant %int 1", - "%7_smod_3 = OpConstantComposite %v2int %int_1_3 %int_1_4", - "%int_2 = OpConstant %int 2", - "%int_2_0 = OpConstant %int 2", - "%minus_7_smod_3 = OpConstantComposite %v2int %int_2 %int_2_0", - "%int_n2 = OpConstant %int -2", - "%int_n2_0 = OpConstant %int -2", - "%7_smod_minus_3 = OpConstantComposite %v2int %int_n2 %int_n2_0", - "%int_n1_3 = OpConstant %int -1", - "%int_n1_4 = OpConstant %int -1", - "%minus_7_smod_minus_3 = OpConstantComposite %v2int %int_n1_3 %int_n1_4", - // umod - "%uint_1 = OpConstant %uint 1", - "%uint_1_0 = OpConstant %uint 1", - "%7_umod_3 = OpConstantComposite %v2uint %uint_1 %uint_1_0", - }, - }, - // vector integer bitwise, shift - { - // original - { - "%xor_1_3 = OpSpecConstantOp %v2int BitwiseXor %signed_one_vec %signed_three_vec", - "%and_1_2 = OpSpecConstantOp %v2int BitwiseAnd %signed_one_vec %xor_1_3", - "%or_1_2 = OpSpecConstantOp %v2int BitwiseOr %signed_one_vec %xor_1_3", - - "%unsigned_31 = OpConstant %uint 31", - "%v2unsigned_31 = OpConstantComposite %v2uint %unsigned_31 %unsigned_31", - "%unsigned_left_shift_max = OpSpecConstantOp %v2uint ShiftLeftLogical %unsigned_one_vec %v2unsigned_31", - "%unsigned_right_shift_logical = OpSpecConstantOp %v2uint ShiftRightLogical %unsigned_left_shift_max %v2unsigned_31", - "%signed_right_shift_arithmetic = OpSpecConstantOp %v2int ShiftRightArithmetic %unsigned_left_shift_max %v2unsigned_31", - }, - // expected - { - "%int_2 = OpConstant %int 2", - "%int_2_0 = OpConstant %int 2", - "%xor_1_3 = OpConstantComposite %v2int %int_2 %int_2_0", - "%int_0 = OpConstant %int 0", - "%int_0_0 = OpConstant %int 0", - "%and_1_2 = OpConstantComposite %v2int %int_0 %int_0_0", - "%int_3 = OpConstant %int 3", - "%int_3_0 = OpConstant %int 3", - "%or_1_2 = OpConstantComposite %v2int %int_3 %int_3_0", - - "%unsigned_31 = OpConstant %uint 31", - "%v2unsigned_31 = OpConstantComposite %v2uint %unsigned_31 %unsigned_31", - "%uint_2147483648 = OpConstant %uint 2147483648", - "%uint_2147483648_0 = OpConstant %uint 2147483648", - "%unsigned_left_shift_max = OpConstantComposite %v2uint %uint_2147483648 %uint_2147483648_0", - "%uint_1 = OpConstant %uint 1", - "%uint_1_0 = OpConstant %uint 1", - "%unsigned_right_shift_logical = OpConstantComposite %v2uint %uint_1 %uint_1_0", - "%int_n1 = OpConstant %int -1", - "%int_n1_0 = OpConstant %int -1", - "%signed_right_shift_arithmetic = OpConstantComposite %v2int %int_n1 %int_n1_0", - }, - }, - // Skip folding if any vector operands or components of the operands - // have undetermined value. - { - // original - { - "%spec_int = OpSpecConstant %int 1", - "%spec_vec = OpSpecConstantComposite %v2int %signed_zero %spec_int", - "%spec_iadd = OpSpecConstantOp %v2int IAdd %signed_three_vec %spec_vec", - }, - // expected - { - "%spec_int = OpSpecConstant %int 1", - "%spec_vec = OpSpecConstantComposite %v2int %signed_zero %spec_int", - "%spec_iadd = OpSpecConstantOp %v2int IAdd %signed_three_vec %spec_vec", - }, - }, - // Skip folding if any vector operands are defined by OpUndef - { - // original - { - "%undef = OpUndef %int", - "%vec = OpConstantComposite %v2int %undef %signed_one", - "%spec_iadd = OpSpecConstantOp %v2int IAdd %signed_three_vec %vec", - }, - // expected - { - "%undef = OpUndef %int", - "%vec = OpConstantComposite %v2int %undef %signed_one", - "%spec_iadd = OpSpecConstantOp %v2int IAdd %signed_three_vec %vec", - }, - }, - // clang-format on - }))); - -// Tests for SpecConstantOp CompositeExtract instruction -INSTANTIATE_TEST_CASE_P( - CompositeExtract, FoldSpecConstantOpAndCompositePassTest, - ::testing::ValuesIn(std::vector< - FoldSpecConstantOpAndCompositePassTestCase>({ - // clang-format off - // normal vector - { - // original - { - "%r = OpSpecConstantOp %int CompositeExtract %signed_three_vec 0", - "%x = OpSpecConstantOp %int CompositeExtract %v4int_0_1_2_3 0", - "%y = OpSpecConstantOp %int CompositeExtract %v4int_0_1_2_3 1", - "%z = OpSpecConstantOp %int CompositeExtract %v4int_0_1_2_3 2", - "%w = OpSpecConstantOp %int CompositeExtract %v4int_0_1_2_3 3", - }, - // expected - { - "%r = OpConstant %int 3", - "%x = OpConstant %int 0", - "%y = OpConstant %int 1", - "%z = OpConstant %int 2", - "%w = OpConstant %int 3", - }, - }, - // null vector - { - // original - { - "%x = OpSpecConstantOp %int CompositeExtract %signed_null_vec 0", - "%y = OpSpecConstantOp %int CompositeExtract %signed_null_vec 1", - "%null_v4int = OpConstantNull %v4int", - "%z = OpSpecConstantOp %int CompositeExtract %signed_null_vec 2", - }, - // expected - { - "%x = OpConstantNull %int", - "%y = OpConstantNull %int", - "%null_v4int = OpConstantNull %v4int", - "%z = OpConstantNull %int", - } - }, - // normal flat struct - { - // original - { - "%float_1 = OpConstant %float 1", - "%flat_1 = OpConstantComposite %flat_struct %bool_true %signed_null %float_1", - "%extract_bool = OpSpecConstantOp %bool CompositeExtract %flat_1 0", - "%extract_int = OpSpecConstantOp %int CompositeExtract %flat_1 1", - "%extract_float_1 = OpSpecConstantOp %float CompositeExtract %flat_1 2", - // foldable composite constants built with OpSpecConstantComposite - // should also be processed. - "%flat_2 = OpSpecConstantComposite %flat_struct %bool_true %signed_null %float_1", - "%extract_float_2 = OpSpecConstantOp %float CompositeExtract %flat_2 2", - }, - // expected - { - "%float_1 = OpConstant %float 1", - "%flat_1 = OpConstantComposite %flat_struct %bool_true %signed_null %float_1", - "%extract_bool = OpConstantTrue %bool", - "%extract_int = OpConstantNull %int", - "%extract_float_1 = OpConstant %float 1", - "%flat_2 = OpConstantComposite %flat_struct %bool_true %signed_null %float_1", - "%extract_float_2 = OpConstant %float 1", - }, - }, - // null flat struct - { - // original - { - "%flat = OpConstantNull %flat_struct", - "%extract_bool = OpSpecConstantOp %bool CompositeExtract %flat 0", - "%extract_int = OpSpecConstantOp %int CompositeExtract %flat 1", - "%extract_float = OpSpecConstantOp %float CompositeExtract %flat 2", - }, - // expected - { - "%flat = OpConstantNull %flat_struct", - "%extract_bool = OpConstantNull %bool", - "%extract_int = OpConstantNull %int", - "%extract_float = OpConstantNull %float", - }, - }, - // normal nested struct - { - // original - { - "%float_1 = OpConstant %float 1", - "%inner = OpConstantComposite %inner_struct %bool_true %signed_null %float_1", - "%outer = OpConstantComposite %outer_struct %inner %signed_one", - "%extract_inner = OpSpecConstantOp %inner_struct CompositeExtract %outer 0", - "%extract_int = OpSpecConstantOp %int CompositeExtract %outer 1", - "%extract_inner_float = OpSpecConstantOp %int CompositeExtract %outer 0 2", - }, - // expected - { - "%float_1 = OpConstant %float 1", - "%inner = OpConstantComposite %inner_struct %bool_true %signed_null %float_1", - "%outer = OpConstantComposite %outer_struct %inner %signed_one", - "%extract_inner = OpConstantComposite %inner_struct %bool_true %signed_null %float_1", - "%extract_int = OpConstant %int 1", - "%extract_inner_float = OpConstant %float 1", - }, - }, - // null nested struct - { - // original - { - "%outer = OpConstantNull %outer_struct", - "%extract_inner = OpSpecConstantOp %inner_struct CompositeExtract %outer 0", - "%extract_int = OpSpecConstantOp %int CompositeExtract %outer 1", - "%extract_inner_float = OpSpecConstantOp %float CompositeExtract %outer 0 2", - }, - // expected - { - "%outer = OpConstantNull %outer_struct", - "%extract_inner = OpConstantNull %inner_struct", - "%extract_int = OpConstantNull %int", - "%extract_inner_float = OpConstantNull %float", - }, - }, - // skip folding if the any composite constant's value are not fully - // determined, even though the extracting target might have - // determined value. - { - // original - { - "%float_1 = OpConstant %float 1", - "%spec_float = OpSpecConstant %float 1", - "%spec_inner = OpSpecConstantComposite %inner_struct %bool_true %signed_null %spec_float", - "%spec_outer = OpSpecConstantComposite %outer_struct %spec_inner %signed_one", - "%spec_vec = OpSpecConstantComposite %v2float %spec_float %float_1", - "%extract_inner = OpSpecConstantOp %int CompositeExtract %spec_inner 1", - "%extract_outer = OpSpecConstantOp %int CompositeExtract %spec_outer 1", - "%extract_vec = OpSpecConstantOp %float CompositeExtract %spec_vec 1", - }, - // expected - { - "%float_1 = OpConstant %float 1", - "%spec_float = OpSpecConstant %float 1", - "%spec_inner = OpSpecConstantComposite %inner_struct %bool_true %signed_null %spec_float", - "%spec_outer = OpSpecConstantComposite %outer_struct %spec_inner %signed_one", - "%spec_vec = OpSpecConstantComposite %v2float %spec_float %float_1", - "%extract_inner = OpSpecConstantOp %int CompositeExtract %spec_inner 1", - "%extract_outer = OpSpecConstantOp %int CompositeExtract %spec_outer 1", - "%extract_vec = OpSpecConstantOp %float CompositeExtract %spec_vec 1", - }, - }, - // skip if the composite constant depends on the result of OpUndef, - // even though the composite extract target element does not depends - // on the OpUndef. - { - // original - { - "%undef = OpUndef %float", - "%inner = OpConstantComposite %inner_struct %bool_true %signed_one %undef", - "%outer = OpConstantComposite %outer_struct %inner %signed_one", - "%extract_inner = OpSpecConstantOp %int CompositeExtract %inner 1", - "%extract_outer = OpSpecConstantOp %int CompositeExtract %outer 1", - }, - // expected - { - "%undef = OpUndef %float", - "%inner = OpConstantComposite %inner_struct %bool_true %signed_one %undef", - "%outer = OpConstantComposite %outer_struct %inner %signed_one", - "%extract_inner = OpSpecConstantOp %int CompositeExtract %inner 1", - "%extract_outer = OpSpecConstantOp %int CompositeExtract %outer 1", - }, - }, - // TODO(qining): Add tests for Array and other composite type constants. - // clang-format on - }))); - -// Tests the swizzle operations for spec const vectors. -INSTANTIATE_TEST_CASE_P( - VectorShuffle, FoldSpecConstantOpAndCompositePassTest, - ::testing::ValuesIn(std::vector< - FoldSpecConstantOpAndCompositePassTestCase>({ - // clang-format off - // normal vector - { - // original - { - "%xy = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %v4int_0_1_2_3 0 1", - "%yz = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %v4int_0_1_2_3 1 2", - "%zw = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %v4int_0_1_2_3 2 3", - "%wx = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %v4int_0_1_2_3 3 0", - "%xx = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %v4int_0_1_2_3 0 0", - "%yyy = OpSpecConstantOp %v3int VectorShuffle %v4int_0_1_2_3 %v4int_0_1_2_3 1 1 1", - "%wwww = OpSpecConstantOp %v4int VectorShuffle %v4int_0_1_2_3 %v4int_0_1_2_3 2 2 2 2", - }, - // expected - { - "%xy = OpConstantComposite %v2int %signed_zero %signed_one", - "%yz = OpConstantComposite %v2int %signed_one %signed_two", - "%zw = OpConstantComposite %v2int %signed_two %signed_three", - "%wx = OpConstantComposite %v2int %signed_three %signed_zero", - "%xx = OpConstantComposite %v2int %signed_zero %signed_zero", - "%yyy = OpConstantComposite %v3int %signed_one %signed_one %signed_one", - "%wwww = OpConstantComposite %v4int %signed_two %signed_two %signed_two %signed_two", - }, - }, - // null vector - { - // original - { - "%a = OpSpecConstantOp %v2int VectorShuffle %signed_null_vec %v4int_0_1_2_3 0 1", - "%b = OpSpecConstantOp %v2int VectorShuffle %signed_null_vec %v4int_0_1_2_3 2 3", - "%c = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %signed_null_vec 3 4", - "%d = OpSpecConstantOp %v2int VectorShuffle %signed_null_vec %signed_null_vec 1 2", - }, - // expected - { - "%60 = OpConstantNull %int", - "%a = OpConstantComposite %v2int %60 %60", - "%62 = OpConstantNull %int", - "%b = OpConstantComposite %v2int %signed_zero %signed_one", - "%64 = OpConstantNull %int", - "%c = OpConstantComposite %v2int %signed_three %64", - "%66 = OpConstantNull %int", - "%d = OpConstantComposite %v2int %66 %66", - } - }, - // skip if any of the components of the vector operands do not have - // determined value, even though the result vector might not be - // built with those undermined values. - { - // original - { - "%spec_int = OpSpecConstant %int 1", - "%spec_ivec = OpSpecConstantComposite %v2int %signed_null %spec_int", - "%a = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %spec_ivec 0 1", - "%b = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %spec_ivec 3 4", - }, - // expected - { - "%spec_int = OpSpecConstant %int 1", - "%spec_ivec = OpSpecConstantComposite %v2int %signed_null %spec_int", - "%a = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %spec_ivec 0 1", - "%b = OpSpecConstantOp %v2int VectorShuffle %v4int_0_1_2_3 %spec_ivec 3 4", - }, - }, - // Skip if any components of the two vector operands depend on - // the result of OpUndef. Even though the selected components do - // not depend on the OpUndef result. - { - // original - { - "%undef = OpUndef %int", - "%vec_1 = OpConstantComposite %v2int %undef %signed_one", - "%dep = OpSpecConstantOp %v2int VectorShuffle %vec_1 %signed_three_vec 0 3", - "%not_dep_element = OpSpecConstantOp %v2int VectorShuffle %vec_1 %signed_three_vec 1 3", - "%no_dep_vector = OpSpecConstantOp %v2int VectorShuffle %vec_1 %signed_three_vec 2 3", - }, - // expected - { - "%undef = OpUndef %int", - "%vec_1 = OpConstantComposite %v2int %undef %signed_one", - "%dep = OpSpecConstantOp %v2int VectorShuffle %vec_1 %signed_three_vec 0 3", - "%not_dep_element = OpSpecConstantOp %v2int VectorShuffle %vec_1 %signed_three_vec 1 3", - "%no_dep_vector = OpSpecConstantOp %v2int VectorShuffle %vec_1 %signed_three_vec 2 3", - }, - }, - // clang-format on - }))); - -// Test with long use-def chain. -INSTANTIATE_TEST_CASE_P( - LongDefUseChain, FoldSpecConstantOpAndCompositePassTest, - ::testing::ValuesIn(std::vector< - FoldSpecConstantOpAndCompositePassTestCase>({ - // clang-format off - // Long Def-Use chain with binary operations. - { - // original - { - "%array_size = OpConstant %int 4", - "%type_arr_int_4 = OpTypeArray %int %array_size", - "%spec_int_0 = OpConstant %int 100", - "%spec_int_1 = OpConstant %int 1", - "%spec_int_2 = OpSpecConstantOp %int IAdd %spec_int_0 %spec_int_1", - "%spec_int_3 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_2", - "%spec_int_4 = OpSpecConstantOp %int IAdd %spec_int_0 %spec_int_3", - "%spec_int_5 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_4", - "%spec_int_6 = OpSpecConstantOp %int IAdd %spec_int_0 %spec_int_5", - "%spec_int_7 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_6", - "%spec_int_8 = OpSpecConstantOp %int IAdd %spec_int_0 %spec_int_7", - "%spec_int_9 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_8", - "%spec_int_10 = OpSpecConstantOp %int IAdd %spec_int_0 %spec_int_9", - "%spec_int_11 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_10", - "%spec_int_12 = OpSpecConstantOp %int IAdd %spec_int_0 %spec_int_11", - "%spec_int_13 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_12", - "%spec_int_14 = OpSpecConstantOp %int IAdd %spec_int_0 %spec_int_13", - "%spec_int_15 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_14", - "%spec_int_16 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_15", - "%spec_int_17 = OpSpecConstantOp %int IAdd %spec_int_0 %spec_int_16", - "%spec_int_18 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_17", - "%spec_int_19 = OpSpecConstantOp %int IAdd %spec_int_0 %spec_int_18", - "%spec_int_20 = OpSpecConstantOp %int ISub %spec_int_0 %spec_int_19", - "%used_vec_a = OpSpecConstantComposite %v2int %spec_int_18 %spec_int_19", - "%used_vec_b = OpSpecConstantOp %v2int IMul %used_vec_a %used_vec_a", - "%spec_int_21 = OpSpecConstantOp %int CompositeExtract %used_vec_b 0", - "%array = OpConstantComposite %type_arr_int_4 %spec_int_20 %spec_int_20 %spec_int_21 %spec_int_21", - // Spec constants whose values can not be fully resolved should - // not be processed. - "%spec_int_22 = OpSpecConstant %int 123", - "%spec_int_23 = OpSpecConstantOp %int IAdd %spec_int_22 %signed_one", - }, - // expected - { - "%array_size = OpConstant %int 4", - "%type_arr_int_4 = OpTypeArray %int %array_size", - "%spec_int_0 = OpConstant %int 100", - "%spec_int_1 = OpConstant %int 1", - "%spec_int_2 = OpConstant %int 101", - "%spec_int_3 = OpConstant %int -1", - "%spec_int_4 = OpConstant %int 99", - "%spec_int_5 = OpConstant %int 1", - "%spec_int_6 = OpConstant %int 101", - "%spec_int_7 = OpConstant %int -1", - "%spec_int_8 = OpConstant %int 99", - "%spec_int_9 = OpConstant %int 1", - "%spec_int_10 = OpConstant %int 101", - "%spec_int_11 = OpConstant %int -1", - "%spec_int_12 = OpConstant %int 99", - "%spec_int_13 = OpConstant %int 1", - "%spec_int_14 = OpConstant %int 101", - "%spec_int_15 = OpConstant %int -1", - "%spec_int_16 = OpConstant %int 101", - "%spec_int_17 = OpConstant %int 201", - "%spec_int_18 = OpConstant %int -101", - "%spec_int_19 = OpConstant %int -1", - "%spec_int_20 = OpConstant %int 101", - "%used_vec_a = OpConstantComposite %v2int %spec_int_18 %spec_int_19", - "%int_10201 = OpConstant %int 10201", - "%int_1 = OpConstant %int 1", - "%used_vec_b = OpConstantComposite %v2int %int_10201 %int_1", - "%spec_int_21 = OpConstant %int 10201", - "%array = OpConstantComposite %type_arr_int_4 %spec_int_20 %spec_int_20 %spec_int_21 %spec_int_21", - "%spec_int_22 = OpSpecConstant %int 123", - "%spec_int_23 = OpSpecConstantOp %int IAdd %spec_int_22 %signed_one", - }, - }, - // Long Def-Use chain with swizzle - }))); -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/freeze_spec_const_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/freeze_spec_const_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/freeze_spec_const_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/freeze_spec_const_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,128 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "pass_fixture.h" -#include "pass_utils.h" - -#include -#include -#include - -namespace { - -using namespace spvtools; - -struct FreezeSpecConstantValueTypeTestCase { - const char* type_decl; - const char* spec_const; - const char* expected_frozen_const; -}; - -using FreezeSpecConstantValueTypeTest = - PassTest<::testing::TestWithParam>; - -TEST_P(FreezeSpecConstantValueTypeTest, PrimaryType) { - auto& test_case = GetParam(); - std::vector text = {"OpCapability Shader", - "OpMemoryModel Logical GLSL450", - test_case.type_decl, test_case.spec_const}; - std::vector expected = { - "OpCapability Shader", "OpMemoryModel Logical GLSL450", - test_case.type_decl, test_case.expected_frozen_const}; - SinglePassRunAndCheck( - JoinAllInsts(text), JoinAllInsts(expected), /* skip_nop = */ false); -} - -// Test each primary type. -INSTANTIATE_TEST_CASE_P( - PrimaryTypeSpecConst, FreezeSpecConstantValueTypeTest, - ::testing::ValuesIn(std::vector({ - // Type declaration, original spec constant definition, expected frozen - // spec constants. - {"%int = OpTypeInt 32 1", "%2 = OpSpecConstant %int 1", - "%int_1 = OpConstant %int 1"}, - {"%uint = OpTypeInt 32 0", "%2 = OpSpecConstant %uint 1", - "%uint_1 = OpConstant %uint 1"}, - {"%float = OpTypeFloat 32", "%2 = OpSpecConstant %float 3.14", - "%float_3_14 = OpConstant %float 3.14"}, - {"%double = OpTypeFloat 64", "%2 = OpSpecConstant %double 3.1415926", - "%double_3_1415926 = OpConstant %double 3.1415926"}, - {"%bool = OpTypeBool", "%2 = OpSpecConstantTrue %bool", - "%true = OpConstantTrue %bool"}, - {"%bool = OpTypeBool", "%2 = OpSpecConstantFalse %bool", - "%false = OpConstantFalse %bool"}, - }))); - -using FreezeSpecConstantValueRemoveDecorationTest = PassTest<::testing::Test>; - -TEST_F(FreezeSpecConstantValueRemoveDecorationTest, - RemoveDecorationInstWithSpecId) { - std::vector text = { - // clang-format off - "OpCapability Shader", - "OpCapability Float64", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %main \"main\"", - "OpSource GLSL 450", - "OpSourceExtension \"GL_GOOGLE_cpp_style_line_directive\"", - "OpSourceExtension \"GL_GOOGLE_include_directive\"", - "OpName %main \"main\"", - "OpDecorate %3 SpecId 200", - "OpDecorate %4 SpecId 201", - "OpDecorate %5 SpecId 202", - "OpDecorate %6 SpecId 203", - "%void = OpTypeVoid", - "%8 = OpTypeFunction %void", - "%int = OpTypeInt 32 1", - "%3 = OpSpecConstant %int 3", - "%float = OpTypeFloat 32", - "%4 = OpSpecConstant %float 3.14", - "%double = OpTypeFloat 64", - "%5 = OpSpecConstant %double 3.14159265358979", - "%bool = OpTypeBool", - "%6 = OpSpecConstantTrue %bool", - "%13 = OpSpecConstantFalse %bool", - "%main = OpFunction %void None %8", - "%14 = OpLabel", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - std::string expected_disassembly = SelectiveJoin(text, [](const char* line) { - return std::string(line).find("SpecId") != std::string::npos; - }); - std::vector> replacement_pairs = { - {"%3 = OpSpecConstant %int 3", "%int_3 = OpConstant %int 3"}, - {"%4 = OpSpecConstant %float 3.14", - "%float_3_14 = OpConstant %float 3.14"}, - {"%5 = OpSpecConstant %double 3.14159265358979", - "%double_3_14159265358979 = OpConstant %double 3.14159265358979"}, - {"%6 = OpSpecConstantTrue ", "%true = OpConstantTrue "}, - {"%13 = OpSpecConstantFalse ", "%false = OpConstantFalse "}, - }; - for (auto& p : replacement_pairs) { - EXPECT_TRUE(FindAndReplace(&expected_disassembly, p.first, p.second)) - << "text:\n" - << expected_disassembly << "\n" - << "find_str:\n" - << p.first << "\n" - << "replace_str:\n" - << p.second << "\n"; - } - SinglePassRunAndCheck( - JoinAllInsts(text), expected_disassembly, - /* skip_nop = */ true); -} -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/inline_opaque_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/inline_opaque_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/inline_opaque_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/inline_opaque_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,412 +0,0 @@ -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; - -using InlineOpaqueTest = PassTest<::testing::Test>; - -TEST_F(InlineOpaqueTest, InlineCallWithStructArgContainingSampledImage) { - // Function with opaque argument is inlined. - // TODO(greg-lunarg): Add HLSL code - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %outColor %texCoords -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpMemberName %S_t 2 "smp" -OpName %foo_struct_S_t_vf2_vf21_ "foo(struct-S_t-vf2-vf21;" -OpName %s "s" -OpName %outColor "outColor" -OpName %sampler15 "sampler15" -OpName %s0 "s0" -OpName %texCoords "texCoords" -OpName %param "param" -OpDecorate %sampler15 DescriptorSet 0 -%void = OpTypeVoid -%12 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v2float = OpTypeVector %float 2 -%v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%outColor = OpVariable %_ptr_Output_v4float Output -%17 = OpTypeImage %float 2D 0 0 0 1 Unknown -%18 = OpTypeSampledImage %17 -%S_t = OpTypeStruct %v2float %v2float %18 -%_ptr_Function_S_t = OpTypePointer Function %S_t -%20 = OpTypeFunction %void %_ptr_Function_S_t -%_ptr_UniformConstant_18 = OpTypePointer UniformConstant %18 -%_ptr_Function_18 = OpTypePointer Function %18 -%sampler15 = OpVariable %_ptr_UniformConstant_18 UniformConstant -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%int_2 = OpConstant %int 2 -%_ptr_Function_v2float = OpTypePointer Function %v2float -%_ptr_Input_v2float = OpTypePointer Input %v2float -%texCoords = OpVariable %_ptr_Input_v2float Input -)"; - - const std::string before = - R"(%main = OpFunction %void None %12 -%28 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%param = OpVariable %_ptr_Function_S_t Function -%29 = OpLoad %v2float %texCoords -%30 = OpAccessChain %_ptr_Function_v2float %s0 %int_0 -OpStore %30 %29 -%31 = OpLoad %18 %sampler15 -%32 = OpAccessChain %_ptr_Function_18 %s0 %int_2 -OpStore %32 %31 -%33 = OpLoad %S_t %s0 -OpStore %param %33 -%34 = OpFunctionCall %void %foo_struct_S_t_vf2_vf21_ %param -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %12 -%28 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%param = OpVariable %_ptr_Function_S_t Function -%29 = OpLoad %v2float %texCoords -%30 = OpAccessChain %_ptr_Function_v2float %s0 %int_0 -OpStore %30 %29 -%31 = OpLoad %18 %sampler15 -%32 = OpAccessChain %_ptr_Function_18 %s0 %int_2 -OpStore %32 %31 -%33 = OpLoad %S_t %s0 -OpStore %param %33 -%41 = OpAccessChain %_ptr_Function_18 %param %int_2 -%42 = OpLoad %18 %41 -%43 = OpAccessChain %_ptr_Function_v2float %param %int_0 -%44 = OpLoad %v2float %43 -%45 = OpImageSampleImplicitLod %v4float %42 %44 -OpStore %outColor %45 -OpReturn -OpFunctionEnd -)"; - - const std::string post_defs = - R"(%foo_struct_S_t_vf2_vf21_ = OpFunction %void None %20 -%s = OpFunctionParameter %_ptr_Function_S_t -%35 = OpLabel -%36 = OpAccessChain %_ptr_Function_18 %s %int_2 -%37 = OpLoad %18 %36 -%38 = OpAccessChain %_ptr_Function_v2float %s %int_0 -%39 = OpLoad %v2float %38 -%40 = OpImageSampleImplicitLod %v4float %37 %39 -OpStore %outColor %40 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before + post_defs, - predefs + after + post_defs, true, true); -} - -TEST_F(InlineOpaqueTest, InlineOpaqueReturn) { - // Function with opaque return value is inlined. - // TODO(greg-lunarg): Add HLSL code - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %texCoords %outColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %foo_ "foo(" -OpName %texCoords "texCoords" -OpName %outColor "outColor" -OpName %sampler15 "sampler15" -OpName %sampler16 "sampler16" -OpDecorate %sampler15 DescriptorSet 0 -OpDecorate %sampler16 DescriptorSet 0 -%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v2float = OpTypeVector %float 2 -%bool = OpTypeBool -%false = OpConstantFalse %bool -%_ptr_Input_v2float = OpTypePointer Input %v2float -%texCoords = OpVariable %_ptr_Input_v2float Input -%float_0 = OpConstant %float 0 -%16 = OpConstantComposite %v2float %float_0 %float_0 -%v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%outColor = OpVariable %_ptr_Output_v4float Output -%19 = OpTypeImage %float 2D 0 0 0 1 Unknown -%20 = OpTypeSampledImage %19 -%21 = OpTypeFunction %20 -%_ptr_UniformConstant_20 = OpTypePointer UniformConstant %20 -%_ptr_Function_20 = OpTypePointer Function %20 -%sampler15 = OpVariable %_ptr_UniformConstant_20 UniformConstant -%sampler16 = OpVariable %_ptr_UniformConstant_20 UniformConstant -)"; - - const std::string before = - R"(%main = OpFunction %void None %9 -%24 = OpLabel -%25 = OpVariable %_ptr_Function_20 Function -%26 = OpFunctionCall %20 %foo_ -OpStore %25 %26 -%27 = OpLoad %20 %25 -%28 = OpLoad %v2float %texCoords -%29 = OpImageSampleImplicitLod %v4float %27 %28 -OpStore %outColor %29 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %9 -%24 = OpLabel -%34 = OpVariable %_ptr_Function_20 Function -%35 = OpVariable %_ptr_Function_20 Function -%25 = OpVariable %_ptr_Function_20 Function -%36 = OpLoad %20 %sampler16 -OpStore %34 %36 -%37 = OpLoad %20 %34 -OpStore %35 %37 -%26 = OpLoad %20 %35 -OpStore %25 %26 -%27 = OpLoad %20 %25 -%28 = OpLoad %v2float %texCoords -%29 = OpImageSampleImplicitLod %v4float %27 %28 -OpStore %outColor %29 -OpReturn -OpFunctionEnd -)"; - - const std::string post_defs = - R"(%foo_ = OpFunction %20 None %21 -%30 = OpLabel -%31 = OpVariable %_ptr_Function_20 Function -%32 = OpLoad %20 %sampler16 -OpStore %31 %32 -%33 = OpLoad %20 %31 -OpReturnValue %33 -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before + post_defs, - predefs + after + post_defs, true, true); -} - -TEST_F(InlineOpaqueTest, InlineInNonEntryPointFunction) { - // This demonstrates opaque inlining in a function that is not - // an entry point function (main2) but is in the call tree of an - // entry point function (main). - // TODO(greg-lunarg): Add HLSL code - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %outColor %texCoords -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %main2 "main2" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpMemberName %S_t 2 "smp" -OpName %foo_struct_S_t_vf2_vf21_ "foo(struct-S_t-vf2-vf21;" -OpName %s "s" -OpName %outColor "outColor" -OpName %sampler15 "sampler15" -OpName %s0 "s0" -OpName %texCoords "texCoords" -OpName %param "param" -OpDecorate %sampler15 DescriptorSet 0 -%void = OpTypeVoid -%13 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v2float = OpTypeVector %float 2 -%v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%outColor = OpVariable %_ptr_Output_v4float Output -%18 = OpTypeImage %float 2D 0 0 0 1 Unknown -%19 = OpTypeSampledImage %18 -%S_t = OpTypeStruct %v2float %v2float %19 -%_ptr_Function_S_t = OpTypePointer Function %S_t -%21 = OpTypeFunction %void %_ptr_Function_S_t -%_ptr_UniformConstant_19 = OpTypePointer UniformConstant %19 -%_ptr_Function_19 = OpTypePointer Function %19 -%sampler15 = OpVariable %_ptr_UniformConstant_19 UniformConstant -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%int_2 = OpConstant %int 2 -%_ptr_Function_v2float = OpTypePointer Function %v2float -%_ptr_Input_v2float = OpTypePointer Input %v2float -%texCoords = OpVariable %_ptr_Input_v2float Input -)"; - - const std::string before = - R"(%main2 = OpFunction %void None %13 -%29 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%param = OpVariable %_ptr_Function_S_t Function -%30 = OpLoad %v2float %texCoords -%31 = OpAccessChain %_ptr_Function_v2float %s0 %int_0 -OpStore %31 %30 -%32 = OpLoad %19 %sampler15 -%33 = OpAccessChain %_ptr_Function_19 %s0 %int_2 -OpStore %33 %32 -%34 = OpLoad %S_t %s0 -OpStore %param %34 -%35 = OpFunctionCall %void %foo_struct_S_t_vf2_vf21_ %param -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main2 = OpFunction %void None %13 -%29 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%param = OpVariable %_ptr_Function_S_t Function -%30 = OpLoad %v2float %texCoords -%31 = OpAccessChain %_ptr_Function_v2float %s0 %int_0 -OpStore %31 %30 -%32 = OpLoad %19 %sampler15 -%33 = OpAccessChain %_ptr_Function_19 %s0 %int_2 -OpStore %33 %32 -%34 = OpLoad %S_t %s0 -OpStore %param %34 -%44 = OpAccessChain %_ptr_Function_19 %param %int_2 -%45 = OpLoad %19 %44 -%46 = OpAccessChain %_ptr_Function_v2float %param %int_0 -%47 = OpLoad %v2float %46 -%48 = OpImageSampleImplicitLod %v4float %45 %47 -OpStore %outColor %48 -OpReturn -OpFunctionEnd -)"; - - const std::string post_defs = - R"(%main = OpFunction %void None %13 -%36 = OpLabel -%37 = OpFunctionCall %void %main2 -OpReturn -OpFunctionEnd -%foo_struct_S_t_vf2_vf21_ = OpFunction %void None %21 -%s = OpFunctionParameter %_ptr_Function_S_t -%38 = OpLabel -%39 = OpAccessChain %_ptr_Function_19 %s %int_2 -%40 = OpLoad %19 %39 -%41 = OpAccessChain %_ptr_Function_v2float %s %int_0 -%42 = OpLoad %v2float %41 -%43 = OpImageSampleImplicitLod %v4float %40 %42 -OpStore %outColor %43 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before + post_defs, - predefs + after + post_defs, true, true); -} - -TEST_F(InlineOpaqueTest, NoInlineNoOpaque) { - // Function without opaque interface is not inlined. - // #version 140 - // - // in vec4 BaseColor; - // - // float foo(vec4 bar) - // { - // return bar.x + bar.y; - // } - // - // void main() - // { - // vec4 color = vec4(foo(BaseColor)); - // gl_FragColor = color; - // } - - const std::string assembly = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %foo_vf4_ "foo(vf4;" -OpName %bar "bar" -OpName %color "color" -OpName %BaseColor "BaseColor" -OpName %param "param" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%10 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%14 = OpTypeFunction %float %_ptr_Function_v4float -%uint = OpTypeInt 32 0 -%uint_0 = OpConstant %uint 0 -%_ptr_Function_float = OpTypePointer Function %float -%uint_1 = OpConstant %uint 1 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%main = OpFunction %void None %10 -%21 = OpLabel -%color = OpVariable %_ptr_Function_v4float Function -%param = OpVariable %_ptr_Function_v4float Function -%22 = OpLoad %v4float %BaseColor -OpStore %param %22 -%23 = OpFunctionCall %float %foo_vf4_ %param -%24 = OpCompositeConstruct %v4float %23 %23 %23 %23 -OpStore %color %24 -%25 = OpLoad %v4float %color -OpStore %gl_FragColor %25 -OpReturn -OpFunctionEnd -%foo_vf4_ = OpFunction %float None %14 -%bar = OpFunctionParameter %_ptr_Function_v4float -%26 = OpLabel -%27 = OpAccessChain %_ptr_Function_float %bar %uint_0 -%28 = OpLoad %float %27 -%29 = OpAccessChain %_ptr_Function_float %bar %uint_1 -%30 = OpLoad %float %29 -%31 = OpFAdd %float %28 %30 -OpReturnValue %31 -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - assembly, assembly, true, true); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/inline_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/inline_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/inline_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/inline_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,2274 +0,0 @@ -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; - -using InlineTest = PassTest<::testing::Test>; - -TEST_F(InlineTest, Simple) { - // #version 140 - // - // in vec4 BaseColor; - // - // float foo(vec4 bar) - // { - // return bar.x + bar.y; - // } - // - // void main() - // { - // vec4 color = vec4(foo(BaseColor)); - // gl_FragColor = color; - // } - const std::vector predefs = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Fragment %main \"main\" %BaseColor %gl_FragColor", - "OpExecutionMode %main OriginUpperLeft", - "OpSource GLSL 140", - "OpName %main \"main\"", - "OpName %foo_vf4_ \"foo(vf4;\"", - "OpName %bar \"bar\"", - "OpName %color \"color\"", - "OpName %BaseColor \"BaseColor\"", - "OpName %param \"param\"", - "OpName %gl_FragColor \"gl_FragColor\"", - "%void = OpTypeVoid", - "%10 = OpTypeFunction %void", - "%float = OpTypeFloat 32", - "%v4float = OpTypeVector %float 4", -"%_ptr_Function_v4float = OpTypePointer Function %v4float", - "%14 = OpTypeFunction %float %_ptr_Function_v4float", - "%uint = OpTypeInt 32 0", - "%uint_0 = OpConstant %uint 0", -"%_ptr_Function_float = OpTypePointer Function %float", - "%uint_1 = OpConstant %uint 1", -"%_ptr_Input_v4float = OpTypePointer Input %v4float", - "%BaseColor = OpVariable %_ptr_Input_v4float Input", -"%_ptr_Output_v4float = OpTypePointer Output %v4float", -"%gl_FragColor = OpVariable %_ptr_Output_v4float Output", - // clang-format on - }; - - const std::vector nonEntryFuncs = { - // clang-format off - "%foo_vf4_ = OpFunction %float None %14", - "%bar = OpFunctionParameter %_ptr_Function_v4float", - "%26 = OpLabel", - "%27 = OpAccessChain %_ptr_Function_float %bar %uint_0", - "%28 = OpLoad %float %27", - "%29 = OpAccessChain %_ptr_Function_float %bar %uint_1", - "%30 = OpLoad %float %29", - "%31 = OpFAdd %float %28 %30", - "OpReturnValue %31", - "OpFunctionEnd", - // clang-format on - }; - - const std::vector before = { - // clang-format off - "%main = OpFunction %void None %10", - "%21 = OpLabel", - "%color = OpVariable %_ptr_Function_v4float Function", - "%param = OpVariable %_ptr_Function_v4float Function", - "%22 = OpLoad %v4float %BaseColor", - "OpStore %param %22", - "%23 = OpFunctionCall %float %foo_vf4_ %param", - "%24 = OpCompositeConstruct %v4float %23 %23 %23 %23", - "OpStore %color %24", - "%25 = OpLoad %v4float %color", - "OpStore %gl_FragColor %25", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - - const std::vector after = { - // clang-format off - "%main = OpFunction %void None %10", - "%21 = OpLabel", - "%32 = OpVariable %_ptr_Function_float Function", - "%color = OpVariable %_ptr_Function_v4float Function", - "%param = OpVariable %_ptr_Function_v4float Function", - "%22 = OpLoad %v4float %BaseColor", - "OpStore %param %22", - "%33 = OpAccessChain %_ptr_Function_float %param %uint_0", - "%34 = OpLoad %float %33", - "%35 = OpAccessChain %_ptr_Function_float %param %uint_1", - "%36 = OpLoad %float %35", - "%37 = OpFAdd %float %34 %36", - "OpStore %32 %37", - "%23 = OpLoad %float %32", - "%24 = OpCompositeConstruct %v4float %23 %23 %23 %23", - "OpStore %color %24", - "%25 = OpLoad %v4float %color", - "OpStore %gl_FragColor %25", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - SinglePassRunAndCheck( - JoinAllInsts(Concat(Concat(predefs, before), nonEntryFuncs)), - JoinAllInsts(Concat(Concat(predefs, after), nonEntryFuncs)), - /* skip_nop = */ false, /* do_validate = */ true); -} - -TEST_F(InlineTest, Nested) { - // #version 140 - // - // in vec4 BaseColor; - // - // float foo2(float f, float f2) - // { - // return f * f2; - // } - // - // float foo(vec4 bar) - // { - // return foo2(bar.x + bar.y, bar.z); - // } - // - // void main() - // { - // vec4 color = vec4(foo(BaseColor)); - // gl_FragColor = color; - // } - const std::vector predefs = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Fragment %main \"main\" %BaseColor %gl_FragColor", - "OpExecutionMode %main OriginUpperLeft", - "OpSource GLSL 140", - "OpName %main \"main\"", - "OpName %foo2_f1_f1_ \"foo2(f1;f1;\"", - "OpName %f \"f\"", - "OpName %f2 \"f2\"", - "OpName %foo_vf4_ \"foo(vf4;\"", - "OpName %bar \"bar\"", - "OpName %param \"param\"", - "OpName %param_0 \"param\"", - "OpName %color \"color\"", - "OpName %BaseColor \"BaseColor\"", - "OpName %param_1 \"param\"", - "OpName %gl_FragColor \"gl_FragColor\"", - "%void = OpTypeVoid", - "%15 = OpTypeFunction %void", - "%float = OpTypeFloat 32", -"%_ptr_Function_float = OpTypePointer Function %float", - "%18 = OpTypeFunction %float %_ptr_Function_float %_ptr_Function_float", - "%v4float = OpTypeVector %float 4", -"%_ptr_Function_v4float = OpTypePointer Function %v4float", - "%21 = OpTypeFunction %float %_ptr_Function_v4float", - "%uint = OpTypeInt 32 0", - "%uint_0 = OpConstant %uint 0", - "%uint_1 = OpConstant %uint 1", - "%uint_2 = OpConstant %uint 2", -"%_ptr_Input_v4float = OpTypePointer Input %v4float", - "%BaseColor = OpVariable %_ptr_Input_v4float Input", -"%_ptr_Output_v4float = OpTypePointer Output %v4float", -"%gl_FragColor = OpVariable %_ptr_Output_v4float Output", - // clang-format on - }; - - const std::vector nonEntryFuncs = { - // clang-format off -"%foo2_f1_f1_ = OpFunction %float None %18", - "%f = OpFunctionParameter %_ptr_Function_float", - "%f2 = OpFunctionParameter %_ptr_Function_float", - "%33 = OpLabel", - "%34 = OpLoad %float %f", - "%35 = OpLoad %float %f2", - "%36 = OpFMul %float %34 %35", - "OpReturnValue %36", - "OpFunctionEnd", - "%foo_vf4_ = OpFunction %float None %21", - "%bar = OpFunctionParameter %_ptr_Function_v4float", - "%37 = OpLabel", - "%param = OpVariable %_ptr_Function_float Function", - "%param_0 = OpVariable %_ptr_Function_float Function", - "%38 = OpAccessChain %_ptr_Function_float %bar %uint_0", - "%39 = OpLoad %float %38", - "%40 = OpAccessChain %_ptr_Function_float %bar %uint_1", - "%41 = OpLoad %float %40", - "%42 = OpFAdd %float %39 %41", - "OpStore %param %42", - "%43 = OpAccessChain %_ptr_Function_float %bar %uint_2", - "%44 = OpLoad %float %43", - "OpStore %param_0 %44", - "%45 = OpFunctionCall %float %foo2_f1_f1_ %param %param_0", - "OpReturnValue %45", - "OpFunctionEnd", - // clang-format on - }; - - const std::vector before = { - // clang-format off - "%main = OpFunction %void None %15", - "%28 = OpLabel", - "%color = OpVariable %_ptr_Function_v4float Function", - "%param_1 = OpVariable %_ptr_Function_v4float Function", - "%29 = OpLoad %v4float %BaseColor", - "OpStore %param_1 %29", - "%30 = OpFunctionCall %float %foo_vf4_ %param_1", - "%31 = OpCompositeConstruct %v4float %30 %30 %30 %30", - "OpStore %color %31", - "%32 = OpLoad %v4float %color", - "OpStore %gl_FragColor %32", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - - const std::vector after = { - // clang-format off - "%main = OpFunction %void None %15", - "%28 = OpLabel", - "%57 = OpVariable %_ptr_Function_float Function", - "%46 = OpVariable %_ptr_Function_float Function", - "%47 = OpVariable %_ptr_Function_float Function", - "%48 = OpVariable %_ptr_Function_float Function", - "%color = OpVariable %_ptr_Function_v4float Function", - "%param_1 = OpVariable %_ptr_Function_v4float Function", - "%29 = OpLoad %v4float %BaseColor", - "OpStore %param_1 %29", - "%49 = OpAccessChain %_ptr_Function_float %param_1 %uint_0", - "%50 = OpLoad %float %49", - "%51 = OpAccessChain %_ptr_Function_float %param_1 %uint_1", - "%52 = OpLoad %float %51", - "%53 = OpFAdd %float %50 %52", - "OpStore %46 %53", - "%54 = OpAccessChain %_ptr_Function_float %param_1 %uint_2", - "%55 = OpLoad %float %54", - "OpStore %47 %55", - "%58 = OpLoad %float %46", - "%59 = OpLoad %float %47", - "%60 = OpFMul %float %58 %59", - "OpStore %57 %60", - "%56 = OpLoad %float %57", - "OpStore %48 %56", - "%30 = OpLoad %float %48", - "%31 = OpCompositeConstruct %v4float %30 %30 %30 %30", - "OpStore %color %31", - "%32 = OpLoad %v4float %color", - "OpStore %gl_FragColor %32", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - SinglePassRunAndCheck( - JoinAllInsts(Concat(Concat(predefs, before), nonEntryFuncs)), - JoinAllInsts(Concat(Concat(predefs, after), nonEntryFuncs)), - /* skip_nop = */ false, /* do_validate = */ true); -} - -TEST_F(InlineTest, InOutParameter) { - // #version 400 - // - // in vec4 Basecolor; - // - // void foo(inout vec4 bar) - // { - // bar.z = bar.x + bar.y; - // } - // - // void main() - // { - // vec4 b = Basecolor; - // foo(b); - // vec4 color = vec4(b.z); - // gl_FragColor = color; - // } - const std::vector predefs = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Fragment %main \"main\" %Basecolor %gl_FragColor", - "OpExecutionMode %main OriginUpperLeft", - "OpSource GLSL 400", - "OpName %main \"main\"", - "OpName %foo_vf4_ \"foo(vf4;\"", - "OpName %bar \"bar\"", - "OpName %b \"b\"", - "OpName %Basecolor \"Basecolor\"", - "OpName %param \"param\"", - "OpName %color \"color\"", - "OpName %gl_FragColor \"gl_FragColor\"", - "%void = OpTypeVoid", - "%11 = OpTypeFunction %void", - "%float = OpTypeFloat 32", - "%v4float = OpTypeVector %float 4", -"%_ptr_Function_v4float = OpTypePointer Function %v4float", - "%15 = OpTypeFunction %void %_ptr_Function_v4float", - "%uint = OpTypeInt 32 0", - "%uint_0 = OpConstant %uint 0", -"%_ptr_Function_float = OpTypePointer Function %float", - "%uint_1 = OpConstant %uint 1", - "%uint_2 = OpConstant %uint 2", -"%_ptr_Input_v4float = OpTypePointer Input %v4float", - "%Basecolor = OpVariable %_ptr_Input_v4float Input", -"%_ptr_Output_v4float = OpTypePointer Output %v4float", -"%gl_FragColor = OpVariable %_ptr_Output_v4float Output", - // clang-format on - }; - - const std::vector nonEntryFuncs = { - // clang-format off - "%foo_vf4_ = OpFunction %void None %15", - "%bar = OpFunctionParameter %_ptr_Function_v4float", - "%32 = OpLabel", - "%33 = OpAccessChain %_ptr_Function_float %bar %uint_0", - "%34 = OpLoad %float %33", - "%35 = OpAccessChain %_ptr_Function_float %bar %uint_1", - "%36 = OpLoad %float %35", - "%37 = OpFAdd %float %34 %36", - "%38 = OpAccessChain %_ptr_Function_float %bar %uint_2", - "OpStore %38 %37", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - - const std::vector before = { - // clang-format off - "%main = OpFunction %void None %11", - "%23 = OpLabel", - "%b = OpVariable %_ptr_Function_v4float Function", - "%param = OpVariable %_ptr_Function_v4float Function", - "%color = OpVariable %_ptr_Function_v4float Function", - "%24 = OpLoad %v4float %Basecolor", - "OpStore %b %24", - "%25 = OpLoad %v4float %b", - "OpStore %param %25", - "%26 = OpFunctionCall %void %foo_vf4_ %param", - "%27 = OpLoad %v4float %param", - "OpStore %b %27", - "%28 = OpAccessChain %_ptr_Function_float %b %uint_2", - "%29 = OpLoad %float %28", - "%30 = OpCompositeConstruct %v4float %29 %29 %29 %29", - "OpStore %color %30", - "%31 = OpLoad %v4float %color", - "OpStore %gl_FragColor %31", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - - const std::vector after = { - // clang-format off - "%main = OpFunction %void None %11", - "%23 = OpLabel", - "%b = OpVariable %_ptr_Function_v4float Function", - "%param = OpVariable %_ptr_Function_v4float Function", - "%color = OpVariable %_ptr_Function_v4float Function", - "%24 = OpLoad %v4float %Basecolor", - "OpStore %b %24", - "%25 = OpLoad %v4float %b", - "OpStore %param %25", - "%39 = OpAccessChain %_ptr_Function_float %param %uint_0", - "%40 = OpLoad %float %39", - "%41 = OpAccessChain %_ptr_Function_float %param %uint_1", - "%42 = OpLoad %float %41", - "%43 = OpFAdd %float %40 %42", - "%44 = OpAccessChain %_ptr_Function_float %param %uint_2", - "OpStore %44 %43", - "%27 = OpLoad %v4float %param", - "OpStore %b %27", - "%28 = OpAccessChain %_ptr_Function_float %b %uint_2", - "%29 = OpLoad %float %28", - "%30 = OpCompositeConstruct %v4float %29 %29 %29 %29", - "OpStore %color %30", - "%31 = OpLoad %v4float %color", - "OpStore %gl_FragColor %31", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - SinglePassRunAndCheck( - JoinAllInsts(Concat(Concat(predefs, before), nonEntryFuncs)), - JoinAllInsts(Concat(Concat(predefs, after), nonEntryFuncs)), - /* skip_nop = */ false, /* do_validate = */ true); -} - -TEST_F(InlineTest, BranchInCallee) { - // #version 140 - // - // in vec4 BaseColor; - // - // float foo(vec4 bar) - // { - // float r = bar.x; - // if (r < 0.0) - // r = -r; - // return r; - // } - // - // void main() - // { - // vec4 color = vec4(foo(BaseColor)); - // - // gl_FragColor = color; - // } - const std::vector predefs = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Fragment %main \"main\" %BaseColor %gl_FragColor", - "OpExecutionMode %main OriginUpperLeft", - "OpSource GLSL 140", - "OpName %main \"main\"", - "OpName %foo_vf4_ \"foo(vf4;\"", - "OpName %bar \"bar\"", - "OpName %r \"r\"", - "OpName %color \"color\"", - "OpName %BaseColor \"BaseColor\"", - "OpName %param \"param\"", - "OpName %gl_FragColor \"gl_FragColor\"", - "%void = OpTypeVoid", - "%11 = OpTypeFunction %void", - "%float = OpTypeFloat 32", - "%v4float = OpTypeVector %float 4", -"%_ptr_Function_v4float = OpTypePointer Function %v4float", - "%15 = OpTypeFunction %float %_ptr_Function_v4float", -"%_ptr_Function_float = OpTypePointer Function %float", - "%uint = OpTypeInt 32 0", - "%uint_0 = OpConstant %uint 0", - "%float_0 = OpConstant %float 0", - "%bool = OpTypeBool", -"%_ptr_Input_v4float = OpTypePointer Input %v4float", - "%BaseColor = OpVariable %_ptr_Input_v4float Input", -"%_ptr_Output_v4float = OpTypePointer Output %v4float", -"%gl_FragColor = OpVariable %_ptr_Output_v4float Output", - // clang-format on - }; - - const std::vector nonEntryFuncs = { - // clang-format off - "%foo_vf4_ = OpFunction %float None %15", - "%bar = OpFunctionParameter %_ptr_Function_v4float", - "%28 = OpLabel", - "%r = OpVariable %_ptr_Function_float Function", - "%29 = OpAccessChain %_ptr_Function_float %bar %uint_0", - "%30 = OpLoad %float %29", - "OpStore %r %30", - "%31 = OpLoad %float %r", - "%32 = OpFOrdLessThan %bool %31 %float_0", - "OpSelectionMerge %33 None", - "OpBranchConditional %32 %34 %33", - "%34 = OpLabel", - "%35 = OpLoad %float %r", - "%36 = OpFNegate %float %35", - "OpStore %r %36", - "OpBranch %33", - "%33 = OpLabel", - "%37 = OpLoad %float %r", - "OpReturnValue %37", - "OpFunctionEnd", - // clang-format on - }; - - const std::vector before = { - // clang-format off - "%main = OpFunction %void None %11", - "%23 = OpLabel", - "%color = OpVariable %_ptr_Function_v4float Function", - "%param = OpVariable %_ptr_Function_v4float Function", - "%24 = OpLoad %v4float %BaseColor", - "OpStore %param %24", - "%25 = OpFunctionCall %float %foo_vf4_ %param", - "%26 = OpCompositeConstruct %v4float %25 %25 %25 %25", - "OpStore %color %26", - "%27 = OpLoad %v4float %color", - "OpStore %gl_FragColor %27", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - - const std::vector after = { - // clang-format off - "%main = OpFunction %void None %11", - "%23 = OpLabel", - "%38 = OpVariable %_ptr_Function_float Function", - "%39 = OpVariable %_ptr_Function_float Function", - "%color = OpVariable %_ptr_Function_v4float Function", - "%param = OpVariable %_ptr_Function_v4float Function", - "%24 = OpLoad %v4float %BaseColor", - "OpStore %param %24", - "%40 = OpAccessChain %_ptr_Function_float %param %uint_0", - "%41 = OpLoad %float %40", - "OpStore %38 %41", - "%42 = OpLoad %float %38", - "%43 = OpFOrdLessThan %bool %42 %float_0", - "OpSelectionMerge %44 None", - "OpBranchConditional %43 %45 %44", - "%45 = OpLabel", - "%46 = OpLoad %float %38", - "%47 = OpFNegate %float %46", - "OpStore %38 %47", - "OpBranch %44", - "%44 = OpLabel", - "%48 = OpLoad %float %38", - "OpStore %39 %48", - "%25 = OpLoad %float %39", - "%26 = OpCompositeConstruct %v4float %25 %25 %25 %25", - "OpStore %color %26", - "%27 = OpLoad %v4float %color", - "OpStore %gl_FragColor %27", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - SinglePassRunAndCheck( - JoinAllInsts(Concat(Concat(predefs, before), nonEntryFuncs)), - JoinAllInsts(Concat(Concat(predefs, after), nonEntryFuncs)), - /* skip_nop = */ false, /* do_validate = */ true); -} - -TEST_F(InlineTest, PhiAfterCall) { - // #version 140 - // - // in vec4 BaseColor; - // - // float foo(float bar) - // { - // float r = bar; - // if (r < 0.0) - // r = -r; - // return r; - // } - // - // void main() - // { - // vec4 color = BaseColor; - // if (foo(color.x) > 2.0 && foo(color.y) > 2.0) - // color = vec4(0.0); - // gl_FragColor = color; - // } - const std::vector predefs = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Fragment %main \"main\" %BaseColor %gl_FragColor", - "OpExecutionMode %main OriginUpperLeft", - "OpSource GLSL 140", - "OpName %main \"main\"", - "OpName %foo_f1_ \"foo(f1;\"", - "OpName %bar \"bar\"", - "OpName %r \"r\"", - "OpName %color \"color\"", - "OpName %BaseColor \"BaseColor\"", - "OpName %param \"param\"", - "OpName %param_0 \"param\"", - "OpName %gl_FragColor \"gl_FragColor\"", - "%void = OpTypeVoid", - "%12 = OpTypeFunction %void", - "%float = OpTypeFloat 32", -"%_ptr_Function_float = OpTypePointer Function %float", - "%15 = OpTypeFunction %float %_ptr_Function_float", - "%float_0 = OpConstant %float 0", - "%bool = OpTypeBool", - "%v4float = OpTypeVector %float 4", -"%_ptr_Function_v4float = OpTypePointer Function %v4float", -"%_ptr_Input_v4float = OpTypePointer Input %v4float", - "%BaseColor = OpVariable %_ptr_Input_v4float Input", - "%uint = OpTypeInt 32 0", - "%uint_0 = OpConstant %uint 0", - "%float_2 = OpConstant %float 2", - "%uint_1 = OpConstant %uint 1", - "%25 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0", -"%_ptr_Output_v4float = OpTypePointer Output %v4float", -"%gl_FragColor = OpVariable %_ptr_Output_v4float Output", - // clang-format on - }; - - const std::vector nonEntryFuncs = { - // clang-format off - "%foo_f1_ = OpFunction %float None %15", - "%bar = OpFunctionParameter %_ptr_Function_float", - "%43 = OpLabel", - "%r = OpVariable %_ptr_Function_float Function", - "%44 = OpLoad %float %bar", - "OpStore %r %44", - "%45 = OpLoad %float %r", - "%46 = OpFOrdLessThan %bool %45 %float_0", - "OpSelectionMerge %47 None", - "OpBranchConditional %46 %48 %47", - "%48 = OpLabel", - "%49 = OpLoad %float %r", - "%50 = OpFNegate %float %49", - "OpStore %r %50", - "OpBranch %47", - "%47 = OpLabel", - "%51 = OpLoad %float %r", - "OpReturnValue %51", - "OpFunctionEnd", - // clang-format on - }; - - const std::vector before = { - // clang-format off - "%main = OpFunction %void None %12", - "%27 = OpLabel", - "%color = OpVariable %_ptr_Function_v4float Function", - "%param = OpVariable %_ptr_Function_float Function", - "%param_0 = OpVariable %_ptr_Function_float Function", - "%28 = OpLoad %v4float %BaseColor", - "OpStore %color %28", - "%29 = OpAccessChain %_ptr_Function_float %color %uint_0", - "%30 = OpLoad %float %29", - "OpStore %param %30", - "%31 = OpFunctionCall %float %foo_f1_ %param", - "%32 = OpFOrdGreaterThan %bool %31 %float_2", - "OpSelectionMerge %33 None", - "OpBranchConditional %32 %34 %33", - "%34 = OpLabel", - "%35 = OpAccessChain %_ptr_Function_float %color %uint_1", - "%36 = OpLoad %float %35", - "OpStore %param_0 %36", - "%37 = OpFunctionCall %float %foo_f1_ %param_0", - "%38 = OpFOrdGreaterThan %bool %37 %float_2", - "OpBranch %33", - "%33 = OpLabel", - "%39 = OpPhi %bool %32 %27 %38 %34", - "OpSelectionMerge %40 None", - "OpBranchConditional %39 %41 %40", - "%41 = OpLabel", - "OpStore %color %25", - "OpBranch %40", - "%40 = OpLabel", - "%42 = OpLoad %v4float %color", - "OpStore %gl_FragColor %42", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - - const std::vector after = { - // clang-format off - "%main = OpFunction %void None %12", - "%27 = OpLabel", - "%62 = OpVariable %_ptr_Function_float Function", - "%63 = OpVariable %_ptr_Function_float Function", - "%52 = OpVariable %_ptr_Function_float Function", - "%53 = OpVariable %_ptr_Function_float Function", - "%color = OpVariable %_ptr_Function_v4float Function", - "%param = OpVariable %_ptr_Function_float Function", - "%param_0 = OpVariable %_ptr_Function_float Function", - "%28 = OpLoad %v4float %BaseColor", - "OpStore %color %28", - "%29 = OpAccessChain %_ptr_Function_float %color %uint_0", - "%30 = OpLoad %float %29", - "OpStore %param %30", - "%54 = OpLoad %float %param", - "OpStore %52 %54", - "%55 = OpLoad %float %52", - "%56 = OpFOrdLessThan %bool %55 %float_0", - "OpSelectionMerge %57 None", - "OpBranchConditional %56 %58 %57", - "%58 = OpLabel", - "%59 = OpLoad %float %52", - "%60 = OpFNegate %float %59", - "OpStore %52 %60", - "OpBranch %57", - "%57 = OpLabel", - "%61 = OpLoad %float %52", - "OpStore %53 %61", - "%31 = OpLoad %float %53", - "%32 = OpFOrdGreaterThan %bool %31 %float_2", - "OpSelectionMerge %33 None", - "OpBranchConditional %32 %34 %33", - "%34 = OpLabel", - "%35 = OpAccessChain %_ptr_Function_float %color %uint_1", - "%36 = OpLoad %float %35", - "OpStore %param_0 %36", - "%64 = OpLoad %float %param_0", - "OpStore %62 %64", - "%65 = OpLoad %float %62", - "%66 = OpFOrdLessThan %bool %65 %float_0", - "OpSelectionMerge %67 None", - "OpBranchConditional %66 %68 %67", - "%68 = OpLabel", - "%69 = OpLoad %float %62", - "%70 = OpFNegate %float %69", - "OpStore %62 %70", - "OpBranch %67", - "%67 = OpLabel", - "%71 = OpLoad %float %62", - "OpStore %63 %71", - "%37 = OpLoad %float %63", - "%38 = OpFOrdGreaterThan %bool %37 %float_2", - "OpBranch %33", - "%33 = OpLabel", - "%39 = OpPhi %bool %32 %57 %38 %67", - "OpSelectionMerge %40 None", - "OpBranchConditional %39 %41 %40", - "%41 = OpLabel", - "OpStore %color %25", - "OpBranch %40", - "%40 = OpLabel", - "%42 = OpLoad %v4float %color", - "OpStore %gl_FragColor %42", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - SinglePassRunAndCheck( - JoinAllInsts(Concat(Concat(predefs, before), nonEntryFuncs)), - JoinAllInsts(Concat(Concat(predefs, after), nonEntryFuncs)), - /* skip_nop = */ false, /* do_validate = */ true); -} - -TEST_F(InlineTest, OpSampledImageOutOfBlock) { - // #version 450 - // - // uniform texture2D t2D; - // uniform sampler samp; - // out vec4 FragColor; - // in vec4 BaseColor; - // - // float foo(vec4 bar) - // { - // float r = bar.x; - // if (r < 0.0) - // r = -r; - // return r; - // } - // - // void main() - // { - // vec4 color1 = texture(sampler2D(t2D, samp), vec2(1.0)); - // vec4 color2 = vec4(foo(BaseColor)); - // vec4 color3 = texture(sampler2D(t2D, samp), vec2(0.5)); - // FragColor = (color1 + color2 + color3)/3; - // } - // - // Note: the before SPIR-V will need to be edited to create a use of - // the OpSampledImage across the function call. - const std::vector predefs = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Fragment %main \"main\" %BaseColor %FragColor", - "OpExecutionMode %main OriginUpperLeft", - "OpSource GLSL 450", - "OpName %main \"main\"", - "OpName %foo_vf4_ \"foo(vf4;\"", - "OpName %bar \"bar\"", - "OpName %r \"r\"", - "OpName %color1 \"color1\"", - "OpName %t2D \"t2D\"", - "OpName %samp \"samp\"", - "OpName %color2 \"color2\"", - "OpName %BaseColor \"BaseColor\"", - "OpName %param \"param\"", - "OpName %color3 \"color3\"", - "OpName %FragColor \"FragColor\"", - "OpDecorate %t2D DescriptorSet 0", - "OpDecorate %samp DescriptorSet 0", - "%void = OpTypeVoid", - "%15 = OpTypeFunction %void", - "%float = OpTypeFloat 32", - "%v4float = OpTypeVector %float 4", -"%_ptr_Function_v4float = OpTypePointer Function %v4float", - "%19 = OpTypeFunction %float %_ptr_Function_v4float", -"%_ptr_Function_float = OpTypePointer Function %float", - "%uint = OpTypeInt 32 0", - "%uint_0 = OpConstant %uint 0", - "%float_0 = OpConstant %float 0", - "%bool = OpTypeBool", - "%25 = OpTypeImage %float 2D 0 0 0 1 Unknown", -"%_ptr_UniformConstant_25 = OpTypePointer UniformConstant %25", - "%t2D = OpVariable %_ptr_UniformConstant_25 UniformConstant", - "%27 = OpTypeSampler", -"%_ptr_UniformConstant_27 = OpTypePointer UniformConstant %27", - "%samp = OpVariable %_ptr_UniformConstant_27 UniformConstant", - "%29 = OpTypeSampledImage %25", - "%v2float = OpTypeVector %float 2", - "%float_1 = OpConstant %float 1", - "%32 = OpConstantComposite %v2float %float_1 %float_1", -"%_ptr_Input_v4float = OpTypePointer Input %v4float", - "%BaseColor = OpVariable %_ptr_Input_v4float Input", - "%float_0_5 = OpConstant %float 0.5", - "%35 = OpConstantComposite %v2float %float_0_5 %float_0_5", -"%_ptr_Output_v4float = OpTypePointer Output %v4float", - "%FragColor = OpVariable %_ptr_Output_v4float Output", - "%float_3 = OpConstant %float 3", - // clang-format on - }; - - const std::vector nonEntryFuncs = { - // clang-format off - "%foo_vf4_ = OpFunction %float None %19", - "%bar = OpFunctionParameter %_ptr_Function_v4float", - "%56 = OpLabel", - "%r = OpVariable %_ptr_Function_float Function", - "%57 = OpAccessChain %_ptr_Function_float %bar %uint_0", - "%58 = OpLoad %float %57", - "OpStore %r %58", - "%59 = OpLoad %float %r", - "%60 = OpFOrdLessThan %bool %59 %float_0", - "OpSelectionMerge %61 None", - "OpBranchConditional %60 %62 %61", - "%62 = OpLabel", - "%63 = OpLoad %float %r", - "%64 = OpFNegate %float %63", - "OpStore %r %64", - "OpBranch %61", - "%61 = OpLabel", - "%65 = OpLoad %float %r", - "OpReturnValue %65", - "OpFunctionEnd", - // clang-format on - }; - - const std::vector before = { - // clang-format off - "%main = OpFunction %void None %15", - "%38 = OpLabel", - "%color1 = OpVariable %_ptr_Function_v4float Function", - "%color2 = OpVariable %_ptr_Function_v4float Function", - "%param = OpVariable %_ptr_Function_v4float Function", - "%color3 = OpVariable %_ptr_Function_v4float Function", - "%39 = OpLoad %25 %t2D", - "%40 = OpLoad %27 %samp", - "%41 = OpSampledImage %29 %39 %40", - "%42 = OpImageSampleImplicitLod %v4float %41 %32", - "OpStore %color1 %42", - "%43 = OpLoad %v4float %BaseColor", - "OpStore %param %43", - "%44 = OpFunctionCall %float %foo_vf4_ %param", - "%45 = OpCompositeConstruct %v4float %44 %44 %44 %44", - "OpStore %color2 %45", - "%46 = OpLoad %25 %t2D", - "%47 = OpLoad %27 %samp", - "%48 = OpImageSampleImplicitLod %v4float %41 %35", - "OpStore %color3 %48", - "%49 = OpLoad %v4float %color1", - "%50 = OpLoad %v4float %color2", - "%51 = OpFAdd %v4float %49 %50", - "%52 = OpLoad %v4float %color3", - "%53 = OpFAdd %v4float %51 %52", - "%54 = OpCompositeConstruct %v4float %float_3 %float_3 %float_3 %float_3", - "%55 = OpFDiv %v4float %53 %54", - "OpStore %FragColor %55", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - - const std::vector after = { - // clang-format off - "%main = OpFunction %void None %15", - "%38 = OpLabel", - "%66 = OpVariable %_ptr_Function_float Function", - "%67 = OpVariable %_ptr_Function_float Function", - "%color1 = OpVariable %_ptr_Function_v4float Function", - "%color2 = OpVariable %_ptr_Function_v4float Function", - "%param = OpVariable %_ptr_Function_v4float Function", - "%color3 = OpVariable %_ptr_Function_v4float Function", - "%39 = OpLoad %25 %t2D", - "%40 = OpLoad %27 %samp", - "%41 = OpSampledImage %29 %39 %40", - "%42 = OpImageSampleImplicitLod %v4float %41 %32", - "OpStore %color1 %42", - "%43 = OpLoad %v4float %BaseColor", - "OpStore %param %43", - "%68 = OpAccessChain %_ptr_Function_float %param %uint_0", - "%69 = OpLoad %float %68", - "OpStore %66 %69", - "%70 = OpLoad %float %66", - "%71 = OpFOrdLessThan %bool %70 %float_0", - "OpSelectionMerge %72 None", - "OpBranchConditional %71 %73 %72", - "%73 = OpLabel", - "%74 = OpLoad %float %66", - "%75 = OpFNegate %float %74", - "OpStore %66 %75", - "OpBranch %72", - "%72 = OpLabel", - "%76 = OpLoad %float %66", - "OpStore %67 %76", - "%44 = OpLoad %float %67", - "%45 = OpCompositeConstruct %v4float %44 %44 %44 %44", - "OpStore %color2 %45", - "%46 = OpLoad %25 %t2D", - "%47 = OpLoad %27 %samp", - "%77 = OpSampledImage %29 %39 %40", - "%48 = OpImageSampleImplicitLod %v4float %77 %35", - "OpStore %color3 %48", - "%49 = OpLoad %v4float %color1", - "%50 = OpLoad %v4float %color2", - "%51 = OpFAdd %v4float %49 %50", - "%52 = OpLoad %v4float %color3", - "%53 = OpFAdd %v4float %51 %52", - "%54 = OpCompositeConstruct %v4float %float_3 %float_3 %float_3 %float_3", - "%55 = OpFDiv %v4float %53 %54", - "OpStore %FragColor %55", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - SinglePassRunAndCheck( - JoinAllInsts(Concat(Concat(predefs, before), nonEntryFuncs)), - JoinAllInsts(Concat(Concat(predefs, after), nonEntryFuncs)), - /* skip_nop = */ false, /* do_validate = */ true); -} - -TEST_F(InlineTest, OpImageOutOfBlock) { - // #version 450 - // - // uniform texture2D t2D; - // uniform sampler samp; - // uniform sampler samp2; - // - // out vec4 FragColor; - // - // in vec4 BaseColor; - // - // float foo(vec4 bar) - // { - // float r = bar.x; - // if (r < 0.0) - // r = -r; - // return r; - // } - // - // void main() - // { - // vec4 color1 = texture(sampler2D(t2D, samp), vec2(1.0)); - // vec4 color2 = vec4(foo(BaseColor)); - // vec4 color3 = texture(sampler2D(t2D, samp2), vec2(0.5)); - // FragColor = (color1 + color2 + color3)/3; - // } - // Note: the before SPIR-V will need to be edited to create an OpImage - // from the first OpSampledImage, place it before the call and use it - // in the second OpSampledImage following the call. - const std::vector predefs = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Fragment %main \"main\" %BaseColor %FragColor", - "OpExecutionMode %main OriginUpperLeft", - "OpSource GLSL 450", - "OpName %main \"main\"", - "OpName %foo_vf4_ \"foo(vf4;\"", - "OpName %bar \"bar\"", - "OpName %r \"r\"", - "OpName %color1 \"color1\"", - "OpName %t2D \"t2D\"", - "OpName %samp \"samp\"", - "OpName %color2 \"color2\"", - "OpName %BaseColor \"BaseColor\"", - "OpName %param \"param\"", - "OpName %color3 \"color3\"", - "OpName %samp2 \"samp2\"", - "OpName %FragColor \"FragColor\"", - "OpDecorate %t2D DescriptorSet 0", - "OpDecorate %samp DescriptorSet 0", - "OpDecorate %samp2 DescriptorSet 0", - "%void = OpTypeVoid", - "%16 = OpTypeFunction %void", - "%float = OpTypeFloat 32", - "%v4float = OpTypeVector %float 4", -"%_ptr_Function_v4float = OpTypePointer Function %v4float", - "%20 = OpTypeFunction %float %_ptr_Function_v4float", -"%_ptr_Function_float = OpTypePointer Function %float", - "%uint = OpTypeInt 32 0", - "%uint_0 = OpConstant %uint 0", - "%float_0 = OpConstant %float 0", - "%bool = OpTypeBool", - "%26 = OpTypeImage %float 2D 0 0 0 1 Unknown", -"%_ptr_UniformConstant_26 = OpTypePointer UniformConstant %26", - "%t2D = OpVariable %_ptr_UniformConstant_26 UniformConstant", - "%28 = OpTypeSampler", -"%_ptr_UniformConstant_28 = OpTypePointer UniformConstant %28", - "%samp = OpVariable %_ptr_UniformConstant_28 UniformConstant", - "%30 = OpTypeSampledImage %26", - "%v2float = OpTypeVector %float 2", - "%float_1 = OpConstant %float 1", - "%33 = OpConstantComposite %v2float %float_1 %float_1", -"%_ptr_Input_v4float = OpTypePointer Input %v4float", - "%BaseColor = OpVariable %_ptr_Input_v4float Input", - "%samp2 = OpVariable %_ptr_UniformConstant_28 UniformConstant", - "%float_0_5 = OpConstant %float 0.5", - "%36 = OpConstantComposite %v2float %float_0_5 %float_0_5", -"%_ptr_Output_v4float = OpTypePointer Output %v4float", - "%FragColor = OpVariable %_ptr_Output_v4float Output", - "%float_3 = OpConstant %float 3", - // clang-format on - }; - - const std::vector nonEntryFuncs = { - // clang-format off - "%foo_vf4_ = OpFunction %float None %20", - "%bar = OpFunctionParameter %_ptr_Function_v4float", - "%58 = OpLabel", - "%r = OpVariable %_ptr_Function_float Function", - "%59 = OpAccessChain %_ptr_Function_float %bar %uint_0", - "%60 = OpLoad %float %59", - "OpStore %r %60", - "%61 = OpLoad %float %r", - "%62 = OpFOrdLessThan %bool %61 %float_0", - "OpSelectionMerge %63 None", - "OpBranchConditional %62 %64 %63", - "%64 = OpLabel", - "%65 = OpLoad %float %r", - "%66 = OpFNegate %float %65", - "OpStore %r %66", - "OpBranch %63", - "%63 = OpLabel", - "%67 = OpLoad %float %r", - "OpReturnValue %67", - "OpFunctionEnd", - // clang-format on - }; - - const std::vector before = { - // clang-format off - "%main = OpFunction %void None %16", - "%39 = OpLabel", - "%color1 = OpVariable %_ptr_Function_v4float Function", - "%color2 = OpVariable %_ptr_Function_v4float Function", - "%param = OpVariable %_ptr_Function_v4float Function", - "%color3 = OpVariable %_ptr_Function_v4float Function", - "%40 = OpLoad %26 %t2D", - "%41 = OpLoad %28 %samp", - "%42 = OpSampledImage %30 %40 %41", - "%43 = OpImageSampleImplicitLod %v4float %42 %33", - "%44 = OpImage %26 %42", - "%45 = OpLoad %28 %samp2", - "OpStore %color1 %43", - "%46 = OpLoad %v4float %BaseColor", - "OpStore %param %46", - "%47 = OpFunctionCall %float %foo_vf4_ %param", - "%48 = OpCompositeConstruct %v4float %47 %47 %47 %47", - "OpStore %color2 %48", - "%49 = OpSampledImage %30 %44 %45", - "%50 = OpImageSampleImplicitLod %v4float %49 %36", - "OpStore %color3 %50", - "%51 = OpLoad %v4float %color1", - "%52 = OpLoad %v4float %color2", - "%53 = OpFAdd %v4float %51 %52", - "%54 = OpLoad %v4float %color3", - "%55 = OpFAdd %v4float %53 %54", - "%56 = OpCompositeConstruct %v4float %float_3 %float_3 %float_3 %float_3", - "%57 = OpFDiv %v4float %55 %56", - "OpStore %FragColor %57", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - - const std::vector after = { - // clang-format off - "%main = OpFunction %void None %16", - "%39 = OpLabel", - "%68 = OpVariable %_ptr_Function_float Function", - "%69 = OpVariable %_ptr_Function_float Function", - "%color1 = OpVariable %_ptr_Function_v4float Function", - "%color2 = OpVariable %_ptr_Function_v4float Function", - "%param = OpVariable %_ptr_Function_v4float Function", - "%color3 = OpVariable %_ptr_Function_v4float Function", - "%40 = OpLoad %26 %t2D", - "%41 = OpLoad %28 %samp", - "%42 = OpSampledImage %30 %40 %41", - "%43 = OpImageSampleImplicitLod %v4float %42 %33", - "%44 = OpImage %26 %42", - "%45 = OpLoad %28 %samp2", - "OpStore %color1 %43", - "%46 = OpLoad %v4float %BaseColor", - "OpStore %param %46", - "%70 = OpAccessChain %_ptr_Function_float %param %uint_0", - "%71 = OpLoad %float %70", - "OpStore %68 %71", - "%72 = OpLoad %float %68", - "%73 = OpFOrdLessThan %bool %72 %float_0", - "OpSelectionMerge %74 None", - "OpBranchConditional %73 %75 %74", - "%75 = OpLabel", - "%76 = OpLoad %float %68", - "%77 = OpFNegate %float %76", - "OpStore %68 %77", - "OpBranch %74", - "%74 = OpLabel", - "%78 = OpLoad %float %68", - "OpStore %69 %78", - "%47 = OpLoad %float %69", - "%48 = OpCompositeConstruct %v4float %47 %47 %47 %47", - "OpStore %color2 %48", - "%79 = OpSampledImage %30 %40 %41", - "%80 = OpImage %26 %79", - "%49 = OpSampledImage %30 %80 %45", - "%50 = OpImageSampleImplicitLod %v4float %49 %36", - "OpStore %color3 %50", - "%51 = OpLoad %v4float %color1", - "%52 = OpLoad %v4float %color2", - "%53 = OpFAdd %v4float %51 %52", - "%54 = OpLoad %v4float %color3", - "%55 = OpFAdd %v4float %53 %54", - "%56 = OpCompositeConstruct %v4float %float_3 %float_3 %float_3 %float_3", - "%57 = OpFDiv %v4float %55 %56", - "OpStore %FragColor %57", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - SinglePassRunAndCheck( - JoinAllInsts(Concat(Concat(predefs, before), nonEntryFuncs)), - JoinAllInsts(Concat(Concat(predefs, after), nonEntryFuncs)), - /* skip_nop = */ false, /* do_validate = */ true); -} - -TEST_F(InlineTest, OpImageAndOpSampledImageOutOfBlock) { - // #version 450 - // - // uniform texture2D t2D; - // uniform sampler samp; - // uniform sampler samp2; - // - // out vec4 FragColor; - // - // in vec4 BaseColor; - // - // float foo(vec4 bar) - // { - // float r = bar.x; - // if (r < 0.0) - // r = -r; - // return r; - // } - // - // void main() - // { - // vec4 color1 = texture(sampler2D(t2D, samp), vec2(1.0)); - // vec4 color2 = vec4(foo(BaseColor)); - // vec4 color3 = texture(sampler2D(t2D, samp2), vec2(0.5)); - // FragColor = (color1 + color2 + color3)/3; - // } - // Note: the before SPIR-V will need to be edited to create an OpImage - // and subsequent OpSampledImage that is used across the function call. - const std::vector predefs = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Fragment %main \"main\" %BaseColor %FragColor", - "OpExecutionMode %main OriginUpperLeft", - "OpSource GLSL 450", - "OpName %main \"main\"", - "OpName %foo_vf4_ \"foo(vf4;\"", - "OpName %bar \"bar\"", - "OpName %r \"r\"", - "OpName %color1 \"color1\"", - "OpName %t2D \"t2D\"", - "OpName %samp \"samp\"", - "OpName %color2 \"color2\"", - "OpName %BaseColor \"BaseColor\"", - "OpName %param \"param\"", - "OpName %color3 \"color3\"", - "OpName %samp2 \"samp2\"", - "OpName %FragColor \"FragColor\"", - "OpDecorate %t2D DescriptorSet 0", - "OpDecorate %samp DescriptorSet 0", - "OpDecorate %samp2 DescriptorSet 0", - "%void = OpTypeVoid", - "%16 = OpTypeFunction %void", - "%float = OpTypeFloat 32", - "%v4float = OpTypeVector %float 4", -"%_ptr_Function_v4float = OpTypePointer Function %v4float", - "%20 = OpTypeFunction %float %_ptr_Function_v4float", -"%_ptr_Function_float = OpTypePointer Function %float", - "%uint = OpTypeInt 32 0", - "%uint_0 = OpConstant %uint 0", - "%float_0 = OpConstant %float 0", - "%bool = OpTypeBool", - "%26 = OpTypeImage %float 2D 0 0 0 1 Unknown", -"%_ptr_UniformConstant_26 = OpTypePointer UniformConstant %26", - "%t2D = OpVariable %_ptr_UniformConstant_26 UniformConstant", - "%28 = OpTypeSampler", -"%_ptr_UniformConstant_28 = OpTypePointer UniformConstant %28", - "%samp = OpVariable %_ptr_UniformConstant_28 UniformConstant", - "%30 = OpTypeSampledImage %26", - "%v2float = OpTypeVector %float 2", - "%float_1 = OpConstant %float 1", - "%33 = OpConstantComposite %v2float %float_1 %float_1", -"%_ptr_Input_v4float = OpTypePointer Input %v4float", - "%BaseColor = OpVariable %_ptr_Input_v4float Input", - "%samp2 = OpVariable %_ptr_UniformConstant_28 UniformConstant", - "%float_0_5 = OpConstant %float 0.5", - "%36 = OpConstantComposite %v2float %float_0_5 %float_0_5", -"%_ptr_Output_v4float = OpTypePointer Output %v4float", - "%FragColor = OpVariable %_ptr_Output_v4float Output", - "%float_3 = OpConstant %float 3", - // clang-format on - }; - - const std::vector nonEntryFuncs = { - // clang-format off - "%foo_vf4_ = OpFunction %float None %20", - "%bar = OpFunctionParameter %_ptr_Function_v4float", - "%58 = OpLabel", - "%r = OpVariable %_ptr_Function_float Function", - "%59 = OpAccessChain %_ptr_Function_float %bar %uint_0", - "%60 = OpLoad %float %59", - "OpStore %r %60", - "%61 = OpLoad %float %r", - "%62 = OpFOrdLessThan %bool %61 %float_0", - "OpSelectionMerge %63 None", - "OpBranchConditional %62 %64 %63", - "%64 = OpLabel", - "%65 = OpLoad %float %r", - "%66 = OpFNegate %float %65", - "OpStore %r %66", - "OpBranch %63", - "%63 = OpLabel", - "%67 = OpLoad %float %r", - "OpReturnValue %67", - "OpFunctionEnd", - // clang-format on - }; - - const std::vector before = { - // clang-format off - "%main = OpFunction %void None %16", - "%39 = OpLabel", - "%color1 = OpVariable %_ptr_Function_v4float Function", - "%color2 = OpVariable %_ptr_Function_v4float Function", - "%param = OpVariable %_ptr_Function_v4float Function", - "%color3 = OpVariable %_ptr_Function_v4float Function", - "%40 = OpLoad %26 %t2D", - "%41 = OpLoad %28 %samp", - "%42 = OpSampledImage %30 %40 %41", - "%43 = OpImageSampleImplicitLod %v4float %42 %33", - "%44 = OpImage %26 %42", - "%45 = OpLoad %28 %samp2", - "%46 = OpSampledImage %30 %44 %45", - "OpStore %color1 %43", - "%47 = OpLoad %v4float %BaseColor", - "OpStore %param %47", - "%48 = OpFunctionCall %float %foo_vf4_ %param", - "%49 = OpCompositeConstruct %v4float %48 %48 %48 %48", - "OpStore %color2 %49", - "%50 = OpImageSampleImplicitLod %v4float %46 %36", - "OpStore %color3 %50", - "%51 = OpLoad %v4float %color1", - "%52 = OpLoad %v4float %color2", - "%53 = OpFAdd %v4float %51 %52", - "%54 = OpLoad %v4float %color3", - "%55 = OpFAdd %v4float %53 %54", - "%56 = OpCompositeConstruct %v4float %float_3 %float_3 %float_3 %float_3", - "%57 = OpFDiv %v4float %55 %56", - "OpStore %FragColor %57", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - - const std::vector after = { - // clang-format off - "%main = OpFunction %void None %16", - "%39 = OpLabel", - "%68 = OpVariable %_ptr_Function_float Function", - "%69 = OpVariable %_ptr_Function_float Function", - "%color1 = OpVariable %_ptr_Function_v4float Function", - "%color2 = OpVariable %_ptr_Function_v4float Function", - "%param = OpVariable %_ptr_Function_v4float Function", - "%color3 = OpVariable %_ptr_Function_v4float Function", - "%40 = OpLoad %26 %t2D", - "%41 = OpLoad %28 %samp", - "%42 = OpSampledImage %30 %40 %41", - "%43 = OpImageSampleImplicitLod %v4float %42 %33", - "%44 = OpImage %26 %42", - "%45 = OpLoad %28 %samp2", - "%46 = OpSampledImage %30 %44 %45", - "OpStore %color1 %43", - "%47 = OpLoad %v4float %BaseColor", - "OpStore %param %47", - "%70 = OpAccessChain %_ptr_Function_float %param %uint_0", - "%71 = OpLoad %float %70", - "OpStore %68 %71", - "%72 = OpLoad %float %68", - "%73 = OpFOrdLessThan %bool %72 %float_0", - "OpSelectionMerge %74 None", - "OpBranchConditional %73 %75 %74", - "%75 = OpLabel", - "%76 = OpLoad %float %68", - "%77 = OpFNegate %float %76", - "OpStore %68 %77", - "OpBranch %74", - "%74 = OpLabel", - "%78 = OpLoad %float %68", - "OpStore %69 %78", - "%48 = OpLoad %float %69", - "%49 = OpCompositeConstruct %v4float %48 %48 %48 %48", - "OpStore %color2 %49", - "%79 = OpSampledImage %30 %40 %41", - "%80 = OpImage %26 %79", - "%81 = OpSampledImage %30 %80 %45", - "%50 = OpImageSampleImplicitLod %v4float %81 %36", - "OpStore %color3 %50", - "%51 = OpLoad %v4float %color1", - "%52 = OpLoad %v4float %color2", - "%53 = OpFAdd %v4float %51 %52", - "%54 = OpLoad %v4float %color3", - "%55 = OpFAdd %v4float %53 %54", - "%56 = OpCompositeConstruct %v4float %float_3 %float_3 %float_3 %float_3", - "%57 = OpFDiv %v4float %55 %56", - "OpStore %FragColor %57", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - SinglePassRunAndCheck( - JoinAllInsts(Concat(Concat(predefs, before), nonEntryFuncs)), - JoinAllInsts(Concat(Concat(predefs, after), nonEntryFuncs)), - /* skip_nop = */ false, /* do_validate = */ true); -} - -TEST_F(InlineTest, EarlyReturnFunctionInlined) { - // #version 140 - // - // in vec4 BaseColor; - // - // float foo(vec4 bar) - // { - // if (bar.x < 0.0) - // return 0.0; - // return bar.x; - // } - // - // void main() - // { - // vec4 color = vec4(foo(BaseColor)); - // gl_FragColor = color; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %foo_vf4_ "foo(vf4;" -OpName %bar "bar" -OpName %color "color" -OpName %BaseColor "BaseColor" -OpName %param "param" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%10 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%14 = OpTypeFunction %float %_ptr_Function_v4float -%uint = OpTypeInt 32 0 -%uint_0 = OpConstant %uint 0 -%_ptr_Function_float = OpTypePointer Function %float -%float_0 = OpConstant %float 0 -%bool = OpTypeBool -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string nonEntryFuncs = - R"(%foo_vf4_ = OpFunction %float None %14 -%bar = OpFunctionParameter %_ptr_Function_v4float -%27 = OpLabel -%28 = OpAccessChain %_ptr_Function_float %bar %uint_0 -%29 = OpLoad %float %28 -%30 = OpFOrdLessThan %bool %29 %float_0 -OpSelectionMerge %31 None -OpBranchConditional %30 %32 %31 -%32 = OpLabel -OpReturnValue %float_0 -%31 = OpLabel -%33 = OpAccessChain %_ptr_Function_float %bar %uint_0 -%34 = OpLoad %float %33 -OpReturnValue %34 -OpFunctionEnd -)"; - - const std::string before = - R"(%main = OpFunction %void None %10 -%22 = OpLabel -%color = OpVariable %_ptr_Function_v4float Function -%param = OpVariable %_ptr_Function_v4float Function -%23 = OpLoad %v4float %BaseColor -OpStore %param %23 -%24 = OpFunctionCall %float %foo_vf4_ %param -%25 = OpCompositeConstruct %v4float %24 %24 %24 %24 -OpStore %color %25 -%26 = OpLoad %v4float %color -OpStore %gl_FragColor %26 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%false = OpConstantFalse %bool -%main = OpFunction %void None %10 -%22 = OpLabel -%35 = OpVariable %_ptr_Function_float Function -%color = OpVariable %_ptr_Function_v4float Function -%param = OpVariable %_ptr_Function_v4float Function -%23 = OpLoad %v4float %BaseColor -OpStore %param %23 -OpBranch %36 -%36 = OpLabel -OpLoopMerge %37 %38 None -OpBranch %39 -%39 = OpLabel -%40 = OpAccessChain %_ptr_Function_float %param %uint_0 -%41 = OpLoad %float %40 -%42 = OpFOrdLessThan %bool %41 %float_0 -OpSelectionMerge %43 None -OpBranchConditional %42 %44 %43 -%44 = OpLabel -OpStore %35 %float_0 -OpBranch %37 -%43 = OpLabel -%45 = OpAccessChain %_ptr_Function_float %param %uint_0 -%46 = OpLoad %float %45 -OpStore %35 %46 -OpBranch %37 -%38 = OpLabel -OpBranchConditional %false %36 %37 -%37 = OpLabel -%24 = OpLoad %float %35 -%25 = OpCompositeConstruct %v4float %24 %24 %24 %24 -OpStore %color %25 -%26 = OpLoad %v4float %color -OpStore %gl_FragColor %26 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before + nonEntryFuncs, - predefs + after + nonEntryFuncs, false, true); -} - -TEST_F(InlineTest, EarlyReturnNotAppearingLastInFunctionInlined) { - // Example from https://github.com/KhronosGroup/SPIRV-Tools/issues/755 - // - // Original example is derived from: - // - // #version 450 - // - // float foo() { - // if (true) { - // } - // } - // - // void main() { foo(); } - // - // But the order of basic blocks in foo is changed so that the return - // block is listed second-last. There is only one return in the callee - // but it does not appear last. - - const std::string predefs = - R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %main "main" -OpSource GLSL 450 -OpName %main "main" -OpName %foo_ "foo(" -%void = OpTypeVoid -%4 = OpTypeFunction %void -%bool = OpTypeBool -%true = OpConstantTrue %bool -)"; - - const std::string nonEntryFuncs = - R"(%foo_ = OpFunction %void None %4 -%7 = OpLabel -OpSelectionMerge %8 None -OpBranchConditional %true %9 %8 -%8 = OpLabel -OpReturn -%9 = OpLabel -OpBranch %8 -OpFunctionEnd -)"; - - const std::string before = - R"(%main = OpFunction %void None %4 -%10 = OpLabel -%11 = OpFunctionCall %void %foo_ -OpReturn -OpFunctionEnd -)"; - - const std::string after = -R"(%main = OpFunction %void None %4 -%10 = OpLabel -OpSelectionMerge %12 None -OpBranchConditional %true %13 %12 -%12 = OpLabel -OpBranch %14 -%13 = OpLabel -OpBranch %12 -%14 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + nonEntryFuncs + before, - predefs + nonEntryFuncs + after, false, true); -} - -TEST_F(InlineTest, ForwardReferencesInPhiInlined) { - // The basic structure of the test case is like this: - // - // int foo() { - // int result = 1; - // if (true) { - // result = 1; - // } - // return result; - // } - // - // void main() { - // int x = foo(); - // } - // - // but with modifications: Using Phi instead of load/store, and the - // return block in foo appears before the "then" block. - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %main "main" -OpSource GLSL 450 -OpName %main "main" -OpName %foo_ "foo(" -OpName %x "x" -%void = OpTypeVoid -%6 = OpTypeFunction %void -%int = OpTypeInt 32 1 -%8 = OpTypeFunction %int -%bool = OpTypeBool -%true = OpConstantTrue %bool -%int_0 = OpConstant %int 0 -%_ptr_Function_int = OpTypePointer Function %int -)"; - - const std::string nonEntryFuncs = - R"(%foo_ = OpFunction %int None %8 -%13 = OpLabel -%14 = OpCopyObject %int %int_0 -OpSelectionMerge %15 None -OpBranchConditional %true %16 %15 -%15 = OpLabel -%17 = OpPhi %int %14 %13 %18 %16 -OpReturnValue %17 -%16 = OpLabel -%18 = OpCopyObject %int %int_0 -OpBranch %15 -OpFunctionEnd -)"; - - const std::string before = - R"(%main = OpFunction %void None %6 -%19 = OpLabel -%x = OpVariable %_ptr_Function_int Function -%20 = OpFunctionCall %int %foo_ -OpStore %x %20 -OpReturn -OpFunctionEnd -)"; - - const std::string after = -R"(%main = OpFunction %void None %6 -%19 = OpLabel -%21 = OpVariable %_ptr_Function_int Function -%x = OpVariable %_ptr_Function_int Function -%22 = OpCopyObject %int %int_0 -OpSelectionMerge %23 None -OpBranchConditional %true %24 %23 -%23 = OpLabel -%26 = OpPhi %int %22 %19 %25 %24 -OpStore %21 %26 -OpBranch %27 -%24 = OpLabel -%25 = OpCopyObject %int %int_0 -OpBranch %23 -%27 = OpLabel -%20 = OpLoad %int %21 -OpStore %x %20 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + nonEntryFuncs + before, - predefs + nonEntryFuncs + after, false, true); -} - -TEST_F(InlineTest, EarlyReturnInLoopIsNotInlined) { - // #version 140 - // - // in vec4 BaseColor; - // - // float foo(vec4 bar) - // { - // while (true) { - // if (bar.x < 0.0) - // return 0.0; - // return bar.x; - // } - // } - // - // void main() - // { - // vec4 color = vec4(foo(BaseColor)); - // gl_FragColor = color; - // } - - const std::string assembly = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %foo_vf4_ "foo(vf4;" -OpName %bar "bar" -OpName %color "color" -OpName %BaseColor "BaseColor" -OpName %param "param" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%10 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%14 = OpTypeFunction %float %_ptr_Function_v4float -%bool = OpTypeBool -%true = OpConstantTrue %bool -%uint = OpTypeInt 32 0 -%uint_0 = OpConstant %uint 0 -%_ptr_Function_float = OpTypePointer Function %float -%float_0 = OpConstant %float 0 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%main = OpFunction %void None %10 -%23 = OpLabel -%color = OpVariable %_ptr_Function_v4float Function -%param = OpVariable %_ptr_Function_v4float Function -%24 = OpLoad %v4float %BaseColor -OpStore %param %24 -%25 = OpFunctionCall %float %foo_vf4_ %param -%26 = OpCompositeConstruct %v4float %25 %25 %25 %25 -OpStore %color %26 -%27 = OpLoad %v4float %color -OpStore %gl_FragColor %27 -OpReturn -OpFunctionEnd -%foo_vf4_ = OpFunction %float None %14 -%bar = OpFunctionParameter %_ptr_Function_v4float -%28 = OpLabel -OpBranch %29 -%29 = OpLabel -OpLoopMerge %30 %31 None -OpBranch %32 -%32 = OpLabel -OpBranchConditional %true %33 %30 -%33 = OpLabel -%34 = OpAccessChain %_ptr_Function_float %bar %uint_0 -%35 = OpLoad %float %34 -%36 = OpFOrdLessThan %bool %35 %float_0 -OpSelectionMerge %37 None -OpBranchConditional %36 %38 %37 -%38 = OpLabel -OpReturnValue %float_0 -%37 = OpLabel -%39 = OpAccessChain %_ptr_Function_float %bar %uint_0 -%40 = OpLoad %float %39 -OpReturnValue %40 -%31 = OpLabel -OpBranch %29 -%30 = OpLabel -%41 = OpUndef %float -OpReturnValue %41 -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - assembly, assembly, false, true); -} - -TEST_F(InlineTest, ExternalFunctionIsNotInlined) { - // In particular, don't crash. - // See report https://github.com/KhronosGroup/SPIRV-Tools/issues/605 - const std::string assembly = - R"(OpCapability Addresses -OpCapability Kernel -OpCapability Linkage -OpMemoryModel Physical32 OpenCL -OpEntryPoint Kernel %1 "entry_pt" -OpDecorate %2 LinkageAttributes "external" Import -%void = OpTypeVoid -%4 = OpTypeFunction %void -%2 = OpFunction %void None %4 -OpFunctionEnd -%1 = OpFunction %void None %4 -%5 = OpLabel -%6 = OpFunctionCall %void %2 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - assembly, assembly, false, true); -} - -TEST_F(InlineTest, SingleBlockLoopCallsMultiBlockCallee) { - // Example from https://github.com/KhronosGroup/SPIRV-Tools/issues/787 - // - // CFG structure is: - // foo: - // fooentry -> fooexit - // - // main: - // entry -> loop - // loop -> loop, merge - // loop calls foo() - // merge - // - // Since the callee has multiple blocks, it will split the calling block - // into at least two, resulting in a new "back-half" block that contains - // the instructions after the inlined function call. If the calling block - // has an OpLoopMerge that points back to the calling block itself, then - // the OpLoopMerge can't remain in the back-half block, but must be - // moved to the end of the original calling block, and it continue target - // operand updated to point to the back-half block. - - const std::string predefs = - R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %1 "main" -OpSource OpenCL_C 120 -%bool = OpTypeBool -%true = OpConstantTrue %bool -%void = OpTypeVoid -)"; - - const std::string nonEntryFuncs = - R"(%5 = OpTypeFunction %void -%6 = OpFunction %void None %5 -%7 = OpLabel -OpBranch %8 -%8 = OpLabel -OpReturn -OpFunctionEnd -)"; - - const std::string before = - R"(%1 = OpFunction %void None %5 -%9 = OpLabel -OpBranch %10 -%10 = OpLabel -%11 = OpFunctionCall %void %6 -OpLoopMerge %12 %10 None -OpBranchConditional %true %10 %12 -%12 = OpLabel -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%1 = OpFunction %void None %5 -%9 = OpLabel -OpBranch %10 -%10 = OpLabel -OpLoopMerge %12 %13 None -OpBranch %13 -%13 = OpLabel -OpBranchConditional %true %10 %12 -%12 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + nonEntryFuncs + before, predefs + nonEntryFuncs + after, false, - true); -} - -TEST_F(InlineTest, MultiBlockLoopHeaderCallsMultiBlockCallee) { - // Like SingleBlockLoopCallsMultiBlockCallee but the loop has several - // blocks, but the function call still occurs in the loop header. - // Example from https://github.com/KhronosGroup/SPIRV-Tools/issues/800 - - const std::string predefs = - R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %1 "main" -OpSource OpenCL_C 120 -%bool = OpTypeBool -%true = OpConstantTrue %bool -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%int_2 = OpConstant %int 2 -%int_3 = OpConstant %int 3 -%int_4 = OpConstant %int 4 -%int_5 = OpConstant %int 5 -%void = OpTypeVoid -%11 = OpTypeFunction %void -)"; - - const std::string nonEntryFuncs = - R"(%12 = OpFunction %void None %11 -%13 = OpLabel -%14 = OpCopyObject %int %int_1 -OpBranch %15 -%15 = OpLabel -%16 = OpCopyObject %int %int_2 -OpReturn -OpFunctionEnd -)"; - - const std::string before = - R"(%1 = OpFunction %void None %11 -%17 = OpLabel -OpBranch %18 -%18 = OpLabel -%19 = OpCopyObject %int %int_3 -%20 = OpFunctionCall %void %12 -%21 = OpCopyObject %int %int_4 -OpLoopMerge %22 %23 None -OpBranchConditional %true %23 %22 -%23 = OpLabel -%24 = OpCopyObject %int %int_5 -OpBranchConditional %true %18 %22 -%22 = OpLabel -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%1 = OpFunction %void None %11 -%17 = OpLabel -OpBranch %18 -%18 = OpLabel -%19 = OpCopyObject %int %int_3 -%25 = OpCopyObject %int %int_1 -OpLoopMerge %22 %23 None -OpBranch %26 -%26 = OpLabel -%27 = OpCopyObject %int %int_2 -%21 = OpCopyObject %int %int_4 -OpBranchConditional %true %23 %22 -%23 = OpLabel -%24 = OpCopyObject %int %int_5 -OpBranchConditional %true %18 %22 -%22 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + nonEntryFuncs + before, predefs + nonEntryFuncs + after, false, - true); -} - -TEST_F(InlineTest, SingleBlockLoopCallsMultiBlockCalleeHavingSelectionMerge) { - // This is similar to SingleBlockLoopCallsMultiBlockCallee except - // that calleee block also has a merge instruction in its first block. - // That merge instruction must be an OpSelectionMerge (because the entry - // block of a function can't be the header of a loop since the entry - // block can't be the target of a branch). - // - // In this case the OpLoopMerge can't be placed in the same block as - // the OpSelectionMerge, so inlining must create a new block to contain - // the callee contents. - // - // Additionally, we have two dummy OpCopyObject instructions to prove that - // the OpLoopMerge is moved to the right location. - // - // Also ensure that OpPhis within the cloned callee code are valid. - // We need to test that the predecessor blocks are remapped correctly so that - // dominance rules are satisfied - - const std::string predefs = - R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %1 "main" -OpSource OpenCL_C 120 -%bool = OpTypeBool -%true = OpConstantTrue %bool -%false = OpConstantFalse %bool -%void = OpTypeVoid -%6 = OpTypeFunction %void -)"; - - // This callee has multiple blocks, and an OpPhi in the last block - // that references a value from the first block. This tests that - // cloned block IDs are remapped appropriately. The OpPhi dominance - // requires that the remapped %9 must be in a block that dominates - // the remapped %8. - const std::string nonEntryFuncs = - R"(%7 = OpFunction %void None %6 -%8 = OpLabel -%9 = OpCopyObject %bool %true -OpSelectionMerge %10 None -OpBranchConditional %true %10 %10 -%10 = OpLabel -%11 = OpPhi %bool %9 %8 -OpReturn -OpFunctionEnd -)"; - - const std::string before = - R"(%1 = OpFunction %void None %6 -%12 = OpLabel -OpBranch %13 -%13 = OpLabel -%14 = OpCopyObject %bool %false -%15 = OpFunctionCall %void %7 -OpLoopMerge %16 %13 None -OpBranchConditional %true %13 %16 -%16 = OpLabel -OpReturn -OpFunctionEnd -)"; - - // Note the remapped Phi uses %17 as the parent instead - // of %13, demonstrating that the parent block has been remapped - // correctly. - const std::string after = - R"(%1 = OpFunction %void None %6 -%12 = OpLabel -OpBranch %13 -%13 = OpLabel -%14 = OpCopyObject %bool %false -OpLoopMerge %16 %19 None -OpBranch %17 -%17 = OpLabel -%18 = OpCopyObject %bool %true -OpSelectionMerge %19 None -OpBranchConditional %true %19 %19 -%19 = OpLabel -%20 = OpPhi %bool %18 %17 -OpBranchConditional %true %13 %16 -%16 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + nonEntryFuncs + before, predefs + nonEntryFuncs + after, false, - true); -} - -TEST_F(InlineTest, MultiBlockLoopHeaderCallsFromToMultiBlockCalleeHavingSelectionMerge) { - // This is similar to SingleBlockLoopCallsMultiBlockCalleeHavingSelectionMerge - // but the call is in the header block of a multi block loop. - - const std::string predefs = -R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %1 "main" -OpSource OpenCL_C 120 -%bool = OpTypeBool -%true = OpConstantTrue %bool -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%int_2 = OpConstant %int 2 -%int_3 = OpConstant %int 3 -%int_4 = OpConstant %int 4 -%int_5 = OpConstant %int 5 -%void = OpTypeVoid -%11 = OpTypeFunction %void -)"; - - const std::string nonEntryFuncs = - R"(%12 = OpFunction %void None %11 -%13 = OpLabel -%14 = OpCopyObject %int %int_1 -OpSelectionMerge %15 None -OpBranchConditional %true %15 %15 -%15 = OpLabel -%16 = OpCopyObject %int %int_2 -OpReturn -OpFunctionEnd -)"; - - const std::string before = - R"(%1 = OpFunction %void None %11 -%17 = OpLabel -OpBranch %18 -%18 = OpLabel -%19 = OpCopyObject %int %int_3 -%20 = OpFunctionCall %void %12 -%21 = OpCopyObject %int %int_4 -OpLoopMerge %22 %23 None -OpBranchConditional %true %23 %22 -%23 = OpLabel -%24 = OpCopyObject %int %int_5 -OpBranchConditional %true %18 %22 -%22 = OpLabel -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%1 = OpFunction %void None %11 -%17 = OpLabel -OpBranch %18 -%18 = OpLabel -%19 = OpCopyObject %int %int_3 -OpLoopMerge %22 %23 None -OpBranch %25 -%25 = OpLabel -%26 = OpCopyObject %int %int_1 -OpSelectionMerge %27 None -OpBranchConditional %true %27 %27 -%27 = OpLabel -%28 = OpCopyObject %int %int_2 -%21 = OpCopyObject %int %int_4 -OpBranchConditional %true %23 %22 -%23 = OpLabel -%24 = OpCopyObject %int %int_5 -OpBranchConditional %true %18 %22 -%22 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + nonEntryFuncs + before, predefs + nonEntryFuncs + after, false, - true); -} - -TEST_F(InlineTest, SingleBlockLoopCallsMultiBlockCalleeHavingSelectionMergeAndMultiReturns) { - // This is similar to SingleBlockLoopCallsMultiBlockCalleeHavingSelectionMerge - // except that in addition to starting with a selection header, the - // callee also has multi returns. - // - // So now we have to accommodate: - // - The caller's OpLoopMerge (which must move to the first block) - // - The single-trip loop to wrap the multi returns, and - // - The callee's selection merge in its first block. - // Each of these must go into their own blocks. - - const std::string predefs = - R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %1 "main" -OpSource OpenCL_C 120 -%bool = OpTypeBool -%int = OpTypeInt 32 1 -%true = OpConstantTrue %bool -%false = OpConstantFalse %bool -%int_0 = OpConstant %int 0 -%int_1 = OpConstant %int 1 -%int_2 = OpConstant %int 2 -%int_3 = OpConstant %int 3 -%int_4 = OpConstant %int 4 -%void = OpTypeVoid -%12 = OpTypeFunction %void -)"; - - const std::string nonEntryFuncs = - R"(%13 = OpFunction %void None %12 -%14 = OpLabel -%15 = OpCopyObject %int %int_0 -OpReturn -%16 = OpLabel -%17 = OpCopyObject %int %int_1 -OpReturn -OpFunctionEnd -)"; - - const std::string before = - R"(%1 = OpFunction %void None %12 -%18 = OpLabel -OpBranch %19 -%19 = OpLabel -%20 = OpCopyObject %int %int_2 -%21 = OpFunctionCall %void %13 -%22 = OpCopyObject %int %int_3 -OpLoopMerge %23 %19 None -OpBranchConditional %true %19 %23 -%23 = OpLabel -%24 = OpCopyObject %int %int_4 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%1 = OpFunction %void None %12 -%18 = OpLabel -OpBranch %19 -%19 = OpLabel -%20 = OpCopyObject %int %int_2 -OpLoopMerge %23 %26 None -OpBranch %25 -%25 = OpLabel -OpLoopMerge %26 %27 None -OpBranch %28 -%28 = OpLabel -%29 = OpCopyObject %int %int_0 -OpBranch %26 -%30 = OpLabel -%31 = OpCopyObject %int %int_1 -OpBranch %26 -%27 = OpLabel -OpBranchConditional %false %25 %26 -%26 = OpLabel -%22 = OpCopyObject %int %int_3 -OpBranchConditional %true %19 %23 -%23 = OpLabel -%24 = OpCopyObject %int %int_4 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + nonEntryFuncs + before, predefs + nonEntryFuncs + after, false, - true); -} - -TEST_F(InlineTest, CalleeWithMultiReturnAndPhiRequiresEntryBlockRemapping) { - // The case from https://github.com/KhronosGroup/SPIRV-Tools/issues/790 - // - // The callee has multiple returns, and so must be wrapped with a single-trip - // loop. That code must remap the callee entry block ID to the introduced - // loop body's ID. Otherwise you can get a dominance error in a cloned OpPhi. - - const std::string predefs = - R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %1 "main" -OpSource OpenCL_C 120 -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%int_1 = OpConstant %int 1 -%int_2 = OpConstant %int 2 -%int_3 = OpConstant %int 3 -%int_4 = OpConstant %int 4 -%void = OpTypeVoid -%9 = OpTypeFunction %void -%bool = OpTypeBool -%false = OpConstantFalse %bool -)"; - - // This callee has multiple returns, and a Phi in the second block referencing - // a value generated in the entry block. - const std::string nonEntryFuncs = - R"(%12 = OpFunction %void None %9 -%13 = OpLabel -%14 = OpCopyObject %int %int_0 -OpBranch %15 -%15 = OpLabel -%16 = OpPhi %int %14 %13 -%17 = OpCopyObject %int %int_1 -OpReturn -%18 = OpLabel -%19 = OpCopyObject %int %int_2 -OpReturn -OpFunctionEnd -)"; - - const std::string before = - R"(%1 = OpFunction %void None %9 -%20 = OpLabel -%21 = OpCopyObject %int %int_3 -%22 = OpFunctionCall %void %12 -%23 = OpCopyObject %int %int_4 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%1 = OpFunction %void None %9 -%20 = OpLabel -%21 = OpCopyObject %int %int_3 -OpBranch %24 -%24 = OpLabel -OpLoopMerge %25 %26 None -OpBranch %27 -%27 = OpLabel -%28 = OpCopyObject %int %int_0 -OpBranch %29 -%29 = OpLabel -%30 = OpPhi %int %28 %27 -%31 = OpCopyObject %int %int_1 -OpBranch %25 -%32 = OpLabel -%33 = OpCopyObject %int %int_2 -OpBranch %25 -%26 = OpLabel -OpBranchConditional %false %24 %25 -%25 = OpLabel -%23 = OpCopyObject %int %int_4 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + nonEntryFuncs + before, predefs + nonEntryFuncs + after, false, - true); -} - - -// TODO(greg-lunarg): Add tests to verify handling of these cases: -// -// Empty modules -// Modules without function definitions -// Modules in which all functions do not call other functions -// Recursive functions (calling self & calling each other) -// Caller and callee both accessing the same global variable -// Functions with OpLine & OpNoLine -// Others? - -// TODO(dneto): Test suggestions from code review -// https://github.com/KhronosGroup/SPIRV-Tools/pull/534 -// -// Callee function returns a value generated outside the callee, -// e.g. a constant value. This might exercise some logic not yet -// exercised by the current tests: the false branch in the "if" -// inside the SpvOpReturnValue case in InlinePass::GenInlineCode? -// SampledImage before function call, but callee is only single block. -// Then the SampledImage instruction is not cloned. Documents existing -// behaviour. -// SampledImage after function call. It is not cloned or changed. - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/insert_extract_elim_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/insert_extract_elim_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/insert_extract_elim_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/insert_extract_elim_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,416 +0,0 @@ -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; - -using InsertExtractElimTest = PassTest<::testing::Test>; - -TEST_F(InsertExtractElimTest, Simple) { - // Note: The SPIR-V assembly has had store/load elimination - // performed to allow the inserts and extracts to directly - // reference each other. - // - // #version 140 - // - // in vec4 BaseColor; - // - // struct S_t { - // vec4 v0; - // vec4 v1; - // }; - // - // void main() - // { - // S_t s0; - // s0.v1 = BaseColor; - // gl_FragColor = s0.v1; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpName %s0 "s0" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%S_t = OpTypeStruct %v4float %v4float -%_ptr_Function_S_t = OpTypePointer Function %S_t -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %8 -%17 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%18 = OpLoad %v4float %BaseColor -%19 = OpLoad %S_t %s0 -%20 = OpCompositeInsert %S_t %18 %19 1 -OpStore %s0 %20 -%21 = OpCompositeExtract %v4float %20 1 -OpStore %gl_FragColor %21 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %8 -%17 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%18 = OpLoad %v4float %BaseColor -%19 = OpLoad %S_t %s0 -%20 = OpCompositeInsert %S_t %18 %19 1 -OpStore %s0 %20 -OpStore %gl_FragColor %18 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck(predefs + before, - predefs + after, true, true); -} - -TEST_F(InsertExtractElimTest, OptimizeAcrossNonConflictingInsert) { - // Note: The SPIR-V assembly has had store/load elimination - // performed to allow the inserts and extracts to directly - // reference each other. - // - // #version 140 - // - // in vec4 BaseColor; - // - // struct S_t { - // vec4 v0; - // vec4 v1; - // }; - // - // void main() - // { - // S_t s0; - // s0.v1 = BaseColor; - // s0.v0[2] = 0.0; - // gl_FragColor = s0.v1; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpName %s0 "s0" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%S_t = OpTypeStruct %v4float %v4float -%_ptr_Function_S_t = OpTypePointer Function %S_t -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%float_0 = OpConstant %float 0 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %8 -%18 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%19 = OpLoad %v4float %BaseColor -%20 = OpLoad %S_t %s0 -%21 = OpCompositeInsert %S_t %19 %20 1 -%22 = OpCompositeInsert %S_t %float_0 %21 0 2 -OpStore %s0 %22 -%23 = OpCompositeExtract %v4float %22 1 -OpStore %gl_FragColor %23 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %8 -%18 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%19 = OpLoad %v4float %BaseColor -%20 = OpLoad %S_t %s0 -%21 = OpCompositeInsert %S_t %19 %20 1 -%22 = OpCompositeInsert %S_t %float_0 %21 0 2 -OpStore %s0 %22 -OpStore %gl_FragColor %19 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck(predefs + before, - predefs + after, true, true); -} - -TEST_F(InsertExtractElimTest, OptimizeOpaque) { - // SPIR-V not representable in GLSL; not generatable from HLSL - // for the moment. - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %outColor %texCoords -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpMemberName %S_t 2 "smp" -OpName %outColor "outColor" -OpName %sampler15 "sampler15" -OpName %s0 "s0" -OpName %texCoords "texCoords" -OpDecorate %sampler15 DescriptorSet 0 -%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v2float = OpTypeVector %float 2 -%v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%outColor = OpVariable %_ptr_Output_v4float Output -%14 = OpTypeImage %float 2D 0 0 0 1 Unknown -%15 = OpTypeSampledImage %14 -%S_t = OpTypeStruct %v2float %v2float %15 -%_ptr_Function_S_t = OpTypePointer Function %S_t -%17 = OpTypeFunction %void %_ptr_Function_S_t -%_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15 -%_ptr_Function_15 = OpTypePointer Function %15 -%sampler15 = OpVariable %_ptr_UniformConstant_15 UniformConstant -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%int_2 = OpConstant %int 2 -%_ptr_Function_v2float = OpTypePointer Function %v2float -%_ptr_Input_v2float = OpTypePointer Input %v2float -%texCoords = OpVariable %_ptr_Input_v2float Input -)"; - - const std::string before = - R"(%main = OpFunction %void None %9 -%25 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%26 = OpLoad %v2float %texCoords -%27 = OpLoad %S_t %s0 -%28 = OpCompositeInsert %S_t %26 %27 0 -%29 = OpLoad %15 %sampler15 -%30 = OpCompositeInsert %S_t %29 %28 2 -OpStore %s0 %30 -%31 = OpCompositeExtract %15 %30 2 -%32 = OpCompositeExtract %v2float %30 0 -%33 = OpImageSampleImplicitLod %v4float %31 %32 -OpStore %outColor %33 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %9 -%25 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%26 = OpLoad %v2float %texCoords -%27 = OpLoad %S_t %s0 -%28 = OpCompositeInsert %S_t %26 %27 0 -%29 = OpLoad %15 %sampler15 -%30 = OpCompositeInsert %S_t %29 %28 2 -OpStore %s0 %30 -%33 = OpImageSampleImplicitLod %v4float %29 %26 -OpStore %outColor %33 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck(predefs + before, - predefs + after, true, true); -} - -TEST_F(InsertExtractElimTest, ConflictingInsertPreventsOptimization) { - // Note: The SPIR-V assembly has had store/load elimination - // performed to allow the inserts and extracts to directly - // reference each other. - // - // #version 140 - // - // in vec4 BaseColor; - // - // struct S_t { - // vec4 v0; - // vec4 v1; - // }; - // - // void main() - // { - // S_t s0; - // s0.v1 = BaseColor; - // s0.v1[2] = 0.0; - // gl_FragColor = s0.v1; - // } - - const std::string assembly = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpName %s0 "s0" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%S_t = OpTypeStruct %v4float %v4float -%_ptr_Function_S_t = OpTypePointer Function %S_t -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%float_0 = OpConstant %float 0 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%main = OpFunction %void None %8 -%18 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%19 = OpLoad %v4float %BaseColor -%20 = OpLoad %S_t %s0 -%21 = OpCompositeInsert %S_t %19 %20 1 -%22 = OpCompositeInsert %S_t %float_0 %21 1 2 -OpStore %s0 %22 -%23 = OpCompositeExtract %v4float %22 1 -OpStore %gl_FragColor %23 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck(assembly, - assembly, true, true); -} - -TEST_F(InsertExtractElimTest, ConflictingInsertPreventsOptimization2) { - // Note: The SPIR-V assembly has had store/load elimination - // performed to allow the inserts and extracts to directly - // reference each other. - // - // #version 140 - // - // in vec4 BaseColor; - // - // struct S_t { - // vec4 v0; - // vec4 v1; - // }; - // - // void main() - // { - // S_t s0; - // s0.v1[1] = 1.0; - // s0.v1 = Baseline; - // gl_FragColor = vec4(s0.v1[1], 0.0, 0.0, 0.0); - // } - - const std::string assembly = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpName %s0 "s0" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%S_t = OpTypeStruct %v4float %v4float -%_ptr_Function_S_t = OpTypePointer Function %S_t -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%float_1 = OpConstant %float 1 -%uint = OpTypeInt 32 0 -%uint_1 = OpConstant %uint 1 -%_ptr_Function_float = OpTypePointer Function %float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%float_0 = OpConstant %float 0 -%main = OpFunction %void None %8 -%22 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%23 = OpLoad %S_t %s0 -%24 = OpCompositeInsert %S_t %float_1 %23 1 1 -%25 = OpLoad %v4float %BaseColor -%26 = OpCompositeInsert %S_t %25 %24 1 -%27 = OpCompositeExtract %float %26 1 1 -%28 = OpCompositeConstruct %v4float %27 %float_0 %float_0 %float_0 -OpStore %gl_FragColor %28 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck(assembly, - assembly, true, true); -} - -// TODO(greg-lunarg): Add tests to verify handling of these cases: -// - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/instruction_list_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/instruction_list_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/instruction_list_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/instruction_list_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include -#include -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -#include "opt/instruction.h" -#include "opt/instruction_list.h" - -namespace { - -using Instruction = spvtools::ir::Instruction; -using InstructionList = spvtools::ir::InstructionList; -using ::testing::ContainerEq; -using ::testing::ElementsAre; -using InstructionListTest = ::testing::Test; - -// A class that overrides the destructor, so we can trace it. -class TestInstruction : public Instruction { - public: - TestInstruction() : Instruction() { created_instructions_.push_back(this); } - - ~TestInstruction() { deleted_instructions_.push_back(this); } - - static std::vector created_instructions_; - static std::vector deleted_instructions_; -}; - -std::vector TestInstruction::created_instructions_; -std::vector TestInstruction::deleted_instructions_; - -// Test that the destructor for InstructionList is calling the destructor -// for every element that is in the list. -TEST(InstructionListTest, Destructor) { - InstructionList* list = new InstructionList(); - list->push_back(new Instruction()); - list->push_back(new Instruction()); - delete list; - - // Sorting because we do not care if the order of create and destruction is - // the same. Using generic sort just incase things are changed above. - std::sort(TestInstruction::created_instructions_.begin(), - TestInstruction::created_instructions_.end()); - std::sort(TestInstruction::deleted_instructions_.begin(), - TestInstruction::deleted_instructions_.end()); - EXPECT_THAT(TestInstruction::created_instructions_, - ContainerEq(TestInstruction::deleted_instructions_)); -} - -// Test the |InsertBefore| with a single instruction in the iterator class. -// Need to make sure the elements are inserted in the correct order, and the -// return value points to the correct location. -// -// Comparing addresses to make sure they remain stable, so other data structures -// can have pointers to instructions in InstructionList. -TEST(InstructionListTest, InsertBefore1) { - InstructionList list; - std::vector inserted_instructions; - for (int i = 0; i < 4; i++) { - std::unique_ptr inst(new Instruction()); - inserted_instructions.push_back(inst.get()); - auto new_element = list.end().InsertBefore(std::move(inst)); - EXPECT_EQ(&*new_element, inserted_instructions.back()); - } - - std::vector output; - for (auto& i : list) { - output.push_back(&i); - } - EXPECT_THAT(output, ContainerEq(inserted_instructions)); -} - -// Test inserting an entire vector of instructions using InsertBefore. Checking -// the order of insertion and the return value. -// -// Comparing addresses to make sure they remain stable, so other data structures -// can have pointers to instructions in InstructionList. -TEST(InstructionListTest, InsertBefore2) { - InstructionList list; - std::vector> new_instructions; - std::vector created_instructions; - for (int i = 0; i < 4; i++) { - std::unique_ptr inst(new Instruction()); - created_instructions.push_back(inst.get()); - new_instructions.push_back(std::move(inst)); - } - auto new_element = list.begin().InsertBefore(std::move(new_instructions)); - EXPECT_TRUE(new_instructions.empty()); - EXPECT_EQ(&*new_element, created_instructions.front()); - - std::vector output; - for (auto& i : list) { - output.push_back(&i); - } - EXPECT_THAT(output, ContainerEq(created_instructions)); -} -} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/instruction_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/instruction_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/instruction_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/instruction_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,224 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "opt/instruction.h" - -#include "gmock/gmock.h" - -#include "spirv-tools/libspirv.h" -#include "unit_spirv.h" - -namespace { - -using spvtest::MakeInstruction; -using spvtools::ir::Instruction; -using spvtools::ir::Operand; -using ::testing::Eq; - -TEST(InstructionTest, CreateTrivial) { - Instruction empty; - EXPECT_EQ(SpvOpNop, empty.opcode()); - EXPECT_EQ(0u, empty.type_id()); - EXPECT_EQ(0u, empty.result_id()); - EXPECT_EQ(0u, empty.NumOperands()); - EXPECT_EQ(0u, empty.NumOperandWords()); - EXPECT_EQ(0u, empty.NumInOperandWords()); - EXPECT_EQ(empty.cend(), empty.cbegin()); - EXPECT_EQ(empty.end(), empty.begin()); -} - -TEST(InstructionTest, CreateWithOpcodeAndNoOperands) { - Instruction inst(SpvOpReturn); - EXPECT_EQ(SpvOpReturn, inst.opcode()); - EXPECT_EQ(0u, inst.type_id()); - EXPECT_EQ(0u, inst.result_id()); - EXPECT_EQ(0u, inst.NumOperands()); - EXPECT_EQ(0u, inst.NumOperandWords()); - EXPECT_EQ(0u, inst.NumInOperandWords()); - EXPECT_EQ(inst.cend(), inst.cbegin()); - EXPECT_EQ(inst.end(), inst.begin()); -} - -// The words for an OpTypeInt for 32-bit signed integer resulting in Id 44. -uint32_t kSampleInstructionWords[] = {(4 << 16) | uint32_t(SpvOpTypeInt), 44, - 32, 1}; -// The operands that would be parsed from kSampleInstructionWords -spv_parsed_operand_t kSampleParsedOperands[] = { - {1, 1, SPV_OPERAND_TYPE_RESULT_ID, SPV_NUMBER_NONE, 0}, - {2, 1, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_NUMBER_UNSIGNED_INT, 32}, - {3, 1, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_NUMBER_UNSIGNED_INT, 1}, -}; - -// A valid parse of kSampleParsedOperands. -spv_parsed_instruction_t kSampleParsedInstruction = {kSampleInstructionWords, - uint16_t(4), - uint16_t(SpvOpTypeInt), - SPV_EXT_INST_TYPE_NONE, - 0, // type id - 44, // result id - kSampleParsedOperands, - 3}; - -// The words for an OpAccessChain instruction. -uint32_t kSampleAccessChainInstructionWords[] = { - (7 << 16) | uint32_t(SpvOpAccessChain), 100, 101, 102, 103, 104, 105}; - -// The operands that would be parsed from kSampleAccessChainInstructionWords. -spv_parsed_operand_t kSampleAccessChainOperands[] = { - {1, 1, SPV_OPERAND_TYPE_RESULT_ID, SPV_NUMBER_NONE, 0}, - {2, 1, SPV_OPERAND_TYPE_TYPE_ID, SPV_NUMBER_NONE, 0}, - {3, 1, SPV_OPERAND_TYPE_ID, SPV_NUMBER_NONE, 0}, - {4, 1, SPV_OPERAND_TYPE_ID, SPV_NUMBER_NONE, 0}, - {5, 1, SPV_OPERAND_TYPE_ID, SPV_NUMBER_NONE, 0}, - {6, 1, SPV_OPERAND_TYPE_ID, SPV_NUMBER_NONE, 0}, -}; - -// A valid parse of kSampleAccessChainInstructionWords -spv_parsed_instruction_t kSampleAccessChainInstruction = { - kSampleAccessChainInstructionWords, - uint16_t(7), - uint16_t(SpvOpAccessChain), - SPV_EXT_INST_TYPE_NONE, - 100, // type id - 101, // result id - kSampleAccessChainOperands, - 6}; - -// The words for an OpControlBarrier instruction. -uint32_t kSampleControlBarrierInstructionWords[] = { - (4 << 16) | uint32_t(SpvOpControlBarrier), 100, 101, 102}; - -// The operands that would be parsed from kSampleControlBarrierInstructionWords. -spv_parsed_operand_t kSampleControlBarrierOperands[] = { - {1, 1, SPV_OPERAND_TYPE_SCOPE_ID, SPV_NUMBER_NONE, 0}, // Execution - {2, 1, SPV_OPERAND_TYPE_SCOPE_ID, SPV_NUMBER_NONE, 0}, // Memory - {3, 1, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_NUMBER_NONE, - 0}, // Semantics -}; - -// A valid parse of kSampleControlBarrierInstructionWords -spv_parsed_instruction_t kSampleControlBarrierInstruction = { - kSampleControlBarrierInstructionWords, - uint16_t(4), - uint16_t(SpvOpControlBarrier), - SPV_EXT_INST_TYPE_NONE, - 0, // type id - 0, // result id - kSampleControlBarrierOperands, - 3}; - -TEST(InstructionTest, CreateWithOpcodeAndOperands) { - Instruction inst(kSampleParsedInstruction); - EXPECT_EQ(SpvOpTypeInt, inst.opcode()); - EXPECT_EQ(0u, inst.type_id()); - EXPECT_EQ(44u, inst.result_id()); - EXPECT_EQ(3u, inst.NumOperands()); - EXPECT_EQ(3u, inst.NumOperandWords()); - EXPECT_EQ(2u, inst.NumInOperandWords()); -} - -TEST(InstructionTest, GetOperand) { - Instruction inst(kSampleParsedInstruction); - EXPECT_THAT(inst.GetOperand(0).words, Eq(std::vector{44})); - EXPECT_THAT(inst.GetOperand(1).words, Eq(std::vector{32})); - EXPECT_THAT(inst.GetOperand(2).words, Eq(std::vector{1})); -} - -TEST(InstructionTest, GetInOperand) { - Instruction inst(kSampleParsedInstruction); - EXPECT_THAT(inst.GetInOperand(0).words, Eq(std::vector{32})); - EXPECT_THAT(inst.GetInOperand(1).words, Eq(std::vector{1})); -} - -TEST(InstructionTest, OperandConstIterators) { - Instruction inst(kSampleParsedInstruction); - // Spot check iteration across operands. - auto cbegin = inst.cbegin(); - auto cend = inst.cend(); - EXPECT_NE(cend, inst.cbegin()); - - auto citer = inst.cbegin(); - for (int i = 0; i < 3; ++i, ++citer) { - const auto& operand = *citer; - EXPECT_THAT(operand.type, Eq(kSampleParsedOperands[i].type)); - EXPECT_THAT(operand.words, - Eq(std::vector{kSampleInstructionWords[i + 1]})); - EXPECT_NE(cend, citer); - } - EXPECT_EQ(cend, citer); - - // Check that cbegin and cend have not changed. - EXPECT_EQ(cbegin, inst.cbegin()); - EXPECT_EQ(cend, inst.cend()); - - // Check arithmetic. - const Operand& operand2 = *(inst.cbegin() + 2); - EXPECT_EQ(SPV_OPERAND_TYPE_LITERAL_INTEGER, operand2.type); -} - -TEST(InstructionTest, OperandIterators) { - Instruction inst(kSampleParsedInstruction); - // Spot check iteration across operands, with mutable iterators. - auto begin = inst.begin(); - auto end = inst.end(); - EXPECT_NE(end, inst.begin()); - - auto iter = inst.begin(); - for (int i = 0; i < 3; ++i, ++iter) { - const auto& operand = *iter; - EXPECT_THAT(operand.type, Eq(kSampleParsedOperands[i].type)); - EXPECT_THAT(operand.words, - Eq(std::vector{kSampleInstructionWords[i + 1]})); - EXPECT_NE(end, iter); - } - EXPECT_EQ(end, iter); - - // Check that begin and end have not changed. - EXPECT_EQ(begin, inst.begin()); - EXPECT_EQ(end, inst.end()); - - // Check arithmetic. - Operand& operand2 = *(inst.begin() + 2); - EXPECT_EQ(SPV_OPERAND_TYPE_LITERAL_INTEGER, operand2.type); - - // Check mutation through an iterator. - operand2.type = SPV_OPERAND_TYPE_TYPE_ID; - EXPECT_EQ(SPV_OPERAND_TYPE_TYPE_ID, (*(inst.cbegin() + 2)).type); -} - -TEST(InstructionTest, ForInIdStandardIdTypes) { - Instruction inst(kSampleAccessChainInstruction); - - std::vector ids; - inst.ForEachInId([&ids](const uint32_t* idptr) { ids.push_back(*idptr); }); - EXPECT_THAT(ids, Eq(std::vector{102, 103, 104, 105})); - - ids.clear(); - inst.ForEachInId([&ids](uint32_t* idptr) { ids.push_back(*idptr); }); - EXPECT_THAT(ids, Eq(std::vector{102, 103, 104, 105})); -} - -TEST(InstructionTest, ForInIdNonstandardIdTypes) { - Instruction inst(kSampleControlBarrierInstruction); - - std::vector ids; - inst.ForEachInId([&ids](const uint32_t* idptr) { ids.push_back(*idptr); }); - EXPECT_THAT(ids, Eq(std::vector{100, 101, 102})); - - ids.clear(); - inst.ForEachInId([&ids](uint32_t* idptr) { ids.push_back(*idptr); }); - EXPECT_THAT(ids, Eq(std::vector{100, 101, 102})); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/ir_loader_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/ir_loader_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/ir_loader_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/ir_loader_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,381 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include -#include - -#include "message.h" -#include "opt/build_module.h" -#include "spirv-tools/libspirv.hpp" - -namespace { - -using namespace spvtools; - -void DoRoundTripCheck(const std::string& text) { - SpirvTools t(SPV_ENV_UNIVERSAL_1_1); - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text); - ASSERT_NE(nullptr, module) << "Failed to assemble\n" << text; - - std::vector binary; - module->ToBinary(&binary, /* skip_nop = */ false); - - std::string disassembled_text; - EXPECT_TRUE(t.Disassemble(binary, &disassembled_text)); - EXPECT_EQ(text, disassembled_text); -} - -TEST(IrBuilder, RoundTrip) { - // #version 310 es - // int add(int a, int b) { return a + b; } - // void main() { add(1, 2); } - DoRoundTripCheck( - // clang-format off - "OpCapability Shader\n" - "%1 = OpExtInstImport \"GLSL.std.450\"\n" - "OpMemoryModel Logical GLSL450\n" - "OpEntryPoint Vertex %main \"main\"\n" - "OpSource ESSL 310\n" - "OpSourceExtension \"GL_GOOGLE_cpp_style_line_directive\"\n" - "OpSourceExtension \"GL_GOOGLE_include_directive\"\n" - "OpName %main \"main\"\n" - "OpName %add_i1_i1_ \"add(i1;i1;\"\n" - "OpName %a \"a\"\n" - "OpName %b \"b\"\n" - "OpName %param \"param\"\n" - "OpName %param_0 \"param\"\n" - "%void = OpTypeVoid\n" - "%9 = OpTypeFunction %void\n" - "%int = OpTypeInt 32 1\n" - "%_ptr_Function_int = OpTypePointer Function %int\n" - "%12 = OpTypeFunction %int %_ptr_Function_int %_ptr_Function_int\n" - "%int_1 = OpConstant %int 1\n" - "%int_2 = OpConstant %int 2\n" - "%main = OpFunction %void None %9\n" - "%15 = OpLabel\n" - "%param = OpVariable %_ptr_Function_int Function\n" - "%param_0 = OpVariable %_ptr_Function_int Function\n" - "OpStore %param %int_1\n" - "OpStore %param_0 %int_2\n" - "%16 = OpFunctionCall %int %add_i1_i1_ %param %param_0\n" - "OpReturn\n" - "OpFunctionEnd\n" - "%add_i1_i1_ = OpFunction %int None %12\n" - "%a = OpFunctionParameter %_ptr_Function_int\n" - "%b = OpFunctionParameter %_ptr_Function_int\n" - "%17 = OpLabel\n" - "%18 = OpLoad %int %a\n" - "%19 = OpLoad %int %b\n" - "%20 = OpIAdd %int %18 %19\n" - "OpReturnValue %20\n" - "OpFunctionEnd\n"); - // clang-format on -} - -TEST(IrBuilder, RoundTripIncompleteBasicBlock) { - DoRoundTripCheck( - "%2 = OpFunction %1 None %3\n" - "%4 = OpLabel\n" - "OpNop\n"); -} - -TEST(IrBuilder, RoundTripIncompleteFunction) { - DoRoundTripCheck("%2 = OpFunction %1 None %3\n"); -} - -TEST(IrBuilder, KeepLineDebugInfo) { - // #version 310 es - // void main() {} - DoRoundTripCheck( - // clang-format off - "OpCapability Shader\n" - "%1 = OpExtInstImport \"GLSL.std.450\"\n" - "OpMemoryModel Logical GLSL450\n" - "OpEntryPoint Vertex %main \"main\"\n" - "%3 = OpString \"minimal.vert\"\n" - "OpSource ESSL 310\n" - "OpName %main \"main\"\n" - "OpLine %3 10 10\n" - "%void = OpTypeVoid\n" - "OpLine %3 100 100\n" - "%5 = OpTypeFunction %void\n" - "%main = OpFunction %void None %5\n" - "OpLine %3 1 1\n" - "OpNoLine\n" - "OpLine %3 2 2\n" - "OpLine %3 3 3\n" - "%6 = OpLabel\n" - "OpLine %3 4 4\n" - "OpNoLine\n" - "OpReturn\n" - "OpFunctionEnd\n"); - // clang-format on -} - -TEST(IrBuilder, LocalGlobalVariables) { - // #version 310 es - // - // float gv1 = 10.; - // float gv2 = 100.; - // - // float f() { - // float lv1 = gv1 + gv2; - // float lv2 = gv1 * gv2; - // return lv1 / lv2; - // } - // - // void main() { - // float lv1 = gv1 - gv2; - // } - DoRoundTripCheck( - // clang-format off - "OpCapability Shader\n" - "%1 = OpExtInstImport \"GLSL.std.450\"\n" - "OpMemoryModel Logical GLSL450\n" - "OpEntryPoint Vertex %main \"main\"\n" - "OpSource ESSL 310\n" - "OpName %main \"main\"\n" - "OpName %f_ \"f(\"\n" - "OpName %gv1 \"gv1\"\n" - "OpName %gv2 \"gv2\"\n" - "OpName %lv1 \"lv1\"\n" - "OpName %lv2 \"lv2\"\n" - "OpName %lv1_0 \"lv1\"\n" - "%void = OpTypeVoid\n" - "%10 = OpTypeFunction %void\n" - "%float = OpTypeFloat 32\n" - "%12 = OpTypeFunction %float\n" - "%_ptr_Private_float = OpTypePointer Private %float\n" - "%gv1 = OpVariable %_ptr_Private_float Private\n" - "%float_10 = OpConstant %float 10\n" - "%gv2 = OpVariable %_ptr_Private_float Private\n" - "%float_100 = OpConstant %float 100\n" - "%_ptr_Function_float = OpTypePointer Function %float\n" - "%main = OpFunction %void None %10\n" - "%17 = OpLabel\n" - "%lv1_0 = OpVariable %_ptr_Function_float Function\n" - "OpStore %gv1 %float_10\n" - "OpStore %gv2 %float_100\n" - "%18 = OpLoad %float %gv1\n" - "%19 = OpLoad %float %gv2\n" - "%20 = OpFSub %float %18 %19\n" - "OpStore %lv1_0 %20\n" - "OpReturn\n" - "OpFunctionEnd\n" - "%f_ = OpFunction %float None %12\n" - "%21 = OpLabel\n" - "%lv1 = OpVariable %_ptr_Function_float Function\n" - "%lv2 = OpVariable %_ptr_Function_float Function\n" - "%22 = OpLoad %float %gv1\n" - "%23 = OpLoad %float %gv2\n" - "%24 = OpFAdd %float %22 %23\n" - "OpStore %lv1 %24\n" - "%25 = OpLoad %float %gv1\n" - "%26 = OpLoad %float %gv2\n" - "%27 = OpFMul %float %25 %26\n" - "OpStore %lv2 %27\n" - "%28 = OpLoad %float %lv1\n" - "%29 = OpLoad %float %lv2\n" - "%30 = OpFDiv %float %28 %29\n" - "OpReturnValue %30\n" - "OpFunctionEnd\n"); - // clang-format on -} - -TEST(IrBuilder, OpUndefOutsideFunction) { - // #version 310 es - // void main() {} - const std::string text = - // clang-format off - "OpMemoryModel Logical GLSL450\n" - "%int = OpTypeInt 32 1\n" - "%uint = OpTypeInt 32 0\n" - "%float = OpTypeFloat 32\n" - "%4 = OpUndef %int\n" - "%int_10 = OpConstant %int 10\n" - "%6 = OpUndef %uint\n" - "%bool = OpTypeBool\n" - "%8 = OpUndef %float\n" - "%double = OpTypeFloat 64\n"; - // clang-format on - - SpirvTools t(SPV_ENV_UNIVERSAL_1_1); - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text); - ASSERT_NE(nullptr, module); - - const auto opundef_count = std::count_if( - module->types_values_begin(), module->types_values_end(), - [](const ir::Instruction& inst) { return inst.opcode() == SpvOpUndef; }); - EXPECT_EQ(3, opundef_count); - - std::vector binary; - module->ToBinary(&binary, /* skip_nop = */ false); - - std::string disassembled_text; - EXPECT_TRUE(t.Disassemble(binary, &disassembled_text)); - EXPECT_EQ(text, disassembled_text); -} - -TEST(IrBuilder, OpUndefInBasicBlock) { - DoRoundTripCheck( - // clang-format off - "OpMemoryModel Logical GLSL450\n" - "OpName %main \"main\"\n" - "%void = OpTypeVoid\n" - "%uint = OpTypeInt 32 0\n" - "%double = OpTypeFloat 64\n" - "%5 = OpTypeFunction %void\n" - "%main = OpFunction %void None %5\n" - "%6 = OpLabel\n" - "%7 = OpUndef %uint\n" - "%8 = OpUndef %double\n" - "OpReturn\n" - "OpFunctionEnd\n"); - // clang-format on -} - -TEST(IrBuilder, KeepLineDebugInfoBeforeType) { - DoRoundTripCheck( - // clang-format off - "OpCapability Shader\n" - "OpMemoryModel Logical GLSL450\n" - "%1 = OpString \"minimal.vert\"\n" - "OpLine %1 1 1\n" - "OpNoLine\n" - "%void = OpTypeVoid\n" - "OpLine %1 2 2\n" - "%3 = OpTypeFunction %void\n"); - // clang-format on -} - -TEST(IrBuilder, KeepLineDebugInfoBeforeLabel) { - DoRoundTripCheck( - // clang-format off - "OpCapability Shader\n" - "OpMemoryModel Logical GLSL450\n" - "%1 = OpString \"minimal.vert\"\n" - "%void = OpTypeVoid\n" - "%3 = OpTypeFunction %void\n" - "%4 = OpFunction %void None %3\n" - "%5 = OpLabel\n" - "OpBranch %6\n" - "OpLine %1 1 1\n" - "OpLine %1 2 2\n" - "%6 = OpLabel\n" - "OpBranch %7\n" - "OpLine %1 100 100\n" - "%7 = OpLabel\n" - "OpReturn\n" - "OpFunctionEnd\n"); - // clang-format on -} - -TEST(IrBuilder, KeepLineDebugInfoBeforeFunctionEnd) { - DoRoundTripCheck( - // clang-format off - "OpCapability Shader\n" - "OpMemoryModel Logical GLSL450\n" - "%1 = OpString \"minimal.vert\"\n" - "%void = OpTypeVoid\n" - "%3 = OpTypeFunction %void\n" - "%4 = OpFunction %void None %3\n" - "OpLine %1 1 1\n" - "OpLine %1 2 2\n" - "OpFunctionEnd\n"); - // clang-format on -} - -TEST(IrBuilder, KeepModuleProcessedInRightPlace) { - DoRoundTripCheck( - // clang-format off - "OpCapability Shader\n" - "OpMemoryModel Logical GLSL450\n" - "%1 = OpString \"minimal.vert\"\n" - "OpName %void \"void\"\n" - "OpModuleProcessed \"Made it faster\"\n" - "OpModuleProcessed \".. and smaller\"\n" - "%void = OpTypeVoid\n"); - // clang-format on -} - -// Checks the given |error_message| is reported when trying to build a module -// from the given |assembly|. -void DoErrorMessageCheck(const std::string& assembly, - const std::string& error_message) { - auto consumer = [error_message](spv_message_level_t level, const char* source, - const spv_position_t& position, - const char* m) { - EXPECT_EQ(error_message, StringifyMessage(level, source, position, m)); - }; - - SpirvTools t(SPV_ENV_UNIVERSAL_1_1); - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, std::move(consumer), assembly); - EXPECT_EQ(nullptr, module); -} - -TEST(IrBuilder, FunctionInsideFunction) { - DoErrorMessageCheck("%2 = OpFunction %1 None %3\n%5 = OpFunction %4 None %6", - "error: :2:0:0: function inside function"); -} - -TEST(IrBuilder, MismatchOpFunctionEnd) { - DoErrorMessageCheck("OpFunctionEnd", - "error: :1:0:0: OpFunctionEnd without " - "corresponding OpFunction"); -} - -TEST(IrBuilder, OpFunctionEndInsideBasicBlock) { - DoErrorMessageCheck( - "%2 = OpFunction %1 None %3\n" - "%4 = OpLabel\n" - "OpFunctionEnd", - "error: :3:0:0: OpFunctionEnd inside basic block"); -} - -TEST(IrBuilder, BasicBlockOutsideFunction) { - DoErrorMessageCheck("OpCapability Shader\n%1 = OpLabel", - "error: :2:0:0: OpLabel outside function"); -} - -TEST(IrBuilder, OpLabelInsideBasicBlock) { - DoErrorMessageCheck( - "%2 = OpFunction %1 None %3\n" - "%4 = OpLabel\n" - "%5 = OpLabel", - "error: :3:0:0: OpLabel inside basic block"); -} - -TEST(IrBuilder, TerminatorOutsideFunction) { - DoErrorMessageCheck( - "OpReturn", - "error: :1:0:0: terminator instruction outside function"); -} - -TEST(IrBuilder, TerminatorOutsideBasicBlock) { - DoErrorMessageCheck("%2 = OpFunction %1 None %3\nOpReturn", - "error: :2:0:0: terminator instruction " - "outside basic block"); -} - -TEST(IrBuilder, NotAllowedInstAppearingInFunction) { - DoErrorMessageCheck("%2 = OpFunction %1 None %3\n%5 = OpVariable %4 Function", - "error: :2:0:0: Non-OpFunctionParameter " - "(opcode: 59) found inside function but outside basic " - "block"); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/iterator_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/iterator_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/iterator_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/iterator_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,217 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include -#include - -#include "gmock/gmock.h" - -#include "opt/iterator.h" -#include "opt/make_unique.h" - -namespace { - -using namespace spvtools; -using ::testing::ContainerEq; - -TEST(Iterator, IncrementDeref) { - const int count = 100; - std::vector> data; - for (int i = 0; i < count; ++i) { - data.emplace_back(new int(i)); - } - - ir::UptrVectorIterator it(&data, data.begin()); - ir::UptrVectorIterator end(&data, data.end()); - - EXPECT_EQ(*data[0], *it); - for (int i = 1; i < count; ++i) { - EXPECT_NE(end, it); - EXPECT_EQ(*data[i], *(++it)); - } - EXPECT_EQ(end, ++it); -} - -TEST(Iterator, DecrementDeref) { - const int count = 100; - std::vector> data; - for (int i = 0; i < count; ++i) { - data.emplace_back(new int(i)); - } - - ir::UptrVectorIterator begin(&data, data.begin()); - ir::UptrVectorIterator it(&data, data.end()); - - for (int i = count - 1; i >= 0; --i) { - EXPECT_NE(begin, it); - EXPECT_EQ(*data[i], *(--it)); - } - EXPECT_EQ(begin, it); -} - -TEST(Iterator, PostIncrementDeref) { - const int count = 100; - std::vector> data; - for (int i = 0; i < count; ++i) { - data.emplace_back(new int(i)); - } - - ir::UptrVectorIterator it(&data, data.begin()); - ir::UptrVectorIterator end(&data, data.end()); - - for (int i = 0; i < count; ++i) { - EXPECT_NE(end, it); - EXPECT_EQ(*data[i], *(it++)); - } - EXPECT_EQ(end, it); -} - -TEST(Iterator, PostDecrementDeref) { - const int count = 100; - std::vector> data; - for (int i = 0; i < count; ++i) { - data.emplace_back(new int(i)); - } - - ir::UptrVectorIterator begin(&data, data.begin()); - ir::UptrVectorIterator end(&data, data.end()); - ir::UptrVectorIterator it(&data, data.end()); - - EXPECT_EQ(end, it--); - for (int i = count - 1; i >= 1; --i) { - EXPECT_EQ(*data[i], *(it--)); - } - // Decrementing .begin() is undefined behavior. - EXPECT_EQ(*data[0], *it); -} - -TEST(Iterator, Access) { - const int count = 100; - std::vector> data; - for (int i = 0; i < count; ++i) { - data.emplace_back(new int(i)); - } - - ir::UptrVectorIterator it(&data, data.begin()); - - for (int i = 0; i < count; ++i) EXPECT_EQ(*data[i], it[i]); -} - -TEST(Iterator, Comparison) { - const int count = 100; - std::vector> data; - for (int i = 0; i < count; ++i) { - data.emplace_back(new int(i)); - } - - ir::UptrVectorIterator it(&data, data.begin()); - ir::UptrVectorIterator end(&data, data.end()); - - for (int i = 0; i < count; ++i, ++it) EXPECT_TRUE(it < end); - EXPECT_EQ(end, it); -} - -TEST(Iterator, InsertBeginEnd) { - const int count = 100; - - std::vector> data; - std::vector expected; - std::vector actual; - - for (int i = 0; i < count; ++i) { - data.emplace_back(new int(i)); - expected.push_back(i); - } - - // Insert at the beginning - expected.insert(expected.begin(), -100); - ir::UptrVectorIterator begin(&data, data.begin()); - auto insert_point = begin.InsertBefore(MakeUnique(-100)); - for (int i = 0; i < count + 1; ++i) { - actual.push_back(*(insert_point++)); - } - EXPECT_THAT(actual, ContainerEq(expected)); - - // Insert at the end - expected.push_back(-42); - expected.push_back(-36); - expected.push_back(-77); - ir::UptrVectorIterator end(&data, data.end()); - end = end.InsertBefore(MakeUnique(-77)); - end = end.InsertBefore(MakeUnique(-36)); - end = end.InsertBefore(MakeUnique(-42)); - - actual.clear(); - begin = ir::UptrVectorIterator(&data, data.begin()); - for (int i = 0; i < count + 4; ++i) { - actual.push_back(*(begin++)); - } - EXPECT_THAT(actual, ContainerEq(expected)); -} - -TEST(Iterator, InsertMiddle) { - const int count = 100; - - std::vector> data; - std::vector expected; - std::vector actual; - - for (int i = 0; i < count; ++i) { - data.emplace_back(new int(i)); - expected.push_back(i); - } - - const int insert_pos = 42; - expected.insert(expected.begin() + insert_pos, -100); - expected.insert(expected.begin() + insert_pos, -42); - - ir::UptrVectorIterator it(&data, data.begin()); - for (int i = 0; i < insert_pos; ++i) ++it; - it = it.InsertBefore(MakeUnique(-100)); - it = it.InsertBefore(MakeUnique(-42)); - auto begin = ir::UptrVectorIterator(&data, data.begin()); - for (int i = 0; i < count + 2; ++i) { - actual.push_back(*(begin++)); - } - EXPECT_THAT(actual, ContainerEq(expected)); -} - -TEST(IteratorRange, Interface) { - const uint32_t count = 100; - - std::vector> data; - - for (uint32_t i = 0; i < count; ++i) { - data.emplace_back(new uint32_t(i)); - } - - auto b = ir::UptrVectorIterator(&data, data.begin()); - auto e = ir::UptrVectorIterator(&data, data.end()); - auto range = ir::IteratorRange(b, e); - - EXPECT_EQ(b, range.begin()); - EXPECT_EQ(e, range.end()); - EXPECT_FALSE(range.empty()); - EXPECT_EQ(count, range.size()); - EXPECT_EQ(0u, *range.begin()); - EXPECT_EQ(99u, *(--range.end())); - - // IteratorRange itself is immutable. - ++b, --e; - EXPECT_EQ(count, range.size()); - ++range.begin(), --range.end(); - EXPECT_EQ(count, range.size()); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/line_debug_info_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/line_debug_info_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/line_debug_info_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/line_debug_info_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; - -// A pass turning all none debug line instructions into Nop. -class NopifyPass : public opt::Pass { - public: - const char* name() const override { return "NopifyPass"; } - Status Process(ir::Module* module) override { - bool modified = false; - module->ForEachInst( - [&modified](ir::Instruction* inst) { - inst->ToNop(); - modified = true; - }, - /* run_on_debug_line_insts = */ false); - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; - } -}; - -using PassTestForLineDebugInfo = PassTest<::testing::Test>; - -// This test's purpose to show our implementation choice: line debug info is -// preserved even if the following instruction is killed. It serves as a guard -// of potential behavior changes. -TEST_F(PassTestForLineDebugInfo, KeepLineDebugInfo) { - // clang-format off - const char* text = - "OpCapability Shader " - "%1 = OpExtInstImport \"GLSL.std.450\" " - "OpMemoryModel Logical GLSL450 " - "OpEntryPoint Vertex %2 \"main\" " - "%3 = OpString \"minimal.vert\" " - "OpNoLine " - "OpLine %3 10 10 " - "%void = OpTypeVoid " - "OpLine %3 100 100 " - "%5 = OpTypeFunction %void " - "%2 = OpFunction %void None %5 " - "OpLine %3 1 1 " - "OpNoLine " - "OpLine %3 2 2 " - "OpLine %3 3 3 " - "%6 = OpLabel " - "OpLine %3 4 4 " - "OpNoLine " - "OpReturn " - "OpLine %3 4 4 " - "OpNoLine " - "OpFunctionEnd "; - // clang-format on - - const char* result_keep_nop = - "OpNop\n" - "OpNop\n" - "OpNop\n" - "OpNop\n" - "OpNop\n" - "OpNoLine\n" - "OpLine %3 10 10\n" - "OpNop\n" - "OpLine %3 100 100\n" - "OpNop\n" - "OpNop\n" - "OpLine %3 1 1\n" - "OpNoLine\n" - "OpLine %3 2 2\n" - "OpLine %3 3 3\n" - "OpNop\n" - "OpLine %3 4 4\n" - "OpNoLine\n" - "OpNop\n" - "OpLine %3 4 4\n" - "OpNoLine\n" - "OpNop\n"; - SinglePassRunAndCheck(text, result_keep_nop, - /* skip_nop = */ false); - const char* result_skip_nop = - "OpNoLine\n" - "OpLine %3 10 10\n" - "OpLine %3 100 100\n" - "OpLine %3 1 1\n" - "OpNoLine\n" - "OpLine %3 2 2\n" - "OpLine %3 3 3\n" - "OpLine %3 4 4\n" - "OpNoLine\n" - "OpLine %3 4 4\n" - "OpNoLine\n"; - SinglePassRunAndCheck(text, result_skip_nop, - /* skip_nop = */ true); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/local_access_chain_convert_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/local_access_chain_convert_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/local_access_chain_convert_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/local_access_chain_convert_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,619 +0,0 @@ -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; - -using LocalAccessChainConvertTest = PassTest<::testing::Test>; - -TEST_F(LocalAccessChainConvertTest, StructOfVecsOfFloatConverted) { - - // #version 140 - // - // in vec4 BaseColor; - // - // struct S_t { - // vec4 v0; - // vec4 v1; - // }; - // - // void main() - // { - // S_t s0; - // s0.v1 = BaseColor; - // gl_FragColor = s0.v1; - // } - - const std::string predefs_before = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpName %s0 "s0" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%S_t = OpTypeStruct %v4float %v4float -%_ptr_Function_S_t = OpTypePointer Function %S_t -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string predefs_after = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpName %s0 "s0" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%S_t = OpTypeStruct %v4float %v4float -%_ptr_Function_S_t = OpTypePointer Function %S_t -%int = OpTypeInt 32 1 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %8 -%17 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%18 = OpLoad %v4float %BaseColor -%19 = OpAccessChain %_ptr_Function_v4float %s0 %int_1 -OpStore %19 %18 -%20 = OpAccessChain %_ptr_Function_v4float %s0 %int_1 -%21 = OpLoad %v4float %20 -OpStore %gl_FragColor %21 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %8 -%17 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%18 = OpLoad %v4float %BaseColor -%22 = OpLoad %S_t %s0 -%23 = OpCompositeInsert %S_t %18 %22 1 -OpStore %s0 %23 -%24 = OpLoad %S_t %s0 -%25 = OpCompositeExtract %v4float %24 1 -OpStore %gl_FragColor %25 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs_before + before, predefs_after + after, true, true); -} - -TEST_F(LocalAccessChainConvertTest, InBoundsAccessChainsConverted) { - - // #version 140 - // - // in vec4 BaseColor; - // - // struct S_t { - // vec4 v0; - // vec4 v1; - // }; - // - // void main() - // { - // S_t s0; - // s0.v1 = BaseColor; - // gl_FragColor = s0.v1; - // } - - const std::string predefs_before = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpName %s0 "s0" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%S_t = OpTypeStruct %v4float %v4float -%_ptr_Function_S_t = OpTypePointer Function %S_t -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string predefs_after = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpName %s0 "s0" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%S_t = OpTypeStruct %v4float %v4float -%_ptr_Function_S_t = OpTypePointer Function %S_t -%int = OpTypeInt 32 1 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %8 -%17 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%18 = OpLoad %v4float %BaseColor -%19 = OpInBoundsAccessChain %_ptr_Function_v4float %s0 %int_1 -OpStore %19 %18 -%20 = OpInBoundsAccessChain %_ptr_Function_v4float %s0 %int_1 -%21 = OpLoad %v4float %20 -OpStore %gl_FragColor %21 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %8 -%17 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%18 = OpLoad %v4float %BaseColor -%22 = OpLoad %S_t %s0 -%23 = OpCompositeInsert %S_t %18 %22 1 -OpStore %s0 %23 -%24 = OpLoad %S_t %s0 -%25 = OpCompositeExtract %v4float %24 1 -OpStore %gl_FragColor %25 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs_before + before, predefs_after + after, true, true); -} - -TEST_F(LocalAccessChainConvertTest, TwoUsesofSingleChainConverted) { - - // #version 140 - // - // in vec4 BaseColor; - // - // struct S_t { - // vec4 v0; - // vec4 v1; - // }; - // - // void main() - // { - // S_t s0; - // s0.v1 = BaseColor; - // gl_FragColor = s0.v1; - // } - - const std::string predefs_before = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpName %s0 "s0" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%S_t = OpTypeStruct %v4float %v4float -%_ptr_Function_S_t = OpTypePointer Function %S_t -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string predefs_after = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpName %s0 "s0" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%S_t = OpTypeStruct %v4float %v4float -%_ptr_Function_S_t = OpTypePointer Function %S_t -%int = OpTypeInt 32 1 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %8 -%17 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%18 = OpLoad %v4float %BaseColor -%19 = OpAccessChain %_ptr_Function_v4float %s0 %int_1 -OpStore %19 %18 -%20 = OpLoad %v4float %19 -OpStore %gl_FragColor %20 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %8 -%17 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%18 = OpLoad %v4float %BaseColor -%21 = OpLoad %S_t %s0 -%22 = OpCompositeInsert %S_t %18 %21 1 -OpStore %s0 %22 -%23 = OpLoad %S_t %s0 -%24 = OpCompositeExtract %v4float %23 1 -OpStore %gl_FragColor %24 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs_before + before, predefs_after + after, true, true); -} - -TEST_F(LocalAccessChainConvertTest, OpaqueConverted) { - // SPIR-V not representable in GLSL; not generatable from HLSL - // at the moment - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %outColor %texCoords -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpMemberName %S_t 2 "smp" -OpName %foo_struct_S_t_vf2_vf21_ "foo(struct-S_t-vf2-vf21;" -OpName %s "s" -OpName %outColor "outColor" -OpName %sampler15 "sampler15" -OpName %s0 "s0" -OpName %texCoords "texCoords" -OpName %param "param" -OpDecorate %sampler15 DescriptorSet 0 -%void = OpTypeVoid -%12 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v2float = OpTypeVector %float 2 -%v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%outColor = OpVariable %_ptr_Output_v4float Output -%17 = OpTypeImage %float 2D 0 0 0 1 Unknown -%18 = OpTypeSampledImage %17 -%S_t = OpTypeStruct %v2float %v2float %18 -%_ptr_Function_S_t = OpTypePointer Function %S_t -%20 = OpTypeFunction %void %_ptr_Function_S_t -%_ptr_UniformConstant_18 = OpTypePointer UniformConstant %18 -%_ptr_Function_18 = OpTypePointer Function %18 -%sampler15 = OpVariable %_ptr_UniformConstant_18 UniformConstant -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%int_2 = OpConstant %int 2 -%_ptr_Function_v2float = OpTypePointer Function %v2float -%_ptr_Input_v2float = OpTypePointer Input %v2float -%texCoords = OpVariable %_ptr_Input_v2float Input -)"; - - const std::string before = - R"(%main = OpFunction %void None %12 -%28 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%param = OpVariable %_ptr_Function_S_t Function -%29 = OpLoad %v2float %texCoords -%30 = OpAccessChain %_ptr_Function_v2float %s0 %int_0 -OpStore %30 %29 -%31 = OpLoad %18 %sampler15 -%32 = OpAccessChain %_ptr_Function_18 %s0 %int_2 -OpStore %32 %31 -%33 = OpLoad %S_t %s0 -OpStore %param %33 -%34 = OpAccessChain %_ptr_Function_18 %param %int_2 -%35 = OpLoad %18 %34 -%36 = OpAccessChain %_ptr_Function_v2float %param %int_0 -%37 = OpLoad %v2float %36 -%38 = OpImageSampleImplicitLod %v4float %35 %37 -OpStore %outColor %38 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %12 -%28 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%param = OpVariable %_ptr_Function_S_t Function -%29 = OpLoad %v2float %texCoords -%45 = OpLoad %S_t %s0 -%46 = OpCompositeInsert %S_t %29 %45 0 -OpStore %s0 %46 -%31 = OpLoad %18 %sampler15 -%47 = OpLoad %S_t %s0 -%48 = OpCompositeInsert %S_t %31 %47 2 -OpStore %s0 %48 -%33 = OpLoad %S_t %s0 -OpStore %param %33 -%49 = OpLoad %S_t %param -%50 = OpCompositeExtract %18 %49 2 -%51 = OpLoad %S_t %param -%52 = OpCompositeExtract %v2float %51 0 -%38 = OpImageSampleImplicitLod %v4float %50 %52 -OpStore %outColor %38 -OpReturn -OpFunctionEnd -)"; - - const std::string remain = - R"(%foo_struct_S_t_vf2_vf21_ = OpFunction %void None %20 -%s = OpFunctionParameter %_ptr_Function_S_t -%39 = OpLabel -%40 = OpAccessChain %_ptr_Function_18 %s %int_2 -%41 = OpLoad %18 %40 -%42 = OpAccessChain %_ptr_Function_v2float %s %int_0 -%43 = OpLoad %v2float %42 -%44 = OpImageSampleImplicitLod %v4float %41 %43 -OpStore %outColor %44 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before + remain, predefs + after + remain, true, true); -} - -TEST_F(LocalAccessChainConvertTest, - UntargetedTypeNotConverted) { - - // #version 140 - // - // in vec4 BaseColor; - // - // struct S1_t { - // vec4 v1; - // }; - // - // struct S2_t { - // vec4 v2; - // S1_t s1; - // }; - // - // void main() - // { - // S2_t s2; - // s2.s1.v1 = BaseColor; - // gl_FragColor = s2.s1.v1; - // } - - const std::string assembly = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S1_t "S1_t" -OpMemberName %S1_t 0 "v1" -OpName %S2_t "S2_t" -OpMemberName %S2_t 0 "v2" -OpMemberName %S2_t 1 "s1" -OpName %s2 "s2" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%S1_t = OpTypeStruct %v4float -%S2_t = OpTypeStruct %v4float %S1_t -%_ptr_Function_S2_t = OpTypePointer Function %S2_t -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%int_0 = OpConstant %int 0 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%main = OpFunction %void None %9 -%19 = OpLabel -%s2 = OpVariable %_ptr_Function_S2_t Function -%20 = OpLoad %v4float %BaseColor -%21 = OpAccessChain %_ptr_Function_v4float %s2 %int_1 %int_0 -OpStore %21 %20 -%22 = OpAccessChain %_ptr_Function_v4float %s2 %int_1 %int_0 -%23 = OpLoad %v4float %22 -OpStore %gl_FragColor %23 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - assembly, assembly, false, true); -} - -TEST_F(LocalAccessChainConvertTest, - DynamicallyIndexedVarNotConverted) { - - // #version 140 - // - // in vec4 BaseColor; - // flat in int Idx; - // in float Bi; - // - // struct S_t { - // vec4 v0; - // vec4 v1; - // }; - // - // void main() - // { - // S_t s0; - // s0.v1 = BaseColor; - // s0.v1[Idx] = Bi; - // gl_FragColor = s0.v1; - // } - - const std::string assembly = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %Idx %Bi %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpName %s0 "s0" -OpName %BaseColor "BaseColor" -OpName %Idx "Idx" -OpName %Bi "Bi" -OpName %gl_FragColor "gl_FragColor" -OpDecorate %Idx Flat -%void = OpTypeVoid -%10 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%S_t = OpTypeStruct %v4float %v4float -%_ptr_Function_S_t = OpTypePointer Function %S_t -%int = OpTypeInt 32 1 -%int_1 = OpConstant %int 1 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_int = OpTypePointer Input %int -%Idx = OpVariable %_ptr_Input_int Input -%_ptr_Input_float = OpTypePointer Input %float -%Bi = OpVariable %_ptr_Input_float Input -%_ptr_Function_float = OpTypePointer Function %float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%main = OpFunction %void None %10 -%22 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%23 = OpLoad %v4float %BaseColor -%24 = OpAccessChain %_ptr_Function_v4float %s0 %int_1 -OpStore %24 %23 -%25 = OpLoad %int %Idx -%26 = OpLoad %float %Bi -%27 = OpAccessChain %_ptr_Function_float %s0 %int_1 %25 -OpStore %27 %26 -%28 = OpAccessChain %_ptr_Function_v4float %s0 %int_1 -%29 = OpLoad %v4float %28 -OpStore %gl_FragColor %29 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - assembly, assembly, false, true); -} - -// TODO(greg-lunarg): Add tests to verify handling of these cases: -// -// Assorted vector and matrix types -// Assorted struct array types -// Assorted scalar types -// Assorted non-target types -// OpInBoundsAccessChain -// Others? - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/local_single_block_elim.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/local_single_block_elim.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/local_single_block_elim.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/local_single_block_elim.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,829 +0,0 @@ -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; - -using LocalSingleBlockLoadStoreElimTest = PassTest<::testing::Test>; - -TEST_F(LocalSingleBlockLoadStoreElimTest, SimpleStoreLoadElim) { - // #version 140 - // - // in vec4 BaseColor; - // - // void main() - // { - // vec4 v = BaseColor; - // gl_FragColor = v; - // } - - const std::string predefs_before = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%7 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string predefs_after = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%7 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %7 -%13 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%14 = OpLoad %v4float %BaseColor -OpStore %v %14 -%15 = OpLoad %v4float %v -OpStore %gl_FragColor %15 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %7 -%13 = OpLabel -%14 = OpLoad %v4float %BaseColor -OpStore %gl_FragColor %14 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs_before + before, predefs_after + after, true, true); -} - -TEST_F(LocalSingleBlockLoadStoreElimTest, SimpleLoadLoadElim) { - // #version 140 - // - // in vec4 BaseColor; - // in float fi; - // - // void main() - // { - // vec4 v = BaseColor; - // if (fi < 0) - // v = vec4(0.0); - // gl_FragData[0] = v; - // gl_FragData[1] = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %fi %gl_FragData -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %fi "fi" -OpName %gl_FragData "gl_FragData" -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Input_float = OpTypePointer Input %float -%fi = OpVariable %_ptr_Input_float Input -%float_0 = OpConstant %float 0 -%bool = OpTypeBool -%16 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 -%uint = OpTypeInt 32 0 -%uint_32 = OpConstant %uint 32 -%_arr_v4float_uint_32 = OpTypeArray %v4float %uint_32 -%_ptr_Output__arr_v4float_uint_32 = OpTypePointer Output %_arr_v4float_uint_32 -%gl_FragData = OpVariable %_ptr_Output__arr_v4float_uint_32 Output -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%int_1 = OpConstant %int 1 -)"; - - const std::string before = - R"(%main = OpFunction %void None %8 -%25 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%26 = OpLoad %v4float %BaseColor -OpStore %v %26 -%27 = OpLoad %float %fi -%28 = OpFOrdLessThan %bool %27 %float_0 -OpSelectionMerge %29 None -OpBranchConditional %28 %30 %29 -%30 = OpLabel -OpStore %v %16 -OpBranch %29 -%29 = OpLabel -%31 = OpLoad %v4float %v -%32 = OpAccessChain %_ptr_Output_v4float %gl_FragData %int_0 -OpStore %32 %31 -%33 = OpLoad %v4float %v -%34 = OpAccessChain %_ptr_Output_v4float %gl_FragData %int_1 -OpStore %34 %33 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %8 -%25 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%26 = OpLoad %v4float %BaseColor -OpStore %v %26 -%27 = OpLoad %float %fi -%28 = OpFOrdLessThan %bool %27 %float_0 -OpSelectionMerge %29 None -OpBranchConditional %28 %30 %29 -%30 = OpLabel -OpStore %v %16 -OpBranch %29 -%29 = OpLabel -%31 = OpLoad %v4float %v -%32 = OpAccessChain %_ptr_Output_v4float %gl_FragData %int_0 -OpStore %32 %31 -%34 = OpAccessChain %_ptr_Output_v4float %gl_FragData %int_1 -OpStore %34 %31 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + before, predefs + after, true, true); -} - -TEST_F(LocalSingleBlockLoadStoreElimTest, - NoStoreElimIfInterveningAccessChainLoad) { - // - // Note that even though the Load to %v is eliminated, the Store to %v - // is not eliminated due to the following access chain reference. - // - // #version 140 - // - // in vec4 BaseColor; - // flat in int Idx; - // - // void main() - // { - // vec4 v = BaseColor; - // float f = v[Idx]; - // gl_FragColor = v/f; - // } - - const std::string predefs_before = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %Idx %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %f "f" -OpName %Idx "Idx" -OpName %gl_FragColor "gl_FragColor" -OpDecorate %Idx Flat -%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_float = OpTypePointer Function %float -%int = OpTypeInt 32 1 -%_ptr_Input_int = OpTypePointer Input %int -%Idx = OpVariable %_ptr_Input_int Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string predefs_after = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %Idx %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %Idx "Idx" -OpName %gl_FragColor "gl_FragColor" -OpDecorate %Idx Flat -%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_float = OpTypePointer Function %float -%int = OpTypeInt 32 1 -%_ptr_Input_int = OpTypePointer Input %int -%Idx = OpVariable %_ptr_Input_int Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %9 -%18 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%f = OpVariable %_ptr_Function_float Function -%19 = OpLoad %v4float %BaseColor -OpStore %v %19 -%20 = OpLoad %int %Idx -%21 = OpAccessChain %_ptr_Function_float %v %20 -%22 = OpLoad %float %21 -OpStore %f %22 -%23 = OpLoad %v4float %v -%24 = OpLoad %float %f -%25 = OpCompositeConstruct %v4float %24 %24 %24 %24 -%26 = OpFDiv %v4float %23 %25 -OpStore %gl_FragColor %26 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %9 -%18 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%19 = OpLoad %v4float %BaseColor -OpStore %v %19 -%20 = OpLoad %int %Idx -%21 = OpAccessChain %_ptr_Function_float %v %20 -%22 = OpLoad %float %21 -%25 = OpCompositeConstruct %v4float %22 %22 %22 %22 -%26 = OpFDiv %v4float %19 %25 -OpStore %gl_FragColor %26 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs_before + before, predefs_after + after, true, true); -} - -TEST_F(LocalSingleBlockLoadStoreElimTest, NoElimIfInterveningAccessChainStore) { - // #version 140 - // - // in vec4 BaseColor; - // flat in int Idx; - // - // void main() - // { - // vec4 v = BaseColor; - // v[Idx] = 0; - // gl_FragColor = v; - // } - - const std::string assembly = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %Idx %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %Idx "Idx" -OpName %gl_FragColor "gl_FragColor" -OpDecorate %Idx Flat -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%int = OpTypeInt 32 1 -%_ptr_Input_int = OpTypePointer Input %int -%Idx = OpVariable %_ptr_Input_int Input -%float_0 = OpConstant %float 0 -%_ptr_Function_float = OpTypePointer Function %float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%main = OpFunction %void None %8 -%18 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%19 = OpLoad %v4float %BaseColor -OpStore %v %19 -%20 = OpLoad %int %Idx -%21 = OpAccessChain %_ptr_Function_float %v %20 -OpStore %21 %float_0 -%22 = OpLoad %v4float %v -OpStore %gl_FragColor %22 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - assembly, assembly, false, true); -} - -TEST_F(LocalSingleBlockLoadStoreElimTest, NoElimIfInterveningFunctionCall) { - // #version 140 - // - // in vec4 BaseColor; - // - // void foo() { - // } - // - // void main() - // { - // vec4 v = BaseColor; - // foo(); - // gl_FragColor = v; - // } - - const std::string assembly = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %foo_ "foo(" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%main = OpFunction %void None %8 -%14 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%15 = OpLoad %v4float %BaseColor -OpStore %v %15 -%16 = OpFunctionCall %void %foo_ -%17 = OpLoad %v4float %v -OpStore %gl_FragColor %17 -OpReturn -OpFunctionEnd -%foo_ = OpFunction %void None %8 -%18 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - assembly, assembly, false, true); -} - -TEST_F(LocalSingleBlockLoadStoreElimTest, ElimIfCopyObjectInFunction) { - // Note: SPIR-V hand edited to insert CopyObject - // - // #version 140 - // - // in vec4 BaseColor; - // - // void main() - // { - // vec4 v1 = BaseColor; - // gl_FragData[0] = v1; - // vec4 v2 = BaseColor * 0.5; - // gl_FragData[1] = v2; - // } - - const std::string predefs_before = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragData -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v1 "v1" -OpName %BaseColor "BaseColor" -OpName %gl_FragData "gl_FragData" -OpName %v2 "v2" -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%uint = OpTypeInt 32 0 -%uint_32 = OpConstant %uint 32 -%_arr_v4float_uint_32 = OpTypeArray %v4float %uint_32 -%_ptr_Output__arr_v4float_uint_32 = OpTypePointer Output %_arr_v4float_uint_32 -%gl_FragData = OpVariable %_ptr_Output__arr_v4float_uint_32 Output -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%float_0_5 = OpConstant %float 0.5 -%int_1 = OpConstant %int 1 -)"; - - const std::string predefs_after = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragData -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %BaseColor "BaseColor" -OpName %gl_FragData "gl_FragData" -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%uint = OpTypeInt 32 0 -%uint_32 = OpConstant %uint 32 -%_arr_v4float_uint_32 = OpTypeArray %v4float %uint_32 -%_ptr_Output__arr_v4float_uint_32 = OpTypePointer Output %_arr_v4float_uint_32 -%gl_FragData = OpVariable %_ptr_Output__arr_v4float_uint_32 Output -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%float_0_5 = OpConstant %float 0.5 -%int_1 = OpConstant %int 1 -)"; - - const std::string before = - R"(%main = OpFunction %void None %8 -%22 = OpLabel -%v1 = OpVariable %_ptr_Function_v4float Function -%v2 = OpVariable %_ptr_Function_v4float Function -%23 = OpLoad %v4float %BaseColor -OpStore %v1 %23 -%24 = OpLoad %v4float %v1 -%25 = OpAccessChain %_ptr_Output_v4float %gl_FragData %int_0 -OpStore %25 %24 -%26 = OpLoad %v4float %BaseColor -%27 = OpVectorTimesScalar %v4float %26 %float_0_5 -%28 = OpCopyObject %_ptr_Function_v4float %v2 -OpStore %28 %27 -%29 = OpLoad %v4float %28 -%30 = OpAccessChain %_ptr_Output_v4float %gl_FragData %int_1 -OpStore %30 %29 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %8 -%22 = OpLabel -%23 = OpLoad %v4float %BaseColor -%25 = OpAccessChain %_ptr_Output_v4float %gl_FragData %int_0 -OpStore %25 %23 -%26 = OpLoad %v4float %BaseColor -%27 = OpVectorTimesScalar %v4float %26 %float_0_5 -%30 = OpAccessChain %_ptr_Output_v4float %gl_FragData %int_1 -OpStore %30 %27 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs_before + before, predefs_after + after, true, true); -} - -TEST_F(LocalSingleBlockLoadStoreElimTest, ElimOpaque) { - // SPIR-V not representable in GLSL; not generatable from HLSL - // at the moment - - const std::string predefs_before = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %outColor %texCoords -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpMemberName %S_t 2 "smp" -OpName %outColor "outColor" -OpName %sampler15 "sampler15" -OpName %s0 "s0" -OpName %texCoords "texCoords" -OpName %param "param" -OpDecorate %sampler15 DescriptorSet 0 -%void = OpTypeVoid -%12 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v2float = OpTypeVector %float 2 -%v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%outColor = OpVariable %_ptr_Output_v4float Output -%17 = OpTypeImage %float 2D 0 0 0 1 Unknown -%18 = OpTypeSampledImage %17 -%S_t = OpTypeStruct %v2float %v2float %18 -%_ptr_Function_S_t = OpTypePointer Function %S_t -%20 = OpTypeFunction %void %_ptr_Function_S_t -%_ptr_UniformConstant_18 = OpTypePointer UniformConstant %18 -%_ptr_Function_18 = OpTypePointer Function %18 -%sampler15 = OpVariable %_ptr_UniformConstant_18 UniformConstant -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%int_2 = OpConstant %int 2 -%_ptr_Function_v2float = OpTypePointer Function %v2float -%_ptr_Input_v2float = OpTypePointer Input %v2float -%texCoords = OpVariable %_ptr_Input_v2float Input -)"; - - const std::string predefs_after = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %outColor %texCoords -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %S_t "S_t" -OpMemberName %S_t 0 "v0" -OpMemberName %S_t 1 "v1" -OpMemberName %S_t 2 "smp" -OpName %outColor "outColor" -OpName %sampler15 "sampler15" -OpName %s0 "s0" -OpName %texCoords "texCoords" -OpDecorate %sampler15 DescriptorSet 0 -%void = OpTypeVoid -%10 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v2float = OpTypeVector %float 2 -%v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%outColor = OpVariable %_ptr_Output_v4float Output -%15 = OpTypeImage %float 2D 0 0 0 1 Unknown -%16 = OpTypeSampledImage %15 -%S_t = OpTypeStruct %v2float %v2float %16 -%_ptr_Function_S_t = OpTypePointer Function %S_t -%18 = OpTypeFunction %void %_ptr_Function_S_t -%_ptr_UniformConstant_16 = OpTypePointer UniformConstant %16 -%_ptr_Function_16 = OpTypePointer Function %16 -%sampler15 = OpVariable %_ptr_UniformConstant_16 UniformConstant -%int = OpTypeInt 32 1 -%int_0 = OpConstant %int 0 -%int_2 = OpConstant %int 2 -%_ptr_Function_v2float = OpTypePointer Function %v2float -%_ptr_Input_v2float = OpTypePointer Input %v2float -%texCoords = OpVariable %_ptr_Input_v2float Input -)"; - - const std::string before = - R"( %main = OpFunction %void None %12 -%28 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%param = OpVariable %_ptr_Function_S_t Function -%29 = OpLoad %v2float %texCoords -%30 = OpLoad %S_t %s0 -%31 = OpCompositeInsert %S_t %29 %30 0 -OpStore %s0 %31 -%32 = OpLoad %18 %sampler15 -%33 = OpLoad %S_t %s0 -%34 = OpCompositeInsert %S_t %32 %33 2 -OpStore %s0 %34 -%35 = OpLoad %S_t %s0 -OpStore %param %35 -%36 = OpLoad %S_t %param -%37 = OpCompositeExtract %18 %36 2 -%38 = OpLoad %S_t %param -%39 = OpCompositeExtract %v2float %38 0 -%40 = OpImageSampleImplicitLod %v4float %37 %39 -OpStore %outColor %40 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %10 -%26 = OpLabel -%s0 = OpVariable %_ptr_Function_S_t Function -%27 = OpLoad %v2float %texCoords -%28 = OpLoad %S_t %s0 -%29 = OpCompositeInsert %S_t %27 %28 0 -%30 = OpLoad %16 %sampler15 -%32 = OpCompositeInsert %S_t %30 %29 2 -OpStore %s0 %32 -%35 = OpCompositeExtract %16 %32 2 -%37 = OpCompositeExtract %v2float %32 0 -%38 = OpImageSampleImplicitLod %v4float %35 %37 -OpStore %outColor %38 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs_before + before, predefs_after + after, true, true); -} - -TEST_F(LocalSingleBlockLoadStoreElimTest, PositiveAndNegativeCallTree) { - // Note that the call tree function bar is optimized, but foo is not - // - // #version 140 - // - // in vec4 BaseColor; - // - // vec4 foo(vec4 v1) - // { - // vec4 t = v1; - // return t; - // } - // - // vec4 bar(vec4 v1) - // { - // vec4 t = v1; - // return t; - // } - // - // void main() - // { - // gl_FragColor = bar(BaseColor); - // } - - const std::string predefs_before = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %gl_FragColor %BaseColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %foo_vf4_ "foo(vf4;" -OpName %v1 "v1" -OpName %bar_vf4_ "bar(vf4;" -OpName %v1_0 "v1" -OpName %t "t" -OpName %t_0 "t" -OpName %gl_FragColor "gl_FragColor" -OpName %BaseColor "BaseColor" -OpName %param "param" -%void = OpTypeVoid -%13 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%17 = OpTypeFunction %v4float %_ptr_Function_v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%main = OpFunction %void None %13 -%20 = OpLabel -%param = OpVariable %_ptr_Function_v4float Function -%21 = OpLoad %v4float %BaseColor -OpStore %param %21 -%22 = OpFunctionCall %v4float %bar_vf4_ %param -OpStore %gl_FragColor %22 -OpReturn -OpFunctionEnd -)"; - - const std::string predefs_after = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %gl_FragColor %BaseColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %foo_vf4_ "foo(vf4;" -OpName %v1 "v1" -OpName %bar_vf4_ "bar(vf4;" -OpName %v1_0 "v1" -OpName %t "t" -OpName %gl_FragColor "gl_FragColor" -OpName %BaseColor "BaseColor" -OpName %param "param" -%void = OpTypeVoid -%13 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%17 = OpTypeFunction %v4float %_ptr_Function_v4float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%main = OpFunction %void None %13 -%20 = OpLabel -%param = OpVariable %_ptr_Function_v4float Function -%21 = OpLoad %v4float %BaseColor -OpStore %param %21 -%22 = OpFunctionCall %v4float %bar_vf4_ %param -OpStore %gl_FragColor %22 -OpReturn -OpFunctionEnd -)"; - - const std::string before = - R"(%foo_vf4_ = OpFunction %v4float None %17 -%v1 = OpFunctionParameter %_ptr_Function_v4float -%23 = OpLabel -%t = OpVariable %_ptr_Function_v4float Function -%24 = OpLoad %v4float %v1 -OpStore %t %24 -%25 = OpLoad %v4float %t -OpReturnValue %25 -OpFunctionEnd -%bar_vf4_ = OpFunction %v4float None %17 -%v1_0 = OpFunctionParameter %_ptr_Function_v4float -%26 = OpLabel -%t_0 = OpVariable %_ptr_Function_v4float Function -%27 = OpLoad %v4float %v1_0 -OpStore %t_0 %27 -%28 = OpLoad %v4float %t_0 -OpReturnValue %28 -OpFunctionEnd -)"; - - const std::string after = - R"(%foo_vf4_ = OpFunction %v4float None %17 -%v1 = OpFunctionParameter %_ptr_Function_v4float -%23 = OpLabel -%t = OpVariable %_ptr_Function_v4float Function -%24 = OpLoad %v4float %v1 -OpStore %t %24 -%25 = OpLoad %v4float %t -OpReturnValue %25 -OpFunctionEnd -%bar_vf4_ = OpFunction %v4float None %17 -%v1_0 = OpFunctionParameter %_ptr_Function_v4float -%26 = OpLabel -%27 = OpLoad %v4float %v1_0 -OpReturnValue %27 -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs_before + before, predefs_after + after, true, true); -} - -// TODO(greg-lunarg): Add tests to verify handling of these cases: -// -// Other target variable types -// InBounds Access Chains -// Check for correctness in the presence of function calls -// Others? - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/local_single_store_elim_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/local_single_store_elim_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/local_single_store_elim_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/local_single_store_elim_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,655 +0,0 @@ -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; - -using LocalSingleStoreElimTest = PassTest<::testing::Test>; - -TEST_F(LocalSingleStoreElimTest, PositiveAndNegative) { - // Single store to v is optimized. Multiple store to - // f is not optimized. - // - // #version 140 - // - // in vec4 BaseColor; - // in float fi; - // - // void main() - // { - // vec4 v = BaseColor; - // float f = fi; - // if (f < 0) - // f = 0.0; - // gl_FragColor = v + f; - // } - - const std::string predefs_before = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %fi %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %f "f" -OpName %fi "fi" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_float = OpTypePointer Function %float -%_ptr_Input_float = OpTypePointer Input %float -%fi = OpVariable %_ptr_Input_float Input -%float_0 = OpConstant %float 0 -%bool = OpTypeBool -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string predefs_after = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %fi %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %BaseColor "BaseColor" -OpName %f "f" -OpName %fi "fi" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_float = OpTypePointer Function %float -%_ptr_Input_float = OpTypePointer Input %float -%fi = OpVariable %_ptr_Input_float Input -%float_0 = OpConstant %float 0 -%bool = OpTypeBool -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %9 -%19 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%f = OpVariable %_ptr_Function_float Function -%20 = OpLoad %v4float %BaseColor -OpStore %v %20 -%21 = OpLoad %float %fi -OpStore %f %21 -%22 = OpLoad %float %f -%23 = OpFOrdLessThan %bool %22 %float_0 -OpSelectionMerge %24 None -OpBranchConditional %23 %25 %24 -%25 = OpLabel -OpStore %f %float_0 -OpBranch %24 -%24 = OpLabel -%26 = OpLoad %v4float %v -%27 = OpLoad %float %f -%28 = OpCompositeConstruct %v4float %27 %27 %27 %27 -%29 = OpFAdd %v4float %26 %28 -OpStore %gl_FragColor %29 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %9 -%19 = OpLabel -%f = OpVariable %_ptr_Function_float Function -%20 = OpLoad %v4float %BaseColor -%21 = OpLoad %float %fi -OpStore %f %21 -%22 = OpLoad %float %f -%23 = OpFOrdLessThan %bool %22 %float_0 -OpSelectionMerge %24 None -OpBranchConditional %23 %25 %24 -%25 = OpLabel -OpStore %f %float_0 -OpBranch %24 -%24 = OpLabel -%27 = OpLoad %float %f -%28 = OpCompositeConstruct %v4float %27 %27 %27 %27 -%29 = OpFAdd %v4float %20 %28 -OpStore %gl_FragColor %29 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs_before + before, - predefs_after + after, true, true); -} - -TEST_F(LocalSingleStoreElimTest, MultipleLoads) { - // Single store to multiple loads of v is optimized. - // - // #version 140 - // - // in vec4 BaseColor; - // in float fi; - // - // void main() - // { - // vec4 v = BaseColor; - // float f = fi; - // if (f < 0) - // f = 0.0; - // gl_FragColor = v + f; - // } - - const std::string predefs_before = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %fi %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %fi "fi" -OpName %r "r" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Input_float = OpTypePointer Input %float -%fi = OpVariable %_ptr_Input_float Input -%float_0 = OpConstant %float 0 -%bool = OpTypeBool -%float_1 = OpConstant %float 1 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string predefs_after = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %fi %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %BaseColor "BaseColor" -OpName %fi "fi" -OpName %r "r" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Input_float = OpTypePointer Input %float -%fi = OpVariable %_ptr_Input_float Input -%float_0 = OpConstant %float 0 -%bool = OpTypeBool -%float_1 = OpConstant %float 1 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %9 -%19 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%r = OpVariable %_ptr_Function_v4float Function -%20 = OpLoad %v4float %BaseColor -OpStore %v %20 -%21 = OpLoad %float %fi -%22 = OpFOrdLessThan %bool %21 %float_0 -OpSelectionMerge %23 None -OpBranchConditional %22 %24 %25 -%24 = OpLabel -%26 = OpLoad %v4float %v -OpStore %r %26 -OpBranch %23 -%25 = OpLabel -%27 = OpLoad %v4float %v -%28 = OpCompositeConstruct %v4float %float_1 %float_1 %float_1 %float_1 -%29 = OpFSub %v4float %28 %27 -OpStore %r %29 -OpBranch %23 -%23 = OpLabel -%30 = OpLoad %v4float %r -OpStore %gl_FragColor %30 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %9 -%19 = OpLabel -%r = OpVariable %_ptr_Function_v4float Function -%20 = OpLoad %v4float %BaseColor -%21 = OpLoad %float %fi -%22 = OpFOrdLessThan %bool %21 %float_0 -OpSelectionMerge %23 None -OpBranchConditional %22 %24 %25 -%24 = OpLabel -OpStore %r %20 -OpBranch %23 -%25 = OpLabel -%28 = OpCompositeConstruct %v4float %float_1 %float_1 %float_1 %float_1 -%29 = OpFSub %v4float %28 %20 -OpStore %r %29 -OpBranch %23 -%23 = OpLabel -%30 = OpLoad %v4float %r -OpStore %gl_FragColor %30 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs_before + before, - predefs_after + after, true, true); -} - -TEST_F(LocalSingleStoreElimTest, NoStoreElimWithInterveningAccessChainLoad) { - // Last load of v is eliminated, but access chain load and store of v isn't - // - // #version 140 - // - // in vec4 BaseColor; - // - // void main() - // { - // vec4 v = BaseColor; - // float f = v[3]; - // gl_FragColor = v * f; - // } - - const std::string predefs_before = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %f "f" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_float = OpTypePointer Function %float -%uint = OpTypeInt 32 0 -%uint_3 = OpConstant %uint 3 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string predefs_after = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_float = OpTypePointer Function %float -%uint = OpTypeInt 32 0 -%uint_3 = OpConstant %uint 3 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %8 -%17 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%f = OpVariable %_ptr_Function_float Function -%18 = OpLoad %v4float %BaseColor -OpStore %v %18 -%19 = OpAccessChain %_ptr_Function_float %v %uint_3 -%20 = OpLoad %float %19 -OpStore %f %20 -%21 = OpLoad %v4float %v -%22 = OpLoad %float %f -%23 = OpVectorTimesScalar %v4float %21 %22 -OpStore %gl_FragColor %23 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %8 -%17 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%18 = OpLoad %v4float %BaseColor -OpStore %v %18 -%19 = OpAccessChain %_ptr_Function_float %v %uint_3 -%20 = OpLoad %float %19 -%23 = OpVectorTimesScalar %v4float %18 %20 -OpStore %gl_FragColor %23 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs_before + before, - predefs_after + after, true, true); -} - -TEST_F(LocalSingleStoreElimTest, NoReplaceOfDominatingPartialStore) { - // Note: SPIR-V hand edited to initialize v to vec4(0.0) - // - // #version 140 - // - // in vec4 BaseColor; - // - // void main() - // { - // vec4 v; - // float v[1] = 1.0; - // gl_FragColor = v; - // } - - const std::string assembly = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %gl_FragColor %BaseColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %gl_FragColor "gl_FragColor" -OpName %BaseColor "BaseColor" -%void = OpTypeVoid -%7 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%float_0 = OpConstant %float 0 -%12 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 -%float_1 = OpConstant %float 1 -%uint = OpTypeInt 32 0 -%uint_1 = OpConstant %uint 1 -%_ptr_Function_float = OpTypePointer Function %float -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%main = OpFunction %void None %7 -%19 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function %12 -%20 = OpAccessChain %_ptr_Function_float %v %uint_1 -OpStore %20 %float_1 -%21 = OpLoad %v4float %v -OpStore %gl_FragColor %21 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck(assembly, assembly, true, - true); -} - -TEST_F(LocalSingleStoreElimTest, ElimIfCopyObjectInFunction) { - // Note: hand edited to insert OpCopyObject - // - // #version 140 - // - // in vec4 BaseColor; - // in float fi; - // - // void main() - // { - // vec4 v = BaseColor; - // float f = fi; - // if (f < 0) - // f = 0.0; - // gl_FragColor = v + f; - // } - - const std::string predefs_before = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %fi %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %f "f" -OpName %fi "fi" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_float = OpTypePointer Function %float -%_ptr_Input_float = OpTypePointer Input %float -%fi = OpVariable %_ptr_Input_float Input -%float_0 = OpConstant %float 0 -%bool = OpTypeBool -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string predefs_after = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %fi %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %BaseColor "BaseColor" -OpName %f "f" -OpName %fi "fi" -OpName %gl_FragColor "gl_FragColor" -%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Function_float = OpTypePointer Function %float -%_ptr_Input_float = OpTypePointer Input %float -%fi = OpVariable %_ptr_Input_float Input -%float_0 = OpConstant %float 0 -%bool = OpTypeBool -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %9 -%19 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%f = OpVariable %_ptr_Function_float Function -%20 = OpLoad %v4float %BaseColor -OpStore %v %20 -%21 = OpLoad %float %fi -OpStore %f %21 -%22 = OpLoad %float %f -%23 = OpFOrdLessThan %bool %22 %float_0 -OpSelectionMerge %24 None -OpBranchConditional %23 %25 %24 -%25 = OpLabel -OpStore %f %float_0 -OpBranch %24 -%24 = OpLabel -%26 = OpCopyObject %_ptr_Function_v4float %v -%27 = OpLoad %v4float %26 -%28 = OpLoad %float %f -%29 = OpCompositeConstruct %v4float %28 %28 %28 %28 -%30 = OpFAdd %v4float %27 %29 -OpStore %gl_FragColor %30 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %9 -%19 = OpLabel -%f = OpVariable %_ptr_Function_float Function -%20 = OpLoad %v4float %BaseColor -%21 = OpLoad %float %fi -OpStore %f %21 -%22 = OpLoad %float %f -%23 = OpFOrdLessThan %bool %22 %float_0 -OpSelectionMerge %24 None -OpBranchConditional %23 %25 %24 -%25 = OpLabel -OpStore %f %float_0 -OpBranch %24 -%24 = OpLabel -%28 = OpLoad %float %f -%29 = OpCompositeConstruct %v4float %28 %28 %28 %28 -%30 = OpFAdd %v4float %20 %29 -OpStore %gl_FragColor %30 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs_before + before, predefs_after + after, true, true); -} - -TEST_F(LocalSingleStoreElimTest, NoOptIfStoreNotDominating) { - // Single store to f not optimized because it does not dominate - // the load. - // - // #version 140 - // - // in vec4 BaseColor; - // in float fi; - // - // void main() - // { - // float f; - // if (fi < 0) - // f = 0.5; - // if (fi < 0) - // gl_FragColor = BaseColor * f; - // else - // gl_FragColor = BaseColor; - // } - - const std::string assembly = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %fi %gl_FragColor %BaseColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -OpName %main "main" -OpName %fi "fi" -OpName %f "f" -OpName %gl_FragColor "gl_FragColor" -OpName %BaseColor "BaseColor" -%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%_ptr_Input_float = OpTypePointer Input %float -%fi = OpVariable %_ptr_Input_float Input -%float_0 = OpConstant %float 0 -%bool = OpTypeBool -%_ptr_Function_float = OpTypePointer Function %float -%float_0_5 = OpConstant %float 0.5 -%v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%main = OpFunction %void None %8 -%18 = OpLabel -%f = OpVariable %_ptr_Function_float Function -%19 = OpLoad %float %fi -%20 = OpFOrdLessThan %bool %19 %float_0 -OpSelectionMerge %21 None -OpBranchConditional %20 %22 %21 -%22 = OpLabel -OpStore %f %float_0_5 -OpBranch %21 -%21 = OpLabel -%23 = OpLoad %float %fi -%24 = OpFOrdLessThan %bool %23 %float_0 -OpSelectionMerge %25 None -OpBranchConditional %24 %26 %27 -%26 = OpLabel -%28 = OpLoad %v4float %BaseColor -%29 = OpLoad %float %f -%30 = OpVectorTimesScalar %v4float %28 %29 -OpStore %gl_FragColor %30 -OpBranch %25 -%27 = OpLabel -%31 = OpLoad %v4float %BaseColor -OpStore %gl_FragColor %31 -OpBranch %25 -%25 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck(assembly, assembly, true, - true); -} - -// TODO(greg-lunarg): Add tests to verify handling of these cases: -// -// Other types -// Others? - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/local_ssa_elim_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/local_ssa_elim_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/local_ssa_elim_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/local_ssa_elim_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1270 +0,0 @@ -// Copyright (c) 2017 Valve Corporation -// Copyright (c) 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. - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; - -using LocalSSAElimTest = PassTest<::testing::Test>; - -TEST_F(LocalSSAElimTest, ForLoop) { - // #version 140 - // - // in vec4 BC; - // out float fo; - // - // void main() - // { - // float f = 0.0; - // for (int i=0; i<4; i++) { - // f = f + BC[i]; - // } - // fo = f; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BC %fo -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -)"; - - const std::string names_before = - R"(OpName %main "main" -OpName %f "f" -OpName %i "i" -OpName %BC "BC" -OpName %fo "fo" -)"; - - const std::string names_after = - R"(OpName %main "main" -OpName %BC "BC" -OpName %fo "fo" -)"; - - const std::string predefs2 = - R"(%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%_ptr_Function_float = OpTypePointer Function %float -%float_0 = OpConstant %float 0 -%int = OpTypeInt 32 1 -%_ptr_Function_int = OpTypePointer Function %int -%int_0 = OpConstant %int 0 -%int_4 = OpConstant %int 4 -%bool = OpTypeBool -%v4float = OpTypeVector %float 4 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BC = OpVariable %_ptr_Input_v4float Input -%_ptr_Input_float = OpTypePointer Input %float -%int_1 = OpConstant %int 1 -%_ptr_Output_float = OpTypePointer Output %float -%fo = OpVariable %_ptr_Output_float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %8 -%22 = OpLabel -%f = OpVariable %_ptr_Function_float Function -%i = OpVariable %_ptr_Function_int Function -OpStore %f %float_0 -OpStore %i %int_0 -OpBranch %23 -%23 = OpLabel -OpLoopMerge %24 %25 None -OpBranch %26 -%26 = OpLabel -%27 = OpLoad %int %i -%28 = OpSLessThan %bool %27 %int_4 -OpBranchConditional %28 %29 %24 -%29 = OpLabel -%30 = OpLoad %float %f -%31 = OpLoad %int %i -%32 = OpAccessChain %_ptr_Input_float %BC %31 -%33 = OpLoad %float %32 -%34 = OpFAdd %float %30 %33 -OpStore %f %34 -OpBranch %25 -%25 = OpLabel -%35 = OpLoad %int %i -%36 = OpIAdd %int %35 %int_1 -OpStore %i %36 -OpBranch %23 -%24 = OpLabel -%37 = OpLoad %float %f -OpStore %fo %37 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %8 -%22 = OpLabel -OpBranch %23 -%23 = OpLabel -%38 = OpPhi %float %float_0 %22 %34 %25 -%39 = OpPhi %int %int_0 %22 %36 %25 -OpLoopMerge %24 %25 None -OpBranch %26 -%26 = OpLabel -%28 = OpSLessThan %bool %39 %int_4 -OpBranchConditional %28 %29 %24 -%29 = OpLabel -%32 = OpAccessChain %_ptr_Input_float %BC %39 -%33 = OpLoad %float %32 -%34 = OpFAdd %float %38 %33 -OpBranch %25 -%25 = OpLabel -%36 = OpIAdd %int %39 %int_1 -OpBranch %23 -%24 = OpLabel -OpStore %fo %38 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + names_before + predefs2 + before, - predefs + names_after + predefs2 + after, - true, true); -} - -TEST_F(LocalSSAElimTest, ForLoopWithContinue) { - // #version 140 - // - // in vec4 BC; - // out float fo; - // - // void main() - // { - // float f = 0.0; - // for (int i=0; i<4; i++) { - // float t = BC[i]; - // if (t < 0.0) - // continue; - // f = f + t; - // } - // fo = f; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BC %fo -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -)"; - - const std::string names_before = - R"(OpName %main "main" -OpName %f "f" -OpName %i "i" -OpName %t "t" -OpName %BC "BC" -OpName %fo "fo" -)"; - - const std::string names_after = - R"(OpName %main "main" -OpName %BC "BC" -OpName %fo "fo" -)"; - - const std::string predefs2 = - R"(%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%_ptr_Function_float = OpTypePointer Function %float -%float_0 = OpConstant %float 0 -%int = OpTypeInt 32 1 -%_ptr_Function_int = OpTypePointer Function %int -%int_0 = OpConstant %int 0 -%int_4 = OpConstant %int 4 -%bool = OpTypeBool -%v4float = OpTypeVector %float 4 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BC = OpVariable %_ptr_Input_v4float Input -%_ptr_Input_float = OpTypePointer Input %float -%int_1 = OpConstant %int 1 -%_ptr_Output_float = OpTypePointer Output %float -%fo = OpVariable %_ptr_Output_float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %9 -%23 = OpLabel -%f = OpVariable %_ptr_Function_float Function -%i = OpVariable %_ptr_Function_int Function -%t = OpVariable %_ptr_Function_float Function -OpStore %f %float_0 -OpStore %i %int_0 -OpBranch %24 -%24 = OpLabel -OpLoopMerge %25 %26 None -OpBranch %27 -%27 = OpLabel -%28 = OpLoad %int %i -%29 = OpSLessThan %bool %28 %int_4 -OpBranchConditional %29 %30 %25 -%30 = OpLabel -%31 = OpLoad %int %i -%32 = OpAccessChain %_ptr_Input_float %BC %31 -%33 = OpLoad %float %32 -OpStore %t %33 -%34 = OpLoad %float %t -%35 = OpFOrdLessThan %bool %34 %float_0 -OpSelectionMerge %36 None -OpBranchConditional %35 %37 %36 -%37 = OpLabel -OpBranch %26 -%36 = OpLabel -%38 = OpLoad %float %f -%39 = OpLoad %float %t -%40 = OpFAdd %float %38 %39 -OpStore %f %40 -OpBranch %26 -%26 = OpLabel -%41 = OpLoad %int %i -%42 = OpIAdd %int %41 %int_1 -OpStore %i %42 -OpBranch %24 -%25 = OpLabel -%43 = OpLoad %float %f -OpStore %fo %43 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%46 = OpUndef %float -%main = OpFunction %void None %9 -%23 = OpLabel -OpBranch %24 -%24 = OpLabel -%44 = OpPhi %float %float_0 %23 %48 %26 -%45 = OpPhi %int %int_0 %23 %42 %26 -%47 = OpPhi %float %46 %23 %33 %26 -OpLoopMerge %25 %26 None -OpBranch %27 -%27 = OpLabel -%29 = OpSLessThan %bool %45 %int_4 -OpBranchConditional %29 %30 %25 -%30 = OpLabel -%32 = OpAccessChain %_ptr_Input_float %BC %45 -%33 = OpLoad %float %32 -%35 = OpFOrdLessThan %bool %33 %float_0 -OpSelectionMerge %36 None -OpBranchConditional %35 %37 %36 -%37 = OpLabel -OpBranch %26 -%36 = OpLabel -%40 = OpFAdd %float %44 %33 -OpBranch %26 -%26 = OpLabel -%48 = OpPhi %float %44 %37 %40 %36 -%42 = OpIAdd %int %45 %int_1 -OpBranch %24 -%25 = OpLabel -OpStore %fo %44 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + names_before + predefs2 + before, - predefs + names_after + predefs2 + after, - true, true); -} - -TEST_F(LocalSSAElimTest, ForLoopWithBreak) { - // #version 140 - // - // in vec4 BC; - // out float fo; - // - // void main() - // { - // float f = 0.0; - // for (int i=0; i<4; i++) { - // float t = f + BC[i]; - // if (t > 1.0) - // break; - // f = t; - // } - // fo = f; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BC %fo -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -)"; - - const std::string names_before = - R"(OpName %main "main" -OpName %f "f" -OpName %i "i" -OpName %t "t" -OpName %BC "BC" -OpName %fo "fo" -)"; - - const std::string names_after = - R"(OpName %main "main" -OpName %BC "BC" -OpName %fo "fo" -)"; - - const std::string predefs2 = - R"(%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%_ptr_Function_float = OpTypePointer Function %float -%float_0 = OpConstant %float 0 -%int = OpTypeInt 32 1 -%_ptr_Function_int = OpTypePointer Function %int -%int_0 = OpConstant %int 0 -%int_4 = OpConstant %int 4 -%bool = OpTypeBool -%v4float = OpTypeVector %float 4 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BC = OpVariable %_ptr_Input_v4float Input -%_ptr_Input_float = OpTypePointer Input %float -%float_1 = OpConstant %float 1 -%int_1 = OpConstant %int 1 -%_ptr_Output_float = OpTypePointer Output %float -%fo = OpVariable %_ptr_Output_float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %9 -%24 = OpLabel -%f = OpVariable %_ptr_Function_float Function -%i = OpVariable %_ptr_Function_int Function -%t = OpVariable %_ptr_Function_float Function -OpStore %f %float_0 -OpStore %i %int_0 -OpBranch %25 -%25 = OpLabel -OpLoopMerge %26 %27 None -OpBranch %28 -%28 = OpLabel -%29 = OpLoad %int %i -%30 = OpSLessThan %bool %29 %int_4 -OpBranchConditional %30 %31 %26 -%31 = OpLabel -%32 = OpLoad %float %f -%33 = OpLoad %int %i -%34 = OpAccessChain %_ptr_Input_float %BC %33 -%35 = OpLoad %float %34 -%36 = OpFAdd %float %32 %35 -OpStore %t %36 -%37 = OpLoad %float %t -%38 = OpFOrdGreaterThan %bool %37 %float_1 -OpSelectionMerge %39 None -OpBranchConditional %38 %40 %39 -%40 = OpLabel -OpBranch %26 -%39 = OpLabel -%41 = OpLoad %float %t -OpStore %f %41 -OpBranch %27 -%27 = OpLabel -%42 = OpLoad %int %i -%43 = OpIAdd %int %42 %int_1 -OpStore %i %43 -OpBranch %25 -%26 = OpLabel -%44 = OpLoad %float %f -OpStore %fo %44 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%47 = OpUndef %float -%main = OpFunction %void None %9 -%24 = OpLabel -OpBranch %25 -%25 = OpLabel -%45 = OpPhi %float %float_0 %24 %36 %27 -%46 = OpPhi %int %int_0 %24 %43 %27 -%48 = OpPhi %float %47 %24 %36 %27 -OpLoopMerge %26 %27 None -OpBranch %28 -%28 = OpLabel -%30 = OpSLessThan %bool %46 %int_4 -OpBranchConditional %30 %31 %26 -%31 = OpLabel -%34 = OpAccessChain %_ptr_Input_float %BC %46 -%35 = OpLoad %float %34 -%36 = OpFAdd %float %45 %35 -%38 = OpFOrdGreaterThan %bool %36 %float_1 -OpSelectionMerge %39 None -OpBranchConditional %38 %40 %39 -%40 = OpLabel -OpBranch %26 -%39 = OpLabel -OpBranch %27 -%27 = OpLabel -%43 = OpIAdd %int %46 %int_1 -OpBranch %25 -%26 = OpLabel -%49 = OpPhi %float %48 %28 %36 %40 -OpStore %fo %45 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + names_before + predefs2 + before, - predefs + names_after + predefs2 + after, - true, true); -} - -TEST_F(LocalSSAElimTest, SwapProblem) { - // #version 140 - // - // in float fe; - // out float fo; - // - // void main() - // { - // float f1 = 0.0; - // float f2 = 1.0; - // int ie = int(fe); - // for (int i=0; i( - predefs + names_before + predefs2 + before, - predefs + names_after + predefs2 + after, - true, true); -} - -TEST_F(LocalSSAElimTest, LostCopyProblem) { - // #version 140 - // - // in vec4 BC; - // out float fo; - // - // void main() - // { - // float f = 0.0; - // float t; - // for (int i=0; i<4; i++) { - // t = f; - // f = f + BC[i]; - // if (f > 1.0) - // break; - // } - // fo = t; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BC %fo -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -)"; - - const std::string names_before = - R"(OpName %main "main" -OpName %f "f" -OpName %i "i" -OpName %t "t" -OpName %BC "BC" -OpName %fo "fo" -)"; - - const std::string names_after = - R"(OpName %main "main" -OpName %BC "BC" -OpName %fo "fo" -)"; - - const std::string predefs2 = - R"(%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%_ptr_Function_float = OpTypePointer Function %float -%float_0 = OpConstant %float 0 -%int = OpTypeInt 32 1 -%_ptr_Function_int = OpTypePointer Function %int -%int_0 = OpConstant %int 0 -%int_4 = OpConstant %int 4 -%bool = OpTypeBool -%v4float = OpTypeVector %float 4 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BC = OpVariable %_ptr_Input_v4float Input -%_ptr_Input_float = OpTypePointer Input %float -%float_1 = OpConstant %float 1 -%int_1 = OpConstant %int 1 -%_ptr_Output_float = OpTypePointer Output %float -%fo = OpVariable %_ptr_Output_float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %9 -%24 = OpLabel -%f = OpVariable %_ptr_Function_float Function -%i = OpVariable %_ptr_Function_int Function -%t = OpVariable %_ptr_Function_float Function -OpStore %f %float_0 -OpStore %i %int_0 -OpBranch %25 -%25 = OpLabel -OpLoopMerge %26 %27 None -OpBranch %28 -%28 = OpLabel -%29 = OpLoad %int %i -%30 = OpSLessThan %bool %29 %int_4 -OpBranchConditional %30 %31 %26 -%31 = OpLabel -%32 = OpLoad %float %f -OpStore %t %32 -%33 = OpLoad %float %f -%34 = OpLoad %int %i -%35 = OpAccessChain %_ptr_Input_float %BC %34 -%36 = OpLoad %float %35 -%37 = OpFAdd %float %33 %36 -OpStore %f %37 -%38 = OpLoad %float %f -%39 = OpFOrdGreaterThan %bool %38 %float_1 -OpSelectionMerge %40 None -OpBranchConditional %39 %41 %40 -%41 = OpLabel -OpBranch %26 -%40 = OpLabel -OpBranch %27 -%27 = OpLabel -%42 = OpLoad %int %i -%43 = OpIAdd %int %42 %int_1 -OpStore %i %43 -OpBranch %25 -%26 = OpLabel -%44 = OpLoad %float %t -OpStore %fo %44 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%47 = OpUndef %float -%main = OpFunction %void None %9 -%24 = OpLabel -OpBranch %25 -%25 = OpLabel -%45 = OpPhi %float %float_0 %24 %37 %27 -%46 = OpPhi %int %int_0 %24 %43 %27 -%48 = OpPhi %float %47 %24 %45 %27 -OpLoopMerge %26 %27 None -OpBranch %28 -%28 = OpLabel -%30 = OpSLessThan %bool %46 %int_4 -OpBranchConditional %30 %31 %26 -%31 = OpLabel -%35 = OpAccessChain %_ptr_Input_float %BC %46 -%36 = OpLoad %float %35 -%37 = OpFAdd %float %45 %36 -%39 = OpFOrdGreaterThan %bool %37 %float_1 -OpSelectionMerge %40 None -OpBranchConditional %39 %41 %40 -%41 = OpLabel -OpBranch %26 -%40 = OpLabel -OpBranch %27 -%27 = OpLabel -%43 = OpIAdd %int %46 %int_1 -OpBranch %25 -%26 = OpLabel -%49 = OpPhi %float %45 %28 %37 %41 -%50 = OpPhi %float %48 %28 %45 %41 -OpStore %fo %50 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + names_before + predefs2 + before, - predefs + names_after + predefs2 + after, - true, true); -} - -TEST_F(LocalSSAElimTest, IfThenElse) { - // #version 140 - // - // in vec4 BaseColor; - // in float f; - // - // void main() - // { - // vec4 v; - // if (f >= 0) - // v = BaseColor * 0.5; - // else - // v = BaseColor + vec4(1.0,1.0,1.0,1.0); - // gl_FragColor = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %f %BaseColor %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -)"; - - const std::string names_before = - R"(OpName %main "main" -OpName %f "f" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -)"; - - const std::string names_after = - R"(OpName %main "main" -OpName %f "f" -OpName %BaseColor "BaseColor" -OpName %gl_FragColor "gl_FragColor" -)"; - - const std::string predefs2 = - R"(%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%_ptr_Input_float = OpTypePointer Input %float -%f = OpVariable %_ptr_Input_float Input -%float_0 = OpConstant %float 0 -%bool = OpTypeBool -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%float_0_5 = OpConstant %float 0.5 -%float_1 = OpConstant %float 1 -%18 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %8 -%20 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%21 = OpLoad %float %f -%22 = OpFOrdGreaterThanEqual %bool %21 %float_0 -OpSelectionMerge %23 None -OpBranchConditional %22 %24 %25 -%24 = OpLabel -%26 = OpLoad %v4float %BaseColor -%27 = OpVectorTimesScalar %v4float %26 %float_0_5 -OpStore %v %27 -OpBranch %23 -%25 = OpLabel -%28 = OpLoad %v4float %BaseColor -%29 = OpFAdd %v4float %28 %18 -OpStore %v %29 -OpBranch %23 -%23 = OpLabel -%30 = OpLoad %v4float %v -OpStore %gl_FragColor %30 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %8 -%20 = OpLabel -%21 = OpLoad %float %f -%22 = OpFOrdGreaterThanEqual %bool %21 %float_0 -OpSelectionMerge %23 None -OpBranchConditional %22 %24 %25 -%24 = OpLabel -%26 = OpLoad %v4float %BaseColor -%27 = OpVectorTimesScalar %v4float %26 %float_0_5 -OpBranch %23 -%25 = OpLabel -%28 = OpLoad %v4float %BaseColor -%29 = OpFAdd %v4float %28 %18 -OpBranch %23 -%23 = OpLabel -%31 = OpPhi %v4float %27 %24 %29 %25 -OpStore %gl_FragColor %31 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + names_before + predefs2 + before, - predefs + names_after + predefs2 + after, - true, true); -} - -TEST_F(LocalSSAElimTest, IfThen) { - // #version 140 - // - // in vec4 BaseColor; - // in float f; - // - // void main() - // { - // vec4 v = BaseColor; - // if (f <= 0) - // v = v * 0.5; - // gl_FragColor = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %f %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -)"; - - const std::string names_before = - R"(OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %f "f" -OpName %gl_FragColor "gl_FragColor" -)"; - - const std::string names_after = - R"(OpName %main "main" -OpName %BaseColor "BaseColor" -OpName %f "f" -OpName %gl_FragColor "gl_FragColor" -)"; - - const std::string predefs2 = - R"(%void = OpTypeVoid -%8 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%_ptr_Input_float = OpTypePointer Input %float -%f = OpVariable %_ptr_Input_float Input -%float_0 = OpConstant %float 0 -%bool = OpTypeBool -%float_0_5 = OpConstant %float 0.5 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %8 -%18 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%19 = OpLoad %v4float %BaseColor -OpStore %v %19 -%20 = OpLoad %float %f -%21 = OpFOrdLessThanEqual %bool %20 %float_0 -OpSelectionMerge %22 None -OpBranchConditional %21 %23 %22 -%23 = OpLabel -%24 = OpLoad %v4float %v -%25 = OpVectorTimesScalar %v4float %24 %float_0_5 -OpStore %v %25 -OpBranch %22 -%22 = OpLabel -%26 = OpLoad %v4float %v -OpStore %gl_FragColor %26 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %8 -%18 = OpLabel -%19 = OpLoad %v4float %BaseColor -%20 = OpLoad %float %f -%21 = OpFOrdLessThanEqual %bool %20 %float_0 -OpSelectionMerge %22 None -OpBranchConditional %21 %23 %22 -%23 = OpLabel -%25 = OpVectorTimesScalar %v4float %19 %float_0_5 -OpBranch %22 -%22 = OpLabel -%27 = OpPhi %v4float %19 %18 %25 %23 -OpStore %gl_FragColor %27 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + names_before + predefs2 + before, - predefs + names_after + predefs2 + after, - true, true); -} - -TEST_F(LocalSSAElimTest, Switch) { - // #version 140 - // - // in vec4 BaseColor; - // in float f; - // - // void main() - // { - // vec4 v = BaseColor; - // int i = int(f); - // switch (i) { - // case 0: - // v = v * 0.1; - // break; - // case 1: - // v = v * 0.3; - // break; - // case 2: - // v = v * 0.7; - // break; - // default: - // break; - // } - // gl_FragColor = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %f %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -)"; - - const std::string names_before = - R"(OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %i "i" -OpName %f "f" -OpName %gl_FragColor "gl_FragColor" -)"; - - const std::string names_after = - R"(OpName %main "main" -OpName %BaseColor "BaseColor" -OpName %f "f" -OpName %gl_FragColor "gl_FragColor" -)"; - - const std::string predefs2 = - R"(%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%int = OpTypeInt 32 1 -%_ptr_Function_int = OpTypePointer Function %int -%_ptr_Input_float = OpTypePointer Input %float -%f = OpVariable %_ptr_Input_float Input -%float_0_1 = OpConstant %float 0.1 -%float_0_3 = OpConstant %float 0.3 -%float_0_7 = OpConstant %float 0.7 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %9 -%21 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%i = OpVariable %_ptr_Function_int Function -%22 = OpLoad %v4float %BaseColor -OpStore %v %22 -%23 = OpLoad %float %f -%24 = OpConvertFToS %int %23 -OpStore %i %24 -%25 = OpLoad %int %i -OpSelectionMerge %26 None -OpSwitch %25 %27 0 %28 1 %29 2 %30 -%27 = OpLabel -OpBranch %26 -%28 = OpLabel -%31 = OpLoad %v4float %v -%32 = OpVectorTimesScalar %v4float %31 %float_0_1 -OpStore %v %32 -OpBranch %26 -%29 = OpLabel -%33 = OpLoad %v4float %v -%34 = OpVectorTimesScalar %v4float %33 %float_0_3 -OpStore %v %34 -OpBranch %26 -%30 = OpLabel -%35 = OpLoad %v4float %v -%36 = OpVectorTimesScalar %v4float %35 %float_0_7 -OpStore %v %36 -OpBranch %26 -%26 = OpLabel -%37 = OpLoad %v4float %v -OpStore %gl_FragColor %37 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %9 -%21 = OpLabel -%22 = OpLoad %v4float %BaseColor -%23 = OpLoad %float %f -%24 = OpConvertFToS %int %23 -OpSelectionMerge %26 None -OpSwitch %24 %27 0 %28 1 %29 2 %30 -%27 = OpLabel -OpBranch %26 -%28 = OpLabel -%32 = OpVectorTimesScalar %v4float %22 %float_0_1 -OpBranch %26 -%29 = OpLabel -%34 = OpVectorTimesScalar %v4float %22 %float_0_3 -OpBranch %26 -%30 = OpLabel -%36 = OpVectorTimesScalar %v4float %22 %float_0_7 -OpBranch %26 -%26 = OpLabel -%38 = OpPhi %v4float %22 %27 %32 %28 %34 %29 %36 %30 -OpStore %gl_FragColor %38 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + names_before + predefs2 + before, - predefs + names_after + predefs2 + after, - true, true); -} - -TEST_F(LocalSSAElimTest, SwitchWithFallThrough) { - // #version 140 - // - // in vec4 BaseColor; - // in float f; - // - // void main() - // { - // vec4 v = BaseColor; - // int i = int(f); - // switch (i) { - // case 0: - // v = v * 0.1; - // break; - // case 1: - // v = v + 0.1; - // case 2: - // v = v * 0.7; - // break; - // default: - // break; - // } - // gl_FragColor = v; - // } - - const std::string predefs = - R"(OpCapability Shader -%1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" %BaseColor %f %gl_FragColor -OpExecutionMode %main OriginUpperLeft -OpSource GLSL 140 -)"; - - const std::string names_before = - R"(OpName %main "main" -OpName %v "v" -OpName %BaseColor "BaseColor" -OpName %i "i" -OpName %f "f" -OpName %gl_FragColor "gl_FragColor" -)"; - - const std::string names_after = - R"(OpName %main "main" -OpName %BaseColor "BaseColor" -OpName %f "f" -OpName %gl_FragColor "gl_FragColor" -)"; - - const std::string predefs2 = - R"(%void = OpTypeVoid -%9 = OpTypeFunction %void -%float = OpTypeFloat 32 -%v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float -%_ptr_Input_v4float = OpTypePointer Input %v4float -%BaseColor = OpVariable %_ptr_Input_v4float Input -%int = OpTypeInt 32 1 -%_ptr_Function_int = OpTypePointer Function %int -%_ptr_Input_float = OpTypePointer Input %float -%f = OpVariable %_ptr_Input_float Input -%float_0_1 = OpConstant %float 0.1 -%float_0_7 = OpConstant %float 0.7 -%_ptr_Output_v4float = OpTypePointer Output %v4float -%gl_FragColor = OpVariable %_ptr_Output_v4float Output -)"; - - const std::string before = - R"(%main = OpFunction %void None %9 -%20 = OpLabel -%v = OpVariable %_ptr_Function_v4float Function -%i = OpVariable %_ptr_Function_int Function -%21 = OpLoad %v4float %BaseColor -OpStore %v %21 -%22 = OpLoad %float %f -%23 = OpConvertFToS %int %22 -OpStore %i %23 -%24 = OpLoad %int %i -OpSelectionMerge %25 None -OpSwitch %24 %26 0 %27 1 %28 2 %29 -%26 = OpLabel -OpBranch %25 -%27 = OpLabel -%30 = OpLoad %v4float %v -%31 = OpVectorTimesScalar %v4float %30 %float_0_1 -OpStore %v %31 -OpBranch %25 -%28 = OpLabel -%32 = OpLoad %v4float %v -%33 = OpCompositeConstruct %v4float %float_0_1 %float_0_1 %float_0_1 %float_0_1 -%34 = OpFAdd %v4float %32 %33 -OpStore %v %34 -OpBranch %29 -%29 = OpLabel -%35 = OpLoad %v4float %v -%36 = OpVectorTimesScalar %v4float %35 %float_0_7 -OpStore %v %36 -OpBranch %25 -%25 = OpLabel -%37 = OpLoad %v4float %v -OpStore %gl_FragColor %37 -OpReturn -OpFunctionEnd -)"; - - const std::string after = - R"(%main = OpFunction %void None %9 -%20 = OpLabel -%21 = OpLoad %v4float %BaseColor -%22 = OpLoad %float %f -%23 = OpConvertFToS %int %22 -OpSelectionMerge %25 None -OpSwitch %23 %26 0 %27 1 %28 2 %29 -%26 = OpLabel -OpBranch %25 -%27 = OpLabel -%31 = OpVectorTimesScalar %v4float %21 %float_0_1 -OpBranch %25 -%28 = OpLabel -%33 = OpCompositeConstruct %v4float %float_0_1 %float_0_1 %float_0_1 %float_0_1 -%34 = OpFAdd %v4float %21 %33 -OpBranch %29 -%29 = OpLabel -%38 = OpPhi %v4float %21 %20 %34 %28 -%36 = OpVectorTimesScalar %v4float %38 %float_0_7 -OpBranch %25 -%25 = OpLabel -%39 = OpPhi %v4float %21 %26 %31 %27 %36 %29 -OpStore %gl_FragColor %39 -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck( - predefs + names_before + predefs2 + before, - predefs + names_after + predefs2 + after, - true, true); -} - -TEST_F(LocalSSAElimTest, DontPatchPhiInLoopHeaderThatIsNotAVar) { - // From https://github.com/KhronosGroup/SPIRV-Tools/issues/826 - // Don't try patching the (%16 %7) value/predecessor pair in the OpPhi. - // That OpPhi is unrelated to this optimization: we did not set that up - // in the SSA initialization for the loop header block. - // The pass should be a no-op on this module. - - const std::string before = R"(OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %1 "main" -%void = OpTypeVoid -%3 = OpTypeFunction %void -%float = OpTypeFloat 32 -%float_1 = OpConstant %float 1 -%1 = OpFunction %void None %3 -%6 = OpLabel -OpBranch %7 -%7 = OpLabel -%8 = OpPhi %float %float_1 %6 %9 %7 -%9 = OpFAdd %float %8 %float_1 -OpLoopMerge %10 %7 None -OpBranch %7 -%10 = OpLabel -OpReturn -OpFunctionEnd -)"; - - SinglePassRunAndCheck(before, before, true, - true); -} - -// TODO(greg-lunarg): Add tests to verify handling of these cases: -// -// No optimization in the presence of -// access chains -// function calls -// OpCopyMemory? -// unsupported extensions -// Others? - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/module_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/module_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/module_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/module_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -#include "message.h" -#include "opt/build_module.h" -#include "opt/module.h" -#include "spirv-tools/libspirv.hpp" - -#include "module_utils.h" - -namespace { - -using spvtools::ir::Module; -using spvtest::GetIdBound; -using ::testing::Eq; - -TEST(ModuleTest, SetIdBound) { - Module m; - // It's initialized to 0. - EXPECT_EQ(0u, GetIdBound(m)); - - m.SetIdBound(19); - EXPECT_EQ(19u, GetIdBound(m)); - - m.SetIdBound(102); - EXPECT_EQ(102u, GetIdBound(m)); -} - -// Returns a module formed by assembling the given text, -// then loading the result. -inline std::unique_ptr BuildModule(std::string text) { - return spvtools::BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text); -} - -TEST(ModuleTest, ComputeIdBound) { - // Emtpy module case. - EXPECT_EQ(1u, BuildModule("")->ComputeIdBound()); - // Sensitive to result id - EXPECT_EQ(2u, BuildModule("%void = OpTypeVoid")->ComputeIdBound()); - // Sensitive to type id - EXPECT_EQ(1000u, BuildModule("%a = OpTypeArray !999 3")->ComputeIdBound()); - // Sensitive to a regular Id parameter - EXPECT_EQ(2000u, BuildModule("OpDecorate !1999 0")->ComputeIdBound()); - // Sensitive to a scope Id parameter. - EXPECT_EQ(3000u, - BuildModule("%f = OpFunction %void None %fntype %a = OpLabel " - "OpMemoryBarrier !2999 %b\n") - ->ComputeIdBound()); - // Sensitive to a semantics Id parameter - EXPECT_EQ(4000u, - BuildModule("%f = OpFunction %void None %fntype %a = OpLabel " - "OpMemoryBarrier %b !3999\n") - ->ComputeIdBound()); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/module_utils.h vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/module_utils.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/module_utils.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/module_utils.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_TEST_OPT_MODULE_UTILS_H_ -#define LIBSPIRV_TEST_OPT_MODULE_UTILS_H_ - -#include -#include "opt/module.h" - -namespace spvtest { - -inline uint32_t GetIdBound(const spvtools::ir::Module& m) { - std::vector binary; - m.ToBinary(&binary, false); - // The 5-word header must always exist. - EXPECT_LE(5u, binary.size()); - // The bound is the fourth word. - return binary[3]; -} - -} // namespace spvtest - -#endif // LIBSPIRV_TEST_OPT_MODULE_UTILS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/optimizer_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/optimizer_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/optimizer_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/optimizer_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,109 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include - -#include "spirv-tools/libspirv.hpp" -#include "spirv-tools/optimizer.hpp" - -#include "pass_fixture.h" - -namespace { - -using spvtools::CreateNullPass; -using spvtools::CreateStripDebugInfoPass; -using spvtools::Optimizer; -using spvtools::SpirvTools; -using ::testing::Eq; - -TEST(Optimizer, CanRunNullPassWithDistinctInputOutputVectors) { - SpirvTools tools(SPV_ENV_UNIVERSAL_1_0); - std::vector binary_in; - tools.Assemble("OpName %foo \"foo\"\n%foo = OpTypeVoid", &binary_in); - - Optimizer opt(SPV_ENV_UNIVERSAL_1_0); - opt.RegisterPass(CreateNullPass()); - std::vector binary_out; - opt.Run(binary_in.data(), binary_in.size(), &binary_out); - - std::string disassembly; - tools.Disassemble(binary_out.data(), binary_out.size(), &disassembly); - EXPECT_THAT(disassembly, Eq("OpName %foo \"foo\"\n%foo = OpTypeVoid\n")); -} - -TEST(Optimizer, CanRunTransformingPassWithDistinctInputOutputVectors) { - SpirvTools tools(SPV_ENV_UNIVERSAL_1_0); - std::vector binary_in; - tools.Assemble("OpName %foo \"foo\"\n%foo = OpTypeVoid", &binary_in); - - Optimizer opt(SPV_ENV_UNIVERSAL_1_0); - opt.RegisterPass(CreateStripDebugInfoPass()); - std::vector binary_out; - opt.Run(binary_in.data(), binary_in.size(), &binary_out); - - std::string disassembly; - tools.Disassemble(binary_out.data(), binary_out.size(), &disassembly); - EXPECT_THAT(disassembly, Eq("%void = OpTypeVoid\n")); -} - -TEST(Optimizer, CanRunNullPassWithAliasedVectors) { - SpirvTools tools(SPV_ENV_UNIVERSAL_1_0); - std::vector binary; - tools.Assemble("OpName %foo \"foo\"\n%foo = OpTypeVoid", &binary); - - Optimizer opt(SPV_ENV_UNIVERSAL_1_0); - opt.RegisterPass(CreateNullPass()); - opt.Run(binary.data(), binary.size(), &binary); // This is the key. - - std::string disassembly; - tools.Disassemble(binary.data(), binary.size(), &disassembly); - EXPECT_THAT(disassembly, Eq("OpName %foo \"foo\"\n%foo = OpTypeVoid\n")); -} - -TEST(Optimizer, CanRunNullPassWithAliasedVectorDataButDifferentSize) { - SpirvTools tools(SPV_ENV_UNIVERSAL_1_0); - std::vector binary; - tools.Assemble("OpName %foo \"foo\"\n%foo = OpTypeVoid", &binary); - - Optimizer opt(SPV_ENV_UNIVERSAL_1_0); - opt.RegisterPass(CreateNullPass()); - auto orig_size = binary.size(); - // Now change the size. Add a word that will be ignored - // by the optimizer. - binary.push_back(42); - EXPECT_THAT(orig_size + 1, Eq(binary.size())); - opt.Run(binary.data(), orig_size, &binary); // This is the key. - // The binary vector should have been rewritten. - EXPECT_THAT(binary.size(), Eq(orig_size)); - - std::string disassembly; - tools.Disassemble(binary.data(), binary.size(), &disassembly); - EXPECT_THAT(disassembly, Eq("OpName %foo \"foo\"\n%foo = OpTypeVoid\n")); -} - -TEST(Optimizer, CanRunTransformingPassWithAliasedVectors) { - SpirvTools tools(SPV_ENV_UNIVERSAL_1_0); - std::vector binary; - tools.Assemble("OpName %foo \"foo\"\n%foo = OpTypeVoid", &binary); - - Optimizer opt(SPV_ENV_UNIVERSAL_1_0); - opt.RegisterPass(CreateStripDebugInfoPass()); - opt.Run(binary.data(), binary.size(), &binary); // This is the key - - std::string disassembly; - tools.Disassemble(binary.data(), binary.size(), &disassembly); - EXPECT_THAT(disassembly, Eq("%void = OpTypeVoid\n")); -} - -} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/pass_fixture.h vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/pass_fixture.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/pass_fixture.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/pass_fixture.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,202 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_TEST_OPT_PASS_FIXTURE_H_ -#define LIBSPIRV_TEST_OPT_PASS_FIXTURE_H_ - -#include -#include -#include -#include - -#include - -#include "opt/build_module.h" -#include "opt/make_unique.h" -#include "opt/pass_manager.h" -#include "opt/passes.h" -#include "spirv-tools/libspirv.hpp" - -namespace spvtools { - -// Template class for testing passes. It contains some handy utility methods for -// running passes and checking results. -// -// To write value-Parameterized tests: -// using ValueParamTest = PassTest<::testing::TestWithParam>; -// To use as normal fixture: -// using FixtureTest = PassTest<::testing::Test>; -template -class PassTest : public TestT { - public: - PassTest() - : consumer_(nullptr), - tools_(SPV_ENV_UNIVERSAL_1_1), - manager_(new opt::PassManager()), - assemble_options_(SpirvTools::kDefaultAssembleOption), - disassemble_options_(SpirvTools::kDefaultDisassembleOption) {} - - // Runs the given |pass| on the binary assembled from the |original|. - // Returns a tuple of the optimized binary and the boolean value returned - // from pass Process() function. - std::tuple, opt::Pass::Status> OptimizeToBinary( - opt::Pass* pass, const std::string& original, bool skip_nop) { - std::unique_ptr module = BuildModule( - SPV_ENV_UNIVERSAL_1_1, consumer_, original, assemble_options_); - EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" - << original << std::endl; - if (!module) { - return std::make_tuple(std::vector(), - opt::Pass::Status::Failure); - } - - const auto status = pass->Process(module.get()); - - std::vector binary; - module->ToBinary(&binary, skip_nop); - return std::make_tuple(binary, status); - } - - // Runs a single pass of class |PassT| on the binary assembled from the - // |assembly|. Returns a tuple of the optimized binary and the boolean value - // from the pass Process() function. - template - std::tuple, opt::Pass::Status> SinglePassRunToBinary( - const std::string& assembly, bool skip_nop, Args&&... args) { - auto pass = MakeUnique(std::forward(args)...); - pass->SetMessageConsumer(consumer_); - return OptimizeToBinary(pass.get(), assembly, skip_nop); - } - - // Runs a single pass of class |PassT| on the binary assembled from the - // |assembly|, disassembles the optimized binary. Returns a tuple of - // disassembly string and the boolean value from the pass Process() function. - template - std::tuple SinglePassRunAndDisassemble( - const std::string& assembly, bool skip_nop, Args&&... args) { - std::vector optimized_bin; - auto status = opt::Pass::Status::SuccessWithoutChange; - std::tie(optimized_bin, status) = SinglePassRunToBinary( - assembly, skip_nop, std::forward(args)...); - std::string optimized_asm; - EXPECT_TRUE(tools_.Disassemble(optimized_bin, &optimized_asm, - disassemble_options_)) - << "Disassembling failed for shader:\n" - << assembly << std::endl; - return std::make_tuple(optimized_asm, status); - } - - // Runs a single pass of class |PassT| on the binary assembled from the - // |original| assembly, and checks whether the optimized binary can be - // disassembled to the |expected| assembly. Optionally will also validate - // the optimized binary. This does *not* involve pass manager. Callers - // are suggested to use SCOPED_TRACE() for better messages. - template - void SinglePassRunAndCheck(const std::string& original, - const std::string& expected, bool skip_nop, - bool do_validation, Args&&... args) { - std::vector optimized_bin; - auto status = opt::Pass::Status::SuccessWithoutChange; - std::tie(optimized_bin, status) = SinglePassRunToBinary( - original, skip_nop, std::forward(args)...); - // Check whether the pass returns the correct modification indication. - EXPECT_NE(opt::Pass::Status::Failure, status); - EXPECT_EQ(original == expected, - status == opt::Pass::Status::SuccessWithoutChange); - if (do_validation) { - spv_target_env target_env = SPV_ENV_UNIVERSAL_1_1; - spv_context context = spvContextCreate(target_env); - spv_diagnostic diagnostic = nullptr; - spv_const_binary_t binary = {optimized_bin.data(), - optimized_bin.size()}; - spv_result_t error = spvValidate(context, &binary, &diagnostic); - EXPECT_EQ(error, 0); - if (error != 0) - spvDiagnosticPrint(diagnostic); - spvDiagnosticDestroy(diagnostic); - spvContextDestroy(context); - } - std::string optimized_asm; - EXPECT_TRUE(tools_.Disassemble(optimized_bin, &optimized_asm, - disassemble_options_)) - << "Disassembling failed for shader:\n" - << original << std::endl; - EXPECT_EQ(expected, optimized_asm); - } - - // Runs a single pass of class |PassT| on the binary assembled from the - // |original| assembly, and checks whether the optimized binary can be - // disassembled to the |expected| assembly. This does *not* involve pass - // manager. Callers are suggested to use SCOPED_TRACE() for better messages. - template - void SinglePassRunAndCheck(const std::string& original, - const std::string& expected, bool skip_nop, - Args&&... args) { - SinglePassRunAndCheck(original, expected, skip_nop, false, - std::forward(args)...); - } - - // Adds a pass to be run. - template - void AddPass(Args&&... args) { - manager_->AddPass(std::forward(args)...); - } - - // Renews the pass manager, including clearing all previously added passes. - void RenewPassManger() { - manager_.reset(new opt::PassManager()); - manager_->SetMessageConsumer(consumer_); - } - - // Runs the passes added thus far using a pass manager on the binary assembled - // from the |original| assembly, and checks whether the optimized binary can - // be disassembled to the |expected| assembly. Callers are suggested to use - // SCOPED_TRACE() for better messages. - void RunAndCheck(const std::string& original, const std::string& expected) { - assert(manager_->NumPasses()); - - std::unique_ptr module = BuildModule( - SPV_ENV_UNIVERSAL_1_1, nullptr, original, assemble_options_); - ASSERT_NE(nullptr, module); - - manager_->Run(module.get()); - - std::vector binary; - module->ToBinary(&binary, /* skip_nop = */ false); - - std::string optimized; - EXPECT_TRUE(tools_.Disassemble(binary, &optimized, - disassemble_options_)); - EXPECT_EQ(expected, optimized); - } - - void SetAssembleOptions(uint32_t assemble_options) { - assemble_options_ = assemble_options; - } - - void SetDisassembleOptions(uint32_t disassemble_options) { - disassemble_options_ = disassemble_options; - } - - private: - MessageConsumer consumer_; // Message consumer. - SpirvTools tools_; // An instance for calling SPIRV-Tools functionalities. - std::unique_ptr manager_; // The pass manager. - uint32_t assemble_options_; - uint32_t disassemble_options_; -}; - -} // namespace spvtools - -#endif // LIBSPIRV_TEST_OPT_PASS_FIXTURE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/pass_manager_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/pass_manager_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/pass_manager_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/pass_manager_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,183 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "gmock/gmock.h" - -#include - -#include "module_utils.h" -#include "opt/make_unique.h" -#include "pass_fixture.h" - -namespace { - -using namespace spvtools; -using spvtest::GetIdBound; -using ::testing::Eq; - -// A null pass whose construtors accept arguments -class NullPassWithArgs : public opt::NullPass { - public: - NullPassWithArgs(uint32_t) {} - NullPassWithArgs(std::string) {} - NullPassWithArgs(const std::vector&) {} - NullPassWithArgs(const std::vector&, uint32_t) {} - - const char* name() const override { return "null-with-args"; } -}; - -TEST(PassManager, Interface) { - opt::PassManager manager; - EXPECT_EQ(0u, manager.NumPasses()); - - manager.AddPass(); - EXPECT_EQ(1u, manager.NumPasses()); - EXPECT_STREQ("strip-debug", manager.GetPass(0)->name()); - - manager.AddPass(MakeUnique()); - EXPECT_EQ(2u, manager.NumPasses()); - EXPECT_STREQ("strip-debug", manager.GetPass(0)->name()); - EXPECT_STREQ("null", manager.GetPass(1)->name()); - - manager.AddPass(); - EXPECT_EQ(3u, manager.NumPasses()); - EXPECT_STREQ("strip-debug", manager.GetPass(0)->name()); - EXPECT_STREQ("null", manager.GetPass(1)->name()); - EXPECT_STREQ("strip-debug", manager.GetPass(2)->name()); - - manager.AddPass(1u); - manager.AddPass("null pass args"); - manager.AddPass(std::initializer_list{1, 2}); - manager.AddPass(std::initializer_list{1, 2}, 3); - EXPECT_EQ(7u, manager.NumPasses()); - EXPECT_STREQ("strip-debug", manager.GetPass(0)->name()); - EXPECT_STREQ("null", manager.GetPass(1)->name()); - EXPECT_STREQ("strip-debug", manager.GetPass(2)->name()); - EXPECT_STREQ("null-with-args", manager.GetPass(3)->name()); - EXPECT_STREQ("null-with-args", manager.GetPass(4)->name()); - EXPECT_STREQ("null-with-args", manager.GetPass(5)->name()); - EXPECT_STREQ("null-with-args", manager.GetPass(6)->name()); -} - -// A pass that appends an OpNop instruction to the debug1 section. -class AppendOpNopPass : public opt::Pass { - public: - const char* name() const override { return "AppendOpNop"; } - Status Process(ir::Module* module) override { - module->AddDebug1Inst(MakeUnique()); - return Status::SuccessWithChange; - } -}; - -// A pass that appends specified number of OpNop instructions to the debug1 -// section. -class AppendMultipleOpNopPass : public opt::Pass { - public: - explicit AppendMultipleOpNopPass(uint32_t num_nop) : num_nop_(num_nop) {} - - const char* name() const override { return "AppendOpNop"; } - Status Process(ir::Module* module) override { - for (uint32_t i = 0; i < num_nop_; i++) { - module->AddDebug1Inst(MakeUnique()); - } - return Status::SuccessWithChange; - } - - private: - uint32_t num_nop_; -}; - -// A pass that duplicates the last instruction in the debug1 section. -class DuplicateInstPass : public opt::Pass { - public: - const char* name() const override { return "DuplicateInst"; } - Status Process(ir::Module* module) override { - auto inst = MakeUnique(*(--module->debug1_end())); - module->AddDebug1Inst(std::move(inst)); - return Status::SuccessWithChange; - } -}; - -using PassManagerTest = PassTest<::testing::Test>; - -TEST_F(PassManagerTest, Run) { - const std::string text = "OpMemoryModel Logical GLSL450\nOpSource ESSL 310\n"; - - AddPass(); - AddPass(); - RunAndCheck(text.c_str(), (text + "OpNop\nOpNop\n").c_str()); - - RenewPassManger(); - AddPass(); - AddPass(); - RunAndCheck(text.c_str(), (text + "OpNop\nOpNop\n").c_str()); - - RenewPassManger(); - AddPass(); - AddPass(); - RunAndCheck(text.c_str(), (text + "OpSource ESSL 310\nOpNop\n").c_str()); - - RenewPassManger(); - AddPass(3); - RunAndCheck(text.c_str(), (text + "OpNop\nOpNop\nOpNop\n").c_str()); -} - -// A pass that appends an OpTypeVoid instruction that uses a given id. -class AppendTypeVoidInstPass : public opt::Pass { - public: - explicit AppendTypeVoidInstPass(uint32_t result_id) : result_id_(result_id) {} - - const char* name() const override { return "AppendTypeVoidInstPass"; } - Status Process(ir::Module* module) override { - auto inst = MakeUnique(SpvOpTypeVoid, 0, result_id_, - std::vector{}); - module->AddType(std::move(inst)); - return Status::SuccessWithChange; - } - - private: - uint32_t result_id_; -}; - -TEST(PassManager, RecomputeIdBoundAutomatically) { - ir::Module module; - EXPECT_THAT(GetIdBound(module), Eq(0u)); - - opt::PassManager manager; - manager.Run(&module); - manager.AddPass(); - // With no ID changes, the ID bound does not change. - EXPECT_THAT(GetIdBound(module), Eq(0u)); - - // Now we force an Id of 100 to be used. - manager.AddPass(MakeUnique(100)); - EXPECT_THAT(GetIdBound(module), Eq(0u)); - manager.Run(&module); - // The Id has been updated automatically, even though the pass - // did not update it. - EXPECT_THAT(GetIdBound(module), Eq(101u)); - - // Try one more time! - manager.AddPass(MakeUnique(200)); - manager.Run(&module); - EXPECT_THAT(GetIdBound(module), Eq(201u)); - - // Add another pass, but which uses a lower Id. - manager.AddPass(MakeUnique(10)); - manager.Run(&module); - // The Id stays high. - EXPECT_THAT(GetIdBound(module), Eq(201u)); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/pass_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/pass_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/pass_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/pass_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,241 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include -#include - -#include - -#include "assembly_builder.h" -#include "opt/pass.h" -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { -using namespace spvtools; -class DummyPass : public opt::Pass { - public: - const char* name() const override { return "dummy-pass"; } - Status Process(ir::Module* module) override { - return module ? Status::SuccessWithoutChange : Status::Failure; - } -}; -} // namespace - -namespace { - -using namespace spvtools; -using ::testing::UnorderedElementsAre; - -using PassClassTest = PassTest<::testing::Test>; - -TEST_F(PassClassTest, BasicVisitFromEntryPoint) { - // Make sure we visit the entry point, and the function it calls. - // Do not visit Dead or Exported. - const std::string text = R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %10 "main" - OpName %10 "main" - OpName %Dead "Dead" - OpName %11 "Constant" - OpName %ExportedFunc "ExportedFunc" - OpDecorate %ExportedFunc LinkageAttributes "ExportedFunc" Export - %void = OpTypeVoid - %6 = OpTypeFunction %void - %10 = OpFunction %void None %6 - %14 = OpLabel - %15 = OpFunctionCall %void %11 - %16 = OpFunctionCall %void %11 - OpReturn - OpFunctionEnd - %11 = OpFunction %void None %6 - %18 = OpLabel - OpReturn - OpFunctionEnd - %Dead = OpFunction %void None %6 - %19 = OpLabel - OpReturn - OpFunctionEnd -%ExportedFunc = OpFunction %void None %7 - %20 = OpLabel - %21 = OpFunctionCall %void %11 - OpReturn - OpFunctionEnd -)"; - // clang-format on - - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" - << text << std::endl; - DummyPass testPass; - std::vector processed; - opt::Pass::ProcessFunction mark_visited = [&processed](ir::Function* fp) { - processed.push_back(fp->result_id()); - return false; - }; - testPass.ProcessEntryPointCallTree(mark_visited, module.get()); - EXPECT_THAT(processed, UnorderedElementsAre(10, 11)); -} - -TEST_F(PassClassTest, BasicVisitReachable) { - // Make sure we visit the entry point, exported function, and the function - // they call. Do not visit Dead. - const std::string text = R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %10 "main" - OpName %10 "main" - OpName %Dead "Dead" - OpName %11 "Constant" - OpName %12 "ExportedFunc" - OpName %13 "Constant2" - OpDecorate %12 LinkageAttributes "ExportedFunc" Export - %void = OpTypeVoid - %6 = OpTypeFunction %void - %10 = OpFunction %void None %6 - %14 = OpLabel - %15 = OpFunctionCall %void %11 - %16 = OpFunctionCall %void %11 - OpReturn - OpFunctionEnd - %11 = OpFunction %void None %6 - %18 = OpLabel - OpReturn - OpFunctionEnd - %Dead = OpFunction %void None %6 - %19 = OpLabel - OpReturn - OpFunctionEnd - %12 = OpFunction %void None %9 - %20 = OpLabel - %21 = OpFunctionCall %void %13 - OpReturn - OpFunctionEnd - %13 = OpFunction %void None %6 - %22 = OpLabel - OpReturn - OpFunctionEnd -)"; - // clang-format on - - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" - << text << std::endl; - DummyPass testPass; - std::vector processed; - opt::Pass::ProcessFunction mark_visited = [&processed](ir::Function* fp) { - processed.push_back(fp->result_id()); - return false; - }; - testPass.ProcessReachableCallTree(mark_visited, module.get()); - EXPECT_THAT(processed, UnorderedElementsAre(10, 11, 12, 13)); -} - -TEST_F(PassClassTest, BasicVisitOnlyOnce) { - // Make sure we visit %11 only once, even if it is called from two different - // functions. - const std::string text = R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %10 "main" %gl_FragColor - OpName %10 "main" - OpName %Dead "Dead" - OpName %11 "Constant" - OpName %12 "ExportedFunc" - OpDecorate %12 LinkageAttributes "ExportedFunc" Export - %void = OpTypeVoid - %6 = OpTypeFunction %void - %10 = OpFunction %void None %6 - %14 = OpLabel - %15 = OpFunctionCall %void %11 - %16 = OpFunctionCall %void %12 - OpReturn - OpFunctionEnd - %11 = OpFunction %void None %6 - %18 = OpLabel - %19 = OpFunctionCall %void %12 - OpReturn - OpFunctionEnd - %Dead = OpFunction %void None %6 - %20 = OpLabel - OpReturn - OpFunctionEnd - %12 = OpFunction %void None %9 - %21 = OpLabel - OpReturn - OpFunctionEnd -)"; - // clang-format on - - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" - << text << std::endl; - DummyPass testPass; - std::vector processed; - opt::Pass::ProcessFunction mark_visited = [&processed](ir::Function* fp) { - processed.push_back(fp->result_id()); - return false; - }; - testPass.ProcessReachableCallTree(mark_visited, module.get()); - EXPECT_THAT(processed, UnorderedElementsAre(10, 11, 12)); -} - -TEST_F(PassClassTest, BasicDontVisitExportedVariable) { - // Make sure we only visit functions and not exported variables. - const std::string text = R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %10 "main" %gl_FragColor - OpExecutionMode %10 OriginUpperLeft - OpSource GLSL 150 - OpName %10 "main" - OpName %Dead "Dead" - OpName %11 "Constant" - OpName %12 "export_var" - OpDecorate %12 LinkageAttributes "export_var" Export - %void = OpTypeVoid - %6 = OpTypeFunction %void - %float = OpTypeFloat 32 - %float_1 = OpConstant %float 1 - %12 = OpVariable %float Output - %10 = OpFunction %void None %6 - %14 = OpLabel - OpStore %12 %float_1 - OpReturn - OpFunctionEnd -)"; - // clang-format on - - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text, - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n" - << text << std::endl; - DummyPass testPass; - std::vector processed; - opt::Pass::ProcessFunction mark_visited = [&processed](ir::Function* fp) { - processed.push_back(fp->result_id()); - return false; - }; - testPass.ProcessReachableCallTree(mark_visited, module.get()); - EXPECT_THAT(processed, UnorderedElementsAre(10)); -} -} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/pass_utils.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/pass_utils.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/pass_utils.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/pass_utils.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "pass_utils.h" - -#include -#include - -namespace { - -// Well, this is another place requiring the knowledge of the grammar and can be -// stale when SPIR-V is updated. It would be nice to automatically generate -// this, but the cost is just too high. - -const char* kDebugOpcodes[] = { - // clang-format off - "OpSourceContinued", "OpSource", "OpSourceExtension", - "OpName", "OpMemberName", "OpString", - "OpLine", "OpNoLine", "OpModuleProcessed" - // clang-format on -}; - -} // anonymous namespace - -namespace spvtools { - -bool FindAndReplace(std::string* process_str, const std::string find_str, - const std::string replace_str) { - if (process_str->empty() || find_str.empty()) { - return false; - } - bool replaced = false; - // Note this algorithm has quadratic time complexity. It is OK for test cases - // with short strings, but might not fit in other contexts. - for (size_t pos = process_str->find(find_str, 0); pos != std::string::npos; - pos = process_str->find(find_str, pos)) { - process_str->replace(pos, find_str.length(), replace_str); - pos += replace_str.length(); - replaced = true; - } - return replaced; -} - -bool ContainsDebugOpcode(const char* inst) { - return std::any_of(std::begin(kDebugOpcodes), std::end(kDebugOpcodes), - [inst](const char* op) { - return std::string(inst).find(op) != std::string::npos; - }); -} - -std::string SelectiveJoin(const std::vector& strings, - const std::function& skip_dictator, - char delimiter) { - std::ostringstream oss; - for (const auto* str : strings) { - if (!skip_dictator(str)) oss << str << delimiter; - } - return oss.str(); -} - -std::string JoinAllInsts(const std::vector& insts) { - return SelectiveJoin(insts, [](const char*) { return false; }); -} - -std::string JoinNonDebugInsts(const std::vector& insts) { - return SelectiveJoin( - insts, [](const char* inst) { return ContainsDebugOpcode(inst); }); -} - -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/pass_utils.h vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/pass_utils.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/pass_utils.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/pass_utils.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_TEST_OPT_PASS_UTILS_H_ -#define LIBSPIRV_TEST_OPT_PASS_UTILS_H_ - -#include -#include -#include - -namespace spvtools { - -// In-place substring replacement. Finds the |find_str| in the |process_str| -// and replaces the found substring with |replace_str|. Returns true if at -// least one replacement is done successfully, returns false otherwise. The -// replaced substring won't be processed again, which means: If the -// |replace_str| has |find_str| as its substring, that newly replaced part of -// |process_str| won't be processed again. -bool FindAndReplace(std::string* process_str, const std::string find_str, - const std::string replace_str); - -// Returns true if the given string contains any debug opcode substring. -bool ContainsDebugOpcode(const char* inst); - -// Returns the concatenated string from a vector of |strings|, with postfixing -// each string with the given |delimiter|. if the |skip_dictator| returns true -// for an original string, that string will be omitted. -std::string SelectiveJoin(const std::vector& strings, - const std::function& skip_dictator, - char delimiter = '\n'); - -// Concatenates a vector of strings into one string. Each string is postfixed -// with '\n'. -std::string JoinAllInsts(const std::vector& insts); - -// Concatenates a vector of strings into one string. Each string is postfixed -// with '\n'. If a string contains opcode for debug instruction, that string -// will be ignored. -std::string JoinNonDebugInsts(const std::vector& insts); - -// Returns a vector that contains the contents of |a| followed by the contents -// of |b|. -template -std::vector Concat(const std::vector& a, const std::vector& b) { - std::vector ret; - std::copy(a.begin(), a.end(), back_inserter(ret)); - std::copy(b.begin(), b.end(), back_inserter(ret)); - return ret; -} - -} // namespace spvtools - -#endif // LIBSPIRV_TEST_OPT_PASS_UTILS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/set_spec_const_default_value_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/set_spec_const_default_value_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/set_spec_const_default_value_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/set_spec_const_default_value_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1059 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "pass_fixture.h" - -#include - -namespace { -using namespace spvtools; - -using testing::Eq; - -using SpecIdToValueStrMap = - opt::SetSpecConstantDefaultValuePass::SpecIdToValueStrMap; -using SpecIdToValueBitPatternMap = - opt::SetSpecConstantDefaultValuePass::SpecIdToValueBitPatternMap; - -struct DefaultValuesStringParsingTestCase { - const char* default_values_str; - bool expect_success; - SpecIdToValueStrMap expected_map; -}; - -using DefaultValuesStringParsingTest = - ::testing::TestWithParam; - -TEST_P(DefaultValuesStringParsingTest, TestCase) { - const auto& tc = GetParam(); - auto actual_map = - opt::SetSpecConstantDefaultValuePass::ParseDefaultValuesString( - tc.default_values_str); - if (tc.expect_success) { - EXPECT_NE(nullptr, actual_map); - if (actual_map) { EXPECT_THAT(*actual_map, Eq(tc.expected_map)); } - } else { - EXPECT_EQ(nullptr, actual_map); - } -} - -INSTANTIATE_TEST_CASE_P( - ValidString, DefaultValuesStringParsingTest, - ::testing::ValuesIn(std::vector{ - // 0. empty map - {"", true, SpecIdToValueStrMap{}}, - // 1. one pair - {"100:1024", true, SpecIdToValueStrMap{{100, "1024"}}}, - // 2. two pairs - {"100:1024 200:2048", true, - SpecIdToValueStrMap{{100, "1024"}, {200, "2048"}}}, - // 3. spaces between entries - {"100:1024 \n \r \t \v \f 200:2048", true, - SpecIdToValueStrMap{{100, "1024"}, {200, "2048"}}}, - // 4. \t, \n, \r and spaces before spec id - {" \n \r\t \t \v \f 100:1024", true, - SpecIdToValueStrMap{{100, "1024"}}}, - // 5. \t, \n, \r and spaces after value string - {"100:1024 \n \r\t \t \v \f ", true, - SpecIdToValueStrMap{{100, "1024"}}}, - // 6. maximum spec id - {"4294967295:0", true, SpecIdToValueStrMap{{4294967295, "0"}}}, - // 7. minimum spec id - {"0:100", true, SpecIdToValueStrMap{{0, "100"}}}, - // 8. random content without spaces are allowed - {"200:random_stuff", true, SpecIdToValueStrMap{{200, "random_stuff"}}}, - // 9. support hex format spec id (just because we use the - // ParseNumber() utility) - {"0x100:1024", true, SpecIdToValueStrMap{{256, "1024"}}}, - // 10. multiple entries - {"101:1 102:2 103:3 104:4 200:201 9999:1000 0x100:333", true, - SpecIdToValueStrMap{{101, "1"}, - {102, "2"}, - {103, "3"}, - {104, "4"}, - {200, "201"}, - {9999, "1000"}, - {256, "333"}}}, - // 11. default value in hex float format - {"100:0x0.3p10", true, SpecIdToValueStrMap{{100, "0x0.3p10"}}}, - // 12. default value in decimal float format - {"100:1.5e-13", true, SpecIdToValueStrMap{{100, "1.5e-13"}}}, - })); - -INSTANTIATE_TEST_CASE_P( - InvalidString, DefaultValuesStringParsingTest, - ::testing::ValuesIn(std::vector{ - // 0. missing default value - {"100:", false, SpecIdToValueStrMap{}}, - // 1. spec id is not an integer - {"100.0:200", false, SpecIdToValueStrMap{}}, - // 2. spec id is not a number - {"something_not_a_number:1", false, SpecIdToValueStrMap{}}, - // 3. only spec id number - {"100", false, SpecIdToValueStrMap{}}, - // 4. same spec id defined multiple times - {"100:20 100:21", false, SpecIdToValueStrMap{}}, - // 5. Multiple definition of an identical spec id in different forms - // is not allowed - {"0x100:100 256:200", false, SpecIdToValueStrMap{}}, - // 6. empty spec id - {":3", false, SpecIdToValueStrMap{}}, - // 7. only colon - {":", false, SpecIdToValueStrMap{}}, - // 8. spec id overflow - {"4294967296:200", false, SpecIdToValueStrMap{}}, - // 9. spec id less than 0 - {"-1:200", false, SpecIdToValueStrMap{}}, - // 10. nullptr - {nullptr, false, SpecIdToValueStrMap{}}, - // 11. only a number is invalid - {"1234", false, SpecIdToValueStrMap{}}, - // 12. invalid entry separator - {"12:34;23:14", false, SpecIdToValueStrMap{}}, - // 13. invalid spec id and default value separator - {"12@34", false, SpecIdToValueStrMap{}}, - // 14. spaces before colon - {"100 :1024", false, SpecIdToValueStrMap{}}, - // 15. spaces after colon - {"100: 1024", false, SpecIdToValueStrMap{}}, - // 16. spec id represented in hex float format is invalid - {"0x3p10:200", false, SpecIdToValueStrMap{}}, - })); - -struct SetSpecConstantDefaultValueInStringFormTestCase { - const char* code; - SpecIdToValueStrMap default_values; - const char* expected; -}; - -using SetSpecConstantDefaultValueInStringFormParamTest = PassTest< - ::testing::TestWithParam>; - -TEST_P(SetSpecConstantDefaultValueInStringFormParamTest, TestCase) { - const auto& tc = GetParam(); - SinglePassRunAndCheck( - tc.code, tc.expected, /* skip_nop = */ false, tc.default_values); -} - -INSTANTIATE_TEST_CASE_P( - ValidCases, SetSpecConstantDefaultValueInStringFormParamTest, - ::testing::ValuesIn(std::vector< - SetSpecConstantDefaultValueInStringFormTestCase>{ - // 0. Empty. - {"", SpecIdToValueStrMap{}, ""}, - // 1. Empty with non-empty values to set. - {"", SpecIdToValueStrMap{{1, "100"}, {2, "200"}}, ""}, - // 2. Bool type. - { - // code - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "%bool = OpTypeBool\n" - "%1 = OpSpecConstantTrue %bool\n" - "%2 = OpSpecConstantFalse %bool\n", - // default values - SpecIdToValueStrMap{{100, "false"}, {101, "true"}}, - // expected - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "%bool = OpTypeBool\n" - "%1 = OpSpecConstantFalse %bool\n" - "%2 = OpSpecConstantTrue %bool\n", - }, - // 3. 32-bit int type. - { - // code - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "OpDecorate %3 SpecId 102\n" - "%int = OpTypeInt 32 1\n" - "%1 = OpSpecConstant %int 10\n" - "%2 = OpSpecConstant %int 11\n" - "%3 = OpSpecConstant %int 11\n", - // default values - SpecIdToValueStrMap{ - {100, "2147483647"}, {101, "0xffffffff"}, {102, "-42"}}, - // expected - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "OpDecorate %3 SpecId 102\n" - "%int = OpTypeInt 32 1\n" - "%1 = OpSpecConstant %int 2147483647\n" - "%2 = OpSpecConstant %int -1\n" - "%3 = OpSpecConstant %int -42\n", - }, - // 4. 64-bit uint type. - { - // code - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "%ulong = OpTypeInt 64 0\n" - "%1 = OpSpecConstant %ulong 10\n" - "%2 = OpSpecConstant %ulong 11\n", - // default values - SpecIdToValueStrMap{{100, "18446744073709551614"}, {101, "0x100"}}, - // expected - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "%ulong = OpTypeInt 64 0\n" - "%1 = OpSpecConstant %ulong 18446744073709551614\n" - "%2 = OpSpecConstant %ulong 256\n", - }, - // 5. 32-bit float type. - { - // code - "OpDecorate %1 SpecId 101\n" - "OpDecorate %2 SpecId 102\n" - "%float = OpTypeFloat 32\n" - "%1 = OpSpecConstant %float 200\n" - "%2 = OpSpecConstant %float 201\n", - // default values - SpecIdToValueStrMap{{101, "-0x1.fffffep+128"}, {102, "2.5"}}, - // expected - "OpDecorate %1 SpecId 101\n" - "OpDecorate %2 SpecId 102\n" - "%float = OpTypeFloat 32\n" - "%1 = OpSpecConstant %float -0x1.fffffep+128\n" - "%2 = OpSpecConstant %float 2.5\n", - }, - // 6. 64-bit float type. - { - // code - "OpDecorate %1 SpecId 201\n" - "OpDecorate %2 SpecId 202\n" - "%double = OpTypeFloat 64\n" - "%1 = OpSpecConstant %double 3.14159265358979\n" - "%2 = OpSpecConstant %double 0.142857\n", - // default values - SpecIdToValueStrMap{{201, "0x1.fffffffffffffp+1024"}, - {202, "-32.5"}}, - // expected - "OpDecorate %1 SpecId 201\n" - "OpDecorate %2 SpecId 202\n" - "%double = OpTypeFloat 64\n" - "%1 = OpSpecConstant %double 0x1.fffffffffffffp+1024\n" - "%2 = OpSpecConstant %double -32.5\n", - }, - // 7. SpecId not found, expect no modification. - { - // code - "OpDecorate %1 SpecId 201\n" - "%double = OpTypeFloat 64\n" - "%1 = OpSpecConstant %double 3.14159265358979\n", - // default values - SpecIdToValueStrMap{{8888, "0.0"}}, - // expected - "OpDecorate %1 SpecId 201\n" - "%double = OpTypeFloat 64\n" - "%1 = OpSpecConstant %double 3.14159265358979\n", - }, - // 8. Multiple types of spec constants. - { - // code - "OpDecorate %1 SpecId 201\n" - "OpDecorate %2 SpecId 202\n" - "OpDecorate %3 SpecId 203\n" - "%bool = OpTypeBool\n" - "%int = OpTypeInt 32 1\n" - "%double = OpTypeFloat 64\n" - "%1 = OpSpecConstant %double 3.14159265358979\n" - "%2 = OpSpecConstant %int 1024\n" - "%3 = OpSpecConstantTrue %bool\n", - // default values - SpecIdToValueStrMap{ - {201, "0x1.fffffffffffffp+1024"}, {202, "2048"}, {203, "false"}, - }, - // expected - "OpDecorate %1 SpecId 201\n" - "OpDecorate %2 SpecId 202\n" - "OpDecorate %3 SpecId 203\n" - "%bool = OpTypeBool\n" - "%int = OpTypeInt 32 1\n" - "%double = OpTypeFloat 64\n" - "%1 = OpSpecConstant %double 0x1.fffffffffffffp+1024\n" - "%2 = OpSpecConstant %int 2048\n" - "%3 = OpSpecConstantFalse %bool\n", - }, - // 9. Ignore other decorations. - { - // code - "OpDecorate %1 ArrayStride 4\n" - "%int = OpTypeInt 32 1\n" - "%1 = OpSpecConstant %int 100\n", - // default values - SpecIdToValueStrMap{{4, "0x7fffffff"}}, - // expected - "OpDecorate %1 ArrayStride 4\n" - "%int = OpTypeInt 32 1\n" - "%1 = OpSpecConstant %int 100\n", - }, - // 10. Distinguish from other decorations. - { - // code - "OpDecorate %1 SpecId 100\n" - "OpDecorate %1 ArrayStride 4\n" - "%int = OpTypeInt 32 1\n" - "%1 = OpSpecConstant %int 100\n", - // default values - SpecIdToValueStrMap{{4, "0x7fffffff"}, {100, "0xffffffff"}}, - // expected - "OpDecorate %1 SpecId 100\n" - "OpDecorate %1 ArrayStride 4\n" - "%int = OpTypeInt 32 1\n" - "%1 = OpSpecConstant %int -1\n", - }, - // 11. Decorate through decoration group. - { - // code - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int 100\n", - // default values - SpecIdToValueStrMap{{100, "0x7fffffff"}}, - // expected - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int 2147483647\n", - }, - // 12. Ignore other decorations in decoration group. - { - // code - "OpDecorate %1 ArrayStride 4\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int 100\n", - // default values - SpecIdToValueStrMap{{4, "0x7fffffff"}}, - // expected - "OpDecorate %1 ArrayStride 4\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int 100\n", - }, - // 13. Distinguish from other decorations in decoration group. - { - // code - "OpDecorate %1 SpecId 100\n" - "OpDecorate %1 ArrayStride 4\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int 100\n", - // default values - SpecIdToValueStrMap{{100, "0x7fffffff"}, {4, "0x00000001"}}, - // expected - "OpDecorate %1 SpecId 100\n" - "OpDecorate %1 ArrayStride 4\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int 2147483647\n", - }, - // 14. Unchanged bool default value - { - // code - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "%bool = OpTypeBool\n" - "%1 = OpSpecConstantTrue %bool\n" - "%2 = OpSpecConstantFalse %bool\n", - // default values - SpecIdToValueStrMap{{100, "true"}, {101, "false"}}, - // expected - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "%bool = OpTypeBool\n" - "%1 = OpSpecConstantTrue %bool\n" - "%2 = OpSpecConstantFalse %bool\n", - }, - // 15. Unchanged int default values - { - // code - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "%int = OpTypeInt 32 1\n" - "%ulong = OpTypeInt 64 0\n" - "%1 = OpSpecConstant %int 10\n" - "%2 = OpSpecConstant %ulong 11\n", - // default values - SpecIdToValueStrMap{{100, "10"}, {101, "11"}}, - // expected - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "%int = OpTypeInt 32 1\n" - "%ulong = OpTypeInt 64 0\n" - "%1 = OpSpecConstant %int 10\n" - "%2 = OpSpecConstant %ulong 11\n", - }, - // 16. Unchanged float default values - { - // code - "OpDecorate %1 SpecId 201\n" - "OpDecorate %2 SpecId 202\n" - "%float = OpTypeFloat 32\n" - "%double = OpTypeFloat 64\n" - "%1 = OpSpecConstant %float 3.14159\n" - "%2 = OpSpecConstant %double 0.142857\n", - // default values - SpecIdToValueStrMap{{201, "3.14159"}, {202, "0.142857"}}, - // expected - "OpDecorate %1 SpecId 201\n" - "OpDecorate %2 SpecId 202\n" - "%float = OpTypeFloat 32\n" - "%double = OpTypeFloat 64\n" - "%1 = OpSpecConstant %float 3.14159\n" - "%2 = OpSpecConstant %double 0.142857\n", - }, - // 17. OpGroupDecorate may have multiple target ids defined by the same - // eligible spec constant - { - // code - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2 %2 %2\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int 100\n", - // default values - SpecIdToValueStrMap{{100, "0xffffffff"}}, - // expected - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2 %2 %2\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int -1\n", - }, - })); - -INSTANTIATE_TEST_CASE_P( - InvalidCases, SetSpecConstantDefaultValueInStringFormParamTest, - ::testing::ValuesIn(std::vector< - SetSpecConstantDefaultValueInStringFormTestCase>{ - // 0. Do not crash when decoration group is not used. - { - // code - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "%int = OpTypeInt 32 1\n" - "%3 = OpSpecConstant %int 100\n", - // default values - SpecIdToValueStrMap{{100, "0x7fffffff"}}, - // expected - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "%int = OpTypeInt 32 1\n" - "%3 = OpSpecConstant %int 100\n", - }, - // 1. Do not crash when target does not exist. - { - // code - "OpDecorate %1 SpecId 100\n" - "%int = OpTypeInt 32 1\n", - // default values - SpecIdToValueStrMap{{100, "0x7fffffff"}}, - // expected - "OpDecorate %1 SpecId 100\n" - "%int = OpTypeInt 32 1\n", - }, - // 2. Do nothing when SpecId decoration is not attached to a - // non-spec-constant instruction. - { - // code - "OpDecorate %1 SpecId 100\n" - "%int = OpTypeInt 32 1\n" - "%int_101 = OpConstant %int 101\n", - // default values - SpecIdToValueStrMap{{100, "0x7fffffff"}}, - // expected - "OpDecorate %1 SpecId 100\n" - "%int = OpTypeInt 32 1\n" - "%int_101 = OpConstant %int 101\n", - }, - // 3. Do nothing when SpecId decoration is not attached to a - // OpSpecConstant{|True|False} instruction. - { - // code - "OpDecorate %1 SpecId 100\n" - "%int = OpTypeInt 32 1\n" - "%3 = OpSpecConstant %int 101\n" - "%1 = OpSpecConstantOp %int IAdd %3 %3\n", - // default values - SpecIdToValueStrMap{{100, "0x7fffffff"}}, - // expected - "OpDecorate %1 SpecId 100\n" - "%int = OpTypeInt 32 1\n" - "%3 = OpSpecConstant %int 101\n" - "%1 = OpSpecConstantOp %int IAdd %3 %3\n", - }, - // 4. Do not crash and do nothing when SpecId decoration is applied to - // multiple spec constants. - { - // code - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2 %3 %4\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int 100\n" - "%3 = OpSpecConstant %int 200\n" - "%4 = OpSpecConstant %int 300\n", - // default values - SpecIdToValueStrMap{{100, "0xffffffff"}}, - // expected - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2 %3 %4\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int 100\n" - "%3 = OpSpecConstant %int 200\n" - "%4 = OpSpecConstant %int 300\n", - }, - // 5. Do not crash and do nothing when SpecId decoration is attached to - // non-spec-constants (invalid case). - { - // code - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2\n" - "%int = OpTypeInt 32 1\n" - "%int_100 = OpConstant %int 100\n", - // default values - SpecIdToValueStrMap{{100, "0xffffffff"}}, - // expected - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2\n" - "%int = OpTypeInt 32 1\n" - "%int_100 = OpConstant %int 100\n", - }, - // 6. Boolean type spec constant cannot be set with numeric values in - // string form. i.e. only 'true' and 'false' are acceptable for setting - // boolean type spec constants. Nothing should be done if numeric values - // in string form are provided. - { - // code - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "OpDecorate %3 SpecId 102\n" - "OpDecorate %4 SpecId 103\n" - "OpDecorate %5 SpecId 104\n" - "OpDecorate %6 SpecId 105\n" - "%bool = OpTypeBool\n" - "%1 = OpSpecConstantTrue %bool\n" - "%2 = OpSpecConstantFalse %bool\n" - "%3 = OpSpecConstantTrue %bool\n" - "%4 = OpSpecConstantTrue %bool\n" - "%5 = OpSpecConstantTrue %bool\n" - "%6 = OpSpecConstantFalse %bool\n", - // default values - SpecIdToValueStrMap{{100, "0"}, - {101, "1"}, - {102, "0x0"}, - {103, "0.0"}, - {104, "-0.0"}, - {105, "0x12345678"}}, - // expected - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "OpDecorate %3 SpecId 102\n" - "OpDecorate %4 SpecId 103\n" - "OpDecorate %5 SpecId 104\n" - "OpDecorate %6 SpecId 105\n" - "%bool = OpTypeBool\n" - "%1 = OpSpecConstantTrue %bool\n" - "%2 = OpSpecConstantFalse %bool\n" - "%3 = OpSpecConstantTrue %bool\n" - "%4 = OpSpecConstantTrue %bool\n" - "%5 = OpSpecConstantTrue %bool\n" - "%6 = OpSpecConstantFalse %bool\n", - }, - })); - -struct SetSpecConstantDefaultValueInBitPatternFormTestCase { - const char* code; - SpecIdToValueBitPatternMap default_values; - const char* expected; -}; - -using SetSpecConstantDefaultValueInBitPatternFormParamTest = - PassTest<::testing::TestWithParam< - SetSpecConstantDefaultValueInBitPatternFormTestCase>>; - -TEST_P(SetSpecConstantDefaultValueInBitPatternFormParamTest, TestCase) { - const auto& tc = GetParam(); - SinglePassRunAndCheck( - tc.code, tc.expected, /* skip_nop = */ false, tc.default_values); -} - -INSTANTIATE_TEST_CASE_P( - ValidCases, SetSpecConstantDefaultValueInBitPatternFormParamTest, - ::testing::ValuesIn(std::vector< - SetSpecConstantDefaultValueInBitPatternFormTestCase>{ - // 0. Empty. - {"", SpecIdToValueBitPatternMap{}, ""}, - // 1. Empty with non-empty values to set. - {"", SpecIdToValueBitPatternMap{{1, {100}}, {2, {200}}}, ""}, - // 2. Baisc bool type. - { - // code - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "%bool = OpTypeBool\n" - "%1 = OpSpecConstantTrue %bool\n" - "%2 = OpSpecConstantFalse %bool\n", - // default values - SpecIdToValueBitPatternMap{{100, {0x0}}, {101, {0x1}}}, - // expected - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "%bool = OpTypeBool\n" - "%1 = OpSpecConstantFalse %bool\n" - "%2 = OpSpecConstantTrue %bool\n", - }, - // 3. 32-bit int type. - { - // code - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "OpDecorate %3 SpecId 102\n" - "%int = OpTypeInt 32 1\n" - "%1 = OpSpecConstant %int 10\n" - "%2 = OpSpecConstant %int 11\n" - "%3 = OpSpecConstant %int 11\n", - // default values - SpecIdToValueBitPatternMap{ - {100, {2147483647}}, {101, {0xffffffff}}, {102, {0xffffffd6}}}, - // expected - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "OpDecorate %3 SpecId 102\n" - "%int = OpTypeInt 32 1\n" - "%1 = OpSpecConstant %int 2147483647\n" - "%2 = OpSpecConstant %int -1\n" - "%3 = OpSpecConstant %int -42\n", - }, - // 4. 64-bit uint type. - { - // code - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "%ulong = OpTypeInt 64 0\n" - "%1 = OpSpecConstant %ulong 10\n" - "%2 = OpSpecConstant %ulong 11\n", - // default values - SpecIdToValueBitPatternMap{{100, {0xFFFFFFFE, 0xFFFFFFFF}}, - {101, {0x100, 0x0}}}, - // expected - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "%ulong = OpTypeInt 64 0\n" - "%1 = OpSpecConstant %ulong 18446744073709551614\n" - "%2 = OpSpecConstant %ulong 256\n", - }, - // 5. 32-bit float type. - { - // code - "OpDecorate %1 SpecId 101\n" - "OpDecorate %2 SpecId 102\n" - "%float = OpTypeFloat 32\n" - "%1 = OpSpecConstant %float 200\n" - "%2 = OpSpecConstant %float 201\n", - // default values - SpecIdToValueBitPatternMap{{101, {0xffffffff}}, - {102, {0x40200000}}}, - // expected - "OpDecorate %1 SpecId 101\n" - "OpDecorate %2 SpecId 102\n" - "%float = OpTypeFloat 32\n" - "%1 = OpSpecConstant %float -0x1.fffffep+128\n" - "%2 = OpSpecConstant %float 2.5\n", - }, - // 6. 64-bit float type. - { - // code - "OpDecorate %1 SpecId 201\n" - "OpDecorate %2 SpecId 202\n" - "%double = OpTypeFloat 64\n" - "%1 = OpSpecConstant %double 3.14159265358979\n" - "%2 = OpSpecConstant %double 0.142857\n", - // default values - SpecIdToValueBitPatternMap{{201, {0xffffffff, 0x7fffffff}}, - {202, {0x00000000, 0xc0404000}}}, - // expected - "OpDecorate %1 SpecId 201\n" - "OpDecorate %2 SpecId 202\n" - "%double = OpTypeFloat 64\n" - "%1 = OpSpecConstant %double 0x1.fffffffffffffp+1024\n" - "%2 = OpSpecConstant %double -32.5\n", - }, - // 7. SpecId not found, expect no modification. - { - // code - "OpDecorate %1 SpecId 201\n" - "%double = OpTypeFloat 64\n" - "%1 = OpSpecConstant %double 3.14159265358979\n", - // default values - SpecIdToValueBitPatternMap{{8888, {0x0}}}, - // expected - "OpDecorate %1 SpecId 201\n" - "%double = OpTypeFloat 64\n" - "%1 = OpSpecConstant %double 3.14159265358979\n", - }, - // 8. Multiple types of spec constants. - { - // code - "OpDecorate %1 SpecId 201\n" - "OpDecorate %2 SpecId 202\n" - "OpDecorate %3 SpecId 203\n" - "%bool = OpTypeBool\n" - "%int = OpTypeInt 32 1\n" - "%double = OpTypeFloat 64\n" - "%1 = OpSpecConstant %double 3.14159265358979\n" - "%2 = OpSpecConstant %int 1024\n" - "%3 = OpSpecConstantTrue %bool\n", - // default values - SpecIdToValueBitPatternMap{ - {201, {0xffffffff, 0x7fffffff}}, - {202, {0x00000800}}, - {203, {0x0}}, - }, - // expected - "OpDecorate %1 SpecId 201\n" - "OpDecorate %2 SpecId 202\n" - "OpDecorate %3 SpecId 203\n" - "%bool = OpTypeBool\n" - "%int = OpTypeInt 32 1\n" - "%double = OpTypeFloat 64\n" - "%1 = OpSpecConstant %double 0x1.fffffffffffffp+1024\n" - "%2 = OpSpecConstant %int 2048\n" - "%3 = OpSpecConstantFalse %bool\n", - }, - // 9. Ignore other decorations. - { - // code - "OpDecorate %1 ArrayStride 4\n" - "%int = OpTypeInt 32 1\n" - "%1 = OpSpecConstant %int 100\n", - // default values - SpecIdToValueBitPatternMap{{4, {0x7fffffff}}}, - // expected - "OpDecorate %1 ArrayStride 4\n" - "%int = OpTypeInt 32 1\n" - "%1 = OpSpecConstant %int 100\n", - }, - // 10. Distinguish from other decorations. - { - // code - "OpDecorate %1 SpecId 100\n" - "OpDecorate %1 ArrayStride 4\n" - "%int = OpTypeInt 32 1\n" - "%1 = OpSpecConstant %int 100\n", - // default values - SpecIdToValueBitPatternMap{{4, {0x7fffffff}}, {100, {0xffffffff}}}, - // expected - "OpDecorate %1 SpecId 100\n" - "OpDecorate %1 ArrayStride 4\n" - "%int = OpTypeInt 32 1\n" - "%1 = OpSpecConstant %int -1\n", - }, - // 11. Decorate through decoration group. - { - // code - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int 100\n", - // default values - SpecIdToValueBitPatternMap{{100, {0x7fffffff}}}, - // expected - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int 2147483647\n", - }, - // 12. Ignore other decorations in decoration group. - { - // code - "OpDecorate %1 ArrayStride 4\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int 100\n", - // default values - SpecIdToValueBitPatternMap{{4, {0x7fffffff}}}, - // expected - "OpDecorate %1 ArrayStride 4\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int 100\n", - }, - // 13. Distinguish from other decorations in decoration group. - { - // code - "OpDecorate %1 SpecId 100\n" - "OpDecorate %1 ArrayStride 4\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int 100\n", - // default values - SpecIdToValueBitPatternMap{{100, {0x7fffffff}}, {4, {0x00000001}}}, - // expected - "OpDecorate %1 SpecId 100\n" - "OpDecorate %1 ArrayStride 4\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int 2147483647\n", - }, - // 14. Unchanged bool default value - { - // code - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "%bool = OpTypeBool\n" - "%1 = OpSpecConstantTrue %bool\n" - "%2 = OpSpecConstantFalse %bool\n", - // default values - SpecIdToValueBitPatternMap{{100, {0x1}}, {101, {0x0}}}, - // expected - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "%bool = OpTypeBool\n" - "%1 = OpSpecConstantTrue %bool\n" - "%2 = OpSpecConstantFalse %bool\n", - }, - // 15. Unchanged int default values - { - // code - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "%int = OpTypeInt 32 1\n" - "%ulong = OpTypeInt 64 0\n" - "%1 = OpSpecConstant %int 10\n" - "%2 = OpSpecConstant %ulong 11\n", - // default values - SpecIdToValueBitPatternMap{{100, {10}}, {101, {11, 0}}}, - // expected - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "%int = OpTypeInt 32 1\n" - "%ulong = OpTypeInt 64 0\n" - "%1 = OpSpecConstant %int 10\n" - "%2 = OpSpecConstant %ulong 11\n", - }, - // 16. Unchanged float default values - { - // code - "OpDecorate %1 SpecId 201\n" - "OpDecorate %2 SpecId 202\n" - "%float = OpTypeFloat 32\n" - "%double = OpTypeFloat 64\n" - "%1 = OpSpecConstant %float 3.25\n" - "%2 = OpSpecConstant %double 1.25\n", - // default values - SpecIdToValueBitPatternMap{{201, {0x40500000}}, - {202, {0x00000000, 0x3ff40000}}}, - // expected - "OpDecorate %1 SpecId 201\n" - "OpDecorate %2 SpecId 202\n" - "%float = OpTypeFloat 32\n" - "%double = OpTypeFloat 64\n" - "%1 = OpSpecConstant %float 3.25\n" - "%2 = OpSpecConstant %double 1.25\n", - }, - // 17. OpGroupDecorate may have multiple target ids defined by the same - // eligible spec constant - { - // code - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2 %2 %2\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int 100\n", - // default values - SpecIdToValueBitPatternMap{{100, {0xffffffff}}}, - // expected - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2 %2 %2\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int -1\n", - }, - // 18. For Boolean type spec constants,if any word in the bit pattern - // is not zero, it can be considered as a 'true', otherwise, it can be - // considered as a 'false'. - { - // code - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "OpDecorate %3 SpecId 102\n" - "%bool = OpTypeBool\n" - "%1 = OpSpecConstantTrue %bool\n" - "%2 = OpSpecConstantFalse %bool\n" - "%3 = OpSpecConstantFalse %bool\n", - // default values - SpecIdToValueBitPatternMap{ - {100, {0x0, 0x0, 0x0, 0x0}}, - {101, {0x10101010}}, - {102, {0x0, 0x0, 0x0, 0x2}}, - }, - // expected - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "OpDecorate %3 SpecId 102\n" - "%bool = OpTypeBool\n" - "%1 = OpSpecConstantFalse %bool\n" - "%2 = OpSpecConstantTrue %bool\n" - "%3 = OpSpecConstantTrue %bool\n", - }, - })); - -INSTANTIATE_TEST_CASE_P( - InvalidCases, SetSpecConstantDefaultValueInBitPatternFormParamTest, - ::testing::ValuesIn(std::vector< - SetSpecConstantDefaultValueInBitPatternFormTestCase>{ - // 0. Do not crash when decoration group is not used. - { - // code - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "%int = OpTypeInt 32 1\n" - "%3 = OpSpecConstant %int 100\n", - // default values - SpecIdToValueBitPatternMap{{100, {0x7fffffff}}}, - // expected - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "%int = OpTypeInt 32 1\n" - "%3 = OpSpecConstant %int 100\n", - }, - // 1. Do not crash when target does not exist. - { - // code - "OpDecorate %1 SpecId 100\n" - "%int = OpTypeInt 32 1\n", - // default values - SpecIdToValueBitPatternMap{{100, {0x7fffffff}}}, - // expected - "OpDecorate %1 SpecId 100\n" - "%int = OpTypeInt 32 1\n", - }, - // 2. Do nothing when SpecId decoration is not attached to a - // non-spec-constant instruction. - { - // code - "OpDecorate %1 SpecId 100\n" - "%int = OpTypeInt 32 1\n" - "%int_101 = OpConstant %int 101\n", - // default values - SpecIdToValueBitPatternMap{{100, {0x7fffffff}}}, - // expected - "OpDecorate %1 SpecId 100\n" - "%int = OpTypeInt 32 1\n" - "%int_101 = OpConstant %int 101\n", - }, - // 3. Do nothing when SpecId decoration is not attached to a - // OpSpecConstant{|True|False} instruction. - { - // code - "OpDecorate %1 SpecId 100\n" - "%int = OpTypeInt 32 1\n" - "%3 = OpSpecConstant %int 101\n" - "%1 = OpSpecConstantOp %int IAdd %3 %3\n", - // default values - SpecIdToValueBitPatternMap{{100, {0x7fffffff}}}, - // expected - "OpDecorate %1 SpecId 100\n" - "%int = OpTypeInt 32 1\n" - "%3 = OpSpecConstant %int 101\n" - "%1 = OpSpecConstantOp %int IAdd %3 %3\n", - }, - // 4. Do not crash and do nothing when SpecId decoration is applied to - // multiple spec constants. - { - // code - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2 %3 %4\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int 100\n" - "%3 = OpSpecConstant %int 200\n" - "%4 = OpSpecConstant %int 300\n", - // default values - SpecIdToValueBitPatternMap{{100, {0xffffffff}}}, - // expected - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2 %3 %4\n" - "%int = OpTypeInt 32 1\n" - "%2 = OpSpecConstant %int 100\n" - "%3 = OpSpecConstant %int 200\n" - "%4 = OpSpecConstant %int 300\n", - }, - // 5. Do not crash and do nothing when SpecId decoration is attached to - // non-spec-constants (invalid case). - { - // code - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2\n" - "%int = OpTypeInt 32 1\n" - "%int_100 = OpConstant %int 100\n", - // default values - SpecIdToValueBitPatternMap{{100, {0xffffffff}}}, - // expected - "OpDecorate %1 SpecId 100\n" - "%1 = OpDecorationGroup\n" - "OpGroupDecorate %1 %2\n" - "%int = OpTypeInt 32 1\n" - "%int_100 = OpConstant %int 100\n", - }, - // 6. Incompatible input bit pattern with the type. Nothing should be - // done in such a case. - { - // code - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "OpDecorate %3 SpecId 102\n" - "%int = OpTypeInt 32 1\n" - "%ulong = OpTypeInt 64 0\n" - "%double = OpTypeFloat 64\n" - "%1 = OpSpecConstant %int 100\n" - "%2 = OpSpecConstant %ulong 200\n" - "%3 = OpSpecConstant %double 3.1415926\n", - // default values - SpecIdToValueBitPatternMap{ - {100, {10, 0}}, {101, {11}}, {102, {0xffffffff}}}, - // expected - "OpDecorate %1 SpecId 100\n" - "OpDecorate %2 SpecId 101\n" - "OpDecorate %3 SpecId 102\n" - "%int = OpTypeInt 32 1\n" - "%ulong = OpTypeInt 64 0\n" - "%double = OpTypeFloat 64\n" - "%1 = OpSpecConstant %int 100\n" - "%2 = OpSpecConstant %ulong 200\n" - "%3 = OpSpecConstant %double 3.1415926\n", - }, - })); - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/strength_reduction_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/strength_reduction_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/strength_reduction_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/strength_reduction_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,427 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include "assembly_builder.h" -#include "gmock/gmock.h" -#include "pass_fixture.h" -#include "pass_utils.h" - -#include -#include -#include -#include -#include - -namespace { - -using namespace spvtools; - -using ::testing::HasSubstr; -using ::testing::MatchesRegex; - -using StrengthReductionBasicTest = PassTest<::testing::Test>; - -// Test to make sure we replace 5*8. -TEST_F(StrengthReductionBasicTest, BasicReplaceMulBy8) { - const std::vector text = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %main \"main\"", - "OpName %main \"main\"", - "%void = OpTypeVoid", - "%4 = OpTypeFunction %void", - "%uint = OpTypeInt 32 0", - "%uint_5 = OpConstant %uint 5", - "%uint_8 = OpConstant %uint 8", - "%main = OpFunction %void None %4", - "%8 = OpLabel", - "%9 = OpIMul %uint %uint_5 %uint_8", - "OpReturn", - "OpFunctionEnd" - // clang-format on - }; - - auto result = SinglePassRunAndDisassemble( - JoinAllInsts(text), /* skip_nop = */ true); - - EXPECT_EQ(opt::Pass::Status::SuccessWithChange, std::get<1>(result)); - const std::string& output = std::get<0>(result); - EXPECT_THAT(output, Not(HasSubstr("OpIMul"))); - EXPECT_THAT(output, HasSubstr("OpShiftLeftLogical %uint %uint_5 %uint_3")); -} - -// Test to make sure we replace 16*5. -TEST_F(StrengthReductionBasicTest, BasicReplaceMulBy16) { - const std::vector text = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %main \"main\"", - "OpName %main \"main\"", - "%void = OpTypeVoid", - "%4 = OpTypeFunction %void", - "%int = OpTypeInt 32 1", - "%int_16 = OpConstant %int 16", - "%int_5 = OpConstant %int 5", - "%main = OpFunction %void None %4", - "%8 = OpLabel", - "%9 = OpIMul %int %int_16 %int_5", - "OpReturn", - "OpFunctionEnd" - // clang-format on - }; - - auto result = SinglePassRunAndDisassemble( - JoinAllInsts(text), /* skip_nop = */ true); - - EXPECT_EQ(opt::Pass::Status::SuccessWithChange, std::get<1>(result)); - const std::string& output = std::get<0>(result); - EXPECT_THAT(output, Not(HasSubstr("OpIMul"))); - EXPECT_THAT(output, HasSubstr("OpShiftLeftLogical %int %int_5 %uint_4")); -} - -// Test to make sure we replace a multiple of 32 and 4. -TEST_F(StrengthReductionBasicTest, BasicTwoPowersOf2) { - // In this case, we have two powers of 2. Need to make sure we replace only - // one of them for the bit shift. - // clang-format off - const std::string text = R"( - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %main "main" - OpName %main "main" - %void = OpTypeVoid - %4 = OpTypeFunction %void - %int = OpTypeInt 32 1 -%int_32 = OpConstant %int 32 - %int_4 = OpConstant %int 4 - %main = OpFunction %void None %4 - %8 = OpLabel - %9 = OpIMul %int %int_32 %int_4 - OpReturn - OpFunctionEnd -)"; - // clang-format on - auto result = SinglePassRunAndDisassemble( - text, /* skip_nop = */ true); - - EXPECT_EQ(opt::Pass::Status::SuccessWithChange, std::get<1>(result)); - const std::string& output = std::get<0>(result); - EXPECT_THAT(output, Not(HasSubstr("OpIMul"))); - EXPECT_THAT(output, HasSubstr("OpShiftLeftLogical %int %int_4 %uint_5")); -} - -// Test to make sure we don't replace 0*5. -TEST_F(StrengthReductionBasicTest, BasicDontReplace0) { - const std::vector text = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %main \"main\"", - "OpName %main \"main\"", - "%void = OpTypeVoid", - "%4 = OpTypeFunction %void", - "%int = OpTypeInt 32 1", - "%int_0 = OpConstant %int 0", - "%int_5 = OpConstant %int 5", - "%main = OpFunction %void None %4", - "%8 = OpLabel", - "%9 = OpIMul %int %int_0 %int_5", - "OpReturn", - "OpFunctionEnd" - // clang-format on - }; - - auto result = SinglePassRunAndDisassemble( - JoinAllInsts(text), /* skip_nop = */ true); - - EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); -} - -// Test to make sure we do not replace a multiple of 5 and 7. -TEST_F(StrengthReductionBasicTest, BasicNoChange) { - const std::vector text = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %2 \"main\"", - "OpName %2 \"main\"", - "%3 = OpTypeVoid", - "%4 = OpTypeFunction %3", - "%5 = OpTypeInt 32 1", - "%6 = OpTypeInt 32 0", - "%7 = OpConstant %5 5", - "%8 = OpConstant %5 7", - "%2 = OpFunction %3 None %4", - "%9 = OpLabel", - "%10 = OpIMul %5 %7 %8", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - - auto result = SinglePassRunAndDisassemble( - JoinAllInsts(text), /* skip_nop = */ true); - - EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result)); -} - -// Test to make sure constants and types are reused and not duplicated. -TEST_F(StrengthReductionBasicTest, NoDuplicateConstantsAndTypes) { - const std::vector text = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %main \"main\"", - "OpName %main \"main\"", - "%void = OpTypeVoid", - "%4 = OpTypeFunction %void", - "%uint = OpTypeInt 32 0", - "%uint_8 = OpConstant %uint 8", - "%uint_3 = OpConstant %uint 3", - "%main = OpFunction %void None %4", - "%8 = OpLabel", - "%9 = OpIMul %uint %uint_8 %uint_3", - "OpReturn", - "OpFunctionEnd", - // clang-format on - }; - - auto result = SinglePassRunAndDisassemble( - JoinAllInsts(text), /* skip_nop = */ true); - - EXPECT_EQ(opt::Pass::Status::SuccessWithChange, std::get<1>(result)); - const std::string& output = std::get<0>(result); - EXPECT_THAT(output, - Not(MatchesRegex(".*OpConstant %uint 3.*OpConstant %uint 3.*"))); - EXPECT_THAT(output, Not(MatchesRegex(".*OpTypeInt 32 0.*OpTypeInt 32 0.*"))); -} - -// Test to make sure we generate the constants only once -TEST_F(StrengthReductionBasicTest, BasicCreateOneConst) { - const std::vector text = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %main \"main\"", - "OpName %main \"main\"", - "%void = OpTypeVoid", - "%4 = OpTypeFunction %void", - "%uint = OpTypeInt 32 0", - "%uint_5 = OpConstant %uint 5", - "%uint_9 = OpConstant %uint 9", - "%uint_128 = OpConstant %uint 128", - "%main = OpFunction %void None %4", - "%8 = OpLabel", - "%9 = OpIMul %uint %uint_5 %uint_128", - "%10 = OpIMul %uint %uint_9 %uint_128", - "OpReturn", - "OpFunctionEnd" - // clang-format on - }; - - auto result = SinglePassRunAndDisassemble( - JoinAllInsts(text), /* skip_nop = */ true); - - EXPECT_EQ(opt::Pass::Status::SuccessWithChange, std::get<1>(result)); - const std::string& output = std::get<0>(result); - EXPECT_THAT(output, Not(HasSubstr("OpIMul"))); - EXPECT_THAT(output, HasSubstr("OpShiftLeftLogical %uint %uint_5 %uint_7")); - EXPECT_THAT(output, HasSubstr("OpShiftLeftLogical %uint %uint_9 %uint_7")); -} - -// Test to make sure we generate the instructions in the correct position and -// that the uses get replaced as well. Here we check that the use in the return -// is replaced, we also check that we can replace two OpIMuls when one feeds the -// other. -TEST_F(StrengthReductionBasicTest, BasicCheckPositionAndReplacement) { - // This is just the preamble to set up the test. - const std::vector common_text = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Fragment %main \"main\" %gl_FragColor", - "OpExecutionMode %main OriginUpperLeft", - "OpName %main \"main\"", - "OpName %foo_i1_ \"foo(i1;\"", - "OpName %n \"n\"", - "OpName %gl_FragColor \"gl_FragColor\"", - "OpName %param \"param\"", - "OpDecorate %gl_FragColor Location 0", - "%void = OpTypeVoid", - "%3 = OpTypeFunction %void", - "%int = OpTypeInt 32 1", -"%_ptr_Function_int = OpTypePointer Function %int", - "%8 = OpTypeFunction %int %_ptr_Function_int", - "%int_256 = OpConstant %int 256", - "%int_2 = OpConstant %int 2", - "%float = OpTypeFloat 32", - "%v4float = OpTypeVector %float 4", -"%_ptr_Output_v4float = OpTypePointer Output %v4float", -"%gl_FragColor = OpVariable %_ptr_Output_v4float Output", - "%float_1 = OpConstant %float 1", - "%int_10 = OpConstant %int 10", - "%float_0_4 = OpConstant %float 0.4", - "%float_0_8 = OpConstant %float 0.8", - "%uint = OpTypeInt 32 0", - "%uint_8 = OpConstant %uint 8", - "%uint_1 = OpConstant %uint 1", - "%main = OpFunction %void None %3", - "%5 = OpLabel", - "%param = OpVariable %_ptr_Function_int Function", - "OpStore %param %int_10", - "%26 = OpFunctionCall %int %foo_i1_ %param", - "%27 = OpConvertSToF %float %26", - "%28 = OpFDiv %float %float_1 %27", - "%31 = OpCompositeConstruct %v4float %28 %float_0_4 %float_0_8 %float_1", - "OpStore %gl_FragColor %31", - "OpReturn", - "OpFunctionEnd" - // clang-format on - }; - - // This is the real test. The two OpIMul should be replaced. The expected - // output is in |foo_after|. - const std::vector foo_before = { - // clang-format off - "%foo_i1_ = OpFunction %int None %8", - "%n = OpFunctionParameter %_ptr_Function_int", - "%11 = OpLabel", - "%12 = OpLoad %int %n", - "%14 = OpIMul %int %12 %int_256", - "%16 = OpIMul %int %14 %int_2", - "OpReturnValue %16", - "OpFunctionEnd", - - // clang-format on - }; - - const std::vector foo_after = { - // clang-format off - "%foo_i1_ = OpFunction %int None %8", - "%n = OpFunctionParameter %_ptr_Function_int", - "%11 = OpLabel", - "%12 = OpLoad %int %n", - "%33 = OpShiftLeftLogical %int %12 %uint_8", - "%34 = OpShiftLeftLogical %int %33 %uint_1", - "OpReturnValue %34", - "OpFunctionEnd", - // clang-format on - }; - - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - SinglePassRunAndCheck( - JoinAllInsts(Concat(common_text, foo_before)), - JoinAllInsts(Concat(common_text, foo_after)), - /* skip_nop = */ true, /* do_validate = */ true); -} - -// Test that, when the result of an OpIMul instruction has more than 1 use, and -// the instruction is replaced, all of the uses of the results are replace with -// the new result. -TEST_F(StrengthReductionBasicTest, BasicTestMultipleReplacements) { - // This is just the preamble to set up the test. - const std::vector common_text = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Fragment %main \"main\" %gl_FragColor", - "OpExecutionMode %main OriginUpperLeft", - "OpName %main \"main\"", - "OpName %foo_i1_ \"foo(i1;\"", - "OpName %n \"n\"", - "OpName %gl_FragColor \"gl_FragColor\"", - "OpName %param \"param\"", - "OpDecorate %gl_FragColor Location 0", - "%void = OpTypeVoid", - "%3 = OpTypeFunction %void", - "%int = OpTypeInt 32 1", -"%_ptr_Function_int = OpTypePointer Function %int", - "%8 = OpTypeFunction %int %_ptr_Function_int", - "%int_256 = OpConstant %int 256", - "%int_2 = OpConstant %int 2", - "%float = OpTypeFloat 32", - "%v4float = OpTypeVector %float 4", -"%_ptr_Output_v4float = OpTypePointer Output %v4float", -"%gl_FragColor = OpVariable %_ptr_Output_v4float Output", - "%float_1 = OpConstant %float 1", - "%int_10 = OpConstant %int 10", - "%float_0_4 = OpConstant %float 0.4", - "%float_0_8 = OpConstant %float 0.8", - "%uint = OpTypeInt 32 0", - "%uint_8 = OpConstant %uint 8", - "%uint_1 = OpConstant %uint 1", - "%main = OpFunction %void None %3", - "%5 = OpLabel", - "%param = OpVariable %_ptr_Function_int Function", - "OpStore %param %int_10", - "%26 = OpFunctionCall %int %foo_i1_ %param", - "%27 = OpConvertSToF %float %26", - "%28 = OpFDiv %float %float_1 %27", - "%31 = OpCompositeConstruct %v4float %28 %float_0_4 %float_0_8 %float_1", - "OpStore %gl_FragColor %31", - "OpReturn", - "OpFunctionEnd" - // clang-format on - }; - - // This is the real test. The two OpIMul instructions should be replaced. In - // particular, we want to be sure that both uses of %16 are changed to use the - // new result. - const std::vector foo_before = { - // clang-format off - "%foo_i1_ = OpFunction %int None %8", - "%n = OpFunctionParameter %_ptr_Function_int", - "%11 = OpLabel", - "%12 = OpLoad %int %n", - "%14 = OpIMul %int %12 %int_256", - "%16 = OpIMul %int %14 %int_2", - "%17 = OpIAdd %int %14 %16", - "OpReturnValue %17", - "OpFunctionEnd", - - // clang-format on - }; - - const std::vector foo_after = { - // clang-format off - "%foo_i1_ = OpFunction %int None %8", - "%n = OpFunctionParameter %_ptr_Function_int", - "%11 = OpLabel", - "%12 = OpLoad %int %n", - "%34 = OpShiftLeftLogical %int %12 %uint_8", - "%35 = OpShiftLeftLogical %int %34 %uint_1", - "%17 = OpIAdd %int %34 %35", - "OpReturnValue %17", - "OpFunctionEnd", - // clang-format on - }; - - SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); - SinglePassRunAndCheck( - JoinAllInsts(Concat(common_text, foo_before)), - JoinAllInsts(Concat(common_text, foo_after)), - /* skip_nop = */ true, /* do_validate = */ true); -} -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/strip_debug_info_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/strip_debug_info_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/strip_debug_info_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/strip_debug_info_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,101 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { - -using namespace spvtools; - -using StripLineDebugInfoTest = PassTest<::testing::Test>; - -TEST_F(StripLineDebugInfoTest, LineNoLine) { - std::vector text = { - // clang-format off - "OpCapability Shader", - "%1 = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint Vertex %2 \"main\"", - "%3 = OpString \"minimal.vert\"", - "OpModuleProcessed \"42\"", - "OpModuleProcessed \"43\"", - "OpModuleProcessed \"44\"", - "OpNoLine", - "OpLine %3 10 10", - "%void = OpTypeVoid", - "OpLine %3 100 100", - "%5 = OpTypeFunction %void", - "%2 = OpFunction %void None %5", - "OpLine %3 1 1", - "OpNoLine", - "OpLine %3 2 2", - "OpLine %3 3 3", - "%6 = OpLabel", - "OpLine %3 4 4", - "OpNoLine", - "OpReturn", - "OpLine %3 4 4", - "OpNoLine", - "OpFunctionEnd", - // clang-format on - }; - SinglePassRunAndCheck(JoinAllInsts(text), - JoinNonDebugInsts(text), - /* skip_nop = */ false); - - // Let's add more debug instruction before the "OpString" instruction. - const std::vector more_text = { - "OpSourceContinued \"I'm a happy shader! Yay! ;)\"", - "OpSourceContinued \"wahahaha\"", - "OpSource ESSL 310", - "OpSource ESSL 310", - "OpSourceContinued \"wahahaha\"", - "OpSourceContinued \"wahahaha\"", - "OpSourceExtension \"save-the-world-extension\"", - "OpName %2 \"main\"", - }; - text.insert(text.begin() + 4, more_text.cbegin(), more_text.cend()); - SinglePassRunAndCheck(JoinAllInsts(text), - JoinNonDebugInsts(text), - /* skip_nop = */ false); -} - -using StripDebugInfoTest = PassTest<::testing::TestWithParam>; - -TEST_P(StripDebugInfoTest, Kind) { - std::vector text = { - "OpCapability Shader", "OpMemoryModel Logical GLSL450", GetParam(), - }; - SinglePassRunAndCheck(JoinAllInsts(text), - JoinNonDebugInsts(text), - /* skip_nop = */ false); -} - -// Test each possible non-line debug instruction. -// clang-format off -INSTANTIATE_TEST_CASE_P( - SingleKindDebugInst, StripDebugInfoTest, - ::testing::ValuesIn(std::vector({ - "OpSourceContinued \"I'm a happy shader! Yay! ;)\"", - "OpSource ESSL 310", - "OpSourceExtension \"save-the-world-extension\"", - "OpName %main \"main\"", - "OpMemberName %struct 0 \"field\"", - "%1 = OpString \"name.vert\"", - "OpModuleProcessed \"42\"", - }))); -// clang-format on - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/type_manager_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/type_manager_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/type_manager_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/type_manager_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,277 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include -#include - -#include "opt/build_module.h" -#include "opt/instruction.h" -#include "opt/type_manager.h" - -namespace { - -using namespace spvtools; - -TEST(TypeManager, TypeStrings) { - const std::string text = R"( - OpTypeForwardPointer !20 !2 ; id for %p is 20, Uniform is 2 - OpTypeForwardPointer !10000 !1 - %void = OpTypeVoid - %bool = OpTypeBool - %u32 = OpTypeInt 32 0 - %id4 = OpConstant %u32 4 - %s32 = OpTypeInt 32 1 - %f64 = OpTypeFloat 64 - %v3u32 = OpTypeVector %u32 3 - %m3x3 = OpTypeMatrix %v3u32 3 - %img1 = OpTypeImage %s32 Cube 0 1 1 0 R32f ReadWrite - %img2 = OpTypeImage %s32 Cube 0 1 1 0 R32f - %sampler = OpTypeSampler - %si1 = OpTypeSampledImage %img1 - %si2 = OpTypeSampledImage %img2 - %a5u32 = OpTypeArray %u32 %id4 - %af64 = OpTypeRuntimeArray %f64 - %st1 = OpTypeStruct %u32 - %st2 = OpTypeStruct %f64 %s32 %v3u32 - %opaque1 = OpTypeOpaque "" - %opaque2 = OpTypeOpaque "opaque" - %p = OpTypePointer Uniform %st1 - %f = OpTypeFunction %void %u32 %u32 - %event = OpTypeEvent - %de = OpTypeDeviceEvent - %ri = OpTypeReserveId - %queue = OpTypeQueue - %pipe = OpTypePipe ReadOnly - %ps = OpTypePipeStorage - %nb = OpTypeNamedBarrier - )"; - - std::vector> type_id_strs = { - {1, "void"}, - {2, "bool"}, - {3, "uint32"}, - // Id 4 is used by the constant. - {5, "sint32"}, - {6, "float64"}, - {7, ""}, - {8, "<, 3>"}, - {9, "image(sint32, 3, 0, 1, 1, 0, 3, 2)"}, - {10, "image(sint32, 3, 0, 1, 1, 0, 3, 0)"}, - {11, "sampler"}, - {12, "sampled_image(image(sint32, 3, 0, 1, 1, 0, 3, 2))"}, - {13, "sampled_image(image(sint32, 3, 0, 1, 1, 0, 3, 0))"}, - {14, "[uint32, id(4)]"}, - {15, "[float64]"}, - {16, "{uint32}"}, - {17, "{float64, sint32, }"}, - {18, "opaque('')"}, - {19, "opaque('opaque')"}, - {20, "{uint32}*"}, - {21, "(uint32, uint32) -> void"}, - {22, "event"}, - {23, "device_event"}, - {24, "reserve_id"}, - {25, "queue"}, - {26, "pipe(0)"}, - {27, "pipe_storage"}, - {28, "named_barrier"}, - }; - - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text); - opt::analysis::TypeManager manager(nullptr, *module); - - EXPECT_EQ(type_id_strs.size(), manager.NumTypes()); - EXPECT_EQ(2u, manager.NumForwardPointers()); - - for (const auto& p : type_id_strs) { - EXPECT_EQ(p.second, manager.GetType(p.first)->str()); - EXPECT_EQ(p.first, manager.GetId(manager.GetType(p.first))); - } - EXPECT_EQ("forward_pointer({uint32}*)", manager.GetForwardPointer(0)->str()); - EXPECT_EQ("forward_pointer(10000)", manager.GetForwardPointer(1)->str()); -} - -TEST(TypeManager, DecorationOnStruct) { - const std::string text = R"( - OpDecorate %struct1 Block - OpDecorate %struct2 Block - OpDecorate %struct3 Block - OpDecorate %struct4 Block - - %u32 = OpTypeInt 32 0 ; id: 5 - %f32 = OpTypeFloat 32 ; id: 6 - %struct1 = OpTypeStruct %u32 %f32 ; base - %struct2 = OpTypeStruct %f32 %u32 ; different member order - %struct3 = OpTypeStruct %f32 ; different member list - %struct4 = OpTypeStruct %u32 %f32 ; the same - %struct7 = OpTypeStruct %f32 ; no decoration - )"; - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text); - opt::analysis::TypeManager manager(nullptr, *module); - - ASSERT_EQ(7u, manager.NumTypes()); - ASSERT_EQ(0u, manager.NumForwardPointers()); - // Make sure we get ids correct. - ASSERT_EQ("uint32", manager.GetType(5)->str()); - ASSERT_EQ("float32", manager.GetType(6)->str()); - - // Try all combinations of pairs. Expect to be the same type only when the - // same id or (1, 4). - for (const auto id1 : {1, 2, 3, 4, 7}) { - for (const auto id2 : {1, 2, 3, 4, 7}) { - if (id1 == id2 || (id1 == 1 && id2 == 4) || (id1 == 4 && id2 == 1)) { - EXPECT_TRUE(manager.GetType(id1)->IsSame(manager.GetType(id2))) - << "%struct" << id1 << " is expected to be the same as %struct" - << id2; - } else { - EXPECT_FALSE(manager.GetType(id1)->IsSame(manager.GetType(id2))) - << "%struct" << id1 << " is expected to be different with %struct" - << id2; - } - } - } -} - -TEST(TypeManager, DecorationOnMember) { - const std::string text = R"( - OpMemberDecorate %struct1 0 Offset 0 - OpMemberDecorate %struct2 0 Offset 0 - OpMemberDecorate %struct3 0 Offset 0 - OpMemberDecorate %struct4 0 Offset 0 - OpMemberDecorate %struct5 1 Offset 0 - OpMemberDecorate %struct6 0 Offset 4 - - OpDecorate %struct7 Block - OpMemberDecorate %struct7 0 Offset 0 - - %u32 = OpTypeInt 32 0 ; id: 8 - %f32 = OpTypeFloat 32 ; id: 9 - %struct1 = OpTypeStruct %u32 %f32 ; base - %struct2 = OpTypeStruct %f32 %u32 ; different member order - %struct3 = OpTypeStruct %f32 ; different member list - %struct4 = OpTypeStruct %u32 %f32 ; the same - %struct5 = OpTypeStruct %u32 %f32 ; member decorate different field - %struct6 = OpTypeStruct %u32 %f32 ; different member decoration parameter - %struct7 = OpTypeStruct %u32 %f32 ; extra decoration on the struct - %struct10 = OpTypeStruct %u32 %f32 ; no member decoration - )"; - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text); - opt::analysis::TypeManager manager(nullptr, *module); - - ASSERT_EQ(10u, manager.NumTypes()); - ASSERT_EQ(0u, manager.NumForwardPointers()); - // Make sure we get ids correct. - ASSERT_EQ("uint32", manager.GetType(8)->str()); - ASSERT_EQ("float32", manager.GetType(9)->str()); - - // Try all combinations of pairs. Expect to be the same type only when the - // same id or (1, 4). - for (const auto id1 : {1, 2, 3, 4, 5, 6, 7, 10}) { - for (const auto id2 : {1, 2, 3, 4, 5, 6, 7, 10}) { - if (id1 == id2 || (id1 == 1 && id2 == 4) || (id1 == 4 && id2 == 1)) { - EXPECT_TRUE(manager.GetType(id1)->IsSame(manager.GetType(id2))) - << "%struct" << id1 << " is expected to be the same as %struct" - << id2; - } else { - EXPECT_FALSE(manager.GetType(id1)->IsSame(manager.GetType(id2))) - << "%struct" << id1 << " is expected to be different with %struct" - << id2; - } - } - } -} - -TEST(TypeManager, DecorationEmpty) { - const std::string text = R"( - OpDecorate %struct1 Block - OpMemberDecorate %struct2 0 Offset 0 - - %u32 = OpTypeInt 32 0 ; id: 3 - %f32 = OpTypeFloat 32 ; id: 4 - %struct1 = OpTypeStruct %u32 %f32 - %struct2 = OpTypeStruct %f32 %u32 - %struct5 = OpTypeStruct %f32 - )"; - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text); - opt::analysis::TypeManager manager(nullptr, *module); - - ASSERT_EQ(5u, manager.NumTypes()); - ASSERT_EQ(0u, manager.NumForwardPointers()); - // Make sure we get ids correct. - ASSERT_EQ("uint32", manager.GetType(3)->str()); - ASSERT_EQ("float32", manager.GetType(4)->str()); - - // %struct1 with decoration on itself - EXPECT_FALSE(manager.GetType(1)->decoration_empty()); - // %struct2 with decoration on its member - EXPECT_FALSE(manager.GetType(2)->decoration_empty()); - EXPECT_TRUE(manager.GetType(3)->decoration_empty()); - EXPECT_TRUE(manager.GetType(4)->decoration_empty()); - // %struct5 has no decorations - EXPECT_TRUE(manager.GetType(5)->decoration_empty()); -} - -TEST(TypeManager, BeginEndForEmptyModule) { - const std::string text = ""; - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text); - opt::analysis::TypeManager manager(nullptr, *module); - ASSERT_EQ(0u, manager.NumTypes()); - ASSERT_EQ(0u, manager.NumForwardPointers()); - - EXPECT_EQ(manager.begin(), manager.end()); -} - -TEST(TypeManager, BeginEnd) { - const std::string text = R"( - %void1 = OpTypeVoid - %void2 = OpTypeVoid - %bool = OpTypeBool - %u32 = OpTypeInt 32 0 - %f64 = OpTypeFloat 64 - )"; - std::unique_ptr module = - BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text); - opt::analysis::TypeManager manager(nullptr, *module); - ASSERT_EQ(5u, manager.NumTypes()); - ASSERT_EQ(0u, manager.NumForwardPointers()); - - EXPECT_NE(manager.begin(), manager.end()); - for (const auto& t : manager) { - switch (t.first) { - case 1: - case 2: - EXPECT_EQ("void", t.second->str()); - break; - case 3: - EXPECT_EQ("bool", t.second->str()); - break; - case 4: - EXPECT_EQ("uint32", t.second->str()); - break; - case 5: - EXPECT_EQ("float64", t.second->str()); - break; - default: - EXPECT_TRUE(false && "unreachable"); - break; - } - } -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/types_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/types_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/types_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/types_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,261 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include -#include - -#include - -#include "opt/make_unique.h" -#include "opt/types.h" - -namespace { - -using namespace spvtools::opt::analysis; -using spvtools::MakeUnique; - -// Fixture class providing some element types. -class SameTypeTest : public ::testing::Test { - protected: - virtual void SetUp() override { - void_t_.reset(new Void()); - u32_t_.reset(new Integer(32, false)); - f64_t_.reset(new Float(64)); - v3u32_t_.reset(new Vector(u32_t_.get(), 3)); - image_t_.reset(new Image(f64_t_.get(), SpvDim2D, 1, 1, 0, 0, - SpvImageFormatR16, SpvAccessQualifierReadWrite)); - } - - // Element types to be used for constructing other types for testing. - std::unique_ptr void_t_; - std::unique_ptr u32_t_; - std::unique_ptr f64_t_; - std::unique_ptr v3u32_t_; - std::unique_ptr image_t_; -}; - -#define TestMultipleInstancesOfTheSameType(ty, ...) \ - TEST_F(SameTypeTest, MultiSame##ty) { \ - std::vector> types; \ - for (int i = 0; i < 10; ++i) types.emplace_back(new ty(__VA_ARGS__)); \ - for (size_t i = 0; i < types.size(); ++i) { \ - for (size_t j = 0; j < types.size(); ++j) { \ - EXPECT_TRUE(types[i]->IsSame(types[j].get())) \ - << "expected '" << types[i]->str() << "' is the same as '" \ - << types[j]->str() << "'"; \ - } \ - } \ - } -TestMultipleInstancesOfTheSameType(Void); -TestMultipleInstancesOfTheSameType(Bool); -TestMultipleInstancesOfTheSameType(Integer, 32, true); -TestMultipleInstancesOfTheSameType(Float, 64); -TestMultipleInstancesOfTheSameType(Vector, u32_t_.get(), 3); -TestMultipleInstancesOfTheSameType(Matrix, v3u32_t_.get(), 4); -TestMultipleInstancesOfTheSameType(Image, f64_t_.get(), SpvDimCube, 0, 0, 1, 1, - SpvImageFormatRgb10A2, - SpvAccessQualifierWriteOnly); -TestMultipleInstancesOfTheSameType(Sampler); -TestMultipleInstancesOfTheSameType(SampledImage, image_t_.get()); -TestMultipleInstancesOfTheSameType(Array, u32_t_.get(), 10); -TestMultipleInstancesOfTheSameType(RuntimeArray, u32_t_.get()); -TestMultipleInstancesOfTheSameType(Struct, std::vector{u32_t_.get(), - f64_t_.get()}); -TestMultipleInstancesOfTheSameType(Opaque, "testing rocks"); -TestMultipleInstancesOfTheSameType(Pointer, u32_t_.get(), SpvStorageClassInput); -TestMultipleInstancesOfTheSameType(Function, u32_t_.get(), - {f64_t_.get(), f64_t_.get()}); -TestMultipleInstancesOfTheSameType(Event); -TestMultipleInstancesOfTheSameType(DeviceEvent); -TestMultipleInstancesOfTheSameType(ReserveId); -TestMultipleInstancesOfTheSameType(Queue); -TestMultipleInstancesOfTheSameType(Pipe, SpvAccessQualifierReadWrite); -TestMultipleInstancesOfTheSameType(ForwardPointer, 10, SpvStorageClassUniform); -TestMultipleInstancesOfTheSameType(PipeStorage); -TestMultipleInstancesOfTheSameType(NamedBarrier); -#undef TestMultipleInstanceOfTheSameType - -TEST(Types, AllTypes) { - // Types in this test case are only equal to themselves, nothing else. - std::vector> types; - - // Forward Pointer - types.emplace_back(new ForwardPointer(10000, SpvStorageClassInput)); - types.emplace_back(new ForwardPointer(20000, SpvStorageClassInput)); - - // Void, Bool - types.emplace_back(new Void()); - auto* voidt = types.back().get(); - types.emplace_back(new Bool()); - auto* boolt = types.back().get(); - - // Integer - types.emplace_back(new Integer(32, true)); - auto* s32 = types.back().get(); - types.emplace_back(new Integer(32, false)); - types.emplace_back(new Integer(64, true)); - types.emplace_back(new Integer(64, false)); - auto* u64 = types.back().get(); - - // Float - types.emplace_back(new Float(32)); - auto* f32 = types.back().get(); - types.emplace_back(new Float(64)); - - // Vector - types.emplace_back(new Vector(s32, 2)); - types.emplace_back(new Vector(s32, 3)); - auto* v3s32 = types.back().get(); - types.emplace_back(new Vector(u64, 4)); - types.emplace_back(new Vector(f32, 3)); - auto* v3f32 = types.back().get(); - - // Matrix - types.emplace_back(new Matrix(v3s32, 3)); - types.emplace_back(new Matrix(v3s32, 4)); - types.emplace_back(new Matrix(v3f32, 4)); - - // Images - types.emplace_back(new Image(s32, SpvDim2D, 0, 0, 0, 0, SpvImageFormatRg8, - SpvAccessQualifierReadOnly)); - auto* image1 = types.back().get(); - types.emplace_back(new Image(s32, SpvDim2D, 0, 1, 0, 0, SpvImageFormatRg8, - SpvAccessQualifierReadOnly)); - types.emplace_back(new Image(s32, SpvDim3D, 0, 1, 0, 0, SpvImageFormatRg8, - SpvAccessQualifierReadOnly)); - types.emplace_back(new Image(voidt, SpvDim3D, 0, 1, 0, 1, SpvImageFormatRg8, - SpvAccessQualifierReadWrite)); - auto* image2 = types.back().get(); - - // Sampler - types.emplace_back(new Sampler()); - - // Sampled Image - types.emplace_back(new SampledImage(image1)); - types.emplace_back(new SampledImage(image2)); - - // Array - types.emplace_back(new Array(f32, 100)); - types.emplace_back(new Array(f32, 42)); - auto* a42f32 = types.back().get(); - types.emplace_back(new Array(u64, 24)); - - // RuntimeArray - types.emplace_back(new RuntimeArray(v3f32)); - types.emplace_back(new RuntimeArray(v3s32)); - auto* rav3s32 = types.back().get(); - - // Struct - types.emplace_back(new Struct(std::vector{s32})); - types.emplace_back(new Struct(std::vector{s32, f32})); - auto* sts32f32 = types.back().get(); - types.emplace_back(new Struct(std::vector{u64, a42f32, rav3s32})); - - // Opaque - types.emplace_back(new Opaque("")); - types.emplace_back(new Opaque("hello")); - types.emplace_back(new Opaque("world")); - - // Pointer - types.emplace_back(new Pointer(f32, SpvStorageClassInput)); - types.emplace_back(new Pointer(sts32f32, SpvStorageClassFunction)); - types.emplace_back(new Pointer(a42f32, SpvStorageClassFunction)); - - // Function - types.emplace_back(new Function(voidt, {})); - types.emplace_back(new Function(voidt, {boolt})); - types.emplace_back(new Function(voidt, {boolt, s32})); - types.emplace_back(new Function(s32, {boolt, s32})); - - // Event, Device Event, Reserve Id, Queue, - types.emplace_back(new Event()); - types.emplace_back(new DeviceEvent()); - types.emplace_back(new ReserveId()); - types.emplace_back(new Queue()); - - // Pipe, Forward Pointer, PipeStorage, NamedBarrier - types.emplace_back(new Pipe(SpvAccessQualifierReadWrite)); - types.emplace_back(new Pipe(SpvAccessQualifierReadOnly)); - types.emplace_back(new ForwardPointer(1, SpvStorageClassInput)); - types.emplace_back(new ForwardPointer(2, SpvStorageClassInput)); - types.emplace_back(new ForwardPointer(2, SpvStorageClassUniform)); - types.emplace_back(new PipeStorage()); - types.emplace_back(new NamedBarrier()); - - for (size_t i = 0; i < types.size(); ++i) { - for (size_t j = 0; j < types.size(); ++j) { - if (i == j) { - EXPECT_TRUE(types[i]->IsSame(types[j].get())) - << "expected '" << types[i]->str() << "' is the same as '" - << types[j]->str() << "'"; - } else { - EXPECT_FALSE(types[i]->IsSame(types[j].get())) - << "expected '" << types[i]->str() << "' is different to '" - << types[j]->str() << "'"; - } - } - } -} - -TEST(Types, IntSignedness) { - std::vector signednesses = {true, false, false, true}; - std::vector> types; - for (bool s : signednesses) { - types.emplace_back(new Integer(32, s)); - } - for (size_t i = 0; i < signednesses.size(); i++) { - EXPECT_EQ(signednesses[i], types[i]->IsSigned()); - } -} - -TEST(Types, IntWidth) { - std::vector widths = {1, 2, 4, 8, 16, 32, 48, 64, 128}; - std::vector> types; - for (uint32_t w : widths) { - types.emplace_back(new Integer(w, true)); - } - for (size_t i = 0; i < widths.size(); i++) { - EXPECT_EQ(widths[i], types[i]->width()); - } -} - -TEST(Types, FloatWidth) { - std::vector widths = {1, 2, 4, 8, 16, 32, 48, 64, 128}; - std::vector> types; - for (uint32_t w : widths) { - types.emplace_back(new Float(w)); - } - for (size_t i = 0; i < widths.size(); i++) { - EXPECT_EQ(widths[i], types[i]->width()); - } -} - -TEST(Types, VectorElementCount) { - auto s32 = MakeUnique(32, true); - for (uint32_t c : {2, 3, 4}) { - auto s32v = MakeUnique(s32.get(), c); - EXPECT_EQ(c, s32v->element_count()); - } -} - -TEST(Types, MatrixElementCount) { - auto s32 = MakeUnique(32, true); - auto s32v4 = MakeUnique(s32.get(), 4); - for (uint32_t c : {1, 2, 3, 4, 10, 100}) { - auto s32m = MakeUnique(s32v4.get(), c); - EXPECT_EQ(c, s32m->element_count()); - } -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/unify_const_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/unify_const_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/unify_const_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/unify_const_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,981 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include - -#include "assembly_builder.h" -#include "pass_fixture.h" -#include "pass_utils.h" - -namespace { -using namespace spvtools; - -// Returns the types defining instructions commonly used in many tests. -std::vector CommonTypes() { - return std::vector{ - // clang-format off - // scalar types - "%bool = OpTypeBool", - "%uint = OpTypeInt 32 0", - "%int = OpTypeInt 32 1", - "%uint64 = OpTypeInt 64 0", - "%int64 = OpTypeInt 64 1", - "%float = OpTypeFloat 32", - "%double = OpTypeFloat 64", - // vector types - "%v2bool = OpTypeVector %bool 2", - "%v2uint = OpTypeVector %uint 2", - "%v2int = OpTypeVector %int 2", - "%v3int = OpTypeVector %int 3", - "%v4int = OpTypeVector %int 4", - "%v2float = OpTypeVector %float 2", - "%v3float = OpTypeVector %float 3", - "%v2double = OpTypeVector %double 2", - // struct types - "%inner_struct = OpTypeStruct %bool %float", - "%outer_struct = OpTypeStruct %inner_struct %int %double", - "%flat_struct = OpTypeStruct %bool %int %float %double", - // variable pointer types - "%_pf_bool = OpTypePointer Function %bool", - "%_pf_uint = OpTypePointer Function %uint", - "%_pf_int = OpTypePointer Function %int", - "%_pf_uint64 = OpTypePointer Function %uint64", - "%_pf_int64 = OpTypePointer Function %int64", - "%_pf_float = OpTypePointer Function %float", - "%_pf_double = OpTypePointer Function %double", - "%_pf_v2int = OpTypePointer Function %v2int", - "%_pf_v3int = OpTypePointer Function %v3int", - "%_pf_v4int = OpTypePointer Function %v4int", - "%_pf_v2float = OpTypePointer Function %v2float", - "%_pf_v3float = OpTypePointer Function %v3float", - "%_pf_v2double = OpTypePointer Function %v2double", - "%_pf_inner_struct = OpTypePointer Function %inner_struct", - "%_pf_outer_struct = OpTypePointer Function %outer_struct", - "%_pf_flat_struct = OpTypePointer Function %flat_struct", - // clang-format on - }; -} - -// A helper function to strip OpName instructions from the given string of -// disassembly code and put those debug instructions to a set. Returns the -// string with all OpName instruction stripped and a set of OpName -// instructions. -std::tuple> -StripOpNameInstructionsToSet(const std::string& str) { - std::stringstream ss(str); - std::ostringstream oss; - std::string inst_str; - std::unordered_set opname_instructions; - while (std::getline(ss, inst_str, '\n')) { - if (inst_str.find("OpName %") == std::string::npos) { - oss << inst_str << '\n'; - } else { - opname_instructions.insert(inst_str); - } - } - return std::make_tuple(oss.str(), std::move(opname_instructions)); -} - -// The test fixture for all tests of UnifyConstantPass. This fixture defines -// the rule of checking: all the optimized code should be exactly the same as -// the expected code, except the OpName instructions, which can be different in -// order. -template -class UnifyConstantTest : public PassTest { - protected: - // Runs UnifyConstantPass on the code built from the given |test_builder|, - // and checks whether the optimization result matches with the code built - // from |expected_builder|. - void Check(const AssemblyBuilder& expected_builder, - const AssemblyBuilder& test_builder) { - // unoptimized code - const std::string original_before_strip = test_builder.GetCode(); - std::string original_without_opnames; - std::unordered_set original_opnames; - std::tie(original_without_opnames, original_opnames) = - StripOpNameInstructionsToSet(original_before_strip); - - // expected code - std::string expected_without_opnames; - std::unordered_set expected_opnames; - std::tie(expected_without_opnames, expected_opnames) = - StripOpNameInstructionsToSet(expected_builder.GetCode()); - - // optimized code - std::string optimized_before_strip; - auto status = opt::Pass::Status::SuccessWithoutChange; - std::tie(optimized_before_strip, status) = - this->template SinglePassRunAndDisassemble( - test_builder.GetCode(), - /* skip_nop = */ true); - std::string optimized_without_opnames; - std::unordered_set optimized_opnames; - std::tie(optimized_without_opnames, optimized_opnames) = - StripOpNameInstructionsToSet(optimized_before_strip); - - // Flag "status" should be returned correctly. - EXPECT_NE(opt::Pass::Status::Failure, status); - EXPECT_EQ(expected_without_opnames == original_without_opnames, - status == opt::Pass::Status::SuccessWithoutChange); - // Code except OpName instructions should be exactly the same. - EXPECT_EQ(expected_without_opnames, optimized_without_opnames); - // OpName instructions can be in different order, but the content must be - // the same. - EXPECT_EQ(expected_opnames, optimized_opnames); - } -}; - -using UnifyFrontEndConstantSingleTest = - UnifyConstantTest>; - -TEST_F(UnifyFrontEndConstantSingleTest, Basic) { - AssemblyBuilder test_builder; - AssemblyBuilder expected_builder; - - test_builder - .AppendTypesConstantsGlobals({ - "%uint = OpTypeInt 32 0", "%_pf_uint = OpTypePointer Function %uint", - "%unsigned_1 = OpConstant %uint 1", - "%unsigned_1_duplicate = OpConstant %uint 1", // duplicated constant - }) - .AppendInMain({ - "%uint_var = OpVariable %_pf_uint Function", - "OpStore %uint_var %unsigned_1_duplicate", - }); - - expected_builder - .AppendTypesConstantsGlobals({ - "%uint = OpTypeInt 32 0", "%_pf_uint = OpTypePointer Function %uint", - "%unsigned_1 = OpConstant %uint 1", - }) - .AppendInMain({ - "%uint_var = OpVariable %_pf_uint Function", - "OpStore %uint_var %unsigned_1", - }) - .AppendNames({ - "OpName %unsigned_1 \"unsigned_1_duplicate\"", // the OpName - // instruction of the - // removed duplicated - // constant won't be - // erased. - }); - Check(expected_builder, test_builder); -} - -TEST_F(UnifyFrontEndConstantSingleTest, SkipWhenResultIdHasDecorations) { - AssemblyBuilder test_builder; - AssemblyBuilder expected_builder; - - test_builder - .AppendAnnotations({ - // So far we don't have valid decorations for constants. This is - // preparing for the future updates of SPIR-V. - // TODO(qining): change to a valid decoration once they are available. - "OpDecorate %f_1 RelaxedPrecision", - "OpDecorate %f_2_dup RelaxedPrecision", - }) - .AppendTypesConstantsGlobals({ - // clang-format off - "%float = OpTypeFloat 32", - "%_pf_float = OpTypePointer Function %float", - "%f_1 = OpConstant %float 1", - // %f_1 has decoration, so %f_1 will not be used to replace %f_1_dup. - "%f_1_dup = OpConstant %float 1", - "%f_2 = OpConstant %float 2", - // %_2_dup has decoration, so %f_2 will not replace %f_2_dup. - "%f_2_dup = OpConstant %float 2", - // no decoration for %f_3 or %f_3_dup, %f_3_dup should be replaced. - "%f_3 = OpConstant %float 3", - "%f_3_dup = OpConstant %float 3", - // clang-format on - }) - .AppendInMain({ - // clang-format off - "%f_var = OpVariable %_pf_float Function", - "OpStore %f_var %f_1_dup", - "OpStore %f_var %f_2_dup", - "OpStore %f_var %f_3_dup", - // clang-format on - }); - - expected_builder - .AppendAnnotations({ - "OpDecorate %f_1 RelaxedPrecision", - "OpDecorate %f_2_dup RelaxedPrecision", - }) - .AppendTypesConstantsGlobals({ - // clang-format off - "%float = OpTypeFloat 32", - "%_pf_float = OpTypePointer Function %float", - "%f_1 = OpConstant %float 1", - "%f_1_dup = OpConstant %float 1", - "%f_2 = OpConstant %float 2", - "%f_2_dup = OpConstant %float 2", - "%f_3 = OpConstant %float 3", - // clang-format on - }) - .AppendInMain({ - // clang-format off - "%f_var = OpVariable %_pf_float Function", - "OpStore %f_var %f_1_dup", - "OpStore %f_var %f_2_dup", - "OpStore %f_var %f_3", - // clang-format on - }) - .AppendNames({ - "OpName %f_3 \"f_3_dup\"", - }); - - Check(expected_builder, test_builder); -} - -TEST_F(UnifyFrontEndConstantSingleTest, UnifyWithDecorationOnTypes) { - AssemblyBuilder test_builder; - AssemblyBuilder expected_builder; - - test_builder - .AppendAnnotations({ - "OpMemberDecorate %flat_d 1 RelaxedPrecision", - }) - .AppendTypesConstantsGlobals({ - // clang-format off - "%int = OpTypeInt 32 1", - "%float = OpTypeFloat 32", - "%flat = OpTypeStruct %int %float", - "%_pf_flat = OpTypePointer Function %flat", - // decorated flat struct - "%flat_d = OpTypeStruct %int %float", - "%_pf_flat_d = OpTypePointer Function %flat_d", - // perserved contants. %flat_1 and %flat_d has same members, but - // their type are different in decorations, so they should not be - // used to replace each other. - "%int_1 = OpConstant %int 1", - "%float_1 = OpConstant %float 1", - "%flat_1 = OpConstantComposite %flat %int_1 %float_1", - "%flat_d_1 = OpConstantComposite %flat_d %int_1 %float_1", - // duplicated constants. - "%flat_1_dup = OpConstantComposite %flat %int_1 %float_1", - "%flat_d_1_dup = OpConstantComposite %flat_d %int_1 %float_1", - // clang-format on - }) - .AppendInMain({ - "%flat_var = OpVariable %_pf_flat Function", - "OpStore %flat_var %flat_1_dup", - "%flat_d_var = OpVariable %_pf_flat_d Function", - "OpStore %flat_d_var %flat_d_1_dup", - }); - - expected_builder - .AppendAnnotations({ - "OpMemberDecorate %flat_d 1 RelaxedPrecision", - }) - .AppendTypesConstantsGlobals({ - // clang-format off - "%int = OpTypeInt 32 1", - "%float = OpTypeFloat 32", - "%flat = OpTypeStruct %int %float", - "%_pf_flat = OpTypePointer Function %flat", - // decorated flat struct - "%flat_d = OpTypeStruct %int %float", - "%_pf_flat_d = OpTypePointer Function %flat_d", - "%int_1 = OpConstant %int 1", - "%float_1 = OpConstant %float 1", - "%flat_1 = OpConstantComposite %flat %int_1 %float_1", - "%flat_d_1 = OpConstantComposite %flat_d %int_1 %float_1", - // clang-format on - }) - .AppendInMain({ - "%flat_var = OpVariable %_pf_flat Function", - "OpStore %flat_var %flat_1", - "%flat_d_var = OpVariable %_pf_flat_d Function", - "OpStore %flat_d_var %flat_d_1", - }) - .AppendNames({ - "OpName %flat_1 \"flat_1_dup\"", "OpName %flat_d_1 \"flat_d_1_dup\"", - }); - - Check(expected_builder, test_builder); -} - -struct UnifyConstantTestCase { - // preserved constants. - std::vector preserved_consts; - // expected uses of the preserved constants. - std::vector use_preserved_consts; - // duplicated constants of the preserved constants. - std::vector duplicate_consts; - // uses of the duplicated constants, expected to be updated to use the - // preserved constants. - std::vector use_duplicate_consts; - // The updated OpName instructions that originally refer to duplicated - // constants. - std::vector remapped_names; -}; - -using UnifyFrontEndConstantParamTest = UnifyConstantTest< - PassTest<::testing::TestWithParam>>; - -TEST_P(UnifyFrontEndConstantParamTest, TestCase) { - auto& tc = GetParam(); - AssemblyBuilder test_builder; - AssemblyBuilder expected_builder; - test_builder.AppendTypesConstantsGlobals(CommonTypes()); - expected_builder.AppendTypesConstantsGlobals(CommonTypes()); - - test_builder.AppendTypesConstantsGlobals(tc.preserved_consts) - .AppendTypesConstantsGlobals(tc.duplicate_consts) - .AppendInMain(tc.use_duplicate_consts); - - // Duplicated constants are killed in the expected output, and the debug - // instructions attached to those duplicated instructions will be migrated to - // the corresponding preserved constants. - expected_builder.AppendTypesConstantsGlobals(tc.preserved_consts) - .AppendInMain(tc.use_preserved_consts) - .AppendNames(tc.remapped_names); - - Check(expected_builder, test_builder); -} - -INSTANTIATE_TEST_CASE_P(Case, UnifyFrontEndConstantParamTest, - ::testing::ValuesIn(std::vector({ - // clang-format off - // basic tests for scalar constants - { - // preserved constants - { - "%bool_true = OpConstantTrue %bool", - "%signed_1 = OpConstant %int 1", - "%signed_minus_1 = OpConstant %int64 -1", - "%unsigned_max = OpConstant %uint64 18446744073709551615", - "%float_1 = OpConstant %float 1", - "%double_1 = OpConstant %double 1", - }, - // use preserved constants in main - { - "%bool_var = OpVariable %_pf_bool Function", - "OpStore %bool_var %bool_true", - "%int_var = OpVariable %_pf_int Function", - "OpStore %int_var %signed_1", - "%int64_var = OpVariable %_pf_int64 Function", - "OpStore %int64_var %signed_minus_1", - "%uint64_var = OpVariable %_pf_uint64 Function", - "OpStore %uint64_var %unsigned_max", - "%float_var = OpVariable %_pf_float Function", - "OpStore %float_var %float_1", - "%double_var = OpVariable %_pf_double Function", - "OpStore %double_var %double_1", - }, - // duplicated constants - { - "%bool_true_duplicate = OpConstantTrue %bool", - "%signed_1_duplicate = OpConstant %int 1", - "%signed_minus_1_duplicate = OpConstant %int64 -1", - "%unsigned_max_duplicate = OpConstant %uint64 18446744073709551615", - "%float_1_duplicate = OpConstant %float 1", - "%double_1_duplicate = OpConstant %double 1", - }, - // use duplicated constants in main - { - "%bool_var = OpVariable %_pf_bool Function", - "OpStore %bool_var %bool_true_duplicate", - "%int_var = OpVariable %_pf_int Function", - "OpStore %int_var %signed_1_duplicate", - "%int64_var = OpVariable %_pf_int64 Function", - "OpStore %int64_var %signed_minus_1_duplicate", - "%uint64_var = OpVariable %_pf_uint64 Function", - "OpStore %uint64_var %unsigned_max_duplicate", - "%float_var = OpVariable %_pf_float Function", - "OpStore %float_var %float_1_duplicate", - "%double_var = OpVariable %_pf_double Function", - "OpStore %double_var %double_1_duplicate", - }, - // remapped names - { - "OpName %bool_true \"bool_true_duplicate\"", - "OpName %signed_1 \"signed_1_duplicate\"", - "OpName %signed_minus_1 \"signed_minus_1_duplicate\"", - "OpName %unsigned_max \"unsigned_max_duplicate\"", - "OpName %float_1 \"float_1_duplicate\"", - "OpName %double_1 \"double_1_duplicate\"", - }, - }, - // NaN in different bit patterns should not be unified, but the ones - // using same bit pattern should be unified. - { - // preserved constants - { - "%float_nan_1 = OpConstant %float 0x1.8p+128", // !2143289344, 7FC00000 - "%float_nan_2 = OpConstant %float 0x1.800002p+128",// !2143289345 7FC00001 - }, - // use preserved constants in main - { - "%float_var = OpVariable %_pf_float Function", - "OpStore %float_var %float_nan_1", - "OpStore %float_var %float_nan_2", - }, - // duplicated constants - { - "%float_nan_1_duplicate = OpConstant %float 0x1.8p+128", // !2143289344, 7FC00000 - "%float_nan_2_duplicate = OpConstant %float 0x1.800002p+128",// !2143289345, 7FC00001 - }, - // use duplicated constants in main - { - "%float_var = OpVariable %_pf_float Function", - "OpStore %float_var %float_nan_1_duplicate", - "OpStore %float_var %float_nan_2_duplicate", - }, - // remapped names - { - "OpName %float_nan_1 \"float_nan_1_duplicate\"", - "OpName %float_nan_2 \"float_nan_2_duplicate\"", - }, - }, - // null values - { - // preserved constants - { - "%bool_null = OpConstantNull %bool", - "%signed_null = OpConstantNull %int", - "%signed_64_null = OpConstantNull %int64", - "%float_null = OpConstantNull %float", - "%double_null = OpConstantNull %double", - // zero-valued constants will not be unified with the equivalent - // null constants. - "%signed_zero = OpConstant %int 0", - }, - // use preserved constants in main - { - "%bool_var = OpVariable %_pf_bool Function", - "OpStore %bool_var %bool_null", - "%int_var = OpVariable %_pf_int Function", - "OpStore %int_var %signed_null", - "%int64_var = OpVariable %_pf_int64 Function", - "OpStore %int64_var %signed_64_null", - "%float_var = OpVariable %_pf_float Function", - "OpStore %float_var %float_null", - "%double_var = OpVariable %_pf_double Function", - "OpStore %double_var %double_null", - }, - // duplicated constants - { - "%bool_null_duplicate = OpConstantNull %bool", - "%signed_null_duplicate = OpConstantNull %int", - "%signed_64_null_duplicate = OpConstantNull %int64", - "%float_null_duplicate = OpConstantNull %float", - "%double_null_duplicate = OpConstantNull %double", - }, - // use duplicated constants in main - { - "%bool_var = OpVariable %_pf_bool Function", - "OpStore %bool_var %bool_null_duplicate", - "%int_var = OpVariable %_pf_int Function", - "OpStore %int_var %signed_null_duplicate", - "%int64_var = OpVariable %_pf_int64 Function", - "OpStore %int64_var %signed_64_null_duplicate", - "%float_var = OpVariable %_pf_float Function", - "OpStore %float_var %float_null_duplicate", - "%double_var = OpVariable %_pf_double Function", - "OpStore %double_var %double_null_duplicate", - }, - // remapped names - { - "OpName %bool_null \"bool_null_duplicate\"", - "OpName %signed_null \"signed_null_duplicate\"", - "OpName %signed_64_null \"signed_64_null_duplicate\"", - "OpName %float_null \"float_null_duplicate\"", - "OpName %double_null \"double_null_duplicate\"", - }, - }, - // constant sampler - { - // preserved constants - { - "%sampler = OpTypeSampler", - "%_pf_sampler = OpTypePointer Function %sampler", - "%sampler_1 = OpConstantSampler %sampler Repeat 0 Linear", - }, - // use preserved constants in main - { - "%sampler_var = OpVariable %_pf_sampler Function", - "OpStore %sampler_var %sampler_1", - }, - // duplicated constants - { - "%sampler_1_duplicate = OpConstantSampler %sampler Repeat 0 Linear", - }, - // use duplicated constants in main - { - "%sampler_var = OpVariable %_pf_sampler Function", - "OpStore %sampler_var %sampler_1_duplicate", - }, - // remapped names - { - "OpName %sampler_1 \"sampler_1_duplicate\"", - }, - }, - // duplicate vector built from same ids. - { - // preserved constants - { - "%signed_1 = OpConstant %int 1", - "%signed_2 = OpConstant %int 2", - "%signed_3 = OpConstant %int 3", - "%signed_4 = OpConstant %int 4", - "%vec = OpConstantComposite %v4int %signed_1 %signed_2 %signed_3 %signed_4", - }, - // use preserved constants in main - { - "%vec_var = OpVariable %_pf_v4int Function", - "OpStore %vec_var %vec", - }, - // duplicated constants - { - "%vec_duplicate = OpConstantComposite %v4int %signed_1 %signed_2 %signed_3 %signed_4", - }, - // use duplicated constants in main - { - "%vec_var = OpVariable %_pf_v4int Function", - "OpStore %vec_var %vec_duplicate", - }, - // remapped names - { - "OpName %vec \"vec_duplicate\"", - } - }, - // duplicate vector built from duplicated ids. - { - // preserved constants - { - "%signed_1 = OpConstant %int 1", - "%signed_2 = OpConstant %int 2", - "%signed_3 = OpConstant %int 3", - "%signed_4 = OpConstant %int 4", - "%vec = OpConstantComposite %v4int %signed_1 %signed_2 %signed_3 %signed_4", - }, - // use preserved constants in main - { - "%vec_var = OpVariable %_pf_v4int Function", - "OpStore %vec_var %vec", - }, - // duplicated constants - { - "%signed_3_duplicate = OpConstant %int 3", - "%signed_4_duplicate = OpConstant %int 4", - "%vec_duplicate = OpConstantComposite %v4int %signed_1 %signed_2 %signed_3_duplicate %signed_4_duplicate", - }, - // use duplicated constants in main - { - "%vec_var = OpVariable %_pf_v4int Function", - "OpStore %vec_var %vec_duplicate", - }, - // remapped names - { - "OpName %signed_3 \"signed_3_duplicate\"", - "OpName %signed_4 \"signed_4_duplicate\"", - "OpName %vec \"vec_duplicate\"", - }, - }, - // flat struct - { - // preserved constants - { - "%bool_true = OpConstantTrue %bool", - "%signed_1 = OpConstant %int 1", - "%float_1 = OpConstant %float 1", - "%double_1 = OpConstant %double 1", - "%s = OpConstantComposite %flat_struct %bool_true %signed_1 %float_1 %double_1", - }, - // use preserved constants in main - { - "%s_var = OpVariable %_pf_flat_struct Function", - "OpStore %s_var %s", - }, - // duplicated constants - { - "%float_1_duplicate = OpConstant %float 1", - "%double_1_duplicate = OpConstant %double 1", - "%s_duplicate = OpConstantComposite %flat_struct %bool_true %signed_1 %float_1_duplicate %double_1_duplicate", - }, - // use duplicated constants in main - { - "%s_var = OpVariable %_pf_flat_struct Function", - "OpStore %s_var %s_duplicate", - }, - // remapped names - { - "OpName %float_1 \"float_1_duplicate\"", - "OpName %double_1 \"double_1_duplicate\"", - "OpName %s \"s_duplicate\"", - }, - }, - // nested struct - { - // preserved constants - { - "%bool_true = OpConstantTrue %bool", - "%signed_1 = OpConstant %int 1", - "%float_1 = OpConstant %float 1", - "%double_1 = OpConstant %double 1", - "%inner = OpConstantComposite %inner_struct %bool_true %float_1", - "%outer = OpConstantComposite %outer_struct %inner %signed_1 %double_1", - }, - // use preserved constants in main - { - "%outer_var = OpVariable %_pf_outer_struct Function", - "OpStore %outer_var %outer", - }, - // duplicated constants - { - "%float_1_duplicate = OpConstant %float 1", - "%double_1_duplicate = OpConstant %double 1", - "%inner_duplicate = OpConstantComposite %inner_struct %bool_true %float_1_duplicate", - "%outer_duplicate = OpConstantComposite %outer_struct %inner_duplicate %signed_1 %double_1_duplicate", - }, - // use duplicated constants in main - { - "%outer_var = OpVariable %_pf_outer_struct Function", - "OpStore %outer_var %outer_duplicate", - }, - // remapped names - { - "OpName %float_1 \"float_1_duplicate\"", - "OpName %double_1 \"double_1_duplicate\"", - "OpName %inner \"inner_duplicate\"", - "OpName %outer \"outer_duplicate\"", - }, - }, - // composite type null constants. Null constants and zero-valued - // constants should not be used to replace each other. - { - // preserved constants - { - "%bool_zero = OpConstantFalse %bool", - "%float_zero = OpConstant %float 0", - "%int_null = OpConstantNull %int", - "%double_null = OpConstantNull %double", - // inner_struct type null constant. - "%null_inner = OpConstantNull %inner_struct", - // zero-valued composite constant built from zero-valued constant - // component. inner_zero should not be replace by null_inner. - "%inner_zero = OpConstantComposite %inner_struct %bool_zero %float_zero", - // zero-valued composite contant built from zero-valued constants - // and null constants. - "%outer_zero = OpConstantComposite %outer_struct %inner_zero %int_null %double_null", - // outer_struct type null constant, it should not be replaced by - // outer_zero. - "%null_outer = OpConstantNull %outer_struct", - }, - // use preserved constants in main - { - "%inner_var = OpVariable %_pf_inner_struct Function", - "OpStore %inner_var %inner_zero", - "OpStore %inner_var %null_inner", - "%outer_var = OpVariable %_pf_outer_struct Function", - "OpStore %outer_var %outer_zero", - "OpStore %outer_var %null_outer", - }, - // duplicated constants - { - "%null_inner_dup = OpConstantNull %inner_struct", - "%null_outer_dup = OpConstantNull %outer_struct", - "%inner_zero_dup = OpConstantComposite %inner_struct %bool_zero %float_zero", - "%outer_zero_dup = OpConstantComposite %outer_struct %inner_zero_dup %int_null %double_null", - }, - // use duplicated constants in main - { - "%inner_var = OpVariable %_pf_inner_struct Function", - "OpStore %inner_var %inner_zero_dup", - "OpStore %inner_var %null_inner_dup", - "%outer_var = OpVariable %_pf_outer_struct Function", - "OpStore %outer_var %outer_zero_dup", - "OpStore %outer_var %null_outer_dup", - }, - // remapped names - { - "OpName %null_inner \"null_inner_dup\"", - "OpName %null_outer \"null_outer_dup\"", - "OpName %inner_zero \"inner_zero_dup\"", - "OpName %outer_zero \"outer_zero_dup\"", - }, - }, - // Spec Constants with SpecId decoration should be skipped. - { - // preserved constants - { - // Assembly builder will add OpDecorate SpecId instruction for the - // following spec constant instructions automatically. - "%spec_bool_1 = OpSpecConstantTrue %bool", - "%spec_bool_2 = OpSpecConstantTrue %bool", - "%spec_int_1 = OpSpecConstant %int 1", - "%spec_int_2 = OpSpecConstant %int 1", - }, - // use preserved constants in main - { - "%bool_var = OpVariable %_pf_bool Function", - "OpStore %bool_var %spec_bool_1", - "OpStore %bool_var %spec_bool_2", - "%int_var = OpVariable %_pf_int Function", - "OpStore %int_var %spec_int_1", - "OpStore %int_var %spec_int_2", - }, - // duplicated constants. No duplicated instruction to remove in this - // case. - {}, - // use duplicated constants in main. Same as the above 'use preserved - // constants in main' defined above, as no instruction should be - // removed in this case. - { - "%bool_var = OpVariable %_pf_bool Function", - "OpStore %bool_var %spec_bool_1", - "OpStore %bool_var %spec_bool_2", - "%int_var = OpVariable %_pf_int Function", - "OpStore %int_var %spec_int_1", - "OpStore %int_var %spec_int_2", - }, - // remapped names. No duplicated instruction removed, so this is - // empty. - {} - }, - // spec constant composite - { - // preserved constants - { - "%spec_bool_true = OpSpecConstantTrue %bool", - "%spec_signed_1 = OpSpecConstant %int 1", - "%float_1 = OpConstant %float 1", - "%double_1 = OpConstant %double 1", - "%spec_inner = OpSpecConstantComposite %inner_struct %spec_bool_true %float_1", - "%spec_outer = OpSpecConstantComposite %outer_struct %spec_inner %spec_signed_1 %double_1", - "%spec_vec2 = OpSpecConstantComposite %v2float %float_1 %float_1", - }, - // use preserved constants in main - { - "%outer_var = OpVariable %_pf_outer_struct Function", - "OpStore %outer_var %spec_outer", - "%v2float_var = OpVariable %_pf_v2float Function", - "OpStore %v2float_var %spec_vec2", - }, - // duplicated constants - { - "%float_1_duplicate = OpConstant %float 1", - "%double_1_duplicate = OpConstant %double 1", - "%spec_inner_duplicate = OpSpecConstantComposite %inner_struct %spec_bool_true %float_1_duplicate", - "%spec_outer_duplicate = OpSpecConstantComposite %outer_struct %spec_inner_duplicate %spec_signed_1 %double_1_duplicate", - "%spec_vec2_duplicate = OpSpecConstantComposite %v2float %float_1 %float_1_duplicate", - }, - // use duplicated constants in main - { - "%outer_var = OpVariable %_pf_outer_struct Function", - "OpStore %outer_var %spec_outer_duplicate", - "%v2float_var = OpVariable %_pf_v2float Function", - "OpStore %v2float_var %spec_vec2_duplicate", - }, - // remapped names - { - "OpName %float_1 \"float_1_duplicate\"", - "OpName %double_1 \"double_1_duplicate\"", - "OpName %spec_inner \"spec_inner_duplicate\"", - "OpName %spec_outer \"spec_outer_duplicate\"", - "OpName %spec_vec2 \"spec_vec2_duplicate\"", - }, - }, - // spec constant op with int scalar - { - // preserved constants - { - "%spec_signed_1 = OpSpecConstant %int 1", - "%spec_signed_2 = OpSpecConstant %int 2", - "%spec_signed_add = OpSpecConstantOp %int IAdd %spec_signed_1 %spec_signed_2", - }, - // use preserved constants in main - { - "%int_var = OpVariable %_pf_int Function", - "OpStore %int_var %spec_signed_add", - }, - // duplicated constants - { - "%spec_signed_add_duplicate = OpSpecConstantOp %int IAdd %spec_signed_1 %spec_signed_2", - }, - // use duplicated contants in main - { - "%int_var = OpVariable %_pf_int Function", - "OpStore %int_var %spec_signed_add_duplicate", - }, - // remapped names - { - "OpName %spec_signed_add \"spec_signed_add_duplicate\"", - }, - }, - // spec constant op composite extract - { - // preserved constants - { - "%float_1 = OpConstant %float 1", - "%spec_vec2 = OpSpecConstantComposite %v2float %float_1 %float_1", - "%spec_extract = OpSpecConstantOp %float CompositeExtract %spec_vec2 1", - }, - // use preserved constants in main - { - "%float_var = OpVariable %_pf_float Function", - "OpStore %float_var %spec_extract", - }, - // duplicated constants - { - "%spec_extract_duplicate = OpSpecConstantOp %float CompositeExtract %spec_vec2 1", - }, - // use duplicated constants in main - { - "%float_var = OpVariable %_pf_float Function", - "OpStore %float_var %spec_extract_duplicate", - }, - // remapped names - { - "OpName %spec_extract \"spec_extract_duplicate\"", - }, - }, - // spec constant op vector shuffle - { - // preserved constants - { - "%float_1 = OpConstant %float 1", - "%float_2 = OpConstant %float 2", - "%spec_vec2_1 = OpSpecConstantComposite %v2float %float_1 %float_1", - "%spec_vec2_2 = OpSpecConstantComposite %v2float %float_2 %float_2", - "%spec_vector_shuffle = OpSpecConstantOp %v2float VectorShuffle %spec_vec2_1 %spec_vec2_2 1 2", - }, - // use preserved constants in main - { - "%v2float_var = OpVariable %_pf_v2float Function", - "OpStore %v2float_var %spec_vector_shuffle", - }, - // duplicated constants - { - "%spec_vector_shuffle_duplicate = OpSpecConstantOp %v2float VectorShuffle %spec_vec2_1 %spec_vec2_2 1 2", - }, - // use duplicated constants in main - { - "%v2float_var = OpVariable %_pf_v2float Function", - "OpStore %v2float_var %spec_vector_shuffle_duplicate", - }, - // remapped names - { - "OpName %spec_vector_shuffle \"spec_vector_shuffle_duplicate\"", - }, - }, - // long dependency chain - { - // preserved constants - { - "%array_size = OpConstant %int 4", - "%type_arr_int_4 = OpTypeArray %int %array_size", - "%signed_0 = OpConstant %int 100", - "%signed_1 = OpConstant %int 1", - "%signed_2 = OpSpecConstantOp %int IAdd %signed_0 %signed_1", - "%signed_3 = OpSpecConstantOp %int ISub %signed_0 %signed_2", - "%signed_4 = OpSpecConstantOp %int IAdd %signed_0 %signed_3", - "%signed_5 = OpSpecConstantOp %int ISub %signed_0 %signed_4", - "%signed_6 = OpSpecConstantOp %int IAdd %signed_0 %signed_5", - "%signed_7 = OpSpecConstantOp %int ISub %signed_0 %signed_6", - "%signed_8 = OpSpecConstantOp %int IAdd %signed_0 %signed_7", - "%signed_9 = OpSpecConstantOp %int ISub %signed_0 %signed_8", - "%signed_10 = OpSpecConstantOp %int IAdd %signed_0 %signed_9", - "%signed_11 = OpSpecConstantOp %int ISub %signed_0 %signed_10", - "%signed_12 = OpSpecConstantOp %int IAdd %signed_0 %signed_11", - "%signed_13 = OpSpecConstantOp %int ISub %signed_0 %signed_12", - "%signed_14 = OpSpecConstantOp %int IAdd %signed_0 %signed_13", - "%signed_15 = OpSpecConstantOp %int ISub %signed_0 %signed_14", - "%signed_16 = OpSpecConstantOp %int ISub %signed_0 %signed_15", - "%signed_17 = OpSpecConstantOp %int IAdd %signed_0 %signed_16", - "%signed_18 = OpSpecConstantOp %int ISub %signed_0 %signed_17", - "%signed_19 = OpSpecConstantOp %int IAdd %signed_0 %signed_18", - "%signed_20 = OpSpecConstantOp %int ISub %signed_0 %signed_19", - "%signed_vec_a = OpSpecConstantComposite %v2int %signed_18 %signed_19", - "%signed_vec_b = OpSpecConstantOp %v2int IMul %signed_vec_a %signed_vec_a", - "%signed_21 = OpSpecConstantOp %int CompositeExtract %signed_vec_b 0", - "%signed_array = OpConstantComposite %type_arr_int_4 %signed_20 %signed_20 %signed_21 %signed_21", - "%signed_22 = OpSpecConstantOp %int CompositeExtract %signed_array 0", - }, - // use preserved constants in main - { - "%int_var = OpVariable %_pf_int Function", - "OpStore %int_var %signed_22", - }, - // duplicated constants - { - "%signed_0_dup = OpConstant %int 100", - "%signed_1_dup = OpConstant %int 1", - "%signed_2_dup = OpSpecConstantOp %int IAdd %signed_0_dup %signed_1_dup", - "%signed_3_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_2_dup", - "%signed_4_dup = OpSpecConstantOp %int IAdd %signed_0_dup %signed_3_dup", - "%signed_5_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_4_dup", - "%signed_6_dup = OpSpecConstantOp %int IAdd %signed_0_dup %signed_5_dup", - "%signed_7_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_6_dup", - "%signed_8_dup = OpSpecConstantOp %int IAdd %signed_0_dup %signed_7_dup", - "%signed_9_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_8_dup", - "%signed_10_dup = OpSpecConstantOp %int IAdd %signed_0_dup %signed_9_dup", - "%signed_11_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_10_dup", - "%signed_12_dup = OpSpecConstantOp %int IAdd %signed_0_dup %signed_11_dup", - "%signed_13_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_12_dup", - "%signed_14_dup = OpSpecConstantOp %int IAdd %signed_0_dup %signed_13_dup", - "%signed_15_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_14_dup", - "%signed_16_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_15_dup", - "%signed_17_dup = OpSpecConstantOp %int IAdd %signed_0_dup %signed_16_dup", - "%signed_18_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_17_dup", - "%signed_19_dup = OpSpecConstantOp %int IAdd %signed_0_dup %signed_18_dup", - "%signed_20_dup = OpSpecConstantOp %int ISub %signed_0_dup %signed_19_dup", - "%signed_vec_a_dup = OpSpecConstantComposite %v2int %signed_18_dup %signed_19_dup", - "%signed_vec_b_dup = OpSpecConstantOp %v2int IMul %signed_vec_a_dup %signed_vec_a_dup", - "%signed_21_dup = OpSpecConstantOp %int CompositeExtract %signed_vec_b_dup 0", - "%signed_array_dup = OpConstantComposite %type_arr_int_4 %signed_20_dup %signed_20_dup %signed_21_dup %signed_21_dup", - "%signed_22_dup = OpSpecConstantOp %int CompositeExtract %signed_array_dup 0", - }, - // use duplicated constants in main - { - "%int_var = OpVariable %_pf_int Function", - "OpStore %int_var %signed_22_dup", - }, - // remapped names - { - "OpName %signed_0 \"signed_0_dup\"", - "OpName %signed_1 \"signed_1_dup\"", - "OpName %signed_2 \"signed_2_dup\"", - "OpName %signed_3 \"signed_3_dup\"", - "OpName %signed_4 \"signed_4_dup\"", - "OpName %signed_5 \"signed_5_dup\"", - "OpName %signed_6 \"signed_6_dup\"", - "OpName %signed_7 \"signed_7_dup\"", - "OpName %signed_8 \"signed_8_dup\"", - "OpName %signed_9 \"signed_9_dup\"", - "OpName %signed_10 \"signed_10_dup\"", - "OpName %signed_11 \"signed_11_dup\"", - "OpName %signed_12 \"signed_12_dup\"", - "OpName %signed_13 \"signed_13_dup\"", - "OpName %signed_14 \"signed_14_dup\"", - "OpName %signed_15 \"signed_15_dup\"", - "OpName %signed_16 \"signed_16_dup\"", - "OpName %signed_17 \"signed_17_dup\"", - "OpName %signed_18 \"signed_18_dup\"", - "OpName %signed_19 \"signed_19_dup\"", - "OpName %signed_20 \"signed_20_dup\"", - "OpName %signed_vec_a \"signed_vec_a_dup\"", - "OpName %signed_vec_b \"signed_vec_b_dup\"", - "OpName %signed_21 \"signed_21_dup\"", - "OpName %signed_array \"signed_array_dup\"", - "OpName %signed_22 \"signed_22_dup\"", - }, - }, - // clang-format on - }))); - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/utils_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/utils_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/opt/utils_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/opt/utils_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,106 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include - -#include "pass_utils.h" - -namespace { - -using namespace spvtools; - -TEST(JoinAllInsts, Cases) { - EXPECT_EQ("", JoinAllInsts({})); - EXPECT_EQ("a\n", JoinAllInsts({"a"})); - EXPECT_EQ("a\nb\n", JoinAllInsts({"a", "b"})); - EXPECT_EQ("a\nb\nc\n", JoinAllInsts({"a", "b", "c"})); - EXPECT_EQ("hello,\nworld!\n\n\n", JoinAllInsts({"hello,", "world!", "\n"})); -} - -TEST(JoinNonDebugInsts, Cases) { - EXPECT_EQ("", JoinNonDebugInsts({})); - EXPECT_EQ("a\n", JoinNonDebugInsts({"a"})); - EXPECT_EQ("", JoinNonDebugInsts({"OpName"})); - EXPECT_EQ("a\nb\n", JoinNonDebugInsts({"a", "b"})); - EXPECT_EQ("", JoinNonDebugInsts({"OpName", "%1 = OpString \"42\""})); - EXPECT_EQ("Opstring\n", JoinNonDebugInsts({"OpName", "Opstring"})); - EXPECT_EQ("the only remaining string\n", - JoinNonDebugInsts( - {"OpSourceContinued", "OpSource", "OpSourceExtension", - "lgtm OpName", "hello OpMemberName", "this is a OpString", - "lonely OpLine", "happy OpNoLine", "OpModuleProcessed", - "the only remaining string"})); -} - -namespace { -struct SubstringReplacementTestCase { - const char* orig_str; - const char* find_substr; - const char* replace_substr; - const char* expected_str; - bool replace_should_succeed; -}; -} -using FindAndReplaceTest = - ::testing::TestWithParam; - -TEST_P(FindAndReplaceTest, SubstringReplacement) { - auto process = std::string(GetParam().orig_str); - EXPECT_EQ(GetParam().replace_should_succeed, - FindAndReplace(&process, GetParam().find_substr, - GetParam().replace_substr)) - << "Original string: " << GetParam().orig_str - << " replace: " << GetParam().find_substr - << " to: " << GetParam().replace_substr - << " should returns: " << GetParam().replace_should_succeed; - EXPECT_STREQ(GetParam().expected_str, process.c_str()) - << "Original string: " << GetParam().orig_str - << " replace: " << GetParam().find_substr - << " to: " << GetParam().replace_substr - << " expected string: " << GetParam().expected_str; -} - -INSTANTIATE_TEST_CASE_P( - SubstringReplacement, FindAndReplaceTest, - ::testing::ValuesIn(std::vector({ - // orig string, find substring, replace substring, expected string, - // replacement happened - {"", "", "", "", false}, - {"", "b", "", "", false}, - {"", "", "c", "", false}, - {"", "a", "b", "", false}, - - {"a", "", "c", "a", false}, - {"a", "b", "c", "a", false}, - {"a", "b", "", "a", false}, - {"a", "a", "", "", true}, - {"a", "a", "b", "b", true}, - - {"ab", "a", "b", "bb", true}, - {"ab", "a", "", "b", true}, - {"ab", "b", "", "a", true}, - {"ab", "ab", "", "", true}, - {"ab", "ab", "cd", "cd", true}, - {"bc", "abc", "efg", "bc", false}, - - {"abc", "ab", "bc", "bcc", true}, - {"abc", "ab", "", "c", true}, - {"abc", "bc", "", "a", true}, - {"abc", "bc", "d", "ad", true}, - {"abc", "a", "123", "123bc", true}, - {"abc", "ab", "a", "ac", true}, - {"abc", "a", "aab", "aabbc", true}, - {"abc", "abcd", "efg", "abc", false}, - }))); -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/parse_number_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/parse_number_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/parse_number_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/parse_number_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,970 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include - -#include "gmock/gmock.h" -#include "source/util/parse_number.h" -#include "spirv-tools/libspirv.h" - -namespace { -using spvutils::NumberType; -using spvutils::EncodeNumberStatus; -using spvutils::ParseNumber; -using spvutils::ParseAndEncodeIntegerNumber; -using spvutils::ParseAndEncodeFloatingPointNumber; -using spvutils::ParseAndEncodeNumber; -using testing::Eq; -using testing::IsNull; -using testing::NotNull; - -TEST(ParseNarrowSignedIntegers, Sample) { - int16_t i16; - - EXPECT_FALSE(ParseNumber(nullptr, &i16)); - EXPECT_FALSE(ParseNumber("", &i16)); - EXPECT_FALSE(ParseNumber("0=", &i16)); - - EXPECT_TRUE(ParseNumber("0", &i16)); - EXPECT_EQ(0, i16); - EXPECT_TRUE(ParseNumber("32767", &i16)); - EXPECT_EQ(32767, i16); - EXPECT_TRUE(ParseNumber("-32768", &i16)); - EXPECT_EQ(-32768, i16); - EXPECT_TRUE(ParseNumber("-0", &i16)); - EXPECT_EQ(0, i16); - - // These are out of range, so they should return an error. - // The error code depends on whether this is an optional value. - EXPECT_FALSE(ParseNumber("32768", &i16)); - EXPECT_FALSE(ParseNumber("65535", &i16)); - - // Check hex parsing. - EXPECT_TRUE(ParseNumber("0x7fff", &i16)); - EXPECT_EQ(32767, i16); - // This is out of range. - EXPECT_FALSE(ParseNumber("0xffff", &i16)); -} - -TEST(ParseNarrowUnsignedIntegers, Sample) { - uint16_t u16; - - EXPECT_FALSE(ParseNumber(nullptr, &u16)); - EXPECT_FALSE(ParseNumber("", &u16)); - EXPECT_FALSE(ParseNumber("0=", &u16)); - - EXPECT_TRUE(ParseNumber("0", &u16)); - EXPECT_EQ(0, u16); - EXPECT_TRUE(ParseNumber("65535", &u16)); - EXPECT_EQ(65535, u16); - EXPECT_FALSE(ParseNumber("65536", &u16)); - - // We don't care about -0 since it's rejected at a higher level. - EXPECT_FALSE(ParseNumber("-1", &u16)); - EXPECT_TRUE(ParseNumber("0xffff", &u16)); - EXPECT_EQ(0xffff, u16); - EXPECT_FALSE(ParseNumber("0x10000", &u16)); -} - -TEST(ParseSignedIntegers, Sample) { - int32_t i32; - - // Invalid parse. - EXPECT_FALSE(ParseNumber(nullptr, &i32)); - EXPECT_FALSE(ParseNumber("", &i32)); - EXPECT_FALSE(ParseNumber("0=", &i32)); - - // Decimal values. - EXPECT_TRUE(ParseNumber("0", &i32)); - EXPECT_EQ(0, i32); - EXPECT_TRUE(ParseNumber("2147483647", &i32)); - EXPECT_EQ(std::numeric_limits::max(), i32); - EXPECT_FALSE(ParseNumber("2147483648", &i32)); - EXPECT_TRUE(ParseNumber("-0", &i32)); - EXPECT_EQ(0, i32); - EXPECT_TRUE(ParseNumber("-1", &i32)); - EXPECT_EQ(-1, i32); - EXPECT_TRUE(ParseNumber("-2147483648", &i32)); - EXPECT_EQ(std::numeric_limits::min(), i32); - - // Hex values. - EXPECT_TRUE(ParseNumber("0x7fffffff", &i32)); - EXPECT_EQ(std::numeric_limits::max(), i32); - EXPECT_FALSE(ParseNumber("0x80000000", &i32)); - EXPECT_TRUE(ParseNumber("-0x000", &i32)); - EXPECT_EQ(0, i32); - EXPECT_TRUE(ParseNumber("-0x001", &i32)); - EXPECT_EQ(-1, i32); - EXPECT_TRUE(ParseNumber("-0x80000000", &i32)); - EXPECT_EQ(std::numeric_limits::min(), i32); -} - -TEST(ParseUnsignedIntegers, Sample) { - uint32_t u32; - - // Invalid parse. - EXPECT_FALSE(ParseNumber(nullptr, &u32)); - EXPECT_FALSE(ParseNumber("", &u32)); - EXPECT_FALSE(ParseNumber("0=", &u32)); - - // Valid values. - EXPECT_TRUE(ParseNumber("0", &u32)); - EXPECT_EQ(0u, u32); - EXPECT_TRUE(ParseNumber("4294967295", &u32)); - EXPECT_EQ(std::numeric_limits::max(), u32); - EXPECT_FALSE(ParseNumber("4294967296", &u32)); - - // Hex values. - EXPECT_TRUE(ParseNumber("0xffffffff", &u32)); - EXPECT_EQ(std::numeric_limits::max(), u32); - - // We don't care about -0 since it's rejected at a higher level. - EXPECT_FALSE(ParseNumber("-1", &u32)); -} - -TEST(ParseWideSignedIntegers, Sample) { - int64_t i64; - EXPECT_FALSE(ParseNumber(nullptr, &i64)); - EXPECT_FALSE(ParseNumber("", &i64)); - EXPECT_FALSE(ParseNumber("0=", &i64)); - EXPECT_TRUE(ParseNumber("0", &i64)); - EXPECT_EQ(0, i64); - EXPECT_TRUE(ParseNumber("0x7fffffffffffffff", &i64)); - EXPECT_EQ(0x7fffffffffffffff, i64); - EXPECT_TRUE(ParseNumber("-0", &i64)); - EXPECT_EQ(0, i64); - EXPECT_TRUE(ParseNumber("-1", &i64)); - EXPECT_EQ(-1, i64); -} - -TEST(ParseWideUnsignedIntegers, Sample) { - uint64_t u64; - EXPECT_FALSE(ParseNumber(nullptr, &u64)); - EXPECT_FALSE(ParseNumber("", &u64)); - EXPECT_FALSE(ParseNumber("0=", &u64)); - EXPECT_TRUE(ParseNumber("0", &u64)); - EXPECT_EQ(0u, u64); - EXPECT_TRUE(ParseNumber("0xffffffffffffffff", &u64)); - EXPECT_EQ(0xffffffffffffffffULL, u64); - - // We don't care about -0 since it's rejected at a higher level. - EXPECT_FALSE(ParseNumber("-1", &u64)); -} - -TEST(ParseFloat, Sample) { - float f; - - EXPECT_FALSE(ParseNumber(nullptr, &f)); - EXPECT_FALSE(ParseNumber("", &f)); - EXPECT_FALSE(ParseNumber("0=", &f)); - - // These values are exactly representatble. - EXPECT_TRUE(ParseNumber("0", &f)); - EXPECT_EQ(0.0f, f); - EXPECT_TRUE(ParseNumber("42", &f)); - EXPECT_EQ(42.0f, f); - EXPECT_TRUE(ParseNumber("2.5", &f)); - EXPECT_EQ(2.5f, f); - EXPECT_TRUE(ParseNumber("-32.5", &f)); - EXPECT_EQ(-32.5f, f); - EXPECT_TRUE(ParseNumber("1e38", &f)); - EXPECT_EQ(1e38f, f); - EXPECT_TRUE(ParseNumber("-1e38", &f)); - EXPECT_EQ(-1e38f, f); -} - -TEST(ParseFloat, Overflow) { - // The assembler parses using HexFloat>. Make - // sure that succeeds for in-range values, and fails for out of - // range values. When it does overflow, the value is set to the - // nearest finite value, matching C++11 behavior for operator>> - // on floating point. - spvutils::HexFloat> f(0.0f); - - EXPECT_TRUE(ParseNumber("1e38", &f)); - EXPECT_EQ(1e38f, f.value().getAsFloat()); - EXPECT_TRUE(ParseNumber("-1e38", &f)); - EXPECT_EQ(-1e38f, f.value().getAsFloat()); - EXPECT_FALSE(ParseNumber("1e40", &f)); - EXPECT_FALSE(ParseNumber("-1e40", &f)); - EXPECT_FALSE(ParseNumber("1e400", &f)); - EXPECT_FALSE(ParseNumber("-1e400", &f)); -} - -TEST(ParseDouble, Sample) { - double f; - - EXPECT_FALSE(ParseNumber(nullptr, &f)); - EXPECT_FALSE(ParseNumber("", &f)); - EXPECT_FALSE(ParseNumber("0=", &f)); - - // These values are exactly representatble. - EXPECT_TRUE(ParseNumber("0", &f)); - EXPECT_EQ(0.0, f); - EXPECT_TRUE(ParseNumber("42", &f)); - EXPECT_EQ(42.0, f); - EXPECT_TRUE(ParseNumber("2.5", &f)); - EXPECT_EQ(2.5, f); - EXPECT_TRUE(ParseNumber("-32.5", &f)); - EXPECT_EQ(-32.5, f); - EXPECT_TRUE(ParseNumber("1e38", &f)); - EXPECT_EQ(1e38, f); - EXPECT_TRUE(ParseNumber("-1e38", &f)); - EXPECT_EQ(-1e38, f); - // These are out of range for 32-bit float, but in range for 64-bit float. - EXPECT_TRUE(ParseNumber("1e40", &f)); - EXPECT_EQ(1e40, f); - EXPECT_TRUE(ParseNumber("-1e40", &f)); - EXPECT_EQ(-1e40, f); -} - -TEST(ParseDouble, Overflow) { - // The assembler parses using HexFloat>. Make - // sure that succeeds for in-range values, and fails for out of - // range values. When it does overflow, the value is set to the - // nearest finite value, matching C++11 behavior for operator>> - // on floating point. - spvutils::HexFloat> f(0.0); - - EXPECT_TRUE(ParseNumber("1e38", &f)); - EXPECT_EQ(1e38, f.value().getAsFloat()); - EXPECT_TRUE(ParseNumber("-1e38", &f)); - EXPECT_EQ(-1e38, f.value().getAsFloat()); - EXPECT_TRUE(ParseNumber("1e40", &f)); - EXPECT_EQ(1e40, f.value().getAsFloat()); - EXPECT_TRUE(ParseNumber("-1e40", &f)); - EXPECT_EQ(-1e40, f.value().getAsFloat()); - EXPECT_FALSE(ParseNumber("1e400", &f)); - EXPECT_FALSE(ParseNumber("-1e400", &f)); -} - -TEST(ParseFloat16, Overflow) { - // The assembler parses using HexFloat>. Make - // sure that succeeds for in-range values, and fails for out of - // range values. When it does overflow, the value is set to the - // nearest finite value, matching C++11 behavior for operator>> - // on floating point. - spvutils::HexFloat> f(0); - - EXPECT_FALSE(ParseNumber(nullptr, &f)); - EXPECT_TRUE(ParseNumber("-0.0", &f)); - EXPECT_EQ(uint16_t{0x8000}, f.value().getAsFloat().get_value()); - EXPECT_TRUE(ParseNumber("1.0", &f)); - EXPECT_EQ(uint16_t{0x3c00}, f.value().getAsFloat().get_value()); - - // Overflows 16-bit but not 32-bit - EXPECT_FALSE(ParseNumber("1e38", &f)); - EXPECT_FALSE(ParseNumber("-1e38", &f)); - - // Overflows 32-bit but not 64-bit - EXPECT_FALSE(ParseNumber("1e40", &f)); - EXPECT_FALSE(ParseNumber("-1e40", &f)); - - // Overflows 64-bit - EXPECT_FALSE(ParseNumber("1e400", &f)); - EXPECT_FALSE(ParseNumber("-1e400", &f)); -} - -void AssertEmitFunc(uint32_t) { - ASSERT_FALSE(true) - << "Should not call emit() function when the number can not be parsed."; - return; -} - -TEST(ParseAndEncodeNarrowSignedIntegers, Invalid) { - // The error message should be overwritten after each parsing call. - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - std::string err_msg; - NumberType type = {16, SPV_NUMBER_SIGNED_INT}; - - rc = ParseAndEncodeIntegerNumber(nullptr, type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("The given text is a nullptr", err_msg); - rc = ParseAndEncodeIntegerNumber("", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: ", err_msg); - rc = ParseAndEncodeIntegerNumber("=", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: =", err_msg); - rc = ParseAndEncodeIntegerNumber("-", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid signed integer literal: -", err_msg); - rc = ParseAndEncodeIntegerNumber("0=", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: 0=", err_msg); -} - -TEST(ParseAndEncodeNarrowSignedIntegers, Overflow) { - // The error message should be overwritten after each parsing call. - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - std::string err_msg; - NumberType type = {16, SPV_NUMBER_SIGNED_INT}; - - rc = ParseAndEncodeIntegerNumber("32768", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Integer 32768 does not fit in a 16-bit signed integer", err_msg); - rc = ParseAndEncodeIntegerNumber("-32769", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Integer -32769 does not fit in a 16-bit signed integer", err_msg); -} - -TEST(ParseAndEncodeNarrowSignedIntegers, Success) { - // Don't care the error message in this case. - EncodeNumberStatus rc = EncodeNumberStatus::kInvalidText; - NumberType type = {16, SPV_NUMBER_SIGNED_INT}; - - // Zero, maximum, and minimum value - rc = ParseAndEncodeIntegerNumber( - "0", type, [](uint32_t word) { EXPECT_EQ(0u, word); }, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeIntegerNumber( - "-0", type, [](uint32_t word) { EXPECT_EQ(0u, word); }, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeIntegerNumber( - "32767", type, [](uint32_t word) { EXPECT_EQ(0x00007fffu, word); }, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeIntegerNumber( - "-32768", type, [](uint32_t word) { EXPECT_EQ(0xffff8000u, word); }, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - - // Hex parsing - rc = ParseAndEncodeIntegerNumber( - "0x7fff", type, [](uint32_t word) { EXPECT_EQ(0x00007fffu, word); }, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeIntegerNumber( - "0xffff", type, [](uint32_t word) { EXPECT_EQ(0xffffffffu, word); }, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); -} - -TEST(ParseAndEncodeNarrowUnsignedIntegers, Invalid) { - // The error message should be overwritten after each parsing call. - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - std::string err_msg; - NumberType type = {16, SPV_NUMBER_UNSIGNED_INT}; - - rc = ParseAndEncodeIntegerNumber(nullptr, type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("The given text is a nullptr", err_msg); - rc = ParseAndEncodeIntegerNumber("", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: ", err_msg); - rc = ParseAndEncodeIntegerNumber("=", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: =", err_msg); - rc = ParseAndEncodeIntegerNumber("-", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); - EXPECT_EQ("Cannot put a negative number in an unsigned literal", err_msg); - rc = ParseAndEncodeIntegerNumber("0=", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: 0=", err_msg); - rc = ParseAndEncodeIntegerNumber("-0", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); - EXPECT_EQ("Cannot put a negative number in an unsigned literal", err_msg); - rc = ParseAndEncodeIntegerNumber("-1", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); - EXPECT_EQ("Cannot put a negative number in an unsigned literal", err_msg); -} - -TEST(ParseAndEncodeNarrowUnsignedIntegers, Overflow) { - // The error message should be overwritten after each parsing call. - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - std::string err_msg("random content"); - NumberType type = {16, SPV_NUMBER_UNSIGNED_INT}; - - // Overflow - rc = ParseAndEncodeIntegerNumber("65536", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Integer 65536 does not fit in a 16-bit unsigned integer", err_msg); -} - -TEST(ParseAndEncodeNarrowUnsignedIntegers, Success) { - // Don't care the error message in this case. - EncodeNumberStatus rc = EncodeNumberStatus::kInvalidText; - NumberType type = {16, SPV_NUMBER_UNSIGNED_INT}; - - // Zero, maximum, and minimum value - rc = ParseAndEncodeIntegerNumber( - "0", type, [](uint32_t word) { EXPECT_EQ(0u, word); }, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeIntegerNumber( - "65535", type, [](uint32_t word) { EXPECT_EQ(0x0000ffffu, word); }, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - - // Hex parsing - rc = ParseAndEncodeIntegerNumber( - "0xffff", type, [](uint32_t word) { EXPECT_EQ(0x0000ffffu, word); }, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); -} - -TEST(ParseAndEncodeSignedIntegers, Invalid) { - // The error message should be overwritten after each parsing call. - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - std::string err_msg; - NumberType type = {32, SPV_NUMBER_SIGNED_INT}; - - rc = ParseAndEncodeIntegerNumber(nullptr, type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("The given text is a nullptr", err_msg); - rc = ParseAndEncodeIntegerNumber("", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: ", err_msg); - rc = ParseAndEncodeIntegerNumber("=", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: =", err_msg); - rc = ParseAndEncodeIntegerNumber("-", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid signed integer literal: -", err_msg); - rc = ParseAndEncodeIntegerNumber("0=", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: 0=", err_msg); -} - -TEST(ParseAndEncodeSignedIntegers, Overflow) { - // The error message should be overwritten after each parsing call. - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - std::string err_msg; - NumberType type = {32, SPV_NUMBER_SIGNED_INT}; - - rc = - ParseAndEncodeIntegerNumber("2147483648", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Integer 2147483648 does not fit in a 32-bit signed integer", - err_msg); - rc = ParseAndEncodeIntegerNumber("-2147483649", type, AssertEmitFunc, - &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Integer -2147483649 does not fit in a 32-bit signed integer", - err_msg); -} - -TEST(ParseAndEncodeSignedIntegers, Success) { - // Don't care the error message in this case. - EncodeNumberStatus rc = EncodeNumberStatus::kInvalidText; - NumberType type = {32, SPV_NUMBER_SIGNED_INT}; - - // Zero, maximum, and minimum value - rc = ParseAndEncodeIntegerNumber( - "0", type, [](uint32_t word) { EXPECT_EQ(0u, word); }, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeIntegerNumber( - "-0", type, [](uint32_t word) { EXPECT_EQ(0u, word); }, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeIntegerNumber( - "2147483647", type, [](uint32_t word) { EXPECT_EQ(0x7fffffffu, word); }, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeIntegerNumber( - "-2147483648", type, [](uint32_t word) { EXPECT_EQ(0x80000000u, word); }, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - - // Hex parsing - rc = ParseAndEncodeIntegerNumber( - "0x7fffffff", type, [](uint32_t word) { EXPECT_EQ(0x7fffffffu, word); }, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeIntegerNumber( - "0xffffffff", type, [](uint32_t word) { EXPECT_EQ(0xffffffffu, word); }, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); -} - -TEST(ParseAndEncodeUnsignedIntegers, Invalid) { - // The error message should be overwritten after each parsing call. - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - std::string err_msg; - NumberType type = {32, SPV_NUMBER_UNSIGNED_INT}; - - rc = ParseAndEncodeIntegerNumber(nullptr, type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("The given text is a nullptr", err_msg); - rc = ParseAndEncodeIntegerNumber("", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: ", err_msg); - rc = ParseAndEncodeIntegerNumber("=", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: =", err_msg); - rc = ParseAndEncodeIntegerNumber("-", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); - EXPECT_EQ("Cannot put a negative number in an unsigned literal", err_msg); - rc = ParseAndEncodeIntegerNumber("0=", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: 0=", err_msg); - rc = ParseAndEncodeIntegerNumber("-0", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); - EXPECT_EQ("Cannot put a negative number in an unsigned literal", err_msg); - rc = ParseAndEncodeIntegerNumber("-1", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); - EXPECT_EQ("Cannot put a negative number in an unsigned literal", err_msg); -} - -TEST(ParseAndEncodeUnsignedIntegers, Overflow) { - // The error message should be overwritten after each parsing call. - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - std::string err_msg("random content"); - NumberType type = {32, SPV_NUMBER_UNSIGNED_INT}; - - // Overflow - rc = - ParseAndEncodeIntegerNumber("4294967296", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Integer 4294967296 does not fit in a 32-bit unsigned integer", - err_msg); -} - -TEST(ParseAndEncodeUnsignedIntegers, Success) { - // Don't care the error message in this case. - EncodeNumberStatus rc = EncodeNumberStatus::kInvalidText; - NumberType type = {32, SPV_NUMBER_UNSIGNED_INT}; - - // Zero, maximum, and minimum value - rc = ParseAndEncodeIntegerNumber( - "0", type, [](uint32_t word) { EXPECT_EQ(0u, word); }, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeIntegerNumber( - "4294967295", type, [](uint32_t word) { EXPECT_EQ(0xffffffffu, word); }, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - - // Hex parsing - rc = ParseAndEncodeIntegerNumber( - "0xffffffff", type, [](uint32_t word) { EXPECT_EQ(0xffffffffu, word); }, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); -} - -TEST(ParseAndEncodeWideSignedIntegers, Invalid) { - // The error message should be overwritten after each parsing call. - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - std::string err_msg; - NumberType type = {64, SPV_NUMBER_SIGNED_INT}; - - rc = ParseAndEncodeIntegerNumber(nullptr, type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("The given text is a nullptr", err_msg); - rc = ParseAndEncodeIntegerNumber("", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: ", err_msg); - rc = ParseAndEncodeIntegerNumber("=", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: =", err_msg); - rc = ParseAndEncodeIntegerNumber("-", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid signed integer literal: -", err_msg); - rc = ParseAndEncodeIntegerNumber("0=", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: 0=", err_msg); -} - -TEST(ParseAndEncodeWideSignedIntegers, Overflow) { - // The error message should be overwritten after each parsing call. - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - std::string err_msg; - NumberType type = {64, SPV_NUMBER_SIGNED_INT}; - - rc = ParseAndEncodeIntegerNumber("9223372036854775808", type, AssertEmitFunc, - &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ( - "Integer 9223372036854775808 does not fit in a 64-bit signed integer", - err_msg); - rc = ParseAndEncodeIntegerNumber("-9223372036854775809", type, AssertEmitFunc, - &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid signed integer literal: -9223372036854775809", err_msg); -} - -TEST(ParseAndEncodeWideSignedIntegers, Success) { - // Don't care the error message in this case. - EncodeNumberStatus rc = EncodeNumberStatus::kInvalidText; - NumberType type = {64, SPV_NUMBER_SIGNED_INT}; - std::vector word_buffer; - auto emit = [&word_buffer](uint32_t word) { - if (word_buffer.size() == 2) word_buffer.clear(); - word_buffer.push_back(word); - }; - - // Zero, maximum, and minimum value - rc = ParseAndEncodeIntegerNumber("0", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0u, 0u})); - rc = ParseAndEncodeIntegerNumber("-0", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0u, 0u})); - rc = ParseAndEncodeIntegerNumber("9223372036854775807", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0xffffffffu, 0x7fffffffu})); - rc = ParseAndEncodeIntegerNumber("-9223372036854775808", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0u, 0x80000000u})); - rc = ParseAndEncodeIntegerNumber("-1", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0xffffffffu, 0xffffffffu})); - - // Hex parsing - rc = ParseAndEncodeIntegerNumber("0x7fffffffffffffff", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0xffffffffu, 0x7fffffffu})); - rc = ParseAndEncodeIntegerNumber("0xffffffffffffffff", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0xffffffffu, 0xffffffffu})); -} - -TEST(ParseAndEncodeWideUnsignedIntegers, Invalid) { - // The error message should be overwritten after each parsing call. - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - std::string err_msg; - NumberType type = {64, SPV_NUMBER_UNSIGNED_INT}; - - // Invalid - rc = ParseAndEncodeIntegerNumber(nullptr, type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("The given text is a nullptr", err_msg); - rc = ParseAndEncodeIntegerNumber("", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: ", err_msg); - rc = ParseAndEncodeIntegerNumber("=", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: =", err_msg); - rc = ParseAndEncodeIntegerNumber("-", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); - EXPECT_EQ("Cannot put a negative number in an unsigned literal", err_msg); - rc = ParseAndEncodeIntegerNumber("0=", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: 0=", err_msg); - rc = ParseAndEncodeIntegerNumber("-0", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); - EXPECT_EQ("Cannot put a negative number in an unsigned literal", err_msg); - rc = ParseAndEncodeIntegerNumber("-1", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); - EXPECT_EQ("Cannot put a negative number in an unsigned literal", err_msg); -} - -TEST(ParseAndEncodeWideUnsignedIntegers, Overflow) { - // The error message should be overwritten after each parsing call. - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - std::string err_msg; - NumberType type = {64, SPV_NUMBER_UNSIGNED_INT}; - - // Overflow - rc = ParseAndEncodeIntegerNumber("18446744073709551616", type, AssertEmitFunc, - &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: 18446744073709551616", err_msg); -} - -TEST(ParseAndEncodeWideUnsignedIntegers, Success) { - // Don't care the error message in this case. - EncodeNumberStatus rc = EncodeNumberStatus::kInvalidText; - NumberType type = {64, SPV_NUMBER_UNSIGNED_INT}; - std::vector word_buffer; - auto emit = [&word_buffer](uint32_t word) { - if (word_buffer.size() == 2) word_buffer.clear(); - word_buffer.push_back(word); - }; - - // Zero, maximum, and minimum value - rc = ParseAndEncodeIntegerNumber("0", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0u, 0u})); - rc = ParseAndEncodeIntegerNumber("18446744073709551615", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0xffffffffu, 0xffffffffu})); - - // Hex parsing - rc = ParseAndEncodeIntegerNumber("0xffffffffffffffff", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0xffffffffu, 0xffffffffu})); -} - -TEST(ParseAndEncodeIntegerNumber, TypeNone) { - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - std::string err_msg; - NumberType type = {32, SPV_NUMBER_NONE}; - - rc = ParseAndEncodeIntegerNumber( - "0.0", type, [](uint32_t word) { EXPECT_EQ(0x0u, word); }, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); - EXPECT_EQ("The expected type is not a integer type", err_msg); -} - -TEST(ParseAndEncodeIntegerNumber, InvalidCaseWithoutErrorMessageString) { - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - NumberType type = {32, SPV_NUMBER_SIGNED_INT}; - - rc = ParseAndEncodeIntegerNumber("invalid", type, AssertEmitFunc, nullptr); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); -} - -TEST(ParseAndEncodeIntegerNumber, DoNotTouchErrorMessageStringOnSuccess) { - EncodeNumberStatus rc = EncodeNumberStatus::kInvalidText; - std::string err_msg("random content"); - NumberType type = {32, SPV_NUMBER_SIGNED_INT}; - - rc = ParseAndEncodeIntegerNumber( - "100", type, [](uint32_t word) { EXPECT_EQ(100u, word); }, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_EQ("random content", err_msg); -} - -TEST(ParseAndEncodeFloat, Sample) { - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - std::string err_msg; - NumberType type = {32, SPV_NUMBER_FLOATING}; - - // Invalid - rc = ParseAndEncodeFloatingPointNumber("", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid 32-bit float literal: ", err_msg); - rc = ParseAndEncodeFloatingPointNumber("0=", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid 32-bit float literal: 0=", err_msg); - - // Representative samples - rc = ParseAndEncodeFloatingPointNumber( - "0.0", type, [](uint32_t word) { EXPECT_EQ(0x0u, word); }, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeFloatingPointNumber( - "-0.0", type, [](uint32_t word) { EXPECT_EQ(0x80000000u, word); }, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeFloatingPointNumber( - "42", type, [](uint32_t word) { EXPECT_EQ(0x42280000u, word); }, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeFloatingPointNumber( - "2.5", type, [](uint32_t word) { EXPECT_EQ(0x40200000u, word); }, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeFloatingPointNumber( - "-32.5", type, [](uint32_t word) { EXPECT_EQ(0xc2020000u, word); }, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeFloatingPointNumber( - "1e38", type, [](uint32_t word) { EXPECT_EQ(0x7e967699u, word); }, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeFloatingPointNumber( - "-1e38", type, [](uint32_t word) { EXPECT_EQ(0xfe967699u, word); }, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - - // Overflow - rc = - ParseAndEncodeFloatingPointNumber("1e40", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid 32-bit float literal: 1e40", err_msg); - rc = ParseAndEncodeFloatingPointNumber("-1e40", type, AssertEmitFunc, - &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid 32-bit float literal: -1e40", err_msg); - rc = ParseAndEncodeFloatingPointNumber("1e400", type, AssertEmitFunc, - &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid 32-bit float literal: 1e400", err_msg); - rc = ParseAndEncodeFloatingPointNumber("-1e400", type, AssertEmitFunc, - &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid 32-bit float literal: -1e400", err_msg); -} - -TEST(ParseAndEncodeDouble, Sample) { - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - std::string err_msg; - NumberType type = {64, SPV_NUMBER_FLOATING}; - std::vector word_buffer; - auto emit = [&word_buffer](uint32_t word) { - if (word_buffer.size() == 2) word_buffer.clear(); - word_buffer.push_back(word); - }; - - // Invalid - rc = ParseAndEncodeFloatingPointNumber("", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid 64-bit float literal: ", err_msg); - rc = ParseAndEncodeFloatingPointNumber("0=", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid 64-bit float literal: 0=", err_msg); - - // Representative samples - rc = ParseAndEncodeFloatingPointNumber("0.0", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0u, 0u})); - rc = ParseAndEncodeFloatingPointNumber("-0.0", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0u, 0x80000000u})); - rc = ParseAndEncodeFloatingPointNumber("42", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0u, 0x40450000u})); - rc = ParseAndEncodeFloatingPointNumber("2.5", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0u, 0x40040000u})); - rc = ParseAndEncodeFloatingPointNumber("32.5", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0u, 0x40404000u})); - rc = ParseAndEncodeFloatingPointNumber("1e38", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0x2a16a1b1u, 0x47d2ced3u})); - rc = ParseAndEncodeFloatingPointNumber("-1e38", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0x2a16a1b1u, 0xc7d2ced3u})); - rc = ParseAndEncodeFloatingPointNumber("1e40", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0xf1c35ca5u, 0x483d6329u})); - rc = ParseAndEncodeFloatingPointNumber("-1e40", type, emit, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_THAT(word_buffer, Eq(std::vector{0xf1c35ca5u, 0xc83d6329u})); - - // Overflow - rc = ParseAndEncodeFloatingPointNumber("1e400", type, AssertEmitFunc, - &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid 64-bit float literal: 1e400", err_msg); - rc = ParseAndEncodeFloatingPointNumber("-1e400", type, AssertEmitFunc, - &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid 64-bit float literal: -1e400", err_msg); -} - -TEST(ParseAndEncodeFloat16, Sample) { - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - std::string err_msg; - NumberType type = {16, SPV_NUMBER_FLOATING}; - - // Invalid - rc = ParseAndEncodeFloatingPointNumber("", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid 16-bit float literal: ", err_msg); - rc = ParseAndEncodeFloatingPointNumber("0=", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid 16-bit float literal: 0=", err_msg); - - // Representative samples - rc = ParseAndEncodeFloatingPointNumber( - "0.0", type, [](uint32_t word) { EXPECT_EQ(0x0u, word); }, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeFloatingPointNumber( - "-0.0", type, [](uint32_t word) { EXPECT_EQ(0x8000u, word); }, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeFloatingPointNumber( - "1.0", type, [](uint32_t word) { EXPECT_EQ(0x3c00u, word); }, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeFloatingPointNumber( - "2.5", type, [](uint32_t word) { EXPECT_EQ(0x4100u, word); }, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - rc = ParseAndEncodeFloatingPointNumber( - "32.5", type, [](uint32_t word) { EXPECT_EQ(0x5010u, word); }, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - - // Overflow - rc = - ParseAndEncodeFloatingPointNumber("1e38", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid 16-bit float literal: 1e38", err_msg); - rc = ParseAndEncodeFloatingPointNumber("-1e38", type, AssertEmitFunc, - &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid 16-bit float literal: -1e38", err_msg); - rc = - ParseAndEncodeFloatingPointNumber("1e40", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid 16-bit float literal: 1e40", err_msg); - rc = ParseAndEncodeFloatingPointNumber("-1e40", type, AssertEmitFunc, - &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid 16-bit float literal: -1e40", err_msg); - rc = ParseAndEncodeFloatingPointNumber("1e400", type, AssertEmitFunc, - &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid 16-bit float literal: 1e400", err_msg); - rc = ParseAndEncodeFloatingPointNumber("-1e400", type, AssertEmitFunc, - &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid 16-bit float literal: -1e400", err_msg); -} - -TEST(ParseAndEncodeFloatingPointNumber, TypeNone) { - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - std::string err_msg; - NumberType type = {32, SPV_NUMBER_NONE}; - - rc = ParseAndEncodeFloatingPointNumber( - "0.0", type, [](uint32_t word) { EXPECT_EQ(0x0u, word); }, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidUsage, rc); - EXPECT_EQ("The expected type is not a float type", err_msg); -} - -TEST(ParseAndEncodeFloatingPointNumber, InvalidCaseWithoutErrorMessageString) { - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - NumberType type = {32, SPV_NUMBER_FLOATING}; - - rc = ParseAndEncodeFloatingPointNumber("invalid", type, AssertEmitFunc, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); -} - -TEST(ParseAndEncodeFloatingPointNumber, DoNotTouchErrorMessageStringOnSuccess) { - EncodeNumberStatus rc = EncodeNumberStatus::kInvalidText; - std::string err_msg("random content"); - NumberType type = {32, SPV_NUMBER_FLOATING}; - - rc = ParseAndEncodeFloatingPointNumber( - "0.0", type, [](uint32_t word) { EXPECT_EQ(0x0u, word); }, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_EQ("random content", err_msg); -} - -TEST(ParseAndEncodeNumber, Sample) { - EncodeNumberStatus rc = EncodeNumberStatus::kSuccess; - std::string err_msg; - NumberType type = {32, SPV_NUMBER_SIGNED_INT}; - - // Invalid with error message string - rc = ParseAndEncodeNumber("something wrong", type, AssertEmitFunc, &err_msg); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - EXPECT_EQ("Invalid unsigned integer literal: something wrong", err_msg); - - // Invalid without error message string - rc = ParseAndEncodeNumber("something wrong", type, AssertEmitFunc, nullptr); - EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc); - - // Signed integer, should not touch the error message string. - err_msg = "random content"; - rc = ParseAndEncodeNumber("-1", type, - [](uint32_t word) { EXPECT_EQ(0xffffffffu, word); }, - &err_msg); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - EXPECT_EQ("random content", err_msg); - - // Unsigned integer - type = {32, SPV_NUMBER_UNSIGNED_INT}; - rc = ParseAndEncodeNumber( - "1", type, [](uint32_t word) { EXPECT_EQ(1u, word); }, nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); - - // Float - type = {32, SPV_NUMBER_FLOATING}; - rc = ParseAndEncodeNumber("-1.0", type, - [](uint32_t word) { EXPECT_EQ(0xbf800000, word); }, - nullptr); - EXPECT_EQ(EncodeNumberStatus::kSuccess, rc); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/preserve_numeric_ids_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/preserve_numeric_ids_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/preserve_numeric_ids_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/preserve_numeric_ids_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,158 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Tests for unique type declaration rules validator. - -#include - -#include "source/text.h" -#include "source/text_handler.h" -#include "test_fixture.h" - -namespace { - -using spvtest::ScopedContext; - -// Converts code to binary and then back to text. -spv_result_t ToBinaryAndBack( - const std::string& before, std::string* after, - uint32_t text_to_binary_options = SPV_TEXT_TO_BINARY_OPTION_NONE, - uint32_t binary_to_text_options = SPV_BINARY_TO_TEXT_OPTION_NONE, - spv_target_env env = SPV_ENV_UNIVERSAL_1_0) { - ScopedContext ctx(env); - spv_binary binary; - spv_text text; - - spv_result_t result = spvTextToBinaryWithOptions( - ctx.context, before.c_str(), before.size(), text_to_binary_options, - &binary, nullptr); - if (result != SPV_SUCCESS) { - return result; - } - - result = spvBinaryToText( - ctx.context, binary->code, binary->wordCount, binary_to_text_options, - &text, nullptr); - if (result != SPV_SUCCESS) { - return result; - } - - *after = std::string(text->str, text->length); - - spvBinaryDestroy(binary); - spvTextDestroy(text); - - return SPV_SUCCESS; -} - -TEST(ToBinaryAndBack, DontPreserveNumericIds) { - const std::string before = -R"(OpCapability Addresses -OpCapability Kernel -OpCapability GenericPointer -OpCapability Linkage -OpMemoryModel Physical32 OpenCL -%i32 = OpTypeInt 32 1 -%u32 = OpTypeInt 32 0 -%f32 = OpTypeFloat 32 -%200 = OpTypeVoid -%300 = OpTypeFunction %200 -%main = OpFunction %200 None %300 -%entry = OpLabel -%100 = OpConstant %u32 100 -%1 = OpConstant %u32 200 -%2 = OpConstant %u32 300 -OpReturn -OpFunctionEnd -)"; - - const std::string expected = -R"(OpCapability Addresses -OpCapability Kernel -OpCapability GenericPointer -OpCapability Linkage -OpMemoryModel Physical32 OpenCL -%1 = OpTypeInt 32 1 -%2 = OpTypeInt 32 0 -%3 = OpTypeFloat 32 -%4 = OpTypeVoid -%5 = OpTypeFunction %4 -%6 = OpFunction %4 None %5 -%7 = OpLabel -%8 = OpConstant %2 100 -%9 = OpConstant %2 200 -%10 = OpConstant %2 300 -OpReturn -OpFunctionEnd -)"; - - std::string after; - EXPECT_EQ(SPV_SUCCESS, ToBinaryAndBack(before, &after, - SPV_TEXT_TO_BINARY_OPTION_NONE, - SPV_BINARY_TO_TEXT_OPTION_NO_HEADER)); - - EXPECT_EQ(expected, after); -} - -TEST(TextHandler, PreserveNumericIds) { - const std::string before = -R"(OpCapability Addresses -OpCapability Kernel -OpCapability GenericPointer -OpCapability Linkage -OpMemoryModel Physical32 OpenCL -%i32 = OpTypeInt 32 1 -%u32 = OpTypeInt 32 0 -%f32 = OpTypeFloat 32 -%200 = OpTypeVoid -%300 = OpTypeFunction %200 -%main = OpFunction %200 None %300 -%entry = OpLabel -%100 = OpConstant %u32 100 -%1 = OpConstant %u32 200 -%2 = OpConstant %u32 300 -OpReturn -OpFunctionEnd -)"; - - const std::string expected = -R"(OpCapability Addresses -OpCapability Kernel -OpCapability GenericPointer -OpCapability Linkage -OpMemoryModel Physical32 OpenCL -%3 = OpTypeInt 32 1 -%4 = OpTypeInt 32 0 -%5 = OpTypeFloat 32 -%200 = OpTypeVoid -%300 = OpTypeFunction %200 -%6 = OpFunction %200 None %300 -%7 = OpLabel -%100 = OpConstant %4 100 -%1 = OpConstant %4 200 -%2 = OpConstant %4 300 -OpReturn -OpFunctionEnd -)"; - - std::string after; - EXPECT_EQ(SPV_SUCCESS, - ToBinaryAndBack(before, &after, - SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS, - SPV_BINARY_TO_TEXT_OPTION_NO_HEADER)); - - EXPECT_EQ(expected, after); -} - -} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/scripts/test_compact_ids.py vulkan-1.1.73+dfsg/external/spirv-tools/test/scripts/test_compact_ids.py --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/scripts/test_compact_ids.py 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/scripts/test_compact_ids.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,102 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2017 Google 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. -"""Tests correctness of opt pass tools/opt --compact-ids.""" - -from __future__ import print_function - -import os.path -import sys -import tempfile - -def test_spirv_file(path, temp_dir): - optimized_spv_path = os.path.join(temp_dir, 'optimized.spv') - optimized_dis_path = os.path.join(temp_dir, 'optimized.dis') - converted_spv_path = os.path.join(temp_dir, 'converted.spv') - converted_dis_path = os.path.join(temp_dir, 'converted.dis') - - os.system('tools/spirv-opt ' + path + ' -o ' + optimized_spv_path + - ' --compact-ids') - os.system('tools/spirv-dis ' + optimized_spv_path + ' -o ' + - optimized_dis_path) - - os.system('tools/spirv-dis ' + path + ' -o ' + converted_dis_path) - os.system('tools/spirv-as ' + converted_dis_path + ' -o ' + - converted_spv_path) - os.system('tools/spirv-dis ' + converted_spv_path + ' -o ' + - converted_dis_path) - - with open(converted_dis_path, 'r') as f: - converted_dis = f.readlines()[3:] - - with open(optimized_dis_path, 'r') as f: - optimized_dis = f.readlines()[3:] - - return converted_dis == optimized_dis - -def print_usage(): - template= \ -"""{script} tests correctness of opt pass tools/opt --compact-ids - -USAGE: python {script} [] - -Requires tools/spirv-dis, tools/spirv-as and tools/spirv-opt to be in path -(call the script from the SPIRV-Tools build output directory). - -TIP: In order to test all .spv files under current dir use -find -name "*.spv" -print0 | xargs -0 -s 2000000 python {script} -""" - print(template.format(script=sys.argv[0])); - -def main(): - if not os.path.isfile('tools/spirv-dis'): - print('error: tools/spirv-dis not found') - print_usage() - exit(1) - - if not os.path.isfile('tools/spirv-as'): - print('error: tools/spirv-as not found') - print_usage() - exit(1) - - if not os.path.isfile('tools/spirv-opt'): - print('error: tools/spirv-opt not found') - print_usage() - exit(1) - - paths = sys.argv[1:] - if not paths: - print_usage() - - num_failed = 0 - - temp_dir = tempfile.mkdtemp() - - for path in paths: - success = test_spirv_file(path, temp_dir) - if not success: - print('Test failed for ' + path) - num_failed += 1 - - print('Tested ' + str(len(paths)) + ' files') - - if num_failed: - print(str(num_failed) + ' tests failed') - exit(1) - else: - print('All tests successful') - exit(0) - -if __name__ == '__main__': - main() diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/software_version_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/software_version_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/software_version_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/software_version_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -// Copyright (c) 2015-2016 Google 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. - -#include "unit_spirv.h" - -#include - -#include "gmock/gmock.h" - -using ::testing::AnyOf; -using ::testing::Eq; -using ::testing::Ge; -using ::testing::StartsWith; - -namespace { - -void CheckFormOfHighLevelVersion(const std::string& version) { - std::istringstream s(version); - char v = 'x'; - int year = -1; - char period = 'x'; - int index = -1; - s >> v >> year >> period >> index; - EXPECT_THAT(v, Eq('v')); - EXPECT_THAT(year, Ge(2016)); - EXPECT_THAT(period, Eq('.')); - EXPECT_THAT(index, Ge(0)); - EXPECT_TRUE(s.good() || s.eof()); - - std::string rest; - s >> rest; - EXPECT_THAT(rest, AnyOf("", "-dev")); -} - -TEST(SoftwareVersion, ShortIsCorrectForm) { - SCOPED_TRACE("short form"); - CheckFormOfHighLevelVersion(spvSoftwareVersionString()); -} - -TEST(SoftwareVersion, DetailedIsCorrectForm) { - const std::string detailed_version(spvSoftwareVersionDetailsString()); - EXPECT_THAT(detailed_version, StartsWith("SPIRV-Tools v")); - - // Parse the high level version. - const std::string from_v = - detailed_version.substr(detailed_version.find_first_of('v')); - const size_t first_space_after_v_or_npos = from_v.find_first_of(' '); - SCOPED_TRACE(detailed_version); - CheckFormOfHighLevelVersion(from_v.substr(0, first_space_after_v_or_npos)); - - // We don't actually care about what comes after the version number. -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/stats/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/test/stats/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/stats/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/stats/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -# Copyright (c) 2017 Google 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. - -set(VAL_TEST_COMMON_SRCS - ${CMAKE_CURRENT_SOURCE_DIR}/../test_fixture.h - ${CMAKE_CURRENT_SOURCE_DIR}/../unit_spirv.h -) - -add_spvtools_unittest(TARGET stats_aggregate - SRCS stats_aggregate_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) - -add_spvtools_unittest(TARGET stats_analyzer - SRCS stats_analyzer_test.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/../../tools/stats/stats_analyzer.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/stats/stats_aggregate_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/stats/stats_aggregate_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/stats/stats_aggregate_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/stats/stats_aggregate_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,487 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Tests for unique type declaration rules validator. - -#include - -#include "source/spirv_stats.h" -#include "test_fixture.h" -#include "unit_spirv.h" - -namespace { - -using libspirv::SpirvStats; -using spvtest::ScopedContext; - -void DiagnosticsMessageHandler(spv_message_level_t level, const char*, - const spv_position_t& position, - const char* message) { - switch (level) { - case SPV_MSG_FATAL: - case SPV_MSG_INTERNAL_ERROR: - case SPV_MSG_ERROR: - std::cerr << "error: " << position.index << ": " << message - << std::endl; - break; - case SPV_MSG_WARNING: - std::cout << "warning: " << position.index << ": " << message - << std::endl; - break; - case SPV_MSG_INFO: - std::cout << "info: " << position.index << ": " << message << std::endl; - break; - default: - break; - } -} - -// Calls libspirv::AggregateStats for binary compiled from |code|. -void CompileAndAggregateStats(const std::string& code, SpirvStats* stats, - spv_target_env env = SPV_ENV_UNIVERSAL_1_1) { - ScopedContext ctx(env); - SetContextMessageConsumer(ctx.context, DiagnosticsMessageHandler); - spv_binary binary; - ASSERT_EQ(SPV_SUCCESS, spvTextToBinary( - ctx.context, code.c_str(), code.size(), &binary, nullptr)); - - ASSERT_EQ(SPV_SUCCESS, AggregateStats(*ctx.context, binary->code, - binary->wordCount, nullptr, stats)); - spvBinaryDestroy(binary); -} - -TEST(AggregateStats, CapabilityHistogram) { - const std::string code1 = R"( -OpCapability Addresses -OpCapability Kernel -OpCapability GenericPointer -OpCapability Linkage -OpMemoryModel Physical32 OpenCL -)"; - - const std::string code2 = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -)"; - - SpirvStats stats; - - CompileAndAggregateStats(code1, &stats); - EXPECT_EQ(4u, stats.capability_hist.size()); - EXPECT_EQ(0u, stats.capability_hist.count(SpvCapabilityShader)); - EXPECT_EQ(1u, stats.capability_hist.at(SpvCapabilityAddresses)); - EXPECT_EQ(1u, stats.capability_hist.at(SpvCapabilityKernel)); - EXPECT_EQ(1u, stats.capability_hist.at(SpvCapabilityGenericPointer)); - EXPECT_EQ(1u, stats.capability_hist.at(SpvCapabilityLinkage)); - - CompileAndAggregateStats(code2, &stats); - EXPECT_EQ(5u, stats.capability_hist.size()); - EXPECT_EQ(1u, stats.capability_hist.at(SpvCapabilityShader)); - EXPECT_EQ(1u, stats.capability_hist.at(SpvCapabilityAddresses)); - EXPECT_EQ(1u, stats.capability_hist.at(SpvCapabilityKernel)); - EXPECT_EQ(1u, stats.capability_hist.at(SpvCapabilityGenericPointer)); - EXPECT_EQ(2u, stats.capability_hist.at(SpvCapabilityLinkage)); - - CompileAndAggregateStats(code1, &stats); - EXPECT_EQ(5u, stats.capability_hist.size()); - EXPECT_EQ(1u, stats.capability_hist.at(SpvCapabilityShader)); - EXPECT_EQ(2u, stats.capability_hist.at(SpvCapabilityAddresses)); - EXPECT_EQ(2u, stats.capability_hist.at(SpvCapabilityKernel)); - EXPECT_EQ(2u, stats.capability_hist.at(SpvCapabilityGenericPointer)); - EXPECT_EQ(3u, stats.capability_hist.at(SpvCapabilityLinkage)); - - CompileAndAggregateStats(code2, &stats); - EXPECT_EQ(5u, stats.capability_hist.size()); - EXPECT_EQ(2u, stats.capability_hist.at(SpvCapabilityShader)); - EXPECT_EQ(2u, stats.capability_hist.at(SpvCapabilityAddresses)); - EXPECT_EQ(2u, stats.capability_hist.at(SpvCapabilityKernel)); - EXPECT_EQ(2u, stats.capability_hist.at(SpvCapabilityGenericPointer)); - EXPECT_EQ(4u, stats.capability_hist.at(SpvCapabilityLinkage)); -} - -TEST(AggregateStats, ExtensionHistogram) { - const std::string code1 = R"( -OpCapability Addresses -OpCapability Kernel -OpCapability GenericPointer -OpCapability Linkage -OpExtension "SPV_KHR_16bit_storage" -OpMemoryModel Physical32 OpenCL -)"; - - const std::string code2 = R"( -OpCapability Shader -OpCapability Linkage -OpExtension "SPV_NV_viewport_array2" -OpExtension "greatest_extension_ever" -OpMemoryModel Logical GLSL450 -)"; - - SpirvStats stats; - - CompileAndAggregateStats(code1, &stats); - EXPECT_EQ(1u, stats.extension_hist.size()); - EXPECT_EQ(0u, stats.extension_hist.count("SPV_NV_viewport_array2")); - EXPECT_EQ(1u, stats.extension_hist.at("SPV_KHR_16bit_storage")); - - CompileAndAggregateStats(code2, &stats); - EXPECT_EQ(3u, stats.extension_hist.size()); - EXPECT_EQ(1u, stats.extension_hist.at("SPV_NV_viewport_array2")); - EXPECT_EQ(1u, stats.extension_hist.at("SPV_KHR_16bit_storage")); - EXPECT_EQ(1u, stats.extension_hist.at("greatest_extension_ever")); - - CompileAndAggregateStats(code1, &stats); - EXPECT_EQ(3u, stats.extension_hist.size()); - EXPECT_EQ(1u, stats.extension_hist.at("SPV_NV_viewport_array2")); - EXPECT_EQ(2u, stats.extension_hist.at("SPV_KHR_16bit_storage")); - EXPECT_EQ(1u, stats.extension_hist.at("greatest_extension_ever")); - - CompileAndAggregateStats(code2, &stats); - EXPECT_EQ(3u, stats.extension_hist.size()); - EXPECT_EQ(2u, stats.extension_hist.at("SPV_NV_viewport_array2")); - EXPECT_EQ(2u, stats.extension_hist.at("SPV_KHR_16bit_storage")); - EXPECT_EQ(2u, stats.extension_hist.at("greatest_extension_ever")); -} - -TEST(AggregateStats, VersionHistogram) { - const std::string code1 = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -)"; - - SpirvStats stats; - - CompileAndAggregateStats(code1, &stats); - EXPECT_EQ(1u, stats.version_hist.size()); - EXPECT_EQ(1u, stats.version_hist.at(0x00010100)); - - CompileAndAggregateStats(code1, &stats, SPV_ENV_UNIVERSAL_1_0); - EXPECT_EQ(2u, stats.version_hist.size()); - EXPECT_EQ(1u, stats.version_hist.at(0x00010100)); - EXPECT_EQ(1u, stats.version_hist.at(0x00010000)); - - CompileAndAggregateStats(code1, &stats); - EXPECT_EQ(2u, stats.version_hist.size()); - EXPECT_EQ(2u, stats.version_hist.at(0x00010100)); - EXPECT_EQ(1u, stats.version_hist.at(0x00010000)); - - CompileAndAggregateStats(code1, &stats, SPV_ENV_UNIVERSAL_1_0); - EXPECT_EQ(2u, stats.version_hist.size()); - EXPECT_EQ(2u, stats.version_hist.at(0x00010100)); - EXPECT_EQ(2u, stats.version_hist.at(0x00010000)); -} - -TEST(AggregateStats, GeneratorHistogram) { - const std::string code1 = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -)"; - - const uint32_t kGeneratorKhronosAssembler = - SPV_GENERATOR_KHRONOS_ASSEMBLER << 16; - - SpirvStats stats; - - CompileAndAggregateStats(code1, &stats); - EXPECT_EQ(1u, stats.generator_hist.size()); - EXPECT_EQ(1u, stats.generator_hist.at(kGeneratorKhronosAssembler)); - - CompileAndAggregateStats(code1, &stats); - EXPECT_EQ(1u, stats.generator_hist.size()); - EXPECT_EQ(2u, stats.generator_hist.at(kGeneratorKhronosAssembler)); -} - -TEST(AggregateStats, OpcodeHistogram) { - const std::string code1 = R"( -OpCapability Addresses -OpCapability Kernel -OpCapability Int64 -OpCapability Linkage -OpMemoryModel Physical32 OpenCL -%u64 = OpTypeInt 64 0 -%u32 = OpTypeInt 32 0 -%f32 = OpTypeFloat 32 -)"; - - const std::string code2 = R"( -OpCapability Shader -OpCapability Linkage -OpExtension "SPV_NV_viewport_array2" -OpMemoryModel Logical GLSL450 -)"; - - SpirvStats stats; - - CompileAndAggregateStats(code1, &stats); - EXPECT_EQ(4u, stats.opcode_hist.size()); - EXPECT_EQ(4u, stats.opcode_hist.at(SpvOpCapability)); - EXPECT_EQ(1u, stats.opcode_hist.at(SpvOpMemoryModel)); - EXPECT_EQ(2u, stats.opcode_hist.at(SpvOpTypeInt)); - EXPECT_EQ(1u, stats.opcode_hist.at(SpvOpTypeFloat)); - - CompileAndAggregateStats(code2, &stats); - EXPECT_EQ(5u, stats.opcode_hist.size()); - EXPECT_EQ(6u, stats.opcode_hist.at(SpvOpCapability)); - EXPECT_EQ(2u, stats.opcode_hist.at(SpvOpMemoryModel)); - EXPECT_EQ(2u, stats.opcode_hist.at(SpvOpTypeInt)); - EXPECT_EQ(1u, stats.opcode_hist.at(SpvOpTypeFloat)); - EXPECT_EQ(1u, stats.opcode_hist.at(SpvOpExtension)); - - CompileAndAggregateStats(code1, &stats); - EXPECT_EQ(5u, stats.opcode_hist.size()); - EXPECT_EQ(10u, stats.opcode_hist.at(SpvOpCapability)); - EXPECT_EQ(3u, stats.opcode_hist.at(SpvOpMemoryModel)); - EXPECT_EQ(4u, stats.opcode_hist.at(SpvOpTypeInt)); - EXPECT_EQ(2u, stats.opcode_hist.at(SpvOpTypeFloat)); - EXPECT_EQ(1u, stats.opcode_hist.at(SpvOpExtension)); - - CompileAndAggregateStats(code2, &stats); - EXPECT_EQ(5u, stats.opcode_hist.size()); - EXPECT_EQ(12u, stats.opcode_hist.at(SpvOpCapability)); - EXPECT_EQ(4u, stats.opcode_hist.at(SpvOpMemoryModel)); - EXPECT_EQ(4u, stats.opcode_hist.at(SpvOpTypeInt)); - EXPECT_EQ(2u, stats.opcode_hist.at(SpvOpTypeFloat)); - EXPECT_EQ(2u, stats.opcode_hist.at(SpvOpExtension)); -} - -TEST(AggregateStats, OpcodeMarkovHistogram) { - const std::string code1 = R"( -OpCapability Shader -OpCapability Linkage -OpExtension "SPV_NV_viewport_array2" -OpMemoryModel Logical GLSL450 -)"; - - const std::string code2 = R"( -OpCapability Addresses -OpCapability Kernel -OpCapability Int64 -OpCapability Linkage -OpMemoryModel Physical32 OpenCL -%u64 = OpTypeInt 64 0 -%u32 = OpTypeInt 32 0 -%f32 = OpTypeFloat 32 -)"; - - SpirvStats stats; - stats.opcode_markov_hist.resize(2); - - CompileAndAggregateStats(code1, &stats); - ASSERT_EQ(2u, stats.opcode_markov_hist.size()); - EXPECT_EQ(2u, stats.opcode_markov_hist[0].size()); - EXPECT_EQ(2u, stats.opcode_markov_hist[0].at(SpvOpCapability).size()); - EXPECT_EQ(1u, stats.opcode_markov_hist[0].at(SpvOpExtension).size()); - EXPECT_EQ( - 1u, stats.opcode_markov_hist[0].at(SpvOpCapability).at(SpvOpCapability)); - EXPECT_EQ( - 1u, stats.opcode_markov_hist[0].at(SpvOpCapability).at(SpvOpExtension)); - EXPECT_EQ( - 1u, stats.opcode_markov_hist[0].at(SpvOpExtension).at(SpvOpMemoryModel)); - - EXPECT_EQ(1u, stats.opcode_markov_hist[1].size()); - EXPECT_EQ(2u, stats.opcode_markov_hist[1].at(SpvOpCapability).size()); - EXPECT_EQ( - 1u, stats.opcode_markov_hist[1].at(SpvOpCapability).at(SpvOpExtension)); - EXPECT_EQ( - 1u, stats.opcode_markov_hist[1].at(SpvOpCapability).at(SpvOpMemoryModel)); - - CompileAndAggregateStats(code2, &stats); - ASSERT_EQ(2u, stats.opcode_markov_hist.size()); - EXPECT_EQ(4u, stats.opcode_markov_hist[0].size()); - EXPECT_EQ(3u, stats.opcode_markov_hist[0].at(SpvOpCapability).size()); - EXPECT_EQ(1u, stats.opcode_markov_hist[0].at(SpvOpExtension).size()); - EXPECT_EQ(1u, stats.opcode_markov_hist[0].at(SpvOpMemoryModel).size()); - EXPECT_EQ(2u, stats.opcode_markov_hist[0].at(SpvOpTypeInt).size()); - EXPECT_EQ( - 4u, stats.opcode_markov_hist[0].at(SpvOpCapability).at(SpvOpCapability)); - EXPECT_EQ( - 1u, stats.opcode_markov_hist[0].at(SpvOpCapability).at(SpvOpExtension)); - EXPECT_EQ( - 1u, stats.opcode_markov_hist[0].at(SpvOpCapability).at(SpvOpMemoryModel)); - EXPECT_EQ( - 1u, stats.opcode_markov_hist[0].at(SpvOpExtension).at(SpvOpMemoryModel)); - EXPECT_EQ( - 1u, stats.opcode_markov_hist[0].at(SpvOpMemoryModel).at(SpvOpTypeInt)); - EXPECT_EQ( - 1u, stats.opcode_markov_hist[0].at(SpvOpTypeInt).at(SpvOpTypeInt)); - EXPECT_EQ( - 1u, stats.opcode_markov_hist[0].at(SpvOpTypeInt).at(SpvOpTypeFloat)); - - EXPECT_EQ(3u, stats.opcode_markov_hist[1].size()); - EXPECT_EQ(4u, stats.opcode_markov_hist[1].at(SpvOpCapability).size()); - EXPECT_EQ(1u, stats.opcode_markov_hist[1].at(SpvOpMemoryModel).size()); - EXPECT_EQ(1u, stats.opcode_markov_hist[1].at(SpvOpTypeInt).size()); - EXPECT_EQ( - 2u, stats.opcode_markov_hist[1].at(SpvOpCapability).at(SpvOpCapability)); - EXPECT_EQ( - 1u, stats.opcode_markov_hist[1].at(SpvOpCapability).at(SpvOpExtension)); - EXPECT_EQ( - 2u, stats.opcode_markov_hist[1].at(SpvOpCapability).at(SpvOpMemoryModel)); - EXPECT_EQ( - 1u, stats.opcode_markov_hist[1].at(SpvOpCapability).at(SpvOpTypeInt)); - EXPECT_EQ( - 1u, stats.opcode_markov_hist[1].at(SpvOpMemoryModel).at(SpvOpTypeInt)); - EXPECT_EQ( - 1u, stats.opcode_markov_hist[1].at(SpvOpTypeInt).at(SpvOpTypeFloat)); -} - -TEST(AggregateStats, ConstantLiteralsHistogram) { - const std::string code1 = R"( -OpCapability Addresses -OpCapability Kernel -OpCapability GenericPointer -OpCapability Linkage -OpCapability Float64 -OpCapability Int16 -OpCapability Int64 -OpMemoryModel Physical32 OpenCL -%u16 = OpTypeInt 16 0 -%u32 = OpTypeInt 32 0 -%u64 = OpTypeInt 64 0 -%f32 = OpTypeFloat 32 -%f64 = OpTypeFloat 64 -%1 = OpConstant %f32 0.1 -%2 = OpConstant %f32 -2 -%3 = OpConstant %f64 -2 -%4 = OpConstant %u16 16 -%5 = OpConstant %u16 2 -%6 = OpConstant %u32 32 -%7 = OpConstant %u64 64 -)"; - - const std::string code2 = R"( -OpCapability Shader -OpCapability Linkage -OpCapability Int16 -OpCapability Int64 -OpMemoryModel Logical GLSL450 -%f32 = OpTypeFloat 32 -%u16 = OpTypeInt 16 0 -%s16 = OpTypeInt 16 1 -%u32 = OpTypeInt 32 0 -%s32 = OpTypeInt 32 1 -%u64 = OpTypeInt 64 0 -%s64 = OpTypeInt 64 1 -%1 = OpConstant %f32 0.1 -%2 = OpConstant %f32 -2 -%3 = OpConstant %u16 1 -%4 = OpConstant %u16 16 -%5 = OpConstant %u16 2 -%6 = OpConstant %s16 -16 -%7 = OpConstant %u32 32 -%8 = OpConstant %s32 2 -%9 = OpConstant %s32 -32 -%10 = OpConstant %u64 64 -%11 = OpConstant %s64 -64 -)"; - - SpirvStats stats; - - CompileAndAggregateStats(code1, &stats); - EXPECT_EQ(2u, stats.f32_constant_hist.size()); - EXPECT_EQ(1u, stats.f64_constant_hist.size()); - EXPECT_EQ(1u, stats.f32_constant_hist.at(0.1f)); - EXPECT_EQ(1u, stats.f32_constant_hist.at(-2.f)); - EXPECT_EQ(1u, stats.f64_constant_hist.at(-2)); - - EXPECT_EQ(2u, stats.u16_constant_hist.size()); - EXPECT_EQ(0u, stats.s16_constant_hist.size()); - EXPECT_EQ(1u, stats.u32_constant_hist.size()); - EXPECT_EQ(0u, stats.s32_constant_hist.size()); - EXPECT_EQ(1u, stats.u64_constant_hist.size()); - EXPECT_EQ(0u, stats.s64_constant_hist.size()); - EXPECT_EQ(1u, stats.u16_constant_hist.at(16)); - EXPECT_EQ(1u, stats.u16_constant_hist.at(2)); - EXPECT_EQ(1u, stats.u32_constant_hist.at(32)); - EXPECT_EQ(1u, stats.u64_constant_hist.at(64)); - - CompileAndAggregateStats(code2, &stats); - EXPECT_EQ(2u, stats.f32_constant_hist.size()); - EXPECT_EQ(1u, stats.f64_constant_hist.size()); - EXPECT_EQ(2u, stats.f32_constant_hist.at(0.1f)); - EXPECT_EQ(2u, stats.f32_constant_hist.at(-2.f)); - EXPECT_EQ(1u, stats.f64_constant_hist.at(-2)); - - EXPECT_EQ(3u, stats.u16_constant_hist.size()); - EXPECT_EQ(1u, stats.s16_constant_hist.size()); - EXPECT_EQ(1u, stats.u32_constant_hist.size()); - EXPECT_EQ(2u, stats.s32_constant_hist.size()); - EXPECT_EQ(1u, stats.u64_constant_hist.size()); - EXPECT_EQ(1u, stats.s64_constant_hist.size()); - EXPECT_EQ(2u, stats.u16_constant_hist.at(16)); - EXPECT_EQ(2u, stats.u16_constant_hist.at(2)); - EXPECT_EQ(1u, stats.u16_constant_hist.at(1)); - EXPECT_EQ(1u, stats.s16_constant_hist.at(-16)); - EXPECT_EQ(2u, stats.u32_constant_hist.at(32)); - EXPECT_EQ(1u, stats.s32_constant_hist.at(2)); - EXPECT_EQ(1u, stats.s32_constant_hist.at(-32)); - EXPECT_EQ(2u, stats.u64_constant_hist.at(64)); - EXPECT_EQ(1u, stats.s64_constant_hist.at(-64)); -} - -TEST(AggregateStats, IdDescriptor) { - const std::string code1 = R"( -OpCapability Addresses -OpCapability Kernel -OpCapability GenericPointer -OpCapability Linkage -OpMemoryModel Physical32 OpenCL -%u32 = OpTypeInt 32 0 -%f32 = OpTypeFloat 32 -%1 = OpConstant %f32 1 -%2 = OpConstant %f32 1 -%3 = OpConstant %u32 32 -)"; - - const std::string code2 = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -%f32 = OpTypeFloat 32 -%u32 = OpTypeInt 32 0 -%1 = OpConstant %f32 1 -%2 = OpConstant %f32 3 -%3 = OpConstant %u32 32 -)"; - - const uint32_t kF32 = 1951208733; - const uint32_t kU32 = 2430404313; - const uint32_t kF32_1 = 296981500; - const uint32_t kF32_3 = 1450415100; - const uint32_t kU32_32 = 827246872; - - SpirvStats stats; - - CompileAndAggregateStats(code1, &stats); - - { - const std::unordered_map expected = { - {kF32, 3}, {kU32, 2}, {kF32_1, 2}, {kU32_32, 1} - }; - EXPECT_EQ(expected, stats.id_descriptor_hist); - } - - CompileAndAggregateStats(code2, &stats); - { - const std::unordered_map expected = { - {kF32, 6}, {kU32, 4}, {kF32_1, 3}, {kF32_3, 1}, {kU32_32, 2} - }; - EXPECT_EQ(expected, stats.id_descriptor_hist); - } -} - -} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/stats/stats_analyzer_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/stats/stats_analyzer_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/stats/stats_analyzer_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/stats/stats_analyzer_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,172 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Tests for unique type declaration rules validator. - -#include -#include - -#include "spirv/1.1/spirv.h" -#include "test_fixture.h" -#include "tools/stats/stats_analyzer.h" - -namespace { - -using libspirv::SpirvStats; - -// Fills |stats| with some synthetic header stats, as if aggregated from 100 -// modules (100 used for simpler percentage evaluation). -void FillDefaultStats(SpirvStats* stats) { - *stats = SpirvStats(); - stats->version_hist[0x00010000] = 40; - stats->version_hist[0x00010100] = 60; - stats->generator_hist[0x00000000] = 64; - stats->generator_hist[0x00010000] = 1; - stats->generator_hist[0x00020000] = 2; - stats->generator_hist[0x00030000] = 3; - stats->generator_hist[0x00040000] = 4; - stats->generator_hist[0x00050000] = 5; - stats->generator_hist[0x00060000] = 6; - stats->generator_hist[0x00070000] = 7; - stats->generator_hist[0x00080000] = 8; - - int num_version_entries = 0; - for (const auto& pair : stats->version_hist) { - num_version_entries += pair.second; - } - - int num_generator_entries = 0; - for (const auto& pair : stats->generator_hist) { - num_generator_entries += pair.second; - } - - EXPECT_EQ(num_version_entries, num_generator_entries); -} - -TEST(StatsAnalyzer, Version) { - SpirvStats stats; - FillDefaultStats(&stats); - - StatsAnalyzer analyzer(stats); - - std::stringstream ss; - analyzer.WriteVersion(ss); - const std::string output = ss.str(); - const std::string expected_output = "Version 1.1 60%\nVersion 1.0 40%\n"; - - EXPECT_EQ(expected_output, output); -} - -TEST(StatsAnalyzer, Generator) { - SpirvStats stats; - FillDefaultStats(&stats); - - StatsAnalyzer analyzer(stats); - - std::stringstream ss; - analyzer.WriteGenerator(ss); - const std::string output = ss.str(); - const std::string expected_output = - "Khronos 64%\nKhronos Glslang Reference Front End 8%\n" - "Khronos SPIR-V Tools Assembler 7%\nKhronos LLVM/SPIR-V Translator 6%" - "\nARM 5%\nNVIDIA 4%\nCodeplay 3%\nValve 2%\nLunarG 1%\n"; - - EXPECT_EQ(expected_output, output); -} - -TEST(StatsAnalyzer, Capability) { - SpirvStats stats; - FillDefaultStats(&stats); - - stats.capability_hist[SpvCapabilityShader] = 25; - stats.capability_hist[SpvCapabilityKernel] = 75; - - StatsAnalyzer analyzer(stats); - - std::stringstream ss; - analyzer.WriteCapability(ss); - const std::string output = ss.str(); - const std::string expected_output = "Kernel 75%\nShader 25%\n"; - - EXPECT_EQ(expected_output, output); -} - -TEST(StatsAnalyzer, Extension) { - SpirvStats stats; - FillDefaultStats(&stats); - - stats.extension_hist["greatest_extension_ever"] = 1; - stats.extension_hist["worst_extension_ever"] = 10; - - StatsAnalyzer analyzer(stats); - - std::stringstream ss; - analyzer.WriteExtension(ss); - const std::string output = ss.str(); - const std::string expected_output = - "worst_extension_ever 10%\ngreatest_extension_ever 1%\n"; - - EXPECT_EQ(expected_output, output); -} - -TEST(StatsAnalyzer, Opcode) { - SpirvStats stats; - FillDefaultStats(&stats); - - stats.opcode_hist[SpvOpCapability] = 20; - stats.opcode_hist[SpvOpConstant] = 80; - stats.opcode_hist[SpvOpDecorate] = 100; - - StatsAnalyzer analyzer(stats); - - std::stringstream ss; - analyzer.WriteOpcode(ss); - const std::string output = ss.str(); - const std::string expected_output = - "Total unique opcodes used: 3\nDecorate 50%\n" - "Constant 40%\nCapability 10%\n"; - - EXPECT_EQ(expected_output, output); -} - -TEST(StatsAnalyzer, OpcodeMarkov) { - SpirvStats stats; - FillDefaultStats(&stats); - - stats.opcode_hist[SpvOpFMul] = 400; - stats.opcode_hist[SpvOpFAdd] = 200; - stats.opcode_hist[SpvOpFSub] = 400; - - stats.opcode_markov_hist.resize(1); - auto& hist = stats.opcode_markov_hist[0]; - hist[SpvOpFMul][SpvOpFAdd] = 100; - hist[SpvOpFMul][SpvOpFSub] = 300; - hist[SpvOpFAdd][SpvOpFMul] = 100; - hist[SpvOpFAdd][SpvOpFAdd] = 100; - - StatsAnalyzer analyzer(stats); - - std::stringstream ss; - analyzer.WriteOpcodeMarkov(ss); - const std::string output = ss.str(); - const std::string expected_output = - "FMul -> FSub 75% (base rate 40%, pair occurrences 300)\n" - "FMul -> FAdd 25% (base rate 20%, pair occurrences 100)\n" - "FAdd -> FAdd 50% (base rate 20%, pair occurrences 100)\n" - "FAdd -> FMul 50% (base rate 40%, pair occurrences 100)\n"; - - EXPECT_EQ(expected_output, output); -} - -} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/string_utils_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/string_utils_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/string_utils_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/string_utils_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,190 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include - -#include "gtest/gtest.h" -#include "source/util/string_utils.h" -#include "spirv-tools/libspirv.h" - -namespace { - -using ::spvutils::CardinalToOrdinal; -using ::spvutils::ToString; - -TEST(ToString, Int) { - EXPECT_EQ("0", ToString(0)); - EXPECT_EQ("1000", ToString(1000)); - EXPECT_EQ("-1", ToString(-1)); - EXPECT_EQ("0", ToString(0LL)); - EXPECT_EQ("1000", ToString(1000LL)); - EXPECT_EQ("-1", ToString(-1LL)); -} - -TEST(ToString, Uint) { - EXPECT_EQ("0", ToString(0U)); - EXPECT_EQ("1000", ToString(1000U)); - EXPECT_EQ("0", ToString(0ULL)); - EXPECT_EQ("1000", ToString(1000ULL)); -} - -TEST(ToString, Float) { - EXPECT_EQ("0", ToString(0.f)); - EXPECT_EQ("1000", ToString(1000.f)); - EXPECT_EQ("-1.5", ToString(-1.5f)); -} - -TEST(ToString, Double) { - EXPECT_EQ("0", ToString(0.)); - EXPECT_EQ("1000", ToString(1000.)); - EXPECT_EQ("-1.5", ToString(-1.5)); -} - -TEST(CardinalToOrdinal, Test) { - EXPECT_EQ("1st", CardinalToOrdinal(1)); - EXPECT_EQ("2nd", CardinalToOrdinal(2)); - EXPECT_EQ("3rd", CardinalToOrdinal(3)); - EXPECT_EQ("4th", CardinalToOrdinal(4)); - EXPECT_EQ("5th", CardinalToOrdinal(5)); - EXPECT_EQ("6th", CardinalToOrdinal(6)); - EXPECT_EQ("7th", CardinalToOrdinal(7)); - EXPECT_EQ("8th", CardinalToOrdinal(8)); - EXPECT_EQ("9th", CardinalToOrdinal(9)); - EXPECT_EQ("10th", CardinalToOrdinal(10)); - EXPECT_EQ("11th", CardinalToOrdinal(11)); - EXPECT_EQ("12th", CardinalToOrdinal(12)); - EXPECT_EQ("13th", CardinalToOrdinal(13)); - EXPECT_EQ("14th", CardinalToOrdinal(14)); - EXPECT_EQ("15th", CardinalToOrdinal(15)); - EXPECT_EQ("16th", CardinalToOrdinal(16)); - EXPECT_EQ("17th", CardinalToOrdinal(17)); - EXPECT_EQ("18th", CardinalToOrdinal(18)); - EXPECT_EQ("19th", CardinalToOrdinal(19)); - EXPECT_EQ("20th", CardinalToOrdinal(20)); - EXPECT_EQ("21st", CardinalToOrdinal(21)); - EXPECT_EQ("22nd", CardinalToOrdinal(22)); - EXPECT_EQ("23rd", CardinalToOrdinal(23)); - EXPECT_EQ("24th", CardinalToOrdinal(24)); - EXPECT_EQ("25th", CardinalToOrdinal(25)); - EXPECT_EQ("26th", CardinalToOrdinal(26)); - EXPECT_EQ("27th", CardinalToOrdinal(27)); - EXPECT_EQ("28th", CardinalToOrdinal(28)); - EXPECT_EQ("29th", CardinalToOrdinal(29)); - EXPECT_EQ("30th", CardinalToOrdinal(30)); - EXPECT_EQ("31st", CardinalToOrdinal(31)); - EXPECT_EQ("32nd", CardinalToOrdinal(32)); - EXPECT_EQ("33rd", CardinalToOrdinal(33)); - EXPECT_EQ("34th", CardinalToOrdinal(34)); - EXPECT_EQ("35th", CardinalToOrdinal(35)); - EXPECT_EQ("100th", CardinalToOrdinal(100)); - EXPECT_EQ("101st", CardinalToOrdinal(101)); - EXPECT_EQ("102nd", CardinalToOrdinal(102)); - EXPECT_EQ("103rd", CardinalToOrdinal(103)); - EXPECT_EQ("104th", CardinalToOrdinal(104)); - EXPECT_EQ("105th", CardinalToOrdinal(105)); - EXPECT_EQ("106th", CardinalToOrdinal(106)); - EXPECT_EQ("107th", CardinalToOrdinal(107)); - EXPECT_EQ("108th", CardinalToOrdinal(108)); - EXPECT_EQ("109th", CardinalToOrdinal(109)); - EXPECT_EQ("110th", CardinalToOrdinal(110)); - EXPECT_EQ("111th", CardinalToOrdinal(111)); - EXPECT_EQ("112th", CardinalToOrdinal(112)); - EXPECT_EQ("113th", CardinalToOrdinal(113)); - EXPECT_EQ("114th", CardinalToOrdinal(114)); - EXPECT_EQ("115th", CardinalToOrdinal(115)); - EXPECT_EQ("116th", CardinalToOrdinal(116)); - EXPECT_EQ("117th", CardinalToOrdinal(117)); - EXPECT_EQ("118th", CardinalToOrdinal(118)); - EXPECT_EQ("119th", CardinalToOrdinal(119)); - EXPECT_EQ("120th", CardinalToOrdinal(120)); - EXPECT_EQ("121st", CardinalToOrdinal(121)); - EXPECT_EQ("122nd", CardinalToOrdinal(122)); - EXPECT_EQ("123rd", CardinalToOrdinal(123)); - EXPECT_EQ("124th", CardinalToOrdinal(124)); - EXPECT_EQ("125th", CardinalToOrdinal(125)); - EXPECT_EQ("126th", CardinalToOrdinal(126)); - EXPECT_EQ("127th", CardinalToOrdinal(127)); - EXPECT_EQ("128th", CardinalToOrdinal(128)); - EXPECT_EQ("129th", CardinalToOrdinal(129)); - EXPECT_EQ("130th", CardinalToOrdinal(130)); - EXPECT_EQ("131st", CardinalToOrdinal(131)); - EXPECT_EQ("132nd", CardinalToOrdinal(132)); - EXPECT_EQ("133rd", CardinalToOrdinal(133)); - EXPECT_EQ("134th", CardinalToOrdinal(134)); - EXPECT_EQ("135th", CardinalToOrdinal(135)); - EXPECT_EQ("1000th", CardinalToOrdinal(1000)); - EXPECT_EQ("1001st", CardinalToOrdinal(1001)); - EXPECT_EQ("1002nd", CardinalToOrdinal(1002)); - EXPECT_EQ("1003rd", CardinalToOrdinal(1003)); - EXPECT_EQ("1004th", CardinalToOrdinal(1004)); - EXPECT_EQ("1005th", CardinalToOrdinal(1005)); - EXPECT_EQ("1006th", CardinalToOrdinal(1006)); - EXPECT_EQ("1007th", CardinalToOrdinal(1007)); - EXPECT_EQ("1008th", CardinalToOrdinal(1008)); - EXPECT_EQ("1009th", CardinalToOrdinal(1009)); - EXPECT_EQ("1010th", CardinalToOrdinal(1010)); - EXPECT_EQ("1011th", CardinalToOrdinal(1011)); - EXPECT_EQ("1012th", CardinalToOrdinal(1012)); - EXPECT_EQ("1013th", CardinalToOrdinal(1013)); - EXPECT_EQ("1014th", CardinalToOrdinal(1014)); - EXPECT_EQ("1015th", CardinalToOrdinal(1015)); - EXPECT_EQ("1016th", CardinalToOrdinal(1016)); - EXPECT_EQ("1017th", CardinalToOrdinal(1017)); - EXPECT_EQ("1018th", CardinalToOrdinal(1018)); - EXPECT_EQ("1019th", CardinalToOrdinal(1019)); - EXPECT_EQ("1020th", CardinalToOrdinal(1020)); - EXPECT_EQ("1021st", CardinalToOrdinal(1021)); - EXPECT_EQ("1022nd", CardinalToOrdinal(1022)); - EXPECT_EQ("1023rd", CardinalToOrdinal(1023)); - EXPECT_EQ("1024th", CardinalToOrdinal(1024)); - EXPECT_EQ("1025th", CardinalToOrdinal(1025)); - EXPECT_EQ("1026th", CardinalToOrdinal(1026)); - EXPECT_EQ("1027th", CardinalToOrdinal(1027)); - EXPECT_EQ("1028th", CardinalToOrdinal(1028)); - EXPECT_EQ("1029th", CardinalToOrdinal(1029)); - EXPECT_EQ("1030th", CardinalToOrdinal(1030)); - EXPECT_EQ("1031st", CardinalToOrdinal(1031)); - EXPECT_EQ("1032nd", CardinalToOrdinal(1032)); - EXPECT_EQ("1033rd", CardinalToOrdinal(1033)); - EXPECT_EQ("1034th", CardinalToOrdinal(1034)); - EXPECT_EQ("1035th", CardinalToOrdinal(1035)); - EXPECT_EQ("1200th", CardinalToOrdinal(1200)); - EXPECT_EQ("1201st", CardinalToOrdinal(1201)); - EXPECT_EQ("1202nd", CardinalToOrdinal(1202)); - EXPECT_EQ("1203rd", CardinalToOrdinal(1203)); - EXPECT_EQ("1204th", CardinalToOrdinal(1204)); - EXPECT_EQ("1205th", CardinalToOrdinal(1205)); - EXPECT_EQ("1206th", CardinalToOrdinal(1206)); - EXPECT_EQ("1207th", CardinalToOrdinal(1207)); - EXPECT_EQ("1208th", CardinalToOrdinal(1208)); - EXPECT_EQ("1209th", CardinalToOrdinal(1209)); - EXPECT_EQ("1210th", CardinalToOrdinal(1210)); - EXPECT_EQ("1211th", CardinalToOrdinal(1211)); - EXPECT_EQ("1212th", CardinalToOrdinal(1212)); - EXPECT_EQ("1213th", CardinalToOrdinal(1213)); - EXPECT_EQ("1214th", CardinalToOrdinal(1214)); - EXPECT_EQ("1215th", CardinalToOrdinal(1215)); - EXPECT_EQ("1216th", CardinalToOrdinal(1216)); - EXPECT_EQ("1217th", CardinalToOrdinal(1217)); - EXPECT_EQ("1218th", CardinalToOrdinal(1218)); - EXPECT_EQ("1219th", CardinalToOrdinal(1219)); - EXPECT_EQ("1220th", CardinalToOrdinal(1220)); - EXPECT_EQ("1221st", CardinalToOrdinal(1221)); - EXPECT_EQ("1222nd", CardinalToOrdinal(1222)); - EXPECT_EQ("1223rd", CardinalToOrdinal(1223)); - EXPECT_EQ("1224th", CardinalToOrdinal(1224)); - EXPECT_EQ("1225th", CardinalToOrdinal(1225)); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/target_env_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/target_env_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/target_env_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/target_env_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,90 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include - -#include "unit_spirv.h" - -#include "source/spirv_target_env.h" - -namespace { - -using ::testing::AnyOf; -using ::testing::Eq; -using ::testing::ValuesIn; -using ::testing::StartsWith; - -using TargetEnvTest = ::testing::TestWithParam; -TEST_P(TargetEnvTest, CreateContext) { - spv_target_env env = GetParam(); - spv_context context = spvContextCreate(env); - ASSERT_NE(nullptr, context); - spvContextDestroy(context); // Avoid leaking -} - -TEST_P(TargetEnvTest, ValidDescription) { - const char* description = spvTargetEnvDescription(GetParam()); - ASSERT_NE(nullptr, description); - ASSERT_THAT(description, StartsWith("SPIR-V ")); -} - -TEST_P(TargetEnvTest, ValidSpirvVersion) { - auto spirv_version = spvVersionForTargetEnv(GetParam()); - ASSERT_THAT(spirv_version, AnyOf(0x10000, 0x10100, 0x10200)); -} - -INSTANTIATE_TEST_CASE_P(AllTargetEnvs, TargetEnvTest, - ValuesIn(spvtest::AllTargetEnvironments())); - -TEST(GetContextTest, InvalidTargetEnvProducesNull) { - // Use a value beyond the last valid enum value. - spv_context context = spvContextCreate(static_cast(15)); - EXPECT_EQ(context, nullptr); -} - -// A test case for parsing an environment string. -struct ParseCase { - const char* input; - bool success; // Expect to successfully parse? - spv_target_env env; // The parsed environment, if successful. -}; - -using TargetParseTest = ::testing::TestWithParam; - -TEST_P(TargetParseTest, InvalidTargetEnvProducesNull) { - spv_target_env env; - bool parsed = spvParseTargetEnv(GetParam().input, &env); - EXPECT_THAT(parsed, Eq(GetParam().success)); - EXPECT_THAT(env, Eq(GetParam().env)); -} - -INSTANTIATE_TEST_CASE_P(TargetParsing, TargetParseTest, - ValuesIn(std::vector{ - {"spv1.0", true, SPV_ENV_UNIVERSAL_1_0}, - {"spv1.1", true, SPV_ENV_UNIVERSAL_1_1}, - {"spv1.2", true, SPV_ENV_UNIVERSAL_1_2}, - {"vulkan1.0", true, SPV_ENV_VULKAN_1_0}, - {"opencl2.1", true, SPV_ENV_OPENCL_2_1}, - {"opencl2.2", true, SPV_ENV_OPENCL_2_2}, - {"opengl4.0", true, SPV_ENV_OPENGL_4_0}, - {"opengl4.1", true, SPV_ENV_OPENGL_4_1}, - {"opengl4.2", true, SPV_ENV_OPENGL_4_2}, - {"opengl4.3", true, SPV_ENV_OPENGL_4_3}, - {"opengl4.5", true, SPV_ENV_OPENGL_4_5}, - {nullptr, false, SPV_ENV_UNIVERSAL_1_0}, - {"", false, SPV_ENV_UNIVERSAL_1_0}, - {"abc", false, SPV_ENV_UNIVERSAL_1_0}, - })); - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/test_fixture.h vulkan-1.1.73+dfsg/external/spirv-tools/test/test_fixture.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/test_fixture.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/test_fixture.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,182 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_TEST_TEST_FIXTURE_H_ -#define LIBSPIRV_TEST_TEST_FIXTURE_H_ - -#include "unit_spirv.h" - -namespace spvtest { - -// RAII for spv_context. -struct ScopedContext { - ScopedContext(spv_target_env env = SPV_ENV_UNIVERSAL_1_0) - : context(spvContextCreate(env)) {} - ~ScopedContext() { spvContextDestroy(context); } - spv_context context; -}; - -// Common setup for TextToBinary tests. SetText() should be called to populate -// the actual test text. -template -class TextToBinaryTestBase : public T { - public: - // Shorthand for SPIR-V compilation result. - using SpirvVector = std::vector; - - // Offset into a SpirvVector at which the first instruction starts. - static const SpirvVector::size_type kFirstInstruction = 5; - - TextToBinaryTestBase() : diagnostic(nullptr), text(), binary(nullptr) { - char textStr[] = "substitute the text member variable with your test"; - text = {textStr, strlen(textStr)}; - } - - virtual ~TextToBinaryTestBase() { - DestroyBinary(); - if (diagnostic) spvDiagnosticDestroy(diagnostic); - } - - // Returns subvector v[from:end). - SpirvVector Subvector(const SpirvVector& v, SpirvVector::size_type from) { - assert(from <= v.size()); - return SpirvVector(v.begin() + from, v.end()); - } - - // Compiles SPIR-V text in the given assembly syntax format, asserting - // compilation success. Returns the compiled code. - SpirvVector CompileSuccessfully(const std::string& txt, - spv_target_env env = SPV_ENV_UNIVERSAL_1_0) { - spv_result_t status = - spvTextToBinary(ScopedContext(env).context, txt.c_str(), txt.size(), - &binary, &diagnostic); - EXPECT_EQ(SPV_SUCCESS, status) << txt; - SpirvVector code_copy; - if (status == SPV_SUCCESS) { - code_copy = SpirvVector(binary->code, binary->code + binary->wordCount); - DestroyBinary(); - } else { - spvDiagnosticPrint(diagnostic); - } - return code_copy; - } - - // Compiles SPIR-V text with the given format, asserting compilation failure. - // Returns the error message(s). - std::string CompileFailure(const std::string& txt, - spv_target_env env = SPV_ENV_UNIVERSAL_1_0) { - EXPECT_NE(SPV_SUCCESS, - spvTextToBinary(ScopedContext(env).context, txt.c_str(), - txt.size(), &binary, &diagnostic)) - << txt; - DestroyBinary(); - return diagnostic->error; - } - - // Encodes SPIR-V text into binary and then decodes the binary using - // given options. Returns the decoded text. - std::string EncodeAndDecodeSuccessfully( - const std::string& txt, - uint32_t disassemble_options = SPV_BINARY_TO_TEXT_OPTION_NONE, - spv_target_env env = SPV_ENV_UNIVERSAL_1_0) { - DestroyBinary(); - ScopedContext context(env); - disassemble_options |= SPV_BINARY_TO_TEXT_OPTION_NO_HEADER; - spv_result_t error = spvTextToBinary(context.context, txt.c_str(), - txt.size(), &binary, &diagnostic); - if (error) { - spvDiagnosticPrint(diagnostic); - spvDiagnosticDestroy(diagnostic); - } - EXPECT_EQ(SPV_SUCCESS, error); - if (!binary) return ""; - - spv_text decoded_text; - error = spvBinaryToText(context.context, binary->code, binary->wordCount, - disassemble_options, &decoded_text, &diagnostic); - if (error) { - spvDiagnosticPrint(diagnostic); - spvDiagnosticDestroy(diagnostic); - } - EXPECT_EQ(SPV_SUCCESS, error) << txt; - - const std::string decoded_string = decoded_text->str; - spvTextDestroy(decoded_text); - - return decoded_string; - } - - // Encodes SPIR-V text into binary. This is expected to succeed. - // The given words are then appended to the binary, and the result - // is then decoded. This is expected to fail. - // Returns the error message. - std::string EncodeSuccessfullyDecodeFailed( - const std::string& txt, const SpirvVector& words_to_append) { - SpirvVector code = - spvtest::Concatenate({CompileSuccessfully(txt), words_to_append}); - - spv_text decoded_text; - EXPECT_NE(SPV_SUCCESS, - spvBinaryToText(ScopedContext().context, code.data(), code.size(), - SPV_BINARY_TO_TEXT_OPTION_NONE, &decoded_text, - &diagnostic)); - if (diagnostic) { - std::string error_message = diagnostic->error; - spvDiagnosticDestroy(diagnostic); - diagnostic = nullptr; - return error_message; - } - return ""; - } - - // Compiles SPIR-V text, asserts success, and returns the words representing - // the instructions. In particular, skip the words in the SPIR-V header. - SpirvVector CompiledInstructions(const std::string& txt, - spv_target_env env = SPV_ENV_UNIVERSAL_1_0) { - const SpirvVector code = CompileSuccessfully(txt, env); - SpirvVector result; - // Extract just the instructions. - // If the code fails to compile, then return the empty vector. - // In any case, don't crash or invoke undefined behaviour. - if (code.size() >= kFirstInstruction) - result = Subvector(code, kFirstInstruction); - return result; - } - - void SetText(const std::string& code) { - textString = code; - text.str = textString.c_str(); - text.length = textString.size(); - } - - // Destroys the binary, if it exists. - void DestroyBinary() { - spvBinaryDestroy(binary); - binary = nullptr; - } - - spv_diagnostic diagnostic; - - std::string textString; - spv_text_t text; - spv_binary binary; -}; - -using TextToBinaryTest = TextToBinaryTestBase<::testing::Test>; -} // namespace spvtest - -using RoundTripTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -#endif // LIBSPIRV_TEST_TEST_FIXTURE_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_advance_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_advance_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_advance_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_advance_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,131 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -namespace { - -using libspirv::AssemblyContext; -using spvtest::AutoText; - -TEST(TextAdvance, LeadingNewLines) { - AutoText input("\n\nWord"); - AssemblyContext data(input, nullptr); - ASSERT_EQ(SPV_SUCCESS, data.advance()); - ASSERT_EQ(0u, data.position().column); - ASSERT_EQ(2u, data.position().line); - ASSERT_EQ(2u, data.position().index); -} - -TEST(TextAdvance, LeadingSpaces) { - AutoText input(" Word"); - AssemblyContext data(input, nullptr); - ASSERT_EQ(SPV_SUCCESS, data.advance()); - ASSERT_EQ(4u, data.position().column); - ASSERT_EQ(0u, data.position().line); - ASSERT_EQ(4u, data.position().index); -} - -TEST(TextAdvance, LeadingTabs) { - AutoText input("\t\t\tWord"); - AssemblyContext data(input, nullptr); - ASSERT_EQ(SPV_SUCCESS, data.advance()); - ASSERT_EQ(3u, data.position().column); - ASSERT_EQ(0u, data.position().line); - ASSERT_EQ(3u, data.position().index); -} - -TEST(TextAdvance, LeadingNewLinesSpacesAndTabs) { - AutoText input("\n\n\t Word"); - AssemblyContext data(input, nullptr); - ASSERT_EQ(SPV_SUCCESS, data.advance()); - ASSERT_EQ(3u, data.position().column); - ASSERT_EQ(2u, data.position().line); - ASSERT_EQ(5u, data.position().index); -} - -TEST(TextAdvance, LeadingWhitespaceAfterCommentLine) { - AutoText input("; comment\n \t \tWord"); - AssemblyContext data(input, nullptr); - ASSERT_EQ(SPV_SUCCESS, data.advance()); - ASSERT_EQ(4u, data.position().column); - ASSERT_EQ(1u, data.position().line); - ASSERT_EQ(14u, data.position().index); -} - -TEST(TextAdvance, EOFAfterCommentLine) { - AutoText input("; comment"); - AssemblyContext data(input, nullptr); - ASSERT_EQ(SPV_END_OF_STREAM, data.advance()); -} - -TEST(TextAdvance, NullTerminator) { - AutoText input(""); - AssemblyContext data(input, nullptr); - ASSERT_EQ(SPV_END_OF_STREAM, data.advance()); -} - -TEST(TextAdvance, NoNullTerminatorAfterCommentLine) { - std::string input = "; comment|padding beyond the end"; - spv_text_t text = {input.data(), 9}; - AssemblyContext data(&text, nullptr); - ASSERT_EQ(SPV_END_OF_STREAM, data.advance()); - EXPECT_EQ(9u, data.position().index); -} - -TEST(TextAdvance, NoNullTerminator) { - spv_text_t text = {"OpNop\nSomething else in memory", 6}; - AssemblyContext data(&text, nullptr); - const spv_position_t line_break = {1u, 5u, 5u}; - data.setPosition(line_break); - ASSERT_EQ(SPV_END_OF_STREAM, data.advance()); -} - -// Invokes AssemblyContext::advance() on text, asserts success, and returns -// AssemblyContext::position(). -spv_position_t PositionAfterAdvance(const char* text) { - AutoText input(text); - AssemblyContext data(input, nullptr); - EXPECT_EQ(SPV_SUCCESS, data.advance()); - return data.position(); -} - -TEST(TextAdvance, SkipOverCR) { - const auto pos = PositionAfterAdvance("\rWord"); - EXPECT_EQ(1u, pos.column); - EXPECT_EQ(0u, pos.line); - EXPECT_EQ(1u, pos.index); -} - -TEST(TextAdvance, SkipOverCRs) { - const auto pos = PositionAfterAdvance("\r\r\rWord"); - EXPECT_EQ(3u, pos.column); - EXPECT_EQ(0u, pos.line); - EXPECT_EQ(3u, pos.index); -} - -TEST(TextAdvance, SkipOverCRLF) { - const auto pos = PositionAfterAdvance("\r\nWord"); - EXPECT_EQ(0u, pos.column); - EXPECT_EQ(1u, pos.line); - EXPECT_EQ(2u, pos.index); -} - -TEST(TextAdvance, SkipOverCRLFs) { - const auto pos = PositionAfterAdvance("\r\n\r\nWord"); - EXPECT_EQ(0u, pos.column); - EXPECT_EQ(2u, pos.line); - EXPECT_EQ(4u, pos.index); -} -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_destroy_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_destroy_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_destroy_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_destroy_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -namespace { - -TEST(TextDestroy, DestroyNull) { spvBinaryDestroy(nullptr); } - -TEST(TextDestroy, Default) { - spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_0); - char textStr[] = R"( - OpSource OpenCL_C 12 - OpMemoryModel Physical64 OpenCL - OpSourceExtension "PlaceholderExtensionName" - OpEntryPoint Kernel %0 "" - OpExecutionMode %0 LocalSizeHint 1 1 1 - %1 = OpTypeVoid - %2 = OpTypeBool - %3 = OpTypeInt 8 0 - %4 = OpTypeInt 8 1 - %5 = OpTypeInt 16 0 - %6 = OpTypeInt 16 1 - %7 = OpTypeInt 32 0 - %8 = OpTypeInt 32 1 - %9 = OpTypeInt 64 0 - %10 = OpTypeInt 64 1 - %11 = OpTypeFloat 16 - %12 = OpTypeFloat 32 - %13 = OpTypeFloat 64 - %14 = OpTypeVector %3 2 - )"; - - spv_binary binary = nullptr; - spv_diagnostic diagnostic = nullptr; - EXPECT_EQ(SPV_SUCCESS, spvTextToBinary(context, textStr, strlen(textStr), - &binary, &diagnostic)); - EXPECT_NE(nullptr, binary); - EXPECT_NE(nullptr, binary->code); - EXPECT_NE(0u, binary->wordCount); - if (diagnostic) { - spvDiagnosticPrint(diagnostic); - ASSERT_TRUE(false); - } - - spv_text resultText = nullptr; - EXPECT_EQ(SPV_SUCCESS, - spvBinaryToText(context, binary->code, binary->wordCount, 0, - &resultText, &diagnostic)); - spvBinaryDestroy(binary); - if (diagnostic) { - spvDiagnosticPrint(diagnostic); - spvDiagnosticDestroy(diagnostic); - ASSERT_TRUE(false); - } - EXPECT_NE(nullptr, resultText->str); - EXPECT_NE(0u, resultText->length); - spvTextDestroy(resultText); - spvContextDestroy(context); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_literal_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_literal_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_literal_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_literal_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,413 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -#include "test_fixture.h" -#include "gmock/gmock.h" -#include "message.h" - -#include - -using ::testing::Eq; -namespace { - -TEST(TextLiteral, GoodI32) { - spv_literal_t l; - - ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral("-0", &l)); - EXPECT_EQ(SPV_LITERAL_TYPE_INT_32, l.type); - EXPECT_EQ(0, l.value.i32); - - ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral("-2147483648", &l)); - EXPECT_EQ(SPV_LITERAL_TYPE_INT_32, l.type); - EXPECT_EQ((-2147483647L - 1), l.value.i32); -} - -TEST(TextLiteral, GoodU32) { - spv_literal_t l; - - ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral("0", &l)); - EXPECT_EQ(SPV_LITERAL_TYPE_UINT_32, l.type); - EXPECT_EQ(0, l.value.i32); - - ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral("4294967295", &l)); - EXPECT_EQ(SPV_LITERAL_TYPE_UINT_32, l.type); - EXPECT_EQ(4294967295, l.value.u32); -} - -TEST(TextLiteral, GoodI64) { - spv_literal_t l; - - ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral("-2147483649", &l)); - EXPECT_EQ(SPV_LITERAL_TYPE_INT_64, l.type); - EXPECT_EQ(-2147483649LL, l.value.i64); -} - -TEST(TextLiteral, GoodU64) { - spv_literal_t l; - - ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral("4294967296", &l)); - EXPECT_EQ(SPV_LITERAL_TYPE_UINT_64, l.type); - EXPECT_EQ(4294967296u, l.value.u64); -} - -TEST(TextLiteral, GoodFloat) { - spv_literal_t l; - - ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral("1.0", &l)); - EXPECT_EQ(SPV_LITERAL_TYPE_FLOAT_32, l.type); - EXPECT_EQ(1.0, l.value.f); - - ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral("1.5", &l)); - EXPECT_EQ(SPV_LITERAL_TYPE_FLOAT_32, l.type); - EXPECT_EQ(1.5, l.value.f); - - ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral("-.25", &l)); - EXPECT_EQ(SPV_LITERAL_TYPE_FLOAT_32, l.type); - EXPECT_EQ(-.25, l.value.f); -} - -TEST(TextLiteral, BadString) { - spv_literal_t l; - - EXPECT_EQ(SPV_FAILED_MATCH, spvTextToLiteral("", &l)); - EXPECT_EQ(SPV_FAILED_MATCH, spvTextToLiteral("-", &l)); - EXPECT_EQ(SPV_FAILED_MATCH, spvTextToLiteral("--", &l)); - EXPECT_EQ(SPV_FAILED_MATCH, spvTextToLiteral("1-2", &l)); - EXPECT_EQ(SPV_FAILED_MATCH, spvTextToLiteral("123a", &l)); - EXPECT_EQ(SPV_FAILED_MATCH, spvTextToLiteral("12.2.3", &l)); - EXPECT_EQ(SPV_FAILED_MATCH, spvTextToLiteral("\"", &l)); - EXPECT_EQ(SPV_FAILED_MATCH, spvTextToLiteral("\"z", &l)); - EXPECT_EQ(SPV_FAILED_MATCH, spvTextToLiteral("a\"", &l)); -} - -class GoodStringTest - : public ::testing::TestWithParam> {}; - -TEST_P(GoodStringTest, GoodStrings) { - spv_literal_t l; - - ASSERT_EQ(SPV_SUCCESS, spvTextToLiteral(std::get<0>(GetParam()), &l)); - EXPECT_EQ(SPV_LITERAL_TYPE_STRING, l.type); - EXPECT_EQ(std::get<1>(GetParam()), l.str); -} - -INSTANTIATE_TEST_CASE_P( - TextLiteral, GoodStringTest, - ::testing::ValuesIn(std::vector>{ - {R"("-")", "-"}, - {R"("--")", "--"}, - {R"("1-2")", "1-2"}, - {R"("123a")", "123a"}, - {R"("12.2.3")", "12.2.3"}, - {R"("\"")", "\""}, - {R"("\\")", "\\"}, - {"\"\\foo\nbar\"", "foo\nbar"}, - {"\"\\foo\\\nbar\"", "foo\nbar"}, - {"\"\xE4\xBA\xB2\"", "\xE4\xBA\xB2"}, - {"\"\\\xE4\xBA\xB2\"", "\xE4\xBA\xB2"}, - {"\"this \\\" and this \\\\ and \\\xE4\xBA\xB2\"", - "this \" and this \\ and \xE4\xBA\xB2"}}), ); - -TEST(TextLiteral, StringTooLong) { - spv_literal_t l; - std::string too_long = - std::string("\"") + - std::string(SPV_LIMIT_LITERAL_STRING_BYTES_MAX + 1, 'a') + "\""; - EXPECT_EQ(SPV_ERROR_OUT_OF_MEMORY, spvTextToLiteral(too_long.data(), &l)); -} - -TEST(TextLiteral, GoodLongString) { - spv_literal_t l; - // The universal limit of 65535 Unicode characters might make this - // fail validation, since SPV_LIMIT_LITERAL_STRING_BYTES_MAX is 4*65535. - // However, as an implementation detail, we'll allow the assembler - // to parse it. Otherwise we'd have to scan the string for valid UTF-8 - // characters. - std::string unquoted(SPV_LIMIT_LITERAL_STRING_BYTES_MAX, 'a'); - std::string good_long = std::string("\"") + unquoted + "\""; - EXPECT_EQ(SPV_SUCCESS, spvTextToLiteral(good_long.data(), &l)); - EXPECT_EQ(SPV_LITERAL_TYPE_STRING, l.type); - EXPECT_EQ(unquoted.data(), l.str); -} - -TEST(TextLiteral, GoodUTF8String) { - const std::string unquoted = - spvtest::MakeLongUTF8String(SPV_LIMIT_LITERAL_STRING_UTF8_CHARS_MAX); - const std::string good_long = std::string("\"") + unquoted + "\""; - spv_literal_t l; - EXPECT_EQ(SPV_SUCCESS, spvTextToLiteral(good_long.data(), &l)); - EXPECT_EQ(SPV_LITERAL_TYPE_STRING, l.type); - EXPECT_EQ(unquoted.data(), l.str); -} - -// A test case for parsing literal numbers. -struct TextLiteralCase { - uint32_t bitwidth; - const char* text; - bool is_signed; - bool success; - std::vector expected_values; -}; - -using IntegerTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -std::vector successfulEncode(const TextLiteralCase& test, - libspirv::IdTypeClass type) { - spv_instruction_t inst; - std::string message; - auto capture_message = [&message](spv_message_level_t, const char*, - const spv_position_t&, - const char* m) { message = m; }; - libspirv::IdType expected_type{test.bitwidth, test.is_signed, type}; - EXPECT_EQ(SPV_SUCCESS, - libspirv::AssemblyContext(nullptr, capture_message) - .binaryEncodeNumericLiteral(test.text, SPV_ERROR_INVALID_TEXT, - expected_type, &inst)) - << message; - return inst.words; -} - -std::string failedEncode(const TextLiteralCase& test, - libspirv::IdTypeClass type) { - spv_instruction_t inst; - std::string message; - auto capture_message = [&message](spv_message_level_t, const char*, - const spv_position_t&, - const char* m) { message = m; }; - libspirv::IdType expected_type{test.bitwidth, test.is_signed, type}; - EXPECT_EQ(SPV_ERROR_INVALID_TEXT, - libspirv::AssemblyContext(nullptr, capture_message) - .binaryEncodeNumericLiteral(test.text, SPV_ERROR_INVALID_TEXT, - expected_type, &inst)); - return message; -} - -TEST_P(IntegerTest, IntegerBounds) { - if (GetParam().success) { - EXPECT_THAT( - successfulEncode(GetParam(), libspirv::IdTypeClass::kScalarIntegerType), - Eq(GetParam().expected_values)); - } else { - std::stringstream ss; - ss << "Integer " << GetParam().text << " does not fit in a " - << GetParam().bitwidth << "-bit " - << (GetParam().is_signed ? "signed" : "unsigned") << " integer"; - EXPECT_THAT( - failedEncode(GetParam(), libspirv::IdTypeClass::kScalarIntegerType), - Eq(ss.str())); - } -} - -// Four nicely named methods for making TextLiteralCase values. -// Their names have underscores in some places to make it easier -// to read the table that follows. -TextLiteralCase Make_Ok__Signed(uint32_t bitwidth, const char* text, - std::vector encoding) { - return TextLiteralCase{bitwidth, text, true, true, encoding}; -} -TextLiteralCase Make_Ok__Unsigned(uint32_t bitwidth, const char* text, - std::vector encoding) { - return TextLiteralCase{bitwidth, text, false, true, encoding}; -} -TextLiteralCase Make_Bad_Signed(uint32_t bitwidth, const char* text) { - return TextLiteralCase{bitwidth, text, true, false, {}}; -} -TextLiteralCase Make_Bad_Unsigned(uint32_t bitwidth, const char* text) { - return TextLiteralCase{bitwidth, text, false, false, {}}; -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - DecimalIntegers, IntegerTest, - ::testing::ValuesIn(std::vector{ - // Check max value and overflow value for 1-bit numbers. - Make_Ok__Signed(1, "0", {0}), - Make_Ok__Unsigned(1, "1", {1}), - Make_Bad_Signed(1, "1"), - Make_Bad_Unsigned(1, "2"), - - // Check max value and overflow value for 2-bit numbers. - Make_Ok__Signed(2, "1", {1}), - Make_Ok__Unsigned(2, "3", {3}), - Make_Bad_Signed(2, "2"), - Make_Bad_Unsigned(2, "4"), - - // Check max negative value and overflow value for signed - // 1- and 2-bit numbers. Signed negative numbers are sign-extended. - Make_Ok__Signed(1, "-0", {uint32_t(0)}), - Make_Ok__Signed(1, "-1", {uint32_t(-1)}), - Make_Ok__Signed(2, "-0", {0}), - Make_Ok__Signed(2, "-1", {uint32_t(-1)}), - Make_Ok__Signed(2, "-2", {uint32_t(-2)}), - Make_Bad_Signed(2, "-3"), - - Make_Bad_Unsigned(2, "2224323424242424"), - Make_Ok__Unsigned(16, "65535", {0xFFFF}), - Make_Bad_Unsigned(16, "65536"), - Make_Bad_Signed(16, "65535"), - Make_Ok__Signed(16, "32767", {0x7FFF}), - Make_Ok__Signed(16, "-32768", {0xFFFF8000}), - - // Check values around 32-bits in magnitude. - Make_Ok__Unsigned(33, "4294967296", {0, 1}), - Make_Ok__Unsigned(33, "4294967297", {1, 1}), - Make_Bad_Unsigned(33, "8589934592"), - Make_Bad_Signed(33, "4294967296"), - Make_Ok__Signed(33, "-4294967296", {0x0, 0xFFFFFFFF}), - Make_Ok__Unsigned(64, "4294967296", {0, 1}), - Make_Ok__Unsigned(64, "4294967297", {1, 1}), - - // Check max value and overflow value for 64-bit numbers. - Make_Ok__Signed(64, "9223372036854775807", {0xffffffff, 0x7fffffff}), - Make_Bad_Signed(64, "9223372036854775808"), - Make_Ok__Unsigned(64, "9223372036854775808", {0x00000000, 0x80000000}), - Make_Ok__Unsigned(64, "18446744073709551615", {0xffffffff, 0xffffffff}), - Make_Ok__Signed(64, "-9223372036854775808", {0x00000000, 0x80000000}), - - }),); -// clang-format on - -using IntegerLeadingMinusTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(IntegerLeadingMinusTest, CantHaveLeadingMinusOnUnsigned) { - EXPECT_FALSE(GetParam().success); - EXPECT_THAT( - failedEncode(GetParam(), libspirv::IdTypeClass::kScalarIntegerType), - Eq("Cannot put a negative number in an unsigned literal")); -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - DecimalAndHexIntegers, IntegerLeadingMinusTest, - ::testing::ValuesIn(std::vector{ - // Unsigned numbers never allow a leading minus sign. - Make_Bad_Unsigned(16, "-0"), - Make_Bad_Unsigned(16, "-0x0"), - Make_Bad_Unsigned(16, "-0x1"), - Make_Bad_Unsigned(32, "-0"), - Make_Bad_Unsigned(32, "-0x0"), - Make_Bad_Unsigned(32, "-0x1"), - Make_Bad_Unsigned(64, "-0"), - Make_Bad_Unsigned(64, "-0x0"), - Make_Bad_Unsigned(64, "-0x1"), - }),); - -// clang-format off -INSTANTIATE_TEST_CASE_P( - HexIntegers, IntegerTest, - ::testing::ValuesIn(std::vector{ - // Check 0x and 0X prefices. - Make_Ok__Signed(16, "0x1234", {0x1234}), - Make_Ok__Signed(16, "0X1234", {0x1234}), - - // Check 1-bit numbers - Make_Ok__Signed(1, "0x0", {0}), - Make_Ok__Signed(1, "0x1", {uint32_t(-1)}), - Make_Ok__Unsigned(1, "0x0", {0}), - Make_Ok__Unsigned(1, "0x1", {1}), - Make_Bad_Signed(1, "0x2"), - Make_Bad_Unsigned(1, "0x2"), - - // Check 2-bit numbers - Make_Ok__Signed(2, "0x0", {0}), - Make_Ok__Signed(2, "0x1", {1}), - Make_Ok__Signed(2, "0x2", {uint32_t(-2)}), - Make_Ok__Signed(2, "0x3", {uint32_t(-1)}), - Make_Ok__Unsigned(2, "0x0", {0}), - Make_Ok__Unsigned(2, "0x1", {1}), - Make_Ok__Unsigned(2, "0x2", {2}), - Make_Ok__Unsigned(2, "0x3", {3}), - Make_Bad_Signed(2, "0x4"), - Make_Bad_Unsigned(2, "0x4"), - - // Check 8-bit numbers - Make_Ok__Signed(8, "0x7f", {0x7f}), - Make_Ok__Signed(8, "0x80", {0xffffff80}), - Make_Ok__Unsigned(8, "0x80", {0x80}), - Make_Ok__Unsigned(8, "0xff", {0xff}), - Make_Bad_Signed(8, "0x100"), - Make_Bad_Unsigned(8, "0x100"), - - // Check 16-bit numbers - Make_Ok__Signed(16, "0x7fff", {0x7fff}), - Make_Ok__Signed(16, "0x8000", {0xffff8000}), - Make_Ok__Unsigned(16, "0x8000", {0x8000}), - Make_Ok__Unsigned(16, "0xffff", {0xffff}), - Make_Bad_Signed(16, "0x10000"), - Make_Bad_Unsigned(16, "0x10000"), - - // Check 32-bit numbers - Make_Ok__Signed(32, "0x7fffffff", {0x7fffffff}), - Make_Ok__Signed(32, "0x80000000", {0x80000000}), - Make_Ok__Unsigned(32, "0x80000000", {0x80000000}), - Make_Ok__Unsigned(32, "0xffffffff", {0xffffffff}), - Make_Bad_Signed(32, "0x100000000"), - Make_Bad_Unsigned(32, "0x100000000"), - - // Check 48-bit numbers - Make_Ok__Unsigned(48, "0x7ffffffff", {0xffffffff, 7}), - Make_Ok__Unsigned(48, "0x800000000", {0, 8}), - Make_Ok__Signed(48, "0x7fffffffffff", {0xffffffff, 0x7fff}), - Make_Ok__Signed(48, "0x800000000000", {0, 0xffff8000}), - Make_Bad_Signed(48, "0x1000000000000"), - Make_Bad_Unsigned(48, "0x1000000000000"), - - // Check 64-bit numbers - Make_Ok__Signed(64, "0x7fffffffffffffff", {0xffffffff, 0x7fffffff}), - Make_Ok__Signed(64, "0x8000000000000000", {0x00000000, 0x80000000}), - Make_Ok__Unsigned(64, "0x7fffffffffffffff", {0xffffffff, 0x7fffffff}), - Make_Ok__Unsigned(64, "0x8000000000000000", {0x00000000, 0x80000000}), - }),); -// clang-format on - -TEST(OverflowIntegerParse, Decimal) { - std::string signed_input = "-18446744073709551616"; - std::string expected_message0 = - "Invalid signed integer literal: " + signed_input; - EXPECT_THAT(failedEncode(Make_Bad_Signed(64, signed_input.c_str()), - libspirv::IdTypeClass::kScalarIntegerType), - Eq(expected_message0)); - - std::string unsigned_input = "18446744073709551616"; - std::string expected_message1 = - "Invalid unsigned integer literal: " + unsigned_input; - EXPECT_THAT(failedEncode(Make_Bad_Unsigned(64, unsigned_input.c_str()), - libspirv::IdTypeClass::kScalarIntegerType), - Eq(expected_message1)); - - // TODO(dneto): When the given number doesn't have a leading sign, - // we say we're trying to parse an unsigned number, even when the caller - // asked for a signed number. This is kind of weird, but it's an - // artefact of how we do the parsing. - EXPECT_THAT(failedEncode(Make_Bad_Signed(64, unsigned_input.c_str()), - libspirv::IdTypeClass::kScalarIntegerType), - Eq(expected_message1)); -} - -TEST(OverflowIntegerParse, Hex) { - std::string input = "0x10000000000000000"; - std::string expected_message = "Invalid unsigned integer literal: " + input; - EXPECT_THAT(failedEncode(Make_Bad_Signed(64, input.c_str()), - libspirv::IdTypeClass::kScalarIntegerType), - Eq(expected_message)); - EXPECT_THAT(failedEncode(Make_Bad_Unsigned(64, input.c_str()), - libspirv::IdTypeClass::kScalarIntegerType), - Eq(expected_message)); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_start_new_inst_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_start_new_inst_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_start_new_inst_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_start_new_inst_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -#include - -namespace { - -using libspirv::AssemblyContext; -using spvtest::AutoText; - -TEST(TextStartsWithOp, YesAtStart) { - EXPECT_TRUE(AssemblyContext(AutoText("OpFoo"), nullptr).isStartOfNewInst()); - EXPECT_TRUE(AssemblyContext(AutoText("OpFoo"), nullptr).isStartOfNewInst()); - EXPECT_TRUE(AssemblyContext(AutoText("OpEnCL"), nullptr).isStartOfNewInst()); -} - -TEST(TextStartsWithOp, YesAtMiddle) { - { - AutoText text(" OpFoo"); - AssemblyContext dat(text, nullptr); - dat.seekForward(2); - EXPECT_TRUE(dat.isStartOfNewInst()); - } - { - AutoText text("xx OpFoo"); - AssemblyContext dat(text, nullptr); - dat.seekForward(2); - EXPECT_TRUE(dat.isStartOfNewInst()); - } -} - -TEST(TextStartsWithOp, NoIfTooFar) { - AutoText text(" OpFoo"); - AssemblyContext dat(text, nullptr); - dat.seekForward(3); - EXPECT_FALSE(dat.isStartOfNewInst()); -} - -TEST(TextStartsWithOp, NoRegular) { - EXPECT_FALSE( - AssemblyContext(AutoText("Fee Fi Fo Fum"), nullptr).isStartOfNewInst()); - EXPECT_FALSE(AssemblyContext(AutoText("123456"), nullptr).isStartOfNewInst()); - EXPECT_FALSE(AssemblyContext(AutoText("123456"), nullptr).isStartOfNewInst()); - EXPECT_FALSE(AssemblyContext(AutoText("OpenCL"), nullptr).isStartOfNewInst()); -} - -TEST(TextStartsWithOp, YesForValueGenerationForm) { - EXPECT_TRUE( - AssemblyContext(AutoText("%foo = OpAdd"), nullptr).isStartOfNewInst()); - EXPECT_TRUE( - AssemblyContext(AutoText("%foo = OpAdd"), nullptr).isStartOfNewInst()); -} - -TEST(TextStartsWithOp, NoForNearlyValueGeneration) { - EXPECT_FALSE( - AssemblyContext(AutoText("%foo = "), nullptr).isStartOfNewInst()); - EXPECT_FALSE(AssemblyContext(AutoText("%foo "), nullptr).isStartOfNewInst()); - EXPECT_FALSE(AssemblyContext(AutoText("%foo"), nullptr).isStartOfNewInst()); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.annotation_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.annotation_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.annotation_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.annotation_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,504 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Assembler tests for instructions in the "Annotation" section of the -// SPIR-V spec. - -#include "unit_spirv.h" - -#include -#include - -#include "test_fixture.h" -#include "gmock/gmock.h" - -namespace { - -using ::testing::Combine; -using ::testing::Eq; -using ::testing::Values; -using ::testing::ValuesIn; -using spvtest::EnumCase; -using spvtest::MakeInstruction; -using spvtest::MakeVector; -using spvtest::TextToBinaryTest; -using std::get; -using std::tuple; - -// Test OpDecorate - -using OpDecorateSimpleTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>>>; - -TEST_P(OpDecorateSimpleTest, AnySimpleDecoration) { - // This string should assemble, but should not validate. - std::stringstream input; - input << "OpDecorate %1 " << get<1>(GetParam()).name(); - for (auto operand : get<1>(GetParam()).operands()) input << " " << operand; - input << std::endl; - EXPECT_THAT(CompiledInstructions(input.str(), get<0>(GetParam())), - Eq(MakeInstruction(SpvOpDecorate, - {1, uint32_t(get<1>(GetParam()).value())}, - get<1>(GetParam()).operands()))); - // Also check disassembly. - EXPECT_THAT( - EncodeAndDecodeSuccessfully(input.str(), SPV_BINARY_TO_TEXT_OPTION_NONE, - get<0>(GetParam())), - Eq(input.str())); -} - -#define CASE(NAME) SpvDecoration##NAME, #NAME -INSTANTIATE_TEST_CASE_P( - TextToBinaryDecorateSimple, OpDecorateSimpleTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector>{ - // The operand literal values are arbitrarily chosen, - // but there are the right number of them. - {CASE(RelaxedPrecision), {}}, - {CASE(SpecId), {100}}, - {CASE(Block), {}}, - {CASE(BufferBlock), {}}, - {CASE(RowMajor), {}}, - {CASE(ColMajor), {}}, - {CASE(ArrayStride), {4}}, - {CASE(MatrixStride), {16}}, - {CASE(GLSLShared), {}}, - {CASE(GLSLPacked), {}}, - {CASE(CPacked), {}}, - // Placeholder line for enum value 12 - {CASE(NoPerspective), {}}, - {CASE(Flat), {}}, - {CASE(Patch), {}}, - {CASE(Centroid), {}}, - {CASE(Sample), {}}, - {CASE(Invariant), {}}, - {CASE(Restrict), {}}, - {CASE(Aliased), {}}, - {CASE(Volatile), {}}, - {CASE(Constant), {}}, - {CASE(Coherent), {}}, - {CASE(NonWritable), {}}, - {CASE(NonReadable), {}}, - {CASE(Uniform), {}}, - {CASE(SaturatedConversion), {}}, - {CASE(Stream), {2}}, - {CASE(Location), {6}}, - {CASE(Component), {3}}, - {CASE(Index), {14}}, - {CASE(Binding), {19}}, - {CASE(DescriptorSet), {7}}, - {CASE(Offset), {12}}, - {CASE(XfbBuffer), {1}}, - {CASE(XfbStride), {8}}, - {CASE(NoContraction), {}}, - {CASE(InputAttachmentIndex), {102}}, - {CASE(Alignment), {16}}, - })), ); - -INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateSimpleV11, OpDecorateSimpleTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_1), - Values(EnumCase{ - CASE(MaxByteOffset), {128}})), ); -#undef CASE - -TEST_F(OpDecorateSimpleTest, WrongDecoration) { - EXPECT_THAT(CompileFailure("OpDecorate %1 xxyyzz"), - Eq("Invalid decoration 'xxyyzz'.")); -} - -TEST_F(OpDecorateSimpleTest, ExtraOperandsOnDecorationExpectingNone) { - EXPECT_THAT(CompileFailure("OpDecorate %1 RelaxedPrecision 99"), - Eq("Expected or at the beginning of an " - "instruction, found '99'.")); -} - -TEST_F(OpDecorateSimpleTest, ExtraOperandsOnDecorationExpectingOne) { - EXPECT_THAT(CompileFailure("OpDecorate %1 SpecId 99 100"), - Eq("Expected or at the beginning of an " - "instruction, found '100'.")); -} - -TEST_F(OpDecorateSimpleTest, ExtraOperandsOnDecorationExpectingTwo) { - EXPECT_THAT( - CompileFailure("OpDecorate %1 LinkageAttributes \"abc\" Import 42"), - Eq("Expected or at the beginning of an " - "instruction, found '42'.")); -} - -// A single test case for an enum decoration. -struct DecorateEnumCase { - // Place the enum value first, so it's easier to read the binary dumps when - // the test fails. - uint32_t value; // The value within the enum, e.g. Position - std::string name; - uint32_t enum_value; // Which enum, e.g. BuiltIn - std::string enum_name; -}; - -using OpDecorateEnumTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(OpDecorateEnumTest, AnyEnumDecoration) { - // This string should assemble, but should not validate. - const std::string input = - "OpDecorate %1 " + GetParam().enum_name + " " + GetParam().name; - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpDecorate, {1, GetParam().enum_value, - GetParam().value}))); -} - -// Test OpDecorate BuiltIn. -// clang-format off -#define CASE(NAME) \ - { SpvBuiltIn##NAME, #NAME, SpvDecorationBuiltIn, "BuiltIn" } -INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateBuiltIn, OpDecorateEnumTest, - ::testing::ValuesIn(std::vector{ - CASE(Position), - CASE(PointSize), - CASE(ClipDistance), - CASE(CullDistance), - CASE(VertexId), - CASE(InstanceId), - CASE(PrimitiveId), - CASE(InvocationId), - CASE(Layer), - CASE(ViewportIndex), - CASE(TessLevelOuter), - CASE(TessLevelInner), - CASE(TessCoord), - CASE(PatchVertices), - CASE(FragCoord), - CASE(PointCoord), - CASE(FrontFacing), - CASE(SampleId), - CASE(SamplePosition), - CASE(SampleMask), - // Value 21 intentionally missing. - CASE(FragDepth), - CASE(HelperInvocation), - CASE(NumWorkgroups), - CASE(WorkgroupSize), - CASE(WorkgroupId), - CASE(LocalInvocationId), - CASE(GlobalInvocationId), - CASE(LocalInvocationIndex), - CASE(WorkDim), - CASE(GlobalSize), - CASE(EnqueuedWorkgroupSize), - CASE(GlobalOffset), - CASE(GlobalLinearId), - // Value 35 intentionally missing. - CASE(SubgroupSize), - CASE(SubgroupMaxSize), - CASE(NumSubgroups), - CASE(NumEnqueuedSubgroups), - CASE(SubgroupId), - CASE(SubgroupLocalInvocationId), - CASE(VertexIndex), - CASE(InstanceIndex), - }),); -#undef CASE -// clang-format on - -TEST_F(OpDecorateEnumTest, WrongBuiltIn) { - EXPECT_THAT(CompileFailure("OpDecorate %1 BuiltIn xxyyzz"), - Eq("Invalid built-in 'xxyyzz'.")); -} - -// Test OpDecorate FuncParamAttr -// clang-format off -#define CASE(NAME) \ - { SpvFunctionParameterAttribute##NAME, #NAME, SpvDecorationFuncParamAttr, "FuncParamAttr" } -INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFuncParamAttr, OpDecorateEnumTest, - ::testing::ValuesIn(std::vector{ - CASE(Zext), - CASE(Sext), - CASE(ByVal), - CASE(Sret), - CASE(NoAlias), - CASE(NoCapture), - CASE(NoWrite), - CASE(NoReadWrite), - }),); -#undef CASE -// clang-format on - -TEST_F(OpDecorateEnumTest, WrongFuncParamAttr) { - EXPECT_THAT(CompileFailure("OpDecorate %1 FuncParamAttr xxyyzz"), - Eq("Invalid function parameter attribute 'xxyyzz'.")); -} - -// Test OpDecorate FPRoundingMode -// clang-format off -#define CASE(NAME) \ - { SpvFPRoundingMode##NAME, #NAME, SpvDecorationFPRoundingMode, "FPRoundingMode" } -INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFPRoundingMode, OpDecorateEnumTest, - ::testing::ValuesIn(std::vector{ - CASE(RTE), - CASE(RTZ), - CASE(RTP), - CASE(RTN), - }),); -#undef CASE -// clang-format on - -TEST_F(OpDecorateEnumTest, WrongFPRoundingMode) { - EXPECT_THAT(CompileFailure("OpDecorate %1 FPRoundingMode xxyyzz"), - Eq("Invalid floating-point rounding mode 'xxyyzz'.")); -} - -// Test OpDecorate FPFastMathMode. -// These can by named enums for the single-bit masks. However, we don't support -// symbolic combinations of the masks. Rather, they can use ! -// syntax, e.g. !0x3 - -// clang-format off -#define CASE(ENUM,NAME) \ - { SpvFPFastMathMode##ENUM, #NAME, SpvDecorationFPFastMathMode, "FPFastMathMode" } -INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFPFastMathMode, OpDecorateEnumTest, - ::testing::ValuesIn(std::vector{ - CASE(MaskNone, None), - CASE(NotNaNMask, NotNaN), - CASE(NotInfMask, NotInf), - CASE(NSZMask, NSZ), - CASE(AllowRecipMask, AllowRecip), - CASE(FastMask, Fast), - }),); -#undef CASE -// clang-format on - -TEST_F(OpDecorateEnumTest, CombinedFPFastMathMask) { - // Sample a single combination. This ensures we've integrated - // the instruction parsing logic with spvTextParseMask. - const std::string input = "OpDecorate %1 FPFastMathMode NotNaN|NotInf|NSZ"; - const uint32_t expected_enum = SpvDecorationFPFastMathMode; - const uint32_t expected_mask = SpvFPFastMathModeNotNaNMask | - SpvFPFastMathModeNotInfMask | - SpvFPFastMathModeNSZMask; - EXPECT_THAT( - CompiledInstructions(input), - Eq(MakeInstruction(SpvOpDecorate, {1, expected_enum, expected_mask}))); -} - -TEST_F(OpDecorateEnumTest, WrongFPFastMathMode) { - EXPECT_THAT( - CompileFailure("OpDecorate %1 FPFastMathMode NotNaN|xxyyzz"), - Eq("Invalid floating-point fast math mode operand 'NotNaN|xxyyzz'.")); -} - -// Test OpDecorate Linkage - -// A single test case for a linkage -struct DecorateLinkageCase { - uint32_t linkage_type_value; - std::string linkage_type_name; - std::string external_name; -}; - -using OpDecorateLinkageTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>; - -TEST_P(OpDecorateLinkageTest, AnyLinkageDecoration) { - // This string should assemble, but should not validate. - const std::string input = "OpDecorate %1 LinkageAttributes \"" + - GetParam().external_name + "\" " + - GetParam().linkage_type_name; - std::vector expected_operands{1, SpvDecorationLinkageAttributes}; - std::vector encoded_external_name = - MakeVector(GetParam().external_name); - expected_operands.insert(expected_operands.end(), - encoded_external_name.begin(), - encoded_external_name.end()); - expected_operands.push_back(GetParam().linkage_type_value); - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpDecorate, expected_operands))); -} - -// clang-format off -#define CASE(ENUM) SpvLinkageType##ENUM, #ENUM -INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateLinkage, OpDecorateLinkageTest, - ::testing::ValuesIn(std::vector{ - { CASE(Import), "a" }, - { CASE(Export), "foo" }, - { CASE(Import), "some kind of long name with spaces etc." }, - // TODO(dneto): utf-8, escaping, quoting cases. - }),); -#undef CASE -// clang-format on - -TEST_F(OpDecorateLinkageTest, WrongType) { - EXPECT_THAT(CompileFailure("OpDecorate %1 LinkageAttributes \"foo\" xxyyzz"), - Eq("Invalid linkage type 'xxyyzz'.")); -} - -// Test OpGroupMemberDecorate - -TEST_F(TextToBinaryTest, GroupMemberDecorateGoodOneTarget) { - EXPECT_THAT(CompiledInstructions("OpGroupMemberDecorate %group %id0 42"), - Eq(MakeInstruction(SpvOpGroupMemberDecorate, {1, 2, 42}))); -} - -TEST_F(TextToBinaryTest, GroupMemberDecorateGoodTwoTargets) { - EXPECT_THAT( - CompiledInstructions("OpGroupMemberDecorate %group %id0 96 %id1 42"), - Eq(MakeInstruction(SpvOpGroupMemberDecorate, {1, 2, 96, 3, 42}))); -} - -TEST_F(TextToBinaryTest, GroupMemberDecorateMissingGroupId) { - EXPECT_THAT(CompileFailure("OpGroupMemberDecorate"), - Eq("Expected operand, found end of stream.")); -} - -TEST_F(TextToBinaryTest, GroupMemberDecorateInvalidGroupId) { - EXPECT_THAT(CompileFailure("OpGroupMemberDecorate 16"), - Eq("Expected id to start with %.")); -} - -TEST_F(TextToBinaryTest, GroupMemberDecorateInvalidTargetId) { - EXPECT_THAT(CompileFailure("OpGroupMemberDecorate %group 12"), - Eq("Expected id to start with %.")); -} - -TEST_F(TextToBinaryTest, GroupMemberDecorateMissingTargetMemberNumber) { - EXPECT_THAT(CompileFailure("OpGroupMemberDecorate %group %id0"), - Eq("Expected operand, found end of stream.")); -} - -TEST_F(TextToBinaryTest, GroupMemberDecorateInvalidTargetMemberNumber) { - EXPECT_THAT(CompileFailure("OpGroupMemberDecorate %group %id0 %id1"), - Eq("Invalid unsigned integer literal: %id1")); -} - -TEST_F(TextToBinaryTest, GroupMemberDecorateInvalidSecondTargetId) { - EXPECT_THAT(CompileFailure("OpGroupMemberDecorate %group %id1 42 12"), - Eq("Expected id to start with %.")); -} - -TEST_F(TextToBinaryTest, GroupMemberDecorateMissingSecondTargetMemberNumber) { - EXPECT_THAT(CompileFailure("OpGroupMemberDecorate %group %id0 42 %id1"), - Eq("Expected operand, found end of stream.")); -} - -TEST_F(TextToBinaryTest, GroupMemberDecorateInvalidSecondTargetMemberNumber) { - EXPECT_THAT(CompileFailure("OpGroupMemberDecorate %group %id0 42 %id1 %id2"), - Eq("Invalid unsigned integer literal: %id2")); -} - -// Test OpMemberDecorate - -using OpMemberDecorateSimpleTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>>>; - -TEST_P(OpMemberDecorateSimpleTest, AnySimpleDecoration) { - // This string should assemble, but should not validate. - std::stringstream input; - input << "OpMemberDecorate %1 42 " << get<1>(GetParam()).name(); - for (auto operand : get<1>(GetParam()).operands()) input << " " << operand; - input << std::endl; - EXPECT_THAT(CompiledInstructions(input.str(), get<0>(GetParam())), - Eq(MakeInstruction(SpvOpMemberDecorate, - {1, 42, uint32_t(get<1>(GetParam()).value())}, - get<1>(GetParam()).operands()))); - // Also check disassembly. - EXPECT_THAT( - EncodeAndDecodeSuccessfully(input.str(), SPV_BINARY_TO_TEXT_OPTION_NONE, - get<0>(GetParam())), - Eq(input.str())); -} - -#define CASE(NAME) SpvDecoration##NAME, #NAME -INSTANTIATE_TEST_CASE_P( - TextToBinaryDecorateSimple, OpMemberDecorateSimpleTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector>{ - // The operand literal values are arbitrarily chosen, - // but there are the right number of them. - {CASE(RelaxedPrecision), {}}, - {CASE(SpecId), {100}}, - {CASE(Block), {}}, - {CASE(BufferBlock), {}}, - {CASE(RowMajor), {}}, - {CASE(ColMajor), {}}, - {CASE(ArrayStride), {4}}, - {CASE(MatrixStride), {16}}, - {CASE(GLSLShared), {}}, - {CASE(GLSLPacked), {}}, - {CASE(CPacked), {}}, - // Placeholder line for enum value 12 - {CASE(NoPerspective), {}}, - {CASE(Flat), {}}, - {CASE(Patch), {}}, - {CASE(Centroid), {}}, - {CASE(Sample), {}}, - {CASE(Invariant), {}}, - {CASE(Restrict), {}}, - {CASE(Aliased), {}}, - {CASE(Volatile), {}}, - {CASE(Constant), {}}, - {CASE(Coherent), {}}, - {CASE(NonWritable), {}}, - {CASE(NonReadable), {}}, - {CASE(Uniform), {}}, - {CASE(SaturatedConversion), {}}, - {CASE(Stream), {2}}, - {CASE(Location), {6}}, - {CASE(Component), {3}}, - {CASE(Index), {14}}, - {CASE(Binding), {19}}, - {CASE(DescriptorSet), {7}}, - {CASE(Offset), {12}}, - {CASE(XfbBuffer), {1}}, - {CASE(XfbStride), {8}}, - {CASE(NoContraction), {}}, - {CASE(InputAttachmentIndex), {102}}, - {CASE(Alignment), {16}}, - })), ); - -INSTANTIATE_TEST_CASE_P( - TextToBinaryDecorateSimpleV11, OpMemberDecorateSimpleTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_1), - Values(EnumCase{CASE(MaxByteOffset), {128}})), ); -#undef CASE - -TEST_F(OpMemberDecorateSimpleTest, WrongDecoration) { - EXPECT_THAT(CompileFailure("OpMemberDecorate %1 9 xxyyzz"), - Eq("Invalid decoration 'xxyyzz'.")); -} - -TEST_F(OpMemberDecorateSimpleTest, ExtraOperandsOnDecorationExpectingNone) { - EXPECT_THAT(CompileFailure("OpMemberDecorate %1 12 RelaxedPrecision 99"), - Eq("Expected or at the beginning of an " - "instruction, found '99'.")); -} - -TEST_F(OpMemberDecorateSimpleTest, ExtraOperandsOnDecorationExpectingOne) { - EXPECT_THAT(CompileFailure("OpMemberDecorate %1 0 SpecId 99 100"), - Eq("Expected or at the beginning of an " - "instruction, found '100'.")); -} - -TEST_F(OpMemberDecorateSimpleTest, ExtraOperandsOnDecorationExpectingTwo) { - EXPECT_THAT(CompileFailure( - "OpMemberDecorate %1 1 LinkageAttributes \"abc\" Import 42"), - Eq("Expected or at the beginning of an " - "instruction, found '42'.")); -} - -// TODO(dneto): OpMemberDecorate cases for decorations with parameters which -// are: not just lists of literal numbers. - -// TODO(dneto): OpDecorationGroup -// TODO(dneto): OpGroupDecorate - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.barrier_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.barrier_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.barrier_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.barrier_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,161 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Assembler tests for instructions in the "Barrier Instructions" section -// of the SPIR-V spec. - -#include "unit_spirv.h" - -#include "test_fixture.h" -#include "gmock/gmock.h" - -namespace { - -using ::testing::ElementsAre; -using ::testing::Eq; -using ::testing::_; -using spvtest::MakeInstruction; -using spvtest::TextToBinaryTest; - -// Test OpMemoryBarrier - -using OpMemoryBarrier = spvtest::TextToBinaryTest; - -TEST_F(OpMemoryBarrier, Good) { - const std::string input = "OpMemoryBarrier %1 %2\n"; - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpMemoryBarrier, {1, 2}))); - EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(input)); -} - -TEST_F(OpMemoryBarrier, BadMissingScopeId) { - const std::string input = "OpMemoryBarrier\n"; - EXPECT_THAT(CompileFailure(input), - Eq("Expected operand, found end of stream.")); -} - -TEST_F(OpMemoryBarrier, BadInvalidScopeId) { - const std::string input = "OpMemoryBarrier 99\n"; - EXPECT_THAT(CompileFailure(input), Eq("Expected id to start with %.")); -} - -TEST_F(OpMemoryBarrier, BadMissingMemorySemanticsId) { - const std::string input = "OpMemoryBarrier %scope\n"; - EXPECT_THAT(CompileFailure(input), - Eq("Expected operand, found end of stream.")); -} - -TEST_F(OpMemoryBarrier, BadInvalidMemorySemanticsId) { - const std::string input = "OpMemoryBarrier %scope 14\n"; - EXPECT_THAT(CompileFailure(input), Eq("Expected id to start with %.")); -} - -// TODO(dneto): OpControlBarrier -// TODO(dneto): OpGroupAsyncCopy -// TODO(dneto): OpGroupWaitEvents -// TODO(dneto): OpGroupAll -// TODO(dneto): OpGroupAny -// TODO(dneto): OpGroupBroadcast -// TODO(dneto): OpGroupIAdd -// TODO(dneto): OpGroupFAdd -// TODO(dneto): OpGroupFMin -// TODO(dneto): OpGroupUMin -// TODO(dneto): OpGroupSMin -// TODO(dneto): OpGroupFMax -// TODO(dneto): OpGroupUMax -// TODO(dneto): OpGroupSMax - -using NamedMemoryBarrierTest = spvtest::TextToBinaryTest; - -TEST_F(NamedMemoryBarrierTest, OpcodeUnrecognizedInV10) { - EXPECT_THAT(CompileFailure("OpMemoryNamedBarrier %bar %scope %semantics", - SPV_ENV_UNIVERSAL_1_0), - Eq("Invalid Opcode name 'OpMemoryNamedBarrier'")); -} - -TEST_F(NamedMemoryBarrierTest, ArgumentCount) { - EXPECT_THAT(CompileFailure("OpMemoryNamedBarrier", SPV_ENV_UNIVERSAL_1_1), - Eq("Expected operand, found end of stream.")); - EXPECT_THAT( - CompileFailure("OpMemoryNamedBarrier %bar", SPV_ENV_UNIVERSAL_1_1), - Eq("Expected operand, found end of stream.")); - EXPECT_THAT( - CompileFailure("OpMemoryNamedBarrier %bar %scope", SPV_ENV_UNIVERSAL_1_1), - Eq("Expected operand, found end of stream.")); - EXPECT_THAT( - CompiledInstructions("OpMemoryNamedBarrier %bar %scope %semantics", - SPV_ENV_UNIVERSAL_1_1), - ElementsAre(spvOpcodeMake(4, SpvOpMemoryNamedBarrier), _, _, _)); - EXPECT_THAT( - CompileFailure("OpMemoryNamedBarrier %bar %scope %semantics %extra", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected '=', found end of stream.")); -} - -TEST_F(NamedMemoryBarrierTest, ArgumentTypes) { - EXPECT_THAT(CompileFailure("OpMemoryNamedBarrier 123 %scope %semantics", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected id to start with %.")); - EXPECT_THAT(CompileFailure("OpMemoryNamedBarrier %bar %scope \"semantics\"", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected id to start with %.")); -} - -using TypeNamedBarrierTest = spvtest::TextToBinaryTest; - -TEST_F(TypeNamedBarrierTest, OpcodeUnrecognizedInV10) { - EXPECT_THAT(CompileFailure("%t = OpTypeNamedBarrier", SPV_ENV_UNIVERSAL_1_0), - Eq("Invalid Opcode name 'OpTypeNamedBarrier'")); -} - -TEST_F(TypeNamedBarrierTest, ArgumentCount) { - EXPECT_THAT(CompileFailure("OpTypeNamedBarrier", SPV_ENV_UNIVERSAL_1_1), - Eq("Expected at the beginning of an instruction, " - "found 'OpTypeNamedBarrier'.")); - EXPECT_THAT( - CompiledInstructions("%t = OpTypeNamedBarrier", SPV_ENV_UNIVERSAL_1_1), - ElementsAre(spvOpcodeMake(2, SpvOpTypeNamedBarrier), _)); - EXPECT_THAT( - CompileFailure("%t = OpTypeNamedBarrier 1 2 3", SPV_ENV_UNIVERSAL_1_1), - Eq("Expected or at the beginning of an instruction, " - "found '1'.")); -} - -using NamedBarrierInitializeTest = spvtest::TextToBinaryTest; - -TEST_F(NamedBarrierInitializeTest, OpcodeUnrecognizedInV10) { - EXPECT_THAT(CompileFailure("%bar = OpNamedBarrierInitialize %type %count", - SPV_ENV_UNIVERSAL_1_0), - Eq("Invalid Opcode name 'OpNamedBarrierInitialize'")); -} - -TEST_F(NamedBarrierInitializeTest, ArgumentCount) { - EXPECT_THAT( - CompileFailure("%bar = OpNamedBarrierInitialize", SPV_ENV_UNIVERSAL_1_1), - Eq("Expected operand, found end of stream.")); - EXPECT_THAT(CompileFailure("%bar = OpNamedBarrierInitialize %ype", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected operand, found end of stream.")); - EXPECT_THAT( - CompiledInstructions("%bar = OpNamedBarrierInitialize %type %count", - SPV_ENV_UNIVERSAL_1_1), - ElementsAre(spvOpcodeMake(4, SpvOpNamedBarrierInitialize), _, _, _)); - EXPECT_THAT( - CompileFailure("%bar = OpNamedBarrierInitialize %type %count \"extra\"", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected or at the beginning of an instruction, " - "found '\"extra\"'.")); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.constant_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.constant_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.constant_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.constant_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,826 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Assembler tests for instructions in the "Group Instrucions" section of the -// SPIR-V spec. - -#include "unit_spirv.h" - -#include -#include - -#include "test_fixture.h" -#include "gmock/gmock.h" - -namespace { - -using spvtest::EnumCase; -using spvtest::MakeInstruction; -using spvtest::Concatenate; -using ::testing::Eq; - -// Test Sampler Addressing Mode enum values - -using SamplerAddressingModeTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>>; - -TEST_P(SamplerAddressingModeTest, AnySamplerAddressingMode) { - const std::string input = - "%result = OpConstantSampler %type " + GetParam().name() + " 0 Nearest"; - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpConstantSampler, - {1, 2, GetParam().value(), 0, 0}))); -} - -// clang-format off -#define CASE(NAME) { SpvSamplerAddressingMode##NAME, #NAME } -INSTANTIATE_TEST_CASE_P( - TextToBinarySamplerAddressingMode, SamplerAddressingModeTest, - ::testing::ValuesIn(std::vector>{ - CASE(None), - CASE(ClampToEdge), - CASE(Clamp), - CASE(Repeat), - CASE(RepeatMirrored), - }),); -#undef CASE -// clang-format on - -TEST_F(SamplerAddressingModeTest, WrongMode) { - EXPECT_THAT(CompileFailure("%r = OpConstantSampler %t xxyyzz 0 Nearest"), - Eq("Invalid sampler addressing mode 'xxyyzz'.")); -} - -// Test Sampler Filter Mode enum values - -using SamplerFilterModeTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>>; - -TEST_P(SamplerFilterModeTest, AnySamplerFilterMode) { - const std::string input = - "%result = OpConstantSampler %type Clamp 0 " + GetParam().name(); - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpConstantSampler, - {1, 2, 2, 0, GetParam().value()}))); -} - -// clang-format off -#define CASE(NAME) { SpvSamplerFilterMode##NAME, #NAME} -INSTANTIATE_TEST_CASE_P( - TextToBinarySamplerFilterMode, SamplerFilterModeTest, - ::testing::ValuesIn(std::vector>{ - CASE(Nearest), - CASE(Linear), - }),); -#undef CASE -// clang-format on - -TEST_F(SamplerFilterModeTest, WrongMode) { - EXPECT_THAT(CompileFailure("%r = OpConstantSampler %t Clamp 0 xxyyzz"), - Eq("Invalid sampler filter mode 'xxyyzz'.")); -} - -struct ConstantTestCase { - std::string constant_type; - std::string constant_value; - std::vector expected_instructions; -}; - -using OpConstantValidTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(OpConstantValidTest, ValidTypes) { - const std::string input = "%1 = " + GetParam().constant_type + - "\n" - "%2 = OpConstant %1 " + - GetParam().constant_value + "\n"; - std::vector instructions; - EXPECT_THAT(CompiledInstructions(input), Eq(GetParam().expected_instructions)) - << " type: " << GetParam().constant_type - << " literal: " << GetParam().constant_value; -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - TextToBinaryOpConstantValid, OpConstantValidTest, - ::testing::ValuesIn(std::vector{ - // Check 16 bits - {"OpTypeInt 16 0", "0x1234", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), - MakeInstruction(SpvOpConstant, {1, 2, 0x1234})})}, - {"OpTypeInt 16 0", "0x8000", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), - MakeInstruction(SpvOpConstant, {1, 2, 0x8000})})}, - {"OpTypeInt 16 0", "0", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), - MakeInstruction(SpvOpConstant, {1, 2, 0})})}, - {"OpTypeInt 16 0", "65535", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), - MakeInstruction(SpvOpConstant, {1, 2, 65535})})}, - {"OpTypeInt 16 0", "0xffff", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), - MakeInstruction(SpvOpConstant, {1, 2, 65535})})}, - {"OpTypeInt 16 1", "0x8000", // Test sign extension. - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), - MakeInstruction(SpvOpConstant, {1, 2, 0xffff8000})})}, - {"OpTypeInt 16 1", "-32", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), - MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-32)})})}, - {"OpTypeInt 16 1", "0", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), - MakeInstruction(SpvOpConstant, {1, 2, 0})})}, - {"OpTypeInt 16 1", "-0", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), - MakeInstruction(SpvOpConstant, {1, 2, 0})})}, - {"OpTypeInt 16 1", "-0x0", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), - MakeInstruction(SpvOpConstant, {1, 2, 0})})}, - {"OpTypeInt 16 1", "-32768", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), - MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-32768)})})}, - // Check 32 bits - {"OpTypeInt 32 0", "42", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 0}), - MakeInstruction(SpvOpConstant, {1, 2, 42})})}, - {"OpTypeInt 32 1", "-32", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), - MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-32)})})}, - {"OpTypeInt 32 1", "0", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), - MakeInstruction(SpvOpConstant, {1, 2, 0})})}, - {"OpTypeInt 32 1", "-0", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), - MakeInstruction(SpvOpConstant, {1, 2, 0})})}, - {"OpTypeInt 32 1", "-0x0", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), - MakeInstruction(SpvOpConstant, {1, 2, 0})})}, - {"OpTypeInt 32 1", "-0x001", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), - MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-1)})})}, - {"OpTypeInt 32 1", "2147483647", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), - MakeInstruction(SpvOpConstant, {1, 2, 0x7fffffffu})})}, - {"OpTypeInt 32 1", "-2147483648", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), - MakeInstruction(SpvOpConstant, {1, 2, 0x80000000u})})}, - {"OpTypeFloat 32", "1.0", - Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), - MakeInstruction(SpvOpConstant, {1, 2, 0x3f800000})})}, - {"OpTypeFloat 32", "10.0", - Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), - MakeInstruction(SpvOpConstant, {1, 2, 0x41200000})})}, - {"OpTypeFloat 32", "-0x1p+128", // -infinity - Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), - MakeInstruction(SpvOpConstant, {1, 2, 0xFF800000})})}, - {"OpTypeFloat 32", "0x1p+128", // +infinity - Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), - MakeInstruction(SpvOpConstant, {1, 2, 0x7F800000})})}, - {"OpTypeFloat 32", "-0x1.8p+128", // A -NaN - Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), - MakeInstruction(SpvOpConstant, {1, 2, 0xFFC00000})})}, - {"OpTypeFloat 32", "-0x1.0002p+128", // A +NaN - Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), - MakeInstruction(SpvOpConstant, {1, 2, 0xFF800100})})}, - // Check 48 bits - {"OpTypeInt 48 0", "0x1234", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 0}), - MakeInstruction(SpvOpConstant, {1, 2, 0x1234, 0})})}, - {"OpTypeInt 48 0", "0x800000000001", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 0}), - MakeInstruction(SpvOpConstant, {1, 2, 1, 0x00008000})})}, - {"OpTypeInt 48 1", "0x800000000000", // Test sign extension. - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 1}), - MakeInstruction(SpvOpConstant, {1, 2, 0, 0xffff8000})})}, - {"OpTypeInt 48 1", "-32", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 1}), - MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-32), uint32_t(-1)})})}, - // Check 64 bits - {"OpTypeInt 64 0", "0x1234", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 0}), - MakeInstruction(SpvOpConstant, {1, 2, 0x1234, 0})})}, - {"OpTypeInt 64 0", "18446744073709551615", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 0}), - MakeInstruction(SpvOpConstant, {1, 2, 0xffffffffu, 0xffffffffu})})}, - {"OpTypeInt 64 0", "0xffffffffffffffff", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 0}), - MakeInstruction(SpvOpConstant, {1, 2, 0xffffffffu, 0xffffffffu})})}, - {"OpTypeInt 64 1", "0x1234", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), - MakeInstruction(SpvOpConstant, {1, 2, 0x1234, 0})})}, - {"OpTypeInt 64 1", "-42", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), - MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-42), uint32_t(-1)})})}, - {"OpTypeInt 64 1", "-0x01", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), - MakeInstruction(SpvOpConstant, {1, 2, 0xffffffffu, 0xffffffffu})})}, - {"OpTypeInt 64 1", "9223372036854775807", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), - MakeInstruction(SpvOpConstant, {1, 2, 0xffffffffu, 0x7fffffffu})})}, - {"OpTypeInt 64 1", "0x7fffffff", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), - MakeInstruction(SpvOpConstant, {1, 2, 0x7fffffffu, 0})})}, - }),); -// clang-format on - -// A test case for checking OpConstant with invalid literals with a leading minus. -struct InvalidLeadingMinusCase { - std::string type; - std::string literal; -}; - -using OpConstantInvalidLeadingMinusTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(OpConstantInvalidLeadingMinusTest, InvalidCase) { - const std::string input = "%1 = " + GetParam().type + - "\n" - "%2 = OpConstant %1 " + - GetParam().literal; - EXPECT_THAT(CompileFailure(input), - Eq("Cannot put a negative number in an unsigned literal")); -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - TextToBinaryOpConstantInvalidLeadingMinus, OpConstantInvalidLeadingMinusTest, - ::testing::ValuesIn(std::vector{ - {"OpTypeInt 16 0", "-0"}, - {"OpTypeInt 16 0", "-0x0"}, - {"OpTypeInt 16 0", "-1"}, - {"OpTypeInt 32 0", "-0"}, - {"OpTypeInt 32 0", "-0x0"}, - {"OpTypeInt 32 0", "-1"}, - {"OpTypeInt 64 0", "-0"}, - {"OpTypeInt 64 0", "-0x0"}, - {"OpTypeInt 64 0", "-1"}, - }),); -// clang-format on - -// A test case for invalid floating point literals. -struct InvalidFloatConstantCase { - uint32_t width; - std::string literal; -}; - -using OpConstantInvalidFloatConstant = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>; - -TEST_P(OpConstantInvalidFloatConstant, Samples) { - // Check both kinds of instructions that take literal floats. - for (const auto& instruction : {"OpConstant", "OpSpecConstant"}) { - std::stringstream input; - input << "%1 = OpTypeFloat " << GetParam().width << "\n" - << "%2 = " << instruction << " %1 " << GetParam().literal; - std::stringstream expected_error; - expected_error << "Invalid " << GetParam().width - << "-bit float literal: " << GetParam().literal; - EXPECT_THAT(CompileFailure(input.str()), Eq(expected_error.str())); - } -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - TextToBinaryInvalidFloatConstant, OpConstantInvalidFloatConstant, - ::testing::ValuesIn(std::vector{ - {16, "abc"}, - {16, "--1"}, - {16, "-+1"}, - {16, "+-1"}, - {16, "++1"}, - {16, "1e30"}, // Overflow is an error for 16-bit floats. - {16, "-1e30"}, - {16, "1e40"}, - {16, "-1e40"}, - {16, "1e400"}, - {16, "-1e400"}, - {32, "abc"}, - {32, "--1"}, - {32, "-+1"}, - {32, "+-1"}, - {32, "++1"}, - {32, "1e40"}, // Overflow is an error for 32-bit floats. - {32, "-1e40"}, - {32, "1e400"}, - {32, "-1e400"}, - {64, "abc"}, - {64, "--1"}, - {64, "-+1"}, - {64, "+-1"}, - {64, "++1"}, - {32, "1e400"}, // Overflow is an error for 64-bit floats. - {32, "-1e400"}, - }),); -// clang-format on - -using OpConstantInvalidTypeTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(OpConstantInvalidTypeTest, InvalidTypes) { - const std::string input = "%1 = " + GetParam() + - "\n" - "%2 = OpConstant %1 0\n"; - EXPECT_THAT( - CompileFailure(input), - Eq("Type for Constant must be a scalar floating point or integer type")); -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - TextToBinaryOpConstantInvalidValidType, OpConstantInvalidTypeTest, - ::testing::ValuesIn(std::vector{ - {"OpTypeVoid", - "OpTypeBool", - "OpTypeVector %a 32", - "OpTypeMatrix %a 32", - "OpTypeImage %a 1D 0 0 0 0 Unknown", - "OpTypeSampler", - "OpTypeSampledImage %a", - "OpTypeArray %a %b", - "OpTypeRuntimeArray %a", - "OpTypeStruct %a", - "OpTypeOpaque \"Foo\"", - "OpTypePointer UniformConstant %a", - "OpTypeFunction %a %b", - "OpTypeEvent", - "OpTypeDeviceEvent", - "OpTypeReserveId", - "OpTypeQueue", - "OpTypePipe ReadOnly", - "OpTypeForwardPointer %a UniformConstant", - // At least one thing that isn't a type at all - "OpNot %a %b" - }, - }),); -// clang-format on - -using OpSpecConstantValidTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(OpSpecConstantValidTest, ValidTypes) { - const std::string input = "%1 = " + GetParam().constant_type + - "\n" - "%2 = OpSpecConstant %1 " + - GetParam().constant_value + "\n"; - std::vector instructions; - EXPECT_THAT(CompiledInstructions(input), - Eq(GetParam().expected_instructions)); -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - TextToBinaryOpSpecConstantValid, OpSpecConstantValidTest, - ::testing::ValuesIn(std::vector{ - // Check 16 bits - {"OpTypeInt 16 0", "0x1234", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), - MakeInstruction(SpvOpSpecConstant, {1, 2, 0x1234})})}, - {"OpTypeInt 16 0", "0x8000", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), - MakeInstruction(SpvOpSpecConstant, {1, 2, 0x8000})})}, - {"OpTypeInt 16 1", "0x8000", // Test sign extension. - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), - MakeInstruction(SpvOpSpecConstant, {1, 2, 0xffff8000})})}, - {"OpTypeInt 16 1", "-32", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), - MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-32)})})}, - // Check 32 bits - {"OpTypeInt 32 0", "42", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 0}), - MakeInstruction(SpvOpSpecConstant, {1, 2, 42})})}, - {"OpTypeInt 32 1", "-32", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), - MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-32)})})}, - {"OpTypeFloat 32", "1.0", - Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), - MakeInstruction(SpvOpSpecConstant, {1, 2, 0x3f800000})})}, - {"OpTypeFloat 32", "10.0", - Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), - MakeInstruction(SpvOpSpecConstant, {1, 2, 0x41200000})})}, - // Check 48 bits - {"OpTypeInt 48 0", "0x1234", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 0}), - MakeInstruction(SpvOpSpecConstant, {1, 2, 0x1234, 0})})}, - {"OpTypeInt 48 0", "0x800000000001", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 0}), - MakeInstruction(SpvOpSpecConstant, {1, 2, 1, 0x00008000})})}, - {"OpTypeInt 48 1", "0x800000000000", // Test sign extension. - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 1}), - MakeInstruction(SpvOpSpecConstant, {1, 2, 0, 0xffff8000})})}, - {"OpTypeInt 48 1", "-32", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 1}), - MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-32), uint32_t(-1)})})}, - // Check 64 bits - {"OpTypeInt 64 0", "0x1234", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 0}), - MakeInstruction(SpvOpSpecConstant, {1, 2, 0x1234, 0})})}, - {"OpTypeInt 64 1", "0x1234", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), - MakeInstruction(SpvOpSpecConstant, {1, 2, 0x1234, 0})})}, - {"OpTypeInt 64 1", "-42", - Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), - MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-42), uint32_t(-1)})})}, - }),); -// clang-format on - -using OpSpecConstantInvalidTypeTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(OpSpecConstantInvalidTypeTest, InvalidTypes) { - const std::string input = "%1 = " + GetParam() + - "\n" - "%2 = OpSpecConstant %1 0\n"; - EXPECT_THAT(CompileFailure(input), - Eq("Type for SpecConstant must be a scalar floating point or " - "integer type")); -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - TextToBinaryOpSpecConstantInvalidValidType, OpSpecConstantInvalidTypeTest, - ::testing::ValuesIn(std::vector{ - {"OpTypeVoid", - "OpTypeBool", - "OpTypeVector %a 32", - "OpTypeMatrix %a 32", - "OpTypeImage %a 1D 0 0 0 0 Unknown", - "OpTypeSampler", - "OpTypeSampledImage %a", - "OpTypeArray %a %b", - "OpTypeRuntimeArray %a", - "OpTypeStruct %a", - "OpTypeOpaque \"Foo\"", - "OpTypePointer UniformConstant %a", - "OpTypeFunction %a %b", - "OpTypeEvent", - "OpTypeDeviceEvent", - "OpTypeReserveId", - "OpTypeQueue", - "OpTypePipe ReadOnly", - "OpTypeForwardPointer %a UniformConstant", - // At least one thing that isn't a type at all - "OpNot %a %b" - }, - }),); -// clang-format on - -const int64_t kMaxUnsigned48Bit = (int64_t(1) << 48) - 1; -const int64_t kMaxSigned48Bit = (int64_t(1) << 47) - 1; -const int64_t kMinSigned48Bit = -kMaxSigned48Bit - 1; - -INSTANTIATE_TEST_CASE_P( - OpConstantRoundTrip, RoundTripTest, - ::testing::ValuesIn(std::vector{ - // 16 bit - "%1 = OpTypeInt 16 0\n%2 = OpConstant %1 0\n", - "%1 = OpTypeInt 16 0\n%2 = OpConstant %1 65535\n", - "%1 = OpTypeInt 16 1\n%2 = OpConstant %1 -32768\n", - "%1 = OpTypeInt 16 1\n%2 = OpConstant %1 32767\n", - "%1 = OpTypeInt 32 0\n%2 = OpConstant %1 0\n", - // 32 bit - std::string("%1 = OpTypeInt 32 0\n%2 = OpConstant %1 0\n"), - std::string("%1 = OpTypeInt 32 0\n%2 = OpConstant %1 ") + - std::to_string(std::numeric_limits::max()) + "\n", - std::string("%1 = OpTypeInt 32 1\n%2 = OpConstant %1 ") + - std::to_string(std::numeric_limits::max()) + "\n", - std::string("%1 = OpTypeInt 32 1\n%2 = OpConstant %1 ") + - std::to_string(std::numeric_limits::min()) + "\n", - // 48 bit - std::string("%1 = OpTypeInt 48 0\n%2 = OpConstant %1 0\n"), - std::string("%1 = OpTypeInt 48 0\n%2 = OpConstant %1 ") + - std::to_string(kMaxUnsigned48Bit) + "\n", - std::string("%1 = OpTypeInt 48 1\n%2 = OpConstant %1 ") + - std::to_string(kMaxSigned48Bit) + "\n", - std::string("%1 = OpTypeInt 48 1\n%2 = OpConstant %1 ") + - std::to_string(kMinSigned48Bit) + "\n", - // 64 bit - std::string("%1 = OpTypeInt 64 0\n%2 = OpConstant %1 0\n"), - std::string("%1 = OpTypeInt 64 0\n%2 = OpConstant %1 ") + - std::to_string(std::numeric_limits::max()) + "\n", - std::string("%1 = OpTypeInt 64 1\n%2 = OpConstant %1 ") + - std::to_string(std::numeric_limits::max()) + "\n", - std::string("%1 = OpTypeInt 64 1\n%2 = OpConstant %1 ") + - std::to_string(std::numeric_limits::min()) + "\n", - // 32-bit float - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 0\n", - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 13.5\n", - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -12.5\n", - // 64-bit float - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0\n", - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 1.79769e+308\n", - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -1.79769e+308\n", - }),); - -INSTANTIATE_TEST_CASE_P( - OpConstantHalfRoundTrip, RoundTripTest, - ::testing::ValuesIn(std::vector{ - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x0p+0\n", - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x0p+0\n", - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1p+0\n", - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.1p+0\n", - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.01p-1\n", - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.8p+1\n", - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.ffcp+1\n", - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1p+0\n", - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.1p+0\n", - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.01p-1\n", - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.8p+1\n", - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.ffcp+1\n", - - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1p-16\n", // some denorms - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1p-24\n", - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1p-24\n", - - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1p+16\n", // +inf - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1p+16\n", // -inf - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.01p+16\n", // -inf - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.01p+16\n", // nan - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.11p+16\n", // nan - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.ffp+16\n", // nan - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.ffcp+16\n", // nan - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.004p+16\n", // nan - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.01p+16\n", // -nan - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.11p+16\n", // -nan - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.ffp+16\n", // -nan - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.ffcp+16\n", // -nan - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.004p+16\n", // -nan - }),); - -// clang-format off -// (Clang-format really wants to break up these strings across lines. -INSTANTIATE_TEST_CASE_P( - OpConstantRoundTripNonFinite, RoundTripTest, - ::testing::ValuesIn(std::vector{ - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1p+128\n", // -inf - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1p+128\n", // inf - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1.8p+128\n", // -nan - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1.0002p+128\n", // -nan - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1.0018p+128\n", // -nan - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1.01ep+128\n", // -nan - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1.fffffep+128\n", // -nan - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1.8p+128\n", // +nan - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1.0002p+128\n", // +nan - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1.0018p+128\n", // +nan - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1.01ep+128\n", // +nan - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 0x1.fffffep+128\n", // +nan - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1p+1024\n", //-inf - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1p+1024\n", //+inf - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.8p+1024\n", // -nan - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.0fp+1024\n", // -nan - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.0000000000001p+1024\n", // -nan - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.00003p+1024\n", // -nan - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.fffffffffffffp+1024\n", // -nan - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.8p+1024\n", // +nan - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.0fp+1024\n", // +nan - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.0000000000001p+1024\n", // -nan - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.00003p+1024\n", // -nan - "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.fffffffffffffp+1024\n", // -nan - }),); -// clang-format on - -INSTANTIATE_TEST_CASE_P( - OpSpecConstantRoundTrip, RoundTripTest, - ::testing::ValuesIn(std::vector{ - // 16 bit - "%1 = OpTypeInt 16 0\n%2 = OpSpecConstant %1 0\n", - "%1 = OpTypeInt 16 0\n%2 = OpSpecConstant %1 65535\n", - "%1 = OpTypeInt 16 1\n%2 = OpSpecConstant %1 -32768\n", - "%1 = OpTypeInt 16 1\n%2 = OpSpecConstant %1 32767\n", - "%1 = OpTypeInt 32 0\n%2 = OpSpecConstant %1 0\n", - // 32 bit - std::string("%1 = OpTypeInt 32 0\n%2 = OpSpecConstant %1 0\n"), - std::string("%1 = OpTypeInt 32 0\n%2 = OpSpecConstant %1 ") + - std::to_string(std::numeric_limits::max()) + "\n", - std::string("%1 = OpTypeInt 32 1\n%2 = OpSpecConstant %1 ") + - std::to_string(std::numeric_limits::max()) + "\n", - std::string("%1 = OpTypeInt 32 1\n%2 = OpSpecConstant %1 ") + - std::to_string(std::numeric_limits::min()) + "\n", - // 48 bit - std::string("%1 = OpTypeInt 48 0\n%2 = OpSpecConstant %1 0\n"), - std::string("%1 = OpTypeInt 48 0\n%2 = OpSpecConstant %1 ") + - std::to_string(kMaxUnsigned48Bit) + "\n", - std::string("%1 = OpTypeInt 48 1\n%2 = OpSpecConstant %1 ") + - std::to_string(kMaxSigned48Bit) + "\n", - std::string("%1 = OpTypeInt 48 1\n%2 = OpSpecConstant %1 ") + - std::to_string(kMinSigned48Bit) + "\n", - // 64 bit - std::string("%1 = OpTypeInt 64 0\n%2 = OpSpecConstant %1 0\n"), - std::string("%1 = OpTypeInt 64 0\n%2 = OpSpecConstant %1 ") + - std::to_string(std::numeric_limits::max()) + "\n", - std::string("%1 = OpTypeInt 64 1\n%2 = OpSpecConstant %1 ") + - std::to_string(std::numeric_limits::max()) + "\n", - std::string("%1 = OpTypeInt 64 1\n%2 = OpSpecConstant %1 ") + - std::to_string(std::numeric_limits::min()) + "\n", - // 32-bit float - "%1 = OpTypeFloat 32\n%2 = OpSpecConstant %1 0\n", - "%1 = OpTypeFloat 32\n%2 = OpSpecConstant %1 13.5\n", - "%1 = OpTypeFloat 32\n%2 = OpSpecConstant %1 -12.5\n", - // 64-bit float - "%1 = OpTypeFloat 64\n%2 = OpSpecConstant %1 0\n", - "%1 = OpTypeFloat 64\n%2 = OpSpecConstant %1 1.79769e+308\n", - "%1 = OpTypeFloat 64\n%2 = OpSpecConstant %1 -1.79769e+308\n", - }),); - -// Test OpSpecConstantOp - -using OpSpecConstantOpTestWithIds = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>>; - -// The operands to the OpSpecConstantOp opcode are all Ids. -TEST_P(OpSpecConstantOpTestWithIds, Assembly) { - std::stringstream input; - input << "%2 = OpSpecConstantOp %1 " << GetParam().name(); - for (auto id : GetParam().operands()) input << " %" << id; - input << "\n"; - - EXPECT_THAT(CompiledInstructions(input.str()), - Eq(MakeInstruction(SpvOpSpecConstantOp, - {1, 2, uint32_t(GetParam().value())}, - GetParam().operands()))); - - // Check the disassembler as well. - EXPECT_THAT(EncodeAndDecodeSuccessfully(input.str()), input.str()); -} - -// clang-format off -#define CASE1(NAME) { SpvOp##NAME, #NAME, {3} } -#define CASE2(NAME) { SpvOp##NAME, #NAME, {3, 4} } -#define CASE3(NAME) { SpvOp##NAME, #NAME, {3, 4, 5} } -#define CASE4(NAME) { SpvOp##NAME, #NAME, {3, 4, 5, 6} } -#define CASE5(NAME) { SpvOp##NAME, #NAME, {3, 4, 5, 6, 7} } -#define CASE6(NAME) { SpvOp##NAME, #NAME, {3, 4, 5, 6, 7, 8} } -INSTANTIATE_TEST_CASE_P( - TextToBinaryOpSpecConstantOp, OpSpecConstantOpTestWithIds, - ::testing::ValuesIn(std::vector>{ - // Conversion - CASE1(SConvert), - CASE1(FConvert), - CASE1(ConvertFToS), - CASE1(ConvertSToF), - CASE1(ConvertFToU), - CASE1(ConvertUToF), - CASE1(UConvert), - CASE1(ConvertPtrToU), - CASE1(ConvertUToPtr), - CASE1(GenericCastToPtr), - CASE1(PtrCastToGeneric), - CASE1(Bitcast), - CASE1(QuantizeToF16), - // Arithmetic - CASE1(SNegate), - CASE1(Not), - CASE2(IAdd), - CASE2(ISub), - CASE2(IMul), - CASE2(UDiv), - CASE2(SDiv), - CASE2(UMod), - CASE2(SRem), - CASE2(SMod), - CASE2(ShiftRightLogical), - CASE2(ShiftRightArithmetic), - CASE2(ShiftLeftLogical), - CASE2(BitwiseOr), - CASE2(BitwiseAnd), - CASE2(BitwiseXor), - CASE1(FNegate), - CASE2(FAdd), - CASE2(FSub), - CASE2(FMul), - CASE2(FDiv), - CASE2(FRem), - CASE2(FMod), - // Composite operations use literal numbers. So they're in another test. - // Logical - CASE2(LogicalOr), - CASE2(LogicalAnd), - CASE1(LogicalNot), - CASE2(LogicalEqual), - CASE2(LogicalNotEqual), - CASE3(Select), - // Comparison - CASE2(IEqual), - CASE2(INotEqual), // Allowed in 1.0 Rev 7 - CASE2(ULessThan), - CASE2(SLessThan), - CASE2(UGreaterThan), - CASE2(SGreaterThan), - CASE2(ULessThanEqual), - CASE2(SLessThanEqual), - CASE2(UGreaterThanEqual), - CASE2(SGreaterThanEqual), - // Memory - // For AccessChain, there is a base Id, then a sequence of index Ids. - // Having no index Ids is a corner case. - CASE1(AccessChain), - CASE2(AccessChain), - CASE6(AccessChain), - CASE1(InBoundsAccessChain), - CASE2(InBoundsAccessChain), - CASE6(InBoundsAccessChain), - // PtrAccessChain also has an element Id. - CASE2(PtrAccessChain), - CASE3(PtrAccessChain), - CASE6(PtrAccessChain), - CASE2(InBoundsPtrAccessChain), - CASE3(InBoundsPtrAccessChain), - CASE6(InBoundsPtrAccessChain), - }),); -#undef CASE1 -#undef CASE2 -#undef CASE3 -#undef CASE4 -#undef CASE5 -#undef CASE6 -// clang-format on - -using OpSpecConstantOpTestWithTwoIdsThenLiteralNumbers = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>>; - -// The operands to the OpSpecConstantOp opcode are two Ids followed by a -// sequence of literal numbers. -TEST_P(OpSpecConstantOpTestWithTwoIdsThenLiteralNumbers, Assembly) { - std::stringstream input; - input << "%2 = OpSpecConstantOp %1 " << GetParam().name() << " %3 %4"; - for (auto number : GetParam().operands()) input << " " << number; - input << "\n"; - - EXPECT_THAT(CompiledInstructions(input.str()), - Eq(MakeInstruction(SpvOpSpecConstantOp, - {1, 2, uint32_t(GetParam().value()), 3, 4}, - GetParam().operands()))); - - // Check the disassembler as well. - EXPECT_THAT(EncodeAndDecodeSuccessfully(input.str()), input.str()); -} - -#define CASE(NAME) SpvOp##NAME, #NAME -INSTANTIATE_TEST_CASE_P( - TextToBinaryOpSpecConstantOp, - OpSpecConstantOpTestWithTwoIdsThenLiteralNumbers, - ::testing::ValuesIn(std::vector>{ - // For VectorShuffle, there are two vector operands, and at least - // two selector Ids. OpenCL can have up to 16-element vectors. - {CASE(VectorShuffle), {0, 0}}, - {CASE(VectorShuffle), {4, 3, 2, 1}}, - {CASE(VectorShuffle), {0, 2, 4, 6, 1, 3, 5, 7}}, - {CASE(VectorShuffle), - {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}}, - // For CompositeInsert, there is an object to insert, the target - // composite, and then literal indices. - {CASE(CompositeInsert), {0}}, - {CASE(CompositeInsert), {4, 3, 99, 1}}, - }),); - -using OpSpecConstantOpTestWithOneIdThenLiteralNumbers = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>>; - -// The operands to the OpSpecConstantOp opcode are one Id followed by a -// sequence of literal numbers. -TEST_P(OpSpecConstantOpTestWithOneIdThenLiteralNumbers, Assembly) { - std::stringstream input; - input << "%2 = OpSpecConstantOp %1 " << GetParam().name() << " %3"; - for (auto number : GetParam().operands()) input << " " << number; - input << "\n"; - - EXPECT_THAT(CompiledInstructions(input.str()), - Eq(MakeInstruction(SpvOpSpecConstantOp, - {1, 2, uint32_t(GetParam().value()), 3}, - GetParam().operands()))); - - // Check the disassembler as well. - EXPECT_THAT(EncodeAndDecodeSuccessfully(input.str()), input.str()); -} - -#define CASE(NAME) SpvOp##NAME, #NAME -INSTANTIATE_TEST_CASE_P( - TextToBinaryOpSpecConstantOp, - OpSpecConstantOpTestWithOneIdThenLiteralNumbers, - ::testing::ValuesIn(std::vector>{ - // For CompositeExtract, the universal limit permits up to 255 literal - // indices. Let's only test a few. - {CASE(CompositeExtract), {0}}, - {CASE(CompositeExtract), {0, 99, 42, 16, 17, 12, 19}}, - }),); - -// TODO(dneto): OpConstantTrue -// TODO(dneto): OpConstantFalse -// TODO(dneto): OpConstantComposite -// TODO(dneto): OpConstantSampler: other variations Param is 0 or 1 -// TODO(dneto): OpConstantNull -// TODO(dneto): OpSpecConstantTrue -// TODO(dneto): OpSpecConstantFalse -// TODO(dneto): OpSpecConstantComposite -// TODO(dneto): Negative tests for OpSpecConstantOp - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.control_flow_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.control_flow_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.control_flow_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.control_flow_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,395 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Assembler tests for instructions in the "Control Flow" section of the -// SPIR-V spec. - -#include -#include -#include - -#include "unit_spirv.h" - -#include "test_fixture.h" -#include "gmock/gmock.h" - -namespace { - -using ::testing::Combine; -using ::testing::Eq; -using ::testing::TestWithParam; -using ::testing::Values; -using ::testing::ValuesIn; -using spvtest::Concatenate; -using spvtest::EnumCase; -using spvtest::MakeInstruction; -using spvtest::TextToBinaryTest; -using std::get; -using std::ostringstream; -using std::tuple; - -// Test OpSelectionMerge - -using OpSelectionMergeTest = spvtest::TextToBinaryTestBase< - TestWithParam>>; - -TEST_P(OpSelectionMergeTest, AnySingleSelectionControlMask) { - const std::string input = "OpSelectionMerge %1 " + GetParam().name(); - EXPECT_THAT( - CompiledInstructions(input), - Eq(MakeInstruction(SpvOpSelectionMerge, {1, GetParam().value()}))); -} - -// clang-format off -#define CASE(VALUE,NAME) { SpvSelectionControl##VALUE, NAME} -INSTANTIATE_TEST_CASE_P(TextToBinarySelectionMerge, OpSelectionMergeTest, - ValuesIn(std::vector>{ - CASE(MaskNone, "None"), - CASE(FlattenMask, "Flatten"), - CASE(DontFlattenMask, "DontFlatten"), - }),); -#undef CASE -// clang-format on - -TEST_F(OpSelectionMergeTest, CombinedSelectionControlMask) { - const std::string input = "OpSelectionMerge %1 Flatten|DontFlatten"; - const uint32_t expected_mask = - SpvSelectionControlFlattenMask | SpvSelectionControlDontFlattenMask; - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpSelectionMerge, {1, expected_mask}))); -} - -TEST_F(OpSelectionMergeTest, WrongSelectionControl) { - // Case sensitive: "flatten" != "Flatten" and thus wrong. - EXPECT_THAT(CompileFailure("OpSelectionMerge %1 flatten|DontFlatten"), - Eq("Invalid selection control operand 'flatten|DontFlatten'.")); -} - -// Test OpLoopMerge - -using OpLoopMergeTest = spvtest::TextToBinaryTestBase< - TestWithParam>>>; - -TEST_P(OpLoopMergeTest, AnySingleLoopControlMask) { - const auto ctrl = get<1>(GetParam()); - ostringstream input; - input << "OpLoopMerge %merge %continue " << ctrl.name(); - for (auto num : ctrl.operands()) input << " " << num; - EXPECT_THAT(CompiledInstructions(input.str(), get<0>(GetParam())), - Eq(MakeInstruction(SpvOpLoopMerge, {1, 2, ctrl.value()}, - ctrl.operands()))); -} - -#define CASE(VALUE, NAME) \ - { SpvLoopControl##VALUE, NAME } -#define CASE1(VALUE, NAME, PARM) \ - { \ - SpvLoopControl##VALUE, NAME, { PARM } \ - } -INSTANTIATE_TEST_CASE_P( - TextToBinaryLoopMerge, OpLoopMergeTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector>{ - // clang-format off - CASE(MaskNone, "None"), - CASE(UnrollMask, "Unroll"), - CASE(DontUnrollMask, "DontUnroll"), - // clang-format on - })), ); - -INSTANTIATE_TEST_CASE_P( - TextToBinaryLoopMergeV11, OpLoopMergeTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector>{ - // clang-format off - CASE(DependencyInfiniteMask, "DependencyInfinite"), - CASE1(DependencyLengthMask, "DependencyLength", 234), - {SpvLoopControlUnrollMask|SpvLoopControlDependencyLengthMask, - "DependencyLength|Unroll", {33}}, - // clang-format on - })), ); -#undef CASE -#undef CASE1 - -TEST_F(OpLoopMergeTest, CombinedLoopControlMask) { - const std::string input = "OpLoopMerge %merge %continue Unroll|DontUnroll"; - const uint32_t expected_mask = - SpvLoopControlUnrollMask | SpvLoopControlDontUnrollMask; - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpLoopMerge, {1, 2, expected_mask}))); -} - -TEST_F(OpLoopMergeTest, WrongLoopControl) { - EXPECT_THAT(CompileFailure("OpLoopMerge %m %c none"), - Eq("Invalid loop control operand 'none'.")); -} - -// Test OpSwitch - -TEST_F(TextToBinaryTest, SwitchGoodZeroTargets) { - EXPECT_THAT(CompiledInstructions("OpSwitch %selector %default"), - Eq(MakeInstruction(SpvOpSwitch, {1, 2}))); -} - -TEST_F(TextToBinaryTest, SwitchGoodOneTarget) { - EXPECT_THAT(CompiledInstructions("%1 = OpTypeInt 32 0\n" - "%2 = OpConstant %1 52\n" - "OpSwitch %2 %default 12 %target0"), - Eq(Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 0}), - MakeInstruction(SpvOpConstant, {1, 2, 52}), - MakeInstruction(SpvOpSwitch, {2, 3, 12, 4})}))); -} - -TEST_F(TextToBinaryTest, SwitchGoodTwoTargets) { - EXPECT_THAT( - CompiledInstructions("%1 = OpTypeInt 32 0\n" - "%2 = OpConstant %1 52\n" - "OpSwitch %2 %default 12 %target0 42 %target1"), - Eq(Concatenate({ - MakeInstruction(SpvOpTypeInt, {1, 32, 0}), - MakeInstruction(SpvOpConstant, {1, 2, 52}), - MakeInstruction(SpvOpSwitch, {2, 3, 12, 4, 42, 5}), - }))); -} - -TEST_F(TextToBinaryTest, SwitchBadMissingSelector) { - EXPECT_THAT(CompileFailure("OpSwitch"), - Eq("Expected operand, found end of stream.")); -} - -TEST_F(TextToBinaryTest, SwitchBadInvalidSelector) { - EXPECT_THAT(CompileFailure("OpSwitch 12"), - Eq("Expected id to start with %.")); -} - -TEST_F(TextToBinaryTest, SwitchBadMissingDefault) { - EXPECT_THAT(CompileFailure("OpSwitch %selector"), - Eq("Expected operand, found end of stream.")); -} - -TEST_F(TextToBinaryTest, SwitchBadInvalidDefault) { - EXPECT_THAT(CompileFailure("OpSwitch %selector 12"), - Eq("Expected id to start with %.")); -} - -TEST_F(TextToBinaryTest, SwitchBadInvalidLiteral) { - // The assembler recognizes "OpSwitch %selector %default" as a complete - // instruction. Then it tries to parse "%abc" as the start of a new - // instruction, but can't since it hits the end of stream. - const auto input = R"(%i32 = OpTypeInt 32 0 - %selector = OpConstant %i32 42 - OpSwitch %selector %default %abc)"; - EXPECT_THAT(CompileFailure(input), Eq("Expected '=', found end of stream.")); -} - -TEST_F(TextToBinaryTest, SwitchBadMissingTarget) { - EXPECT_THAT(CompileFailure("%1 = OpTypeInt 32 0\n" - "%2 = OpConstant %1 52\n" - "OpSwitch %2 %default 12"), - Eq("Expected operand, found end of stream.")); -} - -// A test case for an OpSwitch. -// It is also parameterized to test encodings OpConstant -// integer literals. This can capture both single and multi-word -// integer literal tests. -struct SwitchTestCase { - std::string constant_type_args; - std::string constant_value_arg; - std::string case_value_arg; - std::vector expected_instructions; -}; - -using OpSwitchValidTest = - spvtest::TextToBinaryTestBase>; - -// Tests the encoding of OpConstant literal values, and also -// the literal integer cases in an OpSwitch. This can -// test both single and multi-word integer literal encodings. -TEST_P(OpSwitchValidTest, ValidTypes) { - const std::string input = "%1 = OpTypeInt " + GetParam().constant_type_args + - "\n" - "%2 = OpConstant %1 " + - GetParam().constant_value_arg + - "\n" - "OpSwitch %2 %default " + - GetParam().case_value_arg + " %4\n"; - std::vector instructions; - EXPECT_THAT(CompiledInstructions(input), - Eq(GetParam().expected_instructions)); -} - -// Constructs a SwitchTestCase from the given integer_width, signedness, -// constant value string, and expected encoded constant. -SwitchTestCase MakeSwitchTestCase(uint32_t integer_width, - uint32_t integer_signedness, - std::string constant_str, - std::vector encoded_constant, - std::string case_value_str, - std::vector encoded_case_value) { - std::stringstream ss; - ss << integer_width << " " << integer_signedness; - return SwitchTestCase{ - ss.str(), - constant_str, - case_value_str, - {Concatenate( - {MakeInstruction(SpvOpTypeInt, - {1, integer_width, integer_signedness}), - MakeInstruction(SpvOpConstant, - Concatenate({{1, 2}, encoded_constant})), - MakeInstruction(SpvOpSwitch, - Concatenate({{2, 3}, encoded_case_value, {4}}))})}}; -} - -INSTANTIATE_TEST_CASE_P( - TextToBinaryOpSwitchValid1Word, OpSwitchValidTest, - ValuesIn(std::vector({ - MakeSwitchTestCase(32, 0, "42", {42}, "100", {100}), - MakeSwitchTestCase(32, 1, "-1", {0xffffffff}, "100", {100}), - // SPIR-V 1.0 Rev 1 clarified that for an integer narrower than 32-bits, - // its bits will appear in the lower order bits of the 32-bit word, and - // a signed integer is sign-extended. - MakeSwitchTestCase(7, 0, "127", {127}, "100", {100}), - MakeSwitchTestCase(14, 0, "99", {99}, "100", {100}), - MakeSwitchTestCase(16, 0, "65535", {65535}, "100", {100}), - MakeSwitchTestCase(16, 1, "101", {101}, "100", {100}), - // Demonstrate sign extension - MakeSwitchTestCase(16, 1, "-2", {0xfffffffe}, "100", {100}), - // Hex cases - MakeSwitchTestCase(16, 1, "0x7ffe", {0x7ffe}, "0x1234", {0x1234}), - MakeSwitchTestCase(16, 1, "0x8000", {0xffff8000}, "0x8100", - {0xffff8100}), - MakeSwitchTestCase(16, 0, "0x8000", {0x00008000}, "0x8100", {0x8100}), - })), ); - -// NB: The words LOW ORDER bits show up first. -INSTANTIATE_TEST_CASE_P( - TextToBinaryOpSwitchValid2Words, OpSwitchValidTest, - ValuesIn(std::vector({ - MakeSwitchTestCase(33, 0, "101", {101, 0}, "500", {500, 0}), - MakeSwitchTestCase(48, 1, "-1", {0xffffffff, 0xffffffff}, "900", - {900, 0}), - MakeSwitchTestCase(64, 1, "-2", {0xfffffffe, 0xffffffff}, "-5", - {0xfffffffb, uint32_t(-1)}), - // Hex cases - MakeSwitchTestCase(48, 1, "0x7fffffffffff", {0xffffffff, 0x00007fff}, - "100", {100, 0}), - MakeSwitchTestCase(48, 1, "0x800000000000", {0x00000000, 0xffff8000}, - "0x800000000000", {0x00000000, 0xffff8000}), - MakeSwitchTestCase(48, 0, "0x800000000000", {0x00000000, 0x00008000}, - "0x800000000000", {0x00000000, 0x00008000}), - MakeSwitchTestCase(63, 0, "0x500000000", {0, 5}, "12", {12, 0}), - MakeSwitchTestCase(64, 0, "0x600000000", {0, 6}, "12", {12, 0}), - MakeSwitchTestCase(64, 1, "0x700000123", {0x123, 7}, "12", {12, 0}), - })), ); - -INSTANTIATE_TEST_CASE_P( - OpSwitchRoundTripUnsignedIntegers, RoundTripTest, - ValuesIn(std::vector({ - // Unsigned 16-bit. - "%1 = OpTypeInt 16 0\n%2 = OpConstant %1 65535\nOpSwitch %2 %3\n", - // Unsigned 32-bit, three non-default cases. - "%1 = OpTypeInt 32 0\n%2 = OpConstant %1 123456\n" - "OpSwitch %2 %3 100 %4 102 %5 1000000 %6\n", - // Unsigned 48-bit, three non-default cases. - "%1 = OpTypeInt 48 0\n%2 = OpConstant %1 5000000000\n" - "OpSwitch %2 %3 100 %4 102 %5 6000000000 %6\n", - // Unsigned 64-bit, three non-default cases. - "%1 = OpTypeInt 64 0\n%2 = OpConstant %1 9223372036854775807\n" - "OpSwitch %2 %3 100 %4 102 %5 9000000000000000000 %6\n", - })), ); - -INSTANTIATE_TEST_CASE_P( - OpSwitchRoundTripSignedIntegers, RoundTripTest, - ValuesIn(std::vector{ - // Signed 16-bit, with two non-default cases - "%1 = OpTypeInt 16 1\n%2 = OpConstant %1 32767\n" - "OpSwitch %2 %3 99 %4 -102 %5\n", - "%1 = OpTypeInt 16 1\n%2 = OpConstant %1 -32768\n" - "OpSwitch %2 %3 99 %4 -102 %5\n", - // Signed 32-bit, two non-default cases. - "%1 = OpTypeInt 32 1\n%2 = OpConstant %1 -123456\n" - "OpSwitch %2 %3 100 %4 -123456 %5\n", - "%1 = OpTypeInt 32 1\n%2 = OpConstant %1 123456\n" - "OpSwitch %2 %3 100 %4 123456 %5\n", - // Signed 48-bit, three non-default cases. - "%1 = OpTypeInt 48 1\n%2 = OpConstant %1 5000000000\n" - "OpSwitch %2 %3 100 %4 -7000000000 %5 6000000000 %6\n", - "%1 = OpTypeInt 48 1\n%2 = OpConstant %1 -5000000000\n" - "OpSwitch %2 %3 100 %4 -7000000000 %5 6000000000 %6\n", - // Signed 64-bit, three non-default cases. - "%1 = OpTypeInt 64 1\n%2 = OpConstant %1 9223372036854775807\n" - "OpSwitch %2 %3 100 %4 7000000000 %5 -1000000000000000000 %6\n", - "%1 = OpTypeInt 64 1\n%2 = OpConstant %1 -9223372036854775808\n" - "OpSwitch %2 %3 100 %4 7000000000 %5 -1000000000000000000 %6\n", - }), ); - -using OpSwitchInvalidTypeTestCase = - spvtest::TextToBinaryTestBase>; - -TEST_P(OpSwitchInvalidTypeTestCase, InvalidTypes) { - const std::string input = - "%1 = " + GetParam() + - "\n" - "%3 = OpCopyObject %1 %2\n" // We only care the type of the expression - "%4 = OpSwitch %3 %default 32 %c\n"; - EXPECT_THAT(CompileFailure(input), - Eq("The selector operand for OpSwitch must be the result of an " - "instruction that generates an integer scalar")); -} - -// clang-format off -INSTANTIATE_TEST_CASE_P( - TextToBinaryOpSwitchInvalidTests, OpSwitchInvalidTypeTestCase, - ValuesIn(std::vector{ - {"OpTypeVoid", - "OpTypeBool", - "OpTypeFloat 32", - "OpTypeVector %a 32", - "OpTypeMatrix %a 32", - "OpTypeImage %a 1D 0 0 0 0 Unknown", - "OpTypeSampler", - "OpTypeSampledImage %a", - "OpTypeArray %a %b", - "OpTypeRuntimeArray %a", - "OpTypeStruct %a", - "OpTypeOpaque \"Foo\"", - "OpTypePointer UniformConstant %a", - "OpTypeFunction %a %b", - "OpTypeEvent", - "OpTypeDeviceEvent", - "OpTypeReserveId", - "OpTypeQueue", - "OpTypePipe ReadOnly", - "OpTypeForwardPointer %a UniformConstant", - // At least one thing that isn't a type at all - "OpNot %a %b" - }, - }),); -// clang-format on - -// TODO(dneto): OpPhi -// TODO(dneto): OpLoopMerge -// TODO(dneto): OpLabel -// TODO(dneto): OpBranch -// TODO(dneto): OpSwitch -// TODO(dneto): OpKill -// TODO(dneto): OpReturn -// TODO(dneto): OpReturnValue -// TODO(dneto): OpUnreachable -// TODO(dneto): OpLifetimeStart -// TODO(dneto): OpLifetimeStop - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.debug_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.debug_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.debug_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.debug_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,211 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Assembler tests for instructions in the "Debug" section of the -// SPIR-V spec. - -#include "unit_spirv.h" - -#include - -#include "test_fixture.h" -#include "gmock/gmock.h" - -namespace { - -using spvtest::MakeInstruction; -using spvtest::MakeVector; -using spvtest::TextToBinaryTest; -using ::testing::Eq; - -// Test OpSource - -// A single test case for OpSource -struct LanguageCase { - uint32_t get_language_value() const { - return static_cast(language_value); - } - const char* language_name; - SpvSourceLanguage language_value; - uint32_t version; -}; - -// clang-format off -// The list of OpSource cases to use. -const LanguageCase kLanguageCases[] = { -#define CASE(NAME, VERSION) \ - { #NAME, SpvSourceLanguage##NAME, VERSION } - CASE(Unknown, 0), - CASE(Unknown, 999), - CASE(ESSL, 310), - CASE(GLSL, 450), - CASE(OpenCL_C, 120), - CASE(OpenCL_C, 200), - CASE(OpenCL_C, 210), - CASE(OpenCL_CPP, 210), - CASE(HLSL, 5), - CASE(HLSL, 6), -#undef CASE -}; -// clang-format on - -using OpSourceTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(OpSourceTest, AnyLanguage) { - const std::string input = std::string("OpSource ") + - GetParam().language_name + " " + - std::to_string(GetParam().version); - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpSource, {GetParam().get_language_value(), - GetParam().version}))); -} - -INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpSourceTest, - ::testing::ValuesIn(kLanguageCases), ); - -TEST_F(OpSourceTest, WrongLanguage) { - EXPECT_THAT(CompileFailure("OpSource xxyyzz 12345"), - Eq("Invalid source language 'xxyyzz'.")); -} - -TEST_F(TextToBinaryTest, OpSourceAcceptsOptionalFileId) { - // In the grammar, the file id is an OperandOptionalId. - const std::string input = "OpSource GLSL 450 %file_id"; - EXPECT_THAT( - CompiledInstructions(input), - Eq(MakeInstruction(SpvOpSource, {SpvSourceLanguageGLSL, 450, 1}))); -} - -TEST_F(TextToBinaryTest, OpSourceAcceptsOptionalSourceText) { - std::string fake_source = "To be or not to be"; - const std::string input = - "OpSource GLSL 450 %file_id \"" + fake_source + "\""; - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpSource, {SpvSourceLanguageGLSL, 450, 1}, - MakeVector(fake_source)))); -} - -// Test OpSourceContinued - -using OpSourceContinuedTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(OpSourceContinuedTest, AnyExtension) { - // TODO(dneto): utf-8, quoting, escaping - const std::string input = - std::string("OpSourceContinued \"") + GetParam() + "\""; - EXPECT_THAT( - CompiledInstructions(input), - Eq(MakeInstruction(SpvOpSourceContinued, MakeVector(GetParam())))); -} - -// TODO(dneto): utf-8, quoting, escaping -INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpSourceContinuedTest, - ::testing::ValuesIn(std::vector{ - "", "foo bar this and that"}), ); - -// Test OpSourceExtension - -using OpSourceExtensionTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(OpSourceExtensionTest, AnyExtension) { - // TODO(dneto): utf-8, quoting, escaping - const std::string input = - std::string("OpSourceExtension \"") + GetParam() + "\""; - EXPECT_THAT( - CompiledInstructions(input), - Eq(MakeInstruction(SpvOpSourceExtension, MakeVector(GetParam())))); -} - -// TODO(dneto): utf-8, quoting, escaping -INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpSourceExtensionTest, - ::testing::ValuesIn(std::vector{ - "", "foo bar this and that"}), ); - -TEST_F(TextToBinaryTest, OpLine) { - EXPECT_THAT(CompiledInstructions("OpLine %srcfile 42 99"), - Eq(MakeInstruction(SpvOpLine, {1, 42, 99}))); -} - -TEST_F(TextToBinaryTest, OpNoLine) { - EXPECT_THAT(CompiledInstructions("OpNoLine"), - Eq(MakeInstruction(SpvOpNoLine, {}))); -} - -using OpStringTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(OpStringTest, AnyString) { - // TODO(dneto): utf-8, quoting, escaping - const std::string input = - std::string("%result = OpString \"") + GetParam() + "\""; - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpString, {1}, MakeVector(GetParam())))); -} - -// TODO(dneto): utf-8, quoting, escaping -INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpStringTest, - ::testing::ValuesIn(std::vector{ - "", "foo bar this and that"}), ); - -using OpNameTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(OpNameTest, AnyString) { - const std::string input = - std::string("OpName %target \"") + GetParam() + "\""; - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpName, {1}, MakeVector(GetParam())))); -} - -// UTF-8, quoting, escaping, etc. are covered in the StringLiterals tests in -// BinaryToText.Literal.cpp. -INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpNameTest, - ::testing::Values("", "foo bar this and that"), ); - -using OpMemberNameTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(OpMemberNameTest, AnyString) { - // TODO(dneto): utf-8, quoting, escaping - const std::string input = - std::string("OpMemberName %type 42 \"") + GetParam() + "\""; - EXPECT_THAT( - CompiledInstructions(input), - Eq(MakeInstruction(SpvOpMemberName, {1, 42}, MakeVector(GetParam())))); -} - -// TODO(dneto): utf-8, quoting, escaping -INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpMemberNameTest, - ::testing::ValuesIn(std::vector{ - "", "foo bar this and that"}), ); - -// TODO(dneto): Parse failures? - -using OpModuleProcessedTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(OpModuleProcessedTest, AnyString) { - const std::string input = - std::string("OpModuleProcessed \"") + GetParam() + "\""; - EXPECT_THAT( - CompiledInstructions(input, SPV_ENV_UNIVERSAL_1_1), - Eq(MakeInstruction(SpvOpModuleProcessed, MakeVector(GetParam())))); -} - -INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpModuleProcessedTest, - ::testing::Values("", "foo bar this and that"), ); -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.device_side_enqueue_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.device_side_enqueue_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.device_side_enqueue_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.device_side_enqueue_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,107 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Assembler tests for instructions in the "Device-Side Enqueue Instructions" -// section of the SPIR-V spec. - -#include "unit_spirv.h" - -#include "gmock/gmock.h" -#include "test_fixture.h" - -namespace { -using spvtest::MakeInstruction; -using ::testing::Eq; - -// Test OpEnqueueKernel - -struct KernelEnqueueCase { - std::string local_size_source; - std::vector local_size_operands; -}; - -using OpEnqueueKernelGood = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(OpEnqueueKernelGood, Sample) { - const std::string input = - "%result = OpEnqueueKernel %type %queue %flags %NDRange %num_events" - " %wait_events %ret_event %invoke %param %param_size %param_align " + - GetParam().local_size_source; - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpEnqueueKernel, - {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, - GetParam().local_size_operands))); -} - -INSTANTIATE_TEST_CASE_P( - TextToBinaryTest, OpEnqueueKernelGood, - ::testing::ValuesIn(std::vector{ - // Provide IDs for pointer-to-local arguments for the - // invoked function. - // Test up to 10 such arguments. - // I (dneto) can't find a limit on the number of kernel - // arguments in OpenCL C 2.0 Rev 29, e.g. in section 6.9 - // Restrictions. - {"", {}}, - {"%l0", {13}}, - {"%l0 %l1", {13, 14}}, - {"%l0 %l1 %l2", {13, 14, 15}}, - {"%l0 %l1 %l2 %l3", {13, 14, 15, 16}}, - {"%l0 %l1 %l2 %l3 %l4", {13, 14, 15, 16, 17}}, - {"%l0 %l1 %l2 %l3 %l4 %l5", {13, 14, 15, 16, 17, 18}}, - {"%l0 %l1 %l2 %l3 %l4 %l5 %l6", {13, 14, 15, 16, 17, 18, 19}}, - {"%l0 %l1 %l2 %l3 %l4 %l5 %l6 %l7", {13, 14, 15, 16, 17, 18, 19, 20}}, - {"%l0 %l1 %l2 %l3 %l4 %l5 %l6 %l7 %l8", - {13, 14, 15, 16, 17, 18, 19, 20, 21}}, - {"%l0 %l1 %l2 %l3 %l4 %l5 %l6 %l7 %l8 %l9", - {13, 14, 15, 16, 17, 18, 19, 20, 21, 22}}, - }),); - -// Test some bad parses of OpEnqueueKernel. For other cases, we're relying -// on the uniformity of the parsing algorithm. The following two tests, ensure -// that every required ID operand is specified, and is actually an ID operand. -using OpKernelEnqueueBad = spvtest::TextToBinaryTest; - -TEST_F(OpKernelEnqueueBad, MissingLastOperand) { - EXPECT_THAT( - CompileFailure( - "%result = OpEnqueueKernel %type %queue %flags %NDRange %num_events" - " %wait_events %ret_event %invoke %param %param_size"), - Eq("Expected operand, found end of stream.")); -} - -TEST_F(OpKernelEnqueueBad, InvalidLastOperand) { - EXPECT_THAT( - CompileFailure( - "%result = OpEnqueueKernel %type %queue %flags %NDRange %num_events" - " %wait_events %ret_event %invoke %param %param_size 42"), - Eq("Expected id to start with %.")); -} - -// TODO(dneto): OpEnqueueMarker -// TODO(dneto): OpGetKernelNDRangeSubGroupCount -// TODO(dneto): OpGetKernelNDRangeMaxSubGroupSize -// TODO(dneto): OpGetKernelWorkGroupSize -// TODO(dneto): OpGetKernelPreferredWorkGroupSizeMultiple -// TODO(dneto): OpRetainEvent -// TODO(dneto): OpReleaseEvent -// TODO(dneto): OpCreateUserEvent -// TODO(dneto): OpSetUserEventStatus -// TODO(dneto): OpCaptureEventProfilingInfo -// TODO(dneto): OpGetDefaultQueue -// TODO(dneto): OpBuildNDRange -// TODO(dneto): OpBuildNDRange - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.extension_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.extension_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.extension_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.extension_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,423 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Assembler tests for instructions in the "Extension Instruction" section -// of the SPIR-V spec. - -#include "unit_spirv.h" - -#include "test_fixture.h" -#include "gmock/gmock.h" -#include "spirv/1.0/GLSL.std.450.h" -#include "spirv/1.0/OpenCL.std.h" - -namespace { - -using spvtest::Concatenate; -using spvtest::MakeInstruction; -using spvtest::MakeVector; -using spvtest::TextToBinaryTest; -using ::testing::Combine; -using ::testing::Eq; -using ::testing::Values; -using ::testing::ValuesIn; - -TEST_F(TextToBinaryTest, InvalidExtInstImportName) { - EXPECT_THAT(CompileFailure("%1 = OpExtInstImport \"Haskell.std\""), - Eq("Invalid extended instruction import 'Haskell.std'")); -} - -TEST_F(TextToBinaryTest, InvalidImportId) { - EXPECT_THAT(CompileFailure("%1 = OpTypeVoid\n" - "%2 = OpExtInst %1 %1"), - Eq("Invalid extended instruction import Id 2")); -} - -TEST_F(TextToBinaryTest, InvalidImportInstruction) { - const std::string input = R"(%1 = OpTypeVoid - %2 = OpExtInstImport "OpenCL.std" - %3 = OpExtInst %1 %2 not_in_the_opencl)"; - EXPECT_THAT(CompileFailure(input), - Eq("Invalid extended instruction name 'not_in_the_opencl'.")); -} - -TEST_F(TextToBinaryTest, MultiImport) { - const std::string input = R"(%2 = OpExtInstImport "OpenCL.std" - %2 = OpExtInstImport "OpenCL.std")"; - EXPECT_THAT(CompileFailure(input), - Eq("Import Id is being defined a second time")); -} - -TEST_F(TextToBinaryTest, TooManyArguments) { - const std::string input = R"(%opencl = OpExtInstImport "OpenCL.std" - %2 = OpExtInst %float %opencl cos %x %oops")"; - EXPECT_THAT(CompileFailure(input), Eq("Expected '=', found end of stream.")); -} - -TEST_F(TextToBinaryTest, ExtInstFromTwoDifferentImports) { - const std::string input = R"(%1 = OpExtInstImport "OpenCL.std" -%2 = OpExtInstImport "GLSL.std.450" -%4 = OpExtInst %3 %1 native_sqrt %5 -%7 = OpExtInst %6 %2 MatrixInverse %8 -)"; - - // Make sure it assembles correctly. - EXPECT_THAT( - CompiledInstructions(input), - Eq(Concatenate({ - MakeInstruction(SpvOpExtInstImport, {1}, MakeVector("OpenCL.std")), - MakeInstruction(SpvOpExtInstImport, {2}, MakeVector("GLSL.std.450")), - MakeInstruction( - SpvOpExtInst, - {3, 4, 1, uint32_t(OpenCLLIB::Entrypoints::Native_sqrt), 5}), - MakeInstruction(SpvOpExtInst, - {6, 7, 2, uint32_t(GLSLstd450MatrixInverse), 8}), - }))); - - // Make sure it disassembles correctly. - EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(input)); -} - - -// A test case for assembling into words in an instruction. -struct AssemblyCase { - std::string input; - std::vector expected; -}; - -using ExtensionAssemblyTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>>; - -TEST_P(ExtensionAssemblyTest, Samples) { - const spv_target_env& env = std::get<0>(GetParam()); - const AssemblyCase& ac = std::get<1>(GetParam()); - - // Check that it assembles correctly. - EXPECT_THAT(CompiledInstructions(ac.input, env), Eq(ac.expected)); -} - -using ExtensionRoundTripTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>>; - -TEST_P(ExtensionRoundTripTest, Samples) { - const spv_target_env& env = std::get<0>(GetParam()); - const AssemblyCase& ac = std::get<1>(GetParam()); - - // Check that it assembles correctly. - EXPECT_THAT(CompiledInstructions(ac.input, env), Eq(ac.expected)); - - // Check round trip through the disassembler. - EXPECT_THAT(EncodeAndDecodeSuccessfully(ac.input, - SPV_BINARY_TO_TEXT_OPTION_NONE, env), - Eq(ac.input)); -} - -// SPV_KHR_shader_ballot - -INSTANTIATE_TEST_CASE_P( - SPV_KHR_shader_ballot, ExtensionRoundTripTest, - // We'll get coverage over operand tables by trying the universal - // environments, and at least one specific environment. - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_VULKAN_1_0), - ValuesIn(std::vector{ - {"OpCapability SubgroupBallotKHR\n", - MakeInstruction(SpvOpCapability, - {SpvCapabilitySubgroupBallotKHR})}, - {"%2 = OpSubgroupBallotKHR %1 %3\n", - MakeInstruction(SpvOpSubgroupBallotKHR, {1, 2, 3})}, - {"%2 = OpSubgroupFirstInvocationKHR %1 %3\n", - MakeInstruction(SpvOpSubgroupFirstInvocationKHR, {1, 2, 3})}, - {"OpDecorate %1 BuiltIn SubgroupEqMaskKHR\n", - MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, - SpvBuiltInSubgroupEqMaskKHR})}, - {"OpDecorate %1 BuiltIn SubgroupGeMaskKHR\n", - MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, - SpvBuiltInSubgroupGeMaskKHR})}, - {"OpDecorate %1 BuiltIn SubgroupGtMaskKHR\n", - MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, - SpvBuiltInSubgroupGtMaskKHR})}, - {"OpDecorate %1 BuiltIn SubgroupLeMaskKHR\n", - MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, - SpvBuiltInSubgroupLeMaskKHR})}, - {"OpDecorate %1 BuiltIn SubgroupLtMaskKHR\n", - MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, - SpvBuiltInSubgroupLtMaskKHR})}, - })), ); - -// SPV_KHR_shader_draw_parameters - -INSTANTIATE_TEST_CASE_P( - SPV_KHR_shader_draw_parameters, ExtensionRoundTripTest, - // We'll get coverage over operand tables by trying the universal - // environments, and at least one specific environment. - Combine( - Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_VULKAN_1_0), - ValuesIn(std::vector{ - {"OpCapability DrawParameters\n", - MakeInstruction(SpvOpCapability, {SpvCapabilityDrawParameters})}, - {"OpDecorate %1 BuiltIn BaseVertex\n", - MakeInstruction(SpvOpDecorate, - {1, SpvDecorationBuiltIn, SpvBuiltInBaseVertex})}, - {"OpDecorate %1 BuiltIn BaseInstance\n", - MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, - SpvBuiltInBaseInstance})}, - {"OpDecorate %1 BuiltIn DrawIndex\n", - MakeInstruction(SpvOpDecorate, - {1, SpvDecorationBuiltIn, SpvBuiltInDrawIndex})}, - })), ); - -// SPV_KHR_subgroup_vote - -INSTANTIATE_TEST_CASE_P( - SPV_KHR_subgroup_vote, ExtensionRoundTripTest, - // We'll get coverage over operand tables by trying the universal - // environments, and at least one specific environment. - Combine( - Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_VULKAN_1_0), - ValuesIn(std::vector{ - {"OpCapability SubgroupVoteKHR\n", - MakeInstruction(SpvOpCapability, {SpvCapabilitySubgroupVoteKHR})}, - {"%2 = OpSubgroupAnyKHR %1 %3\n", - MakeInstruction(SpvOpSubgroupAnyKHR, {1, 2, 3})}, - {"%2 = OpSubgroupAllKHR %1 %3\n", - MakeInstruction(SpvOpSubgroupAllKHR, {1, 2, 3})}, - {"%2 = OpSubgroupAllEqualKHR %1 %3\n", - MakeInstruction(SpvOpSubgroupAllEqualKHR, {1, 2, 3})}, - })), ); - -// SPV_KHR_16bit_storage - -INSTANTIATE_TEST_CASE_P( - SPV_KHR_16bit_storage, ExtensionRoundTripTest, - // We'll get coverage over operand tables by trying the universal - // environments, and at least one specific environment. - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_VULKAN_1_0), - ValuesIn(std::vector{ - {"OpCapability StorageBuffer16BitAccess\n", - MakeInstruction(SpvOpCapability, - {SpvCapabilityStorageUniformBufferBlock16})}, - {"OpCapability StorageBuffer16BitAccess\n", - MakeInstruction(SpvOpCapability, - {SpvCapabilityStorageBuffer16BitAccess})}, - {"OpCapability UniformAndStorageBuffer16BitAccess\n", - MakeInstruction( - SpvOpCapability, - {SpvCapabilityUniformAndStorageBuffer16BitAccess})}, - {"OpCapability UniformAndStorageBuffer16BitAccess\n", - MakeInstruction(SpvOpCapability, - {SpvCapabilityStorageUniform16})}, - {"OpCapability StoragePushConstant16\n", - MakeInstruction(SpvOpCapability, - {SpvCapabilityStoragePushConstant16})}, - {"OpCapability StorageInputOutput16\n", - MakeInstruction(SpvOpCapability, - {SpvCapabilityStorageInputOutput16})}, - })), ); - -INSTANTIATE_TEST_CASE_P( - SPV_KHR_16bit_storage_alias_check, ExtensionAssemblyTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_VULKAN_1_0), - ValuesIn(std::vector{ - // The old name maps to the new enum. - {"OpCapability StorageUniformBufferBlock16\n", - MakeInstruction(SpvOpCapability, - {SpvCapabilityStorageBuffer16BitAccess})}, - // The old name maps to the new enum. - {"OpCapability StorageUniform16\n", - MakeInstruction( - SpvOpCapability, - {SpvCapabilityUniformAndStorageBuffer16BitAccess})}, - })), ); - -// SPV_KHR_device_group - -INSTANTIATE_TEST_CASE_P( - SPV_KHR_device_group, ExtensionRoundTripTest, - // We'll get coverage over operand tables by trying the universal - // environments, and at least one specific environment. - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_VULKAN_1_0), - ValuesIn(std::vector{ - {"OpCapability DeviceGroup\n", - MakeInstruction(SpvOpCapability, {SpvCapabilityDeviceGroup})}, - {"OpDecorate %1 BuiltIn DeviceIndex\n", - MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, - SpvBuiltInDeviceIndex})}, - })), ); - -// SPV_KHR_multiview - -INSTANTIATE_TEST_CASE_P( - SPV_KHR_multiview, ExtensionRoundTripTest, - // We'll get coverage over operand tables by trying the universal - // environments, and at least one specific environment. - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_VULKAN_1_0), - ValuesIn(std::vector{ - {"OpCapability MultiView\n", - MakeInstruction(SpvOpCapability, {SpvCapabilityMultiView})}, - {"OpDecorate %1 BuiltIn ViewIndex\n", - MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn, - SpvBuiltInViewIndex})}, - })), ); - - -// SPV_AMD_shader_explicit_vertex_parameter - -#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_shader_explicit_vertex_parameter\"\n" -INSTANTIATE_TEST_CASE_P( - SPV_AMD_shader_explicit_vertex_parameter, ExtensionRoundTripTest, - // We'll get coverage over operand tables by trying the universal - // environments, and at least one specific environment. - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_VULKAN_1_0), - ValuesIn(std::vector{ - {PREAMBLE "%3 = OpExtInst %2 %1 InterpolateAtVertexAMD %4 %5\n", - Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("SPV_AMD_shader_explicit_vertex_parameter")), - MakeInstruction(SpvOpExtInst, {2, 3, 1, 1, 4, 5})})}, - })), ); -#undef PREAMBLE - - -// SPV_AMD_shader_trinary_minmax - -#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_shader_trinary_minmax\"\n" -INSTANTIATE_TEST_CASE_P( - SPV_AMD_shader_trinary_minmax, ExtensionRoundTripTest, - // We'll get coverage over operand tables by trying the universal - // environments, and at least one specific environment. - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_VULKAN_1_0), - ValuesIn(std::vector{ - {PREAMBLE "%3 = OpExtInst %2 %1 FMin3AMD %4 %5 %6\n", - Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("SPV_AMD_shader_trinary_minmax")), - MakeInstruction(SpvOpExtInst, {2, 3, 1, 1, 4, 5, 6})})}, - {PREAMBLE "%3 = OpExtInst %2 %1 UMin3AMD %4 %5 %6\n", - Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("SPV_AMD_shader_trinary_minmax")), - MakeInstruction(SpvOpExtInst, {2, 3, 1, 2, 4, 5, 6})})}, - {PREAMBLE "%3 = OpExtInst %2 %1 SMin3AMD %4 %5 %6\n", - Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("SPV_AMD_shader_trinary_minmax")), - MakeInstruction(SpvOpExtInst, {2, 3, 1, 3, 4, 5, 6})})}, - {PREAMBLE "%3 = OpExtInst %2 %1 FMax3AMD %4 %5 %6\n", - Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("SPV_AMD_shader_trinary_minmax")), - MakeInstruction(SpvOpExtInst, {2, 3, 1, 4, 4, 5, 6})})}, - {PREAMBLE "%3 = OpExtInst %2 %1 UMax3AMD %4 %5 %6\n", - Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("SPV_AMD_shader_trinary_minmax")), - MakeInstruction(SpvOpExtInst, {2, 3, 1, 5, 4, 5, 6})})}, - {PREAMBLE "%3 = OpExtInst %2 %1 SMax3AMD %4 %5 %6\n", - Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("SPV_AMD_shader_trinary_minmax")), - MakeInstruction(SpvOpExtInst, {2, 3, 1, 6, 4, 5, 6})})}, - {PREAMBLE "%3 = OpExtInst %2 %1 FMid3AMD %4 %5 %6\n", - Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("SPV_AMD_shader_trinary_minmax")), - MakeInstruction(SpvOpExtInst, {2, 3, 1, 7, 4, 5, 6})})}, - {PREAMBLE "%3 = OpExtInst %2 %1 UMid3AMD %4 %5 %6\n", - Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("SPV_AMD_shader_trinary_minmax")), - MakeInstruction(SpvOpExtInst, {2, 3, 1, 8, 4, 5, 6})})}, - {PREAMBLE "%3 = OpExtInst %2 %1 SMid3AMD %4 %5 %6\n", - Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("SPV_AMD_shader_trinary_minmax")), - MakeInstruction(SpvOpExtInst, {2, 3, 1, 9, 4, 5, 6})})}, - })), ); -#undef PREAMBLE - - -// SPV_AMD_gcn_shader - -#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_gcn_shader\"\n" -INSTANTIATE_TEST_CASE_P( - SPV_AMD_gcn_shader, ExtensionRoundTripTest, - // We'll get coverage over operand tables by trying the universal - // environments, and at least one specific environment. - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_VULKAN_1_0), - ValuesIn(std::vector{ - {PREAMBLE "%3 = OpExtInst %2 %1 CubeFaceIndexAMD %4\n", - Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("SPV_AMD_gcn_shader")), - MakeInstruction(SpvOpExtInst, {2, 3, 1, 1, 4})})}, - {PREAMBLE "%3 = OpExtInst %2 %1 CubeFaceCoordAMD %4\n", - Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("SPV_AMD_gcn_shader")), - MakeInstruction(SpvOpExtInst, {2, 3, 1, 2, 4})})}, - {PREAMBLE "%3 = OpExtInst %2 %1 TimeAMD\n", - Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("SPV_AMD_gcn_shader")), - MakeInstruction(SpvOpExtInst, {2, 3, 1, 3})})}, - })), ); -#undef PREAMBLE - - -// SPV_AMD_shader_ballot - -#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_shader_ballot\"\n" -INSTANTIATE_TEST_CASE_P( - SPV_AMD_shader_ballot, ExtensionRoundTripTest, - // We'll get coverage over operand tables by trying the universal - // environments, and at least one specific environment. - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_VULKAN_1_0), - ValuesIn(std::vector{ - {PREAMBLE "%3 = OpExtInst %2 %1 SwizzleInvocationsAMD %4 %5\n", - Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("SPV_AMD_shader_ballot")), - MakeInstruction(SpvOpExtInst, {2, 3, 1, 1, 4, 5})})}, - {PREAMBLE "%3 = OpExtInst %2 %1 SwizzleInvocationsMaskedAMD %4 %5\n", - Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("SPV_AMD_shader_ballot")), - MakeInstruction(SpvOpExtInst, {2, 3, 1, 2, 4, 5})})}, - {PREAMBLE "%3 = OpExtInst %2 %1 WriteInvocationAMD %4 %5 %6\n", - Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("SPV_AMD_shader_ballot")), - MakeInstruction(SpvOpExtInst, {2, 3, 1, 3, 4, 5, 6})})}, - {PREAMBLE "%3 = OpExtInst %2 %1 MbcntAMD %4\n", - Concatenate({MakeInstruction(SpvOpExtInstImport, {1}, - MakeVector("SPV_AMD_shader_ballot")), - MakeInstruction(SpvOpExtInst, {2, 3, 1, 4, 4})})}, - })), ); -#undef PREAMBLE - - -// SPV_KHR_variable_pointers - -INSTANTIATE_TEST_CASE_P( - SPV_KHR_variable_pointers, ExtensionRoundTripTest, - // We'll get coverage over operand tables by trying the universal - // environments, and at least one specific environment. - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, - SPV_ENV_VULKAN_1_0), - ValuesIn(std::vector{ - {"OpCapability VariablePointers\n", - MakeInstruction(SpvOpCapability, - {SpvCapabilityVariablePointers})}, - {"OpCapability VariablePointersStorageBuffer\n", - MakeInstruction( - SpvOpCapability, - {SpvCapabilityVariablePointersStorageBuffer})}, - })), ); - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.function_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.function_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.function_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.function_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Assembler tests for instructions in the "Function" section of the -// SPIR-V spec. - -#include "unit_spirv.h" - -#include "gmock/gmock.h" -#include "test_fixture.h" - -namespace { - -using spvtest::EnumCase; -using spvtest::MakeInstruction; -using spvtest::TextToBinaryTest; -using ::testing::Eq; - -// Test OpFunction - -using OpFunctionControlTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>>; - -TEST_P(OpFunctionControlTest, AnySingleFunctionControlMask) { - const std::string input = "%result_id = OpFunction %result_type " + - GetParam().name() + " %function_type "; - EXPECT_THAT( - CompiledInstructions(input), - Eq(MakeInstruction(SpvOpFunction, {1, 2, GetParam().value(), 3}))); -} - -// clang-format off -#define CASE(VALUE,NAME) { SpvFunctionControl##VALUE, NAME } -INSTANTIATE_TEST_CASE_P(TextToBinaryFunctionTest, OpFunctionControlTest, - ::testing::ValuesIn(std::vector>{ - CASE(MaskNone, "None"), - CASE(InlineMask, "Inline"), - CASE(DontInlineMask, "DontInline"), - CASE(PureMask, "Pure"), - CASE(ConstMask, "Const"), - }),); -#undef CASE -// clang-format on - -TEST_F(OpFunctionControlTest, CombinedFunctionControlMask) { - // Sample a single combination. This ensures we've integrated - // the instruction parsing logic with spvTextParseMask. - const std::string input = - "%result_id = OpFunction %result_type Inline|Pure|Const %function_type"; - const uint32_t expected_mask = SpvFunctionControlInlineMask | - SpvFunctionControlPureMask | - SpvFunctionControlConstMask; - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpFunction, {1, 2, expected_mask, 3}))); -} - -TEST_F(OpFunctionControlTest, WrongFunctionControl) { - EXPECT_THAT(CompileFailure("%r = OpFunction %t Inline|Unroll %ft"), - Eq("Invalid function control operand 'Inline|Unroll'.")); -} - -// TODO(dneto): OpFunctionParameter -// TODO(dneto): OpFunctionEnd -// TODO(dneto): OpFunctionCall - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.group_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.group_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.group_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.group_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Assembler tests for instructions in the "Group Instrucions" section of the -// SPIR-V spec. - -#include "unit_spirv.h" - -#include "gmock/gmock.h" -#include "test_fixture.h" - -namespace { - -using spvtest::EnumCase; -using spvtest::MakeInstruction; -using ::testing::Eq; - -// Test GroupOperation enum - -using GroupOperationTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>>; - -TEST_P(GroupOperationTest, AnyGroupOperation) { - const std::string input = - "%result = OpGroupIAdd %type %scope " + GetParam().name() + " %x"; - EXPECT_THAT( - CompiledInstructions(input), - Eq(MakeInstruction(SpvOpGroupIAdd, {1, 2, 3, GetParam().value(), 4}))); -} - -// clang-format off -#define CASE(NAME) { SpvGroupOperation##NAME, #NAME} -INSTANTIATE_TEST_CASE_P(TextToBinaryGroupOperation, GroupOperationTest, - ::testing::ValuesIn(std::vector>{ - CASE(Reduce), - CASE(InclusiveScan), - CASE(ExclusiveScan), - }),); -#undef CASE -// clang-format on - -TEST_F(GroupOperationTest, WrongGroupOperation) { - EXPECT_THAT(CompileFailure("%r = OpGroupUMin %t %e xxyyzz %x"), - Eq("Invalid group operation 'xxyyzz'.")); -} - -// TODO(dneto): OpGroupAsyncCopy -// TODO(dneto): OpGroupWaitEvents -// TODO(dneto): OpGroupAll -// TODO(dneto): OpGroupAny -// TODO(dneto): OpGroupBroadcast -// TODO(dneto): OpGroupIAdd -// TODO(dneto): OpGroupFAdd -// TODO(dneto): OpGroupFMin -// TODO(dneto): OpGroupUMin -// TODO(dneto): OpGroupSMin -// TODO(dneto): OpGroupFMax -// TODO(dneto): OpGroupUMax -// TODO(dneto): OpGroupSMax - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.image_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.image_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.image_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.image_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,273 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Assembler tests for instructions in the "Image Instructions" section of -// the SPIR-V spec. - -#include "unit_spirv.h" - -#include "gmock/gmock.h" -#include "test_fixture.h" - -namespace { - -using spvtest::MakeInstruction; -using spvtest::TextToBinaryTest; -using ::testing::Eq; - -// An example case for a mask value with operands. -struct ImageOperandsCase { - std::string image_operands; - // The expected mask, followed by its operands. - std::vector expected_mask_and_operands; -}; - -// Test all kinds of image operands. - -using ImageOperandsTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(ImageOperandsTest, Sample) { - const std::string input = - "%2 = OpImageFetch %1 %3 %4" + GetParam().image_operands + "\n"; - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpImageFetch, {1, 2, 3, 4}, - GetParam().expected_mask_and_operands))); -} - -#define MASK(NAME) SpvImageOperands##NAME##Mask -INSTANTIATE_TEST_CASE_P( - TextToBinaryImageOperandsAny, ImageOperandsTest, - ::testing::ValuesIn(std::vector{ - // TODO(dneto): Rev32 adds many more values, and rearranges their - // values. - // Image operands are optional. - {"", {}}, - // Test each kind, alone. - {" Bias %5", {MASK(Bias), 5}}, - {" Lod %5", {MASK(Lod), 5}}, - {" Grad %5 %6", {MASK(Grad), 5, 6}}, - {" ConstOffset %5", {MASK(ConstOffset), 5}}, - {" Offset %5", {MASK(Offset), 5}}, - {" ConstOffsets %5", {MASK(ConstOffsets), 5}}, - {" Sample %5", {MASK(Sample), 5}}, - {" MinLod %5", {MASK(MinLod), 5}}, - }),); -#undef MASK -#define MASK(NAME) static_cast(SpvImageOperands##NAME##Mask) -INSTANTIATE_TEST_CASE_P( - TextToBinaryImageOperandsCombination, ImageOperandsTest, - ::testing::ValuesIn(std::vector{ - // TODO(dneto): Rev32 adds many more values, and rearranges their - // values. - // Test adjacent pairs, so we can easily debug the values when it fails. - {" Bias|Lod %5 %6", {MASK(Bias) | MASK(Lod), 5, 6}}, - {" Lod|Grad %5 %6 %7", {MASK(Lod) | MASK(Grad), 5, 6, 7}}, - {" Grad|ConstOffset %5 %6 %7", - {MASK(Grad) | MASK(ConstOffset), 5, 6, 7}}, - {" ConstOffset|Offset %5 %6", - {MASK(ConstOffset) | MASK(Offset), 5, 6}}, - {" Offset|ConstOffsets %5 %6", - {MASK(Offset) | MASK(ConstOffsets), 5, 6}}, - {" ConstOffsets|Sample %5 %6", - {MASK(ConstOffsets) | MASK(Sample), 5, 6}}, - // Test all masks together. - {" Bias|Lod|Grad|ConstOffset|Offset|ConstOffsets|Sample" - " %5 %6 %7 %8 %9 %10 %11 %12", - {MASK(Bias) | MASK(Lod) | MASK(Grad) | MASK(ConstOffset) | - MASK(Offset) | MASK(ConstOffsets) | MASK(Sample), - 5, 6, 7, 8, 9, 10, 11, 12}}, - // The same, but with mask value names reversed. - {" Sample|ConstOffsets|Offset|ConstOffset|Grad|Lod|Bias" - " %5 %6 %7 %8 %9 %10 %11 %12", - {MASK(Bias) | MASK(Lod) | MASK(Grad) | MASK(ConstOffset) | - MASK(Offset) | MASK(ConstOffsets) | MASK(Sample), - 5, 6, 7, 8, 9, 10, 11, 12}}}),); -#undef MASK - -TEST_F(ImageOperandsTest, WrongOperand) { - EXPECT_THAT(CompileFailure("%r = OpImageFetch %t %i %c xxyyzz"), - Eq("Invalid image operand 'xxyyzz'.")); -} - -// Test OpImage - -using OpImageTest = TextToBinaryTest; - -TEST_F(OpImageTest, Valid) { - const std::string input = "%2 = OpImage %1 %3\n"; - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpImage, {1, 2, 3}))); - - // Test the disassembler. - EXPECT_THAT(EncodeAndDecodeSuccessfully(input), input); -} - -TEST_F(OpImageTest, InvalidTypeOperand) { - EXPECT_THAT(CompileFailure("%2 = OpImage 42"), - Eq("Expected id to start with %.")); -} - -TEST_F(OpImageTest, MissingSampledImageOperand) { - EXPECT_THAT(CompileFailure("%2 = OpImage %1"), - Eq("Expected operand, found end of stream.")); -} - -TEST_F(OpImageTest, InvalidSampledImageOperand) { - EXPECT_THAT(CompileFailure("%2 = OpImage %1 1000"), - Eq("Expected id to start with %.")); -} - -TEST_F(OpImageTest, TooManyOperands) { - // We should improve this message, to say what instruction we're trying to - // parse. - EXPECT_THAT(CompileFailure("%2 = OpImage %1 %3 %4"), // an Id - Eq("Expected '=', found end of stream.")); - - EXPECT_THAT(CompileFailure("%2 = OpImage %1 %3 99"), // a number - Eq("Expected or at the beginning of an " - "instruction, found '99'.")); - EXPECT_THAT(CompileFailure("%2 = OpImage %1 %3 \"abc\""), // a string - Eq("Expected or at the beginning of an " - "instruction, found '\"abc\"'.")); -} - -// Test OpImageSparseRead - -using OpImageSparseReadTest = TextToBinaryTest; - -TEST_F(OpImageSparseReadTest, OnlyRequiredOperands) { - const std::string input = "%2 = OpImageSparseRead %1 %3 %4\n"; - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpImageSparseRead, {1, 2, 3, 4}))); - // Test the disassembler. - EXPECT_THAT(EncodeAndDecodeSuccessfully(input), input); -} - -// Test all kinds of image operands on OpImageSparseRead - -using ImageSparseReadImageOperandsTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>; - -TEST_P(ImageSparseReadImageOperandsTest, Sample) { - const std::string input = - "%2 = OpImageSparseRead %1 %3 %4" + GetParam().image_operands + "\n"; - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpImageSparseRead, {1, 2, 3, 4}, - GetParam().expected_mask_and_operands))); - // Test the disassembler. - EXPECT_THAT(EncodeAndDecodeSuccessfully(input), input); -} - -#define MASK(NAME) SpvImageOperands##NAME##Mask -INSTANTIATE_TEST_CASE_P(ImageSparseReadImageOperandsAny, - ImageSparseReadImageOperandsTest, - ::testing::ValuesIn(std::vector{ - // Image operands are optional. - {"", {}}, - // Test each kind, alone. - {" Bias %5", {MASK(Bias), 5}}, - {" Lod %5", {MASK(Lod), 5}}, - {" Grad %5 %6", {MASK(Grad), 5, 6}}, - {" ConstOffset %5", {MASK(ConstOffset), 5}}, - {" Offset %5", {MASK(Offset), 5}}, - {" ConstOffsets %5", {MASK(ConstOffsets), 5}}, - {" Sample %5", {MASK(Sample), 5}}, - {" MinLod %5", {MASK(MinLod), 5}}, - }),); -#undef MASK -#define MASK(NAME) static_cast(SpvImageOperands##NAME##Mask) -INSTANTIATE_TEST_CASE_P( - ImageSparseReadImageOperandsCombination, ImageSparseReadImageOperandsTest, - ::testing::ValuesIn(std::vector{ - // values. - // Test adjacent pairs, so we can easily debug the values when it fails. - {" Bias|Lod %5 %6", {MASK(Bias) | MASK(Lod), 5, 6}}, - {" Lod|Grad %5 %6 %7", {MASK(Lod) | MASK(Grad), 5, 6, 7}}, - {" Grad|ConstOffset %5 %6 %7", - {MASK(Grad) | MASK(ConstOffset), 5, 6, 7}}, - {" ConstOffset|Offset %5 %6", {MASK(ConstOffset) | MASK(Offset), 5, 6}}, - {" Offset|ConstOffsets %5 %6", - {MASK(Offset) | MASK(ConstOffsets), 5, 6}}, - {" ConstOffsets|Sample %5 %6", - {MASK(ConstOffsets) | MASK(Sample), 5, 6}}, - // Test all masks together. - {" Bias|Lod|Grad|ConstOffset|Offset|ConstOffsets|Sample" - " %5 %6 %7 %8 %9 %10 %11 %12", - {MASK(Bias) | MASK(Lod) | MASK(Grad) | MASK(ConstOffset) | - MASK(Offset) | MASK(ConstOffsets) | MASK(Sample), - 5, 6, 7, 8, 9, 10, 11, 12}}, - // Don't try the masks reversed, since this is a round trip test, - // and the disassembler will sort them. - }),); -#undef MASK - -TEST_F(OpImageSparseReadTest, InvalidTypeOperand) { - EXPECT_THAT(CompileFailure("%2 = OpImageSparseRead 42"), - Eq("Expected id to start with %.")); -} - -TEST_F(OpImageSparseReadTest, MissingImageOperand) { - EXPECT_THAT(CompileFailure("%2 = OpImageSparseRead %1"), - Eq("Expected operand, found end of stream.")); -} - -TEST_F(OpImageSparseReadTest, InvalidImageOperand) { - EXPECT_THAT(CompileFailure("%2 = OpImageSparseRead %1 1000"), - Eq("Expected id to start with %.")); -} - -TEST_F(OpImageSparseReadTest, MissingCoordinateOperand) { - EXPECT_THAT(CompileFailure("%2 = OpImageSparseRead %1 %2"), - Eq("Expected operand, found end of stream.")); -} - -TEST_F(OpImageSparseReadTest, InvalidCoordinateOperand) { - EXPECT_THAT(CompileFailure("%2 = OpImageSparseRead %1 %2 1000"), - Eq("Expected id to start with %.")); -} - -// TODO(dneto): OpSampledImage -// TODO(dneto): OpImageSampleImplicitLod -// TODO(dneto): OpImageSampleExplicitLod -// TODO(dneto): OpImageSampleDrefImplicitLod -// TODO(dneto): OpImageSampleDrefExplicitLod -// TODO(dneto): OpImageSampleProjImplicitLod -// TODO(dneto): OpImageSampleProjExplicitLod -// TODO(dneto): OpImageSampleProjDrefImplicitLod -// TODO(dneto): OpImageSampleProjDrefExplicitLod -// TODO(dneto): OpImageGather -// TODO(dneto): OpImageDrefGather -// TODO(dneto): OpImageRead -// TODO(dneto): OpImageWrite -// TODO(dneto): OpImageQueryFormat -// TODO(dneto): OpImageQueryOrder -// TODO(dneto): OpImageQuerySizeLod -// TODO(dneto): OpImageQuerySize -// TODO(dneto): OpImageQueryLod -// TODO(dneto): OpImageQueryLevels -// TODO(dneto): OpImageQuerySamples -// TODO(dneto): OpImageSparseSampleImplicitLod -// TODO(dneto): OpImageSparseSampleExplicitLod -// TODO(dneto): OpImageSparseSampleDrefImplicitLod -// TODO(dneto): OpImageSparseSampleDrefExplicitLod -// TODO(dneto): OpImageSparseSampleProjImplicitLod -// TODO(dneto): OpImageSparseSampleProjExplicitLod -// TODO(dneto): OpImageSparseSampleProjDrefImplicitLod -// TODO(dneto): OpImageSparseSampleProjDrefExplicitLod -// TODO(dneto): OpImageSparseFetch -// TODO(dneto): OpImageSparseDrefGather -// TODO(dneto): OpImageSparseTexelsResident - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.literal_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.literal_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.literal_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.literal_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Assembler tests for literal numbers and literal strings. - -#include "test_fixture.h" - -namespace { - -using spvtest::TextToBinaryTest; - -TEST_F(TextToBinaryTest, LiteralStringInPlaceOfLiteralNumber) { - EXPECT_EQ( - R"(Invalid unsigned integer literal: "I shouldn't be a string")", - CompileFailure(R"(OpSource GLSL "I shouldn't be a string")")); -} - -TEST_F(TextToBinaryTest, GarbageInPlaceOfLiteralString) { - EXPECT_EQ("Invalid literal string 'nice-source-code'.", - CompileFailure("OpSourceExtension nice-source-code")); -} - -TEST_F(TextToBinaryTest, LiteralNumberInPlaceOfLiteralString) { - EXPECT_EQ("Expected literal string, found literal number '1000'.", - CompileFailure("OpSourceExtension 1000")); -} - -TEST_F(TextToBinaryTest, LiteralFloatInPlaceOfLiteralInteger) { - EXPECT_EQ("Invalid unsigned integer literal: 10.5", - CompileFailure("OpSource GLSL 10.5")); - - EXPECT_EQ("Invalid unsigned integer literal: 0.2", - CompileFailure(R"(OpMemberName %type 0.2 "member0.2")")); - - EXPECT_EQ("Invalid unsigned integer literal: 32.42", - CompileFailure("%int = OpTypeInt 32.42 0")); - - EXPECT_EQ("Invalid unsigned integer literal: 4.5", - CompileFailure("%mat = OpTypeMatrix %vec 4.5")); - - EXPECT_EQ("Invalid unsigned integer literal: 1.5", - CompileFailure("OpExecutionMode %main LocalSize 1.5 1.6 1.7")); - - EXPECT_EQ("Invalid unsigned integer literal: 0.123", - CompileFailure("%i32 = OpTypeInt 32 1\n" - "%c = OpConstant %i32 0.123")); -} - -TEST_F(TextToBinaryTest, LiteralInt64) { - const std::string code = - "%1 = OpTypeInt 64 0\n%2 = OpConstant %1 123456789021\n"; - EXPECT_EQ(code, EncodeAndDecodeSuccessfully(code)); -} - -TEST_F(TextToBinaryTest, LiteralDouble) { - const std::string code = - "%1 = OpTypeFloat 64\n%2 = OpSpecConstant %1 3.14159265358979\n"; - EXPECT_EQ(code, EncodeAndDecodeSuccessfully(code)); -} - -TEST_F(TextToBinaryTest, LiteralStringASCIILong) { - // SPIR-V allows strings up to 65535 characters. - // Test the simple case of UTF-8 code points corresponding - // to ASCII characters. - EXPECT_EQ(65535, SPV_LIMIT_LITERAL_STRING_UTF8_CHARS_MAX); - const std::string code = - "OpSourceExtension \"" + - std::string(SPV_LIMIT_LITERAL_STRING_UTF8_CHARS_MAX, 'o') + "\"\n"; - EXPECT_EQ(code, EncodeAndDecodeSuccessfully(code)); -} - -TEST_F(TextToBinaryTest, LiteralStringUTF8LongEncodings) { - // SPIR-V allows strings up to 65535 characters. - // Test the case of many Unicode characters, each of which has - // a 4-byte UTF-8 encoding. - - // An instruction is at most 65535 words long. The first one - // contains the wordcount and opcode. So the worst case number of - // 4-byte UTF-8 characters is 65533, since we also need to - // store a terminating null character. - - // This string fits exactly into 65534 words. - const std::string good_string = - spvtest::MakeLongUTF8String(65533) - // The following single character has a 3 byte encoding, - // which fits snugly against the terminating null. - + "\xe8\x80\x80"; - - // These strings will overflow any instruction with 0 or 1 other - // arguments, respectively. - const std::string bad_0_arg_string = spvtest::MakeLongUTF8String(65534); - const std::string bad_1_arg_string = spvtest::MakeLongUTF8String(65533); - - const std::string good_code = "OpSourceExtension \"" + good_string + "\"\n"; - EXPECT_EQ(good_code, EncodeAndDecodeSuccessfully(good_code)); - - // Prove that it works on more than one instruction. - const std::string good_code_2 = "OpSourceContinued \"" + good_string + "\"\n"; - EXPECT_EQ(good_code, EncodeAndDecodeSuccessfully(good_code)); - - // Failure cases. - EXPECT_EQ("Instruction too long: more than 65535 words.", - CompileFailure("OpSourceExtension \"" + bad_0_arg_string + "\"\n")); - EXPECT_EQ("Instruction too long: more than 65535 words.", - CompileFailure("OpSourceContinued \"" + bad_0_arg_string + "\"\n")); - EXPECT_EQ("Instruction too long: more than 65535 words.", - CompileFailure("OpName %target \"" + bad_1_arg_string + "\"\n")); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.memory_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.memory_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.memory_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.memory_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,108 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Assembler tests for instructions in the "Memory Instructions" section of -// the SPIR-V spec. - -#include "unit_spirv.h" - -#include - -#include "gmock/gmock.h" -#include "test_fixture.h" - -namespace { - -using spvtest::EnumCase; -using spvtest::MakeInstruction; -using spvtest::TextToBinaryTest; -using ::testing::Eq; - -// Test assembly of Memory Access masks - -using MemoryAccessTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>>; - -TEST_P(MemoryAccessTest, AnySingleMemoryAccessMask) { - std::stringstream input; - input << "OpStore %ptr %value " << GetParam().name(); - for (auto operand : GetParam().operands()) input << " " << operand; - EXPECT_THAT(CompiledInstructions(input.str()), - Eq(MakeInstruction(SpvOpStore, {1, 2, GetParam().value()}, - GetParam().operands()))); -} - -INSTANTIATE_TEST_CASE_P( - TextToBinaryMemoryAccessTest, MemoryAccessTest, - ::testing::ValuesIn(std::vector>{ - {SpvMemoryAccessMaskNone, "None", {}}, - {SpvMemoryAccessVolatileMask, "Volatile", {}}, - {SpvMemoryAccessAlignedMask, "Aligned", {16}}, - {SpvMemoryAccessNontemporalMask, "Nontemporal", {}}, - }),); - -TEST_F(TextToBinaryTest, CombinedMemoryAccessMask) { - const std::string input = "OpStore %ptr %value Volatile|Aligned 16"; - const uint32_t expected_mask = - SpvMemoryAccessVolatileMask | SpvMemoryAccessAlignedMask; - EXPECT_THAT(expected_mask, Eq(3u)); - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpStore, {1, 2, expected_mask, 16}))); -} - -// Test Storage Class enum values - -using StorageClassTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>>; - -TEST_P(StorageClassTest, AnyStorageClass) { - const std::string input = "%1 = OpVariable %2 " + GetParam().name(); - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpVariable, {1, 2, GetParam().value()}))); -} - -// clang-format off -#define CASE(NAME) { SpvStorageClass##NAME, #NAME, {} } -INSTANTIATE_TEST_CASE_P( - TextToBinaryStorageClassTest, StorageClassTest, - ::testing::ValuesIn(std::vector>{ - CASE(UniformConstant), - CASE(Input), - CASE(Uniform), - CASE(Output), - CASE(Workgroup), - CASE(CrossWorkgroup), - CASE(Private), - CASE(Function), - CASE(Generic), - CASE(PushConstant), - CASE(AtomicCounter), - CASE(Image), - }),); -#undef CASE -// clang-format on - -// TODO(dneto): OpVariable with initializers -// TODO(dneto): OpImageTexelPointer -// TODO(dneto): OpLoad -// TODO(dneto): OpStore -// TODO(dneto): OpCopyMemory -// TODO(dneto): OpCopyMemorySized -// TODO(dneto): OpAccessChain -// TODO(dneto): OpInBoundsAccessChain -// TODO(dneto): OpPtrAccessChain -// TODO(dneto): OpArrayLength -// TODO(dneto): OpGenercPtrMemSemantics - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.misc_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.misc_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.misc_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.misc_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Assembler tests for instructions in the "Miscellaneous" section of the -// SPIR-V spec. - -#include "unit_spirv.h" - -#include "test_fixture.h" -#include "gmock/gmock.h" - -namespace { - -using SpirvVector = spvtest::TextToBinaryTest::SpirvVector; -using spvtest::MakeInstruction; -using ::testing::Eq; -using TextToBinaryMisc = spvtest::TextToBinaryTest; - -TEST_F(TextToBinaryMisc, OpNop) { - EXPECT_THAT(CompiledInstructions("OpNop"), Eq(MakeInstruction(SpvOpNop, {}))); -} - -TEST_F(TextToBinaryMisc, OpUndef) { - const SpirvVector code = CompiledInstructions(R"(%f32 = OpTypeFloat 32 - %u = OpUndef %f32)"); - const uint32_t typeID = 1; - EXPECT_THAT(code[1], Eq(typeID)); - EXPECT_THAT(Subvector(code, 3), Eq(MakeInstruction(SpvOpUndef, {typeID, 2}))); -} - -TEST_F(TextToBinaryMisc, OpWrong) { - EXPECT_THAT(CompileFailure(" OpWrong %1 %2"), - Eq("Invalid Opcode name 'OpWrong'")); -} - -TEST_F(TextToBinaryMisc, OpWrongAfterRight) { - const auto assembly = R"( -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpXYZ -)"; - EXPECT_THAT(CompileFailure(assembly), Eq("Invalid Opcode name 'OpXYZ'")); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.mode_setting_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.mode_setting_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.mode_setting_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.mode_setting_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,298 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Assembler tests for instructions in the "Mode-Setting" section of the -// SPIR-V spec. - -#include "unit_spirv.h" - -#include "test_fixture.h" -#include "gmock/gmock.h" - -namespace { - -using ::testing::Combine; -using ::testing::Eq; -using ::testing::TestWithParam; -using ::testing::Values; -using ::testing::ValuesIn; -using spvtest::EnumCase; -using spvtest::MakeInstruction; -using spvtest::MakeVector; -using std::get; -using std::tuple; - -// Test OpMemoryModel - -// An example case for OpMemoryModel -struct MemoryModelCase { - uint32_t get_addressing_value() const { - return static_cast(addressing_value); - } - uint32_t get_memory_value() const { - return static_cast(memory_value); - } - SpvAddressingModel addressing_value; - std::string addressing_name; - SpvMemoryModel memory_value; - std::string memory_name; -}; - -using OpMemoryModelTest = - spvtest::TextToBinaryTestBase>; - -TEST_P(OpMemoryModelTest, AnyMemoryModelCase) { - const std::string input = "OpMemoryModel " + GetParam().addressing_name + - " " + GetParam().memory_name; - EXPECT_THAT( - CompiledInstructions(input), - Eq(MakeInstruction(SpvOpMemoryModel, {GetParam().get_addressing_value(), - GetParam().get_memory_value()}))); -} - -#define CASE(ADDRESSING, MEMORY) \ - { \ - SpvAddressingModel##ADDRESSING, #ADDRESSING, SpvMemoryModel##MEMORY, \ - #MEMORY \ - } -// clang-format off -INSTANTIATE_TEST_CASE_P(TextToBinaryMemoryModel, OpMemoryModelTest, - ValuesIn(std::vector{ - // These cases exercise each addressing model, and - // each memory model, but not necessarily in - // combination. - CASE(Logical,Simple), - CASE(Logical,GLSL450), - CASE(Physical32,OpenCL), - CASE(Physical64,OpenCL), - }),); -#undef CASE -// clang-format on - -TEST_F(OpMemoryModelTest, WrongModel) { - EXPECT_THAT(CompileFailure("OpMemoryModel xxyyzz Simple"), - Eq("Invalid addressing model 'xxyyzz'.")); - EXPECT_THAT(CompileFailure("OpMemoryModel Logical xxyyzz"), - Eq("Invalid memory model 'xxyyzz'.")); -} - -// Test OpEntryPoint - -// An example case for OpEntryPoint -struct EntryPointCase { - uint32_t get_execution_value() const { - return static_cast(execution_value); - } - SpvExecutionModel execution_value; - std::string execution_name; - std::string entry_point_name; -}; - -using OpEntryPointTest = - spvtest::TextToBinaryTestBase>; - -TEST_P(OpEntryPointTest, AnyEntryPointCase) { - // TODO(dneto): utf-8, escaping, quoting cases for entry point name. - const std::string input = "OpEntryPoint " + GetParam().execution_name + - " %1 \"" + GetParam().entry_point_name + "\""; - EXPECT_THAT( - CompiledInstructions(input), - Eq(MakeInstruction(SpvOpEntryPoint, {GetParam().get_execution_value(), 1}, - MakeVector(GetParam().entry_point_name)))); -} - -// clang-format off -#define CASE(NAME) SpvExecutionModel##NAME, #NAME -INSTANTIATE_TEST_CASE_P(TextToBinaryEntryPoint, OpEntryPointTest, - ValuesIn(std::vector{ - { CASE(Vertex), "" }, - { CASE(TessellationControl), "my tess" }, - { CASE(TessellationEvaluation), "really fancy" }, - { CASE(Geometry), "Euclid" }, - { CASE(Fragment), "FAT32" }, - { CASE(GLCompute), "cubic" }, - { CASE(Kernel), "Sanders" }, - }),); -#undef CASE -// clang-format on - -TEST_F(OpEntryPointTest, WrongModel) { - EXPECT_THAT(CompileFailure("OpEntryPoint xxyyzz %1 \"fun\""), - Eq("Invalid execution model 'xxyyzz'.")); -} - -// Test OpExecutionMode -using OpExecutionModeTest = spvtest::TextToBinaryTestBase< - TestWithParam>>>; - -TEST_P(OpExecutionModeTest, AnyExecutionMode) { - // This string should assemble, but should not validate. - std::stringstream input; - input << "OpExecutionMode %1 " << get<1>(GetParam()).name(); - for (auto operand : get<1>(GetParam()).operands()) input << " " << operand; - EXPECT_THAT( - CompiledInstructions(input.str(), get<0>(GetParam())), - Eq(MakeInstruction(SpvOpExecutionMode, {1, get<1>(GetParam()).value()}, - get<1>(GetParam()).operands()))); -} - -#define CASE(NAME) SpvExecutionMode##NAME, #NAME -INSTANTIATE_TEST_CASE_P( - TextToBinaryExecutionMode, OpExecutionModeTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector>{ - // The operand literal values are arbitrarily chosen, - // but there are the right number of them. - {CASE(Invocations), {101}}, - {CASE(SpacingEqual), {}}, - {CASE(SpacingFractionalEven), {}}, - {CASE(SpacingFractionalOdd), {}}, - {CASE(VertexOrderCw), {}}, - {CASE(VertexOrderCcw), {}}, - {CASE(PixelCenterInteger), {}}, - {CASE(OriginUpperLeft), {}}, - {CASE(OriginLowerLeft), {}}, - {CASE(EarlyFragmentTests), {}}, - {CASE(PointMode), {}}, - {CASE(Xfb), {}}, - {CASE(DepthReplacing), {}}, - {CASE(DepthGreater), {}}, - {CASE(DepthLess), {}}, - {CASE(DepthUnchanged), {}}, - {CASE(LocalSize), {64, 1, 2}}, - {CASE(LocalSizeHint), {8, 2, 4}}, - {CASE(InputPoints), {}}, - {CASE(InputLines), {}}, - {CASE(InputLinesAdjacency), {}}, - {CASE(Triangles), {}}, - {CASE(InputTrianglesAdjacency), {}}, - {CASE(Quads), {}}, - {CASE(Isolines), {}}, - {CASE(OutputVertices), {21}}, - {CASE(OutputPoints), {}}, - {CASE(OutputLineStrip), {}}, - {CASE(OutputTriangleStrip), {}}, - {CASE(VecTypeHint), {96}}, - {CASE(ContractionOff), {}}, - })), ); - -INSTANTIATE_TEST_CASE_P( - TextToBinaryExecutionModeV11, OpExecutionModeTest, - Combine(Values(SPV_ENV_UNIVERSAL_1_1), - ValuesIn(std::vector>{ - {CASE(Initializer)}, - {CASE(Finalizer)}, - {CASE(SubgroupSize), {12}}, - {CASE(SubgroupsPerWorkgroup), {64}}})), ); -#undef CASE - -TEST_F(OpExecutionModeTest, WrongMode) { - EXPECT_THAT(CompileFailure("OpExecutionMode %1 xxyyzz"), - Eq("Invalid execution mode 'xxyyzz'.")); -} - -TEST_F(OpExecutionModeTest, TooManyModes) { - EXPECT_THAT(CompileFailure("OpExecutionMode %1 Xfb PointMode"), - Eq("Expected or at the beginning of an " - "instruction, found 'PointMode'.")); -} - -// Test OpCapability - -using OpCapabilityTest = - spvtest::TextToBinaryTestBase>>; - -TEST_P(OpCapabilityTest, AnyCapability) { - const std::string input = "OpCapability " + GetParam().name(); - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpCapability, {GetParam().value()}))); -} - -// clang-format off -#define CASE(NAME) { SpvCapability##NAME, #NAME } -INSTANTIATE_TEST_CASE_P(TextToBinaryCapability, OpCapabilityTest, - ValuesIn(std::vector>{ - CASE(Matrix), - CASE(Shader), - CASE(Geometry), - CASE(Tessellation), - CASE(Addresses), - CASE(Linkage), - CASE(Kernel), - CASE(Vector16), - CASE(Float16Buffer), - CASE(Float16), - CASE(Float64), - CASE(Int64), - CASE(Int64Atomics), - CASE(ImageBasic), - CASE(ImageReadWrite), - CASE(ImageMipmap), - // Value 16 intentionally missing - CASE(Pipes), - CASE(Groups), - CASE(DeviceEnqueue), - CASE(LiteralSampler), - CASE(AtomicStorage), - CASE(Int16), - CASE(TessellationPointSize), - CASE(GeometryPointSize), - CASE(ImageGatherExtended), - // Value 26 intentionally missing - CASE(StorageImageMultisample), - CASE(UniformBufferArrayDynamicIndexing), - CASE(SampledImageArrayDynamicIndexing), - CASE(StorageBufferArrayDynamicIndexing), - CASE(StorageImageArrayDynamicIndexing), - CASE(ClipDistance), - CASE(CullDistance), - CASE(ImageCubeArray), - CASE(SampleRateShading), - CASE(ImageRect), - CASE(SampledRect), - CASE(GenericPointer), - CASE(Int8), - CASE(InputAttachment), - CASE(SparseResidency), - CASE(MinLod), - CASE(Sampled1D), - CASE(Image1D), - CASE(SampledCubeArray), - CASE(SampledBuffer), - CASE(ImageBuffer), - CASE(ImageMSArray), - CASE(StorageImageExtendedFormats), - CASE(ImageQuery), - CASE(DerivativeControl), - CASE(InterpolationFunction), - CASE(TransformFeedback), - }),); -#undef CASE -// clang-format on - -using TextToBinaryCapability = spvtest::TextToBinaryTest; - -TEST_F(TextToBinaryCapability, BadMissingCapability) { - EXPECT_THAT(CompileFailure("OpCapability"), - Eq("Expected operand, found end of stream.")); -} - -TEST_F(TextToBinaryCapability, BadInvalidCapability) { - EXPECT_THAT(CompileFailure("OpCapability 123"), - Eq("Invalid capability '123'.")); -} - -// TODO(dneto): OpExecutionMode - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.pipe_storage_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.pipe_storage_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.pipe_storage_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.pipe_storage_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "test_fixture.h" -#include "gmock/gmock.h" - -namespace { - -using ::spvtest::MakeInstruction; -using ::testing::Eq; - -using OpTypePipeStorageTest = spvtest::TextToBinaryTest; - -TEST_F(OpTypePipeStorageTest, OpcodeUnrecognizedInV10) { - EXPECT_THAT(CompileFailure("%res = OpTypePipeStorage", SPV_ENV_UNIVERSAL_1_0), - Eq("Invalid Opcode name 'OpTypePipeStorage'")); -} - -TEST_F(OpTypePipeStorageTest, ArgumentCount) { - EXPECT_THAT( - CompileFailure("OpTypePipeStorage", SPV_ENV_UNIVERSAL_1_1), - Eq("Expected at the beginning of an instruction, found " - "'OpTypePipeStorage'.")); - EXPECT_THAT( - CompiledInstructions("%res = OpTypePipeStorage", SPV_ENV_UNIVERSAL_1_1), - Eq(MakeInstruction(SpvOpTypePipeStorage, {1}))); - EXPECT_THAT(CompileFailure("%res = OpTypePipeStorage %1 %2 %3 %4 %5", - SPV_ENV_UNIVERSAL_1_1), - Eq("'=' expected after result id.")); -} - -using OpConstantPipeStorageTest = spvtest::TextToBinaryTest; - -TEST_F(OpConstantPipeStorageTest, OpcodeUnrecognizedInV10) { - EXPECT_THAT(CompileFailure("%1 = OpConstantPipeStorage %2 3 4 5", - SPV_ENV_UNIVERSAL_1_0), - Eq("Invalid Opcode name 'OpConstantPipeStorage'")); -} - -TEST_F(OpConstantPipeStorageTest, ArgumentCount) { - EXPECT_THAT( - CompileFailure("OpConstantPipeStorage", SPV_ENV_UNIVERSAL_1_1), - Eq("Expected at the beginning of an instruction, found " - "'OpConstantPipeStorage'.")); - EXPECT_THAT( - CompileFailure("%1 = OpConstantPipeStorage", SPV_ENV_UNIVERSAL_1_1), - Eq("Expected operand, found end of stream.")); - EXPECT_THAT(CompileFailure("%1 = OpConstantPipeStorage %2 3 4", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected operand, found end of stream.")); - EXPECT_THAT(CompiledInstructions("%1 = OpConstantPipeStorage %2 3 4 5", - SPV_ENV_UNIVERSAL_1_1), - Eq(MakeInstruction(SpvOpConstantPipeStorage, {1, 2, 3, 4, 5}))); - EXPECT_THAT(CompileFailure("%1 = OpConstantPipeStorage %2 3 4 5 %6 %7", - SPV_ENV_UNIVERSAL_1_1), - Eq("'=' expected after result id.")); -} - -TEST_F(OpConstantPipeStorageTest, ArgumentTypes) { - EXPECT_THAT(CompileFailure("%1 = OpConstantPipeStorage %2 %3 4 5", - SPV_ENV_UNIVERSAL_1_1), - Eq("Invalid unsigned integer literal: %3")); - EXPECT_THAT(CompileFailure("%1 = OpConstantPipeStorage %2 3 %4 5", - SPV_ENV_UNIVERSAL_1_1), - Eq("Invalid unsigned integer literal: %4")); - EXPECT_THAT(CompileFailure("%1 = OpConstantPipeStorage 2 3 4 5", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected id to start with %.")); - EXPECT_THAT(CompileFailure("%1 = OpConstantPipeStorage %2 3 4 \"ab\"", - SPV_ENV_UNIVERSAL_1_1), - Eq("Invalid unsigned integer literal: \"ab\"")); -} - -using OpCreatePipeFromPipeStorageTest = spvtest::TextToBinaryTest; - -TEST_F(OpCreatePipeFromPipeStorageTest, OpcodeUnrecognizedInV10) { - EXPECT_THAT(CompileFailure("%1 = OpCreatePipeFromPipeStorage %2 %3", - SPV_ENV_UNIVERSAL_1_0), - Eq("Invalid Opcode name 'OpCreatePipeFromPipeStorage'")); -} - -TEST_F(OpCreatePipeFromPipeStorageTest, ArgumentCount) { - EXPECT_THAT( - CompileFailure("OpCreatePipeFromPipeStorage", SPV_ENV_UNIVERSAL_1_1), - Eq("Expected at the beginning of an instruction, found " - "'OpCreatePipeFromPipeStorage'.")); - EXPECT_THAT( - CompileFailure("%1 = OpCreatePipeFromPipeStorage", SPV_ENV_UNIVERSAL_1_1), - Eq("Expected operand, found end of stream.")); - EXPECT_THAT(CompileFailure("%1 = OpCreatePipeFromPipeStorage %2 OpNop", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected operand, found next instruction instead.")); - EXPECT_THAT(CompiledInstructions("%1 = OpCreatePipeFromPipeStorage %2 %3", - SPV_ENV_UNIVERSAL_1_1), - Eq(MakeInstruction(SpvOpCreatePipeFromPipeStorage, {1, 2, 3}))); - EXPECT_THAT(CompileFailure("%1 = OpCreatePipeFromPipeStorage %2 %3 %4 %5", - SPV_ENV_UNIVERSAL_1_1), - Eq("'=' expected after result id.")); -} - -TEST_F(OpCreatePipeFromPipeStorageTest, ArgumentTypes) { - EXPECT_THAT(CompileFailure("%1 = OpCreatePipeFromPipeStorage \"\" %3", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected id to start with %.")); - EXPECT_THAT(CompileFailure("%1 = OpCreatePipeFromPipeStorage %2 3", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected id to start with %.")); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.subgroup_dispatch_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.subgroup_dispatch_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.subgroup_dispatch_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.subgroup_dispatch_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ -// Copyright (c) 2016 Google 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. - -// Assembler tests for instructions in the "Barrier Instructions" section -// of the SPIR-V spec. - -#include "unit_spirv.h" - -#include "test_fixture.h" -#include "gmock/gmock.h" - -namespace { - -using ::spvtest::MakeInstruction; -using ::testing::Eq; -using std::vector; - -using OpGetKernelLocalSizeForSubgroupCountTest = spvtest::TextToBinaryTest; - -TEST_F(OpGetKernelLocalSizeForSubgroupCountTest, OpcodeUnrecognizedInV10) { - EXPECT_THAT( - CompileFailure("%res = OpGetKernelLocalSizeForSubgroupCount %type " - "%sgcount %invoke %param %param_size %param_align", - SPV_ENV_UNIVERSAL_1_0), - Eq("Invalid Opcode name 'OpGetKernelLocalSizeForSubgroupCount'")); -} - -TEST_F(OpGetKernelLocalSizeForSubgroupCountTest, ArgumentCount) { - EXPECT_THAT(CompileFailure("OpGetKernelLocalSizeForSubgroupCount", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected at the beginning of an instruction, " - "found 'OpGetKernelLocalSizeForSubgroupCount'.")); - EXPECT_THAT(CompileFailure("%res = OpGetKernelLocalSizeForSubgroupCount", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected operand, found end of stream.")); - EXPECT_THAT( - CompileFailure("%1 = OpGetKernelLocalSizeForSubgroupCount %2 %3 %4 %5 %6", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected operand, found end of stream.")); - EXPECT_THAT( - CompiledInstructions("%res = OpGetKernelLocalSizeForSubgroupCount %type " - "%sgcount %invoke %param %param_size %param_align", - SPV_ENV_UNIVERSAL_1_1), - Eq(MakeInstruction(SpvOpGetKernelLocalSizeForSubgroupCount, - {1, 2, 3, 4, 5, 6, 7}))); - EXPECT_THAT( - CompileFailure("%res = OpGetKernelLocalSizeForSubgroupCount %type " - "%sgcount %invoke %param %param_size %param_align %extra", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected '=', found end of stream.")); -} - -TEST_F(OpGetKernelLocalSizeForSubgroupCountTest, ArgumentTypes) { - EXPECT_THAT(CompileFailure( - "%1 = OpGetKernelLocalSizeForSubgroupCount 2 %3 %4 %5 %6 %7", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected id to start with %.")); - EXPECT_THAT( - CompileFailure( - "%1 = OpGetKernelLocalSizeForSubgroupCount %2 %3 %4 %5 %6 \"abc\"", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected id to start with %.")); -} - -using OpGetKernelMaxNumSubgroupsTest = spvtest::TextToBinaryTest; - -TEST_F(OpGetKernelMaxNumSubgroupsTest, OpcodeUnrecognizedInV10) { - EXPECT_THAT(CompileFailure("%res = OpGetKernelLocalSizeForSubgroupCount " - "%type %invoke %param %param_size %param_align", - SPV_ENV_UNIVERSAL_1_0), - Eq("Invalid Opcode name 'OpGetKernelLocalSizeForSubgroupCount'")); -} - -TEST_F(OpGetKernelMaxNumSubgroupsTest, ArgumentCount) { - EXPECT_THAT( - CompileFailure("OpGetKernelMaxNumSubgroups", SPV_ENV_UNIVERSAL_1_1), - Eq("Expected at the beginning of an instruction, found " - "'OpGetKernelMaxNumSubgroups'.")); - EXPECT_THAT(CompileFailure("%res = OpGetKernelMaxNumSubgroups", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected operand, found end of stream.")); - EXPECT_THAT(CompileFailure("%1 = OpGetKernelMaxNumSubgroups %2 %3 %4 %5", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected operand, found end of stream.")); - EXPECT_THAT( - CompiledInstructions("%res = OpGetKernelMaxNumSubgroups %type " - "%invoke %param %param_size %param_align", - SPV_ENV_UNIVERSAL_1_1), - Eq(MakeInstruction(SpvOpGetKernelMaxNumSubgroups, {1, 2, 3, 4, 5, 6}))); - EXPECT_THAT(CompileFailure("%res = OpGetKernelMaxNumSubgroups %type %invoke " - "%param %param_size %param_align %extra", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected '=', found end of stream.")); -} - -TEST_F(OpGetKernelMaxNumSubgroupsTest, ArgumentTypes) { - EXPECT_THAT(CompileFailure("%1 = OpGetKernelMaxNumSubgroups 2 %3 %4 %5 %6", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected id to start with %.")); - EXPECT_THAT( - CompileFailure("%1 = OpGetKernelMaxNumSubgroups %2 %3 %4 %5 \"abc\"", - SPV_ENV_UNIVERSAL_1_1), - Eq("Expected id to start with %.")); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,269 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include - -#include "gmock/gmock.h" - -#include "test_fixture.h" -#include "unit_spirv.h" -#include "source/spirv_constant.h" -#include "source/util/bitutils.h" -#include "source/util/hex_float.h" - -namespace { - -using libspirv::AssemblyContext; -using libspirv::AssemblyGrammar; -using spvtest::AutoText; -using spvtest::Concatenate; -using spvtest::MakeInstruction; -using spvtest::ScopedContext; -using spvtest::TextToBinaryTest; -using testing::Eq; -using testing::IsNull; -using testing::NotNull; - -// An mask parsing test case. -struct MaskCase { - spv_operand_type_t which_enum; - uint32_t expected_value; - const char* expression; -}; - -using GoodMaskParseTest = ::testing::TestWithParam; - -TEST_P(GoodMaskParseTest, GoodMaskExpressions) { - spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_0); - - uint32_t value; - EXPECT_EQ(SPV_SUCCESS, - AssemblyGrammar(context).parseMaskOperand( - GetParam().which_enum, GetParam().expression, &value)); - EXPECT_EQ(GetParam().expected_value, value); - - spvContextDestroy(context); -} - -INSTANTIATE_TEST_CASE_P( - ParseMask, GoodMaskParseTest, - ::testing::ValuesIn(std::vector{ - {SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, 0, "None"}, - {SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, 1, "NotNaN"}, - {SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, 2, "NotInf"}, - {SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, 3, "NotNaN|NotInf"}, - // Mask experssions are symmetric. - {SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, 3, "NotInf|NotNaN"}, - // Repeating a value has no effect. - {SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, 3, "NotInf|NotNaN|NotInf"}, - // Using 3 operands still works. - {SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, 0x13, "NotInf|NotNaN|Fast"}, - {SPV_OPERAND_TYPE_SELECTION_CONTROL, 0, "None"}, - {SPV_OPERAND_TYPE_SELECTION_CONTROL, 1, "Flatten"}, - {SPV_OPERAND_TYPE_SELECTION_CONTROL, 2, "DontFlatten"}, - // Weirdly, you can specify to flatten and don't flatten a selection. - {SPV_OPERAND_TYPE_SELECTION_CONTROL, 3, "Flatten|DontFlatten"}, - {SPV_OPERAND_TYPE_LOOP_CONTROL, 0, "None"}, - {SPV_OPERAND_TYPE_LOOP_CONTROL, 1, "Unroll"}, - {SPV_OPERAND_TYPE_LOOP_CONTROL, 2, "DontUnroll"}, - // Weirdly, you can specify to unroll and don't unroll a loop. - {SPV_OPERAND_TYPE_LOOP_CONTROL, 3, "Unroll|DontUnroll"}, - {SPV_OPERAND_TYPE_FUNCTION_CONTROL, 0, "None"}, - {SPV_OPERAND_TYPE_FUNCTION_CONTROL, 1, "Inline"}, - {SPV_OPERAND_TYPE_FUNCTION_CONTROL, 2, "DontInline"}, - {SPV_OPERAND_TYPE_FUNCTION_CONTROL, 4, "Pure"}, - {SPV_OPERAND_TYPE_FUNCTION_CONTROL, 8, "Const"}, - {SPV_OPERAND_TYPE_FUNCTION_CONTROL, 0xd, "Inline|Const|Pure"}, - }), ); - -using BadFPFastMathMaskParseTest = ::testing::TestWithParam; - -TEST_P(BadFPFastMathMaskParseTest, BadMaskExpressions) { - spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_0); - - uint32_t value; - EXPECT_NE(SPV_SUCCESS, - AssemblyGrammar(context).parseMaskOperand( - SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, GetParam(), &value)); - - spvContextDestroy(context); -} - -INSTANTIATE_TEST_CASE_P(ParseMask, BadFPFastMathMaskParseTest, - ::testing::ValuesIn(std::vector{ - nullptr, "", "NotValidEnum", "|", "NotInf|", - "|NotInf", "NotInf||NotNaN", - "Unroll" // A good word, but for the wrong enum - }), ); - -TEST_F(TextToBinaryTest, InvalidText) { - ASSERT_EQ(SPV_ERROR_INVALID_TEXT, - spvTextToBinary(ScopedContext().context, nullptr, 0, &binary, - &diagnostic)); - EXPECT_NE(nullptr, diagnostic); - EXPECT_THAT(diagnostic->error, Eq(std::string("Missing assembly text."))); -} - -TEST_F(TextToBinaryTest, InvalidPointer) { - SetText( - "OpEntryPoint Kernel 0 \"\"\nOpExecutionMode 0 LocalSizeHint 1 1 1\n"); - ASSERT_EQ(SPV_ERROR_INVALID_POINTER, - spvTextToBinary(ScopedContext().context, text.str, text.length, - nullptr, &diagnostic)); -} - -TEST_F(TextToBinaryTest, InvalidPrefix) { - EXPECT_EQ( - "Expected or at the beginning of an instruction, " - "found 'Invalid'.", - CompileFailure("Invalid")); -} - -TEST_F(TextToBinaryTest, EmptyAssemblyString) { - // An empty assembly module is valid! - // It should produce a valid module with zero instructions. - EXPECT_THAT(CompiledInstructions(""), Eq(std::vector{})); -} - -TEST_F(TextToBinaryTest, StringSpace) { - const std::string code = ("OpSourceExtension \"string with spaces\"\n"); - EXPECT_EQ(code, EncodeAndDecodeSuccessfully(code)); -} - -TEST_F(TextToBinaryTest, UnknownBeginningOfInstruction) { - EXPECT_EQ( - "Expected or at the beginning of an instruction, " - "found 'Google'.", - CompileFailure( - "\nOpSource OpenCL_C 12\nOpMemoryModel Physical64 OpenCL\nGoogle\n")); - EXPECT_EQ(4u, diagnostic->position.line + 1); - EXPECT_EQ(1u, diagnostic->position.column + 1); -} - -TEST_F(TextToBinaryTest, NoEqualSign) { - EXPECT_EQ("Expected '=', found end of stream.", - CompileFailure("\nOpSource OpenCL_C 12\n" - "OpMemoryModel Physical64 OpenCL\n%2\n")); - EXPECT_EQ(5u, diagnostic->position.line + 1); - EXPECT_EQ(1u, diagnostic->position.column + 1); -} - -TEST_F(TextToBinaryTest, NoOpCode) { - EXPECT_EQ("Expected opcode, found end of stream.", - CompileFailure("\nOpSource OpenCL_C 12\n" - "OpMemoryModel Physical64 OpenCL\n%2 =\n")); - EXPECT_EQ(5u, diagnostic->position.line + 1); - EXPECT_EQ(1u, diagnostic->position.column + 1); -} - -TEST_F(TextToBinaryTest, WrongOpCode) { - EXPECT_EQ("Invalid Opcode prefix 'Wahahaha'.", - CompileFailure("\nOpSource OpenCL_C 12\n" - "OpMemoryModel Physical64 OpenCL\n%2 = Wahahaha\n")); - EXPECT_EQ(4u, diagnostic->position.line + 1); - EXPECT_EQ(6u, diagnostic->position.column + 1); -} - -TEST_F(TextToBinaryTest, CRLF) { - const std::string input = - "%i32 = OpTypeInt 32 1\r\n%c = OpConstant %i32 123\r\n"; - EXPECT_THAT(CompiledInstructions(input), - Eq(Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), - MakeInstruction(SpvOpConstant, {1, 2, 123})}))); -} - -using TextToBinaryFloatValueTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>>; - -TEST_P(TextToBinaryFloatValueTest, Samples) { - const std::string input = - "%1 = OpTypeFloat 32\n%2 = OpConstant %1 " + GetParam().first; - EXPECT_THAT(CompiledInstructions(input), - Eq(Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), - MakeInstruction(SpvOpConstant, - {1, 2, GetParam().second})}))); -} - -INSTANTIATE_TEST_CASE_P( - FloatValues, TextToBinaryFloatValueTest, - ::testing::ValuesIn(std::vector>{ - {"0.0", 0x00000000}, // +0 - {"!0x00000001", 0x00000001}, // +denorm - {"!0x00800000", 0x00800000}, // +norm - {"1.5", 0x3fc00000}, - {"!0x7f800000", 0x7f800000}, // +inf - {"!0x7f800001", 0x7f800001}, // NaN - - {"-0.0", 0x80000000}, // -0 - {"!0x80000001", 0x80000001}, // -denorm - {"!0x80800000", 0x80800000}, // -norm - {"-2.5", 0xc0200000}, - {"!0xff800000", 0xff800000}, // -inf - {"!0xff800001", 0xff800001}, // NaN - }), ); - -using TextToBinaryHalfValueTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>>; - -TEST_P(TextToBinaryHalfValueTest, Samples) { - const std::string input = - "%1 = OpTypeFloat 16\n%2 = OpConstant %1 " + GetParam().first; - EXPECT_THAT(CompiledInstructions(input), - Eq(Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 16}), - MakeInstruction(SpvOpConstant, - {1, 2, GetParam().second})}))); -} - -INSTANTIATE_TEST_CASE_P( - HalfValues, TextToBinaryHalfValueTest, - ::testing::ValuesIn(std::vector>{ - {"0.0", 0x00000000}, - {"1.0", 0x00003c00}, - {"1.000844", 0x00003c00}, // Truncate to 1.0 - {"1.000977", 0x00003c01}, // Don't have to truncate - {"1.001465", 0x00003c01}, // Truncate to 1.0000977 - {"1.5", 0x00003e00}, - {"-1.0", 0x0000bc00}, - {"2.0", 0x00004000}, - {"-2.0", 0x0000c000}, - {"0x1p1", 0x00004000}, - {"-0x1p1", 0x0000c000}, - {"0x1.8p1", 0x00004200}, - {"0x1.8p4", 0x00004e00}, - {"0x1.801p4", 0x00004e00}, - {"0x1.804p4", 0x00004e01}, - }), ); - -TEST(CreateContext, InvalidEnvironment) { - spv_target_env env; - std::memset(&env, 99, sizeof(env)); - EXPECT_THAT(spvContextCreate(env), IsNull()); -} - -TEST(CreateContext, UniversalEnvironment) { - auto c = spvContextCreate(SPV_ENV_UNIVERSAL_1_0); - EXPECT_THAT(c, NotNull()); - spvContextDestroy(c); -} - -TEST(CreateContext, VulkanEnvironment) { - auto c = spvContextCreate(SPV_ENV_VULKAN_1_0); - EXPECT_THAT(c, NotNull()); - spvContextDestroy(c); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.type_declaration_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.type_declaration_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_to_binary.type_declaration_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_to_binary.type_declaration_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,286 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Assembler tests for instructions in the "Type-Declaration" section of the -// SPIR-V spec. - -#include "unit_spirv.h" - -#include "test_fixture.h" -#include "gmock/gmock.h" - -namespace { - -using spvtest::EnumCase; -using spvtest::MakeInstruction; -using ::testing::Eq; - -// Test Dim enums via OpTypeImage - -using DimTest = - spvtest::TextToBinaryTestBase<::testing::TestWithParam>>; - -TEST_P(DimTest, AnyDim) { - const std::string input = - "%1 = OpTypeImage %2 " + GetParam().name() + " 2 3 0 4 Rgba8\n"; - EXPECT_THAT( - CompiledInstructions(input), - Eq(MakeInstruction(SpvOpTypeImage, {1, 2, GetParam().value(), 2, 3, 0, 4, - SpvImageFormatRgba8}))); - - // Check the disassembler as well. - EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(input)); -} - -// clang-format off -#define CASE(NAME) {SpvDim##NAME, #NAME} -INSTANTIATE_TEST_CASE_P( - TextToBinaryDim, DimTest, - ::testing::ValuesIn(std::vector>{ - CASE(1D), - CASE(2D), - CASE(3D), - CASE(Cube), - CASE(Rect), - CASE(Buffer), - CASE(SubpassData), - }),); -#undef CASE -// clang-format on - -TEST_F(DimTest, WrongDim) { - EXPECT_THAT(CompileFailure("%i = OpTypeImage %t xxyyzz 1 2 3 4 R8"), - Eq("Invalid dimensionality 'xxyyzz'.")); -} - -// Test ImageFormat enums via OpTypeImage - -using ImageFormatTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>>; - -TEST_P(ImageFormatTest, AnyImageFormatAndNoAccessQualifier) { - const std::string input = - "%1 = OpTypeImage %2 1D 2 3 0 4 " + GetParam().name() + "\n"; - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpTypeImage, {1, 2, SpvDim1D, 2, 3, 0, 4, - GetParam().value()}))); - // Check the disassembler as well. - EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(input)); -} - -// clang-format off -#define CASE(NAME) {SpvImageFormat##NAME, #NAME} -INSTANTIATE_TEST_CASE_P( - TextToBinaryImageFormat, ImageFormatTest, - ::testing::ValuesIn(std::vector>{ - CASE(Unknown), - CASE(Rgba32f), - CASE(Rgba16f), - CASE(R32f), - CASE(Rgba8), - CASE(Rgba8Snorm), - CASE(Rg32f), - CASE(Rg16f), - CASE(R11fG11fB10f), - CASE(R16f), - CASE(Rgba16), - CASE(Rgb10A2), - CASE(Rg16), - CASE(Rg8), - CASE(R16), - CASE(R8), - CASE(Rgba16Snorm), - CASE(Rg16Snorm), - CASE(Rg8Snorm), - CASE(R16Snorm), - CASE(R8Snorm), - CASE(Rgba32i), - CASE(Rgba16i), - CASE(Rgba8i), - CASE(R32i), - CASE(Rg32i), - CASE(Rg16i), - CASE(Rg8i), - CASE(R16i), - CASE(R8i), - CASE(Rgba32ui), - CASE(Rgba16ui), - CASE(Rgba8ui), - CASE(R32ui), - CASE(Rgb10a2ui), - CASE(Rg32ui), - CASE(Rg16ui), - CASE(Rg8ui), - CASE(R16ui), - CASE(R8ui), - }),); -#undef CASE -// clang-format on - -TEST_F(ImageFormatTest, WrongFormat) { - EXPECT_THAT(CompileFailure("%r = OpTypeImage %t 1D 2 3 0 4 xxyyzz"), - Eq("Invalid image format 'xxyyzz'.")); -} - -// Test AccessQualifier enums via OpTypeImage. -using ImageAccessQualifierTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>>; - -TEST_P(ImageAccessQualifierTest, AnyAccessQualifier) { - const std::string input = - "%1 = OpTypeImage %2 1D 2 3 0 4 Rgba8 " + GetParam().name() + "\n"; - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpTypeImage, - {1, 2, SpvDim1D, 2, 3, 0, 4, - SpvImageFormatRgba8, GetParam().value()}))); - // Check the disassembler as well. - EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(input)); -} - -// clang-format off -#define CASE(NAME) {SpvAccessQualifier##NAME, #NAME} -INSTANTIATE_TEST_CASE_P( - AccessQualifier, ImageAccessQualifierTest, - ::testing::ValuesIn(std::vector>{ - CASE(ReadOnly), - CASE(WriteOnly), - CASE(ReadWrite), - }),); -// clang-format on -#undef CASE - -// Test AccessQualifier enums via OpTypePipe. - -using OpTypePipeTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam>>; - -TEST_P(OpTypePipeTest, AnyAccessQualifier) { - const std::string input = "%1 = OpTypePipe " + GetParam().name() + "\n"; - EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(SpvOpTypePipe, {1, GetParam().value()}))); - // Check the disassembler as well. - EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(input)); -} - -// clang-format off -#define CASE(NAME) {SpvAccessQualifier##NAME, #NAME} -INSTANTIATE_TEST_CASE_P( - TextToBinaryTypePipe, OpTypePipeTest, - ::testing::ValuesIn(std::vector>{ - CASE(ReadOnly), - CASE(WriteOnly), - CASE(ReadWrite), - }),); -#undef CASE -// clang-format on - -TEST_F(OpTypePipeTest, WrongAccessQualifier) { - EXPECT_THAT(CompileFailure("%1 = OpTypePipe xxyyzz"), - Eq("Invalid access qualifier 'xxyyzz'.")); -} - -using OpTypeForwardPointerTest = spvtest::TextToBinaryTest; - -#define CASE(storage_class) \ - do { \ - EXPECT_THAT( \ - CompiledInstructions("OpTypeForwardPointer %pt " #storage_class), \ - Eq(MakeInstruction(SpvOpTypeForwardPointer, \ - {1, SpvStorageClass##storage_class}))); \ - } while (0) - -TEST_F(OpTypeForwardPointerTest, ValidStorageClass) { - CASE(UniformConstant); - CASE(Input); - CASE(Uniform); - CASE(Output); - CASE(Workgroup); - CASE(CrossWorkgroup); - CASE(Private); - CASE(Function); - CASE(Generic); - CASE(PushConstant); - CASE(AtomicCounter); - CASE(Image); - CASE(StorageBuffer); -} - -#undef CASE - -TEST_F(OpTypeForwardPointerTest, MissingType) { - EXPECT_THAT(CompileFailure("OpTypeForwardPointer"), - Eq("Expected operand, found end of stream.")); -} - -TEST_F(OpTypeForwardPointerTest, MissingClass) { - EXPECT_THAT(CompileFailure("OpTypeForwardPointer %pt"), - Eq("Expected operand, found end of stream.")); -} - -TEST_F(OpTypeForwardPointerTest, WrongClass) { - EXPECT_THAT(CompileFailure("OpTypeForwardPointer %pt xxyyzz"), - Eq("Invalid storage class 'xxyyzz'.")); -} - -using OpSizeOfTest = spvtest::TextToBinaryTest; - -TEST_F(OpSizeOfTest, OpcodeUnrecognizedInV10) { - EXPECT_THAT(CompileFailure("%1 = OpSizeOf %2 %3", SPV_ENV_UNIVERSAL_1_0), - Eq("Invalid Opcode name 'OpSizeOf'")); -} - -TEST_F(OpSizeOfTest, ArgumentCount) { - EXPECT_THAT( - CompileFailure("OpSizeOf", SPV_ENV_UNIVERSAL_1_1), - Eq("Expected at the beginning of an instruction, found " - "'OpSizeOf'.")); - EXPECT_THAT(CompileFailure("%res = OpSizeOf OpNop", SPV_ENV_UNIVERSAL_1_1), - Eq("Expected operand, found next instruction instead.")); - EXPECT_THAT( - CompiledInstructions("%1 = OpSizeOf %2 %3", SPV_ENV_UNIVERSAL_1_1), - Eq(MakeInstruction(SpvOpSizeOf, {1, 2, 3}))); - EXPECT_THAT( - CompileFailure("%1 = OpSizeOf %2 %3 44 55 ", SPV_ENV_UNIVERSAL_1_1), - Eq("Expected or at the beginning of an instruction, " - "found '44'.")); -} - -TEST_F(OpSizeOfTest, ArgumentTypes) { - EXPECT_THAT(CompileFailure("%1 = OpSizeOf 2 %3", SPV_ENV_UNIVERSAL_1_1), - Eq("Expected id to start with %.")); - EXPECT_THAT(CompileFailure("%1 = OpSizeOf %2 \"abc\"", SPV_ENV_UNIVERSAL_1_1), - Eq("Expected id to start with %.")); -} - -// TODO(dneto): OpTypeVoid -// TODO(dneto): OpTypeBool -// TODO(dneto): OpTypeInt -// TODO(dneto): OpTypeFloat -// TODO(dneto): OpTypeVector -// TODO(dneto): OpTypeMatrix -// TODO(dneto): OpTypeImage -// TODO(dneto): OpTypeSampler -// TODO(dneto): OpTypeSampledImage -// TODO(dneto): OpTypeArray -// TODO(dneto): OpTypeRuntimeArray -// TODO(dneto): OpTypeStruct -// TODO(dneto): OpTypeOpaque -// TODO(dneto): OpTypePointer -// TODO(dneto): OpTypeFunction -// TODO(dneto): OpTypeEvent -// TODO(dneto): OpTypeDeviceEvent -// TODO(dneto): OpTypeReserveId -// TODO(dneto): OpTypeQueue - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_word_get_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/text_word_get_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/text_word_get_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/text_word_get_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,251 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -namespace { - -using libspirv::AssemblyContext; -using spvtest::AutoText; - -#define TAB "\t" -#define NEWLINE "\n" -#define BACKSLASH R"(\)" -#define QUOTE R"(")" - -TEST(TextWordGet, NullTerminator) { - std::string word; - spv_position_t endPosition = {}; - ASSERT_EQ( - SPV_SUCCESS, - AssemblyContext(AutoText("Word"), nullptr).getWord(&word, &endPosition)); - ASSERT_EQ(4u, endPosition.column); - ASSERT_EQ(0u, endPosition.line); - ASSERT_EQ(4u, endPosition.index); - ASSERT_STREQ("Word", word.c_str()); -} - -TEST(TextWordGet, TabTerminator) { - std::string word; - spv_position_t endPosition = {}; - ASSERT_EQ(SPV_SUCCESS, AssemblyContext(AutoText("Word\t"), nullptr) - .getWord(&word, &endPosition)); - ASSERT_EQ(4u, endPosition.column); - ASSERT_EQ(0u, endPosition.line); - ASSERT_EQ(4u, endPosition.index); - ASSERT_STREQ("Word", word.c_str()); -} - -TEST(TextWordGet, SpaceTerminator) { - std::string word; - spv_position_t endPosition = {}; - ASSERT_EQ( - SPV_SUCCESS, - AssemblyContext(AutoText("Word "), nullptr).getWord(&word, &endPosition)); - ASSERT_EQ(4u, endPosition.column); - ASSERT_EQ(0u, endPosition.line); - ASSERT_EQ(4u, endPosition.index); - ASSERT_STREQ("Word", word.c_str()); -} - -TEST(TextWordGet, SemicolonTerminator) { - std::string word; - spv_position_t endPosition = {}; - ASSERT_EQ( - SPV_SUCCESS, - AssemblyContext(AutoText("Wo;rd"), nullptr).getWord(&word, &endPosition)); - ASSERT_EQ(2u, endPosition.column); - ASSERT_EQ(0u, endPosition.line); - ASSERT_EQ(2u, endPosition.index); - ASSERT_STREQ("Wo", word.c_str()); -} - -TEST(TextWordGet, NoTerminator) { - const std::string full_text = "abcdefghijklmn"; - for (size_t len = 1; len <= full_text.size(); ++len) { - std::string word; - spv_text_t text = {full_text.data(), len}; - spv_position_t endPosition = {}; - ASSERT_EQ(SPV_SUCCESS, - AssemblyContext(&text, nullptr).getWord(&word, &endPosition)); - ASSERT_EQ(0u, endPosition.line); - ASSERT_EQ(len, endPosition.column); - ASSERT_EQ(len, endPosition.index); - ASSERT_EQ(full_text.substr(0, len), word); - } -} - -TEST(TextWordGet, MultipleWords) { - AutoText input("Words in a sentence"); - AssemblyContext data(input, nullptr); - - spv_position_t endPosition = {}; - const char* words[] = {"Words", "in", "a", "sentence"}; - - std::string word; - for (uint32_t wordIndex = 0; wordIndex < 4; ++wordIndex) { - ASSERT_EQ(SPV_SUCCESS, data.getWord(&word, &endPosition)); - ASSERT_EQ(strlen(words[wordIndex]), - endPosition.column - data.position().column); - ASSERT_EQ(0u, endPosition.line); - ASSERT_EQ(strlen(words[wordIndex]), - endPosition.index - data.position().index); - ASSERT_STREQ(words[wordIndex], word.c_str()); - - data.setPosition(endPosition); - if (3 != wordIndex) { - ASSERT_EQ(SPV_SUCCESS, data.advance()); - } else { - ASSERT_EQ(SPV_END_OF_STREAM, data.advance()); - } - } -} - -TEST(TextWordGet, QuotesAreKept) { - AutoText input(R"("quotes" "around words")"); - const char* expected[] = {R"("quotes")", R"("around words")"}; - AssemblyContext data(input, nullptr); - - std::string word; - spv_position_t endPosition = {}; - ASSERT_EQ(SPV_SUCCESS, data.getWord(&word, &endPosition)); - EXPECT_EQ(8u, endPosition.column); - EXPECT_EQ(0u, endPosition.line); - EXPECT_EQ(8u, endPosition.index); - EXPECT_STREQ(expected[0], word.c_str()); - - // Move to the next word. - data.setPosition(endPosition); - data.seekForward(1); - - ASSERT_EQ(SPV_SUCCESS, data.getWord(&word, &endPosition)); - EXPECT_EQ(23u, endPosition.column); - EXPECT_EQ(0u, endPosition.line); - EXPECT_EQ(23u, endPosition.index); - EXPECT_STREQ(expected[1], word.c_str()); -} - -TEST(TextWordGet, QuotesBetweenWordsActLikeGlue) { - AutoText input(R"(quotes" "between words)"); - const char* expected[] = {R"(quotes" "between)", "words"}; - AssemblyContext data(input, nullptr); - - std::string word; - spv_position_t endPosition = {}; - ASSERT_EQ(SPV_SUCCESS, data.getWord(&word, &endPosition)); - EXPECT_EQ(16u, endPosition.column); - EXPECT_EQ(0u, endPosition.line); - EXPECT_EQ(16u, endPosition.index); - EXPECT_STREQ(expected[0], word.c_str()); - - // Move to the next word. - data.setPosition(endPosition); - data.seekForward(1); - - ASSERT_EQ(SPV_SUCCESS, data.getWord(&word, &endPosition)); - EXPECT_EQ(22u, endPosition.column); - EXPECT_EQ(0u, endPosition.line); - EXPECT_EQ(22u, endPosition.index); - EXPECT_STREQ(expected[1], word.c_str()); -} - -TEST(TextWordGet, QuotingWhitespace) { - AutoText input(QUOTE "white " NEWLINE TAB " space" QUOTE); - // Whitespace surrounded by quotes acts like glue. - std::string word; - spv_position_t endPosition = {}; - ASSERT_EQ(SPV_SUCCESS, - AssemblyContext(input, nullptr).getWord(&word, &endPosition)); - EXPECT_EQ(input.str.length(), endPosition.column); - EXPECT_EQ(0u, endPosition.line); - EXPECT_EQ(input.str.length(), endPosition.index); - EXPECT_EQ(input.str, word); -} - -TEST(TextWordGet, QuoteAlone) { - AutoText input(QUOTE); - std::string word; - spv_position_t endPosition = {}; - ASSERT_EQ(SPV_SUCCESS, - AssemblyContext(input, nullptr).getWord(&word, &endPosition)); - ASSERT_EQ(1u, endPosition.column); - ASSERT_EQ(0u, endPosition.line); - ASSERT_EQ(1u, endPosition.index); - ASSERT_STREQ(QUOTE, word.c_str()); -} - -TEST(TextWordGet, EscapeAlone) { - AutoText input(BACKSLASH); - std::string word; - spv_position_t endPosition = {}; - ASSERT_EQ(SPV_SUCCESS, - AssemblyContext(input, nullptr).getWord(&word, &endPosition)); - ASSERT_EQ(1u, endPosition.column); - ASSERT_EQ(0u, endPosition.line); - ASSERT_EQ(1u, endPosition.index); - ASSERT_STREQ(BACKSLASH, word.c_str()); -} - -TEST(TextWordGet, EscapeAtEndOfInput) { - AutoText input("word" BACKSLASH); - std::string word; - spv_position_t endPosition = {}; - ASSERT_EQ(SPV_SUCCESS, - AssemblyContext(input, nullptr).getWord(&word, &endPosition)); - ASSERT_EQ(5u, endPosition.column); - ASSERT_EQ(0u, endPosition.line); - ASSERT_EQ(5u, endPosition.index); - ASSERT_STREQ("word" BACKSLASH, word.c_str()); -} - -TEST(TextWordGet, Escaping) { - AutoText input("w" BACKSLASH QUOTE "o" BACKSLASH NEWLINE "r" BACKSLASH ";d"); - std::string word; - spv_position_t endPosition = {}; - ASSERT_EQ(SPV_SUCCESS, - AssemblyContext(input, nullptr).getWord(&word, &endPosition)); - ASSERT_EQ(10u, endPosition.column); - ASSERT_EQ(0u, endPosition.line); - ASSERT_EQ(10u, endPosition.index); - ASSERT_EQ(input.str, word); -} - -TEST(TextWordGet, EscapingEscape) { - AutoText input("word" BACKSLASH BACKSLASH " abc"); - std::string word; - spv_position_t endPosition = {}; - ASSERT_EQ(SPV_SUCCESS, - AssemblyContext(input, nullptr).getWord(&word, &endPosition)); - ASSERT_EQ(6u, endPosition.column); - ASSERT_EQ(0u, endPosition.line); - ASSERT_EQ(6u, endPosition.index); - ASSERT_STREQ("word" BACKSLASH BACKSLASH, word.c_str()); -} - -TEST(TextWordGet, CRLF) { - AutoText input("abc\r\nd"); - AssemblyContext data(input, nullptr); - std::string word; - spv_position_t pos = {}; - ASSERT_EQ(SPV_SUCCESS, data.getWord(&word, &pos)); - EXPECT_EQ(3u, pos.column); - EXPECT_STREQ("abc", word.c_str()); - data.setPosition(pos); - data.advance(); - ASSERT_EQ(SPV_SUCCESS, data.getWord(&word, &pos)); - EXPECT_EQ(1u, pos.column); - EXPECT_STREQ("d", word.c_str()); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/unit_spirv.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/unit_spirv.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/unit_spirv.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/unit_spirv.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "unit_spirv.h" - -#include "gmock/gmock.h" -#include "test_fixture.h" - -namespace { - -using spvtest::MakeVector; -using ::testing::Eq; -using Words = std::vector; - -TEST(MakeVector, Samples) { - EXPECT_THAT(MakeVector(""), Eq(Words{0})); - EXPECT_THAT(MakeVector("a"), Eq(Words{0x0061})); - EXPECT_THAT(MakeVector("ab"), Eq(Words{0x006261})); - EXPECT_THAT(MakeVector("abc"), Eq(Words{0x00636261})); - EXPECT_THAT(MakeVector("abcd"), Eq(Words{0x64636261, 0x00})); - EXPECT_THAT(MakeVector("abcde"), Eq(Words{0x64636261, 0x0065})); -} - -TEST(WordVectorPrintTo, PreservesFlagsAndFill) { - std::stringstream s; - s << std::setw(4) << std::oct << std::setfill('x') << 8 << " "; - spvtest::PrintTo(spvtest::WordVector({10, 16}), &s); - // The octal setting and fill character should be preserved - // from before the PrintTo. - // Width is reset after each emission of a regular scalar type. - // So set it explicitly again. - s << std::setw(4) << 9; - - EXPECT_THAT(s.str(), Eq("xx10 0x0000000a 0x00000010 xx11")); -} - -TEST_P(RoundTripTest, Sample) { - EXPECT_THAT(EncodeAndDecodeSuccessfully(GetParam()), Eq(GetParam())) - << GetParam(); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/unit_spirv.h vulkan-1.1.73+dfsg/external/spirv-tools/test/unit_spirv.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/unit_spirv.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/unit_spirv.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,226 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_TEST_UNITSPIRV_H_ -#define LIBSPIRV_TEST_UNITSPIRV_H_ - -#include - -#include -#include - -#include "source/assembly_grammar.h" -#include "source/binary.h" -#include "source/enum_set.h" -#include "source/diagnostic.h" -#include "source/opcode.h" -#include "source/spirv_endian.h" -#include "source/text.h" -#include "source/text_handler.h" -#include "source/validate.h" -#include "spirv-tools/libspirv.h" - -#include - -#ifdef __ANDROID__ -#include -namespace std { -template -std::string to_string(const T& val) { - std::ostringstream os; - os << val; - return os.str(); -} -} -#endif - -// Determine endianness & predicate tests on it -enum { - I32_ENDIAN_LITTLE = 0x03020100ul, - I32_ENDIAN_BIG = 0x00010203ul, -}; - -static const union { - unsigned char bytes[4]; - uint32_t value; -} o32_host_order = {{0, 1, 2, 3}}; -#define I32_ENDIAN_HOST (o32_host_order.value) - -// A namespace for utilities used in SPIR-V Tools unit tests. -namespace spvtest { - -class WordVector; - -// Emits the given word vector to the given stream. -// This function can be used by the gtest value printer. -void PrintTo(const WordVector& words, ::std::ostream* os); - -// A proxy class to allow us to easily write out vectors of SPIR-V words. -class WordVector { - public: - explicit WordVector(const std::vector& val) : value_(val) {} - explicit WordVector(const spv_binary_t& binary) - : value_(binary.code, binary.code + binary.wordCount) {} - - // Returns the underlying vector. - const std::vector& value() const { return value_; } - - // Returns the string representation of this word vector. - std::string str() const { - std::ostringstream os; - PrintTo(*this, &os); - return os.str(); - } - - private: - const std::vector value_; -}; - -inline void PrintTo(const WordVector& words, ::std::ostream* os) { - size_t count = 0; - const auto saved_flags = os->flags(); - const auto saved_fill = os->fill(); - for (uint32_t value : words.value()) { - *os << "0x" << std::setw(8) << std::setfill('0') << std::hex << value - << " "; - if (count++ % 8 == 7) { - *os << std::endl; - } - } - os->flags(saved_flags); - os->fill(saved_fill); -} - -// Returns a vector of words representing a single instruction with the -// given opcode and operand words as a vector. -inline std::vector MakeInstruction( - SpvOp opcode, const std::vector& args) { - std::vector result{ - spvOpcodeMake(uint16_t(args.size() + 1), opcode)}; - result.insert(result.end(), args.begin(), args.end()); - return result; -} - -// Returns a vector of words representing a single instruction with the -// given opcode and whose operands are the concatenation of the two given -// argument lists. -inline std::vector MakeInstruction( - SpvOp opcode, std::vector args, - const std::vector& extra_args) { - args.insert(args.end(), extra_args.begin(), extra_args.end()); - return MakeInstruction(opcode, args); -} - -// Returns the vector of words representing the concatenation -// of all input vectors. -inline std::vector Concatenate( - const std::vector>& instructions) { - std::vector result; - for (const auto& instruction : instructions) { - result.insert(result.end(), instruction.begin(), instruction.end()); - } - return result; -} - -// Encodes a string as a sequence of words, using the SPIR-V encoding. -inline std::vector MakeVector(std::string input) { - std::vector result; - uint32_t word = 0; - size_t num_bytes = input.size(); - // SPIR-V strings are null-terminated. The byte_index == num_bytes - // case is used to push the terminating null byte. - for (size_t byte_index = 0; byte_index <= num_bytes; byte_index++) { - const auto new_byte = - (byte_index < num_bytes ? uint8_t(input[byte_index]) : uint8_t(0)); - word |= (new_byte << (8 * (byte_index % sizeof(uint32_t)))); - if (3 == (byte_index % sizeof(uint32_t))) { - result.push_back(word); - word = 0; - } - } - // Emit a trailing partial word. - if ((num_bytes + 1) % sizeof(uint32_t)) { - result.push_back(word); - } - return result; -} - -// A type for easily creating spv_text_t values, with an implicit conversion to -// spv_text. -struct AutoText { - explicit AutoText(const std::string& value) - : str(value), text({str.data(), str.size()}) {} - operator spv_text() { return &text; } - std::string str; - spv_text_t text; -}; - -// An example case for an enumerated value, optionally with operands. -template -class EnumCase { - public: - EnumCase() = default; // Required by ::testing::Combine(). - EnumCase(E val, std::string enum_name, std::vector ops = {}) - : enum_value_(val), name_(enum_name), operands_(ops) {} - // Returns the enum value as a uint32_t. - uint32_t value() const { return static_cast(enum_value_); } - // Returns the name of the enumerant. - const std::string& name() const { return name_; } - // Returns a reference to the operands. - const std::vector& operands() const { return operands_; } - - private: - E enum_value_; - std::string name_; - std::vector operands_; -}; - -// Returns a string with num_4_byte_chars Unicode characters, -// each of which has a 4-byte UTF-8 encoding. -inline std::string MakeLongUTF8String(size_t num_4_byte_chars) { - // An example of a longest valid UTF-8 character. - // Be explicit about the character type because Microsoft compilers can - // otherwise interpret the character string as being over wide (16-bit) - // characters. Ideally, we would just use a C++11 UTF-8 string literal, - // but we want to support older Microsoft compilers. - const std::basic_string earth_africa("\xF0\x9F\x8C\x8D"); - EXPECT_EQ(4u, earth_africa.size()); - - std::string result; - result.reserve(num_4_byte_chars * 4); - for (size_t i = 0; i < num_4_byte_chars; i++) { - result += earth_africa; - } - EXPECT_EQ(4 * num_4_byte_chars, result.size()); - return result; -} - -// Returns a vector of all valid target environment enums. -inline std::vector AllTargetEnvironments() { - return {SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, SPV_ENV_OPENCL_2_1, - SPV_ENV_OPENCL_2_2, SPV_ENV_VULKAN_1_0, SPV_ENV_OPENGL_4_0, - SPV_ENV_OPENGL_4_1, SPV_ENV_OPENGL_4_2, SPV_ENV_OPENGL_4_3, - SPV_ENV_OPENGL_4_5, SPV_ENV_UNIVERSAL_1_2}; -} - -// Returns the capabilities in a CapabilitySet as an ordered vector. -inline std::vector ElementsIn( - const libspirv::CapabilitySet& capabilities) { - std::vector result; - capabilities.ForEach([&result](SpvCapability c) { result.push_back(c); }); - return result; -} - -} // namespace spvtest -#endif // LIBSPIRV_TEST_UNITSPIRV_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/util/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/test/util/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/util/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/util/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -# Copyright (c) 2017 Google 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. - -add_spvtools_unittest(TARGET util_intrusive_list - SRCS ilist_test.cpp - LIBS SPIRV-Tools-opt -) diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/util/ilist_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/util/ilist_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/util/ilist_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/util/ilist_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,318 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include - -#include "gmock/gmock.h" - -#include "util/ilist.h" - -namespace { - -using ::testing::ElementsAre; -using spvtools::utils::IntrusiveList; -using spvtools::utils::IntrusiveNodeBase; -using IListTest = ::testing::Test; - -class TestNode : public IntrusiveNodeBase { - public: - TestNode() : IntrusiveNodeBase() {} - int data_; -}; - -class TestList : public IntrusiveList { - public: - TestList() = default; - TestList(TestList&& that) : IntrusiveList(std::move(that)) {} - TestList& operator=(TestList&& that) { - static_cast&>(*this) = - static_cast&&>(that); - return *this; - } -}; - -// This test checks the push_back method, as well as using an iterator to -// traverse the list from begin() to end(). This implicitly test the -// PreviousNode and NextNode functions. -TEST(IListTest, PushBack) { - TestNode nodes[10]; - TestList list; - for (int i = 0; i < 10; i++) { - nodes[i].data_ = i; - list.push_back(&nodes[i]); - } - - std::vector output; - for (auto& i : list) output.push_back(i.data_); - - EXPECT_THAT(output, ElementsAre(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)); -} - -// Returns a list containing the values 0 to n-1 using the first n elements of -// nodes to build the list. -TestList BuildList(TestNode nodes[], int n) { - TestList list; - for (int i = 0; i < n; i++) { - nodes[i].data_ = i; - list.push_back(&nodes[i]); - } - return list; -} - -// Test decrementing begin() -TEST(IListTest, DecrementingBegin) { - TestNode nodes[10]; - TestList list = BuildList(nodes, 10); - EXPECT_EQ(--list.begin(), list.end()); -} - -// Test incrementing end() -TEST(IListTest, IncrementingEnd1) { - TestNode nodes[10]; - TestList list = BuildList(nodes, 10); - EXPECT_EQ((++list.end())->data_, 0); -} - -// Test incrementing end() should equal begin() -TEST(IListTest, IncrementingEnd2) { - TestNode nodes[10]; - TestList list = BuildList(nodes, 10); - EXPECT_EQ(++list.end(), list.begin()); -} - -// Test decrementing end() -TEST(IListTest, DecrementingEnd) { - TestNode nodes[10]; - TestList list = BuildList(nodes, 10); - EXPECT_EQ((--list.end())->data_, 9); -} - -// Test the move constructor for the list class. -TEST(IListTest, MoveConstructor) { - TestNode nodes[10]; - TestList list = BuildList(nodes, 10); - std::vector output; - for (auto& i : list) output.push_back(i.data_); - - EXPECT_THAT(output, ElementsAre(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)); -} - -// Using a const list so we can test the const_iterator. -TEST(IListTest, ConstIterator) { - TestNode nodes[10]; - const TestList list = BuildList(nodes, 10); - std::vector output; - for (auto& i : list) output.push_back(i.data_); - - EXPECT_THAT(output, ElementsAre(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)); -} - -// Uses the move assignement instead of the move constructor. -TEST(IListTest, MoveAssignment) { - TestNode nodes[10]; - TestList list; - list = BuildList(nodes, 10); - std::vector output; - for (auto& i : list) output.push_back(i.data_); - - EXPECT_THAT(output, ElementsAre(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)); -} - -// Test inserting a new element at the end of a list using the IntrusiveNodeBase -// "InsertAfter" function. -TEST(IListTest, InsertAfter1) { - TestNode nodes[10]; - TestList list = BuildList(nodes, 5); - - nodes[5].data_ = 5; - nodes[5].InsertAfter(&nodes[4]); - - std::vector output; - for (auto& i : list) output.push_back(i.data_); - - EXPECT_THAT(output, ElementsAre(0, 1, 2, 3, 4, 5)); -} - -// Test inserting a new element in the middle of a list using the -// IntrusiveNodeBase "InsertAfter" function. -TEST(IListTest, InsertAfter2) { - TestNode nodes[10]; - TestList list = BuildList(nodes, 5); - - nodes[5].data_ = 5; - nodes[5].InsertAfter(&nodes[2]); - - std::vector output; - for (auto& i : list) output.push_back(i.data_); - - EXPECT_THAT(output, ElementsAre(0, 1, 2, 5, 3, 4)); -} - -// Test moving an element already in the list in the middle of a list using the -// IntrusiveNodeBase "InsertAfter" function. -TEST(IListTest, MoveUsingInsertAfter1) { - TestNode nodes[10]; - TestList list = BuildList(nodes, 6); - - nodes[5].InsertAfter(&nodes[2]); - - std::vector output; - for (auto& i : list) output.push_back(i.data_); - - EXPECT_THAT(output, ElementsAre(0, 1, 2, 5, 3, 4)); -} - -// Move the element at the start of the list into the middle. -TEST(IListTest, MoveUsingInsertAfter2) { - TestNode nodes[10]; - TestList list = BuildList(nodes, 6); - - nodes[0].InsertAfter(&nodes[2]); - - std::vector output; - for (auto& i : list) output.push_back(i.data_); - - EXPECT_THAT(output, ElementsAre(1, 2, 0, 3, 4, 5)); -} - -// Move an element in the middle of the list to the end. -TEST(IListTest, MoveUsingInsertAfter3) { - TestNode nodes[10]; - TestList list = BuildList(nodes, 6); - - nodes[2].InsertAfter(&nodes[5]); - - std::vector output; - for (auto& i : list) output.push_back(i.data_); - - EXPECT_THAT(output, ElementsAre(0, 1, 3, 4, 5, 2)); -} - -// Removing an element from the middle of a list. -TEST(IListTest, Remove1) { - TestNode nodes[10]; - TestList list = BuildList(nodes, 6); - - nodes[2].RemoveFromList(); - - std::vector output; - for (auto& i : list) output.push_back(i.data_); - - EXPECT_THAT(output, ElementsAre(0, 1, 3, 4, 5)); -} - -// Removing an element from the beginning of the list. -TEST(IListTest, Remove2) { - TestNode nodes[10]; - TestList list = BuildList(nodes, 6); - - nodes[0].RemoveFromList(); - - std::vector output; - for (auto& i : list) output.push_back(i.data_); - - EXPECT_THAT(output, ElementsAre(1, 2, 3, 4, 5)); -} - -// Removing the last element of a list. -TEST(IListTest, Remove3) { - TestNode nodes[10]; - TestList list = BuildList(nodes, 6); - - nodes[5].RemoveFromList(); - - std::vector output; - for (auto& i : list) output.push_back(i.data_); - - EXPECT_THAT(output, ElementsAre(0, 1, 2, 3, 4)); -} - -// Test that operator== and operator!= work properly for the iterator class. -TEST(IListTest, IteratorEqual) { - TestNode nodes[10]; - TestList list = BuildList(nodes, 6); - - std::vector output; - for (auto i = list.begin(); i != list.end(); ++i) - for (auto j = list.begin(); j != list.end(); ++j) - if (i == j) output.push_back(i->data_); - - EXPECT_THAT(output, ElementsAre(0, 1, 2, 3, 4, 5)); -} - -// Test MoveBefore. Moving into middle of a list. -TEST(IListTest, MoveBefore1) { - TestNode nodes[10]; - TestList list1 = BuildList(nodes, 6); - TestList list2 = BuildList(nodes + 6, 3); - - TestList::iterator insertion_point = list1.begin(); - ++insertion_point; - insertion_point.MoveBefore(&list2); - - std::vector output; - for (auto i = list1.begin(); i != list1.end(); ++i) - output.push_back(i->data_); - - EXPECT_THAT(output, ElementsAre(0, 0, 1, 2, 1, 2, 3, 4, 5)); -} - -// Test MoveBefore. Moving to the start of a list. -TEST(IListTest, MoveBefore2) { - TestNode nodes[10]; - TestList list1 = BuildList(nodes, 6); - TestList list2 = BuildList(nodes + 6, 3); - - TestList::iterator insertion_point = list1.begin(); - insertion_point.MoveBefore(&list2); - - std::vector output; - for (auto i = list1.begin(); i != list1.end(); ++i) - output.push_back(i->data_); - - EXPECT_THAT(output, ElementsAre(0, 1, 2, 0, 1, 2, 3, 4, 5)); -} - -// Test MoveBefore. Moving to the end of a list. -TEST(IListTest, MoveBefore3) { - TestNode nodes[10]; - TestList list1 = BuildList(nodes, 6); - TestList list2 = BuildList(nodes + 6, 3); - - TestList::iterator insertion_point = list1.end(); - insertion_point.MoveBefore(&list2); - - std::vector output; - for (auto i = list1.begin(); i != list1.end(); ++i) - output.push_back(i->data_); - - EXPECT_THAT(output, ElementsAre(0, 1, 2, 3, 4, 5, 0, 1, 2)); -} - -// Test MoveBefore. Moving an empty list. -TEST(IListTest, MoveBefore4) { - TestNode nodes[10]; - TestList list1 = BuildList(nodes, 6); - TestList list2; - - TestList::iterator insertion_point = list1.end(); - insertion_point.MoveBefore(&list2); - - std::vector output; - for (auto i = list1.begin(); i != list1.end(); ++i) - output.push_back(i->data_); - - EXPECT_THAT(output, ElementsAre(0, 1, 2, 3, 4, 5)); -} -} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/test/val/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ -# Copyright (c) 2016 The Khronos Group Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set(VAL_TEST_COMMON_SRCS - ${CMAKE_CURRENT_SOURCE_DIR}/../test_fixture.h - ${CMAKE_CURRENT_SOURCE_DIR}/../unit_spirv.h - ${CMAKE_CURRENT_SOURCE_DIR}/val_fixtures.h - ${CMAKE_CURRENT_SOURCE_DIR}/val_fixtures.cpp -) - - -add_spvtools_unittest(TARGET val_capability - SRCS val_capability_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) - -add_spvtools_unittest(TARGET val_cfg - SRCS val_cfg_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) - -add_spvtools_unittest(TARGET val_id - SRCS val_id_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) - -add_spvtools_unittest(TARGET val_layout - SRCS val_layout_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) - -add_spvtools_unittest(TARGET val_ssa - SRCS val_ssa_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) - -add_spvtools_unittest(TARGET val_storage - SRCS val_storage_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) - -add_spvtools_unittest(TARGET val_state - SRCS val_state_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) - -add_spvtools_unittest(TARGET val_data - SRCS val_data_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) - -add_spvtools_unittest(TARGET val_type_unique - SRCS val_type_unique_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) - -add_spvtools_unittest(TARGET val_arithmetics - SRCS val_arithmetics_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) - -add_spvtools_unittest(TARGET val_conversion - SRCS val_conversion_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) - -add_spvtools_unittest(TARGET val_logicals - SRCS val_logicals_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) - -add_spvtools_unittest(TARGET val_bitwise - SRCS val_bitwise_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) - -add_spvtools_unittest(TARGET val_limits - SRCS val_limits_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) - -add_spvtools_unittest(TARGET val_validation_state - SRCS val_validation_state_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) - -add_spvtools_unittest(TARGET val_decoration - SRCS val_decoration_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) - -add_spvtools_unittest(TARGET val_instructions - SRCS val_instructions_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) - -add_spvtools_unittest(TARGET val_extensions - SRCS val_extensions_test.cpp - ${VAL_TEST_COMMON_SRCS} - LIBS ${SPIRV_TOOLS} -) diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_arithmetics_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_arithmetics_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_arithmetics_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_arithmetics_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1215 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Tests for unique type declaration rules validator. - -#include - -#include "gmock/gmock.h" -#include "unit_spirv.h" -#include "val_fixtures.h" - -namespace { - -using ::testing::HasSubstr; -using ::testing::Not; - -using std::string; - -using ValidateArithmetics = spvtest::ValidateBase; - -std::string GenerateCode(const std::string& main_body) { - const std::string prefix = -R"( -OpCapability Shader -OpCapability Int64 -OpCapability Float64 -OpCapability Matrix -%ext_inst = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -%void = OpTypeVoid -%func = OpTypeFunction %void -%bool = OpTypeBool -%f32 = OpTypeFloat 32 -%u32 = OpTypeInt 32 0 -%s32 = OpTypeInt 32 1 -%f64 = OpTypeFloat 64 -%u64 = OpTypeInt 64 0 -%s64 = OpTypeInt 64 1 -%boolvec2 = OpTypeVector %bool 2 -%s32vec2 = OpTypeVector %s32 2 -%u32vec2 = OpTypeVector %u32 2 -%u64vec2 = OpTypeVector %u64 2 -%f32vec2 = OpTypeVector %f32 2 -%f64vec2 = OpTypeVector %f64 2 -%boolvec3 = OpTypeVector %bool 3 -%u32vec3 = OpTypeVector %u32 3 -%u64vec3 = OpTypeVector %u64 3 -%s32vec3 = OpTypeVector %s32 3 -%f32vec3 = OpTypeVector %f32 3 -%f64vec3 = OpTypeVector %f64 3 -%boolvec4 = OpTypeVector %bool 4 -%u32vec4 = OpTypeVector %u32 4 -%u64vec4 = OpTypeVector %u64 4 -%s32vec4 = OpTypeVector %s32 4 -%f32vec4 = OpTypeVector %f32 4 -%f64vec4 = OpTypeVector %f64 4 - -%f32mat22 = OpTypeMatrix %f32vec2 2 -%f32mat23 = OpTypeMatrix %f32vec2 3 -%f32mat32 = OpTypeMatrix %f32vec3 2 -%f32mat33 = OpTypeMatrix %f32vec3 3 -%f64mat22 = OpTypeMatrix %f64vec2 2 - -%struct_f32_f32 = OpTypeStruct %f32 %f32 -%struct_u32_u32 = OpTypeStruct %u32 %u32 -%struct_u32_u32_u32 = OpTypeStruct %u32 %u32 %u32 -%struct_s32_s32 = OpTypeStruct %s32 %s32 -%struct_s32_u32 = OpTypeStruct %s32 %u32 -%struct_u32vec2_u32vec2 = OpTypeStruct %u32vec2 %u32vec2 -%struct_s32vec2_s32vec2 = OpTypeStruct %s32vec2 %s32vec2 - -%f32_0 = OpConstant %f32 0 -%f32_1 = OpConstant %f32 1 -%f32_2 = OpConstant %f32 2 -%f32_3 = OpConstant %f32 3 -%f32_4 = OpConstant %f32 4 -%f32_pi = OpConstant %f32 3.14159 - -%s32_0 = OpConstant %s32 0 -%s32_1 = OpConstant %s32 1 -%s32_2 = OpConstant %s32 2 -%s32_3 = OpConstant %s32 3 -%s32_4 = OpConstant %s32 4 -%s32_m1 = OpConstant %s32 -1 - -%u32_0 = OpConstant %u32 0 -%u32_1 = OpConstant %u32 1 -%u32_2 = OpConstant %u32 2 -%u32_3 = OpConstant %u32 3 -%u32_4 = OpConstant %u32 4 - -%f64_0 = OpConstant %f64 0 -%f64_1 = OpConstant %f64 1 -%f64_2 = OpConstant %f64 2 -%f64_3 = OpConstant %f64 3 -%f64_4 = OpConstant %f64 4 - -%s64_0 = OpConstant %s64 0 -%s64_1 = OpConstant %s64 1 -%s64_2 = OpConstant %s64 2 -%s64_3 = OpConstant %s64 3 -%s64_4 = OpConstant %s64 4 -%s64_m1 = OpConstant %s64 -1 - -%u64_0 = OpConstant %u64 0 -%u64_1 = OpConstant %u64 1 -%u64_2 = OpConstant %u64 2 -%u64_3 = OpConstant %u64 3 -%u64_4 = OpConstant %u64 4 - -%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 -%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 -%u32vec3_012 = OpConstantComposite %u32vec3 %u32_0 %u32_1 %u32_2 -%u32vec3_123 = OpConstantComposite %u32vec3 %u32_1 %u32_2 %u32_3 -%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 -%u32vec4_1234 = OpConstantComposite %u32vec4 %u32_1 %u32_2 %u32_3 %u32_4 - -%s32vec2_01 = OpConstantComposite %s32vec2 %s32_0 %s32_1 -%s32vec2_12 = OpConstantComposite %s32vec2 %s32_1 %s32_2 -%s32vec3_012 = OpConstantComposite %s32vec3 %s32_0 %s32_1 %s32_2 -%s32vec3_123 = OpConstantComposite %s32vec3 %s32_1 %s32_2 %s32_3 -%s32vec4_0123 = OpConstantComposite %s32vec4 %s32_0 %s32_1 %s32_2 %s32_3 -%s32vec4_1234 = OpConstantComposite %s32vec4 %s32_1 %s32_2 %s32_3 %s32_4 - -%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 -%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 -%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 -%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 -%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 -%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 - -%f64vec2_01 = OpConstantComposite %f64vec2 %f64_0 %f64_1 -%f64vec2_12 = OpConstantComposite %f64vec2 %f64_1 %f64_2 -%f64vec3_012 = OpConstantComposite %f64vec3 %f64_0 %f64_1 %f64_2 -%f64vec3_123 = OpConstantComposite %f64vec3 %f64_1 %f64_2 %f64_3 -%f64vec4_0123 = OpConstantComposite %f64vec4 %f64_0 %f64_1 %f64_2 %f64_3 -%f64vec4_1234 = OpConstantComposite %f64vec4 %f64_1 %f64_2 %f64_3 %f64_4 - -%f32mat22_1212 = OpConstantComposite %f32mat22 %f32vec2_12 %f32vec2_12 -%f32mat23_121212 = OpConstantComposite %f32mat23 %f32vec2_12 %f32vec2_12 %f32vec2_12 -%f32mat32_123123 = OpConstantComposite %f32mat32 %f32vec3_123 %f32vec3_123 -%f32mat33_123123123 = OpConstantComposite %f32mat33 %f32vec3_123 %f32vec3_123 %f32vec3_123 - -%f64mat22_1212 = OpConstantComposite %f64mat22 %f64vec2_12 %f64vec2_12 - -%main = OpFunction %void None %func -%main_entry = OpLabel)"; - - const std::string suffix = -R"( -OpReturn -OpFunctionEnd)"; - - return prefix + main_body + suffix; -} - -TEST_F(ValidateArithmetics, F32Success) { - const std::string body = R"( -%val1 = OpFMul %f32 %f32_0 %f32_1 -%val2 = OpFSub %f32 %f32_2 %f32_0 -%val3 = OpFAdd %f32 %val1 %val2 -%val4 = OpFNegate %f32 %val3 -%val5 = OpFDiv %f32 %val4 %val1 -%val6 = OpFRem %f32 %val4 %f32_2 -%val7 = OpFMod %f32 %val4 %f32_2 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, F64Success) { - const std::string body = R"( -%val1 = OpFMul %f64 %f64_0 %f64_1 -%val2 = OpFSub %f64 %f64_2 %f64_0 -%val3 = OpFAdd %f64 %val1 %val2 -%val4 = OpFNegate %f64 %val3 -%val5 = OpFDiv %f64 %val4 %val1 -%val6 = OpFRem %f64 %val4 %f64_2 -%val7 = OpFMod %f64 %val4 %f64_2 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, Int32Success) { - const std::string body = R"( -%val1 = OpIMul %u32 %s32_0 %u32_1 -%val2 = OpIMul %s32 %s32_2 %u32_1 -%val3 = OpIAdd %u32 %val1 %val2 -%val4 = OpIAdd %s32 %val1 %val2 -%val5 = OpISub %u32 %val3 %val4 -%val6 = OpISub %s32 %val4 %val3 -%val7 = OpSDiv %s32 %val4 %val3 -%val8 = OpSNegate %s32 %val7 -%val9 = OpSRem %s32 %val4 %val3 -%val10 = OpSMod %s32 %val4 %val3 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, Int64Success) { - const std::string body = R"( -%val1 = OpIMul %u64 %s64_0 %u64_1 -%val2 = OpIMul %s64 %s64_2 %u64_1 -%val3 = OpIAdd %u64 %val1 %val2 -%val4 = OpIAdd %s64 %val1 %val2 -%val5 = OpISub %u64 %val3 %val4 -%val6 = OpISub %s64 %val4 %val3 -%val7 = OpSDiv %s64 %val4 %val3 -%val8 = OpSNegate %s64 %val7 -%val9 = OpSRem %s64 %val4 %val3 -%val10 = OpSMod %s64 %val4 %val3 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, F32Vec2Success) { - const std::string body = R"( -%val1 = OpFMul %f32vec2 %f32vec2_01 %f32vec2_12 -%val2 = OpFSub %f32vec2 %f32vec2_12 %f32vec2_01 -%val3 = OpFAdd %f32vec2 %val1 %val2 -%val4 = OpFNegate %f32vec2 %val3 -%val5 = OpFDiv %f32vec2 %val4 %val1 -%val6 = OpFRem %f32vec2 %val4 %f32vec2_12 -%val7 = OpFMod %f32vec2 %val4 %f32vec2_12 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, F64Vec2Success) { - const std::string body = R"( -%val1 = OpFMul %f64vec2 %f64vec2_01 %f64vec2_12 -%val2 = OpFSub %f64vec2 %f64vec2_12 %f64vec2_01 -%val3 = OpFAdd %f64vec2 %val1 %val2 -%val4 = OpFNegate %f64vec2 %val3 -%val5 = OpFDiv %f64vec2 %val4 %val1 -%val6 = OpFRem %f64vec2 %val4 %f64vec2_12 -%val7 = OpFMod %f64vec2 %val4 %f64vec2_12 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, U32Vec2Success) { - const std::string body = R"( -%val1 = OpIMul %u32vec2 %u32vec2_01 %u32vec2_12 -%val2 = OpISub %u32vec2 %u32vec2_12 %u32vec2_01 -%val3 = OpIAdd %u32vec2 %val1 %val2 -%val4 = OpSNegate %u32vec2 %val3 -%val5 = OpSDiv %u32vec2 %val4 %val1 -%val6 = OpSRem %u32vec2 %val4 %u32vec2_12 -%val7 = OpSMod %u32vec2 %val4 %u32vec2_12 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, FNegateTypeIdU32) { - const std::string body = R"( -%val = OpFNegate %u32 %u32_0 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected floating scalar or vector type as Result Type: FNegate")); -} - -TEST_F(ValidateArithmetics, FNegateTypeIdVec2U32) { - const std::string body = R"( -%val = OpFNegate %u32vec2 %u32vec2_01 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected floating scalar or vector type as Result Type: FNegate")); -} - -TEST_F(ValidateArithmetics, FNegateWrongOperand) { - const std::string body = R"( -%val = OpFNegate %f32 %u32_0 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected arithmetic operands to be of Result Type: " - "FNegate operand index 2")); -} - -TEST_F(ValidateArithmetics, FMulTypeIdU32) { - const std::string body = R"( -%val = OpFMul %u32 %u32_0 %u32_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected floating scalar or vector type as Result Type: FMul")); -} - -TEST_F(ValidateArithmetics, FMulTypeIdVec2U32) { - const std::string body = R"( -%val = OpFMul %u32vec2 %u32vec2_01 %u32vec2_12 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected floating scalar or vector type as Result Type: FMul")); -} - -TEST_F(ValidateArithmetics, FMulWrongOperand1) { - const std::string body = R"( -%val = OpFMul %f32 %u32_0 %f32_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected arithmetic operands to be of Result Type: " - "FMul operand index 2")); -} - -TEST_F(ValidateArithmetics, FMulWrongOperand2) { - const std::string body = R"( -%val = OpFMul %f32 %f32_0 %u32_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected arithmetic operands to be of Result Type: " - "FMul operand index 3")); -} - -TEST_F(ValidateArithmetics, FMulWrongVectorOperand1) { - const std::string body = R"( -%val = OpFMul %f64vec3 %f32vec3_123 %f64vec3_012 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected arithmetic operands to be of Result Type: " - "FMul operand index 2")); -} - -TEST_F(ValidateArithmetics, FMulWrongVectorOperand2) { - const std::string body = R"( -%val = OpFMul %f32vec3 %f32vec3_123 %f64vec3_012 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected arithmetic operands to be of Result Type: " - "FMul operand index 3")); -} - -TEST_F(ValidateArithmetics, IMulFloatTypeId) { - const std::string body = R"( -%val = OpIMul %f32 %u32_0 %s32_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected int scalar or vector type as Result Type: IMul")); -} - -TEST_F(ValidateArithmetics, IMulFloatOperand1) { - const std::string body = R"( -%val = OpIMul %u32 %f32_0 %s32_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected int scalar or vector type as operand: " - "IMul operand index 2")); -} - -TEST_F(ValidateArithmetics, IMulFloatOperand2) { - const std::string body = R"( -%val = OpIMul %u32 %s32_0 %f32_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected int scalar or vector type as operand: " - "IMul operand index 3")); -} - -TEST_F(ValidateArithmetics, IMulWrongBitWidthOperand1) { - const std::string body = R"( -%val = OpIMul %u64 %u32_0 %s64_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected arithmetic operands to have the same bit width " - "as Result Type: IMul operand index 2")); -} - -TEST_F(ValidateArithmetics, IMulWrongBitWidthOperand2) { - const std::string body = R"( -%val = OpIMul %u32 %u32_0 %s64_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected arithmetic operands to have the same bit width " - "as Result Type: IMul operand index 3")); -} - -TEST_F(ValidateArithmetics, IMulWrongBitWidthVector) { - const std::string body = R"( -%val = OpIMul %u64vec3 %u32vec3_012 %u32vec3_123 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected arithmetic operands to have the same bit width " - "as Result Type: IMul operand index 2")); -} - -TEST_F(ValidateArithmetics, IMulVectorScalarOperand1) { - const std::string body = R"( -%val = OpIMul %u32vec2 %u32_0 %u32vec2_01 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected arithmetic operands to have the same dimension " - "as Result Type: IMul operand index 2")); -} - -TEST_F(ValidateArithmetics, IMulVectorScalarOperand2) { - const std::string body = R"( -%val = OpIMul %u32vec2 %u32vec2_01 %u32_0 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected arithmetic operands to have the same dimension " - "as Result Type: IMul operand index 3")); -} - -TEST_F(ValidateArithmetics, IMulScalarVectorOperand1) { - const std::string body = R"( -%val = OpIMul %s32 %u32vec2_01 %u32_0 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected arithmetic operands to have the same dimension " - "as Result Type: IMul operand index 2")); -} - -TEST_F(ValidateArithmetics, IMulScalarVectorOperand2) { - const std::string body = R"( -%val = OpIMul %u32 %u32_0 %s32vec2_01 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected arithmetic operands to have the same dimension " - "as Result Type: IMul operand index 3")); -} - -TEST_F(ValidateArithmetics, SNegateFloat) { - const std::string body = R"( -%val = OpSNegate %s32 %f32_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected int scalar or vector type as operand: " - "SNegate operand index 2")); -} - -TEST_F(ValidateArithmetics, UDivFloatType) { - const std::string body = R"( -%val = OpUDiv %f32 %u32_2 %u32_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected unsigned int scalar or vector type as Result Type: UDiv")); -} - -TEST_F(ValidateArithmetics, UDivSignedIntType) { - const std::string body = R"( -%val = OpUDiv %s32 %u32_2 %u32_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected unsigned int scalar or vector type as Result Type: UDiv")); -} - -TEST_F(ValidateArithmetics, UDivWrongOperand1) { - const std::string body = R"( -%val = OpUDiv %u64 %f64_2 %u64_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected arithmetic operands to be of Result Type: " - "UDiv operand index 2")); -} - -TEST_F(ValidateArithmetics, UDivWrongOperand2) { - const std::string body = R"( -%val = OpUDiv %u64 %u64_2 %u32_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected arithmetic operands to be of Result Type: " - "UDiv operand index 3")); -} - -TEST_F(ValidateArithmetics, DotSuccess) { - const std::string body = R"( -%val = OpDot %f32 %f32vec2_01 %f32vec2_12 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, DotWrongTypeId) { - const std::string body = R"( -%val = OpDot %u32 %u32vec2_01 %u32vec2_12 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected float scalar type as Result Type: Dot")); -} - -TEST_F(ValidateArithmetics, DotNotVectorTypeOperand1) { - const std::string body = R"( -%val = OpDot %f32 %f32 %f32vec2_12 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected float vector as operand: Dot operand index 2")); -} - -TEST_F(ValidateArithmetics, DotNotVectorTypeOperand2) { - const std::string body = R"( -%val = OpDot %f32 %f32vec3_012 %f32_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected float vector as operand: Dot operand index 3")); -} - -TEST_F(ValidateArithmetics, DotWrongComponentOperand1) { - const std::string body = R"( -%val = OpDot %f64 %f32vec2_01 %f64vec2_12 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected component type to be equal to Result Type: " - "Dot operand index 2")); -} - -TEST_F(ValidateArithmetics, DotWrongComponentOperand2) { - const std::string body = R"( -%val = OpDot %f32 %f32vec2_01 %f64vec2_12 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected component type to be equal to Result Type: " - "Dot operand index 3")); -} - -TEST_F(ValidateArithmetics, DotDifferentVectorSize) { - const std::string body = R"( -%val = OpDot %f32 %f32vec2_01 %f32vec3_123 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected operands to have the same number of componenets: Dot")); -} - -TEST_F(ValidateArithmetics, VectorTimesScalarSuccess) { - const std::string body = R"( -%val = OpVectorTimesScalar %f32vec2 %f32vec2_01 %f32_2 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, VectorTimesScalarWrongTypeId) { - const std::string body = R"( -%val = OpVectorTimesScalar %u32vec2 %f32vec2_01 %f32_2 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected float vector type as Result Type: " - "VectorTimesScalar")); -} - -TEST_F(ValidateArithmetics, VectorTimesScalarWrongVector) { - const std::string body = R"( -%val = OpVectorTimesScalar %f32vec2 %f32vec3_012 %f32_2 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected vector operand type to be equal to Result Type: " - "VectorTimesScalar")); -} - -TEST_F(ValidateArithmetics, VectorTimesScalarWrongScalar) { - const std::string body = R"( -%val = OpVectorTimesScalar %f32vec2 %f32vec2_01 %f64_2 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected scalar operand type to be equal to the component " - "type of the vector operand: VectorTimesScalar")); -} - -TEST_F(ValidateArithmetics, MatrixTimesScalarSuccess) { - const std::string body = R"( -%val = OpMatrixTimesScalar %f32mat22 %f32mat22_1212 %f32_2 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, MatrixTimesScalarWrongTypeId) { - const std::string body = R"( -%val = OpMatrixTimesScalar %f32vec2 %f32mat22_1212 %f32_2 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected float matrix type as Result Type: " - "MatrixTimesScalar")); -} - -TEST_F(ValidateArithmetics, MatrixTimesScalarWrongMatrix) { - const std::string body = R"( -%val = OpMatrixTimesScalar %f32mat22 %f32vec2_01 %f32_2 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected matrix operand type to be equal to Result Type: " - "MatrixTimesScalar")); -} - -TEST_F(ValidateArithmetics, MatrixTimesScalarWrongScalar) { - const std::string body = R"( -%val = OpMatrixTimesScalar %f32mat22 %f32mat22_1212 %f64_2 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected scalar operand type to be equal to the component " - "type of the matrix operand: MatrixTimesScalar")); -} - -TEST_F(ValidateArithmetics, VectorTimesMatrix2x22Success) { - const std::string body = R"( -%val = OpVectorTimesMatrix %f32vec2 %f32vec2_12 %f32mat22_1212 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, VectorTimesMatrix3x32Success) { - const std::string body = R"( -%val = OpVectorTimesMatrix %f32vec2 %f32vec3_123 %f32mat32_123123 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, VectorTimesMatrixWrongTypeId) { - const std::string body = R"( -%val = OpVectorTimesMatrix %f32mat22 %f32vec2_12 %f32mat22_1212 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected float vector type as Result Type: " - "VectorTimesMatrix")); -} - -TEST_F(ValidateArithmetics, VectorTimesMatrixNotFloatVector) { - const std::string body = R"( -%val = OpVectorTimesMatrix %f32vec2 %u32vec2_12 %f32mat22_1212 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected float vector type as left operand: " - "VectorTimesMatrix")); -} - -TEST_F(ValidateArithmetics, VectorTimesMatrixWrongVectorComponent) { - const std::string body = R"( -%val = OpVectorTimesMatrix %f32vec2 %f64vec2_12 %f32mat22_1212 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected component types of Result Type and vector to be equal: " - "VectorTimesMatrix")); -} - -TEST_F(ValidateArithmetics, VectorTimesMatrixWrongMatrix) { - const std::string body = R"( -%val = OpVectorTimesMatrix %f32vec2 %f32vec2_12 %f32vec2_12 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected float matrix type as right operand: " - "VectorTimesMatrix")); -} - -TEST_F(ValidateArithmetics, VectorTimesMatrixWrongMatrixComponent) { - const std::string body = R"( -%val = OpVectorTimesMatrix %f32vec2 %f32vec2_12 %f64mat22_1212 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected component types of Result Type and matrix to be equal: " - "VectorTimesMatrix")); -} - -TEST_F(ValidateArithmetics, VectorTimesMatrix2eq2x23Fail) { - const std::string body = R"( -%val = OpVectorTimesMatrix %f32vec2 %f32vec2_12 %f32mat23_121212 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected number of columns of the matrix to be equal to Result Type " - "vector size: VectorTimesMatrix")); -} - -TEST_F(ValidateArithmetics, VectorTimesMatrix2x32Fail) { - const std::string body = R"( -%val = OpVectorTimesMatrix %f32vec2 %f32vec2_12 %f32mat32_123123 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected number of rows of the matrix to be equal to the vector " - "operand size: VectorTimesMatrix")); -} - -TEST_F(ValidateArithmetics, MatrixTimesVector22x2Success) { - const std::string body = R"( -%val = OpMatrixTimesVector %f32vec2 %f32mat22_1212 %f32vec2_12 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, MatrixTimesVector23x3Success) { - const std::string body = R"( -%val = OpMatrixTimesVector %f32vec2 %f32mat23_121212 %f32vec3_123 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, MatrixTimesVectorWrongTypeId) { - const std::string body = R"( -%val = OpMatrixTimesVector %f32mat22 %f32mat22_1212 %f32vec2_12 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected float vector type as Result Type: " - "MatrixTimesVector")); -} - -TEST_F(ValidateArithmetics, MatrixTimesVectorWrongMatrix) { - const std::string body = R"( -%val = OpMatrixTimesVector %f32vec3 %f32vec3_123 %f32vec3_123 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected float matrix type as left operand: " - "MatrixTimesVector")); -} - -TEST_F(ValidateArithmetics, MatrixTimesVectorWrongMatrixCol) { - const std::string body = R"( -%val = OpMatrixTimesVector %f32vec3 %f32mat23_121212 %f32vec3_123 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected column type of the matrix to be equal to Result Type: " - "MatrixTimesVector")); -} - -TEST_F(ValidateArithmetics, MatrixTimesVectorWrongVector) { - const std::string body = R"( -%val = OpMatrixTimesVector %f32vec2 %f32mat22_1212 %u32vec2_12 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected float vector type as right operand: " - "MatrixTimesVector")); -} - -TEST_F(ValidateArithmetics, MatrixTimesVectorDifferentComponents) { - const std::string body = R"( -%val = OpMatrixTimesVector %f32vec2 %f32mat22_1212 %f64vec2_12 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected component types of the operands to be equal: " - "MatrixTimesVector")); -} - -TEST_F(ValidateArithmetics, MatrixTimesVector22x3Fail) { - const std::string body = R"( -%val = OpMatrixTimesVector %f32vec2 %f32mat22_1212 %f32vec3_123 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected number of columns of the matrix to be equal to the vector " - "size: MatrixTimesVector")); -} - -TEST_F(ValidateArithmetics, MatrixTimesMatrix22x22Success) { - const std::string body = R"( -%val = OpMatrixTimesMatrix %f32mat22 %f32mat22_1212 %f32mat22_1212 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, MatrixTimesMatrix23x32Success) { - const std::string body = R"( -%val = OpMatrixTimesMatrix %f32mat22 %f32mat23_121212 %f32mat32_123123 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, MatrixTimesMatrix33x33Success) { - const std::string body = R"( -%val = OpMatrixTimesMatrix %f32mat33 %f32mat33_123123123 %f32mat33_123123123 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, MatrixTimesMatrixWrongTypeId) { - const std::string body = R"( -%val = OpMatrixTimesMatrix %f32vec2 %f32mat22_1212 %f32mat22_1212 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected float matrix type as Result Type: MatrixTimesMatrix")); -} - -TEST_F(ValidateArithmetics, MatrixTimesMatrixWrongLeftOperand) { - const std::string body = R"( -%val = OpMatrixTimesMatrix %f32mat22 %f32vec2_12 %f32mat22_1212 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected float matrix type as left operand: MatrixTimesMatrix")); -} - -TEST_F(ValidateArithmetics, MatrixTimesMatrixWrongRightOperand) { - const std::string body = R"( -%val = OpMatrixTimesMatrix %f32mat22 %f32mat22_1212 %f32vec2_12 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected float matrix type as right operand: MatrixTimesMatrix")); -} - -TEST_F(ValidateArithmetics, MatrixTimesMatrix32x23Fail) { - const std::string body = R"( -%val = OpMatrixTimesMatrix %f32mat22 %f32mat32_123123 %f32mat23_121212 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected column types of Result Type and left matrix to be equal: " - "MatrixTimesMatrix")); -} - -TEST_F(ValidateArithmetics, MatrixTimesMatrixDifferentComponents) { - const std::string body = R"( -%val = OpMatrixTimesMatrix %f32mat22 %f32mat22_1212 %f64mat22_1212 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected component types of Result Type and right matrix to be equal: " - "MatrixTimesMatrix")); -} - -TEST_F(ValidateArithmetics, MatrixTimesMatrix23x23Fail) { - const std::string body = R"( -%val = OpMatrixTimesMatrix %f32mat22 %f32mat23_121212 %f32mat23_121212 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected number of columns of Result Type and right matrix to be equal: " - "MatrixTimesMatrix")); -} - -TEST_F(ValidateArithmetics, MatrixTimesMatrix23x22Fail) { - const std::string body = R"( -%val = OpMatrixTimesMatrix %f32mat22 %f32mat23_121212 %f32mat22_1212 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected number of columns of left matrix and number of rows of right " - "matrix to be equal: MatrixTimesMatrix")); -} - -TEST_F(ValidateArithmetics, OuterProduct2x2Success) { - const std::string body = R"( -%val = OpOuterProduct %f32mat22 %f32vec2_12 %f32vec2_01 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, OuterProduct3x2Success) { - const std::string body = R"( -%val = OpOuterProduct %f32mat32 %f32vec3_123 %f32vec2_01 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, OuterProduct2x3Success) { - const std::string body = R"( -%val = OpOuterProduct %f32mat23 %f32vec2_01 %f32vec3_123 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, OuterProductWrongTypeId) { - const std::string body = R"( -%val = OpOuterProduct %f32vec2 %f32vec2_01 %f32vec3_123 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected float matrix type as Result Type: " - "OuterProduct")); -} - -TEST_F(ValidateArithmetics, OuterProductWrongLeftOperand) { - const std::string body = R"( -%val = OpOuterProduct %f32mat22 %f32vec3_123 %f32vec2_01 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected column type of Result Type to be equal to the type " - "of the left operand: OuterProduct")); -} - -TEST_F(ValidateArithmetics, OuterProductRightOperandNotFloatVector) { - const std::string body = R"( -%val = OpOuterProduct %f32mat22 %f32vec2_12 %u32vec2_01 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected float vector type as right operand: OuterProduct")); -} - -TEST_F(ValidateArithmetics, OuterProductRightOperandWrongComponent) { - const std::string body = R"( -%val = OpOuterProduct %f32mat22 %f32vec2_12 %f64vec2_01 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected component types of the operands to be equal: OuterProduct")); -} - -TEST_F(ValidateArithmetics, OuterProductRightOperandWrongDimension) { - const std::string body = R"( -%val = OpOuterProduct %f32mat22 %f32vec2_12 %f32vec3_123 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected number of columns of the matrix to be equal to the " - "vector size of the right operand: OuterProduct")); -} - -TEST_F(ValidateArithmetics, IAddCarrySuccess) { - const std::string body = R"( -%val1 = OpIAddCarry %struct_u32_u32 %u32_0 %u32_1 -%val2 = OpIAddCarry %struct_u32vec2_u32vec2 %u32vec2_01 %u32vec2_12 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, IAddCarryResultTypeNotStruct) { - const std::string body = R"( -%val = OpIAddCarry %u32 %u32_0 %u32_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected a struct as Result Type: IAddCarry")); -} - -TEST_F(ValidateArithmetics, IAddCarryResultTypeNotTwoMembers) { - const std::string body = R"( -%val = OpIAddCarry %struct_u32_u32_u32 %u32_0 %u32_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Result Type struct to have two members: IAddCarry")); -} - -TEST_F(ValidateArithmetics, IAddCarryResultTypeMemberNotUnsignedInt) { - const std::string body = R"( -%val = OpIAddCarry %struct_s32_s32 %s32_0 %s32_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Result Type struct member types to be unsigned integer scalar " - "or vector: IAddCarry")); -} - -TEST_F(ValidateArithmetics, IAddCarryWrongLeftOperand) { - const std::string body = R"( -%val = OpIAddCarry %struct_u32_u32 %s32_0 %u32_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected both operands to be of Result Type member type: IAddCarry")); -} - -TEST_F(ValidateArithmetics, IAddCarryWrongRightOperand) { - const std::string body = R"( -%val = OpIAddCarry %struct_u32_u32 %u32_0 %s32_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected both operands to be of Result Type member type: IAddCarry")); -} - -TEST_F(ValidateArithmetics, OpSMulExtendedSuccess) { - const std::string body = R"( -%val1 = OpSMulExtended %struct_u32_u32 %u32_0 %u32_1 -%val2 = OpSMulExtended %struct_s32_s32 %s32_0 %s32_1 -%val3 = OpSMulExtended %struct_u32vec2_u32vec2 %u32vec2_01 %u32vec2_12 -%val4 = OpSMulExtended %struct_s32vec2_s32vec2 %s32vec2_01 %s32vec2_12 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateArithmetics, SMulExtendedResultTypeMemberNotInt) { - const std::string body = R"( -%val = OpSMulExtended %struct_f32_f32 %f32_0 %f32_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Result Type struct member types to be integer scalar " - "or vector: SMulExtended")); -} - -TEST_F(ValidateArithmetics, SMulExtendedResultTypeMembersNotIdentical) { - const std::string body = R"( -%val = OpSMulExtended %struct_s32_u32 %s32_0 %s32_1 -)"; - - CompileSuccessfully(GenerateCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Result Type struct member types to be identical: " - "SMulExtended")); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_bitwise_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_bitwise_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_bitwise_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_bitwise_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,512 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Tests for unique type declaration rules validator. - -#include - -#include "gmock/gmock.h" -#include "unit_spirv.h" -#include "val_fixtures.h" - -namespace { - -using ::testing::HasSubstr; -using ::testing::Not; - -using ValidateBitwise = spvtest::ValidateBase; - -std::string GenerateShaderCode( - const std::string& body, - const std::string& capabilities_and_extensions = "") { - const std::string capabilities = -R"( -OpCapability Shader -OpCapability Int64 -OpCapability Float64)"; - - const std::string after_extension_before_body = -R"( -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -%void = OpTypeVoid -%func = OpTypeFunction %void -%bool = OpTypeBool -%f32 = OpTypeFloat 32 -%u32 = OpTypeInt 32 0 -%s32 = OpTypeInt 32 1 -%f64 = OpTypeFloat 64 -%u64 = OpTypeInt 64 0 -%s64 = OpTypeInt 64 1 -%boolvec2 = OpTypeVector %bool 2 -%s32vec2 = OpTypeVector %s32 2 -%u32vec2 = OpTypeVector %u32 2 -%u64vec2 = OpTypeVector %u64 2 -%f32vec2 = OpTypeVector %f32 2 -%f64vec2 = OpTypeVector %f64 2 -%boolvec3 = OpTypeVector %bool 3 -%u32vec3 = OpTypeVector %u32 3 -%u64vec3 = OpTypeVector %u64 3 -%s32vec3 = OpTypeVector %s32 3 -%f32vec3 = OpTypeVector %f32 3 -%f64vec3 = OpTypeVector %f64 3 -%boolvec4 = OpTypeVector %bool 4 -%u32vec4 = OpTypeVector %u32 4 -%u64vec4 = OpTypeVector %u64 4 -%s32vec4 = OpTypeVector %s32 4 -%f32vec4 = OpTypeVector %f32 4 -%f64vec4 = OpTypeVector %f64 4 - -%f32_0 = OpConstant %f32 0 -%f32_1 = OpConstant %f32 1 -%f32_2 = OpConstant %f32 2 -%f32_3 = OpConstant %f32 3 -%f32_4 = OpConstant %f32 4 - -%s32_0 = OpConstant %s32 0 -%s32_1 = OpConstant %s32 1 -%s32_2 = OpConstant %s32 2 -%s32_3 = OpConstant %s32 3 -%s32_4 = OpConstant %s32 4 -%s32_m1 = OpConstant %s32 -1 - -%u32_0 = OpConstant %u32 0 -%u32_1 = OpConstant %u32 1 -%u32_2 = OpConstant %u32 2 -%u32_3 = OpConstant %u32 3 -%u32_4 = OpConstant %u32 4 - -%f64_0 = OpConstant %f64 0 -%f64_1 = OpConstant %f64 1 -%f64_2 = OpConstant %f64 2 -%f64_3 = OpConstant %f64 3 -%f64_4 = OpConstant %f64 4 - -%s64_0 = OpConstant %s64 0 -%s64_1 = OpConstant %s64 1 -%s64_2 = OpConstant %s64 2 -%s64_3 = OpConstant %s64 3 -%s64_4 = OpConstant %s64 4 -%s64_m1 = OpConstant %s64 -1 - -%u64_0 = OpConstant %u64 0 -%u64_1 = OpConstant %u64 1 -%u64_2 = OpConstant %u64 2 -%u64_3 = OpConstant %u64 3 -%u64_4 = OpConstant %u64 4 - -%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 -%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 -%u32vec3_012 = OpConstantComposite %u32vec3 %u32_0 %u32_1 %u32_2 -%u32vec3_123 = OpConstantComposite %u32vec3 %u32_1 %u32_2 %u32_3 -%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 -%u32vec4_1234 = OpConstantComposite %u32vec4 %u32_1 %u32_2 %u32_3 %u32_4 - -%s32vec2_01 = OpConstantComposite %s32vec2 %s32_0 %s32_1 -%s32vec2_12 = OpConstantComposite %s32vec2 %s32_1 %s32_2 -%s32vec3_012 = OpConstantComposite %s32vec3 %s32_0 %s32_1 %s32_2 -%s32vec3_123 = OpConstantComposite %s32vec3 %s32_1 %s32_2 %s32_3 -%s32vec4_0123 = OpConstantComposite %s32vec4 %s32_0 %s32_1 %s32_2 %s32_3 -%s32vec4_1234 = OpConstantComposite %s32vec4 %s32_1 %s32_2 %s32_3 %s32_4 - -%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 -%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 -%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 -%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 -%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 -%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 - -%main = OpFunction %void None %func -%main_entry = OpLabel)"; - - const std::string after_body = -R"( -OpReturn -OpFunctionEnd)"; - - return capabilities + capabilities_and_extensions + - after_extension_before_body + body + after_body; -} - -TEST_F(ValidateBitwise, ShiftAllSuccess) { - const std::string body = R"( -%val1 = OpShiftRightLogical %u64 %u64_1 %s32_2 -%val2 = OpShiftRightArithmetic %s32vec2 %s32vec2_12 %s32vec2_12 -%val3 = OpShiftLeftLogical %u32vec2 %s32vec2_12 %u32vec2_12 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateBitwise, OpShiftRightLogicalWrongResultType) { - const std::string body = R"( -%val1 = OpShiftRightLogical %bool %u64_1 %s32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected int scalar or vector type as Result Type: ShiftRightLogical")); -} - -TEST_F(ValidateBitwise, OpShiftRightLogicalBaseNotInt) { - const std::string body = R"( -%val1 = OpShiftRightLogical %u32 %f32_1 %s32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Base to be int scalar or vector: ShiftRightLogical")); -} - -TEST_F(ValidateBitwise, OpShiftRightLogicalBaseWrongDimension) { - const std::string body = R"( -%val1 = OpShiftRightLogical %u32 %u32vec2_12 %s32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Base to have the same dimension as Result Type: " - "ShiftRightLogical")); -} - -TEST_F(ValidateBitwise, OpShiftRightLogicalBaseWrongBitWidth) { - const std::string body = R"( -%val1 = OpShiftRightLogical %u64 %u32_1 %s32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Base to have the same bit width as Result Type: " - "ShiftRightLogical")); -} - -TEST_F(ValidateBitwise, OpShiftRightLogicalShiftNotInt) { - const std::string body = R"( -%val1 = OpShiftRightLogical %u32 %u32_1 %f32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Shift to be int scalar or vector: ShiftRightLogical")); -} - -TEST_F(ValidateBitwise, OpShiftRightLogicalShiftWrongDimension) { - const std::string body = R"( -%val1 = OpShiftRightLogical %u32 %u32_1 %s32vec2_12 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Shift to have the same dimension as Result Type: " - "ShiftRightLogical")); -} - -TEST_F(ValidateBitwise, LogicAllSuccess) { - const std::string body = R"( -%val1 = OpBitwiseOr %u64 %u64_1 %s64_0 -%val2 = OpBitwiseAnd %s64 %s64_1 %u64_0 -%val3 = OpBitwiseXor %s32vec2 %s32vec2_12 %u32vec2_01 -%val4 = OpNot %s32vec2 %u32vec2_01 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateBitwise, OpBitwiseAndWrongResultType) { - const std::string body = R"( -%val1 = OpBitwiseAnd %bool %u64_1 %s32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected int scalar or vector type as Result Type: BitwiseAnd")); -} - -TEST_F(ValidateBitwise, OpBitwiseAndLeftNotInt) { - const std::string body = R"( -%val1 = OpBitwiseAnd %u32 %f32_1 %s32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected int scalar or vector as operand: BitwiseAnd " - "operand index 2")); -} - -TEST_F(ValidateBitwise, OpBitwiseAndRightNotInt) { - const std::string body = R"( -%val1 = OpBitwiseAnd %u32 %u32_1 %f32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected int scalar or vector as operand: BitwiseAnd " - "operand index 3")); -} - -TEST_F(ValidateBitwise, OpBitwiseAndLeftWrongDimension) { - const std::string body = R"( -%val1 = OpBitwiseAnd %u32 %u32vec2_12 %s32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected operands to have the same dimension as Result Type: " - "BitwiseAnd operand index 2")); -} - -TEST_F(ValidateBitwise, OpBitwiseAndRightWrongDimension) { - const std::string body = R"( -%val1 = OpBitwiseAnd %u32 %s32_2 %u32vec2_12 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected operands to have the same dimension as Result Type: " - "BitwiseAnd operand index 3")); -} - -TEST_F(ValidateBitwise, OpBitwiseAndLeftWrongBitWidth) { - const std::string body = R"( -%val1 = OpBitwiseAnd %u64 %u32_1 %s64_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected operands to have the same bit width as Result Type: " - "BitwiseAnd operand index 2")); -} - -TEST_F(ValidateBitwise, OpBitwiseAndRightWrongBitWidth) { - const std::string body = R"( -%val1 = OpBitwiseAnd %u64 %u64_1 %s32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected operands to have the same bit width as Result Type: " - "BitwiseAnd operand index 3")); -} - -TEST_F(ValidateBitwise, OpBitFieldInsertSuccess) { - const std::string body = R"( -%val1 = OpBitFieldInsert %u64 %u64_1 %u64_2 %s32_1 %s32_2 -%val2 = OpBitFieldInsert %s32vec2 %s32vec2_12 %s32vec2_12 %s32_1 %u32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateBitwise, OpBitFieldInsertWrongResultType) { - const std::string body = R"( -%val1 = OpBitFieldInsert %bool %u64_1 %u64_2 %s32_1 %s32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected int scalar or vector type as Result Type: BitFieldInsert")); -} - -TEST_F(ValidateBitwise, OpBitFieldInsertWrongBaseType) { - const std::string body = R"( -%val1 = OpBitFieldInsert %u64 %s64_1 %u64_2 %s32_1 %s32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Base Type to be equal to Result Type: BitFieldInsert")); -} - -TEST_F(ValidateBitwise, OpBitFieldInsertWrongInsertType) { - const std::string body = R"( -%val1 = OpBitFieldInsert %u64 %u64_1 %s64_2 %s32_1 %s32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Insert Type to be equal to Result Type: BitFieldInsert")); -} - -TEST_F(ValidateBitwise, OpBitFieldInsertOffsetNotInt) { - const std::string body = R"( -%val1 = OpBitFieldInsert %u64 %u64_1 %u64_2 %f32_1 %s32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Offset Type to be int scalar: BitFieldInsert")); -} - -TEST_F(ValidateBitwise, OpBitFieldInsertCountNotInt) { - const std::string body = R"( -%val1 = OpBitFieldInsert %u64 %u64_1 %u64_2 %u32_1 %f32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Count Type to be int scalar: BitFieldInsert")); -} - -TEST_F(ValidateBitwise, OpBitFieldSExtractSuccess) { - const std::string body = R"( -%val1 = OpBitFieldSExtract %u64 %u64_1 %s32_1 %s32_2 -%val2 = OpBitFieldSExtract %s32vec2 %s32vec2_12 %s32_1 %u32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateBitwise, OpBitFieldSExtractWrongResultType) { - const std::string body = R"( -%val1 = OpBitFieldSExtract %bool %u64_1 %s32_1 %s32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected int scalar or vector type as Result Type: BitFieldSExtract")); -} - -TEST_F(ValidateBitwise, OpBitFieldSExtractWrongBaseType) { - const std::string body = R"( -%val1 = OpBitFieldSExtract %u64 %s64_1 %s32_1 %s32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Base Type to be equal to Result Type: BitFieldSExtract")); -} - -TEST_F(ValidateBitwise, OpBitFieldSExtractOffsetNotInt) { - const std::string body = R"( -%val1 = OpBitFieldSExtract %u64 %u64_1 %f32_1 %s32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Offset Type to be int scalar: BitFieldSExtract")); -} - -TEST_F(ValidateBitwise, OpBitFieldSExtractCountNotInt) { - const std::string body = R"( -%val1 = OpBitFieldSExtract %u64 %u64_1 %u32_1 %f32_2 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Count Type to be int scalar: BitFieldSExtract")); -} - -TEST_F(ValidateBitwise, OpBitReverseSuccess) { - const std::string body = R"( -%val1 = OpBitReverse %u64 %u64_1 -%val2 = OpBitReverse %s32vec2 %s32vec2_12 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateBitwise, OpBitReverseWrongResultType) { - const std::string body = R"( -%val1 = OpBitReverse %bool %u64_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected int scalar or vector type as Result Type: BitReverse")); -} - -TEST_F(ValidateBitwise, OpBitReverseWrongBaseType) { - const std::string body = R"( -%val1 = OpBitReverse %u64 %s64_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Base Type to be equal to Result Type: BitReverse")); -} - -TEST_F(ValidateBitwise, OpBitCountSuccess) { - const std::string body = R"( -%val1 = OpBitCount %s32 %u64_1 -%val2 = OpBitCount %u32vec2 %s32vec2_12 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateBitwise, OpBitCountWrongResultType) { - const std::string body = R"( -%val1 = OpBitCount %bool %u64_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected int scalar or vector type as Result Type: BitCount")); -} - -TEST_F(ValidateBitwise, OpBitCountBaseNotInt) { - const std::string body = R"( -%val1 = OpBitCount %u32 %f64_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Base Type to be int scalar or vector: BitCount")); -} - -TEST_F(ValidateBitwise, OpBitCountBaseWrongDimension) { - const std::string body = R"( -%val1 = OpBitCount %u32 %u32vec2_12 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Base dimension to be equal to Result Type dimension: " - "BitCount")); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_capability_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_capability_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_capability_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_capability_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1624 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Validation tests for Logical Layout - -#include -#include -#include -#include - -#include - -#include "source/assembly_grammar.h" -#include "test_fixture.h" -#include "unit_spirv.h" -#include "val_fixtures.h" - -namespace { - -using spvtest::ScopedContext; -using std::get; -using std::make_pair; -using std::ostringstream; -using std::pair; -using std::string; -using std::tuple; -using std::vector; -using testing::Combine; -using testing::HasSubstr; -using testing::Values; -using testing::ValuesIn; - -// Parameter for validation test fixtures. The first string is a capability -// name that will begin the assembly under test, the second the remainder -// assembly, and the vector at the end determines whether the test expects -// success or failure. See below for details and convenience methods to access -// each one. -// -// The assembly to test is composed from a variable top line and a fixed -// remainder. The top line will be an OpCapability instruction, while the -// remainder will be some assembly text that succeeds or fails to assemble -// depending on which capability was chosen. For instance, the following will -// succeed: -// -// OpCapability Pipes ; implies Kernel -// OpLifetimeStop %1 0 ; requires Kernel -// -// and the following will fail: -// -// OpCapability Kernel -// %1 = OpTypeNamedBarrier ; requires NamedBarrier -// -// So how does the test parameter capture which capabilities should cause -// success and which shouldn't? The answer is in the last element: it's a -// vector of capabilities that make the remainder assembly succeed. So if the -// first-line capability exists in that vector, success is expected; otherwise, -// failure is expected in the tests. -// -// We will use testing::Combine() to vary the first line: when we combine -// AllCapabilities() with a single remainder assembly, we generate enough test -// cases to try the assembly with every possible capability that could be -// declared. However, Combine() only produces tuples -- it cannot produce, say, -// a struct. Therefore, this type must be a tuple. -using CapTestParameter = tuple>>; - -const string& Capability(const CapTestParameter& p) { return get<0>(p); } -const string& Remainder(const CapTestParameter& p) { return get<1>(p).first; } -const vector& MustSucceed(const CapTestParameter& p) { - return get<1>(p).second; -} - -// Creates assembly to test from p. -string MakeAssembly(const CapTestParameter& p) { - ostringstream ss; - const string& capability = Capability(p); - if (!capability.empty()) { - ss << "OpCapability " << capability << "\n"; - } - ss << Remainder(p); - return ss.str(); -} - -// Expected validation result for p. -spv_result_t ExpectedResult(const CapTestParameter& p) { - const auto& caps = MustSucceed(p); - auto found = find(begin(caps), end(caps), Capability(p)); - return (found == end(caps)) ? SPV_ERROR_INVALID_CAPABILITY : SPV_SUCCESS; -} - -// Assembles using v1.0, unless the parameter's capability requires v1.1. -using ValidateCapability = spvtest::ValidateBase; - -// Always assembles using v1.1. -using ValidateCapabilityV11 = spvtest::ValidateBase; - -// Always assembles using Vulkan 1.0. -// TODO(dneto): Refactor all these tests to scale better across environments. -using ValidateCapabilityVulkan10 = spvtest::ValidateBase; -// Always assembles using OpenGL 4.0. -using ValidateCapabilityOpenGL40 = spvtest::ValidateBase; - -TEST_F(ValidateCapability, Default) { - const char str[] = R"( - OpCapability Kernel - OpCapability Linkage - OpCapability Matrix - OpMemoryModel Logical OpenCL -%f32 = OpTypeFloat 32 -%vec3 = OpTypeVector %f32 3 -%mat33 = OpTypeMatrix %vec3 3 -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// clang-format off -const vector& AllCapabilities() { - static const auto r = new vector{ - "", - "Matrix", - "Shader", - "Geometry", - "Tessellation", - "Addresses", - "Linkage", - "Kernel", - "Vector16", - "Float16Buffer", - "Float16", - "Float64", - "Int64", - "Int64Atomics", - "ImageBasic", - "ImageReadWrite", - "ImageMipmap", - "Pipes", - "Groups", - "DeviceEnqueue", - "LiteralSampler", - "AtomicStorage", - "Int16", - "TessellationPointSize", - "GeometryPointSize", - "ImageGatherExtended", - "StorageImageMultisample", - "UniformBufferArrayDynamicIndexing", - "SampledImageArrayDynamicIndexing", - "StorageBufferArrayDynamicIndexing", - "StorageImageArrayDynamicIndexing", - "ClipDistance", - "CullDistance", - "ImageCubeArray", - "SampleRateShading", - "ImageRect", - "SampledRect", - "GenericPointer", - "Int8", - "InputAttachment", - "SparseResidency", - "MinLod", - "Sampled1D", - "Image1D", - "SampledCubeArray", - "SampledBuffer", - "ImageBuffer", - "ImageMSArray", - "StorageImageExtendedFormats", - "ImageQuery", - "DerivativeControl", - "InterpolationFunction", - "TransformFeedback", - "GeometryStreams", - "StorageImageReadWithoutFormat", - "StorageImageWriteWithoutFormat", - "MultiViewport", - "SubgroupDispatch", - "NamedBarrier", - "PipeStorage"}; - return *r; -} - -const vector& AllSpirV10Capabilities() { - static const auto r = new vector{ - "", - "Matrix", - "Shader", - "Geometry", - "Tessellation", - "Addresses", - "Linkage", - "Kernel", - "Vector16", - "Float16Buffer", - "Float16", - "Float64", - "Int64", - "Int64Atomics", - "ImageBasic", - "ImageReadWrite", - "ImageMipmap", - "Pipes", - "Groups", - "DeviceEnqueue", - "LiteralSampler", - "AtomicStorage", - "Int16", - "TessellationPointSize", - "GeometryPointSize", - "ImageGatherExtended", - "StorageImageMultisample", - "UniformBufferArrayDynamicIndexing", - "SampledImageArrayDynamicIndexing", - "StorageBufferArrayDynamicIndexing", - "StorageImageArrayDynamicIndexing", - "ClipDistance", - "CullDistance", - "ImageCubeArray", - "SampleRateShading", - "ImageRect", - "SampledRect", - "GenericPointer", - "Int8", - "InputAttachment", - "SparseResidency", - "MinLod", - "Sampled1D", - "Image1D", - "SampledCubeArray", - "SampledBuffer", - "ImageBuffer", - "ImageMSArray", - "StorageImageExtendedFormats", - "ImageQuery", - "DerivativeControl", - "InterpolationFunction", - "TransformFeedback", - "GeometryStreams", - "StorageImageReadWithoutFormat", - "StorageImageWriteWithoutFormat", - "MultiViewport"}; - return *r; -} - -const vector& AllVulkan10Capabilities() { - static const auto r = new vector{ - "", - "Matrix", - "Shader", - "InputAttachment", - "Sampled1D", - "Image1D", - "SampledBuffer", - "ImageBuffer", - "ImageQuery", - "DerivativeControl", - "Geometry", - "Tessellation", - "Float64", - "Int64", - "Int16", - "TessellationPointSize", - "GeometryPointSize", - "ImageGatherExtended", - "StorageImageMultisample", - "UniformBufferArrayDynamicIndexing", - "SampledImageArrayDynamicIndexing", - "StorageBufferArrayDynamicIndexing", - "StorageImageArrayDynamicIndexing", - "ClipDistance", - "CullDistance", - "ImageCubeArray", - "SampleRateShading", - "SparseResidency", - "MinLod", - "SampledCubeArray", - "ImageMSArray", - "StorageImageExtendedFormats", - "InterpolationFunction", - "StorageImageReadWithoutFormat", - "StorageImageWriteWithoutFormat", - "MultiViewport"}; - return *r; -} - -const vector& MatrixDependencies() { - static const auto r = new vector{ - "Matrix", - "Shader", - "Geometry", - "Tessellation", - "AtomicStorage", - "TessellationPointSize", - "GeometryPointSize", - "ImageGatherExtended", - "StorageImageMultisample", - "UniformBufferArrayDynamicIndexing", - "SampledImageArrayDynamicIndexing", - "StorageBufferArrayDynamicIndexing", - "StorageImageArrayDynamicIndexing", - "ClipDistance", - "CullDistance", - "ImageCubeArray", - "SampleRateShading", - "ImageRect", - "SampledRect", - "InputAttachment", - "SparseResidency", - "MinLod", - "SampledCubeArray", - "ImageMSArray", - "StorageImageExtendedFormats", - "ImageQuery", - "DerivativeControl", - "InterpolationFunction", - "TransformFeedback", - "GeometryStreams", - "StorageImageReadWithoutFormat", - "StorageImageWriteWithoutFormat", - "MultiViewport"}; - return *r; -} - -const vector& ShaderDependencies() { - static const auto r = new vector{ - "Shader", - "Geometry", - "Tessellation", - "AtomicStorage", - "TessellationPointSize", - "GeometryPointSize", - "ImageGatherExtended", - "StorageImageMultisample", - "UniformBufferArrayDynamicIndexing", - "SampledImageArrayDynamicIndexing", - "StorageBufferArrayDynamicIndexing", - "StorageImageArrayDynamicIndexing", - "ClipDistance", - "CullDistance", - "ImageCubeArray", - "SampleRateShading", - "ImageRect", - "SampledRect", - "InputAttachment", - "SparseResidency", - "MinLod", - "SampledCubeArray", - "ImageMSArray", - "StorageImageExtendedFormats", - "ImageQuery", - "DerivativeControl", - "InterpolationFunction", - "TransformFeedback", - "GeometryStreams", - "StorageImageReadWithoutFormat", - "StorageImageWriteWithoutFormat", - "MultiViewport"}; - return *r; -} - -const vector& TessellationDependencies() { - static const auto r = new vector{ - "Tessellation", - "TessellationPointSize"}; - return *r; -} - -const vector& GeometryDependencies() { - static const auto r = new vector{ - "Geometry", - "GeometryPointSize", - "GeometryStreams", - "MultiViewport"}; - return *r; -} - -const vector& GeometryTessellationDependencies() { - static const auto r = new vector{ - "Tessellation", - "TessellationPointSize", - "Geometry", - "GeometryPointSize", - "GeometryStreams", - "MultiViewport"}; - return *r; -} - -// Returns the names of capabilities that directly depend on Kernel, -// plus itself. -const vector& KernelDependencies() { - static const auto r = new vector{ - "Kernel", - "Vector16", - "Float16Buffer", - "ImageBasic", - "ImageReadWrite", - "ImageMipmap", - "Pipes", - "DeviceEnqueue", - "LiteralSampler", - "Int8", - "SubgroupDispatch", - "NamedBarrier", - "PipeStorage"}; - return *r; -} - -const vector& AddressesDependencies() { - static const auto r = new vector{ - "Addresses", - "GenericPointer"}; - return *r; -} - -const vector& Sampled1DDependencies() { - static const auto r = new vector{ - "Sampled1D", - "Image1D"}; - return *r; -} - -const vector& SampledRectDependencies() { - static const auto r = new vector{ - "SampledRect", - "ImageRect"}; - return *r; -} - -const vector& SampledBufferDependencies() { - static const auto r = new vector{ - "SampledBuffer", - "ImageBuffer"}; - return *r; -} - -const char kOpenCLMemoryModel[] = \ - " OpCapability Kernel" - " OpMemoryModel Logical OpenCL "; - -const char kGLSL450MemoryModel[] = \ - " OpCapability Shader" - " OpMemoryModel Logical GLSL450 "; - -const char kVoidFVoid[] = \ - " %void = OpTypeVoid" - " %void_f = OpTypeFunction %void" - " %func = OpFunction %void None %void_f" - " %label = OpLabel" - " OpReturn" - " OpFunctionEnd "; - -const char kVoidFVoid2[] = \ - " %void_f = OpTypeFunction %voidt" - " %func = OpFunction %voidt None %void_f" - " %label = OpLabel" - " OpReturn" - " OpFunctionEnd "; - -INSTANTIATE_TEST_CASE_P(ExecutionModel, ValidateCapability, - Combine( - ValuesIn(AllCapabilities()), - Values( -make_pair(string(kOpenCLMemoryModel) + - " OpEntryPoint Vertex %func \"shader\"" + - string(kVoidFVoid), ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - " OpEntryPoint TessellationControl %func \"shader\"" + - string(kVoidFVoid), TessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - " OpEntryPoint TessellationEvaluation %func \"shader\"" + - string(kVoidFVoid), TessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - " OpEntryPoint Geometry %func \"shader\"" + - string(kVoidFVoid), GeometryDependencies()), -make_pair(string(kOpenCLMemoryModel) + - " OpEntryPoint Fragment %func \"shader\"" + - string(kVoidFVoid), ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - " OpEntryPoint GLCompute %func \"shader\"" + - string(kVoidFVoid), ShaderDependencies()), -make_pair(string(kGLSL450MemoryModel) + - " OpEntryPoint Kernel %func \"shader\"" + - string(kVoidFVoid), KernelDependencies()) -)),); - -INSTANTIATE_TEST_CASE_P(AddressingAndMemoryModel, ValidateCapability, - Combine( - ValuesIn(AllCapabilities()), - Values( -make_pair(" OpCapability Shader" - " OpMemoryModel Logical Simple" - " OpEntryPoint Vertex %func \"shader\"" + - string(kVoidFVoid), AllCapabilities()), -make_pair(" OpCapability Shader" - " OpMemoryModel Logical GLSL450" - " OpEntryPoint Vertex %func \"shader\"" + - string(kVoidFVoid), AllCapabilities()), -make_pair(" OpCapability Kernel" - " OpMemoryModel Logical OpenCL" - " OpEntryPoint Kernel %func \"compute\"" + - string(kVoidFVoid), AllCapabilities()), -make_pair(" OpCapability Shader" - " OpMemoryModel Physical32 Simple" - " OpEntryPoint Vertex %func \"shader\"" + - string(kVoidFVoid), AddressesDependencies()), -make_pair(" OpCapability Shader" - " OpMemoryModel Physical32 GLSL450" - " OpEntryPoint Vertex %func \"shader\"" + - string(kVoidFVoid), AddressesDependencies()), -make_pair(" OpCapability Kernel" - " OpMemoryModel Physical32 OpenCL" - " OpEntryPoint Kernel %func \"compute\"" + - string(kVoidFVoid), AddressesDependencies()), -make_pair(" OpCapability Shader" - " OpMemoryModel Physical64 Simple" - " OpEntryPoint Vertex %func \"shader\"" + - string(kVoidFVoid), AddressesDependencies()), -make_pair(" OpCapability Shader" - " OpMemoryModel Physical64 GLSL450" - " OpEntryPoint Vertex %func \"shader\"" + - string(kVoidFVoid), AddressesDependencies()), -make_pair(" OpCapability Kernel" - " OpMemoryModel Physical64 OpenCL" - " OpEntryPoint Kernel %func \"compute\"" + - string(kVoidFVoid), AddressesDependencies()) -)),); - -INSTANTIATE_TEST_CASE_P(ExecutionMode, ValidateCapability, - Combine( - ValuesIn(AllCapabilities()), - Values( -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Geometry %func \"shader\" " - "OpExecutionMode %func Invocations 42" + - string(kVoidFVoid), GeometryDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint TessellationControl %func \"shader\" " - "OpExecutionMode %func SpacingEqual" + - string(kVoidFVoid), TessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint TessellationControl %func \"shader\" " - "OpExecutionMode %func SpacingFractionalEven" + - string(kVoidFVoid), TessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint TessellationControl %func \"shader\" " - "OpExecutionMode %func SpacingFractionalOdd" + - string(kVoidFVoid), TessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint TessellationControl %func \"shader\" " - "OpExecutionMode %func VertexOrderCw" + - string(kVoidFVoid), TessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint TessellationControl %func \"shader\" " - "OpExecutionMode %func VertexOrderCcw" + - string(kVoidFVoid), TessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Vertex %func \"shader\" " - "OpExecutionMode %func PixelCenterInteger" + - string(kVoidFVoid), ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Vertex %func \"shader\" " - "OpExecutionMode %func OriginUpperLeft" + - string(kVoidFVoid), ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Vertex %func \"shader\" " - "OpExecutionMode %func OriginLowerLeft" + - string(kVoidFVoid), ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Vertex %func \"shader\" " - "OpExecutionMode %func EarlyFragmentTests" + - string(kVoidFVoid), ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint TessellationControl %func \"shader\" " - "OpExecutionMode %func PointMode" + - string(kVoidFVoid), TessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Vertex %func \"shader\" " - "OpExecutionMode %func Xfb" + - string(kVoidFVoid), vector{"TransformFeedback"}), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Vertex %func \"shader\" " - "OpExecutionMode %func DepthReplacing" + - string(kVoidFVoid), ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Vertex %func \"shader\" " - "OpExecutionMode %func DepthGreater" + - string(kVoidFVoid), ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Vertex %func \"shader\" " - "OpExecutionMode %func DepthLess" + - string(kVoidFVoid), ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Vertex %func \"shader\" " - "OpExecutionMode %func DepthUnchanged" + - string(kVoidFVoid), ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"shader\" " - "OpExecutionMode %func LocalSize 42 42 42" + - string(kVoidFVoid), AllCapabilities()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Kernel %func \"shader\" " - "OpExecutionMode %func LocalSizeHint 42 42 42" + - string(kVoidFVoid), KernelDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Geometry %func \"shader\" " - "OpExecutionMode %func InputPoints" + - string(kVoidFVoid), GeometryDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Geometry %func \"shader\" " - "OpExecutionMode %func InputLines" + - string(kVoidFVoid), GeometryDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Geometry %func \"shader\" " - "OpExecutionMode %func InputLinesAdjacency" + - string(kVoidFVoid), GeometryDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Geometry %func \"shader\" " - "OpExecutionMode %func Triangles" + - string(kVoidFVoid), GeometryDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint TessellationControl %func \"shader\" " - "OpExecutionMode %func Triangles" + - string(kVoidFVoid), TessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Geometry %func \"shader\" " - "OpExecutionMode %func InputTrianglesAdjacency" + - string(kVoidFVoid), GeometryDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint TessellationControl %func \"shader\" " - "OpExecutionMode %func Quads" + - string(kVoidFVoid), TessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint TessellationControl %func \"shader\" " - "OpExecutionMode %func Isolines" + - string(kVoidFVoid), TessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Geometry %func \"shader\" " - "OpExecutionMode %func OutputVertices 42" + - string(kVoidFVoid), GeometryDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint TessellationControl %func \"shader\" " - "OpExecutionMode %func OutputVertices 42" + - string(kVoidFVoid), TessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Geometry %func \"shader\" " - "OpExecutionMode %func OutputPoints" + - string(kVoidFVoid), GeometryDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Geometry %func \"shader\" " - "OpExecutionMode %func OutputLineStrip" + - string(kVoidFVoid), GeometryDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Geometry %func \"shader\" " - "OpExecutionMode %func OutputTriangleStrip" + - string(kVoidFVoid), GeometryDependencies()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Kernel %func \"shader\" " - "OpExecutionMode %func VecTypeHint 2" + - string(kVoidFVoid), KernelDependencies()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Kernel %func \"shader\" " - "OpExecutionMode %func ContractionOff" + - string(kVoidFVoid), KernelDependencies()))),); - -// clang-format on - -INSTANTIATE_TEST_CASE_P( - ExecutionModeV11, ValidateCapabilityV11, - Combine(ValuesIn(AllCapabilities()), - Values(make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"shader\" " - "OpExecutionMode %func SubgroupSize 1" + - string(kVoidFVoid), - vector{"SubgroupDispatch"}), - make_pair( - string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"shader\" " - "OpExecutionMode %func SubgroupsPerWorkgroup 65535" + - string(kVoidFVoid), - vector{"SubgroupDispatch"}))), ); -// clang-format off - -INSTANTIATE_TEST_CASE_P(StorageClass, ValidateCapability, - Combine( - ValuesIn(AllCapabilities()), - Values( -make_pair(string(kGLSL450MemoryModel) + - " OpEntryPoint Vertex %func \"shader\"" + - " %intt = OpTypeInt 32 0\n" - " %ptrt = OpTypePointer UniformConstant %intt\n" - " %var = OpVariable %ptrt UniformConstant\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kOpenCLMemoryModel) + - " OpEntryPoint Kernel %func \"compute\"" + - " %intt = OpTypeInt 32 0\n" - " %ptrt = OpTypePointer Input %intt" - " %var = OpVariable %ptrt Input\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kOpenCLMemoryModel) + - " OpEntryPoint Vertex %func \"shader\"" + - " %intt = OpTypeInt 32 0\n" - " %ptrt = OpTypePointer Uniform %intt\n" - " %var = OpVariable %ptrt Uniform\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - " OpEntryPoint Vertex %func \"shader\"" + - " %intt = OpTypeInt 32 0\n" - " %ptrt = OpTypePointer Output %intt\n" - " %var = OpVariable %ptrt Output\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kGLSL450MemoryModel) + - " OpEntryPoint Vertex %func \"shader\"" + - " %intt = OpTypeInt 32 0\n" - " %ptrt = OpTypePointer Workgroup %intt\n" - " %var = OpVariable %ptrt Workgroup\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kGLSL450MemoryModel) + - " OpEntryPoint Vertex %func \"shader\"" + - " %intt = OpTypeInt 32 0\n" - " %ptrt = OpTypePointer CrossWorkgroup %intt\n" - " %var = OpVariable %ptrt CrossWorkgroup\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kOpenCLMemoryModel) + - " OpEntryPoint Kernel %func \"compute\"" + - " %intt = OpTypeInt 32 0\n" - " %ptrt = OpTypePointer Private %intt\n" - " %var = OpVariable %ptrt Private\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - " OpEntryPoint Kernel %func \"compute\"" + - " %intt = OpTypeInt 32 0\n" - " %ptrt = OpTypePointer PushConstant %intt\n" - " %var = OpVariable %ptrt PushConstant\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kGLSL450MemoryModel) + - " OpEntryPoint Vertex %func \"shader\"" + - " %intt = OpTypeInt 32 0\n" - " %ptrt = OpTypePointer AtomicCounter %intt\n" - " %var = OpVariable %ptrt AtomicCounter\n" + string(kVoidFVoid), - vector{"AtomicStorage"}), -make_pair(string(kGLSL450MemoryModel) + - " OpEntryPoint Vertex %func \"shader\"" + - " %intt = OpTypeInt 32 0\n" - " %ptrt = OpTypePointer Image %intt\n" - " %var = OpVariable %ptrt Image\n" + string(kVoidFVoid), - AllCapabilities()) -)),); - -INSTANTIATE_TEST_CASE_P(Dim, ValidateCapability, - Combine( - ValuesIn(AllCapabilities()), - Values( -make_pair(" OpCapability ImageBasic" + - string(kOpenCLMemoryModel) + - string(" OpEntryPoint Kernel %func \"compute\"") + - " %voidt = OpTypeVoid" - " %imgt = OpTypeImage %voidt 1D 0 0 0 0 Unknown" + string(kVoidFVoid2), - Sampled1DDependencies()), -make_pair(" OpCapability ImageBasic" + - string(kOpenCLMemoryModel) + - string(" OpEntryPoint Kernel %func \"compute\"") + - " %voidt = OpTypeVoid" - " %imgt = OpTypeImage %voidt 2D 0 0 0 0 Unknown" + string(kVoidFVoid2), - AllCapabilities()), -make_pair(" OpCapability ImageBasic" + - string(kOpenCLMemoryModel) + - string(" OpEntryPoint Kernel %func \"compute\"") + - " %voidt = OpTypeVoid" - " %imgt = OpTypeImage %voidt 3D 0 0 0 0 Unknown" + string(kVoidFVoid2), - AllCapabilities()), -make_pair(" OpCapability ImageBasic" + - string(kOpenCLMemoryModel) + - string(" OpEntryPoint Kernel %func \"compute\"") + - " %voidt = OpTypeVoid" - " %imgt = OpTypeImage %voidt Cube 0 0 0 0 Unknown" + string(kVoidFVoid2), - ShaderDependencies()), -make_pair(" OpCapability ImageBasic" + - string(kOpenCLMemoryModel) + - string(" OpEntryPoint Kernel %func \"compute\"") + - " %voidt = OpTypeVoid" - " %imgt = OpTypeImage %voidt Rect 0 0 0 0 Unknown" + string(kVoidFVoid2), - SampledRectDependencies()), -make_pair(" OpCapability ImageBasic" + - string(kOpenCLMemoryModel) + - string(" OpEntryPoint Kernel %func \"compute\"") + - " %voidt = OpTypeVoid" - " %imgt = OpTypeImage %voidt Buffer 0 0 0 0 Unknown" + string(kVoidFVoid2), - SampledBufferDependencies()), -make_pair(" OpCapability ImageBasic" + - string(kOpenCLMemoryModel) + - string(" OpEntryPoint Kernel %func \"compute\"") + - " %voidt = OpTypeVoid" - " %imgt = OpTypeImage %voidt SubpassData 0 0 0 2 Unknown" + string(kVoidFVoid2), - vector{"InputAttachment"}) -)),); - -// NOTE: All Sampler Address Modes require kernel capabilities but the -// OpConstantSampler requires LiteralSampler which depends on Kernel -INSTANTIATE_TEST_CASE_P(SamplerAddressingMode, ValidateCapability, - Combine( - ValuesIn(AllCapabilities()), - Values( -make_pair(string(kGLSL450MemoryModel) + - " OpEntryPoint Vertex %func \"shader\"" - " %samplert = OpTypeSampler" - " %sampler = OpConstantSampler %samplert None 1 Nearest" + - string(kVoidFVoid), - vector{"LiteralSampler"}), -make_pair(string(kGLSL450MemoryModel) + - " OpEntryPoint Vertex %func \"shader\"" - " %samplert = OpTypeSampler" - " %sampler = OpConstantSampler %samplert ClampToEdge 1 Nearest" + - string(kVoidFVoid), - vector{"LiteralSampler"}), -make_pair(string(kGLSL450MemoryModel) + - " OpEntryPoint Vertex %func \"shader\"" - " %samplert = OpTypeSampler" - " %sampler = OpConstantSampler %samplert Clamp 1 Nearest" + - string(kVoidFVoid), - vector{"LiteralSampler"}), -make_pair(string(kGLSL450MemoryModel) + - " OpEntryPoint Vertex %func \"shader\"" - " %samplert = OpTypeSampler" - " %sampler = OpConstantSampler %samplert Repeat 1 Nearest" + - string(kVoidFVoid), - vector{"LiteralSampler"}), -make_pair(string(kGLSL450MemoryModel) + - " OpEntryPoint Vertex %func \"shader\"" - " %samplert = OpTypeSampler" - " %sampler = OpConstantSampler %samplert RepeatMirrored 1 Nearest" + - string(kVoidFVoid), - vector{"LiteralSampler"}) -)),); - -//TODO(umar): Sampler Filter Mode -//TODO(umar): Image Format -//TODO(umar): Image Channel Order -//TODO(umar): Image Channel Data Type -//TODO(umar): Image Operands -//TODO(umar): FP Fast Math Mode -//TODO(umar): FP Rounding Mode -//TODO(umar): Linkage Type -//TODO(umar): Access Qualifier -//TODO(umar): Function Parameter Attribute - -INSTANTIATE_TEST_CASE_P(Decoration, ValidateCapability, - Combine( - ValuesIn(AllCapabilities()), - Values( -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt RelaxedPrecision\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt Block\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt BufferBlock\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt RowMajor\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - MatrixDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt ColMajor\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - MatrixDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt ArrayStride 1\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt MatrixStride 1\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - MatrixDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt GLSLShared\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt GLSLPacked\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" - "OpDecorate %intt CPacked\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - KernelDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt NoPerspective\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt Flat\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt Patch\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - TessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt Centroid\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt Sample\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - vector{"SampleRateShading"}), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt Invariant\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt Restrict\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt Aliased\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt Volatile\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" - "OpDecorate %intt Constant\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - KernelDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt Coherent\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt NonWritable\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt NonReadable\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt Uniform\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" - "OpDecorate %intt SaturatedConversion\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - KernelDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt Stream 0\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - vector{"GeometryStreams"}), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt Location 0\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt Component 0\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt Index 0\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt Binding 0\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt DescriptorSet 0\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt Offset 0\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt XfbBuffer 0\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - vector{"TransformFeedback"}), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt XfbStride 0\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - vector{"TransformFeedback"}), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" - "OpDecorate %intt FuncParamAttr Zext\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - KernelDependencies()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" - "OpDecorate %intt FPRoundingMode RTE\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - KernelDependencies()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" - "OpDecorate %intt FPFastMathMode Fast\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - KernelDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt LinkageAttributes \"other\" Import\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - vector{"Linkage"}), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt NoContraction\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %intt InputAttachmentIndex 0\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - vector{"InputAttachment"}), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" - "OpDecorate %intt Alignment 4\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - KernelDependencies()) -)),); - -// clang-format on -INSTANTIATE_TEST_CASE_P( - DecorationSpecId, ValidateCapability, - Combine(ValuesIn(AllSpirV10Capabilities()), - Values(make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" + - "OpDecorate %1 SpecId 1\n" - "%intt = OpTypeInt 32 0\n" - "%1 = OpSpecConstant %intt 0\n" + - string(kVoidFVoid), - ShaderDependencies()))), ); - -INSTANTIATE_TEST_CASE_P( - DecorationV11, ValidateCapabilityV11, - Combine(ValuesIn(AllCapabilities()), - Values(make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %p MaxByteOffset 0 " - "%i32 = OpTypeInt 32 0 " - "%pi32 = OpTypePointer Workgroup %i32 " - "%p = OpVariable %pi32 Workgroup " + - string(kVoidFVoid), - AddressesDependencies()), - // Trying to test OpDecorate here, but if this fails due to - // incorrect OpMemoryModel validation, that must also be - // fixed. - make_pair(string("OpMemoryModel Logical OpenCL " - "OpEntryPoint Kernel %func \"compute\" \n" - "OpDecorate %1 SpecId 1 " - "%intt = OpTypeInt 32 0 " - "%1 = OpSpecConstant %intt 0") + - string(kVoidFVoid), - KernelDependencies()), - make_pair(string("OpMemoryModel Logical Simple " - "OpEntryPoint Vertex %func \"shader\" \n" - "OpDecorate %1 SpecId 1 " - "%intt = OpTypeInt 32 0 " - "%1 = OpSpecConstant %intt 0") + - string(kVoidFVoid), - ShaderDependencies()))), ); -// clang-format off - -INSTANTIATE_TEST_CASE_P(BuiltIn, ValidateCapability, - Combine( - ValuesIn(AllCapabilities()), - Values( -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn Position\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -// Just mentioning PointSize, ClipDistance, or CullDistance as a BuiltIn does -// not trigger the requirement for the associated capability. -// See https://github.com/KhronosGroup/SPIRV-Tools/issues/365 -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn PointSize\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn ClipDistance\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn CullDistance\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn VertexId\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn InstanceId\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn PrimitiveId\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - GeometryTessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn InvocationId\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - GeometryTessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn Layer\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - GeometryDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn ViewportIndex\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - vector{"MultiViewport"}), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn TessLevelOuter\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - TessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn TessLevelInner\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - TessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn TessCoord\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - TessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn PatchVertices\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - TessellationDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn FragCoord\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn PointCoord\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn FrontFacing\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn SampleId\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - vector{"SampleRateShading"}), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn SamplePosition\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - vector{"SampleRateShading"}), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn SampleMask\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn FragDepth\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn HelperInvocation\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn VertexIndex\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn InstanceIndex\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn NumWorkgroups\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn WorkgroupSize\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn WorkgroupId\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn LocalInvocationId\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn GlobalInvocationId\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn LocalInvocationIndex\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllCapabilities()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" + - "OpDecorate %intt BuiltIn WorkDim\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - KernelDependencies()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" + - "OpDecorate %intt BuiltIn GlobalSize\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - KernelDependencies()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" + - "OpDecorate %intt BuiltIn EnqueuedWorkgroupSize\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - KernelDependencies()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" + - "OpDecorate %intt BuiltIn GlobalOffset\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - KernelDependencies()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" + - "OpDecorate %intt BuiltIn GlobalLinearId\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - KernelDependencies()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" + - "OpDecorate %intt BuiltIn SubgroupSize\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - KernelDependencies()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" + - "OpDecorate %intt BuiltIn SubgroupMaxSize\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - KernelDependencies()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" + - "OpDecorate %intt BuiltIn NumSubgroups\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - KernelDependencies()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" + - "OpDecorate %intt BuiltIn NumEnqueuedSubgroups\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - KernelDependencies()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" + - "OpDecorate %intt BuiltIn SubgroupId\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - KernelDependencies()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" + - "OpDecorate %intt BuiltIn SubgroupLocalInvocationId\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - KernelDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn VertexIndex\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()), -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "OpDecorate %intt BuiltIn InstanceIndex\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - ShaderDependencies()) -)),); - -// Ensure that mere mention of PointSize, ClipDistance, or CullDistance as -// BuiltIns does not trigger the requirement for the associated -// capability. -// See https://github.com/KhronosGroup/SPIRV-Tools/issues/365 -INSTANTIATE_TEST_CASE_P(BuiltIn, ValidateCapabilityVulkan10, - Combine( - // All capabilities to try. - ValuesIn(AllSpirV10Capabilities()), - Values( -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" + - "OpDecorate %intt BuiltIn PointSize\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - // Capabilities which should succeed. - AllVulkan10Capabilities()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" + - "OpDecorate %intt BuiltIn ClipDistance\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllVulkan10Capabilities()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" + - "OpDecorate %intt BuiltIn CullDistance\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllVulkan10Capabilities()) -)),); - -INSTANTIATE_TEST_CASE_P(BuiltIn, ValidateCapabilityOpenGL40, - Combine( - // OpenGL 4.0 is based on SPIR-V 1.0 - ValuesIn(AllSpirV10Capabilities()), - Values( -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" + - "OpDecorate %intt BuiltIn PointSize\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllSpirV10Capabilities()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" + - "OpDecorate %intt BuiltIn ClipDistance\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllSpirV10Capabilities()), -make_pair(string(kGLSL450MemoryModel) + - "OpEntryPoint Vertex %func \"shader\" \n" + - "OpDecorate %intt BuiltIn CullDistance\n" - "%intt = OpTypeInt 32 0\n" + string(kVoidFVoid), - AllSpirV10Capabilities()) -)),); - -// TODO(umar): Selection Control -// TODO(umar): Loop Control -// TODO(umar): Function Control -// TODO(umar): Memory Semantics -// TODO(umar): Memory Access -// TODO(umar): Scope -// TODO(umar): Group Operation -// TODO(umar): Kernel Enqueue Flags -// TODO(umar): Kernel Profiling Flags - -INSTANTIATE_TEST_CASE_P(MatrixOp, ValidateCapability, - Combine( - ValuesIn(AllCapabilities()), - Values( -make_pair(string(kOpenCLMemoryModel) + - "OpEntryPoint Kernel %func \"compute\" \n" + - "%f32 = OpTypeFloat 32\n" - "%vec3 = OpTypeVector %f32 3\n" - "%mat33 = OpTypeMatrix %vec3 3\n" + string(kVoidFVoid), - MatrixDependencies()))),); -// clang-format on - -// Creates assembly containing an OpImageFetch instruction using operands for -// the image-operands part. The assembly defines constants %fzero and %izero -// that can be used for operands where IDs are required. The assembly is valid, -// apart from not declaring any capabilities required by the operands. -string ImageOperandsTemplate(const string& operands) { - ostringstream ss; - // clang-format off - ss << R"( -OpCapability Kernel -OpCapability Linkage -OpMemoryModel Logical OpenCL - -%i32 = OpTypeInt 32 0 -%f32 = OpTypeFloat 32 -%v4i32 = OpTypeVector %i32 4 -%timg = OpTypeImage %i32 2D 0 0 0 0 Unknown -%pimg = OpTypePointer UniformConstant %timg -%tfun = OpTypeFunction %i32 - -%vimg = OpVariable %pimg UniformConstant -%izero = OpConstant %i32 0 -%fzero = OpConstant %f32 0. - -%main = OpFunction %i32 None %tfun -%lbl = OpLabel -%img = OpLoad %timg %vimg -%r1 = OpImageFetch %v4i32 %img %izero )" << operands << R"( -OpReturnValue %izero -OpFunctionEnd -)"; - // clang-format on - return ss.str(); -} - -INSTANTIATE_TEST_CASE_P( - TwoImageOperandsMask, ValidateCapability, - Combine( - ValuesIn(AllCapabilities()), - Values(make_pair(ImageOperandsTemplate("Bias|Lod %fzero %fzero"), - ShaderDependencies()), - make_pair(ImageOperandsTemplate("Lod|Offset %fzero %izero"), - vector{"ImageGatherExtended"}), - make_pair(ImageOperandsTemplate("Sample|MinLod %izero %fzero"), - vector{"MinLod"}), - make_pair(ImageOperandsTemplate("Lod|Sample %fzero %izero"), - AllCapabilities()))), ); - -// TODO(umar): Instruction capability checks - -// True if capability exists in env. -bool Exists(const std::string& capability, spv_target_env env) { - spv_operand_desc dummy; - return SPV_SUCCESS == - libspirv::AssemblyGrammar(ScopedContext(env).context) - .lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, capability.c_str(), - capability.size(), &dummy); -} - -TEST_P(ValidateCapability, Capability) { - const string capability = Capability(GetParam()); - spv_target_env env = - (capability.empty() || Exists(capability, SPV_ENV_UNIVERSAL_1_0)) - ? SPV_ENV_UNIVERSAL_1_0 - : SPV_ENV_UNIVERSAL_1_1; - const string test_code = MakeAssembly(GetParam()); - CompileSuccessfully(test_code, env); - ASSERT_EQ(ExpectedResult(GetParam()), ValidateInstructions(env)) << test_code; -} - -TEST_P(ValidateCapabilityV11, Capability) { - const string test_code = MakeAssembly(GetParam()); - CompileSuccessfully(test_code, SPV_ENV_UNIVERSAL_1_1); - ASSERT_EQ(ExpectedResult(GetParam()), - ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)) - << test_code; -} - -TEST_P(ValidateCapabilityVulkan10, Capability) { - const string test_code = MakeAssembly(GetParam()); - CompileSuccessfully(test_code, SPV_ENV_VULKAN_1_0); - ASSERT_EQ(ExpectedResult(GetParam()), - ValidateInstructions(SPV_ENV_VULKAN_1_0)) - << test_code; -} - -TEST_P(ValidateCapabilityOpenGL40, Capability) { - const string test_code = MakeAssembly(GetParam()); - CompileSuccessfully(test_code, SPV_ENV_OPENGL_4_0); - ASSERT_EQ(ExpectedResult(GetParam()), - ValidateInstructions(SPV_ENV_OPENGL_4_0)) - << test_code; -} - -TEST_F(ValidateCapability, SemanticsIdIsAnIdNotALiteral) { - // From https://github.com/KhronosGroup/SPIRV-Tools/issues/248 - // The validator was interpreting the memory semantics ID number - // as the value to be checked rather than an ID that references - // another value to be checked. - // In this case a raw ID of 64 was mistaken to mean a literal - // semantic value of UniformMemory, which would require the Shader - // capability. - const char str[] = R"( -OpCapability Kernel -OpCapability Linkage -OpMemoryModel Logical OpenCL - -; %i32 has ID 1 -%i32 = OpTypeInt 32 0 -%tf = OpTypeFunction %i32 -%pi32 = OpTypePointer CrossWorkgroup %i32 -%var = OpVariable %pi32 CrossWorkgroup -%c = OpConstant %i32 100 -%scope = OpConstant %i32 1 ; Device scope - -; Fake an instruction with 64 as the result id. -; !64 = OpConstantNull %i32 -!0x3002e !1 !64 - -%f = OpFunction %i32 None %tf -%l = OpLabel -%result = OpAtomicIAdd %i32 %var %scope !64 %c -OpReturnValue %result -OpFunctionEnd -)"; - - CompileSuccessfully(str); - - // Since we are forcing usage of 64, the "id bound" in the binary header - // must be overwritten so that 64 is considered within bound. - // ID Bound is at index 3 of the binary. Set it to 65. - OverwriteAssembledBinary(3, 65); - - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateCapability, IntSignednessKernelGood) { - const std::string spirv = R"( -OpCapability Kernel -OpCapability Linkage -OpMemoryModel Logical OpenCL -%i32 = OpTypeInt 32 0 -)"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateCapability, IntSignednessKernelBad) { - const std::string spirv = R"( -OpCapability Kernel -OpCapability Linkage -OpMemoryModel Logical OpenCL -%i32 = OpTypeInt 32 1 -)"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("The Signedness in OpTypeInt must always be 0 when " - "Kernel capability is used.")); -} - -TEST_F(ValidateCapability, IntSignednessShaderGood) { - const std::string spirv = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -%u32 = OpTypeInt 32 0 -%i32 = OpTypeInt 32 1 -)"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateCapability, NonVulkan10Capability) { - const std::string spirv = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -%u32 = OpTypeInt 32 0 -%i32 = OpTypeInt 32 1 -)"; - CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0); - EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, - ValidateInstructions(SPV_ENV_VULKAN_1_0)); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Capability value 5 is not allowed by Vulkan 1.0")); -} - -TEST_F(ValidateCapability, Vulkan10EnabledByExtension) { - const std::string spirv = R"( -OpCapability Shader -OpCapability DrawParameters -OpExtension "SPV_KHR_shader_draw_parameters" -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %func "shader" -OpDecorate %intt BuiltIn PointSize -%intt = OpTypeInt 32 0 -)" + string(kVoidFVoid); - - CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0)); -} - -TEST_F(ValidateCapability, Vulkan10NotEnabledByExtension) { - const std::string spirv = R"( -OpCapability Shader -OpCapability DrawParameters -OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %func "shader" -OpDecorate %intt BuiltIn PointSize -%intt = OpTypeInt 32 0 -)" + string(kVoidFVoid); - - CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0); - EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY, - ValidateInstructions(SPV_ENV_VULKAN_1_0)); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Capability value 4427 is not allowed by Vulkan 1.0")); -} - -} // namespace anonymous diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_cfg_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_cfg_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_cfg_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_cfg_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1402 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Validation tests for Control Flow Graph - -#include -#include -#include -#include -#include -#include -#include - -#include "gmock/gmock.h" - -#include "source/diagnostic.h" -#include "source/validate.h" -#include "test_fixture.h" -#include "unit_spirv.h" -#include "val_fixtures.h" - -using std::array; -using std::make_pair; -using std::pair; -using std::string; -using std::stringstream; -using std::vector; - -using ::testing::HasSubstr; -using ::testing::MatchesRegex; - -using libspirv::BasicBlock; -using libspirv::ValidationState_t; - -using ValidateCFG = spvtest::ValidateBase; -using spvtest::ScopedContext; - -namespace { - -string nameOps() { return ""; } - -template -string nameOps(pair head, Args... names) { - return "OpName %" + head.first + " \"" + head.second + "\"\n" + - nameOps(names...); -} - -template -string nameOps(string head, Args... names) { - return "OpName %" + head + " \"" + head + "\"\n" + nameOps(names...); -} - -/// This class allows the easy creation of complex control flow without writing -/// SPIR-V. This class is used in the test cases below. -class Block { - string label_; - string body_; - SpvOp type_; - vector successors_; - - public: - /// Creates a Block with a given label - /// - /// @param[in]: label the label id of the block - /// @param[in]: type the branch instruciton that ends the block - explicit Block(string label, SpvOp type = SpvOpBranch) - : label_(label), body_(), type_(type), successors_() {} - - /// Sets the instructions which will appear in the body of the block - Block& SetBody(std::string body) { - body_ = body; - return *this; - } - - Block& AppendBody(std::string body) { - body_ += body; - return *this; - } - - /// Converts the block into a SPIR-V string - operator string() { - stringstream out; - out << std::setw(8) << "%" + label_ + " = OpLabel \n"; - if (!body_.empty()) { - out << body_; - } - - switch (type_) { - case SpvOpBranchConditional: - out << "OpBranchConditional %cond "; - for (Block& b : successors_) { - out << "%" + b.label_ + " "; - } - break; - case SpvOpSwitch: { - out << "OpSwitch %one %" + successors_.front().label_; - stringstream ss; - for (size_t i = 1; i < successors_.size(); i++) { - ss << " " << i << " %" << successors_[i].label_; - } - out << ss.str(); - } break; - case SpvOpReturn: - assert(successors_.size() == 0); - out << "OpReturn\n"; - break; - case SpvOpUnreachable: - assert(successors_.size() == 0); - out << "OpUnreachable\n"; - break; - case SpvOpBranch: - assert(successors_.size() == 1); - out << "OpBranch %" + successors_.front().label_; - break; - default: - assert(1 == 0 && "Unhandled"); - } - out << "\n"; - - return out.str(); - } - friend Block& operator>>(Block& curr, vector successors); - friend Block& operator>>(Block& lhs, Block& successor); -}; - -/// Assigns the successors for the Block on the lhs -Block& operator>>(Block& lhs, vector successors) { - if (lhs.type_ == SpvOpBranchConditional) { - assert(successors.size() == 2); - } else if (lhs.type_ == SpvOpSwitch) { - assert(successors.size() > 1); - } - lhs.successors_ = successors; - return lhs; -} - -/// Assigns the successor for the Block on the lhs -Block& operator>>(Block& lhs, Block& successor) { - assert(lhs.type_ == SpvOpBranch); - lhs.successors_.push_back(successor); - return lhs; -} - -const char* header(SpvCapability cap) { - static const char* shader_header = - "OpCapability Shader\n" - "OpCapability Linkage\n" - "OpMemoryModel Logical GLSL450\n"; - - static const char* kernel_header = - "OpCapability Kernel\n" - "OpCapability Linkage\n" - "OpMemoryModel Logical OpenCL\n"; - - return (cap == SpvCapabilityShader) ? shader_header : kernel_header; -} - -const char* types_consts() { - static const char* types = - "%voidt = OpTypeVoid\n" - "%boolt = OpTypeBool\n" - "%intt = OpTypeInt 32 0\n" - "%one = OpConstant %intt 1\n" - "%two = OpConstant %intt 2\n" - "%ptrt = OpTypePointer Function %intt\n" - "%funct = OpTypeFunction %voidt\n"; - - return types; -} - -INSTANTIATE_TEST_CASE_P(StructuredControlFlow, ValidateCFG, - ::testing::Values(SpvCapabilityShader, - SpvCapabilityKernel)); - -TEST_P(ValidateCFG, LoopReachableFromEntryButNeverLeadingToReturn) { - // In this case, the loop is reachable from a node without a predecessor, - // but never reaches a node with a return. - // - // This motivates the need for the pseudo-exit node to have a node - // from a cycle in its predecessors list. Otherwise the validator's - // post-dominance calculation will go into an infinite loop. - // - // For more motivation, see - // https://github.com/KhronosGroup/SPIRV-Tools/issues/279 - string str = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - - OpName %entry "entry" - OpName %loop "loop" - OpName %exit "exit" - -%voidt = OpTypeVoid -%funct = OpTypeFunction %voidt - -%main = OpFunction %voidt None %funct -%entry = OpLabel - OpBranch %loop -%loop = OpLabel - OpLoopMerge %exit %loop None - OpBranch %loop -%exit = OpLabel - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()) << str; -} - -TEST_P(ValidateCFG, LoopUnreachableFromEntryButLeadingToReturn) { - // In this case, the loop is not reachable from a node without a - // predecessor, but eventually reaches a node with a return. - // - // This motivates the need for the pseudo-entry node to have a node - // from a cycle in its successors list. Otherwise the validator's - // dominance calculation will go into an infinite loop. - // - // For more motivation, see - // https://github.com/KhronosGroup/SPIRV-Tools/issues/279 - // Before that fix, we'd have an infinite loop when calculating - // post-dominators. - string str = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - - OpName %entry "entry" - OpName %loop "loop" - OpName %cont "cont" - OpName %exit "exit" - -%voidt = OpTypeVoid -%funct = OpTypeFunction %voidt -%boolt = OpTypeBool -%false = OpConstantFalse %boolt - -%main = OpFunction %voidt None %funct -%entry = OpLabel - OpReturn - -%loop = OpLabel - OpLoopMerge %exit %cont None - OpBranch %cont - -%cont = OpLabel - OpBranchConditional %false %loop %exit - -%exit = OpLabel - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()) << str - << getDiagnosticString(); -} - -TEST_P(ValidateCFG, Simple) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block loop("loop", SpvOpBranchConditional); - Block cont("cont"); - Block merge("merge", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) { - loop.SetBody("OpLoopMerge %merge %cont None\n"); - } - - string str = header(GetParam()) + nameOps("loop", "entry", "cont", "merge", - make_pair("func", "Main")) + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> loop; - str += loop >> vector({cont, merge}); - str += cont >> loop; - str += merge; - str += "OpFunctionEnd\n"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateCFG, Variable) { - Block entry("entry"); - Block cont("cont"); - Block exit("exit", SpvOpReturn); - - entry.SetBody("%var = OpVariable %ptrt Function\n"); - - string str = header(GetParam()) + nameOps(make_pair("func", "Main")) + - types_consts() + " %func = OpFunction %voidt None %funct\n"; - str += entry >> cont; - str += cont >> exit; - str += exit; - str += "OpFunctionEnd\n"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateCFG, VariableNotInFirstBlockBad) { - Block entry("entry"); - Block cont("cont"); - Block exit("exit", SpvOpReturn); - - // This operation should only be performed in the entry block - cont.SetBody("%var = OpVariable %ptrt Function\n"); - - string str = header(GetParam()) + nameOps(make_pair("func", "Main")) + - types_consts() + " %func = OpFunction %voidt None %funct\n"; - - str += entry >> cont; - str += cont >> exit; - str += exit; - str += "OpFunctionEnd\n"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "Variables can only be defined in the first block of a function")); -} - -TEST_P(ValidateCFG, BlockSelfLoopIsOk) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block loop("loop", SpvOpBranchConditional); - Block merge("merge", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) loop.SetBody("OpLoopMerge %merge %loop None\n"); - - string str = header(GetParam()) + - nameOps("loop", "merge", make_pair("func", "Main")) + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> loop; - // loop branches to itself, but does not trigger an error. - str += loop >> vector({merge, loop}); - str += merge; - str += "OpFunctionEnd\n"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); -} - -TEST_P(ValidateCFG, BlockAppearsBeforeDominatorBad) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block cont("cont"); - Block branch("branch", SpvOpBranchConditional); - Block merge("merge", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) branch.SetBody("OpSelectionMerge %merge None\n"); - - string str = header(GetParam()) + - nameOps("cont", "branch", make_pair("func", "Main")) + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> branch; - str += cont >> merge; // cont appears before its dominator - str += branch >> vector({cont, merge}); - str += merge; - str += "OpFunctionEnd\n"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - MatchesRegex("Block .\\[cont\\] appears in the binary " - "before its dominator .\\[branch\\]")); -} - -TEST_P(ValidateCFG, MergeBlockTargetedByMultipleHeaderBlocksBad) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block loop("loop"); - Block selection("selection", SpvOpBranchConditional); - Block merge("merge", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) loop.SetBody(" OpLoopMerge %merge %loop None\n"); - - // cannot share the same merge - if (is_shader) selection.SetBody("OpSelectionMerge %merge None\n"); - - string str = header(GetParam()) + - nameOps("merge", make_pair("func", "Main")) + types_consts() + - "%func = OpFunction %voidt None %funct\n"; - - str += entry >> loop; - str += loop >> selection; - str += selection >> vector({loop, merge}); - str += merge; - str += "OpFunctionEnd\n"; - - CompileSuccessfully(str); - if (is_shader) { - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - MatchesRegex("Block .\\[merge\\] is already a merge block " - "for another header")); - } else { - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); - } -} - -TEST_P(ValidateCFG, MergeBlockTargetedByMultipleHeaderBlocksSelectionBad) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block loop("loop", SpvOpBranchConditional); - Block selection("selection", SpvOpBranchConditional); - Block merge("merge", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) selection.SetBody(" OpSelectionMerge %merge None\n"); - - // cannot share the same merge - if (is_shader) loop.SetBody(" OpLoopMerge %merge %loop None\n"); - - string str = header(GetParam()) + - nameOps("merge", make_pair("func", "Main")) + types_consts() + - "%func = OpFunction %voidt None %funct\n"; - - str += entry >> selection; - str += selection >> vector({merge, loop}); - str += loop >> vector({loop, merge}); - str += merge; - str += "OpFunctionEnd\n"; - - CompileSuccessfully(str); - if (is_shader) { - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - MatchesRegex("Block .\\[merge\\] is already a merge block " - "for another header")); - } else { - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); - } -} - -TEST_P(ValidateCFG, BranchTargetFirstBlockBad) { - Block entry("entry"); - Block bad("bad"); - Block end("end", SpvOpReturn); - string str = header(GetParam()) + - nameOps("entry", "bad", make_pair("func", "Main")) + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> bad; - str += bad >> entry; // Cannot target entry block - str += end; - str += "OpFunctionEnd\n"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - MatchesRegex("First block .\\[entry\\] of function .\\[Main\\] " - "is targeted by block .\\[bad\\]")); -} - -TEST_P(ValidateCFG, BranchConditionalTrueTargetFirstBlockBad) { - Block entry("entry"); - Block bad("bad", SpvOpBranchConditional); - Block exit("exit", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - bad.SetBody(" OpLoopMerge %entry %exit None\n"); - - string str = header(GetParam()) + - nameOps("entry", "bad", make_pair("func", "Main")) + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> bad; - str += bad >> vector({entry, exit}); // cannot target entry block - str += exit; - str += "OpFunctionEnd\n"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - MatchesRegex("First block .\\[entry\\] of function .\\[Main\\] " - "is targeted by block .\\[bad\\]")); -} - -TEST_P(ValidateCFG, BranchConditionalFalseTargetFirstBlockBad) { - Block entry("entry"); - Block bad("bad", SpvOpBranchConditional); - Block t("t"); - Block merge("merge"); - Block end("end", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - bad.SetBody("OpLoopMerge %merge %cont None\n"); - - string str = header(GetParam()) + - nameOps("entry", "bad", make_pair("func", "Main")) + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> bad; - str += bad >> vector({t, entry}); - str += merge >> end; - str += end; - str += "OpFunctionEnd\n"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - MatchesRegex("First block .\\[entry\\] of function .\\[Main\\] " - "is targeted by block .\\[bad\\]")); -} - -TEST_P(ValidateCFG, SwitchTargetFirstBlockBad) { - Block entry("entry"); - Block bad("bad", SpvOpSwitch); - Block block1("block1"); - Block block2("block2"); - Block block3("block3"); - Block def("def"); // default block - Block merge("merge"); - Block end("end", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - bad.SetBody("OpSelectionMerge %merge None\n"); - - string str = header(GetParam()) + - nameOps("entry", "bad", make_pair("func", "Main")) + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> bad; - str += bad >> vector({def, block1, block2, block3, entry}); - str += def >> merge; - str += block1 >> merge; - str += block2 >> merge; - str += block3 >> merge; - str += merge >> end; - str += end; - str += "OpFunctionEnd\n"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - MatchesRegex("First block .\\[entry\\] of function .\\[Main\\] " - "is targeted by block .\\[bad\\]")); -} - -TEST_P(ValidateCFG, BranchToBlockInOtherFunctionBad) { - Block entry("entry"); - Block middle("middle", SpvOpBranchConditional); - Block end("end", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - middle.SetBody("OpSelectionMerge %end None\n"); - - Block entry2("entry2"); - Block middle2("middle2"); - Block end2("end2", SpvOpReturn); - - string str = header(GetParam()) + - nameOps("middle2", make_pair("func", "Main")) + types_consts() + - "%func = OpFunction %voidt None %funct\n"; - - str += entry >> middle; - str += middle >> vector({end, middle2}); - str += end; - str += "OpFunctionEnd\n"; - - str += "%func2 = OpFunction %voidt None %funct\n"; - str += entry2 >> middle2; - str += middle2 >> end2; - str += end2; - str += "OpFunctionEnd\n"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - MatchesRegex("Block\\(s\\) \\{.\\[middle2\\] .\\} are referenced but not " - "defined in function .\\[Main\\]")); -} - -TEST_P(ValidateCFG, HeaderDoesntDominatesMergeBad) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block head("head", SpvOpBranchConditional); - Block f("f"); - Block merge("merge", SpvOpReturn); - - head.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - - if (is_shader) head.AppendBody("OpSelectionMerge %merge None\n"); - - string str = header(GetParam()) + - nameOps("head", "merge", make_pair("func", "Main")) + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> merge; - str += head >> vector({merge, f}); - str += f >> merge; - str += merge; - str += "OpFunctionEnd\n"; - - CompileSuccessfully(str); - if (is_shader) { - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - MatchesRegex("The selection construct with the selection header " - ".\\[head\\] does not dominate the merge block " - ".\\[merge\\]")); - } else { - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); - } -} - -TEST_P(ValidateCFG, HeaderDoesntStrictlyDominateMergeBad) { - // If a merge block is reachable, then it must be strictly dominated by - // its header block. - bool is_shader = GetParam() == SpvCapabilityShader; - Block head("head", SpvOpBranchConditional); - Block exit("exit", SpvOpReturn); - - head.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - - if (is_shader) head.AppendBody("OpSelectionMerge %head None\n"); - - string str = header(GetParam()) + - nameOps("head", "exit", make_pair("func", "Main")) + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += head >> vector({exit, exit}); - str += exit; - str += "OpFunctionEnd\n"; - - CompileSuccessfully(str); - if (is_shader) { - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - MatchesRegex("The selection construct with the selection header " - ".\\[head\\] does not strictly dominate the merge block " - ".\\[head\\]")); - } else { - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()) << str; - } -} - -TEST_P(ValidateCFG, UnreachableMerge) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block branch("branch", SpvOpBranchConditional); - Block t("t", SpvOpReturn); - Block f("f", SpvOpReturn); - Block merge("merge", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) branch.AppendBody("OpSelectionMerge %merge None\n"); - - string str = header(GetParam()) + - nameOps("branch", "merge", make_pair("func", "Main")) + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> branch; - str += branch >> vector({t, f}); - str += t; - str += f; - str += merge; - str += "OpFunctionEnd\n"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateCFG, UnreachableMergeDefinedByOpUnreachable) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block branch("branch", SpvOpBranchConditional); - Block t("t", SpvOpReturn); - Block f("f", SpvOpReturn); - Block merge("merge", SpvOpUnreachable); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) branch.AppendBody("OpSelectionMerge %merge None\n"); - - string str = header(GetParam()) + - nameOps("branch", "merge", make_pair("func", "Main")) + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> branch; - str += branch >> vector({t, f}); - str += t; - str += f; - str += merge; - str += "OpFunctionEnd\n"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateCFG, UnreachableBlock) { - Block entry("entry"); - Block unreachable("unreachable"); - Block exit("exit", SpvOpReturn); - - string str = header(GetParam()) + - nameOps("unreachable", "exit", make_pair("func", "Main")) + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> exit; - str += unreachable >> exit; - str += exit; - str += "OpFunctionEnd\n"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateCFG, UnreachableBranch) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block unreachable("unreachable", SpvOpBranchConditional); - Block unreachablechildt("unreachablechildt"); - Block unreachablechildf("unreachablechildf"); - Block merge("merge"); - Block exit("exit", SpvOpReturn); - - unreachable.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) unreachable.AppendBody("OpSelectionMerge %merge None\n"); - string str = header(GetParam()) + - nameOps("unreachable", "exit", make_pair("func", "Main")) + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> exit; - str += unreachable >> vector({unreachablechildt, unreachablechildf}); - str += unreachablechildt >> merge; - str += unreachablechildf >> merge; - str += merge >> exit; - str += exit; - str += "OpFunctionEnd\n"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateCFG, EmptyFunction) { - string str = header(GetParam()) + string(types_consts()) + - R"(%func = OpFunction %voidt None %funct - %l = OpLabel - OpReturn - OpFunctionEnd)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateCFG, SingleBlockLoop) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block loop("loop", SpvOpBranchConditional); - Block exit("exit", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) loop.AppendBody("OpLoopMerge %exit %loop None\n"); - - string str = header(GetParam()) + string(types_consts()) + - "%func = OpFunction %voidt None %funct\n"; - - str += entry >> loop; - str += loop >> vector({loop, exit}); - str += exit; - str += "OpFunctionEnd"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateCFG, NestedLoops) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block loop1("loop1"); - Block loop1_cont_break_block("loop1_cont_break_block", - SpvOpBranchConditional); - Block loop2("loop2", SpvOpBranchConditional); - Block loop2_merge("loop2_merge"); - Block loop1_merge("loop1_merge"); - Block exit("exit", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) { - loop1.SetBody("OpLoopMerge %loop1_merge %loop2 None\n"); - loop2.SetBody("OpLoopMerge %loop2_merge %loop2 None\n"); - } - - string str = header(GetParam()) + nameOps("loop2", "loop2_merge") + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> loop1; - str += loop1 >> loop1_cont_break_block; - str += loop1_cont_break_block >> vector({loop1_merge, loop2}); - str += loop2 >> vector({loop2, loop2_merge}); - str += loop2_merge >> loop1; - str += loop1_merge >> exit; - str += exit; - str += "OpFunctionEnd"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateCFG, NestedSelection) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - const int N = 256; - vector if_blocks; - vector merge_blocks; - Block inner("inner"); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - - if_blocks.emplace_back("if0", SpvOpBranchConditional); - - if (is_shader) if_blocks[0].SetBody("OpSelectionMerge %if_merge0 None\n"); - merge_blocks.emplace_back("if_merge0", SpvOpReturn); - - for (int i = 1; i < N; i++) { - stringstream ss; - ss << i; - if_blocks.emplace_back("if" + ss.str(), SpvOpBranchConditional); - if (is_shader) - if_blocks[i].SetBody("OpSelectionMerge %if_merge" + ss.str() + " None\n"); - merge_blocks.emplace_back("if_merge" + ss.str(), SpvOpBranch); - } - string str = header(GetParam()) + string(types_consts()) + - "%func = OpFunction %voidt None %funct\n"; - - str += entry >> if_blocks[0]; - for (int i = 0; i < N - 1; i++) { - str += if_blocks[i] >> vector({if_blocks[i + 1], merge_blocks[i]}); - } - str += if_blocks.back() >> vector({inner, merge_blocks.back()}); - str += inner >> merge_blocks.back(); - for (int i = N - 1; i > 0; i--) { - str += merge_blocks[i] >> merge_blocks[i - 1]; - } - str += merge_blocks[0]; - str += "OpFunctionEnd"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateCFG, BackEdgeBlockDoesntPostDominateContinueTargetBad) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block loop1("loop1", SpvOpBranchConditional); - Block loop2("loop2", SpvOpBranchConditional); - Block loop2_merge("loop2_merge", SpvOpBranchConditional); - Block be_block("be_block"); - Block exit("exit", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) { - loop1.SetBody("OpLoopMerge %exit %loop2_merge None\n"); - loop2.SetBody("OpLoopMerge %loop2_merge %loop2 None\n"); - } - - string str = header(GetParam()) + - nameOps("loop1", "loop2", "be_block", "loop2_merge") + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> loop1; - str += loop1 >> vector({loop2, exit}); - str += loop2 >> vector({loop2, loop2_merge}); - str += loop2_merge >> vector({be_block, exit}); - str += be_block >> loop1; - str += exit; - str += "OpFunctionEnd"; - - CompileSuccessfully(str); - if (GetParam() == SpvCapabilityShader) { - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - MatchesRegex("The continue construct with the continue target " - ".\\[loop2_merge\\] is not post dominated by the " - "back-edge block .\\[be_block\\]")); - } else { - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); - } -} - -TEST_P(ValidateCFG, BranchingToNonLoopHeaderBlockBad) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block split("split", SpvOpBranchConditional); - Block t("t"); - Block f("f"); - Block exit("exit", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) split.SetBody("OpSelectionMerge %exit None\n"); - - string str = header(GetParam()) + nameOps("split", "f") + types_consts() + - "%func = OpFunction %voidt None %funct\n"; - - str += entry >> split; - str += split >> vector({t, f}); - str += t >> exit; - str += f >> split; - str += exit; - str += "OpFunctionEnd"; - - CompileSuccessfully(str); - if (is_shader) { - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - MatchesRegex("Back-edges \\(.\\[f\\] -> .\\[split\\]\\) can only " - "be formed between a block and a loop header.")); - } else { - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); - } -} - -TEST_P(ValidateCFG, BranchingToSameNonLoopHeaderBlockBad) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block split("split", SpvOpBranchConditional); - Block exit("exit", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) split.SetBody("OpSelectionMerge %exit None\n"); - - string str = header(GetParam()) + nameOps("split") + types_consts() + - "%func = OpFunction %voidt None %funct\n"; - - str += entry >> split; - str += split >> vector({split, exit}); - str += exit; - str += "OpFunctionEnd"; - - CompileSuccessfully(str); - if (is_shader) { - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - MatchesRegex( - "Back-edges \\(.\\[split\\] -> .\\[split\\]\\) can only be " - "formed between a block and a loop header.")); - } else { - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); - } -} - -TEST_P(ValidateCFG, MultipleBackEdgeBlocksToLoopHeaderBad) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block loop("loop", SpvOpBranchConditional); - Block back0("back0"); - Block back1("back1"); - Block merge("merge", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) loop.SetBody("OpLoopMerge %merge %back0 None\n"); - - string str = header(GetParam()) + nameOps("loop", "back0", "back1") + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> loop; - str += loop >> vector({back0, back1}); - str += back0 >> loop; - str += back1 >> loop; - str += merge; - str += "OpFunctionEnd"; - - CompileSuccessfully(str); - if (is_shader) { - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - MatchesRegex( - "Loop header .\\[loop\\] is targeted by 2 back-edge blocks " - "but the standard requires exactly one")) - << str; - } else { - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); - } -} - -TEST_P(ValidateCFG, ContinueTargetMustBePostDominatedByBackEdge) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block loop("loop", SpvOpBranchConditional); - Block cheader("cheader", SpvOpBranchConditional); - Block be_block("be_block"); - Block merge("merge", SpvOpReturn); - Block exit("exit", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) loop.SetBody("OpLoopMerge %merge %cheader None\n"); - - string str = header(GetParam()) + nameOps("cheader", "be_block") + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> loop; - str += loop >> vector({cheader, merge}); - str += cheader >> vector({exit, be_block}); - str += exit; // Branches out of a continue construct - str += be_block >> loop; - str += merge; - str += "OpFunctionEnd"; - - CompileSuccessfully(str); - if (is_shader) { - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - MatchesRegex("The continue construct with the continue target " - ".\\[cheader\\] is not post dominated by the " - "back-edge block .\\[be_block\\]")); - } else { - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); - } -} - -TEST_P(ValidateCFG, BranchOutOfConstructToMergeBad) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block loop("loop", SpvOpBranchConditional); - Block cont("cont", SpvOpBranchConditional); - Block merge("merge", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) loop.SetBody("OpLoopMerge %merge %loop None\n"); - - string str = header(GetParam()) + nameOps("cont", "loop") + types_consts() + - "%func = OpFunction %voidt None %funct\n"; - - str += entry >> loop; - str += loop >> vector({cont, merge}); - str += cont >> vector({loop, merge}); - str += merge; - str += "OpFunctionEnd"; - - CompileSuccessfully(str); - if (is_shader) { - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - MatchesRegex("The continue construct with the continue target " - ".\\[loop\\] is not post dominated by the " - "back-edge block .\\[cont\\]")) - << str; - } else { - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); - } -} - -TEST_P(ValidateCFG, BranchOutOfConstructBad) { - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block loop("loop", SpvOpBranchConditional); - Block cont("cont", SpvOpBranchConditional); - Block merge("merge"); - Block exit("exit", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) loop.SetBody("OpLoopMerge %merge %loop None\n"); - - string str = header(GetParam()) + nameOps("cont", "loop") + types_consts() + - "%func = OpFunction %voidt None %funct\n"; - - str += entry >> loop; - str += loop >> vector({cont, merge}); - str += cont >> vector({loop, exit}); - str += merge >> exit; - str += exit; - str += "OpFunctionEnd"; - - CompileSuccessfully(str); - if (is_shader) { - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - MatchesRegex("The continue construct with the continue target " - ".\\[loop\\] is not post dominated by the " - "back-edge block .\\[cont\\]")); - } else { - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); - } -} - -TEST_F(ValidateCFG, OpSwitchToUnreachableBlock) { - Block entry("entry", SpvOpSwitch); - Block case0("case0"); - Block case1("case1"); - Block case2("case2"); - Block def("default", SpvOpUnreachable); - Block phi("phi", SpvOpReturn); - - string str = R"( -OpCapability Shader -OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %main "main" %id -OpExecutionMode %main LocalSize 1 1 1 -OpSource GLSL 430 -OpName %main "main" -OpDecorate %id BuiltIn GlobalInvocationId -%void = OpTypeVoid -%voidf = OpTypeFunction %void -%u32 = OpTypeInt 32 0 -%f32 = OpTypeFloat 32 -%uvec3 = OpTypeVector %u32 3 -%fvec3 = OpTypeVector %f32 3 -%uvec3ptr = OpTypePointer Input %uvec3 -%id = OpVariable %uvec3ptr Input -%one = OpConstant %u32 1 -%three = OpConstant %u32 3 -%main = OpFunction %void None %voidf -)"; - - entry.SetBody( - "%idval = OpLoad %uvec3 %id\n" - "%x = OpCompositeExtract %u32 %idval 0\n" - "%selector = OpUMod %u32 %x %three\n" - "OpSelectionMerge %phi None\n"); - str += entry >> vector({def, case0, case1, case2}); - str += case1 >> phi; - str += def; - str += phi; - str += case0 >> phi; - str += case2 >> phi; - str += "OpFunctionEnd"; - - CompileSuccessfully(str); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateCFG, LoopWithZeroBackEdgesBad) { - string str = R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" - OpName %loop "loop" -%voidt = OpTypeVoid -%funct = OpTypeFunction %voidt -%main = OpFunction %voidt None %funct -%loop = OpLabel - OpLoopMerge %exit %exit None - OpBranch %exit -%exit = OpLabel - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - MatchesRegex("Loop header .\\[loop\\] is targeted by " - "0 back-edge blocks but the standard requires exactly " - "one")); -} - -TEST_F(ValidateCFG, LoopWithBackEdgeFromUnreachableContinueConstructGood) { - string str = R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" - OpName %loop "loop" -%voidt = OpTypeVoid -%funct = OpTypeFunction %voidt -%floatt = OpTypeFloat 32 -%boolt = OpTypeBool -%one = OpConstant %floatt 1 -%two = OpConstant %floatt 2 -%main = OpFunction %voidt None %funct -%entry = OpLabel - OpBranch %loop -%loop = OpLabel - OpLoopMerge %exit %cont None - OpBranch %16 -%16 = OpLabel -%cond = OpFOrdLessThan %boolt %one %two - OpBranchConditional %cond %body %exit -%body = OpLabel - OpReturn -%cont = OpLabel ; Reachable only from OpLoopMerge ContinueTarget parameter - OpBranch %loop ; Should be considered a back-edge -%exit = OpLabel - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); -} - -TEST_P(ValidateCFG, - NestedConstructWithUnreachableMergeBlockBranchingToOuterMergeBlock) { - // Test for https://github.com/KhronosGroup/SPIRV-Tools/issues/297 - // The nested construct has an unreachable merge block. In the - // augmented CFG that merge block - // we still determine that the - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry", SpvOpBranchConditional); - Block inner_head("inner_head", SpvOpBranchConditional); - Block inner_true("inner_true", SpvOpReturn); - Block inner_false("inner_false", SpvOpReturn); - Block inner_merge("inner_merge"); - Block exit("exit", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) { - entry.AppendBody("OpSelectionMerge %exit None\n"); - inner_head.SetBody("OpSelectionMerge %inner_merge None\n"); - } - - string str = header(GetParam()) + nameOps("entry", "inner_merge", "exit") + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> vector({inner_head, exit}); - str += inner_head >> vector({inner_true, inner_false}); - str += inner_true; - str += inner_false; - str += inner_merge >> exit; - str += exit; - str += "OpFunctionEnd"; - - CompileSuccessfully(str); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); -} - -TEST_P(ValidateCFG, ContinueTargetCanBeMergeBlockForNestedStructureGood) { - // This example is valid. It shows that the validator can't just add - // an edge from the loop head to the continue target. If that edge - // is added, then the "if_merge" block is both the continue target - // for the loop and also the merge block for the nested selection, but - // then it wouldn't be dominated by "if_head", the header block for the - // nested selection. - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block loop("loop"); - Block if_head("if_head", SpvOpBranchConditional); - Block if_true("if_true"); - Block if_merge("if_merge", SpvOpBranchConditional); - Block merge("merge", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) { - loop.SetBody("OpLoopMerge %merge %if_merge None\n"); - if_head.SetBody("OpSelectionMerge %if_merge None\n"); - } - - string str = header(GetParam()) + nameOps("entry", "loop", "if_head", - "if_true", "if_merge", "merge") + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> loop; - str += loop >> if_head; - str += if_head >> vector({if_true, if_merge}); - str += if_true >> if_merge; - str += if_merge >> vector({loop, merge}); - str += merge; - str += "OpFunctionEnd"; - - CompileSuccessfully(str); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); -} - -TEST_P(ValidateCFG, SingleLatchBlockMultipleBranchesToLoopHeader) { - // This test case ensures we allow both branches of a loop latch block - // to go back to the loop header. It still counts as a single back edge. - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block loop("loop", SpvOpBranchConditional); - Block latch("latch", SpvOpBranchConditional); - Block merge("merge", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) { - loop.SetBody("OpLoopMerge %merge %latch None\n"); - } - - string str = header(GetParam()) + nameOps("entry", "loop", "latch", "merge") + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> loop; - str += loop >> vector({latch, merge}); - str += latch >> vector({loop, loop}); // This is the key - str += merge; - str += "OpFunctionEnd"; - - CompileSuccessfully(str); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << str - << getDiagnosticString(); -} - -TEST_P(ValidateCFG, SingleLatchBlockHeaderContinueTargetIsItselfGood) { - // This test case ensures we don't count a Continue Target from a loop - // header to itself as a self-loop when computing back edges. - // Also, it detects that there is an edge from %latch to the pseudo-exit - // node, rather than from %loop. In particular, it detects that we - // have used the *reverse* textual order of blocks when computing - // predecessor traversal roots. - bool is_shader = GetParam() == SpvCapabilityShader; - Block entry("entry"); - Block loop("loop"); - Block latch("latch"); - Block merge("merge", SpvOpReturn); - - entry.SetBody("%cond = OpSLessThan %boolt %one %two\n"); - if (is_shader) { - loop.SetBody("OpLoopMerge %merge %loop None\n"); - } - - string str = header(GetParam()) + nameOps("entry", "loop", "latch", "merge") + - types_consts() + "%func = OpFunction %voidt None %funct\n"; - - str += entry >> loop; - str += loop >> latch; - str += latch >> loop; - str += merge; - str += "OpFunctionEnd"; - - CompileSuccessfully(str); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << str - << getDiagnosticString(); -} - -// Unit test to check the case where a basic block is the entry block of 2 -// different constructs. In this case, the basic block is the entry block of a -// continue construct as well as a selection construct. See issue# 517 for more -// details. -TEST_F(ValidateCFG, BasicBlockIsEntryBlockOfTwoConstructsGood) { - std::string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - %void = OpTypeVoid - %bool = OpTypeBool - %int = OpTypeInt 32 1 - %void_func = OpTypeFunction %void - %int_0 = OpConstant %int 0 - %testfun = OpFunction %void None %void_func - %label_1 = OpLabel - OpBranch %start - %start = OpLabel - %cond = OpSLessThan %bool %int_0 %int_0 - ; - ; Note: In this case, the "target" block is both the entry block of - ; the continue construct of the loop as well as the entry block of - ; the selection construct. - ; - OpLoopMerge %loop_merge %target None - OpBranchConditional %cond %target %loop_merge - %loop_merge = OpLabel - OpReturn - %target = OpLabel - OpSelectionMerge %selection_merge None - OpBranchConditional %cond %do_stuff %do_other_stuff - %do_other_stuff = OpLabel - OpBranch %selection_merge - %selection_merge = OpLabel - OpBranch %start - %do_stuff = OpLabel - OpBranch %selection_merge - OpFunctionEnd - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateCFG, OpReturnInNonVoidFunc) { - std::string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - %int = OpTypeInt 32 1 - %int_func = OpTypeFunction %int - %testfun = OpFunction %int None %int_func - %label_1 = OpLabel - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(spirv); - ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "OpReturn can only be called from a function with void return type")); -} - -/// TODO(umar): Switch instructions -/// TODO(umar): Nested CFG constructs -} /// namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_conversion_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_conversion_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_conversion_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_conversion_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1065 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Tests for unique type declaration rules validator. - -#include - -#include "gmock/gmock.h" -#include "unit_spirv.h" -#include "val_fixtures.h" - -namespace { - -using ::testing::HasSubstr; -using ::testing::Not; - -using ValidateConversion = spvtest::ValidateBase; - -std::string GenerateShaderCode( - const std::string& body, - const std::string& capabilities_and_extensions = "") { - const std::string capabilities = -R"( -OpCapability Shader -OpCapability Int64 -OpCapability Float64)"; - - const std::string after_extension_before_body = -R"( -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -%void = OpTypeVoid -%func = OpTypeFunction %void -%bool = OpTypeBool -%f32 = OpTypeFloat 32 -%u32 = OpTypeInt 32 0 -%s32 = OpTypeInt 32 1 -%f64 = OpTypeFloat 64 -%u64 = OpTypeInt 64 0 -%s64 = OpTypeInt 64 1 -%boolvec2 = OpTypeVector %bool 2 -%s32vec2 = OpTypeVector %s32 2 -%u32vec2 = OpTypeVector %u32 2 -%u64vec2 = OpTypeVector %u64 2 -%f32vec2 = OpTypeVector %f32 2 -%f64vec2 = OpTypeVector %f64 2 -%boolvec3 = OpTypeVector %bool 3 -%u32vec3 = OpTypeVector %u32 3 -%u64vec3 = OpTypeVector %u64 3 -%s32vec3 = OpTypeVector %s32 3 -%f32vec3 = OpTypeVector %f32 3 -%f64vec3 = OpTypeVector %f64 3 -%boolvec4 = OpTypeVector %bool 4 -%u32vec4 = OpTypeVector %u32 4 -%u64vec4 = OpTypeVector %u64 4 -%s32vec4 = OpTypeVector %s32 4 -%f32vec4 = OpTypeVector %f32 4 -%f64vec4 = OpTypeVector %f64 4 - -%f32_0 = OpConstant %f32 0 -%f32_1 = OpConstant %f32 1 -%f32_2 = OpConstant %f32 2 -%f32_3 = OpConstant %f32 3 -%f32_4 = OpConstant %f32 4 - -%s32_0 = OpConstant %s32 0 -%s32_1 = OpConstant %s32 1 -%s32_2 = OpConstant %s32 2 -%s32_3 = OpConstant %s32 3 -%s32_4 = OpConstant %s32 4 -%s32_m1 = OpConstant %s32 -1 - -%u32_0 = OpConstant %u32 0 -%u32_1 = OpConstant %u32 1 -%u32_2 = OpConstant %u32 2 -%u32_3 = OpConstant %u32 3 -%u32_4 = OpConstant %u32 4 - -%f64_0 = OpConstant %f64 0 -%f64_1 = OpConstant %f64 1 -%f64_2 = OpConstant %f64 2 -%f64_3 = OpConstant %f64 3 -%f64_4 = OpConstant %f64 4 - -%s64_0 = OpConstant %s64 0 -%s64_1 = OpConstant %s64 1 -%s64_2 = OpConstant %s64 2 -%s64_3 = OpConstant %s64 3 -%s64_4 = OpConstant %s64 4 -%s64_m1 = OpConstant %s64 -1 - -%u64_0 = OpConstant %u64 0 -%u64_1 = OpConstant %u64 1 -%u64_2 = OpConstant %u64 2 -%u64_3 = OpConstant %u64 3 -%u64_4 = OpConstant %u64 4 - -%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 -%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 -%u32vec3_012 = OpConstantComposite %u32vec3 %u32_0 %u32_1 %u32_2 -%u32vec3_123 = OpConstantComposite %u32vec3 %u32_1 %u32_2 %u32_3 -%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 -%u32vec4_1234 = OpConstantComposite %u32vec4 %u32_1 %u32_2 %u32_3 %u32_4 - -%s32vec2_01 = OpConstantComposite %s32vec2 %s32_0 %s32_1 -%s32vec2_12 = OpConstantComposite %s32vec2 %s32_1 %s32_2 -%s32vec3_012 = OpConstantComposite %s32vec3 %s32_0 %s32_1 %s32_2 -%s32vec3_123 = OpConstantComposite %s32vec3 %s32_1 %s32_2 %s32_3 -%s32vec4_0123 = OpConstantComposite %s32vec4 %s32_0 %s32_1 %s32_2 %s32_3 -%s32vec4_1234 = OpConstantComposite %s32vec4 %s32_1 %s32_2 %s32_3 %s32_4 - -%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 -%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 -%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 -%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 -%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 -%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 - -%f64vec2_01 = OpConstantComposite %f64vec2 %f64_0 %f64_1 -%f64vec2_12 = OpConstantComposite %f64vec2 %f64_1 %f64_2 -%f64vec3_012 = OpConstantComposite %f64vec3 %f64_0 %f64_1 %f64_2 -%f64vec3_123 = OpConstantComposite %f64vec3 %f64_1 %f64_2 %f64_3 -%f64vec4_0123 = OpConstantComposite %f64vec4 %f64_0 %f64_1 %f64_2 %f64_3 -%f64vec4_1234 = OpConstantComposite %f64vec4 %f64_1 %f64_2 %f64_3 %f64_4 - -%true = OpConstantTrue %bool -%false = OpConstantFalse %bool - -%f32ptr_func = OpTypePointer Function %f32 - -%main = OpFunction %void None %func -%main_entry = OpLabel)"; - - const std::string after_body = -R"( -OpReturn -OpFunctionEnd)"; - - return capabilities + capabilities_and_extensions + - after_extension_before_body + body + after_body; -} - -std::string GenerateKernelCode( - const std::string& body, - const std::string& capabilities_and_extensions = "") { - const std::string capabilities = -R"( -OpCapability Addresses -OpCapability Kernel -OpCapability Linkage -OpCapability GenericPointer -OpCapability Int64 -OpCapability Float64)"; - - const std::string after_extension_before_body = -R"( -OpMemoryModel Physical32 OpenCL -%void = OpTypeVoid -%func = OpTypeFunction %void -%bool = OpTypeBool -%f32 = OpTypeFloat 32 -%u32 = OpTypeInt 32 0 -%f64 = OpTypeFloat 64 -%u64 = OpTypeInt 64 0 -%boolvec2 = OpTypeVector %bool 2 -%u32vec2 = OpTypeVector %u32 2 -%u64vec2 = OpTypeVector %u64 2 -%f32vec2 = OpTypeVector %f32 2 -%f64vec2 = OpTypeVector %f64 2 -%boolvec3 = OpTypeVector %bool 3 -%u32vec3 = OpTypeVector %u32 3 -%u64vec3 = OpTypeVector %u64 3 -%f32vec3 = OpTypeVector %f32 3 -%f64vec3 = OpTypeVector %f64 3 -%boolvec4 = OpTypeVector %bool 4 -%u32vec4 = OpTypeVector %u32 4 -%u64vec4 = OpTypeVector %u64 4 -%f32vec4 = OpTypeVector %f32 4 -%f64vec4 = OpTypeVector %f64 4 - -%f32_0 = OpConstant %f32 0 -%f32_1 = OpConstant %f32 1 -%f32_2 = OpConstant %f32 2 -%f32_3 = OpConstant %f32 3 -%f32_4 = OpConstant %f32 4 - -%u32_0 = OpConstant %u32 0 -%u32_1 = OpConstant %u32 1 -%u32_2 = OpConstant %u32 2 -%u32_3 = OpConstant %u32 3 -%u32_4 = OpConstant %u32 4 - -%f64_0 = OpConstant %f64 0 -%f64_1 = OpConstant %f64 1 -%f64_2 = OpConstant %f64 2 -%f64_3 = OpConstant %f64 3 -%f64_4 = OpConstant %f64 4 - -%u64_0 = OpConstant %u64 0 -%u64_1 = OpConstant %u64 1 -%u64_2 = OpConstant %u64 2 -%u64_3 = OpConstant %u64 3 -%u64_4 = OpConstant %u64 4 - -%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 -%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 -%u32vec3_012 = OpConstantComposite %u32vec3 %u32_0 %u32_1 %u32_2 -%u32vec3_123 = OpConstantComposite %u32vec3 %u32_1 %u32_2 %u32_3 -%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 -%u32vec4_1234 = OpConstantComposite %u32vec4 %u32_1 %u32_2 %u32_3 %u32_4 - -%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 -%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 -%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 -%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 -%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 -%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 - -%f64vec2_01 = OpConstantComposite %f64vec2 %f64_0 %f64_1 -%f64vec2_12 = OpConstantComposite %f64vec2 %f64_1 %f64_2 -%f64vec3_012 = OpConstantComposite %f64vec3 %f64_0 %f64_1 %f64_2 -%f64vec3_123 = OpConstantComposite %f64vec3 %f64_1 %f64_2 %f64_3 -%f64vec4_0123 = OpConstantComposite %f64vec4 %f64_0 %f64_1 %f64_2 %f64_3 -%f64vec4_1234 = OpConstantComposite %f64vec4 %f64_1 %f64_2 %f64_3 %f64_4 - -%true = OpConstantTrue %bool -%false = OpConstantFalse %bool - -%f32ptr_func = OpTypePointer Function %f32 -%u32ptr_func = OpTypePointer Function %u32 -%f32ptr_gen = OpTypePointer Generic %f32 -%f32ptr_inp = OpTypePointer Input %f32 -%f32ptr_wg = OpTypePointer Workgroup %f32 -%f32ptr_cwg = OpTypePointer CrossWorkgroup %f32 - -%f32inp = OpVariable %f32ptr_inp Input - -%main = OpFunction %void None %func -%main_entry = OpLabel)"; - - const std::string after_body = -R"( -OpReturn -OpFunctionEnd)"; - - return capabilities + capabilities_and_extensions + - after_extension_before_body + body + after_body; -} - -TEST_F(ValidateConversion, ConvertFToUSuccess) { - const std::string body = R"( -%val1 = OpConvertFToU %u32 %f32_1 -%val2 = OpConvertFToU %u32 %f64_0 -%val3 = OpConvertFToU %u32vec2 %f32vec2_01 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateConversion, ConvertFToUWrongResultType) { - const std::string body = R"( -%val = OpConvertFToU %s32 %f32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected unsigned int scalar or vector type as Result Type: ConvertFToU")); -} - -TEST_F(ValidateConversion, ConvertFToUWrongInputType) { - const std::string body = R"( -%val = OpConvertFToU %u32 %u32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to be float scalar or vector: ConvertFToU")); -} - -TEST_F(ValidateConversion, ConvertFToUDifferentDimension) { - const std::string body = R"( -%val = OpConvertFToU %u32 %f32vec2_01 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to have the same dimension as Result Type: ConvertFToU")); -} - -TEST_F(ValidateConversion, ConvertFToSSuccess) { - const std::string body = R"( -%val1 = OpConvertFToS %s32 %f32_1 -%val2 = OpConvertFToS %u32 %f64_0 -%val3 = OpConvertFToS %s32vec2 %f32vec2_01 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateConversion, ConvertFToSWrongResultType) { - const std::string body = R"( -%val = OpConvertFToS %bool %f32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected int scalar or vector type as Result Type: ConvertFToS")); -} - -TEST_F(ValidateConversion, ConvertFToSWrongInputType) { - const std::string body = R"( -%val = OpConvertFToS %s32 %u32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to be float scalar or vector: ConvertFToS")); -} - -TEST_F(ValidateConversion, ConvertFToSDifferentDimension) { - const std::string body = R"( -%val = OpConvertFToS %u32 %f32vec2_01 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to have the same dimension as Result Type: ConvertFToS")); -} - -TEST_F(ValidateConversion, ConvertSToFSuccess) { - const std::string body = R"( -%val1 = OpConvertSToF %f32 %u32_1 -%val2 = OpConvertSToF %f32 %s64_0 -%val3 = OpConvertSToF %f32vec2 %s32vec2_01 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateConversion, ConvertSToFWrongResultType) { - const std::string body = R"( -%val = OpConvertSToF %u32 %s32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected float scalar or vector type as Result Type: ConvertSToF")); -} - -TEST_F(ValidateConversion, ConvertSToFWrongInputType) { - const std::string body = R"( -%val = OpConvertSToF %f32 %f32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to be int scalar or vector: ConvertSToF")); -} - -TEST_F(ValidateConversion, ConvertSToFDifferentDimension) { - const std::string body = R"( -%val = OpConvertSToF %f32 %u32vec2_01 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to have the same dimension as Result Type: ConvertSToF")); -} - -TEST_F(ValidateConversion, UConvertSuccess) { - const std::string body = R"( -%val1 = OpUConvert %u32 %u64_1 -%val2 = OpUConvert %u64 %s32_0 -%val3 = OpUConvert %u64vec2 %s32vec2_01 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -#if 0 -// TODO(atgoo@github.com) Reenable the test once the check is reenabled. -TEST_F(ValidateConversion, UConvertWrongResultType) { - const std::string body = R"( -%val = OpUConvert %s32 %s32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected unsigned int scalar or vector type as Result Type: UConvert")); -} - -TEST_F(ValidateConversion, UConvertWrongInputType) { - const std::string body = R"( -%val = OpUConvert %u32 %f32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to be int scalar or vector: UConvert")); -} - -TEST_F(ValidateConversion, UConvertDifferentDimension) { - const std::string body = R"( -%val = OpUConvert %u32 %u32vec2_01 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to have the same dimension as Result Type: UConvert")); -} - -TEST_F(ValidateConversion, UConvertSameBitWidth) { - const std::string body = R"( -%val = OpUConvert %u32 %s32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to have different bit width from Result Type: UConvert")); -} -#endif - -TEST_F(ValidateConversion, SConvertSuccess) { - const std::string body = R"( -%val1 = OpSConvert %s32 %u64_1 -%val2 = OpSConvert %s64 %s32_0 -%val3 = OpSConvert %u64vec2 %s32vec2_01 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateConversion, SConvertWrongResultType) { - const std::string body = R"( -%val = OpSConvert %f32 %s32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected int scalar or vector type as Result Type: SConvert")); -} - -TEST_F(ValidateConversion, SConvertWrongInputType) { - const std::string body = R"( -%val = OpSConvert %u32 %f32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to be int scalar or vector: SConvert")); -} - -TEST_F(ValidateConversion, SConvertDifferentDimension) { - const std::string body = R"( -%val = OpSConvert %s32 %u32vec2_01 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to have the same dimension as Result Type: SConvert")); -} - -TEST_F(ValidateConversion, SConvertSameBitWidth) { - const std::string body = R"( -%val = OpSConvert %u32 %s32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to have different bit width from Result Type: SConvert")); -} - -TEST_F(ValidateConversion, FConvertSuccess) { - const std::string body = R"( -%val1 = OpFConvert %f32 %f64_1 -%val2 = OpFConvert %f64 %f32_0 -%val3 = OpFConvert %f64vec2 %f32vec2_01 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateConversion, FConvertWrongResultType) { - const std::string body = R"( -%val = OpFConvert %u32 %f32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected float scalar or vector type as Result Type: FConvert")); -} - -TEST_F(ValidateConversion, FConvertWrongInputType) { - const std::string body = R"( -%val = OpFConvert %f32 %u64_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to be float scalar or vector: FConvert")); -} - -TEST_F(ValidateConversion, FConvertDifferentDimension) { - const std::string body = R"( -%val = OpFConvert %f64 %f32vec2_01 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to have the same dimension as Result Type: FConvert")); -} - -TEST_F(ValidateConversion, FConvertSameBitWidth) { - const std::string body = R"( -%val = OpFConvert %f32 %f32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to have different bit width from Result Type: FConvert")); -} - -TEST_F(ValidateConversion, QuantizeToF16Success) { - const std::string body = R"( -%val1 = OpQuantizeToF16 %f32 %f32_1 -%val2 = OpQuantizeToF16 %f32 %f32_0 -%val3 = OpQuantizeToF16 %f32vec2 %f32vec2_01 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateConversion, QuantizeToF16WrongResultType) { - const std::string body = R"( -%val = OpQuantizeToF16 %u32 %f32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected 32-bit float scalar or vector type as Result Type: " - "QuantizeToF16")); -} - -TEST_F(ValidateConversion, QuantizeToF16WrongResultTypeBitWidth) { - const std::string body = R"( -%val = OpQuantizeToF16 %u64 %f64_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected 32-bit float scalar or vector type as Result Type: " - "QuantizeToF16")); -} - -TEST_F(ValidateConversion, QuantizeToF16WrongInputType) { - const std::string body = R"( -%val = OpQuantizeToF16 %f32 %f64_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input type to be equal to Result Type: QuantizeToF16")); -} - -TEST_F(ValidateConversion, ConvertPtrToUSuccess) { - const std::string body = R"( -%ptr = OpVariable %f32ptr_func Function -%val1 = OpConvertPtrToU %u32 %ptr -%val2 = OpConvertPtrToU %u64 %ptr -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateConversion, ConvertPtrToUWrongResultType) { - const std::string body = R"( -%ptr = OpVariable %f32ptr_func Function -%val = OpConvertPtrToU %f32 %ptr -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected unsigned int scalar type as Result Type: " - "ConvertPtrToU")); -} - -TEST_F(ValidateConversion, ConvertPtrToUNotPointer) { - const std::string body = R"( -%val = OpConvertPtrToU %u32 %f32_1 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to be a pointer: ConvertPtrToU")); -} - -TEST_F(ValidateConversion, SatConvertSToUSuccess) { - const std::string body = R"( -%val1 = OpSatConvertSToU %u32 %u64_2 -%val2 = OpSatConvertSToU %u64 %u32_1 -%val3 = OpSatConvertSToU %u64vec2 %u32vec2_12 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateConversion, SatConvertSToUWrongResultType) { - const std::string body = R"( -%val = OpSatConvertSToU %f32 %u32_1 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected int scalar or vector type as Result Type: " - "SatConvertSToU")); -} - -TEST_F(ValidateConversion, SatConvertSToUWrongInputType) { - const std::string body = R"( -%val = OpSatConvertSToU %u32 %f32_1 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected int scalar or vector as input: SatConvertSToU")); -} - -TEST_F(ValidateConversion, SatConvertSToUDifferentDimension) { - const std::string body = R"( -%val = OpSatConvertSToU %u32 %u32vec2_12 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to have the same dimension as Result Type: " - "SatConvertSToU")); -} - -TEST_F(ValidateConversion, ConvertUToPtrSuccess) { - const std::string body = R"( -%val1 = OpConvertUToPtr %f32ptr_func %u32_1 -%val2 = OpConvertUToPtr %f32ptr_func %u64_1 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateConversion, ConvertUToPtrWrongResultType) { - const std::string body = R"( -%val = OpConvertUToPtr %f32 %u32_1 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Result Type to be a pointer: ConvertUToPtr")); -} - -TEST_F(ValidateConversion, ConvertUToPtrNotInt) { - const std::string body = R"( -%val = OpConvertUToPtr %f32ptr_func %f32_1 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected int scalar as input: ConvertUToPtr")); -} - -TEST_F(ValidateConversion, ConvertUToPtrNotIntScalar) { - const std::string body = R"( -%val = OpConvertUToPtr %f32ptr_func %u32vec2_12 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected int scalar as input: ConvertUToPtr")); -} - -TEST_F(ValidateConversion, PtrCastToGenericSuccess) { - const std::string body = R"( -%ptr_func = OpVariable %f32ptr_func Function -%val = OpPtrCastToGeneric %f32ptr_gen %ptr_func -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateConversion, PtrCastToGenericWrongResultType) { - const std::string body = R"( -%ptr_func = OpVariable %f32ptr_func Function -%val = OpPtrCastToGeneric %f32 %ptr_func -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Result Type to be a pointer: PtrCastToGeneric")); -} - -TEST_F(ValidateConversion, PtrCastToGenericWrongResultStorageClass) { - const std::string body = R"( -%ptr_func = OpVariable %f32ptr_func Function -%val = OpPtrCastToGeneric %f32ptr_func %ptr_func -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Result Type to have storage class Generic: PtrCastToGeneric")); -} - -TEST_F(ValidateConversion, PtrCastToGenericWrongInputType) { - const std::string body = R"( -%ptr_func = OpVariable %f32ptr_func Function -%val = OpPtrCastToGeneric %f32ptr_gen %f32 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to be a pointer: PtrCastToGeneric")); -} - -TEST_F(ValidateConversion, PtrCastToGenericWrongInputStorageClass) { - const std::string body = R"( -%val = OpPtrCastToGeneric %f32ptr_gen %f32inp -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to have storage class Workgroup, " - "CrossWorkgroup or Function: PtrCastToGeneric")); -} - -TEST_F(ValidateConversion, PtrCastToGenericPointToDifferentType) { - const std::string body = R"( -%ptr_func = OpVariable %u32ptr_func Function -%val = OpPtrCastToGeneric %f32ptr_gen %ptr_func -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input and Result Type to point to the same type: " - "PtrCastToGeneric")); -} - -TEST_F(ValidateConversion, GenericCastToPtrSuccess) { - const std::string body = R"( -%ptr_func = OpVariable %f32ptr_func Function -%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func -%ptr_func2 = OpGenericCastToPtr %f32ptr_func %ptr_gen -%ptr_wg = OpGenericCastToPtr %f32ptr_wg %ptr_gen -%ptr_cwg = OpGenericCastToPtr %f32ptr_cwg %ptr_gen -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateConversion, GenericCastToPtrWrongResultType) { - const std::string body = R"( -%ptr_func = OpVariable %f32ptr_func Function -%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func -%ptr_func2 = OpGenericCastToPtr %f32 %ptr_gen -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Result Type to be a pointer: GenericCastToPtr")); -} - -TEST_F(ValidateConversion, GenericCastToPtrWrongResultStorageClass) { - const std::string body = R"( -%ptr_func = OpVariable %f32ptr_func Function -%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func -%ptr_func2 = OpGenericCastToPtr %f32ptr_gen %ptr_gen -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Result Type to have storage class Workgroup, " - "CrossWorkgroup or Function: GenericCastToPtr")); -} - -TEST_F(ValidateConversion, GenericCastToPtrWrongInputType) { - const std::string body = R"( -%ptr_func = OpVariable %f32ptr_func Function -%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func -%ptr_func2 = OpGenericCastToPtr %f32ptr_func %f32_1 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to be a pointer: GenericCastToPtr")); -} - -TEST_F(ValidateConversion, GenericCastToPtrWrongInputStorageClass) { - const std::string body = R"( -%ptr_func = OpVariable %f32ptr_func Function -%ptr_func2 = OpGenericCastToPtr %f32ptr_func %ptr_func -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to have storage class Generic: " - "GenericCastToPtr")); -} - -TEST_F(ValidateConversion, GenericCastToPtrPointToDifferentType) { - const std::string body = R"( -%ptr_func = OpVariable %f32ptr_func Function -%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func -%ptr_func2 = OpGenericCastToPtr %u32ptr_func %ptr_gen -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input and Result Type to point to the same type: " - "GenericCastToPtr")); -} - -TEST_F(ValidateConversion, GenericCastToPtrExplicitSuccess) { - const std::string body = R"( -%ptr_func = OpVariable %f32ptr_func Function -%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func -%ptr_func2 = OpGenericCastToPtrExplicit %f32ptr_func %ptr_gen Function -%ptr_wg = OpGenericCastToPtrExplicit %f32ptr_wg %ptr_gen Workgroup -%ptr_cwg = OpGenericCastToPtrExplicit %f32ptr_cwg %ptr_gen CrossWorkgroup -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateConversion, GenericCastToPtrExplicitWrongResultType) { - const std::string body = R"( -%ptr_func = OpVariable %f32ptr_func Function -%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func -%ptr_func2 = OpGenericCastToPtrExplicit %f32 %ptr_gen Function -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Result Type to be a pointer: GenericCastToPtrExplicit")); -} - -TEST_F(ValidateConversion, GenericCastToPtrExplicitResultStorageClassDiffers) { - const std::string body = R"( -%ptr_func = OpVariable %f32ptr_func Function -%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func -%ptr_func2 = OpGenericCastToPtrExplicit %f32ptr_func %ptr_gen Workgroup -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Result Type to be of target storage class: " - "GenericCastToPtrExplicit")); -} - -TEST_F(ValidateConversion, GenericCastToPtrExplicitWrongResultStorageClass) { - const std::string body = R"( -%ptr_func = OpVariable %f32ptr_func Function -%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func -%ptr_func2 = OpGenericCastToPtrExplicit %f32ptr_gen %ptr_gen Generic -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected target storage class to be Workgroup, " - "CrossWorkgroup or Function: GenericCastToPtrExplicit")); -} - -TEST_F(ValidateConversion, GenericCastToPtrExplicitWrongInputType) { - const std::string body = R"( -%ptr_func = OpVariable %f32ptr_func Function -%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func -%ptr_func2 = OpGenericCastToPtrExplicit %f32ptr_func %f32_1 Function -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to be a pointer: GenericCastToPtrExplicit")); -} - -TEST_F(ValidateConversion, GenericCastToPtrExplicitWrongInputStorageClass) { - const std::string body = R"( -%ptr_func = OpVariable %f32ptr_func Function -%ptr_func2 = OpGenericCastToPtrExplicit %f32ptr_func %ptr_func Function -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to have storage class Generic: " - "GenericCastToPtrExplicit")); -} - -TEST_F(ValidateConversion, GenericCastToPtrExplicitPointToDifferentType) { - const std::string body = R"( -%ptr_func = OpVariable %f32ptr_func Function -%ptr_gen = OpPtrCastToGeneric %f32ptr_gen %ptr_func -%ptr_func2 = OpGenericCastToPtrExplicit %u32ptr_func %ptr_gen Function -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input and Result Type to point to the same type: " - "GenericCastToPtrExplicit")); -} - -TEST_F(ValidateConversion, BitcastSuccess) { - const std::string body = R"( -%ptr = OpVariable %f32ptr_func Function -%val1 = OpBitcast %u32 %ptr -%val2 = OpBitcast %u64 %ptr -%val3 = OpBitcast %f32ptr_func %u32_1 -%val4 = OpBitcast %f32ptr_wg %u64_1 -%val5 = OpBitcast %f32 %u32_1 -%val6 = OpBitcast %f32vec2 %u32vec2_12 -%val7 = OpBitcast %f32vec2 %u64_1 -%val8 = OpBitcast %f64 %u32vec2_12 -%val9 = OpBitcast %f32vec4 %f64vec2_12 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateConversion, BitcastInputHasNoType) { - const std::string body = R"( -%val = OpBitcast %u32 %f32 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to have a type: Bitcast")); -} - -TEST_F(ValidateConversion, BitcastWrongResultType) { - const std::string body = R"( -%val = OpBitcast %bool %f32_1 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected Result Type to be a pointer or int or float vector " - "or scalar type: Bitcast")); -} - -TEST_F(ValidateConversion, BitcastWrongInputType) { - const std::string body = R"( -%val = OpBitcast %u32 %true -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to be a pointer or int or float vector " - "or scalar: Bitcast")); -} - -TEST_F(ValidateConversion, BitcastPtrWrongInputType) { - const std::string body = R"( -%val = OpBitcast %u32ptr_func %f32_1 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to be a pointer or int scalar if Result Type " - "is pointer: Bitcast")); -} - -TEST_F(ValidateConversion, BitcastPtrWrongResultType) { - const std::string body = R"( -%val = OpBitcast %f32 %f32inp -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Pointer can only be converted to another pointer or int scalar: " - "Bitcast")); -} - -TEST_F(ValidateConversion, BitcastDifferentTotalBitWidth) { - const std::string body = R"( -%val = OpBitcast %f32 %u64_1 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected input to have the same total bit width as Result Type: " - "Bitcast")); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_data_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_data_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_data_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_data_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,586 +0,0 @@ -// Copyright (c) 2016 Google 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. - -// Validation tests for Data Rules. - -#include -#include -#include - -#include "gmock/gmock.h" -#include "unit_spirv.h" -#include "val_fixtures.h" - -namespace { - -using ::testing::HasSubstr; -using ::testing::MatchesRegex; - -using std::string; -using std::pair; -using std::stringstream; - -using ValidateData = spvtest::ValidateBase>; - -string HeaderWith(std::string cap) { - return std::string("OpCapability Shader OpCapability Linkage OpCapability ") + - cap + " OpMemoryModel Logical GLSL450 "; -} - -string header = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 -)"; -string header_with_addresses = R"( - OpCapability Addresses - OpCapability Kernel - OpCapability GenericPointer - OpCapability Linkage - OpMemoryModel Physical32 OpenCL -)"; -string header_with_vec16_cap = R"( - OpCapability Shader - OpCapability Vector16 - OpCapability Linkage - OpMemoryModel Logical GLSL450 -)"; -string header_with_int8 = R"( - OpCapability Shader - OpCapability Linkage - OpCapability Int8 - OpMemoryModel Logical GLSL450 -)"; -string header_with_int16 = R"( - OpCapability Shader - OpCapability Linkage - OpCapability Int16 - OpMemoryModel Logical GLSL450 -)"; -string header_with_int64 = R"( - OpCapability Shader - OpCapability Linkage - OpCapability Int64 - OpMemoryModel Logical GLSL450 -)"; -string header_with_float16 = R"( - OpCapability Shader - OpCapability Linkage - OpCapability Float16 - OpMemoryModel Logical GLSL450 -)"; -string header_with_float16_buffer = R"( - OpCapability Shader - OpCapability Linkage - OpCapability Float16Buffer - OpMemoryModel Logical GLSL450 -)"; -string header_with_float64 = R"( - OpCapability Shader - OpCapability Linkage - OpCapability Float64 - OpMemoryModel Logical GLSL450 -)"; - -string invalid_comp_error = "Illegal number of components"; -string missing_cap_error = "requires the Vector16 capability"; -string missing_int8_cap_error = "requires the Int8 capability"; -string missing_int16_cap_error = - "requires the Int16 capability," - " or an extension that explicitly enables 16-bit integers."; -string missing_int64_cap_error = "requires the Int64 capability"; -string missing_float16_cap_error = - "requires the Float16 or Float16Buffer capability," - " or an extension that explicitly enables 16-bit floating point."; -string missing_float64_cap_error = "requires the Float64 capability"; -string invalid_num_bits_error = "Invalid number of bits"; - -TEST_F(ValidateData, vec0) { - string str = header + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 0 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(invalid_comp_error)); -} - -TEST_F(ValidateData, vec1) { - string str = header + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 1 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(invalid_comp_error)); -} - -TEST_F(ValidateData, vec2) { - string str = header + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 2 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, vec3) { - string str = header + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 3 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, vec4) { - string str = header + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, vec5) { - string str = header + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 5 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(invalid_comp_error)); -} - -TEST_F(ValidateData, vec8) { - string str = header + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 8 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(missing_cap_error)); -} - -TEST_F(ValidateData, vec8_with_capability) { - string str = header_with_vec16_cap + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 8 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, vec16) { - string str = header + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 8 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(missing_cap_error)); -} - -TEST_F(ValidateData, vec16_with_capability) { - string str = header_with_vec16_cap + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 16 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, vec15) { - string str = header + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 15 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(invalid_comp_error)); -} - -TEST_F(ValidateData, int8_good) { - string str = header_with_int8 + "%2 = OpTypeInt 8 0"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, int8_bad) { - string str = header + "%2 = OpTypeInt 8 1"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(missing_int8_cap_error)); -} - -TEST_F(ValidateData, int16_good) { - string str = header_with_int16 + "%2 = OpTypeInt 16 1"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, storage_uniform_buffer_block_16_good) { - string str = HeaderWith("StorageUniformBufferBlock16 " - "OpExtension \"SPV_KHR_16bit_storage\"") + - "%2 = OpTypeInt 16 1 %3 = OpTypeFloat 16"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, storage_uniform_16_good) { - string str = - HeaderWith("StorageUniform16 OpExtension \"SPV_KHR_16bit_storage\"") + - "%2 = OpTypeInt 16 1 %3 = OpTypeFloat 16"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, storage_push_constant_16_good) { - string str = HeaderWith("StoragePushConstant16 " - "OpExtension \"SPV_KHR_16bit_storage\"") + - "%2 = OpTypeInt 16 1 %3 = OpTypeFloat 16"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, storage_input_output_16_good) { - string str = HeaderWith("StorageInputOutput16 " - "OpExtension \"SPV_KHR_16bit_storage\"") + - "%2 = OpTypeInt 16 1 %3 = OpTypeFloat 16"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, int16_bad) { - string str = header + "%2 = OpTypeInt 16 1"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(missing_int16_cap_error)); -} - -TEST_F(ValidateData, int64_good) { - string str = header_with_int64 + "%2 = OpTypeInt 64 1"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, int64_bad) { - string str = header + "%2 = OpTypeInt 64 1"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(missing_int64_cap_error)); -} - -// Number of bits in an integer may be only one of: {8,16,32,64} -TEST_F(ValidateData, int_invalid_num_bits) { - string str = header + "%2 = OpTypeInt 48 1"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(invalid_num_bits_error)); -} - -TEST_F(ValidateData, float16_good) { - string str = header_with_float16 + "%2 = OpTypeFloat 16"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, float16_buffer_good) { - string str = header_with_float16_buffer + "%2 = OpTypeFloat 16"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, float16_bad) { - string str = header + "%2 = OpTypeFloat 16"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(missing_float16_cap_error)); -} - -TEST_F(ValidateData, float64_good) { - string str = header_with_float64 + "%2 = OpTypeFloat 64"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, float64_bad) { - string str = header + "%2 = OpTypeFloat 64"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(missing_float64_cap_error)); -} - -// Number of bits in a float may be only one of: {16,32,64} -TEST_F(ValidateData, float_invalid_num_bits) { - string str = header + "%2 = OpTypeFloat 48"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(invalid_num_bits_error)); -} - -TEST_F(ValidateData, matrix_data_type_float) { - string str = header + R"( -%f32 = OpTypeFloat 32 -%vec3 = OpTypeVector %f32 3 -%mat33 = OpTypeMatrix %vec3 3 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, matrix_bad_column_type) { - string str = header + R"( -%f32 = OpTypeFloat 32 -%mat33 = OpTypeMatrix %f32 3 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Columns in a matrix must be of type vector")); -} - -TEST_F(ValidateData, matrix_data_type_int) { - string str = header + R"( -%int32 = OpTypeInt 32 1 -%vec3 = OpTypeVector %int32 3 -%mat33 = OpTypeMatrix %vec3 3 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("can only be parameterized with floating-point types")); -} - -TEST_F(ValidateData, matrix_data_type_bool) { - string str = header + R"( -%boolt = OpTypeBool -%vec3 = OpTypeVector %boolt 3 -%mat33 = OpTypeMatrix %vec3 3 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("can only be parameterized with floating-point types")); -} - -TEST_F(ValidateData, matrix_with_0_columns) { - string str = header + R"( -%f32 = OpTypeFloat 32 -%vec3 = OpTypeVector %f32 3 -%mat33 = OpTypeMatrix %vec3 0 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("can only be parameterized as having only 2, 3, or 4 columns")); -} - -TEST_F(ValidateData, matrix_with_1_column) { - string str = header + R"( -%f32 = OpTypeFloat 32 -%vec3 = OpTypeVector %f32 3 -%mat33 = OpTypeMatrix %vec3 1 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("can only be parameterized as having only 2, 3, or 4 columns")); -} - -TEST_F(ValidateData, matrix_with_2_columns) { - string str = header + R"( -%f32 = OpTypeFloat 32 -%vec3 = OpTypeVector %f32 3 -%mat33 = OpTypeMatrix %vec3 2 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, matrix_with_3_columns) { - string str = header + R"( -%f32 = OpTypeFloat 32 -%vec3 = OpTypeVector %f32 3 -%mat33 = OpTypeMatrix %vec3 3 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, matrix_with_4_columns) { - string str = header + R"( -%f32 = OpTypeFloat 32 -%vec3 = OpTypeVector %f32 3 -%mat33 = OpTypeMatrix %vec3 4 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, matrix_with_5_column) { - string str = header + R"( -%f32 = OpTypeFloat 32 -%vec3 = OpTypeVector %f32 3 -%mat33 = OpTypeMatrix %vec3 5 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("can only be parameterized as having only 2, 3, or 4 columns")); -} - -TEST_F(ValidateData, specialize_int) { - string str = header + R"( -%i32 = OpTypeInt 32 1 -%len = OpSpecConstant %i32 2)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, specialize_float) { - string str = header + R"( -%f32 = OpTypeFloat 32 -%len = OpSpecConstant %f32 2)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, specialize_boolean) { - string str = header + R"( -%2 = OpTypeBool -%3 = OpSpecConstantTrue %2 -%4 = OpSpecConstantFalse %2)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, specialize_boolean_to_int) { - string str = header + R"( -%2 = OpTypeInt 32 1 -%3 = OpSpecConstantTrue %2 -%4 = OpSpecConstantFalse %2)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Specialization constant must be a boolean")); -} - -TEST_F(ValidateData, missing_forward_pointer_decl) { - string str = header_with_addresses + R"( -%uintt = OpTypeInt 32 0 -%3 = OpTypeStruct %fwd_ptrt %uintt -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("must first be declared using OpTypeForwardPointer")); -} - -TEST_F(ValidateData, forward_pointer_missing_definition) { - string str = header_with_addresses + R"( -OpTypeForwardPointer %_ptr_Generic_struct_A Generic -%uintt = OpTypeInt 32 0 -%struct_B = OpTypeStruct %uintt %_ptr_Generic_struct_A -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("forward referenced IDs have not been defined")); -} - -TEST_F(ValidateData, forward_ref_bad_type) { - string str = header_with_addresses + R"( -OpTypeForwardPointer %_ptr_Generic_struct_A Generic -%uintt = OpTypeInt 32 0 -%struct_B = OpTypeStruct %uintt %_ptr_Generic_struct_A -%_ptr_Generic_struct_A = OpTypeFloat 32 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Found a forward reference to a non-pointer type in " - "OpTypeStruct instruction.")); -} - -TEST_F(ValidateData, forward_ref_points_to_non_struct) { - string str = header_with_addresses + R"( -OpTypeForwardPointer %_ptr_Generic_struct_A Generic -%uintt = OpTypeInt 32 0 -%struct_B = OpTypeStruct %uintt %_ptr_Generic_struct_A -%_ptr_Generic_struct_A = OpTypePointer Generic %uintt -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("A forward reference operand in an OpTypeStruct must " - "be an OpTypePointer that points to an OpTypeStruct. " - "Found OpTypePointer that points to OpTypeInt.")); -} - -TEST_F(ValidateData, struct_forward_pointer_good) { - string str = header_with_addresses + R"( -OpTypeForwardPointer %_ptr_Generic_struct_A Generic -%uintt = OpTypeInt 32 0 -%struct_B = OpTypeStruct %uintt %_ptr_Generic_struct_A -%struct_C = OpTypeStruct %uintt %struct_B -%struct_A = OpTypeStruct %uintt %struct_C -%_ptr_Generic_struct_A = OpTypePointer Generic %struct_C -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateData, ext_16bit_storage_caps_allow_free_fp_rounding_mode) { - for (const char* cap : {"StorageUniform16", "StorageUniformBufferBlock16", - "StoragePushConstant16", "StorageInputOutput16"}) { - for (const char* mode : {"RTE", "RTZ", "RTP", "RTN"}) { - string str = string(R"( - OpCapability Shader - OpCapability Linkage - OpCapability )") + - cap + R"( - OpExtension "SPV_KHR_16bit_storage" - OpMemoryModel Logical GLSL450 - OpDecorate %2 FPRoundingMode )" + - mode + R"( - %1 = OpTypeFloat 32 - %2 = OpConstant %1 1.25 - )"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); - } - } -} - -TEST_F(ValidateData, default_disallow_free_fp_rounding_mode) { - string str = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpDecorate %2 FPRoundingMode RTZ - %1 = OpTypeFloat 32 - %2 = OpConstant %1 1.25 - )"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_CAPABILITY, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Operand 2 of Decorate requires one of these " - "capabilities: Kernel")); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_decoration_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_decoration_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_decoration_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_decoration_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,452 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Common validation fixtures for unit tests - -#include "gmock/gmock.h" -#include "unit_spirv.h" -#include "val_fixtures.h" -#include "source/val/decoration.h" - -namespace { - -using std::string; -using std::vector; -using ::testing::HasSubstr; -using ::testing::Eq; -using libspirv::Decoration; - -using ValidateDecorations = spvtest::ValidateBase; - -TEST_F(ValidateDecorations, ValidateOpDecorateRegistration) { - string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpDecorate %1 ArrayStride 4 - OpDecorate %1 Uniform - %2 = OpTypeFloat 32 - %1 = OpTypeRuntimeArray %2 - ; Since %1 is used first in Decoration, it gets id 1. -)"; - const uint32_t id = 1; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); - // Must have 2 decorations. - EXPECT_THAT(vstate_->id_decorations(id), - Eq(vector{Decoration(SpvDecorationArrayStride, {4}), - Decoration(SpvDecorationUniform)})); -} - -TEST_F(ValidateDecorations, ValidateOpMemberDecorateRegistration) { - string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpDecorate %_arr_double_uint_6 ArrayStride 4 - OpMemberDecorate %_struct_115 2 NonReadable - OpMemberDecorate %_struct_115 2 Offset 2 - OpDecorate %_struct_115 BufferBlock - %float = OpTypeFloat 32 - %uint = OpTypeInt 32 0 - %uint_6 = OpConstant %uint 6 - %_arr_double_uint_6 = OpTypeArray %float %uint_6 - %_struct_115 = OpTypeStruct %float %float %_arr_double_uint_6 -)"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); - - // The array must have 1 decoration. - const uint32_t arr_id = 1; - EXPECT_THAT( - vstate_->id_decorations(arr_id), - Eq(vector{Decoration(SpvDecorationArrayStride, {4})})); - - // The struct must have 3 decorations. - const uint32_t struct_id = 2; - EXPECT_THAT(vstate_->id_decorations(struct_id), - Eq(vector{Decoration(SpvDecorationNonReadable, {}, 2), - Decoration(SpvDecorationOffset, {2}, 2), - Decoration(SpvDecorationBufferBlock)})); -} - -TEST_F(ValidateDecorations, ValidateGroupDecorateRegistration) { - string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpDecorate %1 DescriptorSet 0 - OpDecorate %1 NonWritable - OpDecorate %1 Restrict - %1 = OpDecorationGroup - OpGroupDecorate %1 %2 %3 - OpGroupDecorate %1 %4 - %float = OpTypeFloat 32 -%_runtimearr_float = OpTypeRuntimeArray %float - %_struct_9 = OpTypeStruct %_runtimearr_float -%_ptr_Uniform__struct_9 = OpTypePointer Uniform %_struct_9 - %2 = OpVariable %_ptr_Uniform__struct_9 Uniform - %_struct_10 = OpTypeStruct %_runtimearr_float -%_ptr_Uniform__struct_10 = OpTypePointer Uniform %_struct_10 - %3 = OpVariable %_ptr_Uniform__struct_10 Uniform - %_struct_11 = OpTypeStruct %_runtimearr_float -%_ptr_Uniform__struct_11 = OpTypePointer Uniform %_struct_11 - %4 = OpVariable %_ptr_Uniform__struct_11 Uniform - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); - - // Decoration group has 3 decorations. - auto expected_decorations = vector{ - Decoration(SpvDecorationDescriptorSet, {0}), - Decoration(SpvDecorationNonWritable), Decoration(SpvDecorationRestrict)}; - - // Decoration group is applied to id 1, 2, 3, and 4. Note that id 1 (which is - // the decoration group id) also has all the decorations. - EXPECT_THAT(vstate_->id_decorations(1), Eq(expected_decorations)); - EXPECT_THAT(vstate_->id_decorations(2), Eq(expected_decorations)); - EXPECT_THAT(vstate_->id_decorations(3), Eq(expected_decorations)); - EXPECT_THAT(vstate_->id_decorations(4), Eq(expected_decorations)); -} - -TEST_F(ValidateDecorations, ValidateGroupMemberDecorateRegistration) { - string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpDecorate %1 Offset 3 - %1 = OpDecorationGroup - OpGroupMemberDecorate %1 %_struct_1 3 %_struct_2 3 %_struct_3 3 - %float = OpTypeFloat 32 -%_runtimearr = OpTypeRuntimeArray %float - %_struct_1 = OpTypeStruct %float %float %float %_runtimearr - %_struct_2 = OpTypeStruct %float %float %float %_runtimearr - %_struct_3 = OpTypeStruct %float %float %float %_runtimearr - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); - // Decoration group has 1 decoration. - auto expected_decorations = - vector{Decoration(SpvDecorationOffset, {3}, 3)}; - - // Decoration group is applied to id 2, 3, and 4. - EXPECT_THAT(vstate_->id_decorations(2), Eq(expected_decorations)); - EXPECT_THAT(vstate_->id_decorations(3), Eq(expected_decorations)); - EXPECT_THAT(vstate_->id_decorations(4), Eq(expected_decorations)); -} - -TEST_F(ValidateDecorations, LinkageImportUsedForInitializedVariableBad) { - string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpDecorate %target LinkageAttributes "link_ptr" Import - %float = OpTypeFloat 32 - %_ptr_float = OpTypePointer Uniform %float - %zero = OpConstantNull %float - %target = OpVariable %_ptr_float Uniform %zero - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateAndRetrieveValidationState()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("A module-scope OpVariable with initialization value " - "cannot be marked with the Import Linkage Type.")); -} -TEST_F(ValidateDecorations, LinkageExportUsedForInitializedVariableGood) { - string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpDecorate %target LinkageAttributes "link_ptr" Export - %float = OpTypeFloat 32 - %_ptr_float = OpTypePointer Uniform %float - %zero = OpConstantNull %float - %target = OpVariable %_ptr_float Uniform %zero - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); -} - -TEST_F(ValidateDecorations, StructAllMembersHaveBuiltInDecorationsGood) { - string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpMemberDecorate %_struct_1 0 BuiltIn Position - OpMemberDecorate %_struct_1 1 BuiltIn Position - OpMemberDecorate %_struct_1 2 BuiltIn Position - OpMemberDecorate %_struct_1 3 BuiltIn Position - %float = OpTypeFloat 32 -%_runtimearr = OpTypeRuntimeArray %float - %_struct_1 = OpTypeStruct %float %float %float %_runtimearr - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); -} - -TEST_F(ValidateDecorations, MixedBuiltInDecorationsBad) { - string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpMemberDecorate %_struct_1 0 BuiltIn Position - OpMemberDecorate %_struct_1 1 BuiltIn Position - %float = OpTypeFloat 32 -%_runtimearr = OpTypeRuntimeArray %float - %_struct_1 = OpTypeStruct %float %float %float %_runtimearr - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateAndRetrieveValidationState()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("When BuiltIn decoration is applied to a structure-type " - "member, all members of that structure type must also be " - "decorated with BuiltIn (No allowed mixing of built-in " - "variables and non-built-in variables within a single " - "structure). Structure id 1 does not meet this requirement.")); -} - -TEST_F(ValidateDecorations, StructContainsBuiltInStructBad) { - string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpMemberDecorate %_struct_1 0 BuiltIn Position - OpMemberDecorate %_struct_1 1 BuiltIn Position - OpMemberDecorate %_struct_1 2 BuiltIn Position - OpMemberDecorate %_struct_1 3 BuiltIn Position - %float = OpTypeFloat 32 -%_runtimearr = OpTypeRuntimeArray %float - %_struct_1 = OpTypeStruct %float %float %float %_runtimearr - %_struct_2 = OpTypeStruct %_struct_1 - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateAndRetrieveValidationState()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Structure 1 contains members with BuiltIn " - "decoration. Therefore this structure may not be " - "contained as a member of another structure type. " - "Structure 4 contains structure 1.")); -} - -TEST_F(ValidateDecorations, StructContainsNonBuiltInStructGood) { - string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - %float = OpTypeFloat 32 - %_struct_1 = OpTypeStruct %float - %_struct_2 = OpTypeStruct %_struct_1 - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); -} - -TEST_F(ValidateDecorations, MultipleBuiltInObjectsConsumedByOpEntryPointBad) { - string spirv = R"( - OpCapability Shader - OpCapability Geometry - OpMemoryModel Logical GLSL450 - OpEntryPoint Geometry %main "main" %in_1 %in_2 - OpMemberDecorate %struct_1 0 BuiltIn InvocationId - OpMemberDecorate %struct_2 0 BuiltIn Position - %int = OpTypeInt 32 1 - %void = OpTypeVoid - %func = OpTypeFunction %void - %float = OpTypeFloat 32 - %struct_1 = OpTypeStruct %int - %struct_2 = OpTypeStruct %float -%ptr_builtin_1 = OpTypePointer Input %struct_1 -%ptr_builtin_2 = OpTypePointer Input %struct_2 -%in_1 = OpVariable %ptr_builtin_1 Input -%in_2 = OpVariable %ptr_builtin_2 Input - %main = OpFunction %void None %func - %5 = OpLabel - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateAndRetrieveValidationState()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("There must be at most one object per Storage Class " - "that can contain a structure type containing members " - "decorated with BuiltIn, consumed per entry-point.")); -} - -TEST_F(ValidateDecorations, - OneBuiltInObjectPerStorageClassConsumedByOpEntryPointGood) { - string spirv = R"( - OpCapability Shader - OpCapability Geometry - OpMemoryModel Logical GLSL450 - OpEntryPoint Geometry %main "main" %in_1 %out_1 - OpMemberDecorate %struct_1 0 BuiltIn InvocationId - OpMemberDecorate %struct_2 0 BuiltIn Position - %int = OpTypeInt 32 1 - %void = OpTypeVoid - %func = OpTypeFunction %void - %float = OpTypeFloat 32 - %struct_1 = OpTypeStruct %int - %struct_2 = OpTypeStruct %float -%ptr_builtin_1 = OpTypePointer Input %struct_1 -%ptr_builtin_2 = OpTypePointer Output %struct_2 -%in_1 = OpVariable %ptr_builtin_1 Input -%out_1 = OpVariable %ptr_builtin_2 Output - %main = OpFunction %void None %func - %5 = OpLabel - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); -} - -TEST_F(ValidateDecorations, NoBuiltInObjectsConsumedByOpEntryPointGood) { - string spirv = R"( - OpCapability Shader - OpCapability Geometry - OpMemoryModel Logical GLSL450 - OpEntryPoint Geometry %main "main" %in_1 %out_1 - %int = OpTypeInt 32 1 - %void = OpTypeVoid - %func = OpTypeFunction %void - %float = OpTypeFloat 32 - %struct_1 = OpTypeStruct %int - %struct_2 = OpTypeStruct %float -%ptr_builtin_1 = OpTypePointer Input %struct_1 -%ptr_builtin_2 = OpTypePointer Output %struct_2 -%in_1 = OpVariable %ptr_builtin_1 Input -%out_1 = OpVariable %ptr_builtin_2 Output - %main = OpFunction %void None %func - %5 = OpLabel - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); -} - -TEST_F(ValidateDecorations, EntryPointFunctionHasLinkageAttributeBad) { - string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %main "main" - OpDecorate %main LinkageAttributes "import_main" Import -%1 = OpTypeVoid -%2 = OpTypeFunction %1 -%main = OpFunction %1 None %2 -%4 = OpLabel - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("The LinkageAttributes Decoration (Linkage name: import_main) " - "cannot be applied to function id 1 because it is targeted by " - "an OpEntryPoint instruction.")); -} - -TEST_F(ValidateDecorations, FunctionDeclarationWithoutImportLinkageBad) { - string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - %void = OpTypeVoid - %func = OpTypeFunction %void - %main = OpFunction %void None %func - OpFunctionEnd - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateAndRetrieveValidationState()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("Function declaration (id 3) must have a LinkageAttributes " - "decoration with the Import Linkage type.")); -} - -TEST_F(ValidateDecorations, FunctionDeclarationWithImportLinkageGood) { - string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpDecorate %main LinkageAttributes "link_fn" Import - %void = OpTypeVoid - %func = OpTypeFunction %void - %main = OpFunction %void None %func - OpFunctionEnd - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); -} - -TEST_F(ValidateDecorations, FunctionDeclarationWithExportLinkageBad) { - string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpDecorate %main LinkageAttributes "link_fn" Export - %void = OpTypeVoid - %func = OpTypeFunction %void - %main = OpFunction %void None %func - OpFunctionEnd - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateAndRetrieveValidationState()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("Function declaration (id 1) must have a LinkageAttributes " - "decoration with the Import Linkage type.")); -} - -TEST_F(ValidateDecorations, FunctionDefinitionWithImportLinkageBad) { - string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpDecorate %main LinkageAttributes "link_fn" Import - %void = OpTypeVoid - %func = OpTypeFunction %void - %main = OpFunction %void None %func - %label = OpLabel - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateAndRetrieveValidationState()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Function definition (id 1) may not be decorated with " - "Import Linkage type.")); -} - -TEST_F(ValidateDecorations, FunctionDefinitionWithoutImportLinkageGood) { - string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - %void = OpTypeVoid - %func = OpTypeFunction %void - %main = OpFunction %void None %func - %label = OpLabel - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); -} - -} // anonymous namespace - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_extensions_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_extensions_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_extensions_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_extensions_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Tests for OpExtension validator rules. - -#include - -#include "enum_string_mapping.h" -#include "extensions.h" -#include "gmock/gmock.h" -#include "test_fixture.h" -#include "unit_spirv.h" -#include "val_fixtures.h" - -namespace { - -using ::libspirv::Extension; - -using ::testing::HasSubstr; -using ::testing::Not; -using ::testing::Values; - -using std::string; - -using ValidateKnownExtensions = spvtest::ValidateBase; -using ValidateUnknownExtensions = spvtest::ValidateBase; -using ValidateExtensionCapabilities = spvtest::ValidateBase; - -// Returns expected error string if |extension| is not recognized. -string GetErrorString(const std::string& extension) { - return "Found unrecognized extension " + extension; -} - -INSTANTIATE_TEST_CASE_P(ExpectSuccess, ValidateKnownExtensions, Values( - // Match the order as published on the SPIR-V Registry. - "SPV_AMD_shader_explicit_vertex_parameter", - "SPV_AMD_shader_trinary_minmax", - "SPV_AMD_gcn_shader", - "SPV_KHR_shader_ballot", - "SPV_AMD_shader_ballot", - "SPV_AMD_gpu_shader_half_float", - "SPV_KHR_shader_draw_parameters", - "SPV_KHR_subgroup_vote", - "SPV_KHR_16bit_storage", - "SPV_KHR_device_group", - "SPV_KHR_multiview", - "SPV_NVX_multiview_per_view_attributes", - "SPV_NV_viewport_array2", - "SPV_NV_stereo_view_rendering", - "SPV_NV_sample_mask_override_coverage", - "SPV_NV_geometry_shader_passthrough", - "SPV_AMD_texture_gather_bias_lod", - "SPV_KHR_storage_buffer_storage_class", - "SPV_KHR_variable_pointers", - "SPV_AMD_gpu_shader_int16", - "SPV_KHR_post_depth_coverage", - "SPV_KHR_shader_atomic_counter_ops", - "SPV_EXT_shader_stencil_export", - "SPV_EXT_shader_viewport_index_layer", - "SPV_AMD_shader_image_load_store_lod", - "SPV_AMD_shader_fragment_mask" - )); - -INSTANTIATE_TEST_CASE_P(FailSilently, ValidateUnknownExtensions, Values( - "ERROR_unknown_extension", - "SPV_KHR_", - "SPV_KHR_shader_ballot_ERROR" - )); - -TEST_P(ValidateKnownExtensions, ExpectSuccess) { - const std::string extension = GetParam(); - const string str = - "OpCapability Shader\nOpCapability Linkage\nOpExtension \"" + extension + - "\"\nOpMemoryModel Logical GLSL450"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), Not(HasSubstr(GetErrorString(extension)))); -} - -TEST_P(ValidateUnknownExtensions, FailSilently) { - const std::string extension = GetParam(); - const string str = - "OpCapability Shader\nOpCapability Linkage\nOpExtension \"" + extension + - "\"\nOpMemoryModel Logical GLSL450"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(extension))); -} - -TEST_F(ValidateExtensionCapabilities, DeclCapabilitySuccess) { - const string str = - "OpCapability Shader\nOpCapability Linkage\nOpCapability DeviceGroup\n" - "OpExtension \"SPV_KHR_device_group\"" - "\nOpMemoryModel Logical GLSL450"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateExtensionCapabilities, DeclCapabilityFailure) { - const string str = - "OpCapability Shader\nOpCapability Linkage\nOpCapability DeviceGroup\n" - "\nOpMemoryModel Logical GLSL450"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_ERROR_MISSING_EXTENSION, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("1st operand of Capability")); - EXPECT_THAT(getDiagnosticString(), HasSubstr("requires one of these extensions")); - EXPECT_THAT(getDiagnosticString(), HasSubstr("SPV_KHR_device_group")); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_fixtures.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_fixtures.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_fixtures.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_fixtures.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,110 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Common validation fixtures for unit tests - -#include "val_fixtures.h" - -#include -#include -#include - -#include "test_fixture.h" - -namespace spvtest { - -template -ValidateBase::ValidateBase() : binary_(), diagnostic_() { - // Initialize to default command line options. Different tests can then - // specialize specific options as necessary. - options_ = spvValidatorOptionsCreate(); -} - -template -spv_const_binary ValidateBase::get_const_binary() { - return spv_const_binary(binary_); -} - -template -void ValidateBase::TearDown() { - if (diagnostic_) { - spvDiagnosticPrint(diagnostic_); - } - spvDiagnosticDestroy(diagnostic_); - spvBinaryDestroy(binary_); - spvValidatorOptionsDestroy(options_); -} - -template -void ValidateBase::CompileSuccessfully(std::string code, - spv_target_env env) { - spv_diagnostic diagnostic = nullptr; - ASSERT_EQ(SPV_SUCCESS, - spvTextToBinary(ScopedContext(env).context, code.c_str(), - code.size(), &binary_, &diagnostic)) - << "ERROR: " << diagnostic->error - << "\nSPIR-V could not be compiled into binary:\n" - << code; -} - -template -void ValidateBase::OverwriteAssembledBinary(uint32_t index, uint32_t word) { - ASSERT_TRUE(index < binary_->wordCount) - << "OverwriteAssembledBinary: The given index is larger than the binary " - "word count."; - binary_->code[index] = word; -} - -template -spv_result_t ValidateBase::ValidateInstructions(spv_target_env env) { - return spvValidateWithOptions(ScopedContext(env).context, options_, - get_const_binary(), &diagnostic_); -} - -template -spv_result_t ValidateBase::ValidateAndRetrieveValidationState( - spv_target_env env) { - return spvtools::ValidateBinaryAndKeepValidationState( - ScopedContext(env).context, options_, get_const_binary()->code, - get_const_binary()->wordCount, &diagnostic_, &vstate_); -} - -template -std::string ValidateBase::getDiagnosticString() { - return diagnostic_ == nullptr ? - std::string() : std::string(diagnostic_->error); -} - -template -spv_validator_options ValidateBase::getValidatorOptions() { - return options_; -} - -template -spv_position_t ValidateBase::getErrorPosition() { - return diagnostic_ == nullptr ? spv_position_t() : diagnostic_->position; -} - -template class spvtest::ValidateBase; -template class spvtest::ValidateBase; -template class spvtest::ValidateBase; -template class spvtest::ValidateBase>; -template class spvtest::ValidateBase< - std::tuple>>>; -template class spvtest::ValidateBase< - std::tuple, - std::function>>>; -template class spvtest::ValidateBase; -template class spvtest::ValidateBase>; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_fixtures.h vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_fixtures.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_fixtures.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_fixtures.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Common validation fixtures for unit tests - -#ifndef LIBSPIRV_TEST_VALIDATE_FIXTURES_H_ -#define LIBSPIRV_TEST_VALIDATE_FIXTURES_H_ - -#include "unit_spirv.h" -#include "source/val/validation_state.h" - -namespace spvtest { - -template -class ValidateBase : public ::testing::Test, - public ::testing::WithParamInterface { - public: - ValidateBase(); - - virtual void TearDown(); - - // Returns the a spv_const_binary struct - spv_const_binary get_const_binary(); - - void CompileSuccessfully(std::string code, - spv_target_env env = SPV_ENV_UNIVERSAL_1_0); - - // Overwrites the word at index 'index' with the given word. - // For testing purposes, it is often useful to be able to manipulate the - // assembled binary before running the validator on it. - // This function overwrites the word at the given index with a new word. - void OverwriteAssembledBinary(uint32_t index, uint32_t word); - - // Performs validation on the SPIR-V code and compares the result of the - // spvValidate function - spv_result_t ValidateInstructions(spv_target_env env = SPV_ENV_UNIVERSAL_1_0); - - // Performs validation. Returns the status and stores validation state into - // the vstate_ member. - spv_result_t ValidateAndRetrieveValidationState( - spv_target_env env = SPV_ENV_UNIVERSAL_1_0); - - std::string getDiagnosticString(); - spv_position_t getErrorPosition(); - spv_validator_options getValidatorOptions(); - - spv_binary binary_; - spv_diagnostic diagnostic_; - spv_validator_options options_; - std::unique_ptr vstate_; -}; -} -#endif diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_id_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_id_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_id_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_id_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,4246 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include - -#include "gmock/gmock.h" -#include "test_fixture.h" -#include "unit_spirv.h" -#include "val_fixtures.h" - -// NOTE: The tests in this file are ONLY testing ID usage, there for the input -// SPIR-V does not follow the logical layout rules from the spec in all cases in -// order to makes the tests smaller. Validation of the whole module is handled -// in stages, ID validation is only one of these stages. All validation stages -// are stand alone. - -namespace { - -using ::testing::ValuesIn; -using ::testing::HasSubstr; -using spvtest::ScopedContext; -using std::ostringstream; -using std::string; -using std::vector; - -using ValidateIdWithMessage = spvtest::ValidateBase; - -string kGLSL450MemoryModel = R"( - OpCapability Shader - OpCapability Linkage - OpCapability Addresses - OpCapability Pipes - OpCapability LiteralSampler - OpCapability DeviceEnqueue - OpCapability Vector16 - OpCapability Int8 - OpCapability Int16 - OpCapability Int64 - OpCapability Float64 - OpMemoryModel Logical GLSL450 -)"; - -string kOpenCLMemoryModel32 = R"( - OpCapability Addresses - OpCapability Linkage - OpCapability Kernel -%1 = OpExtInstImport "OpenCL.std" - OpMemoryModel Physical32 OpenCL -)"; - -string kOpenCLMemoryModel64 = R"( - OpCapability Addresses - OpCapability Linkage - OpCapability Kernel - OpCapability Int64 -%1 = OpExtInstImport "OpenCL.std" - OpMemoryModel Physical64 OpenCL -)"; - -string sampledImageSetup = R"( - %void = OpTypeVoid - %typeFuncVoid = OpTypeFunction %void - %float = OpTypeFloat 32 - %v4float = OpTypeVector %float 4 - %image_type = OpTypeImage %float 2D 0 0 0 1 Unknown -%_ptr_UniformConstant_img = OpTypePointer UniformConstant %image_type - %tex = OpVariable %_ptr_UniformConstant_img UniformConstant - %sampler_type = OpTypeSampler -%_ptr_UniformConstant_sam = OpTypePointer UniformConstant %sampler_type - %s = OpVariable %_ptr_UniformConstant_sam UniformConstant - %sampled_image_type = OpTypeSampledImage %image_type - %v2float = OpTypeVector %float 2 - %float_1 = OpConstant %float 1 - %float_2 = OpConstant %float 2 - %const_vec_1_1 = OpConstantComposite %v2float %float_1 %float_1 - %const_vec_2_2 = OpConstantComposite %v2float %float_2 %float_2 - %bool_type = OpTypeBool - %spec_true = OpSpecConstantTrue %bool_type - %main = OpFunction %void None %typeFuncVoid - %label_1 = OpLabel - %image_inst = OpLoad %image_type %tex - %sampler_inst = OpLoad %sampler_type %s -)"; - -// TODO: OpUndef - -TEST_F(ValidateIdWithMessage, OpName) { - string spirv = kGLSL450MemoryModel + R"( - OpName %2 "name" -%1 = OpTypeInt 32 0 -%2 = OpTypePointer UniformConstant %1 -%3 = OpVariable %2 UniformConstant)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpMemberNameGood) { - string spirv = kGLSL450MemoryModel + R"( - OpMemberName %2 0 "foo" -%1 = OpTypeInt 32 0 -%2 = OpTypeStruct %1)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpMemberNameTypeBad) { - string spirv = kGLSL450MemoryModel + R"( - OpMemberName %1 0 "foo" -%1 = OpTypeInt 32 0)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpMemberName Type '1' is not a struct type.")); -} -TEST_F(ValidateIdWithMessage, OpMemberNameMemberBad) { - string spirv = kGLSL450MemoryModel + R"( - OpMemberName %1 1 "foo" -%2 = OpTypeInt 32 0 -%1 = OpTypeStruct %2)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpMemberName Member '1' index is larger than " - "Type '1's member count.")); -} - -TEST_F(ValidateIdWithMessage, OpLineGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpString "/path/to/source.file" - OpLine %1 0 0 -%2 = OpTypeInt 32 0 -%3 = OpTypePointer Input %2 -%4 = OpVariable %3 Input)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpLineFileBad) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeInt 32 0 - OpLine %1 0 0 - )"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpLine Target '1' is not an OpString.")); -} - -TEST_F(ValidateIdWithMessage, OpDecorateGood) { - string spirv = kGLSL450MemoryModel + R"( - OpDecorate %2 GLSLShared -%1 = OpTypeInt 64 0 -%2 = OpTypeStruct %1 %1)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpDecorateBad) { - string spirv = kGLSL450MemoryModel + R"( -OpDecorate %1 GLSLShared)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("forward referenced IDs have not been defined")); -} - -TEST_F(ValidateIdWithMessage, OpMemberDecorateGood) { - string spirv = kGLSL450MemoryModel + R"( - OpMemberDecorate %2 0 Uniform -%1 = OpTypeInt 32 0 -%2 = OpTypeStruct %1 %1)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpMemberDecorateBad) { - string spirv = kGLSL450MemoryModel + R"( - OpMemberDecorate %1 0 Uniform -%1 = OpTypeInt 32 0)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "OpMemberDecorate Structure type '1' is not a struct type.")); -} -TEST_F(ValidateIdWithMessage, OpMemberDecorateMemberBad) { - string spirv = kGLSL450MemoryModel + R"( - OpMemberDecorate %1 3 Uniform -%int = OpTypeInt 32 0 -%1 = OpTypeStruct %int %int)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Index 3 provided in OpMemberDecorate for struct " - "1 is out of bounds. The structure has 2 members. " - "Largest valid index is 1.")); -} - -TEST_F(ValidateIdWithMessage, OpGroupDecorateGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpDecorationGroup - OpDecorate %1 Uniform - OpDecorate %1 GLSLShared - OpGroupDecorate %1 %3 %4 -%2 = OpTypeInt 32 0 -%3 = OpConstant %2 42 -%4 = OpConstant %2 23)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpGroupDecorateDecorationGroupBad) { - string spirv = R"( - OpCapability Shader - OpCapability Linkage - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpGroupDecorate %1 %2 %3 -%2 = OpTypeInt 32 0 -%3 = OpConstant %2 42)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpGroupDecorate Decoration group '1' is not a " - "decoration group.")); -} -TEST_F(ValidateIdWithMessage, OpGroupDecorateTargetBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpDecorationGroup - OpDecorate %1 Uniform - OpDecorate %1 GLSLShared - OpGroupDecorate %1 %3 -%2 = OpTypeInt 32 0)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("forward referenced IDs have not been defined")); -} -TEST_F(ValidateIdWithMessage, OpGroupMemberDecorateDecorationGroupBad) { - string spirv = R"( - OpCapability Shader - OpCapability Linkage - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpGroupMemberDecorate %1 %2 0 -%2 = OpTypeInt 32 0)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpGroupMemberDecorate Decoration group '1' is " - "not a decoration group.")); -} -TEST_F(ValidateIdWithMessage, OpGroupMemberDecorateIdNotStructBad) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpDecorationGroup - OpGroupMemberDecorate %1 %2 0 -%2 = OpTypeInt 32 0)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpGroupMemberDecorate Structure type '2' is not " - "a struct type.")); -} -TEST_F(ValidateIdWithMessage, OpGroupMemberDecorateIndexOutOfBoundBad) { - string spirv = kGLSL450MemoryModel + R"( - OpDecorate %1 Offset 0 - %1 = OpDecorationGroup - OpGroupMemberDecorate %1 %struct 3 -%float = OpTypeFloat 32 -%struct = OpTypeStruct %float %float %float -)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Index 3 provided in OpGroupMemberDecorate for struct " - " 2 is out of bounds. The structure has 3 members. " - "Largest valid index is 2.")); -} - -// TODO: OpExtInst - -TEST_F(ValidateIdWithMessage, OpEntryPointGood) { - string spirv = kGLSL450MemoryModel + R"( - OpEntryPoint GLCompute %3 "" -%1 = OpTypeVoid -%2 = OpTypeFunction %1 -%3 = OpFunction %1 None %2 -%4 = OpLabel - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpEntryPointFunctionBad) { - string spirv = kGLSL450MemoryModel + R"( - OpEntryPoint GLCompute %1 "" -%1 = OpTypeVoid)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpEntryPoint Entry Point '1' is not a function.")); -} -TEST_F(ValidateIdWithMessage, OpEntryPointParameterCountBad) { - string spirv = kGLSL450MemoryModel + R"( - OpEntryPoint GLCompute %3 "" -%1 = OpTypeVoid -%2 = OpTypeFunction %1 %1 -%3 = OpFunction %1 None %2 -%4 = OpLabel - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpEntryPoint Entry Point '1's function parameter " - "count is not zero")); -} -TEST_F(ValidateIdWithMessage, OpEntryPointReturnTypeBad) { - string spirv = kGLSL450MemoryModel + R"( - OpEntryPoint GLCompute %3 "" -%1 = OpTypeInt 32 0 -%ret = OpConstant %1 0 -%2 = OpTypeFunction %1 -%3 = OpFunction %1 None %2 -%4 = OpLabel - OpReturnValue %ret - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpEntryPoint Entry Point '1's function return " - "type is not void.")); -} - -TEST_F(ValidateIdWithMessage, OpEntryPointInterfaceIsNotVariableTypeBad) { - string spirv = R"( - OpCapability Shader - OpCapability Geometry - OpMemoryModel Logical GLSL450 - OpEntryPoint Geometry %main "main" %ptr_builtin_1 - OpMemberDecorate %struct_1 0 BuiltIn InvocationId - %int = OpTypeInt 32 1 - %void = OpTypeVoid - %func = OpTypeFunction %void - %struct_1 = OpTypeStruct %int -%ptr_builtin_1 = OpTypePointer Input %struct_1 - %main = OpFunction %void None %func - %5 = OpLabel - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Interfaces passed to OpEntryPoint must be of type " - "OpTypeVariable. Found OpTypePointer.")); -} - - -TEST_F(ValidateIdWithMessage, OpEntryPointInterfaceStorageClassBad) { - string spirv = R"( - OpCapability Shader - OpCapability Geometry - OpMemoryModel Logical GLSL450 - OpEntryPoint Geometry %main "main" %in_1 - OpMemberDecorate %struct_1 0 BuiltIn InvocationId - %int = OpTypeInt 32 1 - %void = OpTypeVoid - %func = OpTypeFunction %void - %struct_1 = OpTypeStruct %int -%ptr_builtin_1 = OpTypePointer Uniform %struct_1 - %in_1 = OpVariable %ptr_builtin_1 Uniform - %main = OpFunction %void None %func - %5 = OpLabel - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpEntryPoint interfaces must be OpVariables with " - "Storage Class of Input(1) or Output(3). Found Storage " - "Class 2 for Entry Point id 1.")); -} - -TEST_F(ValidateIdWithMessage, OpExecutionModeGood) { - string spirv = kGLSL450MemoryModel + R"( - OpEntryPoint GLCompute %3 "" - OpExecutionMode %3 LocalSize 1 1 1 -%1 = OpTypeVoid -%2 = OpTypeFunction %1 -%3 = OpFunction %1 None %2 -%4 = OpLabel - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpExecutionModeEntryPointMissing) { - string spirv = kGLSL450MemoryModel + R"( - OpExecutionMode %3 LocalSize 1 1 1 -%1 = OpTypeVoid -%2 = OpTypeFunction %1 -%3 = OpFunction %1 None %2 -%4 = OpLabel - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpExecutionMode Entry Point '1' is not the Entry " - "Point operand of an OpEntryPoint.")); -} - -TEST_F(ValidateIdWithMessage, OpExecutionModeEntryPointBad) { - string spirv = kGLSL450MemoryModel + R"( - OpEntryPoint GLCompute %3 "" %a - OpExecutionMode %a LocalSize 1 1 1 -%void = OpTypeVoid -%ptr = OpTypePointer Input %void -%a = OpVariable %ptr Input -%2 = OpTypeFunction %void -%3 = OpFunction %void None %2 -%4 = OpLabel - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpExecutionMode Entry Point '2' is not the Entry " - "Point operand of an OpEntryPoint.")); -} - -TEST_F(ValidateIdWithMessage, OpTypeVectorFloat) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpTypeVectorInt) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeVector %1 4)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpTypeVectorUInt) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 64 0 -%2 = OpTypeVector %1 4)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpTypeVectorBool) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeBool -%2 = OpTypeVector %1 4)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpTypeVectorComponentTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeFloat 32 -%2 = OpTypePointer UniformConstant %1 -%3 = OpTypeVector %2 4)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpTypeVector Component Type '2' is not a scalar type.")); -} - -TEST_F(ValidateIdWithMessage, OpTypeMatrixGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 2 -%3 = OpTypeMatrix %2 3)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpTypeMatrixColumnTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeMatrix %1 3)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Columns in a matrix must be of type vector.")); -} - -TEST_F(ValidateIdWithMessage, OpTypeSamplerGood) { - // In Rev31, OpTypeSampler takes no arguments. - string spirv = kGLSL450MemoryModel + R"( -%s = OpTypeSampler)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpTypeArrayGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpConstant %1 1 -%3 = OpTypeArray %1 %2)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpTypeArrayElementTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpConstant %1 1 -%3 = OpTypeArray %2 %2)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpTypeArray Element Type '2' is not a type.")); -} - -// Signed or unsigned. -enum Signed { kSigned, kUnsigned }; - -// Creates an assembly snippet declaring OpTypeArray with the given length. -string MakeArrayLength(const string& len, Signed isSigned, int width) { - ostringstream ss; - ss << R"( - OpCapability Shader - OpCapability Linkage - OpCapability Int16 - OpCapability Int64 - )"; - ss << "OpMemoryModel Logical GLSL450\n"; - ss << " %t = OpTypeInt " << width << (isSigned == kSigned ? " 1" : " 0"); - ss << " %l = OpConstant %t " << len; - ss << " %a = OpTypeArray %t %l"; - return ss.str(); -} - -// Tests OpTypeArray. Parameter is the width (in bits) of the array-length's -// type. -class OpTypeArrayLengthTest - : public spvtest::TextToBinaryTestBase<::testing::TestWithParam> { - protected: - OpTypeArrayLengthTest() - : position_(spv_position_t{0, 0, 0}), - diagnostic_(spvDiagnosticCreate(&position_, "")) {} - - ~OpTypeArrayLengthTest() { spvDiagnosticDestroy(diagnostic_); } - - // Runs spvValidate() on v, printing any errors via spvDiagnosticPrint(). - spv_result_t Val(const SpirvVector& v, const std::string &expected_err = "") { - spv_const_binary_t cbinary{v.data(), v.size()}; - const auto status = - spvValidate(ScopedContext().context, &cbinary, &diagnostic_); - if (status != SPV_SUCCESS) { - spvDiagnosticPrint(diagnostic_); - EXPECT_THAT(std::string(diagnostic_->error), HasSubstr(expected_err)); - } - return status; - } - - private: - spv_position_t position_; // For creating diagnostic_. - spv_diagnostic diagnostic_; -}; - -TEST_P(OpTypeArrayLengthTest, LengthPositive) { - const int width = GetParam(); - EXPECT_EQ(SPV_SUCCESS, - Val(CompileSuccessfully(MakeArrayLength("1", kSigned, width)))); - EXPECT_EQ(SPV_SUCCESS, - Val(CompileSuccessfully(MakeArrayLength("1", kUnsigned, width)))); - EXPECT_EQ(SPV_SUCCESS, - Val(CompileSuccessfully(MakeArrayLength("2", kSigned, width)))); - EXPECT_EQ(SPV_SUCCESS, - Val(CompileSuccessfully(MakeArrayLength("2", kUnsigned, width)))); - EXPECT_EQ(SPV_SUCCESS, - Val(CompileSuccessfully(MakeArrayLength("55", kSigned, width)))); - EXPECT_EQ(SPV_SUCCESS, - Val(CompileSuccessfully(MakeArrayLength("55", kUnsigned, width)))); - const string fpad(width / 4 - 1, 'F'); - EXPECT_EQ( - SPV_SUCCESS, - Val(CompileSuccessfully(MakeArrayLength("0x7" + fpad, kSigned, width)))); - EXPECT_EQ(SPV_SUCCESS, Val(CompileSuccessfully( - MakeArrayLength("0xF" + fpad, kUnsigned, width)))); -} - -TEST_P(OpTypeArrayLengthTest, LengthZero) { - const int width = GetParam(); - EXPECT_EQ( - SPV_ERROR_INVALID_ID, - Val(CompileSuccessfully(MakeArrayLength("0", kSigned, width)), - "OpTypeArray Length '2' default value must be at least 1.")); - EXPECT_EQ( - SPV_ERROR_INVALID_ID, - Val(CompileSuccessfully(MakeArrayLength("0", kUnsigned, width)), - "OpTypeArray Length '2' default value must be at least 1.")); -} - -TEST_P(OpTypeArrayLengthTest, LengthNegative) { - const int width = GetParam(); - EXPECT_EQ( - SPV_ERROR_INVALID_ID, - Val(CompileSuccessfully(MakeArrayLength("-1", kSigned, width)), - "OpTypeArray Length '2' default value must be at least 1.")); - EXPECT_EQ( - SPV_ERROR_INVALID_ID, - Val(CompileSuccessfully(MakeArrayLength("-2", kSigned, width)), - "OpTypeArray Length '2' default value must be at least 1.")); - EXPECT_EQ( - SPV_ERROR_INVALID_ID, - Val(CompileSuccessfully(MakeArrayLength("-123", kSigned, width)), - "OpTypeArray Length '2' default value must be at least 1.")); - const string neg_max = "0x8" + string(width / 4 - 1, '0'); - EXPECT_EQ( - SPV_ERROR_INVALID_ID, - Val(CompileSuccessfully(MakeArrayLength(neg_max, kSigned, width)), - "OpTypeArray Length '2' default value must be at least 1.")); -} - -// The only valid widths for integers are 8, 16, 32, and 64. -// Since the Int8 capability requires the Kernel capability, and the Kernel -// capability prohibits usage of signed integers, we can skip 8-bit integers -// here since the purpose of these tests is to check the validity of -// OpTypeArray, not OpTypeInt. -INSTANTIATE_TEST_CASE_P(Widths, OpTypeArrayLengthTest, - ValuesIn(vector{16, 32, 64})); - -TEST_F(ValidateIdWithMessage, OpTypeArrayLengthNull) { - string spirv = kGLSL450MemoryModel + R"( -%i32 = OpTypeInt 32 0 -%len = OpConstantNull %i32 -%ary = OpTypeArray %i32 %len)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "OpTypeArray Length '2' default value must be at least 1.")); -} - -TEST_F(ValidateIdWithMessage, OpTypeArrayLengthSpecConst) { - string spirv = kGLSL450MemoryModel + R"( -%i32 = OpTypeInt 32 0 -%len = OpSpecConstant %i32 2 -%ary = OpTypeArray %i32 %len)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpTypeArrayLengthSpecConstOp) { - string spirv = kGLSL450MemoryModel + R"( -%i32 = OpTypeInt 32 0 -%c1 = OpConstant %i32 1 -%c2 = OpConstant %i32 2 -%len = OpSpecConstantOp %i32 IAdd %c1 %c2 -%ary = OpTypeArray %i32 %len)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpTypeRuntimeArrayGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeRuntimeArray %1)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpTypeRuntimeArrayBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpConstant %1 0 -%3 = OpTypeRuntimeArray %2)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpTypeRuntimeArray Element Type '2' is not a type.")); -} -// TODO: Object of this type can only be created with OpVariable using the -// Unifrom Storage Class - -TEST_F(ValidateIdWithMessage, OpTypeStructGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeFloat 64 -%3 = OpTypePointer Input %1 -%4 = OpTypeStruct %1 %2 %3)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpTypeStructMemberTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeFloat 64 -%3 = OpConstant %2 0.0 -%4 = OpTypeStruct %1 %2 %3)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpTypeStruct Member Type '3' is not a type.")); -} - -TEST_F(ValidateIdWithMessage, OpTypePointerGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypePointer Input %1)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpTypePointerBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpConstant %1 0 -%3 = OpTypePointer Input %2)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpTypePointer Type '2' is not a type.")); -} - -TEST_F(ValidateIdWithMessage, OpTypeFunctionGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeFunction %1)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpTypeFunctionReturnTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpConstant %1 0 -%3 = OpTypeFunction %2)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpTypeFunction Return Type '2' is not a type.")); -} -TEST_F(ValidateIdWithMessage, OpTypeFunctionParameterBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpConstant %2 0 -%4 = OpTypeFunction %1 %2 %3)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpTypeFunction Parameter Type '3' is not a type.")); -} - -TEST_F(ValidateIdWithMessage, OpTypePipeGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 16 -%3 = OpTypePipe ReadOnly)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpConstantTrueGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeBool -%2 = OpConstantTrue %1)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpConstantTrueBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpConstantTrue %1)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpConstantTrue Result Type '1' is not a boolean type.")); -} - -TEST_F(ValidateIdWithMessage, OpConstantFalseGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeBool -%2 = OpConstantTrue %1)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpConstantFalseBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpConstantFalse %1)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpConstantFalse Result Type '1' is not a boolean type.")); -} - -TEST_F(ValidateIdWithMessage, OpConstantGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpConstant %1 1)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpConstantBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpConstant !1 !0)"; - // The expected failure code is implementation dependent (currently - // INVALID_BINARY because the binary parser catches these cases) and may - // change over time, but this must always fail. - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpConstantCompositeVectorGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%3 = OpConstant %1 3.14 -%4 = OpConstantComposite %2 %3 %3 %3 %3)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpConstantCompositeVectorWithUndefGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%3 = OpConstant %1 3.14 -%9 = OpUndef %1 -%4 = OpConstantComposite %2 %3 %3 %3 %9)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpConstantCompositeVectorResultTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%3 = OpConstant %1 3.14 -%4 = OpConstantComposite %1 %3 %3 %3 %3)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "OpConstantComposite Result Type '1' is not a composite type.")); -} -TEST_F(ValidateIdWithMessage, OpConstantCompositeVectorConstituentTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%4 = OpTypeInt 32 0 -%3 = OpConstant %1 3.14 -%5 = OpConstant %4 42 ; bad type for constant value -%6 = OpConstantComposite %2 %3 %5 %3 %3)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpConstantComposite Constituent '5's type does not match " - "Result Type '2's vector element type.")); -} -TEST_F(ValidateIdWithMessage, - OpConstantCompositeVectorConstituentUndefTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%4 = OpTypeInt 32 0 -%3 = OpConstant %1 3.14 -%5 = OpUndef %4 ; bad type for undef value -%6 = OpConstantComposite %2 %3 %5 %3 %3)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpConstantComposite Constituent '5's type does not match " - "Result Type '2's vector element type.")); -} -TEST_F(ValidateIdWithMessage, OpConstantCompositeMatrixGood) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %3 = OpTypeMatrix %2 4 - %4 = OpConstant %1 1.0 - %5 = OpConstant %1 0.0 - %6 = OpConstantComposite %2 %4 %5 %5 %5 - %7 = OpConstantComposite %2 %5 %4 %5 %5 - %8 = OpConstantComposite %2 %5 %5 %4 %5 - %9 = OpConstantComposite %2 %5 %5 %5 %4 -%10 = OpConstantComposite %3 %6 %7 %8 %9)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpConstantCompositeMatrixUndefGood) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %3 = OpTypeMatrix %2 4 - %4 = OpConstant %1 1.0 - %5 = OpConstant %1 0.0 - %6 = OpConstantComposite %2 %4 %5 %5 %5 - %7 = OpConstantComposite %2 %5 %4 %5 %5 - %8 = OpConstantComposite %2 %5 %5 %4 %5 - %9 = OpUndef %2 -%10 = OpConstantComposite %3 %6 %7 %8 %9)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpConstantCompositeMatrixConstituentTypeBad) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 -%11 = OpTypeVector %1 3 - %3 = OpTypeMatrix %2 4 - %4 = OpConstant %1 1.0 - %5 = OpConstant %1 0.0 - %6 = OpConstantComposite %2 %4 %5 %5 %5 - %7 = OpConstantComposite %2 %5 %4 %5 %5 - %8 = OpConstantComposite %2 %5 %5 %4 %5 - %9 = OpConstantComposite %11 %5 %5 %5 -%10 = OpConstantComposite %3 %6 %7 %8 %9)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpConstantComposite Constituent '10' vector " - "component count does not match Result Type '4's " - "vector component count.")); -} -TEST_F(ValidateIdWithMessage, - OpConstantCompositeMatrixConstituentUndefTypeBad) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 -%11 = OpTypeVector %1 3 - %3 = OpTypeMatrix %2 4 - %4 = OpConstant %1 1.0 - %5 = OpConstant %1 0.0 - %6 = OpConstantComposite %2 %4 %5 %5 %5 - %7 = OpConstantComposite %2 %5 %4 %5 %5 - %8 = OpConstantComposite %2 %5 %5 %4 %5 - %9 = OpUndef %11 -%10 = OpConstantComposite %3 %6 %7 %8 %9)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpConstantComposite Constituent '10' vector " - "component count does not match Result Type '4's " - "vector component count.")); -} -TEST_F(ValidateIdWithMessage, OpConstantCompositeMatrixColumnTypeBad) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeInt 32 0 - %2 = OpTypeFloat 32 - %3 = OpTypeVector %1 2 - %4 = OpTypeVector %3 2 - %5 = OpTypeMatrix %2 2 - %6 = OpConstant %1 42 - %7 = OpConstant %2 3.14 - %8 = OpConstantComposite %3 %6 %6 - %9 = OpConstantComposite %4 %7 %7 -%10 = OpConstantComposite %5 %8 %9)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Columns in a matrix must be of type vector.")); -} -TEST_F(ValidateIdWithMessage, OpConstantCompositeArrayGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpConstant %1 4 -%3 = OpTypeArray %1 %2 -%4 = OpConstantComposite %3 %2 %2 %2 %2)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpConstantCompositeArrayWithUndefGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpConstant %1 4 -%9 = OpUndef %1 -%3 = OpTypeArray %1 %2 -%4 = OpConstantComposite %3 %2 %2 %2 %9)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpConstantCompositeArrayConstConstituentBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpConstant %1 4 -%3 = OpTypeArray %1 %2 -%4 = OpConstantComposite %3 %2 %2 %2 %1)"; // Uses a type as operand - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpConstantComposite Constituent '1' is not a " - "constant or undef.")); -} -TEST_F(ValidateIdWithMessage, OpConstantCompositeArrayConstituentTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpConstant %1 4 -%3 = OpTypeArray %1 %2 -%5 = OpTypeFloat 32 -%6 = OpConstant %5 3.14 ; bad type for const value -%4 = OpConstantComposite %3 %2 %2 %2 %6)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpConstantComposite Constituent '5's type does " - "not match Result Type '3's array element type.")); -} -TEST_F(ValidateIdWithMessage, OpConstantCompositeArrayConstituentUndefTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpConstant %1 4 -%3 = OpTypeArray %1 %2 -%5 = OpTypeFloat 32 -%6 = OpUndef %5 ; bad type for undef -%4 = OpConstantComposite %3 %2 %2 %2 %6)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpConstantComposite Constituent '5's type does " - "not match Result Type '3's array element type.")); -} -TEST_F(ValidateIdWithMessage, OpConstantCompositeStructGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeInt 64 0 -%3 = OpTypeStruct %1 %1 %2 -%4 = OpConstant %1 42 -%5 = OpConstant %2 4300000000 -%6 = OpConstantComposite %3 %4 %4 %5)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpConstantCompositeStructUndefGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeInt 64 0 -%3 = OpTypeStruct %1 %1 %2 -%4 = OpConstant %1 42 -%5 = OpUndef %2 -%6 = OpConstantComposite %3 %4 %4 %5)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpConstantCompositeStructMemberTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeInt 64 0 -%3 = OpTypeStruct %1 %1 %2 -%4 = OpConstant %1 42 -%5 = OpConstant %2 4300000000 -%6 = OpConstantComposite %3 %4 %5 %4)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpConstantComposite Constituent '5' type does " - "not match the Result Type '3's member type.")); -} - -TEST_F(ValidateIdWithMessage, OpConstantCompositeStructMemberUndefTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeInt 64 0 -%3 = OpTypeStruct %1 %1 %2 -%4 = OpConstant %1 42 -%5 = OpUndef %2 -%6 = OpConstantComposite %3 %4 %5 %4)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpConstantComposite Constituent '5' type does " - "not match the Result Type '3's member type.")); -} - -TEST_F(ValidateIdWithMessage, OpConstantSamplerGood) { - string spirv = kGLSL450MemoryModel + R"( -%float = OpTypeFloat 32 -%samplerType = OpTypeSampler -%3 = OpConstantSampler %samplerType ClampToEdge 0 Nearest)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpConstantSamplerResultTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeFloat 32 -%2 = OpConstantSampler %1 Clamp 0 Nearest)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "OpConstantSampler Result Type '1' is not a sampler type.")); -} - -TEST_F(ValidateIdWithMessage, OpConstantNullGood) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeBool - %2 = OpConstantNull %1 - %3 = OpTypeInt 32 0 - %4 = OpConstantNull %3 - %5 = OpTypeFloat 32 - %6 = OpConstantNull %5 - %7 = OpTypePointer UniformConstant %3 - %8 = OpConstantNull %7 - %9 = OpTypeEvent -%10 = OpConstantNull %9 -%11 = OpTypeDeviceEvent -%12 = OpConstantNull %11 -%13 = OpTypeReserveId -%14 = OpConstantNull %13 -%15 = OpTypeQueue -%16 = OpConstantNull %15 -%17 = OpTypeVector %5 2 -%18 = OpConstantNull %17 -%19 = OpTypeMatrix %17 2 -%20 = OpConstantNull %19 -%25 = OpConstant %3 8 -%21 = OpTypeArray %3 %25 -%22 = OpConstantNull %21 -%23 = OpTypeStruct %3 %5 %1 -%24 = OpConstantNull %23 -%26 = OpTypeArray %17 %25 -%27 = OpConstantNull %26 -%28 = OpTypeStruct %7 %26 %26 %1 -%29 = OpConstantNull %28 -)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpConstantNullBasicBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpConstantNull %1)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "OpConstantNull Result Type '1' cannot have a null value.")); -} - -TEST_F(ValidateIdWithMessage, OpConstantNullArrayBad) { - string spirv = kGLSL450MemoryModel + R"( -%2 = OpTypeInt 32 0 -%3 = OpTypeSampler -%4 = OpConstant %2 4 -%5 = OpTypeArray %3 %4 -%6 = OpConstantNull %5)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "OpConstantNull Result Type '4' cannot have a null value.")); -} - -TEST_F(ValidateIdWithMessage, OpConstantNullStructBad) { - string spirv = kGLSL450MemoryModel + R"( -%2 = OpTypeSampler -%3 = OpTypeStruct %2 %2 -%4 = OpConstantNull %3)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "OpConstantNull Result Type '2' cannot have a null value.")); -} - -TEST_F(ValidateIdWithMessage, OpConstantNullRuntimeArrayBad) { - string spirv = kGLSL450MemoryModel + R"( -%bool = OpTypeBool -%array = OpTypeRuntimeArray %bool -%null = OpConstantNull %array)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "OpConstantNull Result Type '2' cannot have a null value.")); -} - -TEST_F(ValidateIdWithMessage, OpSpecConstantTrueGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeBool -%2 = OpSpecConstantTrue %1)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpSpecConstantTrueBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpSpecConstantTrue %1)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Specialization constant must be a boolean type.")); -} - -TEST_F(ValidateIdWithMessage, OpSpecConstantFalseGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeBool -%2 = OpSpecConstantFalse %1)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpSpecConstantFalseBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpSpecConstantFalse %1)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Specialization constant must be a boolean type.")); -} - -TEST_F(ValidateIdWithMessage, OpSpecConstantGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeFloat 32 -%2 = OpSpecConstant %1 42)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpSpecConstantBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpSpecConstant !1 !4)"; - // The expected failure code is implementation dependent (currently - // INVALID_BINARY because the binary parser catches these cases) and may - // change over time, but this must always fail. - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Type Id 1 is not a scalar numeric type")); -} - -// Valid: SpecConstantComposite specializes to a vector. -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeVectorGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%3 = OpSpecConstant %1 3.14 -%4 = OpConstant %1 3.14 -%5 = OpSpecConstantComposite %2 %3 %3 %4 %4)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Valid: Vector of floats and Undefs. -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeVectorWithUndefGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%3 = OpSpecConstant %1 3.14 -%5 = OpConstant %1 3.14 -%9 = OpUndef %1 -%4 = OpSpecConstantComposite %2 %3 %5 %3 %9)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: result type is float. -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeVectorResultTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%3 = OpSpecConstant %1 3.14 -%4 = OpSpecConstantComposite %1 %3 %3 %3 %3)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("is not a composite type")); -} - -// Invalid: Vector contains a mix of Int and Float. -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeVectorConstituentTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%4 = OpTypeInt 32 0 -%3 = OpSpecConstant %1 3.14 -%5 = OpConstant %4 42 ; bad type for constant value -%6 = OpSpecConstantComposite %2 %3 %5 %3 %3)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpSpecConstantComposite Constituent '5's type " - "does not match Result Type '2's vector element " - "type.")); -} - -// Invalid: Constituent is not a constant -TEST_F(ValidateIdWithMessage, - OpSpecConstantCompositeVectorConstituentNotConstantBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%3 = OpTypeInt 32 0 -%4 = OpSpecConstant %1 3.14 -%6 = OpSpecConstantComposite %2 %3 %4 %4 %4)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpSpecConstantComposite Constituent '3' is not a " - "constant or undef.")); -} - -// Invalid: Vector contains a mix of Undef-int and Float. -TEST_F(ValidateIdWithMessage, - OpSpecConstantCompositeVectorConstituentUndefTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 4 -%4 = OpTypeInt 32 0 -%3 = OpSpecConstant %1 3.14 -%5 = OpUndef %4 ; bad type for undef value -%6 = OpSpecConstantComposite %2 %3 %5 %3 %3)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpSpecConstantComposite Constituent '5's type " - "does not match Result Type '2's vector element " - "type.")); -} - -// Invalid: Vector expects 3 components, but 4 specified. -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeVectorNumComponentsBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeFloat 32 -%2 = OpTypeVector %1 3 -%3 = OpConstant %1 3.14 -%5 = OpSpecConstant %1 4.0 -%6 = OpSpecConstantComposite %2 %3 %5 %3 %3)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpSpecConstantComposite Constituent count does " - "not match Result Type '2's vector component " - "count.")); -} - -// Valid: 4x4 matrix of floats -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeMatrixGood) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %3 = OpTypeMatrix %2 4 - %4 = OpConstant %1 1.0 - %5 = OpSpecConstant %1 0.0 - %6 = OpSpecConstantComposite %2 %4 %5 %5 %5 - %7 = OpSpecConstantComposite %2 %5 %4 %5 %5 - %8 = OpSpecConstantComposite %2 %5 %5 %4 %5 - %9 = OpSpecConstantComposite %2 %5 %5 %5 %4 -%10 = OpSpecConstantComposite %3 %6 %7 %8 %9)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Valid: Matrix in which one column is Undef -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeMatrixUndefGood) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %3 = OpTypeMatrix %2 4 - %4 = OpConstant %1 1.0 - %5 = OpSpecConstant %1 0.0 - %6 = OpSpecConstantComposite %2 %4 %5 %5 %5 - %7 = OpSpecConstantComposite %2 %5 %4 %5 %5 - %8 = OpSpecConstantComposite %2 %5 %5 %4 %5 - %9 = OpUndef %2 -%10 = OpSpecConstantComposite %3 %6 %7 %8 %9)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: Matrix in which the sizes of column vectors are not equal. -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeMatrixConstituentTypeBad) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %3 = OpTypeVector %1 3 - %4 = OpTypeMatrix %2 4 - %5 = OpSpecConstant %1 1.0 - %6 = OpConstant %1 0.0 - %7 = OpSpecConstantComposite %2 %5 %6 %6 %6 - %8 = OpSpecConstantComposite %2 %6 %5 %6 %6 - %9 = OpSpecConstantComposite %2 %6 %6 %5 %6 - %10 = OpSpecConstantComposite %3 %6 %6 %6 -%11 = OpSpecConstantComposite %4 %7 %8 %9 %10)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpSpecConstantComposite Constituent '10' vector " - "component count does not match Result Type '4's " - "vector component count.")); -} - -// Invalid: Matrix type expects 4 columns but only 3 specified. -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeMatrixNumColsBad) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %3 = OpTypeMatrix %2 4 - %4 = OpSpecConstant %1 1.0 - %5 = OpConstant %1 0.0 - %6 = OpSpecConstantComposite %2 %4 %5 %5 %5 - %7 = OpSpecConstantComposite %2 %5 %4 %5 %5 - %8 = OpSpecConstantComposite %2 %5 %5 %4 %5 -%10 = OpSpecConstantComposite %3 %6 %7 %8)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpSpecConstantComposite Constituent count does " - "not match Result Type '3's matrix column count.")); -} - -// Invalid: Composite contains a non-const/undef component -TEST_F(ValidateIdWithMessage, - OpSpecConstantCompositeMatrixConstituentNotConstBad) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeFloat 32 - %2 = OpConstant %1 0.0 - %3 = OpTypeVector %1 4 - %4 = OpTypeMatrix %3 4 - %5 = OpSpecConstantComposite %3 %2 %2 %2 %2 - %6 = OpSpecConstantComposite %4 %5 %5 %5 %1)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpSpecConstantComposite Constituent '1' is not a " - "constant composite or undef.")); -} - -// Invalid: Composite contains a column that is *not* a vector (it's an array) -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeMatrixColTypeBad) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeFloat 32 - %2 = OpTypeInt 32 0 - %3 = OpSpecConstant %2 4 - %4 = OpConstant %1 0.0 - %5 = OpTypeVector %1 4 - %6 = OpTypeArray %2 %3 - %7 = OpTypeMatrix %5 4 - %8 = OpSpecConstantComposite %6 %3 %3 %3 %3 - %9 = OpSpecConstantComposite %5 %4 %4 %4 %4 - %10 = OpSpecConstantComposite %7 %9 %9 %9 %8)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpSpecConstantComposite Constituent '8' type " - "does not match Result Type '7's matrix column " - "type.")); -} - -// Invalid: Matrix with an Undef column of the wrong size. -TEST_F(ValidateIdWithMessage, - OpSpecConstantCompositeMatrixConstituentUndefTypeBad) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeFloat 32 - %2 = OpTypeVector %1 4 - %3 = OpTypeVector %1 3 - %4 = OpTypeMatrix %2 4 - %5 = OpSpecConstant %1 1.0 - %6 = OpSpecConstant %1 0.0 - %7 = OpSpecConstantComposite %2 %5 %6 %6 %6 - %8 = OpSpecConstantComposite %2 %6 %5 %6 %6 - %9 = OpSpecConstantComposite %2 %6 %6 %5 %6 - %10 = OpUndef %3 - %11 = OpSpecConstantComposite %4 %7 %8 %9 %10)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpSpecConstantComposite Constituent '10' vector " - "component count does not match Result Type '4's " - "vector component count.")); -} - -// Invalid: Matrix in which some columns are Int and some are Float. -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeMatrixColumnTypeBad) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeInt 32 0 - %2 = OpTypeFloat 32 - %3 = OpTypeVector %1 2 - %4 = OpTypeVector %2 2 - %5 = OpTypeMatrix %4 2 - %6 = OpSpecConstant %1 42 - %7 = OpConstant %2 3.14 - %8 = OpSpecConstantComposite %3 %6 %6 - %9 = OpSpecConstantComposite %4 %7 %7 -%10 = OpSpecConstantComposite %5 %8 %9)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpSpecConstantComposite Constituent '8' " - "component type does not match Result Type '5's " - "matrix column component type.")); -} - -// Valid: Array of integers -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeArrayGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpSpecConstant %1 4 -%5 = OpConstant %1 5 -%3 = OpTypeArray %1 %2 -%6 = OpTypeArray %1 %5 -%4 = OpSpecConstantComposite %3 %2 %2 %2 %2 -%7 = OpSpecConstantComposite %3 %5 %5 %5 %5)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: Expecting an array of 4 components, but 3 specified. -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeArrayNumComponentsBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpSpecConstant %1 4 -%3 = OpTypeArray %1 %2 -%4 = OpSpecConstantComposite %3 %2 %2 %2)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpSpecConstantComposite Constituent count does not " - "match Result Type '3's array length.")); -} - -// Valid: Array of Integers and Undef-int -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeArrayWithUndefGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpSpecConstant %1 4 -%9 = OpUndef %1 -%3 = OpTypeArray %1 %2 -%4 = OpSpecConstantComposite %3 %2 %2 %2 %9)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: Array uses a type as operand. -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeArrayConstConstituentBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpConstant %1 4 -%3 = OpTypeArray %1 %2 -%4 = OpSpecConstantComposite %3 %2 %2 %2 %1)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpSpecConstantComposite Constituent '1' is not a " - "constant or undef.")); -} - -// Invalid: Array has a mix of Int and Float components. -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeArrayConstituentTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpConstant %1 4 -%3 = OpTypeArray %1 %2 -%4 = OpTypeFloat 32 -%5 = OpSpecConstant %4 3.14 ; bad type for const value -%6 = OpSpecConstantComposite %3 %2 %2 %2 %5)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpSpecConstantComposite Constituent '5's type " - "does not match Result Type '3's array element " - "type.")); -} - -// Invalid: Array has a mix of Int and Undef-float. -TEST_F(ValidateIdWithMessage, - OpSpecConstantCompositeArrayConstituentUndefTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpSpecConstant %1 4 -%3 = OpTypeArray %1 %2 -%5 = OpTypeFloat 32 -%6 = OpUndef %5 ; bad type for undef -%4 = OpSpecConstantComposite %3 %2 %2 %2 %6)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpSpecConstantComposite Constituent '5's type " - "does not match Result Type '3's array element " - "type.")); -} - -// Valid: Struct of {Int32,Int32,Int64}. -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeStructGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeInt 64 0 -%3 = OpTypeStruct %1 %1 %2 -%4 = OpConstant %1 42 -%5 = OpSpecConstant %2 4300000000 -%6 = OpSpecConstantComposite %3 %4 %4 %5)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: missing one int32 struct member. -TEST_F(ValidateIdWithMessage, - OpSpecConstantCompositeStructMissingComponentBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%3 = OpTypeStruct %1 %1 %1 -%4 = OpConstant %1 42 -%5 = OpSpecConstant %1 430 -%6 = OpSpecConstantComposite %3 %4 %5)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpSpecConstantComposite Constituent '2' count " - "does not match Result Type '2's struct member " - "count.")); -} - -// Valid: Struct uses Undef-int64. -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeStructUndefGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeInt 64 0 -%3 = OpTypeStruct %1 %1 %2 -%4 = OpSpecConstant %1 42 -%5 = OpUndef %2 -%6 = OpSpecConstantComposite %3 %4 %4 %5)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: Composite contains non-const/undef component. -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeStructNonConstBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeInt 64 0 -%3 = OpTypeStruct %1 %1 %2 -%4 = OpSpecConstant %1 42 -%5 = OpUndef %2 -%6 = OpSpecConstantComposite %3 %4 %1 %5)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpSpecConstantComposite Constituent '1' is not a " - "constant or undef.")); -} - -// Invalid: Struct component type does not match expected specialization type. -// Second component was expected to be Int32, but got Int64. -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeStructMemberTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeInt 64 0 -%3 = OpTypeStruct %1 %1 %2 -%4 = OpConstant %1 42 -%5 = OpSpecConstant %2 4300000000 -%6 = OpSpecConstantComposite %3 %4 %5 %4)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpSpecConstantComposite Constituent '5' type " - "does not match the Result Type '3's member " - "type.")); -} - -// Invalid: Undef-int64 used when Int32 was expected. -TEST_F(ValidateIdWithMessage, OpSpecConstantCompositeStructMemberUndefTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeInt 64 0 -%3 = OpTypeStruct %1 %1 %2 -%4 = OpSpecConstant %1 42 -%5 = OpUndef %2 -%6 = OpSpecConstantComposite %3 %4 %5 %4)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpSpecConstantComposite Constituent '5' type " - "does not match the Result Type '3's member " - "type.")); -} - -// TODO: OpSpecConstantOp - -TEST_F(ValidateIdWithMessage, OpVariableGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypePointer Input %1 -%3 = OpVariable %2 Input)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpVariableInitializerConstantGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypePointer Input %1 -%3 = OpConstant %1 42 -%4 = OpVariable %2 Input %3)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpVariableInitializerGlobalVariableGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypePointer Uniform %1 -%3 = OpVariable %2 Uniform -%4 = OpTypePointer Uniform %2 ; pointer to pointer -%5 = OpVariable %4 Uniform %3)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -// TODO: Positive test OpVariable with OpConstantNull of OpTypePointer -TEST_F(ValidateIdWithMessage, OpVariableResultTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpVariable %1 Input)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpVariable Result Type '1' is not a pointer type.")); -} -TEST_F(ValidateIdWithMessage, OpVariableInitializerIsTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypePointer Input %1 -%3 = OpVariable %2 Input %2)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpVariable Initializer '2' is not a constant or " - "module-scope variable")); -} - -TEST_F(ValidateIdWithMessage, OpVariableInitializerIsFunctionVarBad) { - string spirv = kGLSL450MemoryModel + R"( -%int = OpTypeInt 32 0 -%ptrint = OpTypePointer Function %int -%ptrptrint = OpTypePointer Function %ptrint -%void = OpTypeVoid -%fnty = OpTypeFunction %void -%main = OpFunction %void None %fnty -%entry = OpLabel -%var = OpVariable %ptrint Function -%varinit = OpVariable %ptrptrint Function %var ; Can't initialize function variable. -OpReturn -OpFunctionEnd -)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpVariable Initializer '8' is not a constant or " - "module-scope variable")); -} - -TEST_F(ValidateIdWithMessage, OpVariableInitializerIsModuleVarGood) { - string spirv = kGLSL450MemoryModel + R"( -%int = OpTypeInt 32 0 -%ptrint = OpTypePointer Uniform %int -%mvar = OpVariable %ptrint Uniform -%ptrptrint = OpTypePointer Function %ptrint -%void = OpTypeVoid -%fnty = OpTypeFunction %void -%main = OpFunction %void None %fnty -%entry = OpLabel -%goodvar = OpVariable %ptrptrint Function %mvar ; This is ok -OpReturn -OpFunctionEnd -)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpLoadGood) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeVoid - %2 = OpTypeInt 32 0 - %3 = OpTypePointer UniformConstant %2 - %4 = OpTypeFunction %1 - %5 = OpVariable %3 UniformConstant - %6 = OpFunction %1 None %4 - %7 = OpLabel - %8 = OpLoad %2 %5 - %9 = OpReturn -%10 = OpFunctionEnd -)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// TODO: Add tests that exercise VariablePointersStorageBuffer instead of -// VariablePointers. -void createVariablePointerSpirvProgram(std::ostringstream* spirv, - std::string result_strategy, - bool use_varptr_cap, - bool add_helper_function) { - *spirv << "OpCapability Shader "; - if (use_varptr_cap) { - *spirv << "OpCapability VariablePointers "; - *spirv << "OpExtension \"SPV_KHR_variable_pointers\" "; - } - *spirv << R"( - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %main "main" - %void = OpTypeVoid - %voidf = OpTypeFunction %void - %bool = OpTypeBool - %i32 = OpTypeInt 32 1 - %f32 = OpTypeFloat 32 - %f32ptr = OpTypePointer Uniform %f32 - %i = OpConstant %i32 1 - %zero = OpConstant %i32 0 - %float_1 = OpConstant %f32 1.0 - %ptr1 = OpVariable %f32ptr Uniform - %ptr2 = OpVariable %f32ptr Uniform - )"; - if (add_helper_function) { - *spirv << R"( - ; //////////////////////////////////////////////////////////// - ;;;; Function that returns a pointer - ; //////////////////////////////////////////////////////////// - %selector_func_type = OpTypeFunction %f32ptr %bool %f32ptr %f32ptr - %choose_input_func = OpFunction %f32ptr None %selector_func_type - %is_neg_param = OpFunctionParameter %bool - %first_ptr_param = OpFunctionParameter %f32ptr - %second_ptr_param = OpFunctionParameter %f32ptr - %selector_func_begin = OpLabel - %result_ptr = OpSelect %f32ptr %is_neg_param %first_ptr_param %second_ptr_param - OpReturnValue %result_ptr - OpFunctionEnd - )"; - } - *spirv << R"( - %main = OpFunction %void None %voidf - %label = OpLabel - )"; - *spirv << result_strategy; - *spirv << R"( - OpReturn - OpFunctionEnd - )"; -} - -// With the VariablePointer Capability, OpLoad should allow loading a -// VaiablePointer. In this test the variable pointer is obtained by an OpSelect -TEST_F(ValidateIdWithMessage, OpLoadVarPtrOpSelectGood) { - std::string result_strategy = R"( - %isneg = OpSLessThan %bool %i %zero - %varptr = OpSelect %f32ptr %isneg %ptr1 %ptr2 - %result = OpLoad %f32 %varptr - )"; - - std::ostringstream spirv; - createVariablePointerSpirvProgram(&spirv, result_strategy, - true /* Add VariablePointers Capability? */, - false /* Use Helper Function? */); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Without the VariablePointers Capability, OpLoad will not allow loading -// through a variable pointer. -// Disabled since using OpSelect with pointers without VariablePointers will -// fail LogicalsPass. -TEST_F(ValidateIdWithMessage, DISABLED_OpLoadVarPtrOpSelectBad) { - std::string result_strategy = R"( - %isneg = OpSLessThan %bool %i %zero - %varptr = OpSelect %f32ptr %isneg %ptr1 %ptr2 - %result = OpLoad %f32 %varptr - )"; - - std::ostringstream spirv; - createVariablePointerSpirvProgram(&spirv, result_strategy, - false /* Add VariablePointers Capability?*/, - false /* Use Helper Function? */); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("is not a logical pointer.")); -} - -// With the VariablePointer Capability, OpLoad should allow loading a -// VaiablePointer. In this test the variable pointer is obtained by an OpPhi -TEST_F(ValidateIdWithMessage, OpLoadVarPtrOpPhiGood) { - std::string result_strategy = R"( - %is_neg = OpSLessThan %bool %i %zero - OpSelectionMerge %end_label None - OpBranchConditional %is_neg %take_ptr_1 %take_ptr_2 - %take_ptr_1 = OpLabel - OpBranch %end_label - %take_ptr_2 = OpLabel - OpBranch %end_label - %end_label = OpLabel - %varptr = OpPhi %f32ptr %ptr1 %take_ptr_1 %ptr2 %take_ptr_2 - %result = OpLoad %f32 %varptr - )"; - - std::ostringstream spirv; - createVariablePointerSpirvProgram(&spirv, result_strategy, - true /* Add VariablePointers Capability?*/, - false /* Use Helper Function? */); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Without the VariablePointers Capability, OpLoad will not allow loading -// through a variable pointer. -TEST_F(ValidateIdWithMessage, OpLoadVarPtrOpPhiBad) { - std::string result_strategy = R"( - %is_neg = OpSLessThan %bool %i %zero - OpSelectionMerge %end_label None - OpBranchConditional %is_neg %take_ptr_1 %take_ptr_2 - %take_ptr_1 = OpLabel - OpBranch %end_label - %take_ptr_2 = OpLabel - OpBranch %end_label - %end_label = OpLabel - %varptr = OpPhi %f32ptr %ptr1 %take_ptr_1 %ptr2 %take_ptr_2 - %result = OpLoad %f32 %varptr - )"; - - std::ostringstream spirv; - createVariablePointerSpirvProgram(&spirv, result_strategy, - false /* Add VariablePointers Capability?*/, - false /* Use Helper Function? */); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("is not a logical pointer")); -} - -// With the VariablePointer Capability, OpLoad should allow loading through a -// VaiablePointer. In this test the variable pointer is obtained from an -// OpFunctionCall (return value from a function) -TEST_F(ValidateIdWithMessage, OpLoadVarPtrOpFunctionCallGood) { - std::ostringstream spirv; - std::string result_strategy = R"( - %isneg = OpSLessThan %bool %i %zero - %varptr = OpFunctionCall %f32ptr %choose_input_func %isneg %ptr1 %ptr2 - %result = OpLoad %f32 %varptr - )"; - - createVariablePointerSpirvProgram(&spirv, - result_strategy, - true /* Add VariablePointers Capability?*/, - true /* Use Helper Function? */); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpLoadResultTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypePointer UniformConstant %2 -%4 = OpTypeFunction %1 -%5 = OpVariable %3 UniformConstant -%6 = OpFunction %1 None %4 -%7 = OpLabel -%8 = OpLoad %3 %5 - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpLoad Result Type '3' does not match Pointer " - " '5's type.")); -} - -TEST_F(ValidateIdWithMessage, OpLoadPointerBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypePointer UniformConstant %2 -%4 = OpTypeFunction %1 -%5 = OpFunction %1 None %4 -%6 = OpLabel -%7 = OpLoad %2 %8 - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - // Prove that SSA checks trigger for a bad Id value. - // The next test case show the not-a-logical-pointer case. - EXPECT_THAT(getDiagnosticString(), - HasSubstr("ID 8 has not been defined")); -} - -// Disabled as bitcasting type to object is now not valid. -TEST_F(ValidateIdWithMessage, DISABLED_OpLoadLogicalPointerBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypeFloat 32 -%4 = OpTypePointer UniformConstant %2 -%5 = OpTypePointer UniformConstant %3 -%6 = OpTypeFunction %1 -%7 = OpFunction %1 None %6 -%8 = OpLabel -%9 = OpBitcast %5 %4 ; Not valid in logical addressing -%10 = OpLoad %3 %9 ; Should trigger message - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - // Once we start checking bitcasts, we might catch that - // as the error first, instead of catching it here. - // I don't know if it's possible to generate a bad case - // if/when the validator is complete. - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpLoad Pointer '9' is not a logical pointer.")); -} - -TEST_F(ValidateIdWithMessage, OpStoreGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypePointer UniformConstant %2 -%4 = OpTypeFunction %1 -%5 = OpConstant %2 42 -%6 = OpVariable %3 UniformConstant -%7 = OpFunction %1 None %4 -%8 = OpLabel - OpStore %6 %5 - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpStorePointerBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypePointer UniformConstant %2 -%4 = OpTypeFunction %1 -%5 = OpConstant %2 42 -%6 = OpVariable %3 UniformConstant -%7 = OpFunction %1 None %4 -%8 = OpLabel - OpStore %3 %5 - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpStore Pointer '3' is not a logical pointer.")); -} - -// Disabled as bitcasting type to object is now not valid. -TEST_F(ValidateIdWithMessage, DISABLED_OpStoreLogicalPointerBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypeFloat 32 -%4 = OpTypePointer UniformConstant %2 -%5 = OpTypePointer UniformConstant %3 -%6 = OpTypeFunction %1 -%7 = OpConstantNull %5 -%8 = OpFunction %1 None %6 -%9 = OpLabel -%10 = OpBitcast %5 %4 ; Not valid in logical addressing -%11 = OpStore %10 %7 ; Should trigger message - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpStore Pointer '10' is not a logical pointer.")); -} - -// Without the VariablePointer Capability, OpStore should may not store -// through a variable pointer. -// Disabled since using OpSelect with pointers without VariablePointers will -// fail LogicalsPass. -TEST_F(ValidateIdWithMessage, DISABLED_OpStoreVarPtrBad) { - std::string result_strategy = R"( - %isneg = OpSLessThan %bool %i %zero - %varptr = OpSelect %f32ptr %isneg %ptr1 %ptr2 - OpStore %varptr %float_1 - )"; - - std::ostringstream spirv; - createVariablePointerSpirvProgram( - &spirv, result_strategy, false /* Add VariablePointers Capability? */, - false /* Use Helper Function? */); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("is not a logical pointer.")); -} - -// With the VariablePointer Capability, OpStore should allow storing through a -// variable pointer. -TEST_F(ValidateIdWithMessage, OpStoreVarPtrGood) { - std::string result_strategy = R"( - %isneg = OpSLessThan %bool %i %zero - %varptr = OpSelect %f32ptr %isneg %ptr1 %ptr2 - OpStore %varptr %float_1 - )"; - - std::ostringstream spirv; - createVariablePointerSpirvProgram(&spirv, result_strategy, - true /* Add VariablePointers Capability? */, - false /* Use Helper Function? */); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpStoreObjectGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypePointer UniformConstant %2 -%4 = OpTypeFunction %1 -%5 = OpConstant %2 42 -%6 = OpVariable %3 UniformConstant -%7 = OpFunction %1 None %4 -%8 = OpLabel - OpStore %6 %7 - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpStore Object '7's type is void.")); -} -TEST_F(ValidateIdWithMessage, OpStoreTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%9 = OpTypeFloat 32 -%3 = OpTypePointer UniformConstant %2 -%4 = OpTypeFunction %1 -%5 = OpConstant %9 3.14 -%6 = OpVariable %3 UniformConstant -%7 = OpFunction %1 None %4 -%8 = OpLabel - OpStore %6 %5 - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpStore Pointer '7's type does not match Object " - " '3's type.")); -} - -TEST_F(ValidateIdWithMessage, OpStoreVoid) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypePointer UniformConstant %2 -%4 = OpTypeFunction %1 -%6 = OpVariable %3 UniformConstant -%7 = OpFunction %1 None %4 -%8 = OpLabel -%9 = OpFunctionCall %1 %7 - OpStore %6 %9 - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpStore Object '8's type is void.")); -} - -TEST_F(ValidateIdWithMessage, OpStoreLabel) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypePointer UniformConstant %2 -%4 = OpTypeFunction %1 -%6 = OpVariable %3 UniformConstant -%7 = OpFunction %1 None %4 -%8 = OpLabel - OpStore %6 %8 - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpStore Object '7' is not an object.")); -} - -// TODO: enable when this bug is fixed: -// https://cvs.khronos.org/bugzilla/show_bug.cgi?id=15404 -TEST_F(ValidateIdWithMessage, DISABLED_OpStoreFunction) { - string spirv = kGLSL450MemoryModel + R"( -%2 = OpTypeInt 32 0 -%3 = OpTypePointer UniformConstant %2 -%4 = OpTypeFunction %2 -%5 = OpConstant %2 123 -%6 = OpVariable %3 UniformConstant -%7 = OpFunction %2 None %4 -%8 = OpLabel - OpStore %6 %7 - OpReturnValue %5 - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpCopyMemoryGood) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeVoid - %2 = OpTypeInt 32 0 - %3 = OpTypePointer UniformConstant %2 - %4 = OpConstant %2 42 - %5 = OpVariable %3 UniformConstant %4 - %6 = OpTypePointer Function %2 - %7 = OpTypeFunction %1 - %8 = OpFunction %1 None %7 - %9 = OpLabel -%10 = OpVariable %6 Function - OpCopyMemory %10 %5 None - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpCopyMemoryBad) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeVoid - %2 = OpTypeInt 32 0 - %3 = OpTypePointer UniformConstant %2 - %4 = OpConstant %2 42 - %5 = OpVariable %3 UniformConstant %4 -%11 = OpTypeFloat 32 - %6 = OpTypePointer Function %11 - %7 = OpTypeFunction %1 - %8 = OpFunction %1 None %7 - %9 = OpLabel -%10 = OpVariable %6 Function - OpCopyMemory %10 %5 None - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpCopyMemory Target '5's type does not match " - "Source '2's type.")); -} - -// TODO: OpCopyMemorySized -TEST_F(ValidateIdWithMessage, OpCopyMemorySizedGood) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeVoid - %2 = OpTypeInt 32 0 - %3 = OpTypePointer UniformConstant %2 - %4 = OpTypePointer Function %2 - %5 = OpConstant %2 4 - %6 = OpVariable %3 UniformConstant %5 - %7 = OpTypeFunction %1 - %8 = OpFunction %1 None %7 - %9 = OpLabel -%10 = OpVariable %4 Function - OpCopyMemorySized %10 %6 %5 None - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpCopyMemorySizedTargetBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypePointer UniformConstant %2 -%4 = OpTypePointer Function %2 -%5 = OpConstant %2 4 -%6 = OpVariable %3 UniformConstant %5 -%7 = OpTypeFunction %1 -%8 = OpFunction %1 None %7 -%9 = OpLabel - OpCopyMemorySized %9 %6 %5 None - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpCopyMemorySized Target '9' is not a pointer.")); -} -TEST_F(ValidateIdWithMessage, OpCopyMemorySizedSourceBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypePointer UniformConstant %2 -%4 = OpTypePointer Function %2 -%5 = OpConstant %2 4 -%6 = OpTypeFunction %1 -%7 = OpFunction %1 None %6 -%8 = OpLabel -%9 = OpVariable %4 Function - OpCopyMemorySized %9 %6 %5 None - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpCopyMemorySized Source '6' is not a pointer.")); -} -TEST_F(ValidateIdWithMessage, OpCopyMemorySizedSizeBad) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeVoid - %2 = OpTypeInt 32 0 - %3 = OpTypePointer UniformConstant %2 - %4 = OpTypePointer Function %2 - %5 = OpConstant %2 4 - %6 = OpVariable %3 UniformConstant %5 - %7 = OpTypeFunction %1 - %8 = OpFunction %1 None %7 - %9 = OpLabel -%10 = OpVariable %4 Function - OpCopyMemorySized %10 %6 %6 None - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpCopyMemorySized Size '6's variable type is not " - "an integer type.")); -} -TEST_F(ValidateIdWithMessage, OpCopyMemorySizedSizeTypeBad) { - string spirv = kGLSL450MemoryModel + R"( - %1 = OpTypeVoid - %2 = OpTypeInt 32 0 - %3 = OpTypePointer UniformConstant %2 - %4 = OpTypePointer Function %2 - %5 = OpConstant %2 4 - %6 = OpVariable %3 UniformConstant %5 - %7 = OpTypeFunction %1 -%11 = OpTypeFloat 32 -%12 = OpConstant %11 1.0 - %8 = OpFunction %1 None %7 - %9 = OpLabel -%10 = OpVariable %4 Function - OpCopyMemorySized %10 %6 %12 None - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "OpCopyMemorySized Size '9's type is not an integer type.")); -} - -const char kDeeplyNestedStructureSetup[] = R"( -%void = OpTypeVoid -%void_f = OpTypeFunction %void -%int = OpTypeInt 32 0 -%float = OpTypeFloat 32 -%v3float = OpTypeVector %float 3 -%mat4x3 = OpTypeMatrix %v3float 4 -%_ptr_Private_mat4x3 = OpTypePointer Private %mat4x3 -%_ptr_Private_float = OpTypePointer Private %float -%my_matrix = OpVariable %_ptr_Private_mat4x3 Private -%my_float_var = OpVariable %_ptr_Private_float Private -%_ptr_Function_float = OpTypePointer Function %float -%int_0 = OpConstant %int 0 -%int_1 = OpConstant %int 1 -%int_2 = OpConstant %int 2 -%int_3 = OpConstant %int 3 -%int_5 = OpConstant %int 5 - -; Making the following nested structures. -; -; struct S { -; bool b; -; vec4 v[5]; -; int i; -; mat4x3 m[5]; -; } -; uniform blockName { -; S s; -; bool cond; -; RunTimeArray arr; -; } - -%f32arr = OpTypeRuntimeArray %float -%bool = OpTypeBool -%v4float = OpTypeVector %float 4 -%array5_mat4x3 = OpTypeArray %mat4x3 %int_5 -%array5_vec4 = OpTypeArray %v4float %int_5 -%_ptr_Uniform_float = OpTypePointer Uniform %float -%_ptr_Function_vec4 = OpTypePointer Function %v4float -%_ptr_Uniform_vec4 = OpTypePointer Uniform %v4float -%struct_s = OpTypeStruct %bool %array5_vec4 %int %array5_mat4x3 -%struct_blockName = OpTypeStruct %struct_s %bool %f32arr -%_ptr_Uniform_blockName = OpTypePointer Uniform %struct_blockName -%_ptr_Uniform_struct_s = OpTypePointer Uniform %struct_s -%_ptr_Uniform_array5_mat4x3 = OpTypePointer Uniform %array5_mat4x3 -%_ptr_Uniform_mat4x3 = OpTypePointer Uniform %mat4x3 -%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float -%blockName_var = OpVariable %_ptr_Uniform_blockName Uniform -%spec_int = OpSpecConstant %int 2 -%func = OpFunction %void None %void_f -%my_label = OpLabel -)"; - -// In what follows, Access Chain Instruction refers to one of the following: -// OpAccessChain, OpInBoundsAccessChain, OpPtrAccessChain, and -// OpInBoundsPtrAccessChain -using AccessChainInstructionTest = spvtest::ValidateBase; - -// Determines whether the access chain instruction requires the 'element id' -// argument. -bool AccessChainRequiresElemId(const std::string& instr) { - return (instr == "OpPtrAccessChain" || instr == "OpInBoundsPtrAccessChain"); -} - -// Valid: Access a float in a matrix using an access chain instruction. -TEST_P(AccessChainInstructionTest, AccessChainGood) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; - string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + - "%float_entry = " + instr + - R"( %_ptr_Private_float %my_matrix )" + elem + R"(%int_0 %int_1 - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid. The result type of an access chain instruction must be a pointer. -TEST_P(AccessChainInstructionTest, AccessChainResultTypeBad) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; - string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( -%float_entry = )" + - instr + R"( %float %my_matrix )" + elem + R"(%int_0 %int_1 -OpReturn -OpFunctionEnd - )"; - - const std::string expected_err = "The Result Type of " + instr + - " '36' must be " - "OpTypePointer. Found OpTypeFloat."; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); -} - -// Invalid. The base type of an access chain instruction must be a pointer. -TEST_P(AccessChainInstructionTest, AccessChainBaseTypeVoidBad) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; - string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( -%float_entry = )" + - instr + " %_ptr_Private_float %void " + elem + R"(%int_0 %int_1 -OpReturn -OpFunctionEnd - )"; - const std::string expected_err = "The Base '1' in " + instr + - " instruction must " - "be a pointer."; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); -} - -// Invalid. The base type of an access chain instruction must be a pointer. -TEST_P(AccessChainInstructionTest, AccessChainBaseTypeNonPtrVariableBad) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; - string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( -%entry = )" + instr + - R"( %_ptr_Private_float %_ptr_Private_float )" + elem + - R"(%int_0 %int_1 -OpReturn -OpFunctionEnd - )"; - const std::string expected_err = "The Base '8' in " + instr + - " instruction must " - "be a pointer."; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); -} - -// Invalid: The storage class of Base and Result do not match. -TEST_P(AccessChainInstructionTest, - AccessChainResultAndBaseStorageClassDoesntMatchBad) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; - string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( -%entry = )" + instr + - R"( %_ptr_Function_float %my_matrix )" + elem + - R"(%int_0 %int_1 -OpReturn -OpFunctionEnd - )"; - const std::string expected_err = - "The result pointer storage class and base pointer storage class in " + - instr + " do not match."; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); -} - -// Invalid. The base type of an access chain instruction must point to a -// composite object. -TEST_P(AccessChainInstructionTest, - AccessChainBasePtrNotPointingToCompositeBad) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; - string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( -%entry = )" + instr + - R"( %_ptr_Private_float %my_float_var )" + elem + R"(%int_0 -OpReturn -OpFunctionEnd - )"; - const std::string expected_err = instr + - " reached non-composite type while " - "indexes still remain to be traversed."; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); -} - -// Valid. No Indexes were passed to the access chain instruction. The Result -// Type is the same as the Base type. -TEST_P(AccessChainInstructionTest, AccessChainNoIndexesGood) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; - string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( -%entry = )" + instr + - R"( %_ptr_Private_float %my_float_var )" + elem + R"( -OpReturn -OpFunctionEnd - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid. No Indexes were passed to the access chain instruction, but the -// Result Type is different from the Base type. -TEST_P(AccessChainInstructionTest, AccessChainNoIndexesBad) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; - string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( -%entry = )" + instr + - R"( %_ptr_Private_mat4x3 %my_float_var )" + elem + R"( -OpReturn -OpFunctionEnd - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("result type (OpTypeMatrix) does not match the type that " - "results from indexing into the base (OpTypeFloat).")); -} - -// Valid: 255 indexes passed to the access chain instruction. Limit is 255. -TEST_P(AccessChainInstructionTest, AccessChainTooManyIndexesGood) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? " %int_0 " : ""; - int depth = 255; - std::string header = kGLSL450MemoryModel + kDeeplyNestedStructureSetup; - header.erase(header.find("%func")); - std::ostringstream spirv; - spirv << header << "\n"; - - // Build nested structures. Struct 'i' contains struct 'i-1' - spirv << "%s_depth_1 = OpTypeStruct %float\n"; - for (int i = 2; i <= depth; ++i) { - spirv << "%s_depth_" << i << " = OpTypeStruct %s_depth_" << i - 1 << "\n"; - } - - // Define Pointer and Variable to use for the AccessChain instruction. - spirv << "%_ptr_Uniform_deep_struct = OpTypePointer Uniform %s_depth_" - << depth << "\n"; - spirv << "%deep_var = OpVariable %_ptr_Uniform_deep_struct Uniform\n"; - - // Function Start - spirv << R"( - %func = OpFunction %void None %void_f - %my_label = OpLabel - )"; - - // AccessChain with 'n' indexes (n = depth) - spirv << "%entry = " << instr << " %_ptr_Uniform_float %deep_var" << elem; - for (int i = 0; i < depth; ++i) { - spirv << " %int_0"; - } - - // Function end - spirv << R"( - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: 256 indexes passed to the access chain instruction. Limit is 255. -TEST_P(AccessChainInstructionTest, AccessChainTooManyIndexesBad) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? " %int_0 " : ""; - std::ostringstream spirv; - spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup; - spirv << "%entry = " << instr << " %_ptr_Private_float %my_matrix" << elem; - for (int i = 0; i < 256; ++i) { - spirv << " %int_0"; - } - spirv << R"( - OpReturn - OpFunctionEnd - )"; - const std::string expected_err = "The number of indexes in " + instr + - " may not exceed 255. Found 256 indexes."; - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); -} - -// Valid: 10 indexes passed to the access chain instruction. (Custom limit: 10) -TEST_P(AccessChainInstructionTest, CustomizedAccessChainTooManyIndexesGood) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? " %int_0 " : ""; - int depth = 10; - std::string header = kGLSL450MemoryModel + kDeeplyNestedStructureSetup; - header.erase(header.find("%func")); - std::ostringstream spirv; - spirv << header << "\n"; - - // Build nested structures. Struct 'i' contains struct 'i-1' - spirv << "%s_depth_1 = OpTypeStruct %float\n"; - for (int i = 2; i <= depth; ++i) { - spirv << "%s_depth_" << i << " = OpTypeStruct %s_depth_" << i - 1 << "\n"; - } - - // Define Pointer and Variable to use for the AccessChain instruction. - spirv << "%_ptr_Uniform_deep_struct = OpTypePointer Uniform %s_depth_" - << depth << "\n"; - spirv << "%deep_var = OpVariable %_ptr_Uniform_deep_struct Uniform\n"; - - // Function Start - spirv << R"( - %func = OpFunction %void None %void_f - %my_label = OpLabel - )"; - - // AccessChain with 'n' indexes (n = depth) - spirv << "%entry = " << instr << " %_ptr_Uniform_float %deep_var" << elem; - for (int i = 0; i < depth; ++i) { - spirv << " %int_0"; - } - - // Function end - spirv << R"( - OpReturn - OpFunctionEnd - )"; - - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_access_chain_indexes, 10u); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: 11 indexes passed to the access chain instruction. Custom Limit:10 -TEST_P(AccessChainInstructionTest, CustomizedAccessChainTooManyIndexesBad) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? " %int_0 " : ""; - std::ostringstream spirv; - spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup; - spirv << "%entry = " << instr << " %_ptr_Private_float %my_matrix" << elem; - for (int i = 0; i < 11; ++i) { - spirv << " %int_0"; - } - spirv << R"( - OpReturn - OpFunctionEnd - )"; - const std::string expected_err = "The number of indexes in " + instr + - " may not exceed 10. Found 11 indexes."; - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_access_chain_indexes, 10u); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); -} - -// Invalid: Index passed to the access chain instruction is float (must be -// integer). -TEST_P(AccessChainInstructionTest, AccessChainUndefinedIndexBad) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; - string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( -%entry = )" + instr + - R"( %_ptr_Private_float %my_matrix )" + elem + R"(%float %int_1 -OpReturn -OpFunctionEnd - )"; - const std::string expected_err = - "Indexes passed to " + instr + " must be of type integer."; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); -} - -// Invalid: The index argument that indexes into a struct must be of type -// OpConstant. -TEST_P(AccessChainInstructionTest, AccessChainStructIndexNotConstantBad) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; - string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( -%f = )" + instr + R"( %_ptr_Uniform_float %blockName_var )" + - elem + R"(%int_0 %spec_int %int_2 -OpReturn -OpFunctionEnd - )"; - const std::string expected_err = - "The passed to " + instr + - " to index into a structure must be an OpConstant."; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); -} - -// Invalid: Indexing up to a vec4 granularity, but result type expected float. -TEST_P(AccessChainInstructionTest, - AccessChainStructResultTypeDoesntMatchIndexedTypeBad) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; - string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( -%entry = )" + instr + - R"( %_ptr_Uniform_float %blockName_var )" + elem + - R"(%int_0 %int_1 %int_2 -OpReturn -OpFunctionEnd - )"; - const std::string expected_err = instr + - " result type (OpTypeFloat) does not match " - "the type that results from indexing into " - "the base (OpTypeVector)."; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); -} - -// Invalid: Reach non-composite type (bool) when unused indexes remain. -TEST_P(AccessChainInstructionTest, AccessChainStructTooManyIndexesBad) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; - string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( -%entry = )" + instr + - R"( %_ptr_Uniform_float %blockName_var )" + elem + - R"(%int_0 %int_2 %int_2 -OpReturn -OpFunctionEnd - )"; - const std::string expected_err = instr + - " reached non-composite type while " - "indexes still remain to be traversed."; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); -} - -// Invalid: Trying to find index 3 of the struct that has only 3 members. -TEST_P(AccessChainInstructionTest, AccessChainStructIndexOutOfBoundBad) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; - string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( -%entry = )" + instr + - R"( %_ptr_Uniform_float %blockName_var )" + elem + - R"(%int_3 %int_2 %int_2 -OpReturn -OpFunctionEnd - )"; - const std::string expected_err = "Index is out of bounds: " + instr + - " can not find index 3 into the structure " - " '26'. This structure has 3 members. " - "Largest valid index is 2."; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); -} - -// Valid: Tests that we can index into Struct, Array, Matrix, and Vector! -TEST_P(AccessChainInstructionTest, AccessChainIndexIntoAllTypesGood) { - // indexes that we are passing are: 0, 3, 1, 2, 0 - // 0 will select the struct_s within the base struct (blockName) - // 3 will select the Array that contains 5 matrices - // 1 will select the Matrix that is at index 1 of the array - // 2 will select the column (which is a vector) within the matrix at index 2 - // 0 will select the element at the index 0 of the vector. (which is a float). - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; - ostringstream spirv; - spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup << std::endl; - spirv << "%ss = " << instr << " %_ptr_Uniform_struct_s %blockName_var " - << elem << "%int_0" << std::endl; - spirv << "%sa = " << instr << " %_ptr_Uniform_array5_mat4x3 %blockName_var " - << elem << "%int_0 %int_3" << std::endl; - spirv << "%sm = " << instr << " %_ptr_Uniform_mat4x3 %blockName_var " << elem - << "%int_0 %int_3 %int_1" << std::endl; - spirv << "%sc = " << instr << " %_ptr_Uniform_v3float %blockName_var " << elem - << "%int_0 %int_3 %int_1 %int_2" << std::endl; - spirv << "%entry = " << instr << " %_ptr_Uniform_float %blockName_var " - << elem << "%int_0 %int_3 %int_1 %int_2 %int_0" << std::endl; - spirv << R"( -OpReturn -OpFunctionEnd - )"; - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Valid: Access an element of OpTypeRuntimeArray. -TEST_P(AccessChainInstructionTest, AccessChainIndexIntoRuntimeArrayGood) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; - string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( -%runtime_arr_entry = )" + - instr + - R"( %_ptr_Uniform_float %blockName_var )" + elem + - R"(%int_2 %int_0 -OpReturn -OpFunctionEnd - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: Unused index when accessing OpTypeRuntimeArray. -TEST_P(AccessChainInstructionTest, AccessChainIndexIntoRuntimeArrayBad) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; - string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( -%runtime_arr_entry = )" + - instr + - R"( %_ptr_Uniform_float %blockName_var )" + elem + - R"(%int_2 %int_0 %int_1 -OpReturn -OpFunctionEnd - )"; - const std::string expected_err = - instr + - " reached non-composite type while indexes still remain to be traversed."; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); -} - -// Invalid: Reached scalar type before arguments to the access chain instruction -// finished. -TEST_P(AccessChainInstructionTest, AccessChainMatrixMoreArgsThanNeededBad) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; - string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( -%entry = )" + instr + - R"( %_ptr_Private_float %my_matrix )" + elem + - R"(%int_0 %int_1 %int_0 -OpReturn -OpFunctionEnd - )"; - const std::string expected_err = instr + - " reached non-composite type while " - "indexes still remain to be traversed."; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); -} - -// Invalid: The result type and the type indexed into do not match. -TEST_P(AccessChainInstructionTest, - AccessChainResultTypeDoesntMatchIndexedTypeBad) { - const std::string instr = GetParam(); - const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : ""; - string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"( -%entry = )" + instr + - R"( %_ptr_Private_mat4x3 %my_matrix )" + elem + - R"(%int_0 %int_1 -OpReturn -OpFunctionEnd - )"; - const std::string expected_err = instr + - " result type (OpTypeMatrix) does not match " - "the type that results from indexing into " - "the base (OpTypeFloat)."; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err)); -} - -// Run tests for Access Chain Instructions. -INSTANTIATE_TEST_CASE_P( - CheckAccessChainInstructions, AccessChainInstructionTest, - ::testing::Values("OpAccessChain", "OpInBoundsAccessChain", - "OpPtrAccessChain", "OpInBoundsPtrAccessChain")); - -// TODO: OpArrayLength -// TODO: OpImagePointer -// TODO: OpGenericPtrMemSemantics - -TEST_F(ValidateIdWithMessage, OpFunctionGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypeFunction %1 %2 %2 -%4 = OpFunction %1 None %3 -%5 = OpLabel - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpFunctionResultTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpConstant %2 42 -%4 = OpTypeFunction %1 %2 %2 -%5 = OpFunction %2 None %4 -%6 = OpLabel - OpReturnValue %3 - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpFunction Result Type '2' does not match the " - "Function Type '2's return type.")); -} -TEST_F(ValidateIdWithMessage, OpReturnValueTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeFloat 32 -%3 = OpConstant %2 0 -%4 = OpTypeFunction %1 -%5 = OpFunction %1 None %4 -%6 = OpLabel - OpReturnValue %3 - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpReturnValue Value '3's type does not match " - "OpFunction's return type.")); -} -TEST_F(ValidateIdWithMessage, OpFunctionFunctionTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%4 = OpFunction %1 None %2 -%5 = OpLabel - OpReturn -OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpFunction Function Type '2' is not a function type.")); -} - -TEST_F(ValidateIdWithMessage, OpFunctionParameterGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypeFunction %1 %2 -%4 = OpFunction %1 None %3 -%5 = OpFunctionParameter %2 -%6 = OpLabel - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpFunctionParameterMultipleGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypeFunction %1 %2 %2 -%4 = OpFunction %1 None %3 -%5 = OpFunctionParameter %2 -%6 = OpFunctionParameter %2 -%7 = OpLabel - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpFunctionParameterResultTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypeFunction %1 %2 -%4 = OpFunction %1 None %3 -%5 = OpFunctionParameter %1 -%6 = OpLabel - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpFunctionParameter Result Type '1' does not match the " - "OpTypeFunction parameter type of the same index.")); -} - -TEST_F(ValidateIdWithMessage, OpFunctionCallGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypeFunction %2 %2 -%4 = OpTypeFunction %1 -%5 = OpConstant %2 42 ;21 - -%6 = OpFunction %2 None %3 -%7 = OpFunctionParameter %2 -%8 = OpLabel - OpReturnValue %7 - OpFunctionEnd - -%10 = OpFunction %1 None %4 -%11 = OpLabel -%12 = OpFunctionCall %2 %6 %5 - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpFunctionCallResultTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypeFunction %2 %2 -%4 = OpTypeFunction %1 -%5 = OpConstant %2 42 ;21 - -%6 = OpFunction %2 None %3 -%7 = OpFunctionParameter %2 -%8 = OpLabel -%9 = OpIAdd %2 %7 %7 - OpReturnValue %9 - OpFunctionEnd - -%10 = OpFunction %1 None %4 -%11 = OpLabel -%12 = OpFunctionCall %1 %6 %5 - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpFunctionCall Result Type '1's type does not " - "match Function '2's return type.")); -} -TEST_F(ValidateIdWithMessage, OpFunctionCallFunctionBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypeFunction %2 %2 -%4 = OpTypeFunction %1 -%5 = OpConstant %2 42 ;21 - -%10 = OpFunction %1 None %4 -%11 = OpLabel -%12 = OpFunctionCall %2 %5 %5 - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpFunctionCall Function '5' is not a function.")); -} -TEST_F(ValidateIdWithMessage, OpFunctionCallArgumentTypeBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypeFunction %2 %2 -%4 = OpTypeFunction %1 -%5 = OpConstant %2 42 - -%13 = OpTypeFloat 32 -%14 = OpConstant %13 3.14 - -%6 = OpFunction %2 None %3 -%7 = OpFunctionParameter %2 -%8 = OpLabel -%9 = OpIAdd %2 %7 %7 - OpReturnValue %9 - OpFunctionEnd - -%10 = OpFunction %1 None %4 -%11 = OpLabel -%12 = OpFunctionCall %2 %6 %14 - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpFunctionCall Argument '7's type does not match " - "Function '2's parameter type.")); -} - -// Valid: OpSampledImage result is used in the same block by -// OpImageSampleImplictLod -TEST_F(ValidateIdWithMessage, OpSampledImageGood) { - string spirv = kGLSL450MemoryModel + sampledImageSetup + R"( -%smpld_img = OpSampledImage %sampled_image_type %image_inst %sampler_inst -%si_lod = OpImageSampleImplicitLod %v4float %smpld_img %const_vec_1_1 - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: OpSampledImage result is defined in one block and used in a -// different block. -TEST_F(ValidateIdWithMessage, OpSampledImageUsedInDifferentBlockBad) { - string spirv = kGLSL450MemoryModel + sampledImageSetup + R"( -%smpld_img = OpSampledImage %sampled_image_type %image_inst %sampler_inst -OpBranch %label_2 -%label_2 = OpLabel -%si_lod = OpImageSampleImplicitLod %v4float %smpld_img %const_vec_1_1 -OpReturn -OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("All OpSampledImage instructions must be in the same block in " - "which their Result are consumed. OpSampledImage Result " - "Type '23' has a consumer in a different basic block. The " - "consumer instruction is '25'.")); -} - -// Invalid: OpSampledImage result is used by OpSelect -// Note: According to the Spec, OpSelect parameters must be either a scalar or a -// vector. Therefore, OpTypeSampledImage is an illegal parameter for OpSelect. -// However, the OpSelect validation does not catch this today. Therefore, it is -// caught by the OpSampledImage validation. If the OpSelect validation code is -// updated, the error message for this test may change. -// -// Disabled since OpSelect catches this now. -TEST_F(ValidateIdWithMessage, DISABLED_OpSampledImageUsedInOpSelectBad) { - string spirv = kGLSL450MemoryModel + sampledImageSetup + R"( -%smpld_img = OpSampledImage %sampled_image_type %image_inst %sampler_inst -%select_img = OpSelect %sampled_image_type %spec_true %smpld_img %smpld_img -OpReturn -OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Result from OpSampledImage instruction must not " - "appear as operands of OpSelect. Found result " - "'23' as an operand of '24'.")); -} - -// Invalid: OpSampledImage result is used by OpPhi -TEST_F(ValidateIdWithMessage, OpSampledImageUsedInOpPhiBad) { - string spirv = kGLSL450MemoryModel + sampledImageSetup + R"( -%smpld_img = OpSampledImage %sampled_image_type %image_inst %sampler_inst -%phi_result = OpPhi %sampled_image_type %smpld_img %label_1 -OpReturn -OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Result from OpSampledImage instruction must not " - "appear as operands of OpPhi. Found result '23' " - "as an operand of '24'.")); -} - -// Valid: Get a float in a matrix using CompositeExtract. -// Valid: Insert float into a matrix using CompositeInsert. -TEST_F(ValidateIdWithMessage, CompositeExtractInsertGood) { - ostringstream spirv; - spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup << std::endl; - spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl; - spirv << "%float_entry = OpCompositeExtract %float %matrix 0 1" << std::endl; - - // To test CompositeInsert, insert the object back in after extraction. - spirv << "%new_composite = OpCompositeInsert %mat4x3 %float_entry %matrix 0 1" - << std::endl; - spirv << R"(OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Valid. Tests both CompositeExtract and CompositeInsert with 255 indexes. -TEST_F(ValidateIdWithMessage, CompositeExtractInsertLimitsGood) { - int depth = 255; - std::string header = kGLSL450MemoryModel + kDeeplyNestedStructureSetup; - header.erase(header.find("%func")); - std::ostringstream spirv; - spirv << header << std::endl; - - // Build nested structures. Struct 'i' contains struct 'i-1' - spirv << "%s_depth_1 = OpTypeStruct %float\n"; - for (int i = 2; i <= depth; ++i) { - spirv << "%s_depth_" << i << " = OpTypeStruct %s_depth_" << i - 1 << "\n"; - } - - // Define Pointer and Variable to use for CompositeExtract/Insert. - spirv << "%_ptr_Uniform_deep_struct = OpTypePointer Uniform %s_depth_" - << depth << "\n"; - spirv << "%deep_var = OpVariable %_ptr_Uniform_deep_struct Uniform\n"; - - // Function Start - spirv << R"( - %func = OpFunction %void None %void_f - %my_label = OpLabel - )"; - - // OpCompositeExtract/Insert with 'n' indexes (n = depth) - spirv << "%deep = OpLoad %s_depth_" << depth << " %deep_var" << std::endl; - spirv << "%entry = OpCompositeExtract %float %deep"; - for (int i = 0; i < depth; ++i) { - spirv << " 0"; - } - spirv << std::endl; - spirv << "%new_composite = OpCompositeInsert %s_depth_" << depth - << " %entry %deep"; - for (int i = 0; i < depth; ++i) { - spirv << " 0"; - } - spirv << std::endl; - - // Function end - spirv << R"( - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: 256 indexes passed to OpCompositeExtract. Limit is 255. -TEST_F(ValidateIdWithMessage, CompositeExtractArgCountExceededLimitBad) { - std::ostringstream spirv; - spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup; - spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl; - spirv << "%entry = OpCompositeExtract %float %matrix"; - for (int i = 0; i < 256; ++i) { - spirv << " 0"; - } - spirv << R"( - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("The number of indexes in OpCompositeExtract may not " - "exceed 255. Found 256 indexes.")); -} - -// Invalid: 256 indexes passed to OpCompositeInsert. Limit is 255. -TEST_F(ValidateIdWithMessage, CompositeInsertArgCountExceededLimitBad) { - std::ostringstream spirv; - spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup; - spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl; - spirv << "%new_composite = OpCompositeInsert %mat4x3 %int_0 %matrix"; - for (int i = 0; i < 256; ++i) { - spirv << " 0"; - } - spirv << R"( - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("The number of indexes in OpCompositeInsert may not " - "exceed 255. Found 256 indexes.")); -} - -// Invalid: In OpCompositeInsert, result type must be the same as composite type -TEST_F(ValidateIdWithMessage, CompositeInsertWrongResultTypeBad) { - ostringstream spirv; - spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup << std::endl; - spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl; - spirv << "%float_entry = OpCompositeExtract %float %matrix 0 1" << std::endl; - spirv << "%new_composite = OpCompositeInsert %float %float_entry %matrix 0 1" - << std::endl; - spirv << R"(OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("The Result Type must be the same as Composite type")); -} - -// Valid: No Indexes were passed to OpCompositeExtract, and the Result Type is -// the same as the Base Composite type. -TEST_F(ValidateIdWithMessage, CompositeExtractNoIndexesGood) { - ostringstream spirv; - spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup << std::endl; - spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl; - spirv << "%float_entry = OpCompositeExtract %mat4x3 %matrix" << std::endl; - spirv << R"(OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: No Indexes were passed to OpCompositeExtract, but the Result Type is -// different from the Base Composite type. -TEST_F(ValidateIdWithMessage, CompositeExtractNoIndexesBad) { - ostringstream spirv; - spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup << std::endl; - spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl; - spirv << "%float_entry = OpCompositeExtract %float %matrix" << std::endl; - spirv << R"(OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpCompositeExtract result type (OpTypeFloat) does not " - "match the type that results from indexing into the " - "composite (OpTypeMatrix).")); -} - -// Valid: No Indexes were passed to OpCompositeInsert, and the type of the -// Object argument matches the Composite type. -TEST_F(ValidateIdWithMessage, CompositeInsertMissingIndexesGood) { - ostringstream spirv; - spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup << std::endl; - spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl; - spirv << "%matrix_2 = OpLoad %mat4x3 %my_matrix" << std::endl; - spirv << "%new_composite = OpCompositeInsert %mat4x3 %matrix_2 %matrix"; - spirv << R"( - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: No Indexes were passed to OpCompositeInsert, but the type of the -// Object argument does not match the Composite type. -TEST_F(ValidateIdWithMessage, CompositeInsertMissingIndexesBad) { - ostringstream spirv; - spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup << std::endl; - spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl; - spirv << "%new_composite = OpCompositeInsert %mat4x3 %int_0 %matrix"; - spirv << R"( - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("The Object type (OpTypeInt) in OpCompositeInsert does " - "not match the type that results from indexing into " - "the Composite (OpTypeMatrix).")); -} - -// Valid: Tests that we can index into Struct, Array, Matrix, and Vector! -TEST_F(ValidateIdWithMessage, CompositeExtractInsertIndexIntoAllTypesGood) { - // indexes that we are passing are: 0, 3, 1, 2, 0 - // 0 will select the struct_s within the base struct (blockName) - // 3 will select the Array that contains 5 matrices - // 1 will select the Matrix that is at index 1 of the array - // 2 will select the column (which is a vector) within the matrix at index 2 - // 0 will select the element at the index 0 of the vector. (which is a float). - ostringstream spirv; - spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup << R"( - %myblock = OpLoad %struct_blockName %blockName_var - %ss = OpCompositeExtract %struct_s %myblock 0 - %sa = OpCompositeExtract %array5_mat4x3 %myblock 0 3 - %sm = OpCompositeExtract %mat4x3 %myblock 0 3 1 - %sc = OpCompositeExtract %v3float %myblock 0 3 1 2 - %fl = OpCompositeExtract %float %myblock 0 3 1 2 0 - ; - ; Now let's insert back at different levels... - ; - %b1 = OpCompositeInsert %struct_blockName %ss %myblock 0 - %b2 = OpCompositeInsert %struct_blockName %sa %myblock 0 3 - %b3 = OpCompositeInsert %struct_blockName %sm %myblock 0 3 1 - %b4 = OpCompositeInsert %struct_blockName %sc %myblock 0 3 1 2 - %b5 = OpCompositeInsert %struct_blockName %fl %myblock 0 3 1 2 0 - OpReturn - OpFunctionEnd - )"; - - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid. More indexes are provided than needed for OpCompositeExtract. -TEST_F(ValidateIdWithMessage, CompositeExtractReachedScalarBad) { - // indexes that we are passing are: 0, 3, 1, 2, 0 - // 0 will select the struct_s within the base struct (blockName) - // 3 will select the Array that contains 5 matrices - // 1 will select the Matrix that is at index 1 of the array - // 2 will select the column (which is a vector) within the matrix at index 2 - // 0 will select the element at the index 0 of the vector. (which is a float). - ostringstream spirv; - spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup << R"( - %myblock = OpLoad %struct_blockName %blockName_var - %fl = OpCompositeExtract %float %myblock 0 3 1 2 0 1 - OpReturn - OpFunctionEnd - )"; - - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpCompositeExtract reached non-composite type while " - "indexes still remain to be traversed.")); -} - -// Invalid. More indexes are provided than needed for OpCompositeInsert. -TEST_F(ValidateIdWithMessage, CompositeInsertReachedScalarBad) { - // indexes that we are passing are: 0, 3, 1, 2, 0 - // 0 will select the struct_s within the base struct (blockName) - // 3 will select the Array that contains 5 matrices - // 1 will select the Matrix that is at index 1 of the array - // 2 will select the column (which is a vector) within the matrix at index 2 - // 0 will select the element at the index 0 of the vector. (which is a float). - ostringstream spirv; - spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup << R"( - %myblock = OpLoad %struct_blockName %blockName_var - %fl = OpCompositeExtract %float %myblock 0 3 1 2 0 - %b5 = OpCompositeInsert %struct_blockName %fl %myblock 0 3 1 2 0 1 - OpReturn - OpFunctionEnd - )"; - - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpCompositeInsert reached non-composite type while " - "indexes still remain to be traversed.")); -} - -// Invalid. Result type doesn't match the type we get from indexing into -// the composite. -TEST_F(ValidateIdWithMessage, - CompositeExtractResultTypeDoesntMatchIndexedTypeBad) { - // indexes that we are passing are: 0, 3, 1, 2, 0 - // 0 will select the struct_s within the base struct (blockName) - // 3 will select the Array that contains 5 matrices - // 1 will select the Matrix that is at index 1 of the array - // 2 will select the column (which is a vector) within the matrix at index 2 - // 0 will select the element at the index 0 of the vector. (which is a float). - ostringstream spirv; - spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup << R"( - %myblock = OpLoad %struct_blockName %blockName_var - %fl = OpCompositeExtract %int %myblock 0 3 1 2 0 - OpReturn - OpFunctionEnd - )"; - - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpCompositeExtract result type (OpTypeInt) does not " - "match the type that results from indexing into the " - "composite (OpTypeFloat).")); -} - -// Invalid. Given object type doesn't match the type we get from indexing into -// the composite. -TEST_F(ValidateIdWithMessage, - CompositeInsertObjectTypeDoesntMatchIndexedTypeBad) { - // indexes that we are passing are: 0, 3, 1, 2, 0 - // 0 will select the struct_s within the base struct (blockName) - // 3 will select the Array that contains 5 matrices - // 1 will select the Matrix that is at index 1 of the array - // 2 will select the column (which is a vector) within the matrix at index 2 - // 0 will select the element at the index 0 of the vector. (which is a float). - // We are trying to insert an integer where we should be inserting a float. - ostringstream spirv; - spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup << R"( - %myblock = OpLoad %struct_blockName %blockName_var - %b5 = OpCompositeInsert %struct_blockName %int_0 %myblock 0 3 1 2 0 - OpReturn - OpFunctionEnd - )"; - - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("he Object type (OpTypeInt) in OpCompositeInsert does " - "not match the type that results from indexing into " - "the Composite (OpTypeFloat).")); -} - -// Invalid. Index into a struct is larger than the number of struct members. -TEST_F(ValidateIdWithMessage, CompositeExtractStructIndexOutOfBoundBad) { - // struct_blockName has 3 members (index 0,1,2). We'll try to access index 3. - ostringstream spirv; - spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup << R"( - %myblock = OpLoad %struct_blockName %blockName_var - %ss = OpCompositeExtract %struct_s %myblock 3 - OpReturn - OpFunctionEnd - )"; - - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Index is out of bounds: OpCompositeExtract can not " - "find index 3 into the structure '26'. This " - "structure has 3 members. Largest valid index is 2.")); -} - -// Invalid. Index into a struct is larger than the number of struct members. -TEST_F(ValidateIdWithMessage, CompositeInsertStructIndexOutOfBoundBad) { - // struct_blockName has 3 members (index 0,1,2). We'll try to access index 3. - ostringstream spirv; - spirv << kGLSL450MemoryModel << kDeeplyNestedStructureSetup << R"( - %myblock = OpLoad %struct_blockName %blockName_var - %ss = OpCompositeExtract %struct_s %myblock 0 - %new_composite = OpCompositeInsert %struct_blockName %ss %myblock 3 - OpReturn - OpFunctionEnd - )"; - - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("Index is out of bounds: OpCompositeInsert can not find " - "index 3 into the structure '26'. This structure " - "has 3 members. Largest valid index is 2.")); -} - -#if 0 -TEST_F(ValidateIdWithMessage, OpFunctionCallArgumentCountBar) { - const char *spirv = R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypeFunction %2 %2 -%4 = OpTypeFunction %1 -%5 = OpConstant %2 42 ;21 - -%6 = OpFunction %2 None %3 -%7 = OpFunctionParameter %2 -%8 = OpLabel -%9 = OpLoad %2 %7 - OpReturnValue %9 - OpFunctionEnd - -%10 = OpFunction %1 None %4 -%11 = OpLabel - OpReturn -%12 = OpFunctionCall %2 %6 %5 - OpFunctionEnd)"; - CHECK(spirv, SPV_ERROR_INVALID_ID); -} -#endif - -// TODO: The many things that changed with how images are used. -// TODO: OpTextureSample -// TODO: OpTextureSampleDref -// TODO: OpTextureSampleLod -// TODO: OpTextureSampleProj -// TODO: OpTextureSampleGrad -// TODO: OpTextureSampleOffset -// TODO: OpTextureSampleProjLod -// TODO: OpTextureSampleProjGrad -// TODO: OpTextureSampleLodOffset -// TODO: OpTextureSampleProjOffset -// TODO: OpTextureSampleGradOffset -// TODO: OpTextureSampleProjLodOffset -// TODO: OpTextureSampleProjGradOffset -// TODO: OpTextureFetchTexelLod -// TODO: OpTextureFetchTexelOffset -// TODO: OpTextureFetchSample -// TODO: OpTextureFetchTexel -// TODO: OpTextureGather -// TODO: OpTextureGatherOffset -// TODO: OpTextureGatherOffsets -// TODO: OpTextureQuerySizeLod -// TODO: OpTextureQuerySize -// TODO: OpTextureQueryLevels -// TODO: OpTextureQuerySamples -// TODO: OpConvertUToF -// TODO: OpConvertFToS -// TODO: OpConvertSToF -// TODO: OpConvertUToF -// TODO: OpUConvert -// TODO: OpSConvert -// TODO: OpFConvert -// TODO: OpConvertPtrToU -// TODO: OpConvertUToPtr -// TODO: OpPtrCastToGeneric -// TODO: OpGenericCastToPtr -// TODO: OpBitcast -// TODO: OpGenericCastToPtrExplicit -// TODO: OpSatConvertSToU -// TODO: OpSatConvertUToS -// TODO: OpVectorExtractDynamic -// TODO: OpVectorInsertDynamic -// TODO: OpVectorShuffle -// TODO: OpCompositeConstruct -// TODO: OpCompositeExtract -// TODO: OpCompositeInsert -// TODO: OpCopyObject -// TODO: OpTranspose -// TODO: OpSNegate -// TODO: OpFNegate -// TODO: OpNot -// TODO: OpIAdd -// TODO: OpFAdd -// TODO: OpISub -// TODO: OpFSub -// TODO: OpIMul -// TODO: OpFMul -// TODO: OpUDiv -// TODO: OpSDiv -// TODO: OpFDiv -// TODO: OpUMod -// TODO: OpSRem -// TODO: OpSMod -// TODO: OpFRem -// TODO: OpFMod -// TODO: OpVectorTimesScalar -// TODO: OpMatrixTimesScalar -// TODO: OpVectorTimesMatrix -// TODO: OpMatrixTimesVector -// TODO: OpMatrixTimesMatrix -// TODO: OpOuterProduct -// TODO: OpDot -// TODO: OpShiftRightLogical -// TODO: OpShiftRightArithmetic -// TODO: OpShiftLeftLogical -// TODO: OpBitwiseOr -// TODO: OpBitwiseXor -// TODO: OpBitwiseAnd -// TODO: OpAny -// TODO: OpAll -// TODO: OpIsNan -// TODO: OpIsInf -// TODO: OpIsFinite -// TODO: OpIsNormal -// TODO: OpSignBitSet -// TODO: OpLessOrGreater -// TODO: OpOrdered -// TODO: OpUnordered -// TODO: OpLogicalOr -// TODO: OpLogicalXor -// TODO: OpLogicalAnd -// TODO: OpSelect -// TODO: OpIEqual -// TODO: OpFOrdEqual -// TODO: OpFUnordEqual -// TODO: OpINotEqual -// TODO: OpFOrdNotEqual -// TODO: OpFUnordNotEqual -// TODO: OpULessThan -// TODO: OpSLessThan -// TODO: OpFOrdLessThan -// TODO: OpFUnordLessThan -// TODO: OpUGreaterThan -// TODO: OpSGreaterThan -// TODO: OpFOrdGreaterThan -// TODO: OpFUnordGreaterThan -// TODO: OpULessThanEqual -// TODO: OpSLessThanEqual -// TODO: OpFOrdLessThanEqual -// TODO: OpFUnordLessThanEqual -// TODO: OpUGreaterThanEqual -// TODO: OpSGreaterThanEqual -// TODO: OpFOrdGreaterThanEqual -// TODO: OpFUnordGreaterThanEqual -// TODO: OpDPdx -// TODO: OpDPdy -// TODO: OpFWidth -// TODO: OpDPdxFine -// TODO: OpDPdyFine -// TODO: OpFwidthFine -// TODO: OpDPdxCoarse -// TODO: OpDPdyCoarse -// TODO: OpFwidthCoarse -// TODO: OpPhi -// TODO: OpLoopMerge -// TODO: OpSelectionMerge -// TODO: OpBranch -// TODO: OpBranchConditional -// TODO: OpSwitch - -TEST_F(ValidateIdWithMessage, OpReturnValueConstantGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypeFunction %2 -%4 = OpConstant %2 42 -%5 = OpFunction %2 None %3 -%6 = OpLabel - OpReturnValue %4 - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpReturnValueVariableGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 ;10 -%3 = OpTypeFunction %2 -%8 = OpTypePointer Function %2 ;18 -%4 = OpConstant %2 42 ;22 -%5 = OpFunction %2 None %3 ;27 -%6 = OpLabel ;29 -%7 = OpVariable %8 Function %4 ;34 -%9 = OpLoad %2 %7 - OpReturnValue %9 ;36 - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpReturnValueExpressionGood) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypeFunction %2 -%4 = OpConstant %2 42 -%5 = OpFunction %2 None %3 -%6 = OpLabel -%7 = OpIAdd %2 %4 %4 - OpReturnValue %7 - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpReturnValueIsType) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypeFunction %2 -%5 = OpFunction %2 None %3 -%6 = OpLabel - OpReturnValue %1 - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpReturnValue Value '1' does not represent a value.")); -} - -TEST_F(ValidateIdWithMessage, OpReturnValueIsLabel) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypeFunction %2 -%5 = OpFunction %2 None %3 -%6 = OpLabel - OpReturnValue %6 - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpReturnValue Value '5' does not represent a value.")); -} - -TEST_F(ValidateIdWithMessage, OpReturnValueIsVoid) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypeFunction %1 -%5 = OpFunction %1 None %3 -%6 = OpLabel -%7 = OpFunctionCall %1 %5 - OpReturnValue %7 - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpReturnValue value's type '1' is missing or void.")); -} - -TEST_F(ValidateIdWithMessage, OpReturnValueIsVariableInPhysical) { - // It's valid to return a pointer in a physical addressing model. - string spirv = kGLSL450MemoryModel + R"( - OpMemoryModel Physical32 OpenCL -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypePointer Private %2 -%4 = OpTypeFunction %3 -%5 = OpFunction %3 None %4 -%6 = OpLabel -%7 = OpVariable %3 Function - OpReturnValue %7 - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpReturnValueIsVariableInLogical) { - // It's invalid to return a pointer in a physical addressing model. - string spirv = kGLSL450MemoryModel + R"( - OpMemoryModel Logical GLSL450 -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypePointer Private %2 -%4 = OpTypeFunction %3 -%5 = OpFunction %3 None %4 -%6 = OpLabel -%7 = OpVariable %3 Function - OpReturnValue %7 - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpReturnValue value's type '3' is a pointer, " - "which is invalid in the Logical addressing model.")); -} - -// With the VariablePointer Capability, the return value of a function is -// allowed to be a pointer. -TEST_F(ValidateIdWithMessage, OpReturnValueVarPtrGood) { - std::ostringstream spirv; - createVariablePointerSpirvProgram(&spirv, - "" /* Instructions to add to "main" */, - true /* Add VariablePointers Capability?*/, - true /* Use Helper Function? */); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Without the VariablePointer Capability, the return value of a function is -// *not* allowed to be a pointer. -// Disabled since using OpSelect with pointers without VariablePointers will -// fail LogicalsPass. -TEST_F(ValidateIdWithMessage, DISABLED_OpReturnValueVarPtrBad) { - std::ostringstream spirv; - createVariablePointerSpirvProgram(&spirv, - "" /* Instructions to add to "main" */, - false /* Add VariablePointers Capability?*/, - true /* Use Helper Function? */); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpReturnValue value's type '7' is a pointer, " - "which is invalid in the Logical addressing model.")); -} - -// TODO: enable when this bug is fixed: -// https://cvs.khronos.org/bugzilla/show_bug.cgi?id=15404 -TEST_F(ValidateIdWithMessage, DISABLED_OpReturnValueIsFunction) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeInt 32 0 -%3 = OpTypeFunction %2 -%5 = OpFunction %2 None %3 -%6 = OpLabel - OpReturnValue %5 - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, UndefinedTypeId) { - string spirv = kGLSL450MemoryModel + R"( -%s = OpTypeStruct %i32 -)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Forward reference operands in an OpTypeStruct must " - "first be declared using OpTypeForwardPointer.")); -} - -TEST_F(ValidateIdWithMessage, UndefinedIdScope) { - string spirv = kGLSL450MemoryModel + R"( -%u32 = OpTypeInt 32 0 -%memsem = OpConstant %u32 0 -%void = OpTypeVoid -%void_f = OpTypeFunction %void -%f = OpFunction %void None %void_f -%l = OpLabel - OpMemoryBarrier %undef %memsem - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("ID 7 has not been defined")); -} - -TEST_F(ValidateIdWithMessage, UndefinedIdMemSem) { - string spirv = kGLSL450MemoryModel + R"( -%u32 = OpTypeInt 32 0 -%scope = OpConstant %u32 0 -%void = OpTypeVoid -%void_f = OpTypeFunction %void -%f = OpFunction %void None %void_f -%l = OpLabel - OpMemoryBarrier %scope %undef - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("ID 7 has not been defined")); -} - -TEST_F(ValidateIdWithMessage, - KernelOpEntryPointAndOpInBoundsPtrAccessChainGood) { - string spirv = kOpenCLMemoryModel32 + R"( - OpEntryPoint Kernel %2 "simple_kernel" - OpSource OpenCL_C 200000 - OpDecorate %3 BuiltIn GlobalInvocationId - OpDecorate %3 Constant - OpDecorate %4 FuncParamAttr NoCapture - OpDecorate %3 LinkageAttributes "__spirv_GlobalInvocationId" Import - %5 = OpTypeInt 32 0 - %6 = OpTypeVector %5 3 - %7 = OpTypePointer UniformConstant %6 - %3 = OpVariable %7 UniformConstant - %8 = OpTypeVoid - %9 = OpTypeStruct %5 -%10 = OpTypePointer CrossWorkgroup %9 -%11 = OpTypeFunction %8 %10 -%12 = OpConstant %5 0 -%13 = OpTypePointer CrossWorkgroup %5 -%14 = OpConstant %5 42 - %2 = OpFunction %8 None %11 - %4 = OpFunctionParameter %10 -%15 = OpLabel -%16 = OpLoad %6 %3 Aligned 0 -%17 = OpCompositeExtract %5 %16 0 -%18 = OpInBoundsPtrAccessChain %13 %4 %17 %12 - OpStore %18 %14 Aligned 4 - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpPtrAccessChainGood) { - string spirv = kOpenCLMemoryModel64 + R"( - OpEntryPoint Kernel %2 "another_kernel" - OpSource OpenCL_C 200000 - OpDecorate %3 BuiltIn GlobalInvocationId - OpDecorate %3 Constant - OpDecorate %4 FuncParamAttr NoCapture - OpDecorate %3 LinkageAttributes "__spirv_GlobalInvocationId" Import - %5 = OpTypeInt 64 0 - %6 = OpTypeVector %5 3 - %7 = OpTypePointer UniformConstant %6 - %3 = OpVariable %7 UniformConstant - %8 = OpTypeVoid - %9 = OpTypeInt 32 0 -%10 = OpTypeStruct %9 -%11 = OpTypePointer CrossWorkgroup %10 -%12 = OpTypeFunction %8 %11 -%13 = OpConstant %5 4294967295 -%14 = OpConstant %9 0 -%15 = OpTypePointer CrossWorkgroup %9 -%16 = OpConstant %9 42 - %2 = OpFunction %8 None %12 - %4 = OpFunctionParameter %11 -%17 = OpLabel -%18 = OpLoad %6 %3 Aligned 0 -%19 = OpCompositeExtract %5 %18 0 -%20 = OpBitwiseAnd %5 %19 %13 -%21 = OpPtrAccessChain %15 %4 %20 %14 - OpStore %21 %16 Aligned 4 - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateIdWithMessage, OpLoadBitcastPointerGood) { - string spirv = kOpenCLMemoryModel64 + R"( -%2 = OpTypeVoid -%3 = OpTypeInt 32 0 -%4 = OpTypeFloat 32 -%5 = OpTypePointer UniformConstant %3 -%6 = OpTypePointer UniformConstant %4 -%7 = OpVariable %5 UniformConstant -%8 = OpTypeFunction %2 -%9 = OpFunction %2 None %8 -%10 = OpLabel -%11 = OpBitcast %6 %7 -%12 = OpLoad %4 %11 - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpLoadBitcastNonPointerBad) { - string spirv = kOpenCLMemoryModel64 + R"( -%2 = OpTypeVoid -%3 = OpTypeInt 32 0 -%4 = OpTypeFloat 32 -%5 = OpTypePointer UniformConstant %3 -%6 = OpTypeFunction %2 -%7 = OpVariable %5 UniformConstant -%8 = OpFunction %2 None %6 -%9 = OpLabel -%10 = OpLoad %3 %7 -%11 = OpBitcast %4 %10 -%12 = OpLoad %3 %11 - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpLoad type for pointer '11' is not a pointer type.")); -} -TEST_F(ValidateIdWithMessage, OpStoreBitcastPointerGood) { - string spirv = kOpenCLMemoryModel64 + R"( -%2 = OpTypeVoid -%3 = OpTypeInt 32 0 -%4 = OpTypeFloat 32 -%5 = OpTypePointer Function %3 -%6 = OpTypePointer Function %4 -%7 = OpTypeFunction %2 -%8 = OpConstant %3 42 -%9 = OpFunction %2 None %7 -%10 = OpLabel -%11 = OpVariable %6 Function -%12 = OpBitcast %5 %11 - OpStore %12 %8 - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} -TEST_F(ValidateIdWithMessage, OpStoreBitcastNonPointerBad) { - string spirv = kOpenCLMemoryModel64 + R"( -%2 = OpTypeVoid -%3 = OpTypeInt 32 0 -%4 = OpTypeFloat 32 -%5 = OpTypePointer Function %4 -%6 = OpTypeFunction %2 -%7 = OpConstant %4 42 -%8 = OpFunction %2 None %6 -%9 = OpLabel -%10 = OpVariable %5 Function -%11 = OpBitcast %3 %7 - OpStore %11 %7 - OpReturn - OpFunctionEnd)"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpStore type for pointer '11' is not a pointer type.")); -} - -// Result resulting from an instruction within a function may not be used -// outside that function. -TEST_F(ValidateIdWithMessage, ResultIdUsedOutsideOfFunctionBad) { - string spirv = kGLSL450MemoryModel + R"( -%1 = OpTypeVoid -%2 = OpTypeFunction %1 -%3 = OpTypeInt 32 0 -%4 = OpTypePointer Function %3 -%5 = OpFunction %1 None %2 -%6 = OpLabel -%7 = OpVariable %4 Function -OpReturn -OpFunctionEnd -%8 = OpFunction %1 None %2 -%9 = OpLabel -%10 = OpLoad %3 %7 -OpReturn -OpFunctionEnd - )"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "ID 7 defined in block 6 does not dominate its use in block 9")); -} - -TEST_F(ValidateIdWithMessage, SpecIdTargetNotSpecializationConstant) { - string spirv = kGLSL450MemoryModel + R"( -OpDecorate %1 SpecId 200 -%void = OpTypeVoid -%2 = OpTypeFunction %void -%int = OpTypeInt 32 0 -%1 = OpConstant %int 3 -%main = OpFunction %1 None %2 -%4 = OpLabel -OpReturnValue %1 -OpFunctionEnd - )"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpDecorate SpectId decoration target '1' is not a " - "scalar specialization constant.")); -} - -TEST_F(ValidateIdWithMessage, SpecIdTargetOpSpecConstantOpBad) { - string spirv = kGLSL450MemoryModel + R"( -OpDecorate %1 SpecId 200 -%void = OpTypeVoid -%2 = OpTypeFunction %void -%int = OpTypeInt 32 0 -%3 = OpConstant %int 1 -%4 = OpConstant %int 2 -%1 = OpSpecConstantOp %int IAdd %3 %4 -%main = OpFunction %1 None %2 -%6 = OpLabel -OpReturnValue %3 -OpFunctionEnd - )"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpDecorate SpectId decoration target '1' is not a " - "scalar specialization constant.")); -} - -TEST_F(ValidateIdWithMessage, SpecIdTargetOpSpecConstantCompositeBad) { - string spirv = kGLSL450MemoryModel + R"( -OpDecorate %1 SpecId 200 -%void = OpTypeVoid -%2 = OpTypeFunction %void -%int = OpTypeInt 32 0 -%3 = OpConstant %int 1 -%1 = OpSpecConstantComposite %int -%main = OpFunction %1 None %2 -%4 = OpLabel -OpReturnValue %3 -OpFunctionEnd - )"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("OpDecorate SpectId decoration target '1' is not a " - "scalar specialization constant.")); -} - -TEST_F(ValidateIdWithMessage, SpecIdTargetGood) { - string spirv = kGLSL450MemoryModel + R"( -OpDecorate %3 SpecId 200 -OpDecorate %4 SpecId 201 -OpDecorate %5 SpecId 202 -%1 = OpTypeVoid -%2 = OpTypeFunction %1 -%int = OpTypeInt 32 0 -%bool = OpTypeBool -%3 = OpSpecConstant %int 3 -%4 = OpSpecConstantTrue %bool -%5 = OpSpecConstantFalse %bool -%main = OpFunction %1 None %2 -%6 = OpLabel -OpReturn -OpFunctionEnd - )"; - CompileSuccessfully(spirv.c_str()); - EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); -} - -// TODO: OpLifetimeStart -// TODO: OpLifetimeStop -// TODO: OpAtomicInit -// TODO: OpAtomicLoad -// TODO: OpAtomicStore -// TODO: OpAtomicExchange -// TODO: OpAtomicCompareExchange -// TODO: OpAtomicCompareExchangeWeak -// TODO: OpAtomicIIncrement -// TODO: OpAtomicIDecrement -// TODO: OpAtomicIAdd -// TODO: OpAtomicISub -// TODO: OpAtomicUMin -// TODO: OpAtomicUMax -// TODO: OpAtomicAnd -// TODO: OpAtomicOr -// TODO: OpAtomicXor -// TODO: OpAtomicIMin -// TODO: OpAtomicIMax -// TODO: OpEmitStreamVertex -// TODO: OpEndStreamPrimitive -// TODO: OpAsyncGroupCopy -// TODO: OpWaitGroupEvents -// TODO: OpGroupAll -// TODO: OpGroupAny -// TODO: OpGroupBroadcast -// TODO: OpGroupIAdd -// TODO: OpGroupFAdd -// TODO: OpGroupFMin -// TODO: OpGroupUMin -// TODO: OpGroupSMin -// TODO: OpGroupFMax -// TODO: OpGroupUMax -// TODO: OpGroupSMax -// TODO: OpEnqueueMarker -// TODO: OpEnqueueKernel -// TODO: OpGetKernelNDrangeSubGroupCount -// TODO: OpGetKernelNDrangeMaxSubGroupSize -// TODO: OpGetKernelWorkGroupSize -// TODO: OpGetKernelPreferredWorkGroupSizeMultiple -// TODO: OpRetainEvent -// TODO: OpReleaseEvent -// TODO: OpCreateUserEvent -// TODO: OpIsValidEvent -// TODO: OpSetUserEventStatus -// TODO: OpCaptureEventProfilingInfo -// TODO: OpGetDefaultQueue -// TODO: OpBuildNDRange -// TODO: OpReadPipe -// TODO: OpWritePipe -// TODO: OpReservedReadPipe -// TODO: OpReservedWritePipe -// TODO: OpReserveReadPipePackets -// TODO: OpReserveWritePipePackets -// TODO: OpCommitReadPipe -// TODO: OpCommitWritePipe -// TODO: OpIsValidReserveId -// TODO: OpGetNumPipePackets -// TODO: OpGetMaxPipePackets -// TODO: OpGroupReserveReadPipePackets -// TODO: OpGroupReserveWritePipePackets -// TODO: OpGroupCommitReadPipe -// TODO: OpGroupCommitWritePipe - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_instructions_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_instructions_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_instructions_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_instructions_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Validation tests for illegal instructions - -#include -#include -#include - -#include "gmock/gmock.h" -#include "val_fixtures.h" - -using ::testing::HasSubstr; - -using ImageSampleTestParameter = std::pair; - -const std::string& Opcode(const ImageSampleTestParameter& p) { return p.first; } -const std::string& Operands(const ImageSampleTestParameter& p) { - return p.second; -} - -using ValidateIns = spvtest::ValidateBase; - -namespace { - -TEST_P(ValidateIns, Reserved) { - const auto& param = GetParam(); - - std::string str = R"( - OpCapability Shader - OpCapability SparseResidency - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" %img -%void = OpTypeVoid -%int = OpTypeInt 32 0 -%float = OpTypeFloat 32 -%fnt = OpTypeFunction %void -%coord = OpConstantNull %float -%lod = OpConstantNull %float -%dref = OpConstantNull %float -%imgt = OpTypeImage %float 2D 0 0 0 0 Rgba32f -%sampledt = OpTypeSampledImage %imgt -%sampledp = OpTypePointer Uniform %sampledt -%img = OpVariable %sampledp Input -%main = OpFunction %void None %fnt -%label = OpLabel -%sample = Op)" + Opcode(param) + - " " + Operands(param) + R"( - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - EXPECT_EQ(SPV_ERROR_INVALID_VALUE, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr(Opcode(param) + " is reserved for future use.")); -} - -#define CASE(NAME, ARGS) \ - { "ImageSparseSampleProj" #NAME, ARGS } - -INSTANTIATE_TEST_CASE_P( - OpImageSparseSampleProj, ValidateIns, - ::testing::ValuesIn(std::vector{ - CASE(ImplicitLod, "%float %img %coord"), - CASE(ExplicitLod, "%float %img %coord Lod %lod"), - CASE(DrefImplicitLod, "%float %img %coord %dref"), - CASE(DrefExplicitLod, "%float %img %coord %dref Lod %lod"), - }), ); -#undef CASE -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_layout_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_layout_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_layout_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_layout_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,605 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Validation tests for Logical Layout - -#include -#include -#include -#include - -#include "gmock/gmock.h" -#include "source/diagnostic.h" -#include "unit_spirv.h" -#include "val_fixtures.h" - -using std::function; -using std::ostream; -using std::ostream_iterator; -using std::pair; -using std::stringstream; -using std::string; -using std::tie; -using std::tuple; -using std::vector; - -using ::testing::Eq; -using ::testing::HasSubstr; -using ::testing::StrEq; -using libspirv::spvResultToString; - -using pred_type = function; -using ValidateLayout = - spvtest::ValidateBase>>; - -namespace { - -// returns true if order is equal to VAL -template -spv_result_t Equals(int order) { - return order == VAL ? SPV_SUCCESS : RET; -} - -// returns true if order is between MIN and MAX(inclusive) -template -struct Range { - explicit Range(bool inverse = false) : inverse_(inverse) {} - spv_result_t operator()(int order) { - return (inverse_ ^ (order >= MIN && order <= MAX)) ? SPV_SUCCESS : RET; - } - - private: - bool inverse_; -}; - -template -spv_result_t InvalidSet(int order) { - for (spv_result_t val : {T(true)(order)...}) - if (val != SPV_SUCCESS) return val; - return SPV_SUCCESS; -} - -// SPIRV source used to test the logical layout -const vector& getInstructions() { - // clang-format off - static const vector instructions = { - "OpCapability Shader", - "OpExtension \"TestExtension\"", - "%inst = OpExtInstImport \"GLSL.std.450\"", - "OpMemoryModel Logical GLSL450", - "OpEntryPoint GLCompute %func \"\"", - "OpExecutionMode %func LocalSize 1 1 1", - "%str = OpString \"Test String\"", - "%str2 = OpString \"blabla\"", - "OpSource GLSL 450 %str \"uniform vec3 var = vec3(4.0);\"", - "OpSourceContinued \"void main(){return;}\"", - "OpSourceExtension \"Test extension\"", - "OpName %func \"MyFunction\"", - "OpMemberName %struct 1 \"my_member\"", - "OpDecorate %dgrp RowMajor", - "OpMemberDecorate %struct 1 RowMajor", - "%dgrp = OpDecorationGroup", - "OpGroupDecorate %dgrp %mat33 %mat44", - "%intt = OpTypeInt 32 1", - "%floatt = OpTypeFloat 32", - "%voidt = OpTypeVoid", - "%boolt = OpTypeBool", - "%vec4 = OpTypeVector %floatt 4", - "%vec3 = OpTypeVector %floatt 3", - "%mat33 = OpTypeMatrix %vec3 3", - "%mat44 = OpTypeMatrix %vec4 4", - "%struct = OpTypeStruct %intt %mat33", - "%vfunct = OpTypeFunction %voidt", - "%viifunct = OpTypeFunction %voidt %intt %intt", - "%one = OpConstant %intt 1", - // TODO(umar): OpConstant fails because the type is not defined - // TODO(umar): OpGroupMemberDecorate - "OpLine %str 3 4", - "OpNoLine", - "%func = OpFunction %voidt None %vfunct", - "%l = OpLabel", - "OpReturn ; %func return", - "OpFunctionEnd ; %func end", - "%func2 = OpFunction %voidt None %viifunct", - "%funcp1 = OpFunctionParameter %intt", - "%funcp2 = OpFunctionParameter %intt", - "%fLabel = OpLabel", - "OpNop", - "OpReturn ; %func2 return", - "OpFunctionEnd" - }; - return instructions; -} - -static const int kRangeEnd = 1000; -pred_type All = Range<0, kRangeEnd>(); - -INSTANTIATE_TEST_CASE_P(InstructionsOrder, - ValidateLayout, - ::testing::Combine(::testing::Range((int)0, (int)getInstructions().size()), - // Note: Because of ID dependencies between instructions, some instructions - // are not free to be placed anywhere without triggering an non-layout - // validation error. Therefore, "Lines to compile" for some instructions - // are not "All" in the below. - // - // | Instruction | Line(s) valid | Lines to compile - ::testing::Values( make_tuple(string("OpCapability") , Equals<0> , Range<0, 2>()) - , make_tuple(string("OpExtension") , Equals<1> , All) - , make_tuple(string("OpExtInstImport") , Equals<2> , All) - , make_tuple(string("OpMemoryModel") , Equals<3> , Range<1, kRangeEnd>()) - , make_tuple(string("OpEntryPoint") , Equals<4> , All) - , make_tuple(string("OpExecutionMode") , Equals<5> , All) - , make_tuple(string("OpSource ") , Range<6, 10>() , Range<7, kRangeEnd>()) - , make_tuple(string("OpSourceContinued ") , Range<6, 10>() , All) - , make_tuple(string("OpSourceExtension ") , Range<6, 10>() , All) - , make_tuple(string("%str2 = OpString ") , Range<6, 10>() , All) - , make_tuple(string("OpName ") , Range<11, 12>() , All) - , make_tuple(string("OpMemberName ") , Range<11, 12>() , All) - , make_tuple(string("OpDecorate ") , Range<13, 16>() , All) - , make_tuple(string("OpMemberDecorate ") , Range<13, 16>() , All) - , make_tuple(string("OpGroupDecorate ") , Range<13, 16>() , Range<16, kRangeEnd>()) - , make_tuple(string("OpDecorationGroup") , Range<13, 16>() , Range<0, 15>()) - , make_tuple(string("OpTypeBool") , Range<17, 30>() , All) - , make_tuple(string("OpTypeVoid") , Range<17, 30>() , Range<0, 25>()) - , make_tuple(string("OpTypeFloat") , Range<17, 30>() , Range<0,20>()) - , make_tuple(string("OpTypeInt") , Range<17, 30>() , Range<0, 20>()) - , make_tuple(string("OpTypeVector %floatt 4") , Range<17, 30>() , Range<19, 23>()) - , make_tuple(string("OpTypeMatrix %vec4 4") , Range<17, 30>() , Range<22, kRangeEnd>()) - , make_tuple(string("OpTypeStruct") , Range<17, 30>() , Range<24, kRangeEnd>()) - , make_tuple(string("%vfunct = OpTypeFunction"), Range<17, 30>() , Range<20, 30>()) - , make_tuple(string("OpConstant") , Range<17, 30>() , Range<20, kRangeEnd>()) - , make_tuple(string("OpLine ") , Range<17, kRangeEnd>() , Range<7, kRangeEnd>()) - , make_tuple(string("OpNoLine") , Range<17, kRangeEnd>() , All) - , make_tuple(string("%fLabel = OpLabel") , Equals<38> , All) - , make_tuple(string("OpNop") , Equals<39> , Range<39,kRangeEnd>()) - , make_tuple(string("OpReturn ; %func2 return") , Equals<40> , All) - )),); -// clang-format on - -// Creates a new vector which removes the string if the substr is found in the -// instructions vector and reinserts it in the location specified by order. -// NOTE: This will not work correctly if there are two instances of substr in -// instructions -vector GenerateCode(string substr, int order) { - vector code(getInstructions().size()); - vector inst(1); - partition_copy(begin(getInstructions()), end(getInstructions()), begin(code), - begin(inst), [=](const string& str) { - return string::npos == str.find(substr); - }); - - code.insert(begin(code) + order, inst.front()); - return code; -} - -// This test will check the logical layout of a binary by removing each -// instruction in the pair of the INSTANTIATE_TEST_CASE_P call and moving it in -// the SPIRV source formed by combining the vector "instructions". -TEST_P(ValidateLayout, Layout) { - int order; - string instruction; - pred_type pred; - pred_type test_pred; // Predicate to determine if the test should be build - tuple testCase; - - tie(order, testCase) = GetParam(); - tie(instruction, pred, test_pred) = testCase; - - // Skip test which break the code generation - if (test_pred(order)) return; - - vector code = GenerateCode(instruction, order); - - stringstream ss; - copy(begin(code), end(code), ostream_iterator(ss, "\n")); - - // printf("code: \n%s\n", ss.str().c_str()); - CompileSuccessfully(ss.str()); - spv_result_t result; - // clang-format off - ASSERT_EQ(pred(order), result = ValidateInstructions()) - << "Actual: " << spvResultToString(result) - << "\nExpected: " << spvResultToString(pred(order)) - << "\nOrder: " << order - << "\nInstruction: " << instruction - << "\nCode: \n" << ss.str(); - // clang-format on -} - -TEST_F(ValidateLayout, MemoryModelMissing) { - string str = R"( - OpCapability Matrix - OpExtension "TestExtension" - %inst = OpExtInstImport "GLSL.std.450" - OpEntryPoint GLCompute %func "" - OpExecutionMode %func LocalSize 1 1 1 - )"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "EntryPoint cannot appear before the memory model instruction")); -} - -TEST_F(ValidateLayout, FunctionDefinitionBeforeDeclarationBad) { - char str[] = R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpDecorate %var Restrict -%intt = OpTypeInt 32 1 -%voidt = OpTypeVoid -%vfunct = OpTypeFunction %voidt -%vifunct = OpTypeFunction %voidt %intt -%ptrt = OpTypePointer Function %intt -%func = OpFunction %voidt None %vfunct -%funcl = OpLabel - OpNop - OpReturn - OpFunctionEnd -%func2 = OpFunction %voidt None %vifunct ; must appear before definition -%func2p = OpFunctionParameter %intt - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "Function declarations must appear before function definitions.")); -} - -// TODO(umar): Passes but gives incorrect error message. Should be fixed after -// type checking -TEST_F(ValidateLayout, LabelBeforeFunctionParameterBad) { - char str[] = R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpDecorate %var Restrict -%intt = OpTypeInt 32 1 -%voidt = OpTypeVoid -%vfunct = OpTypeFunction %voidt -%vifunct = OpTypeFunction %voidt %intt -%ptrt = OpTypePointer Function %intt -%func = OpFunction %voidt None %vifunct -%funcl = OpLabel ; Label appears before function parameter -%func2p = OpFunctionParameter %intt - OpNop - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Function parameters must only appear immediately " - "after the function definition")); -} - -TEST_F(ValidateLayout, FuncParameterNotImmediatlyAfterFuncBad) { - char str[] = R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpDecorate %var Restrict -%intt = OpTypeInt 32 1 -%voidt = OpTypeVoid -%vfunct = OpTypeFunction %voidt -%vifunct = OpTypeFunction %voidt %intt -%ptrt = OpTypePointer Function %intt -%func = OpFunction %voidt None %vifunct -%funcl = OpLabel - OpNop - OpBranch %next -%func2p = OpFunctionParameter %intt ;FunctionParameter appears in a function but not immediately afterwards -%next = OpLabel - OpNop - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Function parameters must only appear immediately " - "after the function definition")); -} - -TEST_F(ValidateLayout, OpUndefCanAppearInTypeDeclarationSection) { - string str = R"( - OpCapability Kernel - OpCapability Linkage - OpMemoryModel Logical OpenCL -%voidt = OpTypeVoid -%uintt = OpTypeInt 32 0 -%funct = OpTypeFunction %voidt -%udef = OpUndef %uintt -%func = OpFunction %voidt None %funct -%entry = OpLabel - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateLayout, OpUndefCanAppearInBlock) { - string str = R"( - OpCapability Kernel - OpCapability Linkage - OpMemoryModel Logical OpenCL -%voidt = OpTypeVoid -%uintt = OpTypeInt 32 0 -%funct = OpTypeFunction %voidt -%func = OpFunction %voidt None %funct -%entry = OpLabel -%udef = OpUndef %uintt - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateLayout, MissingFunctionEndForFunctionWithBody) { - const auto s = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -%void = OpTypeVoid -%tf = OpTypeFunction %void -%f = OpFunction %void None %tf -%l = OpLabel -OpReturn -)"; - - CompileSuccessfully(s); - ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - StrEq("Missing OpFunctionEnd at end of module.")); -} - -TEST_F(ValidateLayout, MissingFunctionEndForFunctionPrototype) { - const auto s = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -%void = OpTypeVoid -%tf = OpTypeFunction %void -%f = OpFunction %void None %tf -)"; - - CompileSuccessfully(s); - ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - StrEq("Missing OpFunctionEnd at end of module.")); -} - -using ValidateOpFunctionParameter = spvtest::ValidateBase; - -TEST_F(ValidateOpFunctionParameter, OpLineBetweenParameters) { - const auto s = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -%foo_frag = OpString "foo.frag" -%i32 = OpTypeInt 32 1 -%tf = OpTypeFunction %i32 %i32 %i32 -%c = OpConstant %i32 123 -%f = OpFunction %i32 None %tf -OpLine %foo_frag 1 1 -%p1 = OpFunctionParameter %i32 -OpNoLine -%p2 = OpFunctionParameter %i32 -%l = OpLabel -OpReturnValue %c -OpFunctionEnd -)"; - CompileSuccessfully(s); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateOpFunctionParameter, TooManyParameters) { - const auto s = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -%i32 = OpTypeInt 32 1 -%tf = OpTypeFunction %i32 %i32 %i32 -%c = OpConstant %i32 123 -%f = OpFunction %i32 None %tf -%p1 = OpFunctionParameter %i32 -%p2 = OpFunctionParameter %i32 -%xp3 = OpFunctionParameter %i32 -%xp4 = OpFunctionParameter %i32 -%xp5 = OpFunctionParameter %i32 -%xp6 = OpFunctionParameter %i32 -%xp7 = OpFunctionParameter %i32 -%l = OpLabel -OpReturnValue %c -OpFunctionEnd -)"; - CompileSuccessfully(s); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); -} - -using ValidateEntryPoint = spvtest::ValidateBase; - -// Tests that not having OpEntryPoint causes an error. -TEST_F(ValidateEntryPoint, NoEntryPointBad) { - std::string spirv = R"( - OpCapability Shader - OpMemoryModel Logical GLSL450)"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("No OpEntryPoint instruction was found. This is only " - "allowed if the Linkage capability is being used.")); -} - -// Invalid. A function may not be a target of both OpEntryPoint and -// OpFunctionCall. -TEST_F(ValidateEntryPoint, FunctionIsTargetOfEntryPointAndFunctionCallBad) { - std::string spirv = R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %foo "foo" -%voidt = OpTypeVoid -%funct = OpTypeFunction %voidt -%foo = OpFunction %voidt None %funct -%entry = OpLabel -%recurse = OpFunctionCall %voidt %foo - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("A function (1) may not be targeted by both an OpEntryPoint " - "instruction and an OpFunctionCall instruction.")); -} - -// Valid. Module with a function but no entry point is valid when Linkage -// Capability is used. -TEST_F(ValidateEntryPoint, NoEntryPointWithLinkageCapGood) { - std::string spirv = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 -%voidt = OpTypeVoid -%funct = OpTypeFunction %voidt -%foo = OpFunction %voidt None %funct -%entry = OpLabel - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateLayout, ModuleProcessedInvalidIn10) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpName %void "void" - OpModuleProcessed "this is ok in 1.1 and later" - OpDecorate %void Volatile ; bogus, but makes the example short -%void = OpTypeVoid -)"; - - CompileSuccessfully(str, SPV_ENV_UNIVERSAL_1_1); - ASSERT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions(SPV_ENV_UNIVERSAL_1_0)); - // In a 1.0 environment the binary parse fails before we even get to - // validation. This occurs no matter where the OpModuleProcessed is placed. - EXPECT_THAT(getDiagnosticString(), HasSubstr("Invalid opcode: 330")); -} - -TEST_F(ValidateLayout, ModuleProcessedValidIn11) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpName %void "void" - OpModuleProcessed "this is ok in 1.1 and later" - OpDecorate %void Volatile ; bogus, but makes the example short -%void = OpTypeVoid -)"; - - CompileSuccessfully(str, SPV_ENV_UNIVERSAL_1_1); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); - EXPECT_THAT(getDiagnosticString(), Eq("")); -} - -TEST_F(ValidateLayout, ModuleProcessedBeforeLastNameIsTooEarly) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpModuleProcessed "this is too early" - OpName %void "void" -%void = OpTypeVoid -)"; - - CompileSuccessfully(str, SPV_ENV_UNIVERSAL_1_1); - ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); - // By the mechanics of the validator, we assume ModuleProcessed is in the - // right spot, but then that OpName is in the wrong spot. - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Name cannot appear in a function declaration")); -} - -TEST_F(ValidateLayout, ModuleProcessedInvalidAfterFirstAnnotation) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpDecorate %void Volatile ; this is bogus, but keeps the example short - OpModuleProcessed "this is too late" -%void = OpTypeVoid -)"; - - CompileSuccessfully(str, SPV_ENV_UNIVERSAL_1_1); - ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("ModuleProcessed cannot appear in a function declaration")); -} - -TEST_F(ValidateLayout, ModuleProcessedInvalidInFunctionBeforeLabel) { - char str[] = R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %main "main" -%void = OpTypeVoid -%voidfn = OpTypeFunction %void -%main = OpFunction %void None %voidfn - OpModuleProcessed "this is too late, in function before label" -%entry = OpLabel - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str, SPV_ENV_UNIVERSAL_1_1); - ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("ModuleProcessed cannot appear in a function declaration")); -} - -TEST_F(ValidateLayout, ModuleProcessedInvalidInBasicBlock) { - char str[] = R"( - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %main "main" -%void = OpTypeVoid -%voidfn = OpTypeFunction %void -%main = OpFunction %void None %voidfn -%entry = OpLabel - OpModuleProcessed "this is too late, in basic block" - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str, SPV_ENV_UNIVERSAL_1_1); - ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("ModuleProcessed cannot appear in a function declaration")); -} - - -// TODO(umar): Test optional instructions -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_limits_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_limits_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_limits_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_limits_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,706 +0,0 @@ -// Copyright (c) 2016 Google 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. - -// Validation tests for Universal Limits. (Section 2.17 of the SPIR-V Spec) - -#include -#include -#include - -#include "gmock/gmock.h" -#include "unit_spirv.h" -#include "val_fixtures.h" - -namespace { - -using ::testing::HasSubstr; -using ::testing::MatchesRegex; -using std::string; - -using ValidateLimits = spvtest::ValidateBase; - -string header = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 -)"; - -TEST_F(ValidateLimits, IdLargerThanBoundBad) { - string str = header + R"( -; %i32 has ID 1 -%i32 = OpTypeInt 32 1 -%c = OpConstant %i32 100 - -; Fake an instruction with 64 as the result id. -; !64 = OpConstantNull %i32 -!0x3002e !1 !64 -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("Result '64' must be less than the ID bound '3'.")); -} - -TEST_F(ValidateLimits, IdEqualToBoundBad) { - string str = header + R"( -; %i32 has ID 1 -%i32 = OpTypeInt 32 1 -%c = OpConstant %i32 100 - -; Fake an instruction with 64 as the result id. -; !64 = OpConstantNull %i32 -!0x3002e !1 !64 -)"; - - CompileSuccessfully(str); - - // The largest ID used in this program is 64. Let's overwrite the ID bound in - // the header to be 64. This should result in an error because all IDs must - // satisfy: 0 < id < bound. - OverwriteAssembledBinary(3, 64); - - ASSERT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr("Result '64' must be less than the ID bound '64'.")); -} - -TEST_F(ValidateLimits, StructNumMembersGood) { - std::ostringstream spirv; - spirv << header << R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeStruct)"; - for (int i = 0; i < 16383; ++i) { - spirv << " %1"; - } - CompileSuccessfully(spirv.str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateLimits, StructNumMembersExceededBad) { - std::ostringstream spirv; - spirv << header << R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeStruct)"; - for (int i = 0; i < 16384; ++i) { - spirv << " %1"; - } - CompileSuccessfully(spirv.str()); - ASSERT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Number of OpTypeStruct members (16384) has exceeded " - "the limit (16383).")); -} - -TEST_F(ValidateLimits, CustomizedStructNumMembersGood) { - std::ostringstream spirv; - spirv << header << R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeStruct)"; - for (int i = 0; i < 32000; ++i) { - spirv << " %1"; - } - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_struct_members, 32000u); - CompileSuccessfully(spirv.str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateLimits, CustomizedStructNumMembersBad) { - std::ostringstream spirv; - spirv << header << R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeStruct)"; - for (int i = 0; i < 32001; ++i) { - spirv << " %1"; - } - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_struct_members, 32000u); - CompileSuccessfully(spirv.str()); - ASSERT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Number of OpTypeStruct members (32001) has exceeded " - "the limit (32000).")); -} - -// Valid: Switch statement has 16,383 branches. -TEST_F(ValidateLimits, SwitchNumBranchesGood) { - std::ostringstream spirv; - spirv << header << R"( -%1 = OpTypeVoid -%2 = OpTypeFunction %1 -%3 = OpTypeInt 32 0 -%4 = OpConstant %3 1234 -%5 = OpFunction %1 None %2 -%7 = OpLabel -%8 = OpIAdd %3 %4 %4 -%9 = OpSwitch %4 %10)"; - - // Now add the (literal, label) pairs - for (int i = 0; i < 16383; ++i) { - spirv << " 1 %10"; - } - - spirv << R"( -%10 = OpLabel -OpReturn -OpFunctionEnd - )"; - - CompileSuccessfully(spirv.str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: Switch statement has 16,384 branches. -TEST_F(ValidateLimits, SwitchNumBranchesBad) { - std::ostringstream spirv; - spirv << header << R"( -%1 = OpTypeVoid -%2 = OpTypeFunction %1 -%3 = OpTypeInt 32 0 -%4 = OpConstant %3 1234 -%5 = OpFunction %1 None %2 -%7 = OpLabel -%8 = OpIAdd %3 %4 %4 -%9 = OpSwitch %4 %10)"; - - // Now add the (literal, label) pairs - for (int i = 0; i < 16384; ++i) { - spirv << " 1 %10"; - } - - spirv << R"( -%10 = OpLabel -OpReturn -OpFunctionEnd - )"; - - CompileSuccessfully(spirv.str()); - ASSERT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Number of (literal, label) pairs in OpSwitch (16384) " - "exceeds the limit (16383).")); -} - -// Valid: Switch statement has 10 branches (limit is 10) -TEST_F(ValidateLimits, CustomizedSwitchNumBranchesGood) { - std::ostringstream spirv; - spirv << header << R"( -%1 = OpTypeVoid -%2 = OpTypeFunction %1 -%3 = OpTypeInt 32 0 -%4 = OpConstant %3 1234 -%5 = OpFunction %1 None %2 -%7 = OpLabel -%8 = OpIAdd %3 %4 %4 -%9 = OpSwitch %4 %10)"; - - // Now add the (literal, label) pairs - for (int i = 0; i < 10; ++i) { - spirv << " 1 %10"; - } - - spirv << R"( -%10 = OpLabel -OpReturn -OpFunctionEnd - )"; - - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_switch_branches, 10u); - CompileSuccessfully(spirv.str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: Switch statement has 11 branches (limit is 10) -TEST_F(ValidateLimits, CustomizedSwitchNumBranchesBad) { - std::ostringstream spirv; - spirv << header << R"( -%1 = OpTypeVoid -%2 = OpTypeFunction %1 -%3 = OpTypeInt 32 0 -%4 = OpConstant %3 1234 -%5 = OpFunction %1 None %2 -%7 = OpLabel -%8 = OpIAdd %3 %4 %4 -%9 = OpSwitch %4 %10)"; - - // Now add the (literal, label) pairs - for (int i = 0; i < 11; ++i) { - spirv << " 1 %10"; - } - - spirv << R"( -%10 = OpLabel -OpReturn -OpFunctionEnd - )"; - - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_switch_branches, 10u); - CompileSuccessfully(spirv.str()); - ASSERT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Number of (literal, label) pairs in OpSwitch (11) " - "exceeds the limit (10).")); -} - -// Valid: OpTypeFunction with 255 arguments. -TEST_F(ValidateLimits, OpTypeFunctionGood) { - int num_args = 255; - std::ostringstream spirv; - spirv << header << R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeFunction %1)"; - // add parameters - for (int i = 0; i < num_args; ++i) { - spirv << " %1"; - } - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: OpTypeFunction with 256 arguments. (limit is 255 according to the -// spec Universal Limits (2.17). -TEST_F(ValidateLimits, OpTypeFunctionBad) { - int num_args = 256; - std::ostringstream spirv; - spirv << header << R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeFunction %1)"; - for (int i = 0; i < num_args; ++i) { - spirv << " %1"; - } - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpTypeFunction may not take more than 255 arguments. " - "OpTypeFunction '2' has 256 arguments.")); -} - -// Valid: OpTypeFunction with 100 arguments (Custom limit: 100) -TEST_F(ValidateLimits, CustomizedOpTypeFunctionGood) { - int num_args = 100; - std::ostringstream spirv; - spirv << header << R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeFunction %1)"; - // add parameters - for (int i = 0; i < num_args; ++i) { - spirv << " %1"; - } - spvValidatorOptionsSetUniversalLimit(options_, - spv_validator_limit_max_function_args, 100u); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: OpTypeFunction with 101 arguments. (Custom limit: 100) -TEST_F(ValidateLimits, CustomizedOpTypeFunctionBad) { - int num_args = 101; - std::ostringstream spirv; - spirv << header << R"( -%1 = OpTypeInt 32 0 -%2 = OpTypeFunction %1)"; - for (int i = 0; i < num_args; ++i) { - spirv << " %1"; - } - spvValidatorOptionsSetUniversalLimit(options_, - spv_validator_limit_max_function_args, 100u); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpTypeFunction may not take more than 100 arguments. " - "OpTypeFunction '2' has 101 arguments.")); -} - -// Valid: module has 65,535 global variables. -TEST_F(ValidateLimits, NumGlobalVarsGood) { - int num_globals = 65535; - std::ostringstream spirv; - spirv << header << R"( - %int = OpTypeInt 32 0 -%_ptr_int = OpTypePointer Input %int - )"; - - for (int i = 0; i < num_globals; ++i) { - spirv << "%var_" << i << " = OpVariable %_ptr_int Input\n"; - } - - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: module has 65,536 global variables (limit is 65,535). -TEST_F(ValidateLimits, NumGlobalVarsBad) { - int num_globals = 65536; - std::ostringstream spirv; - spirv << header << R"( - %int = OpTypeInt 32 0 -%_ptr_int = OpTypePointer Input %int - )"; - - for (int i = 0; i < num_globals; ++i) { - spirv << "%var_" << i << " = OpVariable %_ptr_int Input\n"; - } - - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Number of Global Variables (Storage Class other than " - "'Function') exceeded the valid limit (65535).")); -} - -// Valid: module has 50 global variables (limit is 50) -TEST_F(ValidateLimits, CustomizedNumGlobalVarsGood) { - int num_globals = 50; - std::ostringstream spirv; - spirv << header << R"( - %int = OpTypeInt 32 0 -%_ptr_int = OpTypePointer Input %int - )"; - - for (int i = 0; i < num_globals; ++i) { - spirv << "%var_" << i << " = OpVariable %_ptr_int Input\n"; - } - - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_global_variables, 50u); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: module has 51 global variables (limit is 50). -TEST_F(ValidateLimits, CustomizedNumGlobalVarsBad) { - int num_globals = 51; - std::ostringstream spirv; - spirv << header << R"( - %int = OpTypeInt 32 0 -%_ptr_int = OpTypePointer Input %int - )"; - - for (int i = 0; i < num_globals; ++i) { - spirv << "%var_" << i << " = OpVariable %_ptr_int Input\n"; - } - - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_global_variables, 50u); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Number of Global Variables (Storage Class other than " - "'Function') exceeded the valid limit (50).")); -} - -// Valid: module has 524,287 local variables. -TEST_F(ValidateLimits, NumLocalVarsGood) { - int num_locals = 524287; - std::ostringstream spirv; - spirv << header << R"( - %int = OpTypeInt 32 0 - %_ptr_int = OpTypePointer Function %int - %voidt = OpTypeVoid - %funct = OpTypeFunction %voidt - %main = OpFunction %voidt None %funct - %entry = OpLabel - )"; - - for (int i = 0; i < num_locals; ++i) { - spirv << "%var_" << i << " = OpVariable %_ptr_int Function\n"; - } - - spirv << R"( - OpReturn - OpFunctionEnd - )"; - - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: module has 524,288 local variables (limit is 524,287). -TEST_F(ValidateLimits, NumLocalVarsBad) { - int num_locals = 524288; - std::ostringstream spirv; - spirv << header << R"( - %int = OpTypeInt 32 0 - %_ptr_int = OpTypePointer Function %int - %voidt = OpTypeVoid - %funct = OpTypeFunction %voidt - %main = OpFunction %voidt None %funct - %entry = OpLabel - )"; - - for (int i = 0; i < num_locals; ++i) { - spirv << "%var_" << i << " = OpVariable %_ptr_int Function\n"; - } - - spirv << R"( - OpReturn - OpFunctionEnd - )"; - - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Number of local variables ('Function' Storage Class) " - "exceeded the valid limit (524287).")); -} - -// Valid: module has 100 local variables (limit is 100). -TEST_F(ValidateLimits, CustomizedNumLocalVarsGood) { - int num_locals = 100; - std::ostringstream spirv; - spirv << header << R"( - %int = OpTypeInt 32 0 - %_ptr_int = OpTypePointer Function %int - %voidt = OpTypeVoid - %funct = OpTypeFunction %voidt - %main = OpFunction %voidt None %funct - %entry = OpLabel - )"; - - for (int i = 0; i < num_locals; ++i) { - spirv << "%var_" << i << " = OpVariable %_ptr_int Function\n"; - } - - spirv << R"( - OpReturn - OpFunctionEnd - )"; - - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_local_variables, 100u); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: module has 101 local variables (limit is 100). -TEST_F(ValidateLimits, CustomizedNumLocalVarsBad) { - int num_locals = 101; - std::ostringstream spirv; - spirv << header << R"( - %int = OpTypeInt 32 0 - %_ptr_int = OpTypePointer Function %int - %voidt = OpTypeVoid - %funct = OpTypeFunction %voidt - %main = OpFunction %voidt None %funct - %entry = OpLabel - )"; - - for (int i = 0; i < num_locals; ++i) { - spirv << "%var_" << i << " = OpVariable %_ptr_int Function\n"; - } - - spirv << R"( - OpReturn - OpFunctionEnd - )"; - - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_local_variables, 100u); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Number of local variables ('Function' Storage Class) " - "exceeded the valid limit (100).")); -} - -// Valid: Structure nesting depth of 255. -TEST_F(ValidateLimits, StructNestingDepthGood) { - std::ostringstream spirv; - spirv << header << R"( - %int = OpTypeInt 32 0 - %s_depth_1 = OpTypeStruct %int - )"; - for(auto i=2; i<=255; ++i) { - spirv << "%s_depth_" << i << " = OpTypeStruct %int %s_depth_" << i-1; - spirv << "\n"; - } - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: Structure nesting depth of 256. -TEST_F(ValidateLimits, StructNestingDepthBad) { - std::ostringstream spirv; - spirv << header << R"( - %int = OpTypeInt 32 0 - %s_depth_1 = OpTypeStruct %int - )"; - for(auto i=2; i<=256; ++i) { - spirv << "%s_depth_" << i << " = OpTypeStruct %int %s_depth_" << i-1; - spirv << "\n"; - } - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "Structure Nesting Depth may not be larger than 255. Found 256.")); -} - -// Valid: Structure nesting depth of 100 (limit is 100). -TEST_F(ValidateLimits, CustomizedStructNestingDepthGood) { - std::ostringstream spirv; - spirv << header << R"( - %int = OpTypeInt 32 0 - %s_depth_1 = OpTypeStruct %int - )"; - for (auto i = 2; i <= 100; ++i) { - spirv << "%s_depth_" << i << " = OpTypeStruct %int %s_depth_" << i - 1; - spirv << "\n"; - } - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_struct_depth, 100u); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: Structure nesting depth of 101 (limit is 100). -TEST_F(ValidateLimits, CustomizedStructNestingDepthBad) { - std::ostringstream spirv; - spirv << header << R"( - %int = OpTypeInt 32 0 - %s_depth_1 = OpTypeStruct %int - )"; - for (auto i = 2; i <= 101; ++i) { - spirv << "%s_depth_" << i << " = OpTypeStruct %int %s_depth_" << i - 1; - spirv << "\n"; - } - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_struct_depth, 100u); - CompileSuccessfully(spirv.str()); - EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - HasSubstr( - "Structure Nesting Depth may not be larger than 100. Found 101.")); -} - -// clang-format off -// Generates an SPIRV program with the given control flow nesting depth -void GenerateSpirvProgramWithCfgNestingDepth(std::string& str, int depth) { - std::ostringstream spirv; - spirv << header << R"( - %void = OpTypeVoid - %3 = OpTypeFunction %void - %bool = OpTypeBool - %12 = OpConstantTrue %bool - %main = OpFunction %void None %3 - %5 = OpLabel - OpBranch %6 - %6 = OpLabel - OpLoopMerge %8 %9 None - OpBranch %10 - %10 = OpLabel - OpBranchConditional %12 %7 %8 - %7 = OpLabel - )"; - int first_id = 13; - int last_id = 14; - // We already have 1 level of nesting due to the Loop. - int num_if_conditions = depth-1; - int largest_index = first_id + 2*num_if_conditions - 2; - for (int i = first_id; i <= largest_index; i = i + 2) { - spirv << "OpSelectionMerge %" << i+1 << " None" << "\n"; - spirv << "OpBranchConditional %12 " << "%" << i << " %" << i+1 << "\n"; - spirv << "%" << i << " = OpLabel" << "\n"; - } - spirv << "OpBranch %9" << "\n"; - - for (int i = largest_index+1; i > last_id; i = i - 2) { - spirv << "%" << i << " = OpLabel" << "\n"; - spirv << "OpBranch %" << i-2 << "\n"; - } - spirv << "%" << last_id << " = OpLabel" << "\n"; - spirv << "OpBranch %9" << "\n"; - spirv << R"( - %9 = OpLabel - OpBranch %6 - %8 = OpLabel - OpReturn - OpFunctionEnd - )"; - str = spirv.str(); -} -// clang-format on - -// Valid: Control Flow Nesting depth is 1023. -TEST_F(ValidateLimits, ControlFlowDepthGood) { - std::string spirv; - GenerateSpirvProgramWithCfgNestingDepth(spirv, 1023); - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: Control Flow Nesting depth is 1024. (limit is 1023). -TEST_F(ValidateLimits, ControlFlowDepthBad) { - std::string spirv; - GenerateSpirvProgramWithCfgNestingDepth(spirv, 1024); - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Maximum Control Flow nesting depth exceeded.")); -} - -// Valid: Control Flow Nesting depth is 10 (custom limit: 10). -TEST_F(ValidateLimits, CustomizedControlFlowDepthGood) { - std::string spirv; - GenerateSpirvProgramWithCfgNestingDepth(spirv, 10); - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_control_flow_nesting_depth, 10u); - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// Invalid: Control Flow Nesting depth is 11. (custom limit: 10). -TEST_F(ValidateLimits, CustomizedControlFlowDepthBad) { - std::string spirv; - GenerateSpirvProgramWithCfgNestingDepth(spirv, 11); - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_control_flow_nesting_depth, 10u); - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Maximum Control Flow nesting depth exceeded.")); -} - -// Valid. The purpose here is to test the CFG depth calculation code when a loop -// continue target is the loop iteself. It also exercises the case where a loop -// is unreachable. -TEST_F(ValidateLimits, ControlFlowNoEntryToLoopGood) { - string str = header + R"( - OpName %entry "entry" - OpName %loop "loop" - OpName %exit "exit" -%voidt = OpTypeVoid -%funct = OpTypeFunction %voidt -%main = OpFunction %voidt None %funct -%entry = OpLabel - OpBranch %exit -%loop = OpLabel - OpLoopMerge %loop %loop None - OpBranch %loop -%exit = OpLabel - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(str); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_logicals_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_logicals_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_logicals_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_logicals_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,870 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Tests for unique type declaration rules validator. - -#include - -#include "gmock/gmock.h" -#include "unit_spirv.h" -#include "val_fixtures.h" - -namespace { - -using ::testing::HasSubstr; -using ::testing::Not; - -using ValidateLogicals = spvtest::ValidateBase; - -std::string GenerateShaderCode( - const std::string& body, - const std::string& capabilities_and_extensions = "") { - const std::string capabilities = -R"( -OpCapability Shader -OpCapability Int64 -OpCapability Float64)"; - - const std::string after_extension_before_body = -R"( -%ext_inst = OpExtInstImport "GLSL.std.450" -OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %main "main" -%void = OpTypeVoid -%func = OpTypeFunction %void -%bool = OpTypeBool -%f32 = OpTypeFloat 32 -%u32 = OpTypeInt 32 0 -%s32 = OpTypeInt 32 1 -%f64 = OpTypeFloat 64 -%u64 = OpTypeInt 64 0 -%s64 = OpTypeInt 64 1 -%boolvec2 = OpTypeVector %bool 2 -%s32vec2 = OpTypeVector %s32 2 -%u32vec2 = OpTypeVector %u32 2 -%u64vec2 = OpTypeVector %u64 2 -%f32vec2 = OpTypeVector %f32 2 -%f64vec2 = OpTypeVector %f64 2 -%boolvec3 = OpTypeVector %bool 3 -%u32vec3 = OpTypeVector %u32 3 -%u64vec3 = OpTypeVector %u64 3 -%s32vec3 = OpTypeVector %s32 3 -%f32vec3 = OpTypeVector %f32 3 -%f64vec3 = OpTypeVector %f64 3 -%boolvec4 = OpTypeVector %bool 4 -%u32vec4 = OpTypeVector %u32 4 -%u64vec4 = OpTypeVector %u64 4 -%s32vec4 = OpTypeVector %s32 4 -%f32vec4 = OpTypeVector %f32 4 -%f64vec4 = OpTypeVector %f64 4 - -%f32_0 = OpConstant %f32 0 -%f32_1 = OpConstant %f32 1 -%f32_2 = OpConstant %f32 2 -%f32_3 = OpConstant %f32 3 -%f32_4 = OpConstant %f32 4 - -%s32_0 = OpConstant %s32 0 -%s32_1 = OpConstant %s32 1 -%s32_2 = OpConstant %s32 2 -%s32_3 = OpConstant %s32 3 -%s32_4 = OpConstant %s32 4 -%s32_m1 = OpConstant %s32 -1 - -%u32_0 = OpConstant %u32 0 -%u32_1 = OpConstant %u32 1 -%u32_2 = OpConstant %u32 2 -%u32_3 = OpConstant %u32 3 -%u32_4 = OpConstant %u32 4 - -%f64_0 = OpConstant %f64 0 -%f64_1 = OpConstant %f64 1 -%f64_2 = OpConstant %f64 2 -%f64_3 = OpConstant %f64 3 -%f64_4 = OpConstant %f64 4 - -%s64_0 = OpConstant %s64 0 -%s64_1 = OpConstant %s64 1 -%s64_2 = OpConstant %s64 2 -%s64_3 = OpConstant %s64 3 -%s64_4 = OpConstant %s64 4 -%s64_m1 = OpConstant %s64 -1 - -%u64_0 = OpConstant %u64 0 -%u64_1 = OpConstant %u64 1 -%u64_2 = OpConstant %u64 2 -%u64_3 = OpConstant %u64 3 -%u64_4 = OpConstant %u64 4 - -%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 -%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 -%u32vec3_012 = OpConstantComposite %u32vec3 %u32_0 %u32_1 %u32_2 -%u32vec3_123 = OpConstantComposite %u32vec3 %u32_1 %u32_2 %u32_3 -%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 -%u32vec4_1234 = OpConstantComposite %u32vec4 %u32_1 %u32_2 %u32_3 %u32_4 - -%s32vec2_01 = OpConstantComposite %s32vec2 %s32_0 %s32_1 -%s32vec2_12 = OpConstantComposite %s32vec2 %s32_1 %s32_2 -%s32vec3_012 = OpConstantComposite %s32vec3 %s32_0 %s32_1 %s32_2 -%s32vec3_123 = OpConstantComposite %s32vec3 %s32_1 %s32_2 %s32_3 -%s32vec4_0123 = OpConstantComposite %s32vec4 %s32_0 %s32_1 %s32_2 %s32_3 -%s32vec4_1234 = OpConstantComposite %s32vec4 %s32_1 %s32_2 %s32_3 %s32_4 - -%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 -%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 -%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 -%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 -%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 -%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 - -%f64vec2_01 = OpConstantComposite %f64vec2 %f64_0 %f64_1 -%f64vec2_12 = OpConstantComposite %f64vec2 %f64_1 %f64_2 -%f64vec3_012 = OpConstantComposite %f64vec3 %f64_0 %f64_1 %f64_2 -%f64vec3_123 = OpConstantComposite %f64vec3 %f64_1 %f64_2 %f64_3 -%f64vec4_0123 = OpConstantComposite %f64vec4 %f64_0 %f64_1 %f64_2 %f64_3 -%f64vec4_1234 = OpConstantComposite %f64vec4 %f64_1 %f64_2 %f64_3 %f64_4 - -%true = OpConstantTrue %bool -%false = OpConstantFalse %bool -%boolvec2_tf = OpConstantComposite %boolvec2 %true %false -%boolvec3_tft = OpConstantComposite %boolvec3 %true %false %true -%boolvec4_tftf = OpConstantComposite %boolvec4 %true %false %true %false - -%f32vec4ptr = OpTypePointer Function %f32vec4 - -%main = OpFunction %void None %func -%main_entry = OpLabel)"; - - const std::string after_body = -R"( -OpReturn -OpFunctionEnd)"; - - return capabilities + capabilities_and_extensions + - after_extension_before_body + body + after_body; -} - -std::string GenerateKernelCode( - const std::string& body, - const std::string& capabilities_and_extensions = "") { - const std::string capabilities = -R"( -OpCapability Addresses -OpCapability Kernel -OpCapability Linkage -OpCapability Int64 -OpCapability Float64)"; - - const std::string after_extension_before_body = -R"( -OpMemoryModel Physical32 OpenCL -%void = OpTypeVoid -%func = OpTypeFunction %void -%bool = OpTypeBool -%f32 = OpTypeFloat 32 -%u32 = OpTypeInt 32 0 -%f64 = OpTypeFloat 64 -%u64 = OpTypeInt 64 0 -%boolvec2 = OpTypeVector %bool 2 -%u32vec2 = OpTypeVector %u32 2 -%u64vec2 = OpTypeVector %u64 2 -%f32vec2 = OpTypeVector %f32 2 -%f64vec2 = OpTypeVector %f64 2 -%boolvec3 = OpTypeVector %bool 3 -%u32vec3 = OpTypeVector %u32 3 -%u64vec3 = OpTypeVector %u64 3 -%f32vec3 = OpTypeVector %f32 3 -%f64vec3 = OpTypeVector %f64 3 -%boolvec4 = OpTypeVector %bool 4 -%u32vec4 = OpTypeVector %u32 4 -%u64vec4 = OpTypeVector %u64 4 -%f32vec4 = OpTypeVector %f32 4 -%f64vec4 = OpTypeVector %f64 4 - -%f32_0 = OpConstant %f32 0 -%f32_1 = OpConstant %f32 1 -%f32_2 = OpConstant %f32 2 -%f32_3 = OpConstant %f32 3 -%f32_4 = OpConstant %f32 4 - -%u32_0 = OpConstant %u32 0 -%u32_1 = OpConstant %u32 1 -%u32_2 = OpConstant %u32 2 -%u32_3 = OpConstant %u32 3 -%u32_4 = OpConstant %u32 4 - -%f64_0 = OpConstant %f64 0 -%f64_1 = OpConstant %f64 1 -%f64_2 = OpConstant %f64 2 -%f64_3 = OpConstant %f64 3 -%f64_4 = OpConstant %f64 4 - -%u64_0 = OpConstant %u64 0 -%u64_1 = OpConstant %u64 1 -%u64_2 = OpConstant %u64 2 -%u64_3 = OpConstant %u64 3 -%u64_4 = OpConstant %u64 4 - -%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1 -%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2 -%u32vec3_012 = OpConstantComposite %u32vec3 %u32_0 %u32_1 %u32_2 -%u32vec3_123 = OpConstantComposite %u32vec3 %u32_1 %u32_2 %u32_3 -%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3 -%u32vec4_1234 = OpConstantComposite %u32vec4 %u32_1 %u32_2 %u32_3 %u32_4 - -%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1 -%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2 -%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2 -%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3 -%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3 -%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4 - -%f64vec2_01 = OpConstantComposite %f64vec2 %f64_0 %f64_1 -%f64vec2_12 = OpConstantComposite %f64vec2 %f64_1 %f64_2 -%f64vec3_012 = OpConstantComposite %f64vec3 %f64_0 %f64_1 %f64_2 -%f64vec3_123 = OpConstantComposite %f64vec3 %f64_1 %f64_2 %f64_3 -%f64vec4_0123 = OpConstantComposite %f64vec4 %f64_0 %f64_1 %f64_2 %f64_3 -%f64vec4_1234 = OpConstantComposite %f64vec4 %f64_1 %f64_2 %f64_3 %f64_4 - -%true = OpConstantTrue %bool -%false = OpConstantFalse %bool -%boolvec2_tf = OpConstantComposite %boolvec2 %true %false -%boolvec3_tft = OpConstantComposite %boolvec3 %true %false %true -%boolvec4_tftf = OpConstantComposite %boolvec4 %true %false %true %false - -%f32vec4ptr = OpTypePointer Function %f32vec4 - -%main = OpFunction %void None %func -%main_entry = OpLabel)"; - - const std::string after_body = -R"( -OpReturn -OpFunctionEnd)"; - - return capabilities + capabilities_and_extensions + - after_extension_before_body + body + after_body; -} - -TEST_F(ValidateLogicals, OpAnySuccess) { - const std::string body = R"( -%val1 = OpAny %bool %boolvec2_tf -%val2 = OpAny %bool %boolvec3_tft -%val3 = OpAny %bool %boolvec4_tftf -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateLogicals, OpAnyWrongTypeId) { - const std::string body = R"( -%val = OpAny %u32 %boolvec2_tf -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected bool scalar type as Result Type: Any")); -} - -TEST_F(ValidateLogicals, OpAnyWrongOperand) { - const std::string body = R"( -%val = OpAny %bool %u32vec3_123 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected operand to be vector bool: Any")); -} - -TEST_F(ValidateLogicals, OpIsNanSuccess) { - const std::string body = R"( -%val1 = OpIsNan %bool %f32_1 -%val2 = OpIsNan %bool %f64_0 -%val3 = OpIsNan %boolvec2 %f32vec2_12 -%val4 = OpIsNan %boolvec3 %f32vec3_123 -%val5 = OpIsNan %boolvec4 %f32vec4_1234 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateLogicals, OpIsNanWrongTypeId) { - const std::string body = R"( -%val1 = OpIsNan %u32 %f32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected bool scalar or vector type as Result Type: IsNan")); -} - -TEST_F(ValidateLogicals, OpIsNanOperandNotFloat) { - const std::string body = R"( -%val1 = OpIsNan %bool %u32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected operand to be scalar or vector float: IsNan")); -} - -TEST_F(ValidateLogicals, OpIsNanOperandWrongSize) { - const std::string body = R"( -%val1 = OpIsNan %bool %f32vec2_12 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected vector sizes of Result Type and the operand to be equal: " - "IsNan")); -} - -TEST_F(ValidateLogicals, OpLessOrGreaterSuccess) { - const std::string body = R"( -%val1 = OpLessOrGreater %bool %f32_0 %f32_1 -%val2 = OpLessOrGreater %bool %f64_0 %f64_0 -%val3 = OpLessOrGreater %boolvec2 %f32vec2_12 %f32vec2_12 -%val4 = OpLessOrGreater %boolvec3 %f32vec3_123 %f32vec3_123 -%val5 = OpLessOrGreater %boolvec4 %f32vec4_1234 %f32vec4_1234 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateLogicals, OpLessOrGreaterWrongTypeId) { - const std::string body = R"( -%val1 = OpLessOrGreater %u32 %f32_1 %f32_1 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected bool scalar or vector type as Result Type: LessOrGreater")); -} - -TEST_F(ValidateLogicals, OpLessOrGreaterLeftOperandNotFloat) { - const std::string body = R"( -%val1 = OpLessOrGreater %bool %u32_1 %f32_1 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected operands to be scalar or vector float: LessOrGreater")); -} - -TEST_F(ValidateLogicals, OpLessOrGreaterLeftOperandWrongSize) { - const std::string body = R"( -%val1 = OpLessOrGreater %bool %f32vec2_12 %f32_1 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected vector sizes of Result Type and the operands to be equal: " - "LessOrGreater")); -} - -TEST_F(ValidateLogicals, OpLessOrGreaterOperandsDifferentType) { - const std::string body = R"( -%val1 = OpLessOrGreater %bool %f32_1 %f64_1 -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected left and right operands to have the same type: " - "LessOrGreater")); -} - -TEST_F(ValidateLogicals, OpFOrdEqualSuccess) { - const std::string body = R"( -%val1 = OpFOrdEqual %bool %f32_0 %f32_1 -%val2 = OpFOrdEqual %bool %f64_0 %f64_0 -%val3 = OpFOrdEqual %boolvec2 %f32vec2_12 %f32vec2_12 -%val4 = OpFOrdEqual %boolvec3 %f32vec3_123 %f32vec3_123 -%val5 = OpFOrdEqual %boolvec4 %f32vec4_1234 %f32vec4_1234 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateLogicals, OpFOrdEqualWrongTypeId) { - const std::string body = R"( -%val1 = OpFOrdEqual %u32 %f32_1 %f32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected bool scalar or vector type as Result Type: FOrdEqual")); -} - -TEST_F(ValidateLogicals, OpFOrdEqualLeftOperandNotFloat) { - const std::string body = R"( -%val1 = OpFOrdEqual %bool %u32_1 %f32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected operands to be scalar or vector float: FOrdEqual")); -} - -TEST_F(ValidateLogicals, OpFOrdEqualLeftOperandWrongSize) { - const std::string body = R"( -%val1 = OpFOrdEqual %bool %f32vec2_12 %f32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected vector sizes of Result Type and the operands to be equal: " - "FOrdEqual")); -} - -TEST_F(ValidateLogicals, OpFOrdEqualOperandsDifferentType) { - const std::string body = R"( -%val1 = OpFOrdEqual %bool %f32_1 %f64_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected left and right operands to have the same type: " - "FOrdEqual")); -} - -TEST_F(ValidateLogicals, OpLogicalEqualSuccess) { - const std::string body = R"( -%val1 = OpLogicalEqual %bool %true %false -%val2 = OpLogicalEqual %boolvec2 %boolvec2_tf %boolvec2_tf -%val3 = OpLogicalEqual %boolvec3 %boolvec3_tft %boolvec3_tft -%val4 = OpLogicalEqual %boolvec4 %boolvec4_tftf %boolvec4_tftf -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateLogicals, OpLogicalEqualWrongTypeId) { - const std::string body = R"( -%val1 = OpLogicalEqual %u32 %true %false -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected bool scalar or vector type as Result Type: LogicalEqual")); -} - -TEST_F(ValidateLogicals, OpLogicalEqualWrongLeftOperand) { - const std::string body = R"( -%val1 = OpLogicalEqual %bool %boolvec2_tf %false -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected both operands to be of Result Type: LogicalEqual")); -} - -TEST_F(ValidateLogicals, OpLogicalEqualWrongRightOperand) { - const std::string body = R"( -%val1 = OpLogicalEqual %boolvec2 %boolvec2_tf %false -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected both operands to be of Result Type: LogicalEqual")); -} - -TEST_F(ValidateLogicals, OpLogicalNotSuccess) { - const std::string body = R"( -%val1 = OpLogicalNot %bool %true -%val2 = OpLogicalNot %boolvec2 %boolvec2_tf -%val3 = OpLogicalNot %boolvec3 %boolvec3_tft -%val4 = OpLogicalNot %boolvec4 %boolvec4_tftf -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateLogicals, OpLogicalNotWrongTypeId) { - const std::string body = R"( -%val1 = OpLogicalNot %u32 %true -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected bool scalar or vector type as Result Type: LogicalNot")); -} - -TEST_F(ValidateLogicals, OpLogicalNotWrongOperand) { - const std::string body = R"( -%val1 = OpLogicalNot %bool %boolvec2_tf -)"; - - CompileSuccessfully(GenerateKernelCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected operand to be of Result Type: LogicalNot")); -} - -TEST_F(ValidateLogicals, OpSelectSuccess) { - const std::string body = R"( -%val1 = OpSelect %u32 %true %u32_0 %u32_1 -%val2 = OpSelect %f32 %true %f32_0 %f32_1 -%val3 = OpSelect %f64 %true %f64_0 %f64_1 -%val4 = OpSelect %f32vec2 %boolvec2_tf %f32vec2_01 %f32vec2_12 -%val5 = OpSelect %f32vec4 %boolvec4_tftf %f32vec4_0123 %f32vec4_1234 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateLogicals, OpSelectWrongTypeId) { - const std::string body = R"( -%val1 = OpSelect %void %true %u32_0 %u32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected scalar or vector type as Result Type: Select")); -} - -TEST_F(ValidateLogicals, OpSelectPointerNoCapability) { - const std::string body = R"( -%x = OpVariable %f32vec4ptr Function -%y = OpVariable %f32vec4ptr Function -OpStore %x %f32vec4_0123 -OpStore %y %f32vec4_1234 -%val1 = OpSelect %f32vec4ptr %true %x %y -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Using pointers with OpSelect requires capability VariablePointers " - "or VariablePointersStorageBuffer")); -} - -TEST_F(ValidateLogicals, OpSelectPointerWithCapability1) { - const std::string body = R"( -%x = OpVariable %f32vec4ptr Function -%y = OpVariable %f32vec4ptr Function -OpStore %x %f32vec4_0123 -OpStore %y %f32vec4_1234 -%val1 = OpSelect %f32vec4ptr %true %x %y -)"; - - const std::string extra_cap_ext = R"( -OpCapability VariablePointers -OpExtension "SPV_KHR_variable_pointers" -)"; - - CompileSuccessfully(GenerateShaderCode(body, extra_cap_ext).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateLogicals, OpSelectPointerWithCapability2) { - const std::string body = R"( -%x = OpVariable %f32vec4ptr Function -%y = OpVariable %f32vec4ptr Function -OpStore %x %f32vec4_0123 -OpStore %y %f32vec4_1234 -%val1 = OpSelect %f32vec4ptr %true %x %y -)"; - - const std::string extra_cap_ext = R"( -OpCapability VariablePointersStorageBuffer -OpExtension "SPV_KHR_variable_pointers" -)"; - - CompileSuccessfully(GenerateShaderCode(body, extra_cap_ext).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateLogicals, OpSelectWrongCondition) { - const std::string body = R"( -%val1 = OpSelect %u32 %u32_1 %u32_0 %u32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected bool scalar or vector type as condition: Select")); -} - -TEST_F(ValidateLogicals, OpSelectWrongConditionDimension) { - const std::string body = R"( -%val1 = OpSelect %u32vec2 %true %u32vec2_01 %u32vec2_12 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected vector sizes of Result Type and the condition to be equal: " - "Select")); -} - -TEST_F(ValidateLogicals, OpSelectWrongLeftObject) { - const std::string body = R"( -%val1 = OpSelect %bool %true %u32vec2_01 %u32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected both objects to be of Result Type: Select")); -} - -TEST_F(ValidateLogicals, OpSelectWrongRightObject) { - const std::string body = R"( -%val1 = OpSelect %bool %true %u32_1 %u32vec2_01 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected both objects to be of Result Type: Select")); -} - -TEST_F(ValidateLogicals, OpIEqualSuccess) { - const std::string body = R"( -%val1 = OpIEqual %bool %u32_0 %s32_1 -%val2 = OpIEqual %bool %s64_0 %u64_0 -%val3 = OpIEqual %boolvec2 %s32vec2_12 %u32vec2_12 -%val4 = OpIEqual %boolvec3 %s32vec3_123 %u32vec3_123 -%val5 = OpIEqual %boolvec4 %s32vec4_1234 %u32vec4_1234 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateLogicals, OpIEqualWrongTypeId) { - const std::string body = R"( -%val1 = OpIEqual %u32 %s32_1 %s32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected bool scalar or vector type as Result Type: IEqual")); -} - -TEST_F(ValidateLogicals, OpIEqualLeftOperandNotInt) { - const std::string body = R"( -%val1 = OpIEqual %bool %f32_1 %s32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected operands to be scalar or vector int: IEqual")); -} - -TEST_F(ValidateLogicals, OpIEqualLeftOperandWrongSize) { - const std::string body = R"( -%val1 = OpIEqual %bool %s32vec2_12 %s32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected vector sizes of Result Type and the operands to be equal: " - "IEqual")); -} - -TEST_F(ValidateLogicals, OpIEqualRightOperandNotInt) { - const std::string body = R"( -%val1 = OpIEqual %bool %u32_1 %f32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected operands to be scalar or vector int: IEqual")); -} - -TEST_F(ValidateLogicals, OpIEqualDifferentBitWidth) { - const std::string body = R"( -%val1 = OpIEqual %bool %u32_1 %u64_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected both operands to have the same component bit width: IEqual")); -} - -TEST_F(ValidateLogicals, OpUGreaterThanSuccess) { - const std::string body = R"( -%val1 = OpUGreaterThan %bool %u32_0 %u32_1 -%val2 = OpUGreaterThan %bool %s32_0 %u32_1 -%val3 = OpUGreaterThan %bool %u64_0 %u64_0 -%val4 = OpUGreaterThan %bool %u64_0 %s64_0 -%val5 = OpUGreaterThan %boolvec2 %u32vec2_12 %u32vec2_12 -%val6 = OpUGreaterThan %boolvec3 %s32vec3_123 %u32vec3_123 -%val7 = OpUGreaterThan %boolvec4 %u32vec4_1234 %u32vec4_1234 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateLogicals, OpUGreaterThanWrongTypeId) { - const std::string body = R"( -%val1 = OpUGreaterThan %u32 %u32_1 %u32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected bool scalar or vector type as Result Type: UGreaterThan")); -} - -TEST_F(ValidateLogicals, OpUGreaterThanLeftOperandNotInt) { - const std::string body = R"( -%val1 = OpUGreaterThan %bool %f32_1 %u32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected operands to be scalar or vector int: UGreaterThan")); -} - -TEST_F(ValidateLogicals, OpUGreaterThanLeftOperandWrongSize) { - const std::string body = R"( -%val1 = OpUGreaterThan %bool %u32vec2_12 %u32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected vector sizes of Result Type and the operands to be equal: " - "UGreaterThan")); -} - -TEST_F(ValidateLogicals, OpUGreaterThanRightOperandNotInt) { - const std::string body = R"( -%val1 = OpUGreaterThan %bool %u32_1 %f32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected operands to be scalar or vector int: UGreaterThan")); -} - -TEST_F(ValidateLogicals, OpUGreaterThanDifferentBitWidth) { - const std::string body = R"( -%val1 = OpUGreaterThan %bool %u32_1 %u64_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected both operands to have the same component bit width: " - "UGreaterThan")); -} - -TEST_F(ValidateLogicals, OpSGreaterThanSuccess) { - const std::string body = R"( -%val1 = OpSGreaterThan %bool %s32_0 %s32_1 -%val2 = OpSGreaterThan %bool %u32_0 %s32_1 -%val3 = OpSGreaterThan %bool %s64_0 %s64_0 -%val4 = OpSGreaterThan %bool %s64_0 %u64_0 -%val5 = OpSGreaterThan %boolvec2 %s32vec2_12 %s32vec2_12 -%val6 = OpSGreaterThan %boolvec3 %s32vec3_123 %u32vec3_123 -%val7 = OpSGreaterThan %boolvec4 %s32vec4_1234 %s32vec4_1234 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateLogicals, OpSGreaterThanWrongTypeId) { - const std::string body = R"( -%val1 = OpSGreaterThan %s32 %s32_1 %s32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected bool scalar or vector type as Result Type: SGreaterThan")); -} - -TEST_F(ValidateLogicals, OpSGreaterThanLeftOperandNotInt) { - const std::string body = R"( -%val1 = OpSGreaterThan %bool %f32_1 %s32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected operands to be scalar or vector int: SGreaterThan")); -} - -TEST_F(ValidateLogicals, OpSGreaterThanLeftOperandWrongSize) { - const std::string body = R"( -%val1 = OpSGreaterThan %bool %s32vec2_12 %s32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected vector sizes of Result Type and the operands to be equal: " - "SGreaterThan")); -} - -TEST_F(ValidateLogicals, OpSGreaterThanRightOperandNotInt) { - const std::string body = R"( -%val1 = OpSGreaterThan %bool %s32_1 %f32_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected operands to be scalar or vector int: SGreaterThan")); -} - -TEST_F(ValidateLogicals, OpSGreaterThanDifferentBitWidth) { - const std::string body = R"( -%val1 = OpSGreaterThan %bool %s32_1 %s64_1 -)"; - - CompileSuccessfully(GenerateShaderCode(body).c_str()); - ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Expected both operands to have the same component bit width: SGreaterThan")); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_ssa_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_ssa_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_ssa_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_ssa_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1409 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Validation tests for SSA - -#include -#include -#include - -#include "gmock/gmock.h" -#include "unit_spirv.h" -#include "val_fixtures.h" - -using ::testing::HasSubstr; -using ::testing::MatchesRegex; - -using std::string; -using std::pair; -using std::stringstream; - -namespace { -using ValidateSSA = spvtest::ValidateBase>; - -TEST_F(ValidateSSA, Default) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %3 "" - OpExecutionMode %3 LocalSize 1 1 1 -%1 = OpTypeVoid -%2 = OpTypeFunction %1 -%3 = OpFunction %1 None %2 -%4 = OpLabel - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSSA, IdUndefinedBad) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpName %missing "missing" -%voidt = OpTypeVoid -%vfunct = OpTypeFunction %voidt -%func = OpFunction %vfunct None %missing -%flabel = OpLabel - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); -} - -TEST_F(ValidateSSA, IdRedefinedBad) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpName %2 "redefined" -%1 = OpTypeVoid -%2 = OpTypeFunction %1 -%2 = OpFunction %1 None %2 -%4 = OpLabel - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); -} - -TEST_F(ValidateSSA, DominateUsageBad) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpName %1 "not_dominant" -%2 = OpTypeFunction %1 ; uses %1 before it's definition -%1 = OpTypeVoid -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("not_dominant")); -} - -TEST_F(ValidateSSA, DominateUsageWithinBlockBad) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpName %bad "bad" -%voidt = OpTypeVoid -%funct = OpTypeFunction %voidt -%uintt = OpTypeInt 32 0 -%one = OpConstant %uintt 1 -%func = OpFunction %voidt None %funct -%entry = OpLabel -%sum = OpIAdd %uintt %one %bad -%bad = OpCopyObject %uintt %sum - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - MatchesRegex("ID .\\[bad\\] has not been defined")); -} - -TEST_F(ValidateSSA, DominateUsageSameInstructionBad) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpName %sum "sum" -%voidt = OpTypeVoid -%funct = OpTypeFunction %voidt -%uintt = OpTypeInt 32 0 -%one = OpConstant %uintt 1 -%func = OpFunction %voidt None %funct -%entry = OpLabel -%sum = OpIAdd %uintt %one %sum - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - MatchesRegex("ID .\\[sum\\] has not been defined")); -} - -TEST_F(ValidateSSA, ForwardNameGood) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpName %3 "main" -%1 = OpTypeVoid -%2 = OpTypeFunction %1 -%3 = OpFunction %1 None %2 -%4 = OpLabel - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSSA, ForwardNameMissingTargetBad) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpName %5 "main" ; Target never defined -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("main")); -} - -TEST_F(ValidateSSA, ForwardMemberNameGood) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpMemberName %struct 0 "value" - OpMemberName %struct 1 "size" -%intt = OpTypeInt 32 1 -%uintt = OpTypeInt 32 0 -%struct = OpTypeStruct %intt %uintt -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSSA, ForwardMemberNameMissingTargetBad) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpMemberName %struct 0 "value" - OpMemberName %bad 1 "size" ; Target is not defined -%intt = OpTypeInt 32 1 -%uintt = OpTypeInt 32 0 -%struct = OpTypeStruct %intt %uintt -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("size")); -} - -TEST_F(ValidateSSA, ForwardDecorateGood) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpDecorate %var Restrict -%intt = OpTypeInt 32 1 -%ptrt = OpTypePointer UniformConstant %intt -%var = OpVariable %ptrt UniformConstant -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSSA, ForwardDecorateInvalidIDBad) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpName %missing "missing" - OpDecorate %missing Restrict ;Missing ID -%voidt = OpTypeVoid -%intt = OpTypeInt 32 1 -%ptrt = OpTypePointer UniformConstant %intt -%var = OpVariable %ptrt UniformConstant -%2 = OpTypeFunction %voidt -%3 = OpFunction %voidt None %2 -%4 = OpLabel - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); -} - -TEST_F(ValidateSSA, ForwardMemberDecorateGood) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpMemberDecorate %struct 1 RowMajor -%intt = OpTypeInt 32 1 -%f32 = OpTypeFloat 32 -%vec3 = OpTypeVector %f32 3 -%mat33 = OpTypeMatrix %vec3 3 -%struct = OpTypeStruct %intt %mat33 -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSSA, ForwardMemberDecorateInvalidIdBad) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpName %missing "missing" - OpMemberDecorate %missing 1 RowMajor ; Target not defined -%intt = OpTypeInt 32 1 -%f32 = OpTypeFloat 32 -%vec3 = OpTypeVector %f32 3 -%mat33 = OpTypeMatrix %vec3 3 -%struct = OpTypeStruct %intt %mat33 -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); -} - -TEST_F(ValidateSSA, ForwardGroupDecorateGood) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpDecorate %dgrp RowMajor -%dgrp = OpDecorationGroup - OpGroupDecorate %dgrp %mat33 %mat44 -%f32 = OpTypeFloat 32 -%vec3 = OpTypeVector %f32 3 -%vec4 = OpTypeVector %f32 4 -%mat33 = OpTypeMatrix %vec3 3 -%mat44 = OpTypeMatrix %vec4 4 -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSSA, ForwardGroupDecorateMissingGroupBad) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpName %missing "missing" - OpDecorate %dgrp RowMajor -%dgrp = OpDecorationGroup - OpGroupDecorate %missing %mat33 %mat44 ; Target not defined -%intt = OpTypeInt 32 1 -%vec3 = OpTypeVector %intt 3 -%vec4 = OpTypeVector %intt 4 -%mat33 = OpTypeMatrix %vec3 3 -%mat44 = OpTypeMatrix %vec4 4 -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); -} - -TEST_F(ValidateSSA, ForwardGroupDecorateMissingTargetBad) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpName %missing "missing" - OpDecorate %dgrp RowMajor -%dgrp = OpDecorationGroup - OpGroupDecorate %dgrp %missing %mat44 ; Target not defined -%f32 = OpTypeFloat 32 -%vec3 = OpTypeVector %f32 3 -%vec4 = OpTypeVector %f32 4 -%mat33 = OpTypeMatrix %vec3 3 -%mat44 = OpTypeMatrix %vec4 4 -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); -} - -TEST_F(ValidateSSA, ForwardGroupDecorateDecorationGroupDominateBad) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpName %dgrp "group" - OpDecorate %dgrp RowMajor - OpGroupDecorate %dgrp %mat33 %mat44 ; Decoration group does not dominate usage -%dgrp = OpDecorationGroup -%intt = OpTypeInt 32 1 -%vec3 = OpTypeVector %intt 3 -%vec4 = OpTypeVector %intt 4 -%mat33 = OpTypeMatrix %vec3 3 -%mat44 = OpTypeMatrix %vec4 4 -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("group")); -} - -TEST_F(ValidateSSA, ForwardDecorateInvalidIdBad) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpName %missing "missing" - OpDecorate %missing Restrict ; Missing target -%voidt = OpTypeVoid -%intt = OpTypeInt 32 1 -%ptrt = OpTypePointer UniformConstant %intt -%var = OpVariable %ptrt UniformConstant -%2 = OpTypeFunction %voidt -%3 = OpFunction %voidt None %2 -%4 = OpLabel - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); -} - -TEST_F(ValidateSSA, FunctionCallGood) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 -%1 = OpTypeVoid -%2 = OpTypeInt 32 1 -%3 = OpTypeInt 32 0 -%4 = OpTypeFunction %1 -%8 = OpTypeFunction %1 %2 %3 -%four = OpConstant %2 4 -%five = OpConstant %3 5 -%9 = OpFunction %1 None %8 -%10 = OpFunctionParameter %2 -%11 = OpFunctionParameter %3 -%12 = OpLabel - OpReturn - OpFunctionEnd -%5 = OpFunction %1 None %4 -%6 = OpLabel -%7 = OpFunctionCall %1 %9 %four %five - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSSA, ForwardFunctionCallGood) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 -%1 = OpTypeVoid -%2 = OpTypeInt 32 1 -%3 = OpTypeInt 32 0 -%four = OpConstant %2 4 -%five = OpConstant %3 5 -%8 = OpTypeFunction %1 %2 %3 -%4 = OpTypeFunction %1 -%5 = OpFunction %1 None %4 -%6 = OpLabel -%7 = OpFunctionCall %1 %9 %four %five - OpReturn - OpFunctionEnd -%9 = OpFunction %1 None %8 -%10 = OpFunctionParameter %2 -%11 = OpFunctionParameter %3 -%12 = OpLabel - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSSA, ForwardBranchConditionalGood) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 -%voidt = OpTypeVoid -%boolt = OpTypeBool -%vfunct = OpTypeFunction %voidt -%true = OpConstantTrue %boolt -%main = OpFunction %voidt None %vfunct -%mainl = OpLabel - OpSelectionMerge %endl None - OpBranchConditional %true %truel %falsel -%truel = OpLabel - OpNop - OpBranch %endl -%falsel = OpLabel - OpNop - OpBranch %endl -%endl = OpLabel - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSSA, ForwardBranchConditionalWithWeightsGood) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 -%voidt = OpTypeVoid -%boolt = OpTypeBool -%vfunct = OpTypeFunction %voidt -%true = OpConstantTrue %boolt -%main = OpFunction %voidt None %vfunct -%mainl = OpLabel - OpSelectionMerge %endl None - OpBranchConditional %true %truel %falsel 1 9 -%truel = OpLabel - OpNop - OpBranch %endl -%falsel = OpLabel - OpNop - OpBranch %endl -%endl = OpLabel - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSSA, ForwardBranchConditionalNonDominantConditionBad) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpName %tcpy "conditional" -%voidt = OpTypeVoid -%boolt = OpTypeBool -%vfunct = OpTypeFunction %voidt -%true = OpConstantTrue %boolt -%main = OpFunction %voidt None %vfunct -%mainl = OpLabel - OpSelectionMerge %endl None - OpBranchConditional %tcpy %truel %falsel ; -%truel = OpLabel - OpNop - OpBranch %endl -%falsel = OpLabel - OpNop - OpBranch %endl -%endl = OpLabel -%tcpy = OpCopyObject %boolt %true - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("conditional")); -} - -TEST_F(ValidateSSA, ForwardBranchConditionalMissingTargetBad) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 - OpName %missing "missing" -%voidt = OpTypeVoid -%boolt = OpTypeBool -%vfunct = OpTypeFunction %voidt -%true = OpConstantTrue %boolt -%main = OpFunction %voidt None %vfunct -%mainl = OpLabel - OpSelectionMerge %endl None - OpBranchConditional %true %missing %falsel -%truel = OpLabel - OpNop - OpBranch %endl -%falsel = OpLabel - OpNop - OpBranch %endl -%endl = OpLabel - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); -} - -// Since Int8 requires the Kernel capability, the signedness of int types may -// not be "1". -const string kHeader = R"( -OpCapability Int8 -OpCapability DeviceEnqueue -OpCapability Linkage -OpMemoryModel Logical OpenCL -)"; - -const string kBasicTypes = R"( -%voidt = OpTypeVoid -%boolt = OpTypeBool -%int8t = OpTypeInt 8 0 -%uintt = OpTypeInt 32 0 -%vfunct = OpTypeFunction %voidt -%intptrt = OpTypePointer UniformConstant %uintt -%zero = OpConstant %uintt 0 -%one = OpConstant %uintt 1 -%ten = OpConstant %uintt 10 -%false = OpConstantFalse %boolt -)"; - -const string kKernelTypesAndConstants = R"( -%queuet = OpTypeQueue - -%three = OpConstant %uintt 3 -%arr3t = OpTypeArray %uintt %three -%ndt = OpTypeStruct %uintt %arr3t %arr3t %arr3t - -%eventt = OpTypeEvent - -%offset = OpConstant %uintt 0 -%local = OpConstant %uintt 1 -%gl = OpConstant %uintt 1 - -%nevent = OpConstant %uintt 0 -%event = OpConstantNull %eventt - -%firstp = OpConstant %int8t 0 -%psize = OpConstant %uintt 0 -%palign = OpConstant %uintt 32 -%lsize = OpConstant %uintt 1 -%flags = OpConstant %uintt 0 ; NoWait - -%kfunct = OpTypeFunction %voidt %intptrt -)"; - -const string kKernelSetup = R"( -%dqueue = OpGetDefaultQueue %queuet -%ndval = OpBuildNDRange %ndt %gl %local %offset -%revent = OpUndef %eventt - -)"; - -const string kKernelDefinition = R"( -%kfunc = OpFunction %voidt None %kfunct -%iparam = OpFunctionParameter %intptrt -%kfuncl = OpLabel - OpNop - OpReturn - OpFunctionEnd -)"; - -TEST_F(ValidateSSA, EnqueueKernelGood) { - string str = kHeader + kBasicTypes + kKernelTypesAndConstants + - kKernelDefinition + R"( - %main = OpFunction %voidt None %vfunct - %mainl = OpLabel - )" + - kKernelSetup + R"( - %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent - %event %revent %kfunc %firstp %psize - %palign %lsize - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSSA, ForwardEnqueueKernelGood) { - string str = kHeader + kBasicTypes + kKernelTypesAndConstants + R"( - %main = OpFunction %voidt None %vfunct - %mainl = OpLabel - )" + - kKernelSetup + R"( - %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent - %event %revent %kfunc %firstp %psize - %palign %lsize - OpReturn - OpFunctionEnd - )" + - kKernelDefinition; - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSSA, EnqueueMissingFunctionBad) { - string str = kHeader + "OpName %kfunc \"kfunc\"" + kBasicTypes + - kKernelTypesAndConstants + R"( - %main = OpFunction %voidt None %vfunct - %mainl = OpLabel - )" + - kKernelSetup + R"( - %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent - %event %revent %kfunc %firstp %psize - %palign %lsize - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("kfunc")); -} - -string forwardKernelNonDominantParameterBaseCode(string name = string()) { - string op_name; - if (name.empty()) { - op_name = ""; - } else { - op_name = "\nOpName %" + name + " \"" + name + "\"\n"; - } - string out = kHeader + op_name + kBasicTypes + kKernelTypesAndConstants + - kKernelDefinition + - R"( - %main = OpFunction %voidt None %vfunct - %mainl = OpLabel - )" + - kKernelSetup; - return out; -} - -TEST_F(ValidateSSA, ForwardEnqueueKernelMissingParameter1Bad) { - string str = forwardKernelNonDominantParameterBaseCode("missing") + R"( - %err = OpEnqueueKernel %missing %dqueue %flags %ndval - %nevent %event %revent %kfunc %firstp - %psize %palign %lsize - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); -} - -TEST_F(ValidateSSA, ForwardEnqueueKernelNonDominantParameter2Bad) { - string str = forwardKernelNonDominantParameterBaseCode("dqueue2") + R"( - %err = OpEnqueueKernel %uintt %dqueue2 %flags %ndval - %nevent %event %revent %kfunc - %firstp %psize %palign %lsize - %dqueue2 = OpGetDefaultQueue %queuet - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("dqueue2")); -} - -TEST_F(ValidateSSA, ForwardEnqueueKernelNonDominantParameter3Bad) { - string str = forwardKernelNonDominantParameterBaseCode("ndval2") + R"( - %err = OpEnqueueKernel %uintt %dqueue %flags %ndval2 - %nevent %event %revent %kfunc %firstp - %psize %palign %lsize - %ndval2 = OpBuildNDRange %ndt %gl %local %offset - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("ndval2")); -} - -TEST_F(ValidateSSA, ForwardEnqueueKernelNonDominantParameter4Bad) { - string str = forwardKernelNonDominantParameterBaseCode("nevent2") + R"( - %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent2 - %event %revent %kfunc %firstp %psize - %palign %lsize - %nevent2 = OpCopyObject %uintt %nevent - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("nevent2")); -} - -TEST_F(ValidateSSA, ForwardEnqueueKernelNonDominantParameter5Bad) { - string str = forwardKernelNonDominantParameterBaseCode("event2") + R"( - %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent - %event2 %revent %kfunc %firstp %psize - %palign %lsize - %event2 = OpCopyObject %eventt %event - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("event2")); -} - -TEST_F(ValidateSSA, ForwardEnqueueKernelNonDominantParameter6Bad) { - string str = forwardKernelNonDominantParameterBaseCode("revent2") + R"( - %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent - %event %revent2 %kfunc %firstp %psize - %palign %lsize - %revent2 = OpCopyObject %eventt %revent - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("revent2")); -} - -TEST_F(ValidateSSA, ForwardEnqueueKernelNonDominantParameter8Bad) { - string str = forwardKernelNonDominantParameterBaseCode("firstp2") + R"( - %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent - %event %revent %kfunc %firstp2 %psize - %palign %lsize - %firstp2 = OpCopyObject %int8t %firstp - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("firstp2")); -} - -TEST_F(ValidateSSA, ForwardEnqueueKernelNonDominantParameter9Bad) { - string str = forwardKernelNonDominantParameterBaseCode("psize2") + R"( - %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent - %event %revent %kfunc %firstp %psize2 - %palign %lsize - %psize2 = OpCopyObject %uintt %psize - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("psize2")); -} - -TEST_F(ValidateSSA, ForwardEnqueueKernelNonDominantParameter10Bad) { - string str = forwardKernelNonDominantParameterBaseCode("palign2") + R"( - %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent - %event %revent %kfunc %firstp %psize - %palign2 %lsize - %palign2 = OpCopyObject %uintt %palign - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("palign2")); -} - -TEST_F(ValidateSSA, ForwardEnqueueKernelNonDominantParameter11Bad) { - string str = forwardKernelNonDominantParameterBaseCode("lsize2") + R"( - %err = OpEnqueueKernel %uintt %dqueue %flags %ndval %nevent - %event %revent %kfunc %firstp %psize - %palign %lsize2 - %lsize2 = OpCopyObject %uintt %lsize - OpReturn - OpFunctionEnd - )"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("lsize2")); -} - -static const bool kWithNDrange = true; -static const bool kNoNDrange = false; -pair cases[] = { - {"OpGetKernelNDrangeSubGroupCount", kWithNDrange}, - {"OpGetKernelNDrangeMaxSubGroupSize", kWithNDrange}, - {"OpGetKernelWorkGroupSize", kNoNDrange}, - {"OpGetKernelPreferredWorkGroupSizeMultiple", kNoNDrange}}; - -INSTANTIATE_TEST_CASE_P(KernelArgs, ValidateSSA, ::testing::ValuesIn(cases), ); - -static const string return_instructions = R"( - OpReturn - OpFunctionEnd -)"; - -TEST_P(ValidateSSA, GetKernelGood) { - string instruction = GetParam().first; - bool with_ndrange = GetParam().second; - string ndrange_param = with_ndrange ? " %ndval " : " "; - - stringstream ss; - // clang-format off - ss << forwardKernelNonDominantParameterBaseCode() + " %numsg = " - << instruction + " %uintt" + ndrange_param + "%kfunc %firstp %psize %palign" - << return_instructions; - // clang-format on - - CompileSuccessfully(ss.str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateSSA, ForwardGetKernelGood) { - string instruction = GetParam().first; - bool with_ndrange = GetParam().second; - string ndrange_param = with_ndrange ? " %ndval " : " "; - - // clang-format off - string str = kHeader + kBasicTypes + kKernelTypesAndConstants + - R"( - %main = OpFunction %voidt None %vfunct - %mainl = OpLabel - )" - + kKernelSetup + " %numsg = " - + instruction + " %uintt" + ndrange_param + "%kfunc %firstp %psize %palign" - + return_instructions + kKernelDefinition; - // clang-format on - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_P(ValidateSSA, ForwardGetKernelMissingDefinitionBad) { - string instruction = GetParam().first; - bool with_ndrange = GetParam().second; - string ndrange_param = with_ndrange ? " %ndval " : " "; - - stringstream ss; - // clang-format off - ss << forwardKernelNonDominantParameterBaseCode("missing") + " %numsg = " - << instruction + " %uintt" + ndrange_param + "%missing %firstp %psize %palign" - << return_instructions; - // clang-format on - - CompileSuccessfully(ss.str()); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); -} - -TEST_P(ValidateSSA, ForwardGetKernelNDrangeSubGroupCountMissingParameter1Bad) { - string instruction = GetParam().first; - bool with_ndrange = GetParam().second; - string ndrange_param = with_ndrange ? " %ndval " : " "; - - stringstream ss; - // clang-format off - ss << forwardKernelNonDominantParameterBaseCode("missing") + " %numsg = " - << instruction + " %missing" + ndrange_param + "%kfunc %firstp %psize %palign" - << return_instructions; - // clang-format on - - CompileSuccessfully(ss.str()); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); -} - -TEST_P(ValidateSSA, - ForwardGetKernelNDrangeSubGroupCountNonDominantParameter2Bad) { - string instruction = GetParam().first; - bool with_ndrange = GetParam().second; - string ndrange_param = with_ndrange ? " %ndval2 " : " "; - - stringstream ss; - // clang-format off - ss << forwardKernelNonDominantParameterBaseCode("ndval2") + " %numsg = " - << instruction + " %uintt" + ndrange_param + "%kfunc %firstp %psize %palign" - << "\n %ndval2 = OpBuildNDRange %ndt %gl %local %offset" - << return_instructions; - // clang-format on - - if (GetParam().second) { - CompileSuccessfully(ss.str()); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("ndval2")); - } -} - -TEST_P(ValidateSSA, - ForwardGetKernelNDrangeSubGroupCountNonDominantParameter4Bad) { - string instruction = GetParam().first; - bool with_ndrange = GetParam().second; - string ndrange_param = with_ndrange ? " %ndval " : " "; - - stringstream ss; - // clang-format off - ss << forwardKernelNonDominantParameterBaseCode("firstp2") + " %numsg = " - << instruction + " %uintt" + ndrange_param + "%kfunc %firstp2 %psize %palign" - << "\n %firstp2 = OpCopyObject %int8t %firstp" - << return_instructions; - // clang-format on - - CompileSuccessfully(ss.str()); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("firstp2")); -} - -TEST_P(ValidateSSA, - ForwardGetKernelNDrangeSubGroupCountNonDominantParameter5Bad) { - string instruction = GetParam().first; - bool with_ndrange = GetParam().second; - string ndrange_param = with_ndrange ? " %ndval " : " "; - - stringstream ss; - // clang-format off - ss << forwardKernelNonDominantParameterBaseCode("psize2") + " %numsg = " - << instruction + " %uintt" + ndrange_param + "%kfunc %firstp %psize2 %palign" - << "\n %psize2 = OpCopyObject %uintt %psize" - << return_instructions; - // clang-format on - - CompileSuccessfully(ss.str()); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("psize2")); -} - -TEST_P(ValidateSSA, - ForwardGetKernelNDrangeSubGroupCountNonDominantParameter6Bad) { - string instruction = GetParam().first; - bool with_ndrange = GetParam().second; - string ndrange_param = with_ndrange ? " %ndval " : " "; - - stringstream ss; - // clang-format off - ss << forwardKernelNonDominantParameterBaseCode("palign2") + " %numsg = " - << instruction + " %uintt" + ndrange_param + "%kfunc %firstp %psize %palign2" - << "\n %palign2 = OpCopyObject %uintt %palign" - << return_instructions; - // clang-format on - - if (GetParam().second) { - CompileSuccessfully(ss.str()); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("palign2")); - } -} - -TEST_F(ValidateSSA, PhiGood) { - string str = kHeader + kBasicTypes + - R"( -%func = OpFunction %voidt None %vfunct -%preheader = OpLabel -%init = OpCopyObject %uintt %zero - OpBranch %loop -%loop = OpLabel -%i = OpPhi %uintt %init %preheader %loopi %loop -%loopi = OpIAdd %uintt %i %one - OpNop -%cond = OpSLessThan %boolt %i %ten - OpLoopMerge %endl %loop None - OpBranchConditional %cond %loop %endl -%endl = OpLabel - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSSA, PhiMissingTypeBad) { - string str = kHeader + "OpName %missing \"missing\"" + kBasicTypes + - R"( -%func = OpFunction %voidt None %vfunct -%preheader = OpLabel -%init = OpCopyObject %uintt %zero - OpBranch %loop -%loop = OpLabel -%i = OpPhi %missing %init %preheader %loopi %loop -%loopi = OpIAdd %uintt %i %one - OpNop -%cond = OpSLessThan %boolt %i %ten - OpLoopMerge %endl %loop None - OpBranchConditional %cond %loop %endl -%endl = OpLabel - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); -} - -TEST_F(ValidateSSA, PhiMissingIdBad) { - string str = kHeader + "OpName %missing \"missing\"" + kBasicTypes + - R"( -%func = OpFunction %voidt None %vfunct -%preheader = OpLabel -%init = OpCopyObject %uintt %zero - OpBranch %loop -%loop = OpLabel -%i = OpPhi %uintt %missing %preheader %loopi %loop -%loopi = OpIAdd %uintt %i %one - OpNop -%cond = OpSLessThan %boolt %i %ten - OpLoopMerge %endl %loop None - OpBranchConditional %cond %loop %endl -%endl = OpLabel - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); -} - -TEST_F(ValidateSSA, PhiMissingLabelBad) { - string str = kHeader + "OpName %missing \"missing\"" + kBasicTypes + - R"( -%func = OpFunction %voidt None %vfunct -%preheader = OpLabel -%init = OpCopyObject %uintt %zero - OpBranch %loop -%loop = OpLabel -%i = OpPhi %uintt %init %missing %loopi %loop -%loopi = OpIAdd %uintt %i %one - OpNop -%cond = OpSLessThan %boolt %i %ten - OpLoopMerge %endl %loop None - OpBranchConditional %cond %loop %endl -%endl = OpLabel - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr("missing")); -} - -TEST_F(ValidateSSA, IdDominatesItsUseGood) { - string str = kHeader + kBasicTypes + - R"( -%func = OpFunction %voidt None %vfunct -%entry = OpLabel -%cond = OpSLessThan %boolt %one %ten -%eleven = OpIAdd %uintt %one %ten - OpSelectionMerge %merge None - OpBranchConditional %cond %t %f -%t = OpLabel -%twelve = OpIAdd %uintt %eleven %one - OpBranch %merge -%f = OpLabel -%twentytwo = OpIAdd %uintt %eleven %ten - OpBranch %merge -%merge = OpLabel - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSSA, IdDoesNotDominateItsUseBad) { - string str = kHeader + - "OpName %eleven \"eleven\"\n" - "OpName %true_block \"true_block\"\n" - "OpName %false_block \"false_block\"" + - kBasicTypes + - R"( -%func = OpFunction %voidt None %vfunct -%entry = OpLabel -%cond = OpSLessThan %boolt %one %ten - OpSelectionMerge %merge None - OpBranchConditional %cond %true_block %false_block -%true_block = OpLabel -%eleven = OpIAdd %uintt %one %ten -%twelve = OpIAdd %uintt %eleven %one - OpBranch %merge -%false_block = OpLabel -%twentytwo = OpIAdd %uintt %eleven %ten - OpBranch %merge -%merge = OpLabel - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - MatchesRegex("ID .\\[eleven\\] defined in block .\\[true_block\\] does " - "not dominate its use in block .\\[false_block\\]")); -} - -TEST_F(ValidateSSA, PhiUseDoesntDominateDefinitionGood) { - string str = kHeader + kBasicTypes + - R"( -%func = OpFunction %voidt None %vfunct -%entry = OpLabel -%var_one = OpVariable %intptrt Function %one -%one_val = OpLoad %uintt %var_one - OpBranch %loop -%loop = OpLabel -%i = OpPhi %uintt %one_val %entry %inew %cont -%cond = OpSLessThan %boolt %one %ten - OpLoopMerge %merge %cont None - OpBranchConditional %cond %body %merge -%body = OpLabel - OpBranch %cont -%cont = OpLabel -%inew = OpIAdd %uintt %i %one - OpBranch %loop -%merge = OpLabel - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSSA, - PhiUseDoesntDominateUseOfPhiOperandUsedBeforeDefinitionBad) { - string str = kHeader + "OpName %inew \"inew\"" + kBasicTypes + - R"( -%func = OpFunction %voidt None %vfunct -%entry = OpLabel -%var_one = OpVariable %intptrt Function %one -%one_val = OpLoad %uintt %var_one - OpBranch %loop -%loop = OpLabel -%i = OpPhi %uintt %one_val %entry %inew %cont -%bad = OpIAdd %uintt %inew %one -%cond = OpSLessThan %boolt %one %ten - OpLoopMerge %merge %cont None - OpBranchConditional %cond %body %merge -%body = OpLabel - OpBranch %cont -%cont = OpLabel -%inew = OpIAdd %uintt %i %one - OpBranch %loop -%merge = OpLabel - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - MatchesRegex("ID .\\[inew\\] has not been defined")); -} - -TEST_F(ValidateSSA, PhiUseMayComeFromNonDominatingBlockGood) { - string str = kHeader + "OpName %if_true \"if_true\"\n" + - "OpName %exit \"exit\"\n" + "OpName %copy \"copy\"\n" + - kBasicTypes + - R"( -%func = OpFunction %voidt None %vfunct -%entry = OpLabel - OpBranchConditional %false %if_true %exit - -%if_true = OpLabel -%copy = OpCopyObject %boolt %false - OpBranch %exit - -; The use of %copy here is ok, even though it was defined -; in a block that does not dominate %exit. That's the point -; of an OpPhi. -%exit = OpLabel -%value = OpPhi %boolt %false %entry %copy %if_true - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); -} - -TEST_F(ValidateSSA, PhiUsesItsOwnDefinitionGood) { - // See https://github.com/KhronosGroup/SPIRV-Tools/issues/415 - // - // Non-phi instructions can't use their own definitions, as - // already checked in test DominateUsageSameInstructionBad. - string str = kHeader + "OpName %loop \"loop\"\n" + - "OpName %value \"value\"\n" + kBasicTypes + - R"( -%func = OpFunction %voidt None %vfunct -%entry = OpLabel - OpBranch %loop - -%loop = OpLabel -%value = OpPhi %boolt %false %entry %value %loop - OpBranch %loop - - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); -} - -TEST_F(ValidateSSA, PhiVariableDefNotDominatedByParentBlockBad) { - string str = kHeader + "OpName %if_true \"if_true\"\n" + - "OpName %if_false \"if_false\"\n" + "OpName %exit \"exit\"\n" + - "OpName %value \"phi\"\n" + "OpName %true_copy \"true_copy\"\n" + - "OpName %false_copy \"false_copy\"\n" + kBasicTypes + - R"( -%func = OpFunction %voidt None %vfunct -%entry = OpLabel - OpBranchConditional %false %if_true %if_false - -%if_true = OpLabel -%true_copy = OpCopyObject %boolt %false - OpBranch %exit - -%if_false = OpLabel -%false_copy = OpCopyObject %boolt %false - OpBranch %exit - -; The (variable,Id) pairs are swapped. -%exit = OpLabel -%value = OpPhi %boolt %true_copy %if_false %false_copy %if_true - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - MatchesRegex("In OpPhi instruction .\\[phi\\], ID .\\[true_copy\\] " - "definition does not dominate its parent .\\[if_false\\]")); -} - -TEST_F(ValidateSSA, PhiVariableDefDominatesButNotDefinedInParentBlock) { - string str = kHeader + "OpName %if_true \"if_true\"\n" + kBasicTypes + - R"( -%func = OpFunction %voidt None %vfunct -%entry = OpLabel - OpBranchConditional %false %if_true %if_false - -%if_true = OpLabel -%true_copy = OpCopyObject %boolt %false - OpBranch %if_tnext -%if_tnext = OpLabel - OpBranch %exit - -%if_false = OpLabel -%false_copy = OpCopyObject %boolt %false - OpBranch %if_fnext -%if_fnext = OpLabel - OpBranch %exit - -%exit = OpLabel -%value = OpPhi %boolt %true_copy %if_tnext %false_copy %if_fnext - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSSA, - DominanceCheckIgnoresUsesInUnreachableBlocksDefInBlockGood) { - string str = kHeader + kBasicTypes + - R"( -%func = OpFunction %voidt None %vfunct -%entry = OpLabel -%def = OpCopyObject %boolt %false - OpReturn - -%unreach = OpLabel -%use = OpCopyObject %boolt %def - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); -} - -TEST_F(ValidateSSA, - DominanceCheckIgnoresUsesInUnreachableBlocksDefIsParamGood) { - string str = kHeader + kBasicTypes + - R"( -%void_fn_int = OpTypeFunction %voidt %uintt -%func = OpFunction %voidt None %void_fn_int -%int_param = OpFunctionParameter %uintt -%entry = OpLabel - OpReturn - -%unreach = OpLabel -%use = OpCopyObject %uintt %int_param - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString(); -} - -TEST_F(ValidateSSA, UseFunctionParameterFromOtherFunctionBad) { - string str = kHeader + - "OpName %first \"first\"\n" - "OpName %func \"func\"\n" + - "OpName %func2 \"func2\"\n" + kBasicTypes + - R"( -%viifunct = OpTypeFunction %voidt %uintt %uintt -%func = OpFunction %voidt None %viifunct -%first = OpFunctionParameter %uintt -%second = OpFunctionParameter %uintt - OpFunctionEnd -%func2 = OpFunction %voidt None %viifunct -%first2 = OpFunctionParameter %uintt -%second2 = OpFunctionParameter %uintt -%entry2 = OpLabel -%baduse = OpIAdd %uintt %first %first2 - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions()); - EXPECT_THAT( - getDiagnosticString(), - MatchesRegex("ID .\\[first\\] used in function .\\[func2\\] is used " - "outside of it's defining function .\\[func\\]")); -} - -TEST_F(ValidateSSA, TypeForwardPointerForwardReference) { - // See https://github.com/KhronosGroup/SPIRV-Tools/issues/429 - // - // ForwardPointers can references instructions that have not been defined - string str = R"( - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %intptrt "intptrt" - OpTypeForwardPointer %intptrt UniformConstant - %uint = OpTypeInt 32 0 - %intptrt = OpTypePointer UniformConstant %uint -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateSSA, TypeStructForwardReference) { - string str = R"( - OpCapability Kernel - OpCapability Addresses - OpCapability Linkage - OpMemoryModel Logical OpenCL - OpName %structptr "structptr" - OpTypeForwardPointer %structptr UniformConstant - %uint = OpTypeInt 32 0 - %structt1 = OpTypeStruct %structptr %uint - %structt2 = OpTypeStruct %uint %structptr - %structt3 = OpTypeStruct %uint %uint %structptr - %structt4 = OpTypeStruct %uint %uint %uint %structptr - %structptr = OpTypePointer UniformConstant %structt1 -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// TODO(umar): OpGroupMemberDecorate -} // namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_state_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_state_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_state_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_state_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,140 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// Copyright (c) 2016 Google 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. - -// Unit tests for ValidationState_t. - -#include - -#include "gtest/gtest.h" -#include "spirv/1.1/spirv.h" - -#include "enum_set.h" -#include "extensions.h" -#include "spirv_validator_options.h" -#include "val/construct.h" -#include "val/function.h" -#include "val/validation_state.h" -#include "validate.h" - -namespace { -using libspirv::CapabilitySet; -using libspirv::Extension; -using libspirv::ExtensionSet; -using libspirv::ValidationState_t; -using std::vector; - -// A test with a ValidationState_t member transparently. -class ValidationStateTest : public testing::Test { - public: - ValidationStateTest() - : context_(spvContextCreate(SPV_ENV_UNIVERSAL_1_0)), - options_(spvValidatorOptionsCreate()), - state_(context_, options_) {} - - ~ValidationStateTest() { - spvContextDestroy(context_); - spvValidatorOptionsDestroy(options_); - } - protected: - spv_context context_; - spv_validator_options options_; - ValidationState_t state_; -}; - -// A test of ValidationState_t::HasAnyOfCapabilities(). -using ValidationState_HasAnyOfCapabilities = ValidationStateTest; - -TEST_F(ValidationState_HasAnyOfCapabilities, EmptyMask) { - EXPECT_TRUE(state_.HasAnyOfCapabilities({})); - state_.RegisterCapability(SpvCapabilityMatrix); - EXPECT_TRUE(state_.HasAnyOfCapabilities({})); - state_.RegisterCapability(SpvCapabilityImageMipmap); - EXPECT_TRUE(state_.HasAnyOfCapabilities({})); - state_.RegisterCapability(SpvCapabilityPipes); - EXPECT_TRUE(state_.HasAnyOfCapabilities({})); - state_.RegisterCapability(SpvCapabilityStorageImageArrayDynamicIndexing); - EXPECT_TRUE(state_.HasAnyOfCapabilities({})); - state_.RegisterCapability(SpvCapabilityClipDistance); - EXPECT_TRUE(state_.HasAnyOfCapabilities({})); - state_.RegisterCapability(SpvCapabilityStorageImageWriteWithoutFormat); - EXPECT_TRUE(state_.HasAnyOfCapabilities({})); -} - -TEST_F(ValidationState_HasAnyOfCapabilities, SingleCapMask) { - EXPECT_FALSE(state_.HasAnyOfCapabilities({SpvCapabilityMatrix})); - EXPECT_FALSE(state_.HasAnyOfCapabilities({SpvCapabilityImageMipmap})); - state_.RegisterCapability(SpvCapabilityMatrix); - EXPECT_TRUE(state_.HasAnyOfCapabilities({SpvCapabilityMatrix})); - EXPECT_FALSE(state_.HasAnyOfCapabilities({SpvCapabilityImageMipmap})); - state_.RegisterCapability(SpvCapabilityImageMipmap); - EXPECT_TRUE(state_.HasAnyOfCapabilities({SpvCapabilityMatrix})); - EXPECT_TRUE(state_.HasAnyOfCapabilities({SpvCapabilityImageMipmap})); -} - -TEST_F(ValidationState_HasAnyOfCapabilities, MultiCapMask) { - const auto set1 = - CapabilitySet{SpvCapabilitySampledRect, SpvCapabilityImageBuffer}; - const auto set2 = CapabilitySet{SpvCapabilityStorageImageWriteWithoutFormat, - SpvCapabilityStorageImageReadWithoutFormat, - SpvCapabilityGeometryStreams}; - EXPECT_FALSE(state_.HasAnyOfCapabilities(set1)); - EXPECT_FALSE(state_.HasAnyOfCapabilities(set2)); - state_.RegisterCapability(SpvCapabilityImageBuffer); - EXPECT_TRUE(state_.HasAnyOfCapabilities(set1)); - EXPECT_FALSE(state_.HasAnyOfCapabilities(set2)); -} - -// A test of ValidationState_t::HasAnyOfExtensions(). -using ValidationState_HasAnyOfExtensions = ValidationStateTest; - -TEST_F(ValidationState_HasAnyOfExtensions, EmptyMask) { - EXPECT_TRUE(state_.HasAnyOfExtensions({})); - state_.RegisterExtension(Extension::kSPV_KHR_shader_ballot); - EXPECT_TRUE(state_.HasAnyOfExtensions({})); - state_.RegisterExtension(Extension::kSPV_KHR_16bit_storage); - EXPECT_TRUE(state_.HasAnyOfExtensions({})); - state_.RegisterExtension(Extension::kSPV_NV_viewport_array2); - EXPECT_TRUE(state_.HasAnyOfExtensions({})); -} - -TEST_F(ValidationState_HasAnyOfExtensions, SingleCapMask) { - EXPECT_FALSE(state_.HasAnyOfExtensions({Extension::kSPV_KHR_shader_ballot})); - EXPECT_FALSE(state_.HasAnyOfExtensions({Extension::kSPV_KHR_16bit_storage})); - state_.RegisterExtension(Extension::kSPV_KHR_shader_ballot); - EXPECT_TRUE(state_.HasAnyOfExtensions({Extension::kSPV_KHR_shader_ballot})); - EXPECT_FALSE(state_.HasAnyOfExtensions({Extension::kSPV_KHR_16bit_storage})); - state_.RegisterExtension(Extension::kSPV_KHR_16bit_storage); - EXPECT_TRUE(state_.HasAnyOfExtensions({Extension::kSPV_KHR_shader_ballot})); - EXPECT_TRUE(state_.HasAnyOfExtensions({Extension::kSPV_KHR_16bit_storage})); -} - -TEST_F(ValidationState_HasAnyOfExtensions, MultiCapMask) { - const auto set1 = ExtensionSet { - Extension::kSPV_KHR_multiview, - Extension::kSPV_KHR_16bit_storage - }; - const auto set2 = ExtensionSet { - Extension::kSPV_KHR_shader_draw_parameters, - Extension::kSPV_NV_stereo_view_rendering, - Extension::kSPV_KHR_shader_ballot - }; - EXPECT_FALSE(state_.HasAnyOfExtensions(set1)); - EXPECT_FALSE(state_.HasAnyOfExtensions(set2)); - state_.RegisterExtension(Extension::kSPV_KHR_multiview); - EXPECT_TRUE(state_.HasAnyOfExtensions(set1)); - EXPECT_FALSE(state_.HasAnyOfExtensions(set2)); -} - -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_storage_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_storage_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_storage_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_storage_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,178 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Validation tests for OpVariable storage class - -#include -#include -#include - -#include "gmock/gmock.h" -#include "val_fixtures.h" - -using ::testing::HasSubstr; - -using ValidateStorage = spvtest::ValidateBase; - -namespace { - -TEST_F(ValidateStorage, FunctionStorageInsideFunction) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 -%intt = OpTypeInt 32 1 -%voidt = OpTypeVoid -%vfunct = OpTypeFunction %voidt -%ptrt = OpTypePointer Function %intt -%func = OpFunction %voidt None %vfunct -%funcl = OpLabel -%var = OpVariable %ptrt Function - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateStorage, FunctionStorageOutsideFunction) { - char str[] = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 -%intt = OpTypeInt 32 1 -%voidt = OpTypeVoid -%vfunct = OpTypeFunction %voidt -%ptrt = OpTypePointer Function %intt -%var = OpVariable %ptrt Function -%func = OpFunction %voidt None %vfunct -%funcl = OpLabel - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("Variables can not have a function[7] storage class " - "outside of a function")); -} - -TEST_F(ValidateStorage, OtherStorageOutsideFunction) { - char str[] = R"( - OpCapability Shader - OpCapability Kernel - OpCapability AtomicStorage - OpCapability Linkage - OpMemoryModel Logical GLSL450 -%intt = OpTypeInt 32 0 -%voidt = OpTypeVoid -%vfunct = OpTypeFunction %voidt -%ptrt = OpTypePointer Function %intt -%unicon = OpVariable %ptrt UniformConstant -%input = OpVariable %ptrt Input -%unif = OpVariable %ptrt Uniform -%output = OpVariable %ptrt Output -%wgroup = OpVariable %ptrt Workgroup -%xwgrp = OpVariable %ptrt CrossWorkgroup -%priv = OpVariable %ptrt Private -%pushco = OpVariable %ptrt PushConstant -%atomct = OpVariable %ptrt AtomicCounter -%image = OpVariable %ptrt Image -%func = OpFunction %voidt None %vfunct -%funcl = OpLabel - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(str); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -// clang-format off -TEST_P(ValidateStorage, OtherStorageInsideFunction) { - std::stringstream ss; - ss << R"( - OpCapability Shader - OpCapability Kernel - OpCapability AtomicStorage - OpCapability Linkage - OpMemoryModel Logical GLSL450 -%intt = OpTypeInt 32 0 -%voidt = OpTypeVoid -%vfunct = OpTypeFunction %voidt -%ptrt = OpTypePointer Function %intt -%func = OpFunction %voidt None %vfunct -%funcl = OpLabel -%var = OpVariable %ptrt )" << GetParam() << R"( - OpReturn - OpFunctionEnd -)"; - - CompileSuccessfully(ss.str()); - ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr( - "Variables must have a function[7] storage class inside of a function")); -} - -INSTANTIATE_TEST_CASE_P(MatrixOp, ValidateStorage, - ::testing::Values( - "Input", - "Uniform", - "Output", - "Workgroup", - "CrossWorkgroup", - "Private", - "PushConstant", - "AtomicCounter", - "Image"),); -// clang-format on - -TEST_F(ValidateStorage, GenericVariableOutsideFunction) { - const auto str = R"( - OpCapability Kernel - OpCapability Linkage - OpMemoryModel Logical OpenCL -%intt = OpTypeInt 32 0 -%ptrt = OpTypePointer Function %intt -%var = OpVariable %ptrt Generic -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpVariable storage class cannot be Generic")); -} - -TEST_F(ValidateStorage, GenericVariableInsideFunction) { - const auto str = R"( - OpCapability Shader - OpCapability Linkage - OpMemoryModel Logical GLSL450 -%intt = OpTypeInt 32 1 -%voidt = OpTypeVoid -%vfunct = OpTypeFunction %voidt -%ptrt = OpTypePointer Function %intt -%func = OpFunction %voidt None %vfunct -%funcl = OpLabel -%var = OpVariable %ptrt Generic - OpReturn - OpFunctionEnd -)"; - CompileSuccessfully(str); - ASSERT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr("OpVariable storage class cannot be Generic")); -} -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_type_unique_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_type_unique_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_type_unique_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_type_unique_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,269 +0,0 @@ -// Copyright (c) 2017 Google 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. - -// Tests for unique type declaration rules validator. - -#include - -#include "gmock/gmock.h" -#include "unit_spirv.h" -#include "val_fixtures.h" - -namespace { - -using ::testing::HasSubstr; -using ::testing::Not; - -using std::string; - -using ValidateTypeUnique = spvtest::ValidateBase; - -const spv_result_t kDuplicateTypeError = SPV_ERROR_INVALID_DATA; - -const string& GetHeader() { - static const string header = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -%floatt = OpTypeFloat 32 -%vec2t = OpTypeVector %floatt 2 -%vec3t = OpTypeVector %floatt 3 -%vec4t = OpTypeVector %floatt 4 -%mat22t = OpTypeMatrix %vec2t 2 -%mat33t = OpTypeMatrix %vec3t 3 -%mat44t = OpTypeMatrix %vec4t 4 -%intt = OpTypeInt 32 1 -%uintt = OpTypeInt 32 0 -%num3 = OpConstant %uintt 3 -%const3 = OpConstant %uintt 3 -%val3 = OpConstant %uintt 3 -%array = OpTypeArray %vec3t %num3 -%struct = OpTypeStruct %floatt %floatt %vec3t -%boolt = OpTypeBool -%array2 = OpTypeArray %vec3t %num3 -%voidt = OpTypeVoid -%vfunct = OpTypeFunction %voidt -%struct2 = OpTypeStruct %floatt %floatt %vec3t -%false = OpConstantFalse %boolt -%true = OpConstantTrue %boolt -%runtime_arrayt = OpTypeRuntimeArray %floatt -%runtime_arrayt2 = OpTypeRuntimeArray %floatt -)"; - - return header; -} - -const string& GetBody() { - static const string body = R"( -%main = OpFunction %voidt None %vfunct -%mainl = OpLabel -%a = OpIAdd %uintt %const3 %val3 -%b = OpIAdd %uintt %const3 %val3 -OpSelectionMerge %endl None -OpBranchConditional %true %truel %falsel -%truel = OpLabel -%add1 = OpIAdd %uintt %a %b -%add2 = OpIAdd %uintt %a %b -OpBranch %endl -%falsel = OpLabel -%sub1 = OpISub %uintt %a %b -%sub2 = OpISub %uintt %a %b -OpBranch %endl -%endl = OpLabel -OpReturn -OpFunctionEnd -)"; - - return body; -} - -// Returns expected error string if |opcode| produces a duplicate type -// declaration. -string GetErrorString(SpvOp opcode) { - return "Duplicate non-aggregate type declarations are not allowed. Opcode: " - + std::string(spvOpcodeString(opcode)); -} - -TEST_F(ValidateTypeUnique, success) { - string str = GetHeader() + GetBody(); - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateTypeUnique, duplicate_void) { - string str = GetHeader() + R"( -%boolt2 = OpTypeVoid -)" + GetBody(); - CompileSuccessfully(str.c_str()); - ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeVoid))); -} - -TEST_F(ValidateTypeUnique, duplicate_bool) { - string str = GetHeader() + R"( -%boolt2 = OpTypeBool -)" + GetBody(); - CompileSuccessfully(str.c_str()); - ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeBool))); -} - -TEST_F(ValidateTypeUnique, duplicate_int) { - string str = GetHeader() + R"( -%uintt2 = OpTypeInt 32 0 -)" + GetBody(); - CompileSuccessfully(str.c_str()); - ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeInt))); -} - -TEST_F(ValidateTypeUnique, duplicate_float) { - string str = GetHeader() + R"( -%floatt2 = OpTypeFloat 32 -)" + GetBody(); - CompileSuccessfully(str.c_str()); - ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeFloat))); -} - -TEST_F(ValidateTypeUnique, duplicate_vec3) { - string str = GetHeader() + R"( -%vec3t2 = OpTypeVector %floatt 3 -)" + GetBody(); - CompileSuccessfully(str.c_str()); - ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr(GetErrorString(SpvOpTypeVector))); -} - -TEST_F(ValidateTypeUnique, duplicate_mat33) { - string str = GetHeader() + R"( -%mat33t2 = OpTypeMatrix %vec3t 3 -)" + GetBody(); - CompileSuccessfully(str.c_str()); - ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr(GetErrorString(SpvOpTypeMatrix))); -} - -TEST_F(ValidateTypeUnique, duplicate_vfunc) { - string str = GetHeader() + R"( -%vfunct2 = OpTypeFunction %voidt -)" + GetBody(); - CompileSuccessfully(str.c_str()); - ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr(GetErrorString(SpvOpTypeFunction))); -} - -TEST_F(ValidateTypeUnique, duplicate_pipe_storage) { - string str = R"( -OpCapability Addresses -OpCapability Kernel -OpCapability Linkage -OpCapability Pipes -OpCapability PipeStorage -OpMemoryModel Physical32 OpenCL -%ps = OpTypePipeStorage -%ps2 = OpTypePipeStorage -)"; - CompileSuccessfully(str.c_str(), SPV_ENV_UNIVERSAL_1_1); - ASSERT_EQ(kDuplicateTypeError, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); - EXPECT_THAT(getDiagnosticString(), - HasSubstr(GetErrorString(SpvOpTypePipeStorage))); -} - -TEST_F(ValidateTypeUnique, duplicate_named_barrier) { - string str = R"( -OpCapability Addresses -OpCapability Kernel -OpCapability Linkage -OpCapability NamedBarrier -OpMemoryModel Physical32 OpenCL -%nb = OpTypeNamedBarrier -%nb2 = OpTypeNamedBarrier -)"; - CompileSuccessfully(str.c_str(), SPV_ENV_UNIVERSAL_1_1); - ASSERT_EQ(kDuplicateTypeError, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1)); - EXPECT_THAT(getDiagnosticString(), - HasSubstr(GetErrorString(SpvOpTypeNamedBarrier))); -} - -TEST_F(ValidateTypeUnique, duplicate_forward_pointer) { - string str = R"( -OpCapability Addresses -OpCapability Kernel -OpCapability GenericPointer -OpCapability Linkage -OpMemoryModel Physical32 OpenCL -OpTypeForwardPointer %ptr Generic -OpTypeForwardPointer %ptr2 Generic -%intt = OpTypeInt 32 0 -%floatt = OpTypeFloat 32 -%ptr = OpTypePointer Generic %intt -%ptr2 = OpTypePointer Generic %floatt -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); -} - -TEST_F(ValidateTypeUnique, duplicate_void_with_extension) { - string str = R"( -OpCapability Addresses -OpCapability Kernel -OpCapability Linkage -OpCapability Pipes -OpExtension "SPV_VALIDATOR_ignore_type_decl_unique" -OpMemoryModel Physical32 OpenCL -%voidt = OpTypeVoid -%voidt2 = OpTypeVoid -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - Not(HasSubstr(GetErrorString(SpvOpTypeVoid)))); -} - -TEST_F(ValidateTypeUnique, DuplicatePointerTypesNoExtension) { - string str = R"( -OpCapability Shader -OpCapability Linkage -OpMemoryModel Logical GLSL450 -%u32 = OpTypeInt 32 0 -%ptr1 = OpTypePointer Input %u32 -%ptr2 = OpTypePointer Input %u32 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(kDuplicateTypeError, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - HasSubstr(GetErrorString(SpvOpTypePointer))); -} - -TEST_F(ValidateTypeUnique, DuplicatePointerTypesWithExtension) { - string str = R"( -OpCapability Shader -OpCapability Linkage -OpExtension "SPV_KHR_variable_pointers" -OpMemoryModel Logical GLSL450 -%u32 = OpTypeInt 32 0 -%ptr1 = OpTypePointer Input %u32 -%ptr2 = OpTypePointer Input %u32 -)"; - CompileSuccessfully(str.c_str()); - ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()); - EXPECT_THAT(getDiagnosticString(), - Not(HasSubstr(GetErrorString(SpvOpTypePointer)))); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_validation_state_test.cpp vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_validation_state_test.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/test/val/val_validation_state_test.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/test/val/val_validation_state_test.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,155 +0,0 @@ -// Copyright (c) 2016 Google 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. - -// Basic tests for the ValidationState_t datastructure. - -#include - -#include "gmock/gmock.h" -#include "spirv_validator_options.h" -#include "unit_spirv.h" -#include "val_fixtures.h" - -namespace { - -using std::string; -using ::testing::HasSubstr; - -using ValidationStateTest = spvtest::ValidateBase; - -const char header[] = - " OpCapability Shader" - " OpCapability Linkage" - " OpMemoryModel Logical GLSL450 "; - -const char kVoidFVoid[] = - " %void = OpTypeVoid" - " %void_f = OpTypeFunction %void" - " %func = OpFunction %void None %void_f" - " %label = OpLabel" - " OpReturn" - " OpFunctionEnd "; - -// Tests that the instruction count in ValidationState is correct. -TEST_F(ValidationStateTest, CheckNumInstructions) { - string spirv = string(header) + "%int = OpTypeInt 32 0"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); - EXPECT_EQ(size_t(4), vstate_->ordered_instructions().size()); -} - -// Tests that the number of global variables in ValidationState is correct. -TEST_F(ValidationStateTest, CheckNumGlobalVars) { - string spirv = string(header) + R"( - %int = OpTypeInt 32 0 -%_ptr_int = OpTypePointer Input %int - %var_1 = OpVariable %_ptr_int Input - %var_2 = OpVariable %_ptr_int Input - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); - EXPECT_EQ(unsigned(2), vstate_->num_global_vars()); -} - -// Tests that the number of local variables in ValidationState is correct. -TEST_F(ValidationStateTest, CheckNumLocalVars) { - string spirv = string(header) + R"( - %int = OpTypeInt 32 0 - %_ptr_int = OpTypePointer Function %int - %voidt = OpTypeVoid - %funct = OpTypeFunction %voidt - %main = OpFunction %voidt None %funct - %entry = OpLabel - %var_1 = OpVariable %_ptr_int Function - %var_2 = OpVariable %_ptr_int Function - %var_3 = OpVariable %_ptr_int Function - OpReturn - OpFunctionEnd - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); - EXPECT_EQ(unsigned(3), vstate_->num_local_vars()); -} - -// Tests that the "id bound" in ValidationState is correct. -TEST_F(ValidationStateTest, CheckIdBound) { - string spirv = string(header) + R"( - %int = OpTypeInt 32 0 - %voidt = OpTypeVoid - )"; - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); - EXPECT_EQ(unsigned(3), vstate_->getIdBound()); -} - -// Tests that the entry_points in ValidationState is correct. -TEST_F(ValidationStateTest, CheckEntryPoints) { - string spirv = string(header) + " OpEntryPoint Vertex %func \"shader\"" + - string(kVoidFVoid); - CompileSuccessfully(spirv); - EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState()); - EXPECT_EQ(size_t(1), vstate_->entry_points().size()); - EXPECT_EQ(SpvOpFunction, - vstate_->FindDef(vstate_->entry_points()[0])->opcode()); -} - -TEST_F(ValidationStateTest, CheckStructMemberLimitOption) { - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_struct_members, 32000u); - EXPECT_EQ(32000u, options_->universal_limits_.max_struct_members); -} - -TEST_F(ValidationStateTest, CheckNumGlobalVarsLimitOption) { - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_global_variables, 100u); - EXPECT_EQ(100u, options_->universal_limits_.max_global_variables); -} - -TEST_F(ValidationStateTest, CheckNumLocalVarsLimitOption) { - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_local_variables, 100u); - EXPECT_EQ(100u, options_->universal_limits_.max_local_variables); -} - -TEST_F(ValidationStateTest, CheckStructDepthLimitOption) { - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_struct_depth, 100u); - EXPECT_EQ(100u, options_->universal_limits_.max_struct_depth); -} - -TEST_F(ValidationStateTest, CheckSwitchBranchesLimitOption) { - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_switch_branches, 100u); - EXPECT_EQ(100u, options_->universal_limits_.max_switch_branches); -} - -TEST_F(ValidationStateTest, CheckFunctionArgsLimitOption) { - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_function_args, 100u); - EXPECT_EQ(100u, options_->universal_limits_.max_function_args); -} - -TEST_F(ValidationStateTest, CheckCFGDepthLimitOption) { - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_control_flow_nesting_depth, 100u); - EXPECT_EQ(100u, options_->universal_limits_.max_control_flow_nesting_depth); -} - -TEST_F(ValidationStateTest, CheckAccessChainIndexesLimitOption) { - spvValidatorOptionsSetUniversalLimit( - options_, spv_validator_limit_max_access_chain_indexes, 100u); - EXPECT_EQ(100u, options_->universal_limits_.max_access_chain_indexes); -} - -} // anonymous namespace diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/as/as.cpp vulkan-1.1.73+dfsg/external/spirv-tools/tools/as/as.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/as/as.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/as/as.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,153 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include - -#include "source/spirv_target_env.h" -#include "spirv-tools/libspirv.h" -#include "tools/io.h" - -void print_usage(char* argv0) { - printf( - R"(%s - Create a SPIR-V binary module from SPIR-V assembly text - -Usage: %s [options] [] - -The SPIR-V assembly text is read from . If no file is specified, -or if the filename is "-", then the binary is read from standard input. -The SPIR-V binary module is written to file "out.spv", unless the -o option -is used. - -Options: - - -h, --help Print this help. - - -o Set the output filename. Use '-' to mean stdout. - --version Display assembler version information. - --preserve-numeric-ids - Numeric IDs in the binary will have the same values as in the - source. Non-numeric IDs are allocated by filling in the gaps, - starting with 1 and going up. - --target-env {vulkan1.0|spv1.0|spv1.1|spv1.2} - Use Vulkan1.0/SPIR-V1.0/SPIR-V1.1/SPIR-V1.2 -)", - argv0, argv0); -} - -static const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_2; - -int main(int argc, char** argv) { - const char* inFile = nullptr; - const char* outFile = nullptr; - uint32_t options = 0; - spv_target_env target_env = kDefaultEnvironment; - for (int argi = 1; argi < argc; ++argi) { - if ('-' == argv[argi][0]) { - switch (argv[argi][1]) { - case 'h': { - print_usage(argv[0]); - return 0; - } - case 'o': { - if (!outFile && argi + 1 < argc) { - outFile = argv[++argi]; - } else { - print_usage(argv[0]); - return 1; - } - } break; - case 0: { - // Setting a filename of "-" to indicate stdin. - if (!inFile) { - inFile = argv[argi]; - } else { - fprintf(stderr, "error: More than one input file specified\n"); - return 1; - } - } break; - case '-': { - // Long options - if (0 == strcmp(argv[argi], "--version")) { - printf("%s\n", spvSoftwareVersionDetailsString()); - printf("Target: %s\n", - spvTargetEnvDescription(kDefaultEnvironment)); - return 0; - } else if (0 == strcmp(argv[argi], "--help")) { - print_usage(argv[0]); - return 0; - } else if (0 == strcmp(argv[argi], "--preserve-numeric-ids")) { - options |= SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS; - } else if (0 == strcmp(argv[argi], "--target-env")) { - if (argi + 1 < argc) { - const auto env_str = argv[++argi]; - if (!spvParseTargetEnv(env_str, &target_env)) { - fprintf(stderr, "error: Unrecognized target env: %s\n", - env_str); - return 1; - } - } else { - fprintf(stderr, "error: Missing argument to --target-env\n"); - return 1; - } - } else { - fprintf(stderr, "error: Unrecognized option: %s\n\n", argv[argi]); - print_usage(argv[0]); - return 1; - } - } break; - default: - fprintf(stderr, "error: Unrecognized option: %s\n\n", argv[argi]); - print_usage(argv[0]); - return 1; - } - } else { - if (!inFile) { - inFile = argv[argi]; - } else { - fprintf(stderr, "error: More than one input file specified\n"); - return 1; - } - } - } - - if (!outFile) { - outFile = "out.spv"; - } - - std::vector contents; - if (!ReadFile(inFile, "r", &contents)) return 1; - - spv_binary binary; - spv_diagnostic diagnostic = nullptr; - spv_context context = spvContextCreate(target_env); - spv_result_t error = spvTextToBinaryWithOptions( - context, contents.data(), contents.size(), options, &binary, &diagnostic); - spvContextDestroy(context); - if (error) { - spvDiagnosticPrint(diagnostic); - spvDiagnosticDestroy(diagnostic); - return error; - } - - if (!WriteFile(outFile, "wb", binary->code, binary->wordCount)) { - spvBinaryDestroy(binary); - return 1; - } - - spvBinaryDestroy(binary); - - return 0; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/cfg/bin_to_dot.cpp vulkan-1.1.73+dfsg/external/spirv-tools/tools/cfg/bin_to_dot.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/cfg/bin_to_dot.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/cfg/bin_to_dot.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,187 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include "bin_to_dot.h" - -#include -#include -#include -#include - -#include "assembly_grammar.h" -#include "name_mapper.h" - -namespace { - -const char* kMergeStyle = "style=dashed"; -const char* kContinueStyle = "style=dotted"; - -// A DotConverter can be used to dump the GraphViz "dot" graph for -// a SPIR-V module. -class DotConverter { - public: - DotConverter(libspirv::NameMapper name_mapper, std::iostream* out) - : name_mapper_(std::move(name_mapper)), out_(*out) {} - - // Emits the graph preamble. - void Begin() const { - out_ << "digraph {\n"; - // Emit a simple legend - out_ << "legend_merge_src [shape=plaintext, label=\"\"];\n" - << "legend_merge_dest [shape=plaintext, label=\"\"];\n" - << "legend_merge_src -> legend_merge_dest [label=\" merge\"," - << kMergeStyle << "];\n" - << "legend_continue_src [shape=plaintext, label=\"\"];\n" - << "legend_continue_dest [shape=plaintext, label=\"\"];\n" - << "legend_continue_src -> legend_continue_dest [label=\" continue\"," - << kContinueStyle << "];\n"; - } - // Emits the graph postamble. - void End() const { out_ << "}\n"; } - - // Emits the Dot commands for the given instruction. - spv_result_t HandleInstruction(const spv_parsed_instruction_t& inst); - - private: - // Ends processing for the current block, emitting its dot code. - void FlushBlock(const std::vector& successors); - - // The ID of the current functio, or 0 if outside of a function. - uint32_t current_function_id_ = 0; - - // The ID of the current basic block, or 0 if outside of a block. - uint32_t current_block_id_ = 0; - - // Have we completed processing for the entry block to this fuction? - bool seen_function_entry_block_ = false; - - // The Id of the merge block for this block if it exists, or 0 otherwise. - uint32_t merge_ = 0; - // The Id of the continue target block for this block if it exists, or 0 - // otherwise. - uint32_t continue_target_ = 0; - - // An object for mapping Ids to names. - libspirv::NameMapper name_mapper_; - - // The output stream. - std::ostream& out_; -}; - -spv_result_t DotConverter::HandleInstruction( - const spv_parsed_instruction_t& inst) { - switch(inst.opcode) { - case SpvOpFunction: - current_function_id_ = inst.result_id; - seen_function_entry_block_ = false; - break; - case SpvOpFunctionEnd: - current_function_id_ = 0; - break; - - case SpvOpLabel: - current_block_id_ = inst.result_id; - break; - - case SpvOpBranch: - FlushBlock({inst.words[1]}); - break; - case SpvOpBranchConditional: - FlushBlock({inst.words[2], inst.words[3]}); - break; - case SpvOpSwitch: { - std::vector successors{inst.words[2]}; - for (size_t i = 3; i < inst.num_operands; i += 2) { - successors.push_back(inst.words[inst.operands[i].offset]); - } - FlushBlock(successors); - } break; - - case SpvOpKill: - case SpvOpReturn: - case SpvOpUnreachable: - case SpvOpReturnValue: - FlushBlock({}); - break; - - case SpvOpLoopMerge: - merge_ = inst.words[1]; - continue_target_ = inst.words[2]; - break; - case SpvOpSelectionMerge: - merge_ = inst.words[1]; - break; - default: - break; - } - return SPV_SUCCESS; -} - -void DotConverter::FlushBlock(const std::vector& successors) { - out_ << current_block_id_; - if (!seen_function_entry_block_) { - out_ << " [label=\"" << name_mapper_(current_block_id_) << "\nFn " - << name_mapper_(current_function_id_) << " entry\", shape=box];\n"; - } else { - out_ << " [label=\"" << name_mapper_(current_block_id_) << "\"];\n"; - } - - for (auto successor : successors) { - out_ << current_block_id_ << " -> " << successor << ";\n"; - } - - if (merge_) { - out_ << current_block_id_ << " -> " << merge_ << " [" << kMergeStyle - << "];\n"; - } - if (continue_target_) { - out_ << current_block_id_ << " -> " << continue_target_ << " [" - << kContinueStyle << "];\n"; - } - - // Reset the book-keeping for a block. - seen_function_entry_block_ = true; - merge_ = 0; - continue_target_ = 0; -} - -spv_result_t HandleInstruction( - void* user_data, const spv_parsed_instruction_t* parsed_instruction) { - assert(user_data); - auto converter = static_cast(user_data); - return converter->HandleInstruction(*parsed_instruction); -} - -} // anonymous namespace - -spv_result_t BinaryToDot(const spv_const_context context, const uint32_t* words, - size_t num_words, std::iostream* out, - spv_diagnostic* diagnostic) { - // Invalid arguments return error codes, but don't necessarily generate - // diagnostics. These are programmer errors, not user errors. - if (!diagnostic) return SPV_ERROR_INVALID_DIAGNOSTIC; - const libspirv::AssemblyGrammar grammar(context); - if (!grammar.isValid()) return SPV_ERROR_INVALID_TABLE; - - libspirv::FriendlyNameMapper friendly_mapper(context, words, num_words); - DotConverter converter(friendly_mapper.GetNameMapper(), out); - converter.Begin(); - if (auto error = spvBinaryParse(context, &converter, words, num_words, - nullptr, HandleInstruction, diagnostic)) { - return error; - } - converter.End(); - - return SPV_SUCCESS; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/cfg/bin_to_dot.h vulkan-1.1.73+dfsg/external/spirv-tools/tools/cfg/bin_to_dot.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/cfg/bin_to_dot.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/cfg/bin_to_dot.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef BIN_TO_DOT_H_ -#define BIN_TO_DOT_H_ - -#include -#include "spirv-tools/libspirv.h" - -// Dumps the control flow graph for the given module to the output stream. -// Returns SPV_SUCCESS on succes. -spv_result_t BinaryToDot(const spv_const_context context, const uint32_t* words, - size_t num_words, std::iostream* out, - spv_diagnostic* diagnostic); - -#endif // BIN_TO_DOT_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/cfg/cfg.cpp vulkan-1.1.73+dfsg/external/spirv-tools/tools/cfg/cfg.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/cfg/cfg.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/cfg/cfg.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,127 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include -#include - -#include "spirv-tools/libspirv.h" -#include "tools/io.h" - -#include "bin_to_dot.h" - -// Prints a program usage message to stdout. -static void print_usage(const char* argv0) { - printf( - R"(%s - Show the control flow graph in GraphiViz "dot" form. EXPERIMENTAL - -Usage: %s [options] [] - -The SPIR-V binary is read from . If no file is specified, -or if the filename is "-", then the binary is read from standard input. - -Options: - - -h, --help Print this help. - --version Display version information. - - -o Set the output filename. - Output goes to standard output if this option is - not specified, or if the filename is "-". -)", - argv0, argv0); -} - -static const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_2; - -int main(int argc, char** argv) { - const char* inFile = nullptr; - const char* outFile = nullptr; // Stays nullptr if printing to stdout. - - for (int argi = 1; argi < argc; ++argi) { - if ('-' == argv[argi][0]) { - switch (argv[argi][1]) { - case 'h': - print_usage(argv[0]); - return 0; - case 'o': { - if (!outFile && argi + 1 < argc) { - outFile = argv[++argi]; - } else { - print_usage(argv[0]); - return 1; - } - } break; - case '-': { - // Long options - if (0 == strcmp(argv[argi], "--help")) { - print_usage(argv[0]); - return 0; - } else if (0 == strcmp(argv[argi], "--version")) { - printf("%s EXPERIMENTAL\n", spvSoftwareVersionDetailsString()); - printf("Target: %s\n", - spvTargetEnvDescription(kDefaultEnvironment)); - return 0; - } else { - print_usage(argv[0]); - return 1; - } - } break; - case 0: { - // Setting a filename of "-" to indicate stdin. - if (!inFile) { - inFile = argv[argi]; - } else { - fprintf(stderr, "error: More than one input file specified\n"); - return 1; - } - } break; - default: - print_usage(argv[0]); - return 1; - } - } else { - if (!inFile) { - inFile = argv[argi]; - } else { - fprintf(stderr, "error: More than one input file specified\n"); - return 1; - } - } - } - - // Read the input binary. - std::vector contents; - if (!ReadFile(inFile, "rb", &contents)) return 1; - spv_context context = spvContextCreate(kDefaultEnvironment); - spv_diagnostic diagnostic = nullptr; - - std::stringstream ss; - auto error = BinaryToDot(context, contents.data(), contents.size(), &ss, &diagnostic); - if (error) { - spvDiagnosticPrint(diagnostic); - spvDiagnosticDestroy(diagnostic); - spvContextDestroy(context); - return error; - } - std::string str = ss.str(); - WriteFile(outFile, "w", str.data(), str.size()); - - spvDiagnosticDestroy(diagnostic); - spvContextDestroy(context); - - return 0; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/tools/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -# Copyright (c) 2015-2016 The Khronos Group Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -add_subdirectory(lesspipe) -add_subdirectory(emacs) - -# Add a SPIR-V Tools command line tool. Signature: -# add_spvtools_tool( -# TARGET target_name -# SRCS src_file1.cpp src_file2.cpp -# LIBS lib_target1 lib_target2 -# ) -function(add_spvtools_tool) - set(one_value_args TARGET) - set(multi_value_args SRCS LIBS) - cmake_parse_arguments( - ARG "" "${one_value_args}" "${multi_value_args}" ${ARGN}) - - add_executable(${ARG_TARGET} ${ARG_SRCS}) - spvtools_default_compile_options(${ARG_TARGET}) - target_link_libraries(${ARG_TARGET} PRIVATE ${ARG_LIBS}) - target_include_directories(${ARG_TARGET} PRIVATE - ${spirv-tools_SOURCE_DIR} - ${spirv-tools_BINARY_DIR} - ) - set_property(TARGET ${ARG_TARGET} PROPERTY FOLDER "SPIRV-Tools executables") -endfunction() - -if (NOT ${SPIRV_SKIP_EXECUTABLES}) - add_spvtools_tool(TARGET spirv-as SRCS as/as.cpp LIBS ${SPIRV_TOOLS}) - add_spvtools_tool(TARGET spirv-dis SRCS dis/dis.cpp LIBS ${SPIRV_TOOLS}) - add_spvtools_tool(TARGET spirv-val SRCS val/val.cpp LIBS ${SPIRV_TOOLS}) - add_spvtools_tool(TARGET spirv-opt SRCS opt/opt.cpp LIBS SPIRV-Tools-opt ${SPIRV_TOOLS}) - add_spvtools_tool(TARGET spirv-link SRCS link/linker.cpp LIBS SPIRV-Tools-link ${SPIRV_TOOLS}) - add_spvtools_tool(TARGET spirv-stats - SRCS stats/stats.cpp - stats/stats_analyzer.cpp - LIBS ${SPIRV_TOOLS}) - add_spvtools_tool(TARGET spirv-cfg - SRCS cfg/cfg.cpp - cfg/bin_to_dot.h - cfg/bin_to_dot.cpp - LIBS ${SPIRV_TOOLS}) - target_include_directories(spirv-cfg PRIVATE ${spirv-tools_SOURCE_DIR} - ${SPIRV_HEADER_INCLUDE_DIR}) - target_include_directories(spirv-stats PRIVATE ${spirv-tools_SOURCE_DIR} - ${SPIRV_HEADER_INCLUDE_DIR}) - - set(SPIRV_INSTALL_TARGETS spirv-as spirv-dis spirv-val spirv-opt spirv-stats - spirv-cfg spirv-link) - - if(SPIRV_BUILD_COMPRESSION) - add_spvtools_tool(TARGET spirv-markv - SRCS comp/markv.cpp - comp/markv_model_factory.cpp - comp/markv_model_shader_default.cpp - LIBS SPIRV-Tools-comp ${SPIRV_TOOLS}) - target_include_directories(spirv-markv PRIVATE ${spirv-tools_SOURCE_DIR} - ${SPIRV_HEADER_INCLUDE_DIR}) - set(SPIRV_INSTALL_TARGETS ${SPIRV_INSTALL_TARGETS} spirv-markv) - endif(SPIRV_BUILD_COMPRESSION) - - if(ENABLE_SPIRV_TOOLS_INSTALL) - install(TARGETS ${SPIRV_INSTALL_TARGETS} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(ENABLE_SPIRV_TOOLS_INSTALL) -endif() diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/comp/markv.cpp vulkan-1.1.73+dfsg/external/spirv-tools/tools/comp/markv.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/comp/markv.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/comp/markv.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,252 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include -#include -#include -#include -#include -#include -#include - -#include "markv_model_factory.h" -#include "source/comp/markv.h" -#include "source/spirv_target_env.h" -#include "source/table.h" -#include "tools/io.h" - -namespace { - -enum Task { - kNoTask = 0, - kEncode, - kDecode, -}; - -struct ScopedContext { - ScopedContext(spv_target_env env) : context(spvContextCreate(env)) {} - ~ScopedContext() { spvContextDestroy(context); } - spv_context context; -}; - -void print_usage(char* argv0) { - printf( - R"(%s - Encodes or decodes a SPIR-V binary to or from a MARK-V binary. - -USAGE: %s [e|d] [options] [] - -The input binary is read from . If no file is specified, -or if the filename is "-", then the binary is read from standard input. - -If no output is specified then the output is printed to stdout in a human -readable format. - -WIP: MARK-V codec is in early stages of development. At the moment it only -can encode and decode some SPIR-V files and only if exacly the same build of -software is used (is doesn't write or handle version numbers yet). - -Tasks: - e Encode SPIR-V to MARK-V. - d Decode MARK-V to SPIR-V. - -Options: - -h, --help Print this help. - --comments Write codec comments to stdout. - --version Display MARK-V codec version. - --validate Validate SPIR-V while encoding or decoding. - - -o Set the output filename. - Output goes to standard output if this option is - not specified, or if the filename is "-". -)", - argv0, argv0); -} - -void DiagnosticsMessageHandler(spv_message_level_t level, const char*, - const spv_position_t& position, - const char* message) { - switch (level) { - case SPV_MSG_FATAL: - case SPV_MSG_INTERNAL_ERROR: - case SPV_MSG_ERROR: - std::cerr << "error: " << position.index << ": " << message - << std::endl; - break; - case SPV_MSG_WARNING: - std::cout << "warning: " << position.index << ": " << message - << std::endl; - break; - case SPV_MSG_INFO: - std::cout << "info: " << position.index << ": " << message << std::endl; - break; - default: - break; - } -} - -} // namespace - -int main(int argc, char** argv) { - const char* input_filename = nullptr; - const char* output_filename = nullptr; - - Task task = kNoTask; - - if (argc < 3) { - print_usage(argv[0]); - return 0; - } - - const char* task_char = argv[1]; - if (0 == strcmp("e", task_char)) { - task = kEncode; - } else if (0 == strcmp("d", task_char)) { - task = kDecode; - } - - if (task == kNoTask) { - print_usage(argv[0]); - return 1; - } - - bool want_comments = false; - bool validate_spirv_binary = false; - - for (int argi = 2; argi < argc; ++argi) { - if ('-' == argv[argi][0]) { - switch (argv[argi][1]) { - case 'h': - print_usage(argv[0]); - return 0; - case 'o': { - if (!output_filename && argi + 1 < argc) { - output_filename = argv[++argi]; - } else { - print_usage(argv[0]); - return 1; - } - } break; - case '-': { - if (0 == strcmp(argv[argi], "--help")) { - print_usage(argv[0]); - return 0; - } else if (0 == strcmp(argv[argi], "--comments")) { - want_comments = true; - } else if (0 == strcmp(argv[argi], "--version")) { - fprintf(stderr, "error: Not implemented\n"); - return 1; - } else if (0 == strcmp(argv[argi], "--validate")) { - validate_spirv_binary = true; - } else { - print_usage(argv[0]); - return 1; - } - } break; - case '\0': { - // Setting a filename of "-" to indicate stdin. - if (!input_filename) { - input_filename = argv[argi]; - } else { - fprintf(stderr, "error: More than one input file specified\n"); - return 1; - } - } break; - default: - print_usage(argv[0]); - return 1; - } - } else { - if (!input_filename) { - input_filename = argv[argi]; - } else { - fprintf(stderr, "error: More than one input file specified\n"); - return 1; - } - } - } - - if (task == kDecode && want_comments) { - fprintf(stderr, "warning: Decoder comments not yet implemented\n"); - want_comments = false; - } - - const bool write_to_stdout = output_filename == nullptr || - 0 == strcmp(output_filename, "-"); - - std::string comments; - std::string* comments_ptr = want_comments ? &comments : nullptr; - - ScopedContext ctx(SPV_ENV_UNIVERSAL_1_2); - - std::unique_ptr model = - spvtools::CreateMarkvModel(spvtools::kMarkvModelShaderDefault); - - if (task == kEncode) { - std::vector spirv; - if (!ReadFile(input_filename, "rb", &spirv)) return 1; - - spvtools::MarkvEncoderOptions options; - options.validate_spirv_binary = validate_spirv_binary; - - std::vector markv; - - if (SPV_SUCCESS != spvtools::SpirvToMarkv( - ctx.context, spirv, options, *model, DiagnosticsMessageHandler, - &markv, comments_ptr)) { - std::cerr << "error: Failed to encode " << input_filename << " to MARK-V " - << std::endl; - return 1; - } - - if (want_comments) { - if (!WriteFile(nullptr, "w", comments.c_str(), - comments.length())) return 1; - } - - if (!want_comments || !write_to_stdout) { - if (!WriteFile(output_filename, "wb", markv.data(), - markv.size())) return 1; - } - } else if (task == kDecode) { - std::vector markv; - if (!ReadFile(input_filename, "rb", &markv)) return 1; - - spvtools::MarkvDecoderOptions options; - options.validate_spirv_binary = validate_spirv_binary; - - std::vector spirv; - - if (SPV_SUCCESS != spvtools::MarkvToSpirv( - ctx.context, markv, options, *model, DiagnosticsMessageHandler, - &spirv, comments_ptr)) { - std::cerr << "error: Failed to decode " << input_filename << " to SPIR-V " - << std::endl; - return 1; - } - - if (want_comments) { - if (!WriteFile(nullptr, "w", comments.c_str(), - comments.length())) return 1; - } - - if (!want_comments || !write_to_stdout) { - if (!WriteFile(output_filename, "wb", spirv.data(), - spirv.size())) return 1; - } - } else { - assert(false && "Unknown task"); - } - - return 0; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/comp/markv_model_factory.cpp vulkan-1.1.73+dfsg/external/spirv-tools/tools/comp/markv_model_factory.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/comp/markv_model_factory.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/comp/markv_model_factory.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include "markv_model_factory.h" -#include "markv_model_shader_default.h" - -namespace spvtools { - -std::unique_ptr CreateMarkvModel(MarkvModelType type) { - std::unique_ptr model; - switch (type) { - case kMarkvModelShaderDefault: { - model.reset(new MarkvModelShaderDefault()); - break; - } - } - - model->SetModelType(static_cast(type)); - - return model; -} - -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/comp/markv_model_factory.h vulkan-1.1.73+dfsg/external/spirv-tools/tools/comp/markv_model_factory.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/comp/markv_model_factory.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/comp/markv_model_factory.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SPIRV_TOOLS_COMP_MARKV_MODEL_FACTORY_H_ -#define SPIRV_TOOLS_COMP_MARKV_MODEL_FACTORY_H_ - -#include - -#include "source/comp/markv_model.h" - -namespace spvtools { - -enum MarkvModelType { - kMarkvModelShaderDefault = 1, -}; - -std::unique_ptr CreateMarkvModel(MarkvModelType type); - -} // namespace spvtools - -#endif // SPIRV_TOOLS_COMP_MARKV_MODEL_FACTORY_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/comp/markv_model_shader_default_autogen.inc vulkan-1.1.73+dfsg/external/spirv-tools/tools/comp/markv_model_shader_default_autogen.inc --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/comp/markv_model_shader_default_autogen.inc 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/comp/markv_model_shader_default_autogen.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,14519 +0,0 @@ - -std::map GetOpcodeAndNumOperandsHist() { - return std::map({ - { CombineOpcodeAndNumOperands(SpvOpExtInst, 7), 158282 }, - { CombineOpcodeAndNumOperands(SpvOpDot, 4), 151035 }, - { CombineOpcodeAndNumOperands(SpvOpVectorShuffle, 6), 183292 }, - { CombineOpcodeAndNumOperands(SpvOpImageSampleImplicitLod, 4), 126492 }, - { CombineOpcodeAndNumOperands(SpvOpExecutionMode, 2), 13311 }, - { CombineOpcodeAndNumOperands(SpvOpFNegate, 3), 29952 }, - { CombineOpcodeAndNumOperands(SpvOpExtInst, 5), 106847 }, - { CombineOpcodeAndNumOperands(SpvOpImageSampleExplicitLod, 7), 26350 }, - { CombineOpcodeAndNumOperands(SpvOpImageSampleExplicitLod, 6), 28186 }, - { CombineOpcodeAndNumOperands(SpvOpFDiv, 4), 41635 }, - { CombineOpcodeAndNumOperands(SpvOpFMul, 4), 412786 }, - { CombineOpcodeAndNumOperands(SpvOpFunction, 4), 62905 }, - { CombineOpcodeAndNumOperands(SpvOpVectorShuffle, 8), 118614 }, - { CombineOpcodeAndNumOperands(SpvOpDecorate, 2), 100735 }, - { CombineOpcodeAndNumOperands(SpvOpReturnValue, 1), 40852 }, - { CombineOpcodeAndNumOperands(SpvOpVectorTimesScalar, 4), 157091 }, - { CombineOpcodeAndNumOperands(SpvOpExtInst, 6), 122100 }, - { CombineOpcodeAndNumOperands(SpvOpAccessChain, 5), 82930 }, - { CombineOpcodeAndNumOperands(SpvOpFSub, 4), 161019 }, - { CombineOpcodeAndNumOperands(SpvOpConstant, 3), 466014 }, - { CombineOpcodeAndNumOperands(SpvOpCompositeExtract, 5), 107126 }, - { CombineOpcodeAndNumOperands(SpvOpTypeImage, 8), 34775 }, - { CombineOpcodeAndNumOperands(SpvOpImageSampleDrefExplicitLod, 7), 26146 }, - { CombineOpcodeAndNumOperands(SpvOpMemoryModel, 2), 18879 }, - { CombineOpcodeAndNumOperands(SpvOpDecorate, 3), 485251 }, - { CombineOpcodeAndNumOperands(SpvOpCompositeConstruct, 4), 78011 }, - { CombineOpcodeAndNumOperands(SpvOpTypeFloat, 2), 18879 }, - { CombineOpcodeAndNumOperands(SpvOpVectorTimesMatrix, 4), 15848 }, - { CombineOpcodeAndNumOperands(SpvOpTypeVector, 3), 69404 }, - { CombineOpcodeAndNumOperands(SpvOpTypeFunction, 3), 19998 }, - { CombineOpcodeAndNumOperands(SpvOpConstantComposite, 6), 40228 }, - { CombineOpcodeAndNumOperands(SpvOpCapability, 1), 22510 }, - { CombineOpcodeAndNumOperands(SpvOpTypeArray, 3), 37585 }, - { CombineOpcodeAndNumOperands(SpvOpTypeInt, 3), 30454 }, - { CombineOpcodeAndNumOperands(SpvOpFunctionCall, 4), 29021 }, - { CombineOpcodeAndNumOperands(SpvOpFAdd, 4), 342237 }, - { CombineOpcodeAndNumOperands(SpvOpTypeMatrix, 3), 24449 }, - { CombineOpcodeAndNumOperands(SpvOpLabel, 1), 129408 }, - { CombineOpcodeAndNumOperands(SpvOpTypePointer, 3), 246535 }, - { CombineOpcodeAndNumOperands(SpvOpAccessChain, 4), 503456 }, - { CombineOpcodeAndNumOperands(SpvOpTypeFunction, 2), 19779 }, - { CombineOpcodeAndNumOperands(SpvOpBranchConditional, 3), 24139 }, - { CombineOpcodeAndNumOperands(SpvOpVariable, 3), 697946 }, - { CombineOpcodeAndNumOperands(SpvOpConstantComposite, 5), 55769 }, - { CombineOpcodeAndNumOperands(SpvOpTypeVoid, 1), 18879 }, - { CombineOpcodeAndNumOperands(SpvOpCompositeConstruct, 6), 145508 }, - { CombineOpcodeAndNumOperands(SpvOpFunctionParameter, 2), 85583 }, - { CombineOpcodeAndNumOperands(SpvOpTypeSampledImage, 2), 34775 }, - { CombineOpcodeAndNumOperands(SpvOpConstantComposite, 4), 66362 }, - { CombineOpcodeAndNumOperands(SpvOpLoad, 3), 1272902 }, - { CombineOpcodeAndNumOperands(SpvOpReturn, 0), 22122 }, - { CombineOpcodeAndNumOperands(SpvOpCompositeExtract, 4), 861008 }, - { CombineOpcodeAndNumOperands(SpvOpFunctionEnd, 0), 62905 }, - { CombineOpcodeAndNumOperands(SpvOpExtInstImport, 2), 18879 }, - { CombineOpcodeAndNumOperands(SpvOpSelectionMerge, 2), 22009 }, - { CombineOpcodeAndNumOperands(SpvOpBranch, 1), 38275 }, - { CombineOpcodeAndNumOperands(SpvOpTypeBool, 1), 12208 }, - { CombineOpcodeAndNumOperands(SpvOpSampledImage, 4), 95518 }, - { CombineOpcodeAndNumOperands(SpvOpMemberDecorate, 3), 94887 }, - { CombineOpcodeAndNumOperands(SpvOpMemberDecorate, 4), 1942215 }, - { CombineOpcodeAndNumOperands(SpvOpCompositeConstruct, 5), 205266 }, - { CombineOpcodeAndNumOperands(SpvOpUndef, 2), 22157 }, - { CombineOpcodeAndNumOperands(SpvOpCompositeInsert, 5), 142749 }, - { CombineOpcodeAndNumOperands(SpvOpCompositeInsert, 6), 24420 }, - { CombineOpcodeAndNumOperands(SpvOpCompositeExtract, 6), 16896 }, - { CombineOpcodeAndNumOperands(SpvOpStore, 2), 604982 }, - { CombineOpcodeAndNumOperands(SpvOpIAdd, 4), 14471 }, - { CombineOpcodeAndNumOperands(SpvOpVectorShuffle, 7), 269658 }, - { kMarkvNoneOfTheAbove, 399895 }, - }); -} - -std::map>> -GetOpcodeAndNumOperandsMarkovHuffmanCodecs() { - std::map>> codecs; - { - std::unique_ptr> codec(new HuffmanCodec(35, { - {0, 0, 0}, - {65790, 0, 0}, - {131134, 0, 0}, - {196669, 0, 0}, - {262209, 0, 0}, - {262221, 0, 0}, - {262225, 0, 0}, - {262230, 0, 0}, - {262273, 0, 0}, - {262277, 0, 0}, - {262286, 0, 0}, - {327745, 0, 0}, - {327761, 0, 0}, - {327762, 0, 0}, - {393295, 0, 0}, - {393304, 0, 0}, - {458831, 0, 0}, - {458840, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 11, 8}, - {0, 12, 19}, - {0, 18, 20}, - {0, 5, 21}, - {0, 15, 7}, - {0, 10, 1}, - {0, 23, 22}, - {0, 14, 24}, - {0, 6, 4}, - {0, 2, 17}, - {0, 13, 25}, - {0, 9, 26}, - {0, 28, 27}, - {0, 3, 29}, - {0, 30, 16}, - {0, 32, 31}, - {0, 34, 33}, - })); - - codecs.emplace(SpvOpImageSampleExplicitLod, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(55, { - {0, 0, 0}, - {65785, 0, 0}, - {65790, 0, 0}, - {131134, 0, 0}, - {196669, 0, 0}, - {196735, 0, 0}, - {262201, 0, 0}, - {262209, 0, 0}, - {262224, 0, 0}, - {262225, 0, 0}, - {262231, 0, 0}, - {262273, 0, 0}, - {262275, 0, 0}, - {262277, 0, 0}, - {262280, 0, 0}, - {262286, 0, 0}, - {327692, 0, 0}, - {327745, 0, 0}, - {327760, 0, 0}, - {327762, 0, 0}, - {393228, 0, 0}, - {393295, 0, 0}, - {393296, 0, 0}, - {393303, 0, 0}, - {393304, 0, 0}, - {458764, 0, 0}, - {458831, 0, 0}, - {524367, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 14, 5}, - {0, 29, 17}, - {0, 1, 30}, - {0, 10, 20}, - {0, 32, 31}, - {0, 33, 2}, - {0, 34, 23}, - {0, 8, 35}, - {0, 6, 36}, - {0, 19, 22}, - {0, 28, 25}, - {0, 38, 37}, - {0, 13, 39}, - {0, 40, 24}, - {0, 27, 21}, - {0, 26, 41}, - {0, 42, 12}, - {0, 15, 43}, - {0, 44, 18}, - {0, 45, 3}, - {0, 11, 7}, - {0, 16, 46}, - {0, 47, 9}, - {0, 4, 48}, - {0, 50, 49}, - {0, 52, 51}, - {0, 54, 53}, - })); - - codecs.emplace(SpvOpFDiv, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(19, { - {0, 0, 0}, - {196669, 0, 0}, - {262209, 0, 0}, - {262224, 0, 0}, - {262225, 0, 0}, - {262231, 0, 0}, - {262286, 0, 0}, - {393295, 0, 0}, - {393304, 0, 0}, - {458840, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 8, 10}, - {0, 11, 3}, - {0, 2, 9}, - {0, 4, 1}, - {0, 5, 6}, - {0, 13, 12}, - {0, 15, 14}, - {0, 16, 7}, - {0, 18, 17}, - })); - - codecs.emplace(SpvOpSampledImage, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(67, { - {0, 0, 0}, - {65785, 0, 0}, - {65790, 0, 0}, - {131134, 0, 0}, - {131319, 0, 0}, - {196669, 0, 0}, - {196735, 0, 0}, - {262209, 0, 0}, - {262224, 0, 0}, - {262225, 0, 0}, - {262231, 0, 0}, - {262272, 0, 0}, - {262273, 0, 0}, - {262275, 0, 0}, - {262277, 0, 0}, - {262280, 0, 0}, - {262285, 0, 0}, - {262286, 0, 0}, - {262292, 0, 0}, - {327692, 0, 0}, - {327745, 0, 0}, - {327760, 0, 0}, - {327761, 0, 0}, - {327762, 0, 0}, - {393228, 0, 0}, - {393281, 0, 0}, - {393295, 0, 0}, - {393296, 0, 0}, - {393297, 0, 0}, - {393298, 0, 0}, - {393304, 0, 0}, - {458764, 0, 0}, - {458831, 0, 0}, - {524367, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 10}, - {0, 30, 35}, - {0, 1, 36}, - {0, 11, 37}, - {0, 38, 6}, - {0, 16, 39}, - {0, 15, 40}, - {0, 25, 2}, - {0, 41, 20}, - {0, 26, 19}, - {0, 42, 29}, - {0, 28, 22}, - {0, 23, 34}, - {0, 44, 43}, - {0, 17, 45}, - {0, 24, 27}, - {0, 18, 33}, - {0, 47, 46}, - {0, 8, 48}, - {0, 50, 49}, - {0, 32, 51}, - {0, 31, 52}, - {0, 53, 21}, - {0, 54, 13}, - {0, 3, 55}, - {0, 7, 14}, - {0, 57, 56}, - {0, 58, 5}, - {0, 59, 9}, - {0, 61, 60}, - {0, 63, 62}, - {0, 64, 12}, - {0, 66, 65}, - })); - - codecs.emplace(SpvOpFMul, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(79, { - {0, 0, 0}, - {65785, 0, 0}, - {65790, 0, 0}, - {131134, 0, 0}, - {196669, 0, 0}, - {196735, 0, 0}, - {262201, 0, 0}, - {262209, 0, 0}, - {262224, 0, 0}, - {262225, 0, 0}, - {262230, 0, 0}, - {262231, 0, 0}, - {262272, 0, 0}, - {262273, 0, 0}, - {262275, 0, 0}, - {262277, 0, 0}, - {262280, 0, 0}, - {262286, 0, 0}, - {262288, 0, 0}, - {262292, 0, 0}, - {262328, 0, 0}, - {262334, 0, 0}, - {327692, 0, 0}, - {327737, 0, 0}, - {327745, 0, 0}, - {327760, 0, 0}, - {327761, 0, 0}, - {327762, 0, 0}, - {393228, 0, 0}, - {393281, 0, 0}, - {393295, 0, 0}, - {393296, 0, 0}, - {393297, 0, 0}, - {393303, 0, 0}, - {393304, 0, 0}, - {458764, 0, 0}, - {458831, 0, 0}, - {458840, 0, 0}, - {524345, 0, 0}, - {524367, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 38, 33}, - {0, 18, 41}, - {0, 42, 23}, - {0, 43, 6}, - {0, 34, 44}, - {0, 1, 45}, - {0, 31, 14}, - {0, 47, 46}, - {0, 48, 2}, - {0, 12, 21}, - {0, 49, 30}, - {0, 37, 50}, - {0, 51, 20}, - {0, 5, 24}, - {0, 40, 16}, - {0, 29, 13}, - {0, 26, 52}, - {0, 53, 17}, - {0, 36, 54}, - {0, 55, 28}, - {0, 57, 56}, - {0, 19, 25}, - {0, 39, 8}, - {0, 32, 58}, - {0, 59, 27}, - {0, 22, 10}, - {0, 35, 60}, - {0, 62, 61}, - {0, 63, 7}, - {0, 65, 64}, - {0, 4, 66}, - {0, 68, 67}, - {0, 11, 3}, - {0, 15, 69}, - {0, 9, 70}, - {0, 72, 71}, - {0, 74, 73}, - {0, 76, 75}, - {0, 78, 77}, - })); - - codecs.emplace(SpvOpFAdd, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(55, { - {0, 0, 0}, - {65556, 0, 0}, - {65562, 0, 0}, - {131073, 0, 0}, - {131094, 0, 0}, - {131105, 0, 0}, - {196629, 0, 0}, - {196631, 0, 0}, - {196632, 0, 0}, - {196636, 0, 0}, - {196640, 0, 0}, - {196641, 0, 0}, - {196651, 0, 0}, - {196667, 0, 0}, - {262177, 0, 0}, - {262188, 0, 0}, - {262198, 0, 0}, - {327713, 0, 0}, - {327724, 0, 0}, - {393249, 0, 0}, - {393260, 0, 0}, - {458785, 0, 0}, - {524313, 0, 0}, - {524321, 0, 0}, - {589857, 0, 0}, - {655393, 0, 0}, - {720929, 0, 0}, - {852001, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 26, 24}, - {0, 29, 27}, - {0, 4, 30}, - {0, 21, 9}, - {0, 31, 20}, - {0, 33, 32}, - {0, 34, 3}, - {0, 8, 35}, - {0, 36, 5}, - {0, 23, 16}, - {0, 38, 37}, - {0, 25, 2}, - {0, 39, 1}, - {0, 17, 40}, - {0, 41, 15}, - {0, 18, 42}, - {0, 43, 6}, - {0, 44, 14}, - {0, 28, 19}, - {0, 7, 45}, - {0, 46, 22}, - {0, 48, 47}, - {0, 49, 11}, - {0, 51, 50}, - {0, 12, 10}, - {0, 53, 52}, - {0, 13, 54}, - })); - - codecs.emplace(SpvOpTypePointer, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(57, { - {0, 0, 0}, - {65785, 0, 0}, - {65790, 0, 0}, - {131134, 0, 0}, - {196669, 0, 0}, - {196735, 0, 0}, - {262209, 0, 0}, - {262224, 0, 0}, - {262225, 0, 0}, - {262272, 0, 0}, - {262273, 0, 0}, - {262275, 0, 0}, - {262277, 0, 0}, - {262280, 0, 0}, - {262286, 0, 0}, - {262292, 0, 0}, - {262328, 0, 0}, - {327692, 0, 0}, - {327745, 0, 0}, - {327760, 0, 0}, - {327761, 0, 0}, - {327762, 0, 0}, - {393228, 0, 0}, - {393273, 0, 0}, - {393295, 0, 0}, - {393296, 0, 0}, - {458764, 0, 0}, - {458831, 0, 0}, - {524367, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 9, 23}, - {0, 1, 30}, - {0, 5, 31}, - {0, 32, 28}, - {0, 33, 25}, - {0, 34, 29}, - {0, 18, 24}, - {0, 27, 16}, - {0, 7, 13}, - {0, 14, 35}, - {0, 20, 10}, - {0, 36, 21}, - {0, 2, 37}, - {0, 38, 3}, - {0, 39, 22}, - {0, 40, 19}, - {0, 41, 11}, - {0, 6, 4}, - {0, 12, 42}, - {0, 43, 8}, - {0, 15, 26}, - {0, 45, 44}, - {0, 47, 46}, - {0, 48, 17}, - {0, 50, 49}, - {0, 52, 51}, - {0, 54, 53}, - {0, 56, 55}, - })); - - codecs.emplace(SpvOpFSub, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(13, { - {0, 0, 0}, - {65785, 0, 0}, - {131134, 0, 0}, - {196719, 0, 0}, - {262209, 0, 0}, - {262276, 0, 0}, - {327745, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 7, 4}, - {0, 2, 8}, - {0, 1, 9}, - {0, 5, 10}, - {0, 3, 6}, - {0, 12, 11}, - })); - - codecs.emplace(SpvOpIAdd, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(83, { - {0, 0, 0}, - {65785, 0, 0}, - {65790, 0, 0}, - {131134, 0, 0}, - {131319, 0, 0}, - {196669, 0, 0}, - {196732, 0, 0}, - {196735, 0, 0}, - {262209, 0, 0}, - {262221, 0, 0}, - {262224, 0, 0}, - {262225, 0, 0}, - {262230, 0, 0}, - {262231, 0, 0}, - {262273, 0, 0}, - {262275, 0, 0}, - {262277, 0, 0}, - {262280, 0, 0}, - {262286, 0, 0}, - {262288, 0, 0}, - {262292, 0, 0}, - {262328, 0, 0}, - {262334, 0, 0}, - {262340, 0, 0}, - {327692, 0, 0}, - {327737, 0, 0}, - {327745, 0, 0}, - {327760, 0, 0}, - {327761, 0, 0}, - {327762, 0, 0}, - {393228, 0, 0}, - {393273, 0, 0}, - {393295, 0, 0}, - {393296, 0, 0}, - {393297, 0, 0}, - {393298, 0, 0}, - {393304, 0, 0}, - {458764, 0, 0}, - {458831, 0, 0}, - {458840, 0, 0}, - {458842, 0, 0}, - {524367, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 25, 2}, - {0, 31, 43}, - {0, 4, 44}, - {0, 26, 45}, - {0, 39, 46}, - {0, 34, 36}, - {0, 19, 47}, - {0, 6, 48}, - {0, 35, 9}, - {0, 12, 29}, - {0, 21, 49}, - {0, 22, 13}, - {0, 17, 50}, - {0, 23, 51}, - {0, 52, 7}, - {0, 37, 1}, - {0, 53, 3}, - {0, 54, 24}, - {0, 56, 55}, - {0, 32, 57}, - {0, 59, 58}, - {0, 42, 10}, - {0, 60, 8}, - {0, 5, 41}, - {0, 61, 20}, - {0, 62, 38}, - {0, 64, 63}, - {0, 40, 65}, - {0, 66, 18}, - {0, 15, 28}, - {0, 14, 67}, - {0, 68, 30}, - {0, 70, 69}, - {0, 72, 71}, - {0, 73, 27}, - {0, 16, 74}, - {0, 75, 33}, - {0, 77, 76}, - {0, 79, 78}, - {0, 81, 80}, - {0, 82, 11}, - })); - - codecs.emplace(SpvOpCompositeExtract, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(29, { - {0, 0, 0}, - {65790, 0, 0}, - {131134, 0, 0}, - {196669, 0, 0}, - {262209, 0, 0}, - {262225, 0, 0}, - {262273, 0, 0}, - {262288, 0, 0}, - {262292, 0, 0}, - {327692, 0, 0}, - {327761, 0, 0}, - {327762, 0, 0}, - {393295, 0, 0}, - {458831, 0, 0}, - {524367, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 10, 6}, - {0, 16, 13}, - {0, 7, 17}, - {0, 15, 18}, - {0, 19, 12}, - {0, 20, 14}, - {0, 1, 4}, - {0, 22, 21}, - {0, 11, 8}, - {0, 2, 5}, - {0, 9, 23}, - {0, 3, 24}, - {0, 26, 25}, - {0, 28, 27}, - })); - - codecs.emplace(SpvOpVectorTimesMatrix, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {65784, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(SpvOpBranch, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {262198, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(SpvOpFunctionEnd, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {65784, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(SpvOpBranchConditional, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(53, { - {0, 0, 0}, - {65785, 0, 0}, - {65790, 0, 0}, - {131134, 0, 0}, - {131319, 0, 0}, - {196665, 0, 0}, - {196669, 0, 0}, - {196735, 0, 0}, - {262201, 0, 0}, - {262209, 0, 0}, - {262224, 0, 0}, - {262225, 0, 0}, - {262231, 0, 0}, - {262273, 0, 0}, - {262275, 0, 0}, - {262277, 0, 0}, - {262280, 0, 0}, - {262286, 0, 0}, - {262288, 0, 0}, - {262292, 0, 0}, - {327692, 0, 0}, - {327745, 0, 0}, - {327760, 0, 0}, - {393228, 0, 0}, - {393295, 0, 0}, - {458764, 0, 0}, - {458831, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 25, 16}, - {0, 21, 28}, - {0, 18, 23}, - {0, 4, 29}, - {0, 10, 5}, - {0, 1, 30}, - {0, 32, 31}, - {0, 22, 33}, - {0, 34, 8}, - {0, 35, 15}, - {0, 13, 36}, - {0, 26, 17}, - {0, 38, 37}, - {0, 39, 11}, - {0, 40, 14}, - {0, 12, 27}, - {0, 19, 41}, - {0, 24, 42}, - {0, 44, 43}, - {0, 45, 7}, - {0, 20, 46}, - {0, 9, 47}, - {0, 48, 2}, - {0, 50, 49}, - {0, 6, 3}, - {0, 52, 51}, - })); - - codecs.emplace(SpvOpFunctionCall, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(71, { - {0, 0, 0}, - {65556, 0, 0}, - {65562, 0, 0}, - {131073, 0, 0}, - {131094, 0, 0}, - {131099, 0, 0}, - {131134, 0, 0}, - {196629, 0, 0}, - {196631, 0, 0}, - {196632, 0, 0}, - {196636, 0, 0}, - {196640, 0, 0}, - {196651, 0, 0}, - {196665, 0, 0}, - {196667, 0, 0}, - {196669, 0, 0}, - {262188, 0, 0}, - {262198, 0, 0}, - {262201, 0, 0}, - {262209, 0, 0}, - {262225, 0, 0}, - {262275, 0, 0}, - {262280, 0, 0}, - {262292, 0, 0}, - {327692, 0, 0}, - {327724, 0, 0}, - {327737, 0, 0}, - {327745, 0, 0}, - {393228, 0, 0}, - {393260, 0, 0}, - {393273, 0, 0}, - {393295, 0, 0}, - {393296, 0, 0}, - {458831, 0, 0}, - {524313, 0, 0}, - {524367, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 22, 4}, - {0, 32, 23}, - {0, 37, 30}, - {0, 21, 38}, - {0, 39, 31}, - {0, 41, 40}, - {0, 13, 42}, - {0, 43, 26}, - {0, 10, 44}, - {0, 28, 45}, - {0, 35, 18}, - {0, 20, 46}, - {0, 33, 47}, - {0, 24, 48}, - {0, 6, 49}, - {0, 3, 50}, - {0, 16, 51}, - {0, 27, 52}, - {0, 53, 1}, - {0, 9, 17}, - {0, 29, 54}, - {0, 19, 2}, - {0, 8, 36}, - {0, 55, 34}, - {0, 25, 56}, - {0, 7, 57}, - {0, 5, 58}, - {0, 60, 59}, - {0, 61, 15}, - {0, 63, 62}, - {0, 65, 64}, - {0, 66, 11}, - {0, 12, 67}, - {0, 69, 68}, - {0, 14, 70}, - })); - - codecs.emplace(SpvOpVariable, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {131134, 0, 0}, - {196669, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 3}, - {0, 2, 4}, - })); - - codecs.emplace(SpvOpAccessChain, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(73, { - {0, 0, 0}, - {252, 0, 0}, - {253, 0, 0}, - {65785, 0, 0}, - {65790, 0, 0}, - {131073, 0, 0}, - {131134, 0, 0}, - {131319, 0, 0}, - {196665, 0, 0}, - {196667, 0, 0}, - {196669, 0, 0}, - {196735, 0, 0}, - {196854, 0, 0}, - {262201, 0, 0}, - {262209, 0, 0}, - {262221, 0, 0}, - {262225, 0, 0}, - {262272, 0, 0}, - {262273, 0, 0}, - {262275, 0, 0}, - {262276, 0, 0}, - {262277, 0, 0}, - {262280, 0, 0}, - {262286, 0, 0}, - {262292, 0, 0}, - {262321, 0, 0}, - {327692, 0, 0}, - {327745, 0, 0}, - {327761, 0, 0}, - {327762, 0, 0}, - {393228, 0, 0}, - {393295, 0, 0}, - {393296, 0, 0}, - {393298, 0, 0}, - {393461, 0, 0}, - {458831, 0, 0}, - {524367, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 28, 5}, - {0, 30, 8}, - {0, 13, 38}, - {0, 40, 39}, - {0, 41, 26}, - {0, 42, 19}, - {0, 43, 29}, - {0, 23, 44}, - {0, 36, 32}, - {0, 45, 22}, - {0, 2, 46}, - {0, 21, 20}, - {0, 48, 47}, - {0, 33, 49}, - {0, 4, 50}, - {0, 51, 24}, - {0, 18, 11}, - {0, 52, 12}, - {0, 25, 15}, - {0, 53, 17}, - {0, 37, 54}, - {0, 55, 35}, - {0, 7, 27}, - {0, 57, 56}, - {0, 58, 31}, - {0, 6, 59}, - {0, 1, 60}, - {0, 62, 61}, - {0, 63, 14}, - {0, 3, 16}, - {0, 34, 64}, - {0, 66, 65}, - {0, 68, 67}, - {0, 70, 69}, - {0, 10, 9}, - {0, 72, 71}, - })); - - codecs.emplace(SpvOpLabel, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {56, 0, 0}, - {65784, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 2}, - {0, 1, 4}, - })); - - codecs.emplace(SpvOpReturn, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {65784, 0, 0}, - {131127, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 3}, - {0, 2, 4}, - })); - - codecs.emplace(SpvOpFunction, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(31, { - {0, 0, 0}, - {65556, 0, 0}, - {196629, 0, 0}, - {196631, 0, 0}, - {196632, 0, 0}, - {196636, 0, 0}, - {196640, 0, 0}, - {196641, 0, 0}, - {196651, 0, 0}, - {196667, 0, 0}, - {262177, 0, 0}, - {262188, 0, 0}, - {262198, 0, 0}, - {327713, 0, 0}, - {393260, 0, 0}, - {524313, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 12, 1}, - {0, 13, 5}, - {0, 18, 17}, - {0, 7, 19}, - {0, 9, 20}, - {0, 16, 21}, - {0, 15, 10}, - {0, 22, 4}, - {0, 24, 23}, - {0, 25, 14}, - {0, 8, 11}, - {0, 2, 26}, - {0, 28, 27}, - {0, 3, 6}, - {0, 30, 29}, - })); - - codecs.emplace(SpvOpTypeVector, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {65784, 0, 0}, - {131127, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 3}, - {0, 4, 1}, - })); - - codecs.emplace(SpvOpFunctionParameter, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {56, 0, 0}, - {65784, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 2}, - {0, 1, 4}, - })); - - codecs.emplace(SpvOpReturnValue, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {131105, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(SpvOpTypeVoid, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(89, { - {0, 0, 0}, - {253, 0, 0}, - {65785, 0, 0}, - {65790, 0, 0}, - {131134, 0, 0}, - {131319, 0, 0}, - {196665, 0, 0}, - {196669, 0, 0}, - {196735, 0, 0}, - {262201, 0, 0}, - {262209, 0, 0}, - {262224, 0, 0}, - {262225, 0, 0}, - {262272, 0, 0}, - {262273, 0, 0}, - {262275, 0, 0}, - {262277, 0, 0}, - {262280, 0, 0}, - {262286, 0, 0}, - {262288, 0, 0}, - {262292, 0, 0}, - {327692, 0, 0}, - {327737, 0, 0}, - {327745, 0, 0}, - {327760, 0, 0}, - {327761, 0, 0}, - {327762, 0, 0}, - {393228, 0, 0}, - {393273, 0, 0}, - {393281, 0, 0}, - {393295, 0, 0}, - {393296, 0, 0}, - {458764, 0, 0}, - {458809, 0, 0}, - {458831, 0, 0}, - {524345, 0, 0}, - {524367, 0, 0}, - {589881, 0, 0}, - {655417, 0, 0}, - {720953, 0, 0}, - {786489, 0, 0}, - {852025, 0, 0}, - {917561, 0, 0}, - {983097, 0, 0}, - {1114169, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 40, 32}, - {0, 46, 29}, - {0, 38, 27}, - {0, 20, 47}, - {0, 49, 48}, - {0, 50, 44}, - {0, 51, 43}, - {0, 14, 5}, - {0, 42, 52}, - {0, 13, 19}, - {0, 3, 26}, - {0, 54, 53}, - {0, 56, 55}, - {0, 57, 6}, - {0, 39, 37}, - {0, 15, 58}, - {0, 18, 31}, - {0, 59, 21}, - {0, 60, 17}, - {0, 61, 41}, - {0, 62, 24}, - {0, 34, 63}, - {0, 35, 64}, - {0, 65, 8}, - {0, 66, 36}, - {0, 67, 30}, - {0, 16, 11}, - {0, 69, 68}, - {0, 70, 28}, - {0, 22, 71}, - {0, 33, 72}, - {0, 45, 73}, - {0, 75, 74}, - {0, 77, 76}, - {0, 78, 12}, - {0, 1, 2}, - {0, 9, 79}, - {0, 25, 80}, - {0, 23, 81}, - {0, 4, 82}, - {0, 84, 83}, - {0, 86, 85}, - {0, 7, 10}, - {0, 88, 87}, - })); - - codecs.emplace(SpvOpStore, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(13, { - {0, 0, 0}, - {131075, 0, 0}, - {131088, 0, 0}, - {131143, 0, 0}, - {196624, 0, 0}, - {196679, 0, 0}, - {262216, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 4}, - {0, 1, 8}, - {0, 7, 9}, - {0, 6, 10}, - {0, 5, 11}, - {0, 2, 12}, - })); - - codecs.emplace(SpvOpEntryPoint, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(97, { - {0, 0, 0}, - {65785, 0, 0}, - {65790, 0, 0}, - {131134, 0, 0}, - {131319, 0, 0}, - {196665, 0, 0}, - {196669, 0, 0}, - {196732, 0, 0}, - {196735, 0, 0}, - {262201, 0, 0}, - {262209, 0, 0}, - {262224, 0, 0}, - {262225, 0, 0}, - {262230, 0, 0}, - {262231, 0, 0}, - {262272, 0, 0}, - {262273, 0, 0}, - {262275, 0, 0}, - {262276, 0, 0}, - {262277, 0, 0}, - {262280, 0, 0}, - {262286, 0, 0}, - {262288, 0, 0}, - {262292, 0, 0}, - {262326, 0, 0}, - {262328, 0, 0}, - {262330, 0, 0}, - {327692, 0, 0}, - {327737, 0, 0}, - {327745, 0, 0}, - {327760, 0, 0}, - {327761, 0, 0}, - {327762, 0, 0}, - {393228, 0, 0}, - {393273, 0, 0}, - {393281, 0, 0}, - {393295, 0, 0}, - {393296, 0, 0}, - {393297, 0, 0}, - {393304, 0, 0}, - {458764, 0, 0}, - {458809, 0, 0}, - {458817, 0, 0}, - {458831, 0, 0}, - {458840, 0, 0}, - {524345, 0, 0}, - {524367, 0, 0}, - {589881, 0, 0}, - {720953, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 42, 47}, - {0, 48, 50}, - {0, 45, 51}, - {0, 34, 52}, - {0, 53, 41}, - {0, 1, 54}, - {0, 55, 5}, - {0, 15, 4}, - {0, 56, 35}, - {0, 26, 24}, - {0, 18, 28}, - {0, 57, 38}, - {0, 59, 58}, - {0, 60, 25}, - {0, 20, 9}, - {0, 7, 61}, - {0, 62, 22}, - {0, 11, 31}, - {0, 63, 8}, - {0, 64, 40}, - {0, 66, 65}, - {0, 27, 44}, - {0, 29, 67}, - {0, 68, 39}, - {0, 69, 2}, - {0, 37, 49}, - {0, 71, 70}, - {0, 30, 72}, - {0, 73, 17}, - {0, 33, 74}, - {0, 23, 14}, - {0, 32, 75}, - {0, 21, 76}, - {0, 77, 16}, - {0, 46, 78}, - {0, 13, 79}, - {0, 80, 12}, - {0, 19, 81}, - {0, 43, 36}, - {0, 83, 82}, - {0, 10, 84}, - {0, 85, 3}, - {0, 6, 86}, - {0, 88, 87}, - {0, 90, 89}, - {0, 92, 91}, - {0, 94, 93}, - {0, 96, 95}, - })); - - codecs.emplace(SpvOpLoad, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(47, { - {0, 0, 0}, - {262159, 0, 0}, - {327695, 0, 0}, - {393231, 0, 0}, - {458767, 0, 0}, - {524303, 0, 0}, - {589839, 0, 0}, - {655375, 0, 0}, - {720911, 0, 0}, - {786447, 0, 0}, - {851983, 0, 0}, - {917519, 0, 0}, - {983055, 0, 0}, - {1048591, 0, 0}, - {1114127, 0, 0}, - {1179663, 0, 0}, - {1245199, 0, 0}, - {1310735, 0, 0}, - {1376271, 0, 0}, - {1441807, 0, 0}, - {1507343, 0, 0}, - {1572879, 0, 0}, - {1638415, 0, 0}, - {1703951, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 23}, - {0, 22, 25}, - {0, 21, 26}, - {0, 6, 20}, - {0, 19, 27}, - {0, 29, 28}, - {0, 24, 18}, - {0, 30, 13}, - {0, 31, 14}, - {0, 32, 7}, - {0, 17, 15}, - {0, 33, 2}, - {0, 34, 8}, - {0, 16, 12}, - {0, 35, 3}, - {0, 36, 5}, - {0, 9, 37}, - {0, 39, 38}, - {0, 11, 40}, - {0, 4, 10}, - {0, 42, 41}, - {0, 44, 43}, - {0, 46, 45}, - })); - - codecs.emplace(SpvOpMemoryModel, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {196631, 0, 0}, - {196640, 0, 0}, - {196641, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 3}, - {0, 4, 5}, - {0, 1, 6}, - })); - - codecs.emplace(SpvOpTypeFloat, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(69, { - {0, 0, 0}, - {65790, 0, 0}, - {131134, 0, 0}, - {196669, 0, 0}, - {196735, 0, 0}, - {262201, 0, 0}, - {262209, 0, 0}, - {262224, 0, 0}, - {262225, 0, 0}, - {262231, 0, 0}, - {262272, 0, 0}, - {262273, 0, 0}, - {262275, 0, 0}, - {262277, 0, 0}, - {262280, 0, 0}, - {262286, 0, 0}, - {262288, 0, 0}, - {262289, 0, 0}, - {262292, 0, 0}, - {327692, 0, 0}, - {327745, 0, 0}, - {327760, 0, 0}, - {327761, 0, 0}, - {327762, 0, 0}, - {327849, 0, 0}, - {393228, 0, 0}, - {393281, 0, 0}, - {393295, 0, 0}, - {393296, 0, 0}, - {393304, 0, 0}, - {458764, 0, 0}, - {458809, 0, 0}, - {458831, 0, 0}, - {524345, 0, 0}, - {524367, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 33, 10}, - {0, 31, 36}, - {0, 26, 37}, - {0, 5, 38}, - {0, 20, 39}, - {0, 22, 40}, - {0, 24, 25}, - {0, 15, 41}, - {0, 9, 17}, - {0, 1, 42}, - {0, 4, 43}, - {0, 35, 44}, - {0, 34, 45}, - {0, 19, 46}, - {0, 7, 29}, - {0, 16, 47}, - {0, 48, 32}, - {0, 49, 27}, - {0, 11, 14}, - {0, 18, 28}, - {0, 23, 50}, - {0, 51, 12}, - {0, 52, 21}, - {0, 6, 53}, - {0, 55, 54}, - {0, 57, 56}, - {0, 3, 58}, - {0, 13, 59}, - {0, 60, 8}, - {0, 30, 61}, - {0, 62, 2}, - {0, 64, 63}, - {0, 66, 65}, - {0, 68, 67}, - })); - - codecs.emplace(SpvOpCompositeConstruct, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(39, { - {0, 0, 0}, - {65556, 0, 0}, - {131094, 0, 0}, - {131105, 0, 0}, - {196629, 0, 0}, - {196631, 0, 0}, - {196632, 0, 0}, - {196640, 0, 0}, - {196641, 0, 0}, - {262177, 0, 0}, - {327713, 0, 0}, - {393249, 0, 0}, - {458785, 0, 0}, - {524313, 0, 0}, - {524321, 0, 0}, - {589857, 0, 0}, - {655393, 0, 0}, - {786465, 0, 0}, - {917537, 0, 0}, - {1048609, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 19, 18}, - {0, 21, 15}, - {0, 1, 22}, - {0, 16, 23}, - {0, 14, 24}, - {0, 20, 25}, - {0, 13, 17}, - {0, 3, 26}, - {0, 6, 11}, - {0, 27, 12}, - {0, 4, 28}, - {0, 29, 10}, - {0, 9, 30}, - {0, 7, 31}, - {0, 33, 32}, - {0, 34, 5}, - {0, 8, 35}, - {0, 2, 36}, - {0, 38, 37}, - })); - - codecs.emplace(SpvOpTypeFunction, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {131086, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(SpvOpExtInstImport, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {131099, 0, 0}, - {196640, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 3}, - {0, 1, 4}, - })); - - codecs.emplace(SpvOpTypeImage, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {131143, 0, 0}, - {196679, 0, 0}, - {196680, 0, 0}, - {262216, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 5, 2}, - {0, 3, 6}, - {0, 7, 1}, - {0, 4, 8}, - })); - - codecs.emplace(SpvOpMemberDecorate, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {65553, 0, 0}, - {131083, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 3}, - {0, 2, 4}, - })); - - codecs.emplace(SpvOpCapability, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(17, { - {0, 0, 0}, - {196629, 0, 0}, - {196631, 0, 0}, - {196632, 0, 0}, - {196640, 0, 0}, - {196651, 0, 0}, - {196667, 0, 0}, - {327713, 0, 0}, - {458785, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 7, 8}, - {0, 1, 10}, - {0, 6, 11}, - {0, 9, 12}, - {0, 4, 13}, - {0, 3, 14}, - {0, 15, 2}, - {0, 5, 16}, - })); - - codecs.emplace(SpvOpTypeInt, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(29, { - {0, 0, 0}, - {65556, 0, 0}, - {131073, 0, 0}, - {196629, 0, 0}, - {196631, 0, 0}, - {196632, 0, 0}, - {196636, 0, 0}, - {196640, 0, 0}, - {196651, 0, 0}, - {196667, 0, 0}, - {262188, 0, 0}, - {262198, 0, 0}, - {327724, 0, 0}, - {393260, 0, 0}, - {524313, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 6}, - {0, 16, 3}, - {0, 11, 17}, - {0, 5, 18}, - {0, 15, 19}, - {0, 13, 20}, - {0, 1, 4}, - {0, 12, 21}, - {0, 7, 22}, - {0, 14, 23}, - {0, 24, 10}, - {0, 25, 9}, - {0, 27, 26}, - {0, 8, 28}, - })); - - codecs.emplace(SpvOpConstantComposite, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(15, { - {0, 0, 0}, - {65556, 0, 0}, - {196631, 0, 0}, - {196640, 0, 0}, - {196651, 0, 0}, - {196667, 0, 0}, - {327724, 0, 0}, - {393260, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 6, 7}, - {0, 1, 9}, - {0, 10, 8}, - {0, 2, 11}, - {0, 5, 12}, - {0, 13, 4}, - {0, 3, 14}, - })); - - codecs.emplace(SpvOpTypeSampledImage, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(21, { - {0, 0, 0}, - {131073, 0, 0}, - {196629, 0, 0}, - {196631, 0, 0}, - {196632, 0, 0}, - {196636, 0, 0}, - {196640, 0, 0}, - {196641, 0, 0}, - {196651, 0, 0}, - {196667, 0, 0}, - {262198, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 5}, - {0, 11, 12}, - {0, 8, 13}, - {0, 7, 14}, - {0, 4, 10}, - {0, 9, 2}, - {0, 16, 15}, - {0, 1, 17}, - {0, 19, 18}, - {0, 6, 20}, - })); - - codecs.emplace(SpvOpTypeStruct, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(49, { - {0, 0, 0}, - {65785, 0, 0}, - {65790, 0, 0}, - {131134, 0, 0}, - {196669, 0, 0}, - {196735, 0, 0}, - {262201, 0, 0}, - {262209, 0, 0}, - {262224, 0, 0}, - {262225, 0, 0}, - {262272, 0, 0}, - {262273, 0, 0}, - {262275, 0, 0}, - {262277, 0, 0}, - {262286, 0, 0}, - {262292, 0, 0}, - {327692, 0, 0}, - {327745, 0, 0}, - {327760, 0, 0}, - {327762, 0, 0}, - {393228, 0, 0}, - {393295, 0, 0}, - {393296, 0, 0}, - {458764, 0, 0}, - {458831, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 20, 12}, - {0, 26, 24}, - {0, 21, 27}, - {0, 28, 16}, - {0, 10, 8}, - {0, 30, 29}, - {0, 31, 17}, - {0, 32, 13}, - {0, 25, 6}, - {0, 1, 33}, - {0, 14, 11}, - {0, 3, 34}, - {0, 18, 35}, - {0, 37, 36}, - {0, 23, 5}, - {0, 38, 2}, - {0, 39, 7}, - {0, 4, 9}, - {0, 40, 19}, - {0, 42, 41}, - {0, 43, 22}, - {0, 45, 44}, - {0, 46, 15}, - {0, 48, 47}, - })); - - codecs.emplace(SpvOpFNegate, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(11, { - {0, 0, 0}, - {65555, 0, 0}, - {131143, 0, 0}, - {196679, 0, 0}, - {196680, 0, 0}, - {262216, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 6}, - {0, 1, 2}, - {0, 8, 7}, - {0, 5, 9}, - {0, 3, 10}, - })); - - codecs.emplace(SpvOpDecorate, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(25, { - {0, 0, 0}, - {65562, 0, 0}, - {196629, 0, 0}, - {196631, 0, 0}, - {196632, 0, 0}, - {196636, 0, 0}, - {196640, 0, 0}, - {196641, 0, 0}, - {196651, 0, 0}, - {196667, 0, 0}, - {262177, 0, 0}, - {262198, 0, 0}, - {327713, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 12, 11}, - {0, 9, 14}, - {0, 10, 15}, - {0, 13, 16}, - {0, 4, 17}, - {0, 2, 1}, - {0, 18, 7}, - {0, 20, 19}, - {0, 21, 3}, - {0, 22, 6}, - {0, 5, 8}, - {0, 24, 23}, - })); - - codecs.emplace(SpvOpTypeMatrix, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(31, { - {0, 0, 0}, - {65556, 0, 0}, - {131073, 0, 0}, - {131094, 0, 0}, - {196629, 0, 0}, - {196631, 0, 0}, - {196632, 0, 0}, - {196636, 0, 0}, - {196640, 0, 0}, - {196651, 0, 0}, - {196667, 0, 0}, - {262188, 0, 0}, - {262198, 0, 0}, - {327724, 0, 0}, - {393260, 0, 0}, - {524313, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 12, 2}, - {0, 17, 3}, - {0, 5, 18}, - {0, 1, 19}, - {0, 16, 4}, - {0, 21, 20}, - {0, 6, 15}, - {0, 7, 22}, - {0, 24, 23}, - {0, 13, 14}, - {0, 25, 8}, - {0, 26, 11}, - {0, 27, 10}, - {0, 29, 28}, - {0, 30, 9}, - })); - - codecs.emplace(SpvOpConstant, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(33, { - {0, 0, 0}, - {131113, 0, 0}, - {196629, 0, 0}, - {196631, 0, 0}, - {196632, 0, 0}, - {196640, 0, 0}, - {196641, 0, 0}, - {196651, 0, 0}, - {196667, 0, 0}, - {262188, 0, 0}, - {262198, 0, 0}, - {327713, 0, 0}, - {327724, 0, 0}, - {393249, 0, 0}, - {393260, 0, 0}, - {524313, 0, 0}, - {524321, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 6, 4}, - {0, 13, 11}, - {0, 16, 15}, - {0, 18, 10}, - {0, 20, 19}, - {0, 21, 2}, - {0, 23, 22}, - {0, 8, 24}, - {0, 9, 25}, - {0, 17, 26}, - {0, 14, 27}, - {0, 12, 28}, - {0, 1, 3}, - {0, 5, 29}, - {0, 30, 7}, - {0, 32, 31}, - })); - - codecs.emplace(SpvOpTypeBool, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(11, { - {0, 0, 0}, - {196636, 0, 0}, - {196640, 0, 0}, - {196651, 0, 0}, - {196667, 0, 0}, - {524313, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 5}, - {0, 3, 7}, - {0, 2, 8}, - {0, 6, 9}, - {0, 1, 10}, - })); - - codecs.emplace(SpvOpTypeArray, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(67, { - {0, 0, 0}, - {65785, 0, 0}, - {65790, 0, 0}, - {131134, 0, 0}, - {131319, 0, 0}, - {196669, 0, 0}, - {196735, 0, 0}, - {262201, 0, 0}, - {262209, 0, 0}, - {262224, 0, 0}, - {262225, 0, 0}, - {262231, 0, 0}, - {262272, 0, 0}, - {262273, 0, 0}, - {262275, 0, 0}, - {262277, 0, 0}, - {262280, 0, 0}, - {262286, 0, 0}, - {262292, 0, 0}, - {262334, 0, 0}, - {327692, 0, 0}, - {327737, 0, 0}, - {327745, 0, 0}, - {327760, 0, 0}, - {327761, 0, 0}, - {327762, 0, 0}, - {393228, 0, 0}, - {393273, 0, 0}, - {393281, 0, 0}, - {393295, 0, 0}, - {393296, 0, 0}, - {458764, 0, 0}, - {458831, 0, 0}, - {524367, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 7, 27}, - {0, 11, 28}, - {0, 35, 21}, - {0, 36, 1}, - {0, 4, 37}, - {0, 39, 38}, - {0, 40, 30}, - {0, 41, 12}, - {0, 19, 42}, - {0, 13, 43}, - {0, 16, 44}, - {0, 45, 22}, - {0, 34, 18}, - {0, 29, 24}, - {0, 46, 25}, - {0, 6, 2}, - {0, 9, 31}, - {0, 17, 47}, - {0, 49, 48}, - {0, 50, 33}, - {0, 51, 26}, - {0, 20, 52}, - {0, 32, 53}, - {0, 3, 54}, - {0, 15, 14}, - {0, 23, 55}, - {0, 8, 56}, - {0, 58, 57}, - {0, 10, 59}, - {0, 5, 60}, - {0, 62, 61}, - {0, 64, 63}, - {0, 66, 65}, - })); - - codecs.emplace(SpvOpExtInst, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(57, { - {0, 0, 0}, - {65790, 0, 0}, - {131134, 0, 0}, - {196665, 0, 0}, - {196669, 0, 0}, - {196718, 0, 0}, - {262201, 0, 0}, - {262209, 0, 0}, - {262224, 0, 0}, - {262225, 0, 0}, - {262231, 0, 0}, - {262273, 0, 0}, - {262275, 0, 0}, - {262277, 0, 0}, - {262280, 0, 0}, - {262286, 0, 0}, - {262292, 0, 0}, - {327692, 0, 0}, - {327745, 0, 0}, - {327760, 0, 0}, - {327762, 0, 0}, - {393228, 0, 0}, - {393273, 0, 0}, - {393295, 0, 0}, - {393296, 0, 0}, - {393303, 0, 0}, - {458764, 0, 0}, - {458831, 0, 0}, - {524367, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 18, 6}, - {0, 30, 22}, - {0, 31, 25}, - {0, 10, 32}, - {0, 21, 33}, - {0, 3, 34}, - {0, 35, 5}, - {0, 23, 36}, - {0, 14, 17}, - {0, 37, 26}, - {0, 1, 38}, - {0, 29, 39}, - {0, 13, 40}, - {0, 41, 19}, - {0, 28, 20}, - {0, 16, 42}, - {0, 27, 43}, - {0, 8, 24}, - {0, 7, 44}, - {0, 9, 45}, - {0, 15, 46}, - {0, 12, 47}, - {0, 48, 2}, - {0, 4, 49}, - {0, 51, 50}, - {0, 11, 52}, - {0, 54, 53}, - {0, 56, 55}, - })); - - codecs.emplace(SpvOpVectorTimesScalar, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(67, { - {0, 0, 0}, - {65785, 0, 0}, - {65790, 0, 0}, - {131134, 0, 0}, - {196669, 0, 0}, - {196735, 0, 0}, - {262201, 0, 0}, - {262209, 0, 0}, - {262224, 0, 0}, - {262225, 0, 0}, - {262230, 0, 0}, - {262231, 0, 0}, - {262272, 0, 0}, - {262273, 0, 0}, - {262275, 0, 0}, - {262277, 0, 0}, - {262280, 0, 0}, - {262286, 0, 0}, - {262292, 0, 0}, - {327692, 0, 0}, - {327737, 0, 0}, - {327745, 0, 0}, - {327760, 0, 0}, - {327761, 0, 0}, - {327762, 0, 0}, - {393228, 0, 0}, - {393273, 0, 0}, - {393295, 0, 0}, - {393296, 0, 0}, - {393303, 0, 0}, - {393304, 0, 0}, - {458764, 0, 0}, - {458831, 0, 0}, - {524367, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 26, 29}, - {0, 20, 35}, - {0, 12, 36}, - {0, 6, 37}, - {0, 38, 28}, - {0, 30, 5}, - {0, 8, 39}, - {0, 2, 40}, - {0, 41, 21}, - {0, 1, 10}, - {0, 43, 42}, - {0, 23, 16}, - {0, 44, 33}, - {0, 34, 31}, - {0, 14, 45}, - {0, 19, 46}, - {0, 25, 47}, - {0, 49, 48}, - {0, 27, 22}, - {0, 7, 50}, - {0, 17, 32}, - {0, 18, 51}, - {0, 24, 52}, - {0, 54, 53}, - {0, 55, 9}, - {0, 56, 11}, - {0, 57, 4}, - {0, 15, 58}, - {0, 59, 13}, - {0, 60, 3}, - {0, 62, 61}, - {0, 64, 63}, - {0, 66, 65}, - })); - - codecs.emplace(SpvOpVectorShuffle, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(33, { - {0, 0, 0}, - {65790, 0, 0}, - {131134, 0, 0}, - {196669, 0, 0}, - {262201, 0, 0}, - {262209, 0, 0}, - {262225, 0, 0}, - {262231, 0, 0}, - {262273, 0, 0}, - {262277, 0, 0}, - {262286, 0, 0}, - {262292, 0, 0}, - {327745, 0, 0}, - {393281, 0, 0}, - {393295, 0, 0}, - {393296, 0, 0}, - {458831, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 13, 12}, - {0, 1, 18}, - {0, 19, 11}, - {0, 9, 20}, - {0, 10, 21}, - {0, 22, 15}, - {0, 23, 8}, - {0, 4, 24}, - {0, 25, 7}, - {0, 17, 26}, - {0, 5, 27}, - {0, 14, 3}, - {0, 29, 28}, - {0, 30, 2}, - {0, 6, 31}, - {0, 32, 16}, - })); - - codecs.emplace(SpvOpImageSampleImplicitLod, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(55, { - {0, 0, 0}, - {65785, 0, 0}, - {65790, 0, 0}, - {131134, 0, 0}, - {196669, 0, 0}, - {196735, 0, 0}, - {196817, 0, 0}, - {262209, 0, 0}, - {262224, 0, 0}, - {262225, 0, 0}, - {262273, 0, 0}, - {262275, 0, 0}, - {262277, 0, 0}, - {262280, 0, 0}, - {262286, 0, 0}, - {262292, 0, 0}, - {327692, 0, 0}, - {327745, 0, 0}, - {327760, 0, 0}, - {327761, 0, 0}, - {327762, 0, 0}, - {393228, 0, 0}, - {393281, 0, 0}, - {393295, 0, 0}, - {393296, 0, 0}, - {393298, 0, 0}, - {458764, 0, 0}, - {458831, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 5, 2}, - {0, 22, 29}, - {0, 30, 1}, - {0, 6, 31}, - {0, 9, 32}, - {0, 28, 3}, - {0, 27, 33}, - {0, 20, 16}, - {0, 34, 8}, - {0, 10, 35}, - {0, 4, 36}, - {0, 24, 23}, - {0, 21, 13}, - {0, 7, 37}, - {0, 38, 14}, - {0, 25, 39}, - {0, 17, 11}, - {0, 12, 19}, - {0, 41, 40}, - {0, 42, 18}, - {0, 15, 43}, - {0, 45, 44}, - {0, 47, 46}, - {0, 26, 48}, - {0, 50, 49}, - {0, 52, 51}, - {0, 54, 53}, - })); - - codecs.emplace(SpvOpDot, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(11, { - {0, 0, 0}, - {131075, 0, 0}, - {131088, 0, 0}, - {196624, 0, 0}, - {196679, 0, 0}, - {262216, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 5, 3}, - {0, 2, 7}, - {0, 1, 8}, - {0, 6, 9}, - {0, 4, 10}, - })); - - codecs.emplace(SpvOpExecutionMode, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {196858, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(SpvOpSelectionMerge, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(23, { - {0, 0, 0}, - {131134, 0, 0}, - {196669, 0, 0}, - {262209, 0, 0}, - {262224, 0, 0}, - {262225, 0, 0}, - {262277, 0, 0}, - {327745, 0, 0}, - {327761, 0, 0}, - {327762, 0, 0}, - {393295, 0, 0}, - {393296, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 12}, - {0, 7, 13}, - {0, 5, 1}, - {0, 4, 10}, - {0, 14, 6}, - {0, 16, 15}, - {0, 17, 11}, - {0, 3, 8}, - {0, 19, 18}, - {0, 9, 20}, - {0, 22, 21}, - })); - - codecs.emplace(SpvOpImageSampleDrefExplicitLod, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {65790, 0, 0}, - {131073, 0, 0}, - {262198, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 1}, - {0, 3, 5}, - {0, 2, 6}, - })); - - codecs.emplace(SpvOpUndef, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(59, { - {0, 0, 0}, - {65785, 0, 0}, - {131134, 0, 0}, - {131319, 0, 0}, - {196669, 0, 0}, - {196735, 0, 0}, - {262209, 0, 0}, - {262221, 0, 0}, - {262224, 0, 0}, - {262225, 0, 0}, - {262230, 0, 0}, - {262273, 0, 0}, - {262275, 0, 0}, - {262277, 0, 0}, - {262280, 0, 0}, - {262286, 0, 0}, - {262288, 0, 0}, - {262292, 0, 0}, - {262334, 0, 0}, - {327692, 0, 0}, - {327760, 0, 0}, - {327761, 0, 0}, - {327762, 0, 0}, - {393228, 0, 0}, - {393295, 0, 0}, - {393296, 0, 0}, - {393298, 0, 0}, - {458764, 0, 0}, - {458831, 0, 0}, - {524367, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 17, 3}, - {0, 5, 31}, - {0, 11, 32}, - {0, 33, 12}, - {0, 34, 20}, - {0, 16, 27}, - {0, 35, 23}, - {0, 37, 36}, - {0, 14, 18}, - {0, 39, 38}, - {0, 7, 30}, - {0, 8, 25}, - {0, 40, 15}, - {0, 13, 2}, - {0, 1, 29}, - {0, 19, 41}, - {0, 43, 42}, - {0, 28, 44}, - {0, 46, 45}, - {0, 22, 21}, - {0, 47, 24}, - {0, 48, 26}, - {0, 10, 6}, - {0, 50, 49}, - {0, 52, 51}, - {0, 54, 53}, - {0, 4, 9}, - {0, 56, 55}, - {0, 58, 57}, - })); - - codecs.emplace(SpvOpCompositeInsert, std::move(codec)); - } - - return codecs; -} - -std::map>> -GetLiteralStringHuffmanCodecs() { - std::map>> codecs; - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {"", 0, 0}, - {"MainPs", 0, 0}, - {"MainVs", 0, 0}, - {"kMarkvNoneOfTheAbove", 0, 0}, - {"main", 0, 0}, - {"", 2, 3}, - {"", 1, 5}, - {"", 4, 6}, - })); - - codecs.emplace(SpvOpEntryPoint, std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {"", 0, 0}, - {"GLSL.std.450", 0, 0}, - {"kMarkvNoneOfTheAbove", 0, 0}, - {"", 1, 2}, - })); - - codecs.emplace(SpvOpExtInstImport, std::move(codec)); - } - - return codecs; -} - -std::map, std::unique_ptr>> -GetNonIdWordHuffmanCodecs() { - std::map, std::unique_ptr>> codecs; - { - std::unique_ptr> codec(new HuffmanCodec(33, { - {0, 0, 0}, - {4, 0, 0}, - {8, 0, 0}, - {10, 0, 0}, - {26, 0, 0}, - {29, 0, 0}, - {31, 0, 0}, - {37, 0, 0}, - {40, 0, 0}, - {43, 0, 0}, - {46, 0, 0}, - {49, 0, 0}, - {66, 0, 0}, - {67, 0, 0}, - {68, 0, 0}, - {69, 0, 0}, - {71, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 12, 5}, - {0, 18, 13}, - {0, 3, 7}, - {0, 19, 11}, - {0, 20, 16}, - {0, 14, 17}, - {0, 21, 1}, - {0, 2, 6}, - {0, 23, 22}, - {0, 4, 24}, - {0, 26, 25}, - {0, 28, 27}, - {0, 10, 15}, - {0, 8, 9}, - {0, 30, 29}, - {0, 32, 31}, - })); - - codecs.emplace(std::pair(SpvOpExtInst, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {0, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpMemoryModel, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {1, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpMemoryModel, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {0, 0, 0}, - {4, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 3}, - {0, 2, 4}, - })); - - codecs.emplace(std::pair(SpvOpEntryPoint, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {7, 0, 0}, - {8, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 2}, - {0, 1, 4}, - })); - - codecs.emplace(std::pair(SpvOpExecutionMode, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(11, { - {0, 0, 0}, - {1, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {4, 0, 0}, - {18, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 2}, - {0, 6, 5}, - {0, 7, 1}, - {0, 3, 8}, - {0, 10, 9}, - })); - - codecs.emplace(std::pair(SpvOpExecutionMode, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {1, 0, 0}, - {32, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 3}, - {0, 1, 4}, - })); - - codecs.emplace(std::pair(SpvOpCapability, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {32, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeInt, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {0, 0, 0}, - {1, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 3}, - {0, 1, 4}, - })); - - codecs.emplace(std::pair(SpvOpTypeInt, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {32, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeFloat, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {4, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 4}, - {0, 1, 5}, - {0, 6, 3}, - })); - - codecs.emplace(std::pair(SpvOpTypeVector, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {4, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 4}, - {0, 2, 5}, - {0, 3, 6}, - })); - - codecs.emplace(std::pair(SpvOpTypeMatrix, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {1, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 4}, - {0, 2, 5}, - {0, 1, 6}, - })); - - codecs.emplace(std::pair(SpvOpTypeImage, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {0, 0, 0}, - {1, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 3}, - {0, 1, 4}, - })); - - codecs.emplace(std::pair(SpvOpTypeImage, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {0, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeImage, 4), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {0, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeImage, 5), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {1, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeImage, 6), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {0, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeImage, 7), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(13, { - {0, 0, 0}, - {0, 0, 0}, - {1, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {6, 0, 0}, - {7, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 5, 7}, - {0, 6, 8}, - {0, 1, 4}, - {0, 2, 9}, - {0, 10, 3}, - {0, 12, 11}, - })); - - codecs.emplace(std::pair(SpvOpTypePointer, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(173, { - {0, 0, 0}, - {0, 0, 0}, - {1, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {4, 0, 0}, - {5, 0, 0}, - {6, 0, 0}, - {7, 0, 0}, - {8, 0, 0}, - {9, 0, 0}, - {10, 0, 0}, - {11, 0, 0}, - {12, 0, 0}, - {13, 0, 0}, - {14, 0, 0}, - {15, 0, 0}, - {16, 0, 0}, - {17, 0, 0}, - {18, 0, 0}, - {19, 0, 0}, - {20, 0, 0}, - {21, 0, 0}, - {22, 0, 0}, - {23, 0, 0}, - {24, 0, 0}, - {26, 0, 0}, - {27, 0, 0}, - {28, 0, 0}, - {29, 0, 0}, - {30, 0, 0}, - {31, 0, 0}, - {32, 0, 0}, - {256, 0, 0}, - {507307272, 0, 0}, - {864026611, 0, 0}, - {981668463, 0, 0}, - {997553156, 0, 0}, - {1014330372, 0, 0}, - {1020708227, 0, 0}, - {1028443341, 0, 0}, - {1032953056, 0, 0}, - {1033463938, 0, 0}, - {1033463943, 0, 0}, - {1039998884, 0, 0}, - {1039998950, 0, 0}, - {1040187392, 0, 0}, - {1042401985, 0, 0}, - {1044220635, 0, 0}, - {1045622707, 0, 0}, - {1045622740, 0, 0}, - {1048576000, 0, 0}, - {1053609165, 0, 0}, - {1053790359, 0, 0}, - {1054448026, 0, 0}, - {1055437881, 0, 0}, - {1056300230, 0, 0}, - {1056964608, 0, 0}, - {1058056805, 0, 0}, - {1059286575, 0, 0}, - {1061158912, 0, 0}, - {1061997773, 0, 0}, - {1064514355, 0, 0}, - {1064854933, 0, 0}, - {1065353216, 0, 0}, - {1069547520, 0, 0}, - {1073741824, 0, 0}, - {1077936128, 0, 0}, - {1082130432, 0, 0}, - {1091567616, 0, 0}, - {1115422720, 0, 0}, - {1124073472, 0, 0}, - {1132396544, 0, 0}, - {1140850688, 0, 0}, - {1199562752, 0, 0}, - {3179067684, 0, 0}, - {3180973575, 0, 0}, - {3182651297, 0, 0}, - {3196448879, 0, 0}, - {3204448256, 0, 0}, - {3204993516, 0, 0}, - {3205248529, 0, 0}, - {3207137644, 0, 0}, - {3208642560, 0, 0}, - {3211081967, 0, 0}, - {3212836864, 0, 0}, - {3332128768, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 38, 37}, - {0, 42, 39}, - {0, 49, 44}, - {0, 45, 43}, - {0, 26, 50}, - {0, 46, 73}, - {0, 35, 28}, - {0, 32, 65}, - {0, 83, 40}, - {0, 60, 62}, - {0, 27, 54}, - {0, 79, 67}, - {0, 31, 74}, - {0, 51, 12}, - {0, 70, 30}, - {0, 15, 16}, - {0, 88, 25}, - {0, 90, 89}, - {0, 34, 71}, - {0, 72, 29}, - {0, 92, 91}, - {0, 14, 33}, - {0, 94, 93}, - {0, 22, 23}, - {0, 21, 95}, - {0, 19, 24}, - {0, 96, 13}, - {0, 47, 41}, - {0, 53, 48}, - {0, 58, 56}, - {0, 63, 59}, - {0, 76, 75}, - {0, 78, 77}, - {0, 81, 80}, - {0, 84, 82}, - {0, 52, 20}, - {0, 97, 69}, - {0, 99, 98}, - {0, 18, 10}, - {0, 68, 61}, - {0, 17, 100}, - {0, 102, 101}, - {0, 11, 36}, - {0, 104, 103}, - {0, 86, 105}, - {0, 107, 106}, - {0, 109, 108}, - {0, 110, 9}, - {0, 8, 111}, - {0, 113, 112}, - {0, 115, 114}, - {0, 117, 116}, - {0, 119, 118}, - {0, 121, 120}, - {0, 123, 122}, - {0, 125, 124}, - {0, 126, 7}, - {0, 127, 85}, - {0, 6, 128}, - {0, 129, 55}, - {0, 130, 5}, - {0, 132, 131}, - {0, 134, 133}, - {0, 136, 135}, - {0, 137, 66}, - {0, 139, 138}, - {0, 141, 140}, - {0, 143, 142}, - {0, 145, 144}, - {0, 146, 57}, - {0, 147, 64}, - {0, 148, 4}, - {0, 149, 2}, - {0, 151, 150}, - {0, 152, 3}, - {0, 154, 153}, - {0, 156, 155}, - {0, 158, 157}, - {0, 159, 1}, - {0, 160, 87}, - {0, 162, 161}, - {0, 164, 163}, - {0, 166, 165}, - {0, 168, 167}, - {0, 170, 169}, - {0, 172, 171}, - })); - - codecs.emplace(std::pair(SpvOpConstant, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {0, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpFunction, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(13, { - {0, 0, 0}, - {0, 0, 0}, - {1, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {6, 0, 0}, - {7, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 7}, - {0, 4, 8}, - {0, 9, 2}, - {0, 1, 5}, - {0, 10, 6}, - {0, 12, 11}, - })); - - codecs.emplace(std::pair(SpvOpVariable, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(15, { - {0, 0, 0}, - {0, 0, 0}, - {2, 0, 0}, - {6, 0, 0}, - {11, 0, 0}, - {30, 0, 0}, - {33, 0, 0}, - {34, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 8}, - {0, 9, 1}, - {0, 3, 10}, - {0, 6, 11}, - {0, 12, 2}, - {0, 7, 5}, - {0, 14, 13}, - })); - - codecs.emplace(std::pair(SpvOpDecorate, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(37, { - {0, 0, 0}, - {0, 0, 0}, - {1, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {4, 0, 0}, - {5, 0, 0}, - {6, 0, 0}, - {7, 0, 0}, - {8, 0, 0}, - {9, 0, 0}, - {10, 0, 0}, - {12, 0, 0}, - {13, 0, 0}, - {14, 0, 0}, - {15, 0, 0}, - {16, 0, 0}, - {18, 0, 0}, - {64, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 17, 11}, - {0, 10, 13}, - {0, 12, 14}, - {0, 21, 20}, - {0, 9, 22}, - {0, 19, 15}, - {0, 8, 23}, - {0, 18, 24}, - {0, 25, 7}, - {0, 5, 6}, - {0, 26, 16}, - {0, 27, 4}, - {0, 28, 3}, - {0, 30, 29}, - {0, 31, 2}, - {0, 33, 32}, - {0, 35, 34}, - {0, 1, 36}, - })); - - codecs.emplace(std::pair(SpvOpDecorate, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(79, { - {0, 0, 0}, - {0, 0, 0}, - {1, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {4, 0, 0}, - {5, 0, 0}, - {6, 0, 0}, - {7, 0, 0}, - {8, 0, 0}, - {9, 0, 0}, - {10, 0, 0}, - {11, 0, 0}, - {12, 0, 0}, - {13, 0, 0}, - {14, 0, 0}, - {15, 0, 0}, - {16, 0, 0}, - {17, 0, 0}, - {18, 0, 0}, - {19, 0, 0}, - {20, 0, 0}, - {21, 0, 0}, - {22, 0, 0}, - {23, 0, 0}, - {24, 0, 0}, - {25, 0, 0}, - {26, 0, 0}, - {27, 0, 0}, - {28, 0, 0}, - {29, 0, 0}, - {30, 0, 0}, - {31, 0, 0}, - {32, 0, 0}, - {33, 0, 0}, - {34, 0, 0}, - {35, 0, 0}, - {36, 0, 0}, - {37, 0, 0}, - {38, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 39, 37}, - {0, 40, 36}, - {0, 34, 35}, - {0, 32, 33}, - {0, 30, 31}, - {0, 27, 29}, - {0, 26, 28}, - {0, 42, 41}, - {0, 23, 25}, - {0, 38, 22}, - {0, 44, 43}, - {0, 46, 45}, - {0, 21, 47}, - {0, 19, 20}, - {0, 17, 18}, - {0, 14, 15}, - {0, 12, 10}, - {0, 16, 13}, - {0, 9, 11}, - {0, 7, 8}, - {0, 6, 5}, - {0, 24, 48}, - {0, 50, 49}, - {0, 3, 4}, - {0, 51, 2}, - {0, 1, 52}, - {0, 54, 53}, - {0, 56, 55}, - {0, 58, 57}, - {0, 60, 59}, - {0, 62, 61}, - {0, 64, 63}, - {0, 66, 65}, - {0, 68, 67}, - {0, 70, 69}, - {0, 72, 71}, - {0, 74, 73}, - {0, 76, 75}, - {0, 78, 77}, - })); - - codecs.emplace(std::pair(SpvOpMemberDecorate, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {4, 0, 0}, - {7, 0, 0}, - {35, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 4}, - {0, 5, 2}, - {0, 3, 6}, - })); - - codecs.emplace(std::pair(SpvOpMemberDecorate, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(149, { - {0, 0, 0}, - {0, 0, 0}, - {16, 0, 0}, - {28, 0, 0}, - {32, 0, 0}, - {36, 0, 0}, - {40, 0, 0}, - {44, 0, 0}, - {48, 0, 0}, - {60, 0, 0}, - {64, 0, 0}, - {76, 0, 0}, - {80, 0, 0}, - {84, 0, 0}, - {88, 0, 0}, - {92, 0, 0}, - {96, 0, 0}, - {100, 0, 0}, - {108, 0, 0}, - {112, 0, 0}, - {120, 0, 0}, - {124, 0, 0}, - {128, 0, 0}, - {132, 0, 0}, - {136, 0, 0}, - {140, 0, 0}, - {144, 0, 0}, - {148, 0, 0}, - {152, 0, 0}, - {156, 0, 0}, - {160, 0, 0}, - {172, 0, 0}, - {176, 0, 0}, - {192, 0, 0}, - {204, 0, 0}, - {208, 0, 0}, - {224, 0, 0}, - {236, 0, 0}, - {240, 0, 0}, - {248, 0, 0}, - {256, 0, 0}, - {272, 0, 0}, - {288, 0, 0}, - {292, 0, 0}, - {296, 0, 0}, - {300, 0, 0}, - {304, 0, 0}, - {316, 0, 0}, - {320, 0, 0}, - {332, 0, 0}, - {336, 0, 0}, - {348, 0, 0}, - {352, 0, 0}, - {364, 0, 0}, - {368, 0, 0}, - {372, 0, 0}, - {376, 0, 0}, - {384, 0, 0}, - {392, 0, 0}, - {400, 0, 0}, - {416, 0, 0}, - {424, 0, 0}, - {432, 0, 0}, - {448, 0, 0}, - {460, 0, 0}, - {464, 0, 0}, - {468, 0, 0}, - {472, 0, 0}, - {476, 0, 0}, - {480, 0, 0}, - {488, 0, 0}, - {492, 0, 0}, - {496, 0, 0}, - {512, 0, 0}, - {640, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 14, 17}, - {0, 37, 31}, - {0, 21, 39}, - {0, 24, 23}, - {0, 5, 13}, - {0, 38, 76}, - {0, 51, 77}, - {0, 55, 53}, - {0, 58, 56}, - {0, 64, 61}, - {0, 67, 66}, - {0, 70, 68}, - {0, 54, 71}, - {0, 62, 60}, - {0, 65, 63}, - {0, 73, 72}, - {0, 59, 57}, - {0, 52, 74}, - {0, 50, 69}, - {0, 49, 47}, - {0, 48, 46}, - {0, 45, 43}, - {0, 42, 44}, - {0, 78, 41}, - {0, 20, 18}, - {0, 80, 79}, - {0, 15, 27}, - {0, 7, 34}, - {0, 81, 6}, - {0, 28, 3}, - {0, 35, 82}, - {0, 9, 36}, - {0, 84, 83}, - {0, 86, 85}, - {0, 88, 87}, - {0, 90, 89}, - {0, 92, 91}, - {0, 94, 93}, - {0, 96, 95}, - {0, 98, 97}, - {0, 11, 29}, - {0, 99, 25}, - {0, 100, 40}, - {0, 102, 101}, - {0, 26, 32}, - {0, 19, 30}, - {0, 16, 12}, - {0, 4, 8}, - {0, 104, 103}, - {0, 106, 105}, - {0, 33, 107}, - {0, 109, 108}, - {0, 111, 110}, - {0, 22, 112}, - {0, 113, 10}, - {0, 115, 114}, - {0, 75, 116}, - {0, 118, 117}, - {0, 119, 1}, - {0, 121, 120}, - {0, 123, 122}, - {0, 125, 124}, - {0, 127, 126}, - {0, 129, 128}, - {0, 131, 130}, - {0, 132, 2}, - {0, 134, 133}, - {0, 136, 135}, - {0, 138, 137}, - {0, 140, 139}, - {0, 142, 141}, - {0, 144, 143}, - {0, 146, 145}, - {0, 148, 147}, - })); - - codecs.emplace(std::pair(SpvOpMemberDecorate, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(11, { - {0, 0, 0}, - {0, 0, 0}, - {1, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {4, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 6}, - {0, 4, 7}, - {0, 8, 3}, - {0, 9, 5}, - {0, 1, 10}, - })); - - codecs.emplace(std::pair(SpvOpVectorShuffle, 4), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(13, { - {0, 0, 0}, - {0, 0, 0}, - {1, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {4, 0, 0}, - {5, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 7}, - {0, 8, 5}, - {0, 9, 1}, - {0, 4, 10}, - {0, 11, 6}, - {0, 2, 12}, - })); - - codecs.emplace(std::pair(SpvOpVectorShuffle, 5), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(15, { - {0, 0, 0}, - {0, 0, 0}, - {1, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {4, 0, 0}, - {5, 0, 0}, - {6, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 6, 8}, - {0, 5, 2}, - {0, 10, 9}, - {0, 1, 4}, - {0, 12, 11}, - {0, 7, 13}, - {0, 3, 14}, - })); - - codecs.emplace(std::pair(SpvOpVectorShuffle, 6), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(15, { - {0, 0, 0}, - {0, 0, 0}, - {1, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {4, 0, 0}, - {5, 0, 0}, - {6, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 8, 5}, - {0, 9, 7}, - {0, 10, 3}, - {0, 11, 2}, - {0, 6, 1}, - {0, 13, 12}, - {0, 4, 14}, - })); - - codecs.emplace(std::pair(SpvOpVectorShuffle, 7), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(61, { - {0, 0, 0}, - {0, 0, 0}, - {1, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {4, 0, 0}, - {5, 0, 0}, - {6, 0, 0}, - {7, 0, 0}, - {8, 0, 0}, - {9, 0, 0}, - {10, 0, 0}, - {11, 0, 0}, - {12, 0, 0}, - {13, 0, 0}, - {14, 0, 0}, - {15, 0, 0}, - {16, 0, 0}, - {17, 0, 0}, - {18, 0, 0}, - {19, 0, 0}, - {20, 0, 0}, - {21, 0, 0}, - {22, 0, 0}, - {23, 0, 0}, - {24, 0, 0}, - {27, 0, 0}, - {28, 0, 0}, - {29, 0, 0}, - {30, 0, 0}, - {31, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 30, 16}, - {0, 26, 27}, - {0, 29, 28}, - {0, 18, 22}, - {0, 12, 19}, - {0, 15, 20}, - {0, 14, 23}, - {0, 32, 7}, - {0, 8, 21}, - {0, 11, 33}, - {0, 17, 34}, - {0, 25, 13}, - {0, 36, 35}, - {0, 9, 10}, - {0, 38, 37}, - {0, 39, 31}, - {0, 5, 40}, - {0, 42, 41}, - {0, 44, 43}, - {0, 6, 45}, - {0, 46, 24}, - {0, 48, 47}, - {0, 50, 49}, - {0, 52, 51}, - {0, 54, 53}, - {0, 55, 4}, - {0, 56, 3}, - {0, 57, 2}, - {0, 58, 1}, - {0, 60, 59}, - })); - - codecs.emplace(std::pair(SpvOpCompositeExtract, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(63, { - {0, 0, 0}, - {0, 0, 0}, - {1, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {4, 0, 0}, - {5, 0, 0}, - {6, 0, 0}, - {7, 0, 0}, - {8, 0, 0}, - {9, 0, 0}, - {10, 0, 0}, - {11, 0, 0}, - {12, 0, 0}, - {13, 0, 0}, - {29, 0, 0}, - {30, 0, 0}, - {31, 0, 0}, - {32, 0, 0}, - {33, 0, 0}, - {34, 0, 0}, - {35, 0, 0}, - {36, 0, 0}, - {37, 0, 0}, - {38, 0, 0}, - {39, 0, 0}, - {40, 0, 0}, - {41, 0, 0}, - {42, 0, 0}, - {43, 0, 0}, - {44, 0, 0}, - {45, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 13, 14}, - {0, 12, 9}, - {0, 11, 25}, - {0, 27, 26}, - {0, 29, 28}, - {0, 31, 30}, - {0, 23, 22}, - {0, 10, 24}, - {0, 8, 21}, - {0, 17, 7}, - {0, 19, 18}, - {0, 15, 20}, - {0, 6, 16}, - {0, 5, 33}, - {0, 35, 34}, - {0, 37, 36}, - {0, 39, 38}, - {0, 41, 40}, - {0, 43, 42}, - {0, 45, 44}, - {0, 47, 46}, - {0, 49, 48}, - {0, 51, 50}, - {0, 32, 52}, - {0, 54, 53}, - {0, 56, 55}, - {0, 58, 57}, - {0, 3, 2}, - {0, 59, 4}, - {0, 60, 1}, - {0, 62, 61}, - })); - - codecs.emplace(std::pair(SpvOpCompositeExtract, 4), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {0, 0, 0}, - {1, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 5}, - {0, 3, 2}, - {0, 6, 4}, - {0, 8, 7}, - })); - - codecs.emplace(std::pair(SpvOpCompositeExtract, 5), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(23, { - {0, 0, 0}, - {0, 0, 0}, - {1, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {4, 0, 0}, - {5, 0, 0}, - {6, 0, 0}, - {7, 0, 0}, - {8, 0, 0}, - {9, 0, 0}, - {10, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 12, 11}, - {0, 10, 13}, - {0, 9, 14}, - {0, 7, 5}, - {0, 8, 6}, - {0, 4, 15}, - {0, 17, 16}, - {0, 18, 3}, - {0, 19, 2}, - {0, 20, 1}, - {0, 22, 21}, - })); - - codecs.emplace(std::pair(SpvOpCompositeInsert, 4), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {0, 0, 0}, - {1, 0, 0}, - {2, 0, 0}, - {3, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 5}, - {0, 2, 6}, - {0, 7, 1}, - {0, 4, 8}, - })); - - codecs.emplace(std::pair(SpvOpCompositeInsert, 5), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {1, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpImageSampleImplicitLod, 4), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {2, 0, 0}, - {10, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 3}, - {0, 1, 4}, - })); - - codecs.emplace(std::pair(SpvOpImageSampleExplicitLod, 4), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {2, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpImageSampleDrefExplicitLod, 5), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {0, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpSelectionMerge, 1), std::move(codec)); - } - - return codecs; -} - -std::map, std::unique_ptr>> -GetIdDescriptorHuffmanCodecs() { - std::map, std::unique_ptr>> codecs; - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 5}, - {0, 4, 6}, - {0, 1, 7}, - {0, 2, 8}, - })); - - codecs.emplace(std::pair(SpvOpExtInst, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(63, { - {0, 0, 0}, - {34183582, 0, 0}, - {223800276, 0, 0}, - {295018543, 0, 0}, - {439764402, 0, 0}, - {443558693, 0, 0}, - {583624926, 0, 0}, - {599185303, 0, 0}, - {779021139, 0, 0}, - {1015552308, 0, 0}, - {1027242654, 0, 0}, - {1077859090, 0, 0}, - {1104362365, 0, 0}, - {1132589448, 0, 0}, - {1236389532, 0, 0}, - {1739837626, 0, 0}, - {1955104493, 0, 0}, - {2161102232, 0, 0}, - {2197874825, 0, 0}, - {2217833278, 0, 0}, - {2244470522, 0, 0}, - {2532518896, 0, 0}, - {2789375411, 0, 0}, - {3061690214, 0, 0}, - {3287039847, 0, 0}, - {3357301402, 0, 0}, - {3365041621, 0, 0}, - {3510257966, 0, 0}, - {3534235309, 0, 0}, - {4018237905, 0, 0}, - {4145966869, 0, 0}, - {4272200782, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 10, 19}, - {0, 6, 1}, - {0, 26, 13}, - {0, 2, 11}, - {0, 15, 22}, - {0, 23, 18}, - {0, 4, 27}, - {0, 28, 12}, - {0, 3, 30}, - {0, 9, 7}, - {0, 20, 14}, - {0, 29, 16}, - {0, 21, 8}, - {0, 34, 33}, - {0, 36, 35}, - {0, 31, 25}, - {0, 37, 24}, - {0, 39, 38}, - {0, 41, 40}, - {0, 43, 42}, - {0, 45, 44}, - {0, 17, 5}, - {0, 47, 46}, - {0, 49, 48}, - {0, 51, 50}, - {0, 53, 52}, - {0, 55, 54}, - {0, 57, 56}, - {0, 59, 58}, - {0, 61, 60}, - {0, 32, 62}, - })); - - codecs.emplace(std::pair(SpvOpExtInst, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {4228502127, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpExtInst, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(113, { - {0, 0, 0}, - {50998433, 0, 0}, - {139011596, 0, 0}, - {181902171, 0, 0}, - {296981500, 0, 0}, - {321630747, 0, 0}, - {416853049, 0, 0}, - {464259778, 0, 0}, - {615982737, 0, 0}, - {669982125, 0, 0}, - {759277550, 0, 0}, - {810488476, 0, 0}, - {870594305, 0, 0}, - {922996215, 0, 0}, - {969500141, 0, 0}, - {1015552308, 0, 0}, - {1139547465, 0, 0}, - {1203545131, 0, 0}, - {1220643281, 0, 0}, - {1220749418, 0, 0}, - {1367301635, 0, 0}, - {1395923345, 0, 0}, - {1554194368, 0, 0}, - {1742737136, 0, 0}, - {1755648697, 0, 0}, - {1962162282, 0, 0}, - {1964254745, 0, 0}, - {2055836767, 0, 0}, - {2096388952, 0, 0}, - {2124837447, 0, 0}, - {2161102232, 0, 0}, - {2321729979, 0, 0}, - {2346547796, 0, 0}, - {2399809085, 0, 0}, - {2432827426, 0, 0}, - {2455417440, 0, 0}, - {2572638469, 0, 0}, - {2614879967, 0, 0}, - {2855506940, 0, 0}, - {2919796598, 0, 0}, - {2970183398, 0, 0}, - {2976066508, 0, 0}, - {3044188332, 0, 0}, - {3061690214, 0, 0}, - {3091876332, 0, 0}, - {3104643263, 0, 0}, - {3107165180, 0, 0}, - {3187066832, 0, 0}, - {3413713311, 0, 0}, - {3487022798, 0, 0}, - {3602693817, 0, 0}, - {3678875745, 0, 0}, - {3701632935, 0, 0}, - {3829325073, 0, 0}, - {4040340620, 0, 0}, - {4174489262, 0, 0}, - {4272200782, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 33, 7}, - {0, 13, 34}, - {0, 21, 18}, - {0, 53, 22}, - {0, 39, 1}, - {0, 14, 9}, - {0, 43, 26}, - {0, 51, 35}, - {0, 19, 6}, - {0, 15, 25}, - {0, 55, 29}, - {0, 32, 3}, - {0, 27, 44}, - {0, 10, 46}, - {0, 45, 24}, - {0, 36, 40}, - {0, 47, 8}, - {0, 48, 54}, - {0, 58, 5}, - {0, 60, 59}, - {0, 30, 61}, - {0, 62, 56}, - {0, 64, 63}, - {0, 41, 50}, - {0, 66, 65}, - {0, 68, 67}, - {0, 70, 69}, - {0, 37, 31}, - {0, 4, 17}, - {0, 16, 20}, - {0, 72, 71}, - {0, 73, 52}, - {0, 49, 12}, - {0, 75, 74}, - {0, 76, 11}, - {0, 23, 42}, - {0, 78, 77}, - {0, 80, 79}, - {0, 82, 81}, - {0, 84, 83}, - {0, 85, 28}, - {0, 87, 86}, - {0, 89, 88}, - {0, 91, 90}, - {0, 93, 92}, - {0, 94, 2}, - {0, 96, 95}, - {0, 98, 97}, - {0, 100, 99}, - {0, 102, 101}, - {0, 38, 103}, - {0, 105, 104}, - {0, 107, 106}, - {0, 109, 108}, - {0, 111, 110}, - {0, 57, 112}, - })); - - codecs.emplace(std::pair(SpvOpExtInst, 4), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(127, { - {0, 0, 0}, - {72782198, 0, 0}, - {139011596, 0, 0}, - {296981500, 0, 0}, - {300939750, 0, 0}, - {401211099, 0, 0}, - {429277936, 0, 0}, - {505940164, 0, 0}, - {538168945, 0, 0}, - {603915804, 0, 0}, - {688216667, 0, 0}, - {706016261, 0, 0}, - {790502615, 0, 0}, - {810488476, 0, 0}, - {993150979, 0, 0}, - {1203545131, 0, 0}, - {1206726575, 0, 0}, - {1265796414, 0, 0}, - {1314843976, 0, 0}, - {1367301635, 0, 0}, - {1378082995, 0, 0}, - {1410311776, 0, 0}, - {1443829854, 0, 0}, - {1448448666, 0, 0}, - {1468919488, 0, 0}, - {1496351055, 0, 0}, - {1619778288, 0, 0}, - {1684282922, 0, 0}, - {1848784182, 0, 0}, - {1901166356, 0, 0}, - {2095546797, 0, 0}, - {2096388952, 0, 0}, - {2162986400, 0, 0}, - {2197874825, 0, 0}, - {2246405597, 0, 0}, - {2250225826, 0, 0}, - {2282454607, 0, 0}, - {2328748202, 0, 0}, - {2348201466, 0, 0}, - {2597020383, 0, 0}, - {2633682514, 0, 0}, - {2817335337, 0, 0}, - {2855506940, 0, 0}, - {2936040203, 0, 0}, - {2955375511, 0, 0}, - {3122368657, 0, 0}, - {3154597438, 0, 0}, - {3184381405, 0, 0}, - {3187066832, 0, 0}, - {3233393284, 0, 0}, - {3251128023, 0, 0}, - {3260309823, 0, 0}, - {3441531391, 0, 0}, - {3496407048, 0, 0}, - {3582002820, 0, 0}, - {3647586740, 0, 0}, - {3653838348, 0, 0}, - {3730093054, 0, 0}, - {3759072440, 0, 0}, - {3928764629, 0, 0}, - {3969279737, 0, 0}, - {3994511488, 0, 0}, - {4026740269, 0, 0}, - {4274214049, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 43, 23}, - {0, 5, 24}, - {0, 9, 8}, - {0, 36, 21}, - {0, 13, 46}, - {0, 7, 12}, - {0, 35, 20}, - {0, 61, 59}, - {0, 22, 29}, - {0, 38, 62}, - {0, 56, 45}, - {0, 6, 48}, - {0, 33, 30}, - {0, 14, 58}, - {0, 34, 28}, - {0, 51, 40}, - {0, 63, 55}, - {0, 25, 16}, - {0, 17, 11}, - {0, 53, 52}, - {0, 65, 27}, - {0, 39, 41}, - {0, 67, 66}, - {0, 69, 68}, - {0, 10, 4}, - {0, 37, 18}, - {0, 60, 47}, - {0, 1, 32}, - {0, 71, 70}, - {0, 73, 72}, - {0, 57, 26}, - {0, 74, 31}, - {0, 76, 75}, - {0, 77, 44}, - {0, 78, 15}, - {0, 79, 54}, - {0, 81, 80}, - {0, 82, 49}, - {0, 84, 83}, - {0, 86, 85}, - {0, 88, 87}, - {0, 89, 19}, - {0, 91, 90}, - {0, 93, 92}, - {0, 95, 94}, - {0, 2, 96}, - {0, 98, 97}, - {0, 100, 99}, - {0, 102, 101}, - {0, 104, 103}, - {0, 106, 105}, - {0, 3, 107}, - {0, 109, 108}, - {0, 111, 110}, - {0, 113, 112}, - {0, 114, 50}, - {0, 116, 115}, - {0, 118, 117}, - {0, 120, 119}, - {0, 122, 121}, - {0, 124, 123}, - {0, 64, 42}, - {0, 126, 125}, - })); - - codecs.emplace(std::pair(SpvOpExtInst, 5), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(93, { - {0, 0, 0}, - {99347751, 0, 0}, - {102542696, 0, 0}, - {107497541, 0, 0}, - {112452386, 0, 0}, - {139011596, 0, 0}, - {296981500, 0, 0}, - {429277936, 0, 0}, - {451957774, 0, 0}, - {508217552, 0, 0}, - {573901046, 0, 0}, - {774727851, 0, 0}, - {801484894, 0, 0}, - {920604853, 0, 0}, - {925559698, 0, 0}, - {1022915255, 0, 0}, - {1209418480, 0, 0}, - {1287937401, 0, 0}, - {1319785741, 0, 0}, - {1392080469, 0, 0}, - {1538342947, 0, 0}, - {1541020250, 0, 0}, - {1587209598, 0, 0}, - {1594733696, 0, 0}, - {1631434666, 0, 0}, - {1636389511, 0, 0}, - {1684282922, 0, 0}, - {1859128680, 0, 0}, - {1901166356, 0, 0}, - {2004567202, 0, 0}, - {2119793999, 0, 0}, - {2280400314, 0, 0}, - {2538917932, 0, 0}, - {2677264274, 0, 0}, - {2683080096, 0, 0}, - {2854085372, 0, 0}, - {2879917501, 0, 0}, - {3059119137, 0, 0}, - {3174324790, 0, 0}, - {3194725903, 0, 0}, - {3358097187, 0, 0}, - {3547456240, 0, 0}, - {3614752756, 0, 0}, - {3753486980, 0, 0}, - {3811268385, 0, 0}, - {3953733490, 0, 0}, - {3990925720, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 23, 22}, - {0, 36, 31}, - {0, 17, 40}, - {0, 27, 19}, - {0, 35, 33}, - {0, 30, 38}, - {0, 42, 39}, - {0, 46, 32}, - {0, 13, 12}, - {0, 44, 14}, - {0, 29, 11}, - {0, 10, 18}, - {0, 15, 37}, - {0, 1, 4}, - {0, 45, 2}, - {0, 21, 28}, - {0, 8, 5}, - {0, 49, 48}, - {0, 51, 50}, - {0, 53, 52}, - {0, 54, 16}, - {0, 55, 25}, - {0, 56, 3}, - {0, 58, 57}, - {0, 59, 26}, - {0, 20, 7}, - {0, 61, 60}, - {0, 62, 24}, - {0, 41, 63}, - {0, 65, 64}, - {0, 9, 34}, - {0, 67, 66}, - {0, 69, 68}, - {0, 71, 70}, - {0, 73, 72}, - {0, 75, 74}, - {0, 76, 43}, - {0, 78, 77}, - {0, 80, 79}, - {0, 82, 81}, - {0, 84, 83}, - {0, 86, 85}, - {0, 88, 87}, - {0, 90, 89}, - {0, 47, 91}, - {0, 92, 6}, - })); - - codecs.emplace(std::pair(SpvOpExtInst, 6), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(15, { - {0, 0, 0}, - {166253838, 0, 0}, - {679771963, 0, 0}, - {1247793383, 0, 0}, - {2261697609, 0, 0}, - {2263349224, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 8}, - {0, 9, 1}, - {0, 3, 5}, - {0, 11, 10}, - {0, 2, 12}, - {0, 7, 6}, - {0, 14, 13}, - })); - - codecs.emplace(std::pair(SpvOpTypeVector, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {789872778, 0, 0}, - {1415510495, 0, 0}, - {1951208733, 0, 0}, - {2430404313, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 5}, - {0, 4, 6}, - {0, 7, 1}, - {0, 3, 8}, - })); - - codecs.emplace(std::pair(SpvOpTypeVector, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(15, { - {0, 0, 0}, - {1389644742, 0, 0}, - {3232633974, 0, 0}, - {3278176820, 0, 0}, - {3648138580, 0, 0}, - {3687777340, 0, 0}, - {3694383800, 0, 0}, - {3697687030, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 5, 4}, - {0, 9, 6}, - {0, 10, 8}, - {0, 2, 11}, - {0, 12, 3}, - {0, 1, 13}, - {0, 14, 7}, - })); - - codecs.emplace(std::pair(SpvOpTypeArray, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {1951208733, 0, 0}, - {2160380860, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 4}, - {0, 2, 5}, - {0, 3, 6}, - })); - - codecs.emplace(std::pair(SpvOpTypeArray, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(13, { - {0, 0, 0}, - {144116905, 0, 0}, - {827246872, 0, 0}, - {1545298048, 0, 0}, - {2715370488, 0, 0}, - {2798552666, 0, 0}, - {3812456892, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 3}, - {0, 8, 6}, - {0, 9, 7}, - {0, 1, 10}, - {0, 11, 4}, - {0, 5, 12}, - })); - - codecs.emplace(std::pair(SpvOpTypeArray, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(67, { - {0, 0, 0}, - {40653745, 0, 0}, - {119981689, 0, 0}, - {153085016, 0, 0}, - {451382997, 0, 0}, - {545678922, 0, 0}, - {899570100, 0, 0}, - {929101967, 0, 0}, - {1070791291, 0, 0}, - {1100599986, 0, 0}, - {1103903216, 0, 0}, - {1154919607, 0, 0}, - {1199157863, 0, 0}, - {1258105452, 0, 0}, - {1369578001, 0, 0}, - {1372881231, 0, 0}, - {1674803691, 0, 0}, - {1677700667, 0, 0}, - {1989520052, 0, 0}, - {2593884753, 0, 0}, - {2664825925, 0, 0}, - {2924146124, 0, 0}, - {2926633629, 0, 0}, - {3249265647, 0, 0}, - {3345288309, 0, 0}, - {3410158390, 0, 0}, - {3489360962, 0, 0}, - {3495967422, 0, 0}, - {3504981554, 0, 0}, - {3705139860, 0, 0}, - {3822983876, 0, 0}, - {4141567741, 0, 0}, - {4234287173, 0, 0}, - {4240893633, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 15, 23}, - {0, 20, 17}, - {0, 32, 22}, - {0, 19, 12}, - {0, 13, 3}, - {0, 30, 27}, - {0, 4, 35}, - {0, 24, 36}, - {0, 31, 37}, - {0, 33, 38}, - {0, 39, 7}, - {0, 6, 40}, - {0, 41, 29}, - {0, 14, 42}, - {0, 43, 28}, - {0, 10, 44}, - {0, 45, 18}, - {0, 26, 46}, - {0, 5, 47}, - {0, 48, 2}, - {0, 49, 9}, - {0, 50, 16}, - {0, 34, 25}, - {0, 52, 51}, - {0, 54, 53}, - {0, 56, 55}, - {0, 58, 57}, - {0, 60, 59}, - {0, 8, 21}, - {0, 1, 11}, - {0, 62, 61}, - {0, 64, 63}, - {0, 66, 65}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(11, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2160380860, 0, 0}, - {3278176820, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 6}, - {0, 2, 7}, - {0, 3, 8}, - {0, 9, 1}, - {0, 5, 10}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(13, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2160380860, 0, 0}, - {2320303498, 0, 0}, - {3232633974, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 5, 7}, - {0, 2, 8}, - {0, 4, 9}, - {0, 10, 3}, - {0, 1, 6}, - {0, 12, 11}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(11, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2160380860, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 5, 6}, - {0, 1, 7}, - {0, 3, 4}, - {0, 8, 2}, - {0, 10, 9}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(11, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2160380860, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 6}, - {0, 3, 7}, - {0, 5, 4}, - {0, 8, 1}, - {0, 10, 9}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 4), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2263349224, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 5}, - {0, 1, 6}, - {0, 2, 7}, - {0, 8, 4}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 5), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 5}, - {0, 1, 6}, - {0, 2, 7}, - {0, 8, 4}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 6), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 5}, - {0, 4, 6}, - {0, 7, 1}, - {0, 2, 8}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 7), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 5}, - {0, 1, 6}, - {0, 7, 4}, - {0, 2, 8}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 8), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 4}, - {0, 3, 5}, - {0, 1, 6}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 9), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 5, 3}, - {0, 1, 6}, - {0, 4, 7}, - {0, 8, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 10), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 5}, - {0, 1, 6}, - {0, 7, 4}, - {0, 8, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 11), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 3}, - {0, 4, 1}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 12), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 4}, - {0, 1, 5}, - {0, 2, 6}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 13), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 5}, - {0, 3, 6}, - {0, 7, 1}, - {0, 8, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 14), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 4}, - {0, 5, 3}, - {0, 6, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 15), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 4}, - {0, 2, 5}, - {0, 1, 6}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 16), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 5}, - {0, 4, 6}, - {0, 7, 1}, - {0, 8, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 17), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 4}, - {0, 1, 5}, - {0, 2, 6}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 18), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 4}, - {0, 3, 5}, - {0, 2, 6}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 19), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 4}, - {0, 1, 5}, - {0, 2, 6}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 20), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 4}, - {0, 2, 5}, - {0, 3, 6}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 21), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 5, 1}, - {0, 2, 6}, - {0, 3, 7}, - {0, 8, 4}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 22), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 5}, - {0, 2, 6}, - {0, 4, 7}, - {0, 8, 3}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 23), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(11, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2160380860, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 6, 4}, - {0, 1, 7}, - {0, 2, 8}, - {0, 3, 9}, - {0, 10, 5}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 24), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 5}, - {0, 2, 6}, - {0, 4, 7}, - {0, 8, 3}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 25), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 4}, - {0, 2, 5}, - {0, 3, 6}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 26), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 4}, - {0, 2, 5}, - {0, 3, 6}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 27), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 3}, - {0, 1, 4}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 28), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 3}, - {0, 2, 4}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 29), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 3}, - {0, 2, 4}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 30), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 3}, - {0, 1, 5}, - {0, 2, 6}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 31), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 4}, - {0, 1, 5}, - {0, 2, 6}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 32), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 3}, - {0, 1, 4}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 33), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 3}, - {0, 2, 4}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 34), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 3}, - {0, 1, 4}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 35), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 3}, - {0, 1, 4}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 36), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {679771963, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 37), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {1389644742, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 38), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {3697687030, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 39), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {2320303498, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 40), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {2320303498, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 41), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {679771963, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 42), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {679771963, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 43), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {679771963, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 44), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {679771963, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 45), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {679771963, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 46), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {679771963, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 47), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {679771963, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 48), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {679771963, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 49), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {679771963, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 50), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {679771963, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpTypeStruct, 51), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(101, { - {0, 0, 0}, - {85880059, 0, 0}, - {135486769, 0, 0}, - {304448521, 0, 0}, - {436416061, 0, 0}, - {440421571, 0, 0}, - {450406196, 0, 0}, - {503094540, 0, 0}, - {543621065, 0, 0}, - {626892406, 0, 0}, - {628544021, 0, 0}, - {827698488, 0, 0}, - {869050696, 0, 0}, - {907126242, 0, 0}, - {908777857, 0, 0}, - {910429472, 0, 0}, - {1113409935, 0, 0}, - {1294403159, 0, 0}, - {1296054774, 0, 0}, - {1297706389, 0, 0}, - {1322549027, 0, 0}, - {1784441183, 0, 0}, - {2080953106, 0, 0}, - {2194691858, 0, 0}, - {2448331885, 0, 0}, - {2466255445, 0, 0}, - {2468230023, 0, 0}, - {2547657777, 0, 0}, - {2549309392, 0, 0}, - {2550961007, 0, 0}, - {2894051250, 0, 0}, - {2929019254, 0, 0}, - {2934934694, 0, 0}, - {2936586309, 0, 0}, - {2938237924, 0, 0}, - {3077271274, 0, 0}, - {3092528578, 0, 0}, - {3094180193, 0, 0}, - {3094857332, 0, 0}, - {3095831808, 0, 0}, - {3183924418, 0, 0}, - {3207966516, 0, 0}, - {3282979782, 0, 0}, - {3433956341, 0, 0}, - {3561562003, 0, 0}, - {3563213618, 0, 0}, - {3564865233, 0, 0}, - {3585511591, 0, 0}, - {4028622909, 0, 0}, - {4039938779, 0, 0}, - {4050155669, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 16, 25}, - {0, 50, 1}, - {0, 42, 35}, - {0, 31, 41}, - {0, 4, 43}, - {0, 9, 10}, - {0, 3, 30}, - {0, 52, 47}, - {0, 12, 53}, - {0, 55, 54}, - {0, 36, 56}, - {0, 49, 57}, - {0, 6, 58}, - {0, 34, 33}, - {0, 59, 26}, - {0, 21, 32}, - {0, 60, 15}, - {0, 24, 61}, - {0, 62, 38}, - {0, 22, 2}, - {0, 37, 7}, - {0, 63, 46}, - {0, 14, 13}, - {0, 64, 5}, - {0, 65, 45}, - {0, 66, 19}, - {0, 18, 67}, - {0, 17, 20}, - {0, 68, 11}, - {0, 8, 69}, - {0, 70, 39}, - {0, 72, 71}, - {0, 74, 73}, - {0, 40, 75}, - {0, 76, 23}, - {0, 78, 77}, - {0, 29, 79}, - {0, 28, 80}, - {0, 27, 48}, - {0, 82, 81}, - {0, 51, 83}, - {0, 84, 44}, - {0, 86, 85}, - {0, 88, 87}, - {0, 90, 89}, - {0, 92, 91}, - {0, 94, 93}, - {0, 96, 95}, - {0, 98, 97}, - {0, 100, 99}, - })); - - codecs.emplace(std::pair(SpvOpTypePointer, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(65, { - {0, 0, 0}, - {119981689, 0, 0}, - {162255877, 0, 0}, - {451382997, 0, 0}, - {545678922, 0, 0}, - {679771963, 0, 0}, - {789872778, 0, 0}, - {1100599986, 0, 0}, - {1103903216, 0, 0}, - {1154919607, 0, 0}, - {1343794461, 0, 0}, - {1415510495, 0, 0}, - {1674803691, 0, 0}, - {1951208733, 0, 0}, - {1989520052, 0, 0}, - {2160380860, 0, 0}, - {2263349224, 0, 0}, - {2320303498, 0, 0}, - {2924146124, 0, 0}, - {2984325996, 0, 0}, - {3334207724, 0, 0}, - {3345288309, 0, 0}, - {3410158390, 0, 0}, - {3489360962, 0, 0}, - {3495967422, 0, 0}, - {3504981554, 0, 0}, - {3800912395, 0, 0}, - {3802564010, 0, 0}, - {3866587616, 0, 0}, - {3868239231, 0, 0}, - {3869890846, 0, 0}, - {3998230222, 0, 0}, - {4240893633, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 3}, - {0, 6, 24}, - {0, 11, 7}, - {0, 32, 21}, - {0, 27, 34}, - {0, 35, 25}, - {0, 36, 8}, - {0, 26, 31}, - {0, 14, 15}, - {0, 28, 37}, - {0, 1, 23}, - {0, 39, 38}, - {0, 12, 40}, - {0, 22, 41}, - {0, 10, 16}, - {0, 43, 42}, - {0, 29, 44}, - {0, 2, 45}, - {0, 46, 19}, - {0, 48, 47}, - {0, 18, 49}, - {0, 50, 30}, - {0, 9, 33}, - {0, 52, 51}, - {0, 54, 53}, - {0, 13, 55}, - {0, 17, 56}, - {0, 5, 57}, - {0, 59, 58}, - {0, 60, 20}, - {0, 62, 61}, - {0, 64, 63}, - })); - - codecs.emplace(std::pair(SpvOpTypePointer, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(99, { - {0, 0, 0}, - {75986790, 0, 0}, - {95470391, 0, 0}, - {170378107, 0, 0}, - {172029722, 0, 0}, - {204234270, 0, 0}, - {205885885, 0, 0}, - {244668133, 0, 0}, - {265778447, 0, 0}, - {616435646, 0, 0}, - {618087261, 0, 0}, - {753954113, 0, 0}, - {1000070091, 0, 0}, - {1308462133, 0, 0}, - {1671139745, 0, 0}, - {1774874546, 0, 0}, - {1776526161, 0, 0}, - {1887808856, 0, 0}, - {1889460471, 0, 0}, - {1917966999, 0, 0}, - {2044728014, 0, 0}, - {2192810893, 0, 0}, - {2293247016, 0, 0}, - {2503194620, 0, 0}, - {2605012269, 0, 0}, - {2608484640, 0, 0}, - {2615111110, 0, 0}, - {2668769415, 0, 0}, - {2759951687, 0, 0}, - {2761603302, 0, 0}, - {2856623532, 0, 0}, - {2945369269, 0, 0}, - {2956189845, 0, 0}, - {3085119011, 0, 0}, - {3367313400, 0, 0}, - {3447882276, 0, 0}, - {3633746133, 0, 0}, - {3635397748, 0, 0}, - {3710645347, 0, 0}, - {3712296962, 0, 0}, - {3715846592, 0, 0}, - {3727494858, 0, 0}, - {3747079365, 0, 0}, - {3748965853, 0, 0}, - {3750617468, 0, 0}, - {4018820793, 0, 0}, - {4022124023, 0, 0}, - {4024173916, 0, 0}, - {4215670524, 0, 0}, - {4217322139, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 10, 9}, - {0, 31, 24}, - {0, 40, 13}, - {0, 45, 33}, - {0, 34, 46}, - {0, 43, 38}, - {0, 44, 15}, - {0, 11, 30}, - {0, 21, 6}, - {0, 47, 3}, - {0, 51, 16}, - {0, 14, 52}, - {0, 8, 53}, - {0, 35, 5}, - {0, 55, 54}, - {0, 56, 26}, - {0, 20, 57}, - {0, 39, 19}, - {0, 59, 58}, - {0, 61, 60}, - {0, 4, 62}, - {0, 2, 63}, - {0, 25, 7}, - {0, 64, 27}, - {0, 12, 22}, - {0, 65, 48}, - {0, 41, 42}, - {0, 17, 23}, - {0, 49, 66}, - {0, 68, 67}, - {0, 70, 69}, - {0, 72, 71}, - {0, 74, 73}, - {0, 18, 75}, - {0, 37, 32}, - {0, 76, 36}, - {0, 78, 77}, - {0, 79, 28}, - {0, 81, 80}, - {0, 82, 29}, - {0, 84, 83}, - {0, 86, 85}, - {0, 88, 87}, - {0, 90, 89}, - {0, 91, 50}, - {0, 93, 92}, - {0, 95, 94}, - {0, 1, 96}, - {0, 98, 97}, - })); - - codecs.emplace(std::pair(SpvOpTypeFunction, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(27, { - {0, 0, 0}, - {545678922, 0, 0}, - {679771963, 0, 0}, - {899570100, 0, 0}, - {929101967, 0, 0}, - {1100599986, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3056042030, 0, 0}, - {3334207724, 0, 0}, - {3357250579, 0, 0}, - {3705139860, 0, 0}, - {3800912395, 0, 0}, - {3802564010, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 5, 3}, - {0, 10, 13}, - {0, 4, 15}, - {0, 16, 11}, - {0, 17, 1}, - {0, 14, 12}, - {0, 19, 18}, - {0, 21, 20}, - {0, 7, 6}, - {0, 9, 22}, - {0, 24, 23}, - {0, 25, 2}, - {0, 26, 8}, - })); - - codecs.emplace(std::pair(SpvOpTypeFunction, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(57, { - {0, 0, 0}, - {283209196, 0, 0}, - {436416061, 0, 0}, - {679771963, 0, 0}, - {789872778, 0, 0}, - {815757910, 0, 0}, - {827698488, 0, 0}, - {1164221089, 0, 0}, - {1294403159, 0, 0}, - {1296054774, 0, 0}, - {1297706389, 0, 0}, - {1525861001, 0, 0}, - {1579585816, 0, 0}, - {1675764636, 0, 0}, - {1824016656, 0, 0}, - {1951208733, 0, 0}, - {1991787192, 0, 0}, - {2180701723, 0, 0}, - {2194691858, 0, 0}, - {2320303498, 0, 0}, - {2881886868, 0, 0}, - {2926633629, 0, 0}, - {3249265647, 0, 0}, - {3334207724, 0, 0}, - {3472123498, 0, 0}, - {3674863070, 0, 0}, - {4050155669, 0, 0}, - {4141567741, 0, 0}, - {4155122613, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 24, 7}, - {0, 17, 1}, - {0, 4, 15}, - {0, 11, 16}, - {0, 28, 30}, - {0, 25, 20}, - {0, 14, 31}, - {0, 32, 26}, - {0, 12, 5}, - {0, 2, 22}, - {0, 33, 13}, - {0, 35, 34}, - {0, 37, 36}, - {0, 39, 38}, - {0, 40, 21}, - {0, 29, 18}, - {0, 27, 41}, - {0, 43, 42}, - {0, 19, 44}, - {0, 45, 23}, - {0, 6, 3}, - {0, 47, 46}, - {0, 49, 48}, - {0, 51, 50}, - {0, 10, 8}, - {0, 53, 52}, - {0, 9, 54}, - {0, 56, 55}, - })); - - codecs.emplace(std::pair(SpvOpTypeFunction, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(17, { - {0, 0, 0}, - {679771963, 0, 0}, - {827698488, 0, 0}, - {1294403159, 0, 0}, - {1296054774, 0, 0}, - {1297706389, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 8, 9}, - {0, 10, 6}, - {0, 1, 5}, - {0, 11, 3}, - {0, 12, 7}, - {0, 13, 2}, - {0, 15, 14}, - {0, 16, 4}, - })); - - codecs.emplace(std::pair(SpvOpTypeFunction, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(17, { - {0, 0, 0}, - {679771963, 0, 0}, - {827698488, 0, 0}, - {1294403159, 0, 0}, - {1296054774, 0, 0}, - {1951208733, 0, 0}, - {2194691858, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 8, 5}, - {0, 10, 9}, - {0, 11, 6}, - {0, 7, 12}, - {0, 1, 3}, - {0, 2, 13}, - {0, 15, 14}, - {0, 4, 16}, - })); - - codecs.emplace(std::pair(SpvOpTypeFunction, 4), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(11, { - {0, 0, 0}, - {827698488, 0, 0}, - {1294403159, 0, 0}, - {1296054774, 0, 0}, - {1297706389, 0, 0}, - {1951208733, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 6}, - {0, 5, 7}, - {0, 2, 8}, - {0, 1, 9}, - {0, 10, 3}, - })); - - codecs.emplace(std::pair(SpvOpTypeFunction, 5), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(11, { - {0, 0, 0}, - {827698488, 0, 0}, - {1294403159, 0, 0}, - {1296054774, 0, 0}, - {1951208733, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 6}, - {0, 4, 7}, - {0, 8, 5}, - {0, 3, 9}, - {0, 1, 10}, - })); - - codecs.emplace(std::pair(SpvOpTypeFunction, 6), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {789872778, 0, 0}, - {827698488, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 5, 1}, - {0, 4, 6}, - {0, 3, 7}, - {0, 2, 8}, - })); - - codecs.emplace(std::pair(SpvOpTypeFunction, 7), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {543621065, 0, 0}, - {827698488, 0, 0}, - {1951208733, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 4}, - {0, 1, 5}, - {0, 2, 6}, - })); - - codecs.emplace(std::pair(SpvOpTypeFunction, 8), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {827698488, 0, 0}, - {1951208733, 0, 0}, - {3095831808, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 4}, - {0, 3, 5}, - {0, 1, 6}, - })); - - codecs.emplace(std::pair(SpvOpTypeFunction, 9), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {1296054774, 0, 0}, - {1951208733, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 2}, - {0, 1, 4}, - })); - - codecs.emplace(std::pair(SpvOpTypeFunction, 10), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {1296054774, 0, 0}, - {2320303498, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 2}, - {0, 1, 4}, - })); - - codecs.emplace(std::pair(SpvOpTypeFunction, 11), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {789872778, 0, 0}, - {1951208733, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 2}, - {0, 4, 1}, - })); - - codecs.emplace(std::pair(SpvOpTypeFunction, 12), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {789872778, 0, 0}, - {1951208733, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 1}, - {0, 4, 3}, - })); - - codecs.emplace(std::pair(SpvOpTypeFunction, 13), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {1951208733, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 1}, - })); - - codecs.emplace(std::pair(SpvOpTypeFunction, 14), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {1951208733, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 1}, - })); - - codecs.emplace(std::pair(SpvOpTypeFunction, 15), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {789872778, 0, 0}, - {1951208733, 0, 0}, - {2430404313, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 4}, - {0, 1, 5}, - {0, 2, 6}, - })); - - codecs.emplace(std::pair(SpvOpConstant, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(183, { - {0, 0, 0}, - {51041423, 0, 0}, - {52882140, 0, 0}, - {72782198, 0, 0}, - {142465290, 0, 0}, - {144116905, 0, 0}, - {158160339, 0, 0}, - {169135842, 0, 0}, - {210116709, 0, 0}, - {290391815, 0, 0}, - {296981500, 0, 0}, - {385229009, 0, 0}, - {438318340, 0, 0}, - {529742207, 0, 0}, - {628331516, 0, 0}, - {677668732, 0, 0}, - {778500192, 0, 0}, - {825595257, 0, 0}, - {910398460, 0, 0}, - {917019124, 0, 0}, - {959681532, 0, 0}, - {1031290113, 0, 0}, - {1039111164, 0, 0}, - {1064945649, 0, 0}, - {1087394637, 0, 0}, - {1092948665, 0, 0}, - {1156369516, 0, 0}, - {1158021131, 0, 0}, - {1172110445, 0, 0}, - {1304296041, 0, 0}, - {1400019344, 0, 0}, - {1450415100, 0, 0}, - {1452222566, 0, 0}, - {1543646433, 0, 0}, - {1543672828, 0, 0}, - {1612361408, 0, 0}, - {1622381564, 0, 0}, - {1691572958, 0, 0}, - {1755648697, 0, 0}, - {1782996825, 0, 0}, - {1784648440, 0, 0}, - {1930923350, 0, 0}, - {1939359710, 0, 0}, - {1971252067, 0, 0}, - {1979847999, 0, 0}, - {2078849875, 0, 0}, - {2113115132, 0, 0}, - {2135340676, 0, 0}, - {2170273742, 0, 0}, - {2268204687, 0, 0}, - {2285081596, 0, 0}, - {2318200267, 0, 0}, - {2321729979, 0, 0}, - {2326636627, 0, 0}, - {2444465148, 0, 0}, - {2466126792, 0, 0}, - {2490492987, 0, 0}, - {2524697596, 0, 0}, - {2557550659, 0, 0}, - {2678954464, 0, 0}, - {2705477184, 0, 0}, - {2715370488, 0, 0}, - {2732195517, 0, 0}, - {2775815164, 0, 0}, - {2796901051, 0, 0}, - {2798552666, 0, 0}, - {2855506940, 0, 0}, - {2860348412, 0, 0}, - {2922615804, 0, 0}, - {2937761472, 0, 0}, - {2944827576, 0, 0}, - {3092754101, 0, 0}, - {3107165180, 0, 0}, - {3168953855, 0, 0}, - {3184177968, 0, 0}, - {3202349435, 0, 0}, - {3266548732, 0, 0}, - {3332104493, 0, 0}, - {3362723943, 0, 0}, - {3571454885, 0, 0}, - {3712763835, 0, 0}, - {3743748793, 0, 0}, - {3810805277, 0, 0}, - {3912967080, 0, 0}, - {3929248764, 0, 0}, - {3958731802, 0, 0}, - {3997952447, 0, 0}, - {4016096296, 0, 0}, - {4106658327, 0, 0}, - {4172568578, 0, 0}, - {4198082194, 0, 0}, - {4248015868, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 35, 16}, - {0, 49, 42}, - {0, 86, 69}, - {0, 53, 30}, - {0, 45, 89}, - {0, 50, 68}, - {0, 73, 71}, - {0, 17, 46}, - {0, 14, 81}, - {0, 63, 44}, - {0, 12, 3}, - {0, 72, 31}, - {0, 55, 67}, - {0, 36, 19}, - {0, 22, 88}, - {0, 9, 70}, - {0, 93, 23}, - {0, 95, 94}, - {0, 47, 91}, - {0, 34, 32}, - {0, 97, 96}, - {0, 41, 61}, - {0, 99, 98}, - {0, 37, 1}, - {0, 77, 100}, - {0, 51, 60}, - {0, 101, 79}, - {0, 6, 2}, - {0, 11, 7}, - {0, 24, 21}, - {0, 43, 28}, - {0, 59, 56}, - {0, 75, 62}, - {0, 80, 78}, - {0, 87, 83}, - {0, 18, 15}, - {0, 102, 38}, - {0, 104, 103}, - {0, 85, 90}, - {0, 76, 25}, - {0, 29, 105}, - {0, 107, 106}, - {0, 58, 52}, - {0, 109, 108}, - {0, 57, 110}, - {0, 112, 111}, - {0, 114, 113}, - {0, 115, 33}, - {0, 74, 116}, - {0, 118, 117}, - {0, 120, 119}, - {0, 122, 121}, - {0, 124, 123}, - {0, 126, 125}, - {0, 128, 127}, - {0, 130, 129}, - {0, 131, 13}, - {0, 54, 27}, - {0, 133, 132}, - {0, 48, 40}, - {0, 5, 8}, - {0, 82, 134}, - {0, 26, 135}, - {0, 39, 4}, - {0, 136, 64}, - {0, 138, 137}, - {0, 140, 139}, - {0, 84, 141}, - {0, 143, 142}, - {0, 145, 144}, - {0, 147, 146}, - {0, 149, 148}, - {0, 20, 150}, - {0, 65, 151}, - {0, 66, 152}, - {0, 153, 10}, - {0, 155, 154}, - {0, 157, 156}, - {0, 159, 158}, - {0, 161, 160}, - {0, 163, 162}, - {0, 165, 164}, - {0, 167, 166}, - {0, 169, 168}, - {0, 170, 92}, - {0, 172, 171}, - {0, 174, 173}, - {0, 176, 175}, - {0, 178, 177}, - {0, 180, 179}, - {0, 182, 181}, - })); - - codecs.emplace(std::pair(SpvOpConstant, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {679771963, 0, 0}, - {1247793383, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 5}, - {0, 4, 6}, - {0, 1, 3}, - {0, 8, 7}, - })); - - codecs.emplace(std::pair(SpvOpConstantComposite, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(83, { - {0, 0, 0}, - {15502752, 0, 0}, - {46736908, 0, 0}, - {139011596, 0, 0}, - {149720480, 0, 0}, - {249378857, 0, 0}, - {251209228, 0, 0}, - {503145996, 0, 0}, - {836581417, 0, 0}, - {882718761, 0, 0}, - {1289566249, 0, 0}, - {1325348861, 0, 0}, - {1558001705, 0, 0}, - {1646147798, 0, 0}, - {1679946323, 0, 0}, - {1766401548, 0, 0}, - {1992893964, 0, 0}, - {2123388694, 0, 0}, - {2162986400, 0, 0}, - {2580096524, 0, 0}, - {2598189097, 0, 0}, - {2683080096, 0, 0}, - {2698156268, 0, 0}, - {2763960513, 0, 0}, - {3015046341, 0, 0}, - {3133016299, 0, 0}, - {3251128023, 0, 0}, - {3504158761, 0, 0}, - {3535289452, 0, 0}, - {3536941067, 0, 0}, - {3538592682, 0, 0}, - {3540244297, 0, 0}, - {3541895912, 0, 0}, - {3570219049, 0, 0}, - {3653838348, 0, 0}, - {3764205609, 0, 0}, - {3882634684, 0, 0}, - {3913885196, 0, 0}, - {3982047273, 0, 0}, - {4024252457, 0, 0}, - {4243119782, 0, 0}, - {4255182614, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 8, 4}, - {0, 39, 2}, - {0, 38, 10}, - {0, 29, 41}, - {0, 23, 28}, - {0, 9, 24}, - {0, 44, 43}, - {0, 45, 6}, - {0, 20, 12}, - {0, 18, 33}, - {0, 19, 16}, - {0, 7, 46}, - {0, 48, 47}, - {0, 5, 49}, - {0, 13, 11}, - {0, 17, 14}, - {0, 25, 22}, - {0, 40, 36}, - {0, 1, 50}, - {0, 31, 30}, - {0, 51, 32}, - {0, 42, 52}, - {0, 54, 53}, - {0, 55, 15}, - {0, 37, 56}, - {0, 57, 34}, - {0, 59, 58}, - {0, 61, 60}, - {0, 35, 21}, - {0, 62, 26}, - {0, 64, 63}, - {0, 65, 27}, - {0, 3, 66}, - {0, 68, 67}, - {0, 70, 69}, - {0, 72, 71}, - {0, 74, 73}, - {0, 76, 75}, - {0, 78, 77}, - {0, 80, 79}, - {0, 82, 81}, - })); - - codecs.emplace(std::pair(SpvOpConstantComposite, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(65, { - {0, 0, 0}, - {142465290, 0, 0}, - {158160339, 0, 0}, - {169135842, 0, 0}, - {210116709, 0, 0}, - {296981500, 0, 0}, - {615748604, 0, 0}, - {910398460, 0, 0}, - {959681532, 0, 0}, - {1039111164, 0, 0}, - {1087394637, 0, 0}, - {1156369516, 0, 0}, - {1450415100, 0, 0}, - {1543672828, 0, 0}, - {2100532220, 0, 0}, - {2170273742, 0, 0}, - {2285081596, 0, 0}, - {2326636627, 0, 0}, - {2444465148, 0, 0}, - {2732195517, 0, 0}, - {2763232252, 0, 0}, - {2796901051, 0, 0}, - {2855506940, 0, 0}, - {2922615804, 0, 0}, - {2937761472, 0, 0}, - {3202349435, 0, 0}, - {3362723943, 0, 0}, - {3712763835, 0, 0}, - {3810805277, 0, 0}, - {3929248764, 0, 0}, - {4016096296, 0, 0}, - {4172568578, 0, 0}, - {4248015868, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 12, 23}, - {0, 13, 6}, - {0, 20, 14}, - {0, 15, 24}, - {0, 17, 28}, - {0, 16, 31}, - {0, 7, 34}, - {0, 9, 32}, - {0, 36, 35}, - {0, 38, 37}, - {0, 40, 39}, - {0, 2, 8}, - {0, 10, 3}, - {0, 25, 19}, - {0, 27, 26}, - {0, 33, 30}, - {0, 11, 41}, - {0, 1, 21}, - {0, 18, 42}, - {0, 44, 43}, - {0, 46, 45}, - {0, 48, 47}, - {0, 29, 49}, - {0, 4, 50}, - {0, 52, 51}, - {0, 54, 53}, - {0, 56, 55}, - {0, 58, 57}, - {0, 59, 5}, - {0, 61, 60}, - {0, 62, 22}, - {0, 64, 63}, - })); - - codecs.emplace(std::pair(SpvOpConstantComposite, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(57, { - {0, 0, 0}, - {52882140, 0, 0}, - {210116709, 0, 0}, - {296981500, 0, 0}, - {385229009, 0, 0}, - {615748604, 0, 0}, - {910398460, 0, 0}, - {959681532, 0, 0}, - {1031290113, 0, 0}, - {1039111164, 0, 0}, - {1172110445, 0, 0}, - {1450415100, 0, 0}, - {1543672828, 0, 0}, - {1622381564, 0, 0}, - {1782996825, 0, 0}, - {1971252067, 0, 0}, - {2100532220, 0, 0}, - {2268204687, 0, 0}, - {2326636627, 0, 0}, - {2444465148, 0, 0}, - {2490492987, 0, 0}, - {2678954464, 0, 0}, - {2763232252, 0, 0}, - {2855506940, 0, 0}, - {2922615804, 0, 0}, - {3912967080, 0, 0}, - {3929248764, 0, 0}, - {4172568578, 0, 0}, - {4248015868, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 11, 24}, - {0, 12, 5}, - {0, 22, 16}, - {0, 18, 17}, - {0, 30, 27}, - {0, 6, 13}, - {0, 9, 28}, - {0, 32, 31}, - {0, 34, 33}, - {0, 7, 35}, - {0, 4, 1}, - {0, 10, 8}, - {0, 20, 15}, - {0, 25, 21}, - {0, 36, 29}, - {0, 19, 37}, - {0, 39, 38}, - {0, 41, 40}, - {0, 43, 42}, - {0, 26, 44}, - {0, 45, 2}, - {0, 47, 46}, - {0, 49, 48}, - {0, 50, 14}, - {0, 51, 3}, - {0, 53, 52}, - {0, 54, 23}, - {0, 56, 55}, - })); - - codecs.emplace(std::pair(SpvOpConstantComposite, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(39, { - {0, 0, 0}, - {210116709, 0, 0}, - {296981500, 0, 0}, - {615748604, 0, 0}, - {910398460, 0, 0}, - {959681532, 0, 0}, - {1039111164, 0, 0}, - {1092948665, 0, 0}, - {1450415100, 0, 0}, - {1543672828, 0, 0}, - {1612361408, 0, 0}, - {2100532220, 0, 0}, - {2326636627, 0, 0}, - {2444465148, 0, 0}, - {2524697596, 0, 0}, - {2763232252, 0, 0}, - {2855506940, 0, 0}, - {3929248764, 0, 0}, - {4172568578, 0, 0}, - {4248015868, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 8, 7}, - {0, 9, 3}, - {0, 15, 11}, - {0, 10, 21}, - {0, 18, 12}, - {0, 4, 20}, - {0, 22, 19}, - {0, 23, 6}, - {0, 14, 24}, - {0, 5, 25}, - {0, 27, 26}, - {0, 28, 17}, - {0, 30, 29}, - {0, 31, 13}, - {0, 1, 32}, - {0, 34, 33}, - {0, 16, 35}, - {0, 2, 36}, - {0, 38, 37}, - })); - - codecs.emplace(std::pair(SpvOpConstantComposite, 4), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(35, { - {0, 0, 0}, - {296981500, 0, 0}, - {615748604, 0, 0}, - {673708384, 0, 0}, - {959681532, 0, 0}, - {1039111164, 0, 0}, - {1450415100, 0, 0}, - {1543672828, 0, 0}, - {1939359710, 0, 0}, - {2100532220, 0, 0}, - {2113115132, 0, 0}, - {2326636627, 0, 0}, - {2444465148, 0, 0}, - {2763232252, 0, 0}, - {2855506940, 0, 0}, - {3929248764, 0, 0}, - {4172568578, 0, 0}, - {4248015868, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 18, 3}, - {0, 6, 19}, - {0, 12, 4}, - {0, 17, 2}, - {0, 9, 7}, - {0, 20, 13}, - {0, 11, 8}, - {0, 10, 16}, - {0, 21, 15}, - {0, 5, 22}, - {0, 24, 23}, - {0, 26, 25}, - {0, 28, 27}, - {0, 29, 1}, - {0, 31, 30}, - {0, 33, 32}, - {0, 34, 14}, - })); - - codecs.emplace(std::pair(SpvOpConstantComposite, 5), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(23, { - {0, 0, 0}, - {545678922, 0, 0}, - {679771963, 0, 0}, - {929101967, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3056042030, 0, 0}, - {3334207724, 0, 0}, - {3357250579, 0, 0}, - {3705139860, 0, 0}, - {3800912395, 0, 0}, - {3802564010, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 8, 11}, - {0, 9, 3}, - {0, 1, 13}, - {0, 14, 10}, - {0, 12, 15}, - {0, 17, 16}, - {0, 18, 4}, - {0, 7, 5}, - {0, 20, 19}, - {0, 2, 21}, - {0, 22, 6}, - })); - - codecs.emplace(std::pair(SpvOpFunction, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(89, { - {0, 0, 0}, - {35240468, 0, 0}, - {123060826, 0, 0}, - {184634770, 0, 0}, - {359054425, 0, 0}, - {459968607, 0, 0}, - {619875033, 0, 0}, - {904486530, 0, 0}, - {945128292, 0, 0}, - {950731750, 0, 0}, - {1058429216, 0, 0}, - {1182296898, 0, 0}, - {1238120570, 0, 0}, - {1429389803, 0, 0}, - {1652168174, 0, 0}, - {1717510093, 0, 0}, - {1766422419, 0, 0}, - {1775308984, 0, 0}, - {1776629361, 0, 0}, - {1824526196, 0, 0}, - {1957265068, 0, 0}, - {1998433745, 0, 0}, - {2055664760, 0, 0}, - {2303184249, 0, 0}, - {2451531615, 0, 0}, - {2507457870, 0, 0}, - {2550501832, 0, 0}, - {2590402790, 0, 0}, - {2649103430, 0, 0}, - {2780190687, 0, 0}, - {2831059514, 0, 0}, - {3167253437, 0, 0}, - {3269075805, 0, 0}, - {3323202731, 0, 0}, - {3361419439, 0, 0}, - {3464197236, 0, 0}, - {3472029049, 0, 0}, - {3518630848, 0, 0}, - {3604842236, 0, 0}, - {3653985133, 0, 0}, - {4091916710, 0, 0}, - {4121643374, 0, 0}, - {4185590212, 0, 0}, - {4233562270, 0, 0}, - {4235213885, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 6, 40}, - {0, 14, 31}, - {0, 7, 9}, - {0, 29, 27}, - {0, 18, 44}, - {0, 8, 5}, - {0, 10, 3}, - {0, 41, 37}, - {0, 42, 35}, - {0, 2, 1}, - {0, 47, 46}, - {0, 48, 4}, - {0, 11, 49}, - {0, 50, 36}, - {0, 19, 51}, - {0, 53, 52}, - {0, 55, 54}, - {0, 15, 12}, - {0, 26, 16}, - {0, 56, 21}, - {0, 25, 33}, - {0, 43, 24}, - {0, 57, 39}, - {0, 59, 58}, - {0, 61, 60}, - {0, 62, 34}, - {0, 64, 63}, - {0, 17, 30}, - {0, 66, 65}, - {0, 20, 67}, - {0, 13, 68}, - {0, 28, 69}, - {0, 70, 32}, - {0, 72, 71}, - {0, 73, 22}, - {0, 75, 74}, - {0, 77, 76}, - {0, 79, 78}, - {0, 80, 23}, - {0, 45, 81}, - {0, 83, 82}, - {0, 85, 84}, - {0, 38, 86}, - {0, 88, 87}, - })); - - codecs.emplace(std::pair(SpvOpFunction, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(87, { - {0, 0, 0}, - {75986790, 0, 0}, - {95470391, 0, 0}, - {170378107, 0, 0}, - {172029722, 0, 0}, - {204234270, 0, 0}, - {205885885, 0, 0}, - {244668133, 0, 0}, - {265778447, 0, 0}, - {753954113, 0, 0}, - {1000070091, 0, 0}, - {1671139745, 0, 0}, - {1774874546, 0, 0}, - {1776526161, 0, 0}, - {1887808856, 0, 0}, - {1889460471, 0, 0}, - {1917966999, 0, 0}, - {2044728014, 0, 0}, - {2192810893, 0, 0}, - {2293247016, 0, 0}, - {2503194620, 0, 0}, - {2608484640, 0, 0}, - {2615111110, 0, 0}, - {2668769415, 0, 0}, - {2759951687, 0, 0}, - {2761603302, 0, 0}, - {2856623532, 0, 0}, - {2956189845, 0, 0}, - {3085119011, 0, 0}, - {3367313400, 0, 0}, - {3447882276, 0, 0}, - {3633746133, 0, 0}, - {3635397748, 0, 0}, - {3710645347, 0, 0}, - {3712296962, 0, 0}, - {3727494858, 0, 0}, - {3747079365, 0, 0}, - {3748965853, 0, 0}, - {3750617468, 0, 0}, - {4018820793, 0, 0}, - {4022124023, 0, 0}, - {4024173916, 0, 0}, - {4215670524, 0, 0}, - {4217322139, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 39, 28}, - {0, 29, 40}, - {0, 37, 33}, - {0, 38, 12}, - {0, 9, 26}, - {0, 18, 6}, - {0, 41, 3}, - {0, 11, 13}, - {0, 5, 8}, - {0, 45, 30}, - {0, 22, 46}, - {0, 48, 47}, - {0, 16, 17}, - {0, 34, 49}, - {0, 51, 50}, - {0, 53, 52}, - {0, 7, 2}, - {0, 23, 21}, - {0, 54, 10}, - {0, 20, 36}, - {0, 55, 35}, - {0, 56, 4}, - {0, 43, 57}, - {0, 59, 58}, - {0, 60, 42}, - {0, 62, 61}, - {0, 63, 15}, - {0, 64, 31}, - {0, 14, 65}, - {0, 66, 24}, - {0, 67, 32}, - {0, 68, 19}, - {0, 70, 69}, - {0, 71, 27}, - {0, 73, 72}, - {0, 75, 74}, - {0, 77, 76}, - {0, 78, 25}, - {0, 44, 79}, - {0, 81, 80}, - {0, 83, 82}, - {0, 1, 84}, - {0, 86, 85}, - })); - - codecs.emplace(std::pair(SpvOpFunction, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(41, { - {0, 0, 0}, - {436416061, 0, 0}, - {543621065, 0, 0}, - {679771963, 0, 0}, - {815757910, 0, 0}, - {827698488, 0, 0}, - {1294403159, 0, 0}, - {1296054774, 0, 0}, - {1297706389, 0, 0}, - {1579585816, 0, 0}, - {1675764636, 0, 0}, - {1824016656, 0, 0}, - {1951208733, 0, 0}, - {2194691858, 0, 0}, - {2320303498, 0, 0}, - {2926633629, 0, 0}, - {3095831808, 0, 0}, - {3249265647, 0, 0}, - {3334207724, 0, 0}, - {4050155669, 0, 0}, - {4141567741, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 11}, - {0, 19, 16}, - {0, 9, 4}, - {0, 1, 17}, - {0, 22, 10}, - {0, 24, 23}, - {0, 15, 25}, - {0, 13, 26}, - {0, 27, 20}, - {0, 12, 28}, - {0, 30, 29}, - {0, 31, 18}, - {0, 3, 21}, - {0, 32, 14}, - {0, 34, 33}, - {0, 35, 8}, - {0, 5, 6}, - {0, 37, 36}, - {0, 39, 38}, - {0, 40, 7}, - })); - - codecs.emplace(std::pair(SpvOpFunctionParameter, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(41, { - {0, 0, 0}, - {522971108, 0, 0}, - {615341051, 0, 0}, - {718301639, 0, 0}, - {985750227, 0, 0}, - {1395113939, 0, 0}, - {1510333659, 0, 0}, - {1642805350, 0, 0}, - {1846856260, 0, 0}, - {1957218950, 0, 0}, - {1977038330, 0, 0}, - {1978689945, 0, 0}, - {1980341560, 0, 0}, - {2262220987, 0, 0}, - {2674422363, 0, 0}, - {3197739982, 0, 0}, - {3465954368, 0, 0}, - {3941049054, 0, 0}, - {3945795573, 0, 0}, - {4080527786, 0, 0}, - {4154758669, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 17}, - {0, 4, 15}, - {0, 8, 7}, - {0, 2, 20}, - {0, 22, 19}, - {0, 24, 23}, - {0, 14, 25}, - {0, 16, 26}, - {0, 27, 13}, - {0, 6, 28}, - {0, 30, 29}, - {0, 31, 10}, - {0, 11, 21}, - {0, 32, 12}, - {0, 34, 33}, - {0, 35, 5}, - {0, 9, 18}, - {0, 37, 36}, - {0, 39, 38}, - {0, 40, 1}, - })); - - codecs.emplace(std::pair(SpvOpFunctionParameter, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(27, { - {0, 0, 0}, - {545678922, 0, 0}, - {679771963, 0, 0}, - {899570100, 0, 0}, - {929101967, 0, 0}, - {1100599986, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3056042030, 0, 0}, - {3334207724, 0, 0}, - {3357250579, 0, 0}, - {3705139860, 0, 0}, - {3800912395, 0, 0}, - {3802564010, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 5, 3}, - {0, 10, 13}, - {0, 4, 15}, - {0, 16, 11}, - {0, 17, 1}, - {0, 14, 12}, - {0, 19, 18}, - {0, 21, 20}, - {0, 22, 8}, - {0, 7, 6}, - {0, 23, 9}, - {0, 25, 24}, - {0, 26, 2}, - })); - - codecs.emplace(std::pair(SpvOpFunctionCall, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(115, { - {0, 0, 0}, - {57149555, 0, 0}, - {86116519, 0, 0}, - {168339452, 0, 0}, - {181902171, 0, 0}, - {284226441, 0, 0}, - {314809953, 0, 0}, - {330249537, 0, 0}, - {527665290, 0, 0}, - {545363837, 0, 0}, - {707478563, 0, 0}, - {740921498, 0, 0}, - {807276090, 0, 0}, - {824323032, 0, 0}, - {835458563, 0, 0}, - {1162127370, 0, 0}, - {1245448751, 0, 0}, - {1277245109, 0, 0}, - {1375043498, 0, 0}, - {1380991098, 0, 0}, - {1603937321, 0, 0}, - {1708264968, 0, 0}, - {1717555224, 0, 0}, - {1765126703, 0, 0}, - {1838993983, 0, 0}, - {1949856502, 0, 0}, - {2108571893, 0, 0}, - {2110223508, 0, 0}, - {2293637521, 0, 0}, - {2377112119, 0, 0}, - {2378763734, 0, 0}, - {2512398201, 0, 0}, - {2516325050, 0, 0}, - {2645135839, 0, 0}, - {2708915136, 0, 0}, - {2894979602, 0, 0}, - {2903897222, 0, 0}, - {2976581453, 0, 0}, - {3054834317, 0, 0}, - {3075866530, 0, 0}, - {3085157904, 0, 0}, - {3242843022, 0, 0}, - {3266028549, 0, 0}, - {3296691317, 0, 0}, - {3299488628, 0, 0}, - {3322500634, 0, 0}, - {3345707173, 0, 0}, - {3536390697, 0, 0}, - {3584683259, 0, 0}, - {3647606635, 0, 0}, - {3760372982, 0, 0}, - {3823959661, 0, 0}, - {3839389658, 0, 0}, - {4124281183, 0, 0}, - {4130950286, 0, 0}, - {4169878842, 0, 0}, - {4174489262, 0, 0}, - {4237497041, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 17, 23}, - {0, 37, 8}, - {0, 45, 39}, - {0, 41, 14}, - {0, 48, 43}, - {0, 40, 31}, - {0, 19, 29}, - {0, 53, 26}, - {0, 10, 5}, - {0, 50, 24}, - {0, 27, 3}, - {0, 59, 32}, - {0, 51, 18}, - {0, 52, 55}, - {0, 60, 57}, - {0, 62, 61}, - {0, 36, 33}, - {0, 64, 63}, - {0, 65, 22}, - {0, 66, 46}, - {0, 6, 67}, - {0, 68, 13}, - {0, 21, 44}, - {0, 1, 69}, - {0, 30, 11}, - {0, 71, 70}, - {0, 12, 72}, - {0, 74, 73}, - {0, 76, 75}, - {0, 16, 2}, - {0, 49, 35}, - {0, 77, 9}, - {0, 42, 28}, - {0, 15, 78}, - {0, 80, 79}, - {0, 82, 81}, - {0, 47, 83}, - {0, 85, 84}, - {0, 87, 86}, - {0, 89, 88}, - {0, 20, 38}, - {0, 54, 90}, - {0, 34, 91}, - {0, 93, 92}, - {0, 25, 94}, - {0, 95, 7}, - {0, 97, 96}, - {0, 56, 98}, - {0, 100, 99}, - {0, 102, 101}, - {0, 104, 103}, - {0, 4, 105}, - {0, 107, 106}, - {0, 58, 108}, - {0, 110, 109}, - {0, 112, 111}, - {0, 114, 113}, - })); - - codecs.emplace(std::pair(SpvOpFunctionCall, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(81, { - {0, 0, 0}, - {35240468, 0, 0}, - {36096192, 0, 0}, - {123060826, 0, 0}, - {184634770, 0, 0}, - {459968607, 0, 0}, - {619875033, 0, 0}, - {950731750, 0, 0}, - {1058429216, 0, 0}, - {1182296898, 0, 0}, - {1238120570, 0, 0}, - {1271484400, 0, 0}, - {1429389803, 0, 0}, - {1717510093, 0, 0}, - {1766422419, 0, 0}, - {1775308984, 0, 0}, - {1817271123, 0, 0}, - {1917336504, 0, 0}, - {1957265068, 0, 0}, - {1998433745, 0, 0}, - {2055664760, 0, 0}, - {2303184249, 0, 0}, - {2308565678, 0, 0}, - {2451531615, 0, 0}, - {2496297824, 0, 0}, - {2507457870, 0, 0}, - {2550501832, 0, 0}, - {2590402790, 0, 0}, - {2649103430, 0, 0}, - {2831059514, 0, 0}, - {2836440943, 0, 0}, - {3269075805, 0, 0}, - {3361419439, 0, 0}, - {3457269042, 0, 0}, - {3464197236, 0, 0}, - {3472029049, 0, 0}, - {3518630848, 0, 0}, - {3587381650, 0, 0}, - {3653985133, 0, 0}, - {4185590212, 0, 0}, - {4233562270, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 40, 37}, - {0, 22, 30}, - {0, 2, 7}, - {0, 24, 11}, - {0, 16, 33}, - {0, 6, 34}, - {0, 42, 27}, - {0, 5, 43}, - {0, 4, 44}, - {0, 36, 8}, - {0, 39, 45}, - {0, 46, 1}, - {0, 3, 47}, - {0, 48, 23}, - {0, 49, 9}, - {0, 50, 35}, - {0, 52, 51}, - {0, 32, 53}, - {0, 13, 10}, - {0, 26, 14}, - {0, 19, 54}, - {0, 55, 25}, - {0, 56, 38}, - {0, 17, 57}, - {0, 59, 58}, - {0, 61, 60}, - {0, 62, 29}, - {0, 12, 15}, - {0, 18, 63}, - {0, 28, 64}, - {0, 65, 31}, - {0, 67, 66}, - {0, 20, 41}, - {0, 69, 68}, - {0, 71, 70}, - {0, 21, 72}, - {0, 74, 73}, - {0, 76, 75}, - {0, 78, 77}, - {0, 80, 79}, - })); - - codecs.emplace(std::pair(SpvOpFunctionCall, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(61, { - {0, 0, 0}, - {37459569, 0, 0}, - {162167595, 0, 0}, - {535067202, 0, 0}, - {701281393, 0, 0}, - {837715723, 0, 0}, - {1320550031, 0, 0}, - {1630583316, 0, 0}, - {1913735398, 0, 0}, - {1918481917, 0, 0}, - {1955871800, 0, 0}, - {1977038330, 0, 0}, - {2053214130, 0, 0}, - {2443959748, 0, 0}, - {2564745684, 0, 0}, - {2622612602, 0, 0}, - {2677252364, 0, 0}, - {2736026107, 0, 0}, - {2790624748, 0, 0}, - {2882994691, 0, 0}, - {2888125966, 0, 0}, - {2970183398, 0, 0}, - {3253403867, 0, 0}, - {3427283542, 0, 0}, - {3570411982, 0, 0}, - {3619787319, 0, 0}, - {3662767579, 0, 0}, - {3884846406, 0, 0}, - {3910458990, 0, 0}, - {3927915220, 0, 0}, - {4224872590, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 5, 20}, - {0, 6, 25}, - {0, 23, 3}, - {0, 2, 4}, - {0, 14, 17}, - {0, 11, 8}, - {0, 27, 10}, - {0, 19, 28}, - {0, 12, 16}, - {0, 33, 32}, - {0, 35, 34}, - {0, 37, 36}, - {0, 39, 38}, - {0, 40, 15}, - {0, 41, 7}, - {0, 1, 21}, - {0, 24, 13}, - {0, 29, 42}, - {0, 44, 43}, - {0, 22, 45}, - {0, 47, 46}, - {0, 49, 48}, - {0, 50, 30}, - {0, 31, 51}, - {0, 53, 52}, - {0, 55, 54}, - {0, 56, 9}, - {0, 57, 26}, - {0, 59, 58}, - {0, 60, 18}, - })); - - codecs.emplace(std::pair(SpvOpFunctionCall, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(39, { - {0, 0, 0}, - {744062262, 0, 0}, - {810488476, 0, 0}, - {1040775722, 0, 0}, - {1280126114, 0, 0}, - {1367301635, 0, 0}, - {1684282922, 0, 0}, - {1918481917, 0, 0}, - {1978689945, 0, 0}, - {1980341560, 0, 0}, - {2443959748, 0, 0}, - {2629265310, 0, 0}, - {2790624748, 0, 0}, - {2970183398, 0, 0}, - {3044188332, 0, 0}, - {3496407048, 0, 0}, - {3662767579, 0, 0}, - {3887377256, 0, 0}, - {3971481069, 0, 0}, - {4224872590, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 2}, - {0, 18, 15}, - {0, 21, 6}, - {0, 13, 11}, - {0, 4, 22}, - {0, 14, 1}, - {0, 24, 23}, - {0, 25, 8}, - {0, 27, 26}, - {0, 20, 17}, - {0, 5, 28}, - {0, 29, 9}, - {0, 16, 10}, - {0, 31, 30}, - {0, 32, 7}, - {0, 19, 33}, - {0, 35, 34}, - {0, 37, 36}, - {0, 38, 12}, - })); - - codecs.emplace(std::pair(SpvOpFunctionCall, 4), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(27, { - {0, 0, 0}, - {37459569, 0, 0}, - {837715723, 0, 0}, - {1352628475, 0, 0}, - {1918481917, 0, 0}, - {1978689945, 0, 0}, - {1980341560, 0, 0}, - {2096388952, 0, 0}, - {2622612602, 0, 0}, - {2790624748, 0, 0}, - {2970183398, 0, 0}, - {3510682541, 0, 0}, - {3783543823, 0, 0}, - {4224872590, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 7, 11}, - {0, 2, 8}, - {0, 15, 12}, - {0, 1, 3}, - {0, 16, 6}, - {0, 18, 17}, - {0, 19, 14}, - {0, 20, 5}, - {0, 10, 21}, - {0, 22, 4}, - {0, 23, 13}, - {0, 25, 24}, - {0, 9, 26}, - })); - - codecs.emplace(std::pair(SpvOpFunctionCall, 5), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(13, { - {0, 0, 0}, - {1510333659, 0, 0}, - {1684282922, 0, 0}, - {1918481917, 0, 0}, - {2790624748, 0, 0}, - {3662767579, 0, 0}, - {4224872590, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 5, 1}, - {0, 8, 2}, - {0, 9, 7}, - {0, 3, 10}, - {0, 6, 11}, - {0, 4, 12}, - })); - - codecs.emplace(std::pair(SpvOpFunctionCall, 6), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(27, { - {0, 0, 0}, - {161668409, 0, 0}, - {188347929, 0, 0}, - {653708953, 0, 0}, - {976111724, 0, 0}, - {1510333659, 0, 0}, - {1918481917, 0, 0}, - {2790624748, 0, 0}, - {3033873113, 0, 0}, - {3499234137, 0, 0}, - {3525913657, 0, 0}, - {3552593177, 0, 0}, - {3570411982, 0, 0}, - {4224872590, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 8, 3}, - {0, 2, 9}, - {0, 10, 11}, - {0, 15, 1}, - {0, 17, 16}, - {0, 19, 18}, - {0, 5, 4}, - {0, 20, 6}, - {0, 12, 21}, - {0, 14, 22}, - {0, 24, 23}, - {0, 7, 25}, - {0, 13, 26}, - })); - - codecs.emplace(std::pair(SpvOpFunctionCall, 7), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(31, { - {0, 0, 0}, - {226836633, 0, 0}, - {296981500, 0, 0}, - {718877177, 0, 0}, - {745556697, 0, 0}, - {798915737, 0, 0}, - {1510333659, 0, 0}, - {1684282922, 0, 0}, - {2444465148, 0, 0}, - {2713718873, 0, 0}, - {3495546641, 0, 0}, - {3564402361, 0, 0}, - {4056442905, 0, 0}, - {4083122425, 0, 0}, - {4123141705, 0, 0}, - {4224872590, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 14, 4}, - {0, 5, 3}, - {0, 9, 8}, - {0, 13, 12}, - {0, 1, 11}, - {0, 18, 17}, - {0, 2, 19}, - {0, 21, 20}, - {0, 23, 22}, - {0, 25, 24}, - {0, 26, 7}, - {0, 27, 16}, - {0, 10, 6}, - {0, 29, 28}, - {0, 15, 30}, - })); - - codecs.emplace(std::pair(SpvOpFunctionCall, 8), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(35, { - {0, 0, 0}, - {161668409, 0, 0}, - {188347929, 0, 0}, - {215027449, 0, 0}, - {296981500, 0, 0}, - {653708953, 0, 0}, - {680388473, 0, 0}, - {1119069977, 0, 0}, - {1510333659, 0, 0}, - {1584774136, 0, 0}, - {2049792025, 0, 0}, - {2444465148, 0, 0}, - {2568512089, 0, 0}, - {3033873113, 0, 0}, - {3499234137, 0, 0}, - {3525913657, 0, 0}, - {3552593177, 0, 0}, - {4224872590, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 7, 6}, - {0, 10, 12}, - {0, 4, 3}, - {0, 16, 11}, - {0, 19, 14}, - {0, 5, 2}, - {0, 20, 13}, - {0, 21, 15}, - {0, 1, 22}, - {0, 24, 23}, - {0, 26, 25}, - {0, 28, 27}, - {0, 18, 29}, - {0, 8, 30}, - {0, 32, 31}, - {0, 9, 33}, - {0, 17, 34}, - })); - - codecs.emplace(std::pair(SpvOpFunctionCall, 9), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(25, { - {0, 0, 0}, - {825595257, 0, 0}, - {1064945649, 0, 0}, - {1290956281, 0, 0}, - {1510333659, 0, 0}, - {2096388952, 0, 0}, - {2248357849, 0, 0}, - {2713718873, 0, 0}, - {3187066832, 0, 0}, - {3205759417, 0, 0}, - {4064212479, 0, 0}, - {4163160985, 0, 0}, - {4224872590, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 8, 3}, - {0, 2, 9}, - {0, 7, 6}, - {0, 5, 14}, - {0, 16, 15}, - {0, 17, 11}, - {0, 19, 18}, - {0, 20, 1}, - {0, 4, 13}, - {0, 22, 21}, - {0, 10, 23}, - {0, 12, 24}, - })); - - codecs.emplace(std::pair(SpvOpFunctionCall, 10), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(27, { - {0, 0, 0}, - {123108003, 0, 0}, - {296981500, 0, 0}, - {595410904, 0, 0}, - {1466938734, 0, 0}, - {1503477720, 0, 0}, - {1816558243, 0, 0}, - {1990431740, 0, 0}, - {2724625059, 0, 0}, - {2790624748, 0, 0}, - {2812498065, 0, 0}, - {3160388974, 0, 0}, - {3745223676, 0, 0}, - {3982311384, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 5, 13}, - {0, 8, 1}, - {0, 12, 11}, - {0, 15, 3}, - {0, 6, 4}, - {0, 16, 7}, - {0, 17, 14}, - {0, 18, 2}, - {0, 19, 10}, - {0, 21, 20}, - {0, 23, 22}, - {0, 25, 24}, - {0, 9, 26}, - })); - - codecs.emplace(std::pair(SpvOpFunctionCall, 11), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(25, { - {0, 0, 0}, - {94145952, 0, 0}, - {1054641568, 0, 0}, - {1269075360, 0, 0}, - {1675922848, 0, 0}, - {2038205856, 0, 0}, - {2433519008, 0, 0}, - {2636942752, 0, 0}, - {2790624748, 0, 0}, - {2840366496, 0, 0}, - {2851900832, 0, 0}, - {2964622752, 0, 0}, - {3654061472, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 7, 1}, - {0, 12, 6}, - {0, 14, 10}, - {0, 13, 4}, - {0, 11, 15}, - {0, 3, 16}, - {0, 2, 17}, - {0, 18, 5}, - {0, 9, 19}, - {0, 21, 20}, - {0, 23, 22}, - {0, 8, 24}, - })); - - codecs.emplace(std::pair(SpvOpFunctionCall, 12), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(45, { - {0, 0, 0}, - {107544081, 0, 0}, - {125015036, 0, 0}, - {586244865, 0, 0}, - {1033081852, 0, 0}, - {1064945649, 0, 0}, - {1155765244, 0, 0}, - {1304296041, 0, 0}, - {1543646433, 0, 0}, - {1782996825, 0, 0}, - {1941148668, 0, 0}, - {2002490364, 0, 0}, - {2022347217, 0, 0}, - {2063832060, 0, 0}, - {2487708241, 0, 0}, - {2726532092, 0, 0}, - {2849215484, 0, 0}, - {2966409025, 0, 0}, - {3445109809, 0, 0}, - {3458449569, 0, 0}, - {3634598908, 0, 0}, - {3695940604, 0, 0}, - {3923810593, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 7, 2}, - {0, 14, 13}, - {0, 1, 23}, - {0, 6, 5}, - {0, 16, 15}, - {0, 24, 17}, - {0, 12, 25}, - {0, 22, 18}, - {0, 10, 26}, - {0, 28, 27}, - {0, 21, 29}, - {0, 31, 30}, - {0, 9, 8}, - {0, 11, 32}, - {0, 33, 19}, - {0, 3, 34}, - {0, 36, 35}, - {0, 38, 37}, - {0, 20, 39}, - {0, 41, 40}, - {0, 42, 4}, - {0, 44, 43}, - })); - - codecs.emplace(std::pair(SpvOpFunctionCall, 13), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(23, { - {0, 0, 0}, - {247698428, 0, 0}, - {309040124, 0, 0}, - {333554713, 0, 0}, - {572905105, 0, 0}, - {1033081852, 0, 0}, - {2002490364, 0, 0}, - {2009007457, 0, 0}, - {2487708241, 0, 0}, - {3634598908, 0, 0}, - {3695940604, 0, 0}, - {3923810593, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 6, 1}, - {0, 9, 7}, - {0, 5, 12}, - {0, 14, 13}, - {0, 15, 8}, - {0, 3, 16}, - {0, 17, 11}, - {0, 10, 4}, - {0, 2, 18}, - {0, 20, 19}, - {0, 22, 21}, - })); - - codecs.emplace(std::pair(SpvOpFunctionCall, 14), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(11, { - {0, 0, 0}, - {247698428, 0, 0}, - {1033081852, 0, 0}, - {2002490364, 0, 0}, - {2910557180, 0, 0}, - {3757282300, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 6, 4}, - {0, 7, 3}, - {0, 2, 8}, - {0, 1, 5}, - {0, 10, 9}, - })); - - codecs.emplace(std::pair(SpvOpFunctionCall, 15), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {1033081852, 0, 0}, - {1094423548, 0, 0}, - {2002490364, 0, 0}, - {3757282300, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 5}, - {0, 6, 2}, - {0, 4, 7}, - {0, 8, 1}, - })); - - codecs.emplace(std::pair(SpvOpFunctionCall, 16), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(57, { - {0, 0, 0}, - {135486769, 0, 0}, - {450406196, 0, 0}, - {503094540, 0, 0}, - {543621065, 0, 0}, - {827698488, 0, 0}, - {1294403159, 0, 0}, - {1296054774, 0, 0}, - {1297706389, 0, 0}, - {1322549027, 0, 0}, - {1784441183, 0, 0}, - {2194691858, 0, 0}, - {2448331885, 0, 0}, - {2468230023, 0, 0}, - {2547657777, 0, 0}, - {2549309392, 0, 0}, - {2550961007, 0, 0}, - {2934934694, 0, 0}, - {2936586309, 0, 0}, - {2938237924, 0, 0}, - {3094180193, 0, 0}, - {3095831808, 0, 0}, - {3183924418, 0, 0}, - {3561562003, 0, 0}, - {3563213618, 0, 0}, - {3564865233, 0, 0}, - {4028622909, 0, 0}, - {4039938779, 0, 0}, - {4050155669, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 27, 28}, - {0, 10, 2}, - {0, 25, 24}, - {0, 1, 12}, - {0, 30, 3}, - {0, 20, 31}, - {0, 9, 32}, - {0, 34, 33}, - {0, 35, 22}, - {0, 26, 15}, - {0, 19, 36}, - {0, 18, 37}, - {0, 38, 16}, - {0, 39, 8}, - {0, 5, 40}, - {0, 6, 41}, - {0, 21, 42}, - {0, 11, 29}, - {0, 4, 43}, - {0, 13, 23}, - {0, 14, 17}, - {0, 7, 44}, - {0, 46, 45}, - {0, 48, 47}, - {0, 50, 49}, - {0, 52, 51}, - {0, 54, 53}, - {0, 56, 55}, - })); - - codecs.emplace(std::pair(SpvOpVariable, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(57, { - {0, 0, 0}, - {37459569, 0, 0}, - {112745085, 0, 0}, - {137840602, 0, 0}, - {565334834, 0, 0}, - {625975427, 0, 0}, - {630964591, 0, 0}, - {680016782, 0, 0}, - {769422756, 0, 0}, - {1009983433, 0, 0}, - {1093210099, 0, 0}, - {1572088444, 0, 0}, - {1584774136, 0, 0}, - {1641565587, 0, 0}, - {1918481917, 0, 0}, - {2190437442, 0, 0}, - {2790624748, 0, 0}, - {3085467405, 0, 0}, - {3181646225, 0, 0}, - {3192069648, 0, 0}, - {3253403867, 0, 0}, - {3390051757, 0, 0}, - {3560665067, 0, 0}, - {3662767579, 0, 0}, - {4053789056, 0, 0}, - {4064212479, 0, 0}, - {4192247221, 0, 0}, - {4224872590, 0, 0}, - {4290024976, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 20}, - {0, 28, 10}, - {0, 13, 8}, - {0, 15, 17}, - {0, 30, 21}, - {0, 19, 31}, - {0, 4, 32}, - {0, 34, 33}, - {0, 35, 5}, - {0, 7, 24}, - {0, 9, 36}, - {0, 3, 37}, - {0, 38, 6}, - {0, 39, 23}, - {0, 27, 40}, - {0, 14, 41}, - {0, 25, 42}, - {0, 1, 29}, - {0, 12, 43}, - {0, 11, 26}, - {0, 18, 22}, - {0, 16, 44}, - {0, 46, 45}, - {0, 48, 47}, - {0, 50, 49}, - {0, 52, 51}, - {0, 54, 53}, - {0, 56, 55}, - })); - - codecs.emplace(std::pair(SpvOpVariable, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(27, { - {0, 0, 0}, - {162255877, 0, 0}, - {679771963, 0, 0}, - {789872778, 0, 0}, - {1154919607, 0, 0}, - {1343794461, 0, 0}, - {1951208733, 0, 0}, - {2263349224, 0, 0}, - {2320303498, 0, 0}, - {2924146124, 0, 0}, - {2984325996, 0, 0}, - {3334207724, 0, 0}, - {3868239231, 0, 0}, - {3869890846, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 5, 3}, - {0, 9, 7}, - {0, 12, 4}, - {0, 16, 15}, - {0, 18, 17}, - {0, 14, 19}, - {0, 13, 10}, - {0, 20, 1}, - {0, 21, 8}, - {0, 2, 22}, - {0, 11, 23}, - {0, 6, 24}, - {0, 26, 25}, - })); - - codecs.emplace(std::pair(SpvOpLoad, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(83, { - {0, 0, 0}, - {169674806, 0, 0}, - {269823086, 0, 0}, - {408465899, 0, 0}, - {451264926, 0, 0}, - {543558236, 0, 0}, - {810488476, 0, 0}, - {850497536, 0, 0}, - {870594305, 0, 0}, - {883854656, 0, 0}, - {1033363654, 0, 0}, - {1069781886, 0, 0}, - {1141965917, 0, 0}, - {1323407757, 0, 0}, - {1570165302, 0, 0}, - {1684282922, 0, 0}, - {1742737136, 0, 0}, - {1901166356, 0, 0}, - {1949759310, 0, 0}, - {2043873558, 0, 0}, - {2087004702, 0, 0}, - {2096388952, 0, 0}, - {2157103435, 0, 0}, - {2219733501, 0, 0}, - {2356768706, 0, 0}, - {2443959748, 0, 0}, - {2517964682, 0, 0}, - {2614879967, 0, 0}, - {2622612602, 0, 0}, - {2660843182, 0, 0}, - {2959147533, 0, 0}, - {2970183398, 0, 0}, - {3044188332, 0, 0}, - {3091876332, 0, 0}, - {3187066832, 0, 0}, - {3244209297, 0, 0}, - {3487022798, 0, 0}, - {3496407048, 0, 0}, - {3570411982, 0, 0}, - {3692647551, 0, 0}, - {3713290482, 0, 0}, - {3831290364, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 1}, - {0, 35, 13}, - {0, 25, 11}, - {0, 7, 10}, - {0, 19, 36}, - {0, 43, 27}, - {0, 16, 29}, - {0, 22, 3}, - {0, 41, 30}, - {0, 44, 12}, - {0, 2, 24}, - {0, 40, 32}, - {0, 23, 45}, - {0, 46, 39}, - {0, 17, 33}, - {0, 48, 47}, - {0, 8, 49}, - {0, 51, 50}, - {0, 52, 20}, - {0, 53, 14}, - {0, 31, 54}, - {0, 15, 55}, - {0, 57, 56}, - {0, 59, 58}, - {0, 6, 26}, - {0, 61, 60}, - {0, 34, 62}, - {0, 64, 63}, - {0, 5, 37}, - {0, 9, 65}, - {0, 18, 28}, - {0, 66, 38}, - {0, 68, 67}, - {0, 69, 21}, - {0, 71, 70}, - {0, 73, 72}, - {0, 75, 74}, - {0, 77, 76}, - {0, 79, 78}, - {0, 80, 42}, - {0, 82, 81}, - })); - - codecs.emplace(std::pair(SpvOpLoad, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(83, { - {0, 0, 0}, - {28782128, 0, 0}, - {30433743, 0, 0}, - {37459569, 0, 0}, - {137840602, 0, 0}, - {522971108, 0, 0}, - {565334834, 0, 0}, - {625975427, 0, 0}, - {630964591, 0, 0}, - {680016782, 0, 0}, - {1009983433, 0, 0}, - {1079999262, 0, 0}, - {1395113939, 0, 0}, - {1572088444, 0, 0}, - {1584774136, 0, 0}, - {1649426421, 0, 0}, - {1918481917, 0, 0}, - {1957218950, 0, 0}, - {2311941439, 0, 0}, - {2313593054, 0, 0}, - {2790624748, 0, 0}, - {2838165089, 0, 0}, - {2839816704, 0, 0}, - {2841468319, 0, 0}, - {3085467405, 0, 0}, - {3181646225, 0, 0}, - {3192069648, 0, 0}, - {3253403867, 0, 0}, - {3364388739, 0, 0}, - {3366040354, 0, 0}, - {3367691969, 0, 0}, - {3369343584, 0, 0}, - {3560665067, 0, 0}, - {3662767579, 0, 0}, - {3945795573, 0, 0}, - {4053789056, 0, 0}, - {4064212479, 0, 0}, - {4224872590, 0, 0}, - {4239834800, 0, 0}, - {4241486415, 0, 0}, - {4243138030, 0, 0}, - {4244789645, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 27}, - {0, 15, 2}, - {0, 10, 26}, - {0, 7, 24}, - {0, 9, 31}, - {0, 43, 30}, - {0, 29, 12}, - {0, 11, 41}, - {0, 40, 39}, - {0, 44, 23}, - {0, 22, 6}, - {0, 34, 35}, - {0, 18, 45}, - {0, 46, 21}, - {0, 17, 19}, - {0, 48, 47}, - {0, 28, 49}, - {0, 51, 50}, - {0, 52, 38}, - {0, 53, 33}, - {0, 4, 54}, - {0, 13, 55}, - {0, 57, 56}, - {0, 59, 58}, - {0, 37, 8}, - {0, 61, 60}, - {0, 5, 62}, - {0, 64, 63}, - {0, 36, 32}, - {0, 3, 65}, - {0, 14, 16}, - {0, 66, 25}, - {0, 68, 67}, - {0, 69, 20}, - {0, 71, 70}, - {0, 73, 72}, - {0, 75, 74}, - {0, 77, 76}, - {0, 79, 78}, - {0, 80, 42}, - {0, 82, 81}, - })); - - codecs.emplace(std::pair(SpvOpLoad, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(49, { - {0, 0, 0}, - {137840602, 0, 0}, - {522971108, 0, 0}, - {769422756, 0, 0}, - {1009983433, 0, 0}, - {1079999262, 0, 0}, - {1558345254, 0, 0}, - {1572088444, 0, 0}, - {1641565587, 0, 0}, - {1918481917, 0, 0}, - {2311941439, 0, 0}, - {2313593054, 0, 0}, - {2790624748, 0, 0}, - {2838165089, 0, 0}, - {2994529201, 0, 0}, - {2996180816, 0, 0}, - {2997832431, 0, 0}, - {3027538652, 0, 0}, - {3253403867, 0, 0}, - {3364388739, 0, 0}, - {3560665067, 0, 0}, - {3662767579, 0, 0}, - {3945795573, 0, 0}, - {4192247221, 0, 0}, - {4224872590, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 14, 17}, - {0, 16, 15}, - {0, 13, 11}, - {0, 10, 3}, - {0, 22, 18}, - {0, 6, 8}, - {0, 19, 2}, - {0, 27, 26}, - {0, 28, 5}, - {0, 30, 29}, - {0, 32, 31}, - {0, 34, 33}, - {0, 4, 35}, - {0, 37, 36}, - {0, 21, 1}, - {0, 39, 38}, - {0, 40, 24}, - {0, 7, 23}, - {0, 20, 9}, - {0, 42, 41}, - {0, 43, 25}, - {0, 44, 12}, - {0, 46, 45}, - {0, 48, 47}, - })); - - codecs.emplace(std::pair(SpvOpStore, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(59, { - {0, 0, 0}, - {139011596, 0, 0}, - {177111659, 0, 0}, - {296981500, 0, 0}, - {408465899, 0, 0}, - {495107308, 0, 0}, - {810488476, 0, 0}, - {870594305, 0, 0}, - {1367301635, 0, 0}, - {1901166356, 0, 0}, - {2055836767, 0, 0}, - {2087004702, 0, 0}, - {2096388952, 0, 0}, - {2204920111, 0, 0}, - {2517964682, 0, 0}, - {2622612602, 0, 0}, - {2660843182, 0, 0}, - {2842919847, 0, 0}, - {2855506940, 0, 0}, - {2959147533, 0, 0}, - {3044188332, 0, 0}, - {3187066832, 0, 0}, - {3504158761, 0, 0}, - {3570411982, 0, 0}, - {3619787319, 0, 0}, - {3653838348, 0, 0}, - {3692647551, 0, 0}, - {3764205609, 0, 0}, - {3831290364, 0, 0}, - {3913885196, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 20, 29}, - {0, 25, 8}, - {0, 5, 1}, - {0, 24, 26}, - {0, 14, 9}, - {0, 27, 16}, - {0, 31, 7}, - {0, 33, 32}, - {0, 17, 34}, - {0, 35, 13}, - {0, 22, 6}, - {0, 3, 2}, - {0, 23, 36}, - {0, 28, 37}, - {0, 19, 4}, - {0, 38, 10}, - {0, 39, 15}, - {0, 40, 18}, - {0, 42, 41}, - {0, 43, 12}, - {0, 44, 21}, - {0, 45, 11}, - {0, 47, 46}, - {0, 49, 48}, - {0, 51, 50}, - {0, 53, 52}, - {0, 55, 54}, - {0, 57, 56}, - {0, 30, 58}, - })); - - codecs.emplace(std::pair(SpvOpStore, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(35, { - {0, 0, 0}, - {440421571, 0, 0}, - {827698488, 0, 0}, - {907126242, 0, 0}, - {908777857, 0, 0}, - {910429472, 0, 0}, - {1294403159, 0, 0}, - {1296054774, 0, 0}, - {1297706389, 0, 0}, - {2080953106, 0, 0}, - {2468230023, 0, 0}, - {2547657777, 0, 0}, - {2549309392, 0, 0}, - {2550961007, 0, 0}, - {3094857332, 0, 0}, - {3561562003, 0, 0}, - {3563213618, 0, 0}, - {3564865233, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 16, 12}, - {0, 17, 13}, - {0, 14, 19}, - {0, 18, 20}, - {0, 5, 21}, - {0, 11, 7}, - {0, 15, 22}, - {0, 9, 8}, - {0, 24, 23}, - {0, 25, 4}, - {0, 27, 26}, - {0, 28, 3}, - {0, 29, 10}, - {0, 6, 1}, - {0, 31, 30}, - {0, 32, 2}, - {0, 34, 33}, - })); - - codecs.emplace(std::pair(SpvOpAccessChain, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(99, { - {0, 0, 0}, - {27130513, 0, 0}, - {28782128, 0, 0}, - {30433743, 0, 0}, - {32085358, 0, 0}, - {155458798, 0, 0}, - {157110413, 0, 0}, - {163402553, 0, 0}, - {165054168, 0, 0}, - {213642219, 0, 0}, - {215293834, 0, 0}, - {216945449, 0, 0}, - {221900294, 0, 0}, - {545986953, 0, 0}, - {979993429, 0, 0}, - {1079999262, 0, 0}, - {1302400505, 0, 0}, - {1313182965, 0, 0}, - {1314834580, 0, 0}, - {1315613425, 0, 0}, - {1317265040, 0, 0}, - {1558345254, 0, 0}, - {1649426421, 0, 0}, - {2311941439, 0, 0}, - {2313593054, 0, 0}, - {2602027658, 0, 0}, - {2838165089, 0, 0}, - {2839816704, 0, 0}, - {2841468319, 0, 0}, - {2863084840, 0, 0}, - {2994529201, 0, 0}, - {2996180816, 0, 0}, - {2997832431, 0, 0}, - {3027538652, 0, 0}, - {3187387500, 0, 0}, - {3189039115, 0, 0}, - {3364388739, 0, 0}, - {3366040354, 0, 0}, - {3367691969, 0, 0}, - {3369343584, 0, 0}, - {3716914380, 0, 0}, - {3928842969, 0, 0}, - {3930494584, 0, 0}, - {3932146199, 0, 0}, - {3945482286, 0, 0}, - {4105051793, 0, 0}, - {4239834800, 0, 0}, - {4241486415, 0, 0}, - {4243138030, 0, 0}, - {4244789645, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 29, 10}, - {0, 17, 18}, - {0, 13, 14}, - {0, 44, 25}, - {0, 8, 7}, - {0, 20, 11}, - {0, 33, 19}, - {0, 6, 45}, - {0, 42, 43}, - {0, 40, 5}, - {0, 9, 16}, - {0, 1, 4}, - {0, 35, 34}, - {0, 12, 21}, - {0, 52, 51}, - {0, 31, 30}, - {0, 41, 32}, - {0, 54, 53}, - {0, 55, 2}, - {0, 3, 56}, - {0, 58, 57}, - {0, 60, 59}, - {0, 61, 22}, - {0, 63, 62}, - {0, 65, 64}, - {0, 67, 66}, - {0, 39, 68}, - {0, 38, 69}, - {0, 47, 70}, - {0, 49, 71}, - {0, 28, 48}, - {0, 37, 15}, - {0, 73, 72}, - {0, 74, 27}, - {0, 23, 75}, - {0, 76, 26}, - {0, 24, 77}, - {0, 79, 78}, - {0, 81, 80}, - {0, 82, 46}, - {0, 36, 83}, - {0, 85, 84}, - {0, 87, 86}, - {0, 89, 88}, - {0, 91, 90}, - {0, 93, 92}, - {0, 95, 94}, - {0, 97, 96}, - {0, 50, 98}, - })); - - codecs.emplace(std::pair(SpvOpAccessChain, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(101, { - {0, 0, 0}, - {112745085, 0, 0}, - {116376005, 0, 0}, - {137840602, 0, 0}, - {400248103, 0, 0}, - {406044930, 0, 0}, - {468372467, 0, 0}, - {522971108, 0, 0}, - {615341051, 0, 0}, - {625975427, 0, 0}, - {630964591, 0, 0}, - {680016782, 0, 0}, - {763027711, 0, 0}, - {977312655, 0, 0}, - {1009983433, 0, 0}, - {1062250709, 0, 0}, - {1395113939, 0, 0}, - {1410849099, 0, 0}, - {1642805350, 0, 0}, - {1692932387, 0, 0}, - {1698730948, 0, 0}, - {1827244161, 0, 0}, - {1918481917, 0, 0}, - {2096472894, 0, 0}, - {2190437442, 0, 0}, - {2299842241, 0, 0}, - {2433358586, 0, 0}, - {2593325766, 0, 0}, - {2785441472, 0, 0}, - {2790624748, 0, 0}, - {2879917723, 0, 0}, - {2882994691, 0, 0}, - {2902069960, 0, 0}, - {3090408469, 0, 0}, - {3181646225, 0, 0}, - {3255947500, 0, 0}, - {3263901372, 0, 0}, - {3268751013, 0, 0}, - {3347863687, 0, 0}, - {3390051757, 0, 0}, - {3560665067, 0, 0}, - {3617689692, 0, 0}, - {3662767579, 0, 0}, - {3717523241, 0, 0}, - {3854557817, 0, 0}, - {3910458990, 0, 0}, - {3941049054, 0, 0}, - {3945795573, 0, 0}, - {4080527786, 0, 0}, - {4101009465, 0, 0}, - {4290024976, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 32, 44}, - {0, 41, 26}, - {0, 16, 10}, - {0, 27, 45}, - {0, 25, 38}, - {0, 12, 18}, - {0, 6, 35}, - {0, 46, 23}, - {0, 20, 37}, - {0, 52, 19}, - {0, 53, 21}, - {0, 54, 48}, - {0, 33, 55}, - {0, 3, 8}, - {0, 28, 56}, - {0, 13, 57}, - {0, 59, 58}, - {0, 1, 49}, - {0, 47, 60}, - {0, 61, 14}, - {0, 63, 62}, - {0, 64, 43}, - {0, 7, 4}, - {0, 65, 15}, - {0, 67, 66}, - {0, 68, 17}, - {0, 36, 2}, - {0, 30, 69}, - {0, 71, 70}, - {0, 34, 5}, - {0, 73, 72}, - {0, 75, 74}, - {0, 77, 76}, - {0, 24, 78}, - {0, 39, 31}, - {0, 80, 79}, - {0, 9, 11}, - {0, 42, 81}, - {0, 83, 82}, - {0, 29, 50}, - {0, 84, 51}, - {0, 86, 85}, - {0, 22, 40}, - {0, 88, 87}, - {0, 90, 89}, - {0, 92, 91}, - {0, 94, 93}, - {0, 96, 95}, - {0, 98, 97}, - {0, 100, 99}, - })); - - codecs.emplace(std::pair(SpvOpAccessChain, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(69, { - {0, 0, 0}, - {51041423, 0, 0}, - {142465290, 0, 0}, - {144116905, 0, 0}, - {290391815, 0, 0}, - {438318340, 0, 0}, - {529742207, 0, 0}, - {677668732, 0, 0}, - {917019124, 0, 0}, - {1064945649, 0, 0}, - {1156369516, 0, 0}, - {1158021131, 0, 0}, - {1304296041, 0, 0}, - {1452222566, 0, 0}, - {1543646433, 0, 0}, - {1691572958, 0, 0}, - {1782996825, 0, 0}, - {1784648440, 0, 0}, - {1930923350, 0, 0}, - {2170273742, 0, 0}, - {2318200267, 0, 0}, - {2466126792, 0, 0}, - {2557550659, 0, 0}, - {2705477184, 0, 0}, - {2796901051, 0, 0}, - {2798552666, 0, 0}, - {2944827576, 0, 0}, - {3092754101, 0, 0}, - {3184177968, 0, 0}, - {3332104493, 0, 0}, - {3571454885, 0, 0}, - {3810805277, 0, 0}, - {3958731802, 0, 0}, - {4106658327, 0, 0}, - {4198082194, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 27, 33}, - {0, 21, 5}, - {0, 26, 13}, - {0, 20, 8}, - {0, 15, 7}, - {0, 37, 36}, - {0, 32, 29}, - {0, 38, 4}, - {0, 30, 1}, - {0, 9, 12}, - {0, 39, 18}, - {0, 22, 40}, - {0, 42, 41}, - {0, 44, 43}, - {0, 45, 35}, - {0, 46, 34}, - {0, 6, 14}, - {0, 28, 23}, - {0, 48, 47}, - {0, 49, 31}, - {0, 51, 50}, - {0, 19, 24}, - {0, 52, 10}, - {0, 2, 53}, - {0, 55, 54}, - {0, 25, 56}, - {0, 11, 57}, - {0, 59, 58}, - {0, 3, 17}, - {0, 61, 60}, - {0, 16, 62}, - {0, 64, 63}, - {0, 66, 65}, - {0, 68, 67}, - })); - - codecs.emplace(std::pair(SpvOpAccessChain, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(85, { - {0, 0, 0}, - {142465290, 0, 0}, - {144116905, 0, 0}, - {198967948, 0, 0}, - {290391815, 0, 0}, - {529742207, 0, 0}, - {586244865, 0, 0}, - {677668732, 0, 0}, - {825595257, 0, 0}, - {917019124, 0, 0}, - {973521782, 0, 0}, - {1064945649, 0, 0}, - {1156369516, 0, 0}, - {1158021131, 0, 0}, - {1212872174, 0, 0}, - {1304296041, 0, 0}, - {1452222566, 0, 0}, - {1543646433, 0, 0}, - {1600149091, 0, 0}, - {1782996825, 0, 0}, - {1784648440, 0, 0}, - {1839499483, 0, 0}, - {1930923350, 0, 0}, - {2170273742, 0, 0}, - {2226776400, 0, 0}, - {2318200267, 0, 0}, - {2466126792, 0, 0}, - {2557550659, 0, 0}, - {2614053317, 0, 0}, - {2796901051, 0, 0}, - {2798552666, 0, 0}, - {2853403709, 0, 0}, - {2944827576, 0, 0}, - {3184177968, 0, 0}, - {3240680626, 0, 0}, - {3480031018, 0, 0}, - {3571454885, 0, 0}, - {3810805277, 0, 0}, - {3867307935, 0, 0}, - {3958731802, 0, 0}, - {4106658327, 0, 0}, - {4198082194, 0, 0}, - {4254584852, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 7, 11}, - {0, 15, 4}, - {0, 32, 25}, - {0, 44, 39}, - {0, 36, 22}, - {0, 45, 17}, - {0, 24, 46}, - {0, 10, 9}, - {0, 6, 27}, - {0, 28, 18}, - {0, 42, 34}, - {0, 31, 14}, - {0, 41, 38}, - {0, 26, 3}, - {0, 47, 33}, - {0, 21, 8}, - {0, 5, 35}, - {0, 40, 16}, - {0, 37, 23}, - {0, 49, 48}, - {0, 51, 50}, - {0, 53, 52}, - {0, 55, 54}, - {0, 57, 56}, - {0, 59, 58}, - {0, 61, 60}, - {0, 63, 62}, - {0, 65, 64}, - {0, 67, 66}, - {0, 68, 12}, - {0, 29, 69}, - {0, 70, 1}, - {0, 30, 2}, - {0, 43, 71}, - {0, 73, 72}, - {0, 74, 20}, - {0, 75, 19}, - {0, 77, 76}, - {0, 13, 78}, - {0, 80, 79}, - {0, 82, 81}, - {0, 84, 83}, - })); - - codecs.emplace(std::pair(SpvOpAccessChain, 4), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {144116905, 0, 0}, - {1158021131, 0, 0}, - {1784648440, 0, 0}, - {2798552666, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 5}, - {0, 4, 2}, - {0, 6, 3}, - {0, 8, 7}, - })); - - codecs.emplace(std::pair(SpvOpAccessChain, 5), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(5, { - {0, 0, 0}, - {142465290, 0, 0}, - {1782996825, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 1}, - {0, 4, 3}, - })); - - codecs.emplace(std::pair(SpvOpAccessChain, 6), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {679771963, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 4}, - {0, 2, 5}, - {0, 6, 1}, - })); - - codecs.emplace(std::pair(SpvOpVectorShuffle, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(59, { - {0, 0, 0}, - {177111659, 0, 0}, - {413918748, 0, 0}, - {529383565, 0, 0}, - {646282397, 0, 0}, - {837715723, 0, 0}, - {1019457583, 0, 0}, - {1022544883, 0, 0}, - {1054461787, 0, 0}, - {1097775533, 0, 0}, - {1136775085, 0, 0}, - {1191015885, 0, 0}, - {1196280518, 0, 0}, - {1203545131, 0, 0}, - {1352628475, 0, 0}, - {1367301635, 0, 0}, - {1918742169, 0, 0}, - {1922045399, 0, 0}, - {2055836767, 0, 0}, - {2183547611, 0, 0}, - {2204920111, 0, 0}, - {2358141757, 0, 0}, - {2572638469, 0, 0}, - {2597020383, 0, 0}, - {2842919847, 0, 0}, - {3619787319, 0, 0}, - {3701632935, 0, 0}, - {3783543823, 0, 0}, - {4245257809, 0, 0}, - {4265894873, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 11, 23}, - {0, 12, 2}, - {0, 9, 7}, - {0, 21, 19}, - {0, 4, 29}, - {0, 10, 28}, - {0, 17, 16}, - {0, 27, 3}, - {0, 32, 31}, - {0, 33, 22}, - {0, 6, 34}, - {0, 35, 8}, - {0, 36, 24}, - {0, 38, 37}, - {0, 1, 14}, - {0, 39, 20}, - {0, 5, 40}, - {0, 42, 41}, - {0, 43, 26}, - {0, 45, 44}, - {0, 47, 46}, - {0, 48, 18}, - {0, 15, 49}, - {0, 50, 25}, - {0, 51, 13}, - {0, 53, 52}, - {0, 55, 54}, - {0, 57, 56}, - {0, 30, 58}, - })); - - codecs.emplace(std::pair(SpvOpVectorShuffle, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(59, { - {0, 0, 0}, - {236660303, 0, 0}, - {342159236, 0, 0}, - {371428004, 0, 0}, - {373079619, 0, 0}, - {488500848, 0, 0}, - {495107308, 0, 0}, - {864295921, 0, 0}, - {1071164424, 0, 0}, - {1136911283, 0, 0}, - {1178317551, 0, 0}, - {1510422521, 0, 0}, - {1570165302, 0, 0}, - {1822823090, 0, 0}, - {1858116930, 0, 0}, - {1977038330, 0, 0}, - {2096388952, 0, 0}, - {2157103435, 0, 0}, - {2231688008, 0, 0}, - {2604576561, 0, 0}, - {2622612602, 0, 0}, - {2771938750, 0, 0}, - {2777172031, 0, 0}, - {2996594997, 0, 0}, - {3187066832, 0, 0}, - {3496407048, 0, 0}, - {3570411982, 0, 0}, - {3609540589, 0, 0}, - {3713290482, 0, 0}, - {3797761273, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 18, 8}, - {0, 27, 9}, - {0, 21, 10}, - {0, 14, 24}, - {0, 12, 19}, - {0, 11, 15}, - {0, 23, 2}, - {0, 7, 13}, - {0, 31, 22}, - {0, 32, 4}, - {0, 33, 29}, - {0, 34, 1}, - {0, 35, 3}, - {0, 37, 36}, - {0, 38, 28}, - {0, 39, 5}, - {0, 41, 40}, - {0, 42, 17}, - {0, 16, 43}, - {0, 45, 44}, - {0, 46, 6}, - {0, 48, 47}, - {0, 50, 49}, - {0, 52, 51}, - {0, 25, 53}, - {0, 54, 20}, - {0, 55, 26}, - {0, 57, 56}, - {0, 30, 58}, - })); - - codecs.emplace(std::pair(SpvOpVectorShuffle, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(47, { - {0, 0, 0}, - {236660303, 0, 0}, - {342159236, 0, 0}, - {488500848, 0, 0}, - {495107308, 0, 0}, - {864295921, 0, 0}, - {1178317551, 0, 0}, - {1510422521, 0, 0}, - {1570165302, 0, 0}, - {1858116930, 0, 0}, - {1977038330, 0, 0}, - {2096388952, 0, 0}, - {2157103435, 0, 0}, - {2231688008, 0, 0}, - {2604576561, 0, 0}, - {2622612602, 0, 0}, - {2771938750, 0, 0}, - {2777172031, 0, 0}, - {2996594997, 0, 0}, - {3496407048, 0, 0}, - {3570411982, 0, 0}, - {3609540589, 0, 0}, - {3713290482, 0, 0}, - {3797761273, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 21, 13}, - {0, 16, 6}, - {0, 14, 9}, - {0, 7, 10}, - {0, 18, 2}, - {0, 17, 5}, - {0, 25, 8}, - {0, 22, 12}, - {0, 26, 23}, - {0, 27, 1}, - {0, 28, 3}, - {0, 30, 29}, - {0, 32, 31}, - {0, 34, 33}, - {0, 35, 11}, - {0, 36, 4}, - {0, 38, 37}, - {0, 40, 39}, - {0, 41, 15}, - {0, 42, 19}, - {0, 20, 43}, - {0, 45, 44}, - {0, 24, 46}, - })); - - codecs.emplace(std::pair(SpvOpVectorShuffle, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(15, { - {0, 0, 0}, - {679771963, 0, 0}, - {1146476634, 0, 0}, - {2160380860, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {3800912395, 0, 0}, - {3802564010, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 3}, - {0, 9, 6}, - {0, 8, 7}, - {0, 11, 10}, - {0, 4, 12}, - {0, 5, 13}, - {0, 14, 1}, - })); - - codecs.emplace(std::pair(SpvOpCompositeConstruct, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(79, { - {0, 0, 0}, - {107497541, 0, 0}, - {289648234, 0, 0}, - {348584153, 0, 0}, - {369686787, 0, 0}, - {429277936, 0, 0}, - {449954059, 0, 0}, - {508217552, 0, 0}, - {742917749, 0, 0}, - {1032593647, 0, 0}, - {1158929937, 0, 0}, - {1209418480, 0, 0}, - {1319785741, 0, 0}, - {1321616112, 0, 0}, - {1417363940, 0, 0}, - {1541020250, 0, 0}, - {1564342316, 0, 0}, - {1578775276, 0, 0}, - {1631434666, 0, 0}, - {1636389511, 0, 0}, - {2012838864, 0, 0}, - {2262137600, 0, 0}, - {2281956980, 0, 0}, - {2359973133, 0, 0}, - {2464905186, 0, 0}, - {2613179511, 0, 0}, - {2621255555, 0, 0}, - {2817335337, 0, 0}, - {2881302403, 0, 0}, - {3063300848, 0, 0}, - {3151638847, 0, 0}, - {3233393284, 0, 0}, - {3323682385, 0, 0}, - {3337532056, 0, 0}, - {3456899824, 0, 0}, - {3547456240, 0, 0}, - {3675926744, 0, 0}, - {3753486980, 0, 0}, - {3931641900, 0, 0}, - {3970432934, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 25, 1}, - {0, 6, 4}, - {0, 8, 19}, - {0, 39, 24}, - {0, 3, 2}, - {0, 34, 14}, - {0, 10, 9}, - {0, 18, 38}, - {0, 32, 15}, - {0, 27, 16}, - {0, 28, 35}, - {0, 13, 26}, - {0, 20, 23}, - {0, 21, 11}, - {0, 36, 33}, - {0, 5, 22}, - {0, 42, 41}, - {0, 43, 29}, - {0, 45, 44}, - {0, 7, 46}, - {0, 48, 47}, - {0, 30, 31}, - {0, 50, 49}, - {0, 52, 51}, - {0, 54, 53}, - {0, 55, 17}, - {0, 57, 56}, - {0, 59, 58}, - {0, 61, 60}, - {0, 62, 12}, - {0, 64, 63}, - {0, 66, 65}, - {0, 67, 37}, - {0, 69, 68}, - {0, 71, 70}, - {0, 73, 72}, - {0, 75, 74}, - {0, 77, 76}, - {0, 40, 78}, - })); - - codecs.emplace(std::pair(SpvOpCompositeConstruct, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(87, { - {0, 0, 0}, - {153013225, 0, 0}, - {296836635, 0, 0}, - {296981500, 0, 0}, - {778500192, 0, 0}, - {810488476, 0, 0}, - {848380423, 0, 0}, - {900522183, 0, 0}, - {910398460, 0, 0}, - {959681532, 0, 0}, - {1141965917, 0, 0}, - {1287304304, 0, 0}, - {1323407757, 0, 0}, - {1417363940, 0, 0}, - {1471851763, 0, 0}, - {1526654696, 0, 0}, - {1654776395, 0, 0}, - {1684282922, 0, 0}, - {1739837626, 0, 0}, - {1791352211, 0, 0}, - {2195550588, 0, 0}, - {2319227476, 0, 0}, - {2491124112, 0, 0}, - {2789375411, 0, 0}, - {2807448986, 0, 0}, - {2817579280, 0, 0}, - {2835131395, 0, 0}, - {2847102741, 0, 0}, - {2855506940, 0, 0}, - {2860348412, 0, 0}, - {3079287749, 0, 0}, - {3091876332, 0, 0}, - {3168953855, 0, 0}, - {3374978006, 0, 0}, - {3399062057, 0, 0}, - {3510257966, 0, 0}, - {3554463148, 0, 0}, - {3579593979, 0, 0}, - {3757851979, 0, 0}, - {3759503594, 0, 0}, - {3761155209, 0, 0}, - {3762806824, 0, 0}, - {3902853271, 0, 0}, - {4140081844, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 38, 42}, - {0, 14, 23}, - {0, 26, 18}, - {0, 39, 35}, - {0, 6, 40}, - {0, 16, 13}, - {0, 33, 34}, - {0, 12, 4}, - {0, 27, 41}, - {0, 25, 21}, - {0, 24, 1}, - {0, 37, 19}, - {0, 32, 22}, - {0, 2, 8}, - {0, 20, 17}, - {0, 43, 36}, - {0, 29, 15}, - {0, 46, 45}, - {0, 48, 47}, - {0, 50, 49}, - {0, 52, 51}, - {0, 54, 53}, - {0, 7, 55}, - {0, 56, 30}, - {0, 57, 5}, - {0, 59, 58}, - {0, 60, 11}, - {0, 9, 61}, - {0, 63, 62}, - {0, 65, 64}, - {0, 66, 31}, - {0, 68, 67}, - {0, 10, 69}, - {0, 71, 70}, - {0, 28, 72}, - {0, 74, 73}, - {0, 76, 75}, - {0, 78, 77}, - {0, 79, 3}, - {0, 81, 80}, - {0, 83, 82}, - {0, 85, 84}, - {0, 44, 86}, - })); - - codecs.emplace(std::pair(SpvOpCompositeConstruct, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(81, { - {0, 0, 0}, - {14244860, 0, 0}, - {150820676, 0, 0}, - {153013225, 0, 0}, - {269823086, 0, 0}, - {289648234, 0, 0}, - {296981500, 0, 0}, - {678695941, 0, 0}, - {810488476, 0, 0}, - {850592577, 0, 0}, - {870594305, 0, 0}, - {910398460, 0, 0}, - {959681532, 0, 0}, - {1206571206, 0, 0}, - {1287304304, 0, 0}, - {1323407757, 0, 0}, - {1471851763, 0, 0}, - {1526654696, 0, 0}, - {1684282922, 0, 0}, - {1734446471, 0, 0}, - {1758530522, 0, 0}, - {2117320444, 0, 0}, - {2118972059, 0, 0}, - {2120623674, 0, 0}, - {2122275289, 0, 0}, - {2219733501, 0, 0}, - {2262321736, 0, 0}, - {2807448986, 0, 0}, - {2817579280, 0, 0}, - {2835131395, 0, 0}, - {2855506940, 0, 0}, - {2860348412, 0, 0}, - {2951272396, 0, 0}, - {3079287749, 0, 0}, - {3168953855, 0, 0}, - {3502816184, 0, 0}, - {3510257966, 0, 0}, - {3554463148, 0, 0}, - {3997952447, 0, 0}, - {4140081844, 0, 0}, - {4182141402, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 21, 26}, - {0, 29, 16}, - {0, 22, 36}, - {0, 1, 23}, - {0, 20, 5}, - {0, 19, 35}, - {0, 10, 38}, - {0, 13, 24}, - {0, 28, 7}, - {0, 27, 3}, - {0, 40, 2}, - {0, 34, 9}, - {0, 32, 11}, - {0, 33, 18}, - {0, 39, 37}, - {0, 31, 17}, - {0, 43, 42}, - {0, 45, 44}, - {0, 47, 46}, - {0, 49, 48}, - {0, 51, 50}, - {0, 8, 52}, - {0, 15, 53}, - {0, 55, 54}, - {0, 56, 14}, - {0, 58, 57}, - {0, 60, 59}, - {0, 61, 25}, - {0, 63, 62}, - {0, 4, 64}, - {0, 66, 65}, - {0, 68, 67}, - {0, 70, 69}, - {0, 71, 12}, - {0, 6, 72}, - {0, 30, 73}, - {0, 75, 74}, - {0, 77, 76}, - {0, 79, 78}, - {0, 41, 80}, - })); - - codecs.emplace(std::pair(SpvOpCompositeConstruct, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(111, { - {0, 0, 0}, - {34183582, 0, 0}, - {93914936, 0, 0}, - {94303122, 0, 0}, - {117998987, 0, 0}, - {153013225, 0, 0}, - {296981500, 0, 0}, - {451264926, 0, 0}, - {473485679, 0, 0}, - {476788909, 0, 0}, - {478440524, 0, 0}, - {480092139, 0, 0}, - {481743754, 0, 0}, - {810488476, 0, 0}, - {871966503, 0, 0}, - {910398460, 0, 0}, - {918189168, 0, 0}, - {933769938, 0, 0}, - {959681532, 0, 0}, - {1149665466, 0, 0}, - {1166917451, 0, 0}, - {1227221002, 0, 0}, - {1310740861, 0, 0}, - {1323407757, 0, 0}, - {1341516288, 0, 0}, - {1373166395, 0, 0}, - {1445161581, 0, 0}, - {1461645203, 0, 0}, - {1471851763, 0, 0}, - {1526654696, 0, 0}, - {1561718045, 0, 0}, - {1593584949, 0, 0}, - {1684282922, 0, 0}, - {1800404122, 0, 0}, - {1862284649, 0, 0}, - {2213411495, 0, 0}, - {2668680621, 0, 0}, - {2805256437, 0, 0}, - {2807448986, 0, 0}, - {2835131395, 0, 0}, - {2855506940, 0, 0}, - {2860348412, 0, 0}, - {3000904950, 0, 0}, - {3107413701, 0, 0}, - {3168953855, 0, 0}, - {3333131702, 0, 0}, - {3365041621, 0, 0}, - {3456899824, 0, 0}, - {3505028338, 0, 0}, - {3510257966, 0, 0}, - {3554463148, 0, 0}, - {3606320646, 0, 0}, - {3692647551, 0, 0}, - {3861006967, 0, 0}, - {4126287524, 0, 0}, - {4140081844, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 14, 33}, - {0, 35, 25}, - {0, 27, 17}, - {0, 8, 20}, - {0, 3, 54}, - {0, 1, 19}, - {0, 10, 46}, - {0, 11, 9}, - {0, 39, 28}, - {0, 53, 49}, - {0, 12, 2}, - {0, 34, 4}, - {0, 47, 36}, - {0, 23, 45}, - {0, 5, 37}, - {0, 24, 38}, - {0, 43, 26}, - {0, 48, 51}, - {0, 44, 32}, - {0, 15, 16}, - {0, 57, 22}, - {0, 55, 50}, - {0, 29, 58}, - {0, 60, 59}, - {0, 41, 61}, - {0, 63, 62}, - {0, 65, 64}, - {0, 67, 66}, - {0, 69, 68}, - {0, 13, 70}, - {0, 71, 7}, - {0, 42, 31}, - {0, 73, 72}, - {0, 75, 74}, - {0, 21, 30}, - {0, 77, 76}, - {0, 79, 78}, - {0, 81, 80}, - {0, 82, 18}, - {0, 84, 83}, - {0, 86, 85}, - {0, 88, 87}, - {0, 90, 89}, - {0, 52, 91}, - {0, 6, 92}, - {0, 94, 93}, - {0, 96, 95}, - {0, 98, 97}, - {0, 99, 40}, - {0, 101, 100}, - {0, 103, 102}, - {0, 105, 104}, - {0, 107, 106}, - {0, 109, 108}, - {0, 56, 110}, - })); - - codecs.emplace(std::pair(SpvOpCompositeConstruct, 4), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(155, { - {0, 0, 0}, - {18776483, 0, 0}, - {37009196, 0, 0}, - {277023757, 0, 0}, - {296981500, 0, 0}, - {348988933, 0, 0}, - {451264926, 0, 0}, - {564884461, 0, 0}, - {804899022, 0, 0}, - {810488476, 0, 0}, - {870594305, 0, 0}, - {876864198, 0, 0}, - {900522183, 0, 0}, - {928261291, 0, 0}, - {959681532, 0, 0}, - {1164724902, 0, 0}, - {1323407757, 0, 0}, - {1332774287, 0, 0}, - {1404739463, 0, 0}, - {1447712361, 0, 0}, - {1450415100, 0, 0}, - {1513770932, 0, 0}, - {1620634991, 0, 0}, - {1692600167, 0, 0}, - {1860649552, 0, 0}, - {1932614728, 0, 0}, - {2087004702, 0, 0}, - {2148510256, 0, 0}, - {2220475432, 0, 0}, - {2388524817, 0, 0}, - {2460489993, 0, 0}, - {2676385521, 0, 0}, - {2748350697, 0, 0}, - {2855506940, 0, 0}, - {2860348412, 0, 0}, - {2916400082, 0, 0}, - {2988365258, 0, 0}, - {3061856840, 0, 0}, - {3063508455, 0, 0}, - {3065160070, 0, 0}, - {3066811685, 0, 0}, - {3068463300, 0, 0}, - {3070114915, 0, 0}, - {3071766530, 0, 0}, - {3073418145, 0, 0}, - {3075069760, 0, 0}, - {3076721375, 0, 0}, - {3078372990, 0, 0}, - {3080024605, 0, 0}, - {3081676220, 0, 0}, - {3083327835, 0, 0}, - {3084979450, 0, 0}, - {3086631065, 0, 0}, - {3088282680, 0, 0}, - {3114708520, 0, 0}, - {3116360135, 0, 0}, - {3118011750, 0, 0}, - {3119663365, 0, 0}, - {3121314980, 0, 0}, - {3124618210, 0, 0}, - {3126269825, 0, 0}, - {3127921440, 0, 0}, - {3129573055, 0, 0}, - {3131224670, 0, 0}, - {3132876285, 0, 0}, - {3134527900, 0, 0}, - {3136179515, 0, 0}, - {3204260786, 0, 0}, - {3264086791, 0, 0}, - {3276225962, 0, 0}, - {3444275347, 0, 0}, - {3516240523, 0, 0}, - {3588205699, 0, 0}, - {3732136051, 0, 0}, - {3804101227, 0, 0}, - {3874089391, 0, 0}, - {4044115788, 0, 0}, - {4116080964, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 45, 43}, - {0, 3, 46}, - {0, 71, 36}, - {0, 44, 34}, - {0, 76, 54}, - {0, 73, 55}, - {0, 57, 67}, - {0, 51, 56}, - {0, 31, 27}, - {0, 38, 37}, - {0, 40, 39}, - {0, 42, 41}, - {0, 49, 47}, - {0, 35, 50}, - {0, 21, 70}, - {0, 19, 5}, - {0, 8, 58}, - {0, 17, 11}, - {0, 24, 18}, - {0, 30, 29}, - {0, 52, 9}, - {0, 77, 22}, - {0, 62, 48}, - {0, 25, 53}, - {0, 20, 59}, - {0, 26, 60}, - {0, 72, 6}, - {0, 79, 69}, - {0, 80, 7}, - {0, 81, 2}, - {0, 12, 13}, - {0, 82, 68}, - {0, 65, 61}, - {0, 74, 63}, - {0, 23, 83}, - {0, 64, 10}, - {0, 84, 32}, - {0, 66, 28}, - {0, 15, 85}, - {0, 86, 16}, - {0, 88, 87}, - {0, 90, 89}, - {0, 92, 91}, - {0, 1, 93}, - {0, 95, 94}, - {0, 97, 96}, - {0, 99, 98}, - {0, 100, 75}, - {0, 102, 101}, - {0, 104, 103}, - {0, 106, 105}, - {0, 107, 14}, - {0, 109, 108}, - {0, 111, 110}, - {0, 113, 112}, - {0, 115, 114}, - {0, 117, 116}, - {0, 119, 118}, - {0, 121, 120}, - {0, 123, 122}, - {0, 125, 124}, - {0, 127, 126}, - {0, 129, 128}, - {0, 131, 130}, - {0, 133, 132}, - {0, 135, 134}, - {0, 137, 136}, - {0, 139, 138}, - {0, 141, 140}, - {0, 143, 142}, - {0, 145, 144}, - {0, 147, 146}, - {0, 33, 148}, - {0, 4, 149}, - {0, 78, 150}, - {0, 152, 151}, - {0, 154, 153}, - })); - - codecs.emplace(std::pair(SpvOpCompositeConstruct, 5), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(11, { - {0, 0, 0}, - {679771963, 0, 0}, - {789872778, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 6, 2}, - {0, 4, 7}, - {0, 1, 8}, - {0, 9, 5}, - {0, 3, 10}, - })); - - codecs.emplace(std::pair(SpvOpCompositeExtract, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(49, { - {0, 0, 0}, - {126463145, 0, 0}, - {171307615, 0, 0}, - {342159236, 0, 0}, - {354479447, 0, 0}, - {593829839, 0, 0}, - {743407979, 0, 0}, - {898191441, 0, 0}, - {900522183, 0, 0}, - {1265796414, 0, 0}, - {1287304304, 0, 0}, - {1356063462, 0, 0}, - {1368383673, 0, 0}, - {1526654696, 0, 0}, - {1766994680, 0, 0}, - {1793544760, 0, 0}, - {1811839150, 0, 0}, - {2234361374, 0, 0}, - {2279700640, 0, 0}, - {2383939514, 0, 0}, - {2780898906, 0, 0}, - {2996594997, 0, 0}, - {3413713311, 0, 0}, - {3554463148, 0, 0}, - {3635542517, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 11, 15}, - {0, 20, 14}, - {0, 7, 18}, - {0, 6, 1}, - {0, 12, 10}, - {0, 23, 19}, - {0, 13, 5}, - {0, 24, 17}, - {0, 21, 3}, - {0, 22, 16}, - {0, 26, 2}, - {0, 27, 8}, - {0, 4, 28}, - {0, 29, 9}, - {0, 31, 30}, - {0, 33, 32}, - {0, 35, 34}, - {0, 37, 36}, - {0, 39, 38}, - {0, 41, 40}, - {0, 43, 42}, - {0, 45, 44}, - {0, 47, 46}, - {0, 25, 48}, - })); - - codecs.emplace(std::pair(SpvOpCompositeExtract, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(153, { - {0, 0, 0}, - {13107491, 0, 0}, - {257136089, 0, 0}, - {293528591, 0, 0}, - {321459212, 0, 0}, - {425022309, 0, 0}, - {490769168, 0, 0}, - {495107308, 0, 0}, - {517919178, 0, 0}, - {617312262, 0, 0}, - {708736129, 0, 0}, - {753756604, 0, 0}, - {765238787, 0, 0}, - {796985462, 0, 0}, - {819503463, 0, 0}, - {850497536, 0, 0}, - {948086521, 0, 0}, - {1004589179, 0, 0}, - {1120149824, 0, 0}, - {1165671422, 0, 0}, - {1203545131, 0, 0}, - {1297165140, 0, 0}, - {1335363438, 0, 0}, - {1351676723, 0, 0}, - {1391866096, 0, 0}, - {1584369690, 0, 0}, - {1631216488, 0, 0}, - {1691646294, 0, 0}, - {1779143013, 0, 0}, - {1858116930, 0, 0}, - {1890300748, 0, 0}, - {1915438939, 0, 0}, - {1918742169, 0, 0}, - {1922045399, 0, 0}, - {1961990747, 0, 0}, - {2037710159, 0, 0}, - {2037814253, 0, 0}, - {2043873558, 0, 0}, - {2096388952, 0, 0}, - {2169307971, 0, 0}, - {2257843797, 0, 0}, - {2262220987, 0, 0}, - {2338272340, 0, 0}, - {2405770322, 0, 0}, - {2498042266, 0, 0}, - {2563789125, 0, 0}, - {2588618056, 0, 0}, - {2645120714, 0, 0}, - {2864863800, 0, 0}, - {2909957084, 0, 0}, - {2975894973, 0, 0}, - {3041450802, 0, 0}, - {3151638847, 0, 0}, - {3187066832, 0, 0}, - {3244716568, 0, 0}, - {3271748023, 0, 0}, - {3304438238, 0, 0}, - {3312467582, 0, 0}, - {3325419312, 0, 0}, - {3370185097, 0, 0}, - {3419674548, 0, 0}, - {3435931956, 0, 0}, - {3504158761, 0, 0}, - {3602522282, 0, 0}, - {3653059026, 0, 0}, - {3716353056, 0, 0}, - {3782099915, 0, 0}, - {3838648480, 0, 0}, - {3847846774, 0, 0}, - {3913593633, 0, 0}, - {3989799199, 0, 0}, - {3997038726, 0, 0}, - {4046301857, 0, 0}, - {4092654294, 0, 0}, - {4176581069, 0, 0}, - {4242327928, 0, 0}, - {4285652249, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 74, 38}, - {0, 12, 56}, - {0, 28, 24}, - {0, 60, 43}, - {0, 65, 72}, - {0, 18, 2}, - {0, 52, 3}, - {0, 19, 10}, - {0, 49, 36}, - {0, 67, 66}, - {0, 41, 17}, - {0, 53, 11}, - {0, 29, 68}, - {0, 26, 55}, - {0, 70, 76}, - {0, 73, 47}, - {0, 51, 22}, - {0, 39, 21}, - {0, 5, 9}, - {0, 40, 48}, - {0, 59, 44}, - {0, 6, 69}, - {0, 32, 31}, - {0, 4, 33}, - {0, 13, 54}, - {0, 14, 50}, - {0, 35, 75}, - {0, 58, 23}, - {0, 16, 34}, - {0, 27, 63}, - {0, 45, 61}, - {0, 20, 46}, - {0, 71, 1}, - {0, 79, 78}, - {0, 81, 80}, - {0, 83, 82}, - {0, 84, 8}, - {0, 86, 85}, - {0, 88, 87}, - {0, 90, 89}, - {0, 92, 91}, - {0, 94, 93}, - {0, 96, 95}, - {0, 98, 97}, - {0, 64, 99}, - {0, 101, 100}, - {0, 103, 102}, - {0, 105, 104}, - {0, 106, 62}, - {0, 108, 107}, - {0, 110, 109}, - {0, 7, 111}, - {0, 113, 112}, - {0, 115, 114}, - {0, 117, 116}, - {0, 119, 118}, - {0, 121, 120}, - {0, 123, 122}, - {0, 30, 124}, - {0, 126, 125}, - {0, 128, 127}, - {0, 130, 129}, - {0, 132, 131}, - {0, 134, 133}, - {0, 135, 25}, - {0, 57, 136}, - {0, 138, 137}, - {0, 42, 139}, - {0, 37, 140}, - {0, 142, 141}, - {0, 143, 15}, - {0, 145, 144}, - {0, 147, 146}, - {0, 149, 148}, - {0, 151, 150}, - {0, 152, 77}, - })); - - codecs.emplace(std::pair(SpvOpCompositeExtract, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(47, { - {0, 0, 0}, - {545678922, 0, 0}, - {630592085, 0, 0}, - {679771963, 0, 0}, - {899570100, 0, 0}, - {906176560, 0, 0}, - {929101967, 0, 0}, - {1100599986, 0, 0}, - {1103903216, 0, 0}, - {1107206446, 0, 0}, - {1369578001, 0, 0}, - {1372881231, 0, 0}, - {2320303498, 0, 0}, - {2926633629, 0, 0}, - {3249265647, 0, 0}, - {3334207724, 0, 0}, - {3486057732, 0, 0}, - {3674863070, 0, 0}, - {3705139860, 0, 0}, - {3800912395, 0, 0}, - {3802564010, 0, 0}, - {3822983876, 0, 0}, - {4141567741, 0, 0}, - {4292991777, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 9, 17}, - {0, 20, 11}, - {0, 25, 5}, - {0, 2, 14}, - {0, 23, 13}, - {0, 16, 26}, - {0, 27, 24}, - {0, 28, 8}, - {0, 29, 18}, - {0, 22, 30}, - {0, 6, 31}, - {0, 21, 32}, - {0, 3, 33}, - {0, 35, 34}, - {0, 1, 12}, - {0, 10, 36}, - {0, 37, 19}, - {0, 4, 15}, - {0, 39, 38}, - {0, 7, 40}, - {0, 42, 41}, - {0, 44, 43}, - {0, 46, 45}, - })); - - codecs.emplace(std::pair(SpvOpCompositeInsert, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(103, { - {0, 0, 0}, - {125792961, 0, 0}, - {132755933, 0, 0}, - {156014509, 0, 0}, - {436066778, 0, 0}, - {463084678, 0, 0}, - {531559080, 0, 0}, - {565233904, 0, 0}, - {578132535, 0, 0}, - {600906020, 0, 0}, - {602222721, 0, 0}, - {694743357, 0, 0}, - {760554870, 0, 0}, - {996663016, 0, 0}, - {1022309772, 0, 0}, - {1351676723, 0, 0}, - {1496901698, 0, 0}, - {1502470404, 0, 0}, - {1522901980, 0, 0}, - {1548254487, 0, 0}, - {1637661947, 0, 0}, - {1788504755, 0, 0}, - {2092468906, 0, 0}, - {2094647776, 0, 0}, - {2127660080, 0, 0}, - {2213946343, 0, 0}, - {2225172640, 0, 0}, - {2259467579, 0, 0}, - {2263866576, 0, 0}, - {2600961503, 0, 0}, - {2727022058, 0, 0}, - {2752967311, 0, 0}, - {2864705739, 0, 0}, - {3021406120, 0, 0}, - {3044723416, 0, 0}, - {3052439312, 0, 0}, - {3136865519, 0, 0}, - {3297860332, 0, 0}, - {3352361837, 0, 0}, - {3670298840, 0, 0}, - {3712946115, 0, 0}, - {3732709413, 0, 0}, - {3764662384, 0, 0}, - {3788324110, 0, 0}, - {3928555688, 0, 0}, - {4083347580, 0, 0}, - {4098876453, 0, 0}, - {4147239510, 0, 0}, - {4199470013, 0, 0}, - {4211577142, 0, 0}, - {4218799564, 0, 0}, - {4290374884, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 2}, - {0, 9, 8}, - {0, 17, 10}, - {0, 20, 18}, - {0, 22, 21}, - {0, 26, 23}, - {0, 31, 29}, - {0, 35, 34}, - {0, 45, 36}, - {0, 5, 3}, - {0, 12, 6}, - {0, 15, 14}, - {0, 25, 19}, - {0, 28, 27}, - {0, 38, 33}, - {0, 43, 39}, - {0, 47, 46}, - {0, 50, 49}, - {0, 7, 51}, - {0, 1, 48}, - {0, 37, 24}, - {0, 44, 42}, - {0, 13, 11}, - {0, 41, 40}, - {0, 54, 53}, - {0, 56, 55}, - {0, 58, 57}, - {0, 60, 59}, - {0, 62, 61}, - {0, 64, 63}, - {0, 66, 65}, - {0, 68, 67}, - {0, 70, 69}, - {0, 72, 71}, - {0, 30, 16}, - {0, 73, 32}, - {0, 75, 74}, - {0, 77, 76}, - {0, 79, 78}, - {0, 81, 80}, - {0, 83, 82}, - {0, 85, 84}, - {0, 87, 86}, - {0, 89, 88}, - {0, 91, 90}, - {0, 93, 92}, - {0, 95, 94}, - {0, 97, 96}, - {0, 99, 98}, - {0, 101, 100}, - {0, 52, 102}, - })); - - codecs.emplace(std::pair(SpvOpCompositeInsert, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(93, { - {0, 0, 0}, - {17185761, 0, 0}, - {117250846, 0, 0}, - {296981500, 0, 0}, - {330388453, 0, 0}, - {346929928, 0, 0}, - {533021259, 0, 0}, - {564302770, 0, 0}, - {680157484, 0, 0}, - {721450866, 0, 0}, - {798549062, 0, 0}, - {853200279, 0, 0}, - {864295921, 0, 0}, - {900522183, 0, 0}, - {973908139, 0, 0}, - {983243705, 0, 0}, - {1033363654, 0, 0}, - {1037370721, 0, 0}, - {1464587427, 0, 0}, - {1670691893, 0, 0}, - {1686512349, 0, 0}, - {1849065716, 0, 0}, - {1917602962, 0, 0}, - {1965902997, 0, 0}, - {2121980967, 0, 0}, - {2311072371, 0, 0}, - {2339901602, 0, 0}, - {2517964682, 0, 0}, - {2542834724, 0, 0}, - {2558655180, 0, 0}, - {2736881867, 0, 0}, - {2855506940, 0, 0}, - {2888753905, 0, 0}, - {2950446516, 0, 0}, - {3044188332, 0, 0}, - {3079287749, 0, 0}, - {3153451899, 0, 0}, - {3214537066, 0, 0}, - {3234673086, 0, 0}, - {3349230696, 0, 0}, - {3504158761, 0, 0}, - {3570411982, 0, 0}, - {3652695478, 0, 0}, - {3764205609, 0, 0}, - {3940720663, 0, 0}, - {4180570743, 0, 0}, - {4221373527, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 24, 18}, - {0, 4, 2}, - {0, 15, 14}, - {0, 21, 20}, - {0, 29, 26}, - {0, 42, 36}, - {0, 7, 45}, - {0, 37, 9}, - {0, 8, 5}, - {0, 32, 11}, - {0, 39, 38}, - {0, 12, 10}, - {0, 28, 19}, - {0, 1, 46}, - {0, 17, 6}, - {0, 30, 23}, - {0, 44, 33}, - {0, 35, 13}, - {0, 16, 48}, - {0, 50, 49}, - {0, 52, 51}, - {0, 54, 53}, - {0, 55, 40}, - {0, 57, 56}, - {0, 59, 58}, - {0, 61, 60}, - {0, 25, 22}, - {0, 63, 62}, - {0, 3, 64}, - {0, 66, 65}, - {0, 68, 67}, - {0, 70, 69}, - {0, 34, 71}, - {0, 73, 72}, - {0, 75, 74}, - {0, 77, 76}, - {0, 27, 43}, - {0, 79, 78}, - {0, 81, 80}, - {0, 83, 82}, - {0, 84, 31}, - {0, 86, 85}, - {0, 41, 87}, - {0, 89, 88}, - {0, 91, 90}, - {0, 47, 92}, - })); - - codecs.emplace(std::pair(SpvOpCompositeInsert, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(115, { - {0, 0, 0}, - {132755933, 0, 0}, - {156014509, 0, 0}, - {255227811, 0, 0}, - {371186900, 0, 0}, - {371428004, 0, 0}, - {374731234, 0, 0}, - {531559080, 0, 0}, - {565233904, 0, 0}, - {578132535, 0, 0}, - {591140762, 0, 0}, - {600906020, 0, 0}, - {602222721, 0, 0}, - {656610661, 0, 0}, - {760554870, 0, 0}, - {996663016, 0, 0}, - {1022309772, 0, 0}, - {1496901698, 0, 0}, - {1502470404, 0, 0}, - {1522901980, 0, 0}, - {1536350567, 0, 0}, - {1543280290, 0, 0}, - {1548254487, 0, 0}, - {1788504755, 0, 0}, - {2064733527, 0, 0}, - {2092468906, 0, 0}, - {2094647776, 0, 0}, - {2162986400, 0, 0}, - {2225172640, 0, 0}, - {2259467579, 0, 0}, - {2263866576, 0, 0}, - {2360004627, 0, 0}, - {2507709226, 0, 0}, - {2600961503, 0, 0}, - {2727022058, 0, 0}, - {2752967311, 0, 0}, - {2864705739, 0, 0}, - {3021406120, 0, 0}, - {3052439312, 0, 0}, - {3136865519, 0, 0}, - {3297860332, 0, 0}, - {3352361837, 0, 0}, - {3598957382, 0, 0}, - {3619787319, 0, 0}, - {3655201337, 0, 0}, - {3670298840, 0, 0}, - {3774892253, 0, 0}, - {3788324110, 0, 0}, - {3808408202, 0, 0}, - {3951925872, 0, 0}, - {3952316364, 0, 0}, - {4098876453, 0, 0}, - {4147239510, 0, 0}, - {4199470013, 0, 0}, - {4211577142, 0, 0}, - {4217306348, 0, 0}, - {4218799564, 0, 0}, - {4290374884, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 6, 43}, - {0, 4, 1}, - {0, 11, 9}, - {0, 13, 12}, - {0, 19, 18}, - {0, 25, 23}, - {0, 28, 26}, - {0, 35, 33}, - {0, 39, 38}, - {0, 2, 49}, - {0, 7, 3}, - {0, 16, 14}, - {0, 29, 22}, - {0, 37, 30}, - {0, 45, 41}, - {0, 51, 47}, - {0, 54, 52}, - {0, 57, 56}, - {0, 53, 8}, - {0, 32, 10}, - {0, 42, 40}, - {0, 24, 46}, - {0, 15, 50}, - {0, 55, 20}, - {0, 59, 44}, - {0, 61, 60}, - {0, 63, 62}, - {0, 65, 64}, - {0, 67, 66}, - {0, 69, 68}, - {0, 71, 70}, - {0, 73, 72}, - {0, 75, 74}, - {0, 77, 76}, - {0, 31, 17}, - {0, 36, 34}, - {0, 79, 78}, - {0, 81, 80}, - {0, 27, 82}, - {0, 5, 21}, - {0, 48, 83}, - {0, 85, 84}, - {0, 87, 86}, - {0, 89, 88}, - {0, 91, 90}, - {0, 93, 92}, - {0, 95, 94}, - {0, 97, 96}, - {0, 99, 98}, - {0, 101, 100}, - {0, 103, 102}, - {0, 105, 104}, - {0, 107, 106}, - {0, 109, 108}, - {0, 111, 110}, - {0, 113, 112}, - {0, 58, 114}, - })); - - codecs.emplace(std::pair(SpvOpCompositeInsert, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {3866587616, 0, 0}, - {3868239231, 0, 0}, - {3869890846, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 4}, - {0, 2, 5}, - {0, 3, 6}, - })); - - codecs.emplace(std::pair(SpvOpSampledImage, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {1164218401, 0, 0}, - {2036361232, 0, 0}, - {2637132451, 0, 0}, - {3237903670, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 5}, - {0, 3, 6}, - {0, 1, 7}, - {0, 2, 8}, - })); - - codecs.emplace(std::pair(SpvOpSampledImage, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {543558236, 0, 0}, - {1069781886, 0, 0}, - {1596005536, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 4}, - {0, 2, 5}, - {0, 1, 6}, - })); - - codecs.emplace(std::pair(SpvOpSampledImage, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {1949759310, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpSampledImage, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpImageSampleImplicitLod, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(87, { - {0, 0, 0}, - {236660303, 0, 0}, - {347505241, 0, 0}, - {426360862, 0, 0}, - {439998433, 0, 0}, - {488500848, 0, 0}, - {495107308, 0, 0}, - {868652905, 0, 0}, - {1191735827, 0, 0}, - {1265998516, 0, 0}, - {1309728002, 0, 0}, - {1365842164, 0, 0}, - {1396344138, 0, 0}, - {1508074873, 0, 0}, - {1553476262, 0, 0}, - {1642818143, 0, 0}, - {1851510470, 0, 0}, - {1858116930, 0, 0}, - {1863199739, 0, 0}, - {1979978194, 0, 0}, - {1986584654, 0, 0}, - {2092100514, 0, 0}, - {2098706974, 0, 0}, - {2231688008, 0, 0}, - {2232491275, 0, 0}, - {2329992200, 0, 0}, - {2637935122, 0, 0}, - {2693892518, 0, 0}, - {2759250216, 0, 0}, - {2839765116, 0, 0}, - {2855895374, 0, 0}, - {2913136690, 0, 0}, - {3012980338, 0, 0}, - {3327770644, 0, 0}, - {3362344229, 0, 0}, - {3398925952, 0, 0}, - {3448018532, 0, 0}, - {3457985288, 0, 0}, - {3566035349, 0, 0}, - {3657635382, 0, 0}, - {3702405475, 0, 0}, - {3757479030, 0, 0}, - {3797204453, 0, 0}, - {4291477370, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 32, 28}, - {0, 9, 35}, - {0, 31, 11}, - {0, 10, 30}, - {0, 25, 21}, - {0, 40, 2}, - {0, 15, 19}, - {0, 24, 36}, - {0, 42, 4}, - {0, 18, 16}, - {0, 29, 26}, - {0, 43, 7}, - {0, 45, 8}, - {0, 37, 13}, - {0, 47, 46}, - {0, 48, 33}, - {0, 49, 14}, - {0, 3, 22}, - {0, 50, 12}, - {0, 41, 39}, - {0, 51, 34}, - {0, 52, 20}, - {0, 54, 53}, - {0, 56, 55}, - {0, 58, 57}, - {0, 60, 59}, - {0, 61, 23}, - {0, 63, 62}, - {0, 65, 64}, - {0, 27, 66}, - {0, 67, 38}, - {0, 68, 17}, - {0, 70, 69}, - {0, 72, 71}, - {0, 74, 73}, - {0, 76, 75}, - {0, 5, 77}, - {0, 78, 1}, - {0, 80, 79}, - {0, 82, 81}, - {0, 83, 6}, - {0, 85, 84}, - {0, 44, 86}, - })); - - codecs.emplace(std::pair(SpvOpImageSampleImplicitLod, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(15, { - {0, 0, 0}, - {883854656, 0, 0}, - {1962971231, 0, 0}, - {2036361232, 0, 0}, - {2356768706, 0, 0}, - {2637132451, 0, 0}, - {3237903670, 0, 0}, - {3829682756, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 8, 2}, - {0, 6, 9}, - {0, 10, 7}, - {0, 4, 5}, - {0, 12, 11}, - {0, 3, 13}, - {0, 14, 1}, - })); - - codecs.emplace(std::pair(SpvOpImageSampleImplicitLod, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(87, { - {0, 0, 0}, - {150685616, 0, 0}, - {255302575, 0, 0}, - {414620710, 0, 0}, - {557400685, 0, 0}, - {575205902, 0, 0}, - {618761615, 0, 0}, - {646282397, 0, 0}, - {686024761, 0, 0}, - {740921498, 0, 0}, - {921246433, 0, 0}, - {1057578789, 0, 0}, - {1162127370, 0, 0}, - {1329499601, 0, 0}, - {1352628475, 0, 0}, - {1502028603, 0, 0}, - {1519723107, 0, 0}, - {1543798545, 0, 0}, - {1545450160, 0, 0}, - {1570165302, 0, 0}, - {1600392975, 0, 0}, - {1641415225, 0, 0}, - {2204920111, 0, 0}, - {2257971049, 0, 0}, - {2276405827, 0, 0}, - {2339018837, 0, 0}, - {2340670452, 0, 0}, - {2517964682, 0, 0}, - {2532518896, 0, 0}, - {2674090849, 0, 0}, - {2754074729, 0, 0}, - {2804281092, 0, 0}, - {2816338013, 0, 0}, - {2841008029, 0, 0}, - {3234673086, 0, 0}, - {3249261197, 0, 0}, - {3619787319, 0, 0}, - {3627739127, 0, 0}, - {3669223677, 0, 0}, - {3787567939, 0, 0}, - {3898287302, 0, 0}, - {4142016703, 0, 0}, - {4237092412, 0, 0}, - {4285779501, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 16, 15}, - {0, 2, 33}, - {0, 41, 35}, - {0, 32, 30}, - {0, 39, 38}, - {0, 5, 1}, - {0, 9, 43}, - {0, 40, 22}, - {0, 29, 12}, - {0, 4, 3}, - {0, 25, 37}, - {0, 34, 26}, - {0, 45, 19}, - {0, 31, 24}, - {0, 47, 46}, - {0, 48, 20}, - {0, 49, 6}, - {0, 8, 21}, - {0, 50, 11}, - {0, 13, 10}, - {0, 51, 42}, - {0, 52, 23}, - {0, 54, 53}, - {0, 56, 55}, - {0, 58, 57}, - {0, 60, 59}, - {0, 61, 28}, - {0, 63, 62}, - {0, 65, 64}, - {0, 17, 66}, - {0, 67, 18}, - {0, 68, 7}, - {0, 70, 69}, - {0, 72, 71}, - {0, 74, 73}, - {0, 76, 75}, - {0, 14, 77}, - {0, 78, 27}, - {0, 80, 79}, - {0, 82, 81}, - {0, 83, 36}, - {0, 85, 84}, - {0, 44, 86}, - })); - - codecs.emplace(std::pair(SpvOpImageSampleImplicitLod, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {2855506940, 0, 0}, - {3266548732, 0, 0}, - {3732640764, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 1}, - {0, 5, 4}, - {0, 3, 6}, - })); - - codecs.emplace(std::pair(SpvOpImageSampleImplicitLod, 5), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpImageSampleExplicitLod, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(139, { - {0, 0, 0}, - {27177503, 0, 0}, - {30663912, 0, 0}, - {151672195, 0, 0}, - {162608772, 0, 0}, - {180913835, 0, 0}, - {371621315, 0, 0}, - {414444763, 0, 0}, - {421602934, 0, 0}, - {443347828, 0, 0}, - {458937500, 0, 0}, - {587888644, 0, 0}, - {601656217, 0, 0}, - {665789406, 0, 0}, - {712168842, 0, 0}, - {730943059, 0, 0}, - {750870327, 0, 0}, - {875212982, 0, 0}, - {899320334, 0, 0}, - {973908139, 0, 0}, - {989813600, 0, 0}, - {1057606514, 0, 0}, - {1171541710, 0, 0}, - {1243764146, 0, 0}, - {1310404265, 0, 0}, - {1366337101, 0, 0}, - {1443547269, 0, 0}, - {1472185378, 0, 0}, - {1473799048, 0, 0}, - {1543935193, 0, 0}, - {1572834111, 0, 0}, - {1623013158, 0, 0}, - {1686512349, 0, 0}, - {1705716306, 0, 0}, - {1747355813, 0, 0}, - {1755165354, 0, 0}, - {1781864804, 0, 0}, - {1916983087, 0, 0}, - {1941403425, 0, 0}, - {2023008475, 0, 0}, - {2043684541, 0, 0}, - {2274226560, 0, 0}, - {2285438321, 0, 0}, - {2315690100, 0, 0}, - {2344328209, 0, 0}, - {2414725163, 0, 0}, - {2493146691, 0, 0}, - {2495155989, 0, 0}, - {2558655180, 0, 0}, - {2577859137, 0, 0}, - {2857814560, 0, 0}, - {2895151306, 0, 0}, - {2986830770, 0, 0}, - {3006548167, 0, 0}, - {3127329373, 0, 0}, - {3157581152, 0, 0}, - {3216471040, 0, 0}, - {3296722158, 0, 0}, - {3367298820, 0, 0}, - {3376009661, 0, 0}, - {3450001968, 0, 0}, - {3526837441, 0, 0}, - {3609540589, 0, 0}, - {3743398113, 0, 0}, - {3858973601, 0, 0}, - {3953984401, 0, 0}, - {3999472204, 0, 0}, - {4088613871, 0, 0}, - {4184019303, 0, 0}, - {4258229445, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 31, 16}, - {0, 58, 47}, - {0, 21, 61}, - {0, 6, 14}, - {0, 65, 23}, - {0, 35, 5}, - {0, 2, 7}, - {0, 10, 25}, - {0, 40, 22}, - {0, 9, 50}, - {0, 20, 11}, - {0, 38, 36}, - {0, 13, 12}, - {0, 67, 28}, - {0, 71, 68}, - {0, 73, 72}, - {0, 3, 29}, - {0, 27, 8}, - {0, 44, 37}, - {0, 74, 63}, - {0, 76, 75}, - {0, 18, 1}, - {0, 78, 77}, - {0, 80, 79}, - {0, 82, 81}, - {0, 26, 15}, - {0, 83, 43}, - {0, 85, 84}, - {0, 19, 86}, - {0, 48, 32}, - {0, 33, 46}, - {0, 87, 49}, - {0, 89, 88}, - {0, 91, 90}, - {0, 41, 30}, - {0, 52, 42}, - {0, 64, 55}, - {0, 92, 53}, - {0, 94, 93}, - {0, 51, 39}, - {0, 45, 95}, - {0, 66, 54}, - {0, 97, 96}, - {0, 57, 98}, - {0, 99, 69}, - {0, 101, 100}, - {0, 56, 102}, - {0, 4, 59}, - {0, 34, 17}, - {0, 103, 24}, - {0, 105, 104}, - {0, 107, 106}, - {0, 109, 108}, - {0, 60, 110}, - {0, 111, 62}, - {0, 113, 112}, - {0, 115, 114}, - {0, 117, 116}, - {0, 119, 118}, - {0, 121, 120}, - {0, 123, 122}, - {0, 125, 124}, - {0, 127, 126}, - {0, 129, 128}, - {0, 70, 130}, - {0, 132, 131}, - {0, 134, 133}, - {0, 136, 135}, - {0, 138, 137}, - })); - - codecs.emplace(std::pair(SpvOpImageSampleExplicitLod, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(11, { - {0, 0, 0}, - {883854656, 0, 0}, - {1962971231, 0, 0}, - {2036361232, 0, 0}, - {2366506734, 0, 0}, - {3829682756, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 2}, - {0, 6, 7}, - {0, 8, 5}, - {0, 3, 9}, - {0, 1, 10}, - })); - - codecs.emplace(std::pair(SpvOpImageSampleExplicitLod, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(73, { - {0, 0, 0}, - {178571546, 0, 0}, - {223310468, 0, 0}, - {388034151, 0, 0}, - {449954059, 0, 0}, - {694743357, 0, 0}, - {797415788, 0, 0}, - {835638766, 0, 0}, - {1002144380, 0, 0}, - {1221183390, 0, 0}, - {1570165302, 0, 0}, - {1663234329, 0, 0}, - {1750829822, 0, 0}, - {1894133125, 0, 0}, - {1967643923, 0, 0}, - {1980341560, 0, 0}, - {2278706468, 0, 0}, - {2326990117, 0, 0}, - {2464905186, 0, 0}, - {2511346984, 0, 0}, - {2517964682, 0, 0}, - {2616085763, 0, 0}, - {2710583246, 0, 0}, - {2745872368, 0, 0}, - {2924263085, 0, 0}, - {3027500544, 0, 0}, - {3044723416, 0, 0}, - {3202324433, 0, 0}, - {3289213933, 0, 0}, - {3323682385, 0, 0}, - {3366848728, 0, 0}, - {3417583519, 0, 0}, - {3732916270, 0, 0}, - {3787909072, 0, 0}, - {3877813395, 0, 0}, - {4028028350, 0, 0}, - {4178218543, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 36, 31}, - {0, 15, 3}, - {0, 17, 1}, - {0, 24, 12}, - {0, 35, 34}, - {0, 28, 27}, - {0, 21, 38}, - {0, 6, 13}, - {0, 14, 7}, - {0, 39, 25}, - {0, 40, 30}, - {0, 42, 41}, - {0, 32, 43}, - {0, 23, 9}, - {0, 11, 44}, - {0, 45, 22}, - {0, 47, 46}, - {0, 2, 16}, - {0, 49, 48}, - {0, 4, 50}, - {0, 51, 18}, - {0, 53, 52}, - {0, 33, 54}, - {0, 26, 55}, - {0, 57, 56}, - {0, 5, 58}, - {0, 59, 8}, - {0, 19, 60}, - {0, 10, 61}, - {0, 29, 62}, - {0, 37, 63}, - {0, 65, 64}, - {0, 67, 66}, - {0, 20, 68}, - {0, 70, 69}, - {0, 72, 71}, - })); - - codecs.emplace(std::pair(SpvOpImageSampleExplicitLod, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {2855506940, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpImageSampleExplicitLod, 5), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(13, { - {0, 0, 0}, - {3533637837, 0, 0}, - {3535289452, 0, 0}, - {3536941067, 0, 0}, - {3538592682, 0, 0}, - {3540244297, 0, 0}, - {3541895912, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 7}, - {0, 2, 8}, - {0, 9, 3}, - {0, 4, 10}, - {0, 5, 11}, - {0, 12, 6}, - })); - - codecs.emplace(std::pair(SpvOpImageSampleExplicitLod, 6), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 5}, - {0, 2, 6}, - {0, 1, 3}, - {0, 8, 7}, - })); - - codecs.emplace(std::pair(SpvOpFAdd, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(45, { - {0, 0, 0}, - {328661377, 0, 0}, - {464259778, 0, 0}, - {920941800, 0, 0}, - {969500141, 0, 0}, - {1449907751, 0, 0}, - {1451831482, 0, 0}, - {1543798545, 0, 0}, - {1545450160, 0, 0}, - {1626224034, 0, 0}, - {1669930486, 0, 0}, - {1770165905, 0, 0}, - {2278571792, 0, 0}, - {2432827426, 0, 0}, - {2656211099, 0, 0}, - {2736844435, 0, 0}, - {2870852215, 0, 0}, - {2919626325, 0, 0}, - {2923708820, 0, 0}, - {3325419312, 0, 0}, - {3678875745, 0, 0}, - {4182141402, 0, 0}, - {4241374559, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 2, 6}, - {0, 9, 13}, - {0, 5, 15}, - {0, 4, 11}, - {0, 20, 22}, - {0, 10, 1}, - {0, 18, 14}, - {0, 16, 3}, - {0, 12, 21}, - {0, 8, 7}, - {0, 24, 17}, - {0, 19, 25}, - {0, 27, 26}, - {0, 29, 28}, - {0, 31, 30}, - {0, 33, 32}, - {0, 35, 34}, - {0, 37, 36}, - {0, 39, 38}, - {0, 41, 40}, - {0, 43, 42}, - {0, 23, 44}, - })); - - codecs.emplace(std::pair(SpvOpFAdd, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(89, { - {0, 0, 0}, - {135920445, 0, 0}, - {176166202, 0, 0}, - {294390719, 0, 0}, - {296981500, 0, 0}, - {743407979, 0, 0}, - {810488476, 0, 0}, - {837715723, 0, 0}, - {885020215, 0, 0}, - {922996215, 0, 0}, - {959681532, 0, 0}, - {963902061, 0, 0}, - {1136775085, 0, 0}, - {1189681639, 0, 0}, - {1203545131, 0, 0}, - {1297294717, 0, 0}, - {1317058015, 0, 0}, - {1352397672, 0, 0}, - {1367301635, 0, 0}, - {1412908157, 0, 0}, - {1570165302, 0, 0}, - {1763758554, 0, 0}, - {1791427568, 0, 0}, - {1992893964, 0, 0}, - {2013867381, 0, 0}, - {2096388952, 0, 0}, - {2219733501, 0, 0}, - {2383939514, 0, 0}, - {2517964682, 0, 0}, - {2555315060, 0, 0}, - {2572638469, 0, 0}, - {2762094724, 0, 0}, - {2770161927, 0, 0}, - {2855506940, 0, 0}, - {3044188332, 0, 0}, - {3187066832, 0, 0}, - {3319278167, 0, 0}, - {3653838348, 0, 0}, - {3675926744, 0, 0}, - {3701632935, 0, 0}, - {3712946115, 0, 0}, - {3732709413, 0, 0}, - {3743748793, 0, 0}, - {3783543823, 0, 0}, - {3930727258, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 15, 12}, - {0, 38, 16}, - {0, 41, 40}, - {0, 1, 33}, - {0, 21, 34}, - {0, 9, 2}, - {0, 24, 7}, - {0, 39, 44}, - {0, 29, 22}, - {0, 17, 19}, - {0, 36, 32}, - {0, 26, 18}, - {0, 30, 3}, - {0, 11, 8}, - {0, 42, 35}, - {0, 46, 31}, - {0, 27, 5}, - {0, 48, 47}, - {0, 28, 49}, - {0, 51, 50}, - {0, 52, 23}, - {0, 54, 53}, - {0, 13, 14}, - {0, 6, 55}, - {0, 57, 56}, - {0, 59, 58}, - {0, 60, 43}, - {0, 62, 61}, - {0, 37, 63}, - {0, 65, 64}, - {0, 67, 66}, - {0, 69, 68}, - {0, 70, 4}, - {0, 10, 71}, - {0, 72, 20}, - {0, 74, 73}, - {0, 76, 75}, - {0, 78, 77}, - {0, 80, 79}, - {0, 81, 25}, - {0, 83, 82}, - {0, 85, 84}, - {0, 87, 86}, - {0, 45, 88}, - })); - - codecs.emplace(std::pair(SpvOpFAdd, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(103, { - {0, 0, 0}, - {126463145, 0, 0}, - {220008971, 0, 0}, - {246375791, 0, 0}, - {503145996, 0, 0}, - {628331516, 0, 0}, - {643418617, 0, 0}, - {743407979, 0, 0}, - {837715723, 0, 0}, - {858902117, 0, 0}, - {870594305, 0, 0}, - {939671928, 0, 0}, - {959681532, 0, 0}, - {1051471757, 0, 0}, - {1092948665, 0, 0}, - {1097775533, 0, 0}, - {1136775085, 0, 0}, - {1140367371, 0, 0}, - {1332643570, 0, 0}, - {1367301635, 0, 0}, - {1558001705, 0, 0}, - {1684282922, 0, 0}, - {2096388952, 0, 0}, - {2183547611, 0, 0}, - {2219733501, 0, 0}, - {2358141757, 0, 0}, - {2359973133, 0, 0}, - {2383939514, 0, 0}, - {2444465148, 0, 0}, - {2517964682, 0, 0}, - {2567901801, 0, 0}, - {2598189097, 0, 0}, - {2655147757, 0, 0}, - {2683080096, 0, 0}, - {2705434194, 0, 0}, - {2738307068, 0, 0}, - {2780898906, 0, 0}, - {3030911670, 0, 0}, - {3032677281, 0, 0}, - {3063300848, 0, 0}, - {3277199633, 0, 0}, - {3289969989, 0, 0}, - {3401762422, 0, 0}, - {3436143898, 0, 0}, - {3560552546, 0, 0}, - {3656163446, 0, 0}, - {3675926744, 0, 0}, - {3701632935, 0, 0}, - {3743748793, 0, 0}, - {3752211294, 0, 0}, - {3794803132, 0, 0}, - {4241374559, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 21}, - {0, 17, 11}, - {0, 36, 35}, - {0, 46, 45}, - {0, 50, 49}, - {0, 9, 3}, - {0, 20, 47}, - {0, 37, 31}, - {0, 2, 34}, - {0, 40, 13}, - {0, 51, 32}, - {0, 41, 10}, - {0, 38, 19}, - {0, 18, 44}, - {0, 43, 16}, - {0, 48, 24}, - {0, 26, 5}, - {0, 53, 8}, - {0, 15, 7}, - {0, 25, 23}, - {0, 54, 27}, - {0, 56, 55}, - {0, 58, 57}, - {0, 60, 59}, - {0, 39, 42}, - {0, 62, 61}, - {0, 30, 63}, - {0, 4, 64}, - {0, 65, 28}, - {0, 66, 22}, - {0, 68, 67}, - {0, 69, 14}, - {0, 70, 33}, - {0, 71, 6}, - {0, 73, 72}, - {0, 75, 74}, - {0, 29, 76}, - {0, 78, 77}, - {0, 80, 79}, - {0, 82, 81}, - {0, 84, 83}, - {0, 86, 85}, - {0, 88, 87}, - {0, 90, 89}, - {0, 91, 12}, - {0, 93, 92}, - {0, 95, 94}, - {0, 97, 96}, - {0, 99, 98}, - {0, 101, 100}, - {0, 52, 102}, - })); - - codecs.emplace(std::pair(SpvOpFAdd, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 5}, - {0, 4, 6}, - {0, 1, 7}, - {0, 2, 8}, - })); - - codecs.emplace(std::pair(SpvOpFSub, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(159, { - {0, 0, 0}, - {50385656, 0, 0}, - {117250846, 0, 0}, - {171494987, 0, 0}, - {195244192, 0, 0}, - {210754155, 0, 0}, - {265392489, 0, 0}, - {333855951, 0, 0}, - {416853049, 0, 0}, - {529068443, 0, 0}, - {533021259, 0, 0}, - {615982737, 0, 0}, - {660038281, 0, 0}, - {663341511, 0, 0}, - {669812542, 0, 0}, - {716890919, 0, 0}, - {1081536219, 0, 0}, - {1119744229, 0, 0}, - {1123617794, 0, 0}, - {1139547465, 0, 0}, - {1162789888, 0, 0}, - {1178317551, 0, 0}, - {1190147516, 0, 0}, - {1193734351, 0, 0}, - {1215030156, 0, 0}, - {1220749418, 0, 0}, - {1318479490, 0, 0}, - {1461398554, 0, 0}, - {1486207619, 0, 0}, - {1551372768, 0, 0}, - {1763758554, 0, 0}, - {1797960910, 0, 0}, - {1850331254, 0, 0}, - {1894417995, 0, 0}, - {1964254745, 0, 0}, - {1965902997, 0, 0}, - {1989327599, 0, 0}, - {2095027856, 0, 0}, - {2123683379, 0, 0}, - {2124837447, 0, 0}, - {2137526937, 0, 0}, - {2269114589, 0, 0}, - {2269130237, 0, 0}, - {2330636993, 0, 0}, - {2481746922, 0, 0}, - {2503770904, 0, 0}, - {2589449658, 0, 0}, - {2603020391, 0, 0}, - {2604576561, 0, 0}, - {2795773560, 0, 0}, - {2835131395, 0, 0}, - {2852854788, 0, 0}, - {2890638791, 0, 0}, - {2895413148, 0, 0}, - {2950446516, 0, 0}, - {2963744582, 0, 0}, - {3079287749, 0, 0}, - {3088785099, 0, 0}, - {3280064277, 0, 0}, - {3335250889, 0, 0}, - {3510242586, 0, 0}, - {3517169445, 0, 0}, - {3518703473, 0, 0}, - {3536471583, 0, 0}, - {3579593979, 0, 0}, - {3591222197, 0, 0}, - {3673811979, 0, 0}, - {3727034815, 0, 0}, - {3730093054, 0, 0}, - {3898287302, 0, 0}, - {3944781937, 0, 0}, - {3950980241, 0, 0}, - {4033586023, 0, 0}, - {4041974454, 0, 0}, - {4052965752, 0, 0}, - {4083161638, 0, 0}, - {4167600590, 0, 0}, - {4185661467, 0, 0}, - {4237092412, 0, 0}, - {4244540017, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 44, 18}, - {0, 69, 57}, - {0, 24, 16}, - {0, 79, 5}, - {0, 59, 4}, - {0, 76, 40}, - {0, 53, 45}, - {0, 14, 2}, - {0, 62, 61}, - {0, 33, 75}, - {0, 38, 37}, - {0, 42, 58}, - {0, 66, 47}, - {0, 63, 67}, - {0, 1, 7}, - {0, 10, 3}, - {0, 13, 12}, - {0, 23, 22}, - {0, 32, 28}, - {0, 36, 35}, - {0, 72, 49}, - {0, 74, 73}, - {0, 77, 55}, - {0, 27, 41}, - {0, 31, 15}, - {0, 6, 54}, - {0, 78, 17}, - {0, 81, 56}, - {0, 83, 82}, - {0, 85, 84}, - {0, 48, 30}, - {0, 71, 60}, - {0, 65, 51}, - {0, 87, 86}, - {0, 50, 34}, - {0, 89, 88}, - {0, 90, 9}, - {0, 25, 8}, - {0, 92, 91}, - {0, 93, 26}, - {0, 95, 94}, - {0, 52, 39}, - {0, 29, 20}, - {0, 97, 96}, - {0, 99, 98}, - {0, 101, 100}, - {0, 64, 102}, - {0, 104, 103}, - {0, 106, 105}, - {0, 21, 107}, - {0, 108, 68}, - {0, 109, 46}, - {0, 110, 11}, - {0, 112, 111}, - {0, 114, 113}, - {0, 116, 115}, - {0, 117, 70}, - {0, 43, 118}, - {0, 120, 119}, - {0, 122, 121}, - {0, 124, 123}, - {0, 126, 125}, - {0, 128, 127}, - {0, 129, 19}, - {0, 131, 130}, - {0, 133, 132}, - {0, 135, 134}, - {0, 137, 136}, - {0, 139, 138}, - {0, 141, 140}, - {0, 143, 142}, - {0, 145, 144}, - {0, 147, 146}, - {0, 149, 148}, - {0, 151, 150}, - {0, 153, 152}, - {0, 155, 154}, - {0, 157, 156}, - {0, 158, 80}, - })); - - codecs.emplace(std::pair(SpvOpFSub, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(103, { - {0, 0, 0}, - {50998433, 0, 0}, - {171494987, 0, 0}, - {249378857, 0, 0}, - {296981500, 0, 0}, - {508007510, 0, 0}, - {610429940, 0, 0}, - {660038281, 0, 0}, - {663341511, 0, 0}, - {836581417, 0, 0}, - {1027242654, 0, 0}, - {1167160774, 0, 0}, - {1191015885, 0, 0}, - {1200870684, 0, 0}, - {1203545131, 0, 0}, - {1265796414, 0, 0}, - {1319785741, 0, 0}, - {1669959736, 0, 0}, - {1684282922, 0, 0}, - {1752686878, 0, 0}, - {1850331254, 0, 0}, - {1901166356, 0, 0}, - {1906988301, 0, 0}, - {2055836767, 0, 0}, - {2095027856, 0, 0}, - {2096388952, 0, 0}, - {2144962711, 0, 0}, - {2217833278, 0, 0}, - {2500819054, 0, 0}, - {2525173102, 0, 0}, - {2575525651, 0, 0}, - {2660843182, 0, 0}, - {2855506940, 0, 0}, - {2918750759, 0, 0}, - {2919787747, 0, 0}, - {3091876332, 0, 0}, - {3187066832, 0, 0}, - {3244209297, 0, 0}, - {3423702268, 0, 0}, - {3508792859, 0, 0}, - {3548535223, 0, 0}, - {3619787319, 0, 0}, - {3653838348, 0, 0}, - {3692647551, 0, 0}, - {3713290482, 0, 0}, - {3753486980, 0, 0}, - {3783756895, 0, 0}, - {3797961332, 0, 0}, - {3836822275, 0, 0}, - {4043078107, 0, 0}, - {4052965752, 0, 0}, - {4091394002, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 31, 49}, - {0, 24, 19}, - {0, 46, 45}, - {0, 6, 48}, - {0, 12, 33}, - {0, 17, 21}, - {0, 43, 11}, - {0, 7, 2}, - {0, 9, 8}, - {0, 28, 13}, - {0, 44, 38}, - {0, 30, 50}, - {0, 26, 22}, - {0, 29, 51}, - {0, 34, 37}, - {0, 53, 40}, - {0, 23, 54}, - {0, 55, 25}, - {0, 27, 18}, - {0, 1, 10}, - {0, 57, 56}, - {0, 59, 58}, - {0, 5, 47}, - {0, 60, 20}, - {0, 62, 61}, - {0, 64, 63}, - {0, 66, 65}, - {0, 67, 39}, - {0, 69, 68}, - {0, 16, 70}, - {0, 3, 71}, - {0, 73, 72}, - {0, 41, 15}, - {0, 35, 74}, - {0, 76, 75}, - {0, 78, 77}, - {0, 36, 79}, - {0, 81, 80}, - {0, 83, 82}, - {0, 14, 84}, - {0, 86, 85}, - {0, 88, 87}, - {0, 32, 89}, - {0, 42, 90}, - {0, 92, 91}, - {0, 94, 93}, - {0, 96, 95}, - {0, 98, 97}, - {0, 52, 99}, - {0, 100, 4}, - {0, 102, 101}, - })); - - codecs.emplace(std::pair(SpvOpFSub, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(157, { - {0, 0, 0}, - {49456560, 0, 0}, - {170690025, 0, 0}, - {243178923, 0, 0}, - {295017943, 0, 0}, - {296981500, 0, 0}, - {330249537, 0, 0}, - {435256475, 0, 0}, - {443558693, 0, 0}, - {456043370, 0, 0}, - {470277359, 0, 0}, - {592180731, 0, 0}, - {663258455, 0, 0}, - {706238670, 0, 0}, - {810488476, 0, 0}, - {870594305, 0, 0}, - {877895868, 0, 0}, - {900522183, 0, 0}, - {1077859090, 0, 0}, - {1082941229, 0, 0}, - {1104362365, 0, 0}, - {1132589448, 0, 0}, - {1173092699, 0, 0}, - {1203545131, 0, 0}, - {1265796414, 0, 0}, - {1278818058, 0, 0}, - {1285705317, 0, 0}, - {1319785741, 0, 0}, - {1382106590, 0, 0}, - {1461897718, 0, 0}, - {1474506522, 0, 0}, - {1530183840, 0, 0}, - {1558001705, 0, 0}, - {1558990974, 0, 0}, - {1616846013, 0, 0}, - {1633850097, 0, 0}, - {1684282922, 0, 0}, - {1725011064, 0, 0}, - {1767704813, 0, 0}, - {1923453688, 0, 0}, - {1941148668, 0, 0}, - {1955104493, 0, 0}, - {2022961611, 0, 0}, - {2162274327, 0, 0}, - {2212501241, 0, 0}, - {2219733501, 0, 0}, - {2234361374, 0, 0}, - {2272221101, 0, 0}, - {2305269460, 0, 0}, - {2488410748, 0, 0}, - {2566666743, 0, 0}, - {2598189097, 0, 0}, - {2775815164, 0, 0}, - {2793529873, 0, 0}, - {2844616706, 0, 0}, - {2970183398, 0, 0}, - {3103302036, 0, 0}, - {3110479131, 0, 0}, - {3115038057, 0, 0}, - {3116932970, 0, 0}, - {3152745753, 0, 0}, - {3187066832, 0, 0}, - {3244209297, 0, 0}, - {3383007207, 0, 0}, - {3392887901, 0, 0}, - {3508792859, 0, 0}, - {3737376990, 0, 0}, - {3753486980, 0, 0}, - {3765247327, 0, 0}, - {3817149113, 0, 0}, - {3839047923, 0, 0}, - {3886529747, 0, 0}, - {4044928561, 0, 0}, - {4061558677, 0, 0}, - {4069720347, 0, 0}, - {4069810315, 0, 0}, - {4128942283, 0, 0}, - {4164704452, 0, 0}, - {4273793488, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 74, 47}, - {0, 34, 33}, - {0, 36, 14}, - {0, 61, 48}, - {0, 13, 31}, - {0, 39, 25}, - {0, 37, 29}, - {0, 65, 54}, - {0, 4, 73}, - {0, 38, 10}, - {0, 15, 43}, - {0, 6, 35}, - {0, 9, 16}, - {0, 30, 19}, - {0, 49, 44}, - {0, 57, 53}, - {0, 60, 58}, - {0, 72, 66}, - {0, 59, 76}, - {0, 1, 68}, - {0, 70, 42}, - {0, 63, 3}, - {0, 28, 69}, - {0, 17, 55}, - {0, 45, 64}, - {0, 81, 80}, - {0, 7, 82}, - {0, 12, 11}, - {0, 21, 50}, - {0, 83, 18}, - {0, 22, 84}, - {0, 85, 26}, - {0, 20, 86}, - {0, 87, 40}, - {0, 56, 88}, - {0, 90, 89}, - {0, 92, 91}, - {0, 93, 2}, - {0, 95, 94}, - {0, 97, 96}, - {0, 98, 41}, - {0, 100, 99}, - {0, 101, 52}, - {0, 103, 102}, - {0, 77, 71}, - {0, 104, 78}, - {0, 105, 46}, - {0, 32, 8}, - {0, 106, 51}, - {0, 108, 107}, - {0, 23, 109}, - {0, 110, 27}, - {0, 112, 111}, - {0, 113, 75}, - {0, 115, 114}, - {0, 117, 116}, - {0, 119, 118}, - {0, 121, 120}, - {0, 123, 122}, - {0, 124, 62}, - {0, 126, 125}, - {0, 128, 127}, - {0, 67, 129}, - {0, 131, 130}, - {0, 5, 132}, - {0, 134, 133}, - {0, 136, 135}, - {0, 138, 137}, - {0, 139, 24}, - {0, 141, 140}, - {0, 143, 142}, - {0, 145, 144}, - {0, 147, 146}, - {0, 149, 148}, - {0, 151, 150}, - {0, 153, 152}, - {0, 79, 154}, - {0, 156, 155}, - })); - - codecs.emplace(std::pair(SpvOpFSub, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 5}, - {0, 3, 6}, - {0, 1, 7}, - {0, 8, 2}, - })); - - codecs.emplace(std::pair(SpvOpFMul, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(41, { - {0, 0, 0}, - {342197850, 0, 0}, - {885020215, 0, 0}, - {963902061, 0, 0}, - {1041368449, 0, 0}, - {1352397672, 0, 0}, - {1791427568, 0, 0}, - {2013867381, 0, 0}, - {2513230733, 0, 0}, - {2555315060, 0, 0}, - {2562485583, 0, 0}, - {2567901801, 0, 0}, - {2655147757, 0, 0}, - {2680283743, 0, 0}, - {2752766693, 0, 0}, - {2806716850, 0, 0}, - {3030911670, 0, 0}, - {3401762422, 0, 0}, - {3697738938, 0, 0}, - {4164704452, 0, 0}, - {4273793488, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 14, 10}, - {0, 7, 16}, - {0, 1, 15}, - {0, 9, 6}, - {0, 4, 12}, - {0, 18, 5}, - {0, 13, 2}, - {0, 19, 3}, - {0, 17, 20}, - {0, 23, 22}, - {0, 24, 8}, - {0, 26, 25}, - {0, 27, 11}, - {0, 29, 28}, - {0, 31, 30}, - {0, 33, 32}, - {0, 35, 34}, - {0, 37, 36}, - {0, 39, 38}, - {0, 21, 40}, - })); - - codecs.emplace(std::pair(SpvOpFMul, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(129, { - {0, 0, 0}, - {126463145, 0, 0}, - {129135650, 0, 0}, - {200922300, 0, 0}, - {328661377, 0, 0}, - {354479447, 0, 0}, - {360730278, 0, 0}, - {451264926, 0, 0}, - {529068443, 0, 0}, - {593829839, 0, 0}, - {742917749, 0, 0}, - {761731755, 0, 0}, - {810488476, 0, 0}, - {870594305, 0, 0}, - {894529125, 0, 0}, - {959681532, 0, 0}, - {1054461787, 0, 0}, - {1077859090, 0, 0}, - {1086964761, 0, 0}, - {1158929937, 0, 0}, - {1168927492, 0, 0}, - {1196280518, 0, 0}, - {1203545131, 0, 0}, - {1367301635, 0, 0}, - {1508550646, 0, 0}, - {1618544981, 0, 0}, - {1661163736, 0, 0}, - {1684282922, 0, 0}, - {1766994680, 0, 0}, - {1830851200, 0, 0}, - {1901166356, 0, 0}, - {1955104493, 0, 0}, - {2055836767, 0, 0}, - {2096388952, 0, 0}, - {2100052708, 0, 0}, - {2161102232, 0, 0}, - {2197904616, 0, 0}, - {2262137600, 0, 0}, - {2278571792, 0, 0}, - {2281956980, 0, 0}, - {2438466459, 0, 0}, - {2443959748, 0, 0}, - {2517964682, 0, 0}, - {2557754096, 0, 0}, - {2622612602, 0, 0}, - {2660843182, 0, 0}, - {2736844435, 0, 0}, - {2780898906, 0, 0}, - {3044188332, 0, 0}, - {3059119137, 0, 0}, - {3194725903, 0, 0}, - {3270430997, 0, 0}, - {3337532056, 0, 0}, - {3407526215, 0, 0}, - {3496407048, 0, 0}, - {3504158761, 0, 0}, - {3534518722, 0, 0}, - {3570411982, 0, 0}, - {3701632935, 0, 0}, - {3929248764, 0, 0}, - {3944781937, 0, 0}, - {3970432934, 0, 0}, - {4008405264, 0, 0}, - {4245257809, 0, 0}, - {4253051659, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 6, 26}, - {0, 46, 24}, - {0, 64, 50}, - {0, 7, 17}, - {0, 40, 57}, - {0, 56, 49}, - {0, 34, 10}, - {0, 32, 61}, - {0, 36, 44}, - {0, 8, 43}, - {0, 4, 18}, - {0, 25, 23}, - {0, 9, 54}, - {0, 45, 41}, - {0, 13, 21}, - {0, 47, 31}, - {0, 39, 53}, - {0, 11, 3}, - {0, 29, 20}, - {0, 38, 58}, - {0, 37, 14}, - {0, 66, 52}, - {0, 67, 35}, - {0, 48, 68}, - {0, 1, 69}, - {0, 70, 28}, - {0, 27, 63}, - {0, 72, 71}, - {0, 74, 73}, - {0, 75, 60}, - {0, 77, 76}, - {0, 5, 51}, - {0, 15, 78}, - {0, 30, 79}, - {0, 55, 80}, - {0, 42, 81}, - {0, 83, 82}, - {0, 85, 84}, - {0, 86, 2}, - {0, 19, 16}, - {0, 87, 59}, - {0, 62, 88}, - {0, 90, 89}, - {0, 22, 91}, - {0, 93, 92}, - {0, 95, 94}, - {0, 97, 96}, - {0, 99, 98}, - {0, 101, 100}, - {0, 12, 102}, - {0, 104, 103}, - {0, 33, 105}, - {0, 107, 106}, - {0, 109, 108}, - {0, 111, 110}, - {0, 113, 112}, - {0, 115, 114}, - {0, 117, 116}, - {0, 119, 118}, - {0, 121, 120}, - {0, 123, 122}, - {0, 125, 124}, - {0, 127, 126}, - {0, 65, 128}, - })); - - codecs.emplace(std::pair(SpvOpFMul, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(127, { - {0, 0, 0}, - {13319433, 0, 0}, - {15502752, 0, 0}, - {162608772, 0, 0}, - {171307615, 0, 0}, - {296981500, 0, 0}, - {354479447, 0, 0}, - {413918748, 0, 0}, - {443490822, 0, 0}, - {487719832, 0, 0}, - {593829839, 0, 0}, - {615982737, 0, 0}, - {703543228, 0, 0}, - {810488476, 0, 0}, - {870594305, 0, 0}, - {875212982, 0, 0}, - {959681532, 0, 0}, - {1019457583, 0, 0}, - {1203545131, 0, 0}, - {1278448636, 0, 0}, - {1325348861, 0, 0}, - {1368383673, 0, 0}, - {1400019344, 0, 0}, - {1646147798, 0, 0}, - {1679946323, 0, 0}, - {1684282922, 0, 0}, - {1747355813, 0, 0}, - {1755648697, 0, 0}, - {1793544760, 0, 0}, - {1811839150, 0, 0}, - {1901166356, 0, 0}, - {1947620272, 0, 0}, - {1992893964, 0, 0}, - {2042001863, 0, 0}, - {2096388952, 0, 0}, - {2123388694, 0, 0}, - {2128251367, 0, 0}, - {2130747644, 0, 0}, - {2135340676, 0, 0}, - {2161102232, 0, 0}, - {2443959748, 0, 0}, - {2513230733, 0, 0}, - {2557754096, 0, 0}, - {2580096524, 0, 0}, - {2589449658, 0, 0}, - {2614879967, 0, 0}, - {2698156268, 0, 0}, - {2970183398, 0, 0}, - {3002890475, 0, 0}, - {3133016299, 0, 0}, - {3142155593, 0, 0}, - {3187066832, 0, 0}, - {3266548732, 0, 0}, - {3287039847, 0, 0}, - {3357301402, 0, 0}, - {3413713311, 0, 0}, - {3434076295, 0, 0}, - {3496407048, 0, 0}, - {3504158761, 0, 0}, - {3882634684, 0, 0}, - {3929248764, 0, 0}, - {3987079331, 0, 0}, - {4076840151, 0, 0}, - {4243119782, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 31, 8}, - {0, 14, 56}, - {0, 7, 12}, - {0, 9, 30}, - {0, 42, 36}, - {0, 19, 11}, - {0, 22, 40}, - {0, 15, 3}, - {0, 57, 26}, - {0, 58, 61}, - {0, 55, 51}, - {0, 48, 34}, - {0, 20, 1}, - {0, 24, 23}, - {0, 46, 35}, - {0, 59, 49}, - {0, 21, 63}, - {0, 62, 44}, - {0, 6, 50}, - {0, 28, 18}, - {0, 66, 65}, - {0, 41, 32}, - {0, 39, 54}, - {0, 53, 67}, - {0, 68, 37}, - {0, 33, 69}, - {0, 43, 70}, - {0, 71, 38}, - {0, 72, 27}, - {0, 13, 47}, - {0, 45, 73}, - {0, 75, 74}, - {0, 76, 5}, - {0, 77, 17}, - {0, 79, 78}, - {0, 52, 80}, - {0, 2, 81}, - {0, 83, 82}, - {0, 85, 84}, - {0, 87, 86}, - {0, 4, 88}, - {0, 16, 29}, - {0, 90, 89}, - {0, 92, 91}, - {0, 94, 93}, - {0, 60, 95}, - {0, 97, 96}, - {0, 98, 10}, - {0, 25, 99}, - {0, 101, 100}, - {0, 103, 102}, - {0, 105, 104}, - {0, 107, 106}, - {0, 109, 108}, - {0, 111, 110}, - {0, 113, 112}, - {0, 115, 114}, - {0, 117, 116}, - {0, 119, 118}, - {0, 121, 120}, - {0, 123, 122}, - {0, 125, 124}, - {0, 64, 126}, - })); - - codecs.emplace(std::pair(SpvOpFMul, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(9, { - {0, 0, 0}, - {679771963, 0, 0}, - {1951208733, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 4, 5}, - {0, 3, 6}, - {0, 7, 1}, - {0, 2, 8}, - })); - - codecs.emplace(std::pair(SpvOpFDiv, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(153, { - {0, 0, 0}, - {10142671, 0, 0}, - {27865391, 0, 0}, - {29517006, 0, 0}, - {41739659, 0, 0}, - {97231530, 0, 0}, - {171334650, 0, 0}, - {200553094, 0, 0}, - {257136089, 0, 0}, - {294390719, 0, 0}, - {375530199, 0, 0}, - {380957745, 0, 0}, - {388034151, 0, 0}, - {455591063, 0, 0}, - {462664429, 0, 0}, - {491456522, 0, 0}, - {502863753, 0, 0}, - {626480004, 0, 0}, - {643418617, 0, 0}, - {651464351, 0, 0}, - {701281393, 0, 0}, - {744817486, 0, 0}, - {783918780, 0, 0}, - {862784766, 0, 0}, - {930804377, 0, 0}, - {952536201, 0, 0}, - {955476870, 0, 0}, - {1043738701, 0, 0}, - {1047011733, 0, 0}, - {1080545747, 0, 0}, - {1137442027, 0, 0}, - {1235468610, 0, 0}, - {1412908157, 0, 0}, - {1431749301, 0, 0}, - {1434223270, 0, 0}, - {1440646342, 0, 0}, - {1508570930, 0, 0}, - {1510422521, 0, 0}, - {1548121999, 0, 0}, - {1582841441, 0, 0}, - {1612225949, 0, 0}, - {1665981878, 0, 0}, - {1680746207, 0, 0}, - {1696076631, 0, 0}, - {1702168830, 0, 0}, - {1761469971, 0, 0}, - {1799299383, 0, 0}, - {1910240213, 0, 0}, - {1917451875, 0, 0}, - {1945006185, 0, 0}, - {1998444837, 0, 0}, - {2045285083, 0, 0}, - {2217966239, 0, 0}, - {2279273489, 0, 0}, - {2289803479, 0, 0}, - {2348676810, 0, 0}, - {2353194283, 0, 0}, - {2403632109, 0, 0}, - {2409539315, 0, 0}, - {2414984922, 0, 0}, - {2477389837, 0, 0}, - {2524531022, 0, 0}, - {2573160348, 0, 0}, - {2639720559, 0, 0}, - {2773229577, 0, 0}, - {2796513469, 0, 0}, - {2881225774, 0, 0}, - {2890570341, 0, 0}, - {2952850186, 0, 0}, - {3023287679, 0, 0}, - {3118548424, 0, 0}, - {3877813395, 0, 0}, - {3931288033, 0, 0}, - {3972309363, 0, 0}, - {4117704995, 0, 0}, - {4140081844, 0, 0}, - {4258414038, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 74, 53}, - {0, 58, 52}, - {0, 65, 60}, - {0, 41, 5}, - {0, 1, 67}, - {0, 24, 28}, - {0, 27, 26}, - {0, 55, 31}, - {0, 36, 61}, - {0, 13, 49}, - {0, 56, 48}, - {0, 16, 64}, - {0, 76, 42}, - {0, 45, 29}, - {0, 23, 6}, - {0, 72, 12}, - {0, 35, 19}, - {0, 20, 7}, - {0, 21, 46}, - {0, 71, 78}, - {0, 80, 79}, - {0, 47, 17}, - {0, 81, 70}, - {0, 34, 25}, - {0, 83, 82}, - {0, 85, 84}, - {0, 37, 86}, - {0, 87, 73}, - {0, 10, 4}, - {0, 40, 30}, - {0, 88, 57}, - {0, 54, 89}, - {0, 50, 90}, - {0, 11, 91}, - {0, 39, 15}, - {0, 59, 44}, - {0, 92, 66}, - {0, 69, 93}, - {0, 95, 94}, - {0, 14, 96}, - {0, 98, 97}, - {0, 62, 51}, - {0, 100, 99}, - {0, 102, 101}, - {0, 104, 103}, - {0, 32, 43}, - {0, 105, 38}, - {0, 107, 106}, - {0, 109, 108}, - {0, 22, 9}, - {0, 33, 110}, - {0, 2, 111}, - {0, 112, 3}, - {0, 114, 113}, - {0, 116, 115}, - {0, 68, 63}, - {0, 118, 117}, - {0, 120, 119}, - {0, 121, 8}, - {0, 123, 122}, - {0, 125, 124}, - {0, 127, 126}, - {0, 129, 128}, - {0, 131, 130}, - {0, 133, 132}, - {0, 75, 18}, - {0, 135, 134}, - {0, 137, 136}, - {0, 139, 138}, - {0, 141, 140}, - {0, 143, 142}, - {0, 145, 144}, - {0, 147, 146}, - {0, 149, 148}, - {0, 150, 77}, - {0, 152, 151}, - })); - - codecs.emplace(std::pair(SpvOpFDiv, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(131, { - {0, 0, 0}, - {5908395, 0, 0}, - {139011596, 0, 0}, - {296981500, 0, 0}, - {342615870, 0, 0}, - {370232173, 0, 0}, - {492958971, 0, 0}, - {528662843, 0, 0}, - {551924251, 0, 0}, - {604894932, 0, 0}, - {610429940, 0, 0}, - {780957373, 0, 0}, - {810488476, 0, 0}, - {872544165, 0, 0}, - {878733439, 0, 0}, - {918849409, 0, 0}, - {959681532, 0, 0}, - {1013756921, 0, 0}, - {1038982109, 0, 0}, - {1081611718, 0, 0}, - {1125913837, 0, 0}, - {1209418480, 0, 0}, - {1318081294, 0, 0}, - {1367301635, 0, 0}, - {1417425499, 0, 0}, - {1625742020, 0, 0}, - {1684282922, 0, 0}, - {1746004874, 0, 0}, - {1758287856, 0, 0}, - {1777640493, 0, 0}, - {2066323109, 0, 0}, - {2094550054, 0, 0}, - {2096388952, 0, 0}, - {2144962711, 0, 0}, - {2434845539, 0, 0}, - {2480811229, 0, 0}, - {2552825357, 0, 0}, - {2636946065, 0, 0}, - {2651956495, 0, 0}, - {2669086217, 0, 0}, - {2680819379, 0, 0}, - {2709694527, 0, 0}, - {2715304020, 0, 0}, - {2790648021, 0, 0}, - {2802261839, 0, 0}, - {2806296851, 0, 0}, - {2864543087, 0, 0}, - {2952260510, 0, 0}, - {2963184673, 0, 0}, - {3091876332, 0, 0}, - {3098991995, 0, 0}, - {3131890669, 0, 0}, - {3138977758, 0, 0}, - {3198541202, 0, 0}, - {3260579369, 0, 0}, - {3263841912, 0, 0}, - {3335250889, 0, 0}, - {3345856521, 0, 0}, - {3381478137, 0, 0}, - {3489269251, 0, 0}, - {3510242586, 0, 0}, - {3820814597, 0, 0}, - {3900859293, 0, 0}, - {4041974454, 0, 0}, - {4244540017, 0, 0}, - {4265894873, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 15, 52}, - {0, 20, 18}, - {0, 39, 29}, - {0, 9, 43}, - {0, 22, 13}, - {0, 46, 27}, - {0, 51, 48}, - {0, 19, 57}, - {0, 34, 24}, - {0, 64, 59}, - {0, 5, 7}, - {0, 38, 37}, - {0, 45, 47}, - {0, 2, 56}, - {0, 67, 8}, - {0, 17, 68}, - {0, 69, 61}, - {0, 70, 6}, - {0, 55, 54}, - {0, 72, 71}, - {0, 4, 73}, - {0, 74, 40}, - {0, 30, 11}, - {0, 42, 36}, - {0, 75, 58}, - {0, 31, 76}, - {0, 1, 77}, - {0, 44, 14}, - {0, 78, 50}, - {0, 79, 23}, - {0, 26, 80}, - {0, 81, 12}, - {0, 83, 82}, - {0, 84, 21}, - {0, 32, 85}, - {0, 87, 86}, - {0, 35, 10}, - {0, 88, 62}, - {0, 90, 89}, - {0, 41, 91}, - {0, 92, 53}, - {0, 93, 63}, - {0, 95, 94}, - {0, 33, 96}, - {0, 98, 97}, - {0, 99, 3}, - {0, 100, 28}, - {0, 101, 49}, - {0, 102, 60}, - {0, 104, 103}, - {0, 106, 105}, - {0, 108, 107}, - {0, 110, 109}, - {0, 65, 111}, - {0, 25, 112}, - {0, 114, 113}, - {0, 116, 115}, - {0, 117, 16}, - {0, 119, 118}, - {0, 121, 120}, - {0, 123, 122}, - {0, 125, 124}, - {0, 127, 126}, - {0, 128, 66}, - {0, 130, 129}, - })); - - codecs.emplace(std::pair(SpvOpFDiv, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(95, { - {0, 0, 0}, - {116093251, 0, 0}, - {149720480, 0, 0}, - {183103444, 0, 0}, - {251209228, 0, 0}, - {296981500, 0, 0}, - {357505993, 0, 0}, - {394654115, 0, 0}, - {410274915, 0, 0}, - {452208841, 0, 0}, - {788046331, 0, 0}, - {797934924, 0, 0}, - {810488476, 0, 0}, - {1144188012, 0, 0}, - {1220127364, 0, 0}, - {1321616112, 0, 0}, - {1324351672, 0, 0}, - {1348149915, 0, 0}, - {1459457331, 0, 0}, - {1465623797, 0, 0}, - {1531216990, 0, 0}, - {1543672828, 0, 0}, - {1578775276, 0, 0}, - {1738815671, 0, 0}, - {1904128160, 0, 0}, - {2071351379, 0, 0}, - {2119793999, 0, 0}, - {2274779301, 0, 0}, - {2291766425, 0, 0}, - {2357410109, 0, 0}, - {2438466459, 0, 0}, - {2496463830, 0, 0}, - {2630220147, 0, 0}, - {2682510803, 0, 0}, - {3047649911, 0, 0}, - {3085703811, 0, 0}, - {3235459678, 0, 0}, - {3261703164, 0, 0}, - {3331487616, 0, 0}, - {3462674048, 0, 0}, - {3570219049, 0, 0}, - {3585315836, 0, 0}, - {3602108619, 0, 0}, - {3724004880, 0, 0}, - {3931641900, 0, 0}, - {3955205564, 0, 0}, - {4073492988, 0, 0}, - {4127308103, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 24, 37}, - {0, 13, 38}, - {0, 17, 39}, - {0, 35, 23}, - {0, 18, 36}, - {0, 46, 19}, - {0, 20, 33}, - {0, 47, 6}, - {0, 1, 45}, - {0, 3, 27}, - {0, 8, 49}, - {0, 50, 29}, - {0, 10, 51}, - {0, 43, 31}, - {0, 53, 52}, - {0, 54, 26}, - {0, 7, 55}, - {0, 56, 32}, - {0, 57, 41}, - {0, 59, 58}, - {0, 61, 60}, - {0, 63, 62}, - {0, 64, 25}, - {0, 2, 34}, - {0, 65, 14}, - {0, 67, 66}, - {0, 12, 21}, - {0, 9, 68}, - {0, 69, 16}, - {0, 71, 70}, - {0, 72, 44}, - {0, 11, 73}, - {0, 74, 30}, - {0, 4, 75}, - {0, 28, 15}, - {0, 76, 42}, - {0, 5, 77}, - {0, 78, 40}, - {0, 80, 79}, - {0, 82, 81}, - {0, 22, 83}, - {0, 85, 84}, - {0, 86, 48}, - {0, 88, 87}, - {0, 90, 89}, - {0, 92, 91}, - {0, 94, 93}, - })); - - codecs.emplace(std::pair(SpvOpFDiv, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(7, { - {0, 0, 0}, - {679771963, 0, 0}, - {2320303498, 0, 0}, - {3334207724, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 3, 4}, - {0, 2, 5}, - {0, 1, 6}, - })); - - codecs.emplace(std::pair(SpvOpVectorTimesScalar, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(121, { - {0, 0, 0}, - {14113753, 0, 0}, - {102358168, 0, 0}, - {179458548, 0, 0}, - {330388453, 0, 0}, - {386525753, 0, 0}, - {470277359, 0, 0}, - {497658126, 0, 0}, - {508007510, 0, 0}, - {815034111, 0, 0}, - {826214242, 0, 0}, - {849867303, 0, 0}, - {885645401, 0, 0}, - {939415664, 0, 0}, - {968885186, 0, 0}, - {1105835505, 0, 0}, - {1159301677, 0, 0}, - {1461897718, 0, 0}, - {1482251215, 0, 0}, - {1486206763, 0, 0}, - {1527762373, 0, 0}, - {1558990974, 0, 0}, - {1618754372, 0, 0}, - {1669959736, 0, 0}, - {1752686878, 0, 0}, - {2004567202, 0, 0}, - {2055637638, 0, 0}, - {2113506324, 0, 0}, - {2154320787, 0, 0}, - {2162274327, 0, 0}, - {2306141594, 0, 0}, - {2345566651, 0, 0}, - {2457690657, 0, 0}, - {2473053808, 0, 0}, - {2500422644, 0, 0}, - {2504802016, 0, 0}, - {2506771164, 0, 0}, - {2793529873, 0, 0}, - {2801333547, 0, 0}, - {2879050471, 0, 0}, - {3032677281, 0, 0}, - {3045470312, 0, 0}, - {3181546731, 0, 0}, - {3240977890, 0, 0}, - {3262572726, 0, 0}, - {3307100165, 0, 0}, - {3425841570, 0, 0}, - {3560552546, 0, 0}, - {3641833815, 0, 0}, - {3652695478, 0, 0}, - {3782362128, 0, 0}, - {3797961332, 0, 0}, - {3837583704, 0, 0}, - {3886529747, 0, 0}, - {3907920335, 0, 0}, - {4043078107, 0, 0}, - {4044928561, 0, 0}, - {4069720347, 0, 0}, - {4180570743, 0, 0}, - {4245743275, 0, 0}, - {4285201458, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 44, 28}, - {0, 13, 45}, - {0, 19, 15}, - {0, 32, 31}, - {0, 43, 42}, - {0, 16, 52}, - {0, 33, 22}, - {0, 57, 55}, - {0, 24, 21}, - {0, 2, 59}, - {0, 10, 3}, - {0, 18, 12}, - {0, 41, 39}, - {0, 60, 46}, - {0, 4, 25}, - {0, 58, 49}, - {0, 14, 1}, - {0, 27, 17}, - {0, 50, 36}, - {0, 23, 54}, - {0, 5, 30}, - {0, 11, 7}, - {0, 38, 29}, - {0, 37, 8}, - {0, 48, 56}, - {0, 20, 6}, - {0, 34, 26}, - {0, 63, 62}, - {0, 65, 64}, - {0, 67, 66}, - {0, 69, 68}, - {0, 71, 70}, - {0, 73, 72}, - {0, 75, 74}, - {0, 9, 76}, - {0, 78, 77}, - {0, 80, 79}, - {0, 82, 81}, - {0, 84, 83}, - {0, 40, 35}, - {0, 85, 47}, - {0, 86, 51}, - {0, 88, 87}, - {0, 90, 89}, - {0, 53, 91}, - {0, 93, 92}, - {0, 95, 94}, - {0, 97, 96}, - {0, 99, 98}, - {0, 101, 100}, - {0, 103, 102}, - {0, 105, 104}, - {0, 107, 106}, - {0, 109, 108}, - {0, 111, 110}, - {0, 113, 112}, - {0, 115, 114}, - {0, 117, 116}, - {0, 119, 118}, - {0, 61, 120}, - })); - - codecs.emplace(std::pair(SpvOpVectorTimesScalar, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(127, { - {0, 0, 0}, - {100979271, 0, 0}, - {269576093, 0, 0}, - {314809953, 0, 0}, - {354479447, 0, 0}, - {497658126, 0, 0}, - {882718761, 0, 0}, - {968885186, 0, 0}, - {973908139, 0, 0}, - {1019457583, 0, 0}, - {1191015885, 0, 0}, - {1266262705, 0, 0}, - {1310404265, 0, 0}, - {1325348861, 0, 0}, - {1367301635, 0, 0}, - {1368383673, 0, 0}, - {1570165302, 0, 0}, - {1618544981, 0, 0}, - {1646147798, 0, 0}, - {1674464100, 0, 0}, - {1679946323, 0, 0}, - {1686512349, 0, 0}, - {1766401548, 0, 0}, - {1774052499, 0, 0}, - {1788301425, 0, 0}, - {2023008475, 0, 0}, - {2055836767, 0, 0}, - {2096388952, 0, 0}, - {2123388694, 0, 0}, - {2129301998, 0, 0}, - {2212501241, 0, 0}, - {2274226560, 0, 0}, - {2362972044, 0, 0}, - {2378763734, 0, 0}, - {2506771164, 0, 0}, - {2558655180, 0, 0}, - {2622612602, 0, 0}, - {2660843182, 0, 0}, - {2698156268, 0, 0}, - {2801333547, 0, 0}, - {2850246066, 0, 0}, - {2895151306, 0, 0}, - {2970183398, 0, 0}, - {2986830770, 0, 0}, - {3001444829, 0, 0}, - {3133016299, 0, 0}, - {3152745753, 0, 0}, - {3187066832, 0, 0}, - {3261122899, 0, 0}, - {3496407048, 0, 0}, - {3513669836, 0, 0}, - {3536390697, 0, 0}, - {3570411982, 0, 0}, - {3653838348, 0, 0}, - {3713290482, 0, 0}, - {3858973601, 0, 0}, - {3873587660, 0, 0}, - {3877583949, 0, 0}, - {3882634684, 0, 0}, - {3907920335, 0, 0}, - {3997432565, 0, 0}, - {4169226615, 0, 0}, - {4219766939, 0, 0}, - {4243119782, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 25, 12}, - {0, 41, 29}, - {0, 56, 44}, - {0, 1, 3}, - {0, 48, 24}, - {0, 33, 60}, - {0, 8, 50}, - {0, 35, 21}, - {0, 11, 7}, - {0, 34, 23}, - {0, 59, 57}, - {0, 10, 62}, - {0, 40, 2}, - {0, 5, 49}, - {0, 39, 17}, - {0, 9, 61}, - {0, 30, 6}, - {0, 19, 46}, - {0, 53, 54}, - {0, 31, 52}, - {0, 55, 43}, - {0, 66, 65}, - {0, 16, 67}, - {0, 51, 68}, - {0, 70, 69}, - {0, 26, 36}, - {0, 72, 71}, - {0, 74, 73}, - {0, 76, 75}, - {0, 78, 77}, - {0, 80, 79}, - {0, 82, 81}, - {0, 37, 83}, - {0, 85, 84}, - {0, 13, 86}, - {0, 20, 18}, - {0, 38, 28}, - {0, 58, 45}, - {0, 87, 63}, - {0, 15, 88}, - {0, 32, 22}, - {0, 89, 4}, - {0, 90, 14}, - {0, 91, 42}, - {0, 93, 92}, - {0, 95, 94}, - {0, 97, 96}, - {0, 99, 98}, - {0, 101, 100}, - {0, 103, 102}, - {0, 105, 104}, - {0, 107, 106}, - {0, 109, 108}, - {0, 111, 110}, - {0, 113, 112}, - {0, 115, 114}, - {0, 27, 47}, - {0, 117, 116}, - {0, 119, 118}, - {0, 121, 120}, - {0, 123, 122}, - {0, 125, 124}, - {0, 126, 64}, - })); - - codecs.emplace(std::pair(SpvOpVectorTimesScalar, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(137, { - {0, 0, 0}, - {11698369, 0, 0}, - {146392076, 0, 0}, - {151810803, 0, 0}, - {223800276, 0, 0}, - {227103506, 0, 0}, - {253329281, 0, 0}, - {346929928, 0, 0}, - {461040879, 0, 0}, - {629859130, 0, 0}, - {680157484, 0, 0}, - {783918780, 0, 0}, - {810488476, 0, 0}, - {824323032, 0, 0}, - {870594305, 0, 0}, - {959681532, 0, 0}, - {975807626, 0, 0}, - {1081642571, 0, 0}, - {1084574846, 0, 0}, - {1094817798, 0, 0}, - {1141965917, 0, 0}, - {1164137269, 0, 0}, - {1166917451, 0, 0}, - {1204787336, 0, 0}, - {1232501371, 0, 0}, - {1318479490, 0, 0}, - {1369818198, 0, 0}, - {1372785527, 0, 0}, - {1526654696, 0, 0}, - {1543672828, 0, 0}, - {1548121999, 0, 0}, - {1635292159, 0, 0}, - {1641070431, 0, 0}, - {1684282922, 0, 0}, - {1767704813, 0, 0}, - {1781765116, 0, 0}, - {1838763297, 0, 0}, - {1901166356, 0, 0}, - {1904846533, 0, 0}, - {2011183308, 0, 0}, - {2032069771, 0, 0}, - {2071351379, 0, 0}, - {2087004702, 0, 0}, - {2244928358, 0, 0}, - {2314864456, 0, 0}, - {2374216296, 0, 0}, - {2394332122, 0, 0}, - {2443610186, 0, 0}, - {2524697596, 0, 0}, - {2526961521, 0, 0}, - {2568098594, 0, 0}, - {2807907995, 0, 0}, - {3103302036, 0, 0}, - {3117071189, 0, 0}, - {3188115516, 0, 0}, - {3417584874, 0, 0}, - {3554463148, 0, 0}, - {3561482820, 0, 0}, - {3691770462, 0, 0}, - {3729929345, 0, 0}, - {3733675151, 0, 0}, - {3831290364, 0, 0}, - {3866493821, 0, 0}, - {3929248764, 0, 0}, - {4060703604, 0, 0}, - {4092487128, 0, 0}, - {4167600590, 0, 0}, - {4214779116, 0, 0}, - {4248015868, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 36, 13}, - {0, 49, 60}, - {0, 51, 9}, - {0, 3, 62}, - {0, 67, 41}, - {0, 4, 31}, - {0, 66, 5}, - {0, 55, 32}, - {0, 2, 1}, - {0, 30, 16}, - {0, 7, 38}, - {0, 19, 10}, - {0, 34, 20}, - {0, 45, 46}, - {0, 22, 11}, - {0, 25, 23}, - {0, 40, 39}, - {0, 21, 57}, - {0, 6, 35}, - {0, 61, 8}, - {0, 52, 26}, - {0, 70, 59}, - {0, 71, 14}, - {0, 68, 47}, - {0, 73, 72}, - {0, 29, 74}, - {0, 76, 75}, - {0, 77, 17}, - {0, 79, 78}, - {0, 81, 80}, - {0, 82, 18}, - {0, 83, 42}, - {0, 85, 84}, - {0, 87, 86}, - {0, 27, 37}, - {0, 53, 43}, - {0, 89, 88}, - {0, 64, 54}, - {0, 90, 65}, - {0, 92, 91}, - {0, 58, 93}, - {0, 56, 48}, - {0, 94, 28}, - {0, 96, 95}, - {0, 98, 97}, - {0, 44, 99}, - {0, 101, 100}, - {0, 15, 12}, - {0, 103, 102}, - {0, 104, 33}, - {0, 106, 105}, - {0, 108, 107}, - {0, 24, 109}, - {0, 111, 110}, - {0, 113, 112}, - {0, 114, 50}, - {0, 116, 115}, - {0, 118, 117}, - {0, 120, 119}, - {0, 122, 121}, - {0, 124, 123}, - {0, 126, 125}, - {0, 128, 127}, - {0, 129, 63}, - {0, 131, 130}, - {0, 133, 132}, - {0, 135, 134}, - {0, 136, 69}, - })); - - codecs.emplace(std::pair(SpvOpVectorTimesScalar, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {1951208733, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpDot, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(97, { - {0, 0, 0}, - {78001013, 0, 0}, - {170690025, 0, 0}, - {206688607, 0, 0}, - {443490822, 0, 0}, - {461476226, 0, 0}, - {537830163, 0, 0}, - {669982125, 0, 0}, - {790502615, 0, 0}, - {805072272, 0, 0}, - {1173092699, 0, 0}, - {1220643281, 0, 0}, - {1448448666, 0, 0}, - {1466804584, 0, 0}, - {1473411044, 0, 0}, - {1515695460, 0, 0}, - {1587730355, 0, 0}, - {1625742020, 0, 0}, - {2071351379, 0, 0}, - {2250055803, 0, 0}, - {2291766425, 0, 0}, - {2416108131, 0, 0}, - {2427834344, 0, 0}, - {2436009347, 0, 0}, - {2455417440, 0, 0}, - {2480811229, 0, 0}, - {2654325647, 0, 0}, - {2919796598, 0, 0}, - {3047649911, 0, 0}, - {3088511797, 0, 0}, - {3104643263, 0, 0}, - {3198541202, 0, 0}, - {3204986803, 0, 0}, - {3272233597, 0, 0}, - {3383007207, 0, 0}, - {3602108619, 0, 0}, - {3622349409, 0, 0}, - {3714664910, 0, 0}, - {3717942504, 0, 0}, - {3732000233, 0, 0}, - {3759072440, 0, 0}, - {3765247327, 0, 0}, - {3805423332, 0, 0}, - {3829325073, 0, 0}, - {3866493821, 0, 0}, - {4058280485, 0, 0}, - {4061558677, 0, 0}, - {4148979936, 0, 0}, - {4155586396, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 13, 38}, - {0, 39, 14}, - {0, 44, 9}, - {0, 48, 47}, - {0, 23, 15}, - {0, 33, 25}, - {0, 1, 42}, - {0, 5, 46}, - {0, 31, 3}, - {0, 36, 28}, - {0, 16, 12}, - {0, 32, 22}, - {0, 41, 21}, - {0, 6, 50}, - {0, 51, 29}, - {0, 45, 34}, - {0, 37, 8}, - {0, 19, 52}, - {0, 11, 4}, - {0, 43, 40}, - {0, 27, 53}, - {0, 54, 10}, - {0, 24, 55}, - {0, 57, 56}, - {0, 58, 26}, - {0, 2, 59}, - {0, 61, 60}, - {0, 63, 62}, - {0, 65, 64}, - {0, 20, 66}, - {0, 30, 35}, - {0, 67, 17}, - {0, 68, 7}, - {0, 70, 69}, - {0, 71, 18}, - {0, 73, 72}, - {0, 75, 74}, - {0, 77, 76}, - {0, 79, 78}, - {0, 81, 80}, - {0, 83, 82}, - {0, 85, 84}, - {0, 87, 86}, - {0, 89, 88}, - {0, 91, 90}, - {0, 93, 92}, - {0, 95, 94}, - {0, 49, 96}, - })); - - codecs.emplace(std::pair(SpvOpDot, 1), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(117, { - {0, 0, 0}, - {50385656, 0, 0}, - {181902171, 0, 0}, - {560078433, 0, 0}, - {615982737, 0, 0}, - {674428451, 0, 0}, - {837715723, 0, 0}, - {886972033, 0, 0}, - {900101778, 0, 0}, - {983299427, 0, 0}, - {1237148906, 0, 0}, - {1364157225, 0, 0}, - {1367301635, 0, 0}, - {1380160211, 0, 0}, - {1451831482, 0, 0}, - {1499923635, 0, 0}, - {1570165302, 0, 0}, - {1735295265, 0, 0}, - {1766401548, 0, 0}, - {1796311149, 0, 0}, - {1826456251, 0, 0}, - {1839669171, 0, 0}, - {2012838864, 0, 0}, - {2024071551, 0, 0}, - {2096388952, 0, 0}, - {2161102232, 0, 0}, - {2197874825, 0, 0}, - {2279700640, 0, 0}, - {2289183712, 0, 0}, - {2351620600, 0, 0}, - {2362972044, 0, 0}, - {2472176885, 0, 0}, - {2477434291, 0, 0}, - {2530899578, 0, 0}, - {2531826164, 0, 0}, - {2558133383, 0, 0}, - {2589449658, 0, 0}, - {2621255555, 0, 0}, - {2622612602, 0, 0}, - {2872580757, 0, 0}, - {2881302403, 0, 0}, - {2891091137, 0, 0}, - {2923708820, 0, 0}, - {2936040203, 0, 0}, - {2970183398, 0, 0}, - {3187066832, 0, 0}, - {3224952074, 0, 0}, - {3244383472, 0, 0}, - {3261122899, 0, 0}, - {3362830643, 0, 0}, - {3538158875, 0, 0}, - {3635542517, 0, 0}, - {3682213068, 0, 0}, - {3721902098, 0, 0}, - {3826846522, 0, 0}, - {3877583949, 0, 0}, - {3997432565, 0, 0}, - {4093615095, 0, 0}, - {4106828015, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 52, 28}, - {0, 33, 20}, - {0, 46, 57}, - {0, 47, 54}, - {0, 21, 17}, - {0, 31, 58}, - {0, 12, 53}, - {0, 29, 3}, - {0, 35, 34}, - {0, 48, 41}, - {0, 8, 5}, - {0, 7, 55}, - {0, 37, 32}, - {0, 60, 38}, - {0, 61, 16}, - {0, 14, 62}, - {0, 23, 63}, - {0, 13, 19}, - {0, 64, 9}, - {0, 65, 39}, - {0, 2, 66}, - {0, 67, 42}, - {0, 69, 68}, - {0, 25, 70}, - {0, 1, 49}, - {0, 6, 71}, - {0, 72, 15}, - {0, 73, 11}, - {0, 75, 74}, - {0, 77, 76}, - {0, 4, 78}, - {0, 56, 50}, - {0, 80, 79}, - {0, 10, 81}, - {0, 83, 82}, - {0, 85, 84}, - {0, 86, 27}, - {0, 43, 40}, - {0, 88, 87}, - {0, 44, 24}, - {0, 30, 89}, - {0, 51, 36}, - {0, 45, 90}, - {0, 18, 91}, - {0, 93, 92}, - {0, 22, 94}, - {0, 26, 95}, - {0, 97, 96}, - {0, 99, 98}, - {0, 101, 100}, - {0, 103, 102}, - {0, 105, 104}, - {0, 107, 106}, - {0, 109, 108}, - {0, 111, 110}, - {0, 113, 112}, - {0, 59, 114}, - {0, 116, 115}, - })); - - codecs.emplace(std::pair(SpvOpDot, 2), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(179, { - {0, 0, 0}, - {27177503, 0, 0}, - {50385656, 0, 0}, - {129748122, 0, 0}, - {139011596, 0, 0}, - {162608772, 0, 0}, - {181902171, 0, 0}, - {225200779, 0, 0}, - {342159236, 0, 0}, - {386293029, 0, 0}, - {429023543, 0, 0}, - {443558693, 0, 0}, - {504514034, 0, 0}, - {615982737, 0, 0}, - {669812542, 0, 0}, - {674428451, 0, 0}, - {837715723, 0, 0}, - {861753115, 0, 0}, - {875212982, 0, 0}, - {876867882, 0, 0}, - {899320334, 0, 0}, - {900101778, 0, 0}, - {938517572, 0, 0}, - {1347339159, 0, 0}, - {1356063462, 0, 0}, - {1373856501, 0, 0}, - {1376656865, 0, 0}, - {1451831482, 0, 0}, - {1522979646, 0, 0}, - {1548491889, 0, 0}, - {1570165302, 0, 0}, - {1735295265, 0, 0}, - {1747355813, 0, 0}, - {1766401548, 0, 0}, - {1871105284, 0, 0}, - {1918742169, 0, 0}, - {1922045399, 0, 0}, - {1978689945, 0, 0}, - {2024071551, 0, 0}, - {2059975069, 0, 0}, - {2076833303, 0, 0}, - {2096388952, 0, 0}, - {2181030375, 0, 0}, - {2197874825, 0, 0}, - {2362972044, 0, 0}, - {2414725163, 0, 0}, - {2517964682, 0, 0}, - {2564745684, 0, 0}, - {2577387676, 0, 0}, - {2589449658, 0, 0}, - {2604242419, 0, 0}, - {2683080096, 0, 0}, - {2696349144, 0, 0}, - {2763960513, 0, 0}, - {2817823941, 0, 0}, - {2852854788, 0, 0}, - {2891091137, 0, 0}, - {2919626325, 0, 0}, - {2923708820, 0, 0}, - {2936040203, 0, 0}, - {2963744582, 0, 0}, - {2970183398, 0, 0}, - {2984459037, 0, 0}, - {2996594997, 0, 0}, - {3015046341, 0, 0}, - {3055195668, 0, 0}, - {3127329373, 0, 0}, - {3187066832, 0, 0}, - {3193597927, 0, 0}, - {3200890815, 0, 0}, - {3224258475, 0, 0}, - {3224480461, 0, 0}, - {3261122899, 0, 0}, - {3609540589, 0, 0}, - {3619404941, 0, 0}, - {3619626927, 0, 0}, - {3727034815, 0, 0}, - {3742724777, 0, 0}, - {3742946763, 0, 0}, - {3836179806, 0, 0}, - {3913885196, 0, 0}, - {3927338499, 0, 0}, - {3927466635, 0, 0}, - {3997432565, 0, 0}, - {3999472204, 0, 0}, - {4010499223, 0, 0}, - {4032662899, 0, 0}, - {4110915453, 0, 0}, - {4145966869, 0, 0}, - {4228303141, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 23, 87}, - {0, 9, 28}, - {0, 42, 17}, - {0, 74, 70}, - {0, 86, 77}, - {0, 18, 5}, - {0, 31, 32}, - {0, 34, 3}, - {0, 38, 68}, - {0, 50, 29}, - {0, 72, 62}, - {0, 21, 15}, - {0, 14, 54}, - {0, 56, 22}, - {0, 48, 88}, - {0, 2, 76}, - {0, 6, 47}, - {0, 26, 79}, - {0, 65, 12}, - {0, 37, 81}, - {0, 91, 60}, - {0, 30, 92}, - {0, 25, 7}, - {0, 45, 40}, - {0, 66, 52}, - {0, 71, 69}, - {0, 78, 75}, - {0, 84, 82}, - {0, 94, 93}, - {0, 27, 95}, - {0, 97, 96}, - {0, 99, 98}, - {0, 100, 39}, - {0, 55, 101}, - {0, 58, 102}, - {0, 89, 103}, - {0, 35, 11}, - {0, 104, 36}, - {0, 53, 10}, - {0, 1, 64}, - {0, 73, 20}, - {0, 105, 13}, - {0, 107, 106}, - {0, 8, 16}, - {0, 24, 19}, - {0, 85, 63}, - {0, 109, 108}, - {0, 111, 110}, - {0, 4, 112}, - {0, 114, 113}, - {0, 116, 115}, - {0, 118, 117}, - {0, 83, 119}, - {0, 121, 120}, - {0, 123, 122}, - {0, 49, 44}, - {0, 124, 57}, - {0, 125, 59}, - {0, 126, 67}, - {0, 128, 127}, - {0, 130, 129}, - {0, 132, 131}, - {0, 134, 133}, - {0, 135, 51}, - {0, 137, 136}, - {0, 138, 61}, - {0, 43, 41}, - {0, 140, 139}, - {0, 142, 141}, - {0, 144, 143}, - {0, 146, 145}, - {0, 148, 147}, - {0, 149, 33}, - {0, 80, 150}, - {0, 152, 151}, - {0, 154, 153}, - {0, 156, 155}, - {0, 158, 157}, - {0, 160, 159}, - {0, 162, 161}, - {0, 164, 163}, - {0, 166, 165}, - {0, 168, 167}, - {0, 46, 169}, - {0, 171, 170}, - {0, 90, 172}, - {0, 174, 173}, - {0, 176, 175}, - {0, 178, 177}, - })); - - codecs.emplace(std::pair(SpvOpDot, 3), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {1036475267, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpLabel, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(3, { - {0, 0, 0}, - {1036475267, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 1, 2}, - })); - - codecs.emplace(std::pair(SpvOpBranch, 0), std::move(codec)); - } - - { - std::unique_ptr> codec(new HuffmanCodec(119, { - {0, 0, 0}, - {57149555, 0, 0}, - {139011596, 0, 0}, - {255835594, 0, 0}, - {330249537, 0, 0}, - {388686774, 0, 0}, - {508217552, 0, 0}, - {550831114, 0, 0}, - {559246409, 0, 0}, - {599185303, 0, 0}, - {649208064, 0, 0}, - {679061455, 0, 0}, - {810488476, 0, 0}, - {951841533, 0, 0}, - {1008886329, 0, 0}, - {1022544883, 0, 0}, - {1215030156, 0, 0}, - {1305703280, 0, 0}, - {1367301635, 0, 0}, - {1453447304, 0, 0}, - {1487177499, 0, 0}, - {1603937321, 0, 0}, - {1617826947, 0, 0}, - {1643868273, 0, 0}, - {1672607981, 0, 0}, - {1681941034, 0, 0}, - {1755165354, 0, 0}, - {1781864804, 0, 0}, - {1795715718, 0, 0}, - {1977038330, 0, 0}, - {2096388952, 0, 0}, - {2204920111, 0, 0}, - {2244470522, 0, 0}, - {2330636993, 0, 0}, - {2400601988, 0, 0}, - {2424848261, 0, 0}, - {2603020391, 0, 0}, - {2622612602, 0, 0}, - {2645135839, 0, 0}, - {2660843182, 0, 0}, - {2708915136, 0, 0}, - {2724166585, 0, 0}, - {2728667725, 0, 0}, - {2890638791, 0, 0}, - {2901034693, 0, 0}, - {2941648648, 0, 0}, - {2970183398, 0, 0}, - {2998120306, 0, 0}, - {3123244280, 0, 0}, - {3187066832, 0, 0}, - {3209399506, 0, 0}, - {3230260738, 0, 0}, - {3344189994, 0, 0}, - {3345707173, 0, 0}, - {3367298820, 0, 0}, - {3397078357, 0, 0}, - {3569736966, 0, 0}, - {3816961131, 0, 0}, - {4091670162, 0, 0}, - {4237497041, 0, 0}, - {1111111111111111111, 0, 0}, - {0, 17, 44}, - {0, 25, 20}, - {0, 29, 34}, - {0, 18, 2}, - {0, 54, 49}, - {0, 28, 7}, - {0, 47, 52}, - {0, 23, 56}, - {0, 55, 26}, - {0, 24, 61}, - {0, 13, 62}, - {0, 63, 45}, - {0, 27, 15}, - {0, 64, 8}, - {0, 65, 59}, - {0, 35, 22}, - {0, 53, 38}, - {0, 58, 51}, - {0, 11, 66}, - {0, 10, 3}, - {0, 46, 67}, - {0, 69, 68}, - {0, 1, 50}, - {0, 42, 19}, - {0, 70, 6}, - {0, 31, 71}, - {0, 16, 72}, - {0, 74, 73}, - {0, 76, 75}, - {0, 78, 77}, - {0, 79, 4}, - {0, 5, 37}, - {0, 14, 36}, - {0, 80, 57}, - {0, 81, 48}, - {0, 83, 82}, - {0, 39, 84}, - {0, 86, 85}, - {0, 40, 87}, - {0, 89, 88}, - {0, 91, 90}, - {0, 93, 92}, - {0, 21, 9}, - {0, 41, 32}, - {0, 12, 43}, - {0, 95, 94}, - {0, 97, 96}, - {0, 99, 98}, - {0, 100, 33}, - {0, 60, 101}, - {0, 103, 102}, - {0, 105, 104}, - {0, 107, 106}, - {0, 109, 108}, - {0, 110, 30}, - {0, 112, 111}, - {0, 114, 113}, - {0, 116, 115}, - {0, 118, 117}, - })); - - codecs.emplace(std::pair(SpvOpReturnValue, 0), std::move(codec)); - } - - return codecs; -} - -std::unordered_set GetDescriptorsWithCodingScheme() { - std::unordered_set descriptors_with_coding_scheme = { - 3816961131, - 3569736966, - 3397078357, - 3344189994, - 3230260738, - 2941648648, - 2901034693, - 2728667725, - 2400601988, - 1795715718, - 1681941034, - 1487177499, - 1453447304, - 679061455, - 649208064, - 559246409, - 388686774, - 4228303141, - 4110915453, - 4010499223, - 3927466635, - 3927338499, - 3836179806, - 3742724777, - 3619404941, - 3224480461, - 3224258475, - 3200890815, - 3742946763, - 3193597927, - 2604242419, - 2577387676, - 2181030375, - 1376656865, - 1347339159, - 938517572, - 876867882, - 429023543, - 129748122, - 4106828015, - 4093615095, - 3826846522, - 3721902098, - 3244383472, - 2891091137, - 2872580757, - 2558133383, - 2477434291, - 1839669171, - 2059975069, - 1735295265, - 1364157225, - 1237148906, - 886972033, - 674428451, - 4148979936, - 3805423332, - 3732000233, - 3717942504, - 3714664910, - 3622349409, - 3272233597, - 3204986803, - 3088511797, - 1672607981, - 2416108131, - 2250055803, - 1796311149, - 1515695460, - 537830163, - 461476226, - 206688607, - 78001013, - 3866493821, - 3417584874, - 3188115516, - 2526961521, - 2443610186, - 2394332122, - 2374216296, - 2032069771, - 2011183308, - 1904846533, - 1641070431, - 1635292159, - 1372785527, - 1369818198, - 1204787336, - 1826456251, - 1164137269, - 1081642571, - 629859130, - 253329281, - 227103506, - 11698369, - 4219766939, - 4169226615, - 3997432565, - 3873587660, - 3513669836, - 3261122899, - 2129301998, - 1774052499, - 1266262705, - 4285201458, - 4245743275, - 3907920335, - 3837583704, - 3641833815, - 3307100165, - 1232501371, - 3262572726, - 3045470312, - 2879050471, - 2801333547, - 2506771164, - 2504802016, - 2500422644, - 2473053808, - 2457690657, - 2345566651, - 2306141594, - 2154320787, - 2055637638, - 1527762373, - 1486206763, - 1159301677, - 1105835505, - 968885186, - 885645401, - 849867303, - 815034111, - 497658126, - 386525753, - 179458548, - 102358168, - 4127308103, - 4073492988, - 1473411044, - 805072272, - 3724004880, - 3602108619, - 3585315836, - 3331487616, - 3261703164, - 3235459678, - 3085703811, - 3047649911, - 2357410109, - 2291766425, - 2071351379, - 1904128160, - 1738815671, - 1531216990, - 1465623797, - 1324351672, - 1220127364, - 1144188012, - 183103444, - 116093251, - 3900859293, - 3345856521, - 3691770462, - 3263841912, - 3198541202, - 3098991995, - 3682213068, - 2963184673, - 2864543087, - 2802261839, - 2790648021, - 900101778, - 2715304020, - 100979271, - 2709694527, - 2669086217, - 2531826164, - 2651956495, - 2552825357, - 2480811229, - 3138977758, - 2434845539, - 2066323109, - 1777640493, - 1758287856, - 1746004874, - 3945482286, - 3932146199, - 3129573055, - 3126269825, - 3716914380, - 985750227, - 1543672828, - 3189039115, - 1839499483, - 2696349144, - 1536350567, - 3971481069, - 3001444829, - 4028622909, - 215293834, - 213642219, - 153085016, - 1189681639, - 165054168, - 29517006, - 2614879967, - 27865391, - 1649426421, - 4239834800, - 1947620272, - 28782128, - 3207966516, - 3713290482, - 2042001863, - 2724166585, - 2356768706, - 1793544760, - 4092654294, - 2157103435, - 2087004702, - 2043873558, - 27177503, - 1033363654, - 4214779116, - 408465899, - 451264926, - 2377112119, - 1182296898, - 760554870, - 3566035349, - 2630220147, - 4192247221, - 1572088444, - 3538592682, - 769422756, - 1674803691, - 630964591, - 3458449569, - 565334834, - 137840602, - 3955205564, - 2009007457, - 1258105452, - 333554713, - 3923810593, - 126463145, - 3445109809, - 2966409025, - 2849215484, - 1910240213, - 3131890669, - 586244865, - 2320303498, - 3116932970, - 1317265040, - 2812498065, - 1466938734, - 4064212479, - 2613179511, - 2095546797, - 1671139745, - 2568512089, - 3695940604, - 1119069977, - 215027449, - 4123141705, - 3495546641, - 1978689945, - 3202324433, - 3783543823, - 2674422363, - 1352628475, - 1290956281, - 1894417995, - 740921498, - 4211577142, - 1033081852, - 3884846406, - 3253403867, - 2790624748, - 2538917932, - 2144962711, - 3323202731, - 4290024976, - 2564745684, - 2963744582, - 2443959748, - 354479447, - 750870327, - 1918481917, - 4032662899, - 3587381650, - 2414725163, - 1081611718, - 1625742020, - 2308565678, - 1871105284, - 2807907995, - 2121980967, - 1054641568, - 413918748, - 1917336504, - 1816558243, - 4130950286, - 1522979646, - 1669959736, - 1320550031, - 3104643263, - 3823959661, - 3525913657, - 3584683259, - 2918750759, - 3536390697, - 94303122, - 3296691317, - 801484894, - 2496463830, - 3266028549, - 3085157904, - 973908139, - 3787909072, - 3107413701, - 2378763734, - 920604853, - 2516325050, - 1838993983, - 1603937321, - 3183924418, - 1945006185, - 3982311384, - 2682510803, - 680388473, - 979993429, - 2405770322, - 461040879, - 2817579280, - 14113753, - 2894979602, - 168339452, - 951841533, - 4154758669, - 2637132451, - 3877583949, - 1949856502, - 922996215, - 3941049054, - 4182141402, - 2262220987, - 1957218950, - 2094550054, - 1846856260, - 3499234137, - 3086631065, - 3054834317, - 593829839, - 522971108, - 1162127370, - 4233562270, - 2780190687, - 1558345254, - 3716353056, - 3518630848, - 1158929937, - 2038205856, - 86116519, - 4185661467, - 975807626, - 3910458990, - 4124281183, - 3361419439, - 171334650, - 2590402790, - 2890570341, - 2303184249, - 385229009, - 1998433745, - 1717510093, - 4022124023, - 1429389803, - 945128292, - 904486530, - 3869890846, - 619875033, - 459968607, - 3743748793, - 359054425, - 1417363940, - 3653985133, - 255835594, - 1047011733, - 2763232252, - 1329499601, - 328661377, - 2162274327, - 2100532220, - 4255182614, - 4243119782, - 3982047273, - 4053789056, - 401211099, - 950731750, - 1319785741, - 32085358, - 3882634684, - 3117071189, - 3554463148, - 3570219049, - 3535289452, - 2314864456, - 3913885196, - 2763960513, - 1079999262, - 27130513, - 3033873113, - 2976581453, - 2598189097, - 595410904, - 1572834111, - 13319433, - 1084574846, - 2123388694, - 560078433, - 1679946323, - 3518703473, - 184634770, - 296981500, - 1646147798, - 455591063, - 1325348861, - 3224952074, - 1027242654, - 2281956980, - 4221373527, - 1289566249, - 4044928561, - 882718761, - 1510333659, - 836581417, - 1901166356, - 2276405827, - 4052965752, - 1155765244, - 503145996, - 251209228, - 495107308, - 3944781937, - 37459569, - 4248015868, - 4198082194, - 1302400505, - 4106658327, - 680016782, - 2319227476, - 2738307068, - 3929248764, - 2850246066, - 1824526196, - 3912967080, - 3044723416, - 3133016299, - 2517964682, - 3647586740, - 3653838348, - 929101967, - 3571454885, - 2806296851, - 977312655, - 646282397, - 3448018532, - 824323032, - 204234270, - 1579585816, - 3712763835, - 1212872174, - 3953984401, - 3168953855, - 2944827576, - 1582841441, - 2796901051, - 3323682385, - 1317058015, - 2557550659, - 1620634991, - 2986830770, - 2490492987, - 1817271123, - 40653745, - 1696076631, - 2466126792, - 4169878842, - 3251128023, - 2444465148, - 678695941, - 2481746922, - 2836440943, - 774727851, - 2246405597, - 4028028350, - 2524697596, - 1977038330, - 2817823941, - 2219733501, - 688216667, - 3634598908, - 3232633974, - 2724625059, - 3269075805, - 3732640764, - 2263349224, - 1680746207, - 2414984922, - 2507457870, - 50998433, - 3092528578, - 3712946115, - 1543935193, - 807276090, - 1221183390, - 172029722, - 2122275289, - 3990925720, - 2261697609, - 2736881867, - 295017943, - 3278176820, - 3748965853, - 3174324790, - 1103903216, - 3184177968, - 1113409935, - 2299842241, - 2162986400, - 1538342947, - 4056442905, - 1631434666, - 205885885, - 1594733696, - 1955104493, - 1022309772, - 3820814597, - 993150979, - 1209418480, - 1784441183, - 3958731802, - 2250225826, - 3065160070, - 2024071551, - 107497541, - 628544021, - 2732195517, - 4241486415, - 3969279737, - 870594305, - 2916400082, - 1193734351, - 3202349435, - 3831290364, - 3282979782, - 3928764629, - 1308462133, - 3216471040, - 2433519008, - 2022961611, - 3604842236, - 3374978006, - 2855895374, - 3496407048, - 1482251215, - 3994511488, - 2997832431, - 1132589448, - 1348149915, - 2092468906, - 2451531615, - 779021139, - 3730093054, - 3413713311, - 1022915255, - 2204920111, - 2660843182, - 1080545747, - 1642805350, - 1766422419, - 4141567741, - 1558990974, - 4185590212, - 2841468319, - 701281393, - 3325419312, - 451957774, - 357505993, - 1156369516, - 3187387500, - 2259467579, - 2678954464, - 3154597438, - 543558236, - 2359973133, - 1990431740, - 2705477184, - 1041368449, - 3122368657, - 3181646225, - 1094423548, - 2955375511, - 2888125966, - 153013225, - 2936040203, - 1758530522, - 573901046, - 3030911670, - 1675922848, - 4235213885, - 4091916710, - 2633682514, - 4254584852, - 2328748202, - 3357301402, - 3877813395, - 2004567202, - 2496297824, - 3334207724, - 1600149091, - 293528591, - 1782996825, - 3757282300, - 1107206446, - 1092948665, - 1797960910, - 1206726575, - 1496351055, - 3021406120, - 99347751, - 3797204453, - 1468919488, - 797415788, - 1314843976, - 2934934694, - 490769168, - 1474506522, - 3811268385, - 864295921, - 3081676220, - 151810803, - 2588618056, - 2998120306, - 416853049, - 3495967422, - 3233393284, - 508007510, - 759277550, - 1971252067, - 869050696, - 810488476, - 745556697, - 789872778, - 3362723943, - 1617826947, - 3260309823, - 2197904616, - 1199157863, - 1643868273, - 2430404313, - 321630747, - 2503194620, - 3194725903, - 2881225774, - 3997952447, - 1389644742, - 2713718873, - 3585511591, - 1684282922, - 3366848728, - 284226441, - 1541020250, - 4018237905, - 1369578001, - 2424848261, - 2654325647, - 1626224034, - 1081536219, - 309040124, - 123060826, - 3997038726, - 1670691893, - 1543280290, - 443347828, - 1776629361, - 3118548424, - 478440524, - 679771963, - 3729929345, - 4244789645, - 2366506734, - 2838165089, - 1619778288, - 1313182965, - 3240680626, - 1323407757, - 883854656, - 2194691858, - 15502752, - 3760372982, - 1366337101, - 3656163446, - 295018543, - 825595257, - 57149555, - 2563789125, - 2353194283, - 2636942752, - 4026740269, - 3570411982, - 123108003, - 3782362128, - 1280126114, - 1410849099, - 4228502127, - 3609540589, - 3365041621, - 269823086, - 348988933, - 1636389511, - 2936586309, - 2761603302, - 2318200267, - 449954059, - 2895413148, - 1755165354, - 4274214049, - 778500192, - 3345707173, - 3732136051, - 721450866, - 1600392975, - 2466255445, - 4050155669, - 3541895912, - 1139547465, - 394654115, - 1380991098, - 3516240523, - 2234361374, - 1094817798, - 744817486, - 3564402361, - 1452222566, - 1851510470, - 3619787319, - 4265894873, - 216945449, - 3061690214, - 2910557180, - 255227811, - 4167600590, - 1587209598, - 3157581152, - 3184381405, - 2572638469, - 615748604, - 2532518896, - 1774874546, - 599185303, - 1561718045, - 1742737136, - 1674464100, - 3136865519, - 706016261, - 2793529873, - 3504981554, - 4155122613, - 2080953106, - 1104362365, - 2879917501, - 850497536, - 1392080469, - 1287937401, - 718877177, - 1917966999, - 1822823090, - 3701632935, - 3591222197, - 2817335337, - 1941148668, - 3110479131, - 3289213933, - 583624926, - 468372467, - 1633850097, - 2110223508, - 898191441, - 112745085, - 4018820793, - 3085119011, - 2919626325, - 3094857332, - 2348201466, - 2192810893, - 4163160985, - 1269075360, - 3952316364, - 2881886868, - 439764402, - 1584774136, - 169674806, - 3759072440, - 102542696, - 2996180816, - 804899022, - 1015552308, - 963902061, - 3504158761, - 2002490364, - 2806716850, - 265778447, - 4083122425, - 181902171, - 1238120570, - 75986790, - 1265796414, - 899570100, - 2988365258, - 3655201337, - 3654061472, - 3061856840, - 1077859090, - 615341051, - 3678875745, - 3349230696, - 3647606635, - 2549309392, - 1508570930, - 1766401548, - 1448448666, - 1499923635, - 2882994691, - 3674863070, - 3056042030, - 4240893633, - 1395113939, - 2964622752, - 1951208733, - 3536941067, - 4176581069, - 1203545131, - 3092754101, - 246375791, - 2736026107, - 1069781886, - 3687777340, - 1564342316, - 535067202, - 1395923345, - 3240977890, - 1447712361, - 2602027658, - 718301639, - 3123244280, - 1032593647, - 2840366496, - 2680819379, - 3839389658, - 277023757, - 1172110445, - 1755648697, - 2472176885, - 223800276, - 625975427, - 976111724, - 4145966869, - 2789375411, - 618087261, - 249378857, - 4058280485, - 827698488, - 1558001705, - 3561482820, - 2562485583, - 4243138030, - 615982737, - 1220643281, - 150685616, - 3091876332, - 1040775722, - 669982125, - 4116080964, - 3582002820, - 910398460, - 1036475267, - 3800912395, - 146392076, - 1686512349, - 2326636627, - 2839816704, - 3502816184, - 226836633, - 3953733490, - 257136089, - 819503463, - 2863084840, - 1949759310, - 210754155, - 1367301635, - 3822983876, - 4273793488, - 3635397748, - 3930494584, - 3127921440, - 3167253437, - 3868239231, - 1859128680, - 3480031018, - 3810805277, - 2677252364, - 156014509, - 3627739127, - 2321729979, - 1146476634, - 4039938779, - 1964254745, - 2055836767, - 119981689, - 2629265310, - 2448331885, - 3737376990, - 144116905, - 2272221101, - 2197874825, - 1277245109, - 2503770904, - 360730278, - 3489360962, - 1166917451, - 707478563, - 4155586396, - 162255877, - 347505241, - 4215670524, - 3187066832, - 2399809085, - 2754074729, - 4060703604, - 628331516, - 1304296041, - 616435646, - 4080527786, - 1443829854, - 2512398201, - 708736129, - 13107491, - 3794803132, - 2049792025, - 2455417440, - 3367313400, - 3357250579, - 3694383800, - 2339901602, - 3242843022, - 2282454607, - 1243764146, - 835458563, - 1297706389, - 464259778, - 1766994680, - 1294403159, - 2568098594, - 3107165180, - 4040340620, - 3352361837, - 1031290113, - 2903897222, - 1677700667, - 3160388974, - 107544081, - 3044188332, - 2285081596, - 2835131395, - 2984459037, - 4174489262, - 1236389532, - 2938237924, - 321459212, - 3407526215, - 300939750, - 3441531391, - 2909957084, - 3192069648, - 1849065716, - 2524531022, - 505940164, - 4121643374, - 3774892253, - 3197739982, - 2161102232, - 2715370488, - 1992893964, - 1781864804, - 587888644, - 1039111164, - 4237497041, - 451382997, - 969500141, - 1415510495, - 3743398113, - 3027538652, - 2525173102, - 1708264968, - 3366040354, - 1100599986, - 188347929, - 2597020383, - 2705434194, - 2593884753, - 3472123498, - 2975894973, - 3152745753, - 1154919607, - 1930923350, - 3287039847, - 1372881231, - 2280400314, - 3369343584, - 2351620600, - 2645135839, - 2752766693, - 1471851763, - 1989520052, - 1141965917, - 1503477720, - 653708953, - 1765126703, - 2432827426, - 95470391, - 2567901801, - 2589449658, - 4218799564, - 3249265647, - 3673811979, - 210116709, - 1593584949, - 1791352211, - 3457985288, - 3345288309, - 531559080, - 2491124112, - 3410158390, - 4224872590, - 3705139860, - 162608772, - 4258229445, - 925559698, - 3928842969, - 4253051659, - 3633746133, - 3867307935, - 3560665067, - 798915737, - 2945369269, - 2677264274, - 2278571792, - 177111659, - 85880059, - 1297165140, - 1630583316, - 2232491275, - 1848784182, - 2487708241, - 626480004, - 3427283542, - 2108571893, - 304448521, - 3332104493, - 2244470522, - 436416061, - 221900294, - 1502470404, - 3552593177, - 440421571, - 450406196, - 503094540, - 3836822275, - 2708915136, - 3750617468, - 1119744229, - 3614752756, - 921246433, - 2285438321, - 626892406, - 2362972044, - 72782198, - 2929019254, - 2795773560, - 907126242, - 155458798, - 2798552666, - 1404739463, - 4285652249, - 1998444837, - 908777857, - 872544165, - 910429472, - 135486769, - 3457269042, - 426360862, - 1725011064, - 296836635, - 1322549027, - 2044728014, - 1530183840, - 529742207, - 4272200782, - 1341516288, - 2608484640, - 41739659, - 3260579369, - 2745872368, - 2894051250, - 862784766, - 3077271274, - 3094180193, - 3619626927, - 3745223676, - 2976066508, - 2854085372, - 2959147533, - 3266548732, - 1776526161, - 3712296962, - 1955871800, - 2580096524, - 2507709226, - 3564865233, - 948086521, - 1548254487, - 142465290, - 1472185378, - 1459457331, - 2274226560, - 3153451899, - 492958971, - 3563213618, - 1285705317, - 410274915, - 3710645347, - 1309728002, - 2119793999, - 1343794461, - 4024173916, - 2383939514, - 955476870, - 2698156268, - 35240468, - 2655147757, - 3764205609, - 3802564010, - 170690025, - 2311941439, - 3181546731, - 3866587616, - 3648138580, - 93914936, - 170378107, - 2120623674, - 1064945649, - 1618754372, - 244668133, - 247698428, - 3669223677, - 470277359, - 1781765116, - 1691572958, - 1373856501, - 2668769415, - 1087394637, - 1009983433, - 2180701723, - 4008405264, - 2831059514, - 2645120714, - 2649103430, - 2664825925, - 790502615, - 1739837626, - 2293247016, - 1784648440, - 1887808856, - 1788504755, - 112452386, - 1979978194, - 3462674048, - 2170273742, - 538168945, - 753954113, - 374731234, - 3715846592, - 1962971231, - 1860649552, - 1378082995, - 665789406, - 1717555224, - 139011596, - 1375043498, - 1618544981, - 1889460471, - 2262321736, - 1788301425, - 1652168174, - 2668680621, - 2636946065, - 2856623532, - 2759951687, - 959681532, - 3209399506, - 3055195668, - 1227221002, - 508217552, - 3289969989, - 243178923, - 2956189845, - 3075866530, - 2274779301, - 3940720663, - 3998230222, - 1178317551, - 4016096296, - 1545450160, - 2842919847, - 314809953, - 2952850186, - 3747079365, - 4147239510, - 169135842, - 1332643570, - 2994529201, - 973521782, - 1584369690, - 1043738701, - 2851900832, - 290391815, - 283209196, - 2468230023, - 1164221089, - 1991787192, - 3358097187, - 51041423, - 52882140, - 2339018837, - 2053214130, - 3757479030, - 158160339, - 853200279, - 1986584654, - 438318340, - 827246872, - 3299488628, - 2924263085, - 3472029049, - 2736844435, - 677668732, - 604894932, - 1158021131, - 1400019344, - 2268204687, - 1450415100, - 3854557817, - 1543646433, - 1278448636, - 342615870, - 1554194368, - 3080024605, - 3423702268, - 1675764636, - 1622381564, - 2078849875, - 2113115132, - 1380160211, - 3132876285, - 125015036, - 269576093, - 94145952, - 2777172031, - 2683080096, - 3812456892, - 488500848, - 3270430997, - 2895151306, - 116376005, - 400248103, - 406044930, - 1616846013, - 10142671, - 763027711, - 225200779, - 1062250709, - 2013867381, - 2113506324, - 1692932387, - 1827244161, - 3124618210, - 2096472894, - 2924146124, - 2128251367, - 2433358586, - 1939359710, - 2593325766, - 2879917723, - 694743357, - 2902069960, - 220008971, - 3090408469, - 917019124, - 1705716306, - 3263901372, - 3347863687, - 3447882276, - 1661163736, - 3617689692, - 3928555688, - 1057578789, - 435256475, - 4101009465, - 1941403425, - 198967948, - 3733675151, - 2043684541, - 3517169445, - 2226776400, - 2853403709, - 529383565, - 2807448986, - 4234287173, - 1019457583, - 1022544883, - 2493146691, - 1054461787, - 1008886329, - 1136775085, - 1191015885, - 1196280518, - 1979847999, - 50385656, - 1918742169, - 3999472204, - 3697687030, - 2220475432, - 2358141757, - 2360004627, - 4245257809, - 236660303, - 429277936, - 342159236, - 2622612602, - 371428004, - 373079619, - 643418617, - 2095027856, - 1071164424, - 1136911283, - 1548491889, - 2169307971, - 375530199, - 1510422521, - 3151638847, - 1698730948, - 2231688008, - 2604576561, - 2771938750, - 2996594997, - 289648234, - 348584153, - 2748350697, - 2926633629, - 2123683379, - 369686787, - 742917749, - 3538158875, - 2937761472, - 1545298048, - 1321616112, - 2855506940, - 900522183, - 1578775276, - 2217833278, - 2012838864, - 3753486980, - 2839765116, - 2464905186, - 2621255555, - 1305703280, - 861753115, - 3319278167, - 3063300848, - 149720480, - 1082941229, - 3337532056, - 2248357849, - 3675926744, - 1508550646, - 2289803479, - 3456899824, - 3931641900, - 3970432934, - 3419674548, - 1093210099, - 456043370, - 848380423, - 1287304304, - 1526654696, - 2055664760, - 1373166395, - 4291477370, - 2195550588, - 2847102741, - 3399062057, - 1641565587, - 2888753905, - 3579593979, - 3653059026, - 3757851979, - 2922615804, - 2919796598, - 1553476262, - 2566666743, - 3759503594, - 550831114, - 3761155209, - 3762806824, - 3902853271, - 4140081844, - 14244860, - 3847846774, - 150820676, - 1278818058, - 850592577, - 1206571206, - 1734446471, - 2117320444, - 1382106590, - 2436009347, - 2118972059, - 2951272396, - 36096192, - 117998987, - 473485679, - 2244928358, - 476788909, - 3489269251, - 610429940, - 480092139, - 481743754, - 871966503, - 918189168, - 601656217, - 933769938, - 939671928, - 1799299383, - 3312467582, - 1149665466, - 3006548167, - 1310740861, - 3602693817, - 1461645203, - 3367691969, - 1800404122, - 3486057732, - 1862284649, - 2076833303, - 2213411495, - 2805256437, - 3927915220, - 3000904950, - 2094647776, - 3333131702, - 1315613425, - 3752211294, - 603915804, - 3505028338, - 663258455, - 3322500634, - 1612225949, - 3606320646, - 157110413, - 1352397672, - 3861006967, - 452208841, - 18776483, - 1058429216, - 37009196, - 564884461, - 876864198, - 2952260510, - 2860348412, - 928261291, - 1164724902, - 2775815164, - 1332774287, - 780957373, - 939415664, - 1513770932, - 788046331, - 1692600167, - 4069810315, - 673708384, - 4024252457, - 1932614728, - 2148510256, - 3131224670, - 2388524817, - 2460489993, - 2676385521, - 826214242, - 3692647551, - 3063508455, - 3071766530, - 2063832060, - 1525861001, - 3073418145, - 837715723, - 3075069760, - 3076721375, - 3078372990, - 983243705, - 3083327835, - 171307615, - 1824016656, - 3084979450, - 1310404265, - 1775308984, - 3114708520, - 3116360135, - 3121314980, - 3134527900, - 1691646294, - 2804281092, - 97231530, - 3136179515, - 3204260786, - 3276225962, - 1220749418, - 3588205699, - 3874089391, - 4044115788, - 3268751013, - 743407979, - 166253838, - 1356063462, - 1368383673, - 2279700640, - 2130747644, - 3945795573, - 2780898906, - 3635542517, - 425022309, - 517919178, - 4061558677, - 2190437442, - 543621065, - 753756604, - 2500819054, - 1004589179, - 1165671422, - 30433743, - 3444275347, - 1335363438, - 1913735398, - 1265998516, - 3829325073, - 3662767579, - 463084678, - 1351676723, - 1391866096, - 3398925952, - 1631216488, - 815757910, - 1915438939, - 2427834344, - 1445161581, - 1890300748, - 2864863800, - 1961990747, - 575205902, - 2037710159, - 2037814253, - 617312262, - 3732916270, - 783918780, - 2257843797, - 2096388952, - 2338272340, - 1434223270, - 578132535, - 1980341560, - 1002144380, - 3244716568, - 4258414038, - 3271748023, - 3304438238, - 3717523241, - 3370185097, - 3435931956, - 1957265068, - 3602522282, - 2547657777, - 439998433, - 3838648480, - 3913593633, - 3989799199, - 906176560, - 1894133125, - 4046301857, - 4242327928, - 630592085, - 2693892518, - 4292991777, - 545678922, - 125792961, - 3015046341, - 132755933, - 2615111110, - 1570165302, - 1440646342, - 436066778, - 565233904, - 600906020, - 602222721, - 3951925872, - 1496901698, - 1522901980, - 2785441472, - 3041450802, - 1637661947, - 2127660080, - 3487022798, - 2269114589, - 1314834580, - 2315690100, - 3817149113, - 4091670162, - 1431749301, - 1858116930, - 2213946343, - 2225172640, - 2263866576, - 2727022058, - 2752967311, - 2864705739, - 3052439312, - 3510257966, - 2614053317, - 3297860332, - 3670298840, - 3732709413, - 3788324110, - 4098876453, - 4290374884, - 1623013158, - 3381478137, - 17185761, - 3931288033, - 2890638791, - 330388453, - 346929928, - 2022347217, - 4083347580, - 533021259, - 564302770, - 1917602962, - 680157484, - 3264086791, - 3727034815, - 798549062, - 3068463300, - 669812542, - 1965902997, - 2311072371, - 3079287749, - 2542834724, - 1587730355, - 2558655180, - 1838763297, - 4172568578, - 2160380860, - 2950446516, - 1830851200, - 3214537066, - 3234673086, - 3652695478, - 3103302036, - 3465954368, - 4180570743, - 3534518722, - 371186900, - 4091394002, - 1013756921, - 443558693, - 591140762, - 656610661, - 2064733527, - 3808408202, - 983299427, - 4217306348, - 1164218401, - 2036361232, - 3237903670, - 2970183398, - 2293637521, - 135920445, - 1596005536, - 868652905, - 1191735827, - 3987079331, - 1365842164, - 1508074873, - 1642818143, - 3436143898, - 4105051793, - 1863199739, - 3425841570, - 1070791291, - 2135340676, - 2639720559, - 3364388739, - 3797761273, - 2092100514, - 2098706974, - 2329992200, - 414444763, - 2759250216, - 2913136690, - 3012980338, - 3327770644, - 4128942283, - 3362344229, - 161668409, - 3401762422, - 2852854788, - 4237092412, - 1245448751, - 3702405475, - 918849409, - 3829682756, - 1612361408, - 255302575, - 414620710, - 386293029, - 618761615, - 686024761, - 744062262, - 1502028603, - 1543798545, - 1641415225, - 1548121999, - 2257971049, - 2124837447, - 878733439, - 2340670452, - 2674090849, - 3118011750, - 2816338013, - 178571546, - 2841008029, - 3249261197, - 370232173, - 4092487128, - 3787567939, - 3898287302, - 4142016703, - 4285779501, - 30663912, - 151672195, - 180913835, - 3534235309, - 34183582, - 4083161638, - 651464351, - 1410311776, - 371621315, - 421602934, - 458937500, - 2710583246, - 712168842, - 730943059, - 1519723107, - 875212982, - 1247793383, - 4217322139, - 989813600, - 1057606514, - 3764662384, - 1443547269, - 3066811685, - 3598957382, - 1791427568, - 1171541710, - 3930727258, - 1473799048, - 1296054774, - 1747355813, - 765238787, - 2023008475, - 1190147516, - 2344328209, - 2495155989, - 2577859137, - 2857814560, - 3127329373, - 3296722158, - 2773229577, - 3376009661, - 3450001968, - 920941800, - 3526837441, - 3858973601, - 1702168830, - 4088613871, - 1464587427, - 223310468, - 388034151, - 2346547796, - 1663234329, - 1750829822, - 1967643923, - 2881302403, - 2278706468, - 2326990117, - 2511346984, - 3088785099, - 2616085763, - 3027500544, - 3417583519, - 4178218543, - 1412908157, - 797934924, - 3533637837, - 1449907751, - 3362830643, - 1451831482, - 2637935122, - 3070114915, - 3023287679, - 551924251, - 1669930486, - 46736908, - 2870852215, - 1120149824, - 2923708820, - 3887377256, - 3464197236, - 4241374559, - 527665290, - 996663016, - 885020215, - 1763758554, - 3059119137, - 2555315060, - 2762094724, - 2530899578, - 2770161927, - 2262137600, - 3547456240, - 858902117, - 1140367371, - 1215030156, - 443490822, - 294390719, - 3032677281, - 1917451875, - 4184019303, - 3277199633, - 1271484400, - 1297294717, - 3560552546, - 171494987, - 195244192, - 3002890475, - 1811839150, - 265392489, - 1461398554, - 3205759417, - 333855951, - 529068443, - 660038281, - 557400685, - 663341511, - 930804377, - 1922045399, - 716890919, - 162167595, - 1654776395, - 1779143013, - 1123617794, - 2984325996, - 1162789888, - 1318479490, - 1235468610, - 3561562003, - 1486207619, - 1551372768, - 1850331254, - 3255947500, - 1037370721, - 1989327599, - 2137526937, - 835638766, - 2269130237, - 1962162282, - 3244209297, - 2330636993, - 3095831808, - 1396344138, - 2603020391, - 3434076295, - 3280064277, - 2656211099, - 3335250889, - 2550961007, - 3510242586, - 3536471583, - 3950980241, - 4033586023, - 117250846, - 3088282680, - 4041974454, - 4244540017, - 1167160774, - 899320334, - 1200870684, - 1752686878, - 1906988301, - 3804101227, - 2575525651, - 2919787747, - 3508792859, - 3548535223, - 3783756895, - 3797961332, - 4043078107, - 3115038057, - 2313593054, - 49456560, - 592180731, - 1051471757, - 1097775533, - 706238670, - 877895868, - 1173092699, - 1461897718, - 1767704813, - 1770165905, - 1923453688, - 2212501241, - 2305269460, - 2488410748, - 3782099915, - 2844616706, - 3383007207, - 3392887901, - 504514034, - 3765247327, - 1000070091, - 3727494858, - 3657635382, - 3839047923, - 3886529747, - 4069720347, - 4164704452, - 342197850, - 3540244297, - 2513230733, - 4117704995, - 3367298820, - 2680283743, - 3119663365, - 3697738938, - 545363837, - 163402553, - 5908395, - 129135650, - 2289183712, - 200922300, - 761731755, - 894529125, - 1086964761, - 1168927492, - 2100052708, - 2438466459, - 3390051757, - 2498042266, - 2557754096, - 2600961503, - 487719832, - 703543228, - 2726532092, - 4199470013, - 3142155593, - 2550501832, - 4076840151, - 200553094, - 380957745, - 572905105, - 462664429, - 1466804584, - 330249537, - 2605012269, - 491456522, - 4126287524, - 502863753, - 952536201, - 3510682541, - 1137442027, - 1665981878, - 1761469971, - 3085467405, - 2045285083, - 796985462, - 3433956341, - 2217966239, - 2183547611, - 2279273489, - 1916983087, - 2348676810, - 2403632109, - 2409539315, - 545986953, - 176166202, - 2477389837, - 2573160348, - 2796513469, - 3972309363, - 528662843, - 1038982109, - 1125913837, - 1318081294, - 1417425499, - }; - return descriptors_with_coding_scheme; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/comp/markv_model_shader_default.cpp vulkan-1.1.73+dfsg/external/spirv-tools/tools/comp/markv_model_shader_default.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/comp/markv_model_shader_default.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/comp/markv_model_shader_default.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include "markv_model_shader_default.h" - -#include -#include -#include -#include -#include -#include - -using spvutils::HuffmanCodec; - -namespace spvtools { - -namespace { - -// Signals that the value is not in the coding scheme and a fallback method -// needs to be used. -const uint64_t kMarkvNoneOfTheAbove = MarkvModel::GetMarkvNoneOfTheAbove(); - -inline uint32_t CombineOpcodeAndNumOperands(uint32_t opcode, - uint32_t num_operands) { - return opcode | (num_operands << 16); -} - -// The following file contains autogenerated statistical coding rules. -// Generated by running spirv-stats on representative corpus of shaders with -// flags: -// --codegen_opcode_and_num_operands_hist -// --codegen_opcode_and_num_operands_markov_huffman_codecs -// --codegen_literal_string_huffman_codecs -// --codegen_non_id_word_huffman_codecs -// --codegen_id_descriptor_huffman_codecs -// -// Example: -// find -type f -print0 | xargs -0 -s 2000000 -// ~/SPIRV-Tools/build/tools/spirv-stats -v -// --codegen_opcode_and_num_operands_hist -// --codegen_opcode_and_num_operands_markov_huffman_codecs -// --codegen_literal_string_huffman_codecs --codegen_non_id_word_huffman_codecs -// --codegen_id_descriptor_huffman_codecs -o -// ~/SPIRV-Tools/source/comp/markv_autogen.inc -#include "markv_model_shader_default_autogen.inc" - -} // namespace - -MarkvModelShaderDefault::MarkvModelShaderDefault() { - const uint16_t kVersionNumber = 0; - SetModelVersion(kVersionNumber); - - opcode_and_num_operands_huffman_codec_.reset( - new HuffmanCodec(GetOpcodeAndNumOperandsHist())); - opcode_and_num_operands_markov_huffman_codecs_ = - GetOpcodeAndNumOperandsMarkovHuffmanCodecs(); - non_id_word_huffman_codecs_ = GetNonIdWordHuffmanCodecs(); - id_descriptor_huffman_codecs_ = GetIdDescriptorHuffmanCodecs(); - descriptors_with_coding_scheme_ = GetDescriptorsWithCodingScheme(); - literal_string_huffman_codecs_ = GetLiteralStringHuffmanCodecs(); - - operand_chunk_lengths_[SPV_OPERAND_TYPE_TYPE_ID] = 4; - operand_chunk_lengths_[SPV_OPERAND_TYPE_RESULT_ID] = 8; - operand_chunk_lengths_[SPV_OPERAND_TYPE_ID] = 8; - operand_chunk_lengths_[SPV_OPERAND_TYPE_SCOPE_ID] = 8; - operand_chunk_lengths_[SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID] = 8; - operand_chunk_lengths_[SPV_OPERAND_TYPE_LITERAL_INTEGER] = 6; - operand_chunk_lengths_[SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER] = 6; - operand_chunk_lengths_[SPV_OPERAND_TYPE_CAPABILITY] = 6; - operand_chunk_lengths_[SPV_OPERAND_TYPE_SOURCE_LANGUAGE] = 3; - operand_chunk_lengths_[SPV_OPERAND_TYPE_EXECUTION_MODEL] = 3; - operand_chunk_lengths_[SPV_OPERAND_TYPE_ADDRESSING_MODEL] = 2; - operand_chunk_lengths_[SPV_OPERAND_TYPE_MEMORY_MODEL] = 2; - operand_chunk_lengths_[SPV_OPERAND_TYPE_EXECUTION_MODE] = 6; - operand_chunk_lengths_[SPV_OPERAND_TYPE_STORAGE_CLASS] = 4; - operand_chunk_lengths_[SPV_OPERAND_TYPE_DIMENSIONALITY] = 3; - operand_chunk_lengths_[SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE] = 3; - operand_chunk_lengths_[SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE] = 2; - operand_chunk_lengths_[SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT] = 6; - operand_chunk_lengths_[SPV_OPERAND_TYPE_FP_ROUNDING_MODE] = 2; - operand_chunk_lengths_[SPV_OPERAND_TYPE_LINKAGE_TYPE] = 2; - operand_chunk_lengths_[SPV_OPERAND_TYPE_ACCESS_QUALIFIER] = 2; - operand_chunk_lengths_[SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER] = 2; - operand_chunk_lengths_[SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE] = 3; - operand_chunk_lengths_[SPV_OPERAND_TYPE_DECORATION] = 6; - operand_chunk_lengths_[SPV_OPERAND_TYPE_BUILT_IN] = 6; - operand_chunk_lengths_[SPV_OPERAND_TYPE_GROUP_OPERATION] = 2; - operand_chunk_lengths_[SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS] = 2; - operand_chunk_lengths_[SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO] = 2; - operand_chunk_lengths_[SPV_OPERAND_TYPE_FP_FAST_MATH_MODE] = 4; - operand_chunk_lengths_[SPV_OPERAND_TYPE_FUNCTION_CONTROL] = 4; - operand_chunk_lengths_[SPV_OPERAND_TYPE_LOOP_CONTROL] = 4; - operand_chunk_lengths_[SPV_OPERAND_TYPE_IMAGE] = 4; - operand_chunk_lengths_[SPV_OPERAND_TYPE_OPTIONAL_IMAGE] = 4; - operand_chunk_lengths_[SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS] = 4; - operand_chunk_lengths_[SPV_OPERAND_TYPE_SELECTION_CONTROL] = 4; - operand_chunk_lengths_[SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER] = 6; - operand_chunk_lengths_[SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER] = 6; -} - -} // namespace spvtools diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/comp/markv_model_shader_default.h vulkan-1.1.73+dfsg/external/spirv-tools/tools/comp/markv_model_shader_default.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/comp/markv_model_shader_default.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/comp/markv_model_shader_default.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SPIRV_TOOLS_COMP_DEFAULT_SHADER_MARKV_MODEL_H_ -#define SPIRV_TOOLS_COMP_DEFAULT_SHADER_MARKV_MODEL_H_ - -#include "source/comp/markv_model.h" - -namespace spvtools { - -// MARK-V model designed to be a default model for shader compression. -class MarkvModelShaderDefault : public MarkvModel { - public: - MarkvModelShaderDefault(); -}; - -} // namespace spvtools - -#endif // SPIRV_TOOLS_COMP_DEFAULT_SHADER_MARKV_MODEL_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/dis/dis.cpp vulkan-1.1.73+dfsg/external/spirv-tools/tools/dis/dis.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/dis/dis.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/dis/dis.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,195 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) -#include // Need fileno -#include -#endif - -#include -#include -#include -#include - -#include "spirv-tools/libspirv.h" -#include "tools/io.h" - -static void print_usage(char* argv0) { - printf( - R"(%s - Disassemble a SPIR-V binary module - -Usage: %s [options] [] - -The SPIR-V binary is read from . If no file is specified, -or if the filename is "-", then the binary is read from standard input. - -Options: - - -h, --help Print this help. - --version Display disassembler version information. - - -o Set the output filename. - Output goes to standard output if this option is - not specified, or if the filename is "-". - - --no-color Don't print in color. - The default when output goes to something other than a - terminal (e.g. a file, a pipe, or a shell redirection). - - --no-indent Don't indent instructions. - - --no-header Don't output the header as leading comments. - - --raw-id Show raw Id values instead of friendly names. - - --offsets Show byte offsets for each instruction. -)", - argv0, argv0); -} - -static const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_2; - -int main(int argc, char** argv) { - const char* inFile = nullptr; - const char* outFile = nullptr; - - bool allow_color = false; -#ifdef SPIRV_COLOR_TERMINAL - allow_color = true; -#endif - bool allow_indent = true; - bool show_byte_offsets = false; - bool no_header = false; - bool friendly_names = true; - - for (int argi = 1; argi < argc; ++argi) { - if ('-' == argv[argi][0]) { - switch (argv[argi][1]) { - case 'h': - print_usage(argv[0]); - return 0; - case 'o': { - if (!outFile && argi + 1 < argc) { - outFile = argv[++argi]; - } else { - print_usage(argv[0]); - return 1; - } - } break; - case '-': { - // Long options - if (0 == strcmp(argv[argi], "--no-color")) { - allow_color = false; - } else if (0 == strcmp(argv[argi], "--no-indent")) { - allow_indent = false; - } else if (0 == strcmp(argv[argi], "--offsets")) { - show_byte_offsets = true; - } else if (0 == strcmp(argv[argi], "--no-header")) { - no_header = true; - } else if (0 == strcmp(argv[argi], "--raw-id")) { - friendly_names = false; - } else if (0 == strcmp(argv[argi], "--help")) { - print_usage(argv[0]); - return 0; - } else if (0 == strcmp(argv[argi], "--version")) { - printf("%s\n", spvSoftwareVersionDetailsString()); - printf("Target: %s\n", - spvTargetEnvDescription(kDefaultEnvironment)); - return 0; - } else { - print_usage(argv[0]); - return 1; - } - } break; - case 0: { - // Setting a filename of "-" to indicate stdin. - if (!inFile) { - inFile = argv[argi]; - } else { - fprintf(stderr, "error: More than one input file specified\n"); - return 1; - } - } break; - default: - print_usage(argv[0]); - return 1; - } - } else { - if (!inFile) { - inFile = argv[argi]; - } else { - fprintf(stderr, "error: More than one input file specified\n"); - return 1; - } - } - } - - uint32_t options = SPV_BINARY_TO_TEXT_OPTION_NONE; - - if (allow_indent) options |= SPV_BINARY_TO_TEXT_OPTION_INDENT; - - if (show_byte_offsets) options |= SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET; - - if (no_header) options |= SPV_BINARY_TO_TEXT_OPTION_NO_HEADER; - - if (friendly_names) options |= SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES; - - if (!outFile || (0 == strcmp("-", outFile))) { - // Print to standard output. - options |= SPV_BINARY_TO_TEXT_OPTION_PRINT; - bool output_is_tty = true; -#if defined(_POSIX_VERSION) - output_is_tty = isatty(fileno(stdout)); -#endif - if (allow_color && output_is_tty) { - options |= SPV_BINARY_TO_TEXT_OPTION_COLOR; - } - } - - // Read the input binary. - std::vector contents; - if (!ReadFile(inFile, "rb", &contents)) return 1; - - // If printing to standard output, then spvBinaryToText should - // do the printing. In particular, colour printing on Windows is - // controlled by modifying console objects synchronously while - // outputting to the stream rather than by injecting escape codes - // into the output stream. - // If the printing option is off, then save the text in memory, so - // it can be emitted later in this function. - const bool print_to_stdout = SPV_BINARY_TO_TEXT_OPTION_PRINT & options; - spv_text text = nullptr; - spv_text* textOrNull = print_to_stdout ? nullptr : &text; - spv_diagnostic diagnostic = nullptr; - spv_context context = spvContextCreate(kDefaultEnvironment); - spv_result_t error = - spvBinaryToText(context, contents.data(), contents.size(), options, - textOrNull, &diagnostic); - spvContextDestroy(context); - if (error) { - spvDiagnosticPrint(diagnostic); - spvDiagnosticDestroy(diagnostic); - return error; - } - - if (!print_to_stdout) { - if (!WriteFile(outFile, "w", text->str, text->length)) { - spvTextDestroy(text); - return 1; - } - } - spvTextDestroy(text); - - return 0; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/emacs/50spirv-tools.el vulkan-1.1.73+dfsg/external/spirv-tools/tools/emacs/50spirv-tools.el --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/emacs/50spirv-tools.el 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/emacs/50spirv-tools.el 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -;; Copyright (c) 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. - -;; Upon loading a file with the .spv extension into emacs, the file -;; will be disassembled using spirv-dis, and the result colorized with -;; asm-mode in emacs. The file may be edited within the constraints -;; of validity, and when re-saved will be re-assembled using spirv-as. - -;; Note that symbol IDs are not preserved through a load/edit/save operation. -;; This may change if the ability is added to spirv-as. - -;; It is required that those tools be in your PATH. If that is not the case -;; when starting emacs, the path can be modified as in this example: -;; (setenv "PATH" (concat (getenv "PATH") ":/path/to/spirv/tools")) -;; -;; See https://github.com/KhronosGroup/SPIRV-Tools/issues/359 - -(require 'jka-compr) -(require 'asm-mode) - -(add-to-list 'jka-compr-compression-info-list - '["\\.spv\\'" - "Assembling SPIRV" "spirv-as" ("-o" "-") - "Disassembling SPIRV" "spirv-dis" ("--no-color" "--raw-id") - t nil "\003\002\043\007"]) - -(add-to-list 'auto-mode-alist '("\\.spv\\'" . asm-mode)) - -(jka-compr-update) diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/emacs/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/tools/emacs/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/emacs/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/emacs/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -# Copyright (c) 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. - -# Install a script for use with the auto-compression feature of emacs(1). -# Upon loading a file with the .spv extension, the file will be disassembled -# using spirv-dis, and the result colorized with asm-mode in emacs. The file -# may be edited within the constraints of validity, and when re-saved will be -# re-assembled using spirv-as. - -# It is required that those tools be in your PATH. If that is not the case -# when starting emacs, the path can be modified as in this example: -# (setenv "PATH" (concat (getenv "PATH") ":/path/to/spirv/tools")) -# -# See https://github.com/KhronosGroup/SPIRV-Tools/issues/359 - -# This is an absolute directory, and ignores CMAKE_INSTALL_PREFIX, or -# it will not be found by emacs upon startup. It is only installed if -# both of the following are true: -# 1. SPIRV_TOOLS_INSTALL_EMACS_HELPERS is defined -# 2. The directory /etc/emacs/site-start.d already exists at the time of -# cmake invocation (not at the time of make install). This is -# typically true if emacs is installed on the system. - -# Note that symbol IDs are not preserved through a load/edit/save operation. -# This may change if the ability is added to spirv-as. - -option(SPIRV_TOOLS_INSTALL_EMACS_HELPERS - "Install Emacs helper to disassemble/assemble SPIR-V binaries on file load/save." - ${SPIRV_TOOLS_INSTALL_EMACS_HELPERS}) -if (${SPIRV_TOOLS_INSTALL_EMACS_HELPERS}) - if(EXISTS /etc/emacs/site-start.d) - if(ENABLE_SPIRV_TOOLS_INSTALL) - install(FILES 50spirv-tools.el DESTINATION /etc/emacs/site-start.d) - endif(ENABLE_SPIRV_TOOLS_INSTALL) - endif() -endif() - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/io.h vulkan-1.1.73+dfsg/external/spirv-tools/tools/io.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/io.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/io.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -// Copyright (c) 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_TOOLS_IO_H_ -#define LIBSPIRV_TOOLS_IO_H_ - -#include -#include -#include - -// Appends the content from the file named as |filename| to |data|, assuming -// each element in the file is of type |T|. The file is opened with the given -// |mode|. If |filename| is nullptr or "-", reads from the standard input. If -// any error occurs, writes error messages to standard error and returns false. -template -bool ReadFile(const char* filename, const char* mode, std::vector* data) { - const int buf_size = 1024; - const bool use_file = filename && strcmp("-", filename); - if (FILE* fp = (use_file ? fopen(filename, mode) : stdin)) { - T buf[buf_size]; - while (size_t len = fread(buf, sizeof(T), buf_size, fp)) { - data->insert(data->end(), buf, buf + len); - } - if (ftell(fp) == -1L) { - if (ferror(fp)) { - fprintf(stderr, "error: error reading file '%s'\n", filename); - return false; - } - } else { - if (sizeof(T) != 1 && (ftell(fp) % sizeof(T))) { - fprintf(stderr, "error: corrupted word found in file '%s'\n", filename); - return false; - } - } - if (use_file) fclose(fp); - } else { - fprintf(stderr, "error: file does not exist '%s'\n", filename); - return false; - } - return true; -} - -// Writes the given |data| into the file named as |filename| using the given -// |mode|, assuming |data| is an array of |count| elements of type |T|. If -// |filename| is nullptr or "-", writes to standard output. If any error occurs, -// returns false and outputs error message to standard error. -template -bool WriteFile(const char* filename, const char* mode, const T* data, - size_t count) { - const bool use_stdout = - !filename || (filename[0] == '-' && filename[1] == '\0'); - if (FILE* fp = (use_stdout ? stdout : fopen(filename, mode))) { - size_t written = fwrite(data, sizeof(T), count, fp); - if (count != written) { - fprintf(stderr, "error: could not write to file '%s'\n", filename); - return false; - } - if (!use_stdout) fclose(fp); - } else { - fprintf(stderr, "error: could not open file '%s'\n", filename); - return false; - } - return true; -} - -#endif // LIBSPIRV_TOOLS_IO_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/lesspipe/CMakeLists.txt vulkan-1.1.73+dfsg/external/spirv-tools/tools/lesspipe/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/lesspipe/CMakeLists.txt 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/lesspipe/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -# Copyright (c) 2016 Google 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. - -# Install a script for use with the LESSOPEN of less(1). -# For example, after installation into /usr/local do: -# export LESSOPEN='|/usr/local/bin "%s"' -# less -R foo.spv -# -# See https://github.com/KhronosGroup/SPIRV-Tools/issues/359 - -# The script will be installed with everyone having read and execute -# permissions. -# We have a .sh extension because Windows users often configure -# executable settings via filename extension. -if(ENABLE_SPIRV_TOOLS_INSTALL) - install(PROGRAMS spirv-lesspipe.sh DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(ENABLE_SPIRV_TOOLS_INSTALL) diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/lesspipe/spirv-lesspipe.sh vulkan-1.1.73+dfsg/external/spirv-tools/tools/lesspipe/spirv-lesspipe.sh --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/lesspipe/spirv-lesspipe.sh 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/lesspipe/spirv-lesspipe.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -#!/bin/bash -# Copyright (c) 2016 The Khronos Group Inc. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A script for automatically disassembling a .spv file -# for less(1). This assumes spirv-dis is on our PATH. -# -# See https://github.com/KhronosGroup/SPIRV-Tools/issues/359 - -case "$1" in - *.spv) spirv-dis "$@" 2>/dev/null;; - *) exit 1;; -esac - -exit $? - diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/link/linker.cpp vulkan-1.1.73+dfsg/external/spirv-tools/tools/link/linker.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/link/linker.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/link/linker.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,150 +0,0 @@ -// Copyright (c) 2017 Pierre Moreau -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include - -#include "source/spirv_target_env.h" -#include "spirv-tools/libspirv.hpp" -#include "spirv-tools/linker.hpp" -#include "tools/io.h" - -void print_usage(char* argv0) { - printf( - R"(%s - Link SPIR-V binary files together. - -USAGE: %s [options] [ ...] - -The SPIR-V binaries are read from the different . - -NOTE: The linker is a work in progress. - -Options: - -h, --help Print this help. - -o Name of the resulting linked SPIR-V binary. - --create-library Link the binaries into a library, keeping all exported symbols. - --version Display linker version information - --target-env {vulkan1.0|spv1.0|spv1.1|spv1.2|opencl2.1|opencl2.2} - Use Vulkan1.0/SPIR-V1.0/SPIR-V1.1/SPIR-V1.2/OpenCL-2.1/OpenCL2.2 validation rules. -)", - argv0, argv0); -} - -int main(int argc, char** argv) { - std::vector inFiles; - const char* outFile = nullptr; - spv_target_env target_env = SPV_ENV_UNIVERSAL_1_0; - spvtools::LinkerOptions options; - bool continue_processing = true; - int return_code = 0; - - for (int argi = 1; continue_processing && argi < argc; ++argi) { - const char* cur_arg = argv[argi]; - if ('-' == cur_arg[0]) { - if (0 == strcmp(cur_arg, "-o")) { - if (argi + 1 < argc) { - if (!outFile) { - outFile = argv[++argi]; - } else { - fprintf(stderr, "error: More than one output file specified\n"); - continue_processing = false; - return_code = 1; - } - } else { - fprintf(stderr, "error: Missing argument to %s\n", cur_arg); - continue_processing = false; - return_code = 1; - } - } else if (0 == strcmp(cur_arg, "--create-library")) { - options.SetCreateLibrary(true); - } else if (0 == strcmp(cur_arg, "--version")) { - printf("%s\n", spvSoftwareVersionDetailsString()); - // TODO(dneto): Add OpenCL 2.2 at least. - printf("Targets:\n %s\n %s\n %s\n", - spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_1), - spvTargetEnvDescription(SPV_ENV_VULKAN_1_0), - spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_2)); - continue_processing = false; - return_code = 0; - } else if (0 == strcmp(cur_arg, "--help") || 0 == strcmp(cur_arg, "-h")) { - print_usage(argv[0]); - continue_processing = false; - return_code = 0; - } else if (0 == strcmp(cur_arg, "--target-env")) { - if (argi + 1 < argc) { - const auto env_str = argv[++argi]; - if (!spvParseTargetEnv(env_str, &target_env)) { - fprintf(stderr, "error: Unrecognized target env: %s\n", env_str); - continue_processing = false; - return_code = 1; - } - } else { - fprintf(stderr, "error: Missing argument to --target-env\n"); - continue_processing = false; - return_code = 1; - } - } - } else { - inFiles.push_back(cur_arg); - } - } - - // Exit if command line parsing was not successful. - if (!continue_processing) { - return return_code; - } - - if (inFiles.empty()) { - fprintf(stderr, "error: No input file specified\n"); - return 1; - } - - std::vector> contents(inFiles.size()); - for (size_t i = 0u; i < inFiles.size(); ++i) { - if (!ReadFile(inFiles[i], "rb", &contents[i])) return 1; - } - - spvtools::Linker linker(target_env); - linker.SetMessageConsumer([](spv_message_level_t level, const char*, - const spv_position_t& position, - const char* message) { - switch (level) { - case SPV_MSG_FATAL: - case SPV_MSG_INTERNAL_ERROR: - case SPV_MSG_ERROR: - std::cerr << "error: " << position.index << ": " << message - << std::endl; - break; - case SPV_MSG_WARNING: - std::cout << "warning: " << position.index << ": " << message - << std::endl; - break; - case SPV_MSG_INFO: - std::cout << "info: " << position.index << ": " << message << std::endl; - break; - default: - break; - } - }); - - std::vector linkingResult; - bool succeed = linker.Link(contents, linkingResult, options); - - if (!WriteFile(outFile, "wb", linkingResult.data(), - linkingResult.size())) - return 1; - - return !succeed; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/opt/opt.cpp vulkan-1.1.73+dfsg/external/spirv-tools/tools/opt/opt.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/opt/opt.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/opt/opt.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,464 +0,0 @@ -// Copyright (c) 2016 Google 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. - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "opt/set_spec_constant_default_value_pass.h" -#include "spirv-tools/optimizer.hpp" - -#include "message.h" -#include "tools/io.h" - -using namespace spvtools; - -namespace { - -// Status and actions to perform after parsing command-line arguments. -enum OptActions { OPT_CONTINUE, OPT_STOP }; - -struct OptStatus { - OptActions action; - int code; -}; - -std::string GetListOfPassesAsString(const spvtools::Optimizer& optimizer) { - std::stringstream ss; - for (const auto& name : optimizer.GetPassNames()) { - ss << "\n\t\t" << name; - } - return ss.str(); -} - -std::string GetOptimizationPasses() { - spvtools::Optimizer optimizer(SPV_ENV_UNIVERSAL_1_2); - optimizer.RegisterPerformancePasses(); - return GetListOfPassesAsString(optimizer); -} - -std::string GetSizePasses() { - spvtools::Optimizer optimizer(SPV_ENV_UNIVERSAL_1_2); - optimizer.RegisterSizePasses(); - return GetListOfPassesAsString(optimizer); -} - -void PrintUsage(const char* program) { - printf( - R"(%s - Optimize a SPIR-V binary file. - -USAGE: %s [options] [] -o - -The SPIR-V binary is read from . If no file is specified, -or if is "-", then the binary is read from standard input. -if is "-", then the optimized output is written to -standard output. - -NOTE: The optimizer is a work in progress. - -Options: - --strip-debug - Remove all debug instructions. - --freeze-spec-const - Freeze the values of specialization constants to their default - values. - --eliminate-dead-const - Eliminate dead constants. - --fold-spec-const-op-composite - Fold the spec constants defined by OpSpecConstantOp or - OpSpecConstantComposite instructions to front-end constants - when possible. - --set-spec-const-default-value ": ..." - Set the default values of the specialization constants with - : pairs specified in a double-quoted - string. : pairs must be separated by - blank spaces, and in each pair, spec id and default value must - be separated with colon ':' without any blank spaces in between. - e.g.: --set-spec-const-default-value "1:100 2:400" - --unify-const - Remove the duplicated constants. - --flatten-decorations - Replace decoration groups with repeated OpDecorate and - OpMemberDecorate instructions. - --compact-ids - Remap result ids to a compact range starting from %%1 and without - any gaps. - --cfg-cleanup - Cleanup the control flow graph. This will remove any unnecessary - code from the CFG like unreachable code. Performed on entry - point call tree functions and exported functions. - --inline-entry-points-exhaustive - Exhaustively inline all function calls in entry point call tree - functions. Currently does not inline calls to functions with - early return in a loop. - --convert-local-access-chains - Convert constant index access chain loads/stores into - equivalent load/stores with inserts and extracts. Performed - on function scope variables referenced only with load, store, - and constant index access chains in entry point call tree - functions. - --eliminate-common-uniform - Perform load/load elimination for duplicate uniform values. - Converts any constant index access chain uniform loads into - its equivalent load and extract. Some loads will be moved - to facilitate sharing. Performed only on entry point - call tree functions. - --eliminate-local-single-block - Perform single-block store/load and load/load elimination. - Performed only on function scope variables in entry point - call tree functions. - --eliminate-local-single-store - Replace stores and loads of function scope variables that are - only stored once. Performed on variables referenceed only with - loads and stores. Performed only on entry point call tree - functions. - --eliminate-local-multi-store - Replace stores and loads of function scope variables that are - stored multiple times. Performed on variables referenceed only - with loads and stores. Performed only on entry point call tree - functions. - --eliminate-insert-extract - Replace extract from a sequence of inserts with the - corresponding value. Performed only on entry point call tree - functions. - --eliminate-dead-code-aggressive - Delete instructions which do not contribute to a function's - output. Performed only on entry point call tree functions. - --eliminate-dead-branches - Convert conditional branches with constant condition to the - indicated unconditional brranch. Delete all resulting dead - code. Performed only on entry point call tree functions. - --eliminate-dead-functions - Deletes functions that cannot be reached from entry points or - exported functions. - --merge-blocks - Join two blocks into a single block if the second has the - first as its only predecessor. Performed only on entry point - call tree functions. - --strength-reduction - Replaces instructions with equivalent and less expensive ones. - --eliminate-dead-variables - Deletes module scope variables that are not referenced. - -O - Optimize for performance. Apply a sequence of transformations - in an attempt to improve the performance of the generated - code. For this version of the optimizer, this flag is equivalent - to specifying the following optimization code names: - %s - -Os - Optimize for size. Apply a sequence of transformations in an - attempt to minimize the size of the generated code. For this - version of the optimizer, this flag is equivalent to specifying - the following optimization code names: - %s - - NOTE: The specific transformations done by -O and -Os change - from release to release. - -Oconfig= - Apply the sequence of transformations indicated in . - This file contains a sequence of strings separated by whitespace - (tabs, newlines or blanks). Each string is one of the flags - accepted by spirv-opt. Optimizations will be applied in the - sequence they appear in the file. This is equivalent to - specifying all the flags on the command line. For example, - given the file opts.cfg with the content: - - --inline-entry-points-exhaustive - --eliminate-dead-code-aggressive - - The following two invocations to spirv-opt are equivalent: - - $ spirv-opt -Oconfig=opts.cfg program.spv - - $ spirv-opt --inline-entry-points-exhaustive \ - --eliminate-dead-code-aggressive program.spv - - Lines starting with the character '#' in the configuration - file indicate a comment and will be ignored. - - The -O, -Os, and -Oconfig flags act as macros. Using one of them - is equivalent to explicitly inserting the underlying flags at - that position in the command line. For example, the invocation - 'spirv-opt --merge-blocks -O ...' applies the transformation - --merge-blocks followed by all the transformations implied by - -O. - -h, --help - Print this help. - --version - Display optimizer version information. -)", - program, program, GetOptimizationPasses().c_str(), - GetSizePasses().c_str()); -} - -// Reads command-line flags the file specified in |oconfig_flag|. This string -// is assumed to have the form "-Oconfig=FILENAME". This function parses the -// string and extracts the file name after the '=' sign. -// -// Flags found in |FILENAME| are pushed at the end of the vector |file_flags|. -// -// This function returns true on success, false on failure. -bool ReadFlagsFromFile(const char* oconfig_flag, - std::vector* file_flags) { - const char* fname = strchr(oconfig_flag, '='); - if (fname == nullptr || fname[0] != '=') { - fprintf(stderr, "error: Invalid -Oconfig flag %s\n", oconfig_flag); - return false; - } - fname++; - - std::ifstream input_file; - input_file.open(fname); - if (input_file.fail()) { - fprintf(stderr, "error: Could not open file '%s'\n", fname); - return false; - } - - while (!input_file.eof()) { - std::string flag; - input_file >> flag; - if (flag.length() > 0 && flag[0] != '#') { - file_flags->push_back(flag); - } - } - - return true; -} - -OptStatus ParseFlags(int argc, const char** argv, Optimizer* optimizer, - const char** in_file, const char** out_file); - -// Parses and handles the -Oconfig flag. |prog_name| contains the name of -// the spirv-opt binary (used to build a new argv vector for the recursive -// invocation to ParseFlags). |opt_flag| contains the -Oconfig=FILENAME flag. -// |optimizer|, |in_file| and |out_file| are as in ParseFlags. -// -// This returns the same OptStatus instance returned by ParseFlags. -OptStatus ParseOconfigFlag(const char* prog_name, const char* opt_flag, - Optimizer* optimizer, const char** in_file, - const char** out_file) { - std::vector flags; - flags.push_back(prog_name); - - std::vector file_flags; - if (!ReadFlagsFromFile(opt_flag, &file_flags)) { - fprintf(stderr, - "error: Could not read optimizer flags from configuration file\n"); - return {OPT_STOP, 1}; - } - flags.insert(flags.end(), file_flags.begin(), file_flags.end()); - - const char** new_argv = new const char*[flags.size()]; - for (size_t i = 0; i < flags.size(); i++) { - if (flags[i].find("-Oconfig=") != std::string::npos) { - fprintf(stderr, - "error: Flag -Oconfig= may not be used inside the configuration " - "file\n"); - return {OPT_STOP, 1}; - } - new_argv[i] = flags[i].c_str(); - } - - return ParseFlags(static_cast(flags.size()), new_argv, optimizer, - in_file, out_file); -} - -// Parses command-line flags. |argc| contains the number of command-line flags. -// |argv| points to an array of strings holding the flags. |optimizer| is the -// Optimizer instance used to optimize the program. -// -// On return, this function stores the name of the input program in |in_file|. -// The name of the output file in |out_file|. The return value indicates whether -// optimization should continue and a status code indicating an error or -// success. -OptStatus ParseFlags(int argc, const char** argv, Optimizer* optimizer, - const char** in_file, const char** out_file) { - for (int argi = 1; argi < argc; ++argi) { - const char* cur_arg = argv[argi]; - if ('-' == cur_arg[0]) { - if (0 == strcmp(cur_arg, "--version")) { - printf("%s\n", spvSoftwareVersionDetailsString()); - return {OPT_STOP, 0}; - } else if (0 == strcmp(cur_arg, "--help") || 0 == strcmp(cur_arg, "-h")) { - PrintUsage(argv[0]); - return {OPT_STOP, 0}; - } else if (0 == strcmp(cur_arg, "-o")) { - if (!*out_file && argi + 1 < argc) { - *out_file = argv[++argi]; - } else { - PrintUsage(argv[0]); - return {OPT_STOP, 1}; - } - } else if (0 == strcmp(cur_arg, "--strip-debug")) { - optimizer->RegisterPass(CreateStripDebugInfoPass()); - } else if (0 == strcmp(cur_arg, "--set-spec-const-default-value")) { - if (++argi < argc) { - auto spec_ids_vals = - opt::SetSpecConstantDefaultValuePass::ParseDefaultValuesString( - argv[argi]); - if (!spec_ids_vals) { - fprintf(stderr, - "error: Invalid argument for " - "--set-spec-const-default-value: %s\n", - argv[argi]); - return {OPT_STOP, 1}; - } - optimizer->RegisterPass( - CreateSetSpecConstantDefaultValuePass(std::move(*spec_ids_vals))); - } else { - fprintf( - stderr, - "error: Expected a string of : pairs."); - return {OPT_STOP, 1}; - } - } else if (0 == strcmp(cur_arg, "--freeze-spec-const")) { - optimizer->RegisterPass(CreateFreezeSpecConstantValuePass()); - } else if (0 == strcmp(cur_arg, "--inline-entry-points-exhaustive")) { - optimizer->RegisterPass(CreateInlineExhaustivePass()); - } else if (0 == strcmp(cur_arg, "--inline-entry-points-opaque")) { - optimizer->RegisterPass(CreateInlineOpaquePass()); - } else if (0 == strcmp(cur_arg, "--convert-local-access-chains")) { - optimizer->RegisterPass(CreateLocalAccessChainConvertPass()); - } else if (0 == strcmp(cur_arg, "--eliminate-dead-code-aggressive")) { - optimizer->RegisterPass(CreateAggressiveDCEPass()); - } else if (0 == strcmp(cur_arg, "--eliminate-insert-extract")) { - optimizer->RegisterPass(CreateInsertExtractElimPass()); - } else if (0 == strcmp(cur_arg, "--eliminate-local-single-block")) { - optimizer->RegisterPass(CreateLocalSingleBlockLoadStoreElimPass()); - } else if (0 == strcmp(cur_arg, "--eliminate-local-single-store")) { - optimizer->RegisterPass(CreateLocalSingleStoreElimPass()); - } else if (0 == strcmp(cur_arg, "--merge-blocks")) { - optimizer->RegisterPass(CreateBlockMergePass()); - } else if (0 == strcmp(cur_arg, "--eliminate-dead-branches")) { - optimizer->RegisterPass(CreateDeadBranchElimPass()); - } else if (0 == strcmp(cur_arg, "--eliminate-dead-functions")) { - optimizer->RegisterPass(CreateEliminateDeadFunctionsPass()); - } else if (0 == strcmp(cur_arg, "--eliminate-local-multi-store")) { - optimizer->RegisterPass(CreateLocalMultiStoreElimPass()); - } else if (0 == strcmp(cur_arg, "--eliminate-common-uniform")) { - optimizer->RegisterPass(CreateCommonUniformElimPass()); - } else if (0 == strcmp(cur_arg, "--eliminate-dead-const")) { - optimizer->RegisterPass(CreateEliminateDeadConstantPass()); - } else if (0 == strcmp(cur_arg, "--eliminate-dead-variables")) { - optimizer->RegisterPass(CreateDeadVariableEliminationPass()); - } else if (0 == strcmp(cur_arg, "--fold-spec-const-op-composite")) { - optimizer->RegisterPass(CreateFoldSpecConstantOpAndCompositePass()); - } else if (0 == strcmp(cur_arg, "--strength-reduction")) { - optimizer->RegisterPass(CreateStrengthReductionPass()); - } else if (0 == strcmp(cur_arg, "--unify-const")) { - optimizer->RegisterPass(CreateUnifyConstantPass()); - } else if (0 == strcmp(cur_arg, "--flatten-decorations")) { - optimizer->RegisterPass(CreateFlattenDecorationPass()); - } else if (0 == strcmp(cur_arg, "--compact-ids")) { - optimizer->RegisterPass(CreateCompactIdsPass()); - } else if (0 == strcmp(cur_arg, "--cfg-cleanup")) { - optimizer->RegisterPass(CreateCFGCleanupPass()); - } else if (0 == strcmp(cur_arg, "-O")) { - optimizer->RegisterPerformancePasses(); - } else if (0 == strcmp(cur_arg, "-Os")) { - optimizer->RegisterSizePasses(); - } else if (0 == strncmp(cur_arg, "-Oconfig=", sizeof("-Oconfig=") - 1)) { - OptStatus status = - ParseOconfigFlag(argv[0], cur_arg, optimizer, in_file, out_file); - if (status.action != OPT_CONTINUE) { - return status; - } - } else if ('\0' == cur_arg[1]) { - // Setting a filename of "-" to indicate stdin. - if (!*in_file) { - *in_file = cur_arg; - } else { - fprintf(stderr, "error: More than one input file specified\n"); - return {OPT_STOP, 1}; - } - } else { - fprintf( - stderr, - "error: Unknown flag '%s'. Use --help for a list of valid flags\n", - cur_arg); - return {OPT_STOP, 1}; - } - } else { - if (!*in_file) { - *in_file = cur_arg; - } else { - fprintf(stderr, "error: More than one input file specified\n"); - return {OPT_STOP, 1}; - } - } - } - - return {OPT_CONTINUE, 0}; -} - -} // namespace - -int main(int argc, const char** argv) { - const char* in_file = nullptr; - const char* out_file = nullptr; - - spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2; - - spvtools::Optimizer optimizer(target_env); - optimizer.SetMessageConsumer([](spv_message_level_t level, const char* source, - const spv_position_t& position, - const char* message) { - std::cerr << StringifyMessage(level, source, position, message) - << std::endl; - }); - - OptStatus status = ParseFlags(argc, argv, &optimizer, &in_file, &out_file); - if (status.action == OPT_STOP) { - return status.code; - } - - if (out_file == nullptr) { - fprintf(stderr, "error: -o required\n"); - return 1; - } - - std::vector binary; - if (!ReadFile(in_file, "rb", &binary)) { - return 1; - } - - // Let's do validation first. - spv_context context = spvContextCreate(target_env); - spv_diagnostic diagnostic = nullptr; - spv_const_binary_t binary_struct = {binary.data(), binary.size()}; - spv_result_t error = spvValidate(context, &binary_struct, &diagnostic); - if (error) { - spvDiagnosticPrint(diagnostic); - spvDiagnosticDestroy(diagnostic); - spvContextDestroy(context); - return error; - } - spvDiagnosticDestroy(diagnostic); - spvContextDestroy(context); - - // By using the same vector as input and output, we save time in the case - // that there was no change. - bool ok = optimizer.Run(binary.data(), binary.size(), &binary); - - if (!WriteFile(out_file, "wb", binary.data(), binary.size())) { - return 1; - } - - return ok ? 0 : 1; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/stats/stats_analyzer.cpp vulkan-1.1.73+dfsg/external/spirv-tools/tools/stats/stats_analyzer.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/stats/stats_analyzer.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/stats/stats_analyzer.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,886 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include "stats_analyzer.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "spirv/1.2/spirv.h" -#include "source/enum_string_mapping.h" -#include "source/comp/markv_model.h" -#include "source/opcode.h" -#include "source/operand.h" -#include "source/spirv_constant.h" -#include "source/util/huffman_codec.h" - -using libspirv::SpirvStats; -using spvutils::HuffmanCodec; - -namespace { - -// Signals that the value is not in the coding scheme and a fallback method -// needs to be used. -const uint64_t kMarkvNoneOfTheAbove = - spvtools::MarkvModel::GetMarkvNoneOfTheAbove(); - -inline uint32_t CombineOpcodeAndNumOperands(uint32_t opcode, - uint32_t num_operands) { - return opcode | (num_operands << 16); -} - -// Returns all SPIR-V v1.2 opcodes. -std::vector GetAllOpcodes() { - return std::vector({ - SpvOpNop, - SpvOpUndef, - SpvOpSourceContinued, - SpvOpSource, - SpvOpSourceExtension, - SpvOpName, - SpvOpMemberName, - SpvOpString, - SpvOpLine, - SpvOpExtension, - SpvOpExtInstImport, - SpvOpExtInst, - SpvOpMemoryModel, - SpvOpEntryPoint, - SpvOpExecutionMode, - SpvOpCapability, - SpvOpTypeVoid, - SpvOpTypeBool, - SpvOpTypeInt, - SpvOpTypeFloat, - SpvOpTypeVector, - SpvOpTypeMatrix, - SpvOpTypeImage, - SpvOpTypeSampler, - SpvOpTypeSampledImage, - SpvOpTypeArray, - SpvOpTypeRuntimeArray, - SpvOpTypeStruct, - SpvOpTypeOpaque, - SpvOpTypePointer, - SpvOpTypeFunction, - SpvOpTypeEvent, - SpvOpTypeDeviceEvent, - SpvOpTypeReserveId, - SpvOpTypeQueue, - SpvOpTypePipe, - SpvOpTypeForwardPointer, - SpvOpConstantTrue, - SpvOpConstantFalse, - SpvOpConstant, - SpvOpConstantComposite, - SpvOpConstantSampler, - SpvOpConstantNull, - SpvOpSpecConstantTrue, - SpvOpSpecConstantFalse, - SpvOpSpecConstant, - SpvOpSpecConstantComposite, - SpvOpSpecConstantOp, - SpvOpFunction, - SpvOpFunctionParameter, - SpvOpFunctionEnd, - SpvOpFunctionCall, - SpvOpVariable, - SpvOpImageTexelPointer, - SpvOpLoad, - SpvOpStore, - SpvOpCopyMemory, - SpvOpCopyMemorySized, - SpvOpAccessChain, - SpvOpInBoundsAccessChain, - SpvOpPtrAccessChain, - SpvOpArrayLength, - SpvOpGenericPtrMemSemantics, - SpvOpInBoundsPtrAccessChain, - SpvOpDecorate, - SpvOpMemberDecorate, - SpvOpDecorationGroup, - SpvOpGroupDecorate, - SpvOpGroupMemberDecorate, - SpvOpVectorExtractDynamic, - SpvOpVectorInsertDynamic, - SpvOpVectorShuffle, - SpvOpCompositeConstruct, - SpvOpCompositeExtract, - SpvOpCompositeInsert, - SpvOpCopyObject, - SpvOpTranspose, - SpvOpSampledImage, - SpvOpImageSampleImplicitLod, - SpvOpImageSampleExplicitLod, - SpvOpImageSampleDrefImplicitLod, - SpvOpImageSampleDrefExplicitLod, - SpvOpImageSampleProjImplicitLod, - SpvOpImageSampleProjExplicitLod, - SpvOpImageSampleProjDrefImplicitLod, - SpvOpImageSampleProjDrefExplicitLod, - SpvOpImageFetch, - SpvOpImageGather, - SpvOpImageDrefGather, - SpvOpImageRead, - SpvOpImageWrite, - SpvOpImage, - SpvOpImageQueryFormat, - SpvOpImageQueryOrder, - SpvOpImageQuerySizeLod, - SpvOpImageQuerySize, - SpvOpImageQueryLod, - SpvOpImageQueryLevels, - SpvOpImageQuerySamples, - SpvOpConvertFToU, - SpvOpConvertFToS, - SpvOpConvertSToF, - SpvOpConvertUToF, - SpvOpUConvert, - SpvOpSConvert, - SpvOpFConvert, - SpvOpQuantizeToF16, - SpvOpConvertPtrToU, - SpvOpSatConvertSToU, - SpvOpSatConvertUToS, - SpvOpConvertUToPtr, - SpvOpPtrCastToGeneric, - SpvOpGenericCastToPtr, - SpvOpGenericCastToPtrExplicit, - SpvOpBitcast, - SpvOpSNegate, - SpvOpFNegate, - SpvOpIAdd, - SpvOpFAdd, - SpvOpISub, - SpvOpFSub, - SpvOpIMul, - SpvOpFMul, - SpvOpUDiv, - SpvOpSDiv, - SpvOpFDiv, - SpvOpUMod, - SpvOpSRem, - SpvOpSMod, - SpvOpFRem, - SpvOpFMod, - SpvOpVectorTimesScalar, - SpvOpMatrixTimesScalar, - SpvOpVectorTimesMatrix, - SpvOpMatrixTimesVector, - SpvOpMatrixTimesMatrix, - SpvOpOuterProduct, - SpvOpDot, - SpvOpIAddCarry, - SpvOpISubBorrow, - SpvOpUMulExtended, - SpvOpSMulExtended, - SpvOpAny, - SpvOpAll, - SpvOpIsNan, - SpvOpIsInf, - SpvOpIsFinite, - SpvOpIsNormal, - SpvOpSignBitSet, - SpvOpLessOrGreater, - SpvOpOrdered, - SpvOpUnordered, - SpvOpLogicalEqual, - SpvOpLogicalNotEqual, - SpvOpLogicalOr, - SpvOpLogicalAnd, - SpvOpLogicalNot, - SpvOpSelect, - SpvOpIEqual, - SpvOpINotEqual, - SpvOpUGreaterThan, - SpvOpSGreaterThan, - SpvOpUGreaterThanEqual, - SpvOpSGreaterThanEqual, - SpvOpULessThan, - SpvOpSLessThan, - SpvOpULessThanEqual, - SpvOpSLessThanEqual, - SpvOpFOrdEqual, - SpvOpFUnordEqual, - SpvOpFOrdNotEqual, - SpvOpFUnordNotEqual, - SpvOpFOrdLessThan, - SpvOpFUnordLessThan, - SpvOpFOrdGreaterThan, - SpvOpFUnordGreaterThan, - SpvOpFOrdLessThanEqual, - SpvOpFUnordLessThanEqual, - SpvOpFOrdGreaterThanEqual, - SpvOpFUnordGreaterThanEqual, - SpvOpShiftRightLogical, - SpvOpShiftRightArithmetic, - SpvOpShiftLeftLogical, - SpvOpBitwiseOr, - SpvOpBitwiseXor, - SpvOpBitwiseAnd, - SpvOpNot, - SpvOpBitFieldInsert, - SpvOpBitFieldSExtract, - SpvOpBitFieldUExtract, - SpvOpBitReverse, - SpvOpBitCount, - SpvOpDPdx, - SpvOpDPdy, - SpvOpFwidth, - SpvOpDPdxFine, - SpvOpDPdyFine, - SpvOpFwidthFine, - SpvOpDPdxCoarse, - SpvOpDPdyCoarse, - SpvOpFwidthCoarse, - SpvOpEmitVertex, - SpvOpEndPrimitive, - SpvOpEmitStreamVertex, - SpvOpEndStreamPrimitive, - SpvOpControlBarrier, - SpvOpMemoryBarrier, - SpvOpAtomicLoad, - SpvOpAtomicStore, - SpvOpAtomicExchange, - SpvOpAtomicCompareExchange, - SpvOpAtomicCompareExchangeWeak, - SpvOpAtomicIIncrement, - SpvOpAtomicIDecrement, - SpvOpAtomicIAdd, - SpvOpAtomicISub, - SpvOpAtomicSMin, - SpvOpAtomicUMin, - SpvOpAtomicSMax, - SpvOpAtomicUMax, - SpvOpAtomicAnd, - SpvOpAtomicOr, - SpvOpAtomicXor, - SpvOpPhi, - SpvOpLoopMerge, - SpvOpSelectionMerge, - SpvOpLabel, - SpvOpBranch, - SpvOpBranchConditional, - SpvOpSwitch, - SpvOpKill, - SpvOpReturn, - SpvOpReturnValue, - SpvOpUnreachable, - SpvOpLifetimeStart, - SpvOpLifetimeStop, - SpvOpGroupAsyncCopy, - SpvOpGroupWaitEvents, - SpvOpGroupAll, - SpvOpGroupAny, - SpvOpGroupBroadcast, - SpvOpGroupIAdd, - SpvOpGroupFAdd, - SpvOpGroupFMin, - SpvOpGroupUMin, - SpvOpGroupSMin, - SpvOpGroupFMax, - SpvOpGroupUMax, - SpvOpGroupSMax, - SpvOpReadPipe, - SpvOpWritePipe, - SpvOpReservedReadPipe, - SpvOpReservedWritePipe, - SpvOpReserveReadPipePackets, - SpvOpReserveWritePipePackets, - SpvOpCommitReadPipe, - SpvOpCommitWritePipe, - SpvOpIsValidReserveId, - SpvOpGetNumPipePackets, - SpvOpGetMaxPipePackets, - SpvOpGroupReserveReadPipePackets, - SpvOpGroupReserveWritePipePackets, - SpvOpGroupCommitReadPipe, - SpvOpGroupCommitWritePipe, - SpvOpEnqueueMarker, - SpvOpEnqueueKernel, - SpvOpGetKernelNDrangeSubGroupCount, - SpvOpGetKernelNDrangeMaxSubGroupSize, - SpvOpGetKernelWorkGroupSize, - SpvOpGetKernelPreferredWorkGroupSizeMultiple, - SpvOpRetainEvent, - SpvOpReleaseEvent, - SpvOpCreateUserEvent, - SpvOpIsValidEvent, - SpvOpSetUserEventStatus, - SpvOpCaptureEventProfilingInfo, - SpvOpGetDefaultQueue, - SpvOpBuildNDRange, - SpvOpImageSparseSampleImplicitLod, - SpvOpImageSparseSampleExplicitLod, - SpvOpImageSparseSampleDrefImplicitLod, - SpvOpImageSparseSampleDrefExplicitLod, - SpvOpImageSparseSampleProjImplicitLod, - SpvOpImageSparseSampleProjExplicitLod, - SpvOpImageSparseSampleProjDrefImplicitLod, - SpvOpImageSparseSampleProjDrefExplicitLod, - SpvOpImageSparseFetch, - SpvOpImageSparseGather, - SpvOpImageSparseDrefGather, - SpvOpImageSparseTexelsResident, - SpvOpNoLine, - SpvOpAtomicFlagTestAndSet, - SpvOpAtomicFlagClear, - SpvOpImageSparseRead, - SpvOpSizeOf, - SpvOpTypePipeStorage, - SpvOpConstantPipeStorage, - SpvOpCreatePipeFromPipeStorage, - SpvOpGetKernelLocalSizeForSubgroupCount, - SpvOpGetKernelMaxNumSubgroups, - SpvOpTypeNamedBarrier, - SpvOpNamedBarrierInitialize, - SpvOpMemoryNamedBarrier, - SpvOpModuleProcessed, - SpvOpExecutionModeId, - SpvOpDecorateId, - SpvOpSubgroupBallotKHR, - SpvOpSubgroupFirstInvocationKHR, - SpvOpSubgroupAllKHR, - SpvOpSubgroupAnyKHR, - SpvOpSubgroupAllEqualKHR, - SpvOpSubgroupReadInvocationKHR, - }); -} - -std::string GetVersionString(uint32_t word) { - std::stringstream ss; - ss << "Version " << SPV_SPIRV_VERSION_MAJOR_PART(word) - << "." << SPV_SPIRV_VERSION_MINOR_PART(word); - return ss.str(); -} - -std::string GetGeneratorString(uint32_t word) { - return spvGeneratorStr(SPV_GENERATOR_TOOL_PART(word)); -} - -std::string GetOpcodeString(uint32_t word) { - return spvOpcodeString(static_cast(word)); -} - -std::string GetCapabilityString(uint32_t word) { - return libspirv::CapabilityToString(static_cast(word)); -} - -template -std::string KeyIsLabel(T key) { - std::stringstream ss; - ss << key; - return ss.str(); -} - -template -std::unordered_map GetRecall( - const std::unordered_map& hist, uint64_t total) { - std::unordered_map freq; - for (const auto& pair : hist) { - const double frequency = - static_cast(pair.second) / static_cast(total); - freq.emplace(pair.first, frequency); - } - return freq; -} - -template -std::unordered_map GetPrevalence( - const std::unordered_map& hist) { - uint64_t total = 0; - for (const auto& pair : hist) { - total += pair.second; - } - - return GetRecall(hist, total); -} - -// Writes |freq| to |out| sorted by frequency in the following format: -// LABEL3 70% -// LABEL1 20% -// LABEL2 10% -// |label_from_key| is used to convert |Key| to label. -template -void WriteFreq(std::ostream& out, const std::unordered_map& freq, - std::string (*label_from_key)(Key), double threshold = 0.001) { - std::vector> sorted_freq(freq.begin(), freq.end()); - std::sort(sorted_freq.begin(), sorted_freq.end(), - [](const std::pair& left, - const std::pair& right) { - return left.second > right.second; - }); - - for (const auto& pair : sorted_freq) { - if (pair.second < threshold) - break; - out << label_from_key(pair.first) << " " << pair.second * 100.0 - << "%" << std::endl; - } -} - -// Writes |hist| to |out| sorted by count in the following format: -// LABEL3 100 -// LABEL1 50 -// LABEL2 10 -// |label_from_key| is used to convert |Key| to label. -template -void WriteHist(std::ostream& out, const std::unordered_map& hist, - std::string (*label_from_key)(Key)) { - std::vector> sorted_hist(hist.begin(), hist.end()); - std::sort(sorted_hist.begin(), sorted_hist.end(), - [](const std::pair& left, - const std::pair& right) { - return left.second > right.second; - }); - - for (const auto& pair : sorted_hist) { - out << label_from_key(pair.first) << " " << pair.second << std::endl; - } -} - -} // namespace - -StatsAnalyzer::StatsAnalyzer(const SpirvStats& stats) : stats_(stats) { - num_modules_ = 0; - for (const auto& pair : stats_.version_hist) { - num_modules_ += pair.second; - } - - version_freq_ = GetRecall(stats_.version_hist, num_modules_); - generator_freq_ = GetRecall(stats_.generator_hist, num_modules_); - capability_freq_ = GetRecall(stats_.capability_hist, num_modules_); - extension_freq_ = GetRecall(stats_.extension_hist, num_modules_); - opcode_freq_ = GetPrevalence(stats_.opcode_hist); -} - -void StatsAnalyzer::WriteVersion(std::ostream& out) { - WriteFreq(out, version_freq_, GetVersionString); -} - -void StatsAnalyzer::WriteGenerator(std::ostream& out) { - WriteFreq(out, generator_freq_, GetGeneratorString); -} - -void StatsAnalyzer::WriteCapability(std::ostream& out) { - WriteFreq(out, capability_freq_, GetCapabilityString); -} - -void StatsAnalyzer::WriteExtension(std::ostream& out) { - WriteFreq(out, extension_freq_, KeyIsLabel); -} - -void StatsAnalyzer::WriteOpcode(std::ostream& out) { - out << "Total unique opcodes used: " << opcode_freq_.size() << std::endl; - WriteFreq(out, opcode_freq_, GetOpcodeString); -} - -void StatsAnalyzer::WriteConstantLiterals(std::ostream& out) { - out << "Constant literals" << std::endl; - - out << "Float 32" << std::endl; - WriteFreq(out, GetPrevalence(stats_.f32_constant_hist), KeyIsLabel); - - out << std::endl << "Float 64" << std::endl; - WriteFreq(out, GetPrevalence(stats_.f64_constant_hist), KeyIsLabel); - - out << std::endl << "Unsigned int 16" << std::endl; - WriteFreq(out, GetPrevalence(stats_.u16_constant_hist), KeyIsLabel); - - out << std::endl << "Signed int 16" << std::endl; - WriteFreq(out, GetPrevalence(stats_.s16_constant_hist), KeyIsLabel); - - out << std::endl << "Unsigned int 32" << std::endl; - WriteFreq(out, GetPrevalence(stats_.u32_constant_hist), KeyIsLabel); - - out << std::endl << "Signed int 32" << std::endl; - WriteFreq(out, GetPrevalence(stats_.s32_constant_hist), KeyIsLabel); - - out << std::endl << "Unsigned int 64" << std::endl; - WriteFreq(out, GetPrevalence(stats_.u64_constant_hist), KeyIsLabel); - - out << std::endl << "Signed int 64" << std::endl; - WriteFreq(out, GetPrevalence(stats_.s64_constant_hist), KeyIsLabel); -} - -void StatsAnalyzer::WriteOpcodeMarkov(std::ostream& out) { - if (stats_.opcode_markov_hist.empty()) - return; - - const std::unordered_map>& - cue_to_hist = stats_.opcode_markov_hist[0]; - - // Sort by prevalence of the opcodes in opcode_freq_ (descending). - std::vector>> - sorted_cue_to_hist(cue_to_hist.begin(), cue_to_hist.end()); - std::sort(sorted_cue_to_hist.begin(), sorted_cue_to_hist.end(), - [this]( - const std::pair>& left, - const std::pair>& right) { - const double lf = opcode_freq_[left.first]; - const double rf = opcode_freq_[right.first]; - if (lf == rf) - return right.first > left.first; - return lf > rf; - }); - - for (const auto& kv : sorted_cue_to_hist) { - const uint32_t cue = kv.first; - const double kFrequentEnoughToAnalyze = 0.0001; - if (opcode_freq_[cue] < kFrequentEnoughToAnalyze) continue; - - const std::unordered_map& hist = kv.second; - - uint32_t total = 0; - for (const auto& pair : hist) { - total += pair.second; - } - - std::vector> - sorted_hist(hist.begin(), hist.end()); - std::sort(sorted_hist.begin(), sorted_hist.end(), - [](const std::pair& left, - const std::pair& right) { - if (left.second == right.second) - return right.first > left.first; - return left.second > right.second; - }); - - for (const auto& pair : sorted_hist) { - const double prior = opcode_freq_[pair.first]; - const double posterior = - static_cast(pair.second) / static_cast(total); - out << GetOpcodeString(cue) << " -> " << GetOpcodeString(pair.first) - << " " << posterior * 100 << "% (base rate " << prior * 100 - << "%, pair occurrences " << pair.second << ")" << std::endl; - } - } -} - -void StatsAnalyzer::WriteCodegenOpcodeHist(std::ostream& out) { - auto all_opcodes = GetAllOpcodes(); - - // uint64_t is used because kMarkvNoneOfTheAbove is outside of uint32_t range. - out << "std::map GetOpcodeHist() {\n" - << " return std::map({\n"; - - uint32_t total = 0; - for (const auto& kv : stats_.opcode_hist) { - total += kv.second; - } - - for (uint32_t opcode : all_opcodes) { - const auto it = stats_.opcode_hist.find(opcode); - const uint32_t count = it == stats_.opcode_hist.end() ? 0 : it->second; - const double kMaxValue = 1000.0; - uint32_t value = uint32_t(kMaxValue * double(count) / double(total)); - if (value == 0) - value = 1; - out << " { SpvOp" << GetOpcodeString(opcode) - << ", " << value << " },\n"; - } - - // Add kMarkvNoneOfTheAbove as a signal for unknown opcode. - out << " { kMarkvNoneOfTheAbove, " << 10 << " },\n"; - out << " });\n}\n"; -} - -void StatsAnalyzer::WriteCodegenOpcodeAndNumOperandsHist(std::ostream& out) { - out << "std::map GetOpcodeAndNumOperandsHist() {\n" - << " return std::map({\n"; - - - uint32_t total = 0; - for (const auto& kv : stats_.opcode_and_num_operands_hist) { - total += kv.second; - } - - uint32_t left_out = 0; - - for (const auto& kv : stats_.opcode_and_num_operands_hist) { - const uint32_t count = kv.second; - const double kFrequentEnoughToAnalyze = 0.001; - const uint32_t opcode_and_num_operands = kv.first; - const uint32_t opcode = opcode_and_num_operands & 0xFFFF; - const uint32_t num_operands = opcode_and_num_operands >> 16; - - if (opcode == SpvOpTypeStruct || - double(count) / double(total) < kFrequentEnoughToAnalyze) { - left_out += count; - continue; - } - - out << " { CombineOpcodeAndNumOperands(SpvOp" - << spvOpcodeString(SpvOp(opcode)) - << ", " << num_operands << "), " << count << " },\n"; - } - - // Heuristic. - const uint32_t none_of_the_above = - std::max(1, int(left_out + total * 0.01)); - out << " { kMarkvNoneOfTheAbove, " << none_of_the_above << " },\n"; - out << " });\n}\n"; -} - -void StatsAnalyzer::WriteCodegenOpcodeAndNumOperandsMarkovHuffmanCodecs( - std::ostream& out) { - out << "std::map>>\n" - << "GetOpcodeAndNumOperandsMarkovHuffmanCodecs() {\n" - << " std::map>> " - << "codecs;\n"; - - for (const auto& kv : stats_.opcode_and_num_operands_markov_hist) { - const uint32_t prev_opcode = kv.first; - const double kFrequentEnoughToAnalyze = 0.001; - if (opcode_freq_[prev_opcode] < kFrequentEnoughToAnalyze) continue; - - const std::unordered_map& hist = kv.second; - - uint32_t total = 0; - for (const auto& pair : hist) { - total += pair.second; - } - - uint32_t left_out = 0; - - std::map processed_hist; - for (const auto& pair : hist) { - const uint32_t opcode_and_num_operands = pair.first; - const uint32_t opcode = opcode_and_num_operands & 0xFFFF; - - if (opcode == SpvOpTypeStruct) - continue; - - const uint32_t num_operands = opcode_and_num_operands >> 16; - const uint32_t count = pair.second; - const double posterior_freq = double(count) / double(total); - - if (opcode_freq_[opcode] < kFrequentEnoughToAnalyze && - posterior_freq < kFrequentEnoughToAnalyze) { - left_out += count; - continue; - } - processed_hist.emplace(CombineOpcodeAndNumOperands(opcode, num_operands), - count); - } - - // Heuristic. - processed_hist.emplace(kMarkvNoneOfTheAbove, - std::max(1, int(left_out + total * 0.01))); - - HuffmanCodec codec(processed_hist); - - out << " {\n"; - out << " std::unique_ptr> " - << "codec(new HuffmanCodec"; - out << codec.SerializeToText(4); - out << ");\n" << std::endl; - out << " codecs.emplace(SpvOp" << GetOpcodeString(prev_opcode) - << ", std::move(codec));\n"; - out << " }\n\n"; - } - - out << " return codecs;\n}\n"; -} - -void StatsAnalyzer::WriteCodegenLiteralStringHuffmanCodecs(std::ostream& out) { - out << "std::map>>\n" - << "GetLiteralStringHuffmanCodecs() {\n" - << " std::map>> " - << "codecs;\n"; - - for (const auto& kv : stats_.literal_strings_hist) { - const uint32_t opcode = kv.first; - - if (opcode == SpvOpName || opcode == SpvOpMemberName) - continue; - - const double kOpcodeFrequentEnoughToAnalyze = 0.001; - if (opcode_freq_[opcode] < kOpcodeFrequentEnoughToAnalyze) continue; - - const std::unordered_map& hist = kv.second; - - uint32_t total = 0; - for (const auto& pair : hist) { - total += pair.second; - } - - uint32_t left_out = 0; - - std::map processed_hist; - for (const auto& pair : hist) { - const uint32_t count = pair.second; - const double freq = double(count) / double(total); - const double kStringFrequentEnoughToAnalyze = 0.001; - if (freq < kStringFrequentEnoughToAnalyze) { - left_out += count; - continue; - } - processed_hist.emplace(pair.first, count); - } - - // Heuristic. - processed_hist.emplace("kMarkvNoneOfTheAbove", - std::max(1, int(left_out + total * 0.01))); - - HuffmanCodec codec(processed_hist); - - out << " {\n"; - out << " std::unique_ptr> " - << "codec(new HuffmanCodec"; - out << codec.SerializeToText(4); - out << ");\n" << std::endl; - out << " codecs.emplace(SpvOp" << spvOpcodeString(SpvOp(opcode)) - << ", std::move(codec));\n"; - out << " }\n\n"; - } - - out << " return codecs;\n}\n"; -} - -void StatsAnalyzer::WriteCodegenNonIdWordHuffmanCodecs(std::ostream& out) { - out << "std::map, " - << "std::unique_ptr>>\n" - << "GetNonIdWordHuffmanCodecs() {\n" - << " std::map, " - << "std::unique_ptr>> codecs;\n"; - - for (const auto& kv : stats_.operand_slot_non_id_words_hist) { - const auto& opcode_and_index = kv.first; - const uint32_t opcode = opcode_and_index.first; - const uint32_t index = opcode_and_index.second; - - const double kOpcodeFrequentEnoughToAnalyze = 0.001; - if (opcode_freq_[opcode] < kOpcodeFrequentEnoughToAnalyze) continue; - - const std::map& hist = kv.second; - - uint32_t total = 0; - for (const auto& pair : hist) { - total += pair.second; - } - - uint32_t left_out = 0; - - std::map processed_hist; - for (const auto& pair : hist) { - const uint32_t word = pair.first; - const uint32_t count = pair.second; - const double freq = double(count) / double(total); - const double kWordFrequentEnoughToAnalyze = 0.003; - if (freq < kWordFrequentEnoughToAnalyze) { - left_out += count; - continue; - } - processed_hist.emplace(word, count); - } - - // Heuristic. - processed_hist.emplace(kMarkvNoneOfTheAbove, - std::max(1, int(left_out + total * 0.01))); - - HuffmanCodec codec(processed_hist); - - out << " {\n"; - out << " std::unique_ptr> " - << "codec(new HuffmanCodec"; - out << codec.SerializeToText(4); - out << ");\n" << std::endl; - out << " codecs.emplace(std::pair(SpvOp" - << spvOpcodeString(SpvOp(opcode)) - << ", " << index << "), std::move(codec));\n"; - out << " }\n\n"; - } - - out << " return codecs;\n}\n"; -} - -void StatsAnalyzer::WriteCodegenIdDescriptorHuffmanCodecs( - std::ostream& out) { - out << "std::map, " - << "std::unique_ptr>>\n" - << "GetIdDescriptorHuffmanCodecs() {\n" - << " std::map, " - << "std::unique_ptr>> codecs;\n"; - - std::unordered_set descriptors_with_coding_scheme; - - for (const auto& kv : stats_.operand_slot_id_descriptor_hist) { - const auto& opcode_and_index = kv.first; - const uint32_t opcode = opcode_and_index.first; - const uint32_t index = opcode_and_index.second; - - const double kOpcodeFrequentEnoughToAnalyze = 0.003; - if (opcode_freq_[opcode] < kOpcodeFrequentEnoughToAnalyze) continue; - - const std::map& hist = kv.second; - - - uint32_t total = 0; - for (const auto& pair : hist) { - total += pair.second; - } - - uint32_t left_out = 0; - - std::map processed_hist; - for (const auto& pair : hist) { - const uint32_t descriptor = pair.first; - const uint32_t count = pair.second; - const double freq = double(count) / double(total); - const double kDescriptorFrequentEnoughToAnalyze = 0.003; - if (freq < kDescriptorFrequentEnoughToAnalyze) { - left_out += count; - continue; - } - processed_hist.emplace(descriptor, count); - descriptors_with_coding_scheme.insert(descriptor); - } - - // Heuristic. - processed_hist.emplace(kMarkvNoneOfTheAbove, - std::max(1, int(left_out + total * 0.01))); - - - HuffmanCodec codec(processed_hist); - - out << " {\n"; - out << " std::unique_ptr> " - << "codec(new HuffmanCodec"; - out << codec.SerializeToText(4); - out << ");\n" << std::endl; - out << " codecs.emplace(std::pair(SpvOp" - << spvOpcodeString(SpvOp(opcode)) - << ", " << index << "), std::move(codec));\n"; - out << " }\n\n"; - } - - out << " return codecs;\n}\n"; - - out << "\nstd::unordered_set GetDescriptorsWithCodingScheme() {\n" - << " std::unordered_set descriptors_with_coding_scheme = {\n"; - for (uint32_t descriptor : descriptors_with_coding_scheme) { - out << " " << descriptor << ",\n"; - } - out << " };\n"; - out << " return descriptors_with_coding_scheme;\n}\n"; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/stats/stats_analyzer.h vulkan-1.1.73+dfsg/external/spirv-tools/tools/stats/stats_analyzer.h --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/stats/stats_analyzer.h 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/stats/stats_analyzer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -// Copyright (c) 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_TOOLS_STATS_STATS_ANALYZER_H_ -#define LIBSPIRV_TOOLS_STATS_STATS_ANALYZER_H_ - -#include - -#include "source/spirv_stats.h" - -class StatsAnalyzer { - public: - explicit StatsAnalyzer(const libspirv::SpirvStats& stats); - - // Writes respective histograms to |out|. - void WriteVersion(std::ostream& out); - void WriteGenerator(std::ostream& out); - void WriteCapability(std::ostream& out); - void WriteExtension(std::ostream& out); - void WriteOpcode(std::ostream& out); - void WriteConstantLiterals(std::ostream& out); - - // Writes first order Markov analysis to |out|. - // stats_.opcode_markov_hist needs to contain raw data for at least one - // level. - void WriteOpcodeMarkov(std::ostream& out); - - // Writes C++ code containing a function returning opcode histogram. - void WriteCodegenOpcodeHist(std::ostream& out); - - // Writes C++ code containing a function returning opcode_and_num_operands - // histogram. - void WriteCodegenOpcodeAndNumOperandsHist(std::ostream& out); - - // Writes C++ code containing a function returning a map of Huffman codecs - // for opcode_and_num_operands. Each Huffman codec is created for a specific - // previous opcode. - // TODO(atgoo@github.com) Write code which would contain pregenerated Huffman - // codecs, instead of code which would generate them every time. - void WriteCodegenOpcodeAndNumOperandsMarkovHuffmanCodecs(std::ostream& out); - - // Writes C++ code containing a function returning a map of Huffman codecs - // for literal strings. Each Huffman codec is created for a specific opcode. - // I.e. OpExtension and OpExtInstImport would use different codecs. - void WriteCodegenLiteralStringHuffmanCodecs(std::ostream& out); - - // Writes C++ code containing a function returning a map of Huffman codecs - // for single-word non-id operands. Each Huffman codec is created for a - // specific operand slot (opcode and operand number). - void WriteCodegenNonIdWordHuffmanCodecs(std::ostream& out); - - // Writes C++ code containing a function returning a map of Huffman codecs - // for common id descriptors. Each Huffman codec is created for a - // specific operand slot (opcode and operand number). - void WriteCodegenIdDescriptorHuffmanCodecs(std::ostream& out); - - private: - const libspirv::SpirvStats& stats_; - - uint32_t num_modules_; - - std::unordered_map version_freq_; - std::unordered_map generator_freq_; - std::unordered_map capability_freq_; - std::unordered_map extension_freq_; - std::unordered_map opcode_freq_; -}; - - -#endif // LIBSPIRV_TOOLS_STATS_STATS_ANALYZER_H_ diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/stats/stats.cpp vulkan-1.1.73+dfsg/external/spirv-tools/tools/stats/stats.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/stats/stats.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/stats/stats.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,274 +0,0 @@ -// Copyright (c) 2017 Google 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. - -#include -#include -#include -#include -#include - -#include "source/spirv_stats.h" -#include "source/table.h" -#include "spirv-tools/libspirv.h" -#include "stats_analyzer.h" -#include "tools/io.h" - -using libspirv::SpirvStats; - -namespace { - -struct ScopedContext { - ScopedContext(spv_target_env env) : context(spvContextCreate(env)) {} - ~ScopedContext() { spvContextDestroy(context); } - spv_context context; -}; - -void PrintUsage(char* argv0) { - printf( - R"(%s - Collect statistics from one or more SPIR-V binary file(s). - -USAGE: %s [options] [] - -TIP: In order to collect statistics from all .spv files under current dir use -find . -name "*.spv" -print0 | xargs -0 -s 2000000 %s - -Options: - -h, --help - Print this help. - - -v, --verbose - Print additional info to stderr. - - --codegen_opcode_hist - Output generated C++ code for opcode histogram. - This flag disables non-C++ output. - - --codegen_opcode_and_num_operands_hist - Output generated C++ code for opcode_and_num_operands - histogram. - This flag disables non-C++ output. - - --codegen_opcode_and_num_operands_markov_huffman_codecs - Output generated C++ code for Huffman codecs of - opcode_and_num_operands Markov chain. - This flag disables non-C++ output. - - --codegen_literal_string_huffman_codecs - Output generated C++ code for Huffman codecs for - literal strings. - This flag disables non-C++ output. - - --codegen_non_id_word_huffman_codecs - Output generated C++ code for Huffman codecs for - single-word non-id slots. - This flag disables non-C++ output. - - --codegen_id_descriptor_huffman_codecs - Output generated C++ code for Huffman codecs for - common id descriptors. - This flag disables non-C++ output. -)", - argv0, argv0, argv0); -} - -void DiagnosticsMessageHandler(spv_message_level_t level, const char*, - const spv_position_t& position, - const char* message) { - switch (level) { - case SPV_MSG_FATAL: - case SPV_MSG_INTERNAL_ERROR: - case SPV_MSG_ERROR: - std::cerr << "error: " << position.index << ": " << message - << std::endl; - break; - case SPV_MSG_WARNING: - std::cout << "warning: " << position.index << ": " << message - << std::endl; - break; - case SPV_MSG_INFO: - std::cout << "info: " << position.index << ": " << message << std::endl; - break; - default: - break; - } -} - -} // namespace - -int main(int argc, char** argv) { - bool continue_processing = true; - int return_code = 0; - - bool expect_output_path = false; - bool verbose = false; - bool export_text = true; - bool codegen_opcode_hist = false; - bool codegen_opcode_and_num_operands_hist = false; - bool codegen_opcode_and_num_operands_markov_huffman_codecs = false; - bool codegen_literal_string_huffman_codecs = false; - bool codegen_non_id_word_huffman_codecs = false; - bool codegen_id_descriptor_huffman_codecs = false; - - std::vector paths; - const char* output_path = nullptr; - - for (int argi = 1; continue_processing && argi < argc; ++argi) { - const char* cur_arg = argv[argi]; - if ('-' == cur_arg[0]) { - if (0 == strcmp(cur_arg, "--help") || 0 == strcmp(cur_arg, "-h")) { - PrintUsage(argv[0]); - continue_processing = false; - return_code = 0; - } else if (0 == strcmp(cur_arg, "--codegen_opcode_hist")) { - codegen_opcode_hist = true; - export_text = false; - } else if (0 == strcmp(cur_arg, - "--codegen_opcode_and_num_operands_hist")) { - codegen_opcode_and_num_operands_hist = true; - export_text = false; - } else if (strcmp( - "--codegen_opcode_and_num_operands_markov_huffman_codecs", - cur_arg) == 0) { - codegen_opcode_and_num_operands_markov_huffman_codecs = true; - export_text = false; - } else if (0 == strcmp(cur_arg, - "--codegen_literal_string_huffman_codecs")) { - codegen_literal_string_huffman_codecs = true; - export_text = false; - } else if (0 == strcmp(cur_arg, - "--codegen_non_id_word_huffman_codecs")) { - codegen_non_id_word_huffman_codecs = true; - export_text = false; - } else if (0 == strcmp(cur_arg, - "--codegen_id_descriptor_huffman_codecs")) { - codegen_id_descriptor_huffman_codecs = true; - export_text = false; - } else if (0 == strcmp(cur_arg, "--verbose") || - 0 == strcmp(cur_arg, "-v")) { - verbose = true; - } else if (0 == strcmp(cur_arg, "--output") || - 0 == strcmp(cur_arg, "-o")) { - expect_output_path = true; - } else { - PrintUsage(argv[0]); - continue_processing = false; - return_code = 1; - } - } else { - if (expect_output_path) { - output_path = cur_arg; - expect_output_path = false; - } else { - paths.push_back(cur_arg); - } - } - } - - // Exit if command line parsing was not successful. - if (!continue_processing) { - return return_code; - } - - std::cerr << "Processing " << paths.size() << " files..." << std::endl; - - ScopedContext ctx(SPV_ENV_UNIVERSAL_1_1); - SetContextMessageConsumer(ctx.context, DiagnosticsMessageHandler); - - libspirv::SpirvStats stats; - stats.opcode_markov_hist.resize(1); - - for (size_t index = 0; index < paths.size(); ++index) { - const size_t kMilestonePeriod = 1000; - if (verbose) { - if (index % kMilestonePeriod == kMilestonePeriod - 1) - std::cerr << "Processed " << index + 1 << " files..." << std::endl; - } - - const char* path = paths[index]; - std::vector contents; - if (!ReadFile(path, "rb", &contents)) return 1; - - if (SPV_SUCCESS != libspirv::AggregateStats( - *ctx.context, contents.data(), contents.size(), nullptr, &stats)) { - std::cerr << "error: Failed to aggregate stats for " << path << std::endl; - return 1; - } - } - - StatsAnalyzer analyzer(stats); - - std::ofstream fout; - if (output_path) { - fout.open(output_path); - if (!fout.is_open()) { - std::cerr << "error: Failed to open " << output_path << std::endl; - return 1; - } - } - - std::ostream& out = fout.is_open() ? fout : std::cout; - - if (export_text) { - out << std::endl; - analyzer.WriteVersion(out); - analyzer.WriteGenerator(out); - - out << std::endl; - analyzer.WriteCapability(out); - - out << std::endl; - analyzer.WriteExtension(out); - - out << std::endl; - analyzer.WriteOpcode(out); - - out << std::endl; - analyzer.WriteOpcodeMarkov(out); - - out << std::endl; - analyzer.WriteConstantLiterals(out); - } - - if (codegen_opcode_hist) { - out << std::endl; - analyzer.WriteCodegenOpcodeHist(out); - } - - if (codegen_opcode_and_num_operands_hist) { - out << std::endl; - analyzer.WriteCodegenOpcodeAndNumOperandsHist(out); - } - - if (codegen_opcode_and_num_operands_markov_huffman_codecs) { - out << std::endl; - analyzer.WriteCodegenOpcodeAndNumOperandsMarkovHuffmanCodecs(out); - } - - if (codegen_literal_string_huffman_codecs) { - out << std::endl; - analyzer.WriteCodegenLiteralStringHuffmanCodecs(out); - } - - if (codegen_non_id_word_huffman_codecs) { - out << std::endl; - analyzer.WriteCodegenNonIdWordHuffmanCodecs(out); - } - - if (codegen_id_descriptor_huffman_codecs) { - out << std::endl; - analyzer.WriteCodegenIdDescriptorHuffmanCodecs(out); - } - - return 0; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/val/val.cpp vulkan-1.1.73+dfsg/external/spirv-tools/tools/val/val.cpp --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/tools/val/val.cpp 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/tools/val/val.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,171 +0,0 @@ -// Copyright (c) 2015-2016 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include -#include - -#include "source/spirv_target_env.h" -#include "source/spirv_validator_options.h" -#include "spirv-tools/libspirv.hpp" -#include "tools/io.h" - -void print_usage(char* argv0) { - printf( - R"(%s - Validate a SPIR-V binary file. - -USAGE: %s [options] [] - -The SPIR-V binary is read from . If no file is specified, -or if the filename is "-", then the binary is read from standard input. - -NOTE: The validator is a work in progress. - -Options: - -h, --help Print this help. - --max-struct-members - --max-struct-depth - --max-local-variables - --max-global-variables - --max-switch-branches - --max-function-args - --max-control-flow-nesting-depth - --max-access-chain-indexes - --version Display validator version information. - --target-env {vulkan1.0|spv1.0|spv1.1|spv1.2} - Use Vulkan1.0/SPIR-V1.0/SPIR-V1.1/SPIR-V1.2 validation rules. -)", - argv0, argv0); -} - -int main(int argc, char** argv) { - const char* inFile = nullptr; - spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2; - spvtools::ValidatorOptions options; - bool continue_processing = true; - int return_code = 0; - - for (int argi = 1; continue_processing && argi < argc; ++argi) { - const char* cur_arg = argv[argi]; - if ('-' == cur_arg[0]) { - if (0 == strncmp(cur_arg, "--max-", 6)) { - if (argi + 1 < argc) { - spv_validator_limit limit_type; - if (spvParseUniversalLimitsOptions(cur_arg, &limit_type)) { - uint32_t limit = 0; - if (sscanf(argv[++argi], "%d", &limit)) { - options.SetUniversalLimit(limit_type, limit); - } else { - fprintf(stderr, "error: missing argument to %s\n", cur_arg); - continue_processing = false; - return_code = 1; - } - } else { - fprintf(stderr, "error: unrecognized option: %s\n", cur_arg); - continue_processing = false; - return_code = 1; - } - } else { - fprintf(stderr, "error: Missing argument to %s\n", cur_arg); - continue_processing = false; - return_code = 1; - } - } else if (0 == strcmp(cur_arg, "--version")) { - printf("%s\n", spvSoftwareVersionDetailsString()); - // TODO(dneto): Add OpenCL 2.2 at least. - printf("Targets:\n %s\n %s\n %s\n", - spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_1), - spvTargetEnvDescription(SPV_ENV_VULKAN_1_0), - spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_2)); - continue_processing = false; - return_code = 0; - } else if (0 == strcmp(cur_arg, "--help") || 0 == strcmp(cur_arg, "-h")) { - print_usage(argv[0]); - continue_processing = false; - return_code = 0; - } else if (0 == strcmp(cur_arg, "--target-env")) { - if (argi + 1 < argc) { - const auto env_str = argv[++argi]; - if (!spvParseTargetEnv(env_str, &target_env)) { - fprintf(stderr, "error: Unrecognized target env: %s\n", env_str); - continue_processing = false; - return_code = 1; - } - } else { - fprintf(stderr, "error: Missing argument to --target-env\n"); - continue_processing = false; - return_code = 1; - } - } else if (0 == cur_arg[1]) { - // Setting a filename of "-" to indicate stdin. - if (!inFile) { - inFile = cur_arg; - } else { - fprintf(stderr, "error: More than one input file specified\n"); - continue_processing = false; - return_code = 1; - } - } else { - print_usage(argv[0]); - continue_processing = false; - return_code = 1; - } - } else { - if (!inFile) { - inFile = cur_arg; - } else { - fprintf(stderr, "error: More than one input file specified\n"); - continue_processing = false; - return_code = 1; - } - } - } - - // Exit if command line parsing was not successful. - if (!continue_processing) { - return return_code; - } - - std::vector contents; - if (!ReadFile(inFile, "rb", &contents)) return 1; - - spvtools::SpirvTools tools(target_env); - tools.SetMessageConsumer([](spv_message_level_t level, const char*, - const spv_position_t& position, - const char* message) { - switch (level) { - case SPV_MSG_FATAL: - case SPV_MSG_INTERNAL_ERROR: - case SPV_MSG_ERROR: - std::cerr << "error: " << position.index << ": " << message - << std::endl; - break; - case SPV_MSG_WARNING: - std::cout << "warning: " << position.index << ": " << message - << std::endl; - break; - case SPV_MSG_INFO: - std::cout << "info: " << position.index << ": " << message << std::endl; - break; - default: - break; - } - }); - - bool succeed = tools.Validate(contents.data(), contents.size(), options); - - return !succeed; -} diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/.travis.yml vulkan-1.1.73+dfsg/external/spirv-tools/.travis.yml --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/.travis.yml 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,97 +0,0 @@ -# Linux Build Configuration for Travis - -language: cpp - -os: - - linux - - osx - -# Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment. -dist: trusty -sudo: false - -# Use the default Xcode environment for Xcode. - -env: - # Each line is a set of environment variables set before a build. - # Thus each line represents a different build configuration. - - BUILD_TYPE=Release - - BUILD_TYPE=Debug - -compiler: - - clang - - gcc - -matrix: - fast_finish: true - include: - # Additional build using Android NDK with android-cmake - - env: BUILD_ANDROID_CMAKE=ON - # Additional build using Android NDK with Android.mk - - env: BUILD_ANDROID_MK=ON - exclude: - # Skip GCC builds on macOS. - - os: osx - compiler: gcc - -cache: - apt: true - -git: - depth: 1 - -branches: - only: - - master - -before_install: - - if [[ "$BUILD_ANDROID_CMAKE" == "ON" ]] || [[ "$BUILD_ANDROID_MK" == "ON" ]]; then - git clone --depth=1 https://github.com/urho3d/android-ndk.git $HOME/android-ndk; - export ANDROID_NDK=$HOME/android-ndk; - git clone --depth=1 https://github.com/taka-no-me/android-cmake.git $HOME/android-cmake; - export TOOLCHAIN_PATH=$HOME/android-cmake/android.toolchain.cmake; - fi - -before_script: - - git clone --depth=1 https://github.com/KhronosGroup/SPIRV-Headers external/spirv-headers - - git clone --depth=1 https://github.com/google/googletest external/googletest - -script: - # Due to the limitation of Travis platform, we cannot start too many concurrent jobs. - # Otherwise GCC will panic with internal error, possibility because of memory issues. - # ctest with the current tests doesn't profit from using more than 4 threads. - - export NPROC=4; - - mkdir build && cd build; - - if [[ "$BUILD_ANDROID_MK" == "ON" ]]; then - export BUILD_DIR=$(pwd); - mkdir ${BUILD_DIR}/libs; - mkdir ${BUILD_DIR}/app; - $ANDROID_NDK/ndk-build -C ../android_test NDK_PROJECT_PATH=. - NDK_LIBS_OUT=${BUILD_DIR}/libs - NDK_APP_OUT=${BUILD_DIR}/app -j${NPROC}; - elif [[ "$BUILD_ANDROID_CMAKE" == "ON" ]]; then - cmake -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_PATH} - -DANDROID_NATIVE_API_LEVEL=android-9 - -DCMAKE_BUILD_TYPE=Release - -DANDROID_ABI="armeabi-v7a with NEON" - -DSPIRV_BUILD_COMPRESSION=ON - -DSPIRV_SKIP_TESTS=ON ..; - make -j${NPROC}; - else - cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSPIRV_BUILD_COMPRESSION=ON ..; - make -j${NPROC}; - ctest -j${NPROC} --output-on-failure --timeout 300; - fi - - -notifications: - email: - recipients: - - andreyt@google.com - - antiagainst@google.com - - awoloszyn@google.com - - dneto@google.com - - ehsann@google.com - - qining@google.com - on_success: change - on_failure: always diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/utils/check_copyright.py vulkan-1.1.73+dfsg/external/spirv-tools/utils/check_copyright.py --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/utils/check_copyright.py 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/utils/check_copyright.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,217 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2016 Google 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. -"""Checks for copyright notices in all the files that need them under the -current directory. Optionally insert them. When inserting, replaces -an MIT or Khronos free use license with Apache 2. -""" -from __future__ import print_function - -import argparse -import fileinput -import fnmatch -import inspect -import os -import re -import sys - -# List of designated copyright owners. -AUTHORS = ['The Khronos Group Inc.', - 'LunarG Inc.', - 'Google Inc.', - 'Pierre Moreau'] -CURRENT_YEAR='2017' - -YEARS = '(2014-2016|2015-2016|2016|2016-2017|2017)' -COPYRIGHT_RE = re.compile( - 'Copyright \(c\) {} ({})'.format(YEARS, '|'.join(AUTHORS))) - -MIT_BEGIN_RE = re.compile('Permission is hereby granted, ' - 'free of charge, to any person obtaining a') -MIT_END_RE = re.compile('MATERIALS OR THE USE OR OTHER DEALINGS IN ' - 'THE MATERIALS.') -APACHE2_BEGIN_RE = re.compile('Licensed under the Apache License, ' - 'Version 2.0 \(the "License"\);') -APACHE2_END_RE = re.compile('limitations under the License.') - -LICENSED = """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.""" -LICENSED_LEN = 10 # Number of lines in LICENSED - - -def find(top, filename_glob, skip_glob_list): - """Returns files in the tree rooted at top matching filename_glob but not - in directories matching skip_glob_list.""" - - file_list = [] - for path, dirs, files in os.walk(top): - for glob in skip_glob_list: - for match in fnmatch.filter(dirs, glob): - dirs.remove(match) - for filename in fnmatch.filter(files, filename_glob): - file_list.append(os.path.join(path, filename)) - return file_list - - -def filtered_descendants(glob): - """Returns glob-matching filenames under the current directory, but skips - some irrelevant paths.""" - return find('.', glob, ['third_party', 'external', 'build*', 'out*']) - - -def skip(line): - """Returns true if line is all whitespace or shebang.""" - stripped = line.lstrip() - return stripped == '' or stripped.startswith('#!') - - -def comment(text, prefix): - """Returns commented-out text. - - Each line of text will be prefixed by prefix and a space character. Any - trailing whitespace will be trimmed. - """ - accum = ['{} {}'.format(prefix, line).rstrip() for line in text.split('\n')] - return '\n'.join(accum) - - -def insert_copyright(author, glob, comment_prefix): - """Finds all glob-matching files under the current directory and inserts the - copyright message, and license notice. An MIT license or Khronos free - use license (modified MIT) is replaced with an Apache 2 license. - - The copyright message goes into the first non-whitespace, non-shebang line - in a file. The license notice follows it. Both are prefixed on each line - by comment_prefix and a space. - """ - - copyright = comment('Copyright (c) {} {}'.format(CURRENT_YEAR, author), - comment_prefix) + '\n\n' - licensed = comment(LICENSED, comment_prefix) + '\n\n' - for file in filtered_descendants(glob): - # Parsing states are: - # 0 Initial: Have not seen a copyright declaration. - # 1 Seen a copyright line and no other interesting lines - # 2 In the middle of an MIT or Khronos free use license - # 9 Exited any of the above - state = 0 - update_file = False - for line in fileinput.input(file, inplace=1): - emit = True - if state is 0: - if COPYRIGHT_RE.search(line): - state = 1 - elif skip(line): - pass - else: - # Didn't see a copyright. Inject copyright and license. - sys.stdout.write(copyright) - sys.stdout.write(licensed) - # Assume there isn't a previous license notice. - state = 1 - elif state is 1: - if MIT_BEGIN_RE.search(line): - state = 2 - emit = False - elif APACHE2_BEGIN_RE.search(line): - # Assume an Apache license is preceded by a copyright - # notice. So just emit it like the rest of the file. - state = 9 - elif state is 2: - # Replace the MIT license with Apache 2 - emit = False - if MIT_END_RE.search(line): - state = 9 - sys.stdout.write(licensed) - if emit: - sys.stdout.write(line) - - -def alert_if_no_copyright(glob, comment_prefix): - """Prints names of all files missing either a copyright or Apache 2 license. - - Finds all glob-matching files under the current directory and checks if they - contain the copyright message and license notice. Prints the names of all the - files that don't meet both criteria. - - Returns the total number of file names printed. - """ - printed_count = 0 - for file in filtered_descendants(glob): - has_copyright = False - has_apache2 = False - line_num = 0 - apache_expected_end = 0 - with open(file) as contents: - for line in contents: - line_num += 1 - if COPYRIGHT_RE.search(line): - has_copyright = True - if APACHE2_BEGIN_RE.search(line): - apache_expected_end = line_num + LICENSED_LEN - if (line_num is apache_expected_end) and APACHE2_END_RE.search(line): - has_apache2 = True - if not (has_copyright and has_apache2): - message = file - if not has_copyright: - message += ' has no copyright' - if not has_apache2: - message += ' has no Apache 2 license notice' - print(message) - printed_count += 1 - return printed_count - - -class ArgParser(argparse.ArgumentParser): - def __init__(self): - super(ArgParser, self).__init__( - description=inspect.getdoc(sys.modules[__name__])) - self.add_argument('--update', dest='author', action='store', - help='For files missing a copyright notice, insert ' - 'one for the given author, and add a license ' - 'notice. The author must be in the AUTHORS ' - 'list in the script.') - - -def main(): - glob_comment_pairs = [('*.h', '//'), ('*.hpp', '//'), ('*.sh', '#'), - ('*.py', '#'), ('*.cpp', '//'), - ('CMakeLists.txt', '#')] - argparser = ArgParser() - args = argparser.parse_args() - - if args.author: - if args.author not in AUTHORS: - print('error: --update argument must be in the AUTHORS list in ' - 'check_copyright.py: {}'.format(AUTHORS)) - sys.exit(1) - for pair in glob_comment_pairs: - insert_copyright(args.author, *pair) - sys.exit(0) - else: - count = sum([alert_if_no_copyright(*p) for p in glob_comment_pairs]) - sys.exit(count > 0) - - -if __name__ == '__main__': - main() diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/utils/generate_grammar_tables.py vulkan-1.1.73+dfsg/external/spirv-tools/utils/generate_grammar_tables.py --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/utils/generate_grammar_tables.py 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/utils/generate_grammar_tables.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,624 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2016 Google 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. -"""Generates various info tables from SPIR-V JSON grammar.""" - -from __future__ import print_function - -import errno -import json -import os.path -import re - -# Prefix for all C variables generated by this script. -PYGEN_VARIABLE_PREFIX = 'pygen_variable' - -# Extensions to recognize, but which don't necessarily come from the SPIRV-V -# core grammar. Get this list from the SPIR-V registery web page. -EXTENSIONS_FROM_SPIRV_REGISTRY = """ -SPV_AMD_shader_explicit_vertex_parameter -SPV_AMD_shader_trinary_minmax -SPV_AMD_gcn_shader -SPV_KHR_shader_ballot -SPV_AMD_shader_ballot -SPV_AMD_gpu_shader_half_float -SPV_KHR_shader_draw_parameters -SPV_KHR_subgroup_vote -SPV_KHR_16bit_storage -SPV_KHR_device_group -SPV_KHR_multiview -SPV_NVX_multiview_per_view_attributes -SPV_NV_viewport_array2 -SPV_NV_stereo_view_rendering -SPV_NV_sample_mask_override_coverage -SPV_NV_geometry_shader_passthrough -SPV_AMD_texture_gather_bias_lod -SPV_KHR_storage_buffer_storage_class -SPV_KHR_variable_pointers -SPV_AMD_gpu_shader_int16 -SPV_KHR_post_depth_coverage -SPV_KHR_shader_atomic_counter_ops -SPV_EXT_shader_stencil_export -SPV_EXT_shader_viewport_index_layer -SPV_AMD_shader_image_load_store_lod -SPV_AMD_shader_fragment_mask -""" - - - -def make_path_to_file(f): - """Makes all ancestor directories to the given file, if they - don't yet exist. - - Arguments: - f: The file whose ancestor directories are to be created. - """ - dir = os.path.dirname(os.path.abspath(f)) - try: - os.makedirs(dir) - except OSError as e: - if e.errno == errno.EEXIST and os.path.isdir(dir): - pass - else: - raise - - -def compose_capability_list(caps): - """Returns a string containing a braced list of capabilities as enums. - - Arguments: - - caps: a sequence of capability names - - Returns: - a string containing the braced list of SpvCapability* enums named by caps. - """ - return "{" + ", ".join(['SpvCapability{}'.format(c) for c in caps]) + "}" - - -def compose_extension_list(exts): - """Returns a string containing a braced list of extensions as enums. - - Arguments: - - exts: a sequence of extension names - - Returns: - a string containing the braced list of extensions named by exts. - """ - return "{" + ", ".join( - ['libspirv::Extension::k{}'.format(e) for e in exts]) + "}" - - -def convert_operand_kind(operand_tuple): - """Returns the corresponding operand type used in spirv-tools for - the given operand kind and quantifier used in the JSON grammar. - - Arguments: - - operand_tuple: a tuple of two elements: - - operand kind: used in the JSON grammar - - quantifier: '', '?', or '*' - - Returns: - a string of the enumerant name in spv_operand_type_t - """ - kind, quantifier = operand_tuple - # The following cases are where we differ between the JSON grammar and - # spirv-tools. - if kind == 'IdResultType': - kind = 'TypeId' - elif kind == 'IdResult': - kind = 'ResultId' - elif kind == 'IdMemorySemantics' or kind == 'MemorySemantics': - kind = 'MemorySemanticsId' - elif kind == 'IdScope' or kind == 'Scope': - kind = 'ScopeId' - elif kind == 'IdRef': - kind = 'Id' - - elif kind == 'ImageOperands': - kind = 'Image' - elif kind == 'Dim': - kind = 'Dimensionality' - elif kind == 'ImageFormat': - kind = 'SamplerImageFormat' - elif kind == 'KernelEnqueueFlags': - kind = 'KernelEnqFlags' - - elif kind == 'LiteralExtInstInteger': - kind = 'ExtensionInstructionNumber' - elif kind == 'LiteralSpecConstantOpInteger': - kind = 'SpecConstantOpNumber' - elif kind == 'LiteralContextDependentNumber': - kind = 'TypedLiteralNumber' - - elif kind == 'PairLiteralIntegerIdRef': - kind = 'LiteralIntegerId' - elif kind == 'PairIdRefLiteralInteger': - kind = 'IdLiteralInteger' - elif kind == 'PairIdRefIdRef': # Used by OpPhi in the grammar - kind = 'Id' - - if kind == 'FPRoundingMode': - kind = 'FpRoundingMode' - elif kind == 'FPFastMathMode': - kind = 'FpFastMathMode' - - if quantifier == '?': - kind = 'Optional{}'.format(kind) - elif quantifier == '*': - kind = 'Variable{}'.format(kind) - - return 'SPV_OPERAND_TYPE_{}'.format( - re.sub(r'([a-z])([A-Z])', r'\1_\2', kind).upper()) - - -class InstInitializer(object): - """Instances holds a SPIR-V instruction suitable for printing as - the initializer for spv_opcode_desc_t.""" - - def __init__(self, opname, caps, operands): - """Initialization. - - Arguments: - - opname: opcode name (with the 'Op' prefix) - - caps: a sequence of capability names required by this opcode - - operands: a sequence of (operand-kind, operand-quantifier) tuples - """ - assert opname.startswith('Op') - self.opname = opname[2:] # Remove the "Op" prefix. - self.caps_mask = compose_capability_list(caps) - self.operands = [convert_operand_kind(o) for o in operands] - - self.fix_syntax() - - operands = [o[0] for o in operands] - self.ref_type_id = 'IdResultType' in operands - self.def_result_id = 'IdResult' in operands - - def fix_syntax(self): - """Fix an instruction's syntax, adjusting for differences between - the officially released grammar and how SPIRV-Tools uses the grammar. - - Fixes: - - ExtInst should not end with SPV_OPERAND_VARIABLE_ID. - https://github.com/KhronosGroup/SPIRV-Tools/issues/233 - """ - if (self.opname == 'ExtInst' - and self.operands[-1] == 'SPV_OPERAND_TYPE_VARIABLE_ID'): - self.operands.pop() - - def __str__(self): - template = ['{{"{opname}"', 'SpvOp{opname}', '{caps_mask}', - '{num_operands}', '{{{operands}}}', - '{def_result_id}', '{ref_type_id}}}'] - return ', '.join(template).format( - opname=self.opname, - caps_mask=self.caps_mask, - num_operands=len(self.operands), - operands=', '.join(self.operands), - def_result_id=(1 if self.def_result_id else 0), - ref_type_id=(1 if self.ref_type_id else 0)) - - -class ExtInstInitializer(object): - """Instances holds a SPIR-V extended instruction suitable for printing as - the initializer for spv_ext_inst_desc_t.""" - - def __init__(self, opname, opcode, caps, operands): - """Initialization. - - Arguments: - - opname: opcode name - - opcode: enumerant value for this opcode - - caps: a sequence of capability names required by this opcode - - operands: a sequence of (operand-kind, operand-quantifier) tuples - """ - self.opname = opname - self.opcode = opcode - self.caps_mask = compose_capability_list(caps) - self.operands = [convert_operand_kind(o) for o in operands] - self.operands.append('SPV_OPERAND_TYPE_NONE') - - def __str__(self): - template = ['{{"{opname}"', '{opcode}', '{caps_mask}', - '{{{operands}}}}}'] - return ', '.join(template).format( - opname=self.opname, - opcode=self.opcode, - caps_mask=self.caps_mask, - operands=', '.join(self.operands)) - - -def generate_instruction(inst, is_ext_inst): - """Returns the C initializer for the given SPIR-V instruction. - - Arguments: - - inst: a dict containing information about a SPIR-V instruction - - is_ext_inst: a bool indicating whether |inst| is an extended - instruction. - - Returns: - a string containing the C initializer for spv_opcode_desc_t or - spv_ext_inst_desc_t - """ - opname = inst.get('opname') - opcode = inst.get('opcode') - caps = inst.get('capabilities', []) - operands = inst.get('operands', {}) - operands = [(o['kind'], o.get('quantifier', '')) for o in operands] - - assert opname is not None - - if is_ext_inst: - return str(ExtInstInitializer(opname, opcode, caps, operands)) - else: - return str(InstInitializer(opname, caps, operands)) - - -def generate_instruction_table(inst_table, is_ext_inst): - """Returns the info table containing all SPIR-V instructions. - - Arguments: - - inst_table: a dict containing all SPIR-V instructions. - - is_ext_inst: a bool indicating whether |inst_table| is for - an extended instruction set. - """ - return ',\n'.join([generate_instruction(inst, is_ext_inst) - for inst in inst_table]) - - -class EnumerantInitializer(object): - """Prints an enumerant as the initializer for spv_operand_desc_t.""" - - def __init__(self, enumerant, value, caps, exts, parameters): - """Initialization. - - Arguments: - - enumerant: enumerant name - - value: enumerant value - - caps: a sequence of capability names required by this enumerant - - exts: a sequence of names of extensions enabling this enumerant - - parameters: a sequence of (operand-kind, operand-quantifier) tuples - """ - self.enumerant = enumerant - self.value = value - self.caps = compose_capability_list(caps) - self.exts = compose_extension_list(exts) - self.parameters = [convert_operand_kind(p) for p in parameters] - - def __str__(self): - template = ['{{"{enumerant}"', '{value}', - '{caps}', '{exts}', '{{{parameters}}}}}'] - return ', '.join(template).format( - enumerant=self.enumerant, - value=self.value, - caps=self.caps, - exts=self.exts, - parameters=', '.join(self.parameters)) - - -def generate_enum_operand_kind_entry(entry): - """Returns the C initializer for the given operand enum entry. - - Arguments: - - entry: a dict containing information about an enum entry - - Returns: - a string containing the C initializer for spv_operand_desc_t - """ - enumerant = entry.get('enumerant') - value = entry.get('value') - caps = entry.get('capabilities', []) - exts = entry.get('extensions', []) - params = entry.get('parameters', []) - params = [p.get('kind') for p in params] - params = zip(params, [''] * len(params)) - - assert enumerant is not None - assert value is not None - - return str(EnumerantInitializer(enumerant, value, caps, exts, params)) - - -def generate_enum_operand_kind(enum, version): - """Returns the C definition for the given operand kind.""" - kind = enum.get('kind') - assert kind is not None - - name = '{}_{}Entries_{}'.format(PYGEN_VARIABLE_PREFIX, kind, version) - entries = [' {}'.format(generate_enum_operand_kind_entry(e)) - for e in enum.get('enumerants', [])] - - template = ['static const spv_operand_desc_t {name}[] = {{', - '{entries}', '}};'] - entries = '\n'.join(template).format( - name=name, - entries=',\n'.join(entries)) - - return kind, name, entries - - -def generate_operand_kind_table(enums, version): - """Returns the info table containing all SPIR-V operand kinds.""" - # We only need to output info tables for those operand kinds that are enums. - enums = [generate_enum_operand_kind(e, version) - for e in enums - if e.get('category') in ['ValueEnum', 'BitEnum']] - # We have three operand kinds that requires their optional counterpart to - # exist in the operand info table. - three_optional_enums = ['ImageOperands', 'AccessQualifier', 'MemoryAccess'] - three_optional_enums = [e for e in enums if e[0] in three_optional_enums] - enums.extend(three_optional_enums) - - enum_kinds, enum_names, enum_entries = zip(*enums) - # Mark the last three as optional ones. - enum_quantifiers = [''] * (len(enums) - 3) + ['?'] * 3 - # And we don't want redefinition of them. - enum_entries = enum_entries[:-3] - enum_kinds = [convert_operand_kind(e) - for e in zip(enum_kinds, enum_quantifiers)] - table_entries = zip(enum_kinds, enum_names, enum_names) - table_entries = [' {{{}, ARRAY_SIZE({}), {}}}'.format(*e) - for e in table_entries] - - template = [ - 'static const spv_operand_desc_group_t {p}_OperandInfoTable_{v}[] = {{', - '{enums}', '}};'] - table = '\n'.join(template).format( - p=PYGEN_VARIABLE_PREFIX, v=version, enums=',\n'.join(table_entries)) - - return '\n\n'.join(enum_entries + (table,)) - - -def get_extension_list(operands): - """Returns extensions as an alphabetically sorted list of strings.""" - enumerants = sum([item.get('enumerants', []) for item in operands - if item.get('category') in ['ValueEnum']], []) - - extensions = sum([item.get('extensions', []) for item in enumerants - if item.get('extensions')], []) - - extensions.extend(EXTENSIONS_FROM_SPIRV_REGISTRY.split()) - - # Validator would ignore type declaration unique check. Should only be used - # for legacy autogenerated test files containing multiple instances of the - # same type declaration, if fixing the test by other methods is too - # difficult. Shouldn't be used for any other reasons. - extensions.append('SPV_VALIDATOR_ignore_type_decl_unique') - - return sorted(set(extensions)) - - -def get_capabilities(operands): - """Returns capabilities as a list of JSON objects, in order of - appearance. - """ - enumerants = sum([item.get('enumerants', []) for item in operands - if item.get('kind') in ['Capability']], []) - return enumerants - - -def generate_extension_enum(operands): - """Returns enumeration containing extensions declared in the grammar.""" - extensions = get_extension_list(operands) - return ',\n'.join(['k' + extension for extension in extensions]) - - -def generate_extension_to_string_table(operands): - """Returns extension to string mapping table.""" - extensions = get_extension_list(operands) - entry_template = ' {{Extension::k{extension},\n "{extension}"}}' - table_entries = [entry_template.format(extension=extension) - for extension in extensions] - table_template = '{{\n{enums}\n}}' - return table_template.format(enums=',\n'.join(table_entries)) - - -def generate_string_to_extension_table(operands): - """Returns string to extension mapping table.""" - extensions = get_extension_list(operands) - entry_template = ' {{"{extension}",\n Extension::k{extension}}}' - table_entries = [entry_template.format(extension=extension) - for extension in extensions] - table_template = '{{\n{enums}\n}}' - return table_template.format(enums=',\n'.join(table_entries)) - - -def generate_capability_to_string_table(operands): - """Returns capability to string mapping table.""" - capabilities = [item.get('enumerant') - for item in get_capabilities(operands)] - entry_template = ' {{SpvCapability{capability},\n "{capability}"}}' - table_entries = [entry_template.format(capability=capability) - for capability in capabilities] - table_template = '{{\n{enums}\n}}' - return table_template.format(enums=',\n'.join(table_entries)) - - -def generate_extension_to_string_mapping(operands): - """Returns mapping function from extensions to corresponding strings.""" - extensions = get_extension_list(operands) - function = 'std::string ExtensionToString(Extension extension) {\n' - function += ' switch (extension) {\n' - template = ' case Extension::k{extension}:\n' \ - ' return "{extension}";\n' - function += ''.join([template.format(extension=extension) - for extension in extensions]) - function += ' };\n\n return "";\n}' - return function - - -def generate_string_to_extension_mapping(operands): - """Returns mapping function from strings to corresponding extensions.""" - function = 'bool GetExtensionFromString(' \ - 'const std::string& str, Extension* extension) {\n ' \ - 'static const std::unordered_map mapping =\n' - function += generate_string_to_extension_table(operands) - function += ';\n\n' - function += ' const auto it = mapping.find(str);\n\n' \ - ' if (it == mapping.end()) return false;\n\n' \ - ' *extension = it->second;\n return true;\n}' - return function - - -def generate_capability_to_string_mapping(operands): - """Returns mapping function from capabilities to corresponding strings. - We take care to avoid emitting duplicate values. - """ - function = 'std::string CapabilityToString(SpvCapability capability) {\n' - function += ' switch (capability) {\n' - template = ' case SpvCapability{capability}:\n' \ - ' return "{capability}";\n' - emitted = set() # The values of capabilities we already have emitted - for capability in get_capabilities(operands): - value = capability.get('value') - if value not in emitted: - emitted.add(value) - function += template.format(capability=capability.get('enumerant')) - function += ' case SpvCapabilityMax:\n' \ - ' assert(0 && "Attempting to convert SpvCapabilityMax to string");\n' \ - ' return "";\n' - function += ' };\n\n return "";\n}' - return function - - -def generate_all_string_enum_mappings(operands): - """Returns all string-to-enum / enum-to-string mapping tables.""" - tables = [] - tables.append(generate_extension_to_string_mapping(operands)) - tables.append(generate_string_to_extension_mapping(operands)) - tables.append(generate_capability_to_string_mapping(operands)) - return '\n\n'.join(tables) - - -def main(): - import argparse - parser = argparse.ArgumentParser(description='Generate SPIR-V info tables') - - parser.add_argument('--spirv-core-grammar', metavar='', - type=str, required=False, - help='input JSON grammar file for core SPIR-V ' - 'instructions') - parser.add_argument('--extinst-glsl-grammar', metavar='', - type=str, required=False, default=None, - help='input JSON grammar file for GLSL extended ' - 'instruction set') - parser.add_argument('--extinst-opencl-grammar', metavar='', - type=str, required=False, default=None, - help='input JSON grammar file for OpenCL extended ' - 'instruction set') - - parser.add_argument('--core-insts-output', metavar='', - type=str, required=False, default=None, - help='output file for core SPIR-V instructions') - parser.add_argument('--glsl-insts-output', metavar='', - type=str, required=False, default=None, - help='output file for GLSL extended instruction set') - parser.add_argument('--opencl-insts-output', metavar='', - type=str, required=False, default=None, - help='output file for OpenCL extended instruction set') - parser.add_argument('--operand-kinds-output', metavar='', - type=str, required=False, default=None, - help='output file for operand kinds') - parser.add_argument('--extension-enum-output', metavar='', - type=str, required=False, default=None, - help='output file for extension enumeration') - parser.add_argument('--enum-string-mapping-output', metavar='', - type=str, required=False, default=None, - help='output file for enum-string mappings') - parser.add_argument('--extinst-vendor-grammar', metavar='', - type=str, required=False, default=None, - help='input JSON grammar file for vendor extended ' - 'instruction set'), - parser.add_argument('--vendor-insts-output', metavar='', - type=str, required=False, default=None, - help='output file for vendor extended instruction set') - args = parser.parse_args() - - if (args.core_insts_output is None) != \ - (args.operand_kinds_output is None): - print('error: --core-insts-output and --operand_kinds_output ' - 'should be specified together.') - exit(1) - if (args.glsl_insts_output is None) != \ - (args.extinst_glsl_grammar is None): - print('error: --glsl-insts-output and --extinst-glsl-grammar ' - 'should be specified together.') - exit(1) - if (args.opencl_insts_output is None) != \ - (args.extinst_opencl_grammar is None): - print('error: --opencl-insts-output and --extinst-opencl-grammar ' - 'should be specified together.') - exit(1) - if (args.vendor_insts_output is None) != \ - (args.extinst_vendor_grammar is None): - print('error: --vendor-insts-output and ' - '--extinst-vendor-grammar should be specified together.') - exit(1) - if all([args.core_insts_output is None, - args.glsl_insts_output is None, - args.opencl_insts_output is None, - args.vendor_insts_output is None, - args.extension_enum_output is None, - args.enum_string_mapping_output is None]): - print('error: at least one output should be specified.') - exit(1) - - if args.spirv_core_grammar is not None: - with open(args.spirv_core_grammar) as json_file: - grammar = json.loads(json_file.read()) - if args.core_insts_output is not None: - make_path_to_file(args.core_insts_output) - make_path_to_file(args.operand_kinds_output) - print(generate_instruction_table( - grammar['instructions'], False), - file=open(args.core_insts_output, 'w')) - version = '{}_{}'.format(grammar['major_version'], - grammar['minor_version']) - print(generate_operand_kind_table( - grammar['operand_kinds'], version), - file=open(args.operand_kinds_output, 'w')) - if args.extension_enum_output is not None: - make_path_to_file(args.extension_enum_output) - print(generate_extension_enum(grammar['operand_kinds']), - file=open(args.extension_enum_output, 'w')) - if args.enum_string_mapping_output is not None: - make_path_to_file(args.enum_string_mapping_output) - print(generate_all_string_enum_mappings( - grammar['operand_kinds']), - file=open(args.enum_string_mapping_output, 'w')) - - if args.extinst_glsl_grammar is not None: - with open(args.extinst_glsl_grammar) as json_file: - grammar = json.loads(json_file.read()) - make_path_to_file(args.glsl_insts_output) - print(generate_instruction_table(grammar['instructions'], True), - file=open(args.glsl_insts_output, 'w')) - - if args.extinst_opencl_grammar is not None: - with open(args.extinst_opencl_grammar) as json_file: - grammar = json.loads(json_file.read()) - make_path_to_file(args.opencl_insts_output) - print(generate_instruction_table(grammar['instructions'], True), - file=open(args.opencl_insts_output, 'w')) - - if args.extinst_vendor_grammar is not None: - with open(args.extinst_vendor_grammar) as json_file: - grammar = json.loads(json_file.read()) - make_path_to_file(args.vendor_insts_output) - print(generate_instruction_table(grammar['instructions'], True), - file=open(args.vendor_insts_output, 'w')) - - -if __name__ == '__main__': - main() diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/utils/generate_registry_tables.py vulkan-1.1.73+dfsg/external/spirv-tools/utils/generate_registry_tables.py --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/utils/generate_registry_tables.py 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/utils/generate_registry_tables.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2016 Google 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. -"""Generates the vendor tool table from the SPIR-V XML registry.""" - -from __future__ import print_function - -import distutils.dir_util -import os.path -import xml.etree.ElementTree - - -def generate_vendor_table(registry): - """Returns a list of C style initializers for the registered vendors - and their tools. - - Args: - registry: The SPIR-V XMLregistry as an xml.ElementTree - """ - - lines = [] - for ids in registry.iter('ids'): - if 'vendor' == ids.attrib['type']: - for an_id in ids.iter('id'): - value = an_id.attrib['value'] - vendor = an_id.attrib['vendor'] - if 'tool' in an_id.attrib: - tool = an_id.attrib['tool'] - vendor_tool = vendor + ' ' + tool - else: - tool = '' - vendor_tool = vendor - line = '{' + '{}, "{}", "{}", "{}"'.format(value, - vendor, - tool, - vendor_tool) + '},' - lines.append(line) - return '\n'.join(lines) - - -def main(): - import argparse - parser = argparse.ArgumentParser(description= - 'Generate tables from SPIR-V XML registry') - parser.add_argument('--xml', metavar='', - type=str, required=True, - help='SPIR-V XML Registry file') - parser.add_argument('--generator-output', metavar='', - type=str, required=True, - help='output file for SPIR-V generators table') - args = parser.parse_args() - - with open(args.xml) as xml_in: - registry = xml.etree.ElementTree.fromstring(xml_in.read()) - - distutils.dir_util.mkpath(os.path.dirname(args.generator_output)) - print(generate_vendor_table(registry), file=open(args.generator_output, 'w')) - - -if __name__ == '__main__': - main() diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/utils/generate_vim_syntax.py vulkan-1.1.73+dfsg/external/spirv-tools/utils/generate_vim_syntax.py --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/utils/generate_vim_syntax.py 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/utils/generate_vim_syntax.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,192 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2016 Google 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. -"""Generates Vim syntax rules for SPIR-V assembly (.spvasm) files""" - -from __future__ import print_function - -import json - -PREAMBLE="""" Vim syntax file -" Language: spvasm -" Generated by SPIRV-Tools - -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -syn case match -""" - -POSTAMBLE=""" - -syntax keyword spvasmTodo TODO FIXME contained - -syn match spvasmIdNumber /%\d\+\>/ - -" The assembler treats the leading minus sign as part of the number token. -" This applies to integers, and to floats below. -syn match spvasmNumber /-\?\<\d\+\>/ - -" Floating point literals. -" In general, C++ requires at least digit in the mantissa, and the -" floating point is optional. This applies to both the regular decimal float -" case and the hex float case. - -" First case: digits before the optional decimal, no trailing digits. -syn match spvasmFloat /-\?\d\+\.\?\(e[+-]\d\+\)\?/ -" Second case: optional digits before decimal, trailing digits -syn match spvasmFloat /-\?\d*\.\d\+\(e[+-]\d\+\)\?/ - -" First case: hex digits before the optional decimal, no trailing hex digits. -syn match spvasmFloat /-\?0[xX]\\x\+\.\?p[-+]\d\+/ -" Second case: optional hex digits before decimal, trailing hex digits -syn match spvasmFloat /-\?0[xX]\\x*\.\\x\+p[-+]\d\+/ - -syn match spvasmComment /;.*$/ contains=spvasmTodo -syn region spvasmString start=/"/ skip=/\\\\"/ end=/"/ -syn match spvasmId /%[a-zA-Z_][a-zA-Z_0-9]*/ - -" Highlight unknown constants and statements as errors -syn match spvasmError /[a-zA-Z][a-zA-Z_0-9]*/ - - -if version >= 508 || !exists("did_c_syn_inits") - if version < 508 - let did_c_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - HiLink spvasmStatement Statement - HiLink spvasmNumber Number - HiLink spvasmComment Comment - HiLink spvasmString String - HiLink spvasmFloat Float - HiLink spvasmConstant Constant - HiLink spvasmIdNumber Identifier - HiLink spvasmId Identifier - HiLink spvasmTodo Todo - - delcommand HiLink -endif - -let b:current_syntax = "spvasm" -""" - -# This list is taken from the description of OpSpecConstantOp in SPIR-V 1.1. -# TODO(dneto): Propose that this information be embedded in the grammar file. -SPEC_CONSTANT_OP_OPCODES = """ - OpSConvert, OpFConvert - OpSNegate, OpNot - OpIAdd, OpISub - OpIMul, OpUDiv, OpSDiv, OpUMod, OpSRem, OpSMod - OpShiftRightLogical, OpShiftRightArithmetic, OpShiftLeftLogical - OpBitwiseOr, OpBitwiseXor, OpBitwiseAnd - OpVectorShuffle, OpCompositeExtract, OpCompositeInsert - OpLogicalOr, OpLogicalAnd, OpLogicalNot, - OpLogicalEqual, OpLogicalNotEqual - OpSelect - OpIEqual, OpINotEqual - OpULessThan, OpSLessThan - OpUGreaterThan, OpSGreaterThan - OpULessThanEqual, OpSLessThanEqual - OpUGreaterThanEqual, OpSGreaterThanEqual - - OpQuantizeToF16 - - OpConvertFToS, OpConvertSToF - OpConvertFToU, OpConvertUToF - OpUConvert - OpConvertPtrToU, OpConvertUToPtr - OpGenericCastToPtr, OpPtrCastToGeneric - OpBitcast - OpFNegate - OpFAdd, OpFSub - OpFMul, OpFDiv - OpFRem, OpFMod - OpAccessChain, OpInBoundsAccessChain - OpPtrAccessChain, OpInBoundsPtrAccessChain""" - - -def EmitAsStatement(name): - """Emits the given name as a statement token""" - print('syn keyword spvasmStatement', name) - - -def EmitAsEnumerant(name): - """Emits the given name as an named operand token""" - print('syn keyword spvasmConstant', name) - - -def main(): - """Parses arguments, then generates the Vim syntax rules for SPIR-V assembly - on stdout.""" - import argparse - parser = argparse.ArgumentParser(description='Generate SPIR-V info tables') - parser.add_argument('--spirv-core-grammar', metavar='', - type=str, required=True, - help='input JSON grammar file for core SPIR-V ' - 'instructions') - parser.add_argument('--extinst-glsl-grammar', metavar='', - type=str, required=False, default=None, - help='input JSON grammar file for GLSL extended ' - 'instruction set') - parser.add_argument('--extinst-opencl-grammar', metavar='', - type=str, required=False, default=None, - help='input JSON grammar file for OpenGL extended ' - 'instruction set') - args = parser.parse_args() - - # Generate the syntax rules. - print(PREAMBLE) - - core = json.loads(open(args.spirv_core_grammar).read()) - print('\n" Core instructions') - for inst in core["instructions"]: - EmitAsStatement(inst['opname']) - print('\n" Core operand enums') - for operand_kind in core["operand_kinds"]: - if 'enumerants' in operand_kind: - for e in operand_kind['enumerants']: - EmitAsEnumerant(e['enumerant']) - - if args.extinst_glsl_grammar is not None: - print('\n" GLSL.std.450 extended instructions') - glsl = json.loads(open(args.extinst_glsl_grammar).read()) - # These opcodes are really enumerant operands for the OpExtInst - # instruction. - for inst in glsl["instructions"]: - EmitAsEnumerant(inst['opname']) - - if args.extinst_opencl_grammar is not None: - print('\n" OpenCL.std extended instructions') - opencl = json.loads(open(args.extinst_opencl_grammar).read()) - for inst in opencl["instructions"]: - EmitAsEnumerant(inst['opname']) - - print('\n" OpSpecConstantOp opcodes') - for word in SPEC_CONSTANT_OP_OPCODES.split(' '): - stripped = word.strip('\n,') - if stripped != "": - # Treat as an enumerant, but without the leading "Op" - EmitAsEnumerant(stripped[2:]) - print(POSTAMBLE) - - -if __name__ == '__main__': - main() diff -Nru vulkan-1.0.65.2+dfsg1/external/spirv-tools/utils/update_build_version.py vulkan-1.1.73+dfsg/external/spirv-tools/utils/update_build_version.py --- vulkan-1.0.65.2+dfsg1/external/spirv-tools/utils/update_build_version.py 2018-01-10 14:17:09.000000000 +0000 +++ vulkan-1.1.73+dfsg/external/spirv-tools/utils/update_build_version.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,150 +0,0 @@ -#!/usr/bin/env python - -# Copyright (c) 2016 Google 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. - -# Updates an output file with version info unless the new content is the same -# as the existing content. -# -# Args: -# -# The output file will contain a line of text consisting of two C source syntax -# string literals separated by a comma: -# - The software version deduced from the CHANGES file in the given directory. -# - A longer string with the project name, the software version number, and -# git commit information for the directory. The commit information -# is the output of "git describe" if that succeeds, or "git rev-parse HEAD" -# if that succeeds, or otherwise a message containing the phrase -# "unknown hash". -# The string contents are escaped as necessary. - -from __future__ import print_function - -import datetime -import errno -import os -import os.path -import re -import subprocess -import sys -import time - - -def mkdir_p(directory): - """Make the directory, and all its ancestors as required. Any of the - directories are allowed to already exist.""" - - if directory == "": - # We're being asked to make the current directory. - return - - try: - os.makedirs(directory) - except OSError as e: - if e.errno == errno.EEXIST and os.path.isdir(directory): - pass - else: - raise - - -def command_output(cmd, directory): - """Runs a command in a directory and returns its standard output stream. - - Captures the standard error stream. - - Raises a RuntimeError if the command fails to launch or otherwise fails. - """ - p = subprocess.Popen(cmd, - cwd=directory, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - (stdout, _) = p.communicate() - if p.returncode != 0: - raise RuntimeError('Failed to run %s in %s' % (cmd, directory)) - return stdout - - -def deduce_software_version(directory): - """Returns a software version number parsed from the CHANGES file - in the given directory. - - The CHANGES file describes most recent versions first. - """ - - # Match the first well-formed version-and-date line. - # Allow trailing whitespace in the checked-out source code has - # unexpected carriage returns on a linefeed-only system such as - # Linux. - pattern = re.compile(r'^(v\d+\.\d+(-dev)?) \d\d\d\d-\d\d-\d\d\s*$') - changes_file = os.path.join(directory, 'CHANGES') - with open(changes_file, mode='rU') as f: - for line in f.readlines(): - match = pattern.match(line) - if match: - return match.group(1) - raise Exception('No version number found in {}'.format(changes_file)) - - -def describe(directory): - """Returns a string describing the current Git HEAD version as descriptively - as possible. - - Runs 'git describe', or alternately 'git rev-parse HEAD', in directory. If - successful, returns the output; otherwise returns 'unknown hash, '.""" - try: - # decode() is needed here for Python3 compatibility. In Python2, - # str and bytes are the same type, but not in Python3. - # Popen.communicate() returns a bytes instance, which needs to be - # decoded into text data first in Python3. And this decode() won't - # hurt Python2. - return command_output(['git', 'describe'], directory).rstrip().decode() - except: - try: - return command_output( - ['git', 'rev-parse', 'HEAD'], directory).rstrip().decode() - except: - # This is the fallback case where git gives us no information, - # e.g. because the source tree might not be in a git tree. - # In this case, usually use a timestamp. However, to ensure - # reproducible builds, allow the builder to override the wall - # clock time with enviornment variable SOURCE_DATE_EPOCH - # containing a (presumably) fixed timestamp. - timestamp = int(os.environ.get('SOURCE_DATE_EPOCH', time.time())) - formatted = datetime.date.fromtimestamp(timestamp).isoformat() - return 'unknown hash, {}'.format(formatted) - - -def main(): - if len(sys.argv) != 3: - print('usage: {} '.format(sys.argv[0])) - sys.exit(1) - - output_file = sys.argv[2] - mkdir_p(os.path.dirname(output_file)) - - software_version = deduce_software_version(sys.argv[1]) - new_content = '"{}", "SPIRV-Tools {} {}"\n'.format( - software_version, software_version, - describe(sys.argv[1]).replace('"', '\\"')) - - if os.path.isfile(output_file): - with open(output_file, 'r') as f: - if new_content == f.read(): - return - - with open(output_file, 'w') as f: - f.write(new_content) - -if __name__ == '__main__': - main() diff -Nru vulkan-1.0.65.2+dfsg1/external_revisions/glslang_revision vulkan-1.1.73+dfsg/external_revisions/glslang_revision --- vulkan-1.0.65.2+dfsg1/external_revisions/glslang_revision 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/external_revisions/glslang_revision 2018-04-27 11:24:19.000000000 +0000 @@ -1 +1 @@ -715c353a15836e5ae192a64a4cf54e2ce7e8d66a +3bb4c48cd95892a5cfcd63df20fcc47fd51c97a0 diff -Nru vulkan-1.0.65.2+dfsg1/external_revisions/spirv-headers_giturl vulkan-1.1.73+dfsg/external_revisions/spirv-headers_giturl --- vulkan-1.0.65.2+dfsg1/external_revisions/spirv-headers_giturl 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/external_revisions/spirv-headers_giturl 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -https://github.com/KhronosGroup/SPIRV-Headers.git diff -Nru vulkan-1.0.65.2+dfsg1/external_revisions/spirv-headers_revision vulkan-1.1.73+dfsg/external_revisions/spirv-headers_revision --- vulkan-1.0.65.2+dfsg1/external_revisions/spirv-headers_revision 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/external_revisions/spirv-headers_revision 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -061097878467b8e040fbf153a837d844ef9f9f96 diff -Nru vulkan-1.0.65.2+dfsg1/external_revisions/spirv-tools_giturl vulkan-1.1.73+dfsg/external_revisions/spirv-tools_giturl --- vulkan-1.0.65.2+dfsg1/external_revisions/spirv-tools_giturl 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/external_revisions/spirv-tools_giturl 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -https://github.com/KhronosGroup/SPIRV-Tools.git diff -Nru vulkan-1.0.65.2+dfsg1/external_revisions/spirv-tools_revision vulkan-1.1.73+dfsg/external_revisions/spirv-tools_revision --- vulkan-1.0.65.2+dfsg1/external_revisions/spirv-tools_revision 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/external_revisions/spirv-tools_revision 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -5834719fc17d4735fce0102738b87b70255cfd5f diff -Nru vulkan-1.0.65.2+dfsg1/.gitattributes vulkan-1.1.73+dfsg/.gitattributes --- vulkan-1.0.65.2+dfsg1/.gitattributes 2018-01-10 14:15:30.000000000 +0000 +++ vulkan-1.1.73+dfsg/.gitattributes 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -# See https://git-scm.com/docs/gitattributes -# See https://help.github.com/articles/dealing-with-line-endings/ - -# default behavior, if core.autocrlf is unset. -* text=auto - -# files to be converted to native line endings on checkout. -*.cpp text -*.h text - -# files to always have CRLF line endings on checkout. -*.bat text eol=crlf - -# files to always have CR line endings on checkout. -*.sh text eol=cr - diff -Nru vulkan-1.0.65.2+dfsg1/GOVERNANCE.md vulkan-1.1.73+dfsg/GOVERNANCE.md --- vulkan-1.0.65.2+dfsg1/GOVERNANCE.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/GOVERNANCE.md 2018-03-14 09:08:48.000000000 +0000 @@ -0,0 +1,53 @@ +## Vulkan Loader and Validation Layers Repository Management + +# **Open Source Project – Objectives** + +* Alignment with the Vulkan Specification + - The goal is for validation layer behavior to enforce the vulkan specification on applications. Questions on specification +interpretations may require consulting with the Khronos Vulkan Workgroup for resolution + - [Core Specification](https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html) + - [Header Files](https://www.khronos.org/registry/vulkan/#headers) + - [SDK Resources](https://vulkan.lunarg.com) +* ISV Enablement + - Updates of loader and validation layer functionality should be available in a timely fashion + - Every effort will be made to be responsive to ISV issues with validation layers +* Cross Platform Compatibility + - Google and LunarG collaboration: + - Google: Monitor for Android + - LunarG: Monitor for desktop (Windows and Linux) + - Continuous Integration: HW test farms operated by Google and LunarG monitor various hardware/software platforms +* Repo Quality + - Repo remains in healthy state with all tests passing and good-quality, consistent codebase + - Continuous Integration: Along with Github, HW test farms operated by Google and LunarG perform pre-commit cloud testing +on pull-requests + +# **Roles and Definitions** +* Contributor, Commenter, User + - Submitting contributions, creating issues, or using the contents of the repository +* Approver + - Experienced project members who have made significant technical contributions + - Write control: Approve pull/merge requests (verify submissions vs. acceptance criteria) +* Technical Project Leads + - Lead the project in terms of versioning, quality assurance, and overarching objectives + - Monitor github issues and drive timely resolution + - Designate new approvers + - Ensure project information such as the Readme, Contributing docs, wiki, etc., kept up-to-date + - Act as a facilitator in resolving technical conflicts + - Is a point-of-contact for project-related questions + +The technical project leads for this repository are: +* **Mark Lobodzinski** [mark@lunarg.com](mailto:mark@lunarg.com) +* **Tobin Ehlis** [tobine@google.com](mailto:tobine@google.com) + +# **Acceptance Criteria and Process** + - All source code to include Khronos copyright and license (Apache 2.0). + - Additional copyrights of contributors appended + - Contributions are via pull requests + - Project leads will assigning approvers to contributor pull requests + - Approvers can self-assign their reviewers + - For complex or invasive contributions, Project Leads may request approval from specific reviewers + - At least one review approval is required to complete a pull request + - The goal is to be responsive to contributors while ensuring acceptance criteria is met and to facilitate their submissions + - Approval is dependent upon adherence to the guidelines in [CONTRIBUTING.md](CONTRIBUTING.md), and alignment with +repository goals of maintainability, completeness, and quality + - Conflicts or questions will ultimately be resolved by the project leads diff -Nru vulkan-1.0.65.2+dfsg1/icd/CMakeLists.txt vulkan-1.1.73+dfsg/icd/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/icd/CMakeLists.txt 2018-01-10 14:17:11.000000000 +0000 +++ vulkan-1.1.73+dfsg/icd/CMakeLists.txt 2018-04-27 11:24:19.000000000 +0000 @@ -21,6 +21,8 @@ add_definitions(-DVK_USE_PLATFORM_MIR_KHR -DVK_USE_PLATFORM_MIR_KHX) include_directories(${MIR_INCLUDE_DIR}) endif() +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + add_definitions(-DVK_USE_PLATFORM_MACOS_MVK) else() message(FATAL_ERROR "Unsupported Platform!") endif() @@ -31,16 +33,17 @@ if (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)) if (CMAKE_GENERATOR MATCHES "^Visual Studio.*") foreach (config_file ${ICD_JSON_FILES}) - FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${config_file}.json src_json) + FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/windows/${config_file}.json src_json) FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/$/${config_file}.json dst_json) add_custom_target(${config_file}-json ALL COMMAND copy ${src_json} ${dst_json} VERBATIM ) + set_target_properties(${config_file}-json PROPERTIES FOLDER ${LVL_TARGET_FOLDER}) endforeach(config_file) else() foreach (config_file ${ICD_JSON_FILES}) - FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${config_file}.json src_json) + FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/windows/${config_file}.json src_json) FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/${config_file}.json dst_json) add_custom_target(${config_file}-json ALL COMMAND copy ${src_json} ${dst_json} @@ -49,26 +52,50 @@ endforeach(config_file) endif() endif() +elseif(APPLE) + # extra setup for out-of-tree builds + if (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)) + if (CMAKE_GENERATOR MATCHES "^Xcode.*") + add_custom_target(mk_icd_config_dir ALL COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/$) + foreach (config_file ${ICD_JSON_FILES}) + add_custom_target(${config_file}-json ALL + DEPENDS mk_icd_config_dir + COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/macos/${config_file}.json $ + VERBATIM + ) + endforeach(config_file) + else() + foreach (config_file ${ICD_JSON_FILES}) + add_custom_target(${config_file}-json ALL + COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/macos/${config_file}.json + VERBATIM + ) + endforeach(config_file) + endif() + endif() else() # extra setup for out-of-tree builds if (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)) foreach (config_file ${ICD_JSON_FILES}) add_custom_target(${config_file}-json ALL - COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/${config_file}.json + COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/linux/${config_file}.json VERBATIM ) endforeach(config_file) endif() endif() # For ICD with a direct dependency on a project with the same name, use it. -foreach (config_file ${ICD_JSON_FILES}) - add_dependencies(${config_file}-json ${config_file}) -endforeach(config_file) +if (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)) + foreach (config_file ${ICD_JSON_FILES}) + add_dependencies(${config_file}-json ${config_file}) + endforeach(config_file) +endif() add_custom_target(generate_icd_files DEPENDS mock_icd.h mock_icd.cpp ) +set_target_properties(generate_icd_files PROPERTIES FOLDER ${LVL_TARGET_FOLDER}) if (WIN32) macro(add_vk_icd target) @@ -77,11 +104,20 @@ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DEF_FILE} VkICD_${target}.def VERBATIM ) + set_target_properties(copy-${target}-def-file PROPERTIES FOLDER ${LVL_TARGET_FOLDER}) add_library(VkICD_${target} SHARED ${ARGN} VkICD_${target}.def) add_dependencies(VkICD_${target} generate_icd_files) #target_link_Libraries(VkICD_${target} VkICD_utils) #add_dependencies(VkICD_${target} generate_helper_files VkICD_utils) endmacro() +elseif(APPLE) + macro(add_vk_icd target) + add_library(VkICD_${target} SHARED ${ARGN}) + #target_link_Libraries(VkICD_${target} VkICD_utils) + add_dependencies(VkICD_${target} generate_icd_files) + set_target_properties(VkICD_${target} PROPERTIES LINK_FLAGS "-Wl") + install(TARGETS VkICD_${target} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + endmacro() else() macro(add_vk_icd target) add_library(VkICD_${target} SHARED ${ARGN}) @@ -99,7 +135,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../loader ${CMAKE_CURRENT_SOURCE_DIR}/../include/vulkan ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_PROJECT_BINARY_DIR} + ${PROJECT_BINARY_DIR} ${CMAKE_BINARY_DIR} ) @@ -118,39 +154,8 @@ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith -Wno-unused-function -Wno-sign-compare") endif() -if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "mips64") - if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") - set_source_files_properties(mock_icd.cpp PROPERTIES COMPILE_FLAGS -mxgot) - endif() -endif() - run_vk_xml_generate(mock_icd_generator.py mock_icd.h) run_vk_xml_generate(mock_icd_generator.py mock_icd.cpp) -# Layer Utils Library -# For Windows, we use a static lib because the Windows loader has a fairly restrictive loader search -# path that can't be easily modified to point it to the same directory that contains the layers. -#if (WIN32) -# add_library(VkLayer_utils STATIC vk_layer_config.cpp vk_layer_extension_utils.cpp vk_layer_utils.cpp vk_format_utils.cpp) -#else() -# add_library(VkLayer_utils SHARED vk_layer_config.cpp vk_layer_extension_utils.cpp vk_layer_utils.cpp vk_format_utils.cpp) -# if(INSTALL_LVL_FILES) -# install(TARGETS VkLayer_utils DESTINATION ${CMAKE_INSTALL_LIBDIR}) -# endif() -#endif() -#add_dependencies(VkLayer_utils generate_helper_files) - -#add_vk_layer(core_validation core_validation.cpp vk_layer_table.cpp descriptor_sets.cpp buffer_validation.cpp shader_validation.cpp) -#add_vk_layer(object_tracker object_tracker.cpp object_tracker_utils.cpp vk_layer_table.cpp) -# generated -#add_vk_layer(threading threading.cpp thread_check.h vk_layer_table.cpp) -#add_vk_layer(unique_objects unique_objects.cpp unique_objects_wrappers.h vk_layer_table.cpp) -#add_vk_layer(parameter_validation parameter_validation.cpp parameter_validation_utils.cpp parameter_validation.h vk_layer_table.cpp vk_validation_error_messages.h) -#add_vk_layer(mock_layer mock_layer.cpp mock_layer.h vk_layer_table.cpp) - add_vk_icd(mock_icd mock_icd.cpp mock_icd.h) -# Core validation has additional dependencies -#target_include_directories(VkLayer_core_validation PRIVATE ${GLSLANG_SPIRV_INCLUDE_DIR}) -#target_include_directories(VkLayer_core_validation PRIVATE ${SPIRV_TOOLS_INCLUDE_DIR}) -#target_link_libraries(VkLayer_core_validation ${SPIRV_TOOLS_LIBRARIES}) diff -Nru vulkan-1.0.65.2+dfsg1/icd/linux/VkICD_mock_icd.json vulkan-1.1.73+dfsg/icd/linux/VkICD_mock_icd.json --- vulkan-1.0.65.2+dfsg1/icd/linux/VkICD_mock_icd.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/icd/linux/VkICD_mock_icd.json 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,12 @@ +{ + "file_format_version" : "1.0.1", + "ICD": { + "library_path": "./libVkICD_mock_icd.so", + "api_version": "1.1.73" + } +} + + + + + diff -Nru vulkan-1.0.65.2+dfsg1/icd/macos/VkICD_mock_icd.json vulkan-1.1.73+dfsg/icd/macos/VkICD_mock_icd.json --- vulkan-1.0.65.2+dfsg1/icd/macos/VkICD_mock_icd.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/icd/macos/VkICD_mock_icd.json 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,8 @@ +{ + "file_format_version" : "1.0.1", + "ICD": { + "library_path": "./libVkICD_mock_icd.dylib", + "api_version": "1.1.71" + } +} + diff -Nru vulkan-1.0.65.2+dfsg1/icd/README.md vulkan-1.1.73+dfsg/icd/README.md --- vulkan-1.0.65.2+dfsg1/icd/README.md 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/icd/README.md 2018-03-14 09:08:48.000000000 +0000 @@ -33,17 +33,17 @@ The initial mock ICD is just the null driver which can be used in combination with DevSim to test validation layers on simulated devices. Here's a rough sequence of tasks planned for the mock driver going forward: -- Get all LVL tests passing on the bare null driver - - Get failing tests passing - - Get skipped tests passing as able -- Get all LVL tests to run without unexpected errors -- Develop automated test flow using mock ICD (alternative to or replacement for run\_all\_tests.sh) -- Get all LVL tests to pass on a selection of device profiles using DevSim layer -- Update LVL tests with device dependencies to target specific device profiles -- Add entrypoint tracking & verification - - Initially track expected calls - - Update some tests to verify expected capability - - Expand tracking to include parameters +- [X] Get all LVL tests passing on the bare null driver +- [X] Get failing tests passing +- [X] Get skipped tests passing as able +- [ ] Get all LVL tests to run without unexpected errors +- [X] Develop automated test flow using mock ICD (alternative to or replacement for run\_all\_tests.sh) +- [X] Get all LVL tests to pass on a selection of device profiles using DevSim layer +- [ ] Update LVL tests with device dependencies to target specific device profiles +- [ ] Add entrypoint tracking & verification +- [ ] Initially track expected calls +- [ ] Update some tests to verify expected capability +- [ ] Expand tracking to include parameters ## Beyond Validation Layer Testing @@ -69,27 +69,19 @@ ### Passing Tests With Unexpected Errors -VkLayerTest.InvalidCmdBufferBufferDestroyed -VkLayerTest.RenderPassInUseDestroyedSignaled -VkLayerTest.InvalidCmdBufferDescriptorSetBufferDestroyed -VkLayerTest.InvalidDynamicOffsetCases -VkLayerTest.DSUsageBitsErrors -VkLayerTest.DSBufferInfoErrors -VkLayerTest.DSBufferLimitErrors -VkLayerTest.RenderPassIncompatible +- VkLayerTest.RenderPassInUseDestroyedSignaled +- VkLayerTest.RenderPassIncompatible ### Skipped Tests -VkLayerTest.BindImageInvalidMemoryType -VkLayerTest.CreatePipelineBadVertexAttributeFormat -VkLayerTest.MiscBlitImageTests -VkLayerTest.TemporaryExternalSemaphore -VkLayerTest.TemporaryExternalFence -VkLayerTest.PSOViewportScissorCountTests -VkLayerTest.InvalidBarriers -VkLayerTest.CommandQueueFlags -VkPositiveLayerTest.TwoQueuesEnsureCorrectRetirementWithWorkStolen -VkPositiveLayerTest.ExternalSemaphore -VkPositiveLayerTest.ExternalFence - - +- VkLayerTest.BindImageInvalidMemoryType +- VkLayerTest.CreatePipelineBadVertexAttributeFormat +- VkLayerTest.MiscBlitImageTests +- VkLayerTest.TemporaryExternalSemaphore +- VkLayerTest.TemporaryExternalFence +- VkLayerTest.InvalidBarriers +- VkLayerTest.CommandQueueFlags +- VkPositiveLayerTest.TwoQueuesEnsureCorrectRetirementWithWorkStolen +- VkPositiveLayerTest.ExternalSemaphore +- VkPositiveLayerTest.ExternalFence +- VkPositiveLayerTest.ExternalMemory diff -Nru vulkan-1.0.65.2+dfsg1/icd/VkICD_mock_icd.json vulkan-1.1.73+dfsg/icd/VkICD_mock_icd.json --- vulkan-1.0.65.2+dfsg1/icd/VkICD_mock_icd.json 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/icd/VkICD_mock_icd.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -{ - "file_format_version" : "1.0.1", - "ICD": { - "library_path": "./libVkICD_mock_icd.so", - "api_version": "1.0.63" - } -} - - - - - diff -Nru vulkan-1.0.65.2+dfsg1/icd/windows/VkICD_mock_icd.json vulkan-1.1.73+dfsg/icd/windows/VkICD_mock_icd.json --- vulkan-1.0.65.2+dfsg1/icd/windows/VkICD_mock_icd.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/icd/windows/VkICD_mock_icd.json 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,12 @@ +{ + "file_format_version" : "1.0.1", + "ICD": { + "library_path": ".\\VkICD_mock_icd.dll", + "api_version": "1.1.73" + } +} + + + + + diff -Nru vulkan-1.0.65.2+dfsg1/include/vulkan/vk_icd.h vulkan-1.1.73+dfsg/include/vulkan/vk_icd.h --- vulkan-1.0.65.2+dfsg1/include/vulkan/vk_icd.h 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/include/vulkan/vk_icd.h 2018-04-27 11:24:19.000000000 +0000 @@ -44,12 +44,12 @@ #define CURRENT_LOADER_ICD_INTERFACE_VERSION 5 #define MIN_SUPPORTED_LOADER_ICD_INTERFACE_VERSION 0 #define MIN_PHYS_DEV_EXTENSION_ICD_INTERFACE_VERSION 4 -typedef VkResult (VKAPI_PTR *PFN_vkNegotiateLoaderICDInterfaceVersion)(uint32_t *pVersion); +typedef VkResult(VKAPI_PTR *PFN_vkNegotiateLoaderICDInterfaceVersion)(uint32_t *pVersion); // This is defined in vk_layer.h which will be found by the loader, but if an ICD is building against this // file directly, it won't be found. #ifndef PFN_GetPhysicalDeviceProcAddr -typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char* pName); +typedef PFN_vkVoidFunction(VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char *pName); #endif /* @@ -85,6 +85,9 @@ VK_ICD_WSI_PLATFORM_WIN32, VK_ICD_WSI_PLATFORM_XCB, VK_ICD_WSI_PLATFORM_XLIB, + VK_ICD_WSI_PLATFORM_ANDROID, + VK_ICD_WSI_PLATFORM_MACOS, + VK_ICD_WSI_PLATFORM_IOS, VK_ICD_WSI_PLATFORM_DISPLAY } VkIcdWsiPlatform; @@ -98,7 +101,7 @@ MirConnection *connection; MirSurface *mirSurface; } VkIcdSurfaceMir; -#endif // VK_USE_PLATFORM_MIR_KHR +#endif // VK_USE_PLATFORM_MIR_KHR #ifdef VK_USE_PLATFORM_WAYLAND_KHR typedef struct { @@ -106,7 +109,7 @@ struct wl_display *display; struct wl_surface *surface; } VkIcdSurfaceWayland; -#endif // VK_USE_PLATFORM_WAYLAND_KHR +#endif // VK_USE_PLATFORM_WAYLAND_KHR #ifdef VK_USE_PLATFORM_WIN32_KHR typedef struct { @@ -114,7 +117,7 @@ HINSTANCE hinstance; HWND hwnd; } VkIcdSurfaceWin32; -#endif // VK_USE_PLATFORM_WIN32_KHR +#endif // VK_USE_PLATFORM_WIN32_KHR #ifdef VK_USE_PLATFORM_XCB_KHR typedef struct { @@ -122,7 +125,7 @@ xcb_connection_t *connection; xcb_window_t window; } VkIcdSurfaceXcb; -#endif // VK_USE_PLATFORM_XCB_KHR +#endif // VK_USE_PLATFORM_XCB_KHR #ifdef VK_USE_PLATFORM_XLIB_KHR typedef struct { @@ -130,13 +133,28 @@ Display *dpy; Window window; } VkIcdSurfaceXlib; -#endif // VK_USE_PLATFORM_XLIB_KHR +#endif // VK_USE_PLATFORM_XLIB_KHR #ifdef VK_USE_PLATFORM_ANDROID_KHR typedef struct { - ANativeWindow* window; + VkIcdSurfaceBase base; + ANativeWindow *window; } VkIcdSurfaceAndroid; -#endif //VK_USE_PLATFORM_ANDROID_KHR +#endif // VK_USE_PLATFORM_ANDROID_KHR + +#ifdef VK_USE_PLATFORM_MACOS_MVK +typedef struct { + VkIcdSurfaceBase base; + const void *pView; +} VkIcdSurfaceMacOS; +#endif // VK_USE_PLATFORM_MACOS_MVK + +#ifdef VK_USE_PLATFORM_IOS_MVK +typedef struct { + VkIcdSurfaceBase base; + const void *pView; +} VkIcdSurfaceIOS; +#endif // VK_USE_PLATFORM_IOS_MVK typedef struct { VkIcdSurfaceBase base; @@ -149,4 +167,4 @@ VkExtent2D imageExtent; } VkIcdSurfaceDisplay; -#endif // VKICD_H +#endif // VKICD_H diff -Nru vulkan-1.0.65.2+dfsg1/include/vulkan/vk_layer.h vulkan-1.1.73+dfsg/include/vulkan/vk_layer.h --- vulkan-1.0.65.2+dfsg1/include/vulkan/vk_layer.h 2017-07-03 14:21:22.000000000 +0000 +++ vulkan-1.1.73+dfsg/include/vulkan/vk_layer.h 2018-03-14 09:08:48.000000000 +0000 @@ -48,6 +48,8 @@ #define CURRENT_LOADER_LAYER_INTERFACE_VERSION 2 #define MIN_SUPPORTED_LOADER_LAYER_INTERFACE_VERSION 1 +#define VK_CURRENT_CHAIN_VERSION 1 + // Version negotiation values typedef enum VkNegotiateLayerStructType { LAYER_NEGOTIATE_UNINTIALIZED = 0, @@ -138,6 +140,56 @@ VKAPI_ATTR VkResult VKAPI_CALL vkNegotiateLoaderLayerInterfaceVersion(VkNegotiateLayerInterface *pVersionStruct); +typedef enum VkChainType { + VK_CHAIN_TYPE_UNKNOWN = 0, + VK_CHAIN_TYPE_ENUMERATE_INSTANCE_EXTENSION_PROPERTIES = 1, + VK_CHAIN_TYPE_ENUMERATE_INSTANCE_LAYER_PROPERTIES = 2, + VK_CHAIN_TYPE_ENUMERATE_INSTANCE_VERSION = 3, +} VkChainType; + +typedef struct VkChainHeader { + VkChainType type; + uint32_t version; + uint32_t size; +} VkChainHeader; + +typedef struct VkEnumerateInstanceExtensionPropertiesChain { + VkChainHeader header; + VkResult(VKAPI_PTR *pfnNextLayer)(const struct VkEnumerateInstanceExtensionPropertiesChain *, const char *, uint32_t *, + VkExtensionProperties *); + const struct VkEnumerateInstanceExtensionPropertiesChain *pNextLink; + +#if defined(__cplusplus) + inline VkResult CallDown(const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties) const { + return pfnNextLayer(pNextLink, pLayerName, pPropertyCount, pProperties); + } +#endif +} VkEnumerateInstanceExtensionPropertiesChain; + +typedef struct VkEnumerateInstanceLayerPropertiesChain { + VkChainHeader header; + VkResult(VKAPI_PTR *pfnNextLayer)(const struct VkEnumerateInstanceLayerPropertiesChain *, uint32_t *, VkLayerProperties *); + const struct VkEnumerateInstanceLayerPropertiesChain *pNextLink; + +#if defined(__cplusplus) + inline VkResult CallDown(uint32_t *pPropertyCount, VkLayerProperties *pProperties) const { + return pfnNextLayer(pNextLink, pPropertyCount, pProperties); + } +#endif +} VkEnumerateInstanceLayerPropertiesChain; + +typedef struct VkEnumerateInstanceVersionChain { + VkChainHeader header; + VkResult(VKAPI_PTR *pfnNextLayer)(const struct VkEnumerateInstanceVersionChain *, uint32_t *); + const struct VkEnumerateInstanceVersionChain *pNextLink; + +#if defined(__cplusplus) + inline VkResult CallDown(uint32_t *pApiVersion) const { + return pfnNextLayer(pNextLink, pApiVersion); + } +#endif +} VkEnumerateInstanceVersionChain; + #ifdef __cplusplus } #endif diff -Nru vulkan-1.0.65.2+dfsg1/include/vulkan/vk_platform.h vulkan-1.1.73+dfsg/include/vulkan/vk_platform.h --- vulkan-1.0.65.2+dfsg1/include/vulkan/vk_platform.h 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/include/vulkan/vk_platform.h 2018-03-14 09:08:48.000000000 +0000 @@ -89,32 +89,4 @@ } // extern "C" #endif // __cplusplus -// Platform-specific headers required by platform window system extensions. -// These are enabled prior to #including "vulkan.h". The same enable then -// controls inclusion of the extension interfaces in vulkan.h. - -#ifdef VK_USE_PLATFORM_ANDROID_KHR -#include -#endif - -#ifdef VK_USE_PLATFORM_MIR_KHR -#include -#endif - -#ifdef VK_USE_PLATFORM_WAYLAND_KHR -#include -#endif - -#ifdef VK_USE_PLATFORM_WIN32_KHR -#include -#endif - -#ifdef VK_USE_PLATFORM_XLIB_KHR -#include -#endif - -#ifdef VK_USE_PLATFORM_XCB_KHR -#include -#endif - #endif diff -Nru vulkan-1.0.65.2+dfsg1/include/vulkan/vk_sdk_platform.h vulkan-1.1.73+dfsg/include/vulkan/vk_sdk_platform.h --- vulkan-1.0.65.2+dfsg1/include/vulkan/vk_sdk_platform.h 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/include/vulkan/vk_sdk_platform.h 2018-03-14 09:08:48.000000000 +0000 @@ -43,4 +43,27 @@ #endif // _WIN32 -#endif // VK_SDK_PLATFORM_H +// Check for noexcept support using clang, with fallback to Windows or GCC version numbers +#ifndef NOEXCEPT +#if defined(__clang__) +#if __has_feature(cxx_noexcept) +#define HAS_NOEXCEPT +#endif +#else +#if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ * 10 + __GNUC_MINOR__ >= 46 +#define HAS_NOEXCEPT +#else +#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026 && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS +#define HAS_NOEXCEPT +#endif +#endif +#endif + +#ifdef HAS_NOEXCEPT +#define NOEXCEPT noexcept +#else +#define NOEXCEPT +#endif +#endif + +#endif // VK_SDK_PLATFORM_H diff -Nru vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_android.h vulkan-1.1.73+dfsg/include/vulkan/vulkan_android.h --- vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_android.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/include/vulkan/vulkan_android.h 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,126 @@ +#ifndef VULKAN_ANDROID_H_ +#define VULKAN_ANDROID_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_KHR_android_surface 1 +struct ANativeWindow; + +#define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6 +#define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface" + +typedef VkFlags VkAndroidSurfaceCreateFlagsKHR; + +typedef struct VkAndroidSurfaceCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkAndroidSurfaceCreateFlagsKHR flags; + struct ANativeWindow* window; +} VkAndroidSurfaceCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR( + VkInstance instance, + const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); +#endif + +#define VK_ANDROID_external_memory_android_hardware_buffer 1 +struct AHardwareBuffer; + +#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 3 +#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME "VK_ANDROID_external_memory_android_hardware_buffer" + +typedef struct VkAndroidHardwareBufferUsageANDROID { + VkStructureType sType; + void* pNext; + uint64_t androidHardwareBufferUsage; +} VkAndroidHardwareBufferUsageANDROID; + +typedef struct VkAndroidHardwareBufferPropertiesANDROID { + VkStructureType sType; + void* pNext; + VkDeviceSize allocationSize; + uint32_t memoryTypeBits; +} VkAndroidHardwareBufferPropertiesANDROID; + +typedef struct VkAndroidHardwareBufferFormatPropertiesANDROID { + VkStructureType sType; + void* pNext; + VkFormat format; + uint64_t externalFormat; + VkFormatFeatureFlags formatFeatures; + VkComponentMapping samplerYcbcrConversionComponents; + VkSamplerYcbcrModelConversion suggestedYcbcrModel; + VkSamplerYcbcrRange suggestedYcbcrRange; + VkChromaLocation suggestedXChromaOffset; + VkChromaLocation suggestedYChromaOffset; +} VkAndroidHardwareBufferFormatPropertiesANDROID; + +typedef struct VkImportAndroidHardwareBufferInfoANDROID { + VkStructureType sType; + const void* pNext; + struct AHardwareBuffer* buffer; +} VkImportAndroidHardwareBufferInfoANDROID; + +typedef struct VkMemoryGetAndroidHardwareBufferInfoANDROID { + VkStructureType sType; + const void* pNext; + VkDeviceMemory memory; +} VkMemoryGetAndroidHardwareBufferInfoANDROID; + +typedef struct VkExternalFormatANDROID { + VkStructureType sType; + void* pNext; + uint64_t externalFormat; +} VkExternalFormatANDROID; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetAndroidHardwareBufferPropertiesANDROID( + VkDevice device, + const struct AHardwareBuffer* buffer, + VkAndroidHardwareBufferPropertiesANDROID* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID( + VkDevice device, + const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, + struct AHardwareBuffer** pBuffer); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_core.h vulkan-1.1.73+dfsg/include/vulkan/vulkan_core.h --- vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_core.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/include/vulkan/vulkan_core.h 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,7470 @@ +#ifndef VULKAN_CORE_H_ +#define VULKAN_CORE_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_VERSION_1_0 1 +#include "vk_platform.h" + +#define VK_MAKE_VERSION(major, minor, patch) \ + (((major) << 22) | ((minor) << 12) | (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 + +// Vulkan 1.0 version number +#define VK_API_VERSION_1_0 VK_MAKE_VERSION(1, 0, 0)// Patch version should always be set to 0 + +#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22) +#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) +#define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) +// Version of this file +#define VK_HEADER_VERSION 73 + + +#define VK_NULL_HANDLE 0 + + + +#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; + + +#if !defined(VK_DEFINE_NON_DISPATCHABLE_HANDLE) +#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) + #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object; +#else + #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; +#endif +#endif + + + +typedef uint32_t VkFlags; +typedef uint32_t VkBool32; +typedef uint64_t VkDeviceSize; +typedef uint32_t VkSampleMask; + +VK_DEFINE_HANDLE(VkInstance) +VK_DEFINE_HANDLE(VkPhysicalDevice) +VK_DEFINE_HANDLE(VkDevice) +VK_DEFINE_HANDLE(VkQueue) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphore) +VK_DEFINE_HANDLE(VkCommandBuffer) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFence) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeviceMemory) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBuffer) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkEvent) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkQueryPool) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferView) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImageView) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderModule) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineCache) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineLayout) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkRenderPass) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipeline) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSampler) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFramebuffer) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool) + +#define VK_LOD_CLAMP_NONE 1000.0f +#define VK_REMAINING_MIP_LEVELS (~0U) +#define VK_REMAINING_ARRAY_LAYERS (~0U) +#define VK_WHOLE_SIZE (~0ULL) +#define VK_ATTACHMENT_UNUSED (~0U) +#define VK_TRUE 1 +#define VK_FALSE 0 +#define VK_QUEUE_FAMILY_IGNORED (~0U) +#define VK_SUBPASS_EXTERNAL (~0U) +#define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256 +#define VK_UUID_SIZE 16 +#define VK_MAX_MEMORY_TYPES 32 +#define VK_MAX_MEMORY_HEAPS 16 +#define VK_MAX_EXTENSION_NAME_SIZE 256 +#define VK_MAX_DESCRIPTION_SIZE 256 + + +typedef enum VkPipelineCacheHeaderVersion { + VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1, + VK_PIPELINE_CACHE_HEADER_VERSION_BEGIN_RANGE = VK_PIPELINE_CACHE_HEADER_VERSION_ONE, + VK_PIPELINE_CACHE_HEADER_VERSION_END_RANGE = VK_PIPELINE_CACHE_HEADER_VERSION_ONE, + VK_PIPELINE_CACHE_HEADER_VERSION_RANGE_SIZE = (VK_PIPELINE_CACHE_HEADER_VERSION_ONE - VK_PIPELINE_CACHE_HEADER_VERSION_ONE + 1), + VK_PIPELINE_CACHE_HEADER_VERSION_MAX_ENUM = 0x7FFFFFFF +} VkPipelineCacheHeaderVersion; + +typedef enum VkResult { + VK_SUCCESS = 0, + VK_NOT_READY = 1, + VK_TIMEOUT = 2, + VK_EVENT_SET = 3, + VK_EVENT_RESET = 4, + VK_INCOMPLETE = 5, + VK_ERROR_OUT_OF_HOST_MEMORY = -1, + VK_ERROR_OUT_OF_DEVICE_MEMORY = -2, + VK_ERROR_INITIALIZATION_FAILED = -3, + VK_ERROR_DEVICE_LOST = -4, + VK_ERROR_MEMORY_MAP_FAILED = -5, + VK_ERROR_LAYER_NOT_PRESENT = -6, + VK_ERROR_EXTENSION_NOT_PRESENT = -7, + VK_ERROR_FEATURE_NOT_PRESENT = -8, + VK_ERROR_INCOMPATIBLE_DRIVER = -9, + VK_ERROR_TOO_MANY_OBJECTS = -10, + VK_ERROR_FORMAT_NOT_SUPPORTED = -11, + VK_ERROR_FRAGMENTED_POOL = -12, + VK_ERROR_OUT_OF_POOL_MEMORY = -1000069000, + VK_ERROR_INVALID_EXTERNAL_HANDLE = -1000072003, + VK_ERROR_SURFACE_LOST_KHR = -1000000000, + VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001, + VK_SUBOPTIMAL_KHR = 1000001003, + VK_ERROR_OUT_OF_DATE_KHR = -1000001004, + VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001, + VK_ERROR_VALIDATION_FAILED_EXT = -1000011001, + VK_ERROR_INVALID_SHADER_NV = -1000012000, + VK_ERROR_FRAGMENTATION_EXT = -1000161000, + VK_ERROR_NOT_PERMITTED_EXT = -1000174001, + 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_RESULT_BEGIN_RANGE = VK_ERROR_FRAGMENTED_POOL, + VK_RESULT_END_RANGE = VK_INCOMPLETE, + VK_RESULT_RANGE_SIZE = (VK_INCOMPLETE - VK_ERROR_FRAGMENTED_POOL + 1), + VK_RESULT_MAX_ENUM = 0x7FFFFFFF +} VkResult; + +typedef enum VkStructureType { + VK_STRUCTURE_TYPE_APPLICATION_INFO = 0, + VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1, + VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2, + VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3, + VK_STRUCTURE_TYPE_SUBMIT_INFO = 4, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5, + VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6, + VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7, + VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8, + VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9, + VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10, + VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11, + VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12, + VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13, + VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14, + VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15, + VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16, + VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17, + VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18, + VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19, + VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20, + VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23, + VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24, + VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25, + VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26, + VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27, + VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28, + VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29, + VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30, + VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32, + VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34, + VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35, + VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36, + VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37, + VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38, + VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42, + VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43, + VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44, + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45, + VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46, + VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47, + VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES = 1000094000, + VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO = 1000157000, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO = 1000157001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES = 1000083000, + VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS = 1000127000, + VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO = 1000127001, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO = 1000060000, + VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO = 1000060003, + VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO = 1000060004, + VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO = 1000060005, + VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO = 1000060006, + VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO = 1000060013, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO = 1000060014, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES = 1000070000, + VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO = 1000070001, + VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2 = 1000146000, + VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2 = 1000146001, + VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2 = 1000146002, + VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2 = 1000146003, + VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2 = 1000146004, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 = 1000059000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2 = 1000059001, + VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2 = 1000059002, + VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2 = 1000059003, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2 = 1000059004, + VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2 = 1000059005, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2 = 1000059006, + VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2 = 1000059007, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2 = 1000059008, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES = 1000117000, + VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO = 1000117001, + VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO = 1000117002, + VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO = 1000117003, + VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO = 1000053000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES = 1000053001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES = 1000053002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES = 1000120000, + VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO = 1000145000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES = 1000145001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES = 1000145002, + VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2 = 1000145003, + VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO = 1000156000, + VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO = 1000156001, + VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO = 1000156002, + VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO = 1000156003, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES = 1000156004, + VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES = 1000156005, + VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO = 1000085000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO = 1000071000, + VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES = 1000071001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO = 1000071002, + VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES = 1000071003, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES = 1000071004, + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO = 1000072000, + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO = 1000072001, + VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO = 1000072002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO = 1000112000, + VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES = 1000112001, + VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO = 1000113000, + VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO = 1000077000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO = 1000076000, + VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES = 1000076001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES = 1000168000, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT = 1000168001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES = 1000063000, + VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000, + VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001, + VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR = 1000060007, + VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR = 1000060008, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR = 1000060009, + VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR = 1000060010, + VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR = 1000060011, + VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR = 1000060012, + VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000, + VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001, + VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR = 1000003000, + VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000, + VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000, + VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000, + VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000, + VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000, + VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, + VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000, + 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, + 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, + VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD = 1000041000, + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000, + VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001, + VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000, + VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001, + VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000, + VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000, + VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN = 1000062000, + VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR = 1000073000, + VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR = 1000073001, + VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR = 1000073002, + VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR = 1000073003, + VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR = 1000074000, + VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR = 1000074001, + VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR = 1000074002, + VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR = 1000075000, + VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR = 1000078000, + VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR = 1000078001, + VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR = 1000078002, + VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR = 1000078003, + VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR = 1000079000, + VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR = 1000079001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR = 1000080000, + VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000, + VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000, + VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001, + VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002, + VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003, + VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004, + VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV = 1000087000, + VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT = 1000090000, + VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT = 1000091000, + VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT = 1000091001, + VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT = 1000091002, + VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT = 1000091003, + VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE = 1000092000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX = 1000097000, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV = 1000098000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT = 1000099000, + VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT = 1000099001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT = 1000101000, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT = 1000101001, + VK_STRUCTURE_TYPE_HDR_METADATA_EXT = 1000105000, + 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, + VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR = 1000114002, + VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR = 1000115000, + VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR = 1000115001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR = 1000119000, + VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR = 1000119001, + VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR = 1000119002, + VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK = 1000122000, + VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000, + VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT = 1000128000, + VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT = 1000128001, + VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT = 1000128002, + VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT = 1000128003, + VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT = 1000128004, + VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID = 1000129000, + VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID = 1000129001, + VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID = 1000129002, + VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID = 1000129003, + VK_STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID = 1000129004, + VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID = 1000129005, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT = 1000130000, + VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT = 1000130001, + 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, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT = 1000143003, + VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT = 1000143004, + VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR = 1000147000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT = 1000148000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT = 1000148001, + VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT = 1000148002, + VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV = 1000149000, + VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV = 1000152000, + VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160000, + VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160001, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT = 1000161000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT = 1000161001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT = 1000161002, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT = 1000161003, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT = 1000161004, + VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT = 1000174000, + VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT = 1000178000, + VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT = 1000178001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT = 1000178002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD = 1000185000, + 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_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, + VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2, + VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2, + VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2, + VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHR = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO, + VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO, + VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO, + VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO, + VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO, + VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO_KHR = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES, + VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO, + VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHR = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO, + VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHR = VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES, + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO, + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO, + VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO, + VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHR = VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES, + VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES, + VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO, + VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES_KHR = VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES, + VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES, + VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO, + VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO, + VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES, + VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS, + VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO, + VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2, + VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2, + VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2_KHR = VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2, + VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, + VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2_KHR = VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2, + VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO, + VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO, + VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO_KHR = VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO, + VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO_KHR = VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES, + VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES_KHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES, + VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT_KHR = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT, + VK_STRUCTURE_TYPE_BEGIN_RANGE = VK_STRUCTURE_TYPE_APPLICATION_INFO, + VK_STRUCTURE_TYPE_END_RANGE = VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO, + VK_STRUCTURE_TYPE_RANGE_SIZE = (VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO - VK_STRUCTURE_TYPE_APPLICATION_INFO + 1), + VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkStructureType; + +typedef enum VkSystemAllocationScope { + VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0, + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 1, + VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 2, + VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 3, + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 4, + VK_SYSTEM_ALLOCATION_SCOPE_BEGIN_RANGE = VK_SYSTEM_ALLOCATION_SCOPE_COMMAND, + VK_SYSTEM_ALLOCATION_SCOPE_END_RANGE = VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE, + VK_SYSTEM_ALLOCATION_SCOPE_RANGE_SIZE = (VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE - VK_SYSTEM_ALLOCATION_SCOPE_COMMAND + 1), + VK_SYSTEM_ALLOCATION_SCOPE_MAX_ENUM = 0x7FFFFFFF +} VkSystemAllocationScope; + +typedef enum VkInternalAllocationType { + VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0, + VK_INTERNAL_ALLOCATION_TYPE_BEGIN_RANGE = VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE, + VK_INTERNAL_ALLOCATION_TYPE_END_RANGE = VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE, + VK_INTERNAL_ALLOCATION_TYPE_RANGE_SIZE = (VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE - VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE + 1), + VK_INTERNAL_ALLOCATION_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkInternalAllocationType; + +typedef enum VkFormat { + VK_FORMAT_UNDEFINED = 0, + VK_FORMAT_R4G4_UNORM_PACK8 = 1, + VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2, + VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3, + VK_FORMAT_R5G6B5_UNORM_PACK16 = 4, + VK_FORMAT_B5G6R5_UNORM_PACK16 = 5, + VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6, + VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7, + VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8, + VK_FORMAT_R8_UNORM = 9, + VK_FORMAT_R8_SNORM = 10, + VK_FORMAT_R8_USCALED = 11, + VK_FORMAT_R8_SSCALED = 12, + VK_FORMAT_R8_UINT = 13, + VK_FORMAT_R8_SINT = 14, + VK_FORMAT_R8_SRGB = 15, + VK_FORMAT_R8G8_UNORM = 16, + VK_FORMAT_R8G8_SNORM = 17, + VK_FORMAT_R8G8_USCALED = 18, + VK_FORMAT_R8G8_SSCALED = 19, + VK_FORMAT_R8G8_UINT = 20, + VK_FORMAT_R8G8_SINT = 21, + VK_FORMAT_R8G8_SRGB = 22, + VK_FORMAT_R8G8B8_UNORM = 23, + VK_FORMAT_R8G8B8_SNORM = 24, + VK_FORMAT_R8G8B8_USCALED = 25, + VK_FORMAT_R8G8B8_SSCALED = 26, + VK_FORMAT_R8G8B8_UINT = 27, + VK_FORMAT_R8G8B8_SINT = 28, + VK_FORMAT_R8G8B8_SRGB = 29, + VK_FORMAT_B8G8R8_UNORM = 30, + VK_FORMAT_B8G8R8_SNORM = 31, + VK_FORMAT_B8G8R8_USCALED = 32, + VK_FORMAT_B8G8R8_SSCALED = 33, + VK_FORMAT_B8G8R8_UINT = 34, + VK_FORMAT_B8G8R8_SINT = 35, + VK_FORMAT_B8G8R8_SRGB = 36, + VK_FORMAT_R8G8B8A8_UNORM = 37, + VK_FORMAT_R8G8B8A8_SNORM = 38, + VK_FORMAT_R8G8B8A8_USCALED = 39, + VK_FORMAT_R8G8B8A8_SSCALED = 40, + VK_FORMAT_R8G8B8A8_UINT = 41, + VK_FORMAT_R8G8B8A8_SINT = 42, + VK_FORMAT_R8G8B8A8_SRGB = 43, + VK_FORMAT_B8G8R8A8_UNORM = 44, + VK_FORMAT_B8G8R8A8_SNORM = 45, + VK_FORMAT_B8G8R8A8_USCALED = 46, + VK_FORMAT_B8G8R8A8_SSCALED = 47, + VK_FORMAT_B8G8R8A8_UINT = 48, + VK_FORMAT_B8G8R8A8_SINT = 49, + VK_FORMAT_B8G8R8A8_SRGB = 50, + VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51, + VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52, + VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53, + VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54, + VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55, + VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56, + VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57, + VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58, + VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59, + VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60, + VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61, + VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62, + VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63, + VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64, + VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65, + VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66, + VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67, + VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68, + VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69, + VK_FORMAT_R16_UNORM = 70, + VK_FORMAT_R16_SNORM = 71, + VK_FORMAT_R16_USCALED = 72, + VK_FORMAT_R16_SSCALED = 73, + VK_FORMAT_R16_UINT = 74, + VK_FORMAT_R16_SINT = 75, + VK_FORMAT_R16_SFLOAT = 76, + VK_FORMAT_R16G16_UNORM = 77, + VK_FORMAT_R16G16_SNORM = 78, + VK_FORMAT_R16G16_USCALED = 79, + VK_FORMAT_R16G16_SSCALED = 80, + VK_FORMAT_R16G16_UINT = 81, + VK_FORMAT_R16G16_SINT = 82, + VK_FORMAT_R16G16_SFLOAT = 83, + VK_FORMAT_R16G16B16_UNORM = 84, + VK_FORMAT_R16G16B16_SNORM = 85, + VK_FORMAT_R16G16B16_USCALED = 86, + VK_FORMAT_R16G16B16_SSCALED = 87, + VK_FORMAT_R16G16B16_UINT = 88, + VK_FORMAT_R16G16B16_SINT = 89, + VK_FORMAT_R16G16B16_SFLOAT = 90, + VK_FORMAT_R16G16B16A16_UNORM = 91, + VK_FORMAT_R16G16B16A16_SNORM = 92, + VK_FORMAT_R16G16B16A16_USCALED = 93, + VK_FORMAT_R16G16B16A16_SSCALED = 94, + VK_FORMAT_R16G16B16A16_UINT = 95, + VK_FORMAT_R16G16B16A16_SINT = 96, + VK_FORMAT_R16G16B16A16_SFLOAT = 97, + VK_FORMAT_R32_UINT = 98, + VK_FORMAT_R32_SINT = 99, + VK_FORMAT_R32_SFLOAT = 100, + VK_FORMAT_R32G32_UINT = 101, + VK_FORMAT_R32G32_SINT = 102, + VK_FORMAT_R32G32_SFLOAT = 103, + VK_FORMAT_R32G32B32_UINT = 104, + VK_FORMAT_R32G32B32_SINT = 105, + VK_FORMAT_R32G32B32_SFLOAT = 106, + VK_FORMAT_R32G32B32A32_UINT = 107, + VK_FORMAT_R32G32B32A32_SINT = 108, + VK_FORMAT_R32G32B32A32_SFLOAT = 109, + VK_FORMAT_R64_UINT = 110, + VK_FORMAT_R64_SINT = 111, + VK_FORMAT_R64_SFLOAT = 112, + VK_FORMAT_R64G64_UINT = 113, + VK_FORMAT_R64G64_SINT = 114, + VK_FORMAT_R64G64_SFLOAT = 115, + VK_FORMAT_R64G64B64_UINT = 116, + VK_FORMAT_R64G64B64_SINT = 117, + VK_FORMAT_R64G64B64_SFLOAT = 118, + VK_FORMAT_R64G64B64A64_UINT = 119, + VK_FORMAT_R64G64B64A64_SINT = 120, + VK_FORMAT_R64G64B64A64_SFLOAT = 121, + VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122, + VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123, + VK_FORMAT_D16_UNORM = 124, + VK_FORMAT_X8_D24_UNORM_PACK32 = 125, + VK_FORMAT_D32_SFLOAT = 126, + VK_FORMAT_S8_UINT = 127, + VK_FORMAT_D16_UNORM_S8_UINT = 128, + VK_FORMAT_D24_UNORM_S8_UINT = 129, + VK_FORMAT_D32_SFLOAT_S8_UINT = 130, + VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131, + VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132, + VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133, + VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134, + VK_FORMAT_BC2_UNORM_BLOCK = 135, + VK_FORMAT_BC2_SRGB_BLOCK = 136, + VK_FORMAT_BC3_UNORM_BLOCK = 137, + VK_FORMAT_BC3_SRGB_BLOCK = 138, + VK_FORMAT_BC4_UNORM_BLOCK = 139, + VK_FORMAT_BC4_SNORM_BLOCK = 140, + VK_FORMAT_BC5_UNORM_BLOCK = 141, + VK_FORMAT_BC5_SNORM_BLOCK = 142, + VK_FORMAT_BC6H_UFLOAT_BLOCK = 143, + VK_FORMAT_BC6H_SFLOAT_BLOCK = 144, + VK_FORMAT_BC7_UNORM_BLOCK = 145, + VK_FORMAT_BC7_SRGB_BLOCK = 146, + VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147, + VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148, + VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149, + VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150, + VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151, + VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152, + VK_FORMAT_EAC_R11_UNORM_BLOCK = 153, + VK_FORMAT_EAC_R11_SNORM_BLOCK = 154, + VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155, + VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156, + VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157, + VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158, + VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159, + VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160, + VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161, + VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162, + VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163, + VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164, + VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165, + VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166, + VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167, + VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168, + VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169, + VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170, + VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171, + VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172, + VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173, + VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174, + VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175, + VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176, + VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177, + VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178, + VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179, + VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180, + VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181, + VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182, + VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183, + VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184, + VK_FORMAT_G8B8G8R8_422_UNORM = 1000156000, + VK_FORMAT_B8G8R8G8_422_UNORM = 1000156001, + VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM = 1000156002, + VK_FORMAT_G8_B8R8_2PLANE_420_UNORM = 1000156003, + VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM = 1000156004, + VK_FORMAT_G8_B8R8_2PLANE_422_UNORM = 1000156005, + VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM = 1000156006, + VK_FORMAT_R10X6_UNORM_PACK16 = 1000156007, + VK_FORMAT_R10X6G10X6_UNORM_2PACK16 = 1000156008, + VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16 = 1000156009, + VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 = 1000156010, + VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16 = 1000156011, + VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16 = 1000156012, + VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 = 1000156013, + VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16 = 1000156014, + VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 = 1000156015, + VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16 = 1000156016, + VK_FORMAT_R12X4_UNORM_PACK16 = 1000156017, + VK_FORMAT_R12X4G12X4_UNORM_2PACK16 = 1000156018, + VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16 = 1000156019, + VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16 = 1000156020, + VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16 = 1000156021, + VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16 = 1000156022, + VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16 = 1000156023, + VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16 = 1000156024, + VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16 = 1000156025, + VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16 = 1000156026, + VK_FORMAT_G16B16G16R16_422_UNORM = 1000156027, + VK_FORMAT_B16G16R16G16_422_UNORM = 1000156028, + VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM = 1000156029, + VK_FORMAT_G16_B16R16_2PLANE_420_UNORM = 1000156030, + VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM = 1000156031, + VK_FORMAT_G16_B16R16_2PLANE_422_UNORM = 1000156032, + VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM = 1000156033, + VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000, + VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001, + VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002, + VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003, + VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004, + 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_G8B8G8R8_422_UNORM_KHR = VK_FORMAT_G8B8G8R8_422_UNORM, + VK_FORMAT_B8G8R8G8_422_UNORM_KHR = VK_FORMAT_B8G8R8G8_422_UNORM, + VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM, + VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM, + VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR = VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM, + VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM, + VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR = VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM, + VK_FORMAT_R10X6_UNORM_PACK16_KHR = VK_FORMAT_R10X6_UNORM_PACK16, + VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR = VK_FORMAT_R10X6G10X6_UNORM_2PACK16, + VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR = VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16, + VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR = VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16, + VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16, + VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, + VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16, + VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16, + VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16, + VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16, + VK_FORMAT_R12X4_UNORM_PACK16_KHR = VK_FORMAT_R12X4_UNORM_PACK16, + VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR = VK_FORMAT_R12X4G12X4_UNORM_2PACK16, + VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR = VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16, + VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR = VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16, + VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR = VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16, + VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16, + VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16, + VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16, + VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16, + VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16, + VK_FORMAT_G16B16G16R16_422_UNORM_KHR = VK_FORMAT_G16B16G16R16_422_UNORM, + VK_FORMAT_B16G16R16G16_422_UNORM_KHR = VK_FORMAT_B16G16R16G16_422_UNORM, + VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR = VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, + VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR = VK_FORMAT_G16_B16R16_2PLANE_420_UNORM, + VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR = VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM, + VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR = VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, + VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR = VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM, + VK_FORMAT_BEGIN_RANGE = VK_FORMAT_UNDEFINED, + VK_FORMAT_END_RANGE = VK_FORMAT_ASTC_12x12_SRGB_BLOCK, + VK_FORMAT_RANGE_SIZE = (VK_FORMAT_ASTC_12x12_SRGB_BLOCK - VK_FORMAT_UNDEFINED + 1), + VK_FORMAT_MAX_ENUM = 0x7FFFFFFF +} VkFormat; + +typedef enum VkImageType { + VK_IMAGE_TYPE_1D = 0, + VK_IMAGE_TYPE_2D = 1, + VK_IMAGE_TYPE_3D = 2, + VK_IMAGE_TYPE_BEGIN_RANGE = VK_IMAGE_TYPE_1D, + VK_IMAGE_TYPE_END_RANGE = VK_IMAGE_TYPE_3D, + VK_IMAGE_TYPE_RANGE_SIZE = (VK_IMAGE_TYPE_3D - VK_IMAGE_TYPE_1D + 1), + VK_IMAGE_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkImageType; + +typedef enum VkImageTiling { + VK_IMAGE_TILING_OPTIMAL = 0, + VK_IMAGE_TILING_LINEAR = 1, + VK_IMAGE_TILING_BEGIN_RANGE = VK_IMAGE_TILING_OPTIMAL, + VK_IMAGE_TILING_END_RANGE = VK_IMAGE_TILING_LINEAR, + VK_IMAGE_TILING_RANGE_SIZE = (VK_IMAGE_TILING_LINEAR - VK_IMAGE_TILING_OPTIMAL + 1), + VK_IMAGE_TILING_MAX_ENUM = 0x7FFFFFFF +} VkImageTiling; + +typedef enum VkPhysicalDeviceType { + VK_PHYSICAL_DEVICE_TYPE_OTHER = 0, + VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 1, + VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 2, + VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 3, + VK_PHYSICAL_DEVICE_TYPE_CPU = 4, + VK_PHYSICAL_DEVICE_TYPE_BEGIN_RANGE = VK_PHYSICAL_DEVICE_TYPE_OTHER, + VK_PHYSICAL_DEVICE_TYPE_END_RANGE = VK_PHYSICAL_DEVICE_TYPE_CPU, + VK_PHYSICAL_DEVICE_TYPE_RANGE_SIZE = (VK_PHYSICAL_DEVICE_TYPE_CPU - VK_PHYSICAL_DEVICE_TYPE_OTHER + 1), + VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkPhysicalDeviceType; + +typedef enum VkQueryType { + VK_QUERY_TYPE_OCCLUSION = 0, + VK_QUERY_TYPE_PIPELINE_STATISTICS = 1, + VK_QUERY_TYPE_TIMESTAMP = 2, + VK_QUERY_TYPE_BEGIN_RANGE = VK_QUERY_TYPE_OCCLUSION, + VK_QUERY_TYPE_END_RANGE = VK_QUERY_TYPE_TIMESTAMP, + VK_QUERY_TYPE_RANGE_SIZE = (VK_QUERY_TYPE_TIMESTAMP - VK_QUERY_TYPE_OCCLUSION + 1), + VK_QUERY_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkQueryType; + +typedef enum VkSharingMode { + VK_SHARING_MODE_EXCLUSIVE = 0, + VK_SHARING_MODE_CONCURRENT = 1, + VK_SHARING_MODE_BEGIN_RANGE = VK_SHARING_MODE_EXCLUSIVE, + VK_SHARING_MODE_END_RANGE = VK_SHARING_MODE_CONCURRENT, + VK_SHARING_MODE_RANGE_SIZE = (VK_SHARING_MODE_CONCURRENT - VK_SHARING_MODE_EXCLUSIVE + 1), + VK_SHARING_MODE_MAX_ENUM = 0x7FFFFFFF +} VkSharingMode; + +typedef enum VkImageLayout { + VK_IMAGE_LAYOUT_UNDEFINED = 0, + VK_IMAGE_LAYOUT_GENERAL = 1, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 2, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 3, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 4, + VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 5, + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 6, + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 7, + VK_IMAGE_LAYOUT_PREINITIALIZED = 8, + VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL = 1000117000, + VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL = 1000117001, + VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002, + VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR = 1000111000, + 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, + VK_IMAGE_LAYOUT_BEGIN_RANGE = VK_IMAGE_LAYOUT_UNDEFINED, + VK_IMAGE_LAYOUT_END_RANGE = VK_IMAGE_LAYOUT_PREINITIALIZED, + VK_IMAGE_LAYOUT_RANGE_SIZE = (VK_IMAGE_LAYOUT_PREINITIALIZED - VK_IMAGE_LAYOUT_UNDEFINED + 1), + VK_IMAGE_LAYOUT_MAX_ENUM = 0x7FFFFFFF +} VkImageLayout; + +typedef enum VkImageViewType { + VK_IMAGE_VIEW_TYPE_1D = 0, + VK_IMAGE_VIEW_TYPE_2D = 1, + VK_IMAGE_VIEW_TYPE_3D = 2, + VK_IMAGE_VIEW_TYPE_CUBE = 3, + VK_IMAGE_VIEW_TYPE_1D_ARRAY = 4, + VK_IMAGE_VIEW_TYPE_2D_ARRAY = 5, + VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 6, + VK_IMAGE_VIEW_TYPE_BEGIN_RANGE = VK_IMAGE_VIEW_TYPE_1D, + VK_IMAGE_VIEW_TYPE_END_RANGE = VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, + VK_IMAGE_VIEW_TYPE_RANGE_SIZE = (VK_IMAGE_VIEW_TYPE_CUBE_ARRAY - VK_IMAGE_VIEW_TYPE_1D + 1), + VK_IMAGE_VIEW_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkImageViewType; + +typedef enum VkComponentSwizzle { + VK_COMPONENT_SWIZZLE_IDENTITY = 0, + VK_COMPONENT_SWIZZLE_ZERO = 1, + VK_COMPONENT_SWIZZLE_ONE = 2, + VK_COMPONENT_SWIZZLE_R = 3, + VK_COMPONENT_SWIZZLE_G = 4, + VK_COMPONENT_SWIZZLE_B = 5, + VK_COMPONENT_SWIZZLE_A = 6, + VK_COMPONENT_SWIZZLE_BEGIN_RANGE = VK_COMPONENT_SWIZZLE_IDENTITY, + VK_COMPONENT_SWIZZLE_END_RANGE = VK_COMPONENT_SWIZZLE_A, + VK_COMPONENT_SWIZZLE_RANGE_SIZE = (VK_COMPONENT_SWIZZLE_A - VK_COMPONENT_SWIZZLE_IDENTITY + 1), + VK_COMPONENT_SWIZZLE_MAX_ENUM = 0x7FFFFFFF +} VkComponentSwizzle; + +typedef enum VkVertexInputRate { + VK_VERTEX_INPUT_RATE_VERTEX = 0, + VK_VERTEX_INPUT_RATE_INSTANCE = 1, + VK_VERTEX_INPUT_RATE_BEGIN_RANGE = VK_VERTEX_INPUT_RATE_VERTEX, + VK_VERTEX_INPUT_RATE_END_RANGE = VK_VERTEX_INPUT_RATE_INSTANCE, + VK_VERTEX_INPUT_RATE_RANGE_SIZE = (VK_VERTEX_INPUT_RATE_INSTANCE - VK_VERTEX_INPUT_RATE_VERTEX + 1), + VK_VERTEX_INPUT_RATE_MAX_ENUM = 0x7FFFFFFF +} VkVertexInputRate; + +typedef enum VkPrimitiveTopology { + VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0, + VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 1, + VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 2, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 3, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 4, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 5, + VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 6, + VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 7, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 8, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 9, + VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 10, + VK_PRIMITIVE_TOPOLOGY_BEGIN_RANGE = VK_PRIMITIVE_TOPOLOGY_POINT_LIST, + VK_PRIMITIVE_TOPOLOGY_END_RANGE = VK_PRIMITIVE_TOPOLOGY_PATCH_LIST, + VK_PRIMITIVE_TOPOLOGY_RANGE_SIZE = (VK_PRIMITIVE_TOPOLOGY_PATCH_LIST - VK_PRIMITIVE_TOPOLOGY_POINT_LIST + 1), + VK_PRIMITIVE_TOPOLOGY_MAX_ENUM = 0x7FFFFFFF +} VkPrimitiveTopology; + +typedef enum VkPolygonMode { + VK_POLYGON_MODE_FILL = 0, + VK_POLYGON_MODE_LINE = 1, + VK_POLYGON_MODE_POINT = 2, + VK_POLYGON_MODE_FILL_RECTANGLE_NV = 1000153000, + VK_POLYGON_MODE_BEGIN_RANGE = VK_POLYGON_MODE_FILL, + VK_POLYGON_MODE_END_RANGE = VK_POLYGON_MODE_POINT, + VK_POLYGON_MODE_RANGE_SIZE = (VK_POLYGON_MODE_POINT - VK_POLYGON_MODE_FILL + 1), + VK_POLYGON_MODE_MAX_ENUM = 0x7FFFFFFF +} VkPolygonMode; + +typedef enum VkFrontFace { + VK_FRONT_FACE_COUNTER_CLOCKWISE = 0, + VK_FRONT_FACE_CLOCKWISE = 1, + VK_FRONT_FACE_BEGIN_RANGE = VK_FRONT_FACE_COUNTER_CLOCKWISE, + VK_FRONT_FACE_END_RANGE = VK_FRONT_FACE_CLOCKWISE, + VK_FRONT_FACE_RANGE_SIZE = (VK_FRONT_FACE_CLOCKWISE - VK_FRONT_FACE_COUNTER_CLOCKWISE + 1), + VK_FRONT_FACE_MAX_ENUM = 0x7FFFFFFF +} VkFrontFace; + +typedef enum VkCompareOp { + VK_COMPARE_OP_NEVER = 0, + VK_COMPARE_OP_LESS = 1, + VK_COMPARE_OP_EQUAL = 2, + VK_COMPARE_OP_LESS_OR_EQUAL = 3, + VK_COMPARE_OP_GREATER = 4, + VK_COMPARE_OP_NOT_EQUAL = 5, + VK_COMPARE_OP_GREATER_OR_EQUAL = 6, + VK_COMPARE_OP_ALWAYS = 7, + VK_COMPARE_OP_BEGIN_RANGE = VK_COMPARE_OP_NEVER, + VK_COMPARE_OP_END_RANGE = VK_COMPARE_OP_ALWAYS, + VK_COMPARE_OP_RANGE_SIZE = (VK_COMPARE_OP_ALWAYS - VK_COMPARE_OP_NEVER + 1), + VK_COMPARE_OP_MAX_ENUM = 0x7FFFFFFF +} VkCompareOp; + +typedef enum VkStencilOp { + VK_STENCIL_OP_KEEP = 0, + VK_STENCIL_OP_ZERO = 1, + VK_STENCIL_OP_REPLACE = 2, + VK_STENCIL_OP_INCREMENT_AND_CLAMP = 3, + VK_STENCIL_OP_DECREMENT_AND_CLAMP = 4, + VK_STENCIL_OP_INVERT = 5, + VK_STENCIL_OP_INCREMENT_AND_WRAP = 6, + VK_STENCIL_OP_DECREMENT_AND_WRAP = 7, + VK_STENCIL_OP_BEGIN_RANGE = VK_STENCIL_OP_KEEP, + VK_STENCIL_OP_END_RANGE = VK_STENCIL_OP_DECREMENT_AND_WRAP, + VK_STENCIL_OP_RANGE_SIZE = (VK_STENCIL_OP_DECREMENT_AND_WRAP - VK_STENCIL_OP_KEEP + 1), + VK_STENCIL_OP_MAX_ENUM = 0x7FFFFFFF +} VkStencilOp; + +typedef enum VkLogicOp { + VK_LOGIC_OP_CLEAR = 0, + VK_LOGIC_OP_AND = 1, + VK_LOGIC_OP_AND_REVERSE = 2, + VK_LOGIC_OP_COPY = 3, + VK_LOGIC_OP_AND_INVERTED = 4, + VK_LOGIC_OP_NO_OP = 5, + VK_LOGIC_OP_XOR = 6, + VK_LOGIC_OP_OR = 7, + VK_LOGIC_OP_NOR = 8, + VK_LOGIC_OP_EQUIVALENT = 9, + VK_LOGIC_OP_INVERT = 10, + VK_LOGIC_OP_OR_REVERSE = 11, + VK_LOGIC_OP_COPY_INVERTED = 12, + VK_LOGIC_OP_OR_INVERTED = 13, + VK_LOGIC_OP_NAND = 14, + VK_LOGIC_OP_SET = 15, + VK_LOGIC_OP_BEGIN_RANGE = VK_LOGIC_OP_CLEAR, + VK_LOGIC_OP_END_RANGE = VK_LOGIC_OP_SET, + VK_LOGIC_OP_RANGE_SIZE = (VK_LOGIC_OP_SET - VK_LOGIC_OP_CLEAR + 1), + VK_LOGIC_OP_MAX_ENUM = 0x7FFFFFFF +} VkLogicOp; + +typedef enum VkBlendFactor { + VK_BLEND_FACTOR_ZERO = 0, + VK_BLEND_FACTOR_ONE = 1, + VK_BLEND_FACTOR_SRC_COLOR = 2, + VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 3, + VK_BLEND_FACTOR_DST_COLOR = 4, + VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 5, + VK_BLEND_FACTOR_SRC_ALPHA = 6, + VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 7, + VK_BLEND_FACTOR_DST_ALPHA = 8, + VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 9, + VK_BLEND_FACTOR_CONSTANT_COLOR = 10, + VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 11, + VK_BLEND_FACTOR_CONSTANT_ALPHA = 12, + VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 13, + VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 14, + VK_BLEND_FACTOR_SRC1_COLOR = 15, + VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 16, + VK_BLEND_FACTOR_SRC1_ALPHA = 17, + VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 18, + VK_BLEND_FACTOR_BEGIN_RANGE = VK_BLEND_FACTOR_ZERO, + VK_BLEND_FACTOR_END_RANGE = VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA, + VK_BLEND_FACTOR_RANGE_SIZE = (VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA - VK_BLEND_FACTOR_ZERO + 1), + VK_BLEND_FACTOR_MAX_ENUM = 0x7FFFFFFF +} VkBlendFactor; + +typedef enum VkBlendOp { + VK_BLEND_OP_ADD = 0, + VK_BLEND_OP_SUBTRACT = 1, + VK_BLEND_OP_REVERSE_SUBTRACT = 2, + VK_BLEND_OP_MIN = 3, + VK_BLEND_OP_MAX = 4, + VK_BLEND_OP_ZERO_EXT = 1000148000, + VK_BLEND_OP_SRC_EXT = 1000148001, + VK_BLEND_OP_DST_EXT = 1000148002, + VK_BLEND_OP_SRC_OVER_EXT = 1000148003, + VK_BLEND_OP_DST_OVER_EXT = 1000148004, + VK_BLEND_OP_SRC_IN_EXT = 1000148005, + VK_BLEND_OP_DST_IN_EXT = 1000148006, + VK_BLEND_OP_SRC_OUT_EXT = 1000148007, + VK_BLEND_OP_DST_OUT_EXT = 1000148008, + VK_BLEND_OP_SRC_ATOP_EXT = 1000148009, + VK_BLEND_OP_DST_ATOP_EXT = 1000148010, + VK_BLEND_OP_XOR_EXT = 1000148011, + VK_BLEND_OP_MULTIPLY_EXT = 1000148012, + VK_BLEND_OP_SCREEN_EXT = 1000148013, + VK_BLEND_OP_OVERLAY_EXT = 1000148014, + VK_BLEND_OP_DARKEN_EXT = 1000148015, + VK_BLEND_OP_LIGHTEN_EXT = 1000148016, + VK_BLEND_OP_COLORDODGE_EXT = 1000148017, + VK_BLEND_OP_COLORBURN_EXT = 1000148018, + VK_BLEND_OP_HARDLIGHT_EXT = 1000148019, + VK_BLEND_OP_SOFTLIGHT_EXT = 1000148020, + VK_BLEND_OP_DIFFERENCE_EXT = 1000148021, + VK_BLEND_OP_EXCLUSION_EXT = 1000148022, + VK_BLEND_OP_INVERT_EXT = 1000148023, + VK_BLEND_OP_INVERT_RGB_EXT = 1000148024, + VK_BLEND_OP_LINEARDODGE_EXT = 1000148025, + VK_BLEND_OP_LINEARBURN_EXT = 1000148026, + VK_BLEND_OP_VIVIDLIGHT_EXT = 1000148027, + VK_BLEND_OP_LINEARLIGHT_EXT = 1000148028, + VK_BLEND_OP_PINLIGHT_EXT = 1000148029, + VK_BLEND_OP_HARDMIX_EXT = 1000148030, + VK_BLEND_OP_HSL_HUE_EXT = 1000148031, + VK_BLEND_OP_HSL_SATURATION_EXT = 1000148032, + VK_BLEND_OP_HSL_COLOR_EXT = 1000148033, + VK_BLEND_OP_HSL_LUMINOSITY_EXT = 1000148034, + VK_BLEND_OP_PLUS_EXT = 1000148035, + VK_BLEND_OP_PLUS_CLAMPED_EXT = 1000148036, + VK_BLEND_OP_PLUS_CLAMPED_ALPHA_EXT = 1000148037, + VK_BLEND_OP_PLUS_DARKER_EXT = 1000148038, + VK_BLEND_OP_MINUS_EXT = 1000148039, + VK_BLEND_OP_MINUS_CLAMPED_EXT = 1000148040, + VK_BLEND_OP_CONTRAST_EXT = 1000148041, + VK_BLEND_OP_INVERT_OVG_EXT = 1000148042, + VK_BLEND_OP_RED_EXT = 1000148043, + VK_BLEND_OP_GREEN_EXT = 1000148044, + VK_BLEND_OP_BLUE_EXT = 1000148045, + VK_BLEND_OP_BEGIN_RANGE = VK_BLEND_OP_ADD, + VK_BLEND_OP_END_RANGE = VK_BLEND_OP_MAX, + VK_BLEND_OP_RANGE_SIZE = (VK_BLEND_OP_MAX - VK_BLEND_OP_ADD + 1), + VK_BLEND_OP_MAX_ENUM = 0x7FFFFFFF +} VkBlendOp; + +typedef enum VkDynamicState { + VK_DYNAMIC_STATE_VIEWPORT = 0, + VK_DYNAMIC_STATE_SCISSOR = 1, + VK_DYNAMIC_STATE_LINE_WIDTH = 2, + VK_DYNAMIC_STATE_DEPTH_BIAS = 3, + VK_DYNAMIC_STATE_BLEND_CONSTANTS = 4, + VK_DYNAMIC_STATE_DEPTH_BOUNDS = 5, + VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 6, + VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 7, + VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8, + VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV = 1000087000, + VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT = 1000099000, + VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT = 1000143000, + VK_DYNAMIC_STATE_BEGIN_RANGE = VK_DYNAMIC_STATE_VIEWPORT, + VK_DYNAMIC_STATE_END_RANGE = VK_DYNAMIC_STATE_STENCIL_REFERENCE, + VK_DYNAMIC_STATE_RANGE_SIZE = (VK_DYNAMIC_STATE_STENCIL_REFERENCE - VK_DYNAMIC_STATE_VIEWPORT + 1), + VK_DYNAMIC_STATE_MAX_ENUM = 0x7FFFFFFF +} VkDynamicState; + +typedef enum VkFilter { + VK_FILTER_NEAREST = 0, + VK_FILTER_LINEAR = 1, + VK_FILTER_CUBIC_IMG = 1000015000, + VK_FILTER_BEGIN_RANGE = VK_FILTER_NEAREST, + VK_FILTER_END_RANGE = VK_FILTER_LINEAR, + VK_FILTER_RANGE_SIZE = (VK_FILTER_LINEAR - VK_FILTER_NEAREST + 1), + VK_FILTER_MAX_ENUM = 0x7FFFFFFF +} VkFilter; + +typedef enum VkSamplerMipmapMode { + VK_SAMPLER_MIPMAP_MODE_NEAREST = 0, + VK_SAMPLER_MIPMAP_MODE_LINEAR = 1, + VK_SAMPLER_MIPMAP_MODE_BEGIN_RANGE = VK_SAMPLER_MIPMAP_MODE_NEAREST, + VK_SAMPLER_MIPMAP_MODE_END_RANGE = VK_SAMPLER_MIPMAP_MODE_LINEAR, + VK_SAMPLER_MIPMAP_MODE_RANGE_SIZE = (VK_SAMPLER_MIPMAP_MODE_LINEAR - VK_SAMPLER_MIPMAP_MODE_NEAREST + 1), + VK_SAMPLER_MIPMAP_MODE_MAX_ENUM = 0x7FFFFFFF +} VkSamplerMipmapMode; + +typedef enum VkSamplerAddressMode { + VK_SAMPLER_ADDRESS_MODE_REPEAT = 0, + VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 1, + VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 2, + VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 3, + VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 4, + VK_SAMPLER_ADDRESS_MODE_BEGIN_RANGE = VK_SAMPLER_ADDRESS_MODE_REPEAT, + VK_SAMPLER_ADDRESS_MODE_END_RANGE = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, + VK_SAMPLER_ADDRESS_MODE_RANGE_SIZE = (VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER - VK_SAMPLER_ADDRESS_MODE_REPEAT + 1), + VK_SAMPLER_ADDRESS_MODE_MAX_ENUM = 0x7FFFFFFF +} VkSamplerAddressMode; + +typedef enum VkBorderColor { + VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0, + VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 1, + VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 2, + VK_BORDER_COLOR_INT_OPAQUE_BLACK = 3, + VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 4, + VK_BORDER_COLOR_INT_OPAQUE_WHITE = 5, + VK_BORDER_COLOR_BEGIN_RANGE = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK, + VK_BORDER_COLOR_END_RANGE = VK_BORDER_COLOR_INT_OPAQUE_WHITE, + VK_BORDER_COLOR_RANGE_SIZE = (VK_BORDER_COLOR_INT_OPAQUE_WHITE - VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK + 1), + VK_BORDER_COLOR_MAX_ENUM = 0x7FFFFFFF +} VkBorderColor; + +typedef enum VkDescriptorType { + VK_DESCRIPTOR_TYPE_SAMPLER = 0, + VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 1, + VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 2, + VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 3, + VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 4, + VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 5, + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 6, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 7, + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 8, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 9, + VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 10, + VK_DESCRIPTOR_TYPE_BEGIN_RANGE = VK_DESCRIPTOR_TYPE_SAMPLER, + VK_DESCRIPTOR_TYPE_END_RANGE = VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, + VK_DESCRIPTOR_TYPE_RANGE_SIZE = (VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT - VK_DESCRIPTOR_TYPE_SAMPLER + 1), + VK_DESCRIPTOR_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkDescriptorType; + +typedef enum VkAttachmentLoadOp { + VK_ATTACHMENT_LOAD_OP_LOAD = 0, + VK_ATTACHMENT_LOAD_OP_CLEAR = 1, + VK_ATTACHMENT_LOAD_OP_DONT_CARE = 2, + VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE = VK_ATTACHMENT_LOAD_OP_LOAD, + VK_ATTACHMENT_LOAD_OP_END_RANGE = VK_ATTACHMENT_LOAD_OP_DONT_CARE, + VK_ATTACHMENT_LOAD_OP_RANGE_SIZE = (VK_ATTACHMENT_LOAD_OP_DONT_CARE - VK_ATTACHMENT_LOAD_OP_LOAD + 1), + VK_ATTACHMENT_LOAD_OP_MAX_ENUM = 0x7FFFFFFF +} VkAttachmentLoadOp; + +typedef enum VkAttachmentStoreOp { + VK_ATTACHMENT_STORE_OP_STORE = 0, + VK_ATTACHMENT_STORE_OP_DONT_CARE = 1, + VK_ATTACHMENT_STORE_OP_BEGIN_RANGE = VK_ATTACHMENT_STORE_OP_STORE, + VK_ATTACHMENT_STORE_OP_END_RANGE = VK_ATTACHMENT_STORE_OP_DONT_CARE, + VK_ATTACHMENT_STORE_OP_RANGE_SIZE = (VK_ATTACHMENT_STORE_OP_DONT_CARE - VK_ATTACHMENT_STORE_OP_STORE + 1), + VK_ATTACHMENT_STORE_OP_MAX_ENUM = 0x7FFFFFFF +} VkAttachmentStoreOp; + +typedef enum VkPipelineBindPoint { + VK_PIPELINE_BIND_POINT_GRAPHICS = 0, + VK_PIPELINE_BIND_POINT_COMPUTE = 1, + VK_PIPELINE_BIND_POINT_BEGIN_RANGE = VK_PIPELINE_BIND_POINT_GRAPHICS, + VK_PIPELINE_BIND_POINT_END_RANGE = VK_PIPELINE_BIND_POINT_COMPUTE, + VK_PIPELINE_BIND_POINT_RANGE_SIZE = (VK_PIPELINE_BIND_POINT_COMPUTE - VK_PIPELINE_BIND_POINT_GRAPHICS + 1), + VK_PIPELINE_BIND_POINT_MAX_ENUM = 0x7FFFFFFF +} VkPipelineBindPoint; + +typedef enum VkCommandBufferLevel { + VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0, + VK_COMMAND_BUFFER_LEVEL_SECONDARY = 1, + VK_COMMAND_BUFFER_LEVEL_BEGIN_RANGE = VK_COMMAND_BUFFER_LEVEL_PRIMARY, + VK_COMMAND_BUFFER_LEVEL_END_RANGE = VK_COMMAND_BUFFER_LEVEL_SECONDARY, + VK_COMMAND_BUFFER_LEVEL_RANGE_SIZE = (VK_COMMAND_BUFFER_LEVEL_SECONDARY - VK_COMMAND_BUFFER_LEVEL_PRIMARY + 1), + VK_COMMAND_BUFFER_LEVEL_MAX_ENUM = 0x7FFFFFFF +} VkCommandBufferLevel; + +typedef enum VkIndexType { + VK_INDEX_TYPE_UINT16 = 0, + VK_INDEX_TYPE_UINT32 = 1, + VK_INDEX_TYPE_BEGIN_RANGE = VK_INDEX_TYPE_UINT16, + VK_INDEX_TYPE_END_RANGE = VK_INDEX_TYPE_UINT32, + VK_INDEX_TYPE_RANGE_SIZE = (VK_INDEX_TYPE_UINT32 - VK_INDEX_TYPE_UINT16 + 1), + VK_INDEX_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkIndexType; + +typedef enum VkSubpassContents { + VK_SUBPASS_CONTENTS_INLINE = 0, + VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1, + VK_SUBPASS_CONTENTS_BEGIN_RANGE = VK_SUBPASS_CONTENTS_INLINE, + VK_SUBPASS_CONTENTS_END_RANGE = VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS, + VK_SUBPASS_CONTENTS_RANGE_SIZE = (VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS - VK_SUBPASS_CONTENTS_INLINE + 1), + VK_SUBPASS_CONTENTS_MAX_ENUM = 0x7FFFFFFF +} VkSubpassContents; + +typedef enum VkObjectType { + VK_OBJECT_TYPE_UNKNOWN = 0, + VK_OBJECT_TYPE_INSTANCE = 1, + VK_OBJECT_TYPE_PHYSICAL_DEVICE = 2, + VK_OBJECT_TYPE_DEVICE = 3, + VK_OBJECT_TYPE_QUEUE = 4, + VK_OBJECT_TYPE_SEMAPHORE = 5, + VK_OBJECT_TYPE_COMMAND_BUFFER = 6, + VK_OBJECT_TYPE_FENCE = 7, + VK_OBJECT_TYPE_DEVICE_MEMORY = 8, + VK_OBJECT_TYPE_BUFFER = 9, + VK_OBJECT_TYPE_IMAGE = 10, + VK_OBJECT_TYPE_EVENT = 11, + VK_OBJECT_TYPE_QUERY_POOL = 12, + VK_OBJECT_TYPE_BUFFER_VIEW = 13, + VK_OBJECT_TYPE_IMAGE_VIEW = 14, + VK_OBJECT_TYPE_SHADER_MODULE = 15, + VK_OBJECT_TYPE_PIPELINE_CACHE = 16, + VK_OBJECT_TYPE_PIPELINE_LAYOUT = 17, + VK_OBJECT_TYPE_RENDER_PASS = 18, + VK_OBJECT_TYPE_PIPELINE = 19, + VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT = 20, + VK_OBJECT_TYPE_SAMPLER = 21, + VK_OBJECT_TYPE_DESCRIPTOR_POOL = 22, + VK_OBJECT_TYPE_DESCRIPTOR_SET = 23, + VK_OBJECT_TYPE_FRAMEBUFFER = 24, + VK_OBJECT_TYPE_COMMAND_POOL = 25, + VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION = 1000156000, + VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE = 1000085000, + VK_OBJECT_TYPE_SURFACE_KHR = 1000000000, + VK_OBJECT_TYPE_SWAPCHAIN_KHR = 1000001000, + VK_OBJECT_TYPE_DISPLAY_KHR = 1000002000, + VK_OBJECT_TYPE_DISPLAY_MODE_KHR = 1000002001, + VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT = 1000011000, + VK_OBJECT_TYPE_OBJECT_TABLE_NVX = 1000086000, + VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX = 1000086001, + VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT = 1000128000, + VK_OBJECT_TYPE_VALIDATION_CACHE_EXT = 1000160000, + 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_BEGIN_RANGE = VK_OBJECT_TYPE_UNKNOWN, + VK_OBJECT_TYPE_END_RANGE = VK_OBJECT_TYPE_COMMAND_POOL, + VK_OBJECT_TYPE_RANGE_SIZE = (VK_OBJECT_TYPE_COMMAND_POOL - VK_OBJECT_TYPE_UNKNOWN + 1), + VK_OBJECT_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkObjectType; + +typedef VkFlags VkInstanceCreateFlags; + +typedef enum VkFormatFeatureFlagBits { + VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, + VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, + VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, + VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, + VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, + VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, + VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, + VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, + VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, + VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, + VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, + VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000, + VK_FORMAT_FEATURE_TRANSFER_SRC_BIT = 0x00004000, + VK_FORMAT_FEATURE_TRANSFER_DST_BIT = 0x00008000, + VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT = 0x00020000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT = 0x00040000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT = 0x00080000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT = 0x00100000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT = 0x00200000, + VK_FORMAT_FEATURE_DISJOINT_BIT = 0x00400000, + VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT = 0x00800000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT = 0x00010000, + 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, + VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT_KHR = VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT, + VK_FORMAT_FEATURE_DISJOINT_BIT_KHR = VK_FORMAT_FEATURE_DISJOINT_BIT, + VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR = VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, + VK_FORMAT_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkFormatFeatureFlagBits; +typedef VkFlags VkFormatFeatureFlags; + +typedef enum VkImageUsageFlagBits { + VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, + VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, + VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, + VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, + VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, + VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, + VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, + VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, + VK_IMAGE_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkImageUsageFlagBits; +typedef VkFlags VkImageUsageFlags; + +typedef enum VkImageCreateFlagBits { + VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, + VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, + VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004, + VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, + VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, + VK_IMAGE_CREATE_ALIAS_BIT = 0x00000400, + VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT = 0x00000040, + VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT = 0x00000020, + VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT = 0x00000080, + VK_IMAGE_CREATE_EXTENDED_USAGE_BIT = 0x00000100, + VK_IMAGE_CREATE_PROTECTED_BIT = 0x00000800, + VK_IMAGE_CREATE_DISJOINT_BIT = 0x00000200, + VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT = 0x00001000, + 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, + VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR = VK_IMAGE_CREATE_EXTENDED_USAGE_BIT, + VK_IMAGE_CREATE_DISJOINT_BIT_KHR = VK_IMAGE_CREATE_DISJOINT_BIT, + VK_IMAGE_CREATE_ALIAS_BIT_KHR = VK_IMAGE_CREATE_ALIAS_BIT, + VK_IMAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkImageCreateFlagBits; +typedef VkFlags VkImageCreateFlags; + +typedef enum VkSampleCountFlagBits { + VK_SAMPLE_COUNT_1_BIT = 0x00000001, + VK_SAMPLE_COUNT_2_BIT = 0x00000002, + VK_SAMPLE_COUNT_4_BIT = 0x00000004, + VK_SAMPLE_COUNT_8_BIT = 0x00000008, + VK_SAMPLE_COUNT_16_BIT = 0x00000010, + VK_SAMPLE_COUNT_32_BIT = 0x00000020, + VK_SAMPLE_COUNT_64_BIT = 0x00000040, + VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSampleCountFlagBits; +typedef VkFlags VkSampleCountFlags; + +typedef enum VkQueueFlagBits { + VK_QUEUE_GRAPHICS_BIT = 0x00000001, + VK_QUEUE_COMPUTE_BIT = 0x00000002, + VK_QUEUE_TRANSFER_BIT = 0x00000004, + VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, + VK_QUEUE_PROTECTED_BIT = 0x00000010, + VK_QUEUE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkQueueFlagBits; +typedef VkFlags VkQueueFlags; + +typedef enum VkMemoryPropertyFlagBits { + VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002, + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004, + VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008, + VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010, + VK_MEMORY_PROPERTY_PROTECTED_BIT = 0x00000020, + VK_MEMORY_PROPERTY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkMemoryPropertyFlagBits; +typedef VkFlags VkMemoryPropertyFlags; + +typedef enum VkMemoryHeapFlagBits { + VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001, + VK_MEMORY_HEAP_MULTI_INSTANCE_BIT = 0x00000002, + VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR = VK_MEMORY_HEAP_MULTI_INSTANCE_BIT, + VK_MEMORY_HEAP_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkMemoryHeapFlagBits; +typedef VkFlags VkMemoryHeapFlags; +typedef VkFlags VkDeviceCreateFlags; + +typedef enum VkDeviceQueueCreateFlagBits { + VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT = 0x00000001, + VK_DEVICE_QUEUE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkDeviceQueueCreateFlagBits; +typedef VkFlags VkDeviceQueueCreateFlags; + +typedef enum VkPipelineStageFlagBits { + VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, + VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, + VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, + VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, + VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, + VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, + VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, + VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, + VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, + VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, + VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, + VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, + VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000, + VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, + VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, + VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, + VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000, + VK_PIPELINE_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkPipelineStageFlagBits; +typedef VkFlags VkPipelineStageFlags; +typedef VkFlags VkMemoryMapFlags; + +typedef enum VkImageAspectFlagBits { + VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001, + VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002, + VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004, + VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008, + VK_IMAGE_ASPECT_PLANE_0_BIT = 0x00000010, + VK_IMAGE_ASPECT_PLANE_1_BIT = 0x00000020, + VK_IMAGE_ASPECT_PLANE_2_BIT = 0x00000040, + VK_IMAGE_ASPECT_PLANE_0_BIT_KHR = VK_IMAGE_ASPECT_PLANE_0_BIT, + VK_IMAGE_ASPECT_PLANE_1_BIT_KHR = VK_IMAGE_ASPECT_PLANE_1_BIT, + VK_IMAGE_ASPECT_PLANE_2_BIT_KHR = VK_IMAGE_ASPECT_PLANE_2_BIT, + VK_IMAGE_ASPECT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkImageAspectFlagBits; +typedef VkFlags VkImageAspectFlags; + +typedef enum VkSparseImageFormatFlagBits { + VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, + VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT = 0x00000002, + VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, + VK_SPARSE_IMAGE_FORMAT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSparseImageFormatFlagBits; +typedef VkFlags VkSparseImageFormatFlags; + +typedef enum VkSparseMemoryBindFlagBits { + VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001, + VK_SPARSE_MEMORY_BIND_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSparseMemoryBindFlagBits; +typedef VkFlags VkSparseMemoryBindFlags; + +typedef enum VkFenceCreateFlagBits { + VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001, + VK_FENCE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkFenceCreateFlagBits; +typedef VkFlags VkFenceCreateFlags; +typedef VkFlags VkSemaphoreCreateFlags; +typedef VkFlags VkEventCreateFlags; +typedef VkFlags VkQueryPoolCreateFlags; + +typedef enum VkQueryPipelineStatisticFlagBits { + VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, + VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, + VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, + VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, + VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, + VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, + VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, + VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, + VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, + VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, + VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, + VK_QUERY_PIPELINE_STATISTIC_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkQueryPipelineStatisticFlagBits; +typedef VkFlags VkQueryPipelineStatisticFlags; + +typedef enum VkQueryResultFlagBits { + VK_QUERY_RESULT_64_BIT = 0x00000001, + VK_QUERY_RESULT_WAIT_BIT = 0x00000002, + VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, + VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, + VK_QUERY_RESULT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkQueryResultFlagBits; +typedef VkFlags VkQueryResultFlags; + +typedef enum VkBufferCreateFlagBits { + VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, + VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, + VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, + VK_BUFFER_CREATE_PROTECTED_BIT = 0x00000008, + VK_BUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkBufferCreateFlagBits; +typedef VkFlags VkBufferCreateFlags; + +typedef enum VkBufferUsageFlagBits { + VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, + VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, + VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, + VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, + VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, + VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, + VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, + VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, + VK_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkBufferUsageFlagBits; +typedef VkFlags VkBufferUsageFlags; +typedef VkFlags VkBufferViewCreateFlags; +typedef VkFlags VkImageViewCreateFlags; +typedef VkFlags VkShaderModuleCreateFlags; +typedef VkFlags VkPipelineCacheCreateFlags; + +typedef enum VkPipelineCreateFlagBits { + VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001, + VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002, + VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004, + VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT = 0x00000008, + VK_PIPELINE_CREATE_DISPATCH_BASE = 0x00000010, + VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR = VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT, + VK_PIPELINE_CREATE_DISPATCH_BASE_KHR = VK_PIPELINE_CREATE_DISPATCH_BASE, + VK_PIPELINE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkPipelineCreateFlagBits; +typedef VkFlags VkPipelineCreateFlags; +typedef VkFlags VkPipelineShaderStageCreateFlags; + +typedef enum VkShaderStageFlagBits { + VK_SHADER_STAGE_VERTEX_BIT = 0x00000001, + VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002, + VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004, + VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008, + VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010, + VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020, + VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F, + VK_SHADER_STAGE_ALL = 0x7FFFFFFF, + VK_SHADER_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkShaderStageFlagBits; +typedef VkFlags VkPipelineVertexInputStateCreateFlags; +typedef VkFlags VkPipelineInputAssemblyStateCreateFlags; +typedef VkFlags VkPipelineTessellationStateCreateFlags; +typedef VkFlags VkPipelineViewportStateCreateFlags; +typedef VkFlags VkPipelineRasterizationStateCreateFlags; + +typedef enum VkCullModeFlagBits { + VK_CULL_MODE_NONE = 0, + VK_CULL_MODE_FRONT_BIT = 0x00000001, + VK_CULL_MODE_BACK_BIT = 0x00000002, + VK_CULL_MODE_FRONT_AND_BACK = 0x00000003, + VK_CULL_MODE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkCullModeFlagBits; +typedef VkFlags VkCullModeFlags; +typedef VkFlags VkPipelineMultisampleStateCreateFlags; +typedef VkFlags VkPipelineDepthStencilStateCreateFlags; +typedef VkFlags VkPipelineColorBlendStateCreateFlags; + +typedef enum VkColorComponentFlagBits { + VK_COLOR_COMPONENT_R_BIT = 0x00000001, + VK_COLOR_COMPONENT_G_BIT = 0x00000002, + VK_COLOR_COMPONENT_B_BIT = 0x00000004, + VK_COLOR_COMPONENT_A_BIT = 0x00000008, + VK_COLOR_COMPONENT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkColorComponentFlagBits; +typedef VkFlags VkColorComponentFlags; +typedef VkFlags VkPipelineDynamicStateCreateFlags; +typedef VkFlags VkPipelineLayoutCreateFlags; +typedef VkFlags VkShaderStageFlags; +typedef VkFlags VkSamplerCreateFlags; + +typedef enum VkDescriptorSetLayoutCreateFlagBits { + VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR = 0x00000001, + VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT = 0x00000002, + VK_DESCRIPTOR_SET_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkDescriptorSetLayoutCreateFlagBits; +typedef VkFlags VkDescriptorSetLayoutCreateFlags; + +typedef enum VkDescriptorPoolCreateFlagBits { + VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001, + VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT = 0x00000002, + VK_DESCRIPTOR_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkDescriptorPoolCreateFlagBits; +typedef VkFlags VkDescriptorPoolCreateFlags; +typedef VkFlags VkDescriptorPoolResetFlags; +typedef VkFlags VkFramebufferCreateFlags; +typedef VkFlags VkRenderPassCreateFlags; + +typedef enum VkAttachmentDescriptionFlagBits { + VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT = 0x00000001, + VK_ATTACHMENT_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkAttachmentDescriptionFlagBits; +typedef VkFlags VkAttachmentDescriptionFlags; + +typedef enum VkSubpassDescriptionFlagBits { + VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX = 0x00000001, + VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX = 0x00000002, + VK_SUBPASS_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSubpassDescriptionFlagBits; +typedef VkFlags VkSubpassDescriptionFlags; + +typedef enum VkAccessFlagBits { + VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001, + VK_ACCESS_INDEX_READ_BIT = 0x00000002, + VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004, + VK_ACCESS_UNIFORM_READ_BIT = 0x00000008, + VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010, + VK_ACCESS_SHADER_READ_BIT = 0x00000020, + VK_ACCESS_SHADER_WRITE_BIT = 0x00000040, + VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080, + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100, + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200, + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400, + VK_ACCESS_TRANSFER_READ_BIT = 0x00000800, + VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000, + VK_ACCESS_HOST_READ_BIT = 0x00002000, + VK_ACCESS_HOST_WRITE_BIT = 0x00004000, + VK_ACCESS_MEMORY_READ_BIT = 0x00008000, + VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000, + VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000, + VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000, + VK_ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT = 0x00080000, + VK_ACCESS_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkAccessFlagBits; +typedef VkFlags VkAccessFlags; + +typedef enum VkDependencyFlagBits { + VK_DEPENDENCY_BY_REGION_BIT = 0x00000001, + VK_DEPENDENCY_DEVICE_GROUP_BIT = 0x00000004, + VK_DEPENDENCY_VIEW_LOCAL_BIT = 0x00000002, + VK_DEPENDENCY_VIEW_LOCAL_BIT_KHR = VK_DEPENDENCY_VIEW_LOCAL_BIT, + VK_DEPENDENCY_DEVICE_GROUP_BIT_KHR = VK_DEPENDENCY_DEVICE_GROUP_BIT, + VK_DEPENDENCY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkDependencyFlagBits; +typedef VkFlags VkDependencyFlags; + +typedef enum VkCommandPoolCreateFlagBits { + VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, + VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, + VK_COMMAND_POOL_CREATE_PROTECTED_BIT = 0x00000004, + VK_COMMAND_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkCommandPoolCreateFlagBits; +typedef VkFlags VkCommandPoolCreateFlags; + +typedef enum VkCommandPoolResetFlagBits { + VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, + VK_COMMAND_POOL_RESET_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkCommandPoolResetFlagBits; +typedef VkFlags VkCommandPoolResetFlags; + +typedef enum VkCommandBufferUsageFlagBits { + VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001, + VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002, + VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004, + VK_COMMAND_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkCommandBufferUsageFlagBits; +typedef VkFlags VkCommandBufferUsageFlags; + +typedef enum VkQueryControlFlagBits { + VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001, + VK_QUERY_CONTROL_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkQueryControlFlagBits; +typedef VkFlags VkQueryControlFlags; + +typedef enum VkCommandBufferResetFlagBits { + VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, + VK_COMMAND_BUFFER_RESET_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkCommandBufferResetFlagBits; +typedef VkFlags VkCommandBufferResetFlags; + +typedef enum VkStencilFaceFlagBits { + VK_STENCIL_FACE_FRONT_BIT = 0x00000001, + VK_STENCIL_FACE_BACK_BIT = 0x00000002, + VK_STENCIL_FRONT_AND_BACK = 0x00000003, + VK_STENCIL_FACE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkStencilFaceFlagBits; +typedef VkFlags VkStencilFaceFlags; + +typedef struct VkApplicationInfo { + VkStructureType sType; + const void* pNext; + const char* pApplicationName; + uint32_t applicationVersion; + const char* pEngineName; + uint32_t engineVersion; + uint32_t apiVersion; +} VkApplicationInfo; + +typedef struct VkInstanceCreateInfo { + VkStructureType sType; + const void* pNext; + VkInstanceCreateFlags flags; + const VkApplicationInfo* pApplicationInfo; + uint32_t enabledLayerCount; + const char* const* ppEnabledLayerNames; + uint32_t enabledExtensionCount; + const char* const* ppEnabledExtensionNames; +} VkInstanceCreateInfo; + +typedef void* (VKAPI_PTR *PFN_vkAllocationFunction)( + void* pUserData, + size_t size, + size_t alignment, + VkSystemAllocationScope allocationScope); + +typedef void* (VKAPI_PTR *PFN_vkReallocationFunction)( + void* pUserData, + void* pOriginal, + size_t size, + size_t alignment, + VkSystemAllocationScope allocationScope); + +typedef void (VKAPI_PTR *PFN_vkFreeFunction)( + void* pUserData, + void* pMemory); + +typedef void (VKAPI_PTR *PFN_vkInternalAllocationNotification)( + void* pUserData, + size_t size, + VkInternalAllocationType allocationType, + VkSystemAllocationScope allocationScope); + +typedef void (VKAPI_PTR *PFN_vkInternalFreeNotification)( + void* pUserData, + size_t size, + VkInternalAllocationType allocationType, + VkSystemAllocationScope allocationScope); + +typedef struct VkAllocationCallbacks { + void* pUserData; + PFN_vkAllocationFunction pfnAllocation; + PFN_vkReallocationFunction pfnReallocation; + PFN_vkFreeFunction pfnFree; + PFN_vkInternalAllocationNotification pfnInternalAllocation; + PFN_vkInternalFreeNotification pfnInternalFree; +} VkAllocationCallbacks; + +typedef struct VkPhysicalDeviceFeatures { + VkBool32 robustBufferAccess; + VkBool32 fullDrawIndexUint32; + VkBool32 imageCubeArray; + VkBool32 independentBlend; + VkBool32 geometryShader; + VkBool32 tessellationShader; + VkBool32 sampleRateShading; + VkBool32 dualSrcBlend; + VkBool32 logicOp; + VkBool32 multiDrawIndirect; + VkBool32 drawIndirectFirstInstance; + VkBool32 depthClamp; + VkBool32 depthBiasClamp; + VkBool32 fillModeNonSolid; + VkBool32 depthBounds; + VkBool32 wideLines; + VkBool32 largePoints; + VkBool32 alphaToOne; + VkBool32 multiViewport; + VkBool32 samplerAnisotropy; + VkBool32 textureCompressionETC2; + VkBool32 textureCompressionASTC_LDR; + VkBool32 textureCompressionBC; + VkBool32 occlusionQueryPrecise; + VkBool32 pipelineStatisticsQuery; + VkBool32 vertexPipelineStoresAndAtomics; + VkBool32 fragmentStoresAndAtomics; + VkBool32 shaderTessellationAndGeometryPointSize; + VkBool32 shaderImageGatherExtended; + VkBool32 shaderStorageImageExtendedFormats; + VkBool32 shaderStorageImageMultisample; + VkBool32 shaderStorageImageReadWithoutFormat; + VkBool32 shaderStorageImageWriteWithoutFormat; + VkBool32 shaderUniformBufferArrayDynamicIndexing; + VkBool32 shaderSampledImageArrayDynamicIndexing; + VkBool32 shaderStorageBufferArrayDynamicIndexing; + VkBool32 shaderStorageImageArrayDynamicIndexing; + VkBool32 shaderClipDistance; + VkBool32 shaderCullDistance; + VkBool32 shaderFloat64; + VkBool32 shaderInt64; + VkBool32 shaderInt16; + VkBool32 shaderResourceResidency; + VkBool32 shaderResourceMinLod; + VkBool32 sparseBinding; + VkBool32 sparseResidencyBuffer; + VkBool32 sparseResidencyImage2D; + VkBool32 sparseResidencyImage3D; + VkBool32 sparseResidency2Samples; + VkBool32 sparseResidency4Samples; + VkBool32 sparseResidency8Samples; + VkBool32 sparseResidency16Samples; + VkBool32 sparseResidencyAliased; + VkBool32 variableMultisampleRate; + VkBool32 inheritedQueries; +} VkPhysicalDeviceFeatures; + +typedef struct VkFormatProperties { + VkFormatFeatureFlags linearTilingFeatures; + VkFormatFeatureFlags optimalTilingFeatures; + VkFormatFeatureFlags bufferFeatures; +} VkFormatProperties; + +typedef struct VkExtent3D { + uint32_t width; + uint32_t height; + uint32_t depth; +} VkExtent3D; + +typedef struct VkImageFormatProperties { + VkExtent3D maxExtent; + uint32_t maxMipLevels; + uint32_t maxArrayLayers; + VkSampleCountFlags sampleCounts; + VkDeviceSize maxResourceSize; +} VkImageFormatProperties; + +typedef struct VkPhysicalDeviceLimits { + 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; + VkDeviceSize bufferImageGranularity; + VkDeviceSize 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; + uint32_t maxComputeWorkGroupCount[3]; + uint32_t maxComputeWorkGroupInvocations; + uint32_t maxComputeWorkGroupSize[3]; + uint32_t subPixelPrecisionBits; + uint32_t subTexelPrecisionBits; + uint32_t mipmapPrecisionBits; + uint32_t maxDrawIndexedIndexValue; + uint32_t maxDrawIndirectCount; + float maxSamplerLodBias; + float maxSamplerAnisotropy; + uint32_t maxViewports; + uint32_t maxViewportDimensions[2]; + float viewportBoundsRange[2]; + uint32_t viewportSubPixelBits; + size_t minMemoryMapAlignment; + VkDeviceSize minTexelBufferOffsetAlignment; + VkDeviceSize minUniformBufferOffsetAlignment; + VkDeviceSize 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; + VkSampleCountFlags framebufferColorSampleCounts; + VkSampleCountFlags framebufferDepthSampleCounts; + VkSampleCountFlags framebufferStencilSampleCounts; + VkSampleCountFlags framebufferNoAttachmentsSampleCounts; + uint32_t maxColorAttachments; + VkSampleCountFlags sampledImageColorSampleCounts; + VkSampleCountFlags sampledImageIntegerSampleCounts; + VkSampleCountFlags sampledImageDepthSampleCounts; + VkSampleCountFlags sampledImageStencilSampleCounts; + VkSampleCountFlags storageImageSampleCounts; + uint32_t maxSampleMaskWords; + VkBool32 timestampComputeAndGraphics; + float timestampPeriod; + uint32_t maxClipDistances; + uint32_t maxCullDistances; + uint32_t maxCombinedClipAndCullDistances; + uint32_t discreteQueuePriorities; + float pointSizeRange[2]; + float lineWidthRange[2]; + float pointSizeGranularity; + float lineWidthGranularity; + VkBool32 strictLines; + VkBool32 standardSampleLocations; + VkDeviceSize optimalBufferCopyOffsetAlignment; + VkDeviceSize optimalBufferCopyRowPitchAlignment; + VkDeviceSize nonCoherentAtomSize; +} VkPhysicalDeviceLimits; + +typedef struct VkPhysicalDeviceSparseProperties { + VkBool32 residencyStandard2DBlockShape; + VkBool32 residencyStandard2DMultisampleBlockShape; + VkBool32 residencyStandard3DBlockShape; + VkBool32 residencyAlignedMipSize; + VkBool32 residencyNonResidentStrict; +} VkPhysicalDeviceSparseProperties; + +typedef struct VkPhysicalDeviceProperties { + uint32_t apiVersion; + uint32_t driverVersion; + uint32_t vendorID; + uint32_t deviceID; + VkPhysicalDeviceType deviceType; + char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; + uint8_t pipelineCacheUUID[VK_UUID_SIZE]; + VkPhysicalDeviceLimits limits; + VkPhysicalDeviceSparseProperties sparseProperties; +} VkPhysicalDeviceProperties; + +typedef struct VkQueueFamilyProperties { + VkQueueFlags queueFlags; + uint32_t queueCount; + uint32_t timestampValidBits; + VkExtent3D minImageTransferGranularity; +} VkQueueFamilyProperties; + +typedef struct VkMemoryType { + VkMemoryPropertyFlags propertyFlags; + uint32_t heapIndex; +} VkMemoryType; + +typedef struct VkMemoryHeap { + VkDeviceSize size; + VkMemoryHeapFlags flags; +} VkMemoryHeap; + +typedef struct VkPhysicalDeviceMemoryProperties { + uint32_t memoryTypeCount; + VkMemoryType memoryTypes[VK_MAX_MEMORY_TYPES]; + uint32_t memoryHeapCount; + VkMemoryHeap memoryHeaps[VK_MAX_MEMORY_HEAPS]; +} VkPhysicalDeviceMemoryProperties; + +typedef void (VKAPI_PTR *PFN_vkVoidFunction)(void); +typedef struct VkDeviceQueueCreateInfo { + VkStructureType sType; + const void* pNext; + VkDeviceQueueCreateFlags flags; + uint32_t queueFamilyIndex; + uint32_t queueCount; + const float* pQueuePriorities; +} VkDeviceQueueCreateInfo; + +typedef struct VkDeviceCreateInfo { + VkStructureType sType; + const void* pNext; + VkDeviceCreateFlags flags; + uint32_t queueCreateInfoCount; + const VkDeviceQueueCreateInfo* pQueueCreateInfos; + uint32_t enabledLayerCount; + const char* const* ppEnabledLayerNames; + uint32_t enabledExtensionCount; + const char* const* ppEnabledExtensionNames; + const VkPhysicalDeviceFeatures* pEnabledFeatures; +} VkDeviceCreateInfo; + +typedef struct VkExtensionProperties { + char extensionName[VK_MAX_EXTENSION_NAME_SIZE]; + uint32_t specVersion; +} VkExtensionProperties; + +typedef struct VkLayerProperties { + char layerName[VK_MAX_EXTENSION_NAME_SIZE]; + uint32_t specVersion; + uint32_t implementationVersion; + char description[VK_MAX_DESCRIPTION_SIZE]; +} VkLayerProperties; + +typedef struct VkSubmitInfo { + VkStructureType sType; + const void* pNext; + uint32_t waitSemaphoreCount; + const VkSemaphore* pWaitSemaphores; + const VkPipelineStageFlags* pWaitDstStageMask; + uint32_t commandBufferCount; + const VkCommandBuffer* pCommandBuffers; + uint32_t signalSemaphoreCount; + const VkSemaphore* pSignalSemaphores; +} VkSubmitInfo; + +typedef struct VkMemoryAllocateInfo { + VkStructureType sType; + const void* pNext; + VkDeviceSize allocationSize; + uint32_t memoryTypeIndex; +} VkMemoryAllocateInfo; + +typedef struct VkMappedMemoryRange { + VkStructureType sType; + const void* pNext; + VkDeviceMemory memory; + VkDeviceSize offset; + VkDeviceSize size; +} VkMappedMemoryRange; + +typedef struct VkMemoryRequirements { + VkDeviceSize size; + VkDeviceSize alignment; + uint32_t memoryTypeBits; +} VkMemoryRequirements; + +typedef struct VkSparseImageFormatProperties { + VkImageAspectFlags aspectMask; + VkExtent3D imageGranularity; + VkSparseImageFormatFlags flags; +} VkSparseImageFormatProperties; + +typedef struct VkSparseImageMemoryRequirements { + VkSparseImageFormatProperties formatProperties; + uint32_t imageMipTailFirstLod; + VkDeviceSize imageMipTailSize; + VkDeviceSize imageMipTailOffset; + VkDeviceSize imageMipTailStride; +} VkSparseImageMemoryRequirements; + +typedef struct VkSparseMemoryBind { + VkDeviceSize resourceOffset; + VkDeviceSize size; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; + VkSparseMemoryBindFlags flags; +} VkSparseMemoryBind; + +typedef struct VkSparseBufferMemoryBindInfo { + VkBuffer buffer; + uint32_t bindCount; + const VkSparseMemoryBind* pBinds; +} VkSparseBufferMemoryBindInfo; + +typedef struct VkSparseImageOpaqueMemoryBindInfo { + VkImage image; + uint32_t bindCount; + const VkSparseMemoryBind* pBinds; +} VkSparseImageOpaqueMemoryBindInfo; + +typedef struct VkImageSubresource { + VkImageAspectFlags aspectMask; + uint32_t mipLevel; + uint32_t arrayLayer; +} VkImageSubresource; + +typedef struct VkOffset3D { + int32_t x; + int32_t y; + int32_t z; +} VkOffset3D; + +typedef struct VkSparseImageMemoryBind { + VkImageSubresource subresource; + VkOffset3D offset; + VkExtent3D extent; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; + VkSparseMemoryBindFlags flags; +} VkSparseImageMemoryBind; + +typedef struct VkSparseImageMemoryBindInfo { + VkImage image; + uint32_t bindCount; + const VkSparseImageMemoryBind* pBinds; +} VkSparseImageMemoryBindInfo; + +typedef struct VkBindSparseInfo { + VkStructureType sType; + const void* pNext; + uint32_t waitSemaphoreCount; + const VkSemaphore* pWaitSemaphores; + uint32_t bufferBindCount; + const VkSparseBufferMemoryBindInfo* pBufferBinds; + uint32_t imageOpaqueBindCount; + const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds; + uint32_t imageBindCount; + const VkSparseImageMemoryBindInfo* pImageBinds; + uint32_t signalSemaphoreCount; + const VkSemaphore* pSignalSemaphores; +} VkBindSparseInfo; + +typedef struct VkFenceCreateInfo { + VkStructureType sType; + const void* pNext; + VkFenceCreateFlags flags; +} VkFenceCreateInfo; + +typedef struct VkSemaphoreCreateInfo { + VkStructureType sType; + const void* pNext; + VkSemaphoreCreateFlags flags; +} VkSemaphoreCreateInfo; + +typedef struct VkEventCreateInfo { + VkStructureType sType; + const void* pNext; + VkEventCreateFlags flags; +} VkEventCreateInfo; + +typedef struct VkQueryPoolCreateInfo { + VkStructureType sType; + const void* pNext; + VkQueryPoolCreateFlags flags; + VkQueryType queryType; + uint32_t queryCount; + VkQueryPipelineStatisticFlags pipelineStatistics; +} VkQueryPoolCreateInfo; + +typedef struct VkBufferCreateInfo { + VkStructureType sType; + const void* pNext; + VkBufferCreateFlags flags; + VkDeviceSize size; + VkBufferUsageFlags usage; + VkSharingMode sharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t* pQueueFamilyIndices; +} VkBufferCreateInfo; + +typedef struct VkBufferViewCreateInfo { + VkStructureType sType; + const void* pNext; + VkBufferViewCreateFlags flags; + VkBuffer buffer; + VkFormat format; + VkDeviceSize offset; + VkDeviceSize range; +} VkBufferViewCreateInfo; + +typedef struct VkImageCreateInfo { + VkStructureType sType; + const void* pNext; + VkImageCreateFlags flags; + VkImageType imageType; + VkFormat format; + VkExtent3D extent; + uint32_t mipLevels; + uint32_t arrayLayers; + VkSampleCountFlagBits samples; + VkImageTiling tiling; + VkImageUsageFlags usage; + VkSharingMode sharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t* pQueueFamilyIndices; + VkImageLayout initialLayout; +} VkImageCreateInfo; + +typedef struct VkSubresourceLayout { + VkDeviceSize offset; + VkDeviceSize size; + VkDeviceSize rowPitch; + VkDeviceSize arrayPitch; + VkDeviceSize depthPitch; +} VkSubresourceLayout; + +typedef struct VkComponentMapping { + VkComponentSwizzle r; + VkComponentSwizzle g; + VkComponentSwizzle b; + VkComponentSwizzle a; +} VkComponentMapping; + +typedef struct VkImageSubresourceRange { + VkImageAspectFlags aspectMask; + uint32_t baseMipLevel; + uint32_t levelCount; + uint32_t baseArrayLayer; + uint32_t layerCount; +} VkImageSubresourceRange; + +typedef struct VkImageViewCreateInfo { + VkStructureType sType; + const void* pNext; + VkImageViewCreateFlags flags; + VkImage image; + VkImageViewType viewType; + VkFormat format; + VkComponentMapping components; + VkImageSubresourceRange subresourceRange; +} VkImageViewCreateInfo; + +typedef struct VkShaderModuleCreateInfo { + VkStructureType sType; + const void* pNext; + VkShaderModuleCreateFlags flags; + size_t codeSize; + const uint32_t* pCode; +} VkShaderModuleCreateInfo; + +typedef struct VkPipelineCacheCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineCacheCreateFlags flags; + size_t initialDataSize; + const void* pInitialData; +} VkPipelineCacheCreateInfo; + +typedef struct VkSpecializationMapEntry { + uint32_t constantID; + uint32_t offset; + size_t size; +} VkSpecializationMapEntry; + +typedef struct VkSpecializationInfo { + uint32_t mapEntryCount; + const VkSpecializationMapEntry* pMapEntries; + size_t dataSize; + const void* pData; +} VkSpecializationInfo; + +typedef struct VkPipelineShaderStageCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineShaderStageCreateFlags flags; + VkShaderStageFlagBits stage; + VkShaderModule module; + const char* pName; + const VkSpecializationInfo* pSpecializationInfo; +} VkPipelineShaderStageCreateInfo; + +typedef struct VkVertexInputBindingDescription { + uint32_t binding; + uint32_t stride; + VkVertexInputRate inputRate; +} VkVertexInputBindingDescription; + +typedef struct VkVertexInputAttributeDescription { + uint32_t location; + uint32_t binding; + VkFormat format; + uint32_t offset; +} VkVertexInputAttributeDescription; + +typedef struct VkPipelineVertexInputStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineVertexInputStateCreateFlags flags; + uint32_t vertexBindingDescriptionCount; + const VkVertexInputBindingDescription* pVertexBindingDescriptions; + uint32_t vertexAttributeDescriptionCount; + const VkVertexInputAttributeDescription* pVertexAttributeDescriptions; +} VkPipelineVertexInputStateCreateInfo; + +typedef struct VkPipelineInputAssemblyStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineInputAssemblyStateCreateFlags flags; + VkPrimitiveTopology topology; + VkBool32 primitiveRestartEnable; +} VkPipelineInputAssemblyStateCreateInfo; + +typedef struct VkPipelineTessellationStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineTessellationStateCreateFlags flags; + uint32_t patchControlPoints; +} VkPipelineTessellationStateCreateInfo; + +typedef struct VkViewport { + float x; + float y; + float width; + float height; + float minDepth; + float maxDepth; +} VkViewport; + +typedef struct VkOffset2D { + int32_t x; + int32_t y; +} VkOffset2D; + +typedef struct VkExtent2D { + uint32_t width; + uint32_t height; +} VkExtent2D; + +typedef struct VkRect2D { + VkOffset2D offset; + VkExtent2D extent; +} VkRect2D; + +typedef struct VkPipelineViewportStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineViewportStateCreateFlags flags; + uint32_t viewportCount; + const VkViewport* pViewports; + uint32_t scissorCount; + const VkRect2D* pScissors; +} VkPipelineViewportStateCreateInfo; + +typedef struct VkPipelineRasterizationStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineRasterizationStateCreateFlags flags; + VkBool32 depthClampEnable; + VkBool32 rasterizerDiscardEnable; + VkPolygonMode polygonMode; + VkCullModeFlags cullMode; + VkFrontFace frontFace; + VkBool32 depthBiasEnable; + float depthBiasConstantFactor; + float depthBiasClamp; + float depthBiasSlopeFactor; + float lineWidth; +} VkPipelineRasterizationStateCreateInfo; + +typedef struct VkPipelineMultisampleStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineMultisampleStateCreateFlags flags; + VkSampleCountFlagBits rasterizationSamples; + VkBool32 sampleShadingEnable; + float minSampleShading; + const VkSampleMask* pSampleMask; + VkBool32 alphaToCoverageEnable; + VkBool32 alphaToOneEnable; +} VkPipelineMultisampleStateCreateInfo; + +typedef struct VkStencilOpState { + VkStencilOp failOp; + VkStencilOp passOp; + VkStencilOp depthFailOp; + VkCompareOp compareOp; + uint32_t compareMask; + uint32_t writeMask; + uint32_t reference; +} VkStencilOpState; + +typedef struct VkPipelineDepthStencilStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineDepthStencilStateCreateFlags flags; + VkBool32 depthTestEnable; + VkBool32 depthWriteEnable; + VkCompareOp depthCompareOp; + VkBool32 depthBoundsTestEnable; + VkBool32 stencilTestEnable; + VkStencilOpState front; + VkStencilOpState back; + float minDepthBounds; + float maxDepthBounds; +} VkPipelineDepthStencilStateCreateInfo; + +typedef struct VkPipelineColorBlendAttachmentState { + VkBool32 blendEnable; + VkBlendFactor srcColorBlendFactor; + VkBlendFactor dstColorBlendFactor; + VkBlendOp colorBlendOp; + VkBlendFactor srcAlphaBlendFactor; + VkBlendFactor dstAlphaBlendFactor; + VkBlendOp alphaBlendOp; + VkColorComponentFlags colorWriteMask; +} VkPipelineColorBlendAttachmentState; + +typedef struct VkPipelineColorBlendStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineColorBlendStateCreateFlags flags; + VkBool32 logicOpEnable; + VkLogicOp logicOp; + uint32_t attachmentCount; + const VkPipelineColorBlendAttachmentState* pAttachments; + float blendConstants[4]; +} VkPipelineColorBlendStateCreateInfo; + +typedef struct VkPipelineDynamicStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineDynamicStateCreateFlags flags; + uint32_t dynamicStateCount; + const VkDynamicState* pDynamicStates; +} VkPipelineDynamicStateCreateInfo; + +typedef struct VkGraphicsPipelineCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineCreateFlags flags; + uint32_t stageCount; + const VkPipelineShaderStageCreateInfo* pStages; + const VkPipelineVertexInputStateCreateInfo* pVertexInputState; + const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState; + const VkPipelineTessellationStateCreateInfo* pTessellationState; + const VkPipelineViewportStateCreateInfo* pViewportState; + const VkPipelineRasterizationStateCreateInfo* pRasterizationState; + const VkPipelineMultisampleStateCreateInfo* pMultisampleState; + const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState; + const VkPipelineColorBlendStateCreateInfo* pColorBlendState; + const VkPipelineDynamicStateCreateInfo* pDynamicState; + VkPipelineLayout layout; + VkRenderPass renderPass; + uint32_t subpass; + VkPipeline basePipelineHandle; + int32_t basePipelineIndex; +} VkGraphicsPipelineCreateInfo; + +typedef struct VkComputePipelineCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineCreateFlags flags; + VkPipelineShaderStageCreateInfo stage; + VkPipelineLayout layout; + VkPipeline basePipelineHandle; + int32_t basePipelineIndex; +} VkComputePipelineCreateInfo; + +typedef struct VkPushConstantRange { + VkShaderStageFlags stageFlags; + uint32_t offset; + uint32_t size; +} VkPushConstantRange; + +typedef struct VkPipelineLayoutCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineLayoutCreateFlags flags; + uint32_t setLayoutCount; + const VkDescriptorSetLayout* pSetLayouts; + uint32_t pushConstantRangeCount; + const VkPushConstantRange* pPushConstantRanges; +} VkPipelineLayoutCreateInfo; + +typedef struct VkSamplerCreateInfo { + VkStructureType sType; + const void* pNext; + VkSamplerCreateFlags flags; + VkFilter magFilter; + VkFilter minFilter; + VkSamplerMipmapMode mipmapMode; + VkSamplerAddressMode addressModeU; + VkSamplerAddressMode addressModeV; + VkSamplerAddressMode addressModeW; + float mipLodBias; + VkBool32 anisotropyEnable; + float maxAnisotropy; + VkBool32 compareEnable; + VkCompareOp compareOp; + float minLod; + float maxLod; + VkBorderColor borderColor; + VkBool32 unnormalizedCoordinates; +} VkSamplerCreateInfo; + +typedef struct VkDescriptorSetLayoutBinding { + uint32_t binding; + VkDescriptorType descriptorType; + uint32_t descriptorCount; + VkShaderStageFlags stageFlags; + const VkSampler* pImmutableSamplers; +} VkDescriptorSetLayoutBinding; + +typedef struct VkDescriptorSetLayoutCreateInfo { + VkStructureType sType; + const void* pNext; + VkDescriptorSetLayoutCreateFlags flags; + uint32_t bindingCount; + const VkDescriptorSetLayoutBinding* pBindings; +} VkDescriptorSetLayoutCreateInfo; + +typedef struct VkDescriptorPoolSize { + VkDescriptorType type; + uint32_t descriptorCount; +} VkDescriptorPoolSize; + +typedef struct VkDescriptorPoolCreateInfo { + VkStructureType sType; + const void* pNext; + VkDescriptorPoolCreateFlags flags; + uint32_t maxSets; + uint32_t poolSizeCount; + const VkDescriptorPoolSize* pPoolSizes; +} VkDescriptorPoolCreateInfo; + +typedef struct VkDescriptorSetAllocateInfo { + VkStructureType sType; + const void* pNext; + VkDescriptorPool descriptorPool; + uint32_t descriptorSetCount; + const VkDescriptorSetLayout* pSetLayouts; +} VkDescriptorSetAllocateInfo; + +typedef struct VkDescriptorImageInfo { + VkSampler sampler; + VkImageView imageView; + VkImageLayout imageLayout; +} VkDescriptorImageInfo; + +typedef struct VkDescriptorBufferInfo { + VkBuffer buffer; + VkDeviceSize offset; + VkDeviceSize range; +} VkDescriptorBufferInfo; + +typedef struct VkWriteDescriptorSet { + VkStructureType sType; + const void* pNext; + VkDescriptorSet dstSet; + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + VkDescriptorType descriptorType; + const VkDescriptorImageInfo* pImageInfo; + const VkDescriptorBufferInfo* pBufferInfo; + const VkBufferView* pTexelBufferView; +} VkWriteDescriptorSet; + +typedef struct VkCopyDescriptorSet { + VkStructureType sType; + const void* pNext; + VkDescriptorSet srcSet; + uint32_t srcBinding; + uint32_t srcArrayElement; + VkDescriptorSet dstSet; + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; +} VkCopyDescriptorSet; + +typedef struct VkFramebufferCreateInfo { + VkStructureType sType; + const void* pNext; + VkFramebufferCreateFlags flags; + VkRenderPass renderPass; + uint32_t attachmentCount; + const VkImageView* pAttachments; + uint32_t width; + uint32_t height; + uint32_t layers; +} VkFramebufferCreateInfo; + +typedef struct VkAttachmentDescription { + VkAttachmentDescriptionFlags flags; + VkFormat format; + VkSampleCountFlagBits samples; + VkAttachmentLoadOp loadOp; + VkAttachmentStoreOp storeOp; + VkAttachmentLoadOp stencilLoadOp; + VkAttachmentStoreOp stencilStoreOp; + VkImageLayout initialLayout; + VkImageLayout finalLayout; +} VkAttachmentDescription; + +typedef struct VkAttachmentReference { + uint32_t attachment; + VkImageLayout layout; +} VkAttachmentReference; + +typedef struct VkSubpassDescription { + VkSubpassDescriptionFlags flags; + VkPipelineBindPoint pipelineBindPoint; + uint32_t inputAttachmentCount; + const VkAttachmentReference* pInputAttachments; + uint32_t colorAttachmentCount; + const VkAttachmentReference* pColorAttachments; + const VkAttachmentReference* pResolveAttachments; + const VkAttachmentReference* pDepthStencilAttachment; + uint32_t preserveAttachmentCount; + const uint32_t* pPreserveAttachments; +} VkSubpassDescription; + +typedef struct VkSubpassDependency { + uint32_t srcSubpass; + uint32_t dstSubpass; + VkPipelineStageFlags srcStageMask; + VkPipelineStageFlags dstStageMask; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; + VkDependencyFlags dependencyFlags; +} VkSubpassDependency; + +typedef struct VkRenderPassCreateInfo { + VkStructureType sType; + const void* pNext; + VkRenderPassCreateFlags flags; + uint32_t attachmentCount; + const VkAttachmentDescription* pAttachments; + uint32_t subpassCount; + const VkSubpassDescription* pSubpasses; + uint32_t dependencyCount; + const VkSubpassDependency* pDependencies; +} VkRenderPassCreateInfo; + +typedef struct VkCommandPoolCreateInfo { + VkStructureType sType; + const void* pNext; + VkCommandPoolCreateFlags flags; + uint32_t queueFamilyIndex; +} VkCommandPoolCreateInfo; + +typedef struct VkCommandBufferAllocateInfo { + VkStructureType sType; + const void* pNext; + VkCommandPool commandPool; + VkCommandBufferLevel level; + uint32_t commandBufferCount; +} VkCommandBufferAllocateInfo; + +typedef struct VkCommandBufferInheritanceInfo { + VkStructureType sType; + const void* pNext; + VkRenderPass renderPass; + uint32_t subpass; + VkFramebuffer framebuffer; + VkBool32 occlusionQueryEnable; + VkQueryControlFlags queryFlags; + VkQueryPipelineStatisticFlags pipelineStatistics; +} VkCommandBufferInheritanceInfo; + +typedef struct VkCommandBufferBeginInfo { + VkStructureType sType; + const void* pNext; + VkCommandBufferUsageFlags flags; + const VkCommandBufferInheritanceInfo* pInheritanceInfo; +} VkCommandBufferBeginInfo; + +typedef struct VkBufferCopy { + VkDeviceSize srcOffset; + VkDeviceSize dstOffset; + VkDeviceSize size; +} VkBufferCopy; + +typedef struct VkImageSubresourceLayers { + VkImageAspectFlags aspectMask; + uint32_t mipLevel; + uint32_t baseArrayLayer; + uint32_t layerCount; +} VkImageSubresourceLayers; + +typedef struct VkImageCopy { + VkImageSubresourceLayers srcSubresource; + VkOffset3D srcOffset; + VkImageSubresourceLayers dstSubresource; + VkOffset3D dstOffset; + VkExtent3D extent; +} VkImageCopy; + +typedef struct VkImageBlit { + VkImageSubresourceLayers srcSubresource; + VkOffset3D srcOffsets[2]; + VkImageSubresourceLayers dstSubresource; + VkOffset3D dstOffsets[2]; +} VkImageBlit; + +typedef struct VkBufferImageCopy { + VkDeviceSize bufferOffset; + uint32_t bufferRowLength; + uint32_t bufferImageHeight; + VkImageSubresourceLayers imageSubresource; + VkOffset3D imageOffset; + VkExtent3D imageExtent; +} VkBufferImageCopy; + +typedef union VkClearColorValue { + float float32[4]; + int32_t int32[4]; + uint32_t uint32[4]; +} VkClearColorValue; + +typedef struct VkClearDepthStencilValue { + float depth; + uint32_t stencil; +} VkClearDepthStencilValue; + +typedef union VkClearValue { + VkClearColorValue color; + VkClearDepthStencilValue depthStencil; +} VkClearValue; + +typedef struct VkClearAttachment { + VkImageAspectFlags aspectMask; + uint32_t colorAttachment; + VkClearValue clearValue; +} VkClearAttachment; + +typedef struct VkClearRect { + VkRect2D rect; + uint32_t baseArrayLayer; + uint32_t layerCount; +} VkClearRect; + +typedef struct VkImageResolve { + VkImageSubresourceLayers srcSubresource; + VkOffset3D srcOffset; + VkImageSubresourceLayers dstSubresource; + VkOffset3D dstOffset; + VkExtent3D extent; +} VkImageResolve; + +typedef struct VkMemoryBarrier { + VkStructureType sType; + const void* pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; +} VkMemoryBarrier; + +typedef struct VkBufferMemoryBarrier { + VkStructureType sType; + const void* pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; + uint32_t srcQueueFamilyIndex; + uint32_t dstQueueFamilyIndex; + VkBuffer buffer; + VkDeviceSize offset; + VkDeviceSize size; +} VkBufferMemoryBarrier; + +typedef struct VkImageMemoryBarrier { + VkStructureType sType; + const void* pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; + VkImageLayout oldLayout; + VkImageLayout newLayout; + uint32_t srcQueueFamilyIndex; + uint32_t dstQueueFamilyIndex; + VkImage image; + VkImageSubresourceRange subresourceRange; +} VkImageMemoryBarrier; + +typedef struct VkRenderPassBeginInfo { + VkStructureType sType; + const void* pNext; + VkRenderPass renderPass; + VkFramebuffer framebuffer; + VkRect2D renderArea; + uint32_t clearValueCount; + const VkClearValue* pClearValues; +} VkRenderPassBeginInfo; + +typedef struct VkDispatchIndirectCommand { + uint32_t x; + uint32_t y; + uint32_t z; +} VkDispatchIndirectCommand; + +typedef struct VkDrawIndexedIndirectCommand { + uint32_t indexCount; + uint32_t instanceCount; + uint32_t firstIndex; + int32_t vertexOffset; + uint32_t firstInstance; +} VkDrawIndexedIndirectCommand; + +typedef struct VkDrawIndirectCommand { + uint32_t vertexCount; + uint32_t instanceCount; + uint32_t firstVertex; + uint32_t firstInstance; +} VkDrawIndirectCommand; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateInstance)(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance); +typedef void (VKAPI_PTR *PFN_vkDestroyInstance)(VkInstance instance, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDevices)(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties)(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMemoryProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties); +typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetInstanceProcAddr)(VkInstance instance, const char* pName); +typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetDeviceProcAddr)(VkDevice device, const char* pName); +typedef VkResult (VKAPI_PTR *PFN_vkCreateDevice)(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice); +typedef void (VKAPI_PTR *PFN_vkDestroyDevice)(VkDevice device, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkEnumerateInstanceExtensionProperties)(const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkEnumerateDeviceExtensionProperties)(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkEnumerateInstanceLayerProperties)(uint32_t* pPropertyCount, VkLayerProperties* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkEnumerateDeviceLayerProperties)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkLayerProperties* pProperties); +typedef void (VKAPI_PTR *PFN_vkGetDeviceQueue)(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue); +typedef VkResult (VKAPI_PTR *PFN_vkQueueSubmit)(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence); +typedef VkResult (VKAPI_PTR *PFN_vkQueueWaitIdle)(VkQueue queue); +typedef VkResult (VKAPI_PTR *PFN_vkDeviceWaitIdle)(VkDevice device); +typedef VkResult (VKAPI_PTR *PFN_vkAllocateMemory)(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory); +typedef void (VKAPI_PTR *PFN_vkFreeMemory)(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkMapMemory)(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData); +typedef void (VKAPI_PTR *PFN_vkUnmapMemory)(VkDevice device, VkDeviceMemory memory); +typedef VkResult (VKAPI_PTR *PFN_vkFlushMappedMemoryRanges)(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges); +typedef VkResult (VKAPI_PTR *PFN_vkInvalidateMappedMemoryRanges)(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges); +typedef void (VKAPI_PTR *PFN_vkGetDeviceMemoryCommitment)(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes); +typedef VkResult (VKAPI_PTR *PFN_vkBindBufferMemory)(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset); +typedef VkResult (VKAPI_PTR *PFN_vkBindImageMemory)(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset); +typedef void (VKAPI_PTR *PFN_vkGetBufferMemoryRequirements)(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements); +typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements)(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements); +typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements)(VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkQueueBindSparse)(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence); +typedef VkResult (VKAPI_PTR *PFN_vkCreateFence)(VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence); +typedef void (VKAPI_PTR *PFN_vkDestroyFence)(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkResetFences)(VkDevice device, uint32_t fenceCount, const VkFence* pFences); +typedef VkResult (VKAPI_PTR *PFN_vkGetFenceStatus)(VkDevice device, VkFence fence); +typedef VkResult (VKAPI_PTR *PFN_vkWaitForFences)(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout); +typedef VkResult (VKAPI_PTR *PFN_vkCreateSemaphore)(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore); +typedef void (VKAPI_PTR *PFN_vkDestroySemaphore)(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateEvent)(VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent); +typedef void (VKAPI_PTR *PFN_vkDestroyEvent)(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkGetEventStatus)(VkDevice device, VkEvent event); +typedef VkResult (VKAPI_PTR *PFN_vkSetEvent)(VkDevice device, VkEvent event); +typedef VkResult (VKAPI_PTR *PFN_vkResetEvent)(VkDevice device, VkEvent event); +typedef VkResult (VKAPI_PTR *PFN_vkCreateQueryPool)(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool); +typedef void (VKAPI_PTR *PFN_vkDestroyQueryPool)(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkGetQueryPoolResults)(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags); +typedef VkResult (VKAPI_PTR *PFN_vkCreateBuffer)(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer); +typedef void (VKAPI_PTR *PFN_vkDestroyBuffer)(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateBufferView)(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView); +typedef void (VKAPI_PTR *PFN_vkDestroyBufferView)(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateImage)(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage); +typedef void (VKAPI_PTR *PFN_vkDestroyImage)(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkGetImageSubresourceLayout)(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout); +typedef VkResult (VKAPI_PTR *PFN_vkCreateImageView)(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView); +typedef void (VKAPI_PTR *PFN_vkDestroyImageView)(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateShaderModule)(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule); +typedef void (VKAPI_PTR *PFN_vkDestroyShaderModule)(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreatePipelineCache)(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache); +typedef void (VKAPI_PTR *PFN_vkDestroyPipelineCache)(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkGetPipelineCacheData)(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData); +typedef VkResult (VKAPI_PTR *PFN_vkMergePipelineCaches)(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches); +typedef VkResult (VKAPI_PTR *PFN_vkCreateGraphicsPipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); +typedef VkResult (VKAPI_PTR *PFN_vkCreateComputePipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); +typedef void (VKAPI_PTR *PFN_vkDestroyPipeline)(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreatePipelineLayout)(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout); +typedef void (VKAPI_PTR *PFN_vkDestroyPipelineLayout)(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateSampler)(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler); +typedef void (VKAPI_PTR *PFN_vkDestroySampler)(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorSetLayout)(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout); +typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorSetLayout)(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorPool)(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool); +typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkResetDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags); +typedef VkResult (VKAPI_PTR *PFN_vkAllocateDescriptorSets)(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets); +typedef VkResult (VKAPI_PTR *PFN_vkFreeDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets); +typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSets)(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies); +typedef VkResult (VKAPI_PTR *PFN_vkCreateFramebuffer)(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer); +typedef void (VKAPI_PTR *PFN_vkDestroyFramebuffer)(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateRenderPass)(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass); +typedef void (VKAPI_PTR *PFN_vkDestroyRenderPass)(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkGetRenderAreaGranularity)(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity); +typedef VkResult (VKAPI_PTR *PFN_vkCreateCommandPool)(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool); +typedef void (VKAPI_PTR *PFN_vkDestroyCommandPool)(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkResetCommandPool)(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags); +typedef VkResult (VKAPI_PTR *PFN_vkAllocateCommandBuffers)(VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers); +typedef void (VKAPI_PTR *PFN_vkFreeCommandBuffers)(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers); +typedef VkResult (VKAPI_PTR *PFN_vkBeginCommandBuffer)(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo); +typedef VkResult (VKAPI_PTR *PFN_vkEndCommandBuffer)(VkCommandBuffer commandBuffer); +typedef VkResult (VKAPI_PTR *PFN_vkResetCommandBuffer)(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags); +typedef void (VKAPI_PTR *PFN_vkCmdBindPipeline)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); +typedef void (VKAPI_PTR *PFN_vkCmdSetViewport)(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports); +typedef void (VKAPI_PTR *PFN_vkCmdSetScissor)(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors); +typedef void (VKAPI_PTR *PFN_vkCmdSetLineWidth)(VkCommandBuffer commandBuffer, float lineWidth); +typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBias)(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor); +typedef void (VKAPI_PTR *PFN_vkCmdSetBlendConstants)(VkCommandBuffer commandBuffer, const float blendConstants[4]); +typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBounds)(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds); +typedef void (VKAPI_PTR *PFN_vkCmdSetStencilCompareMask)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask); +typedef void (VKAPI_PTR *PFN_vkCmdSetStencilWriteMask)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask); +typedef void (VKAPI_PTR *PFN_vkCmdSetStencilReference)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference); +typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorSets)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets); +typedef void (VKAPI_PTR *PFN_vkCmdBindIndexBuffer)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType); +typedef void (VKAPI_PTR *PFN_vkCmdBindVertexBuffers)(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets); +typedef void (VKAPI_PTR *PFN_vkCmdDraw)(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); +typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexed)(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance); +typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); +typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); +typedef void (VKAPI_PTR *PFN_vkCmdDispatch)(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); +typedef void (VKAPI_PTR *PFN_vkCmdDispatchIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); +typedef void (VKAPI_PTR *PFN_vkCmdCopyBuffer)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions); +typedef void (VKAPI_PTR *PFN_vkCmdCopyImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions); +typedef void (VKAPI_PTR *PFN_vkCmdBlitImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkFilter filter); +typedef void (VKAPI_PTR *PFN_vkCmdCopyBufferToImage)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions); +typedef void (VKAPI_PTR *PFN_vkCmdCopyImageToBuffer)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions); +typedef void (VKAPI_PTR *PFN_vkCmdUpdateBuffer)(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData); +typedef void (VKAPI_PTR *PFN_vkCmdFillBuffer)(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data); +typedef void (VKAPI_PTR *PFN_vkCmdClearColorImage)(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges); +typedef void (VKAPI_PTR *PFN_vkCmdClearDepthStencilImage)(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges); +typedef void (VKAPI_PTR *PFN_vkCmdClearAttachments)(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects); +typedef void (VKAPI_PTR *PFN_vkCmdResolveImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions); +typedef void (VKAPI_PTR *PFN_vkCmdSetEvent)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); +typedef void (VKAPI_PTR *PFN_vkCmdResetEvent)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); +typedef void (VKAPI_PTR *PFN_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); +typedef void (VKAPI_PTR *PFN_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); +typedef void (VKAPI_PTR *PFN_vkCmdBeginQuery)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags); +typedef void (VKAPI_PTR *PFN_vkCmdEndQuery)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query); +typedef void (VKAPI_PTR *PFN_vkCmdResetQueryPool)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); +typedef void (VKAPI_PTR *PFN_vkCmdWriteTimestamp)(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query); +typedef void (VKAPI_PTR *PFN_vkCmdCopyQueryPoolResults)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags); +typedef void (VKAPI_PTR *PFN_vkCmdPushConstants)(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues); +typedef void (VKAPI_PTR *PFN_vkCmdBeginRenderPass)(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents); +typedef void (VKAPI_PTR *PFN_vkCmdNextSubpass)(VkCommandBuffer commandBuffer, VkSubpassContents contents); +typedef void (VKAPI_PTR *PFN_vkCmdEndRenderPass)(VkCommandBuffer commandBuffer); +typedef void (VKAPI_PTR *PFN_vkCmdExecuteCommands)(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance( + const VkInstanceCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkInstance* pInstance); + +VKAPI_ATTR void VKAPI_CALL vkDestroyInstance( + VkInstance instance, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDevices( + VkInstance instance, + uint32_t* pPhysicalDeviceCount, + VkPhysicalDevice* pPhysicalDevices); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceFeatures* pFeatures); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties( + VkPhysicalDevice physicalDevice, + VkFormat format, + VkFormatProperties* pFormatProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties( + VkPhysicalDevice physicalDevice, + VkFormat format, + VkImageType type, + VkImageTiling tiling, + VkImageUsageFlags usage, + VkImageCreateFlags flags, + VkImageFormatProperties* pImageFormatProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceProperties* pProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties( + VkPhysicalDevice physicalDevice, + uint32_t* pQueueFamilyPropertyCount, + VkQueueFamilyProperties* pQueueFamilyProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceMemoryProperties* pMemoryProperties); + +VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr( + VkInstance instance, + const char* pName); + +VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr( + VkDevice device, + const char* pName); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice( + VkPhysicalDevice physicalDevice, + const VkDeviceCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDevice* pDevice); + +VKAPI_ATTR void VKAPI_CALL vkDestroyDevice( + VkDevice device, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties( + const char* pLayerName, + uint32_t* pPropertyCount, + VkExtensionProperties* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties( + VkPhysicalDevice physicalDevice, + const char* pLayerName, + uint32_t* pPropertyCount, + VkExtensionProperties* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties( + uint32_t* pPropertyCount, + VkLayerProperties* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceLayerProperties( + VkPhysicalDevice physicalDevice, + uint32_t* pPropertyCount, + VkLayerProperties* pProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue( + VkDevice device, + uint32_t queueFamilyIndex, + uint32_t queueIndex, + VkQueue* pQueue); + +VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit( + VkQueue queue, + uint32_t submitCount, + const VkSubmitInfo* pSubmits, + VkFence fence); + +VKAPI_ATTR VkResult VKAPI_CALL vkQueueWaitIdle( + VkQueue queue); + +VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle( + VkDevice device); + +VKAPI_ATTR VkResult VKAPI_CALL vkAllocateMemory( + VkDevice device, + const VkMemoryAllocateInfo* pAllocateInfo, + const VkAllocationCallbacks* pAllocator, + VkDeviceMemory* pMemory); + +VKAPI_ATTR void VKAPI_CALL vkFreeMemory( + VkDevice device, + VkDeviceMemory memory, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkMapMemory( + VkDevice device, + VkDeviceMemory memory, + VkDeviceSize offset, + VkDeviceSize size, + VkMemoryMapFlags flags, + void** ppData); + +VKAPI_ATTR void VKAPI_CALL vkUnmapMemory( + VkDevice device, + VkDeviceMemory memory); + +VKAPI_ATTR VkResult VKAPI_CALL vkFlushMappedMemoryRanges( + VkDevice device, + uint32_t memoryRangeCount, + const VkMappedMemoryRange* pMemoryRanges); + +VKAPI_ATTR VkResult VKAPI_CALL vkInvalidateMappedMemoryRanges( + VkDevice device, + uint32_t memoryRangeCount, + const VkMappedMemoryRange* pMemoryRanges); + +VKAPI_ATTR void VKAPI_CALL vkGetDeviceMemoryCommitment( + VkDevice device, + VkDeviceMemory memory, + VkDeviceSize* pCommittedMemoryInBytes); + +VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory( + VkDevice device, + VkBuffer buffer, + VkDeviceMemory memory, + VkDeviceSize memoryOffset); + +VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory( + VkDevice device, + VkImage image, + VkDeviceMemory memory, + VkDeviceSize memoryOffset); + +VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements( + VkDevice device, + VkBuffer buffer, + VkMemoryRequirements* pMemoryRequirements); + +VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements( + VkDevice device, + VkImage image, + VkMemoryRequirements* pMemoryRequirements); + +VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements( + VkDevice device, + VkImage image, + uint32_t* pSparseMemoryRequirementCount, + VkSparseImageMemoryRequirements* pSparseMemoryRequirements); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties( + VkPhysicalDevice physicalDevice, + VkFormat format, + VkImageType type, + VkSampleCountFlagBits samples, + VkImageUsageFlags usage, + VkImageTiling tiling, + uint32_t* pPropertyCount, + VkSparseImageFormatProperties* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkQueueBindSparse( + VkQueue queue, + uint32_t bindInfoCount, + const VkBindSparseInfo* pBindInfo, + VkFence fence); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateFence( + VkDevice device, + const VkFenceCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkFence* pFence); + +VKAPI_ATTR void VKAPI_CALL vkDestroyFence( + VkDevice device, + VkFence fence, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkResetFences( + VkDevice device, + uint32_t fenceCount, + const VkFence* pFences); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceStatus( + VkDevice device, + VkFence fence); + +VKAPI_ATTR VkResult VKAPI_CALL vkWaitForFences( + VkDevice device, + uint32_t fenceCount, + const VkFence* pFences, + VkBool32 waitAll, + uint64_t timeout); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateSemaphore( + VkDevice device, + const VkSemaphoreCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSemaphore* pSemaphore); + +VKAPI_ATTR void VKAPI_CALL vkDestroySemaphore( + VkDevice device, + VkSemaphore semaphore, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateEvent( + VkDevice device, + const VkEventCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkEvent* pEvent); + +VKAPI_ATTR void VKAPI_CALL vkDestroyEvent( + VkDevice device, + VkEvent event, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetEventStatus( + VkDevice device, + VkEvent event); + +VKAPI_ATTR VkResult VKAPI_CALL vkSetEvent( + VkDevice device, + VkEvent event); + +VKAPI_ATTR VkResult VKAPI_CALL vkResetEvent( + VkDevice device, + VkEvent event); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateQueryPool( + VkDevice device, + const VkQueryPoolCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkQueryPool* pQueryPool); + +VKAPI_ATTR void VKAPI_CALL vkDestroyQueryPool( + VkDevice device, + VkQueryPool queryPool, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetQueryPoolResults( + VkDevice device, + VkQueryPool queryPool, + uint32_t firstQuery, + uint32_t queryCount, + size_t dataSize, + void* pData, + VkDeviceSize stride, + VkQueryResultFlags flags); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateBuffer( + VkDevice device, + const VkBufferCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkBuffer* pBuffer); + +VKAPI_ATTR void VKAPI_CALL vkDestroyBuffer( + VkDevice device, + VkBuffer buffer, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferView( + VkDevice device, + const VkBufferViewCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkBufferView* pView); + +VKAPI_ATTR void VKAPI_CALL vkDestroyBufferView( + VkDevice device, + VkBufferView bufferView, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage( + VkDevice device, + const VkImageCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkImage* pImage); + +VKAPI_ATTR void VKAPI_CALL vkDestroyImage( + VkDevice device, + VkImage image, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout( + VkDevice device, + VkImage image, + const VkImageSubresource* pSubresource, + VkSubresourceLayout* pLayout); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView( + VkDevice device, + const VkImageViewCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkImageView* pView); + +VKAPI_ATTR void VKAPI_CALL vkDestroyImageView( + VkDevice device, + VkImageView imageView, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateShaderModule( + VkDevice device, + const VkShaderModuleCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkShaderModule* pShaderModule); + +VKAPI_ATTR void VKAPI_CALL vkDestroyShaderModule( + VkDevice device, + VkShaderModule shaderModule, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineCache( + VkDevice device, + const VkPipelineCacheCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkPipelineCache* pPipelineCache); + +VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineCache( + VkDevice device, + VkPipelineCache pipelineCache, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineCacheData( + VkDevice device, + VkPipelineCache pipelineCache, + size_t* pDataSize, + void* pData); + +VKAPI_ATTR VkResult VKAPI_CALL vkMergePipelineCaches( + VkDevice device, + VkPipelineCache dstCache, + uint32_t srcCacheCount, + const VkPipelineCache* pSrcCaches); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateGraphicsPipelines( + VkDevice device, + VkPipelineCache pipelineCache, + uint32_t createInfoCount, + const VkGraphicsPipelineCreateInfo* pCreateInfos, + const VkAllocationCallbacks* pAllocator, + VkPipeline* pPipelines); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateComputePipelines( + VkDevice device, + VkPipelineCache pipelineCache, + uint32_t createInfoCount, + const VkComputePipelineCreateInfo* pCreateInfos, + const VkAllocationCallbacks* pAllocator, + VkPipeline* pPipelines); + +VKAPI_ATTR void VKAPI_CALL vkDestroyPipeline( + VkDevice device, + VkPipeline pipeline, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineLayout( + VkDevice device, + const VkPipelineLayoutCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkPipelineLayout* pPipelineLayout); + +VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineLayout( + VkDevice device, + VkPipelineLayout pipelineLayout, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateSampler( + VkDevice device, + const VkSamplerCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSampler* pSampler); + +VKAPI_ATTR void VKAPI_CALL vkDestroySampler( + VkDevice device, + VkSampler sampler, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorSetLayout( + VkDevice device, + const VkDescriptorSetLayoutCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDescriptorSetLayout* pSetLayout); + +VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorSetLayout( + VkDevice device, + VkDescriptorSetLayout descriptorSetLayout, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorPool( + VkDevice device, + const VkDescriptorPoolCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDescriptorPool* pDescriptorPool); + +VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorPool( + VkDevice device, + VkDescriptorPool descriptorPool, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkResetDescriptorPool( + VkDevice device, + VkDescriptorPool descriptorPool, + VkDescriptorPoolResetFlags flags); + +VKAPI_ATTR VkResult VKAPI_CALL vkAllocateDescriptorSets( + VkDevice device, + const VkDescriptorSetAllocateInfo* pAllocateInfo, + VkDescriptorSet* pDescriptorSets); + +VKAPI_ATTR VkResult VKAPI_CALL vkFreeDescriptorSets( + VkDevice device, + VkDescriptorPool descriptorPool, + uint32_t descriptorSetCount, + const VkDescriptorSet* pDescriptorSets); + +VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSets( + VkDevice device, + uint32_t descriptorWriteCount, + const VkWriteDescriptorSet* pDescriptorWrites, + uint32_t descriptorCopyCount, + const VkCopyDescriptorSet* pDescriptorCopies); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateFramebuffer( + VkDevice device, + const VkFramebufferCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkFramebuffer* pFramebuffer); + +VKAPI_ATTR void VKAPI_CALL vkDestroyFramebuffer( + VkDevice device, + VkFramebuffer framebuffer, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass( + VkDevice device, + const VkRenderPassCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkRenderPass* pRenderPass); + +VKAPI_ATTR void VKAPI_CALL vkDestroyRenderPass( + VkDevice device, + VkRenderPass renderPass, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkGetRenderAreaGranularity( + VkDevice device, + VkRenderPass renderPass, + VkExtent2D* pGranularity); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool( + VkDevice device, + const VkCommandPoolCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkCommandPool* pCommandPool); + +VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool( + VkDevice device, + VkCommandPool commandPool, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandPool( + VkDevice device, + VkCommandPool commandPool, + VkCommandPoolResetFlags flags); + +VKAPI_ATTR VkResult VKAPI_CALL vkAllocateCommandBuffers( + VkDevice device, + const VkCommandBufferAllocateInfo* pAllocateInfo, + VkCommandBuffer* pCommandBuffers); + +VKAPI_ATTR void VKAPI_CALL vkFreeCommandBuffers( + VkDevice device, + VkCommandPool commandPool, + uint32_t commandBufferCount, + const VkCommandBuffer* pCommandBuffers); + +VKAPI_ATTR VkResult VKAPI_CALL vkBeginCommandBuffer( + VkCommandBuffer commandBuffer, + const VkCommandBufferBeginInfo* pBeginInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkEndCommandBuffer( + VkCommandBuffer commandBuffer); + +VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandBuffer( + VkCommandBuffer commandBuffer, + VkCommandBufferResetFlags flags); + +VKAPI_ATTR void VKAPI_CALL vkCmdBindPipeline( + VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipeline pipeline); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetViewport( + VkCommandBuffer commandBuffer, + uint32_t firstViewport, + uint32_t viewportCount, + const VkViewport* pViewports); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetScissor( + VkCommandBuffer commandBuffer, + uint32_t firstScissor, + uint32_t scissorCount, + const VkRect2D* pScissors); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetLineWidth( + VkCommandBuffer commandBuffer, + float lineWidth); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBias( + VkCommandBuffer commandBuffer, + float depthBiasConstantFactor, + float depthBiasClamp, + float depthBiasSlopeFactor); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetBlendConstants( + VkCommandBuffer commandBuffer, + const float blendConstants[4]); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBounds( + VkCommandBuffer commandBuffer, + float minDepthBounds, + float maxDepthBounds); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilCompareMask( + VkCommandBuffer commandBuffer, + VkStencilFaceFlags faceMask, + uint32_t compareMask); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilWriteMask( + VkCommandBuffer commandBuffer, + VkStencilFaceFlags faceMask, + uint32_t writeMask); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilReference( + VkCommandBuffer commandBuffer, + VkStencilFaceFlags faceMask, + uint32_t reference); + +VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets( + VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout layout, + uint32_t firstSet, + uint32_t descriptorSetCount, + const VkDescriptorSet* pDescriptorSets, + uint32_t dynamicOffsetCount, + const uint32_t* pDynamicOffsets); + +VKAPI_ATTR void VKAPI_CALL vkCmdBindIndexBuffer( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkIndexType indexType); + +VKAPI_ATTR void VKAPI_CALL vkCmdBindVertexBuffers( + VkCommandBuffer commandBuffer, + uint32_t firstBinding, + uint32_t bindingCount, + const VkBuffer* pBuffers, + const VkDeviceSize* pOffsets); + +VKAPI_ATTR void VKAPI_CALL vkCmdDraw( + VkCommandBuffer commandBuffer, + uint32_t vertexCount, + uint32_t instanceCount, + uint32_t firstVertex, + uint32_t firstInstance); + +VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexed( + VkCommandBuffer commandBuffer, + uint32_t indexCount, + uint32_t instanceCount, + uint32_t firstIndex, + int32_t vertexOffset, + uint32_t firstInstance); + +VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirect( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + uint32_t drawCount, + uint32_t stride); + +VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirect( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + uint32_t drawCount, + uint32_t stride); + +VKAPI_ATTR void VKAPI_CALL vkCmdDispatch( + VkCommandBuffer commandBuffer, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); + +VKAPI_ATTR void VKAPI_CALL vkCmdDispatchIndirect( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset); + +VKAPI_ATTR void VKAPI_CALL vkCmdCopyBuffer( + VkCommandBuffer commandBuffer, + VkBuffer srcBuffer, + VkBuffer dstBuffer, + uint32_t regionCount, + const VkBufferCopy* pRegions); + +VKAPI_ATTR void VKAPI_CALL vkCmdCopyImage( + VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkImageCopy* pRegions); + +VKAPI_ATTR void VKAPI_CALL vkCmdBlitImage( + VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkImageBlit* pRegions, + VkFilter filter); + +VKAPI_ATTR void VKAPI_CALL vkCmdCopyBufferToImage( + VkCommandBuffer commandBuffer, + VkBuffer srcBuffer, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkBufferImageCopy* pRegions); + +VKAPI_ATTR void VKAPI_CALL vkCmdCopyImageToBuffer( + VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkBuffer dstBuffer, + uint32_t regionCount, + const VkBufferImageCopy* pRegions); + +VKAPI_ATTR void VKAPI_CALL vkCmdUpdateBuffer( + VkCommandBuffer commandBuffer, + VkBuffer dstBuffer, + VkDeviceSize dstOffset, + VkDeviceSize dataSize, + const void* pData); + +VKAPI_ATTR void VKAPI_CALL vkCmdFillBuffer( + VkCommandBuffer commandBuffer, + VkBuffer dstBuffer, + VkDeviceSize dstOffset, + VkDeviceSize size, + uint32_t data); + +VKAPI_ATTR void VKAPI_CALL vkCmdClearColorImage( + VkCommandBuffer commandBuffer, + VkImage image, + VkImageLayout imageLayout, + const VkClearColorValue* pColor, + uint32_t rangeCount, + const VkImageSubresourceRange* pRanges); + +VKAPI_ATTR void VKAPI_CALL vkCmdClearDepthStencilImage( + VkCommandBuffer commandBuffer, + VkImage image, + VkImageLayout imageLayout, + const VkClearDepthStencilValue* pDepthStencil, + uint32_t rangeCount, + const VkImageSubresourceRange* pRanges); + +VKAPI_ATTR void VKAPI_CALL vkCmdClearAttachments( + VkCommandBuffer commandBuffer, + uint32_t attachmentCount, + const VkClearAttachment* pAttachments, + uint32_t rectCount, + const VkClearRect* pRects); + +VKAPI_ATTR void VKAPI_CALL vkCmdResolveImage( + VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkImageResolve* pRegions); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetEvent( + VkCommandBuffer commandBuffer, + VkEvent event, + VkPipelineStageFlags stageMask); + +VKAPI_ATTR void VKAPI_CALL vkCmdResetEvent( + VkCommandBuffer commandBuffer, + VkEvent event, + VkPipelineStageFlags stageMask); + +VKAPI_ATTR void VKAPI_CALL 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); + +VKAPI_ATTR void VKAPI_CALL 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); + +VKAPI_ATTR void VKAPI_CALL vkCmdBeginQuery( + VkCommandBuffer commandBuffer, + VkQueryPool queryPool, + uint32_t query, + VkQueryControlFlags flags); + +VKAPI_ATTR void VKAPI_CALL vkCmdEndQuery( + VkCommandBuffer commandBuffer, + VkQueryPool queryPool, + uint32_t query); + +VKAPI_ATTR void VKAPI_CALL vkCmdResetQueryPool( + VkCommandBuffer commandBuffer, + VkQueryPool queryPool, + uint32_t firstQuery, + uint32_t queryCount); + +VKAPI_ATTR void VKAPI_CALL vkCmdWriteTimestamp( + VkCommandBuffer commandBuffer, + VkPipelineStageFlagBits pipelineStage, + VkQueryPool queryPool, + uint32_t query); + +VKAPI_ATTR void VKAPI_CALL vkCmdCopyQueryPoolResults( + VkCommandBuffer commandBuffer, + VkQueryPool queryPool, + uint32_t firstQuery, + uint32_t queryCount, + VkBuffer dstBuffer, + VkDeviceSize dstOffset, + VkDeviceSize stride, + VkQueryResultFlags flags); + +VKAPI_ATTR void VKAPI_CALL vkCmdPushConstants( + VkCommandBuffer commandBuffer, + VkPipelineLayout layout, + VkShaderStageFlags stageFlags, + uint32_t offset, + uint32_t size, + const void* pValues); + +VKAPI_ATTR void VKAPI_CALL vkCmdBeginRenderPass( + VkCommandBuffer commandBuffer, + const VkRenderPassBeginInfo* pRenderPassBegin, + VkSubpassContents contents); + +VKAPI_ATTR void VKAPI_CALL vkCmdNextSubpass( + VkCommandBuffer commandBuffer, + VkSubpassContents contents); + +VKAPI_ATTR void VKAPI_CALL vkCmdEndRenderPass( + VkCommandBuffer commandBuffer); + +VKAPI_ATTR void VKAPI_CALL vkCmdExecuteCommands( + VkCommandBuffer commandBuffer, + uint32_t commandBufferCount, + const VkCommandBuffer* pCommandBuffers); +#endif + +#define VK_VERSION_1_1 1 +// Vulkan 1.1 version number +#define VK_API_VERSION_1_1 VK_MAKE_VERSION(1, 1, 0)// Patch version should always be set to 0 + + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSamplerYcbcrConversion) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplate) + +#define VK_MAX_DEVICE_GROUP_SIZE 32 +#define VK_LUID_SIZE 8 +#define VK_QUEUE_FAMILY_EXTERNAL (~0U-1) + + +typedef enum VkPointClippingBehavior { + VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES = 0, + VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY = 1, + VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES_KHR = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES, + VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY_KHR = VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY, + VK_POINT_CLIPPING_BEHAVIOR_BEGIN_RANGE = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES, + VK_POINT_CLIPPING_BEHAVIOR_END_RANGE = VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY, + VK_POINT_CLIPPING_BEHAVIOR_RANGE_SIZE = (VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY - VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES + 1), + VK_POINT_CLIPPING_BEHAVIOR_MAX_ENUM = 0x7FFFFFFF +} VkPointClippingBehavior; + +typedef enum VkTessellationDomainOrigin { + VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT = 0, + VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT = 1, + VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT_KHR = VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT, + VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT_KHR = VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT, + VK_TESSELLATION_DOMAIN_ORIGIN_BEGIN_RANGE = VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT, + VK_TESSELLATION_DOMAIN_ORIGIN_END_RANGE = VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT, + VK_TESSELLATION_DOMAIN_ORIGIN_RANGE_SIZE = (VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT - VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT + 1), + VK_TESSELLATION_DOMAIN_ORIGIN_MAX_ENUM = 0x7FFFFFFF +} VkTessellationDomainOrigin; + +typedef enum VkSamplerYcbcrModelConversion { + VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY = 0, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY = 1, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709 = 2, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601 = 3, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020 = 4, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_BEGIN_RANGE = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_END_RANGE = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_RANGE_SIZE = (VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020 - VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY + 1), + VK_SAMPLER_YCBCR_MODEL_CONVERSION_MAX_ENUM = 0x7FFFFFFF +} VkSamplerYcbcrModelConversion; + +typedef enum VkSamplerYcbcrRange { + VK_SAMPLER_YCBCR_RANGE_ITU_FULL = 0, + VK_SAMPLER_YCBCR_RANGE_ITU_NARROW = 1, + VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR = VK_SAMPLER_YCBCR_RANGE_ITU_FULL, + VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR = VK_SAMPLER_YCBCR_RANGE_ITU_NARROW, + VK_SAMPLER_YCBCR_RANGE_BEGIN_RANGE = VK_SAMPLER_YCBCR_RANGE_ITU_FULL, + VK_SAMPLER_YCBCR_RANGE_END_RANGE = VK_SAMPLER_YCBCR_RANGE_ITU_NARROW, + VK_SAMPLER_YCBCR_RANGE_RANGE_SIZE = (VK_SAMPLER_YCBCR_RANGE_ITU_NARROW - VK_SAMPLER_YCBCR_RANGE_ITU_FULL + 1), + VK_SAMPLER_YCBCR_RANGE_MAX_ENUM = 0x7FFFFFFF +} VkSamplerYcbcrRange; + +typedef enum VkChromaLocation { + VK_CHROMA_LOCATION_COSITED_EVEN = 0, + VK_CHROMA_LOCATION_MIDPOINT = 1, + VK_CHROMA_LOCATION_COSITED_EVEN_KHR = VK_CHROMA_LOCATION_COSITED_EVEN, + VK_CHROMA_LOCATION_MIDPOINT_KHR = VK_CHROMA_LOCATION_MIDPOINT, + VK_CHROMA_LOCATION_BEGIN_RANGE = VK_CHROMA_LOCATION_COSITED_EVEN, + VK_CHROMA_LOCATION_END_RANGE = VK_CHROMA_LOCATION_MIDPOINT, + VK_CHROMA_LOCATION_RANGE_SIZE = (VK_CHROMA_LOCATION_MIDPOINT - VK_CHROMA_LOCATION_COSITED_EVEN + 1), + VK_CHROMA_LOCATION_MAX_ENUM = 0x7FFFFFFF +} VkChromaLocation; + +typedef enum VkDescriptorUpdateTemplateType { + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET = 0, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR = 1, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_BEGIN_RANGE = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_END_RANGE = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_RANGE_SIZE = (VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET + 1), + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkDescriptorUpdateTemplateType; + + +typedef enum VkSubgroupFeatureFlagBits { + VK_SUBGROUP_FEATURE_BASIC_BIT = 0x00000001, + VK_SUBGROUP_FEATURE_VOTE_BIT = 0x00000002, + VK_SUBGROUP_FEATURE_ARITHMETIC_BIT = 0x00000004, + VK_SUBGROUP_FEATURE_BALLOT_BIT = 0x00000008, + VK_SUBGROUP_FEATURE_SHUFFLE_BIT = 0x00000010, + VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT = 0x00000020, + VK_SUBGROUP_FEATURE_CLUSTERED_BIT = 0x00000040, + VK_SUBGROUP_FEATURE_QUAD_BIT = 0x00000080, + VK_SUBGROUP_FEATURE_PARTITIONED_BIT_NV = 0x00000100, + VK_SUBGROUP_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSubgroupFeatureFlagBits; +typedef VkFlags VkSubgroupFeatureFlags; + +typedef enum VkPeerMemoryFeatureFlagBits { + VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT = 0x00000001, + VK_PEER_MEMORY_FEATURE_COPY_DST_BIT = 0x00000002, + VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT = 0x00000004, + VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT = 0x00000008, + VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT_KHR = VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT, + VK_PEER_MEMORY_FEATURE_COPY_DST_BIT_KHR = VK_PEER_MEMORY_FEATURE_COPY_DST_BIT, + VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT_KHR = VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT, + VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT_KHR = VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT, + VK_PEER_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkPeerMemoryFeatureFlagBits; +typedef VkFlags VkPeerMemoryFeatureFlags; + +typedef enum VkMemoryAllocateFlagBits { + VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT = 0x00000001, + VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT_KHR = VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT, + VK_MEMORY_ALLOCATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkMemoryAllocateFlagBits; +typedef VkFlags VkMemoryAllocateFlags; +typedef VkFlags VkCommandPoolTrimFlags; +typedef VkFlags VkDescriptorUpdateTemplateCreateFlags; + +typedef enum VkExternalMemoryHandleTypeFlagBits { + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT = 0x00000001, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT = 0x00000002, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 0x00000004, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT = 0x00000008, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT = 0x00000010, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT = 0x00000020, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT = 0x00000040, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT = 0x00000200, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID = 0x00000400, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT = 0x00000080, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT = 0x00000100, + 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, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalMemoryHandleTypeFlagBits; +typedef VkFlags VkExternalMemoryHandleTypeFlags; + +typedef enum VkExternalMemoryFeatureFlagBits { + VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT = 0x00000001, + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT = 0x00000002, + VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT = 0x00000004, + VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT, + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT, + VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT, + VK_EXTERNAL_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalMemoryFeatureFlagBits; +typedef VkFlags VkExternalMemoryFeatureFlags; + +typedef enum VkExternalFenceHandleTypeFlagBits { + VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT = 0x00000001, + VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT = 0x00000002, + VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 0x00000004, + VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT = 0x00000008, + VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT, + VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT, + VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, + VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT, + VK_EXTERNAL_FENCE_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalFenceHandleTypeFlagBits; +typedef VkFlags VkExternalFenceHandleTypeFlags; + +typedef enum VkExternalFenceFeatureFlagBits { + VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT = 0x00000001, + VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT = 0x00000002, + VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT_KHR = VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT, + VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT_KHR = VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT, + VK_EXTERNAL_FENCE_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalFenceFeatureFlagBits; +typedef VkFlags VkExternalFenceFeatureFlags; + +typedef enum VkFenceImportFlagBits { + VK_FENCE_IMPORT_TEMPORARY_BIT = 0x00000001, + VK_FENCE_IMPORT_TEMPORARY_BIT_KHR = VK_FENCE_IMPORT_TEMPORARY_BIT, + VK_FENCE_IMPORT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkFenceImportFlagBits; +typedef VkFlags VkFenceImportFlags; + +typedef enum VkSemaphoreImportFlagBits { + VK_SEMAPHORE_IMPORT_TEMPORARY_BIT = 0x00000001, + VK_SEMAPHORE_IMPORT_TEMPORARY_BIT_KHR = VK_SEMAPHORE_IMPORT_TEMPORARY_BIT, + VK_SEMAPHORE_IMPORT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSemaphoreImportFlagBits; +typedef VkFlags VkSemaphoreImportFlags; + +typedef enum VkExternalSemaphoreHandleTypeFlagBits { + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT = 0x00000001, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT = 0x00000002, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 0x00000004, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT = 0x00000008, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT = 0x00000010, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalSemaphoreHandleTypeFlagBits; +typedef VkFlags VkExternalSemaphoreHandleTypeFlags; + +typedef enum VkExternalSemaphoreFeatureFlagBits { + VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT = 0x00000001, + VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT = 0x00000002, + VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHR = VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT, + VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHR = VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT, + VK_EXTERNAL_SEMAPHORE_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalSemaphoreFeatureFlagBits; +typedef VkFlags VkExternalSemaphoreFeatureFlags; + +typedef struct VkPhysicalDeviceSubgroupProperties { + VkStructureType sType; + void* pNext; + uint32_t subgroupSize; + VkShaderStageFlags supportedStages; + VkSubgroupFeatureFlags supportedOperations; + VkBool32 quadOperationsInAllStages; +} VkPhysicalDeviceSubgroupProperties; + +typedef struct VkBindBufferMemoryInfo { + VkStructureType sType; + const void* pNext; + VkBuffer buffer; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; +} VkBindBufferMemoryInfo; + +typedef struct VkBindImageMemoryInfo { + VkStructureType sType; + const void* pNext; + VkImage image; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; +} VkBindImageMemoryInfo; + +typedef struct VkPhysicalDevice16BitStorageFeatures { + VkStructureType sType; + void* pNext; + VkBool32 storageBuffer16BitAccess; + VkBool32 uniformAndStorageBuffer16BitAccess; + VkBool32 storagePushConstant16; + VkBool32 storageInputOutput16; +} VkPhysicalDevice16BitStorageFeatures; + +typedef struct VkMemoryDedicatedRequirements { + VkStructureType sType; + void* pNext; + VkBool32 prefersDedicatedAllocation; + VkBool32 requiresDedicatedAllocation; +} VkMemoryDedicatedRequirements; + +typedef struct VkMemoryDedicatedAllocateInfo { + VkStructureType sType; + const void* pNext; + VkImage image; + VkBuffer buffer; +} VkMemoryDedicatedAllocateInfo; + +typedef struct VkMemoryAllocateFlagsInfo { + VkStructureType sType; + const void* pNext; + VkMemoryAllocateFlags flags; + uint32_t deviceMask; +} VkMemoryAllocateFlagsInfo; + +typedef struct VkDeviceGroupRenderPassBeginInfo { + VkStructureType sType; + const void* pNext; + uint32_t deviceMask; + uint32_t deviceRenderAreaCount; + const VkRect2D* pDeviceRenderAreas; +} VkDeviceGroupRenderPassBeginInfo; + +typedef struct VkDeviceGroupCommandBufferBeginInfo { + VkStructureType sType; + const void* pNext; + uint32_t deviceMask; +} VkDeviceGroupCommandBufferBeginInfo; + +typedef struct VkDeviceGroupSubmitInfo { + VkStructureType sType; + const void* pNext; + uint32_t waitSemaphoreCount; + const uint32_t* pWaitSemaphoreDeviceIndices; + uint32_t commandBufferCount; + const uint32_t* pCommandBufferDeviceMasks; + uint32_t signalSemaphoreCount; + const uint32_t* pSignalSemaphoreDeviceIndices; +} VkDeviceGroupSubmitInfo; + +typedef struct VkDeviceGroupBindSparseInfo { + VkStructureType sType; + const void* pNext; + uint32_t resourceDeviceIndex; + uint32_t memoryDeviceIndex; +} VkDeviceGroupBindSparseInfo; + +typedef struct VkBindBufferMemoryDeviceGroupInfo { + VkStructureType sType; + const void* pNext; + uint32_t deviceIndexCount; + const uint32_t* pDeviceIndices; +} VkBindBufferMemoryDeviceGroupInfo; + +typedef struct VkBindImageMemoryDeviceGroupInfo { + VkStructureType sType; + const void* pNext; + uint32_t deviceIndexCount; + const uint32_t* pDeviceIndices; + uint32_t splitInstanceBindRegionCount; + const VkRect2D* pSplitInstanceBindRegions; +} VkBindImageMemoryDeviceGroupInfo; + +typedef struct VkPhysicalDeviceGroupProperties { + VkStructureType sType; + void* pNext; + uint32_t physicalDeviceCount; + VkPhysicalDevice physicalDevices[VK_MAX_DEVICE_GROUP_SIZE]; + VkBool32 subsetAllocation; +} VkPhysicalDeviceGroupProperties; + +typedef struct VkDeviceGroupDeviceCreateInfo { + VkStructureType sType; + const void* pNext; + uint32_t physicalDeviceCount; + const VkPhysicalDevice* pPhysicalDevices; +} VkDeviceGroupDeviceCreateInfo; + +typedef struct VkBufferMemoryRequirementsInfo2 { + VkStructureType sType; + const void* pNext; + VkBuffer buffer; +} VkBufferMemoryRequirementsInfo2; + +typedef struct VkImageMemoryRequirementsInfo2 { + VkStructureType sType; + const void* pNext; + VkImage image; +} VkImageMemoryRequirementsInfo2; + +typedef struct VkImageSparseMemoryRequirementsInfo2 { + VkStructureType sType; + const void* pNext; + VkImage image; +} VkImageSparseMemoryRequirementsInfo2; + +typedef struct VkMemoryRequirements2 { + VkStructureType sType; + void* pNext; + VkMemoryRequirements memoryRequirements; +} VkMemoryRequirements2; + +typedef struct VkSparseImageMemoryRequirements2 { + VkStructureType sType; + void* pNext; + VkSparseImageMemoryRequirements memoryRequirements; +} VkSparseImageMemoryRequirements2; + +typedef struct VkPhysicalDeviceFeatures2 { + VkStructureType sType; + void* pNext; + VkPhysicalDeviceFeatures features; +} VkPhysicalDeviceFeatures2; + +typedef struct VkPhysicalDeviceProperties2 { + VkStructureType sType; + void* pNext; + VkPhysicalDeviceProperties properties; +} VkPhysicalDeviceProperties2; + +typedef struct VkFormatProperties2 { + VkStructureType sType; + void* pNext; + VkFormatProperties formatProperties; +} VkFormatProperties2; + +typedef struct VkImageFormatProperties2 { + VkStructureType sType; + void* pNext; + VkImageFormatProperties imageFormatProperties; +} VkImageFormatProperties2; + +typedef struct VkPhysicalDeviceImageFormatInfo2 { + VkStructureType sType; + const void* pNext; + VkFormat format; + VkImageType type; + VkImageTiling tiling; + VkImageUsageFlags usage; + VkImageCreateFlags flags; +} VkPhysicalDeviceImageFormatInfo2; + +typedef struct VkQueueFamilyProperties2 { + VkStructureType sType; + void* pNext; + VkQueueFamilyProperties queueFamilyProperties; +} VkQueueFamilyProperties2; + +typedef struct VkPhysicalDeviceMemoryProperties2 { + VkStructureType sType; + void* pNext; + VkPhysicalDeviceMemoryProperties memoryProperties; +} VkPhysicalDeviceMemoryProperties2; + +typedef struct VkSparseImageFormatProperties2 { + VkStructureType sType; + void* pNext; + VkSparseImageFormatProperties properties; +} VkSparseImageFormatProperties2; + +typedef struct VkPhysicalDeviceSparseImageFormatInfo2 { + VkStructureType sType; + const void* pNext; + VkFormat format; + VkImageType type; + VkSampleCountFlagBits samples; + VkImageUsageFlags usage; + VkImageTiling tiling; +} VkPhysicalDeviceSparseImageFormatInfo2; + +typedef struct VkPhysicalDevicePointClippingProperties { + VkStructureType sType; + void* pNext; + VkPointClippingBehavior pointClippingBehavior; +} VkPhysicalDevicePointClippingProperties; + +typedef struct VkInputAttachmentAspectReference { + uint32_t subpass; + uint32_t inputAttachmentIndex; + VkImageAspectFlags aspectMask; +} VkInputAttachmentAspectReference; + +typedef struct VkRenderPassInputAttachmentAspectCreateInfo { + VkStructureType sType; + const void* pNext; + uint32_t aspectReferenceCount; + const VkInputAttachmentAspectReference* pAspectReferences; +} VkRenderPassInputAttachmentAspectCreateInfo; + +typedef struct VkImageViewUsageCreateInfo { + VkStructureType sType; + const void* pNext; + VkImageUsageFlags usage; +} VkImageViewUsageCreateInfo; + +typedef struct VkPipelineTessellationDomainOriginStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkTessellationDomainOrigin domainOrigin; +} VkPipelineTessellationDomainOriginStateCreateInfo; + +typedef struct VkRenderPassMultiviewCreateInfo { + VkStructureType sType; + const void* pNext; + uint32_t subpassCount; + const uint32_t* pViewMasks; + uint32_t dependencyCount; + const int32_t* pViewOffsets; + uint32_t correlationMaskCount; + const uint32_t* pCorrelationMasks; +} VkRenderPassMultiviewCreateInfo; + +typedef struct VkPhysicalDeviceMultiviewFeatures { + VkStructureType sType; + void* pNext; + VkBool32 multiview; + VkBool32 multiviewGeometryShader; + VkBool32 multiviewTessellationShader; +} VkPhysicalDeviceMultiviewFeatures; + +typedef struct VkPhysicalDeviceMultiviewProperties { + VkStructureType sType; + void* pNext; + uint32_t maxMultiviewViewCount; + uint32_t maxMultiviewInstanceIndex; +} VkPhysicalDeviceMultiviewProperties; + +typedef struct VkPhysicalDeviceVariablePointerFeatures { + VkStructureType sType; + void* pNext; + VkBool32 variablePointersStorageBuffer; + VkBool32 variablePointers; +} VkPhysicalDeviceVariablePointerFeatures; + +typedef struct VkPhysicalDeviceProtectedMemoryFeatures { + VkStructureType sType; + void* pNext; + VkBool32 protectedMemory; +} VkPhysicalDeviceProtectedMemoryFeatures; + +typedef struct VkPhysicalDeviceProtectedMemoryProperties { + VkStructureType sType; + void* pNext; + VkBool32 protectedNoFault; +} VkPhysicalDeviceProtectedMemoryProperties; + +typedef struct VkDeviceQueueInfo2 { + VkStructureType sType; + const void* pNext; + VkDeviceQueueCreateFlags flags; + uint32_t queueFamilyIndex; + uint32_t queueIndex; +} VkDeviceQueueInfo2; + +typedef struct VkProtectedSubmitInfo { + VkStructureType sType; + const void* pNext; + VkBool32 protectedSubmit; +} VkProtectedSubmitInfo; + +typedef struct VkSamplerYcbcrConversionCreateInfo { + VkStructureType sType; + const void* pNext; + VkFormat format; + VkSamplerYcbcrModelConversion ycbcrModel; + VkSamplerYcbcrRange ycbcrRange; + VkComponentMapping components; + VkChromaLocation xChromaOffset; + VkChromaLocation yChromaOffset; + VkFilter chromaFilter; + VkBool32 forceExplicitReconstruction; +} VkSamplerYcbcrConversionCreateInfo; + +typedef struct VkSamplerYcbcrConversionInfo { + VkStructureType sType; + const void* pNext; + VkSamplerYcbcrConversion conversion; +} VkSamplerYcbcrConversionInfo; + +typedef struct VkBindImagePlaneMemoryInfo { + VkStructureType sType; + const void* pNext; + VkImageAspectFlagBits planeAspect; +} VkBindImagePlaneMemoryInfo; + +typedef struct VkImagePlaneMemoryRequirementsInfo { + VkStructureType sType; + const void* pNext; + VkImageAspectFlagBits planeAspect; +} VkImagePlaneMemoryRequirementsInfo; + +typedef struct VkPhysicalDeviceSamplerYcbcrConversionFeatures { + VkStructureType sType; + void* pNext; + VkBool32 samplerYcbcrConversion; +} VkPhysicalDeviceSamplerYcbcrConversionFeatures; + +typedef struct VkSamplerYcbcrConversionImageFormatProperties { + VkStructureType sType; + void* pNext; + uint32_t combinedImageSamplerDescriptorCount; +} VkSamplerYcbcrConversionImageFormatProperties; + +typedef struct VkDescriptorUpdateTemplateEntry { + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + VkDescriptorType descriptorType; + size_t offset; + size_t stride; +} VkDescriptorUpdateTemplateEntry; + +typedef struct VkDescriptorUpdateTemplateCreateInfo { + VkStructureType sType; + void* pNext; + VkDescriptorUpdateTemplateCreateFlags flags; + uint32_t descriptorUpdateEntryCount; + const VkDescriptorUpdateTemplateEntry* pDescriptorUpdateEntries; + VkDescriptorUpdateTemplateType templateType; + VkDescriptorSetLayout descriptorSetLayout; + VkPipelineBindPoint pipelineBindPoint; + VkPipelineLayout pipelineLayout; + uint32_t set; +} VkDescriptorUpdateTemplateCreateInfo; + +typedef struct VkExternalMemoryProperties { + VkExternalMemoryFeatureFlags externalMemoryFeatures; + VkExternalMemoryHandleTypeFlags exportFromImportedHandleTypes; + VkExternalMemoryHandleTypeFlags compatibleHandleTypes; +} VkExternalMemoryProperties; + +typedef struct VkPhysicalDeviceExternalImageFormatInfo { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBits handleType; +} VkPhysicalDeviceExternalImageFormatInfo; + +typedef struct VkExternalImageFormatProperties { + VkStructureType sType; + void* pNext; + VkExternalMemoryProperties externalMemoryProperties; +} VkExternalImageFormatProperties; + +typedef struct VkPhysicalDeviceExternalBufferInfo { + VkStructureType sType; + const void* pNext; + VkBufferCreateFlags flags; + VkBufferUsageFlags usage; + VkExternalMemoryHandleTypeFlagBits handleType; +} VkPhysicalDeviceExternalBufferInfo; + +typedef struct VkExternalBufferProperties { + VkStructureType sType; + void* pNext; + VkExternalMemoryProperties externalMemoryProperties; +} VkExternalBufferProperties; + +typedef struct VkPhysicalDeviceIDProperties { + VkStructureType sType; + void* pNext; + uint8_t deviceUUID[VK_UUID_SIZE]; + uint8_t driverUUID[VK_UUID_SIZE]; + uint8_t deviceLUID[VK_LUID_SIZE]; + uint32_t deviceNodeMask; + VkBool32 deviceLUIDValid; +} VkPhysicalDeviceIDProperties; + +typedef struct VkExternalMemoryImageCreateInfo { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlags handleTypes; +} VkExternalMemoryImageCreateInfo; + +typedef struct VkExternalMemoryBufferCreateInfo { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlags handleTypes; +} VkExternalMemoryBufferCreateInfo; + +typedef struct VkExportMemoryAllocateInfo { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlags handleTypes; +} VkExportMemoryAllocateInfo; + +typedef struct VkPhysicalDeviceExternalFenceInfo { + VkStructureType sType; + const void* pNext; + VkExternalFenceHandleTypeFlagBits handleType; +} VkPhysicalDeviceExternalFenceInfo; + +typedef struct VkExternalFenceProperties { + VkStructureType sType; + void* pNext; + VkExternalFenceHandleTypeFlags exportFromImportedHandleTypes; + VkExternalFenceHandleTypeFlags compatibleHandleTypes; + VkExternalFenceFeatureFlags externalFenceFeatures; +} VkExternalFenceProperties; + +typedef struct VkExportFenceCreateInfo { + VkStructureType sType; + const void* pNext; + VkExternalFenceHandleTypeFlags handleTypes; +} VkExportFenceCreateInfo; + +typedef struct VkExportSemaphoreCreateInfo { + VkStructureType sType; + const void* pNext; + VkExternalSemaphoreHandleTypeFlags handleTypes; +} VkExportSemaphoreCreateInfo; + +typedef struct VkPhysicalDeviceExternalSemaphoreInfo { + VkStructureType sType; + const void* pNext; + VkExternalSemaphoreHandleTypeFlagBits handleType; +} VkPhysicalDeviceExternalSemaphoreInfo; + +typedef struct VkExternalSemaphoreProperties { + VkStructureType sType; + void* pNext; + VkExternalSemaphoreHandleTypeFlags exportFromImportedHandleTypes; + VkExternalSemaphoreHandleTypeFlags compatibleHandleTypes; + VkExternalSemaphoreFeatureFlags externalSemaphoreFeatures; +} VkExternalSemaphoreProperties; + +typedef struct VkPhysicalDeviceMaintenance3Properties { + VkStructureType sType; + void* pNext; + uint32_t maxPerSetDescriptors; + VkDeviceSize maxMemoryAllocationSize; +} VkPhysicalDeviceMaintenance3Properties; + +typedef struct VkDescriptorSetLayoutSupport { + VkStructureType sType; + void* pNext; + VkBool32 supported; +} VkDescriptorSetLayoutSupport; + +typedef struct VkPhysicalDeviceShaderDrawParameterFeatures { + VkStructureType sType; + void* pNext; + VkBool32 shaderDrawParameters; +} VkPhysicalDeviceShaderDrawParameterFeatures; + + +typedef VkResult (VKAPI_PTR *PFN_vkEnumerateInstanceVersion)(uint32_t* pApiVersion); +typedef VkResult (VKAPI_PTR *PFN_vkBindBufferMemory2)(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos); +typedef VkResult (VKAPI_PTR *PFN_vkBindImageMemory2)(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos); +typedef void (VKAPI_PTR *PFN_vkGetDeviceGroupPeerMemoryFeatures)(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures); +typedef void (VKAPI_PTR *PFN_vkCmdSetDeviceMask)(VkCommandBuffer commandBuffer, uint32_t deviceMask); +typedef void (VKAPI_PTR *PFN_vkCmdDispatchBase)(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); +typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceGroups)(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties); +typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements2)(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); +typedef void (VKAPI_PTR *PFN_vkGetBufferMemoryRequirements2)(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); +typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements2)(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures2)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceProperties2)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFormatProperties2)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties2)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties2)(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMemoryProperties2)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties2)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties); +typedef void (VKAPI_PTR *PFN_vkTrimCommandPool)(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags); +typedef void (VKAPI_PTR *PFN_vkGetDeviceQueue2)(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue); +typedef VkResult (VKAPI_PTR *PFN_vkCreateSamplerYcbcrConversion)(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion); +typedef void (VKAPI_PTR *PFN_vkDestroySamplerYcbcrConversion)(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorUpdateTemplate)(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); +typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorUpdateTemplate)(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSetWithTemplate)(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalBufferProperties)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalFenceProperties)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalSemaphoreProperties)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties); +typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutSupport)(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceVersion( + uint32_t* pApiVersion); + +VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory2( + VkDevice device, + uint32_t bindInfoCount, + const VkBindBufferMemoryInfo* pBindInfos); + +VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory2( + VkDevice device, + uint32_t bindInfoCount, + const VkBindImageMemoryInfo* pBindInfos); + +VKAPI_ATTR void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeatures( + VkDevice device, + uint32_t heapIndex, + uint32_t localDeviceIndex, + uint32_t remoteDeviceIndex, + VkPeerMemoryFeatureFlags* pPeerMemoryFeatures); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDeviceMask( + VkCommandBuffer commandBuffer, + uint32_t deviceMask); + +VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBase( + VkCommandBuffer commandBuffer, + uint32_t baseGroupX, + uint32_t baseGroupY, + uint32_t baseGroupZ, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); + +VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroups( + VkInstance instance, + uint32_t* pPhysicalDeviceGroupCount, + VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements2( + VkDevice device, + const VkImageMemoryRequirementsInfo2* pInfo, + VkMemoryRequirements2* pMemoryRequirements); + +VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements2( + VkDevice device, + const VkBufferMemoryRequirementsInfo2* pInfo, + VkMemoryRequirements2* pMemoryRequirements); + +VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements2( + VkDevice device, + const VkImageSparseMemoryRequirementsInfo2* pInfo, + uint32_t* pSparseMemoryRequirementCount, + VkSparseImageMemoryRequirements2* pSparseMemoryRequirements); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures2( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceFeatures2* pFeatures); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties2( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceProperties2* pProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2( + VkPhysicalDevice physicalDevice, + VkFormat format, + VkFormatProperties2* pFormatProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, + VkImageFormatProperties2* pImageFormatProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2( + VkPhysicalDevice physicalDevice, + uint32_t* pQueueFamilyPropertyCount, + VkQueueFamilyProperties2* pQueueFamilyProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceMemoryProperties2* pMemoryProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, + uint32_t* pPropertyCount, + VkSparseImageFormatProperties2* pProperties); + +VKAPI_ATTR void VKAPI_CALL vkTrimCommandPool( + VkDevice device, + VkCommandPool commandPool, + VkCommandPoolTrimFlags flags); + +VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue2( + VkDevice device, + const VkDeviceQueueInfo2* pQueueInfo, + VkQueue* pQueue); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateSamplerYcbcrConversion( + VkDevice device, + const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSamplerYcbcrConversion* pYcbcrConversion); + +VKAPI_ATTR void VKAPI_CALL vkDestroySamplerYcbcrConversion( + VkDevice device, + VkSamplerYcbcrConversion ycbcrConversion, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplate( + VkDevice device, + const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); + +VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorUpdateTemplate( + VkDevice device, + VkDescriptorUpdateTemplate descriptorUpdateTemplate, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSetWithTemplate( + VkDevice device, + VkDescriptorSet descriptorSet, + VkDescriptorUpdateTemplate descriptorUpdateTemplate, + const void* pData); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalBufferProperties( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, + VkExternalBufferProperties* pExternalBufferProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalFenceProperties( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, + VkExternalFenceProperties* pExternalFenceProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphoreProperties( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, + VkExternalSemaphoreProperties* pExternalSemaphoreProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutSupport( + VkDevice device, + const VkDescriptorSetLayoutCreateInfo* pCreateInfo, + VkDescriptorSetLayoutSupport* pSupport); +#endif + +#define VK_KHR_surface 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) + +#define VK_KHR_SURFACE_SPEC_VERSION 25 +#define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface" +#define VK_COLORSPACE_SRGB_NONLINEAR_KHR VK_COLOR_SPACE_SRGB_NONLINEAR_KHR + + +typedef enum VkColorSpaceKHR { + VK_COLOR_SPACE_SRGB_NONLINEAR_KHR = 0, + VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104001, + VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT = 1000104002, + VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = 1000104003, + VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104004, + VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104005, + VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104006, + VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104007, + VK_COLOR_SPACE_HDR10_ST2084_EXT = 1000104008, + VK_COLOR_SPACE_DOLBYVISION_EXT = 1000104009, + VK_COLOR_SPACE_HDR10_HLG_EXT = 1000104010, + VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011, + VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012, + VK_COLOR_SPACE_PASS_THROUGH_EXT = 1000104013, + VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT = 1000104014, + VK_COLOR_SPACE_BEGIN_RANGE_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, + VK_COLOR_SPACE_END_RANGE_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, + VK_COLOR_SPACE_RANGE_SIZE_KHR = (VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - VK_COLOR_SPACE_SRGB_NONLINEAR_KHR + 1), + VK_COLOR_SPACE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkColorSpaceKHR; + +typedef enum VkPresentModeKHR { + VK_PRESENT_MODE_IMMEDIATE_KHR = 0, + VK_PRESENT_MODE_MAILBOX_KHR = 1, + VK_PRESENT_MODE_FIFO_KHR = 2, + VK_PRESENT_MODE_FIFO_RELAXED_KHR = 3, + VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR = 1000111000, + VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR = 1000111001, + VK_PRESENT_MODE_BEGIN_RANGE_KHR = VK_PRESENT_MODE_IMMEDIATE_KHR, + VK_PRESENT_MODE_END_RANGE_KHR = VK_PRESENT_MODE_FIFO_RELAXED_KHR, + VK_PRESENT_MODE_RANGE_SIZE_KHR = (VK_PRESENT_MODE_FIFO_RELAXED_KHR - VK_PRESENT_MODE_IMMEDIATE_KHR + 1), + VK_PRESENT_MODE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkPresentModeKHR; + + +typedef enum VkSurfaceTransformFlagBitsKHR { + VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001, + VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002, + VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004, + VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080, + VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100, + VK_SURFACE_TRANSFORM_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkSurfaceTransformFlagBitsKHR; +typedef VkFlags VkSurfaceTransformFlagsKHR; + +typedef enum VkCompositeAlphaFlagBitsKHR { + VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, + VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002, + VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004, + VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008, + VK_COMPOSITE_ALPHA_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkCompositeAlphaFlagBitsKHR; +typedef VkFlags VkCompositeAlphaFlagsKHR; + +typedef struct VkSurfaceCapabilitiesKHR { + uint32_t minImageCount; + uint32_t maxImageCount; + VkExtent2D currentExtent; + VkExtent2D minImageExtent; + VkExtent2D maxImageExtent; + uint32_t maxImageArrayLayers; + VkSurfaceTransformFlagsKHR supportedTransforms; + VkSurfaceTransformFlagBitsKHR currentTransform; + VkCompositeAlphaFlagsKHR supportedCompositeAlpha; + VkImageUsageFlags supportedUsageFlags; +} VkSurfaceCapabilitiesKHR; + +typedef struct VkSurfaceFormatKHR { + VkFormat format; + VkColorSpaceKHR colorSpace; +} VkSurfaceFormatKHR; + + +typedef void (VKAPI_PTR *PFN_vkDestroySurfaceKHR)(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkDestroySurfaceKHR( + VkInstance instance, + VkSurfaceKHR surface, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceSupportKHR( + VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + VkSurfaceKHR surface, + VkBool32* pSupported); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilitiesKHR( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + VkSurfaceCapabilitiesKHR* pSurfaceCapabilities); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormatsKHR( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + uint32_t* pSurfaceFormatCount, + VkSurfaceFormatKHR* pSurfaceFormats); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModesKHR( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + uint32_t* pPresentModeCount, + VkPresentModeKHR* pPresentModes); +#endif + +#define VK_KHR_swapchain 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) + +#define VK_KHR_SWAPCHAIN_SPEC_VERSION 70 +#define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain" + + +typedef enum VkSwapchainCreateFlagBitsKHR { + VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = 0x00000001, + VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR = 0x00000002, + VK_SWAPCHAIN_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkSwapchainCreateFlagBitsKHR; +typedef VkFlags VkSwapchainCreateFlagsKHR; + +typedef enum VkDeviceGroupPresentModeFlagBitsKHR { + VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR = 0x00000001, + VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR = 0x00000002, + VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR = 0x00000004, + VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR = 0x00000008, + VK_DEVICE_GROUP_PRESENT_MODE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkDeviceGroupPresentModeFlagBitsKHR; +typedef VkFlags VkDeviceGroupPresentModeFlagsKHR; + +typedef struct VkSwapchainCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkSwapchainCreateFlagsKHR flags; + VkSurfaceKHR surface; + uint32_t minImageCount; + VkFormat imageFormat; + VkColorSpaceKHR imageColorSpace; + VkExtent2D imageExtent; + uint32_t imageArrayLayers; + VkImageUsageFlags imageUsage; + VkSharingMode imageSharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t* pQueueFamilyIndices; + VkSurfaceTransformFlagBitsKHR preTransform; + VkCompositeAlphaFlagBitsKHR compositeAlpha; + VkPresentModeKHR presentMode; + VkBool32 clipped; + VkSwapchainKHR oldSwapchain; +} VkSwapchainCreateInfoKHR; + +typedef struct VkPresentInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t waitSemaphoreCount; + const VkSemaphore* pWaitSemaphores; + uint32_t swapchainCount; + const VkSwapchainKHR* pSwapchains; + const uint32_t* pImageIndices; + VkResult* pResults; +} VkPresentInfoKHR; + +typedef struct VkImageSwapchainCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkSwapchainKHR swapchain; +} VkImageSwapchainCreateInfoKHR; + +typedef struct VkBindImageMemorySwapchainInfoKHR { + VkStructureType sType; + const void* pNext; + VkSwapchainKHR swapchain; + uint32_t imageIndex; +} VkBindImageMemorySwapchainInfoKHR; + +typedef struct VkAcquireNextImageInfoKHR { + VkStructureType sType; + const void* pNext; + VkSwapchainKHR swapchain; + uint64_t timeout; + VkSemaphore semaphore; + VkFence fence; + uint32_t deviceMask; +} VkAcquireNextImageInfoKHR; + +typedef struct VkDeviceGroupPresentCapabilitiesKHR { + VkStructureType sType; + const void* pNext; + uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE]; + VkDeviceGroupPresentModeFlagsKHR modes; +} VkDeviceGroupPresentCapabilitiesKHR; + +typedef struct VkDeviceGroupPresentInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t swapchainCount; + const uint32_t* pDeviceMasks; + VkDeviceGroupPresentModeFlagBitsKHR mode; +} VkDeviceGroupPresentInfoKHR; + +typedef struct VkDeviceGroupSwapchainCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkDeviceGroupPresentModeFlagsKHR modes; +} VkDeviceGroupSwapchainCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateSwapchainKHR)(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain); +typedef void (VKAPI_PTR *PFN_vkDestroySwapchainKHR)(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainImagesKHR)(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages); +typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImageKHR)(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex); +typedef VkResult (VKAPI_PTR *PFN_vkQueuePresentKHR)(VkQueue queue, const VkPresentInfoKHR* pPresentInfo); +typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupPresentCapabilitiesKHR)(VkDevice device, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities); +typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModesKHR)(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR* pModes); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDevicePresentRectanglesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pRectCount, VkRect2D* pRects); +typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImage2KHR)(VkDevice device, const VkAcquireNextImageInfoKHR* pAcquireInfo, uint32_t* pImageIndex); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateSwapchainKHR( + VkDevice device, + const VkSwapchainCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSwapchainKHR* pSwapchain); + +VKAPI_ATTR void VKAPI_CALL vkDestroySwapchainKHR( + VkDevice device, + VkSwapchainKHR swapchain, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainImagesKHR( + VkDevice device, + VkSwapchainKHR swapchain, + uint32_t* pSwapchainImageCount, + VkImage* pSwapchainImages); + +VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImageKHR( + VkDevice device, + VkSwapchainKHR swapchain, + uint64_t timeout, + VkSemaphore semaphore, + VkFence fence, + uint32_t* pImageIndex); + +VKAPI_ATTR VkResult VKAPI_CALL vkQueuePresentKHR( + VkQueue queue, + const VkPresentInfoKHR* pPresentInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupPresentCapabilitiesKHR( + VkDevice device, + VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModesKHR( + VkDevice device, + VkSurfaceKHR surface, + VkDeviceGroupPresentModeFlagsKHR* pModes); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDevicePresentRectanglesKHR( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + uint32_t* pRectCount, + VkRect2D* pRects); + +VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImage2KHR( + VkDevice device, + const VkAcquireNextImageInfoKHR* pAcquireInfo, + uint32_t* pImageIndex); +#endif + +#define VK_KHR_display 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayKHR) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayModeKHR) + +#define VK_KHR_DISPLAY_SPEC_VERSION 21 +#define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display" + + +typedef enum VkDisplayPlaneAlphaFlagBitsKHR { + VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, + VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002, + VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004, + VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008, + VK_DISPLAY_PLANE_ALPHA_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkDisplayPlaneAlphaFlagBitsKHR; +typedef VkFlags VkDisplayPlaneAlphaFlagsKHR; +typedef VkFlags VkDisplayModeCreateFlagsKHR; +typedef VkFlags VkDisplaySurfaceCreateFlagsKHR; + +typedef struct VkDisplayPropertiesKHR { + VkDisplayKHR display; + const char* displayName; + VkExtent2D physicalDimensions; + VkExtent2D physicalResolution; + VkSurfaceTransformFlagsKHR supportedTransforms; + VkBool32 planeReorderPossible; + VkBool32 persistentContent; +} VkDisplayPropertiesKHR; + +typedef struct VkDisplayModeParametersKHR { + VkExtent2D visibleRegion; + uint32_t refreshRate; +} VkDisplayModeParametersKHR; + +typedef struct VkDisplayModePropertiesKHR { + VkDisplayModeKHR displayMode; + VkDisplayModeParametersKHR parameters; +} VkDisplayModePropertiesKHR; + +typedef struct VkDisplayModeCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkDisplayModeCreateFlagsKHR flags; + VkDisplayModeParametersKHR parameters; +} VkDisplayModeCreateInfoKHR; + +typedef struct VkDisplayPlaneCapabilitiesKHR { + VkDisplayPlaneAlphaFlagsKHR supportedAlpha; + VkOffset2D minSrcPosition; + VkOffset2D maxSrcPosition; + VkExtent2D minSrcExtent; + VkExtent2D maxSrcExtent; + VkOffset2D minDstPosition; + VkOffset2D maxDstPosition; + VkExtent2D minDstExtent; + VkExtent2D maxDstExtent; +} VkDisplayPlaneCapabilitiesKHR; + +typedef struct VkDisplayPlanePropertiesKHR { + VkDisplayKHR currentDisplay; + uint32_t currentStackIndex; +} VkDisplayPlanePropertiesKHR; + +typedef struct VkDisplaySurfaceCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkDisplaySurfaceCreateFlagsKHR flags; + VkDisplayModeKHR displayMode; + uint32_t planeIndex; + uint32_t planeStackIndex; + VkSurfaceTransformFlagBitsKHR transform; + float globalAlpha; + VkDisplayPlaneAlphaFlagBitsKHR alphaMode; + VkExtent2D imageExtent; +} VkDisplaySurfaceCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceDisplayPropertiesKHR)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPropertiesKHR* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPlanePropertiesKHR* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetDisplayPlaneSupportedDisplaysKHR)(VkPhysicalDevice physicalDevice, uint32_t planeIndex, uint32_t* pDisplayCount, VkDisplayKHR* pDisplays); +typedef VkResult (VKAPI_PTR *PFN_vkGetDisplayModePropertiesKHR)(VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint32_t* pPropertyCount, VkDisplayModePropertiesKHR* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkCreateDisplayModeKHR)(VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode); +typedef VkResult (VKAPI_PTR *PFN_vkGetDisplayPlaneCapabilitiesKHR)(VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities); +typedef VkResult (VKAPI_PTR *PFN_vkCreateDisplayPlaneSurfaceKHR)(VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceDisplayPropertiesKHR( + VkPhysicalDevice physicalDevice, + uint32_t* pPropertyCount, + VkDisplayPropertiesKHR* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceDisplayPlanePropertiesKHR( + VkPhysicalDevice physicalDevice, + uint32_t* pPropertyCount, + VkDisplayPlanePropertiesKHR* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayPlaneSupportedDisplaysKHR( + VkPhysicalDevice physicalDevice, + uint32_t planeIndex, + uint32_t* pDisplayCount, + VkDisplayKHR* pDisplays); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayModePropertiesKHR( + VkPhysicalDevice physicalDevice, + VkDisplayKHR display, + uint32_t* pPropertyCount, + VkDisplayModePropertiesKHR* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDisplayModeKHR( + VkPhysicalDevice physicalDevice, + VkDisplayKHR display, + const VkDisplayModeCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDisplayModeKHR* pMode); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayPlaneCapabilitiesKHR( + VkPhysicalDevice physicalDevice, + VkDisplayModeKHR mode, + uint32_t planeIndex, + VkDisplayPlaneCapabilitiesKHR* pCapabilities); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDisplayPlaneSurfaceKHR( + VkInstance instance, + const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); +#endif + +#define VK_KHR_display_swapchain 1 +#define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9 +#define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain" + +typedef struct VkDisplayPresentInfoKHR { + VkStructureType sType; + const void* pNext; + VkRect2D srcRect; + VkRect2D dstRect; + VkBool32 persistent; +} VkDisplayPresentInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateSharedSwapchainsKHR)(VkDevice device, uint32_t swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateSharedSwapchainsKHR( + VkDevice device, + uint32_t swapchainCount, + const VkSwapchainCreateInfoKHR* pCreateInfos, + const VkAllocationCallbacks* pAllocator, + VkSwapchainKHR* pSwapchains); +#endif + +#define VK_KHR_sampler_mirror_clamp_to_edge 1 +#define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 1 +#define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME "VK_KHR_sampler_mirror_clamp_to_edge" + + +#define VK_KHR_multiview 1 +#define VK_KHR_MULTIVIEW_SPEC_VERSION 1 +#define VK_KHR_MULTIVIEW_EXTENSION_NAME "VK_KHR_multiview" + +typedef VkRenderPassMultiviewCreateInfo VkRenderPassMultiviewCreateInfoKHR; + +typedef VkPhysicalDeviceMultiviewFeatures VkPhysicalDeviceMultiviewFeaturesKHR; + +typedef VkPhysicalDeviceMultiviewProperties VkPhysicalDeviceMultiviewPropertiesKHR; + + + +#define VK_KHR_get_physical_device_properties2 1 +#define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 1 +#define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2" + +typedef VkPhysicalDeviceFeatures2 VkPhysicalDeviceFeatures2KHR; + +typedef VkPhysicalDeviceProperties2 VkPhysicalDeviceProperties2KHR; + +typedef VkFormatProperties2 VkFormatProperties2KHR; + +typedef VkImageFormatProperties2 VkImageFormatProperties2KHR; + +typedef VkPhysicalDeviceImageFormatInfo2 VkPhysicalDeviceImageFormatInfo2KHR; + +typedef VkQueueFamilyProperties2 VkQueueFamilyProperties2KHR; + +typedef VkPhysicalDeviceMemoryProperties2 VkPhysicalDeviceMemoryProperties2KHR; + +typedef VkSparseImageFormatProperties2 VkSparseImageFormatProperties2KHR; + +typedef VkPhysicalDeviceSparseImageFormatInfo2 VkPhysicalDeviceSparseImageFormatInfo2KHR; + + +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures2KHR)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceProperties2KHR)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFormatProperties2KHR)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR)(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMemoryProperties2KHR)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures2KHR( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceFeatures2* pFeatures); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties2KHR( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceProperties2* pProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2KHR( + VkPhysicalDevice physicalDevice, + VkFormat format, + VkFormatProperties2* pFormatProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2KHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, + VkImageFormatProperties2* pImageFormatProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2KHR( + VkPhysicalDevice physicalDevice, + uint32_t* pQueueFamilyPropertyCount, + VkQueueFamilyProperties2* pQueueFamilyProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2KHR( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceMemoryProperties2* pMemoryProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2KHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, + uint32_t* pPropertyCount, + VkSparseImageFormatProperties2* pProperties); +#endif + +#define VK_KHR_device_group 1 +#define VK_KHR_DEVICE_GROUP_SPEC_VERSION 3 +#define VK_KHR_DEVICE_GROUP_EXTENSION_NAME "VK_KHR_device_group" + +typedef VkPeerMemoryFeatureFlags VkPeerMemoryFeatureFlagsKHR; + +typedef VkPeerMemoryFeatureFlagBits VkPeerMemoryFeatureFlagBitsKHR; + +typedef VkMemoryAllocateFlags VkMemoryAllocateFlagsKHR; + +typedef VkMemoryAllocateFlagBits VkMemoryAllocateFlagBitsKHR; + + +typedef VkMemoryAllocateFlagsInfo VkMemoryAllocateFlagsInfoKHR; + +typedef VkDeviceGroupRenderPassBeginInfo VkDeviceGroupRenderPassBeginInfoKHR; + +typedef VkDeviceGroupCommandBufferBeginInfo VkDeviceGroupCommandBufferBeginInfoKHR; + +typedef VkDeviceGroupSubmitInfo VkDeviceGroupSubmitInfoKHR; + +typedef VkDeviceGroupBindSparseInfo VkDeviceGroupBindSparseInfoKHR; + +typedef VkBindBufferMemoryDeviceGroupInfo VkBindBufferMemoryDeviceGroupInfoKHR; + +typedef VkBindImageMemoryDeviceGroupInfo VkBindImageMemoryDeviceGroupInfoKHR; + + +typedef void (VKAPI_PTR *PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR)(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures); +typedef void (VKAPI_PTR *PFN_vkCmdSetDeviceMaskKHR)(VkCommandBuffer commandBuffer, uint32_t deviceMask); +typedef void (VKAPI_PTR *PFN_vkCmdDispatchBaseKHR)(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeaturesKHR( + VkDevice device, + uint32_t heapIndex, + uint32_t localDeviceIndex, + uint32_t remoteDeviceIndex, + VkPeerMemoryFeatureFlags* pPeerMemoryFeatures); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDeviceMaskKHR( + VkCommandBuffer commandBuffer, + uint32_t deviceMask); + +VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBaseKHR( + VkCommandBuffer commandBuffer, + uint32_t baseGroupX, + uint32_t baseGroupY, + uint32_t baseGroupZ, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); +#endif + +#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" + + +#define VK_KHR_maintenance1 1 +#define VK_KHR_MAINTENANCE1_SPEC_VERSION 2 +#define VK_KHR_MAINTENANCE1_EXTENSION_NAME "VK_KHR_maintenance1" + +typedef VkCommandPoolTrimFlags VkCommandPoolTrimFlagsKHR; + + +typedef void (VKAPI_PTR *PFN_vkTrimCommandPoolKHR)(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkTrimCommandPoolKHR( + VkDevice device, + VkCommandPool commandPool, + VkCommandPoolTrimFlags flags); +#endif + +#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" +#define VK_MAX_DEVICE_GROUP_SIZE_KHR VK_MAX_DEVICE_GROUP_SIZE + +typedef VkPhysicalDeviceGroupProperties VkPhysicalDeviceGroupPropertiesKHR; + +typedef VkDeviceGroupDeviceCreateInfo VkDeviceGroupDeviceCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceGroupsKHR)(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroupsKHR( + VkInstance instance, + uint32_t* pPhysicalDeviceGroupCount, + VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties); +#endif + +#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" +#define VK_LUID_SIZE_KHR VK_LUID_SIZE + +typedef VkExternalMemoryHandleTypeFlags VkExternalMemoryHandleTypeFlagsKHR; + +typedef VkExternalMemoryHandleTypeFlagBits VkExternalMemoryHandleTypeFlagBitsKHR; + +typedef VkExternalMemoryFeatureFlags VkExternalMemoryFeatureFlagsKHR; + +typedef VkExternalMemoryFeatureFlagBits VkExternalMemoryFeatureFlagBitsKHR; + + +typedef VkExternalMemoryProperties VkExternalMemoryPropertiesKHR; + +typedef VkPhysicalDeviceExternalImageFormatInfo VkPhysicalDeviceExternalImageFormatInfoKHR; + +typedef VkExternalImageFormatProperties VkExternalImageFormatPropertiesKHR; + +typedef VkPhysicalDeviceExternalBufferInfo VkPhysicalDeviceExternalBufferInfoKHR; + +typedef VkExternalBufferProperties VkExternalBufferPropertiesKHR; + +typedef VkPhysicalDeviceIDProperties VkPhysicalDeviceIDPropertiesKHR; + + +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalBufferPropertiesKHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, + VkExternalBufferProperties* pExternalBufferProperties); +#endif + +#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" +#define VK_QUEUE_FAMILY_EXTERNAL_KHR VK_QUEUE_FAMILY_EXTERNAL + +typedef VkExternalMemoryImageCreateInfo VkExternalMemoryImageCreateInfoKHR; + +typedef VkExternalMemoryBufferCreateInfo VkExternalMemoryBufferCreateInfoKHR; + +typedef VkExportMemoryAllocateInfo VkExportMemoryAllocateInfoKHR; + + + +#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" + +typedef struct VkImportMemoryFdInfoKHR { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBits handleType; + int fd; +} VkImportMemoryFdInfoKHR; + +typedef struct VkMemoryFdPropertiesKHR { + VkStructureType sType; + void* pNext; + uint32_t memoryTypeBits; +} VkMemoryFdPropertiesKHR; + +typedef struct VkMemoryGetFdInfoKHR { + VkStructureType sType; + const void* pNext; + VkDeviceMemory memory; + VkExternalMemoryHandleTypeFlagBits handleType; +} VkMemoryGetFdInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryFdKHR)(VkDevice device, const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd); +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryFdPropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, int fd, VkMemoryFdPropertiesKHR* pMemoryFdProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryFdKHR( + VkDevice device, + const VkMemoryGetFdInfoKHR* pGetFdInfo, + int* pFd); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryFdPropertiesKHR( + VkDevice device, + VkExternalMemoryHandleTypeFlagBits handleType, + int fd, + VkMemoryFdPropertiesKHR* pMemoryFdProperties); +#endif + +#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" + +typedef VkExternalSemaphoreHandleTypeFlags VkExternalSemaphoreHandleTypeFlagsKHR; + +typedef VkExternalSemaphoreHandleTypeFlagBits VkExternalSemaphoreHandleTypeFlagBitsKHR; + +typedef VkExternalSemaphoreFeatureFlags VkExternalSemaphoreFeatureFlagsKHR; + +typedef VkExternalSemaphoreFeatureFlagBits VkExternalSemaphoreFeatureFlagBitsKHR; + + +typedef VkPhysicalDeviceExternalSemaphoreInfo VkPhysicalDeviceExternalSemaphoreInfoKHR; + +typedef VkExternalSemaphoreProperties VkExternalSemaphorePropertiesKHR; + + +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, + VkExternalSemaphoreProperties* pExternalSemaphoreProperties); +#endif + +#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" + +typedef VkSemaphoreImportFlags VkSemaphoreImportFlagsKHR; + +typedef VkSemaphoreImportFlagBits VkSemaphoreImportFlagBitsKHR; + + +typedef VkExportSemaphoreCreateInfo VkExportSemaphoreCreateInfoKHR; + + + +#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" + +typedef struct VkImportSemaphoreFdInfoKHR { + VkStructureType sType; + const void* pNext; + VkSemaphore semaphore; + VkSemaphoreImportFlags flags; + VkExternalSemaphoreHandleTypeFlagBits handleType; + int fd; +} VkImportSemaphoreFdInfoKHR; + +typedef struct VkSemaphoreGetFdInfoKHR { + VkStructureType sType; + const void* pNext; + VkSemaphore semaphore; + VkExternalSemaphoreHandleTypeFlagBits handleType; +} VkSemaphoreGetFdInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreFdKHR)(VkDevice device, const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo); +typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreFdKHR)(VkDevice device, const VkSemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreFdKHR( + VkDevice device, + const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreFdKHR( + VkDevice device, + const VkSemaphoreGetFdInfoKHR* pGetFdInfo, + int* pFd); +#endif + +#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" + +typedef struct VkPhysicalDevicePushDescriptorPropertiesKHR { + VkStructureType sType; + void* pNext; + uint32_t maxPushDescriptors; +} VkPhysicalDevicePushDescriptorPropertiesKHR; + + +typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetKHR)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites); +typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetWithTemplateKHR)(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetKHR( + VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout layout, + uint32_t set, + uint32_t descriptorWriteCount, + const VkWriteDescriptorSet* pDescriptorWrites); + +VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetWithTemplateKHR( + VkCommandBuffer commandBuffer, + VkDescriptorUpdateTemplate descriptorUpdateTemplate, + VkPipelineLayout layout, + uint32_t set, + const void* pData); +#endif + +#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" + +typedef VkPhysicalDevice16BitStorageFeatures VkPhysicalDevice16BitStorageFeaturesKHR; + + + +#define VK_KHR_incremental_present 1 +#define VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION 1 +#define VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME "VK_KHR_incremental_present" + +typedef struct VkRectLayerKHR { + VkOffset2D offset; + VkExtent2D extent; + uint32_t layer; +} VkRectLayerKHR; + +typedef struct VkPresentRegionKHR { + uint32_t rectangleCount; + const VkRectLayerKHR* pRectangles; +} VkPresentRegionKHR; + +typedef struct VkPresentRegionsKHR { + VkStructureType sType; + const void* pNext; + uint32_t swapchainCount; + const VkPresentRegionKHR* pRegions; +} VkPresentRegionsKHR; + + + +#define VK_KHR_descriptor_update_template 1 +typedef VkDescriptorUpdateTemplate VkDescriptorUpdateTemplateKHR; + + +#define VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION 1 +#define VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME "VK_KHR_descriptor_update_template" + +typedef VkDescriptorUpdateTemplateType VkDescriptorUpdateTemplateTypeKHR; + + +typedef VkDescriptorUpdateTemplateCreateFlags VkDescriptorUpdateTemplateCreateFlagsKHR; + + +typedef VkDescriptorUpdateTemplateEntry VkDescriptorUpdateTemplateEntryKHR; + +typedef VkDescriptorUpdateTemplateCreateInfo VkDescriptorUpdateTemplateCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorUpdateTemplateKHR)(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); +typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorUpdateTemplateKHR)(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSetWithTemplateKHR)(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplateKHR( + VkDevice device, + const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); + +VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorUpdateTemplateKHR( + VkDevice device, + VkDescriptorUpdateTemplate descriptorUpdateTemplate, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSetWithTemplateKHR( + VkDevice device, + VkDescriptorSet descriptorSet, + VkDescriptorUpdateTemplate descriptorUpdateTemplate, + const void* pData); +#endif + +#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" + +typedef struct VkSharedPresentSurfaceCapabilitiesKHR { + VkStructureType sType; + void* pNext; + VkImageUsageFlags sharedPresentSupportedUsageFlags; +} VkSharedPresentSurfaceCapabilitiesKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainStatusKHR)(VkDevice device, VkSwapchainKHR swapchain); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainStatusKHR( + VkDevice device, + VkSwapchainKHR swapchain); +#endif + +#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" + +typedef VkExternalFenceHandleTypeFlags VkExternalFenceHandleTypeFlagsKHR; + +typedef VkExternalFenceHandleTypeFlagBits VkExternalFenceHandleTypeFlagBitsKHR; + +typedef VkExternalFenceFeatureFlags VkExternalFenceFeatureFlagsKHR; + +typedef VkExternalFenceFeatureFlagBits VkExternalFenceFeatureFlagBitsKHR; + + +typedef VkPhysicalDeviceExternalFenceInfo VkPhysicalDeviceExternalFenceInfoKHR; + +typedef VkExternalFenceProperties VkExternalFencePropertiesKHR; + + +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalFencePropertiesKHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, + VkExternalFenceProperties* pExternalFenceProperties); +#endif + +#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" + +typedef VkFenceImportFlags VkFenceImportFlagsKHR; + +typedef VkFenceImportFlagBits VkFenceImportFlagBitsKHR; + + +typedef VkExportFenceCreateInfo VkExportFenceCreateInfoKHR; + + + +#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" + +typedef struct VkImportFenceFdInfoKHR { + VkStructureType sType; + const void* pNext; + VkFence fence; + VkFenceImportFlags flags; + VkExternalFenceHandleTypeFlagBits handleType; + int fd; +} VkImportFenceFdInfoKHR; + +typedef struct VkFenceGetFdInfoKHR { + VkStructureType sType; + const void* pNext; + VkFence fence; + VkExternalFenceHandleTypeFlagBits handleType; +} VkFenceGetFdInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkImportFenceFdKHR)(VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo); +typedef VkResult (VKAPI_PTR *PFN_vkGetFenceFdKHR)(VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkImportFenceFdKHR( + VkDevice device, + const VkImportFenceFdInfoKHR* pImportFenceFdInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceFdKHR( + VkDevice device, + const VkFenceGetFdInfoKHR* pGetFdInfo, + int* pFd); +#endif + +#define VK_KHR_maintenance2 1 +#define VK_KHR_MAINTENANCE2_SPEC_VERSION 1 +#define VK_KHR_MAINTENANCE2_EXTENSION_NAME "VK_KHR_maintenance2" + +typedef VkPointClippingBehavior VkPointClippingBehaviorKHR; + +typedef VkTessellationDomainOrigin VkTessellationDomainOriginKHR; + + +typedef VkPhysicalDevicePointClippingProperties VkPhysicalDevicePointClippingPropertiesKHR; + +typedef VkRenderPassInputAttachmentAspectCreateInfo VkRenderPassInputAttachmentAspectCreateInfoKHR; + +typedef VkInputAttachmentAspectReference VkInputAttachmentAspectReferenceKHR; + +typedef VkImageViewUsageCreateInfo VkImageViewUsageCreateInfoKHR; + +typedef VkPipelineTessellationDomainOriginStateCreateInfo VkPipelineTessellationDomainOriginStateCreateInfoKHR; + + + +#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" + +typedef struct VkPhysicalDeviceSurfaceInfo2KHR { + VkStructureType sType; + const void* pNext; + VkSurfaceKHR surface; +} VkPhysicalDeviceSurfaceInfo2KHR; + +typedef struct VkSurfaceCapabilities2KHR { + VkStructureType sType; + void* pNext; + VkSurfaceCapabilitiesKHR surfaceCapabilities; +} VkSurfaceCapabilities2KHR; + +typedef struct VkSurfaceFormat2KHR { + VkStructureType sType; + void* pNext; + VkSurfaceFormatKHR surfaceFormat; +} VkSurfaceFormat2KHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilities2KHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, + VkSurfaceCapabilities2KHR* pSurfaceCapabilities); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormats2KHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, + uint32_t* pSurfaceFormatCount, + VkSurfaceFormat2KHR* pSurfaceFormats); +#endif + +#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" + +typedef VkPhysicalDeviceVariablePointerFeatures VkPhysicalDeviceVariablePointerFeaturesKHR; + + + +#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" + +typedef VkMemoryDedicatedRequirements VkMemoryDedicatedRequirementsKHR; + +typedef VkMemoryDedicatedAllocateInfo VkMemoryDedicatedAllocateInfoKHR; + + + +#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" + + +#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" + + +#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" + +typedef VkBufferMemoryRequirementsInfo2 VkBufferMemoryRequirementsInfo2KHR; + +typedef VkImageMemoryRequirementsInfo2 VkImageMemoryRequirementsInfo2KHR; + +typedef VkImageSparseMemoryRequirementsInfo2 VkImageSparseMemoryRequirementsInfo2KHR; + +typedef VkMemoryRequirements2 VkMemoryRequirements2KHR; + +typedef VkSparseImageMemoryRequirements2 VkSparseImageMemoryRequirements2KHR; + + +typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements2KHR)(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); +typedef void (VKAPI_PTR *PFN_vkGetBufferMemoryRequirements2KHR)(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); +typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements2KHR)(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements2KHR( + VkDevice device, + const VkImageMemoryRequirementsInfo2* pInfo, + VkMemoryRequirements2* pMemoryRequirements); + +VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements2KHR( + VkDevice device, + const VkBufferMemoryRequirementsInfo2* pInfo, + VkMemoryRequirements2* pMemoryRequirements); + +VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements2KHR( + VkDevice device, + const VkImageSparseMemoryRequirementsInfo2* pInfo, + uint32_t* pSparseMemoryRequirementCount, + VkSparseImageMemoryRequirements2* pSparseMemoryRequirements); +#endif + +#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" + +typedef struct VkImageFormatListCreateInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t viewFormatCount; + const VkFormat* pViewFormats; +} VkImageFormatListCreateInfoKHR; + + + +#define VK_KHR_sampler_ycbcr_conversion 1 +typedef VkSamplerYcbcrConversion VkSamplerYcbcrConversionKHR; + + +#define VK_KHR_SAMPLER_YCBCR_CONVERSION_SPEC_VERSION 1 +#define VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME "VK_KHR_sampler_ycbcr_conversion" + +typedef VkSamplerYcbcrModelConversion VkSamplerYcbcrModelConversionKHR; + +typedef VkSamplerYcbcrRange VkSamplerYcbcrRangeKHR; + +typedef VkChromaLocation VkChromaLocationKHR; + + +typedef VkSamplerYcbcrConversionCreateInfo VkSamplerYcbcrConversionCreateInfoKHR; + +typedef VkSamplerYcbcrConversionInfo VkSamplerYcbcrConversionInfoKHR; + +typedef VkBindImagePlaneMemoryInfo VkBindImagePlaneMemoryInfoKHR; + +typedef VkImagePlaneMemoryRequirementsInfo VkImagePlaneMemoryRequirementsInfoKHR; + +typedef VkPhysicalDeviceSamplerYcbcrConversionFeatures VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR; + +typedef VkSamplerYcbcrConversionImageFormatProperties VkSamplerYcbcrConversionImageFormatPropertiesKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateSamplerYcbcrConversionKHR)(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion); +typedef void (VKAPI_PTR *PFN_vkDestroySamplerYcbcrConversionKHR)(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateSamplerYcbcrConversionKHR( + VkDevice device, + const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSamplerYcbcrConversion* pYcbcrConversion); + +VKAPI_ATTR void VKAPI_CALL vkDestroySamplerYcbcrConversionKHR( + VkDevice device, + VkSamplerYcbcrConversion ycbcrConversion, + const VkAllocationCallbacks* pAllocator); +#endif + +#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" + +typedef VkBindBufferMemoryInfo VkBindBufferMemoryInfoKHR; + +typedef VkBindImageMemoryInfo VkBindImageMemoryInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkBindBufferMemory2KHR)(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos); +typedef VkResult (VKAPI_PTR *PFN_vkBindImageMemory2KHR)(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory2KHR( + VkDevice device, + uint32_t bindInfoCount, + const VkBindBufferMemoryInfo* pBindInfos); + +VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory2KHR( + VkDevice device, + uint32_t bindInfoCount, + const VkBindImageMemoryInfo* pBindInfos); +#endif + +#define VK_KHR_maintenance3 1 +#define VK_KHR_MAINTENANCE3_SPEC_VERSION 1 +#define VK_KHR_MAINTENANCE3_EXTENSION_NAME "VK_KHR_maintenance3" + +typedef VkPhysicalDeviceMaintenance3Properties VkPhysicalDeviceMaintenance3PropertiesKHR; + +typedef VkDescriptorSetLayoutSupport VkDescriptorSetLayoutSupportKHR; + + +typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutSupportKHR)(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutSupportKHR( + VkDevice device, + const VkDescriptorSetLayoutCreateInfo* pCreateInfo, + VkDescriptorSetLayoutSupport* pSupport); +#endif + +#define VK_EXT_debug_report 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) + +#define VK_EXT_DEBUG_REPORT_SPEC_VERSION 9 +#define VK_EXT_DEBUG_REPORT_EXTENSION_NAME "VK_EXT_debug_report" +#define VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT +#define VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT + + +typedef enum VkDebugReportObjectTypeEXT { + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0, + VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1, + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2, + VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3, + VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4, + VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5, + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6, + VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7, + VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8, + VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9, + VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10, + VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11, + VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12, + VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13, + VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14, + VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15, + VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16, + VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17, + VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18, + VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19, + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20, + VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21, + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22, + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23, + VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24, + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25, + VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26, + VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27, + VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT = 28, + VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29, + VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30, + VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31, + VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32, + VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT = 33, + VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT = 1000156000, + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT = 1000085000, + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_BEGIN_RANGE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_END_RANGE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_RANGE_SIZE_EXT = (VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT + 1), + VK_DEBUG_REPORT_OBJECT_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDebugReportObjectTypeEXT; + + +typedef enum VkDebugReportFlagBitsEXT { + VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001, + VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002, + VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004, + VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008, + VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010, + VK_DEBUG_REPORT_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDebugReportFlagBitsEXT; +typedef VkFlags VkDebugReportFlagsEXT; + +typedef VkBool32 (VKAPI_PTR *PFN_vkDebugReportCallbackEXT)( + VkDebugReportFlagsEXT flags, + VkDebugReportObjectTypeEXT objectType, + uint64_t object, + size_t location, + int32_t messageCode, + const char* pLayerPrefix, + const char* pMessage, + void* pUserData); + +typedef struct VkDebugReportCallbackCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkDebugReportFlagsEXT flags; + PFN_vkDebugReportCallbackEXT pfnCallback; + void* pUserData; +} VkDebugReportCallbackCreateInfoEXT; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateDebugReportCallbackEXT)(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback); +typedef void (VKAPI_PTR *PFN_vkDestroyDebugReportCallbackEXT)(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkDebugReportMessageEXT)(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDebugReportCallbackEXT( + VkInstance instance, + const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDebugReportCallbackEXT* pCallback); + +VKAPI_ATTR void VKAPI_CALL vkDestroyDebugReportCallbackEXT( + VkInstance instance, + VkDebugReportCallbackEXT callback, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkDebugReportMessageEXT( + VkInstance instance, + VkDebugReportFlagsEXT flags, + VkDebugReportObjectTypeEXT objectType, + uint64_t object, + size_t location, + int32_t messageCode, + const char* pLayerPrefix, + const char* pMessage); +#endif + +#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" + + +#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" + + +#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" + + +#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" + + +typedef enum VkRasterizationOrderAMD { + VK_RASTERIZATION_ORDER_STRICT_AMD = 0, + VK_RASTERIZATION_ORDER_RELAXED_AMD = 1, + VK_RASTERIZATION_ORDER_BEGIN_RANGE_AMD = VK_RASTERIZATION_ORDER_STRICT_AMD, + VK_RASTERIZATION_ORDER_END_RANGE_AMD = VK_RASTERIZATION_ORDER_RELAXED_AMD, + VK_RASTERIZATION_ORDER_RANGE_SIZE_AMD = (VK_RASTERIZATION_ORDER_RELAXED_AMD - VK_RASTERIZATION_ORDER_STRICT_AMD + 1), + VK_RASTERIZATION_ORDER_MAX_ENUM_AMD = 0x7FFFFFFF +} VkRasterizationOrderAMD; + +typedef struct VkPipelineRasterizationStateRasterizationOrderAMD { + VkStructureType sType; + const void* pNext; + VkRasterizationOrderAMD rasterizationOrder; +} VkPipelineRasterizationStateRasterizationOrderAMD; + + + +#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" + + +#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" + + +#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" + +typedef struct VkDebugMarkerObjectNameInfoEXT { + VkStructureType sType; + const void* pNext; + VkDebugReportObjectTypeEXT objectType; + uint64_t object; + const char* pObjectName; +} VkDebugMarkerObjectNameInfoEXT; + +typedef struct VkDebugMarkerObjectTagInfoEXT { + VkStructureType sType; + const void* pNext; + VkDebugReportObjectTypeEXT objectType; + uint64_t object; + uint64_t tagName; + size_t tagSize; + const void* pTag; +} VkDebugMarkerObjectTagInfoEXT; + +typedef struct VkDebugMarkerMarkerInfoEXT { + VkStructureType sType; + const void* pNext; + const char* pMarkerName; + float color[4]; +} VkDebugMarkerMarkerInfoEXT; + + +typedef VkResult (VKAPI_PTR *PFN_vkDebugMarkerSetObjectTagEXT)(VkDevice device, const VkDebugMarkerObjectTagInfoEXT* pTagInfo); +typedef VkResult (VKAPI_PTR *PFN_vkDebugMarkerSetObjectNameEXT)(VkDevice device, const VkDebugMarkerObjectNameInfoEXT* pNameInfo); +typedef void (VKAPI_PTR *PFN_vkCmdDebugMarkerBeginEXT)(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); +typedef void (VKAPI_PTR *PFN_vkCmdDebugMarkerEndEXT)(VkCommandBuffer commandBuffer); +typedef void (VKAPI_PTR *PFN_vkCmdDebugMarkerInsertEXT)(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkDebugMarkerSetObjectTagEXT( + VkDevice device, + const VkDebugMarkerObjectTagInfoEXT* pTagInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkDebugMarkerSetObjectNameEXT( + VkDevice device, + const VkDebugMarkerObjectNameInfoEXT* pNameInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdDebugMarkerBeginEXT( + VkCommandBuffer commandBuffer, + const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdDebugMarkerEndEXT( + VkCommandBuffer commandBuffer); + +VKAPI_ATTR void VKAPI_CALL vkCmdDebugMarkerInsertEXT( + VkCommandBuffer commandBuffer, + const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); +#endif + +#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" + + +#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" + +typedef struct VkDedicatedAllocationImageCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkBool32 dedicatedAllocation; +} VkDedicatedAllocationImageCreateInfoNV; + +typedef struct VkDedicatedAllocationBufferCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkBool32 dedicatedAllocation; +} VkDedicatedAllocationBufferCreateInfoNV; + +typedef struct VkDedicatedAllocationMemoryAllocateInfoNV { + VkStructureType sType; + const void* pNext; + VkImage image; + VkBuffer buffer; +} VkDedicatedAllocationMemoryAllocateInfoNV; + + + +#define VK_AMD_draw_indirect_count 1 +#define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1 +#define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count" + +typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirectCountAMD)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); +typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirectCountAMD)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirectCountAMD( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); + +VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirectCountAMD( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); +#endif + +#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" + + +#define VK_AMD_gpu_shader_half_float 1 +#define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 1 +#define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float" + + +#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" + + +#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" + +typedef struct VkTextureLODGatherFormatPropertiesAMD { + VkStructureType sType; + void* pNext; + VkBool32 supportsTextureGatherLODBiasAMD; +} VkTextureLODGatherFormatPropertiesAMD; + + + +#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" + + +typedef enum VkShaderInfoTypeAMD { + VK_SHADER_INFO_TYPE_STATISTICS_AMD = 0, + VK_SHADER_INFO_TYPE_BINARY_AMD = 1, + VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD = 2, + VK_SHADER_INFO_TYPE_BEGIN_RANGE_AMD = VK_SHADER_INFO_TYPE_STATISTICS_AMD, + VK_SHADER_INFO_TYPE_END_RANGE_AMD = VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD, + VK_SHADER_INFO_TYPE_RANGE_SIZE_AMD = (VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD - VK_SHADER_INFO_TYPE_STATISTICS_AMD + 1), + VK_SHADER_INFO_TYPE_MAX_ENUM_AMD = 0x7FFFFFFF +} VkShaderInfoTypeAMD; + +typedef struct VkShaderResourceUsageAMD { + uint32_t numUsedVgprs; + uint32_t numUsedSgprs; + uint32_t ldsSizePerLocalWorkGroup; + size_t ldsUsageSizeInBytes; + size_t scratchMemUsageInBytes; +} VkShaderResourceUsageAMD; + +typedef struct VkShaderStatisticsInfoAMD { + VkShaderStageFlags shaderStageMask; + VkShaderResourceUsageAMD resourceUsage; + uint32_t numPhysicalVgprs; + uint32_t numPhysicalSgprs; + uint32_t numAvailableVgprs; + uint32_t numAvailableSgprs; + uint32_t computeWorkGroupSize[3]; +} VkShaderStatisticsInfoAMD; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetShaderInfoAMD)(VkDevice device, VkPipeline pipeline, VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetShaderInfoAMD( + VkDevice device, + VkPipeline pipeline, + VkShaderStageFlagBits shaderStage, + VkShaderInfoTypeAMD infoType, + size_t* pInfoSize, + void* pInfo); +#endif + +#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" + + +#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" + + +#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" + + +typedef enum VkExternalMemoryHandleTypeFlagBitsNV { + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF +} VkExternalMemoryHandleTypeFlagBitsNV; +typedef VkFlags VkExternalMemoryHandleTypeFlagsNV; + +typedef enum VkExternalMemoryFeatureFlagBitsNV { + VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001, + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002, + VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004, + VK_EXTERNAL_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF +} VkExternalMemoryFeatureFlagBitsNV; +typedef VkFlags VkExternalMemoryFeatureFlagsNV; + +typedef struct VkExternalImageFormatPropertiesNV { + VkImageFormatProperties imageFormatProperties; + VkExternalMemoryFeatureFlagsNV externalMemoryFeatures; + VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes; + VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes; +} VkExternalImageFormatPropertiesNV; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceExternalImageFormatPropertiesNV( + VkPhysicalDevice physicalDevice, + VkFormat format, + VkImageType type, + VkImageTiling tiling, + VkImageUsageFlags usage, + VkImageCreateFlags flags, + VkExternalMemoryHandleTypeFlagsNV externalHandleType, + VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties); +#endif + +#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" + +typedef struct VkExternalMemoryImageCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagsNV handleTypes; +} VkExternalMemoryImageCreateInfoNV; + +typedef struct VkExportMemoryAllocateInfoNV { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagsNV handleTypes; +} VkExportMemoryAllocateInfoNV; + + + +#define VK_EXT_validation_flags 1 +#define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 1 +#define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags" + + +typedef enum VkValidationCheckEXT { + VK_VALIDATION_CHECK_ALL_EXT = 0, + VK_VALIDATION_CHECK_SHADERS_EXT = 1, + VK_VALIDATION_CHECK_BEGIN_RANGE_EXT = VK_VALIDATION_CHECK_ALL_EXT, + VK_VALIDATION_CHECK_END_RANGE_EXT = VK_VALIDATION_CHECK_SHADERS_EXT, + VK_VALIDATION_CHECK_RANGE_SIZE_EXT = (VK_VALIDATION_CHECK_SHADERS_EXT - VK_VALIDATION_CHECK_ALL_EXT + 1), + VK_VALIDATION_CHECK_MAX_ENUM_EXT = 0x7FFFFFFF +} VkValidationCheckEXT; + +typedef struct VkValidationFlagsEXT { + VkStructureType sType; + const void* pNext; + uint32_t disabledValidationCheckCount; + VkValidationCheckEXT* pDisabledValidationChecks; +} VkValidationFlagsEXT; + + + +#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" + + +#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" + + +#define VK_NVX_device_generated_commands 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkObjectTableNVX) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectCommandsLayoutNVX) + +#define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 3 +#define VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NVX_device_generated_commands" + + +typedef enum VkIndirectCommandsTokenTypeNVX { + VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NVX = 0, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_DESCRIPTOR_SET_NVX = 1, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_NVX = 2, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_NVX = 3, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NVX = 4, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_NVX = 5, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_NVX = 6, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NVX = 7, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_BEGIN_RANGE_NVX = VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NVX, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_END_RANGE_NVX = VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NVX, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_RANGE_SIZE_NVX = (VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NVX - VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NVX + 1), + VK_INDIRECT_COMMANDS_TOKEN_TYPE_MAX_ENUM_NVX = 0x7FFFFFFF +} VkIndirectCommandsTokenTypeNVX; + +typedef enum VkObjectEntryTypeNVX { + VK_OBJECT_ENTRY_TYPE_DESCRIPTOR_SET_NVX = 0, + VK_OBJECT_ENTRY_TYPE_PIPELINE_NVX = 1, + VK_OBJECT_ENTRY_TYPE_INDEX_BUFFER_NVX = 2, + VK_OBJECT_ENTRY_TYPE_VERTEX_BUFFER_NVX = 3, + VK_OBJECT_ENTRY_TYPE_PUSH_CONSTANT_NVX = 4, + VK_OBJECT_ENTRY_TYPE_BEGIN_RANGE_NVX = VK_OBJECT_ENTRY_TYPE_DESCRIPTOR_SET_NVX, + VK_OBJECT_ENTRY_TYPE_END_RANGE_NVX = VK_OBJECT_ENTRY_TYPE_PUSH_CONSTANT_NVX, + VK_OBJECT_ENTRY_TYPE_RANGE_SIZE_NVX = (VK_OBJECT_ENTRY_TYPE_PUSH_CONSTANT_NVX - VK_OBJECT_ENTRY_TYPE_DESCRIPTOR_SET_NVX + 1), + VK_OBJECT_ENTRY_TYPE_MAX_ENUM_NVX = 0x7FFFFFFF +} VkObjectEntryTypeNVX; + + +typedef enum VkIndirectCommandsLayoutUsageFlagBitsNVX { + VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001, + VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002, + VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004, + VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008, + VK_INDIRECT_COMMANDS_LAYOUT_USAGE_FLAG_BITS_MAX_ENUM_NVX = 0x7FFFFFFF +} VkIndirectCommandsLayoutUsageFlagBitsNVX; +typedef VkFlags VkIndirectCommandsLayoutUsageFlagsNVX; + +typedef enum VkObjectEntryUsageFlagBitsNVX { + VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001, + VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002, + VK_OBJECT_ENTRY_USAGE_FLAG_BITS_MAX_ENUM_NVX = 0x7FFFFFFF +} VkObjectEntryUsageFlagBitsNVX; +typedef VkFlags VkObjectEntryUsageFlagsNVX; + +typedef struct VkDeviceGeneratedCommandsFeaturesNVX { + VkStructureType sType; + const void* pNext; + VkBool32 computeBindingPointSupport; +} VkDeviceGeneratedCommandsFeaturesNVX; + +typedef struct VkDeviceGeneratedCommandsLimitsNVX { + VkStructureType sType; + const void* pNext; + uint32_t maxIndirectCommandsLayoutTokenCount; + uint32_t maxObjectEntryCounts; + uint32_t minSequenceCountBufferOffsetAlignment; + uint32_t minSequenceIndexBufferOffsetAlignment; + uint32_t minCommandsTokenBufferOffsetAlignment; +} VkDeviceGeneratedCommandsLimitsNVX; + +typedef struct VkIndirectCommandsTokenNVX { + VkIndirectCommandsTokenTypeNVX tokenType; + VkBuffer buffer; + VkDeviceSize offset; +} VkIndirectCommandsTokenNVX; + +typedef struct VkIndirectCommandsLayoutTokenNVX { + VkIndirectCommandsTokenTypeNVX tokenType; + uint32_t bindingUnit; + uint32_t dynamicCount; + uint32_t divisor; +} VkIndirectCommandsLayoutTokenNVX; + +typedef struct VkIndirectCommandsLayoutCreateInfoNVX { + VkStructureType sType; + const void* pNext; + VkPipelineBindPoint pipelineBindPoint; + VkIndirectCommandsLayoutUsageFlagsNVX flags; + uint32_t tokenCount; + const VkIndirectCommandsLayoutTokenNVX* pTokens; +} VkIndirectCommandsLayoutCreateInfoNVX; + +typedef struct VkCmdProcessCommandsInfoNVX { + VkStructureType sType; + const void* pNext; + VkObjectTableNVX objectTable; + VkIndirectCommandsLayoutNVX indirectCommandsLayout; + uint32_t indirectCommandsTokenCount; + const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens; + uint32_t maxSequencesCount; + VkCommandBuffer targetCommandBuffer; + VkBuffer sequencesCountBuffer; + VkDeviceSize sequencesCountOffset; + VkBuffer sequencesIndexBuffer; + VkDeviceSize sequencesIndexOffset; +} VkCmdProcessCommandsInfoNVX; + +typedef struct VkCmdReserveSpaceForCommandsInfoNVX { + VkStructureType sType; + const void* pNext; + VkObjectTableNVX objectTable; + VkIndirectCommandsLayoutNVX indirectCommandsLayout; + uint32_t maxSequencesCount; +} VkCmdReserveSpaceForCommandsInfoNVX; + +typedef struct VkObjectTableCreateInfoNVX { + VkStructureType sType; + const void* pNext; + uint32_t objectCount; + const VkObjectEntryTypeNVX* pObjectEntryTypes; + const uint32_t* pObjectEntryCounts; + const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags; + uint32_t maxUniformBuffersPerDescriptor; + uint32_t maxStorageBuffersPerDescriptor; + uint32_t maxStorageImagesPerDescriptor; + uint32_t maxSampledImagesPerDescriptor; + uint32_t maxPipelineLayouts; +} VkObjectTableCreateInfoNVX; + +typedef struct VkObjectTableEntryNVX { + VkObjectEntryTypeNVX type; + VkObjectEntryUsageFlagsNVX flags; +} VkObjectTableEntryNVX; + +typedef struct VkObjectTablePipelineEntryNVX { + VkObjectEntryTypeNVX type; + VkObjectEntryUsageFlagsNVX flags; + VkPipeline pipeline; +} VkObjectTablePipelineEntryNVX; + +typedef struct VkObjectTableDescriptorSetEntryNVX { + VkObjectEntryTypeNVX type; + VkObjectEntryUsageFlagsNVX flags; + VkPipelineLayout pipelineLayout; + VkDescriptorSet descriptorSet; +} VkObjectTableDescriptorSetEntryNVX; + +typedef struct VkObjectTableVertexBufferEntryNVX { + VkObjectEntryTypeNVX type; + VkObjectEntryUsageFlagsNVX flags; + VkBuffer buffer; +} VkObjectTableVertexBufferEntryNVX; + +typedef struct VkObjectTableIndexBufferEntryNVX { + VkObjectEntryTypeNVX type; + VkObjectEntryUsageFlagsNVX flags; + VkBuffer buffer; + VkIndexType indexType; +} VkObjectTableIndexBufferEntryNVX; + +typedef struct VkObjectTablePushConstantEntryNVX { + VkObjectEntryTypeNVX type; + VkObjectEntryUsageFlagsNVX flags; + VkPipelineLayout pipelineLayout; + VkShaderStageFlags stageFlags; +} VkObjectTablePushConstantEntryNVX; + + +typedef void (VKAPI_PTR *PFN_vkCmdProcessCommandsNVX)(VkCommandBuffer commandBuffer, const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo); +typedef void (VKAPI_PTR *PFN_vkCmdReserveSpaceForCommandsNVX)(VkCommandBuffer commandBuffer, const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo); +typedef VkResult (VKAPI_PTR *PFN_vkCreateIndirectCommandsLayoutNVX)(VkDevice device, const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout); +typedef void (VKAPI_PTR *PFN_vkDestroyIndirectCommandsLayoutNVX)(VkDevice device, VkIndirectCommandsLayoutNVX indirectCommandsLayout, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateObjectTableNVX)(VkDevice device, const VkObjectTableCreateInfoNVX* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkObjectTableNVX* pObjectTable); +typedef void (VKAPI_PTR *PFN_vkDestroyObjectTableNVX)(VkDevice device, VkObjectTableNVX objectTable, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkRegisterObjectsNVX)(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, const VkObjectTableEntryNVX* const* ppObjectTableEntries, const uint32_t* pObjectIndices); +typedef VkResult (VKAPI_PTR *PFN_vkUnregisterObjectsNVX)(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, const VkObjectEntryTypeNVX* pObjectEntryTypes, const uint32_t* pObjectIndices); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX)(VkPhysicalDevice physicalDevice, VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, VkDeviceGeneratedCommandsLimitsNVX* pLimits); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdProcessCommandsNVX( + VkCommandBuffer commandBuffer, + const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdReserveSpaceForCommandsNVX( + VkCommandBuffer commandBuffer, + const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateIndirectCommandsLayoutNVX( + VkDevice device, + const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout); + +VKAPI_ATTR void VKAPI_CALL vkDestroyIndirectCommandsLayoutNVX( + VkDevice device, + VkIndirectCommandsLayoutNVX indirectCommandsLayout, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateObjectTableNVX( + VkDevice device, + const VkObjectTableCreateInfoNVX* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkObjectTableNVX* pObjectTable); + +VKAPI_ATTR void VKAPI_CALL vkDestroyObjectTableNVX( + VkDevice device, + VkObjectTableNVX objectTable, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkRegisterObjectsNVX( + VkDevice device, + VkObjectTableNVX objectTable, + uint32_t objectCount, + const VkObjectTableEntryNVX* const* ppObjectTableEntries, + const uint32_t* pObjectIndices); + +VKAPI_ATTR VkResult VKAPI_CALL vkUnregisterObjectsNVX( + VkDevice device, + VkObjectTableNVX objectTable, + uint32_t objectCount, + const VkObjectEntryTypeNVX* pObjectEntryTypes, + const uint32_t* pObjectIndices); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( + VkPhysicalDevice physicalDevice, + VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, + VkDeviceGeneratedCommandsLimitsNVX* pLimits); +#endif + +#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" + +typedef struct VkViewportWScalingNV { + float xcoeff; + float ycoeff; +} VkViewportWScalingNV; + +typedef struct VkPipelineViewportWScalingStateCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkBool32 viewportWScalingEnable; + uint32_t viewportCount; + const VkViewportWScalingNV* pViewportWScalings; +} VkPipelineViewportWScalingStateCreateInfoNV; + + +typedef void (VKAPI_PTR *PFN_vkCmdSetViewportWScalingNV)(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV* pViewportWScalings); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetViewportWScalingNV( + VkCommandBuffer commandBuffer, + uint32_t firstViewport, + uint32_t viewportCount, + const VkViewportWScalingNV* pViewportWScalings); +#endif + +#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" + +typedef VkResult (VKAPI_PTR *PFN_vkReleaseDisplayEXT)(VkPhysicalDevice physicalDevice, VkDisplayKHR display); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkReleaseDisplayEXT( + VkPhysicalDevice physicalDevice, + VkDisplayKHR display); +#endif + +#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" +#define VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT + + +typedef enum VkSurfaceCounterFlagBitsEXT { + VK_SURFACE_COUNTER_VBLANK_EXT = 0x00000001, + VK_SURFACE_COUNTER_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkSurfaceCounterFlagBitsEXT; +typedef VkFlags VkSurfaceCounterFlagsEXT; + +typedef struct VkSurfaceCapabilities2EXT { + VkStructureType sType; + void* pNext; + uint32_t minImageCount; + uint32_t maxImageCount; + VkExtent2D currentExtent; + VkExtent2D minImageExtent; + VkExtent2D maxImageExtent; + uint32_t maxImageArrayLayers; + VkSurfaceTransformFlagsKHR supportedTransforms; + VkSurfaceTransformFlagBitsKHR currentTransform; + VkCompositeAlphaFlagsKHR supportedCompositeAlpha; + VkImageUsageFlags supportedUsageFlags; + VkSurfaceCounterFlagsEXT supportedSurfaceCounters; +} VkSurfaceCapabilities2EXT; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilities2EXT* pSurfaceCapabilities); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilities2EXT( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + VkSurfaceCapabilities2EXT* pSurfaceCapabilities); +#endif + +#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" + + +typedef enum VkDisplayPowerStateEXT { + VK_DISPLAY_POWER_STATE_OFF_EXT = 0, + VK_DISPLAY_POWER_STATE_SUSPEND_EXT = 1, + VK_DISPLAY_POWER_STATE_ON_EXT = 2, + VK_DISPLAY_POWER_STATE_BEGIN_RANGE_EXT = VK_DISPLAY_POWER_STATE_OFF_EXT, + VK_DISPLAY_POWER_STATE_END_RANGE_EXT = VK_DISPLAY_POWER_STATE_ON_EXT, + VK_DISPLAY_POWER_STATE_RANGE_SIZE_EXT = (VK_DISPLAY_POWER_STATE_ON_EXT - VK_DISPLAY_POWER_STATE_OFF_EXT + 1), + VK_DISPLAY_POWER_STATE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDisplayPowerStateEXT; + +typedef enum VkDeviceEventTypeEXT { + VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT = 0, + VK_DEVICE_EVENT_TYPE_BEGIN_RANGE_EXT = VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT, + VK_DEVICE_EVENT_TYPE_END_RANGE_EXT = VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT, + VK_DEVICE_EVENT_TYPE_RANGE_SIZE_EXT = (VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT - VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT + 1), + VK_DEVICE_EVENT_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDeviceEventTypeEXT; + +typedef enum VkDisplayEventTypeEXT { + VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT = 0, + VK_DISPLAY_EVENT_TYPE_BEGIN_RANGE_EXT = VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT, + VK_DISPLAY_EVENT_TYPE_END_RANGE_EXT = VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT, + VK_DISPLAY_EVENT_TYPE_RANGE_SIZE_EXT = (VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT - VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT + 1), + VK_DISPLAY_EVENT_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDisplayEventTypeEXT; + +typedef struct VkDisplayPowerInfoEXT { + VkStructureType sType; + const void* pNext; + VkDisplayPowerStateEXT powerState; +} VkDisplayPowerInfoEXT; + +typedef struct VkDeviceEventInfoEXT { + VkStructureType sType; + const void* pNext; + VkDeviceEventTypeEXT deviceEvent; +} VkDeviceEventInfoEXT; + +typedef struct VkDisplayEventInfoEXT { + VkStructureType sType; + const void* pNext; + VkDisplayEventTypeEXT displayEvent; +} VkDisplayEventInfoEXT; + +typedef struct VkSwapchainCounterCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkSurfaceCounterFlagsEXT surfaceCounters; +} VkSwapchainCounterCreateInfoEXT; + + +typedef VkResult (VKAPI_PTR *PFN_vkDisplayPowerControlEXT)(VkDevice device, VkDisplayKHR display, const VkDisplayPowerInfoEXT* pDisplayPowerInfo); +typedef VkResult (VKAPI_PTR *PFN_vkRegisterDeviceEventEXT)(VkDevice device, const VkDeviceEventInfoEXT* pDeviceEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence); +typedef VkResult (VKAPI_PTR *PFN_vkRegisterDisplayEventEXT)(VkDevice device, VkDisplayKHR display, const VkDisplayEventInfoEXT* pDisplayEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence); +typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainCounterEXT)(VkDevice device, VkSwapchainKHR swapchain, VkSurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkDisplayPowerControlEXT( + VkDevice device, + VkDisplayKHR display, + const VkDisplayPowerInfoEXT* pDisplayPowerInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkRegisterDeviceEventEXT( + VkDevice device, + const VkDeviceEventInfoEXT* pDeviceEventInfo, + const VkAllocationCallbacks* pAllocator, + VkFence* pFence); + +VKAPI_ATTR VkResult VKAPI_CALL vkRegisterDisplayEventEXT( + VkDevice device, + VkDisplayKHR display, + const VkDisplayEventInfoEXT* pDisplayEventInfo, + const VkAllocationCallbacks* pAllocator, + VkFence* pFence); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainCounterEXT( + VkDevice device, + VkSwapchainKHR swapchain, + VkSurfaceCounterFlagBitsEXT counter, + uint64_t* pCounterValue); +#endif + +#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" + +typedef struct VkRefreshCycleDurationGOOGLE { + uint64_t refreshDuration; +} VkRefreshCycleDurationGOOGLE; + +typedef struct VkPastPresentationTimingGOOGLE { + uint32_t presentID; + uint64_t desiredPresentTime; + uint64_t actualPresentTime; + uint64_t earliestPresentTime; + uint64_t presentMargin; +} VkPastPresentationTimingGOOGLE; + +typedef struct VkPresentTimeGOOGLE { + uint32_t presentID; + uint64_t desiredPresentTime; +} VkPresentTimeGOOGLE; + +typedef struct VkPresentTimesInfoGOOGLE { + VkStructureType sType; + const void* pNext; + uint32_t swapchainCount; + const VkPresentTimeGOOGLE* pTimes; +} VkPresentTimesInfoGOOGLE; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetRefreshCycleDurationGOOGLE)(VkDevice device, VkSwapchainKHR swapchain, VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetPastPresentationTimingGOOGLE)(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pPresentationTimingCount, VkPastPresentationTimingGOOGLE* pPresentationTimings); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetRefreshCycleDurationGOOGLE( + VkDevice device, + VkSwapchainKHR swapchain, + VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPastPresentationTimingGOOGLE( + VkDevice device, + VkSwapchainKHR swapchain, + uint32_t* pPresentationTimingCount, + VkPastPresentationTimingGOOGLE* pPresentationTimings); +#endif + +#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" + + +#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" + + +#define VK_NV_viewport_array2 1 +#define VK_NV_VIEWPORT_ARRAY2_SPEC_VERSION 1 +#define VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME "VK_NV_viewport_array2" + + +#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" + +typedef struct VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX { + VkStructureType sType; + void* pNext; + VkBool32 perViewPositionAllComponents; +} VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX; + + + +#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" + + +typedef enum VkViewportCoordinateSwizzleNV { + VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV = 0, + VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_X_NV = 1, + VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Y_NV = 2, + VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Y_NV = 3, + VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Z_NV = 4, + VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Z_NV = 5, + VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_W_NV = 6, + VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV = 7, + VK_VIEWPORT_COORDINATE_SWIZZLE_BEGIN_RANGE_NV = VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV, + VK_VIEWPORT_COORDINATE_SWIZZLE_END_RANGE_NV = VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV, + VK_VIEWPORT_COORDINATE_SWIZZLE_RANGE_SIZE_NV = (VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV + 1), + VK_VIEWPORT_COORDINATE_SWIZZLE_MAX_ENUM_NV = 0x7FFFFFFF +} VkViewportCoordinateSwizzleNV; + +typedef VkFlags VkPipelineViewportSwizzleStateCreateFlagsNV; + +typedef struct VkViewportSwizzleNV { + VkViewportCoordinateSwizzleNV x; + VkViewportCoordinateSwizzleNV y; + VkViewportCoordinateSwizzleNV z; + VkViewportCoordinateSwizzleNV w; +} VkViewportSwizzleNV; + +typedef struct VkPipelineViewportSwizzleStateCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkPipelineViewportSwizzleStateCreateFlagsNV flags; + uint32_t viewportCount; + const VkViewportSwizzleNV* pViewportSwizzles; +} VkPipelineViewportSwizzleStateCreateInfoNV; + + + +#define VK_EXT_discard_rectangles 1 +#define VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION 1 +#define VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME "VK_EXT_discard_rectangles" + + +typedef enum VkDiscardRectangleModeEXT { + VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT = 0, + VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT = 1, + VK_DISCARD_RECTANGLE_MODE_BEGIN_RANGE_EXT = VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT, + VK_DISCARD_RECTANGLE_MODE_END_RANGE_EXT = VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT, + VK_DISCARD_RECTANGLE_MODE_RANGE_SIZE_EXT = (VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT - VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT + 1), + VK_DISCARD_RECTANGLE_MODE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDiscardRectangleModeEXT; + +typedef VkFlags VkPipelineDiscardRectangleStateCreateFlagsEXT; + +typedef struct VkPhysicalDeviceDiscardRectanglePropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t maxDiscardRectangles; +} VkPhysicalDeviceDiscardRectanglePropertiesEXT; + +typedef struct VkPipelineDiscardRectangleStateCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkPipelineDiscardRectangleStateCreateFlagsEXT flags; + VkDiscardRectangleModeEXT discardRectangleMode; + uint32_t discardRectangleCount; + const VkRect2D* pDiscardRectangles; +} VkPipelineDiscardRectangleStateCreateInfoEXT; + + +typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleEXT)(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetDiscardRectangleEXT( + VkCommandBuffer commandBuffer, + uint32_t firstDiscardRectangle, + uint32_t discardRectangleCount, + const VkRect2D* pDiscardRectangles); +#endif + +#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" + + +typedef enum VkConservativeRasterizationModeEXT { + VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT = 0, + VK_CONSERVATIVE_RASTERIZATION_MODE_OVERESTIMATE_EXT = 1, + VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT = 2, + VK_CONSERVATIVE_RASTERIZATION_MODE_BEGIN_RANGE_EXT = VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT, + VK_CONSERVATIVE_RASTERIZATION_MODE_END_RANGE_EXT = VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT, + VK_CONSERVATIVE_RASTERIZATION_MODE_RANGE_SIZE_EXT = (VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT - VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT + 1), + VK_CONSERVATIVE_RASTERIZATION_MODE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkConservativeRasterizationModeEXT; + +typedef VkFlags VkPipelineRasterizationConservativeStateCreateFlagsEXT; + +typedef struct VkPhysicalDeviceConservativeRasterizationPropertiesEXT { + VkStructureType sType; + void* pNext; + float primitiveOverestimationSize; + float maxExtraPrimitiveOverestimationSize; + float extraPrimitiveOverestimationSizeGranularity; + VkBool32 primitiveUnderestimation; + VkBool32 conservativePointAndLineRasterization; + VkBool32 degenerateTrianglesRasterized; + VkBool32 degenerateLinesRasterized; + VkBool32 fullyCoveredFragmentShaderInputVariable; + VkBool32 conservativeRasterizationPostDepthCoverage; +} VkPhysicalDeviceConservativeRasterizationPropertiesEXT; + +typedef struct VkPipelineRasterizationConservativeStateCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkPipelineRasterizationConservativeStateCreateFlagsEXT flags; + VkConservativeRasterizationModeEXT conservativeRasterizationMode; + float extraPrimitiveOverestimationSize; +} VkPipelineRasterizationConservativeStateCreateInfoEXT; + + + +#define VK_EXT_swapchain_colorspace 1 +#define VK_EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION 3 +#define VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME "VK_EXT_swapchain_colorspace" + + +#define VK_EXT_hdr_metadata 1 +#define VK_EXT_HDR_METADATA_SPEC_VERSION 1 +#define VK_EXT_HDR_METADATA_EXTENSION_NAME "VK_EXT_hdr_metadata" + +typedef struct VkXYColorEXT { + float x; + float y; +} VkXYColorEXT; + +typedef struct VkHdrMetadataEXT { + VkStructureType sType; + const void* pNext; + VkXYColorEXT displayPrimaryRed; + VkXYColorEXT displayPrimaryGreen; + VkXYColorEXT displayPrimaryBlue; + VkXYColorEXT whitePoint; + float maxLuminance; + float minLuminance; + float maxContentLightLevel; + float maxFrameAverageLightLevel; +} VkHdrMetadataEXT; + + +typedef void (VKAPI_PTR *PFN_vkSetHdrMetadataEXT)(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR* pSwapchains, const VkHdrMetadataEXT* pMetadata); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkSetHdrMetadataEXT( + VkDevice device, + uint32_t swapchainCount, + const VkSwapchainKHR* pSwapchains, + const VkHdrMetadataEXT* pMetadata); +#endif + +#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" + + +#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 (~0U-2) + + +#define VK_EXT_debug_utils 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugUtilsMessengerEXT) + +#define VK_EXT_DEBUG_UTILS_SPEC_VERSION 1 +#define VK_EXT_DEBUG_UTILS_EXTENSION_NAME "VK_EXT_debug_utils" + +typedef VkFlags VkDebugUtilsMessengerCallbackDataFlagsEXT; +typedef VkFlags VkDebugUtilsMessengerCreateFlagsEXT; + +typedef enum VkDebugUtilsMessageSeverityFlagBitsEXT { + VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT = 0x00000001, + VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT = 0x00000010, + VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT = 0x00000100, + VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT = 0x00001000, + VK_DEBUG_UTILS_MESSAGE_SEVERITY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDebugUtilsMessageSeverityFlagBitsEXT; +typedef VkFlags VkDebugUtilsMessageSeverityFlagsEXT; + +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_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDebugUtilsMessageTypeFlagBitsEXT; +typedef VkFlags VkDebugUtilsMessageTypeFlagsEXT; + +typedef struct VkDebugUtilsObjectNameInfoEXT { + VkStructureType sType; + const void* pNext; + VkObjectType objectType; + uint64_t objectHandle; + const char* pObjectName; +} VkDebugUtilsObjectNameInfoEXT; + +typedef struct VkDebugUtilsObjectTagInfoEXT { + VkStructureType sType; + const void* pNext; + VkObjectType objectType; + uint64_t objectHandle; + uint64_t tagName; + size_t tagSize; + const void* pTag; +} VkDebugUtilsObjectTagInfoEXT; + +typedef struct VkDebugUtilsLabelEXT { + VkStructureType sType; + const void* pNext; + const char* pLabelName; + float color[4]; +} VkDebugUtilsLabelEXT; + +typedef struct VkDebugUtilsMessengerCallbackDataEXT { + VkStructureType sType; + const void* pNext; + VkDebugUtilsMessengerCallbackDataFlagsEXT flags; + const char* pMessageIdName; + int32_t messageIdNumber; + const char* pMessage; + uint32_t queueLabelCount; + VkDebugUtilsLabelEXT* pQueueLabels; + uint32_t cmdBufLabelCount; + VkDebugUtilsLabelEXT* pCmdBufLabels; + uint32_t objectCount; + VkDebugUtilsObjectNameInfoEXT* pObjects; +} VkDebugUtilsMessengerCallbackDataEXT; + +typedef VkBool32 (VKAPI_PTR *PFN_vkDebugUtilsMessengerCallbackEXT)( + VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, + VkDebugUtilsMessageTypeFlagsEXT messageType, + const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, + void* pUserData); + +typedef struct VkDebugUtilsMessengerCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkDebugUtilsMessengerCreateFlagsEXT flags; + VkDebugUtilsMessageSeverityFlagsEXT messageSeverity; + VkDebugUtilsMessageTypeFlagsEXT messageType; + PFN_vkDebugUtilsMessengerCallbackEXT pfnUserCallback; + void* pUserData; +} VkDebugUtilsMessengerCreateInfoEXT; + + +typedef VkResult (VKAPI_PTR *PFN_vkSetDebugUtilsObjectNameEXT)(VkDevice device, const VkDebugUtilsObjectNameInfoEXT* pNameInfo); +typedef VkResult (VKAPI_PTR *PFN_vkSetDebugUtilsObjectTagEXT)(VkDevice device, const VkDebugUtilsObjectTagInfoEXT* pTagInfo); +typedef void (VKAPI_PTR *PFN_vkQueueBeginDebugUtilsLabelEXT)(VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo); +typedef void (VKAPI_PTR *PFN_vkQueueEndDebugUtilsLabelEXT)(VkQueue queue); +typedef void (VKAPI_PTR *PFN_vkQueueInsertDebugUtilsLabelEXT)(VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo); +typedef void (VKAPI_PTR *PFN_vkCmdBeginDebugUtilsLabelEXT)(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT* pLabelInfo); +typedef void (VKAPI_PTR *PFN_vkCmdEndDebugUtilsLabelEXT)(VkCommandBuffer commandBuffer); +typedef void (VKAPI_PTR *PFN_vkCmdInsertDebugUtilsLabelEXT)(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT* pLabelInfo); +typedef VkResult (VKAPI_PTR *PFN_vkCreateDebugUtilsMessengerEXT)(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugUtilsMessengerEXT* pMessenger); +typedef void (VKAPI_PTR *PFN_vkDestroyDebugUtilsMessengerEXT)(VkInstance instance, VkDebugUtilsMessengerEXT messenger, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkSubmitDebugUtilsMessageEXT)(VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkSetDebugUtilsObjectNameEXT( + VkDevice device, + const VkDebugUtilsObjectNameInfoEXT* pNameInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkSetDebugUtilsObjectTagEXT( + VkDevice device, + const VkDebugUtilsObjectTagInfoEXT* pTagInfo); + +VKAPI_ATTR void VKAPI_CALL vkQueueBeginDebugUtilsLabelEXT( + VkQueue queue, + const VkDebugUtilsLabelEXT* pLabelInfo); + +VKAPI_ATTR void VKAPI_CALL vkQueueEndDebugUtilsLabelEXT( + VkQueue queue); + +VKAPI_ATTR void VKAPI_CALL vkQueueInsertDebugUtilsLabelEXT( + VkQueue queue, + const VkDebugUtilsLabelEXT* pLabelInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdBeginDebugUtilsLabelEXT( + VkCommandBuffer commandBuffer, + const VkDebugUtilsLabelEXT* pLabelInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdEndDebugUtilsLabelEXT( + VkCommandBuffer commandBuffer); + +VKAPI_ATTR void VKAPI_CALL vkCmdInsertDebugUtilsLabelEXT( + VkCommandBuffer commandBuffer, + const VkDebugUtilsLabelEXT* pLabelInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDebugUtilsMessengerEXT( + VkInstance instance, + const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDebugUtilsMessengerEXT* pMessenger); + +VKAPI_ATTR void VKAPI_CALL vkDestroyDebugUtilsMessengerEXT( + VkInstance instance, + VkDebugUtilsMessengerEXT messenger, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkSubmitDebugUtilsMessageEXT( + VkInstance instance, + VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, + VkDebugUtilsMessageTypeFlagsEXT messageTypes, + const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData); +#endif + +#define VK_EXT_sampler_filter_minmax 1 +#define VK_EXT_SAMPLER_FILTER_MINMAX_SPEC_VERSION 1 +#define VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME "VK_EXT_sampler_filter_minmax" + + +typedef enum VkSamplerReductionModeEXT { + VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT = 0, + VK_SAMPLER_REDUCTION_MODE_MIN_EXT = 1, + VK_SAMPLER_REDUCTION_MODE_MAX_EXT = 2, + VK_SAMPLER_REDUCTION_MODE_BEGIN_RANGE_EXT = VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT, + VK_SAMPLER_REDUCTION_MODE_END_RANGE_EXT = VK_SAMPLER_REDUCTION_MODE_MAX_EXT, + VK_SAMPLER_REDUCTION_MODE_RANGE_SIZE_EXT = (VK_SAMPLER_REDUCTION_MODE_MAX_EXT - VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT + 1), + VK_SAMPLER_REDUCTION_MODE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkSamplerReductionModeEXT; + +typedef struct VkSamplerReductionModeCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkSamplerReductionModeEXT reductionMode; +} VkSamplerReductionModeCreateInfoEXT; + +typedef struct VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT { + VkStructureType sType; + void* pNext; + VkBool32 filterMinmaxSingleComponentFormats; + VkBool32 filterMinmaxImageComponentMapping; +} VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT; + + + +#define VK_AMD_gpu_shader_int16 1 +#define VK_AMD_GPU_SHADER_INT16_SPEC_VERSION 1 +#define VK_AMD_GPU_SHADER_INT16_EXTENSION_NAME "VK_AMD_gpu_shader_int16" + + +#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" + + +#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" + + +#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" + + +#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" + +typedef struct VkSampleLocationEXT { + float x; + float y; +} VkSampleLocationEXT; + +typedef struct VkSampleLocationsInfoEXT { + VkStructureType sType; + const void* pNext; + VkSampleCountFlagBits sampleLocationsPerPixel; + VkExtent2D sampleLocationGridSize; + uint32_t sampleLocationsCount; + const VkSampleLocationEXT* pSampleLocations; +} VkSampleLocationsInfoEXT; + +typedef struct VkAttachmentSampleLocationsEXT { + uint32_t attachmentIndex; + VkSampleLocationsInfoEXT sampleLocationsInfo; +} VkAttachmentSampleLocationsEXT; + +typedef struct VkSubpassSampleLocationsEXT { + uint32_t subpassIndex; + VkSampleLocationsInfoEXT sampleLocationsInfo; +} VkSubpassSampleLocationsEXT; + +typedef struct VkRenderPassSampleLocationsBeginInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t attachmentInitialSampleLocationsCount; + const VkAttachmentSampleLocationsEXT* pAttachmentInitialSampleLocations; + uint32_t postSubpassSampleLocationsCount; + const VkSubpassSampleLocationsEXT* pPostSubpassSampleLocations; +} VkRenderPassSampleLocationsBeginInfoEXT; + +typedef struct VkPipelineSampleLocationsStateCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkBool32 sampleLocationsEnable; + VkSampleLocationsInfoEXT sampleLocationsInfo; +} VkPipelineSampleLocationsStateCreateInfoEXT; + +typedef struct VkPhysicalDeviceSampleLocationsPropertiesEXT { + VkStructureType sType; + void* pNext; + VkSampleCountFlags sampleLocationSampleCounts; + VkExtent2D maxSampleLocationGridSize; + float sampleLocationCoordinateRange[2]; + uint32_t sampleLocationSubPixelBits; + VkBool32 variableSampleLocations; +} VkPhysicalDeviceSampleLocationsPropertiesEXT; + +typedef struct VkMultisamplePropertiesEXT { + VkStructureType sType; + void* pNext; + VkExtent2D maxSampleLocationGridSize; +} VkMultisamplePropertiesEXT; + + +typedef void (VKAPI_PTR *PFN_vkCmdSetSampleLocationsEXT)(VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT)(VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetSampleLocationsEXT( + VkCommandBuffer commandBuffer, + const VkSampleLocationsInfoEXT* pSampleLocationsInfo); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMultisamplePropertiesEXT( + VkPhysicalDevice physicalDevice, + VkSampleCountFlagBits samples, + VkMultisamplePropertiesEXT* pMultisampleProperties); +#endif + +#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" + + +typedef enum VkBlendOverlapEXT { + VK_BLEND_OVERLAP_UNCORRELATED_EXT = 0, + VK_BLEND_OVERLAP_DISJOINT_EXT = 1, + VK_BLEND_OVERLAP_CONJOINT_EXT = 2, + VK_BLEND_OVERLAP_BEGIN_RANGE_EXT = VK_BLEND_OVERLAP_UNCORRELATED_EXT, + VK_BLEND_OVERLAP_END_RANGE_EXT = VK_BLEND_OVERLAP_CONJOINT_EXT, + VK_BLEND_OVERLAP_RANGE_SIZE_EXT = (VK_BLEND_OVERLAP_CONJOINT_EXT - VK_BLEND_OVERLAP_UNCORRELATED_EXT + 1), + VK_BLEND_OVERLAP_MAX_ENUM_EXT = 0x7FFFFFFF +} VkBlendOverlapEXT; + +typedef struct VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 advancedBlendCoherentOperations; +} VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT; + +typedef struct VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t advancedBlendMaxColorAttachments; + VkBool32 advancedBlendIndependentBlend; + VkBool32 advancedBlendNonPremultipliedSrcColor; + VkBool32 advancedBlendNonPremultipliedDstColor; + VkBool32 advancedBlendCorrelatedOverlap; + VkBool32 advancedBlendAllOperations; +} VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT; + +typedef struct VkPipelineColorBlendAdvancedStateCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkBool32 srcPremultiplied; + VkBool32 dstPremultiplied; + VkBlendOverlapEXT blendOverlap; +} VkPipelineColorBlendAdvancedStateCreateInfoEXT; + + + +#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" + +typedef VkFlags VkPipelineCoverageToColorStateCreateFlagsNV; + +typedef struct VkPipelineCoverageToColorStateCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkPipelineCoverageToColorStateCreateFlagsNV flags; + VkBool32 coverageToColorEnable; + uint32_t coverageToColorLocation; +} VkPipelineCoverageToColorStateCreateInfoNV; + + + +#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" + + +typedef enum VkCoverageModulationModeNV { + VK_COVERAGE_MODULATION_MODE_NONE_NV = 0, + VK_COVERAGE_MODULATION_MODE_RGB_NV = 1, + VK_COVERAGE_MODULATION_MODE_ALPHA_NV = 2, + VK_COVERAGE_MODULATION_MODE_RGBA_NV = 3, + VK_COVERAGE_MODULATION_MODE_BEGIN_RANGE_NV = VK_COVERAGE_MODULATION_MODE_NONE_NV, + VK_COVERAGE_MODULATION_MODE_END_RANGE_NV = VK_COVERAGE_MODULATION_MODE_RGBA_NV, + VK_COVERAGE_MODULATION_MODE_RANGE_SIZE_NV = (VK_COVERAGE_MODULATION_MODE_RGBA_NV - VK_COVERAGE_MODULATION_MODE_NONE_NV + 1), + VK_COVERAGE_MODULATION_MODE_MAX_ENUM_NV = 0x7FFFFFFF +} VkCoverageModulationModeNV; + +typedef VkFlags VkPipelineCoverageModulationStateCreateFlagsNV; + +typedef struct VkPipelineCoverageModulationStateCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkPipelineCoverageModulationStateCreateFlagsNV flags; + VkCoverageModulationModeNV coverageModulationMode; + VkBool32 coverageModulationTableEnable; + uint32_t coverageModulationTableCount; + const float* pCoverageModulationTable; +} VkPipelineCoverageModulationStateCreateInfoNV; + + + +#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" + + +#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" + + +#define VK_EXT_validation_cache 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkValidationCacheEXT) + +#define VK_EXT_VALIDATION_CACHE_SPEC_VERSION 1 +#define VK_EXT_VALIDATION_CACHE_EXTENSION_NAME "VK_EXT_validation_cache" +#define VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT + + +typedef enum VkValidationCacheHeaderVersionEXT { + VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT = 1, + VK_VALIDATION_CACHE_HEADER_VERSION_BEGIN_RANGE_EXT = VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT, + VK_VALIDATION_CACHE_HEADER_VERSION_END_RANGE_EXT = VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT, + VK_VALIDATION_CACHE_HEADER_VERSION_RANGE_SIZE_EXT = (VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT - VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT + 1), + VK_VALIDATION_CACHE_HEADER_VERSION_MAX_ENUM_EXT = 0x7FFFFFFF +} VkValidationCacheHeaderVersionEXT; + +typedef VkFlags VkValidationCacheCreateFlagsEXT; + +typedef struct VkValidationCacheCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkValidationCacheCreateFlagsEXT flags; + size_t initialDataSize; + const void* pInitialData; +} VkValidationCacheCreateInfoEXT; + +typedef struct VkShaderModuleValidationCacheCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkValidationCacheEXT validationCache; +} VkShaderModuleValidationCacheCreateInfoEXT; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateValidationCacheEXT)(VkDevice device, const VkValidationCacheCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkValidationCacheEXT* pValidationCache); +typedef void (VKAPI_PTR *PFN_vkDestroyValidationCacheEXT)(VkDevice device, VkValidationCacheEXT validationCache, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkMergeValidationCachesEXT)(VkDevice device, VkValidationCacheEXT dstCache, uint32_t srcCacheCount, const VkValidationCacheEXT* pSrcCaches); +typedef VkResult (VKAPI_PTR *PFN_vkGetValidationCacheDataEXT)(VkDevice device, VkValidationCacheEXT validationCache, size_t* pDataSize, void* pData); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateValidationCacheEXT( + VkDevice device, + const VkValidationCacheCreateInfoEXT* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkValidationCacheEXT* pValidationCache); + +VKAPI_ATTR void VKAPI_CALL vkDestroyValidationCacheEXT( + VkDevice device, + VkValidationCacheEXT validationCache, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkMergeValidationCachesEXT( + VkDevice device, + VkValidationCacheEXT dstCache, + uint32_t srcCacheCount, + const VkValidationCacheEXT* pSrcCaches); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetValidationCacheDataEXT( + VkDevice device, + VkValidationCacheEXT validationCache, + size_t* pDataSize, + void* pData); +#endif + +#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" + + +typedef enum VkDescriptorBindingFlagBitsEXT { + VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT = 0x00000001, + VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT = 0x00000002, + VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT = 0x00000004, + VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT = 0x00000008, + VK_DESCRIPTOR_BINDING_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDescriptorBindingFlagBitsEXT; +typedef VkFlags VkDescriptorBindingFlagsEXT; + +typedef struct VkDescriptorSetLayoutBindingFlagsCreateInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t bindingCount; + const VkDescriptorBindingFlagsEXT* pBindingFlags; +} VkDescriptorSetLayoutBindingFlagsCreateInfoEXT; + +typedef struct VkPhysicalDeviceDescriptorIndexingFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 shaderInputAttachmentArrayDynamicIndexing; + VkBool32 shaderUniformTexelBufferArrayDynamicIndexing; + VkBool32 shaderStorageTexelBufferArrayDynamicIndexing; + VkBool32 shaderUniformBufferArrayNonUniformIndexing; + VkBool32 shaderSampledImageArrayNonUniformIndexing; + VkBool32 shaderStorageBufferArrayNonUniformIndexing; + VkBool32 shaderStorageImageArrayNonUniformIndexing; + VkBool32 shaderInputAttachmentArrayNonUniformIndexing; + VkBool32 shaderUniformTexelBufferArrayNonUniformIndexing; + VkBool32 shaderStorageTexelBufferArrayNonUniformIndexing; + VkBool32 descriptorBindingUniformBufferUpdateAfterBind; + VkBool32 descriptorBindingSampledImageUpdateAfterBind; + VkBool32 descriptorBindingStorageImageUpdateAfterBind; + VkBool32 descriptorBindingStorageBufferUpdateAfterBind; + VkBool32 descriptorBindingUniformTexelBufferUpdateAfterBind; + VkBool32 descriptorBindingStorageTexelBufferUpdateAfterBind; + VkBool32 descriptorBindingUpdateUnusedWhilePending; + VkBool32 descriptorBindingPartiallyBound; + VkBool32 descriptorBindingVariableDescriptorCount; + VkBool32 runtimeDescriptorArray; +} VkPhysicalDeviceDescriptorIndexingFeaturesEXT; + +typedef struct VkPhysicalDeviceDescriptorIndexingPropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t maxUpdateAfterBindDescriptorsInAllPools; + VkBool32 shaderUniformBufferArrayNonUniformIndexingNative; + VkBool32 shaderSampledImageArrayNonUniformIndexingNative; + VkBool32 shaderStorageBufferArrayNonUniformIndexingNative; + VkBool32 shaderStorageImageArrayNonUniformIndexingNative; + VkBool32 shaderInputAttachmentArrayNonUniformIndexingNative; + VkBool32 robustBufferAccessUpdateAfterBind; + VkBool32 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; +} VkPhysicalDeviceDescriptorIndexingPropertiesEXT; + +typedef struct VkDescriptorSetVariableDescriptorCountAllocateInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t descriptorSetCount; + const uint32_t* pDescriptorCounts; +} VkDescriptorSetVariableDescriptorCountAllocateInfoEXT; + +typedef struct VkDescriptorSetVariableDescriptorCountLayoutSupportEXT { + VkStructureType sType; + void* pNext; + uint32_t maxVariableDescriptorCount; +} VkDescriptorSetVariableDescriptorCountLayoutSupportEXT; + + + +#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" + + +#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" + + +typedef enum VkQueueGlobalPriorityEXT { + VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT = 128, + VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT = 256, + VK_QUEUE_GLOBAL_PRIORITY_HIGH_EXT = 512, + VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT = 1024, + VK_QUEUE_GLOBAL_PRIORITY_BEGIN_RANGE_EXT = VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT, + VK_QUEUE_GLOBAL_PRIORITY_END_RANGE_EXT = VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT, + VK_QUEUE_GLOBAL_PRIORITY_RANGE_SIZE_EXT = (VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT - VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT + 1), + VK_QUEUE_GLOBAL_PRIORITY_MAX_ENUM_EXT = 0x7FFFFFFF +} VkQueueGlobalPriorityEXT; + +typedef struct VkDeviceQueueGlobalPriorityCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkQueueGlobalPriorityEXT globalPriority; +} VkDeviceQueueGlobalPriorityCreateInfoEXT; + + + +#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" + +typedef struct VkImportMemoryHostPointerInfoEXT { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBits handleType; + void* pHostPointer; +} VkImportMemoryHostPointerInfoEXT; + +typedef struct VkMemoryHostPointerPropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t memoryTypeBits; +} VkMemoryHostPointerPropertiesEXT; + +typedef struct VkPhysicalDeviceExternalMemoryHostPropertiesEXT { + VkStructureType sType; + void* pNext; + VkDeviceSize minImportedHostPointerAlignment; +} VkPhysicalDeviceExternalMemoryHostPropertiesEXT; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryHostPointerPropertiesEXT)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer, VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryHostPointerPropertiesEXT( + VkDevice device, + VkExternalMemoryHandleTypeFlagBits handleType, + const void* pHostPointer, + VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties); +#endif + +#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" + +typedef void (VKAPI_PTR *PFN_vkCmdWriteBufferMarkerAMD)(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdWriteBufferMarkerAMD( + VkCommandBuffer commandBuffer, + VkPipelineStageFlagBits pipelineStage, + VkBuffer dstBuffer, + VkDeviceSize dstOffset, + uint32_t marker); +#endif + +#define VK_AMD_shader_core_properties 1 +#define VK_AMD_SHADER_CORE_PROPERTIES_SPEC_VERSION 1 +#define VK_AMD_SHADER_CORE_PROPERTIES_EXTENSION_NAME "VK_AMD_shader_core_properties" + +typedef struct VkPhysicalDeviceShaderCorePropertiesAMD { + VkStructureType sType; + 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; +} VkPhysicalDeviceShaderCorePropertiesAMD; + + + +#define VK_EXT_vertex_attribute_divisor 1 +#define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION 1 +#define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME "VK_EXT_vertex_attribute_divisor" + +typedef struct VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t maxVertexAttribDivisor; +} VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT; + +typedef struct VkVertexInputBindingDivisorDescriptionEXT { + uint32_t binding; + uint32_t divisor; +} VkVertexInputBindingDivisorDescriptionEXT; + +typedef struct VkPipelineVertexInputDivisorStateCreateInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t vertexBindingDivisorCount; + const VkVertexInputBindingDivisorDescriptionEXT* pVertexBindingDivisors; +} VkPipelineVertexInputDivisorStateCreateInfoEXT; + + + +#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" + + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan.h vulkan-1.1.73+dfsg/include/vulkan/vulkan.h --- vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan.h 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/include/vulkan/vulkan.h 2018-03-14 09:08:48.000000000 +0000 @@ -1,12 +1,8 @@ #ifndef VULKAN_H_ #define VULKAN_H_ 1 -#ifdef __cplusplus -extern "C" { -#endif - /* -** Copyright (c) 2015-2017 The Khronos Group Inc. +** Copyright (c) 2015-2018 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. @@ -21,6917 +17,63 @@ ** limitations under the License. */ -/* -** This header is generated from the Khronos Vulkan XML API Registry. -** -*/ - - -#define VK_VERSION_1_0 1 #include "vk_platform.h" +#include "vulkan_core.h" -#define VK_MAKE_VERSION(major, minor, patch) \ - (((major) << 22) | ((minor) << 12) | (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 - -// Vulkan 1.0 version number -#define VK_API_VERSION_1_0 VK_MAKE_VERSION(1, 0, 0)// Patch version should always be set to 0 - -#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22) -#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) -#define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) -// Version of this file -#define VK_HEADER_VERSION 65 - - -#define VK_NULL_HANDLE 0 - - - -#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; - - -#if !defined(VK_DEFINE_NON_DISPATCHABLE_HANDLE) -#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) - #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object; -#else - #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; -#endif +#ifdef VK_USE_PLATFORM_ANDROID_KHR +#include "vulkan_android.h" #endif - - - -typedef uint32_t VkFlags; -typedef uint32_t VkBool32; -typedef uint64_t VkDeviceSize; -typedef uint32_t VkSampleMask; - -VK_DEFINE_HANDLE(VkInstance) -VK_DEFINE_HANDLE(VkPhysicalDevice) -VK_DEFINE_HANDLE(VkDevice) -VK_DEFINE_HANDLE(VkQueue) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphore) -VK_DEFINE_HANDLE(VkCommandBuffer) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFence) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeviceMemory) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBuffer) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkEvent) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkQueryPool) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferView) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImageView) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderModule) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineCache) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineLayout) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkRenderPass) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipeline) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSampler) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFramebuffer) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool) - -#define VK_LOD_CLAMP_NONE 1000.0f -#define VK_REMAINING_MIP_LEVELS (~0U) -#define VK_REMAINING_ARRAY_LAYERS (~0U) -#define VK_WHOLE_SIZE (~0ULL) -#define VK_ATTACHMENT_UNUSED (~0U) -#define VK_TRUE 1 -#define VK_FALSE 0 -#define VK_QUEUE_FAMILY_IGNORED (~0U) -#define VK_SUBPASS_EXTERNAL (~0U) -#define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256 -#define VK_UUID_SIZE 16 -#define VK_MAX_MEMORY_TYPES 32 -#define VK_MAX_MEMORY_HEAPS 16 -#define VK_MAX_EXTENSION_NAME_SIZE 256 -#define VK_MAX_DESCRIPTION_SIZE 256 - - -typedef enum VkPipelineCacheHeaderVersion { - VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1, - VK_PIPELINE_CACHE_HEADER_VERSION_BEGIN_RANGE = VK_PIPELINE_CACHE_HEADER_VERSION_ONE, - VK_PIPELINE_CACHE_HEADER_VERSION_END_RANGE = VK_PIPELINE_CACHE_HEADER_VERSION_ONE, - VK_PIPELINE_CACHE_HEADER_VERSION_RANGE_SIZE = (VK_PIPELINE_CACHE_HEADER_VERSION_ONE - VK_PIPELINE_CACHE_HEADER_VERSION_ONE + 1), - VK_PIPELINE_CACHE_HEADER_VERSION_MAX_ENUM = 0x7FFFFFFF -} VkPipelineCacheHeaderVersion; - -typedef enum VkResult { - VK_SUCCESS = 0, - VK_NOT_READY = 1, - VK_TIMEOUT = 2, - VK_EVENT_SET = 3, - VK_EVENT_RESET = 4, - VK_INCOMPLETE = 5, - VK_ERROR_OUT_OF_HOST_MEMORY = -1, - VK_ERROR_OUT_OF_DEVICE_MEMORY = -2, - VK_ERROR_INITIALIZATION_FAILED = -3, - VK_ERROR_DEVICE_LOST = -4, - VK_ERROR_MEMORY_MAP_FAILED = -5, - VK_ERROR_LAYER_NOT_PRESENT = -6, - VK_ERROR_EXTENSION_NOT_PRESENT = -7, - VK_ERROR_FEATURE_NOT_PRESENT = -8, - VK_ERROR_INCOMPATIBLE_DRIVER = -9, - VK_ERROR_TOO_MANY_OBJECTS = -10, - VK_ERROR_FORMAT_NOT_SUPPORTED = -11, - VK_ERROR_FRAGMENTED_POOL = -12, - VK_ERROR_SURFACE_LOST_KHR = -1000000000, - VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001, - VK_SUBOPTIMAL_KHR = 1000001003, - VK_ERROR_OUT_OF_DATE_KHR = -1000001004, - VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001, - VK_ERROR_VALIDATION_FAILED_EXT = -1000011001, - VK_ERROR_INVALID_SHADER_NV = -1000012000, - VK_ERROR_OUT_OF_POOL_MEMORY_KHR = -1000069000, - VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR = -1000072003, - VK_ERROR_NOT_PERMITTED_EXT = -1000174001, - VK_RESULT_BEGIN_RANGE = VK_ERROR_FRAGMENTED_POOL, - VK_RESULT_END_RANGE = VK_INCOMPLETE, - VK_RESULT_RANGE_SIZE = (VK_INCOMPLETE - VK_ERROR_FRAGMENTED_POOL + 1), - VK_RESULT_MAX_ENUM = 0x7FFFFFFF -} VkResult; - -typedef enum VkStructureType { - VK_STRUCTURE_TYPE_APPLICATION_INFO = 0, - VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1, - VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2, - VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3, - VK_STRUCTURE_TYPE_SUBMIT_INFO = 4, - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5, - VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6, - VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7, - VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8, - VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9, - VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10, - VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11, - VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12, - VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13, - VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14, - VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15, - VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16, - VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17, - VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18, - VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19, - VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20, - VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23, - VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24, - VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25, - VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26, - VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27, - VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28, - VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29, - VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30, - VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32, - VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34, - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35, - VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36, - VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37, - VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38, - VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42, - VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43, - VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44, - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45, - VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46, - VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47, - VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48, - VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000, - VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001, - VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000, - VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001, - VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR = 1000003000, - VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000, - VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000, - VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000, - VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000, - VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000, - VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, - VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000, - 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, - 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, - VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD = 1000041000, - VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHX = 1000053000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHX = 1000053001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHX = 1000053002, - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000, - VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001, - VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000, - VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001, - VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001, - VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002, - VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = 1000059004, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006, - VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008, - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHX = 1000060000, - VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHX = 1000060003, - VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHX = 1000060004, - VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHX = 1000060005, - VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHX = 1000060006, - VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHX = 1000060010, - VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO_KHX = 1000060013, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHX = 1000060014, - VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHX = 1000060007, - VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHX = 1000060008, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHX = 1000060009, - VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHX = 1000060011, - VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHX = 1000060012, - VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000, - VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN = 1000062000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHX = 1000070000, - VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX = 1000070001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHR = 1000071000, - VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHR = 1000071001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHR = 1000071002, - VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHR = 1000071003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR = 1000071004, - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR = 1000072000, - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR = 1000072001, - VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR = 1000072002, - VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR = 1000073000, - VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR = 1000073001, - VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR = 1000073002, - VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR = 1000073003, - VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR = 1000074000, - VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR = 1000074001, - VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR = 1000074002, - VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR = 1000075000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHR = 1000076000, - VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHR = 1000076001, - VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHR = 1000077000, - VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR = 1000078000, - VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR = 1000078001, - VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR = 1000078002, - VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR = 1000078003, - VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR = 1000079000, - VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR = 1000079001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR = 1000080000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR = 1000083000, - VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000, - VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR = 1000085000, - VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000, - VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001, - VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002, - VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003, - VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004, - VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV = 1000087000, - VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT = 1000090000, - VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT = 1000091000, - VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT = 1000091001, - VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT = 1000091002, - VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT = 1000091003, - VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE = 1000092000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX = 1000097000, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV = 1000098000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT = 1000099000, - VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT = 1000099001, - VK_STRUCTURE_TYPE_HDR_METADATA_EXT = 1000105000, - VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR = 1000111000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR = 1000112000, - VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES_KHR = 1000112001, - VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO_KHR = 1000113000, - VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR = 1000114000, - VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR = 1000114001, - VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR = 1000114002, - VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR = 1000115000, - VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR = 1000115001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES_KHR = 1000117000, - VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO_KHR = 1000117001, - VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO_KHR = 1000117002, - VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO_KHR = 1000117003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR = 1000119000, - VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR = 1000119001, - VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR = 1000119002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR = 1000120000, - VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK = 1000122000, - VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000, - VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR = 1000127000, - VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR = 1000127001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT = 1000130000, - VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT = 1000130001, - 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, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT = 1000143003, - VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT = 1000143004, - VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR = 1000146000, - VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR = 1000146001, - VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2_KHR = 1000146002, - VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR = 1000146003, - VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2_KHR = 1000146004, - VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR = 1000147000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT = 1000148000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT = 1000148001, - VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT = 1000148002, - VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV = 1000149000, - VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV = 1000152000, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_KHR = 1000156000, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR = 1000156001, - VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO_KHR = 1000156002, - VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO_KHR = 1000156003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR = 1000156004, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES_KHR = 1000156005, - VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR = 1000157000, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR = 1000157001, - VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160000, - VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160001, - VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT = 1000174000, - VK_STRUCTURE_TYPE_BEGIN_RANGE = VK_STRUCTURE_TYPE_APPLICATION_INFO, - VK_STRUCTURE_TYPE_END_RANGE = VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO, - VK_STRUCTURE_TYPE_RANGE_SIZE = (VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO - VK_STRUCTURE_TYPE_APPLICATION_INFO + 1), - VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkStructureType; - -typedef enum VkSystemAllocationScope { - VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0, - VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 1, - VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 2, - VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 3, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 4, - VK_SYSTEM_ALLOCATION_SCOPE_BEGIN_RANGE = VK_SYSTEM_ALLOCATION_SCOPE_COMMAND, - VK_SYSTEM_ALLOCATION_SCOPE_END_RANGE = VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE, - VK_SYSTEM_ALLOCATION_SCOPE_RANGE_SIZE = (VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE - VK_SYSTEM_ALLOCATION_SCOPE_COMMAND + 1), - VK_SYSTEM_ALLOCATION_SCOPE_MAX_ENUM = 0x7FFFFFFF -} VkSystemAllocationScope; - -typedef enum VkInternalAllocationType { - VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0, - VK_INTERNAL_ALLOCATION_TYPE_BEGIN_RANGE = VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE, - VK_INTERNAL_ALLOCATION_TYPE_END_RANGE = VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE, - VK_INTERNAL_ALLOCATION_TYPE_RANGE_SIZE = (VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE - VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE + 1), - VK_INTERNAL_ALLOCATION_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkInternalAllocationType; - -typedef enum VkFormat { - VK_FORMAT_UNDEFINED = 0, - VK_FORMAT_R4G4_UNORM_PACK8 = 1, - VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2, - VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3, - VK_FORMAT_R5G6B5_UNORM_PACK16 = 4, - VK_FORMAT_B5G6R5_UNORM_PACK16 = 5, - VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6, - VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7, - VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8, - VK_FORMAT_R8_UNORM = 9, - VK_FORMAT_R8_SNORM = 10, - VK_FORMAT_R8_USCALED = 11, - VK_FORMAT_R8_SSCALED = 12, - VK_FORMAT_R8_UINT = 13, - VK_FORMAT_R8_SINT = 14, - VK_FORMAT_R8_SRGB = 15, - VK_FORMAT_R8G8_UNORM = 16, - VK_FORMAT_R8G8_SNORM = 17, - VK_FORMAT_R8G8_USCALED = 18, - VK_FORMAT_R8G8_SSCALED = 19, - VK_FORMAT_R8G8_UINT = 20, - VK_FORMAT_R8G8_SINT = 21, - VK_FORMAT_R8G8_SRGB = 22, - VK_FORMAT_R8G8B8_UNORM = 23, - VK_FORMAT_R8G8B8_SNORM = 24, - VK_FORMAT_R8G8B8_USCALED = 25, - VK_FORMAT_R8G8B8_SSCALED = 26, - VK_FORMAT_R8G8B8_UINT = 27, - VK_FORMAT_R8G8B8_SINT = 28, - VK_FORMAT_R8G8B8_SRGB = 29, - VK_FORMAT_B8G8R8_UNORM = 30, - VK_FORMAT_B8G8R8_SNORM = 31, - VK_FORMAT_B8G8R8_USCALED = 32, - VK_FORMAT_B8G8R8_SSCALED = 33, - VK_FORMAT_B8G8R8_UINT = 34, - VK_FORMAT_B8G8R8_SINT = 35, - VK_FORMAT_B8G8R8_SRGB = 36, - VK_FORMAT_R8G8B8A8_UNORM = 37, - VK_FORMAT_R8G8B8A8_SNORM = 38, - VK_FORMAT_R8G8B8A8_USCALED = 39, - VK_FORMAT_R8G8B8A8_SSCALED = 40, - VK_FORMAT_R8G8B8A8_UINT = 41, - VK_FORMAT_R8G8B8A8_SINT = 42, - VK_FORMAT_R8G8B8A8_SRGB = 43, - VK_FORMAT_B8G8R8A8_UNORM = 44, - VK_FORMAT_B8G8R8A8_SNORM = 45, - VK_FORMAT_B8G8R8A8_USCALED = 46, - VK_FORMAT_B8G8R8A8_SSCALED = 47, - VK_FORMAT_B8G8R8A8_UINT = 48, - VK_FORMAT_B8G8R8A8_SINT = 49, - VK_FORMAT_B8G8R8A8_SRGB = 50, - VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51, - VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52, - VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53, - VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54, - VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55, - VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56, - VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57, - VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58, - VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59, - VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60, - VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61, - VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62, - VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63, - VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64, - VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65, - VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66, - VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67, - VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68, - VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69, - VK_FORMAT_R16_UNORM = 70, - VK_FORMAT_R16_SNORM = 71, - VK_FORMAT_R16_USCALED = 72, - VK_FORMAT_R16_SSCALED = 73, - VK_FORMAT_R16_UINT = 74, - VK_FORMAT_R16_SINT = 75, - VK_FORMAT_R16_SFLOAT = 76, - VK_FORMAT_R16G16_UNORM = 77, - VK_FORMAT_R16G16_SNORM = 78, - VK_FORMAT_R16G16_USCALED = 79, - VK_FORMAT_R16G16_SSCALED = 80, - VK_FORMAT_R16G16_UINT = 81, - VK_FORMAT_R16G16_SINT = 82, - VK_FORMAT_R16G16_SFLOAT = 83, - VK_FORMAT_R16G16B16_UNORM = 84, - VK_FORMAT_R16G16B16_SNORM = 85, - VK_FORMAT_R16G16B16_USCALED = 86, - VK_FORMAT_R16G16B16_SSCALED = 87, - VK_FORMAT_R16G16B16_UINT = 88, - VK_FORMAT_R16G16B16_SINT = 89, - VK_FORMAT_R16G16B16_SFLOAT = 90, - VK_FORMAT_R16G16B16A16_UNORM = 91, - VK_FORMAT_R16G16B16A16_SNORM = 92, - VK_FORMAT_R16G16B16A16_USCALED = 93, - VK_FORMAT_R16G16B16A16_SSCALED = 94, - VK_FORMAT_R16G16B16A16_UINT = 95, - VK_FORMAT_R16G16B16A16_SINT = 96, - VK_FORMAT_R16G16B16A16_SFLOAT = 97, - VK_FORMAT_R32_UINT = 98, - VK_FORMAT_R32_SINT = 99, - VK_FORMAT_R32_SFLOAT = 100, - VK_FORMAT_R32G32_UINT = 101, - VK_FORMAT_R32G32_SINT = 102, - VK_FORMAT_R32G32_SFLOAT = 103, - VK_FORMAT_R32G32B32_UINT = 104, - VK_FORMAT_R32G32B32_SINT = 105, - VK_FORMAT_R32G32B32_SFLOAT = 106, - VK_FORMAT_R32G32B32A32_UINT = 107, - VK_FORMAT_R32G32B32A32_SINT = 108, - VK_FORMAT_R32G32B32A32_SFLOAT = 109, - VK_FORMAT_R64_UINT = 110, - VK_FORMAT_R64_SINT = 111, - VK_FORMAT_R64_SFLOAT = 112, - VK_FORMAT_R64G64_UINT = 113, - VK_FORMAT_R64G64_SINT = 114, - VK_FORMAT_R64G64_SFLOAT = 115, - VK_FORMAT_R64G64B64_UINT = 116, - VK_FORMAT_R64G64B64_SINT = 117, - VK_FORMAT_R64G64B64_SFLOAT = 118, - VK_FORMAT_R64G64B64A64_UINT = 119, - VK_FORMAT_R64G64B64A64_SINT = 120, - VK_FORMAT_R64G64B64A64_SFLOAT = 121, - VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122, - VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123, - VK_FORMAT_D16_UNORM = 124, - VK_FORMAT_X8_D24_UNORM_PACK32 = 125, - VK_FORMAT_D32_SFLOAT = 126, - VK_FORMAT_S8_UINT = 127, - VK_FORMAT_D16_UNORM_S8_UINT = 128, - VK_FORMAT_D24_UNORM_S8_UINT = 129, - VK_FORMAT_D32_SFLOAT_S8_UINT = 130, - VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131, - VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132, - VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133, - VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134, - VK_FORMAT_BC2_UNORM_BLOCK = 135, - VK_FORMAT_BC2_SRGB_BLOCK = 136, - VK_FORMAT_BC3_UNORM_BLOCK = 137, - VK_FORMAT_BC3_SRGB_BLOCK = 138, - VK_FORMAT_BC4_UNORM_BLOCK = 139, - VK_FORMAT_BC4_SNORM_BLOCK = 140, - VK_FORMAT_BC5_UNORM_BLOCK = 141, - VK_FORMAT_BC5_SNORM_BLOCK = 142, - VK_FORMAT_BC6H_UFLOAT_BLOCK = 143, - VK_FORMAT_BC6H_SFLOAT_BLOCK = 144, - VK_FORMAT_BC7_UNORM_BLOCK = 145, - VK_FORMAT_BC7_SRGB_BLOCK = 146, - VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147, - VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148, - VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149, - VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150, - VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151, - VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152, - VK_FORMAT_EAC_R11_UNORM_BLOCK = 153, - VK_FORMAT_EAC_R11_SNORM_BLOCK = 154, - VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155, - VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156, - VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157, - VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158, - VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159, - VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160, - VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161, - VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162, - VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163, - VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164, - VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165, - VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166, - VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167, - VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168, - VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169, - VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170, - VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171, - VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172, - VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173, - VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174, - VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175, - VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176, - VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177, - VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178, - VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179, - VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180, - VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181, - VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182, - VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183, - VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184, - VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000, - VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001, - VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002, - VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003, - VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004, - 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_G8B8G8R8_422_UNORM_KHR = 1000156000, - VK_FORMAT_B8G8R8G8_422_UNORM_KHR = 1000156001, - VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR = 1000156002, - VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR = 1000156003, - VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR = 1000156004, - VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR = 1000156005, - VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR = 1000156006, - VK_FORMAT_R10X6_UNORM_PACK16_KHR = 1000156007, - VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR = 1000156008, - VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR = 1000156009, - VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR = 1000156010, - VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR = 1000156011, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR = 1000156012, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR = 1000156013, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR = 1000156014, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR = 1000156015, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR = 1000156016, - VK_FORMAT_R12X4_UNORM_PACK16_KHR = 1000156017, - VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR = 1000156018, - VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR = 1000156019, - VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR = 1000156020, - VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR = 1000156021, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR = 1000156022, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR = 1000156023, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR = 1000156024, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR = 1000156025, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR = 1000156026, - VK_FORMAT_G16B16G16R16_422_UNORM_KHR = 1000156027, - VK_FORMAT_B16G16R16G16_422_UNORM_KHR = 1000156028, - VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR = 1000156029, - VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR = 1000156030, - VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR = 1000156031, - VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR = 1000156032, - VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR = 1000156033, - VK_FORMAT_BEGIN_RANGE = VK_FORMAT_UNDEFINED, - VK_FORMAT_END_RANGE = VK_FORMAT_ASTC_12x12_SRGB_BLOCK, - VK_FORMAT_RANGE_SIZE = (VK_FORMAT_ASTC_12x12_SRGB_BLOCK - VK_FORMAT_UNDEFINED + 1), - VK_FORMAT_MAX_ENUM = 0x7FFFFFFF -} VkFormat; - -typedef enum VkImageType { - VK_IMAGE_TYPE_1D = 0, - VK_IMAGE_TYPE_2D = 1, - VK_IMAGE_TYPE_3D = 2, - VK_IMAGE_TYPE_BEGIN_RANGE = VK_IMAGE_TYPE_1D, - VK_IMAGE_TYPE_END_RANGE = VK_IMAGE_TYPE_3D, - VK_IMAGE_TYPE_RANGE_SIZE = (VK_IMAGE_TYPE_3D - VK_IMAGE_TYPE_1D + 1), - VK_IMAGE_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkImageType; - -typedef enum VkImageTiling { - VK_IMAGE_TILING_OPTIMAL = 0, - VK_IMAGE_TILING_LINEAR = 1, - VK_IMAGE_TILING_BEGIN_RANGE = VK_IMAGE_TILING_OPTIMAL, - VK_IMAGE_TILING_END_RANGE = VK_IMAGE_TILING_LINEAR, - VK_IMAGE_TILING_RANGE_SIZE = (VK_IMAGE_TILING_LINEAR - VK_IMAGE_TILING_OPTIMAL + 1), - VK_IMAGE_TILING_MAX_ENUM = 0x7FFFFFFF -} VkImageTiling; - -typedef enum VkPhysicalDeviceType { - VK_PHYSICAL_DEVICE_TYPE_OTHER = 0, - VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 1, - VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 2, - VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 3, - VK_PHYSICAL_DEVICE_TYPE_CPU = 4, - VK_PHYSICAL_DEVICE_TYPE_BEGIN_RANGE = VK_PHYSICAL_DEVICE_TYPE_OTHER, - VK_PHYSICAL_DEVICE_TYPE_END_RANGE = VK_PHYSICAL_DEVICE_TYPE_CPU, - VK_PHYSICAL_DEVICE_TYPE_RANGE_SIZE = (VK_PHYSICAL_DEVICE_TYPE_CPU - VK_PHYSICAL_DEVICE_TYPE_OTHER + 1), - VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkPhysicalDeviceType; - -typedef enum VkQueryType { - VK_QUERY_TYPE_OCCLUSION = 0, - VK_QUERY_TYPE_PIPELINE_STATISTICS = 1, - VK_QUERY_TYPE_TIMESTAMP = 2, - VK_QUERY_TYPE_BEGIN_RANGE = VK_QUERY_TYPE_OCCLUSION, - VK_QUERY_TYPE_END_RANGE = VK_QUERY_TYPE_TIMESTAMP, - VK_QUERY_TYPE_RANGE_SIZE = (VK_QUERY_TYPE_TIMESTAMP - VK_QUERY_TYPE_OCCLUSION + 1), - VK_QUERY_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkQueryType; - -typedef enum VkSharingMode { - VK_SHARING_MODE_EXCLUSIVE = 0, - VK_SHARING_MODE_CONCURRENT = 1, - VK_SHARING_MODE_BEGIN_RANGE = VK_SHARING_MODE_EXCLUSIVE, - VK_SHARING_MODE_END_RANGE = VK_SHARING_MODE_CONCURRENT, - VK_SHARING_MODE_RANGE_SIZE = (VK_SHARING_MODE_CONCURRENT - VK_SHARING_MODE_EXCLUSIVE + 1), - VK_SHARING_MODE_MAX_ENUM = 0x7FFFFFFF -} VkSharingMode; - -typedef enum VkImageLayout { - VK_IMAGE_LAYOUT_UNDEFINED = 0, - VK_IMAGE_LAYOUT_GENERAL = 1, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 2, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 3, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 4, - VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 5, - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 6, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 7, - VK_IMAGE_LAYOUT_PREINITIALIZED = 8, - VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002, - VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR = 1000111000, - VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR = 1000117000, - VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR = 1000117001, - VK_IMAGE_LAYOUT_BEGIN_RANGE = VK_IMAGE_LAYOUT_UNDEFINED, - VK_IMAGE_LAYOUT_END_RANGE = VK_IMAGE_LAYOUT_PREINITIALIZED, - VK_IMAGE_LAYOUT_RANGE_SIZE = (VK_IMAGE_LAYOUT_PREINITIALIZED - VK_IMAGE_LAYOUT_UNDEFINED + 1), - VK_IMAGE_LAYOUT_MAX_ENUM = 0x7FFFFFFF -} VkImageLayout; - -typedef enum VkImageViewType { - VK_IMAGE_VIEW_TYPE_1D = 0, - VK_IMAGE_VIEW_TYPE_2D = 1, - VK_IMAGE_VIEW_TYPE_3D = 2, - VK_IMAGE_VIEW_TYPE_CUBE = 3, - VK_IMAGE_VIEW_TYPE_1D_ARRAY = 4, - VK_IMAGE_VIEW_TYPE_2D_ARRAY = 5, - VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 6, - VK_IMAGE_VIEW_TYPE_BEGIN_RANGE = VK_IMAGE_VIEW_TYPE_1D, - VK_IMAGE_VIEW_TYPE_END_RANGE = VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, - VK_IMAGE_VIEW_TYPE_RANGE_SIZE = (VK_IMAGE_VIEW_TYPE_CUBE_ARRAY - VK_IMAGE_VIEW_TYPE_1D + 1), - VK_IMAGE_VIEW_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkImageViewType; - -typedef enum VkComponentSwizzle { - VK_COMPONENT_SWIZZLE_IDENTITY = 0, - VK_COMPONENT_SWIZZLE_ZERO = 1, - VK_COMPONENT_SWIZZLE_ONE = 2, - VK_COMPONENT_SWIZZLE_R = 3, - VK_COMPONENT_SWIZZLE_G = 4, - VK_COMPONENT_SWIZZLE_B = 5, - VK_COMPONENT_SWIZZLE_A = 6, - VK_COMPONENT_SWIZZLE_BEGIN_RANGE = VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_END_RANGE = VK_COMPONENT_SWIZZLE_A, - VK_COMPONENT_SWIZZLE_RANGE_SIZE = (VK_COMPONENT_SWIZZLE_A - VK_COMPONENT_SWIZZLE_IDENTITY + 1), - VK_COMPONENT_SWIZZLE_MAX_ENUM = 0x7FFFFFFF -} VkComponentSwizzle; - -typedef enum VkVertexInputRate { - VK_VERTEX_INPUT_RATE_VERTEX = 0, - VK_VERTEX_INPUT_RATE_INSTANCE = 1, - VK_VERTEX_INPUT_RATE_BEGIN_RANGE = VK_VERTEX_INPUT_RATE_VERTEX, - VK_VERTEX_INPUT_RATE_END_RANGE = VK_VERTEX_INPUT_RATE_INSTANCE, - VK_VERTEX_INPUT_RATE_RANGE_SIZE = (VK_VERTEX_INPUT_RATE_INSTANCE - VK_VERTEX_INPUT_RATE_VERTEX + 1), - VK_VERTEX_INPUT_RATE_MAX_ENUM = 0x7FFFFFFF -} VkVertexInputRate; - -typedef enum VkPrimitiveTopology { - VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0, - VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 1, - VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 2, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 3, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 4, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 5, - VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 6, - VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 7, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 8, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 9, - VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 10, - VK_PRIMITIVE_TOPOLOGY_BEGIN_RANGE = VK_PRIMITIVE_TOPOLOGY_POINT_LIST, - VK_PRIMITIVE_TOPOLOGY_END_RANGE = VK_PRIMITIVE_TOPOLOGY_PATCH_LIST, - VK_PRIMITIVE_TOPOLOGY_RANGE_SIZE = (VK_PRIMITIVE_TOPOLOGY_PATCH_LIST - VK_PRIMITIVE_TOPOLOGY_POINT_LIST + 1), - VK_PRIMITIVE_TOPOLOGY_MAX_ENUM = 0x7FFFFFFF -} VkPrimitiveTopology; - -typedef enum VkPolygonMode { - VK_POLYGON_MODE_FILL = 0, - VK_POLYGON_MODE_LINE = 1, - VK_POLYGON_MODE_POINT = 2, - VK_POLYGON_MODE_FILL_RECTANGLE_NV = 1000153000, - VK_POLYGON_MODE_BEGIN_RANGE = VK_POLYGON_MODE_FILL, - VK_POLYGON_MODE_END_RANGE = VK_POLYGON_MODE_POINT, - VK_POLYGON_MODE_RANGE_SIZE = (VK_POLYGON_MODE_POINT - VK_POLYGON_MODE_FILL + 1), - VK_POLYGON_MODE_MAX_ENUM = 0x7FFFFFFF -} VkPolygonMode; - -typedef enum VkFrontFace { - VK_FRONT_FACE_COUNTER_CLOCKWISE = 0, - VK_FRONT_FACE_CLOCKWISE = 1, - VK_FRONT_FACE_BEGIN_RANGE = VK_FRONT_FACE_COUNTER_CLOCKWISE, - VK_FRONT_FACE_END_RANGE = VK_FRONT_FACE_CLOCKWISE, - VK_FRONT_FACE_RANGE_SIZE = (VK_FRONT_FACE_CLOCKWISE - VK_FRONT_FACE_COUNTER_CLOCKWISE + 1), - VK_FRONT_FACE_MAX_ENUM = 0x7FFFFFFF -} VkFrontFace; - -typedef enum VkCompareOp { - VK_COMPARE_OP_NEVER = 0, - VK_COMPARE_OP_LESS = 1, - VK_COMPARE_OP_EQUAL = 2, - VK_COMPARE_OP_LESS_OR_EQUAL = 3, - VK_COMPARE_OP_GREATER = 4, - VK_COMPARE_OP_NOT_EQUAL = 5, - VK_COMPARE_OP_GREATER_OR_EQUAL = 6, - VK_COMPARE_OP_ALWAYS = 7, - VK_COMPARE_OP_BEGIN_RANGE = VK_COMPARE_OP_NEVER, - VK_COMPARE_OP_END_RANGE = VK_COMPARE_OP_ALWAYS, - VK_COMPARE_OP_RANGE_SIZE = (VK_COMPARE_OP_ALWAYS - VK_COMPARE_OP_NEVER + 1), - VK_COMPARE_OP_MAX_ENUM = 0x7FFFFFFF -} VkCompareOp; - -typedef enum VkStencilOp { - VK_STENCIL_OP_KEEP = 0, - VK_STENCIL_OP_ZERO = 1, - VK_STENCIL_OP_REPLACE = 2, - VK_STENCIL_OP_INCREMENT_AND_CLAMP = 3, - VK_STENCIL_OP_DECREMENT_AND_CLAMP = 4, - VK_STENCIL_OP_INVERT = 5, - VK_STENCIL_OP_INCREMENT_AND_WRAP = 6, - VK_STENCIL_OP_DECREMENT_AND_WRAP = 7, - VK_STENCIL_OP_BEGIN_RANGE = VK_STENCIL_OP_KEEP, - VK_STENCIL_OP_END_RANGE = VK_STENCIL_OP_DECREMENT_AND_WRAP, - VK_STENCIL_OP_RANGE_SIZE = (VK_STENCIL_OP_DECREMENT_AND_WRAP - VK_STENCIL_OP_KEEP + 1), - VK_STENCIL_OP_MAX_ENUM = 0x7FFFFFFF -} VkStencilOp; - -typedef enum VkLogicOp { - VK_LOGIC_OP_CLEAR = 0, - VK_LOGIC_OP_AND = 1, - VK_LOGIC_OP_AND_REVERSE = 2, - VK_LOGIC_OP_COPY = 3, - VK_LOGIC_OP_AND_INVERTED = 4, - VK_LOGIC_OP_NO_OP = 5, - VK_LOGIC_OP_XOR = 6, - VK_LOGIC_OP_OR = 7, - VK_LOGIC_OP_NOR = 8, - VK_LOGIC_OP_EQUIVALENT = 9, - VK_LOGIC_OP_INVERT = 10, - VK_LOGIC_OP_OR_REVERSE = 11, - VK_LOGIC_OP_COPY_INVERTED = 12, - VK_LOGIC_OP_OR_INVERTED = 13, - VK_LOGIC_OP_NAND = 14, - VK_LOGIC_OP_SET = 15, - VK_LOGIC_OP_BEGIN_RANGE = VK_LOGIC_OP_CLEAR, - VK_LOGIC_OP_END_RANGE = VK_LOGIC_OP_SET, - VK_LOGIC_OP_RANGE_SIZE = (VK_LOGIC_OP_SET - VK_LOGIC_OP_CLEAR + 1), - VK_LOGIC_OP_MAX_ENUM = 0x7FFFFFFF -} VkLogicOp; - -typedef enum VkBlendFactor { - VK_BLEND_FACTOR_ZERO = 0, - VK_BLEND_FACTOR_ONE = 1, - VK_BLEND_FACTOR_SRC_COLOR = 2, - VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 3, - VK_BLEND_FACTOR_DST_COLOR = 4, - VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 5, - VK_BLEND_FACTOR_SRC_ALPHA = 6, - VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 7, - VK_BLEND_FACTOR_DST_ALPHA = 8, - VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 9, - VK_BLEND_FACTOR_CONSTANT_COLOR = 10, - VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 11, - VK_BLEND_FACTOR_CONSTANT_ALPHA = 12, - VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 13, - VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 14, - VK_BLEND_FACTOR_SRC1_COLOR = 15, - VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 16, - VK_BLEND_FACTOR_SRC1_ALPHA = 17, - VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 18, - VK_BLEND_FACTOR_BEGIN_RANGE = VK_BLEND_FACTOR_ZERO, - VK_BLEND_FACTOR_END_RANGE = VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA, - VK_BLEND_FACTOR_RANGE_SIZE = (VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA - VK_BLEND_FACTOR_ZERO + 1), - VK_BLEND_FACTOR_MAX_ENUM = 0x7FFFFFFF -} VkBlendFactor; - -typedef enum VkBlendOp { - VK_BLEND_OP_ADD = 0, - VK_BLEND_OP_SUBTRACT = 1, - VK_BLEND_OP_REVERSE_SUBTRACT = 2, - VK_BLEND_OP_MIN = 3, - VK_BLEND_OP_MAX = 4, - VK_BLEND_OP_ZERO_EXT = 1000148000, - VK_BLEND_OP_SRC_EXT = 1000148001, - VK_BLEND_OP_DST_EXT = 1000148002, - VK_BLEND_OP_SRC_OVER_EXT = 1000148003, - VK_BLEND_OP_DST_OVER_EXT = 1000148004, - VK_BLEND_OP_SRC_IN_EXT = 1000148005, - VK_BLEND_OP_DST_IN_EXT = 1000148006, - VK_BLEND_OP_SRC_OUT_EXT = 1000148007, - VK_BLEND_OP_DST_OUT_EXT = 1000148008, - VK_BLEND_OP_SRC_ATOP_EXT = 1000148009, - VK_BLEND_OP_DST_ATOP_EXT = 1000148010, - VK_BLEND_OP_XOR_EXT = 1000148011, - VK_BLEND_OP_MULTIPLY_EXT = 1000148012, - VK_BLEND_OP_SCREEN_EXT = 1000148013, - VK_BLEND_OP_OVERLAY_EXT = 1000148014, - VK_BLEND_OP_DARKEN_EXT = 1000148015, - VK_BLEND_OP_LIGHTEN_EXT = 1000148016, - VK_BLEND_OP_COLORDODGE_EXT = 1000148017, - VK_BLEND_OP_COLORBURN_EXT = 1000148018, - VK_BLEND_OP_HARDLIGHT_EXT = 1000148019, - VK_BLEND_OP_SOFTLIGHT_EXT = 1000148020, - VK_BLEND_OP_DIFFERENCE_EXT = 1000148021, - VK_BLEND_OP_EXCLUSION_EXT = 1000148022, - VK_BLEND_OP_INVERT_EXT = 1000148023, - VK_BLEND_OP_INVERT_RGB_EXT = 1000148024, - VK_BLEND_OP_LINEARDODGE_EXT = 1000148025, - VK_BLEND_OP_LINEARBURN_EXT = 1000148026, - VK_BLEND_OP_VIVIDLIGHT_EXT = 1000148027, - VK_BLEND_OP_LINEARLIGHT_EXT = 1000148028, - VK_BLEND_OP_PINLIGHT_EXT = 1000148029, - VK_BLEND_OP_HARDMIX_EXT = 1000148030, - VK_BLEND_OP_HSL_HUE_EXT = 1000148031, - VK_BLEND_OP_HSL_SATURATION_EXT = 1000148032, - VK_BLEND_OP_HSL_COLOR_EXT = 1000148033, - VK_BLEND_OP_HSL_LUMINOSITY_EXT = 1000148034, - VK_BLEND_OP_PLUS_EXT = 1000148035, - VK_BLEND_OP_PLUS_CLAMPED_EXT = 1000148036, - VK_BLEND_OP_PLUS_CLAMPED_ALPHA_EXT = 1000148037, - VK_BLEND_OP_PLUS_DARKER_EXT = 1000148038, - VK_BLEND_OP_MINUS_EXT = 1000148039, - VK_BLEND_OP_MINUS_CLAMPED_EXT = 1000148040, - VK_BLEND_OP_CONTRAST_EXT = 1000148041, - VK_BLEND_OP_INVERT_OVG_EXT = 1000148042, - VK_BLEND_OP_RED_EXT = 1000148043, - VK_BLEND_OP_GREEN_EXT = 1000148044, - VK_BLEND_OP_BLUE_EXT = 1000148045, - VK_BLEND_OP_BEGIN_RANGE = VK_BLEND_OP_ADD, - VK_BLEND_OP_END_RANGE = VK_BLEND_OP_MAX, - VK_BLEND_OP_RANGE_SIZE = (VK_BLEND_OP_MAX - VK_BLEND_OP_ADD + 1), - VK_BLEND_OP_MAX_ENUM = 0x7FFFFFFF -} VkBlendOp; - -typedef enum VkDynamicState { - VK_DYNAMIC_STATE_VIEWPORT = 0, - VK_DYNAMIC_STATE_SCISSOR = 1, - VK_DYNAMIC_STATE_LINE_WIDTH = 2, - VK_DYNAMIC_STATE_DEPTH_BIAS = 3, - VK_DYNAMIC_STATE_BLEND_CONSTANTS = 4, - VK_DYNAMIC_STATE_DEPTH_BOUNDS = 5, - VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 6, - VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 7, - VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8, - VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV = 1000087000, - VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT = 1000099000, - VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT = 1000143000, - VK_DYNAMIC_STATE_BEGIN_RANGE = VK_DYNAMIC_STATE_VIEWPORT, - VK_DYNAMIC_STATE_END_RANGE = VK_DYNAMIC_STATE_STENCIL_REFERENCE, - VK_DYNAMIC_STATE_RANGE_SIZE = (VK_DYNAMIC_STATE_STENCIL_REFERENCE - VK_DYNAMIC_STATE_VIEWPORT + 1), - VK_DYNAMIC_STATE_MAX_ENUM = 0x7FFFFFFF -} VkDynamicState; - -typedef enum VkFilter { - VK_FILTER_NEAREST = 0, - VK_FILTER_LINEAR = 1, - VK_FILTER_CUBIC_IMG = 1000015000, - VK_FILTER_BEGIN_RANGE = VK_FILTER_NEAREST, - VK_FILTER_END_RANGE = VK_FILTER_LINEAR, - VK_FILTER_RANGE_SIZE = (VK_FILTER_LINEAR - VK_FILTER_NEAREST + 1), - VK_FILTER_MAX_ENUM = 0x7FFFFFFF -} VkFilter; - -typedef enum VkSamplerMipmapMode { - VK_SAMPLER_MIPMAP_MODE_NEAREST = 0, - VK_SAMPLER_MIPMAP_MODE_LINEAR = 1, - VK_SAMPLER_MIPMAP_MODE_BEGIN_RANGE = VK_SAMPLER_MIPMAP_MODE_NEAREST, - VK_SAMPLER_MIPMAP_MODE_END_RANGE = VK_SAMPLER_MIPMAP_MODE_LINEAR, - VK_SAMPLER_MIPMAP_MODE_RANGE_SIZE = (VK_SAMPLER_MIPMAP_MODE_LINEAR - VK_SAMPLER_MIPMAP_MODE_NEAREST + 1), - VK_SAMPLER_MIPMAP_MODE_MAX_ENUM = 0x7FFFFFFF -} VkSamplerMipmapMode; - -typedef enum VkSamplerAddressMode { - VK_SAMPLER_ADDRESS_MODE_REPEAT = 0, - VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 1, - VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 2, - VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 3, - VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 4, - VK_SAMPLER_ADDRESS_MODE_BEGIN_RANGE = VK_SAMPLER_ADDRESS_MODE_REPEAT, - VK_SAMPLER_ADDRESS_MODE_END_RANGE = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, - VK_SAMPLER_ADDRESS_MODE_RANGE_SIZE = (VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER - VK_SAMPLER_ADDRESS_MODE_REPEAT + 1), - VK_SAMPLER_ADDRESS_MODE_MAX_ENUM = 0x7FFFFFFF -} VkSamplerAddressMode; - -typedef enum VkBorderColor { - VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0, - VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 1, - VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 2, - VK_BORDER_COLOR_INT_OPAQUE_BLACK = 3, - VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 4, - VK_BORDER_COLOR_INT_OPAQUE_WHITE = 5, - VK_BORDER_COLOR_BEGIN_RANGE = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK, - VK_BORDER_COLOR_END_RANGE = VK_BORDER_COLOR_INT_OPAQUE_WHITE, - VK_BORDER_COLOR_RANGE_SIZE = (VK_BORDER_COLOR_INT_OPAQUE_WHITE - VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK + 1), - VK_BORDER_COLOR_MAX_ENUM = 0x7FFFFFFF -} VkBorderColor; - -typedef enum VkDescriptorType { - VK_DESCRIPTOR_TYPE_SAMPLER = 0, - VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 1, - VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 2, - VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 3, - VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 4, - VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 5, - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 6, - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 7, - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 8, - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 9, - VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 10, - VK_DESCRIPTOR_TYPE_BEGIN_RANGE = VK_DESCRIPTOR_TYPE_SAMPLER, - VK_DESCRIPTOR_TYPE_END_RANGE = VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, - VK_DESCRIPTOR_TYPE_RANGE_SIZE = (VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT - VK_DESCRIPTOR_TYPE_SAMPLER + 1), - VK_DESCRIPTOR_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkDescriptorType; - -typedef enum VkAttachmentLoadOp { - VK_ATTACHMENT_LOAD_OP_LOAD = 0, - VK_ATTACHMENT_LOAD_OP_CLEAR = 1, - VK_ATTACHMENT_LOAD_OP_DONT_CARE = 2, - VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE = VK_ATTACHMENT_LOAD_OP_LOAD, - VK_ATTACHMENT_LOAD_OP_END_RANGE = VK_ATTACHMENT_LOAD_OP_DONT_CARE, - VK_ATTACHMENT_LOAD_OP_RANGE_SIZE = (VK_ATTACHMENT_LOAD_OP_DONT_CARE - VK_ATTACHMENT_LOAD_OP_LOAD + 1), - VK_ATTACHMENT_LOAD_OP_MAX_ENUM = 0x7FFFFFFF -} VkAttachmentLoadOp; - -typedef enum VkAttachmentStoreOp { - VK_ATTACHMENT_STORE_OP_STORE = 0, - VK_ATTACHMENT_STORE_OP_DONT_CARE = 1, - VK_ATTACHMENT_STORE_OP_BEGIN_RANGE = VK_ATTACHMENT_STORE_OP_STORE, - VK_ATTACHMENT_STORE_OP_END_RANGE = VK_ATTACHMENT_STORE_OP_DONT_CARE, - VK_ATTACHMENT_STORE_OP_RANGE_SIZE = (VK_ATTACHMENT_STORE_OP_DONT_CARE - VK_ATTACHMENT_STORE_OP_STORE + 1), - VK_ATTACHMENT_STORE_OP_MAX_ENUM = 0x7FFFFFFF -} VkAttachmentStoreOp; - -typedef enum VkPipelineBindPoint { - VK_PIPELINE_BIND_POINT_GRAPHICS = 0, - VK_PIPELINE_BIND_POINT_COMPUTE = 1, - VK_PIPELINE_BIND_POINT_BEGIN_RANGE = VK_PIPELINE_BIND_POINT_GRAPHICS, - VK_PIPELINE_BIND_POINT_END_RANGE = VK_PIPELINE_BIND_POINT_COMPUTE, - VK_PIPELINE_BIND_POINT_RANGE_SIZE = (VK_PIPELINE_BIND_POINT_COMPUTE - VK_PIPELINE_BIND_POINT_GRAPHICS + 1), - VK_PIPELINE_BIND_POINT_MAX_ENUM = 0x7FFFFFFF -} VkPipelineBindPoint; - -typedef enum VkCommandBufferLevel { - VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0, - VK_COMMAND_BUFFER_LEVEL_SECONDARY = 1, - VK_COMMAND_BUFFER_LEVEL_BEGIN_RANGE = VK_COMMAND_BUFFER_LEVEL_PRIMARY, - VK_COMMAND_BUFFER_LEVEL_END_RANGE = VK_COMMAND_BUFFER_LEVEL_SECONDARY, - VK_COMMAND_BUFFER_LEVEL_RANGE_SIZE = (VK_COMMAND_BUFFER_LEVEL_SECONDARY - VK_COMMAND_BUFFER_LEVEL_PRIMARY + 1), - VK_COMMAND_BUFFER_LEVEL_MAX_ENUM = 0x7FFFFFFF -} VkCommandBufferLevel; - -typedef enum VkIndexType { - VK_INDEX_TYPE_UINT16 = 0, - VK_INDEX_TYPE_UINT32 = 1, - VK_INDEX_TYPE_BEGIN_RANGE = VK_INDEX_TYPE_UINT16, - VK_INDEX_TYPE_END_RANGE = VK_INDEX_TYPE_UINT32, - VK_INDEX_TYPE_RANGE_SIZE = (VK_INDEX_TYPE_UINT32 - VK_INDEX_TYPE_UINT16 + 1), - VK_INDEX_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkIndexType; - -typedef enum VkSubpassContents { - VK_SUBPASS_CONTENTS_INLINE = 0, - VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1, - VK_SUBPASS_CONTENTS_BEGIN_RANGE = VK_SUBPASS_CONTENTS_INLINE, - VK_SUBPASS_CONTENTS_END_RANGE = VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS, - VK_SUBPASS_CONTENTS_RANGE_SIZE = (VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS - VK_SUBPASS_CONTENTS_INLINE + 1), - VK_SUBPASS_CONTENTS_MAX_ENUM = 0x7FFFFFFF -} VkSubpassContents; - -typedef enum VkObjectType { - VK_OBJECT_TYPE_UNKNOWN = 0, - VK_OBJECT_TYPE_INSTANCE = 1, - VK_OBJECT_TYPE_PHYSICAL_DEVICE = 2, - VK_OBJECT_TYPE_DEVICE = 3, - VK_OBJECT_TYPE_QUEUE = 4, - VK_OBJECT_TYPE_SEMAPHORE = 5, - VK_OBJECT_TYPE_COMMAND_BUFFER = 6, - VK_OBJECT_TYPE_FENCE = 7, - VK_OBJECT_TYPE_DEVICE_MEMORY = 8, - VK_OBJECT_TYPE_BUFFER = 9, - VK_OBJECT_TYPE_IMAGE = 10, - VK_OBJECT_TYPE_EVENT = 11, - VK_OBJECT_TYPE_QUERY_POOL = 12, - VK_OBJECT_TYPE_BUFFER_VIEW = 13, - VK_OBJECT_TYPE_IMAGE_VIEW = 14, - VK_OBJECT_TYPE_SHADER_MODULE = 15, - VK_OBJECT_TYPE_PIPELINE_CACHE = 16, - VK_OBJECT_TYPE_PIPELINE_LAYOUT = 17, - VK_OBJECT_TYPE_RENDER_PASS = 18, - VK_OBJECT_TYPE_PIPELINE = 19, - VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT = 20, - VK_OBJECT_TYPE_SAMPLER = 21, - VK_OBJECT_TYPE_DESCRIPTOR_POOL = 22, - VK_OBJECT_TYPE_DESCRIPTOR_SET = 23, - VK_OBJECT_TYPE_FRAMEBUFFER = 24, - VK_OBJECT_TYPE_COMMAND_POOL = 25, - VK_OBJECT_TYPE_SURFACE_KHR = 1000000000, - VK_OBJECT_TYPE_SWAPCHAIN_KHR = 1000001000, - VK_OBJECT_TYPE_DISPLAY_KHR = 1000002000, - VK_OBJECT_TYPE_DISPLAY_MODE_KHR = 1000002001, - VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT = 1000011000, - VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR = 1000085000, - VK_OBJECT_TYPE_OBJECT_TABLE_NVX = 1000086000, - VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX = 1000086001, - VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR = 1000156000, - VK_OBJECT_TYPE_VALIDATION_CACHE_EXT = 1000160000, - VK_OBJECT_TYPE_BEGIN_RANGE = VK_OBJECT_TYPE_UNKNOWN, - VK_OBJECT_TYPE_END_RANGE = VK_OBJECT_TYPE_COMMAND_POOL, - VK_OBJECT_TYPE_RANGE_SIZE = (VK_OBJECT_TYPE_COMMAND_POOL - VK_OBJECT_TYPE_UNKNOWN + 1), - VK_OBJECT_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkObjectType; - -typedef VkFlags VkInstanceCreateFlags; - -typedef enum VkFormatFeatureFlagBits { - VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, - VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, - VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, - VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, - VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, - VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, - VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, - VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, - VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, - VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, - VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, - VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000, - VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = 0x00004000, - VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = 0x00008000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT = 0x00010000, - VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT_KHR = 0x00020000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR = 0x00040000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR = 0x00080000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR = 0x00100000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR = 0x00200000, - VK_FORMAT_FEATURE_DISJOINT_BIT_KHR = 0x00400000, - VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR = 0x00800000, - VK_FORMAT_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkFormatFeatureFlagBits; -typedef VkFlags VkFormatFeatureFlags; - -typedef enum VkImageUsageFlagBits { - VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, - VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, - VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, - VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, - VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, - VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, - VK_IMAGE_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkImageUsageFlagBits; -typedef VkFlags VkImageUsageFlags; - -typedef enum VkImageCreateFlagBits { - VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, - VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, - VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004, - VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, - VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, - VK_IMAGE_CREATE_BIND_SFR_BIT_KHX = 0x00000040, - VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = 0x00000020, - VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR = 0x00000080, - VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR = 0x00000100, - VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT = 0x00001000, - VK_IMAGE_CREATE_DISJOINT_BIT_KHR = 0x00000200, - VK_IMAGE_CREATE_ALIAS_BIT_KHR = 0x00000400, - VK_IMAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkImageCreateFlagBits; -typedef VkFlags VkImageCreateFlags; - -typedef enum VkSampleCountFlagBits { - VK_SAMPLE_COUNT_1_BIT = 0x00000001, - VK_SAMPLE_COUNT_2_BIT = 0x00000002, - VK_SAMPLE_COUNT_4_BIT = 0x00000004, - VK_SAMPLE_COUNT_8_BIT = 0x00000008, - VK_SAMPLE_COUNT_16_BIT = 0x00000010, - VK_SAMPLE_COUNT_32_BIT = 0x00000020, - VK_SAMPLE_COUNT_64_BIT = 0x00000040, - VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkSampleCountFlagBits; -typedef VkFlags VkSampleCountFlags; - -typedef enum VkQueueFlagBits { - VK_QUEUE_GRAPHICS_BIT = 0x00000001, - VK_QUEUE_COMPUTE_BIT = 0x00000002, - VK_QUEUE_TRANSFER_BIT = 0x00000004, - VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, - VK_QUEUE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkQueueFlagBits; -typedef VkFlags VkQueueFlags; - -typedef enum VkMemoryPropertyFlagBits { - VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001, - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002, - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004, - VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008, - VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010, - VK_MEMORY_PROPERTY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkMemoryPropertyFlagBits; -typedef VkFlags VkMemoryPropertyFlags; - -typedef enum VkMemoryHeapFlagBits { - VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001, - VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHX = 0x00000002, - VK_MEMORY_HEAP_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkMemoryHeapFlagBits; -typedef VkFlags VkMemoryHeapFlags; -typedef VkFlags VkDeviceCreateFlags; -typedef VkFlags VkDeviceQueueCreateFlags; - -typedef enum VkPipelineStageFlagBits { - VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, - VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, - VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, - VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, - VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, - VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, - VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, - VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, - VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, - VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, - VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000, - VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, - VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, - VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, - VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000, - VK_PIPELINE_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkPipelineStageFlagBits; -typedef VkFlags VkPipelineStageFlags; -typedef VkFlags VkMemoryMapFlags; - -typedef enum VkImageAspectFlagBits { - VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001, - VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002, - VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004, - VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008, - VK_IMAGE_ASPECT_PLANE_0_BIT_KHR = 0x00000010, - VK_IMAGE_ASPECT_PLANE_1_BIT_KHR = 0x00000020, - VK_IMAGE_ASPECT_PLANE_2_BIT_KHR = 0x00000040, - VK_IMAGE_ASPECT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkImageAspectFlagBits; -typedef VkFlags VkImageAspectFlags; - -typedef enum VkSparseImageFormatFlagBits { - VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, - VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT = 0x00000002, - VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, - VK_SPARSE_IMAGE_FORMAT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkSparseImageFormatFlagBits; -typedef VkFlags VkSparseImageFormatFlags; - -typedef enum VkSparseMemoryBindFlagBits { - VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001, - VK_SPARSE_MEMORY_BIND_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkSparseMemoryBindFlagBits; -typedef VkFlags VkSparseMemoryBindFlags; - -typedef enum VkFenceCreateFlagBits { - VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001, - VK_FENCE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkFenceCreateFlagBits; -typedef VkFlags VkFenceCreateFlags; -typedef VkFlags VkSemaphoreCreateFlags; -typedef VkFlags VkEventCreateFlags; -typedef VkFlags VkQueryPoolCreateFlags; - -typedef enum VkQueryPipelineStatisticFlagBits { - VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, - VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, - VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, - VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, - VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, - VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, - VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, - VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, - VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, - VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, - VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, - VK_QUERY_PIPELINE_STATISTIC_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkQueryPipelineStatisticFlagBits; -typedef VkFlags VkQueryPipelineStatisticFlags; - -typedef enum VkQueryResultFlagBits { - VK_QUERY_RESULT_64_BIT = 0x00000001, - VK_QUERY_RESULT_WAIT_BIT = 0x00000002, - VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, - VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, - VK_QUERY_RESULT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkQueryResultFlagBits; -typedef VkFlags VkQueryResultFlags; - -typedef enum VkBufferCreateFlagBits { - VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, - VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, - VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, - VK_BUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkBufferCreateFlagBits; -typedef VkFlags VkBufferCreateFlags; - -typedef enum VkBufferUsageFlagBits { - VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, - VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, - VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, - VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, - VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, - VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, - VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, - VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, - VK_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkBufferUsageFlagBits; -typedef VkFlags VkBufferUsageFlags; -typedef VkFlags VkBufferViewCreateFlags; -typedef VkFlags VkImageViewCreateFlags; -typedef VkFlags VkShaderModuleCreateFlags; -typedef VkFlags VkPipelineCacheCreateFlags; - -typedef enum VkPipelineCreateFlagBits { - VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001, - VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002, - VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004, - VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHX = 0x00000008, - VK_PIPELINE_CREATE_DISPATCH_BASE_KHX = 0x00000010, - VK_PIPELINE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkPipelineCreateFlagBits; -typedef VkFlags VkPipelineCreateFlags; -typedef VkFlags VkPipelineShaderStageCreateFlags; - -typedef enum VkShaderStageFlagBits { - VK_SHADER_STAGE_VERTEX_BIT = 0x00000001, - VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002, - VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004, - VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008, - VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010, - VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020, - VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F, - VK_SHADER_STAGE_ALL = 0x7FFFFFFF, - VK_SHADER_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkShaderStageFlagBits; -typedef VkFlags VkPipelineVertexInputStateCreateFlags; -typedef VkFlags VkPipelineInputAssemblyStateCreateFlags; -typedef VkFlags VkPipelineTessellationStateCreateFlags; -typedef VkFlags VkPipelineViewportStateCreateFlags; -typedef VkFlags VkPipelineRasterizationStateCreateFlags; - -typedef enum VkCullModeFlagBits { - VK_CULL_MODE_NONE = 0, - VK_CULL_MODE_FRONT_BIT = 0x00000001, - VK_CULL_MODE_BACK_BIT = 0x00000002, - VK_CULL_MODE_FRONT_AND_BACK = 0x00000003, - VK_CULL_MODE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkCullModeFlagBits; -typedef VkFlags VkCullModeFlags; -typedef VkFlags VkPipelineMultisampleStateCreateFlags; -typedef VkFlags VkPipelineDepthStencilStateCreateFlags; -typedef VkFlags VkPipelineColorBlendStateCreateFlags; - -typedef enum VkColorComponentFlagBits { - VK_COLOR_COMPONENT_R_BIT = 0x00000001, - VK_COLOR_COMPONENT_G_BIT = 0x00000002, - VK_COLOR_COMPONENT_B_BIT = 0x00000004, - VK_COLOR_COMPONENT_A_BIT = 0x00000008, - VK_COLOR_COMPONENT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkColorComponentFlagBits; -typedef VkFlags VkColorComponentFlags; -typedef VkFlags VkPipelineDynamicStateCreateFlags; -typedef VkFlags VkPipelineLayoutCreateFlags; -typedef VkFlags VkShaderStageFlags; -typedef VkFlags VkSamplerCreateFlags; - -typedef enum VkDescriptorSetLayoutCreateFlagBits { - VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR = 0x00000001, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkDescriptorSetLayoutCreateFlagBits; -typedef VkFlags VkDescriptorSetLayoutCreateFlags; - -typedef enum VkDescriptorPoolCreateFlagBits { - VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001, - VK_DESCRIPTOR_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkDescriptorPoolCreateFlagBits; -typedef VkFlags VkDescriptorPoolCreateFlags; -typedef VkFlags VkDescriptorPoolResetFlags; -typedef VkFlags VkFramebufferCreateFlags; -typedef VkFlags VkRenderPassCreateFlags; - -typedef enum VkAttachmentDescriptionFlagBits { - VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT = 0x00000001, - VK_ATTACHMENT_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkAttachmentDescriptionFlagBits; -typedef VkFlags VkAttachmentDescriptionFlags; - -typedef enum VkSubpassDescriptionFlagBits { - VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX = 0x00000001, - VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX = 0x00000002, - VK_SUBPASS_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkSubpassDescriptionFlagBits; -typedef VkFlags VkSubpassDescriptionFlags; - -typedef enum VkAccessFlagBits { - VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001, - VK_ACCESS_INDEX_READ_BIT = 0x00000002, - VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004, - VK_ACCESS_UNIFORM_READ_BIT = 0x00000008, - VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010, - VK_ACCESS_SHADER_READ_BIT = 0x00000020, - VK_ACCESS_SHADER_WRITE_BIT = 0x00000040, - VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080, - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100, - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200, - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400, - VK_ACCESS_TRANSFER_READ_BIT = 0x00000800, - VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000, - VK_ACCESS_HOST_READ_BIT = 0x00002000, - VK_ACCESS_HOST_WRITE_BIT = 0x00004000, - VK_ACCESS_MEMORY_READ_BIT = 0x00008000, - VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000, - VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000, - VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000, - VK_ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT = 0x00080000, - VK_ACCESS_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkAccessFlagBits; -typedef VkFlags VkAccessFlags; - -typedef enum VkDependencyFlagBits { - VK_DEPENDENCY_BY_REGION_BIT = 0x00000001, - VK_DEPENDENCY_VIEW_LOCAL_BIT_KHX = 0x00000002, - VK_DEPENDENCY_DEVICE_GROUP_BIT_KHX = 0x00000004, - VK_DEPENDENCY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkDependencyFlagBits; -typedef VkFlags VkDependencyFlags; - -typedef enum VkCommandPoolCreateFlagBits { - VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, - VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, - VK_COMMAND_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkCommandPoolCreateFlagBits; -typedef VkFlags VkCommandPoolCreateFlags; - -typedef enum VkCommandPoolResetFlagBits { - VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, - VK_COMMAND_POOL_RESET_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkCommandPoolResetFlagBits; -typedef VkFlags VkCommandPoolResetFlags; - -typedef enum VkCommandBufferUsageFlagBits { - VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001, - VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002, - VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004, - VK_COMMAND_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkCommandBufferUsageFlagBits; -typedef VkFlags VkCommandBufferUsageFlags; - -typedef enum VkQueryControlFlagBits { - VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001, - VK_QUERY_CONTROL_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkQueryControlFlagBits; -typedef VkFlags VkQueryControlFlags; - -typedef enum VkCommandBufferResetFlagBits { - VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, - VK_COMMAND_BUFFER_RESET_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkCommandBufferResetFlagBits; -typedef VkFlags VkCommandBufferResetFlags; - -typedef enum VkStencilFaceFlagBits { - VK_STENCIL_FACE_FRONT_BIT = 0x00000001, - VK_STENCIL_FACE_BACK_BIT = 0x00000002, - VK_STENCIL_FRONT_AND_BACK = 0x00000003, - VK_STENCIL_FACE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkStencilFaceFlagBits; -typedef VkFlags VkStencilFaceFlags; - -typedef struct VkApplicationInfo { - VkStructureType sType; - const void* pNext; - const char* pApplicationName; - uint32_t applicationVersion; - const char* pEngineName; - uint32_t engineVersion; - uint32_t apiVersion; -} VkApplicationInfo; - -typedef struct VkInstanceCreateInfo { - VkStructureType sType; - const void* pNext; - VkInstanceCreateFlags flags; - const VkApplicationInfo* pApplicationInfo; - uint32_t enabledLayerCount; - const char* const* ppEnabledLayerNames; - uint32_t enabledExtensionCount; - const char* const* ppEnabledExtensionNames; -} VkInstanceCreateInfo; - -typedef void* (VKAPI_PTR *PFN_vkAllocationFunction)( - void* pUserData, - size_t size, - size_t alignment, - VkSystemAllocationScope allocationScope); - -typedef void* (VKAPI_PTR *PFN_vkReallocationFunction)( - void* pUserData, - void* pOriginal, - size_t size, - size_t alignment, - VkSystemAllocationScope allocationScope); - -typedef void (VKAPI_PTR *PFN_vkFreeFunction)( - void* pUserData, - void* pMemory); - -typedef void (VKAPI_PTR *PFN_vkInternalAllocationNotification)( - void* pUserData, - size_t size, - VkInternalAllocationType allocationType, - VkSystemAllocationScope allocationScope); - -typedef void (VKAPI_PTR *PFN_vkInternalFreeNotification)( - void* pUserData, - size_t size, - VkInternalAllocationType allocationType, - VkSystemAllocationScope allocationScope); - -typedef struct VkAllocationCallbacks { - void* pUserData; - PFN_vkAllocationFunction pfnAllocation; - PFN_vkReallocationFunction pfnReallocation; - PFN_vkFreeFunction pfnFree; - PFN_vkInternalAllocationNotification pfnInternalAllocation; - PFN_vkInternalFreeNotification pfnInternalFree; -} VkAllocationCallbacks; - -typedef struct VkPhysicalDeviceFeatures { - VkBool32 robustBufferAccess; - VkBool32 fullDrawIndexUint32; - VkBool32 imageCubeArray; - VkBool32 independentBlend; - VkBool32 geometryShader; - VkBool32 tessellationShader; - VkBool32 sampleRateShading; - VkBool32 dualSrcBlend; - VkBool32 logicOp; - VkBool32 multiDrawIndirect; - VkBool32 drawIndirectFirstInstance; - VkBool32 depthClamp; - VkBool32 depthBiasClamp; - VkBool32 fillModeNonSolid; - VkBool32 depthBounds; - VkBool32 wideLines; - VkBool32 largePoints; - VkBool32 alphaToOne; - VkBool32 multiViewport; - VkBool32 samplerAnisotropy; - VkBool32 textureCompressionETC2; - VkBool32 textureCompressionASTC_LDR; - VkBool32 textureCompressionBC; - VkBool32 occlusionQueryPrecise; - VkBool32 pipelineStatisticsQuery; - VkBool32 vertexPipelineStoresAndAtomics; - VkBool32 fragmentStoresAndAtomics; - VkBool32 shaderTessellationAndGeometryPointSize; - VkBool32 shaderImageGatherExtended; - VkBool32 shaderStorageImageExtendedFormats; - VkBool32 shaderStorageImageMultisample; - VkBool32 shaderStorageImageReadWithoutFormat; - VkBool32 shaderStorageImageWriteWithoutFormat; - VkBool32 shaderUniformBufferArrayDynamicIndexing; - VkBool32 shaderSampledImageArrayDynamicIndexing; - VkBool32 shaderStorageBufferArrayDynamicIndexing; - VkBool32 shaderStorageImageArrayDynamicIndexing; - VkBool32 shaderClipDistance; - VkBool32 shaderCullDistance; - VkBool32 shaderFloat64; - VkBool32 shaderInt64; - VkBool32 shaderInt16; - VkBool32 shaderResourceResidency; - VkBool32 shaderResourceMinLod; - VkBool32 sparseBinding; - VkBool32 sparseResidencyBuffer; - VkBool32 sparseResidencyImage2D; - VkBool32 sparseResidencyImage3D; - VkBool32 sparseResidency2Samples; - VkBool32 sparseResidency4Samples; - VkBool32 sparseResidency8Samples; - VkBool32 sparseResidency16Samples; - VkBool32 sparseResidencyAliased; - VkBool32 variableMultisampleRate; - VkBool32 inheritedQueries; -} VkPhysicalDeviceFeatures; - -typedef struct VkFormatProperties { - VkFormatFeatureFlags linearTilingFeatures; - VkFormatFeatureFlags optimalTilingFeatures; - VkFormatFeatureFlags bufferFeatures; -} VkFormatProperties; - -typedef struct VkExtent3D { - uint32_t width; - uint32_t height; - uint32_t depth; -} VkExtent3D; - -typedef struct VkImageFormatProperties { - VkExtent3D maxExtent; - uint32_t maxMipLevels; - uint32_t maxArrayLayers; - VkSampleCountFlags sampleCounts; - VkDeviceSize maxResourceSize; -} VkImageFormatProperties; - -typedef struct VkPhysicalDeviceLimits { - 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; - VkDeviceSize bufferImageGranularity; - VkDeviceSize 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; - uint32_t maxComputeWorkGroupCount[3]; - uint32_t maxComputeWorkGroupInvocations; - uint32_t maxComputeWorkGroupSize[3]; - uint32_t subPixelPrecisionBits; - uint32_t subTexelPrecisionBits; - uint32_t mipmapPrecisionBits; - uint32_t maxDrawIndexedIndexValue; - uint32_t maxDrawIndirectCount; - float maxSamplerLodBias; - float maxSamplerAnisotropy; - uint32_t maxViewports; - uint32_t maxViewportDimensions[2]; - float viewportBoundsRange[2]; - uint32_t viewportSubPixelBits; - size_t minMemoryMapAlignment; - VkDeviceSize minTexelBufferOffsetAlignment; - VkDeviceSize minUniformBufferOffsetAlignment; - VkDeviceSize 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; - VkSampleCountFlags framebufferColorSampleCounts; - VkSampleCountFlags framebufferDepthSampleCounts; - VkSampleCountFlags framebufferStencilSampleCounts; - VkSampleCountFlags framebufferNoAttachmentsSampleCounts; - uint32_t maxColorAttachments; - VkSampleCountFlags sampledImageColorSampleCounts; - VkSampleCountFlags sampledImageIntegerSampleCounts; - VkSampleCountFlags sampledImageDepthSampleCounts; - VkSampleCountFlags sampledImageStencilSampleCounts; - VkSampleCountFlags storageImageSampleCounts; - uint32_t maxSampleMaskWords; - VkBool32 timestampComputeAndGraphics; - float timestampPeriod; - uint32_t maxClipDistances; - uint32_t maxCullDistances; - uint32_t maxCombinedClipAndCullDistances; - uint32_t discreteQueuePriorities; - float pointSizeRange[2]; - float lineWidthRange[2]; - float pointSizeGranularity; - float lineWidthGranularity; - VkBool32 strictLines; - VkBool32 standardSampleLocations; - VkDeviceSize optimalBufferCopyOffsetAlignment; - VkDeviceSize optimalBufferCopyRowPitchAlignment; - VkDeviceSize nonCoherentAtomSize; -} VkPhysicalDeviceLimits; - -typedef struct VkPhysicalDeviceSparseProperties { - VkBool32 residencyStandard2DBlockShape; - VkBool32 residencyStandard2DMultisampleBlockShape; - VkBool32 residencyStandard3DBlockShape; - VkBool32 residencyAlignedMipSize; - VkBool32 residencyNonResidentStrict; -} VkPhysicalDeviceSparseProperties; - -typedef struct VkPhysicalDeviceProperties { - uint32_t apiVersion; - uint32_t driverVersion; - uint32_t vendorID; - uint32_t deviceID; - VkPhysicalDeviceType deviceType; - char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; - uint8_t pipelineCacheUUID[VK_UUID_SIZE]; - VkPhysicalDeviceLimits limits; - VkPhysicalDeviceSparseProperties sparseProperties; -} VkPhysicalDeviceProperties; - -typedef struct VkQueueFamilyProperties { - VkQueueFlags queueFlags; - uint32_t queueCount; - uint32_t timestampValidBits; - VkExtent3D minImageTransferGranularity; -} VkQueueFamilyProperties; - -typedef struct VkMemoryType { - VkMemoryPropertyFlags propertyFlags; - uint32_t heapIndex; -} VkMemoryType; - -typedef struct VkMemoryHeap { - VkDeviceSize size; - VkMemoryHeapFlags flags; -} VkMemoryHeap; - -typedef struct VkPhysicalDeviceMemoryProperties { - uint32_t memoryTypeCount; - VkMemoryType memoryTypes[VK_MAX_MEMORY_TYPES]; - uint32_t memoryHeapCount; - VkMemoryHeap memoryHeaps[VK_MAX_MEMORY_HEAPS]; -} VkPhysicalDeviceMemoryProperties; - -typedef void (VKAPI_PTR *PFN_vkVoidFunction)(void); -typedef struct VkDeviceQueueCreateInfo { - VkStructureType sType; - const void* pNext; - VkDeviceQueueCreateFlags flags; - uint32_t queueFamilyIndex; - uint32_t queueCount; - const float* pQueuePriorities; -} VkDeviceQueueCreateInfo; - -typedef struct VkDeviceCreateInfo { - VkStructureType sType; - const void* pNext; - VkDeviceCreateFlags flags; - uint32_t queueCreateInfoCount; - const VkDeviceQueueCreateInfo* pQueueCreateInfos; - uint32_t enabledLayerCount; - const char* const* ppEnabledLayerNames; - uint32_t enabledExtensionCount; - const char* const* ppEnabledExtensionNames; - const VkPhysicalDeviceFeatures* pEnabledFeatures; -} VkDeviceCreateInfo; - -typedef struct VkExtensionProperties { - char extensionName[VK_MAX_EXTENSION_NAME_SIZE]; - uint32_t specVersion; -} VkExtensionProperties; - -typedef struct VkLayerProperties { - char layerName[VK_MAX_EXTENSION_NAME_SIZE]; - uint32_t specVersion; - uint32_t implementationVersion; - char description[VK_MAX_DESCRIPTION_SIZE]; -} VkLayerProperties; - -typedef struct VkSubmitInfo { - VkStructureType sType; - const void* pNext; - uint32_t waitSemaphoreCount; - const VkSemaphore* pWaitSemaphores; - const VkPipelineStageFlags* pWaitDstStageMask; - uint32_t commandBufferCount; - const VkCommandBuffer* pCommandBuffers; - uint32_t signalSemaphoreCount; - const VkSemaphore* pSignalSemaphores; -} VkSubmitInfo; - -typedef struct VkMemoryAllocateInfo { - VkStructureType sType; - const void* pNext; - VkDeviceSize allocationSize; - uint32_t memoryTypeIndex; -} VkMemoryAllocateInfo; - -typedef struct VkMappedMemoryRange { - VkStructureType sType; - const void* pNext; - VkDeviceMemory memory; - VkDeviceSize offset; - VkDeviceSize size; -} VkMappedMemoryRange; - -typedef struct VkMemoryRequirements { - VkDeviceSize size; - VkDeviceSize alignment; - uint32_t memoryTypeBits; -} VkMemoryRequirements; - -typedef struct VkSparseImageFormatProperties { - VkImageAspectFlags aspectMask; - VkExtent3D imageGranularity; - VkSparseImageFormatFlags flags; -} VkSparseImageFormatProperties; - -typedef struct VkSparseImageMemoryRequirements { - VkSparseImageFormatProperties formatProperties; - uint32_t imageMipTailFirstLod; - VkDeviceSize imageMipTailSize; - VkDeviceSize imageMipTailOffset; - VkDeviceSize imageMipTailStride; -} VkSparseImageMemoryRequirements; - -typedef struct VkSparseMemoryBind { - VkDeviceSize resourceOffset; - VkDeviceSize size; - VkDeviceMemory memory; - VkDeviceSize memoryOffset; - VkSparseMemoryBindFlags flags; -} VkSparseMemoryBind; - -typedef struct VkSparseBufferMemoryBindInfo { - VkBuffer buffer; - uint32_t bindCount; - const VkSparseMemoryBind* pBinds; -} VkSparseBufferMemoryBindInfo; - -typedef struct VkSparseImageOpaqueMemoryBindInfo { - VkImage image; - uint32_t bindCount; - const VkSparseMemoryBind* pBinds; -} VkSparseImageOpaqueMemoryBindInfo; - -typedef struct VkImageSubresource { - VkImageAspectFlags aspectMask; - uint32_t mipLevel; - uint32_t arrayLayer; -} VkImageSubresource; - -typedef struct VkOffset3D { - int32_t x; - int32_t y; - int32_t z; -} VkOffset3D; - -typedef struct VkSparseImageMemoryBind { - VkImageSubresource subresource; - VkOffset3D offset; - VkExtent3D extent; - VkDeviceMemory memory; - VkDeviceSize memoryOffset; - VkSparseMemoryBindFlags flags; -} VkSparseImageMemoryBind; - -typedef struct VkSparseImageMemoryBindInfo { - VkImage image; - uint32_t bindCount; - const VkSparseImageMemoryBind* pBinds; -} VkSparseImageMemoryBindInfo; -typedef struct VkBindSparseInfo { - VkStructureType sType; - const void* pNext; - uint32_t waitSemaphoreCount; - const VkSemaphore* pWaitSemaphores; - uint32_t bufferBindCount; - const VkSparseBufferMemoryBindInfo* pBufferBinds; - uint32_t imageOpaqueBindCount; - const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds; - uint32_t imageBindCount; - const VkSparseImageMemoryBindInfo* pImageBinds; - uint32_t signalSemaphoreCount; - const VkSemaphore* pSignalSemaphores; -} VkBindSparseInfo; -typedef struct VkFenceCreateInfo { - VkStructureType sType; - const void* pNext; - VkFenceCreateFlags flags; -} VkFenceCreateInfo; - -typedef struct VkSemaphoreCreateInfo { - VkStructureType sType; - const void* pNext; - VkSemaphoreCreateFlags flags; -} VkSemaphoreCreateInfo; - -typedef struct VkEventCreateInfo { - VkStructureType sType; - const void* pNext; - VkEventCreateFlags flags; -} VkEventCreateInfo; - -typedef struct VkQueryPoolCreateInfo { - VkStructureType sType; - const void* pNext; - VkQueryPoolCreateFlags flags; - VkQueryType queryType; - uint32_t queryCount; - VkQueryPipelineStatisticFlags pipelineStatistics; -} VkQueryPoolCreateInfo; - -typedef struct VkBufferCreateInfo { - VkStructureType sType; - const void* pNext; - VkBufferCreateFlags flags; - VkDeviceSize size; - VkBufferUsageFlags usage; - VkSharingMode sharingMode; - uint32_t queueFamilyIndexCount; - const uint32_t* pQueueFamilyIndices; -} VkBufferCreateInfo; - -typedef struct VkBufferViewCreateInfo { - VkStructureType sType; - const void* pNext; - VkBufferViewCreateFlags flags; - VkBuffer buffer; - VkFormat format; - VkDeviceSize offset; - VkDeviceSize range; -} VkBufferViewCreateInfo; - -typedef struct VkImageCreateInfo { - VkStructureType sType; - const void* pNext; - VkImageCreateFlags flags; - VkImageType imageType; - VkFormat format; - VkExtent3D extent; - uint32_t mipLevels; - uint32_t arrayLayers; - VkSampleCountFlagBits samples; - VkImageTiling tiling; - VkImageUsageFlags usage; - VkSharingMode sharingMode; - uint32_t queueFamilyIndexCount; - const uint32_t* pQueueFamilyIndices; - VkImageLayout initialLayout; -} VkImageCreateInfo; - -typedef struct VkSubresourceLayout { - VkDeviceSize offset; - VkDeviceSize size; - VkDeviceSize rowPitch; - VkDeviceSize arrayPitch; - VkDeviceSize depthPitch; -} VkSubresourceLayout; - -typedef struct VkComponentMapping { - VkComponentSwizzle r; - VkComponentSwizzle g; - VkComponentSwizzle b; - VkComponentSwizzle a; -} VkComponentMapping; - -typedef struct VkImageSubresourceRange { - VkImageAspectFlags aspectMask; - uint32_t baseMipLevel; - uint32_t levelCount; - uint32_t baseArrayLayer; - uint32_t layerCount; -} VkImageSubresourceRange; - -typedef struct VkImageViewCreateInfo { - VkStructureType sType; - const void* pNext; - VkImageViewCreateFlags flags; - VkImage image; - VkImageViewType viewType; - VkFormat format; - VkComponentMapping components; - VkImageSubresourceRange subresourceRange; -} VkImageViewCreateInfo; - -typedef struct VkShaderModuleCreateInfo { - VkStructureType sType; - const void* pNext; - VkShaderModuleCreateFlags flags; - size_t codeSize; - const uint32_t* pCode; -} VkShaderModuleCreateInfo; - -typedef struct VkPipelineCacheCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineCacheCreateFlags flags; - size_t initialDataSize; - const void* pInitialData; -} VkPipelineCacheCreateInfo; - -typedef struct VkSpecializationMapEntry { - uint32_t constantID; - uint32_t offset; - size_t size; -} VkSpecializationMapEntry; - -typedef struct VkSpecializationInfo { - uint32_t mapEntryCount; - const VkSpecializationMapEntry* pMapEntries; - size_t dataSize; - const void* pData; -} VkSpecializationInfo; - -typedef struct VkPipelineShaderStageCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineShaderStageCreateFlags flags; - VkShaderStageFlagBits stage; - VkShaderModule module; - const char* pName; - const VkSpecializationInfo* pSpecializationInfo; -} VkPipelineShaderStageCreateInfo; - -typedef struct VkVertexInputBindingDescription { - uint32_t binding; - uint32_t stride; - VkVertexInputRate inputRate; -} VkVertexInputBindingDescription; - -typedef struct VkVertexInputAttributeDescription { - uint32_t location; - uint32_t binding; - VkFormat format; - uint32_t offset; -} VkVertexInputAttributeDescription; - -typedef struct VkPipelineVertexInputStateCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineVertexInputStateCreateFlags flags; - uint32_t vertexBindingDescriptionCount; - const VkVertexInputBindingDescription* pVertexBindingDescriptions; - uint32_t vertexAttributeDescriptionCount; - const VkVertexInputAttributeDescription* pVertexAttributeDescriptions; -} VkPipelineVertexInputStateCreateInfo; - -typedef struct VkPipelineInputAssemblyStateCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineInputAssemblyStateCreateFlags flags; - VkPrimitiveTopology topology; - VkBool32 primitiveRestartEnable; -} VkPipelineInputAssemblyStateCreateInfo; - -typedef struct VkPipelineTessellationStateCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineTessellationStateCreateFlags flags; - uint32_t patchControlPoints; -} VkPipelineTessellationStateCreateInfo; - -typedef struct VkViewport { - float x; - float y; - float width; - float height; - float minDepth; - float maxDepth; -} VkViewport; - -typedef struct VkOffset2D { - int32_t x; - int32_t y; -} VkOffset2D; - -typedef struct VkExtent2D { - uint32_t width; - uint32_t height; -} VkExtent2D; - -typedef struct VkRect2D { - VkOffset2D offset; - VkExtent2D extent; -} VkRect2D; - -typedef struct VkPipelineViewportStateCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineViewportStateCreateFlags flags; - uint32_t viewportCount; - const VkViewport* pViewports; - uint32_t scissorCount; - const VkRect2D* pScissors; -} VkPipelineViewportStateCreateInfo; - -typedef struct VkPipelineRasterizationStateCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineRasterizationStateCreateFlags flags; - VkBool32 depthClampEnable; - VkBool32 rasterizerDiscardEnable; - VkPolygonMode polygonMode; - VkCullModeFlags cullMode; - VkFrontFace frontFace; - VkBool32 depthBiasEnable; - float depthBiasConstantFactor; - float depthBiasClamp; - float depthBiasSlopeFactor; - float lineWidth; -} VkPipelineRasterizationStateCreateInfo; - -typedef struct VkPipelineMultisampleStateCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineMultisampleStateCreateFlags flags; - VkSampleCountFlagBits rasterizationSamples; - VkBool32 sampleShadingEnable; - float minSampleShading; - const VkSampleMask* pSampleMask; - VkBool32 alphaToCoverageEnable; - VkBool32 alphaToOneEnable; -} VkPipelineMultisampleStateCreateInfo; - -typedef struct VkStencilOpState { - VkStencilOp failOp; - VkStencilOp passOp; - VkStencilOp depthFailOp; - VkCompareOp compareOp; - uint32_t compareMask; - uint32_t writeMask; - uint32_t reference; -} VkStencilOpState; - -typedef struct VkPipelineDepthStencilStateCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineDepthStencilStateCreateFlags flags; - VkBool32 depthTestEnable; - VkBool32 depthWriteEnable; - VkCompareOp depthCompareOp; - VkBool32 depthBoundsTestEnable; - VkBool32 stencilTestEnable; - VkStencilOpState front; - VkStencilOpState back; - float minDepthBounds; - float maxDepthBounds; -} VkPipelineDepthStencilStateCreateInfo; - -typedef struct VkPipelineColorBlendAttachmentState { - VkBool32 blendEnable; - VkBlendFactor srcColorBlendFactor; - VkBlendFactor dstColorBlendFactor; - VkBlendOp colorBlendOp; - VkBlendFactor srcAlphaBlendFactor; - VkBlendFactor dstAlphaBlendFactor; - VkBlendOp alphaBlendOp; - VkColorComponentFlags colorWriteMask; -} VkPipelineColorBlendAttachmentState; - -typedef struct VkPipelineColorBlendStateCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineColorBlendStateCreateFlags flags; - VkBool32 logicOpEnable; - VkLogicOp logicOp; - uint32_t attachmentCount; - const VkPipelineColorBlendAttachmentState* pAttachments; - float blendConstants[4]; -} VkPipelineColorBlendStateCreateInfo; - -typedef struct VkPipelineDynamicStateCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineDynamicStateCreateFlags flags; - uint32_t dynamicStateCount; - const VkDynamicState* pDynamicStates; -} VkPipelineDynamicStateCreateInfo; - -typedef struct VkGraphicsPipelineCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineCreateFlags flags; - uint32_t stageCount; - const VkPipelineShaderStageCreateInfo* pStages; - const VkPipelineVertexInputStateCreateInfo* pVertexInputState; - const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState; - const VkPipelineTessellationStateCreateInfo* pTessellationState; - const VkPipelineViewportStateCreateInfo* pViewportState; - const VkPipelineRasterizationStateCreateInfo* pRasterizationState; - const VkPipelineMultisampleStateCreateInfo* pMultisampleState; - const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState; - const VkPipelineColorBlendStateCreateInfo* pColorBlendState; - const VkPipelineDynamicStateCreateInfo* pDynamicState; - VkPipelineLayout layout; - VkRenderPass renderPass; - uint32_t subpass; - VkPipeline basePipelineHandle; - int32_t basePipelineIndex; -} VkGraphicsPipelineCreateInfo; - -typedef struct VkComputePipelineCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineCreateFlags flags; - VkPipelineShaderStageCreateInfo stage; - VkPipelineLayout layout; - VkPipeline basePipelineHandle; - int32_t basePipelineIndex; -} VkComputePipelineCreateInfo; - -typedef struct VkPushConstantRange { - VkShaderStageFlags stageFlags; - uint32_t offset; - uint32_t size; -} VkPushConstantRange; - -typedef struct VkPipelineLayoutCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineLayoutCreateFlags flags; - uint32_t setLayoutCount; - const VkDescriptorSetLayout* pSetLayouts; - uint32_t pushConstantRangeCount; - const VkPushConstantRange* pPushConstantRanges; -} VkPipelineLayoutCreateInfo; - -typedef struct VkSamplerCreateInfo { - VkStructureType sType; - const void* pNext; - VkSamplerCreateFlags flags; - VkFilter magFilter; - VkFilter minFilter; - VkSamplerMipmapMode mipmapMode; - VkSamplerAddressMode addressModeU; - VkSamplerAddressMode addressModeV; - VkSamplerAddressMode addressModeW; - float mipLodBias; - VkBool32 anisotropyEnable; - float maxAnisotropy; - VkBool32 compareEnable; - VkCompareOp compareOp; - float minLod; - float maxLod; - VkBorderColor borderColor; - VkBool32 unnormalizedCoordinates; -} VkSamplerCreateInfo; - -typedef struct VkDescriptorSetLayoutBinding { - uint32_t binding; - VkDescriptorType descriptorType; - uint32_t descriptorCount; - VkShaderStageFlags stageFlags; - const VkSampler* pImmutableSamplers; -} VkDescriptorSetLayoutBinding; - -typedef struct VkDescriptorSetLayoutCreateInfo { - VkStructureType sType; - const void* pNext; - VkDescriptorSetLayoutCreateFlags flags; - uint32_t bindingCount; - const VkDescriptorSetLayoutBinding* pBindings; -} VkDescriptorSetLayoutCreateInfo; - -typedef struct VkDescriptorPoolSize { - VkDescriptorType type; - uint32_t descriptorCount; -} VkDescriptorPoolSize; - -typedef struct VkDescriptorPoolCreateInfo { - VkStructureType sType; - const void* pNext; - VkDescriptorPoolCreateFlags flags; - uint32_t maxSets; - uint32_t poolSizeCount; - const VkDescriptorPoolSize* pPoolSizes; -} VkDescriptorPoolCreateInfo; - -typedef struct VkDescriptorSetAllocateInfo { - VkStructureType sType; - const void* pNext; - VkDescriptorPool descriptorPool; - uint32_t descriptorSetCount; - const VkDescriptorSetLayout* pSetLayouts; -} VkDescriptorSetAllocateInfo; - -typedef struct VkDescriptorImageInfo { - VkSampler sampler; - VkImageView imageView; - VkImageLayout imageLayout; -} VkDescriptorImageInfo; - -typedef struct VkDescriptorBufferInfo { - VkBuffer buffer; - VkDeviceSize offset; - VkDeviceSize range; -} VkDescriptorBufferInfo; - -typedef struct VkWriteDescriptorSet { - VkStructureType sType; - const void* pNext; - VkDescriptorSet dstSet; - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; - VkDescriptorType descriptorType; - const VkDescriptorImageInfo* pImageInfo; - const VkDescriptorBufferInfo* pBufferInfo; - const VkBufferView* pTexelBufferView; -} VkWriteDescriptorSet; - -typedef struct VkCopyDescriptorSet { - VkStructureType sType; - const void* pNext; - VkDescriptorSet srcSet; - uint32_t srcBinding; - uint32_t srcArrayElement; - VkDescriptorSet dstSet; - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; -} VkCopyDescriptorSet; - -typedef struct VkFramebufferCreateInfo { - VkStructureType sType; - const void* pNext; - VkFramebufferCreateFlags flags; - VkRenderPass renderPass; - uint32_t attachmentCount; - const VkImageView* pAttachments; - uint32_t width; - uint32_t height; - uint32_t layers; -} VkFramebufferCreateInfo; - -typedef struct VkAttachmentDescription { - VkAttachmentDescriptionFlags flags; - VkFormat format; - VkSampleCountFlagBits samples; - VkAttachmentLoadOp loadOp; - VkAttachmentStoreOp storeOp; - VkAttachmentLoadOp stencilLoadOp; - VkAttachmentStoreOp stencilStoreOp; - VkImageLayout initialLayout; - VkImageLayout finalLayout; -} VkAttachmentDescription; - -typedef struct VkAttachmentReference { - uint32_t attachment; - VkImageLayout layout; -} VkAttachmentReference; - -typedef struct VkSubpassDescription { - VkSubpassDescriptionFlags flags; - VkPipelineBindPoint pipelineBindPoint; - uint32_t inputAttachmentCount; - const VkAttachmentReference* pInputAttachments; - uint32_t colorAttachmentCount; - const VkAttachmentReference* pColorAttachments; - const VkAttachmentReference* pResolveAttachments; - const VkAttachmentReference* pDepthStencilAttachment; - uint32_t preserveAttachmentCount; - const uint32_t* pPreserveAttachments; -} VkSubpassDescription; - -typedef struct VkSubpassDependency { - uint32_t srcSubpass; - uint32_t dstSubpass; - VkPipelineStageFlags srcStageMask; - VkPipelineStageFlags dstStageMask; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - VkDependencyFlags dependencyFlags; -} VkSubpassDependency; - -typedef struct VkRenderPassCreateInfo { - VkStructureType sType; - const void* pNext; - VkRenderPassCreateFlags flags; - uint32_t attachmentCount; - const VkAttachmentDescription* pAttachments; - uint32_t subpassCount; - const VkSubpassDescription* pSubpasses; - uint32_t dependencyCount; - const VkSubpassDependency* pDependencies; -} VkRenderPassCreateInfo; - -typedef struct VkCommandPoolCreateInfo { - VkStructureType sType; - const void* pNext; - VkCommandPoolCreateFlags flags; - uint32_t queueFamilyIndex; -} VkCommandPoolCreateInfo; - -typedef struct VkCommandBufferAllocateInfo { - VkStructureType sType; - const void* pNext; - VkCommandPool commandPool; - VkCommandBufferLevel level; - uint32_t commandBufferCount; -} VkCommandBufferAllocateInfo; - -typedef struct VkCommandBufferInheritanceInfo { - VkStructureType sType; - const void* pNext; - VkRenderPass renderPass; - uint32_t subpass; - VkFramebuffer framebuffer; - VkBool32 occlusionQueryEnable; - VkQueryControlFlags queryFlags; - VkQueryPipelineStatisticFlags pipelineStatistics; -} VkCommandBufferInheritanceInfo; - -typedef struct VkCommandBufferBeginInfo { - VkStructureType sType; - const void* pNext; - VkCommandBufferUsageFlags flags; - const VkCommandBufferInheritanceInfo* pInheritanceInfo; -} VkCommandBufferBeginInfo; - -typedef struct VkBufferCopy { - VkDeviceSize srcOffset; - VkDeviceSize dstOffset; - VkDeviceSize size; -} VkBufferCopy; - -typedef struct VkImageSubresourceLayers { - VkImageAspectFlags aspectMask; - uint32_t mipLevel; - uint32_t baseArrayLayer; - uint32_t layerCount; -} VkImageSubresourceLayers; - -typedef struct VkImageCopy { - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffset; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffset; - VkExtent3D extent; -} VkImageCopy; - -typedef struct VkImageBlit { - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffsets[2]; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffsets[2]; -} VkImageBlit; - -typedef struct VkBufferImageCopy { - VkDeviceSize bufferOffset; - uint32_t bufferRowLength; - uint32_t bufferImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkBufferImageCopy; - -typedef union VkClearColorValue { - float float32[4]; - int32_t int32[4]; - uint32_t uint32[4]; -} VkClearColorValue; - -typedef struct VkClearDepthStencilValue { - float depth; - uint32_t stencil; -} VkClearDepthStencilValue; - -typedef union VkClearValue { - VkClearColorValue color; - VkClearDepthStencilValue depthStencil; -} VkClearValue; - -typedef struct VkClearAttachment { - VkImageAspectFlags aspectMask; - uint32_t colorAttachment; - VkClearValue clearValue; -} VkClearAttachment; - -typedef struct VkClearRect { - VkRect2D rect; - uint32_t baseArrayLayer; - uint32_t layerCount; -} VkClearRect; - -typedef struct VkImageResolve { - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffset; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffset; - VkExtent3D extent; -} VkImageResolve; - -typedef struct VkMemoryBarrier { - VkStructureType sType; - const void* pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; -} VkMemoryBarrier; - -typedef struct VkBufferMemoryBarrier { - VkStructureType sType; - const void* pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkBuffer buffer; - VkDeviceSize offset; - VkDeviceSize size; -} VkBufferMemoryBarrier; - -typedef struct VkImageMemoryBarrier { - VkStructureType sType; - const void* pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - VkImageLayout oldLayout; - VkImageLayout newLayout; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkImage image; - VkImageSubresourceRange subresourceRange; -} VkImageMemoryBarrier; - -typedef struct VkRenderPassBeginInfo { - VkStructureType sType; - const void* pNext; - VkRenderPass renderPass; - VkFramebuffer framebuffer; - VkRect2D renderArea; - uint32_t clearValueCount; - const VkClearValue* pClearValues; -} VkRenderPassBeginInfo; - -typedef struct VkDispatchIndirectCommand { - uint32_t x; - uint32_t y; - uint32_t z; -} VkDispatchIndirectCommand; - -typedef struct VkDrawIndexedIndirectCommand { - uint32_t indexCount; - uint32_t instanceCount; - uint32_t firstIndex; - int32_t vertexOffset; - uint32_t firstInstance; -} VkDrawIndexedIndirectCommand; - -typedef struct VkDrawIndirectCommand { - uint32_t vertexCount; - uint32_t instanceCount; - uint32_t firstVertex; - uint32_t firstInstance; -} VkDrawIndirectCommand; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateInstance)(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance); -typedef void (VKAPI_PTR *PFN_vkDestroyInstance)(VkInstance instance, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDevices)(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties)(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMemoryProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties); -typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetInstanceProcAddr)(VkInstance instance, const char* pName); -typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetDeviceProcAddr)(VkDevice device, const char* pName); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDevice)(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice); -typedef void (VKAPI_PTR *PFN_vkDestroyDevice)(VkDevice device, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateInstanceExtensionProperties)(const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties); -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateDeviceExtensionProperties)(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties); -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateInstanceLayerProperties)(uint32_t* pPropertyCount, VkLayerProperties* pProperties); -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateDeviceLayerProperties)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkLayerProperties* pProperties); -typedef void (VKAPI_PTR *PFN_vkGetDeviceQueue)(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue); -typedef VkResult (VKAPI_PTR *PFN_vkQueueSubmit)(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence); -typedef VkResult (VKAPI_PTR *PFN_vkQueueWaitIdle)(VkQueue queue); -typedef VkResult (VKAPI_PTR *PFN_vkDeviceWaitIdle)(VkDevice device); -typedef VkResult (VKAPI_PTR *PFN_vkAllocateMemory)(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory); -typedef void (VKAPI_PTR *PFN_vkFreeMemory)(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkMapMemory)(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData); -typedef void (VKAPI_PTR *PFN_vkUnmapMemory)(VkDevice device, VkDeviceMemory memory); -typedef VkResult (VKAPI_PTR *PFN_vkFlushMappedMemoryRanges)(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges); -typedef VkResult (VKAPI_PTR *PFN_vkInvalidateMappedMemoryRanges)(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges); -typedef void (VKAPI_PTR *PFN_vkGetDeviceMemoryCommitment)(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes); -typedef VkResult (VKAPI_PTR *PFN_vkBindBufferMemory)(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset); -typedef VkResult (VKAPI_PTR *PFN_vkBindImageMemory)(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset); -typedef void (VKAPI_PTR *PFN_vkGetBufferMemoryRequirements)(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements); -typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements)(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements); -typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements)(VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties); -typedef VkResult (VKAPI_PTR *PFN_vkQueueBindSparse)(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence); -typedef VkResult (VKAPI_PTR *PFN_vkCreateFence)(VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence); -typedef void (VKAPI_PTR *PFN_vkDestroyFence)(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkResetFences)(VkDevice device, uint32_t fenceCount, const VkFence* pFences); -typedef VkResult (VKAPI_PTR *PFN_vkGetFenceStatus)(VkDevice device, VkFence fence); -typedef VkResult (VKAPI_PTR *PFN_vkWaitForFences)(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout); -typedef VkResult (VKAPI_PTR *PFN_vkCreateSemaphore)(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore); -typedef void (VKAPI_PTR *PFN_vkDestroySemaphore)(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreateEvent)(VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent); -typedef void (VKAPI_PTR *PFN_vkDestroyEvent)(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkGetEventStatus)(VkDevice device, VkEvent event); -typedef VkResult (VKAPI_PTR *PFN_vkSetEvent)(VkDevice device, VkEvent event); -typedef VkResult (VKAPI_PTR *PFN_vkResetEvent)(VkDevice device, VkEvent event); -typedef VkResult (VKAPI_PTR *PFN_vkCreateQueryPool)(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool); -typedef void (VKAPI_PTR *PFN_vkDestroyQueryPool)(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkGetQueryPoolResults)(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags); -typedef VkResult (VKAPI_PTR *PFN_vkCreateBuffer)(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer); -typedef void (VKAPI_PTR *PFN_vkDestroyBuffer)(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreateBufferView)(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView); -typedef void (VKAPI_PTR *PFN_vkDestroyBufferView)(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreateImage)(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage); -typedef void (VKAPI_PTR *PFN_vkDestroyImage)(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator); -typedef void (VKAPI_PTR *PFN_vkGetImageSubresourceLayout)(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout); -typedef VkResult (VKAPI_PTR *PFN_vkCreateImageView)(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView); -typedef void (VKAPI_PTR *PFN_vkDestroyImageView)(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreateShaderModule)(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule); -typedef void (VKAPI_PTR *PFN_vkDestroyShaderModule)(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreatePipelineCache)(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache); -typedef void (VKAPI_PTR *PFN_vkDestroyPipelineCache)(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkGetPipelineCacheData)(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData); -typedef VkResult (VKAPI_PTR *PFN_vkMergePipelineCaches)(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches); -typedef VkResult (VKAPI_PTR *PFN_vkCreateGraphicsPipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); -typedef VkResult (VKAPI_PTR *PFN_vkCreateComputePipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); -typedef void (VKAPI_PTR *PFN_vkDestroyPipeline)(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreatePipelineLayout)(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout); -typedef void (VKAPI_PTR *PFN_vkDestroyPipelineLayout)(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreateSampler)(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler); -typedef void (VKAPI_PTR *PFN_vkDestroySampler)(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorSetLayout)(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout); -typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorSetLayout)(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorPool)(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool); -typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkResetDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags); -typedef VkResult (VKAPI_PTR *PFN_vkAllocateDescriptorSets)(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets); -typedef VkResult (VKAPI_PTR *PFN_vkFreeDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets); -typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSets)(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies); -typedef VkResult (VKAPI_PTR *PFN_vkCreateFramebuffer)(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer); -typedef void (VKAPI_PTR *PFN_vkDestroyFramebuffer)(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreateRenderPass)(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass); -typedef void (VKAPI_PTR *PFN_vkDestroyRenderPass)(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator); -typedef void (VKAPI_PTR *PFN_vkGetRenderAreaGranularity)(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity); -typedef VkResult (VKAPI_PTR *PFN_vkCreateCommandPool)(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool); -typedef void (VKAPI_PTR *PFN_vkDestroyCommandPool)(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkResetCommandPool)(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags); -typedef VkResult (VKAPI_PTR *PFN_vkAllocateCommandBuffers)(VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers); -typedef void (VKAPI_PTR *PFN_vkFreeCommandBuffers)(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers); -typedef VkResult (VKAPI_PTR *PFN_vkBeginCommandBuffer)(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo); -typedef VkResult (VKAPI_PTR *PFN_vkEndCommandBuffer)(VkCommandBuffer commandBuffer); -typedef VkResult (VKAPI_PTR *PFN_vkResetCommandBuffer)(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags); -typedef void (VKAPI_PTR *PFN_vkCmdBindPipeline)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); -typedef void (VKAPI_PTR *PFN_vkCmdSetViewport)(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports); -typedef void (VKAPI_PTR *PFN_vkCmdSetScissor)(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors); -typedef void (VKAPI_PTR *PFN_vkCmdSetLineWidth)(VkCommandBuffer commandBuffer, float lineWidth); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBias)(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor); -typedef void (VKAPI_PTR *PFN_vkCmdSetBlendConstants)(VkCommandBuffer commandBuffer, const float blendConstants[4]); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBounds)(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilCompareMask)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilWriteMask)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilReference)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference); -typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorSets)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets); -typedef void (VKAPI_PTR *PFN_vkCmdBindIndexBuffer)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType); -typedef void (VKAPI_PTR *PFN_vkCmdBindVertexBuffers)(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets); -typedef void (VKAPI_PTR *PFN_vkCmdDraw)(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexed)(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); -typedef void (VKAPI_PTR *PFN_vkCmdDispatch)(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); -typedef void (VKAPI_PTR *PFN_vkCmdDispatchIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); -typedef void (VKAPI_PTR *PFN_vkCmdCopyBuffer)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions); -typedef void (VKAPI_PTR *PFN_vkCmdCopyImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions); -typedef void (VKAPI_PTR *PFN_vkCmdBlitImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkFilter filter); -typedef void (VKAPI_PTR *PFN_vkCmdCopyBufferToImage)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions); -typedef void (VKAPI_PTR *PFN_vkCmdCopyImageToBuffer)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions); -typedef void (VKAPI_PTR *PFN_vkCmdUpdateBuffer)(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData); -typedef void (VKAPI_PTR *PFN_vkCmdFillBuffer)(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data); -typedef void (VKAPI_PTR *PFN_vkCmdClearColorImage)(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges); -typedef void (VKAPI_PTR *PFN_vkCmdClearDepthStencilImage)(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges); -typedef void (VKAPI_PTR *PFN_vkCmdClearAttachments)(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects); -typedef void (VKAPI_PTR *PFN_vkCmdResolveImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions); -typedef void (VKAPI_PTR *PFN_vkCmdSetEvent)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); -typedef void (VKAPI_PTR *PFN_vkCmdResetEvent)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); -typedef void (VKAPI_PTR *PFN_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); -typedef void (VKAPI_PTR *PFN_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); -typedef void (VKAPI_PTR *PFN_vkCmdBeginQuery)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags); -typedef void (VKAPI_PTR *PFN_vkCmdEndQuery)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query); -typedef void (VKAPI_PTR *PFN_vkCmdResetQueryPool)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); -typedef void (VKAPI_PTR *PFN_vkCmdWriteTimestamp)(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query); -typedef void (VKAPI_PTR *PFN_vkCmdCopyQueryPoolResults)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags); -typedef void (VKAPI_PTR *PFN_vkCmdPushConstants)(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues); -typedef void (VKAPI_PTR *PFN_vkCmdBeginRenderPass)(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents); -typedef void (VKAPI_PTR *PFN_vkCmdNextSubpass)(VkCommandBuffer commandBuffer, VkSubpassContents contents); -typedef void (VKAPI_PTR *PFN_vkCmdEndRenderPass)(VkCommandBuffer commandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdExecuteCommands)(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance( - const VkInstanceCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkInstance* pInstance); - -VKAPI_ATTR void VKAPI_CALL vkDestroyInstance( - VkInstance instance, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDevices( - VkInstance instance, - uint32_t* pPhysicalDeviceCount, - VkPhysicalDevice* pPhysicalDevices); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceFeatures* pFeatures); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties( - VkPhysicalDevice physicalDevice, - VkFormat format, - VkFormatProperties* pFormatProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties( - VkPhysicalDevice physicalDevice, - VkFormat format, - VkImageType type, - VkImageTiling tiling, - VkImageUsageFlags usage, - VkImageCreateFlags flags, - VkImageFormatProperties* pImageFormatProperties); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceProperties* pProperties); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties( - VkPhysicalDevice physicalDevice, - uint32_t* pQueueFamilyPropertyCount, - VkQueueFamilyProperties* pQueueFamilyProperties); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceMemoryProperties* pMemoryProperties); - -VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr( - VkInstance instance, - const char* pName); - -VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr( - VkDevice device, - const char* pName); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice( - VkPhysicalDevice physicalDevice, - const VkDeviceCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkDevice* pDevice); - -VKAPI_ATTR void VKAPI_CALL vkDestroyDevice( - VkDevice device, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties( - const char* pLayerName, - uint32_t* pPropertyCount, - VkExtensionProperties* pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties( - VkPhysicalDevice physicalDevice, - const char* pLayerName, - uint32_t* pPropertyCount, - VkExtensionProperties* pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties( - uint32_t* pPropertyCount, - VkLayerProperties* pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceLayerProperties( - VkPhysicalDevice physicalDevice, - uint32_t* pPropertyCount, - VkLayerProperties* pProperties); - -VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue( - VkDevice device, - uint32_t queueFamilyIndex, - uint32_t queueIndex, - VkQueue* pQueue); - -VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit( - VkQueue queue, - uint32_t submitCount, - const VkSubmitInfo* pSubmits, - VkFence fence); - -VKAPI_ATTR VkResult VKAPI_CALL vkQueueWaitIdle( - VkQueue queue); - -VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle( - VkDevice device); - -VKAPI_ATTR VkResult VKAPI_CALL vkAllocateMemory( - VkDevice device, - const VkMemoryAllocateInfo* pAllocateInfo, - const VkAllocationCallbacks* pAllocator, - VkDeviceMemory* pMemory); - -VKAPI_ATTR void VKAPI_CALL vkFreeMemory( - VkDevice device, - VkDeviceMemory memory, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkMapMemory( - VkDevice device, - VkDeviceMemory memory, - VkDeviceSize offset, - VkDeviceSize size, - VkMemoryMapFlags flags, - void** ppData); - -VKAPI_ATTR void VKAPI_CALL vkUnmapMemory( - VkDevice device, - VkDeviceMemory memory); - -VKAPI_ATTR VkResult VKAPI_CALL vkFlushMappedMemoryRanges( - VkDevice device, - uint32_t memoryRangeCount, - const VkMappedMemoryRange* pMemoryRanges); - -VKAPI_ATTR VkResult VKAPI_CALL vkInvalidateMappedMemoryRanges( - VkDevice device, - uint32_t memoryRangeCount, - const VkMappedMemoryRange* pMemoryRanges); +#ifdef VK_USE_PLATFORM_IOS_MVK +#include "vulkan_ios.h" +#endif -VKAPI_ATTR void VKAPI_CALL vkGetDeviceMemoryCommitment( - VkDevice device, - VkDeviceMemory memory, - VkDeviceSize* pCommittedMemoryInBytes); -VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory( - VkDevice device, - VkBuffer buffer, - VkDeviceMemory memory, - VkDeviceSize memoryOffset); +#ifdef VK_USE_PLATFORM_MACOS_MVK +#include "vulkan_macos.h" +#endif -VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory( - VkDevice device, - VkImage image, - VkDeviceMemory memory, - VkDeviceSize memoryOffset); -VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements( - VkDevice device, - VkBuffer buffer, - VkMemoryRequirements* pMemoryRequirements); +#ifdef VK_USE_PLATFORM_MIR_KHR +#include +#include "vulkan_mir.h" +#endif -VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements( - VkDevice device, - VkImage image, - VkMemoryRequirements* pMemoryRequirements); -VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements( - VkDevice device, - VkImage image, - uint32_t* pSparseMemoryRequirementCount, - VkSparseImageMemoryRequirements* pSparseMemoryRequirements); +#ifdef VK_USE_PLATFORM_VI_NN +#include "vulkan_vi.h" +#endif -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties( - VkPhysicalDevice physicalDevice, - VkFormat format, - VkImageType type, - VkSampleCountFlagBits samples, - VkImageUsageFlags usage, - VkImageTiling tiling, - uint32_t* pPropertyCount, - VkSparseImageFormatProperties* pProperties); -VKAPI_ATTR VkResult VKAPI_CALL vkQueueBindSparse( - VkQueue queue, - uint32_t bindInfoCount, - const VkBindSparseInfo* pBindInfo, - VkFence fence); +#ifdef VK_USE_PLATFORM_WAYLAND_KHR +#include +#include "vulkan_wayland.h" +#endif -VKAPI_ATTR VkResult VKAPI_CALL vkCreateFence( - VkDevice device, - const VkFenceCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkFence* pFence); -VKAPI_ATTR void VKAPI_CALL vkDestroyFence( - VkDevice device, - VkFence fence, - const VkAllocationCallbacks* pAllocator); +#ifdef VK_USE_PLATFORM_WIN32_KHR +#include +#include "vulkan_win32.h" +#endif -VKAPI_ATTR VkResult VKAPI_CALL vkResetFences( - VkDevice device, - uint32_t fenceCount, - const VkFence* pFences); -VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceStatus( - VkDevice device, - VkFence fence); +#ifdef VK_USE_PLATFORM_XCB_KHR +#include +#include "vulkan_xcb.h" +#endif -VKAPI_ATTR VkResult VKAPI_CALL vkWaitForFences( - VkDevice device, - uint32_t fenceCount, - const VkFence* pFences, - VkBool32 waitAll, - uint64_t timeout); -VKAPI_ATTR VkResult VKAPI_CALL vkCreateSemaphore( - VkDevice device, - const VkSemaphoreCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSemaphore* pSemaphore); +#ifdef VK_USE_PLATFORM_XLIB_KHR +#include +#include "vulkan_xlib.h" +#endif -VKAPI_ATTR void VKAPI_CALL vkDestroySemaphore( - VkDevice device, - VkSemaphore semaphore, - const VkAllocationCallbacks* pAllocator); -VKAPI_ATTR VkResult VKAPI_CALL vkCreateEvent( - VkDevice device, - const VkEventCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkEvent* pEvent); +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT +#include +#include +#include "vulkan_xlib_xrandr.h" +#endif -VKAPI_ATTR void VKAPI_CALL vkDestroyEvent( - VkDevice device, - VkEvent event, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetEventStatus( - VkDevice device, - VkEvent event); - -VKAPI_ATTR VkResult VKAPI_CALL vkSetEvent( - VkDevice device, - VkEvent event); - -VKAPI_ATTR VkResult VKAPI_CALL vkResetEvent( - VkDevice device, - VkEvent event); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateQueryPool( - VkDevice device, - const VkQueryPoolCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkQueryPool* pQueryPool); - -VKAPI_ATTR void VKAPI_CALL vkDestroyQueryPool( - VkDevice device, - VkQueryPool queryPool, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetQueryPoolResults( - VkDevice device, - VkQueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - size_t dataSize, - void* pData, - VkDeviceSize stride, - VkQueryResultFlags flags); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateBuffer( - VkDevice device, - const VkBufferCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkBuffer* pBuffer); - -VKAPI_ATTR void VKAPI_CALL vkDestroyBuffer( - VkDevice device, - VkBuffer buffer, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferView( - VkDevice device, - const VkBufferViewCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkBufferView* pView); - -VKAPI_ATTR void VKAPI_CALL vkDestroyBufferView( - VkDevice device, - VkBufferView bufferView, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage( - VkDevice device, - const VkImageCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkImage* pImage); - -VKAPI_ATTR void VKAPI_CALL vkDestroyImage( - VkDevice device, - VkImage image, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout( - VkDevice device, - VkImage image, - const VkImageSubresource* pSubresource, - VkSubresourceLayout* pLayout); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView( - VkDevice device, - const VkImageViewCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkImageView* pView); - -VKAPI_ATTR void VKAPI_CALL vkDestroyImageView( - VkDevice device, - VkImageView imageView, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateShaderModule( - VkDevice device, - const VkShaderModuleCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkShaderModule* pShaderModule); - -VKAPI_ATTR void VKAPI_CALL vkDestroyShaderModule( - VkDevice device, - VkShaderModule shaderModule, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineCache( - VkDevice device, - const VkPipelineCacheCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkPipelineCache* pPipelineCache); - -VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineCache( - VkDevice device, - VkPipelineCache pipelineCache, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineCacheData( - VkDevice device, - VkPipelineCache pipelineCache, - size_t* pDataSize, - void* pData); - -VKAPI_ATTR VkResult VKAPI_CALL vkMergePipelineCaches( - VkDevice device, - VkPipelineCache dstCache, - uint32_t srcCacheCount, - const VkPipelineCache* pSrcCaches); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateGraphicsPipelines( - VkDevice device, - VkPipelineCache pipelineCache, - uint32_t createInfoCount, - const VkGraphicsPipelineCreateInfo* pCreateInfos, - const VkAllocationCallbacks* pAllocator, - VkPipeline* pPipelines); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateComputePipelines( - VkDevice device, - VkPipelineCache pipelineCache, - uint32_t createInfoCount, - const VkComputePipelineCreateInfo* pCreateInfos, - const VkAllocationCallbacks* pAllocator, - VkPipeline* pPipelines); - -VKAPI_ATTR void VKAPI_CALL vkDestroyPipeline( - VkDevice device, - VkPipeline pipeline, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineLayout( - VkDevice device, - const VkPipelineLayoutCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkPipelineLayout* pPipelineLayout); - -VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineLayout( - VkDevice device, - VkPipelineLayout pipelineLayout, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateSampler( - VkDevice device, - const VkSamplerCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSampler* pSampler); - -VKAPI_ATTR void VKAPI_CALL vkDestroySampler( - VkDevice device, - VkSampler sampler, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorSetLayout( - VkDevice device, - const VkDescriptorSetLayoutCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkDescriptorSetLayout* pSetLayout); - -VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorSetLayout( - VkDevice device, - VkDescriptorSetLayout descriptorSetLayout, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorPool( - VkDevice device, - const VkDescriptorPoolCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkDescriptorPool* pDescriptorPool); - -VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorPool( - VkDevice device, - VkDescriptorPool descriptorPool, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkResetDescriptorPool( - VkDevice device, - VkDescriptorPool descriptorPool, - VkDescriptorPoolResetFlags flags); - -VKAPI_ATTR VkResult VKAPI_CALL vkAllocateDescriptorSets( - VkDevice device, - const VkDescriptorSetAllocateInfo* pAllocateInfo, - VkDescriptorSet* pDescriptorSets); - -VKAPI_ATTR VkResult VKAPI_CALL vkFreeDescriptorSets( - VkDevice device, - VkDescriptorPool descriptorPool, - uint32_t descriptorSetCount, - const VkDescriptorSet* pDescriptorSets); - -VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSets( - VkDevice device, - uint32_t descriptorWriteCount, - const VkWriteDescriptorSet* pDescriptorWrites, - uint32_t descriptorCopyCount, - const VkCopyDescriptorSet* pDescriptorCopies); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateFramebuffer( - VkDevice device, - const VkFramebufferCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkFramebuffer* pFramebuffer); - -VKAPI_ATTR void VKAPI_CALL vkDestroyFramebuffer( - VkDevice device, - VkFramebuffer framebuffer, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass( - VkDevice device, - const VkRenderPassCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkRenderPass* pRenderPass); - -VKAPI_ATTR void VKAPI_CALL vkDestroyRenderPass( - VkDevice device, - VkRenderPass renderPass, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR void VKAPI_CALL vkGetRenderAreaGranularity( - VkDevice device, - VkRenderPass renderPass, - VkExtent2D* pGranularity); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool( - VkDevice device, - const VkCommandPoolCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkCommandPool* pCommandPool); - -VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool( - VkDevice device, - VkCommandPool commandPool, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandPool( - VkDevice device, - VkCommandPool commandPool, - VkCommandPoolResetFlags flags); - -VKAPI_ATTR VkResult VKAPI_CALL vkAllocateCommandBuffers( - VkDevice device, - const VkCommandBufferAllocateInfo* pAllocateInfo, - VkCommandBuffer* pCommandBuffers); - -VKAPI_ATTR void VKAPI_CALL vkFreeCommandBuffers( - VkDevice device, - VkCommandPool commandPool, - uint32_t commandBufferCount, - const VkCommandBuffer* pCommandBuffers); - -VKAPI_ATTR VkResult VKAPI_CALL vkBeginCommandBuffer( - VkCommandBuffer commandBuffer, - const VkCommandBufferBeginInfo* pBeginInfo); - -VKAPI_ATTR VkResult VKAPI_CALL vkEndCommandBuffer( - VkCommandBuffer commandBuffer); - -VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandBuffer( - VkCommandBuffer commandBuffer, - VkCommandBufferResetFlags flags); - -VKAPI_ATTR void VKAPI_CALL vkCmdBindPipeline( - VkCommandBuffer commandBuffer, - VkPipelineBindPoint pipelineBindPoint, - VkPipeline pipeline); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetViewport( - VkCommandBuffer commandBuffer, - uint32_t firstViewport, - uint32_t viewportCount, - const VkViewport* pViewports); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetScissor( - VkCommandBuffer commandBuffer, - uint32_t firstScissor, - uint32_t scissorCount, - const VkRect2D* pScissors); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetLineWidth( - VkCommandBuffer commandBuffer, - float lineWidth); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBias( - VkCommandBuffer commandBuffer, - float depthBiasConstantFactor, - float depthBiasClamp, - float depthBiasSlopeFactor); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetBlendConstants( - VkCommandBuffer commandBuffer, - const float blendConstants[4]); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBounds( - VkCommandBuffer commandBuffer, - float minDepthBounds, - float maxDepthBounds); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilCompareMask( - VkCommandBuffer commandBuffer, - VkStencilFaceFlags faceMask, - uint32_t compareMask); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilWriteMask( - VkCommandBuffer commandBuffer, - VkStencilFaceFlags faceMask, - uint32_t writeMask); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilReference( - VkCommandBuffer commandBuffer, - VkStencilFaceFlags faceMask, - uint32_t reference); - -VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets( - VkCommandBuffer commandBuffer, - VkPipelineBindPoint pipelineBindPoint, - VkPipelineLayout layout, - uint32_t firstSet, - uint32_t descriptorSetCount, - const VkDescriptorSet* pDescriptorSets, - uint32_t dynamicOffsetCount, - const uint32_t* pDynamicOffsets); - -VKAPI_ATTR void VKAPI_CALL vkCmdBindIndexBuffer( - VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset, - VkIndexType indexType); - -VKAPI_ATTR void VKAPI_CALL vkCmdBindVertexBuffers( - VkCommandBuffer commandBuffer, - uint32_t firstBinding, - uint32_t bindingCount, - const VkBuffer* pBuffers, - const VkDeviceSize* pOffsets); - -VKAPI_ATTR void VKAPI_CALL vkCmdDraw( - VkCommandBuffer commandBuffer, - uint32_t vertexCount, - uint32_t instanceCount, - uint32_t firstVertex, - uint32_t firstInstance); - -VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexed( - VkCommandBuffer commandBuffer, - uint32_t indexCount, - uint32_t instanceCount, - uint32_t firstIndex, - int32_t vertexOffset, - uint32_t firstInstance); - -VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirect( - VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset, - uint32_t drawCount, - uint32_t stride); - -VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirect( - VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset, - uint32_t drawCount, - uint32_t stride); - -VKAPI_ATTR void VKAPI_CALL vkCmdDispatch( - VkCommandBuffer commandBuffer, - uint32_t groupCountX, - uint32_t groupCountY, - uint32_t groupCountZ); - -VKAPI_ATTR void VKAPI_CALL vkCmdDispatchIndirect( - VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset); - -VKAPI_ATTR void VKAPI_CALL vkCmdCopyBuffer( - VkCommandBuffer commandBuffer, - VkBuffer srcBuffer, - VkBuffer dstBuffer, - uint32_t regionCount, - const VkBufferCopy* pRegions); - -VKAPI_ATTR void VKAPI_CALL vkCmdCopyImage( - VkCommandBuffer commandBuffer, - VkImage srcImage, - VkImageLayout srcImageLayout, - VkImage dstImage, - VkImageLayout dstImageLayout, - uint32_t regionCount, - const VkImageCopy* pRegions); - -VKAPI_ATTR void VKAPI_CALL vkCmdBlitImage( - VkCommandBuffer commandBuffer, - VkImage srcImage, - VkImageLayout srcImageLayout, - VkImage dstImage, - VkImageLayout dstImageLayout, - uint32_t regionCount, - const VkImageBlit* pRegions, - VkFilter filter); - -VKAPI_ATTR void VKAPI_CALL vkCmdCopyBufferToImage( - VkCommandBuffer commandBuffer, - VkBuffer srcBuffer, - VkImage dstImage, - VkImageLayout dstImageLayout, - uint32_t regionCount, - const VkBufferImageCopy* pRegions); - -VKAPI_ATTR void VKAPI_CALL vkCmdCopyImageToBuffer( - VkCommandBuffer commandBuffer, - VkImage srcImage, - VkImageLayout srcImageLayout, - VkBuffer dstBuffer, - uint32_t regionCount, - const VkBufferImageCopy* pRegions); - -VKAPI_ATTR void VKAPI_CALL vkCmdUpdateBuffer( - VkCommandBuffer commandBuffer, - VkBuffer dstBuffer, - VkDeviceSize dstOffset, - VkDeviceSize dataSize, - const void* pData); - -VKAPI_ATTR void VKAPI_CALL vkCmdFillBuffer( - VkCommandBuffer commandBuffer, - VkBuffer dstBuffer, - VkDeviceSize dstOffset, - VkDeviceSize size, - uint32_t data); - -VKAPI_ATTR void VKAPI_CALL vkCmdClearColorImage( - VkCommandBuffer commandBuffer, - VkImage image, - VkImageLayout imageLayout, - const VkClearColorValue* pColor, - uint32_t rangeCount, - const VkImageSubresourceRange* pRanges); - -VKAPI_ATTR void VKAPI_CALL vkCmdClearDepthStencilImage( - VkCommandBuffer commandBuffer, - VkImage image, - VkImageLayout imageLayout, - const VkClearDepthStencilValue* pDepthStencil, - uint32_t rangeCount, - const VkImageSubresourceRange* pRanges); - -VKAPI_ATTR void VKAPI_CALL vkCmdClearAttachments( - VkCommandBuffer commandBuffer, - uint32_t attachmentCount, - const VkClearAttachment* pAttachments, - uint32_t rectCount, - const VkClearRect* pRects); - -VKAPI_ATTR void VKAPI_CALL vkCmdResolveImage( - VkCommandBuffer commandBuffer, - VkImage srcImage, - VkImageLayout srcImageLayout, - VkImage dstImage, - VkImageLayout dstImageLayout, - uint32_t regionCount, - const VkImageResolve* pRegions); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetEvent( - VkCommandBuffer commandBuffer, - VkEvent event, - VkPipelineStageFlags stageMask); - -VKAPI_ATTR void VKAPI_CALL vkCmdResetEvent( - VkCommandBuffer commandBuffer, - VkEvent event, - VkPipelineStageFlags stageMask); - -VKAPI_ATTR void VKAPI_CALL 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); - -VKAPI_ATTR void VKAPI_CALL 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); - -VKAPI_ATTR void VKAPI_CALL vkCmdBeginQuery( - VkCommandBuffer commandBuffer, - VkQueryPool queryPool, - uint32_t query, - VkQueryControlFlags flags); - -VKAPI_ATTR void VKAPI_CALL vkCmdEndQuery( - VkCommandBuffer commandBuffer, - VkQueryPool queryPool, - uint32_t query); - -VKAPI_ATTR void VKAPI_CALL vkCmdResetQueryPool( - VkCommandBuffer commandBuffer, - VkQueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount); - -VKAPI_ATTR void VKAPI_CALL vkCmdWriteTimestamp( - VkCommandBuffer commandBuffer, - VkPipelineStageFlagBits pipelineStage, - VkQueryPool queryPool, - uint32_t query); - -VKAPI_ATTR void VKAPI_CALL vkCmdCopyQueryPoolResults( - VkCommandBuffer commandBuffer, - VkQueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - VkBuffer dstBuffer, - VkDeviceSize dstOffset, - VkDeviceSize stride, - VkQueryResultFlags flags); - -VKAPI_ATTR void VKAPI_CALL vkCmdPushConstants( - VkCommandBuffer commandBuffer, - VkPipelineLayout layout, - VkShaderStageFlags stageFlags, - uint32_t offset, - uint32_t size, - const void* pValues); - -VKAPI_ATTR void VKAPI_CALL vkCmdBeginRenderPass( - VkCommandBuffer commandBuffer, - const VkRenderPassBeginInfo* pRenderPassBegin, - VkSubpassContents contents); - -VKAPI_ATTR void VKAPI_CALL vkCmdNextSubpass( - VkCommandBuffer commandBuffer, - VkSubpassContents contents); - -VKAPI_ATTR void VKAPI_CALL vkCmdEndRenderPass( - VkCommandBuffer commandBuffer); - -VKAPI_ATTR void VKAPI_CALL vkCmdExecuteCommands( - VkCommandBuffer commandBuffer, - uint32_t commandBufferCount, - const VkCommandBuffer* pCommandBuffers); -#endif - -#define VK_KHR_surface 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) - -#define VK_KHR_SURFACE_SPEC_VERSION 25 -#define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface" -#define VK_COLORSPACE_SRGB_NONLINEAR_KHR VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - - -typedef enum VkColorSpaceKHR { - VK_COLOR_SPACE_SRGB_NONLINEAR_KHR = 0, - VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104001, - VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT = 1000104002, - VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = 1000104003, - VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104004, - VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104005, - VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104006, - VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104007, - VK_COLOR_SPACE_HDR10_ST2084_EXT = 1000104008, - VK_COLOR_SPACE_DOLBYVISION_EXT = 1000104009, - VK_COLOR_SPACE_HDR10_HLG_EXT = 1000104010, - VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011, - VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012, - VK_COLOR_SPACE_PASS_THROUGH_EXT = 1000104013, - VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT = 1000104014, - VK_COLOR_SPACE_BEGIN_RANGE_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, - VK_COLOR_SPACE_END_RANGE_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, - VK_COLOR_SPACE_RANGE_SIZE_KHR = (VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - VK_COLOR_SPACE_SRGB_NONLINEAR_KHR + 1), - VK_COLOR_SPACE_MAX_ENUM_KHR = 0x7FFFFFFF -} VkColorSpaceKHR; - -typedef enum VkPresentModeKHR { - VK_PRESENT_MODE_IMMEDIATE_KHR = 0, - VK_PRESENT_MODE_MAILBOX_KHR = 1, - VK_PRESENT_MODE_FIFO_KHR = 2, - VK_PRESENT_MODE_FIFO_RELAXED_KHR = 3, - VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR = 1000111000, - VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR = 1000111001, - VK_PRESENT_MODE_BEGIN_RANGE_KHR = VK_PRESENT_MODE_IMMEDIATE_KHR, - VK_PRESENT_MODE_END_RANGE_KHR = VK_PRESENT_MODE_FIFO_RELAXED_KHR, - VK_PRESENT_MODE_RANGE_SIZE_KHR = (VK_PRESENT_MODE_FIFO_RELAXED_KHR - VK_PRESENT_MODE_IMMEDIATE_KHR + 1), - VK_PRESENT_MODE_MAX_ENUM_KHR = 0x7FFFFFFF -} VkPresentModeKHR; - - -typedef enum VkSurfaceTransformFlagBitsKHR { - VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001, - VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002, - VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004, - VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080, - VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100, - VK_SURFACE_TRANSFORM_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkSurfaceTransformFlagBitsKHR; -typedef VkFlags VkSurfaceTransformFlagsKHR; - -typedef enum VkCompositeAlphaFlagBitsKHR { - VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, - VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002, - VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004, - VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008, - VK_COMPOSITE_ALPHA_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkCompositeAlphaFlagBitsKHR; -typedef VkFlags VkCompositeAlphaFlagsKHR; - -typedef struct VkSurfaceCapabilitiesKHR { - uint32_t minImageCount; - uint32_t maxImageCount; - VkExtent2D currentExtent; - VkExtent2D minImageExtent; - VkExtent2D maxImageExtent; - uint32_t maxImageArrayLayers; - VkSurfaceTransformFlagsKHR supportedTransforms; - VkSurfaceTransformFlagBitsKHR currentTransform; - VkCompositeAlphaFlagsKHR supportedCompositeAlpha; - VkImageUsageFlags supportedUsageFlags; -} VkSurfaceCapabilitiesKHR; - -typedef struct VkSurfaceFormatKHR { - VkFormat format; - VkColorSpaceKHR colorSpace; -} VkSurfaceFormatKHR; - - -typedef void (VKAPI_PTR *PFN_vkDestroySurfaceKHR)(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkDestroySurfaceKHR( - VkInstance instance, - VkSurfaceKHR surface, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceSupportKHR( - VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - VkSurfaceKHR surface, - VkBool32* pSupported); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilitiesKHR( - VkPhysicalDevice physicalDevice, - VkSurfaceKHR surface, - VkSurfaceCapabilitiesKHR* pSurfaceCapabilities); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormatsKHR( - VkPhysicalDevice physicalDevice, - VkSurfaceKHR surface, - uint32_t* pSurfaceFormatCount, - VkSurfaceFormatKHR* pSurfaceFormats); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModesKHR( - VkPhysicalDevice physicalDevice, - VkSurfaceKHR surface, - uint32_t* pPresentModeCount, - VkPresentModeKHR* pPresentModes); -#endif - -#define VK_KHR_swapchain 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) - -#define VK_KHR_SWAPCHAIN_SPEC_VERSION 68 -#define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain" - - -typedef enum VkSwapchainCreateFlagBitsKHR { - VK_SWAPCHAIN_CREATE_BIND_SFR_BIT_KHX = 0x00000001, - VK_SWAPCHAIN_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkSwapchainCreateFlagBitsKHR; -typedef VkFlags VkSwapchainCreateFlagsKHR; - -typedef struct VkSwapchainCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkSwapchainCreateFlagsKHR flags; - VkSurfaceKHR surface; - uint32_t minImageCount; - VkFormat imageFormat; - VkColorSpaceKHR imageColorSpace; - VkExtent2D imageExtent; - uint32_t imageArrayLayers; - VkImageUsageFlags imageUsage; - VkSharingMode imageSharingMode; - uint32_t queueFamilyIndexCount; - const uint32_t* pQueueFamilyIndices; - VkSurfaceTransformFlagBitsKHR preTransform; - VkCompositeAlphaFlagBitsKHR compositeAlpha; - VkPresentModeKHR presentMode; - VkBool32 clipped; - VkSwapchainKHR oldSwapchain; -} VkSwapchainCreateInfoKHR; - -typedef struct VkPresentInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t waitSemaphoreCount; - const VkSemaphore* pWaitSemaphores; - uint32_t swapchainCount; - const VkSwapchainKHR* pSwapchains; - const uint32_t* pImageIndices; - VkResult* pResults; -} VkPresentInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateSwapchainKHR)(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain); -typedef void (VKAPI_PTR *PFN_vkDestroySwapchainKHR)(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainImagesKHR)(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages); -typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImageKHR)(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex); -typedef VkResult (VKAPI_PTR *PFN_vkQueuePresentKHR)(VkQueue queue, const VkPresentInfoKHR* pPresentInfo); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateSwapchainKHR( - VkDevice device, - const VkSwapchainCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSwapchainKHR* pSwapchain); - -VKAPI_ATTR void VKAPI_CALL vkDestroySwapchainKHR( - VkDevice device, - VkSwapchainKHR swapchain, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainImagesKHR( - VkDevice device, - VkSwapchainKHR swapchain, - uint32_t* pSwapchainImageCount, - VkImage* pSwapchainImages); - -VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImageKHR( - VkDevice device, - VkSwapchainKHR swapchain, - uint64_t timeout, - VkSemaphore semaphore, - VkFence fence, - uint32_t* pImageIndex); - -VKAPI_ATTR VkResult VKAPI_CALL vkQueuePresentKHR( - VkQueue queue, - const VkPresentInfoKHR* pPresentInfo); -#endif - -#define VK_KHR_display 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayKHR) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayModeKHR) - -#define VK_KHR_DISPLAY_SPEC_VERSION 21 -#define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display" - - -typedef enum VkDisplayPlaneAlphaFlagBitsKHR { - VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, - VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002, - VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004, - VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008, - VK_DISPLAY_PLANE_ALPHA_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkDisplayPlaneAlphaFlagBitsKHR; -typedef VkFlags VkDisplayPlaneAlphaFlagsKHR; -typedef VkFlags VkDisplayModeCreateFlagsKHR; -typedef VkFlags VkDisplaySurfaceCreateFlagsKHR; - -typedef struct VkDisplayPropertiesKHR { - VkDisplayKHR display; - const char* displayName; - VkExtent2D physicalDimensions; - VkExtent2D physicalResolution; - VkSurfaceTransformFlagsKHR supportedTransforms; - VkBool32 planeReorderPossible; - VkBool32 persistentContent; -} VkDisplayPropertiesKHR; - -typedef struct VkDisplayModeParametersKHR { - VkExtent2D visibleRegion; - uint32_t refreshRate; -} VkDisplayModeParametersKHR; - -typedef struct VkDisplayModePropertiesKHR { - VkDisplayModeKHR displayMode; - VkDisplayModeParametersKHR parameters; -} VkDisplayModePropertiesKHR; - -typedef struct VkDisplayModeCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkDisplayModeCreateFlagsKHR flags; - VkDisplayModeParametersKHR parameters; -} VkDisplayModeCreateInfoKHR; - -typedef struct VkDisplayPlaneCapabilitiesKHR { - VkDisplayPlaneAlphaFlagsKHR supportedAlpha; - VkOffset2D minSrcPosition; - VkOffset2D maxSrcPosition; - VkExtent2D minSrcExtent; - VkExtent2D maxSrcExtent; - VkOffset2D minDstPosition; - VkOffset2D maxDstPosition; - VkExtent2D minDstExtent; - VkExtent2D maxDstExtent; -} VkDisplayPlaneCapabilitiesKHR; - -typedef struct VkDisplayPlanePropertiesKHR { - VkDisplayKHR currentDisplay; - uint32_t currentStackIndex; -} VkDisplayPlanePropertiesKHR; - -typedef struct VkDisplaySurfaceCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkDisplaySurfaceCreateFlagsKHR flags; - VkDisplayModeKHR displayMode; - uint32_t planeIndex; - uint32_t planeStackIndex; - VkSurfaceTransformFlagBitsKHR transform; - float globalAlpha; - VkDisplayPlaneAlphaFlagBitsKHR alphaMode; - VkExtent2D imageExtent; -} VkDisplaySurfaceCreateInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceDisplayPropertiesKHR)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPropertiesKHR* pProperties); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPlanePropertiesKHR* pProperties); -typedef VkResult (VKAPI_PTR *PFN_vkGetDisplayPlaneSupportedDisplaysKHR)(VkPhysicalDevice physicalDevice, uint32_t planeIndex, uint32_t* pDisplayCount, VkDisplayKHR* pDisplays); -typedef VkResult (VKAPI_PTR *PFN_vkGetDisplayModePropertiesKHR)(VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint32_t* pPropertyCount, VkDisplayModePropertiesKHR* pProperties); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDisplayModeKHR)(VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode); -typedef VkResult (VKAPI_PTR *PFN_vkGetDisplayPlaneCapabilitiesKHR)(VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDisplayPlaneSurfaceKHR)(VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceDisplayPropertiesKHR( - VkPhysicalDevice physicalDevice, - uint32_t* pPropertyCount, - VkDisplayPropertiesKHR* pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceDisplayPlanePropertiesKHR( - VkPhysicalDevice physicalDevice, - uint32_t* pPropertyCount, - VkDisplayPlanePropertiesKHR* pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayPlaneSupportedDisplaysKHR( - VkPhysicalDevice physicalDevice, - uint32_t planeIndex, - uint32_t* pDisplayCount, - VkDisplayKHR* pDisplays); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayModePropertiesKHR( - VkPhysicalDevice physicalDevice, - VkDisplayKHR display, - uint32_t* pPropertyCount, - VkDisplayModePropertiesKHR* pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateDisplayModeKHR( - VkPhysicalDevice physicalDevice, - VkDisplayKHR display, - const VkDisplayModeCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkDisplayModeKHR* pMode); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayPlaneCapabilitiesKHR( - VkPhysicalDevice physicalDevice, - VkDisplayModeKHR mode, - uint32_t planeIndex, - VkDisplayPlaneCapabilitiesKHR* pCapabilities); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateDisplayPlaneSurfaceKHR( - VkInstance instance, - const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); -#endif - -#define VK_KHR_display_swapchain 1 -#define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9 -#define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain" - -typedef struct VkDisplayPresentInfoKHR { - VkStructureType sType; - const void* pNext; - VkRect2D srcRect; - VkRect2D dstRect; - VkBool32 persistent; -} VkDisplayPresentInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateSharedSwapchainsKHR)(VkDevice device, uint32_t swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateSharedSwapchainsKHR( - VkDevice device, - uint32_t swapchainCount, - const VkSwapchainCreateInfoKHR* pCreateInfos, - const VkAllocationCallbacks* pAllocator, - VkSwapchainKHR* pSwapchains); -#endif - -#ifdef VK_USE_PLATFORM_XLIB_KHR -#define VK_KHR_xlib_surface 1 -#include - -#define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6 -#define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface" - -typedef VkFlags VkXlibSurfaceCreateFlagsKHR; - -typedef struct VkXlibSurfaceCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkXlibSurfaceCreateFlagsKHR flags; - Display* dpy; - Window window; -} VkXlibSurfaceCreateInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateXlibSurfaceKHR)(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); -typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR( - VkInstance instance, - const VkXlibSurfaceCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); - -VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR( - VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - Display* dpy, - VisualID visualID); -#endif -#endif /* VK_USE_PLATFORM_XLIB_KHR */ - -#ifdef VK_USE_PLATFORM_XCB_KHR -#define VK_KHR_xcb_surface 1 -#include - -#define VK_KHR_XCB_SURFACE_SPEC_VERSION 6 -#define VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface" - -typedef VkFlags VkXcbSurfaceCreateFlagsKHR; - -typedef struct VkXcbSurfaceCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkXcbSurfaceCreateFlagsKHR flags; - xcb_connection_t* connection; - xcb_window_t window; -} VkXcbSurfaceCreateInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateXcbSurfaceKHR)(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); -typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR( - VkInstance instance, - const VkXcbSurfaceCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); - -VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXcbPresentationSupportKHR( - VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - xcb_connection_t* connection, - xcb_visualid_t visual_id); -#endif -#endif /* VK_USE_PLATFORM_XCB_KHR */ - -#ifdef VK_USE_PLATFORM_WAYLAND_KHR -#define VK_KHR_wayland_surface 1 -#include - -#define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 6 -#define VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "VK_KHR_wayland_surface" - -typedef VkFlags VkWaylandSurfaceCreateFlagsKHR; - -typedef struct VkWaylandSurfaceCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkWaylandSurfaceCreateFlagsKHR flags; - struct wl_display* display; - struct wl_surface* surface; -} VkWaylandSurfaceCreateInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateWaylandSurfaceKHR)(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); -typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR( - VkInstance instance, - const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); - -VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWaylandPresentationSupportKHR( - VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - struct wl_display* display); -#endif -#endif /* VK_USE_PLATFORM_WAYLAND_KHR */ - -#ifdef VK_USE_PLATFORM_MIR_KHR -#define VK_KHR_mir_surface 1 -#include - -#define VK_KHR_MIR_SURFACE_SPEC_VERSION 4 -#define VK_KHR_MIR_SURFACE_EXTENSION_NAME "VK_KHR_mir_surface" - -typedef VkFlags VkMirSurfaceCreateFlagsKHR; - -typedef struct VkMirSurfaceCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkMirSurfaceCreateFlagsKHR flags; - MirConnection* connection; - MirSurface* mirSurface; -} VkMirSurfaceCreateInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateMirSurfaceKHR)(VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); -typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, MirConnection* connection); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR( - VkInstance instance, - const VkMirSurfaceCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); - -VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceMirPresentationSupportKHR( - VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - MirConnection* connection); -#endif -#endif /* VK_USE_PLATFORM_MIR_KHR */ - -#ifdef VK_USE_PLATFORM_ANDROID_KHR -#define VK_KHR_android_surface 1 -#include - -#define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6 -#define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface" - -typedef VkFlags VkAndroidSurfaceCreateFlagsKHR; - -typedef struct VkAndroidSurfaceCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkAndroidSurfaceCreateFlagsKHR flags; - ANativeWindow* window; -} VkAndroidSurfaceCreateInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR( - VkInstance instance, - const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); -#endif -#endif /* VK_USE_PLATFORM_ANDROID_KHR */ - -#ifdef VK_USE_PLATFORM_WIN32_KHR -#define VK_KHR_win32_surface 1 -#include - -#define VK_KHR_WIN32_SURFACE_SPEC_VERSION 6 -#define VK_KHR_WIN32_SURFACE_EXTENSION_NAME "VK_KHR_win32_surface" - -typedef VkFlags VkWin32SurfaceCreateFlagsKHR; - -typedef struct VkWin32SurfaceCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkWin32SurfaceCreateFlagsKHR flags; - HINSTANCE hinstance; - HWND hwnd; -} VkWin32SurfaceCreateInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateWin32SurfaceKHR)(VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); -typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateWin32SurfaceKHR( - VkInstance instance, - const VkWin32SurfaceCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); - -VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR( - VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex); -#endif -#endif /* VK_USE_PLATFORM_WIN32_KHR */ - -#define VK_KHR_sampler_mirror_clamp_to_edge 1 -#define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 1 -#define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME "VK_KHR_sampler_mirror_clamp_to_edge" - - -#define VK_KHR_get_physical_device_properties2 1 -#define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 1 -#define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2" - -typedef struct VkPhysicalDeviceFeatures2KHR { - VkStructureType sType; - void* pNext; - VkPhysicalDeviceFeatures features; -} VkPhysicalDeviceFeatures2KHR; - -typedef struct VkPhysicalDeviceProperties2KHR { - VkStructureType sType; - void* pNext; - VkPhysicalDeviceProperties properties; -} VkPhysicalDeviceProperties2KHR; - -typedef struct VkFormatProperties2KHR { - VkStructureType sType; - void* pNext; - VkFormatProperties formatProperties; -} VkFormatProperties2KHR; - -typedef struct VkImageFormatProperties2KHR { - VkStructureType sType; - void* pNext; - VkImageFormatProperties imageFormatProperties; -} VkImageFormatProperties2KHR; - -typedef struct VkPhysicalDeviceImageFormatInfo2KHR { - VkStructureType sType; - const void* pNext; - VkFormat format; - VkImageType type; - VkImageTiling tiling; - VkImageUsageFlags usage; - VkImageCreateFlags flags; -} VkPhysicalDeviceImageFormatInfo2KHR; - -typedef struct VkQueueFamilyProperties2KHR { - VkStructureType sType; - void* pNext; - VkQueueFamilyProperties queueFamilyProperties; -} VkQueueFamilyProperties2KHR; - -typedef struct VkPhysicalDeviceMemoryProperties2KHR { - VkStructureType sType; - void* pNext; - VkPhysicalDeviceMemoryProperties memoryProperties; -} VkPhysicalDeviceMemoryProperties2KHR; - -typedef struct VkSparseImageFormatProperties2KHR { - VkStructureType sType; - void* pNext; - VkSparseImageFormatProperties properties; -} VkSparseImageFormatProperties2KHR; - -typedef struct VkPhysicalDeviceSparseImageFormatInfo2KHR { - VkStructureType sType; - const void* pNext; - VkFormat format; - VkImageType type; - VkSampleCountFlagBits samples; - VkImageUsageFlags usage; - VkImageTiling tiling; -} VkPhysicalDeviceSparseImageFormatInfo2KHR; - - -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures2KHR)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2KHR* pFeatures); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceProperties2KHR)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2KHR* pProperties); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFormatProperties2KHR)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2KHR* pFormatProperties); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo, VkImageFormatProperties2KHR* pImageFormatProperties); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR)(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2KHR* pQueueFamilyProperties); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMemoryProperties2KHR)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2KHR* pProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures2KHR( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceFeatures2KHR* pFeatures); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties2KHR( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceProperties2KHR* pProperties); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2KHR( - VkPhysicalDevice physicalDevice, - VkFormat format, - VkFormatProperties2KHR* pFormatProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo, - VkImageFormatProperties2KHR* pImageFormatProperties); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2KHR( - VkPhysicalDevice physicalDevice, - uint32_t* pQueueFamilyPropertyCount, - VkQueueFamilyProperties2KHR* pQueueFamilyProperties); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2KHR( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo, - uint32_t* pPropertyCount, - VkSparseImageFormatProperties2KHR* pProperties); -#endif - -#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" - - -#define VK_KHR_maintenance1 1 -#define VK_KHR_MAINTENANCE1_SPEC_VERSION 1 -#define VK_KHR_MAINTENANCE1_EXTENSION_NAME "VK_KHR_maintenance1" - -typedef VkFlags VkCommandPoolTrimFlagsKHR; - -typedef void (VKAPI_PTR *PFN_vkTrimCommandPoolKHR)(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlagsKHR flags); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkTrimCommandPoolKHR( - VkDevice device, - VkCommandPool commandPool, - VkCommandPoolTrimFlagsKHR flags); -#endif - -#define VK_KHR_external_memory_capabilities 1 -#define VK_LUID_SIZE_KHR 8 -#define VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_memory_capabilities" - - -typedef enum VkExternalMemoryHandleTypeFlagBitsKHR { - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = 0x00000001, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = 0x00000002, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = 0x00000004, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR = 0x00000008, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR = 0x00000010, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR = 0x00000020, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR = 0x00000040, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkExternalMemoryHandleTypeFlagBitsKHR; -typedef VkFlags VkExternalMemoryHandleTypeFlagsKHR; - -typedef enum VkExternalMemoryFeatureFlagBitsKHR { - VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHR = 0x00000001, - VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHR = 0x00000002, - VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR = 0x00000004, - VK_EXTERNAL_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkExternalMemoryFeatureFlagBitsKHR; -typedef VkFlags VkExternalMemoryFeatureFlagsKHR; - -typedef struct VkExternalMemoryPropertiesKHR { - VkExternalMemoryFeatureFlagsKHR externalMemoryFeatures; - VkExternalMemoryHandleTypeFlagsKHR exportFromImportedHandleTypes; - VkExternalMemoryHandleTypeFlagsKHR compatibleHandleTypes; -} VkExternalMemoryPropertiesKHR; - -typedef struct VkPhysicalDeviceExternalImageFormatInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagBitsKHR handleType; -} VkPhysicalDeviceExternalImageFormatInfoKHR; - -typedef struct VkExternalImageFormatPropertiesKHR { - VkStructureType sType; - void* pNext; - VkExternalMemoryPropertiesKHR externalMemoryProperties; -} VkExternalImageFormatPropertiesKHR; - -typedef struct VkPhysicalDeviceExternalBufferInfoKHR { - VkStructureType sType; - const void* pNext; - VkBufferCreateFlags flags; - VkBufferUsageFlags usage; - VkExternalMemoryHandleTypeFlagBitsKHR handleType; -} VkPhysicalDeviceExternalBufferInfoKHR; - -typedef struct VkExternalBufferPropertiesKHR { - VkStructureType sType; - void* pNext; - VkExternalMemoryPropertiesKHR externalMemoryProperties; -} VkExternalBufferPropertiesKHR; - -typedef struct VkPhysicalDeviceIDPropertiesKHR { - VkStructureType sType; - void* pNext; - uint8_t deviceUUID[VK_UUID_SIZE]; - uint8_t driverUUID[VK_UUID_SIZE]; - uint8_t deviceLUID[VK_LUID_SIZE_KHR]; - uint32_t deviceNodeMask; - VkBool32 deviceLUIDValid; -} VkPhysicalDeviceIDPropertiesKHR; - - -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfoKHR* pExternalBufferInfo, VkExternalBufferPropertiesKHR* pExternalBufferProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalBufferPropertiesKHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceExternalBufferInfoKHR* pExternalBufferInfo, - VkExternalBufferPropertiesKHR* pExternalBufferProperties); -#endif - -#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" -#define VK_QUEUE_FAMILY_EXTERNAL_KHR (~0U-1) - -typedef struct VkExternalMemoryImageCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagsKHR handleTypes; -} VkExternalMemoryImageCreateInfoKHR; - -typedef struct VkExternalMemoryBufferCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagsKHR handleTypes; -} VkExternalMemoryBufferCreateInfoKHR; - -typedef struct VkExportMemoryAllocateInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagsKHR handleTypes; -} VkExportMemoryAllocateInfoKHR; - - - -#ifdef VK_USE_PLATFORM_WIN32_KHR -#define VK_KHR_external_memory_win32 1 -#define VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_KHR_external_memory_win32" - -typedef struct VkImportMemoryWin32HandleInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagBitsKHR handleType; - HANDLE handle; - LPCWSTR name; -} VkImportMemoryWin32HandleInfoKHR; - -typedef struct VkExportMemoryWin32HandleInfoKHR { - VkStructureType sType; - const void* pNext; - const SECURITY_ATTRIBUTES* pAttributes; - DWORD dwAccess; - LPCWSTR name; -} VkExportMemoryWin32HandleInfoKHR; - -typedef struct VkMemoryWin32HandlePropertiesKHR { - VkStructureType sType; - void* pNext; - uint32_t memoryTypeBits; -} VkMemoryWin32HandlePropertiesKHR; - -typedef struct VkMemoryGetWin32HandleInfoKHR { - VkStructureType sType; - const void* pNext; - VkDeviceMemory memory; - VkExternalMemoryHandleTypeFlagBitsKHR handleType; -} VkMemoryGetWin32HandleInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleKHR)(VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle); -typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandlePropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBitsKHR handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleKHR( - VkDevice device, - const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, - HANDLE* pHandle); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR( - VkDevice device, - VkExternalMemoryHandleTypeFlagBitsKHR handleType, - HANDLE handle, - VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties); -#endif -#endif /* VK_USE_PLATFORM_WIN32_KHR */ - -#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" - -typedef struct VkImportMemoryFdInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagBitsKHR handleType; - int fd; -} VkImportMemoryFdInfoKHR; - -typedef struct VkMemoryFdPropertiesKHR { - VkStructureType sType; - void* pNext; - uint32_t memoryTypeBits; -} VkMemoryFdPropertiesKHR; - -typedef struct VkMemoryGetFdInfoKHR { - VkStructureType sType; - const void* pNext; - VkDeviceMemory memory; - VkExternalMemoryHandleTypeFlagBitsKHR handleType; -} VkMemoryGetFdInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryFdKHR)(VkDevice device, const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd); -typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryFdPropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBitsKHR handleType, int fd, VkMemoryFdPropertiesKHR* pMemoryFdProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryFdKHR( - VkDevice device, - const VkMemoryGetFdInfoKHR* pGetFdInfo, - int* pFd); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryFdPropertiesKHR( - VkDevice device, - VkExternalMemoryHandleTypeFlagBitsKHR handleType, - int fd, - VkMemoryFdPropertiesKHR* pMemoryFdProperties); -#endif - -#ifdef VK_USE_PLATFORM_WIN32_KHR -#define VK_KHR_win32_keyed_mutex 1 -#define VK_KHR_WIN32_KEYED_MUTEX_SPEC_VERSION 1 -#define VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_KHR_win32_keyed_mutex" - -typedef struct VkWin32KeyedMutexAcquireReleaseInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t acquireCount; - const VkDeviceMemory* pAcquireSyncs; - const uint64_t* pAcquireKeys; - const uint32_t* pAcquireTimeouts; - uint32_t releaseCount; - const VkDeviceMemory* pReleaseSyncs; - const uint64_t* pReleaseKeys; -} VkWin32KeyedMutexAcquireReleaseInfoKHR; - - -#endif /* VK_USE_PLATFORM_WIN32_KHR */ - -#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" - - -typedef enum VkExternalSemaphoreHandleTypeFlagBitsKHR { - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = 0x00000001, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = 0x00000002, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = 0x00000004, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHR = 0x00000008, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR = 0x00000010, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkExternalSemaphoreHandleTypeFlagBitsKHR; -typedef VkFlags VkExternalSemaphoreHandleTypeFlagsKHR; - -typedef enum VkExternalSemaphoreFeatureFlagBitsKHR { - VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHR = 0x00000001, - VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHR = 0x00000002, - VK_EXTERNAL_SEMAPHORE_FEATURE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkExternalSemaphoreFeatureFlagBitsKHR; -typedef VkFlags VkExternalSemaphoreFeatureFlagsKHR; - -typedef struct VkPhysicalDeviceExternalSemaphoreInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalSemaphoreHandleTypeFlagBitsKHR handleType; -} VkPhysicalDeviceExternalSemaphoreInfoKHR; - -typedef struct VkExternalSemaphorePropertiesKHR { - VkStructureType sType; - void* pNext; - VkExternalSemaphoreHandleTypeFlagsKHR exportFromImportedHandleTypes; - VkExternalSemaphoreHandleTypeFlagsKHR compatibleHandleTypes; - VkExternalSemaphoreFeatureFlagsKHR externalSemaphoreFeatures; -} VkExternalSemaphorePropertiesKHR; - - -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfoKHR* pExternalSemaphoreInfo, VkExternalSemaphorePropertiesKHR* pExternalSemaphoreProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceExternalSemaphoreInfoKHR* pExternalSemaphoreInfo, - VkExternalSemaphorePropertiesKHR* pExternalSemaphoreProperties); -#endif - -#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" - - -typedef enum VkSemaphoreImportFlagBitsKHR { - VK_SEMAPHORE_IMPORT_TEMPORARY_BIT_KHR = 0x00000001, - VK_SEMAPHORE_IMPORT_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkSemaphoreImportFlagBitsKHR; -typedef VkFlags VkSemaphoreImportFlagsKHR; - -typedef struct VkExportSemaphoreCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalSemaphoreHandleTypeFlagsKHR handleTypes; -} VkExportSemaphoreCreateInfoKHR; - - - -#ifdef VK_USE_PLATFORM_WIN32_KHR -#define VK_KHR_external_semaphore_win32 1 -#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME "VK_KHR_external_semaphore_win32" - -typedef struct VkImportSemaphoreWin32HandleInfoKHR { - VkStructureType sType; - const void* pNext; - VkSemaphore semaphore; - VkSemaphoreImportFlagsKHR flags; - VkExternalSemaphoreHandleTypeFlagBitsKHR handleType; - HANDLE handle; - LPCWSTR name; -} VkImportSemaphoreWin32HandleInfoKHR; - -typedef struct VkExportSemaphoreWin32HandleInfoKHR { - VkStructureType sType; - const void* pNext; - const SECURITY_ATTRIBUTES* pAttributes; - DWORD dwAccess; - LPCWSTR name; -} VkExportSemaphoreWin32HandleInfoKHR; - -typedef struct VkD3D12FenceSubmitInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t waitSemaphoreValuesCount; - const uint64_t* pWaitSemaphoreValues; - uint32_t signalSemaphoreValuesCount; - const uint64_t* pSignalSemaphoreValues; -} VkD3D12FenceSubmitInfoKHR; - -typedef struct VkSemaphoreGetWin32HandleInfoKHR { - VkStructureType sType; - const void* pNext; - VkSemaphore semaphore; - VkExternalSemaphoreHandleTypeFlagBitsKHR handleType; -} VkSemaphoreGetWin32HandleInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreWin32HandleKHR)(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo); -typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreWin32HandleKHR)(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreWin32HandleKHR( - VkDevice device, - const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHR( - VkDevice device, - const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, - HANDLE* pHandle); -#endif -#endif /* VK_USE_PLATFORM_WIN32_KHR */ - -#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" - -typedef struct VkImportSemaphoreFdInfoKHR { - VkStructureType sType; - const void* pNext; - VkSemaphore semaphore; - VkSemaphoreImportFlagsKHR flags; - VkExternalSemaphoreHandleTypeFlagBitsKHR handleType; - int fd; -} VkImportSemaphoreFdInfoKHR; - -typedef struct VkSemaphoreGetFdInfoKHR { - VkStructureType sType; - const void* pNext; - VkSemaphore semaphore; - VkExternalSemaphoreHandleTypeFlagBitsKHR handleType; -} VkSemaphoreGetFdInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreFdKHR)(VkDevice device, const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo); -typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreFdKHR)(VkDevice device, const VkSemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreFdKHR( - VkDevice device, - const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreFdKHR( - VkDevice device, - const VkSemaphoreGetFdInfoKHR* pGetFdInfo, - int* pFd); -#endif - -#define VK_KHR_push_descriptor 1 -#define VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION 1 -#define VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME "VK_KHR_push_descriptor" - -typedef struct VkPhysicalDevicePushDescriptorPropertiesKHR { - VkStructureType sType; - void* pNext; - uint32_t maxPushDescriptors; -} VkPhysicalDevicePushDescriptorPropertiesKHR; - - -typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetKHR)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetKHR( - VkCommandBuffer commandBuffer, - VkPipelineBindPoint pipelineBindPoint, - VkPipelineLayout layout, - uint32_t set, - uint32_t descriptorWriteCount, - const VkWriteDescriptorSet* pDescriptorWrites); -#endif - -#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" - -typedef struct VkPhysicalDevice16BitStorageFeaturesKHR { - VkStructureType sType; - void* pNext; - VkBool32 storageBuffer16BitAccess; - VkBool32 uniformAndStorageBuffer16BitAccess; - VkBool32 storagePushConstant16; - VkBool32 storageInputOutput16; -} VkPhysicalDevice16BitStorageFeaturesKHR; - - - -#define VK_KHR_incremental_present 1 -#define VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION 1 -#define VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME "VK_KHR_incremental_present" - -typedef struct VkRectLayerKHR { - VkOffset2D offset; - VkExtent2D extent; - uint32_t layer; -} VkRectLayerKHR; - -typedef struct VkPresentRegionKHR { - uint32_t rectangleCount; - const VkRectLayerKHR* pRectangles; -} VkPresentRegionKHR; - -typedef struct VkPresentRegionsKHR { - VkStructureType sType; - const void* pNext; - uint32_t swapchainCount; - const VkPresentRegionKHR* pRegions; -} VkPresentRegionsKHR; - - - -#define VK_KHR_descriptor_update_template 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplateKHR) - -#define VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION 1 -#define VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME "VK_KHR_descriptor_update_template" - - -typedef enum VkDescriptorUpdateTemplateTypeKHR { - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR = 0, - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR = 1, - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_BEGIN_RANGE_KHR = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR, - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_END_RANGE_KHR = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_RANGE_SIZE_KHR = (VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR + 1), - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_MAX_ENUM_KHR = 0x7FFFFFFF -} VkDescriptorUpdateTemplateTypeKHR; - -typedef VkFlags VkDescriptorUpdateTemplateCreateFlagsKHR; - -typedef struct VkDescriptorUpdateTemplateEntryKHR { - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; - VkDescriptorType descriptorType; - size_t offset; - size_t stride; -} VkDescriptorUpdateTemplateEntryKHR; - -typedef struct VkDescriptorUpdateTemplateCreateInfoKHR { - VkStructureType sType; - void* pNext; - VkDescriptorUpdateTemplateCreateFlagsKHR flags; - uint32_t descriptorUpdateEntryCount; - const VkDescriptorUpdateTemplateEntryKHR* pDescriptorUpdateEntries; - VkDescriptorUpdateTemplateTypeKHR templateType; - VkDescriptorSetLayout descriptorSetLayout; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout pipelineLayout; - uint32_t set; -} VkDescriptorUpdateTemplateCreateInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorUpdateTemplateKHR)(VkDevice device, const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate); -typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorUpdateTemplateKHR)(VkDevice device, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator); -typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSetWithTemplateKHR)(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void* pData); -typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetWithTemplateKHR)(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplateKHR( - VkDevice device, - const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate); - -VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorUpdateTemplateKHR( - VkDevice device, - VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSetWithTemplateKHR( - VkDevice device, - VkDescriptorSet descriptorSet, - VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, - const void* pData); - -VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetWithTemplateKHR( - VkCommandBuffer commandBuffer, - VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, - VkPipelineLayout layout, - uint32_t set, - const void* pData); -#endif - -#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" - -typedef struct VkSharedPresentSurfaceCapabilitiesKHR { - VkStructureType sType; - void* pNext; - VkImageUsageFlags sharedPresentSupportedUsageFlags; -} VkSharedPresentSurfaceCapabilitiesKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainStatusKHR)(VkDevice device, VkSwapchainKHR swapchain); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainStatusKHR( - VkDevice device, - VkSwapchainKHR swapchain); -#endif - -#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" - - -typedef enum VkExternalFenceHandleTypeFlagBitsKHR { - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = 0x00000001, - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = 0x00000002, - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = 0x00000004, - VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR = 0x00000008, - VK_EXTERNAL_FENCE_HANDLE_TYPE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkExternalFenceHandleTypeFlagBitsKHR; -typedef VkFlags VkExternalFenceHandleTypeFlagsKHR; - -typedef enum VkExternalFenceFeatureFlagBitsKHR { - VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT_KHR = 0x00000001, - VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT_KHR = 0x00000002, - VK_EXTERNAL_FENCE_FEATURE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkExternalFenceFeatureFlagBitsKHR; -typedef VkFlags VkExternalFenceFeatureFlagsKHR; - -typedef struct VkPhysicalDeviceExternalFenceInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalFenceHandleTypeFlagBitsKHR handleType; -} VkPhysicalDeviceExternalFenceInfoKHR; - -typedef struct VkExternalFencePropertiesKHR { - VkStructureType sType; - void* pNext; - VkExternalFenceHandleTypeFlagsKHR exportFromImportedHandleTypes; - VkExternalFenceHandleTypeFlagsKHR compatibleHandleTypes; - VkExternalFenceFeatureFlagsKHR externalFenceFeatures; -} VkExternalFencePropertiesKHR; - - -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfoKHR* pExternalFenceInfo, VkExternalFencePropertiesKHR* pExternalFenceProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalFencePropertiesKHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceExternalFenceInfoKHR* pExternalFenceInfo, - VkExternalFencePropertiesKHR* pExternalFenceProperties); -#endif - -#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" - - -typedef enum VkFenceImportFlagBitsKHR { - VK_FENCE_IMPORT_TEMPORARY_BIT_KHR = 0x00000001, - VK_FENCE_IMPORT_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkFenceImportFlagBitsKHR; -typedef VkFlags VkFenceImportFlagsKHR; - -typedef struct VkExportFenceCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalFenceHandleTypeFlagsKHR handleTypes; -} VkExportFenceCreateInfoKHR; - - - -#ifdef VK_USE_PLATFORM_WIN32_KHR -#define VK_KHR_external_fence_win32 1 -#define VK_KHR_EXTERNAL_FENCE_WIN32_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME "VK_KHR_external_fence_win32" - -typedef struct VkImportFenceWin32HandleInfoKHR { - VkStructureType sType; - const void* pNext; - VkFence fence; - VkFenceImportFlagsKHR flags; - VkExternalFenceHandleTypeFlagBitsKHR handleType; - HANDLE handle; - LPCWSTR name; -} VkImportFenceWin32HandleInfoKHR; - -typedef struct VkExportFenceWin32HandleInfoKHR { - VkStructureType sType; - const void* pNext; - const SECURITY_ATTRIBUTES* pAttributes; - DWORD dwAccess; - LPCWSTR name; -} VkExportFenceWin32HandleInfoKHR; - -typedef struct VkFenceGetWin32HandleInfoKHR { - VkStructureType sType; - const void* pNext; - VkFence fence; - VkExternalFenceHandleTypeFlagBitsKHR handleType; -} VkFenceGetWin32HandleInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkImportFenceWin32HandleKHR)(VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo); -typedef VkResult (VKAPI_PTR *PFN_vkGetFenceWin32HandleKHR)(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkImportFenceWin32HandleKHR( - VkDevice device, - const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceWin32HandleKHR( - VkDevice device, - const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, - HANDLE* pHandle); -#endif -#endif /* VK_USE_PLATFORM_WIN32_KHR */ - -#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" - -typedef struct VkImportFenceFdInfoKHR { - VkStructureType sType; - const void* pNext; - VkFence fence; - VkFenceImportFlagsKHR flags; - VkExternalFenceHandleTypeFlagBitsKHR handleType; - int fd; -} VkImportFenceFdInfoKHR; - -typedef struct VkFenceGetFdInfoKHR { - VkStructureType sType; - const void* pNext; - VkFence fence; - VkExternalFenceHandleTypeFlagBitsKHR handleType; -} VkFenceGetFdInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkImportFenceFdKHR)(VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo); -typedef VkResult (VKAPI_PTR *PFN_vkGetFenceFdKHR)(VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkImportFenceFdKHR( - VkDevice device, - const VkImportFenceFdInfoKHR* pImportFenceFdInfo); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceFdKHR( - VkDevice device, - const VkFenceGetFdInfoKHR* pGetFdInfo, - int* pFd); -#endif - -#define VK_KHR_maintenance2 1 -#define VK_KHR_MAINTENANCE2_SPEC_VERSION 1 -#define VK_KHR_MAINTENANCE2_EXTENSION_NAME "VK_KHR_maintenance2" - - -typedef enum VkPointClippingBehaviorKHR { - VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES_KHR = 0, - VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY_KHR = 1, - VK_POINT_CLIPPING_BEHAVIOR_BEGIN_RANGE_KHR = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES_KHR, - VK_POINT_CLIPPING_BEHAVIOR_END_RANGE_KHR = VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY_KHR, - VK_POINT_CLIPPING_BEHAVIOR_RANGE_SIZE_KHR = (VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY_KHR - VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES_KHR + 1), - VK_POINT_CLIPPING_BEHAVIOR_MAX_ENUM_KHR = 0x7FFFFFFF -} VkPointClippingBehaviorKHR; - -typedef enum VkTessellationDomainOriginKHR { - VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT_KHR = 0, - VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT_KHR = 1, - VK_TESSELLATION_DOMAIN_ORIGIN_BEGIN_RANGE_KHR = VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT_KHR, - VK_TESSELLATION_DOMAIN_ORIGIN_END_RANGE_KHR = VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT_KHR, - VK_TESSELLATION_DOMAIN_ORIGIN_RANGE_SIZE_KHR = (VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT_KHR - VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT_KHR + 1), - VK_TESSELLATION_DOMAIN_ORIGIN_MAX_ENUM_KHR = 0x7FFFFFFF -} VkTessellationDomainOriginKHR; - -typedef struct VkPhysicalDevicePointClippingPropertiesKHR { - VkStructureType sType; - void* pNext; - VkPointClippingBehaviorKHR pointClippingBehavior; -} VkPhysicalDevicePointClippingPropertiesKHR; - -typedef struct VkInputAttachmentAspectReferenceKHR { - uint32_t subpass; - uint32_t inputAttachmentIndex; - VkImageAspectFlags aspectMask; -} VkInputAttachmentAspectReferenceKHR; - -typedef struct VkRenderPassInputAttachmentAspectCreateInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t aspectReferenceCount; - const VkInputAttachmentAspectReferenceKHR* pAspectReferences; -} VkRenderPassInputAttachmentAspectCreateInfoKHR; - -typedef struct VkImageViewUsageCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkImageUsageFlags usage; -} VkImageViewUsageCreateInfoKHR; - -typedef struct VkPipelineTessellationDomainOriginStateCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkTessellationDomainOriginKHR domainOrigin; -} VkPipelineTessellationDomainOriginStateCreateInfoKHR; - - - -#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" - -typedef struct VkPhysicalDeviceSurfaceInfo2KHR { - VkStructureType sType; - const void* pNext; - VkSurfaceKHR surface; -} VkPhysicalDeviceSurfaceInfo2KHR; - -typedef struct VkSurfaceCapabilities2KHR { - VkStructureType sType; - void* pNext; - VkSurfaceCapabilitiesKHR surfaceCapabilities; -} VkSurfaceCapabilities2KHR; - -typedef struct VkSurfaceFormat2KHR { - VkStructureType sType; - void* pNext; - VkSurfaceFormatKHR surfaceFormat; -} VkSurfaceFormat2KHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilities2KHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, - VkSurfaceCapabilities2KHR* pSurfaceCapabilities); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormats2KHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, - uint32_t* pSurfaceFormatCount, - VkSurfaceFormat2KHR* pSurfaceFormats); -#endif - -#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" - -typedef struct VkPhysicalDeviceVariablePointerFeaturesKHR { - VkStructureType sType; - void* pNext; - VkBool32 variablePointersStorageBuffer; - VkBool32 variablePointers; -} VkPhysicalDeviceVariablePointerFeaturesKHR; - - - -#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" - -typedef struct VkMemoryDedicatedRequirementsKHR { - VkStructureType sType; - void* pNext; - VkBool32 prefersDedicatedAllocation; - VkBool32 requiresDedicatedAllocation; -} VkMemoryDedicatedRequirementsKHR; - -typedef struct VkMemoryDedicatedAllocateInfoKHR { - VkStructureType sType; - const void* pNext; - VkImage image; - VkBuffer buffer; -} VkMemoryDedicatedAllocateInfoKHR; - - - -#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" - - -#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" - - -#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" - -typedef struct VkBufferMemoryRequirementsInfo2KHR { - VkStructureType sType; - const void* pNext; - VkBuffer buffer; -} VkBufferMemoryRequirementsInfo2KHR; - -typedef struct VkImageMemoryRequirementsInfo2KHR { - VkStructureType sType; - const void* pNext; - VkImage image; -} VkImageMemoryRequirementsInfo2KHR; - -typedef struct VkImageSparseMemoryRequirementsInfo2KHR { - VkStructureType sType; - const void* pNext; - VkImage image; -} VkImageSparseMemoryRequirementsInfo2KHR; - -typedef struct VkMemoryRequirements2KHR { - VkStructureType sType; - void* pNext; - VkMemoryRequirements memoryRequirements; -} VkMemoryRequirements2KHR; - -typedef struct VkSparseImageMemoryRequirements2KHR { - VkStructureType sType; - void* pNext; - VkSparseImageMemoryRequirements memoryRequirements; -} VkSparseImageMemoryRequirements2KHR; - - -typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements2KHR)(VkDevice device, const VkImageMemoryRequirementsInfo2KHR* pInfo, VkMemoryRequirements2KHR* pMemoryRequirements); -typedef void (VKAPI_PTR *PFN_vkGetBufferMemoryRequirements2KHR)(VkDevice device, const VkBufferMemoryRequirementsInfo2KHR* pInfo, VkMemoryRequirements2KHR* pMemoryRequirements); -typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements2KHR)(VkDevice device, const VkImageSparseMemoryRequirementsInfo2KHR* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2KHR* pSparseMemoryRequirements); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements2KHR( - VkDevice device, - const VkImageMemoryRequirementsInfo2KHR* pInfo, - VkMemoryRequirements2KHR* pMemoryRequirements); - -VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements2KHR( - VkDevice device, - const VkBufferMemoryRequirementsInfo2KHR* pInfo, - VkMemoryRequirements2KHR* pMemoryRequirements); - -VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements2KHR( - VkDevice device, - const VkImageSparseMemoryRequirementsInfo2KHR* pInfo, - uint32_t* pSparseMemoryRequirementCount, - VkSparseImageMemoryRequirements2KHR* pSparseMemoryRequirements); -#endif - -#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" - -typedef struct VkImageFormatListCreateInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t viewFormatCount; - const VkFormat* pViewFormats; -} VkImageFormatListCreateInfoKHR; - - - -#define VK_KHR_sampler_ycbcr_conversion 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSamplerYcbcrConversionKHR) - -#define VK_KHR_SAMPLER_YCBCR_CONVERSION_SPEC_VERSION 1 -#define VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME "VK_KHR_sampler_ycbcr_conversion" - - -typedef enum VkSamplerYcbcrModelConversionKHR { - VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR = 0, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY_KHR = 1, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR = 2, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR = 3, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR = 4, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_BEGIN_RANGE_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_END_RANGE_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_RANGE_SIZE_KHR = (VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR - VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR + 1), - VK_SAMPLER_YCBCR_MODEL_CONVERSION_MAX_ENUM_KHR = 0x7FFFFFFF -} VkSamplerYcbcrModelConversionKHR; - -typedef enum VkSamplerYcbcrRangeKHR { - VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR = 0, - VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR = 1, - VK_SAMPLER_YCBCR_RANGE_BEGIN_RANGE_KHR = VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR, - VK_SAMPLER_YCBCR_RANGE_END_RANGE_KHR = VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR, - VK_SAMPLER_YCBCR_RANGE_RANGE_SIZE_KHR = (VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR - VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR + 1), - VK_SAMPLER_YCBCR_RANGE_MAX_ENUM_KHR = 0x7FFFFFFF -} VkSamplerYcbcrRangeKHR; - -typedef enum VkChromaLocationKHR { - VK_CHROMA_LOCATION_COSITED_EVEN_KHR = 0, - VK_CHROMA_LOCATION_MIDPOINT_KHR = 1, - VK_CHROMA_LOCATION_BEGIN_RANGE_KHR = VK_CHROMA_LOCATION_COSITED_EVEN_KHR, - VK_CHROMA_LOCATION_END_RANGE_KHR = VK_CHROMA_LOCATION_MIDPOINT_KHR, - VK_CHROMA_LOCATION_RANGE_SIZE_KHR = (VK_CHROMA_LOCATION_MIDPOINT_KHR - VK_CHROMA_LOCATION_COSITED_EVEN_KHR + 1), - VK_CHROMA_LOCATION_MAX_ENUM_KHR = 0x7FFFFFFF -} VkChromaLocationKHR; - -typedef struct VkSamplerYcbcrConversionCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkFormat format; - VkSamplerYcbcrModelConversionKHR ycbcrModel; - VkSamplerYcbcrRangeKHR ycbcrRange; - VkComponentMapping components; - VkChromaLocationKHR xChromaOffset; - VkChromaLocationKHR yChromaOffset; - VkFilter chromaFilter; - VkBool32 forceExplicitReconstruction; -} VkSamplerYcbcrConversionCreateInfoKHR; - -typedef struct VkSamplerYcbcrConversionInfoKHR { - VkStructureType sType; - const void* pNext; - VkSamplerYcbcrConversionKHR conversion; -} VkSamplerYcbcrConversionInfoKHR; - -typedef struct VkBindImagePlaneMemoryInfoKHR { - VkStructureType sType; - const void* pNext; - VkImageAspectFlagBits planeAspect; -} VkBindImagePlaneMemoryInfoKHR; - -typedef struct VkImagePlaneMemoryRequirementsInfoKHR { - VkStructureType sType; - const void* pNext; - VkImageAspectFlagBits planeAspect; -} VkImagePlaneMemoryRequirementsInfoKHR; - -typedef struct VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR { - VkStructureType sType; - void* pNext; - VkBool32 samplerYcbcrConversion; -} VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR; - -typedef struct VkSamplerYcbcrConversionImageFormatPropertiesKHR { - VkStructureType sType; - void* pNext; - uint32_t combinedImageSamplerDescriptorCount; -} VkSamplerYcbcrConversionImageFormatPropertiesKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateSamplerYcbcrConversionKHR)(VkDevice device, const VkSamplerYcbcrConversionCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversionKHR* pYcbcrConversion); -typedef void (VKAPI_PTR *PFN_vkDestroySamplerYcbcrConversionKHR)(VkDevice device, VkSamplerYcbcrConversionKHR ycbcrConversion, const VkAllocationCallbacks* pAllocator); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateSamplerYcbcrConversionKHR( - VkDevice device, - const VkSamplerYcbcrConversionCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSamplerYcbcrConversionKHR* pYcbcrConversion); - -VKAPI_ATTR void VKAPI_CALL vkDestroySamplerYcbcrConversionKHR( - VkDevice device, - VkSamplerYcbcrConversionKHR ycbcrConversion, - const VkAllocationCallbacks* pAllocator); -#endif - -#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" - -typedef struct VkBindBufferMemoryInfoKHR { - VkStructureType sType; - const void* pNext; - VkBuffer buffer; - VkDeviceMemory memory; - VkDeviceSize memoryOffset; -} VkBindBufferMemoryInfoKHR; - -typedef struct VkBindImageMemoryInfoKHR { - VkStructureType sType; - const void* pNext; - VkImage image; - VkDeviceMemory memory; - VkDeviceSize memoryOffset; -} VkBindImageMemoryInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkBindBufferMemory2KHR)(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfoKHR* pBindInfos); -typedef VkResult (VKAPI_PTR *PFN_vkBindImageMemory2KHR)(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfoKHR* pBindInfos); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory2KHR( - VkDevice device, - uint32_t bindInfoCount, - const VkBindBufferMemoryInfoKHR* pBindInfos); - -VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory2KHR( - VkDevice device, - uint32_t bindInfoCount, - const VkBindImageMemoryInfoKHR* pBindInfos); -#endif - -#define VK_EXT_debug_report 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) - -#define VK_EXT_DEBUG_REPORT_SPEC_VERSION 9 -#define VK_EXT_DEBUG_REPORT_EXTENSION_NAME "VK_EXT_debug_report" -#define VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT -#define VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT - - -typedef enum VkDebugReportObjectTypeEXT { - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0, - VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2, - VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3, - VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4, - VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6, - VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7, - VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8, - VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10, - VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11, - VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12, - VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14, - VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17, - VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20, - VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23, - VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25, - VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26, - VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27, - VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT = 28, - VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29, - VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30, - VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31, - VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32, - VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT = 33, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT = 1000085000, - VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR_EXT = 1000156000, - VK_DEBUG_REPORT_OBJECT_TYPE_BEGIN_RANGE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_END_RANGE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_RANGE_SIZE_EXT = (VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT + 1), - VK_DEBUG_REPORT_OBJECT_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF -} VkDebugReportObjectTypeEXT; - - -typedef enum VkDebugReportFlagBitsEXT { - VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001, - VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002, - VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004, - VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008, - VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010, - VK_DEBUG_REPORT_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkDebugReportFlagBitsEXT; -typedef VkFlags VkDebugReportFlagsEXT; - -typedef VkBool32 (VKAPI_PTR *PFN_vkDebugReportCallbackEXT)( - VkDebugReportFlagsEXT flags, - VkDebugReportObjectTypeEXT objectType, - uint64_t object, - size_t location, - int32_t messageCode, - const char* pLayerPrefix, - const char* pMessage, - void* pUserData); - -typedef struct VkDebugReportCallbackCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkDebugReportFlagsEXT flags; - PFN_vkDebugReportCallbackEXT pfnCallback; - void* pUserData; -} VkDebugReportCallbackCreateInfoEXT; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateDebugReportCallbackEXT)(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback); -typedef void (VKAPI_PTR *PFN_vkDestroyDebugReportCallbackEXT)(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator); -typedef void (VKAPI_PTR *PFN_vkDebugReportMessageEXT)(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateDebugReportCallbackEXT( - VkInstance instance, - const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkDebugReportCallbackEXT* pCallback); - -VKAPI_ATTR void VKAPI_CALL vkDestroyDebugReportCallbackEXT( - VkInstance instance, - VkDebugReportCallbackEXT callback, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR void VKAPI_CALL vkDebugReportMessageEXT( - VkInstance instance, - VkDebugReportFlagsEXT flags, - VkDebugReportObjectTypeEXT objectType, - uint64_t object, - size_t location, - int32_t messageCode, - const char* pLayerPrefix, - const char* pMessage); -#endif - -#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" - - -#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" - - -#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" - - -#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" - - -typedef enum VkRasterizationOrderAMD { - VK_RASTERIZATION_ORDER_STRICT_AMD = 0, - VK_RASTERIZATION_ORDER_RELAXED_AMD = 1, - VK_RASTERIZATION_ORDER_BEGIN_RANGE_AMD = VK_RASTERIZATION_ORDER_STRICT_AMD, - VK_RASTERIZATION_ORDER_END_RANGE_AMD = VK_RASTERIZATION_ORDER_RELAXED_AMD, - VK_RASTERIZATION_ORDER_RANGE_SIZE_AMD = (VK_RASTERIZATION_ORDER_RELAXED_AMD - VK_RASTERIZATION_ORDER_STRICT_AMD + 1), - VK_RASTERIZATION_ORDER_MAX_ENUM_AMD = 0x7FFFFFFF -} VkRasterizationOrderAMD; - -typedef struct VkPipelineRasterizationStateRasterizationOrderAMD { - VkStructureType sType; - const void* pNext; - VkRasterizationOrderAMD rasterizationOrder; -} VkPipelineRasterizationStateRasterizationOrderAMD; - - - -#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" - - -#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" - - -#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" - -typedef struct VkDebugMarkerObjectNameInfoEXT { - VkStructureType sType; - const void* pNext; - VkDebugReportObjectTypeEXT objectType; - uint64_t object; - const char* pObjectName; -} VkDebugMarkerObjectNameInfoEXT; - -typedef struct VkDebugMarkerObjectTagInfoEXT { - VkStructureType sType; - const void* pNext; - VkDebugReportObjectTypeEXT objectType; - uint64_t object; - uint64_t tagName; - size_t tagSize; - const void* pTag; -} VkDebugMarkerObjectTagInfoEXT; - -typedef struct VkDebugMarkerMarkerInfoEXT { - VkStructureType sType; - const void* pNext; - const char* pMarkerName; - float color[4]; -} VkDebugMarkerMarkerInfoEXT; - - -typedef VkResult (VKAPI_PTR *PFN_vkDebugMarkerSetObjectTagEXT)(VkDevice device, const VkDebugMarkerObjectTagInfoEXT* pTagInfo); -typedef VkResult (VKAPI_PTR *PFN_vkDebugMarkerSetObjectNameEXT)(VkDevice device, const VkDebugMarkerObjectNameInfoEXT* pNameInfo); -typedef void (VKAPI_PTR *PFN_vkCmdDebugMarkerBeginEXT)(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); -typedef void (VKAPI_PTR *PFN_vkCmdDebugMarkerEndEXT)(VkCommandBuffer commandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdDebugMarkerInsertEXT)(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkDebugMarkerSetObjectTagEXT( - VkDevice device, - const VkDebugMarkerObjectTagInfoEXT* pTagInfo); - -VKAPI_ATTR VkResult VKAPI_CALL vkDebugMarkerSetObjectNameEXT( - VkDevice device, - const VkDebugMarkerObjectNameInfoEXT* pNameInfo); - -VKAPI_ATTR void VKAPI_CALL vkCmdDebugMarkerBeginEXT( - VkCommandBuffer commandBuffer, - const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); - -VKAPI_ATTR void VKAPI_CALL vkCmdDebugMarkerEndEXT( - VkCommandBuffer commandBuffer); - -VKAPI_ATTR void VKAPI_CALL vkCmdDebugMarkerInsertEXT( - VkCommandBuffer commandBuffer, - const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); -#endif - -#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" - - -#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" - -typedef struct VkDedicatedAllocationImageCreateInfoNV { - VkStructureType sType; - const void* pNext; - VkBool32 dedicatedAllocation; -} VkDedicatedAllocationImageCreateInfoNV; - -typedef struct VkDedicatedAllocationBufferCreateInfoNV { - VkStructureType sType; - const void* pNext; - VkBool32 dedicatedAllocation; -} VkDedicatedAllocationBufferCreateInfoNV; - -typedef struct VkDedicatedAllocationMemoryAllocateInfoNV { - VkStructureType sType; - const void* pNext; - VkImage image; - VkBuffer buffer; -} VkDedicatedAllocationMemoryAllocateInfoNV; - - - -#define VK_AMD_draw_indirect_count 1 -#define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1 -#define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count" - -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirectCountAMD)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirectCountAMD)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirectCountAMD( - VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset, - VkBuffer countBuffer, - VkDeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride); - -VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirectCountAMD( - VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset, - VkBuffer countBuffer, - VkDeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride); -#endif - -#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" - - -#define VK_AMD_gpu_shader_half_float 1 -#define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 1 -#define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float" - - -#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" - - -#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" - -typedef struct VkTextureLODGatherFormatPropertiesAMD { - VkStructureType sType; - void* pNext; - VkBool32 supportsTextureGatherLODBiasAMD; -} VkTextureLODGatherFormatPropertiesAMD; - - - -#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" - - -typedef enum VkShaderInfoTypeAMD { - VK_SHADER_INFO_TYPE_STATISTICS_AMD = 0, - VK_SHADER_INFO_TYPE_BINARY_AMD = 1, - VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD = 2, - VK_SHADER_INFO_TYPE_BEGIN_RANGE_AMD = VK_SHADER_INFO_TYPE_STATISTICS_AMD, - VK_SHADER_INFO_TYPE_END_RANGE_AMD = VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD, - VK_SHADER_INFO_TYPE_RANGE_SIZE_AMD = (VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD - VK_SHADER_INFO_TYPE_STATISTICS_AMD + 1), - VK_SHADER_INFO_TYPE_MAX_ENUM_AMD = 0x7FFFFFFF -} VkShaderInfoTypeAMD; - -typedef struct VkShaderResourceUsageAMD { - uint32_t numUsedVgprs; - uint32_t numUsedSgprs; - uint32_t ldsSizePerLocalWorkGroup; - size_t ldsUsageSizeInBytes; - size_t scratchMemUsageInBytes; -} VkShaderResourceUsageAMD; - -typedef struct VkShaderStatisticsInfoAMD { - VkShaderStageFlags shaderStageMask; - VkShaderResourceUsageAMD resourceUsage; - uint32_t numPhysicalVgprs; - uint32_t numPhysicalSgprs; - uint32_t numAvailableVgprs; - uint32_t numAvailableSgprs; - uint32_t computeWorkGroupSize[3]; -} VkShaderStatisticsInfoAMD; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetShaderInfoAMD)(VkDevice device, VkPipeline pipeline, VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetShaderInfoAMD( - VkDevice device, - VkPipeline pipeline, - VkShaderStageFlagBits shaderStage, - VkShaderInfoTypeAMD infoType, - size_t* pInfoSize, - void* pInfo); -#endif - -#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" - - -#define VK_KHX_multiview 1 -#define VK_KHX_MULTIVIEW_SPEC_VERSION 1 -#define VK_KHX_MULTIVIEW_EXTENSION_NAME "VK_KHX_multiview" - -typedef struct VkRenderPassMultiviewCreateInfoKHX { - VkStructureType sType; - const void* pNext; - uint32_t subpassCount; - const uint32_t* pViewMasks; - uint32_t dependencyCount; - const int32_t* pViewOffsets; - uint32_t correlationMaskCount; - const uint32_t* pCorrelationMasks; -} VkRenderPassMultiviewCreateInfoKHX; - -typedef struct VkPhysicalDeviceMultiviewFeaturesKHX { - VkStructureType sType; - void* pNext; - VkBool32 multiview; - VkBool32 multiviewGeometryShader; - VkBool32 multiviewTessellationShader; -} VkPhysicalDeviceMultiviewFeaturesKHX; - -typedef struct VkPhysicalDeviceMultiviewPropertiesKHX { - VkStructureType sType; - void* pNext; - uint32_t maxMultiviewViewCount; - uint32_t maxMultiviewInstanceIndex; -} VkPhysicalDeviceMultiviewPropertiesKHX; - - - -#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" - - -#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" - - -typedef enum VkExternalMemoryHandleTypeFlagBitsNV { - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF -} VkExternalMemoryHandleTypeFlagBitsNV; -typedef VkFlags VkExternalMemoryHandleTypeFlagsNV; - -typedef enum VkExternalMemoryFeatureFlagBitsNV { - VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001, - VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002, - VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004, - VK_EXTERNAL_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF -} VkExternalMemoryFeatureFlagBitsNV; -typedef VkFlags VkExternalMemoryFeatureFlagsNV; - -typedef struct VkExternalImageFormatPropertiesNV { - VkImageFormatProperties imageFormatProperties; - VkExternalMemoryFeatureFlagsNV externalMemoryFeatures; - VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes; - VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes; -} VkExternalImageFormatPropertiesNV; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceExternalImageFormatPropertiesNV( - VkPhysicalDevice physicalDevice, - VkFormat format, - VkImageType type, - VkImageTiling tiling, - VkImageUsageFlags usage, - VkImageCreateFlags flags, - VkExternalMemoryHandleTypeFlagsNV externalHandleType, - VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties); -#endif - -#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" - -typedef struct VkExternalMemoryImageCreateInfoNV { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagsNV handleTypes; -} VkExternalMemoryImageCreateInfoNV; - -typedef struct VkExportMemoryAllocateInfoNV { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagsNV handleTypes; -} VkExportMemoryAllocateInfoNV; - - - -#ifdef VK_USE_PLATFORM_WIN32_KHR -#define VK_NV_external_memory_win32 1 -#define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1 -#define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32" - -typedef struct VkImportMemoryWin32HandleInfoNV { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagsNV handleType; - HANDLE handle; -} VkImportMemoryWin32HandleInfoNV; - -typedef struct VkExportMemoryWin32HandleInfoNV { - VkStructureType sType; - const void* pNext; - const SECURITY_ATTRIBUTES* pAttributes; - DWORD dwAccess; -} VkExportMemoryWin32HandleInfoNV; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleNV)(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV( - VkDevice device, - VkDeviceMemory memory, - VkExternalMemoryHandleTypeFlagsNV handleType, - HANDLE* pHandle); -#endif -#endif /* VK_USE_PLATFORM_WIN32_KHR */ - -#ifdef VK_USE_PLATFORM_WIN32_KHR -#define VK_NV_win32_keyed_mutex 1 -#define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1 -#define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex" - -typedef struct VkWin32KeyedMutexAcquireReleaseInfoNV { - VkStructureType sType; - const void* pNext; - uint32_t acquireCount; - const VkDeviceMemory* pAcquireSyncs; - const uint64_t* pAcquireKeys; - const uint32_t* pAcquireTimeoutMilliseconds; - uint32_t releaseCount; - const VkDeviceMemory* pReleaseSyncs; - const uint64_t* pReleaseKeys; -} VkWin32KeyedMutexAcquireReleaseInfoNV; - - -#endif /* VK_USE_PLATFORM_WIN32_KHR */ - -#define VK_KHX_device_group 1 -#define VK_KHX_DEVICE_GROUP_SPEC_VERSION 2 -#define VK_KHX_DEVICE_GROUP_EXTENSION_NAME "VK_KHX_device_group" -#define VK_MAX_DEVICE_GROUP_SIZE_KHX 32 - - -typedef enum VkPeerMemoryFeatureFlagBitsKHX { - VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT_KHX = 0x00000001, - VK_PEER_MEMORY_FEATURE_COPY_DST_BIT_KHX = 0x00000002, - VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT_KHX = 0x00000004, - VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT_KHX = 0x00000008, - VK_PEER_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF -} VkPeerMemoryFeatureFlagBitsKHX; -typedef VkFlags VkPeerMemoryFeatureFlagsKHX; - -typedef enum VkMemoryAllocateFlagBitsKHX { - VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT_KHX = 0x00000001, - VK_MEMORY_ALLOCATE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF -} VkMemoryAllocateFlagBitsKHX; -typedef VkFlags VkMemoryAllocateFlagsKHX; - -typedef enum VkDeviceGroupPresentModeFlagBitsKHX { - VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHX = 0x00000001, - VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHX = 0x00000002, - VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHX = 0x00000004, - VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHX = 0x00000008, - VK_DEVICE_GROUP_PRESENT_MODE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF -} VkDeviceGroupPresentModeFlagBitsKHX; -typedef VkFlags VkDeviceGroupPresentModeFlagsKHX; - -typedef struct VkMemoryAllocateFlagsInfoKHX { - VkStructureType sType; - const void* pNext; - VkMemoryAllocateFlagsKHX flags; - uint32_t deviceMask; -} VkMemoryAllocateFlagsInfoKHX; - -typedef struct VkDeviceGroupRenderPassBeginInfoKHX { - VkStructureType sType; - const void* pNext; - uint32_t deviceMask; - uint32_t deviceRenderAreaCount; - const VkRect2D* pDeviceRenderAreas; -} VkDeviceGroupRenderPassBeginInfoKHX; - -typedef struct VkDeviceGroupCommandBufferBeginInfoKHX { - VkStructureType sType; - const void* pNext; - uint32_t deviceMask; -} VkDeviceGroupCommandBufferBeginInfoKHX; - -typedef struct VkDeviceGroupSubmitInfoKHX { - VkStructureType sType; - const void* pNext; - uint32_t waitSemaphoreCount; - const uint32_t* pWaitSemaphoreDeviceIndices; - uint32_t commandBufferCount; - const uint32_t* pCommandBufferDeviceMasks; - uint32_t signalSemaphoreCount; - const uint32_t* pSignalSemaphoreDeviceIndices; -} VkDeviceGroupSubmitInfoKHX; - -typedef struct VkDeviceGroupBindSparseInfoKHX { - VkStructureType sType; - const void* pNext; - uint32_t resourceDeviceIndex; - uint32_t memoryDeviceIndex; -} VkDeviceGroupBindSparseInfoKHX; - -typedef struct VkBindBufferMemoryDeviceGroupInfoKHX { - VkStructureType sType; - const void* pNext; - uint32_t deviceIndexCount; - const uint32_t* pDeviceIndices; -} VkBindBufferMemoryDeviceGroupInfoKHX; - -typedef struct VkBindImageMemoryDeviceGroupInfoKHX { - VkStructureType sType; - const void* pNext; - uint32_t deviceIndexCount; - const uint32_t* pDeviceIndices; - uint32_t SFRRectCount; - const VkRect2D* pSFRRects; -} VkBindImageMemoryDeviceGroupInfoKHX; - -typedef struct VkDeviceGroupPresentCapabilitiesKHX { - VkStructureType sType; - const void* pNext; - uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE_KHX]; - VkDeviceGroupPresentModeFlagsKHX modes; -} VkDeviceGroupPresentCapabilitiesKHX; - -typedef struct VkImageSwapchainCreateInfoKHX { - VkStructureType sType; - const void* pNext; - VkSwapchainKHR swapchain; -} VkImageSwapchainCreateInfoKHX; - -typedef struct VkBindImageMemorySwapchainInfoKHX { - VkStructureType sType; - const void* pNext; - VkSwapchainKHR swapchain; - uint32_t imageIndex; -} VkBindImageMemorySwapchainInfoKHX; - -typedef struct VkAcquireNextImageInfoKHX { - VkStructureType sType; - const void* pNext; - VkSwapchainKHR swapchain; - uint64_t timeout; - VkSemaphore semaphore; - VkFence fence; - uint32_t deviceMask; -} VkAcquireNextImageInfoKHX; - -typedef struct VkDeviceGroupPresentInfoKHX { - VkStructureType sType; - const void* pNext; - uint32_t swapchainCount; - const uint32_t* pDeviceMasks; - VkDeviceGroupPresentModeFlagBitsKHX mode; -} VkDeviceGroupPresentInfoKHX; - -typedef struct VkDeviceGroupSwapchainCreateInfoKHX { - VkStructureType sType; - const void* pNext; - VkDeviceGroupPresentModeFlagsKHX modes; -} VkDeviceGroupSwapchainCreateInfoKHX; - - -typedef void (VKAPI_PTR *PFN_vkGetDeviceGroupPeerMemoryFeaturesKHX)(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlagsKHX* pPeerMemoryFeatures); -typedef void (VKAPI_PTR *PFN_vkCmdSetDeviceMaskKHX)(VkCommandBuffer commandBuffer, uint32_t deviceMask); -typedef void (VKAPI_PTR *PFN_vkCmdDispatchBaseKHX)(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); -typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupPresentCapabilitiesKHX)(VkDevice device, VkDeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities); -typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModesKHX)(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHX* pModes); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDevicePresentRectanglesKHX)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pRectCount, VkRect2D* pRects); -typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImage2KHX)(VkDevice device, const VkAcquireNextImageInfoKHX* pAcquireInfo, uint32_t* pImageIndex); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeaturesKHX( - VkDevice device, - uint32_t heapIndex, - uint32_t localDeviceIndex, - uint32_t remoteDeviceIndex, - VkPeerMemoryFeatureFlagsKHX* pPeerMemoryFeatures); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetDeviceMaskKHX( - VkCommandBuffer commandBuffer, - uint32_t deviceMask); - -VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBaseKHX( - VkCommandBuffer commandBuffer, - uint32_t baseGroupX, - uint32_t baseGroupY, - uint32_t baseGroupZ, - uint32_t groupCountX, - uint32_t groupCountY, - uint32_t groupCountZ); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupPresentCapabilitiesKHX( - VkDevice device, - VkDeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModesKHX( - VkDevice device, - VkSurfaceKHR surface, - VkDeviceGroupPresentModeFlagsKHX* pModes); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDevicePresentRectanglesKHX( - VkPhysicalDevice physicalDevice, - VkSurfaceKHR surface, - uint32_t* pRectCount, - VkRect2D* pRects); - -VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImage2KHX( - VkDevice device, - const VkAcquireNextImageInfoKHX* pAcquireInfo, - uint32_t* pImageIndex); -#endif - -#define VK_EXT_validation_flags 1 -#define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 1 -#define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags" - - -typedef enum VkValidationCheckEXT { - VK_VALIDATION_CHECK_ALL_EXT = 0, - VK_VALIDATION_CHECK_SHADERS_EXT = 1, - VK_VALIDATION_CHECK_BEGIN_RANGE_EXT = VK_VALIDATION_CHECK_ALL_EXT, - VK_VALIDATION_CHECK_END_RANGE_EXT = VK_VALIDATION_CHECK_SHADERS_EXT, - VK_VALIDATION_CHECK_RANGE_SIZE_EXT = (VK_VALIDATION_CHECK_SHADERS_EXT - VK_VALIDATION_CHECK_ALL_EXT + 1), - VK_VALIDATION_CHECK_MAX_ENUM_EXT = 0x7FFFFFFF -} VkValidationCheckEXT; - -typedef struct VkValidationFlagsEXT { - VkStructureType sType; - const void* pNext; - uint32_t disabledValidationCheckCount; - VkValidationCheckEXT* pDisabledValidationChecks; -} VkValidationFlagsEXT; - - - -#ifdef VK_USE_PLATFORM_VI_NN -#define VK_NN_vi_surface 1 -#define VK_NN_VI_SURFACE_SPEC_VERSION 1 -#define VK_NN_VI_SURFACE_EXTENSION_NAME "VK_NN_vi_surface" - -typedef VkFlags VkViSurfaceCreateFlagsNN; - -typedef struct VkViSurfaceCreateInfoNN { - VkStructureType sType; - const void* pNext; - VkViSurfaceCreateFlagsNN flags; - void* window; -} VkViSurfaceCreateInfoNN; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateViSurfaceNN)(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateViSurfaceNN( - VkInstance instance, - const VkViSurfaceCreateInfoNN* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); -#endif -#endif /* VK_USE_PLATFORM_VI_NN */ - -#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" - - -#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" - - -#define VK_KHX_device_group_creation 1 -#define VK_KHX_DEVICE_GROUP_CREATION_SPEC_VERSION 1 -#define VK_KHX_DEVICE_GROUP_CREATION_EXTENSION_NAME "VK_KHX_device_group_creation" - -typedef struct VkPhysicalDeviceGroupPropertiesKHX { - VkStructureType sType; - void* pNext; - uint32_t physicalDeviceCount; - VkPhysicalDevice physicalDevices[VK_MAX_DEVICE_GROUP_SIZE_KHX]; - VkBool32 subsetAllocation; -} VkPhysicalDeviceGroupPropertiesKHX; - -typedef struct VkDeviceGroupDeviceCreateInfoKHX { - VkStructureType sType; - const void* pNext; - uint32_t physicalDeviceCount; - const VkPhysicalDevice* pPhysicalDevices; -} VkDeviceGroupDeviceCreateInfoKHX; - - -typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceGroupsKHX)(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupPropertiesKHX* pPhysicalDeviceGroupProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroupsKHX( - VkInstance instance, - uint32_t* pPhysicalDeviceGroupCount, - VkPhysicalDeviceGroupPropertiesKHX* pPhysicalDeviceGroupProperties); -#endif - -#define VK_NVX_device_generated_commands 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkObjectTableNVX) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectCommandsLayoutNVX) - -#define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 3 -#define VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NVX_device_generated_commands" - - -typedef enum VkIndirectCommandsTokenTypeNVX { - VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NVX = 0, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DESCRIPTOR_SET_NVX = 1, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_NVX = 2, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_NVX = 3, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NVX = 4, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_NVX = 5, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_NVX = 6, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NVX = 7, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_BEGIN_RANGE_NVX = VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NVX, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_END_RANGE_NVX = VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NVX, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_RANGE_SIZE_NVX = (VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NVX - VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NVX + 1), - VK_INDIRECT_COMMANDS_TOKEN_TYPE_MAX_ENUM_NVX = 0x7FFFFFFF -} VkIndirectCommandsTokenTypeNVX; - -typedef enum VkObjectEntryTypeNVX { - VK_OBJECT_ENTRY_TYPE_DESCRIPTOR_SET_NVX = 0, - VK_OBJECT_ENTRY_TYPE_PIPELINE_NVX = 1, - VK_OBJECT_ENTRY_TYPE_INDEX_BUFFER_NVX = 2, - VK_OBJECT_ENTRY_TYPE_VERTEX_BUFFER_NVX = 3, - VK_OBJECT_ENTRY_TYPE_PUSH_CONSTANT_NVX = 4, - VK_OBJECT_ENTRY_TYPE_BEGIN_RANGE_NVX = VK_OBJECT_ENTRY_TYPE_DESCRIPTOR_SET_NVX, - VK_OBJECT_ENTRY_TYPE_END_RANGE_NVX = VK_OBJECT_ENTRY_TYPE_PUSH_CONSTANT_NVX, - VK_OBJECT_ENTRY_TYPE_RANGE_SIZE_NVX = (VK_OBJECT_ENTRY_TYPE_PUSH_CONSTANT_NVX - VK_OBJECT_ENTRY_TYPE_DESCRIPTOR_SET_NVX + 1), - VK_OBJECT_ENTRY_TYPE_MAX_ENUM_NVX = 0x7FFFFFFF -} VkObjectEntryTypeNVX; - - -typedef enum VkIndirectCommandsLayoutUsageFlagBitsNVX { - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001, - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002, - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004, - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008, - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_FLAG_BITS_MAX_ENUM_NVX = 0x7FFFFFFF -} VkIndirectCommandsLayoutUsageFlagBitsNVX; -typedef VkFlags VkIndirectCommandsLayoutUsageFlagsNVX; - -typedef enum VkObjectEntryUsageFlagBitsNVX { - VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001, - VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002, - VK_OBJECT_ENTRY_USAGE_FLAG_BITS_MAX_ENUM_NVX = 0x7FFFFFFF -} VkObjectEntryUsageFlagBitsNVX; -typedef VkFlags VkObjectEntryUsageFlagsNVX; - -typedef struct VkDeviceGeneratedCommandsFeaturesNVX { - VkStructureType sType; - const void* pNext; - VkBool32 computeBindingPointSupport; -} VkDeviceGeneratedCommandsFeaturesNVX; - -typedef struct VkDeviceGeneratedCommandsLimitsNVX { - VkStructureType sType; - const void* pNext; - uint32_t maxIndirectCommandsLayoutTokenCount; - uint32_t maxObjectEntryCounts; - uint32_t minSequenceCountBufferOffsetAlignment; - uint32_t minSequenceIndexBufferOffsetAlignment; - uint32_t minCommandsTokenBufferOffsetAlignment; -} VkDeviceGeneratedCommandsLimitsNVX; - -typedef struct VkIndirectCommandsTokenNVX { - VkIndirectCommandsTokenTypeNVX tokenType; - VkBuffer buffer; - VkDeviceSize offset; -} VkIndirectCommandsTokenNVX; - -typedef struct VkIndirectCommandsLayoutTokenNVX { - VkIndirectCommandsTokenTypeNVX tokenType; - uint32_t bindingUnit; - uint32_t dynamicCount; - uint32_t divisor; -} VkIndirectCommandsLayoutTokenNVX; - -typedef struct VkIndirectCommandsLayoutCreateInfoNVX { - VkStructureType sType; - const void* pNext; - VkPipelineBindPoint pipelineBindPoint; - VkIndirectCommandsLayoutUsageFlagsNVX flags; - uint32_t tokenCount; - const VkIndirectCommandsLayoutTokenNVX* pTokens; -} VkIndirectCommandsLayoutCreateInfoNVX; - -typedef struct VkCmdProcessCommandsInfoNVX { - VkStructureType sType; - const void* pNext; - VkObjectTableNVX objectTable; - VkIndirectCommandsLayoutNVX indirectCommandsLayout; - uint32_t indirectCommandsTokenCount; - const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens; - uint32_t maxSequencesCount; - VkCommandBuffer targetCommandBuffer; - VkBuffer sequencesCountBuffer; - VkDeviceSize sequencesCountOffset; - VkBuffer sequencesIndexBuffer; - VkDeviceSize sequencesIndexOffset; -} VkCmdProcessCommandsInfoNVX; - -typedef struct VkCmdReserveSpaceForCommandsInfoNVX { - VkStructureType sType; - const void* pNext; - VkObjectTableNVX objectTable; - VkIndirectCommandsLayoutNVX indirectCommandsLayout; - uint32_t maxSequencesCount; -} VkCmdReserveSpaceForCommandsInfoNVX; - -typedef struct VkObjectTableCreateInfoNVX { - VkStructureType sType; - const void* pNext; - uint32_t objectCount; - const VkObjectEntryTypeNVX* pObjectEntryTypes; - const uint32_t* pObjectEntryCounts; - const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags; - uint32_t maxUniformBuffersPerDescriptor; - uint32_t maxStorageBuffersPerDescriptor; - uint32_t maxStorageImagesPerDescriptor; - uint32_t maxSampledImagesPerDescriptor; - uint32_t maxPipelineLayouts; -} VkObjectTableCreateInfoNVX; - -typedef struct VkObjectTableEntryNVX { - VkObjectEntryTypeNVX type; - VkObjectEntryUsageFlagsNVX flags; -} VkObjectTableEntryNVX; - -typedef struct VkObjectTablePipelineEntryNVX { - VkObjectEntryTypeNVX type; - VkObjectEntryUsageFlagsNVX flags; - VkPipeline pipeline; -} VkObjectTablePipelineEntryNVX; - -typedef struct VkObjectTableDescriptorSetEntryNVX { - VkObjectEntryTypeNVX type; - VkObjectEntryUsageFlagsNVX flags; - VkPipelineLayout pipelineLayout; - VkDescriptorSet descriptorSet; -} VkObjectTableDescriptorSetEntryNVX; - -typedef struct VkObjectTableVertexBufferEntryNVX { - VkObjectEntryTypeNVX type; - VkObjectEntryUsageFlagsNVX flags; - VkBuffer buffer; -} VkObjectTableVertexBufferEntryNVX; - -typedef struct VkObjectTableIndexBufferEntryNVX { - VkObjectEntryTypeNVX type; - VkObjectEntryUsageFlagsNVX flags; - VkBuffer buffer; - VkIndexType indexType; -} VkObjectTableIndexBufferEntryNVX; - -typedef struct VkObjectTablePushConstantEntryNVX { - VkObjectEntryTypeNVX type; - VkObjectEntryUsageFlagsNVX flags; - VkPipelineLayout pipelineLayout; - VkShaderStageFlags stageFlags; -} VkObjectTablePushConstantEntryNVX; - - -typedef void (VKAPI_PTR *PFN_vkCmdProcessCommandsNVX)(VkCommandBuffer commandBuffer, const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo); -typedef void (VKAPI_PTR *PFN_vkCmdReserveSpaceForCommandsNVX)(VkCommandBuffer commandBuffer, const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo); -typedef VkResult (VKAPI_PTR *PFN_vkCreateIndirectCommandsLayoutNVX)(VkDevice device, const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout); -typedef void (VKAPI_PTR *PFN_vkDestroyIndirectCommandsLayoutNVX)(VkDevice device, VkIndirectCommandsLayoutNVX indirectCommandsLayout, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreateObjectTableNVX)(VkDevice device, const VkObjectTableCreateInfoNVX* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkObjectTableNVX* pObjectTable); -typedef void (VKAPI_PTR *PFN_vkDestroyObjectTableNVX)(VkDevice device, VkObjectTableNVX objectTable, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkRegisterObjectsNVX)(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, const VkObjectTableEntryNVX* const* ppObjectTableEntries, const uint32_t* pObjectIndices); -typedef VkResult (VKAPI_PTR *PFN_vkUnregisterObjectsNVX)(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, const VkObjectEntryTypeNVX* pObjectEntryTypes, const uint32_t* pObjectIndices); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX)(VkPhysicalDevice physicalDevice, VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, VkDeviceGeneratedCommandsLimitsNVX* pLimits); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkCmdProcessCommandsNVX( - VkCommandBuffer commandBuffer, - const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo); - -VKAPI_ATTR void VKAPI_CALL vkCmdReserveSpaceForCommandsNVX( - VkCommandBuffer commandBuffer, - const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateIndirectCommandsLayoutNVX( - VkDevice device, - const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout); - -VKAPI_ATTR void VKAPI_CALL vkDestroyIndirectCommandsLayoutNVX( - VkDevice device, - VkIndirectCommandsLayoutNVX indirectCommandsLayout, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateObjectTableNVX( - VkDevice device, - const VkObjectTableCreateInfoNVX* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkObjectTableNVX* pObjectTable); - -VKAPI_ATTR void VKAPI_CALL vkDestroyObjectTableNVX( - VkDevice device, - VkObjectTableNVX objectTable, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkRegisterObjectsNVX( - VkDevice device, - VkObjectTableNVX objectTable, - uint32_t objectCount, - const VkObjectTableEntryNVX* const* ppObjectTableEntries, - const uint32_t* pObjectIndices); - -VKAPI_ATTR VkResult VKAPI_CALL vkUnregisterObjectsNVX( - VkDevice device, - VkObjectTableNVX objectTable, - uint32_t objectCount, - const VkObjectEntryTypeNVX* pObjectEntryTypes, - const uint32_t* pObjectIndices); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( - VkPhysicalDevice physicalDevice, - VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, - VkDeviceGeneratedCommandsLimitsNVX* pLimits); -#endif - -#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" - -typedef struct VkViewportWScalingNV { - float xcoeff; - float ycoeff; -} VkViewportWScalingNV; - -typedef struct VkPipelineViewportWScalingStateCreateInfoNV { - VkStructureType sType; - const void* pNext; - VkBool32 viewportWScalingEnable; - uint32_t viewportCount; - const VkViewportWScalingNV* pViewportWScalings; -} VkPipelineViewportWScalingStateCreateInfoNV; - - -typedef void (VKAPI_PTR *PFN_vkCmdSetViewportWScalingNV)(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV* pViewportWScalings); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkCmdSetViewportWScalingNV( - VkCommandBuffer commandBuffer, - uint32_t firstViewport, - uint32_t viewportCount, - const VkViewportWScalingNV* pViewportWScalings); -#endif - -#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" - -typedef VkResult (VKAPI_PTR *PFN_vkReleaseDisplayEXT)(VkPhysicalDevice physicalDevice, VkDisplayKHR display); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkReleaseDisplayEXT( - VkPhysicalDevice physicalDevice, - VkDisplayKHR display); -#endif - -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT -#define VK_EXT_acquire_xlib_display 1 -#include - -#define VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION 1 -#define VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_xlib_display" - -typedef VkResult (VKAPI_PTR *PFN_vkAcquireXlibDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display); -typedef VkResult (VKAPI_PTR *PFN_vkGetRandROutputDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkAcquireXlibDisplayEXT( - VkPhysicalDevice physicalDevice, - Display* dpy, - VkDisplayKHR display); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetRandROutputDisplayEXT( - VkPhysicalDevice physicalDevice, - Display* dpy, - RROutput rrOutput, - VkDisplayKHR* pDisplay); -#endif -#endif /* VK_USE_PLATFORM_XLIB_XRANDR_EXT */ - -#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" -#define VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT - - -typedef enum VkSurfaceCounterFlagBitsEXT { - VK_SURFACE_COUNTER_VBLANK_EXT = 0x00000001, - VK_SURFACE_COUNTER_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkSurfaceCounterFlagBitsEXT; -typedef VkFlags VkSurfaceCounterFlagsEXT; - -typedef struct VkSurfaceCapabilities2EXT { - VkStructureType sType; - void* pNext; - uint32_t minImageCount; - uint32_t maxImageCount; - VkExtent2D currentExtent; - VkExtent2D minImageExtent; - VkExtent2D maxImageExtent; - uint32_t maxImageArrayLayers; - VkSurfaceTransformFlagsKHR supportedTransforms; - VkSurfaceTransformFlagBitsKHR currentTransform; - VkCompositeAlphaFlagsKHR supportedCompositeAlpha; - VkImageUsageFlags supportedUsageFlags; - VkSurfaceCounterFlagsEXT supportedSurfaceCounters; -} VkSurfaceCapabilities2EXT; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilities2EXT* pSurfaceCapabilities); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilities2EXT( - VkPhysicalDevice physicalDevice, - VkSurfaceKHR surface, - VkSurfaceCapabilities2EXT* pSurfaceCapabilities); -#endif - -#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" - - -typedef enum VkDisplayPowerStateEXT { - VK_DISPLAY_POWER_STATE_OFF_EXT = 0, - VK_DISPLAY_POWER_STATE_SUSPEND_EXT = 1, - VK_DISPLAY_POWER_STATE_ON_EXT = 2, - VK_DISPLAY_POWER_STATE_BEGIN_RANGE_EXT = VK_DISPLAY_POWER_STATE_OFF_EXT, - VK_DISPLAY_POWER_STATE_END_RANGE_EXT = VK_DISPLAY_POWER_STATE_ON_EXT, - VK_DISPLAY_POWER_STATE_RANGE_SIZE_EXT = (VK_DISPLAY_POWER_STATE_ON_EXT - VK_DISPLAY_POWER_STATE_OFF_EXT + 1), - VK_DISPLAY_POWER_STATE_MAX_ENUM_EXT = 0x7FFFFFFF -} VkDisplayPowerStateEXT; - -typedef enum VkDeviceEventTypeEXT { - VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT = 0, - VK_DEVICE_EVENT_TYPE_BEGIN_RANGE_EXT = VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT, - VK_DEVICE_EVENT_TYPE_END_RANGE_EXT = VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT, - VK_DEVICE_EVENT_TYPE_RANGE_SIZE_EXT = (VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT - VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT + 1), - VK_DEVICE_EVENT_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF -} VkDeviceEventTypeEXT; - -typedef enum VkDisplayEventTypeEXT { - VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT = 0, - VK_DISPLAY_EVENT_TYPE_BEGIN_RANGE_EXT = VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT, - VK_DISPLAY_EVENT_TYPE_END_RANGE_EXT = VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT, - VK_DISPLAY_EVENT_TYPE_RANGE_SIZE_EXT = (VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT - VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT + 1), - VK_DISPLAY_EVENT_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF -} VkDisplayEventTypeEXT; - -typedef struct VkDisplayPowerInfoEXT { - VkStructureType sType; - const void* pNext; - VkDisplayPowerStateEXT powerState; -} VkDisplayPowerInfoEXT; - -typedef struct VkDeviceEventInfoEXT { - VkStructureType sType; - const void* pNext; - VkDeviceEventTypeEXT deviceEvent; -} VkDeviceEventInfoEXT; - -typedef struct VkDisplayEventInfoEXT { - VkStructureType sType; - const void* pNext; - VkDisplayEventTypeEXT displayEvent; -} VkDisplayEventInfoEXT; - -typedef struct VkSwapchainCounterCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkSurfaceCounterFlagsEXT surfaceCounters; -} VkSwapchainCounterCreateInfoEXT; - - -typedef VkResult (VKAPI_PTR *PFN_vkDisplayPowerControlEXT)(VkDevice device, VkDisplayKHR display, const VkDisplayPowerInfoEXT* pDisplayPowerInfo); -typedef VkResult (VKAPI_PTR *PFN_vkRegisterDeviceEventEXT)(VkDevice device, const VkDeviceEventInfoEXT* pDeviceEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence); -typedef VkResult (VKAPI_PTR *PFN_vkRegisterDisplayEventEXT)(VkDevice device, VkDisplayKHR display, const VkDisplayEventInfoEXT* pDisplayEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence); -typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainCounterEXT)(VkDevice device, VkSwapchainKHR swapchain, VkSurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkDisplayPowerControlEXT( - VkDevice device, - VkDisplayKHR display, - const VkDisplayPowerInfoEXT* pDisplayPowerInfo); - -VKAPI_ATTR VkResult VKAPI_CALL vkRegisterDeviceEventEXT( - VkDevice device, - const VkDeviceEventInfoEXT* pDeviceEventInfo, - const VkAllocationCallbacks* pAllocator, - VkFence* pFence); - -VKAPI_ATTR VkResult VKAPI_CALL vkRegisterDisplayEventEXT( - VkDevice device, - VkDisplayKHR display, - const VkDisplayEventInfoEXT* pDisplayEventInfo, - const VkAllocationCallbacks* pAllocator, - VkFence* pFence); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainCounterEXT( - VkDevice device, - VkSwapchainKHR swapchain, - VkSurfaceCounterFlagBitsEXT counter, - uint64_t* pCounterValue); -#endif - -#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" - -typedef struct VkRefreshCycleDurationGOOGLE { - uint64_t refreshDuration; -} VkRefreshCycleDurationGOOGLE; - -typedef struct VkPastPresentationTimingGOOGLE { - uint32_t presentID; - uint64_t desiredPresentTime; - uint64_t actualPresentTime; - uint64_t earliestPresentTime; - uint64_t presentMargin; -} VkPastPresentationTimingGOOGLE; - -typedef struct VkPresentTimeGOOGLE { - uint32_t presentID; - uint64_t desiredPresentTime; -} VkPresentTimeGOOGLE; - -typedef struct VkPresentTimesInfoGOOGLE { - VkStructureType sType; - const void* pNext; - uint32_t swapchainCount; - const VkPresentTimeGOOGLE* pTimes; -} VkPresentTimesInfoGOOGLE; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetRefreshCycleDurationGOOGLE)(VkDevice device, VkSwapchainKHR swapchain, VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties); -typedef VkResult (VKAPI_PTR *PFN_vkGetPastPresentationTimingGOOGLE)(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pPresentationTimingCount, VkPastPresentationTimingGOOGLE* pPresentationTimings); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetRefreshCycleDurationGOOGLE( - VkDevice device, - VkSwapchainKHR swapchain, - VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPastPresentationTimingGOOGLE( - VkDevice device, - VkSwapchainKHR swapchain, - uint32_t* pPresentationTimingCount, - VkPastPresentationTimingGOOGLE* pPresentationTimings); -#endif - -#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" - - -#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" - - -#define VK_NV_viewport_array2 1 -#define VK_NV_VIEWPORT_ARRAY2_SPEC_VERSION 1 -#define VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME "VK_NV_viewport_array2" - - -#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" - -typedef struct VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX { - VkStructureType sType; - void* pNext; - VkBool32 perViewPositionAllComponents; -} VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX; - - - -#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" - - -typedef enum VkViewportCoordinateSwizzleNV { - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV = 0, - VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_X_NV = 1, - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Y_NV = 2, - VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Y_NV = 3, - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Z_NV = 4, - VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Z_NV = 5, - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_W_NV = 6, - VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV = 7, - VK_VIEWPORT_COORDINATE_SWIZZLE_BEGIN_RANGE_NV = VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV, - VK_VIEWPORT_COORDINATE_SWIZZLE_END_RANGE_NV = VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV, - VK_VIEWPORT_COORDINATE_SWIZZLE_RANGE_SIZE_NV = (VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV + 1), - VK_VIEWPORT_COORDINATE_SWIZZLE_MAX_ENUM_NV = 0x7FFFFFFF -} VkViewportCoordinateSwizzleNV; - -typedef VkFlags VkPipelineViewportSwizzleStateCreateFlagsNV; - -typedef struct VkViewportSwizzleNV { - VkViewportCoordinateSwizzleNV x; - VkViewportCoordinateSwizzleNV y; - VkViewportCoordinateSwizzleNV z; - VkViewportCoordinateSwizzleNV w; -} VkViewportSwizzleNV; - -typedef struct VkPipelineViewportSwizzleStateCreateInfoNV { - VkStructureType sType; - const void* pNext; - VkPipelineViewportSwizzleStateCreateFlagsNV flags; - uint32_t viewportCount; - const VkViewportSwizzleNV* pViewportSwizzles; -} VkPipelineViewportSwizzleStateCreateInfoNV; - - - -#define VK_EXT_discard_rectangles 1 -#define VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION 1 -#define VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME "VK_EXT_discard_rectangles" - - -typedef enum VkDiscardRectangleModeEXT { - VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT = 0, - VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT = 1, - VK_DISCARD_RECTANGLE_MODE_BEGIN_RANGE_EXT = VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT, - VK_DISCARD_RECTANGLE_MODE_END_RANGE_EXT = VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT, - VK_DISCARD_RECTANGLE_MODE_RANGE_SIZE_EXT = (VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT - VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT + 1), - VK_DISCARD_RECTANGLE_MODE_MAX_ENUM_EXT = 0x7FFFFFFF -} VkDiscardRectangleModeEXT; - -typedef VkFlags VkPipelineDiscardRectangleStateCreateFlagsEXT; - -typedef struct VkPhysicalDeviceDiscardRectanglePropertiesEXT { - VkStructureType sType; - void* pNext; - uint32_t maxDiscardRectangles; -} VkPhysicalDeviceDiscardRectanglePropertiesEXT; - -typedef struct VkPipelineDiscardRectangleStateCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkPipelineDiscardRectangleStateCreateFlagsEXT flags; - VkDiscardRectangleModeEXT discardRectangleMode; - uint32_t discardRectangleCount; - const VkRect2D* pDiscardRectangles; -} VkPipelineDiscardRectangleStateCreateInfoEXT; - - -typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleEXT)(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkCmdSetDiscardRectangleEXT( - VkCommandBuffer commandBuffer, - uint32_t firstDiscardRectangle, - uint32_t discardRectangleCount, - const VkRect2D* pDiscardRectangles); -#endif - -#define VK_EXT_swapchain_colorspace 1 -#define VK_EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION 3 -#define VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME "VK_EXT_swapchain_colorspace" - - -#define VK_EXT_hdr_metadata 1 -#define VK_EXT_HDR_METADATA_SPEC_VERSION 1 -#define VK_EXT_HDR_METADATA_EXTENSION_NAME "VK_EXT_hdr_metadata" - -typedef struct VkXYColorEXT { - float x; - float y; -} VkXYColorEXT; - -typedef struct VkHdrMetadataEXT { - VkStructureType sType; - const void* pNext; - VkXYColorEXT displayPrimaryRed; - VkXYColorEXT displayPrimaryGreen; - VkXYColorEXT displayPrimaryBlue; - VkXYColorEXT whitePoint; - float maxLuminance; - float minLuminance; - float maxContentLightLevel; - float maxFrameAverageLightLevel; -} VkHdrMetadataEXT; - - -typedef void (VKAPI_PTR *PFN_vkSetHdrMetadataEXT)(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR* pSwapchains, const VkHdrMetadataEXT* pMetadata); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkSetHdrMetadataEXT( - VkDevice device, - uint32_t swapchainCount, - const VkSwapchainKHR* pSwapchains, - const VkHdrMetadataEXT* pMetadata); -#endif - -#ifdef VK_USE_PLATFORM_IOS_MVK -#define VK_MVK_ios_surface 1 -#define VK_MVK_IOS_SURFACE_SPEC_VERSION 2 -#define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface" - -typedef VkFlags VkIOSSurfaceCreateFlagsMVK; - -typedef struct VkIOSSurfaceCreateInfoMVK { - VkStructureType sType; - const void* pNext; - VkIOSSurfaceCreateFlagsMVK flags; - const void* pView; -} VkIOSSurfaceCreateInfoMVK; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK( - VkInstance instance, - const VkIOSSurfaceCreateInfoMVK* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); -#endif -#endif /* VK_USE_PLATFORM_IOS_MVK */ - -#ifdef VK_USE_PLATFORM_MACOS_MVK -#define VK_MVK_macos_surface 1 -#define VK_MVK_MACOS_SURFACE_SPEC_VERSION 2 -#define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface" - -typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; - -typedef struct VkMacOSSurfaceCreateInfoMVK { - VkStructureType sType; - const void* pNext; - VkMacOSSurfaceCreateFlagsMVK flags; - const void* pView; -} VkMacOSSurfaceCreateInfoMVK; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateMacOSSurfaceMVK)(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK( - VkInstance instance, - const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); -#endif -#endif /* VK_USE_PLATFORM_MACOS_MVK */ - -#define VK_EXT_sampler_filter_minmax 1 -#define VK_EXT_SAMPLER_FILTER_MINMAX_SPEC_VERSION 1 -#define VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME "VK_EXT_sampler_filter_minmax" - - -typedef enum VkSamplerReductionModeEXT { - VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT = 0, - VK_SAMPLER_REDUCTION_MODE_MIN_EXT = 1, - VK_SAMPLER_REDUCTION_MODE_MAX_EXT = 2, - VK_SAMPLER_REDUCTION_MODE_BEGIN_RANGE_EXT = VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT, - VK_SAMPLER_REDUCTION_MODE_END_RANGE_EXT = VK_SAMPLER_REDUCTION_MODE_MAX_EXT, - VK_SAMPLER_REDUCTION_MODE_RANGE_SIZE_EXT = (VK_SAMPLER_REDUCTION_MODE_MAX_EXT - VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT + 1), - VK_SAMPLER_REDUCTION_MODE_MAX_ENUM_EXT = 0x7FFFFFFF -} VkSamplerReductionModeEXT; - -typedef struct VkSamplerReductionModeCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkSamplerReductionModeEXT reductionMode; -} VkSamplerReductionModeCreateInfoEXT; - -typedef struct VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT { - VkStructureType sType; - void* pNext; - VkBool32 filterMinmaxSingleComponentFormats; - VkBool32 filterMinmaxImageComponentMapping; -} VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT; - - - -#define VK_AMD_gpu_shader_int16 1 -#define VK_AMD_GPU_SHADER_INT16_SPEC_VERSION 1 -#define VK_AMD_GPU_SHADER_INT16_EXTENSION_NAME "VK_AMD_gpu_shader_int16" - - -#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" - - -#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" - - -#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" - - -#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" - -typedef struct VkSampleLocationEXT { - float x; - float y; -} VkSampleLocationEXT; - -typedef struct VkSampleLocationsInfoEXT { - VkStructureType sType; - const void* pNext; - VkSampleCountFlagBits sampleLocationsPerPixel; - VkExtent2D sampleLocationGridSize; - uint32_t sampleLocationsCount; - const VkSampleLocationEXT* pSampleLocations; -} VkSampleLocationsInfoEXT; - -typedef struct VkAttachmentSampleLocationsEXT { - uint32_t attachmentIndex; - VkSampleLocationsInfoEXT sampleLocationsInfo; -} VkAttachmentSampleLocationsEXT; - -typedef struct VkSubpassSampleLocationsEXT { - uint32_t subpassIndex; - VkSampleLocationsInfoEXT sampleLocationsInfo; -} VkSubpassSampleLocationsEXT; - -typedef struct VkRenderPassSampleLocationsBeginInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t attachmentInitialSampleLocationsCount; - const VkAttachmentSampleLocationsEXT* pAttachmentInitialSampleLocations; - uint32_t postSubpassSampleLocationsCount; - const VkSubpassSampleLocationsEXT* pPostSubpassSampleLocations; -} VkRenderPassSampleLocationsBeginInfoEXT; - -typedef struct VkPipelineSampleLocationsStateCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkBool32 sampleLocationsEnable; - VkSampleLocationsInfoEXT sampleLocationsInfo; -} VkPipelineSampleLocationsStateCreateInfoEXT; - -typedef struct VkPhysicalDeviceSampleLocationsPropertiesEXT { - VkStructureType sType; - void* pNext; - VkSampleCountFlags sampleLocationSampleCounts; - VkExtent2D maxSampleLocationGridSize; - float sampleLocationCoordinateRange[2]; - uint32_t sampleLocationSubPixelBits; - VkBool32 variableSampleLocations; -} VkPhysicalDeviceSampleLocationsPropertiesEXT; - -typedef struct VkMultisamplePropertiesEXT { - VkStructureType sType; - void* pNext; - VkExtent2D maxSampleLocationGridSize; -} VkMultisamplePropertiesEXT; - - -typedef void (VKAPI_PTR *PFN_vkCmdSetSampleLocationsEXT)(VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT)(VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkCmdSetSampleLocationsEXT( - VkCommandBuffer commandBuffer, - const VkSampleLocationsInfoEXT* pSampleLocationsInfo); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMultisamplePropertiesEXT( - VkPhysicalDevice physicalDevice, - VkSampleCountFlagBits samples, - VkMultisamplePropertiesEXT* pMultisampleProperties); -#endif - -#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" - - -typedef enum VkBlendOverlapEXT { - VK_BLEND_OVERLAP_UNCORRELATED_EXT = 0, - VK_BLEND_OVERLAP_DISJOINT_EXT = 1, - VK_BLEND_OVERLAP_CONJOINT_EXT = 2, - VK_BLEND_OVERLAP_BEGIN_RANGE_EXT = VK_BLEND_OVERLAP_UNCORRELATED_EXT, - VK_BLEND_OVERLAP_END_RANGE_EXT = VK_BLEND_OVERLAP_CONJOINT_EXT, - VK_BLEND_OVERLAP_RANGE_SIZE_EXT = (VK_BLEND_OVERLAP_CONJOINT_EXT - VK_BLEND_OVERLAP_UNCORRELATED_EXT + 1), - VK_BLEND_OVERLAP_MAX_ENUM_EXT = 0x7FFFFFFF -} VkBlendOverlapEXT; - -typedef struct VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT { - VkStructureType sType; - void* pNext; - VkBool32 advancedBlendCoherentOperations; -} VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT; - -typedef struct VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT { - VkStructureType sType; - void* pNext; - uint32_t advancedBlendMaxColorAttachments; - VkBool32 advancedBlendIndependentBlend; - VkBool32 advancedBlendNonPremultipliedSrcColor; - VkBool32 advancedBlendNonPremultipliedDstColor; - VkBool32 advancedBlendCorrelatedOverlap; - VkBool32 advancedBlendAllOperations; -} VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT; - -typedef struct VkPipelineColorBlendAdvancedStateCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkBool32 srcPremultiplied; - VkBool32 dstPremultiplied; - VkBlendOverlapEXT blendOverlap; -} VkPipelineColorBlendAdvancedStateCreateInfoEXT; - - - -#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" - -typedef VkFlags VkPipelineCoverageToColorStateCreateFlagsNV; - -typedef struct VkPipelineCoverageToColorStateCreateInfoNV { - VkStructureType sType; - const void* pNext; - VkPipelineCoverageToColorStateCreateFlagsNV flags; - VkBool32 coverageToColorEnable; - uint32_t coverageToColorLocation; -} VkPipelineCoverageToColorStateCreateInfoNV; - - - -#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" - - -typedef enum VkCoverageModulationModeNV { - VK_COVERAGE_MODULATION_MODE_NONE_NV = 0, - VK_COVERAGE_MODULATION_MODE_RGB_NV = 1, - VK_COVERAGE_MODULATION_MODE_ALPHA_NV = 2, - VK_COVERAGE_MODULATION_MODE_RGBA_NV = 3, - VK_COVERAGE_MODULATION_MODE_BEGIN_RANGE_NV = VK_COVERAGE_MODULATION_MODE_NONE_NV, - VK_COVERAGE_MODULATION_MODE_END_RANGE_NV = VK_COVERAGE_MODULATION_MODE_RGBA_NV, - VK_COVERAGE_MODULATION_MODE_RANGE_SIZE_NV = (VK_COVERAGE_MODULATION_MODE_RGBA_NV - VK_COVERAGE_MODULATION_MODE_NONE_NV + 1), - VK_COVERAGE_MODULATION_MODE_MAX_ENUM_NV = 0x7FFFFFFF -} VkCoverageModulationModeNV; - -typedef VkFlags VkPipelineCoverageModulationStateCreateFlagsNV; - -typedef struct VkPipelineCoverageModulationStateCreateInfoNV { - VkStructureType sType; - const void* pNext; - VkPipelineCoverageModulationStateCreateFlagsNV flags; - VkCoverageModulationModeNV coverageModulationMode; - VkBool32 coverageModulationTableEnable; - uint32_t coverageModulationTableCount; - const float* pCoverageModulationTable; -} VkPipelineCoverageModulationStateCreateInfoNV; - - - -#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" - - -#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" - - -#define VK_EXT_validation_cache 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkValidationCacheEXT) - -#define VK_EXT_VALIDATION_CACHE_SPEC_VERSION 1 -#define VK_EXT_VALIDATION_CACHE_EXTENSION_NAME "VK_EXT_validation_cache" - - -typedef enum VkValidationCacheHeaderVersionEXT { - VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT = 1, - VK_VALIDATION_CACHE_HEADER_VERSION_BEGIN_RANGE_EXT = VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT, - VK_VALIDATION_CACHE_HEADER_VERSION_END_RANGE_EXT = VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT, - VK_VALIDATION_CACHE_HEADER_VERSION_RANGE_SIZE_EXT = (VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT - VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT + 1), - VK_VALIDATION_CACHE_HEADER_VERSION_MAX_ENUM_EXT = 0x7FFFFFFF -} VkValidationCacheHeaderVersionEXT; - -typedef VkFlags VkValidationCacheCreateFlagsEXT; - -typedef struct VkValidationCacheCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkValidationCacheCreateFlagsEXT flags; - size_t initialDataSize; - const void* pInitialData; -} VkValidationCacheCreateInfoEXT; - -typedef struct VkShaderModuleValidationCacheCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkValidationCacheEXT validationCache; -} VkShaderModuleValidationCacheCreateInfoEXT; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateValidationCacheEXT)(VkDevice device, const VkValidationCacheCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkValidationCacheEXT* pValidationCache); -typedef void (VKAPI_PTR *PFN_vkDestroyValidationCacheEXT)(VkDevice device, VkValidationCacheEXT validationCache, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkMergeValidationCachesEXT)(VkDevice device, VkValidationCacheEXT dstCache, uint32_t srcCacheCount, const VkValidationCacheEXT* pSrcCaches); -typedef VkResult (VKAPI_PTR *PFN_vkGetValidationCacheDataEXT)(VkDevice device, VkValidationCacheEXT validationCache, size_t* pDataSize, void* pData); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateValidationCacheEXT( - VkDevice device, - const VkValidationCacheCreateInfoEXT* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkValidationCacheEXT* pValidationCache); - -VKAPI_ATTR void VKAPI_CALL vkDestroyValidationCacheEXT( - VkDevice device, - VkValidationCacheEXT validationCache, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkMergeValidationCachesEXT( - VkDevice device, - VkValidationCacheEXT dstCache, - uint32_t srcCacheCount, - const VkValidationCacheEXT* pSrcCaches); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetValidationCacheDataEXT( - VkDevice device, - VkValidationCacheEXT validationCache, - size_t* pDataSize, - void* pData); -#endif - -#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" - - -#define VK_EXT_global_priority 1 -#define VK_EXT_GLOBAL_PRIORITY_SPEC_VERSION 1 -#define VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME "VK_EXT_global_priority" - - -typedef enum VkQueueGlobalPriorityEXT { - VK_QUEUE_GLOBAL_PRIORITY_LOW = 128, - VK_QUEUE_GLOBAL_PRIORITY_MEDIUM = 256, - VK_QUEUE_GLOBAL_PRIORITY_HIGH = 512, - VK_QUEUE_GLOBAL_PRIORITY_REALTIME = 1024, - VK_QUEUE_GLOBAL_PRIORITY_BEGIN_RANGE_EXT = VK_QUEUE_GLOBAL_PRIORITY_LOW, - VK_QUEUE_GLOBAL_PRIORITY_END_RANGE_EXT = VK_QUEUE_GLOBAL_PRIORITY_REALTIME, - VK_QUEUE_GLOBAL_PRIORITY_RANGE_SIZE_EXT = (VK_QUEUE_GLOBAL_PRIORITY_REALTIME - VK_QUEUE_GLOBAL_PRIORITY_LOW + 1), - VK_QUEUE_GLOBAL_PRIORITY_MAX_ENUM_EXT = 0x7FFFFFFF -} VkQueueGlobalPriorityEXT; - -typedef struct VkDeviceQueueGlobalPriorityCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkQueueGlobalPriorityEXT globalPriority; -} VkDeviceQueueGlobalPriorityCreateInfoEXT; - - - -#ifdef __cplusplus -} -#endif - -#endif +#endif // VULKAN_H_ diff -Nru vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan.hpp vulkan-1.1.73+dfsg/include/vulkan/vulkan.hpp --- vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan.hpp 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/include/vulkan/vulkan.hpp 2018-04-27 11:24:19.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2015-2017 The Khronos Group Inc. +// Copyright (c) 2015-2018 The Khronos Group Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -33,7 +32,11 @@ # include # include #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -static_assert( VK_HEADER_VERSION == 65 , "Wrong VK_HEADER_VERSION!" ); +#if !defined(VULKAN_HPP_ASSERT) +# include +# define VULKAN_HPP_ASSERT assert +#endif +static_assert( VK_HEADER_VERSION == 73 , "Wrong VK_HEADER_VERSION!" ); // 32-bit vulkan is not typesafe for 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 @@ -82,11 +85,21 @@ # define VULKAN_HPP_TYPESAFE_EXPLICIT explicit #endif +#if defined(_MSC_VER) && (_MSC_VER <= 1800) +# define VULKAN_HPP_CONSTEXPR +#else +# define VULKAN_HPP_CONSTEXPR constexpr +#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 { @@ -99,7 +112,7 @@ class Flags { public: - Flags() + VULKAN_HPP_CONSTEXPR Flags() : m_mask(0) { } @@ -114,6 +127,11 @@ { } + explicit Flags(MaskType flags) + : m_mask(flags) + { + } + Flags & operator=(Flags const& rhs) { m_mask = rhs.m_mask; @@ -235,7 +253,7 @@ class ArrayProxy { public: - ArrayProxy(std::nullptr_t) + VULKAN_HPP_CONSTEXPR ArrayProxy(std::nullptr_t) : m_count(0) , m_ptr(nullptr) {} @@ -291,13 +309,13 @@ const T & front() const { - assert(m_count && m_ptr); + VULKAN_HPP_ASSERT(m_count && m_ptr); return *m_ptr; } const T & back() const { - assert(m_count && m_ptr); + VULKAN_HPP_ASSERT(m_count && m_ptr); return *(m_ptr + m_count - 1); } @@ -323,25 +341,30 @@ #endif #ifndef VULKAN_HPP_NO_SMART_HANDLE - template - class UniqueHandle + + template class UniqueHandleTraits; + + template + class UniqueHandle : public UniqueHandleTraits::deleter { + private: + using Deleter = typename UniqueHandleTraits::deleter; public: explicit UniqueHandle( Type const& value = Type(), Deleter const& deleter = Deleter() ) - : m_value( value ) - , m_deleter( deleter ) + : Deleter( deleter) + , m_value( value ) {} UniqueHandle( UniqueHandle const& ) = delete; UniqueHandle( UniqueHandle && other ) - : m_value( other.release() ) - , m_deleter( std::move( other.m_deleter ) ) + : Deleter( std::move( static_cast( other ) ) ) + , m_value( other.release() ) {} ~UniqueHandle() { - destroy(); + if ( m_value ) this->destroy( m_value ); } UniqueHandle & operator=( UniqueHandle const& ) = delete; @@ -349,7 +372,7 @@ UniqueHandle & operator=( UniqueHandle && other ) { reset( other.release() ); - m_deleter = std::move( other.m_deleter ); + *static_cast(this) = std::move( static_cast(other) ); return *this; } @@ -388,21 +411,11 @@ return m_value; } - Deleter & getDeleter() - { - return m_deleter; - } - - Deleter const& getDeleter() const - { - return m_deleter; - } - void reset( Type const& value = Type() ) { if ( m_value != value ) { - destroy(); + if ( m_value ) this->destroy( m_value ); m_value = value; } } @@ -414,35 +427,25 @@ return value; } - void swap( UniqueHandle & rhs ) + void swap( UniqueHandle & rhs ) { std::swap(m_value, rhs.m_value); - std::swap(m_deleter, rhs.m_deleter); - } - - private: - void destroy() - { - if ( m_value ) - { - m_deleter( m_value ); - } + std::swap(static_cast(*this), static_cast(rhs)); } private: Type m_value; - Deleter m_deleter; }; - template - VULKAN_HPP_INLINE void swap( UniqueHandle & lhs, UniqueHandle & rhs ) + template + VULKAN_HPP_INLINE void swap( UniqueHandle & lhs, UniqueHandle & rhs ) { lhs.swap( rhs ); } #endif - template constexpr bool isStructureChainValid() { return false; } + template struct isStructureChainValid { enum { value = false }; }; template class StructureChainElement @@ -485,7 +488,7 @@ template void link() { - static_assert(isStructureChainValid(), "The structure chain is not valid!"); + static_assert(isStructureChainValid::value, "The structure chain is not valid!"); X& x = static_cast(*this); Y& y = static_cast(*this); x.pNext = &y; @@ -501,7 +504,7 @@ template void linkAndCopy(StructureChain const &rhs) { - static_assert(isStructureChainValid(), "The structure chain is not valid!"); + static_assert(isStructureChainValid::value, "The structure chain is not valid!"); X& x = static_cast(*this); Y& y = static_cast(*this); x = static_cast(rhs); @@ -530,6 +533,10 @@ eErrorTooManyObjects = VK_ERROR_TOO_MANY_OBJECTS, eErrorFormatNotSupported = VK_ERROR_FORMAT_NOT_SUPPORTED, eErrorFragmentedPool = VK_ERROR_FRAGMENTED_POOL, + eErrorOutOfPoolMemory = VK_ERROR_OUT_OF_POOL_MEMORY, + eErrorOutOfPoolMemoryKHR = VK_ERROR_OUT_OF_POOL_MEMORY, + eErrorInvalidExternalHandle = VK_ERROR_INVALID_EXTERNAL_HANDLE, + eErrorInvalidExternalHandleKHR = VK_ERROR_INVALID_EXTERNAL_HANDLE, eErrorSurfaceLostKHR = VK_ERROR_SURFACE_LOST_KHR, eErrorNativeWindowInUseKHR = VK_ERROR_NATIVE_WINDOW_IN_USE_KHR, eSuboptimalKHR = VK_SUBOPTIMAL_KHR, @@ -537,8 +544,7 @@ eErrorIncompatibleDisplayKHR = VK_ERROR_INCOMPATIBLE_DISPLAY_KHR, eErrorValidationFailedEXT = VK_ERROR_VALIDATION_FAILED_EXT, eErrorInvalidShaderNV = VK_ERROR_INVALID_SHADER_NV, - eErrorOutOfPoolMemoryKHR = VK_ERROR_OUT_OF_POOL_MEMORY_KHR, - eErrorInvalidExternalHandleKHR = VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR, + eErrorFragmentationEXT = VK_ERROR_FRAGMENTATION_EXT, eErrorNotPermittedEXT = VK_ERROR_NOT_PERMITTED_EXT }; @@ -564,6 +570,8 @@ case Result::eErrorTooManyObjects: return "ErrorTooManyObjects"; case Result::eErrorFormatNotSupported: return "ErrorFormatNotSupported"; case Result::eErrorFragmentedPool: return "ErrorFragmentedPool"; + case Result::eErrorOutOfPoolMemory: return "ErrorOutOfPoolMemory"; + case Result::eErrorInvalidExternalHandle: return "ErrorInvalidExternalHandle"; case Result::eErrorSurfaceLostKHR: return "ErrorSurfaceLostKHR"; case Result::eErrorNativeWindowInUseKHR: return "ErrorNativeWindowInUseKHR"; case Result::eSuboptimalKHR: return "SuboptimalKHR"; @@ -571,8 +579,7 @@ case Result::eErrorIncompatibleDisplayKHR: return "ErrorIncompatibleDisplayKHR"; case Result::eErrorValidationFailedEXT: return "ErrorValidationFailedEXT"; case Result::eErrorInvalidShaderNV: return "ErrorInvalidShaderNV"; - case Result::eErrorOutOfPoolMemoryKHR: return "ErrorOutOfPoolMemoryKHR"; - case Result::eErrorInvalidExternalHandleKHR: return "ErrorInvalidExternalHandleKHR"; + case Result::eErrorFragmentationEXT: return "ErrorFragmentationEXT"; case Result::eErrorNotPermittedEXT: return "ErrorNotPermittedEXT"; default: return "invalid"; } @@ -586,7 +593,7 @@ class ErrorCategoryImpl : public std::error_category { public: - virtual const char* name() const noexcept override { return "VULKAN_HPP_NAMESPACE::Result"; } + virtual const char* name() const noexcept override { return VULKAN_HPP_NAMESPACE_STRING"::Result"; } virtual std::string message(int ev) const override { return to_string(static_cast(ev)); } }; @@ -754,6 +761,22 @@ FragmentedPoolError( char const * message ) : SystemError( make_error_code( Result::eErrorFragmentedPool ), 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 SurfaceLostKHRError : public SystemError { public: @@ -802,21 +825,13 @@ InvalidShaderNVError( char const * message ) : SystemError( make_error_code( Result::eErrorInvalidShaderNV ), message ) {} }; - class OutOfPoolMemoryKHRError : public SystemError - { - public: - OutOfPoolMemoryKHRError( std::string const& message ) - : SystemError( make_error_code( Result::eErrorOutOfPoolMemoryKHR ), message ) {} - OutOfPoolMemoryKHRError( char const * message ) - : SystemError( make_error_code( Result::eErrorOutOfPoolMemoryKHR ), message ) {} - }; - class InvalidExternalHandleKHRError : public SystemError + class FragmentationEXTError : public SystemError { public: - InvalidExternalHandleKHRError( std::string const& message ) - : SystemError( make_error_code( Result::eErrorInvalidExternalHandleKHR ), message ) {} - InvalidExternalHandleKHRError( char const * message ) - : SystemError( make_error_code( Result::eErrorInvalidExternalHandleKHR ), message ) {} + FragmentationEXTError( std::string const& message ) + : SystemError( make_error_code( Result::eErrorFragmentationEXT ), message ) {} + FragmentationEXTError( char const * message ) + : SystemError( make_error_code( Result::eErrorFragmentationEXT ), message ) {} }; class NotPermittedEXTError : public SystemError { @@ -829,7 +844,6 @@ VULKAN_HPP_INLINE void throwResultException( Result result, char const * message ) { - assert ( static_cast(result) < 0 ); switch ( result ) { case Result::eErrorOutOfHostMemory: throw OutOfHostMemoryError ( message ); @@ -844,14 +858,15 @@ case Result::eErrorTooManyObjects: throw TooManyObjectsError ( message ); case Result::eErrorFormatNotSupported: throw FormatNotSupportedError ( message ); case Result::eErrorFragmentedPool: throw FragmentedPoolError ( message ); + case Result::eErrorOutOfPoolMemory: throw OutOfPoolMemoryError ( message ); + case Result::eErrorInvalidExternalHandle: throw InvalidExternalHandleError ( 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 ); - case Result::eErrorOutOfPoolMemoryKHR: throw OutOfPoolMemoryKHRError ( message ); - case Result::eErrorInvalidExternalHandleKHR: throw InvalidExternalHandleKHRError ( message ); + case Result::eErrorFragmentationEXT: throw FragmentationEXTError ( message ); case Result::eErrorNotPermittedEXT: throw NotPermittedEXTError ( message ); default: throw SystemError( make_error_code( result ) ); } @@ -877,6 +892,11 @@ , value( v ) {} + ResultValue( Result r, T && v ) + : result( r ) + , value( std::move( v ) ) + {} + Result result; T value; @@ -889,7 +909,7 @@ #ifdef VULKAN_HPP_NO_EXCEPTIONS typedef ResultValue type; #else - typedef T type; + typedef T type; #endif }; @@ -906,7 +926,7 @@ VULKAN_HPP_INLINE ResultValueType::type createResultValue( Result result, char const * message ) { #ifdef VULKAN_HPP_NO_EXCEPTIONS - assert( result == Result::eSuccess ); + VULKAN_HPP_ASSERT( result == Result::eSuccess ); return result; #else if ( result != Result::eSuccess ) @@ -920,21 +940,21 @@ VULKAN_HPP_INLINE typename ResultValueType::type createResultValue( Result result, T & data, char const * message ) { #ifdef VULKAN_HPP_NO_EXCEPTIONS - assert( result == Result::eSuccess ); + VULKAN_HPP_ASSERT( result == Result::eSuccess ); return ResultValue( result, data ); #else if ( result != Result::eSuccess ) { throwResultException( result, message ); } - return data; + return std::move( data ); #endif } VULKAN_HPP_INLINE Result createResultValue( Result result, char const * message, std::initializer_list successCodes ) { #ifdef VULKAN_HPP_NO_EXCEPTIONS - assert( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() ); + VULKAN_HPP_ASSERT( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() ); #else if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() ) { @@ -948,7 +968,7 @@ VULKAN_HPP_INLINE ResultValue createResultValue( Result result, T & data, char const * message, std::initializer_list successCodes ) { #ifdef VULKAN_HPP_NO_EXCEPTIONS - assert( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() ); + VULKAN_HPP_ASSERT( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() ); #else if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() ) { @@ -958,13329 +978,16627 @@ return ResultValue( result, data ); } - using SampleMask = uint32_t; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + VULKAN_HPP_INLINE typename ResultValueType>::type createResultValue( Result result, T & data, char const * message, typename UniqueHandleTraits::deleter const& deleter ) + { +#ifdef VULKAN_HPP_NO_EXCEPTIONS + VULKAN_HPP_ASSERT( result == Result::eSuccess ); + return ResultValue>( result, UniqueHandle(data, deleter) ); +#else + if ( result != Result::eSuccess ) + { + throwResultException( result, message ); + } + return UniqueHandle(data, deleter); +#endif + } +#endif - using Bool32 = uint32_t; - using DeviceSize = uint64_t; + struct AllocationCallbacks; - enum class FramebufferCreateFlagBits + template + class ObjectDestroy { - }; - - using FramebufferCreateFlags = Flags; + public: + ObjectDestroy(OwnerType owner = OwnerType(), Optional allocator = nullptr) + : m_owner(owner) + , m_allocator(allocator) + {} + + OwnerType getOwner() const { return m_owner; } + Optional getAllocator() const { return m_allocator; } + + protected: + template + void destroy(T t) + { + m_owner.destroy(t, m_allocator); + } - enum class QueryPoolCreateFlagBits - { + private: + OwnerType m_owner; + Optional m_allocator; }; - using QueryPoolCreateFlags = Flags; + class NoParent; - enum class RenderPassCreateFlagBits + template <> + class ObjectDestroy { - }; - - using RenderPassCreateFlags = Flags; + public: + ObjectDestroy( Optional allocator = nullptr ) + : m_allocator( allocator ) + {} - enum class SamplerCreateFlagBits - { - }; + Optional getAllocator() const { return m_allocator; } - using SamplerCreateFlags = Flags; + protected: + template + void destroy(T t) + { + t.destroy( m_allocator ); + } - enum class PipelineLayoutCreateFlagBits - { + private: + Optional m_allocator; }; - using PipelineLayoutCreateFlags = Flags; - - enum class PipelineCacheCreateFlagBits + template + class ObjectFree { - }; - - using PipelineCacheCreateFlags = Flags; + public: + ObjectFree(OwnerType owner = OwnerType(), Optional allocator = nullptr) + : m_owner(owner) + , m_allocator(allocator) + {} + + OwnerType getOwner() const { return m_owner; } + Optional getAllocator() const { return m_allocator; } + + protected: + template + void destroy(T t) + { + m_owner.free(t, m_allocator); + } - enum class PipelineDepthStencilStateCreateFlagBits - { + private: + OwnerType m_owner; + Optional m_allocator; }; - using PipelineDepthStencilStateCreateFlags = Flags; - - enum class PipelineDynamicStateCreateFlagBits + template + class PoolFree { - }; - - using PipelineDynamicStateCreateFlags = Flags; + public: + PoolFree(OwnerType owner = OwnerType(), PoolType pool = PoolType()) + : m_owner(owner) + , m_pool(pool) + {} + + OwnerType getOwner() const { return m_owner; } + PoolType getPool() const { return m_pool; } + + protected: + template + void destroy(T t) + { + m_owner.free(m_pool, t); + } - enum class PipelineColorBlendStateCreateFlagBits - { + private: + OwnerType m_owner; + PoolType m_pool; }; - using PipelineColorBlendStateCreateFlags = Flags; - - enum class PipelineMultisampleStateCreateFlagBits +class DispatchLoaderStatic +{ +public: + VkResult vkAcquireNextImage2KHR( VkDevice device, const VkAcquireNextImageInfoKHR* pAcquireInfo, uint32_t* pImageIndex ) const { - }; - - using PipelineMultisampleStateCreateFlags = Flags; - - enum class PipelineRasterizationStateCreateFlagBits + return ::vkAcquireNextImage2KHR( device, pAcquireInfo, pImageIndex); + } + VkResult vkAcquireNextImageKHR( VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex ) const { - }; - - using PipelineRasterizationStateCreateFlags = Flags; - - enum class PipelineViewportStateCreateFlagBits + return ::vkAcquireNextImageKHR( device, swapchain, timeout, semaphore, fence, pImageIndex); + } +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_NV + VkResult vkAcquireXlibDisplayEXT( VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display ) const { - }; - - using PipelineViewportStateCreateFlags = Flags; - - enum class PipelineTessellationStateCreateFlagBits + return ::vkAcquireXlibDisplayEXT( physicalDevice, dpy, display); + } +#endif /*VK_USE_PLATFORM_XLIB_XRANDR_NV*/ + VkResult vkAllocateCommandBuffers( VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers ) const { - }; - - using PipelineTessellationStateCreateFlags = Flags; - - enum class PipelineInputAssemblyStateCreateFlagBits + return ::vkAllocateCommandBuffers( device, pAllocateInfo, pCommandBuffers); + } + VkResult vkAllocateDescriptorSets( VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets ) const { - }; - - using PipelineInputAssemblyStateCreateFlags = Flags; - - enum class PipelineVertexInputStateCreateFlagBits + return ::vkAllocateDescriptorSets( device, pAllocateInfo, pDescriptorSets); + } + VkResult vkAllocateMemory( VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory ) const { - }; - - using PipelineVertexInputStateCreateFlags = Flags; - - enum class PipelineShaderStageCreateFlagBits + return ::vkAllocateMemory( device, pAllocateInfo, pAllocator, pMemory); + } + VkResult vkBeginCommandBuffer( VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo ) const { - }; - - using PipelineShaderStageCreateFlags = Flags; - - enum class BufferViewCreateFlagBits + return ::vkBeginCommandBuffer( commandBuffer, pBeginInfo); + } + VkResult vkBindBufferMemory( VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset ) const { - }; - - using BufferViewCreateFlags = Flags; - - enum class InstanceCreateFlagBits + return ::vkBindBufferMemory( device, buffer, memory, memoryOffset); + } + VkResult vkBindBufferMemory2( VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos ) const { - }; - - using InstanceCreateFlags = Flags; - - enum class DeviceCreateFlagBits + return ::vkBindBufferMemory2( device, bindInfoCount, pBindInfos); + } + VkResult vkBindBufferMemory2KHR( VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos ) const { - }; - - using DeviceCreateFlags = Flags; - - enum class DeviceQueueCreateFlagBits + return ::vkBindBufferMemory2KHR( device, bindInfoCount, pBindInfos); + } + VkResult vkBindImageMemory( VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset ) const { - }; - - using DeviceQueueCreateFlags = Flags; - - enum class ImageViewCreateFlagBits + return ::vkBindImageMemory( device, image, memory, memoryOffset); + } + VkResult vkBindImageMemory2( VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos ) const { - }; - - using ImageViewCreateFlags = Flags; - - enum class SemaphoreCreateFlagBits + return ::vkBindImageMemory2( device, bindInfoCount, pBindInfos); + } + VkResult vkBindImageMemory2KHR( VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos ) const { - }; - - using SemaphoreCreateFlags = Flags; - - enum class ShaderModuleCreateFlagBits + return ::vkBindImageMemory2KHR( device, bindInfoCount, pBindInfos); + } + void vkCmdBeginDebugUtilsLabelEXT( VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT* pLabelInfo ) const { - }; - - using ShaderModuleCreateFlags = Flags; - - enum class EventCreateFlagBits + return ::vkCmdBeginDebugUtilsLabelEXT( commandBuffer, pLabelInfo); + } + void vkCmdBeginQuery( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags ) const { - }; - - using EventCreateFlags = Flags; - - enum class MemoryMapFlagBits + return ::vkCmdBeginQuery( commandBuffer, queryPool, query, flags); + } + void vkCmdBeginRenderPass( VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents ) const { - }; - - using MemoryMapFlags = Flags; - - enum class DescriptorPoolResetFlagBits + return ::vkCmdBeginRenderPass( commandBuffer, pRenderPassBegin, contents); + } + 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 { - }; - - using DescriptorPoolResetFlags = Flags; - - enum class DescriptorUpdateTemplateCreateFlagBitsKHR + return ::vkCmdBindDescriptorSets( commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); + } + void vkCmdBindIndexBuffer( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType ) const { - }; - - using DescriptorUpdateTemplateCreateFlagsKHR = Flags; - - enum class DisplayModeCreateFlagBitsKHR + return ::vkCmdBindIndexBuffer( commandBuffer, buffer, offset, indexType); + } + void vkCmdBindPipeline( VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline ) const { - }; - - using DisplayModeCreateFlagsKHR = Flags; - - enum class DisplaySurfaceCreateFlagBitsKHR + return ::vkCmdBindPipeline( commandBuffer, pipelineBindPoint, pipeline); + } + void vkCmdBindVertexBuffers( VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets ) const { - }; - - using DisplaySurfaceCreateFlagsKHR = Flags; - -#ifdef VK_USE_PLATFORM_ANDROID_KHR - enum class AndroidSurfaceCreateFlagBitsKHR + return ::vkCmdBindVertexBuffers( commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets); + } + void vkCmdBlitImage( VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkFilter filter ) const { - }; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -#ifdef VK_USE_PLATFORM_ANDROID_KHR - using AndroidSurfaceCreateFlagsKHR = Flags; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -#ifdef VK_USE_PLATFORM_MIR_KHR - enum class MirSurfaceCreateFlagBitsKHR + return ::vkCmdBlitImage( commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter); + } + void vkCmdClearAttachments( VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects ) const { - }; -#endif /*VK_USE_PLATFORM_MIR_KHR*/ - -#ifdef VK_USE_PLATFORM_MIR_KHR - using MirSurfaceCreateFlagsKHR = Flags; -#endif /*VK_USE_PLATFORM_MIR_KHR*/ - -#ifdef VK_USE_PLATFORM_VI_NN - enum class ViSurfaceCreateFlagBitsNN + return ::vkCmdClearAttachments( commandBuffer, attachmentCount, pAttachments, rectCount, pRects); + } + void vkCmdClearColorImage( VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges ) const { - }; -#endif /*VK_USE_PLATFORM_VI_NN*/ - -#ifdef VK_USE_PLATFORM_VI_NN - using ViSurfaceCreateFlagsNN = Flags; -#endif /*VK_USE_PLATFORM_VI_NN*/ - -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - enum class WaylandSurfaceCreateFlagBitsKHR + 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 { - }; -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ + return ::vkCmdClearDepthStencilImage( commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges); + } + void vkCmdCopyBuffer( VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions ) const + { + return ::vkCmdCopyBuffer( commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions); + } + void vkCmdCopyBufferToImage( VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions ) const + { + return ::vkCmdCopyBufferToImage( commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions); + } + void vkCmdCopyImage( VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions ) const + { + return ::vkCmdCopyImage( commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions); + } + void vkCmdCopyImageToBuffer( VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions ) const + { + return ::vkCmdCopyImageToBuffer( commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions); + } + void vkCmdCopyQueryPoolResults( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags ) const + { + return ::vkCmdCopyQueryPoolResults( commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags); + } + void vkCmdDebugMarkerBeginEXT( VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo ) const + { + return ::vkCmdDebugMarkerBeginEXT( commandBuffer, pMarkerInfo); + } + void vkCmdDebugMarkerEndEXT( VkCommandBuffer commandBuffer ) const + { + return ::vkCmdDebugMarkerEndEXT( commandBuffer); + } + void vkCmdDebugMarkerInsertEXT( VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo ) const + { + return ::vkCmdDebugMarkerInsertEXT( commandBuffer, pMarkerInfo); + } + void vkCmdDispatch( VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const + { + return ::vkCmdDispatch( commandBuffer, groupCountX, groupCountY, groupCountZ); + } + void vkCmdDispatchBase( VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const + { + return ::vkCmdDispatchBase( commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ); + } + void vkCmdDispatchBaseKHR( VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const + { + return ::vkCmdDispatchBaseKHR( commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ); + } + void vkCmdDispatchIndirect( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset ) const + { + return ::vkCmdDispatchIndirect( commandBuffer, buffer, offset); + } + void vkCmdDraw( VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance ) const + { + 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 + { + return ::vkCmdDrawIndexed( commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance); + } + void vkCmdDrawIndexedIndirect( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride ) const + { + return ::vkCmdDrawIndexedIndirect( commandBuffer, buffer, offset, drawCount, stride); + } + void vkCmdDrawIndexedIndirectCountAMD( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride ) const + { + return ::vkCmdDrawIndexedIndirectCountAMD( commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); + } + void vkCmdDrawIndirect( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride ) const + { + return ::vkCmdDrawIndirect( commandBuffer, buffer, offset, drawCount, stride); + } + void vkCmdDrawIndirectCountAMD( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride ) const + { + return ::vkCmdDrawIndirectCountAMD( commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); + } + void vkCmdEndDebugUtilsLabelEXT( VkCommandBuffer commandBuffer ) const + { + return ::vkCmdEndDebugUtilsLabelEXT( commandBuffer); + } + void vkCmdEndQuery( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query ) const + { + return ::vkCmdEndQuery( commandBuffer, queryPool, query); + } + void vkCmdEndRenderPass( VkCommandBuffer commandBuffer ) const + { + return ::vkCmdEndRenderPass( commandBuffer); + } + void vkCmdExecuteCommands( VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers ) const + { + return ::vkCmdExecuteCommands( commandBuffer, commandBufferCount, pCommandBuffers); + } + void vkCmdFillBuffer( VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data ) const + { + return ::vkCmdFillBuffer( commandBuffer, dstBuffer, dstOffset, size, data); + } + void vkCmdInsertDebugUtilsLabelEXT( VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT* pLabelInfo ) const + { + return ::vkCmdInsertDebugUtilsLabelEXT( commandBuffer, pLabelInfo); + } + void vkCmdNextSubpass( VkCommandBuffer commandBuffer, VkSubpassContents contents ) const + { + return ::vkCmdNextSubpass( commandBuffer, contents); + } + 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 + { + return ::vkCmdPipelineBarrier( commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); + } + void vkCmdProcessCommandsNVX( VkCommandBuffer commandBuffer, const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo ) const + { + return ::vkCmdProcessCommandsNVX( commandBuffer, pProcessCommandsInfo); + } + void vkCmdPushConstants( VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues ) const + { + return ::vkCmdPushConstants( commandBuffer, layout, stageFlags, offset, size, pValues); + } + void vkCmdPushDescriptorSetKHR( VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites ) const + { + return ::vkCmdPushDescriptorSetKHR( commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites); + } + void vkCmdPushDescriptorSetWithTemplateKHR( VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData ) const + { + return ::vkCmdPushDescriptorSetWithTemplateKHR( commandBuffer, descriptorUpdateTemplate, layout, set, pData); + } + void vkCmdReserveSpaceForCommandsNVX( VkCommandBuffer commandBuffer, const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo ) const + { + return ::vkCmdReserveSpaceForCommandsNVX( commandBuffer, pReserveSpaceInfo); + } + void vkCmdResetEvent( VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask ) const + { + return ::vkCmdResetEvent( commandBuffer, event, stageMask); + } + void vkCmdResetQueryPool( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount ) const + { + return ::vkCmdResetQueryPool( commandBuffer, queryPool, firstQuery, queryCount); + } + void vkCmdResolveImage( VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions ) const + { + return ::vkCmdResolveImage( commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions); + } + void vkCmdSetBlendConstants( VkCommandBuffer commandBuffer, const float blendConstants[4] ) const + { + return ::vkCmdSetBlendConstants( commandBuffer, blendConstants); + } + void vkCmdSetDepthBias( VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor ) const + { + return ::vkCmdSetDepthBias( commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor); + } + void vkCmdSetDepthBounds( VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds ) const + { + return ::vkCmdSetDepthBounds( commandBuffer, minDepthBounds, maxDepthBounds); + } + void vkCmdSetDeviceMask( VkCommandBuffer commandBuffer, uint32_t deviceMask ) const + { + return ::vkCmdSetDeviceMask( commandBuffer, deviceMask); + } + void vkCmdSetDeviceMaskKHR( VkCommandBuffer commandBuffer, uint32_t deviceMask ) const + { + return ::vkCmdSetDeviceMaskKHR( commandBuffer, deviceMask); + } + void vkCmdSetDiscardRectangleEXT( VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles ) const + { + return ::vkCmdSetDiscardRectangleEXT( commandBuffer, firstDiscardRectangle, discardRectangleCount, pDiscardRectangles); + } + void vkCmdSetEvent( VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask ) const + { + return ::vkCmdSetEvent( commandBuffer, event, stageMask); + } + void vkCmdSetLineWidth( VkCommandBuffer commandBuffer, float lineWidth ) const + { + return ::vkCmdSetLineWidth( commandBuffer, lineWidth); + } + void vkCmdSetSampleLocationsEXT( VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo ) const + { + return ::vkCmdSetSampleLocationsEXT( commandBuffer, pSampleLocationsInfo); + } + void vkCmdSetScissor( VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors ) const + { + return ::vkCmdSetScissor( commandBuffer, firstScissor, scissorCount, pScissors); + } + void vkCmdSetStencilCompareMask( VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask ) const + { + return ::vkCmdSetStencilCompareMask( commandBuffer, faceMask, compareMask); + } + void vkCmdSetStencilReference( VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference ) const + { + return ::vkCmdSetStencilReference( commandBuffer, faceMask, reference); + } + void vkCmdSetStencilWriteMask( VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask ) const + { + return ::vkCmdSetStencilWriteMask( commandBuffer, faceMask, writeMask); + } + void vkCmdSetViewport( VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports ) const + { + return ::vkCmdSetViewport( commandBuffer, firstViewport, viewportCount, pViewports); + } + void vkCmdSetViewportWScalingNV( VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV* pViewportWScalings ) const + { + return ::vkCmdSetViewportWScalingNV( commandBuffer, firstViewport, viewportCount, pViewportWScalings); + } + void vkCmdUpdateBuffer( VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData ) const + { + return ::vkCmdUpdateBuffer( commandBuffer, dstBuffer, dstOffset, dataSize, pData); + } + 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 + { + return ::vkCmdWaitEvents( commandBuffer, eventCount, pEvents, srcStageMask, dstStageMask, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); + } + void vkCmdWriteBufferMarkerAMD( VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker ) const + { + return ::vkCmdWriteBufferMarkerAMD( commandBuffer, pipelineStage, dstBuffer, dstOffset, marker); + } + void vkCmdWriteTimestamp( VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query ) const + { + return ::vkCmdWriteTimestamp( commandBuffer, pipelineStage, queryPool, query); + } +#ifdef VK_USE_PLATFORM_ANDROID_KHR + VkResult vkCreateAndroidSurfaceKHR( VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface ) const + { + return ::vkCreateAndroidSurfaceKHR( instance, pCreateInfo, pAllocator, pSurface); + } +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + VkResult vkCreateBuffer( VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer ) const + { + return ::vkCreateBuffer( device, pCreateInfo, pAllocator, pBuffer); + } + VkResult vkCreateBufferView( VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView ) const + { + return ::vkCreateBufferView( device, pCreateInfo, pAllocator, pView); + } + VkResult vkCreateCommandPool( VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool ) const + { + return ::vkCreateCommandPool( device, pCreateInfo, pAllocator, pCommandPool); + } + VkResult vkCreateComputePipelines( VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines ) const + { + return ::vkCreateComputePipelines( device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); + } + VkResult vkCreateDebugReportCallbackEXT( VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback ) const + { + return ::vkCreateDebugReportCallbackEXT( instance, pCreateInfo, pAllocator, pCallback); + } + VkResult vkCreateDebugUtilsMessengerEXT( VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugUtilsMessengerEXT* pMessenger ) const + { + return ::vkCreateDebugUtilsMessengerEXT( instance, pCreateInfo, pAllocator, pMessenger); + } + VkResult vkCreateDescriptorPool( VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool ) const + { + return ::vkCreateDescriptorPool( device, pCreateInfo, pAllocator, pDescriptorPool); + } + VkResult vkCreateDescriptorSetLayout( VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout ) const + { + return ::vkCreateDescriptorSetLayout( device, pCreateInfo, pAllocator, pSetLayout); + } + VkResult vkCreateDescriptorUpdateTemplate( VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate ) const + { + return ::vkCreateDescriptorUpdateTemplate( device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); + } + VkResult vkCreateDescriptorUpdateTemplateKHR( VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate ) const + { + return ::vkCreateDescriptorUpdateTemplateKHR( device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); + } + VkResult vkCreateDevice( VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice ) const + { + return ::vkCreateDevice( physicalDevice, pCreateInfo, pAllocator, pDevice); + } + VkResult vkCreateDisplayModeKHR( VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode ) const + { + return ::vkCreateDisplayModeKHR( physicalDevice, display, pCreateInfo, pAllocator, pMode); + } + VkResult vkCreateDisplayPlaneSurfaceKHR( VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface ) const + { + return ::vkCreateDisplayPlaneSurfaceKHR( instance, pCreateInfo, pAllocator, pSurface); + } + VkResult vkCreateEvent( VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent ) const + { + return ::vkCreateEvent( device, pCreateInfo, pAllocator, pEvent); + } + VkResult vkCreateFence( VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence ) const + { + return ::vkCreateFence( device, pCreateInfo, pAllocator, pFence); + } + VkResult vkCreateFramebuffer( VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer ) const + { + return ::vkCreateFramebuffer( device, pCreateInfo, pAllocator, pFramebuffer); + } + VkResult vkCreateGraphicsPipelines( VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines ) const + { + return ::vkCreateGraphicsPipelines( device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); + } +#ifdef VK_USE_PLATFORM_IOS_MVK + VkResult vkCreateIOSSurfaceMVK( VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface ) const + { + return ::vkCreateIOSSurfaceMVK( instance, pCreateInfo, pAllocator, pSurface); + } +#endif /*VK_USE_PLATFORM_IOS_MVK*/ + VkResult vkCreateImage( VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage ) const + { + return ::vkCreateImage( device, pCreateInfo, pAllocator, pImage); + } + VkResult vkCreateImageView( VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView ) const + { + return ::vkCreateImageView( device, pCreateInfo, pAllocator, pView); + } + VkResult vkCreateIndirectCommandsLayoutNVX( VkDevice device, const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout ) const + { + return ::vkCreateIndirectCommandsLayoutNVX( device, pCreateInfo, pAllocator, pIndirectCommandsLayout); + } + VkResult vkCreateInstance( const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance ) const + { + return ::vkCreateInstance( pCreateInfo, pAllocator, pInstance); + } +#ifdef VK_USE_PLATFORM_MACOS_MVK + VkResult vkCreateMacOSSurfaceMVK( VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface ) const + { + return ::vkCreateMacOSSurfaceMVK( instance, pCreateInfo, pAllocator, pSurface); + } +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ +#ifdef VK_USE_PLATFORM_MIR_KHR + VkResult vkCreateMirSurfaceKHR( VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface ) const + { + return ::vkCreateMirSurfaceKHR( instance, pCreateInfo, pAllocator, pSurface); + } +#endif /*VK_USE_PLATFORM_MIR_KHR*/ + VkResult vkCreateObjectTableNVX( VkDevice device, const VkObjectTableCreateInfoNVX* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkObjectTableNVX* pObjectTable ) const + { + return ::vkCreateObjectTableNVX( device, pCreateInfo, pAllocator, pObjectTable); + } + VkResult vkCreatePipelineCache( VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache ) const + { + return ::vkCreatePipelineCache( device, pCreateInfo, pAllocator, pPipelineCache); + } + VkResult vkCreatePipelineLayout( VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout ) const + { + return ::vkCreatePipelineLayout( device, pCreateInfo, pAllocator, pPipelineLayout); + } + VkResult vkCreateQueryPool( VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool ) const + { + return ::vkCreateQueryPool( device, pCreateInfo, pAllocator, pQueryPool); + } + VkResult vkCreateRenderPass( VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass ) const + { + return ::vkCreateRenderPass( device, pCreateInfo, pAllocator, pRenderPass); + } + VkResult vkCreateSampler( VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler ) const + { + return ::vkCreateSampler( device, pCreateInfo, pAllocator, pSampler); + } + VkResult vkCreateSamplerYcbcrConversion( VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion ) const + { + return ::vkCreateSamplerYcbcrConversion( device, pCreateInfo, pAllocator, pYcbcrConversion); + } + VkResult vkCreateSamplerYcbcrConversionKHR( VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion ) const + { + return ::vkCreateSamplerYcbcrConversionKHR( device, pCreateInfo, pAllocator, pYcbcrConversion); + } + VkResult vkCreateSemaphore( VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore ) const + { + return ::vkCreateSemaphore( device, pCreateInfo, pAllocator, pSemaphore); + } + VkResult vkCreateShaderModule( VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule ) const + { + return ::vkCreateShaderModule( device, pCreateInfo, pAllocator, pShaderModule); + } + VkResult vkCreateSharedSwapchainsKHR( VkDevice device, uint32_t swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains ) const + { + return ::vkCreateSharedSwapchainsKHR( device, swapchainCount, pCreateInfos, pAllocator, pSwapchains); + } + VkResult vkCreateSwapchainKHR( VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain ) const + { + return ::vkCreateSwapchainKHR( device, pCreateInfo, pAllocator, pSwapchain); + } + VkResult vkCreateValidationCacheEXT( VkDevice device, const VkValidationCacheCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkValidationCacheEXT* pValidationCache ) const + { + return ::vkCreateValidationCacheEXT( device, pCreateInfo, pAllocator, pValidationCache); + } +#ifdef VK_USE_PLATFORM_VI_NN + VkResult vkCreateViSurfaceNN( VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface ) const + { + return ::vkCreateViSurfaceNN( instance, pCreateInfo, pAllocator, pSurface); + } +#endif /*VK_USE_PLATFORM_VI_NN*/ +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + VkResult vkCreateWaylandSurfaceKHR( VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface ) const + { + return ::vkCreateWaylandSurfaceKHR( instance, pCreateInfo, pAllocator, pSurface); + } +#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ +#ifdef VK_USE_PLATFORM_WIN32_KHR + VkResult vkCreateWin32SurfaceKHR( VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface ) const + { + return ::vkCreateWin32SurfaceKHR( instance, pCreateInfo, pAllocator, pSurface); + } +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ +#ifdef VK_USE_PLATFORM_XCB_KHR + VkResult vkCreateXcbSurfaceKHR( VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface ) const + { + return ::vkCreateXcbSurfaceKHR( instance, pCreateInfo, pAllocator, pSurface); + } +#endif /*VK_USE_PLATFORM_XCB_KHR*/ +#ifdef VK_USE_PLATFORM_XLIB_KHR + VkResult vkCreateXlibSurfaceKHR( VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface ) const + { + return ::vkCreateXlibSurfaceKHR( instance, pCreateInfo, pAllocator, pSurface); + } +#endif /*VK_USE_PLATFORM_XLIB_KHR*/ + VkResult vkDebugMarkerSetObjectNameEXT( VkDevice device, const VkDebugMarkerObjectNameInfoEXT* pNameInfo ) const + { + return ::vkDebugMarkerSetObjectNameEXT( device, pNameInfo); + } + VkResult vkDebugMarkerSetObjectTagEXT( VkDevice device, const VkDebugMarkerObjectTagInfoEXT* pTagInfo ) const + { + return ::vkDebugMarkerSetObjectTagEXT( device, pTagInfo); + } + void vkDebugReportMessageEXT( VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage ) const + { + return ::vkDebugReportMessageEXT( instance, flags, objectType, object, location, messageCode, pLayerPrefix, pMessage); + } + void vkDestroyBuffer( VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyBuffer( device, buffer, pAllocator); + } + void vkDestroyBufferView( VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyBufferView( device, bufferView, pAllocator); + } + void vkDestroyCommandPool( VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyCommandPool( device, commandPool, pAllocator); + } + void vkDestroyDebugReportCallbackEXT( VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyDebugReportCallbackEXT( instance, callback, pAllocator); + } + void vkDestroyDebugUtilsMessengerEXT( VkInstance instance, VkDebugUtilsMessengerEXT messenger, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyDebugUtilsMessengerEXT( instance, messenger, pAllocator); + } + void vkDestroyDescriptorPool( VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyDescriptorPool( device, descriptorPool, pAllocator); + } + void vkDestroyDescriptorSetLayout( VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyDescriptorSetLayout( device, descriptorSetLayout, pAllocator); + } + void vkDestroyDescriptorUpdateTemplate( VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyDescriptorUpdateTemplate( device, descriptorUpdateTemplate, pAllocator); + } + void vkDestroyDescriptorUpdateTemplateKHR( VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyDescriptorUpdateTemplateKHR( device, descriptorUpdateTemplate, pAllocator); + } + void vkDestroyDevice( VkDevice device, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyDevice( device, pAllocator); + } + void vkDestroyEvent( VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyEvent( device, event, pAllocator); + } + void vkDestroyFence( VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyFence( device, fence, pAllocator); + } + void vkDestroyFramebuffer( VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyFramebuffer( device, framebuffer, pAllocator); + } + void vkDestroyImage( VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyImage( device, image, pAllocator); + } + void vkDestroyImageView( VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyImageView( device, imageView, pAllocator); + } + void vkDestroyIndirectCommandsLayoutNVX( VkDevice device, VkIndirectCommandsLayoutNVX indirectCommandsLayout, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyIndirectCommandsLayoutNVX( device, indirectCommandsLayout, pAllocator); + } + void vkDestroyInstance( VkInstance instance, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyInstance( instance, pAllocator); + } + void vkDestroyObjectTableNVX( VkDevice device, VkObjectTableNVX objectTable, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyObjectTableNVX( device, objectTable, pAllocator); + } + void vkDestroyPipeline( VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyPipeline( device, pipeline, pAllocator); + } + void vkDestroyPipelineCache( VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyPipelineCache( device, pipelineCache, pAllocator); + } + void vkDestroyPipelineLayout( VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyPipelineLayout( device, pipelineLayout, pAllocator); + } + void vkDestroyQueryPool( VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyQueryPool( device, queryPool, pAllocator); + } + void vkDestroyRenderPass( VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyRenderPass( device, renderPass, pAllocator); + } + void vkDestroySampler( VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroySampler( device, sampler, pAllocator); + } + void vkDestroySamplerYcbcrConversion( VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroySamplerYcbcrConversion( device, ycbcrConversion, pAllocator); + } + void vkDestroySamplerYcbcrConversionKHR( VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroySamplerYcbcrConversionKHR( device, ycbcrConversion, pAllocator); + } + void vkDestroySemaphore( VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroySemaphore( device, semaphore, pAllocator); + } + void vkDestroyShaderModule( VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyShaderModule( device, shaderModule, pAllocator); + } + void vkDestroySurfaceKHR( VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroySurfaceKHR( instance, surface, pAllocator); + } + void vkDestroySwapchainKHR( VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroySwapchainKHR( device, swapchain, pAllocator); + } + void vkDestroyValidationCacheEXT( VkDevice device, VkValidationCacheEXT validationCache, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkDestroyValidationCacheEXT( device, validationCache, pAllocator); + } + VkResult vkDeviceWaitIdle( VkDevice device ) const + { + return ::vkDeviceWaitIdle( device); + } + VkResult vkDisplayPowerControlEXT( VkDevice device, VkDisplayKHR display, const VkDisplayPowerInfoEXT* pDisplayPowerInfo ) const + { + return ::vkDisplayPowerControlEXT( device, display, pDisplayPowerInfo); + } + VkResult vkEndCommandBuffer( VkCommandBuffer commandBuffer ) const + { + return ::vkEndCommandBuffer( commandBuffer); + } + VkResult vkEnumerateDeviceExtensionProperties( VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties ) const + { + return ::vkEnumerateDeviceExtensionProperties( physicalDevice, pLayerName, pPropertyCount, pProperties); + } + VkResult vkEnumerateDeviceLayerProperties( VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkLayerProperties* pProperties ) const + { + return ::vkEnumerateDeviceLayerProperties( physicalDevice, pPropertyCount, pProperties); + } + VkResult vkEnumerateInstanceExtensionProperties( const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties ) const + { + return ::vkEnumerateInstanceExtensionProperties( pLayerName, pPropertyCount, pProperties); + } + VkResult vkEnumerateInstanceLayerProperties( uint32_t* pPropertyCount, VkLayerProperties* pProperties ) const + { + return ::vkEnumerateInstanceLayerProperties( pPropertyCount, pProperties); + } + VkResult vkEnumerateInstanceVersion( uint32_t* pApiVersion ) const + { + return ::vkEnumerateInstanceVersion( pApiVersion); + } + VkResult vkEnumeratePhysicalDeviceGroups( VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties ) const + { + return ::vkEnumeratePhysicalDeviceGroups( instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties); + } + VkResult vkEnumeratePhysicalDeviceGroupsKHR( VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties ) const + { + return ::vkEnumeratePhysicalDeviceGroupsKHR( instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties); + } + VkResult vkEnumeratePhysicalDevices( VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices ) const + { + return ::vkEnumeratePhysicalDevices( instance, pPhysicalDeviceCount, pPhysicalDevices); + } + VkResult vkFlushMappedMemoryRanges( VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges ) const + { + return ::vkFlushMappedMemoryRanges( device, memoryRangeCount, pMemoryRanges); + } + void vkFreeCommandBuffers( VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers ) const + { + return ::vkFreeCommandBuffers( device, commandPool, commandBufferCount, pCommandBuffers); + } + VkResult vkFreeDescriptorSets( VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets ) const + { + return ::vkFreeDescriptorSets( device, descriptorPool, descriptorSetCount, pDescriptorSets); + } + void vkFreeMemory( VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator ) const + { + return ::vkFreeMemory( device, memory, pAllocator); + } +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + VkResult vkGetAndroidHardwareBufferPropertiesANDROID( VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties ) const + { + return ::vkGetAndroidHardwareBufferPropertiesANDROID( device, buffer, pProperties); + } +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ + void vkGetBufferMemoryRequirements( VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements ) const + { + return ::vkGetBufferMemoryRequirements( device, buffer, pMemoryRequirements); + } + void vkGetBufferMemoryRequirements2( VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements ) const + { + return ::vkGetBufferMemoryRequirements2( device, pInfo, pMemoryRequirements); + } + void vkGetBufferMemoryRequirements2KHR( VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements ) const + { + return ::vkGetBufferMemoryRequirements2KHR( device, pInfo, pMemoryRequirements); + } + void vkGetDescriptorSetLayoutSupport( VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport ) const + { + return ::vkGetDescriptorSetLayoutSupport( device, pCreateInfo, pSupport); + } + void vkGetDescriptorSetLayoutSupportKHR( VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport ) const + { + return ::vkGetDescriptorSetLayoutSupportKHR( device, pCreateInfo, pSupport); + } + void vkGetDeviceGroupPeerMemoryFeatures( VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures ) const + { + return ::vkGetDeviceGroupPeerMemoryFeatures( device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures); + } + void vkGetDeviceGroupPeerMemoryFeaturesKHR( VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures ) const + { + return ::vkGetDeviceGroupPeerMemoryFeaturesKHR( device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures); + } + VkResult vkGetDeviceGroupPresentCapabilitiesKHR( VkDevice device, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities ) const + { + return ::vkGetDeviceGroupPresentCapabilitiesKHR( device, pDeviceGroupPresentCapabilities); + } + VkResult vkGetDeviceGroupSurfacePresentModesKHR( VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR* pModes ) const + { + return ::vkGetDeviceGroupSurfacePresentModesKHR( device, surface, pModes); + } + void vkGetDeviceMemoryCommitment( VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes ) const + { + return ::vkGetDeviceMemoryCommitment( device, memory, pCommittedMemoryInBytes); + } + PFN_vkVoidFunction vkGetDeviceProcAddr( VkDevice device, const char* pName ) const + { + return ::vkGetDeviceProcAddr( device, pName); + } + void vkGetDeviceQueue( VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue ) const + { + return ::vkGetDeviceQueue( device, queueFamilyIndex, queueIndex, pQueue); + } + void vkGetDeviceQueue2( VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue ) const + { + return ::vkGetDeviceQueue2( device, pQueueInfo, pQueue); + } + VkResult vkGetDisplayModePropertiesKHR( VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint32_t* pPropertyCount, VkDisplayModePropertiesKHR* pProperties ) const + { + return ::vkGetDisplayModePropertiesKHR( physicalDevice, display, pPropertyCount, pProperties); + } + VkResult vkGetDisplayPlaneCapabilitiesKHR( VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities ) const + { + return ::vkGetDisplayPlaneCapabilitiesKHR( physicalDevice, mode, planeIndex, pCapabilities); + } + VkResult vkGetDisplayPlaneSupportedDisplaysKHR( VkPhysicalDevice physicalDevice, uint32_t planeIndex, uint32_t* pDisplayCount, VkDisplayKHR* pDisplays ) const + { + return ::vkGetDisplayPlaneSupportedDisplaysKHR( physicalDevice, planeIndex, pDisplayCount, pDisplays); + } + VkResult vkGetEventStatus( VkDevice device, VkEvent event ) const + { + return ::vkGetEventStatus( device, event); + } + VkResult vkGetFenceFdKHR( VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd ) const + { + return ::vkGetFenceFdKHR( device, pGetFdInfo, pFd); + } + VkResult vkGetFenceStatus( VkDevice device, VkFence fence ) const + { + return ::vkGetFenceStatus( device, fence); + } +#ifdef VK_USE_PLATFORM_WIN32_KHR + VkResult vkGetFenceWin32HandleKHR( VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle ) const + { + return ::vkGetFenceWin32HandleKHR( device, pGetWin32HandleInfo, pHandle); + } +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + void vkGetImageMemoryRequirements( VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements ) const + { + return ::vkGetImageMemoryRequirements( device, image, pMemoryRequirements); + } + void vkGetImageMemoryRequirements2( VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements ) const + { + return ::vkGetImageMemoryRequirements2( device, pInfo, pMemoryRequirements); + } + void vkGetImageMemoryRequirements2KHR( VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements ) const + { + return ::vkGetImageMemoryRequirements2KHR( device, pInfo, pMemoryRequirements); + } + void vkGetImageSparseMemoryRequirements( VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements ) const + { + return ::vkGetImageSparseMemoryRequirements( device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements); + } + void vkGetImageSparseMemoryRequirements2( VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements ) const + { + return ::vkGetImageSparseMemoryRequirements2( device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements); + } + void vkGetImageSparseMemoryRequirements2KHR( VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements ) const + { + return ::vkGetImageSparseMemoryRequirements2KHR( device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements); + } + void vkGetImageSubresourceLayout( VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout ) const + { + return ::vkGetImageSubresourceLayout( device, image, pSubresource, pLayout); + } + PFN_vkVoidFunction vkGetInstanceProcAddr( VkInstance instance, const char* pName ) const + { + return ::vkGetInstanceProcAddr( instance, pName); + } +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + VkResult vkGetMemoryAndroidHardwareBufferANDROID( VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer ) const + { + return ::vkGetMemoryAndroidHardwareBufferANDROID( device, pInfo, pBuffer); + } +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ + VkResult vkGetMemoryFdKHR( VkDevice device, const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd ) const + { + return ::vkGetMemoryFdKHR( device, pGetFdInfo, pFd); + } + VkResult vkGetMemoryFdPropertiesKHR( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, int fd, VkMemoryFdPropertiesKHR* pMemoryFdProperties ) const + { + return ::vkGetMemoryFdPropertiesKHR( device, handleType, fd, pMemoryFdProperties); + } + VkResult vkGetMemoryHostPointerPropertiesEXT( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer, VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties ) const + { + return ::vkGetMemoryHostPointerPropertiesEXT( device, handleType, pHostPointer, pMemoryHostPointerProperties); + } +#ifdef VK_USE_PLATFORM_WIN32_KHR + VkResult vkGetMemoryWin32HandleKHR( VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle ) const + { + return ::vkGetMemoryWin32HandleKHR( device, pGetWin32HandleInfo, pHandle); + } +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ +#ifdef VK_USE_PLATFORM_WIN32_NV + VkResult vkGetMemoryWin32HandleNV( VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle ) const + { + return ::vkGetMemoryWin32HandleNV( device, memory, handleType, pHandle); + } +#endif /*VK_USE_PLATFORM_WIN32_NV*/ +#ifdef VK_USE_PLATFORM_WIN32_KHR + VkResult vkGetMemoryWin32HandlePropertiesKHR( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties ) const + { + return ::vkGetMemoryWin32HandlePropertiesKHR( device, handleType, handle, pMemoryWin32HandleProperties); + } +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + VkResult vkGetPastPresentationTimingGOOGLE( VkDevice device, VkSwapchainKHR swapchain, uint32_t* pPresentationTimingCount, VkPastPresentationTimingGOOGLE* pPresentationTimings ) const + { + return ::vkGetPastPresentationTimingGOOGLE( device, swapchain, pPresentationTimingCount, pPresentationTimings); + } + VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR( VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPlanePropertiesKHR* pProperties ) const + { + return ::vkGetPhysicalDeviceDisplayPlanePropertiesKHR( physicalDevice, pPropertyCount, pProperties); + } + VkResult vkGetPhysicalDeviceDisplayPropertiesKHR( VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPropertiesKHR* pProperties ) const + { + return ::vkGetPhysicalDeviceDisplayPropertiesKHR( physicalDevice, pPropertyCount, pProperties); + } + void vkGetPhysicalDeviceExternalBufferProperties( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties ) const + { + return ::vkGetPhysicalDeviceExternalBufferProperties( physicalDevice, pExternalBufferInfo, pExternalBufferProperties); + } + void vkGetPhysicalDeviceExternalBufferPropertiesKHR( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties ) const + { + return ::vkGetPhysicalDeviceExternalBufferPropertiesKHR( physicalDevice, pExternalBufferInfo, pExternalBufferProperties); + } + void vkGetPhysicalDeviceExternalFenceProperties( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties ) const + { + return ::vkGetPhysicalDeviceExternalFenceProperties( physicalDevice, pExternalFenceInfo, pExternalFenceProperties); + } + void vkGetPhysicalDeviceExternalFencePropertiesKHR( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties ) const + { + return ::vkGetPhysicalDeviceExternalFencePropertiesKHR( physicalDevice, pExternalFenceInfo, pExternalFenceProperties); + } + VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV( VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties ) const + { + return ::vkGetPhysicalDeviceExternalImageFormatPropertiesNV( physicalDevice, format, type, tiling, usage, flags, externalHandleType, pExternalImageFormatProperties); + } + void vkGetPhysicalDeviceExternalSemaphoreProperties( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties ) const + { + return ::vkGetPhysicalDeviceExternalSemaphoreProperties( physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties); + } + void vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties ) const + { + return ::vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties); + } + void vkGetPhysicalDeviceFeatures( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures ) const + { + return ::vkGetPhysicalDeviceFeatures( physicalDevice, pFeatures); + } + void vkGetPhysicalDeviceFeatures2( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures ) const + { + return ::vkGetPhysicalDeviceFeatures2( physicalDevice, pFeatures); + } + void vkGetPhysicalDeviceFeatures2KHR( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures ) const + { + return ::vkGetPhysicalDeviceFeatures2KHR( physicalDevice, pFeatures); + } + void vkGetPhysicalDeviceFormatProperties( VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties ) const + { + return ::vkGetPhysicalDeviceFormatProperties( physicalDevice, format, pFormatProperties); + } + void vkGetPhysicalDeviceFormatProperties2( VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties ) const + { + return ::vkGetPhysicalDeviceFormatProperties2( physicalDevice, format, pFormatProperties); + } + void vkGetPhysicalDeviceFormatProperties2KHR( VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties ) const + { + return ::vkGetPhysicalDeviceFormatProperties2KHR( physicalDevice, format, pFormatProperties); + } + void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( VkPhysicalDevice physicalDevice, VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, VkDeviceGeneratedCommandsLimitsNVX* pLimits ) const + { + return ::vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( physicalDevice, pFeatures, pLimits); + } + VkResult vkGetPhysicalDeviceImageFormatProperties( VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties ) const + { + return ::vkGetPhysicalDeviceImageFormatProperties( physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties); + } + VkResult vkGetPhysicalDeviceImageFormatProperties2( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties ) const + { + return ::vkGetPhysicalDeviceImageFormatProperties2( physicalDevice, pImageFormatInfo, pImageFormatProperties); + } + VkResult vkGetPhysicalDeviceImageFormatProperties2KHR( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties ) const + { + return ::vkGetPhysicalDeviceImageFormatProperties2KHR( physicalDevice, pImageFormatInfo, pImageFormatProperties); + } + void vkGetPhysicalDeviceMemoryProperties( VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties ) const + { + return ::vkGetPhysicalDeviceMemoryProperties( physicalDevice, pMemoryProperties); + } + void vkGetPhysicalDeviceMemoryProperties2( VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties ) const + { + return ::vkGetPhysicalDeviceMemoryProperties2( physicalDevice, pMemoryProperties); + } + void vkGetPhysicalDeviceMemoryProperties2KHR( VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties ) const + { + return ::vkGetPhysicalDeviceMemoryProperties2KHR( physicalDevice, pMemoryProperties); + } +#ifdef VK_USE_PLATFORM_MIR_KHR + VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR( VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, MirConnection* connection ) const + { + return ::vkGetPhysicalDeviceMirPresentationSupportKHR( physicalDevice, queueFamilyIndex, connection); + } +#endif /*VK_USE_PLATFORM_MIR_KHR*/ + void vkGetPhysicalDeviceMultisamplePropertiesEXT( VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties ) const + { + return ::vkGetPhysicalDeviceMultisamplePropertiesEXT( physicalDevice, samples, pMultisampleProperties); + } + VkResult vkGetPhysicalDevicePresentRectanglesKHR( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pRectCount, VkRect2D* pRects ) const + { + return ::vkGetPhysicalDevicePresentRectanglesKHR( physicalDevice, surface, pRectCount, pRects); + } + void vkGetPhysicalDeviceProperties( VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties ) const + { + return ::vkGetPhysicalDeviceProperties( physicalDevice, pProperties); + } + void vkGetPhysicalDeviceProperties2( VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties ) const + { + return ::vkGetPhysicalDeviceProperties2( physicalDevice, pProperties); + } + void vkGetPhysicalDeviceProperties2KHR( VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties ) const + { + return ::vkGetPhysicalDeviceProperties2KHR( physicalDevice, pProperties); + } + void vkGetPhysicalDeviceQueueFamilyProperties( VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties ) const + { + return ::vkGetPhysicalDeviceQueueFamilyProperties( physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties); + } + void vkGetPhysicalDeviceQueueFamilyProperties2( VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties ) const + { + return ::vkGetPhysicalDeviceQueueFamilyProperties2( physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties); + } + void vkGetPhysicalDeviceQueueFamilyProperties2KHR( VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties ) const + { + return ::vkGetPhysicalDeviceQueueFamilyProperties2KHR( physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties); + } + void vkGetPhysicalDeviceSparseImageFormatProperties( VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties ) const + { + return ::vkGetPhysicalDeviceSparseImageFormatProperties( physicalDevice, format, type, samples, usage, tiling, pPropertyCount, pProperties); + } + void vkGetPhysicalDeviceSparseImageFormatProperties2( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties ) const + { + return ::vkGetPhysicalDeviceSparseImageFormatProperties2( physicalDevice, pFormatInfo, pPropertyCount, pProperties); + } + void vkGetPhysicalDeviceSparseImageFormatProperties2KHR( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties ) const + { + return ::vkGetPhysicalDeviceSparseImageFormatProperties2KHR( physicalDevice, pFormatInfo, pPropertyCount, pProperties); + } + VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilities2EXT* pSurfaceCapabilities ) const + { + return ::vkGetPhysicalDeviceSurfaceCapabilities2EXT( physicalDevice, surface, pSurfaceCapabilities); + } + VkResult vkGetPhysicalDeviceSurfaceCapabilities2KHR( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities ) const + { + return ::vkGetPhysicalDeviceSurfaceCapabilities2KHR( physicalDevice, pSurfaceInfo, pSurfaceCapabilities); + } + VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities ) const + { + return ::vkGetPhysicalDeviceSurfaceCapabilitiesKHR( physicalDevice, surface, pSurfaceCapabilities); + } + VkResult vkGetPhysicalDeviceSurfaceFormats2KHR( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats ) const + { + return ::vkGetPhysicalDeviceSurfaceFormats2KHR( physicalDevice, pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats); + } + VkResult vkGetPhysicalDeviceSurfaceFormatsKHR( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats ) const + { + return ::vkGetPhysicalDeviceSurfaceFormatsKHR( physicalDevice, surface, pSurfaceFormatCount, pSurfaceFormats); + } + VkResult vkGetPhysicalDeviceSurfacePresentModesKHR( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes ) const + { + return ::vkGetPhysicalDeviceSurfacePresentModesKHR( physicalDevice, surface, pPresentModeCount, pPresentModes); + } + VkResult vkGetPhysicalDeviceSurfaceSupportKHR( VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported ) const + { + return ::vkGetPhysicalDeviceSurfaceSupportKHR( physicalDevice, queueFamilyIndex, surface, pSupported); + } +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR( VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display ) const + { + return ::vkGetPhysicalDeviceWaylandPresentationSupportKHR( physicalDevice, queueFamilyIndex, display); + } +#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ +#ifdef VK_USE_PLATFORM_WIN32_KHR + VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR( VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex ) const + { + return ::vkGetPhysicalDeviceWin32PresentationSupportKHR( physicalDevice, queueFamilyIndex); + } +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ +#ifdef VK_USE_PLATFORM_XCB_KHR + VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR( VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id ) const + { + return ::vkGetPhysicalDeviceXcbPresentationSupportKHR( physicalDevice, queueFamilyIndex, connection, visual_id); + } +#endif /*VK_USE_PLATFORM_XCB_KHR*/ +#ifdef VK_USE_PLATFORM_XLIB_KHR + VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR( VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID ) const + { + return ::vkGetPhysicalDeviceXlibPresentationSupportKHR( physicalDevice, queueFamilyIndex, dpy, visualID); + } +#endif /*VK_USE_PLATFORM_XLIB_KHR*/ + VkResult vkGetPipelineCacheData( VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData ) const + { + return ::vkGetPipelineCacheData( device, pipelineCache, pDataSize, pData); + } + VkResult vkGetQueryPoolResults( VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags ) const + { + return ::vkGetQueryPoolResults( device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags); + } +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_NV + VkResult vkGetRandROutputDisplayEXT( VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay ) const + { + return ::vkGetRandROutputDisplayEXT( physicalDevice, dpy, rrOutput, pDisplay); + } +#endif /*VK_USE_PLATFORM_XLIB_XRANDR_NV*/ + VkResult vkGetRefreshCycleDurationGOOGLE( VkDevice device, VkSwapchainKHR swapchain, VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties ) const + { + return ::vkGetRefreshCycleDurationGOOGLE( device, swapchain, pDisplayTimingProperties); + } + void vkGetRenderAreaGranularity( VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity ) const + { + return ::vkGetRenderAreaGranularity( device, renderPass, pGranularity); + } + VkResult vkGetSemaphoreFdKHR( VkDevice device, const VkSemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd ) const + { + return ::vkGetSemaphoreFdKHR( device, pGetFdInfo, pFd); + } +#ifdef VK_USE_PLATFORM_WIN32_KHR + VkResult vkGetSemaphoreWin32HandleKHR( VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle ) const + { + return ::vkGetSemaphoreWin32HandleKHR( device, pGetWin32HandleInfo, pHandle); + } +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + VkResult vkGetShaderInfoAMD( VkDevice device, VkPipeline pipeline, VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo ) const + { + return ::vkGetShaderInfoAMD( device, pipeline, shaderStage, infoType, pInfoSize, pInfo); + } + VkResult vkGetSwapchainCounterEXT( VkDevice device, VkSwapchainKHR swapchain, VkSurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue ) const + { + return ::vkGetSwapchainCounterEXT( device, swapchain, counter, pCounterValue); + } + VkResult vkGetSwapchainImagesKHR( VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages ) const + { + return ::vkGetSwapchainImagesKHR( device, swapchain, pSwapchainImageCount, pSwapchainImages); + } + VkResult vkGetSwapchainStatusKHR( VkDevice device, VkSwapchainKHR swapchain ) const + { + return ::vkGetSwapchainStatusKHR( device, swapchain); + } + VkResult vkGetValidationCacheDataEXT( VkDevice device, VkValidationCacheEXT validationCache, size_t* pDataSize, void* pData ) const + { + return ::vkGetValidationCacheDataEXT( device, validationCache, pDataSize, pData); + } + VkResult vkImportFenceFdKHR( VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo ) const + { + return ::vkImportFenceFdKHR( device, pImportFenceFdInfo); + } +#ifdef VK_USE_PLATFORM_WIN32_KHR + VkResult vkImportFenceWin32HandleKHR( VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo ) const + { + return ::vkImportFenceWin32HandleKHR( device, pImportFenceWin32HandleInfo); + } +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + VkResult vkImportSemaphoreFdKHR( VkDevice device, const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo ) const + { + return ::vkImportSemaphoreFdKHR( device, pImportSemaphoreFdInfo); + } +#ifdef VK_USE_PLATFORM_WIN32_KHR + VkResult vkImportSemaphoreWin32HandleKHR( VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo ) const + { + return ::vkImportSemaphoreWin32HandleKHR( device, pImportSemaphoreWin32HandleInfo); + } +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + VkResult vkInvalidateMappedMemoryRanges( VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges ) const + { + return ::vkInvalidateMappedMemoryRanges( device, memoryRangeCount, pMemoryRanges); + } + VkResult vkMapMemory( VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData ) const + { + return ::vkMapMemory( device, memory, offset, size, flags, ppData); + } + VkResult vkMergePipelineCaches( VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches ) const + { + return ::vkMergePipelineCaches( device, dstCache, srcCacheCount, pSrcCaches); + } + VkResult vkMergeValidationCachesEXT( VkDevice device, VkValidationCacheEXT dstCache, uint32_t srcCacheCount, const VkValidationCacheEXT* pSrcCaches ) const + { + return ::vkMergeValidationCachesEXT( device, dstCache, srcCacheCount, pSrcCaches); + } + void vkQueueBeginDebugUtilsLabelEXT( VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo ) const + { + return ::vkQueueBeginDebugUtilsLabelEXT( queue, pLabelInfo); + } + VkResult vkQueueBindSparse( VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence ) const + { + return ::vkQueueBindSparse( queue, bindInfoCount, pBindInfo, fence); + } + void vkQueueEndDebugUtilsLabelEXT( VkQueue queue ) const + { + return ::vkQueueEndDebugUtilsLabelEXT( queue); + } + void vkQueueInsertDebugUtilsLabelEXT( VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo ) const + { + return ::vkQueueInsertDebugUtilsLabelEXT( queue, pLabelInfo); + } + VkResult vkQueuePresentKHR( VkQueue queue, const VkPresentInfoKHR* pPresentInfo ) const + { + return ::vkQueuePresentKHR( queue, pPresentInfo); + } + VkResult vkQueueSubmit( VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence ) const + { + return ::vkQueueSubmit( queue, submitCount, pSubmits, fence); + } + VkResult vkQueueWaitIdle( VkQueue queue ) const + { + return ::vkQueueWaitIdle( queue); + } + VkResult vkRegisterDeviceEventEXT( VkDevice device, const VkDeviceEventInfoEXT* pDeviceEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence ) const + { + return ::vkRegisterDeviceEventEXT( device, pDeviceEventInfo, pAllocator, pFence); + } + VkResult vkRegisterDisplayEventEXT( VkDevice device, VkDisplayKHR display, const VkDisplayEventInfoEXT* pDisplayEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence ) const + { + return ::vkRegisterDisplayEventEXT( device, display, pDisplayEventInfo, pAllocator, pFence); + } + VkResult vkRegisterObjectsNVX( VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, const VkObjectTableEntryNVX* const* ppObjectTableEntries, const uint32_t* pObjectIndices ) const + { + return ::vkRegisterObjectsNVX( device, objectTable, objectCount, ppObjectTableEntries, pObjectIndices); + } + VkResult vkReleaseDisplayEXT( VkPhysicalDevice physicalDevice, VkDisplayKHR display ) const + { + return ::vkReleaseDisplayEXT( physicalDevice, display); + } + VkResult vkResetCommandBuffer( VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags ) const + { + return ::vkResetCommandBuffer( commandBuffer, flags); + } + VkResult vkResetCommandPool( VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags ) const + { + return ::vkResetCommandPool( device, commandPool, flags); + } + VkResult vkResetDescriptorPool( VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags ) const + { + return ::vkResetDescriptorPool( device, descriptorPool, flags); + } + VkResult vkResetEvent( VkDevice device, VkEvent event ) const + { + return ::vkResetEvent( device, event); + } + VkResult vkResetFences( VkDevice device, uint32_t fenceCount, const VkFence* pFences ) const + { + return ::vkResetFences( device, fenceCount, pFences); + } + VkResult vkSetDebugUtilsObjectNameEXT( VkDevice device, const VkDebugUtilsObjectNameInfoEXT* pNameInfo ) const + { + return ::vkSetDebugUtilsObjectNameEXT( device, pNameInfo); + } + VkResult vkSetDebugUtilsObjectTagEXT( VkDevice device, const VkDebugUtilsObjectTagInfoEXT* pTagInfo ) const + { + return ::vkSetDebugUtilsObjectTagEXT( device, pTagInfo); + } + VkResult vkSetEvent( VkDevice device, VkEvent event ) const + { + return ::vkSetEvent( device, event); + } + void vkSetHdrMetadataEXT( VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR* pSwapchains, const VkHdrMetadataEXT* pMetadata ) const + { + return ::vkSetHdrMetadataEXT( device, swapchainCount, pSwapchains, pMetadata); + } + void vkSubmitDebugUtilsMessageEXT( VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData ) const + { + return ::vkSubmitDebugUtilsMessageEXT( instance, messageSeverity, messageTypes, pCallbackData); + } + void vkTrimCommandPool( VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags ) const + { + return ::vkTrimCommandPool( device, commandPool, flags); + } + void vkTrimCommandPoolKHR( VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags ) const + { + return ::vkTrimCommandPoolKHR( device, commandPool, flags); + } + void vkUnmapMemory( VkDevice device, VkDeviceMemory memory ) const + { + return ::vkUnmapMemory( device, memory); + } + VkResult vkUnregisterObjectsNVX( VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, const VkObjectEntryTypeNVX* pObjectEntryTypes, const uint32_t* pObjectIndices ) const + { + return ::vkUnregisterObjectsNVX( device, objectTable, objectCount, pObjectEntryTypes, pObjectIndices); + } + void vkUpdateDescriptorSetWithTemplate( VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData ) const + { + return ::vkUpdateDescriptorSetWithTemplate( device, descriptorSet, descriptorUpdateTemplate, pData); + } + void vkUpdateDescriptorSetWithTemplateKHR( VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData ) const + { + return ::vkUpdateDescriptorSetWithTemplateKHR( device, descriptorSet, descriptorUpdateTemplate, pData); + } + void vkUpdateDescriptorSets( VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies ) const + { + return ::vkUpdateDescriptorSets( device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies); + } + VkResult vkWaitForFences( VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout ) const + { + return ::vkWaitForFences( device, fenceCount, pFences, waitAll, timeout); + } +}; + using SampleMask = uint32_t; + + using Bool32 = uint32_t; + + using DeviceSize = uint64_t; + + enum class FramebufferCreateFlagBits + { + }; + + using FramebufferCreateFlags = Flags; + + enum class QueryPoolCreateFlagBits + { + }; + + using QueryPoolCreateFlags = Flags; + + enum class RenderPassCreateFlagBits + { + }; + + using RenderPassCreateFlags = Flags; + + enum class SamplerCreateFlagBits + { + }; + + using SamplerCreateFlags = Flags; + + enum class PipelineLayoutCreateFlagBits + { + }; + + using PipelineLayoutCreateFlags = Flags; + + enum class PipelineCacheCreateFlagBits + { + }; + + using PipelineCacheCreateFlags = Flags; + + enum class PipelineDepthStencilStateCreateFlagBits + { + }; + + using PipelineDepthStencilStateCreateFlags = Flags; + + enum class PipelineDynamicStateCreateFlagBits + { + }; + + using PipelineDynamicStateCreateFlags = Flags; + + enum class PipelineColorBlendStateCreateFlagBits + { + }; + + using PipelineColorBlendStateCreateFlags = Flags; + + enum class PipelineMultisampleStateCreateFlagBits + { + }; + + using PipelineMultisampleStateCreateFlags = Flags; + + enum class PipelineRasterizationStateCreateFlagBits + { + }; + + using PipelineRasterizationStateCreateFlags = Flags; + + enum class PipelineViewportStateCreateFlagBits + { + }; + + using PipelineViewportStateCreateFlags = Flags; + + enum class PipelineTessellationStateCreateFlagBits + { + }; + + using PipelineTessellationStateCreateFlags = Flags; + + enum class PipelineInputAssemblyStateCreateFlagBits + { + }; + + using PipelineInputAssemblyStateCreateFlags = Flags; + + enum class PipelineVertexInputStateCreateFlagBits + { + }; + + using PipelineVertexInputStateCreateFlags = Flags; + + enum class PipelineShaderStageCreateFlagBits + { + }; + + using PipelineShaderStageCreateFlags = Flags; + + enum class BufferViewCreateFlagBits + { + }; + + using BufferViewCreateFlags = Flags; + + enum class InstanceCreateFlagBits + { + }; + + using InstanceCreateFlags = Flags; + + enum class DeviceCreateFlagBits + { + }; + + using DeviceCreateFlags = Flags; + + enum class ImageViewCreateFlagBits + { + }; + + using ImageViewCreateFlags = Flags; + + enum class SemaphoreCreateFlagBits + { + }; + + using SemaphoreCreateFlags = Flags; + + enum class ShaderModuleCreateFlagBits + { + }; + + using ShaderModuleCreateFlags = Flags; + + enum class EventCreateFlagBits + { + }; + + using EventCreateFlags = Flags; + + enum class MemoryMapFlagBits + { + }; + + using MemoryMapFlags = Flags; + + enum class DescriptorPoolResetFlagBits + { + }; + + using DescriptorPoolResetFlags = Flags; + + enum class DescriptorUpdateTemplateCreateFlagBits + { + }; + + using DescriptorUpdateTemplateCreateFlags = Flags; + + using DescriptorUpdateTemplateCreateFlagsKHR = DescriptorUpdateTemplateCreateFlags; + + enum class DisplayModeCreateFlagBitsKHR + { + }; + + using DisplayModeCreateFlagsKHR = Flags; + + enum class DisplaySurfaceCreateFlagBitsKHR + { + }; + + using DisplaySurfaceCreateFlagsKHR = Flags; + +#ifdef VK_USE_PLATFORM_ANDROID_KHR + enum class AndroidSurfaceCreateFlagBitsKHR + { + }; +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + +#ifdef VK_USE_PLATFORM_ANDROID_KHR + using AndroidSurfaceCreateFlagsKHR = Flags; +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + +#ifdef VK_USE_PLATFORM_MIR_KHR + enum class MirSurfaceCreateFlagBitsKHR + { + }; +#endif /*VK_USE_PLATFORM_MIR_KHR*/ + +#ifdef VK_USE_PLATFORM_MIR_KHR + using MirSurfaceCreateFlagsKHR = Flags; +#endif /*VK_USE_PLATFORM_MIR_KHR*/ + +#ifdef VK_USE_PLATFORM_VI_NN + enum class ViSurfaceCreateFlagBitsNN + { + }; +#endif /*VK_USE_PLATFORM_VI_NN*/ + +#ifdef VK_USE_PLATFORM_VI_NN + using ViSurfaceCreateFlagsNN = Flags; +#endif /*VK_USE_PLATFORM_VI_NN*/ + +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + enum class WaylandSurfaceCreateFlagBitsKHR + { + }; +#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ + +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + using WaylandSurfaceCreateFlagsKHR = Flags; +#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHR + enum class Win32SurfaceCreateFlagBitsKHR + { + }; +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHR + using Win32SurfaceCreateFlagsKHR = Flags; +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + +#ifdef VK_USE_PLATFORM_XLIB_KHR + enum class XlibSurfaceCreateFlagBitsKHR + { + }; +#endif /*VK_USE_PLATFORM_XLIB_KHR*/ + +#ifdef VK_USE_PLATFORM_XLIB_KHR + using XlibSurfaceCreateFlagsKHR = Flags; +#endif /*VK_USE_PLATFORM_XLIB_KHR*/ + +#ifdef VK_USE_PLATFORM_XCB_KHR + enum class XcbSurfaceCreateFlagBitsKHR + { + }; +#endif /*VK_USE_PLATFORM_XCB_KHR*/ + +#ifdef VK_USE_PLATFORM_XCB_KHR + using XcbSurfaceCreateFlagsKHR = Flags; +#endif /*VK_USE_PLATFORM_XCB_KHR*/ + +#ifdef VK_USE_PLATFORM_IOS_MVK + enum class IOSSurfaceCreateFlagBitsMVK + { + }; +#endif /*VK_USE_PLATFORM_IOS_MVK*/ + +#ifdef VK_USE_PLATFORM_IOS_MVK + using IOSSurfaceCreateFlagsMVK = Flags; +#endif /*VK_USE_PLATFORM_IOS_MVK*/ + +#ifdef VK_USE_PLATFORM_MACOS_MVK + enum class MacOSSurfaceCreateFlagBitsMVK + { + }; +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ + +#ifdef VK_USE_PLATFORM_MACOS_MVK + using MacOSSurfaceCreateFlagsMVK = Flags; +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ + + enum class CommandPoolTrimFlagBits + { + }; + + using CommandPoolTrimFlags = Flags; + + using CommandPoolTrimFlagsKHR = CommandPoolTrimFlags; + + enum class PipelineViewportSwizzleStateCreateFlagBitsNV + { + }; + + using PipelineViewportSwizzleStateCreateFlagsNV = Flags; + + enum class PipelineDiscardRectangleStateCreateFlagBitsEXT + { + }; + + using PipelineDiscardRectangleStateCreateFlagsEXT = Flags; + + enum class PipelineCoverageToColorStateCreateFlagBitsNV + { + }; + + using PipelineCoverageToColorStateCreateFlagsNV = Flags; + + enum class PipelineCoverageModulationStateCreateFlagBitsNV + { + }; + + using PipelineCoverageModulationStateCreateFlagsNV = Flags; + + enum class ValidationCacheCreateFlagBitsEXT + { + }; + + using ValidationCacheCreateFlagsEXT = Flags; + + enum class DebugUtilsMessengerCreateFlagBitsEXT + { + }; + + using DebugUtilsMessengerCreateFlagsEXT = Flags; + + enum class DebugUtilsMessengerCallbackDataFlagBitsEXT + { + }; + + using DebugUtilsMessengerCallbackDataFlagsEXT = Flags; + + enum class PipelineRasterizationConservativeStateCreateFlagBitsEXT + { + }; + + using PipelineRasterizationConservativeStateCreateFlagsEXT = Flags; + + class DeviceMemory + { + public: + VULKAN_HPP_CONSTEXPR DeviceMemory() + : m_deviceMemory(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR DeviceMemory( std::nullptr_t ) + : m_deviceMemory(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT DeviceMemory( VkDeviceMemory deviceMemory ) + : m_deviceMemory( deviceMemory ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + DeviceMemory & operator=(VkDeviceMemory deviceMemory) + { + m_deviceMemory = deviceMemory; + return *this; + } +#endif + + DeviceMemory & operator=( std::nullptr_t ) + { + m_deviceMemory = VK_NULL_HANDLE; + return *this; + } + + bool operator==( DeviceMemory const & rhs ) const + { + return m_deviceMemory == rhs.m_deviceMemory; + } + + bool operator!=(DeviceMemory const & rhs ) const + { + return m_deviceMemory != rhs.m_deviceMemory; + } + + bool operator<(DeviceMemory const & rhs ) const + { + return m_deviceMemory < rhs.m_deviceMemory; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDeviceMemory() const + { + return m_deviceMemory; + } + + explicit operator bool() const + { + return m_deviceMemory != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_deviceMemory == VK_NULL_HANDLE; + } + + private: + VkDeviceMemory m_deviceMemory; + }; + + static_assert( sizeof( DeviceMemory ) == sizeof( VkDeviceMemory ), "handle and wrapper have different size!" ); + + class CommandPool + { + public: + VULKAN_HPP_CONSTEXPR CommandPool() + : m_commandPool(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR CommandPool( std::nullptr_t ) + : m_commandPool(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT CommandPool( VkCommandPool commandPool ) + : m_commandPool( commandPool ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + CommandPool & operator=(VkCommandPool commandPool) + { + m_commandPool = commandPool; + return *this; + } +#endif + + CommandPool & operator=( std::nullptr_t ) + { + m_commandPool = VK_NULL_HANDLE; + return *this; + } + + bool operator==( CommandPool const & rhs ) const + { + return m_commandPool == rhs.m_commandPool; + } + + bool operator!=(CommandPool const & rhs ) const + { + return m_commandPool != rhs.m_commandPool; + } + + bool operator<(CommandPool const & rhs ) const + { + return m_commandPool < rhs.m_commandPool; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkCommandPool() const + { + return m_commandPool; + } + + explicit operator bool() const + { + return m_commandPool != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_commandPool == VK_NULL_HANDLE; + } + + private: + VkCommandPool m_commandPool; + }; + + static_assert( sizeof( CommandPool ) == sizeof( VkCommandPool ), "handle and wrapper have different size!" ); + + class Buffer + { + public: + VULKAN_HPP_CONSTEXPR Buffer() + : m_buffer(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR Buffer( std::nullptr_t ) + : m_buffer(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT Buffer( VkBuffer buffer ) + : m_buffer( buffer ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + Buffer & operator=(VkBuffer buffer) + { + m_buffer = buffer; + return *this; + } +#endif + + Buffer & operator=( std::nullptr_t ) + { + m_buffer = VK_NULL_HANDLE; + return *this; + } + + bool operator==( Buffer const & rhs ) const + { + return m_buffer == rhs.m_buffer; + } + + bool operator!=(Buffer const & rhs ) const + { + return m_buffer != rhs.m_buffer; + } + + bool operator<(Buffer const & rhs ) const + { + return m_buffer < rhs.m_buffer; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkBuffer() const + { + return m_buffer; + } + + explicit operator bool() const + { + return m_buffer != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_buffer == VK_NULL_HANDLE; + } + + private: + VkBuffer m_buffer; + }; + + static_assert( sizeof( Buffer ) == sizeof( VkBuffer ), "handle and wrapper have different size!" ); + + class BufferView + { + public: + VULKAN_HPP_CONSTEXPR BufferView() + : m_bufferView(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR BufferView( std::nullptr_t ) + : m_bufferView(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT BufferView( VkBufferView bufferView ) + : m_bufferView( bufferView ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + BufferView & operator=(VkBufferView bufferView) + { + m_bufferView = bufferView; + return *this; + } +#endif + + BufferView & operator=( std::nullptr_t ) + { + m_bufferView = VK_NULL_HANDLE; + return *this; + } + + bool operator==( BufferView const & rhs ) const + { + return m_bufferView == rhs.m_bufferView; + } + + bool operator!=(BufferView const & rhs ) const + { + return m_bufferView != rhs.m_bufferView; + } + + bool operator<(BufferView const & rhs ) const + { + return m_bufferView < rhs.m_bufferView; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkBufferView() const + { + return m_bufferView; + } + + explicit operator bool() const + { + return m_bufferView != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_bufferView == VK_NULL_HANDLE; + } + + private: + VkBufferView m_bufferView; + }; + + static_assert( sizeof( BufferView ) == sizeof( VkBufferView ), "handle and wrapper have different size!" ); + + class Image + { + public: + VULKAN_HPP_CONSTEXPR Image() + : m_image(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR Image( std::nullptr_t ) + : m_image(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT Image( VkImage image ) + : m_image( image ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + Image & operator=(VkImage image) + { + m_image = image; + return *this; + } +#endif + + Image & operator=( std::nullptr_t ) + { + m_image = VK_NULL_HANDLE; + return *this; + } + + bool operator==( Image const & rhs ) const + { + return m_image == rhs.m_image; + } + + bool operator!=(Image const & rhs ) const + { + return m_image != rhs.m_image; + } + + bool operator<(Image const & rhs ) const + { + return m_image < rhs.m_image; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkImage() const + { + return m_image; + } + + explicit operator bool() const + { + return m_image != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_image == VK_NULL_HANDLE; + } + + private: + VkImage m_image; + }; + + static_assert( sizeof( Image ) == sizeof( VkImage ), "handle and wrapper have different size!" ); + + class ImageView + { + public: + VULKAN_HPP_CONSTEXPR ImageView() + : m_imageView(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR ImageView( std::nullptr_t ) + : m_imageView(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT ImageView( VkImageView imageView ) + : m_imageView( imageView ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + ImageView & operator=(VkImageView imageView) + { + m_imageView = imageView; + return *this; + } +#endif + + ImageView & operator=( std::nullptr_t ) + { + m_imageView = VK_NULL_HANDLE; + return *this; + } + + bool operator==( ImageView const & rhs ) const + { + return m_imageView == rhs.m_imageView; + } + + bool operator!=(ImageView const & rhs ) const + { + return m_imageView != rhs.m_imageView; + } + + bool operator<(ImageView const & rhs ) const + { + return m_imageView < rhs.m_imageView; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkImageView() const + { + return m_imageView; + } + + explicit operator bool() const + { + return m_imageView != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_imageView == VK_NULL_HANDLE; + } + + private: + VkImageView m_imageView; + }; + + static_assert( sizeof( ImageView ) == sizeof( VkImageView ), "handle and wrapper have different size!" ); + + class ShaderModule + { + public: + VULKAN_HPP_CONSTEXPR ShaderModule() + : m_shaderModule(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR ShaderModule( std::nullptr_t ) + : m_shaderModule(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT ShaderModule( VkShaderModule shaderModule ) + : m_shaderModule( shaderModule ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + ShaderModule & operator=(VkShaderModule shaderModule) + { + m_shaderModule = shaderModule; + return *this; + } +#endif + + ShaderModule & operator=( std::nullptr_t ) + { + m_shaderModule = VK_NULL_HANDLE; + return *this; + } + + bool operator==( ShaderModule const & rhs ) const + { + return m_shaderModule == rhs.m_shaderModule; + } + + bool operator!=(ShaderModule const & rhs ) const + { + return m_shaderModule != rhs.m_shaderModule; + } + + bool operator<(ShaderModule const & rhs ) const + { + return m_shaderModule < rhs.m_shaderModule; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkShaderModule() const + { + return m_shaderModule; + } + + explicit operator bool() const + { + return m_shaderModule != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_shaderModule == VK_NULL_HANDLE; + } + + private: + VkShaderModule m_shaderModule; + }; + + static_assert( sizeof( ShaderModule ) == sizeof( VkShaderModule ), "handle and wrapper have different size!" ); + + class Pipeline + { + public: + VULKAN_HPP_CONSTEXPR Pipeline() + : m_pipeline(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR Pipeline( std::nullptr_t ) + : m_pipeline(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT Pipeline( VkPipeline pipeline ) + : m_pipeline( pipeline ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + Pipeline & operator=(VkPipeline pipeline) + { + m_pipeline = pipeline; + return *this; + } +#endif + + Pipeline & operator=( std::nullptr_t ) + { + m_pipeline = VK_NULL_HANDLE; + return *this; + } + + bool operator==( Pipeline const & rhs ) const + { + return m_pipeline == rhs.m_pipeline; + } + + bool operator!=(Pipeline const & rhs ) const + { + return m_pipeline != rhs.m_pipeline; + } + + bool operator<(Pipeline const & rhs ) const + { + return m_pipeline < rhs.m_pipeline; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkPipeline() const + { + return m_pipeline; + } + + explicit operator bool() const + { + return m_pipeline != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_pipeline == VK_NULL_HANDLE; + } + + private: + VkPipeline m_pipeline; + }; + + static_assert( sizeof( Pipeline ) == sizeof( VkPipeline ), "handle and wrapper have different size!" ); + + class PipelineLayout + { + public: + VULKAN_HPP_CONSTEXPR PipelineLayout() + : m_pipelineLayout(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR PipelineLayout( std::nullptr_t ) + : m_pipelineLayout(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT PipelineLayout( VkPipelineLayout pipelineLayout ) + : m_pipelineLayout( pipelineLayout ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + PipelineLayout & operator=(VkPipelineLayout pipelineLayout) + { + m_pipelineLayout = pipelineLayout; + return *this; + } +#endif + + PipelineLayout & operator=( std::nullptr_t ) + { + m_pipelineLayout = VK_NULL_HANDLE; + return *this; + } + + bool operator==( PipelineLayout const & rhs ) const + { + return m_pipelineLayout == rhs.m_pipelineLayout; + } + + bool operator!=(PipelineLayout const & rhs ) const + { + return m_pipelineLayout != rhs.m_pipelineLayout; + } + + bool operator<(PipelineLayout const & rhs ) const + { + return m_pipelineLayout < rhs.m_pipelineLayout; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkPipelineLayout() const + { + return m_pipelineLayout; + } + + explicit operator bool() const + { + return m_pipelineLayout != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_pipelineLayout == VK_NULL_HANDLE; + } + + private: + VkPipelineLayout m_pipelineLayout; + }; + + static_assert( sizeof( PipelineLayout ) == sizeof( VkPipelineLayout ), "handle and wrapper have different size!" ); + + class Sampler + { + public: + VULKAN_HPP_CONSTEXPR Sampler() + : m_sampler(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR Sampler( std::nullptr_t ) + : m_sampler(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT Sampler( VkSampler sampler ) + : m_sampler( sampler ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + Sampler & operator=(VkSampler sampler) + { + m_sampler = sampler; + return *this; + } +#endif + + Sampler & operator=( std::nullptr_t ) + { + m_sampler = VK_NULL_HANDLE; + return *this; + } + + bool operator==( Sampler const & rhs ) const + { + return m_sampler == rhs.m_sampler; + } + + bool operator!=(Sampler const & rhs ) const + { + return m_sampler != rhs.m_sampler; + } + + bool operator<(Sampler const & rhs ) const + { + return m_sampler < rhs.m_sampler; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSampler() const + { + return m_sampler; + } + + explicit operator bool() const + { + return m_sampler != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_sampler == VK_NULL_HANDLE; + } + + private: + VkSampler m_sampler; + }; + + static_assert( sizeof( Sampler ) == sizeof( VkSampler ), "handle and wrapper have different size!" ); + + class DescriptorSet + { + public: + VULKAN_HPP_CONSTEXPR DescriptorSet() + : m_descriptorSet(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR DescriptorSet( std::nullptr_t ) + : m_descriptorSet(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorSet( VkDescriptorSet descriptorSet ) + : m_descriptorSet( descriptorSet ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + DescriptorSet & operator=(VkDescriptorSet descriptorSet) + { + m_descriptorSet = descriptorSet; + return *this; + } +#endif + + DescriptorSet & operator=( std::nullptr_t ) + { + m_descriptorSet = VK_NULL_HANDLE; + return *this; + } + + bool operator==( DescriptorSet const & rhs ) const + { + return m_descriptorSet == rhs.m_descriptorSet; + } + + bool operator!=(DescriptorSet const & rhs ) const + { + return m_descriptorSet != rhs.m_descriptorSet; + } + + bool operator<(DescriptorSet const & rhs ) const + { + return m_descriptorSet < rhs.m_descriptorSet; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDescriptorSet() const + { + return m_descriptorSet; + } + + explicit operator bool() const + { + return m_descriptorSet != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_descriptorSet == VK_NULL_HANDLE; + } + + private: + VkDescriptorSet m_descriptorSet; + }; + + static_assert( sizeof( DescriptorSet ) == sizeof( VkDescriptorSet ), "handle and wrapper have different size!" ); + + class DescriptorSetLayout + { + public: + VULKAN_HPP_CONSTEXPR DescriptorSetLayout() + : m_descriptorSetLayout(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR DescriptorSetLayout( std::nullptr_t ) + : m_descriptorSetLayout(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorSetLayout( VkDescriptorSetLayout descriptorSetLayout ) + : m_descriptorSetLayout( descriptorSetLayout ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + DescriptorSetLayout & operator=(VkDescriptorSetLayout descriptorSetLayout) + { + m_descriptorSetLayout = descriptorSetLayout; + return *this; + } +#endif + + DescriptorSetLayout & operator=( std::nullptr_t ) + { + m_descriptorSetLayout = VK_NULL_HANDLE; + return *this; + } + + bool operator==( DescriptorSetLayout const & rhs ) const + { + return m_descriptorSetLayout == rhs.m_descriptorSetLayout; + } + + bool operator!=(DescriptorSetLayout const & rhs ) const + { + return m_descriptorSetLayout != rhs.m_descriptorSetLayout; + } + + bool operator<(DescriptorSetLayout const & rhs ) const + { + return m_descriptorSetLayout < rhs.m_descriptorSetLayout; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDescriptorSetLayout() const + { + return m_descriptorSetLayout; + } + + explicit operator bool() const + { + return m_descriptorSetLayout != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_descriptorSetLayout == VK_NULL_HANDLE; + } + + private: + VkDescriptorSetLayout m_descriptorSetLayout; + }; + + static_assert( sizeof( DescriptorSetLayout ) == sizeof( VkDescriptorSetLayout ), "handle and wrapper have different size!" ); + + class DescriptorPool + { + public: + VULKAN_HPP_CONSTEXPR DescriptorPool() + : m_descriptorPool(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR DescriptorPool( std::nullptr_t ) + : m_descriptorPool(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorPool( VkDescriptorPool descriptorPool ) + : m_descriptorPool( descriptorPool ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + DescriptorPool & operator=(VkDescriptorPool descriptorPool) + { + m_descriptorPool = descriptorPool; + return *this; + } +#endif + + DescriptorPool & operator=( std::nullptr_t ) + { + m_descriptorPool = VK_NULL_HANDLE; + return *this; + } + + bool operator==( DescriptorPool const & rhs ) const + { + return m_descriptorPool == rhs.m_descriptorPool; + } + + bool operator!=(DescriptorPool const & rhs ) const + { + return m_descriptorPool != rhs.m_descriptorPool; + } + + bool operator<(DescriptorPool const & rhs ) const + { + return m_descriptorPool < rhs.m_descriptorPool; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDescriptorPool() const + { + return m_descriptorPool; + } + + explicit operator bool() const + { + return m_descriptorPool != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_descriptorPool == VK_NULL_HANDLE; + } + + private: + VkDescriptorPool m_descriptorPool; + }; + + static_assert( sizeof( DescriptorPool ) == sizeof( VkDescriptorPool ), "handle and wrapper have different size!" ); + + class Fence + { + public: + VULKAN_HPP_CONSTEXPR Fence() + : m_fence(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR Fence( std::nullptr_t ) + : m_fence(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT Fence( VkFence fence ) + : m_fence( fence ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + Fence & operator=(VkFence fence) + { + m_fence = fence; + return *this; + } +#endif + + Fence & operator=( std::nullptr_t ) + { + m_fence = VK_NULL_HANDLE; + return *this; + } + + bool operator==( Fence const & rhs ) const + { + return m_fence == rhs.m_fence; + } + + bool operator!=(Fence const & rhs ) const + { + return m_fence != rhs.m_fence; + } + + bool operator<(Fence const & rhs ) const + { + return m_fence < rhs.m_fence; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkFence() const + { + return m_fence; + } + + explicit operator bool() const + { + return m_fence != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_fence == VK_NULL_HANDLE; + } + + private: + VkFence m_fence; + }; + + static_assert( sizeof( Fence ) == sizeof( VkFence ), "handle and wrapper have different size!" ); + + class Semaphore + { + public: + VULKAN_HPP_CONSTEXPR Semaphore() + : m_semaphore(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR Semaphore( std::nullptr_t ) + : m_semaphore(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT Semaphore( VkSemaphore semaphore ) + : m_semaphore( semaphore ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + Semaphore & operator=(VkSemaphore semaphore) + { + m_semaphore = semaphore; + return *this; + } +#endif + + Semaphore & operator=( std::nullptr_t ) + { + m_semaphore = VK_NULL_HANDLE; + return *this; + } + + bool operator==( Semaphore const & rhs ) const + { + return m_semaphore == rhs.m_semaphore; + } + + bool operator!=(Semaphore const & rhs ) const + { + return m_semaphore != rhs.m_semaphore; + } + + bool operator<(Semaphore const & rhs ) const + { + return m_semaphore < rhs.m_semaphore; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSemaphore() const + { + return m_semaphore; + } + + explicit operator bool() const + { + return m_semaphore != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_semaphore == VK_NULL_HANDLE; + } + + private: + VkSemaphore m_semaphore; + }; + + static_assert( sizeof( Semaphore ) == sizeof( VkSemaphore ), "handle and wrapper have different size!" ); + + class Event + { + public: + VULKAN_HPP_CONSTEXPR Event() + : m_event(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR Event( std::nullptr_t ) + : m_event(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT Event( VkEvent event ) + : m_event( event ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + Event & operator=(VkEvent event) + { + m_event = event; + return *this; + } +#endif + + Event & operator=( std::nullptr_t ) + { + m_event = VK_NULL_HANDLE; + return *this; + } + + bool operator==( Event const & rhs ) const + { + return m_event == rhs.m_event; + } + + bool operator!=(Event const & rhs ) const + { + return m_event != rhs.m_event; + } + + bool operator<(Event const & rhs ) const + { + return m_event < rhs.m_event; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkEvent() const + { + return m_event; + } + + explicit operator bool() const + { + return m_event != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_event == VK_NULL_HANDLE; + } + + private: + VkEvent m_event; + }; + + static_assert( sizeof( Event ) == sizeof( VkEvent ), "handle and wrapper have different size!" ); + + class QueryPool + { + public: + VULKAN_HPP_CONSTEXPR QueryPool() + : m_queryPool(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR QueryPool( std::nullptr_t ) + : m_queryPool(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT QueryPool( VkQueryPool queryPool ) + : m_queryPool( queryPool ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + QueryPool & operator=(VkQueryPool queryPool) + { + m_queryPool = queryPool; + return *this; + } +#endif + + QueryPool & operator=( std::nullptr_t ) + { + m_queryPool = VK_NULL_HANDLE; + return *this; + } + + bool operator==( QueryPool const & rhs ) const + { + return m_queryPool == rhs.m_queryPool; + } + + bool operator!=(QueryPool const & rhs ) const + { + return m_queryPool != rhs.m_queryPool; + } + + bool operator<(QueryPool const & rhs ) const + { + return m_queryPool < rhs.m_queryPool; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkQueryPool() const + { + return m_queryPool; + } + + explicit operator bool() const + { + return m_queryPool != VK_NULL_HANDLE; + } -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - using WaylandSurfaceCreateFlagsKHR = Flags; -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ + bool operator!() const + { + return m_queryPool == VK_NULL_HANDLE; + } -#ifdef VK_USE_PLATFORM_WIN32_KHR - enum class Win32SurfaceCreateFlagBitsKHR - { + private: + VkQueryPool m_queryPool; }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ -#ifdef VK_USE_PLATFORM_WIN32_KHR - using Win32SurfaceCreateFlagsKHR = Flags; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + static_assert( sizeof( QueryPool ) == sizeof( VkQueryPool ), "handle and wrapper have different size!" ); -#ifdef VK_USE_PLATFORM_XLIB_KHR - enum class XlibSurfaceCreateFlagBitsKHR + class Framebuffer { - }; -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ + public: + VULKAN_HPP_CONSTEXPR Framebuffer() + : m_framebuffer(VK_NULL_HANDLE) + {} -#ifdef VK_USE_PLATFORM_XLIB_KHR - using XlibSurfaceCreateFlagsKHR = Flags; -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ + VULKAN_HPP_CONSTEXPR Framebuffer( std::nullptr_t ) + : m_framebuffer(VK_NULL_HANDLE) + {} -#ifdef VK_USE_PLATFORM_XCB_KHR - enum class XcbSurfaceCreateFlagBitsKHR - { - }; -#endif /*VK_USE_PLATFORM_XCB_KHR*/ + VULKAN_HPP_TYPESAFE_EXPLICIT Framebuffer( VkFramebuffer framebuffer ) + : m_framebuffer( framebuffer ) + {} -#ifdef VK_USE_PLATFORM_XCB_KHR - using XcbSurfaceCreateFlagsKHR = Flags; -#endif /*VK_USE_PLATFORM_XCB_KHR*/ +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + Framebuffer & operator=(VkFramebuffer framebuffer) + { + m_framebuffer = framebuffer; + return *this; + } +#endif -#ifdef VK_USE_PLATFORM_IOS_MVK - enum class IOSSurfaceCreateFlagBitsMVK - { + Framebuffer & operator=( std::nullptr_t ) + { + m_framebuffer = VK_NULL_HANDLE; + return *this; + } + + bool operator==( Framebuffer const & rhs ) const + { + return m_framebuffer == rhs.m_framebuffer; + } + + bool operator!=(Framebuffer const & rhs ) const + { + return m_framebuffer != rhs.m_framebuffer; + } + + bool operator<(Framebuffer const & rhs ) const + { + return m_framebuffer < rhs.m_framebuffer; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkFramebuffer() const + { + return m_framebuffer; + } + + explicit operator bool() const + { + return m_framebuffer != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_framebuffer == VK_NULL_HANDLE; + } + + private: + VkFramebuffer m_framebuffer; }; -#endif /*VK_USE_PLATFORM_IOS_MVK*/ -#ifdef VK_USE_PLATFORM_IOS_MVK - using IOSSurfaceCreateFlagsMVK = Flags; -#endif /*VK_USE_PLATFORM_IOS_MVK*/ + static_assert( sizeof( Framebuffer ) == sizeof( VkFramebuffer ), "handle and wrapper have different size!" ); -#ifdef VK_USE_PLATFORM_MACOS_MVK - enum class MacOSSurfaceCreateFlagBitsMVK + class RenderPass { + public: + VULKAN_HPP_CONSTEXPR RenderPass() + : m_renderPass(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR RenderPass( std::nullptr_t ) + : m_renderPass(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT RenderPass( VkRenderPass renderPass ) + : m_renderPass( renderPass ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + RenderPass & operator=(VkRenderPass renderPass) + { + m_renderPass = renderPass; + return *this; + } +#endif + + RenderPass & operator=( std::nullptr_t ) + { + m_renderPass = VK_NULL_HANDLE; + return *this; + } + + bool operator==( RenderPass const & rhs ) const + { + return m_renderPass == rhs.m_renderPass; + } + + bool operator!=(RenderPass const & rhs ) const + { + return m_renderPass != rhs.m_renderPass; + } + + bool operator<(RenderPass const & rhs ) const + { + return m_renderPass < rhs.m_renderPass; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkRenderPass() const + { + return m_renderPass; + } + + explicit operator bool() const + { + return m_renderPass != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_renderPass == VK_NULL_HANDLE; + } + + private: + VkRenderPass m_renderPass; }; -#endif /*VK_USE_PLATFORM_MACOS_MVK*/ -#ifdef VK_USE_PLATFORM_MACOS_MVK - using MacOSSurfaceCreateFlagsMVK = Flags; -#endif /*VK_USE_PLATFORM_MACOS_MVK*/ + static_assert( sizeof( RenderPass ) == sizeof( VkRenderPass ), "handle and wrapper have different size!" ); - enum class CommandPoolTrimFlagBitsKHR + class PipelineCache { + public: + VULKAN_HPP_CONSTEXPR PipelineCache() + : m_pipelineCache(VK_NULL_HANDLE) + {} + + VULKAN_HPP_CONSTEXPR PipelineCache( std::nullptr_t ) + : m_pipelineCache(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT PipelineCache( VkPipelineCache pipelineCache ) + : m_pipelineCache( pipelineCache ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + PipelineCache & operator=(VkPipelineCache pipelineCache) + { + m_pipelineCache = pipelineCache; + return *this; + } +#endif + + PipelineCache & operator=( std::nullptr_t ) + { + m_pipelineCache = VK_NULL_HANDLE; + return *this; + } + + bool operator==( PipelineCache const & rhs ) const + { + return m_pipelineCache == rhs.m_pipelineCache; + } + + bool operator!=(PipelineCache const & rhs ) const + { + return m_pipelineCache != rhs.m_pipelineCache; + } + + bool operator<(PipelineCache const & rhs ) const + { + return m_pipelineCache < rhs.m_pipelineCache; + } + + + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkPipelineCache() const + { + return m_pipelineCache; + } + + explicit operator bool() const + { + return m_pipelineCache != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_pipelineCache == VK_NULL_HANDLE; + } + + private: + VkPipelineCache m_pipelineCache; }; - using CommandPoolTrimFlagsKHR = Flags; + static_assert( sizeof( PipelineCache ) == sizeof( VkPipelineCache ), "handle and wrapper have different size!" ); - enum class PipelineViewportSwizzleStateCreateFlagBitsNV + class ObjectTableNVX { - }; + public: + VULKAN_HPP_CONSTEXPR ObjectTableNVX() + : m_objectTableNVX(VK_NULL_HANDLE) + {} - using PipelineViewportSwizzleStateCreateFlagsNV = Flags; + VULKAN_HPP_CONSTEXPR ObjectTableNVX( std::nullptr_t ) + : m_objectTableNVX(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT ObjectTableNVX( VkObjectTableNVX objectTableNVX ) + : m_objectTableNVX( objectTableNVX ) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + ObjectTableNVX & operator=(VkObjectTableNVX objectTableNVX) + { + m_objectTableNVX = objectTableNVX; + return *this; + } +#endif + + ObjectTableNVX & operator=( std::nullptr_t ) + { + m_objectTableNVX = VK_NULL_HANDLE; + return *this; + } + + bool operator==( ObjectTableNVX const & rhs ) const + { + return m_objectTableNVX == rhs.m_objectTableNVX; + } + + bool operator!=(ObjectTableNVX const & rhs ) const + { + return m_objectTableNVX != rhs.m_objectTableNVX; + } - enum class PipelineDiscardRectangleStateCreateFlagBitsEXT - { - }; + bool operator<(ObjectTableNVX const & rhs ) const + { + return m_objectTableNVX < rhs.m_objectTableNVX; + } - using PipelineDiscardRectangleStateCreateFlagsEXT = Flags; - enum class PipelineCoverageToColorStateCreateFlagBitsNV - { - }; - using PipelineCoverageToColorStateCreateFlagsNV = Flags; + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkObjectTableNVX() const + { + return m_objectTableNVX; + } - enum class PipelineCoverageModulationStateCreateFlagBitsNV - { - }; + explicit operator bool() const + { + return m_objectTableNVX != VK_NULL_HANDLE; + } - using PipelineCoverageModulationStateCreateFlagsNV = Flags; + bool operator!() const + { + return m_objectTableNVX == VK_NULL_HANDLE; + } - enum class ValidationCacheCreateFlagBitsEXT - { + private: + VkObjectTableNVX m_objectTableNVX; }; - using ValidationCacheCreateFlagsEXT = Flags; + static_assert( sizeof( ObjectTableNVX ) == sizeof( VkObjectTableNVX ), "handle and wrapper have different size!" ); - class DeviceMemory + class IndirectCommandsLayoutNVX { public: - DeviceMemory() - : m_deviceMemory(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR IndirectCommandsLayoutNVX() + : m_indirectCommandsLayoutNVX(VK_NULL_HANDLE) {} - DeviceMemory( std::nullptr_t ) - : m_deviceMemory(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR IndirectCommandsLayoutNVX( std::nullptr_t ) + : m_indirectCommandsLayoutNVX(VK_NULL_HANDLE) {} - VULKAN_HPP_TYPESAFE_EXPLICIT DeviceMemory( VkDeviceMemory deviceMemory ) - : m_deviceMemory( deviceMemory ) + VULKAN_HPP_TYPESAFE_EXPLICIT IndirectCommandsLayoutNVX( VkIndirectCommandsLayoutNVX indirectCommandsLayoutNVX ) + : m_indirectCommandsLayoutNVX( indirectCommandsLayoutNVX ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - DeviceMemory & operator=(VkDeviceMemory deviceMemory) + IndirectCommandsLayoutNVX & operator=(VkIndirectCommandsLayoutNVX indirectCommandsLayoutNVX) { - m_deviceMemory = deviceMemory; + m_indirectCommandsLayoutNVX = indirectCommandsLayoutNVX; return *this; } #endif - DeviceMemory & operator=( std::nullptr_t ) + IndirectCommandsLayoutNVX & operator=( std::nullptr_t ) { - m_deviceMemory = VK_NULL_HANDLE; + m_indirectCommandsLayoutNVX = VK_NULL_HANDLE; return *this; } - bool operator==( DeviceMemory const & rhs ) const + bool operator==( IndirectCommandsLayoutNVX const & rhs ) const { - return m_deviceMemory == rhs.m_deviceMemory; + return m_indirectCommandsLayoutNVX == rhs.m_indirectCommandsLayoutNVX; } - bool operator!=(DeviceMemory const & rhs ) const + bool operator!=(IndirectCommandsLayoutNVX const & rhs ) const { - return m_deviceMemory != rhs.m_deviceMemory; + return m_indirectCommandsLayoutNVX != rhs.m_indirectCommandsLayoutNVX; } - bool operator<(DeviceMemory const & rhs ) const + bool operator<(IndirectCommandsLayoutNVX const & rhs ) const { - return m_deviceMemory < rhs.m_deviceMemory; + return m_indirectCommandsLayoutNVX < rhs.m_indirectCommandsLayoutNVX; } - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDeviceMemory() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkIndirectCommandsLayoutNVX() const { - return m_deviceMemory; + return m_indirectCommandsLayoutNVX; } explicit operator bool() const { - return m_deviceMemory != VK_NULL_HANDLE; + return m_indirectCommandsLayoutNVX != VK_NULL_HANDLE; } bool operator!() const { - return m_deviceMemory == VK_NULL_HANDLE; + return m_indirectCommandsLayoutNVX == VK_NULL_HANDLE; } private: - VkDeviceMemory m_deviceMemory; + VkIndirectCommandsLayoutNVX m_indirectCommandsLayoutNVX; }; - static_assert( sizeof( DeviceMemory ) == sizeof( VkDeviceMemory ), "handle and wrapper have different size!" ); + static_assert( sizeof( IndirectCommandsLayoutNVX ) == sizeof( VkIndirectCommandsLayoutNVX ), "handle and wrapper have different size!" ); - class CommandPool + class DescriptorUpdateTemplate { public: - CommandPool() - : m_commandPool(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR DescriptorUpdateTemplate() + : m_descriptorUpdateTemplate(VK_NULL_HANDLE) {} - CommandPool( std::nullptr_t ) - : m_commandPool(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR DescriptorUpdateTemplate( std::nullptr_t ) + : m_descriptorUpdateTemplate(VK_NULL_HANDLE) {} - VULKAN_HPP_TYPESAFE_EXPLICIT CommandPool( VkCommandPool commandPool ) - : m_commandPool( commandPool ) + VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorUpdateTemplate( VkDescriptorUpdateTemplate descriptorUpdateTemplate ) + : m_descriptorUpdateTemplate( descriptorUpdateTemplate ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - CommandPool & operator=(VkCommandPool commandPool) + DescriptorUpdateTemplate & operator=(VkDescriptorUpdateTemplate descriptorUpdateTemplate) { - m_commandPool = commandPool; + m_descriptorUpdateTemplate = descriptorUpdateTemplate; return *this; } #endif - CommandPool & operator=( std::nullptr_t ) + DescriptorUpdateTemplate & operator=( std::nullptr_t ) { - m_commandPool = VK_NULL_HANDLE; + m_descriptorUpdateTemplate = VK_NULL_HANDLE; return *this; } - bool operator==( CommandPool const & rhs ) const + bool operator==( DescriptorUpdateTemplate const & rhs ) const { - return m_commandPool == rhs.m_commandPool; + return m_descriptorUpdateTemplate == rhs.m_descriptorUpdateTemplate; } - bool operator!=(CommandPool const & rhs ) const + bool operator!=(DescriptorUpdateTemplate const & rhs ) const { - return m_commandPool != rhs.m_commandPool; + return m_descriptorUpdateTemplate != rhs.m_descriptorUpdateTemplate; } - bool operator<(CommandPool const & rhs ) const + bool operator<(DescriptorUpdateTemplate const & rhs ) const { - return m_commandPool < rhs.m_commandPool; + return m_descriptorUpdateTemplate < rhs.m_descriptorUpdateTemplate; } - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkCommandPool() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDescriptorUpdateTemplate() const { - return m_commandPool; + return m_descriptorUpdateTemplate; } explicit operator bool() const { - return m_commandPool != VK_NULL_HANDLE; + return m_descriptorUpdateTemplate != VK_NULL_HANDLE; } bool operator!() const { - return m_commandPool == VK_NULL_HANDLE; + return m_descriptorUpdateTemplate == VK_NULL_HANDLE; } private: - VkCommandPool m_commandPool; + VkDescriptorUpdateTemplate m_descriptorUpdateTemplate; }; - static_assert( sizeof( CommandPool ) == sizeof( VkCommandPool ), "handle and wrapper have different size!" ); + static_assert( sizeof( DescriptorUpdateTemplate ) == sizeof( VkDescriptorUpdateTemplate ), "handle and wrapper have different size!" ); - class Buffer + using DescriptorUpdateTemplateKHR = DescriptorUpdateTemplate; + + class SamplerYcbcrConversion { public: - Buffer() - : m_buffer(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR SamplerYcbcrConversion() + : m_samplerYcbcrConversion(VK_NULL_HANDLE) {} - Buffer( std::nullptr_t ) - : m_buffer(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR SamplerYcbcrConversion( std::nullptr_t ) + : m_samplerYcbcrConversion(VK_NULL_HANDLE) {} - VULKAN_HPP_TYPESAFE_EXPLICIT Buffer( VkBuffer buffer ) - : m_buffer( buffer ) + VULKAN_HPP_TYPESAFE_EXPLICIT SamplerYcbcrConversion( VkSamplerYcbcrConversion samplerYcbcrConversion ) + : m_samplerYcbcrConversion( samplerYcbcrConversion ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Buffer & operator=(VkBuffer buffer) + SamplerYcbcrConversion & operator=(VkSamplerYcbcrConversion samplerYcbcrConversion) { - m_buffer = buffer; + m_samplerYcbcrConversion = samplerYcbcrConversion; return *this; } #endif - Buffer & operator=( std::nullptr_t ) + SamplerYcbcrConversion & operator=( std::nullptr_t ) { - m_buffer = VK_NULL_HANDLE; + m_samplerYcbcrConversion = VK_NULL_HANDLE; return *this; } - bool operator==( Buffer const & rhs ) const + bool operator==( SamplerYcbcrConversion const & rhs ) const { - return m_buffer == rhs.m_buffer; + return m_samplerYcbcrConversion == rhs.m_samplerYcbcrConversion; } - bool operator!=(Buffer const & rhs ) const + bool operator!=(SamplerYcbcrConversion const & rhs ) const { - return m_buffer != rhs.m_buffer; + return m_samplerYcbcrConversion != rhs.m_samplerYcbcrConversion; } - bool operator<(Buffer const & rhs ) const + bool operator<(SamplerYcbcrConversion const & rhs ) const { - return m_buffer < rhs.m_buffer; + return m_samplerYcbcrConversion < rhs.m_samplerYcbcrConversion; } - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkBuffer() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSamplerYcbcrConversion() const { - return m_buffer; + return m_samplerYcbcrConversion; } explicit operator bool() const { - return m_buffer != VK_NULL_HANDLE; + return m_samplerYcbcrConversion != VK_NULL_HANDLE; } bool operator!() const { - return m_buffer == VK_NULL_HANDLE; + return m_samplerYcbcrConversion == VK_NULL_HANDLE; } private: - VkBuffer m_buffer; + VkSamplerYcbcrConversion m_samplerYcbcrConversion; }; - static_assert( sizeof( Buffer ) == sizeof( VkBuffer ), "handle and wrapper have different size!" ); + static_assert( sizeof( SamplerYcbcrConversion ) == sizeof( VkSamplerYcbcrConversion ), "handle and wrapper have different size!" ); - class BufferView + using SamplerYcbcrConversionKHR = SamplerYcbcrConversion; + + class ValidationCacheEXT { public: - BufferView() - : m_bufferView(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR ValidationCacheEXT() + : m_validationCacheEXT(VK_NULL_HANDLE) {} - BufferView( std::nullptr_t ) - : m_bufferView(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR ValidationCacheEXT( std::nullptr_t ) + : m_validationCacheEXT(VK_NULL_HANDLE) {} - VULKAN_HPP_TYPESAFE_EXPLICIT BufferView( VkBufferView bufferView ) - : m_bufferView( bufferView ) + VULKAN_HPP_TYPESAFE_EXPLICIT ValidationCacheEXT( VkValidationCacheEXT validationCacheEXT ) + : m_validationCacheEXT( validationCacheEXT ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - BufferView & operator=(VkBufferView bufferView) + ValidationCacheEXT & operator=(VkValidationCacheEXT validationCacheEXT) { - m_bufferView = bufferView; + m_validationCacheEXT = validationCacheEXT; return *this; } #endif - BufferView & operator=( std::nullptr_t ) + ValidationCacheEXT & operator=( std::nullptr_t ) { - m_bufferView = VK_NULL_HANDLE; + m_validationCacheEXT = VK_NULL_HANDLE; return *this; } - bool operator==( BufferView const & rhs ) const + bool operator==( ValidationCacheEXT const & rhs ) const { - return m_bufferView == rhs.m_bufferView; + return m_validationCacheEXT == rhs.m_validationCacheEXT; } - bool operator!=(BufferView const & rhs ) const + bool operator!=(ValidationCacheEXT const & rhs ) const { - return m_bufferView != rhs.m_bufferView; + return m_validationCacheEXT != rhs.m_validationCacheEXT; } - bool operator<(BufferView const & rhs ) const + bool operator<(ValidationCacheEXT const & rhs ) const { - return m_bufferView < rhs.m_bufferView; + return m_validationCacheEXT < rhs.m_validationCacheEXT; } - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkBufferView() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkValidationCacheEXT() const { - return m_bufferView; + return m_validationCacheEXT; } explicit operator bool() const { - return m_bufferView != VK_NULL_HANDLE; + return m_validationCacheEXT != VK_NULL_HANDLE; } bool operator!() const { - return m_bufferView == VK_NULL_HANDLE; + return m_validationCacheEXT == VK_NULL_HANDLE; } private: - VkBufferView m_bufferView; + VkValidationCacheEXT m_validationCacheEXT; }; - static_assert( sizeof( BufferView ) == sizeof( VkBufferView ), "handle and wrapper have different size!" ); + static_assert( sizeof( ValidationCacheEXT ) == sizeof( VkValidationCacheEXT ), "handle and wrapper have different size!" ); - class Image + class DisplayKHR { public: - Image() - : m_image(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR DisplayKHR() + : m_displayKHR(VK_NULL_HANDLE) {} - Image( std::nullptr_t ) - : m_image(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR DisplayKHR( std::nullptr_t ) + : m_displayKHR(VK_NULL_HANDLE) {} - VULKAN_HPP_TYPESAFE_EXPLICIT Image( VkImage image ) - : m_image( image ) + VULKAN_HPP_TYPESAFE_EXPLICIT DisplayKHR( VkDisplayKHR displayKHR ) + : m_displayKHR( displayKHR ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Image & operator=(VkImage image) + DisplayKHR & operator=(VkDisplayKHR displayKHR) { - m_image = image; + m_displayKHR = displayKHR; return *this; } #endif - Image & operator=( std::nullptr_t ) + DisplayKHR & operator=( std::nullptr_t ) { - m_image = VK_NULL_HANDLE; + m_displayKHR = VK_NULL_HANDLE; return *this; } - bool operator==( Image const & rhs ) const + bool operator==( DisplayKHR const & rhs ) const { - return m_image == rhs.m_image; + return m_displayKHR == rhs.m_displayKHR; } - bool operator!=(Image const & rhs ) const + bool operator!=(DisplayKHR const & rhs ) const { - return m_image != rhs.m_image; + return m_displayKHR != rhs.m_displayKHR; } - bool operator<(Image const & rhs ) const + bool operator<(DisplayKHR const & rhs ) const { - return m_image < rhs.m_image; + return m_displayKHR < rhs.m_displayKHR; } - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkImage() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDisplayKHR() const { - return m_image; + return m_displayKHR; } explicit operator bool() const { - return m_image != VK_NULL_HANDLE; + return m_displayKHR != VK_NULL_HANDLE; } bool operator!() const { - return m_image == VK_NULL_HANDLE; + return m_displayKHR == VK_NULL_HANDLE; } private: - VkImage m_image; + VkDisplayKHR m_displayKHR; }; - static_assert( sizeof( Image ) == sizeof( VkImage ), "handle and wrapper have different size!" ); + static_assert( sizeof( DisplayKHR ) == sizeof( VkDisplayKHR ), "handle and wrapper have different size!" ); - class ImageView + class DisplayModeKHR { public: - ImageView() - : m_imageView(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR DisplayModeKHR() + : m_displayModeKHR(VK_NULL_HANDLE) {} - ImageView( std::nullptr_t ) - : m_imageView(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR DisplayModeKHR( std::nullptr_t ) + : m_displayModeKHR(VK_NULL_HANDLE) {} - VULKAN_HPP_TYPESAFE_EXPLICIT ImageView( VkImageView imageView ) - : m_imageView( imageView ) + VULKAN_HPP_TYPESAFE_EXPLICIT DisplayModeKHR( VkDisplayModeKHR displayModeKHR ) + : m_displayModeKHR( displayModeKHR ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - ImageView & operator=(VkImageView imageView) + DisplayModeKHR & operator=(VkDisplayModeKHR displayModeKHR) { - m_imageView = imageView; + m_displayModeKHR = displayModeKHR; return *this; } #endif - ImageView & operator=( std::nullptr_t ) + DisplayModeKHR & operator=( std::nullptr_t ) { - m_imageView = VK_NULL_HANDLE; + m_displayModeKHR = VK_NULL_HANDLE; return *this; } - bool operator==( ImageView const & rhs ) const + bool operator==( DisplayModeKHR const & rhs ) const { - return m_imageView == rhs.m_imageView; + return m_displayModeKHR == rhs.m_displayModeKHR; } - bool operator!=(ImageView const & rhs ) const + bool operator!=(DisplayModeKHR const & rhs ) const { - return m_imageView != rhs.m_imageView; + return m_displayModeKHR != rhs.m_displayModeKHR; } - bool operator<(ImageView const & rhs ) const + bool operator<(DisplayModeKHR const & rhs ) const { - return m_imageView < rhs.m_imageView; + return m_displayModeKHR < rhs.m_displayModeKHR; } - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkImageView() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDisplayModeKHR() const { - return m_imageView; + return m_displayModeKHR; } explicit operator bool() const { - return m_imageView != VK_NULL_HANDLE; + return m_displayModeKHR != VK_NULL_HANDLE; } bool operator!() const { - return m_imageView == VK_NULL_HANDLE; + return m_displayModeKHR == VK_NULL_HANDLE; } private: - VkImageView m_imageView; + VkDisplayModeKHR m_displayModeKHR; }; - static_assert( sizeof( ImageView ) == sizeof( VkImageView ), "handle and wrapper have different size!" ); + static_assert( sizeof( DisplayModeKHR ) == sizeof( VkDisplayModeKHR ), "handle and wrapper have different size!" ); - class ShaderModule + class SurfaceKHR { public: - ShaderModule() - : m_shaderModule(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR SurfaceKHR() + : m_surfaceKHR(VK_NULL_HANDLE) {} - ShaderModule( std::nullptr_t ) - : m_shaderModule(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR SurfaceKHR( std::nullptr_t ) + : m_surfaceKHR(VK_NULL_HANDLE) {} - VULKAN_HPP_TYPESAFE_EXPLICIT ShaderModule( VkShaderModule shaderModule ) - : m_shaderModule( shaderModule ) + VULKAN_HPP_TYPESAFE_EXPLICIT SurfaceKHR( VkSurfaceKHR surfaceKHR ) + : m_surfaceKHR( surfaceKHR ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - ShaderModule & operator=(VkShaderModule shaderModule) + SurfaceKHR & operator=(VkSurfaceKHR surfaceKHR) { - m_shaderModule = shaderModule; + m_surfaceKHR = surfaceKHR; return *this; } #endif - ShaderModule & operator=( std::nullptr_t ) + SurfaceKHR & operator=( std::nullptr_t ) { - m_shaderModule = VK_NULL_HANDLE; + m_surfaceKHR = VK_NULL_HANDLE; return *this; } - bool operator==( ShaderModule const & rhs ) const + bool operator==( SurfaceKHR const & rhs ) const { - return m_shaderModule == rhs.m_shaderModule; + return m_surfaceKHR == rhs.m_surfaceKHR; } - bool operator!=(ShaderModule const & rhs ) const + bool operator!=(SurfaceKHR const & rhs ) const { - return m_shaderModule != rhs.m_shaderModule; + return m_surfaceKHR != rhs.m_surfaceKHR; } - bool operator<(ShaderModule const & rhs ) const + bool operator<(SurfaceKHR const & rhs ) const { - return m_shaderModule < rhs.m_shaderModule; + return m_surfaceKHR < rhs.m_surfaceKHR; } - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkShaderModule() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSurfaceKHR() const { - return m_shaderModule; + return m_surfaceKHR; } explicit operator bool() const { - return m_shaderModule != VK_NULL_HANDLE; + return m_surfaceKHR != VK_NULL_HANDLE; } bool operator!() const { - return m_shaderModule == VK_NULL_HANDLE; + return m_surfaceKHR == VK_NULL_HANDLE; } private: - VkShaderModule m_shaderModule; + VkSurfaceKHR m_surfaceKHR; }; - static_assert( sizeof( ShaderModule ) == sizeof( VkShaderModule ), "handle and wrapper have different size!" ); + static_assert( sizeof( SurfaceKHR ) == sizeof( VkSurfaceKHR ), "handle and wrapper have different size!" ); - class Pipeline + class SwapchainKHR { public: - Pipeline() - : m_pipeline(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR SwapchainKHR() + : m_swapchainKHR(VK_NULL_HANDLE) {} - Pipeline( std::nullptr_t ) - : m_pipeline(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR SwapchainKHR( std::nullptr_t ) + : m_swapchainKHR(VK_NULL_HANDLE) {} - VULKAN_HPP_TYPESAFE_EXPLICIT Pipeline( VkPipeline pipeline ) - : m_pipeline( pipeline ) + VULKAN_HPP_TYPESAFE_EXPLICIT SwapchainKHR( VkSwapchainKHR swapchainKHR ) + : m_swapchainKHR( swapchainKHR ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Pipeline & operator=(VkPipeline pipeline) + SwapchainKHR & operator=(VkSwapchainKHR swapchainKHR) { - m_pipeline = pipeline; + m_swapchainKHR = swapchainKHR; return *this; } #endif - Pipeline & operator=( std::nullptr_t ) + SwapchainKHR & operator=( std::nullptr_t ) { - m_pipeline = VK_NULL_HANDLE; + m_swapchainKHR = VK_NULL_HANDLE; return *this; } - bool operator==( Pipeline const & rhs ) const + bool operator==( SwapchainKHR const & rhs ) const { - return m_pipeline == rhs.m_pipeline; + return m_swapchainKHR == rhs.m_swapchainKHR; } - bool operator!=(Pipeline const & rhs ) const + bool operator!=(SwapchainKHR const & rhs ) const { - return m_pipeline != rhs.m_pipeline; + return m_swapchainKHR != rhs.m_swapchainKHR; } - bool operator<(Pipeline const & rhs ) const + bool operator<(SwapchainKHR const & rhs ) const { - return m_pipeline < rhs.m_pipeline; + return m_swapchainKHR < rhs.m_swapchainKHR; } - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkPipeline() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSwapchainKHR() const { - return m_pipeline; + return m_swapchainKHR; } explicit operator bool() const { - return m_pipeline != VK_NULL_HANDLE; + return m_swapchainKHR != VK_NULL_HANDLE; } bool operator!() const { - return m_pipeline == VK_NULL_HANDLE; + return m_swapchainKHR == VK_NULL_HANDLE; } private: - VkPipeline m_pipeline; + VkSwapchainKHR m_swapchainKHR; }; - static_assert( sizeof( Pipeline ) == sizeof( VkPipeline ), "handle and wrapper have different size!" ); + static_assert( sizeof( SwapchainKHR ) == sizeof( VkSwapchainKHR ), "handle and wrapper have different size!" ); - class PipelineLayout + class DebugReportCallbackEXT { public: - PipelineLayout() - : m_pipelineLayout(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR DebugReportCallbackEXT() + : m_debugReportCallbackEXT(VK_NULL_HANDLE) {} - PipelineLayout( std::nullptr_t ) - : m_pipelineLayout(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR DebugReportCallbackEXT( std::nullptr_t ) + : m_debugReportCallbackEXT(VK_NULL_HANDLE) {} - VULKAN_HPP_TYPESAFE_EXPLICIT PipelineLayout( VkPipelineLayout pipelineLayout ) - : m_pipelineLayout( pipelineLayout ) + VULKAN_HPP_TYPESAFE_EXPLICIT DebugReportCallbackEXT( VkDebugReportCallbackEXT debugReportCallbackEXT ) + : m_debugReportCallbackEXT( debugReportCallbackEXT ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - PipelineLayout & operator=(VkPipelineLayout pipelineLayout) + DebugReportCallbackEXT & operator=(VkDebugReportCallbackEXT debugReportCallbackEXT) { - m_pipelineLayout = pipelineLayout; + m_debugReportCallbackEXT = debugReportCallbackEXT; return *this; } #endif - PipelineLayout & operator=( std::nullptr_t ) + DebugReportCallbackEXT & operator=( std::nullptr_t ) { - m_pipelineLayout = VK_NULL_HANDLE; + m_debugReportCallbackEXT = VK_NULL_HANDLE; return *this; } - bool operator==( PipelineLayout const & rhs ) const + bool operator==( DebugReportCallbackEXT const & rhs ) const { - return m_pipelineLayout == rhs.m_pipelineLayout; + return m_debugReportCallbackEXT == rhs.m_debugReportCallbackEXT; } - bool operator!=(PipelineLayout const & rhs ) const + bool operator!=(DebugReportCallbackEXT const & rhs ) const { - return m_pipelineLayout != rhs.m_pipelineLayout; + return m_debugReportCallbackEXT != rhs.m_debugReportCallbackEXT; } - bool operator<(PipelineLayout const & rhs ) const + bool operator<(DebugReportCallbackEXT const & rhs ) const { - return m_pipelineLayout < rhs.m_pipelineLayout; + return m_debugReportCallbackEXT < rhs.m_debugReportCallbackEXT; } - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkPipelineLayout() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDebugReportCallbackEXT() const { - return m_pipelineLayout; + return m_debugReportCallbackEXT; } explicit operator bool() const { - return m_pipelineLayout != VK_NULL_HANDLE; + return m_debugReportCallbackEXT != VK_NULL_HANDLE; } bool operator!() const { - return m_pipelineLayout == VK_NULL_HANDLE; + return m_debugReportCallbackEXT == VK_NULL_HANDLE; } private: - VkPipelineLayout m_pipelineLayout; + VkDebugReportCallbackEXT m_debugReportCallbackEXT; }; - static_assert( sizeof( PipelineLayout ) == sizeof( VkPipelineLayout ), "handle and wrapper have different size!" ); + static_assert( sizeof( DebugReportCallbackEXT ) == sizeof( VkDebugReportCallbackEXT ), "handle and wrapper have different size!" ); - class Sampler + class DebugUtilsMessengerEXT { public: - Sampler() - : m_sampler(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR DebugUtilsMessengerEXT() + : m_debugUtilsMessengerEXT(VK_NULL_HANDLE) {} - Sampler( std::nullptr_t ) - : m_sampler(VK_NULL_HANDLE) + VULKAN_HPP_CONSTEXPR DebugUtilsMessengerEXT( std::nullptr_t ) + : m_debugUtilsMessengerEXT(VK_NULL_HANDLE) {} - VULKAN_HPP_TYPESAFE_EXPLICIT Sampler( VkSampler sampler ) - : m_sampler( sampler ) + VULKAN_HPP_TYPESAFE_EXPLICIT DebugUtilsMessengerEXT( VkDebugUtilsMessengerEXT debugUtilsMessengerEXT ) + : m_debugUtilsMessengerEXT( debugUtilsMessengerEXT ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Sampler & operator=(VkSampler sampler) + DebugUtilsMessengerEXT & operator=(VkDebugUtilsMessengerEXT debugUtilsMessengerEXT) { - m_sampler = sampler; + m_debugUtilsMessengerEXT = debugUtilsMessengerEXT; return *this; } #endif - Sampler & operator=( std::nullptr_t ) + DebugUtilsMessengerEXT & operator=( std::nullptr_t ) { - m_sampler = VK_NULL_HANDLE; + m_debugUtilsMessengerEXT = VK_NULL_HANDLE; return *this; } - bool operator==( Sampler const & rhs ) const + bool operator==( DebugUtilsMessengerEXT const & rhs ) const { - return m_sampler == rhs.m_sampler; + return m_debugUtilsMessengerEXT == rhs.m_debugUtilsMessengerEXT; } - bool operator!=(Sampler const & rhs ) const + bool operator!=(DebugUtilsMessengerEXT const & rhs ) const { - return m_sampler != rhs.m_sampler; + return m_debugUtilsMessengerEXT != rhs.m_debugUtilsMessengerEXT; } - bool operator<(Sampler const & rhs ) const + bool operator<(DebugUtilsMessengerEXT const & rhs ) const { - return m_sampler < rhs.m_sampler; + return m_debugUtilsMessengerEXT < rhs.m_debugUtilsMessengerEXT; } - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSampler() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDebugUtilsMessengerEXT() const { - return m_sampler; + return m_debugUtilsMessengerEXT; } explicit operator bool() const { - return m_sampler != VK_NULL_HANDLE; + return m_debugUtilsMessengerEXT != VK_NULL_HANDLE; } bool operator!() const { - return m_sampler == VK_NULL_HANDLE; + return m_debugUtilsMessengerEXT == VK_NULL_HANDLE; } private: - VkSampler m_sampler; + VkDebugUtilsMessengerEXT m_debugUtilsMessengerEXT; }; - static_assert( sizeof( Sampler ) == sizeof( VkSampler ), "handle and wrapper have different size!" ); + static_assert( sizeof( DebugUtilsMessengerEXT ) == sizeof( VkDebugUtilsMessengerEXT ), "handle and wrapper have different size!" ); - class DescriptorSet + struct Offset2D { - public: - DescriptorSet() - : m_descriptorSet(VK_NULL_HANDLE) - {} - - DescriptorSet( std::nullptr_t ) - : m_descriptorSet(VK_NULL_HANDLE) - {} + Offset2D( int32_t x_ = 0, int32_t y_ = 0 ) + : x( x_ ) + , y( y_ ) + { + } - VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorSet( VkDescriptorSet descriptorSet ) - : m_descriptorSet( descriptorSet ) - {} + Offset2D( VkOffset2D const & rhs ) + { + memcpy( this, &rhs, sizeof( Offset2D ) ); + } -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - DescriptorSet & operator=(VkDescriptorSet descriptorSet) + Offset2D& operator=( VkOffset2D const & rhs ) { - m_descriptorSet = descriptorSet; - return *this; + memcpy( this, &rhs, sizeof( Offset2D ) ); + return *this; + } + Offset2D& setX( int32_t x_ ) + { + x = x_; + return *this; } -#endif - DescriptorSet & operator=( std::nullptr_t ) + Offset2D& setY( int32_t y_ ) { - m_descriptorSet = VK_NULL_HANDLE; + y = y_; return *this; } - bool operator==( DescriptorSet const & rhs ) const + operator const VkOffset2D&() const { - return m_descriptorSet == rhs.m_descriptorSet; + return *reinterpret_cast(this); } - bool operator!=(DescriptorSet const & rhs ) const + bool operator==( Offset2D const& rhs ) const { - return m_descriptorSet != rhs.m_descriptorSet; + return ( x == rhs.x ) + && ( y == rhs.y ); } - bool operator<(DescriptorSet const & rhs ) const + bool operator!=( Offset2D const& rhs ) const { - return m_descriptorSet < rhs.m_descriptorSet; + return !operator==( rhs ); } + int32_t x; + int32_t y; + }; + static_assert( sizeof( Offset2D ) == sizeof( VkOffset2D ), "struct and wrapper have different size!" ); + struct Offset3D + { + Offset3D( int32_t x_ = 0, int32_t y_ = 0, int32_t z_ = 0 ) + : x( x_ ) + , y( y_ ) + , z( z_ ) + { + } - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDescriptorSet() const + Offset3D( VkOffset3D const & rhs ) { - return m_descriptorSet; + memcpy( this, &rhs, sizeof( Offset3D ) ); } - explicit operator bool() const + Offset3D& operator=( VkOffset3D const & rhs ) { - return m_descriptorSet != VK_NULL_HANDLE; + memcpy( this, &rhs, sizeof( Offset3D ) ); + return *this; + } + Offset3D& setX( int32_t x_ ) + { + x = x_; + return *this; } - bool operator!() const + Offset3D& setY( int32_t y_ ) { - return m_descriptorSet == VK_NULL_HANDLE; + y = y_; + return *this; } - private: - VkDescriptorSet m_descriptorSet; - }; + Offset3D& setZ( int32_t z_ ) + { + z = z_; + return *this; + } - static_assert( sizeof( DescriptorSet ) == sizeof( VkDescriptorSet ), "handle and wrapper have different size!" ); + operator const VkOffset3D&() const + { + return *reinterpret_cast(this); + } - class DescriptorSetLayout - { - public: - DescriptorSetLayout() - : m_descriptorSetLayout(VK_NULL_HANDLE) - {} + bool operator==( Offset3D const& rhs ) const + { + return ( x == rhs.x ) + && ( y == rhs.y ) + && ( z == rhs.z ); + } - DescriptorSetLayout( std::nullptr_t ) - : m_descriptorSetLayout(VK_NULL_HANDLE) - {} + bool operator!=( Offset3D const& rhs ) const + { + return !operator==( rhs ); + } - VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorSetLayout( VkDescriptorSetLayout descriptorSetLayout ) - : m_descriptorSetLayout( descriptorSetLayout ) - {} + int32_t x; + int32_t y; + int32_t z; + }; + static_assert( sizeof( Offset3D ) == sizeof( VkOffset3D ), "struct and wrapper have different size!" ); -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - DescriptorSetLayout & operator=(VkDescriptorSetLayout descriptorSetLayout) + struct Extent2D + { + Extent2D( uint32_t width_ = 0, uint32_t height_ = 0 ) + : width( width_ ) + , height( height_ ) { - m_descriptorSetLayout = descriptorSetLayout; - return *this; } -#endif - DescriptorSetLayout & operator=( std::nullptr_t ) + Extent2D( VkExtent2D const & rhs ) { - m_descriptorSetLayout = VK_NULL_HANDLE; - return *this; + memcpy( this, &rhs, sizeof( Extent2D ) ); } - bool operator==( DescriptorSetLayout const & rhs ) const + Extent2D& operator=( VkExtent2D const & rhs ) { - return m_descriptorSetLayout == rhs.m_descriptorSetLayout; + memcpy( this, &rhs, sizeof( Extent2D ) ); + return *this; } - - bool operator!=(DescriptorSetLayout const & rhs ) const + Extent2D& setWidth( uint32_t width_ ) { - return m_descriptorSetLayout != rhs.m_descriptorSetLayout; + width = width_; + return *this; } - bool operator<(DescriptorSetLayout const & rhs ) const + Extent2D& setHeight( uint32_t height_ ) { - return m_descriptorSetLayout < rhs.m_descriptorSetLayout; + height = height_; + return *this; } - - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDescriptorSetLayout() const + operator const VkExtent2D&() const { - return m_descriptorSetLayout; + return *reinterpret_cast(this); } - explicit operator bool() const + bool operator==( Extent2D const& rhs ) const { - return m_descriptorSetLayout != VK_NULL_HANDLE; + return ( width == rhs.width ) + && ( height == rhs.height ); } - bool operator!() const + bool operator!=( Extent2D const& rhs ) const { - return m_descriptorSetLayout == VK_NULL_HANDLE; + return !operator==( rhs ); } - private: - VkDescriptorSetLayout m_descriptorSetLayout; + uint32_t width; + uint32_t height; }; + static_assert( sizeof( Extent2D ) == sizeof( VkExtent2D ), "struct and wrapper have different size!" ); - static_assert( sizeof( DescriptorSetLayout ) == sizeof( VkDescriptorSetLayout ), "handle and wrapper have different size!" ); - - class DescriptorPool + struct Extent3D { - public: - DescriptorPool() - : m_descriptorPool(VK_NULL_HANDLE) - {} - - DescriptorPool( std::nullptr_t ) - : m_descriptorPool(VK_NULL_HANDLE) - {} - - VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorPool( VkDescriptorPool descriptorPool ) - : m_descriptorPool( descriptorPool ) - {} + Extent3D( uint32_t width_ = 0, uint32_t height_ = 0, uint32_t depth_ = 0 ) + : width( width_ ) + , height( height_ ) + , depth( depth_ ) + { + } -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - DescriptorPool & operator=(VkDescriptorPool descriptorPool) + Extent3D( VkExtent3D const & rhs ) { - m_descriptorPool = descriptorPool; - return *this; + memcpy( this, &rhs, sizeof( Extent3D ) ); } -#endif - DescriptorPool & operator=( std::nullptr_t ) + Extent3D& operator=( VkExtent3D const & rhs ) { - m_descriptorPool = VK_NULL_HANDLE; + memcpy( this, &rhs, sizeof( Extent3D ) ); return *this; } - - bool operator==( DescriptorPool const & rhs ) const + Extent3D& setWidth( uint32_t width_ ) { - return m_descriptorPool == rhs.m_descriptorPool; + width = width_; + return *this; } - bool operator!=(DescriptorPool const & rhs ) const + Extent3D& setHeight( uint32_t height_ ) { - return m_descriptorPool != rhs.m_descriptorPool; + height = height_; + return *this; } - bool operator<(DescriptorPool const & rhs ) const + Extent3D& setDepth( uint32_t depth_ ) { - return m_descriptorPool < rhs.m_descriptorPool; + depth = depth_; + return *this; } - - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDescriptorPool() const + operator const VkExtent3D&() const { - return m_descriptorPool; + return *reinterpret_cast(this); } - explicit operator bool() const + bool operator==( Extent3D const& rhs ) const { - return m_descriptorPool != VK_NULL_HANDLE; + return ( width == rhs.width ) + && ( height == rhs.height ) + && ( depth == rhs.depth ); } - bool operator!() const + bool operator!=( Extent3D const& rhs ) const { - return m_descriptorPool == VK_NULL_HANDLE; + return !operator==( rhs ); } - private: - VkDescriptorPool m_descriptorPool; + uint32_t width; + uint32_t height; + uint32_t depth; }; + static_assert( sizeof( Extent3D ) == sizeof( VkExtent3D ), "struct and wrapper have different size!" ); - static_assert( sizeof( DescriptorPool ) == sizeof( VkDescriptorPool ), "handle and wrapper have different size!" ); - - class Fence + struct Viewport { - public: - Fence() - : m_fence(VK_NULL_HANDLE) - {} - - Fence( std::nullptr_t ) - : m_fence(VK_NULL_HANDLE) - {} - - VULKAN_HPP_TYPESAFE_EXPLICIT Fence( VkFence fence ) - : m_fence( fence ) - {} + Viewport( float x_ = 0, float y_ = 0, float width_ = 0, float height_ = 0, float minDepth_ = 0, float maxDepth_ = 0 ) + : x( x_ ) + , y( y_ ) + , width( width_ ) + , height( height_ ) + , minDepth( minDepth_ ) + , maxDepth( maxDepth_ ) + { + } -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Fence & operator=(VkFence fence) + Viewport( VkViewport const & rhs ) { - m_fence = fence; - return *this; + memcpy( this, &rhs, sizeof( Viewport ) ); } -#endif - Fence & operator=( std::nullptr_t ) + Viewport& operator=( VkViewport const & rhs ) { - m_fence = VK_NULL_HANDLE; + memcpy( this, &rhs, sizeof( Viewport ) ); + return *this; + } + Viewport& setX( float x_ ) + { + x = x_; return *this; } - bool operator==( Fence const & rhs ) const + Viewport& setY( float y_ ) { - return m_fence == rhs.m_fence; + y = y_; + return *this; } - bool operator!=(Fence const & rhs ) const + Viewport& setWidth( float width_ ) { - return m_fence != rhs.m_fence; + width = width_; + return *this; } - bool operator<(Fence const & rhs ) const + Viewport& setHeight( float height_ ) { - return m_fence < rhs.m_fence; + height = height_; + return *this; } + Viewport& setMinDepth( float minDepth_ ) + { + minDepth = minDepth_; + return *this; + } + Viewport& setMaxDepth( float maxDepth_ ) + { + maxDepth = maxDepth_; + return *this; + } - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkFence() const + operator const VkViewport&() const { - return m_fence; + return *reinterpret_cast(this); } - explicit operator bool() const + bool operator==( Viewport const& rhs ) const { - return m_fence != VK_NULL_HANDLE; + return ( x == rhs.x ) + && ( y == rhs.y ) + && ( width == rhs.width ) + && ( height == rhs.height ) + && ( minDepth == rhs.minDepth ) + && ( maxDepth == rhs.maxDepth ); } - bool operator!() const + bool operator!=( Viewport const& rhs ) const { - return m_fence == VK_NULL_HANDLE; + return !operator==( rhs ); } - private: - VkFence m_fence; + float x; + float y; + float width; + float height; + float minDepth; + float maxDepth; }; + static_assert( sizeof( Viewport ) == sizeof( VkViewport ), "struct and wrapper have different size!" ); - static_assert( sizeof( Fence ) == sizeof( VkFence ), "handle and wrapper have different size!" ); - - class Semaphore + struct Rect2D { - public: - Semaphore() - : m_semaphore(VK_NULL_HANDLE) - {} - - Semaphore( std::nullptr_t ) - : m_semaphore(VK_NULL_HANDLE) - {} + Rect2D( Offset2D offset_ = Offset2D(), Extent2D extent_ = Extent2D() ) + : offset( offset_ ) + , extent( extent_ ) + { + } - VULKAN_HPP_TYPESAFE_EXPLICIT Semaphore( VkSemaphore semaphore ) - : m_semaphore( semaphore ) - {} + Rect2D( VkRect2D const & rhs ) + { + memcpy( this, &rhs, sizeof( Rect2D ) ); + } -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Semaphore & operator=(VkSemaphore semaphore) + Rect2D& operator=( VkRect2D const & rhs ) { - m_semaphore = semaphore; - return *this; + memcpy( this, &rhs, sizeof( Rect2D ) ); + return *this; + } + Rect2D& setOffset( Offset2D offset_ ) + { + offset = offset_; + return *this; } -#endif - Semaphore & operator=( std::nullptr_t ) + Rect2D& setExtent( Extent2D extent_ ) { - m_semaphore = VK_NULL_HANDLE; + extent = extent_; return *this; } - bool operator==( Semaphore const & rhs ) const + operator const VkRect2D&() const { - return m_semaphore == rhs.m_semaphore; + return *reinterpret_cast(this); } - bool operator!=(Semaphore const & rhs ) const + bool operator==( Rect2D const& rhs ) const { - return m_semaphore != rhs.m_semaphore; + return ( offset == rhs.offset ) + && ( extent == rhs.extent ); } - bool operator<(Semaphore const & rhs ) const + bool operator!=( Rect2D const& rhs ) const { - return m_semaphore < rhs.m_semaphore; + return !operator==( rhs ); } + Offset2D offset; + Extent2D extent; + }; + static_assert( sizeof( Rect2D ) == sizeof( VkRect2D ), "struct and wrapper have different size!" ); + struct ClearRect + { + ClearRect( Rect2D rect_ = Rect2D(), uint32_t baseArrayLayer_ = 0, uint32_t layerCount_ = 0 ) + : rect( rect_ ) + , baseArrayLayer( baseArrayLayer_ ) + , layerCount( layerCount_ ) + { + } - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSemaphore() const + ClearRect( VkClearRect const & rhs ) { - return m_semaphore; + memcpy( this, &rhs, sizeof( ClearRect ) ); } - explicit operator bool() const + ClearRect& operator=( VkClearRect const & rhs ) { - return m_semaphore != VK_NULL_HANDLE; + memcpy( this, &rhs, sizeof( ClearRect ) ); + return *this; } - - bool operator!() const + ClearRect& setRect( Rect2D rect_ ) { - return m_semaphore == VK_NULL_HANDLE; + rect = rect_; + return *this; } - private: - VkSemaphore m_semaphore; - }; - - static_assert( sizeof( Semaphore ) == sizeof( VkSemaphore ), "handle and wrapper have different size!" ); - - class Event - { - public: - Event() - : m_event(VK_NULL_HANDLE) - {} - - Event( std::nullptr_t ) - : m_event(VK_NULL_HANDLE) - {} - - VULKAN_HPP_TYPESAFE_EXPLICIT Event( VkEvent event ) - : m_event( event ) - {} - -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Event & operator=(VkEvent event) + ClearRect& setBaseArrayLayer( uint32_t baseArrayLayer_ ) { - m_event = event; - return *this; + baseArrayLayer = baseArrayLayer_; + return *this; } -#endif - Event & operator=( std::nullptr_t ) + ClearRect& setLayerCount( uint32_t layerCount_ ) { - m_event = VK_NULL_HANDLE; + layerCount = layerCount_; return *this; } - bool operator==( Event const & rhs ) const + operator const VkClearRect&() const { - return m_event == rhs.m_event; + return *reinterpret_cast(this); } - bool operator!=(Event const & rhs ) const + bool operator==( ClearRect const& rhs ) const { - return m_event != rhs.m_event; + return ( rect == rhs.rect ) + && ( baseArrayLayer == rhs.baseArrayLayer ) + && ( layerCount == rhs.layerCount ); } - bool operator<(Event const & rhs ) const + bool operator!=( ClearRect const& rhs ) const { - return m_event < rhs.m_event; + return !operator==( rhs ); } + Rect2D rect; + uint32_t baseArrayLayer; + uint32_t layerCount; + }; + static_assert( sizeof( ClearRect ) == sizeof( VkClearRect ), "struct and wrapper have different size!" ); - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkEvent() const + struct ExtensionProperties + { + operator const VkExtensionProperties&() const { - return m_event; + return *reinterpret_cast(this); } - explicit operator bool() const + bool operator==( ExtensionProperties const& rhs ) const { - return m_event != VK_NULL_HANDLE; + return ( memcmp( extensionName, rhs.extensionName, VK_MAX_EXTENSION_NAME_SIZE * sizeof( char ) ) == 0 ) + && ( specVersion == rhs.specVersion ); } - bool operator!() const + bool operator!=( ExtensionProperties const& rhs ) const { - return m_event == VK_NULL_HANDLE; + return !operator==( rhs ); } - private: - VkEvent m_event; + char extensionName[VK_MAX_EXTENSION_NAME_SIZE]; + uint32_t specVersion; }; + static_assert( sizeof( ExtensionProperties ) == sizeof( VkExtensionProperties ), "struct and wrapper have different size!" ); - static_assert( sizeof( Event ) == sizeof( VkEvent ), "handle and wrapper have different size!" ); - - class QueryPool + struct LayerProperties { - public: - QueryPool() - : m_queryPool(VK_NULL_HANDLE) - {} - - QueryPool( std::nullptr_t ) - : m_queryPool(VK_NULL_HANDLE) - {} - - VULKAN_HPP_TYPESAFE_EXPLICIT QueryPool( VkQueryPool queryPool ) - : m_queryPool( queryPool ) - {} - -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - QueryPool & operator=(VkQueryPool queryPool) + operator const VkLayerProperties&() const { - m_queryPool = queryPool; - return *this; + return *reinterpret_cast(this); } -#endif - QueryPool & operator=( std::nullptr_t ) + bool operator==( LayerProperties const& rhs ) const { - m_queryPool = VK_NULL_HANDLE; - return *this; + return ( memcmp( layerName, rhs.layerName, VK_MAX_EXTENSION_NAME_SIZE * sizeof( char ) ) == 0 ) + && ( specVersion == rhs.specVersion ) + && ( implementationVersion == rhs.implementationVersion ) + && ( memcmp( description, rhs.description, VK_MAX_DESCRIPTION_SIZE * sizeof( char ) ) == 0 ); } - bool operator==( QueryPool const & rhs ) const + bool operator!=( LayerProperties const& rhs ) const { - return m_queryPool == rhs.m_queryPool; + return !operator==( rhs ); } - bool operator!=(QueryPool const & rhs ) const + char layerName[VK_MAX_EXTENSION_NAME_SIZE]; + uint32_t specVersion; + uint32_t implementationVersion; + char description[VK_MAX_DESCRIPTION_SIZE]; + }; + static_assert( sizeof( LayerProperties ) == sizeof( VkLayerProperties ), "struct and wrapper have different size!" ); + + struct AllocationCallbacks + { + AllocationCallbacks( void* pUserData_ = nullptr, PFN_vkAllocationFunction pfnAllocation_ = nullptr, PFN_vkReallocationFunction pfnReallocation_ = nullptr, PFN_vkFreeFunction pfnFree_ = nullptr, PFN_vkInternalAllocationNotification pfnInternalAllocation_ = nullptr, PFN_vkInternalFreeNotification pfnInternalFree_ = nullptr ) + : pUserData( pUserData_ ) + , pfnAllocation( pfnAllocation_ ) + , pfnReallocation( pfnReallocation_ ) + , pfnFree( pfnFree_ ) + , pfnInternalAllocation( pfnInternalAllocation_ ) + , pfnInternalFree( pfnInternalFree_ ) { - return m_queryPool != rhs.m_queryPool; } - bool operator<(QueryPool const & rhs ) const + AllocationCallbacks( VkAllocationCallbacks const & rhs ) { - return m_queryPool < rhs.m_queryPool; + memcpy( this, &rhs, sizeof( AllocationCallbacks ) ); } - - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkQueryPool() const + AllocationCallbacks& operator=( VkAllocationCallbacks const & rhs ) { - return m_queryPool; + memcpy( this, &rhs, sizeof( AllocationCallbacks ) ); + return *this; } - - explicit operator bool() const + AllocationCallbacks& setPUserData( void* pUserData_ ) { - return m_queryPool != VK_NULL_HANDLE; + pUserData = pUserData_; + return *this; } - bool operator!() const + AllocationCallbacks& setPfnAllocation( PFN_vkAllocationFunction pfnAllocation_ ) { - return m_queryPool == VK_NULL_HANDLE; + pfnAllocation = pfnAllocation_; + return *this; } - private: - VkQueryPool m_queryPool; - }; - - static_assert( sizeof( QueryPool ) == sizeof( VkQueryPool ), "handle and wrapper have different size!" ); - - class Framebuffer - { - public: - Framebuffer() - : m_framebuffer(VK_NULL_HANDLE) - {} - - Framebuffer( std::nullptr_t ) - : m_framebuffer(VK_NULL_HANDLE) - {} - - VULKAN_HPP_TYPESAFE_EXPLICIT Framebuffer( VkFramebuffer framebuffer ) - : m_framebuffer( framebuffer ) - {} + AllocationCallbacks& setPfnReallocation( PFN_vkReallocationFunction pfnReallocation_ ) + { + pfnReallocation = pfnReallocation_; + return *this; + } -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Framebuffer & operator=(VkFramebuffer framebuffer) + AllocationCallbacks& setPfnFree( PFN_vkFreeFunction pfnFree_ ) { - m_framebuffer = framebuffer; - return *this; + pfnFree = pfnFree_; + return *this; } -#endif - Framebuffer & operator=( std::nullptr_t ) + AllocationCallbacks& setPfnInternalAllocation( PFN_vkInternalAllocationNotification pfnInternalAllocation_ ) { - m_framebuffer = VK_NULL_HANDLE; + pfnInternalAllocation = pfnInternalAllocation_; return *this; } - bool operator==( Framebuffer const & rhs ) const + AllocationCallbacks& setPfnInternalFree( PFN_vkInternalFreeNotification pfnInternalFree_ ) { - return m_framebuffer == rhs.m_framebuffer; + pfnInternalFree = pfnInternalFree_; + return *this; } - bool operator!=(Framebuffer const & rhs ) const + operator const VkAllocationCallbacks&() const { - return m_framebuffer != rhs.m_framebuffer; + return *reinterpret_cast(this); } - bool operator<(Framebuffer const & rhs ) const + bool operator==( AllocationCallbacks const& rhs ) const { - return m_framebuffer < rhs.m_framebuffer; + return ( pUserData == rhs.pUserData ) + && ( pfnAllocation == rhs.pfnAllocation ) + && ( pfnReallocation == rhs.pfnReallocation ) + && ( pfnFree == rhs.pfnFree ) + && ( pfnInternalAllocation == rhs.pfnInternalAllocation ) + && ( pfnInternalFree == rhs.pfnInternalFree ); } + bool operator!=( AllocationCallbacks const& rhs ) const + { + return !operator==( rhs ); + } + void* pUserData; + PFN_vkAllocationFunction pfnAllocation; + PFN_vkReallocationFunction pfnReallocation; + PFN_vkFreeFunction pfnFree; + PFN_vkInternalAllocationNotification pfnInternalAllocation; + PFN_vkInternalFreeNotification pfnInternalFree; + }; + static_assert( sizeof( AllocationCallbacks ) == sizeof( VkAllocationCallbacks ), "struct and wrapper have different size!" ); - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkFramebuffer() const + struct MemoryRequirements + { + operator const VkMemoryRequirements&() const { - return m_framebuffer; + return *reinterpret_cast(this); } - explicit operator bool() const + bool operator==( MemoryRequirements const& rhs ) const { - return m_framebuffer != VK_NULL_HANDLE; + return ( size == rhs.size ) + && ( alignment == rhs.alignment ) + && ( memoryTypeBits == rhs.memoryTypeBits ); } - bool operator!() const + bool operator!=( MemoryRequirements const& rhs ) const { - return m_framebuffer == VK_NULL_HANDLE; + return !operator==( rhs ); } - private: - VkFramebuffer m_framebuffer; + DeviceSize size; + DeviceSize alignment; + uint32_t memoryTypeBits; }; + static_assert( sizeof( MemoryRequirements ) == sizeof( VkMemoryRequirements ), "struct and wrapper have different size!" ); - static_assert( sizeof( Framebuffer ) == sizeof( VkFramebuffer ), "handle and wrapper have different size!" ); - - class RenderPass + struct DescriptorBufferInfo { - public: - RenderPass() - : m_renderPass(VK_NULL_HANDLE) - {} - - RenderPass( std::nullptr_t ) - : m_renderPass(VK_NULL_HANDLE) - {} + DescriptorBufferInfo( Buffer buffer_ = Buffer(), DeviceSize offset_ = 0, DeviceSize range_ = 0 ) + : buffer( buffer_ ) + , offset( offset_ ) + , range( range_ ) + { + } - VULKAN_HPP_TYPESAFE_EXPLICIT RenderPass( VkRenderPass renderPass ) - : m_renderPass( renderPass ) - {} + DescriptorBufferInfo( VkDescriptorBufferInfo const & rhs ) + { + memcpy( this, &rhs, sizeof( DescriptorBufferInfo ) ); + } -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - RenderPass & operator=(VkRenderPass renderPass) + DescriptorBufferInfo& operator=( VkDescriptorBufferInfo const & rhs ) { - m_renderPass = renderPass; - return *this; + memcpy( this, &rhs, sizeof( DescriptorBufferInfo ) ); + return *this; + } + DescriptorBufferInfo& setBuffer( Buffer buffer_ ) + { + buffer = buffer_; + return *this; } -#endif - RenderPass & operator=( std::nullptr_t ) + DescriptorBufferInfo& setOffset( DeviceSize offset_ ) { - m_renderPass = VK_NULL_HANDLE; + offset = offset_; return *this; } - bool operator==( RenderPass const & rhs ) const + DescriptorBufferInfo& setRange( DeviceSize range_ ) { - return m_renderPass == rhs.m_renderPass; + range = range_; + return *this; } - bool operator!=(RenderPass const & rhs ) const + operator const VkDescriptorBufferInfo&() const { - return m_renderPass != rhs.m_renderPass; + return *reinterpret_cast(this); } - bool operator<(RenderPass const & rhs ) const + bool operator==( DescriptorBufferInfo const& rhs ) const { - return m_renderPass < rhs.m_renderPass; + return ( buffer == rhs.buffer ) + && ( offset == rhs.offset ) + && ( range == rhs.range ); } + bool operator!=( DescriptorBufferInfo const& rhs ) const + { + return !operator==( rhs ); + } + Buffer buffer; + DeviceSize offset; + DeviceSize range; + }; + static_assert( sizeof( DescriptorBufferInfo ) == sizeof( VkDescriptorBufferInfo ), "struct and wrapper have different size!" ); - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkRenderPass() const + struct SubresourceLayout + { + operator const VkSubresourceLayout&() const { - return m_renderPass; + return *reinterpret_cast(this); } - explicit operator bool() const + bool operator==( SubresourceLayout const& rhs ) const { - return m_renderPass != VK_NULL_HANDLE; + return ( offset == rhs.offset ) + && ( size == rhs.size ) + && ( rowPitch == rhs.rowPitch ) + && ( arrayPitch == rhs.arrayPitch ) + && ( depthPitch == rhs.depthPitch ); } - bool operator!() const + bool operator!=( SubresourceLayout const& rhs ) const { - return m_renderPass == VK_NULL_HANDLE; + return !operator==( rhs ); } - private: - VkRenderPass m_renderPass; + DeviceSize offset; + DeviceSize size; + DeviceSize rowPitch; + DeviceSize arrayPitch; + DeviceSize depthPitch; }; + static_assert( sizeof( SubresourceLayout ) == sizeof( VkSubresourceLayout ), "struct and wrapper have different size!" ); - static_assert( sizeof( RenderPass ) == sizeof( VkRenderPass ), "handle and wrapper have different size!" ); - - class PipelineCache + struct BufferCopy { - public: - PipelineCache() - : m_pipelineCache(VK_NULL_HANDLE) - {} - - PipelineCache( std::nullptr_t ) - : m_pipelineCache(VK_NULL_HANDLE) - {} - - VULKAN_HPP_TYPESAFE_EXPLICIT PipelineCache( VkPipelineCache pipelineCache ) - : m_pipelineCache( pipelineCache ) - {} + BufferCopy( DeviceSize srcOffset_ = 0, DeviceSize dstOffset_ = 0, DeviceSize size_ = 0 ) + : srcOffset( srcOffset_ ) + , dstOffset( dstOffset_ ) + , size( size_ ) + { + } -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - PipelineCache & operator=(VkPipelineCache pipelineCache) + BufferCopy( VkBufferCopy const & rhs ) { - m_pipelineCache = pipelineCache; - return *this; + memcpy( this, &rhs, sizeof( BufferCopy ) ); } -#endif - PipelineCache & operator=( std::nullptr_t ) + BufferCopy& operator=( VkBufferCopy const & rhs ) { - m_pipelineCache = VK_NULL_HANDLE; + memcpy( this, &rhs, sizeof( BufferCopy ) ); return *this; } - - bool operator==( PipelineCache const & rhs ) const + BufferCopy& setSrcOffset( DeviceSize srcOffset_ ) { - return m_pipelineCache == rhs.m_pipelineCache; + srcOffset = srcOffset_; + return *this; } - bool operator!=(PipelineCache const & rhs ) const + BufferCopy& setDstOffset( DeviceSize dstOffset_ ) { - return m_pipelineCache != rhs.m_pipelineCache; + dstOffset = dstOffset_; + return *this; } - bool operator<(PipelineCache const & rhs ) const + BufferCopy& setSize( DeviceSize size_ ) { - return m_pipelineCache < rhs.m_pipelineCache; + size = size_; + return *this; } - - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkPipelineCache() const + operator const VkBufferCopy&() const { - return m_pipelineCache; + return *reinterpret_cast(this); } - explicit operator bool() const + bool operator==( BufferCopy const& rhs ) const { - return m_pipelineCache != VK_NULL_HANDLE; + return ( srcOffset == rhs.srcOffset ) + && ( dstOffset == rhs.dstOffset ) + && ( size == rhs.size ); } - bool operator!() const + bool operator!=( BufferCopy const& rhs ) const { - return m_pipelineCache == VK_NULL_HANDLE; + return !operator==( rhs ); } - private: - VkPipelineCache m_pipelineCache; + DeviceSize srcOffset; + DeviceSize dstOffset; + DeviceSize size; }; + static_assert( sizeof( BufferCopy ) == sizeof( VkBufferCopy ), "struct and wrapper have different size!" ); - static_assert( sizeof( PipelineCache ) == sizeof( VkPipelineCache ), "handle and wrapper have different size!" ); - - class ObjectTableNVX + struct SpecializationMapEntry { - public: - ObjectTableNVX() - : m_objectTableNVX(VK_NULL_HANDLE) - {} - - ObjectTableNVX( std::nullptr_t ) - : m_objectTableNVX(VK_NULL_HANDLE) - {} - - VULKAN_HPP_TYPESAFE_EXPLICIT ObjectTableNVX( VkObjectTableNVX objectTableNVX ) - : m_objectTableNVX( objectTableNVX ) - {} + SpecializationMapEntry( uint32_t constantID_ = 0, uint32_t offset_ = 0, size_t size_ = 0 ) + : constantID( constantID_ ) + , offset( offset_ ) + , size( size_ ) + { + } -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - ObjectTableNVX & operator=(VkObjectTableNVX objectTableNVX) + SpecializationMapEntry( VkSpecializationMapEntry const & rhs ) { - m_objectTableNVX = objectTableNVX; - return *this; + memcpy( this, &rhs, sizeof( SpecializationMapEntry ) ); } -#endif - ObjectTableNVX & operator=( std::nullptr_t ) + SpecializationMapEntry& operator=( VkSpecializationMapEntry const & rhs ) { - m_objectTableNVX = VK_NULL_HANDLE; + memcpy( this, &rhs, sizeof( SpecializationMapEntry ) ); return *this; } - - bool operator==( ObjectTableNVX const & rhs ) const + SpecializationMapEntry& setConstantID( uint32_t constantID_ ) { - return m_objectTableNVX == rhs.m_objectTableNVX; + constantID = constantID_; + return *this; } - bool operator!=(ObjectTableNVX const & rhs ) const + SpecializationMapEntry& setOffset( uint32_t offset_ ) { - return m_objectTableNVX != rhs.m_objectTableNVX; + offset = offset_; + return *this; } - bool operator<(ObjectTableNVX const & rhs ) const + SpecializationMapEntry& setSize( size_t size_ ) { - return m_objectTableNVX < rhs.m_objectTableNVX; + size = size_; + return *this; } - - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkObjectTableNVX() const + operator const VkSpecializationMapEntry&() const { - return m_objectTableNVX; + return *reinterpret_cast(this); } - explicit operator bool() const + bool operator==( SpecializationMapEntry const& rhs ) const { - return m_objectTableNVX != VK_NULL_HANDLE; + return ( constantID == rhs.constantID ) + && ( offset == rhs.offset ) + && ( size == rhs.size ); } - bool operator!() const + bool operator!=( SpecializationMapEntry const& rhs ) const { - return m_objectTableNVX == VK_NULL_HANDLE; + return !operator==( rhs ); } - private: - VkObjectTableNVX m_objectTableNVX; + uint32_t constantID; + uint32_t offset; + size_t size; }; + static_assert( sizeof( SpecializationMapEntry ) == sizeof( VkSpecializationMapEntry ), "struct and wrapper have different size!" ); - static_assert( sizeof( ObjectTableNVX ) == sizeof( VkObjectTableNVX ), "handle and wrapper have different size!" ); - - class IndirectCommandsLayoutNVX + struct SpecializationInfo { - public: - IndirectCommandsLayoutNVX() - : m_indirectCommandsLayoutNVX(VK_NULL_HANDLE) - {} - - IndirectCommandsLayoutNVX( std::nullptr_t ) - : m_indirectCommandsLayoutNVX(VK_NULL_HANDLE) - {} - - VULKAN_HPP_TYPESAFE_EXPLICIT IndirectCommandsLayoutNVX( VkIndirectCommandsLayoutNVX indirectCommandsLayoutNVX ) - : m_indirectCommandsLayoutNVX( indirectCommandsLayoutNVX ) - {} + SpecializationInfo( uint32_t mapEntryCount_ = 0, const SpecializationMapEntry* pMapEntries_ = nullptr, size_t dataSize_ = 0, const void* pData_ = nullptr ) + : mapEntryCount( mapEntryCount_ ) + , pMapEntries( pMapEntries_ ) + , dataSize( dataSize_ ) + , pData( pData_ ) + { + } -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - IndirectCommandsLayoutNVX & operator=(VkIndirectCommandsLayoutNVX indirectCommandsLayoutNVX) + SpecializationInfo( VkSpecializationInfo const & rhs ) { - m_indirectCommandsLayoutNVX = indirectCommandsLayoutNVX; - return *this; + memcpy( this, &rhs, sizeof( SpecializationInfo ) ); } -#endif - IndirectCommandsLayoutNVX & operator=( std::nullptr_t ) + SpecializationInfo& operator=( VkSpecializationInfo const & rhs ) { - m_indirectCommandsLayoutNVX = VK_NULL_HANDLE; + memcpy( this, &rhs, sizeof( SpecializationInfo ) ); + return *this; + } + SpecializationInfo& setMapEntryCount( uint32_t mapEntryCount_ ) + { + mapEntryCount = mapEntryCount_; return *this; } - bool operator==( IndirectCommandsLayoutNVX const & rhs ) const + SpecializationInfo& setPMapEntries( const SpecializationMapEntry* pMapEntries_ ) { - return m_indirectCommandsLayoutNVX == rhs.m_indirectCommandsLayoutNVX; + pMapEntries = pMapEntries_; + return *this; } - bool operator!=(IndirectCommandsLayoutNVX const & rhs ) const + SpecializationInfo& setDataSize( size_t dataSize_ ) { - return m_indirectCommandsLayoutNVX != rhs.m_indirectCommandsLayoutNVX; + dataSize = dataSize_; + return *this; } - bool operator<(IndirectCommandsLayoutNVX const & rhs ) const + SpecializationInfo& setPData( const void* pData_ ) { - return m_indirectCommandsLayoutNVX < rhs.m_indirectCommandsLayoutNVX; + pData = pData_; + return *this; } - - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkIndirectCommandsLayoutNVX() const + operator const VkSpecializationInfo&() const { - return m_indirectCommandsLayoutNVX; + return *reinterpret_cast(this); } - explicit operator bool() const + bool operator==( SpecializationInfo const& rhs ) const { - return m_indirectCommandsLayoutNVX != VK_NULL_HANDLE; + return ( mapEntryCount == rhs.mapEntryCount ) + && ( pMapEntries == rhs.pMapEntries ) + && ( dataSize == rhs.dataSize ) + && ( pData == rhs.pData ); } - bool operator!() const + bool operator!=( SpecializationInfo const& rhs ) const { - return m_indirectCommandsLayoutNVX == VK_NULL_HANDLE; + return !operator==( rhs ); } - private: - VkIndirectCommandsLayoutNVX m_indirectCommandsLayoutNVX; + uint32_t mapEntryCount; + const SpecializationMapEntry* pMapEntries; + size_t dataSize; + const void* pData; }; + static_assert( sizeof( SpecializationInfo ) == sizeof( VkSpecializationInfo ), "struct and wrapper have different size!" ); - static_assert( sizeof( IndirectCommandsLayoutNVX ) == sizeof( VkIndirectCommandsLayoutNVX ), "handle and wrapper have different size!" ); - - class DescriptorUpdateTemplateKHR + union ClearColorValue { - public: - DescriptorUpdateTemplateKHR() - : m_descriptorUpdateTemplateKHR(VK_NULL_HANDLE) - {} - - DescriptorUpdateTemplateKHR( std::nullptr_t ) - : m_descriptorUpdateTemplateKHR(VK_NULL_HANDLE) - {} - - VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorUpdateTemplateKHR( VkDescriptorUpdateTemplateKHR descriptorUpdateTemplateKHR ) - : m_descriptorUpdateTemplateKHR( descriptorUpdateTemplateKHR ) - {} - -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - DescriptorUpdateTemplateKHR & operator=(VkDescriptorUpdateTemplateKHR descriptorUpdateTemplateKHR) - { - m_descriptorUpdateTemplateKHR = descriptorUpdateTemplateKHR; - return *this; - } -#endif - - DescriptorUpdateTemplateKHR & operator=( std::nullptr_t ) + ClearColorValue( const std::array& float32_ = { {0} } ) { - m_descriptorUpdateTemplateKHR = VK_NULL_HANDLE; - return *this; + memcpy( &float32, float32_.data(), 4 * sizeof( float ) ); } - bool operator==( DescriptorUpdateTemplateKHR const & rhs ) const + ClearColorValue( const std::array& int32_ ) { - return m_descriptorUpdateTemplateKHR == rhs.m_descriptorUpdateTemplateKHR; + memcpy( &int32, int32_.data(), 4 * sizeof( int32_t ) ); } - bool operator!=(DescriptorUpdateTemplateKHR const & rhs ) const + ClearColorValue( const std::array& uint32_ ) { - return m_descriptorUpdateTemplateKHR != rhs.m_descriptorUpdateTemplateKHR; + memcpy( &uint32, uint32_.data(), 4 * sizeof( uint32_t ) ); } - bool operator<(DescriptorUpdateTemplateKHR const & rhs ) const + ClearColorValue& setFloat32( std::array float32_ ) { - return m_descriptorUpdateTemplateKHR < rhs.m_descriptorUpdateTemplateKHR; + memcpy( &float32, float32_.data(), 4 * sizeof( float ) ); + return *this; } - - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDescriptorUpdateTemplateKHR() const + ClearColorValue& setInt32( std::array int32_ ) { - return m_descriptorUpdateTemplateKHR; + memcpy( &int32, int32_.data(), 4 * sizeof( int32_t ) ); + return *this; } - explicit operator bool() const + ClearColorValue& setUint32( std::array uint32_ ) { - return m_descriptorUpdateTemplateKHR != VK_NULL_HANDLE; + memcpy( &uint32, uint32_.data(), 4 * sizeof( uint32_t ) ); + return *this; } - bool operator!() const + operator VkClearColorValue const& () const { - return m_descriptorUpdateTemplateKHR == VK_NULL_HANDLE; + return *reinterpret_cast(this); } - private: - VkDescriptorUpdateTemplateKHR m_descriptorUpdateTemplateKHR; + float float32[4]; + int32_t int32[4]; + uint32_t uint32[4]; }; - static_assert( sizeof( DescriptorUpdateTemplateKHR ) == sizeof( VkDescriptorUpdateTemplateKHR ), "handle and wrapper have different size!" ); - - class SamplerYcbcrConversionKHR + struct ClearDepthStencilValue { - public: - SamplerYcbcrConversionKHR() - : m_samplerYcbcrConversionKHR(VK_NULL_HANDLE) - {} - - SamplerYcbcrConversionKHR( std::nullptr_t ) - : m_samplerYcbcrConversionKHR(VK_NULL_HANDLE) - {} - - VULKAN_HPP_TYPESAFE_EXPLICIT SamplerYcbcrConversionKHR( VkSamplerYcbcrConversionKHR samplerYcbcrConversionKHR ) - : m_samplerYcbcrConversionKHR( samplerYcbcrConversionKHR ) - {} - -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - SamplerYcbcrConversionKHR & operator=(VkSamplerYcbcrConversionKHR samplerYcbcrConversionKHR) + ClearDepthStencilValue( float depth_ = 0, uint32_t stencil_ = 0 ) + : depth( depth_ ) + , stencil( stencil_ ) { - m_samplerYcbcrConversionKHR = samplerYcbcrConversionKHR; - return *this; } -#endif - SamplerYcbcrConversionKHR & operator=( std::nullptr_t ) + ClearDepthStencilValue( VkClearDepthStencilValue const & rhs ) { - m_samplerYcbcrConversionKHR = VK_NULL_HANDLE; - return *this; + memcpy( this, &rhs, sizeof( ClearDepthStencilValue ) ); } - bool operator==( SamplerYcbcrConversionKHR const & rhs ) const + ClearDepthStencilValue& operator=( VkClearDepthStencilValue const & rhs ) { - return m_samplerYcbcrConversionKHR == rhs.m_samplerYcbcrConversionKHR; + memcpy( this, &rhs, sizeof( ClearDepthStencilValue ) ); + return *this; } - - bool operator!=(SamplerYcbcrConversionKHR const & rhs ) const + ClearDepthStencilValue& setDepth( float depth_ ) { - return m_samplerYcbcrConversionKHR != rhs.m_samplerYcbcrConversionKHR; + depth = depth_; + return *this; } - bool operator<(SamplerYcbcrConversionKHR const & rhs ) const + ClearDepthStencilValue& setStencil( uint32_t stencil_ ) { - return m_samplerYcbcrConversionKHR < rhs.m_samplerYcbcrConversionKHR; + stencil = stencil_; + return *this; } - - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSamplerYcbcrConversionKHR() const + operator const VkClearDepthStencilValue&() const { - return m_samplerYcbcrConversionKHR; + return *reinterpret_cast(this); } - explicit operator bool() const + bool operator==( ClearDepthStencilValue const& rhs ) const { - return m_samplerYcbcrConversionKHR != VK_NULL_HANDLE; + return ( depth == rhs.depth ) + && ( stencil == rhs.stencil ); } - bool operator!() const + bool operator!=( ClearDepthStencilValue const& rhs ) const { - return m_samplerYcbcrConversionKHR == VK_NULL_HANDLE; + return !operator==( rhs ); } - private: - VkSamplerYcbcrConversionKHR m_samplerYcbcrConversionKHR; + float depth; + uint32_t stencil; }; + static_assert( sizeof( ClearDepthStencilValue ) == sizeof( VkClearDepthStencilValue ), "struct and wrapper have different size!" ); - static_assert( sizeof( SamplerYcbcrConversionKHR ) == sizeof( VkSamplerYcbcrConversionKHR ), "handle and wrapper have different size!" ); - - class ValidationCacheEXT + union ClearValue { - public: - ValidationCacheEXT() - : m_validationCacheEXT(VK_NULL_HANDLE) - {} - - ValidationCacheEXT( std::nullptr_t ) - : m_validationCacheEXT(VK_NULL_HANDLE) - {} - - VULKAN_HPP_TYPESAFE_EXPLICIT ValidationCacheEXT( VkValidationCacheEXT validationCacheEXT ) - : m_validationCacheEXT( validationCacheEXT ) - {} - -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - ValidationCacheEXT & operator=(VkValidationCacheEXT validationCacheEXT) + ClearValue( ClearColorValue color_ = ClearColorValue() ) { - m_validationCacheEXT = validationCacheEXT; - return *this; + color = color_; } -#endif - ValidationCacheEXT & operator=( std::nullptr_t ) + ClearValue( ClearDepthStencilValue depthStencil_ ) { - m_validationCacheEXT = VK_NULL_HANDLE; - return *this; + depthStencil = depthStencil_; } - bool operator==( ValidationCacheEXT const & rhs ) const + ClearValue& setColor( ClearColorValue color_ ) { - return m_validationCacheEXT == rhs.m_validationCacheEXT; + color = color_; + return *this; } - bool operator!=(ValidationCacheEXT const & rhs ) const + ClearValue& setDepthStencil( ClearDepthStencilValue depthStencil_ ) { - return m_validationCacheEXT != rhs.m_validationCacheEXT; + depthStencil = depthStencil_; + return *this; } - bool operator<(ValidationCacheEXT const & rhs ) const + operator VkClearValue const& () const { - return m_validationCacheEXT < rhs.m_validationCacheEXT; + return *reinterpret_cast(this); } +#ifdef VULKAN_HPP_HAS_UNRESTRICTED_UNIONS + ClearColorValue color; + ClearDepthStencilValue depthStencil; +#else + VkClearColorValue color; + VkClearDepthStencilValue depthStencil; +#endif // VULKAN_HPP_HAS_UNRESTRICTED_UNIONS + }; - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkValidationCacheEXT() const + struct PhysicalDeviceFeatures + { + PhysicalDeviceFeatures( Bool32 robustBufferAccess_ = 0, Bool32 fullDrawIndexUint32_ = 0, Bool32 imageCubeArray_ = 0, Bool32 independentBlend_ = 0, Bool32 geometryShader_ = 0, Bool32 tessellationShader_ = 0, Bool32 sampleRateShading_ = 0, Bool32 dualSrcBlend_ = 0, Bool32 logicOp_ = 0, Bool32 multiDrawIndirect_ = 0, Bool32 drawIndirectFirstInstance_ = 0, Bool32 depthClamp_ = 0, Bool32 depthBiasClamp_ = 0, Bool32 fillModeNonSolid_ = 0, Bool32 depthBounds_ = 0, Bool32 wideLines_ = 0, Bool32 largePoints_ = 0, Bool32 alphaToOne_ = 0, Bool32 multiViewport_ = 0, Bool32 samplerAnisotropy_ = 0, Bool32 textureCompressionETC2_ = 0, Bool32 textureCompressionASTC_LDR_ = 0, Bool32 textureCompressionBC_ = 0, Bool32 occlusionQueryPrecise_ = 0, Bool32 pipelineStatisticsQuery_ = 0, Bool32 vertexPipelineStoresAndAtomics_ = 0, Bool32 fragmentStoresAndAtomics_ = 0, Bool32 shaderTessellationAndGeometryPointSize_ = 0, Bool32 shaderImageGatherExtended_ = 0, Bool32 shaderStorageImageExtendedFormats_ = 0, Bool32 shaderStorageImageMultisample_ = 0, Bool32 shaderStorageImageReadWithoutFormat_ = 0, Bool32 shaderStorageImageWriteWithoutFormat_ = 0, Bool32 shaderUniformBufferArrayDynamicIndexing_ = 0, Bool32 shaderSampledImageArrayDynamicIndexing_ = 0, Bool32 shaderStorageBufferArrayDynamicIndexing_ = 0, Bool32 shaderStorageImageArrayDynamicIndexing_ = 0, Bool32 shaderClipDistance_ = 0, Bool32 shaderCullDistance_ = 0, Bool32 shaderFloat64_ = 0, Bool32 shaderInt64_ = 0, Bool32 shaderInt16_ = 0, Bool32 shaderResourceResidency_ = 0, Bool32 shaderResourceMinLod_ = 0, Bool32 sparseBinding_ = 0, Bool32 sparseResidencyBuffer_ = 0, Bool32 sparseResidencyImage2D_ = 0, Bool32 sparseResidencyImage3D_ = 0, Bool32 sparseResidency2Samples_ = 0, Bool32 sparseResidency4Samples_ = 0, Bool32 sparseResidency8Samples_ = 0, Bool32 sparseResidency16Samples_ = 0, Bool32 sparseResidencyAliased_ = 0, Bool32 variableMultisampleRate_ = 0, Bool32 inheritedQueries_ = 0 ) + : 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_ ) { - return m_validationCacheEXT; } - explicit operator bool() const + PhysicalDeviceFeatures( VkPhysicalDeviceFeatures const & rhs ) { - return m_validationCacheEXT != VK_NULL_HANDLE; + memcpy( this, &rhs, sizeof( PhysicalDeviceFeatures ) ); } - bool operator!() const + PhysicalDeviceFeatures& operator=( VkPhysicalDeviceFeatures const & rhs ) { - return m_validationCacheEXT == VK_NULL_HANDLE; + memcpy( this, &rhs, sizeof( PhysicalDeviceFeatures ) ); + return *this; } - - private: - VkValidationCacheEXT m_validationCacheEXT; - }; - - static_assert( sizeof( ValidationCacheEXT ) == sizeof( VkValidationCacheEXT ), "handle and wrapper have different size!" ); - - class DisplayKHR - { - public: - DisplayKHR() - : m_displayKHR(VK_NULL_HANDLE) - {} - - DisplayKHR( std::nullptr_t ) - : m_displayKHR(VK_NULL_HANDLE) - {} - - VULKAN_HPP_TYPESAFE_EXPLICIT DisplayKHR( VkDisplayKHR displayKHR ) - : m_displayKHR( displayKHR ) - {} - -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - DisplayKHR & operator=(VkDisplayKHR displayKHR) + PhysicalDeviceFeatures& setRobustBufferAccess( Bool32 robustBufferAccess_ ) { - m_displayKHR = displayKHR; - return *this; + robustBufferAccess = robustBufferAccess_; + return *this; } -#endif - DisplayKHR & operator=( std::nullptr_t ) + PhysicalDeviceFeatures& setFullDrawIndexUint32( Bool32 fullDrawIndexUint32_ ) { - m_displayKHR = VK_NULL_HANDLE; + fullDrawIndexUint32 = fullDrawIndexUint32_; return *this; } - bool operator==( DisplayKHR const & rhs ) const + PhysicalDeviceFeatures& setImageCubeArray( Bool32 imageCubeArray_ ) { - return m_displayKHR == rhs.m_displayKHR; + imageCubeArray = imageCubeArray_; + return *this; } - bool operator!=(DisplayKHR const & rhs ) const + PhysicalDeviceFeatures& setIndependentBlend( Bool32 independentBlend_ ) { - return m_displayKHR != rhs.m_displayKHR; + independentBlend = independentBlend_; + return *this; } - bool operator<(DisplayKHR const & rhs ) const + PhysicalDeviceFeatures& setGeometryShader( Bool32 geometryShader_ ) { - return m_displayKHR < rhs.m_displayKHR; + geometryShader = geometryShader_; + return *this; } - - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDisplayKHR() const + PhysicalDeviceFeatures& setTessellationShader( Bool32 tessellationShader_ ) { - return m_displayKHR; + tessellationShader = tessellationShader_; + return *this; } - explicit operator bool() const + PhysicalDeviceFeatures& setSampleRateShading( Bool32 sampleRateShading_ ) { - return m_displayKHR != VK_NULL_HANDLE; + sampleRateShading = sampleRateShading_; + return *this; } - bool operator!() const + PhysicalDeviceFeatures& setDualSrcBlend( Bool32 dualSrcBlend_ ) { - return m_displayKHR == VK_NULL_HANDLE; + dualSrcBlend = dualSrcBlend_; + return *this; } - private: - VkDisplayKHR m_displayKHR; - }; - - static_assert( sizeof( DisplayKHR ) == sizeof( VkDisplayKHR ), "handle and wrapper have different size!" ); - - class DisplayModeKHR - { - public: - DisplayModeKHR() - : m_displayModeKHR(VK_NULL_HANDLE) - {} - - DisplayModeKHR( std::nullptr_t ) - : m_displayModeKHR(VK_NULL_HANDLE) - {} - - VULKAN_HPP_TYPESAFE_EXPLICIT DisplayModeKHR( VkDisplayModeKHR displayModeKHR ) - : m_displayModeKHR( displayModeKHR ) - {} - -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - DisplayModeKHR & operator=(VkDisplayModeKHR displayModeKHR) + PhysicalDeviceFeatures& setLogicOp( Bool32 logicOp_ ) { - m_displayModeKHR = displayModeKHR; - return *this; + logicOp = logicOp_; + return *this; } -#endif - DisplayModeKHR & operator=( std::nullptr_t ) + PhysicalDeviceFeatures& setMultiDrawIndirect( Bool32 multiDrawIndirect_ ) { - m_displayModeKHR = VK_NULL_HANDLE; + multiDrawIndirect = multiDrawIndirect_; return *this; } - bool operator==( DisplayModeKHR const & rhs ) const + PhysicalDeviceFeatures& setDrawIndirectFirstInstance( Bool32 drawIndirectFirstInstance_ ) { - return m_displayModeKHR == rhs.m_displayModeKHR; + drawIndirectFirstInstance = drawIndirectFirstInstance_; + return *this; } - bool operator!=(DisplayModeKHR const & rhs ) const + PhysicalDeviceFeatures& setDepthClamp( Bool32 depthClamp_ ) { - return m_displayModeKHR != rhs.m_displayModeKHR; + depthClamp = depthClamp_; + return *this; } - bool operator<(DisplayModeKHR const & rhs ) const + PhysicalDeviceFeatures& setDepthBiasClamp( Bool32 depthBiasClamp_ ) { - return m_displayModeKHR < rhs.m_displayModeKHR; + depthBiasClamp = depthBiasClamp_; + return *this; } - - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDisplayModeKHR() const + PhysicalDeviceFeatures& setFillModeNonSolid( Bool32 fillModeNonSolid_ ) { - return m_displayModeKHR; + fillModeNonSolid = fillModeNonSolid_; + return *this; } - explicit operator bool() const + PhysicalDeviceFeatures& setDepthBounds( Bool32 depthBounds_ ) { - return m_displayModeKHR != VK_NULL_HANDLE; + depthBounds = depthBounds_; + return *this; } - bool operator!() const + PhysicalDeviceFeatures& setWideLines( Bool32 wideLines_ ) { - return m_displayModeKHR == VK_NULL_HANDLE; + wideLines = wideLines_; + return *this; } - private: - VkDisplayModeKHR m_displayModeKHR; - }; - - static_assert( sizeof( DisplayModeKHR ) == sizeof( VkDisplayModeKHR ), "handle and wrapper have different size!" ); - - class SurfaceKHR - { - public: - SurfaceKHR() - : m_surfaceKHR(VK_NULL_HANDLE) - {} - - SurfaceKHR( std::nullptr_t ) - : m_surfaceKHR(VK_NULL_HANDLE) - {} - - VULKAN_HPP_TYPESAFE_EXPLICIT SurfaceKHR( VkSurfaceKHR surfaceKHR ) - : m_surfaceKHR( surfaceKHR ) - {} - -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - SurfaceKHR & operator=(VkSurfaceKHR surfaceKHR) + PhysicalDeviceFeatures& setLargePoints( Bool32 largePoints_ ) { - m_surfaceKHR = surfaceKHR; - return *this; + largePoints = largePoints_; + return *this; } -#endif - SurfaceKHR & operator=( std::nullptr_t ) + PhysicalDeviceFeatures& setAlphaToOne( Bool32 alphaToOne_ ) { - m_surfaceKHR = VK_NULL_HANDLE; + alphaToOne = alphaToOne_; return *this; } - bool operator==( SurfaceKHR const & rhs ) const + PhysicalDeviceFeatures& setMultiViewport( Bool32 multiViewport_ ) { - return m_surfaceKHR == rhs.m_surfaceKHR; + multiViewport = multiViewport_; + return *this; } - bool operator!=(SurfaceKHR const & rhs ) const + PhysicalDeviceFeatures& setSamplerAnisotropy( Bool32 samplerAnisotropy_ ) { - return m_surfaceKHR != rhs.m_surfaceKHR; + samplerAnisotropy = samplerAnisotropy_; + return *this; } - bool operator<(SurfaceKHR const & rhs ) const + PhysicalDeviceFeatures& setTextureCompressionETC2( Bool32 textureCompressionETC2_ ) { - return m_surfaceKHR < rhs.m_surfaceKHR; + textureCompressionETC2 = textureCompressionETC2_; + return *this; } - - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSurfaceKHR() const + PhysicalDeviceFeatures& setTextureCompressionASTC_LDR( Bool32 textureCompressionASTC_LDR_ ) { - return m_surfaceKHR; + textureCompressionASTC_LDR = textureCompressionASTC_LDR_; + return *this; } - explicit operator bool() const + PhysicalDeviceFeatures& setTextureCompressionBC( Bool32 textureCompressionBC_ ) { - return m_surfaceKHR != VK_NULL_HANDLE; + textureCompressionBC = textureCompressionBC_; + return *this; } - bool operator!() const + PhysicalDeviceFeatures& setOcclusionQueryPrecise( Bool32 occlusionQueryPrecise_ ) { - return m_surfaceKHR == VK_NULL_HANDLE; + occlusionQueryPrecise = occlusionQueryPrecise_; + return *this; } - private: - VkSurfaceKHR m_surfaceKHR; - }; - - static_assert( sizeof( SurfaceKHR ) == sizeof( VkSurfaceKHR ), "handle and wrapper have different size!" ); - - class SwapchainKHR - { - public: - SwapchainKHR() - : m_swapchainKHR(VK_NULL_HANDLE) - {} - - SwapchainKHR( std::nullptr_t ) - : m_swapchainKHR(VK_NULL_HANDLE) - {} - - VULKAN_HPP_TYPESAFE_EXPLICIT SwapchainKHR( VkSwapchainKHR swapchainKHR ) - : m_swapchainKHR( swapchainKHR ) - {} - -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - SwapchainKHR & operator=(VkSwapchainKHR swapchainKHR) + PhysicalDeviceFeatures& setPipelineStatisticsQuery( Bool32 pipelineStatisticsQuery_ ) { - m_swapchainKHR = swapchainKHR; - return *this; + pipelineStatisticsQuery = pipelineStatisticsQuery_; + return *this; } -#endif - SwapchainKHR & operator=( std::nullptr_t ) + PhysicalDeviceFeatures& setVertexPipelineStoresAndAtomics( Bool32 vertexPipelineStoresAndAtomics_ ) { - m_swapchainKHR = VK_NULL_HANDLE; + vertexPipelineStoresAndAtomics = vertexPipelineStoresAndAtomics_; return *this; } - bool operator==( SwapchainKHR const & rhs ) const + PhysicalDeviceFeatures& setFragmentStoresAndAtomics( Bool32 fragmentStoresAndAtomics_ ) { - return m_swapchainKHR == rhs.m_swapchainKHR; + fragmentStoresAndAtomics = fragmentStoresAndAtomics_; + return *this; } - bool operator!=(SwapchainKHR const & rhs ) const + PhysicalDeviceFeatures& setShaderTessellationAndGeometryPointSize( Bool32 shaderTessellationAndGeometryPointSize_ ) { - return m_swapchainKHR != rhs.m_swapchainKHR; + shaderTessellationAndGeometryPointSize = shaderTessellationAndGeometryPointSize_; + return *this; } - bool operator<(SwapchainKHR const & rhs ) const + PhysicalDeviceFeatures& setShaderImageGatherExtended( Bool32 shaderImageGatherExtended_ ) { - return m_swapchainKHR < rhs.m_swapchainKHR; + shaderImageGatherExtended = shaderImageGatherExtended_; + return *this; } - - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSwapchainKHR() const + PhysicalDeviceFeatures& setShaderStorageImageExtendedFormats( Bool32 shaderStorageImageExtendedFormats_ ) { - return m_swapchainKHR; + shaderStorageImageExtendedFormats = shaderStorageImageExtendedFormats_; + return *this; } - explicit operator bool() const + PhysicalDeviceFeatures& setShaderStorageImageMultisample( Bool32 shaderStorageImageMultisample_ ) { - return m_swapchainKHR != VK_NULL_HANDLE; + shaderStorageImageMultisample = shaderStorageImageMultisample_; + return *this; } - bool operator!() const + PhysicalDeviceFeatures& setShaderStorageImageReadWithoutFormat( Bool32 shaderStorageImageReadWithoutFormat_ ) { - return m_swapchainKHR == VK_NULL_HANDLE; + shaderStorageImageReadWithoutFormat = shaderStorageImageReadWithoutFormat_; + return *this; } - private: - VkSwapchainKHR m_swapchainKHR; - }; - - static_assert( sizeof( SwapchainKHR ) == sizeof( VkSwapchainKHR ), "handle and wrapper have different size!" ); - - class DebugReportCallbackEXT - { - public: - DebugReportCallbackEXT() - : m_debugReportCallbackEXT(VK_NULL_HANDLE) - {} - - DebugReportCallbackEXT( std::nullptr_t ) - : m_debugReportCallbackEXT(VK_NULL_HANDLE) - {} + PhysicalDeviceFeatures& setShaderStorageImageWriteWithoutFormat( Bool32 shaderStorageImageWriteWithoutFormat_ ) + { + shaderStorageImageWriteWithoutFormat = shaderStorageImageWriteWithoutFormat_; + return *this; + } - VULKAN_HPP_TYPESAFE_EXPLICIT DebugReportCallbackEXT( VkDebugReportCallbackEXT debugReportCallbackEXT ) - : m_debugReportCallbackEXT( debugReportCallbackEXT ) - {} + PhysicalDeviceFeatures& setShaderUniformBufferArrayDynamicIndexing( Bool32 shaderUniformBufferArrayDynamicIndexing_ ) + { + shaderUniformBufferArrayDynamicIndexing = shaderUniformBufferArrayDynamicIndexing_; + return *this; + } -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - DebugReportCallbackEXT & operator=(VkDebugReportCallbackEXT debugReportCallbackEXT) + PhysicalDeviceFeatures& setShaderSampledImageArrayDynamicIndexing( Bool32 shaderSampledImageArrayDynamicIndexing_ ) { - m_debugReportCallbackEXT = debugReportCallbackEXT; - return *this; + shaderSampledImageArrayDynamicIndexing = shaderSampledImageArrayDynamicIndexing_; + return *this; } -#endif - DebugReportCallbackEXT & operator=( std::nullptr_t ) + PhysicalDeviceFeatures& setShaderStorageBufferArrayDynamicIndexing( Bool32 shaderStorageBufferArrayDynamicIndexing_ ) { - m_debugReportCallbackEXT = VK_NULL_HANDLE; + shaderStorageBufferArrayDynamicIndexing = shaderStorageBufferArrayDynamicIndexing_; return *this; } - bool operator==( DebugReportCallbackEXT const & rhs ) const + PhysicalDeviceFeatures& setShaderStorageImageArrayDynamicIndexing( Bool32 shaderStorageImageArrayDynamicIndexing_ ) { - return m_debugReportCallbackEXT == rhs.m_debugReportCallbackEXT; + shaderStorageImageArrayDynamicIndexing = shaderStorageImageArrayDynamicIndexing_; + return *this; } - bool operator!=(DebugReportCallbackEXT const & rhs ) const + PhysicalDeviceFeatures& setShaderClipDistance( Bool32 shaderClipDistance_ ) { - return m_debugReportCallbackEXT != rhs.m_debugReportCallbackEXT; + shaderClipDistance = shaderClipDistance_; + return *this; } - bool operator<(DebugReportCallbackEXT const & rhs ) const + PhysicalDeviceFeatures& setShaderCullDistance( Bool32 shaderCullDistance_ ) { - return m_debugReportCallbackEXT < rhs.m_debugReportCallbackEXT; + shaderCullDistance = shaderCullDistance_; + return *this; } - - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDebugReportCallbackEXT() const + PhysicalDeviceFeatures& setShaderFloat64( Bool32 shaderFloat64_ ) { - return m_debugReportCallbackEXT; + shaderFloat64 = shaderFloat64_; + return *this; } - explicit operator bool() const + PhysicalDeviceFeatures& setShaderInt64( Bool32 shaderInt64_ ) { - return m_debugReportCallbackEXT != VK_NULL_HANDLE; + shaderInt64 = shaderInt64_; + return *this; } - bool operator!() const + PhysicalDeviceFeatures& setShaderInt16( Bool32 shaderInt16_ ) { - return m_debugReportCallbackEXT == VK_NULL_HANDLE; + shaderInt16 = shaderInt16_; + return *this; } - private: - VkDebugReportCallbackEXT m_debugReportCallbackEXT; - }; - - static_assert( sizeof( DebugReportCallbackEXT ) == sizeof( VkDebugReportCallbackEXT ), "handle and wrapper have different size!" ); - - struct Offset2D - { - Offset2D( int32_t x_ = 0, int32_t y_ = 0 ) - : x( x_ ) - , y( y_ ) + PhysicalDeviceFeatures& setShaderResourceResidency( Bool32 shaderResourceResidency_ ) { + shaderResourceResidency = shaderResourceResidency_; + return *this; } - Offset2D( VkOffset2D const & rhs ) + PhysicalDeviceFeatures& setShaderResourceMinLod( Bool32 shaderResourceMinLod_ ) { - memcpy( this, &rhs, sizeof( Offset2D ) ); + shaderResourceMinLod = shaderResourceMinLod_; + return *this; } - Offset2D& operator=( VkOffset2D const & rhs ) + PhysicalDeviceFeatures& setSparseBinding( Bool32 sparseBinding_ ) { - memcpy( this, &rhs, sizeof( Offset2D ) ); + sparseBinding = sparseBinding_; return *this; } - Offset2D& setX( int32_t x_ ) + + PhysicalDeviceFeatures& setSparseResidencyBuffer( Bool32 sparseResidencyBuffer_ ) { - x = x_; + sparseResidencyBuffer = sparseResidencyBuffer_; return *this; } - Offset2D& setY( int32_t y_ ) + PhysicalDeviceFeatures& setSparseResidencyImage2D( Bool32 sparseResidencyImage2D_ ) { - y = y_; + sparseResidencyImage2D = sparseResidencyImage2D_; return *this; } - operator const VkOffset2D&() const + PhysicalDeviceFeatures& setSparseResidencyImage3D( Bool32 sparseResidencyImage3D_ ) { - return *reinterpret_cast(this); + sparseResidencyImage3D = sparseResidencyImage3D_; + return *this; } - bool operator==( Offset2D const& rhs ) const + PhysicalDeviceFeatures& setSparseResidency2Samples( Bool32 sparseResidency2Samples_ ) { - return ( x == rhs.x ) - && ( y == rhs.y ); + sparseResidency2Samples = sparseResidency2Samples_; + return *this; } - bool operator!=( Offset2D const& rhs ) const + PhysicalDeviceFeatures& setSparseResidency4Samples( Bool32 sparseResidency4Samples_ ) { - return !operator==( rhs ); + sparseResidency4Samples = sparseResidency4Samples_; + return *this; } - int32_t x; - int32_t y; - }; - static_assert( sizeof( Offset2D ) == sizeof( VkOffset2D ), "struct and wrapper have different size!" ); - - struct Offset3D - { - Offset3D( int32_t x_ = 0, int32_t y_ = 0, int32_t z_ = 0 ) - : x( x_ ) - , y( y_ ) - , z( z_ ) + PhysicalDeviceFeatures& setSparseResidency8Samples( Bool32 sparseResidency8Samples_ ) { + sparseResidency8Samples = sparseResidency8Samples_; + return *this; } - Offset3D( VkOffset3D const & rhs ) + PhysicalDeviceFeatures& setSparseResidency16Samples( Bool32 sparseResidency16Samples_ ) { - memcpy( this, &rhs, sizeof( Offset3D ) ); + sparseResidency16Samples = sparseResidency16Samples_; + return *this; } - Offset3D& operator=( VkOffset3D const & rhs ) + PhysicalDeviceFeatures& setSparseResidencyAliased( Bool32 sparseResidencyAliased_ ) { - memcpy( this, &rhs, sizeof( Offset3D ) ); + sparseResidencyAliased = sparseResidencyAliased_; return *this; } - Offset3D& setX( int32_t x_ ) + + PhysicalDeviceFeatures& setVariableMultisampleRate( Bool32 variableMultisampleRate_ ) { - x = x_; + variableMultisampleRate = variableMultisampleRate_; return *this; } - Offset3D& setY( int32_t y_ ) + PhysicalDeviceFeatures& setInheritedQueries( Bool32 inheritedQueries_ ) { - y = y_; + inheritedQueries = inheritedQueries_; return *this; } - Offset3D& setZ( int32_t z_ ) + operator const VkPhysicalDeviceFeatures&() const { - z = z_; - return *this; + return *reinterpret_cast(this); } - operator const VkOffset3D&() const + bool operator==( PhysicalDeviceFeatures const& rhs ) const { - return *reinterpret_cast(this); + 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 ); } - bool operator==( Offset3D const& rhs ) const + bool operator!=( PhysicalDeviceFeatures const& rhs ) const { - return ( x == rhs.x ) - && ( y == rhs.y ) - && ( z == rhs.z ); + return !operator==( rhs ); + } + + Bool32 robustBufferAccess; + Bool32 fullDrawIndexUint32; + Bool32 imageCubeArray; + Bool32 independentBlend; + Bool32 geometryShader; + Bool32 tessellationShader; + Bool32 sampleRateShading; + Bool32 dualSrcBlend; + Bool32 logicOp; + Bool32 multiDrawIndirect; + Bool32 drawIndirectFirstInstance; + Bool32 depthClamp; + Bool32 depthBiasClamp; + Bool32 fillModeNonSolid; + Bool32 depthBounds; + Bool32 wideLines; + Bool32 largePoints; + Bool32 alphaToOne; + Bool32 multiViewport; + Bool32 samplerAnisotropy; + Bool32 textureCompressionETC2; + Bool32 textureCompressionASTC_LDR; + Bool32 textureCompressionBC; + Bool32 occlusionQueryPrecise; + Bool32 pipelineStatisticsQuery; + Bool32 vertexPipelineStoresAndAtomics; + Bool32 fragmentStoresAndAtomics; + Bool32 shaderTessellationAndGeometryPointSize; + Bool32 shaderImageGatherExtended; + Bool32 shaderStorageImageExtendedFormats; + Bool32 shaderStorageImageMultisample; + Bool32 shaderStorageImageReadWithoutFormat; + Bool32 shaderStorageImageWriteWithoutFormat; + Bool32 shaderUniformBufferArrayDynamicIndexing; + Bool32 shaderSampledImageArrayDynamicIndexing; + Bool32 shaderStorageBufferArrayDynamicIndexing; + Bool32 shaderStorageImageArrayDynamicIndexing; + Bool32 shaderClipDistance; + Bool32 shaderCullDistance; + Bool32 shaderFloat64; + Bool32 shaderInt64; + Bool32 shaderInt16; + Bool32 shaderResourceResidency; + Bool32 shaderResourceMinLod; + Bool32 sparseBinding; + Bool32 sparseResidencyBuffer; + Bool32 sparseResidencyImage2D; + Bool32 sparseResidencyImage3D; + Bool32 sparseResidency2Samples; + Bool32 sparseResidency4Samples; + Bool32 sparseResidency8Samples; + Bool32 sparseResidency16Samples; + Bool32 sparseResidencyAliased; + Bool32 variableMultisampleRate; + Bool32 inheritedQueries; + }; + static_assert( sizeof( PhysicalDeviceFeatures ) == sizeof( VkPhysicalDeviceFeatures ), "struct and wrapper have different size!" ); + + struct PhysicalDeviceSparseProperties + { + operator const VkPhysicalDeviceSparseProperties&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PhysicalDeviceSparseProperties const& rhs ) const + { + return ( residencyStandard2DBlockShape == rhs.residencyStandard2DBlockShape ) + && ( residencyStandard2DMultisampleBlockShape == rhs.residencyStandard2DMultisampleBlockShape ) + && ( residencyStandard3DBlockShape == rhs.residencyStandard3DBlockShape ) + && ( residencyAlignedMipSize == rhs.residencyAlignedMipSize ) + && ( residencyNonResidentStrict == rhs.residencyNonResidentStrict ); } - bool operator!=( Offset3D const& rhs ) const + bool operator!=( PhysicalDeviceSparseProperties const& rhs ) const { return !operator==( rhs ); } - int32_t x; - int32_t y; - int32_t z; + Bool32 residencyStandard2DBlockShape; + Bool32 residencyStandard2DMultisampleBlockShape; + Bool32 residencyStandard3DBlockShape; + Bool32 residencyAlignedMipSize; + Bool32 residencyNonResidentStrict; }; - static_assert( sizeof( Offset3D ) == sizeof( VkOffset3D ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceSparseProperties ) == sizeof( VkPhysicalDeviceSparseProperties ), "struct and wrapper have different size!" ); - struct Extent2D + struct DrawIndirectCommand { - Extent2D( uint32_t width_ = 0, uint32_t height_ = 0 ) - : width( width_ ) - , height( height_ ) + DrawIndirectCommand( uint32_t vertexCount_ = 0, uint32_t instanceCount_ = 0, uint32_t firstVertex_ = 0, uint32_t firstInstance_ = 0 ) + : vertexCount( vertexCount_ ) + , instanceCount( instanceCount_ ) + , firstVertex( firstVertex_ ) + , firstInstance( firstInstance_ ) { } - Extent2D( VkExtent2D const & rhs ) + DrawIndirectCommand( VkDrawIndirectCommand const & rhs ) { - memcpy( this, &rhs, sizeof( Extent2D ) ); + memcpy( this, &rhs, sizeof( DrawIndirectCommand ) ); } - Extent2D& operator=( VkExtent2D const & rhs ) + DrawIndirectCommand& operator=( VkDrawIndirectCommand const & rhs ) { - memcpy( this, &rhs, sizeof( Extent2D ) ); + memcpy( this, &rhs, sizeof( DrawIndirectCommand ) ); return *this; } - Extent2D& setWidth( uint32_t width_ ) + DrawIndirectCommand& setVertexCount( uint32_t vertexCount_ ) { - width = width_; + vertexCount = vertexCount_; return *this; } - Extent2D& setHeight( uint32_t height_ ) + DrawIndirectCommand& setInstanceCount( uint32_t instanceCount_ ) { - height = height_; + instanceCount = instanceCount_; return *this; } - operator const VkExtent2D&() const + DrawIndirectCommand& setFirstVertex( uint32_t firstVertex_ ) { - return *reinterpret_cast(this); + firstVertex = firstVertex_; + return *this; } - bool operator==( Extent2D const& rhs ) const + DrawIndirectCommand& setFirstInstance( uint32_t firstInstance_ ) { - return ( width == rhs.width ) - && ( height == rhs.height ); + firstInstance = firstInstance_; + return *this; } - bool operator!=( Extent2D const& rhs ) const + operator const VkDrawIndirectCommand&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DrawIndirectCommand const& rhs ) const + { + return ( vertexCount == rhs.vertexCount ) + && ( instanceCount == rhs.instanceCount ) + && ( firstVertex == rhs.firstVertex ) + && ( firstInstance == rhs.firstInstance ); + } + + bool operator!=( DrawIndirectCommand const& rhs ) const { return !operator==( rhs ); } - uint32_t width; - uint32_t height; + uint32_t vertexCount; + uint32_t instanceCount; + uint32_t firstVertex; + uint32_t firstInstance; }; - static_assert( sizeof( Extent2D ) == sizeof( VkExtent2D ), "struct and wrapper have different size!" ); + static_assert( sizeof( DrawIndirectCommand ) == sizeof( VkDrawIndirectCommand ), "struct and wrapper have different size!" ); - struct Extent3D + struct DrawIndexedIndirectCommand { - Extent3D( uint32_t width_ = 0, uint32_t height_ = 0, uint32_t depth_ = 0 ) - : width( width_ ) - , height( height_ ) - , depth( depth_ ) + DrawIndexedIndirectCommand( uint32_t indexCount_ = 0, uint32_t instanceCount_ = 0, uint32_t firstIndex_ = 0, int32_t vertexOffset_ = 0, uint32_t firstInstance_ = 0 ) + : indexCount( indexCount_ ) + , instanceCount( instanceCount_ ) + , firstIndex( firstIndex_ ) + , vertexOffset( vertexOffset_ ) + , firstInstance( firstInstance_ ) { } - Extent3D( VkExtent3D const & rhs ) + DrawIndexedIndirectCommand( VkDrawIndexedIndirectCommand const & rhs ) { - memcpy( this, &rhs, sizeof( Extent3D ) ); + memcpy( this, &rhs, sizeof( DrawIndexedIndirectCommand ) ); } - Extent3D& operator=( VkExtent3D const & rhs ) + DrawIndexedIndirectCommand& operator=( VkDrawIndexedIndirectCommand const & rhs ) { - memcpy( this, &rhs, sizeof( Extent3D ) ); + memcpy( this, &rhs, sizeof( DrawIndexedIndirectCommand ) ); return *this; } - Extent3D& setWidth( uint32_t width_ ) + DrawIndexedIndirectCommand& setIndexCount( uint32_t indexCount_ ) { - width = width_; + indexCount = indexCount_; return *this; } - Extent3D& setHeight( uint32_t height_ ) + DrawIndexedIndirectCommand& setInstanceCount( uint32_t instanceCount_ ) { - height = height_; + instanceCount = instanceCount_; return *this; } - Extent3D& setDepth( uint32_t depth_ ) + DrawIndexedIndirectCommand& setFirstIndex( uint32_t firstIndex_ ) { - depth = depth_; + firstIndex = firstIndex_; return *this; } - operator const VkExtent3D&() const + DrawIndexedIndirectCommand& setVertexOffset( int32_t vertexOffset_ ) { - return *reinterpret_cast(this); + vertexOffset = vertexOffset_; + return *this; } - bool operator==( Extent3D const& rhs ) const + DrawIndexedIndirectCommand& setFirstInstance( uint32_t firstInstance_ ) { - return ( width == rhs.width ) - && ( height == rhs.height ) - && ( depth == rhs.depth ); + firstInstance = firstInstance_; + return *this; } - bool operator!=( Extent3D const& rhs ) const + operator const VkDrawIndexedIndirectCommand&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DrawIndexedIndirectCommand const& rhs ) const + { + return ( indexCount == rhs.indexCount ) + && ( instanceCount == rhs.instanceCount ) + && ( firstIndex == rhs.firstIndex ) + && ( vertexOffset == rhs.vertexOffset ) + && ( firstInstance == rhs.firstInstance ); + } + + bool operator!=( DrawIndexedIndirectCommand const& rhs ) const { return !operator==( rhs ); } - uint32_t width; - uint32_t height; - uint32_t depth; + uint32_t indexCount; + uint32_t instanceCount; + uint32_t firstIndex; + int32_t vertexOffset; + uint32_t firstInstance; }; - static_assert( sizeof( Extent3D ) == sizeof( VkExtent3D ), "struct and wrapper have different size!" ); + static_assert( sizeof( DrawIndexedIndirectCommand ) == sizeof( VkDrawIndexedIndirectCommand ), "struct and wrapper have different size!" ); - struct Viewport + struct DispatchIndirectCommand { - Viewport( float x_ = 0, float y_ = 0, float width_ = 0, float height_ = 0, float minDepth_ = 0, float maxDepth_ = 0 ) + DispatchIndirectCommand( uint32_t x_ = 0, uint32_t y_ = 0, uint32_t z_ = 0 ) : x( x_ ) , y( y_ ) - , width( width_ ) - , height( height_ ) - , minDepth( minDepth_ ) - , maxDepth( maxDepth_ ) + , z( z_ ) { } - Viewport( VkViewport const & rhs ) + DispatchIndirectCommand( VkDispatchIndirectCommand const & rhs ) { - memcpy( this, &rhs, sizeof( Viewport ) ); + memcpy( this, &rhs, sizeof( DispatchIndirectCommand ) ); } - Viewport& operator=( VkViewport const & rhs ) + DispatchIndirectCommand& operator=( VkDispatchIndirectCommand const & rhs ) { - memcpy( this, &rhs, sizeof( Viewport ) ); + memcpy( this, &rhs, sizeof( DispatchIndirectCommand ) ); return *this; } - Viewport& setX( float x_ ) + DispatchIndirectCommand& setX( uint32_t x_ ) { x = x_; return *this; } - Viewport& setY( float y_ ) + DispatchIndirectCommand& setY( uint32_t y_ ) { y = y_; return *this; } - Viewport& setWidth( float width_ ) + DispatchIndirectCommand& setZ( uint32_t z_ ) { - width = width_; + z = z_; return *this; } - Viewport& setHeight( float height_ ) + operator const VkDispatchIndirectCommand&() const { - height = height_; - return *this; + return *reinterpret_cast(this); } - Viewport& setMinDepth( float minDepth_ ) + bool operator==( DispatchIndirectCommand const& rhs ) const { - minDepth = minDepth_; - return *this; + return ( x == rhs.x ) + && ( y == rhs.y ) + && ( z == rhs.z ); } - Viewport& setMaxDepth( float maxDepth_ ) + bool operator!=( DispatchIndirectCommand const& rhs ) const { - maxDepth = maxDepth_; - return *this; + return !operator==( rhs ); } - operator const VkViewport&() const + uint32_t x; + uint32_t y; + uint32_t z; + }; + static_assert( sizeof( DispatchIndirectCommand ) == sizeof( VkDispatchIndirectCommand ), "struct and wrapper have different size!" ); + + struct DisplayPlanePropertiesKHR + { + operator const VkDisplayPlanePropertiesKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( Viewport const& rhs ) const + bool operator==( DisplayPlanePropertiesKHR const& rhs ) const { - return ( x == rhs.x ) - && ( y == rhs.y ) - && ( width == rhs.width ) - && ( height == rhs.height ) - && ( minDepth == rhs.minDepth ) - && ( maxDepth == rhs.maxDepth ); + return ( currentDisplay == rhs.currentDisplay ) + && ( currentStackIndex == rhs.currentStackIndex ); } - bool operator!=( Viewport const& rhs ) const + bool operator!=( DisplayPlanePropertiesKHR const& rhs ) const { return !operator==( rhs ); } - float x; - float y; - float width; - float height; - float minDepth; - float maxDepth; + DisplayKHR currentDisplay; + uint32_t currentStackIndex; }; - static_assert( sizeof( Viewport ) == sizeof( VkViewport ), "struct and wrapper have different size!" ); + static_assert( sizeof( DisplayPlanePropertiesKHR ) == sizeof( VkDisplayPlanePropertiesKHR ), "struct and wrapper have different size!" ); - struct Rect2D + struct DisplayModeParametersKHR { - Rect2D( Offset2D offset_ = Offset2D(), Extent2D extent_ = Extent2D() ) - : offset( offset_ ) - , extent( extent_ ) + DisplayModeParametersKHR( Extent2D visibleRegion_ = Extent2D(), uint32_t refreshRate_ = 0 ) + : visibleRegion( visibleRegion_ ) + , refreshRate( refreshRate_ ) { } - Rect2D( VkRect2D const & rhs ) + DisplayModeParametersKHR( VkDisplayModeParametersKHR const & rhs ) { - memcpy( this, &rhs, sizeof( Rect2D ) ); + memcpy( this, &rhs, sizeof( DisplayModeParametersKHR ) ); } - Rect2D& operator=( VkRect2D const & rhs ) + DisplayModeParametersKHR& operator=( VkDisplayModeParametersKHR const & rhs ) { - memcpy( this, &rhs, sizeof( Rect2D ) ); + memcpy( this, &rhs, sizeof( DisplayModeParametersKHR ) ); return *this; } - Rect2D& setOffset( Offset2D offset_ ) + DisplayModeParametersKHR& setVisibleRegion( Extent2D visibleRegion_ ) + { + visibleRegion = visibleRegion_; + return *this; + } + + DisplayModeParametersKHR& setRefreshRate( uint32_t refreshRate_ ) + { + refreshRate = refreshRate_; + return *this; + } + + operator const VkDisplayModeParametersKHR&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DisplayModeParametersKHR const& rhs ) const { - offset = offset_; - return *this; + return ( visibleRegion == rhs.visibleRegion ) + && ( refreshRate == rhs.refreshRate ); } - Rect2D& setExtent( Extent2D extent_ ) + bool operator!=( DisplayModeParametersKHR const& rhs ) const { - extent = extent_; - return *this; + return !operator==( rhs ); } - operator const VkRect2D&() const + Extent2D visibleRegion; + uint32_t refreshRate; + }; + static_assert( sizeof( DisplayModeParametersKHR ) == sizeof( VkDisplayModeParametersKHR ), "struct and wrapper have different size!" ); + + struct DisplayModePropertiesKHR + { + operator const VkDisplayModePropertiesKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( Rect2D const& rhs ) const + bool operator==( DisplayModePropertiesKHR const& rhs ) const { - return ( offset == rhs.offset ) - && ( extent == rhs.extent ); + return ( displayMode == rhs.displayMode ) + && ( parameters == rhs.parameters ); } - bool operator!=( Rect2D const& rhs ) const + bool operator!=( DisplayModePropertiesKHR const& rhs ) const { return !operator==( rhs ); } - Offset2D offset; - Extent2D extent; + DisplayModeKHR displayMode; + DisplayModeParametersKHR parameters; }; - static_assert( sizeof( Rect2D ) == sizeof( VkRect2D ), "struct and wrapper have different size!" ); + static_assert( sizeof( DisplayModePropertiesKHR ) == sizeof( VkDisplayModePropertiesKHR ), "struct and wrapper have different size!" ); - struct ClearRect + struct RectLayerKHR { - ClearRect( Rect2D rect_ = Rect2D(), uint32_t baseArrayLayer_ = 0, uint32_t layerCount_ = 0 ) - : rect( rect_ ) - , baseArrayLayer( baseArrayLayer_ ) - , layerCount( layerCount_ ) + RectLayerKHR( Offset2D offset_ = Offset2D(), Extent2D extent_ = Extent2D(), uint32_t layer_ = 0 ) + : offset( offset_ ) + , extent( extent_ ) + , layer( layer_ ) { } - ClearRect( VkClearRect const & rhs ) + RectLayerKHR( VkRectLayerKHR const & rhs ) { - memcpy( this, &rhs, sizeof( ClearRect ) ); + memcpy( this, &rhs, sizeof( RectLayerKHR ) ); } - ClearRect& operator=( VkClearRect const & rhs ) + RectLayerKHR& operator=( VkRectLayerKHR const & rhs ) { - memcpy( this, &rhs, sizeof( ClearRect ) ); + memcpy( this, &rhs, sizeof( RectLayerKHR ) ); return *this; } - ClearRect& setRect( Rect2D rect_ ) + RectLayerKHR& setOffset( Offset2D offset_ ) { - rect = rect_; + offset = offset_; return *this; } - ClearRect& setBaseArrayLayer( uint32_t baseArrayLayer_ ) + RectLayerKHR& setExtent( Extent2D extent_ ) { - baseArrayLayer = baseArrayLayer_; + extent = extent_; return *this; } - ClearRect& setLayerCount( uint32_t layerCount_ ) + RectLayerKHR& setLayer( uint32_t layer_ ) { - layerCount = layerCount_; + layer = layer_; return *this; } - operator const VkClearRect&() const + operator const VkRectLayerKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ClearRect const& rhs ) const + bool operator==( RectLayerKHR const& rhs ) const { - return ( rect == rhs.rect ) - && ( baseArrayLayer == rhs.baseArrayLayer ) - && ( layerCount == rhs.layerCount ); + return ( offset == rhs.offset ) + && ( extent == rhs.extent ) + && ( layer == rhs.layer ); } - bool operator!=( ClearRect const& rhs ) const + bool operator!=( RectLayerKHR const& rhs ) const { return !operator==( rhs ); } - Rect2D rect; - uint32_t baseArrayLayer; - uint32_t layerCount; + Offset2D offset; + Extent2D extent; + uint32_t layer; }; - static_assert( sizeof( ClearRect ) == sizeof( VkClearRect ), "struct and wrapper have different size!" ); + static_assert( sizeof( RectLayerKHR ) == sizeof( VkRectLayerKHR ), "struct and wrapper have different size!" ); - struct ExtensionProperties + struct PresentRegionKHR { - operator const VkExtensionProperties&() const + PresentRegionKHR( uint32_t rectangleCount_ = 0, const RectLayerKHR* pRectangles_ = nullptr ) + : rectangleCount( rectangleCount_ ) + , pRectangles( pRectangles_ ) { - return *reinterpret_cast(this); } - bool operator==( ExtensionProperties const& rhs ) const + PresentRegionKHR( VkPresentRegionKHR const & rhs ) { - return ( memcmp( extensionName, rhs.extensionName, VK_MAX_EXTENSION_NAME_SIZE * sizeof( char ) ) == 0 ) - && ( specVersion == rhs.specVersion ); + memcpy( this, &rhs, sizeof( PresentRegionKHR ) ); } - bool operator!=( ExtensionProperties const& rhs ) const + PresentRegionKHR& operator=( VkPresentRegionKHR const & rhs ) { - return !operator==( rhs ); + memcpy( this, &rhs, sizeof( PresentRegionKHR ) ); + return *this; + } + PresentRegionKHR& setRectangleCount( uint32_t rectangleCount_ ) + { + rectangleCount = rectangleCount_; + return *this; } - char extensionName[VK_MAX_EXTENSION_NAME_SIZE]; - uint32_t specVersion; - }; - static_assert( sizeof( ExtensionProperties ) == sizeof( VkExtensionProperties ), "struct and wrapper have different size!" ); + PresentRegionKHR& setPRectangles( const RectLayerKHR* pRectangles_ ) + { + pRectangles = pRectangles_; + return *this; + } - struct LayerProperties - { - operator const VkLayerProperties&() const + operator const VkPresentRegionKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( LayerProperties const& rhs ) const + bool operator==( PresentRegionKHR const& rhs ) const { - return ( memcmp( layerName, rhs.layerName, VK_MAX_EXTENSION_NAME_SIZE * sizeof( char ) ) == 0 ) - && ( specVersion == rhs.specVersion ) - && ( implementationVersion == rhs.implementationVersion ) - && ( memcmp( description, rhs.description, VK_MAX_DESCRIPTION_SIZE * sizeof( char ) ) == 0 ); + return ( rectangleCount == rhs.rectangleCount ) + && ( pRectangles == rhs.pRectangles ); } - bool operator!=( LayerProperties const& rhs ) const + bool operator!=( PresentRegionKHR const& rhs ) const { return !operator==( rhs ); } - char layerName[VK_MAX_EXTENSION_NAME_SIZE]; - uint32_t specVersion; - uint32_t implementationVersion; - char description[VK_MAX_DESCRIPTION_SIZE]; + uint32_t rectangleCount; + const RectLayerKHR* pRectangles; }; - static_assert( sizeof( LayerProperties ) == sizeof( VkLayerProperties ), "struct and wrapper have different size!" ); + static_assert( sizeof( PresentRegionKHR ) == sizeof( VkPresentRegionKHR ), "struct and wrapper have different size!" ); - struct AllocationCallbacks + struct XYColorEXT { - AllocationCallbacks( void* pUserData_ = nullptr, PFN_vkAllocationFunction pfnAllocation_ = nullptr, PFN_vkReallocationFunction pfnReallocation_ = nullptr, PFN_vkFreeFunction pfnFree_ = nullptr, PFN_vkInternalAllocationNotification pfnInternalAllocation_ = nullptr, PFN_vkInternalFreeNotification pfnInternalFree_ = nullptr ) - : pUserData( pUserData_ ) - , pfnAllocation( pfnAllocation_ ) - , pfnReallocation( pfnReallocation_ ) - , pfnFree( pfnFree_ ) - , pfnInternalAllocation( pfnInternalAllocation_ ) - , pfnInternalFree( pfnInternalFree_ ) + XYColorEXT( float x_ = 0, float y_ = 0 ) + : x( x_ ) + , y( y_ ) { } - AllocationCallbacks( VkAllocationCallbacks const & rhs ) + XYColorEXT( VkXYColorEXT const & rhs ) { - memcpy( this, &rhs, sizeof( AllocationCallbacks ) ); + memcpy( this, &rhs, sizeof( XYColorEXT ) ); } - AllocationCallbacks& operator=( VkAllocationCallbacks const & rhs ) + XYColorEXT& operator=( VkXYColorEXT const & rhs ) { - memcpy( this, &rhs, sizeof( AllocationCallbacks ) ); + memcpy( this, &rhs, sizeof( XYColorEXT ) ); return *this; } - AllocationCallbacks& setPUserData( void* pUserData_ ) + XYColorEXT& setX( float x_ ) { - pUserData = pUserData_; + x = x_; return *this; } - AllocationCallbacks& setPfnAllocation( PFN_vkAllocationFunction pfnAllocation_ ) + XYColorEXT& setY( float y_ ) { - pfnAllocation = pfnAllocation_; + y = y_; return *this; } - AllocationCallbacks& setPfnReallocation( PFN_vkReallocationFunction pfnReallocation_ ) + operator const VkXYColorEXT&() const { - pfnReallocation = pfnReallocation_; - return *this; + return *reinterpret_cast(this); } - AllocationCallbacks& setPfnFree( PFN_vkFreeFunction pfnFree_ ) + bool operator==( XYColorEXT const& rhs ) const { - pfnFree = pfnFree_; - return *this; + return ( x == rhs.x ) + && ( y == rhs.y ); } - AllocationCallbacks& setPfnInternalAllocation( PFN_vkInternalAllocationNotification pfnInternalAllocation_ ) + bool operator!=( XYColorEXT const& rhs ) const { - pfnInternalAllocation = pfnInternalAllocation_; - return *this; + return !operator==( rhs ); } - AllocationCallbacks& setPfnInternalFree( PFN_vkInternalFreeNotification pfnInternalFree_ ) + float x; + float y; + }; + static_assert( sizeof( XYColorEXT ) == sizeof( VkXYColorEXT ), "struct and wrapper have different size!" ); + + struct RefreshCycleDurationGOOGLE + { + RefreshCycleDurationGOOGLE( uint64_t refreshDuration_ = 0 ) + : refreshDuration( refreshDuration_ ) { - pfnInternalFree = pfnInternalFree_; - return *this; } - operator const VkAllocationCallbacks&() const + RefreshCycleDurationGOOGLE( VkRefreshCycleDurationGOOGLE const & rhs ) { - return *reinterpret_cast(this); + memcpy( this, &rhs, sizeof( RefreshCycleDurationGOOGLE ) ); } - bool operator==( AllocationCallbacks const& rhs ) const + RefreshCycleDurationGOOGLE& operator=( VkRefreshCycleDurationGOOGLE const & rhs ) { - return ( pUserData == rhs.pUserData ) - && ( pfnAllocation == rhs.pfnAllocation ) - && ( pfnReallocation == rhs.pfnReallocation ) - && ( pfnFree == rhs.pfnFree ) - && ( pfnInternalAllocation == rhs.pfnInternalAllocation ) - && ( pfnInternalFree == rhs.pfnInternalFree ); + memcpy( this, &rhs, sizeof( RefreshCycleDurationGOOGLE ) ); + return *this; } - - bool operator!=( AllocationCallbacks const& rhs ) const + RefreshCycleDurationGOOGLE& setRefreshDuration( uint64_t refreshDuration_ ) { - return !operator==( rhs ); + refreshDuration = refreshDuration_; + return *this; } - void* pUserData; - PFN_vkAllocationFunction pfnAllocation; - PFN_vkReallocationFunction pfnReallocation; - PFN_vkFreeFunction pfnFree; - PFN_vkInternalAllocationNotification pfnInternalAllocation; - PFN_vkInternalFreeNotification pfnInternalFree; - }; - static_assert( sizeof( AllocationCallbacks ) == sizeof( VkAllocationCallbacks ), "struct and wrapper have different size!" ); - - struct MemoryRequirements - { - operator const VkMemoryRequirements&() const + operator const VkRefreshCycleDurationGOOGLE&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( MemoryRequirements const& rhs ) const + bool operator==( RefreshCycleDurationGOOGLE const& rhs ) const { - return ( size == rhs.size ) - && ( alignment == rhs.alignment ) - && ( memoryTypeBits == rhs.memoryTypeBits ); + return ( refreshDuration == rhs.refreshDuration ); } - bool operator!=( MemoryRequirements const& rhs ) const + bool operator!=( RefreshCycleDurationGOOGLE const& rhs ) const { return !operator==( rhs ); } - DeviceSize size; - DeviceSize alignment; - uint32_t memoryTypeBits; + uint64_t refreshDuration; }; - static_assert( sizeof( MemoryRequirements ) == sizeof( VkMemoryRequirements ), "struct and wrapper have different size!" ); + static_assert( sizeof( RefreshCycleDurationGOOGLE ) == sizeof( VkRefreshCycleDurationGOOGLE ), "struct and wrapper have different size!" ); + + struct PastPresentationTimingGOOGLE + { + PastPresentationTimingGOOGLE( uint32_t presentID_ = 0, uint64_t desiredPresentTime_ = 0, uint64_t actualPresentTime_ = 0, uint64_t earliestPresentTime_ = 0, uint64_t presentMargin_ = 0 ) + : presentID( presentID_ ) + , desiredPresentTime( desiredPresentTime_ ) + , actualPresentTime( actualPresentTime_ ) + , earliestPresentTime( earliestPresentTime_ ) + , presentMargin( presentMargin_ ) + { + } - struct DescriptorBufferInfo - { - DescriptorBufferInfo( Buffer buffer_ = Buffer(), DeviceSize offset_ = 0, DeviceSize range_ = 0 ) - : buffer( buffer_ ) - , offset( offset_ ) - , range( range_ ) + PastPresentationTimingGOOGLE( VkPastPresentationTimingGOOGLE const & rhs ) { + memcpy( this, &rhs, sizeof( PastPresentationTimingGOOGLE ) ); } - DescriptorBufferInfo( VkDescriptorBufferInfo const & rhs ) + PastPresentationTimingGOOGLE& operator=( VkPastPresentationTimingGOOGLE const & rhs ) { - memcpy( this, &rhs, sizeof( DescriptorBufferInfo ) ); + memcpy( this, &rhs, sizeof( PastPresentationTimingGOOGLE ) ); + return *this; + } + PastPresentationTimingGOOGLE& setPresentID( uint32_t presentID_ ) + { + presentID = presentID_; + return *this; } - DescriptorBufferInfo& operator=( VkDescriptorBufferInfo const & rhs ) + PastPresentationTimingGOOGLE& setDesiredPresentTime( uint64_t desiredPresentTime_ ) { - memcpy( this, &rhs, sizeof( DescriptorBufferInfo ) ); + desiredPresentTime = desiredPresentTime_; return *this; } - DescriptorBufferInfo& setBuffer( Buffer buffer_ ) + + PastPresentationTimingGOOGLE& setActualPresentTime( uint64_t actualPresentTime_ ) { - buffer = buffer_; + actualPresentTime = actualPresentTime_; return *this; } - DescriptorBufferInfo& setOffset( DeviceSize offset_ ) + PastPresentationTimingGOOGLE& setEarliestPresentTime( uint64_t earliestPresentTime_ ) { - offset = offset_; + earliestPresentTime = earliestPresentTime_; return *this; } - DescriptorBufferInfo& setRange( DeviceSize range_ ) + PastPresentationTimingGOOGLE& setPresentMargin( uint64_t presentMargin_ ) { - range = range_; + presentMargin = presentMargin_; return *this; } - operator const VkDescriptorBufferInfo&() const + operator const VkPastPresentationTimingGOOGLE&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DescriptorBufferInfo const& rhs ) const + bool operator==( PastPresentationTimingGOOGLE const& rhs ) const { - return ( buffer == rhs.buffer ) - && ( offset == rhs.offset ) - && ( range == rhs.range ); + return ( presentID == rhs.presentID ) + && ( desiredPresentTime == rhs.desiredPresentTime ) + && ( actualPresentTime == rhs.actualPresentTime ) + && ( earliestPresentTime == rhs.earliestPresentTime ) + && ( presentMargin == rhs.presentMargin ); } - bool operator!=( DescriptorBufferInfo const& rhs ) const + bool operator!=( PastPresentationTimingGOOGLE const& rhs ) const { return !operator==( rhs ); } - Buffer buffer; - DeviceSize offset; - DeviceSize range; + uint32_t presentID; + uint64_t desiredPresentTime; + uint64_t actualPresentTime; + uint64_t earliestPresentTime; + uint64_t presentMargin; }; - static_assert( sizeof( DescriptorBufferInfo ) == sizeof( VkDescriptorBufferInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( PastPresentationTimingGOOGLE ) == sizeof( VkPastPresentationTimingGOOGLE ), "struct and wrapper have different size!" ); - struct SubresourceLayout + struct PresentTimeGOOGLE { - operator const VkSubresourceLayout&() const + PresentTimeGOOGLE( uint32_t presentID_ = 0, uint64_t desiredPresentTime_ = 0 ) + : presentID( presentID_ ) + , desiredPresentTime( desiredPresentTime_ ) { - return *reinterpret_cast(this); } - bool operator==( SubresourceLayout const& rhs ) const + PresentTimeGOOGLE( VkPresentTimeGOOGLE const & rhs ) { - return ( offset == rhs.offset ) - && ( size == rhs.size ) - && ( rowPitch == rhs.rowPitch ) - && ( arrayPitch == rhs.arrayPitch ) - && ( depthPitch == rhs.depthPitch ); + memcpy( this, &rhs, sizeof( PresentTimeGOOGLE ) ); } - bool operator!=( SubresourceLayout const& rhs ) const + PresentTimeGOOGLE& operator=( VkPresentTimeGOOGLE const & rhs ) + { + memcpy( this, &rhs, sizeof( PresentTimeGOOGLE ) ); + return *this; + } + PresentTimeGOOGLE& setPresentID( uint32_t presentID_ ) + { + presentID = presentID_; + return *this; + } + + PresentTimeGOOGLE& setDesiredPresentTime( uint64_t desiredPresentTime_ ) + { + desiredPresentTime = desiredPresentTime_; + return *this; + } + + operator const VkPresentTimeGOOGLE&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PresentTimeGOOGLE const& rhs ) const + { + return ( presentID == rhs.presentID ) + && ( desiredPresentTime == rhs.desiredPresentTime ); + } + + bool operator!=( PresentTimeGOOGLE const& rhs ) const { return !operator==( rhs ); } - DeviceSize offset; - DeviceSize size; - DeviceSize rowPitch; - DeviceSize arrayPitch; - DeviceSize depthPitch; + uint32_t presentID; + uint64_t desiredPresentTime; }; - static_assert( sizeof( SubresourceLayout ) == sizeof( VkSubresourceLayout ), "struct and wrapper have different size!" ); + static_assert( sizeof( PresentTimeGOOGLE ) == sizeof( VkPresentTimeGOOGLE ), "struct and wrapper have different size!" ); - struct BufferCopy + struct ViewportWScalingNV { - BufferCopy( DeviceSize srcOffset_ = 0, DeviceSize dstOffset_ = 0, DeviceSize size_ = 0 ) - : srcOffset( srcOffset_ ) - , dstOffset( dstOffset_ ) - , size( size_ ) + ViewportWScalingNV( float xcoeff_ = 0, float ycoeff_ = 0 ) + : xcoeff( xcoeff_ ) + , ycoeff( ycoeff_ ) { } - BufferCopy( VkBufferCopy const & rhs ) + ViewportWScalingNV( VkViewportWScalingNV const & rhs ) { - memcpy( this, &rhs, sizeof( BufferCopy ) ); + memcpy( this, &rhs, sizeof( ViewportWScalingNV ) ); } - BufferCopy& operator=( VkBufferCopy const & rhs ) - { - memcpy( this, &rhs, sizeof( BufferCopy ) ); - return *this; - } - BufferCopy& setSrcOffset( DeviceSize srcOffset_ ) + ViewportWScalingNV& operator=( VkViewportWScalingNV const & rhs ) { - srcOffset = srcOffset_; + memcpy( this, &rhs, sizeof( ViewportWScalingNV ) ); return *this; } - - BufferCopy& setDstOffset( DeviceSize dstOffset_ ) + ViewportWScalingNV& setXcoeff( float xcoeff_ ) { - dstOffset = dstOffset_; + xcoeff = xcoeff_; return *this; } - BufferCopy& setSize( DeviceSize size_ ) + ViewportWScalingNV& setYcoeff( float ycoeff_ ) { - size = size_; + ycoeff = ycoeff_; return *this; } - operator const VkBufferCopy&() const + operator const VkViewportWScalingNV&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( BufferCopy const& rhs ) const + bool operator==( ViewportWScalingNV const& rhs ) const { - return ( srcOffset == rhs.srcOffset ) - && ( dstOffset == rhs.dstOffset ) - && ( size == rhs.size ); + return ( xcoeff == rhs.xcoeff ) + && ( ycoeff == rhs.ycoeff ); } - bool operator!=( BufferCopy const& rhs ) const + bool operator!=( ViewportWScalingNV const& rhs ) const { return !operator==( rhs ); } - DeviceSize srcOffset; - DeviceSize dstOffset; - DeviceSize size; + float xcoeff; + float ycoeff; }; - static_assert( sizeof( BufferCopy ) == sizeof( VkBufferCopy ), "struct and wrapper have different size!" ); + static_assert( sizeof( ViewportWScalingNV ) == sizeof( VkViewportWScalingNV ), "struct and wrapper have different size!" ); - struct SpecializationMapEntry + struct SampleLocationEXT { - SpecializationMapEntry( uint32_t constantID_ = 0, uint32_t offset_ = 0, size_t size_ = 0 ) - : constantID( constantID_ ) - , offset( offset_ ) - , size( size_ ) + SampleLocationEXT( float x_ = 0, float y_ = 0 ) + : x( x_ ) + , y( y_ ) { } - SpecializationMapEntry( VkSpecializationMapEntry const & rhs ) + SampleLocationEXT( VkSampleLocationEXT const & rhs ) { - memcpy( this, &rhs, sizeof( SpecializationMapEntry ) ); + memcpy( this, &rhs, sizeof( SampleLocationEXT ) ); } - SpecializationMapEntry& operator=( VkSpecializationMapEntry const & rhs ) - { - memcpy( this, &rhs, sizeof( SpecializationMapEntry ) ); - return *this; - } - SpecializationMapEntry& setConstantID( uint32_t constantID_ ) + SampleLocationEXT& operator=( VkSampleLocationEXT const & rhs ) { - constantID = constantID_; + memcpy( this, &rhs, sizeof( SampleLocationEXT ) ); return *this; } - - SpecializationMapEntry& setOffset( uint32_t offset_ ) + SampleLocationEXT& setX( float x_ ) { - offset = offset_; + x = x_; return *this; } - SpecializationMapEntry& setSize( size_t size_ ) + SampleLocationEXT& setY( float y_ ) { - size = size_; + y = y_; return *this; } - operator const VkSpecializationMapEntry&() const + operator const VkSampleLocationEXT&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( SpecializationMapEntry const& rhs ) const + bool operator==( SampleLocationEXT const& rhs ) const { - return ( constantID == rhs.constantID ) - && ( offset == rhs.offset ) - && ( size == rhs.size ); + return ( x == rhs.x ) + && ( y == rhs.y ); } - bool operator!=( SpecializationMapEntry const& rhs ) const + bool operator!=( SampleLocationEXT const& rhs ) const { return !operator==( rhs ); } - uint32_t constantID; - uint32_t offset; - size_t size; + float x; + float y; }; - static_assert( sizeof( SpecializationMapEntry ) == sizeof( VkSpecializationMapEntry ), "struct and wrapper have different size!" ); + static_assert( sizeof( SampleLocationEXT ) == sizeof( VkSampleLocationEXT ), "struct and wrapper have different size!" ); - struct SpecializationInfo + struct ShaderResourceUsageAMD { - SpecializationInfo( uint32_t mapEntryCount_ = 0, const SpecializationMapEntry* pMapEntries_ = nullptr, size_t dataSize_ = 0, const void* pData_ = nullptr ) - : mapEntryCount( mapEntryCount_ ) - , pMapEntries( pMapEntries_ ) - , dataSize( dataSize_ ) - , pData( pData_ ) + operator const VkShaderResourceUsageAMD&() const { + return *reinterpret_cast(this); } - SpecializationInfo( VkSpecializationInfo const & rhs ) + bool operator==( ShaderResourceUsageAMD const& rhs ) const { - memcpy( this, &rhs, sizeof( SpecializationInfo ) ); + return ( numUsedVgprs == rhs.numUsedVgprs ) + && ( numUsedSgprs == rhs.numUsedSgprs ) + && ( ldsSizePerLocalWorkGroup == rhs.ldsSizePerLocalWorkGroup ) + && ( ldsUsageSizeInBytes == rhs.ldsUsageSizeInBytes ) + && ( scratchMemUsageInBytes == rhs.scratchMemUsageInBytes ); } - SpecializationInfo& operator=( VkSpecializationInfo const & rhs ) + bool operator!=( ShaderResourceUsageAMD const& rhs ) const + { + return !operator==( rhs ); + } + + uint32_t numUsedVgprs; + uint32_t numUsedSgprs; + uint32_t ldsSizePerLocalWorkGroup; + size_t ldsUsageSizeInBytes; + size_t scratchMemUsageInBytes; + }; + static_assert( sizeof( ShaderResourceUsageAMD ) == sizeof( VkShaderResourceUsageAMD ), "struct and wrapper have different size!" ); + + struct VertexInputBindingDivisorDescriptionEXT + { + VertexInputBindingDivisorDescriptionEXT( uint32_t binding_ = 0, uint32_t divisor_ = 0 ) + : binding( binding_ ) + , divisor( divisor_ ) { - memcpy( this, &rhs, sizeof( SpecializationInfo ) ); - return *this; } - SpecializationInfo& setMapEntryCount( uint32_t mapEntryCount_ ) + + VertexInputBindingDivisorDescriptionEXT( VkVertexInputBindingDivisorDescriptionEXT const & rhs ) { - mapEntryCount = mapEntryCount_; - return *this; + memcpy( this, &rhs, sizeof( VertexInputBindingDivisorDescriptionEXT ) ); } - SpecializationInfo& setPMapEntries( const SpecializationMapEntry* pMapEntries_ ) + VertexInputBindingDivisorDescriptionEXT& operator=( VkVertexInputBindingDivisorDescriptionEXT const & rhs ) { - pMapEntries = pMapEntries_; + memcpy( this, &rhs, sizeof( VertexInputBindingDivisorDescriptionEXT ) ); return *this; } - - SpecializationInfo& setDataSize( size_t dataSize_ ) + VertexInputBindingDivisorDescriptionEXT& setBinding( uint32_t binding_ ) { - dataSize = dataSize_; + binding = binding_; return *this; } - SpecializationInfo& setPData( const void* pData_ ) + VertexInputBindingDivisorDescriptionEXT& setDivisor( uint32_t divisor_ ) { - pData = pData_; + divisor = divisor_; return *this; } - operator const VkSpecializationInfo&() const + operator const VkVertexInputBindingDivisorDescriptionEXT&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( SpecializationInfo const& rhs ) const + bool operator==( VertexInputBindingDivisorDescriptionEXT const& rhs ) const { - return ( mapEntryCount == rhs.mapEntryCount ) - && ( pMapEntries == rhs.pMapEntries ) - && ( dataSize == rhs.dataSize ) - && ( pData == rhs.pData ); + return ( binding == rhs.binding ) + && ( divisor == rhs.divisor ); } - bool operator!=( SpecializationInfo const& rhs ) const + bool operator!=( VertexInputBindingDivisorDescriptionEXT const& rhs ) const { return !operator==( rhs ); } - uint32_t mapEntryCount; - const SpecializationMapEntry* pMapEntries; - size_t dataSize; - const void* pData; + uint32_t binding; + uint32_t divisor; }; - static_assert( sizeof( SpecializationInfo ) == sizeof( VkSpecializationInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( VertexInputBindingDivisorDescriptionEXT ) == sizeof( VkVertexInputBindingDivisorDescriptionEXT ), "struct and wrapper have different size!" ); - union ClearColorValue + enum class ImageLayout { - ClearColorValue( const std::array& float32_ = { {0} } ) + 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, + eDepthReadOnlyStencilAttachmentOptimalKHR = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, + eDepthAttachmentStencilReadOnlyOptimal = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, + eDepthAttachmentStencilReadOnlyOptimalKHR = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, + ePresentSrcKHR = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, + eSharedPresentKHR = VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR + }; + + struct DescriptorImageInfo + { + DescriptorImageInfo( Sampler sampler_ = Sampler(), ImageView imageView_ = ImageView(), ImageLayout imageLayout_ = ImageLayout::eUndefined ) + : sampler( sampler_ ) + , imageView( imageView_ ) + , imageLayout( imageLayout_ ) { - memcpy( &float32, float32_.data(), 4 * sizeof( float ) ); } - ClearColorValue( const std::array& int32_ ) + DescriptorImageInfo( VkDescriptorImageInfo const & rhs ) { - memcpy( &int32, int32_.data(), 4 * sizeof( int32_t ) ); + memcpy( this, &rhs, sizeof( DescriptorImageInfo ) ); } - ClearColorValue( const std::array& uint32_ ) + DescriptorImageInfo& operator=( VkDescriptorImageInfo const & rhs ) { - memcpy( &uint32, uint32_.data(), 4 * sizeof( uint32_t ) ); + memcpy( this, &rhs, sizeof( DescriptorImageInfo ) ); + return *this; } - - ClearColorValue& setFloat32( std::array float32_ ) + DescriptorImageInfo& setSampler( Sampler sampler_ ) { - memcpy( &float32, float32_.data(), 4 * sizeof( float ) ); + sampler = sampler_; return *this; } - ClearColorValue& setInt32( std::array int32_ ) + DescriptorImageInfo& setImageView( ImageView imageView_ ) { - memcpy( &int32, int32_.data(), 4 * sizeof( int32_t ) ); + imageView = imageView_; return *this; } - ClearColorValue& setUint32( std::array uint32_ ) + DescriptorImageInfo& setImageLayout( ImageLayout imageLayout_ ) { - memcpy( &uint32, uint32_.data(), 4 * sizeof( uint32_t ) ); + imageLayout = imageLayout_; return *this; } - operator VkClearColorValue const& () const + operator const VkDescriptorImageInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - float float32[4]; - int32_t int32[4]; - uint32_t uint32[4]; + bool operator==( DescriptorImageInfo const& rhs ) const + { + return ( sampler == rhs.sampler ) + && ( imageView == rhs.imageView ) + && ( imageLayout == rhs.imageLayout ); + } + + bool operator!=( DescriptorImageInfo const& rhs ) const + { + return !operator==( rhs ); + } + + Sampler sampler; + ImageView imageView; + ImageLayout imageLayout; }; + static_assert( sizeof( DescriptorImageInfo ) == sizeof( VkDescriptorImageInfo ), "struct and wrapper have different size!" ); - struct ClearDepthStencilValue + struct AttachmentReference { - ClearDepthStencilValue( float depth_ = 0, uint32_t stencil_ = 0 ) - : depth( depth_ ) - , stencil( stencil_ ) + AttachmentReference( uint32_t attachment_ = 0, ImageLayout layout_ = ImageLayout::eUndefined ) + : attachment( attachment_ ) + , layout( layout_ ) { } - ClearDepthStencilValue( VkClearDepthStencilValue const & rhs ) + AttachmentReference( VkAttachmentReference const & rhs ) { - memcpy( this, &rhs, sizeof( ClearDepthStencilValue ) ); + memcpy( this, &rhs, sizeof( AttachmentReference ) ); } - ClearDepthStencilValue& operator=( VkClearDepthStencilValue const & rhs ) + AttachmentReference& operator=( VkAttachmentReference const & rhs ) { - memcpy( this, &rhs, sizeof( ClearDepthStencilValue ) ); + memcpy( this, &rhs, sizeof( AttachmentReference ) ); return *this; } - ClearDepthStencilValue& setDepth( float depth_ ) + AttachmentReference& setAttachment( uint32_t attachment_ ) { - depth = depth_; + attachment = attachment_; return *this; } - ClearDepthStencilValue& setStencil( uint32_t stencil_ ) + AttachmentReference& setLayout( ImageLayout layout_ ) { - stencil = stencil_; + layout = layout_; return *this; } - operator const VkClearDepthStencilValue&() const + operator const VkAttachmentReference&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ClearDepthStencilValue const& rhs ) const + bool operator==( AttachmentReference const& rhs ) const { - return ( depth == rhs.depth ) - && ( stencil == rhs.stencil ); + return ( attachment == rhs.attachment ) + && ( layout == rhs.layout ); } - bool operator!=( ClearDepthStencilValue const& rhs ) const + bool operator!=( AttachmentReference const& rhs ) const { return !operator==( rhs ); } - float depth; - uint32_t stencil; + uint32_t attachment; + ImageLayout layout; }; - static_assert( sizeof( ClearDepthStencilValue ) == sizeof( VkClearDepthStencilValue ), "struct and wrapper have different size!" ); + static_assert( sizeof( AttachmentReference ) == sizeof( VkAttachmentReference ), "struct and wrapper have different size!" ); - union ClearValue + enum class AttachmentLoadOp { - ClearValue( ClearColorValue color_ = ClearColorValue() ) - { - color = color_; - } - - ClearValue( ClearDepthStencilValue depthStencil_ ) - { - depthStencil = depthStencil_; - } - - ClearValue& setColor( ClearColorValue color_ ) - { - color = color_; - return *this; - } + eLoad = VK_ATTACHMENT_LOAD_OP_LOAD, + eClear = VK_ATTACHMENT_LOAD_OP_CLEAR, + eDontCare = VK_ATTACHMENT_LOAD_OP_DONT_CARE + }; - ClearValue& setDepthStencil( ClearDepthStencilValue depthStencil_ ) - { - depthStencil = depthStencil_; - return *this; - } + enum class AttachmentStoreOp + { + eStore = VK_ATTACHMENT_STORE_OP_STORE, + eDontCare = VK_ATTACHMENT_STORE_OP_DONT_CARE + }; - operator VkClearValue const& () const - { - return *reinterpret_cast(this); - } + enum class ImageType + { + e1D = VK_IMAGE_TYPE_1D, + e2D = VK_IMAGE_TYPE_2D, + e3D = VK_IMAGE_TYPE_3D + }; -#ifdef VULKAN_HPP_HAS_UNRESTRICTED_UNIONS - ClearColorValue color; - ClearDepthStencilValue depthStencil; -#else - VkClearColorValue color; - VkClearDepthStencilValue depthStencil; -#endif // VULKAN_HPP_HAS_UNRESTRICTED_UNIONS + enum class ImageTiling + { + eOptimal = VK_IMAGE_TILING_OPTIMAL, + eLinear = VK_IMAGE_TILING_LINEAR }; - struct PhysicalDeviceFeatures + enum class ImageViewType { - PhysicalDeviceFeatures( Bool32 robustBufferAccess_ = 0, Bool32 fullDrawIndexUint32_ = 0, Bool32 imageCubeArray_ = 0, Bool32 independentBlend_ = 0, Bool32 geometryShader_ = 0, Bool32 tessellationShader_ = 0, Bool32 sampleRateShading_ = 0, Bool32 dualSrcBlend_ = 0, Bool32 logicOp_ = 0, Bool32 multiDrawIndirect_ = 0, Bool32 drawIndirectFirstInstance_ = 0, Bool32 depthClamp_ = 0, Bool32 depthBiasClamp_ = 0, Bool32 fillModeNonSolid_ = 0, Bool32 depthBounds_ = 0, Bool32 wideLines_ = 0, Bool32 largePoints_ = 0, Bool32 alphaToOne_ = 0, Bool32 multiViewport_ = 0, Bool32 samplerAnisotropy_ = 0, Bool32 textureCompressionETC2_ = 0, Bool32 textureCompressionASTC_LDR_ = 0, Bool32 textureCompressionBC_ = 0, Bool32 occlusionQueryPrecise_ = 0, Bool32 pipelineStatisticsQuery_ = 0, Bool32 vertexPipelineStoresAndAtomics_ = 0, Bool32 fragmentStoresAndAtomics_ = 0, Bool32 shaderTessellationAndGeometryPointSize_ = 0, Bool32 shaderImageGatherExtended_ = 0, Bool32 shaderStorageImageExtendedFormats_ = 0, Bool32 shaderStorageImageMultisample_ = 0, Bool32 shaderStorageImageReadWithoutFormat_ = 0, Bool32 shaderStorageImageWriteWithoutFormat_ = 0, Bool32 shaderUniformBufferArrayDynamicIndexing_ = 0, Bool32 shaderSampledImageArrayDynamicIndexing_ = 0, Bool32 shaderStorageBufferArrayDynamicIndexing_ = 0, Bool32 shaderStorageImageArrayDynamicIndexing_ = 0, Bool32 shaderClipDistance_ = 0, Bool32 shaderCullDistance_ = 0, Bool32 shaderFloat64_ = 0, Bool32 shaderInt64_ = 0, Bool32 shaderInt16_ = 0, Bool32 shaderResourceResidency_ = 0, Bool32 shaderResourceMinLod_ = 0, Bool32 sparseBinding_ = 0, Bool32 sparseResidencyBuffer_ = 0, Bool32 sparseResidencyImage2D_ = 0, Bool32 sparseResidencyImage3D_ = 0, Bool32 sparseResidency2Samples_ = 0, Bool32 sparseResidency4Samples_ = 0, Bool32 sparseResidency8Samples_ = 0, Bool32 sparseResidency16Samples_ = 0, Bool32 sparseResidencyAliased_ = 0, Bool32 variableMultisampleRate_ = 0, Bool32 inheritedQueries_ = 0 ) - : 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_ ) + 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 CommandBufferLevel + { + ePrimary = VK_COMMAND_BUFFER_LEVEL_PRIMARY, + eSecondary = VK_COMMAND_BUFFER_LEVEL_SECONDARY + }; + + 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 + }; + + struct ComponentMapping + { + ComponentMapping( ComponentSwizzle r_ = ComponentSwizzle::eIdentity, ComponentSwizzle g_ = ComponentSwizzle::eIdentity, ComponentSwizzle b_ = ComponentSwizzle::eIdentity, ComponentSwizzle a_ = ComponentSwizzle::eIdentity ) + : r( r_ ) + , g( g_ ) + , b( b_ ) + , a( a_ ) { } - PhysicalDeviceFeatures( VkPhysicalDeviceFeatures const & rhs ) + ComponentMapping( VkComponentMapping const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceFeatures ) ); + memcpy( this, &rhs, sizeof( ComponentMapping ) ); } - PhysicalDeviceFeatures& operator=( VkPhysicalDeviceFeatures const & rhs ) + ComponentMapping& operator=( VkComponentMapping const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceFeatures ) ); + memcpy( this, &rhs, sizeof( ComponentMapping ) ); return *this; } - PhysicalDeviceFeatures& setRobustBufferAccess( Bool32 robustBufferAccess_ ) + ComponentMapping& setR( ComponentSwizzle r_ ) { - robustBufferAccess = robustBufferAccess_; + r = r_; return *this; } - PhysicalDeviceFeatures& setFullDrawIndexUint32( Bool32 fullDrawIndexUint32_ ) + ComponentMapping& setG( ComponentSwizzle g_ ) { - fullDrawIndexUint32 = fullDrawIndexUint32_; + g = g_; return *this; } - PhysicalDeviceFeatures& setImageCubeArray( Bool32 imageCubeArray_ ) + ComponentMapping& setB( ComponentSwizzle b_ ) { - imageCubeArray = imageCubeArray_; + b = b_; return *this; } - PhysicalDeviceFeatures& setIndependentBlend( Bool32 independentBlend_ ) + ComponentMapping& setA( ComponentSwizzle a_ ) { - independentBlend = independentBlend_; + a = a_; return *this; } - PhysicalDeviceFeatures& setGeometryShader( Bool32 geometryShader_ ) + operator const VkComponentMapping&() const { - geometryShader = geometryShader_; - return *this; + return *reinterpret_cast(this); } - PhysicalDeviceFeatures& setTessellationShader( Bool32 tessellationShader_ ) + bool operator==( ComponentMapping const& rhs ) const { - tessellationShader = tessellationShader_; - return *this; + return ( r == rhs.r ) + && ( g == rhs.g ) + && ( b == rhs.b ) + && ( a == rhs.a ); } - PhysicalDeviceFeatures& setSampleRateShading( Bool32 sampleRateShading_ ) + bool operator!=( ComponentMapping const& rhs ) const { - sampleRateShading = sampleRateShading_; - return *this; + return !operator==( rhs ); } - PhysicalDeviceFeatures& setDualSrcBlend( Bool32 dualSrcBlend_ ) - { - dualSrcBlend = dualSrcBlend_; - return *this; - } + ComponentSwizzle r; + ComponentSwizzle g; + ComponentSwizzle b; + ComponentSwizzle a; + }; + static_assert( sizeof( ComponentMapping ) == sizeof( VkComponentMapping ), "struct and wrapper have different size!" ); - PhysicalDeviceFeatures& setLogicOp( Bool32 logicOp_ ) - { - logicOp = logicOp_; - return *this; - } + 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 + }; - PhysicalDeviceFeatures& setMultiDrawIndirect( Bool32 multiDrawIndirect_ ) + struct DescriptorPoolSize + { + DescriptorPoolSize( DescriptorType type_ = DescriptorType::eSampler, uint32_t descriptorCount_ = 0 ) + : type( type_ ) + , descriptorCount( descriptorCount_ ) { - multiDrawIndirect = multiDrawIndirect_; - return *this; } - PhysicalDeviceFeatures& setDrawIndirectFirstInstance( Bool32 drawIndirectFirstInstance_ ) + DescriptorPoolSize( VkDescriptorPoolSize const & rhs ) { - drawIndirectFirstInstance = drawIndirectFirstInstance_; - return *this; + memcpy( this, &rhs, sizeof( DescriptorPoolSize ) ); } - PhysicalDeviceFeatures& setDepthClamp( Bool32 depthClamp_ ) + DescriptorPoolSize& operator=( VkDescriptorPoolSize const & rhs ) { - depthClamp = depthClamp_; + memcpy( this, &rhs, sizeof( DescriptorPoolSize ) ); return *this; } - - PhysicalDeviceFeatures& setDepthBiasClamp( Bool32 depthBiasClamp_ ) + DescriptorPoolSize& setType( DescriptorType type_ ) { - depthBiasClamp = depthBiasClamp_; + type = type_; return *this; } - PhysicalDeviceFeatures& setFillModeNonSolid( Bool32 fillModeNonSolid_ ) + DescriptorPoolSize& setDescriptorCount( uint32_t descriptorCount_ ) { - fillModeNonSolid = fillModeNonSolid_; + descriptorCount = descriptorCount_; return *this; } - PhysicalDeviceFeatures& setDepthBounds( Bool32 depthBounds_ ) + operator const VkDescriptorPoolSize&() const { - depthBounds = depthBounds_; - return *this; + return *reinterpret_cast(this); } - PhysicalDeviceFeatures& setWideLines( Bool32 wideLines_ ) + bool operator==( DescriptorPoolSize const& rhs ) const { - wideLines = wideLines_; - return *this; + return ( type == rhs.type ) + && ( descriptorCount == rhs.descriptorCount ); } - PhysicalDeviceFeatures& setLargePoints( Bool32 largePoints_ ) + bool operator!=( DescriptorPoolSize const& rhs ) const { - largePoints = largePoints_; - return *this; + return !operator==( rhs ); } - PhysicalDeviceFeatures& setAlphaToOne( Bool32 alphaToOne_ ) - { - alphaToOne = alphaToOne_; - return *this; - } + DescriptorType type; + uint32_t descriptorCount; + }; + static_assert( sizeof( DescriptorPoolSize ) == sizeof( VkDescriptorPoolSize ), "struct and wrapper have different size!" ); - PhysicalDeviceFeatures& setMultiViewport( Bool32 multiViewport_ ) + struct DescriptorUpdateTemplateEntry + { + DescriptorUpdateTemplateEntry( uint32_t dstBinding_ = 0, uint32_t dstArrayElement_ = 0, uint32_t descriptorCount_ = 0, DescriptorType descriptorType_ = DescriptorType::eSampler, size_t offset_ = 0, size_t stride_ = 0 ) + : dstBinding( dstBinding_ ) + , dstArrayElement( dstArrayElement_ ) + , descriptorCount( descriptorCount_ ) + , descriptorType( descriptorType_ ) + , offset( offset_ ) + , stride( stride_ ) { - multiViewport = multiViewport_; - return *this; } - PhysicalDeviceFeatures& setSamplerAnisotropy( Bool32 samplerAnisotropy_ ) + DescriptorUpdateTemplateEntry( VkDescriptorUpdateTemplateEntry const & rhs ) { - samplerAnisotropy = samplerAnisotropy_; - return *this; + memcpy( this, &rhs, sizeof( DescriptorUpdateTemplateEntry ) ); } - PhysicalDeviceFeatures& setTextureCompressionETC2( Bool32 textureCompressionETC2_ ) + DescriptorUpdateTemplateEntry& operator=( VkDescriptorUpdateTemplateEntry const & rhs ) { - textureCompressionETC2 = textureCompressionETC2_; + memcpy( this, &rhs, sizeof( DescriptorUpdateTemplateEntry ) ); return *this; } - - PhysicalDeviceFeatures& setTextureCompressionASTC_LDR( Bool32 textureCompressionASTC_LDR_ ) + DescriptorUpdateTemplateEntry& setDstBinding( uint32_t dstBinding_ ) { - textureCompressionASTC_LDR = textureCompressionASTC_LDR_; + dstBinding = dstBinding_; return *this; } - PhysicalDeviceFeatures& setTextureCompressionBC( Bool32 textureCompressionBC_ ) + DescriptorUpdateTemplateEntry& setDstArrayElement( uint32_t dstArrayElement_ ) { - textureCompressionBC = textureCompressionBC_; + dstArrayElement = dstArrayElement_; return *this; } - PhysicalDeviceFeatures& setOcclusionQueryPrecise( Bool32 occlusionQueryPrecise_ ) + DescriptorUpdateTemplateEntry& setDescriptorCount( uint32_t descriptorCount_ ) { - occlusionQueryPrecise = occlusionQueryPrecise_; + descriptorCount = descriptorCount_; return *this; } - PhysicalDeviceFeatures& setPipelineStatisticsQuery( Bool32 pipelineStatisticsQuery_ ) + DescriptorUpdateTemplateEntry& setDescriptorType( DescriptorType descriptorType_ ) { - pipelineStatisticsQuery = pipelineStatisticsQuery_; + descriptorType = descriptorType_; return *this; } - PhysicalDeviceFeatures& setVertexPipelineStoresAndAtomics( Bool32 vertexPipelineStoresAndAtomics_ ) + DescriptorUpdateTemplateEntry& setOffset( size_t offset_ ) { - vertexPipelineStoresAndAtomics = vertexPipelineStoresAndAtomics_; + offset = offset_; return *this; } - PhysicalDeviceFeatures& setFragmentStoresAndAtomics( Bool32 fragmentStoresAndAtomics_ ) + DescriptorUpdateTemplateEntry& setStride( size_t stride_ ) { - fragmentStoresAndAtomics = fragmentStoresAndAtomics_; + stride = stride_; return *this; } - PhysicalDeviceFeatures& setShaderTessellationAndGeometryPointSize( Bool32 shaderTessellationAndGeometryPointSize_ ) + operator const VkDescriptorUpdateTemplateEntry&() const { - shaderTessellationAndGeometryPointSize = shaderTessellationAndGeometryPointSize_; - return *this; + return *reinterpret_cast(this); } - PhysicalDeviceFeatures& setShaderImageGatherExtended( Bool32 shaderImageGatherExtended_ ) + bool operator==( DescriptorUpdateTemplateEntry const& rhs ) const { - shaderImageGatherExtended = shaderImageGatherExtended_; - return *this; + return ( dstBinding == rhs.dstBinding ) + && ( dstArrayElement == rhs.dstArrayElement ) + && ( descriptorCount == rhs.descriptorCount ) + && ( descriptorType == rhs.descriptorType ) + && ( offset == rhs.offset ) + && ( stride == rhs.stride ); } - PhysicalDeviceFeatures& setShaderStorageImageExtendedFormats( Bool32 shaderStorageImageExtendedFormats_ ) + bool operator!=( DescriptorUpdateTemplateEntry const& rhs ) const { - shaderStorageImageExtendedFormats = shaderStorageImageExtendedFormats_; - return *this; + return !operator==( rhs ); } - PhysicalDeviceFeatures& setShaderStorageImageMultisample( Bool32 shaderStorageImageMultisample_ ) - { - shaderStorageImageMultisample = shaderStorageImageMultisample_; - return *this; - } + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + DescriptorType descriptorType; + size_t offset; + size_t stride; + }; + static_assert( sizeof( DescriptorUpdateTemplateEntry ) == sizeof( VkDescriptorUpdateTemplateEntry ), "struct and wrapper have different size!" ); + + using DescriptorUpdateTemplateEntryKHR = DescriptorUpdateTemplateEntry; + + enum class QueryType + { + eOcclusion = VK_QUERY_TYPE_OCCLUSION, + ePipelineStatistics = VK_QUERY_TYPE_PIPELINE_STATISTICS, + eTimestamp = VK_QUERY_TYPE_TIMESTAMP + }; + + 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 + }; + + enum class PipelineBindPoint + { + eGraphics = VK_PIPELINE_BIND_POINT_GRAPHICS, + eCompute = VK_PIPELINE_BIND_POINT_COMPUTE + }; + + enum class PipelineCacheHeaderVersion + { + eOne = VK_PIPELINE_CACHE_HEADER_VERSION_ONE + }; + + 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 SharingMode + { + eExclusive = VK_SHARING_MODE_EXCLUSIVE, + eConcurrent = VK_SHARING_MODE_CONCURRENT + }; + + enum class IndexType + { + eUint16 = VK_INDEX_TYPE_UINT16, + eUint32 = VK_INDEX_TYPE_UINT32 + }; - PhysicalDeviceFeatures& setShaderStorageImageReadWithoutFormat( Bool32 shaderStorageImageReadWithoutFormat_ ) - { - shaderStorageImageReadWithoutFormat = shaderStorageImageReadWithoutFormat_; - return *this; - } + enum class Filter + { + eNearest = VK_FILTER_NEAREST, + eLinear = VK_FILTER_LINEAR, + eCubicIMG = VK_FILTER_CUBIC_IMG + }; - PhysicalDeviceFeatures& setShaderStorageImageWriteWithoutFormat( Bool32 shaderStorageImageWriteWithoutFormat_ ) - { - shaderStorageImageWriteWithoutFormat = shaderStorageImageWriteWithoutFormat_; - return *this; - } + enum class SamplerMipmapMode + { + eNearest = VK_SAMPLER_MIPMAP_MODE_NEAREST, + eLinear = VK_SAMPLER_MIPMAP_MODE_LINEAR + }; - PhysicalDeviceFeatures& setShaderUniformBufferArrayDynamicIndexing( Bool32 shaderUniformBufferArrayDynamicIndexing_ ) - { - shaderUniformBufferArrayDynamicIndexing = shaderUniformBufferArrayDynamicIndexing_; - return *this; - } + 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 + }; - PhysicalDeviceFeatures& setShaderSampledImageArrayDynamicIndexing( Bool32 shaderSampledImageArrayDynamicIndexing_ ) - { - shaderSampledImageArrayDynamicIndexing = shaderSampledImageArrayDynamicIndexing_; - return *this; - } + 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 + }; - PhysicalDeviceFeatures& setShaderStorageBufferArrayDynamicIndexing( Bool32 shaderStorageBufferArrayDynamicIndexing_ ) - { - shaderStorageBufferArrayDynamicIndexing = shaderStorageBufferArrayDynamicIndexing_; - return *this; - } + 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 + }; - PhysicalDeviceFeatures& setShaderStorageImageArrayDynamicIndexing( Bool32 shaderStorageImageArrayDynamicIndexing_ ) - { - shaderStorageImageArrayDynamicIndexing = shaderStorageImageArrayDynamicIndexing_; - return *this; - } + enum class CullModeFlagBits + { + eNone = VK_CULL_MODE_NONE, + eFront = VK_CULL_MODE_FRONT_BIT, + eBack = VK_CULL_MODE_BACK_BIT, + eFrontAndBack = VK_CULL_MODE_FRONT_AND_BACK + }; - PhysicalDeviceFeatures& setShaderClipDistance( Bool32 shaderClipDistance_ ) - { - shaderClipDistance = shaderClipDistance_; - return *this; - } + using CullModeFlags = Flags; - PhysicalDeviceFeatures& setShaderCullDistance( Bool32 shaderCullDistance_ ) - { - shaderCullDistance = shaderCullDistance_; - return *this; - } + VULKAN_HPP_INLINE CullModeFlags operator|( CullModeFlagBits bit0, CullModeFlagBits bit1 ) + { + return CullModeFlags( bit0 ) | bit1; + } - PhysicalDeviceFeatures& setShaderFloat64( Bool32 shaderFloat64_ ) - { - shaderFloat64 = shaderFloat64_; - return *this; - } + VULKAN_HPP_INLINE CullModeFlags operator~( CullModeFlagBits bits ) + { + return ~( CullModeFlags( bits ) ); + } - PhysicalDeviceFeatures& setShaderInt64( Bool32 shaderInt64_ ) + template <> struct FlagTraits + { + enum { - shaderInt64 = shaderInt64_; - return *this; - } + allFlags = VkFlags(CullModeFlagBits::eNone) | VkFlags(CullModeFlagBits::eFront) | VkFlags(CullModeFlagBits::eBack) | VkFlags(CullModeFlagBits::eFrontAndBack) + }; + }; - PhysicalDeviceFeatures& setShaderInt16( Bool32 shaderInt16_ ) - { - shaderInt16 = shaderInt16_; - return *this; - } + enum class FrontFace + { + eCounterClockwise = VK_FRONT_FACE_COUNTER_CLOCKWISE, + eClockwise = VK_FRONT_FACE_CLOCKWISE + }; - PhysicalDeviceFeatures& setShaderResourceResidency( Bool32 shaderResourceResidency_ ) - { - shaderResourceResidency = shaderResourceResidency_; - return *this; - } + 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 + }; - PhysicalDeviceFeatures& setShaderResourceMinLod( Bool32 shaderResourceMinLod_ ) - { - shaderResourceMinLod = shaderResourceMinLod_; - return *this; - } + 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 + }; - PhysicalDeviceFeatures& setSparseBinding( Bool32 sparseBinding_ ) - { - sparseBinding = sparseBinding_; - return *this; - } + 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 + }; - PhysicalDeviceFeatures& setSparseResidencyBuffer( Bool32 sparseResidencyBuffer_ ) + struct StencilOpState + { + StencilOpState( StencilOp failOp_ = StencilOp::eKeep, StencilOp passOp_ = StencilOp::eKeep, StencilOp depthFailOp_ = StencilOp::eKeep, CompareOp compareOp_ = CompareOp::eNever, uint32_t compareMask_ = 0, uint32_t writeMask_ = 0, uint32_t reference_ = 0 ) + : failOp( failOp_ ) + , passOp( passOp_ ) + , depthFailOp( depthFailOp_ ) + , compareOp( compareOp_ ) + , compareMask( compareMask_ ) + , writeMask( writeMask_ ) + , reference( reference_ ) { - sparseResidencyBuffer = sparseResidencyBuffer_; - return *this; } - PhysicalDeviceFeatures& setSparseResidencyImage2D( Bool32 sparseResidencyImage2D_ ) + StencilOpState( VkStencilOpState const & rhs ) { - sparseResidencyImage2D = sparseResidencyImage2D_; - return *this; + memcpy( this, &rhs, sizeof( StencilOpState ) ); } - PhysicalDeviceFeatures& setSparseResidencyImage3D( Bool32 sparseResidencyImage3D_ ) + StencilOpState& operator=( VkStencilOpState const & rhs ) { - sparseResidencyImage3D = sparseResidencyImage3D_; + memcpy( this, &rhs, sizeof( StencilOpState ) ); return *this; } - - PhysicalDeviceFeatures& setSparseResidency2Samples( Bool32 sparseResidency2Samples_ ) + StencilOpState& setFailOp( StencilOp failOp_ ) { - sparseResidency2Samples = sparseResidency2Samples_; + failOp = failOp_; return *this; } - PhysicalDeviceFeatures& setSparseResidency4Samples( Bool32 sparseResidency4Samples_ ) + StencilOpState& setPassOp( StencilOp passOp_ ) { - sparseResidency4Samples = sparseResidency4Samples_; + passOp = passOp_; return *this; } - PhysicalDeviceFeatures& setSparseResidency8Samples( Bool32 sparseResidency8Samples_ ) + StencilOpState& setDepthFailOp( StencilOp depthFailOp_ ) { - sparseResidency8Samples = sparseResidency8Samples_; + depthFailOp = depthFailOp_; return *this; } - PhysicalDeviceFeatures& setSparseResidency16Samples( Bool32 sparseResidency16Samples_ ) + StencilOpState& setCompareOp( CompareOp compareOp_ ) { - sparseResidency16Samples = sparseResidency16Samples_; + compareOp = compareOp_; return *this; } - PhysicalDeviceFeatures& setSparseResidencyAliased( Bool32 sparseResidencyAliased_ ) + StencilOpState& setCompareMask( uint32_t compareMask_ ) { - sparseResidencyAliased = sparseResidencyAliased_; + compareMask = compareMask_; return *this; } - PhysicalDeviceFeatures& setVariableMultisampleRate( Bool32 variableMultisampleRate_ ) + StencilOpState& setWriteMask( uint32_t writeMask_ ) { - variableMultisampleRate = variableMultisampleRate_; + writeMask = writeMask_; return *this; } - PhysicalDeviceFeatures& setInheritedQueries( Bool32 inheritedQueries_ ) + StencilOpState& setReference( uint32_t reference_ ) { - inheritedQueries = inheritedQueries_; + reference = reference_; return *this; } - operator const VkPhysicalDeviceFeatures&() const + operator const VkStencilOpState&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceFeatures const& rhs ) const + bool operator==( StencilOpState const& rhs ) const { - 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 ); + return ( failOp == rhs.failOp ) + && ( passOp == rhs.passOp ) + && ( depthFailOp == rhs.depthFailOp ) + && ( compareOp == rhs.compareOp ) + && ( compareMask == rhs.compareMask ) + && ( writeMask == rhs.writeMask ) + && ( reference == rhs.reference ); } - bool operator!=( PhysicalDeviceFeatures const& rhs ) const + bool operator!=( StencilOpState const& rhs ) const { return !operator==( rhs ); } - Bool32 robustBufferAccess; - Bool32 fullDrawIndexUint32; - Bool32 imageCubeArray; - Bool32 independentBlend; - Bool32 geometryShader; - Bool32 tessellationShader; - Bool32 sampleRateShading; - Bool32 dualSrcBlend; - Bool32 logicOp; - Bool32 multiDrawIndirect; - Bool32 drawIndirectFirstInstance; - Bool32 depthClamp; - Bool32 depthBiasClamp; - Bool32 fillModeNonSolid; - Bool32 depthBounds; - Bool32 wideLines; - Bool32 largePoints; - Bool32 alphaToOne; - Bool32 multiViewport; - Bool32 samplerAnisotropy; - Bool32 textureCompressionETC2; - Bool32 textureCompressionASTC_LDR; - Bool32 textureCompressionBC; - Bool32 occlusionQueryPrecise; - Bool32 pipelineStatisticsQuery; - Bool32 vertexPipelineStoresAndAtomics; - Bool32 fragmentStoresAndAtomics; - Bool32 shaderTessellationAndGeometryPointSize; - Bool32 shaderImageGatherExtended; - Bool32 shaderStorageImageExtendedFormats; - Bool32 shaderStorageImageMultisample; - Bool32 shaderStorageImageReadWithoutFormat; - Bool32 shaderStorageImageWriteWithoutFormat; - Bool32 shaderUniformBufferArrayDynamicIndexing; - Bool32 shaderSampledImageArrayDynamicIndexing; - Bool32 shaderStorageBufferArrayDynamicIndexing; - Bool32 shaderStorageImageArrayDynamicIndexing; - Bool32 shaderClipDistance; - Bool32 shaderCullDistance; - Bool32 shaderFloat64; - Bool32 shaderInt64; - Bool32 shaderInt16; - Bool32 shaderResourceResidency; - Bool32 shaderResourceMinLod; - Bool32 sparseBinding; - Bool32 sparseResidencyBuffer; - Bool32 sparseResidencyImage2D; - Bool32 sparseResidencyImage3D; - Bool32 sparseResidency2Samples; - Bool32 sparseResidency4Samples; - Bool32 sparseResidency8Samples; - Bool32 sparseResidency16Samples; - Bool32 sparseResidencyAliased; - Bool32 variableMultisampleRate; - Bool32 inheritedQueries; + StencilOp failOp; + StencilOp passOp; + StencilOp depthFailOp; + CompareOp compareOp; + uint32_t compareMask; + uint32_t writeMask; + uint32_t reference; }; - static_assert( sizeof( PhysicalDeviceFeatures ) == sizeof( VkPhysicalDeviceFeatures ), "struct and wrapper have different size!" ); + static_assert( sizeof( StencilOpState ) == sizeof( VkStencilOpState ), "struct and wrapper have different size!" ); - struct PhysicalDeviceSparseProperties + enum class LogicOp { - operator const VkPhysicalDeviceSparseProperties&() const - { - return *reinterpret_cast(this); - } + 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 + }; - bool operator==( PhysicalDeviceSparseProperties const& rhs ) const - { - return ( residencyStandard2DBlockShape == rhs.residencyStandard2DBlockShape ) - && ( residencyStandard2DMultisampleBlockShape == rhs.residencyStandard2DMultisampleBlockShape ) - && ( residencyStandard3DBlockShape == rhs.residencyStandard3DBlockShape ) - && ( residencyAlignedMipSize == rhs.residencyAlignedMipSize ) - && ( residencyNonResidentStrict == rhs.residencyNonResidentStrict ); - } + enum class InternalAllocationType + { + eExecutable = VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE + }; - bool operator!=( PhysicalDeviceSparseProperties const& rhs ) const - { - return !operator==( rhs ); - } + 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 + }; - Bool32 residencyStandard2DBlockShape; - Bool32 residencyStandard2DMultisampleBlockShape; - Bool32 residencyStandard3DBlockShape; - Bool32 residencyAlignedMipSize; - Bool32 residencyNonResidentStrict; + 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 }; - static_assert( sizeof( PhysicalDeviceSparseProperties ) == sizeof( VkPhysicalDeviceSparseProperties ), "struct and wrapper have different size!" ); - struct DrawIndirectCommand + enum class VertexInputRate { - DrawIndirectCommand( uint32_t vertexCount_ = 0, uint32_t instanceCount_ = 0, uint32_t firstVertex_ = 0, uint32_t firstInstance_ = 0 ) - : vertexCount( vertexCount_ ) - , instanceCount( instanceCount_ ) - , firstVertex( firstVertex_ ) - , firstInstance( firstInstance_ ) - { - } + eVertex = VK_VERTEX_INPUT_RATE_VERTEX, + eInstance = VK_VERTEX_INPUT_RATE_INSTANCE + }; - DrawIndirectCommand( VkDrawIndirectCommand const & rhs ) + struct VertexInputBindingDescription + { + VertexInputBindingDescription( uint32_t binding_ = 0, uint32_t stride_ = 0, VertexInputRate inputRate_ = VertexInputRate::eVertex ) + : binding( binding_ ) + , stride( stride_ ) + , inputRate( inputRate_ ) { - memcpy( this, &rhs, sizeof( DrawIndirectCommand ) ); } - DrawIndirectCommand& operator=( VkDrawIndirectCommand const & rhs ) + VertexInputBindingDescription( VkVertexInputBindingDescription const & rhs ) { - memcpy( this, &rhs, sizeof( DrawIndirectCommand ) ); - return *this; + memcpy( this, &rhs, sizeof( VertexInputBindingDescription ) ); } - DrawIndirectCommand& setVertexCount( uint32_t vertexCount_ ) + + VertexInputBindingDescription& operator=( VkVertexInputBindingDescription const & rhs ) { - vertexCount = vertexCount_; + memcpy( this, &rhs, sizeof( VertexInputBindingDescription ) ); return *this; } - - DrawIndirectCommand& setInstanceCount( uint32_t instanceCount_ ) + VertexInputBindingDescription& setBinding( uint32_t binding_ ) { - instanceCount = instanceCount_; + binding = binding_; return *this; } - DrawIndirectCommand& setFirstVertex( uint32_t firstVertex_ ) + VertexInputBindingDescription& setStride( uint32_t stride_ ) { - firstVertex = firstVertex_; + stride = stride_; return *this; } - DrawIndirectCommand& setFirstInstance( uint32_t firstInstance_ ) + VertexInputBindingDescription& setInputRate( VertexInputRate inputRate_ ) { - firstInstance = firstInstance_; + inputRate = inputRate_; return *this; } - operator const VkDrawIndirectCommand&() const + operator const VkVertexInputBindingDescription&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DrawIndirectCommand const& rhs ) const + bool operator==( VertexInputBindingDescription const& rhs ) const { - return ( vertexCount == rhs.vertexCount ) - && ( instanceCount == rhs.instanceCount ) - && ( firstVertex == rhs.firstVertex ) - && ( firstInstance == rhs.firstInstance ); + return ( binding == rhs.binding ) + && ( stride == rhs.stride ) + && ( inputRate == rhs.inputRate ); } - bool operator!=( DrawIndirectCommand const& rhs ) const + bool operator!=( VertexInputBindingDescription const& rhs ) const { return !operator==( rhs ); } - uint32_t vertexCount; - uint32_t instanceCount; - uint32_t firstVertex; - uint32_t firstInstance; + uint32_t binding; + uint32_t stride; + VertexInputRate inputRate; }; - static_assert( sizeof( DrawIndirectCommand ) == sizeof( VkDrawIndirectCommand ), "struct and wrapper have different size!" ); + static_assert( sizeof( VertexInputBindingDescription ) == sizeof( VkVertexInputBindingDescription ), "struct and wrapper have different size!" ); - struct DrawIndexedIndirectCommand + enum class Format { - DrawIndexedIndirectCommand( uint32_t indexCount_ = 0, uint32_t instanceCount_ = 0, uint32_t firstIndex_ = 0, int32_t vertexOffset_ = 0, uint32_t firstInstance_ = 0 ) - : indexCount( indexCount_ ) - , instanceCount( instanceCount_ ) - , firstIndex( firstIndex_ ) - , vertexOffset( vertexOffset_ ) - , firstInstance( firstInstance_ ) - { - } - - DrawIndexedIndirectCommand( VkDrawIndexedIndirectCommand const & rhs ) - { - memcpy( this, &rhs, sizeof( DrawIndexedIndirectCommand ) ); - } - - DrawIndexedIndirectCommand& operator=( VkDrawIndexedIndirectCommand const & rhs ) - { - memcpy( this, &rhs, sizeof( DrawIndexedIndirectCommand ) ); - return *this; - } - DrawIndexedIndirectCommand& setIndexCount( uint32_t indexCount_ ) - { - indexCount = indexCount_; - return *this; - } - - DrawIndexedIndirectCommand& setInstanceCount( uint32_t instanceCount_ ) - { - instanceCount = instanceCount_; - return *this; - } + 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, + eG8B8G8R8422UnormKHR = VK_FORMAT_G8B8G8R8_422_UNORM, + eB8G8R8G8422Unorm = VK_FORMAT_B8G8R8G8_422_UNORM, + eB8G8R8G8422UnormKHR = VK_FORMAT_B8G8R8G8_422_UNORM, + eG8B8R83Plane420Unorm = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM, + eG8B8R83Plane420UnormKHR = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM, + eG8B8R82Plane420Unorm = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM, + eG8B8R82Plane420UnormKHR = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM, + eG8B8R83Plane422Unorm = VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM, + eG8B8R83Plane422UnormKHR = VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM, + eG8B8R82Plane422Unorm = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM, + eG8B8R82Plane422UnormKHR = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM, + eG8B8R83Plane444Unorm = VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM, + eG8B8R83Plane444UnormKHR = VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM, + eR10X6UnormPack16 = VK_FORMAT_R10X6_UNORM_PACK16, + eR10X6UnormPack16KHR = VK_FORMAT_R10X6_UNORM_PACK16, + eR10X6G10X6Unorm2Pack16 = VK_FORMAT_R10X6G10X6_UNORM_2PACK16, + eR10X6G10X6Unorm2Pack16KHR = VK_FORMAT_R10X6G10X6_UNORM_2PACK16, + eR10X6G10X6B10X6A10X6Unorm4Pack16 = VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16, + eR10X6G10X6B10X6A10X6Unorm4Pack16KHR = VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16, + eG10X6B10X6G10X6R10X6422Unorm4Pack16 = VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16, + eG10X6B10X6G10X6R10X6422Unorm4Pack16KHR = VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16, + eB10X6G10X6R10X6G10X6422Unorm4Pack16 = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16, + eB10X6G10X6R10X6G10X6422Unorm4Pack16KHR = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16, + eG10X6B10X6R10X63Plane420Unorm3Pack16 = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, + eG10X6B10X6R10X63Plane420Unorm3Pack16KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, + eG10X6B10X6R10X62Plane420Unorm3Pack16 = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16, + eG10X6B10X6R10X62Plane420Unorm3Pack16KHR = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16, + eG10X6B10X6R10X63Plane422Unorm3Pack16 = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16, + eG10X6B10X6R10X63Plane422Unorm3Pack16KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16, + eG10X6B10X6R10X62Plane422Unorm3Pack16 = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16, + eG10X6B10X6R10X62Plane422Unorm3Pack16KHR = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16, + eG10X6B10X6R10X63Plane444Unorm3Pack16 = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16, + eG10X6B10X6R10X63Plane444Unorm3Pack16KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16, + eR12X4UnormPack16 = VK_FORMAT_R12X4_UNORM_PACK16, + eR12X4UnormPack16KHR = VK_FORMAT_R12X4_UNORM_PACK16, + eR12X4G12X4Unorm2Pack16 = VK_FORMAT_R12X4G12X4_UNORM_2PACK16, + eR12X4G12X4Unorm2Pack16KHR = VK_FORMAT_R12X4G12X4_UNORM_2PACK16, + eR12X4G12X4B12X4A12X4Unorm4Pack16 = VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16, + eR12X4G12X4B12X4A12X4Unorm4Pack16KHR = VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16, + eG12X4B12X4G12X4R12X4422Unorm4Pack16 = VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16, + eG12X4B12X4G12X4R12X4422Unorm4Pack16KHR = VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16, + eB12X4G12X4R12X4G12X4422Unorm4Pack16 = VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16, + eB12X4G12X4R12X4G12X4422Unorm4Pack16KHR = VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16, + eG12X4B12X4R12X43Plane420Unorm3Pack16 = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16, + eG12X4B12X4R12X43Plane420Unorm3Pack16KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16, + eG12X4B12X4R12X42Plane420Unorm3Pack16 = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16, + eG12X4B12X4R12X42Plane420Unorm3Pack16KHR = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16, + eG12X4B12X4R12X43Plane422Unorm3Pack16 = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16, + eG12X4B12X4R12X43Plane422Unorm3Pack16KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16, + eG12X4B12X4R12X42Plane422Unorm3Pack16 = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16, + eG12X4B12X4R12X42Plane422Unorm3Pack16KHR = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16, + eG12X4B12X4R12X43Plane444Unorm3Pack16 = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16, + eG12X4B12X4R12X43Plane444Unorm3Pack16KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16, + eG16B16G16R16422Unorm = VK_FORMAT_G16B16G16R16_422_UNORM, + eG16B16G16R16422UnormKHR = VK_FORMAT_G16B16G16R16_422_UNORM, + eB16G16R16G16422Unorm = VK_FORMAT_B16G16R16G16_422_UNORM, + eB16G16R16G16422UnormKHR = VK_FORMAT_B16G16R16G16_422_UNORM, + eG16B16R163Plane420Unorm = VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, + eG16B16R163Plane420UnormKHR = VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, + eG16B16R162Plane420Unorm = VK_FORMAT_G16_B16R16_2PLANE_420_UNORM, + eG16B16R162Plane420UnormKHR = VK_FORMAT_G16_B16R16_2PLANE_420_UNORM, + eG16B16R163Plane422Unorm = VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM, + eG16B16R163Plane422UnormKHR = VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM, + eG16B16R162Plane422Unorm = VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, + eG16B16R162Plane422UnormKHR = VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, + eG16B16R163Plane444Unorm = VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM, + eG16B16R163Plane444UnormKHR = VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM, + 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 + }; - DrawIndexedIndirectCommand& setFirstIndex( uint32_t firstIndex_ ) + struct VertexInputAttributeDescription + { + VertexInputAttributeDescription( uint32_t location_ = 0, uint32_t binding_ = 0, Format format_ = Format::eUndefined, uint32_t offset_ = 0 ) + : location( location_ ) + , binding( binding_ ) + , format( format_ ) + , offset( offset_ ) { - firstIndex = firstIndex_; - return *this; } - DrawIndexedIndirectCommand& setVertexOffset( int32_t vertexOffset_ ) + VertexInputAttributeDescription( VkVertexInputAttributeDescription const & rhs ) { - vertexOffset = vertexOffset_; - return *this; + memcpy( this, &rhs, sizeof( VertexInputAttributeDescription ) ); } - DrawIndexedIndirectCommand& setFirstInstance( uint32_t firstInstance_ ) + VertexInputAttributeDescription& operator=( VkVertexInputAttributeDescription const & rhs ) { - firstInstance = firstInstance_; + memcpy( this, &rhs, sizeof( VertexInputAttributeDescription ) ); return *this; } - - operator const VkDrawIndexedIndirectCommand&() const - { - return *reinterpret_cast(this); - } - - bool operator==( DrawIndexedIndirectCommand const& rhs ) const - { - return ( indexCount == rhs.indexCount ) - && ( instanceCount == rhs.instanceCount ) - && ( firstIndex == rhs.firstIndex ) - && ( vertexOffset == rhs.vertexOffset ) - && ( firstInstance == rhs.firstInstance ); - } - - bool operator!=( DrawIndexedIndirectCommand const& rhs ) const - { - return !operator==( rhs ); - } - - uint32_t indexCount; - uint32_t instanceCount; - uint32_t firstIndex; - int32_t vertexOffset; - uint32_t firstInstance; - }; - static_assert( sizeof( DrawIndexedIndirectCommand ) == sizeof( VkDrawIndexedIndirectCommand ), "struct and wrapper have different size!" ); - - struct DispatchIndirectCommand - { - DispatchIndirectCommand( uint32_t x_ = 0, uint32_t y_ = 0, uint32_t z_ = 0 ) - : x( x_ ) - , y( y_ ) - , z( z_ ) - { - } - - DispatchIndirectCommand( VkDispatchIndirectCommand const & rhs ) - { - memcpy( this, &rhs, sizeof( DispatchIndirectCommand ) ); - } - - DispatchIndirectCommand& operator=( VkDispatchIndirectCommand const & rhs ) + VertexInputAttributeDescription& setLocation( uint32_t location_ ) { - memcpy( this, &rhs, sizeof( DispatchIndirectCommand ) ); + location = location_; return *this; } - DispatchIndirectCommand& setX( uint32_t x_ ) + + VertexInputAttributeDescription& setBinding( uint32_t binding_ ) { - x = x_; + binding = binding_; return *this; } - DispatchIndirectCommand& setY( uint32_t y_ ) + VertexInputAttributeDescription& setFormat( Format format_ ) { - y = y_; + format = format_; return *this; } - DispatchIndirectCommand& setZ( uint32_t z_ ) + VertexInputAttributeDescription& setOffset( uint32_t offset_ ) { - z = z_; + offset = offset_; return *this; } - operator const VkDispatchIndirectCommand&() const + operator const VkVertexInputAttributeDescription&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DispatchIndirectCommand const& rhs ) const + bool operator==( VertexInputAttributeDescription const& rhs ) const { - return ( x == rhs.x ) - && ( y == rhs.y ) - && ( z == rhs.z ); + return ( location == rhs.location ) + && ( binding == rhs.binding ) + && ( format == rhs.format ) + && ( offset == rhs.offset ); } - bool operator!=( DispatchIndirectCommand const& rhs ) const + bool operator!=( VertexInputAttributeDescription const& rhs ) const { return !operator==( rhs ); } - uint32_t x; - uint32_t y; - uint32_t z; + uint32_t location; + uint32_t binding; + Format format; + uint32_t offset; }; - static_assert( sizeof( DispatchIndirectCommand ) == sizeof( VkDispatchIndirectCommand ), "struct and wrapper have different size!" ); + static_assert( sizeof( VertexInputAttributeDescription ) == sizeof( VkVertexInputAttributeDescription ), "struct and wrapper have different size!" ); - struct DisplayPlanePropertiesKHR + enum class StructureType { - operator const VkDisplayPlanePropertiesKHR&() const - { - return *reinterpret_cast(this); - } - - bool operator==( DisplayPlanePropertiesKHR const& rhs ) const - { - return ( currentDisplay == rhs.currentDisplay ) - && ( currentStackIndex == rhs.currentStackIndex ); - } - - bool operator!=( DisplayPlanePropertiesKHR const& rhs ) const - { - return !operator==( rhs ); - } - - DisplayKHR currentDisplay; - uint32_t currentStackIndex; + 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, + eBindBufferMemoryInfoKHR = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO, + eBindImageMemoryInfo = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO, + eBindImageMemoryInfoKHR = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO, + ePhysicalDevice16BitStorageFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES, + ePhysicalDevice16BitStorageFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES, + eMemoryDedicatedRequirements = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS, + eMemoryDedicatedRequirementsKHR = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS, + eMemoryDedicatedAllocateInfo = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO, + eMemoryDedicatedAllocateInfoKHR = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO, + eMemoryAllocateFlagsInfo = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO, + eMemoryAllocateFlagsInfoKHR = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO, + eDeviceGroupRenderPassBeginInfo = VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO, + eDeviceGroupRenderPassBeginInfoKHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO, + eDeviceGroupCommandBufferBeginInfo = VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO, + eDeviceGroupCommandBufferBeginInfoKHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO, + eDeviceGroupSubmitInfo = VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO, + eDeviceGroupSubmitInfoKHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO, + eDeviceGroupBindSparseInfo = VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO, + eDeviceGroupBindSparseInfoKHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO, + eBindBufferMemoryDeviceGroupInfo = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO, + eBindBufferMemoryDeviceGroupInfoKHR = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO, + eBindImageMemoryDeviceGroupInfo = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO, + eBindImageMemoryDeviceGroupInfoKHR = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO, + ePhysicalDeviceGroupProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES, + ePhysicalDeviceGroupPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES, + eDeviceGroupDeviceCreateInfo = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO, + eDeviceGroupDeviceCreateInfoKHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO, + eBufferMemoryRequirementsInfo2 = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2, + eBufferMemoryRequirementsInfo2KHR = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2, + eImageMemoryRequirementsInfo2 = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2, + eImageMemoryRequirementsInfo2KHR = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2, + eImageSparseMemoryRequirementsInfo2 = VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2, + eImageSparseMemoryRequirementsInfo2KHR = VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2, + eMemoryRequirements2 = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, + eMemoryRequirements2KHR = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, + eSparseImageMemoryRequirements2 = VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2, + eSparseImageMemoryRequirements2KHR = VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2, + ePhysicalDeviceFeatures2 = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, + ePhysicalDeviceFeatures2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, + ePhysicalDeviceProperties2 = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, + ePhysicalDeviceProperties2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, + eFormatProperties2 = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2, + eFormatProperties2KHR = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2, + eImageFormatProperties2 = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2, + eImageFormatProperties2KHR = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2, + ePhysicalDeviceImageFormatInfo2 = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2, + ePhysicalDeviceImageFormatInfo2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2, + eQueueFamilyProperties2 = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2, + eQueueFamilyProperties2KHR = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2, + ePhysicalDeviceMemoryProperties2 = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2, + ePhysicalDeviceMemoryProperties2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2, + eSparseImageFormatProperties2 = VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2, + eSparseImageFormatProperties2KHR = VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2, + ePhysicalDeviceSparseImageFormatInfo2 = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2, + ePhysicalDeviceSparseImageFormatInfo2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2, + ePhysicalDevicePointClippingProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES, + ePhysicalDevicePointClippingPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES, + eRenderPassInputAttachmentAspectCreateInfo = VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO, + eRenderPassInputAttachmentAspectCreateInfoKHR = VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO, + eImageViewUsageCreateInfo = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO, + eImageViewUsageCreateInfoKHR = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO, + ePipelineTessellationDomainOriginStateCreateInfo = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO, + ePipelineTessellationDomainOriginStateCreateInfoKHR = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO, + eRenderPassMultiviewCreateInfo = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO, + eRenderPassMultiviewCreateInfoKHR = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO, + ePhysicalDeviceMultiviewFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES, + ePhysicalDeviceMultiviewFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES, + ePhysicalDeviceMultiviewProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES, + ePhysicalDeviceMultiviewPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES, + ePhysicalDeviceVariablePointerFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES, + ePhysicalDeviceVariablePointerFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_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, + eSamplerYcbcrConversionCreateInfoKHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO, + eSamplerYcbcrConversionInfo = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO, + eSamplerYcbcrConversionInfoKHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO, + eBindImagePlaneMemoryInfo = VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO, + eBindImagePlaneMemoryInfoKHR = VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO, + eImagePlaneMemoryRequirementsInfo = VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO, + eImagePlaneMemoryRequirementsInfoKHR = VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO, + ePhysicalDeviceSamplerYcbcrConversionFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES, + ePhysicalDeviceSamplerYcbcrConversionFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES, + eSamplerYcbcrConversionImageFormatProperties = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES, + eSamplerYcbcrConversionImageFormatPropertiesKHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES, + eDescriptorUpdateTemplateCreateInfo = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, + eDescriptorUpdateTemplateCreateInfoKHR = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, + ePhysicalDeviceExternalImageFormatInfo = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO, + ePhysicalDeviceExternalImageFormatInfoKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO, + eExternalImageFormatProperties = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES, + eExternalImageFormatPropertiesKHR = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES, + ePhysicalDeviceExternalBufferInfo = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO, + ePhysicalDeviceExternalBufferInfoKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO, + eExternalBufferProperties = VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES, + eExternalBufferPropertiesKHR = VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES, + ePhysicalDeviceIdProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES, + ePhysicalDeviceIdPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES, + eExternalMemoryBufferCreateInfo = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO, + eExternalMemoryBufferCreateInfoKHR = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO, + eExternalMemoryImageCreateInfo = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO, + eExternalMemoryImageCreateInfoKHR = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO, + eExportMemoryAllocateInfo = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO, + eExportMemoryAllocateInfoKHR = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO, + ePhysicalDeviceExternalFenceInfo = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO, + ePhysicalDeviceExternalFenceInfoKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO, + eExternalFenceProperties = VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES, + eExternalFencePropertiesKHR = VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES, + eExportFenceCreateInfo = VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO, + eExportFenceCreateInfoKHR = VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO, + eExportSemaphoreCreateInfo = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO, + eExportSemaphoreCreateInfoKHR = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO, + ePhysicalDeviceExternalSemaphoreInfo = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO, + ePhysicalDeviceExternalSemaphoreInfoKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO, + eExternalSemaphoreProperties = VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES, + eExternalSemaphorePropertiesKHR = VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES, + ePhysicalDeviceMaintenance3Properties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES, + ePhysicalDeviceMaintenance3PropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES, + eDescriptorSetLayoutSupport = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT, + eDescriptorSetLayoutSupportKHR = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT, + ePhysicalDeviceShaderDrawParameterFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES, + 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, + eXlibSurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR, + eXcbSurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR, + eWaylandSurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR, + eMirSurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR, + eAndroidSurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR, + eWin32SurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_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, + 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, + eTextureLodGatherFormatPropertiesAMD = VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD, + eExternalMemoryImageCreateInfoNV = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV, + eExportMemoryAllocateInfoNV = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV, + 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, + eValidationFlagsEXT = VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT, + eViSurfaceCreateInfoNN = VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN, + 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, + 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, + 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, + 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, + ePresentRegionsKHR = VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR, + eObjectTableCreateInfoNVX = VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX, + eIndirectCommandsLayoutCreateInfoNVX = VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX, + eCmdProcessCommandsInfoNVX = VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX, + eCmdReserveSpaceForCommandsInfoNVX = VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX, + eDeviceGeneratedCommandsLimitsNVX = VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX, + eDeviceGeneratedCommandsFeaturesNVX = VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX, + 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, + eHdrMetadataEXT = VK_STRUCTURE_TYPE_HDR_METADATA_EXT, + eSharedPresentSurfaceCapabilitiesKHR = VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_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, + eImportFenceFdInfoKHR = VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR, + eFenceGetFdInfoKHR = VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_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, + eIosSurfaceCreateInfoMVK = VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK, + eMacosSurfaceCreateInfoMVK = VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_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, + 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, + ePhysicalDeviceSamplerFilterMinmaxPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT, + eSamplerReductionModeCreateInfoEXT = VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT, + 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, + eImageFormatListCreateInfoKHR = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR, + 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, + ePipelineCoverageModulationStateCreateInfoNV = VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV, + eValidationCacheCreateInfoEXT = VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT, + eShaderModuleValidationCacheCreateInfoEXT = VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT, + eDescriptorSetLayoutBindingFlagsCreateInfoEXT = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT, + ePhysicalDeviceDescriptorIndexingFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT, + ePhysicalDeviceDescriptorIndexingPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT, + eDescriptorSetVariableDescriptorCountAllocateInfoEXT = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT, + eDescriptorSetVariableDescriptorCountLayoutSupportEXT = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT, + eDeviceQueueGlobalPriorityCreateInfoEXT = VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_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, + ePhysicalDeviceShaderCorePropertiesAMD = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD, + ePhysicalDeviceVertexAttributeDivisorPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT, + ePipelineVertexInputDivisorStateCreateInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT }; - static_assert( sizeof( DisplayPlanePropertiesKHR ) == sizeof( VkDisplayPlanePropertiesKHR ), "struct and wrapper have different size!" ); - struct DisplayModeParametersKHR + struct ApplicationInfo { - DisplayModeParametersKHR( Extent2D visibleRegion_ = Extent2D(), uint32_t refreshRate_ = 0 ) - : visibleRegion( visibleRegion_ ) - , refreshRate( refreshRate_ ) + ApplicationInfo( const char* pApplicationName_ = nullptr, uint32_t applicationVersion_ = 0, const char* pEngineName_ = nullptr, uint32_t engineVersion_ = 0, uint32_t apiVersion_ = 0 ) + : pApplicationName( pApplicationName_ ) + , applicationVersion( applicationVersion_ ) + , pEngineName( pEngineName_ ) + , engineVersion( engineVersion_ ) + , apiVersion( apiVersion_ ) { } - DisplayModeParametersKHR( VkDisplayModeParametersKHR const & rhs ) + ApplicationInfo( VkApplicationInfo const & rhs ) { - memcpy( this, &rhs, sizeof( DisplayModeParametersKHR ) ); + memcpy( this, &rhs, sizeof( ApplicationInfo ) ); } - DisplayModeParametersKHR& operator=( VkDisplayModeParametersKHR const & rhs ) + ApplicationInfo& operator=( VkApplicationInfo const & rhs ) { - memcpy( this, &rhs, sizeof( DisplayModeParametersKHR ) ); + memcpy( this, &rhs, sizeof( ApplicationInfo ) ); return *this; } - DisplayModeParametersKHR& setVisibleRegion( Extent2D visibleRegion_ ) + ApplicationInfo& setPNext( const void* pNext_ ) { - visibleRegion = visibleRegion_; + pNext = pNext_; return *this; } - DisplayModeParametersKHR& setRefreshRate( uint32_t refreshRate_ ) + ApplicationInfo& setPApplicationName( const char* pApplicationName_ ) { - refreshRate = refreshRate_; + pApplicationName = pApplicationName_; return *this; } - operator const VkDisplayModeParametersKHR&() const + ApplicationInfo& setApplicationVersion( uint32_t applicationVersion_ ) { - return *reinterpret_cast(this); + applicationVersion = applicationVersion_; + return *this; } - bool operator==( DisplayModeParametersKHR const& rhs ) const + ApplicationInfo& setPEngineName( const char* pEngineName_ ) { - return ( visibleRegion == rhs.visibleRegion ) - && ( refreshRate == rhs.refreshRate ); + pEngineName = pEngineName_; + return *this; } - bool operator!=( DisplayModeParametersKHR const& rhs ) const + ApplicationInfo& setEngineVersion( uint32_t engineVersion_ ) { - return !operator==( rhs ); + engineVersion = engineVersion_; + return *this; } - Extent2D visibleRegion; - uint32_t refreshRate; - }; - static_assert( sizeof( DisplayModeParametersKHR ) == sizeof( VkDisplayModeParametersKHR ), "struct and wrapper have different size!" ); + ApplicationInfo& setApiVersion( uint32_t apiVersion_ ) + { + apiVersion = apiVersion_; + return *this; + } - struct DisplayModePropertiesKHR - { - operator const VkDisplayModePropertiesKHR&() const + operator const VkApplicationInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DisplayModePropertiesKHR const& rhs ) const + bool operator==( ApplicationInfo const& rhs ) const { - return ( displayMode == rhs.displayMode ) - && ( parameters == rhs.parameters ); + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( pApplicationName == rhs.pApplicationName ) + && ( applicationVersion == rhs.applicationVersion ) + && ( pEngineName == rhs.pEngineName ) + && ( engineVersion == rhs.engineVersion ) + && ( apiVersion == rhs.apiVersion ); } - bool operator!=( DisplayModePropertiesKHR const& rhs ) const + bool operator!=( ApplicationInfo const& rhs ) const { return !operator==( rhs ); } - DisplayModeKHR displayMode; - DisplayModeParametersKHR parameters; + private: + StructureType sType = StructureType::eApplicationInfo; + + public: + const void* pNext = nullptr; + const char* pApplicationName; + uint32_t applicationVersion; + const char* pEngineName; + uint32_t engineVersion; + uint32_t apiVersion; }; - static_assert( sizeof( DisplayModePropertiesKHR ) == sizeof( VkDisplayModePropertiesKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( ApplicationInfo ) == sizeof( VkApplicationInfo ), "struct and wrapper have different size!" ); - struct RectLayerKHR + struct InstanceCreateInfo { - RectLayerKHR( Offset2D offset_ = Offset2D(), Extent2D extent_ = Extent2D(), uint32_t layer_ = 0 ) - : offset( offset_ ) - , extent( extent_ ) - , layer( layer_ ) + InstanceCreateInfo( InstanceCreateFlags flags_ = InstanceCreateFlags(), const ApplicationInfo* pApplicationInfo_ = nullptr, uint32_t enabledLayerCount_ = 0, const char* const* ppEnabledLayerNames_ = nullptr, uint32_t enabledExtensionCount_ = 0, const char* const* ppEnabledExtensionNames_ = nullptr ) + : flags( flags_ ) + , pApplicationInfo( pApplicationInfo_ ) + , enabledLayerCount( enabledLayerCount_ ) + , ppEnabledLayerNames( ppEnabledLayerNames_ ) + , enabledExtensionCount( enabledExtensionCount_ ) + , ppEnabledExtensionNames( ppEnabledExtensionNames_ ) { } - RectLayerKHR( VkRectLayerKHR const & rhs ) + InstanceCreateInfo( VkInstanceCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( RectLayerKHR ) ); + memcpy( this, &rhs, sizeof( InstanceCreateInfo ) ); } - RectLayerKHR& operator=( VkRectLayerKHR const & rhs ) + InstanceCreateInfo& operator=( VkInstanceCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( RectLayerKHR ) ); + memcpy( this, &rhs, sizeof( InstanceCreateInfo ) ); return *this; } - RectLayerKHR& setOffset( Offset2D offset_ ) + InstanceCreateInfo& setPNext( const void* pNext_ ) { - offset = offset_; + pNext = pNext_; return *this; } - RectLayerKHR& setExtent( Extent2D extent_ ) + InstanceCreateInfo& setFlags( InstanceCreateFlags flags_ ) { - extent = extent_; + flags = flags_; return *this; } - RectLayerKHR& setLayer( uint32_t layer_ ) + InstanceCreateInfo& setPApplicationInfo( const ApplicationInfo* pApplicationInfo_ ) { - layer = layer_; + pApplicationInfo = pApplicationInfo_; return *this; } - operator const VkRectLayerKHR&() const - { - return *reinterpret_cast(this); - } - - bool operator==( RectLayerKHR const& rhs ) const - { - return ( offset == rhs.offset ) - && ( extent == rhs.extent ) - && ( layer == rhs.layer ); - } - - bool operator!=( RectLayerKHR const& rhs ) const - { - return !operator==( rhs ); - } - - Offset2D offset; - Extent2D extent; - uint32_t layer; - }; - static_assert( sizeof( RectLayerKHR ) == sizeof( VkRectLayerKHR ), "struct and wrapper have different size!" ); - - struct PresentRegionKHR - { - PresentRegionKHR( uint32_t rectangleCount_ = 0, const RectLayerKHR* pRectangles_ = nullptr ) - : rectangleCount( rectangleCount_ ) - , pRectangles( pRectangles_ ) - { - } - - PresentRegionKHR( VkPresentRegionKHR const & rhs ) + InstanceCreateInfo& setEnabledLayerCount( uint32_t enabledLayerCount_ ) { - memcpy( this, &rhs, sizeof( PresentRegionKHR ) ); + enabledLayerCount = enabledLayerCount_; + return *this; } - PresentRegionKHR& operator=( VkPresentRegionKHR const & rhs ) + InstanceCreateInfo& setPpEnabledLayerNames( const char* const* ppEnabledLayerNames_ ) { - memcpy( this, &rhs, sizeof( PresentRegionKHR ) ); + ppEnabledLayerNames = ppEnabledLayerNames_; return *this; } - PresentRegionKHR& setRectangleCount( uint32_t rectangleCount_ ) + + InstanceCreateInfo& setEnabledExtensionCount( uint32_t enabledExtensionCount_ ) { - rectangleCount = rectangleCount_; + enabledExtensionCount = enabledExtensionCount_; return *this; } - PresentRegionKHR& setPRectangles( const RectLayerKHR* pRectangles_ ) + InstanceCreateInfo& setPpEnabledExtensionNames( const char* const* ppEnabledExtensionNames_ ) { - pRectangles = pRectangles_; + ppEnabledExtensionNames = ppEnabledExtensionNames_; return *this; } - operator const VkPresentRegionKHR&() const + operator const VkInstanceCreateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PresentRegionKHR const& rhs ) const + bool operator==( InstanceCreateInfo const& rhs ) const { - return ( rectangleCount == rhs.rectangleCount ) - && ( pRectangles == rhs.pRectangles ); + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( pApplicationInfo == rhs.pApplicationInfo ) + && ( enabledLayerCount == rhs.enabledLayerCount ) + && ( ppEnabledLayerNames == rhs.ppEnabledLayerNames ) + && ( enabledExtensionCount == rhs.enabledExtensionCount ) + && ( ppEnabledExtensionNames == rhs.ppEnabledExtensionNames ); } - bool operator!=( PresentRegionKHR const& rhs ) const + bool operator!=( InstanceCreateInfo const& rhs ) const { return !operator==( rhs ); } - uint32_t rectangleCount; - const RectLayerKHR* pRectangles; + private: + StructureType sType = StructureType::eInstanceCreateInfo; + + public: + const void* pNext = nullptr; + InstanceCreateFlags flags; + const ApplicationInfo* pApplicationInfo; + uint32_t enabledLayerCount; + const char* const* ppEnabledLayerNames; + uint32_t enabledExtensionCount; + const char* const* ppEnabledExtensionNames; }; - static_assert( sizeof( PresentRegionKHR ) == sizeof( VkPresentRegionKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( InstanceCreateInfo ) == sizeof( VkInstanceCreateInfo ), "struct and wrapper have different size!" ); - struct XYColorEXT + struct MemoryAllocateInfo { - XYColorEXT( float x_ = 0, float y_ = 0 ) - : x( x_ ) - , y( y_ ) - { - } - - XYColorEXT( VkXYColorEXT const & rhs ) + MemoryAllocateInfo( DeviceSize allocationSize_ = 0, uint32_t memoryTypeIndex_ = 0 ) + : allocationSize( allocationSize_ ) + , memoryTypeIndex( memoryTypeIndex_ ) { - memcpy( this, &rhs, sizeof( XYColorEXT ) ); } - XYColorEXT& operator=( VkXYColorEXT const & rhs ) - { - memcpy( this, &rhs, sizeof( XYColorEXT ) ); - return *this; - } - XYColorEXT& setX( float x_ ) + MemoryAllocateInfo( VkMemoryAllocateInfo const & rhs ) { - x = x_; - return *this; + memcpy( this, &rhs, sizeof( MemoryAllocateInfo ) ); } - XYColorEXT& setY( float y_ ) + MemoryAllocateInfo& operator=( VkMemoryAllocateInfo const & rhs ) { - y = y_; + memcpy( this, &rhs, sizeof( MemoryAllocateInfo ) ); return *this; } - - operator const VkXYColorEXT&() const - { - return *reinterpret_cast(this); - } - - bool operator==( XYColorEXT const& rhs ) const - { - return ( x == rhs.x ) - && ( y == rhs.y ); - } - - bool operator!=( XYColorEXT const& rhs ) const - { - return !operator==( rhs ); - } - - float x; - float y; - }; - static_assert( sizeof( XYColorEXT ) == sizeof( VkXYColorEXT ), "struct and wrapper have different size!" ); - - struct RefreshCycleDurationGOOGLE - { - RefreshCycleDurationGOOGLE( uint64_t refreshDuration_ = 0 ) - : refreshDuration( refreshDuration_ ) - { - } - - RefreshCycleDurationGOOGLE( VkRefreshCycleDurationGOOGLE const & rhs ) + MemoryAllocateInfo& setPNext( const void* pNext_ ) { - memcpy( this, &rhs, sizeof( RefreshCycleDurationGOOGLE ) ); + pNext = pNext_; + return *this; } - RefreshCycleDurationGOOGLE& operator=( VkRefreshCycleDurationGOOGLE const & rhs ) + MemoryAllocateInfo& setAllocationSize( DeviceSize allocationSize_ ) { - memcpy( this, &rhs, sizeof( RefreshCycleDurationGOOGLE ) ); + allocationSize = allocationSize_; return *this; } - RefreshCycleDurationGOOGLE& setRefreshDuration( uint64_t refreshDuration_ ) + + MemoryAllocateInfo& setMemoryTypeIndex( uint32_t memoryTypeIndex_ ) { - refreshDuration = refreshDuration_; + memoryTypeIndex = memoryTypeIndex_; return *this; } - operator const VkRefreshCycleDurationGOOGLE&() const + operator const VkMemoryAllocateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( RefreshCycleDurationGOOGLE const& rhs ) const + bool operator==( MemoryAllocateInfo const& rhs ) const { - return ( refreshDuration == rhs.refreshDuration ); + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( allocationSize == rhs.allocationSize ) + && ( memoryTypeIndex == rhs.memoryTypeIndex ); } - bool operator!=( RefreshCycleDurationGOOGLE const& rhs ) const + bool operator!=( MemoryAllocateInfo const& rhs ) const { return !operator==( rhs ); } - uint64_t refreshDuration; + private: + StructureType sType = StructureType::eMemoryAllocateInfo; + + public: + const void* pNext = nullptr; + DeviceSize allocationSize; + uint32_t memoryTypeIndex; }; - static_assert( sizeof( RefreshCycleDurationGOOGLE ) == sizeof( VkRefreshCycleDurationGOOGLE ), "struct and wrapper have different size!" ); + static_assert( sizeof( MemoryAllocateInfo ) == sizeof( VkMemoryAllocateInfo ), "struct and wrapper have different size!" ); - struct PastPresentationTimingGOOGLE + struct MappedMemoryRange { - PastPresentationTimingGOOGLE( uint32_t presentID_ = 0, uint64_t desiredPresentTime_ = 0, uint64_t actualPresentTime_ = 0, uint64_t earliestPresentTime_ = 0, uint64_t presentMargin_ = 0 ) - : presentID( presentID_ ) - , desiredPresentTime( desiredPresentTime_ ) - , actualPresentTime( actualPresentTime_ ) - , earliestPresentTime( earliestPresentTime_ ) - , presentMargin( presentMargin_ ) + MappedMemoryRange( DeviceMemory memory_ = DeviceMemory(), DeviceSize offset_ = 0, DeviceSize size_ = 0 ) + : memory( memory_ ) + , offset( offset_ ) + , size( size_ ) { } - PastPresentationTimingGOOGLE( VkPastPresentationTimingGOOGLE const & rhs ) + MappedMemoryRange( VkMappedMemoryRange const & rhs ) { - memcpy( this, &rhs, sizeof( PastPresentationTimingGOOGLE ) ); + memcpy( this, &rhs, sizeof( MappedMemoryRange ) ); } - PastPresentationTimingGOOGLE& operator=( VkPastPresentationTimingGOOGLE const & rhs ) - { - memcpy( this, &rhs, sizeof( PastPresentationTimingGOOGLE ) ); - return *this; - } - PastPresentationTimingGOOGLE& setPresentID( uint32_t presentID_ ) + MappedMemoryRange& operator=( VkMappedMemoryRange const & rhs ) { - presentID = presentID_; + memcpy( this, &rhs, sizeof( MappedMemoryRange ) ); return *this; } - - PastPresentationTimingGOOGLE& setDesiredPresentTime( uint64_t desiredPresentTime_ ) + MappedMemoryRange& setPNext( const void* pNext_ ) { - desiredPresentTime = desiredPresentTime_; + pNext = pNext_; return *this; } - PastPresentationTimingGOOGLE& setActualPresentTime( uint64_t actualPresentTime_ ) + MappedMemoryRange& setMemory( DeviceMemory memory_ ) { - actualPresentTime = actualPresentTime_; + memory = memory_; return *this; } - PastPresentationTimingGOOGLE& setEarliestPresentTime( uint64_t earliestPresentTime_ ) + MappedMemoryRange& setOffset( DeviceSize offset_ ) { - earliestPresentTime = earliestPresentTime_; + offset = offset_; return *this; } - PastPresentationTimingGOOGLE& setPresentMargin( uint64_t presentMargin_ ) + MappedMemoryRange& setSize( DeviceSize size_ ) { - presentMargin = presentMargin_; + size = size_; return *this; } - operator const VkPastPresentationTimingGOOGLE&() const + operator const VkMappedMemoryRange&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PastPresentationTimingGOOGLE const& rhs ) const + bool operator==( MappedMemoryRange const& rhs ) const { - return ( presentID == rhs.presentID ) - && ( desiredPresentTime == rhs.desiredPresentTime ) - && ( actualPresentTime == rhs.actualPresentTime ) - && ( earliestPresentTime == rhs.earliestPresentTime ) - && ( presentMargin == rhs.presentMargin ); + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( memory == rhs.memory ) + && ( offset == rhs.offset ) + && ( size == rhs.size ); } - bool operator!=( PastPresentationTimingGOOGLE const& rhs ) const + bool operator!=( MappedMemoryRange const& rhs ) const { return !operator==( rhs ); } - uint32_t presentID; - uint64_t desiredPresentTime; - uint64_t actualPresentTime; - uint64_t earliestPresentTime; - uint64_t presentMargin; + private: + StructureType sType = StructureType::eMappedMemoryRange; + + public: + const void* pNext = nullptr; + DeviceMemory memory; + DeviceSize offset; + DeviceSize size; }; - static_assert( sizeof( PastPresentationTimingGOOGLE ) == sizeof( VkPastPresentationTimingGOOGLE ), "struct and wrapper have different size!" ); + static_assert( sizeof( MappedMemoryRange ) == sizeof( VkMappedMemoryRange ), "struct and wrapper have different size!" ); - struct PresentTimeGOOGLE + struct WriteDescriptorSet { - PresentTimeGOOGLE( uint32_t presentID_ = 0, uint64_t desiredPresentTime_ = 0 ) - : presentID( presentID_ ) - , desiredPresentTime( desiredPresentTime_ ) + WriteDescriptorSet( DescriptorSet dstSet_ = DescriptorSet(), uint32_t dstBinding_ = 0, uint32_t dstArrayElement_ = 0, uint32_t descriptorCount_ = 0, DescriptorType descriptorType_ = DescriptorType::eSampler, const DescriptorImageInfo* pImageInfo_ = nullptr, const DescriptorBufferInfo* pBufferInfo_ = nullptr, const BufferView* pTexelBufferView_ = nullptr ) + : dstSet( dstSet_ ) + , dstBinding( dstBinding_ ) + , dstArrayElement( dstArrayElement_ ) + , descriptorCount( descriptorCount_ ) + , descriptorType( descriptorType_ ) + , pImageInfo( pImageInfo_ ) + , pBufferInfo( pBufferInfo_ ) + , pTexelBufferView( pTexelBufferView_ ) { } - PresentTimeGOOGLE( VkPresentTimeGOOGLE const & rhs ) + WriteDescriptorSet( VkWriteDescriptorSet const & rhs ) { - memcpy( this, &rhs, sizeof( PresentTimeGOOGLE ) ); + memcpy( this, &rhs, sizeof( WriteDescriptorSet ) ); } - PresentTimeGOOGLE& operator=( VkPresentTimeGOOGLE const & rhs ) + WriteDescriptorSet& operator=( VkWriteDescriptorSet const & rhs ) { - memcpy( this, &rhs, sizeof( PresentTimeGOOGLE ) ); + memcpy( this, &rhs, sizeof( WriteDescriptorSet ) ); return *this; } - PresentTimeGOOGLE& setPresentID( uint32_t presentID_ ) + WriteDescriptorSet& setPNext( const void* pNext_ ) { - presentID = presentID_; + pNext = pNext_; return *this; } - PresentTimeGOOGLE& setDesiredPresentTime( uint64_t desiredPresentTime_ ) + WriteDescriptorSet& setDstSet( DescriptorSet dstSet_ ) { - desiredPresentTime = desiredPresentTime_; + dstSet = dstSet_; return *this; } - operator const VkPresentTimeGOOGLE&() const - { - return *reinterpret_cast(this); - } - - bool operator==( PresentTimeGOOGLE const& rhs ) const + WriteDescriptorSet& setDstBinding( uint32_t dstBinding_ ) { - return ( presentID == rhs.presentID ) - && ( desiredPresentTime == rhs.desiredPresentTime ); + dstBinding = dstBinding_; + return *this; } - bool operator!=( PresentTimeGOOGLE const& rhs ) const + WriteDescriptorSet& setDstArrayElement( uint32_t dstArrayElement_ ) { - return !operator==( rhs ); + dstArrayElement = dstArrayElement_; + return *this; } - uint32_t presentID; - uint64_t desiredPresentTime; - }; - static_assert( sizeof( PresentTimeGOOGLE ) == sizeof( VkPresentTimeGOOGLE ), "struct and wrapper have different size!" ); - - struct ViewportWScalingNV - { - ViewportWScalingNV( float xcoeff_ = 0, float ycoeff_ = 0 ) - : xcoeff( xcoeff_ ) - , ycoeff( ycoeff_ ) + WriteDescriptorSet& setDescriptorCount( uint32_t descriptorCount_ ) { + descriptorCount = descriptorCount_; + return *this; } - ViewportWScalingNV( VkViewportWScalingNV const & rhs ) + WriteDescriptorSet& setDescriptorType( DescriptorType descriptorType_ ) { - memcpy( this, &rhs, sizeof( ViewportWScalingNV ) ); + descriptorType = descriptorType_; + return *this; } - ViewportWScalingNV& operator=( VkViewportWScalingNV const & rhs ) + WriteDescriptorSet& setPImageInfo( const DescriptorImageInfo* pImageInfo_ ) { - memcpy( this, &rhs, sizeof( ViewportWScalingNV ) ); + pImageInfo = pImageInfo_; return *this; } - ViewportWScalingNV& setXcoeff( float xcoeff_ ) + + WriteDescriptorSet& setPBufferInfo( const DescriptorBufferInfo* pBufferInfo_ ) { - xcoeff = xcoeff_; + pBufferInfo = pBufferInfo_; return *this; } - ViewportWScalingNV& setYcoeff( float ycoeff_ ) + WriteDescriptorSet& setPTexelBufferView( const BufferView* pTexelBufferView_ ) { - ycoeff = ycoeff_; + pTexelBufferView = pTexelBufferView_; return *this; } - operator const VkViewportWScalingNV&() const + operator const VkWriteDescriptorSet&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ViewportWScalingNV const& rhs ) const + bool operator==( WriteDescriptorSet const& rhs ) const { - return ( xcoeff == rhs.xcoeff ) - && ( ycoeff == rhs.ycoeff ); + 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 ); } - bool operator!=( ViewportWScalingNV const& rhs ) const + bool operator!=( WriteDescriptorSet const& rhs ) const { return !operator==( rhs ); } - float xcoeff; - float ycoeff; + private: + StructureType sType = StructureType::eWriteDescriptorSet; + + public: + const void* pNext = nullptr; + DescriptorSet dstSet; + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + DescriptorType descriptorType; + const DescriptorImageInfo* pImageInfo; + const DescriptorBufferInfo* pBufferInfo; + const BufferView* pTexelBufferView; }; - static_assert( sizeof( ViewportWScalingNV ) == sizeof( VkViewportWScalingNV ), "struct and wrapper have different size!" ); + static_assert( sizeof( WriteDescriptorSet ) == sizeof( VkWriteDescriptorSet ), "struct and wrapper have different size!" ); - struct SampleLocationEXT + struct CopyDescriptorSet { - SampleLocationEXT( float x_ = 0, float y_ = 0 ) - : x( x_ ) - , y( y_ ) + CopyDescriptorSet( DescriptorSet srcSet_ = DescriptorSet(), uint32_t srcBinding_ = 0, uint32_t srcArrayElement_ = 0, DescriptorSet dstSet_ = DescriptorSet(), uint32_t dstBinding_ = 0, uint32_t dstArrayElement_ = 0, uint32_t descriptorCount_ = 0 ) + : srcSet( srcSet_ ) + , srcBinding( srcBinding_ ) + , srcArrayElement( srcArrayElement_ ) + , dstSet( dstSet_ ) + , dstBinding( dstBinding_ ) + , dstArrayElement( dstArrayElement_ ) + , descriptorCount( descriptorCount_ ) + { + } + + CopyDescriptorSet( VkCopyDescriptorSet const & rhs ) + { + memcpy( this, &rhs, sizeof( CopyDescriptorSet ) ); + } + + CopyDescriptorSet& operator=( VkCopyDescriptorSet const & rhs ) + { + memcpy( this, &rhs, sizeof( CopyDescriptorSet ) ); + return *this; + } + CopyDescriptorSet& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + CopyDescriptorSet& setSrcSet( DescriptorSet srcSet_ ) + { + srcSet = srcSet_; + return *this; + } + + CopyDescriptorSet& setSrcBinding( uint32_t srcBinding_ ) + { + srcBinding = srcBinding_; + return *this; + } + + CopyDescriptorSet& setSrcArrayElement( uint32_t srcArrayElement_ ) { + srcArrayElement = srcArrayElement_; + return *this; } - SampleLocationEXT( VkSampleLocationEXT const & rhs ) + CopyDescriptorSet& setDstSet( DescriptorSet dstSet_ ) { - memcpy( this, &rhs, sizeof( SampleLocationEXT ) ); + dstSet = dstSet_; + return *this; } - SampleLocationEXT& operator=( VkSampleLocationEXT const & rhs ) + CopyDescriptorSet& setDstBinding( uint32_t dstBinding_ ) { - memcpy( this, &rhs, sizeof( SampleLocationEXT ) ); + dstBinding = dstBinding_; return *this; } - SampleLocationEXT& setX( float x_ ) + + CopyDescriptorSet& setDstArrayElement( uint32_t dstArrayElement_ ) { - x = x_; + dstArrayElement = dstArrayElement_; return *this; } - SampleLocationEXT& setY( float y_ ) + CopyDescriptorSet& setDescriptorCount( uint32_t descriptorCount_ ) { - y = y_; + descriptorCount = descriptorCount_; return *this; } - operator const VkSampleLocationEXT&() const + operator const VkCopyDescriptorSet&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( SampleLocationEXT const& rhs ) const + bool operator==( CopyDescriptorSet const& rhs ) const { - return ( x == rhs.x ) - && ( y == rhs.y ); + 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 ); } - bool operator!=( SampleLocationEXT const& rhs ) const + bool operator!=( CopyDescriptorSet const& rhs ) const { return !operator==( rhs ); } - float x; - float y; + private: + StructureType sType = StructureType::eCopyDescriptorSet; + + public: + const void* pNext = nullptr; + DescriptorSet srcSet; + uint32_t srcBinding; + uint32_t srcArrayElement; + DescriptorSet dstSet; + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; }; - static_assert( sizeof( SampleLocationEXT ) == sizeof( VkSampleLocationEXT ), "struct and wrapper have different size!" ); + static_assert( sizeof( CopyDescriptorSet ) == sizeof( VkCopyDescriptorSet ), "struct and wrapper have different size!" ); - struct ShaderResourceUsageAMD + struct BufferViewCreateInfo { - operator const VkShaderResourceUsageAMD&() const + BufferViewCreateInfo( BufferViewCreateFlags flags_ = BufferViewCreateFlags(), Buffer buffer_ = Buffer(), Format format_ = Format::eUndefined, DeviceSize offset_ = 0, DeviceSize range_ = 0 ) + : flags( flags_ ) + , buffer( buffer_ ) + , format( format_ ) + , offset( offset_ ) + , range( range_ ) { - return *reinterpret_cast(this); } - bool operator==( ShaderResourceUsageAMD const& rhs ) const + BufferViewCreateInfo( VkBufferViewCreateInfo const & rhs ) { - return ( numUsedVgprs == rhs.numUsedVgprs ) - && ( numUsedSgprs == rhs.numUsedSgprs ) - && ( ldsSizePerLocalWorkGroup == rhs.ldsSizePerLocalWorkGroup ) - && ( ldsUsageSizeInBytes == rhs.ldsUsageSizeInBytes ) - && ( scratchMemUsageInBytes == rhs.scratchMemUsageInBytes ); + memcpy( this, &rhs, sizeof( BufferViewCreateInfo ) ); } - bool operator!=( ShaderResourceUsageAMD const& rhs ) const + BufferViewCreateInfo& operator=( VkBufferViewCreateInfo const & rhs ) { - return !operator==( rhs ); + memcpy( this, &rhs, sizeof( BufferViewCreateInfo ) ); + return *this; } - - uint32_t numUsedVgprs; - uint32_t numUsedSgprs; - uint32_t ldsSizePerLocalWorkGroup; - size_t ldsUsageSizeInBytes; - size_t scratchMemUsageInBytes; - }; - static_assert( sizeof( ShaderResourceUsageAMD ) == sizeof( VkShaderResourceUsageAMD ), "struct and wrapper have different size!" ); - - 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, - ePresentSrcKHR = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, - eSharedPresentKHR = VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, - eDepthReadOnlyStencilAttachmentOptimalKHR = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR, - eDepthAttachmentStencilReadOnlyOptimalKHR = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR - }; - - struct DescriptorImageInfo - { - DescriptorImageInfo( Sampler sampler_ = Sampler(), ImageView imageView_ = ImageView(), ImageLayout imageLayout_ = ImageLayout::eUndefined ) - : sampler( sampler_ ) - , imageView( imageView_ ) - , imageLayout( imageLayout_ ) + BufferViewCreateInfo& setPNext( const void* pNext_ ) { + pNext = pNext_; + return *this; } - DescriptorImageInfo( VkDescriptorImageInfo const & rhs ) + BufferViewCreateInfo& setFlags( BufferViewCreateFlags flags_ ) { - memcpy( this, &rhs, sizeof( DescriptorImageInfo ) ); + flags = flags_; + return *this; } - DescriptorImageInfo& operator=( VkDescriptorImageInfo const & rhs ) + BufferViewCreateInfo& setBuffer( Buffer buffer_ ) { - memcpy( this, &rhs, sizeof( DescriptorImageInfo ) ); + buffer = buffer_; return *this; } - DescriptorImageInfo& setSampler( Sampler sampler_ ) + + BufferViewCreateInfo& setFormat( Format format_ ) { - sampler = sampler_; + format = format_; return *this; } - DescriptorImageInfo& setImageView( ImageView imageView_ ) + BufferViewCreateInfo& setOffset( DeviceSize offset_ ) { - imageView = imageView_; + offset = offset_; return *this; } - DescriptorImageInfo& setImageLayout( ImageLayout imageLayout_ ) + BufferViewCreateInfo& setRange( DeviceSize range_ ) { - imageLayout = imageLayout_; + range = range_; return *this; } - operator const VkDescriptorImageInfo&() const + operator const VkBufferViewCreateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DescriptorImageInfo const& rhs ) const + bool operator==( BufferViewCreateInfo const& rhs ) const { - return ( sampler == rhs.sampler ) - && ( imageView == rhs.imageView ) - && ( imageLayout == rhs.imageLayout ); + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( buffer == rhs.buffer ) + && ( format == rhs.format ) + && ( offset == rhs.offset ) + && ( range == rhs.range ); } - bool operator!=( DescriptorImageInfo const& rhs ) const + bool operator!=( BufferViewCreateInfo const& rhs ) const { return !operator==( rhs ); } - Sampler sampler; - ImageView imageView; - ImageLayout imageLayout; + private: + StructureType sType = StructureType::eBufferViewCreateInfo; + + public: + const void* pNext = nullptr; + BufferViewCreateFlags flags; + Buffer buffer; + Format format; + DeviceSize offset; + DeviceSize range; }; - static_assert( sizeof( DescriptorImageInfo ) == sizeof( VkDescriptorImageInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( BufferViewCreateInfo ) == sizeof( VkBufferViewCreateInfo ), "struct and wrapper have different size!" ); - struct AttachmentReference + struct ShaderModuleCreateInfo { - AttachmentReference( uint32_t attachment_ = 0, ImageLayout layout_ = ImageLayout::eUndefined ) - : attachment( attachment_ ) - , layout( layout_ ) + ShaderModuleCreateInfo( ShaderModuleCreateFlags flags_ = ShaderModuleCreateFlags(), size_t codeSize_ = 0, const uint32_t* pCode_ = nullptr ) + : flags( flags_ ) + , codeSize( codeSize_ ) + , pCode( pCode_ ) { } - AttachmentReference( VkAttachmentReference const & rhs ) + ShaderModuleCreateInfo( VkShaderModuleCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( AttachmentReference ) ); + memcpy( this, &rhs, sizeof( ShaderModuleCreateInfo ) ); } - AttachmentReference& operator=( VkAttachmentReference const & rhs ) + ShaderModuleCreateInfo& operator=( VkShaderModuleCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( AttachmentReference ) ); + memcpy( this, &rhs, sizeof( ShaderModuleCreateInfo ) ); return *this; } - AttachmentReference& setAttachment( uint32_t attachment_ ) + ShaderModuleCreateInfo& setPNext( const void* pNext_ ) { - attachment = attachment_; + pNext = pNext_; return *this; } - AttachmentReference& setLayout( ImageLayout layout_ ) + ShaderModuleCreateInfo& setFlags( ShaderModuleCreateFlags flags_ ) { - layout = layout_; + flags = flags_; return *this; } - operator const VkAttachmentReference&() const + ShaderModuleCreateInfo& setCodeSize( size_t codeSize_ ) { - return *reinterpret_cast(this); + codeSize = codeSize_; + return *this; } - bool operator==( AttachmentReference const& rhs ) const + ShaderModuleCreateInfo& setPCode( const uint32_t* pCode_ ) { - return ( attachment == rhs.attachment ) - && ( layout == rhs.layout ); + pCode = pCode_; + return *this; } - bool operator!=( AttachmentReference const& rhs ) const + operator const VkShaderModuleCreateInfo&() const { - return !operator==( rhs ); + return *reinterpret_cast(this); } - uint32_t attachment; - ImageLayout layout; - }; - static_assert( sizeof( AttachmentReference ) == sizeof( VkAttachmentReference ), "struct and wrapper have different size!" ); - - enum class AttachmentLoadOp - { - eLoad = VK_ATTACHMENT_LOAD_OP_LOAD, - eClear = VK_ATTACHMENT_LOAD_OP_CLEAR, - eDontCare = VK_ATTACHMENT_LOAD_OP_DONT_CARE - }; - - enum class AttachmentStoreOp - { - eStore = VK_ATTACHMENT_STORE_OP_STORE, - eDontCare = VK_ATTACHMENT_STORE_OP_DONT_CARE - }; - - enum class ImageType - { - e1D = VK_IMAGE_TYPE_1D, - e2D = VK_IMAGE_TYPE_2D, - e3D = VK_IMAGE_TYPE_3D - }; - - enum class ImageTiling - { - eOptimal = VK_IMAGE_TILING_OPTIMAL, - eLinear = VK_IMAGE_TILING_LINEAR - }; + bool operator==( ShaderModuleCreateInfo const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( codeSize == rhs.codeSize ) + && ( pCode == rhs.pCode ); + } - 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 - }; + bool operator!=( ShaderModuleCreateInfo const& rhs ) const + { + return !operator==( rhs ); + } - enum class CommandBufferLevel - { - ePrimary = VK_COMMAND_BUFFER_LEVEL_PRIMARY, - eSecondary = VK_COMMAND_BUFFER_LEVEL_SECONDARY - }; + private: + StructureType sType = StructureType::eShaderModuleCreateInfo; - 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 + public: + const void* pNext = nullptr; + ShaderModuleCreateFlags flags; + size_t codeSize; + const uint32_t* pCode; }; + static_assert( sizeof( ShaderModuleCreateInfo ) == sizeof( VkShaderModuleCreateInfo ), "struct and wrapper have different size!" ); - struct ComponentMapping + struct DescriptorSetAllocateInfo { - ComponentMapping( ComponentSwizzle r_ = ComponentSwizzle::eIdentity, ComponentSwizzle g_ = ComponentSwizzle::eIdentity, ComponentSwizzle b_ = ComponentSwizzle::eIdentity, ComponentSwizzle a_ = ComponentSwizzle::eIdentity ) - : r( r_ ) - , g( g_ ) - , b( b_ ) - , a( a_ ) + DescriptorSetAllocateInfo( DescriptorPool descriptorPool_ = DescriptorPool(), uint32_t descriptorSetCount_ = 0, const DescriptorSetLayout* pSetLayouts_ = nullptr ) + : descriptorPool( descriptorPool_ ) + , descriptorSetCount( descriptorSetCount_ ) + , pSetLayouts( pSetLayouts_ ) { } - ComponentMapping( VkComponentMapping const & rhs ) + DescriptorSetAllocateInfo( VkDescriptorSetAllocateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ComponentMapping ) ); + memcpy( this, &rhs, sizeof( DescriptorSetAllocateInfo ) ); } - ComponentMapping& operator=( VkComponentMapping const & rhs ) + DescriptorSetAllocateInfo& operator=( VkDescriptorSetAllocateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ComponentMapping ) ); + memcpy( this, &rhs, sizeof( DescriptorSetAllocateInfo ) ); return *this; } - ComponentMapping& setR( ComponentSwizzle r_ ) + DescriptorSetAllocateInfo& setPNext( const void* pNext_ ) { - r = r_; + pNext = pNext_; return *this; } - ComponentMapping& setG( ComponentSwizzle g_ ) + DescriptorSetAllocateInfo& setDescriptorPool( DescriptorPool descriptorPool_ ) { - g = g_; + descriptorPool = descriptorPool_; return *this; } - ComponentMapping& setB( ComponentSwizzle b_ ) + DescriptorSetAllocateInfo& setDescriptorSetCount( uint32_t descriptorSetCount_ ) { - b = b_; + descriptorSetCount = descriptorSetCount_; return *this; } - ComponentMapping& setA( ComponentSwizzle a_ ) + DescriptorSetAllocateInfo& setPSetLayouts( const DescriptorSetLayout* pSetLayouts_ ) { - a = a_; + pSetLayouts = pSetLayouts_; return *this; } - operator const VkComponentMapping&() const + operator const VkDescriptorSetAllocateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ComponentMapping const& rhs ) const + bool operator==( DescriptorSetAllocateInfo const& rhs ) const { - return ( r == rhs.r ) - && ( g == rhs.g ) - && ( b == rhs.b ) - && ( a == rhs.a ); + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( descriptorPool == rhs.descriptorPool ) + && ( descriptorSetCount == rhs.descriptorSetCount ) + && ( pSetLayouts == rhs.pSetLayouts ); } - bool operator!=( ComponentMapping const& rhs ) const + bool operator!=( DescriptorSetAllocateInfo const& rhs ) const { return !operator==( rhs ); } - ComponentSwizzle r; - ComponentSwizzle g; - ComponentSwizzle b; - ComponentSwizzle a; - }; - static_assert( sizeof( ComponentMapping ) == sizeof( VkComponentMapping ), "struct and wrapper have different size!" ); + private: + StructureType sType = StructureType::eDescriptorSetAllocateInfo; - 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 + public: + const void* pNext = nullptr; + DescriptorPool descriptorPool; + uint32_t descriptorSetCount; + const DescriptorSetLayout* pSetLayouts; }; + static_assert( sizeof( DescriptorSetAllocateInfo ) == sizeof( VkDescriptorSetAllocateInfo ), "struct and wrapper have different size!" ); - struct DescriptorPoolSize + struct PipelineVertexInputStateCreateInfo { - DescriptorPoolSize( DescriptorType type_ = DescriptorType::eSampler, uint32_t descriptorCount_ = 0 ) - : type( type_ ) - , descriptorCount( descriptorCount_ ) + PipelineVertexInputStateCreateInfo( PipelineVertexInputStateCreateFlags flags_ = PipelineVertexInputStateCreateFlags(), uint32_t vertexBindingDescriptionCount_ = 0, const VertexInputBindingDescription* pVertexBindingDescriptions_ = nullptr, uint32_t vertexAttributeDescriptionCount_ = 0, const VertexInputAttributeDescription* pVertexAttributeDescriptions_ = nullptr ) + : flags( flags_ ) + , vertexBindingDescriptionCount( vertexBindingDescriptionCount_ ) + , pVertexBindingDescriptions( pVertexBindingDescriptions_ ) + , vertexAttributeDescriptionCount( vertexAttributeDescriptionCount_ ) + , pVertexAttributeDescriptions( pVertexAttributeDescriptions_ ) { } - DescriptorPoolSize( VkDescriptorPoolSize const & rhs ) + PipelineVertexInputStateCreateInfo( VkPipelineVertexInputStateCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( DescriptorPoolSize ) ); + memcpy( this, &rhs, sizeof( PipelineVertexInputStateCreateInfo ) ); } - DescriptorPoolSize& operator=( VkDescriptorPoolSize const & rhs ) + PipelineVertexInputStateCreateInfo& operator=( VkPipelineVertexInputStateCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( DescriptorPoolSize ) ); + memcpy( this, &rhs, sizeof( PipelineVertexInputStateCreateInfo ) ); return *this; } - DescriptorPoolSize& setType( DescriptorType type_ ) + PipelineVertexInputStateCreateInfo& setPNext( const void* pNext_ ) { - type = type_; + pNext = pNext_; return *this; } - DescriptorPoolSize& setDescriptorCount( uint32_t descriptorCount_ ) + PipelineVertexInputStateCreateInfo& setFlags( PipelineVertexInputStateCreateFlags flags_ ) { - descriptorCount = descriptorCount_; + flags = flags_; return *this; } - operator const VkDescriptorPoolSize&() const + PipelineVertexInputStateCreateInfo& setVertexBindingDescriptionCount( uint32_t vertexBindingDescriptionCount_ ) { - return *reinterpret_cast(this); + vertexBindingDescriptionCount = vertexBindingDescriptionCount_; + return *this; } - bool operator==( DescriptorPoolSize const& rhs ) const + PipelineVertexInputStateCreateInfo& setPVertexBindingDescriptions( const VertexInputBindingDescription* pVertexBindingDescriptions_ ) { - return ( type == rhs.type ) - && ( descriptorCount == rhs.descriptorCount ); + pVertexBindingDescriptions = pVertexBindingDescriptions_; + return *this; } - bool operator!=( DescriptorPoolSize const& rhs ) const + PipelineVertexInputStateCreateInfo& setVertexAttributeDescriptionCount( uint32_t vertexAttributeDescriptionCount_ ) { - return !operator==( rhs ); + vertexAttributeDescriptionCount = vertexAttributeDescriptionCount_; + return *this; } - DescriptorType type; - uint32_t descriptorCount; - }; - static_assert( sizeof( DescriptorPoolSize ) == sizeof( VkDescriptorPoolSize ), "struct and wrapper have different size!" ); + PipelineVertexInputStateCreateInfo& setPVertexAttributeDescriptions( const VertexInputAttributeDescription* pVertexAttributeDescriptions_ ) + { + pVertexAttributeDescriptions = pVertexAttributeDescriptions_; + return *this; + } - struct DescriptorUpdateTemplateEntryKHR - { - DescriptorUpdateTemplateEntryKHR( uint32_t dstBinding_ = 0, uint32_t dstArrayElement_ = 0, uint32_t descriptorCount_ = 0, DescriptorType descriptorType_ = DescriptorType::eSampler, size_t offset_ = 0, size_t stride_ = 0 ) - : dstBinding( dstBinding_ ) - , dstArrayElement( dstArrayElement_ ) - , descriptorCount( descriptorCount_ ) - , descriptorType( descriptorType_ ) - , offset( offset_ ) - , stride( stride_ ) + operator const VkPipelineVertexInputStateCreateInfo&() const { + return *reinterpret_cast(this); } - DescriptorUpdateTemplateEntryKHR( VkDescriptorUpdateTemplateEntryKHR const & rhs ) + bool operator==( PipelineVertexInputStateCreateInfo const& rhs ) const { - memcpy( this, &rhs, sizeof( DescriptorUpdateTemplateEntryKHR ) ); + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( vertexBindingDescriptionCount == rhs.vertexBindingDescriptionCount ) + && ( pVertexBindingDescriptions == rhs.pVertexBindingDescriptions ) + && ( vertexAttributeDescriptionCount == rhs.vertexAttributeDescriptionCount ) + && ( pVertexAttributeDescriptions == rhs.pVertexAttributeDescriptions ); } - DescriptorUpdateTemplateEntryKHR& operator=( VkDescriptorUpdateTemplateEntryKHR const & rhs ) + bool operator!=( PipelineVertexInputStateCreateInfo const& rhs ) const { - memcpy( this, &rhs, sizeof( DescriptorUpdateTemplateEntryKHR ) ); - return *this; + return !operator==( rhs ); } - DescriptorUpdateTemplateEntryKHR& setDstBinding( uint32_t dstBinding_ ) + + private: + StructureType sType = StructureType::ePipelineVertexInputStateCreateInfo; + + public: + const void* pNext = nullptr; + PipelineVertexInputStateCreateFlags flags; + uint32_t vertexBindingDescriptionCount; + const VertexInputBindingDescription* pVertexBindingDescriptions; + uint32_t vertexAttributeDescriptionCount; + const VertexInputAttributeDescription* pVertexAttributeDescriptions; + }; + static_assert( sizeof( PipelineVertexInputStateCreateInfo ) == sizeof( VkPipelineVertexInputStateCreateInfo ), "struct and wrapper have different size!" ); + + struct PipelineInputAssemblyStateCreateInfo + { + PipelineInputAssemblyStateCreateInfo( PipelineInputAssemblyStateCreateFlags flags_ = PipelineInputAssemblyStateCreateFlags(), PrimitiveTopology topology_ = PrimitiveTopology::ePointList, Bool32 primitiveRestartEnable_ = 0 ) + : flags( flags_ ) + , topology( topology_ ) + , primitiveRestartEnable( primitiveRestartEnable_ ) { - dstBinding = dstBinding_; - return *this; } - DescriptorUpdateTemplateEntryKHR& setDstArrayElement( uint32_t dstArrayElement_ ) + PipelineInputAssemblyStateCreateInfo( VkPipelineInputAssemblyStateCreateInfo const & rhs ) { - dstArrayElement = dstArrayElement_; - return *this; + memcpy( this, &rhs, sizeof( PipelineInputAssemblyStateCreateInfo ) ); } - DescriptorUpdateTemplateEntryKHR& setDescriptorCount( uint32_t descriptorCount_ ) + PipelineInputAssemblyStateCreateInfo& operator=( VkPipelineInputAssemblyStateCreateInfo const & rhs ) { - descriptorCount = descriptorCount_; + memcpy( this, &rhs, sizeof( PipelineInputAssemblyStateCreateInfo ) ); return *this; } - - DescriptorUpdateTemplateEntryKHR& setDescriptorType( DescriptorType descriptorType_ ) + PipelineInputAssemblyStateCreateInfo& setPNext( const void* pNext_ ) { - descriptorType = descriptorType_; + pNext = pNext_; return *this; } - DescriptorUpdateTemplateEntryKHR& setOffset( size_t offset_ ) + PipelineInputAssemblyStateCreateInfo& setFlags( PipelineInputAssemblyStateCreateFlags flags_ ) { - offset = offset_; + flags = flags_; return *this; } - DescriptorUpdateTemplateEntryKHR& setStride( size_t stride_ ) + PipelineInputAssemblyStateCreateInfo& setTopology( PrimitiveTopology topology_ ) { - stride = stride_; + topology = topology_; return *this; } - operator const VkDescriptorUpdateTemplateEntryKHR&() const + PipelineInputAssemblyStateCreateInfo& setPrimitiveRestartEnable( Bool32 primitiveRestartEnable_ ) { - return *reinterpret_cast(this); + primitiveRestartEnable = primitiveRestartEnable_; + return *this; } - bool operator==( DescriptorUpdateTemplateEntryKHR const& rhs ) const + operator const VkPipelineInputAssemblyStateCreateInfo&() const { - return ( dstBinding == rhs.dstBinding ) - && ( dstArrayElement == rhs.dstArrayElement ) - && ( descriptorCount == rhs.descriptorCount ) - && ( descriptorType == rhs.descriptorType ) - && ( offset == rhs.offset ) - && ( stride == rhs.stride ); + return *reinterpret_cast(this); } - bool operator!=( DescriptorUpdateTemplateEntryKHR const& rhs ) const + bool operator==( PipelineInputAssemblyStateCreateInfo const& rhs ) const { - return !operator==( rhs ); + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( topology == rhs.topology ) + && ( primitiveRestartEnable == rhs.primitiveRestartEnable ); } - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; - DescriptorType descriptorType; - size_t offset; - size_t stride; - }; - static_assert( sizeof( DescriptorUpdateTemplateEntryKHR ) == sizeof( VkDescriptorUpdateTemplateEntryKHR ), "struct and wrapper have different size!" ); - - enum class QueryType - { - eOcclusion = VK_QUERY_TYPE_OCCLUSION, - ePipelineStatistics = VK_QUERY_TYPE_PIPELINE_STATISTICS, - eTimestamp = VK_QUERY_TYPE_TIMESTAMP - }; - - 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 - }; - - enum class PipelineBindPoint - { - eGraphics = VK_PIPELINE_BIND_POINT_GRAPHICS, - eCompute = VK_PIPELINE_BIND_POINT_COMPUTE - }; + bool operator!=( PipelineInputAssemblyStateCreateInfo const& rhs ) const + { + return !operator==( rhs ); + } - enum class PipelineCacheHeaderVersion - { - eOne = VK_PIPELINE_CACHE_HEADER_VERSION_ONE - }; + private: + StructureType sType = StructureType::ePipelineInputAssemblyStateCreateInfo; - 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 + public: + const void* pNext = nullptr; + PipelineInputAssemblyStateCreateFlags flags; + PrimitiveTopology topology; + Bool32 primitiveRestartEnable; }; + static_assert( sizeof( PipelineInputAssemblyStateCreateInfo ) == sizeof( VkPipelineInputAssemblyStateCreateInfo ), "struct and wrapper have different size!" ); - enum class SharingMode + struct PipelineTessellationStateCreateInfo { - eExclusive = VK_SHARING_MODE_EXCLUSIVE, - eConcurrent = VK_SHARING_MODE_CONCURRENT - }; + PipelineTessellationStateCreateInfo( PipelineTessellationStateCreateFlags flags_ = PipelineTessellationStateCreateFlags(), uint32_t patchControlPoints_ = 0 ) + : flags( flags_ ) + , patchControlPoints( patchControlPoints_ ) + { + } - enum class IndexType - { - eUint16 = VK_INDEX_TYPE_UINT16, - eUint32 = VK_INDEX_TYPE_UINT32 - }; + PipelineTessellationStateCreateInfo( VkPipelineTessellationStateCreateInfo const & rhs ) + { + memcpy( this, &rhs, sizeof( PipelineTessellationStateCreateInfo ) ); + } - enum class Filter - { - eNearest = VK_FILTER_NEAREST, - eLinear = VK_FILTER_LINEAR, - eCubicIMG = VK_FILTER_CUBIC_IMG - }; + PipelineTessellationStateCreateInfo& operator=( VkPipelineTessellationStateCreateInfo const & rhs ) + { + memcpy( this, &rhs, sizeof( PipelineTessellationStateCreateInfo ) ); + return *this; + } + PipelineTessellationStateCreateInfo& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } - enum class SamplerMipmapMode - { - eNearest = VK_SAMPLER_MIPMAP_MODE_NEAREST, - eLinear = VK_SAMPLER_MIPMAP_MODE_LINEAR - }; + PipelineTessellationStateCreateInfo& setFlags( PipelineTessellationStateCreateFlags flags_ ) + { + flags = flags_; + return *this; + } - 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 - }; + PipelineTessellationStateCreateInfo& setPatchControlPoints( uint32_t patchControlPoints_ ) + { + patchControlPoints = patchControlPoints_; + return *this; + } - 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 - }; + operator const VkPipelineTessellationStateCreateInfo&() const + { + return *reinterpret_cast(this); + } - 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 - }; + bool operator==( PipelineTessellationStateCreateInfo const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( patchControlPoints == rhs.patchControlPoints ); + } - enum class CullModeFlagBits - { - eNone = VK_CULL_MODE_NONE, - eFront = VK_CULL_MODE_FRONT_BIT, - eBack = VK_CULL_MODE_BACK_BIT, - eFrontAndBack = VK_CULL_MODE_FRONT_AND_BACK - }; + bool operator!=( PipelineTessellationStateCreateInfo const& rhs ) const + { + return !operator==( rhs ); + } - using CullModeFlags = Flags; + private: + StructureType sType = StructureType::ePipelineTessellationStateCreateInfo; - VULKAN_HPP_INLINE CullModeFlags operator|( CullModeFlagBits bit0, CullModeFlagBits bit1 ) - { - return CullModeFlags( bit0 ) | bit1; - } + public: + const void* pNext = nullptr; + PipelineTessellationStateCreateFlags flags; + uint32_t patchControlPoints; + }; + static_assert( sizeof( PipelineTessellationStateCreateInfo ) == sizeof( VkPipelineTessellationStateCreateInfo ), "struct and wrapper have different size!" ); - VULKAN_HPP_INLINE CullModeFlags operator~( CullModeFlagBits bits ) + struct PipelineViewportStateCreateInfo { - return ~( CullModeFlags( bits ) ); - } + PipelineViewportStateCreateInfo( PipelineViewportStateCreateFlags flags_ = PipelineViewportStateCreateFlags(), uint32_t viewportCount_ = 0, const Viewport* pViewports_ = nullptr, uint32_t scissorCount_ = 0, const Rect2D* pScissors_ = nullptr ) + : flags( flags_ ) + , viewportCount( viewportCount_ ) + , pViewports( pViewports_ ) + , scissorCount( scissorCount_ ) + , pScissors( pScissors_ ) + { + } - template <> struct FlagTraits - { - enum + PipelineViewportStateCreateInfo( VkPipelineViewportStateCreateInfo const & rhs ) { - allFlags = VkFlags(CullModeFlagBits::eNone) | VkFlags(CullModeFlagBits::eFront) | VkFlags(CullModeFlagBits::eBack) | VkFlags(CullModeFlagBits::eFrontAndBack) - }; - }; + memcpy( this, &rhs, sizeof( PipelineViewportStateCreateInfo ) ); + } - enum class FrontFace - { - eCounterClockwise = VK_FRONT_FACE_COUNTER_CLOCKWISE, - eClockwise = VK_FRONT_FACE_CLOCKWISE - }; + PipelineViewportStateCreateInfo& operator=( VkPipelineViewportStateCreateInfo const & rhs ) + { + memcpy( this, &rhs, sizeof( PipelineViewportStateCreateInfo ) ); + return *this; + } + PipelineViewportStateCreateInfo& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } - 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 - }; + PipelineViewportStateCreateInfo& setFlags( PipelineViewportStateCreateFlags flags_ ) + { + flags = flags_; + return *this; + } - 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 - }; + PipelineViewportStateCreateInfo& setViewportCount( uint32_t viewportCount_ ) + { + viewportCount = viewportCount_; + return *this; + } + + PipelineViewportStateCreateInfo& setPViewports( const Viewport* pViewports_ ) + { + pViewports = pViewports_; + return *this; + } - 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 + PipelineViewportStateCreateInfo& setScissorCount( uint32_t scissorCount_ ) + { + scissorCount = scissorCount_; + return *this; + } + + PipelineViewportStateCreateInfo& setPScissors( const Rect2D* pScissors_ ) + { + pScissors = pScissors_; + return *this; + } + + operator const VkPipelineViewportStateCreateInfo&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PipelineViewportStateCreateInfo const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( viewportCount == rhs.viewportCount ) + && ( pViewports == rhs.pViewports ) + && ( scissorCount == rhs.scissorCount ) + && ( pScissors == rhs.pScissors ); + } + + bool operator!=( PipelineViewportStateCreateInfo const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType = StructureType::ePipelineViewportStateCreateInfo; + + public: + const void* pNext = nullptr; + PipelineViewportStateCreateFlags flags; + uint32_t viewportCount; + const Viewport* pViewports; + uint32_t scissorCount; + const Rect2D* pScissors; }; + static_assert( sizeof( PipelineViewportStateCreateInfo ) == sizeof( VkPipelineViewportStateCreateInfo ), "struct and wrapper have different size!" ); - struct StencilOpState + struct PipelineRasterizationStateCreateInfo { - StencilOpState( StencilOp failOp_ = StencilOp::eKeep, StencilOp passOp_ = StencilOp::eKeep, StencilOp depthFailOp_ = StencilOp::eKeep, CompareOp compareOp_ = CompareOp::eNever, uint32_t compareMask_ = 0, uint32_t writeMask_ = 0, uint32_t reference_ = 0 ) - : failOp( failOp_ ) - , passOp( passOp_ ) - , depthFailOp( depthFailOp_ ) - , compareOp( compareOp_ ) - , compareMask( compareMask_ ) - , writeMask( writeMask_ ) - , reference( reference_ ) + PipelineRasterizationStateCreateInfo( PipelineRasterizationStateCreateFlags flags_ = PipelineRasterizationStateCreateFlags(), Bool32 depthClampEnable_ = 0, Bool32 rasterizerDiscardEnable_ = 0, PolygonMode polygonMode_ = PolygonMode::eFill, CullModeFlags cullMode_ = CullModeFlags(), FrontFace frontFace_ = FrontFace::eCounterClockwise, Bool32 depthBiasEnable_ = 0, float depthBiasConstantFactor_ = 0, float depthBiasClamp_ = 0, float depthBiasSlopeFactor_ = 0, float lineWidth_ = 0 ) + : flags( flags_ ) + , depthClampEnable( depthClampEnable_ ) + , rasterizerDiscardEnable( rasterizerDiscardEnable_ ) + , polygonMode( polygonMode_ ) + , cullMode( cullMode_ ) + , frontFace( frontFace_ ) + , depthBiasEnable( depthBiasEnable_ ) + , depthBiasConstantFactor( depthBiasConstantFactor_ ) + , depthBiasClamp( depthBiasClamp_ ) + , depthBiasSlopeFactor( depthBiasSlopeFactor_ ) + , lineWidth( lineWidth_ ) { } - StencilOpState( VkStencilOpState const & rhs ) + PipelineRasterizationStateCreateInfo( VkPipelineRasterizationStateCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( StencilOpState ) ); + memcpy( this, &rhs, sizeof( PipelineRasterizationStateCreateInfo ) ); } - StencilOpState& operator=( VkStencilOpState const & rhs ) + PipelineRasterizationStateCreateInfo& operator=( VkPipelineRasterizationStateCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( StencilOpState ) ); + memcpy( this, &rhs, sizeof( PipelineRasterizationStateCreateInfo ) ); return *this; } - StencilOpState& setFailOp( StencilOp failOp_ ) + PipelineRasterizationStateCreateInfo& setPNext( const void* pNext_ ) { - failOp = failOp_; + pNext = pNext_; return *this; } - StencilOpState& setPassOp( StencilOp passOp_ ) + PipelineRasterizationStateCreateInfo& setFlags( PipelineRasterizationStateCreateFlags flags_ ) { - passOp = passOp_; + flags = flags_; return *this; } - StencilOpState& setDepthFailOp( StencilOp depthFailOp_ ) + PipelineRasterizationStateCreateInfo& setDepthClampEnable( Bool32 depthClampEnable_ ) { - depthFailOp = depthFailOp_; + depthClampEnable = depthClampEnable_; return *this; } - StencilOpState& setCompareOp( CompareOp compareOp_ ) + PipelineRasterizationStateCreateInfo& setRasterizerDiscardEnable( Bool32 rasterizerDiscardEnable_ ) { - compareOp = compareOp_; + rasterizerDiscardEnable = rasterizerDiscardEnable_; return *this; } - StencilOpState& setCompareMask( uint32_t compareMask_ ) + PipelineRasterizationStateCreateInfo& setPolygonMode( PolygonMode polygonMode_ ) { - compareMask = compareMask_; + polygonMode = polygonMode_; return *this; } - StencilOpState& setWriteMask( uint32_t writeMask_ ) + PipelineRasterizationStateCreateInfo& setCullMode( CullModeFlags cullMode_ ) { - writeMask = writeMask_; + cullMode = cullMode_; return *this; } - StencilOpState& setReference( uint32_t reference_ ) + PipelineRasterizationStateCreateInfo& setFrontFace( FrontFace frontFace_ ) { - reference = reference_; + frontFace = frontFace_; return *this; } - operator const VkStencilOpState&() const + PipelineRasterizationStateCreateInfo& setDepthBiasEnable( Bool32 depthBiasEnable_ ) { - return *reinterpret_cast(this); + depthBiasEnable = depthBiasEnable_; + return *this; } - bool operator==( StencilOpState const& rhs ) const + PipelineRasterizationStateCreateInfo& setDepthBiasConstantFactor( float depthBiasConstantFactor_ ) { - return ( failOp == rhs.failOp ) - && ( passOp == rhs.passOp ) - && ( depthFailOp == rhs.depthFailOp ) - && ( compareOp == rhs.compareOp ) - && ( compareMask == rhs.compareMask ) - && ( writeMask == rhs.writeMask ) - && ( reference == rhs.reference ); + depthBiasConstantFactor = depthBiasConstantFactor_; + return *this; } - bool operator!=( StencilOpState const& rhs ) const + PipelineRasterizationStateCreateInfo& setDepthBiasClamp( float depthBiasClamp_ ) { - return !operator==( rhs ); + depthBiasClamp = depthBiasClamp_; + return *this; } - StencilOp failOp; - StencilOp passOp; - StencilOp depthFailOp; - CompareOp compareOp; - uint32_t compareMask; - uint32_t writeMask; - uint32_t reference; - }; - static_assert( sizeof( StencilOpState ) == sizeof( VkStencilOpState ), "struct and wrapper have different size!" ); + PipelineRasterizationStateCreateInfo& setDepthBiasSlopeFactor( float depthBiasSlopeFactor_ ) + { + depthBiasSlopeFactor = depthBiasSlopeFactor_; + return *this; + } - 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 - }; + PipelineRasterizationStateCreateInfo& setLineWidth( float lineWidth_ ) + { + lineWidth = lineWidth_; + return *this; + } - enum class InternalAllocationType - { - eExecutable = VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE - }; + operator const VkPipelineRasterizationStateCreateInfo&() const + { + return *reinterpret_cast(this); + } - 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 - }; + bool operator==( PipelineRasterizationStateCreateInfo const& rhs ) const + { + 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 ); + } - 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 - }; + bool operator!=( PipelineRasterizationStateCreateInfo const& rhs ) const + { + return !operator==( rhs ); + } - enum class VertexInputRate - { - eVertex = VK_VERTEX_INPUT_RATE_VERTEX, - eInstance = VK_VERTEX_INPUT_RATE_INSTANCE + private: + StructureType sType = StructureType::ePipelineRasterizationStateCreateInfo; + + public: + const void* pNext = nullptr; + PipelineRasterizationStateCreateFlags flags; + Bool32 depthClampEnable; + Bool32 rasterizerDiscardEnable; + PolygonMode polygonMode; + CullModeFlags cullMode; + FrontFace frontFace; + Bool32 depthBiasEnable; + float depthBiasConstantFactor; + float depthBiasClamp; + float depthBiasSlopeFactor; + float lineWidth; }; + static_assert( sizeof( PipelineRasterizationStateCreateInfo ) == sizeof( VkPipelineRasterizationStateCreateInfo ), "struct and wrapper have different size!" ); - struct VertexInputBindingDescription + struct PipelineDepthStencilStateCreateInfo { - VertexInputBindingDescription( uint32_t binding_ = 0, uint32_t stride_ = 0, VertexInputRate inputRate_ = VertexInputRate::eVertex ) - : binding( binding_ ) - , stride( stride_ ) - , inputRate( inputRate_ ) + PipelineDepthStencilStateCreateInfo( PipelineDepthStencilStateCreateFlags flags_ = PipelineDepthStencilStateCreateFlags(), Bool32 depthTestEnable_ = 0, Bool32 depthWriteEnable_ = 0, CompareOp depthCompareOp_ = CompareOp::eNever, Bool32 depthBoundsTestEnable_ = 0, Bool32 stencilTestEnable_ = 0, StencilOpState front_ = StencilOpState(), StencilOpState back_ = StencilOpState(), float minDepthBounds_ = 0, float maxDepthBounds_ = 0 ) + : flags( flags_ ) + , depthTestEnable( depthTestEnable_ ) + , depthWriteEnable( depthWriteEnable_ ) + , depthCompareOp( depthCompareOp_ ) + , depthBoundsTestEnable( depthBoundsTestEnable_ ) + , stencilTestEnable( stencilTestEnable_ ) + , front( front_ ) + , back( back_ ) + , minDepthBounds( minDepthBounds_ ) + , maxDepthBounds( maxDepthBounds_ ) + { + } + + PipelineDepthStencilStateCreateInfo( VkPipelineDepthStencilStateCreateInfo const & rhs ) { + memcpy( this, &rhs, sizeof( PipelineDepthStencilStateCreateInfo ) ); } - VertexInputBindingDescription( VkVertexInputBindingDescription const & rhs ) + PipelineDepthStencilStateCreateInfo& operator=( VkPipelineDepthStencilStateCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( VertexInputBindingDescription ) ); + memcpy( this, &rhs, sizeof( PipelineDepthStencilStateCreateInfo ) ); + return *this; + } + PipelineDepthStencilStateCreateInfo& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; } - VertexInputBindingDescription& operator=( VkVertexInputBindingDescription const & rhs ) + PipelineDepthStencilStateCreateInfo& setFlags( PipelineDepthStencilStateCreateFlags flags_ ) { - memcpy( this, &rhs, sizeof( VertexInputBindingDescription ) ); + flags = flags_; return *this; } - VertexInputBindingDescription& setBinding( uint32_t binding_ ) + + PipelineDepthStencilStateCreateInfo& setDepthTestEnable( Bool32 depthTestEnable_ ) { - binding = binding_; + depthTestEnable = depthTestEnable_; return *this; } - VertexInputBindingDescription& setStride( uint32_t stride_ ) + PipelineDepthStencilStateCreateInfo& setDepthWriteEnable( Bool32 depthWriteEnable_ ) { - stride = stride_; + depthWriteEnable = depthWriteEnable_; return *this; } - VertexInputBindingDescription& setInputRate( VertexInputRate inputRate_ ) + PipelineDepthStencilStateCreateInfo& setDepthCompareOp( CompareOp depthCompareOp_ ) { - inputRate = inputRate_; + depthCompareOp = depthCompareOp_; return *this; } - operator const VkVertexInputBindingDescription&() const + PipelineDepthStencilStateCreateInfo& setDepthBoundsTestEnable( Bool32 depthBoundsTestEnable_ ) { - return *reinterpret_cast(this); + depthBoundsTestEnable = depthBoundsTestEnable_; + return *this; } - bool operator==( VertexInputBindingDescription const& rhs ) const + PipelineDepthStencilStateCreateInfo& setStencilTestEnable( Bool32 stencilTestEnable_ ) { - return ( binding == rhs.binding ) - && ( stride == rhs.stride ) - && ( inputRate == rhs.inputRate ); + stencilTestEnable = stencilTestEnable_; + return *this; } - bool operator!=( VertexInputBindingDescription const& rhs ) const + PipelineDepthStencilStateCreateInfo& setFront( StencilOpState front_ ) { - return !operator==( rhs ); + front = front_; + return *this; } - uint32_t binding; - uint32_t stride; - VertexInputRate inputRate; - }; - static_assert( sizeof( VertexInputBindingDescription ) == sizeof( VkVertexInputBindingDescription ), "struct and wrapper have different size!" ); + PipelineDepthStencilStateCreateInfo& setBack( StencilOpState back_ ) + { + back = back_; + return *this; + } - 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, - 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, - eG8B8G8R8422UnormKHR = VK_FORMAT_G8B8G8R8_422_UNORM_KHR, - eB8G8R8G8422UnormKHR = VK_FORMAT_B8G8R8G8_422_UNORM_KHR, - eG8B8R83Plane420UnormKHR = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR, - eG8B8R82Plane420UnormKHR = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR, - eG8B8R83Plane422UnormKHR = VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR, - eG8B8R82Plane422UnormKHR = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR, - eG8B8R83Plane444UnormKHR = VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR, - eR10X6UnormPack16KHR = VK_FORMAT_R10X6_UNORM_PACK16_KHR, - eR10X6G10X6Unorm2Pack16KHR = VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR, - eR10X6G10X6B10X6A10X6Unorm4Pack16KHR = VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR, - eG10X6B10X6G10X6R10X6422Unorm4Pack16KHR = VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR, - eB10X6G10X6R10X6G10X6422Unorm4Pack16KHR = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR, - eG10X6B10X6R10X63Plane420Unorm3Pack16KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR, - eG10X6B10X6R10X62Plane420Unorm3Pack16KHR = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR, - eG10X6B10X6R10X63Plane422Unorm3Pack16KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR, - eG10X6B10X6R10X62Plane422Unorm3Pack16KHR = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR, - eG10X6B10X6R10X63Plane444Unorm3Pack16KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR, - eR12X4UnormPack16KHR = VK_FORMAT_R12X4_UNORM_PACK16_KHR, - eR12X4G12X4Unorm2Pack16KHR = VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR, - eR12X4G12X4B12X4A12X4Unorm4Pack16KHR = VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR, - eG12X4B12X4G12X4R12X4422Unorm4Pack16KHR = VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR, - eB12X4G12X4R12X4G12X4422Unorm4Pack16KHR = VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR, - eG12X4B12X4R12X43Plane420Unorm3Pack16KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR, - eG12X4B12X4R12X42Plane420Unorm3Pack16KHR = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR, - eG12X4B12X4R12X43Plane422Unorm3Pack16KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR, - eG12X4B12X4R12X42Plane422Unorm3Pack16KHR = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR, - eG12X4B12X4R12X43Plane444Unorm3Pack16KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR, - eG16B16G16R16422UnormKHR = VK_FORMAT_G16B16G16R16_422_UNORM_KHR, - eB16G16R16G16422UnormKHR = VK_FORMAT_B16G16R16G16_422_UNORM_KHR, - eG16B16R163Plane420UnormKHR = VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR, - eG16B16R162Plane420UnormKHR = VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR, - eG16B16R163Plane422UnormKHR = VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR, - eG16B16R162Plane422UnormKHR = VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR, - eG16B16R163Plane444UnormKHR = VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR + PipelineDepthStencilStateCreateInfo& setMinDepthBounds( float minDepthBounds_ ) + { + minDepthBounds = minDepthBounds_; + return *this; + } + + PipelineDepthStencilStateCreateInfo& setMaxDepthBounds( float maxDepthBounds_ ) + { + maxDepthBounds = maxDepthBounds_; + return *this; + } + + operator const VkPipelineDepthStencilStateCreateInfo&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PipelineDepthStencilStateCreateInfo const& rhs ) const + { + 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 ); + } + + bool operator!=( PipelineDepthStencilStateCreateInfo const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType = StructureType::ePipelineDepthStencilStateCreateInfo; + + public: + const void* pNext = nullptr; + PipelineDepthStencilStateCreateFlags flags; + Bool32 depthTestEnable; + Bool32 depthWriteEnable; + CompareOp depthCompareOp; + Bool32 depthBoundsTestEnable; + Bool32 stencilTestEnable; + StencilOpState front; + StencilOpState back; + float minDepthBounds; + float maxDepthBounds; }; + static_assert( sizeof( PipelineDepthStencilStateCreateInfo ) == sizeof( VkPipelineDepthStencilStateCreateInfo ), "struct and wrapper have different size!" ); - struct VertexInputAttributeDescription + struct PipelineCacheCreateInfo { - VertexInputAttributeDescription( uint32_t location_ = 0, uint32_t binding_ = 0, Format format_ = Format::eUndefined, uint32_t offset_ = 0 ) - : location( location_ ) - , binding( binding_ ) - , format( format_ ) - , offset( offset_ ) + PipelineCacheCreateInfo( PipelineCacheCreateFlags flags_ = PipelineCacheCreateFlags(), size_t initialDataSize_ = 0, const void* pInitialData_ = nullptr ) + : flags( flags_ ) + , initialDataSize( initialDataSize_ ) + , pInitialData( pInitialData_ ) { } - VertexInputAttributeDescription( VkVertexInputAttributeDescription const & rhs ) + PipelineCacheCreateInfo( VkPipelineCacheCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( VertexInputAttributeDescription ) ); + memcpy( this, &rhs, sizeof( PipelineCacheCreateInfo ) ); } - VertexInputAttributeDescription& operator=( VkVertexInputAttributeDescription const & rhs ) + PipelineCacheCreateInfo& operator=( VkPipelineCacheCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( VertexInputAttributeDescription ) ); + memcpy( this, &rhs, sizeof( PipelineCacheCreateInfo ) ); return *this; } - VertexInputAttributeDescription& setLocation( uint32_t location_ ) + PipelineCacheCreateInfo& setPNext( const void* pNext_ ) { - location = location_; + pNext = pNext_; return *this; } - VertexInputAttributeDescription& setBinding( uint32_t binding_ ) + PipelineCacheCreateInfo& setFlags( PipelineCacheCreateFlags flags_ ) { - binding = binding_; + flags = flags_; return *this; } - VertexInputAttributeDescription& setFormat( Format format_ ) + PipelineCacheCreateInfo& setInitialDataSize( size_t initialDataSize_ ) { - format = format_; + initialDataSize = initialDataSize_; return *this; } - VertexInputAttributeDescription& setOffset( uint32_t offset_ ) + PipelineCacheCreateInfo& setPInitialData( const void* pInitialData_ ) { - offset = offset_; + pInitialData = pInitialData_; return *this; } - operator const VkVertexInputAttributeDescription&() const + operator const VkPipelineCacheCreateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( VertexInputAttributeDescription const& rhs ) const + bool operator==( PipelineCacheCreateInfo const& rhs ) const { - return ( location == rhs.location ) - && ( binding == rhs.binding ) - && ( format == rhs.format ) - && ( offset == rhs.offset ); + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( initialDataSize == rhs.initialDataSize ) + && ( pInitialData == rhs.pInitialData ); } - bool operator!=( VertexInputAttributeDescription const& rhs ) const + bool operator!=( PipelineCacheCreateInfo const& rhs ) const { return !operator==( rhs ); } - uint32_t location; - uint32_t binding; - Format format; - uint32_t offset; - }; - static_assert( sizeof( VertexInputAttributeDescription ) == sizeof( VkVertexInputAttributeDescription ), "struct and wrapper have different size!" ); + private: + StructureType sType = StructureType::ePipelineCacheCreateInfo; - 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, - eSwapchainCreateInfoKHR = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, - ePresentInfoKHR = VK_STRUCTURE_TYPE_PRESENT_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, - eXlibSurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR, - eXcbSurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR, - eWaylandSurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR, - eMirSurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR, - eAndroidSurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR, - eWin32SurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_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, - 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, - eTextureLodGatherFormatPropertiesAMD = VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD, - eRenderPassMultiviewCreateInfoKHX = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHX, - ePhysicalDeviceMultiviewFeaturesKHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHX, - ePhysicalDeviceMultiviewPropertiesKHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHX, - eExternalMemoryImageCreateInfoNV = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV, - eExportMemoryAllocateInfoNV = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV, - 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, - ePhysicalDeviceFeatures2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR, - ePhysicalDeviceProperties2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR, - eFormatProperties2KHR = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR, - eImageFormatProperties2KHR = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR, - ePhysicalDeviceImageFormatInfo2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR, - eQueueFamilyProperties2KHR = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR, - ePhysicalDeviceMemoryProperties2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR, - eSparseImageFormatProperties2KHR = VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR, - ePhysicalDeviceSparseImageFormatInfo2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR, - eMemoryAllocateFlagsInfoKHX = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHX, - eDeviceGroupRenderPassBeginInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHX, - eDeviceGroupCommandBufferBeginInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHX, - eDeviceGroupSubmitInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHX, - eDeviceGroupBindSparseInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHX, - eAcquireNextImageInfoKHX = VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHX, - eBindBufferMemoryDeviceGroupInfoKHX = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO_KHX, - eBindImageMemoryDeviceGroupInfoKHX = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHX, - eDeviceGroupPresentCapabilitiesKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHX, - eImageSwapchainCreateInfoKHX = VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHX, - eBindImageMemorySwapchainInfoKHX = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHX, - eDeviceGroupPresentInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHX, - eDeviceGroupSwapchainCreateInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHX, - eValidationFlagsEXT = VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT, - eViSurfaceCreateInfoNN = VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN, - ePhysicalDeviceGroupPropertiesKHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHX, - eDeviceGroupDeviceCreateInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX, - ePhysicalDeviceExternalImageFormatInfoKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHR, - eExternalImageFormatPropertiesKHR = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHR, - ePhysicalDeviceExternalBufferInfoKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHR, - eExternalBufferPropertiesKHR = VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHR, - ePhysicalDeviceIdPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR, - eExternalMemoryBufferCreateInfoKHR = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR, - eExternalMemoryImageCreateInfoKHR = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR, - eExportMemoryAllocateInfoKHR = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_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, - 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, - eWin32KeyedMutexAcquireReleaseInfoKHR = VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR, - ePhysicalDeviceExternalSemaphoreInfoKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHR, - eExternalSemaphorePropertiesKHR = VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHR, - eExportSemaphoreCreateInfoKHR = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_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, - 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, - ePhysicalDevice16BitStorageFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR, - ePresentRegionsKHR = VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR, - eDescriptorUpdateTemplateCreateInfoKHR = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR, - eObjectTableCreateInfoNVX = VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX, - eIndirectCommandsLayoutCreateInfoNVX = VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX, - eCmdProcessCommandsInfoNVX = VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX, - eCmdReserveSpaceForCommandsInfoNVX = VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX, - eDeviceGeneratedCommandsLimitsNVX = VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX, - eDeviceGeneratedCommandsFeaturesNVX = VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX, - 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, - eHdrMetadataEXT = VK_STRUCTURE_TYPE_HDR_METADATA_EXT, - eSharedPresentSurfaceCapabilitiesKHR = VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR, - ePhysicalDeviceExternalFenceInfoKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR, - eExternalFencePropertiesKHR = VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES_KHR, - eExportFenceCreateInfoKHR = VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO_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, - eImportFenceFdInfoKHR = VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR, - eFenceGetFdInfoKHR = VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR, - ePhysicalDevicePointClippingPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES_KHR, - eRenderPassInputAttachmentAspectCreateInfoKHR = VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO_KHR, - eImageViewUsageCreateInfoKHR = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO_KHR, - ePipelineTessellationDomainOriginStateCreateInfoKHR = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO_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, - ePhysicalDeviceVariablePointerFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR, - eIosSurfaceCreateInfoMVK = VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK, - eMacosSurfaceCreateInfoMVK = VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK, - eMemoryDedicatedRequirementsKHR = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR, - eMemoryDedicatedAllocateInfoKHR = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR, - ePhysicalDeviceSamplerFilterMinmaxPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT, - eSamplerReductionModeCreateInfoEXT = VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT, - 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, - eBufferMemoryRequirementsInfo2KHR = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR, - eImageMemoryRequirementsInfo2KHR = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR, - eImageSparseMemoryRequirementsInfo2KHR = VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2_KHR, - eMemoryRequirements2KHR = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR, - eSparseImageMemoryRequirements2KHR = VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2_KHR, - eImageFormatListCreateInfoKHR = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR, - 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, - ePipelineCoverageModulationStateCreateInfoNV = VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV, - eSamplerYcbcrConversionCreateInfoKHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_KHR, - eSamplerYcbcrConversionInfoKHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR, - eBindImagePlaneMemoryInfoKHR = VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO_KHR, - eImagePlaneMemoryRequirementsInfoKHR = VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO_KHR, - ePhysicalDeviceSamplerYcbcrConversionFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR, - eSamplerYcbcrConversionImageFormatPropertiesKHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES_KHR, - eBindBufferMemoryInfoKHR = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR, - eBindImageMemoryInfoKHR = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR, - eValidationCacheCreateInfoEXT = VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT, - eShaderModuleValidationCacheCreateInfoEXT = VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT, - eDeviceQueueGlobalPriorityCreateInfoEXT = VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT + public: + const void* pNext = nullptr; + PipelineCacheCreateFlags flags; + size_t initialDataSize; + const void* pInitialData; }; - - struct ApplicationInfo - { - ApplicationInfo( const char* pApplicationName_ = nullptr, uint32_t applicationVersion_ = 0, const char* pEngineName_ = nullptr, uint32_t engineVersion_ = 0, uint32_t apiVersion_ = 0 ) - : sType( StructureType::eApplicationInfo ) - , pNext( nullptr ) - , pApplicationName( pApplicationName_ ) - , applicationVersion( applicationVersion_ ) - , pEngineName( pEngineName_ ) - , engineVersion( engineVersion_ ) - , apiVersion( apiVersion_ ) + static_assert( sizeof( PipelineCacheCreateInfo ) == sizeof( VkPipelineCacheCreateInfo ), "struct and wrapper have different size!" ); + + struct SamplerCreateInfo + { + SamplerCreateInfo( SamplerCreateFlags flags_ = SamplerCreateFlags(), Filter magFilter_ = Filter::eNearest, Filter minFilter_ = Filter::eNearest, SamplerMipmapMode mipmapMode_ = SamplerMipmapMode::eNearest, SamplerAddressMode addressModeU_ = SamplerAddressMode::eRepeat, SamplerAddressMode addressModeV_ = SamplerAddressMode::eRepeat, SamplerAddressMode addressModeW_ = SamplerAddressMode::eRepeat, float mipLodBias_ = 0, Bool32 anisotropyEnable_ = 0, float maxAnisotropy_ = 0, Bool32 compareEnable_ = 0, CompareOp compareOp_ = CompareOp::eNever, float minLod_ = 0, float maxLod_ = 0, BorderColor borderColor_ = BorderColor::eFloatTransparentBlack, Bool32 unnormalizedCoordinates_ = 0 ) + : 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_ ) { } - ApplicationInfo( VkApplicationInfo const & rhs ) + SamplerCreateInfo( VkSamplerCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ApplicationInfo ) ); + memcpy( this, &rhs, sizeof( SamplerCreateInfo ) ); } - ApplicationInfo& operator=( VkApplicationInfo const & rhs ) + SamplerCreateInfo& operator=( VkSamplerCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ApplicationInfo ) ); + memcpy( this, &rhs, sizeof( SamplerCreateInfo ) ); return *this; } - ApplicationInfo& setPNext( const void* pNext_ ) + SamplerCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - ApplicationInfo& setPApplicationName( const char* pApplicationName_ ) + SamplerCreateInfo& setFlags( SamplerCreateFlags flags_ ) { - pApplicationName = pApplicationName_; + flags = flags_; return *this; } - ApplicationInfo& setApplicationVersion( uint32_t applicationVersion_ ) + SamplerCreateInfo& setMagFilter( Filter magFilter_ ) { - applicationVersion = applicationVersion_; + magFilter = magFilter_; return *this; } - ApplicationInfo& setPEngineName( const char* pEngineName_ ) + SamplerCreateInfo& setMinFilter( Filter minFilter_ ) { - pEngineName = pEngineName_; + minFilter = minFilter_; return *this; } - ApplicationInfo& setEngineVersion( uint32_t engineVersion_ ) + SamplerCreateInfo& setMipmapMode( SamplerMipmapMode mipmapMode_ ) { - engineVersion = engineVersion_; + mipmapMode = mipmapMode_; return *this; } - ApplicationInfo& setApiVersion( uint32_t apiVersion_ ) + SamplerCreateInfo& setAddressModeU( SamplerAddressMode addressModeU_ ) { - apiVersion = apiVersion_; + addressModeU = addressModeU_; return *this; } - operator const VkApplicationInfo&() const + SamplerCreateInfo& setAddressModeV( SamplerAddressMode addressModeV_ ) { - return *reinterpret_cast(this); + addressModeV = addressModeV_; + return *this; } - bool operator==( ApplicationInfo const& rhs ) const + SamplerCreateInfo& setAddressModeW( SamplerAddressMode addressModeW_ ) { - return ( sType == rhs.sType ) - && ( pNext == rhs.pNext ) - && ( pApplicationName == rhs.pApplicationName ) - && ( applicationVersion == rhs.applicationVersion ) - && ( pEngineName == rhs.pEngineName ) - && ( engineVersion == rhs.engineVersion ) - && ( apiVersion == rhs.apiVersion ); + addressModeW = addressModeW_; + return *this; } - bool operator!=( ApplicationInfo const& rhs ) const + SamplerCreateInfo& setMipLodBias( float mipLodBias_ ) { - return !operator==( rhs ); + mipLodBias = mipLodBias_; + return *this; } - private: - StructureType sType; - - public: - const void* pNext; - const char* pApplicationName; - uint32_t applicationVersion; - const char* pEngineName; - uint32_t engineVersion; - uint32_t apiVersion; - }; - static_assert( sizeof( ApplicationInfo ) == sizeof( VkApplicationInfo ), "struct and wrapper have different size!" ); - - struct DeviceQueueCreateInfo - { - DeviceQueueCreateInfo( DeviceQueueCreateFlags flags_ = DeviceQueueCreateFlags(), uint32_t queueFamilyIndex_ = 0, uint32_t queueCount_ = 0, const float* pQueuePriorities_ = nullptr ) - : sType( StructureType::eDeviceQueueCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) - , queueFamilyIndex( queueFamilyIndex_ ) - , queueCount( queueCount_ ) - , pQueuePriorities( pQueuePriorities_ ) + SamplerCreateInfo& setAnisotropyEnable( Bool32 anisotropyEnable_ ) { + anisotropyEnable = anisotropyEnable_; + return *this; } - DeviceQueueCreateInfo( VkDeviceQueueCreateInfo const & rhs ) + SamplerCreateInfo& setMaxAnisotropy( float maxAnisotropy_ ) { - memcpy( this, &rhs, sizeof( DeviceQueueCreateInfo ) ); + maxAnisotropy = maxAnisotropy_; + return *this; } - DeviceQueueCreateInfo& operator=( VkDeviceQueueCreateInfo const & rhs ) + SamplerCreateInfo& setCompareEnable( Bool32 compareEnable_ ) { - memcpy( this, &rhs, sizeof( DeviceQueueCreateInfo ) ); + compareEnable = compareEnable_; return *this; } - DeviceQueueCreateInfo& setPNext( const void* pNext_ ) + + SamplerCreateInfo& setCompareOp( CompareOp compareOp_ ) { - pNext = pNext_; + compareOp = compareOp_; return *this; } - DeviceQueueCreateInfo& setFlags( DeviceQueueCreateFlags flags_ ) + SamplerCreateInfo& setMinLod( float minLod_ ) { - flags = flags_; + minLod = minLod_; return *this; } - DeviceQueueCreateInfo& setQueueFamilyIndex( uint32_t queueFamilyIndex_ ) + SamplerCreateInfo& setMaxLod( float maxLod_ ) { - queueFamilyIndex = queueFamilyIndex_; + maxLod = maxLod_; return *this; } - DeviceQueueCreateInfo& setQueueCount( uint32_t queueCount_ ) + SamplerCreateInfo& setBorderColor( BorderColor borderColor_ ) { - queueCount = queueCount_; + borderColor = borderColor_; return *this; } - DeviceQueueCreateInfo& setPQueuePriorities( const float* pQueuePriorities_ ) + SamplerCreateInfo& setUnnormalizedCoordinates( Bool32 unnormalizedCoordinates_ ) { - pQueuePriorities = pQueuePriorities_; + unnormalizedCoordinates = unnormalizedCoordinates_; return *this; } - operator const VkDeviceQueueCreateInfo&() const + operator const VkSamplerCreateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DeviceQueueCreateInfo const& rhs ) const + bool operator==( SamplerCreateInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) - && ( queueFamilyIndex == rhs.queueFamilyIndex ) - && ( queueCount == rhs.queueCount ) - && ( pQueuePriorities == rhs.pQueuePriorities ); + && ( 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 ); } - bool operator!=( DeviceQueueCreateInfo const& rhs ) const + bool operator!=( SamplerCreateInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eSamplerCreateInfo; public: - const void* pNext; - DeviceQueueCreateFlags flags; - uint32_t queueFamilyIndex; - uint32_t queueCount; - const float* pQueuePriorities; + const void* pNext = nullptr; + SamplerCreateFlags flags; + Filter magFilter; + Filter minFilter; + SamplerMipmapMode mipmapMode; + SamplerAddressMode addressModeU; + SamplerAddressMode addressModeV; + SamplerAddressMode addressModeW; + float mipLodBias; + Bool32 anisotropyEnable; + float maxAnisotropy; + Bool32 compareEnable; + CompareOp compareOp; + float minLod; + float maxLod; + BorderColor borderColor; + Bool32 unnormalizedCoordinates; }; - static_assert( sizeof( DeviceQueueCreateInfo ) == sizeof( VkDeviceQueueCreateInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( SamplerCreateInfo ) == sizeof( VkSamplerCreateInfo ), "struct and wrapper have different size!" ); - struct DeviceCreateInfo + struct CommandBufferAllocateInfo { - DeviceCreateInfo( DeviceCreateFlags flags_ = DeviceCreateFlags(), uint32_t queueCreateInfoCount_ = 0, const DeviceQueueCreateInfo* pQueueCreateInfos_ = nullptr, uint32_t enabledLayerCount_ = 0, const char* const* ppEnabledLayerNames_ = nullptr, uint32_t enabledExtensionCount_ = 0, const char* const* ppEnabledExtensionNames_ = nullptr, const PhysicalDeviceFeatures* pEnabledFeatures_ = nullptr ) - : sType( StructureType::eDeviceCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) - , queueCreateInfoCount( queueCreateInfoCount_ ) - , pQueueCreateInfos( pQueueCreateInfos_ ) - , enabledLayerCount( enabledLayerCount_ ) - , ppEnabledLayerNames( ppEnabledLayerNames_ ) - , enabledExtensionCount( enabledExtensionCount_ ) - , ppEnabledExtensionNames( ppEnabledExtensionNames_ ) - , pEnabledFeatures( pEnabledFeatures_ ) + CommandBufferAllocateInfo( CommandPool commandPool_ = CommandPool(), CommandBufferLevel level_ = CommandBufferLevel::ePrimary, uint32_t commandBufferCount_ = 0 ) + : commandPool( commandPool_ ) + , level( level_ ) + , commandBufferCount( commandBufferCount_ ) { } - DeviceCreateInfo( VkDeviceCreateInfo const & rhs ) + CommandBufferAllocateInfo( VkCommandBufferAllocateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceCreateInfo ) ); + memcpy( this, &rhs, sizeof( CommandBufferAllocateInfo ) ); } - DeviceCreateInfo& operator=( VkDeviceCreateInfo const & rhs ) + CommandBufferAllocateInfo& operator=( VkCommandBufferAllocateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceCreateInfo ) ); + memcpy( this, &rhs, sizeof( CommandBufferAllocateInfo ) ); return *this; } - DeviceCreateInfo& setPNext( const void* pNext_ ) + CommandBufferAllocateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - DeviceCreateInfo& setFlags( DeviceCreateFlags flags_ ) + CommandBufferAllocateInfo& setCommandPool( CommandPool commandPool_ ) { - flags = flags_; + commandPool = commandPool_; return *this; } - DeviceCreateInfo& setQueueCreateInfoCount( uint32_t queueCreateInfoCount_ ) + CommandBufferAllocateInfo& setLevel( CommandBufferLevel level_ ) + { + level = level_; + return *this; + } + + CommandBufferAllocateInfo& setCommandBufferCount( uint32_t commandBufferCount_ ) + { + commandBufferCount = commandBufferCount_; + return *this; + } + + operator const VkCommandBufferAllocateInfo&() const + { + return *reinterpret_cast(this); + } + + bool operator==( CommandBufferAllocateInfo const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( commandPool == rhs.commandPool ) + && ( level == rhs.level ) + && ( commandBufferCount == rhs.commandBufferCount ); + } + + bool operator!=( CommandBufferAllocateInfo const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType = StructureType::eCommandBufferAllocateInfo; + + public: + const void* pNext = nullptr; + CommandPool commandPool; + CommandBufferLevel level; + uint32_t commandBufferCount; + }; + static_assert( sizeof( CommandBufferAllocateInfo ) == sizeof( VkCommandBufferAllocateInfo ), "struct and wrapper have different size!" ); + + struct RenderPassBeginInfo + { + RenderPassBeginInfo( RenderPass renderPass_ = RenderPass(), Framebuffer framebuffer_ = Framebuffer(), Rect2D renderArea_ = Rect2D(), uint32_t clearValueCount_ = 0, const ClearValue* pClearValues_ = nullptr ) + : renderPass( renderPass_ ) + , framebuffer( framebuffer_ ) + , renderArea( renderArea_ ) + , clearValueCount( clearValueCount_ ) + , pClearValues( pClearValues_ ) + { + } + + RenderPassBeginInfo( VkRenderPassBeginInfo const & rhs ) + { + memcpy( this, &rhs, sizeof( RenderPassBeginInfo ) ); + } + + RenderPassBeginInfo& operator=( VkRenderPassBeginInfo const & rhs ) { - queueCreateInfoCount = queueCreateInfoCount_; + memcpy( this, &rhs, sizeof( RenderPassBeginInfo ) ); return *this; } - - DeviceCreateInfo& setPQueueCreateInfos( const DeviceQueueCreateInfo* pQueueCreateInfos_ ) + RenderPassBeginInfo& setPNext( const void* pNext_ ) { - pQueueCreateInfos = pQueueCreateInfos_; + pNext = pNext_; return *this; } - DeviceCreateInfo& setEnabledLayerCount( uint32_t enabledLayerCount_ ) + RenderPassBeginInfo& setRenderPass( RenderPass renderPass_ ) { - enabledLayerCount = enabledLayerCount_; + renderPass = renderPass_; return *this; } - DeviceCreateInfo& setPpEnabledLayerNames( const char* const* ppEnabledLayerNames_ ) + RenderPassBeginInfo& setFramebuffer( Framebuffer framebuffer_ ) { - ppEnabledLayerNames = ppEnabledLayerNames_; + framebuffer = framebuffer_; return *this; } - DeviceCreateInfo& setEnabledExtensionCount( uint32_t enabledExtensionCount_ ) + RenderPassBeginInfo& setRenderArea( Rect2D renderArea_ ) { - enabledExtensionCount = enabledExtensionCount_; + renderArea = renderArea_; return *this; } - DeviceCreateInfo& setPpEnabledExtensionNames( const char* const* ppEnabledExtensionNames_ ) + RenderPassBeginInfo& setClearValueCount( uint32_t clearValueCount_ ) { - ppEnabledExtensionNames = ppEnabledExtensionNames_; + clearValueCount = clearValueCount_; return *this; } - DeviceCreateInfo& setPEnabledFeatures( const PhysicalDeviceFeatures* pEnabledFeatures_ ) + RenderPassBeginInfo& setPClearValues( const ClearValue* pClearValues_ ) { - pEnabledFeatures = pEnabledFeatures_; + pClearValues = pClearValues_; return *this; } - operator const VkDeviceCreateInfo&() const + operator const VkRenderPassBeginInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DeviceCreateInfo const& rhs ) const + bool operator==( RenderPassBeginInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( queueCreateInfoCount == rhs.queueCreateInfoCount ) - && ( pQueueCreateInfos == rhs.pQueueCreateInfos ) - && ( enabledLayerCount == rhs.enabledLayerCount ) - && ( ppEnabledLayerNames == rhs.ppEnabledLayerNames ) - && ( enabledExtensionCount == rhs.enabledExtensionCount ) - && ( ppEnabledExtensionNames == rhs.ppEnabledExtensionNames ) - && ( pEnabledFeatures == rhs.pEnabledFeatures ); + && ( renderPass == rhs.renderPass ) + && ( framebuffer == rhs.framebuffer ) + && ( renderArea == rhs.renderArea ) + && ( clearValueCount == rhs.clearValueCount ) + && ( pClearValues == rhs.pClearValues ); } - bool operator!=( DeviceCreateInfo const& rhs ) const + bool operator!=( RenderPassBeginInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eRenderPassBeginInfo; public: - const void* pNext; - DeviceCreateFlags flags; - uint32_t queueCreateInfoCount; - const DeviceQueueCreateInfo* pQueueCreateInfos; - uint32_t enabledLayerCount; - const char* const* ppEnabledLayerNames; - uint32_t enabledExtensionCount; - const char* const* ppEnabledExtensionNames; - const PhysicalDeviceFeatures* pEnabledFeatures; + const void* pNext = nullptr; + RenderPass renderPass; + Framebuffer framebuffer; + Rect2D renderArea; + uint32_t clearValueCount; + const ClearValue* pClearValues; }; - static_assert( sizeof( DeviceCreateInfo ) == sizeof( VkDeviceCreateInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( RenderPassBeginInfo ) == sizeof( VkRenderPassBeginInfo ), "struct and wrapper have different size!" ); - struct InstanceCreateInfo + struct EventCreateInfo { - InstanceCreateInfo( InstanceCreateFlags flags_ = InstanceCreateFlags(), const ApplicationInfo* pApplicationInfo_ = nullptr, uint32_t enabledLayerCount_ = 0, const char* const* ppEnabledLayerNames_ = nullptr, uint32_t enabledExtensionCount_ = 0, const char* const* ppEnabledExtensionNames_ = nullptr ) - : sType( StructureType::eInstanceCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) - , pApplicationInfo( pApplicationInfo_ ) - , enabledLayerCount( enabledLayerCount_ ) - , ppEnabledLayerNames( ppEnabledLayerNames_ ) - , enabledExtensionCount( enabledExtensionCount_ ) - , ppEnabledExtensionNames( ppEnabledExtensionNames_ ) + EventCreateInfo( EventCreateFlags flags_ = EventCreateFlags() ) + : flags( flags_ ) { } - InstanceCreateInfo( VkInstanceCreateInfo const & rhs ) + EventCreateInfo( VkEventCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( InstanceCreateInfo ) ); + memcpy( this, &rhs, sizeof( EventCreateInfo ) ); } - InstanceCreateInfo& operator=( VkInstanceCreateInfo const & rhs ) + EventCreateInfo& operator=( VkEventCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( InstanceCreateInfo ) ); + memcpy( this, &rhs, sizeof( EventCreateInfo ) ); return *this; } - InstanceCreateInfo& setPNext( const void* pNext_ ) + EventCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - InstanceCreateInfo& setFlags( InstanceCreateFlags flags_ ) + EventCreateInfo& setFlags( EventCreateFlags flags_ ) { flags = flags_; return *this; } - InstanceCreateInfo& setPApplicationInfo( const ApplicationInfo* pApplicationInfo_ ) + operator const VkEventCreateInfo&() const { - pApplicationInfo = pApplicationInfo_; - return *this; + return *reinterpret_cast(this); } - InstanceCreateInfo& setEnabledLayerCount( uint32_t enabledLayerCount_ ) + bool operator==( EventCreateInfo const& rhs ) const { - enabledLayerCount = enabledLayerCount_; - return *this; + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ); } - InstanceCreateInfo& setPpEnabledLayerNames( const char* const* ppEnabledLayerNames_ ) + bool operator!=( EventCreateInfo const& rhs ) const { - ppEnabledLayerNames = ppEnabledLayerNames_; - return *this; + return !operator==( rhs ); } - InstanceCreateInfo& setEnabledExtensionCount( uint32_t enabledExtensionCount_ ) + private: + StructureType sType = StructureType::eEventCreateInfo; + + public: + const void* pNext = nullptr; + EventCreateFlags flags; + }; + static_assert( sizeof( EventCreateInfo ) == sizeof( VkEventCreateInfo ), "struct and wrapper have different size!" ); + + struct SemaphoreCreateInfo + { + SemaphoreCreateInfo( SemaphoreCreateFlags flags_ = SemaphoreCreateFlags() ) + : flags( flags_ ) { - enabledExtensionCount = enabledExtensionCount_; + } + + SemaphoreCreateInfo( VkSemaphoreCreateInfo const & rhs ) + { + memcpy( this, &rhs, sizeof( SemaphoreCreateInfo ) ); + } + + SemaphoreCreateInfo& operator=( VkSemaphoreCreateInfo const & rhs ) + { + memcpy( this, &rhs, sizeof( SemaphoreCreateInfo ) ); + return *this; + } + SemaphoreCreateInfo& setPNext( const void* pNext_ ) + { + pNext = pNext_; return *this; } - InstanceCreateInfo& setPpEnabledExtensionNames( const char* const* ppEnabledExtensionNames_ ) + SemaphoreCreateInfo& setFlags( SemaphoreCreateFlags flags_ ) { - ppEnabledExtensionNames = ppEnabledExtensionNames_; + flags = flags_; return *this; } - operator const VkInstanceCreateInfo&() const + operator const VkSemaphoreCreateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( InstanceCreateInfo const& rhs ) const + bool operator==( SemaphoreCreateInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( pApplicationInfo == rhs.pApplicationInfo ) - && ( enabledLayerCount == rhs.enabledLayerCount ) - && ( ppEnabledLayerNames == rhs.ppEnabledLayerNames ) - && ( enabledExtensionCount == rhs.enabledExtensionCount ) - && ( ppEnabledExtensionNames == rhs.ppEnabledExtensionNames ); + && ( flags == rhs.flags ); } - bool operator!=( InstanceCreateInfo const& rhs ) const + bool operator!=( SemaphoreCreateInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eSemaphoreCreateInfo; public: - const void* pNext; - InstanceCreateFlags flags; - const ApplicationInfo* pApplicationInfo; - uint32_t enabledLayerCount; - const char* const* ppEnabledLayerNames; - uint32_t enabledExtensionCount; - const char* const* ppEnabledExtensionNames; + const void* pNext = nullptr; + SemaphoreCreateFlags flags; }; - static_assert( sizeof( InstanceCreateInfo ) == sizeof( VkInstanceCreateInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( SemaphoreCreateInfo ) == sizeof( VkSemaphoreCreateInfo ), "struct and wrapper have different size!" ); - struct MemoryAllocateInfo + struct FramebufferCreateInfo { - MemoryAllocateInfo( DeviceSize allocationSize_ = 0, uint32_t memoryTypeIndex_ = 0 ) - : sType( StructureType::eMemoryAllocateInfo ) - , pNext( nullptr ) - , allocationSize( allocationSize_ ) - , memoryTypeIndex( memoryTypeIndex_ ) + FramebufferCreateInfo( FramebufferCreateFlags flags_ = FramebufferCreateFlags(), RenderPass renderPass_ = RenderPass(), uint32_t attachmentCount_ = 0, const ImageView* pAttachments_ = nullptr, uint32_t width_ = 0, uint32_t height_ = 0, uint32_t layers_ = 0 ) + : flags( flags_ ) + , renderPass( renderPass_ ) + , attachmentCount( attachmentCount_ ) + , pAttachments( pAttachments_ ) + , width( width_ ) + , height( height_ ) + , layers( layers_ ) { } - MemoryAllocateInfo( VkMemoryAllocateInfo const & rhs ) + FramebufferCreateInfo( VkFramebufferCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( MemoryAllocateInfo ) ); + memcpy( this, &rhs, sizeof( FramebufferCreateInfo ) ); } - MemoryAllocateInfo& operator=( VkMemoryAllocateInfo const & rhs ) + FramebufferCreateInfo& operator=( VkFramebufferCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( MemoryAllocateInfo ) ); + memcpy( this, &rhs, sizeof( FramebufferCreateInfo ) ); return *this; } - MemoryAllocateInfo& setPNext( const void* pNext_ ) + FramebufferCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - MemoryAllocateInfo& setAllocationSize( DeviceSize allocationSize_ ) + FramebufferCreateInfo& setFlags( FramebufferCreateFlags flags_ ) { - allocationSize = allocationSize_; + flags = flags_; return *this; } - MemoryAllocateInfo& setMemoryTypeIndex( uint32_t memoryTypeIndex_ ) + FramebufferCreateInfo& setRenderPass( RenderPass renderPass_ ) { - memoryTypeIndex = memoryTypeIndex_; + renderPass = renderPass_; return *this; } - operator const VkMemoryAllocateInfo&() const + FramebufferCreateInfo& setAttachmentCount( uint32_t attachmentCount_ ) { - return *reinterpret_cast(this); + attachmentCount = attachmentCount_; + return *this; } - bool operator==( MemoryAllocateInfo const& rhs ) const + FramebufferCreateInfo& setPAttachments( const ImageView* pAttachments_ ) + { + pAttachments = pAttachments_; + return *this; + } + + FramebufferCreateInfo& setWidth( uint32_t width_ ) + { + width = width_; + return *this; + } + + FramebufferCreateInfo& setHeight( uint32_t height_ ) + { + height = height_; + return *this; + } + + FramebufferCreateInfo& setLayers( uint32_t layers_ ) + { + layers = layers_; + return *this; + } + + operator const VkFramebufferCreateInfo&() const + { + return *reinterpret_cast(this); + } + + bool operator==( FramebufferCreateInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( allocationSize == rhs.allocationSize ) - && ( memoryTypeIndex == rhs.memoryTypeIndex ); + && ( flags == rhs.flags ) + && ( renderPass == rhs.renderPass ) + && ( attachmentCount == rhs.attachmentCount ) + && ( pAttachments == rhs.pAttachments ) + && ( width == rhs.width ) + && ( height == rhs.height ) + && ( layers == rhs.layers ); } - bool operator!=( MemoryAllocateInfo const& rhs ) const + bool operator!=( FramebufferCreateInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eFramebufferCreateInfo; public: - const void* pNext; - DeviceSize allocationSize; - uint32_t memoryTypeIndex; + const void* pNext = nullptr; + FramebufferCreateFlags flags; + RenderPass renderPass; + uint32_t attachmentCount; + const ImageView* pAttachments; + uint32_t width; + uint32_t height; + uint32_t layers; }; - static_assert( sizeof( MemoryAllocateInfo ) == sizeof( VkMemoryAllocateInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( FramebufferCreateInfo ) == sizeof( VkFramebufferCreateInfo ), "struct and wrapper have different size!" ); - struct MappedMemoryRange + struct DisplayModeCreateInfoKHR { - MappedMemoryRange( DeviceMemory memory_ = DeviceMemory(), DeviceSize offset_ = 0, DeviceSize size_ = 0 ) - : sType( StructureType::eMappedMemoryRange ) - , pNext( nullptr ) - , memory( memory_ ) - , offset( offset_ ) - , size( size_ ) + DisplayModeCreateInfoKHR( DisplayModeCreateFlagsKHR flags_ = DisplayModeCreateFlagsKHR(), DisplayModeParametersKHR parameters_ = DisplayModeParametersKHR() ) + : flags( flags_ ) + , parameters( parameters_ ) { } - MappedMemoryRange( VkMappedMemoryRange const & rhs ) + DisplayModeCreateInfoKHR( VkDisplayModeCreateInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( MappedMemoryRange ) ); + memcpy( this, &rhs, sizeof( DisplayModeCreateInfoKHR ) ); } - MappedMemoryRange& operator=( VkMappedMemoryRange const & rhs ) + DisplayModeCreateInfoKHR& operator=( VkDisplayModeCreateInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( MappedMemoryRange ) ); + memcpy( this, &rhs, sizeof( DisplayModeCreateInfoKHR ) ); return *this; } - MappedMemoryRange& setPNext( const void* pNext_ ) + DisplayModeCreateInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - MappedMemoryRange& setMemory( DeviceMemory memory_ ) - { - memory = memory_; - return *this; - } - - MappedMemoryRange& setOffset( DeviceSize offset_ ) + DisplayModeCreateInfoKHR& setFlags( DisplayModeCreateFlagsKHR flags_ ) { - offset = offset_; + flags = flags_; return *this; } - MappedMemoryRange& setSize( DeviceSize size_ ) + DisplayModeCreateInfoKHR& setParameters( DisplayModeParametersKHR parameters_ ) { - size = size_; + parameters = parameters_; return *this; } - operator const VkMappedMemoryRange&() const + operator const VkDisplayModeCreateInfoKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( MappedMemoryRange const& rhs ) const + bool operator==( DisplayModeCreateInfoKHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( memory == rhs.memory ) - && ( offset == rhs.offset ) - && ( size == rhs.size ); + && ( flags == rhs.flags ) + && ( parameters == rhs.parameters ); } - bool operator!=( MappedMemoryRange const& rhs ) const + bool operator!=( DisplayModeCreateInfoKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDisplayModeCreateInfoKHR; public: - const void* pNext; - DeviceMemory memory; - DeviceSize offset; - DeviceSize size; + const void* pNext = nullptr; + DisplayModeCreateFlagsKHR flags; + DisplayModeParametersKHR parameters; }; - static_assert( sizeof( MappedMemoryRange ) == sizeof( VkMappedMemoryRange ), "struct and wrapper have different size!" ); + static_assert( sizeof( DisplayModeCreateInfoKHR ) == sizeof( VkDisplayModeCreateInfoKHR ), "struct and wrapper have different size!" ); - struct WriteDescriptorSet + struct DisplayPresentInfoKHR { - WriteDescriptorSet( DescriptorSet dstSet_ = DescriptorSet(), uint32_t dstBinding_ = 0, uint32_t dstArrayElement_ = 0, uint32_t descriptorCount_ = 0, DescriptorType descriptorType_ = DescriptorType::eSampler, const DescriptorImageInfo* pImageInfo_ = nullptr, const DescriptorBufferInfo* pBufferInfo_ = nullptr, const BufferView* pTexelBufferView_ = nullptr ) - : sType( StructureType::eWriteDescriptorSet ) - , pNext( nullptr ) - , dstSet( dstSet_ ) - , dstBinding( dstBinding_ ) - , dstArrayElement( dstArrayElement_ ) - , descriptorCount( descriptorCount_ ) - , descriptorType( descriptorType_ ) - , pImageInfo( pImageInfo_ ) - , pBufferInfo( pBufferInfo_ ) - , pTexelBufferView( pTexelBufferView_ ) + DisplayPresentInfoKHR( Rect2D srcRect_ = Rect2D(), Rect2D dstRect_ = Rect2D(), Bool32 persistent_ = 0 ) + : srcRect( srcRect_ ) + , dstRect( dstRect_ ) + , persistent( persistent_ ) { } - WriteDescriptorSet( VkWriteDescriptorSet const & rhs ) + DisplayPresentInfoKHR( VkDisplayPresentInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( WriteDescriptorSet ) ); + memcpy( this, &rhs, sizeof( DisplayPresentInfoKHR ) ); } - WriteDescriptorSet& operator=( VkWriteDescriptorSet const & rhs ) + DisplayPresentInfoKHR& operator=( VkDisplayPresentInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( WriteDescriptorSet ) ); + memcpy( this, &rhs, sizeof( DisplayPresentInfoKHR ) ); return *this; } - WriteDescriptorSet& setPNext( const void* pNext_ ) + DisplayPresentInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - WriteDescriptorSet& setDstSet( DescriptorSet dstSet_ ) - { - dstSet = dstSet_; - return *this; - } - - WriteDescriptorSet& setDstBinding( uint32_t dstBinding_ ) - { - dstBinding = dstBinding_; - return *this; - } - - WriteDescriptorSet& setDstArrayElement( uint32_t dstArrayElement_ ) - { - dstArrayElement = dstArrayElement_; - return *this; - } - - WriteDescriptorSet& setDescriptorCount( uint32_t descriptorCount_ ) - { - descriptorCount = descriptorCount_; - return *this; - } - - WriteDescriptorSet& setDescriptorType( DescriptorType descriptorType_ ) - { - descriptorType = descriptorType_; - return *this; - } - - WriteDescriptorSet& setPImageInfo( const DescriptorImageInfo* pImageInfo_ ) + DisplayPresentInfoKHR& setSrcRect( Rect2D srcRect_ ) { - pImageInfo = pImageInfo_; + srcRect = srcRect_; return *this; } - WriteDescriptorSet& setPBufferInfo( const DescriptorBufferInfo* pBufferInfo_ ) + DisplayPresentInfoKHR& setDstRect( Rect2D dstRect_ ) { - pBufferInfo = pBufferInfo_; + dstRect = dstRect_; return *this; } - WriteDescriptorSet& setPTexelBufferView( const BufferView* pTexelBufferView_ ) + DisplayPresentInfoKHR& setPersistent( Bool32 persistent_ ) { - pTexelBufferView = pTexelBufferView_; + persistent = persistent_; return *this; } - operator const VkWriteDescriptorSet&() const + operator const VkDisplayPresentInfoKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( WriteDescriptorSet const& rhs ) const + bool operator==( DisplayPresentInfoKHR const& rhs ) const { 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 ); + && ( srcRect == rhs.srcRect ) + && ( dstRect == rhs.dstRect ) + && ( persistent == rhs.persistent ); } - bool operator!=( WriteDescriptorSet const& rhs ) const + bool operator!=( DisplayPresentInfoKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDisplayPresentInfoKHR; public: - const void* pNext; - DescriptorSet dstSet; - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; - DescriptorType descriptorType; - const DescriptorImageInfo* pImageInfo; - const DescriptorBufferInfo* pBufferInfo; - const BufferView* pTexelBufferView; + const void* pNext = nullptr; + Rect2D srcRect; + Rect2D dstRect; + Bool32 persistent; }; - static_assert( sizeof( WriteDescriptorSet ) == sizeof( VkWriteDescriptorSet ), "struct and wrapper have different size!" ); + static_assert( sizeof( DisplayPresentInfoKHR ) == sizeof( VkDisplayPresentInfoKHR ), "struct and wrapper have different size!" ); - struct CopyDescriptorSet +#ifdef VK_USE_PLATFORM_ANDROID_KHR + struct AndroidSurfaceCreateInfoKHR { - CopyDescriptorSet( DescriptorSet srcSet_ = DescriptorSet(), uint32_t srcBinding_ = 0, uint32_t srcArrayElement_ = 0, DescriptorSet dstSet_ = DescriptorSet(), uint32_t dstBinding_ = 0, uint32_t dstArrayElement_ = 0, uint32_t descriptorCount_ = 0 ) - : sType( StructureType::eCopyDescriptorSet ) - , pNext( nullptr ) - , srcSet( srcSet_ ) - , srcBinding( srcBinding_ ) - , srcArrayElement( srcArrayElement_ ) - , dstSet( dstSet_ ) - , dstBinding( dstBinding_ ) - , dstArrayElement( dstArrayElement_ ) - , descriptorCount( descriptorCount_ ) + AndroidSurfaceCreateInfoKHR( AndroidSurfaceCreateFlagsKHR flags_ = AndroidSurfaceCreateFlagsKHR(), struct ANativeWindow* window_ = nullptr ) + : flags( flags_ ) + , window( window_ ) { } - CopyDescriptorSet( VkCopyDescriptorSet const & rhs ) + AndroidSurfaceCreateInfoKHR( VkAndroidSurfaceCreateInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( CopyDescriptorSet ) ); + memcpy( this, &rhs, sizeof( AndroidSurfaceCreateInfoKHR ) ); } - CopyDescriptorSet& operator=( VkCopyDescriptorSet const & rhs ) + AndroidSurfaceCreateInfoKHR& operator=( VkAndroidSurfaceCreateInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( CopyDescriptorSet ) ); + memcpy( this, &rhs, sizeof( AndroidSurfaceCreateInfoKHR ) ); return *this; } - CopyDescriptorSet& setPNext( const void* pNext_ ) + AndroidSurfaceCreateInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - CopyDescriptorSet& setSrcSet( DescriptorSet srcSet_ ) - { - srcSet = srcSet_; - return *this; - } - - CopyDescriptorSet& setSrcBinding( uint32_t srcBinding_ ) - { - srcBinding = srcBinding_; - return *this; - } - - CopyDescriptorSet& setSrcArrayElement( uint32_t srcArrayElement_ ) - { - srcArrayElement = srcArrayElement_; - return *this; - } - - CopyDescriptorSet& setDstSet( DescriptorSet dstSet_ ) - { - dstSet = dstSet_; - return *this; - } - - CopyDescriptorSet& setDstBinding( uint32_t dstBinding_ ) - { - dstBinding = dstBinding_; - return *this; - } - - CopyDescriptorSet& setDstArrayElement( uint32_t dstArrayElement_ ) + AndroidSurfaceCreateInfoKHR& setFlags( AndroidSurfaceCreateFlagsKHR flags_ ) { - dstArrayElement = dstArrayElement_; + flags = flags_; return *this; } - CopyDescriptorSet& setDescriptorCount( uint32_t descriptorCount_ ) + AndroidSurfaceCreateInfoKHR& setWindow( struct ANativeWindow* window_ ) { - descriptorCount = descriptorCount_; + window = window_; return *this; } - operator const VkCopyDescriptorSet&() const + operator const VkAndroidSurfaceCreateInfoKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( CopyDescriptorSet const& rhs ) const + bool operator==( AndroidSurfaceCreateInfoKHR const& rhs ) const { 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 ); + && ( flags == rhs.flags ) + && ( window == rhs.window ); } - bool operator!=( CopyDescriptorSet const& rhs ) const + bool operator!=( AndroidSurfaceCreateInfoKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eAndroidSurfaceCreateInfoKHR; public: - const void* pNext; - DescriptorSet srcSet; - uint32_t srcBinding; - uint32_t srcArrayElement; - DescriptorSet dstSet; - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; + const void* pNext = nullptr; + AndroidSurfaceCreateFlagsKHR flags; + struct ANativeWindow* window; }; - static_assert( sizeof( CopyDescriptorSet ) == sizeof( VkCopyDescriptorSet ), "struct and wrapper have different size!" ); + static_assert( sizeof( AndroidSurfaceCreateInfoKHR ) == sizeof( VkAndroidSurfaceCreateInfoKHR ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - struct BufferViewCreateInfo +#ifdef VK_USE_PLATFORM_MIR_KHR + struct MirSurfaceCreateInfoKHR { - BufferViewCreateInfo( BufferViewCreateFlags flags_ = BufferViewCreateFlags(), Buffer buffer_ = Buffer(), Format format_ = Format::eUndefined, DeviceSize offset_ = 0, DeviceSize range_ = 0 ) - : sType( StructureType::eBufferViewCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) - , buffer( buffer_ ) - , format( format_ ) - , offset( offset_ ) - , range( range_ ) - { - } - - BufferViewCreateInfo( VkBufferViewCreateInfo const & rhs ) + MirSurfaceCreateInfoKHR( MirSurfaceCreateFlagsKHR flags_ = MirSurfaceCreateFlagsKHR(), MirConnection* connection_ = nullptr, MirSurface* mirSurface_ = nullptr ) + : flags( flags_ ) + , connection( connection_ ) + , mirSurface( mirSurface_ ) { - memcpy( this, &rhs, sizeof( BufferViewCreateInfo ) ); } - BufferViewCreateInfo& operator=( VkBufferViewCreateInfo const & rhs ) - { - memcpy( this, &rhs, sizeof( BufferViewCreateInfo ) ); - return *this; - } - BufferViewCreateInfo& setPNext( const void* pNext_ ) + MirSurfaceCreateInfoKHR( VkMirSurfaceCreateInfoKHR const & rhs ) { - pNext = pNext_; - return *this; + memcpy( this, &rhs, sizeof( MirSurfaceCreateInfoKHR ) ); } - BufferViewCreateInfo& setFlags( BufferViewCreateFlags flags_ ) + MirSurfaceCreateInfoKHR& operator=( VkMirSurfaceCreateInfoKHR const & rhs ) { - flags = flags_; + memcpy( this, &rhs, sizeof( MirSurfaceCreateInfoKHR ) ); return *this; } - - BufferViewCreateInfo& setBuffer( Buffer buffer_ ) + MirSurfaceCreateInfoKHR& setPNext( const void* pNext_ ) { - buffer = buffer_; + pNext = pNext_; return *this; } - BufferViewCreateInfo& setFormat( Format format_ ) + MirSurfaceCreateInfoKHR& setFlags( MirSurfaceCreateFlagsKHR flags_ ) { - format = format_; + flags = flags_; return *this; } - BufferViewCreateInfo& setOffset( DeviceSize offset_ ) + MirSurfaceCreateInfoKHR& setConnection( MirConnection* connection_ ) { - offset = offset_; + connection = connection_; return *this; } - BufferViewCreateInfo& setRange( DeviceSize range_ ) + MirSurfaceCreateInfoKHR& setMirSurface( MirSurface* mirSurface_ ) { - range = range_; + mirSurface = mirSurface_; return *this; } - operator const VkBufferViewCreateInfo&() const + operator const VkMirSurfaceCreateInfoKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( BufferViewCreateInfo const& rhs ) const + bool operator==( MirSurfaceCreateInfoKHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) - && ( buffer == rhs.buffer ) - && ( format == rhs.format ) - && ( offset == rhs.offset ) - && ( range == rhs.range ); + && ( connection == rhs.connection ) + && ( mirSurface == rhs.mirSurface ); } - bool operator!=( BufferViewCreateInfo const& rhs ) const + bool operator!=( MirSurfaceCreateInfoKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eMirSurfaceCreateInfoKHR; public: - const void* pNext; - BufferViewCreateFlags flags; - Buffer buffer; - Format format; - DeviceSize offset; - DeviceSize range; + const void* pNext = nullptr; + MirSurfaceCreateFlagsKHR flags; + MirConnection* connection; + MirSurface* mirSurface; }; - static_assert( sizeof( BufferViewCreateInfo ) == sizeof( VkBufferViewCreateInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( MirSurfaceCreateInfoKHR ) == sizeof( VkMirSurfaceCreateInfoKHR ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_MIR_KHR*/ - struct ShaderModuleCreateInfo +#ifdef VK_USE_PLATFORM_VI_NN + struct ViSurfaceCreateInfoNN { - ShaderModuleCreateInfo( ShaderModuleCreateFlags flags_ = ShaderModuleCreateFlags(), size_t codeSize_ = 0, const uint32_t* pCode_ = nullptr ) - : sType( StructureType::eShaderModuleCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) - , codeSize( codeSize_ ) - , pCode( pCode_ ) + ViSurfaceCreateInfoNN( ViSurfaceCreateFlagsNN flags_ = ViSurfaceCreateFlagsNN(), void* window_ = nullptr ) + : flags( flags_ ) + , window( window_ ) { } - ShaderModuleCreateInfo( VkShaderModuleCreateInfo const & rhs ) + ViSurfaceCreateInfoNN( VkViSurfaceCreateInfoNN const & rhs ) { - memcpy( this, &rhs, sizeof( ShaderModuleCreateInfo ) ); + memcpy( this, &rhs, sizeof( ViSurfaceCreateInfoNN ) ); } - ShaderModuleCreateInfo& operator=( VkShaderModuleCreateInfo const & rhs ) + ViSurfaceCreateInfoNN& operator=( VkViSurfaceCreateInfoNN const & rhs ) { - memcpy( this, &rhs, sizeof( ShaderModuleCreateInfo ) ); + memcpy( this, &rhs, sizeof( ViSurfaceCreateInfoNN ) ); return *this; } - ShaderModuleCreateInfo& setPNext( const void* pNext_ ) + ViSurfaceCreateInfoNN& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - ShaderModuleCreateInfo& setFlags( ShaderModuleCreateFlags flags_ ) + ViSurfaceCreateInfoNN& setFlags( ViSurfaceCreateFlagsNN flags_ ) { flags = flags_; return *this; } - ShaderModuleCreateInfo& setCodeSize( size_t codeSize_ ) - { - codeSize = codeSize_; - return *this; - } - - ShaderModuleCreateInfo& setPCode( const uint32_t* pCode_ ) + ViSurfaceCreateInfoNN& setWindow( void* window_ ) { - pCode = pCode_; + window = window_; return *this; } - operator const VkShaderModuleCreateInfo&() const + operator const VkViSurfaceCreateInfoNN&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ShaderModuleCreateInfo const& rhs ) const + bool operator==( ViSurfaceCreateInfoNN const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) - && ( codeSize == rhs.codeSize ) - && ( pCode == rhs.pCode ); + && ( window == rhs.window ); } - bool operator!=( ShaderModuleCreateInfo const& rhs ) const + bool operator!=( ViSurfaceCreateInfoNN const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eViSurfaceCreateInfoNN; public: - const void* pNext; - ShaderModuleCreateFlags flags; - size_t codeSize; - const uint32_t* pCode; + const void* pNext = nullptr; + ViSurfaceCreateFlagsNN flags; + void* window; }; - static_assert( sizeof( ShaderModuleCreateInfo ) == sizeof( VkShaderModuleCreateInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( ViSurfaceCreateInfoNN ) == sizeof( VkViSurfaceCreateInfoNN ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_VI_NN*/ - struct DescriptorSetAllocateInfo +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + struct WaylandSurfaceCreateInfoKHR { - DescriptorSetAllocateInfo( DescriptorPool descriptorPool_ = DescriptorPool(), uint32_t descriptorSetCount_ = 0, const DescriptorSetLayout* pSetLayouts_ = nullptr ) - : sType( StructureType::eDescriptorSetAllocateInfo ) - , pNext( nullptr ) - , descriptorPool( descriptorPool_ ) - , descriptorSetCount( descriptorSetCount_ ) - , pSetLayouts( pSetLayouts_ ) + WaylandSurfaceCreateInfoKHR( WaylandSurfaceCreateFlagsKHR flags_ = WaylandSurfaceCreateFlagsKHR(), struct wl_display* display_ = nullptr, struct wl_surface* surface_ = nullptr ) + : flags( flags_ ) + , display( display_ ) + , surface( surface_ ) { } - DescriptorSetAllocateInfo( VkDescriptorSetAllocateInfo const & rhs ) + WaylandSurfaceCreateInfoKHR( VkWaylandSurfaceCreateInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( DescriptorSetAllocateInfo ) ); + memcpy( this, &rhs, sizeof( WaylandSurfaceCreateInfoKHR ) ); } - DescriptorSetAllocateInfo& operator=( VkDescriptorSetAllocateInfo const & rhs ) + WaylandSurfaceCreateInfoKHR& operator=( VkWaylandSurfaceCreateInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( DescriptorSetAllocateInfo ) ); + memcpy( this, &rhs, sizeof( WaylandSurfaceCreateInfoKHR ) ); return *this; } - DescriptorSetAllocateInfo& setPNext( const void* pNext_ ) + WaylandSurfaceCreateInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - DescriptorSetAllocateInfo& setDescriptorPool( DescriptorPool descriptorPool_ ) + WaylandSurfaceCreateInfoKHR& setFlags( WaylandSurfaceCreateFlagsKHR flags_ ) { - descriptorPool = descriptorPool_; + flags = flags_; return *this; } - DescriptorSetAllocateInfo& setDescriptorSetCount( uint32_t descriptorSetCount_ ) + WaylandSurfaceCreateInfoKHR& setDisplay( struct wl_display* display_ ) { - descriptorSetCount = descriptorSetCount_; + display = display_; return *this; } - DescriptorSetAllocateInfo& setPSetLayouts( const DescriptorSetLayout* pSetLayouts_ ) + WaylandSurfaceCreateInfoKHR& setSurface( struct wl_surface* surface_ ) { - pSetLayouts = pSetLayouts_; + surface = surface_; return *this; } - operator const VkDescriptorSetAllocateInfo&() const + operator const VkWaylandSurfaceCreateInfoKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DescriptorSetAllocateInfo const& rhs ) const + bool operator==( WaylandSurfaceCreateInfoKHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( descriptorPool == rhs.descriptorPool ) - && ( descriptorSetCount == rhs.descriptorSetCount ) - && ( pSetLayouts == rhs.pSetLayouts ); + && ( flags == rhs.flags ) + && ( display == rhs.display ) + && ( surface == rhs.surface ); } - bool operator!=( DescriptorSetAllocateInfo const& rhs ) const + bool operator!=( WaylandSurfaceCreateInfoKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eWaylandSurfaceCreateInfoKHR; public: - const void* pNext; - DescriptorPool descriptorPool; - uint32_t descriptorSetCount; - const DescriptorSetLayout* pSetLayouts; + const void* pNext = nullptr; + WaylandSurfaceCreateFlagsKHR flags; + struct wl_display* display; + struct wl_surface* surface; }; - static_assert( sizeof( DescriptorSetAllocateInfo ) == sizeof( VkDescriptorSetAllocateInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( WaylandSurfaceCreateInfoKHR ) == sizeof( VkWaylandSurfaceCreateInfoKHR ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - struct PipelineVertexInputStateCreateInfo +#ifdef VK_USE_PLATFORM_WIN32_KHR + struct Win32SurfaceCreateInfoKHR { - PipelineVertexInputStateCreateInfo( PipelineVertexInputStateCreateFlags flags_ = PipelineVertexInputStateCreateFlags(), uint32_t vertexBindingDescriptionCount_ = 0, const VertexInputBindingDescription* pVertexBindingDescriptions_ = nullptr, uint32_t vertexAttributeDescriptionCount_ = 0, const VertexInputAttributeDescription* pVertexAttributeDescriptions_ = nullptr ) - : sType( StructureType::ePipelineVertexInputStateCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) - , vertexBindingDescriptionCount( vertexBindingDescriptionCount_ ) - , pVertexBindingDescriptions( pVertexBindingDescriptions_ ) - , vertexAttributeDescriptionCount( vertexAttributeDescriptionCount_ ) - , pVertexAttributeDescriptions( pVertexAttributeDescriptions_ ) + Win32SurfaceCreateInfoKHR( Win32SurfaceCreateFlagsKHR flags_ = Win32SurfaceCreateFlagsKHR(), HINSTANCE hinstance_ = 0, HWND hwnd_ = 0 ) + : flags( flags_ ) + , hinstance( hinstance_ ) + , hwnd( hwnd_ ) { } - PipelineVertexInputStateCreateInfo( VkPipelineVertexInputStateCreateInfo const & rhs ) + Win32SurfaceCreateInfoKHR( VkWin32SurfaceCreateInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineVertexInputStateCreateInfo ) ); + memcpy( this, &rhs, sizeof( Win32SurfaceCreateInfoKHR ) ); } - PipelineVertexInputStateCreateInfo& operator=( VkPipelineVertexInputStateCreateInfo const & rhs ) + Win32SurfaceCreateInfoKHR& operator=( VkWin32SurfaceCreateInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineVertexInputStateCreateInfo ) ); + memcpy( this, &rhs, sizeof( Win32SurfaceCreateInfoKHR ) ); return *this; } - PipelineVertexInputStateCreateInfo& setPNext( const void* pNext_ ) + Win32SurfaceCreateInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PipelineVertexInputStateCreateInfo& setFlags( PipelineVertexInputStateCreateFlags flags_ ) + Win32SurfaceCreateInfoKHR& setFlags( Win32SurfaceCreateFlagsKHR flags_ ) { flags = flags_; return *this; } - PipelineVertexInputStateCreateInfo& setVertexBindingDescriptionCount( uint32_t vertexBindingDescriptionCount_ ) - { - vertexBindingDescriptionCount = vertexBindingDescriptionCount_; - return *this; - } - - PipelineVertexInputStateCreateInfo& setPVertexBindingDescriptions( const VertexInputBindingDescription* pVertexBindingDescriptions_ ) - { - pVertexBindingDescriptions = pVertexBindingDescriptions_; - return *this; - } - - PipelineVertexInputStateCreateInfo& setVertexAttributeDescriptionCount( uint32_t vertexAttributeDescriptionCount_ ) + Win32SurfaceCreateInfoKHR& setHinstance( HINSTANCE hinstance_ ) { - vertexAttributeDescriptionCount = vertexAttributeDescriptionCount_; + hinstance = hinstance_; return *this; } - PipelineVertexInputStateCreateInfo& setPVertexAttributeDescriptions( const VertexInputAttributeDescription* pVertexAttributeDescriptions_ ) + Win32SurfaceCreateInfoKHR& setHwnd( HWND hwnd_ ) { - pVertexAttributeDescriptions = pVertexAttributeDescriptions_; + hwnd = hwnd_; return *this; } - operator const VkPipelineVertexInputStateCreateInfo&() const + operator const VkWin32SurfaceCreateInfoKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PipelineVertexInputStateCreateInfo const& rhs ) const + bool operator==( Win32SurfaceCreateInfoKHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) - && ( vertexBindingDescriptionCount == rhs.vertexBindingDescriptionCount ) - && ( pVertexBindingDescriptions == rhs.pVertexBindingDescriptions ) - && ( vertexAttributeDescriptionCount == rhs.vertexAttributeDescriptionCount ) - && ( pVertexAttributeDescriptions == rhs.pVertexAttributeDescriptions ); + && ( hinstance == rhs.hinstance ) + && ( hwnd == rhs.hwnd ); } - bool operator!=( PipelineVertexInputStateCreateInfo const& rhs ) const + bool operator!=( Win32SurfaceCreateInfoKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eWin32SurfaceCreateInfoKHR; public: - const void* pNext; - PipelineVertexInputStateCreateFlags flags; - uint32_t vertexBindingDescriptionCount; - const VertexInputBindingDescription* pVertexBindingDescriptions; - uint32_t vertexAttributeDescriptionCount; - const VertexInputAttributeDescription* pVertexAttributeDescriptions; + const void* pNext = nullptr; + Win32SurfaceCreateFlagsKHR flags; + HINSTANCE hinstance; + HWND hwnd; }; - static_assert( sizeof( PipelineVertexInputStateCreateInfo ) == sizeof( VkPipelineVertexInputStateCreateInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( Win32SurfaceCreateInfoKHR ) == sizeof( VkWin32SurfaceCreateInfoKHR ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - struct PipelineInputAssemblyStateCreateInfo +#ifdef VK_USE_PLATFORM_XLIB_KHR + struct XlibSurfaceCreateInfoKHR { - PipelineInputAssemblyStateCreateInfo( PipelineInputAssemblyStateCreateFlags flags_ = PipelineInputAssemblyStateCreateFlags(), PrimitiveTopology topology_ = PrimitiveTopology::ePointList, Bool32 primitiveRestartEnable_ = 0 ) - : sType( StructureType::ePipelineInputAssemblyStateCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) - , topology( topology_ ) - , primitiveRestartEnable( primitiveRestartEnable_ ) + XlibSurfaceCreateInfoKHR( XlibSurfaceCreateFlagsKHR flags_ = XlibSurfaceCreateFlagsKHR(), Display* dpy_ = nullptr, Window window_ = 0 ) + : flags( flags_ ) + , dpy( dpy_ ) + , window( window_ ) { } - PipelineInputAssemblyStateCreateInfo( VkPipelineInputAssemblyStateCreateInfo const & rhs ) + XlibSurfaceCreateInfoKHR( VkXlibSurfaceCreateInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineInputAssemblyStateCreateInfo ) ); + memcpy( this, &rhs, sizeof( XlibSurfaceCreateInfoKHR ) ); } - PipelineInputAssemblyStateCreateInfo& operator=( VkPipelineInputAssemblyStateCreateInfo const & rhs ) + XlibSurfaceCreateInfoKHR& operator=( VkXlibSurfaceCreateInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineInputAssemblyStateCreateInfo ) ); + memcpy( this, &rhs, sizeof( XlibSurfaceCreateInfoKHR ) ); return *this; } - PipelineInputAssemblyStateCreateInfo& setPNext( const void* pNext_ ) + XlibSurfaceCreateInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PipelineInputAssemblyStateCreateInfo& setFlags( PipelineInputAssemblyStateCreateFlags flags_ ) + XlibSurfaceCreateInfoKHR& setFlags( XlibSurfaceCreateFlagsKHR flags_ ) { flags = flags_; return *this; } - PipelineInputAssemblyStateCreateInfo& setTopology( PrimitiveTopology topology_ ) + XlibSurfaceCreateInfoKHR& setDpy( Display* dpy_ ) { - topology = topology_; + dpy = dpy_; return *this; } - PipelineInputAssemblyStateCreateInfo& setPrimitiveRestartEnable( Bool32 primitiveRestartEnable_ ) + XlibSurfaceCreateInfoKHR& setWindow( Window window_ ) { - primitiveRestartEnable = primitiveRestartEnable_; + window = window_; return *this; } - operator const VkPipelineInputAssemblyStateCreateInfo&() const + operator const VkXlibSurfaceCreateInfoKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PipelineInputAssemblyStateCreateInfo const& rhs ) const + bool operator==( XlibSurfaceCreateInfoKHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) - && ( topology == rhs.topology ) - && ( primitiveRestartEnable == rhs.primitiveRestartEnable ); + && ( dpy == rhs.dpy ) + && ( window == rhs.window ); } - bool operator!=( PipelineInputAssemblyStateCreateInfo const& rhs ) const + bool operator!=( XlibSurfaceCreateInfoKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eXlibSurfaceCreateInfoKHR; public: - const void* pNext; - PipelineInputAssemblyStateCreateFlags flags; - PrimitiveTopology topology; - Bool32 primitiveRestartEnable; + const void* pNext = nullptr; + XlibSurfaceCreateFlagsKHR flags; + Display* dpy; + Window window; }; - static_assert( sizeof( PipelineInputAssemblyStateCreateInfo ) == sizeof( VkPipelineInputAssemblyStateCreateInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( XlibSurfaceCreateInfoKHR ) == sizeof( VkXlibSurfaceCreateInfoKHR ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_XLIB_KHR*/ - struct PipelineTessellationStateCreateInfo +#ifdef VK_USE_PLATFORM_XCB_KHR + struct XcbSurfaceCreateInfoKHR { - PipelineTessellationStateCreateInfo( PipelineTessellationStateCreateFlags flags_ = PipelineTessellationStateCreateFlags(), uint32_t patchControlPoints_ = 0 ) - : sType( StructureType::ePipelineTessellationStateCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) - , patchControlPoints( patchControlPoints_ ) + XcbSurfaceCreateInfoKHR( XcbSurfaceCreateFlagsKHR flags_ = XcbSurfaceCreateFlagsKHR(), xcb_connection_t* connection_ = nullptr, xcb_window_t window_ = 0 ) + : flags( flags_ ) + , connection( connection_ ) + , window( window_ ) { } - PipelineTessellationStateCreateInfo( VkPipelineTessellationStateCreateInfo const & rhs ) + XcbSurfaceCreateInfoKHR( VkXcbSurfaceCreateInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineTessellationStateCreateInfo ) ); + memcpy( this, &rhs, sizeof( XcbSurfaceCreateInfoKHR ) ); } - PipelineTessellationStateCreateInfo& operator=( VkPipelineTessellationStateCreateInfo const & rhs ) + XcbSurfaceCreateInfoKHR& operator=( VkXcbSurfaceCreateInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineTessellationStateCreateInfo ) ); + memcpy( this, &rhs, sizeof( XcbSurfaceCreateInfoKHR ) ); return *this; } - PipelineTessellationStateCreateInfo& setPNext( const void* pNext_ ) + XcbSurfaceCreateInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PipelineTessellationStateCreateInfo& setFlags( PipelineTessellationStateCreateFlags flags_ ) + XcbSurfaceCreateInfoKHR& setFlags( XcbSurfaceCreateFlagsKHR flags_ ) { flags = flags_; return *this; } - PipelineTessellationStateCreateInfo& setPatchControlPoints( uint32_t patchControlPoints_ ) + XcbSurfaceCreateInfoKHR& setConnection( xcb_connection_t* connection_ ) { - patchControlPoints = patchControlPoints_; + connection = connection_; return *this; } - operator const VkPipelineTessellationStateCreateInfo&() const + XcbSurfaceCreateInfoKHR& setWindow( xcb_window_t window_ ) { - return *reinterpret_cast(this); + window = window_; + return *this; } - bool operator==( PipelineTessellationStateCreateInfo const& rhs ) const + operator const VkXcbSurfaceCreateInfoKHR&() const + { + return *reinterpret_cast(this); + } + + bool operator==( XcbSurfaceCreateInfoKHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) - && ( patchControlPoints == rhs.patchControlPoints ); + && ( connection == rhs.connection ) + && ( window == rhs.window ); } - bool operator!=( PipelineTessellationStateCreateInfo const& rhs ) const + bool operator!=( XcbSurfaceCreateInfoKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eXcbSurfaceCreateInfoKHR; public: - const void* pNext; - PipelineTessellationStateCreateFlags flags; - uint32_t patchControlPoints; + const void* pNext = nullptr; + XcbSurfaceCreateFlagsKHR flags; + xcb_connection_t* connection; + xcb_window_t window; }; - static_assert( sizeof( PipelineTessellationStateCreateInfo ) == sizeof( VkPipelineTessellationStateCreateInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( XcbSurfaceCreateInfoKHR ) == sizeof( VkXcbSurfaceCreateInfoKHR ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_XCB_KHR*/ - struct PipelineViewportStateCreateInfo + struct DebugMarkerMarkerInfoEXT { - PipelineViewportStateCreateInfo( PipelineViewportStateCreateFlags flags_ = PipelineViewportStateCreateFlags(), uint32_t viewportCount_ = 0, const Viewport* pViewports_ = nullptr, uint32_t scissorCount_ = 0, const Rect2D* pScissors_ = nullptr ) - : sType( StructureType::ePipelineViewportStateCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) - , viewportCount( viewportCount_ ) - , pViewports( pViewports_ ) - , scissorCount( scissorCount_ ) - , pScissors( pScissors_ ) + DebugMarkerMarkerInfoEXT( const char* pMarkerName_ = nullptr, std::array const& color_ = { { 0, 0, 0, 0 } } ) + : pMarkerName( pMarkerName_ ) { + memcpy( &color, color_.data(), 4 * sizeof( float ) ); } - PipelineViewportStateCreateInfo( VkPipelineViewportStateCreateInfo const & rhs ) + DebugMarkerMarkerInfoEXT( VkDebugMarkerMarkerInfoEXT const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineViewportStateCreateInfo ) ); + memcpy( this, &rhs, sizeof( DebugMarkerMarkerInfoEXT ) ); } - PipelineViewportStateCreateInfo& operator=( VkPipelineViewportStateCreateInfo const & rhs ) + DebugMarkerMarkerInfoEXT& operator=( VkDebugMarkerMarkerInfoEXT const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineViewportStateCreateInfo ) ); + memcpy( this, &rhs, sizeof( DebugMarkerMarkerInfoEXT ) ); return *this; } - PipelineViewportStateCreateInfo& setPNext( const void* pNext_ ) + DebugMarkerMarkerInfoEXT& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PipelineViewportStateCreateInfo& setFlags( PipelineViewportStateCreateFlags flags_ ) - { - flags = flags_; - return *this; - } - - PipelineViewportStateCreateInfo& setViewportCount( uint32_t viewportCount_ ) - { - viewportCount = viewportCount_; - return *this; - } - - PipelineViewportStateCreateInfo& setPViewports( const Viewport* pViewports_ ) - { - pViewports = pViewports_; - return *this; - } - - PipelineViewportStateCreateInfo& setScissorCount( uint32_t scissorCount_ ) + DebugMarkerMarkerInfoEXT& setPMarkerName( const char* pMarkerName_ ) { - scissorCount = scissorCount_; + pMarkerName = pMarkerName_; return *this; } - PipelineViewportStateCreateInfo& setPScissors( const Rect2D* pScissors_ ) + DebugMarkerMarkerInfoEXT& setColor( std::array color_ ) { - pScissors = pScissors_; + memcpy( &color, color_.data(), 4 * sizeof( float ) ); return *this; } - operator const VkPipelineViewportStateCreateInfo&() const + operator const VkDebugMarkerMarkerInfoEXT&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PipelineViewportStateCreateInfo const& rhs ) const + bool operator==( DebugMarkerMarkerInfoEXT const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( viewportCount == rhs.viewportCount ) - && ( pViewports == rhs.pViewports ) - && ( scissorCount == rhs.scissorCount ) - && ( pScissors == rhs.pScissors ); + && ( pMarkerName == rhs.pMarkerName ) + && ( memcmp( color, rhs.color, 4 * sizeof( float ) ) == 0 ); } - bool operator!=( PipelineViewportStateCreateInfo const& rhs ) const + bool operator!=( DebugMarkerMarkerInfoEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDebugMarkerMarkerInfoEXT; public: - const void* pNext; - PipelineViewportStateCreateFlags flags; - uint32_t viewportCount; - const Viewport* pViewports; - uint32_t scissorCount; - const Rect2D* pScissors; + const void* pNext = nullptr; + const char* pMarkerName; + float color[4]; }; - static_assert( sizeof( PipelineViewportStateCreateInfo ) == sizeof( VkPipelineViewportStateCreateInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( DebugMarkerMarkerInfoEXT ) == sizeof( VkDebugMarkerMarkerInfoEXT ), "struct and wrapper have different size!" ); - struct PipelineRasterizationStateCreateInfo + struct DedicatedAllocationImageCreateInfoNV { - PipelineRasterizationStateCreateInfo( PipelineRasterizationStateCreateFlags flags_ = PipelineRasterizationStateCreateFlags(), Bool32 depthClampEnable_ = 0, Bool32 rasterizerDiscardEnable_ = 0, PolygonMode polygonMode_ = PolygonMode::eFill, CullModeFlags cullMode_ = CullModeFlags(), FrontFace frontFace_ = FrontFace::eCounterClockwise, Bool32 depthBiasEnable_ = 0, float depthBiasConstantFactor_ = 0, float depthBiasClamp_ = 0, float depthBiasSlopeFactor_ = 0, float lineWidth_ = 0 ) - : sType( StructureType::ePipelineRasterizationStateCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) - , depthClampEnable( depthClampEnable_ ) - , rasterizerDiscardEnable( rasterizerDiscardEnable_ ) - , polygonMode( polygonMode_ ) - , cullMode( cullMode_ ) - , frontFace( frontFace_ ) - , depthBiasEnable( depthBiasEnable_ ) - , depthBiasConstantFactor( depthBiasConstantFactor_ ) - , depthBiasClamp( depthBiasClamp_ ) - , depthBiasSlopeFactor( depthBiasSlopeFactor_ ) - , lineWidth( lineWidth_ ) + DedicatedAllocationImageCreateInfoNV( Bool32 dedicatedAllocation_ = 0 ) + : dedicatedAllocation( dedicatedAllocation_ ) { } - PipelineRasterizationStateCreateInfo( VkPipelineRasterizationStateCreateInfo const & rhs ) + DedicatedAllocationImageCreateInfoNV( VkDedicatedAllocationImageCreateInfoNV const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineRasterizationStateCreateInfo ) ); + memcpy( this, &rhs, sizeof( DedicatedAllocationImageCreateInfoNV ) ); } - PipelineRasterizationStateCreateInfo& operator=( VkPipelineRasterizationStateCreateInfo const & rhs ) + DedicatedAllocationImageCreateInfoNV& operator=( VkDedicatedAllocationImageCreateInfoNV const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineRasterizationStateCreateInfo ) ); + memcpy( this, &rhs, sizeof( DedicatedAllocationImageCreateInfoNV ) ); return *this; } - PipelineRasterizationStateCreateInfo& setPNext( const void* pNext_ ) + DedicatedAllocationImageCreateInfoNV& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PipelineRasterizationStateCreateInfo& setFlags( PipelineRasterizationStateCreateFlags flags_ ) + DedicatedAllocationImageCreateInfoNV& setDedicatedAllocation( Bool32 dedicatedAllocation_ ) { - flags = flags_; + dedicatedAllocation = dedicatedAllocation_; return *this; } - PipelineRasterizationStateCreateInfo& setDepthClampEnable( Bool32 depthClampEnable_ ) + operator const VkDedicatedAllocationImageCreateInfoNV&() const { - depthClampEnable = depthClampEnable_; - return *this; + return *reinterpret_cast(this); } - PipelineRasterizationStateCreateInfo& setRasterizerDiscardEnable( Bool32 rasterizerDiscardEnable_ ) + bool operator==( DedicatedAllocationImageCreateInfoNV const& rhs ) const { - rasterizerDiscardEnable = rasterizerDiscardEnable_; - return *this; + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( dedicatedAllocation == rhs.dedicatedAllocation ); } - PipelineRasterizationStateCreateInfo& setPolygonMode( PolygonMode polygonMode_ ) + bool operator!=( DedicatedAllocationImageCreateInfoNV const& rhs ) const { - polygonMode = polygonMode_; - return *this; + return !operator==( rhs ); } - PipelineRasterizationStateCreateInfo& setCullMode( CullModeFlags cullMode_ ) - { - cullMode = cullMode_; - return *this; - } + private: + StructureType sType = StructureType::eDedicatedAllocationImageCreateInfoNV; - PipelineRasterizationStateCreateInfo& setFrontFace( FrontFace frontFace_ ) - { - frontFace = frontFace_; - return *this; - } + public: + const void* pNext = nullptr; + Bool32 dedicatedAllocation; + }; + static_assert( sizeof( DedicatedAllocationImageCreateInfoNV ) == sizeof( VkDedicatedAllocationImageCreateInfoNV ), "struct and wrapper have different size!" ); - PipelineRasterizationStateCreateInfo& setDepthBiasEnable( Bool32 depthBiasEnable_ ) + struct DedicatedAllocationBufferCreateInfoNV + { + DedicatedAllocationBufferCreateInfoNV( Bool32 dedicatedAllocation_ = 0 ) + : dedicatedAllocation( dedicatedAllocation_ ) { - depthBiasEnable = depthBiasEnable_; - return *this; } - PipelineRasterizationStateCreateInfo& setDepthBiasConstantFactor( float depthBiasConstantFactor_ ) + DedicatedAllocationBufferCreateInfoNV( VkDedicatedAllocationBufferCreateInfoNV const & rhs ) { - depthBiasConstantFactor = depthBiasConstantFactor_; - return *this; + memcpy( this, &rhs, sizeof( DedicatedAllocationBufferCreateInfoNV ) ); } - PipelineRasterizationStateCreateInfo& setDepthBiasClamp( float depthBiasClamp_ ) + DedicatedAllocationBufferCreateInfoNV& operator=( VkDedicatedAllocationBufferCreateInfoNV const & rhs ) { - depthBiasClamp = depthBiasClamp_; + memcpy( this, &rhs, sizeof( DedicatedAllocationBufferCreateInfoNV ) ); return *this; } - - PipelineRasterizationStateCreateInfo& setDepthBiasSlopeFactor( float depthBiasSlopeFactor_ ) + DedicatedAllocationBufferCreateInfoNV& setPNext( const void* pNext_ ) { - depthBiasSlopeFactor = depthBiasSlopeFactor_; + pNext = pNext_; return *this; } - PipelineRasterizationStateCreateInfo& setLineWidth( float lineWidth_ ) + DedicatedAllocationBufferCreateInfoNV& setDedicatedAllocation( Bool32 dedicatedAllocation_ ) { - lineWidth = lineWidth_; + dedicatedAllocation = dedicatedAllocation_; return *this; } - operator const VkPipelineRasterizationStateCreateInfo&() const + operator const VkDedicatedAllocationBufferCreateInfoNV&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PipelineRasterizationStateCreateInfo const& rhs ) const + bool operator==( DedicatedAllocationBufferCreateInfoNV const& rhs ) const { 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 ); + && ( dedicatedAllocation == rhs.dedicatedAllocation ); } - bool operator!=( PipelineRasterizationStateCreateInfo const& rhs ) const + bool operator!=( DedicatedAllocationBufferCreateInfoNV const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDedicatedAllocationBufferCreateInfoNV; public: - const void* pNext; - PipelineRasterizationStateCreateFlags flags; - Bool32 depthClampEnable; - Bool32 rasterizerDiscardEnable; - PolygonMode polygonMode; - CullModeFlags cullMode; - FrontFace frontFace; - Bool32 depthBiasEnable; - float depthBiasConstantFactor; - float depthBiasClamp; - float depthBiasSlopeFactor; - float lineWidth; + const void* pNext = nullptr; + Bool32 dedicatedAllocation; }; - static_assert( sizeof( PipelineRasterizationStateCreateInfo ) == sizeof( VkPipelineRasterizationStateCreateInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( DedicatedAllocationBufferCreateInfoNV ) == sizeof( VkDedicatedAllocationBufferCreateInfoNV ), "struct and wrapper have different size!" ); - struct PipelineDepthStencilStateCreateInfo + struct DedicatedAllocationMemoryAllocateInfoNV { - PipelineDepthStencilStateCreateInfo( PipelineDepthStencilStateCreateFlags flags_ = PipelineDepthStencilStateCreateFlags(), Bool32 depthTestEnable_ = 0, Bool32 depthWriteEnable_ = 0, CompareOp depthCompareOp_ = CompareOp::eNever, Bool32 depthBoundsTestEnable_ = 0, Bool32 stencilTestEnable_ = 0, StencilOpState front_ = StencilOpState(), StencilOpState back_ = StencilOpState(), float minDepthBounds_ = 0, float maxDepthBounds_ = 0 ) - : sType( StructureType::ePipelineDepthStencilStateCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) - , depthTestEnable( depthTestEnable_ ) - , depthWriteEnable( depthWriteEnable_ ) - , depthCompareOp( depthCompareOp_ ) - , depthBoundsTestEnable( depthBoundsTestEnable_ ) - , stencilTestEnable( stencilTestEnable_ ) - , front( front_ ) - , back( back_ ) - , minDepthBounds( minDepthBounds_ ) - , maxDepthBounds( maxDepthBounds_ ) + DedicatedAllocationMemoryAllocateInfoNV( Image image_ = Image(), Buffer buffer_ = Buffer() ) + : image( image_ ) + , buffer( buffer_ ) { } - PipelineDepthStencilStateCreateInfo( VkPipelineDepthStencilStateCreateInfo const & rhs ) + DedicatedAllocationMemoryAllocateInfoNV( VkDedicatedAllocationMemoryAllocateInfoNV const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineDepthStencilStateCreateInfo ) ); + memcpy( this, &rhs, sizeof( DedicatedAllocationMemoryAllocateInfoNV ) ); } - PipelineDepthStencilStateCreateInfo& operator=( VkPipelineDepthStencilStateCreateInfo const & rhs ) + DedicatedAllocationMemoryAllocateInfoNV& operator=( VkDedicatedAllocationMemoryAllocateInfoNV const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineDepthStencilStateCreateInfo ) ); + memcpy( this, &rhs, sizeof( DedicatedAllocationMemoryAllocateInfoNV ) ); return *this; } - PipelineDepthStencilStateCreateInfo& setPNext( const void* pNext_ ) + DedicatedAllocationMemoryAllocateInfoNV& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PipelineDepthStencilStateCreateInfo& setFlags( PipelineDepthStencilStateCreateFlags flags_ ) + DedicatedAllocationMemoryAllocateInfoNV& setImage( Image image_ ) { - flags = flags_; + image = image_; return *this; } - PipelineDepthStencilStateCreateInfo& setDepthTestEnable( Bool32 depthTestEnable_ ) + DedicatedAllocationMemoryAllocateInfoNV& setBuffer( Buffer buffer_ ) { - depthTestEnable = depthTestEnable_; + buffer = buffer_; return *this; } - PipelineDepthStencilStateCreateInfo& setDepthWriteEnable( Bool32 depthWriteEnable_ ) + operator const VkDedicatedAllocationMemoryAllocateInfoNV&() const { - depthWriteEnable = depthWriteEnable_; - return *this; + return *reinterpret_cast(this); } - PipelineDepthStencilStateCreateInfo& setDepthCompareOp( CompareOp depthCompareOp_ ) + bool operator==( DedicatedAllocationMemoryAllocateInfoNV const& rhs ) const { - depthCompareOp = depthCompareOp_; - return *this; + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( image == rhs.image ) + && ( buffer == rhs.buffer ); } - PipelineDepthStencilStateCreateInfo& setDepthBoundsTestEnable( Bool32 depthBoundsTestEnable_ ) + bool operator!=( DedicatedAllocationMemoryAllocateInfoNV const& rhs ) const { - depthBoundsTestEnable = depthBoundsTestEnable_; - return *this; + return !operator==( rhs ); } - PipelineDepthStencilStateCreateInfo& setStencilTestEnable( Bool32 stencilTestEnable_ ) + private: + StructureType sType = StructureType::eDedicatedAllocationMemoryAllocateInfoNV; + + public: + const void* pNext = nullptr; + Image image; + Buffer buffer; + }; + static_assert( sizeof( DedicatedAllocationMemoryAllocateInfoNV ) == sizeof( VkDedicatedAllocationMemoryAllocateInfoNV ), "struct and wrapper have different size!" ); + +#ifdef VK_USE_PLATFORM_WIN32_NV + struct ExportMemoryWin32HandleInfoNV + { + ExportMemoryWin32HandleInfoNV( const SECURITY_ATTRIBUTES* pAttributes_ = nullptr, DWORD dwAccess_ = 0 ) + : pAttributes( pAttributes_ ) + , dwAccess( dwAccess_ ) { - stencilTestEnable = stencilTestEnable_; - return *this; } - PipelineDepthStencilStateCreateInfo& setFront( StencilOpState front_ ) + ExportMemoryWin32HandleInfoNV( VkExportMemoryWin32HandleInfoNV const & rhs ) { - front = front_; - return *this; + memcpy( this, &rhs, sizeof( ExportMemoryWin32HandleInfoNV ) ); } - PipelineDepthStencilStateCreateInfo& setBack( StencilOpState back_ ) + ExportMemoryWin32HandleInfoNV& operator=( VkExportMemoryWin32HandleInfoNV const & rhs ) { - back = back_; + memcpy( this, &rhs, sizeof( ExportMemoryWin32HandleInfoNV ) ); + return *this; + } + ExportMemoryWin32HandleInfoNV& setPNext( const void* pNext_ ) + { + pNext = pNext_; return *this; } - PipelineDepthStencilStateCreateInfo& setMinDepthBounds( float minDepthBounds_ ) + ExportMemoryWin32HandleInfoNV& setPAttributes( const SECURITY_ATTRIBUTES* pAttributes_ ) { - minDepthBounds = minDepthBounds_; + pAttributes = pAttributes_; return *this; } - PipelineDepthStencilStateCreateInfo& setMaxDepthBounds( float maxDepthBounds_ ) + ExportMemoryWin32HandleInfoNV& setDwAccess( DWORD dwAccess_ ) { - maxDepthBounds = maxDepthBounds_; + dwAccess = dwAccess_; return *this; } - operator const VkPipelineDepthStencilStateCreateInfo&() const + operator const VkExportMemoryWin32HandleInfoNV&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PipelineDepthStencilStateCreateInfo const& rhs ) const + bool operator==( ExportMemoryWin32HandleInfoNV const& rhs ) const { 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 ); + && ( pAttributes == rhs.pAttributes ) + && ( dwAccess == rhs.dwAccess ); } - bool operator!=( PipelineDepthStencilStateCreateInfo const& rhs ) const + bool operator!=( ExportMemoryWin32HandleInfoNV const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eExportMemoryWin32HandleInfoNV; public: - const void* pNext; - PipelineDepthStencilStateCreateFlags flags; - Bool32 depthTestEnable; - Bool32 depthWriteEnable; - CompareOp depthCompareOp; - Bool32 depthBoundsTestEnable; - Bool32 stencilTestEnable; - StencilOpState front; - StencilOpState back; - float minDepthBounds; - float maxDepthBounds; + const void* pNext = nullptr; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; }; - static_assert( sizeof( PipelineDepthStencilStateCreateInfo ) == sizeof( VkPipelineDepthStencilStateCreateInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( ExportMemoryWin32HandleInfoNV ) == sizeof( VkExportMemoryWin32HandleInfoNV ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_NV*/ - struct PipelineCacheCreateInfo +#ifdef VK_USE_PLATFORM_WIN32_NV + struct Win32KeyedMutexAcquireReleaseInfoNV { - PipelineCacheCreateInfo( PipelineCacheCreateFlags flags_ = PipelineCacheCreateFlags(), size_t initialDataSize_ = 0, const void* pInitialData_ = nullptr ) - : sType( StructureType::ePipelineCacheCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) - , initialDataSize( initialDataSize_ ) - , pInitialData( pInitialData_ ) + Win32KeyedMutexAcquireReleaseInfoNV( uint32_t acquireCount_ = 0, const DeviceMemory* pAcquireSyncs_ = nullptr, const uint64_t* pAcquireKeys_ = nullptr, const uint32_t* pAcquireTimeoutMilliseconds_ = nullptr, uint32_t releaseCount_ = 0, const DeviceMemory* pReleaseSyncs_ = nullptr, const uint64_t* pReleaseKeys_ = nullptr ) + : acquireCount( acquireCount_ ) + , pAcquireSyncs( pAcquireSyncs_ ) + , pAcquireKeys( pAcquireKeys_ ) + , pAcquireTimeoutMilliseconds( pAcquireTimeoutMilliseconds_ ) + , releaseCount( releaseCount_ ) + , pReleaseSyncs( pReleaseSyncs_ ) + , pReleaseKeys( pReleaseKeys_ ) { } - PipelineCacheCreateInfo( VkPipelineCacheCreateInfo const & rhs ) + Win32KeyedMutexAcquireReleaseInfoNV( VkWin32KeyedMutexAcquireReleaseInfoNV const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineCacheCreateInfo ) ); + memcpy( this, &rhs, sizeof( Win32KeyedMutexAcquireReleaseInfoNV ) ); } - PipelineCacheCreateInfo& operator=( VkPipelineCacheCreateInfo const & rhs ) + Win32KeyedMutexAcquireReleaseInfoNV& operator=( VkWin32KeyedMutexAcquireReleaseInfoNV const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineCacheCreateInfo ) ); + memcpy( this, &rhs, sizeof( Win32KeyedMutexAcquireReleaseInfoNV ) ); return *this; } - PipelineCacheCreateInfo& setPNext( const void* pNext_ ) + Win32KeyedMutexAcquireReleaseInfoNV& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PipelineCacheCreateInfo& setFlags( PipelineCacheCreateFlags flags_ ) + Win32KeyedMutexAcquireReleaseInfoNV& setAcquireCount( uint32_t acquireCount_ ) { - flags = flags_; + acquireCount = acquireCount_; return *this; } - PipelineCacheCreateInfo& setInitialDataSize( size_t initialDataSize_ ) + Win32KeyedMutexAcquireReleaseInfoNV& setPAcquireSyncs( const DeviceMemory* pAcquireSyncs_ ) { - initialDataSize = initialDataSize_; + pAcquireSyncs = pAcquireSyncs_; return *this; } - PipelineCacheCreateInfo& setPInitialData( const void* pInitialData_ ) + Win32KeyedMutexAcquireReleaseInfoNV& setPAcquireKeys( const uint64_t* pAcquireKeys_ ) { - pInitialData = pInitialData_; + pAcquireKeys = pAcquireKeys_; return *this; } - operator const VkPipelineCacheCreateInfo&() const + Win32KeyedMutexAcquireReleaseInfoNV& setPAcquireTimeoutMilliseconds( const uint32_t* pAcquireTimeoutMilliseconds_ ) { - return *reinterpret_cast(this); + pAcquireTimeoutMilliseconds = pAcquireTimeoutMilliseconds_; + return *this; } - bool operator==( PipelineCacheCreateInfo const& rhs ) const + Win32KeyedMutexAcquireReleaseInfoNV& setReleaseCount( uint32_t releaseCount_ ) { - return ( sType == rhs.sType ) - && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( initialDataSize == rhs.initialDataSize ) - && ( pInitialData == rhs.pInitialData ); + releaseCount = releaseCount_; + return *this; } - bool operator!=( PipelineCacheCreateInfo const& rhs ) const + Win32KeyedMutexAcquireReleaseInfoNV& setPReleaseSyncs( const DeviceMemory* pReleaseSyncs_ ) { - return !operator==( rhs ); + pReleaseSyncs = pReleaseSyncs_; + return *this; } - private: - StructureType sType; - - public: - const void* pNext; - PipelineCacheCreateFlags flags; - size_t initialDataSize; - const void* pInitialData; - }; - static_assert( sizeof( PipelineCacheCreateInfo ) == sizeof( VkPipelineCacheCreateInfo ), "struct and wrapper have different size!" ); + Win32KeyedMutexAcquireReleaseInfoNV& setPReleaseKeys( const uint64_t* pReleaseKeys_ ) + { + pReleaseKeys = pReleaseKeys_; + return *this; + } - struct SamplerCreateInfo - { - SamplerCreateInfo( SamplerCreateFlags flags_ = SamplerCreateFlags(), Filter magFilter_ = Filter::eNearest, Filter minFilter_ = Filter::eNearest, SamplerMipmapMode mipmapMode_ = SamplerMipmapMode::eNearest, SamplerAddressMode addressModeU_ = SamplerAddressMode::eRepeat, SamplerAddressMode addressModeV_ = SamplerAddressMode::eRepeat, SamplerAddressMode addressModeW_ = SamplerAddressMode::eRepeat, float mipLodBias_ = 0, Bool32 anisotropyEnable_ = 0, float maxAnisotropy_ = 0, Bool32 compareEnable_ = 0, CompareOp compareOp_ = CompareOp::eNever, float minLod_ = 0, float maxLod_ = 0, BorderColor borderColor_ = BorderColor::eFloatTransparentBlack, Bool32 unnormalizedCoordinates_ = 0 ) - : sType( StructureType::eSamplerCreateInfo ) - , pNext( nullptr ) - , 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_ ) + operator const VkWin32KeyedMutexAcquireReleaseInfoNV&() const { + return *reinterpret_cast(this); } - SamplerCreateInfo( VkSamplerCreateInfo const & rhs ) + bool operator==( Win32KeyedMutexAcquireReleaseInfoNV const& rhs ) const { - memcpy( this, &rhs, sizeof( SamplerCreateInfo ) ); + 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 ); } - SamplerCreateInfo& operator=( VkSamplerCreateInfo const & rhs ) + bool operator!=( Win32KeyedMutexAcquireReleaseInfoNV const& rhs ) const { - memcpy( this, &rhs, sizeof( SamplerCreateInfo ) ); - return *this; + return !operator==( rhs ); } - SamplerCreateInfo& setPNext( const void* pNext_ ) + + private: + StructureType sType = StructureType::eWin32KeyedMutexAcquireReleaseInfoNV; + + public: + const void* pNext = nullptr; + uint32_t acquireCount; + const DeviceMemory* pAcquireSyncs; + const uint64_t* pAcquireKeys; + const uint32_t* pAcquireTimeoutMilliseconds; + uint32_t releaseCount; + const DeviceMemory* pReleaseSyncs; + const uint64_t* pReleaseKeys; + }; + static_assert( sizeof( Win32KeyedMutexAcquireReleaseInfoNV ) == sizeof( VkWin32KeyedMutexAcquireReleaseInfoNV ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_NV*/ + + struct DeviceGeneratedCommandsFeaturesNVX + { + DeviceGeneratedCommandsFeaturesNVX( Bool32 computeBindingPointSupport_ = 0 ) + : computeBindingPointSupport( computeBindingPointSupport_ ) { - pNext = pNext_; - return *this; } - SamplerCreateInfo& setFlags( SamplerCreateFlags flags_ ) + DeviceGeneratedCommandsFeaturesNVX( VkDeviceGeneratedCommandsFeaturesNVX const & rhs ) { - flags = flags_; - return *this; + memcpy( this, &rhs, sizeof( DeviceGeneratedCommandsFeaturesNVX ) ); } - SamplerCreateInfo& setMagFilter( Filter magFilter_ ) + DeviceGeneratedCommandsFeaturesNVX& operator=( VkDeviceGeneratedCommandsFeaturesNVX const & rhs ) { - magFilter = magFilter_; + memcpy( this, &rhs, sizeof( DeviceGeneratedCommandsFeaturesNVX ) ); return *this; } - - SamplerCreateInfo& setMinFilter( Filter minFilter_ ) + DeviceGeneratedCommandsFeaturesNVX& setPNext( const void* pNext_ ) { - minFilter = minFilter_; + pNext = pNext_; return *this; } - SamplerCreateInfo& setMipmapMode( SamplerMipmapMode mipmapMode_ ) + DeviceGeneratedCommandsFeaturesNVX& setComputeBindingPointSupport( Bool32 computeBindingPointSupport_ ) { - mipmapMode = mipmapMode_; + computeBindingPointSupport = computeBindingPointSupport_; return *this; } - SamplerCreateInfo& setAddressModeU( SamplerAddressMode addressModeU_ ) + operator const VkDeviceGeneratedCommandsFeaturesNVX&() const { - addressModeU = addressModeU_; - return *this; + return *reinterpret_cast(this); } - SamplerCreateInfo& setAddressModeV( SamplerAddressMode addressModeV_ ) + bool operator==( DeviceGeneratedCommandsFeaturesNVX const& rhs ) const { - addressModeV = addressModeV_; - return *this; + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( computeBindingPointSupport == rhs.computeBindingPointSupport ); } - SamplerCreateInfo& setAddressModeW( SamplerAddressMode addressModeW_ ) + bool operator!=( DeviceGeneratedCommandsFeaturesNVX const& rhs ) const { - addressModeW = addressModeW_; - return *this; + return !operator==( rhs ); } - SamplerCreateInfo& setMipLodBias( float mipLodBias_ ) + private: + StructureType sType = StructureType::eDeviceGeneratedCommandsFeaturesNVX; + + public: + const void* pNext = nullptr; + Bool32 computeBindingPointSupport; + }; + static_assert( sizeof( DeviceGeneratedCommandsFeaturesNVX ) == sizeof( VkDeviceGeneratedCommandsFeaturesNVX ), "struct and wrapper have different size!" ); + + struct DeviceGeneratedCommandsLimitsNVX + { + DeviceGeneratedCommandsLimitsNVX( uint32_t maxIndirectCommandsLayoutTokenCount_ = 0, uint32_t maxObjectEntryCounts_ = 0, uint32_t minSequenceCountBufferOffsetAlignment_ = 0, uint32_t minSequenceIndexBufferOffsetAlignment_ = 0, uint32_t minCommandsTokenBufferOffsetAlignment_ = 0 ) + : maxIndirectCommandsLayoutTokenCount( maxIndirectCommandsLayoutTokenCount_ ) + , maxObjectEntryCounts( maxObjectEntryCounts_ ) + , minSequenceCountBufferOffsetAlignment( minSequenceCountBufferOffsetAlignment_ ) + , minSequenceIndexBufferOffsetAlignment( minSequenceIndexBufferOffsetAlignment_ ) + , minCommandsTokenBufferOffsetAlignment( minCommandsTokenBufferOffsetAlignment_ ) { - mipLodBias = mipLodBias_; - return *this; } - SamplerCreateInfo& setAnisotropyEnable( Bool32 anisotropyEnable_ ) + DeviceGeneratedCommandsLimitsNVX( VkDeviceGeneratedCommandsLimitsNVX const & rhs ) { - anisotropyEnable = anisotropyEnable_; - return *this; + memcpy( this, &rhs, sizeof( DeviceGeneratedCommandsLimitsNVX ) ); } - SamplerCreateInfo& setMaxAnisotropy( float maxAnisotropy_ ) + DeviceGeneratedCommandsLimitsNVX& operator=( VkDeviceGeneratedCommandsLimitsNVX const & rhs ) { - maxAnisotropy = maxAnisotropy_; + memcpy( this, &rhs, sizeof( DeviceGeneratedCommandsLimitsNVX ) ); return *this; } - - SamplerCreateInfo& setCompareEnable( Bool32 compareEnable_ ) + DeviceGeneratedCommandsLimitsNVX& setPNext( const void* pNext_ ) { - compareEnable = compareEnable_; + pNext = pNext_; return *this; } - SamplerCreateInfo& setCompareOp( CompareOp compareOp_ ) + DeviceGeneratedCommandsLimitsNVX& setMaxIndirectCommandsLayoutTokenCount( uint32_t maxIndirectCommandsLayoutTokenCount_ ) { - compareOp = compareOp_; + maxIndirectCommandsLayoutTokenCount = maxIndirectCommandsLayoutTokenCount_; return *this; } - SamplerCreateInfo& setMinLod( float minLod_ ) + DeviceGeneratedCommandsLimitsNVX& setMaxObjectEntryCounts( uint32_t maxObjectEntryCounts_ ) { - minLod = minLod_; + maxObjectEntryCounts = maxObjectEntryCounts_; return *this; } - SamplerCreateInfo& setMaxLod( float maxLod_ ) + DeviceGeneratedCommandsLimitsNVX& setMinSequenceCountBufferOffsetAlignment( uint32_t minSequenceCountBufferOffsetAlignment_ ) { - maxLod = maxLod_; + minSequenceCountBufferOffsetAlignment = minSequenceCountBufferOffsetAlignment_; return *this; } - SamplerCreateInfo& setBorderColor( BorderColor borderColor_ ) + DeviceGeneratedCommandsLimitsNVX& setMinSequenceIndexBufferOffsetAlignment( uint32_t minSequenceIndexBufferOffsetAlignment_ ) { - borderColor = borderColor_; + minSequenceIndexBufferOffsetAlignment = minSequenceIndexBufferOffsetAlignment_; return *this; } - SamplerCreateInfo& setUnnormalizedCoordinates( Bool32 unnormalizedCoordinates_ ) + DeviceGeneratedCommandsLimitsNVX& setMinCommandsTokenBufferOffsetAlignment( uint32_t minCommandsTokenBufferOffsetAlignment_ ) { - unnormalizedCoordinates = unnormalizedCoordinates_; + minCommandsTokenBufferOffsetAlignment = minCommandsTokenBufferOffsetAlignment_; return *this; } - operator const VkSamplerCreateInfo&() const + operator const VkDeviceGeneratedCommandsLimitsNVX&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( SamplerCreateInfo const& rhs ) const + bool operator==( DeviceGeneratedCommandsLimitsNVX const& rhs ) const { 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 ); + && ( maxIndirectCommandsLayoutTokenCount == rhs.maxIndirectCommandsLayoutTokenCount ) + && ( maxObjectEntryCounts == rhs.maxObjectEntryCounts ) + && ( minSequenceCountBufferOffsetAlignment == rhs.minSequenceCountBufferOffsetAlignment ) + && ( minSequenceIndexBufferOffsetAlignment == rhs.minSequenceIndexBufferOffsetAlignment ) + && ( minCommandsTokenBufferOffsetAlignment == rhs.minCommandsTokenBufferOffsetAlignment ); } - bool operator!=( SamplerCreateInfo const& rhs ) const + bool operator!=( DeviceGeneratedCommandsLimitsNVX const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDeviceGeneratedCommandsLimitsNVX; public: - const void* pNext; - SamplerCreateFlags flags; - Filter magFilter; - Filter minFilter; - SamplerMipmapMode mipmapMode; - SamplerAddressMode addressModeU; - SamplerAddressMode addressModeV; - SamplerAddressMode addressModeW; - float mipLodBias; - Bool32 anisotropyEnable; - float maxAnisotropy; - Bool32 compareEnable; - CompareOp compareOp; - float minLod; - float maxLod; - BorderColor borderColor; - Bool32 unnormalizedCoordinates; + const void* pNext = nullptr; + uint32_t maxIndirectCommandsLayoutTokenCount; + uint32_t maxObjectEntryCounts; + uint32_t minSequenceCountBufferOffsetAlignment; + uint32_t minSequenceIndexBufferOffsetAlignment; + uint32_t minCommandsTokenBufferOffsetAlignment; }; - static_assert( sizeof( SamplerCreateInfo ) == sizeof( VkSamplerCreateInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( DeviceGeneratedCommandsLimitsNVX ) == sizeof( VkDeviceGeneratedCommandsLimitsNVX ), "struct and wrapper have different size!" ); - struct CommandBufferAllocateInfo + struct CmdReserveSpaceForCommandsInfoNVX { - CommandBufferAllocateInfo( CommandPool commandPool_ = CommandPool(), CommandBufferLevel level_ = CommandBufferLevel::ePrimary, uint32_t commandBufferCount_ = 0 ) - : sType( StructureType::eCommandBufferAllocateInfo ) - , pNext( nullptr ) - , commandPool( commandPool_ ) - , level( level_ ) - , commandBufferCount( commandBufferCount_ ) + CmdReserveSpaceForCommandsInfoNVX( ObjectTableNVX objectTable_ = ObjectTableNVX(), IndirectCommandsLayoutNVX indirectCommandsLayout_ = IndirectCommandsLayoutNVX(), uint32_t maxSequencesCount_ = 0 ) + : objectTable( objectTable_ ) + , indirectCommandsLayout( indirectCommandsLayout_ ) + , maxSequencesCount( maxSequencesCount_ ) { } - CommandBufferAllocateInfo( VkCommandBufferAllocateInfo const & rhs ) + CmdReserveSpaceForCommandsInfoNVX( VkCmdReserveSpaceForCommandsInfoNVX const & rhs ) { - memcpy( this, &rhs, sizeof( CommandBufferAllocateInfo ) ); + memcpy( this, &rhs, sizeof( CmdReserveSpaceForCommandsInfoNVX ) ); } - CommandBufferAllocateInfo& operator=( VkCommandBufferAllocateInfo const & rhs ) + CmdReserveSpaceForCommandsInfoNVX& operator=( VkCmdReserveSpaceForCommandsInfoNVX const & rhs ) { - memcpy( this, &rhs, sizeof( CommandBufferAllocateInfo ) ); + memcpy( this, &rhs, sizeof( CmdReserveSpaceForCommandsInfoNVX ) ); return *this; } - CommandBufferAllocateInfo& setPNext( const void* pNext_ ) + CmdReserveSpaceForCommandsInfoNVX& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - CommandBufferAllocateInfo& setCommandPool( CommandPool commandPool_ ) + CmdReserveSpaceForCommandsInfoNVX& setObjectTable( ObjectTableNVX objectTable_ ) { - commandPool = commandPool_; + objectTable = objectTable_; return *this; } - CommandBufferAllocateInfo& setLevel( CommandBufferLevel level_ ) + CmdReserveSpaceForCommandsInfoNVX& setIndirectCommandsLayout( IndirectCommandsLayoutNVX indirectCommandsLayout_ ) { - level = level_; + indirectCommandsLayout = indirectCommandsLayout_; return *this; } - CommandBufferAllocateInfo& setCommandBufferCount( uint32_t commandBufferCount_ ) + CmdReserveSpaceForCommandsInfoNVX& setMaxSequencesCount( uint32_t maxSequencesCount_ ) { - commandBufferCount = commandBufferCount_; + maxSequencesCount = maxSequencesCount_; return *this; } - operator const VkCommandBufferAllocateInfo&() const + operator const VkCmdReserveSpaceForCommandsInfoNVX&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( CommandBufferAllocateInfo const& rhs ) const + bool operator==( CmdReserveSpaceForCommandsInfoNVX const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( commandPool == rhs.commandPool ) - && ( level == rhs.level ) - && ( commandBufferCount == rhs.commandBufferCount ); + && ( objectTable == rhs.objectTable ) + && ( indirectCommandsLayout == rhs.indirectCommandsLayout ) + && ( maxSequencesCount == rhs.maxSequencesCount ); } - bool operator!=( CommandBufferAllocateInfo const& rhs ) const + bool operator!=( CmdReserveSpaceForCommandsInfoNVX const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eCmdReserveSpaceForCommandsInfoNVX; public: - const void* pNext; - CommandPool commandPool; - CommandBufferLevel level; - uint32_t commandBufferCount; + const void* pNext = nullptr; + ObjectTableNVX objectTable; + IndirectCommandsLayoutNVX indirectCommandsLayout; + uint32_t maxSequencesCount; }; - static_assert( sizeof( CommandBufferAllocateInfo ) == sizeof( VkCommandBufferAllocateInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( CmdReserveSpaceForCommandsInfoNVX ) == sizeof( VkCmdReserveSpaceForCommandsInfoNVX ), "struct and wrapper have different size!" ); - struct RenderPassBeginInfo + struct PhysicalDeviceFeatures2 { - RenderPassBeginInfo( RenderPass renderPass_ = RenderPass(), Framebuffer framebuffer_ = Framebuffer(), Rect2D renderArea_ = Rect2D(), uint32_t clearValueCount_ = 0, const ClearValue* pClearValues_ = nullptr ) - : sType( StructureType::eRenderPassBeginInfo ) - , pNext( nullptr ) - , renderPass( renderPass_ ) - , framebuffer( framebuffer_ ) - , renderArea( renderArea_ ) - , clearValueCount( clearValueCount_ ) - , pClearValues( pClearValues_ ) + PhysicalDeviceFeatures2( PhysicalDeviceFeatures features_ = PhysicalDeviceFeatures() ) + : features( features_ ) { } - RenderPassBeginInfo( VkRenderPassBeginInfo const & rhs ) + PhysicalDeviceFeatures2( VkPhysicalDeviceFeatures2 const & rhs ) { - memcpy( this, &rhs, sizeof( RenderPassBeginInfo ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceFeatures2 ) ); } - RenderPassBeginInfo& operator=( VkRenderPassBeginInfo const & rhs ) + PhysicalDeviceFeatures2& operator=( VkPhysicalDeviceFeatures2 const & rhs ) { - memcpy( this, &rhs, sizeof( RenderPassBeginInfo ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceFeatures2 ) ); return *this; } - RenderPassBeginInfo& setPNext( const void* pNext_ ) + PhysicalDeviceFeatures2& setPNext( void* pNext_ ) { pNext = pNext_; return *this; } - RenderPassBeginInfo& setRenderPass( RenderPass renderPass_ ) + PhysicalDeviceFeatures2& setFeatures( PhysicalDeviceFeatures features_ ) { - renderPass = renderPass_; + features = features_; return *this; } - RenderPassBeginInfo& setFramebuffer( Framebuffer framebuffer_ ) + operator const VkPhysicalDeviceFeatures2&() const { - framebuffer = framebuffer_; - return *this; + return *reinterpret_cast(this); } - RenderPassBeginInfo& setRenderArea( Rect2D renderArea_ ) + bool operator==( PhysicalDeviceFeatures2 const& rhs ) const { - renderArea = renderArea_; - return *this; + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( features == rhs.features ); } - RenderPassBeginInfo& setClearValueCount( uint32_t clearValueCount_ ) + bool operator!=( PhysicalDeviceFeatures2 const& rhs ) const { - clearValueCount = clearValueCount_; + return !operator==( rhs ); + } + + private: + StructureType sType = StructureType::ePhysicalDeviceFeatures2; + + public: + void* pNext = nullptr; + PhysicalDeviceFeatures features; + }; + static_assert( sizeof( PhysicalDeviceFeatures2 ) == sizeof( VkPhysicalDeviceFeatures2 ), "struct and wrapper have different size!" ); + + using PhysicalDeviceFeatures2KHR = PhysicalDeviceFeatures2; + + struct PhysicalDevicePushDescriptorPropertiesKHR + { + PhysicalDevicePushDescriptorPropertiesKHR( uint32_t maxPushDescriptors_ = 0 ) + : maxPushDescriptors( maxPushDescriptors_ ) + { + } + + PhysicalDevicePushDescriptorPropertiesKHR( VkPhysicalDevicePushDescriptorPropertiesKHR const & rhs ) + { + memcpy( this, &rhs, sizeof( PhysicalDevicePushDescriptorPropertiesKHR ) ); + } + + PhysicalDevicePushDescriptorPropertiesKHR& operator=( VkPhysicalDevicePushDescriptorPropertiesKHR const & rhs ) + { + memcpy( this, &rhs, sizeof( PhysicalDevicePushDescriptorPropertiesKHR ) ); + return *this; + } + PhysicalDevicePushDescriptorPropertiesKHR& setPNext( void* pNext_ ) + { + pNext = pNext_; return *this; } - RenderPassBeginInfo& setPClearValues( const ClearValue* pClearValues_ ) + PhysicalDevicePushDescriptorPropertiesKHR& setMaxPushDescriptors( uint32_t maxPushDescriptors_ ) { - pClearValues = pClearValues_; + maxPushDescriptors = maxPushDescriptors_; return *this; } - operator const VkRenderPassBeginInfo&() const + operator const VkPhysicalDevicePushDescriptorPropertiesKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( RenderPassBeginInfo const& rhs ) const + bool operator==( PhysicalDevicePushDescriptorPropertiesKHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( renderPass == rhs.renderPass ) - && ( framebuffer == rhs.framebuffer ) - && ( renderArea == rhs.renderArea ) - && ( clearValueCount == rhs.clearValueCount ) - && ( pClearValues == rhs.pClearValues ); + && ( maxPushDescriptors == rhs.maxPushDescriptors ); } - bool operator!=( RenderPassBeginInfo const& rhs ) const + bool operator!=( PhysicalDevicePushDescriptorPropertiesKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDevicePushDescriptorPropertiesKHR; public: - const void* pNext; - RenderPass renderPass; - Framebuffer framebuffer; - Rect2D renderArea; - uint32_t clearValueCount; - const ClearValue* pClearValues; + void* pNext = nullptr; + uint32_t maxPushDescriptors; }; - static_assert( sizeof( RenderPassBeginInfo ) == sizeof( VkRenderPassBeginInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDevicePushDescriptorPropertiesKHR ) == sizeof( VkPhysicalDevicePushDescriptorPropertiesKHR ), "struct and wrapper have different size!" ); - struct EventCreateInfo + struct PresentRegionsKHR { - EventCreateInfo( EventCreateFlags flags_ = EventCreateFlags() ) - : sType( StructureType::eEventCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) + PresentRegionsKHR( uint32_t swapchainCount_ = 0, const PresentRegionKHR* pRegions_ = nullptr ) + : swapchainCount( swapchainCount_ ) + , pRegions( pRegions_ ) { } - EventCreateInfo( VkEventCreateInfo const & rhs ) + PresentRegionsKHR( VkPresentRegionsKHR const & rhs ) { - memcpy( this, &rhs, sizeof( EventCreateInfo ) ); + memcpy( this, &rhs, sizeof( PresentRegionsKHR ) ); } - EventCreateInfo& operator=( VkEventCreateInfo const & rhs ) + PresentRegionsKHR& operator=( VkPresentRegionsKHR const & rhs ) { - memcpy( this, &rhs, sizeof( EventCreateInfo ) ); + memcpy( this, &rhs, sizeof( PresentRegionsKHR ) ); return *this; } - EventCreateInfo& setPNext( const void* pNext_ ) + PresentRegionsKHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - EventCreateInfo& setFlags( EventCreateFlags flags_ ) + PresentRegionsKHR& setSwapchainCount( uint32_t swapchainCount_ ) { - flags = flags_; + swapchainCount = swapchainCount_; return *this; } - operator const VkEventCreateInfo&() const + PresentRegionsKHR& setPRegions( const PresentRegionKHR* pRegions_ ) { - return *reinterpret_cast(this); + pRegions = pRegions_; + return *this; } - bool operator==( EventCreateInfo const& rhs ) const + operator const VkPresentRegionsKHR&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PresentRegionsKHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ); + && ( swapchainCount == rhs.swapchainCount ) + && ( pRegions == rhs.pRegions ); } - bool operator!=( EventCreateInfo const& rhs ) const + bool operator!=( PresentRegionsKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePresentRegionsKHR; public: - const void* pNext; - EventCreateFlags flags; + const void* pNext = nullptr; + uint32_t swapchainCount; + const PresentRegionKHR* pRegions; }; - static_assert( sizeof( EventCreateInfo ) == sizeof( VkEventCreateInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( PresentRegionsKHR ) == sizeof( VkPresentRegionsKHR ), "struct and wrapper have different size!" ); - struct SemaphoreCreateInfo + struct PhysicalDeviceVariablePointerFeatures { - SemaphoreCreateInfo( SemaphoreCreateFlags flags_ = SemaphoreCreateFlags() ) - : sType( StructureType::eSemaphoreCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) + PhysicalDeviceVariablePointerFeatures( Bool32 variablePointersStorageBuffer_ = 0, Bool32 variablePointers_ = 0 ) + : variablePointersStorageBuffer( variablePointersStorageBuffer_ ) + , variablePointers( variablePointers_ ) { } - SemaphoreCreateInfo( VkSemaphoreCreateInfo const & rhs ) + PhysicalDeviceVariablePointerFeatures( VkPhysicalDeviceVariablePointerFeatures const & rhs ) { - memcpy( this, &rhs, sizeof( SemaphoreCreateInfo ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceVariablePointerFeatures ) ); } - SemaphoreCreateInfo& operator=( VkSemaphoreCreateInfo const & rhs ) + PhysicalDeviceVariablePointerFeatures& operator=( VkPhysicalDeviceVariablePointerFeatures const & rhs ) { - memcpy( this, &rhs, sizeof( SemaphoreCreateInfo ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceVariablePointerFeatures ) ); return *this; } - SemaphoreCreateInfo& setPNext( const void* pNext_ ) + PhysicalDeviceVariablePointerFeatures& setPNext( void* pNext_ ) { pNext = pNext_; return *this; } - SemaphoreCreateInfo& setFlags( SemaphoreCreateFlags flags_ ) + PhysicalDeviceVariablePointerFeatures& setVariablePointersStorageBuffer( Bool32 variablePointersStorageBuffer_ ) { - flags = flags_; + variablePointersStorageBuffer = variablePointersStorageBuffer_; return *this; } - operator const VkSemaphoreCreateInfo&() const + PhysicalDeviceVariablePointerFeatures& setVariablePointers( Bool32 variablePointers_ ) { - return *reinterpret_cast(this); + variablePointers = variablePointers_; + return *this; } - bool operator==( SemaphoreCreateInfo const& rhs ) const + operator const VkPhysicalDeviceVariablePointerFeatures&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PhysicalDeviceVariablePointerFeatures const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ); + && ( variablePointersStorageBuffer == rhs.variablePointersStorageBuffer ) + && ( variablePointers == rhs.variablePointers ); } - bool operator!=( SemaphoreCreateInfo const& rhs ) const + bool operator!=( PhysicalDeviceVariablePointerFeatures const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceVariablePointerFeatures; public: - const void* pNext; - SemaphoreCreateFlags flags; + void* pNext = nullptr; + Bool32 variablePointersStorageBuffer; + Bool32 variablePointers; }; - static_assert( sizeof( SemaphoreCreateInfo ) == sizeof( VkSemaphoreCreateInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceVariablePointerFeatures ) == sizeof( VkPhysicalDeviceVariablePointerFeatures ), "struct and wrapper have different size!" ); - struct FramebufferCreateInfo + using PhysicalDeviceVariablePointerFeaturesKHR = PhysicalDeviceVariablePointerFeatures; + + struct PhysicalDeviceIDProperties { - FramebufferCreateInfo( FramebufferCreateFlags flags_ = FramebufferCreateFlags(), RenderPass renderPass_ = RenderPass(), uint32_t attachmentCount_ = 0, const ImageView* pAttachments_ = nullptr, uint32_t width_ = 0, uint32_t height_ = 0, uint32_t layers_ = 0 ) - : sType( StructureType::eFramebufferCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) - , renderPass( renderPass_ ) - , attachmentCount( attachmentCount_ ) - , pAttachments( pAttachments_ ) - , width( width_ ) - , height( height_ ) - , layers( layers_ ) + operator const VkPhysicalDeviceIDProperties&() const { + return *reinterpret_cast(this); } - FramebufferCreateInfo( VkFramebufferCreateInfo const & rhs ) + bool operator==( PhysicalDeviceIDProperties const& rhs ) const { - memcpy( this, &rhs, sizeof( FramebufferCreateInfo ) ); + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( memcmp( deviceUUID, rhs.deviceUUID, VK_UUID_SIZE * sizeof( uint8_t ) ) == 0 ) + && ( memcmp( driverUUID, rhs.driverUUID, VK_UUID_SIZE * sizeof( uint8_t ) ) == 0 ) + && ( memcmp( deviceLUID, rhs.deviceLUID, VK_LUID_SIZE * sizeof( uint8_t ) ) == 0 ) + && ( deviceNodeMask == rhs.deviceNodeMask ) + && ( deviceLUIDValid == rhs.deviceLUIDValid ); } - FramebufferCreateInfo& operator=( VkFramebufferCreateInfo const & rhs ) + bool operator!=( PhysicalDeviceIDProperties const& rhs ) const { - memcpy( this, &rhs, sizeof( FramebufferCreateInfo ) ); + return !operator==( rhs ); + } + + private: + StructureType sType = StructureType::ePhysicalDeviceIdProperties; + + public: + void* pNext = nullptr; + uint8_t deviceUUID[VK_UUID_SIZE]; + uint8_t driverUUID[VK_UUID_SIZE]; + uint8_t deviceLUID[VK_LUID_SIZE]; + uint32_t deviceNodeMask; + Bool32 deviceLUIDValid; + }; + static_assert( sizeof( PhysicalDeviceIDProperties ) == sizeof( VkPhysicalDeviceIDProperties ), "struct and wrapper have different size!" ); + + using PhysicalDeviceIDPropertiesKHR = PhysicalDeviceIDProperties; + +#ifdef VK_USE_PLATFORM_WIN32_KHR + struct ExportMemoryWin32HandleInfoKHR + { + ExportMemoryWin32HandleInfoKHR( const SECURITY_ATTRIBUTES* pAttributes_ = nullptr, DWORD dwAccess_ = 0, LPCWSTR name_ = 0 ) + : pAttributes( pAttributes_ ) + , dwAccess( dwAccess_ ) + , name( name_ ) + { + } + + ExportMemoryWin32HandleInfoKHR( VkExportMemoryWin32HandleInfoKHR const & rhs ) + { + memcpy( this, &rhs, sizeof( ExportMemoryWin32HandleInfoKHR ) ); + } + + ExportMemoryWin32HandleInfoKHR& operator=( VkExportMemoryWin32HandleInfoKHR const & rhs ) + { + memcpy( this, &rhs, sizeof( ExportMemoryWin32HandleInfoKHR ) ); return *this; } - FramebufferCreateInfo& setPNext( const void* pNext_ ) + ExportMemoryWin32HandleInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - FramebufferCreateInfo& setFlags( FramebufferCreateFlags flags_ ) + ExportMemoryWin32HandleInfoKHR& setPAttributes( const SECURITY_ATTRIBUTES* pAttributes_ ) { - flags = flags_; + pAttributes = pAttributes_; return *this; } - FramebufferCreateInfo& setRenderPass( RenderPass renderPass_ ) + ExportMemoryWin32HandleInfoKHR& setDwAccess( DWORD dwAccess_ ) { - renderPass = renderPass_; + dwAccess = dwAccess_; return *this; } - FramebufferCreateInfo& setAttachmentCount( uint32_t attachmentCount_ ) + ExportMemoryWin32HandleInfoKHR& setName( LPCWSTR name_ ) { - attachmentCount = attachmentCount_; + name = name_; return *this; } - FramebufferCreateInfo& setPAttachments( const ImageView* pAttachments_ ) + operator const VkExportMemoryWin32HandleInfoKHR&() const { - pAttachments = pAttachments_; - return *this; + return *reinterpret_cast(this); } - FramebufferCreateInfo& setWidth( uint32_t width_ ) + bool operator==( ExportMemoryWin32HandleInfoKHR const& rhs ) const { - width = width_; - return *this; + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( pAttributes == rhs.pAttributes ) + && ( dwAccess == rhs.dwAccess ) + && ( name == rhs.name ); } - FramebufferCreateInfo& setHeight( uint32_t height_ ) + bool operator!=( ExportMemoryWin32HandleInfoKHR const& rhs ) const { - height = height_; - return *this; + return !operator==( rhs ); } - FramebufferCreateInfo& setLayers( uint32_t layers_ ) + private: + StructureType sType = StructureType::eExportMemoryWin32HandleInfoKHR; + + public: + const void* pNext = nullptr; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; + LPCWSTR name; + }; + static_assert( sizeof( ExportMemoryWin32HandleInfoKHR ) == sizeof( VkExportMemoryWin32HandleInfoKHR ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHR + struct MemoryWin32HandlePropertiesKHR + { + operator const VkMemoryWin32HandlePropertiesKHR&() const { - layers = layers_; - return *this; + return *reinterpret_cast(this); } - operator const VkFramebufferCreateInfo&() const + bool operator==( MemoryWin32HandlePropertiesKHR const& rhs ) const { - return *reinterpret_cast(this); + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( memoryTypeBits == rhs.memoryTypeBits ); } - bool operator==( FramebufferCreateInfo const& rhs ) const + bool operator!=( MemoryWin32HandlePropertiesKHR const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType = StructureType::eMemoryWin32HandlePropertiesKHR; + + public: + void* pNext = nullptr; + uint32_t memoryTypeBits; + }; + static_assert( sizeof( MemoryWin32HandlePropertiesKHR ) == sizeof( VkMemoryWin32HandlePropertiesKHR ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + + struct MemoryFdPropertiesKHR + { + operator const VkMemoryFdPropertiesKHR&() const + { + return *reinterpret_cast(this); + } + + bool operator==( MemoryFdPropertiesKHR const& rhs ) const { 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 ); + && ( memoryTypeBits == rhs.memoryTypeBits ); } - bool operator!=( FramebufferCreateInfo const& rhs ) const + bool operator!=( MemoryFdPropertiesKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eMemoryFdPropertiesKHR; public: - const void* pNext; - FramebufferCreateFlags flags; - RenderPass renderPass; - uint32_t attachmentCount; - const ImageView* pAttachments; - uint32_t width; - uint32_t height; - uint32_t layers; + void* pNext = nullptr; + uint32_t memoryTypeBits; }; - static_assert( sizeof( FramebufferCreateInfo ) == sizeof( VkFramebufferCreateInfo ), "struct and wrapper have different size!" ); + static_assert( sizeof( MemoryFdPropertiesKHR ) == sizeof( VkMemoryFdPropertiesKHR ), "struct and wrapper have different size!" ); + +#ifdef VK_USE_PLATFORM_WIN32_KHR + struct Win32KeyedMutexAcquireReleaseInfoKHR + { + Win32KeyedMutexAcquireReleaseInfoKHR( uint32_t acquireCount_ = 0, const DeviceMemory* pAcquireSyncs_ = nullptr, const uint64_t* pAcquireKeys_ = nullptr, const uint32_t* pAcquireTimeouts_ = nullptr, uint32_t releaseCount_ = 0, const DeviceMemory* pReleaseSyncs_ = nullptr, const uint64_t* pReleaseKeys_ = nullptr ) + : acquireCount( acquireCount_ ) + , pAcquireSyncs( pAcquireSyncs_ ) + , pAcquireKeys( pAcquireKeys_ ) + , pAcquireTimeouts( pAcquireTimeouts_ ) + , releaseCount( releaseCount_ ) + , pReleaseSyncs( pReleaseSyncs_ ) + , pReleaseKeys( pReleaseKeys_ ) + { + } + + Win32KeyedMutexAcquireReleaseInfoKHR( VkWin32KeyedMutexAcquireReleaseInfoKHR const & rhs ) + { + memcpy( this, &rhs, sizeof( Win32KeyedMutexAcquireReleaseInfoKHR ) ); + } + + Win32KeyedMutexAcquireReleaseInfoKHR& operator=( VkWin32KeyedMutexAcquireReleaseInfoKHR const & rhs ) + { + memcpy( this, &rhs, sizeof( Win32KeyedMutexAcquireReleaseInfoKHR ) ); + return *this; + } + Win32KeyedMutexAcquireReleaseInfoKHR& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } - struct DisplayModeCreateInfoKHR - { - DisplayModeCreateInfoKHR( DisplayModeCreateFlagsKHR flags_ = DisplayModeCreateFlagsKHR(), DisplayModeParametersKHR parameters_ = DisplayModeParametersKHR() ) - : sType( StructureType::eDisplayModeCreateInfoKHR ) - , pNext( nullptr ) - , flags( flags_ ) - , parameters( parameters_ ) + Win32KeyedMutexAcquireReleaseInfoKHR& setAcquireCount( uint32_t acquireCount_ ) { + acquireCount = acquireCount_; + return *this; } - DisplayModeCreateInfoKHR( VkDisplayModeCreateInfoKHR const & rhs ) + Win32KeyedMutexAcquireReleaseInfoKHR& setPAcquireSyncs( const DeviceMemory* pAcquireSyncs_ ) { - memcpy( this, &rhs, sizeof( DisplayModeCreateInfoKHR ) ); + pAcquireSyncs = pAcquireSyncs_; + return *this; } - DisplayModeCreateInfoKHR& operator=( VkDisplayModeCreateInfoKHR const & rhs ) + Win32KeyedMutexAcquireReleaseInfoKHR& setPAcquireKeys( const uint64_t* pAcquireKeys_ ) { - memcpy( this, &rhs, sizeof( DisplayModeCreateInfoKHR ) ); + pAcquireKeys = pAcquireKeys_; return *this; } - DisplayModeCreateInfoKHR& setPNext( const void* pNext_ ) + + Win32KeyedMutexAcquireReleaseInfoKHR& setPAcquireTimeouts( const uint32_t* pAcquireTimeouts_ ) { - pNext = pNext_; + pAcquireTimeouts = pAcquireTimeouts_; return *this; } - DisplayModeCreateInfoKHR& setFlags( DisplayModeCreateFlagsKHR flags_ ) + Win32KeyedMutexAcquireReleaseInfoKHR& setReleaseCount( uint32_t releaseCount_ ) { - flags = flags_; + releaseCount = releaseCount_; return *this; } - DisplayModeCreateInfoKHR& setParameters( DisplayModeParametersKHR parameters_ ) + Win32KeyedMutexAcquireReleaseInfoKHR& setPReleaseSyncs( const DeviceMemory* pReleaseSyncs_ ) { - parameters = parameters_; + pReleaseSyncs = pReleaseSyncs_; return *this; } - operator const VkDisplayModeCreateInfoKHR&() const + Win32KeyedMutexAcquireReleaseInfoKHR& setPReleaseKeys( const uint64_t* pReleaseKeys_ ) { - return *reinterpret_cast(this); + pReleaseKeys = pReleaseKeys_; + return *this; } - bool operator==( DisplayModeCreateInfoKHR const& rhs ) const + operator const VkWin32KeyedMutexAcquireReleaseInfoKHR&() const + { + return *reinterpret_cast(this); + } + + bool operator==( Win32KeyedMutexAcquireReleaseInfoKHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( parameters == rhs.parameters ); + && ( acquireCount == rhs.acquireCount ) + && ( pAcquireSyncs == rhs.pAcquireSyncs ) + && ( pAcquireKeys == rhs.pAcquireKeys ) + && ( pAcquireTimeouts == rhs.pAcquireTimeouts ) + && ( releaseCount == rhs.releaseCount ) + && ( pReleaseSyncs == rhs.pReleaseSyncs ) + && ( pReleaseKeys == rhs.pReleaseKeys ); } - bool operator!=( DisplayModeCreateInfoKHR const& rhs ) const + bool operator!=( Win32KeyedMutexAcquireReleaseInfoKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eWin32KeyedMutexAcquireReleaseInfoKHR; public: - const void* pNext; - DisplayModeCreateFlagsKHR flags; - DisplayModeParametersKHR parameters; + const void* pNext = nullptr; + uint32_t acquireCount; + const DeviceMemory* pAcquireSyncs; + const uint64_t* pAcquireKeys; + const uint32_t* pAcquireTimeouts; + uint32_t releaseCount; + const DeviceMemory* pReleaseSyncs; + const uint64_t* pReleaseKeys; }; - static_assert( sizeof( DisplayModeCreateInfoKHR ) == sizeof( VkDisplayModeCreateInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( Win32KeyedMutexAcquireReleaseInfoKHR ) == sizeof( VkWin32KeyedMutexAcquireReleaseInfoKHR ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - struct DisplayPresentInfoKHR +#ifdef VK_USE_PLATFORM_WIN32_KHR + struct ExportSemaphoreWin32HandleInfoKHR { - DisplayPresentInfoKHR( Rect2D srcRect_ = Rect2D(), Rect2D dstRect_ = Rect2D(), Bool32 persistent_ = 0 ) - : sType( StructureType::eDisplayPresentInfoKHR ) - , pNext( nullptr ) - , srcRect( srcRect_ ) - , dstRect( dstRect_ ) - , persistent( persistent_ ) + ExportSemaphoreWin32HandleInfoKHR( const SECURITY_ATTRIBUTES* pAttributes_ = nullptr, DWORD dwAccess_ = 0, LPCWSTR name_ = 0 ) + : pAttributes( pAttributes_ ) + , dwAccess( dwAccess_ ) + , name( name_ ) { } - DisplayPresentInfoKHR( VkDisplayPresentInfoKHR const & rhs ) + ExportSemaphoreWin32HandleInfoKHR( VkExportSemaphoreWin32HandleInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( DisplayPresentInfoKHR ) ); + memcpy( this, &rhs, sizeof( ExportSemaphoreWin32HandleInfoKHR ) ); } - DisplayPresentInfoKHR& operator=( VkDisplayPresentInfoKHR const & rhs ) + ExportSemaphoreWin32HandleInfoKHR& operator=( VkExportSemaphoreWin32HandleInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( DisplayPresentInfoKHR ) ); + memcpy( this, &rhs, sizeof( ExportSemaphoreWin32HandleInfoKHR ) ); return *this; } - DisplayPresentInfoKHR& setPNext( const void* pNext_ ) + ExportSemaphoreWin32HandleInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - DisplayPresentInfoKHR& setSrcRect( Rect2D srcRect_ ) + ExportSemaphoreWin32HandleInfoKHR& setPAttributes( const SECURITY_ATTRIBUTES* pAttributes_ ) { - srcRect = srcRect_; + pAttributes = pAttributes_; return *this; } - DisplayPresentInfoKHR& setDstRect( Rect2D dstRect_ ) + ExportSemaphoreWin32HandleInfoKHR& setDwAccess( DWORD dwAccess_ ) { - dstRect = dstRect_; + dwAccess = dwAccess_; return *this; } - DisplayPresentInfoKHR& setPersistent( Bool32 persistent_ ) + ExportSemaphoreWin32HandleInfoKHR& setName( LPCWSTR name_ ) { - persistent = persistent_; + name = name_; return *this; } - operator const VkDisplayPresentInfoKHR&() const + operator const VkExportSemaphoreWin32HandleInfoKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DisplayPresentInfoKHR const& rhs ) const + bool operator==( ExportSemaphoreWin32HandleInfoKHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( srcRect == rhs.srcRect ) - && ( dstRect == rhs.dstRect ) - && ( persistent == rhs.persistent ); + && ( pAttributes == rhs.pAttributes ) + && ( dwAccess == rhs.dwAccess ) + && ( name == rhs.name ); } - bool operator!=( DisplayPresentInfoKHR const& rhs ) const + bool operator!=( ExportSemaphoreWin32HandleInfoKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eExportSemaphoreWin32HandleInfoKHR; public: - const void* pNext; - Rect2D srcRect; - Rect2D dstRect; - Bool32 persistent; + const void* pNext = nullptr; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; + LPCWSTR name; }; - static_assert( sizeof( DisplayPresentInfoKHR ) == sizeof( VkDisplayPresentInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( ExportSemaphoreWin32HandleInfoKHR ) == sizeof( VkExportSemaphoreWin32HandleInfoKHR ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ -#ifdef VK_USE_PLATFORM_ANDROID_KHR - struct AndroidSurfaceCreateInfoKHR +#ifdef VK_USE_PLATFORM_WIN32_KHR + struct D3D12FenceSubmitInfoKHR { - AndroidSurfaceCreateInfoKHR( AndroidSurfaceCreateFlagsKHR flags_ = AndroidSurfaceCreateFlagsKHR(), ANativeWindow* window_ = nullptr ) - : sType( StructureType::eAndroidSurfaceCreateInfoKHR ) - , pNext( nullptr ) - , flags( flags_ ) - , window( window_ ) + D3D12FenceSubmitInfoKHR( uint32_t waitSemaphoreValuesCount_ = 0, const uint64_t* pWaitSemaphoreValues_ = nullptr, uint32_t signalSemaphoreValuesCount_ = 0, const uint64_t* pSignalSemaphoreValues_ = nullptr ) + : waitSemaphoreValuesCount( waitSemaphoreValuesCount_ ) + , pWaitSemaphoreValues( pWaitSemaphoreValues_ ) + , signalSemaphoreValuesCount( signalSemaphoreValuesCount_ ) + , pSignalSemaphoreValues( pSignalSemaphoreValues_ ) { } - AndroidSurfaceCreateInfoKHR( VkAndroidSurfaceCreateInfoKHR const & rhs ) + D3D12FenceSubmitInfoKHR( VkD3D12FenceSubmitInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( AndroidSurfaceCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( D3D12FenceSubmitInfoKHR ) ); } - AndroidSurfaceCreateInfoKHR& operator=( VkAndroidSurfaceCreateInfoKHR const & rhs ) + D3D12FenceSubmitInfoKHR& operator=( VkD3D12FenceSubmitInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( AndroidSurfaceCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( D3D12FenceSubmitInfoKHR ) ); return *this; } - AndroidSurfaceCreateInfoKHR& setPNext( const void* pNext_ ) + D3D12FenceSubmitInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - AndroidSurfaceCreateInfoKHR& setFlags( AndroidSurfaceCreateFlagsKHR flags_ ) + D3D12FenceSubmitInfoKHR& setWaitSemaphoreValuesCount( uint32_t waitSemaphoreValuesCount_ ) { - flags = flags_; + waitSemaphoreValuesCount = waitSemaphoreValuesCount_; return *this; } - AndroidSurfaceCreateInfoKHR& setWindow( ANativeWindow* window_ ) + D3D12FenceSubmitInfoKHR& setPWaitSemaphoreValues( const uint64_t* pWaitSemaphoreValues_ ) { - window = window_; + pWaitSemaphoreValues = pWaitSemaphoreValues_; return *this; } - operator const VkAndroidSurfaceCreateInfoKHR&() const + D3D12FenceSubmitInfoKHR& setSignalSemaphoreValuesCount( uint32_t signalSemaphoreValuesCount_ ) { - return *reinterpret_cast(this); + signalSemaphoreValuesCount = signalSemaphoreValuesCount_; + return *this; } - bool operator==( AndroidSurfaceCreateInfoKHR const& rhs ) const + D3D12FenceSubmitInfoKHR& setPSignalSemaphoreValues( const uint64_t* pSignalSemaphoreValues_ ) + { + pSignalSemaphoreValues = pSignalSemaphoreValues_; + return *this; + } + + operator const VkD3D12FenceSubmitInfoKHR&() const + { + return *reinterpret_cast(this); + } + + bool operator==( D3D12FenceSubmitInfoKHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( window == rhs.window ); + && ( waitSemaphoreValuesCount == rhs.waitSemaphoreValuesCount ) + && ( pWaitSemaphoreValues == rhs.pWaitSemaphoreValues ) + && ( signalSemaphoreValuesCount == rhs.signalSemaphoreValuesCount ) + && ( pSignalSemaphoreValues == rhs.pSignalSemaphoreValues ); } - bool operator!=( AndroidSurfaceCreateInfoKHR const& rhs ) const + bool operator!=( D3D12FenceSubmitInfoKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eD3D12FenceSubmitInfoKHR; public: - const void* pNext; - AndroidSurfaceCreateFlagsKHR flags; - ANativeWindow* window; + const void* pNext = nullptr; + uint32_t waitSemaphoreValuesCount; + const uint64_t* pWaitSemaphoreValues; + uint32_t signalSemaphoreValuesCount; + const uint64_t* pSignalSemaphoreValues; }; - static_assert( sizeof( AndroidSurfaceCreateInfoKHR ) == sizeof( VkAndroidSurfaceCreateInfoKHR ), "struct and wrapper have different size!" ); -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + static_assert( sizeof( D3D12FenceSubmitInfoKHR ) == sizeof( VkD3D12FenceSubmitInfoKHR ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ -#ifdef VK_USE_PLATFORM_MIR_KHR - struct MirSurfaceCreateInfoKHR +#ifdef VK_USE_PLATFORM_WIN32_KHR + struct ExportFenceWin32HandleInfoKHR { - MirSurfaceCreateInfoKHR( MirSurfaceCreateFlagsKHR flags_ = MirSurfaceCreateFlagsKHR(), MirConnection* connection_ = nullptr, MirSurface* mirSurface_ = nullptr ) - : sType( StructureType::eMirSurfaceCreateInfoKHR ) - , pNext( nullptr ) - , flags( flags_ ) - , connection( connection_ ) - , mirSurface( mirSurface_ ) + ExportFenceWin32HandleInfoKHR( const SECURITY_ATTRIBUTES* pAttributes_ = nullptr, DWORD dwAccess_ = 0, LPCWSTR name_ = 0 ) + : pAttributes( pAttributes_ ) + , dwAccess( dwAccess_ ) + , name( name_ ) { } - MirSurfaceCreateInfoKHR( VkMirSurfaceCreateInfoKHR const & rhs ) + ExportFenceWin32HandleInfoKHR( VkExportFenceWin32HandleInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( MirSurfaceCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( ExportFenceWin32HandleInfoKHR ) ); } - MirSurfaceCreateInfoKHR& operator=( VkMirSurfaceCreateInfoKHR const & rhs ) + ExportFenceWin32HandleInfoKHR& operator=( VkExportFenceWin32HandleInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( MirSurfaceCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( ExportFenceWin32HandleInfoKHR ) ); return *this; } - MirSurfaceCreateInfoKHR& setPNext( const void* pNext_ ) + ExportFenceWin32HandleInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - MirSurfaceCreateInfoKHR& setFlags( MirSurfaceCreateFlagsKHR flags_ ) + ExportFenceWin32HandleInfoKHR& setPAttributes( const SECURITY_ATTRIBUTES* pAttributes_ ) { - flags = flags_; + pAttributes = pAttributes_; return *this; } - MirSurfaceCreateInfoKHR& setConnection( MirConnection* connection_ ) + ExportFenceWin32HandleInfoKHR& setDwAccess( DWORD dwAccess_ ) { - connection = connection_; + dwAccess = dwAccess_; return *this; } - MirSurfaceCreateInfoKHR& setMirSurface( MirSurface* mirSurface_ ) + ExportFenceWin32HandleInfoKHR& setName( LPCWSTR name_ ) { - mirSurface = mirSurface_; + name = name_; return *this; } - operator const VkMirSurfaceCreateInfoKHR&() const + operator const VkExportFenceWin32HandleInfoKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( MirSurfaceCreateInfoKHR const& rhs ) const + bool operator==( ExportFenceWin32HandleInfoKHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( connection == rhs.connection ) - && ( mirSurface == rhs.mirSurface ); + && ( pAttributes == rhs.pAttributes ) + && ( dwAccess == rhs.dwAccess ) + && ( name == rhs.name ); } - bool operator!=( MirSurfaceCreateInfoKHR const& rhs ) const + bool operator!=( ExportFenceWin32HandleInfoKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eExportFenceWin32HandleInfoKHR; public: - const void* pNext; - MirSurfaceCreateFlagsKHR flags; - MirConnection* connection; - MirSurface* mirSurface; + const void* pNext = nullptr; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; + LPCWSTR name; }; - static_assert( sizeof( MirSurfaceCreateInfoKHR ) == sizeof( VkMirSurfaceCreateInfoKHR ), "struct and wrapper have different size!" ); -#endif /*VK_USE_PLATFORM_MIR_KHR*/ + static_assert( sizeof( ExportFenceWin32HandleInfoKHR ) == sizeof( VkExportFenceWin32HandleInfoKHR ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ -#ifdef VK_USE_PLATFORM_VI_NN - struct ViSurfaceCreateInfoNN + struct PhysicalDeviceMultiviewFeatures { - ViSurfaceCreateInfoNN( ViSurfaceCreateFlagsNN flags_ = ViSurfaceCreateFlagsNN(), void* window_ = nullptr ) - : sType( StructureType::eViSurfaceCreateInfoNN ) - , pNext( nullptr ) - , flags( flags_ ) - , window( window_ ) + PhysicalDeviceMultiviewFeatures( Bool32 multiview_ = 0, Bool32 multiviewGeometryShader_ = 0, Bool32 multiviewTessellationShader_ = 0 ) + : multiview( multiview_ ) + , multiviewGeometryShader( multiviewGeometryShader_ ) + , multiviewTessellationShader( multiviewTessellationShader_ ) + { + } + + PhysicalDeviceMultiviewFeatures( VkPhysicalDeviceMultiviewFeatures const & rhs ) + { + memcpy( this, &rhs, sizeof( PhysicalDeviceMultiviewFeatures ) ); + } + + PhysicalDeviceMultiviewFeatures& operator=( VkPhysicalDeviceMultiviewFeatures const & rhs ) + { + memcpy( this, &rhs, sizeof( PhysicalDeviceMultiviewFeatures ) ); + return *this; + } + PhysicalDeviceMultiviewFeatures& setPNext( void* pNext_ ) { + pNext = pNext_; + return *this; } - ViSurfaceCreateInfoNN( VkViSurfaceCreateInfoNN const & rhs ) + PhysicalDeviceMultiviewFeatures& setMultiview( Bool32 multiview_ ) { - memcpy( this, &rhs, sizeof( ViSurfaceCreateInfoNN ) ); + multiview = multiview_; + return *this; } - ViSurfaceCreateInfoNN& operator=( VkViSurfaceCreateInfoNN const & rhs ) + PhysicalDeviceMultiviewFeatures& setMultiviewGeometryShader( Bool32 multiviewGeometryShader_ ) { - memcpy( this, &rhs, sizeof( ViSurfaceCreateInfoNN ) ); + multiviewGeometryShader = multiviewGeometryShader_; return *this; } - ViSurfaceCreateInfoNN& setPNext( const void* pNext_ ) + + PhysicalDeviceMultiviewFeatures& setMultiviewTessellationShader( Bool32 multiviewTessellationShader_ ) { - pNext = pNext_; + multiviewTessellationShader = multiviewTessellationShader_; return *this; } - ViSurfaceCreateInfoNN& setFlags( ViSurfaceCreateFlagsNN flags_ ) + operator const VkPhysicalDeviceMultiviewFeatures&() const { - flags = flags_; - return *this; + return *reinterpret_cast(this); } - ViSurfaceCreateInfoNN& setWindow( void* window_ ) + bool operator==( PhysicalDeviceMultiviewFeatures const& rhs ) const { - window = window_; - return *this; + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( multiview == rhs.multiview ) + && ( multiviewGeometryShader == rhs.multiviewGeometryShader ) + && ( multiviewTessellationShader == rhs.multiviewTessellationShader ); } - operator const VkViSurfaceCreateInfoNN&() const + bool operator!=( PhysicalDeviceMultiviewFeatures const& rhs ) const { - return *reinterpret_cast(this); + return !operator==( rhs ); } - bool operator==( ViSurfaceCreateInfoNN const& rhs ) const + private: + StructureType sType = StructureType::ePhysicalDeviceMultiviewFeatures; + + public: + void* pNext = nullptr; + Bool32 multiview; + Bool32 multiviewGeometryShader; + Bool32 multiviewTessellationShader; + }; + static_assert( sizeof( PhysicalDeviceMultiviewFeatures ) == sizeof( VkPhysicalDeviceMultiviewFeatures ), "struct and wrapper have different size!" ); + + using PhysicalDeviceMultiviewFeaturesKHR = PhysicalDeviceMultiviewFeatures; + + struct PhysicalDeviceMultiviewProperties + { + operator const VkPhysicalDeviceMultiviewProperties&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PhysicalDeviceMultiviewProperties const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( window == rhs.window ); + && ( maxMultiviewViewCount == rhs.maxMultiviewViewCount ) + && ( maxMultiviewInstanceIndex == rhs.maxMultiviewInstanceIndex ); } - bool operator!=( ViSurfaceCreateInfoNN const& rhs ) const + bool operator!=( PhysicalDeviceMultiviewProperties const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceMultiviewProperties; public: - const void* pNext; - ViSurfaceCreateFlagsNN flags; - void* window; + void* pNext = nullptr; + uint32_t maxMultiviewViewCount; + uint32_t maxMultiviewInstanceIndex; }; - static_assert( sizeof( ViSurfaceCreateInfoNN ) == sizeof( VkViSurfaceCreateInfoNN ), "struct and wrapper have different size!" ); -#endif /*VK_USE_PLATFORM_VI_NN*/ + static_assert( sizeof( PhysicalDeviceMultiviewProperties ) == sizeof( VkPhysicalDeviceMultiviewProperties ), "struct and wrapper have different size!" ); -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - struct WaylandSurfaceCreateInfoKHR + using PhysicalDeviceMultiviewPropertiesKHR = PhysicalDeviceMultiviewProperties; + + struct RenderPassMultiviewCreateInfo { - WaylandSurfaceCreateInfoKHR( WaylandSurfaceCreateFlagsKHR flags_ = WaylandSurfaceCreateFlagsKHR(), struct wl_display* display_ = nullptr, struct wl_surface* surface_ = nullptr ) - : sType( StructureType::eWaylandSurfaceCreateInfoKHR ) - , pNext( nullptr ) - , flags( flags_ ) - , display( display_ ) - , surface( surface_ ) + RenderPassMultiviewCreateInfo( uint32_t subpassCount_ = 0, const uint32_t* pViewMasks_ = nullptr, uint32_t dependencyCount_ = 0, const int32_t* pViewOffsets_ = nullptr, uint32_t correlationMaskCount_ = 0, const uint32_t* pCorrelationMasks_ = nullptr ) + : subpassCount( subpassCount_ ) + , pViewMasks( pViewMasks_ ) + , dependencyCount( dependencyCount_ ) + , pViewOffsets( pViewOffsets_ ) + , correlationMaskCount( correlationMaskCount_ ) + , pCorrelationMasks( pCorrelationMasks_ ) { } - WaylandSurfaceCreateInfoKHR( VkWaylandSurfaceCreateInfoKHR const & rhs ) + RenderPassMultiviewCreateInfo( VkRenderPassMultiviewCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( WaylandSurfaceCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( RenderPassMultiviewCreateInfo ) ); } - WaylandSurfaceCreateInfoKHR& operator=( VkWaylandSurfaceCreateInfoKHR const & rhs ) + RenderPassMultiviewCreateInfo& operator=( VkRenderPassMultiviewCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( WaylandSurfaceCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( RenderPassMultiviewCreateInfo ) ); return *this; } - WaylandSurfaceCreateInfoKHR& setPNext( const void* pNext_ ) + RenderPassMultiviewCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - WaylandSurfaceCreateInfoKHR& setFlags( WaylandSurfaceCreateFlagsKHR flags_ ) + RenderPassMultiviewCreateInfo& setSubpassCount( uint32_t subpassCount_ ) { - flags = flags_; + subpassCount = subpassCount_; return *this; } - WaylandSurfaceCreateInfoKHR& setDisplay( struct wl_display* display_ ) + RenderPassMultiviewCreateInfo& setPViewMasks( const uint32_t* pViewMasks_ ) { - display = display_; + pViewMasks = pViewMasks_; return *this; } - WaylandSurfaceCreateInfoKHR& setSurface( struct wl_surface* surface_ ) + RenderPassMultiviewCreateInfo& setDependencyCount( uint32_t dependencyCount_ ) { - surface = surface_; + dependencyCount = dependencyCount_; return *this; } - operator const VkWaylandSurfaceCreateInfoKHR&() const + RenderPassMultiviewCreateInfo& setPViewOffsets( const int32_t* pViewOffsets_ ) { - return *reinterpret_cast(this); + pViewOffsets = pViewOffsets_; + return *this; } - bool operator==( WaylandSurfaceCreateInfoKHR const& rhs ) const + RenderPassMultiviewCreateInfo& setCorrelationMaskCount( uint32_t correlationMaskCount_ ) + { + correlationMaskCount = correlationMaskCount_; + return *this; + } + + RenderPassMultiviewCreateInfo& setPCorrelationMasks( const uint32_t* pCorrelationMasks_ ) + { + pCorrelationMasks = pCorrelationMasks_; + return *this; + } + + operator const VkRenderPassMultiviewCreateInfo&() const + { + return *reinterpret_cast(this); + } + + bool operator==( RenderPassMultiviewCreateInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( display == rhs.display ) - && ( surface == rhs.surface ); + && ( subpassCount == rhs.subpassCount ) + && ( pViewMasks == rhs.pViewMasks ) + && ( dependencyCount == rhs.dependencyCount ) + && ( pViewOffsets == rhs.pViewOffsets ) + && ( correlationMaskCount == rhs.correlationMaskCount ) + && ( pCorrelationMasks == rhs.pCorrelationMasks ); } - bool operator!=( WaylandSurfaceCreateInfoKHR const& rhs ) const + bool operator!=( RenderPassMultiviewCreateInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eRenderPassMultiviewCreateInfo; public: - const void* pNext; - WaylandSurfaceCreateFlagsKHR flags; - struct wl_display* display; - struct wl_surface* surface; + const void* pNext = nullptr; + uint32_t subpassCount; + const uint32_t* pViewMasks; + uint32_t dependencyCount; + const int32_t* pViewOffsets; + uint32_t correlationMaskCount; + const uint32_t* pCorrelationMasks; }; - static_assert( sizeof( WaylandSurfaceCreateInfoKHR ) == sizeof( VkWaylandSurfaceCreateInfoKHR ), "struct and wrapper have different size!" ); -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ + static_assert( sizeof( RenderPassMultiviewCreateInfo ) == sizeof( VkRenderPassMultiviewCreateInfo ), "struct and wrapper have different size!" ); -#ifdef VK_USE_PLATFORM_WIN32_KHR - struct Win32SurfaceCreateInfoKHR + using RenderPassMultiviewCreateInfoKHR = RenderPassMultiviewCreateInfo; + + struct BindBufferMemoryInfo { - Win32SurfaceCreateInfoKHR( Win32SurfaceCreateFlagsKHR flags_ = Win32SurfaceCreateFlagsKHR(), HINSTANCE hinstance_ = 0, HWND hwnd_ = 0 ) - : sType( StructureType::eWin32SurfaceCreateInfoKHR ) - , pNext( nullptr ) - , flags( flags_ ) - , hinstance( hinstance_ ) - , hwnd( hwnd_ ) + BindBufferMemoryInfo( Buffer buffer_ = Buffer(), DeviceMemory memory_ = DeviceMemory(), DeviceSize memoryOffset_ = 0 ) + : buffer( buffer_ ) + , memory( memory_ ) + , memoryOffset( memoryOffset_ ) { } - Win32SurfaceCreateInfoKHR( VkWin32SurfaceCreateInfoKHR const & rhs ) + BindBufferMemoryInfo( VkBindBufferMemoryInfo const & rhs ) { - memcpy( this, &rhs, sizeof( Win32SurfaceCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( BindBufferMemoryInfo ) ); } - Win32SurfaceCreateInfoKHR& operator=( VkWin32SurfaceCreateInfoKHR const & rhs ) + BindBufferMemoryInfo& operator=( VkBindBufferMemoryInfo const & rhs ) { - memcpy( this, &rhs, sizeof( Win32SurfaceCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( BindBufferMemoryInfo ) ); return *this; } - Win32SurfaceCreateInfoKHR& setPNext( const void* pNext_ ) + BindBufferMemoryInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - Win32SurfaceCreateInfoKHR& setFlags( Win32SurfaceCreateFlagsKHR flags_ ) + BindBufferMemoryInfo& setBuffer( Buffer buffer_ ) { - flags = flags_; + buffer = buffer_; return *this; } - Win32SurfaceCreateInfoKHR& setHinstance( HINSTANCE hinstance_ ) + BindBufferMemoryInfo& setMemory( DeviceMemory memory_ ) { - hinstance = hinstance_; + memory = memory_; return *this; } - Win32SurfaceCreateInfoKHR& setHwnd( HWND hwnd_ ) + BindBufferMemoryInfo& setMemoryOffset( DeviceSize memoryOffset_ ) { - hwnd = hwnd_; + memoryOffset = memoryOffset_; return *this; } - operator const VkWin32SurfaceCreateInfoKHR&() const + operator const VkBindBufferMemoryInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( Win32SurfaceCreateInfoKHR const& rhs ) const + bool operator==( BindBufferMemoryInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( hinstance == rhs.hinstance ) - && ( hwnd == rhs.hwnd ); + && ( buffer == rhs.buffer ) + && ( memory == rhs.memory ) + && ( memoryOffset == rhs.memoryOffset ); } - bool operator!=( Win32SurfaceCreateInfoKHR const& rhs ) const + bool operator!=( BindBufferMemoryInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eBindBufferMemoryInfo; public: - const void* pNext; - Win32SurfaceCreateFlagsKHR flags; - HINSTANCE hinstance; - HWND hwnd; + const void* pNext = nullptr; + Buffer buffer; + DeviceMemory memory; + DeviceSize memoryOffset; }; - static_assert( sizeof( Win32SurfaceCreateInfoKHR ) == sizeof( VkWin32SurfaceCreateInfoKHR ), "struct and wrapper have different size!" ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + static_assert( sizeof( BindBufferMemoryInfo ) == sizeof( VkBindBufferMemoryInfo ), "struct and wrapper have different size!" ); -#ifdef VK_USE_PLATFORM_XLIB_KHR - struct XlibSurfaceCreateInfoKHR + using BindBufferMemoryInfoKHR = BindBufferMemoryInfo; + + struct BindBufferMemoryDeviceGroupInfo { - XlibSurfaceCreateInfoKHR( XlibSurfaceCreateFlagsKHR flags_ = XlibSurfaceCreateFlagsKHR(), Display* dpy_ = nullptr, Window window_ = 0 ) - : sType( StructureType::eXlibSurfaceCreateInfoKHR ) - , pNext( nullptr ) - , flags( flags_ ) - , dpy( dpy_ ) - , window( window_ ) + BindBufferMemoryDeviceGroupInfo( uint32_t deviceIndexCount_ = 0, const uint32_t* pDeviceIndices_ = nullptr ) + : deviceIndexCount( deviceIndexCount_ ) + , pDeviceIndices( pDeviceIndices_ ) { } - XlibSurfaceCreateInfoKHR( VkXlibSurfaceCreateInfoKHR const & rhs ) + BindBufferMemoryDeviceGroupInfo( VkBindBufferMemoryDeviceGroupInfo const & rhs ) { - memcpy( this, &rhs, sizeof( XlibSurfaceCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( BindBufferMemoryDeviceGroupInfo ) ); } - XlibSurfaceCreateInfoKHR& operator=( VkXlibSurfaceCreateInfoKHR const & rhs ) + BindBufferMemoryDeviceGroupInfo& operator=( VkBindBufferMemoryDeviceGroupInfo const & rhs ) { - memcpy( this, &rhs, sizeof( XlibSurfaceCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( BindBufferMemoryDeviceGroupInfo ) ); return *this; } - XlibSurfaceCreateInfoKHR& setPNext( const void* pNext_ ) + BindBufferMemoryDeviceGroupInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - XlibSurfaceCreateInfoKHR& setFlags( XlibSurfaceCreateFlagsKHR flags_ ) - { - flags = flags_; - return *this; - } - - XlibSurfaceCreateInfoKHR& setDpy( Display* dpy_ ) + BindBufferMemoryDeviceGroupInfo& setDeviceIndexCount( uint32_t deviceIndexCount_ ) { - dpy = dpy_; + deviceIndexCount = deviceIndexCount_; return *this; } - XlibSurfaceCreateInfoKHR& setWindow( Window window_ ) + BindBufferMemoryDeviceGroupInfo& setPDeviceIndices( const uint32_t* pDeviceIndices_ ) { - window = window_; + pDeviceIndices = pDeviceIndices_; return *this; } - operator const VkXlibSurfaceCreateInfoKHR&() const + operator const VkBindBufferMemoryDeviceGroupInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( XlibSurfaceCreateInfoKHR const& rhs ) const + bool operator==( BindBufferMemoryDeviceGroupInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( dpy == rhs.dpy ) - && ( window == rhs.window ); + && ( deviceIndexCount == rhs.deviceIndexCount ) + && ( pDeviceIndices == rhs.pDeviceIndices ); } - bool operator!=( XlibSurfaceCreateInfoKHR const& rhs ) const + bool operator!=( BindBufferMemoryDeviceGroupInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eBindBufferMemoryDeviceGroupInfo; public: - const void* pNext; - XlibSurfaceCreateFlagsKHR flags; - Display* dpy; - Window window; + const void* pNext = nullptr; + uint32_t deviceIndexCount; + const uint32_t* pDeviceIndices; }; - static_assert( sizeof( XlibSurfaceCreateInfoKHR ) == sizeof( VkXlibSurfaceCreateInfoKHR ), "struct and wrapper have different size!" ); -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ + static_assert( sizeof( BindBufferMemoryDeviceGroupInfo ) == sizeof( VkBindBufferMemoryDeviceGroupInfo ), "struct and wrapper have different size!" ); -#ifdef VK_USE_PLATFORM_XCB_KHR - struct XcbSurfaceCreateInfoKHR + using BindBufferMemoryDeviceGroupInfoKHR = BindBufferMemoryDeviceGroupInfo; + + struct BindImageMemoryInfo { - XcbSurfaceCreateInfoKHR( XcbSurfaceCreateFlagsKHR flags_ = XcbSurfaceCreateFlagsKHR(), xcb_connection_t* connection_ = nullptr, xcb_window_t window_ = 0 ) - : sType( StructureType::eXcbSurfaceCreateInfoKHR ) - , pNext( nullptr ) - , flags( flags_ ) - , connection( connection_ ) - , window( window_ ) + BindImageMemoryInfo( Image image_ = Image(), DeviceMemory memory_ = DeviceMemory(), DeviceSize memoryOffset_ = 0 ) + : image( image_ ) + , memory( memory_ ) + , memoryOffset( memoryOffset_ ) { } - XcbSurfaceCreateInfoKHR( VkXcbSurfaceCreateInfoKHR const & rhs ) + BindImageMemoryInfo( VkBindImageMemoryInfo const & rhs ) { - memcpy( this, &rhs, sizeof( XcbSurfaceCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( BindImageMemoryInfo ) ); } - XcbSurfaceCreateInfoKHR& operator=( VkXcbSurfaceCreateInfoKHR const & rhs ) + BindImageMemoryInfo& operator=( VkBindImageMemoryInfo const & rhs ) { - memcpy( this, &rhs, sizeof( XcbSurfaceCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( BindImageMemoryInfo ) ); return *this; } - XcbSurfaceCreateInfoKHR& setPNext( const void* pNext_ ) + BindImageMemoryInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - XcbSurfaceCreateInfoKHR& setFlags( XcbSurfaceCreateFlagsKHR flags_ ) + BindImageMemoryInfo& setImage( Image image_ ) { - flags = flags_; + image = image_; return *this; } - XcbSurfaceCreateInfoKHR& setConnection( xcb_connection_t* connection_ ) + BindImageMemoryInfo& setMemory( DeviceMemory memory_ ) { - connection = connection_; + memory = memory_; return *this; } - XcbSurfaceCreateInfoKHR& setWindow( xcb_window_t window_ ) + BindImageMemoryInfo& setMemoryOffset( DeviceSize memoryOffset_ ) { - window = window_; + memoryOffset = memoryOffset_; return *this; } - operator const VkXcbSurfaceCreateInfoKHR&() const + operator const VkBindImageMemoryInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( XcbSurfaceCreateInfoKHR const& rhs ) const + bool operator==( BindImageMemoryInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( connection == rhs.connection ) - && ( window == rhs.window ); + && ( image == rhs.image ) + && ( memory == rhs.memory ) + && ( memoryOffset == rhs.memoryOffset ); } - bool operator!=( XcbSurfaceCreateInfoKHR const& rhs ) const + bool operator!=( BindImageMemoryInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eBindImageMemoryInfo; public: - const void* pNext; - XcbSurfaceCreateFlagsKHR flags; - xcb_connection_t* connection; - xcb_window_t window; + const void* pNext = nullptr; + Image image; + DeviceMemory memory; + DeviceSize memoryOffset; }; - static_assert( sizeof( XcbSurfaceCreateInfoKHR ) == sizeof( VkXcbSurfaceCreateInfoKHR ), "struct and wrapper have different size!" ); -#endif /*VK_USE_PLATFORM_XCB_KHR*/ + static_assert( sizeof( BindImageMemoryInfo ) == sizeof( VkBindImageMemoryInfo ), "struct and wrapper have different size!" ); - struct DebugMarkerMarkerInfoEXT + using BindImageMemoryInfoKHR = BindImageMemoryInfo; + + struct BindImageMemoryDeviceGroupInfo { - DebugMarkerMarkerInfoEXT( const char* pMarkerName_ = nullptr, std::array const& color_ = { { 0, 0, 0, 0 } } ) - : sType( StructureType::eDebugMarkerMarkerInfoEXT ) - , pNext( nullptr ) - , pMarkerName( pMarkerName_ ) + BindImageMemoryDeviceGroupInfo( uint32_t deviceIndexCount_ = 0, const uint32_t* pDeviceIndices_ = nullptr, uint32_t splitInstanceBindRegionCount_ = 0, const Rect2D* pSplitInstanceBindRegions_ = nullptr ) + : deviceIndexCount( deviceIndexCount_ ) + , pDeviceIndices( pDeviceIndices_ ) + , splitInstanceBindRegionCount( splitInstanceBindRegionCount_ ) + , pSplitInstanceBindRegions( pSplitInstanceBindRegions_ ) { - memcpy( &color, color_.data(), 4 * sizeof( float ) ); } - DebugMarkerMarkerInfoEXT( VkDebugMarkerMarkerInfoEXT const & rhs ) + BindImageMemoryDeviceGroupInfo( VkBindImageMemoryDeviceGroupInfo const & rhs ) { - memcpy( this, &rhs, sizeof( DebugMarkerMarkerInfoEXT ) ); + memcpy( this, &rhs, sizeof( BindImageMemoryDeviceGroupInfo ) ); + } + + BindImageMemoryDeviceGroupInfo& operator=( VkBindImageMemoryDeviceGroupInfo const & rhs ) + { + memcpy( this, &rhs, sizeof( BindImageMemoryDeviceGroupInfo ) ); + return *this; + } + BindImageMemoryDeviceGroupInfo& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; } - DebugMarkerMarkerInfoEXT& operator=( VkDebugMarkerMarkerInfoEXT const & rhs ) + BindImageMemoryDeviceGroupInfo& setDeviceIndexCount( uint32_t deviceIndexCount_ ) { - memcpy( this, &rhs, sizeof( DebugMarkerMarkerInfoEXT ) ); + deviceIndexCount = deviceIndexCount_; return *this; } - DebugMarkerMarkerInfoEXT& setPNext( const void* pNext_ ) + + BindImageMemoryDeviceGroupInfo& setPDeviceIndices( const uint32_t* pDeviceIndices_ ) { - pNext = pNext_; + pDeviceIndices = pDeviceIndices_; return *this; } - DebugMarkerMarkerInfoEXT& setPMarkerName( const char* pMarkerName_ ) + BindImageMemoryDeviceGroupInfo& setSplitInstanceBindRegionCount( uint32_t splitInstanceBindRegionCount_ ) { - pMarkerName = pMarkerName_; + splitInstanceBindRegionCount = splitInstanceBindRegionCount_; return *this; } - DebugMarkerMarkerInfoEXT& setColor( std::array color_ ) + BindImageMemoryDeviceGroupInfo& setPSplitInstanceBindRegions( const Rect2D* pSplitInstanceBindRegions_ ) { - memcpy( &color, color_.data(), 4 * sizeof( float ) ); + pSplitInstanceBindRegions = pSplitInstanceBindRegions_; return *this; } - operator const VkDebugMarkerMarkerInfoEXT&() const + operator const VkBindImageMemoryDeviceGroupInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DebugMarkerMarkerInfoEXT const& rhs ) const + bool operator==( BindImageMemoryDeviceGroupInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( pMarkerName == rhs.pMarkerName ) - && ( memcmp( color, rhs.color, 4 * sizeof( float ) ) == 0 ); + && ( deviceIndexCount == rhs.deviceIndexCount ) + && ( pDeviceIndices == rhs.pDeviceIndices ) + && ( splitInstanceBindRegionCount == rhs.splitInstanceBindRegionCount ) + && ( pSplitInstanceBindRegions == rhs.pSplitInstanceBindRegions ); } - bool operator!=( DebugMarkerMarkerInfoEXT const& rhs ) const + bool operator!=( BindImageMemoryDeviceGroupInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eBindImageMemoryDeviceGroupInfo; public: - const void* pNext; - const char* pMarkerName; - float color[4]; + const void* pNext = nullptr; + uint32_t deviceIndexCount; + const uint32_t* pDeviceIndices; + uint32_t splitInstanceBindRegionCount; + const Rect2D* pSplitInstanceBindRegions; }; - static_assert( sizeof( DebugMarkerMarkerInfoEXT ) == sizeof( VkDebugMarkerMarkerInfoEXT ), "struct and wrapper have different size!" ); + static_assert( sizeof( BindImageMemoryDeviceGroupInfo ) == sizeof( VkBindImageMemoryDeviceGroupInfo ), "struct and wrapper have different size!" ); - struct DedicatedAllocationImageCreateInfoNV + using BindImageMemoryDeviceGroupInfoKHR = BindImageMemoryDeviceGroupInfo; + + struct DeviceGroupRenderPassBeginInfo { - DedicatedAllocationImageCreateInfoNV( Bool32 dedicatedAllocation_ = 0 ) - : sType( StructureType::eDedicatedAllocationImageCreateInfoNV ) - , pNext( nullptr ) - , dedicatedAllocation( dedicatedAllocation_ ) + DeviceGroupRenderPassBeginInfo( uint32_t deviceMask_ = 0, uint32_t deviceRenderAreaCount_ = 0, const Rect2D* pDeviceRenderAreas_ = nullptr ) + : deviceMask( deviceMask_ ) + , deviceRenderAreaCount( deviceRenderAreaCount_ ) + , pDeviceRenderAreas( pDeviceRenderAreas_ ) { } - DedicatedAllocationImageCreateInfoNV( VkDedicatedAllocationImageCreateInfoNV const & rhs ) + DeviceGroupRenderPassBeginInfo( VkDeviceGroupRenderPassBeginInfo const & rhs ) { - memcpy( this, &rhs, sizeof( DedicatedAllocationImageCreateInfoNV ) ); + memcpy( this, &rhs, sizeof( DeviceGroupRenderPassBeginInfo ) ); } - DedicatedAllocationImageCreateInfoNV& operator=( VkDedicatedAllocationImageCreateInfoNV const & rhs ) + DeviceGroupRenderPassBeginInfo& operator=( VkDeviceGroupRenderPassBeginInfo const & rhs ) { - memcpy( this, &rhs, sizeof( DedicatedAllocationImageCreateInfoNV ) ); + memcpy( this, &rhs, sizeof( DeviceGroupRenderPassBeginInfo ) ); return *this; } - DedicatedAllocationImageCreateInfoNV& setPNext( const void* pNext_ ) + DeviceGroupRenderPassBeginInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - DedicatedAllocationImageCreateInfoNV& setDedicatedAllocation( Bool32 dedicatedAllocation_ ) + DeviceGroupRenderPassBeginInfo& setDeviceMask( uint32_t deviceMask_ ) { - dedicatedAllocation = dedicatedAllocation_; + deviceMask = deviceMask_; return *this; } - operator const VkDedicatedAllocationImageCreateInfoNV&() const + DeviceGroupRenderPassBeginInfo& setDeviceRenderAreaCount( uint32_t deviceRenderAreaCount_ ) { - return *reinterpret_cast(this); + deviceRenderAreaCount = deviceRenderAreaCount_; + return *this; } - bool operator==( DedicatedAllocationImageCreateInfoNV const& rhs ) const + DeviceGroupRenderPassBeginInfo& setPDeviceRenderAreas( const Rect2D* pDeviceRenderAreas_ ) + { + pDeviceRenderAreas = pDeviceRenderAreas_; + return *this; + } + + operator const VkDeviceGroupRenderPassBeginInfo&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DeviceGroupRenderPassBeginInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( dedicatedAllocation == rhs.dedicatedAllocation ); + && ( deviceMask == rhs.deviceMask ) + && ( deviceRenderAreaCount == rhs.deviceRenderAreaCount ) + && ( pDeviceRenderAreas == rhs.pDeviceRenderAreas ); } - bool operator!=( DedicatedAllocationImageCreateInfoNV const& rhs ) const + bool operator!=( DeviceGroupRenderPassBeginInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDeviceGroupRenderPassBeginInfo; public: - const void* pNext; - Bool32 dedicatedAllocation; + const void* pNext = nullptr; + uint32_t deviceMask; + uint32_t deviceRenderAreaCount; + const Rect2D* pDeviceRenderAreas; }; - static_assert( sizeof( DedicatedAllocationImageCreateInfoNV ) == sizeof( VkDedicatedAllocationImageCreateInfoNV ), "struct and wrapper have different size!" ); + static_assert( sizeof( DeviceGroupRenderPassBeginInfo ) == sizeof( VkDeviceGroupRenderPassBeginInfo ), "struct and wrapper have different size!" ); - struct DedicatedAllocationBufferCreateInfoNV + using DeviceGroupRenderPassBeginInfoKHR = DeviceGroupRenderPassBeginInfo; + + struct DeviceGroupCommandBufferBeginInfo { - DedicatedAllocationBufferCreateInfoNV( Bool32 dedicatedAllocation_ = 0 ) - : sType( StructureType::eDedicatedAllocationBufferCreateInfoNV ) - , pNext( nullptr ) - , dedicatedAllocation( dedicatedAllocation_ ) + DeviceGroupCommandBufferBeginInfo( uint32_t deviceMask_ = 0 ) + : deviceMask( deviceMask_ ) { } - DedicatedAllocationBufferCreateInfoNV( VkDedicatedAllocationBufferCreateInfoNV const & rhs ) + DeviceGroupCommandBufferBeginInfo( VkDeviceGroupCommandBufferBeginInfo const & rhs ) { - memcpy( this, &rhs, sizeof( DedicatedAllocationBufferCreateInfoNV ) ); + memcpy( this, &rhs, sizeof( DeviceGroupCommandBufferBeginInfo ) ); } - DedicatedAllocationBufferCreateInfoNV& operator=( VkDedicatedAllocationBufferCreateInfoNV const & rhs ) + DeviceGroupCommandBufferBeginInfo& operator=( VkDeviceGroupCommandBufferBeginInfo const & rhs ) { - memcpy( this, &rhs, sizeof( DedicatedAllocationBufferCreateInfoNV ) ); + memcpy( this, &rhs, sizeof( DeviceGroupCommandBufferBeginInfo ) ); return *this; } - DedicatedAllocationBufferCreateInfoNV& setPNext( const void* pNext_ ) + DeviceGroupCommandBufferBeginInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - DedicatedAllocationBufferCreateInfoNV& setDedicatedAllocation( Bool32 dedicatedAllocation_ ) + DeviceGroupCommandBufferBeginInfo& setDeviceMask( uint32_t deviceMask_ ) { - dedicatedAllocation = dedicatedAllocation_; + deviceMask = deviceMask_; return *this; } - operator const VkDedicatedAllocationBufferCreateInfoNV&() const + operator const VkDeviceGroupCommandBufferBeginInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DedicatedAllocationBufferCreateInfoNV const& rhs ) const + bool operator==( DeviceGroupCommandBufferBeginInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( dedicatedAllocation == rhs.dedicatedAllocation ); + && ( deviceMask == rhs.deviceMask ); } - bool operator!=( DedicatedAllocationBufferCreateInfoNV const& rhs ) const + bool operator!=( DeviceGroupCommandBufferBeginInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDeviceGroupCommandBufferBeginInfo; public: - const void* pNext; - Bool32 dedicatedAllocation; + const void* pNext = nullptr; + uint32_t deviceMask; }; - static_assert( sizeof( DedicatedAllocationBufferCreateInfoNV ) == sizeof( VkDedicatedAllocationBufferCreateInfoNV ), "struct and wrapper have different size!" ); + static_assert( sizeof( DeviceGroupCommandBufferBeginInfo ) == sizeof( VkDeviceGroupCommandBufferBeginInfo ), "struct and wrapper have different size!" ); - struct DedicatedAllocationMemoryAllocateInfoNV + using DeviceGroupCommandBufferBeginInfoKHR = DeviceGroupCommandBufferBeginInfo; + + struct DeviceGroupSubmitInfo { - DedicatedAllocationMemoryAllocateInfoNV( Image image_ = Image(), Buffer buffer_ = Buffer() ) - : sType( StructureType::eDedicatedAllocationMemoryAllocateInfoNV ) - , pNext( nullptr ) - , image( image_ ) - , buffer( buffer_ ) + DeviceGroupSubmitInfo( uint32_t waitSemaphoreCount_ = 0, const uint32_t* pWaitSemaphoreDeviceIndices_ = nullptr, uint32_t commandBufferCount_ = 0, const uint32_t* pCommandBufferDeviceMasks_ = nullptr, uint32_t signalSemaphoreCount_ = 0, const uint32_t* pSignalSemaphoreDeviceIndices_ = nullptr ) + : waitSemaphoreCount( waitSemaphoreCount_ ) + , pWaitSemaphoreDeviceIndices( pWaitSemaphoreDeviceIndices_ ) + , commandBufferCount( commandBufferCount_ ) + , pCommandBufferDeviceMasks( pCommandBufferDeviceMasks_ ) + , signalSemaphoreCount( signalSemaphoreCount_ ) + , pSignalSemaphoreDeviceIndices( pSignalSemaphoreDeviceIndices_ ) { } - DedicatedAllocationMemoryAllocateInfoNV( VkDedicatedAllocationMemoryAllocateInfoNV const & rhs ) + DeviceGroupSubmitInfo( VkDeviceGroupSubmitInfo const & rhs ) { - memcpy( this, &rhs, sizeof( DedicatedAllocationMemoryAllocateInfoNV ) ); + memcpy( this, &rhs, sizeof( DeviceGroupSubmitInfo ) ); } - DedicatedAllocationMemoryAllocateInfoNV& operator=( VkDedicatedAllocationMemoryAllocateInfoNV const & rhs ) + DeviceGroupSubmitInfo& operator=( VkDeviceGroupSubmitInfo const & rhs ) { - memcpy( this, &rhs, sizeof( DedicatedAllocationMemoryAllocateInfoNV ) ); + memcpy( this, &rhs, sizeof( DeviceGroupSubmitInfo ) ); return *this; } - DedicatedAllocationMemoryAllocateInfoNV& setPNext( const void* pNext_ ) + DeviceGroupSubmitInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - DedicatedAllocationMemoryAllocateInfoNV& setImage( Image image_ ) + DeviceGroupSubmitInfo& setWaitSemaphoreCount( uint32_t waitSemaphoreCount_ ) { - image = image_; + waitSemaphoreCount = waitSemaphoreCount_; return *this; } - DedicatedAllocationMemoryAllocateInfoNV& setBuffer( Buffer buffer_ ) + DeviceGroupSubmitInfo& setPWaitSemaphoreDeviceIndices( const uint32_t* pWaitSemaphoreDeviceIndices_ ) { - buffer = buffer_; + pWaitSemaphoreDeviceIndices = pWaitSemaphoreDeviceIndices_; return *this; } - operator const VkDedicatedAllocationMemoryAllocateInfoNV&() const + DeviceGroupSubmitInfo& setCommandBufferCount( uint32_t commandBufferCount_ ) { - return *reinterpret_cast(this); + commandBufferCount = commandBufferCount_; + return *this; } - bool operator==( DedicatedAllocationMemoryAllocateInfoNV const& rhs ) const + DeviceGroupSubmitInfo& setPCommandBufferDeviceMasks( const uint32_t* pCommandBufferDeviceMasks_ ) + { + pCommandBufferDeviceMasks = pCommandBufferDeviceMasks_; + return *this; + } + + DeviceGroupSubmitInfo& setSignalSemaphoreCount( uint32_t signalSemaphoreCount_ ) + { + signalSemaphoreCount = signalSemaphoreCount_; + return *this; + } + + DeviceGroupSubmitInfo& setPSignalSemaphoreDeviceIndices( const uint32_t* pSignalSemaphoreDeviceIndices_ ) + { + pSignalSemaphoreDeviceIndices = pSignalSemaphoreDeviceIndices_; + return *this; + } + + operator const VkDeviceGroupSubmitInfo&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DeviceGroupSubmitInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( image == rhs.image ) - && ( buffer == rhs.buffer ); + && ( waitSemaphoreCount == rhs.waitSemaphoreCount ) + && ( pWaitSemaphoreDeviceIndices == rhs.pWaitSemaphoreDeviceIndices ) + && ( commandBufferCount == rhs.commandBufferCount ) + && ( pCommandBufferDeviceMasks == rhs.pCommandBufferDeviceMasks ) + && ( signalSemaphoreCount == rhs.signalSemaphoreCount ) + && ( pSignalSemaphoreDeviceIndices == rhs.pSignalSemaphoreDeviceIndices ); } - bool operator!=( DedicatedAllocationMemoryAllocateInfoNV const& rhs ) const + bool operator!=( DeviceGroupSubmitInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDeviceGroupSubmitInfo; public: - const void* pNext; - Image image; - Buffer buffer; + const void* pNext = nullptr; + uint32_t waitSemaphoreCount; + const uint32_t* pWaitSemaphoreDeviceIndices; + uint32_t commandBufferCount; + const uint32_t* pCommandBufferDeviceMasks; + uint32_t signalSemaphoreCount; + const uint32_t* pSignalSemaphoreDeviceIndices; }; - static_assert( sizeof( DedicatedAllocationMemoryAllocateInfoNV ) == sizeof( VkDedicatedAllocationMemoryAllocateInfoNV ), "struct and wrapper have different size!" ); + static_assert( sizeof( DeviceGroupSubmitInfo ) == sizeof( VkDeviceGroupSubmitInfo ), "struct and wrapper have different size!" ); -#ifdef VK_USE_PLATFORM_WIN32_KHR - struct ExportMemoryWin32HandleInfoNV + using DeviceGroupSubmitInfoKHR = DeviceGroupSubmitInfo; + + struct DeviceGroupBindSparseInfo { - ExportMemoryWin32HandleInfoNV( const SECURITY_ATTRIBUTES* pAttributes_ = nullptr, DWORD dwAccess_ = 0 ) - : sType( StructureType::eExportMemoryWin32HandleInfoNV ) - , pNext( nullptr ) - , pAttributes( pAttributes_ ) - , dwAccess( dwAccess_ ) + DeviceGroupBindSparseInfo( uint32_t resourceDeviceIndex_ = 0, uint32_t memoryDeviceIndex_ = 0 ) + : resourceDeviceIndex( resourceDeviceIndex_ ) + , memoryDeviceIndex( memoryDeviceIndex_ ) { } - ExportMemoryWin32HandleInfoNV( VkExportMemoryWin32HandleInfoNV const & rhs ) + DeviceGroupBindSparseInfo( VkDeviceGroupBindSparseInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ExportMemoryWin32HandleInfoNV ) ); + memcpy( this, &rhs, sizeof( DeviceGroupBindSparseInfo ) ); } - ExportMemoryWin32HandleInfoNV& operator=( VkExportMemoryWin32HandleInfoNV const & rhs ) + DeviceGroupBindSparseInfo& operator=( VkDeviceGroupBindSparseInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ExportMemoryWin32HandleInfoNV ) ); + memcpy( this, &rhs, sizeof( DeviceGroupBindSparseInfo ) ); return *this; } - ExportMemoryWin32HandleInfoNV& setPNext( const void* pNext_ ) + DeviceGroupBindSparseInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - ExportMemoryWin32HandleInfoNV& setPAttributes( const SECURITY_ATTRIBUTES* pAttributes_ ) + DeviceGroupBindSparseInfo& setResourceDeviceIndex( uint32_t resourceDeviceIndex_ ) { - pAttributes = pAttributes_; + resourceDeviceIndex = resourceDeviceIndex_; return *this; } - ExportMemoryWin32HandleInfoNV& setDwAccess( DWORD dwAccess_ ) + DeviceGroupBindSparseInfo& setMemoryDeviceIndex( uint32_t memoryDeviceIndex_ ) { - dwAccess = dwAccess_; + memoryDeviceIndex = memoryDeviceIndex_; return *this; } - operator const VkExportMemoryWin32HandleInfoNV&() const + operator const VkDeviceGroupBindSparseInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ExportMemoryWin32HandleInfoNV const& rhs ) const + bool operator==( DeviceGroupBindSparseInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( pAttributes == rhs.pAttributes ) - && ( dwAccess == rhs.dwAccess ); + && ( resourceDeviceIndex == rhs.resourceDeviceIndex ) + && ( memoryDeviceIndex == rhs.memoryDeviceIndex ); } - bool operator!=( ExportMemoryWin32HandleInfoNV const& rhs ) const + bool operator!=( DeviceGroupBindSparseInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDeviceGroupBindSparseInfo; public: - const void* pNext; - const SECURITY_ATTRIBUTES* pAttributes; - DWORD dwAccess; + const void* pNext = nullptr; + uint32_t resourceDeviceIndex; + uint32_t memoryDeviceIndex; }; - static_assert( sizeof( ExportMemoryWin32HandleInfoNV ) == sizeof( VkExportMemoryWin32HandleInfoNV ), "struct and wrapper have different size!" ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + static_assert( sizeof( DeviceGroupBindSparseInfo ) == sizeof( VkDeviceGroupBindSparseInfo ), "struct and wrapper have different size!" ); -#ifdef VK_USE_PLATFORM_WIN32_KHR - struct Win32KeyedMutexAcquireReleaseInfoNV + using DeviceGroupBindSparseInfoKHR = DeviceGroupBindSparseInfo; + + struct ImageSwapchainCreateInfoKHR { - Win32KeyedMutexAcquireReleaseInfoNV( uint32_t acquireCount_ = 0, const DeviceMemory* pAcquireSyncs_ = nullptr, const uint64_t* pAcquireKeys_ = nullptr, const uint32_t* pAcquireTimeoutMilliseconds_ = nullptr, uint32_t releaseCount_ = 0, const DeviceMemory* pReleaseSyncs_ = nullptr, const uint64_t* pReleaseKeys_ = nullptr ) - : sType( StructureType::eWin32KeyedMutexAcquireReleaseInfoNV ) - , pNext( nullptr ) - , acquireCount( acquireCount_ ) - , pAcquireSyncs( pAcquireSyncs_ ) - , pAcquireKeys( pAcquireKeys_ ) - , pAcquireTimeoutMilliseconds( pAcquireTimeoutMilliseconds_ ) - , releaseCount( releaseCount_ ) - , pReleaseSyncs( pReleaseSyncs_ ) - , pReleaseKeys( pReleaseKeys_ ) + ImageSwapchainCreateInfoKHR( SwapchainKHR swapchain_ = SwapchainKHR() ) + : swapchain( swapchain_ ) { } - Win32KeyedMutexAcquireReleaseInfoNV( VkWin32KeyedMutexAcquireReleaseInfoNV const & rhs ) + ImageSwapchainCreateInfoKHR( VkImageSwapchainCreateInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( Win32KeyedMutexAcquireReleaseInfoNV ) ); + memcpy( this, &rhs, sizeof( ImageSwapchainCreateInfoKHR ) ); } - Win32KeyedMutexAcquireReleaseInfoNV& operator=( VkWin32KeyedMutexAcquireReleaseInfoNV const & rhs ) + ImageSwapchainCreateInfoKHR& operator=( VkImageSwapchainCreateInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( Win32KeyedMutexAcquireReleaseInfoNV ) ); + memcpy( this, &rhs, sizeof( ImageSwapchainCreateInfoKHR ) ); return *this; } - Win32KeyedMutexAcquireReleaseInfoNV& setPNext( const void* pNext_ ) + ImageSwapchainCreateInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - Win32KeyedMutexAcquireReleaseInfoNV& setAcquireCount( uint32_t acquireCount_ ) + ImageSwapchainCreateInfoKHR& setSwapchain( SwapchainKHR swapchain_ ) { - acquireCount = acquireCount_; + swapchain = swapchain_; return *this; } - Win32KeyedMutexAcquireReleaseInfoNV& setPAcquireSyncs( const DeviceMemory* pAcquireSyncs_ ) + operator const VkImageSwapchainCreateInfoKHR&() const { - pAcquireSyncs = pAcquireSyncs_; - return *this; + return *reinterpret_cast(this); } - Win32KeyedMutexAcquireReleaseInfoNV& setPAcquireKeys( const uint64_t* pAcquireKeys_ ) + bool operator==( ImageSwapchainCreateInfoKHR const& rhs ) const { - pAcquireKeys = pAcquireKeys_; - return *this; + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( swapchain == rhs.swapchain ); } - Win32KeyedMutexAcquireReleaseInfoNV& setPAcquireTimeoutMilliseconds( const uint32_t* pAcquireTimeoutMilliseconds_ ) + bool operator!=( ImageSwapchainCreateInfoKHR const& rhs ) const { - pAcquireTimeoutMilliseconds = pAcquireTimeoutMilliseconds_; - return *this; + return !operator==( rhs ); } - Win32KeyedMutexAcquireReleaseInfoNV& setReleaseCount( uint32_t releaseCount_ ) + private: + StructureType sType = StructureType::eImageSwapchainCreateInfoKHR; + + public: + const void* pNext = nullptr; + SwapchainKHR swapchain; + }; + static_assert( sizeof( ImageSwapchainCreateInfoKHR ) == sizeof( VkImageSwapchainCreateInfoKHR ), "struct and wrapper have different size!" ); + + struct BindImageMemorySwapchainInfoKHR + { + BindImageMemorySwapchainInfoKHR( SwapchainKHR swapchain_ = SwapchainKHR(), uint32_t imageIndex_ = 0 ) + : swapchain( swapchain_ ) + , imageIndex( imageIndex_ ) { - releaseCount = releaseCount_; + } + + BindImageMemorySwapchainInfoKHR( VkBindImageMemorySwapchainInfoKHR const & rhs ) + { + memcpy( this, &rhs, sizeof( BindImageMemorySwapchainInfoKHR ) ); + } + + BindImageMemorySwapchainInfoKHR& operator=( VkBindImageMemorySwapchainInfoKHR const & rhs ) + { + memcpy( this, &rhs, sizeof( BindImageMemorySwapchainInfoKHR ) ); + return *this; + } + BindImageMemorySwapchainInfoKHR& setPNext( const void* pNext_ ) + { + pNext = pNext_; return *this; } - Win32KeyedMutexAcquireReleaseInfoNV& setPReleaseSyncs( const DeviceMemory* pReleaseSyncs_ ) + BindImageMemorySwapchainInfoKHR& setSwapchain( SwapchainKHR swapchain_ ) { - pReleaseSyncs = pReleaseSyncs_; + swapchain = swapchain_; return *this; } - Win32KeyedMutexAcquireReleaseInfoNV& setPReleaseKeys( const uint64_t* pReleaseKeys_ ) + BindImageMemorySwapchainInfoKHR& setImageIndex( uint32_t imageIndex_ ) { - pReleaseKeys = pReleaseKeys_; + imageIndex = imageIndex_; return *this; } - operator const VkWin32KeyedMutexAcquireReleaseInfoNV&() const + operator const VkBindImageMemorySwapchainInfoKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( Win32KeyedMutexAcquireReleaseInfoNV const& rhs ) const + bool operator==( BindImageMemorySwapchainInfoKHR const& rhs ) const { 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 ); + && ( swapchain == rhs.swapchain ) + && ( imageIndex == rhs.imageIndex ); } - bool operator!=( Win32KeyedMutexAcquireReleaseInfoNV const& rhs ) const + bool operator!=( BindImageMemorySwapchainInfoKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eBindImageMemorySwapchainInfoKHR; public: - const void* pNext; - uint32_t acquireCount; - const DeviceMemory* pAcquireSyncs; - const uint64_t* pAcquireKeys; - const uint32_t* pAcquireTimeoutMilliseconds; - uint32_t releaseCount; - const DeviceMemory* pReleaseSyncs; - const uint64_t* pReleaseKeys; + const void* pNext = nullptr; + SwapchainKHR swapchain; + uint32_t imageIndex; }; - static_assert( sizeof( Win32KeyedMutexAcquireReleaseInfoNV ) == sizeof( VkWin32KeyedMutexAcquireReleaseInfoNV ), "struct and wrapper have different size!" ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + static_assert( sizeof( BindImageMemorySwapchainInfoKHR ) == sizeof( VkBindImageMemorySwapchainInfoKHR ), "struct and wrapper have different size!" ); - struct DeviceGeneratedCommandsFeaturesNVX + struct AcquireNextImageInfoKHR { - DeviceGeneratedCommandsFeaturesNVX( Bool32 computeBindingPointSupport_ = 0 ) - : sType( StructureType::eDeviceGeneratedCommandsFeaturesNVX ) - , pNext( nullptr ) - , computeBindingPointSupport( computeBindingPointSupport_ ) + AcquireNextImageInfoKHR( SwapchainKHR swapchain_ = SwapchainKHR(), uint64_t timeout_ = 0, Semaphore semaphore_ = Semaphore(), Fence fence_ = Fence(), uint32_t deviceMask_ = 0 ) + : swapchain( swapchain_ ) + , timeout( timeout_ ) + , semaphore( semaphore_ ) + , fence( fence_ ) + , deviceMask( deviceMask_ ) { } - DeviceGeneratedCommandsFeaturesNVX( VkDeviceGeneratedCommandsFeaturesNVX const & rhs ) + AcquireNextImageInfoKHR( VkAcquireNextImageInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceGeneratedCommandsFeaturesNVX ) ); + memcpy( this, &rhs, sizeof( AcquireNextImageInfoKHR ) ); } - DeviceGeneratedCommandsFeaturesNVX& operator=( VkDeviceGeneratedCommandsFeaturesNVX const & rhs ) + AcquireNextImageInfoKHR& operator=( VkAcquireNextImageInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceGeneratedCommandsFeaturesNVX ) ); + memcpy( this, &rhs, sizeof( AcquireNextImageInfoKHR ) ); return *this; } - DeviceGeneratedCommandsFeaturesNVX& setPNext( const void* pNext_ ) + AcquireNextImageInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - DeviceGeneratedCommandsFeaturesNVX& setComputeBindingPointSupport( Bool32 computeBindingPointSupport_ ) + AcquireNextImageInfoKHR& setSwapchain( SwapchainKHR swapchain_ ) { - computeBindingPointSupport = computeBindingPointSupport_; + swapchain = swapchain_; return *this; } - operator const VkDeviceGeneratedCommandsFeaturesNVX&() const + AcquireNextImageInfoKHR& setTimeout( uint64_t timeout_ ) { - return *reinterpret_cast(this); + timeout = timeout_; + return *this; } - bool operator==( DeviceGeneratedCommandsFeaturesNVX const& rhs ) const + AcquireNextImageInfoKHR& setSemaphore( Semaphore semaphore_ ) + { + semaphore = semaphore_; + return *this; + } + + AcquireNextImageInfoKHR& setFence( Fence fence_ ) + { + fence = fence_; + return *this; + } + + AcquireNextImageInfoKHR& setDeviceMask( uint32_t deviceMask_ ) + { + deviceMask = deviceMask_; + return *this; + } + + operator const VkAcquireNextImageInfoKHR&() const + { + return *reinterpret_cast(this); + } + + bool operator==( AcquireNextImageInfoKHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( computeBindingPointSupport == rhs.computeBindingPointSupport ); + && ( swapchain == rhs.swapchain ) + && ( timeout == rhs.timeout ) + && ( semaphore == rhs.semaphore ) + && ( fence == rhs.fence ) + && ( deviceMask == rhs.deviceMask ); } - bool operator!=( DeviceGeneratedCommandsFeaturesNVX const& rhs ) const + bool operator!=( AcquireNextImageInfoKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eAcquireNextImageInfoKHR; public: - const void* pNext; - Bool32 computeBindingPointSupport; + const void* pNext = nullptr; + SwapchainKHR swapchain; + uint64_t timeout; + Semaphore semaphore; + Fence fence; + uint32_t deviceMask; }; - static_assert( sizeof( DeviceGeneratedCommandsFeaturesNVX ) == sizeof( VkDeviceGeneratedCommandsFeaturesNVX ), "struct and wrapper have different size!" ); + static_assert( sizeof( AcquireNextImageInfoKHR ) == sizeof( VkAcquireNextImageInfoKHR ), "struct and wrapper have different size!" ); - struct DeviceGeneratedCommandsLimitsNVX + struct HdrMetadataEXT { - DeviceGeneratedCommandsLimitsNVX( uint32_t maxIndirectCommandsLayoutTokenCount_ = 0, uint32_t maxObjectEntryCounts_ = 0, uint32_t minSequenceCountBufferOffsetAlignment_ = 0, uint32_t minSequenceIndexBufferOffsetAlignment_ = 0, uint32_t minCommandsTokenBufferOffsetAlignment_ = 0 ) - : sType( StructureType::eDeviceGeneratedCommandsLimitsNVX ) - , pNext( nullptr ) - , maxIndirectCommandsLayoutTokenCount( maxIndirectCommandsLayoutTokenCount_ ) - , maxObjectEntryCounts( maxObjectEntryCounts_ ) - , minSequenceCountBufferOffsetAlignment( minSequenceCountBufferOffsetAlignment_ ) - , minSequenceIndexBufferOffsetAlignment( minSequenceIndexBufferOffsetAlignment_ ) - , minCommandsTokenBufferOffsetAlignment( minCommandsTokenBufferOffsetAlignment_ ) + HdrMetadataEXT( XYColorEXT displayPrimaryRed_ = XYColorEXT(), XYColorEXT displayPrimaryGreen_ = XYColorEXT(), XYColorEXT displayPrimaryBlue_ = XYColorEXT(), XYColorEXT whitePoint_ = XYColorEXT(), float maxLuminance_ = 0, float minLuminance_ = 0, float maxContentLightLevel_ = 0, float maxFrameAverageLightLevel_ = 0 ) + : displayPrimaryRed( displayPrimaryRed_ ) + , displayPrimaryGreen( displayPrimaryGreen_ ) + , displayPrimaryBlue( displayPrimaryBlue_ ) + , whitePoint( whitePoint_ ) + , maxLuminance( maxLuminance_ ) + , minLuminance( minLuminance_ ) + , maxContentLightLevel( maxContentLightLevel_ ) + , maxFrameAverageLightLevel( maxFrameAverageLightLevel_ ) { } - DeviceGeneratedCommandsLimitsNVX( VkDeviceGeneratedCommandsLimitsNVX const & rhs ) + HdrMetadataEXT( VkHdrMetadataEXT const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceGeneratedCommandsLimitsNVX ) ); + memcpy( this, &rhs, sizeof( HdrMetadataEXT ) ); } - DeviceGeneratedCommandsLimitsNVX& operator=( VkDeviceGeneratedCommandsLimitsNVX const & rhs ) + HdrMetadataEXT& operator=( VkHdrMetadataEXT const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceGeneratedCommandsLimitsNVX ) ); + memcpy( this, &rhs, sizeof( HdrMetadataEXT ) ); return *this; } - DeviceGeneratedCommandsLimitsNVX& setPNext( const void* pNext_ ) + HdrMetadataEXT& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - DeviceGeneratedCommandsLimitsNVX& setMaxIndirectCommandsLayoutTokenCount( uint32_t maxIndirectCommandsLayoutTokenCount_ ) + HdrMetadataEXT& setDisplayPrimaryRed( XYColorEXT displayPrimaryRed_ ) { - maxIndirectCommandsLayoutTokenCount = maxIndirectCommandsLayoutTokenCount_; + displayPrimaryRed = displayPrimaryRed_; return *this; } - DeviceGeneratedCommandsLimitsNVX& setMaxObjectEntryCounts( uint32_t maxObjectEntryCounts_ ) + HdrMetadataEXT& setDisplayPrimaryGreen( XYColorEXT displayPrimaryGreen_ ) { - maxObjectEntryCounts = maxObjectEntryCounts_; + displayPrimaryGreen = displayPrimaryGreen_; return *this; } - DeviceGeneratedCommandsLimitsNVX& setMinSequenceCountBufferOffsetAlignment( uint32_t minSequenceCountBufferOffsetAlignment_ ) + HdrMetadataEXT& setDisplayPrimaryBlue( XYColorEXT displayPrimaryBlue_ ) { - minSequenceCountBufferOffsetAlignment = minSequenceCountBufferOffsetAlignment_; + displayPrimaryBlue = displayPrimaryBlue_; return *this; } - DeviceGeneratedCommandsLimitsNVX& setMinSequenceIndexBufferOffsetAlignment( uint32_t minSequenceIndexBufferOffsetAlignment_ ) + HdrMetadataEXT& setWhitePoint( XYColorEXT whitePoint_ ) { - minSequenceIndexBufferOffsetAlignment = minSequenceIndexBufferOffsetAlignment_; + whitePoint = whitePoint_; return *this; } - DeviceGeneratedCommandsLimitsNVX& setMinCommandsTokenBufferOffsetAlignment( uint32_t minCommandsTokenBufferOffsetAlignment_ ) + HdrMetadataEXT& setMaxLuminance( float maxLuminance_ ) { - minCommandsTokenBufferOffsetAlignment = minCommandsTokenBufferOffsetAlignment_; + maxLuminance = maxLuminance_; return *this; } - operator const VkDeviceGeneratedCommandsLimitsNVX&() const + HdrMetadataEXT& setMinLuminance( float minLuminance_ ) { - return *reinterpret_cast(this); + minLuminance = minLuminance_; + return *this; } - bool operator==( DeviceGeneratedCommandsLimitsNVX const& rhs ) const + HdrMetadataEXT& setMaxContentLightLevel( float maxContentLightLevel_ ) + { + maxContentLightLevel = maxContentLightLevel_; + return *this; + } + + HdrMetadataEXT& setMaxFrameAverageLightLevel( float maxFrameAverageLightLevel_ ) + { + maxFrameAverageLightLevel = maxFrameAverageLightLevel_; + return *this; + } + + operator const VkHdrMetadataEXT&() const + { + return *reinterpret_cast(this); + } + + bool operator==( HdrMetadataEXT const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( maxIndirectCommandsLayoutTokenCount == rhs.maxIndirectCommandsLayoutTokenCount ) - && ( maxObjectEntryCounts == rhs.maxObjectEntryCounts ) - && ( minSequenceCountBufferOffsetAlignment == rhs.minSequenceCountBufferOffsetAlignment ) - && ( minSequenceIndexBufferOffsetAlignment == rhs.minSequenceIndexBufferOffsetAlignment ) - && ( minCommandsTokenBufferOffsetAlignment == rhs.minCommandsTokenBufferOffsetAlignment ); + && ( displayPrimaryRed == rhs.displayPrimaryRed ) + && ( displayPrimaryGreen == rhs.displayPrimaryGreen ) + && ( displayPrimaryBlue == rhs.displayPrimaryBlue ) + && ( whitePoint == rhs.whitePoint ) + && ( maxLuminance == rhs.maxLuminance ) + && ( minLuminance == rhs.minLuminance ) + && ( maxContentLightLevel == rhs.maxContentLightLevel ) + && ( maxFrameAverageLightLevel == rhs.maxFrameAverageLightLevel ); } - bool operator!=( DeviceGeneratedCommandsLimitsNVX const& rhs ) const + bool operator!=( HdrMetadataEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eHdrMetadataEXT; public: - const void* pNext; - uint32_t maxIndirectCommandsLayoutTokenCount; - uint32_t maxObjectEntryCounts; - uint32_t minSequenceCountBufferOffsetAlignment; - uint32_t minSequenceIndexBufferOffsetAlignment; - uint32_t minCommandsTokenBufferOffsetAlignment; + const void* pNext = nullptr; + XYColorEXT displayPrimaryRed; + XYColorEXT displayPrimaryGreen; + XYColorEXT displayPrimaryBlue; + XYColorEXT whitePoint; + float maxLuminance; + float minLuminance; + float maxContentLightLevel; + float maxFrameAverageLightLevel; }; - static_assert( sizeof( DeviceGeneratedCommandsLimitsNVX ) == sizeof( VkDeviceGeneratedCommandsLimitsNVX ), "struct and wrapper have different size!" ); + static_assert( sizeof( HdrMetadataEXT ) == sizeof( VkHdrMetadataEXT ), "struct and wrapper have different size!" ); - struct CmdReserveSpaceForCommandsInfoNVX + struct PresentTimesInfoGOOGLE { - CmdReserveSpaceForCommandsInfoNVX( ObjectTableNVX objectTable_ = ObjectTableNVX(), IndirectCommandsLayoutNVX indirectCommandsLayout_ = IndirectCommandsLayoutNVX(), uint32_t maxSequencesCount_ = 0 ) - : sType( StructureType::eCmdReserveSpaceForCommandsInfoNVX ) - , pNext( nullptr ) - , objectTable( objectTable_ ) - , indirectCommandsLayout( indirectCommandsLayout_ ) - , maxSequencesCount( maxSequencesCount_ ) + PresentTimesInfoGOOGLE( uint32_t swapchainCount_ = 0, const PresentTimeGOOGLE* pTimes_ = nullptr ) + : swapchainCount( swapchainCount_ ) + , pTimes( pTimes_ ) { } - CmdReserveSpaceForCommandsInfoNVX( VkCmdReserveSpaceForCommandsInfoNVX const & rhs ) + PresentTimesInfoGOOGLE( VkPresentTimesInfoGOOGLE const & rhs ) { - memcpy( this, &rhs, sizeof( CmdReserveSpaceForCommandsInfoNVX ) ); + memcpy( this, &rhs, sizeof( PresentTimesInfoGOOGLE ) ); } - CmdReserveSpaceForCommandsInfoNVX& operator=( VkCmdReserveSpaceForCommandsInfoNVX const & rhs ) + PresentTimesInfoGOOGLE& operator=( VkPresentTimesInfoGOOGLE const & rhs ) { - memcpy( this, &rhs, sizeof( CmdReserveSpaceForCommandsInfoNVX ) ); + memcpy( this, &rhs, sizeof( PresentTimesInfoGOOGLE ) ); return *this; } - CmdReserveSpaceForCommandsInfoNVX& setPNext( const void* pNext_ ) + PresentTimesInfoGOOGLE& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - CmdReserveSpaceForCommandsInfoNVX& setObjectTable( ObjectTableNVX objectTable_ ) - { - objectTable = objectTable_; - return *this; - } - - CmdReserveSpaceForCommandsInfoNVX& setIndirectCommandsLayout( IndirectCommandsLayoutNVX indirectCommandsLayout_ ) + PresentTimesInfoGOOGLE& setSwapchainCount( uint32_t swapchainCount_ ) { - indirectCommandsLayout = indirectCommandsLayout_; + swapchainCount = swapchainCount_; return *this; } - CmdReserveSpaceForCommandsInfoNVX& setMaxSequencesCount( uint32_t maxSequencesCount_ ) + PresentTimesInfoGOOGLE& setPTimes( const PresentTimeGOOGLE* pTimes_ ) { - maxSequencesCount = maxSequencesCount_; + pTimes = pTimes_; return *this; } - operator const VkCmdReserveSpaceForCommandsInfoNVX&() const + operator const VkPresentTimesInfoGOOGLE&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( CmdReserveSpaceForCommandsInfoNVX const& rhs ) const + bool operator==( PresentTimesInfoGOOGLE const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( objectTable == rhs.objectTable ) - && ( indirectCommandsLayout == rhs.indirectCommandsLayout ) - && ( maxSequencesCount == rhs.maxSequencesCount ); + && ( swapchainCount == rhs.swapchainCount ) + && ( pTimes == rhs.pTimes ); } - bool operator!=( CmdReserveSpaceForCommandsInfoNVX const& rhs ) const + bool operator!=( PresentTimesInfoGOOGLE const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePresentTimesInfoGOOGLE; public: - const void* pNext; - ObjectTableNVX objectTable; - IndirectCommandsLayoutNVX indirectCommandsLayout; - uint32_t maxSequencesCount; + const void* pNext = nullptr; + uint32_t swapchainCount; + const PresentTimeGOOGLE* pTimes; }; - static_assert( sizeof( CmdReserveSpaceForCommandsInfoNVX ) == sizeof( VkCmdReserveSpaceForCommandsInfoNVX ), "struct and wrapper have different size!" ); + static_assert( sizeof( PresentTimesInfoGOOGLE ) == sizeof( VkPresentTimesInfoGOOGLE ), "struct and wrapper have different size!" ); - struct PhysicalDeviceFeatures2KHR +#ifdef VK_USE_PLATFORM_IOS_MVK + struct IOSSurfaceCreateInfoMVK { - PhysicalDeviceFeatures2KHR( PhysicalDeviceFeatures features_ = PhysicalDeviceFeatures() ) - : sType( StructureType::ePhysicalDeviceFeatures2KHR ) - , pNext( nullptr ) - , features( features_ ) + IOSSurfaceCreateInfoMVK( IOSSurfaceCreateFlagsMVK flags_ = IOSSurfaceCreateFlagsMVK(), const void* pView_ = nullptr ) + : flags( flags_ ) + , pView( pView_ ) { } - PhysicalDeviceFeatures2KHR( VkPhysicalDeviceFeatures2KHR const & rhs ) + IOSSurfaceCreateInfoMVK( VkIOSSurfaceCreateInfoMVK const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceFeatures2KHR ) ); + memcpy( this, &rhs, sizeof( IOSSurfaceCreateInfoMVK ) ); } - PhysicalDeviceFeatures2KHR& operator=( VkPhysicalDeviceFeatures2KHR const & rhs ) + IOSSurfaceCreateInfoMVK& operator=( VkIOSSurfaceCreateInfoMVK const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceFeatures2KHR ) ); + memcpy( this, &rhs, sizeof( IOSSurfaceCreateInfoMVK ) ); return *this; } - PhysicalDeviceFeatures2KHR& setPNext( void* pNext_ ) + IOSSurfaceCreateInfoMVK& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PhysicalDeviceFeatures2KHR& setFeatures( PhysicalDeviceFeatures features_ ) + IOSSurfaceCreateInfoMVK& setFlags( IOSSurfaceCreateFlagsMVK flags_ ) { - features = features_; + flags = flags_; + return *this; + } + + IOSSurfaceCreateInfoMVK& setPView( const void* pView_ ) + { + pView = pView_; return *this; } - operator const VkPhysicalDeviceFeatures2KHR&() const + operator const VkIOSSurfaceCreateInfoMVK&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceFeatures2KHR const& rhs ) const + bool operator==( IOSSurfaceCreateInfoMVK const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( features == rhs.features ); + && ( flags == rhs.flags ) + && ( pView == rhs.pView ); } - bool operator!=( PhysicalDeviceFeatures2KHR const& rhs ) const + bool operator!=( IOSSurfaceCreateInfoMVK const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eIosSurfaceCreateInfoMVK; public: - void* pNext; - PhysicalDeviceFeatures features; + const void* pNext = nullptr; + IOSSurfaceCreateFlagsMVK flags; + const void* pView; }; - static_assert( sizeof( PhysicalDeviceFeatures2KHR ) == sizeof( VkPhysicalDeviceFeatures2KHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( IOSSurfaceCreateInfoMVK ) == sizeof( VkIOSSurfaceCreateInfoMVK ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_IOS_MVK*/ - struct PhysicalDevicePushDescriptorPropertiesKHR +#ifdef VK_USE_PLATFORM_MACOS_MVK + struct MacOSSurfaceCreateInfoMVK { - PhysicalDevicePushDescriptorPropertiesKHR( uint32_t maxPushDescriptors_ = 0 ) - : sType( StructureType::ePhysicalDevicePushDescriptorPropertiesKHR ) - , pNext( nullptr ) - , maxPushDescriptors( maxPushDescriptors_ ) + MacOSSurfaceCreateInfoMVK( MacOSSurfaceCreateFlagsMVK flags_ = MacOSSurfaceCreateFlagsMVK(), const void* pView_ = nullptr ) + : flags( flags_ ) + , pView( pView_ ) { } - PhysicalDevicePushDescriptorPropertiesKHR( VkPhysicalDevicePushDescriptorPropertiesKHR const & rhs ) + MacOSSurfaceCreateInfoMVK( VkMacOSSurfaceCreateInfoMVK const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDevicePushDescriptorPropertiesKHR ) ); + memcpy( this, &rhs, sizeof( MacOSSurfaceCreateInfoMVK ) ); } - PhysicalDevicePushDescriptorPropertiesKHR& operator=( VkPhysicalDevicePushDescriptorPropertiesKHR const & rhs ) + MacOSSurfaceCreateInfoMVK& operator=( VkMacOSSurfaceCreateInfoMVK const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDevicePushDescriptorPropertiesKHR ) ); + memcpy( this, &rhs, sizeof( MacOSSurfaceCreateInfoMVK ) ); return *this; } - PhysicalDevicePushDescriptorPropertiesKHR& setPNext( void* pNext_ ) + MacOSSurfaceCreateInfoMVK& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PhysicalDevicePushDescriptorPropertiesKHR& setMaxPushDescriptors( uint32_t maxPushDescriptors_ ) + MacOSSurfaceCreateInfoMVK& setFlags( MacOSSurfaceCreateFlagsMVK flags_ ) + { + flags = flags_; + return *this; + } + + MacOSSurfaceCreateInfoMVK& setPView( const void* pView_ ) { - maxPushDescriptors = maxPushDescriptors_; + pView = pView_; return *this; } - operator const VkPhysicalDevicePushDescriptorPropertiesKHR&() const + operator const VkMacOSSurfaceCreateInfoMVK&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDevicePushDescriptorPropertiesKHR const& rhs ) const + bool operator==( MacOSSurfaceCreateInfoMVK const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( maxPushDescriptors == rhs.maxPushDescriptors ); + && ( flags == rhs.flags ) + && ( pView == rhs.pView ); } - bool operator!=( PhysicalDevicePushDescriptorPropertiesKHR const& rhs ) const + bool operator!=( MacOSSurfaceCreateInfoMVK const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eMacosSurfaceCreateInfoMVK; public: - void* pNext; - uint32_t maxPushDescriptors; + const void* pNext = nullptr; + MacOSSurfaceCreateFlagsMVK flags; + const void* pView; }; - static_assert( sizeof( PhysicalDevicePushDescriptorPropertiesKHR ) == sizeof( VkPhysicalDevicePushDescriptorPropertiesKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( MacOSSurfaceCreateInfoMVK ) == sizeof( VkMacOSSurfaceCreateInfoMVK ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ - struct PresentRegionsKHR + struct PipelineViewportWScalingStateCreateInfoNV { - PresentRegionsKHR( uint32_t swapchainCount_ = 0, const PresentRegionKHR* pRegions_ = nullptr ) - : sType( StructureType::ePresentRegionsKHR ) - , pNext( nullptr ) - , swapchainCount( swapchainCount_ ) - , pRegions( pRegions_ ) + PipelineViewportWScalingStateCreateInfoNV( Bool32 viewportWScalingEnable_ = 0, uint32_t viewportCount_ = 0, const ViewportWScalingNV* pViewportWScalings_ = nullptr ) + : viewportWScalingEnable( viewportWScalingEnable_ ) + , viewportCount( viewportCount_ ) + , pViewportWScalings( pViewportWScalings_ ) { } - PresentRegionsKHR( VkPresentRegionsKHR const & rhs ) + PipelineViewportWScalingStateCreateInfoNV( VkPipelineViewportWScalingStateCreateInfoNV const & rhs ) { - memcpy( this, &rhs, sizeof( PresentRegionsKHR ) ); + memcpy( this, &rhs, sizeof( PipelineViewportWScalingStateCreateInfoNV ) ); } - PresentRegionsKHR& operator=( VkPresentRegionsKHR const & rhs ) + PipelineViewportWScalingStateCreateInfoNV& operator=( VkPipelineViewportWScalingStateCreateInfoNV const & rhs ) { - memcpy( this, &rhs, sizeof( PresentRegionsKHR ) ); + memcpy( this, &rhs, sizeof( PipelineViewportWScalingStateCreateInfoNV ) ); return *this; } - PresentRegionsKHR& setPNext( const void* pNext_ ) + PipelineViewportWScalingStateCreateInfoNV& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PresentRegionsKHR& setSwapchainCount( uint32_t swapchainCount_ ) + PipelineViewportWScalingStateCreateInfoNV& setViewportWScalingEnable( Bool32 viewportWScalingEnable_ ) { - swapchainCount = swapchainCount_; + viewportWScalingEnable = viewportWScalingEnable_; return *this; } - PresentRegionsKHR& setPRegions( const PresentRegionKHR* pRegions_ ) + PipelineViewportWScalingStateCreateInfoNV& setViewportCount( uint32_t viewportCount_ ) { - pRegions = pRegions_; + viewportCount = viewportCount_; return *this; } - operator const VkPresentRegionsKHR&() const + PipelineViewportWScalingStateCreateInfoNV& setPViewportWScalings( const ViewportWScalingNV* pViewportWScalings_ ) { - return *reinterpret_cast(this); + pViewportWScalings = pViewportWScalings_; + return *this; } - bool operator==( PresentRegionsKHR const& rhs ) const + operator const VkPipelineViewportWScalingStateCreateInfoNV&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PipelineViewportWScalingStateCreateInfoNV const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( swapchainCount == rhs.swapchainCount ) - && ( pRegions == rhs.pRegions ); + && ( viewportWScalingEnable == rhs.viewportWScalingEnable ) + && ( viewportCount == rhs.viewportCount ) + && ( pViewportWScalings == rhs.pViewportWScalings ); } - bool operator!=( PresentRegionsKHR const& rhs ) const + bool operator!=( PipelineViewportWScalingStateCreateInfoNV const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePipelineViewportWScalingStateCreateInfoNV; public: - const void* pNext; - uint32_t swapchainCount; - const PresentRegionKHR* pRegions; + const void* pNext = nullptr; + Bool32 viewportWScalingEnable; + uint32_t viewportCount; + const ViewportWScalingNV* pViewportWScalings; }; - static_assert( sizeof( PresentRegionsKHR ) == sizeof( VkPresentRegionsKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PipelineViewportWScalingStateCreateInfoNV ) == sizeof( VkPipelineViewportWScalingStateCreateInfoNV ), "struct and wrapper have different size!" ); - struct PhysicalDeviceVariablePointerFeaturesKHR + struct PhysicalDeviceDiscardRectanglePropertiesEXT { - PhysicalDeviceVariablePointerFeaturesKHR( Bool32 variablePointersStorageBuffer_ = 0, Bool32 variablePointers_ = 0 ) - : sType( StructureType::ePhysicalDeviceVariablePointerFeaturesKHR ) - , pNext( nullptr ) - , variablePointersStorageBuffer( variablePointersStorageBuffer_ ) - , variablePointers( variablePointers_ ) + PhysicalDeviceDiscardRectanglePropertiesEXT( uint32_t maxDiscardRectangles_ = 0 ) + : maxDiscardRectangles( maxDiscardRectangles_ ) { } - PhysicalDeviceVariablePointerFeaturesKHR( VkPhysicalDeviceVariablePointerFeaturesKHR const & rhs ) + PhysicalDeviceDiscardRectanglePropertiesEXT( VkPhysicalDeviceDiscardRectanglePropertiesEXT const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceVariablePointerFeaturesKHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceDiscardRectanglePropertiesEXT ) ); } - PhysicalDeviceVariablePointerFeaturesKHR& operator=( VkPhysicalDeviceVariablePointerFeaturesKHR const & rhs ) + PhysicalDeviceDiscardRectanglePropertiesEXT& operator=( VkPhysicalDeviceDiscardRectanglePropertiesEXT const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceVariablePointerFeaturesKHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceDiscardRectanglePropertiesEXT ) ); return *this; } - PhysicalDeviceVariablePointerFeaturesKHR& setPNext( void* pNext_ ) + PhysicalDeviceDiscardRectanglePropertiesEXT& setPNext( void* pNext_ ) { pNext = pNext_; return *this; } - PhysicalDeviceVariablePointerFeaturesKHR& setVariablePointersStorageBuffer( Bool32 variablePointersStorageBuffer_ ) - { - variablePointersStorageBuffer = variablePointersStorageBuffer_; - return *this; - } - - PhysicalDeviceVariablePointerFeaturesKHR& setVariablePointers( Bool32 variablePointers_ ) + PhysicalDeviceDiscardRectanglePropertiesEXT& setMaxDiscardRectangles( uint32_t maxDiscardRectangles_ ) { - variablePointers = variablePointers_; + maxDiscardRectangles = maxDiscardRectangles_; return *this; } - operator const VkPhysicalDeviceVariablePointerFeaturesKHR&() const + operator const VkPhysicalDeviceDiscardRectanglePropertiesEXT&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceVariablePointerFeaturesKHR const& rhs ) const + bool operator==( PhysicalDeviceDiscardRectanglePropertiesEXT const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( variablePointersStorageBuffer == rhs.variablePointersStorageBuffer ) - && ( variablePointers == rhs.variablePointers ); + && ( maxDiscardRectangles == rhs.maxDiscardRectangles ); } - bool operator!=( PhysicalDeviceVariablePointerFeaturesKHR const& rhs ) const + bool operator!=( PhysicalDeviceDiscardRectanglePropertiesEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceDiscardRectanglePropertiesEXT; public: - void* pNext; - Bool32 variablePointersStorageBuffer; - Bool32 variablePointers; + void* pNext = nullptr; + uint32_t maxDiscardRectangles; }; - static_assert( sizeof( PhysicalDeviceVariablePointerFeaturesKHR ) == sizeof( VkPhysicalDeviceVariablePointerFeaturesKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceDiscardRectanglePropertiesEXT ) == sizeof( VkPhysicalDeviceDiscardRectanglePropertiesEXT ), "struct and wrapper have different size!" ); - struct PhysicalDeviceIDPropertiesKHR + struct PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX { - operator const VkPhysicalDeviceIDPropertiesKHR&() const + operator const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceIDPropertiesKHR const& rhs ) const + bool operator==( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( memcmp( deviceUUID, rhs.deviceUUID, VK_UUID_SIZE * sizeof( uint8_t ) ) == 0 ) - && ( memcmp( driverUUID, rhs.driverUUID, VK_UUID_SIZE * sizeof( uint8_t ) ) == 0 ) - && ( memcmp( deviceLUID, rhs.deviceLUID, VK_LUID_SIZE_KHR * sizeof( uint8_t ) ) == 0 ) - && ( deviceNodeMask == rhs.deviceNodeMask ) - && ( deviceLUIDValid == rhs.deviceLUIDValid ); + && ( perViewPositionAllComponents == rhs.perViewPositionAllComponents ); } - bool operator!=( PhysicalDeviceIDPropertiesKHR const& rhs ) const + bool operator!=( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceMultiviewPerViewAttributesPropertiesNVX; public: - void* pNext; - uint8_t deviceUUID[VK_UUID_SIZE]; - uint8_t driverUUID[VK_UUID_SIZE]; - uint8_t deviceLUID[VK_LUID_SIZE_KHR]; - uint32_t deviceNodeMask; - Bool32 deviceLUIDValid; + void* pNext = nullptr; + Bool32 perViewPositionAllComponents; }; - static_assert( sizeof( PhysicalDeviceIDPropertiesKHR ) == sizeof( VkPhysicalDeviceIDPropertiesKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX ) == sizeof( VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX ), "struct and wrapper have different size!" ); -#ifdef VK_USE_PLATFORM_WIN32_KHR - struct ExportMemoryWin32HandleInfoKHR + struct PhysicalDeviceSurfaceInfo2KHR { - ExportMemoryWin32HandleInfoKHR( const SECURITY_ATTRIBUTES* pAttributes_ = nullptr, DWORD dwAccess_ = 0, LPCWSTR name_ = 0 ) - : sType( StructureType::eExportMemoryWin32HandleInfoKHR ) - , pNext( nullptr ) - , pAttributes( pAttributes_ ) - , dwAccess( dwAccess_ ) - , name( name_ ) + PhysicalDeviceSurfaceInfo2KHR( SurfaceKHR surface_ = SurfaceKHR() ) + : surface( surface_ ) { } - ExportMemoryWin32HandleInfoKHR( VkExportMemoryWin32HandleInfoKHR const & rhs ) + PhysicalDeviceSurfaceInfo2KHR( VkPhysicalDeviceSurfaceInfo2KHR const & rhs ) { - memcpy( this, &rhs, sizeof( ExportMemoryWin32HandleInfoKHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceSurfaceInfo2KHR ) ); } - ExportMemoryWin32HandleInfoKHR& operator=( VkExportMemoryWin32HandleInfoKHR const & rhs ) + PhysicalDeviceSurfaceInfo2KHR& operator=( VkPhysicalDeviceSurfaceInfo2KHR const & rhs ) { - memcpy( this, &rhs, sizeof( ExportMemoryWin32HandleInfoKHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceSurfaceInfo2KHR ) ); return *this; } - ExportMemoryWin32HandleInfoKHR& setPNext( const void* pNext_ ) + PhysicalDeviceSurfaceInfo2KHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - ExportMemoryWin32HandleInfoKHR& setPAttributes( const SECURITY_ATTRIBUTES* pAttributes_ ) - { - pAttributes = pAttributes_; - return *this; - } - - ExportMemoryWin32HandleInfoKHR& setDwAccess( DWORD dwAccess_ ) - { - dwAccess = dwAccess_; - return *this; - } - - ExportMemoryWin32HandleInfoKHR& setName( LPCWSTR name_ ) + PhysicalDeviceSurfaceInfo2KHR& setSurface( SurfaceKHR surface_ ) { - name = name_; + surface = surface_; return *this; } - operator const VkExportMemoryWin32HandleInfoKHR&() const + operator const VkPhysicalDeviceSurfaceInfo2KHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ExportMemoryWin32HandleInfoKHR const& rhs ) const + bool operator==( PhysicalDeviceSurfaceInfo2KHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( pAttributes == rhs.pAttributes ) - && ( dwAccess == rhs.dwAccess ) - && ( name == rhs.name ); + && ( surface == rhs.surface ); } - bool operator!=( ExportMemoryWin32HandleInfoKHR const& rhs ) const + bool operator!=( PhysicalDeviceSurfaceInfo2KHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceSurfaceInfo2KHR; public: - const void* pNext; - const SECURITY_ATTRIBUTES* pAttributes; - DWORD dwAccess; - LPCWSTR name; + const void* pNext = nullptr; + SurfaceKHR surface; }; - static_assert( sizeof( ExportMemoryWin32HandleInfoKHR ) == sizeof( VkExportMemoryWin32HandleInfoKHR ), "struct and wrapper have different size!" ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + static_assert( sizeof( PhysicalDeviceSurfaceInfo2KHR ) == sizeof( VkPhysicalDeviceSurfaceInfo2KHR ), "struct and wrapper have different size!" ); -#ifdef VK_USE_PLATFORM_WIN32_KHR - struct MemoryWin32HandlePropertiesKHR + struct PhysicalDevice16BitStorageFeatures { - operator const VkMemoryWin32HandlePropertiesKHR&() const + PhysicalDevice16BitStorageFeatures( Bool32 storageBuffer16BitAccess_ = 0, Bool32 uniformAndStorageBuffer16BitAccess_ = 0, Bool32 storagePushConstant16_ = 0, Bool32 storageInputOutput16_ = 0 ) + : storageBuffer16BitAccess( storageBuffer16BitAccess_ ) + , uniformAndStorageBuffer16BitAccess( uniformAndStorageBuffer16BitAccess_ ) + , storagePushConstant16( storagePushConstant16_ ) + , storageInputOutput16( storageInputOutput16_ ) { - return *reinterpret_cast(this); } - bool operator==( MemoryWin32HandlePropertiesKHR const& rhs ) const + PhysicalDevice16BitStorageFeatures( VkPhysicalDevice16BitStorageFeatures const & rhs ) { - return ( sType == rhs.sType ) - && ( pNext == rhs.pNext ) - && ( memoryTypeBits == rhs.memoryTypeBits ); + memcpy( this, &rhs, sizeof( PhysicalDevice16BitStorageFeatures ) ); } - bool operator!=( MemoryWin32HandlePropertiesKHR const& rhs ) const + PhysicalDevice16BitStorageFeatures& operator=( VkPhysicalDevice16BitStorageFeatures const & rhs ) { - return !operator==( rhs ); + memcpy( this, &rhs, sizeof( PhysicalDevice16BitStorageFeatures ) ); + return *this; + } + PhysicalDevice16BitStorageFeatures& setPNext( void* pNext_ ) + { + pNext = pNext_; + return *this; } - private: - StructureType sType; + PhysicalDevice16BitStorageFeatures& setStorageBuffer16BitAccess( Bool32 storageBuffer16BitAccess_ ) + { + storageBuffer16BitAccess = storageBuffer16BitAccess_; + return *this; + } - public: - void* pNext; - uint32_t memoryTypeBits; - }; - static_assert( sizeof( MemoryWin32HandlePropertiesKHR ) == sizeof( VkMemoryWin32HandlePropertiesKHR ), "struct and wrapper have different size!" ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + PhysicalDevice16BitStorageFeatures& setUniformAndStorageBuffer16BitAccess( Bool32 uniformAndStorageBuffer16BitAccess_ ) + { + uniformAndStorageBuffer16BitAccess = uniformAndStorageBuffer16BitAccess_; + return *this; + } - struct MemoryFdPropertiesKHR - { - operator const VkMemoryFdPropertiesKHR&() const + PhysicalDevice16BitStorageFeatures& setStoragePushConstant16( Bool32 storagePushConstant16_ ) { - return *reinterpret_cast(this); + storagePushConstant16 = storagePushConstant16_; + return *this; } - bool operator==( MemoryFdPropertiesKHR const& rhs ) const + PhysicalDevice16BitStorageFeatures& setStorageInputOutput16( Bool32 storageInputOutput16_ ) + { + storageInputOutput16 = storageInputOutput16_; + return *this; + } + + operator const VkPhysicalDevice16BitStorageFeatures&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PhysicalDevice16BitStorageFeatures const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( memoryTypeBits == rhs.memoryTypeBits ); + && ( storageBuffer16BitAccess == rhs.storageBuffer16BitAccess ) + && ( uniformAndStorageBuffer16BitAccess == rhs.uniformAndStorageBuffer16BitAccess ) + && ( storagePushConstant16 == rhs.storagePushConstant16 ) + && ( storageInputOutput16 == rhs.storageInputOutput16 ); } - bool operator!=( MemoryFdPropertiesKHR const& rhs ) const + bool operator!=( PhysicalDevice16BitStorageFeatures const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDevice16BitStorageFeatures; public: - void* pNext; - uint32_t memoryTypeBits; + void* pNext = nullptr; + Bool32 storageBuffer16BitAccess; + Bool32 uniformAndStorageBuffer16BitAccess; + Bool32 storagePushConstant16; + Bool32 storageInputOutput16; }; - static_assert( sizeof( MemoryFdPropertiesKHR ) == sizeof( VkMemoryFdPropertiesKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDevice16BitStorageFeatures ) == sizeof( VkPhysicalDevice16BitStorageFeatures ), "struct and wrapper have different size!" ); -#ifdef VK_USE_PLATFORM_WIN32_KHR - struct Win32KeyedMutexAcquireReleaseInfoKHR + using PhysicalDevice16BitStorageFeaturesKHR = PhysicalDevice16BitStorageFeatures; + + struct BufferMemoryRequirementsInfo2 { - Win32KeyedMutexAcquireReleaseInfoKHR( uint32_t acquireCount_ = 0, const DeviceMemory* pAcquireSyncs_ = nullptr, const uint64_t* pAcquireKeys_ = nullptr, const uint32_t* pAcquireTimeouts_ = nullptr, uint32_t releaseCount_ = 0, const DeviceMemory* pReleaseSyncs_ = nullptr, const uint64_t* pReleaseKeys_ = nullptr ) - : sType( StructureType::eWin32KeyedMutexAcquireReleaseInfoKHR ) - , pNext( nullptr ) - , acquireCount( acquireCount_ ) - , pAcquireSyncs( pAcquireSyncs_ ) - , pAcquireKeys( pAcquireKeys_ ) - , pAcquireTimeouts( pAcquireTimeouts_ ) - , releaseCount( releaseCount_ ) - , pReleaseSyncs( pReleaseSyncs_ ) - , pReleaseKeys( pReleaseKeys_ ) + BufferMemoryRequirementsInfo2( Buffer buffer_ = Buffer() ) + : buffer( buffer_ ) { } - Win32KeyedMutexAcquireReleaseInfoKHR( VkWin32KeyedMutexAcquireReleaseInfoKHR const & rhs ) + BufferMemoryRequirementsInfo2( VkBufferMemoryRequirementsInfo2 const & rhs ) { - memcpy( this, &rhs, sizeof( Win32KeyedMutexAcquireReleaseInfoKHR ) ); + memcpy( this, &rhs, sizeof( BufferMemoryRequirementsInfo2 ) ); } - Win32KeyedMutexAcquireReleaseInfoKHR& operator=( VkWin32KeyedMutexAcquireReleaseInfoKHR const & rhs ) + BufferMemoryRequirementsInfo2& operator=( VkBufferMemoryRequirementsInfo2 const & rhs ) { - memcpy( this, &rhs, sizeof( Win32KeyedMutexAcquireReleaseInfoKHR ) ); + memcpy( this, &rhs, sizeof( BufferMemoryRequirementsInfo2 ) ); return *this; } - Win32KeyedMutexAcquireReleaseInfoKHR& setPNext( const void* pNext_ ) + BufferMemoryRequirementsInfo2& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - Win32KeyedMutexAcquireReleaseInfoKHR& setAcquireCount( uint32_t acquireCount_ ) + BufferMemoryRequirementsInfo2& setBuffer( Buffer buffer_ ) { - acquireCount = acquireCount_; + buffer = buffer_; return *this; } - Win32KeyedMutexAcquireReleaseInfoKHR& setPAcquireSyncs( const DeviceMemory* pAcquireSyncs_ ) + operator const VkBufferMemoryRequirementsInfo2&() const { - pAcquireSyncs = pAcquireSyncs_; - return *this; + return *reinterpret_cast(this); + } + + bool operator==( BufferMemoryRequirementsInfo2 const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( buffer == rhs.buffer ); + } + + bool operator!=( BufferMemoryRequirementsInfo2 const& rhs ) const + { + return !operator==( rhs ); } - Win32KeyedMutexAcquireReleaseInfoKHR& setPAcquireKeys( const uint64_t* pAcquireKeys_ ) + private: + StructureType sType = StructureType::eBufferMemoryRequirementsInfo2; + + public: + const void* pNext = nullptr; + Buffer buffer; + }; + static_assert( sizeof( BufferMemoryRequirementsInfo2 ) == sizeof( VkBufferMemoryRequirementsInfo2 ), "struct and wrapper have different size!" ); + + using BufferMemoryRequirementsInfo2KHR = BufferMemoryRequirementsInfo2; + + struct ImageMemoryRequirementsInfo2 + { + ImageMemoryRequirementsInfo2( Image image_ = Image() ) + : image( image_ ) { - pAcquireKeys = pAcquireKeys_; - return *this; } - Win32KeyedMutexAcquireReleaseInfoKHR& setPAcquireTimeouts( const uint32_t* pAcquireTimeouts_ ) + ImageMemoryRequirementsInfo2( VkImageMemoryRequirementsInfo2 const & rhs ) { - pAcquireTimeouts = pAcquireTimeouts_; - return *this; + memcpy( this, &rhs, sizeof( ImageMemoryRequirementsInfo2 ) ); } - Win32KeyedMutexAcquireReleaseInfoKHR& setReleaseCount( uint32_t releaseCount_ ) + ImageMemoryRequirementsInfo2& operator=( VkImageMemoryRequirementsInfo2 const & rhs ) { - releaseCount = releaseCount_; + memcpy( this, &rhs, sizeof( ImageMemoryRequirementsInfo2 ) ); return *this; } - - Win32KeyedMutexAcquireReleaseInfoKHR& setPReleaseSyncs( const DeviceMemory* pReleaseSyncs_ ) + ImageMemoryRequirementsInfo2& setPNext( const void* pNext_ ) { - pReleaseSyncs = pReleaseSyncs_; + pNext = pNext_; return *this; } - Win32KeyedMutexAcquireReleaseInfoKHR& setPReleaseKeys( const uint64_t* pReleaseKeys_ ) + ImageMemoryRequirementsInfo2& setImage( Image image_ ) { - pReleaseKeys = pReleaseKeys_; + image = image_; return *this; } - operator const VkWin32KeyedMutexAcquireReleaseInfoKHR&() const + operator const VkImageMemoryRequirementsInfo2&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( Win32KeyedMutexAcquireReleaseInfoKHR const& rhs ) const + bool operator==( ImageMemoryRequirementsInfo2 const& rhs ) const { 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 ); + && ( image == rhs.image ); } - bool operator!=( Win32KeyedMutexAcquireReleaseInfoKHR const& rhs ) const + bool operator!=( ImageMemoryRequirementsInfo2 const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eImageMemoryRequirementsInfo2; public: - const void* pNext; - uint32_t acquireCount; - const DeviceMemory* pAcquireSyncs; - const uint64_t* pAcquireKeys; - const uint32_t* pAcquireTimeouts; - uint32_t releaseCount; - const DeviceMemory* pReleaseSyncs; - const uint64_t* pReleaseKeys; + const void* pNext = nullptr; + Image image; }; - static_assert( sizeof( Win32KeyedMutexAcquireReleaseInfoKHR ) == sizeof( VkWin32KeyedMutexAcquireReleaseInfoKHR ), "struct and wrapper have different size!" ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + static_assert( sizeof( ImageMemoryRequirementsInfo2 ) == sizeof( VkImageMemoryRequirementsInfo2 ), "struct and wrapper have different size!" ); -#ifdef VK_USE_PLATFORM_WIN32_KHR - struct ExportSemaphoreWin32HandleInfoKHR + using ImageMemoryRequirementsInfo2KHR = ImageMemoryRequirementsInfo2; + + struct ImageSparseMemoryRequirementsInfo2 { - ExportSemaphoreWin32HandleInfoKHR( const SECURITY_ATTRIBUTES* pAttributes_ = nullptr, DWORD dwAccess_ = 0, LPCWSTR name_ = 0 ) - : sType( StructureType::eExportSemaphoreWin32HandleInfoKHR ) - , pNext( nullptr ) - , pAttributes( pAttributes_ ) - , dwAccess( dwAccess_ ) - , name( name_ ) + ImageSparseMemoryRequirementsInfo2( Image image_ = Image() ) + : image( image_ ) { } - ExportSemaphoreWin32HandleInfoKHR( VkExportSemaphoreWin32HandleInfoKHR const & rhs ) + ImageSparseMemoryRequirementsInfo2( VkImageSparseMemoryRequirementsInfo2 const & rhs ) { - memcpy( this, &rhs, sizeof( ExportSemaphoreWin32HandleInfoKHR ) ); + memcpy( this, &rhs, sizeof( ImageSparseMemoryRequirementsInfo2 ) ); } - ExportSemaphoreWin32HandleInfoKHR& operator=( VkExportSemaphoreWin32HandleInfoKHR const & rhs ) + ImageSparseMemoryRequirementsInfo2& operator=( VkImageSparseMemoryRequirementsInfo2 const & rhs ) { - memcpy( this, &rhs, sizeof( ExportSemaphoreWin32HandleInfoKHR ) ); + memcpy( this, &rhs, sizeof( ImageSparseMemoryRequirementsInfo2 ) ); return *this; } - ExportSemaphoreWin32HandleInfoKHR& setPNext( const void* pNext_ ) + ImageSparseMemoryRequirementsInfo2& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - ExportSemaphoreWin32HandleInfoKHR& setPAttributes( const SECURITY_ATTRIBUTES* pAttributes_ ) + ImageSparseMemoryRequirementsInfo2& setImage( Image image_ ) { - pAttributes = pAttributes_; + image = image_; return *this; } - ExportSemaphoreWin32HandleInfoKHR& setDwAccess( DWORD dwAccess_ ) + operator const VkImageSparseMemoryRequirementsInfo2&() const { - dwAccess = dwAccess_; - return *this; + return *reinterpret_cast(this); } - ExportSemaphoreWin32HandleInfoKHR& setName( LPCWSTR name_ ) + bool operator==( ImageSparseMemoryRequirementsInfo2 const& rhs ) const { - name = name_; - return *this; + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( image == rhs.image ); } - operator const VkExportSemaphoreWin32HandleInfoKHR&() const + bool operator!=( ImageSparseMemoryRequirementsInfo2 const& rhs ) const { - return *reinterpret_cast(this); + return !operator==( rhs ); } - bool operator==( ExportSemaphoreWin32HandleInfoKHR const& rhs ) const + private: + StructureType sType = StructureType::eImageSparseMemoryRequirementsInfo2; + + public: + const void* pNext = nullptr; + Image image; + }; + static_assert( sizeof( ImageSparseMemoryRequirementsInfo2 ) == sizeof( VkImageSparseMemoryRequirementsInfo2 ), "struct and wrapper have different size!" ); + + using ImageSparseMemoryRequirementsInfo2KHR = ImageSparseMemoryRequirementsInfo2; + + struct MemoryRequirements2 + { + operator const VkMemoryRequirements2&() const + { + return *reinterpret_cast(this); + } + + bool operator==( MemoryRequirements2 const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( pAttributes == rhs.pAttributes ) - && ( dwAccess == rhs.dwAccess ) - && ( name == rhs.name ); + && ( memoryRequirements == rhs.memoryRequirements ); } - bool operator!=( ExportSemaphoreWin32HandleInfoKHR const& rhs ) const + bool operator!=( MemoryRequirements2 const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eMemoryRequirements2; public: - const void* pNext; - const SECURITY_ATTRIBUTES* pAttributes; - DWORD dwAccess; - LPCWSTR name; + void* pNext = nullptr; + MemoryRequirements memoryRequirements; }; - static_assert( sizeof( ExportSemaphoreWin32HandleInfoKHR ) == sizeof( VkExportSemaphoreWin32HandleInfoKHR ), "struct and wrapper have different size!" ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + static_assert( sizeof( MemoryRequirements2 ) == sizeof( VkMemoryRequirements2 ), "struct and wrapper have different size!" ); -#ifdef VK_USE_PLATFORM_WIN32_KHR - struct D3D12FenceSubmitInfoKHR + using MemoryRequirements2KHR = MemoryRequirements2; + + struct MemoryDedicatedRequirements { - D3D12FenceSubmitInfoKHR( uint32_t waitSemaphoreValuesCount_ = 0, const uint64_t* pWaitSemaphoreValues_ = nullptr, uint32_t signalSemaphoreValuesCount_ = 0, const uint64_t* pSignalSemaphoreValues_ = nullptr ) - : sType( StructureType::eD3D12FenceSubmitInfoKHR ) - , pNext( nullptr ) - , waitSemaphoreValuesCount( waitSemaphoreValuesCount_ ) - , pWaitSemaphoreValues( pWaitSemaphoreValues_ ) - , signalSemaphoreValuesCount( signalSemaphoreValuesCount_ ) - , pSignalSemaphoreValues( pSignalSemaphoreValues_ ) + operator const VkMemoryDedicatedRequirements&() const { + return *reinterpret_cast(this); } - D3D12FenceSubmitInfoKHR( VkD3D12FenceSubmitInfoKHR const & rhs ) + bool operator==( MemoryDedicatedRequirements const& rhs ) const { - memcpy( this, &rhs, sizeof( D3D12FenceSubmitInfoKHR ) ); + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( prefersDedicatedAllocation == rhs.prefersDedicatedAllocation ) + && ( requiresDedicatedAllocation == rhs.requiresDedicatedAllocation ); } - D3D12FenceSubmitInfoKHR& operator=( VkD3D12FenceSubmitInfoKHR const & rhs ) + bool operator!=( MemoryDedicatedRequirements const& rhs ) const { - memcpy( this, &rhs, sizeof( D3D12FenceSubmitInfoKHR ) ); - return *this; + return !operator==( rhs ); } - D3D12FenceSubmitInfoKHR& setPNext( const void* pNext_ ) + + private: + StructureType sType = StructureType::eMemoryDedicatedRequirements; + + public: + void* pNext = nullptr; + Bool32 prefersDedicatedAllocation; + Bool32 requiresDedicatedAllocation; + }; + static_assert( sizeof( MemoryDedicatedRequirements ) == sizeof( VkMemoryDedicatedRequirements ), "struct and wrapper have different size!" ); + + using MemoryDedicatedRequirementsKHR = MemoryDedicatedRequirements; + + struct MemoryDedicatedAllocateInfo + { + MemoryDedicatedAllocateInfo( Image image_ = Image(), Buffer buffer_ = Buffer() ) + : image( image_ ) + , buffer( buffer_ ) { - pNext = pNext_; - return *this; } - D3D12FenceSubmitInfoKHR& setWaitSemaphoreValuesCount( uint32_t waitSemaphoreValuesCount_ ) + MemoryDedicatedAllocateInfo( VkMemoryDedicatedAllocateInfo const & rhs ) { - waitSemaphoreValuesCount = waitSemaphoreValuesCount_; - return *this; + memcpy( this, &rhs, sizeof( MemoryDedicatedAllocateInfo ) ); } - D3D12FenceSubmitInfoKHR& setPWaitSemaphoreValues( const uint64_t* pWaitSemaphoreValues_ ) + MemoryDedicatedAllocateInfo& operator=( VkMemoryDedicatedAllocateInfo const & rhs ) { - pWaitSemaphoreValues = pWaitSemaphoreValues_; + memcpy( this, &rhs, sizeof( MemoryDedicatedAllocateInfo ) ); + return *this; + } + MemoryDedicatedAllocateInfo& setPNext( const void* pNext_ ) + { + pNext = pNext_; return *this; } - D3D12FenceSubmitInfoKHR& setSignalSemaphoreValuesCount( uint32_t signalSemaphoreValuesCount_ ) + MemoryDedicatedAllocateInfo& setImage( Image image_ ) { - signalSemaphoreValuesCount = signalSemaphoreValuesCount_; + image = image_; return *this; } - D3D12FenceSubmitInfoKHR& setPSignalSemaphoreValues( const uint64_t* pSignalSemaphoreValues_ ) + MemoryDedicatedAllocateInfo& setBuffer( Buffer buffer_ ) { - pSignalSemaphoreValues = pSignalSemaphoreValues_; + buffer = buffer_; return *this; } - operator const VkD3D12FenceSubmitInfoKHR&() const + operator const VkMemoryDedicatedAllocateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( D3D12FenceSubmitInfoKHR const& rhs ) const + bool operator==( MemoryDedicatedAllocateInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( waitSemaphoreValuesCount == rhs.waitSemaphoreValuesCount ) - && ( pWaitSemaphoreValues == rhs.pWaitSemaphoreValues ) - && ( signalSemaphoreValuesCount == rhs.signalSemaphoreValuesCount ) - && ( pSignalSemaphoreValues == rhs.pSignalSemaphoreValues ); + && ( image == rhs.image ) + && ( buffer == rhs.buffer ); } - bool operator!=( D3D12FenceSubmitInfoKHR const& rhs ) const + bool operator!=( MemoryDedicatedAllocateInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eMemoryDedicatedAllocateInfo; public: - const void* pNext; - uint32_t waitSemaphoreValuesCount; - const uint64_t* pWaitSemaphoreValues; - uint32_t signalSemaphoreValuesCount; - const uint64_t* pSignalSemaphoreValues; + const void* pNext = nullptr; + Image image; + Buffer buffer; }; - static_assert( sizeof( D3D12FenceSubmitInfoKHR ) == sizeof( VkD3D12FenceSubmitInfoKHR ), "struct and wrapper have different size!" ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + static_assert( sizeof( MemoryDedicatedAllocateInfo ) == sizeof( VkMemoryDedicatedAllocateInfo ), "struct and wrapper have different size!" ); -#ifdef VK_USE_PLATFORM_WIN32_KHR - struct ExportFenceWin32HandleInfoKHR + using MemoryDedicatedAllocateInfoKHR = MemoryDedicatedAllocateInfo; + + struct SamplerYcbcrConversionInfo { - ExportFenceWin32HandleInfoKHR( const SECURITY_ATTRIBUTES* pAttributes_ = nullptr, DWORD dwAccess_ = 0, LPCWSTR name_ = 0 ) - : sType( StructureType::eExportFenceWin32HandleInfoKHR ) - , pNext( nullptr ) - , pAttributes( pAttributes_ ) - , dwAccess( dwAccess_ ) - , name( name_ ) + SamplerYcbcrConversionInfo( SamplerYcbcrConversion conversion_ = SamplerYcbcrConversion() ) + : conversion( conversion_ ) { } - ExportFenceWin32HandleInfoKHR( VkExportFenceWin32HandleInfoKHR const & rhs ) + SamplerYcbcrConversionInfo( VkSamplerYcbcrConversionInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ExportFenceWin32HandleInfoKHR ) ); + memcpy( this, &rhs, sizeof( SamplerYcbcrConversionInfo ) ); } - ExportFenceWin32HandleInfoKHR& operator=( VkExportFenceWin32HandleInfoKHR const & rhs ) + SamplerYcbcrConversionInfo& operator=( VkSamplerYcbcrConversionInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ExportFenceWin32HandleInfoKHR ) ); + memcpy( this, &rhs, sizeof( SamplerYcbcrConversionInfo ) ); return *this; } - ExportFenceWin32HandleInfoKHR& setPNext( const void* pNext_ ) + SamplerYcbcrConversionInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - ExportFenceWin32HandleInfoKHR& setPAttributes( const SECURITY_ATTRIBUTES* pAttributes_ ) - { - pAttributes = pAttributes_; - return *this; - } - - ExportFenceWin32HandleInfoKHR& setDwAccess( DWORD dwAccess_ ) - { - dwAccess = dwAccess_; - return *this; - } - - ExportFenceWin32HandleInfoKHR& setName( LPCWSTR name_ ) + SamplerYcbcrConversionInfo& setConversion( SamplerYcbcrConversion conversion_ ) { - name = name_; + conversion = conversion_; return *this; } - operator const VkExportFenceWin32HandleInfoKHR&() const + operator const VkSamplerYcbcrConversionInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ExportFenceWin32HandleInfoKHR const& rhs ) const + bool operator==( SamplerYcbcrConversionInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( pAttributes == rhs.pAttributes ) - && ( dwAccess == rhs.dwAccess ) - && ( name == rhs.name ); + && ( conversion == rhs.conversion ); } - bool operator!=( ExportFenceWin32HandleInfoKHR const& rhs ) const + bool operator!=( SamplerYcbcrConversionInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eSamplerYcbcrConversionInfo; public: - const void* pNext; - const SECURITY_ATTRIBUTES* pAttributes; - DWORD dwAccess; - LPCWSTR name; + const void* pNext = nullptr; + SamplerYcbcrConversion conversion; }; - static_assert( sizeof( ExportFenceWin32HandleInfoKHR ) == sizeof( VkExportFenceWin32HandleInfoKHR ), "struct and wrapper have different size!" ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + static_assert( sizeof( SamplerYcbcrConversionInfo ) == sizeof( VkSamplerYcbcrConversionInfo ), "struct and wrapper have different size!" ); + + using SamplerYcbcrConversionInfoKHR = SamplerYcbcrConversionInfo; - struct PhysicalDeviceMultiviewFeaturesKHX + struct PhysicalDeviceSamplerYcbcrConversionFeatures { - PhysicalDeviceMultiviewFeaturesKHX( Bool32 multiview_ = 0, Bool32 multiviewGeometryShader_ = 0, Bool32 multiviewTessellationShader_ = 0 ) - : sType( StructureType::ePhysicalDeviceMultiviewFeaturesKHX ) - , pNext( nullptr ) - , multiview( multiview_ ) - , multiviewGeometryShader( multiviewGeometryShader_ ) - , multiviewTessellationShader( multiviewTessellationShader_ ) + PhysicalDeviceSamplerYcbcrConversionFeatures( Bool32 samplerYcbcrConversion_ = 0 ) + : samplerYcbcrConversion( samplerYcbcrConversion_ ) { } - PhysicalDeviceMultiviewFeaturesKHX( VkPhysicalDeviceMultiviewFeaturesKHX const & rhs ) + PhysicalDeviceSamplerYcbcrConversionFeatures( VkPhysicalDeviceSamplerYcbcrConversionFeatures const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceMultiviewFeaturesKHX ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceSamplerYcbcrConversionFeatures ) ); } - PhysicalDeviceMultiviewFeaturesKHX& operator=( VkPhysicalDeviceMultiviewFeaturesKHX const & rhs ) + PhysicalDeviceSamplerYcbcrConversionFeatures& operator=( VkPhysicalDeviceSamplerYcbcrConversionFeatures const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceMultiviewFeaturesKHX ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceSamplerYcbcrConversionFeatures ) ); return *this; } - PhysicalDeviceMultiviewFeaturesKHX& setPNext( void* pNext_ ) + PhysicalDeviceSamplerYcbcrConversionFeatures& setPNext( void* pNext_ ) { pNext = pNext_; return *this; } - PhysicalDeviceMultiviewFeaturesKHX& setMultiview( Bool32 multiview_ ) - { - multiview = multiview_; - return *this; - } - - PhysicalDeviceMultiviewFeaturesKHX& setMultiviewGeometryShader( Bool32 multiviewGeometryShader_ ) - { - multiviewGeometryShader = multiviewGeometryShader_; - return *this; - } - - PhysicalDeviceMultiviewFeaturesKHX& setMultiviewTessellationShader( Bool32 multiviewTessellationShader_ ) + PhysicalDeviceSamplerYcbcrConversionFeatures& setSamplerYcbcrConversion( Bool32 samplerYcbcrConversion_ ) { - multiviewTessellationShader = multiviewTessellationShader_; + samplerYcbcrConversion = samplerYcbcrConversion_; return *this; } - operator const VkPhysicalDeviceMultiviewFeaturesKHX&() const + operator const VkPhysicalDeviceSamplerYcbcrConversionFeatures&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceMultiviewFeaturesKHX const& rhs ) const + bool operator==( PhysicalDeviceSamplerYcbcrConversionFeatures const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( multiview == rhs.multiview ) - && ( multiviewGeometryShader == rhs.multiviewGeometryShader ) - && ( multiviewTessellationShader == rhs.multiviewTessellationShader ); + && ( samplerYcbcrConversion == rhs.samplerYcbcrConversion ); } - bool operator!=( PhysicalDeviceMultiviewFeaturesKHX const& rhs ) const + bool operator!=( PhysicalDeviceSamplerYcbcrConversionFeatures const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceSamplerYcbcrConversionFeatures; public: - void* pNext; - Bool32 multiview; - Bool32 multiviewGeometryShader; - Bool32 multiviewTessellationShader; + void* pNext = nullptr; + Bool32 samplerYcbcrConversion; }; - static_assert( sizeof( PhysicalDeviceMultiviewFeaturesKHX ) == sizeof( VkPhysicalDeviceMultiviewFeaturesKHX ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceSamplerYcbcrConversionFeatures ) == sizeof( VkPhysicalDeviceSamplerYcbcrConversionFeatures ), "struct and wrapper have different size!" ); - struct PhysicalDeviceMultiviewPropertiesKHX + using PhysicalDeviceSamplerYcbcrConversionFeaturesKHR = PhysicalDeviceSamplerYcbcrConversionFeatures; + + struct SamplerYcbcrConversionImageFormatProperties { - operator const VkPhysicalDeviceMultiviewPropertiesKHX&() const + operator const VkSamplerYcbcrConversionImageFormatProperties&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceMultiviewPropertiesKHX const& rhs ) const + bool operator==( SamplerYcbcrConversionImageFormatProperties const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( maxMultiviewViewCount == rhs.maxMultiviewViewCount ) - && ( maxMultiviewInstanceIndex == rhs.maxMultiviewInstanceIndex ); + && ( combinedImageSamplerDescriptorCount == rhs.combinedImageSamplerDescriptorCount ); } - bool operator!=( PhysicalDeviceMultiviewPropertiesKHX const& rhs ) const + bool operator!=( SamplerYcbcrConversionImageFormatProperties const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eSamplerYcbcrConversionImageFormatProperties; public: - void* pNext; - uint32_t maxMultiviewViewCount; - uint32_t maxMultiviewInstanceIndex; + void* pNext = nullptr; + uint32_t combinedImageSamplerDescriptorCount; }; - static_assert( sizeof( PhysicalDeviceMultiviewPropertiesKHX ) == sizeof( VkPhysicalDeviceMultiviewPropertiesKHX ), "struct and wrapper have different size!" ); + static_assert( sizeof( SamplerYcbcrConversionImageFormatProperties ) == sizeof( VkSamplerYcbcrConversionImageFormatProperties ), "struct and wrapper have different size!" ); + + using SamplerYcbcrConversionImageFormatPropertiesKHR = SamplerYcbcrConversionImageFormatProperties; - struct RenderPassMultiviewCreateInfoKHX + struct TextureLODGatherFormatPropertiesAMD { - RenderPassMultiviewCreateInfoKHX( uint32_t subpassCount_ = 0, const uint32_t* pViewMasks_ = nullptr, uint32_t dependencyCount_ = 0, const int32_t* pViewOffsets_ = nullptr, uint32_t correlationMaskCount_ = 0, const uint32_t* pCorrelationMasks_ = nullptr ) - : sType( StructureType::eRenderPassMultiviewCreateInfoKHX ) - , pNext( nullptr ) - , subpassCount( subpassCount_ ) - , pViewMasks( pViewMasks_ ) - , dependencyCount( dependencyCount_ ) - , pViewOffsets( pViewOffsets_ ) - , correlationMaskCount( correlationMaskCount_ ) - , pCorrelationMasks( pCorrelationMasks_ ) + operator const VkTextureLODGatherFormatPropertiesAMD&() const { + return *reinterpret_cast(this); } - RenderPassMultiviewCreateInfoKHX( VkRenderPassMultiviewCreateInfoKHX const & rhs ) + bool operator==( TextureLODGatherFormatPropertiesAMD const& rhs ) const { - memcpy( this, &rhs, sizeof( RenderPassMultiviewCreateInfoKHX ) ); + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( supportsTextureGatherLODBiasAMD == rhs.supportsTextureGatherLODBiasAMD ); } - RenderPassMultiviewCreateInfoKHX& operator=( VkRenderPassMultiviewCreateInfoKHX const & rhs ) - { - memcpy( this, &rhs, sizeof( RenderPassMultiviewCreateInfoKHX ) ); - return *this; - } - RenderPassMultiviewCreateInfoKHX& setPNext( const void* pNext_ ) + bool operator!=( TextureLODGatherFormatPropertiesAMD const& rhs ) const { - pNext = pNext_; - return *this; + return !operator==( rhs ); } - RenderPassMultiviewCreateInfoKHX& setSubpassCount( uint32_t subpassCount_ ) - { - subpassCount = subpassCount_; - return *this; - } + private: + StructureType sType = StructureType::eTextureLodGatherFormatPropertiesAMD; + + public: + void* pNext = nullptr; + Bool32 supportsTextureGatherLODBiasAMD; + }; + static_assert( sizeof( TextureLODGatherFormatPropertiesAMD ) == sizeof( VkTextureLODGatherFormatPropertiesAMD ), "struct and wrapper have different size!" ); - RenderPassMultiviewCreateInfoKHX& setPViewMasks( const uint32_t* pViewMasks_ ) + struct ProtectedSubmitInfo + { + ProtectedSubmitInfo( Bool32 protectedSubmit_ = 0 ) + : protectedSubmit( protectedSubmit_ ) { - pViewMasks = pViewMasks_; - return *this; } - RenderPassMultiviewCreateInfoKHX& setDependencyCount( uint32_t dependencyCount_ ) + ProtectedSubmitInfo( VkProtectedSubmitInfo const & rhs ) { - dependencyCount = dependencyCount_; - return *this; + memcpy( this, &rhs, sizeof( ProtectedSubmitInfo ) ); } - RenderPassMultiviewCreateInfoKHX& setPViewOffsets( const int32_t* pViewOffsets_ ) + ProtectedSubmitInfo& operator=( VkProtectedSubmitInfo const & rhs ) { - pViewOffsets = pViewOffsets_; + memcpy( this, &rhs, sizeof( ProtectedSubmitInfo ) ); return *this; } - - RenderPassMultiviewCreateInfoKHX& setCorrelationMaskCount( uint32_t correlationMaskCount_ ) + ProtectedSubmitInfo& setPNext( const void* pNext_ ) { - correlationMaskCount = correlationMaskCount_; + pNext = pNext_; return *this; } - RenderPassMultiviewCreateInfoKHX& setPCorrelationMasks( const uint32_t* pCorrelationMasks_ ) + ProtectedSubmitInfo& setProtectedSubmit( Bool32 protectedSubmit_ ) { - pCorrelationMasks = pCorrelationMasks_; + protectedSubmit = protectedSubmit_; return *this; } - operator const VkRenderPassMultiviewCreateInfoKHX&() const + operator const VkProtectedSubmitInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( RenderPassMultiviewCreateInfoKHX const& rhs ) const + bool operator==( ProtectedSubmitInfo const& rhs ) const { 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 ); + && ( protectedSubmit == rhs.protectedSubmit ); } - bool operator!=( RenderPassMultiviewCreateInfoKHX const& rhs ) const + bool operator!=( ProtectedSubmitInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eProtectedSubmitInfo; public: - const void* pNext; - 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; + Bool32 protectedSubmit; }; - static_assert( sizeof( RenderPassMultiviewCreateInfoKHX ) == sizeof( VkRenderPassMultiviewCreateInfoKHX ), "struct and wrapper have different size!" ); + static_assert( sizeof( ProtectedSubmitInfo ) == sizeof( VkProtectedSubmitInfo ), "struct and wrapper have different size!" ); - struct BindBufferMemoryInfoKHR + struct PhysicalDeviceProtectedMemoryFeatures { - BindBufferMemoryInfoKHR( Buffer buffer_ = Buffer(), DeviceMemory memory_ = DeviceMemory(), DeviceSize memoryOffset_ = 0 ) - : sType( StructureType::eBindBufferMemoryInfoKHR ) - , pNext( nullptr ) - , buffer( buffer_ ) - , memory( memory_ ) - , memoryOffset( memoryOffset_ ) + PhysicalDeviceProtectedMemoryFeatures( Bool32 protectedMemory_ = 0 ) + : protectedMemory( protectedMemory_ ) { } - BindBufferMemoryInfoKHR( VkBindBufferMemoryInfoKHR const & rhs ) + PhysicalDeviceProtectedMemoryFeatures( VkPhysicalDeviceProtectedMemoryFeatures const & rhs ) { - memcpy( this, &rhs, sizeof( BindBufferMemoryInfoKHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceProtectedMemoryFeatures ) ); } - BindBufferMemoryInfoKHR& operator=( VkBindBufferMemoryInfoKHR const & rhs ) + PhysicalDeviceProtectedMemoryFeatures& operator=( VkPhysicalDeviceProtectedMemoryFeatures const & rhs ) { - memcpy( this, &rhs, sizeof( BindBufferMemoryInfoKHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceProtectedMemoryFeatures ) ); return *this; } - BindBufferMemoryInfoKHR& setPNext( const void* pNext_ ) + PhysicalDeviceProtectedMemoryFeatures& setPNext( void* pNext_ ) { pNext = pNext_; return *this; } - BindBufferMemoryInfoKHR& setBuffer( Buffer buffer_ ) - { - buffer = buffer_; - return *this; - } - - BindBufferMemoryInfoKHR& setMemory( DeviceMemory memory_ ) - { - memory = memory_; - return *this; - } - - BindBufferMemoryInfoKHR& setMemoryOffset( DeviceSize memoryOffset_ ) + PhysicalDeviceProtectedMemoryFeatures& setProtectedMemory( Bool32 protectedMemory_ ) { - memoryOffset = memoryOffset_; + protectedMemory = protectedMemory_; return *this; } - operator const VkBindBufferMemoryInfoKHR&() const + operator const VkPhysicalDeviceProtectedMemoryFeatures&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( BindBufferMemoryInfoKHR const& rhs ) const + bool operator==( PhysicalDeviceProtectedMemoryFeatures const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( buffer == rhs.buffer ) - && ( memory == rhs.memory ) - && ( memoryOffset == rhs.memoryOffset ); + && ( protectedMemory == rhs.protectedMemory ); } - bool operator!=( BindBufferMemoryInfoKHR const& rhs ) const + bool operator!=( PhysicalDeviceProtectedMemoryFeatures const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceProtectedMemoryFeatures; public: - const void* pNext; - Buffer buffer; - DeviceMemory memory; - DeviceSize memoryOffset; + void* pNext = nullptr; + Bool32 protectedMemory; }; - static_assert( sizeof( BindBufferMemoryInfoKHR ) == sizeof( VkBindBufferMemoryInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceProtectedMemoryFeatures ) == sizeof( VkPhysicalDeviceProtectedMemoryFeatures ), "struct and wrapper have different size!" ); - struct BindBufferMemoryDeviceGroupInfoKHX + struct PhysicalDeviceProtectedMemoryProperties { - BindBufferMemoryDeviceGroupInfoKHX( uint32_t deviceIndexCount_ = 0, const uint32_t* pDeviceIndices_ = nullptr ) - : sType( StructureType::eBindBufferMemoryDeviceGroupInfoKHX ) - , pNext( nullptr ) - , deviceIndexCount( deviceIndexCount_ ) - , pDeviceIndices( pDeviceIndices_ ) + PhysicalDeviceProtectedMemoryProperties( Bool32 protectedNoFault_ = 0 ) + : protectedNoFault( protectedNoFault_ ) { } - BindBufferMemoryDeviceGroupInfoKHX( VkBindBufferMemoryDeviceGroupInfoKHX const & rhs ) + PhysicalDeviceProtectedMemoryProperties( VkPhysicalDeviceProtectedMemoryProperties const & rhs ) { - memcpy( this, &rhs, sizeof( BindBufferMemoryDeviceGroupInfoKHX ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceProtectedMemoryProperties ) ); } - BindBufferMemoryDeviceGroupInfoKHX& operator=( VkBindBufferMemoryDeviceGroupInfoKHX const & rhs ) + PhysicalDeviceProtectedMemoryProperties& operator=( VkPhysicalDeviceProtectedMemoryProperties const & rhs ) { - memcpy( this, &rhs, sizeof( BindBufferMemoryDeviceGroupInfoKHX ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceProtectedMemoryProperties ) ); return *this; } - BindBufferMemoryDeviceGroupInfoKHX& setPNext( const void* pNext_ ) + PhysicalDeviceProtectedMemoryProperties& setPNext( void* pNext_ ) { pNext = pNext_; return *this; } - BindBufferMemoryDeviceGroupInfoKHX& setDeviceIndexCount( uint32_t deviceIndexCount_ ) - { - deviceIndexCount = deviceIndexCount_; - return *this; - } - - BindBufferMemoryDeviceGroupInfoKHX& setPDeviceIndices( const uint32_t* pDeviceIndices_ ) + PhysicalDeviceProtectedMemoryProperties& setProtectedNoFault( Bool32 protectedNoFault_ ) { - pDeviceIndices = pDeviceIndices_; + protectedNoFault = protectedNoFault_; return *this; } - operator const VkBindBufferMemoryDeviceGroupInfoKHX&() const + operator const VkPhysicalDeviceProtectedMemoryProperties&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( BindBufferMemoryDeviceGroupInfoKHX const& rhs ) const + bool operator==( PhysicalDeviceProtectedMemoryProperties const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( deviceIndexCount == rhs.deviceIndexCount ) - && ( pDeviceIndices == rhs.pDeviceIndices ); + && ( protectedNoFault == rhs.protectedNoFault ); } - bool operator!=( BindBufferMemoryDeviceGroupInfoKHX const& rhs ) const + bool operator!=( PhysicalDeviceProtectedMemoryProperties const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceProtectedMemoryProperties; public: - const void* pNext; - uint32_t deviceIndexCount; - const uint32_t* pDeviceIndices; + void* pNext = nullptr; + Bool32 protectedNoFault; }; - static_assert( sizeof( BindBufferMemoryDeviceGroupInfoKHX ) == sizeof( VkBindBufferMemoryDeviceGroupInfoKHX ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceProtectedMemoryProperties ) == sizeof( VkPhysicalDeviceProtectedMemoryProperties ), "struct and wrapper have different size!" ); - struct BindImageMemoryInfoKHR + struct PipelineCoverageToColorStateCreateInfoNV { - BindImageMemoryInfoKHR( Image image_ = Image(), DeviceMemory memory_ = DeviceMemory(), DeviceSize memoryOffset_ = 0 ) - : sType( StructureType::eBindImageMemoryInfoKHR ) - , pNext( nullptr ) - , image( image_ ) - , memory( memory_ ) - , memoryOffset( memoryOffset_ ) + PipelineCoverageToColorStateCreateInfoNV( PipelineCoverageToColorStateCreateFlagsNV flags_ = PipelineCoverageToColorStateCreateFlagsNV(), Bool32 coverageToColorEnable_ = 0, uint32_t coverageToColorLocation_ = 0 ) + : flags( flags_ ) + , coverageToColorEnable( coverageToColorEnable_ ) + , coverageToColorLocation( coverageToColorLocation_ ) { } - BindImageMemoryInfoKHR( VkBindImageMemoryInfoKHR const & rhs ) + PipelineCoverageToColorStateCreateInfoNV( VkPipelineCoverageToColorStateCreateInfoNV const & rhs ) { - memcpy( this, &rhs, sizeof( BindImageMemoryInfoKHR ) ); + memcpy( this, &rhs, sizeof( PipelineCoverageToColorStateCreateInfoNV ) ); } - BindImageMemoryInfoKHR& operator=( VkBindImageMemoryInfoKHR const & rhs ) + PipelineCoverageToColorStateCreateInfoNV& operator=( VkPipelineCoverageToColorStateCreateInfoNV const & rhs ) { - memcpy( this, &rhs, sizeof( BindImageMemoryInfoKHR ) ); + memcpy( this, &rhs, sizeof( PipelineCoverageToColorStateCreateInfoNV ) ); return *this; } - BindImageMemoryInfoKHR& setPNext( const void* pNext_ ) + PipelineCoverageToColorStateCreateInfoNV& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - BindImageMemoryInfoKHR& setImage( Image image_ ) + PipelineCoverageToColorStateCreateInfoNV& setFlags( PipelineCoverageToColorStateCreateFlagsNV flags_ ) { - image = image_; + flags = flags_; return *this; } - BindImageMemoryInfoKHR& setMemory( DeviceMemory memory_ ) + PipelineCoverageToColorStateCreateInfoNV& setCoverageToColorEnable( Bool32 coverageToColorEnable_ ) { - memory = memory_; + coverageToColorEnable = coverageToColorEnable_; return *this; } - BindImageMemoryInfoKHR& setMemoryOffset( DeviceSize memoryOffset_ ) + PipelineCoverageToColorStateCreateInfoNV& setCoverageToColorLocation( uint32_t coverageToColorLocation_ ) { - memoryOffset = memoryOffset_; + coverageToColorLocation = coverageToColorLocation_; return *this; } - operator const VkBindImageMemoryInfoKHR&() const + operator const VkPipelineCoverageToColorStateCreateInfoNV&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( BindImageMemoryInfoKHR const& rhs ) const + bool operator==( PipelineCoverageToColorStateCreateInfoNV const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( image == rhs.image ) - && ( memory == rhs.memory ) - && ( memoryOffset == rhs.memoryOffset ); + && ( flags == rhs.flags ) + && ( coverageToColorEnable == rhs.coverageToColorEnable ) + && ( coverageToColorLocation == rhs.coverageToColorLocation ); } - bool operator!=( BindImageMemoryInfoKHR const& rhs ) const + bool operator!=( PipelineCoverageToColorStateCreateInfoNV const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePipelineCoverageToColorStateCreateInfoNV; public: - const void* pNext; - Image image; - DeviceMemory memory; - DeviceSize memoryOffset; + const void* pNext = nullptr; + PipelineCoverageToColorStateCreateFlagsNV flags; + Bool32 coverageToColorEnable; + uint32_t coverageToColorLocation; }; - static_assert( sizeof( BindImageMemoryInfoKHR ) == sizeof( VkBindImageMemoryInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PipelineCoverageToColorStateCreateInfoNV ) == sizeof( VkPipelineCoverageToColorStateCreateInfoNV ), "struct and wrapper have different size!" ); - struct BindImageMemoryDeviceGroupInfoKHX + struct PhysicalDeviceSamplerFilterMinmaxPropertiesEXT { - BindImageMemoryDeviceGroupInfoKHX( uint32_t deviceIndexCount_ = 0, const uint32_t* pDeviceIndices_ = nullptr, uint32_t SFRRectCount_ = 0, const Rect2D* pSFRRects_ = nullptr ) - : sType( StructureType::eBindImageMemoryDeviceGroupInfoKHX ) - , pNext( nullptr ) - , deviceIndexCount( deviceIndexCount_ ) - , pDeviceIndices( pDeviceIndices_ ) - , SFRRectCount( SFRRectCount_ ) - , pSFRRects( pSFRRects_ ) - { - } - - BindImageMemoryDeviceGroupInfoKHX( VkBindImageMemoryDeviceGroupInfoKHX const & rhs ) - { - memcpy( this, &rhs, sizeof( BindImageMemoryDeviceGroupInfoKHX ) ); - } - - BindImageMemoryDeviceGroupInfoKHX& operator=( VkBindImageMemoryDeviceGroupInfoKHX const & rhs ) - { - memcpy( this, &rhs, sizeof( BindImageMemoryDeviceGroupInfoKHX ) ); - return *this; - } - BindImageMemoryDeviceGroupInfoKHX& setPNext( const void* pNext_ ) + operator const VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT&() const { - pNext = pNext_; - return *this; + return *reinterpret_cast(this); } - BindImageMemoryDeviceGroupInfoKHX& setDeviceIndexCount( uint32_t deviceIndexCount_ ) + bool operator==( PhysicalDeviceSamplerFilterMinmaxPropertiesEXT const& rhs ) const { - deviceIndexCount = deviceIndexCount_; - return *this; + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( filterMinmaxSingleComponentFormats == rhs.filterMinmaxSingleComponentFormats ) + && ( filterMinmaxImageComponentMapping == rhs.filterMinmaxImageComponentMapping ); } - BindImageMemoryDeviceGroupInfoKHX& setPDeviceIndices( const uint32_t* pDeviceIndices_ ) + bool operator!=( PhysicalDeviceSamplerFilterMinmaxPropertiesEXT const& rhs ) const { - pDeviceIndices = pDeviceIndices_; - return *this; + return !operator==( rhs ); } - BindImageMemoryDeviceGroupInfoKHX& setSFRRectCount( uint32_t SFRRectCount_ ) - { - SFRRectCount = SFRRectCount_; - return *this; - } + private: + StructureType sType = StructureType::ePhysicalDeviceSamplerFilterMinmaxPropertiesEXT; - BindImageMemoryDeviceGroupInfoKHX& setPSFRRects( const Rect2D* pSFRRects_ ) - { - pSFRRects = pSFRRects_; - return *this; - } + public: + void* pNext = nullptr; + Bool32 filterMinmaxSingleComponentFormats; + Bool32 filterMinmaxImageComponentMapping; + }; + static_assert( sizeof( PhysicalDeviceSamplerFilterMinmaxPropertiesEXT ) == sizeof( VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT ), "struct and wrapper have different size!" ); - operator const VkBindImageMemoryDeviceGroupInfoKHX&() const + struct MultisamplePropertiesEXT + { + operator const VkMultisamplePropertiesEXT&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( BindImageMemoryDeviceGroupInfoKHX const& rhs ) const + bool operator==( MultisamplePropertiesEXT const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( deviceIndexCount == rhs.deviceIndexCount ) - && ( pDeviceIndices == rhs.pDeviceIndices ) - && ( SFRRectCount == rhs.SFRRectCount ) - && ( pSFRRects == rhs.pSFRRects ); + && ( maxSampleLocationGridSize == rhs.maxSampleLocationGridSize ); } - bool operator!=( BindImageMemoryDeviceGroupInfoKHX const& rhs ) const + bool operator!=( MultisamplePropertiesEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eMultisamplePropertiesEXT; public: - const void* pNext; - uint32_t deviceIndexCount; - const uint32_t* pDeviceIndices; - uint32_t SFRRectCount; - const Rect2D* pSFRRects; + void* pNext = nullptr; + Extent2D maxSampleLocationGridSize; }; - static_assert( sizeof( BindImageMemoryDeviceGroupInfoKHX ) == sizeof( VkBindImageMemoryDeviceGroupInfoKHX ), "struct and wrapper have different size!" ); + static_assert( sizeof( MultisamplePropertiesEXT ) == sizeof( VkMultisamplePropertiesEXT ), "struct and wrapper have different size!" ); - struct DeviceGroupRenderPassBeginInfoKHX + struct PhysicalDeviceBlendOperationAdvancedFeaturesEXT { - DeviceGroupRenderPassBeginInfoKHX( uint32_t deviceMask_ = 0, uint32_t deviceRenderAreaCount_ = 0, const Rect2D* pDeviceRenderAreas_ = nullptr ) - : sType( StructureType::eDeviceGroupRenderPassBeginInfoKHX ) - , pNext( nullptr ) - , deviceMask( deviceMask_ ) - , deviceRenderAreaCount( deviceRenderAreaCount_ ) - , pDeviceRenderAreas( pDeviceRenderAreas_ ) + PhysicalDeviceBlendOperationAdvancedFeaturesEXT( Bool32 advancedBlendCoherentOperations_ = 0 ) + : advancedBlendCoherentOperations( advancedBlendCoherentOperations_ ) { } - DeviceGroupRenderPassBeginInfoKHX( VkDeviceGroupRenderPassBeginInfoKHX const & rhs ) + PhysicalDeviceBlendOperationAdvancedFeaturesEXT( VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceGroupRenderPassBeginInfoKHX ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceBlendOperationAdvancedFeaturesEXT ) ); } - DeviceGroupRenderPassBeginInfoKHX& operator=( VkDeviceGroupRenderPassBeginInfoKHX const & rhs ) + PhysicalDeviceBlendOperationAdvancedFeaturesEXT& operator=( VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceGroupRenderPassBeginInfoKHX ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceBlendOperationAdvancedFeaturesEXT ) ); return *this; } - DeviceGroupRenderPassBeginInfoKHX& setPNext( const void* pNext_ ) + PhysicalDeviceBlendOperationAdvancedFeaturesEXT& setPNext( void* pNext_ ) { pNext = pNext_; return *this; } - DeviceGroupRenderPassBeginInfoKHX& setDeviceMask( uint32_t deviceMask_ ) + PhysicalDeviceBlendOperationAdvancedFeaturesEXT& setAdvancedBlendCoherentOperations( Bool32 advancedBlendCoherentOperations_ ) { - deviceMask = deviceMask_; + advancedBlendCoherentOperations = advancedBlendCoherentOperations_; return *this; } - DeviceGroupRenderPassBeginInfoKHX& setDeviceRenderAreaCount( uint32_t deviceRenderAreaCount_ ) + operator const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT&() const { - deviceRenderAreaCount = deviceRenderAreaCount_; - return *this; + return *reinterpret_cast(this); } - DeviceGroupRenderPassBeginInfoKHX& setPDeviceRenderAreas( const Rect2D* pDeviceRenderAreas_ ) + bool operator==( PhysicalDeviceBlendOperationAdvancedFeaturesEXT const& rhs ) const { - pDeviceRenderAreas = pDeviceRenderAreas_; - return *this; + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( advancedBlendCoherentOperations == rhs.advancedBlendCoherentOperations ); + } + + bool operator!=( PhysicalDeviceBlendOperationAdvancedFeaturesEXT const& rhs ) const + { + return !operator==( rhs ); } - operator const VkDeviceGroupRenderPassBeginInfoKHX&() const + private: + StructureType sType = StructureType::ePhysicalDeviceBlendOperationAdvancedFeaturesEXT; + + public: + void* pNext = nullptr; + Bool32 advancedBlendCoherentOperations; + }; + static_assert( sizeof( PhysicalDeviceBlendOperationAdvancedFeaturesEXT ) == sizeof( VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT ), "struct and wrapper have different size!" ); + + struct PhysicalDeviceBlendOperationAdvancedPropertiesEXT + { + operator const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DeviceGroupRenderPassBeginInfoKHX const& rhs ) const + bool operator==( PhysicalDeviceBlendOperationAdvancedPropertiesEXT const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( deviceMask == rhs.deviceMask ) - && ( deviceRenderAreaCount == rhs.deviceRenderAreaCount ) - && ( pDeviceRenderAreas == rhs.pDeviceRenderAreas ); + && ( advancedBlendMaxColorAttachments == rhs.advancedBlendMaxColorAttachments ) + && ( advancedBlendIndependentBlend == rhs.advancedBlendIndependentBlend ) + && ( advancedBlendNonPremultipliedSrcColor == rhs.advancedBlendNonPremultipliedSrcColor ) + && ( advancedBlendNonPremultipliedDstColor == rhs.advancedBlendNonPremultipliedDstColor ) + && ( advancedBlendCorrelatedOverlap == rhs.advancedBlendCorrelatedOverlap ) + && ( advancedBlendAllOperations == rhs.advancedBlendAllOperations ); } - bool operator!=( DeviceGroupRenderPassBeginInfoKHX const& rhs ) const + bool operator!=( PhysicalDeviceBlendOperationAdvancedPropertiesEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceBlendOperationAdvancedPropertiesEXT; public: - const void* pNext; - uint32_t deviceMask; - uint32_t deviceRenderAreaCount; - const Rect2D* pDeviceRenderAreas; + void* pNext = nullptr; + uint32_t advancedBlendMaxColorAttachments; + Bool32 advancedBlendIndependentBlend; + Bool32 advancedBlendNonPremultipliedSrcColor; + Bool32 advancedBlendNonPremultipliedDstColor; + Bool32 advancedBlendCorrelatedOverlap; + Bool32 advancedBlendAllOperations; }; - static_assert( sizeof( DeviceGroupRenderPassBeginInfoKHX ) == sizeof( VkDeviceGroupRenderPassBeginInfoKHX ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceBlendOperationAdvancedPropertiesEXT ) == sizeof( VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT ), "struct and wrapper have different size!" ); - struct DeviceGroupCommandBufferBeginInfoKHX + struct ImageFormatListCreateInfoKHR { - DeviceGroupCommandBufferBeginInfoKHX( uint32_t deviceMask_ = 0 ) - : sType( StructureType::eDeviceGroupCommandBufferBeginInfoKHX ) - , pNext( nullptr ) - , deviceMask( deviceMask_ ) + ImageFormatListCreateInfoKHR( uint32_t viewFormatCount_ = 0, const Format* pViewFormats_ = nullptr ) + : viewFormatCount( viewFormatCount_ ) + , pViewFormats( pViewFormats_ ) { } - DeviceGroupCommandBufferBeginInfoKHX( VkDeviceGroupCommandBufferBeginInfoKHX const & rhs ) + ImageFormatListCreateInfoKHR( VkImageFormatListCreateInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceGroupCommandBufferBeginInfoKHX ) ); + memcpy( this, &rhs, sizeof( ImageFormatListCreateInfoKHR ) ); } - DeviceGroupCommandBufferBeginInfoKHX& operator=( VkDeviceGroupCommandBufferBeginInfoKHX const & rhs ) + ImageFormatListCreateInfoKHR& operator=( VkImageFormatListCreateInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceGroupCommandBufferBeginInfoKHX ) ); + memcpy( this, &rhs, sizeof( ImageFormatListCreateInfoKHR ) ); return *this; } - DeviceGroupCommandBufferBeginInfoKHX& setPNext( const void* pNext_ ) + ImageFormatListCreateInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - DeviceGroupCommandBufferBeginInfoKHX& setDeviceMask( uint32_t deviceMask_ ) + ImageFormatListCreateInfoKHR& setViewFormatCount( uint32_t viewFormatCount_ ) { - deviceMask = deviceMask_; + viewFormatCount = viewFormatCount_; + return *this; + } + + ImageFormatListCreateInfoKHR& setPViewFormats( const Format* pViewFormats_ ) + { + pViewFormats = pViewFormats_; return *this; } - operator const VkDeviceGroupCommandBufferBeginInfoKHX&() const + operator const VkImageFormatListCreateInfoKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DeviceGroupCommandBufferBeginInfoKHX const& rhs ) const + bool operator==( ImageFormatListCreateInfoKHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( deviceMask == rhs.deviceMask ); + && ( viewFormatCount == rhs.viewFormatCount ) + && ( pViewFormats == rhs.pViewFormats ); } - bool operator!=( DeviceGroupCommandBufferBeginInfoKHX const& rhs ) const + bool operator!=( ImageFormatListCreateInfoKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eImageFormatListCreateInfoKHR; public: - const void* pNext; - uint32_t deviceMask; + const void* pNext = nullptr; + uint32_t viewFormatCount; + const Format* pViewFormats; }; - static_assert( sizeof( DeviceGroupCommandBufferBeginInfoKHX ) == sizeof( VkDeviceGroupCommandBufferBeginInfoKHX ), "struct and wrapper have different size!" ); + static_assert( sizeof( ImageFormatListCreateInfoKHR ) == sizeof( VkImageFormatListCreateInfoKHR ), "struct and wrapper have different size!" ); - struct DeviceGroupSubmitInfoKHX + struct ValidationCacheCreateInfoEXT { - DeviceGroupSubmitInfoKHX( uint32_t waitSemaphoreCount_ = 0, const uint32_t* pWaitSemaphoreDeviceIndices_ = nullptr, uint32_t commandBufferCount_ = 0, const uint32_t* pCommandBufferDeviceMasks_ = nullptr, uint32_t signalSemaphoreCount_ = 0, const uint32_t* pSignalSemaphoreDeviceIndices_ = nullptr ) - : sType( StructureType::eDeviceGroupSubmitInfoKHX ) - , pNext( nullptr ) - , waitSemaphoreCount( waitSemaphoreCount_ ) - , pWaitSemaphoreDeviceIndices( pWaitSemaphoreDeviceIndices_ ) - , commandBufferCount( commandBufferCount_ ) - , pCommandBufferDeviceMasks( pCommandBufferDeviceMasks_ ) - , signalSemaphoreCount( signalSemaphoreCount_ ) - , pSignalSemaphoreDeviceIndices( pSignalSemaphoreDeviceIndices_ ) - { - } - - DeviceGroupSubmitInfoKHX( VkDeviceGroupSubmitInfoKHX const & rhs ) - { - memcpy( this, &rhs, sizeof( DeviceGroupSubmitInfoKHX ) ); - } - - DeviceGroupSubmitInfoKHX& operator=( VkDeviceGroupSubmitInfoKHX const & rhs ) - { - memcpy( this, &rhs, sizeof( DeviceGroupSubmitInfoKHX ) ); - return *this; - } - DeviceGroupSubmitInfoKHX& setPNext( const void* pNext_ ) + ValidationCacheCreateInfoEXT( ValidationCacheCreateFlagsEXT flags_ = ValidationCacheCreateFlagsEXT(), size_t initialDataSize_ = 0, const void* pInitialData_ = nullptr ) + : flags( flags_ ) + , initialDataSize( initialDataSize_ ) + , pInitialData( pInitialData_ ) { - pNext = pNext_; - return *this; } - DeviceGroupSubmitInfoKHX& setWaitSemaphoreCount( uint32_t waitSemaphoreCount_ ) + ValidationCacheCreateInfoEXT( VkValidationCacheCreateInfoEXT const & rhs ) { - waitSemaphoreCount = waitSemaphoreCount_; - return *this; + memcpy( this, &rhs, sizeof( ValidationCacheCreateInfoEXT ) ); } - DeviceGroupSubmitInfoKHX& setPWaitSemaphoreDeviceIndices( const uint32_t* pWaitSemaphoreDeviceIndices_ ) + ValidationCacheCreateInfoEXT& operator=( VkValidationCacheCreateInfoEXT const & rhs ) { - pWaitSemaphoreDeviceIndices = pWaitSemaphoreDeviceIndices_; + memcpy( this, &rhs, sizeof( ValidationCacheCreateInfoEXT ) ); return *this; } - - DeviceGroupSubmitInfoKHX& setCommandBufferCount( uint32_t commandBufferCount_ ) + ValidationCacheCreateInfoEXT& setPNext( const void* pNext_ ) { - commandBufferCount = commandBufferCount_; + pNext = pNext_; return *this; } - DeviceGroupSubmitInfoKHX& setPCommandBufferDeviceMasks( const uint32_t* pCommandBufferDeviceMasks_ ) + ValidationCacheCreateInfoEXT& setFlags( ValidationCacheCreateFlagsEXT flags_ ) { - pCommandBufferDeviceMasks = pCommandBufferDeviceMasks_; + flags = flags_; return *this; } - DeviceGroupSubmitInfoKHX& setSignalSemaphoreCount( uint32_t signalSemaphoreCount_ ) + ValidationCacheCreateInfoEXT& setInitialDataSize( size_t initialDataSize_ ) { - signalSemaphoreCount = signalSemaphoreCount_; + initialDataSize = initialDataSize_; return *this; } - DeviceGroupSubmitInfoKHX& setPSignalSemaphoreDeviceIndices( const uint32_t* pSignalSemaphoreDeviceIndices_ ) + ValidationCacheCreateInfoEXT& setPInitialData( const void* pInitialData_ ) { - pSignalSemaphoreDeviceIndices = pSignalSemaphoreDeviceIndices_; + pInitialData = pInitialData_; return *this; } - operator const VkDeviceGroupSubmitInfoKHX&() const + operator const VkValidationCacheCreateInfoEXT&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DeviceGroupSubmitInfoKHX const& rhs ) const + bool operator==( ValidationCacheCreateInfoEXT const& rhs ) const { 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 ); + && ( flags == rhs.flags ) + && ( initialDataSize == rhs.initialDataSize ) + && ( pInitialData == rhs.pInitialData ); } - bool operator!=( DeviceGroupSubmitInfoKHX const& rhs ) const + bool operator!=( ValidationCacheCreateInfoEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eValidationCacheCreateInfoEXT; public: - const void* pNext; - 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; + ValidationCacheCreateFlagsEXT flags; + size_t initialDataSize; + const void* pInitialData; }; - static_assert( sizeof( DeviceGroupSubmitInfoKHX ) == sizeof( VkDeviceGroupSubmitInfoKHX ), "struct and wrapper have different size!" ); + static_assert( sizeof( ValidationCacheCreateInfoEXT ) == sizeof( VkValidationCacheCreateInfoEXT ), "struct and wrapper have different size!" ); - struct DeviceGroupBindSparseInfoKHX + struct ShaderModuleValidationCacheCreateInfoEXT { - DeviceGroupBindSparseInfoKHX( uint32_t resourceDeviceIndex_ = 0, uint32_t memoryDeviceIndex_ = 0 ) - : sType( StructureType::eDeviceGroupBindSparseInfoKHX ) - , pNext( nullptr ) - , resourceDeviceIndex( resourceDeviceIndex_ ) - , memoryDeviceIndex( memoryDeviceIndex_ ) + ShaderModuleValidationCacheCreateInfoEXT( ValidationCacheEXT validationCache_ = ValidationCacheEXT() ) + : validationCache( validationCache_ ) { } - DeviceGroupBindSparseInfoKHX( VkDeviceGroupBindSparseInfoKHX const & rhs ) + ShaderModuleValidationCacheCreateInfoEXT( VkShaderModuleValidationCacheCreateInfoEXT const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceGroupBindSparseInfoKHX ) ); + memcpy( this, &rhs, sizeof( ShaderModuleValidationCacheCreateInfoEXT ) ); } - DeviceGroupBindSparseInfoKHX& operator=( VkDeviceGroupBindSparseInfoKHX const & rhs ) + ShaderModuleValidationCacheCreateInfoEXT& operator=( VkShaderModuleValidationCacheCreateInfoEXT const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceGroupBindSparseInfoKHX ) ); + memcpy( this, &rhs, sizeof( ShaderModuleValidationCacheCreateInfoEXT ) ); return *this; } - DeviceGroupBindSparseInfoKHX& setPNext( const void* pNext_ ) + ShaderModuleValidationCacheCreateInfoEXT& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - DeviceGroupBindSparseInfoKHX& setResourceDeviceIndex( uint32_t resourceDeviceIndex_ ) - { - resourceDeviceIndex = resourceDeviceIndex_; - return *this; - } - - DeviceGroupBindSparseInfoKHX& setMemoryDeviceIndex( uint32_t memoryDeviceIndex_ ) + ShaderModuleValidationCacheCreateInfoEXT& setValidationCache( ValidationCacheEXT validationCache_ ) { - memoryDeviceIndex = memoryDeviceIndex_; + validationCache = validationCache_; return *this; } - operator const VkDeviceGroupBindSparseInfoKHX&() const + operator const VkShaderModuleValidationCacheCreateInfoEXT&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DeviceGroupBindSparseInfoKHX const& rhs ) const + bool operator==( ShaderModuleValidationCacheCreateInfoEXT const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( resourceDeviceIndex == rhs.resourceDeviceIndex ) - && ( memoryDeviceIndex == rhs.memoryDeviceIndex ); + && ( validationCache == rhs.validationCache ); } - bool operator!=( DeviceGroupBindSparseInfoKHX const& rhs ) const + bool operator!=( ShaderModuleValidationCacheCreateInfoEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eShaderModuleValidationCacheCreateInfoEXT; public: - const void* pNext; - uint32_t resourceDeviceIndex; - uint32_t memoryDeviceIndex; + const void* pNext = nullptr; + ValidationCacheEXT validationCache; }; - static_assert( sizeof( DeviceGroupBindSparseInfoKHX ) == sizeof( VkDeviceGroupBindSparseInfoKHX ), "struct and wrapper have different size!" ); + static_assert( sizeof( ShaderModuleValidationCacheCreateInfoEXT ) == sizeof( VkShaderModuleValidationCacheCreateInfoEXT ), "struct and wrapper have different size!" ); - struct ImageSwapchainCreateInfoKHX + struct PhysicalDeviceMaintenance3Properties { - ImageSwapchainCreateInfoKHX( SwapchainKHR swapchain_ = SwapchainKHR() ) - : sType( StructureType::eImageSwapchainCreateInfoKHX ) - , pNext( nullptr ) - , swapchain( swapchain_ ) + operator const VkPhysicalDeviceMaintenance3Properties&() const { + return *reinterpret_cast(this); } - ImageSwapchainCreateInfoKHX( VkImageSwapchainCreateInfoKHX const & rhs ) + bool operator==( PhysicalDeviceMaintenance3Properties const& rhs ) const { - memcpy( this, &rhs, sizeof( ImageSwapchainCreateInfoKHX ) ); + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( maxPerSetDescriptors == rhs.maxPerSetDescriptors ) + && ( maxMemoryAllocationSize == rhs.maxMemoryAllocationSize ); } - ImageSwapchainCreateInfoKHX& operator=( VkImageSwapchainCreateInfoKHX const & rhs ) - { - memcpy( this, &rhs, sizeof( ImageSwapchainCreateInfoKHX ) ); - return *this; - } - ImageSwapchainCreateInfoKHX& setPNext( const void* pNext_ ) + bool operator!=( PhysicalDeviceMaintenance3Properties const& rhs ) const { - pNext = pNext_; - return *this; + return !operator==( rhs ); } - ImageSwapchainCreateInfoKHX& setSwapchain( SwapchainKHR swapchain_ ) - { - swapchain = swapchain_; - return *this; - } + private: + StructureType sType = StructureType::ePhysicalDeviceMaintenance3Properties; + + public: + void* pNext = nullptr; + uint32_t maxPerSetDescriptors; + DeviceSize maxMemoryAllocationSize; + }; + static_assert( sizeof( PhysicalDeviceMaintenance3Properties ) == sizeof( VkPhysicalDeviceMaintenance3Properties ), "struct and wrapper have different size!" ); + + using PhysicalDeviceMaintenance3PropertiesKHR = PhysicalDeviceMaintenance3Properties; - operator const VkImageSwapchainCreateInfoKHX&() const + struct DescriptorSetLayoutSupport + { + operator const VkDescriptorSetLayoutSupport&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ImageSwapchainCreateInfoKHX const& rhs ) const + bool operator==( DescriptorSetLayoutSupport const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( swapchain == rhs.swapchain ); + && ( supported == rhs.supported ); } - bool operator!=( ImageSwapchainCreateInfoKHX const& rhs ) const + bool operator!=( DescriptorSetLayoutSupport const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDescriptorSetLayoutSupport; public: - const void* pNext; - SwapchainKHR swapchain; + void* pNext = nullptr; + Bool32 supported; }; - static_assert( sizeof( ImageSwapchainCreateInfoKHX ) == sizeof( VkImageSwapchainCreateInfoKHX ), "struct and wrapper have different size!" ); + static_assert( sizeof( DescriptorSetLayoutSupport ) == sizeof( VkDescriptorSetLayoutSupport ), "struct and wrapper have different size!" ); - struct BindImageMemorySwapchainInfoKHX + using DescriptorSetLayoutSupportKHR = DescriptorSetLayoutSupport; + + struct PhysicalDeviceShaderDrawParameterFeatures { - BindImageMemorySwapchainInfoKHX( SwapchainKHR swapchain_ = SwapchainKHR(), uint32_t imageIndex_ = 0 ) - : sType( StructureType::eBindImageMemorySwapchainInfoKHX ) - , pNext( nullptr ) - , swapchain( swapchain_ ) - , imageIndex( imageIndex_ ) + PhysicalDeviceShaderDrawParameterFeatures( Bool32 shaderDrawParameters_ = 0 ) + : shaderDrawParameters( shaderDrawParameters_ ) { } - BindImageMemorySwapchainInfoKHX( VkBindImageMemorySwapchainInfoKHX const & rhs ) + PhysicalDeviceShaderDrawParameterFeatures( VkPhysicalDeviceShaderDrawParameterFeatures const & rhs ) { - memcpy( this, &rhs, sizeof( BindImageMemorySwapchainInfoKHX ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceShaderDrawParameterFeatures ) ); } - BindImageMemorySwapchainInfoKHX& operator=( VkBindImageMemorySwapchainInfoKHX const & rhs ) + PhysicalDeviceShaderDrawParameterFeatures& operator=( VkPhysicalDeviceShaderDrawParameterFeatures const & rhs ) { - memcpy( this, &rhs, sizeof( BindImageMemorySwapchainInfoKHX ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceShaderDrawParameterFeatures ) ); return *this; } - BindImageMemorySwapchainInfoKHX& setPNext( const void* pNext_ ) + PhysicalDeviceShaderDrawParameterFeatures& setPNext( void* pNext_ ) { pNext = pNext_; return *this; } - BindImageMemorySwapchainInfoKHX& setSwapchain( SwapchainKHR swapchain_ ) + PhysicalDeviceShaderDrawParameterFeatures& setShaderDrawParameters( Bool32 shaderDrawParameters_ ) { - swapchain = swapchain_; - return *this; - } - - BindImageMemorySwapchainInfoKHX& setImageIndex( uint32_t imageIndex_ ) - { - imageIndex = imageIndex_; + shaderDrawParameters = shaderDrawParameters_; return *this; } - operator const VkBindImageMemorySwapchainInfoKHX&() const + operator const VkPhysicalDeviceShaderDrawParameterFeatures&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( BindImageMemorySwapchainInfoKHX const& rhs ) const + bool operator==( PhysicalDeviceShaderDrawParameterFeatures const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( swapchain == rhs.swapchain ) - && ( imageIndex == rhs.imageIndex ); + && ( shaderDrawParameters == rhs.shaderDrawParameters ); } - bool operator!=( BindImageMemorySwapchainInfoKHX const& rhs ) const + bool operator!=( PhysicalDeviceShaderDrawParameterFeatures const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceShaderDrawParameterFeatures; public: - const void* pNext; - SwapchainKHR swapchain; - uint32_t imageIndex; + void* pNext = nullptr; + Bool32 shaderDrawParameters; }; - static_assert( sizeof( BindImageMemorySwapchainInfoKHX ) == sizeof( VkBindImageMemorySwapchainInfoKHX ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceShaderDrawParameterFeatures ) == sizeof( VkPhysicalDeviceShaderDrawParameterFeatures ), "struct and wrapper have different size!" ); - struct AcquireNextImageInfoKHX + struct DebugUtilsLabelEXT { - AcquireNextImageInfoKHX( SwapchainKHR swapchain_ = SwapchainKHR(), uint64_t timeout_ = 0, Semaphore semaphore_ = Semaphore(), Fence fence_ = Fence(), uint32_t deviceMask_ = 0 ) - : sType( StructureType::eAcquireNextImageInfoKHX ) - , pNext( nullptr ) - , swapchain( swapchain_ ) - , timeout( timeout_ ) - , semaphore( semaphore_ ) - , fence( fence_ ) - , deviceMask( deviceMask_ ) + DebugUtilsLabelEXT( const char* pLabelName_ = nullptr, std::array const& color_ = { { 0, 0, 0, 0 } } ) + : pLabelName( pLabelName_ ) { + memcpy( &color, color_.data(), 4 * sizeof( float ) ); } - AcquireNextImageInfoKHX( VkAcquireNextImageInfoKHX const & rhs ) + DebugUtilsLabelEXT( VkDebugUtilsLabelEXT const & rhs ) { - memcpy( this, &rhs, sizeof( AcquireNextImageInfoKHX ) ); + memcpy( this, &rhs, sizeof( DebugUtilsLabelEXT ) ); } - AcquireNextImageInfoKHX& operator=( VkAcquireNextImageInfoKHX const & rhs ) + DebugUtilsLabelEXT& operator=( VkDebugUtilsLabelEXT const & rhs ) { - memcpy( this, &rhs, sizeof( AcquireNextImageInfoKHX ) ); + memcpy( this, &rhs, sizeof( DebugUtilsLabelEXT ) ); return *this; } - AcquireNextImageInfoKHX& setPNext( const void* pNext_ ) + DebugUtilsLabelEXT& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - AcquireNextImageInfoKHX& setSwapchain( SwapchainKHR swapchain_ ) - { - swapchain = swapchain_; - return *this; - } - - AcquireNextImageInfoKHX& setTimeout( uint64_t timeout_ ) - { - timeout = timeout_; - return *this; - } - - AcquireNextImageInfoKHX& setSemaphore( Semaphore semaphore_ ) - { - semaphore = semaphore_; - return *this; - } - - AcquireNextImageInfoKHX& setFence( Fence fence_ ) + DebugUtilsLabelEXT& setPLabelName( const char* pLabelName_ ) { - fence = fence_; + pLabelName = pLabelName_; return *this; } - AcquireNextImageInfoKHX& setDeviceMask( uint32_t deviceMask_ ) + DebugUtilsLabelEXT& setColor( std::array color_ ) { - deviceMask = deviceMask_; + memcpy( &color, color_.data(), 4 * sizeof( float ) ); return *this; } - operator const VkAcquireNextImageInfoKHX&() const + operator const VkDebugUtilsLabelEXT&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( AcquireNextImageInfoKHX const& rhs ) const + bool operator==( DebugUtilsLabelEXT const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( swapchain == rhs.swapchain ) - && ( timeout == rhs.timeout ) - && ( semaphore == rhs.semaphore ) - && ( fence == rhs.fence ) - && ( deviceMask == rhs.deviceMask ); + && ( pLabelName == rhs.pLabelName ) + && ( memcmp( color, rhs.color, 4 * sizeof( float ) ) == 0 ); } - bool operator!=( AcquireNextImageInfoKHX const& rhs ) const + bool operator!=( DebugUtilsLabelEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDebugUtilsLabelEXT; public: - const void* pNext; - SwapchainKHR swapchain; - uint64_t timeout; - Semaphore semaphore; - Fence fence; - uint32_t deviceMask; + const void* pNext = nullptr; + const char* pLabelName; + float color[4]; }; - static_assert( sizeof( AcquireNextImageInfoKHX ) == sizeof( VkAcquireNextImageInfoKHX ), "struct and wrapper have different size!" ); + static_assert( sizeof( DebugUtilsLabelEXT ) == sizeof( VkDebugUtilsLabelEXT ), "struct and wrapper have different size!" ); - struct HdrMetadataEXT + struct MemoryHostPointerPropertiesEXT { - HdrMetadataEXT( XYColorEXT displayPrimaryRed_ = XYColorEXT(), XYColorEXT displayPrimaryGreen_ = XYColorEXT(), XYColorEXT displayPrimaryBlue_ = XYColorEXT(), XYColorEXT whitePoint_ = XYColorEXT(), float maxLuminance_ = 0, float minLuminance_ = 0, float maxContentLightLevel_ = 0, float maxFrameAverageLightLevel_ = 0 ) - : sType( StructureType::eHdrMetadataEXT ) - , pNext( nullptr ) - , displayPrimaryRed( displayPrimaryRed_ ) - , displayPrimaryGreen( displayPrimaryGreen_ ) - , displayPrimaryBlue( displayPrimaryBlue_ ) - , whitePoint( whitePoint_ ) - , maxLuminance( maxLuminance_ ) - , minLuminance( minLuminance_ ) - , maxContentLightLevel( maxContentLightLevel_ ) - , maxFrameAverageLightLevel( maxFrameAverageLightLevel_ ) + MemoryHostPointerPropertiesEXT( uint32_t memoryTypeBits_ = 0 ) + : memoryTypeBits( memoryTypeBits_ ) { } - HdrMetadataEXT( VkHdrMetadataEXT const & rhs ) + MemoryHostPointerPropertiesEXT( VkMemoryHostPointerPropertiesEXT const & rhs ) { - memcpy( this, &rhs, sizeof( HdrMetadataEXT ) ); + memcpy( this, &rhs, sizeof( MemoryHostPointerPropertiesEXT ) ); } - HdrMetadataEXT& operator=( VkHdrMetadataEXT const & rhs ) + MemoryHostPointerPropertiesEXT& operator=( VkMemoryHostPointerPropertiesEXT const & rhs ) { - memcpy( this, &rhs, sizeof( HdrMetadataEXT ) ); + memcpy( this, &rhs, sizeof( MemoryHostPointerPropertiesEXT ) ); return *this; } - HdrMetadataEXT& setPNext( const void* pNext_ ) + MemoryHostPointerPropertiesEXT& setPNext( void* pNext_ ) { pNext = pNext_; return *this; } - HdrMetadataEXT& setDisplayPrimaryRed( XYColorEXT displayPrimaryRed_ ) + MemoryHostPointerPropertiesEXT& setMemoryTypeBits( uint32_t memoryTypeBits_ ) { - displayPrimaryRed = displayPrimaryRed_; + memoryTypeBits = memoryTypeBits_; return *this; } - HdrMetadataEXT& setDisplayPrimaryGreen( XYColorEXT displayPrimaryGreen_ ) + operator const VkMemoryHostPointerPropertiesEXT&() const { - displayPrimaryGreen = displayPrimaryGreen_; - return *this; + return *reinterpret_cast(this); } - HdrMetadataEXT& setDisplayPrimaryBlue( XYColorEXT displayPrimaryBlue_ ) + bool operator==( MemoryHostPointerPropertiesEXT const& rhs ) const { - displayPrimaryBlue = displayPrimaryBlue_; - return *this; + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( memoryTypeBits == rhs.memoryTypeBits ); } - HdrMetadataEXT& setWhitePoint( XYColorEXT whitePoint_ ) + bool operator!=( MemoryHostPointerPropertiesEXT const& rhs ) const { - whitePoint = whitePoint_; - return *this; + return !operator==( rhs ); } - HdrMetadataEXT& setMaxLuminance( float maxLuminance_ ) + private: + StructureType sType = StructureType::eMemoryHostPointerPropertiesEXT; + + public: + void* pNext = nullptr; + uint32_t memoryTypeBits; + }; + static_assert( sizeof( MemoryHostPointerPropertiesEXT ) == sizeof( VkMemoryHostPointerPropertiesEXT ), "struct and wrapper have different size!" ); + + struct PhysicalDeviceExternalMemoryHostPropertiesEXT + { + PhysicalDeviceExternalMemoryHostPropertiesEXT( DeviceSize minImportedHostPointerAlignment_ = 0 ) + : minImportedHostPointerAlignment( minImportedHostPointerAlignment_ ) { - maxLuminance = maxLuminance_; - return *this; } - HdrMetadataEXT& setMinLuminance( float minLuminance_ ) + PhysicalDeviceExternalMemoryHostPropertiesEXT( VkPhysicalDeviceExternalMemoryHostPropertiesEXT const & rhs ) { - minLuminance = minLuminance_; - return *this; + memcpy( this, &rhs, sizeof( PhysicalDeviceExternalMemoryHostPropertiesEXT ) ); } - HdrMetadataEXT& setMaxContentLightLevel( float maxContentLightLevel_ ) + PhysicalDeviceExternalMemoryHostPropertiesEXT& operator=( VkPhysicalDeviceExternalMemoryHostPropertiesEXT const & rhs ) { - maxContentLightLevel = maxContentLightLevel_; + memcpy( this, &rhs, sizeof( PhysicalDeviceExternalMemoryHostPropertiesEXT ) ); + return *this; + } + PhysicalDeviceExternalMemoryHostPropertiesEXT& setPNext( void* pNext_ ) + { + pNext = pNext_; return *this; } - HdrMetadataEXT& setMaxFrameAverageLightLevel( float maxFrameAverageLightLevel_ ) + PhysicalDeviceExternalMemoryHostPropertiesEXT& setMinImportedHostPointerAlignment( DeviceSize minImportedHostPointerAlignment_ ) { - maxFrameAverageLightLevel = maxFrameAverageLightLevel_; + minImportedHostPointerAlignment = minImportedHostPointerAlignment_; return *this; } - operator const VkHdrMetadataEXT&() const + operator const VkPhysicalDeviceExternalMemoryHostPropertiesEXT&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( HdrMetadataEXT const& rhs ) const + bool operator==( PhysicalDeviceExternalMemoryHostPropertiesEXT const& rhs ) const { 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 ); + && ( minImportedHostPointerAlignment == rhs.minImportedHostPointerAlignment ); } - bool operator!=( HdrMetadataEXT const& rhs ) const + bool operator!=( PhysicalDeviceExternalMemoryHostPropertiesEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceExternalMemoryHostPropertiesEXT; public: - const void* pNext; - XYColorEXT displayPrimaryRed; - XYColorEXT displayPrimaryGreen; - XYColorEXT displayPrimaryBlue; - XYColorEXT whitePoint; - float maxLuminance; - float minLuminance; - float maxContentLightLevel; - float maxFrameAverageLightLevel; + void* pNext = nullptr; + DeviceSize minImportedHostPointerAlignment; }; - static_assert( sizeof( HdrMetadataEXT ) == sizeof( VkHdrMetadataEXT ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceExternalMemoryHostPropertiesEXT ) == sizeof( VkPhysicalDeviceExternalMemoryHostPropertiesEXT ), "struct and wrapper have different size!" ); - struct PresentTimesInfoGOOGLE + struct PhysicalDeviceConservativeRasterizationPropertiesEXT { - PresentTimesInfoGOOGLE( uint32_t swapchainCount_ = 0, const PresentTimeGOOGLE* pTimes_ = nullptr ) - : sType( StructureType::ePresentTimesInfoGOOGLE ) - , pNext( nullptr ) - , swapchainCount( swapchainCount_ ) - , pTimes( pTimes_ ) + PhysicalDeviceConservativeRasterizationPropertiesEXT( float primitiveOverestimationSize_ = 0, float maxExtraPrimitiveOverestimationSize_ = 0, float extraPrimitiveOverestimationSizeGranularity_ = 0, Bool32 primitiveUnderestimation_ = 0, Bool32 conservativePointAndLineRasterization_ = 0, Bool32 degenerateTrianglesRasterized_ = 0, Bool32 degenerateLinesRasterized_ = 0, Bool32 fullyCoveredFragmentShaderInputVariable_ = 0, Bool32 conservativeRasterizationPostDepthCoverage_ = 0 ) + : primitiveOverestimationSize( primitiveOverestimationSize_ ) + , maxExtraPrimitiveOverestimationSize( maxExtraPrimitiveOverestimationSize_ ) + , extraPrimitiveOverestimationSizeGranularity( extraPrimitiveOverestimationSizeGranularity_ ) + , primitiveUnderestimation( primitiveUnderestimation_ ) + , conservativePointAndLineRasterization( conservativePointAndLineRasterization_ ) + , degenerateTrianglesRasterized( degenerateTrianglesRasterized_ ) + , degenerateLinesRasterized( degenerateLinesRasterized_ ) + , fullyCoveredFragmentShaderInputVariable( fullyCoveredFragmentShaderInputVariable_ ) + , conservativeRasterizationPostDepthCoverage( conservativeRasterizationPostDepthCoverage_ ) { } - PresentTimesInfoGOOGLE( VkPresentTimesInfoGOOGLE const & rhs ) + PhysicalDeviceConservativeRasterizationPropertiesEXT( VkPhysicalDeviceConservativeRasterizationPropertiesEXT const & rhs ) { - memcpy( this, &rhs, sizeof( PresentTimesInfoGOOGLE ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceConservativeRasterizationPropertiesEXT ) ); } - PresentTimesInfoGOOGLE& operator=( VkPresentTimesInfoGOOGLE const & rhs ) + PhysicalDeviceConservativeRasterizationPropertiesEXT& operator=( VkPhysicalDeviceConservativeRasterizationPropertiesEXT const & rhs ) { - memcpy( this, &rhs, sizeof( PresentTimesInfoGOOGLE ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceConservativeRasterizationPropertiesEXT ) ); return *this; } - PresentTimesInfoGOOGLE& setPNext( const void* pNext_ ) + PhysicalDeviceConservativeRasterizationPropertiesEXT& setPNext( void* pNext_ ) { pNext = pNext_; return *this; } - PresentTimesInfoGOOGLE& setSwapchainCount( uint32_t swapchainCount_ ) + PhysicalDeviceConservativeRasterizationPropertiesEXT& setPrimitiveOverestimationSize( float primitiveOverestimationSize_ ) { - swapchainCount = swapchainCount_; + primitiveOverestimationSize = primitiveOverestimationSize_; return *this; } - PresentTimesInfoGOOGLE& setPTimes( const PresentTimeGOOGLE* pTimes_ ) + PhysicalDeviceConservativeRasterizationPropertiesEXT& setMaxExtraPrimitiveOverestimationSize( float maxExtraPrimitiveOverestimationSize_ ) { - pTimes = pTimes_; + maxExtraPrimitiveOverestimationSize = maxExtraPrimitiveOverestimationSize_; return *this; } - operator const VkPresentTimesInfoGOOGLE&() const - { - return *reinterpret_cast(this); - } - - bool operator==( PresentTimesInfoGOOGLE const& rhs ) const - { - return ( sType == rhs.sType ) - && ( pNext == rhs.pNext ) - && ( swapchainCount == rhs.swapchainCount ) - && ( pTimes == rhs.pTimes ); - } - - bool operator!=( PresentTimesInfoGOOGLE const& rhs ) const + PhysicalDeviceConservativeRasterizationPropertiesEXT& setExtraPrimitiveOverestimationSizeGranularity( float extraPrimitiveOverestimationSizeGranularity_ ) { - return !operator==( rhs ); + extraPrimitiveOverestimationSizeGranularity = extraPrimitiveOverestimationSizeGranularity_; + return *this; } - private: - StructureType sType; - - public: - const void* pNext; - uint32_t swapchainCount; - const PresentTimeGOOGLE* pTimes; - }; - static_assert( sizeof( PresentTimesInfoGOOGLE ) == sizeof( VkPresentTimesInfoGOOGLE ), "struct and wrapper have different size!" ); - -#ifdef VK_USE_PLATFORM_IOS_MVK - struct IOSSurfaceCreateInfoMVK - { - IOSSurfaceCreateInfoMVK( IOSSurfaceCreateFlagsMVK flags_ = IOSSurfaceCreateFlagsMVK(), const void* pView_ = nullptr ) - : sType( StructureType::eIOSSurfaceCreateInfoMVK ) - , pNext( nullptr ) - , flags( flags_ ) - , pView( pView_ ) + PhysicalDeviceConservativeRasterizationPropertiesEXT& setPrimitiveUnderestimation( Bool32 primitiveUnderestimation_ ) { + primitiveUnderestimation = primitiveUnderestimation_; + return *this; } - IOSSurfaceCreateInfoMVK( VkIOSSurfaceCreateInfoMVK const & rhs ) + PhysicalDeviceConservativeRasterizationPropertiesEXT& setConservativePointAndLineRasterization( Bool32 conservativePointAndLineRasterization_ ) { - memcpy( this, &rhs, sizeof( IOSSurfaceCreateInfoMVK ) ); + conservativePointAndLineRasterization = conservativePointAndLineRasterization_; + return *this; } - IOSSurfaceCreateInfoMVK& operator=( VkIOSSurfaceCreateInfoMVK const & rhs ) + PhysicalDeviceConservativeRasterizationPropertiesEXT& setDegenerateTrianglesRasterized( Bool32 degenerateTrianglesRasterized_ ) { - memcpy( this, &rhs, sizeof( IOSSurfaceCreateInfoMVK ) ); + degenerateTrianglesRasterized = degenerateTrianglesRasterized_; return *this; } - IOSSurfaceCreateInfoMVK& setPNext( const void* pNext_ ) + + PhysicalDeviceConservativeRasterizationPropertiesEXT& setDegenerateLinesRasterized( Bool32 degenerateLinesRasterized_ ) { - pNext = pNext_; + degenerateLinesRasterized = degenerateLinesRasterized_; return *this; } - IOSSurfaceCreateInfoMVK& setFlags( IOSSurfaceCreateFlagsMVK flags_ ) + PhysicalDeviceConservativeRasterizationPropertiesEXT& setFullyCoveredFragmentShaderInputVariable( Bool32 fullyCoveredFragmentShaderInputVariable_ ) { - flags = flags_; + fullyCoveredFragmentShaderInputVariable = fullyCoveredFragmentShaderInputVariable_; return *this; } - IOSSurfaceCreateInfoMVK& setPView( const void* pView_ ) + PhysicalDeviceConservativeRasterizationPropertiesEXT& setConservativeRasterizationPostDepthCoverage( Bool32 conservativeRasterizationPostDepthCoverage_ ) { - pView = pView_; + conservativeRasterizationPostDepthCoverage = conservativeRasterizationPostDepthCoverage_; return *this; } - operator const VkIOSSurfaceCreateInfoMVK&() const + operator const VkPhysicalDeviceConservativeRasterizationPropertiesEXT&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( IOSSurfaceCreateInfoMVK const& rhs ) const + bool operator==( PhysicalDeviceConservativeRasterizationPropertiesEXT const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( pView == rhs.pView ); + && ( 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 ); } - bool operator!=( IOSSurfaceCreateInfoMVK const& rhs ) const + bool operator!=( PhysicalDeviceConservativeRasterizationPropertiesEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceConservativeRasterizationPropertiesEXT; public: - const void* pNext; - IOSSurfaceCreateFlagsMVK flags; - const void* pView; + void* pNext = nullptr; + float primitiveOverestimationSize; + float maxExtraPrimitiveOverestimationSize; + float extraPrimitiveOverestimationSizeGranularity; + Bool32 primitiveUnderestimation; + Bool32 conservativePointAndLineRasterization; + Bool32 degenerateTrianglesRasterized; + Bool32 degenerateLinesRasterized; + Bool32 fullyCoveredFragmentShaderInputVariable; + Bool32 conservativeRasterizationPostDepthCoverage; }; - static_assert( sizeof( IOSSurfaceCreateInfoMVK ) == sizeof( VkIOSSurfaceCreateInfoMVK ), "struct and wrapper have different size!" ); -#endif /*VK_USE_PLATFORM_IOS_MVK*/ + static_assert( sizeof( PhysicalDeviceConservativeRasterizationPropertiesEXT ) == sizeof( VkPhysicalDeviceConservativeRasterizationPropertiesEXT ), "struct and wrapper have different size!" ); -#ifdef VK_USE_PLATFORM_MACOS_MVK - struct MacOSSurfaceCreateInfoMVK + struct PhysicalDeviceShaderCorePropertiesAMD { - MacOSSurfaceCreateInfoMVK( MacOSSurfaceCreateFlagsMVK flags_ = MacOSSurfaceCreateFlagsMVK(), const void* pView_ = nullptr ) - : sType( StructureType::eMacOSSurfaceCreateInfoMVK ) - , pNext( nullptr ) - , flags( flags_ ) - , pView( pView_ ) + operator const VkPhysicalDeviceShaderCorePropertiesAMD&() const { + return *reinterpret_cast(this); } - MacOSSurfaceCreateInfoMVK( VkMacOSSurfaceCreateInfoMVK const & rhs ) + bool operator==( PhysicalDeviceShaderCorePropertiesAMD const& rhs ) const { - memcpy( this, &rhs, sizeof( MacOSSurfaceCreateInfoMVK ) ); + 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 ); } - MacOSSurfaceCreateInfoMVK& operator=( VkMacOSSurfaceCreateInfoMVK const & rhs ) + bool operator!=( PhysicalDeviceShaderCorePropertiesAMD const& rhs ) const { - memcpy( this, &rhs, sizeof( MacOSSurfaceCreateInfoMVK ) ); + return !operator==( rhs ); + } + + private: + StructureType sType = StructureType::ePhysicalDeviceShaderCorePropertiesAMD; + + public: + void* pNext = nullptr; + 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; + }; + static_assert( sizeof( PhysicalDeviceShaderCorePropertiesAMD ) == sizeof( VkPhysicalDeviceShaderCorePropertiesAMD ), "struct and wrapper have different size!" ); + + struct PhysicalDeviceDescriptorIndexingFeaturesEXT + { + PhysicalDeviceDescriptorIndexingFeaturesEXT( Bool32 shaderInputAttachmentArrayDynamicIndexing_ = 0, Bool32 shaderUniformTexelBufferArrayDynamicIndexing_ = 0, Bool32 shaderStorageTexelBufferArrayDynamicIndexing_ = 0, Bool32 shaderUniformBufferArrayNonUniformIndexing_ = 0, Bool32 shaderSampledImageArrayNonUniformIndexing_ = 0, Bool32 shaderStorageBufferArrayNonUniformIndexing_ = 0, Bool32 shaderStorageImageArrayNonUniformIndexing_ = 0, Bool32 shaderInputAttachmentArrayNonUniformIndexing_ = 0, Bool32 shaderUniformTexelBufferArrayNonUniformIndexing_ = 0, Bool32 shaderStorageTexelBufferArrayNonUniformIndexing_ = 0, Bool32 descriptorBindingUniformBufferUpdateAfterBind_ = 0, Bool32 descriptorBindingSampledImageUpdateAfterBind_ = 0, Bool32 descriptorBindingStorageImageUpdateAfterBind_ = 0, Bool32 descriptorBindingStorageBufferUpdateAfterBind_ = 0, Bool32 descriptorBindingUniformTexelBufferUpdateAfterBind_ = 0, Bool32 descriptorBindingStorageTexelBufferUpdateAfterBind_ = 0, Bool32 descriptorBindingUpdateUnusedWhilePending_ = 0, Bool32 descriptorBindingPartiallyBound_ = 0, Bool32 descriptorBindingVariableDescriptorCount_ = 0, Bool32 runtimeDescriptorArray_ = 0 ) + : 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_ ) + { + } + + PhysicalDeviceDescriptorIndexingFeaturesEXT( VkPhysicalDeviceDescriptorIndexingFeaturesEXT const & rhs ) + { + memcpy( this, &rhs, sizeof( PhysicalDeviceDescriptorIndexingFeaturesEXT ) ); + } + + PhysicalDeviceDescriptorIndexingFeaturesEXT& operator=( VkPhysicalDeviceDescriptorIndexingFeaturesEXT const & rhs ) + { + memcpy( this, &rhs, sizeof( PhysicalDeviceDescriptorIndexingFeaturesEXT ) ); return *this; } - MacOSSurfaceCreateInfoMVK& setPNext( const void* pNext_ ) + PhysicalDeviceDescriptorIndexingFeaturesEXT& setPNext( void* pNext_ ) { pNext = pNext_; return *this; } - MacOSSurfaceCreateInfoMVK& setFlags( MacOSSurfaceCreateFlagsMVK flags_ ) + PhysicalDeviceDescriptorIndexingFeaturesEXT& setShaderInputAttachmentArrayDynamicIndexing( Bool32 shaderInputAttachmentArrayDynamicIndexing_ ) { - flags = flags_; + shaderInputAttachmentArrayDynamicIndexing = shaderInputAttachmentArrayDynamicIndexing_; return *this; } - MacOSSurfaceCreateInfoMVK& setPView( const void* pView_ ) + PhysicalDeviceDescriptorIndexingFeaturesEXT& setShaderUniformTexelBufferArrayDynamicIndexing( Bool32 shaderUniformTexelBufferArrayDynamicIndexing_ ) { - pView = pView_; + shaderUniformTexelBufferArrayDynamicIndexing = shaderUniformTexelBufferArrayDynamicIndexing_; return *this; } - operator const VkMacOSSurfaceCreateInfoMVK&() const + PhysicalDeviceDescriptorIndexingFeaturesEXT& setShaderStorageTexelBufferArrayDynamicIndexing( Bool32 shaderStorageTexelBufferArrayDynamicIndexing_ ) { - return *reinterpret_cast(this); + shaderStorageTexelBufferArrayDynamicIndexing = shaderStorageTexelBufferArrayDynamicIndexing_; + return *this; } - bool operator==( MacOSSurfaceCreateInfoMVK const& rhs ) const + PhysicalDeviceDescriptorIndexingFeaturesEXT& setShaderUniformBufferArrayNonUniformIndexing( Bool32 shaderUniformBufferArrayNonUniformIndexing_ ) { - return ( sType == rhs.sType ) - && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( pView == rhs.pView ); + shaderUniformBufferArrayNonUniformIndexing = shaderUniformBufferArrayNonUniformIndexing_; + return *this; } - bool operator!=( MacOSSurfaceCreateInfoMVK const& rhs ) const + PhysicalDeviceDescriptorIndexingFeaturesEXT& setShaderSampledImageArrayNonUniformIndexing( Bool32 shaderSampledImageArrayNonUniformIndexing_ ) { - return !operator==( rhs ); + shaderSampledImageArrayNonUniformIndexing = shaderSampledImageArrayNonUniformIndexing_; + return *this; } - private: - StructureType sType; - - public: - const void* pNext; - MacOSSurfaceCreateFlagsMVK flags; - const void* pView; - }; - static_assert( sizeof( MacOSSurfaceCreateInfoMVK ) == sizeof( VkMacOSSurfaceCreateInfoMVK ), "struct and wrapper have different size!" ); -#endif /*VK_USE_PLATFORM_MACOS_MVK*/ - - struct PipelineViewportWScalingStateCreateInfoNV - { - PipelineViewportWScalingStateCreateInfoNV( Bool32 viewportWScalingEnable_ = 0, uint32_t viewportCount_ = 0, const ViewportWScalingNV* pViewportWScalings_ = nullptr ) - : sType( StructureType::ePipelineViewportWScalingStateCreateInfoNV ) - , pNext( nullptr ) - , viewportWScalingEnable( viewportWScalingEnable_ ) - , viewportCount( viewportCount_ ) - , pViewportWScalings( pViewportWScalings_ ) + PhysicalDeviceDescriptorIndexingFeaturesEXT& setShaderStorageBufferArrayNonUniformIndexing( Bool32 shaderStorageBufferArrayNonUniformIndexing_ ) { + shaderStorageBufferArrayNonUniformIndexing = shaderStorageBufferArrayNonUniformIndexing_; + return *this; } - PipelineViewportWScalingStateCreateInfoNV( VkPipelineViewportWScalingStateCreateInfoNV const & rhs ) + PhysicalDeviceDescriptorIndexingFeaturesEXT& setShaderStorageImageArrayNonUniformIndexing( Bool32 shaderStorageImageArrayNonUniformIndexing_ ) { - memcpy( this, &rhs, sizeof( PipelineViewportWScalingStateCreateInfoNV ) ); + shaderStorageImageArrayNonUniformIndexing = shaderStorageImageArrayNonUniformIndexing_; + return *this; } - PipelineViewportWScalingStateCreateInfoNV& operator=( VkPipelineViewportWScalingStateCreateInfoNV const & rhs ) + PhysicalDeviceDescriptorIndexingFeaturesEXT& setShaderInputAttachmentArrayNonUniformIndexing( Bool32 shaderInputAttachmentArrayNonUniformIndexing_ ) { - memcpy( this, &rhs, sizeof( PipelineViewportWScalingStateCreateInfoNV ) ); + shaderInputAttachmentArrayNonUniformIndexing = shaderInputAttachmentArrayNonUniformIndexing_; return *this; } - PipelineViewportWScalingStateCreateInfoNV& setPNext( const void* pNext_ ) + + PhysicalDeviceDescriptorIndexingFeaturesEXT& setShaderUniformTexelBufferArrayNonUniformIndexing( Bool32 shaderUniformTexelBufferArrayNonUniformIndexing_ ) { - pNext = pNext_; + shaderUniformTexelBufferArrayNonUniformIndexing = shaderUniformTexelBufferArrayNonUniformIndexing_; return *this; } - PipelineViewportWScalingStateCreateInfoNV& setViewportWScalingEnable( Bool32 viewportWScalingEnable_ ) + PhysicalDeviceDescriptorIndexingFeaturesEXT& setShaderStorageTexelBufferArrayNonUniformIndexing( Bool32 shaderStorageTexelBufferArrayNonUniformIndexing_ ) { - viewportWScalingEnable = viewportWScalingEnable_; + shaderStorageTexelBufferArrayNonUniformIndexing = shaderStorageTexelBufferArrayNonUniformIndexing_; return *this; } - PipelineViewportWScalingStateCreateInfoNV& setViewportCount( uint32_t viewportCount_ ) + PhysicalDeviceDescriptorIndexingFeaturesEXT& setDescriptorBindingUniformBufferUpdateAfterBind( Bool32 descriptorBindingUniformBufferUpdateAfterBind_ ) { - viewportCount = viewportCount_; + descriptorBindingUniformBufferUpdateAfterBind = descriptorBindingUniformBufferUpdateAfterBind_; return *this; } - PipelineViewportWScalingStateCreateInfoNV& setPViewportWScalings( const ViewportWScalingNV* pViewportWScalings_ ) + PhysicalDeviceDescriptorIndexingFeaturesEXT& setDescriptorBindingSampledImageUpdateAfterBind( Bool32 descriptorBindingSampledImageUpdateAfterBind_ ) { - pViewportWScalings = pViewportWScalings_; + descriptorBindingSampledImageUpdateAfterBind = descriptorBindingSampledImageUpdateAfterBind_; return *this; } - operator const VkPipelineViewportWScalingStateCreateInfoNV&() const + PhysicalDeviceDescriptorIndexingFeaturesEXT& setDescriptorBindingStorageImageUpdateAfterBind( Bool32 descriptorBindingStorageImageUpdateAfterBind_ ) { - return *reinterpret_cast(this); + descriptorBindingStorageImageUpdateAfterBind = descriptorBindingStorageImageUpdateAfterBind_; + return *this; } - bool operator==( PipelineViewportWScalingStateCreateInfoNV const& rhs ) const + PhysicalDeviceDescriptorIndexingFeaturesEXT& setDescriptorBindingStorageBufferUpdateAfterBind( Bool32 descriptorBindingStorageBufferUpdateAfterBind_ ) { - return ( sType == rhs.sType ) - && ( pNext == rhs.pNext ) - && ( viewportWScalingEnable == rhs.viewportWScalingEnable ) - && ( viewportCount == rhs.viewportCount ) - && ( pViewportWScalings == rhs.pViewportWScalings ); + descriptorBindingStorageBufferUpdateAfterBind = descriptorBindingStorageBufferUpdateAfterBind_; + return *this; } - bool operator!=( PipelineViewportWScalingStateCreateInfoNV const& rhs ) const + PhysicalDeviceDescriptorIndexingFeaturesEXT& setDescriptorBindingUniformTexelBufferUpdateAfterBind( Bool32 descriptorBindingUniformTexelBufferUpdateAfterBind_ ) { - return !operator==( rhs ); + descriptorBindingUniformTexelBufferUpdateAfterBind = descriptorBindingUniformTexelBufferUpdateAfterBind_; + return *this; } - private: - StructureType sType; - - public: - const void* pNext; - Bool32 viewportWScalingEnable; - uint32_t viewportCount; - const ViewportWScalingNV* pViewportWScalings; - }; - static_assert( sizeof( PipelineViewportWScalingStateCreateInfoNV ) == sizeof( VkPipelineViewportWScalingStateCreateInfoNV ), "struct and wrapper have different size!" ); - - struct PhysicalDeviceDiscardRectanglePropertiesEXT - { - PhysicalDeviceDiscardRectanglePropertiesEXT( uint32_t maxDiscardRectangles_ = 0 ) - : sType( StructureType::ePhysicalDeviceDiscardRectanglePropertiesEXT ) - , pNext( nullptr ) - , maxDiscardRectangles( maxDiscardRectangles_ ) + PhysicalDeviceDescriptorIndexingFeaturesEXT& setDescriptorBindingStorageTexelBufferUpdateAfterBind( Bool32 descriptorBindingStorageTexelBufferUpdateAfterBind_ ) { + descriptorBindingStorageTexelBufferUpdateAfterBind = descriptorBindingStorageTexelBufferUpdateAfterBind_; + return *this; } - PhysicalDeviceDiscardRectanglePropertiesEXT( VkPhysicalDeviceDiscardRectanglePropertiesEXT const & rhs ) + PhysicalDeviceDescriptorIndexingFeaturesEXT& setDescriptorBindingUpdateUnusedWhilePending( Bool32 descriptorBindingUpdateUnusedWhilePending_ ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceDiscardRectanglePropertiesEXT ) ); + descriptorBindingUpdateUnusedWhilePending = descriptorBindingUpdateUnusedWhilePending_; + return *this; } - PhysicalDeviceDiscardRectanglePropertiesEXT& operator=( VkPhysicalDeviceDiscardRectanglePropertiesEXT const & rhs ) + PhysicalDeviceDescriptorIndexingFeaturesEXT& setDescriptorBindingPartiallyBound( Bool32 descriptorBindingPartiallyBound_ ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceDiscardRectanglePropertiesEXT ) ); + descriptorBindingPartiallyBound = descriptorBindingPartiallyBound_; return *this; } - PhysicalDeviceDiscardRectanglePropertiesEXT& setPNext( void* pNext_ ) + + PhysicalDeviceDescriptorIndexingFeaturesEXT& setDescriptorBindingVariableDescriptorCount( Bool32 descriptorBindingVariableDescriptorCount_ ) { - pNext = pNext_; + descriptorBindingVariableDescriptorCount = descriptorBindingVariableDescriptorCount_; return *this; } - PhysicalDeviceDiscardRectanglePropertiesEXT& setMaxDiscardRectangles( uint32_t maxDiscardRectangles_ ) + PhysicalDeviceDescriptorIndexingFeaturesEXT& setRuntimeDescriptorArray( Bool32 runtimeDescriptorArray_ ) { - maxDiscardRectangles = maxDiscardRectangles_; + runtimeDescriptorArray = runtimeDescriptorArray_; return *this; } - operator const VkPhysicalDeviceDiscardRectanglePropertiesEXT&() const + operator const VkPhysicalDeviceDescriptorIndexingFeaturesEXT&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceDiscardRectanglePropertiesEXT const& rhs ) const + bool operator==( PhysicalDeviceDescriptorIndexingFeaturesEXT const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( maxDiscardRectangles == rhs.maxDiscardRectangles ); + && ( 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 ); } - bool operator!=( PhysicalDeviceDiscardRectanglePropertiesEXT const& rhs ) const + bool operator!=( PhysicalDeviceDescriptorIndexingFeaturesEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceDescriptorIndexingFeaturesEXT; public: - void* pNext; - uint32_t maxDiscardRectangles; + void* pNext = nullptr; + Bool32 shaderInputAttachmentArrayDynamicIndexing; + Bool32 shaderUniformTexelBufferArrayDynamicIndexing; + Bool32 shaderStorageTexelBufferArrayDynamicIndexing; + Bool32 shaderUniformBufferArrayNonUniformIndexing; + Bool32 shaderSampledImageArrayNonUniformIndexing; + Bool32 shaderStorageBufferArrayNonUniformIndexing; + Bool32 shaderStorageImageArrayNonUniformIndexing; + Bool32 shaderInputAttachmentArrayNonUniformIndexing; + Bool32 shaderUniformTexelBufferArrayNonUniformIndexing; + Bool32 shaderStorageTexelBufferArrayNonUniformIndexing; + Bool32 descriptorBindingUniformBufferUpdateAfterBind; + Bool32 descriptorBindingSampledImageUpdateAfterBind; + Bool32 descriptorBindingStorageImageUpdateAfterBind; + Bool32 descriptorBindingStorageBufferUpdateAfterBind; + Bool32 descriptorBindingUniformTexelBufferUpdateAfterBind; + Bool32 descriptorBindingStorageTexelBufferUpdateAfterBind; + Bool32 descriptorBindingUpdateUnusedWhilePending; + Bool32 descriptorBindingPartiallyBound; + Bool32 descriptorBindingVariableDescriptorCount; + Bool32 runtimeDescriptorArray; }; - static_assert( sizeof( PhysicalDeviceDiscardRectanglePropertiesEXT ) == sizeof( VkPhysicalDeviceDiscardRectanglePropertiesEXT ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceDescriptorIndexingFeaturesEXT ) == sizeof( VkPhysicalDeviceDescriptorIndexingFeaturesEXT ), "struct and wrapper have different size!" ); - struct PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX + struct PhysicalDeviceDescriptorIndexingPropertiesEXT { - operator const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX&() const + operator const VkPhysicalDeviceDescriptorIndexingPropertiesEXT&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX const& rhs ) const + bool operator==( PhysicalDeviceDescriptorIndexingPropertiesEXT const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( perViewPositionAllComponents == rhs.perViewPositionAllComponents ); + && ( 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 ); } - bool operator!=( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX const& rhs ) const + bool operator!=( PhysicalDeviceDescriptorIndexingPropertiesEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceDescriptorIndexingPropertiesEXT; public: - void* pNext; - Bool32 perViewPositionAllComponents; + void* pNext = nullptr; + uint32_t maxUpdateAfterBindDescriptorsInAllPools; + Bool32 shaderUniformBufferArrayNonUniformIndexingNative; + Bool32 shaderSampledImageArrayNonUniformIndexingNative; + Bool32 shaderStorageBufferArrayNonUniformIndexingNative; + Bool32 shaderStorageImageArrayNonUniformIndexingNative; + Bool32 shaderInputAttachmentArrayNonUniformIndexingNative; + Bool32 robustBufferAccessUpdateAfterBind; + 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; }; - static_assert( sizeof( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX ) == sizeof( VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceDescriptorIndexingPropertiesEXT ) == sizeof( VkPhysicalDeviceDescriptorIndexingPropertiesEXT ), "struct and wrapper have different size!" ); - struct PhysicalDeviceSurfaceInfo2KHR + struct DescriptorSetVariableDescriptorCountAllocateInfoEXT { - PhysicalDeviceSurfaceInfo2KHR( SurfaceKHR surface_ = SurfaceKHR() ) - : sType( StructureType::ePhysicalDeviceSurfaceInfo2KHR ) - , pNext( nullptr ) - , surface( surface_ ) + DescriptorSetVariableDescriptorCountAllocateInfoEXT( uint32_t descriptorSetCount_ = 0, const uint32_t* pDescriptorCounts_ = nullptr ) + : descriptorSetCount( descriptorSetCount_ ) + , pDescriptorCounts( pDescriptorCounts_ ) { } - PhysicalDeviceSurfaceInfo2KHR( VkPhysicalDeviceSurfaceInfo2KHR const & rhs ) + DescriptorSetVariableDescriptorCountAllocateInfoEXT( VkDescriptorSetVariableDescriptorCountAllocateInfoEXT const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceSurfaceInfo2KHR ) ); + memcpy( this, &rhs, sizeof( DescriptorSetVariableDescriptorCountAllocateInfoEXT ) ); } - PhysicalDeviceSurfaceInfo2KHR& operator=( VkPhysicalDeviceSurfaceInfo2KHR const & rhs ) + DescriptorSetVariableDescriptorCountAllocateInfoEXT& operator=( VkDescriptorSetVariableDescriptorCountAllocateInfoEXT const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceSurfaceInfo2KHR ) ); + memcpy( this, &rhs, sizeof( DescriptorSetVariableDescriptorCountAllocateInfoEXT ) ); return *this; } - PhysicalDeviceSurfaceInfo2KHR& setPNext( const void* pNext_ ) + DescriptorSetVariableDescriptorCountAllocateInfoEXT& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PhysicalDeviceSurfaceInfo2KHR& setSurface( SurfaceKHR surface_ ) + DescriptorSetVariableDescriptorCountAllocateInfoEXT& setDescriptorSetCount( uint32_t descriptorSetCount_ ) { - surface = surface_; + descriptorSetCount = descriptorSetCount_; return *this; } - operator const VkPhysicalDeviceSurfaceInfo2KHR&() const + DescriptorSetVariableDescriptorCountAllocateInfoEXT& setPDescriptorCounts( const uint32_t* pDescriptorCounts_ ) { - return *reinterpret_cast(this); + pDescriptorCounts = pDescriptorCounts_; + return *this; } - bool operator==( PhysicalDeviceSurfaceInfo2KHR const& rhs ) const + operator const VkDescriptorSetVariableDescriptorCountAllocateInfoEXT&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DescriptorSetVariableDescriptorCountAllocateInfoEXT const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( surface == rhs.surface ); + && ( descriptorSetCount == rhs.descriptorSetCount ) + && ( pDescriptorCounts == rhs.pDescriptorCounts ); } - bool operator!=( PhysicalDeviceSurfaceInfo2KHR const& rhs ) const + bool operator!=( DescriptorSetVariableDescriptorCountAllocateInfoEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDescriptorSetVariableDescriptorCountAllocateInfoEXT; public: - const void* pNext; - SurfaceKHR surface; + const void* pNext = nullptr; + uint32_t descriptorSetCount; + const uint32_t* pDescriptorCounts; }; - static_assert( sizeof( PhysicalDeviceSurfaceInfo2KHR ) == sizeof( VkPhysicalDeviceSurfaceInfo2KHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( DescriptorSetVariableDescriptorCountAllocateInfoEXT ) == sizeof( VkDescriptorSetVariableDescriptorCountAllocateInfoEXT ), "struct and wrapper have different size!" ); - struct PhysicalDevice16BitStorageFeaturesKHR + struct DescriptorSetVariableDescriptorCountLayoutSupportEXT { - PhysicalDevice16BitStorageFeaturesKHR( Bool32 storageBuffer16BitAccess_ = 0, Bool32 uniformAndStorageBuffer16BitAccess_ = 0, Bool32 storagePushConstant16_ = 0, Bool32 storageInputOutput16_ = 0 ) - : sType( StructureType::ePhysicalDevice16BitStorageFeaturesKHR ) - , pNext( nullptr ) - , storageBuffer16BitAccess( storageBuffer16BitAccess_ ) - , uniformAndStorageBuffer16BitAccess( uniformAndStorageBuffer16BitAccess_ ) - , storagePushConstant16( storagePushConstant16_ ) - , storageInputOutput16( storageInputOutput16_ ) - { - } - - PhysicalDevice16BitStorageFeaturesKHR( VkPhysicalDevice16BitStorageFeaturesKHR const & rhs ) - { - memcpy( this, &rhs, sizeof( PhysicalDevice16BitStorageFeaturesKHR ) ); - } - - PhysicalDevice16BitStorageFeaturesKHR& operator=( VkPhysicalDevice16BitStorageFeaturesKHR const & rhs ) - { - memcpy( this, &rhs, sizeof( PhysicalDevice16BitStorageFeaturesKHR ) ); - return *this; - } - PhysicalDevice16BitStorageFeaturesKHR& setPNext( void* pNext_ ) - { - pNext = pNext_; - return *this; - } - - PhysicalDevice16BitStorageFeaturesKHR& setStorageBuffer16BitAccess( Bool32 storageBuffer16BitAccess_ ) - { - storageBuffer16BitAccess = storageBuffer16BitAccess_; - return *this; - } - - PhysicalDevice16BitStorageFeaturesKHR& setUniformAndStorageBuffer16BitAccess( Bool32 uniformAndStorageBuffer16BitAccess_ ) + operator const VkDescriptorSetVariableDescriptorCountLayoutSupportEXT&() const { - uniformAndStorageBuffer16BitAccess = uniformAndStorageBuffer16BitAccess_; - return *this; - } - - PhysicalDevice16BitStorageFeaturesKHR& setStoragePushConstant16( Bool32 storagePushConstant16_ ) - { - storagePushConstant16 = storagePushConstant16_; - return *this; - } - - PhysicalDevice16BitStorageFeaturesKHR& setStorageInputOutput16( Bool32 storageInputOutput16_ ) - { - storageInputOutput16 = storageInputOutput16_; - return *this; + return *reinterpret_cast(this); } - operator const VkPhysicalDevice16BitStorageFeaturesKHR&() const - { - return *reinterpret_cast(this); - } - - bool operator==( PhysicalDevice16BitStorageFeaturesKHR const& rhs ) const + bool operator==( DescriptorSetVariableDescriptorCountLayoutSupportEXT const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( storageBuffer16BitAccess == rhs.storageBuffer16BitAccess ) - && ( uniformAndStorageBuffer16BitAccess == rhs.uniformAndStorageBuffer16BitAccess ) - && ( storagePushConstant16 == rhs.storagePushConstant16 ) - && ( storageInputOutput16 == rhs.storageInputOutput16 ); + && ( maxVariableDescriptorCount == rhs.maxVariableDescriptorCount ); } - bool operator!=( PhysicalDevice16BitStorageFeaturesKHR const& rhs ) const + bool operator!=( DescriptorSetVariableDescriptorCountLayoutSupportEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDescriptorSetVariableDescriptorCountLayoutSupportEXT; public: - void* pNext; - Bool32 storageBuffer16BitAccess; - Bool32 uniformAndStorageBuffer16BitAccess; - Bool32 storagePushConstant16; - Bool32 storageInputOutput16; + void* pNext = nullptr; + uint32_t maxVariableDescriptorCount; }; - static_assert( sizeof( PhysicalDevice16BitStorageFeaturesKHR ) == sizeof( VkPhysicalDevice16BitStorageFeaturesKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( DescriptorSetVariableDescriptorCountLayoutSupportEXT ) == sizeof( VkDescriptorSetVariableDescriptorCountLayoutSupportEXT ), "struct and wrapper have different size!" ); - struct BufferMemoryRequirementsInfo2KHR + struct PipelineVertexInputDivisorStateCreateInfoEXT { - BufferMemoryRequirementsInfo2KHR( Buffer buffer_ = Buffer() ) - : sType( StructureType::eBufferMemoryRequirementsInfo2KHR ) - , pNext( nullptr ) - , buffer( buffer_ ) + PipelineVertexInputDivisorStateCreateInfoEXT( uint32_t vertexBindingDivisorCount_ = 0, const VertexInputBindingDivisorDescriptionEXT* pVertexBindingDivisors_ = nullptr ) + : vertexBindingDivisorCount( vertexBindingDivisorCount_ ) + , pVertexBindingDivisors( pVertexBindingDivisors_ ) { } - BufferMemoryRequirementsInfo2KHR( VkBufferMemoryRequirementsInfo2KHR const & rhs ) + PipelineVertexInputDivisorStateCreateInfoEXT( VkPipelineVertexInputDivisorStateCreateInfoEXT const & rhs ) { - memcpy( this, &rhs, sizeof( BufferMemoryRequirementsInfo2KHR ) ); + memcpy( this, &rhs, sizeof( PipelineVertexInputDivisorStateCreateInfoEXT ) ); } - BufferMemoryRequirementsInfo2KHR& operator=( VkBufferMemoryRequirementsInfo2KHR const & rhs ) + PipelineVertexInputDivisorStateCreateInfoEXT& operator=( VkPipelineVertexInputDivisorStateCreateInfoEXT const & rhs ) { - memcpy( this, &rhs, sizeof( BufferMemoryRequirementsInfo2KHR ) ); + memcpy( this, &rhs, sizeof( PipelineVertexInputDivisorStateCreateInfoEXT ) ); return *this; } - BufferMemoryRequirementsInfo2KHR& setPNext( const void* pNext_ ) + PipelineVertexInputDivisorStateCreateInfoEXT& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - BufferMemoryRequirementsInfo2KHR& setBuffer( Buffer buffer_ ) + PipelineVertexInputDivisorStateCreateInfoEXT& setVertexBindingDivisorCount( uint32_t vertexBindingDivisorCount_ ) { - buffer = buffer_; + vertexBindingDivisorCount = vertexBindingDivisorCount_; + return *this; + } + + PipelineVertexInputDivisorStateCreateInfoEXT& setPVertexBindingDivisors( const VertexInputBindingDivisorDescriptionEXT* pVertexBindingDivisors_ ) + { + pVertexBindingDivisors = pVertexBindingDivisors_; return *this; } - operator const VkBufferMemoryRequirementsInfo2KHR&() const + operator const VkPipelineVertexInputDivisorStateCreateInfoEXT&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( BufferMemoryRequirementsInfo2KHR const& rhs ) const + bool operator==( PipelineVertexInputDivisorStateCreateInfoEXT const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( buffer == rhs.buffer ); + && ( vertexBindingDivisorCount == rhs.vertexBindingDivisorCount ) + && ( pVertexBindingDivisors == rhs.pVertexBindingDivisors ); } - bool operator!=( BufferMemoryRequirementsInfo2KHR const& rhs ) const + bool operator!=( PipelineVertexInputDivisorStateCreateInfoEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePipelineVertexInputDivisorStateCreateInfoEXT; public: - const void* pNext; - Buffer buffer; + const void* pNext = nullptr; + uint32_t vertexBindingDivisorCount; + const VertexInputBindingDivisorDescriptionEXT* pVertexBindingDivisors; }; - static_assert( sizeof( BufferMemoryRequirementsInfo2KHR ) == sizeof( VkBufferMemoryRequirementsInfo2KHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PipelineVertexInputDivisorStateCreateInfoEXT ) == sizeof( VkPipelineVertexInputDivisorStateCreateInfoEXT ), "struct and wrapper have different size!" ); - struct ImageMemoryRequirementsInfo2KHR + struct PhysicalDeviceVertexAttributeDivisorPropertiesEXT { - ImageMemoryRequirementsInfo2KHR( Image image_ = Image() ) - : sType( StructureType::eImageMemoryRequirementsInfo2KHR ) - , pNext( nullptr ) - , image( image_ ) + PhysicalDeviceVertexAttributeDivisorPropertiesEXT( uint32_t maxVertexAttribDivisor_ = 0 ) + : maxVertexAttribDivisor( maxVertexAttribDivisor_ ) { } - ImageMemoryRequirementsInfo2KHR( VkImageMemoryRequirementsInfo2KHR const & rhs ) + PhysicalDeviceVertexAttributeDivisorPropertiesEXT( VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT const & rhs ) { - memcpy( this, &rhs, sizeof( ImageMemoryRequirementsInfo2KHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceVertexAttributeDivisorPropertiesEXT ) ); } - ImageMemoryRequirementsInfo2KHR& operator=( VkImageMemoryRequirementsInfo2KHR const & rhs ) + PhysicalDeviceVertexAttributeDivisorPropertiesEXT& operator=( VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT const & rhs ) { - memcpy( this, &rhs, sizeof( ImageMemoryRequirementsInfo2KHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceVertexAttributeDivisorPropertiesEXT ) ); return *this; } - ImageMemoryRequirementsInfo2KHR& setPNext( const void* pNext_ ) + PhysicalDeviceVertexAttributeDivisorPropertiesEXT& setPNext( void* pNext_ ) { pNext = pNext_; return *this; } - ImageMemoryRequirementsInfo2KHR& setImage( Image image_ ) + PhysicalDeviceVertexAttributeDivisorPropertiesEXT& setMaxVertexAttribDivisor( uint32_t maxVertexAttribDivisor_ ) { - image = image_; + maxVertexAttribDivisor = maxVertexAttribDivisor_; return *this; } - operator const VkImageMemoryRequirementsInfo2KHR&() const + operator const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ImageMemoryRequirementsInfo2KHR const& rhs ) const + bool operator==( PhysicalDeviceVertexAttributeDivisorPropertiesEXT const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( image == rhs.image ); + && ( maxVertexAttribDivisor == rhs.maxVertexAttribDivisor ); } - bool operator!=( ImageMemoryRequirementsInfo2KHR const& rhs ) const + bool operator!=( PhysicalDeviceVertexAttributeDivisorPropertiesEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceVertexAttributeDivisorPropertiesEXT; public: - const void* pNext; - Image image; + void* pNext = nullptr; + uint32_t maxVertexAttribDivisor; }; - static_assert( sizeof( ImageMemoryRequirementsInfo2KHR ) == sizeof( VkImageMemoryRequirementsInfo2KHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceVertexAttributeDivisorPropertiesEXT ) == sizeof( VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT ), "struct and wrapper have different size!" ); - struct ImageSparseMemoryRequirementsInfo2KHR +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + struct ImportAndroidHardwareBufferInfoANDROID { - ImageSparseMemoryRequirementsInfo2KHR( Image image_ = Image() ) - : sType( StructureType::eImageSparseMemoryRequirementsInfo2KHR ) - , pNext( nullptr ) - , image( image_ ) + ImportAndroidHardwareBufferInfoANDROID( struct AHardwareBuffer* buffer_ = nullptr ) + : buffer( buffer_ ) { } - ImageSparseMemoryRequirementsInfo2KHR( VkImageSparseMemoryRequirementsInfo2KHR const & rhs ) + ImportAndroidHardwareBufferInfoANDROID( VkImportAndroidHardwareBufferInfoANDROID const & rhs ) { - memcpy( this, &rhs, sizeof( ImageSparseMemoryRequirementsInfo2KHR ) ); + memcpy( this, &rhs, sizeof( ImportAndroidHardwareBufferInfoANDROID ) ); } - ImageSparseMemoryRequirementsInfo2KHR& operator=( VkImageSparseMemoryRequirementsInfo2KHR const & rhs ) + ImportAndroidHardwareBufferInfoANDROID& operator=( VkImportAndroidHardwareBufferInfoANDROID const & rhs ) { - memcpy( this, &rhs, sizeof( ImageSparseMemoryRequirementsInfo2KHR ) ); + memcpy( this, &rhs, sizeof( ImportAndroidHardwareBufferInfoANDROID ) ); return *this; } - ImageSparseMemoryRequirementsInfo2KHR& setPNext( const void* pNext_ ) + ImportAndroidHardwareBufferInfoANDROID& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - ImageSparseMemoryRequirementsInfo2KHR& setImage( Image image_ ) + ImportAndroidHardwareBufferInfoANDROID& setBuffer( struct AHardwareBuffer* buffer_ ) { - image = image_; + buffer = buffer_; return *this; } - operator const VkImageSparseMemoryRequirementsInfo2KHR&() const + operator const VkImportAndroidHardwareBufferInfoANDROID&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ImageSparseMemoryRequirementsInfo2KHR const& rhs ) const + bool operator==( ImportAndroidHardwareBufferInfoANDROID const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( image == rhs.image ); + && ( buffer == rhs.buffer ); } - bool operator!=( ImageSparseMemoryRequirementsInfo2KHR const& rhs ) const + bool operator!=( ImportAndroidHardwareBufferInfoANDROID const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eImportAndroidHardwareBufferInfoANDROID; public: - const void* pNext; - Image image; + const void* pNext = nullptr; + struct AHardwareBuffer* buffer; }; - static_assert( sizeof( ImageSparseMemoryRequirementsInfo2KHR ) == sizeof( VkImageSparseMemoryRequirementsInfo2KHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( ImportAndroidHardwareBufferInfoANDROID ) == sizeof( VkImportAndroidHardwareBufferInfoANDROID ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ - struct MemoryRequirements2KHR +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + struct AndroidHardwareBufferUsageANDROID { - operator const VkMemoryRequirements2KHR&() const + operator const VkAndroidHardwareBufferUsageANDROID&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( MemoryRequirements2KHR const& rhs ) const + bool operator==( AndroidHardwareBufferUsageANDROID const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( memoryRequirements == rhs.memoryRequirements ); + && ( androidHardwareBufferUsage == rhs.androidHardwareBufferUsage ); } - bool operator!=( MemoryRequirements2KHR const& rhs ) const + bool operator!=( AndroidHardwareBufferUsageANDROID const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eAndroidHardwareBufferUsageANDROID; public: - void* pNext; - MemoryRequirements memoryRequirements; + void* pNext = nullptr; + uint64_t androidHardwareBufferUsage; }; - static_assert( sizeof( MemoryRequirements2KHR ) == sizeof( VkMemoryRequirements2KHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( AndroidHardwareBufferUsageANDROID ) == sizeof( VkAndroidHardwareBufferUsageANDROID ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ - struct MemoryDedicatedRequirementsKHR +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + struct AndroidHardwareBufferPropertiesANDROID { - operator const VkMemoryDedicatedRequirementsKHR&() const + operator const VkAndroidHardwareBufferPropertiesANDROID&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( MemoryDedicatedRequirementsKHR const& rhs ) const + bool operator==( AndroidHardwareBufferPropertiesANDROID const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( prefersDedicatedAllocation == rhs.prefersDedicatedAllocation ) - && ( requiresDedicatedAllocation == rhs.requiresDedicatedAllocation ); + && ( allocationSize == rhs.allocationSize ) + && ( memoryTypeBits == rhs.memoryTypeBits ); } - bool operator!=( MemoryDedicatedRequirementsKHR const& rhs ) const + bool operator!=( AndroidHardwareBufferPropertiesANDROID const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eAndroidHardwareBufferPropertiesANDROID; public: - void* pNext; - Bool32 prefersDedicatedAllocation; - Bool32 requiresDedicatedAllocation; + void* pNext = nullptr; + DeviceSize allocationSize; + uint32_t memoryTypeBits; }; - static_assert( sizeof( MemoryDedicatedRequirementsKHR ) == sizeof( VkMemoryDedicatedRequirementsKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( AndroidHardwareBufferPropertiesANDROID ) == sizeof( VkAndroidHardwareBufferPropertiesANDROID ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ - struct MemoryDedicatedAllocateInfoKHR +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + struct MemoryGetAndroidHardwareBufferInfoANDROID { - MemoryDedicatedAllocateInfoKHR( Image image_ = Image(), Buffer buffer_ = Buffer() ) - : sType( StructureType::eMemoryDedicatedAllocateInfoKHR ) - , pNext( nullptr ) - , image( image_ ) - , buffer( buffer_ ) + MemoryGetAndroidHardwareBufferInfoANDROID( DeviceMemory memory_ = DeviceMemory() ) + : memory( memory_ ) { } - MemoryDedicatedAllocateInfoKHR( VkMemoryDedicatedAllocateInfoKHR const & rhs ) + MemoryGetAndroidHardwareBufferInfoANDROID( VkMemoryGetAndroidHardwareBufferInfoANDROID const & rhs ) { - memcpy( this, &rhs, sizeof( MemoryDedicatedAllocateInfoKHR ) ); + memcpy( this, &rhs, sizeof( MemoryGetAndroidHardwareBufferInfoANDROID ) ); } - MemoryDedicatedAllocateInfoKHR& operator=( VkMemoryDedicatedAllocateInfoKHR const & rhs ) + MemoryGetAndroidHardwareBufferInfoANDROID& operator=( VkMemoryGetAndroidHardwareBufferInfoANDROID const & rhs ) { - memcpy( this, &rhs, sizeof( MemoryDedicatedAllocateInfoKHR ) ); + memcpy( this, &rhs, sizeof( MemoryGetAndroidHardwareBufferInfoANDROID ) ); return *this; } - MemoryDedicatedAllocateInfoKHR& setPNext( const void* pNext_ ) + MemoryGetAndroidHardwareBufferInfoANDROID& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - MemoryDedicatedAllocateInfoKHR& setImage( Image image_ ) - { - image = image_; - return *this; - } - - MemoryDedicatedAllocateInfoKHR& setBuffer( Buffer buffer_ ) + MemoryGetAndroidHardwareBufferInfoANDROID& setMemory( DeviceMemory memory_ ) { - buffer = buffer_; + memory = memory_; return *this; } - operator const VkMemoryDedicatedAllocateInfoKHR&() const + operator const VkMemoryGetAndroidHardwareBufferInfoANDROID&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( MemoryDedicatedAllocateInfoKHR const& rhs ) const + bool operator==( MemoryGetAndroidHardwareBufferInfoANDROID const& rhs ) const { return ( sType == rhs.sType ) - && ( pNext == rhs.pNext ) - && ( image == rhs.image ) - && ( buffer == rhs.buffer ); + && ( pNext == rhs.pNext ) + && ( memory == rhs.memory ); } - bool operator!=( MemoryDedicatedAllocateInfoKHR const& rhs ) const + bool operator!=( MemoryGetAndroidHardwareBufferInfoANDROID const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eMemoryGetAndroidHardwareBufferInfoANDROID; public: - const void* pNext; - Image image; - Buffer buffer; + const void* pNext = nullptr; + DeviceMemory memory; }; - static_assert( sizeof( MemoryDedicatedAllocateInfoKHR ) == sizeof( VkMemoryDedicatedAllocateInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( MemoryGetAndroidHardwareBufferInfoANDROID ) == sizeof( VkMemoryGetAndroidHardwareBufferInfoANDROID ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ - struct SamplerYcbcrConversionInfoKHR +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + struct ExternalFormatANDROID { - SamplerYcbcrConversionInfoKHR( SamplerYcbcrConversionKHR conversion_ = SamplerYcbcrConversionKHR() ) - : sType( StructureType::eSamplerYcbcrConversionInfoKHR ) - , pNext( nullptr ) - , conversion( conversion_ ) + ExternalFormatANDROID( uint64_t externalFormat_ = 0 ) + : externalFormat( externalFormat_ ) { } - SamplerYcbcrConversionInfoKHR( VkSamplerYcbcrConversionInfoKHR const & rhs ) + ExternalFormatANDROID( VkExternalFormatANDROID const & rhs ) { - memcpy( this, &rhs, sizeof( SamplerYcbcrConversionInfoKHR ) ); + memcpy( this, &rhs, sizeof( ExternalFormatANDROID ) ); } - SamplerYcbcrConversionInfoKHR& operator=( VkSamplerYcbcrConversionInfoKHR const & rhs ) + ExternalFormatANDROID& operator=( VkExternalFormatANDROID const & rhs ) { - memcpy( this, &rhs, sizeof( SamplerYcbcrConversionInfoKHR ) ); + memcpy( this, &rhs, sizeof( ExternalFormatANDROID ) ); return *this; } - SamplerYcbcrConversionInfoKHR& setPNext( const void* pNext_ ) + ExternalFormatANDROID& setPNext( void* pNext_ ) { pNext = pNext_; return *this; } - SamplerYcbcrConversionInfoKHR& setConversion( SamplerYcbcrConversionKHR conversion_ ) + ExternalFormatANDROID& setExternalFormat( uint64_t externalFormat_ ) { - conversion = conversion_; + externalFormat = externalFormat_; return *this; } - operator const VkSamplerYcbcrConversionInfoKHR&() const + operator const VkExternalFormatANDROID&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( SamplerYcbcrConversionInfoKHR const& rhs ) const + bool operator==( ExternalFormatANDROID const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( conversion == rhs.conversion ); + && ( externalFormat == rhs.externalFormat ); } - bool operator!=( SamplerYcbcrConversionInfoKHR const& rhs ) const + bool operator!=( ExternalFormatANDROID const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eExternalFormatANDROID; public: - const void* pNext; - SamplerYcbcrConversionKHR conversion; + void* pNext = nullptr; + uint64_t externalFormat; + }; + static_assert( sizeof( ExternalFormatANDROID ) == sizeof( VkExternalFormatANDROID ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ + + enum class SubpassContents + { + eInline = VK_SUBPASS_CONTENTS_INLINE, + eSecondaryCommandBuffers = VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS }; - static_assert( sizeof( SamplerYcbcrConversionInfoKHR ) == sizeof( VkSamplerYcbcrConversionInfoKHR ), "struct and wrapper have different size!" ); - struct PhysicalDeviceSamplerYcbcrConversionFeaturesKHR + struct PresentInfoKHR { - PhysicalDeviceSamplerYcbcrConversionFeaturesKHR( Bool32 samplerYcbcrConversion_ = 0 ) - : sType( StructureType::ePhysicalDeviceSamplerYcbcrConversionFeaturesKHR ) - , pNext( nullptr ) - , samplerYcbcrConversion( samplerYcbcrConversion_ ) + PresentInfoKHR( uint32_t waitSemaphoreCount_ = 0, const Semaphore* pWaitSemaphores_ = nullptr, uint32_t swapchainCount_ = 0, const SwapchainKHR* pSwapchains_ = nullptr, const uint32_t* pImageIndices_ = nullptr, Result* pResults_ = nullptr ) + : waitSemaphoreCount( waitSemaphoreCount_ ) + , pWaitSemaphores( pWaitSemaphores_ ) + , swapchainCount( swapchainCount_ ) + , pSwapchains( pSwapchains_ ) + , pImageIndices( pImageIndices_ ) + , pResults( pResults_ ) { } - PhysicalDeviceSamplerYcbcrConversionFeaturesKHR( VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR const & rhs ) + PresentInfoKHR( VkPresentInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceSamplerYcbcrConversionFeaturesKHR ) ); + memcpy( this, &rhs, sizeof( PresentInfoKHR ) ); } - PhysicalDeviceSamplerYcbcrConversionFeaturesKHR& operator=( VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR const & rhs ) + PresentInfoKHR& operator=( VkPresentInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceSamplerYcbcrConversionFeaturesKHR ) ); + memcpy( this, &rhs, sizeof( PresentInfoKHR ) ); return *this; } - PhysicalDeviceSamplerYcbcrConversionFeaturesKHR& setPNext( void* pNext_ ) + PresentInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PhysicalDeviceSamplerYcbcrConversionFeaturesKHR& setSamplerYcbcrConversion( Bool32 samplerYcbcrConversion_ ) + PresentInfoKHR& setWaitSemaphoreCount( uint32_t waitSemaphoreCount_ ) { - samplerYcbcrConversion = samplerYcbcrConversion_; + waitSemaphoreCount = waitSemaphoreCount_; return *this; } - operator const VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR&() const + PresentInfoKHR& setPWaitSemaphores( const Semaphore* pWaitSemaphores_ ) { - return *reinterpret_cast(this); + pWaitSemaphores = pWaitSemaphores_; + return *this; } - bool operator==( PhysicalDeviceSamplerYcbcrConversionFeaturesKHR const& rhs ) const + PresentInfoKHR& setSwapchainCount( uint32_t swapchainCount_ ) { - return ( sType == rhs.sType ) - && ( pNext == rhs.pNext ) - && ( samplerYcbcrConversion == rhs.samplerYcbcrConversion ); + swapchainCount = swapchainCount_; + return *this; } - bool operator!=( PhysicalDeviceSamplerYcbcrConversionFeaturesKHR const& rhs ) const + PresentInfoKHR& setPSwapchains( const SwapchainKHR* pSwapchains_ ) { - return !operator==( rhs ); + pSwapchains = pSwapchains_; + return *this; } - private: - StructureType sType; + PresentInfoKHR& setPImageIndices( const uint32_t* pImageIndices_ ) + { + pImageIndices = pImageIndices_; + return *this; + } - public: - void* pNext; - Bool32 samplerYcbcrConversion; - }; - static_assert( sizeof( PhysicalDeviceSamplerYcbcrConversionFeaturesKHR ) == sizeof( VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR ), "struct and wrapper have different size!" ); + PresentInfoKHR& setPResults( Result* pResults_ ) + { + pResults = pResults_; + return *this; + } - struct SamplerYcbcrConversionImageFormatPropertiesKHR - { - operator const VkSamplerYcbcrConversionImageFormatPropertiesKHR&() const + operator const VkPresentInfoKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( SamplerYcbcrConversionImageFormatPropertiesKHR const& rhs ) const + bool operator==( PresentInfoKHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( combinedImageSamplerDescriptorCount == rhs.combinedImageSamplerDescriptorCount ); + && ( waitSemaphoreCount == rhs.waitSemaphoreCount ) + && ( pWaitSemaphores == rhs.pWaitSemaphores ) + && ( swapchainCount == rhs.swapchainCount ) + && ( pSwapchains == rhs.pSwapchains ) + && ( pImageIndices == rhs.pImageIndices ) + && ( pResults == rhs.pResults ); } - bool operator!=( SamplerYcbcrConversionImageFormatPropertiesKHR const& rhs ) const + bool operator!=( PresentInfoKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePresentInfoKHR; public: - void* pNext; - uint32_t combinedImageSamplerDescriptorCount; + const void* pNext = nullptr; + uint32_t waitSemaphoreCount; + const Semaphore* pWaitSemaphores; + uint32_t swapchainCount; + const SwapchainKHR* pSwapchains; + const uint32_t* pImageIndices; + Result* pResults; }; - static_assert( sizeof( SamplerYcbcrConversionImageFormatPropertiesKHR ) == sizeof( VkSamplerYcbcrConversionImageFormatPropertiesKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PresentInfoKHR ) == sizeof( VkPresentInfoKHR ), "struct and wrapper have different size!" ); - struct TextureLODGatherFormatPropertiesAMD + enum class DynamicState { - operator const VkTextureLODGatherFormatPropertiesAMD&() const + 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, + eViewportWScalingNV = VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV, + eDiscardRectangleEXT = VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT, + eSampleLocationsEXT = VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT + }; + + struct PipelineDynamicStateCreateInfo + { + PipelineDynamicStateCreateInfo( PipelineDynamicStateCreateFlags flags_ = PipelineDynamicStateCreateFlags(), uint32_t dynamicStateCount_ = 0, const DynamicState* pDynamicStates_ = nullptr ) + : flags( flags_ ) + , dynamicStateCount( dynamicStateCount_ ) + , pDynamicStates( pDynamicStates_ ) { - return *reinterpret_cast(this); } - bool operator==( TextureLODGatherFormatPropertiesAMD const& rhs ) const + PipelineDynamicStateCreateInfo( VkPipelineDynamicStateCreateInfo const & rhs ) + { + memcpy( this, &rhs, sizeof( PipelineDynamicStateCreateInfo ) ); + } + + PipelineDynamicStateCreateInfo& operator=( VkPipelineDynamicStateCreateInfo const & rhs ) + { + memcpy( this, &rhs, sizeof( PipelineDynamicStateCreateInfo ) ); + return *this; + } + PipelineDynamicStateCreateInfo& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PipelineDynamicStateCreateInfo& setFlags( PipelineDynamicStateCreateFlags flags_ ) + { + flags = flags_; + return *this; + } + + PipelineDynamicStateCreateInfo& setDynamicStateCount( uint32_t dynamicStateCount_ ) + { + dynamicStateCount = dynamicStateCount_; + return *this; + } + + PipelineDynamicStateCreateInfo& setPDynamicStates( const DynamicState* pDynamicStates_ ) + { + pDynamicStates = pDynamicStates_; + return *this; + } + + operator const VkPipelineDynamicStateCreateInfo&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PipelineDynamicStateCreateInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( supportsTextureGatherLODBiasAMD == rhs.supportsTextureGatherLODBiasAMD ); + && ( flags == rhs.flags ) + && ( dynamicStateCount == rhs.dynamicStateCount ) + && ( pDynamicStates == rhs.pDynamicStates ); } - bool operator!=( TextureLODGatherFormatPropertiesAMD const& rhs ) const + bool operator!=( PipelineDynamicStateCreateInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePipelineDynamicStateCreateInfo; public: - void* pNext; - Bool32 supportsTextureGatherLODBiasAMD; + const void* pNext = nullptr; + PipelineDynamicStateCreateFlags flags; + uint32_t dynamicStateCount; + const DynamicState* pDynamicStates; }; - static_assert( sizeof( TextureLODGatherFormatPropertiesAMD ) == sizeof( VkTextureLODGatherFormatPropertiesAMD ), "struct and wrapper have different size!" ); + static_assert( sizeof( PipelineDynamicStateCreateInfo ) == sizeof( VkPipelineDynamicStateCreateInfo ), "struct and wrapper have different size!" ); - struct PipelineCoverageToColorStateCreateInfoNV + enum class DescriptorUpdateTemplateType { - PipelineCoverageToColorStateCreateInfoNV( PipelineCoverageToColorStateCreateFlagsNV flags_ = PipelineCoverageToColorStateCreateFlagsNV(), Bool32 coverageToColorEnable_ = 0, uint32_t coverageToColorLocation_ = 0 ) - : sType( StructureType::ePipelineCoverageToColorStateCreateInfoNV ) - , pNext( nullptr ) - , flags( flags_ ) - , coverageToColorEnable( coverageToColorEnable_ ) - , coverageToColorLocation( coverageToColorLocation_ ) + eDescriptorSet = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, + eDescriptorSetKHR = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, + ePushDescriptorsKHR = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR + }; + + struct DescriptorUpdateTemplateCreateInfo + { + DescriptorUpdateTemplateCreateInfo( DescriptorUpdateTemplateCreateFlags flags_ = DescriptorUpdateTemplateCreateFlags(), uint32_t descriptorUpdateEntryCount_ = 0, const DescriptorUpdateTemplateEntry* pDescriptorUpdateEntries_ = nullptr, DescriptorUpdateTemplateType templateType_ = DescriptorUpdateTemplateType::eDescriptorSet, DescriptorSetLayout descriptorSetLayout_ = DescriptorSetLayout(), PipelineBindPoint pipelineBindPoint_ = PipelineBindPoint::eGraphics, PipelineLayout pipelineLayout_ = PipelineLayout(), uint32_t set_ = 0 ) + : flags( flags_ ) + , descriptorUpdateEntryCount( descriptorUpdateEntryCount_ ) + , pDescriptorUpdateEntries( pDescriptorUpdateEntries_ ) + , templateType( templateType_ ) + , descriptorSetLayout( descriptorSetLayout_ ) + , pipelineBindPoint( pipelineBindPoint_ ) + , pipelineLayout( pipelineLayout_ ) + , set( set_ ) { } - PipelineCoverageToColorStateCreateInfoNV( VkPipelineCoverageToColorStateCreateInfoNV const & rhs ) + DescriptorUpdateTemplateCreateInfo( VkDescriptorUpdateTemplateCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineCoverageToColorStateCreateInfoNV ) ); + memcpy( this, &rhs, sizeof( DescriptorUpdateTemplateCreateInfo ) ); } - PipelineCoverageToColorStateCreateInfoNV& operator=( VkPipelineCoverageToColorStateCreateInfoNV const & rhs ) + DescriptorUpdateTemplateCreateInfo& operator=( VkDescriptorUpdateTemplateCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineCoverageToColorStateCreateInfoNV ) ); + memcpy( this, &rhs, sizeof( DescriptorUpdateTemplateCreateInfo ) ); return *this; } - PipelineCoverageToColorStateCreateInfoNV& setPNext( const void* pNext_ ) + DescriptorUpdateTemplateCreateInfo& setPNext( void* pNext_ ) { pNext = pNext_; return *this; } - PipelineCoverageToColorStateCreateInfoNV& setFlags( PipelineCoverageToColorStateCreateFlagsNV flags_ ) + DescriptorUpdateTemplateCreateInfo& setFlags( DescriptorUpdateTemplateCreateFlags flags_ ) { flags = flags_; return *this; } - PipelineCoverageToColorStateCreateInfoNV& setCoverageToColorEnable( Bool32 coverageToColorEnable_ ) + DescriptorUpdateTemplateCreateInfo& setDescriptorUpdateEntryCount( uint32_t descriptorUpdateEntryCount_ ) { - coverageToColorEnable = coverageToColorEnable_; + descriptorUpdateEntryCount = descriptorUpdateEntryCount_; return *this; } - PipelineCoverageToColorStateCreateInfoNV& setCoverageToColorLocation( uint32_t coverageToColorLocation_ ) + DescriptorUpdateTemplateCreateInfo& setPDescriptorUpdateEntries( const DescriptorUpdateTemplateEntry* pDescriptorUpdateEntries_ ) { - coverageToColorLocation = coverageToColorLocation_; + pDescriptorUpdateEntries = pDescriptorUpdateEntries_; return *this; } - operator const VkPipelineCoverageToColorStateCreateInfoNV&() const + DescriptorUpdateTemplateCreateInfo& setTemplateType( DescriptorUpdateTemplateType templateType_ ) { - return *reinterpret_cast(this); + templateType = templateType_; + return *this; } - bool operator==( PipelineCoverageToColorStateCreateInfoNV const& rhs ) const + DescriptorUpdateTemplateCreateInfo& setDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout_ ) { - return ( sType == rhs.sType ) - && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( coverageToColorEnable == rhs.coverageToColorEnable ) - && ( coverageToColorLocation == rhs.coverageToColorLocation ); + descriptorSetLayout = descriptorSetLayout_; + return *this; } - bool operator!=( PipelineCoverageToColorStateCreateInfoNV const& rhs ) const + DescriptorUpdateTemplateCreateInfo& setPipelineBindPoint( PipelineBindPoint pipelineBindPoint_ ) { - return !operator==( rhs ); + pipelineBindPoint = pipelineBindPoint_; + return *this; } - private: - StructureType sType; + DescriptorUpdateTemplateCreateInfo& setPipelineLayout( PipelineLayout pipelineLayout_ ) + { + pipelineLayout = pipelineLayout_; + return *this; + } - public: - const void* pNext; - PipelineCoverageToColorStateCreateFlagsNV flags; - Bool32 coverageToColorEnable; - uint32_t coverageToColorLocation; - }; - static_assert( sizeof( PipelineCoverageToColorStateCreateInfoNV ) == sizeof( VkPipelineCoverageToColorStateCreateInfoNV ), "struct and wrapper have different size!" ); + DescriptorUpdateTemplateCreateInfo& setSet( uint32_t set_ ) + { + set = set_; + return *this; + } - struct PhysicalDeviceSamplerFilterMinmaxPropertiesEXT - { - operator const VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT&() const + operator const VkDescriptorUpdateTemplateCreateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceSamplerFilterMinmaxPropertiesEXT const& rhs ) const + bool operator==( DescriptorUpdateTemplateCreateInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( filterMinmaxSingleComponentFormats == rhs.filterMinmaxSingleComponentFormats ) - && ( filterMinmaxImageComponentMapping == rhs.filterMinmaxImageComponentMapping ); + && ( flags == rhs.flags ) + && ( descriptorUpdateEntryCount == rhs.descriptorUpdateEntryCount ) + && ( pDescriptorUpdateEntries == rhs.pDescriptorUpdateEntries ) + && ( templateType == rhs.templateType ) + && ( descriptorSetLayout == rhs.descriptorSetLayout ) + && ( pipelineBindPoint == rhs.pipelineBindPoint ) + && ( pipelineLayout == rhs.pipelineLayout ) + && ( set == rhs.set ); } - bool operator!=( PhysicalDeviceSamplerFilterMinmaxPropertiesEXT const& rhs ) const + bool operator!=( DescriptorUpdateTemplateCreateInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDescriptorUpdateTemplateCreateInfo; public: - void* pNext; - Bool32 filterMinmaxSingleComponentFormats; - Bool32 filterMinmaxImageComponentMapping; + void* pNext = nullptr; + DescriptorUpdateTemplateCreateFlags flags; + uint32_t descriptorUpdateEntryCount; + const DescriptorUpdateTemplateEntry* pDescriptorUpdateEntries; + DescriptorUpdateTemplateType templateType; + DescriptorSetLayout descriptorSetLayout; + PipelineBindPoint pipelineBindPoint; + PipelineLayout pipelineLayout; + uint32_t set; + }; + static_assert( sizeof( DescriptorUpdateTemplateCreateInfo ) == sizeof( VkDescriptorUpdateTemplateCreateInfo ), "struct and wrapper have different size!" ); + + using DescriptorUpdateTemplateCreateInfoKHR = DescriptorUpdateTemplateCreateInfo; + + 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, + eSamplerYcbcrConversionKHR = VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION, + eDescriptorUpdateTemplate = VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, + eDescriptorUpdateTemplateKHR = VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, + 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, + eObjectTableNVX = VK_OBJECT_TYPE_OBJECT_TABLE_NVX, + eIndirectCommandsLayoutNVX = VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX, + eDebugUtilsMessengerEXT = VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT, + eValidationCacheEXT = VK_OBJECT_TYPE_VALIDATION_CACHE_EXT }; - static_assert( sizeof( PhysicalDeviceSamplerFilterMinmaxPropertiesEXT ) == sizeof( VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT ), "struct and wrapper have different size!" ); - struct MultisamplePropertiesEXT + struct DebugUtilsObjectNameInfoEXT { - operator const VkMultisamplePropertiesEXT&() const - { - return *reinterpret_cast(this); - } - - bool operator==( MultisamplePropertiesEXT const& rhs ) const + DebugUtilsObjectNameInfoEXT( ObjectType objectType_ = ObjectType::eUnknown, uint64_t objectHandle_ = 0, const char* pObjectName_ = nullptr ) + : objectType( objectType_ ) + , objectHandle( objectHandle_ ) + , pObjectName( pObjectName_ ) { - return ( sType == rhs.sType ) - && ( pNext == rhs.pNext ) - && ( maxSampleLocationGridSize == rhs.maxSampleLocationGridSize ); } - bool operator!=( MultisamplePropertiesEXT const& rhs ) const + DebugUtilsObjectNameInfoEXT( VkDebugUtilsObjectNameInfoEXT const & rhs ) { - return !operator==( rhs ); + memcpy( this, &rhs, sizeof( DebugUtilsObjectNameInfoEXT ) ); } - private: - StructureType sType; - - public: - void* pNext; - Extent2D maxSampleLocationGridSize; - }; - static_assert( sizeof( MultisamplePropertiesEXT ) == sizeof( VkMultisamplePropertiesEXT ), "struct and wrapper have different size!" ); - - struct PhysicalDeviceBlendOperationAdvancedFeaturesEXT - { - PhysicalDeviceBlendOperationAdvancedFeaturesEXT( Bool32 advancedBlendCoherentOperations_ = 0 ) - : sType( StructureType::ePhysicalDeviceBlendOperationAdvancedFeaturesEXT ) - , pNext( nullptr ) - , advancedBlendCoherentOperations( advancedBlendCoherentOperations_ ) + DebugUtilsObjectNameInfoEXT& operator=( VkDebugUtilsObjectNameInfoEXT const & rhs ) { + memcpy( this, &rhs, sizeof( DebugUtilsObjectNameInfoEXT ) ); + return *this; } - - PhysicalDeviceBlendOperationAdvancedFeaturesEXT( VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT const & rhs ) + DebugUtilsObjectNameInfoEXT& setPNext( const void* pNext_ ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceBlendOperationAdvancedFeaturesEXT ) ); + pNext = pNext_; + return *this; } - PhysicalDeviceBlendOperationAdvancedFeaturesEXT& operator=( VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT const & rhs ) + DebugUtilsObjectNameInfoEXT& setObjectType( ObjectType objectType_ ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceBlendOperationAdvancedFeaturesEXT ) ); + objectType = objectType_; return *this; } - PhysicalDeviceBlendOperationAdvancedFeaturesEXT& setPNext( void* pNext_ ) + + DebugUtilsObjectNameInfoEXT& setObjectHandle( uint64_t objectHandle_ ) { - pNext = pNext_; + objectHandle = objectHandle_; return *this; } - PhysicalDeviceBlendOperationAdvancedFeaturesEXT& setAdvancedBlendCoherentOperations( Bool32 advancedBlendCoherentOperations_ ) + DebugUtilsObjectNameInfoEXT& setPObjectName( const char* pObjectName_ ) { - advancedBlendCoherentOperations = advancedBlendCoherentOperations_; + pObjectName = pObjectName_; return *this; } - operator const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT&() const + operator const VkDebugUtilsObjectNameInfoEXT&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceBlendOperationAdvancedFeaturesEXT const& rhs ) const + bool operator==( DebugUtilsObjectNameInfoEXT const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( advancedBlendCoherentOperations == rhs.advancedBlendCoherentOperations ); + && ( objectType == rhs.objectType ) + && ( objectHandle == rhs.objectHandle ) + && ( pObjectName == rhs.pObjectName ); } - bool operator!=( PhysicalDeviceBlendOperationAdvancedFeaturesEXT const& rhs ) const + bool operator!=( DebugUtilsObjectNameInfoEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDebugUtilsObjectNameInfoEXT; public: - void* pNext; - Bool32 advancedBlendCoherentOperations; + const void* pNext = nullptr; + ObjectType objectType; + uint64_t objectHandle; + const char* pObjectName; }; - static_assert( sizeof( PhysicalDeviceBlendOperationAdvancedFeaturesEXT ) == sizeof( VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT ), "struct and wrapper have different size!" ); + static_assert( sizeof( DebugUtilsObjectNameInfoEXT ) == sizeof( VkDebugUtilsObjectNameInfoEXT ), "struct and wrapper have different size!" ); - struct PhysicalDeviceBlendOperationAdvancedPropertiesEXT + struct DebugUtilsObjectTagInfoEXT { - operator const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT&() const + DebugUtilsObjectTagInfoEXT( ObjectType objectType_ = ObjectType::eUnknown, uint64_t objectHandle_ = 0, uint64_t tagName_ = 0, size_t tagSize_ = 0, const void* pTag_ = nullptr ) + : objectType( objectType_ ) + , objectHandle( objectHandle_ ) + , tagName( tagName_ ) + , tagSize( tagSize_ ) + , pTag( pTag_ ) { - return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceBlendOperationAdvancedPropertiesEXT const& rhs ) const + DebugUtilsObjectTagInfoEXT( VkDebugUtilsObjectTagInfoEXT const & rhs ) { - 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 ); + memcpy( this, &rhs, sizeof( DebugUtilsObjectTagInfoEXT ) ); } - bool operator!=( PhysicalDeviceBlendOperationAdvancedPropertiesEXT const& rhs ) const + DebugUtilsObjectTagInfoEXT& operator=( VkDebugUtilsObjectTagInfoEXT const & rhs ) { - return !operator==( rhs ); + memcpy( this, &rhs, sizeof( DebugUtilsObjectTagInfoEXT ) ); + return *this; } - - private: - StructureType sType; - - public: - void* pNext; - uint32_t advancedBlendMaxColorAttachments; - Bool32 advancedBlendIndependentBlend; - Bool32 advancedBlendNonPremultipliedSrcColor; - Bool32 advancedBlendNonPremultipliedDstColor; - Bool32 advancedBlendCorrelatedOverlap; - Bool32 advancedBlendAllOperations; - }; - static_assert( sizeof( PhysicalDeviceBlendOperationAdvancedPropertiesEXT ) == sizeof( VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT ), "struct and wrapper have different size!" ); - - struct ImageFormatListCreateInfoKHR - { - ImageFormatListCreateInfoKHR( uint32_t viewFormatCount_ = 0, const Format* pViewFormats_ = nullptr ) - : sType( StructureType::eImageFormatListCreateInfoKHR ) - , pNext( nullptr ) - , viewFormatCount( viewFormatCount_ ) - , pViewFormats( pViewFormats_ ) + DebugUtilsObjectTagInfoEXT& setPNext( const void* pNext_ ) { + pNext = pNext_; + return *this; } - ImageFormatListCreateInfoKHR( VkImageFormatListCreateInfoKHR const & rhs ) + DebugUtilsObjectTagInfoEXT& setObjectType( ObjectType objectType_ ) { - memcpy( this, &rhs, sizeof( ImageFormatListCreateInfoKHR ) ); + objectType = objectType_; + return *this; } - ImageFormatListCreateInfoKHR& operator=( VkImageFormatListCreateInfoKHR const & rhs ) + DebugUtilsObjectTagInfoEXT& setObjectHandle( uint64_t objectHandle_ ) { - memcpy( this, &rhs, sizeof( ImageFormatListCreateInfoKHR ) ); + objectHandle = objectHandle_; return *this; } - ImageFormatListCreateInfoKHR& setPNext( const void* pNext_ ) + + DebugUtilsObjectTagInfoEXT& setTagName( uint64_t tagName_ ) { - pNext = pNext_; + tagName = tagName_; return *this; } - ImageFormatListCreateInfoKHR& setViewFormatCount( uint32_t viewFormatCount_ ) + DebugUtilsObjectTagInfoEXT& setTagSize( size_t tagSize_ ) { - viewFormatCount = viewFormatCount_; + tagSize = tagSize_; return *this; } - ImageFormatListCreateInfoKHR& setPViewFormats( const Format* pViewFormats_ ) + DebugUtilsObjectTagInfoEXT& setPTag( const void* pTag_ ) { - pViewFormats = pViewFormats_; + pTag = pTag_; return *this; } - operator const VkImageFormatListCreateInfoKHR&() const + operator const VkDebugUtilsObjectTagInfoEXT&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ImageFormatListCreateInfoKHR const& rhs ) const + bool operator==( DebugUtilsObjectTagInfoEXT const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( viewFormatCount == rhs.viewFormatCount ) - && ( pViewFormats == rhs.pViewFormats ); + && ( objectType == rhs.objectType ) + && ( objectHandle == rhs.objectHandle ) + && ( tagName == rhs.tagName ) + && ( tagSize == rhs.tagSize ) + && ( pTag == rhs.pTag ); } - bool operator!=( ImageFormatListCreateInfoKHR const& rhs ) const + bool operator!=( DebugUtilsObjectTagInfoEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDebugUtilsObjectTagInfoEXT; public: - const void* pNext; - uint32_t viewFormatCount; - const Format* pViewFormats; + const void* pNext = nullptr; + ObjectType objectType; + uint64_t objectHandle; + uint64_t tagName; + size_t tagSize; + const void* pTag; }; - static_assert( sizeof( ImageFormatListCreateInfoKHR ) == sizeof( VkImageFormatListCreateInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( DebugUtilsObjectTagInfoEXT ) == sizeof( VkDebugUtilsObjectTagInfoEXT ), "struct and wrapper have different size!" ); - struct ValidationCacheCreateInfoEXT + struct DebugUtilsMessengerCallbackDataEXT { - ValidationCacheCreateInfoEXT( ValidationCacheCreateFlagsEXT flags_ = ValidationCacheCreateFlagsEXT(), size_t initialDataSize_ = 0, const void* pInitialData_ = nullptr ) - : sType( StructureType::eValidationCacheCreateInfoEXT ) - , pNext( nullptr ) - , flags( flags_ ) - , initialDataSize( initialDataSize_ ) - , pInitialData( pInitialData_ ) + DebugUtilsMessengerCallbackDataEXT( DebugUtilsMessengerCallbackDataFlagsEXT flags_ = DebugUtilsMessengerCallbackDataFlagsEXT(), const char* pMessageIdName_ = nullptr, int32_t messageIdNumber_ = 0, const char* pMessage_ = nullptr, uint32_t queueLabelCount_ = 0, DebugUtilsLabelEXT* pQueueLabels_ = nullptr, uint32_t cmdBufLabelCount_ = 0, DebugUtilsLabelEXT* pCmdBufLabels_ = nullptr, uint32_t objectCount_ = 0, DebugUtilsObjectNameInfoEXT* pObjects_ = nullptr ) + : flags( flags_ ) + , pMessageIdName( pMessageIdName_ ) + , messageIdNumber( messageIdNumber_ ) + , pMessage( pMessage_ ) + , queueLabelCount( queueLabelCount_ ) + , pQueueLabels( pQueueLabels_ ) + , cmdBufLabelCount( cmdBufLabelCount_ ) + , pCmdBufLabels( pCmdBufLabels_ ) + , objectCount( objectCount_ ) + , pObjects( pObjects_ ) { } - ValidationCacheCreateInfoEXT( VkValidationCacheCreateInfoEXT const & rhs ) + DebugUtilsMessengerCallbackDataEXT( VkDebugUtilsMessengerCallbackDataEXT const & rhs ) { - memcpy( this, &rhs, sizeof( ValidationCacheCreateInfoEXT ) ); + memcpy( this, &rhs, sizeof( DebugUtilsMessengerCallbackDataEXT ) ); } - ValidationCacheCreateInfoEXT& operator=( VkValidationCacheCreateInfoEXT const & rhs ) + DebugUtilsMessengerCallbackDataEXT& operator=( VkDebugUtilsMessengerCallbackDataEXT const & rhs ) { - memcpy( this, &rhs, sizeof( ValidationCacheCreateInfoEXT ) ); + memcpy( this, &rhs, sizeof( DebugUtilsMessengerCallbackDataEXT ) ); return *this; } - ValidationCacheCreateInfoEXT& setPNext( const void* pNext_ ) + DebugUtilsMessengerCallbackDataEXT& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - ValidationCacheCreateInfoEXT& setFlags( ValidationCacheCreateFlagsEXT flags_ ) + DebugUtilsMessengerCallbackDataEXT& setFlags( DebugUtilsMessengerCallbackDataFlagsEXT flags_ ) { flags = flags_; return *this; } - ValidationCacheCreateInfoEXT& setInitialDataSize( size_t initialDataSize_ ) + DebugUtilsMessengerCallbackDataEXT& setPMessageIdName( const char* pMessageIdName_ ) { - initialDataSize = initialDataSize_; + pMessageIdName = pMessageIdName_; return *this; } - ValidationCacheCreateInfoEXT& setPInitialData( const void* pInitialData_ ) + DebugUtilsMessengerCallbackDataEXT& setMessageIdNumber( int32_t messageIdNumber_ ) { - pInitialData = pInitialData_; + messageIdNumber = messageIdNumber_; return *this; } - operator const VkValidationCacheCreateInfoEXT&() const - { - return *reinterpret_cast(this); - } - - bool operator==( ValidationCacheCreateInfoEXT const& rhs ) const + DebugUtilsMessengerCallbackDataEXT& setPMessage( const char* pMessage_ ) { - return ( sType == rhs.sType ) - && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( initialDataSize == rhs.initialDataSize ) - && ( pInitialData == rhs.pInitialData ); + pMessage = pMessage_; + return *this; } - bool operator!=( ValidationCacheCreateInfoEXT const& rhs ) const + DebugUtilsMessengerCallbackDataEXT& setQueueLabelCount( uint32_t queueLabelCount_ ) { - return !operator==( rhs ); + queueLabelCount = queueLabelCount_; + return *this; } - private: - StructureType sType; - - public: - const void* pNext; - ValidationCacheCreateFlagsEXT flags; - size_t initialDataSize; - const void* pInitialData; - }; - static_assert( sizeof( ValidationCacheCreateInfoEXT ) == sizeof( VkValidationCacheCreateInfoEXT ), "struct and wrapper have different size!" ); - - struct ShaderModuleValidationCacheCreateInfoEXT - { - ShaderModuleValidationCacheCreateInfoEXT( ValidationCacheEXT validationCache_ = ValidationCacheEXT() ) - : sType( StructureType::eShaderModuleValidationCacheCreateInfoEXT ) - , pNext( nullptr ) - , validationCache( validationCache_ ) + DebugUtilsMessengerCallbackDataEXT& setPQueueLabels( DebugUtilsLabelEXT* pQueueLabels_ ) { + pQueueLabels = pQueueLabels_; + return *this; } - ShaderModuleValidationCacheCreateInfoEXT( VkShaderModuleValidationCacheCreateInfoEXT const & rhs ) + DebugUtilsMessengerCallbackDataEXT& setCmdBufLabelCount( uint32_t cmdBufLabelCount_ ) { - memcpy( this, &rhs, sizeof( ShaderModuleValidationCacheCreateInfoEXT ) ); + cmdBufLabelCount = cmdBufLabelCount_; + return *this; } - ShaderModuleValidationCacheCreateInfoEXT& operator=( VkShaderModuleValidationCacheCreateInfoEXT const & rhs ) + DebugUtilsMessengerCallbackDataEXT& setPCmdBufLabels( DebugUtilsLabelEXT* pCmdBufLabels_ ) { - memcpy( this, &rhs, sizeof( ShaderModuleValidationCacheCreateInfoEXT ) ); + pCmdBufLabels = pCmdBufLabels_; return *this; } - ShaderModuleValidationCacheCreateInfoEXT& setPNext( const void* pNext_ ) + + DebugUtilsMessengerCallbackDataEXT& setObjectCount( uint32_t objectCount_ ) { - pNext = pNext_; + objectCount = objectCount_; return *this; } - ShaderModuleValidationCacheCreateInfoEXT& setValidationCache( ValidationCacheEXT validationCache_ ) + DebugUtilsMessengerCallbackDataEXT& setPObjects( DebugUtilsObjectNameInfoEXT* pObjects_ ) { - validationCache = validationCache_; + pObjects = pObjects_; return *this; } - operator const VkShaderModuleValidationCacheCreateInfoEXT&() const + operator const VkDebugUtilsMessengerCallbackDataEXT&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ShaderModuleValidationCacheCreateInfoEXT const& rhs ) const + bool operator==( DebugUtilsMessengerCallbackDataEXT const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( validationCache == rhs.validationCache ); + && ( flags == rhs.flags ) + && ( pMessageIdName == rhs.pMessageIdName ) + && ( messageIdNumber == rhs.messageIdNumber ) + && ( pMessage == rhs.pMessage ) + && ( queueLabelCount == rhs.queueLabelCount ) + && ( pQueueLabels == rhs.pQueueLabels ) + && ( cmdBufLabelCount == rhs.cmdBufLabelCount ) + && ( pCmdBufLabels == rhs.pCmdBufLabels ) + && ( objectCount == rhs.objectCount ) + && ( pObjects == rhs.pObjects ); } - bool operator!=( ShaderModuleValidationCacheCreateInfoEXT const& rhs ) const + bool operator!=( DebugUtilsMessengerCallbackDataEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDebugUtilsMessengerCallbackDataEXT; public: - const void* pNext; - ValidationCacheEXT validationCache; + const void* pNext = nullptr; + DebugUtilsMessengerCallbackDataFlagsEXT flags; + const char* pMessageIdName; + int32_t messageIdNumber; + const char* pMessage; + uint32_t queueLabelCount; + DebugUtilsLabelEXT* pQueueLabels; + uint32_t cmdBufLabelCount; + DebugUtilsLabelEXT* pCmdBufLabels; + uint32_t objectCount; + DebugUtilsObjectNameInfoEXT* pObjects; }; - static_assert( sizeof( ShaderModuleValidationCacheCreateInfoEXT ) == sizeof( VkShaderModuleValidationCacheCreateInfoEXT ), "struct and wrapper have different size!" ); + static_assert( sizeof( DebugUtilsMessengerCallbackDataEXT ) == sizeof( VkDebugUtilsMessengerCallbackDataEXT ), "struct and wrapper have different size!" ); - enum class SubpassContents + enum class QueueFlagBits { - eInline = VK_SUBPASS_CONTENTS_INLINE, - eSecondaryCommandBuffers = VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS + 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 }; - struct PresentInfoKHR - { - PresentInfoKHR( uint32_t waitSemaphoreCount_ = 0, const Semaphore* pWaitSemaphores_ = nullptr, uint32_t swapchainCount_ = 0, const SwapchainKHR* pSwapchains_ = nullptr, const uint32_t* pImageIndices_ = nullptr, Result* pResults_ = nullptr ) - : sType( StructureType::ePresentInfoKHR ) - , pNext( nullptr ) - , waitSemaphoreCount( waitSemaphoreCount_ ) - , pWaitSemaphores( pWaitSemaphores_ ) - , swapchainCount( swapchainCount_ ) - , pSwapchains( pSwapchains_ ) - , pImageIndices( pImageIndices_ ) - , pResults( pResults_ ) - { - } - - PresentInfoKHR( VkPresentInfoKHR const & rhs ) - { - memcpy( this, &rhs, sizeof( PresentInfoKHR ) ); - } - - PresentInfoKHR& operator=( VkPresentInfoKHR const & rhs ) - { - memcpy( this, &rhs, sizeof( PresentInfoKHR ) ); - return *this; - } - PresentInfoKHR& setPNext( const void* pNext_ ) - { - pNext = pNext_; - return *this; - } + using QueueFlags = Flags; - PresentInfoKHR& setWaitSemaphoreCount( uint32_t waitSemaphoreCount_ ) - { - waitSemaphoreCount = waitSemaphoreCount_; - return *this; - } + VULKAN_HPP_INLINE QueueFlags operator|( QueueFlagBits bit0, QueueFlagBits bit1 ) + { + return QueueFlags( bit0 ) | bit1; + } - PresentInfoKHR& setPWaitSemaphores( const Semaphore* pWaitSemaphores_ ) - { - pWaitSemaphores = pWaitSemaphores_; - return *this; - } + VULKAN_HPP_INLINE QueueFlags operator~( QueueFlagBits bits ) + { + return ~( QueueFlags( bits ) ); + } - PresentInfoKHR& setSwapchainCount( uint32_t swapchainCount_ ) + template <> struct FlagTraits + { + enum { - swapchainCount = swapchainCount_; - return *this; - } + allFlags = VkFlags(QueueFlagBits::eGraphics) | VkFlags(QueueFlagBits::eCompute) | VkFlags(QueueFlagBits::eTransfer) | VkFlags(QueueFlagBits::eSparseBinding) | VkFlags(QueueFlagBits::eProtected) + }; + }; - PresentInfoKHR& setPSwapchains( const SwapchainKHR* pSwapchains_ ) + struct QueueFamilyProperties + { + operator const VkQueueFamilyProperties&() const { - pSwapchains = pSwapchains_; - return *this; + return *reinterpret_cast(this); } - PresentInfoKHR& setPImageIndices( const uint32_t* pImageIndices_ ) + bool operator==( QueueFamilyProperties const& rhs ) const { - pImageIndices = pImageIndices_; - return *this; + return ( queueFlags == rhs.queueFlags ) + && ( queueCount == rhs.queueCount ) + && ( timestampValidBits == rhs.timestampValidBits ) + && ( minImageTransferGranularity == rhs.minImageTransferGranularity ); } - PresentInfoKHR& setPResults( Result* pResults_ ) + bool operator!=( QueueFamilyProperties const& rhs ) const { - pResults = pResults_; - return *this; + return !operator==( rhs ); } - operator const VkPresentInfoKHR&() const + QueueFlags queueFlags; + uint32_t queueCount; + uint32_t timestampValidBits; + Extent3D minImageTransferGranularity; + }; + static_assert( sizeof( QueueFamilyProperties ) == sizeof( VkQueueFamilyProperties ), "struct and wrapper have different size!" ); + + struct QueueFamilyProperties2 + { + operator const VkQueueFamilyProperties2&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PresentInfoKHR const& rhs ) const + bool operator==( QueueFamilyProperties2 const& rhs ) const { 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 ); + && ( queueFamilyProperties == rhs.queueFamilyProperties ); } - bool operator!=( PresentInfoKHR const& rhs ) const + bool operator!=( QueueFamilyProperties2 const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eQueueFamilyProperties2; public: - const void* pNext; - uint32_t waitSemaphoreCount; - const Semaphore* pWaitSemaphores; - uint32_t swapchainCount; - const SwapchainKHR* pSwapchains; - const uint32_t* pImageIndices; - Result* pResults; + void* pNext = nullptr; + QueueFamilyProperties queueFamilyProperties; }; - static_assert( sizeof( PresentInfoKHR ) == sizeof( VkPresentInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( QueueFamilyProperties2 ) == sizeof( VkQueueFamilyProperties2 ), "struct and wrapper have different size!" ); - enum class DynamicState + using QueueFamilyProperties2KHR = QueueFamilyProperties2; + + enum class DeviceQueueCreateFlagBits { - 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, - eViewportWScalingNV = VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV, - eDiscardRectangleEXT = VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT, - eSampleLocationsEXT = VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT + eProtected = VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT }; - struct PipelineDynamicStateCreateInfo + using DeviceQueueCreateFlags = Flags; + + VULKAN_HPP_INLINE DeviceQueueCreateFlags operator|( DeviceQueueCreateFlagBits bit0, DeviceQueueCreateFlagBits bit1 ) { - PipelineDynamicStateCreateInfo( PipelineDynamicStateCreateFlags flags_ = PipelineDynamicStateCreateFlags(), uint32_t dynamicStateCount_ = 0, const DynamicState* pDynamicStates_ = nullptr ) - : sType( StructureType::ePipelineDynamicStateCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) - , dynamicStateCount( dynamicStateCount_ ) - , pDynamicStates( pDynamicStates_ ) + return DeviceQueueCreateFlags( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE DeviceQueueCreateFlags operator~( DeviceQueueCreateFlagBits bits ) + { + return ~( DeviceQueueCreateFlags( bits ) ); + } + + template <> struct FlagTraits + { + enum + { + allFlags = VkFlags(DeviceQueueCreateFlagBits::eProtected) + }; + }; + + struct DeviceQueueCreateInfo + { + DeviceQueueCreateInfo( DeviceQueueCreateFlags flags_ = DeviceQueueCreateFlags(), uint32_t queueFamilyIndex_ = 0, uint32_t queueCount_ = 0, const float* pQueuePriorities_ = nullptr ) + : flags( flags_ ) + , queueFamilyIndex( queueFamilyIndex_ ) + , queueCount( queueCount_ ) + , pQueuePriorities( pQueuePriorities_ ) { } - PipelineDynamicStateCreateInfo( VkPipelineDynamicStateCreateInfo const & rhs ) + DeviceQueueCreateInfo( VkDeviceQueueCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineDynamicStateCreateInfo ) ); + memcpy( this, &rhs, sizeof( DeviceQueueCreateInfo ) ); } - PipelineDynamicStateCreateInfo& operator=( VkPipelineDynamicStateCreateInfo const & rhs ) + DeviceQueueCreateInfo& operator=( VkDeviceQueueCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineDynamicStateCreateInfo ) ); + memcpy( this, &rhs, sizeof( DeviceQueueCreateInfo ) ); return *this; } - PipelineDynamicStateCreateInfo& setPNext( const void* pNext_ ) + DeviceQueueCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PipelineDynamicStateCreateInfo& setFlags( PipelineDynamicStateCreateFlags flags_ ) + DeviceQueueCreateInfo& setFlags( DeviceQueueCreateFlags flags_ ) { flags = flags_; return *this; } - PipelineDynamicStateCreateInfo& setDynamicStateCount( uint32_t dynamicStateCount_ ) + DeviceQueueCreateInfo& setQueueFamilyIndex( uint32_t queueFamilyIndex_ ) { - dynamicStateCount = dynamicStateCount_; + queueFamilyIndex = queueFamilyIndex_; return *this; } - PipelineDynamicStateCreateInfo& setPDynamicStates( const DynamicState* pDynamicStates_ ) + DeviceQueueCreateInfo& setQueueCount( uint32_t queueCount_ ) { - pDynamicStates = pDynamicStates_; + queueCount = queueCount_; return *this; } - operator const VkPipelineDynamicStateCreateInfo&() const + DeviceQueueCreateInfo& setPQueuePriorities( const float* pQueuePriorities_ ) { - return *reinterpret_cast(this); + pQueuePriorities = pQueuePriorities_; + return *this; } - bool operator==( PipelineDynamicStateCreateInfo const& rhs ) const + operator const VkDeviceQueueCreateInfo&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DeviceQueueCreateInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) - && ( dynamicStateCount == rhs.dynamicStateCount ) - && ( pDynamicStates == rhs.pDynamicStates ); + && ( queueFamilyIndex == rhs.queueFamilyIndex ) + && ( queueCount == rhs.queueCount ) + && ( pQueuePriorities == rhs.pQueuePriorities ); } - bool operator!=( PipelineDynamicStateCreateInfo const& rhs ) const + bool operator!=( DeviceQueueCreateInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDeviceQueueCreateInfo; public: - const void* pNext; - PipelineDynamicStateCreateFlags flags; - uint32_t dynamicStateCount; - const DynamicState* pDynamicStates; - }; - static_assert( sizeof( PipelineDynamicStateCreateInfo ) == sizeof( VkPipelineDynamicStateCreateInfo ), "struct and wrapper have different size!" ); - - enum class DescriptorUpdateTemplateTypeKHR - { - eDescriptorSet = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR, - ePushDescriptors = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR + const void* pNext = nullptr; + DeviceQueueCreateFlags flags; + uint32_t queueFamilyIndex; + uint32_t queueCount; + const float* pQueuePriorities; }; + static_assert( sizeof( DeviceQueueCreateInfo ) == sizeof( VkDeviceQueueCreateInfo ), "struct and wrapper have different size!" ); - struct DescriptorUpdateTemplateCreateInfoKHR + struct DeviceCreateInfo { - DescriptorUpdateTemplateCreateInfoKHR( DescriptorUpdateTemplateCreateFlagsKHR flags_ = DescriptorUpdateTemplateCreateFlagsKHR(), uint32_t descriptorUpdateEntryCount_ = 0, const DescriptorUpdateTemplateEntryKHR* pDescriptorUpdateEntries_ = nullptr, DescriptorUpdateTemplateTypeKHR templateType_ = DescriptorUpdateTemplateTypeKHR::eDescriptorSet, DescriptorSetLayout descriptorSetLayout_ = DescriptorSetLayout(), PipelineBindPoint pipelineBindPoint_ = PipelineBindPoint::eGraphics, PipelineLayout pipelineLayout_ = PipelineLayout(), uint32_t set_ = 0 ) - : sType( StructureType::eDescriptorUpdateTemplateCreateInfoKHR ) - , pNext( nullptr ) - , flags( flags_ ) - , descriptorUpdateEntryCount( descriptorUpdateEntryCount_ ) - , pDescriptorUpdateEntries( pDescriptorUpdateEntries_ ) - , templateType( templateType_ ) - , descriptorSetLayout( descriptorSetLayout_ ) - , pipelineBindPoint( pipelineBindPoint_ ) - , pipelineLayout( pipelineLayout_ ) - , set( set_ ) + DeviceCreateInfo( DeviceCreateFlags flags_ = DeviceCreateFlags(), uint32_t queueCreateInfoCount_ = 0, const DeviceQueueCreateInfo* pQueueCreateInfos_ = nullptr, uint32_t enabledLayerCount_ = 0, const char* const* ppEnabledLayerNames_ = nullptr, uint32_t enabledExtensionCount_ = 0, const char* const* ppEnabledExtensionNames_ = nullptr, const PhysicalDeviceFeatures* pEnabledFeatures_ = nullptr ) + : flags( flags_ ) + , queueCreateInfoCount( queueCreateInfoCount_ ) + , pQueueCreateInfos( pQueueCreateInfos_ ) + , enabledLayerCount( enabledLayerCount_ ) + , ppEnabledLayerNames( ppEnabledLayerNames_ ) + , enabledExtensionCount( enabledExtensionCount_ ) + , ppEnabledExtensionNames( ppEnabledExtensionNames_ ) + , pEnabledFeatures( pEnabledFeatures_ ) { } - DescriptorUpdateTemplateCreateInfoKHR( VkDescriptorUpdateTemplateCreateInfoKHR const & rhs ) + DeviceCreateInfo( VkDeviceCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( DescriptorUpdateTemplateCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( DeviceCreateInfo ) ); } - DescriptorUpdateTemplateCreateInfoKHR& operator=( VkDescriptorUpdateTemplateCreateInfoKHR const & rhs ) + DeviceCreateInfo& operator=( VkDeviceCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( DescriptorUpdateTemplateCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( DeviceCreateInfo ) ); return *this; } - DescriptorUpdateTemplateCreateInfoKHR& setPNext( void* pNext_ ) + DeviceCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - DescriptorUpdateTemplateCreateInfoKHR& setFlags( DescriptorUpdateTemplateCreateFlagsKHR flags_ ) + DeviceCreateInfo& setFlags( DeviceCreateFlags flags_ ) { flags = flags_; return *this; } - DescriptorUpdateTemplateCreateInfoKHR& setDescriptorUpdateEntryCount( uint32_t descriptorUpdateEntryCount_ ) + DeviceCreateInfo& setQueueCreateInfoCount( uint32_t queueCreateInfoCount_ ) { - descriptorUpdateEntryCount = descriptorUpdateEntryCount_; + queueCreateInfoCount = queueCreateInfoCount_; return *this; } - DescriptorUpdateTemplateCreateInfoKHR& setPDescriptorUpdateEntries( const DescriptorUpdateTemplateEntryKHR* pDescriptorUpdateEntries_ ) + DeviceCreateInfo& setPQueueCreateInfos( const DeviceQueueCreateInfo* pQueueCreateInfos_ ) { - pDescriptorUpdateEntries = pDescriptorUpdateEntries_; + pQueueCreateInfos = pQueueCreateInfos_; return *this; } - DescriptorUpdateTemplateCreateInfoKHR& setTemplateType( DescriptorUpdateTemplateTypeKHR templateType_ ) + DeviceCreateInfo& setEnabledLayerCount( uint32_t enabledLayerCount_ ) { - templateType = templateType_; + enabledLayerCount = enabledLayerCount_; return *this; } - DescriptorUpdateTemplateCreateInfoKHR& setDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout_ ) + DeviceCreateInfo& setPpEnabledLayerNames( const char* const* ppEnabledLayerNames_ ) { - descriptorSetLayout = descriptorSetLayout_; + ppEnabledLayerNames = ppEnabledLayerNames_; return *this; } - DescriptorUpdateTemplateCreateInfoKHR& setPipelineBindPoint( PipelineBindPoint pipelineBindPoint_ ) + DeviceCreateInfo& setEnabledExtensionCount( uint32_t enabledExtensionCount_ ) { - pipelineBindPoint = pipelineBindPoint_; + enabledExtensionCount = enabledExtensionCount_; return *this; } - DescriptorUpdateTemplateCreateInfoKHR& setPipelineLayout( PipelineLayout pipelineLayout_ ) + DeviceCreateInfo& setPpEnabledExtensionNames( const char* const* ppEnabledExtensionNames_ ) { - pipelineLayout = pipelineLayout_; + ppEnabledExtensionNames = ppEnabledExtensionNames_; return *this; } - DescriptorUpdateTemplateCreateInfoKHR& setSet( uint32_t set_ ) + DeviceCreateInfo& setPEnabledFeatures( const PhysicalDeviceFeatures* pEnabledFeatures_ ) { - set = set_; + pEnabledFeatures = pEnabledFeatures_; return *this; } - operator const VkDescriptorUpdateTemplateCreateInfoKHR&() const - { - return *reinterpret_cast(this); - } - - bool operator==( DescriptorUpdateTemplateCreateInfoKHR const& rhs ) const - { - 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 ); - } - - bool operator!=( DescriptorUpdateTemplateCreateInfoKHR const& rhs ) const - { - return !operator==( rhs ); - } - - private: - StructureType sType; - - public: - void* pNext; - DescriptorUpdateTemplateCreateFlagsKHR flags; - uint32_t descriptorUpdateEntryCount; - const DescriptorUpdateTemplateEntryKHR* pDescriptorUpdateEntries; - DescriptorUpdateTemplateTypeKHR templateType; - DescriptorSetLayout descriptorSetLayout; - PipelineBindPoint pipelineBindPoint; - PipelineLayout pipelineLayout; - uint32_t set; - }; - static_assert( sizeof( DescriptorUpdateTemplateCreateInfoKHR ) == sizeof( VkDescriptorUpdateTemplateCreateInfoKHR ), "struct and wrapper have different size!" ); - - 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, - 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, - eDescriptorUpdateTemplateKHR = VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR, - eObjectTableNVX = VK_OBJECT_TYPE_OBJECT_TABLE_NVX, - eIndirectCommandsLayoutNVX = VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX, - eSamplerYcbcrConversionKHR = VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR, - eValidationCacheEXT = VK_OBJECT_TYPE_VALIDATION_CACHE_EXT - }; + operator const VkDeviceCreateInfo&() const + { + return *reinterpret_cast(this); + } - enum class QueueFlagBits - { - eGraphics = VK_QUEUE_GRAPHICS_BIT, - eCompute = VK_QUEUE_COMPUTE_BIT, - eTransfer = VK_QUEUE_TRANSFER_BIT, - eSparseBinding = VK_QUEUE_SPARSE_BINDING_BIT - }; + bool operator==( DeviceCreateInfo const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( queueCreateInfoCount == rhs.queueCreateInfoCount ) + && ( pQueueCreateInfos == rhs.pQueueCreateInfos ) + && ( enabledLayerCount == rhs.enabledLayerCount ) + && ( ppEnabledLayerNames == rhs.ppEnabledLayerNames ) + && ( enabledExtensionCount == rhs.enabledExtensionCount ) + && ( ppEnabledExtensionNames == rhs.ppEnabledExtensionNames ) + && ( pEnabledFeatures == rhs.pEnabledFeatures ); + } - using QueueFlags = Flags; + bool operator!=( DeviceCreateInfo const& rhs ) const + { + return !operator==( rhs ); + } - VULKAN_HPP_INLINE QueueFlags operator|( QueueFlagBits bit0, QueueFlagBits bit1 ) - { - return QueueFlags( bit0 ) | bit1; - } + private: + StructureType sType = StructureType::eDeviceCreateInfo; - VULKAN_HPP_INLINE QueueFlags operator~( QueueFlagBits bits ) - { - return ~( QueueFlags( bits ) ); - } + public: + const void* pNext = nullptr; + DeviceCreateFlags flags; + uint32_t queueCreateInfoCount; + const DeviceQueueCreateInfo* pQueueCreateInfos; + uint32_t enabledLayerCount; + const char* const* ppEnabledLayerNames; + uint32_t enabledExtensionCount; + const char* const* ppEnabledExtensionNames; + const PhysicalDeviceFeatures* pEnabledFeatures; + }; + static_assert( sizeof( DeviceCreateInfo ) == sizeof( VkDeviceCreateInfo ), "struct and wrapper have different size!" ); - template <> struct FlagTraits + struct DeviceQueueInfo2 { - enum + DeviceQueueInfo2( DeviceQueueCreateFlags flags_ = DeviceQueueCreateFlags(), uint32_t queueFamilyIndex_ = 0, uint32_t queueIndex_ = 0 ) + : flags( flags_ ) + , queueFamilyIndex( queueFamilyIndex_ ) + , queueIndex( queueIndex_ ) { - allFlags = VkFlags(QueueFlagBits::eGraphics) | VkFlags(QueueFlagBits::eCompute) | VkFlags(QueueFlagBits::eTransfer) | VkFlags(QueueFlagBits::eSparseBinding) - }; - }; + } - struct QueueFamilyProperties - { - operator const VkQueueFamilyProperties&() const + DeviceQueueInfo2( VkDeviceQueueInfo2 const & rhs ) { - return *reinterpret_cast(this); + memcpy( this, &rhs, sizeof( DeviceQueueInfo2 ) ); } - bool operator==( QueueFamilyProperties const& rhs ) const + DeviceQueueInfo2& operator=( VkDeviceQueueInfo2 const & rhs ) { - return ( queueFlags == rhs.queueFlags ) - && ( queueCount == rhs.queueCount ) - && ( timestampValidBits == rhs.timestampValidBits ) - && ( minImageTransferGranularity == rhs.minImageTransferGranularity ); + memcpy( this, &rhs, sizeof( DeviceQueueInfo2 ) ); + return *this; + } + DeviceQueueInfo2& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; } - bool operator!=( QueueFamilyProperties const& rhs ) const + DeviceQueueInfo2& setFlags( DeviceQueueCreateFlags flags_ ) { - return !operator==( rhs ); + flags = flags_; + return *this; } - QueueFlags queueFlags; - uint32_t queueCount; - uint32_t timestampValidBits; - Extent3D minImageTransferGranularity; - }; - static_assert( sizeof( QueueFamilyProperties ) == sizeof( VkQueueFamilyProperties ), "struct and wrapper have different size!" ); + DeviceQueueInfo2& setQueueFamilyIndex( uint32_t queueFamilyIndex_ ) + { + queueFamilyIndex = queueFamilyIndex_; + return *this; + } - struct QueueFamilyProperties2KHR - { - operator const VkQueueFamilyProperties2KHR&() const + DeviceQueueInfo2& setQueueIndex( uint32_t queueIndex_ ) + { + queueIndex = queueIndex_; + return *this; + } + + operator const VkDeviceQueueInfo2&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( QueueFamilyProperties2KHR const& rhs ) const + bool operator==( DeviceQueueInfo2 const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( queueFamilyProperties == rhs.queueFamilyProperties ); + && ( flags == rhs.flags ) + && ( queueFamilyIndex == rhs.queueFamilyIndex ) + && ( queueIndex == rhs.queueIndex ); } - bool operator!=( QueueFamilyProperties2KHR const& rhs ) const + bool operator!=( DeviceQueueInfo2 const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDeviceQueueInfo2; public: - void* pNext; - QueueFamilyProperties queueFamilyProperties; + const void* pNext = nullptr; + DeviceQueueCreateFlags flags; + uint32_t queueFamilyIndex; + uint32_t queueIndex; }; - static_assert( sizeof( QueueFamilyProperties2KHR ) == sizeof( VkQueueFamilyProperties2KHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( DeviceQueueInfo2 ) == sizeof( VkDeviceQueueInfo2 ), "struct and wrapper have different size!" ); enum class MemoryPropertyFlagBits { @@ -14288,7 +17606,8 @@ 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 + eLazilyAllocated = VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT, + eProtected = VK_MEMORY_PROPERTY_PROTECTED_BIT }; using MemoryPropertyFlags = Flags; @@ -14307,7 +17626,7 @@ { enum { - allFlags = VkFlags(MemoryPropertyFlagBits::eDeviceLocal) | VkFlags(MemoryPropertyFlagBits::eHostVisible) | VkFlags(MemoryPropertyFlagBits::eHostCoherent) | VkFlags(MemoryPropertyFlagBits::eHostCached) | VkFlags(MemoryPropertyFlagBits::eLazilyAllocated) + allFlags = VkFlags(MemoryPropertyFlagBits::eDeviceLocal) | VkFlags(MemoryPropertyFlagBits::eHostVisible) | VkFlags(MemoryPropertyFlagBits::eHostCoherent) | VkFlags(MemoryPropertyFlagBits::eHostCached) | VkFlags(MemoryPropertyFlagBits::eLazilyAllocated) | VkFlags(MemoryPropertyFlagBits::eProtected) }; }; @@ -14337,7 +17656,8 @@ enum class MemoryHeapFlagBits { eDeviceLocal = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT, - eMultiInstanceKHX = VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHX + eMultiInstance = VK_MEMORY_HEAP_MULTI_INSTANCE_BIT, + eMultiInstanceKHR = VK_MEMORY_HEAP_MULTI_INSTANCE_BIT }; using MemoryHeapFlags = Flags; @@ -14356,7 +17676,7 @@ { enum { - allFlags = VkFlags(MemoryHeapFlagBits::eDeviceLocal) | VkFlags(MemoryHeapFlagBits::eMultiInstanceKHX) + allFlags = VkFlags(MemoryHeapFlagBits::eDeviceLocal) | VkFlags(MemoryHeapFlagBits::eMultiInstance) }; }; @@ -14410,33 +17730,35 @@ }; static_assert( sizeof( PhysicalDeviceMemoryProperties ) == sizeof( VkPhysicalDeviceMemoryProperties ), "struct and wrapper have different size!" ); - struct PhysicalDeviceMemoryProperties2KHR + struct PhysicalDeviceMemoryProperties2 { - operator const VkPhysicalDeviceMemoryProperties2KHR&() const + operator const VkPhysicalDeviceMemoryProperties2&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceMemoryProperties2KHR const& rhs ) const + bool operator==( PhysicalDeviceMemoryProperties2 const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memoryProperties == rhs.memoryProperties ); } - bool operator!=( PhysicalDeviceMemoryProperties2KHR const& rhs ) const + bool operator!=( PhysicalDeviceMemoryProperties2 const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceMemoryProperties2; public: - void* pNext; + void* pNext = nullptr; PhysicalDeviceMemoryProperties memoryProperties; }; - static_assert( sizeof( PhysicalDeviceMemoryProperties2KHR ) == sizeof( VkPhysicalDeviceMemoryProperties2KHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceMemoryProperties2 ) == sizeof( VkPhysicalDeviceMemoryProperties2 ), "struct and wrapper have different size!" ); + + using PhysicalDeviceMemoryProperties2KHR = PhysicalDeviceMemoryProperties2; enum class AccessFlagBits { @@ -14485,9 +17807,7 @@ struct MemoryBarrier { MemoryBarrier( AccessFlags srcAccessMask_ = AccessFlags(), AccessFlags dstAccessMask_ = AccessFlags() ) - : sType( StructureType::eMemoryBarrier ) - , pNext( nullptr ) - , srcAccessMask( srcAccessMask_ ) + : srcAccessMask( srcAccessMask_ ) , dstAccessMask( dstAccessMask_ ) { } @@ -14539,10 +17859,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eMemoryBarrier; public: - const void* pNext; + const void* pNext = nullptr; AccessFlags srcAccessMask; AccessFlags dstAccessMask; }; @@ -14551,9 +17871,7 @@ struct BufferMemoryBarrier { BufferMemoryBarrier( AccessFlags srcAccessMask_ = AccessFlags(), AccessFlags dstAccessMask_ = AccessFlags(), uint32_t srcQueueFamilyIndex_ = 0, uint32_t dstQueueFamilyIndex_ = 0, Buffer buffer_ = Buffer(), DeviceSize offset_ = 0, DeviceSize size_ = 0 ) - : sType( StructureType::eBufferMemoryBarrier ) - , pNext( nullptr ) - , srcAccessMask( srcAccessMask_ ) + : srcAccessMask( srcAccessMask_ ) , dstAccessMask( dstAccessMask_ ) , srcQueueFamilyIndex( srcQueueFamilyIndex_ ) , dstQueueFamilyIndex( dstQueueFamilyIndex_ ) @@ -14645,10 +17963,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eBufferMemoryBarrier; public: - const void* pNext; + const void* pNext = nullptr; AccessFlags srcAccessMask; AccessFlags dstAccessMask; uint32_t srcQueueFamilyIndex; @@ -14696,7 +18014,8 @@ { eSparseBinding = VK_BUFFER_CREATE_SPARSE_BINDING_BIT, eSparseResidency = VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT, - eSparseAliased = VK_BUFFER_CREATE_SPARSE_ALIASED_BIT + eSparseAliased = VK_BUFFER_CREATE_SPARSE_ALIASED_BIT, + eProtected = VK_BUFFER_CREATE_PROTECTED_BIT }; using BufferCreateFlags = Flags; @@ -14715,16 +18034,14 @@ { enum { - allFlags = VkFlags(BufferCreateFlagBits::eSparseBinding) | VkFlags(BufferCreateFlagBits::eSparseResidency) | VkFlags(BufferCreateFlagBits::eSparseAliased) + allFlags = VkFlags(BufferCreateFlagBits::eSparseBinding) | VkFlags(BufferCreateFlagBits::eSparseResidency) | VkFlags(BufferCreateFlagBits::eSparseAliased) | VkFlags(BufferCreateFlagBits::eProtected) }; }; struct BufferCreateInfo { BufferCreateInfo( BufferCreateFlags flags_ = BufferCreateFlags(), DeviceSize size_ = 0, BufferUsageFlags usage_ = BufferUsageFlags(), SharingMode sharingMode_ = SharingMode::eExclusive, uint32_t queueFamilyIndexCount_ = 0, const uint32_t* pQueueFamilyIndices_ = nullptr ) - : sType( StructureType::eBufferCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , size( size_ ) , usage( usage_ ) , sharingMode( sharingMode_ ) @@ -14808,10 +18125,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eBufferCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; BufferCreateFlags flags; DeviceSize size; BufferUsageFlags usage; @@ -14934,9 +18251,7 @@ struct PipelineShaderStageCreateInfo { PipelineShaderStageCreateInfo( PipelineShaderStageCreateFlags flags_ = PipelineShaderStageCreateFlags(), ShaderStageFlagBits stage_ = ShaderStageFlagBits::eVertex, ShaderModule module_ = ShaderModule(), const char* pName_ = nullptr, const SpecializationInfo* pSpecializationInfo_ = nullptr ) - : sType( StructureType::ePipelineShaderStageCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , stage( stage_ ) , module( module_ ) , pName( pName_ ) @@ -15012,10 +18327,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::ePipelineShaderStageCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; PipelineShaderStageCreateFlags flags; ShaderStageFlagBits stage; ShaderModule module; @@ -15087,9 +18402,7 @@ struct PipelineLayoutCreateInfo { PipelineLayoutCreateInfo( PipelineLayoutCreateFlags flags_ = PipelineLayoutCreateFlags(), uint32_t setLayoutCount_ = 0, const DescriptorSetLayout* pSetLayouts_ = nullptr, uint32_t pushConstantRangeCount_ = 0, const PushConstantRange* pPushConstantRanges_ = nullptr ) - : sType( StructureType::ePipelineLayoutCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , setLayoutCount( setLayoutCount_ ) , pSetLayouts( pSetLayouts_ ) , pushConstantRangeCount( pushConstantRangeCount_ ) @@ -15165,10 +18478,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::ePipelineLayoutCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; PipelineLayoutCreateFlags flags; uint32_t setLayoutCount; const DescriptorSetLayout* pSetLayouts; @@ -15262,70 +18575,70 @@ } private: - StructureType sType; + StructureType sType = StructureType::eSharedPresentSurfaceCapabilitiesKHR; public: - void* pNext; + void* pNext = nullptr; ImageUsageFlags sharedPresentSupportedUsageFlags; }; static_assert( sizeof( SharedPresentSurfaceCapabilitiesKHR ) == sizeof( VkSharedPresentSurfaceCapabilitiesKHR ), "struct and wrapper have different size!" ); - struct ImageViewUsageCreateInfoKHR + struct ImageViewUsageCreateInfo { - ImageViewUsageCreateInfoKHR( ImageUsageFlags usage_ = ImageUsageFlags() ) - : sType( StructureType::eImageViewUsageCreateInfoKHR ) - , pNext( nullptr ) - , usage( usage_ ) + ImageViewUsageCreateInfo( ImageUsageFlags usage_ = ImageUsageFlags() ) + : usage( usage_ ) { } - ImageViewUsageCreateInfoKHR( VkImageViewUsageCreateInfoKHR const & rhs ) + ImageViewUsageCreateInfo( VkImageViewUsageCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ImageViewUsageCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( ImageViewUsageCreateInfo ) ); } - ImageViewUsageCreateInfoKHR& operator=( VkImageViewUsageCreateInfoKHR const & rhs ) + ImageViewUsageCreateInfo& operator=( VkImageViewUsageCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ImageViewUsageCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( ImageViewUsageCreateInfo ) ); return *this; } - ImageViewUsageCreateInfoKHR& setPNext( const void* pNext_ ) + ImageViewUsageCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - ImageViewUsageCreateInfoKHR& setUsage( ImageUsageFlags usage_ ) + ImageViewUsageCreateInfo& setUsage( ImageUsageFlags usage_ ) { usage = usage_; return *this; } - operator const VkImageViewUsageCreateInfoKHR&() const + operator const VkImageViewUsageCreateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ImageViewUsageCreateInfoKHR const& rhs ) const + bool operator==( ImageViewUsageCreateInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( usage == rhs.usage ); } - bool operator!=( ImageViewUsageCreateInfoKHR const& rhs ) const + bool operator!=( ImageViewUsageCreateInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eImageViewUsageCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; ImageUsageFlags usage; }; - static_assert( sizeof( ImageViewUsageCreateInfoKHR ) == sizeof( VkImageViewUsageCreateInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( ImageViewUsageCreateInfo ) == sizeof( VkImageViewUsageCreateInfo ), "struct and wrapper have different size!" ); + + using ImageViewUsageCreateInfoKHR = ImageViewUsageCreateInfo; enum class ImageCreateFlagBits { @@ -15334,13 +18647,20 @@ eSparseAliased = VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, eMutableFormat = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, eCubeCompatible = VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, - eBindSfrKHX = VK_IMAGE_CREATE_BIND_SFR_BIT_KHX, - e2DArrayCompatibleKHR = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR, - eBlockTexelViewCompatibleKHR = VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR, - eExtendedUsageKHR = VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR, - eSampleLocationsCompatibleDepthEXT = VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT, - eDisjointKHR = VK_IMAGE_CREATE_DISJOINT_BIT_KHR, - eAliasKHR = VK_IMAGE_CREATE_ALIAS_BIT_KHR + eAlias = VK_IMAGE_CREATE_ALIAS_BIT, + eAliasKHR = VK_IMAGE_CREATE_ALIAS_BIT, + eSplitInstanceBindRegions = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT, + eSplitInstanceBindRegionsKHR = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT, + e2DArrayCompatible = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, + e2DArrayCompatibleKHR = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, + eBlockTexelViewCompatible = VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, + eBlockTexelViewCompatibleKHR = VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, + eExtendedUsage = VK_IMAGE_CREATE_EXTENDED_USAGE_BIT, + eExtendedUsageKHR = VK_IMAGE_CREATE_EXTENDED_USAGE_BIT, + eProtected = VK_IMAGE_CREATE_PROTECTED_BIT, + eDisjoint = VK_IMAGE_CREATE_DISJOINT_BIT, + eDisjointKHR = VK_IMAGE_CREATE_DISJOINT_BIT, + eSampleLocationsCompatibleDepthEXT = VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT }; using ImageCreateFlags = Flags; @@ -15359,16 +18679,14 @@ { enum { - allFlags = VkFlags(ImageCreateFlagBits::eSparseBinding) | VkFlags(ImageCreateFlagBits::eSparseResidency) | VkFlags(ImageCreateFlagBits::eSparseAliased) | VkFlags(ImageCreateFlagBits::eMutableFormat) | VkFlags(ImageCreateFlagBits::eCubeCompatible) | VkFlags(ImageCreateFlagBits::eBindSfrKHX) | VkFlags(ImageCreateFlagBits::e2DArrayCompatibleKHR) | VkFlags(ImageCreateFlagBits::eBlockTexelViewCompatibleKHR) | VkFlags(ImageCreateFlagBits::eExtendedUsageKHR) | VkFlags(ImageCreateFlagBits::eSampleLocationsCompatibleDepthEXT) | VkFlags(ImageCreateFlagBits::eDisjointKHR) | VkFlags(ImageCreateFlagBits::eAliasKHR) + 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::eSampleLocationsCompatibleDepthEXT) }; }; - struct PhysicalDeviceImageFormatInfo2KHR + struct PhysicalDeviceImageFormatInfo2 { - PhysicalDeviceImageFormatInfo2KHR( Format format_ = Format::eUndefined, ImageType type_ = ImageType::e1D, ImageTiling tiling_ = ImageTiling::eOptimal, ImageUsageFlags usage_ = ImageUsageFlags(), ImageCreateFlags flags_ = ImageCreateFlags() ) - : sType( StructureType::ePhysicalDeviceImageFormatInfo2KHR ) - , pNext( nullptr ) - , format( format_ ) + PhysicalDeviceImageFormatInfo2( Format format_ = Format::eUndefined, ImageType type_ = ImageType::e1D, ImageTiling tiling_ = ImageTiling::eOptimal, ImageUsageFlags usage_ = ImageUsageFlags(), ImageCreateFlags flags_ = ImageCreateFlags() ) + : format( format_ ) , type( type_ ) , tiling( tiling_ ) , usage( usage_ ) @@ -15376,58 +18694,58 @@ { } - PhysicalDeviceImageFormatInfo2KHR( VkPhysicalDeviceImageFormatInfo2KHR const & rhs ) + PhysicalDeviceImageFormatInfo2( VkPhysicalDeviceImageFormatInfo2 const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceImageFormatInfo2KHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceImageFormatInfo2 ) ); } - PhysicalDeviceImageFormatInfo2KHR& operator=( VkPhysicalDeviceImageFormatInfo2KHR const & rhs ) + PhysicalDeviceImageFormatInfo2& operator=( VkPhysicalDeviceImageFormatInfo2 const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceImageFormatInfo2KHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceImageFormatInfo2 ) ); return *this; } - PhysicalDeviceImageFormatInfo2KHR& setPNext( const void* pNext_ ) + PhysicalDeviceImageFormatInfo2& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PhysicalDeviceImageFormatInfo2KHR& setFormat( Format format_ ) + PhysicalDeviceImageFormatInfo2& setFormat( Format format_ ) { format = format_; return *this; } - PhysicalDeviceImageFormatInfo2KHR& setType( ImageType type_ ) + PhysicalDeviceImageFormatInfo2& setType( ImageType type_ ) { type = type_; return *this; } - PhysicalDeviceImageFormatInfo2KHR& setTiling( ImageTiling tiling_ ) + PhysicalDeviceImageFormatInfo2& setTiling( ImageTiling tiling_ ) { tiling = tiling_; return *this; } - PhysicalDeviceImageFormatInfo2KHR& setUsage( ImageUsageFlags usage_ ) + PhysicalDeviceImageFormatInfo2& setUsage( ImageUsageFlags usage_ ) { usage = usage_; return *this; } - PhysicalDeviceImageFormatInfo2KHR& setFlags( ImageCreateFlags flags_ ) + PhysicalDeviceImageFormatInfo2& setFlags( ImageCreateFlags flags_ ) { flags = flags_; return *this; } - operator const VkPhysicalDeviceImageFormatInfo2KHR&() const + operator const VkPhysicalDeviceImageFormatInfo2&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceImageFormatInfo2KHR const& rhs ) const + bool operator==( PhysicalDeviceImageFormatInfo2 const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) @@ -15438,31 +18756,35 @@ && ( flags == rhs.flags ); } - bool operator!=( PhysicalDeviceImageFormatInfo2KHR const& rhs ) const + bool operator!=( PhysicalDeviceImageFormatInfo2 const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceImageFormatInfo2; public: - const void* pNext; + const void* pNext = nullptr; Format format; ImageType type; ImageTiling tiling; ImageUsageFlags usage; ImageCreateFlags flags; }; - static_assert( sizeof( PhysicalDeviceImageFormatInfo2KHR ) == sizeof( VkPhysicalDeviceImageFormatInfo2KHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceImageFormatInfo2 ) == sizeof( VkPhysicalDeviceImageFormatInfo2 ), "struct and wrapper have different size!" ); + + using PhysicalDeviceImageFormatInfo2KHR = PhysicalDeviceImageFormatInfo2; enum class PipelineCreateFlagBits { eDisableOptimization = VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT, eAllowDerivatives = VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT, eDerivative = VK_PIPELINE_CREATE_DERIVATIVE_BIT, - eViewIndexFromDeviceIndexKHX = VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHX, - eDispatchBaseKHX = VK_PIPELINE_CREATE_DISPATCH_BASE_KHX + eViewIndexFromDeviceIndex = VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT, + eViewIndexFromDeviceIndexKHR = VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT, + eDispatchBase = VK_PIPELINE_CREATE_DISPATCH_BASE, + eDispatchBaseKHR = VK_PIPELINE_CREATE_DISPATCH_BASE }; using PipelineCreateFlags = Flags; @@ -15481,16 +18803,14 @@ { enum { - allFlags = VkFlags(PipelineCreateFlagBits::eDisableOptimization) | VkFlags(PipelineCreateFlagBits::eAllowDerivatives) | VkFlags(PipelineCreateFlagBits::eDerivative) | VkFlags(PipelineCreateFlagBits::eViewIndexFromDeviceIndexKHX) | VkFlags(PipelineCreateFlagBits::eDispatchBaseKHX) + allFlags = VkFlags(PipelineCreateFlagBits::eDisableOptimization) | VkFlags(PipelineCreateFlagBits::eAllowDerivatives) | VkFlags(PipelineCreateFlagBits::eDerivative) | VkFlags(PipelineCreateFlagBits::eViewIndexFromDeviceIndex) | VkFlags(PipelineCreateFlagBits::eDispatchBase) }; }; struct ComputePipelineCreateInfo { ComputePipelineCreateInfo( PipelineCreateFlags flags_ = PipelineCreateFlags(), PipelineShaderStageCreateInfo stage_ = PipelineShaderStageCreateInfo(), PipelineLayout layout_ = PipelineLayout(), Pipeline basePipelineHandle_ = Pipeline(), int32_t basePipelineIndex_ = 0 ) - : sType( StructureType::eComputePipelineCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , stage( stage_ ) , layout( layout_ ) , basePipelineHandle( basePipelineHandle_ ) @@ -15566,10 +18886,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eComputePipelineCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; PipelineCreateFlags flags; PipelineShaderStageCreateInfo stage; PipelineLayout layout; @@ -15714,9 +19034,7 @@ struct PipelineColorBlendStateCreateInfo { PipelineColorBlendStateCreateInfo( PipelineColorBlendStateCreateFlags flags_ = PipelineColorBlendStateCreateFlags(), Bool32 logicOpEnable_ = 0, LogicOp logicOp_ = LogicOp::eClear, uint32_t attachmentCount_ = 0, const PipelineColorBlendAttachmentState* pAttachments_ = nullptr, std::array const& blendConstants_ = { { 0, 0, 0, 0 } } ) - : sType( StructureType::ePipelineColorBlendStateCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , logicOpEnable( logicOpEnable_ ) , logicOp( logicOp_ ) , attachmentCount( attachmentCount_ ) @@ -15800,10 +19118,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::ePipelineColorBlendStateCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; PipelineColorBlendStateCreateFlags flags; Bool32 logicOpEnable; LogicOp logicOp; @@ -15841,9 +19159,7 @@ struct FenceCreateInfo { FenceCreateInfo( FenceCreateFlags flags_ = FenceCreateFlags() ) - : sType( StructureType::eFenceCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) { } @@ -15887,10 +19203,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eFenceCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; FenceCreateFlags flags; }; static_assert( sizeof( FenceCreateInfo ) == sizeof( VkFenceCreateInfo ), "struct and wrapper have different size!" ); @@ -15910,17 +19226,26 @@ 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, + eTransferSrcKHR = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, + eTransferDst = VK_FORMAT_FEATURE_TRANSFER_DST_BIT, + eTransferDstKHR = VK_FORMAT_FEATURE_TRANSFER_DST_BIT, + eMidpointChromaSamples = VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT, + eMidpointChromaSamplesKHR = VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT, + eSampledImageYcbcrConversionLinearFilter = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT, + eSampledImageYcbcrConversionLinearFilterKHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT, + eSampledImageYcbcrConversionSeparateReconstructionFilter = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT, + eSampledImageYcbcrConversionSeparateReconstructionFilterKHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT, + eSampledImageYcbcrConversionChromaReconstructionExplicit = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT, + eSampledImageYcbcrConversionChromaReconstructionExplicitKHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT, + eSampledImageYcbcrConversionChromaReconstructionExplicitForceable = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT, + eSampledImageYcbcrConversionChromaReconstructionExplicitForceableKHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT, + eDisjoint = VK_FORMAT_FEATURE_DISJOINT_BIT, + eDisjointKHR = VK_FORMAT_FEATURE_DISJOINT_BIT, + eCositedChromaSamples = VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, + eCositedChromaSamplesKHR = VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, eSampledImageFilterCubicIMG = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG, - eTransferSrcKHR = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR, - eTransferDstKHR = VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR, - eSampledImageFilterMinmaxEXT = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT, - eMidpointChromaSamplesKHR = VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_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, - 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, - eDisjointKHR = VK_FORMAT_FEATURE_DISJOINT_BIT_KHR, - eCositedChromaSamplesKHR = VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR + eSampledImageFilterMinmaxEXT = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT }; using FormatFeatureFlags = Flags; @@ -15939,7 +19264,7 @@ { enum { - 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::eSampledImageFilterCubicIMG) | VkFlags(FormatFeatureFlagBits::eTransferSrcKHR) | VkFlags(FormatFeatureFlagBits::eTransferDstKHR) | VkFlags(FormatFeatureFlagBits::eSampledImageFilterMinmaxEXT) | VkFlags(FormatFeatureFlagBits::eMidpointChromaSamplesKHR) | VkFlags(FormatFeatureFlagBits::eSampledImageYcbcrConversionLinearFilterKHR) | VkFlags(FormatFeatureFlagBits::eSampledImageYcbcrConversionSeparateReconstructionFilterKHR) | VkFlags(FormatFeatureFlagBits::eSampledImageYcbcrConversionChromaReconstructionExplicitKHR) | VkFlags(FormatFeatureFlagBits::eSampledImageYcbcrConversionChromaReconstructionExplicitForceableKHR) | VkFlags(FormatFeatureFlagBits::eDisjointKHR) | VkFlags(FormatFeatureFlagBits::eCositedChromaSamplesKHR) + 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::eSampledImageFilterCubicIMG) | VkFlags(FormatFeatureFlagBits::eSampledImageFilterMinmaxEXT) }; }; @@ -15968,33 +19293,35 @@ }; static_assert( sizeof( FormatProperties ) == sizeof( VkFormatProperties ), "struct and wrapper have different size!" ); - struct FormatProperties2KHR + struct FormatProperties2 { - operator const VkFormatProperties2KHR&() const + operator const VkFormatProperties2&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( FormatProperties2KHR const& rhs ) const + bool operator==( FormatProperties2 const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( formatProperties == rhs.formatProperties ); } - bool operator!=( FormatProperties2KHR const& rhs ) const + bool operator!=( FormatProperties2 const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eFormatProperties2; public: - void* pNext; + void* pNext = nullptr; FormatProperties formatProperties; }; - static_assert( sizeof( FormatProperties2KHR ) == sizeof( VkFormatProperties2KHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( FormatProperties2 ) == sizeof( VkFormatProperties2 ), "struct and wrapper have different size!" ); + + using FormatProperties2KHR = FormatProperties2; enum class QueryControlFlagBits { @@ -16114,9 +19441,7 @@ struct CommandBufferInheritanceInfo { CommandBufferInheritanceInfo( RenderPass renderPass_ = RenderPass(), uint32_t subpass_ = 0, Framebuffer framebuffer_ = Framebuffer(), Bool32 occlusionQueryEnable_ = 0, QueryControlFlags queryFlags_ = QueryControlFlags(), QueryPipelineStatisticFlags pipelineStatistics_ = QueryPipelineStatisticFlags() ) - : sType( StructureType::eCommandBufferInheritanceInfo ) - , pNext( nullptr ) - , renderPass( renderPass_ ) + : renderPass( renderPass_ ) , subpass( subpass_ ) , framebuffer( framebuffer_ ) , occlusionQueryEnable( occlusionQueryEnable_ ) @@ -16200,10 +19525,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eCommandBufferInheritanceInfo; public: - const void* pNext; + const void* pNext = nullptr; RenderPass renderPass; uint32_t subpass; Framebuffer framebuffer; @@ -16216,9 +19541,7 @@ struct CommandBufferBeginInfo { CommandBufferBeginInfo( CommandBufferUsageFlags flags_ = CommandBufferUsageFlags(), const CommandBufferInheritanceInfo* pInheritanceInfo_ = nullptr ) - : sType( StructureType::eCommandBufferBeginInfo ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , pInheritanceInfo( pInheritanceInfo_ ) { } @@ -16270,10 +19593,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eCommandBufferBeginInfo; public: - const void* pNext; + const void* pNext = nullptr; CommandBufferUsageFlags flags; const CommandBufferInheritanceInfo* pInheritanceInfo; }; @@ -16282,9 +19605,7 @@ struct QueryPoolCreateInfo { QueryPoolCreateInfo( QueryPoolCreateFlags flags_ = QueryPoolCreateFlags(), QueryType queryType_ = QueryType::eOcclusion, uint32_t queryCount_ = 0, QueryPipelineStatisticFlags pipelineStatistics_ = QueryPipelineStatisticFlags() ) - : sType( StructureType::eQueryPoolCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , queryType( queryType_ ) , queryCount( queryCount_ ) , pipelineStatistics( pipelineStatistics_ ) @@ -16352,10 +19673,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eQueryPoolCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; QueryPoolCreateFlags flags; QueryType queryType; uint32_t queryCount; @@ -16369,9 +19690,12 @@ eDepth = VK_IMAGE_ASPECT_DEPTH_BIT, eStencil = VK_IMAGE_ASPECT_STENCIL_BIT, eMetadata = VK_IMAGE_ASPECT_METADATA_BIT, - ePlane0KHR = VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, - ePlane1KHR = VK_IMAGE_ASPECT_PLANE_1_BIT_KHR, - ePlane2KHR = VK_IMAGE_ASPECT_PLANE_2_BIT_KHR + ePlane0 = VK_IMAGE_ASPECT_PLANE_0_BIT, + ePlane0KHR = VK_IMAGE_ASPECT_PLANE_0_BIT, + ePlane1 = VK_IMAGE_ASPECT_PLANE_1_BIT, + ePlane1KHR = VK_IMAGE_ASPECT_PLANE_1_BIT, + ePlane2 = VK_IMAGE_ASPECT_PLANE_2_BIT, + ePlane2KHR = VK_IMAGE_ASPECT_PLANE_2_BIT }; using ImageAspectFlags = Flags; @@ -16390,7 +19714,7 @@ { enum { - allFlags = VkFlags(ImageAspectFlagBits::eColor) | VkFlags(ImageAspectFlagBits::eDepth) | VkFlags(ImageAspectFlagBits::eStencil) | VkFlags(ImageAspectFlagBits::eMetadata) | VkFlags(ImageAspectFlagBits::ePlane0KHR) | VkFlags(ImageAspectFlagBits::ePlane1KHR) | VkFlags(ImageAspectFlagBits::ePlane2KHR) + allFlags = VkFlags(ImageAspectFlagBits::eColor) | VkFlags(ImageAspectFlagBits::eDepth) | VkFlags(ImageAspectFlagBits::eStencil) | VkFlags(ImageAspectFlagBits::eMetadata) | VkFlags(ImageAspectFlagBits::ePlane0) | VkFlags(ImageAspectFlagBits::ePlane1) | VkFlags(ImageAspectFlagBits::ePlane2) }; }; @@ -16604,9 +19928,7 @@ struct ImageMemoryBarrier { ImageMemoryBarrier( AccessFlags srcAccessMask_ = AccessFlags(), AccessFlags dstAccessMask_ = AccessFlags(), ImageLayout oldLayout_ = ImageLayout::eUndefined, ImageLayout newLayout_ = ImageLayout::eUndefined, uint32_t srcQueueFamilyIndex_ = 0, uint32_t dstQueueFamilyIndex_ = 0, Image image_ = Image(), ImageSubresourceRange subresourceRange_ = ImageSubresourceRange() ) - : sType( StructureType::eImageMemoryBarrier ) - , pNext( nullptr ) - , srcAccessMask( srcAccessMask_ ) + : srcAccessMask( srcAccessMask_ ) , dstAccessMask( dstAccessMask_ ) , oldLayout( oldLayout_ ) , newLayout( newLayout_ ) @@ -16706,10 +20028,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eImageMemoryBarrier; public: - const void* pNext; + const void* pNext = nullptr; AccessFlags srcAccessMask; AccessFlags dstAccessMask; ImageLayout oldLayout; @@ -16724,9 +20046,7 @@ struct ImageViewCreateInfo { ImageViewCreateInfo( ImageViewCreateFlags flags_ = ImageViewCreateFlags(), Image image_ = Image(), ImageViewType viewType_ = ImageViewType::e1D, Format format_ = Format::eUndefined, ComponentMapping components_ = ComponentMapping(), ImageSubresourceRange subresourceRange_ = ImageSubresourceRange() ) - : sType( StructureType::eImageViewCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , image( image_ ) , viewType( viewType_ ) , format( format_ ) @@ -16810,10 +20130,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eImageViewCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; ImageViewCreateFlags flags; Image image; ImageViewType viewType; @@ -17183,56 +20503,56 @@ }; static_assert( sizeof( ClearAttachment ) == sizeof( VkClearAttachment ), "struct and wrapper have different size!" ); - struct InputAttachmentAspectReferenceKHR + struct InputAttachmentAspectReference { - InputAttachmentAspectReferenceKHR( uint32_t subpass_ = 0, uint32_t inputAttachmentIndex_ = 0, ImageAspectFlags aspectMask_ = ImageAspectFlags() ) + InputAttachmentAspectReference( uint32_t subpass_ = 0, uint32_t inputAttachmentIndex_ = 0, ImageAspectFlags aspectMask_ = ImageAspectFlags() ) : subpass( subpass_ ) , inputAttachmentIndex( inputAttachmentIndex_ ) , aspectMask( aspectMask_ ) { } - InputAttachmentAspectReferenceKHR( VkInputAttachmentAspectReferenceKHR const & rhs ) + InputAttachmentAspectReference( VkInputAttachmentAspectReference const & rhs ) { - memcpy( this, &rhs, sizeof( InputAttachmentAspectReferenceKHR ) ); + memcpy( this, &rhs, sizeof( InputAttachmentAspectReference ) ); } - InputAttachmentAspectReferenceKHR& operator=( VkInputAttachmentAspectReferenceKHR const & rhs ) + InputAttachmentAspectReference& operator=( VkInputAttachmentAspectReference const & rhs ) { - memcpy( this, &rhs, sizeof( InputAttachmentAspectReferenceKHR ) ); + memcpy( this, &rhs, sizeof( InputAttachmentAspectReference ) ); return *this; } - InputAttachmentAspectReferenceKHR& setSubpass( uint32_t subpass_ ) + InputAttachmentAspectReference& setSubpass( uint32_t subpass_ ) { subpass = subpass_; return *this; } - InputAttachmentAspectReferenceKHR& setInputAttachmentIndex( uint32_t inputAttachmentIndex_ ) + InputAttachmentAspectReference& setInputAttachmentIndex( uint32_t inputAttachmentIndex_ ) { inputAttachmentIndex = inputAttachmentIndex_; return *this; } - InputAttachmentAspectReferenceKHR& setAspectMask( ImageAspectFlags aspectMask_ ) + InputAttachmentAspectReference& setAspectMask( ImageAspectFlags aspectMask_ ) { aspectMask = aspectMask_; return *this; } - operator const VkInputAttachmentAspectReferenceKHR&() const + operator const VkInputAttachmentAspectReference&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( InputAttachmentAspectReferenceKHR const& rhs ) const + bool operator==( InputAttachmentAspectReference const& rhs ) const { return ( subpass == rhs.subpass ) && ( inputAttachmentIndex == rhs.inputAttachmentIndex ) && ( aspectMask == rhs.aspectMask ); } - bool operator!=( InputAttachmentAspectReferenceKHR const& rhs ) const + bool operator!=( InputAttachmentAspectReference const& rhs ) const { return !operator==( rhs ); } @@ -17241,52 +20561,52 @@ uint32_t inputAttachmentIndex; ImageAspectFlags aspectMask; }; - static_assert( sizeof( InputAttachmentAspectReferenceKHR ) == sizeof( VkInputAttachmentAspectReferenceKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( InputAttachmentAspectReference ) == sizeof( VkInputAttachmentAspectReference ), "struct and wrapper have different size!" ); + + using InputAttachmentAspectReferenceKHR = InputAttachmentAspectReference; - struct RenderPassInputAttachmentAspectCreateInfoKHR + struct RenderPassInputAttachmentAspectCreateInfo { - RenderPassInputAttachmentAspectCreateInfoKHR( uint32_t aspectReferenceCount_ = 0, const InputAttachmentAspectReferenceKHR* pAspectReferences_ = nullptr ) - : sType( StructureType::eRenderPassInputAttachmentAspectCreateInfoKHR ) - , pNext( nullptr ) - , aspectReferenceCount( aspectReferenceCount_ ) + RenderPassInputAttachmentAspectCreateInfo( uint32_t aspectReferenceCount_ = 0, const InputAttachmentAspectReference* pAspectReferences_ = nullptr ) + : aspectReferenceCount( aspectReferenceCount_ ) , pAspectReferences( pAspectReferences_ ) { } - RenderPassInputAttachmentAspectCreateInfoKHR( VkRenderPassInputAttachmentAspectCreateInfoKHR const & rhs ) + RenderPassInputAttachmentAspectCreateInfo( VkRenderPassInputAttachmentAspectCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( RenderPassInputAttachmentAspectCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( RenderPassInputAttachmentAspectCreateInfo ) ); } - RenderPassInputAttachmentAspectCreateInfoKHR& operator=( VkRenderPassInputAttachmentAspectCreateInfoKHR const & rhs ) + RenderPassInputAttachmentAspectCreateInfo& operator=( VkRenderPassInputAttachmentAspectCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( RenderPassInputAttachmentAspectCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( RenderPassInputAttachmentAspectCreateInfo ) ); return *this; } - RenderPassInputAttachmentAspectCreateInfoKHR& setPNext( const void* pNext_ ) + RenderPassInputAttachmentAspectCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - RenderPassInputAttachmentAspectCreateInfoKHR& setAspectReferenceCount( uint32_t aspectReferenceCount_ ) + RenderPassInputAttachmentAspectCreateInfo& setAspectReferenceCount( uint32_t aspectReferenceCount_ ) { aspectReferenceCount = aspectReferenceCount_; return *this; } - RenderPassInputAttachmentAspectCreateInfoKHR& setPAspectReferences( const InputAttachmentAspectReferenceKHR* pAspectReferences_ ) + RenderPassInputAttachmentAspectCreateInfo& setPAspectReferences( const InputAttachmentAspectReference* pAspectReferences_ ) { pAspectReferences = pAspectReferences_; return *this; } - operator const VkRenderPassInputAttachmentAspectCreateInfoKHR&() const + operator const VkRenderPassInputAttachmentAspectCreateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( RenderPassInputAttachmentAspectCreateInfoKHR const& rhs ) const + bool operator==( RenderPassInputAttachmentAspectCreateInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) @@ -17294,134 +20614,136 @@ && ( pAspectReferences == rhs.pAspectReferences ); } - bool operator!=( RenderPassInputAttachmentAspectCreateInfoKHR const& rhs ) const + bool operator!=( RenderPassInputAttachmentAspectCreateInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eRenderPassInputAttachmentAspectCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; uint32_t aspectReferenceCount; - const InputAttachmentAspectReferenceKHR* pAspectReferences; + const InputAttachmentAspectReference* pAspectReferences; }; - static_assert( sizeof( RenderPassInputAttachmentAspectCreateInfoKHR ) == sizeof( VkRenderPassInputAttachmentAspectCreateInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( RenderPassInputAttachmentAspectCreateInfo ) == sizeof( VkRenderPassInputAttachmentAspectCreateInfo ), "struct and wrapper have different size!" ); - struct BindImagePlaneMemoryInfoKHR + using RenderPassInputAttachmentAspectCreateInfoKHR = RenderPassInputAttachmentAspectCreateInfo; + + struct BindImagePlaneMemoryInfo { - BindImagePlaneMemoryInfoKHR( ImageAspectFlagBits planeAspect_ = ImageAspectFlagBits::eColor ) - : sType( StructureType::eBindImagePlaneMemoryInfoKHR ) - , pNext( nullptr ) - , planeAspect( planeAspect_ ) + BindImagePlaneMemoryInfo( ImageAspectFlagBits planeAspect_ = ImageAspectFlagBits::eColor ) + : planeAspect( planeAspect_ ) { } - BindImagePlaneMemoryInfoKHR( VkBindImagePlaneMemoryInfoKHR const & rhs ) + BindImagePlaneMemoryInfo( VkBindImagePlaneMemoryInfo const & rhs ) { - memcpy( this, &rhs, sizeof( BindImagePlaneMemoryInfoKHR ) ); + memcpy( this, &rhs, sizeof( BindImagePlaneMemoryInfo ) ); } - BindImagePlaneMemoryInfoKHR& operator=( VkBindImagePlaneMemoryInfoKHR const & rhs ) + BindImagePlaneMemoryInfo& operator=( VkBindImagePlaneMemoryInfo const & rhs ) { - memcpy( this, &rhs, sizeof( BindImagePlaneMemoryInfoKHR ) ); + memcpy( this, &rhs, sizeof( BindImagePlaneMemoryInfo ) ); return *this; } - BindImagePlaneMemoryInfoKHR& setPNext( const void* pNext_ ) + BindImagePlaneMemoryInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - BindImagePlaneMemoryInfoKHR& setPlaneAspect( ImageAspectFlagBits planeAspect_ ) + BindImagePlaneMemoryInfo& setPlaneAspect( ImageAspectFlagBits planeAspect_ ) { planeAspect = planeAspect_; return *this; } - operator const VkBindImagePlaneMemoryInfoKHR&() const + operator const VkBindImagePlaneMemoryInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( BindImagePlaneMemoryInfoKHR const& rhs ) const + bool operator==( BindImagePlaneMemoryInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( planeAspect == rhs.planeAspect ); } - bool operator!=( BindImagePlaneMemoryInfoKHR const& rhs ) const + bool operator!=( BindImagePlaneMemoryInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eBindImagePlaneMemoryInfo; public: - const void* pNext; + const void* pNext = nullptr; ImageAspectFlagBits planeAspect; }; - static_assert( sizeof( BindImagePlaneMemoryInfoKHR ) == sizeof( VkBindImagePlaneMemoryInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( BindImagePlaneMemoryInfo ) == sizeof( VkBindImagePlaneMemoryInfo ), "struct and wrapper have different size!" ); + + using BindImagePlaneMemoryInfoKHR = BindImagePlaneMemoryInfo; - struct ImagePlaneMemoryRequirementsInfoKHR + struct ImagePlaneMemoryRequirementsInfo { - ImagePlaneMemoryRequirementsInfoKHR( ImageAspectFlagBits planeAspect_ = ImageAspectFlagBits::eColor ) - : sType( StructureType::eImagePlaneMemoryRequirementsInfoKHR ) - , pNext( nullptr ) - , planeAspect( planeAspect_ ) + ImagePlaneMemoryRequirementsInfo( ImageAspectFlagBits planeAspect_ = ImageAspectFlagBits::eColor ) + : planeAspect( planeAspect_ ) { } - ImagePlaneMemoryRequirementsInfoKHR( VkImagePlaneMemoryRequirementsInfoKHR const & rhs ) + ImagePlaneMemoryRequirementsInfo( VkImagePlaneMemoryRequirementsInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ImagePlaneMemoryRequirementsInfoKHR ) ); + memcpy( this, &rhs, sizeof( ImagePlaneMemoryRequirementsInfo ) ); } - ImagePlaneMemoryRequirementsInfoKHR& operator=( VkImagePlaneMemoryRequirementsInfoKHR const & rhs ) + ImagePlaneMemoryRequirementsInfo& operator=( VkImagePlaneMemoryRequirementsInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ImagePlaneMemoryRequirementsInfoKHR ) ); + memcpy( this, &rhs, sizeof( ImagePlaneMemoryRequirementsInfo ) ); return *this; } - ImagePlaneMemoryRequirementsInfoKHR& setPNext( const void* pNext_ ) + ImagePlaneMemoryRequirementsInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - ImagePlaneMemoryRequirementsInfoKHR& setPlaneAspect( ImageAspectFlagBits planeAspect_ ) + ImagePlaneMemoryRequirementsInfo& setPlaneAspect( ImageAspectFlagBits planeAspect_ ) { planeAspect = planeAspect_; return *this; } - operator const VkImagePlaneMemoryRequirementsInfoKHR&() const + operator const VkImagePlaneMemoryRequirementsInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ImagePlaneMemoryRequirementsInfoKHR const& rhs ) const + bool operator==( ImagePlaneMemoryRequirementsInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( planeAspect == rhs.planeAspect ); } - bool operator!=( ImagePlaneMemoryRequirementsInfoKHR const& rhs ) const + bool operator!=( ImagePlaneMemoryRequirementsInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eImagePlaneMemoryRequirementsInfo; public: - const void* pNext; + const void* pNext = nullptr; ImageAspectFlagBits planeAspect; }; - static_assert( sizeof( ImagePlaneMemoryRequirementsInfoKHR ) == sizeof( VkImagePlaneMemoryRequirementsInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( ImagePlaneMemoryRequirementsInfo ) == sizeof( VkImagePlaneMemoryRequirementsInfo ), "struct and wrapper have different size!" ); + + using ImagePlaneMemoryRequirementsInfoKHR = ImagePlaneMemoryRequirementsInfo; enum class SparseImageFormatFlagBits { @@ -17504,61 +20826,65 @@ }; static_assert( sizeof( SparseImageMemoryRequirements ) == sizeof( VkSparseImageMemoryRequirements ), "struct and wrapper have different size!" ); - struct SparseImageFormatProperties2KHR + struct SparseImageFormatProperties2 { - operator const VkSparseImageFormatProperties2KHR&() const + operator const VkSparseImageFormatProperties2&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( SparseImageFormatProperties2KHR const& rhs ) const + bool operator==( SparseImageFormatProperties2 const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( properties == rhs.properties ); } - bool operator!=( SparseImageFormatProperties2KHR const& rhs ) const + bool operator!=( SparseImageFormatProperties2 const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eSparseImageFormatProperties2; public: - void* pNext; + void* pNext = nullptr; SparseImageFormatProperties properties; }; - static_assert( sizeof( SparseImageFormatProperties2KHR ) == sizeof( VkSparseImageFormatProperties2KHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( SparseImageFormatProperties2 ) == sizeof( VkSparseImageFormatProperties2 ), "struct and wrapper have different size!" ); + + using SparseImageFormatProperties2KHR = SparseImageFormatProperties2; - struct SparseImageMemoryRequirements2KHR + struct SparseImageMemoryRequirements2 { - operator const VkSparseImageMemoryRequirements2KHR&() const + operator const VkSparseImageMemoryRequirements2&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( SparseImageMemoryRequirements2KHR const& rhs ) const + bool operator==( SparseImageMemoryRequirements2 const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memoryRequirements == rhs.memoryRequirements ); } - bool operator!=( SparseImageMemoryRequirements2KHR const& rhs ) const + bool operator!=( SparseImageMemoryRequirements2 const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eSparseImageMemoryRequirements2; public: - void* pNext; + void* pNext = nullptr; SparseImageMemoryRequirements memoryRequirements; }; - static_assert( sizeof( SparseImageMemoryRequirements2KHR ) == sizeof( VkSparseImageMemoryRequirements2KHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( SparseImageMemoryRequirements2 ) == sizeof( VkSparseImageMemoryRequirements2 ), "struct and wrapper have different size!" ); + + using SparseImageMemoryRequirements2KHR = SparseImageMemoryRequirements2; enum class SparseMemoryBindFlagBits { @@ -17933,9 +21259,7 @@ struct BindSparseInfo { BindSparseInfo( uint32_t waitSemaphoreCount_ = 0, const Semaphore* pWaitSemaphores_ = nullptr, uint32_t bufferBindCount_ = 0, const SparseBufferMemoryBindInfo* pBufferBinds_ = nullptr, uint32_t imageOpaqueBindCount_ = 0, const SparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds_ = nullptr, uint32_t imageBindCount_ = 0, const SparseImageMemoryBindInfo* pImageBinds_ = nullptr, uint32_t signalSemaphoreCount_ = 0, const Semaphore* pSignalSemaphores_ = nullptr ) - : sType( StructureType::eBindSparseInfo ) - , pNext( nullptr ) - , waitSemaphoreCount( waitSemaphoreCount_ ) + : waitSemaphoreCount( waitSemaphoreCount_ ) , pWaitSemaphores( pWaitSemaphores_ ) , bufferBindCount( bufferBindCount_ ) , pBufferBinds( pBufferBinds_ ) @@ -18051,10 +21375,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eBindSparseInfo; public: - const void* pNext; + const void* pNext = nullptr; uint32_t waitSemaphoreCount; const Semaphore* pWaitSemaphores; uint32_t bufferBindCount; @@ -18113,7 +21437,8 @@ enum class CommandPoolCreateFlagBits { eTransient = VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, - eResetCommandBuffer = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT + eResetCommandBuffer = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, + eProtected = VK_COMMAND_POOL_CREATE_PROTECTED_BIT }; using CommandPoolCreateFlags = Flags; @@ -18132,16 +21457,14 @@ { enum { - allFlags = VkFlags(CommandPoolCreateFlagBits::eTransient) | VkFlags(CommandPoolCreateFlagBits::eResetCommandBuffer) + allFlags = VkFlags(CommandPoolCreateFlagBits::eTransient) | VkFlags(CommandPoolCreateFlagBits::eResetCommandBuffer) | VkFlags(CommandPoolCreateFlagBits::eProtected) }; }; struct CommandPoolCreateInfo { CommandPoolCreateInfo( CommandPoolCreateFlags flags_ = CommandPoolCreateFlags(), uint32_t queueFamilyIndex_ = 0 ) - : sType( StructureType::eCommandPoolCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , queueFamilyIndex( queueFamilyIndex_ ) { } @@ -18193,10 +21516,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eCommandPoolCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; CommandPoolCreateFlags flags; uint32_t queueFamilyIndex; }; @@ -18315,9 +21638,7 @@ struct ImageCreateInfo { ImageCreateInfo( ImageCreateFlags flags_ = ImageCreateFlags(), ImageType imageType_ = ImageType::e1D, Format format_ = Format::eUndefined, Extent3D extent_ = Extent3D(), uint32_t mipLevels_ = 0, uint32_t arrayLayers_ = 0, SampleCountFlagBits samples_ = SampleCountFlagBits::e1, ImageTiling tiling_ = ImageTiling::eOptimal, ImageUsageFlags usage_ = ImageUsageFlags(), SharingMode sharingMode_ = SharingMode::eExclusive, uint32_t queueFamilyIndexCount_ = 0, const uint32_t* pQueueFamilyIndices_ = nullptr, ImageLayout initialLayout_ = ImageLayout::eUndefined ) - : sType( StructureType::eImageCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , imageType( imageType_ ) , format( format_ ) , extent( extent_ ) @@ -18457,10 +21778,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eImageCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; ImageCreateFlags flags; ImageType imageType; Format format; @@ -18480,9 +21801,7 @@ struct PipelineMultisampleStateCreateInfo { PipelineMultisampleStateCreateInfo( PipelineMultisampleStateCreateFlags flags_ = PipelineMultisampleStateCreateFlags(), SampleCountFlagBits rasterizationSamples_ = SampleCountFlagBits::e1, Bool32 sampleShadingEnable_ = 0, float minSampleShading_ = 0, const SampleMask* pSampleMask_ = nullptr, Bool32 alphaToCoverageEnable_ = 0, Bool32 alphaToOneEnable_ = 0 ) - : sType( StructureType::ePipelineMultisampleStateCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , rasterizationSamples( rasterizationSamples_ ) , sampleShadingEnable( sampleShadingEnable_ ) , minSampleShading( minSampleShading_ ) @@ -18574,10 +21893,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::ePipelineMultisampleStateCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; PipelineMultisampleStateCreateFlags flags; SampleCountFlagBits rasterizationSamples; Bool32 sampleShadingEnable; @@ -18591,9 +21910,7 @@ struct GraphicsPipelineCreateInfo { GraphicsPipelineCreateInfo( PipelineCreateFlags flags_ = PipelineCreateFlags(), uint32_t stageCount_ = 0, const PipelineShaderStageCreateInfo* pStages_ = nullptr, const PipelineVertexInputStateCreateInfo* pVertexInputState_ = nullptr, const PipelineInputAssemblyStateCreateInfo* pInputAssemblyState_ = nullptr, const PipelineTessellationStateCreateInfo* pTessellationState_ = nullptr, const PipelineViewportStateCreateInfo* pViewportState_ = nullptr, const PipelineRasterizationStateCreateInfo* pRasterizationState_ = nullptr, const PipelineMultisampleStateCreateInfo* pMultisampleState_ = nullptr, const PipelineDepthStencilStateCreateInfo* pDepthStencilState_ = nullptr, const PipelineColorBlendStateCreateInfo* pColorBlendState_ = nullptr, const PipelineDynamicStateCreateInfo* pDynamicState_ = nullptr, PipelineLayout layout_ = PipelineLayout(), RenderPass renderPass_ = RenderPass(), uint32_t subpass_ = 0, Pipeline basePipelineHandle_ = Pipeline(), int32_t basePipelineIndex_ = 0 ) - : sType( StructureType::eGraphicsPipelineCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , stageCount( stageCount_ ) , pStages( pStages_ ) , pVertexInputState( pVertexInputState_ ) @@ -18765,10 +22082,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eGraphicsPipelineCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; PipelineCreateFlags flags; uint32_t stageCount; const PipelineShaderStageCreateInfo* pStages; @@ -19057,68 +22374,70 @@ }; static_assert( sizeof( PhysicalDeviceProperties ) == sizeof( VkPhysicalDeviceProperties ), "struct and wrapper have different size!" ); - struct PhysicalDeviceProperties2KHR + struct PhysicalDeviceProperties2 { - operator const VkPhysicalDeviceProperties2KHR&() const + operator const VkPhysicalDeviceProperties2&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceProperties2KHR const& rhs ) const + bool operator==( PhysicalDeviceProperties2 const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( properties == rhs.properties ); } - bool operator!=( PhysicalDeviceProperties2KHR const& rhs ) const + bool operator!=( PhysicalDeviceProperties2 const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceProperties2; public: - void* pNext; + void* pNext = nullptr; PhysicalDeviceProperties properties; }; - static_assert( sizeof( PhysicalDeviceProperties2KHR ) == sizeof( VkPhysicalDeviceProperties2KHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceProperties2 ) == sizeof( VkPhysicalDeviceProperties2 ), "struct and wrapper have different size!" ); + + using PhysicalDeviceProperties2KHR = PhysicalDeviceProperties2; - struct ImageFormatProperties2KHR + struct ImageFormatProperties2 { - operator const VkImageFormatProperties2KHR&() const + operator const VkImageFormatProperties2&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ImageFormatProperties2KHR const& rhs ) const + bool operator==( ImageFormatProperties2 const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( imageFormatProperties == rhs.imageFormatProperties ); } - bool operator!=( ImageFormatProperties2KHR const& rhs ) const + bool operator!=( ImageFormatProperties2 const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eImageFormatProperties2; public: - void* pNext; + void* pNext = nullptr; ImageFormatProperties imageFormatProperties; }; - static_assert( sizeof( ImageFormatProperties2KHR ) == sizeof( VkImageFormatProperties2KHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( ImageFormatProperties2 ) == sizeof( VkImageFormatProperties2 ), "struct and wrapper have different size!" ); - struct PhysicalDeviceSparseImageFormatInfo2KHR + using ImageFormatProperties2KHR = ImageFormatProperties2; + + struct PhysicalDeviceSparseImageFormatInfo2 { - PhysicalDeviceSparseImageFormatInfo2KHR( Format format_ = Format::eUndefined, ImageType type_ = ImageType::e1D, SampleCountFlagBits samples_ = SampleCountFlagBits::e1, ImageUsageFlags usage_ = ImageUsageFlags(), ImageTiling tiling_ = ImageTiling::eOptimal ) - : sType( StructureType::ePhysicalDeviceSparseImageFormatInfo2KHR ) - , pNext( nullptr ) - , format( format_ ) + PhysicalDeviceSparseImageFormatInfo2( Format format_ = Format::eUndefined, ImageType type_ = ImageType::e1D, SampleCountFlagBits samples_ = SampleCountFlagBits::e1, ImageUsageFlags usage_ = ImageUsageFlags(), ImageTiling tiling_ = ImageTiling::eOptimal ) + : format( format_ ) , type( type_ ) , samples( samples_ ) , usage( usage_ ) @@ -19126,58 +22445,58 @@ { } - PhysicalDeviceSparseImageFormatInfo2KHR( VkPhysicalDeviceSparseImageFormatInfo2KHR const & rhs ) + PhysicalDeviceSparseImageFormatInfo2( VkPhysicalDeviceSparseImageFormatInfo2 const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceSparseImageFormatInfo2KHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceSparseImageFormatInfo2 ) ); } - PhysicalDeviceSparseImageFormatInfo2KHR& operator=( VkPhysicalDeviceSparseImageFormatInfo2KHR const & rhs ) + PhysicalDeviceSparseImageFormatInfo2& operator=( VkPhysicalDeviceSparseImageFormatInfo2 const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceSparseImageFormatInfo2KHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceSparseImageFormatInfo2 ) ); return *this; } - PhysicalDeviceSparseImageFormatInfo2KHR& setPNext( const void* pNext_ ) + PhysicalDeviceSparseImageFormatInfo2& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PhysicalDeviceSparseImageFormatInfo2KHR& setFormat( Format format_ ) + PhysicalDeviceSparseImageFormatInfo2& setFormat( Format format_ ) { format = format_; return *this; } - PhysicalDeviceSparseImageFormatInfo2KHR& setType( ImageType type_ ) + PhysicalDeviceSparseImageFormatInfo2& setType( ImageType type_ ) { type = type_; return *this; } - PhysicalDeviceSparseImageFormatInfo2KHR& setSamples( SampleCountFlagBits samples_ ) + PhysicalDeviceSparseImageFormatInfo2& setSamples( SampleCountFlagBits samples_ ) { samples = samples_; return *this; } - PhysicalDeviceSparseImageFormatInfo2KHR& setUsage( ImageUsageFlags usage_ ) + PhysicalDeviceSparseImageFormatInfo2& setUsage( ImageUsageFlags usage_ ) { usage = usage_; return *this; } - PhysicalDeviceSparseImageFormatInfo2KHR& setTiling( ImageTiling tiling_ ) + PhysicalDeviceSparseImageFormatInfo2& setTiling( ImageTiling tiling_ ) { tiling = tiling_; return *this; } - operator const VkPhysicalDeviceSparseImageFormatInfo2KHR&() const + operator const VkPhysicalDeviceSparseImageFormatInfo2&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceSparseImageFormatInfo2KHR const& rhs ) const + bool operator==( PhysicalDeviceSparseImageFormatInfo2 const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) @@ -19188,30 +22507,30 @@ && ( tiling == rhs.tiling ); } - bool operator!=( PhysicalDeviceSparseImageFormatInfo2KHR const& rhs ) const + bool operator!=( PhysicalDeviceSparseImageFormatInfo2 const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceSparseImageFormatInfo2; public: - const void* pNext; + const void* pNext = nullptr; Format format; ImageType type; SampleCountFlagBits samples; ImageUsageFlags usage; ImageTiling tiling; }; - static_assert( sizeof( PhysicalDeviceSparseImageFormatInfo2KHR ) == sizeof( VkPhysicalDeviceSparseImageFormatInfo2KHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceSparseImageFormatInfo2 ) == sizeof( VkPhysicalDeviceSparseImageFormatInfo2 ), "struct and wrapper have different size!" ); + + using PhysicalDeviceSparseImageFormatInfo2KHR = PhysicalDeviceSparseImageFormatInfo2; struct SampleLocationsInfoEXT { SampleLocationsInfoEXT( SampleCountFlagBits sampleLocationsPerPixel_ = SampleCountFlagBits::e1, Extent2D sampleLocationGridSize_ = Extent2D(), uint32_t sampleLocationsCount_ = 0, const SampleLocationEXT* pSampleLocations_ = nullptr ) - : sType( StructureType::eSampleLocationsInfoEXT ) - , pNext( nullptr ) - , sampleLocationsPerPixel( sampleLocationsPerPixel_ ) + : sampleLocationsPerPixel( sampleLocationsPerPixel_ ) , sampleLocationGridSize( sampleLocationGridSize_ ) , sampleLocationsCount( sampleLocationsCount_ ) , pSampleLocations( pSampleLocations_ ) @@ -19279,10 +22598,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eSampleLocationsInfoEXT; public: - const void* pNext; + const void* pNext = nullptr; SampleCountFlagBits sampleLocationsPerPixel; Extent2D sampleLocationGridSize; uint32_t sampleLocationsCount; @@ -19395,9 +22714,7 @@ struct RenderPassSampleLocationsBeginInfoEXT { RenderPassSampleLocationsBeginInfoEXT( uint32_t attachmentInitialSampleLocationsCount_ = 0, const AttachmentSampleLocationsEXT* pAttachmentInitialSampleLocations_ = nullptr, uint32_t postSubpassSampleLocationsCount_ = 0, const SubpassSampleLocationsEXT* pPostSubpassSampleLocations_ = nullptr ) - : sType( StructureType::eRenderPassSampleLocationsBeginInfoEXT ) - , pNext( nullptr ) - , attachmentInitialSampleLocationsCount( attachmentInitialSampleLocationsCount_ ) + : attachmentInitialSampleLocationsCount( attachmentInitialSampleLocationsCount_ ) , pAttachmentInitialSampleLocations( pAttachmentInitialSampleLocations_ ) , postSubpassSampleLocationsCount( postSubpassSampleLocationsCount_ ) , pPostSubpassSampleLocations( pPostSubpassSampleLocations_ ) @@ -19465,10 +22782,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eRenderPassSampleLocationsBeginInfoEXT; public: - const void* pNext; + const void* pNext = nullptr; uint32_t attachmentInitialSampleLocationsCount; const AttachmentSampleLocationsEXT* pAttachmentInitialSampleLocations; uint32_t postSubpassSampleLocationsCount; @@ -19479,9 +22796,7 @@ struct PipelineSampleLocationsStateCreateInfoEXT { PipelineSampleLocationsStateCreateInfoEXT( Bool32 sampleLocationsEnable_ = 0, SampleLocationsInfoEXT sampleLocationsInfo_ = SampleLocationsInfoEXT() ) - : sType( StructureType::ePipelineSampleLocationsStateCreateInfoEXT ) - , pNext( nullptr ) - , sampleLocationsEnable( sampleLocationsEnable_ ) + : sampleLocationsEnable( sampleLocationsEnable_ ) , sampleLocationsInfo( sampleLocationsInfo_ ) { } @@ -19533,10 +22848,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::ePipelineSampleLocationsStateCreateInfoEXT; public: - const void* pNext; + const void* pNext = nullptr; Bool32 sampleLocationsEnable; SampleLocationsInfoEXT sampleLocationsInfo; }; @@ -19566,10 +22881,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceSampleLocationsPropertiesEXT; public: - void* pNext; + void* pNext = nullptr; SampleCountFlags sampleLocationSampleCounts; Extent2D maxSampleLocationGridSize; float sampleLocationCoordinateRange[2]; @@ -19746,7 +23061,8 @@ enum class DescriptorPoolCreateFlagBits { - eFreeDescriptorSet = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT + eFreeDescriptorSet = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, + eUpdateAfterBindEXT = VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT }; using DescriptorPoolCreateFlags = Flags; @@ -19765,16 +23081,14 @@ { enum { - allFlags = VkFlags(DescriptorPoolCreateFlagBits::eFreeDescriptorSet) + allFlags = VkFlags(DescriptorPoolCreateFlagBits::eFreeDescriptorSet) | VkFlags(DescriptorPoolCreateFlagBits::eUpdateAfterBindEXT) }; }; struct DescriptorPoolCreateInfo { DescriptorPoolCreateInfo( DescriptorPoolCreateFlags flags_ = DescriptorPoolCreateFlags(), uint32_t maxSets_ = 0, uint32_t poolSizeCount_ = 0, const DescriptorPoolSize* pPoolSizes_ = nullptr ) - : sType( StructureType::eDescriptorPoolCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , maxSets( maxSets_ ) , poolSizeCount( poolSizeCount_ ) , pPoolSizes( pPoolSizes_ ) @@ -19842,10 +23156,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eDescriptorPoolCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; DescriptorPoolCreateFlags flags; uint32_t maxSets; uint32_t poolSizeCount; @@ -19856,8 +23170,10 @@ enum class DependencyFlagBits { eByRegion = VK_DEPENDENCY_BY_REGION_BIT, - eViewLocalKHX = VK_DEPENDENCY_VIEW_LOCAL_BIT_KHX, - eDeviceGroupKHX = VK_DEPENDENCY_DEVICE_GROUP_BIT_KHX + eDeviceGroup = VK_DEPENDENCY_DEVICE_GROUP_BIT, + eDeviceGroupKHR = VK_DEPENDENCY_DEVICE_GROUP_BIT, + eViewLocal = VK_DEPENDENCY_VIEW_LOCAL_BIT, + eViewLocalKHR = VK_DEPENDENCY_VIEW_LOCAL_BIT }; using DependencyFlags = Flags; @@ -19876,7 +23192,7 @@ { enum { - allFlags = VkFlags(DependencyFlagBits::eByRegion) | VkFlags(DependencyFlagBits::eViewLocalKHX) | VkFlags(DependencyFlagBits::eDeviceGroupKHX) + allFlags = VkFlags(DependencyFlagBits::eByRegion) | VkFlags(DependencyFlagBits::eDeviceGroup) | VkFlags(DependencyFlagBits::eViewLocal) }; }; @@ -20048,10 +23364,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eSurfaceFormat2KHR; public: - void* pNext; + void* pNext = nullptr; SurfaceFormatKHR surfaceFormat; }; static_assert( sizeof( SurfaceFormat2KHR ) == sizeof( VkSurfaceFormat2KHR ), "struct and wrapper have different size!" ); @@ -20218,9 +23534,7 @@ struct DisplaySurfaceCreateInfoKHR { DisplaySurfaceCreateInfoKHR( DisplaySurfaceCreateFlagsKHR flags_ = DisplaySurfaceCreateFlagsKHR(), DisplayModeKHR displayMode_ = DisplayModeKHR(), uint32_t planeIndex_ = 0, uint32_t planeStackIndex_ = 0, SurfaceTransformFlagBitsKHR transform_ = SurfaceTransformFlagBitsKHR::eIdentity, float globalAlpha_ = 0, DisplayPlaneAlphaFlagBitsKHR alphaMode_ = DisplayPlaneAlphaFlagBitsKHR::eOpaque, Extent2D imageExtent_ = Extent2D() ) - : sType( StructureType::eDisplaySurfaceCreateInfoKHR ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , displayMode( displayMode_ ) , planeIndex( planeIndex_ ) , planeStackIndex( planeStackIndex_ ) @@ -20320,10 +23634,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eDisplaySurfaceCreateInfoKHR; public: - const void* pNext; + const void* pNext = nullptr; DisplaySurfaceCreateFlagsKHR flags; DisplayModeKHR displayMode; uint32_t planeIndex; @@ -20394,10 +23708,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eSurfaceCapabilities2KHR; public: - void* pNext; + void* pNext = nullptr; SurfaceCapabilitiesKHR surfaceCapabilities; }; static_assert( sizeof( SurfaceCapabilities2KHR ) == sizeof( VkSurfaceCapabilities2KHR ), "struct and wrapper have different size!" ); @@ -20434,9 +23748,7 @@ struct DebugReportCallbackCreateInfoEXT { DebugReportCallbackCreateInfoEXT( DebugReportFlagsEXT flags_ = DebugReportFlagsEXT(), PFN_vkDebugReportCallbackEXT pfnCallback_ = nullptr, void* pUserData_ = nullptr ) - : sType( StructureType::eDebugReportCallbackCreateInfoEXT ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , pfnCallback( pfnCallback_ ) , pUserData( pUserData_ ) { @@ -20496,10 +23808,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eDebugReportCallbackCreateInfoEXT; public: - const void* pNext; + const void* pNext = nullptr; DebugReportFlagsEXT flags; PFN_vkDebugReportCallbackEXT pfnCallback; void* pUserData; @@ -20541,17 +23853,17 @@ eDisplayModeKhr = VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT, eObjectTableNvx = VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT, eIndirectCommandsLayoutNvx = VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT, - eValidationCache = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT, - eDescriptorUpdateTemplateKHR = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT, - eSamplerYcbcrConversionKHR = VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR_EXT + eValidationCacheExt = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT, + eSamplerYcbcrConversion = VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT, + eSamplerYcbcrConversionKHR = VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT, + eDescriptorUpdateTemplate = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT, + eDescriptorUpdateTemplateKHR = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT }; struct DebugMarkerObjectNameInfoEXT { DebugMarkerObjectNameInfoEXT( DebugReportObjectTypeEXT objectType_ = DebugReportObjectTypeEXT::eUnknown, uint64_t object_ = 0, const char* pObjectName_ = nullptr ) - : sType( StructureType::eDebugMarkerObjectNameInfoEXT ) - , pNext( nullptr ) - , objectType( objectType_ ) + : objectType( objectType_ ) , object( object_ ) , pObjectName( pObjectName_ ) { @@ -20611,10 +23923,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eDebugMarkerObjectNameInfoEXT; public: - const void* pNext; + const void* pNext = nullptr; DebugReportObjectTypeEXT objectType; uint64_t object; const char* pObjectName; @@ -20624,9 +23936,7 @@ struct DebugMarkerObjectTagInfoEXT { DebugMarkerObjectTagInfoEXT( DebugReportObjectTypeEXT objectType_ = DebugReportObjectTypeEXT::eUnknown, uint64_t object_ = 0, uint64_t tagName_ = 0, size_t tagSize_ = 0, const void* pTag_ = nullptr ) - : sType( StructureType::eDebugMarkerObjectTagInfoEXT ) - , pNext( nullptr ) - , objectType( objectType_ ) + : objectType( objectType_ ) , object( object_ ) , tagName( tagName_ ) , tagSize( tagSize_ ) @@ -20702,10 +24012,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eDebugMarkerObjectTagInfoEXT; public: - const void* pNext; + const void* pNext = nullptr; DebugReportObjectTypeEXT objectType; uint64_t object; uint64_t tagName; @@ -20723,9 +24033,7 @@ struct PipelineRasterizationStateRasterizationOrderAMD { PipelineRasterizationStateRasterizationOrderAMD( RasterizationOrderAMD rasterizationOrder_ = RasterizationOrderAMD::eStrict ) - : sType( StructureType::ePipelineRasterizationStateRasterizationOrderAMD ) - , pNext( nullptr ) - , rasterizationOrder( rasterizationOrder_ ) + : rasterizationOrder( rasterizationOrder_ ) { } @@ -20769,10 +24077,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::ePipelineRasterizationStateRasterizationOrderAMD; public: - const void* pNext; + const void* pNext = nullptr; RasterizationOrderAMD rasterizationOrder; }; static_assert( sizeof( PipelineRasterizationStateRasterizationOrderAMD ) == sizeof( VkPipelineRasterizationStateRasterizationOrderAMD ), "struct and wrapper have different size!" ); @@ -20808,9 +24116,7 @@ struct ExternalMemoryImageCreateInfoNV { ExternalMemoryImageCreateInfoNV( ExternalMemoryHandleTypeFlagsNV handleTypes_ = ExternalMemoryHandleTypeFlagsNV() ) - : sType( StructureType::eExternalMemoryImageCreateInfoNV ) - , pNext( nullptr ) - , handleTypes( handleTypes_ ) + : handleTypes( handleTypes_ ) { } @@ -20854,10 +24160,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eExternalMemoryImageCreateInfoNV; public: - const void* pNext; + const void* pNext = nullptr; ExternalMemoryHandleTypeFlagsNV handleTypes; }; static_assert( sizeof( ExternalMemoryImageCreateInfoNV ) == sizeof( VkExternalMemoryImageCreateInfoNV ), "struct and wrapper have different size!" ); @@ -20865,9 +24171,7 @@ struct ExportMemoryAllocateInfoNV { ExportMemoryAllocateInfoNV( ExternalMemoryHandleTypeFlagsNV handleTypes_ = ExternalMemoryHandleTypeFlagsNV() ) - : sType( StructureType::eExportMemoryAllocateInfoNV ) - , pNext( nullptr ) - , handleTypes( handleTypes_ ) + : handleTypes( handleTypes_ ) { } @@ -20911,21 +24215,19 @@ } private: - StructureType sType; + StructureType sType = StructureType::eExportMemoryAllocateInfoNV; public: - const void* pNext; + const void* pNext = nullptr; ExternalMemoryHandleTypeFlagsNV handleTypes; }; static_assert( sizeof( ExportMemoryAllocateInfoNV ) == sizeof( VkExportMemoryAllocateInfoNV ), "struct and wrapper have different size!" ); -#ifdef VK_USE_PLATFORM_WIN32_KHR +#ifdef VK_USE_PLATFORM_WIN32_NV struct ImportMemoryWin32HandleInfoNV { ImportMemoryWin32HandleInfoNV( ExternalMemoryHandleTypeFlagsNV handleType_ = ExternalMemoryHandleTypeFlagsNV(), HANDLE handle_ = 0 ) - : sType( StructureType::eImportMemoryWin32HandleInfoNV ) - , pNext( nullptr ) - , handleType( handleType_ ) + : handleType( handleType_ ) , handle( handle_ ) { } @@ -20977,15 +24279,15 @@ } private: - StructureType sType; + StructureType sType = StructureType::eImportMemoryWin32HandleInfoNV; public: - const void* pNext; + const void* pNext = nullptr; ExternalMemoryHandleTypeFlagsNV handleType; HANDLE handle; }; static_assert( sizeof( ImportMemoryWin32HandleInfoNV ) == sizeof( VkImportMemoryWin32HandleInfoNV ), "struct and wrapper have different size!" ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ +#endif /*VK_USE_PLATFORM_WIN32_NV*/ enum class ExternalMemoryFeatureFlagBitsNV { @@ -21050,9 +24352,7 @@ struct ValidationFlagsEXT { ValidationFlagsEXT( uint32_t disabledValidationCheckCount_ = 0, ValidationCheckEXT* pDisabledValidationChecks_ = nullptr ) - : sType( StructureType::eValidationFlagsEXT ) - , pNext( nullptr ) - , disabledValidationCheckCount( disabledValidationCheckCount_ ) + : disabledValidationCheckCount( disabledValidationCheckCount_ ) , pDisabledValidationChecks( pDisabledValidationChecks_ ) { } @@ -21104,15 +24404,82 @@ } private: - StructureType sType; + StructureType sType = StructureType::eValidationFlagsEXT; public: - const void* pNext; + const void* pNext = nullptr; uint32_t disabledValidationCheckCount; ValidationCheckEXT* pDisabledValidationChecks; }; static_assert( sizeof( ValidationFlagsEXT ) == sizeof( VkValidationFlagsEXT ), "struct and wrapper have different size!" ); + enum class SubgroupFeatureFlagBits + { + 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 + }; + + using SubgroupFeatureFlags = Flags; + + VULKAN_HPP_INLINE SubgroupFeatureFlags operator|( SubgroupFeatureFlagBits bit0, SubgroupFeatureFlagBits bit1 ) + { + return SubgroupFeatureFlags( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE SubgroupFeatureFlags operator~( SubgroupFeatureFlagBits bits ) + { + return ~( SubgroupFeatureFlags( bits ) ); + } + + template <> struct FlagTraits + { + enum + { + 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) + }; + }; + + struct PhysicalDeviceSubgroupProperties + { + operator const VkPhysicalDeviceSubgroupProperties&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PhysicalDeviceSubgroupProperties const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( subgroupSize == rhs.subgroupSize ) + && ( supportedStages == rhs.supportedStages ) + && ( supportedOperations == rhs.supportedOperations ) + && ( quadOperationsInAllStages == rhs.quadOperationsInAllStages ); + } + + bool operator!=( PhysicalDeviceSubgroupProperties const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType = StructureType::ePhysicalDeviceSubgroupProperties; + + public: + void* pNext = nullptr; + uint32_t subgroupSize; + ShaderStageFlags supportedStages; + SubgroupFeatureFlags supportedOperations; + Bool32 quadOperationsInAllStages; + }; + static_assert( sizeof( PhysicalDeviceSubgroupProperties ) == sizeof( VkPhysicalDeviceSubgroupProperties ), "struct and wrapper have different size!" ); + enum class IndirectCommandsLayoutUsageFlagBitsNVX { eUnorderedSequences = VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX, @@ -21311,9 +24678,7 @@ struct IndirectCommandsLayoutCreateInfoNVX { IndirectCommandsLayoutCreateInfoNVX( PipelineBindPoint pipelineBindPoint_ = PipelineBindPoint::eGraphics, IndirectCommandsLayoutUsageFlagsNVX flags_ = IndirectCommandsLayoutUsageFlagsNVX(), uint32_t tokenCount_ = 0, const IndirectCommandsLayoutTokenNVX* pTokens_ = nullptr ) - : sType( StructureType::eIndirectCommandsLayoutCreateInfoNVX ) - , pNext( nullptr ) - , pipelineBindPoint( pipelineBindPoint_ ) + : pipelineBindPoint( pipelineBindPoint_ ) , flags( flags_ ) , tokenCount( tokenCount_ ) , pTokens( pTokens_ ) @@ -21381,10 +24746,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eIndirectCommandsLayoutCreateInfoNVX; public: - const void* pNext; + const void* pNext = nullptr; PipelineBindPoint pipelineBindPoint; IndirectCommandsLayoutUsageFlagsNVX flags; uint32_t tokenCount; @@ -21404,9 +24769,7 @@ struct ObjectTableCreateInfoNVX { ObjectTableCreateInfoNVX( uint32_t objectCount_ = 0, const ObjectEntryTypeNVX* pObjectEntryTypes_ = nullptr, const uint32_t* pObjectEntryCounts_ = nullptr, const ObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags_ = nullptr, uint32_t maxUniformBuffersPerDescriptor_ = 0, uint32_t maxStorageBuffersPerDescriptor_ = 0, uint32_t maxStorageImagesPerDescriptor_ = 0, uint32_t maxSampledImagesPerDescriptor_ = 0, uint32_t maxPipelineLayouts_ = 0 ) - : sType( StructureType::eObjectTableCreateInfoNVX ) - , pNext( nullptr ) - , objectCount( objectCount_ ) + : objectCount( objectCount_ ) , pObjectEntryTypes( pObjectEntryTypes_ ) , pObjectEntryCounts( pObjectEntryCounts_ ) , pObjectEntryUsageFlags( pObjectEntryUsageFlags_ ) @@ -21514,10 +24877,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eObjectTableCreateInfoNVX; public: - const void* pNext; + const void* pNext = nullptr; uint32_t objectCount; const ObjectEntryTypeNVX* pObjectEntryTypes; const uint32_t* pObjectEntryCounts; @@ -21910,7 +25273,8 @@ enum class DescriptorSetLayoutCreateFlagBits { - ePushDescriptorKHR = VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR + ePushDescriptorKHR = VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, + eUpdateAfterBindPoolEXT = VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT }; using DescriptorSetLayoutCreateFlags = Flags; @@ -21929,16 +25293,14 @@ { enum { - allFlags = VkFlags(DescriptorSetLayoutCreateFlagBits::ePushDescriptorKHR) + allFlags = VkFlags(DescriptorSetLayoutCreateFlagBits::ePushDescriptorKHR) | VkFlags(DescriptorSetLayoutCreateFlagBits::eUpdateAfterBindPoolEXT) }; }; struct DescriptorSetLayoutCreateInfo { DescriptorSetLayoutCreateInfo( DescriptorSetLayoutCreateFlags flags_ = DescriptorSetLayoutCreateFlags(), uint32_t bindingCount_ = 0, const DescriptorSetLayoutBinding* pBindings_ = nullptr ) - : sType( StructureType::eDescriptorSetLayoutCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , bindingCount( bindingCount_ ) , pBindings( pBindings_ ) { @@ -21998,155 +25360,166 @@ } private: - StructureType sType; + StructureType sType = StructureType::eDescriptorSetLayoutCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; DescriptorSetLayoutCreateFlags flags; uint32_t bindingCount; const DescriptorSetLayoutBinding* pBindings; }; static_assert( sizeof( DescriptorSetLayoutCreateInfo ) == sizeof( VkDescriptorSetLayoutCreateInfo ), "struct and wrapper have different size!" ); - enum class ExternalMemoryHandleTypeFlagBitsKHR + enum class ExternalMemoryHandleTypeFlagBits { - eOpaqueFd = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR, - eOpaqueWin32 = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR, - eOpaqueWin32Kmt = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR, - eD3D11Texture = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR, - eD3D11TextureKmt = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR, - eD3D12Heap = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR, - eD3D12Resource = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR + eOpaqueFd = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT, + eOpaqueFdKHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT, + eOpaqueWin32 = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, + eOpaqueWin32KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, + eOpaqueWin32Kmt = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, + eOpaqueWin32KmtKHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, + eD3D11Texture = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, + eD3D11TextureKHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, + eD3D11TextureKmt = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, + eD3D11TextureKmtKHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, + eD3D12Heap = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, + eD3D12HeapKHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, + eD3D12Resource = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, + eD3D12ResourceKHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, + eDmaBufEXT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT, + eAndroidHardwareBufferANDROID = VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID, + eHostAllocationEXT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT, + eHostMappedForeignMemoryEXT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT }; - using ExternalMemoryHandleTypeFlagsKHR = Flags; + using ExternalMemoryHandleTypeFlags = Flags; - VULKAN_HPP_INLINE ExternalMemoryHandleTypeFlagsKHR operator|( ExternalMemoryHandleTypeFlagBitsKHR bit0, ExternalMemoryHandleTypeFlagBitsKHR bit1 ) + VULKAN_HPP_INLINE ExternalMemoryHandleTypeFlags operator|( ExternalMemoryHandleTypeFlagBits bit0, ExternalMemoryHandleTypeFlagBits bit1 ) { - return ExternalMemoryHandleTypeFlagsKHR( bit0 ) | bit1; + return ExternalMemoryHandleTypeFlags( bit0 ) | bit1; } - VULKAN_HPP_INLINE ExternalMemoryHandleTypeFlagsKHR operator~( ExternalMemoryHandleTypeFlagBitsKHR bits ) + VULKAN_HPP_INLINE ExternalMemoryHandleTypeFlags operator~( ExternalMemoryHandleTypeFlagBits bits ) { - return ~( ExternalMemoryHandleTypeFlagsKHR( bits ) ); + return ~( ExternalMemoryHandleTypeFlags( bits ) ); } - template <> struct FlagTraits + template <> struct FlagTraits { enum { - allFlags = VkFlags(ExternalMemoryHandleTypeFlagBitsKHR::eOpaqueFd) | VkFlags(ExternalMemoryHandleTypeFlagBitsKHR::eOpaqueWin32) | VkFlags(ExternalMemoryHandleTypeFlagBitsKHR::eOpaqueWin32Kmt) | VkFlags(ExternalMemoryHandleTypeFlagBitsKHR::eD3D11Texture) | VkFlags(ExternalMemoryHandleTypeFlagBitsKHR::eD3D11TextureKmt) | VkFlags(ExternalMemoryHandleTypeFlagBitsKHR::eD3D12Heap) | VkFlags(ExternalMemoryHandleTypeFlagBitsKHR::eD3D12Resource) + 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) | VkFlags(ExternalMemoryHandleTypeFlagBits::eAndroidHardwareBufferANDROID) | VkFlags(ExternalMemoryHandleTypeFlagBits::eHostAllocationEXT) | VkFlags(ExternalMemoryHandleTypeFlagBits::eHostMappedForeignMemoryEXT) }; }; - struct PhysicalDeviceExternalImageFormatInfoKHR + using ExternalMemoryHandleTypeFlagsKHR = ExternalMemoryHandleTypeFlags; + + struct PhysicalDeviceExternalImageFormatInfo { - PhysicalDeviceExternalImageFormatInfoKHR( ExternalMemoryHandleTypeFlagBitsKHR handleType_ = ExternalMemoryHandleTypeFlagBitsKHR::eOpaqueFd ) - : sType( StructureType::ePhysicalDeviceExternalImageFormatInfoKHR ) - , pNext( nullptr ) - , handleType( handleType_ ) + PhysicalDeviceExternalImageFormatInfo( ExternalMemoryHandleTypeFlagBits handleType_ = ExternalMemoryHandleTypeFlagBits::eOpaqueFd ) + : handleType( handleType_ ) { } - PhysicalDeviceExternalImageFormatInfoKHR( VkPhysicalDeviceExternalImageFormatInfoKHR const & rhs ) + PhysicalDeviceExternalImageFormatInfo( VkPhysicalDeviceExternalImageFormatInfo const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceExternalImageFormatInfoKHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceExternalImageFormatInfo ) ); } - PhysicalDeviceExternalImageFormatInfoKHR& operator=( VkPhysicalDeviceExternalImageFormatInfoKHR const & rhs ) + PhysicalDeviceExternalImageFormatInfo& operator=( VkPhysicalDeviceExternalImageFormatInfo const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceExternalImageFormatInfoKHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceExternalImageFormatInfo ) ); return *this; } - PhysicalDeviceExternalImageFormatInfoKHR& setPNext( const void* pNext_ ) + PhysicalDeviceExternalImageFormatInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PhysicalDeviceExternalImageFormatInfoKHR& setHandleType( ExternalMemoryHandleTypeFlagBitsKHR handleType_ ) + PhysicalDeviceExternalImageFormatInfo& setHandleType( ExternalMemoryHandleTypeFlagBits handleType_ ) { handleType = handleType_; return *this; } - operator const VkPhysicalDeviceExternalImageFormatInfoKHR&() const + operator const VkPhysicalDeviceExternalImageFormatInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceExternalImageFormatInfoKHR const& rhs ) const + bool operator==( PhysicalDeviceExternalImageFormatInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleType == rhs.handleType ); } - bool operator!=( PhysicalDeviceExternalImageFormatInfoKHR const& rhs ) const + bool operator!=( PhysicalDeviceExternalImageFormatInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceExternalImageFormatInfo; public: - const void* pNext; - ExternalMemoryHandleTypeFlagBitsKHR handleType; + const void* pNext = nullptr; + ExternalMemoryHandleTypeFlagBits handleType; }; - static_assert( sizeof( PhysicalDeviceExternalImageFormatInfoKHR ) == sizeof( VkPhysicalDeviceExternalImageFormatInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceExternalImageFormatInfo ) == sizeof( VkPhysicalDeviceExternalImageFormatInfo ), "struct and wrapper have different size!" ); - struct PhysicalDeviceExternalBufferInfoKHR + using PhysicalDeviceExternalImageFormatInfoKHR = PhysicalDeviceExternalImageFormatInfo; + + struct PhysicalDeviceExternalBufferInfo { - PhysicalDeviceExternalBufferInfoKHR( BufferCreateFlags flags_ = BufferCreateFlags(), BufferUsageFlags usage_ = BufferUsageFlags(), ExternalMemoryHandleTypeFlagBitsKHR handleType_ = ExternalMemoryHandleTypeFlagBitsKHR::eOpaqueFd ) - : sType( StructureType::ePhysicalDeviceExternalBufferInfoKHR ) - , pNext( nullptr ) - , flags( flags_ ) + PhysicalDeviceExternalBufferInfo( BufferCreateFlags flags_ = BufferCreateFlags(), BufferUsageFlags usage_ = BufferUsageFlags(), ExternalMemoryHandleTypeFlagBits handleType_ = ExternalMemoryHandleTypeFlagBits::eOpaqueFd ) + : flags( flags_ ) , usage( usage_ ) , handleType( handleType_ ) { } - PhysicalDeviceExternalBufferInfoKHR( VkPhysicalDeviceExternalBufferInfoKHR const & rhs ) + PhysicalDeviceExternalBufferInfo( VkPhysicalDeviceExternalBufferInfo const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceExternalBufferInfoKHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceExternalBufferInfo ) ); } - PhysicalDeviceExternalBufferInfoKHR& operator=( VkPhysicalDeviceExternalBufferInfoKHR const & rhs ) + PhysicalDeviceExternalBufferInfo& operator=( VkPhysicalDeviceExternalBufferInfo const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceExternalBufferInfoKHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceExternalBufferInfo ) ); return *this; } - PhysicalDeviceExternalBufferInfoKHR& setPNext( const void* pNext_ ) + PhysicalDeviceExternalBufferInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PhysicalDeviceExternalBufferInfoKHR& setFlags( BufferCreateFlags flags_ ) + PhysicalDeviceExternalBufferInfo& setFlags( BufferCreateFlags flags_ ) { flags = flags_; return *this; } - PhysicalDeviceExternalBufferInfoKHR& setUsage( BufferUsageFlags usage_ ) + PhysicalDeviceExternalBufferInfo& setUsage( BufferUsageFlags usage_ ) { usage = usage_; return *this; } - PhysicalDeviceExternalBufferInfoKHR& setHandleType( ExternalMemoryHandleTypeFlagBitsKHR handleType_ ) + PhysicalDeviceExternalBufferInfo& setHandleType( ExternalMemoryHandleTypeFlagBits handleType_ ) { handleType = handleType_; return *this; } - operator const VkPhysicalDeviceExternalBufferInfoKHR&() const + operator const VkPhysicalDeviceExternalBufferInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceExternalBufferInfoKHR const& rhs ) const + bool operator==( PhysicalDeviceExternalBufferInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) @@ -22155,200 +25528,200 @@ && ( handleType == rhs.handleType ); } - bool operator!=( PhysicalDeviceExternalBufferInfoKHR const& rhs ) const + bool operator!=( PhysicalDeviceExternalBufferInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceExternalBufferInfo; public: - const void* pNext; + const void* pNext = nullptr; BufferCreateFlags flags; BufferUsageFlags usage; - ExternalMemoryHandleTypeFlagBitsKHR handleType; + ExternalMemoryHandleTypeFlagBits handleType; }; - static_assert( sizeof( PhysicalDeviceExternalBufferInfoKHR ) == sizeof( VkPhysicalDeviceExternalBufferInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceExternalBufferInfo ) == sizeof( VkPhysicalDeviceExternalBufferInfo ), "struct and wrapper have different size!" ); + + using PhysicalDeviceExternalBufferInfoKHR = PhysicalDeviceExternalBufferInfo; - struct ExternalMemoryImageCreateInfoKHR + struct ExternalMemoryImageCreateInfo { - ExternalMemoryImageCreateInfoKHR( ExternalMemoryHandleTypeFlagsKHR handleTypes_ = ExternalMemoryHandleTypeFlagsKHR() ) - : sType( StructureType::eExternalMemoryImageCreateInfoKHR ) - , pNext( nullptr ) - , handleTypes( handleTypes_ ) + ExternalMemoryImageCreateInfo( ExternalMemoryHandleTypeFlags handleTypes_ = ExternalMemoryHandleTypeFlags() ) + : handleTypes( handleTypes_ ) { } - ExternalMemoryImageCreateInfoKHR( VkExternalMemoryImageCreateInfoKHR const & rhs ) + ExternalMemoryImageCreateInfo( VkExternalMemoryImageCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ExternalMemoryImageCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( ExternalMemoryImageCreateInfo ) ); } - ExternalMemoryImageCreateInfoKHR& operator=( VkExternalMemoryImageCreateInfoKHR const & rhs ) + ExternalMemoryImageCreateInfo& operator=( VkExternalMemoryImageCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ExternalMemoryImageCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( ExternalMemoryImageCreateInfo ) ); return *this; } - ExternalMemoryImageCreateInfoKHR& setPNext( const void* pNext_ ) + ExternalMemoryImageCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - ExternalMemoryImageCreateInfoKHR& setHandleTypes( ExternalMemoryHandleTypeFlagsKHR handleTypes_ ) + ExternalMemoryImageCreateInfo& setHandleTypes( ExternalMemoryHandleTypeFlags handleTypes_ ) { handleTypes = handleTypes_; return *this; } - operator const VkExternalMemoryImageCreateInfoKHR&() const + operator const VkExternalMemoryImageCreateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ExternalMemoryImageCreateInfoKHR const& rhs ) const + bool operator==( ExternalMemoryImageCreateInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleTypes == rhs.handleTypes ); } - bool operator!=( ExternalMemoryImageCreateInfoKHR const& rhs ) const + bool operator!=( ExternalMemoryImageCreateInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eExternalMemoryImageCreateInfo; public: - const void* pNext; - ExternalMemoryHandleTypeFlagsKHR handleTypes; + const void* pNext = nullptr; + ExternalMemoryHandleTypeFlags handleTypes; }; - static_assert( sizeof( ExternalMemoryImageCreateInfoKHR ) == sizeof( VkExternalMemoryImageCreateInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( ExternalMemoryImageCreateInfo ) == sizeof( VkExternalMemoryImageCreateInfo ), "struct and wrapper have different size!" ); - struct ExternalMemoryBufferCreateInfoKHR + using ExternalMemoryImageCreateInfoKHR = ExternalMemoryImageCreateInfo; + + struct ExternalMemoryBufferCreateInfo { - ExternalMemoryBufferCreateInfoKHR( ExternalMemoryHandleTypeFlagsKHR handleTypes_ = ExternalMemoryHandleTypeFlagsKHR() ) - : sType( StructureType::eExternalMemoryBufferCreateInfoKHR ) - , pNext( nullptr ) - , handleTypes( handleTypes_ ) + ExternalMemoryBufferCreateInfo( ExternalMemoryHandleTypeFlags handleTypes_ = ExternalMemoryHandleTypeFlags() ) + : handleTypes( handleTypes_ ) { } - ExternalMemoryBufferCreateInfoKHR( VkExternalMemoryBufferCreateInfoKHR const & rhs ) + ExternalMemoryBufferCreateInfo( VkExternalMemoryBufferCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ExternalMemoryBufferCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( ExternalMemoryBufferCreateInfo ) ); } - ExternalMemoryBufferCreateInfoKHR& operator=( VkExternalMemoryBufferCreateInfoKHR const & rhs ) + ExternalMemoryBufferCreateInfo& operator=( VkExternalMemoryBufferCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ExternalMemoryBufferCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( ExternalMemoryBufferCreateInfo ) ); return *this; } - ExternalMemoryBufferCreateInfoKHR& setPNext( const void* pNext_ ) + ExternalMemoryBufferCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - ExternalMemoryBufferCreateInfoKHR& setHandleTypes( ExternalMemoryHandleTypeFlagsKHR handleTypes_ ) + ExternalMemoryBufferCreateInfo& setHandleTypes( ExternalMemoryHandleTypeFlags handleTypes_ ) { handleTypes = handleTypes_; return *this; } - operator const VkExternalMemoryBufferCreateInfoKHR&() const + operator const VkExternalMemoryBufferCreateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ExternalMemoryBufferCreateInfoKHR const& rhs ) const + bool operator==( ExternalMemoryBufferCreateInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleTypes == rhs.handleTypes ); } - bool operator!=( ExternalMemoryBufferCreateInfoKHR const& rhs ) const + bool operator!=( ExternalMemoryBufferCreateInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eExternalMemoryBufferCreateInfo; public: - const void* pNext; - ExternalMemoryHandleTypeFlagsKHR handleTypes; + const void* pNext = nullptr; + ExternalMemoryHandleTypeFlags handleTypes; }; - static_assert( sizeof( ExternalMemoryBufferCreateInfoKHR ) == sizeof( VkExternalMemoryBufferCreateInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( ExternalMemoryBufferCreateInfo ) == sizeof( VkExternalMemoryBufferCreateInfo ), "struct and wrapper have different size!" ); + + using ExternalMemoryBufferCreateInfoKHR = ExternalMemoryBufferCreateInfo; - struct ExportMemoryAllocateInfoKHR + struct ExportMemoryAllocateInfo { - ExportMemoryAllocateInfoKHR( ExternalMemoryHandleTypeFlagsKHR handleTypes_ = ExternalMemoryHandleTypeFlagsKHR() ) - : sType( StructureType::eExportMemoryAllocateInfoKHR ) - , pNext( nullptr ) - , handleTypes( handleTypes_ ) + ExportMemoryAllocateInfo( ExternalMemoryHandleTypeFlags handleTypes_ = ExternalMemoryHandleTypeFlags() ) + : handleTypes( handleTypes_ ) { } - ExportMemoryAllocateInfoKHR( VkExportMemoryAllocateInfoKHR const & rhs ) + ExportMemoryAllocateInfo( VkExportMemoryAllocateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ExportMemoryAllocateInfoKHR ) ); + memcpy( this, &rhs, sizeof( ExportMemoryAllocateInfo ) ); } - ExportMemoryAllocateInfoKHR& operator=( VkExportMemoryAllocateInfoKHR const & rhs ) + ExportMemoryAllocateInfo& operator=( VkExportMemoryAllocateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ExportMemoryAllocateInfoKHR ) ); + memcpy( this, &rhs, sizeof( ExportMemoryAllocateInfo ) ); return *this; } - ExportMemoryAllocateInfoKHR& setPNext( const void* pNext_ ) + ExportMemoryAllocateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - ExportMemoryAllocateInfoKHR& setHandleTypes( ExternalMemoryHandleTypeFlagsKHR handleTypes_ ) + ExportMemoryAllocateInfo& setHandleTypes( ExternalMemoryHandleTypeFlags handleTypes_ ) { handleTypes = handleTypes_; return *this; } - operator const VkExportMemoryAllocateInfoKHR&() const + operator const VkExportMemoryAllocateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ExportMemoryAllocateInfoKHR const& rhs ) const + bool operator==( ExportMemoryAllocateInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleTypes == rhs.handleTypes ); } - bool operator!=( ExportMemoryAllocateInfoKHR const& rhs ) const + bool operator!=( ExportMemoryAllocateInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eExportMemoryAllocateInfo; public: - const void* pNext; - ExternalMemoryHandleTypeFlagsKHR handleTypes; + const void* pNext = nullptr; + ExternalMemoryHandleTypeFlags handleTypes; }; - static_assert( sizeof( ExportMemoryAllocateInfoKHR ) == sizeof( VkExportMemoryAllocateInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( ExportMemoryAllocateInfo ) == sizeof( VkExportMemoryAllocateInfo ), "struct and wrapper have different size!" ); + + using ExportMemoryAllocateInfoKHR = ExportMemoryAllocateInfo; #ifdef VK_USE_PLATFORM_WIN32_KHR struct ImportMemoryWin32HandleInfoKHR { - ImportMemoryWin32HandleInfoKHR( ExternalMemoryHandleTypeFlagBitsKHR handleType_ = ExternalMemoryHandleTypeFlagBitsKHR::eOpaqueFd, HANDLE handle_ = 0, LPCWSTR name_ = 0 ) - : sType( StructureType::eImportMemoryWin32HandleInfoKHR ) - , pNext( nullptr ) - , handleType( handleType_ ) + ImportMemoryWin32HandleInfoKHR( ExternalMemoryHandleTypeFlagBits handleType_ = ExternalMemoryHandleTypeFlagBits::eOpaqueFd, HANDLE handle_ = 0, LPCWSTR name_ = 0 ) + : handleType( handleType_ ) , handle( handle_ ) , name( name_ ) { @@ -22370,7 +25743,7 @@ return *this; } - ImportMemoryWin32HandleInfoKHR& setHandleType( ExternalMemoryHandleTypeFlagBitsKHR handleType_ ) + ImportMemoryWin32HandleInfoKHR& setHandleType( ExternalMemoryHandleTypeFlagBits handleType_ ) { handleType = handleType_; return *this; @@ -22408,11 +25781,11 @@ } private: - StructureType sType; + StructureType sType = StructureType::eImportMemoryWin32HandleInfoKHR; public: - const void* pNext; - ExternalMemoryHandleTypeFlagBitsKHR handleType; + const void* pNext = nullptr; + ExternalMemoryHandleTypeFlagBits handleType; HANDLE handle; LPCWSTR name; }; @@ -22422,10 +25795,8 @@ #ifdef VK_USE_PLATFORM_WIN32_KHR struct MemoryGetWin32HandleInfoKHR { - MemoryGetWin32HandleInfoKHR( DeviceMemory memory_ = DeviceMemory(), ExternalMemoryHandleTypeFlagBitsKHR handleType_ = ExternalMemoryHandleTypeFlagBitsKHR::eOpaqueFd ) - : sType( StructureType::eMemoryGetWin32HandleInfoKHR ) - , pNext( nullptr ) - , memory( memory_ ) + MemoryGetWin32HandleInfoKHR( DeviceMemory memory_ = DeviceMemory(), ExternalMemoryHandleTypeFlagBits handleType_ = ExternalMemoryHandleTypeFlagBits::eOpaqueFd ) + : memory( memory_ ) , handleType( handleType_ ) { } @@ -22452,7 +25823,7 @@ return *this; } - MemoryGetWin32HandleInfoKHR& setHandleType( ExternalMemoryHandleTypeFlagBitsKHR handleType_ ) + MemoryGetWin32HandleInfoKHR& setHandleType( ExternalMemoryHandleTypeFlagBits handleType_ ) { handleType = handleType_; return *this; @@ -22477,22 +25848,20 @@ } private: - StructureType sType; + StructureType sType = StructureType::eMemoryGetWin32HandleInfoKHR; public: - const void* pNext; + const void* pNext = nullptr; DeviceMemory memory; - ExternalMemoryHandleTypeFlagBitsKHR handleType; + ExternalMemoryHandleTypeFlagBits handleType; }; static_assert( sizeof( MemoryGetWin32HandleInfoKHR ) == sizeof( VkMemoryGetWin32HandleInfoKHR ), "struct and wrapper have different size!" ); #endif /*VK_USE_PLATFORM_WIN32_KHR*/ struct ImportMemoryFdInfoKHR { - ImportMemoryFdInfoKHR( ExternalMemoryHandleTypeFlagBitsKHR handleType_ = ExternalMemoryHandleTypeFlagBitsKHR::eOpaqueFd, int fd_ = 0 ) - : sType( StructureType::eImportMemoryFdInfoKHR ) - , pNext( nullptr ) - , handleType( handleType_ ) + ImportMemoryFdInfoKHR( ExternalMemoryHandleTypeFlagBits handleType_ = ExternalMemoryHandleTypeFlagBits::eOpaqueFd, int fd_ = 0 ) + : handleType( handleType_ ) , fd( fd_ ) { } @@ -22513,7 +25882,7 @@ return *this; } - ImportMemoryFdInfoKHR& setHandleType( ExternalMemoryHandleTypeFlagBitsKHR handleType_ ) + ImportMemoryFdInfoKHR& setHandleType( ExternalMemoryHandleTypeFlagBits handleType_ ) { handleType = handleType_; return *this; @@ -22544,21 +25913,19 @@ } private: - StructureType sType; + StructureType sType = StructureType::eImportMemoryFdInfoKHR; public: - const void* pNext; - ExternalMemoryHandleTypeFlagBitsKHR handleType; + const void* pNext = nullptr; + ExternalMemoryHandleTypeFlagBits handleType; int fd; }; static_assert( sizeof( ImportMemoryFdInfoKHR ) == sizeof( VkImportMemoryFdInfoKHR ), "struct and wrapper have different size!" ); struct MemoryGetFdInfoKHR { - MemoryGetFdInfoKHR( DeviceMemory memory_ = DeviceMemory(), ExternalMemoryHandleTypeFlagBitsKHR handleType_ = ExternalMemoryHandleTypeFlagBitsKHR::eOpaqueFd ) - : sType( StructureType::eMemoryGetFdInfoKHR ) - , pNext( nullptr ) - , memory( memory_ ) + MemoryGetFdInfoKHR( DeviceMemory memory_ = DeviceMemory(), ExternalMemoryHandleTypeFlagBits handleType_ = ExternalMemoryHandleTypeFlagBits::eOpaqueFd ) + : memory( memory_ ) , handleType( handleType_ ) { } @@ -22585,7 +25952,7 @@ return *this; } - MemoryGetFdInfoKHR& setHandleType( ExternalMemoryHandleTypeFlagBitsKHR handleType_ ) + MemoryGetFdInfoKHR& setHandleType( ExternalMemoryHandleTypeFlagBits handleType_ ) { handleType = handleType_; return *this; @@ -22610,273 +25977,353 @@ } private: - StructureType sType; + StructureType sType = StructureType::eMemoryGetFdInfoKHR; public: - const void* pNext; + const void* pNext = nullptr; DeviceMemory memory; - ExternalMemoryHandleTypeFlagBitsKHR handleType; + ExternalMemoryHandleTypeFlagBits handleType; }; static_assert( sizeof( MemoryGetFdInfoKHR ) == sizeof( VkMemoryGetFdInfoKHR ), "struct and wrapper have different size!" ); - enum class ExternalMemoryFeatureFlagBitsKHR + struct ImportMemoryHostPointerInfoEXT + { + ImportMemoryHostPointerInfoEXT( ExternalMemoryHandleTypeFlagBits handleType_ = ExternalMemoryHandleTypeFlagBits::eOpaqueFd, void* pHostPointer_ = nullptr ) + : handleType( handleType_ ) + , pHostPointer( pHostPointer_ ) + { + } + + ImportMemoryHostPointerInfoEXT( VkImportMemoryHostPointerInfoEXT const & rhs ) + { + memcpy( this, &rhs, sizeof( ImportMemoryHostPointerInfoEXT ) ); + } + + ImportMemoryHostPointerInfoEXT& operator=( VkImportMemoryHostPointerInfoEXT const & rhs ) + { + memcpy( this, &rhs, sizeof( ImportMemoryHostPointerInfoEXT ) ); + return *this; + } + ImportMemoryHostPointerInfoEXT& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ImportMemoryHostPointerInfoEXT& setHandleType( ExternalMemoryHandleTypeFlagBits handleType_ ) + { + handleType = handleType_; + return *this; + } + + ImportMemoryHostPointerInfoEXT& setPHostPointer( void* pHostPointer_ ) + { + pHostPointer = pHostPointer_; + return *this; + } + + operator const VkImportMemoryHostPointerInfoEXT&() const + { + return *reinterpret_cast(this); + } + + bool operator==( ImportMemoryHostPointerInfoEXT const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( handleType == rhs.handleType ) + && ( pHostPointer == rhs.pHostPointer ); + } + + bool operator!=( ImportMemoryHostPointerInfoEXT const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType = StructureType::eImportMemoryHostPointerInfoEXT; + + public: + const void* pNext = nullptr; + ExternalMemoryHandleTypeFlagBits handleType; + void* pHostPointer; + }; + static_assert( sizeof( ImportMemoryHostPointerInfoEXT ) == sizeof( VkImportMemoryHostPointerInfoEXT ), "struct and wrapper have different size!" ); + + enum class ExternalMemoryFeatureFlagBits { - eDedicatedOnly = VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHR, - eExportable = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHR, - eImportable = VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR + eDedicatedOnly = VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT, + eDedicatedOnlyKHR = VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT, + eExportable = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT, + eExportableKHR = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT, + eImportable = VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT, + eImportableKHR = VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT }; - using ExternalMemoryFeatureFlagsKHR = Flags; + using ExternalMemoryFeatureFlags = Flags; - VULKAN_HPP_INLINE ExternalMemoryFeatureFlagsKHR operator|( ExternalMemoryFeatureFlagBitsKHR bit0, ExternalMemoryFeatureFlagBitsKHR bit1 ) + VULKAN_HPP_INLINE ExternalMemoryFeatureFlags operator|( ExternalMemoryFeatureFlagBits bit0, ExternalMemoryFeatureFlagBits bit1 ) { - return ExternalMemoryFeatureFlagsKHR( bit0 ) | bit1; + return ExternalMemoryFeatureFlags( bit0 ) | bit1; } - VULKAN_HPP_INLINE ExternalMemoryFeatureFlagsKHR operator~( ExternalMemoryFeatureFlagBitsKHR bits ) + VULKAN_HPP_INLINE ExternalMemoryFeatureFlags operator~( ExternalMemoryFeatureFlagBits bits ) { - return ~( ExternalMemoryFeatureFlagsKHR( bits ) ); + return ~( ExternalMemoryFeatureFlags( bits ) ); } - template <> struct FlagTraits + template <> struct FlagTraits { enum { - allFlags = VkFlags(ExternalMemoryFeatureFlagBitsKHR::eDedicatedOnly) | VkFlags(ExternalMemoryFeatureFlagBitsKHR::eExportable) | VkFlags(ExternalMemoryFeatureFlagBitsKHR::eImportable) + allFlags = VkFlags(ExternalMemoryFeatureFlagBits::eDedicatedOnly) | VkFlags(ExternalMemoryFeatureFlagBits::eExportable) | VkFlags(ExternalMemoryFeatureFlagBits::eImportable) }; }; - struct ExternalMemoryPropertiesKHR + using ExternalMemoryFeatureFlagsKHR = ExternalMemoryFeatureFlags; + + struct ExternalMemoryProperties { - operator const VkExternalMemoryPropertiesKHR&() const + operator const VkExternalMemoryProperties&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ExternalMemoryPropertiesKHR const& rhs ) const + bool operator==( ExternalMemoryProperties const& rhs ) const { return ( externalMemoryFeatures == rhs.externalMemoryFeatures ) && ( exportFromImportedHandleTypes == rhs.exportFromImportedHandleTypes ) && ( compatibleHandleTypes == rhs.compatibleHandleTypes ); } - bool operator!=( ExternalMemoryPropertiesKHR const& rhs ) const + bool operator!=( ExternalMemoryProperties const& rhs ) const { return !operator==( rhs ); } - ExternalMemoryFeatureFlagsKHR externalMemoryFeatures; - ExternalMemoryHandleTypeFlagsKHR exportFromImportedHandleTypes; - ExternalMemoryHandleTypeFlagsKHR compatibleHandleTypes; + ExternalMemoryFeatureFlags externalMemoryFeatures; + ExternalMemoryHandleTypeFlags exportFromImportedHandleTypes; + ExternalMemoryHandleTypeFlags compatibleHandleTypes; }; - static_assert( sizeof( ExternalMemoryPropertiesKHR ) == sizeof( VkExternalMemoryPropertiesKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( ExternalMemoryProperties ) == sizeof( VkExternalMemoryProperties ), "struct and wrapper have different size!" ); - struct ExternalImageFormatPropertiesKHR + using ExternalMemoryPropertiesKHR = ExternalMemoryProperties; + + struct ExternalImageFormatProperties { - operator const VkExternalImageFormatPropertiesKHR&() const + operator const VkExternalImageFormatProperties&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ExternalImageFormatPropertiesKHR const& rhs ) const + bool operator==( ExternalImageFormatProperties const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( externalMemoryProperties == rhs.externalMemoryProperties ); } - bool operator!=( ExternalImageFormatPropertiesKHR const& rhs ) const + bool operator!=( ExternalImageFormatProperties const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eExternalImageFormatProperties; public: - void* pNext; - ExternalMemoryPropertiesKHR externalMemoryProperties; + void* pNext = nullptr; + ExternalMemoryProperties externalMemoryProperties; }; - static_assert( sizeof( ExternalImageFormatPropertiesKHR ) == sizeof( VkExternalImageFormatPropertiesKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( ExternalImageFormatProperties ) == sizeof( VkExternalImageFormatProperties ), "struct and wrapper have different size!" ); + + using ExternalImageFormatPropertiesKHR = ExternalImageFormatProperties; - struct ExternalBufferPropertiesKHR + struct ExternalBufferProperties { - operator const VkExternalBufferPropertiesKHR&() const + operator const VkExternalBufferProperties&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ExternalBufferPropertiesKHR const& rhs ) const + bool operator==( ExternalBufferProperties const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( externalMemoryProperties == rhs.externalMemoryProperties ); } - bool operator!=( ExternalBufferPropertiesKHR const& rhs ) const + bool operator!=( ExternalBufferProperties const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eExternalBufferProperties; public: - void* pNext; - ExternalMemoryPropertiesKHR externalMemoryProperties; + void* pNext = nullptr; + ExternalMemoryProperties externalMemoryProperties; }; - static_assert( sizeof( ExternalBufferPropertiesKHR ) == sizeof( VkExternalBufferPropertiesKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( ExternalBufferProperties ) == sizeof( VkExternalBufferProperties ), "struct and wrapper have different size!" ); - enum class ExternalSemaphoreHandleTypeFlagBitsKHR + using ExternalBufferPropertiesKHR = ExternalBufferProperties; + + enum class ExternalSemaphoreHandleTypeFlagBits { - eOpaqueFd = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR, - eOpaqueWin32 = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR, - eOpaqueWin32Kmt = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR, - eD3D12Fence = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHR, - eSyncFd = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR + eOpaqueFd = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT, + eOpaqueFdKHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT, + eOpaqueWin32 = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT, + eOpaqueWin32KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT, + eOpaqueWin32Kmt = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, + eOpaqueWin32KmtKHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, + eD3D12Fence = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT, + eD3D12FenceKHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT, + eSyncFd = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT, + eSyncFdKHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT }; - using ExternalSemaphoreHandleTypeFlagsKHR = Flags; + using ExternalSemaphoreHandleTypeFlags = Flags; - VULKAN_HPP_INLINE ExternalSemaphoreHandleTypeFlagsKHR operator|( ExternalSemaphoreHandleTypeFlagBitsKHR bit0, ExternalSemaphoreHandleTypeFlagBitsKHR bit1 ) + VULKAN_HPP_INLINE ExternalSemaphoreHandleTypeFlags operator|( ExternalSemaphoreHandleTypeFlagBits bit0, ExternalSemaphoreHandleTypeFlagBits bit1 ) { - return ExternalSemaphoreHandleTypeFlagsKHR( bit0 ) | bit1; + return ExternalSemaphoreHandleTypeFlags( bit0 ) | bit1; } - VULKAN_HPP_INLINE ExternalSemaphoreHandleTypeFlagsKHR operator~( ExternalSemaphoreHandleTypeFlagBitsKHR bits ) + VULKAN_HPP_INLINE ExternalSemaphoreHandleTypeFlags operator~( ExternalSemaphoreHandleTypeFlagBits bits ) { - return ~( ExternalSemaphoreHandleTypeFlagsKHR( bits ) ); + return ~( ExternalSemaphoreHandleTypeFlags( bits ) ); } - template <> struct FlagTraits + template <> struct FlagTraits { enum { - allFlags = VkFlags(ExternalSemaphoreHandleTypeFlagBitsKHR::eOpaqueFd) | VkFlags(ExternalSemaphoreHandleTypeFlagBitsKHR::eOpaqueWin32) | VkFlags(ExternalSemaphoreHandleTypeFlagBitsKHR::eOpaqueWin32Kmt) | VkFlags(ExternalSemaphoreHandleTypeFlagBitsKHR::eD3D12Fence) | VkFlags(ExternalSemaphoreHandleTypeFlagBitsKHR::eSyncFd) + allFlags = VkFlags(ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd) | VkFlags(ExternalSemaphoreHandleTypeFlagBits::eOpaqueWin32) | VkFlags(ExternalSemaphoreHandleTypeFlagBits::eOpaqueWin32Kmt) | VkFlags(ExternalSemaphoreHandleTypeFlagBits::eD3D12Fence) | VkFlags(ExternalSemaphoreHandleTypeFlagBits::eSyncFd) }; }; - struct PhysicalDeviceExternalSemaphoreInfoKHR + using ExternalSemaphoreHandleTypeFlagsKHR = ExternalSemaphoreHandleTypeFlags; + + struct PhysicalDeviceExternalSemaphoreInfo { - PhysicalDeviceExternalSemaphoreInfoKHR( ExternalSemaphoreHandleTypeFlagBitsKHR handleType_ = ExternalSemaphoreHandleTypeFlagBitsKHR::eOpaqueFd ) - : sType( StructureType::ePhysicalDeviceExternalSemaphoreInfoKHR ) - , pNext( nullptr ) - , handleType( handleType_ ) + PhysicalDeviceExternalSemaphoreInfo( ExternalSemaphoreHandleTypeFlagBits handleType_ = ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd ) + : handleType( handleType_ ) { } - PhysicalDeviceExternalSemaphoreInfoKHR( VkPhysicalDeviceExternalSemaphoreInfoKHR const & rhs ) + PhysicalDeviceExternalSemaphoreInfo( VkPhysicalDeviceExternalSemaphoreInfo const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceExternalSemaphoreInfoKHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceExternalSemaphoreInfo ) ); } - PhysicalDeviceExternalSemaphoreInfoKHR& operator=( VkPhysicalDeviceExternalSemaphoreInfoKHR const & rhs ) + PhysicalDeviceExternalSemaphoreInfo& operator=( VkPhysicalDeviceExternalSemaphoreInfo const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceExternalSemaphoreInfoKHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceExternalSemaphoreInfo ) ); return *this; } - PhysicalDeviceExternalSemaphoreInfoKHR& setPNext( const void* pNext_ ) + PhysicalDeviceExternalSemaphoreInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PhysicalDeviceExternalSemaphoreInfoKHR& setHandleType( ExternalSemaphoreHandleTypeFlagBitsKHR handleType_ ) + PhysicalDeviceExternalSemaphoreInfo& setHandleType( ExternalSemaphoreHandleTypeFlagBits handleType_ ) { handleType = handleType_; return *this; } - operator const VkPhysicalDeviceExternalSemaphoreInfoKHR&() const + operator const VkPhysicalDeviceExternalSemaphoreInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceExternalSemaphoreInfoKHR const& rhs ) const + bool operator==( PhysicalDeviceExternalSemaphoreInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleType == rhs.handleType ); } - bool operator!=( PhysicalDeviceExternalSemaphoreInfoKHR const& rhs ) const + bool operator!=( PhysicalDeviceExternalSemaphoreInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceExternalSemaphoreInfo; public: - const void* pNext; - ExternalSemaphoreHandleTypeFlagBitsKHR handleType; + const void* pNext = nullptr; + ExternalSemaphoreHandleTypeFlagBits handleType; }; - static_assert( sizeof( PhysicalDeviceExternalSemaphoreInfoKHR ) == sizeof( VkPhysicalDeviceExternalSemaphoreInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceExternalSemaphoreInfo ) == sizeof( VkPhysicalDeviceExternalSemaphoreInfo ), "struct and wrapper have different size!" ); + + using PhysicalDeviceExternalSemaphoreInfoKHR = PhysicalDeviceExternalSemaphoreInfo; - struct ExportSemaphoreCreateInfoKHR + struct ExportSemaphoreCreateInfo { - ExportSemaphoreCreateInfoKHR( ExternalSemaphoreHandleTypeFlagsKHR handleTypes_ = ExternalSemaphoreHandleTypeFlagsKHR() ) - : sType( StructureType::eExportSemaphoreCreateInfoKHR ) - , pNext( nullptr ) - , handleTypes( handleTypes_ ) + ExportSemaphoreCreateInfo( ExternalSemaphoreHandleTypeFlags handleTypes_ = ExternalSemaphoreHandleTypeFlags() ) + : handleTypes( handleTypes_ ) { } - ExportSemaphoreCreateInfoKHR( VkExportSemaphoreCreateInfoKHR const & rhs ) + ExportSemaphoreCreateInfo( VkExportSemaphoreCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ExportSemaphoreCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( ExportSemaphoreCreateInfo ) ); } - ExportSemaphoreCreateInfoKHR& operator=( VkExportSemaphoreCreateInfoKHR const & rhs ) + ExportSemaphoreCreateInfo& operator=( VkExportSemaphoreCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ExportSemaphoreCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( ExportSemaphoreCreateInfo ) ); return *this; } - ExportSemaphoreCreateInfoKHR& setPNext( const void* pNext_ ) + ExportSemaphoreCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - ExportSemaphoreCreateInfoKHR& setHandleTypes( ExternalSemaphoreHandleTypeFlagsKHR handleTypes_ ) + ExportSemaphoreCreateInfo& setHandleTypes( ExternalSemaphoreHandleTypeFlags handleTypes_ ) { handleTypes = handleTypes_; return *this; } - operator const VkExportSemaphoreCreateInfoKHR&() const + operator const VkExportSemaphoreCreateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ExportSemaphoreCreateInfoKHR const& rhs ) const + bool operator==( ExportSemaphoreCreateInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleTypes == rhs.handleTypes ); } - bool operator!=( ExportSemaphoreCreateInfoKHR const& rhs ) const + bool operator!=( ExportSemaphoreCreateInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eExportSemaphoreCreateInfo; public: - const void* pNext; - ExternalSemaphoreHandleTypeFlagsKHR handleTypes; + const void* pNext = nullptr; + ExternalSemaphoreHandleTypeFlags handleTypes; }; - static_assert( sizeof( ExportSemaphoreCreateInfoKHR ) == sizeof( VkExportSemaphoreCreateInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( ExportSemaphoreCreateInfo ) == sizeof( VkExportSemaphoreCreateInfo ), "struct and wrapper have different size!" ); + + using ExportSemaphoreCreateInfoKHR = ExportSemaphoreCreateInfo; #ifdef VK_USE_PLATFORM_WIN32_KHR struct SemaphoreGetWin32HandleInfoKHR { - SemaphoreGetWin32HandleInfoKHR( Semaphore semaphore_ = Semaphore(), ExternalSemaphoreHandleTypeFlagBitsKHR handleType_ = ExternalSemaphoreHandleTypeFlagBitsKHR::eOpaqueFd ) - : sType( StructureType::eSemaphoreGetWin32HandleInfoKHR ) - , pNext( nullptr ) - , semaphore( semaphore_ ) + SemaphoreGetWin32HandleInfoKHR( Semaphore semaphore_ = Semaphore(), ExternalSemaphoreHandleTypeFlagBits handleType_ = ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd ) + : semaphore( semaphore_ ) , handleType( handleType_ ) { } @@ -22903,7 +26350,7 @@ return *this; } - SemaphoreGetWin32HandleInfoKHR& setHandleType( ExternalSemaphoreHandleTypeFlagBitsKHR handleType_ ) + SemaphoreGetWin32HandleInfoKHR& setHandleType( ExternalSemaphoreHandleTypeFlagBits handleType_ ) { handleType = handleType_; return *this; @@ -22928,22 +26375,20 @@ } private: - StructureType sType; + StructureType sType = StructureType::eSemaphoreGetWin32HandleInfoKHR; public: - const void* pNext; + const void* pNext = nullptr; Semaphore semaphore; - ExternalSemaphoreHandleTypeFlagBitsKHR handleType; + ExternalSemaphoreHandleTypeFlagBits handleType; }; static_assert( sizeof( SemaphoreGetWin32HandleInfoKHR ) == sizeof( VkSemaphoreGetWin32HandleInfoKHR ), "struct and wrapper have different size!" ); #endif /*VK_USE_PLATFORM_WIN32_KHR*/ struct SemaphoreGetFdInfoKHR { - SemaphoreGetFdInfoKHR( Semaphore semaphore_ = Semaphore(), ExternalSemaphoreHandleTypeFlagBitsKHR handleType_ = ExternalSemaphoreHandleTypeFlagBitsKHR::eOpaqueFd ) - : sType( StructureType::eSemaphoreGetFdInfoKHR ) - , pNext( nullptr ) - , semaphore( semaphore_ ) + SemaphoreGetFdInfoKHR( Semaphore semaphore_ = Semaphore(), ExternalSemaphoreHandleTypeFlagBits handleType_ = ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd ) + : semaphore( semaphore_ ) , handleType( handleType_ ) { } @@ -22970,7 +26415,7 @@ return *this; } - SemaphoreGetFdInfoKHR& setHandleType( ExternalSemaphoreHandleTypeFlagBitsKHR handleType_ ) + SemaphoreGetFdInfoKHR& setHandleType( ExternalSemaphoreHandleTypeFlagBits handleType_ ) { handleType = handleType_; return *this; @@ -22995,49 +26440,53 @@ } private: - StructureType sType; + StructureType sType = StructureType::eSemaphoreGetFdInfoKHR; public: - const void* pNext; + const void* pNext = nullptr; Semaphore semaphore; - ExternalSemaphoreHandleTypeFlagBitsKHR handleType; + ExternalSemaphoreHandleTypeFlagBits handleType; }; static_assert( sizeof( SemaphoreGetFdInfoKHR ) == sizeof( VkSemaphoreGetFdInfoKHR ), "struct and wrapper have different size!" ); - enum class ExternalSemaphoreFeatureFlagBitsKHR + enum class ExternalSemaphoreFeatureFlagBits { - eExportable = VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHR, - eImportable = VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHR + eExportable = VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT, + eExportableKHR = VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT, + eImportable = VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT, + eImportableKHR = VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT }; - using ExternalSemaphoreFeatureFlagsKHR = Flags; + using ExternalSemaphoreFeatureFlags = Flags; - VULKAN_HPP_INLINE ExternalSemaphoreFeatureFlagsKHR operator|( ExternalSemaphoreFeatureFlagBitsKHR bit0, ExternalSemaphoreFeatureFlagBitsKHR bit1 ) + VULKAN_HPP_INLINE ExternalSemaphoreFeatureFlags operator|( ExternalSemaphoreFeatureFlagBits bit0, ExternalSemaphoreFeatureFlagBits bit1 ) { - return ExternalSemaphoreFeatureFlagsKHR( bit0 ) | bit1; + return ExternalSemaphoreFeatureFlags( bit0 ) | bit1; } - VULKAN_HPP_INLINE ExternalSemaphoreFeatureFlagsKHR operator~( ExternalSemaphoreFeatureFlagBitsKHR bits ) + VULKAN_HPP_INLINE ExternalSemaphoreFeatureFlags operator~( ExternalSemaphoreFeatureFlagBits bits ) { - return ~( ExternalSemaphoreFeatureFlagsKHR( bits ) ); + return ~( ExternalSemaphoreFeatureFlags( bits ) ); } - template <> struct FlagTraits + template <> struct FlagTraits { enum { - allFlags = VkFlags(ExternalSemaphoreFeatureFlagBitsKHR::eExportable) | VkFlags(ExternalSemaphoreFeatureFlagBitsKHR::eImportable) + allFlags = VkFlags(ExternalSemaphoreFeatureFlagBits::eExportable) | VkFlags(ExternalSemaphoreFeatureFlagBits::eImportable) }; }; - struct ExternalSemaphorePropertiesKHR + using ExternalSemaphoreFeatureFlagsKHR = ExternalSemaphoreFeatureFlags; + + struct ExternalSemaphoreProperties { - operator const VkExternalSemaphorePropertiesKHR&() const + operator const VkExternalSemaphoreProperties&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ExternalSemaphorePropertiesKHR const& rhs ) const + bool operator==( ExternalSemaphoreProperties const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) @@ -23046,54 +26495,57 @@ && ( externalSemaphoreFeatures == rhs.externalSemaphoreFeatures ); } - bool operator!=( ExternalSemaphorePropertiesKHR const& rhs ) const + bool operator!=( ExternalSemaphoreProperties const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eExternalSemaphoreProperties; public: - void* pNext; - ExternalSemaphoreHandleTypeFlagsKHR exportFromImportedHandleTypes; - ExternalSemaphoreHandleTypeFlagsKHR compatibleHandleTypes; - ExternalSemaphoreFeatureFlagsKHR externalSemaphoreFeatures; + void* pNext = nullptr; + ExternalSemaphoreHandleTypeFlags exportFromImportedHandleTypes; + ExternalSemaphoreHandleTypeFlags compatibleHandleTypes; + ExternalSemaphoreFeatureFlags externalSemaphoreFeatures; }; - static_assert( sizeof( ExternalSemaphorePropertiesKHR ) == sizeof( VkExternalSemaphorePropertiesKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( ExternalSemaphoreProperties ) == sizeof( VkExternalSemaphoreProperties ), "struct and wrapper have different size!" ); - enum class SemaphoreImportFlagBitsKHR + using ExternalSemaphorePropertiesKHR = ExternalSemaphoreProperties; + + enum class SemaphoreImportFlagBits { - eTemporary = VK_SEMAPHORE_IMPORT_TEMPORARY_BIT_KHR + eTemporary = VK_SEMAPHORE_IMPORT_TEMPORARY_BIT, + eTemporaryKHR = VK_SEMAPHORE_IMPORT_TEMPORARY_BIT }; - using SemaphoreImportFlagsKHR = Flags; + using SemaphoreImportFlags = Flags; - VULKAN_HPP_INLINE SemaphoreImportFlagsKHR operator|( SemaphoreImportFlagBitsKHR bit0, SemaphoreImportFlagBitsKHR bit1 ) + VULKAN_HPP_INLINE SemaphoreImportFlags operator|( SemaphoreImportFlagBits bit0, SemaphoreImportFlagBits bit1 ) { - return SemaphoreImportFlagsKHR( bit0 ) | bit1; + return SemaphoreImportFlags( bit0 ) | bit1; } - VULKAN_HPP_INLINE SemaphoreImportFlagsKHR operator~( SemaphoreImportFlagBitsKHR bits ) + VULKAN_HPP_INLINE SemaphoreImportFlags operator~( SemaphoreImportFlagBits bits ) { - return ~( SemaphoreImportFlagsKHR( bits ) ); + return ~( SemaphoreImportFlags( bits ) ); } - template <> struct FlagTraits + template <> struct FlagTraits { enum { - allFlags = VkFlags(SemaphoreImportFlagBitsKHR::eTemporary) + allFlags = VkFlags(SemaphoreImportFlagBits::eTemporary) }; }; + using SemaphoreImportFlagsKHR = SemaphoreImportFlags; + #ifdef VK_USE_PLATFORM_WIN32_KHR struct ImportSemaphoreWin32HandleInfoKHR { - ImportSemaphoreWin32HandleInfoKHR( Semaphore semaphore_ = Semaphore(), SemaphoreImportFlagsKHR flags_ = SemaphoreImportFlagsKHR(), ExternalSemaphoreHandleTypeFlagBitsKHR handleType_ = ExternalSemaphoreHandleTypeFlagBitsKHR::eOpaqueFd, HANDLE handle_ = 0, LPCWSTR name_ = 0 ) - : sType( StructureType::eImportSemaphoreWin32HandleInfoKHR ) - , pNext( nullptr ) - , semaphore( semaphore_ ) + ImportSemaphoreWin32HandleInfoKHR( Semaphore semaphore_ = Semaphore(), SemaphoreImportFlags flags_ = SemaphoreImportFlags(), ExternalSemaphoreHandleTypeFlagBits handleType_ = ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd, HANDLE handle_ = 0, LPCWSTR name_ = 0 ) + : semaphore( semaphore_ ) , flags( flags_ ) , handleType( handleType_ ) , handle( handle_ ) @@ -23123,13 +26575,13 @@ return *this; } - ImportSemaphoreWin32HandleInfoKHR& setFlags( SemaphoreImportFlagsKHR flags_ ) + ImportSemaphoreWin32HandleInfoKHR& setFlags( SemaphoreImportFlags flags_ ) { flags = flags_; return *this; } - ImportSemaphoreWin32HandleInfoKHR& setHandleType( ExternalSemaphoreHandleTypeFlagBitsKHR handleType_ ) + ImportSemaphoreWin32HandleInfoKHR& setHandleType( ExternalSemaphoreHandleTypeFlagBits handleType_ ) { handleType = handleType_; return *this; @@ -23169,13 +26621,13 @@ } private: - StructureType sType; + StructureType sType = StructureType::eImportSemaphoreWin32HandleInfoKHR; public: - const void* pNext; + const void* pNext = nullptr; Semaphore semaphore; - SemaphoreImportFlagsKHR flags; - ExternalSemaphoreHandleTypeFlagBitsKHR handleType; + SemaphoreImportFlags flags; + ExternalSemaphoreHandleTypeFlagBits handleType; HANDLE handle; LPCWSTR name; }; @@ -23184,10 +26636,8 @@ struct ImportSemaphoreFdInfoKHR { - ImportSemaphoreFdInfoKHR( Semaphore semaphore_ = Semaphore(), SemaphoreImportFlagsKHR flags_ = SemaphoreImportFlagsKHR(), ExternalSemaphoreHandleTypeFlagBitsKHR handleType_ = ExternalSemaphoreHandleTypeFlagBitsKHR::eOpaqueFd, int fd_ = 0 ) - : sType( StructureType::eImportSemaphoreFdInfoKHR ) - , pNext( nullptr ) - , semaphore( semaphore_ ) + ImportSemaphoreFdInfoKHR( Semaphore semaphore_ = Semaphore(), SemaphoreImportFlags flags_ = SemaphoreImportFlags(), ExternalSemaphoreHandleTypeFlagBits handleType_ = ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd, int fd_ = 0 ) + : semaphore( semaphore_ ) , flags( flags_ ) , handleType( handleType_ ) , fd( fd_ ) @@ -23216,13 +26666,13 @@ return *this; } - ImportSemaphoreFdInfoKHR& setFlags( SemaphoreImportFlagsKHR flags_ ) + ImportSemaphoreFdInfoKHR& setFlags( SemaphoreImportFlags flags_ ) { flags = flags_; return *this; } - ImportSemaphoreFdInfoKHR& setHandleType( ExternalSemaphoreHandleTypeFlagBitsKHR handleType_ ) + ImportSemaphoreFdInfoKHR& setHandleType( ExternalSemaphoreHandleTypeFlagBits handleType_ ) { handleType = handleType_; return *this; @@ -23255,166 +26705,170 @@ } private: - StructureType sType; + StructureType sType = StructureType::eImportSemaphoreFdInfoKHR; public: - const void* pNext; + const void* pNext = nullptr; Semaphore semaphore; - SemaphoreImportFlagsKHR flags; - ExternalSemaphoreHandleTypeFlagBitsKHR handleType; + SemaphoreImportFlags flags; + ExternalSemaphoreHandleTypeFlagBits handleType; int fd; }; static_assert( sizeof( ImportSemaphoreFdInfoKHR ) == sizeof( VkImportSemaphoreFdInfoKHR ), "struct and wrapper have different size!" ); - enum class ExternalFenceHandleTypeFlagBitsKHR + enum class ExternalFenceHandleTypeFlagBits { - eOpaqueFd = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR, - eOpaqueWin32 = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR, - eOpaqueWin32Kmt = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR, - eSyncFd = VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR + eOpaqueFd = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT, + eOpaqueFdKHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT, + eOpaqueWin32 = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT, + eOpaqueWin32KHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT, + eOpaqueWin32Kmt = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, + eOpaqueWin32KmtKHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, + eSyncFd = VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT, + eSyncFdKHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT }; - using ExternalFenceHandleTypeFlagsKHR = Flags; + using ExternalFenceHandleTypeFlags = Flags; - VULKAN_HPP_INLINE ExternalFenceHandleTypeFlagsKHR operator|( ExternalFenceHandleTypeFlagBitsKHR bit0, ExternalFenceHandleTypeFlagBitsKHR bit1 ) + VULKAN_HPP_INLINE ExternalFenceHandleTypeFlags operator|( ExternalFenceHandleTypeFlagBits bit0, ExternalFenceHandleTypeFlagBits bit1 ) { - return ExternalFenceHandleTypeFlagsKHR( bit0 ) | bit1; + return ExternalFenceHandleTypeFlags( bit0 ) | bit1; } - VULKAN_HPP_INLINE ExternalFenceHandleTypeFlagsKHR operator~( ExternalFenceHandleTypeFlagBitsKHR bits ) + VULKAN_HPP_INLINE ExternalFenceHandleTypeFlags operator~( ExternalFenceHandleTypeFlagBits bits ) { - return ~( ExternalFenceHandleTypeFlagsKHR( bits ) ); + return ~( ExternalFenceHandleTypeFlags( bits ) ); } - template <> struct FlagTraits + template <> struct FlagTraits { enum { - allFlags = VkFlags(ExternalFenceHandleTypeFlagBitsKHR::eOpaqueFd) | VkFlags(ExternalFenceHandleTypeFlagBitsKHR::eOpaqueWin32) | VkFlags(ExternalFenceHandleTypeFlagBitsKHR::eOpaqueWin32Kmt) | VkFlags(ExternalFenceHandleTypeFlagBitsKHR::eSyncFd) + allFlags = VkFlags(ExternalFenceHandleTypeFlagBits::eOpaqueFd) | VkFlags(ExternalFenceHandleTypeFlagBits::eOpaqueWin32) | VkFlags(ExternalFenceHandleTypeFlagBits::eOpaqueWin32Kmt) | VkFlags(ExternalFenceHandleTypeFlagBits::eSyncFd) }; }; - struct PhysicalDeviceExternalFenceInfoKHR + using ExternalFenceHandleTypeFlagsKHR = ExternalFenceHandleTypeFlags; + + struct PhysicalDeviceExternalFenceInfo { - PhysicalDeviceExternalFenceInfoKHR( ExternalFenceHandleTypeFlagBitsKHR handleType_ = ExternalFenceHandleTypeFlagBitsKHR::eOpaqueFd ) - : sType( StructureType::ePhysicalDeviceExternalFenceInfoKHR ) - , pNext( nullptr ) - , handleType( handleType_ ) + PhysicalDeviceExternalFenceInfo( ExternalFenceHandleTypeFlagBits handleType_ = ExternalFenceHandleTypeFlagBits::eOpaqueFd ) + : handleType( handleType_ ) { } - PhysicalDeviceExternalFenceInfoKHR( VkPhysicalDeviceExternalFenceInfoKHR const & rhs ) + PhysicalDeviceExternalFenceInfo( VkPhysicalDeviceExternalFenceInfo const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceExternalFenceInfoKHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceExternalFenceInfo ) ); } - PhysicalDeviceExternalFenceInfoKHR& operator=( VkPhysicalDeviceExternalFenceInfoKHR const & rhs ) + PhysicalDeviceExternalFenceInfo& operator=( VkPhysicalDeviceExternalFenceInfo const & rhs ) { - memcpy( this, &rhs, sizeof( PhysicalDeviceExternalFenceInfoKHR ) ); + memcpy( this, &rhs, sizeof( PhysicalDeviceExternalFenceInfo ) ); return *this; } - PhysicalDeviceExternalFenceInfoKHR& setPNext( const void* pNext_ ) + PhysicalDeviceExternalFenceInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PhysicalDeviceExternalFenceInfoKHR& setHandleType( ExternalFenceHandleTypeFlagBitsKHR handleType_ ) + PhysicalDeviceExternalFenceInfo& setHandleType( ExternalFenceHandleTypeFlagBits handleType_ ) { handleType = handleType_; return *this; } - operator const VkPhysicalDeviceExternalFenceInfoKHR&() const + operator const VkPhysicalDeviceExternalFenceInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceExternalFenceInfoKHR const& rhs ) const + bool operator==( PhysicalDeviceExternalFenceInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleType == rhs.handleType ); } - bool operator!=( PhysicalDeviceExternalFenceInfoKHR const& rhs ) const + bool operator!=( PhysicalDeviceExternalFenceInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceExternalFenceInfo; public: - const void* pNext; - ExternalFenceHandleTypeFlagBitsKHR handleType; + const void* pNext = nullptr; + ExternalFenceHandleTypeFlagBits handleType; }; - static_assert( sizeof( PhysicalDeviceExternalFenceInfoKHR ) == sizeof( VkPhysicalDeviceExternalFenceInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceExternalFenceInfo ) == sizeof( VkPhysicalDeviceExternalFenceInfo ), "struct and wrapper have different size!" ); - struct ExportFenceCreateInfoKHR + using PhysicalDeviceExternalFenceInfoKHR = PhysicalDeviceExternalFenceInfo; + + struct ExportFenceCreateInfo { - ExportFenceCreateInfoKHR( ExternalFenceHandleTypeFlagsKHR handleTypes_ = ExternalFenceHandleTypeFlagsKHR() ) - : sType( StructureType::eExportFenceCreateInfoKHR ) - , pNext( nullptr ) - , handleTypes( handleTypes_ ) + ExportFenceCreateInfo( ExternalFenceHandleTypeFlags handleTypes_ = ExternalFenceHandleTypeFlags() ) + : handleTypes( handleTypes_ ) { } - ExportFenceCreateInfoKHR( VkExportFenceCreateInfoKHR const & rhs ) + ExportFenceCreateInfo( VkExportFenceCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ExportFenceCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( ExportFenceCreateInfo ) ); } - ExportFenceCreateInfoKHR& operator=( VkExportFenceCreateInfoKHR const & rhs ) + ExportFenceCreateInfo& operator=( VkExportFenceCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( ExportFenceCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( ExportFenceCreateInfo ) ); return *this; } - ExportFenceCreateInfoKHR& setPNext( const void* pNext_ ) + ExportFenceCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - ExportFenceCreateInfoKHR& setHandleTypes( ExternalFenceHandleTypeFlagsKHR handleTypes_ ) + ExportFenceCreateInfo& setHandleTypes( ExternalFenceHandleTypeFlags handleTypes_ ) { handleTypes = handleTypes_; return *this; } - operator const VkExportFenceCreateInfoKHR&() const + operator const VkExportFenceCreateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ExportFenceCreateInfoKHR const& rhs ) const + bool operator==( ExportFenceCreateInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleTypes == rhs.handleTypes ); } - bool operator!=( ExportFenceCreateInfoKHR const& rhs ) const + bool operator!=( ExportFenceCreateInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eExportFenceCreateInfo; public: - const void* pNext; - ExternalFenceHandleTypeFlagsKHR handleTypes; + const void* pNext = nullptr; + ExternalFenceHandleTypeFlags handleTypes; }; - static_assert( sizeof( ExportFenceCreateInfoKHR ) == sizeof( VkExportFenceCreateInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( ExportFenceCreateInfo ) == sizeof( VkExportFenceCreateInfo ), "struct and wrapper have different size!" ); + + using ExportFenceCreateInfoKHR = ExportFenceCreateInfo; #ifdef VK_USE_PLATFORM_WIN32_KHR struct FenceGetWin32HandleInfoKHR { - FenceGetWin32HandleInfoKHR( Fence fence_ = Fence(), ExternalFenceHandleTypeFlagBitsKHR handleType_ = ExternalFenceHandleTypeFlagBitsKHR::eOpaqueFd ) - : sType( StructureType::eFenceGetWin32HandleInfoKHR ) - , pNext( nullptr ) - , fence( fence_ ) + FenceGetWin32HandleInfoKHR( Fence fence_ = Fence(), ExternalFenceHandleTypeFlagBits handleType_ = ExternalFenceHandleTypeFlagBits::eOpaqueFd ) + : fence( fence_ ) , handleType( handleType_ ) { } @@ -23441,7 +26895,7 @@ return *this; } - FenceGetWin32HandleInfoKHR& setHandleType( ExternalFenceHandleTypeFlagBitsKHR handleType_ ) + FenceGetWin32HandleInfoKHR& setHandleType( ExternalFenceHandleTypeFlagBits handleType_ ) { handleType = handleType_; return *this; @@ -23466,22 +26920,20 @@ } private: - StructureType sType; + StructureType sType = StructureType::eFenceGetWin32HandleInfoKHR; public: - const void* pNext; + const void* pNext = nullptr; Fence fence; - ExternalFenceHandleTypeFlagBitsKHR handleType; + ExternalFenceHandleTypeFlagBits handleType; }; static_assert( sizeof( FenceGetWin32HandleInfoKHR ) == sizeof( VkFenceGetWin32HandleInfoKHR ), "struct and wrapper have different size!" ); #endif /*VK_USE_PLATFORM_WIN32_KHR*/ struct FenceGetFdInfoKHR { - FenceGetFdInfoKHR( Fence fence_ = Fence(), ExternalFenceHandleTypeFlagBitsKHR handleType_ = ExternalFenceHandleTypeFlagBitsKHR::eOpaqueFd ) - : sType( StructureType::eFenceGetFdInfoKHR ) - , pNext( nullptr ) - , fence( fence_ ) + FenceGetFdInfoKHR( Fence fence_ = Fence(), ExternalFenceHandleTypeFlagBits handleType_ = ExternalFenceHandleTypeFlagBits::eOpaqueFd ) + : fence( fence_ ) , handleType( handleType_ ) { } @@ -23508,7 +26960,7 @@ return *this; } - FenceGetFdInfoKHR& setHandleType( ExternalFenceHandleTypeFlagBitsKHR handleType_ ) + FenceGetFdInfoKHR& setHandleType( ExternalFenceHandleTypeFlagBits handleType_ ) { handleType = handleType_; return *this; @@ -23533,49 +26985,53 @@ } private: - StructureType sType; + StructureType sType = StructureType::eFenceGetFdInfoKHR; public: - const void* pNext; + const void* pNext = nullptr; Fence fence; - ExternalFenceHandleTypeFlagBitsKHR handleType; + ExternalFenceHandleTypeFlagBits handleType; }; static_assert( sizeof( FenceGetFdInfoKHR ) == sizeof( VkFenceGetFdInfoKHR ), "struct and wrapper have different size!" ); - enum class ExternalFenceFeatureFlagBitsKHR + enum class ExternalFenceFeatureFlagBits { - eExportable = VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT_KHR, - eImportable = VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT_KHR + eExportable = VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT, + eExportableKHR = VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT, + eImportable = VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT, + eImportableKHR = VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT }; - using ExternalFenceFeatureFlagsKHR = Flags; + using ExternalFenceFeatureFlags = Flags; - VULKAN_HPP_INLINE ExternalFenceFeatureFlagsKHR operator|( ExternalFenceFeatureFlagBitsKHR bit0, ExternalFenceFeatureFlagBitsKHR bit1 ) + VULKAN_HPP_INLINE ExternalFenceFeatureFlags operator|( ExternalFenceFeatureFlagBits bit0, ExternalFenceFeatureFlagBits bit1 ) { - return ExternalFenceFeatureFlagsKHR( bit0 ) | bit1; + return ExternalFenceFeatureFlags( bit0 ) | bit1; } - VULKAN_HPP_INLINE ExternalFenceFeatureFlagsKHR operator~( ExternalFenceFeatureFlagBitsKHR bits ) + VULKAN_HPP_INLINE ExternalFenceFeatureFlags operator~( ExternalFenceFeatureFlagBits bits ) { - return ~( ExternalFenceFeatureFlagsKHR( bits ) ); + return ~( ExternalFenceFeatureFlags( bits ) ); } - template <> struct FlagTraits + template <> struct FlagTraits { enum { - allFlags = VkFlags(ExternalFenceFeatureFlagBitsKHR::eExportable) | VkFlags(ExternalFenceFeatureFlagBitsKHR::eImportable) + allFlags = VkFlags(ExternalFenceFeatureFlagBits::eExportable) | VkFlags(ExternalFenceFeatureFlagBits::eImportable) }; }; - struct ExternalFencePropertiesKHR + using ExternalFenceFeatureFlagsKHR = ExternalFenceFeatureFlags; + + struct ExternalFenceProperties { - operator const VkExternalFencePropertiesKHR&() const + operator const VkExternalFenceProperties&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( ExternalFencePropertiesKHR const& rhs ) const + bool operator==( ExternalFenceProperties const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) @@ -23584,54 +27040,57 @@ && ( externalFenceFeatures == rhs.externalFenceFeatures ); } - bool operator!=( ExternalFencePropertiesKHR const& rhs ) const + bool operator!=( ExternalFenceProperties const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eExternalFenceProperties; public: - void* pNext; - ExternalFenceHandleTypeFlagsKHR exportFromImportedHandleTypes; - ExternalFenceHandleTypeFlagsKHR compatibleHandleTypes; - ExternalFenceFeatureFlagsKHR externalFenceFeatures; + void* pNext = nullptr; + ExternalFenceHandleTypeFlags exportFromImportedHandleTypes; + ExternalFenceHandleTypeFlags compatibleHandleTypes; + ExternalFenceFeatureFlags externalFenceFeatures; }; - static_assert( sizeof( ExternalFencePropertiesKHR ) == sizeof( VkExternalFencePropertiesKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( ExternalFenceProperties ) == sizeof( VkExternalFenceProperties ), "struct and wrapper have different size!" ); + + using ExternalFencePropertiesKHR = ExternalFenceProperties; - enum class FenceImportFlagBitsKHR + enum class FenceImportFlagBits { - eTemporary = VK_FENCE_IMPORT_TEMPORARY_BIT_KHR + eTemporary = VK_FENCE_IMPORT_TEMPORARY_BIT, + eTemporaryKHR = VK_FENCE_IMPORT_TEMPORARY_BIT }; - using FenceImportFlagsKHR = Flags; + using FenceImportFlags = Flags; - VULKAN_HPP_INLINE FenceImportFlagsKHR operator|( FenceImportFlagBitsKHR bit0, FenceImportFlagBitsKHR bit1 ) + VULKAN_HPP_INLINE FenceImportFlags operator|( FenceImportFlagBits bit0, FenceImportFlagBits bit1 ) { - return FenceImportFlagsKHR( bit0 ) | bit1; + return FenceImportFlags( bit0 ) | bit1; } - VULKAN_HPP_INLINE FenceImportFlagsKHR operator~( FenceImportFlagBitsKHR bits ) + VULKAN_HPP_INLINE FenceImportFlags operator~( FenceImportFlagBits bits ) { - return ~( FenceImportFlagsKHR( bits ) ); + return ~( FenceImportFlags( bits ) ); } - template <> struct FlagTraits + template <> struct FlagTraits { enum { - allFlags = VkFlags(FenceImportFlagBitsKHR::eTemporary) + allFlags = VkFlags(FenceImportFlagBits::eTemporary) }; }; + using FenceImportFlagsKHR = FenceImportFlags; + #ifdef VK_USE_PLATFORM_WIN32_KHR struct ImportFenceWin32HandleInfoKHR { - ImportFenceWin32HandleInfoKHR( Fence fence_ = Fence(), FenceImportFlagsKHR flags_ = FenceImportFlagsKHR(), ExternalFenceHandleTypeFlagBitsKHR handleType_ = ExternalFenceHandleTypeFlagBitsKHR::eOpaqueFd, HANDLE handle_ = 0, LPCWSTR name_ = 0 ) - : sType( StructureType::eImportFenceWin32HandleInfoKHR ) - , pNext( nullptr ) - , fence( fence_ ) + ImportFenceWin32HandleInfoKHR( Fence fence_ = Fence(), FenceImportFlags flags_ = FenceImportFlags(), ExternalFenceHandleTypeFlagBits handleType_ = ExternalFenceHandleTypeFlagBits::eOpaqueFd, HANDLE handle_ = 0, LPCWSTR name_ = 0 ) + : fence( fence_ ) , flags( flags_ ) , handleType( handleType_ ) , handle( handle_ ) @@ -23661,13 +27120,13 @@ return *this; } - ImportFenceWin32HandleInfoKHR& setFlags( FenceImportFlagsKHR flags_ ) + ImportFenceWin32HandleInfoKHR& setFlags( FenceImportFlags flags_ ) { flags = flags_; return *this; } - ImportFenceWin32HandleInfoKHR& setHandleType( ExternalFenceHandleTypeFlagBitsKHR handleType_ ) + ImportFenceWin32HandleInfoKHR& setHandleType( ExternalFenceHandleTypeFlagBits handleType_ ) { handleType = handleType_; return *this; @@ -23707,13 +27166,13 @@ } private: - StructureType sType; + StructureType sType = StructureType::eImportFenceWin32HandleInfoKHR; public: - const void* pNext; + const void* pNext = nullptr; Fence fence; - FenceImportFlagsKHR flags; - ExternalFenceHandleTypeFlagBitsKHR handleType; + FenceImportFlags flags; + ExternalFenceHandleTypeFlagBits handleType; HANDLE handle; LPCWSTR name; }; @@ -23722,10 +27181,8 @@ struct ImportFenceFdInfoKHR { - ImportFenceFdInfoKHR( Fence fence_ = Fence(), FenceImportFlagsKHR flags_ = FenceImportFlagsKHR(), ExternalFenceHandleTypeFlagBitsKHR handleType_ = ExternalFenceHandleTypeFlagBitsKHR::eOpaqueFd, int fd_ = 0 ) - : sType( StructureType::eImportFenceFdInfoKHR ) - , pNext( nullptr ) - , fence( fence_ ) + ImportFenceFdInfoKHR( Fence fence_ = Fence(), FenceImportFlags flags_ = FenceImportFlags(), ExternalFenceHandleTypeFlagBits handleType_ = ExternalFenceHandleTypeFlagBits::eOpaqueFd, int fd_ = 0 ) + : fence( fence_ ) , flags( flags_ ) , handleType( handleType_ ) , fd( fd_ ) @@ -23754,13 +27211,13 @@ return *this; } - ImportFenceFdInfoKHR& setFlags( FenceImportFlagsKHR flags_ ) + ImportFenceFdInfoKHR& setFlags( FenceImportFlags flags_ ) { flags = flags_; return *this; } - ImportFenceFdInfoKHR& setHandleType( ExternalFenceHandleTypeFlagBitsKHR handleType_ ) + ImportFenceFdInfoKHR& setHandleType( ExternalFenceHandleTypeFlagBits handleType_ ) { handleType = handleType_; return *this; @@ -23793,13 +27250,13 @@ } private: - StructureType sType; + StructureType sType = StructureType::eImportFenceFdInfoKHR; public: - const void* pNext; + const void* pNext = nullptr; Fence fence; - FenceImportFlagsKHR flags; - ExternalFenceHandleTypeFlagBitsKHR handleType; + FenceImportFlags flags; + ExternalFenceHandleTypeFlagBits handleType; int fd; }; static_assert( sizeof( ImportFenceFdInfoKHR ) == sizeof( VkImportFenceFdInfoKHR ), "struct and wrapper have different size!" ); @@ -23859,10 +27316,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eSurfaceCapabilities2EXT; public: - void* pNext; + void* pNext = nullptr; uint32_t minImageCount; uint32_t maxImageCount; Extent2D currentExtent; @@ -23880,9 +27337,7 @@ struct SwapchainCounterCreateInfoEXT { SwapchainCounterCreateInfoEXT( SurfaceCounterFlagsEXT surfaceCounters_ = SurfaceCounterFlagsEXT() ) - : sType( StructureType::eSwapchainCounterCreateInfoEXT ) - , pNext( nullptr ) - , surfaceCounters( surfaceCounters_ ) + : surfaceCounters( surfaceCounters_ ) { } @@ -23926,10 +27381,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eSwapchainCounterCreateInfoEXT; public: - const void* pNext; + const void* pNext = nullptr; SurfaceCounterFlagsEXT surfaceCounters; }; static_assert( sizeof( SwapchainCounterCreateInfoEXT ) == sizeof( VkSwapchainCounterCreateInfoEXT ), "struct and wrapper have different size!" ); @@ -23944,9 +27399,7 @@ struct DisplayPowerInfoEXT { DisplayPowerInfoEXT( DisplayPowerStateEXT powerState_ = DisplayPowerStateEXT::eOff ) - : sType( StructureType::eDisplayPowerInfoEXT ) - , pNext( nullptr ) - , powerState( powerState_ ) + : powerState( powerState_ ) { } @@ -23990,10 +27443,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eDisplayPowerInfoEXT; public: - const void* pNext; + const void* pNext = nullptr; DisplayPowerStateEXT powerState; }; static_assert( sizeof( DisplayPowerInfoEXT ) == sizeof( VkDisplayPowerInfoEXT ), "struct and wrapper have different size!" ); @@ -24006,9 +27459,7 @@ struct DeviceEventInfoEXT { DeviceEventInfoEXT( DeviceEventTypeEXT deviceEvent_ = DeviceEventTypeEXT::eDisplayHotplug ) - : sType( StructureType::eDeviceEventInfoEXT ) - , pNext( nullptr ) - , deviceEvent( deviceEvent_ ) + : deviceEvent( deviceEvent_ ) { } @@ -24052,10 +27503,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eDeviceEventInfoEXT; public: - const void* pNext; + const void* pNext = nullptr; DeviceEventTypeEXT deviceEvent; }; static_assert( sizeof( DeviceEventInfoEXT ) == sizeof( VkDeviceEventInfoEXT ), "struct and wrapper have different size!" ); @@ -24068,9 +27519,7 @@ struct DisplayEventInfoEXT { DisplayEventInfoEXT( DisplayEventTypeEXT displayEvent_ = DisplayEventTypeEXT::eFirstPixelOut ) - : sType( StructureType::eDisplayEventInfoEXT ) - , pNext( nullptr ) - , displayEvent( displayEvent_ ) + : displayEvent( displayEvent_ ) { } @@ -24114,111 +27563,118 @@ } private: - StructureType sType; + StructureType sType = StructureType::eDisplayEventInfoEXT; public: - const void* pNext; + const void* pNext = nullptr; DisplayEventTypeEXT displayEvent; }; static_assert( sizeof( DisplayEventInfoEXT ) == sizeof( VkDisplayEventInfoEXT ), "struct and wrapper have different size!" ); - enum class PeerMemoryFeatureFlagBitsKHX + enum class PeerMemoryFeatureFlagBits { - eCopySrc = VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT_KHX, - eCopyDst = VK_PEER_MEMORY_FEATURE_COPY_DST_BIT_KHX, - eGenericSrc = VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT_KHX, - eGenericDst = VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT_KHX + eCopySrc = VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT, + eCopySrcKHR = VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT, + eCopyDst = VK_PEER_MEMORY_FEATURE_COPY_DST_BIT, + eCopyDstKHR = VK_PEER_MEMORY_FEATURE_COPY_DST_BIT, + eGenericSrc = VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT, + eGenericSrcKHR = VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT, + eGenericDst = VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT, + eGenericDstKHR = VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT }; - using PeerMemoryFeatureFlagsKHX = Flags; + using PeerMemoryFeatureFlags = Flags; - VULKAN_HPP_INLINE PeerMemoryFeatureFlagsKHX operator|( PeerMemoryFeatureFlagBitsKHX bit0, PeerMemoryFeatureFlagBitsKHX bit1 ) + VULKAN_HPP_INLINE PeerMemoryFeatureFlags operator|( PeerMemoryFeatureFlagBits bit0, PeerMemoryFeatureFlagBits bit1 ) { - return PeerMemoryFeatureFlagsKHX( bit0 ) | bit1; + return PeerMemoryFeatureFlags( bit0 ) | bit1; } - VULKAN_HPP_INLINE PeerMemoryFeatureFlagsKHX operator~( PeerMemoryFeatureFlagBitsKHX bits ) + VULKAN_HPP_INLINE PeerMemoryFeatureFlags operator~( PeerMemoryFeatureFlagBits bits ) { - return ~( PeerMemoryFeatureFlagsKHX( bits ) ); + return ~( PeerMemoryFeatureFlags( bits ) ); } - template <> struct FlagTraits + template <> struct FlagTraits { enum { - allFlags = VkFlags(PeerMemoryFeatureFlagBitsKHX::eCopySrc) | VkFlags(PeerMemoryFeatureFlagBitsKHX::eCopyDst) | VkFlags(PeerMemoryFeatureFlagBitsKHX::eGenericSrc) | VkFlags(PeerMemoryFeatureFlagBitsKHX::eGenericDst) + allFlags = VkFlags(PeerMemoryFeatureFlagBits::eCopySrc) | VkFlags(PeerMemoryFeatureFlagBits::eCopyDst) | VkFlags(PeerMemoryFeatureFlagBits::eGenericSrc) | VkFlags(PeerMemoryFeatureFlagBits::eGenericDst) }; }; - enum class MemoryAllocateFlagBitsKHX + using PeerMemoryFeatureFlagsKHR = PeerMemoryFeatureFlags; + + enum class MemoryAllocateFlagBits { - eDeviceMask = VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT_KHX + eDeviceMask = VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT, + eDeviceMaskKHR = VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT }; - using MemoryAllocateFlagsKHX = Flags; + using MemoryAllocateFlags = Flags; - VULKAN_HPP_INLINE MemoryAllocateFlagsKHX operator|( MemoryAllocateFlagBitsKHX bit0, MemoryAllocateFlagBitsKHX bit1 ) + VULKAN_HPP_INLINE MemoryAllocateFlags operator|( MemoryAllocateFlagBits bit0, MemoryAllocateFlagBits bit1 ) { - return MemoryAllocateFlagsKHX( bit0 ) | bit1; + return MemoryAllocateFlags( bit0 ) | bit1; } - VULKAN_HPP_INLINE MemoryAllocateFlagsKHX operator~( MemoryAllocateFlagBitsKHX bits ) + VULKAN_HPP_INLINE MemoryAllocateFlags operator~( MemoryAllocateFlagBits bits ) { - return ~( MemoryAllocateFlagsKHX( bits ) ); + return ~( MemoryAllocateFlags( bits ) ); } - template <> struct FlagTraits + template <> struct FlagTraits { enum { - allFlags = VkFlags(MemoryAllocateFlagBitsKHX::eDeviceMask) + allFlags = VkFlags(MemoryAllocateFlagBits::eDeviceMask) }; }; - struct MemoryAllocateFlagsInfoKHX + using MemoryAllocateFlagsKHR = MemoryAllocateFlags; + + struct MemoryAllocateFlagsInfo { - MemoryAllocateFlagsInfoKHX( MemoryAllocateFlagsKHX flags_ = MemoryAllocateFlagsKHX(), uint32_t deviceMask_ = 0 ) - : sType( StructureType::eMemoryAllocateFlagsInfoKHX ) - , pNext( nullptr ) - , flags( flags_ ) + MemoryAllocateFlagsInfo( MemoryAllocateFlags flags_ = MemoryAllocateFlags(), uint32_t deviceMask_ = 0 ) + : flags( flags_ ) , deviceMask( deviceMask_ ) { } - MemoryAllocateFlagsInfoKHX( VkMemoryAllocateFlagsInfoKHX const & rhs ) + MemoryAllocateFlagsInfo( VkMemoryAllocateFlagsInfo const & rhs ) { - memcpy( this, &rhs, sizeof( MemoryAllocateFlagsInfoKHX ) ); + memcpy( this, &rhs, sizeof( MemoryAllocateFlagsInfo ) ); } - MemoryAllocateFlagsInfoKHX& operator=( VkMemoryAllocateFlagsInfoKHX const & rhs ) + MemoryAllocateFlagsInfo& operator=( VkMemoryAllocateFlagsInfo const & rhs ) { - memcpy( this, &rhs, sizeof( MemoryAllocateFlagsInfoKHX ) ); + memcpy( this, &rhs, sizeof( MemoryAllocateFlagsInfo ) ); return *this; } - MemoryAllocateFlagsInfoKHX& setPNext( const void* pNext_ ) + MemoryAllocateFlagsInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - MemoryAllocateFlagsInfoKHX& setFlags( MemoryAllocateFlagsKHX flags_ ) + MemoryAllocateFlagsInfo& setFlags( MemoryAllocateFlags flags_ ) { flags = flags_; return *this; } - MemoryAllocateFlagsInfoKHX& setDeviceMask( uint32_t deviceMask_ ) + MemoryAllocateFlagsInfo& setDeviceMask( uint32_t deviceMask_ ) { deviceMask = deviceMask_; return *this; } - operator const VkMemoryAllocateFlagsInfoKHX&() const + operator const VkMemoryAllocateFlagsInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( MemoryAllocateFlagsInfoKHX const& rhs ) const + bool operator==( MemoryAllocateFlagsInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) @@ -24226,130 +27682,130 @@ && ( deviceMask == rhs.deviceMask ); } - bool operator!=( MemoryAllocateFlagsInfoKHX const& rhs ) const + bool operator!=( MemoryAllocateFlagsInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eMemoryAllocateFlagsInfo; public: - const void* pNext; - MemoryAllocateFlagsKHX flags; + const void* pNext = nullptr; + MemoryAllocateFlags flags; uint32_t deviceMask; }; - static_assert( sizeof( MemoryAllocateFlagsInfoKHX ) == sizeof( VkMemoryAllocateFlagsInfoKHX ), "struct and wrapper have different size!" ); + static_assert( sizeof( MemoryAllocateFlagsInfo ) == sizeof( VkMemoryAllocateFlagsInfo ), "struct and wrapper have different size!" ); + + using MemoryAllocateFlagsInfoKHR = MemoryAllocateFlagsInfo; - enum class DeviceGroupPresentModeFlagBitsKHX + enum class DeviceGroupPresentModeFlagBitsKHR { - eLocal = VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHX, - eRemote = VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHX, - eSum = VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHX, - eLocalMultiDevice = VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHX + 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 }; - using DeviceGroupPresentModeFlagsKHX = Flags; + using DeviceGroupPresentModeFlagsKHR = Flags; - VULKAN_HPP_INLINE DeviceGroupPresentModeFlagsKHX operator|( DeviceGroupPresentModeFlagBitsKHX bit0, DeviceGroupPresentModeFlagBitsKHX bit1 ) + VULKAN_HPP_INLINE DeviceGroupPresentModeFlagsKHR operator|( DeviceGroupPresentModeFlagBitsKHR bit0, DeviceGroupPresentModeFlagBitsKHR bit1 ) { - return DeviceGroupPresentModeFlagsKHX( bit0 ) | bit1; + return DeviceGroupPresentModeFlagsKHR( bit0 ) | bit1; } - VULKAN_HPP_INLINE DeviceGroupPresentModeFlagsKHX operator~( DeviceGroupPresentModeFlagBitsKHX bits ) + VULKAN_HPP_INLINE DeviceGroupPresentModeFlagsKHR operator~( DeviceGroupPresentModeFlagBitsKHR bits ) { - return ~( DeviceGroupPresentModeFlagsKHX( bits ) ); + return ~( DeviceGroupPresentModeFlagsKHR( bits ) ); } - template <> struct FlagTraits + template <> struct FlagTraits { enum { - allFlags = VkFlags(DeviceGroupPresentModeFlagBitsKHX::eLocal) | VkFlags(DeviceGroupPresentModeFlagBitsKHX::eRemote) | VkFlags(DeviceGroupPresentModeFlagBitsKHX::eSum) | VkFlags(DeviceGroupPresentModeFlagBitsKHX::eLocalMultiDevice) + allFlags = VkFlags(DeviceGroupPresentModeFlagBitsKHR::eLocal) | VkFlags(DeviceGroupPresentModeFlagBitsKHR::eRemote) | VkFlags(DeviceGroupPresentModeFlagBitsKHR::eSum) | VkFlags(DeviceGroupPresentModeFlagBitsKHR::eLocalMultiDevice) }; }; - struct DeviceGroupPresentCapabilitiesKHX + struct DeviceGroupPresentCapabilitiesKHR { - operator const VkDeviceGroupPresentCapabilitiesKHX&() const + operator const VkDeviceGroupPresentCapabilitiesKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DeviceGroupPresentCapabilitiesKHX const& rhs ) const + bool operator==( DeviceGroupPresentCapabilitiesKHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( memcmp( presentMask, rhs.presentMask, VK_MAX_DEVICE_GROUP_SIZE_KHX * sizeof( uint32_t ) ) == 0 ) + && ( memcmp( presentMask, rhs.presentMask, VK_MAX_DEVICE_GROUP_SIZE * sizeof( uint32_t ) ) == 0 ) && ( modes == rhs.modes ); } - bool operator!=( DeviceGroupPresentCapabilitiesKHX const& rhs ) const + bool operator!=( DeviceGroupPresentCapabilitiesKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDeviceGroupPresentCapabilitiesKHR; public: - const void* pNext; - uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE_KHX]; - DeviceGroupPresentModeFlagsKHX modes; + const void* pNext = nullptr; + uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE]; + DeviceGroupPresentModeFlagsKHR modes; }; - static_assert( sizeof( DeviceGroupPresentCapabilitiesKHX ) == sizeof( VkDeviceGroupPresentCapabilitiesKHX ), "struct and wrapper have different size!" ); + static_assert( sizeof( DeviceGroupPresentCapabilitiesKHR ) == sizeof( VkDeviceGroupPresentCapabilitiesKHR ), "struct and wrapper have different size!" ); - struct DeviceGroupPresentInfoKHX + struct DeviceGroupPresentInfoKHR { - DeviceGroupPresentInfoKHX( uint32_t swapchainCount_ = 0, const uint32_t* pDeviceMasks_ = nullptr, DeviceGroupPresentModeFlagBitsKHX mode_ = DeviceGroupPresentModeFlagBitsKHX::eLocal ) - : sType( StructureType::eDeviceGroupPresentInfoKHX ) - , pNext( nullptr ) - , swapchainCount( swapchainCount_ ) + DeviceGroupPresentInfoKHR( uint32_t swapchainCount_ = 0, const uint32_t* pDeviceMasks_ = nullptr, DeviceGroupPresentModeFlagBitsKHR mode_ = DeviceGroupPresentModeFlagBitsKHR::eLocal ) + : swapchainCount( swapchainCount_ ) , pDeviceMasks( pDeviceMasks_ ) , mode( mode_ ) { } - DeviceGroupPresentInfoKHX( VkDeviceGroupPresentInfoKHX const & rhs ) + DeviceGroupPresentInfoKHR( VkDeviceGroupPresentInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceGroupPresentInfoKHX ) ); + memcpy( this, &rhs, sizeof( DeviceGroupPresentInfoKHR ) ); } - DeviceGroupPresentInfoKHX& operator=( VkDeviceGroupPresentInfoKHX const & rhs ) + DeviceGroupPresentInfoKHR& operator=( VkDeviceGroupPresentInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceGroupPresentInfoKHX ) ); + memcpy( this, &rhs, sizeof( DeviceGroupPresentInfoKHR ) ); return *this; } - DeviceGroupPresentInfoKHX& setPNext( const void* pNext_ ) + DeviceGroupPresentInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - DeviceGroupPresentInfoKHX& setSwapchainCount( uint32_t swapchainCount_ ) + DeviceGroupPresentInfoKHR& setSwapchainCount( uint32_t swapchainCount_ ) { swapchainCount = swapchainCount_; return *this; } - DeviceGroupPresentInfoKHX& setPDeviceMasks( const uint32_t* pDeviceMasks_ ) + DeviceGroupPresentInfoKHR& setPDeviceMasks( const uint32_t* pDeviceMasks_ ) { pDeviceMasks = pDeviceMasks_; return *this; } - DeviceGroupPresentInfoKHX& setMode( DeviceGroupPresentModeFlagBitsKHX mode_ ) + DeviceGroupPresentInfoKHR& setMode( DeviceGroupPresentModeFlagBitsKHR mode_ ) { mode = mode_; return *this; } - operator const VkDeviceGroupPresentInfoKHX&() const + operator const VkDeviceGroupPresentInfoKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DeviceGroupPresentInfoKHX const& rhs ) const + bool operator==( DeviceGroupPresentInfoKHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) @@ -24358,82 +27814,81 @@ && ( mode == rhs.mode ); } - bool operator!=( DeviceGroupPresentInfoKHX const& rhs ) const + bool operator!=( DeviceGroupPresentInfoKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDeviceGroupPresentInfoKHR; public: - const void* pNext; + const void* pNext = nullptr; uint32_t swapchainCount; const uint32_t* pDeviceMasks; - DeviceGroupPresentModeFlagBitsKHX mode; + DeviceGroupPresentModeFlagBitsKHR mode; }; - static_assert( sizeof( DeviceGroupPresentInfoKHX ) == sizeof( VkDeviceGroupPresentInfoKHX ), "struct and wrapper have different size!" ); + static_assert( sizeof( DeviceGroupPresentInfoKHR ) == sizeof( VkDeviceGroupPresentInfoKHR ), "struct and wrapper have different size!" ); - struct DeviceGroupSwapchainCreateInfoKHX + struct DeviceGroupSwapchainCreateInfoKHR { - DeviceGroupSwapchainCreateInfoKHX( DeviceGroupPresentModeFlagsKHX modes_ = DeviceGroupPresentModeFlagsKHX() ) - : sType( StructureType::eDeviceGroupSwapchainCreateInfoKHX ) - , pNext( nullptr ) - , modes( modes_ ) + DeviceGroupSwapchainCreateInfoKHR( DeviceGroupPresentModeFlagsKHR modes_ = DeviceGroupPresentModeFlagsKHR() ) + : modes( modes_ ) { } - DeviceGroupSwapchainCreateInfoKHX( VkDeviceGroupSwapchainCreateInfoKHX const & rhs ) + DeviceGroupSwapchainCreateInfoKHR( VkDeviceGroupSwapchainCreateInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceGroupSwapchainCreateInfoKHX ) ); + memcpy( this, &rhs, sizeof( DeviceGroupSwapchainCreateInfoKHR ) ); } - DeviceGroupSwapchainCreateInfoKHX& operator=( VkDeviceGroupSwapchainCreateInfoKHX const & rhs ) + DeviceGroupSwapchainCreateInfoKHR& operator=( VkDeviceGroupSwapchainCreateInfoKHR const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceGroupSwapchainCreateInfoKHX ) ); + memcpy( this, &rhs, sizeof( DeviceGroupSwapchainCreateInfoKHR ) ); return *this; } - DeviceGroupSwapchainCreateInfoKHX& setPNext( const void* pNext_ ) + DeviceGroupSwapchainCreateInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - DeviceGroupSwapchainCreateInfoKHX& setModes( DeviceGroupPresentModeFlagsKHX modes_ ) + DeviceGroupSwapchainCreateInfoKHR& setModes( DeviceGroupPresentModeFlagsKHR modes_ ) { modes = modes_; return *this; } - operator const VkDeviceGroupSwapchainCreateInfoKHX&() const + operator const VkDeviceGroupSwapchainCreateInfoKHR&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DeviceGroupSwapchainCreateInfoKHX const& rhs ) const + bool operator==( DeviceGroupSwapchainCreateInfoKHR const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( modes == rhs.modes ); } - bool operator!=( DeviceGroupSwapchainCreateInfoKHX const& rhs ) const + bool operator!=( DeviceGroupSwapchainCreateInfoKHR const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDeviceGroupSwapchainCreateInfoKHR; public: - const void* pNext; - DeviceGroupPresentModeFlagsKHX modes; + const void* pNext = nullptr; + DeviceGroupPresentModeFlagsKHR modes; }; - static_assert( sizeof( DeviceGroupSwapchainCreateInfoKHX ) == sizeof( VkDeviceGroupSwapchainCreateInfoKHX ), "struct and wrapper have different size!" ); + static_assert( sizeof( DeviceGroupSwapchainCreateInfoKHR ) == sizeof( VkDeviceGroupSwapchainCreateInfoKHR ), "struct and wrapper have different size!" ); enum class SwapchainCreateFlagBitsKHR { - eBindSfrKHX = VK_SWAPCHAIN_CREATE_BIND_SFR_BIT_KHX + eSplitInstanceBindRegions = VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR, + eProtected = VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR }; using SwapchainCreateFlagsKHR = Flags; @@ -24452,16 +27907,14 @@ { enum { - allFlags = VkFlags(SwapchainCreateFlagBitsKHR::eBindSfrKHX) + allFlags = VkFlags(SwapchainCreateFlagBitsKHR::eSplitInstanceBindRegions) | VkFlags(SwapchainCreateFlagBitsKHR::eProtected) }; }; struct SwapchainCreateInfoKHR { SwapchainCreateInfoKHR( SwapchainCreateFlagsKHR flags_ = SwapchainCreateFlagsKHR(), SurfaceKHR surface_ = SurfaceKHR(), uint32_t minImageCount_ = 0, Format imageFormat_ = Format::eUndefined, ColorSpaceKHR imageColorSpace_ = ColorSpaceKHR::eSrgbNonlinear, Extent2D imageExtent_ = Extent2D(), uint32_t imageArrayLayers_ = 0, ImageUsageFlags imageUsage_ = ImageUsageFlags(), SharingMode imageSharingMode_ = SharingMode::eExclusive, uint32_t queueFamilyIndexCount_ = 0, const uint32_t* pQueueFamilyIndices_ = nullptr, SurfaceTransformFlagBitsKHR preTransform_ = SurfaceTransformFlagBitsKHR::eIdentity, CompositeAlphaFlagBitsKHR compositeAlpha_ = CompositeAlphaFlagBitsKHR::eOpaque, PresentModeKHR presentMode_ = PresentModeKHR::eImmediate, Bool32 clipped_ = 0, SwapchainKHR oldSwapchain_ = SwapchainKHR() ) - : sType( StructureType::eSwapchainCreateInfoKHR ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , surface( surface_ ) , minImageCount( minImageCount_ ) , imageFormat( imageFormat_ ) @@ -24625,10 +28078,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eSwapchainCreateInfoKHR; public: - const void* pNext; + const void* pNext = nullptr; SwapchainCreateFlagsKHR flags; SurfaceKHR surface; uint32_t minImageCount; @@ -24732,9 +28185,7 @@ struct PipelineViewportSwizzleStateCreateInfoNV { PipelineViewportSwizzleStateCreateInfoNV( PipelineViewportSwizzleStateCreateFlagsNV flags_ = PipelineViewportSwizzleStateCreateFlagsNV(), uint32_t viewportCount_ = 0, const ViewportSwizzleNV* pViewportSwizzles_ = nullptr ) - : sType( StructureType::ePipelineViewportSwizzleStateCreateInfoNV ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , viewportCount( viewportCount_ ) , pViewportSwizzles( pViewportSwizzles_ ) { @@ -24794,10 +28245,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::ePipelineViewportSwizzleStateCreateInfoNV; public: - const void* pNext; + const void* pNext = nullptr; PipelineViewportSwizzleStateCreateFlagsNV flags; uint32_t viewportCount; const ViewportSwizzleNV* pViewportSwizzles; @@ -24813,9 +28264,7 @@ struct PipelineDiscardRectangleStateCreateInfoEXT { PipelineDiscardRectangleStateCreateInfoEXT( PipelineDiscardRectangleStateCreateFlagsEXT flags_ = PipelineDiscardRectangleStateCreateFlagsEXT(), DiscardRectangleModeEXT discardRectangleMode_ = DiscardRectangleModeEXT::eInclusive, uint32_t discardRectangleCount_ = 0, const Rect2D* pDiscardRectangles_ = nullptr ) - : sType( StructureType::ePipelineDiscardRectangleStateCreateInfoEXT ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , discardRectangleMode( discardRectangleMode_ ) , discardRectangleCount( discardRectangleCount_ ) , pDiscardRectangles( pDiscardRectangles_ ) @@ -24883,10 +28332,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::ePipelineDiscardRectangleStateCreateInfoEXT; public: - const void* pNext; + const void* pNext = nullptr; PipelineDiscardRectangleStateCreateFlagsEXT flags; DiscardRectangleModeEXT discardRectangleMode; uint32_t discardRectangleCount; @@ -25046,9 +28495,7 @@ struct RenderPassCreateInfo { RenderPassCreateInfo( RenderPassCreateFlags flags_ = RenderPassCreateFlags(), uint32_t attachmentCount_ = 0, const AttachmentDescription* pAttachments_ = nullptr, uint32_t subpassCount_ = 0, const SubpassDescription* pSubpasses_ = nullptr, uint32_t dependencyCount_ = 0, const SubpassDependency* pDependencies_ = nullptr ) - : sType( StructureType::eRenderPassCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , attachmentCount( attachmentCount_ ) , pAttachments( pAttachments_ ) , subpassCount( subpassCount_ ) @@ -25140,10 +28587,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eRenderPassCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; RenderPassCreateFlags flags; uint32_t attachmentCount; const AttachmentDescription* pAttachments; @@ -25154,39 +28601,43 @@ }; static_assert( sizeof( RenderPassCreateInfo ) == sizeof( VkRenderPassCreateInfo ), "struct and wrapper have different size!" ); - enum class PointClippingBehaviorKHR + enum class PointClippingBehavior { - eAllClipPlanes = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES_KHR, - eUserClipPlanesOnly = VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY_KHR + eAllClipPlanes = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES, + eAllClipPlanesKHR = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES, + eUserClipPlanesOnly = VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY, + eUserClipPlanesOnlyKHR = VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY }; - struct PhysicalDevicePointClippingPropertiesKHR + struct PhysicalDevicePointClippingProperties { - operator const VkPhysicalDevicePointClippingPropertiesKHR&() const + operator const VkPhysicalDevicePointClippingProperties&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDevicePointClippingPropertiesKHR const& rhs ) const + bool operator==( PhysicalDevicePointClippingProperties const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pointClippingBehavior == rhs.pointClippingBehavior ); } - bool operator!=( PhysicalDevicePointClippingPropertiesKHR const& rhs ) const + bool operator!=( PhysicalDevicePointClippingProperties const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDevicePointClippingProperties; public: - void* pNext; - PointClippingBehaviorKHR pointClippingBehavior; + void* pNext = nullptr; + PointClippingBehavior pointClippingBehavior; }; - static_assert( sizeof( PhysicalDevicePointClippingPropertiesKHR ) == sizeof( VkPhysicalDevicePointClippingPropertiesKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDevicePointClippingProperties ) == sizeof( VkPhysicalDevicePointClippingProperties ), "struct and wrapper have different size!" ); + + using PhysicalDevicePointClippingPropertiesKHR = PhysicalDevicePointClippingProperties; enum class SamplerReductionModeEXT { @@ -25198,9 +28649,7 @@ struct SamplerReductionModeCreateInfoEXT { SamplerReductionModeCreateInfoEXT( SamplerReductionModeEXT reductionMode_ = SamplerReductionModeEXT::eWeightedAverage ) - : sType( StructureType::eSamplerReductionModeCreateInfoEXT ) - , pNext( nullptr ) - , reductionMode( reductionMode_ ) + : reductionMode( reductionMode_ ) { } @@ -25244,104 +28693,113 @@ } private: - StructureType sType; + StructureType sType = StructureType::eSamplerReductionModeCreateInfoEXT; public: - const void* pNext; + const void* pNext = nullptr; SamplerReductionModeEXT reductionMode; }; static_assert( sizeof( SamplerReductionModeCreateInfoEXT ) == sizeof( VkSamplerReductionModeCreateInfoEXT ), "struct and wrapper have different size!" ); - enum class TessellationDomainOriginKHR + enum class TessellationDomainOrigin { - eUpperLeft = VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT_KHR, - eLowerLeft = VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT_KHR + eUpperLeft = VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT, + eUpperLeftKHR = VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT, + eLowerLeft = VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT, + eLowerLeftKHR = VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT }; - struct PipelineTessellationDomainOriginStateCreateInfoKHR + struct PipelineTessellationDomainOriginStateCreateInfo { - PipelineTessellationDomainOriginStateCreateInfoKHR( TessellationDomainOriginKHR domainOrigin_ = TessellationDomainOriginKHR::eUpperLeft ) - : sType( StructureType::ePipelineTessellationDomainOriginStateCreateInfoKHR ) - , pNext( nullptr ) - , domainOrigin( domainOrigin_ ) + PipelineTessellationDomainOriginStateCreateInfo( TessellationDomainOrigin domainOrigin_ = TessellationDomainOrigin::eUpperLeft ) + : domainOrigin( domainOrigin_ ) { } - PipelineTessellationDomainOriginStateCreateInfoKHR( VkPipelineTessellationDomainOriginStateCreateInfoKHR const & rhs ) + PipelineTessellationDomainOriginStateCreateInfo( VkPipelineTessellationDomainOriginStateCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineTessellationDomainOriginStateCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( PipelineTessellationDomainOriginStateCreateInfo ) ); } - PipelineTessellationDomainOriginStateCreateInfoKHR& operator=( VkPipelineTessellationDomainOriginStateCreateInfoKHR const & rhs ) + PipelineTessellationDomainOriginStateCreateInfo& operator=( VkPipelineTessellationDomainOriginStateCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( PipelineTessellationDomainOriginStateCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( PipelineTessellationDomainOriginStateCreateInfo ) ); return *this; } - PipelineTessellationDomainOriginStateCreateInfoKHR& setPNext( const void* pNext_ ) + PipelineTessellationDomainOriginStateCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - PipelineTessellationDomainOriginStateCreateInfoKHR& setDomainOrigin( TessellationDomainOriginKHR domainOrigin_ ) + PipelineTessellationDomainOriginStateCreateInfo& setDomainOrigin( TessellationDomainOrigin domainOrigin_ ) { domainOrigin = domainOrigin_; return *this; } - operator const VkPipelineTessellationDomainOriginStateCreateInfoKHR&() const + operator const VkPipelineTessellationDomainOriginStateCreateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PipelineTessellationDomainOriginStateCreateInfoKHR const& rhs ) const + bool operator==( PipelineTessellationDomainOriginStateCreateInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( domainOrigin == rhs.domainOrigin ); } - bool operator!=( PipelineTessellationDomainOriginStateCreateInfoKHR const& rhs ) const + bool operator!=( PipelineTessellationDomainOriginStateCreateInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePipelineTessellationDomainOriginStateCreateInfo; public: - const void* pNext; - TessellationDomainOriginKHR domainOrigin; + const void* pNext = nullptr; + TessellationDomainOrigin domainOrigin; }; - static_assert( sizeof( PipelineTessellationDomainOriginStateCreateInfoKHR ) == sizeof( VkPipelineTessellationDomainOriginStateCreateInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( PipelineTessellationDomainOriginStateCreateInfo ) == sizeof( VkPipelineTessellationDomainOriginStateCreateInfo ), "struct and wrapper have different size!" ); - enum class SamplerYcbcrModelConversionKHR + using PipelineTessellationDomainOriginStateCreateInfoKHR = PipelineTessellationDomainOriginStateCreateInfo; + + enum class SamplerYcbcrModelConversion { - eRgbIdentity = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR, - eYcbcrIdentity = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY_KHR, - eYcbcr709 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR, - eYcbcr601 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR, - eYcbcr2020 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR + eRgbIdentity = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY, + eRgbIdentityKHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY, + eYcbcrIdentity = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY, + eYcbcrIdentityKHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY, + eYcbcr709 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709, + eYcbcr709KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709, + eYcbcr601 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601, + eYcbcr601KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601, + eYcbcr2020 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020, + eYcbcr2020KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020 }; - enum class SamplerYcbcrRangeKHR + enum class SamplerYcbcrRange { - eItuFull = VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR, - eItuNarrow = VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR + eItuFull = VK_SAMPLER_YCBCR_RANGE_ITU_FULL, + eItuFullKHR = VK_SAMPLER_YCBCR_RANGE_ITU_FULL, + eItuNarrow = VK_SAMPLER_YCBCR_RANGE_ITU_NARROW, + eItuNarrowKHR = VK_SAMPLER_YCBCR_RANGE_ITU_NARROW }; - enum class ChromaLocationKHR + enum class ChromaLocation { - eCositedEven = VK_CHROMA_LOCATION_COSITED_EVEN_KHR, - eMidpoint = VK_CHROMA_LOCATION_MIDPOINT_KHR + eCositedEven = VK_CHROMA_LOCATION_COSITED_EVEN, + eCositedEvenKHR = VK_CHROMA_LOCATION_COSITED_EVEN, + eMidpoint = VK_CHROMA_LOCATION_MIDPOINT, + eMidpointKHR = VK_CHROMA_LOCATION_MIDPOINT }; - struct SamplerYcbcrConversionCreateInfoKHR + struct SamplerYcbcrConversionCreateInfo { - SamplerYcbcrConversionCreateInfoKHR( Format format_ = Format::eUndefined, SamplerYcbcrModelConversionKHR ycbcrModel_ = SamplerYcbcrModelConversionKHR::eRgbIdentity, SamplerYcbcrRangeKHR ycbcrRange_ = SamplerYcbcrRangeKHR::eItuFull, ComponentMapping components_ = ComponentMapping(), ChromaLocationKHR xChromaOffset_ = ChromaLocationKHR::eCositedEven, ChromaLocationKHR yChromaOffset_ = ChromaLocationKHR::eCositedEven, Filter chromaFilter_ = Filter::eNearest, Bool32 forceExplicitReconstruction_ = 0 ) - : sType( StructureType::eSamplerYcbcrConversionCreateInfoKHR ) - , pNext( nullptr ) - , format( format_ ) + SamplerYcbcrConversionCreateInfo( Format format_ = Format::eUndefined, SamplerYcbcrModelConversion ycbcrModel_ = SamplerYcbcrModelConversion::eRgbIdentity, SamplerYcbcrRange ycbcrRange_ = SamplerYcbcrRange::eItuFull, ComponentMapping components_ = ComponentMapping(), ChromaLocation xChromaOffset_ = ChromaLocation::eCositedEven, ChromaLocation yChromaOffset_ = ChromaLocation::eCositedEven, Filter chromaFilter_ = Filter::eNearest, Bool32 forceExplicitReconstruction_ = 0 ) + : format( format_ ) , ycbcrModel( ycbcrModel_ ) , ycbcrRange( ycbcrRange_ ) , components( components_ ) @@ -25352,76 +28810,76 @@ { } - SamplerYcbcrConversionCreateInfoKHR( VkSamplerYcbcrConversionCreateInfoKHR const & rhs ) + SamplerYcbcrConversionCreateInfo( VkSamplerYcbcrConversionCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( SamplerYcbcrConversionCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( SamplerYcbcrConversionCreateInfo ) ); } - SamplerYcbcrConversionCreateInfoKHR& operator=( VkSamplerYcbcrConversionCreateInfoKHR const & rhs ) + SamplerYcbcrConversionCreateInfo& operator=( VkSamplerYcbcrConversionCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( SamplerYcbcrConversionCreateInfoKHR ) ); + memcpy( this, &rhs, sizeof( SamplerYcbcrConversionCreateInfo ) ); return *this; } - SamplerYcbcrConversionCreateInfoKHR& setPNext( const void* pNext_ ) + SamplerYcbcrConversionCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - SamplerYcbcrConversionCreateInfoKHR& setFormat( Format format_ ) + SamplerYcbcrConversionCreateInfo& setFormat( Format format_ ) { format = format_; return *this; } - SamplerYcbcrConversionCreateInfoKHR& setYcbcrModel( SamplerYcbcrModelConversionKHR ycbcrModel_ ) + SamplerYcbcrConversionCreateInfo& setYcbcrModel( SamplerYcbcrModelConversion ycbcrModel_ ) { ycbcrModel = ycbcrModel_; return *this; } - SamplerYcbcrConversionCreateInfoKHR& setYcbcrRange( SamplerYcbcrRangeKHR ycbcrRange_ ) + SamplerYcbcrConversionCreateInfo& setYcbcrRange( SamplerYcbcrRange ycbcrRange_ ) { ycbcrRange = ycbcrRange_; return *this; } - SamplerYcbcrConversionCreateInfoKHR& setComponents( ComponentMapping components_ ) + SamplerYcbcrConversionCreateInfo& setComponents( ComponentMapping components_ ) { components = components_; return *this; } - SamplerYcbcrConversionCreateInfoKHR& setXChromaOffset( ChromaLocationKHR xChromaOffset_ ) + SamplerYcbcrConversionCreateInfo& setXChromaOffset( ChromaLocation xChromaOffset_ ) { xChromaOffset = xChromaOffset_; return *this; } - SamplerYcbcrConversionCreateInfoKHR& setYChromaOffset( ChromaLocationKHR yChromaOffset_ ) + SamplerYcbcrConversionCreateInfo& setYChromaOffset( ChromaLocation yChromaOffset_ ) { yChromaOffset = yChromaOffset_; return *this; } - SamplerYcbcrConversionCreateInfoKHR& setChromaFilter( Filter chromaFilter_ ) + SamplerYcbcrConversionCreateInfo& setChromaFilter( Filter chromaFilter_ ) { chromaFilter = chromaFilter_; return *this; } - SamplerYcbcrConversionCreateInfoKHR& setForceExplicitReconstruction( Bool32 forceExplicitReconstruction_ ) + SamplerYcbcrConversionCreateInfo& setForceExplicitReconstruction( Bool32 forceExplicitReconstruction_ ) { forceExplicitReconstruction = forceExplicitReconstruction_; return *this; } - operator const VkSamplerYcbcrConversionCreateInfoKHR&() const + operator const VkSamplerYcbcrConversionCreateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( SamplerYcbcrConversionCreateInfoKHR const& rhs ) const + bool operator==( SamplerYcbcrConversionCreateInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) @@ -25435,26 +28893,72 @@ && ( forceExplicitReconstruction == rhs.forceExplicitReconstruction ); } - bool operator!=( SamplerYcbcrConversionCreateInfoKHR const& rhs ) const + bool operator!=( SamplerYcbcrConversionCreateInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eSamplerYcbcrConversionCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; Format format; - SamplerYcbcrModelConversionKHR ycbcrModel; - SamplerYcbcrRangeKHR ycbcrRange; + SamplerYcbcrModelConversion ycbcrModel; + SamplerYcbcrRange ycbcrRange; ComponentMapping components; - ChromaLocationKHR xChromaOffset; - ChromaLocationKHR yChromaOffset; + ChromaLocation xChromaOffset; + ChromaLocation yChromaOffset; Filter chromaFilter; Bool32 forceExplicitReconstruction; }; - static_assert( sizeof( SamplerYcbcrConversionCreateInfoKHR ) == sizeof( VkSamplerYcbcrConversionCreateInfoKHR ), "struct and wrapper have different size!" ); + static_assert( sizeof( SamplerYcbcrConversionCreateInfo ) == sizeof( VkSamplerYcbcrConversionCreateInfo ), "struct and wrapper have different size!" ); + + using SamplerYcbcrConversionCreateInfoKHR = SamplerYcbcrConversionCreateInfo; + +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + struct AndroidHardwareBufferFormatPropertiesANDROID + { + operator const VkAndroidHardwareBufferFormatPropertiesANDROID&() const + { + return *reinterpret_cast(this); + } + + bool operator==( AndroidHardwareBufferFormatPropertiesANDROID const& rhs ) const + { + 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 ); + } + + bool operator!=( AndroidHardwareBufferFormatPropertiesANDROID const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType = StructureType::eAndroidHardwareBufferFormatPropertiesANDROID; + + public: + void* pNext = nullptr; + Format format; + uint64_t externalFormat; + FormatFeatureFlags formatFeatures; + ComponentMapping samplerYcbcrConversionComponents; + SamplerYcbcrModelConversion suggestedYcbcrModel; + SamplerYcbcrRange suggestedYcbcrRange; + ChromaLocation suggestedXChromaOffset; + ChromaLocation suggestedYChromaOffset; + }; + static_assert( sizeof( AndroidHardwareBufferFormatPropertiesANDROID ) == sizeof( VkAndroidHardwareBufferFormatPropertiesANDROID ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ enum class BlendOverlapEXT { @@ -25466,9 +28970,7 @@ struct PipelineColorBlendAdvancedStateCreateInfoEXT { PipelineColorBlendAdvancedStateCreateInfoEXT( Bool32 srcPremultiplied_ = 0, Bool32 dstPremultiplied_ = 0, BlendOverlapEXT blendOverlap_ = BlendOverlapEXT::eUncorrelated ) - : sType( StructureType::ePipelineColorBlendAdvancedStateCreateInfoEXT ) - , pNext( nullptr ) - , srcPremultiplied( srcPremultiplied_ ) + : srcPremultiplied( srcPremultiplied_ ) , dstPremultiplied( dstPremultiplied_ ) , blendOverlap( blendOverlap_ ) { @@ -25528,10 +29030,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::ePipelineColorBlendAdvancedStateCreateInfoEXT; public: - const void* pNext; + const void* pNext = nullptr; Bool32 srcPremultiplied; Bool32 dstPremultiplied; BlendOverlapEXT blendOverlap; @@ -25549,9 +29051,7 @@ struct PipelineCoverageModulationStateCreateInfoNV { PipelineCoverageModulationStateCreateInfoNV( PipelineCoverageModulationStateCreateFlagsNV flags_ = PipelineCoverageModulationStateCreateFlagsNV(), CoverageModulationModeNV coverageModulationMode_ = CoverageModulationModeNV::eNone, Bool32 coverageModulationTableEnable_ = 0, uint32_t coverageModulationTableCount_ = 0, const float* pCoverageModulationTable_ = nullptr ) - : sType( StructureType::ePipelineCoverageModulationStateCreateInfoNV ) - , pNext( nullptr ) - , flags( flags_ ) + : flags( flags_ ) , coverageModulationMode( coverageModulationMode_ ) , coverageModulationTableEnable( coverageModulationTableEnable_ ) , coverageModulationTableCount( coverageModulationTableCount_ ) @@ -25627,10 +29127,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::ePipelineCoverageModulationStateCreateInfoNV; public: - const void* pNext; + const void* pNext = nullptr; PipelineCoverageModulationStateCreateFlagsNV flags; CoverageModulationModeNV coverageModulationMode; Bool32 coverageModulationTableEnable; @@ -25651,133 +29151,476 @@ eDisassembly = VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD }; - enum class QueueGlobalPriorityEXT + enum class QueueGlobalPriorityEXT + { + eLow = VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT, + eMedium = VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT, + eHigh = VK_QUEUE_GLOBAL_PRIORITY_HIGH_EXT, + eRealtime = VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT + }; + + struct DeviceQueueGlobalPriorityCreateInfoEXT + { + DeviceQueueGlobalPriorityCreateInfoEXT( QueueGlobalPriorityEXT globalPriority_ = QueueGlobalPriorityEXT::eLow ) + : globalPriority( globalPriority_ ) + { + } + + DeviceQueueGlobalPriorityCreateInfoEXT( VkDeviceQueueGlobalPriorityCreateInfoEXT const & rhs ) + { + memcpy( this, &rhs, sizeof( DeviceQueueGlobalPriorityCreateInfoEXT ) ); + } + + DeviceQueueGlobalPriorityCreateInfoEXT& operator=( VkDeviceQueueGlobalPriorityCreateInfoEXT const & rhs ) + { + memcpy( this, &rhs, sizeof( DeviceQueueGlobalPriorityCreateInfoEXT ) ); + return *this; + } + DeviceQueueGlobalPriorityCreateInfoEXT& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DeviceQueueGlobalPriorityCreateInfoEXT& setGlobalPriority( QueueGlobalPriorityEXT globalPriority_ ) + { + globalPriority = globalPriority_; + return *this; + } + + operator const VkDeviceQueueGlobalPriorityCreateInfoEXT&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DeviceQueueGlobalPriorityCreateInfoEXT const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( globalPriority == rhs.globalPriority ); + } + + bool operator!=( DeviceQueueGlobalPriorityCreateInfoEXT const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType = StructureType::eDeviceQueueGlobalPriorityCreateInfoEXT; + + public: + const void* pNext = nullptr; + QueueGlobalPriorityEXT globalPriority; + }; + static_assert( sizeof( DeviceQueueGlobalPriorityCreateInfoEXT ) == sizeof( VkDeviceQueueGlobalPriorityCreateInfoEXT ), "struct and wrapper have different size!" ); + + enum class DebugUtilsMessageSeverityFlagBitsEXT + { + 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 + }; + + using DebugUtilsMessageSeverityFlagsEXT = Flags; + + VULKAN_HPP_INLINE DebugUtilsMessageSeverityFlagsEXT operator|( DebugUtilsMessageSeverityFlagBitsEXT bit0, DebugUtilsMessageSeverityFlagBitsEXT bit1 ) + { + return DebugUtilsMessageSeverityFlagsEXT( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE DebugUtilsMessageSeverityFlagsEXT operator~( DebugUtilsMessageSeverityFlagBitsEXT bits ) + { + return ~( DebugUtilsMessageSeverityFlagsEXT( bits ) ); + } + + template <> struct FlagTraits + { + enum + { + allFlags = VkFlags(DebugUtilsMessageSeverityFlagBitsEXT::eVerbose) | VkFlags(DebugUtilsMessageSeverityFlagBitsEXT::eInfo) | VkFlags(DebugUtilsMessageSeverityFlagBitsEXT::eWarning) | VkFlags(DebugUtilsMessageSeverityFlagBitsEXT::eError) + }; + }; + + enum class DebugUtilsMessageTypeFlagBitsEXT + { + 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 + }; + + using DebugUtilsMessageTypeFlagsEXT = Flags; + + VULKAN_HPP_INLINE DebugUtilsMessageTypeFlagsEXT operator|( DebugUtilsMessageTypeFlagBitsEXT bit0, DebugUtilsMessageTypeFlagBitsEXT bit1 ) + { + return DebugUtilsMessageTypeFlagsEXT( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE DebugUtilsMessageTypeFlagsEXT operator~( DebugUtilsMessageTypeFlagBitsEXT bits ) + { + return ~( DebugUtilsMessageTypeFlagsEXT( bits ) ); + } + + template <> struct FlagTraits + { + enum + { + allFlags = VkFlags(DebugUtilsMessageTypeFlagBitsEXT::eGeneral) | VkFlags(DebugUtilsMessageTypeFlagBitsEXT::eValidation) | VkFlags(DebugUtilsMessageTypeFlagBitsEXT::ePerformance) + }; + }; + + struct DebugUtilsMessengerCreateInfoEXT + { + DebugUtilsMessengerCreateInfoEXT( DebugUtilsMessengerCreateFlagsEXT flags_ = DebugUtilsMessengerCreateFlagsEXT(), DebugUtilsMessageSeverityFlagsEXT messageSeverity_ = DebugUtilsMessageSeverityFlagsEXT(), DebugUtilsMessageTypeFlagsEXT messageType_ = DebugUtilsMessageTypeFlagsEXT(), PFN_vkDebugUtilsMessengerCallbackEXT pfnUserCallback_ = nullptr, void* pUserData_ = nullptr ) + : flags( flags_ ) + , messageSeverity( messageSeverity_ ) + , messageType( messageType_ ) + , pfnUserCallback( pfnUserCallback_ ) + , pUserData( pUserData_ ) + { + } + + DebugUtilsMessengerCreateInfoEXT( VkDebugUtilsMessengerCreateInfoEXT const & rhs ) + { + memcpy( this, &rhs, sizeof( DebugUtilsMessengerCreateInfoEXT ) ); + } + + DebugUtilsMessengerCreateInfoEXT& operator=( VkDebugUtilsMessengerCreateInfoEXT const & rhs ) + { + memcpy( this, &rhs, sizeof( DebugUtilsMessengerCreateInfoEXT ) ); + return *this; + } + DebugUtilsMessengerCreateInfoEXT& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DebugUtilsMessengerCreateInfoEXT& setFlags( DebugUtilsMessengerCreateFlagsEXT flags_ ) + { + flags = flags_; + return *this; + } + + DebugUtilsMessengerCreateInfoEXT& setMessageSeverity( DebugUtilsMessageSeverityFlagsEXT messageSeverity_ ) + { + messageSeverity = messageSeverity_; + return *this; + } + + DebugUtilsMessengerCreateInfoEXT& setMessageType( DebugUtilsMessageTypeFlagsEXT messageType_ ) + { + messageType = messageType_; + return *this; + } + + DebugUtilsMessengerCreateInfoEXT& setPfnUserCallback( PFN_vkDebugUtilsMessengerCallbackEXT pfnUserCallback_ ) + { + pfnUserCallback = pfnUserCallback_; + return *this; + } + + DebugUtilsMessengerCreateInfoEXT& setPUserData( void* pUserData_ ) + { + pUserData = pUserData_; + return *this; + } + + operator const VkDebugUtilsMessengerCreateInfoEXT&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DebugUtilsMessengerCreateInfoEXT const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( messageSeverity == rhs.messageSeverity ) + && ( messageType == rhs.messageType ) + && ( pfnUserCallback == rhs.pfnUserCallback ) + && ( pUserData == rhs.pUserData ); + } + + bool operator!=( DebugUtilsMessengerCreateInfoEXT const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType = StructureType::eDebugUtilsMessengerCreateInfoEXT; + + public: + const void* pNext = nullptr; + DebugUtilsMessengerCreateFlagsEXT flags; + DebugUtilsMessageSeverityFlagsEXT messageSeverity; + DebugUtilsMessageTypeFlagsEXT messageType; + PFN_vkDebugUtilsMessengerCallbackEXT pfnUserCallback; + void* pUserData; + }; + static_assert( sizeof( DebugUtilsMessengerCreateInfoEXT ) == sizeof( VkDebugUtilsMessengerCreateInfoEXT ), "struct and wrapper have different size!" ); + + enum class ConservativeRasterizationModeEXT + { + eDisabled = VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT, + eOverestimate = VK_CONSERVATIVE_RASTERIZATION_MODE_OVERESTIMATE_EXT, + eUnderestimate = VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT + }; + + struct PipelineRasterizationConservativeStateCreateInfoEXT + { + PipelineRasterizationConservativeStateCreateInfoEXT( PipelineRasterizationConservativeStateCreateFlagsEXT flags_ = PipelineRasterizationConservativeStateCreateFlagsEXT(), ConservativeRasterizationModeEXT conservativeRasterizationMode_ = ConservativeRasterizationModeEXT::eDisabled, float extraPrimitiveOverestimationSize_ = 0 ) + : flags( flags_ ) + , conservativeRasterizationMode( conservativeRasterizationMode_ ) + , extraPrimitiveOverestimationSize( extraPrimitiveOverestimationSize_ ) + { + } + + PipelineRasterizationConservativeStateCreateInfoEXT( VkPipelineRasterizationConservativeStateCreateInfoEXT const & rhs ) + { + memcpy( this, &rhs, sizeof( PipelineRasterizationConservativeStateCreateInfoEXT ) ); + } + + PipelineRasterizationConservativeStateCreateInfoEXT& operator=( VkPipelineRasterizationConservativeStateCreateInfoEXT const & rhs ) + { + memcpy( this, &rhs, sizeof( PipelineRasterizationConservativeStateCreateInfoEXT ) ); + return *this; + } + PipelineRasterizationConservativeStateCreateInfoEXT& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PipelineRasterizationConservativeStateCreateInfoEXT& setFlags( PipelineRasterizationConservativeStateCreateFlagsEXT flags_ ) + { + flags = flags_; + return *this; + } + + PipelineRasterizationConservativeStateCreateInfoEXT& setConservativeRasterizationMode( ConservativeRasterizationModeEXT conservativeRasterizationMode_ ) + { + conservativeRasterizationMode = conservativeRasterizationMode_; + return *this; + } + + PipelineRasterizationConservativeStateCreateInfoEXT& setExtraPrimitiveOverestimationSize( float extraPrimitiveOverestimationSize_ ) + { + extraPrimitiveOverestimationSize = extraPrimitiveOverestimationSize_; + return *this; + } + + operator const VkPipelineRasterizationConservativeStateCreateInfoEXT&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PipelineRasterizationConservativeStateCreateInfoEXT const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( conservativeRasterizationMode == rhs.conservativeRasterizationMode ) + && ( extraPrimitiveOverestimationSize == rhs.extraPrimitiveOverestimationSize ); + } + + bool operator!=( PipelineRasterizationConservativeStateCreateInfoEXT const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType = StructureType::ePipelineRasterizationConservativeStateCreateInfoEXT; + + public: + const void* pNext = nullptr; + PipelineRasterizationConservativeStateCreateFlagsEXT flags; + ConservativeRasterizationModeEXT conservativeRasterizationMode; + float extraPrimitiveOverestimationSize; + }; + static_assert( sizeof( PipelineRasterizationConservativeStateCreateInfoEXT ) == sizeof( VkPipelineRasterizationConservativeStateCreateInfoEXT ), "struct and wrapper have different size!" ); + + enum class DescriptorBindingFlagBitsEXT + { + eUpdateAfterBind = VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT, + eUpdateUnusedWhilePending = VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT, + ePartiallyBound = VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT, + eVariableDescriptorCount = VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT + }; + + using DescriptorBindingFlagsEXT = Flags; + + VULKAN_HPP_INLINE DescriptorBindingFlagsEXT operator|( DescriptorBindingFlagBitsEXT bit0, DescriptorBindingFlagBitsEXT bit1 ) + { + return DescriptorBindingFlagsEXT( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE DescriptorBindingFlagsEXT operator~( DescriptorBindingFlagBitsEXT bits ) + { + return ~( DescriptorBindingFlagsEXT( bits ) ); + } + + template <> struct FlagTraits { - eLow = VK_QUEUE_GLOBAL_PRIORITY_LOW, - eMedium = VK_QUEUE_GLOBAL_PRIORITY_MEDIUM, - eHigh = VK_QUEUE_GLOBAL_PRIORITY_HIGH, - eRealtime = VK_QUEUE_GLOBAL_PRIORITY_REALTIME + enum + { + allFlags = VkFlags(DescriptorBindingFlagBitsEXT::eUpdateAfterBind) | VkFlags(DescriptorBindingFlagBitsEXT::eUpdateUnusedWhilePending) | VkFlags(DescriptorBindingFlagBitsEXT::ePartiallyBound) | VkFlags(DescriptorBindingFlagBitsEXT::eVariableDescriptorCount) + }; }; - struct DeviceQueueGlobalPriorityCreateInfoEXT + struct DescriptorSetLayoutBindingFlagsCreateInfoEXT { - DeviceQueueGlobalPriorityCreateInfoEXT( QueueGlobalPriorityEXT globalPriority_ = QueueGlobalPriorityEXT::eLow ) - : sType( StructureType::eDeviceQueueGlobalPriorityCreateInfoEXT ) - , pNext( nullptr ) - , globalPriority( globalPriority_ ) + DescriptorSetLayoutBindingFlagsCreateInfoEXT( uint32_t bindingCount_ = 0, const DescriptorBindingFlagsEXT* pBindingFlags_ = nullptr ) + : bindingCount( bindingCount_ ) + , pBindingFlags( pBindingFlags_ ) { } - DeviceQueueGlobalPriorityCreateInfoEXT( VkDeviceQueueGlobalPriorityCreateInfoEXT const & rhs ) + DescriptorSetLayoutBindingFlagsCreateInfoEXT( VkDescriptorSetLayoutBindingFlagsCreateInfoEXT const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceQueueGlobalPriorityCreateInfoEXT ) ); + memcpy( this, &rhs, sizeof( DescriptorSetLayoutBindingFlagsCreateInfoEXT ) ); } - DeviceQueueGlobalPriorityCreateInfoEXT& operator=( VkDeviceQueueGlobalPriorityCreateInfoEXT const & rhs ) + DescriptorSetLayoutBindingFlagsCreateInfoEXT& operator=( VkDescriptorSetLayoutBindingFlagsCreateInfoEXT const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceQueueGlobalPriorityCreateInfoEXT ) ); + memcpy( this, &rhs, sizeof( DescriptorSetLayoutBindingFlagsCreateInfoEXT ) ); return *this; } - DeviceQueueGlobalPriorityCreateInfoEXT& setPNext( const void* pNext_ ) + DescriptorSetLayoutBindingFlagsCreateInfoEXT& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - DeviceQueueGlobalPriorityCreateInfoEXT& setGlobalPriority( QueueGlobalPriorityEXT globalPriority_ ) + DescriptorSetLayoutBindingFlagsCreateInfoEXT& setBindingCount( uint32_t bindingCount_ ) { - globalPriority = globalPriority_; + bindingCount = bindingCount_; return *this; } - operator const VkDeviceQueueGlobalPriorityCreateInfoEXT&() const + DescriptorSetLayoutBindingFlagsCreateInfoEXT& setPBindingFlags( const DescriptorBindingFlagsEXT* pBindingFlags_ ) { - return *reinterpret_cast(this); + pBindingFlags = pBindingFlags_; + return *this; } - bool operator==( DeviceQueueGlobalPriorityCreateInfoEXT const& rhs ) const + operator const VkDescriptorSetLayoutBindingFlagsCreateInfoEXT&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DescriptorSetLayoutBindingFlagsCreateInfoEXT const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( globalPriority == rhs.globalPriority ); + && ( bindingCount == rhs.bindingCount ) + && ( pBindingFlags == rhs.pBindingFlags ); } - bool operator!=( DeviceQueueGlobalPriorityCreateInfoEXT const& rhs ) const + bool operator!=( DescriptorSetLayoutBindingFlagsCreateInfoEXT const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDescriptorSetLayoutBindingFlagsCreateInfoEXT; public: - const void* pNext; - QueueGlobalPriorityEXT globalPriority; + const void* pNext = nullptr; + uint32_t bindingCount; + const DescriptorBindingFlagsEXT* pBindingFlags; }; - static_assert( sizeof( DeviceQueueGlobalPriorityCreateInfoEXT ) == sizeof( VkDeviceQueueGlobalPriorityCreateInfoEXT ), "struct and wrapper have different size!" ); + static_assert( sizeof( DescriptorSetLayoutBindingFlagsCreateInfoEXT ) == sizeof( VkDescriptorSetLayoutBindingFlagsCreateInfoEXT ), "struct and wrapper have different size!" ); + + template + Result enumerateInstanceVersion( uint32_t* pApiVersion, Dispatch const &d = Dispatch() ); +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type enumerateInstanceVersion(Dispatch const &d = Dispatch() ); +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result enumerateInstanceLayerProperties( uint32_t* pPropertyCount, LayerProperties* pProperties ); + template + VULKAN_HPP_INLINE Result enumerateInstanceVersion( uint32_t* pApiVersion, Dispatch const &d) + { + return static_cast( d.vkEnumerateInstanceVersion( pApiVersion ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE ResultValueType::type enumerateInstanceVersion(Dispatch const &d ) + { + uint32_t apiVersion; + Result result = static_cast( d.vkEnumerateInstanceVersion( &apiVersion ) ); + return createResultValue( result, apiVersion, VULKAN_HPP_NAMESPACE_STRING"::enumerateInstanceVersion" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + + template + Result enumerateInstanceLayerProperties( uint32_t* pPropertyCount, LayerProperties* pProperties, Dispatch const &d = Dispatch() ); #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type enumerateInstanceLayerProperties(); + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type enumerateInstanceLayerProperties(Dispatch const &d = Dispatch() ); #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result enumerateInstanceLayerProperties( uint32_t* pPropertyCount, LayerProperties* pProperties ) + template + VULKAN_HPP_INLINE Result enumerateInstanceLayerProperties( uint32_t* pPropertyCount, LayerProperties* pProperties, Dispatch const &d) { - return static_cast( vkEnumerateInstanceLayerProperties( pPropertyCount, reinterpret_cast( pProperties ) ) ); + return static_cast( d.vkEnumerateInstanceLayerProperties( pPropertyCount, reinterpret_cast( pProperties ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type enumerateInstanceLayerProperties() + template + VULKAN_HPP_INLINE typename ResultValueType>::type enumerateInstanceLayerProperties(Dispatch const &d ) { std::vector properties; uint32_t propertyCount; Result result; do { - result = static_cast( vkEnumerateInstanceLayerProperties( &propertyCount, nullptr ) ); + result = static_cast( d.vkEnumerateInstanceLayerProperties( &propertyCount, nullptr ) ); if ( ( result == Result::eSuccess ) && propertyCount ) { properties.resize( propertyCount ); - result = static_cast( vkEnumerateInstanceLayerProperties( &propertyCount, reinterpret_cast( properties.data() ) ) ); + result = static_cast( d.vkEnumerateInstanceLayerProperties( &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - assert( propertyCount <= properties.size() ); + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); properties.resize( propertyCount ); - return createResultValue( result, properties, "VULKAN_HPP_NAMESPACE::enumerateInstanceLayerProperties" ); + return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::enumerateInstanceLayerProperties" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result enumerateInstanceExtensionProperties( const char* pLayerName, uint32_t* pPropertyCount, ExtensionProperties* pProperties ); + template + Result enumerateInstanceExtensionProperties( const char* pLayerName, uint32_t* pPropertyCount, ExtensionProperties* pProperties, Dispatch const &d = Dispatch() ); #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type enumerateInstanceExtensionProperties( Optional layerName = nullptr ); + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type enumerateInstanceExtensionProperties( Optional layerName = nullptr, Dispatch const &d = Dispatch() ); #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result enumerateInstanceExtensionProperties( const char* pLayerName, uint32_t* pPropertyCount, ExtensionProperties* pProperties ) + template + VULKAN_HPP_INLINE Result enumerateInstanceExtensionProperties( const char* pLayerName, uint32_t* pPropertyCount, ExtensionProperties* pProperties, Dispatch const &d) { - return static_cast( vkEnumerateInstanceExtensionProperties( pLayerName, pPropertyCount, reinterpret_cast( pProperties ) ) ); + return static_cast( d.vkEnumerateInstanceExtensionProperties( pLayerName, pPropertyCount, reinterpret_cast( pProperties ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type enumerateInstanceExtensionProperties( Optional layerName ) + template + VULKAN_HPP_INLINE typename ResultValueType>::type enumerateInstanceExtensionProperties( Optional layerName, Dispatch const &d ) { std::vector properties; uint32_t propertyCount; Result result; do { - result = static_cast( vkEnumerateInstanceExtensionProperties( layerName ? layerName->c_str() : nullptr, &propertyCount, nullptr ) ); + result = static_cast( d.vkEnumerateInstanceExtensionProperties( layerName ? layerName->c_str() : nullptr, &propertyCount, nullptr ) ); if ( ( result == Result::eSuccess ) && propertyCount ) { properties.resize( propertyCount ); - result = static_cast( vkEnumerateInstanceExtensionProperties( layerName ? layerName->c_str() : nullptr, &propertyCount, reinterpret_cast( properties.data() ) ) ); + result = static_cast( d.vkEnumerateInstanceExtensionProperties( layerName ? layerName->c_str() : nullptr, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - assert( propertyCount <= properties.size() ); + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); properties.resize( propertyCount ); - return createResultValue( result, properties, "VULKAN_HPP_NAMESPACE::enumerateInstanceExtensionProperties" ); + return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::enumerateInstanceExtensionProperties" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -25788,16 +29631,16 @@ class CommandBuffer { public: - CommandBuffer() + VULKAN_HPP_CONSTEXPR CommandBuffer() : m_commandBuffer(VK_NULL_HANDLE) {} - CommandBuffer( std::nullptr_t ) + VULKAN_HPP_CONSTEXPR CommandBuffer( std::nullptr_t ) : m_commandBuffer(VK_NULL_HANDLE) {} VULKAN_HPP_TYPESAFE_EXPLICIT CommandBuffer( VkCommandBuffer commandBuffer ) - : m_commandBuffer( commandBuffer ) + : m_commandBuffer( commandBuffer ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -25829,222 +29672,337 @@ return m_commandBuffer < rhs.m_commandBuffer; } - Result begin( const CommandBufferBeginInfo* pBeginInfo ) const; + template + Result begin( const CommandBufferBeginInfo* pBeginInfo, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type begin( const CommandBufferBeginInfo & beginInfo ) const; + template + ResultValueType::type begin( const CommandBufferBeginInfo & beginInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result end() const; + template + Result end(Dispatch const &d = Dispatch() ) const; #else - ResultValueType::type end() const; + template + ResultValueType::type end(Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result reset( CommandBufferResetFlags flags ) const; + template + Result reset( CommandBufferResetFlags flags, Dispatch const &d = Dispatch() ) const; #else - ResultValueType::type reset( CommandBufferResetFlags flags ) const; + template + ResultValueType::type reset( CommandBufferResetFlags flags, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void bindPipeline( PipelineBindPoint pipelineBindPoint, Pipeline pipeline ) const; + template + void bindPipeline( PipelineBindPoint pipelineBindPoint, Pipeline pipeline, Dispatch const &d = Dispatch() ) const; - void setViewport( uint32_t firstViewport, uint32_t viewportCount, const Viewport* pViewports ) const; + template + void setViewport( uint32_t firstViewport, uint32_t viewportCount, const Viewport* pViewports, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setViewport( uint32_t firstViewport, ArrayProxy viewports ) const; + template + void setViewport( uint32_t firstViewport, ArrayProxy viewports, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void setScissor( uint32_t firstScissor, uint32_t scissorCount, const Rect2D* pScissors ) const; + template + void setScissor( uint32_t firstScissor, uint32_t scissorCount, const Rect2D* pScissors, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setScissor( uint32_t firstScissor, ArrayProxy scissors ) const; + template + void setScissor( uint32_t firstScissor, ArrayProxy scissors, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void setLineWidth( float lineWidth ) const; + template + void setLineWidth( float lineWidth, Dispatch const &d = Dispatch() ) const; - void setDepthBias( float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor ) const; + template + void setDepthBias( float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor, Dispatch const &d = Dispatch() ) const; - void setBlendConstants( const float blendConstants[4] ) const; + template + void setBlendConstants( const float blendConstants[4], Dispatch const &d = Dispatch() ) const; - void setDepthBounds( float minDepthBounds, float maxDepthBounds ) const; + template + void setDepthBounds( float minDepthBounds, float maxDepthBounds, Dispatch const &d = Dispatch() ) const; - void setStencilCompareMask( StencilFaceFlags faceMask, uint32_t compareMask ) const; + template + void setStencilCompareMask( StencilFaceFlags faceMask, uint32_t compareMask, Dispatch const &d = Dispatch() ) const; - void setStencilWriteMask( StencilFaceFlags faceMask, uint32_t writeMask ) const; + template + void setStencilWriteMask( StencilFaceFlags faceMask, uint32_t writeMask, Dispatch const &d = Dispatch() ) const; - void setStencilReference( StencilFaceFlags faceMask, uint32_t reference ) const; + template + void setStencilReference( StencilFaceFlags faceMask, uint32_t reference, Dispatch const &d = Dispatch() ) const; - void bindDescriptorSets( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const DescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets ) const; + template + void bindDescriptorSets( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const DescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void bindDescriptorSets( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t firstSet, ArrayProxy descriptorSets, ArrayProxy dynamicOffsets ) const; + template + void bindDescriptorSets( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t firstSet, ArrayProxy descriptorSets, ArrayProxy dynamicOffsets, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void bindIndexBuffer( Buffer buffer, DeviceSize offset, IndexType indexType ) const; + template + void bindIndexBuffer( Buffer buffer, DeviceSize offset, IndexType indexType, Dispatch const &d = Dispatch() ) const; - void bindVertexBuffers( uint32_t firstBinding, uint32_t bindingCount, const Buffer* pBuffers, const DeviceSize* pOffsets ) const; + template + void bindVertexBuffers( uint32_t firstBinding, uint32_t bindingCount, const Buffer* pBuffers, const DeviceSize* pOffsets, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void bindVertexBuffers( uint32_t firstBinding, ArrayProxy buffers, ArrayProxy offsets ) const; + template + void bindVertexBuffers( uint32_t firstBinding, ArrayProxy buffers, ArrayProxy offsets, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void draw( uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance ) const; + template + void draw( uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance, Dispatch const &d = Dispatch() ) const; - void drawIndexed( uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance ) const; + template + void drawIndexed( uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance, Dispatch const &d = Dispatch() ) const; - void drawIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride ) const; + template + void drawIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride, Dispatch const &d = Dispatch() ) const; - void drawIndexedIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride ) const; + template + void drawIndexedIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride, Dispatch const &d = Dispatch() ) const; - void dispatch( uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const; + template + void dispatch( uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ, Dispatch const &d = Dispatch() ) const; - void dispatchIndirect( Buffer buffer, DeviceSize offset ) const; + template + void dispatchIndirect( Buffer buffer, DeviceSize offset, Dispatch const &d = Dispatch() ) const; - void copyBuffer( Buffer srcBuffer, Buffer dstBuffer, uint32_t regionCount, const BufferCopy* pRegions ) const; + template + void copyBuffer( Buffer srcBuffer, Buffer dstBuffer, uint32_t regionCount, const BufferCopy* pRegions, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void copyBuffer( Buffer srcBuffer, Buffer dstBuffer, ArrayProxy regions ) const; + template + void copyBuffer( Buffer srcBuffer, Buffer dstBuffer, ArrayProxy regions, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void copyImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageCopy* pRegions ) const; + template + void copyImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageCopy* pRegions, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void copyImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions ) const; + template + void copyImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void blitImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageBlit* pRegions, Filter filter ) const; + template + void blitImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageBlit* pRegions, Filter filter, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void blitImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions, Filter filter ) const; + template + void blitImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions, Filter filter, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void copyBufferToImage( Buffer srcBuffer, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const BufferImageCopy* pRegions ) const; + template + void copyBufferToImage( Buffer srcBuffer, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const BufferImageCopy* pRegions, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void copyBufferToImage( Buffer srcBuffer, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions ) const; + template + void copyBufferToImage( Buffer srcBuffer, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void copyImageToBuffer( Image srcImage, ImageLayout srcImageLayout, Buffer dstBuffer, uint32_t regionCount, const BufferImageCopy* pRegions ) const; + template + void copyImageToBuffer( Image srcImage, ImageLayout srcImageLayout, Buffer dstBuffer, uint32_t regionCount, const BufferImageCopy* pRegions, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void copyImageToBuffer( Image srcImage, ImageLayout srcImageLayout, Buffer dstBuffer, ArrayProxy regions ) const; + template + void copyImageToBuffer( Image srcImage, ImageLayout srcImageLayout, Buffer dstBuffer, ArrayProxy regions, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void updateBuffer( Buffer dstBuffer, DeviceSize dstOffset, DeviceSize dataSize, const void* pData ) const; + template + void updateBuffer( Buffer dstBuffer, DeviceSize dstOffset, DeviceSize dataSize, const void* pData, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void updateBuffer( Buffer dstBuffer, DeviceSize dstOffset, ArrayProxy data ) const; + template + void updateBuffer( Buffer dstBuffer, DeviceSize dstOffset, ArrayProxy data, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void fillBuffer( Buffer dstBuffer, DeviceSize dstOffset, DeviceSize size, uint32_t data ) const; + template + void fillBuffer( Buffer dstBuffer, DeviceSize dstOffset, DeviceSize size, uint32_t data, Dispatch const &d = Dispatch() ) const; - void clearColorImage( Image image, ImageLayout imageLayout, const ClearColorValue* pColor, uint32_t rangeCount, const ImageSubresourceRange* pRanges ) const; + template + void clearColorImage( Image image, ImageLayout imageLayout, const ClearColorValue* pColor, uint32_t rangeCount, const ImageSubresourceRange* pRanges, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void clearColorImage( Image image, ImageLayout imageLayout, const ClearColorValue & color, ArrayProxy ranges ) const; + template + void clearColorImage( Image image, ImageLayout imageLayout, const ClearColorValue & color, ArrayProxy ranges, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void clearDepthStencilImage( Image image, ImageLayout imageLayout, const ClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const ImageSubresourceRange* pRanges ) const; + template + void clearDepthStencilImage( Image image, ImageLayout imageLayout, const ClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const ImageSubresourceRange* pRanges, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void clearDepthStencilImage( Image image, ImageLayout imageLayout, const ClearDepthStencilValue & depthStencil, ArrayProxy ranges ) const; + template + void clearDepthStencilImage( Image image, ImageLayout imageLayout, const ClearDepthStencilValue & depthStencil, ArrayProxy ranges, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void clearAttachments( uint32_t attachmentCount, const ClearAttachment* pAttachments, uint32_t rectCount, const ClearRect* pRects ) const; + template + void clearAttachments( uint32_t attachmentCount, const ClearAttachment* pAttachments, uint32_t rectCount, const ClearRect* pRects, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void clearAttachments( ArrayProxy attachments, ArrayProxy rects ) const; + template + void clearAttachments( ArrayProxy attachments, ArrayProxy rects, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void resolveImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageResolve* pRegions ) const; + template + void resolveImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageResolve* pRegions, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void resolveImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions ) const; + template + void resolveImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void setEvent( Event event, PipelineStageFlags stageMask ) const; + template + void setEvent( Event event, PipelineStageFlags stageMask, Dispatch const &d = Dispatch() ) const; - void resetEvent( Event event, PipelineStageFlags stageMask ) const; + template + void resetEvent( Event event, PipelineStageFlags stageMask, Dispatch const &d = Dispatch() ) const; - void waitEvents( uint32_t eventCount, const Event* pEvents, PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const MemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const BufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const ImageMemoryBarrier* pImageMemoryBarriers ) const; + template + void waitEvents( uint32_t eventCount, const Event* pEvents, PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const MemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const BufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const ImageMemoryBarrier* pImageMemoryBarriers, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void waitEvents( ArrayProxy events, PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, ArrayProxy memoryBarriers, ArrayProxy bufferMemoryBarriers, ArrayProxy imageMemoryBarriers ) const; + template + void waitEvents( ArrayProxy events, PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, ArrayProxy memoryBarriers, ArrayProxy bufferMemoryBarriers, ArrayProxy imageMemoryBarriers, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void pipelineBarrier( PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, DependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const MemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const BufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const ImageMemoryBarrier* pImageMemoryBarriers ) const; + template + void pipelineBarrier( PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, DependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const MemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const BufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const ImageMemoryBarrier* pImageMemoryBarriers, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void pipelineBarrier( PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, DependencyFlags dependencyFlags, ArrayProxy memoryBarriers, ArrayProxy bufferMemoryBarriers, ArrayProxy imageMemoryBarriers ) const; + template + void pipelineBarrier( PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, DependencyFlags dependencyFlags, ArrayProxy memoryBarriers, ArrayProxy bufferMemoryBarriers, ArrayProxy imageMemoryBarriers, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void beginQuery( QueryPool queryPool, uint32_t query, QueryControlFlags flags ) const; + template + void beginQuery( QueryPool queryPool, uint32_t query, QueryControlFlags flags, Dispatch const &d = Dispatch() ) const; - void endQuery( QueryPool queryPool, uint32_t query ) const; + template + void endQuery( QueryPool queryPool, uint32_t query, Dispatch const &d = Dispatch() ) const; - void resetQueryPool( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount ) const; + template + void resetQueryPool( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, Dispatch const &d = Dispatch() ) const; - void writeTimestamp( PipelineStageFlagBits pipelineStage, QueryPool queryPool, uint32_t query ) const; + template + void writeTimestamp( PipelineStageFlagBits pipelineStage, QueryPool queryPool, uint32_t query, Dispatch const &d = Dispatch() ) const; - void copyQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, Buffer dstBuffer, DeviceSize dstOffset, DeviceSize stride, QueryResultFlags flags ) const; + template + void copyQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, Buffer dstBuffer, DeviceSize dstOffset, DeviceSize stride, QueryResultFlags flags, Dispatch const &d = Dispatch() ) const; - void pushConstants( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues ) const; + template + void pushConstants( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void pushConstants( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, ArrayProxy values ) const; + template + void pushConstants( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, ArrayProxy values, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void beginRenderPass( const RenderPassBeginInfo* pRenderPassBegin, SubpassContents contents ) const; + template + void beginRenderPass( const RenderPassBeginInfo* pRenderPassBegin, SubpassContents contents, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void beginRenderPass( const RenderPassBeginInfo & renderPassBegin, SubpassContents contents ) const; + template + void beginRenderPass( const RenderPassBeginInfo & renderPassBegin, SubpassContents contents, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void nextSubpass( SubpassContents contents ) const; + template + void nextSubpass( SubpassContents contents, Dispatch const &d = Dispatch() ) const; - void endRenderPass() const; + template + void endRenderPass(Dispatch const &d = Dispatch() ) const; - void executeCommands( uint32_t commandBufferCount, const CommandBuffer* pCommandBuffers ) const; + template + void executeCommands( uint32_t commandBufferCount, const CommandBuffer* pCommandBuffers, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void executeCommands( ArrayProxy commandBuffers ) const; + template + void executeCommands( ArrayProxy commandBuffers, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void debugMarkerBeginEXT( const DebugMarkerMarkerInfoEXT* pMarkerInfo ) const; + template + void debugMarkerBeginEXT( const DebugMarkerMarkerInfoEXT* pMarkerInfo, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void debugMarkerBeginEXT( const DebugMarkerMarkerInfoEXT & markerInfo ) const; + template + void debugMarkerBeginEXT( const DebugMarkerMarkerInfoEXT & markerInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void debugMarkerEndEXT() const; + template + void debugMarkerEndEXT(Dispatch const &d = Dispatch() ) const; - void debugMarkerInsertEXT( const DebugMarkerMarkerInfoEXT* pMarkerInfo ) const; + template + void debugMarkerInsertEXT( const DebugMarkerMarkerInfoEXT* pMarkerInfo, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void debugMarkerInsertEXT( const DebugMarkerMarkerInfoEXT & markerInfo ) const; + template + void debugMarkerInsertEXT( const DebugMarkerMarkerInfoEXT & markerInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void drawIndirectCountAMD( Buffer buffer, DeviceSize offset, Buffer countBuffer, DeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride ) const; + template + void drawIndirectCountAMD( Buffer buffer, DeviceSize offset, Buffer countBuffer, DeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, Dispatch const &d = Dispatch() ) const; - void drawIndexedIndirectCountAMD( Buffer buffer, DeviceSize offset, Buffer countBuffer, DeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride ) const; + template + void drawIndexedIndirectCountAMD( Buffer buffer, DeviceSize offset, Buffer countBuffer, DeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, Dispatch const &d = Dispatch() ) const; - void processCommandsNVX( const CmdProcessCommandsInfoNVX* pProcessCommandsInfo ) const; + template + void processCommandsNVX( const CmdProcessCommandsInfoNVX* pProcessCommandsInfo, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void processCommandsNVX( const CmdProcessCommandsInfoNVX & processCommandsInfo ) const; + template + void processCommandsNVX( const CmdProcessCommandsInfoNVX & processCommandsInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void reserveSpaceForCommandsNVX( const CmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo ) const; + template + void reserveSpaceForCommandsNVX( const CmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void reserveSpaceForCommandsNVX( const CmdReserveSpaceForCommandsInfoNVX & reserveSpaceInfo ) const; + template + void reserveSpaceForCommandsNVX( const CmdReserveSpaceForCommandsInfoNVX & reserveSpaceInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void pushDescriptorSetKHR( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const WriteDescriptorSet* pDescriptorWrites ) const; + template + void pushDescriptorSetKHR( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const WriteDescriptorSet* pDescriptorWrites, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void pushDescriptorSetKHR( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t set, ArrayProxy descriptorWrites ) const; + template + void pushDescriptorSetKHR( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t set, ArrayProxy descriptorWrites, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void setDeviceMaskKHX( uint32_t deviceMask ) const; + template + void setDeviceMask( uint32_t deviceMask, Dispatch const &d = Dispatch() ) const; + + template + void setDeviceMaskKHR( uint32_t deviceMask, Dispatch const &d = Dispatch() ) const; - void dispatchBaseKHX( uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const; + template + void dispatchBase( uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ, Dispatch const &d = Dispatch() ) const; + + template + void dispatchBaseKHR( uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ, Dispatch const &d = Dispatch() ) const; + + template + void pushDescriptorSetWithTemplateKHR( DescriptorUpdateTemplate descriptorUpdateTemplate, PipelineLayout layout, uint32_t set, const void* pData, Dispatch const &d = Dispatch() ) const; + + template + void setViewportWScalingNV( uint32_t firstViewport, uint32_t viewportCount, const ViewportWScalingNV* pViewportWScalings, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void setViewportWScalingNV( uint32_t firstViewport, ArrayProxy viewportWScalings, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void pushDescriptorSetWithTemplateKHR( DescriptorUpdateTemplateKHR descriptorUpdateTemplate, PipelineLayout layout, uint32_t set, const void* pData ) const; + template + void setDiscardRectangleEXT( uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const Rect2D* pDiscardRectangles, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void setDiscardRectangleEXT( uint32_t firstDiscardRectangle, ArrayProxy discardRectangles, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void setViewportWScalingNV( uint32_t firstViewport, uint32_t viewportCount, const ViewportWScalingNV* pViewportWScalings ) const; + template + void setSampleLocationsEXT( const SampleLocationsInfoEXT* pSampleLocationsInfo, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setViewportWScalingNV( uint32_t firstViewport, ArrayProxy viewportWScalings ) const; + template + void setSampleLocationsEXT( const SampleLocationsInfoEXT & sampleLocationsInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void setDiscardRectangleEXT( uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const Rect2D* pDiscardRectangles ) const; + template + void beginDebugUtilsLabelEXT( const DebugUtilsLabelEXT* pLabelInfo, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setDiscardRectangleEXT( uint32_t firstDiscardRectangle, ArrayProxy discardRectangles ) const; + template + void beginDebugUtilsLabelEXT( const DebugUtilsLabelEXT & labelInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void setSampleLocationsEXT( const SampleLocationsInfoEXT* pSampleLocationsInfo ) const; + template + void endDebugUtilsLabelEXT(Dispatch const &d = Dispatch() ) const; + + template + void insertDebugUtilsLabelEXT( const DebugUtilsLabelEXT* pLabelInfo, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setSampleLocationsEXT( const SampleLocationsInfoEXT & sampleLocationsInfo ) const; + template + void insertDebugUtilsLabelEXT( const DebugUtilsLabelEXT & labelInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + template + void writeBufferMarkerAMD( PipelineStageFlagBits pipelineStage, Buffer dstBuffer, DeviceSize dstOffset, uint32_t marker, Dispatch const &d = Dispatch() ) const; + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkCommandBuffer() const @@ -26068,512 +30026,929 @@ static_assert( sizeof( CommandBuffer ) == sizeof( VkCommandBuffer ), "handle and wrapper have different size!" ); - VULKAN_HPP_INLINE Result CommandBuffer::begin( const CommandBufferBeginInfo* pBeginInfo ) const + template + VULKAN_HPP_INLINE Result CommandBuffer::begin( const CommandBufferBeginInfo* pBeginInfo, Dispatch const &d) const { - return static_cast( vkBeginCommandBuffer( m_commandBuffer, reinterpret_cast( pBeginInfo ) ) ); + return static_cast( d.vkBeginCommandBuffer( m_commandBuffer, reinterpret_cast( pBeginInfo ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type CommandBuffer::begin( const CommandBufferBeginInfo & beginInfo ) const + template + VULKAN_HPP_INLINE ResultValueType::type CommandBuffer::begin( const CommandBufferBeginInfo & beginInfo, Dispatch const &d ) const { - Result result = static_cast( vkBeginCommandBuffer( m_commandBuffer, reinterpret_cast( &beginInfo ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::CommandBuffer::begin" ); + Result result = static_cast( d.vkBeginCommandBuffer( m_commandBuffer, reinterpret_cast( &beginInfo ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::CommandBuffer::begin" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Result CommandBuffer::end() const + template + VULKAN_HPP_INLINE Result CommandBuffer::end(Dispatch const &d) const { - return static_cast( vkEndCommandBuffer( m_commandBuffer ) ); + return static_cast( d.vkEndCommandBuffer( m_commandBuffer ) ); } #else - VULKAN_HPP_INLINE ResultValueType::type CommandBuffer::end() const + template + VULKAN_HPP_INLINE ResultValueType::type CommandBuffer::end(Dispatch const &d ) const { - Result result = static_cast( vkEndCommandBuffer( m_commandBuffer ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::CommandBuffer::end" ); + Result result = static_cast( d.vkEndCommandBuffer( m_commandBuffer ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::CommandBuffer::end" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Result CommandBuffer::reset( CommandBufferResetFlags flags ) const + template + VULKAN_HPP_INLINE Result CommandBuffer::reset( CommandBufferResetFlags flags, Dispatch const &d) const { - return static_cast( vkResetCommandBuffer( m_commandBuffer, static_cast( flags ) ) ); + return static_cast( d.vkResetCommandBuffer( m_commandBuffer, static_cast( flags ) ) ); } #else - VULKAN_HPP_INLINE ResultValueType::type CommandBuffer::reset( CommandBufferResetFlags flags ) const + template + VULKAN_HPP_INLINE ResultValueType::type CommandBuffer::reset( CommandBufferResetFlags flags, Dispatch const &d ) const { - Result result = static_cast( vkResetCommandBuffer( m_commandBuffer, static_cast( flags ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::CommandBuffer::reset" ); + Result result = static_cast( d.vkResetCommandBuffer( m_commandBuffer, static_cast( flags ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::CommandBuffer::reset" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::bindPipeline( PipelineBindPoint pipelineBindPoint, Pipeline pipeline ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::bindPipeline( PipelineBindPoint pipelineBindPoint, Pipeline pipeline, Dispatch const &d) const + { + d.vkCmdBindPipeline( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( pipeline ) ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::bindPipeline( PipelineBindPoint pipelineBindPoint, Pipeline pipeline, Dispatch const &d ) const { - vkCmdBindPipeline( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( pipeline ) ); + d.vkCmdBindPipeline( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( pipeline ) ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::setViewport( uint32_t firstViewport, uint32_t viewportCount, const Viewport* pViewports ) const + template + VULKAN_HPP_INLINE void CommandBuffer::setViewport( uint32_t firstViewport, uint32_t viewportCount, const Viewport* pViewports, Dispatch const &d) const { - vkCmdSetViewport( m_commandBuffer, firstViewport, viewportCount, reinterpret_cast( pViewports ) ); + d.vkCmdSetViewport( m_commandBuffer, firstViewport, viewportCount, reinterpret_cast( pViewports ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::setViewport( uint32_t firstViewport, ArrayProxy viewports ) const + template + VULKAN_HPP_INLINE void CommandBuffer::setViewport( uint32_t firstViewport, ArrayProxy viewports, Dispatch const &d ) const { - vkCmdSetViewport( m_commandBuffer, firstViewport, viewports.size() , reinterpret_cast( viewports.data() ) ); + d.vkCmdSetViewport( m_commandBuffer, firstViewport, viewports.size() , reinterpret_cast( viewports.data() ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::setScissor( uint32_t firstScissor, uint32_t scissorCount, const Rect2D* pScissors ) const + template + VULKAN_HPP_INLINE void CommandBuffer::setScissor( uint32_t firstScissor, uint32_t scissorCount, const Rect2D* pScissors, Dispatch const &d) const { - vkCmdSetScissor( m_commandBuffer, firstScissor, scissorCount, reinterpret_cast( pScissors ) ); + d.vkCmdSetScissor( m_commandBuffer, firstScissor, scissorCount, reinterpret_cast( pScissors ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::setScissor( uint32_t firstScissor, ArrayProxy scissors ) const + template + VULKAN_HPP_INLINE void CommandBuffer::setScissor( uint32_t firstScissor, ArrayProxy scissors, Dispatch const &d ) const { - vkCmdSetScissor( m_commandBuffer, firstScissor, scissors.size() , reinterpret_cast( scissors.data() ) ); + d.vkCmdSetScissor( m_commandBuffer, firstScissor, scissors.size() , reinterpret_cast( scissors.data() ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::setLineWidth( float lineWidth ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::setLineWidth( float lineWidth, Dispatch const &d) const + { + d.vkCmdSetLineWidth( m_commandBuffer, lineWidth ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::setLineWidth( float lineWidth, Dispatch const &d ) const { - vkCmdSetLineWidth( m_commandBuffer, lineWidth ); + d.vkCmdSetLineWidth( m_commandBuffer, lineWidth ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::setDepthBias( float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::setDepthBias( float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor, Dispatch const &d) const { - vkCmdSetDepthBias( m_commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor ); + d.vkCmdSetDepthBias( m_commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor ); } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::setDepthBias( float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor, Dispatch const &d ) const + { + d.vkCmdSetDepthBias( m_commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::setBlendConstants( const float blendConstants[4] ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::setBlendConstants( const float blendConstants[4], Dispatch const &d) const + { + d.vkCmdSetBlendConstants( m_commandBuffer, blendConstants ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::setBlendConstants( const float blendConstants[4], Dispatch const &d ) const { - vkCmdSetBlendConstants( m_commandBuffer, blendConstants ); + d.vkCmdSetBlendConstants( m_commandBuffer, blendConstants ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::setDepthBounds( float minDepthBounds, float maxDepthBounds ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::setDepthBounds( float minDepthBounds, float maxDepthBounds, Dispatch const &d) const + { + d.vkCmdSetDepthBounds( m_commandBuffer, minDepthBounds, maxDepthBounds ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::setDepthBounds( float minDepthBounds, float maxDepthBounds, Dispatch const &d ) const { - vkCmdSetDepthBounds( m_commandBuffer, minDepthBounds, maxDepthBounds ); + d.vkCmdSetDepthBounds( m_commandBuffer, minDepthBounds, maxDepthBounds ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::setStencilCompareMask( StencilFaceFlags faceMask, uint32_t compareMask ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::setStencilCompareMask( StencilFaceFlags faceMask, uint32_t compareMask, Dispatch const &d) const + { + d.vkCmdSetStencilCompareMask( m_commandBuffer, static_cast( faceMask ), compareMask ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::setStencilCompareMask( StencilFaceFlags faceMask, uint32_t compareMask, Dispatch const &d ) const { - vkCmdSetStencilCompareMask( m_commandBuffer, static_cast( faceMask ), compareMask ); + d.vkCmdSetStencilCompareMask( m_commandBuffer, static_cast( faceMask ), compareMask ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::setStencilWriteMask( StencilFaceFlags faceMask, uint32_t writeMask ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::setStencilWriteMask( StencilFaceFlags faceMask, uint32_t writeMask, Dispatch const &d) const { - vkCmdSetStencilWriteMask( m_commandBuffer, static_cast( faceMask ), writeMask ); + d.vkCmdSetStencilWriteMask( m_commandBuffer, static_cast( faceMask ), writeMask ); } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::setStencilWriteMask( StencilFaceFlags faceMask, uint32_t writeMask, Dispatch const &d ) const + { + d.vkCmdSetStencilWriteMask( m_commandBuffer, static_cast( faceMask ), writeMask ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::setStencilReference( StencilFaceFlags faceMask, uint32_t reference ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::setStencilReference( StencilFaceFlags faceMask, uint32_t reference, Dispatch const &d) const + { + d.vkCmdSetStencilReference( m_commandBuffer, static_cast( faceMask ), reference ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::setStencilReference( StencilFaceFlags faceMask, uint32_t reference, Dispatch const &d ) const { - vkCmdSetStencilReference( m_commandBuffer, static_cast( faceMask ), reference ); + d.vkCmdSetStencilReference( m_commandBuffer, static_cast( faceMask ), reference ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::bindDescriptorSets( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const DescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets ) const + template + VULKAN_HPP_INLINE void CommandBuffer::bindDescriptorSets( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const DescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets, Dispatch const &d) const { - vkCmdBindDescriptorSets( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( layout ), firstSet, descriptorSetCount, reinterpret_cast( pDescriptorSets ), dynamicOffsetCount, pDynamicOffsets ); + d.vkCmdBindDescriptorSets( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( layout ), firstSet, descriptorSetCount, reinterpret_cast( pDescriptorSets ), dynamicOffsetCount, pDynamicOffsets ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::bindDescriptorSets( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t firstSet, ArrayProxy descriptorSets, ArrayProxy dynamicOffsets ) const + template + VULKAN_HPP_INLINE void CommandBuffer::bindDescriptorSets( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t firstSet, ArrayProxy descriptorSets, ArrayProxy dynamicOffsets, Dispatch const &d ) const { - vkCmdBindDescriptorSets( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( layout ), firstSet, descriptorSets.size() , reinterpret_cast( descriptorSets.data() ), dynamicOffsets.size() , dynamicOffsets.data() ); + 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*/ - VULKAN_HPP_INLINE void CommandBuffer::bindIndexBuffer( Buffer buffer, DeviceSize offset, IndexType indexType ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::bindIndexBuffer( Buffer buffer, DeviceSize offset, IndexType indexType, Dispatch const &d) const + { + d.vkCmdBindIndexBuffer( m_commandBuffer, static_cast( buffer ), offset, static_cast( indexType ) ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::bindIndexBuffer( Buffer buffer, DeviceSize offset, IndexType indexType, Dispatch const &d ) const { - vkCmdBindIndexBuffer( m_commandBuffer, static_cast( buffer ), offset, static_cast( indexType ) ); + d.vkCmdBindIndexBuffer( m_commandBuffer, static_cast( buffer ), offset, static_cast( indexType ) ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::bindVertexBuffers( uint32_t firstBinding, uint32_t bindingCount, const Buffer* pBuffers, const DeviceSize* pOffsets ) const + template + VULKAN_HPP_INLINE void CommandBuffer::bindVertexBuffers( uint32_t firstBinding, uint32_t bindingCount, const Buffer* pBuffers, const DeviceSize* pOffsets, Dispatch const &d) const { - vkCmdBindVertexBuffers( m_commandBuffer, firstBinding, bindingCount, reinterpret_cast( pBuffers ), pOffsets ); + d.vkCmdBindVertexBuffers( m_commandBuffer, firstBinding, bindingCount, reinterpret_cast( pBuffers ), pOffsets ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::bindVertexBuffers( uint32_t firstBinding, ArrayProxy buffers, ArrayProxy offsets ) const + template + VULKAN_HPP_INLINE void CommandBuffer::bindVertexBuffers( uint32_t firstBinding, ArrayProxy buffers, ArrayProxy offsets, Dispatch const &d ) const { #ifdef VULKAN_HPP_NO_EXCEPTIONS - assert( buffers.size() == offsets.size() ); + VULKAN_HPP_ASSERT( buffers.size() == offsets.size() ); #else if ( buffers.size() != offsets.size() ) { - throw LogicError( "VULKAN_HPP_NAMESPACE::CommandBuffer::bindVertexBuffers: buffers.size() != offsets.size()" ); + throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindVertexBuffers: buffers.size() != offsets.size()" ); } #endif // VULKAN_HPP_NO_EXCEPTIONS - vkCmdBindVertexBuffers( m_commandBuffer, firstBinding, buffers.size() , reinterpret_cast( buffers.data() ), offsets.data() ); + d.vkCmdBindVertexBuffers( m_commandBuffer, firstBinding, buffers.size() , reinterpret_cast( buffers.data() ), offsets.data() ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::draw( uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance ) const +#ifdef 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 + { + d.vkCmdDraw( m_commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::draw( uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance, Dispatch const &d ) const { - vkCmdDraw( m_commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance ); + d.vkCmdDraw( m_commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::drawIndexed( uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + 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 { - vkCmdDrawIndexed( m_commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance ); + d.vkCmdDrawIndexed( m_commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance ); } +#else + 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 + { + d.vkCmdDrawIndexed( m_commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::drawIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::drawIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride, Dispatch const &d) const + { + d.vkCmdDrawIndirect( m_commandBuffer, static_cast( buffer ), offset, drawCount, stride ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::drawIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride, Dispatch const &d ) const { - vkCmdDrawIndirect( m_commandBuffer, static_cast( buffer ), offset, drawCount, stride ); + d.vkCmdDrawIndirect( m_commandBuffer, static_cast( buffer ), offset, drawCount, stride ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::drawIndexedIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::drawIndexedIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride, Dispatch const &d) const + { + d.vkCmdDrawIndexedIndirect( m_commandBuffer, static_cast( buffer ), offset, drawCount, stride ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::drawIndexedIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride, Dispatch const &d ) const { - vkCmdDrawIndexedIndirect( m_commandBuffer, static_cast( buffer ), offset, drawCount, stride ); + d.vkCmdDrawIndexedIndirect( m_commandBuffer, static_cast( buffer ), offset, drawCount, stride ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::dispatch( uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::dispatch( uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ, Dispatch const &d) const + { + d.vkCmdDispatch( m_commandBuffer, groupCountX, groupCountY, groupCountZ ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::dispatch( uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ, Dispatch const &d ) const { - vkCmdDispatch( m_commandBuffer, groupCountX, groupCountY, groupCountZ ); + d.vkCmdDispatch( m_commandBuffer, groupCountX, groupCountY, groupCountZ ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::dispatchIndirect( Buffer buffer, DeviceSize offset ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::dispatchIndirect( Buffer buffer, DeviceSize offset, Dispatch const &d) const { - vkCmdDispatchIndirect( m_commandBuffer, static_cast( buffer ), offset ); + d.vkCmdDispatchIndirect( m_commandBuffer, static_cast( buffer ), offset ); } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::dispatchIndirect( Buffer buffer, DeviceSize offset, Dispatch const &d ) const + { + d.vkCmdDispatchIndirect( m_commandBuffer, static_cast( buffer ), offset ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::copyBuffer( Buffer srcBuffer, Buffer dstBuffer, uint32_t regionCount, const BufferCopy* pRegions ) const + template + VULKAN_HPP_INLINE void CommandBuffer::copyBuffer( Buffer srcBuffer, Buffer dstBuffer, uint32_t regionCount, const BufferCopy* pRegions, Dispatch const &d) const { - vkCmdCopyBuffer( m_commandBuffer, static_cast( srcBuffer ), static_cast( dstBuffer ), regionCount, reinterpret_cast( pRegions ) ); + d.vkCmdCopyBuffer( m_commandBuffer, static_cast( srcBuffer ), static_cast( dstBuffer ), regionCount, reinterpret_cast( pRegions ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::copyBuffer( Buffer srcBuffer, Buffer dstBuffer, ArrayProxy regions ) const + template + VULKAN_HPP_INLINE void CommandBuffer::copyBuffer( Buffer srcBuffer, Buffer dstBuffer, ArrayProxy regions, Dispatch const &d ) const { - vkCmdCopyBuffer( m_commandBuffer, static_cast( srcBuffer ), static_cast( dstBuffer ), regions.size() , reinterpret_cast( regions.data() ) ); + d.vkCmdCopyBuffer( m_commandBuffer, static_cast( srcBuffer ), static_cast( dstBuffer ), regions.size() , reinterpret_cast( regions.data() ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::copyImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageCopy* pRegions ) const + template + VULKAN_HPP_INLINE void CommandBuffer::copyImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageCopy* pRegions, Dispatch const &d) const { - vkCmdCopyImage( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstImage ), static_cast( dstImageLayout ), regionCount, reinterpret_cast( pRegions ) ); + 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 - VULKAN_HPP_INLINE void CommandBuffer::copyImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions ) const + template + VULKAN_HPP_INLINE void CommandBuffer::copyImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions, Dispatch const &d ) const { - vkCmdCopyImage( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstImage ), static_cast( dstImageLayout ), regions.size() , reinterpret_cast( regions.data() ) ); + 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*/ - VULKAN_HPP_INLINE void CommandBuffer::blitImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageBlit* pRegions, Filter filter ) const + template + VULKAN_HPP_INLINE void CommandBuffer::blitImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageBlit* pRegions, Filter filter, Dispatch const &d) const { - vkCmdBlitImage( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstImage ), static_cast( dstImageLayout ), regionCount, reinterpret_cast( pRegions ), static_cast( filter ) ); + 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 - VULKAN_HPP_INLINE void CommandBuffer::blitImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions, Filter filter ) const + template + VULKAN_HPP_INLINE void CommandBuffer::blitImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions, Filter filter, Dispatch const &d ) const { - vkCmdBlitImage( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstImage ), static_cast( dstImageLayout ), regions.size() , reinterpret_cast( regions.data() ), static_cast( filter ) ); + 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*/ - VULKAN_HPP_INLINE void CommandBuffer::copyBufferToImage( Buffer srcBuffer, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const BufferImageCopy* pRegions ) const + template + VULKAN_HPP_INLINE void CommandBuffer::copyBufferToImage( Buffer srcBuffer, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const BufferImageCopy* pRegions, Dispatch const &d) const { - vkCmdCopyBufferToImage( m_commandBuffer, static_cast( srcBuffer ), static_cast( dstImage ), static_cast( dstImageLayout ), regionCount, reinterpret_cast( pRegions ) ); + d.vkCmdCopyBufferToImage( m_commandBuffer, static_cast( srcBuffer ), static_cast( dstImage ), static_cast( dstImageLayout ), regionCount, reinterpret_cast( pRegions ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::copyBufferToImage( Buffer srcBuffer, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions ) const + template + VULKAN_HPP_INLINE void CommandBuffer::copyBufferToImage( Buffer srcBuffer, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions, Dispatch const &d ) const { - vkCmdCopyBufferToImage( m_commandBuffer, static_cast( srcBuffer ), static_cast( dstImage ), static_cast( dstImageLayout ), regions.size() , reinterpret_cast( regions.data() ) ); + 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*/ - VULKAN_HPP_INLINE void CommandBuffer::copyImageToBuffer( Image srcImage, ImageLayout srcImageLayout, Buffer dstBuffer, uint32_t regionCount, const BufferImageCopy* pRegions ) const + template + VULKAN_HPP_INLINE void CommandBuffer::copyImageToBuffer( Image srcImage, ImageLayout srcImageLayout, Buffer dstBuffer, uint32_t regionCount, const BufferImageCopy* pRegions, Dispatch const &d) const { - vkCmdCopyImageToBuffer( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstBuffer ), regionCount, reinterpret_cast( pRegions ) ); + d.vkCmdCopyImageToBuffer( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstBuffer ), regionCount, reinterpret_cast( pRegions ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::copyImageToBuffer( Image srcImage, ImageLayout srcImageLayout, Buffer dstBuffer, ArrayProxy regions ) const + template + VULKAN_HPP_INLINE void CommandBuffer::copyImageToBuffer( Image srcImage, ImageLayout srcImageLayout, Buffer dstBuffer, ArrayProxy regions, Dispatch const &d ) const { - vkCmdCopyImageToBuffer( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstBuffer ), regions.size() , reinterpret_cast( regions.data() ) ); + 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*/ - VULKAN_HPP_INLINE void CommandBuffer::updateBuffer( Buffer dstBuffer, DeviceSize dstOffset, DeviceSize dataSize, const void* pData ) const + template + VULKAN_HPP_INLINE void CommandBuffer::updateBuffer( Buffer dstBuffer, DeviceSize dstOffset, DeviceSize dataSize, const void* pData, Dispatch const &d) const { - vkCmdUpdateBuffer( m_commandBuffer, static_cast( dstBuffer ), dstOffset, dataSize, pData ); + d.vkCmdUpdateBuffer( m_commandBuffer, static_cast( dstBuffer ), dstOffset, dataSize, pData ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::updateBuffer( Buffer dstBuffer, DeviceSize dstOffset, ArrayProxy data ) const + template + VULKAN_HPP_INLINE void CommandBuffer::updateBuffer( Buffer dstBuffer, DeviceSize dstOffset, ArrayProxy data, Dispatch const &d ) const { - vkCmdUpdateBuffer( m_commandBuffer, static_cast( dstBuffer ), dstOffset, data.size() * sizeof( T ) , reinterpret_cast( data.data() ) ); + d.vkCmdUpdateBuffer( m_commandBuffer, static_cast( dstBuffer ), dstOffset, data.size() * sizeof( T ) , reinterpret_cast( data.data() ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::fillBuffer( Buffer dstBuffer, DeviceSize dstOffset, DeviceSize size, uint32_t data ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::fillBuffer( Buffer dstBuffer, DeviceSize dstOffset, DeviceSize size, uint32_t data, Dispatch const &d) const + { + d.vkCmdFillBuffer( m_commandBuffer, static_cast( dstBuffer ), dstOffset, size, data ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::fillBuffer( Buffer dstBuffer, DeviceSize dstOffset, DeviceSize size, uint32_t data, Dispatch const &d ) const { - vkCmdFillBuffer( m_commandBuffer, static_cast( dstBuffer ), dstOffset, size, data ); + d.vkCmdFillBuffer( m_commandBuffer, static_cast( dstBuffer ), dstOffset, size, data ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::clearColorImage( Image image, ImageLayout imageLayout, const ClearColorValue* pColor, uint32_t rangeCount, const ImageSubresourceRange* pRanges ) const + template + VULKAN_HPP_INLINE void CommandBuffer::clearColorImage( Image image, ImageLayout imageLayout, const ClearColorValue* pColor, uint32_t rangeCount, const ImageSubresourceRange* pRanges, Dispatch const &d) const { - vkCmdClearColorImage( m_commandBuffer, static_cast( image ), static_cast( imageLayout ), reinterpret_cast( pColor ), rangeCount, reinterpret_cast( pRanges ) ); + d.vkCmdClearColorImage( m_commandBuffer, static_cast( image ), static_cast( imageLayout ), reinterpret_cast( pColor ), rangeCount, reinterpret_cast( pRanges ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::clearColorImage( Image image, ImageLayout imageLayout, const ClearColorValue & color, ArrayProxy ranges ) const + template + VULKAN_HPP_INLINE void CommandBuffer::clearColorImage( Image image, ImageLayout imageLayout, const ClearColorValue & color, ArrayProxy ranges, Dispatch const &d ) const { - vkCmdClearColorImage( m_commandBuffer, static_cast( image ), static_cast( imageLayout ), reinterpret_cast( &color ), ranges.size() , reinterpret_cast( ranges.data() ) ); + 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*/ - VULKAN_HPP_INLINE void CommandBuffer::clearDepthStencilImage( Image image, ImageLayout imageLayout, const ClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const ImageSubresourceRange* pRanges ) const + template + VULKAN_HPP_INLINE void CommandBuffer::clearDepthStencilImage( Image image, ImageLayout imageLayout, const ClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const ImageSubresourceRange* pRanges, Dispatch const &d) const { - vkCmdClearDepthStencilImage( m_commandBuffer, static_cast( image ), static_cast( imageLayout ), reinterpret_cast( pDepthStencil ), rangeCount, reinterpret_cast( pRanges ) ); + d.vkCmdClearDepthStencilImage( m_commandBuffer, static_cast( image ), static_cast( imageLayout ), reinterpret_cast( pDepthStencil ), rangeCount, reinterpret_cast( pRanges ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::clearDepthStencilImage( Image image, ImageLayout imageLayout, const ClearDepthStencilValue & depthStencil, ArrayProxy ranges ) const + template + VULKAN_HPP_INLINE void CommandBuffer::clearDepthStencilImage( Image image, ImageLayout imageLayout, const ClearDepthStencilValue & depthStencil, ArrayProxy ranges, Dispatch const &d ) const { - vkCmdClearDepthStencilImage( m_commandBuffer, static_cast( image ), static_cast( imageLayout ), reinterpret_cast( &depthStencil ), ranges.size() , reinterpret_cast( ranges.data() ) ); + 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*/ - VULKAN_HPP_INLINE void CommandBuffer::clearAttachments( uint32_t attachmentCount, const ClearAttachment* pAttachments, uint32_t rectCount, const ClearRect* pRects ) const + template + VULKAN_HPP_INLINE void CommandBuffer::clearAttachments( uint32_t attachmentCount, const ClearAttachment* pAttachments, uint32_t rectCount, const ClearRect* pRects, Dispatch const &d) const { - vkCmdClearAttachments( m_commandBuffer, attachmentCount, reinterpret_cast( pAttachments ), rectCount, reinterpret_cast( pRects ) ); + d.vkCmdClearAttachments( m_commandBuffer, attachmentCount, reinterpret_cast( pAttachments ), rectCount, reinterpret_cast( pRects ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::clearAttachments( ArrayProxy attachments, ArrayProxy rects ) const + template + VULKAN_HPP_INLINE void CommandBuffer::clearAttachments( ArrayProxy attachments, ArrayProxy rects, Dispatch const &d ) const { - vkCmdClearAttachments( m_commandBuffer, attachments.size() , reinterpret_cast( attachments.data() ), rects.size() , reinterpret_cast( rects.data() ) ); + d.vkCmdClearAttachments( m_commandBuffer, attachments.size() , reinterpret_cast( attachments.data() ), rects.size() , reinterpret_cast( rects.data() ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::resolveImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageResolve* pRegions ) const + template + VULKAN_HPP_INLINE void CommandBuffer::resolveImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageResolve* pRegions, Dispatch const &d) const { - vkCmdResolveImage( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstImage ), static_cast( dstImageLayout ), regionCount, reinterpret_cast( pRegions ) ); + 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 - VULKAN_HPP_INLINE void CommandBuffer::resolveImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions ) const + template + VULKAN_HPP_INLINE void CommandBuffer::resolveImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions, Dispatch const &d ) const { - vkCmdResolveImage( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstImage ), static_cast( dstImageLayout ), regions.size() , reinterpret_cast( regions.data() ) ); + 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*/ - VULKAN_HPP_INLINE void CommandBuffer::setEvent( Event event, PipelineStageFlags stageMask ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::setEvent( Event event, PipelineStageFlags stageMask, Dispatch const &d) const + { + d.vkCmdSetEvent( m_commandBuffer, static_cast( event ), static_cast( stageMask ) ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::setEvent( Event event, PipelineStageFlags stageMask, Dispatch const &d ) const { - vkCmdSetEvent( m_commandBuffer, static_cast( event ), static_cast( stageMask ) ); + d.vkCmdSetEvent( m_commandBuffer, static_cast( event ), static_cast( stageMask ) ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::resetEvent( Event event, PipelineStageFlags stageMask ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::resetEvent( Event event, PipelineStageFlags stageMask, Dispatch const &d) const { - vkCmdResetEvent( m_commandBuffer, static_cast( event ), static_cast( stageMask ) ); + d.vkCmdResetEvent( m_commandBuffer, static_cast( event ), static_cast( stageMask ) ); } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::resetEvent( Event event, PipelineStageFlags stageMask, Dispatch const &d ) const + { + d.vkCmdResetEvent( m_commandBuffer, static_cast( event ), static_cast( stageMask ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::waitEvents( uint32_t eventCount, const Event* pEvents, PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const MemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const BufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const ImageMemoryBarrier* pImageMemoryBarriers ) const + template + VULKAN_HPP_INLINE void CommandBuffer::waitEvents( uint32_t eventCount, const Event* pEvents, PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const MemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const BufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const ImageMemoryBarrier* pImageMemoryBarriers, Dispatch const &d) const { - 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 ) ); + 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 - VULKAN_HPP_INLINE void CommandBuffer::waitEvents( ArrayProxy events, PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, ArrayProxy memoryBarriers, ArrayProxy bufferMemoryBarriers, ArrayProxy imageMemoryBarriers ) const + template + VULKAN_HPP_INLINE void CommandBuffer::waitEvents( ArrayProxy events, PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, ArrayProxy memoryBarriers, ArrayProxy bufferMemoryBarriers, ArrayProxy imageMemoryBarriers, Dispatch const &d ) const { - 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() ) ); + 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*/ - VULKAN_HPP_INLINE void CommandBuffer::pipelineBarrier( PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, DependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const MemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const BufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const ImageMemoryBarrier* pImageMemoryBarriers ) const + template + VULKAN_HPP_INLINE void CommandBuffer::pipelineBarrier( PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, DependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const MemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const BufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const ImageMemoryBarrier* pImageMemoryBarriers, Dispatch const &d) const { - vkCmdPipelineBarrier( m_commandBuffer, static_cast( srcStageMask ), static_cast( dstStageMask ), static_cast( dependencyFlags ), memoryBarrierCount, reinterpret_cast( pMemoryBarriers ), bufferMemoryBarrierCount, reinterpret_cast( pBufferMemoryBarriers ), imageMemoryBarrierCount, reinterpret_cast( pImageMemoryBarriers ) ); + 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 - VULKAN_HPP_INLINE void CommandBuffer::pipelineBarrier( PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, DependencyFlags dependencyFlags, ArrayProxy memoryBarriers, ArrayProxy bufferMemoryBarriers, ArrayProxy imageMemoryBarriers ) const + template + VULKAN_HPP_INLINE void CommandBuffer::pipelineBarrier( PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, DependencyFlags dependencyFlags, ArrayProxy memoryBarriers, ArrayProxy bufferMemoryBarriers, ArrayProxy imageMemoryBarriers, Dispatch const &d ) const { - 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() ) ); + 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*/ - VULKAN_HPP_INLINE void CommandBuffer::beginQuery( QueryPool queryPool, uint32_t query, QueryControlFlags flags ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::beginQuery( QueryPool queryPool, uint32_t query, QueryControlFlags flags, Dispatch const &d) const + { + d.vkCmdBeginQuery( m_commandBuffer, static_cast( queryPool ), query, static_cast( flags ) ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::beginQuery( QueryPool queryPool, uint32_t query, QueryControlFlags flags, Dispatch const &d ) const { - vkCmdBeginQuery( m_commandBuffer, static_cast( queryPool ), query, static_cast( flags ) ); + d.vkCmdBeginQuery( m_commandBuffer, static_cast( queryPool ), query, static_cast( flags ) ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::endQuery( QueryPool queryPool, uint32_t query ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::endQuery( QueryPool queryPool, uint32_t query, Dispatch const &d) const + { + d.vkCmdEndQuery( m_commandBuffer, static_cast( queryPool ), query ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::endQuery( QueryPool queryPool, uint32_t query, Dispatch const &d ) const { - vkCmdEndQuery( m_commandBuffer, static_cast( queryPool ), query ); + d.vkCmdEndQuery( m_commandBuffer, static_cast( queryPool ), query ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::resetQueryPool( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::resetQueryPool( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, Dispatch const &d) const + { + d.vkCmdResetQueryPool( m_commandBuffer, static_cast( queryPool ), firstQuery, queryCount ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::resetQueryPool( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, Dispatch const &d ) const { - vkCmdResetQueryPool( m_commandBuffer, static_cast( queryPool ), firstQuery, queryCount ); + d.vkCmdResetQueryPool( m_commandBuffer, static_cast( queryPool ), firstQuery, queryCount ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::writeTimestamp( PipelineStageFlagBits pipelineStage, QueryPool queryPool, uint32_t query ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::writeTimestamp( PipelineStageFlagBits pipelineStage, QueryPool queryPool, uint32_t query, Dispatch const &d) const { - vkCmdWriteTimestamp( m_commandBuffer, static_cast( pipelineStage ), static_cast( queryPool ), query ); + d.vkCmdWriteTimestamp( m_commandBuffer, static_cast( pipelineStage ), static_cast( queryPool ), query ); } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::writeTimestamp( PipelineStageFlagBits pipelineStage, QueryPool queryPool, uint32_t query, Dispatch const &d ) const + { + d.vkCmdWriteTimestamp( m_commandBuffer, static_cast( pipelineStage ), static_cast( queryPool ), query ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::copyQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, Buffer dstBuffer, DeviceSize dstOffset, DeviceSize stride, QueryResultFlags flags ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::copyQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, Buffer dstBuffer, DeviceSize dstOffset, DeviceSize stride, QueryResultFlags flags, Dispatch const &d) const + { + d.vkCmdCopyQueryPoolResults( m_commandBuffer, static_cast( queryPool ), firstQuery, queryCount, static_cast( dstBuffer ), dstOffset, stride, static_cast( flags ) ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::copyQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, Buffer dstBuffer, DeviceSize dstOffset, DeviceSize stride, QueryResultFlags flags, Dispatch const &d ) const { - vkCmdCopyQueryPoolResults( m_commandBuffer, static_cast( queryPool ), firstQuery, queryCount, static_cast( dstBuffer ), dstOffset, stride, static_cast( flags ) ); + d.vkCmdCopyQueryPoolResults( m_commandBuffer, static_cast( queryPool ), firstQuery, queryCount, static_cast( dstBuffer ), dstOffset, stride, static_cast( flags ) ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::pushConstants( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues ) const + template + VULKAN_HPP_INLINE void CommandBuffer::pushConstants( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues, Dispatch const &d) const { - vkCmdPushConstants( m_commandBuffer, static_cast( layout ), static_cast( stageFlags ), offset, size, pValues ); + 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( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, ArrayProxy values ) const + template + VULKAN_HPP_INLINE void CommandBuffer::pushConstants( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, ArrayProxy values, Dispatch const &d ) const { - vkCmdPushConstants( m_commandBuffer, static_cast( layout ), static_cast( stageFlags ), offset, values.size() * sizeof( T ) , reinterpret_cast( values.data() ) ); + d.vkCmdPushConstants( m_commandBuffer, static_cast( layout ), static_cast( stageFlags ), offset, values.size() * sizeof( T ) , reinterpret_cast( values.data() ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::beginRenderPass( const RenderPassBeginInfo* pRenderPassBegin, SubpassContents contents ) const + template + VULKAN_HPP_INLINE void CommandBuffer::beginRenderPass( const RenderPassBeginInfo* pRenderPassBegin, SubpassContents contents, Dispatch const &d) const { - vkCmdBeginRenderPass( m_commandBuffer, reinterpret_cast( pRenderPassBegin ), static_cast( contents ) ); + d.vkCmdBeginRenderPass( m_commandBuffer, reinterpret_cast( pRenderPassBegin ), static_cast( contents ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::beginRenderPass( const RenderPassBeginInfo & renderPassBegin, SubpassContents contents ) const + template + VULKAN_HPP_INLINE void CommandBuffer::beginRenderPass( const RenderPassBeginInfo & renderPassBegin, SubpassContents contents, Dispatch const &d ) const { - vkCmdBeginRenderPass( m_commandBuffer, reinterpret_cast( &renderPassBegin ), static_cast( contents ) ); + d.vkCmdBeginRenderPass( m_commandBuffer, reinterpret_cast( &renderPassBegin ), static_cast( contents ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::nextSubpass( SubpassContents contents ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::nextSubpass( SubpassContents contents, Dispatch const &d) const + { + d.vkCmdNextSubpass( m_commandBuffer, static_cast( contents ) ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::nextSubpass( SubpassContents contents, Dispatch const &d ) const { - vkCmdNextSubpass( m_commandBuffer, static_cast( contents ) ); + d.vkCmdNextSubpass( m_commandBuffer, static_cast( contents ) ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::endRenderPass() const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::endRenderPass(Dispatch const &d) const { - vkCmdEndRenderPass( m_commandBuffer ); + d.vkCmdEndRenderPass( m_commandBuffer ); } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::endRenderPass(Dispatch const &d ) const + { + d.vkCmdEndRenderPass( m_commandBuffer ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::executeCommands( uint32_t commandBufferCount, const CommandBuffer* pCommandBuffers ) const + template + VULKAN_HPP_INLINE void CommandBuffer::executeCommands( uint32_t commandBufferCount, const CommandBuffer* pCommandBuffers, Dispatch const &d) const { - vkCmdExecuteCommands( m_commandBuffer, commandBufferCount, reinterpret_cast( pCommandBuffers ) ); + d.vkCmdExecuteCommands( m_commandBuffer, commandBufferCount, reinterpret_cast( pCommandBuffers ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::executeCommands( ArrayProxy commandBuffers ) const + template + VULKAN_HPP_INLINE void CommandBuffer::executeCommands( ArrayProxy commandBuffers, Dispatch const &d ) const { - vkCmdExecuteCommands( m_commandBuffer, commandBuffers.size() , reinterpret_cast( commandBuffers.data() ) ); + d.vkCmdExecuteCommands( m_commandBuffer, commandBuffers.size() , reinterpret_cast( commandBuffers.data() ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::debugMarkerBeginEXT( const DebugMarkerMarkerInfoEXT* pMarkerInfo ) const + template + VULKAN_HPP_INLINE void CommandBuffer::debugMarkerBeginEXT( const DebugMarkerMarkerInfoEXT* pMarkerInfo, Dispatch const &d) const { - vkCmdDebugMarkerBeginEXT( m_commandBuffer, reinterpret_cast( pMarkerInfo ) ); + d.vkCmdDebugMarkerBeginEXT( m_commandBuffer, reinterpret_cast( pMarkerInfo ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::debugMarkerBeginEXT( const DebugMarkerMarkerInfoEXT & markerInfo ) const + template + VULKAN_HPP_INLINE void CommandBuffer::debugMarkerBeginEXT( const DebugMarkerMarkerInfoEXT & markerInfo, Dispatch const &d ) const { - vkCmdDebugMarkerBeginEXT( m_commandBuffer, reinterpret_cast( &markerInfo ) ); + d.vkCmdDebugMarkerBeginEXT( m_commandBuffer, reinterpret_cast( &markerInfo ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::debugMarkerEndEXT() const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::debugMarkerEndEXT(Dispatch const &d) const + { + d.vkCmdDebugMarkerEndEXT( m_commandBuffer ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::debugMarkerEndEXT(Dispatch const &d ) const { - vkCmdDebugMarkerEndEXT( m_commandBuffer ); + d.vkCmdDebugMarkerEndEXT( m_commandBuffer ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::debugMarkerInsertEXT( const DebugMarkerMarkerInfoEXT* pMarkerInfo ) const + template + VULKAN_HPP_INLINE void CommandBuffer::debugMarkerInsertEXT( const DebugMarkerMarkerInfoEXT* pMarkerInfo, Dispatch const &d) const { - vkCmdDebugMarkerInsertEXT( m_commandBuffer, reinterpret_cast( pMarkerInfo ) ); + d.vkCmdDebugMarkerInsertEXT( m_commandBuffer, reinterpret_cast( pMarkerInfo ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::debugMarkerInsertEXT( const DebugMarkerMarkerInfoEXT & markerInfo ) const + template + VULKAN_HPP_INLINE void CommandBuffer::debugMarkerInsertEXT( const DebugMarkerMarkerInfoEXT & markerInfo, Dispatch const &d ) const { - vkCmdDebugMarkerInsertEXT( m_commandBuffer, reinterpret_cast( &markerInfo ) ); + d.vkCmdDebugMarkerInsertEXT( m_commandBuffer, reinterpret_cast( &markerInfo ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::drawIndirectCountAMD( Buffer buffer, DeviceSize offset, Buffer countBuffer, DeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::drawIndirectCountAMD( Buffer buffer, DeviceSize offset, Buffer countBuffer, DeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, Dispatch const &d) const + { + d.vkCmdDrawIndirectCountAMD( m_commandBuffer, static_cast( buffer ), offset, static_cast( countBuffer ), countBufferOffset, maxDrawCount, stride ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::drawIndirectCountAMD( Buffer buffer, DeviceSize offset, Buffer countBuffer, DeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, Dispatch const &d ) const { - vkCmdDrawIndirectCountAMD( m_commandBuffer, static_cast( buffer ), offset, static_cast( countBuffer ), countBufferOffset, maxDrawCount, stride ); + d.vkCmdDrawIndirectCountAMD( m_commandBuffer, static_cast( buffer ), offset, static_cast( countBuffer ), countBufferOffset, maxDrawCount, stride ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::drawIndexedIndirectCountAMD( Buffer buffer, DeviceSize offset, Buffer countBuffer, DeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::drawIndexedIndirectCountAMD( Buffer buffer, DeviceSize offset, Buffer countBuffer, DeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, Dispatch const &d) const + { + d.vkCmdDrawIndexedIndirectCountAMD( m_commandBuffer, static_cast( buffer ), offset, static_cast( countBuffer ), countBufferOffset, maxDrawCount, stride ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::drawIndexedIndirectCountAMD( Buffer buffer, DeviceSize offset, Buffer countBuffer, DeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, Dispatch const &d ) const { - vkCmdDrawIndexedIndirectCountAMD( m_commandBuffer, static_cast( buffer ), offset, static_cast( countBuffer ), countBufferOffset, maxDrawCount, stride ); + d.vkCmdDrawIndexedIndirectCountAMD( m_commandBuffer, static_cast( buffer ), offset, static_cast( countBuffer ), countBufferOffset, maxDrawCount, stride ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::processCommandsNVX( const CmdProcessCommandsInfoNVX* pProcessCommandsInfo ) const + template + VULKAN_HPP_INLINE void CommandBuffer::processCommandsNVX( const CmdProcessCommandsInfoNVX* pProcessCommandsInfo, Dispatch const &d) const { - vkCmdProcessCommandsNVX( m_commandBuffer, reinterpret_cast( pProcessCommandsInfo ) ); + d.vkCmdProcessCommandsNVX( m_commandBuffer, reinterpret_cast( pProcessCommandsInfo ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::processCommandsNVX( const CmdProcessCommandsInfoNVX & processCommandsInfo ) const + template + VULKAN_HPP_INLINE void CommandBuffer::processCommandsNVX( const CmdProcessCommandsInfoNVX & processCommandsInfo, Dispatch const &d ) const { - vkCmdProcessCommandsNVX( m_commandBuffer, reinterpret_cast( &processCommandsInfo ) ); + d.vkCmdProcessCommandsNVX( m_commandBuffer, reinterpret_cast( &processCommandsInfo ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::reserveSpaceForCommandsNVX( const CmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo ) const + template + VULKAN_HPP_INLINE void CommandBuffer::reserveSpaceForCommandsNVX( const CmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo, Dispatch const &d) const { - vkCmdReserveSpaceForCommandsNVX( m_commandBuffer, reinterpret_cast( pReserveSpaceInfo ) ); + d.vkCmdReserveSpaceForCommandsNVX( m_commandBuffer, reinterpret_cast( pReserveSpaceInfo ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::reserveSpaceForCommandsNVX( const CmdReserveSpaceForCommandsInfoNVX & reserveSpaceInfo ) const + template + VULKAN_HPP_INLINE void CommandBuffer::reserveSpaceForCommandsNVX( const CmdReserveSpaceForCommandsInfoNVX & reserveSpaceInfo, Dispatch const &d ) const { - vkCmdReserveSpaceForCommandsNVX( m_commandBuffer, reinterpret_cast( &reserveSpaceInfo ) ); + d.vkCmdReserveSpaceForCommandsNVX( m_commandBuffer, reinterpret_cast( &reserveSpaceInfo ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::pushDescriptorSetKHR( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const WriteDescriptorSet* pDescriptorWrites ) const + template + VULKAN_HPP_INLINE void CommandBuffer::pushDescriptorSetKHR( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const WriteDescriptorSet* pDescriptorWrites, Dispatch const &d) const { - vkCmdPushDescriptorSetKHR( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( layout ), set, descriptorWriteCount, reinterpret_cast( pDescriptorWrites ) ); + d.vkCmdPushDescriptorSetKHR( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( layout ), set, descriptorWriteCount, reinterpret_cast( pDescriptorWrites ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::pushDescriptorSetKHR( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t set, ArrayProxy descriptorWrites ) const + template + VULKAN_HPP_INLINE void CommandBuffer::pushDescriptorSetKHR( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t set, ArrayProxy descriptorWrites, Dispatch const &d ) const + { + d.vkCmdPushDescriptorSetKHR( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( layout ), set, descriptorWrites.size() , reinterpret_cast( descriptorWrites.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::setDeviceMask( uint32_t deviceMask, Dispatch const &d) const + { + d.vkCmdSetDeviceMask( m_commandBuffer, deviceMask ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::setDeviceMask( uint32_t deviceMask, Dispatch const &d ) const + { + d.vkCmdSetDeviceMask( m_commandBuffer, deviceMask ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::setDeviceMaskKHR( uint32_t deviceMask, Dispatch const &d) const + { + d.vkCmdSetDeviceMaskKHR( m_commandBuffer, deviceMask ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::setDeviceMaskKHR( uint32_t deviceMask, Dispatch const &d ) const + { + d.vkCmdSetDeviceMaskKHR( m_commandBuffer, deviceMask ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + 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 + { + d.vkCmdDispatchBase( m_commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ ); + } +#else + 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 + { + d.vkCmdDispatchBase( m_commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + 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 { - vkCmdPushDescriptorSetKHR( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( layout ), set, descriptorWrites.size() , reinterpret_cast( descriptorWrites.data() ) ); + d.vkCmdDispatchBaseKHR( m_commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ ); + } +#else + 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 + { + d.vkCmdDispatchBaseKHR( m_commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::pushDescriptorSetWithTemplateKHR( DescriptorUpdateTemplate descriptorUpdateTemplate, PipelineLayout layout, uint32_t set, const void* pData, Dispatch const &d) const + { + d.vkCmdPushDescriptorSetWithTemplateKHR( m_commandBuffer, static_cast( descriptorUpdateTemplate ), static_cast( layout ), set, pData ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::pushDescriptorSetWithTemplateKHR( DescriptorUpdateTemplate descriptorUpdateTemplate, PipelineLayout layout, uint32_t set, const void* pData, Dispatch const &d ) const + { + d.vkCmdPushDescriptorSetWithTemplateKHR( m_commandBuffer, static_cast( descriptorUpdateTemplate ), static_cast( layout ), set, pData ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::setDeviceMaskKHX( uint32_t deviceMask ) const + template + VULKAN_HPP_INLINE void CommandBuffer::setViewportWScalingNV( uint32_t firstViewport, uint32_t viewportCount, const ViewportWScalingNV* pViewportWScalings, Dispatch const &d) const + { + 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 viewportWScalings, Dispatch const &d ) const { - vkCmdSetDeviceMaskKHX( m_commandBuffer, deviceMask ); + d.vkCmdSetViewportWScalingNV( m_commandBuffer, firstViewport, viewportWScalings.size() , reinterpret_cast( viewportWScalings.data() ) ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::dispatchBaseKHX( uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const + template + VULKAN_HPP_INLINE void CommandBuffer::setDiscardRectangleEXT( uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const Rect2D* pDiscardRectangles, Dispatch const &d) const + { + 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 discardRectangles, Dispatch const &d ) const { - vkCmdDispatchBaseKHX( m_commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ ); + d.vkCmdSetDiscardRectangleEXT( m_commandBuffer, firstDiscardRectangle, discardRectangles.size() , reinterpret_cast( discardRectangles.data() ) ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::pushDescriptorSetWithTemplateKHR( DescriptorUpdateTemplateKHR descriptorUpdateTemplate, PipelineLayout layout, uint32_t set, const void* pData ) const + template + VULKAN_HPP_INLINE void CommandBuffer::setSampleLocationsEXT( const SampleLocationsInfoEXT* pSampleLocationsInfo, Dispatch const &d) const + { + d.vkCmdSetSampleLocationsEXT( m_commandBuffer, reinterpret_cast( pSampleLocationsInfo ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::setSampleLocationsEXT( const SampleLocationsInfoEXT & sampleLocationsInfo, Dispatch const &d ) const { - vkCmdPushDescriptorSetWithTemplateKHR( m_commandBuffer, static_cast( descriptorUpdateTemplate ), static_cast( layout ), set, pData ); + d.vkCmdSetSampleLocationsEXT( m_commandBuffer, reinterpret_cast( &sampleLocationsInfo ) ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::setViewportWScalingNV( uint32_t firstViewport, uint32_t viewportCount, const ViewportWScalingNV* pViewportWScalings ) const + template + VULKAN_HPP_INLINE void CommandBuffer::beginDebugUtilsLabelEXT( const DebugUtilsLabelEXT* pLabelInfo, Dispatch const &d) const { - vkCmdSetViewportWScalingNV( m_commandBuffer, firstViewport, viewportCount, reinterpret_cast( pViewportWScalings ) ); + d.vkCmdBeginDebugUtilsLabelEXT( m_commandBuffer, reinterpret_cast( pLabelInfo ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::setViewportWScalingNV( uint32_t firstViewport, ArrayProxy viewportWScalings ) const + template + VULKAN_HPP_INLINE void CommandBuffer::beginDebugUtilsLabelEXT( const DebugUtilsLabelEXT & labelInfo, Dispatch const &d ) const + { + d.vkCmdBeginDebugUtilsLabelEXT( m_commandBuffer, reinterpret_cast( &labelInfo ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::endDebugUtilsLabelEXT(Dispatch const &d) const { - vkCmdSetViewportWScalingNV( m_commandBuffer, firstViewport, viewportWScalings.size() , reinterpret_cast( viewportWScalings.data() ) ); + d.vkCmdEndDebugUtilsLabelEXT( m_commandBuffer ); + } +#else + template + VULKAN_HPP_INLINE void CommandBuffer::endDebugUtilsLabelEXT(Dispatch const &d ) const + { + d.vkCmdEndDebugUtilsLabelEXT( m_commandBuffer ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::setDiscardRectangleEXT( uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const Rect2D* pDiscardRectangles ) const + template + VULKAN_HPP_INLINE void CommandBuffer::insertDebugUtilsLabelEXT( const DebugUtilsLabelEXT* pLabelInfo, Dispatch const &d) const { - vkCmdSetDiscardRectangleEXT( m_commandBuffer, firstDiscardRectangle, discardRectangleCount, reinterpret_cast( pDiscardRectangles ) ); + d.vkCmdInsertDebugUtilsLabelEXT( m_commandBuffer, reinterpret_cast( pLabelInfo ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::setDiscardRectangleEXT( uint32_t firstDiscardRectangle, ArrayProxy discardRectangles ) const + template + VULKAN_HPP_INLINE void CommandBuffer::insertDebugUtilsLabelEXT( const DebugUtilsLabelEXT & labelInfo, Dispatch const &d ) const { - vkCmdSetDiscardRectangleEXT( m_commandBuffer, firstDiscardRectangle, discardRectangles.size() , reinterpret_cast( discardRectangles.data() ) ); + d.vkCmdInsertDebugUtilsLabelEXT( m_commandBuffer, reinterpret_cast( &labelInfo ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void CommandBuffer::setSampleLocationsEXT( const SampleLocationsInfoEXT* pSampleLocationsInfo ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::writeBufferMarkerAMD( PipelineStageFlagBits pipelineStage, Buffer dstBuffer, DeviceSize dstOffset, uint32_t marker, Dispatch const &d) const { - vkCmdSetSampleLocationsEXT( m_commandBuffer, reinterpret_cast( pSampleLocationsInfo ) ); + d.vkCmdWriteBufferMarkerAMD( m_commandBuffer, static_cast( pipelineStage ), static_cast( dstBuffer ), dstOffset, marker ); } -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void CommandBuffer::setSampleLocationsEXT( const SampleLocationsInfoEXT & sampleLocationsInfo ) const +#else + template + VULKAN_HPP_INLINE void CommandBuffer::writeBufferMarkerAMD( PipelineStageFlagBits pipelineStage, Buffer dstBuffer, DeviceSize dstOffset, uint32_t marker, Dispatch const &d ) const { - vkCmdSetSampleLocationsEXT( m_commandBuffer, reinterpret_cast( &sampleLocationsInfo ) ); + d.vkCmdWriteBufferMarkerAMD( m_commandBuffer, static_cast( pipelineStage ), static_cast( dstBuffer ), dstOffset, marker ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ struct SubmitInfo { SubmitInfo( uint32_t waitSemaphoreCount_ = 0, const Semaphore* pWaitSemaphores_ = nullptr, const PipelineStageFlags* pWaitDstStageMask_ = nullptr, uint32_t commandBufferCount_ = 0, const CommandBuffer* pCommandBuffers_ = nullptr, uint32_t signalSemaphoreCount_ = 0, const Semaphore* pSignalSemaphores_ = nullptr ) - : sType( StructureType::eSubmitInfo ) - , pNext( nullptr ) - , waitSemaphoreCount( waitSemaphoreCount_ ) + : waitSemaphoreCount( waitSemaphoreCount_ ) , pWaitSemaphores( pWaitSemaphores_ ) , pWaitDstStageMask( pWaitDstStageMask_ ) , commandBufferCount( commandBufferCount_ ) @@ -26665,10 +31040,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eSubmitInfo; public: - const void* pNext; + const void* pNext = nullptr; uint32_t waitSemaphoreCount; const Semaphore* pWaitSemaphores; const PipelineStageFlags* pWaitDstStageMask; @@ -26682,16 +31057,16 @@ class Queue { public: - Queue() + VULKAN_HPP_CONSTEXPR Queue() : m_queue(VK_NULL_HANDLE) {} - Queue( std::nullptr_t ) + VULKAN_HPP_CONSTEXPR Queue( std::nullptr_t ) : m_queue(VK_NULL_HANDLE) {} VULKAN_HPP_TYPESAFE_EXPLICIT Queue( VkQueue queue ) - : m_queue( queue ) + : m_queue( queue ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -26723,25 +31098,50 @@ return m_queue < rhs.m_queue; } - Result submit( uint32_t submitCount, const SubmitInfo* pSubmits, Fence fence ) const; + template + Result submit( uint32_t submitCount, const SubmitInfo* pSubmits, Fence fence, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type submit( ArrayProxy submits, Fence fence ) const; + template + ResultValueType::type submit( ArrayProxy submits, Fence fence, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result waitIdle() const; + template + Result waitIdle(Dispatch const &d = Dispatch() ) const; #else - ResultValueType::type waitIdle() const; + template + ResultValueType::type waitIdle(Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + Result bindSparse( uint32_t bindInfoCount, const BindSparseInfo* pBindInfo, Fence fence, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type bindSparse( ArrayProxy bindInfo, Fence fence, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + Result presentKHR( const PresentInfoKHR* pPresentInfo, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + Result presentKHR( const PresentInfoKHR & presentInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result bindSparse( uint32_t bindInfoCount, const BindSparseInfo* pBindInfo, Fence fence ) const; + template + void beginDebugUtilsLabelEXT( const DebugUtilsLabelEXT* pLabelInfo, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type bindSparse( ArrayProxy bindInfo, Fence fence ) const; + template + void beginDebugUtilsLabelEXT( const DebugUtilsLabelEXT & labelInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result presentKHR( const PresentInfoKHR* pPresentInfo ) const; + template + void endDebugUtilsLabelEXT(Dispatch const &d = Dispatch() ) const; + + template + void insertDebugUtilsLabelEXT( const DebugUtilsLabelEXT* pLabelInfo, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result presentKHR( const PresentInfoKHR & presentInfo ) const; + template + void insertDebugUtilsLabelEXT( const DebugUtilsLabelEXT & labelInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -26767,125 +31167,175 @@ static_assert( sizeof( Queue ) == sizeof( VkQueue ), "handle and wrapper have different size!" ); - VULKAN_HPP_INLINE Result Queue::submit( uint32_t submitCount, const SubmitInfo* pSubmits, Fence fence ) const + template + VULKAN_HPP_INLINE Result Queue::submit( uint32_t submitCount, const SubmitInfo* pSubmits, Fence fence, Dispatch const &d) const + { + return static_cast( d.vkQueueSubmit( m_queue, submitCount, reinterpret_cast( pSubmits ), static_cast( fence ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE ResultValueType::type Queue::submit( ArrayProxy submits, Fence fence, Dispatch const &d ) const + { + Result result = static_cast( d.vkQueueSubmit( m_queue, submits.size() , reinterpret_cast( submits.data() ), static_cast( fence ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Queue::submit" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE Result Queue::waitIdle(Dispatch const &d) const + { + return static_cast( d.vkQueueWaitIdle( m_queue ) ); + } +#else + template + VULKAN_HPP_INLINE ResultValueType::type Queue::waitIdle(Dispatch const &d ) const + { + Result result = static_cast( d.vkQueueWaitIdle( m_queue ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Queue::waitIdle" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE Result Queue::bindSparse( uint32_t bindInfoCount, const BindSparseInfo* pBindInfo, Fence fence, Dispatch const &d) const + { + return static_cast( d.vkQueueBindSparse( m_queue, bindInfoCount, reinterpret_cast( pBindInfo ), static_cast( fence ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE ResultValueType::type Queue::bindSparse( ArrayProxy bindInfo, Fence fence, Dispatch const &d ) const + { + Result result = static_cast( d.vkQueueBindSparse( m_queue, bindInfo.size() , reinterpret_cast( bindInfo.data() ), static_cast( fence ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Queue::bindSparse" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE Result Queue::presentKHR( const PresentInfoKHR* pPresentInfo, Dispatch const &d) const + { + return static_cast( d.vkQueuePresentKHR( m_queue, reinterpret_cast( pPresentInfo ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE Result Queue::presentKHR( const PresentInfoKHR & presentInfo, Dispatch const &d ) const + { + Result result = static_cast( d.vkQueuePresentKHR( m_queue, reinterpret_cast( &presentInfo ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Queue::presentKHR", { Result::eSuccess, Result::eSuboptimalKHR } ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE void Queue::beginDebugUtilsLabelEXT( const DebugUtilsLabelEXT* pLabelInfo, Dispatch const &d) const { - return static_cast( vkQueueSubmit( m_queue, submitCount, reinterpret_cast( pSubmits ), static_cast( fence ) ) ); + d.vkQueueBeginDebugUtilsLabelEXT( m_queue, reinterpret_cast( pLabelInfo ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Queue::submit( ArrayProxy submits, Fence fence ) const + template + VULKAN_HPP_INLINE void Queue::beginDebugUtilsLabelEXT( const DebugUtilsLabelEXT & labelInfo, Dispatch const &d ) const { - Result result = static_cast( vkQueueSubmit( m_queue, submits.size() , reinterpret_cast( submits.data() ), static_cast( fence ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Queue::submit" ); + d.vkQueueBeginDebugUtilsLabelEXT( m_queue, reinterpret_cast( &labelInfo ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Result Queue::waitIdle() const + template + VULKAN_HPP_INLINE void Queue::endDebugUtilsLabelEXT(Dispatch const &d) const { - return static_cast( vkQueueWaitIdle( m_queue ) ); + d.vkQueueEndDebugUtilsLabelEXT( m_queue ); } #else - VULKAN_HPP_INLINE ResultValueType::type Queue::waitIdle() const + template + VULKAN_HPP_INLINE void Queue::endDebugUtilsLabelEXT(Dispatch const &d ) const { - Result result = static_cast( vkQueueWaitIdle( m_queue ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Queue::waitIdle" ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_INLINE Result Queue::bindSparse( uint32_t bindInfoCount, const BindSparseInfo* pBindInfo, Fence fence ) const - { - return static_cast( vkQueueBindSparse( m_queue, bindInfoCount, reinterpret_cast( pBindInfo ), static_cast( fence ) ) ); - } -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Queue::bindSparse( ArrayProxy bindInfo, Fence fence ) const - { - Result result = static_cast( vkQueueBindSparse( m_queue, bindInfo.size() , reinterpret_cast( bindInfo.data() ), static_cast( fence ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Queue::bindSparse" ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_INLINE Result Queue::presentKHR( const PresentInfoKHR* pPresentInfo ) const - { - return static_cast( vkQueuePresentKHR( m_queue, reinterpret_cast( pPresentInfo ) ) ); - } -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Result Queue::presentKHR( const PresentInfoKHR & presentInfo ) const - { - Result result = static_cast( vkQueuePresentKHR( m_queue, reinterpret_cast( &presentInfo ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Queue::presentKHR", { Result::eSuccess, Result::eSuboptimalKHR } ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_NO_SMART_HANDLE - class BufferDeleter; - using UniqueBuffer = UniqueHandle; - class BufferViewDeleter; - using UniqueBufferView = UniqueHandle; - class CommandBufferDeleter; - using UniqueCommandBuffer = UniqueHandle; - class CommandPoolDeleter; - using UniqueCommandPool = UniqueHandle; - class DescriptorPoolDeleter; - using UniqueDescriptorPool = UniqueHandle; - class DescriptorSetDeleter; - using UniqueDescriptorSet = UniqueHandle; - class DescriptorSetLayoutDeleter; - using UniqueDescriptorSetLayout = UniqueHandle; - class DescriptorUpdateTemplateKHRDeleter; - using UniqueDescriptorUpdateTemplateKHR = UniqueHandle; - class DeviceMemoryDeleter; - using UniqueDeviceMemory = UniqueHandle; - class EventDeleter; - using UniqueEvent = UniqueHandle; - class FenceDeleter; - using UniqueFence = UniqueHandle; - class FramebufferDeleter; - using UniqueFramebuffer = UniqueHandle; - class ImageDeleter; - using UniqueImage = UniqueHandle; - class ImageViewDeleter; - using UniqueImageView = UniqueHandle; - class IndirectCommandsLayoutNVXDeleter; - using UniqueIndirectCommandsLayoutNVX = UniqueHandle; - class ObjectTableNVXDeleter; - using UniqueObjectTableNVX = UniqueHandle; - class PipelineDeleter; - using UniquePipeline = UniqueHandle; - class PipelineCacheDeleter; - using UniquePipelineCache = UniqueHandle; - class PipelineLayoutDeleter; - using UniquePipelineLayout = UniqueHandle; - class QueryPoolDeleter; - using UniqueQueryPool = UniqueHandle; - class RenderPassDeleter; - using UniqueRenderPass = UniqueHandle; - class SamplerDeleter; - using UniqueSampler = UniqueHandle; - class SamplerYcbcrConversionKHRDeleter; - using UniqueSamplerYcbcrConversionKHR = UniqueHandle; - class SemaphoreDeleter; - using UniqueSemaphore = UniqueHandle; - class ShaderModuleDeleter; - using UniqueShaderModule = UniqueHandle; - class SwapchainKHRDeleter; - using UniqueSwapchainKHR = UniqueHandle; - class ValidationCacheEXTDeleter; - using UniqueValidationCacheEXT = UniqueHandle; + d.vkQueueEndDebugUtilsLabelEXT( m_queue ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE void Queue::insertDebugUtilsLabelEXT( const DebugUtilsLabelEXT* pLabelInfo, Dispatch const &d) const + { + d.vkQueueInsertDebugUtilsLabelEXT( m_queue, reinterpret_cast( pLabelInfo ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Queue::insertDebugUtilsLabelEXT( const DebugUtilsLabelEXT & labelInfo, Dispatch const &d ) const + { + d.vkQueueInsertDebugUtilsLabelEXT( m_queue, reinterpret_cast( &labelInfo ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifndef VULKAN_HPP_NO_SMART_HANDLE + class Device; + + template <> class UniqueHandleTraits {public: using deleter = ObjectDestroy; }; + using UniqueBuffer = UniqueHandle; + 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 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; + 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 UniqueIndirectCommandsLayoutNVX = UniqueHandle; + template <> class UniqueHandleTraits {public: using deleter = ObjectDestroy; }; + using UniqueObjectTableNVX = 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 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; + 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; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ class Device { public: - Device() + VULKAN_HPP_CONSTEXPR Device() : m_device(VK_NULL_HANDLE) {} - Device( std::nullptr_t ) + VULKAN_HPP_CONSTEXPR Device( std::nullptr_t ) : m_device(VK_NULL_HANDLE) {} VULKAN_HPP_TYPESAFE_EXPLICIT Device( VkDevice device ) - : m_device( device ) + : m_device( device ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -26917,3207 +31367,4426 @@ return m_device < rhs.m_device; } - PFN_vkVoidFunction getProcAddr( const char* pName ) const; + template + PFN_vkVoidFunction getProcAddr( const char* pName, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - PFN_vkVoidFunction getProcAddr( const std::string & name ) const; + template + PFN_vkVoidFunction getProcAddr( const std::string & name, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroy( const AllocationCallbacks* pAllocator ) const; + template + void destroy( const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroy( Optional allocator = nullptr ) const; + template + void destroy( Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex, Queue* pQueue ) const; + template + void getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex, Queue* pQueue, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - Queue getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex ) const; + template + Queue getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result waitIdle() const; + template + Result waitIdle(Dispatch const &d = Dispatch() ) const; #else - ResultValueType::type waitIdle() const; + template + ResultValueType::type waitIdle(Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result allocateMemory( const MemoryAllocateInfo* pAllocateInfo, const AllocationCallbacks* pAllocator, DeviceMemory* pMemory ) const; + template + Result allocateMemory( const MemoryAllocateInfo* pAllocateInfo, const AllocationCallbacks* pAllocator, DeviceMemory* pMemory, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type allocateMemory( const MemoryAllocateInfo & allocateInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type allocateMemory( const MemoryAllocateInfo & allocateInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueDeviceMemory allocateMemoryUnique( const MemoryAllocateInfo & allocateInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type allocateMemoryUnique( const MemoryAllocateInfo & allocateInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void freeMemory( DeviceMemory memory, const AllocationCallbacks* pAllocator ) const; + template + void freeMemory( DeviceMemory memory, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void freeMemory( DeviceMemory memory, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + void free( DeviceMemory memory, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void freeMemory( DeviceMemory memory, Optional allocator = nullptr ) const; + template + void free( DeviceMemory memory, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result mapMemory( DeviceMemory memory, DeviceSize offset, DeviceSize size, MemoryMapFlags flags, void** ppData ) const; + template + Result mapMemory( DeviceMemory memory, DeviceSize offset, DeviceSize size, MemoryMapFlags flags, void** ppData, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type mapMemory( DeviceMemory memory, DeviceSize offset, DeviceSize size, MemoryMapFlags flags = MemoryMapFlags() ) const; + template + ResultValueType::type mapMemory( DeviceMemory memory, DeviceSize offset, DeviceSize size, MemoryMapFlags flags = MemoryMapFlags(), Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void unmapMemory( DeviceMemory memory ) const; + template + void unmapMemory( DeviceMemory memory, Dispatch const &d = Dispatch() ) const; - Result flushMappedMemoryRanges( uint32_t memoryRangeCount, const MappedMemoryRange* pMemoryRanges ) const; + template + Result flushMappedMemoryRanges( uint32_t memoryRangeCount, const MappedMemoryRange* pMemoryRanges, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type flushMappedMemoryRanges( ArrayProxy memoryRanges ) const; + template + ResultValueType::type flushMappedMemoryRanges( ArrayProxy memoryRanges, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result invalidateMappedMemoryRanges( uint32_t memoryRangeCount, const MappedMemoryRange* pMemoryRanges ) const; + template + Result invalidateMappedMemoryRanges( uint32_t memoryRangeCount, const MappedMemoryRange* pMemoryRanges, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type invalidateMappedMemoryRanges( ArrayProxy memoryRanges ) const; + template + ResultValueType::type invalidateMappedMemoryRanges( ArrayProxy memoryRanges, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getMemoryCommitment( DeviceMemory memory, DeviceSize* pCommittedMemoryInBytes ) const; + template + void getMemoryCommitment( DeviceMemory memory, DeviceSize* pCommittedMemoryInBytes, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - DeviceSize getMemoryCommitment( DeviceMemory memory ) const; + template + DeviceSize getMemoryCommitment( DeviceMemory memory, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getBufferMemoryRequirements( Buffer buffer, MemoryRequirements* pMemoryRequirements ) const; + template + void getBufferMemoryRequirements( Buffer buffer, MemoryRequirements* pMemoryRequirements, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - MemoryRequirements getBufferMemoryRequirements( Buffer buffer ) const; + template + MemoryRequirements getBufferMemoryRequirements( Buffer buffer, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result bindBufferMemory( Buffer buffer, DeviceMemory memory, DeviceSize memoryOffset ) const; + template + Result bindBufferMemory( Buffer buffer, DeviceMemory memory, DeviceSize memoryOffset, Dispatch const &d = Dispatch() ) const; #else - ResultValueType::type bindBufferMemory( Buffer buffer, DeviceMemory memory, DeviceSize memoryOffset ) const; + template + ResultValueType::type bindBufferMemory( Buffer buffer, DeviceMemory memory, DeviceSize memoryOffset, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getImageMemoryRequirements( Image image, MemoryRequirements* pMemoryRequirements ) const; + template + void getImageMemoryRequirements( Image image, MemoryRequirements* pMemoryRequirements, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - MemoryRequirements getImageMemoryRequirements( Image image ) const; + template + MemoryRequirements getImageMemoryRequirements( Image image, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result bindImageMemory( Image image, DeviceMemory memory, DeviceSize memoryOffset ) const; + template + Result bindImageMemory( Image image, DeviceMemory memory, DeviceSize memoryOffset, Dispatch const &d = Dispatch() ) const; #else - ResultValueType::type bindImageMemory( Image image, DeviceMemory memory, DeviceSize memoryOffset ) const; + template + ResultValueType::type bindImageMemory( Image image, DeviceMemory memory, DeviceSize memoryOffset, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getImageSparseMemoryRequirements( Image image, uint32_t* pSparseMemoryRequirementCount, SparseImageMemoryRequirements* pSparseMemoryRequirements ) const; + template + void getImageSparseMemoryRequirements( Image image, uint32_t* pSparseMemoryRequirementCount, SparseImageMemoryRequirements* pSparseMemoryRequirements, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - std::vector getImageSparseMemoryRequirements( Image image ) const; + template , typename Dispatch = DispatchLoaderStatic> + std::vector getImageSparseMemoryRequirements( Image image, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createFence( const FenceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Fence* pFence ) const; + template + Result createFence( const FenceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Fence* pFence, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createFence( const FenceCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createFence( const FenceCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueFence createFenceUnique( const FenceCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createFenceUnique( const FenceCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyFence( Fence fence, const AllocationCallbacks* pAllocator ) const; + template + void destroyFence( Fence fence, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void destroyFence( Fence fence, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + void destroy( Fence fence, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyFence( Fence fence, Optional allocator = nullptr ) const; + template + void destroy( Fence fence, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result resetFences( uint32_t fenceCount, const Fence* pFences ) const; + template + Result resetFences( uint32_t fenceCount, const Fence* pFences, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type resetFences( ArrayProxy fences ) const; + template + ResultValueType::type resetFences( ArrayProxy fences, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getFenceStatus( Fence fence ) const; + template + Result getFenceStatus( Fence fence, Dispatch const &d = Dispatch() ) const; - Result waitForFences( uint32_t fenceCount, const Fence* pFences, Bool32 waitAll, uint64_t timeout ) const; + template + Result waitForFences( uint32_t fenceCount, const Fence* pFences, Bool32 waitAll, uint64_t timeout, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result waitForFences( ArrayProxy fences, Bool32 waitAll, uint64_t timeout ) const; + template + Result waitForFences( ArrayProxy fences, Bool32 waitAll, uint64_t timeout, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createSemaphore( const SemaphoreCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Semaphore* pSemaphore ) const; + template + Result createSemaphore( const SemaphoreCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Semaphore* pSemaphore, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createSemaphore( const SemaphoreCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createSemaphore( const SemaphoreCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueSemaphore createSemaphoreUnique( const SemaphoreCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createSemaphoreUnique( const SemaphoreCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroySemaphore( Semaphore semaphore, const AllocationCallbacks* pAllocator ) const; + template + void destroySemaphore( Semaphore semaphore, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroySemaphore( Semaphore semaphore, Optional allocator = nullptr ) const; + template + void destroySemaphore( Semaphore semaphore, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createEvent( const EventCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Event* pEvent ) const; + template + void destroy( Semaphore semaphore, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createEvent( const EventCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + void destroy( Semaphore semaphore, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + Result createEvent( const EventCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Event* pEvent, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type createEvent( const EventCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueEvent createEventUnique( const EventCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createEventUnique( const EventCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyEvent( Event event, const AllocationCallbacks* pAllocator ) const; + template + void destroyEvent( Event event, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void destroyEvent( Event event, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + void destroy( Event event, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyEvent( Event event, Optional allocator = nullptr ) const; + template + void destroy( Event event, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getEventStatus( Event event ) const; + template + Result getEventStatus( Event event, Dispatch const &d = Dispatch() ) const; #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result setEvent( Event event ) const; + template + Result setEvent( Event event, Dispatch const &d = Dispatch() ) const; #else - ResultValueType::type setEvent( Event event ) const; + template + ResultValueType::type setEvent( Event event, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result resetEvent( Event event ) const; + template + Result resetEvent( Event event, Dispatch const &d = Dispatch() ) const; #else - ResultValueType::type resetEvent( Event event ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result createQueryPool( const QueryPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, QueryPool* pQueryPool ) const; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createQueryPool( const QueryPoolCreateInfo & createInfo, Optional allocator = nullptr ) const; -#ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueQueryPool createQueryPoolUnique( const QueryPoolCreateInfo & createInfo, Optional allocator = nullptr ) const; -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void destroyQueryPool( QueryPool queryPool, const AllocationCallbacks* pAllocator ) const; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyQueryPool( QueryPool queryPool, Optional allocator = nullptr ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result getQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, DeviceSize stride, QueryResultFlags flags ) const; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - Result getQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, ArrayProxy data, DeviceSize stride, QueryResultFlags flags ) const; + template + ResultValueType::type resetEvent( Event event, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createBuffer( const BufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Buffer* pBuffer ) const; + template + Result createQueryPool( const QueryPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, QueryPool* pQueryPool, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createBuffer( const BufferCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createQueryPool( const QueryPoolCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueBuffer createBufferUnique( const BufferCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createQueryPoolUnique( const QueryPoolCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyBuffer( Buffer buffer, const AllocationCallbacks* pAllocator ) const; + template + void destroyQueryPool( QueryPool queryPool, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyBuffer( Buffer buffer, Optional allocator = nullptr ) const; + template + void destroyQueryPool( QueryPool queryPool, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createBufferView( const BufferViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, BufferView* pView ) const; + template + void destroy( QueryPool queryPool, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createBufferView( const BufferViewCreateInfo & createInfo, Optional allocator = nullptr ) const; -#ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueBufferView createBufferViewUnique( const BufferViewCreateInfo & createInfo, Optional allocator = nullptr ) const; -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + template + void destroy( QueryPool queryPool, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyBufferView( BufferView bufferView, const AllocationCallbacks* pAllocator ) const; + template + Result getQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, DeviceSize stride, QueryResultFlags flags, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyBufferView( BufferView bufferView, Optional allocator = nullptr ) const; + template + Result getQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, ArrayProxy data, DeviceSize stride, QueryResultFlags flags, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createImage( const ImageCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Image* pImage ) const; + template + Result createBuffer( const BufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Buffer* pBuffer, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createImage( const ImageCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createBuffer( const BufferCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueImage createImageUnique( const ImageCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createBufferUnique( const BufferCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyImage( Image image, const AllocationCallbacks* pAllocator ) const; + template + void destroyBuffer( Buffer buffer, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyImage( Image image, Optional allocator = nullptr ) const; + template + void destroyBuffer( Buffer buffer, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getImageSubresourceLayout( Image image, const ImageSubresource* pSubresource, SubresourceLayout* pLayout ) const; + template + void destroy( Buffer buffer, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - SubresourceLayout getImageSubresourceLayout( Image image, const ImageSubresource & subresource ) const; + template + void destroy( Buffer buffer, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createImageView( const ImageViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, ImageView* pView ) const; + template + Result createBufferView( const BufferViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, BufferView* pView, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createImageView( const ImageViewCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createBufferView( const BufferViewCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueImageView createImageViewUnique( const ImageViewCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createBufferViewUnique( const BufferViewCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyImageView( ImageView imageView, const AllocationCallbacks* pAllocator ) const; + template + void destroyBufferView( BufferView bufferView, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyImageView( ImageView imageView, Optional allocator = nullptr ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result createShaderModule( const ShaderModuleCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, ShaderModule* pShaderModule ) const; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createShaderModule( const ShaderModuleCreateInfo & createInfo, Optional allocator = nullptr ) const; -#ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueShaderModule createShaderModuleUnique( const ShaderModuleCreateInfo & createInfo, Optional allocator = nullptr ) const; -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + template + void destroyBufferView( BufferView bufferView, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyShaderModule( ShaderModule shaderModule, const AllocationCallbacks* pAllocator ) const; + template + void destroy( BufferView bufferView, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyShaderModule( ShaderModule shaderModule, Optional allocator = nullptr ) const; + template + void destroy( BufferView bufferView, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createPipelineCache( const PipelineCacheCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, PipelineCache* pPipelineCache ) const; + template + Result createImage( const ImageCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Image* pImage, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createPipelineCache( const PipelineCacheCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createImage( const ImageCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniquePipelineCache createPipelineCacheUnique( const PipelineCacheCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createImageUnique( const ImageCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyPipelineCache( PipelineCache pipelineCache, const AllocationCallbacks* pAllocator ) const; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyPipelineCache( PipelineCache pipelineCache, Optional allocator = nullptr ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result getPipelineCacheData( PipelineCache pipelineCache, size_t* pDataSize, void* pData ) const; + template + void destroyImage( Image image, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getPipelineCacheData( PipelineCache pipelineCache ) const; + template + void destroyImage( Image image, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result mergePipelineCaches( PipelineCache dstCache, uint32_t srcCacheCount, const PipelineCache* pSrcCaches ) const; + template + void destroy( Image image, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type mergePipelineCaches( PipelineCache dstCache, ArrayProxy srcCaches ) const; + template + void destroy( Image image, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createGraphicsPipelines( PipelineCache pipelineCache, uint32_t createInfoCount, const GraphicsPipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines ) const; + template + void getImageSubresourceLayout( Image image, const ImageSubresource* pSubresource, SubresourceLayout* pLayout, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type createGraphicsPipelines( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator = nullptr ) const; - ResultValueType::type createGraphicsPipeline( PipelineCache pipelineCache, const GraphicsPipelineCreateInfo & createInfo, Optional allocator = nullptr ) const; -#ifndef VULKAN_HPP_NO_SMART_HANDLE - template > - std::vector createGraphicsPipelinesUnique( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator = nullptr ) const; - UniquePipeline createGraphicsPipelineUnique( PipelineCache pipelineCache, const GraphicsPipelineCreateInfo & createInfo, Optional allocator = nullptr ) const; -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + template + SubresourceLayout getImageSubresourceLayout( Image image, const ImageSubresource & subresource, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createComputePipelines( PipelineCache pipelineCache, uint32_t createInfoCount, const ComputePipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines ) const; + template + Result createImageView( const ImageViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, ImageView* pView, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type createComputePipelines( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator = nullptr ) const; - ResultValueType::type createComputePipeline( PipelineCache pipelineCache, const ComputePipelineCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createImageView( const ImageViewCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - template > - std::vector createComputePipelinesUnique( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator = nullptr ) const; - UniquePipeline createComputePipelineUnique( PipelineCache pipelineCache, const ComputePipelineCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createImageViewUnique( const ImageViewCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyPipeline( Pipeline pipeline, const AllocationCallbacks* pAllocator ) const; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyPipeline( Pipeline pipeline, Optional allocator = nullptr ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result createPipelineLayout( const PipelineLayoutCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, PipelineLayout* pPipelineLayout ) const; + template + void destroyImageView( ImageView imageView, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createPipelineLayout( const PipelineLayoutCreateInfo & createInfo, Optional allocator = nullptr ) const; -#ifndef VULKAN_HPP_NO_SMART_HANDLE - UniquePipelineLayout createPipelineLayoutUnique( const PipelineLayoutCreateInfo & createInfo, Optional allocator = nullptr ) const; -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + template + void destroyImageView( ImageView imageView, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyPipelineLayout( PipelineLayout pipelineLayout, const AllocationCallbacks* pAllocator ) const; + template + void destroy( ImageView imageView, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyPipelineLayout( PipelineLayout pipelineLayout, Optional allocator = nullptr ) const; + template + void destroy( ImageView imageView, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createSampler( const SamplerCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Sampler* pSampler ) const; + template + Result createShaderModule( const ShaderModuleCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, ShaderModule* pShaderModule, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createSampler( const SamplerCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createShaderModule( const ShaderModuleCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueSampler createSamplerUnique( const SamplerCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createShaderModuleUnique( const ShaderModuleCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroySampler( Sampler sampler, const AllocationCallbacks* pAllocator ) const; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroySampler( Sampler sampler, Optional allocator = nullptr ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result createDescriptorSetLayout( const DescriptorSetLayoutCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorSetLayout* pSetLayout ) const; + template + void destroyShaderModule( ShaderModule shaderModule, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createDescriptorSetLayout( const DescriptorSetLayoutCreateInfo & createInfo, Optional allocator = nullptr ) const; -#ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueDescriptorSetLayout createDescriptorSetLayoutUnique( const DescriptorSetLayoutCreateInfo & createInfo, Optional allocator = nullptr ) const; -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + template + void destroyShaderModule( ShaderModule shaderModule, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout, const AllocationCallbacks* pAllocator ) const; + template + void destroy( ShaderModule shaderModule, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout, Optional allocator = nullptr ) const; + template + void destroy( ShaderModule shaderModule, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createDescriptorPool( const DescriptorPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorPool* pDescriptorPool ) const; + template + Result createPipelineCache( const PipelineCacheCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, PipelineCache* pPipelineCache, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createDescriptorPool( const DescriptorPoolCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createPipelineCache( const PipelineCacheCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueDescriptorPool createDescriptorPoolUnique( const DescriptorPoolCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createPipelineCacheUnique( const PipelineCacheCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyDescriptorPool( DescriptorPool descriptorPool, const AllocationCallbacks* pAllocator ) const; + template + void destroyPipelineCache( PipelineCache pipelineCache, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyDescriptorPool( DescriptorPool descriptorPool, Optional allocator = nullptr ) const; + template + void destroyPipelineCache( PipelineCache pipelineCache, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result resetDescriptorPool( DescriptorPool descriptorPool, DescriptorPoolResetFlags flags ) const; -#else - ResultValueType::type resetDescriptorPool( DescriptorPool descriptorPool, DescriptorPoolResetFlags flags = DescriptorPoolResetFlags() ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result allocateDescriptorSets( const DescriptorSetAllocateInfo* pAllocateInfo, DescriptorSet* pDescriptorSets ) const; + template + void destroy( PipelineCache pipelineCache, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type allocateDescriptorSets( const DescriptorSetAllocateInfo & allocateInfo ) const; -#ifndef VULKAN_HPP_NO_SMART_HANDLE - template > - std::vector allocateDescriptorSetsUnique( const DescriptorSetAllocateInfo & allocateInfo ) const; -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + template + void destroy( PipelineCache pipelineCache, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result freeDescriptorSets( DescriptorPool descriptorPool, uint32_t descriptorSetCount, const DescriptorSet* pDescriptorSets ) const; + template + Result getPipelineCacheData( PipelineCache pipelineCache, size_t* pDataSize, void* pData, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type freeDescriptorSets( DescriptorPool descriptorPool, ArrayProxy descriptorSets ) const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type getPipelineCacheData( PipelineCache pipelineCache, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void updateDescriptorSets( uint32_t descriptorWriteCount, const WriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const CopyDescriptorSet* pDescriptorCopies ) const; + template + Result mergePipelineCaches( PipelineCache dstCache, uint32_t srcCacheCount, const PipelineCache* pSrcCaches, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void updateDescriptorSets( ArrayProxy descriptorWrites, ArrayProxy descriptorCopies ) const; + template + ResultValueType::type mergePipelineCaches( PipelineCache dstCache, ArrayProxy srcCaches, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createFramebuffer( const FramebufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Framebuffer* pFramebuffer ) const; + template + Result createGraphicsPipelines( PipelineCache pipelineCache, uint32_t createInfoCount, const GraphicsPipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createFramebuffer( const FramebufferCreateInfo & createInfo, Optional allocator = nullptr ) const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type createGraphicsPipelines( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; + template , typename Dispatch = DispatchLoaderStatic> + ResultValueType::type createGraphicsPipeline( PipelineCache pipelineCache, const GraphicsPipelineCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueFramebuffer createFramebufferUnique( const FramebufferCreateInfo & createInfo, Optional allocator = nullptr ) const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type createGraphicsPipelinesUnique( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; + template , typename Dispatch = DispatchLoaderStatic> + ResultValueType::type createGraphicsPipelineUnique( PipelineCache pipelineCache, const GraphicsPipelineCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyFramebuffer( Framebuffer framebuffer, const AllocationCallbacks* pAllocator ) const; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyFramebuffer( Framebuffer framebuffer, Optional allocator = nullptr ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result createRenderPass( const RenderPassCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, RenderPass* pRenderPass ) const; + template + Result createComputePipelines( PipelineCache pipelineCache, uint32_t createInfoCount, const ComputePipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createRenderPass( const RenderPassCreateInfo & createInfo, Optional allocator = nullptr ) const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type createComputePipelines( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; + template , typename Dispatch = DispatchLoaderStatic> + ResultValueType::type createComputePipeline( PipelineCache pipelineCache, const ComputePipelineCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueRenderPass createRenderPassUnique( const RenderPassCreateInfo & createInfo, Optional allocator = nullptr ) const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type createComputePipelinesUnique( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; + template , typename Dispatch = DispatchLoaderStatic> + ResultValueType::type createComputePipelineUnique( PipelineCache pipelineCache, const ComputePipelineCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyRenderPass( RenderPass renderPass, const AllocationCallbacks* pAllocator ) const; + template + void destroyPipeline( Pipeline pipeline, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyRenderPass( RenderPass renderPass, Optional allocator = nullptr ) const; + template + void destroyPipeline( Pipeline pipeline, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getRenderAreaGranularity( RenderPass renderPass, Extent2D* pGranularity ) const; + template + void destroy( Pipeline pipeline, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - Extent2D getRenderAreaGranularity( RenderPass renderPass ) const; + template + void destroy( Pipeline pipeline, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createCommandPool( const CommandPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, CommandPool* pCommandPool ) const; + template + Result createPipelineLayout( const PipelineLayoutCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, PipelineLayout* pPipelineLayout, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createCommandPool( const CommandPoolCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createPipelineLayout( const PipelineLayoutCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueCommandPool createCommandPoolUnique( const CommandPoolCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createPipelineLayoutUnique( const PipelineLayoutCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyCommandPool( CommandPool commandPool, const AllocationCallbacks* pAllocator ) const; + template + void destroyPipelineLayout( PipelineLayout pipelineLayout, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyCommandPool( CommandPool commandPool, Optional allocator = nullptr ) const; + template + void destroyPipelineLayout( PipelineLayout pipelineLayout, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result resetCommandPool( CommandPool commandPool, CommandPoolResetFlags flags ) const; -#else - ResultValueType::type resetCommandPool( CommandPool commandPool, CommandPoolResetFlags flags ) const; + template + void destroy( PipelineLayout pipelineLayout, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void destroy( PipelineLayout pipelineLayout, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result allocateCommandBuffers( const CommandBufferAllocateInfo* pAllocateInfo, CommandBuffer* pCommandBuffers ) const; + template + Result createSampler( const SamplerCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Sampler* pSampler, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type allocateCommandBuffers( const CommandBufferAllocateInfo & allocateInfo ) const; + template + ResultValueType::type createSampler( const SamplerCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - template > - std::vector allocateCommandBuffersUnique( const CommandBufferAllocateInfo & allocateInfo ) const; + template + ResultValueType::type createSamplerUnique( const SamplerCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void freeCommandBuffers( CommandPool commandPool, uint32_t commandBufferCount, const CommandBuffer* pCommandBuffers ) const; + template + void destroySampler( Sampler sampler, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void freeCommandBuffers( CommandPool commandPool, ArrayProxy commandBuffers ) const; + template + void destroySampler( Sampler sampler, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createSharedSwapchainsKHR( uint32_t swapchainCount, const SwapchainCreateInfoKHR* pCreateInfos, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchains ) const; + template + void destroy( Sampler sampler, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type createSharedSwapchainsKHR( ArrayProxy createInfos, Optional allocator = nullptr ) const; - ResultValueType::type createSharedSwapchainKHR( const SwapchainCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; -#ifndef VULKAN_HPP_NO_SMART_HANDLE - template > - std::vector createSharedSwapchainsKHRUnique( ArrayProxy createInfos, Optional allocator = nullptr ) const; - UniqueSwapchainKHR createSharedSwapchainKHRUnique( const SwapchainCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + template + void destroy( Sampler sampler, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createSwapchainKHR( const SwapchainCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchain ) const; + template + Result createDescriptorSetLayout( const DescriptorSetLayoutCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorSetLayout* pSetLayout, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createSwapchainKHR( const SwapchainCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createDescriptorSetLayout( const DescriptorSetLayoutCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueSwapchainKHR createSwapchainKHRUnique( const SwapchainCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createDescriptorSetLayoutUnique( const DescriptorSetLayoutCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroySwapchainKHR( SwapchainKHR swapchain, const AllocationCallbacks* pAllocator ) const; + template + void destroyDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroySwapchainKHR( SwapchainKHR swapchain, Optional allocator = nullptr ) const; + template + void destroyDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getSwapchainImagesKHR( SwapchainKHR swapchain, uint32_t* pSwapchainImageCount, Image* pSwapchainImages ) const; + template + void destroy( DescriptorSetLayout descriptorSetLayout, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getSwapchainImagesKHR( SwapchainKHR swapchain ) const; + template + void destroy( DescriptorSetLayout descriptorSetLayout, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result acquireNextImageKHR( SwapchainKHR swapchain, uint64_t timeout, Semaphore semaphore, Fence fence, uint32_t* pImageIndex ) const; + template + Result createDescriptorPool( const DescriptorPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorPool* pDescriptorPool, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValue acquireNextImageKHR( SwapchainKHR swapchain, uint64_t timeout, Semaphore semaphore, Fence fence ) const; + template + ResultValueType::type createDescriptorPool( const DescriptorPoolCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + ResultValueType::type createDescriptorPoolUnique( const DescriptorPoolCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result debugMarkerSetObjectNameEXT( const DebugMarkerObjectNameInfoEXT* pNameInfo ) const; + template + void destroyDescriptorPool( DescriptorPool descriptorPool, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type debugMarkerSetObjectNameEXT( const DebugMarkerObjectNameInfoEXT & nameInfo ) const; + template + void destroyDescriptorPool( DescriptorPool descriptorPool, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result debugMarkerSetObjectTagEXT( const DebugMarkerObjectTagInfoEXT* pTagInfo ) const; + template + void destroy( DescriptorPool descriptorPool, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type debugMarkerSetObjectTagEXT( const DebugMarkerObjectTagInfoEXT & tagInfo ) const; + template + void destroy( DescriptorPool descriptorPool, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VK_USE_PLATFORM_WIN32_KHR - Result getMemoryWin32HandleNV( DeviceMemory memory, ExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle ) const; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getMemoryWin32HandleNV( DeviceMemory memory, ExternalMemoryHandleTypeFlagsNV handleType ) const; +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + Result resetDescriptorPool( DescriptorPool descriptorPool, DescriptorPoolResetFlags flags = DescriptorPoolResetFlags(), Dispatch const &d = Dispatch() ) const; +#else + template + ResultValueType::type resetDescriptorPool( DescriptorPool descriptorPool, DescriptorPoolResetFlags flags = DescriptorPoolResetFlags(), Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - Result createIndirectCommandsLayoutNVX( const IndirectCommandsLayoutCreateInfoNVX* pCreateInfo, const AllocationCallbacks* pAllocator, IndirectCommandsLayoutNVX* pIndirectCommandsLayout ) const; + template + Result allocateDescriptorSets( const DescriptorSetAllocateInfo* pAllocateInfo, DescriptorSet* pDescriptorSets, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createIndirectCommandsLayoutNVX( const IndirectCommandsLayoutCreateInfoNVX & createInfo, Optional allocator = nullptr ) const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type allocateDescriptorSets( const DescriptorSetAllocateInfo & allocateInfo, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueIndirectCommandsLayoutNVX createIndirectCommandsLayoutNVXUnique( const IndirectCommandsLayoutCreateInfoNVX & createInfo, Optional allocator = nullptr ) const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type allocateDescriptorSetsUnique( const DescriptorSetAllocateInfo & allocateInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyIndirectCommandsLayoutNVX( IndirectCommandsLayoutNVX indirectCommandsLayout, const AllocationCallbacks* pAllocator ) const; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyIndirectCommandsLayoutNVX( IndirectCommandsLayoutNVX indirectCommandsLayout, Optional allocator = nullptr ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result createObjectTableNVX( const ObjectTableCreateInfoNVX* pCreateInfo, const AllocationCallbacks* pAllocator, ObjectTableNVX* pObjectTable ) const; + template + Result freeDescriptorSets( DescriptorPool descriptorPool, uint32_t descriptorSetCount, const DescriptorSet* pDescriptorSets, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createObjectTableNVX( const ObjectTableCreateInfoNVX & createInfo, Optional allocator = nullptr ) const; -#ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueObjectTableNVX createObjectTableNVXUnique( const ObjectTableCreateInfoNVX & createInfo, Optional allocator = nullptr ) const; -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + template + ResultValueType::type freeDescriptorSets( DescriptorPool descriptorPool, ArrayProxy descriptorSets, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyObjectTableNVX( ObjectTableNVX objectTable, const AllocationCallbacks* pAllocator ) const; + template + Result free( DescriptorPool descriptorPool, uint32_t descriptorSetCount, const DescriptorSet* pDescriptorSets, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyObjectTableNVX( ObjectTableNVX objectTable, Optional allocator = nullptr ) const; + template + ResultValueType::type free( DescriptorPool descriptorPool, ArrayProxy descriptorSets, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result registerObjectsNVX( ObjectTableNVX objectTable, uint32_t objectCount, const ObjectTableEntryNVX* const* ppObjectTableEntries, const uint32_t* pObjectIndices ) const; + template + void updateDescriptorSets( uint32_t descriptorWriteCount, const WriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const CopyDescriptorSet* pDescriptorCopies, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type registerObjectsNVX( ObjectTableNVX objectTable, ArrayProxy pObjectTableEntries, ArrayProxy objectIndices ) const; + template + void updateDescriptorSets( ArrayProxy descriptorWrites, ArrayProxy descriptorCopies, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result unregisterObjectsNVX( ObjectTableNVX objectTable, uint32_t objectCount, const ObjectEntryTypeNVX* pObjectEntryTypes, const uint32_t* pObjectIndices ) const; + template + Result createFramebuffer( const FramebufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Framebuffer* pFramebuffer, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type unregisterObjectsNVX( ObjectTableNVX objectTable, ArrayProxy objectEntryTypes, ArrayProxy objectIndices ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void trimCommandPoolKHR( CommandPool commandPool, CommandPoolTrimFlagsKHR flags ) const; -#else - void trimCommandPoolKHR( CommandPool commandPool, CommandPoolTrimFlagsKHR flags = CommandPoolTrimFlagsKHR() ) const; + template + ResultValueType::type createFramebuffer( const FramebufferCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + ResultValueType::type createFramebufferUnique( const FramebufferCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VK_USE_PLATFORM_WIN32_KHR - Result getMemoryWin32HandleKHR( const MemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle ) const; + template + void destroyFramebuffer( Framebuffer framebuffer, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getMemoryWin32HandleKHR( const MemoryGetWin32HandleInfoKHR & getWin32HandleInfo ) const; + template + void destroyFramebuffer( Framebuffer framebuffer, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ -#ifdef VK_USE_PLATFORM_WIN32_KHR - Result getMemoryWin32HandlePropertiesKHR( ExternalMemoryHandleTypeFlagBitsKHR handleType, HANDLE handle, MemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties ) const; + template + void destroy( Framebuffer framebuffer, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getMemoryWin32HandlePropertiesKHR( ExternalMemoryHandleTypeFlagBitsKHR handleType, HANDLE handle ) const; + template + void destroy( Framebuffer framebuffer, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - Result getMemoryFdKHR( const MemoryGetFdInfoKHR* pGetFdInfo, int* pFd ) const; + template + Result createRenderPass( const RenderPassCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, RenderPass* pRenderPass, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getMemoryFdKHR( const MemoryGetFdInfoKHR & getFdInfo ) const; + template + ResultValueType::type createRenderPass( const RenderPassCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + ResultValueType::type createRenderPassUnique( const RenderPassCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getMemoryFdPropertiesKHR( ExternalMemoryHandleTypeFlagBitsKHR handleType, int fd, MemoryFdPropertiesKHR* pMemoryFdProperties ) const; + template + void destroyRenderPass( RenderPass renderPass, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getMemoryFdPropertiesKHR( ExternalMemoryHandleTypeFlagBitsKHR handleType, int fd ) const; + template + void destroyRenderPass( RenderPass renderPass, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VK_USE_PLATFORM_WIN32_KHR - Result getSemaphoreWin32HandleKHR( const SemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle ) const; + template + void destroy( RenderPass renderPass, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getSemaphoreWin32HandleKHR( const SemaphoreGetWin32HandleInfoKHR & getWin32HandleInfo ) const; + template + void destroy( RenderPass renderPass, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ -#ifdef VK_USE_PLATFORM_WIN32_KHR - Result importSemaphoreWin32HandleKHR( const ImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo ) const; + template + void getRenderAreaGranularity( RenderPass renderPass, Extent2D* pGranularity, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type importSemaphoreWin32HandleKHR( const ImportSemaphoreWin32HandleInfoKHR & importSemaphoreWin32HandleInfo ) const; + template + Extent2D getRenderAreaGranularity( RenderPass renderPass, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - Result getSemaphoreFdKHR( const SemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd ) const; + template + Result createCommandPool( const CommandPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, CommandPool* pCommandPool, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getSemaphoreFdKHR( const SemaphoreGetFdInfoKHR & getFdInfo ) const; + template + ResultValueType::type createCommandPool( const CommandPoolCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + ResultValueType::type createCommandPoolUnique( const CommandPoolCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result importSemaphoreFdKHR( const ImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo ) const; + template + void destroyCommandPool( CommandPool commandPool, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type importSemaphoreFdKHR( const ImportSemaphoreFdInfoKHR & importSemaphoreFdInfo ) const; + template + void destroyCommandPool( CommandPool commandPool, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VK_USE_PLATFORM_WIN32_KHR - Result getFenceWin32HandleKHR( const FenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle ) const; + template + void destroy( CommandPool commandPool, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getFenceWin32HandleKHR( const FenceGetWin32HandleInfoKHR & getWin32HandleInfo ) const; + template + void destroy( CommandPool commandPool, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ -#ifdef VK_USE_PLATFORM_WIN32_KHR - Result importFenceWin32HandleKHR( const ImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo ) const; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type importFenceWin32HandleKHR( const ImportFenceWin32HandleInfoKHR & importFenceWin32HandleInfo ) const; +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + Result resetCommandPool( CommandPool commandPool, CommandPoolResetFlags flags, Dispatch const &d = Dispatch() ) const; +#else + template + ResultValueType::type resetCommandPool( CommandPool commandPool, CommandPoolResetFlags flags, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - Result getFenceFdKHR( const FenceGetFdInfoKHR* pGetFdInfo, int* pFd ) const; + template + Result allocateCommandBuffers( const CommandBufferAllocateInfo* pAllocateInfo, CommandBuffer* pCommandBuffers, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getFenceFdKHR( const FenceGetFdInfoKHR & getFdInfo ) const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type allocateCommandBuffers( const CommandBufferAllocateInfo & allocateInfo, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type allocateCommandBuffersUnique( const CommandBufferAllocateInfo & allocateInfo, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result importFenceFdKHR( const ImportFenceFdInfoKHR* pImportFenceFdInfo ) const; + template + void freeCommandBuffers( CommandPool commandPool, uint32_t commandBufferCount, const CommandBuffer* pCommandBuffers, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type importFenceFdKHR( const ImportFenceFdInfoKHR & importFenceFdInfo ) const; + template + void freeCommandBuffers( CommandPool commandPool, ArrayProxy commandBuffers, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result displayPowerControlEXT( DisplayKHR display, const DisplayPowerInfoEXT* pDisplayPowerInfo ) const; + template + void free( CommandPool commandPool, uint32_t commandBufferCount, const CommandBuffer* pCommandBuffers, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type displayPowerControlEXT( DisplayKHR display, const DisplayPowerInfoEXT & displayPowerInfo ) const; + template + void free( CommandPool commandPool, ArrayProxy commandBuffers, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result registerEventEXT( const DeviceEventInfoEXT* pDeviceEventInfo, const AllocationCallbacks* pAllocator, Fence* pFence ) const; + template + Result createSharedSwapchainsKHR( uint32_t swapchainCount, const SwapchainCreateInfoKHR* pCreateInfos, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchains, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type registerEventEXT( const DeviceEventInfoEXT & deviceEventInfo, Optional allocator = nullptr ) const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type createSharedSwapchainsKHR( ArrayProxy createInfos, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; + template , typename Dispatch = DispatchLoaderStatic> + ResultValueType::type createSharedSwapchainKHR( const SwapchainCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type createSharedSwapchainsKHRUnique( ArrayProxy createInfos, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; + template , typename Dispatch = DispatchLoaderStatic> + ResultValueType::type createSharedSwapchainKHRUnique( const SwapchainCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result registerDisplayEventEXT( DisplayKHR display, const DisplayEventInfoEXT* pDisplayEventInfo, const AllocationCallbacks* pAllocator, Fence* pFence ) const; + template + Result createSwapchainKHR( const SwapchainCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchain, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type registerDisplayEventEXT( DisplayKHR display, const DisplayEventInfoEXT & displayEventInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createSwapchainKHR( const SwapchainCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + ResultValueType::type createSwapchainKHRUnique( const SwapchainCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getSwapchainCounterEXT( SwapchainKHR swapchain, SurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue ) const; + template + void destroySwapchainKHR( SwapchainKHR swapchain, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValue getSwapchainCounterEXT( SwapchainKHR swapchain, SurfaceCounterFlagBitsEXT counter ) const; + template + void destroySwapchainKHR( SwapchainKHR swapchain, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getGroupPeerMemoryFeaturesKHX( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, PeerMemoryFeatureFlagsKHX* pPeerMemoryFeatures ) const; + template + void destroy( SwapchainKHR swapchain, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - PeerMemoryFeatureFlagsKHX getGroupPeerMemoryFeaturesKHX( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex ) const; + template + void destroy( SwapchainKHR swapchain, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result bindBufferMemory2KHR( uint32_t bindInfoCount, const BindBufferMemoryInfoKHR* pBindInfos ) const; + template + Result getSwapchainImagesKHR( SwapchainKHR swapchain, uint32_t* pSwapchainImageCount, Image* pSwapchainImages, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type bindBufferMemory2KHR( ArrayProxy bindInfos ) const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type getSwapchainImagesKHR( SwapchainKHR swapchain, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result bindImageMemory2KHR( uint32_t bindInfoCount, const BindImageMemoryInfoKHR* pBindInfos ) const; + template + Result acquireNextImageKHR( SwapchainKHR swapchain, uint64_t timeout, Semaphore semaphore, Fence fence, uint32_t* pImageIndex, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type bindImageMemory2KHR( ArrayProxy bindInfos ) const; + template + ResultValue acquireNextImageKHR( SwapchainKHR swapchain, uint64_t timeout, Semaphore semaphore, Fence fence, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getGroupPresentCapabilitiesKHX( DeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities ) const; + template + Result debugMarkerSetObjectNameEXT( const DebugMarkerObjectNameInfoEXT* pNameInfo, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getGroupPresentCapabilitiesKHX() const; + template + ResultValueType::type debugMarkerSetObjectNameEXT( const DebugMarkerObjectNameInfoEXT & nameInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getGroupSurfacePresentModesKHX( SurfaceKHR surface, DeviceGroupPresentModeFlagsKHX* pModes ) const; + template + Result debugMarkerSetObjectTagEXT( const DebugMarkerObjectTagInfoEXT* pTagInfo, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getGroupSurfacePresentModesKHX( SurfaceKHR surface ) const; + template + ResultValueType::type debugMarkerSetObjectTagEXT( const DebugMarkerObjectTagInfoEXT & tagInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result acquireNextImage2KHX( const AcquireNextImageInfoKHX* pAcquireInfo, uint32_t* pImageIndex ) const; +#ifdef VK_USE_PLATFORM_WIN32_NV + template + Result getMemoryWin32HandleNV( DeviceMemory memory, ExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValue acquireNextImage2KHX( const AcquireNextImageInfoKHX & acquireInfo ) const; + template + ResultValueType::type getMemoryWin32HandleNV( DeviceMemory memory, ExternalMemoryHandleTypeFlagsNV handleType, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_NV*/ - Result createDescriptorUpdateTemplateKHR( const DescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate ) const; + template + Result createIndirectCommandsLayoutNVX( const IndirectCommandsLayoutCreateInfoNVX* pCreateInfo, const AllocationCallbacks* pAllocator, IndirectCommandsLayoutNVX* pIndirectCommandsLayout, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createDescriptorUpdateTemplateKHR( const DescriptorUpdateTemplateCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createIndirectCommandsLayoutNVX( const IndirectCommandsLayoutCreateInfoNVX & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueDescriptorUpdateTemplateKHR createDescriptorUpdateTemplateKHRUnique( const DescriptorUpdateTemplateCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createIndirectCommandsLayoutNVXUnique( const IndirectCommandsLayoutCreateInfoNVX & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyDescriptorUpdateTemplateKHR( DescriptorUpdateTemplateKHR descriptorUpdateTemplate, const AllocationCallbacks* pAllocator ) const; + template + void destroyIndirectCommandsLayoutNVX( IndirectCommandsLayoutNVX indirectCommandsLayout, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyDescriptorUpdateTemplateKHR( DescriptorUpdateTemplateKHR descriptorUpdateTemplate, Optional allocator = nullptr ) const; + template + void destroyIndirectCommandsLayoutNVX( IndirectCommandsLayoutNVX indirectCommandsLayout, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void updateDescriptorSetWithTemplateKHR( DescriptorSet descriptorSet, DescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void* pData ) const; - - void setHdrMetadataEXT( uint32_t swapchainCount, const SwapchainKHR* pSwapchains, const HdrMetadataEXT* pMetadata ) const; + template + void destroy( IndirectCommandsLayoutNVX indirectCommandsLayout, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setHdrMetadataEXT( ArrayProxy swapchains, ArrayProxy metadata ) const; + template + void destroy( IndirectCommandsLayoutNVX indirectCommandsLayout, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getSwapchainStatusKHR( SwapchainKHR swapchain ) const; - - Result getRefreshCycleDurationGOOGLE( SwapchainKHR swapchain, RefreshCycleDurationGOOGLE* pDisplayTimingProperties ) const; + template + Result createObjectTableNVX( const ObjectTableCreateInfoNVX* pCreateInfo, const AllocationCallbacks* pAllocator, ObjectTableNVX* pObjectTable, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getRefreshCycleDurationGOOGLE( SwapchainKHR swapchain ) const; + template + ResultValueType::type createObjectTableNVX( const ObjectTableCreateInfoNVX & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + ResultValueType::type createObjectTableNVXUnique( const ObjectTableCreateInfoNVX & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getPastPresentationTimingGOOGLE( SwapchainKHR swapchain, uint32_t* pPresentationTimingCount, PastPresentationTimingGOOGLE* pPresentationTimings ) const; + template + void destroyObjectTableNVX( ObjectTableNVX objectTable, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getPastPresentationTimingGOOGLE( SwapchainKHR swapchain ) const; + template + void destroyObjectTableNVX( ObjectTableNVX objectTable, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getBufferMemoryRequirements2KHR( const BufferMemoryRequirementsInfo2KHR* pInfo, MemoryRequirements2KHR* pMemoryRequirements ) const; + template + void destroy( ObjectTableNVX objectTable, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - MemoryRequirements2KHR getBufferMemoryRequirements2KHR( const BufferMemoryRequirementsInfo2KHR & info ) const; - template - StructureChain getBufferMemoryRequirements2KHR( const BufferMemoryRequirementsInfo2KHR & info ) const; + template + void destroy( ObjectTableNVX objectTable, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getImageMemoryRequirements2KHR( const ImageMemoryRequirementsInfo2KHR* pInfo, MemoryRequirements2KHR* pMemoryRequirements ) const; + template + Result registerObjectsNVX( ObjectTableNVX objectTable, uint32_t objectCount, const ObjectTableEntryNVX* const* ppObjectTableEntries, const uint32_t* pObjectIndices, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - MemoryRequirements2KHR getImageMemoryRequirements2KHR( const ImageMemoryRequirementsInfo2KHR & info ) const; - template - StructureChain getImageMemoryRequirements2KHR( const ImageMemoryRequirementsInfo2KHR & info ) const; + template + ResultValueType::type registerObjectsNVX( ObjectTableNVX objectTable, ArrayProxy pObjectTableEntries, ArrayProxy objectIndices, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getImageSparseMemoryRequirements2KHR( const ImageSparseMemoryRequirementsInfo2KHR* pInfo, uint32_t* pSparseMemoryRequirementCount, SparseImageMemoryRequirements2KHR* pSparseMemoryRequirements ) const; + template + Result unregisterObjectsNVX( ObjectTableNVX objectTable, uint32_t objectCount, const ObjectEntryTypeNVX* pObjectEntryTypes, const uint32_t* pObjectIndices, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - std::vector getImageSparseMemoryRequirements2KHR( const ImageSparseMemoryRequirementsInfo2KHR & info ) const; + template + ResultValueType::type unregisterObjectsNVX( ObjectTableNVX objectTable, ArrayProxy objectEntryTypes, ArrayProxy objectIndices, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createSamplerYcbcrConversionKHR( const SamplerYcbcrConversionCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SamplerYcbcrConversionKHR* pYcbcrConversion ) const; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createSamplerYcbcrConversionKHR( const SamplerYcbcrConversionCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; -#ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueSamplerYcbcrConversionKHR createSamplerYcbcrConversionKHRUnique( const SamplerYcbcrConversionCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + template + void trimCommandPool( CommandPool commandPool, CommandPoolTrimFlags flags = CommandPoolTrimFlags(), Dispatch const &d = Dispatch() ) const; - void destroySamplerYcbcrConversionKHR( SamplerYcbcrConversionKHR ycbcrConversion, const AllocationCallbacks* pAllocator ) const; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroySamplerYcbcrConversionKHR( SamplerYcbcrConversionKHR ycbcrConversion, Optional allocator = nullptr ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + template + void trimCommandPoolKHR( CommandPool commandPool, CommandPoolTrimFlags flags = CommandPoolTrimFlags(), Dispatch const &d = Dispatch() ) const; - Result createValidationCacheEXT( const ValidationCacheCreateInfoEXT* pCreateInfo, const AllocationCallbacks* pAllocator, ValidationCacheEXT* pValidationCache ) const; +#ifdef VK_USE_PLATFORM_WIN32_KHR + template + Result getMemoryWin32HandleKHR( const MemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createValidationCacheEXT( const ValidationCacheCreateInfoEXT & createInfo, Optional allocator = nullptr ) const; -#ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueValidationCacheEXT createValidationCacheEXTUnique( const ValidationCacheCreateInfoEXT & createInfo, Optional allocator = nullptr ) const; -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + template + ResultValueType::type getMemoryWin32HandleKHR( const MemoryGetWin32HandleInfoKHR & getWin32HandleInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - void destroyValidationCacheEXT( ValidationCacheEXT validationCache, const AllocationCallbacks* pAllocator ) const; +#ifdef VK_USE_PLATFORM_WIN32_KHR + template + Result getMemoryWin32HandlePropertiesKHR( ExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, MemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyValidationCacheEXT( ValidationCacheEXT validationCache, Optional allocator = nullptr ) const; + template + ResultValueType::type getMemoryWin32HandlePropertiesKHR( ExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - Result getValidationCacheDataEXT( ValidationCacheEXT validationCache, size_t* pDataSize, void* pData ) const; + template + Result getMemoryFdKHR( const MemoryGetFdInfoKHR* pGetFdInfo, int* pFd, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getValidationCacheDataEXT( ValidationCacheEXT validationCache ) const; + template + ResultValueType::type getMemoryFdKHR( const MemoryGetFdInfoKHR & getFdInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result mergeValidationCachesEXT( ValidationCacheEXT dstCache, uint32_t srcCacheCount, const ValidationCacheEXT* pSrcCaches ) const; + template + Result getMemoryFdPropertiesKHR( ExternalMemoryHandleTypeFlagBits handleType, int fd, MemoryFdPropertiesKHR* pMemoryFdProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type mergeValidationCachesEXT( ValidationCacheEXT dstCache, ArrayProxy srcCaches ) const; + template + ResultValueType::type getMemoryFdPropertiesKHR( ExternalMemoryHandleTypeFlagBits handleType, int fd, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getShaderInfoAMD( Pipeline pipeline, ShaderStageFlagBits shaderStage, ShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo ) const; +#ifdef VK_USE_PLATFORM_WIN32_KHR + template + Result getSemaphoreWin32HandleKHR( const SemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getShaderInfoAMD( Pipeline pipeline, ShaderStageFlagBits shaderStage, ShaderInfoTypeAMD infoType ) const; + template + ResultValueType::type getSemaphoreWin32HandleKHR( const SemaphoreGetWin32HandleInfoKHR & getWin32HandleInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ +#ifdef VK_USE_PLATFORM_WIN32_KHR + template + Result importSemaphoreWin32HandleKHR( const ImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type importSemaphoreWin32HandleKHR( const ImportSemaphoreWin32HandleInfoKHR & importSemaphoreWin32HandleInfo, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + template + Result getSemaphoreFdKHR( const SemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type getSemaphoreFdKHR( const SemaphoreGetFdInfoKHR & getFdInfo, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDevice() const - { - return m_device; - } - - explicit operator bool() const - { - return m_device != VK_NULL_HANDLE; - } - - bool operator!() const - { - return m_device == VK_NULL_HANDLE; - } - - private: - VkDevice m_device; - }; - - static_assert( sizeof( Device ) == sizeof( VkDevice ), "handle and wrapper have different size!" ); - -#ifndef VULKAN_HPP_NO_SMART_HANDLE - class BufferDeleter - { - public: - BufferDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} - - void operator()( Buffer buffer ) - { - m_device.destroyBuffer( buffer, m_allocator ); - } - - private: - Device m_device; - Optional m_allocator; - }; - - class BufferViewDeleter - { - public: - BufferViewDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} - - void operator()( BufferView bufferView ) - { - m_device.destroyBufferView( bufferView, m_allocator ); - } - - private: - Device m_device; - Optional m_allocator; - }; - - class CommandBufferDeleter - { - public: - CommandBufferDeleter( Device device = Device(), CommandPool commandPool = CommandPool() ) - : m_device( device ) - , m_commandPool( commandPool ) - {} - - void operator()( CommandBuffer commandBuffer ) - { - m_device.freeCommandBuffers( m_commandPool, commandBuffer ); - } - - private: - Device m_device; - CommandPool m_commandPool; - }; - - class CommandPoolDeleter - { - public: - CommandPoolDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} - - void operator()( CommandPool commandPool ) - { - m_device.destroyCommandPool( commandPool, m_allocator ); - } - - private: - Device m_device; - Optional m_allocator; - }; - - class DescriptorPoolDeleter - { - public: - DescriptorPoolDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} - - void operator()( DescriptorPool descriptorPool ) - { - m_device.destroyDescriptorPool( descriptorPool, m_allocator ); - } - - private: - Device m_device; - Optional m_allocator; - }; - - class DescriptorSetDeleter - { - public: - DescriptorSetDeleter( Device device = Device(), DescriptorPool descriptorPool = DescriptorPool() ) - : m_device( device ) - , m_descriptorPool( descriptorPool ) - {} - - void operator()( DescriptorSet descriptorSet ) - { - m_device.freeDescriptorSets( m_descriptorPool, descriptorSet ); - } - - private: - Device m_device; - DescriptorPool m_descriptorPool; - }; - - class DescriptorSetLayoutDeleter - { - public: - DescriptorSetLayoutDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} - - void operator()( DescriptorSetLayout descriptorSetLayout ) - { - m_device.destroyDescriptorSetLayout( descriptorSetLayout, m_allocator ); - } - - private: - Device m_device; - Optional m_allocator; - }; + template + Result importSemaphoreFdKHR( const ImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type importSemaphoreFdKHR( const ImportSemaphoreFdInfoKHR & importSemaphoreFdInfo, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - class DescriptorUpdateTemplateKHRDeleter - { - public: - DescriptorUpdateTemplateKHRDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} +#ifdef VK_USE_PLATFORM_WIN32_KHR + template + Result getFenceWin32HandleKHR( const FenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type getFenceWin32HandleKHR( const FenceGetWin32HandleInfoKHR & getWin32HandleInfo, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - void operator()( DescriptorUpdateTemplateKHR descriptorUpdateTemplateKHR ) - { - m_device.destroyDescriptorUpdateTemplateKHR( descriptorUpdateTemplateKHR, m_allocator ); - } +#ifdef VK_USE_PLATFORM_WIN32_KHR + template + Result importFenceWin32HandleKHR( const ImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type importFenceWin32HandleKHR( const ImportFenceWin32HandleInfoKHR & importFenceWin32HandleInfo, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - private: - Device m_device; - Optional m_allocator; - }; + template + Result getFenceFdKHR( const FenceGetFdInfoKHR* pGetFdInfo, int* pFd, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type getFenceFdKHR( const FenceGetFdInfoKHR & getFdInfo, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - class DeviceMemoryDeleter - { - public: - DeviceMemoryDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} + template + Result importFenceFdKHR( const ImportFenceFdInfoKHR* pImportFenceFdInfo, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type importFenceFdKHR( const ImportFenceFdInfoKHR & importFenceFdInfo, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void operator()( DeviceMemory deviceMemory ) - { - m_device.freeMemory( deviceMemory, m_allocator ); - } + template + Result displayPowerControlEXT( DisplayKHR display, const DisplayPowerInfoEXT* pDisplayPowerInfo, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type displayPowerControlEXT( DisplayKHR display, const DisplayPowerInfoEXT & displayPowerInfo, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - private: - Device m_device; - Optional m_allocator; - }; + template + Result registerEventEXT( const DeviceEventInfoEXT* pDeviceEventInfo, const AllocationCallbacks* pAllocator, Fence* pFence, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type registerEventEXT( const DeviceEventInfoEXT & deviceEventInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - class EventDeleter - { - public: - EventDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} + template + Result registerDisplayEventEXT( DisplayKHR display, const DisplayEventInfoEXT* pDisplayEventInfo, const AllocationCallbacks* pAllocator, Fence* pFence, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type registerDisplayEventEXT( DisplayKHR display, const DisplayEventInfoEXT & displayEventInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void operator()( Event event ) - { - m_device.destroyEvent( event, m_allocator ); - } + template + Result getSwapchainCounterEXT( SwapchainKHR swapchain, SurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type getSwapchainCounterEXT( SwapchainKHR swapchain, SurfaceCounterFlagBitsEXT counter, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - private: - Device m_device; - Optional m_allocator; - }; + template + void getGroupPeerMemoryFeatures( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, PeerMemoryFeatureFlags* pPeerMemoryFeatures, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + PeerMemoryFeatureFlags getGroupPeerMemoryFeatures( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - class FenceDeleter - { - public: - FenceDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} + template + void getGroupPeerMemoryFeaturesKHR( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, PeerMemoryFeatureFlags* pPeerMemoryFeatures, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + PeerMemoryFeatureFlags getGroupPeerMemoryFeaturesKHR( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void operator()( Fence fence ) - { - m_device.destroyFence( fence, m_allocator ); - } + template + Result bindBufferMemory2( uint32_t bindInfoCount, const BindBufferMemoryInfo* pBindInfos, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type bindBufferMemory2( ArrayProxy bindInfos, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - private: - Device m_device; - Optional m_allocator; - }; + template + Result bindBufferMemory2KHR( uint32_t bindInfoCount, const BindBufferMemoryInfo* pBindInfos, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type bindBufferMemory2KHR( ArrayProxy bindInfos, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - class FramebufferDeleter - { - public: - FramebufferDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} + template + Result bindImageMemory2( uint32_t bindInfoCount, const BindImageMemoryInfo* pBindInfos, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type bindImageMemory2( ArrayProxy bindInfos, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void operator()( Framebuffer framebuffer ) - { - m_device.destroyFramebuffer( framebuffer, m_allocator ); - } + template + Result bindImageMemory2KHR( uint32_t bindInfoCount, const BindImageMemoryInfo* pBindInfos, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type bindImageMemory2KHR( ArrayProxy bindInfos, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - private: - Device m_device; - Optional m_allocator; - }; + template + Result getGroupPresentCapabilitiesKHR( DeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type getGroupPresentCapabilitiesKHR(Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - class ImageDeleter - { - public: - ImageDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} + template + Result getGroupSurfacePresentModesKHR( SurfaceKHR surface, DeviceGroupPresentModeFlagsKHR* pModes, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type getGroupSurfacePresentModesKHR( SurfaceKHR surface, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void operator()( Image image ) - { - m_device.destroyImage( image, m_allocator ); - } + template + Result acquireNextImage2KHR( const AcquireNextImageInfoKHR* pAcquireInfo, uint32_t* pImageIndex, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValue acquireNextImage2KHR( const AcquireNextImageInfoKHR & acquireInfo, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - private: - Device m_device; - Optional m_allocator; - }; + template + Result createDescriptorUpdateTemplate( const DescriptorUpdateTemplateCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorUpdateTemplate* pDescriptorUpdateTemplate, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type createDescriptorUpdateTemplate( const DescriptorUpdateTemplateCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + ResultValueType::type createDescriptorUpdateTemplateUnique( const DescriptorUpdateTemplateCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - class ImageViewDeleter - { - public: - ImageViewDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} + template + Result createDescriptorUpdateTemplateKHR( const DescriptorUpdateTemplateCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorUpdateTemplate* pDescriptorUpdateTemplate, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type createDescriptorUpdateTemplateKHR( const DescriptorUpdateTemplateCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + ResultValueType::type createDescriptorUpdateTemplateKHRUnique( const DescriptorUpdateTemplateCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void operator()( ImageView imageView ) - { - m_device.destroyImageView( imageView, m_allocator ); - } + template + void destroyDescriptorUpdateTemplate( DescriptorUpdateTemplate descriptorUpdateTemplate, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void destroyDescriptorUpdateTemplate( DescriptorUpdateTemplate descriptorUpdateTemplate, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - private: - Device m_device; - Optional m_allocator; - }; + template + void destroy( DescriptorUpdateTemplate descriptorUpdateTemplate, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void destroy( DescriptorUpdateTemplate descriptorUpdateTemplate, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - class IndirectCommandsLayoutNVXDeleter - { - public: - IndirectCommandsLayoutNVXDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} + template + void destroyDescriptorUpdateTemplateKHR( DescriptorUpdateTemplate descriptorUpdateTemplate, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void destroyDescriptorUpdateTemplateKHR( DescriptorUpdateTemplate descriptorUpdateTemplate, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void operator()( IndirectCommandsLayoutNVX indirectCommandsLayoutNVX ) - { - m_device.destroyIndirectCommandsLayoutNVX( indirectCommandsLayoutNVX, m_allocator ); - } + template + void updateDescriptorSetWithTemplate( DescriptorSet descriptorSet, DescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData, Dispatch const &d = Dispatch() ) const; - private: - Device m_device; - Optional m_allocator; - }; + template + void updateDescriptorSetWithTemplateKHR( DescriptorSet descriptorSet, DescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData, Dispatch const &d = Dispatch() ) const; - class ObjectTableNVXDeleter - { - public: - ObjectTableNVXDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} + template + void setHdrMetadataEXT( uint32_t swapchainCount, const SwapchainKHR* pSwapchains, const HdrMetadataEXT* pMetadata, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void setHdrMetadataEXT( ArrayProxy swapchains, ArrayProxy metadata, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void operator()( ObjectTableNVX objectTableNVX ) - { - m_device.destroyObjectTableNVX( objectTableNVX, m_allocator ); - } + template + Result getSwapchainStatusKHR( SwapchainKHR swapchain, Dispatch const &d = Dispatch() ) const; - private: - Device m_device; - Optional m_allocator; - }; + template + Result getRefreshCycleDurationGOOGLE( SwapchainKHR swapchain, RefreshCycleDurationGOOGLE* pDisplayTimingProperties, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type getRefreshCycleDurationGOOGLE( SwapchainKHR swapchain, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - class PipelineDeleter - { - public: - PipelineDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} + template + Result getPastPresentationTimingGOOGLE( SwapchainKHR swapchain, uint32_t* pPresentationTimingCount, PastPresentationTimingGOOGLE* pPresentationTimings, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type getPastPresentationTimingGOOGLE( SwapchainKHR swapchain, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void operator()( Pipeline pipeline ) - { - m_device.destroyPipeline( pipeline, m_allocator ); - } + template + void getBufferMemoryRequirements2( const BufferMemoryRequirementsInfo2* pInfo, MemoryRequirements2* pMemoryRequirements, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + MemoryRequirements2 getBufferMemoryRequirements2( const BufferMemoryRequirementsInfo2 & info, Dispatch const &d = Dispatch() ) const; + template + StructureChain getBufferMemoryRequirements2( const BufferMemoryRequirementsInfo2 & info, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - private: - Device m_device; - Optional m_allocator; - }; + template + void getBufferMemoryRequirements2KHR( const BufferMemoryRequirementsInfo2* pInfo, MemoryRequirements2* pMemoryRequirements, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + MemoryRequirements2 getBufferMemoryRequirements2KHR( const BufferMemoryRequirementsInfo2 & info, Dispatch const &d = Dispatch() ) const; + template + StructureChain getBufferMemoryRequirements2KHR( const BufferMemoryRequirementsInfo2 & info, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - class PipelineCacheDeleter - { - public: - PipelineCacheDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} + template + void getImageMemoryRequirements2( const ImageMemoryRequirementsInfo2* pInfo, MemoryRequirements2* pMemoryRequirements, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + MemoryRequirements2 getImageMemoryRequirements2( const ImageMemoryRequirementsInfo2 & info, Dispatch const &d = Dispatch() ) const; + template + StructureChain getImageMemoryRequirements2( const ImageMemoryRequirementsInfo2 & info, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void operator()( PipelineCache pipelineCache ) - { - m_device.destroyPipelineCache( pipelineCache, m_allocator ); - } + template + void getImageMemoryRequirements2KHR( const ImageMemoryRequirementsInfo2* pInfo, MemoryRequirements2* pMemoryRequirements, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + MemoryRequirements2 getImageMemoryRequirements2KHR( const ImageMemoryRequirementsInfo2 & info, Dispatch const &d = Dispatch() ) const; + template + StructureChain getImageMemoryRequirements2KHR( const ImageMemoryRequirementsInfo2 & info, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - private: - Device m_device; - Optional m_allocator; - }; + template + void getImageSparseMemoryRequirements2( const ImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, SparseImageMemoryRequirements2* pSparseMemoryRequirements, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template , typename Dispatch = DispatchLoaderStatic> + std::vector getImageSparseMemoryRequirements2( const ImageSparseMemoryRequirementsInfo2 & info, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - class PipelineLayoutDeleter - { - public: - PipelineLayoutDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} + template + void getImageSparseMemoryRequirements2KHR( const ImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, SparseImageMemoryRequirements2* pSparseMemoryRequirements, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template , typename Dispatch = DispatchLoaderStatic> + std::vector getImageSparseMemoryRequirements2KHR( const ImageSparseMemoryRequirementsInfo2 & info, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void operator()( PipelineLayout pipelineLayout ) - { - m_device.destroyPipelineLayout( pipelineLayout, m_allocator ); - } + template + Result createSamplerYcbcrConversion( const SamplerYcbcrConversionCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, SamplerYcbcrConversion* pYcbcrConversion, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type createSamplerYcbcrConversion( const SamplerYcbcrConversionCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + ResultValueType::type createSamplerYcbcrConversionUnique( const SamplerYcbcrConversionCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - private: - Device m_device; - Optional m_allocator; - }; + template + Result createSamplerYcbcrConversionKHR( const SamplerYcbcrConversionCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, SamplerYcbcrConversion* pYcbcrConversion, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type createSamplerYcbcrConversionKHR( const SamplerYcbcrConversionCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + ResultValueType::type createSamplerYcbcrConversionKHRUnique( const SamplerYcbcrConversionCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - class QueryPoolDeleter - { - public: - QueryPoolDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} + template + void destroySamplerYcbcrConversion( SamplerYcbcrConversion ycbcrConversion, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void destroySamplerYcbcrConversion( SamplerYcbcrConversion ycbcrConversion, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void operator()( QueryPool queryPool ) - { - m_device.destroyQueryPool( queryPool, m_allocator ); - } + template + void destroy( SamplerYcbcrConversion ycbcrConversion, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void destroy( SamplerYcbcrConversion ycbcrConversion, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - private: - Device m_device; - Optional m_allocator; - }; + template + void destroySamplerYcbcrConversionKHR( SamplerYcbcrConversion ycbcrConversion, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void destroySamplerYcbcrConversionKHR( SamplerYcbcrConversion ycbcrConversion, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - class RenderPassDeleter - { - public: - RenderPassDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} + template + void getQueue2( const DeviceQueueInfo2* pQueueInfo, Queue* pQueue, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + Queue getQueue2( const DeviceQueueInfo2 & queueInfo, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void operator()( RenderPass renderPass ) - { - m_device.destroyRenderPass( renderPass, m_allocator ); - } + template + Result createValidationCacheEXT( const ValidationCacheCreateInfoEXT* pCreateInfo, const AllocationCallbacks* pAllocator, ValidationCacheEXT* pValidationCache, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type createValidationCacheEXT( const ValidationCacheCreateInfoEXT & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + ResultValueType::type createValidationCacheEXTUnique( const ValidationCacheCreateInfoEXT & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - private: - Device m_device; - Optional m_allocator; - }; + template + void destroyValidationCacheEXT( ValidationCacheEXT validationCache, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void destroyValidationCacheEXT( ValidationCacheEXT validationCache, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - class SamplerDeleter - { - public: - SamplerDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} + template + void destroy( ValidationCacheEXT validationCache, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void destroy( ValidationCacheEXT validationCache, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void operator()( Sampler sampler ) - { - m_device.destroySampler( sampler, m_allocator ); - } + template + Result getValidationCacheDataEXT( ValidationCacheEXT validationCache, size_t* pDataSize, void* pData, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type getValidationCacheDataEXT( ValidationCacheEXT validationCache, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - private: - Device m_device; - Optional m_allocator; - }; + template + Result mergeValidationCachesEXT( ValidationCacheEXT dstCache, uint32_t srcCacheCount, const ValidationCacheEXT* pSrcCaches, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type mergeValidationCachesEXT( ValidationCacheEXT dstCache, ArrayProxy srcCaches, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - class SamplerYcbcrConversionKHRDeleter - { - public: - SamplerYcbcrConversionKHRDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} + template + void getDescriptorSetLayoutSupport( const DescriptorSetLayoutCreateInfo* pCreateInfo, DescriptorSetLayoutSupport* pSupport, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + DescriptorSetLayoutSupport getDescriptorSetLayoutSupport( const DescriptorSetLayoutCreateInfo & createInfo, Dispatch const &d = Dispatch() ) const; + template + StructureChain getDescriptorSetLayoutSupport( const DescriptorSetLayoutCreateInfo & createInfo, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void operator()( SamplerYcbcrConversionKHR samplerYcbcrConversionKHR ) - { - m_device.destroySamplerYcbcrConversionKHR( samplerYcbcrConversionKHR, m_allocator ); - } + template + void getDescriptorSetLayoutSupportKHR( const DescriptorSetLayoutCreateInfo* pCreateInfo, DescriptorSetLayoutSupport* pSupport, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + DescriptorSetLayoutSupport getDescriptorSetLayoutSupportKHR( const DescriptorSetLayoutCreateInfo & createInfo, Dispatch const &d = Dispatch() ) const; + template + StructureChain getDescriptorSetLayoutSupportKHR( const DescriptorSetLayoutCreateInfo & createInfo, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - private: - Device m_device; - Optional m_allocator; - }; + template + Result getShaderInfoAMD( Pipeline pipeline, ShaderStageFlagBits shaderStage, ShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type getShaderInfoAMD( Pipeline pipeline, ShaderStageFlagBits shaderStage, ShaderInfoTypeAMD infoType, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - class SemaphoreDeleter - { - public: - SemaphoreDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} + template + Result setDebugUtilsObjectNameEXT( const DebugUtilsObjectNameInfoEXT* pNameInfo, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type setDebugUtilsObjectNameEXT( const DebugUtilsObjectNameInfoEXT & nameInfo, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void operator()( Semaphore semaphore ) - { - m_device.destroySemaphore( semaphore, m_allocator ); - } + template + Result setDebugUtilsObjectTagEXT( const DebugUtilsObjectTagInfoEXT* pTagInfo, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type setDebugUtilsObjectTagEXT( const DebugUtilsObjectTagInfoEXT & tagInfo, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - private: - Device m_device; - Optional m_allocator; - }; + template + Result getMemoryHostPointerPropertiesEXT( ExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer, MemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type getMemoryHostPointerPropertiesEXT( ExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - class ShaderModuleDeleter - { - public: - ShaderModuleDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + template + Result getAndroidHardwareBufferPropertiesANDROID( const struct AHardwareBuffer* buffer, AndroidHardwareBufferPropertiesANDROID* pProperties, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type getAndroidHardwareBufferPropertiesANDROID( const struct AHardwareBuffer & buffer, Dispatch const &d = Dispatch() ) const; + template + typename ResultValueType>::type getAndroidHardwareBufferPropertiesANDROID( const struct AHardwareBuffer & buffer, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ - void operator()( ShaderModule shaderModule ) - { - m_device.destroyShaderModule( shaderModule, m_allocator ); - } +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + template + Result getMemoryAndroidHardwareBufferANDROID( const MemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type getMemoryAndroidHardwareBufferANDROID( const MemoryGetAndroidHardwareBufferInfoANDROID & info, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ - private: - Device m_device; - Optional m_allocator; - }; - class SwapchainKHRDeleter - { - public: - SwapchainKHRDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} - void operator()( SwapchainKHR swapchainKHR ) + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDevice() const { - m_device.destroySwapchainKHR( swapchainKHR, m_allocator ); + return m_device; } - private: - Device m_device; - Optional m_allocator; - }; - - class ValidationCacheEXTDeleter - { - public: - ValidationCacheEXTDeleter( Device device = Device(), Optional allocator = nullptr ) - : m_device( device ) - , m_allocator( allocator ) - {} + explicit operator bool() const + { + return m_device != VK_NULL_HANDLE; + } - void operator()( ValidationCacheEXT validationCacheEXT ) + bool operator!() const { - m_device.destroyValidationCacheEXT( validationCacheEXT, m_allocator ); + return m_device == VK_NULL_HANDLE; } private: - Device m_device; - Optional m_allocator; + VkDevice m_device; }; -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ - VULKAN_HPP_INLINE PFN_vkVoidFunction Device::getProcAddr( const char* pName ) const + static_assert( sizeof( Device ) == sizeof( VkDevice ), "handle and wrapper have different size!" ); + + template + VULKAN_HPP_INLINE PFN_vkVoidFunction Device::getProcAddr( const char* pName, Dispatch const &d) const { - return vkGetDeviceProcAddr( m_device, pName ); + return d.vkGetDeviceProcAddr( m_device, pName ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE PFN_vkVoidFunction Device::getProcAddr( const std::string & name ) const + template + VULKAN_HPP_INLINE PFN_vkVoidFunction Device::getProcAddr( const std::string & name, Dispatch const &d ) const { - return vkGetDeviceProcAddr( m_device, name.c_str() ); + return d.vkGetDeviceProcAddr( m_device, name.c_str() ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroy( const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyDevice( m_device, reinterpret_cast( pAllocator ) ); + d.vkDestroyDevice( m_device, reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroy( Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( Optional allocator, Dispatch const &d ) const { - vkDestroyDevice( m_device, reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyDevice( m_device, reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex, Queue* pQueue ) const + template + VULKAN_HPP_INLINE void Device::getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex, Queue* pQueue, Dispatch const &d) const { - vkGetDeviceQueue( m_device, queueFamilyIndex, queueIndex, reinterpret_cast( pQueue ) ); + d.vkGetDeviceQueue( m_device, queueFamilyIndex, queueIndex, reinterpret_cast( pQueue ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Queue Device::getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex ) const + template + VULKAN_HPP_INLINE Queue Device::getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex, Dispatch const &d ) const { Queue queue; - vkGetDeviceQueue( m_device, queueFamilyIndex, queueIndex, reinterpret_cast( &queue ) ); + d.vkGetDeviceQueue( m_device, queueFamilyIndex, queueIndex, reinterpret_cast( &queue ) ); return queue; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Result Device::waitIdle() const + template + VULKAN_HPP_INLINE Result Device::waitIdle(Dispatch const &d) const { - return static_cast( vkDeviceWaitIdle( m_device ) ); + return static_cast( d.vkDeviceWaitIdle( m_device ) ); } #else - VULKAN_HPP_INLINE ResultValueType::type Device::waitIdle() const + template + VULKAN_HPP_INLINE ResultValueType::type Device::waitIdle(Dispatch const &d ) const { - Result result = static_cast( vkDeviceWaitIdle( m_device ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::waitIdle" ); + Result result = static_cast( d.vkDeviceWaitIdle( m_device ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::waitIdle" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::allocateMemory( const MemoryAllocateInfo* pAllocateInfo, const AllocationCallbacks* pAllocator, DeviceMemory* pMemory ) const + template + VULKAN_HPP_INLINE Result Device::allocateMemory( const MemoryAllocateInfo* pAllocateInfo, const AllocationCallbacks* pAllocator, DeviceMemory* pMemory, Dispatch const &d) const { - return static_cast( vkAllocateMemory( m_device, reinterpret_cast( pAllocateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pMemory ) ) ); + return static_cast( d.vkAllocateMemory( m_device, reinterpret_cast( pAllocateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pMemory ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::allocateMemory( const MemoryAllocateInfo & allocateInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::allocateMemory( const MemoryAllocateInfo & allocateInfo, Optional allocator, Dispatch const &d ) const { DeviceMemory memory; - Result result = static_cast( vkAllocateMemory( m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &memory ) ) ); - return createResultValue( result, memory, "VULKAN_HPP_NAMESPACE::Device::allocateMemory" ); + Result result = static_cast( d.vkAllocateMemory( m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &memory ) ) ); + return createResultValue( result, memory, VULKAN_HPP_NAMESPACE_STRING"::Device::allocateMemory" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueDeviceMemory Device::allocateMemoryUnique( const MemoryAllocateInfo & allocateInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::allocateMemoryUnique( const MemoryAllocateInfo & allocateInfo, Optional allocator, Dispatch const &d ) const { - DeviceMemoryDeleter deleter( *this, allocator ); - return UniqueDeviceMemory( allocateMemory( allocateInfo, allocator ), deleter ); + DeviceMemory memory; + Result result = static_cast( d.vkAllocateMemory( m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &memory ) ) ); + + ObjectFree deleter( *this, allocator ); + return createResultValue( result, memory, VULKAN_HPP_NAMESPACE_STRING"::Device::allocateMemoryUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::freeMemory( DeviceMemory memory, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::freeMemory( DeviceMemory memory, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkFreeMemory( m_device, static_cast( memory ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::freeMemory( DeviceMemory memory, Optional allocator, Dispatch const &d ) const + { + 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( DeviceMemory memory, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkFreeMemory( m_device, static_cast( memory ), reinterpret_cast( pAllocator ) ); + d.vkFreeMemory( m_device, static_cast( memory ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::freeMemory( DeviceMemory memory, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::free( DeviceMemory memory, Optional allocator, Dispatch const &d ) const { - vkFreeMemory( m_device, static_cast( memory ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkFreeMemory( m_device, static_cast( memory ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::mapMemory( DeviceMemory memory, DeviceSize offset, DeviceSize size, MemoryMapFlags flags, void** ppData ) const + template + VULKAN_HPP_INLINE Result Device::mapMemory( DeviceMemory memory, DeviceSize offset, DeviceSize size, MemoryMapFlags flags, void** ppData, Dispatch const &d) const { - return static_cast( vkMapMemory( m_device, static_cast( memory ), offset, size, static_cast( flags ), ppData ) ); + return static_cast( d.vkMapMemory( m_device, static_cast( memory ), offset, size, static_cast( flags ), ppData ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::mapMemory( DeviceMemory memory, DeviceSize offset, DeviceSize size, MemoryMapFlags flags ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::mapMemory( DeviceMemory memory, DeviceSize offset, DeviceSize size, MemoryMapFlags flags, Dispatch const &d ) const { void* pData; - Result result = static_cast( vkMapMemory( m_device, static_cast( memory ), offset, size, static_cast( flags ), &pData ) ); - return createResultValue( result, pData, "VULKAN_HPP_NAMESPACE::Device::mapMemory" ); + Result result = static_cast( d.vkMapMemory( m_device, static_cast( memory ), offset, size, static_cast( flags ), &pData ) ); + return createResultValue( result, pData, VULKAN_HPP_NAMESPACE_STRING"::Device::mapMemory" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::unmapMemory( DeviceMemory memory ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::unmapMemory( DeviceMemory memory, Dispatch const &d) const + { + d.vkUnmapMemory( m_device, static_cast( memory ) ); + } +#else + template + VULKAN_HPP_INLINE void Device::unmapMemory( DeviceMemory memory, Dispatch const &d ) const { - vkUnmapMemory( m_device, static_cast( memory ) ); + d.vkUnmapMemory( m_device, static_cast( memory ) ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::flushMappedMemoryRanges( uint32_t memoryRangeCount, const MappedMemoryRange* pMemoryRanges ) const + template + VULKAN_HPP_INLINE Result Device::flushMappedMemoryRanges( uint32_t memoryRangeCount, const MappedMemoryRange* pMemoryRanges, Dispatch const &d) const { - return static_cast( vkFlushMappedMemoryRanges( m_device, memoryRangeCount, reinterpret_cast( pMemoryRanges ) ) ); + return static_cast( d.vkFlushMappedMemoryRanges( m_device, memoryRangeCount, reinterpret_cast( pMemoryRanges ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::flushMappedMemoryRanges( ArrayProxy memoryRanges ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::flushMappedMemoryRanges( ArrayProxy memoryRanges, Dispatch const &d ) const { - Result result = static_cast( vkFlushMappedMemoryRanges( m_device, memoryRanges.size() , reinterpret_cast( memoryRanges.data() ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::flushMappedMemoryRanges" ); + Result result = static_cast( d.vkFlushMappedMemoryRanges( m_device, memoryRanges.size() , reinterpret_cast( memoryRanges.data() ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::flushMappedMemoryRanges" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::invalidateMappedMemoryRanges( uint32_t memoryRangeCount, const MappedMemoryRange* pMemoryRanges ) const + template + VULKAN_HPP_INLINE Result Device::invalidateMappedMemoryRanges( uint32_t memoryRangeCount, const MappedMemoryRange* pMemoryRanges, Dispatch const &d) const { - return static_cast( vkInvalidateMappedMemoryRanges( m_device, memoryRangeCount, reinterpret_cast( pMemoryRanges ) ) ); + return static_cast( d.vkInvalidateMappedMemoryRanges( m_device, memoryRangeCount, reinterpret_cast( pMemoryRanges ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::invalidateMappedMemoryRanges( ArrayProxy memoryRanges ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::invalidateMappedMemoryRanges( ArrayProxy memoryRanges, Dispatch const &d ) const { - Result result = static_cast( vkInvalidateMappedMemoryRanges( m_device, memoryRanges.size() , reinterpret_cast( memoryRanges.data() ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::invalidateMappedMemoryRanges" ); + Result result = static_cast( d.vkInvalidateMappedMemoryRanges( m_device, memoryRanges.size() , reinterpret_cast( memoryRanges.data() ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::invalidateMappedMemoryRanges" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::getMemoryCommitment( DeviceMemory memory, DeviceSize* pCommittedMemoryInBytes ) const + template + VULKAN_HPP_INLINE void Device::getMemoryCommitment( DeviceMemory memory, DeviceSize* pCommittedMemoryInBytes, Dispatch const &d) const { - vkGetDeviceMemoryCommitment( m_device, static_cast( memory ), pCommittedMemoryInBytes ); + d.vkGetDeviceMemoryCommitment( m_device, static_cast( memory ), pCommittedMemoryInBytes ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE DeviceSize Device::getMemoryCommitment( DeviceMemory memory ) const + template + VULKAN_HPP_INLINE DeviceSize Device::getMemoryCommitment( DeviceMemory memory, Dispatch const &d ) const { DeviceSize committedMemoryInBytes; - vkGetDeviceMemoryCommitment( m_device, static_cast( memory ), &committedMemoryInBytes ); + d.vkGetDeviceMemoryCommitment( m_device, static_cast( memory ), &committedMemoryInBytes ); return committedMemoryInBytes; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::getBufferMemoryRequirements( Buffer buffer, MemoryRequirements* pMemoryRequirements ) const + template + VULKAN_HPP_INLINE void Device::getBufferMemoryRequirements( Buffer buffer, MemoryRequirements* pMemoryRequirements, Dispatch const &d) const { - vkGetBufferMemoryRequirements( m_device, static_cast( buffer ), reinterpret_cast( pMemoryRequirements ) ); + d.vkGetBufferMemoryRequirements( m_device, static_cast( buffer ), reinterpret_cast( pMemoryRequirements ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE MemoryRequirements Device::getBufferMemoryRequirements( Buffer buffer ) const + template + VULKAN_HPP_INLINE MemoryRequirements Device::getBufferMemoryRequirements( Buffer buffer, Dispatch const &d ) const { MemoryRequirements memoryRequirements; - vkGetBufferMemoryRequirements( m_device, static_cast( buffer ), reinterpret_cast( &memoryRequirements ) ); + d.vkGetBufferMemoryRequirements( m_device, static_cast( buffer ), reinterpret_cast( &memoryRequirements ) ); return memoryRequirements; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Result Device::bindBufferMemory( Buffer buffer, DeviceMemory memory, DeviceSize memoryOffset ) const + template + VULKAN_HPP_INLINE Result Device::bindBufferMemory( Buffer buffer, DeviceMemory memory, DeviceSize memoryOffset, Dispatch const &d) const { - return static_cast( vkBindBufferMemory( m_device, static_cast( buffer ), static_cast( memory ), memoryOffset ) ); + return static_cast( d.vkBindBufferMemory( m_device, static_cast( buffer ), static_cast( memory ), memoryOffset ) ); } #else - VULKAN_HPP_INLINE ResultValueType::type Device::bindBufferMemory( Buffer buffer, DeviceMemory memory, DeviceSize memoryOffset ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::bindBufferMemory( Buffer buffer, DeviceMemory memory, DeviceSize memoryOffset, Dispatch const &d ) const { - Result result = static_cast( vkBindBufferMemory( m_device, static_cast( buffer ), static_cast( memory ), memoryOffset ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::bindBufferMemory" ); + Result result = static_cast( d.vkBindBufferMemory( m_device, static_cast( buffer ), static_cast( memory ), memoryOffset ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::bindBufferMemory" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::getImageMemoryRequirements( Image image, MemoryRequirements* pMemoryRequirements ) const + template + VULKAN_HPP_INLINE void Device::getImageMemoryRequirements( Image image, MemoryRequirements* pMemoryRequirements, Dispatch const &d) const { - vkGetImageMemoryRequirements( m_device, static_cast( image ), reinterpret_cast( pMemoryRequirements ) ); + d.vkGetImageMemoryRequirements( m_device, static_cast( image ), reinterpret_cast( pMemoryRequirements ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE MemoryRequirements Device::getImageMemoryRequirements( Image image ) const + template + VULKAN_HPP_INLINE MemoryRequirements Device::getImageMemoryRequirements( Image image, Dispatch const &d ) const { MemoryRequirements memoryRequirements; - vkGetImageMemoryRequirements( m_device, static_cast( image ), reinterpret_cast( &memoryRequirements ) ); + d.vkGetImageMemoryRequirements( m_device, static_cast( image ), reinterpret_cast( &memoryRequirements ) ); return memoryRequirements; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Result Device::bindImageMemory( Image image, DeviceMemory memory, DeviceSize memoryOffset ) const + template + VULKAN_HPP_INLINE Result Device::bindImageMemory( Image image, DeviceMemory memory, DeviceSize memoryOffset, Dispatch const &d) const { - return static_cast( vkBindImageMemory( m_device, static_cast( image ), static_cast( memory ), memoryOffset ) ); + return static_cast( d.vkBindImageMemory( m_device, static_cast( image ), static_cast( memory ), memoryOffset ) ); } #else - VULKAN_HPP_INLINE ResultValueType::type Device::bindImageMemory( Image image, DeviceMemory memory, DeviceSize memoryOffset ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::bindImageMemory( Image image, DeviceMemory memory, DeviceSize memoryOffset, Dispatch const &d ) const { - Result result = static_cast( vkBindImageMemory( m_device, static_cast( image ), static_cast( memory ), memoryOffset ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::bindImageMemory" ); + Result result = static_cast( d.vkBindImageMemory( m_device, static_cast( image ), static_cast( memory ), memoryOffset ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::bindImageMemory" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::getImageSparseMemoryRequirements( Image image, uint32_t* pSparseMemoryRequirementCount, SparseImageMemoryRequirements* pSparseMemoryRequirements ) const + template + VULKAN_HPP_INLINE void Device::getImageSparseMemoryRequirements( Image image, uint32_t* pSparseMemoryRequirementCount, SparseImageMemoryRequirements* pSparseMemoryRequirements, Dispatch const &d) const { - vkGetImageSparseMemoryRequirements( m_device, static_cast( image ), pSparseMemoryRequirementCount, reinterpret_cast( pSparseMemoryRequirements ) ); + d.vkGetImageSparseMemoryRequirements( m_device, static_cast( image ), pSparseMemoryRequirementCount, reinterpret_cast( pSparseMemoryRequirements ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE std::vector Device::getImageSparseMemoryRequirements( Image image ) const + template + VULKAN_HPP_INLINE std::vector Device::getImageSparseMemoryRequirements( Image image, Dispatch const &d ) const { std::vector sparseMemoryRequirements; uint32_t sparseMemoryRequirementCount; - vkGetImageSparseMemoryRequirements( m_device, static_cast( image ), &sparseMemoryRequirementCount, nullptr ); + d.vkGetImageSparseMemoryRequirements( m_device, static_cast( image ), &sparseMemoryRequirementCount, nullptr ); sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - vkGetImageSparseMemoryRequirements( m_device, static_cast( image ), &sparseMemoryRequirementCount, reinterpret_cast( sparseMemoryRequirements.data() ) ); + d.vkGetImageSparseMemoryRequirements( m_device, static_cast( image ), &sparseMemoryRequirementCount, reinterpret_cast( sparseMemoryRequirements.data() ) ); return sparseMemoryRequirements; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createFence( const FenceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Fence* pFence ) const + template + VULKAN_HPP_INLINE Result Device::createFence( const FenceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Fence* pFence, Dispatch const &d) const { - return static_cast( vkCreateFence( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pFence ) ) ); + return static_cast( d.vkCreateFence( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pFence ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createFence( const FenceCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createFence( const FenceCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { Fence fence; - Result result = static_cast( vkCreateFence( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &fence ) ) ); - return createResultValue( result, fence, "VULKAN_HPP_NAMESPACE::Device::createFence" ); + Result result = static_cast( d.vkCreateFence( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &fence ) ) ); + return createResultValue( result, fence, VULKAN_HPP_NAMESPACE_STRING"::Device::createFence" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueFence Device::createFenceUnique( const FenceCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createFenceUnique( const FenceCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - FenceDeleter deleter( *this, allocator ); - return UniqueFence( createFence( createInfo, allocator ), deleter ); + Fence fence; + Result result = static_cast( d.vkCreateFence( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &fence ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, fence, VULKAN_HPP_NAMESPACE_STRING"::Device::createFenceUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyFence( Fence fence, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyFence( Fence fence, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyFence( m_device, static_cast( fence ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroyFence( Fence fence, Optional allocator, Dispatch const &d ) const + { + 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( Fence fence, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyFence( m_device, static_cast( fence ), reinterpret_cast( pAllocator ) ); + d.vkDestroyFence( m_device, static_cast( fence ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyFence( Fence fence, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( Fence fence, Optional allocator, Dispatch const &d ) const { - vkDestroyFence( m_device, static_cast( fence ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyFence( m_device, static_cast( fence ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::resetFences( uint32_t fenceCount, const Fence* pFences ) const + template + VULKAN_HPP_INLINE Result Device::resetFences( uint32_t fenceCount, const Fence* pFences, Dispatch const &d) const { - return static_cast( vkResetFences( m_device, fenceCount, reinterpret_cast( pFences ) ) ); + return static_cast( d.vkResetFences( m_device, fenceCount, reinterpret_cast( pFences ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::resetFences( ArrayProxy fences ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::resetFences( ArrayProxy fences, Dispatch const &d ) const { - Result result = static_cast( vkResetFences( m_device, fences.size() , reinterpret_cast( fences.data() ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::resetFences" ); + Result result = static_cast( d.vkResetFences( m_device, fences.size() , reinterpret_cast( fences.data() ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::resetFences" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Result Device::getFenceStatus( Fence fence ) const + template + VULKAN_HPP_INLINE Result Device::getFenceStatus( Fence fence, Dispatch const &d) const { - return static_cast( vkGetFenceStatus( m_device, static_cast( fence ) ) ); + return static_cast( d.vkGetFenceStatus( m_device, static_cast( fence ) ) ); } #else - VULKAN_HPP_INLINE Result Device::getFenceStatus( Fence fence ) const + template + VULKAN_HPP_INLINE Result Device::getFenceStatus( Fence fence, Dispatch const &d ) const { - Result result = static_cast( vkGetFenceStatus( m_device, static_cast( fence ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::getFenceStatus", { Result::eSuccess, Result::eNotReady } ); + Result result = static_cast( d.vkGetFenceStatus( m_device, static_cast( fence ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::getFenceStatus", { Result::eSuccess, Result::eNotReady } ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::waitForFences( uint32_t fenceCount, const Fence* pFences, Bool32 waitAll, uint64_t timeout ) const + template + VULKAN_HPP_INLINE Result Device::waitForFences( uint32_t fenceCount, const Fence* pFences, Bool32 waitAll, uint64_t timeout, Dispatch const &d) const { - return static_cast( vkWaitForFences( m_device, fenceCount, reinterpret_cast( pFences ), waitAll, timeout ) ); + return static_cast( d.vkWaitForFences( m_device, fenceCount, reinterpret_cast( pFences ), waitAll, timeout ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Result Device::waitForFences( ArrayProxy fences, Bool32 waitAll, uint64_t timeout ) const + template + VULKAN_HPP_INLINE Result Device::waitForFences( ArrayProxy fences, Bool32 waitAll, uint64_t timeout, Dispatch const &d ) const { - Result result = static_cast( vkWaitForFences( m_device, fences.size() , reinterpret_cast( fences.data() ), waitAll, timeout ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::waitForFences", { Result::eSuccess, Result::eTimeout } ); + Result result = static_cast( d.vkWaitForFences( m_device, fences.size() , reinterpret_cast( fences.data() ), waitAll, timeout ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::waitForFences", { Result::eSuccess, Result::eTimeout } ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createSemaphore( const SemaphoreCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Semaphore* pSemaphore ) const + template + VULKAN_HPP_INLINE Result Device::createSemaphore( const SemaphoreCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Semaphore* pSemaphore, Dispatch const &d) const { - return static_cast( vkCreateSemaphore( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSemaphore ) ) ); + return static_cast( d.vkCreateSemaphore( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSemaphore ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createSemaphore( const SemaphoreCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createSemaphore( const SemaphoreCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { Semaphore semaphore; - Result result = static_cast( vkCreateSemaphore( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &semaphore ) ) ); - return createResultValue( result, semaphore, "VULKAN_HPP_NAMESPACE::Device::createSemaphore" ); + Result result = static_cast( d.vkCreateSemaphore( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &semaphore ) ) ); + return createResultValue( result, semaphore, VULKAN_HPP_NAMESPACE_STRING"::Device::createSemaphore" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueSemaphore Device::createSemaphoreUnique( const SemaphoreCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createSemaphoreUnique( const SemaphoreCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - SemaphoreDeleter deleter( *this, allocator ); - return UniqueSemaphore( createSemaphore( createInfo, allocator ), deleter ); + Semaphore semaphore; + Result result = static_cast( d.vkCreateSemaphore( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &semaphore ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, semaphore, VULKAN_HPP_NAMESPACE_STRING"::Device::createSemaphoreUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroySemaphore( Semaphore semaphore, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroySemaphore( Semaphore semaphore, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroySemaphore( m_device, static_cast( semaphore ), reinterpret_cast( pAllocator ) ); + d.vkDestroySemaphore( m_device, static_cast( semaphore ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroySemaphore( Semaphore semaphore, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroySemaphore( Semaphore semaphore, Optional allocator, Dispatch const &d ) const { - vkDestroySemaphore( m_device, static_cast( semaphore ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroySemaphore( m_device, static_cast( semaphore ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createEvent( const EventCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Event* pEvent ) const + template + VULKAN_HPP_INLINE void Device::destroy( Semaphore semaphore, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - return static_cast( vkCreateEvent( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pEvent ) ) ); + d.vkDestroySemaphore( m_device, static_cast( semaphore ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createEvent( const EventCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( Semaphore semaphore, Optional allocator, Dispatch const &d ) const + { + d.vkDestroySemaphore( m_device, static_cast( semaphore ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE Result Device::createEvent( const EventCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Event* pEvent, Dispatch const &d) const + { + 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_INLINE ResultValueType::type Device::createEvent( const EventCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { Event event; - Result result = static_cast( vkCreateEvent( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &event ) ) ); - return createResultValue( result, event, "VULKAN_HPP_NAMESPACE::Device::createEvent" ); + Result result = static_cast( d.vkCreateEvent( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &event ) ) ); + return createResultValue( result, event, VULKAN_HPP_NAMESPACE_STRING"::Device::createEvent" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueEvent Device::createEventUnique( const EventCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createEventUnique( const EventCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - EventDeleter deleter( *this, allocator ); - return UniqueEvent( createEvent( createInfo, allocator ), deleter ); + Event event; + Result result = static_cast( d.vkCreateEvent( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &event ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, event, VULKAN_HPP_NAMESPACE_STRING"::Device::createEventUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyEvent( Event event, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyEvent( Event event, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyEvent( m_device, static_cast( event ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroyEvent( Event event, Optional allocator, Dispatch const &d ) const + { + 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( Event event, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyEvent( m_device, static_cast( event ), reinterpret_cast( pAllocator ) ); + d.vkDestroyEvent( m_device, static_cast( event ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyEvent( Event event, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( Event event, Optional allocator, Dispatch const &d ) const { - vkDestroyEvent( m_device, static_cast( event ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyEvent( m_device, static_cast( event ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Result Device::getEventStatus( Event event ) const + template + VULKAN_HPP_INLINE Result Device::getEventStatus( Event event, Dispatch const &d) const { - return static_cast( vkGetEventStatus( m_device, static_cast( event ) ) ); + return static_cast( d.vkGetEventStatus( m_device, static_cast( event ) ) ); } #else - VULKAN_HPP_INLINE Result Device::getEventStatus( Event event ) const + template + VULKAN_HPP_INLINE Result Device::getEventStatus( Event event, Dispatch const &d ) const { - Result result = static_cast( vkGetEventStatus( m_device, static_cast( event ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::getEventStatus", { Result::eEventSet, Result::eEventReset } ); + Result result = static_cast( d.vkGetEventStatus( m_device, static_cast( event ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::getEventStatus", { Result::eEventSet, Result::eEventReset } ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Result Device::setEvent( Event event ) const + template + VULKAN_HPP_INLINE Result Device::setEvent( Event event, Dispatch const &d) const { - return static_cast( vkSetEvent( m_device, static_cast( event ) ) ); + return static_cast( d.vkSetEvent( m_device, static_cast( event ) ) ); } #else - VULKAN_HPP_INLINE ResultValueType::type Device::setEvent( Event event ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::setEvent( Event event, Dispatch const &d ) const { - Result result = static_cast( vkSetEvent( m_device, static_cast( event ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::setEvent" ); + Result result = static_cast( d.vkSetEvent( m_device, static_cast( event ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::setEvent" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Result Device::resetEvent( Event event ) const + template + VULKAN_HPP_INLINE Result Device::resetEvent( Event event, Dispatch const &d) const { - return static_cast( vkResetEvent( m_device, static_cast( event ) ) ); + return static_cast( d.vkResetEvent( m_device, static_cast( event ) ) ); } #else - VULKAN_HPP_INLINE ResultValueType::type Device::resetEvent( Event event ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::resetEvent( Event event, Dispatch const &d ) const { - Result result = static_cast( vkResetEvent( m_device, static_cast( event ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::resetEvent" ); + Result result = static_cast( d.vkResetEvent( m_device, static_cast( event ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::resetEvent" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createQueryPool( const QueryPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, QueryPool* pQueryPool ) const + template + VULKAN_HPP_INLINE Result Device::createQueryPool( const QueryPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, QueryPool* pQueryPool, Dispatch const &d) const { - return static_cast( vkCreateQueryPool( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pQueryPool ) ) ); + return static_cast( d.vkCreateQueryPool( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pQueryPool ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createQueryPool( const QueryPoolCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createQueryPool( const QueryPoolCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { QueryPool queryPool; - Result result = static_cast( vkCreateQueryPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &queryPool ) ) ); - return createResultValue( result, queryPool, "VULKAN_HPP_NAMESPACE::Device::createQueryPool" ); + Result result = static_cast( d.vkCreateQueryPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &queryPool ) ) ); + return createResultValue( result, queryPool, VULKAN_HPP_NAMESPACE_STRING"::Device::createQueryPool" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueQueryPool Device::createQueryPoolUnique( const QueryPoolCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createQueryPoolUnique( const QueryPoolCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - QueryPoolDeleter deleter( *this, allocator ); - return UniqueQueryPool( createQueryPool( createInfo, allocator ), deleter ); + QueryPool queryPool; + Result result = static_cast( d.vkCreateQueryPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &queryPool ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, queryPool, VULKAN_HPP_NAMESPACE_STRING"::Device::createQueryPoolUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyQueryPool( QueryPool queryPool, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyQueryPool( QueryPool queryPool, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyQueryPool( m_device, static_cast( queryPool ), reinterpret_cast( pAllocator ) ); + d.vkDestroyQueryPool( m_device, static_cast( queryPool ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyQueryPool( QueryPool queryPool, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroyQueryPool( QueryPool queryPool, Optional allocator, Dispatch const &d ) const { - vkDestroyQueryPool( m_device, static_cast( queryPool ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyQueryPool( m_device, static_cast( queryPool ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::getQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, DeviceSize stride, QueryResultFlags flags ) const + template + VULKAN_HPP_INLINE void Device::destroy( QueryPool queryPool, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - return static_cast( vkGetQueryPoolResults( m_device, static_cast( queryPool ), firstQuery, queryCount, dataSize, pData, stride, static_cast( flags ) ) ); + d.vkDestroyQueryPool( m_device, static_cast( queryPool ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE Result Device::getQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, ArrayProxy data, DeviceSize stride, QueryResultFlags flags ) const + template + VULKAN_HPP_INLINE void Device::destroy( QueryPool queryPool, Optional allocator, Dispatch const &d ) const + { + d.vkDestroyQueryPool( m_device, static_cast( queryPool ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE Result Device::getQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, DeviceSize stride, QueryResultFlags flags, Dispatch const &d) const + { + return static_cast( d.vkGetQueryPoolResults( m_device, static_cast( queryPool ), firstQuery, queryCount, dataSize, pData, stride, static_cast( flags ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE Result Device::getQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, ArrayProxy data, DeviceSize stride, QueryResultFlags flags, Dispatch const &d ) const { - Result result = static_cast( vkGetQueryPoolResults( m_device, static_cast( queryPool ), firstQuery, queryCount, data.size() * sizeof( T ) , reinterpret_cast( data.data() ), stride, static_cast( flags ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::getQueryPoolResults", { Result::eSuccess, Result::eNotReady } ); + Result result = static_cast( d.vkGetQueryPoolResults( m_device, static_cast( queryPool ), firstQuery, queryCount, data.size() * sizeof( T ) , reinterpret_cast( data.data() ), stride, static_cast( flags ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::getQueryPoolResults", { Result::eSuccess, Result::eNotReady } ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createBuffer( const BufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Buffer* pBuffer ) const + template + VULKAN_HPP_INLINE Result Device::createBuffer( const BufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Buffer* pBuffer, Dispatch const &d) const { - return static_cast( vkCreateBuffer( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pBuffer ) ) ); + return static_cast( d.vkCreateBuffer( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pBuffer ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createBuffer( const BufferCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createBuffer( const BufferCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { Buffer buffer; - Result result = static_cast( vkCreateBuffer( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &buffer ) ) ); - return createResultValue( result, buffer, "VULKAN_HPP_NAMESPACE::Device::createBuffer" ); + Result result = static_cast( d.vkCreateBuffer( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &buffer ) ) ); + return createResultValue( result, buffer, VULKAN_HPP_NAMESPACE_STRING"::Device::createBuffer" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueBuffer Device::createBufferUnique( const BufferCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createBufferUnique( const BufferCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - BufferDeleter deleter( *this, allocator ); - return UniqueBuffer( createBuffer( createInfo, allocator ), deleter ); + Buffer buffer; + Result result = static_cast( d.vkCreateBuffer( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &buffer ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, buffer, VULKAN_HPP_NAMESPACE_STRING"::Device::createBufferUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyBuffer( Buffer buffer, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyBuffer( Buffer buffer, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyBuffer( m_device, static_cast( buffer ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroyBuffer( Buffer buffer, Optional allocator, Dispatch const &d ) const + { + 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( Buffer buffer, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyBuffer( m_device, static_cast( buffer ), reinterpret_cast( pAllocator ) ); + d.vkDestroyBuffer( m_device, static_cast( buffer ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyBuffer( Buffer buffer, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( Buffer buffer, Optional allocator, Dispatch const &d ) const { - vkDestroyBuffer( m_device, static_cast( buffer ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyBuffer( m_device, static_cast( buffer ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createBufferView( const BufferViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, BufferView* pView ) const + template + VULKAN_HPP_INLINE Result Device::createBufferView( const BufferViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, BufferView* pView, Dispatch const &d) const { - return static_cast( vkCreateBufferView( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pView ) ) ); + return static_cast( d.vkCreateBufferView( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pView ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createBufferView( const BufferViewCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createBufferView( const BufferViewCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { BufferView view; - Result result = static_cast( vkCreateBufferView( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &view ) ) ); - return createResultValue( result, view, "VULKAN_HPP_NAMESPACE::Device::createBufferView" ); + Result result = static_cast( d.vkCreateBufferView( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &view ) ) ); + return createResultValue( result, view, VULKAN_HPP_NAMESPACE_STRING"::Device::createBufferView" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueBufferView Device::createBufferViewUnique( const BufferViewCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createBufferViewUnique( const BufferViewCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - BufferViewDeleter deleter( *this, allocator ); - return UniqueBufferView( createBufferView( createInfo, allocator ), deleter ); + BufferView view; + Result result = static_cast( d.vkCreateBufferView( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &view ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, view, VULKAN_HPP_NAMESPACE_STRING"::Device::createBufferViewUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyBufferView( BufferView bufferView, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyBufferView( BufferView bufferView, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyBufferView( m_device, static_cast( bufferView ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroyBufferView( BufferView bufferView, Optional allocator, Dispatch const &d ) const + { + 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( BufferView bufferView, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyBufferView( m_device, static_cast( bufferView ), reinterpret_cast( pAllocator ) ); + d.vkDestroyBufferView( m_device, static_cast( bufferView ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyBufferView( BufferView bufferView, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( BufferView bufferView, Optional allocator, Dispatch const &d ) const { - vkDestroyBufferView( m_device, static_cast( bufferView ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyBufferView( m_device, static_cast( bufferView ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createImage( const ImageCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Image* pImage ) const + template + VULKAN_HPP_INLINE Result Device::createImage( const ImageCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Image* pImage, Dispatch const &d) const { - return static_cast( vkCreateImage( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pImage ) ) ); + return static_cast( d.vkCreateImage( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pImage ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createImage( const ImageCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createImage( const ImageCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { Image image; - Result result = static_cast( vkCreateImage( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &image ) ) ); - return createResultValue( result, image, "VULKAN_HPP_NAMESPACE::Device::createImage" ); + Result result = static_cast( d.vkCreateImage( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &image ) ) ); + return createResultValue( result, image, VULKAN_HPP_NAMESPACE_STRING"::Device::createImage" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueImage Device::createImageUnique( const ImageCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createImageUnique( const ImageCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - ImageDeleter deleter( *this, allocator ); - return UniqueImage( createImage( createInfo, allocator ), deleter ); + Image image; + Result result = static_cast( d.vkCreateImage( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &image ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, image, VULKAN_HPP_NAMESPACE_STRING"::Device::createImageUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyImage( Image image, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyImage( Image image, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyImage( m_device, static_cast( image ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroyImage( Image image, Optional allocator, Dispatch const &d ) const + { + 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( Image image, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyImage( m_device, static_cast( image ), reinterpret_cast( pAllocator ) ); + d.vkDestroyImage( m_device, static_cast( image ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyImage( Image image, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( Image image, Optional allocator, Dispatch const &d ) const { - vkDestroyImage( m_device, static_cast( image ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyImage( m_device, static_cast( image ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::getImageSubresourceLayout( Image image, const ImageSubresource* pSubresource, SubresourceLayout* pLayout ) const + template + VULKAN_HPP_INLINE void Device::getImageSubresourceLayout( Image image, const ImageSubresource* pSubresource, SubresourceLayout* pLayout, Dispatch const &d) const { - vkGetImageSubresourceLayout( m_device, static_cast( image ), reinterpret_cast( pSubresource ), reinterpret_cast( pLayout ) ); + d.vkGetImageSubresourceLayout( m_device, static_cast( image ), reinterpret_cast( pSubresource ), reinterpret_cast( pLayout ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE SubresourceLayout Device::getImageSubresourceLayout( Image image, const ImageSubresource & subresource ) const + template + VULKAN_HPP_INLINE SubresourceLayout Device::getImageSubresourceLayout( Image image, const ImageSubresource & subresource, Dispatch const &d ) const { SubresourceLayout layout; - vkGetImageSubresourceLayout( m_device, static_cast( image ), reinterpret_cast( &subresource ), reinterpret_cast( &layout ) ); + d.vkGetImageSubresourceLayout( m_device, static_cast( image ), reinterpret_cast( &subresource ), reinterpret_cast( &layout ) ); return layout; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createImageView( const ImageViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, ImageView* pView ) const + template + VULKAN_HPP_INLINE Result Device::createImageView( const ImageViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, ImageView* pView, Dispatch const &d) const { - return static_cast( vkCreateImageView( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pView ) ) ); + return static_cast( d.vkCreateImageView( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pView ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createImageView( const ImageViewCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createImageView( const ImageViewCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { ImageView view; - Result result = static_cast( vkCreateImageView( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &view ) ) ); - return createResultValue( result, view, "VULKAN_HPP_NAMESPACE::Device::createImageView" ); + Result result = static_cast( d.vkCreateImageView( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &view ) ) ); + return createResultValue( result, view, VULKAN_HPP_NAMESPACE_STRING"::Device::createImageView" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueImageView Device::createImageViewUnique( const ImageViewCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createImageViewUnique( const ImageViewCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - ImageViewDeleter deleter( *this, allocator ); - return UniqueImageView( createImageView( createInfo, allocator ), deleter ); + ImageView view; + Result result = static_cast( d.vkCreateImageView( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &view ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, view, VULKAN_HPP_NAMESPACE_STRING"::Device::createImageViewUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyImageView( ImageView imageView, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyImageView( ImageView imageView, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyImageView( m_device, static_cast( imageView ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroyImageView( ImageView imageView, Optional allocator, Dispatch const &d ) const + { + 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( ImageView imageView, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyImageView( m_device, static_cast( imageView ), reinterpret_cast( pAllocator ) ); + d.vkDestroyImageView( m_device, static_cast( imageView ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyImageView( ImageView imageView, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( ImageView imageView, Optional allocator, Dispatch const &d ) const { - vkDestroyImageView( m_device, static_cast( imageView ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyImageView( m_device, static_cast( imageView ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createShaderModule( const ShaderModuleCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, ShaderModule* pShaderModule ) const + template + VULKAN_HPP_INLINE Result Device::createShaderModule( const ShaderModuleCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, ShaderModule* pShaderModule, Dispatch const &d) const { - return static_cast( vkCreateShaderModule( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pShaderModule ) ) ); + return static_cast( d.vkCreateShaderModule( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pShaderModule ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createShaderModule( const ShaderModuleCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createShaderModule( const ShaderModuleCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { ShaderModule shaderModule; - Result result = static_cast( vkCreateShaderModule( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &shaderModule ) ) ); - return createResultValue( result, shaderModule, "VULKAN_HPP_NAMESPACE::Device::createShaderModule" ); + Result result = static_cast( d.vkCreateShaderModule( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &shaderModule ) ) ); + return createResultValue( result, shaderModule, VULKAN_HPP_NAMESPACE_STRING"::Device::createShaderModule" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueShaderModule Device::createShaderModuleUnique( const ShaderModuleCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createShaderModuleUnique( const ShaderModuleCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - ShaderModuleDeleter deleter( *this, allocator ); - return UniqueShaderModule( createShaderModule( createInfo, allocator ), deleter ); + ShaderModule shaderModule; + Result result = static_cast( d.vkCreateShaderModule( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &shaderModule ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, shaderModule, VULKAN_HPP_NAMESPACE_STRING"::Device::createShaderModuleUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyShaderModule( ShaderModule shaderModule, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyShaderModule( ShaderModule shaderModule, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyShaderModule( m_device, static_cast( shaderModule ), reinterpret_cast( pAllocator ) ); + d.vkDestroyShaderModule( m_device, static_cast( shaderModule ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyShaderModule( ShaderModule shaderModule, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroyShaderModule( ShaderModule shaderModule, Optional allocator, Dispatch const &d ) const { - vkDestroyShaderModule( m_device, static_cast( shaderModule ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyShaderModule( m_device, static_cast( shaderModule ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createPipelineCache( const PipelineCacheCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, PipelineCache* pPipelineCache ) const + template + VULKAN_HPP_INLINE void Device::destroy( ShaderModule shaderModule, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - return static_cast( vkCreatePipelineCache( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pPipelineCache ) ) ); + d.vkDestroyShaderModule( m_device, static_cast( shaderModule ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createPipelineCache( const PipelineCacheCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( ShaderModule shaderModule, Optional allocator, Dispatch const &d ) const + { + d.vkDestroyShaderModule( m_device, static_cast( shaderModule ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE Result Device::createPipelineCache( const PipelineCacheCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, PipelineCache* pPipelineCache, Dispatch const &d) const + { + 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_INLINE ResultValueType::type Device::createPipelineCache( const PipelineCacheCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { PipelineCache pipelineCache; - Result result = static_cast( vkCreatePipelineCache( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &pipelineCache ) ) ); - return createResultValue( result, pipelineCache, "VULKAN_HPP_NAMESPACE::Device::createPipelineCache" ); + Result result = static_cast( d.vkCreatePipelineCache( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &pipelineCache ) ) ); + return createResultValue( result, pipelineCache, VULKAN_HPP_NAMESPACE_STRING"::Device::createPipelineCache" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniquePipelineCache Device::createPipelineCacheUnique( const PipelineCacheCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createPipelineCacheUnique( const PipelineCacheCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - PipelineCacheDeleter deleter( *this, allocator ); - return UniquePipelineCache( createPipelineCache( createInfo, allocator ), deleter ); + PipelineCache pipelineCache; + Result result = static_cast( d.vkCreatePipelineCache( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &pipelineCache ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, pipelineCache, VULKAN_HPP_NAMESPACE_STRING"::Device::createPipelineCacheUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyPipelineCache( PipelineCache pipelineCache, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyPipelineCache( PipelineCache pipelineCache, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyPipelineCache( m_device, static_cast( pipelineCache ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroyPipelineCache( PipelineCache pipelineCache, Optional allocator, Dispatch const &d ) const + { + 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( PipelineCache pipelineCache, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyPipelineCache( m_device, static_cast( pipelineCache ), reinterpret_cast( pAllocator ) ); + d.vkDestroyPipelineCache( m_device, static_cast( pipelineCache ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyPipelineCache( PipelineCache pipelineCache, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( PipelineCache pipelineCache, Optional allocator, Dispatch const &d ) const { - vkDestroyPipelineCache( m_device, static_cast( pipelineCache ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyPipelineCache( m_device, static_cast( pipelineCache ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::getPipelineCacheData( PipelineCache pipelineCache, size_t* pDataSize, void* pData ) const + template + VULKAN_HPP_INLINE Result Device::getPipelineCacheData( PipelineCache pipelineCache, size_t* pDataSize, void* pData, Dispatch const &d) const { - return static_cast( vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), pDataSize, pData ) ); + return static_cast( d.vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), pDataSize, pData ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type Device::getPipelineCacheData( PipelineCache pipelineCache ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::getPipelineCacheData( PipelineCache pipelineCache, Dispatch const &d ) const { std::vector data; size_t dataSize; Result result; do { - result = static_cast( vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), &dataSize, nullptr ) ); + result = static_cast( d.vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), &dataSize, nullptr ) ); if ( ( result == Result::eSuccess ) && dataSize ) { data.resize( dataSize ); - result = static_cast( vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), &dataSize, reinterpret_cast( data.data() ) ) ); + result = static_cast( d.vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), &dataSize, reinterpret_cast( data.data() ) ) ); } } while ( result == Result::eIncomplete ); - assert( dataSize <= data.size() ); + VULKAN_HPP_ASSERT( dataSize <= data.size() ); data.resize( dataSize ); - return createResultValue( result, data, "VULKAN_HPP_NAMESPACE::Device::getPipelineCacheData" ); + return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING"::Device::getPipelineCacheData" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::mergePipelineCaches( PipelineCache dstCache, uint32_t srcCacheCount, const PipelineCache* pSrcCaches ) const + template + VULKAN_HPP_INLINE Result Device::mergePipelineCaches( PipelineCache dstCache, uint32_t srcCacheCount, const PipelineCache* pSrcCaches, Dispatch const &d) const { - return static_cast( vkMergePipelineCaches( m_device, static_cast( dstCache ), srcCacheCount, reinterpret_cast( pSrcCaches ) ) ); + return static_cast( d.vkMergePipelineCaches( m_device, static_cast( dstCache ), srcCacheCount, reinterpret_cast( pSrcCaches ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::mergePipelineCaches( PipelineCache dstCache, ArrayProxy srcCaches ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::mergePipelineCaches( PipelineCache dstCache, ArrayProxy srcCaches, Dispatch const &d ) const { - Result result = static_cast( vkMergePipelineCaches( m_device, static_cast( dstCache ), srcCaches.size() , reinterpret_cast( srcCaches.data() ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::mergePipelineCaches" ); + Result result = static_cast( d.vkMergePipelineCaches( m_device, static_cast( dstCache ), srcCaches.size() , reinterpret_cast( srcCaches.data() ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::mergePipelineCaches" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createGraphicsPipelines( PipelineCache pipelineCache, uint32_t createInfoCount, const GraphicsPipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines ) const + template + VULKAN_HPP_INLINE Result Device::createGraphicsPipelines( PipelineCache pipelineCache, uint32_t createInfoCount, const GraphicsPipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines, Dispatch const &d) const { - return static_cast( vkCreateGraphicsPipelines( m_device, static_cast( pipelineCache ), createInfoCount, reinterpret_cast( pCreateInfos ), reinterpret_cast( pAllocator ), reinterpret_cast( pPipelines ) ) ); + 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_INLINE typename ResultValueType>::type Device::createGraphicsPipelines( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::createGraphicsPipelines( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator, Dispatch const &d ) const { std::vector pipelines( createInfos.size() ); - Result result = static_cast( vkCreateGraphicsPipelines( m_device, static_cast( pipelineCache ), createInfos.size() , reinterpret_cast( createInfos.data() ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( pipelines.data() ) ) ); - return createResultValue( result, pipelines, "VULKAN_HPP_NAMESPACE::Device::createGraphicsPipelines" ); + Result result = static_cast( d.vkCreateGraphicsPipelines( m_device, static_cast( pipelineCache ), createInfos.size() , reinterpret_cast( createInfos.data() ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( pipelines.data() ) ) ); + return createResultValue( result, pipelines, VULKAN_HPP_NAMESPACE_STRING"::Device::createGraphicsPipelines" ); } - VULKAN_HPP_INLINE ResultValueType::type Device::createGraphicsPipeline( PipelineCache pipelineCache, const GraphicsPipelineCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createGraphicsPipeline( PipelineCache pipelineCache, const GraphicsPipelineCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { Pipeline pipeline; - Result result = static_cast( vkCreateGraphicsPipelines( m_device, static_cast( pipelineCache ), 1 , reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &pipeline ) ) ); - return createResultValue( result, pipeline, "VULKAN_HPP_NAMESPACE::Device::createGraphicsPipeline" ); + Result result = static_cast( d.vkCreateGraphicsPipelines( m_device, static_cast( pipelineCache ), 1 , reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &pipeline ) ) ); + return createResultValue( result, pipeline, VULKAN_HPP_NAMESPACE_STRING"::Device::createGraphicsPipeline" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_INLINE std::vector Device::createGraphicsPipelinesUnique( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::createGraphicsPipelinesUnique( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator, Dispatch const &d ) const { - PipelineDeleter deleter( *this, allocator ); - std::vector pipelines = createGraphicsPipelines( pipelineCache, createInfos, allocator ); - std::vector uniquePipelines; - uniquePipelines.reserve( pipelines.size() ); - for ( auto pipeline : pipelines ) + static_assert( sizeof( Pipeline ) <= sizeof( UniquePipeline ), "Pipeline is greater than UniquePipeline!" ); + std::vector pipelines; + pipelines.reserve( createInfos.size() ); + Pipeline* buffer = reinterpret_cast( reinterpret_cast( pipelines.data() ) + createInfos.size() * ( sizeof( UniquePipeline ) - sizeof( Pipeline ) ) ); + Result result = static_cast(d.vkCreateGraphicsPipelines( m_device, static_cast( pipelineCache ), createInfos.size() , reinterpret_cast( createInfos.data() ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( buffer ) ) ); + + ObjectDestroy deleter( *this, allocator ); + for ( size_t i=0 ; i allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createGraphicsPipelineUnique( PipelineCache pipelineCache, const GraphicsPipelineCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - PipelineDeleter deleter( *this, allocator ); - return UniquePipeline( createGraphicsPipeline( pipelineCache, createInfo, allocator ), deleter ); + Pipeline pipeline; + Result result = static_cast( d.vkCreateGraphicsPipelines( m_device, static_cast( pipelineCache ), 1 , reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &pipeline ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, pipeline, VULKAN_HPP_NAMESPACE_STRING"::Device::createGraphicsPipelineUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createComputePipelines( PipelineCache pipelineCache, uint32_t createInfoCount, const ComputePipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines ) const + template + VULKAN_HPP_INLINE Result Device::createComputePipelines( PipelineCache pipelineCache, uint32_t createInfoCount, const ComputePipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines, Dispatch const &d) const { - return static_cast( vkCreateComputePipelines( m_device, static_cast( pipelineCache ), createInfoCount, reinterpret_cast( pCreateInfos ), reinterpret_cast( pAllocator ), reinterpret_cast( pPipelines ) ) ); + 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_INLINE typename ResultValueType>::type Device::createComputePipelines( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::createComputePipelines( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator, Dispatch const &d ) const { std::vector pipelines( createInfos.size() ); - Result result = static_cast( vkCreateComputePipelines( m_device, static_cast( pipelineCache ), createInfos.size() , reinterpret_cast( createInfos.data() ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( pipelines.data() ) ) ); - return createResultValue( result, pipelines, "VULKAN_HPP_NAMESPACE::Device::createComputePipelines" ); + Result result = static_cast( d.vkCreateComputePipelines( m_device, static_cast( pipelineCache ), createInfos.size() , reinterpret_cast( createInfos.data() ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( pipelines.data() ) ) ); + return createResultValue( result, pipelines, VULKAN_HPP_NAMESPACE_STRING"::Device::createComputePipelines" ); } - VULKAN_HPP_INLINE ResultValueType::type Device::createComputePipeline( PipelineCache pipelineCache, const ComputePipelineCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createComputePipeline( PipelineCache pipelineCache, const ComputePipelineCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { Pipeline pipeline; - Result result = static_cast( vkCreateComputePipelines( m_device, static_cast( pipelineCache ), 1 , reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &pipeline ) ) ); - return createResultValue( result, pipeline, "VULKAN_HPP_NAMESPACE::Device::createComputePipeline" ); + Result result = static_cast( d.vkCreateComputePipelines( m_device, static_cast( pipelineCache ), 1 , reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &pipeline ) ) ); + return createResultValue( result, pipeline, VULKAN_HPP_NAMESPACE_STRING"::Device::createComputePipeline" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_INLINE std::vector Device::createComputePipelinesUnique( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::createComputePipelinesUnique( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator, Dispatch const &d ) const { - PipelineDeleter deleter( *this, allocator ); - std::vector pipelines = createComputePipelines( pipelineCache, createInfos, allocator ); - std::vector uniquePipelines; - uniquePipelines.reserve( pipelines.size() ); - for ( auto pipeline : pipelines ) + static_assert( sizeof( Pipeline ) <= sizeof( UniquePipeline ), "Pipeline is greater than UniquePipeline!" ); + std::vector pipelines; + pipelines.reserve( createInfos.size() ); + Pipeline* buffer = reinterpret_cast( reinterpret_cast( pipelines.data() ) + createInfos.size() * ( sizeof( UniquePipeline ) - sizeof( Pipeline ) ) ); + Result result = static_cast(d.vkCreateComputePipelines( m_device, static_cast( pipelineCache ), createInfos.size() , reinterpret_cast( createInfos.data() ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( buffer ) ) ); + + ObjectDestroy deleter( *this, allocator ); + for ( size_t i=0 ; i allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createComputePipelineUnique( PipelineCache pipelineCache, const ComputePipelineCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - PipelineDeleter deleter( *this, allocator ); - return UniquePipeline( createComputePipeline( pipelineCache, createInfo, allocator ), deleter ); + Pipeline pipeline; + Result result = static_cast( d.vkCreateComputePipelines( m_device, static_cast( pipelineCache ), 1 , reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &pipeline ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, pipeline, VULKAN_HPP_NAMESPACE_STRING"::Device::createComputePipelineUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyPipeline( Pipeline pipeline, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyPipeline( Pipeline pipeline, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyPipeline( m_device, static_cast( pipeline ), reinterpret_cast( pAllocator ) ); + d.vkDestroyPipeline( m_device, static_cast( pipeline ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyPipeline( Pipeline pipeline, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroyPipeline( Pipeline pipeline, Optional allocator, Dispatch const &d ) const { - vkDestroyPipeline( m_device, static_cast( pipeline ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyPipeline( m_device, static_cast( pipeline ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createPipelineLayout( const PipelineLayoutCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, PipelineLayout* pPipelineLayout ) const + template + VULKAN_HPP_INLINE void Device::destroy( Pipeline pipeline, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - return static_cast( vkCreatePipelineLayout( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pPipelineLayout ) ) ); + d.vkDestroyPipeline( m_device, static_cast( pipeline ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createPipelineLayout( const PipelineLayoutCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( Pipeline pipeline, Optional allocator, Dispatch const &d ) const + { + d.vkDestroyPipeline( m_device, static_cast( pipeline ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE Result Device::createPipelineLayout( const PipelineLayoutCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, PipelineLayout* pPipelineLayout, Dispatch const &d) const + { + 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_INLINE ResultValueType::type Device::createPipelineLayout( const PipelineLayoutCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { PipelineLayout pipelineLayout; - Result result = static_cast( vkCreatePipelineLayout( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &pipelineLayout ) ) ); - return createResultValue( result, pipelineLayout, "VULKAN_HPP_NAMESPACE::Device::createPipelineLayout" ); + Result result = static_cast( d.vkCreatePipelineLayout( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &pipelineLayout ) ) ); + return createResultValue( result, pipelineLayout, VULKAN_HPP_NAMESPACE_STRING"::Device::createPipelineLayout" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniquePipelineLayout Device::createPipelineLayoutUnique( const PipelineLayoutCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createPipelineLayoutUnique( const PipelineLayoutCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - PipelineLayoutDeleter deleter( *this, allocator ); - return UniquePipelineLayout( createPipelineLayout( createInfo, allocator ), deleter ); + PipelineLayout pipelineLayout; + Result result = static_cast( d.vkCreatePipelineLayout( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &pipelineLayout ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, pipelineLayout, VULKAN_HPP_NAMESPACE_STRING"::Device::createPipelineLayoutUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyPipelineLayout( PipelineLayout pipelineLayout, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyPipelineLayout( PipelineLayout pipelineLayout, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyPipelineLayout( m_device, static_cast( pipelineLayout ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroyPipelineLayout( PipelineLayout pipelineLayout, Optional allocator, Dispatch const &d ) const + { + 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( PipelineLayout pipelineLayout, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyPipelineLayout( m_device, static_cast( pipelineLayout ), reinterpret_cast( pAllocator ) ); + d.vkDestroyPipelineLayout( m_device, static_cast( pipelineLayout ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyPipelineLayout( PipelineLayout pipelineLayout, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( PipelineLayout pipelineLayout, Optional allocator, Dispatch const &d ) const { - vkDestroyPipelineLayout( m_device, static_cast( pipelineLayout ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyPipelineLayout( m_device, static_cast( pipelineLayout ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createSampler( const SamplerCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Sampler* pSampler ) const + template + VULKAN_HPP_INLINE Result Device::createSampler( const SamplerCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Sampler* pSampler, Dispatch const &d) const { - return static_cast( vkCreateSampler( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSampler ) ) ); + return static_cast( d.vkCreateSampler( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSampler ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createSampler( const SamplerCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createSampler( const SamplerCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { Sampler sampler; - Result result = static_cast( vkCreateSampler( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &sampler ) ) ); - return createResultValue( result, sampler, "VULKAN_HPP_NAMESPACE::Device::createSampler" ); + Result result = static_cast( d.vkCreateSampler( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &sampler ) ) ); + return createResultValue( result, sampler, VULKAN_HPP_NAMESPACE_STRING"::Device::createSampler" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueSampler Device::createSamplerUnique( const SamplerCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createSamplerUnique( const SamplerCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - SamplerDeleter deleter( *this, allocator ); - return UniqueSampler( createSampler( createInfo, allocator ), deleter ); + Sampler sampler; + Result result = static_cast( d.vkCreateSampler( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &sampler ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, sampler, VULKAN_HPP_NAMESPACE_STRING"::Device::createSamplerUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroySampler( Sampler sampler, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroySampler( Sampler sampler, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroySampler( m_device, static_cast( sampler ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroySampler( Sampler sampler, Optional allocator, Dispatch const &d ) const + { + 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( Sampler sampler, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroySampler( m_device, static_cast( sampler ), reinterpret_cast( pAllocator ) ); + d.vkDestroySampler( m_device, static_cast( sampler ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroySampler( Sampler sampler, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( Sampler sampler, Optional allocator, Dispatch const &d ) const { - vkDestroySampler( m_device, static_cast( sampler ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroySampler( m_device, static_cast( sampler ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createDescriptorSetLayout( const DescriptorSetLayoutCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorSetLayout* pSetLayout ) const + template + VULKAN_HPP_INLINE Result Device::createDescriptorSetLayout( const DescriptorSetLayoutCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorSetLayout* pSetLayout, Dispatch const &d) const { - return static_cast( vkCreateDescriptorSetLayout( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSetLayout ) ) ); + return static_cast( d.vkCreateDescriptorSetLayout( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSetLayout ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createDescriptorSetLayout( const DescriptorSetLayoutCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createDescriptorSetLayout( const DescriptorSetLayoutCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { DescriptorSetLayout setLayout; - Result result = static_cast( vkCreateDescriptorSetLayout( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &setLayout ) ) ); - return createResultValue( result, setLayout, "VULKAN_HPP_NAMESPACE::Device::createDescriptorSetLayout" ); + Result result = static_cast( d.vkCreateDescriptorSetLayout( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &setLayout ) ) ); + return createResultValue( result, setLayout, VULKAN_HPP_NAMESPACE_STRING"::Device::createDescriptorSetLayout" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueDescriptorSetLayout Device::createDescriptorSetLayoutUnique( const DescriptorSetLayoutCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createDescriptorSetLayoutUnique( const DescriptorSetLayoutCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - DescriptorSetLayoutDeleter deleter( *this, allocator ); - return UniqueDescriptorSetLayout( createDescriptorSetLayout( createInfo, allocator ), deleter ); + DescriptorSetLayout setLayout; + Result result = static_cast( d.vkCreateDescriptorSetLayout( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &setLayout ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, setLayout, VULKAN_HPP_NAMESPACE_STRING"::Device::createDescriptorSetLayoutUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyDescriptorSetLayout( m_device, static_cast( descriptorSetLayout ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroyDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout, Optional allocator, Dispatch const &d ) const + { + 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( DescriptorSetLayout descriptorSetLayout, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyDescriptorSetLayout( m_device, static_cast( descriptorSetLayout ), reinterpret_cast( pAllocator ) ); + d.vkDestroyDescriptorSetLayout( m_device, static_cast( descriptorSetLayout ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( DescriptorSetLayout descriptorSetLayout, Optional allocator, Dispatch const &d ) const { - vkDestroyDescriptorSetLayout( m_device, static_cast( descriptorSetLayout ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyDescriptorSetLayout( m_device, static_cast( descriptorSetLayout ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createDescriptorPool( const DescriptorPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorPool* pDescriptorPool ) const + template + VULKAN_HPP_INLINE Result Device::createDescriptorPool( const DescriptorPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorPool* pDescriptorPool, Dispatch const &d) const { - return static_cast( vkCreateDescriptorPool( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pDescriptorPool ) ) ); + return static_cast( d.vkCreateDescriptorPool( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pDescriptorPool ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createDescriptorPool( const DescriptorPoolCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createDescriptorPool( const DescriptorPoolCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { DescriptorPool descriptorPool; - Result result = static_cast( vkCreateDescriptorPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &descriptorPool ) ) ); - return createResultValue( result, descriptorPool, "VULKAN_HPP_NAMESPACE::Device::createDescriptorPool" ); + Result result = static_cast( d.vkCreateDescriptorPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &descriptorPool ) ) ); + return createResultValue( result, descriptorPool, VULKAN_HPP_NAMESPACE_STRING"::Device::createDescriptorPool" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueDescriptorPool Device::createDescriptorPoolUnique( const DescriptorPoolCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createDescriptorPoolUnique( const DescriptorPoolCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - DescriptorPoolDeleter deleter( *this, allocator ); - return UniqueDescriptorPool( createDescriptorPool( createInfo, allocator ), deleter ); + DescriptorPool descriptorPool; + Result result = static_cast( d.vkCreateDescriptorPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &descriptorPool ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, descriptorPool, VULKAN_HPP_NAMESPACE_STRING"::Device::createDescriptorPoolUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyDescriptorPool( DescriptorPool descriptorPool, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyDescriptorPool( DescriptorPool descriptorPool, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyDescriptorPool( m_device, static_cast( descriptorPool ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroyDescriptorPool( DescriptorPool descriptorPool, Optional allocator, Dispatch const &d ) const + { + 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( DescriptorPool descriptorPool, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyDescriptorPool( m_device, static_cast( descriptorPool ), reinterpret_cast( pAllocator ) ); + d.vkDestroyDescriptorPool( m_device, static_cast( descriptorPool ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyDescriptorPool( DescriptorPool descriptorPool, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( DescriptorPool descriptorPool, Optional allocator, Dispatch const &d ) const { - vkDestroyDescriptorPool( m_device, static_cast( descriptorPool ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyDescriptorPool( m_device, static_cast( descriptorPool ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Result Device::resetDescriptorPool( DescriptorPool descriptorPool, DescriptorPoolResetFlags flags ) const + template + VULKAN_HPP_INLINE Result Device::resetDescriptorPool( DescriptorPool descriptorPool, DescriptorPoolResetFlags flags, Dispatch const &d) const { - return static_cast( vkResetDescriptorPool( m_device, static_cast( descriptorPool ), static_cast( flags ) ) ); + return static_cast( d.vkResetDescriptorPool( m_device, static_cast( descriptorPool ), static_cast( flags ) ) ); } #else - VULKAN_HPP_INLINE ResultValueType::type Device::resetDescriptorPool( DescriptorPool descriptorPool, DescriptorPoolResetFlags flags ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::resetDescriptorPool( DescriptorPool descriptorPool, DescriptorPoolResetFlags flags, Dispatch const &d ) const { - Result result = static_cast( vkResetDescriptorPool( m_device, static_cast( descriptorPool ), static_cast( flags ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::resetDescriptorPool" ); + Result result = static_cast( d.vkResetDescriptorPool( m_device, static_cast( descriptorPool ), static_cast( flags ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::resetDescriptorPool" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::allocateDescriptorSets( const DescriptorSetAllocateInfo* pAllocateInfo, DescriptorSet* pDescriptorSets ) const + template + VULKAN_HPP_INLINE Result Device::allocateDescriptorSets( const DescriptorSetAllocateInfo* pAllocateInfo, DescriptorSet* pDescriptorSets, Dispatch const &d) const { - return static_cast( vkAllocateDescriptorSets( m_device, reinterpret_cast( pAllocateInfo ), reinterpret_cast( pDescriptorSets ) ) ); + return static_cast( d.vkAllocateDescriptorSets( m_device, reinterpret_cast( pAllocateInfo ), reinterpret_cast( pDescriptorSets ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type Device::allocateDescriptorSets( const DescriptorSetAllocateInfo & allocateInfo ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::allocateDescriptorSets( const DescriptorSetAllocateInfo & allocateInfo, Dispatch const &d ) const { std::vector descriptorSets( allocateInfo.descriptorSetCount ); - Result result = static_cast( vkAllocateDescriptorSets( m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( descriptorSets.data() ) ) ); - return createResultValue( result, descriptorSets, "VULKAN_HPP_NAMESPACE::Device::allocateDescriptorSets" ); + Result result = static_cast( d.vkAllocateDescriptorSets( m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( descriptorSets.data() ) ) ); + return createResultValue( result, descriptorSets, VULKAN_HPP_NAMESPACE_STRING"::Device::allocateDescriptorSets" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_INLINE std::vector Device::allocateDescriptorSetsUnique( const DescriptorSetAllocateInfo & allocateInfo ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::allocateDescriptorSetsUnique( const DescriptorSetAllocateInfo & allocateInfo, Dispatch const &d ) const { - DescriptorSetDeleter deleter( *this, allocateInfo.descriptorPool ); - std::vector descriptorSets = allocateDescriptorSets( allocateInfo ); - std::vector uniqueDescriptorSets; - uniqueDescriptorSets.reserve( descriptorSets.size() ); - for ( auto descriptorSet : descriptorSets ) + static_assert( sizeof( DescriptorSet ) <= sizeof( UniqueDescriptorSet ), "DescriptorSet is greater than UniqueDescriptorSet!" ); + std::vector descriptorSets; + descriptorSets.reserve( allocateInfo.descriptorSetCount ); + DescriptorSet* buffer = reinterpret_cast( reinterpret_cast( descriptorSets.data() ) + allocateInfo.descriptorSetCount * ( sizeof( UniqueDescriptorSet ) - sizeof( DescriptorSet ) ) ); + Result result = static_cast(d.vkAllocateDescriptorSets( m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( buffer ) ) ); + + PoolFree deleter( *this, allocateInfo.descriptorPool ); + for ( size_t i=0 ; i + VULKAN_HPP_INLINE Result Device::freeDescriptorSets( DescriptorPool descriptorPool, uint32_t descriptorSetCount, const DescriptorSet* pDescriptorSets, Dispatch const &d) const + { + return static_cast( d.vkFreeDescriptorSets( m_device, static_cast( descriptorPool ), descriptorSetCount, reinterpret_cast( pDescriptorSets ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE ResultValueType::type Device::freeDescriptorSets( DescriptorPool descriptorPool, ArrayProxy descriptorSets, Dispatch const &d ) const + { + Result result = static_cast( d.vkFreeDescriptorSets( m_device, static_cast( descriptorPool ), descriptorSets.size() , reinterpret_cast( descriptorSets.data() ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::freeDescriptorSets" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE Result Device::free( DescriptorPool descriptorPool, uint32_t descriptorSetCount, const DescriptorSet* pDescriptorSets, Dispatch const &d) const { - return static_cast( vkFreeDescriptorSets( m_device, static_cast( descriptorPool ), descriptorSetCount, reinterpret_cast( pDescriptorSets ) ) ); + return static_cast( d.vkFreeDescriptorSets( m_device, static_cast( descriptorPool ), descriptorSetCount, reinterpret_cast( pDescriptorSets ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::freeDescriptorSets( DescriptorPool descriptorPool, ArrayProxy descriptorSets ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::free( DescriptorPool descriptorPool, ArrayProxy descriptorSets, Dispatch const &d ) const { - Result result = static_cast( vkFreeDescriptorSets( m_device, static_cast( descriptorPool ), descriptorSets.size() , reinterpret_cast( descriptorSets.data() ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::freeDescriptorSets" ); + Result result = static_cast( d.vkFreeDescriptorSets( m_device, static_cast( descriptorPool ), descriptorSets.size() , reinterpret_cast( descriptorSets.data() ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::free" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::updateDescriptorSets( uint32_t descriptorWriteCount, const WriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const CopyDescriptorSet* pDescriptorCopies ) const + template + VULKAN_HPP_INLINE void Device::updateDescriptorSets( uint32_t descriptorWriteCount, const WriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const CopyDescriptorSet* pDescriptorCopies, Dispatch const &d) const { - vkUpdateDescriptorSets( m_device, descriptorWriteCount, reinterpret_cast( pDescriptorWrites ), descriptorCopyCount, reinterpret_cast( pDescriptorCopies ) ); + d.vkUpdateDescriptorSets( m_device, descriptorWriteCount, reinterpret_cast( pDescriptorWrites ), descriptorCopyCount, reinterpret_cast( pDescriptorCopies ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::updateDescriptorSets( ArrayProxy descriptorWrites, ArrayProxy descriptorCopies ) const + template + VULKAN_HPP_INLINE void Device::updateDescriptorSets( ArrayProxy descriptorWrites, ArrayProxy descriptorCopies, Dispatch const &d ) const { - vkUpdateDescriptorSets( m_device, descriptorWrites.size() , reinterpret_cast( descriptorWrites.data() ), descriptorCopies.size() , reinterpret_cast( descriptorCopies.data() ) ); + d.vkUpdateDescriptorSets( m_device, descriptorWrites.size() , reinterpret_cast( descriptorWrites.data() ), descriptorCopies.size() , reinterpret_cast( descriptorCopies.data() ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createFramebuffer( const FramebufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Framebuffer* pFramebuffer ) const + template + VULKAN_HPP_INLINE Result Device::createFramebuffer( const FramebufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Framebuffer* pFramebuffer, Dispatch const &d) const { - return static_cast( vkCreateFramebuffer( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pFramebuffer ) ) ); + return static_cast( d.vkCreateFramebuffer( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pFramebuffer ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createFramebuffer( const FramebufferCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createFramebuffer( const FramebufferCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { Framebuffer framebuffer; - Result result = static_cast( vkCreateFramebuffer( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &framebuffer ) ) ); - return createResultValue( result, framebuffer, "VULKAN_HPP_NAMESPACE::Device::createFramebuffer" ); + Result result = static_cast( d.vkCreateFramebuffer( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &framebuffer ) ) ); + return createResultValue( result, framebuffer, VULKAN_HPP_NAMESPACE_STRING"::Device::createFramebuffer" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueFramebuffer Device::createFramebufferUnique( const FramebufferCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createFramebufferUnique( const FramebufferCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - FramebufferDeleter deleter( *this, allocator ); - return UniqueFramebuffer( createFramebuffer( createInfo, allocator ), deleter ); + Framebuffer framebuffer; + Result result = static_cast( d.vkCreateFramebuffer( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &framebuffer ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, framebuffer, VULKAN_HPP_NAMESPACE_STRING"::Device::createFramebufferUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyFramebuffer( Framebuffer framebuffer, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyFramebuffer( Framebuffer framebuffer, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyFramebuffer( m_device, static_cast( framebuffer ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroyFramebuffer( Framebuffer framebuffer, Optional allocator, Dispatch const &d ) const + { + 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( Framebuffer framebuffer, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyFramebuffer( m_device, static_cast( framebuffer ), reinterpret_cast( pAllocator ) ); + d.vkDestroyFramebuffer( m_device, static_cast( framebuffer ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyFramebuffer( Framebuffer framebuffer, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( Framebuffer framebuffer, Optional allocator, Dispatch const &d ) const { - vkDestroyFramebuffer( m_device, static_cast( framebuffer ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyFramebuffer( m_device, static_cast( framebuffer ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createRenderPass( const RenderPassCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, RenderPass* pRenderPass ) const + template + VULKAN_HPP_INLINE Result Device::createRenderPass( const RenderPassCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, RenderPass* pRenderPass, Dispatch const &d) const { - return static_cast( vkCreateRenderPass( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pRenderPass ) ) ); + return static_cast( d.vkCreateRenderPass( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pRenderPass ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createRenderPass( const RenderPassCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createRenderPass( const RenderPassCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { RenderPass renderPass; - Result result = static_cast( vkCreateRenderPass( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &renderPass ) ) ); - return createResultValue( result, renderPass, "VULKAN_HPP_NAMESPACE::Device::createRenderPass" ); + Result result = static_cast( d.vkCreateRenderPass( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &renderPass ) ) ); + return createResultValue( result, renderPass, VULKAN_HPP_NAMESPACE_STRING"::Device::createRenderPass" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueRenderPass Device::createRenderPassUnique( const RenderPassCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createRenderPassUnique( const RenderPassCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - RenderPassDeleter deleter( *this, allocator ); - return UniqueRenderPass( createRenderPass( createInfo, allocator ), deleter ); + RenderPass renderPass; + Result result = static_cast( d.vkCreateRenderPass( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &renderPass ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, renderPass, VULKAN_HPP_NAMESPACE_STRING"::Device::createRenderPassUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyRenderPass( RenderPass renderPass, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyRenderPass( RenderPass renderPass, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyRenderPass( m_device, static_cast( renderPass ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroyRenderPass( RenderPass renderPass, Optional allocator, Dispatch const &d ) const + { + 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( RenderPass renderPass, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyRenderPass( m_device, static_cast( renderPass ), reinterpret_cast( pAllocator ) ); + d.vkDestroyRenderPass( m_device, static_cast( renderPass ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyRenderPass( RenderPass renderPass, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( RenderPass renderPass, Optional allocator, Dispatch const &d ) const { - vkDestroyRenderPass( m_device, static_cast( renderPass ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyRenderPass( m_device, static_cast( renderPass ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::getRenderAreaGranularity( RenderPass renderPass, Extent2D* pGranularity ) const + template + VULKAN_HPP_INLINE void Device::getRenderAreaGranularity( RenderPass renderPass, Extent2D* pGranularity, Dispatch const &d) const { - vkGetRenderAreaGranularity( m_device, static_cast( renderPass ), reinterpret_cast( pGranularity ) ); + d.vkGetRenderAreaGranularity( m_device, static_cast( renderPass ), reinterpret_cast( pGranularity ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Extent2D Device::getRenderAreaGranularity( RenderPass renderPass ) const + template + VULKAN_HPP_INLINE Extent2D Device::getRenderAreaGranularity( RenderPass renderPass, Dispatch const &d ) const { Extent2D granularity; - vkGetRenderAreaGranularity( m_device, static_cast( renderPass ), reinterpret_cast( &granularity ) ); + d.vkGetRenderAreaGranularity( m_device, static_cast( renderPass ), reinterpret_cast( &granularity ) ); return granularity; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createCommandPool( const CommandPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, CommandPool* pCommandPool ) const + template + VULKAN_HPP_INLINE Result Device::createCommandPool( const CommandPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, CommandPool* pCommandPool, Dispatch const &d) const { - return static_cast( vkCreateCommandPool( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pCommandPool ) ) ); + return static_cast( d.vkCreateCommandPool( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pCommandPool ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createCommandPool( const CommandPoolCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createCommandPool( const CommandPoolCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const + { + CommandPool commandPool; + Result result = static_cast( d.vkCreateCommandPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &commandPool ) ) ); + return createResultValue( result, commandPool, VULKAN_HPP_NAMESPACE_STRING"::Device::createCommandPool" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + VULKAN_HPP_INLINE ResultValueType::type Device::createCommandPoolUnique( const CommandPoolCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { CommandPool commandPool; - Result result = static_cast( vkCreateCommandPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &commandPool ) ) ); - return createResultValue( result, commandPool, "VULKAN_HPP_NAMESPACE::Device::createCommandPool" ); + Result result = static_cast( d.vkCreateCommandPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &commandPool ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, commandPool, VULKAN_HPP_NAMESPACE_STRING"::Device::createCommandPoolUnique", deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE void Device::destroyCommandPool( CommandPool commandPool, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyCommandPool( m_device, static_cast( commandPool ), reinterpret_cast( pAllocator ) ); } -#ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueCommandPool Device::createCommandPoolUnique( const CommandPoolCreateInfo & createInfo, Optional allocator ) const +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroyCommandPool( CommandPool commandPool, Optional allocator, Dispatch const &d ) const { - CommandPoolDeleter deleter( *this, allocator ); - return UniqueCommandPool( createCommandPool( createInfo, allocator ), deleter ); + d.vkDestroyCommandPool( m_device, static_cast( commandPool ), reinterpret_cast( static_cast( allocator ) ) ); } -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyCommandPool( CommandPool commandPool, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( CommandPool commandPool, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyCommandPool( m_device, static_cast( commandPool ), reinterpret_cast( pAllocator ) ); + d.vkDestroyCommandPool( m_device, static_cast( commandPool ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyCommandPool( CommandPool commandPool, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( CommandPool commandPool, Optional allocator, Dispatch const &d ) const { - vkDestroyCommandPool( m_device, static_cast( commandPool ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyCommandPool( m_device, static_cast( commandPool ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Result Device::resetCommandPool( CommandPool commandPool, CommandPoolResetFlags flags ) const + template + VULKAN_HPP_INLINE Result Device::resetCommandPool( CommandPool commandPool, CommandPoolResetFlags flags, Dispatch const &d) const { - return static_cast( vkResetCommandPool( m_device, static_cast( commandPool ), static_cast( flags ) ) ); + return static_cast( d.vkResetCommandPool( m_device, static_cast( commandPool ), static_cast( flags ) ) ); } #else - VULKAN_HPP_INLINE ResultValueType::type Device::resetCommandPool( CommandPool commandPool, CommandPoolResetFlags flags ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::resetCommandPool( CommandPool commandPool, CommandPoolResetFlags flags, Dispatch const &d ) const { - Result result = static_cast( vkResetCommandPool( m_device, static_cast( commandPool ), static_cast( flags ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::resetCommandPool" ); + Result result = static_cast( d.vkResetCommandPool( m_device, static_cast( commandPool ), static_cast( flags ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::resetCommandPool" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::allocateCommandBuffers( const CommandBufferAllocateInfo* pAllocateInfo, CommandBuffer* pCommandBuffers ) const + template + VULKAN_HPP_INLINE Result Device::allocateCommandBuffers( const CommandBufferAllocateInfo* pAllocateInfo, CommandBuffer* pCommandBuffers, Dispatch const &d) const { - return static_cast( vkAllocateCommandBuffers( m_device, reinterpret_cast( pAllocateInfo ), reinterpret_cast( pCommandBuffers ) ) ); + return static_cast( d.vkAllocateCommandBuffers( m_device, reinterpret_cast( pAllocateInfo ), reinterpret_cast( pCommandBuffers ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type Device::allocateCommandBuffers( const CommandBufferAllocateInfo & allocateInfo ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::allocateCommandBuffers( const CommandBufferAllocateInfo & allocateInfo, Dispatch const &d ) const { std::vector commandBuffers( allocateInfo.commandBufferCount ); - Result result = static_cast( vkAllocateCommandBuffers( m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( commandBuffers.data() ) ) ); - return createResultValue( result, commandBuffers, "VULKAN_HPP_NAMESPACE::Device::allocateCommandBuffers" ); + Result result = static_cast( d.vkAllocateCommandBuffers( m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( commandBuffers.data() ) ) ); + return createResultValue( result, commandBuffers, VULKAN_HPP_NAMESPACE_STRING"::Device::allocateCommandBuffers" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_INLINE std::vector Device::allocateCommandBuffersUnique( const CommandBufferAllocateInfo & allocateInfo ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::allocateCommandBuffersUnique( const CommandBufferAllocateInfo & allocateInfo, Dispatch const &d ) const { - CommandBufferDeleter deleter( *this, allocateInfo.commandPool ); - std::vector commandBuffers = allocateCommandBuffers( allocateInfo ); - std::vector uniqueCommandBuffers; - uniqueCommandBuffers.reserve( commandBuffers.size() ); - for ( auto commandBuffer : commandBuffers ) + static_assert( sizeof( CommandBuffer ) <= sizeof( UniqueCommandBuffer ), "CommandBuffer is greater than UniqueCommandBuffer!" ); + std::vector commandBuffers; + commandBuffers.reserve( allocateInfo.commandBufferCount ); + CommandBuffer* buffer = reinterpret_cast( reinterpret_cast( commandBuffers.data() ) + allocateInfo.commandBufferCount * ( sizeof( UniqueCommandBuffer ) - sizeof( CommandBuffer ) ) ); + Result result = static_cast(d.vkAllocateCommandBuffers( m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( buffer ) ) ); + + PoolFree deleter( *this, allocateInfo.commandPool ); + for ( size_t i=0 ; i + VULKAN_HPP_INLINE void Device::freeCommandBuffers( CommandPool commandPool, uint32_t commandBufferCount, const CommandBuffer* pCommandBuffers, Dispatch const &d) const + { + d.vkFreeCommandBuffers( m_device, static_cast( commandPool ), commandBufferCount, reinterpret_cast( pCommandBuffers ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::freeCommandBuffers( CommandPool commandPool, ArrayProxy commandBuffers, Dispatch const &d ) const + { + 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( CommandPool commandPool, uint32_t commandBufferCount, const CommandBuffer* pCommandBuffers, Dispatch const &d) const { - vkFreeCommandBuffers( m_device, static_cast( commandPool ), commandBufferCount, reinterpret_cast( pCommandBuffers ) ); + d.vkFreeCommandBuffers( m_device, static_cast( commandPool ), commandBufferCount, reinterpret_cast( pCommandBuffers ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::freeCommandBuffers( CommandPool commandPool, ArrayProxy commandBuffers ) const + template + VULKAN_HPP_INLINE void Device::free( CommandPool commandPool, ArrayProxy commandBuffers, Dispatch const &d ) const { - vkFreeCommandBuffers( m_device, static_cast( commandPool ), commandBuffers.size() , reinterpret_cast( commandBuffers.data() ) ); + d.vkFreeCommandBuffers( m_device, static_cast( commandPool ), commandBuffers.size() , reinterpret_cast( commandBuffers.data() ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createSharedSwapchainsKHR( uint32_t swapchainCount, const SwapchainCreateInfoKHR* pCreateInfos, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchains ) const + template + VULKAN_HPP_INLINE Result Device::createSharedSwapchainsKHR( uint32_t swapchainCount, const SwapchainCreateInfoKHR* pCreateInfos, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchains, Dispatch const &d) const { - return static_cast( vkCreateSharedSwapchainsKHR( m_device, swapchainCount, reinterpret_cast( pCreateInfos ), reinterpret_cast( pAllocator ), reinterpret_cast( pSwapchains ) ) ); + 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_INLINE typename ResultValueType>::type Device::createSharedSwapchainsKHR( ArrayProxy createInfos, Optional allocator ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::createSharedSwapchainsKHR( ArrayProxy createInfos, Optional allocator, Dispatch const &d ) const { std::vector swapchains( createInfos.size() ); - Result result = static_cast( vkCreateSharedSwapchainsKHR( m_device, createInfos.size() , reinterpret_cast( createInfos.data() ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( swapchains.data() ) ) ); - return createResultValue( result, swapchains, "VULKAN_HPP_NAMESPACE::Device::createSharedSwapchainsKHR" ); + Result result = static_cast( d.vkCreateSharedSwapchainsKHR( m_device, createInfos.size() , reinterpret_cast( createInfos.data() ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( swapchains.data() ) ) ); + return createResultValue( result, swapchains, VULKAN_HPP_NAMESPACE_STRING"::Device::createSharedSwapchainsKHR" ); } - VULKAN_HPP_INLINE ResultValueType::type Device::createSharedSwapchainKHR( const SwapchainCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createSharedSwapchainKHR( const SwapchainCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { SwapchainKHR swapchain; - Result result = static_cast( vkCreateSharedSwapchainsKHR( m_device, 1 , reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &swapchain ) ) ); - return createResultValue( result, swapchain, "VULKAN_HPP_NAMESPACE::Device::createSharedSwapchainKHR" ); + Result result = static_cast( d.vkCreateSharedSwapchainsKHR( m_device, 1 , reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &swapchain ) ) ); + return createResultValue( result, swapchain, VULKAN_HPP_NAMESPACE_STRING"::Device::createSharedSwapchainKHR" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_INLINE std::vector Device::createSharedSwapchainsKHRUnique( ArrayProxy createInfos, Optional allocator ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::createSharedSwapchainsKHRUnique( ArrayProxy createInfos, Optional allocator, Dispatch const &d ) const { - SwapchainKHRDeleter deleter( *this, allocator ); - std::vector swapchainKHRs = createSharedSwapchainsKHR( createInfos, allocator ); - std::vector uniqueSwapchainKHRs; - uniqueSwapchainKHRs.reserve( swapchainKHRs.size() ); - for ( auto swapchainKHR : swapchainKHRs ) + static_assert( sizeof( SwapchainKHR ) <= sizeof( UniqueSwapchainKHR ), "SwapchainKHR is greater than UniqueSwapchainKHR!" ); + std::vector swapchainKHRs; + swapchainKHRs.reserve( createInfos.size() ); + SwapchainKHR* buffer = reinterpret_cast( reinterpret_cast( swapchainKHRs.data() ) + createInfos.size() * ( sizeof( UniqueSwapchainKHR ) - sizeof( SwapchainKHR ) ) ); + Result result = static_cast(d.vkCreateSharedSwapchainsKHR( m_device, createInfos.size() , reinterpret_cast( createInfos.data() ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( buffer ) ) ); + + ObjectDestroy deleter( *this, allocator ); + for ( size_t i=0 ; i allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createSharedSwapchainKHRUnique( const SwapchainCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { - SwapchainKHRDeleter deleter( *this, allocator ); - return UniqueSwapchainKHR( createSharedSwapchainKHR( createInfo, allocator ), deleter ); + SwapchainKHR swapchain; + Result result = static_cast( d.vkCreateSharedSwapchainsKHR( m_device, 1 , reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &swapchain ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, swapchain, VULKAN_HPP_NAMESPACE_STRING"::Device::createSharedSwapchainKHRUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createSwapchainKHR( const SwapchainCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchain ) const + template + VULKAN_HPP_INLINE Result Device::createSwapchainKHR( const SwapchainCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchain, Dispatch const &d) const { - return static_cast( vkCreateSwapchainKHR( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSwapchain ) ) ); + return static_cast( d.vkCreateSwapchainKHR( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSwapchain ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createSwapchainKHR( const SwapchainCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createSwapchainKHR( const SwapchainCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { SwapchainKHR swapchain; - Result result = static_cast( vkCreateSwapchainKHR( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &swapchain ) ) ); - return createResultValue( result, swapchain, "VULKAN_HPP_NAMESPACE::Device::createSwapchainKHR" ); + Result result = static_cast( d.vkCreateSwapchainKHR( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &swapchain ) ) ); + return createResultValue( result, swapchain, VULKAN_HPP_NAMESPACE_STRING"::Device::createSwapchainKHR" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueSwapchainKHR Device::createSwapchainKHRUnique( const SwapchainCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createSwapchainKHRUnique( const SwapchainCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { - SwapchainKHRDeleter deleter( *this, allocator ); - return UniqueSwapchainKHR( createSwapchainKHR( createInfo, allocator ), deleter ); + SwapchainKHR swapchain; + Result result = static_cast( d.vkCreateSwapchainKHR( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &swapchain ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, swapchain, VULKAN_HPP_NAMESPACE_STRING"::Device::createSwapchainKHRUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroySwapchainKHR( SwapchainKHR swapchain, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroySwapchainKHR( SwapchainKHR swapchain, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroySwapchainKHR( m_device, static_cast( swapchain ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroySwapchainKHR( SwapchainKHR swapchain, Optional allocator, Dispatch const &d ) const + { + 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( SwapchainKHR swapchain, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroySwapchainKHR( m_device, static_cast( swapchain ), reinterpret_cast( pAllocator ) ); + d.vkDestroySwapchainKHR( m_device, static_cast( swapchain ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroySwapchainKHR( SwapchainKHR swapchain, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( SwapchainKHR swapchain, Optional allocator, Dispatch const &d ) const { - vkDestroySwapchainKHR( m_device, static_cast( swapchain ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroySwapchainKHR( m_device, static_cast( swapchain ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::getSwapchainImagesKHR( SwapchainKHR swapchain, uint32_t* pSwapchainImageCount, Image* pSwapchainImages ) const + template + VULKAN_HPP_INLINE Result Device::getSwapchainImagesKHR( SwapchainKHR swapchain, uint32_t* pSwapchainImageCount, Image* pSwapchainImages, Dispatch const &d) const { - return static_cast( vkGetSwapchainImagesKHR( m_device, static_cast( swapchain ), pSwapchainImageCount, reinterpret_cast( pSwapchainImages ) ) ); + return static_cast( d.vkGetSwapchainImagesKHR( m_device, static_cast( swapchain ), pSwapchainImageCount, reinterpret_cast( pSwapchainImages ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type Device::getSwapchainImagesKHR( SwapchainKHR swapchain ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::getSwapchainImagesKHR( SwapchainKHR swapchain, Dispatch const &d ) const { std::vector swapchainImages; uint32_t swapchainImageCount; Result result; do { - result = static_cast( vkGetSwapchainImagesKHR( m_device, static_cast( swapchain ), &swapchainImageCount, nullptr ) ); + result = static_cast( d.vkGetSwapchainImagesKHR( m_device, static_cast( swapchain ), &swapchainImageCount, nullptr ) ); if ( ( result == Result::eSuccess ) && swapchainImageCount ) { swapchainImages.resize( swapchainImageCount ); - result = static_cast( vkGetSwapchainImagesKHR( m_device, static_cast( swapchain ), &swapchainImageCount, reinterpret_cast( swapchainImages.data() ) ) ); + result = static_cast( d.vkGetSwapchainImagesKHR( m_device, static_cast( swapchain ), &swapchainImageCount, reinterpret_cast( swapchainImages.data() ) ) ); } } while ( result == Result::eIncomplete ); - assert( swapchainImageCount <= swapchainImages.size() ); + VULKAN_HPP_ASSERT( swapchainImageCount <= swapchainImages.size() ); swapchainImages.resize( swapchainImageCount ); - return createResultValue( result, swapchainImages, "VULKAN_HPP_NAMESPACE::Device::getSwapchainImagesKHR" ); + return createResultValue( result, swapchainImages, VULKAN_HPP_NAMESPACE_STRING"::Device::getSwapchainImagesKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::acquireNextImageKHR( SwapchainKHR swapchain, uint64_t timeout, Semaphore semaphore, Fence fence, uint32_t* pImageIndex ) const + template + VULKAN_HPP_INLINE Result Device::acquireNextImageKHR( SwapchainKHR swapchain, uint64_t timeout, Semaphore semaphore, Fence fence, uint32_t* pImageIndex, Dispatch const &d) const { - return static_cast( vkAcquireNextImageKHR( m_device, static_cast( swapchain ), timeout, static_cast( semaphore ), static_cast( fence ), pImageIndex ) ); + return static_cast( d.vkAcquireNextImageKHR( m_device, static_cast( swapchain ), timeout, static_cast( semaphore ), static_cast( fence ), pImageIndex ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValue Device::acquireNextImageKHR( SwapchainKHR swapchain, uint64_t timeout, Semaphore semaphore, Fence fence ) const + template + VULKAN_HPP_INLINE ResultValue Device::acquireNextImageKHR( SwapchainKHR swapchain, uint64_t timeout, Semaphore semaphore, Fence fence, Dispatch const &d ) const { uint32_t imageIndex; - Result result = static_cast( vkAcquireNextImageKHR( m_device, static_cast( swapchain ), timeout, static_cast( semaphore ), static_cast( fence ), &imageIndex ) ); - return createResultValue( result, imageIndex, "VULKAN_HPP_NAMESPACE::Device::acquireNextImageKHR", { Result::eSuccess, Result::eTimeout, Result::eNotReady, Result::eSuboptimalKHR } ); + Result result = static_cast( d.vkAcquireNextImageKHR( m_device, static_cast( swapchain ), timeout, static_cast( semaphore ), static_cast( fence ), &imageIndex ) ); + return createResultValue( result, imageIndex, VULKAN_HPP_NAMESPACE_STRING"::Device::acquireNextImageKHR", { Result::eSuccess, Result::eTimeout, Result::eNotReady, Result::eSuboptimalKHR } ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::debugMarkerSetObjectNameEXT( const DebugMarkerObjectNameInfoEXT* pNameInfo ) const + template + VULKAN_HPP_INLINE Result Device::debugMarkerSetObjectNameEXT( const DebugMarkerObjectNameInfoEXT* pNameInfo, Dispatch const &d) const { - return static_cast( vkDebugMarkerSetObjectNameEXT( m_device, reinterpret_cast( pNameInfo ) ) ); + return static_cast( d.vkDebugMarkerSetObjectNameEXT( m_device, reinterpret_cast( pNameInfo ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::debugMarkerSetObjectNameEXT( const DebugMarkerObjectNameInfoEXT & nameInfo ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::debugMarkerSetObjectNameEXT( const DebugMarkerObjectNameInfoEXT & nameInfo, Dispatch const &d ) const { - Result result = static_cast( vkDebugMarkerSetObjectNameEXT( m_device, reinterpret_cast( &nameInfo ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::debugMarkerSetObjectNameEXT" ); + Result result = static_cast( d.vkDebugMarkerSetObjectNameEXT( m_device, reinterpret_cast( &nameInfo ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::debugMarkerSetObjectNameEXT" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::debugMarkerSetObjectTagEXT( const DebugMarkerObjectTagInfoEXT* pTagInfo ) const + template + VULKAN_HPP_INLINE Result Device::debugMarkerSetObjectTagEXT( const DebugMarkerObjectTagInfoEXT* pTagInfo, Dispatch const &d) const { - return static_cast( vkDebugMarkerSetObjectTagEXT( m_device, reinterpret_cast( pTagInfo ) ) ); + return static_cast( d.vkDebugMarkerSetObjectTagEXT( m_device, reinterpret_cast( pTagInfo ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::debugMarkerSetObjectTagEXT( const DebugMarkerObjectTagInfoEXT & tagInfo ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::debugMarkerSetObjectTagEXT( const DebugMarkerObjectTagInfoEXT & tagInfo, Dispatch const &d ) const { - Result result = static_cast( vkDebugMarkerSetObjectTagEXT( m_device, reinterpret_cast( &tagInfo ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::debugMarkerSetObjectTagEXT" ); + Result result = static_cast( d.vkDebugMarkerSetObjectTagEXT( m_device, reinterpret_cast( &tagInfo ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::debugMarkerSetObjectTagEXT" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VK_USE_PLATFORM_WIN32_KHR - VULKAN_HPP_INLINE Result Device::getMemoryWin32HandleNV( DeviceMemory memory, ExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle ) const +#ifdef VK_USE_PLATFORM_WIN32_NV + template + VULKAN_HPP_INLINE Result Device::getMemoryWin32HandleNV( DeviceMemory memory, ExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle, Dispatch const &d) const { - return static_cast( vkGetMemoryWin32HandleNV( m_device, static_cast( memory ), static_cast( handleType ), pHandle ) ); + return static_cast( d.vkGetMemoryWin32HandleNV( m_device, static_cast( memory ), static_cast( handleType ), pHandle ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::getMemoryWin32HandleNV( DeviceMemory memory, ExternalMemoryHandleTypeFlagsNV handleType ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::getMemoryWin32HandleNV( DeviceMemory memory, ExternalMemoryHandleTypeFlagsNV handleType, Dispatch const &d ) const { HANDLE handle; - Result result = static_cast( vkGetMemoryWin32HandleNV( m_device, static_cast( memory ), static_cast( handleType ), &handle ) ); - return createResultValue( result, handle, "VULKAN_HPP_NAMESPACE::Device::getMemoryWin32HandleNV" ); + Result result = static_cast( d.vkGetMemoryWin32HandleNV( m_device, static_cast( memory ), static_cast( handleType ), &handle ) ); + return createResultValue( result, handle, VULKAN_HPP_NAMESPACE_STRING"::Device::getMemoryWin32HandleNV" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ +#endif /*VK_USE_PLATFORM_WIN32_NV*/ - VULKAN_HPP_INLINE Result Device::createIndirectCommandsLayoutNVX( const IndirectCommandsLayoutCreateInfoNVX* pCreateInfo, const AllocationCallbacks* pAllocator, IndirectCommandsLayoutNVX* pIndirectCommandsLayout ) const + template + VULKAN_HPP_INLINE Result Device::createIndirectCommandsLayoutNVX( const IndirectCommandsLayoutCreateInfoNVX* pCreateInfo, const AllocationCallbacks* pAllocator, IndirectCommandsLayoutNVX* pIndirectCommandsLayout, Dispatch const &d) const { - return static_cast( vkCreateIndirectCommandsLayoutNVX( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pIndirectCommandsLayout ) ) ); + return static_cast( d.vkCreateIndirectCommandsLayoutNVX( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pIndirectCommandsLayout ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createIndirectCommandsLayoutNVX( const IndirectCommandsLayoutCreateInfoNVX & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createIndirectCommandsLayoutNVX( const IndirectCommandsLayoutCreateInfoNVX & createInfo, Optional allocator, Dispatch const &d ) const { IndirectCommandsLayoutNVX indirectCommandsLayout; - Result result = static_cast( vkCreateIndirectCommandsLayoutNVX( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &indirectCommandsLayout ) ) ); - return createResultValue( result, indirectCommandsLayout, "VULKAN_HPP_NAMESPACE::Device::createIndirectCommandsLayoutNVX" ); + Result result = static_cast( d.vkCreateIndirectCommandsLayoutNVX( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &indirectCommandsLayout ) ) ); + return createResultValue( result, indirectCommandsLayout, VULKAN_HPP_NAMESPACE_STRING"::Device::createIndirectCommandsLayoutNVX" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueIndirectCommandsLayoutNVX Device::createIndirectCommandsLayoutNVXUnique( const IndirectCommandsLayoutCreateInfoNVX & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createIndirectCommandsLayoutNVXUnique( const IndirectCommandsLayoutCreateInfoNVX & createInfo, Optional allocator, Dispatch const &d ) const { - IndirectCommandsLayoutNVXDeleter deleter( *this, allocator ); - return UniqueIndirectCommandsLayoutNVX( createIndirectCommandsLayoutNVX( createInfo, allocator ), deleter ); + IndirectCommandsLayoutNVX indirectCommandsLayout; + Result result = static_cast( d.vkCreateIndirectCommandsLayoutNVX( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &indirectCommandsLayout ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, indirectCommandsLayout, VULKAN_HPP_NAMESPACE_STRING"::Device::createIndirectCommandsLayoutNVXUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyIndirectCommandsLayoutNVX( IndirectCommandsLayoutNVX indirectCommandsLayout, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyIndirectCommandsLayoutNVX( IndirectCommandsLayoutNVX indirectCommandsLayout, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyIndirectCommandsLayoutNVX( m_device, static_cast( indirectCommandsLayout ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroyIndirectCommandsLayoutNVX( IndirectCommandsLayoutNVX indirectCommandsLayout, Optional allocator, Dispatch const &d ) const + { + d.vkDestroyIndirectCommandsLayoutNVX( m_device, static_cast( indirectCommandsLayout ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE void Device::destroy( IndirectCommandsLayoutNVX indirectCommandsLayout, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyIndirectCommandsLayoutNVX( m_device, static_cast( indirectCommandsLayout ), reinterpret_cast( pAllocator ) ); + d.vkDestroyIndirectCommandsLayoutNVX( m_device, static_cast( indirectCommandsLayout ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyIndirectCommandsLayoutNVX( IndirectCommandsLayoutNVX indirectCommandsLayout, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( IndirectCommandsLayoutNVX indirectCommandsLayout, Optional allocator, Dispatch const &d ) const { - vkDestroyIndirectCommandsLayoutNVX( m_device, static_cast( indirectCommandsLayout ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyIndirectCommandsLayoutNVX( m_device, static_cast( indirectCommandsLayout ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createObjectTableNVX( const ObjectTableCreateInfoNVX* pCreateInfo, const AllocationCallbacks* pAllocator, ObjectTableNVX* pObjectTable ) const + template + VULKAN_HPP_INLINE Result Device::createObjectTableNVX( const ObjectTableCreateInfoNVX* pCreateInfo, const AllocationCallbacks* pAllocator, ObjectTableNVX* pObjectTable, Dispatch const &d) const { - return static_cast( vkCreateObjectTableNVX( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pObjectTable ) ) ); + return static_cast( d.vkCreateObjectTableNVX( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pObjectTable ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createObjectTableNVX( const ObjectTableCreateInfoNVX & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createObjectTableNVX( const ObjectTableCreateInfoNVX & createInfo, Optional allocator, Dispatch const &d ) const { ObjectTableNVX objectTable; - Result result = static_cast( vkCreateObjectTableNVX( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &objectTable ) ) ); - return createResultValue( result, objectTable, "VULKAN_HPP_NAMESPACE::Device::createObjectTableNVX" ); + Result result = static_cast( d.vkCreateObjectTableNVX( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &objectTable ) ) ); + return createResultValue( result, objectTable, VULKAN_HPP_NAMESPACE_STRING"::Device::createObjectTableNVX" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueObjectTableNVX Device::createObjectTableNVXUnique( const ObjectTableCreateInfoNVX & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createObjectTableNVXUnique( const ObjectTableCreateInfoNVX & createInfo, Optional allocator, Dispatch const &d ) const { - ObjectTableNVXDeleter deleter( *this, allocator ); - return UniqueObjectTableNVX( createObjectTableNVX( createInfo, allocator ), deleter ); + ObjectTableNVX objectTable; + Result result = static_cast( d.vkCreateObjectTableNVX( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &objectTable ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, objectTable, VULKAN_HPP_NAMESPACE_STRING"::Device::createObjectTableNVXUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyObjectTableNVX( ObjectTableNVX objectTable, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyObjectTableNVX( ObjectTableNVX objectTable, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyObjectTableNVX( m_device, static_cast( objectTable ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroyObjectTableNVX( ObjectTableNVX objectTable, Optional allocator, Dispatch const &d ) const + { + d.vkDestroyObjectTableNVX( m_device, static_cast( objectTable ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE void Device::destroy( ObjectTableNVX objectTable, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyObjectTableNVX( m_device, static_cast( objectTable ), reinterpret_cast( pAllocator ) ); + d.vkDestroyObjectTableNVX( m_device, static_cast( objectTable ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyObjectTableNVX( ObjectTableNVX objectTable, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( ObjectTableNVX objectTable, Optional allocator, Dispatch const &d ) const { - vkDestroyObjectTableNVX( m_device, static_cast( objectTable ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyObjectTableNVX( m_device, static_cast( objectTable ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::registerObjectsNVX( ObjectTableNVX objectTable, uint32_t objectCount, const ObjectTableEntryNVX* const* ppObjectTableEntries, const uint32_t* pObjectIndices ) const + template + VULKAN_HPP_INLINE Result Device::registerObjectsNVX( ObjectTableNVX objectTable, uint32_t objectCount, const ObjectTableEntryNVX* const* ppObjectTableEntries, const uint32_t* pObjectIndices, Dispatch const &d) const { - return static_cast( vkRegisterObjectsNVX( m_device, static_cast( objectTable ), objectCount, reinterpret_cast( ppObjectTableEntries ), pObjectIndices ) ); + return static_cast( d.vkRegisterObjectsNVX( m_device, static_cast( objectTable ), objectCount, reinterpret_cast( ppObjectTableEntries ), pObjectIndices ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::registerObjectsNVX( ObjectTableNVX objectTable, ArrayProxy pObjectTableEntries, ArrayProxy objectIndices ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::registerObjectsNVX( ObjectTableNVX objectTable, ArrayProxy pObjectTableEntries, ArrayProxy objectIndices, Dispatch const &d ) const { #ifdef VULKAN_HPP_NO_EXCEPTIONS - assert( pObjectTableEntries.size() == objectIndices.size() ); + VULKAN_HPP_ASSERT( pObjectTableEntries.size() == objectIndices.size() ); #else if ( pObjectTableEntries.size() != objectIndices.size() ) { - throw LogicError( "VULKAN_HPP_NAMESPACE::Device::registerObjectsNVX: pObjectTableEntries.size() != objectIndices.size()" ); + throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::Device::registerObjectsNVX: pObjectTableEntries.size() != objectIndices.size()" ); } #endif // VULKAN_HPP_NO_EXCEPTIONS - Result result = static_cast( vkRegisterObjectsNVX( m_device, static_cast( objectTable ), pObjectTableEntries.size() , reinterpret_cast( pObjectTableEntries.data() ), objectIndices.data() ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::registerObjectsNVX" ); + Result result = static_cast( d.vkRegisterObjectsNVX( m_device, static_cast( objectTable ), pObjectTableEntries.size() , reinterpret_cast( pObjectTableEntries.data() ), objectIndices.data() ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::registerObjectsNVX" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::unregisterObjectsNVX( ObjectTableNVX objectTable, uint32_t objectCount, const ObjectEntryTypeNVX* pObjectEntryTypes, const uint32_t* pObjectIndices ) const + template + VULKAN_HPP_INLINE Result Device::unregisterObjectsNVX( ObjectTableNVX objectTable, uint32_t objectCount, const ObjectEntryTypeNVX* pObjectEntryTypes, const uint32_t* pObjectIndices, Dispatch const &d) const { - return static_cast( vkUnregisterObjectsNVX( m_device, static_cast( objectTable ), objectCount, reinterpret_cast( pObjectEntryTypes ), pObjectIndices ) ); + return static_cast( d.vkUnregisterObjectsNVX( m_device, static_cast( objectTable ), objectCount, reinterpret_cast( pObjectEntryTypes ), pObjectIndices ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::unregisterObjectsNVX( ObjectTableNVX objectTable, ArrayProxy objectEntryTypes, ArrayProxy objectIndices ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::unregisterObjectsNVX( ObjectTableNVX objectTable, ArrayProxy objectEntryTypes, ArrayProxy objectIndices, Dispatch const &d ) const { #ifdef VULKAN_HPP_NO_EXCEPTIONS - assert( objectEntryTypes.size() == objectIndices.size() ); + VULKAN_HPP_ASSERT( objectEntryTypes.size() == objectIndices.size() ); #else if ( objectEntryTypes.size() != objectIndices.size() ) { - throw LogicError( "VULKAN_HPP_NAMESPACE::Device::unregisterObjectsNVX: objectEntryTypes.size() != objectIndices.size()" ); + throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::Device::unregisterObjectsNVX: objectEntryTypes.size() != objectIndices.size()" ); } #endif // VULKAN_HPP_NO_EXCEPTIONS - Result result = static_cast( vkUnregisterObjectsNVX( m_device, static_cast( objectTable ), objectEntryTypes.size() , reinterpret_cast( objectEntryTypes.data() ), objectIndices.data() ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::unregisterObjectsNVX" ); + Result result = static_cast( d.vkUnregisterObjectsNVX( m_device, static_cast( objectTable ), objectEntryTypes.size() , reinterpret_cast( objectEntryTypes.data() ), objectIndices.data() ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::unregisterObjectsNVX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::trimCommandPool( CommandPool commandPool, CommandPoolTrimFlags flags, Dispatch const &d) const + { + d.vkTrimCommandPool( m_device, static_cast( commandPool ), static_cast( flags ) ); + } +#else + template + VULKAN_HPP_INLINE void Device::trimCommandPool( CommandPool commandPool, CommandPoolTrimFlags flags, Dispatch const &d ) const + { + d.vkTrimCommandPool( m_device, static_cast( commandPool ), static_cast( flags ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::trimCommandPoolKHR( CommandPool commandPool, CommandPoolTrimFlagsKHR flags ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::trimCommandPoolKHR( CommandPool commandPool, CommandPoolTrimFlags flags, Dispatch const &d) const + { + d.vkTrimCommandPoolKHR( m_device, static_cast( commandPool ), static_cast( flags ) ); + } +#else + template + VULKAN_HPP_INLINE void Device::trimCommandPoolKHR( CommandPool commandPool, CommandPoolTrimFlags flags, Dispatch const &d ) const { - vkTrimCommandPoolKHR( m_device, static_cast( commandPool ), static_cast( flags ) ); + d.vkTrimCommandPoolKHR( m_device, static_cast( commandPool ), static_cast( flags ) ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_WIN32_KHR - VULKAN_HPP_INLINE Result Device::getMemoryWin32HandleKHR( const MemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle ) const + template + VULKAN_HPP_INLINE Result Device::getMemoryWin32HandleKHR( const MemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle, Dispatch const &d) const { - return static_cast( vkGetMemoryWin32HandleKHR( m_device, reinterpret_cast( pGetWin32HandleInfo ), pHandle ) ); + return static_cast( d.vkGetMemoryWin32HandleKHR( m_device, reinterpret_cast( pGetWin32HandleInfo ), pHandle ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::getMemoryWin32HandleKHR( const MemoryGetWin32HandleInfoKHR & getWin32HandleInfo ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::getMemoryWin32HandleKHR( const MemoryGetWin32HandleInfoKHR & getWin32HandleInfo, Dispatch const &d ) const { HANDLE handle; - Result result = static_cast( vkGetMemoryWin32HandleKHR( m_device, reinterpret_cast( &getWin32HandleInfo ), &handle ) ); - return createResultValue( result, handle, "VULKAN_HPP_NAMESPACE::Device::getMemoryWin32HandleKHR" ); + Result result = static_cast( d.vkGetMemoryWin32HandleKHR( m_device, reinterpret_cast( &getWin32HandleInfo ), &handle ) ); + return createResultValue( result, handle, VULKAN_HPP_NAMESPACE_STRING"::Device::getMemoryWin32HandleKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_WIN32_KHR*/ #ifdef VK_USE_PLATFORM_WIN32_KHR - VULKAN_HPP_INLINE Result Device::getMemoryWin32HandlePropertiesKHR( ExternalMemoryHandleTypeFlagBitsKHR handleType, HANDLE handle, MemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties ) const + template + VULKAN_HPP_INLINE Result Device::getMemoryWin32HandlePropertiesKHR( ExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, MemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties, Dispatch const &d) const { - return static_cast( vkGetMemoryWin32HandlePropertiesKHR( m_device, static_cast( handleType ), handle, reinterpret_cast( pMemoryWin32HandleProperties ) ) ); + return static_cast( d.vkGetMemoryWin32HandlePropertiesKHR( m_device, static_cast( handleType ), handle, reinterpret_cast( pMemoryWin32HandleProperties ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::getMemoryWin32HandlePropertiesKHR( ExternalMemoryHandleTypeFlagBitsKHR handleType, HANDLE handle ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::getMemoryWin32HandlePropertiesKHR( ExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, Dispatch const &d ) const { MemoryWin32HandlePropertiesKHR memoryWin32HandleProperties; - Result result = static_cast( vkGetMemoryWin32HandlePropertiesKHR( m_device, static_cast( handleType ), handle, reinterpret_cast( &memoryWin32HandleProperties ) ) ); - return createResultValue( result, memoryWin32HandleProperties, "VULKAN_HPP_NAMESPACE::Device::getMemoryWin32HandlePropertiesKHR" ); + Result result = static_cast( d.vkGetMemoryWin32HandlePropertiesKHR( m_device, static_cast( handleType ), handle, reinterpret_cast( &memoryWin32HandleProperties ) ) ); + return createResultValue( result, memoryWin32HandleProperties, VULKAN_HPP_NAMESPACE_STRING"::Device::getMemoryWin32HandlePropertiesKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_WIN32_KHR*/ - VULKAN_HPP_INLINE Result Device::getMemoryFdKHR( const MemoryGetFdInfoKHR* pGetFdInfo, int* pFd ) const + template + VULKAN_HPP_INLINE Result Device::getMemoryFdKHR( const MemoryGetFdInfoKHR* pGetFdInfo, int* pFd, Dispatch const &d) const { - return static_cast( vkGetMemoryFdKHR( m_device, reinterpret_cast( pGetFdInfo ), pFd ) ); + return static_cast( d.vkGetMemoryFdKHR( m_device, reinterpret_cast( pGetFdInfo ), pFd ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::getMemoryFdKHR( const MemoryGetFdInfoKHR & getFdInfo ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::getMemoryFdKHR( const MemoryGetFdInfoKHR & getFdInfo, Dispatch const &d ) const { int fd; - Result result = static_cast( vkGetMemoryFdKHR( m_device, reinterpret_cast( &getFdInfo ), &fd ) ); - return createResultValue( result, fd, "VULKAN_HPP_NAMESPACE::Device::getMemoryFdKHR" ); + Result result = static_cast( d.vkGetMemoryFdKHR( m_device, reinterpret_cast( &getFdInfo ), &fd ) ); + return createResultValue( result, fd, VULKAN_HPP_NAMESPACE_STRING"::Device::getMemoryFdKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::getMemoryFdPropertiesKHR( ExternalMemoryHandleTypeFlagBitsKHR handleType, int fd, MemoryFdPropertiesKHR* pMemoryFdProperties ) const + template + VULKAN_HPP_INLINE Result Device::getMemoryFdPropertiesKHR( ExternalMemoryHandleTypeFlagBits handleType, int fd, MemoryFdPropertiesKHR* pMemoryFdProperties, Dispatch const &d) const { - return static_cast( vkGetMemoryFdPropertiesKHR( m_device, static_cast( handleType ), fd, reinterpret_cast( pMemoryFdProperties ) ) ); + return static_cast( d.vkGetMemoryFdPropertiesKHR( m_device, static_cast( handleType ), fd, reinterpret_cast( pMemoryFdProperties ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::getMemoryFdPropertiesKHR( ExternalMemoryHandleTypeFlagBitsKHR handleType, int fd ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::getMemoryFdPropertiesKHR( ExternalMemoryHandleTypeFlagBits handleType, int fd, Dispatch const &d ) const { MemoryFdPropertiesKHR memoryFdProperties; - Result result = static_cast( vkGetMemoryFdPropertiesKHR( m_device, static_cast( handleType ), fd, reinterpret_cast( &memoryFdProperties ) ) ); - return createResultValue( result, memoryFdProperties, "VULKAN_HPP_NAMESPACE::Device::getMemoryFdPropertiesKHR" ); + Result result = static_cast( d.vkGetMemoryFdPropertiesKHR( m_device, static_cast( handleType ), fd, reinterpret_cast( &memoryFdProperties ) ) ); + return createResultValue( result, memoryFdProperties, VULKAN_HPP_NAMESPACE_STRING"::Device::getMemoryFdPropertiesKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_WIN32_KHR - VULKAN_HPP_INLINE Result Device::getSemaphoreWin32HandleKHR( const SemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle ) const + template + VULKAN_HPP_INLINE Result Device::getSemaphoreWin32HandleKHR( const SemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle, Dispatch const &d) const { - return static_cast( vkGetSemaphoreWin32HandleKHR( m_device, reinterpret_cast( pGetWin32HandleInfo ), pHandle ) ); + return static_cast( d.vkGetSemaphoreWin32HandleKHR( m_device, reinterpret_cast( pGetWin32HandleInfo ), pHandle ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::getSemaphoreWin32HandleKHR( const SemaphoreGetWin32HandleInfoKHR & getWin32HandleInfo ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::getSemaphoreWin32HandleKHR( const SemaphoreGetWin32HandleInfoKHR & getWin32HandleInfo, Dispatch const &d ) const { HANDLE handle; - Result result = static_cast( vkGetSemaphoreWin32HandleKHR( m_device, reinterpret_cast( &getWin32HandleInfo ), &handle ) ); - return createResultValue( result, handle, "VULKAN_HPP_NAMESPACE::Device::getSemaphoreWin32HandleKHR" ); + Result result = static_cast( d.vkGetSemaphoreWin32HandleKHR( m_device, reinterpret_cast( &getWin32HandleInfo ), &handle ) ); + return createResultValue( result, handle, VULKAN_HPP_NAMESPACE_STRING"::Device::getSemaphoreWin32HandleKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_WIN32_KHR*/ #ifdef VK_USE_PLATFORM_WIN32_KHR - VULKAN_HPP_INLINE Result Device::importSemaphoreWin32HandleKHR( const ImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo ) const + template + VULKAN_HPP_INLINE Result Device::importSemaphoreWin32HandleKHR( const ImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo, Dispatch const &d) const { - return static_cast( vkImportSemaphoreWin32HandleKHR( m_device, reinterpret_cast( pImportSemaphoreWin32HandleInfo ) ) ); + return static_cast( d.vkImportSemaphoreWin32HandleKHR( m_device, reinterpret_cast( pImportSemaphoreWin32HandleInfo ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::importSemaphoreWin32HandleKHR( const ImportSemaphoreWin32HandleInfoKHR & importSemaphoreWin32HandleInfo ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::importSemaphoreWin32HandleKHR( const ImportSemaphoreWin32HandleInfoKHR & importSemaphoreWin32HandleInfo, Dispatch const &d ) const { - Result result = static_cast( vkImportSemaphoreWin32HandleKHR( m_device, reinterpret_cast( &importSemaphoreWin32HandleInfo ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::importSemaphoreWin32HandleKHR" ); + Result result = static_cast( d.vkImportSemaphoreWin32HandleKHR( m_device, reinterpret_cast( &importSemaphoreWin32HandleInfo ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::importSemaphoreWin32HandleKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_WIN32_KHR*/ - VULKAN_HPP_INLINE Result Device::getSemaphoreFdKHR( const SemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd ) const + template + VULKAN_HPP_INLINE Result Device::getSemaphoreFdKHR( const SemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd, Dispatch const &d) const { - return static_cast( vkGetSemaphoreFdKHR( m_device, reinterpret_cast( pGetFdInfo ), pFd ) ); + return static_cast( d.vkGetSemaphoreFdKHR( m_device, reinterpret_cast( pGetFdInfo ), pFd ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::getSemaphoreFdKHR( const SemaphoreGetFdInfoKHR & getFdInfo ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::getSemaphoreFdKHR( const SemaphoreGetFdInfoKHR & getFdInfo, Dispatch const &d ) const { int fd; - Result result = static_cast( vkGetSemaphoreFdKHR( m_device, reinterpret_cast( &getFdInfo ), &fd ) ); - return createResultValue( result, fd, "VULKAN_HPP_NAMESPACE::Device::getSemaphoreFdKHR" ); + Result result = static_cast( d.vkGetSemaphoreFdKHR( m_device, reinterpret_cast( &getFdInfo ), &fd ) ); + return createResultValue( result, fd, VULKAN_HPP_NAMESPACE_STRING"::Device::getSemaphoreFdKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::importSemaphoreFdKHR( const ImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo ) const + template + VULKAN_HPP_INLINE Result Device::importSemaphoreFdKHR( const ImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo, Dispatch const &d) const { - return static_cast( vkImportSemaphoreFdKHR( m_device, reinterpret_cast( pImportSemaphoreFdInfo ) ) ); + return static_cast( d.vkImportSemaphoreFdKHR( m_device, reinterpret_cast( pImportSemaphoreFdInfo ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::importSemaphoreFdKHR( const ImportSemaphoreFdInfoKHR & importSemaphoreFdInfo ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::importSemaphoreFdKHR( const ImportSemaphoreFdInfoKHR & importSemaphoreFdInfo, Dispatch const &d ) const { - Result result = static_cast( vkImportSemaphoreFdKHR( m_device, reinterpret_cast( &importSemaphoreFdInfo ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::importSemaphoreFdKHR" ); + Result result = static_cast( d.vkImportSemaphoreFdKHR( m_device, reinterpret_cast( &importSemaphoreFdInfo ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::importSemaphoreFdKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_WIN32_KHR - VULKAN_HPP_INLINE Result Device::getFenceWin32HandleKHR( const FenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle ) const + template + VULKAN_HPP_INLINE Result Device::getFenceWin32HandleKHR( const FenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle, Dispatch const &d) const { - return static_cast( vkGetFenceWin32HandleKHR( m_device, reinterpret_cast( pGetWin32HandleInfo ), pHandle ) ); + return static_cast( d.vkGetFenceWin32HandleKHR( m_device, reinterpret_cast( pGetWin32HandleInfo ), pHandle ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::getFenceWin32HandleKHR( const FenceGetWin32HandleInfoKHR & getWin32HandleInfo ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::getFenceWin32HandleKHR( const FenceGetWin32HandleInfoKHR & getWin32HandleInfo, Dispatch const &d ) const { HANDLE handle; - Result result = static_cast( vkGetFenceWin32HandleKHR( m_device, reinterpret_cast( &getWin32HandleInfo ), &handle ) ); - return createResultValue( result, handle, "VULKAN_HPP_NAMESPACE::Device::getFenceWin32HandleKHR" ); + Result result = static_cast( d.vkGetFenceWin32HandleKHR( m_device, reinterpret_cast( &getWin32HandleInfo ), &handle ) ); + return createResultValue( result, handle, VULKAN_HPP_NAMESPACE_STRING"::Device::getFenceWin32HandleKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_WIN32_KHR*/ #ifdef VK_USE_PLATFORM_WIN32_KHR - VULKAN_HPP_INLINE Result Device::importFenceWin32HandleKHR( const ImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo ) const + template + VULKAN_HPP_INLINE Result Device::importFenceWin32HandleKHR( const ImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo, Dispatch const &d) const { - return static_cast( vkImportFenceWin32HandleKHR( m_device, reinterpret_cast( pImportFenceWin32HandleInfo ) ) ); + return static_cast( d.vkImportFenceWin32HandleKHR( m_device, reinterpret_cast( pImportFenceWin32HandleInfo ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::importFenceWin32HandleKHR( const ImportFenceWin32HandleInfoKHR & importFenceWin32HandleInfo ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::importFenceWin32HandleKHR( const ImportFenceWin32HandleInfoKHR & importFenceWin32HandleInfo, Dispatch const &d ) const { - Result result = static_cast( vkImportFenceWin32HandleKHR( m_device, reinterpret_cast( &importFenceWin32HandleInfo ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::importFenceWin32HandleKHR" ); + Result result = static_cast( d.vkImportFenceWin32HandleKHR( m_device, reinterpret_cast( &importFenceWin32HandleInfo ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::importFenceWin32HandleKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_WIN32_KHR*/ - VULKAN_HPP_INLINE Result Device::getFenceFdKHR( const FenceGetFdInfoKHR* pGetFdInfo, int* pFd ) const + template + VULKAN_HPP_INLINE Result Device::getFenceFdKHR( const FenceGetFdInfoKHR* pGetFdInfo, int* pFd, Dispatch const &d) const { - return static_cast( vkGetFenceFdKHR( m_device, reinterpret_cast( pGetFdInfo ), pFd ) ); + return static_cast( d.vkGetFenceFdKHR( m_device, reinterpret_cast( pGetFdInfo ), pFd ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::getFenceFdKHR( const FenceGetFdInfoKHR & getFdInfo ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::getFenceFdKHR( const FenceGetFdInfoKHR & getFdInfo, Dispatch const &d ) const { int fd; - Result result = static_cast( vkGetFenceFdKHR( m_device, reinterpret_cast( &getFdInfo ), &fd ) ); - return createResultValue( result, fd, "VULKAN_HPP_NAMESPACE::Device::getFenceFdKHR" ); + Result result = static_cast( d.vkGetFenceFdKHR( m_device, reinterpret_cast( &getFdInfo ), &fd ) ); + return createResultValue( result, fd, VULKAN_HPP_NAMESPACE_STRING"::Device::getFenceFdKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::importFenceFdKHR( const ImportFenceFdInfoKHR* pImportFenceFdInfo ) const + template + VULKAN_HPP_INLINE Result Device::importFenceFdKHR( const ImportFenceFdInfoKHR* pImportFenceFdInfo, Dispatch const &d) const { - return static_cast( vkImportFenceFdKHR( m_device, reinterpret_cast( pImportFenceFdInfo ) ) ); + return static_cast( d.vkImportFenceFdKHR( m_device, reinterpret_cast( pImportFenceFdInfo ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::importFenceFdKHR( const ImportFenceFdInfoKHR & importFenceFdInfo ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::importFenceFdKHR( const ImportFenceFdInfoKHR & importFenceFdInfo, Dispatch const &d ) const { - Result result = static_cast( vkImportFenceFdKHR( m_device, reinterpret_cast( &importFenceFdInfo ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::importFenceFdKHR" ); + Result result = static_cast( d.vkImportFenceFdKHR( m_device, reinterpret_cast( &importFenceFdInfo ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::importFenceFdKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::displayPowerControlEXT( DisplayKHR display, const DisplayPowerInfoEXT* pDisplayPowerInfo ) const + template + VULKAN_HPP_INLINE Result Device::displayPowerControlEXT( DisplayKHR display, const DisplayPowerInfoEXT* pDisplayPowerInfo, Dispatch const &d) const { - return static_cast( vkDisplayPowerControlEXT( m_device, static_cast( display ), reinterpret_cast( pDisplayPowerInfo ) ) ); + return static_cast( d.vkDisplayPowerControlEXT( m_device, static_cast( display ), reinterpret_cast( pDisplayPowerInfo ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::displayPowerControlEXT( DisplayKHR display, const DisplayPowerInfoEXT & displayPowerInfo ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::displayPowerControlEXT( DisplayKHR display, const DisplayPowerInfoEXT & displayPowerInfo, Dispatch const &d ) const { - Result result = static_cast( vkDisplayPowerControlEXT( m_device, static_cast( display ), reinterpret_cast( &displayPowerInfo ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::displayPowerControlEXT" ); + Result result = static_cast( d.vkDisplayPowerControlEXT( m_device, static_cast( display ), reinterpret_cast( &displayPowerInfo ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::displayPowerControlEXT" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::registerEventEXT( const DeviceEventInfoEXT* pDeviceEventInfo, const AllocationCallbacks* pAllocator, Fence* pFence ) const + template + VULKAN_HPP_INLINE Result Device::registerEventEXT( const DeviceEventInfoEXT* pDeviceEventInfo, const AllocationCallbacks* pAllocator, Fence* pFence, Dispatch const &d) const { - return static_cast( vkRegisterDeviceEventEXT( m_device, reinterpret_cast( pDeviceEventInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pFence ) ) ); + return static_cast( d.vkRegisterDeviceEventEXT( m_device, reinterpret_cast( pDeviceEventInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pFence ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::registerEventEXT( const DeviceEventInfoEXT & deviceEventInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::registerEventEXT( const DeviceEventInfoEXT & deviceEventInfo, Optional allocator, Dispatch const &d ) const { Fence fence; - Result result = static_cast( vkRegisterDeviceEventEXT( m_device, reinterpret_cast( &deviceEventInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &fence ) ) ); - return createResultValue( result, fence, "VULKAN_HPP_NAMESPACE::Device::registerEventEXT" ); + Result result = static_cast( d.vkRegisterDeviceEventEXT( m_device, reinterpret_cast( &deviceEventInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &fence ) ) ); + return createResultValue( result, fence, VULKAN_HPP_NAMESPACE_STRING"::Device::registerEventEXT" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::registerDisplayEventEXT( DisplayKHR display, const DisplayEventInfoEXT* pDisplayEventInfo, const AllocationCallbacks* pAllocator, Fence* pFence ) const + template + VULKAN_HPP_INLINE Result Device::registerDisplayEventEXT( DisplayKHR display, const DisplayEventInfoEXT* pDisplayEventInfo, const AllocationCallbacks* pAllocator, Fence* pFence, Dispatch const &d) const { - return static_cast( vkRegisterDisplayEventEXT( m_device, static_cast( display ), reinterpret_cast( pDisplayEventInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pFence ) ) ); + 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 - VULKAN_HPP_INLINE ResultValueType::type Device::registerDisplayEventEXT( DisplayKHR display, const DisplayEventInfoEXT & displayEventInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::registerDisplayEventEXT( DisplayKHR display, const DisplayEventInfoEXT & displayEventInfo, Optional allocator, Dispatch const &d ) const { Fence fence; - Result result = static_cast( vkRegisterDisplayEventEXT( m_device, static_cast( display ), reinterpret_cast( &displayEventInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &fence ) ) ); - return createResultValue( result, fence, "VULKAN_HPP_NAMESPACE::Device::registerDisplayEventEXT" ); + Result result = static_cast( d.vkRegisterDisplayEventEXT( m_device, static_cast( display ), reinterpret_cast( &displayEventInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &fence ) ) ); + return createResultValue( result, fence, VULKAN_HPP_NAMESPACE_STRING"::Device::registerDisplayEventEXT" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::getSwapchainCounterEXT( SwapchainKHR swapchain, SurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue ) const + template + VULKAN_HPP_INLINE Result Device::getSwapchainCounterEXT( SwapchainKHR swapchain, SurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue, Dispatch const &d) const { - return static_cast( vkGetSwapchainCounterEXT( m_device, static_cast( swapchain ), static_cast( counter ), pCounterValue ) ); + return static_cast( d.vkGetSwapchainCounterEXT( m_device, static_cast( swapchain ), static_cast( counter ), pCounterValue ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValue Device::getSwapchainCounterEXT( SwapchainKHR swapchain, SurfaceCounterFlagBitsEXT counter ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::getSwapchainCounterEXT( SwapchainKHR swapchain, SurfaceCounterFlagBitsEXT counter, Dispatch const &d ) const { uint64_t counterValue; - Result result = static_cast( vkGetSwapchainCounterEXT( m_device, static_cast( swapchain ), static_cast( counter ), &counterValue ) ); - return createResultValue( result, counterValue, "VULKAN_HPP_NAMESPACE::Device::getSwapchainCounterEXT", { Result::eSuccess, Result::eErrorDeviceLost, Result::eErrorOutOfDateKHR } ); + Result result = static_cast( d.vkGetSwapchainCounterEXT( m_device, static_cast( swapchain ), static_cast( counter ), &counterValue ) ); + return createResultValue( result, counterValue, VULKAN_HPP_NAMESPACE_STRING"::Device::getSwapchainCounterEXT" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE void Device::getGroupPeerMemoryFeatures( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, PeerMemoryFeatureFlags* pPeerMemoryFeatures, Dispatch const &d) const + { + d.vkGetDeviceGroupPeerMemoryFeatures( m_device, heapIndex, localDeviceIndex, remoteDeviceIndex, reinterpret_cast( pPeerMemoryFeatures ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE PeerMemoryFeatureFlags Device::getGroupPeerMemoryFeatures( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, Dispatch const &d ) const + { + PeerMemoryFeatureFlags peerMemoryFeatures; + d.vkGetDeviceGroupPeerMemoryFeatures( m_device, heapIndex, localDeviceIndex, remoteDeviceIndex, reinterpret_cast( &peerMemoryFeatures ) ); + return peerMemoryFeatures; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::getGroupPeerMemoryFeaturesKHX( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, PeerMemoryFeatureFlagsKHX* pPeerMemoryFeatures ) const + template + VULKAN_HPP_INLINE void Device::getGroupPeerMemoryFeaturesKHR( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, PeerMemoryFeatureFlags* pPeerMemoryFeatures, Dispatch const &d) const { - vkGetDeviceGroupPeerMemoryFeaturesKHX( m_device, heapIndex, localDeviceIndex, remoteDeviceIndex, reinterpret_cast( pPeerMemoryFeatures ) ); + d.vkGetDeviceGroupPeerMemoryFeaturesKHR( m_device, heapIndex, localDeviceIndex, remoteDeviceIndex, reinterpret_cast( pPeerMemoryFeatures ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE PeerMemoryFeatureFlagsKHX Device::getGroupPeerMemoryFeaturesKHX( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex ) const + template + VULKAN_HPP_INLINE PeerMemoryFeatureFlags Device::getGroupPeerMemoryFeaturesKHR( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, Dispatch const &d ) const { - PeerMemoryFeatureFlagsKHX peerMemoryFeatures; - vkGetDeviceGroupPeerMemoryFeaturesKHX( m_device, heapIndex, localDeviceIndex, remoteDeviceIndex, reinterpret_cast( &peerMemoryFeatures ) ); + PeerMemoryFeatureFlags peerMemoryFeatures; + d.vkGetDeviceGroupPeerMemoryFeaturesKHR( m_device, heapIndex, localDeviceIndex, remoteDeviceIndex, reinterpret_cast( &peerMemoryFeatures ) ); return peerMemoryFeatures; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::bindBufferMemory2KHR( uint32_t bindInfoCount, const BindBufferMemoryInfoKHR* pBindInfos ) const + template + VULKAN_HPP_INLINE Result Device::bindBufferMemory2( uint32_t bindInfoCount, const BindBufferMemoryInfo* pBindInfos, Dispatch const &d) const + { + return static_cast( d.vkBindBufferMemory2( m_device, bindInfoCount, reinterpret_cast( pBindInfos ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE ResultValueType::type Device::bindBufferMemory2( ArrayProxy bindInfos, Dispatch const &d ) const + { + Result result = static_cast( d.vkBindBufferMemory2( m_device, bindInfos.size() , reinterpret_cast( bindInfos.data() ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::bindBufferMemory2" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE Result Device::bindBufferMemory2KHR( uint32_t bindInfoCount, const BindBufferMemoryInfo* pBindInfos, Dispatch const &d) const + { + return static_cast( d.vkBindBufferMemory2KHR( m_device, bindInfoCount, reinterpret_cast( pBindInfos ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE ResultValueType::type Device::bindBufferMemory2KHR( ArrayProxy bindInfos, Dispatch const &d ) const + { + Result result = static_cast( d.vkBindBufferMemory2KHR( m_device, bindInfos.size() , reinterpret_cast( bindInfos.data() ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::bindBufferMemory2KHR" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE Result Device::bindImageMemory2( uint32_t bindInfoCount, const BindImageMemoryInfo* pBindInfos, Dispatch const &d) const { - return static_cast( vkBindBufferMemory2KHR( m_device, bindInfoCount, reinterpret_cast( pBindInfos ) ) ); + return static_cast( d.vkBindImageMemory2( m_device, bindInfoCount, reinterpret_cast( pBindInfos ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::bindBufferMemory2KHR( ArrayProxy bindInfos ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::bindImageMemory2( ArrayProxy bindInfos, Dispatch const &d ) const { - Result result = static_cast( vkBindBufferMemory2KHR( m_device, bindInfos.size() , reinterpret_cast( bindInfos.data() ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::bindBufferMemory2KHR" ); + Result result = static_cast( d.vkBindImageMemory2( m_device, bindInfos.size() , reinterpret_cast( bindInfos.data() ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::bindImageMemory2" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::bindImageMemory2KHR( uint32_t bindInfoCount, const BindImageMemoryInfoKHR* pBindInfos ) const + template + VULKAN_HPP_INLINE Result Device::bindImageMemory2KHR( uint32_t bindInfoCount, const BindImageMemoryInfo* pBindInfos, Dispatch const &d) const { - return static_cast( vkBindImageMemory2KHR( m_device, bindInfoCount, reinterpret_cast( pBindInfos ) ) ); + return static_cast( d.vkBindImageMemory2KHR( m_device, bindInfoCount, reinterpret_cast( pBindInfos ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::bindImageMemory2KHR( ArrayProxy bindInfos ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::bindImageMemory2KHR( ArrayProxy bindInfos, Dispatch const &d ) const { - Result result = static_cast( vkBindImageMemory2KHR( m_device, bindInfos.size() , reinterpret_cast( bindInfos.data() ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::bindImageMemory2KHR" ); + Result result = static_cast( d.vkBindImageMemory2KHR( m_device, bindInfos.size() , reinterpret_cast( bindInfos.data() ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::bindImageMemory2KHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::getGroupPresentCapabilitiesKHX( DeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities ) const + template + VULKAN_HPP_INLINE Result Device::getGroupPresentCapabilitiesKHR( DeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities, Dispatch const &d) const { - return static_cast( vkGetDeviceGroupPresentCapabilitiesKHX( m_device, reinterpret_cast( pDeviceGroupPresentCapabilities ) ) ); + return static_cast( d.vkGetDeviceGroupPresentCapabilitiesKHR( m_device, reinterpret_cast( pDeviceGroupPresentCapabilities ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::getGroupPresentCapabilitiesKHX() const + template + VULKAN_HPP_INLINE ResultValueType::type Device::getGroupPresentCapabilitiesKHR(Dispatch const &d ) const { - DeviceGroupPresentCapabilitiesKHX deviceGroupPresentCapabilities; - Result result = static_cast( vkGetDeviceGroupPresentCapabilitiesKHX( m_device, reinterpret_cast( &deviceGroupPresentCapabilities ) ) ); - return createResultValue( result, deviceGroupPresentCapabilities, "VULKAN_HPP_NAMESPACE::Device::getGroupPresentCapabilitiesKHX" ); + DeviceGroupPresentCapabilitiesKHR deviceGroupPresentCapabilities; + Result result = static_cast( d.vkGetDeviceGroupPresentCapabilitiesKHR( m_device, reinterpret_cast( &deviceGroupPresentCapabilities ) ) ); + return createResultValue( result, deviceGroupPresentCapabilities, VULKAN_HPP_NAMESPACE_STRING"::Device::getGroupPresentCapabilitiesKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::getGroupSurfacePresentModesKHX( SurfaceKHR surface, DeviceGroupPresentModeFlagsKHX* pModes ) const + template + VULKAN_HPP_INLINE Result Device::getGroupSurfacePresentModesKHR( SurfaceKHR surface, DeviceGroupPresentModeFlagsKHR* pModes, Dispatch const &d) const { - return static_cast( vkGetDeviceGroupSurfacePresentModesKHX( m_device, static_cast( surface ), reinterpret_cast( pModes ) ) ); + return static_cast( d.vkGetDeviceGroupSurfacePresentModesKHR( m_device, static_cast( surface ), reinterpret_cast( pModes ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::getGroupSurfacePresentModesKHX( SurfaceKHR surface ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::getGroupSurfacePresentModesKHR( SurfaceKHR surface, Dispatch const &d ) const { - DeviceGroupPresentModeFlagsKHX modes; - Result result = static_cast( vkGetDeviceGroupSurfacePresentModesKHX( m_device, static_cast( surface ), reinterpret_cast( &modes ) ) ); - return createResultValue( result, modes, "VULKAN_HPP_NAMESPACE::Device::getGroupSurfacePresentModesKHX" ); + DeviceGroupPresentModeFlagsKHR modes; + Result result = static_cast( d.vkGetDeviceGroupSurfacePresentModesKHR( m_device, static_cast( surface ), reinterpret_cast( &modes ) ) ); + return createResultValue( result, modes, VULKAN_HPP_NAMESPACE_STRING"::Device::getGroupSurfacePresentModesKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::acquireNextImage2KHX( const AcquireNextImageInfoKHX* pAcquireInfo, uint32_t* pImageIndex ) const + template + VULKAN_HPP_INLINE Result Device::acquireNextImage2KHR( const AcquireNextImageInfoKHR* pAcquireInfo, uint32_t* pImageIndex, Dispatch const &d) const { - return static_cast( vkAcquireNextImage2KHX( m_device, reinterpret_cast( pAcquireInfo ), pImageIndex ) ); + return static_cast( d.vkAcquireNextImage2KHR( m_device, reinterpret_cast( pAcquireInfo ), pImageIndex ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValue Device::acquireNextImage2KHX( const AcquireNextImageInfoKHX & acquireInfo ) const + template + VULKAN_HPP_INLINE ResultValue Device::acquireNextImage2KHR( const AcquireNextImageInfoKHR & acquireInfo, Dispatch const &d ) const { uint32_t imageIndex; - Result result = static_cast( vkAcquireNextImage2KHX( m_device, reinterpret_cast( &acquireInfo ), &imageIndex ) ); - return createResultValue( result, imageIndex, "VULKAN_HPP_NAMESPACE::Device::acquireNextImage2KHX", { Result::eSuccess, Result::eTimeout, Result::eNotReady, Result::eSuboptimalKHR } ); + Result result = static_cast( d.vkAcquireNextImage2KHR( m_device, reinterpret_cast( &acquireInfo ), &imageIndex ) ); + return createResultValue( result, imageIndex, VULKAN_HPP_NAMESPACE_STRING"::Device::acquireNextImage2KHR", { Result::eSuccess, Result::eTimeout, Result::eNotReady, Result::eSuboptimalKHR } ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createDescriptorUpdateTemplateKHR( const DescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate ) const + template + VULKAN_HPP_INLINE Result Device::createDescriptorUpdateTemplate( const DescriptorUpdateTemplateCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorUpdateTemplate* pDescriptorUpdateTemplate, Dispatch const &d) const { - return static_cast( vkCreateDescriptorUpdateTemplateKHR( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pDescriptorUpdateTemplate ) ) ); + return static_cast( d.vkCreateDescriptorUpdateTemplate( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pDescriptorUpdateTemplate ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createDescriptorUpdateTemplateKHR( const DescriptorUpdateTemplateCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createDescriptorUpdateTemplate( const DescriptorUpdateTemplateCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - DescriptorUpdateTemplateKHR descriptorUpdateTemplate; - Result result = static_cast( vkCreateDescriptorUpdateTemplateKHR( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &descriptorUpdateTemplate ) ) ); - return createResultValue( result, descriptorUpdateTemplate, "VULKAN_HPP_NAMESPACE::Device::createDescriptorUpdateTemplateKHR" ); + DescriptorUpdateTemplate descriptorUpdateTemplate; + Result result = static_cast( d.vkCreateDescriptorUpdateTemplate( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &descriptorUpdateTemplate ) ) ); + return createResultValue( result, descriptorUpdateTemplate, VULKAN_HPP_NAMESPACE_STRING"::Device::createDescriptorUpdateTemplate" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueDescriptorUpdateTemplateKHR Device::createDescriptorUpdateTemplateKHRUnique( const DescriptorUpdateTemplateCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createDescriptorUpdateTemplateUnique( const DescriptorUpdateTemplateCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - DescriptorUpdateTemplateKHRDeleter deleter( *this, allocator ); - return UniqueDescriptorUpdateTemplateKHR( createDescriptorUpdateTemplateKHR( createInfo, allocator ), deleter ); + DescriptorUpdateTemplate descriptorUpdateTemplate; + Result result = static_cast( d.vkCreateDescriptorUpdateTemplate( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &descriptorUpdateTemplate ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, descriptorUpdateTemplate, VULKAN_HPP_NAMESPACE_STRING"::Device::createDescriptorUpdateTemplateUnique", deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE Result Device::createDescriptorUpdateTemplateKHR( const DescriptorUpdateTemplateCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorUpdateTemplate* pDescriptorUpdateTemplate, Dispatch const &d) const + { + 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_INLINE ResultValueType::type Device::createDescriptorUpdateTemplateKHR( const DescriptorUpdateTemplateCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const + { + DescriptorUpdateTemplate descriptorUpdateTemplate; + Result result = static_cast( d.vkCreateDescriptorUpdateTemplateKHR( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &descriptorUpdateTemplate ) ) ); + return createResultValue( result, descriptorUpdateTemplate, VULKAN_HPP_NAMESPACE_STRING"::Device::createDescriptorUpdateTemplateKHR" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + VULKAN_HPP_INLINE ResultValueType::type Device::createDescriptorUpdateTemplateKHRUnique( const DescriptorUpdateTemplateCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const + { + DescriptorUpdateTemplate descriptorUpdateTemplate; + Result result = static_cast( d.vkCreateDescriptorUpdateTemplateKHR( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &descriptorUpdateTemplate ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, descriptorUpdateTemplate, VULKAN_HPP_NAMESPACE_STRING"::Device::createDescriptorUpdateTemplateKHRUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyDescriptorUpdateTemplateKHR( DescriptorUpdateTemplateKHR descriptorUpdateTemplate, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyDescriptorUpdateTemplate( DescriptorUpdateTemplate descriptorUpdateTemplate, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyDescriptorUpdateTemplate( m_device, static_cast( descriptorUpdateTemplate ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroyDescriptorUpdateTemplate( DescriptorUpdateTemplate descriptorUpdateTemplate, Optional allocator, Dispatch const &d ) const + { + 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( DescriptorUpdateTemplate descriptorUpdateTemplate, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyDescriptorUpdateTemplate( m_device, static_cast( descriptorUpdateTemplate ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroy( DescriptorUpdateTemplate descriptorUpdateTemplate, Optional allocator, Dispatch const &d ) const + { + d.vkDestroyDescriptorUpdateTemplate( m_device, static_cast( descriptorUpdateTemplate ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE void Device::destroyDescriptorUpdateTemplateKHR( DescriptorUpdateTemplate descriptorUpdateTemplate, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyDescriptorUpdateTemplateKHR( m_device, static_cast( descriptorUpdateTemplate ), reinterpret_cast( pAllocator ) ); + d.vkDestroyDescriptorUpdateTemplateKHR( m_device, static_cast( descriptorUpdateTemplate ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyDescriptorUpdateTemplateKHR( DescriptorUpdateTemplateKHR descriptorUpdateTemplate, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroyDescriptorUpdateTemplateKHR( DescriptorUpdateTemplate descriptorUpdateTemplate, Optional allocator, Dispatch const &d ) const + { + d.vkDestroyDescriptorUpdateTemplateKHR( m_device, static_cast( descriptorUpdateTemplate ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::updateDescriptorSetWithTemplate( DescriptorSet descriptorSet, DescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData, Dispatch const &d) const { - vkDestroyDescriptorUpdateTemplateKHR( m_device, static_cast( descriptorUpdateTemplate ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkUpdateDescriptorSetWithTemplate( m_device, static_cast( descriptorSet ), static_cast( descriptorUpdateTemplate ), pData ); + } +#else + template + VULKAN_HPP_INLINE void Device::updateDescriptorSetWithTemplate( DescriptorSet descriptorSet, DescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData, Dispatch const &d ) const + { + d.vkUpdateDescriptorSetWithTemplate( m_device, static_cast( descriptorSet ), static_cast( descriptorUpdateTemplate ), pData ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::updateDescriptorSetWithTemplateKHR( DescriptorSet descriptorSet, DescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void* pData ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::updateDescriptorSetWithTemplateKHR( DescriptorSet descriptorSet, DescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData, Dispatch const &d) const { - vkUpdateDescriptorSetWithTemplateKHR( m_device, static_cast( descriptorSet ), static_cast( descriptorUpdateTemplate ), pData ); + d.vkUpdateDescriptorSetWithTemplateKHR( m_device, static_cast( descriptorSet ), static_cast( descriptorUpdateTemplate ), pData ); } +#else + template + VULKAN_HPP_INLINE void Device::updateDescriptorSetWithTemplateKHR( DescriptorSet descriptorSet, DescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData, Dispatch const &d ) const + { + d.vkUpdateDescriptorSetWithTemplateKHR( m_device, static_cast( descriptorSet ), static_cast( descriptorUpdateTemplate ), pData ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::setHdrMetadataEXT( uint32_t swapchainCount, const SwapchainKHR* pSwapchains, const HdrMetadataEXT* pMetadata ) const + template + VULKAN_HPP_INLINE void Device::setHdrMetadataEXT( uint32_t swapchainCount, const SwapchainKHR* pSwapchains, const HdrMetadataEXT* pMetadata, Dispatch const &d) const { - vkSetHdrMetadataEXT( m_device, swapchainCount, reinterpret_cast( pSwapchains ), reinterpret_cast( pMetadata ) ); + d.vkSetHdrMetadataEXT( m_device, swapchainCount, reinterpret_cast( pSwapchains ), reinterpret_cast( pMetadata ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::setHdrMetadataEXT( ArrayProxy swapchains, ArrayProxy metadata ) const + template + VULKAN_HPP_INLINE void Device::setHdrMetadataEXT( ArrayProxy swapchains, ArrayProxy metadata, Dispatch const &d ) const { #ifdef VULKAN_HPP_NO_EXCEPTIONS - assert( swapchains.size() == metadata.size() ); + VULKAN_HPP_ASSERT( swapchains.size() == metadata.size() ); #else if ( swapchains.size() != metadata.size() ) { - throw LogicError( "VULKAN_HPP_NAMESPACE::Device::setHdrMetadataEXT: swapchains.size() != metadata.size()" ); + throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::Device::setHdrMetadataEXT: swapchains.size() != metadata.size()" ); } #endif // VULKAN_HPP_NO_EXCEPTIONS - vkSetHdrMetadataEXT( m_device, swapchains.size() , reinterpret_cast( swapchains.data() ), reinterpret_cast( metadata.data() ) ); + d.vkSetHdrMetadataEXT( m_device, swapchains.size() , reinterpret_cast( swapchains.data() ), reinterpret_cast( metadata.data() ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Result Device::getSwapchainStatusKHR( SwapchainKHR swapchain ) const + template + VULKAN_HPP_INLINE Result Device::getSwapchainStatusKHR( SwapchainKHR swapchain, Dispatch const &d) const { - return static_cast( vkGetSwapchainStatusKHR( m_device, static_cast( swapchain ) ) ); + return static_cast( d.vkGetSwapchainStatusKHR( m_device, static_cast( swapchain ) ) ); } #else - VULKAN_HPP_INLINE Result Device::getSwapchainStatusKHR( SwapchainKHR swapchain ) const + template + VULKAN_HPP_INLINE Result Device::getSwapchainStatusKHR( SwapchainKHR swapchain, Dispatch const &d ) const { - Result result = static_cast( vkGetSwapchainStatusKHR( m_device, static_cast( swapchain ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::getSwapchainStatusKHR", { Result::eSuccess, Result::eSuboptimalKHR } ); + Result result = static_cast( d.vkGetSwapchainStatusKHR( m_device, static_cast( swapchain ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::getSwapchainStatusKHR", { Result::eSuccess, Result::eSuboptimalKHR } ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::getRefreshCycleDurationGOOGLE( SwapchainKHR swapchain, RefreshCycleDurationGOOGLE* pDisplayTimingProperties ) const + template + VULKAN_HPP_INLINE Result Device::getRefreshCycleDurationGOOGLE( SwapchainKHR swapchain, RefreshCycleDurationGOOGLE* pDisplayTimingProperties, Dispatch const &d) const { - return static_cast( vkGetRefreshCycleDurationGOOGLE( m_device, static_cast( swapchain ), reinterpret_cast( pDisplayTimingProperties ) ) ); + return static_cast( d.vkGetRefreshCycleDurationGOOGLE( m_device, static_cast( swapchain ), reinterpret_cast( pDisplayTimingProperties ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::getRefreshCycleDurationGOOGLE( SwapchainKHR swapchain ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::getRefreshCycleDurationGOOGLE( SwapchainKHR swapchain, Dispatch const &d ) const { RefreshCycleDurationGOOGLE displayTimingProperties; - Result result = static_cast( vkGetRefreshCycleDurationGOOGLE( m_device, static_cast( swapchain ), reinterpret_cast( &displayTimingProperties ) ) ); - return createResultValue( result, displayTimingProperties, "VULKAN_HPP_NAMESPACE::Device::getRefreshCycleDurationGOOGLE" ); + Result result = static_cast( d.vkGetRefreshCycleDurationGOOGLE( m_device, static_cast( swapchain ), reinterpret_cast( &displayTimingProperties ) ) ); + return createResultValue( result, displayTimingProperties, VULKAN_HPP_NAMESPACE_STRING"::Device::getRefreshCycleDurationGOOGLE" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::getPastPresentationTimingGOOGLE( SwapchainKHR swapchain, uint32_t* pPresentationTimingCount, PastPresentationTimingGOOGLE* pPresentationTimings ) const + template + VULKAN_HPP_INLINE Result Device::getPastPresentationTimingGOOGLE( SwapchainKHR swapchain, uint32_t* pPresentationTimingCount, PastPresentationTimingGOOGLE* pPresentationTimings, Dispatch const &d) const { - return static_cast( vkGetPastPresentationTimingGOOGLE( m_device, static_cast( swapchain ), pPresentationTimingCount, reinterpret_cast( pPresentationTimings ) ) ); + return static_cast( d.vkGetPastPresentationTimingGOOGLE( m_device, static_cast( swapchain ), pPresentationTimingCount, reinterpret_cast( pPresentationTimings ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type Device::getPastPresentationTimingGOOGLE( SwapchainKHR swapchain ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::getPastPresentationTimingGOOGLE( SwapchainKHR swapchain, Dispatch const &d ) const { std::vector presentationTimings; uint32_t presentationTimingCount; - Result result = static_cast( vkGetPastPresentationTimingGOOGLE( m_device, static_cast( swapchain ), &presentationTimingCount, nullptr ) ); - if ( ( result == Result::eSuccess ) && presentationTimingCount ) + Result result; + do { - presentationTimings.resize( presentationTimingCount ); - result = static_cast( vkGetPastPresentationTimingGOOGLE( m_device, static_cast( swapchain ), &presentationTimingCount, reinterpret_cast( presentationTimings.data() ) ) ); - } - return createResultValue( result, presentationTimings, "VULKAN_HPP_NAMESPACE::Device::getPastPresentationTimingGOOGLE" ); + result = static_cast( d.vkGetPastPresentationTimingGOOGLE( m_device, static_cast( swapchain ), &presentationTimingCount, nullptr ) ); + if ( ( result == Result::eSuccess ) && presentationTimingCount ) + { + presentationTimings.resize( presentationTimingCount ); + result = static_cast( d.vkGetPastPresentationTimingGOOGLE( m_device, static_cast( swapchain ), &presentationTimingCount, reinterpret_cast( presentationTimings.data() ) ) ); + } + } while ( result == Result::eIncomplete ); + VULKAN_HPP_ASSERT( presentationTimingCount <= presentationTimings.size() ); + presentationTimings.resize( presentationTimingCount ); + return createResultValue( result, presentationTimings, VULKAN_HPP_NAMESPACE_STRING"::Device::getPastPresentationTimingGOOGLE" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE void Device::getBufferMemoryRequirements2( const BufferMemoryRequirementsInfo2* pInfo, MemoryRequirements2* pMemoryRequirements, Dispatch const &d) const + { + d.vkGetBufferMemoryRequirements2( m_device, reinterpret_cast( pInfo ), reinterpret_cast( pMemoryRequirements ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE MemoryRequirements2 Device::getBufferMemoryRequirements2( const BufferMemoryRequirementsInfo2 & info, Dispatch const &d ) const + { + MemoryRequirements2 memoryRequirements; + d.vkGetBufferMemoryRequirements2( m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); + return memoryRequirements; + } + template + VULKAN_HPP_INLINE StructureChain Device::getBufferMemoryRequirements2( const BufferMemoryRequirementsInfo2 & info, Dispatch const &d ) const + { + StructureChain structureChain; + 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::getBufferMemoryRequirements2KHR( const BufferMemoryRequirementsInfo2* pInfo, MemoryRequirements2* pMemoryRequirements, Dispatch const &d) const + { + d.vkGetBufferMemoryRequirements2KHR( m_device, reinterpret_cast( pInfo ), reinterpret_cast( pMemoryRequirements ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE MemoryRequirements2 Device::getBufferMemoryRequirements2KHR( const BufferMemoryRequirementsInfo2 & info, Dispatch const &d ) const + { + MemoryRequirements2 memoryRequirements; + d.vkGetBufferMemoryRequirements2KHR( m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); + return memoryRequirements; + } + template + VULKAN_HPP_INLINE StructureChain Device::getBufferMemoryRequirements2KHR( const BufferMemoryRequirementsInfo2 & info, Dispatch const &d ) const + { + StructureChain structureChain; + MemoryRequirements2& memoryRequirements = structureChain.template get(); + d.vkGetBufferMemoryRequirements2KHR( m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); + return structureChain; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::getBufferMemoryRequirements2KHR( const BufferMemoryRequirementsInfo2KHR* pInfo, MemoryRequirements2KHR* pMemoryRequirements ) const + template + VULKAN_HPP_INLINE void Device::getImageMemoryRequirements2( const ImageMemoryRequirementsInfo2* pInfo, MemoryRequirements2* pMemoryRequirements, Dispatch const &d) const { - vkGetBufferMemoryRequirements2KHR( m_device, reinterpret_cast( pInfo ), reinterpret_cast( pMemoryRequirements ) ); + d.vkGetImageMemoryRequirements2( m_device, reinterpret_cast( pInfo ), reinterpret_cast( pMemoryRequirements ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE MemoryRequirements2KHR Device::getBufferMemoryRequirements2KHR( const BufferMemoryRequirementsInfo2KHR & info ) const + template + VULKAN_HPP_INLINE MemoryRequirements2 Device::getImageMemoryRequirements2( const ImageMemoryRequirementsInfo2 & info, Dispatch const &d ) const { - MemoryRequirements2KHR memoryRequirements; - vkGetBufferMemoryRequirements2KHR( m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); + MemoryRequirements2 memoryRequirements; + d.vkGetImageMemoryRequirements2( m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); return memoryRequirements; } - template - VULKAN_HPP_INLINE StructureChain Device::getBufferMemoryRequirements2KHR( const BufferMemoryRequirementsInfo2KHR & info ) const + template + VULKAN_HPP_INLINE StructureChain Device::getImageMemoryRequirements2( const ImageMemoryRequirementsInfo2 & info, Dispatch const &d ) const { StructureChain structureChain; - MemoryRequirements2KHR& memoryRequirements = structureChain.template get(); - vkGetBufferMemoryRequirements2KHR( m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); + MemoryRequirements2& memoryRequirements = structureChain.template get(); + d.vkGetImageMemoryRequirements2( m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); return structureChain; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::getImageMemoryRequirements2KHR( const ImageMemoryRequirementsInfo2KHR* pInfo, MemoryRequirements2KHR* pMemoryRequirements ) const + template + VULKAN_HPP_INLINE void Device::getImageMemoryRequirements2KHR( const ImageMemoryRequirementsInfo2* pInfo, MemoryRequirements2* pMemoryRequirements, Dispatch const &d) const { - vkGetImageMemoryRequirements2KHR( m_device, reinterpret_cast( pInfo ), reinterpret_cast( pMemoryRequirements ) ); + d.vkGetImageMemoryRequirements2KHR( m_device, reinterpret_cast( pInfo ), reinterpret_cast( pMemoryRequirements ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE MemoryRequirements2KHR Device::getImageMemoryRequirements2KHR( const ImageMemoryRequirementsInfo2KHR & info ) const + template + VULKAN_HPP_INLINE MemoryRequirements2 Device::getImageMemoryRequirements2KHR( const ImageMemoryRequirementsInfo2 & info, Dispatch const &d ) const { - MemoryRequirements2KHR memoryRequirements; - vkGetImageMemoryRequirements2KHR( m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); + MemoryRequirements2 memoryRequirements; + d.vkGetImageMemoryRequirements2KHR( m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); return memoryRequirements; } - template - VULKAN_HPP_INLINE StructureChain Device::getImageMemoryRequirements2KHR( const ImageMemoryRequirementsInfo2KHR & info ) const + template + VULKAN_HPP_INLINE StructureChain Device::getImageMemoryRequirements2KHR( const ImageMemoryRequirementsInfo2 & info, Dispatch const &d ) const { StructureChain structureChain; - MemoryRequirements2KHR& memoryRequirements = structureChain.template get(); - vkGetImageMemoryRequirements2KHR( m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); + MemoryRequirements2& memoryRequirements = structureChain.template get(); + d.vkGetImageMemoryRequirements2KHR( m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); return structureChain; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::getImageSparseMemoryRequirements2KHR( const ImageSparseMemoryRequirementsInfo2KHR* pInfo, uint32_t* pSparseMemoryRequirementCount, SparseImageMemoryRequirements2KHR* pSparseMemoryRequirements ) const + template + VULKAN_HPP_INLINE void Device::getImageSparseMemoryRequirements2( const ImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, SparseImageMemoryRequirements2* pSparseMemoryRequirements, Dispatch const &d) const + { + d.vkGetImageSparseMemoryRequirements2( m_device, reinterpret_cast( pInfo ), pSparseMemoryRequirementCount, reinterpret_cast( pSparseMemoryRequirements ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE std::vector Device::getImageSparseMemoryRequirements2( const ImageSparseMemoryRequirementsInfo2 & info, Dispatch const &d ) const + { + 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() ) ); + return sparseMemoryRequirements; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE void Device::getImageSparseMemoryRequirements2KHR( const ImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, SparseImageMemoryRequirements2* pSparseMemoryRequirements, Dispatch const &d) const { - vkGetImageSparseMemoryRequirements2KHR( m_device, reinterpret_cast( pInfo ), pSparseMemoryRequirementCount, reinterpret_cast( pSparseMemoryRequirements ) ); + d.vkGetImageSparseMemoryRequirements2KHR( m_device, reinterpret_cast( pInfo ), pSparseMemoryRequirementCount, reinterpret_cast( pSparseMemoryRequirements ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE std::vector Device::getImageSparseMemoryRequirements2KHR( const ImageSparseMemoryRequirementsInfo2KHR & info ) const + template + VULKAN_HPP_INLINE std::vector Device::getImageSparseMemoryRequirements2KHR( const ImageSparseMemoryRequirementsInfo2 & info, Dispatch const &d ) const { - std::vector sparseMemoryRequirements; + std::vector sparseMemoryRequirements; uint32_t sparseMemoryRequirementCount; - vkGetImageSparseMemoryRequirements2KHR( m_device, reinterpret_cast( &info ), &sparseMemoryRequirementCount, nullptr ); + d.vkGetImageSparseMemoryRequirements2KHR( m_device, reinterpret_cast( &info ), &sparseMemoryRequirementCount, nullptr ); sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - vkGetImageSparseMemoryRequirements2KHR( m_device, reinterpret_cast( &info ), &sparseMemoryRequirementCount, reinterpret_cast( sparseMemoryRequirements.data() ) ); + d.vkGetImageSparseMemoryRequirements2KHR( m_device, reinterpret_cast( &info ), &sparseMemoryRequirementCount, reinterpret_cast( sparseMemoryRequirements.data() ) ); return sparseMemoryRequirements; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createSamplerYcbcrConversionKHR( const SamplerYcbcrConversionCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SamplerYcbcrConversionKHR* pYcbcrConversion ) const + template + VULKAN_HPP_INLINE Result Device::createSamplerYcbcrConversion( const SamplerYcbcrConversionCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, SamplerYcbcrConversion* pYcbcrConversion, Dispatch const &d) const { - return static_cast( vkCreateSamplerYcbcrConversionKHR( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pYcbcrConversion ) ) ); + return static_cast( d.vkCreateSamplerYcbcrConversion( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pYcbcrConversion ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createSamplerYcbcrConversionKHR( const SamplerYcbcrConversionCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createSamplerYcbcrConversion( const SamplerYcbcrConversionCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - SamplerYcbcrConversionKHR ycbcrConversion; - Result result = static_cast( vkCreateSamplerYcbcrConversionKHR( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &ycbcrConversion ) ) ); - return createResultValue( result, ycbcrConversion, "VULKAN_HPP_NAMESPACE::Device::createSamplerYcbcrConversionKHR" ); + SamplerYcbcrConversion ycbcrConversion; + Result result = static_cast( d.vkCreateSamplerYcbcrConversion( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &ycbcrConversion ) ) ); + return createResultValue( result, ycbcrConversion, VULKAN_HPP_NAMESPACE_STRING"::Device::createSamplerYcbcrConversion" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueSamplerYcbcrConversionKHR Device::createSamplerYcbcrConversionKHRUnique( const SamplerYcbcrConversionCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createSamplerYcbcrConversionUnique( const SamplerYcbcrConversionCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - SamplerYcbcrConversionKHRDeleter deleter( *this, allocator ); - return UniqueSamplerYcbcrConversionKHR( createSamplerYcbcrConversionKHR( createInfo, allocator ), deleter ); + SamplerYcbcrConversion ycbcrConversion; + Result result = static_cast( d.vkCreateSamplerYcbcrConversion( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &ycbcrConversion ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, ycbcrConversion, VULKAN_HPP_NAMESPACE_STRING"::Device::createSamplerYcbcrConversionUnique", deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE Result Device::createSamplerYcbcrConversionKHR( const SamplerYcbcrConversionCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, SamplerYcbcrConversion* pYcbcrConversion, Dispatch const &d) const + { + 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_INLINE ResultValueType::type Device::createSamplerYcbcrConversionKHR( const SamplerYcbcrConversionCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const + { + SamplerYcbcrConversion ycbcrConversion; + Result result = static_cast( d.vkCreateSamplerYcbcrConversionKHR( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &ycbcrConversion ) ) ); + return createResultValue( result, ycbcrConversion, VULKAN_HPP_NAMESPACE_STRING"::Device::createSamplerYcbcrConversionKHR" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + VULKAN_HPP_INLINE ResultValueType::type Device::createSamplerYcbcrConversionKHRUnique( const SamplerYcbcrConversionCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const + { + SamplerYcbcrConversion ycbcrConversion; + Result result = static_cast( d.vkCreateSamplerYcbcrConversionKHR( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &ycbcrConversion ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, ycbcrConversion, VULKAN_HPP_NAMESPACE_STRING"::Device::createSamplerYcbcrConversionKHRUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroySamplerYcbcrConversionKHR( SamplerYcbcrConversionKHR ycbcrConversion, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroySamplerYcbcrConversion( SamplerYcbcrConversion ycbcrConversion, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroySamplerYcbcrConversion( m_device, static_cast( ycbcrConversion ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroySamplerYcbcrConversion( SamplerYcbcrConversion ycbcrConversion, Optional allocator, Dispatch const &d ) const + { + 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( SamplerYcbcrConversion ycbcrConversion, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroySamplerYcbcrConversion( m_device, static_cast( ycbcrConversion ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroy( SamplerYcbcrConversion ycbcrConversion, Optional allocator, Dispatch const &d ) const + { + d.vkDestroySamplerYcbcrConversion( m_device, static_cast( ycbcrConversion ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE void Device::destroySamplerYcbcrConversionKHR( SamplerYcbcrConversion ycbcrConversion, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroySamplerYcbcrConversionKHR( m_device, static_cast( ycbcrConversion ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroySamplerYcbcrConversionKHR( SamplerYcbcrConversion ycbcrConversion, Optional allocator, Dispatch const &d ) const + { + d.vkDestroySamplerYcbcrConversionKHR( m_device, static_cast( ycbcrConversion ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE void Device::getQueue2( const DeviceQueueInfo2* pQueueInfo, Queue* pQueue, Dispatch const &d) const { - vkDestroySamplerYcbcrConversionKHR( m_device, static_cast( ycbcrConversion ), reinterpret_cast( pAllocator ) ); + d.vkGetDeviceQueue2( m_device, reinterpret_cast( pQueueInfo ), reinterpret_cast( pQueue ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroySamplerYcbcrConversionKHR( SamplerYcbcrConversionKHR ycbcrConversion, Optional allocator ) const + template + VULKAN_HPP_INLINE Queue Device::getQueue2( const DeviceQueueInfo2 & queueInfo, Dispatch const &d ) const { - vkDestroySamplerYcbcrConversionKHR( m_device, static_cast( ycbcrConversion ), reinterpret_cast( static_cast( allocator ) ) ); + Queue queue; + d.vkGetDeviceQueue2( m_device, reinterpret_cast( &queueInfo ), reinterpret_cast( &queue ) ); + return queue; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::createValidationCacheEXT( const ValidationCacheCreateInfoEXT* pCreateInfo, const AllocationCallbacks* pAllocator, ValidationCacheEXT* pValidationCache ) const + template + VULKAN_HPP_INLINE Result Device::createValidationCacheEXT( const ValidationCacheCreateInfoEXT* pCreateInfo, const AllocationCallbacks* pAllocator, ValidationCacheEXT* pValidationCache, Dispatch const &d) const { - return static_cast( vkCreateValidationCacheEXT( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pValidationCache ) ) ); + return static_cast( d.vkCreateValidationCacheEXT( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pValidationCache ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::createValidationCacheEXT( const ValidationCacheCreateInfoEXT & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createValidationCacheEXT( const ValidationCacheCreateInfoEXT & createInfo, Optional allocator, Dispatch const &d ) const { ValidationCacheEXT validationCache; - Result result = static_cast( vkCreateValidationCacheEXT( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &validationCache ) ) ); - return createResultValue( result, validationCache, "VULKAN_HPP_NAMESPACE::Device::createValidationCacheEXT" ); + Result result = static_cast( d.vkCreateValidationCacheEXT( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &validationCache ) ) ); + return createResultValue( result, validationCache, VULKAN_HPP_NAMESPACE_STRING"::Device::createValidationCacheEXT" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueValidationCacheEXT Device::createValidationCacheEXTUnique( const ValidationCacheCreateInfoEXT & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Device::createValidationCacheEXTUnique( const ValidationCacheCreateInfoEXT & createInfo, Optional allocator, Dispatch const &d ) const { - ValidationCacheEXTDeleter deleter( *this, allocator ); - return UniqueValidationCacheEXT( createValidationCacheEXT( createInfo, allocator ), deleter ); + ValidationCacheEXT validationCache; + Result result = static_cast( d.vkCreateValidationCacheEXT( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &validationCache ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, validationCache, VULKAN_HPP_NAMESPACE_STRING"::Device::createValidationCacheEXTUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Device::destroyValidationCacheEXT( ValidationCacheEXT validationCache, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Device::destroyValidationCacheEXT( ValidationCacheEXT validationCache, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyValidationCacheEXT( m_device, static_cast( validationCache ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Device::destroyValidationCacheEXT( ValidationCacheEXT validationCache, Optional allocator, Dispatch const &d ) const + { + 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( ValidationCacheEXT validationCache, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyValidationCacheEXT( m_device, static_cast( validationCache ), reinterpret_cast( pAllocator ) ); + d.vkDestroyValidationCacheEXT( m_device, static_cast( validationCache ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Device::destroyValidationCacheEXT( ValidationCacheEXT validationCache, Optional allocator ) const + template + VULKAN_HPP_INLINE void Device::destroy( ValidationCacheEXT validationCache, Optional allocator, Dispatch const &d ) const { - vkDestroyValidationCacheEXT( m_device, static_cast( validationCache ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyValidationCacheEXT( m_device, static_cast( validationCache ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::getValidationCacheDataEXT( ValidationCacheEXT validationCache, size_t* pDataSize, void* pData ) const + template + VULKAN_HPP_INLINE Result Device::getValidationCacheDataEXT( ValidationCacheEXT validationCache, size_t* pDataSize, void* pData, Dispatch const &d) const { - return static_cast( vkGetValidationCacheDataEXT( m_device, static_cast( validationCache ), pDataSize, pData ) ); + return static_cast( d.vkGetValidationCacheDataEXT( m_device, static_cast( validationCache ), pDataSize, pData ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type Device::getValidationCacheDataEXT( ValidationCacheEXT validationCache ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::getValidationCacheDataEXT( ValidationCacheEXT validationCache, Dispatch const &d ) const { std::vector data; size_t dataSize; Result result; do { - result = static_cast( vkGetValidationCacheDataEXT( m_device, static_cast( validationCache ), &dataSize, nullptr ) ); + result = static_cast( d.vkGetValidationCacheDataEXT( m_device, static_cast( validationCache ), &dataSize, nullptr ) ); if ( ( result == Result::eSuccess ) && dataSize ) { data.resize( dataSize ); - result = static_cast( vkGetValidationCacheDataEXT( m_device, static_cast( validationCache ), &dataSize, reinterpret_cast( data.data() ) ) ); + result = static_cast( d.vkGetValidationCacheDataEXT( m_device, static_cast( validationCache ), &dataSize, reinterpret_cast( data.data() ) ) ); } } while ( result == Result::eIncomplete ); - assert( dataSize <= data.size() ); + VULKAN_HPP_ASSERT( dataSize <= data.size() ); data.resize( dataSize ); - return createResultValue( result, data, "VULKAN_HPP_NAMESPACE::Device::getValidationCacheDataEXT" ); + return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING"::Device::getValidationCacheDataEXT" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE Result Device::mergeValidationCachesEXT( ValidationCacheEXT dstCache, uint32_t srcCacheCount, const ValidationCacheEXT* pSrcCaches, Dispatch const &d) const + { + return static_cast( d.vkMergeValidationCachesEXT( m_device, static_cast( dstCache ), srcCacheCount, reinterpret_cast( pSrcCaches ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE ResultValueType::type Device::mergeValidationCachesEXT( ValidationCacheEXT dstCache, ArrayProxy srcCaches, Dispatch const &d ) const + { + Result result = static_cast( d.vkMergeValidationCachesEXT( m_device, static_cast( dstCache ), srcCaches.size() , reinterpret_cast( srcCaches.data() ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::mergeValidationCachesEXT" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE void Device::getDescriptorSetLayoutSupport( const DescriptorSetLayoutCreateInfo* pCreateInfo, DescriptorSetLayoutSupport* pSupport, Dispatch const &d) const + { + d.vkGetDescriptorSetLayoutSupport( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pSupport ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE DescriptorSetLayoutSupport Device::getDescriptorSetLayoutSupport( const DescriptorSetLayoutCreateInfo & createInfo, Dispatch const &d ) const + { + DescriptorSetLayoutSupport support; + d.vkGetDescriptorSetLayoutSupport( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &support ) ); + return support; + } + template + VULKAN_HPP_INLINE StructureChain Device::getDescriptorSetLayoutSupport( const DescriptorSetLayoutCreateInfo & createInfo, Dispatch const &d ) const + { + StructureChain structureChain; + DescriptorSetLayoutSupport& support = structureChain.template get(); + d.vkGetDescriptorSetLayoutSupport( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &support ) ); + return structureChain; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::mergeValidationCachesEXT( ValidationCacheEXT dstCache, uint32_t srcCacheCount, const ValidationCacheEXT* pSrcCaches ) const + template + VULKAN_HPP_INLINE void Device::getDescriptorSetLayoutSupportKHR( const DescriptorSetLayoutCreateInfo* pCreateInfo, DescriptorSetLayoutSupport* pSupport, Dispatch const &d) const { - return static_cast( vkMergeValidationCachesEXT( m_device, static_cast( dstCache ), srcCacheCount, reinterpret_cast( pSrcCaches ) ) ); + d.vkGetDescriptorSetLayoutSupportKHR( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pSupport ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Device::mergeValidationCachesEXT( ValidationCacheEXT dstCache, ArrayProxy srcCaches ) const + template + VULKAN_HPP_INLINE DescriptorSetLayoutSupport Device::getDescriptorSetLayoutSupportKHR( const DescriptorSetLayoutCreateInfo & createInfo, Dispatch const &d ) const + { + DescriptorSetLayoutSupport support; + d.vkGetDescriptorSetLayoutSupportKHR( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &support ) ); + return support; + } + template + VULKAN_HPP_INLINE StructureChain Device::getDescriptorSetLayoutSupportKHR( const DescriptorSetLayoutCreateInfo & createInfo, Dispatch const &d ) const { - Result result = static_cast( vkMergeValidationCachesEXT( m_device, static_cast( dstCache ), srcCaches.size() , reinterpret_cast( srcCaches.data() ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::Device::mergeValidationCachesEXT" ); + StructureChain structureChain; + DescriptorSetLayoutSupport& support = structureChain.template get(); + d.vkGetDescriptorSetLayoutSupportKHR( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &support ) ); + return structureChain; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Device::getShaderInfoAMD( Pipeline pipeline, ShaderStageFlagBits shaderStage, ShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo ) const + template + VULKAN_HPP_INLINE Result Device::getShaderInfoAMD( Pipeline pipeline, ShaderStageFlagBits shaderStage, ShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo, Dispatch const &d) const { - return static_cast( vkGetShaderInfoAMD( m_device, static_cast( pipeline ), static_cast( shaderStage ), static_cast( infoType ), pInfoSize, pInfo ) ); + 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_INLINE typename ResultValueType>::type Device::getShaderInfoAMD( Pipeline pipeline, ShaderStageFlagBits shaderStage, ShaderInfoTypeAMD infoType ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::getShaderInfoAMD( Pipeline pipeline, ShaderStageFlagBits shaderStage, ShaderInfoTypeAMD infoType, Dispatch const &d ) const { std::vector info; size_t infoSize; Result result; do { - result = static_cast( vkGetShaderInfoAMD( m_device, static_cast( pipeline ), static_cast( shaderStage ), static_cast( infoType ), &infoSize, nullptr ) ); + result = static_cast( d.vkGetShaderInfoAMD( m_device, static_cast( pipeline ), static_cast( shaderStage ), static_cast( infoType ), &infoSize, nullptr ) ); if ( ( result == Result::eSuccess ) && infoSize ) { info.resize( infoSize ); - result = static_cast( vkGetShaderInfoAMD( m_device, static_cast( pipeline ), static_cast( shaderStage ), static_cast( infoType ), &infoSize, reinterpret_cast( info.data() ) ) ); + result = static_cast( d.vkGetShaderInfoAMD( m_device, static_cast( pipeline ), static_cast( shaderStage ), static_cast( infoType ), &infoSize, reinterpret_cast( info.data() ) ) ); } } while ( result == Result::eIncomplete ); - assert( infoSize <= info.size() ); + VULKAN_HPP_ASSERT( infoSize <= info.size() ); info.resize( infoSize ); - return createResultValue( result, info, "VULKAN_HPP_NAMESPACE::Device::getShaderInfoAMD" ); + return createResultValue( result, info, VULKAN_HPP_NAMESPACE_STRING"::Device::getShaderInfoAMD" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE Result Device::setDebugUtilsObjectNameEXT( const DebugUtilsObjectNameInfoEXT* pNameInfo, Dispatch const &d) const + { + return static_cast( d.vkSetDebugUtilsObjectNameEXT( m_device, reinterpret_cast( pNameInfo ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE ResultValueType::type Device::setDebugUtilsObjectNameEXT( const DebugUtilsObjectNameInfoEXT & nameInfo, Dispatch const &d ) const + { + Result result = static_cast( d.vkSetDebugUtilsObjectNameEXT( m_device, reinterpret_cast( &nameInfo ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::setDebugUtilsObjectNameEXT" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE Result Device::setDebugUtilsObjectTagEXT( const DebugUtilsObjectTagInfoEXT* pTagInfo, Dispatch const &d) const + { + return static_cast( d.vkSetDebugUtilsObjectTagEXT( m_device, reinterpret_cast( pTagInfo ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE ResultValueType::type Device::setDebugUtilsObjectTagEXT( const DebugUtilsObjectTagInfoEXT & tagInfo, Dispatch const &d ) const + { + Result result = static_cast( d.vkSetDebugUtilsObjectTagEXT( m_device, reinterpret_cast( &tagInfo ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::Device::setDebugUtilsObjectTagEXT" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE Result Device::getMemoryHostPointerPropertiesEXT( ExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer, MemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties, Dispatch const &d) const + { + return static_cast( d.vkGetMemoryHostPointerPropertiesEXT( m_device, static_cast( handleType ), pHostPointer, reinterpret_cast( pMemoryHostPointerProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE ResultValueType::type Device::getMemoryHostPointerPropertiesEXT( ExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer, Dispatch const &d ) const + { + MemoryHostPointerPropertiesEXT memoryHostPointerProperties; + Result result = static_cast( d.vkGetMemoryHostPointerPropertiesEXT( m_device, static_cast( handleType ), pHostPointer, reinterpret_cast( &memoryHostPointerProperties ) ) ); + return createResultValue( result, memoryHostPointerProperties, VULKAN_HPP_NAMESPACE_STRING"::Device::getMemoryHostPointerPropertiesEXT" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + template + VULKAN_HPP_INLINE Result Device::getAndroidHardwareBufferPropertiesANDROID( const struct AHardwareBuffer* buffer, AndroidHardwareBufferPropertiesANDROID* pProperties, Dispatch const &d) const + { + return static_cast( d.vkGetAndroidHardwareBufferPropertiesANDROID( m_device, buffer, reinterpret_cast( pProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE ResultValueType::type Device::getAndroidHardwareBufferPropertiesANDROID( const struct AHardwareBuffer & buffer, Dispatch const &d ) const + { + AndroidHardwareBufferPropertiesANDROID properties; + Result result = static_cast( d.vkGetAndroidHardwareBufferPropertiesANDROID( m_device, buffer, reinterpret_cast( &properties ) ) ); + return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::Device::getAndroidHardwareBufferPropertiesANDROID" ); + } + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::getAndroidHardwareBufferPropertiesANDROID( const struct AHardwareBuffer & buffer, Dispatch const &d ) const + { + StructureChain structureChain; + AndroidHardwareBufferPropertiesANDROID& properties = structureChain.template get(); + Result result = static_cast( d.vkGetAndroidHardwareBufferPropertiesANDROID( m_device, buffer, reinterpret_cast( &properties ) ) ); + return createResultValue( result, structureChain, VULKAN_HPP_NAMESPACE_STRING"::Device::getAndroidHardwareBufferPropertiesANDROID" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ + +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + template + VULKAN_HPP_INLINE Result Device::getMemoryAndroidHardwareBufferANDROID( const MemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer, Dispatch const &d) const + { + return static_cast( d.vkGetMemoryAndroidHardwareBufferANDROID( m_device, reinterpret_cast( pInfo ), pBuffer ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE ResultValueType::type Device::getMemoryAndroidHardwareBufferANDROID( const MemoryGetAndroidHardwareBufferInfoANDROID & info, Dispatch const &d ) const + { + struct AHardwareBuffer* buffer; + Result result = static_cast( d.vkGetMemoryAndroidHardwareBufferANDROID( m_device, reinterpret_cast( &info ), &buffer ) ); + return createResultValue( result, buffer, VULKAN_HPP_NAMESPACE_STRING"::Device::getMemoryAndroidHardwareBufferANDROID" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ #ifndef VULKAN_HPP_NO_SMART_HANDLE - class DeviceDeleter; - using UniqueDevice = UniqueHandle; + + template <> class UniqueHandleTraits {public: using deleter = ObjectDestroy; }; + using UniqueDevice = UniqueHandle; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ class PhysicalDevice { public: - PhysicalDevice() + VULKAN_HPP_CONSTEXPR PhysicalDevice() : m_physicalDevice(VK_NULL_HANDLE) {} - PhysicalDevice( std::nullptr_t ) + VULKAN_HPP_CONSTEXPR PhysicalDevice( std::nullptr_t ) : m_physicalDevice(VK_NULL_HANDLE) {} VULKAN_HPP_TYPESAFE_EXPLICIT PhysicalDevice( VkPhysicalDevice physicalDevice ) - : m_physicalDevice( physicalDevice ) + : m_physicalDevice( physicalDevice ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -30149,266 +35818,418 @@ return m_physicalDevice < rhs.m_physicalDevice; } - void getProperties( PhysicalDeviceProperties* pProperties ) const; + template + void getProperties( PhysicalDeviceProperties* pProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - PhysicalDeviceProperties getProperties() const; + template + PhysicalDeviceProperties getProperties(Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getQueueFamilyProperties( uint32_t* pQueueFamilyPropertyCount, QueueFamilyProperties* pQueueFamilyProperties ) const; + template + void getQueueFamilyProperties( uint32_t* pQueueFamilyPropertyCount, QueueFamilyProperties* pQueueFamilyProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - std::vector getQueueFamilyProperties() const; + template , typename Dispatch = DispatchLoaderStatic> + std::vector getQueueFamilyProperties(Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getMemoryProperties( PhysicalDeviceMemoryProperties* pMemoryProperties ) const; + template + void getMemoryProperties( PhysicalDeviceMemoryProperties* pMemoryProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - PhysicalDeviceMemoryProperties getMemoryProperties() const; + template + PhysicalDeviceMemoryProperties getMemoryProperties(Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getFeatures( PhysicalDeviceFeatures* pFeatures ) const; + template + void getFeatures( PhysicalDeviceFeatures* pFeatures, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - PhysicalDeviceFeatures getFeatures() const; + template + PhysicalDeviceFeatures getFeatures(Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getFormatProperties( Format format, FormatProperties* pFormatProperties ) const; + template + void getFormatProperties( Format format, FormatProperties* pFormatProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - FormatProperties getFormatProperties( Format format ) const; + template + FormatProperties getFormatProperties( Format format, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getImageFormatProperties( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ImageFormatProperties* pImageFormatProperties ) const; + template + Result getImageFormatProperties( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ImageFormatProperties* pImageFormatProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getImageFormatProperties( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags ) const; + template + ResultValueType::type getImageFormatProperties( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createDevice( const DeviceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Device* pDevice ) const; + template + Result createDevice( const DeviceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Device* pDevice, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createDevice( const DeviceCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createDevice( const DeviceCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueDevice createDeviceUnique( const DeviceCreateInfo & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createDeviceUnique( const DeviceCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result enumerateDeviceLayerProperties( uint32_t* pPropertyCount, LayerProperties* pProperties ) const; + template + Result enumerateDeviceLayerProperties( uint32_t* pPropertyCount, LayerProperties* pProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type enumerateDeviceLayerProperties() const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type enumerateDeviceLayerProperties(Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result enumerateDeviceExtensionProperties( const char* pLayerName, uint32_t* pPropertyCount, ExtensionProperties* pProperties ) const; + template + Result enumerateDeviceExtensionProperties( const char* pLayerName, uint32_t* pPropertyCount, ExtensionProperties* pProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type enumerateDeviceExtensionProperties( Optional layerName = nullptr ) const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type enumerateDeviceExtensionProperties( Optional layerName = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getSparseImageFormatProperties( Format format, ImageType type, SampleCountFlagBits samples, ImageUsageFlags usage, ImageTiling tiling, uint32_t* pPropertyCount, SparseImageFormatProperties* pProperties ) const; + template + void getSparseImageFormatProperties( Format format, ImageType type, SampleCountFlagBits samples, ImageUsageFlags usage, ImageTiling tiling, uint32_t* pPropertyCount, SparseImageFormatProperties* pProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - std::vector getSparseImageFormatProperties( Format format, ImageType type, SampleCountFlagBits samples, ImageUsageFlags usage, ImageTiling tiling ) const; + template , typename Dispatch = DispatchLoaderStatic> + std::vector getSparseImageFormatProperties( Format format, ImageType type, SampleCountFlagBits samples, ImageUsageFlags usage, ImageTiling tiling, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getDisplayPropertiesKHR( uint32_t* pPropertyCount, DisplayPropertiesKHR* pProperties ) const; + template + Result getDisplayPropertiesKHR( uint32_t* pPropertyCount, DisplayPropertiesKHR* pProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getDisplayPropertiesKHR() const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type getDisplayPropertiesKHR(Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getDisplayPlanePropertiesKHR( uint32_t* pPropertyCount, DisplayPlanePropertiesKHR* pProperties ) const; + template + Result getDisplayPlanePropertiesKHR( uint32_t* pPropertyCount, DisplayPlanePropertiesKHR* pProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getDisplayPlanePropertiesKHR() const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type getDisplayPlanePropertiesKHR(Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, uint32_t* pDisplayCount, DisplayKHR* pDisplays ) const; + template + Result getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, uint32_t* pDisplayCount, DisplayKHR* pDisplays, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex ) const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getDisplayModePropertiesKHR( DisplayKHR display, uint32_t* pPropertyCount, DisplayModePropertiesKHR* pProperties ) const; + template + Result getDisplayModePropertiesKHR( DisplayKHR display, uint32_t* pPropertyCount, DisplayModePropertiesKHR* pProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getDisplayModePropertiesKHR( DisplayKHR display ) const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type getDisplayModePropertiesKHR( DisplayKHR display, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createDisplayModeKHR( DisplayKHR display, const DisplayModeCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, DisplayModeKHR* pMode ) const; + template + Result createDisplayModeKHR( DisplayKHR display, const DisplayModeCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, DisplayModeKHR* pMode, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createDisplayModeKHR( DisplayKHR display, const DisplayModeCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createDisplayModeKHR( DisplayKHR display, const DisplayModeCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getDisplayPlaneCapabilitiesKHR( DisplayModeKHR mode, uint32_t planeIndex, DisplayPlaneCapabilitiesKHR* pCapabilities ) const; + template + Result getDisplayPlaneCapabilitiesKHR( DisplayModeKHR mode, uint32_t planeIndex, DisplayPlaneCapabilitiesKHR* pCapabilities, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getDisplayPlaneCapabilitiesKHR( DisplayModeKHR mode, uint32_t planeIndex ) const; + template + ResultValueType::type getDisplayPlaneCapabilitiesKHR( DisplayModeKHR mode, uint32_t planeIndex, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_MIR_KHR - Bool32 getMirPresentationSupportKHR( uint32_t queueFamilyIndex, MirConnection* connection ) const; + template + Bool32 getMirPresentationSupportKHR( uint32_t queueFamilyIndex, MirConnection* connection, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - Bool32 getMirPresentationSupportKHR( uint32_t queueFamilyIndex, MirConnection & connection ) const; + template + Bool32 getMirPresentationSupportKHR( uint32_t queueFamilyIndex, MirConnection & connection, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_MIR_KHR*/ - Result getSurfaceSupportKHR( uint32_t queueFamilyIndex, SurfaceKHR surface, Bool32* pSupported ) const; + template + Result getSurfaceSupportKHR( uint32_t queueFamilyIndex, SurfaceKHR surface, Bool32* pSupported, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getSurfaceSupportKHR( uint32_t queueFamilyIndex, SurfaceKHR surface ) const; + template + ResultValueType::type getSurfaceSupportKHR( uint32_t queueFamilyIndex, SurfaceKHR surface, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getSurfaceCapabilitiesKHR( SurfaceKHR surface, SurfaceCapabilitiesKHR* pSurfaceCapabilities ) const; + template + Result getSurfaceCapabilitiesKHR( SurfaceKHR surface, SurfaceCapabilitiesKHR* pSurfaceCapabilities, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getSurfaceCapabilitiesKHR( SurfaceKHR surface ) const; + template + ResultValueType::type getSurfaceCapabilitiesKHR( SurfaceKHR surface, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getSurfaceFormatsKHR( SurfaceKHR surface, uint32_t* pSurfaceFormatCount, SurfaceFormatKHR* pSurfaceFormats ) const; + template + Result getSurfaceFormatsKHR( SurfaceKHR surface, uint32_t* pSurfaceFormatCount, SurfaceFormatKHR* pSurfaceFormats, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getSurfaceFormatsKHR( SurfaceKHR surface ) const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type getSurfaceFormatsKHR( SurfaceKHR surface, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getSurfacePresentModesKHR( SurfaceKHR surface, uint32_t* pPresentModeCount, PresentModeKHR* pPresentModes ) const; + template + Result getSurfacePresentModesKHR( SurfaceKHR surface, uint32_t* pPresentModeCount, PresentModeKHR* pPresentModes, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getSurfacePresentModesKHR( SurfaceKHR surface ) const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type getSurfacePresentModesKHR( SurfaceKHR surface, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_WAYLAND_KHR - Bool32 getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, struct wl_display* display ) const; + template + Bool32 getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, struct wl_display* display, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - Bool32 getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, struct wl_display & display ) const; + template + Bool32 getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, struct wl_display & display, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ #ifdef VK_USE_PLATFORM_WIN32_KHR - Bool32 getWin32PresentationSupportKHR( uint32_t queueFamilyIndex ) const; + template + Bool32 getWin32PresentationSupportKHR( uint32_t queueFamilyIndex, Dispatch const &d = Dispatch() ) const; #endif /*VK_USE_PLATFORM_WIN32_KHR*/ #ifdef VK_USE_PLATFORM_XLIB_KHR - Bool32 getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, Display* dpy, VisualID visualID ) const; + template + Bool32 getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, Display* dpy, VisualID visualID, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - Bool32 getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, Display & dpy, VisualID visualID ) const; + template + Bool32 getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, Display & dpy, VisualID visualID, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_XLIB_KHR*/ #ifdef VK_USE_PLATFORM_XCB_KHR - Bool32 getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id ) const; + template + Bool32 getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - Bool32 getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, xcb_connection_t & connection, xcb_visualid_t visual_id ) const; + template + Bool32 getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, xcb_connection_t & connection, xcb_visualid_t visual_id, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_XCB_KHR*/ - Result getExternalImageFormatPropertiesNV( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ExternalMemoryHandleTypeFlagsNV externalHandleType, ExternalImageFormatPropertiesNV* pExternalImageFormatProperties ) const; + template + Result getExternalImageFormatPropertiesNV( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ExternalMemoryHandleTypeFlagsNV externalHandleType, ExternalImageFormatPropertiesNV* pExternalImageFormatProperties, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type getExternalImageFormatPropertiesNV( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ExternalMemoryHandleTypeFlagsNV externalHandleType, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + void getGeneratedCommandsPropertiesNVX( DeviceGeneratedCommandsFeaturesNVX* pFeatures, DeviceGeneratedCommandsLimitsNVX* pLimits, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + DeviceGeneratedCommandsLimitsNVX getGeneratedCommandsPropertiesNVX( DeviceGeneratedCommandsFeaturesNVX & features, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + void getFeatures2( PhysicalDeviceFeatures2* pFeatures, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + PhysicalDeviceFeatures2 getFeatures2(Dispatch const &d = Dispatch() ) const; + template + StructureChain getFeatures2(Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + void getFeatures2KHR( PhysicalDeviceFeatures2* pFeatures, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + PhysicalDeviceFeatures2 getFeatures2KHR(Dispatch const &d = Dispatch() ) const; + template + StructureChain getFeatures2KHR(Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + void getProperties2( PhysicalDeviceProperties2* pProperties, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + PhysicalDeviceProperties2 getProperties2(Dispatch const &d = Dispatch() ) const; + template + StructureChain getProperties2(Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + void getProperties2KHR( PhysicalDeviceProperties2* pProperties, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + PhysicalDeviceProperties2 getProperties2KHR(Dispatch const &d = Dispatch() ) const; + template + StructureChain getProperties2KHR(Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + void getFormatProperties2( Format format, FormatProperties2* pFormatProperties, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + FormatProperties2 getFormatProperties2( Format format, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + void getFormatProperties2KHR( Format format, FormatProperties2* pFormatProperties, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + FormatProperties2 getFormatProperties2KHR( Format format, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + Result getImageFormatProperties2( const PhysicalDeviceImageFormatInfo2* pImageFormatInfo, ImageFormatProperties2* pImageFormatProperties, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type getImageFormatProperties2( const PhysicalDeviceImageFormatInfo2 & imageFormatInfo, Dispatch const &d = Dispatch() ) const; + template + typename ResultValueType>::type getImageFormatProperties2( const PhysicalDeviceImageFormatInfo2 & imageFormatInfo, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + Result getImageFormatProperties2KHR( const PhysicalDeviceImageFormatInfo2* pImageFormatInfo, ImageFormatProperties2* pImageFormatProperties, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type getImageFormatProperties2KHR( const PhysicalDeviceImageFormatInfo2 & imageFormatInfo, Dispatch const &d = Dispatch() ) const; + template + typename ResultValueType>::type getImageFormatProperties2KHR( const PhysicalDeviceImageFormatInfo2 & imageFormatInfo, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + void getQueueFamilyProperties2( uint32_t* pQueueFamilyPropertyCount, QueueFamilyProperties2* pQueueFamilyProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getExternalImageFormatPropertiesNV( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ExternalMemoryHandleTypeFlagsNV externalHandleType ) const; + template , typename Dispatch = DispatchLoaderStatic> + std::vector getQueueFamilyProperties2(Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getGeneratedCommandsPropertiesNVX( DeviceGeneratedCommandsFeaturesNVX* pFeatures, DeviceGeneratedCommandsLimitsNVX* pLimits ) const; + template + void getQueueFamilyProperties2KHR( uint32_t* pQueueFamilyPropertyCount, QueueFamilyProperties2* pQueueFamilyProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - DeviceGeneratedCommandsLimitsNVX getGeneratedCommandsPropertiesNVX( DeviceGeneratedCommandsFeaturesNVX & features ) const; + template , typename Dispatch = DispatchLoaderStatic> + std::vector getQueueFamilyProperties2KHR(Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getFeatures2KHR( PhysicalDeviceFeatures2KHR* pFeatures ) const; + template + void getMemoryProperties2( PhysicalDeviceMemoryProperties2* pMemoryProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - PhysicalDeviceFeatures2KHR getFeatures2KHR() const; - template - StructureChain getFeatures2KHR() const; + template + PhysicalDeviceMemoryProperties2 getMemoryProperties2(Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getProperties2KHR( PhysicalDeviceProperties2KHR* pProperties ) const; + template + void getMemoryProperties2KHR( PhysicalDeviceMemoryProperties2* pMemoryProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - PhysicalDeviceProperties2KHR getProperties2KHR() const; - template - StructureChain getProperties2KHR() const; + template + PhysicalDeviceMemoryProperties2 getMemoryProperties2KHR(Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getFormatProperties2KHR( Format format, FormatProperties2KHR* pFormatProperties ) const; + template + void getSparseImageFormatProperties2( const PhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, SparseImageFormatProperties2* pProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - FormatProperties2KHR getFormatProperties2KHR( Format format ) const; + template , typename Dispatch = DispatchLoaderStatic> + std::vector getSparseImageFormatProperties2( const PhysicalDeviceSparseImageFormatInfo2 & formatInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getImageFormatProperties2KHR( const PhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo, ImageFormatProperties2KHR* pImageFormatProperties ) const; + template + void getSparseImageFormatProperties2KHR( const PhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, SparseImageFormatProperties2* pProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getImageFormatProperties2KHR( const PhysicalDeviceImageFormatInfo2KHR & imageFormatInfo ) const; - template - typename ResultValueType>::type getImageFormatProperties2KHR( const PhysicalDeviceImageFormatInfo2KHR & imageFormatInfo ) const; + template , typename Dispatch = DispatchLoaderStatic> + std::vector getSparseImageFormatProperties2KHR( const PhysicalDeviceSparseImageFormatInfo2 & formatInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getQueueFamilyProperties2KHR( uint32_t* pQueueFamilyPropertyCount, QueueFamilyProperties2KHR* pQueueFamilyProperties ) const; + template + void getExternalBufferProperties( const PhysicalDeviceExternalBufferInfo* pExternalBufferInfo, ExternalBufferProperties* pExternalBufferProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - std::vector getQueueFamilyProperties2KHR() const; + template + ExternalBufferProperties getExternalBufferProperties( const PhysicalDeviceExternalBufferInfo & externalBufferInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getMemoryProperties2KHR( PhysicalDeviceMemoryProperties2KHR* pMemoryProperties ) const; + template + void getExternalBufferPropertiesKHR( const PhysicalDeviceExternalBufferInfo* pExternalBufferInfo, ExternalBufferProperties* pExternalBufferProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - PhysicalDeviceMemoryProperties2KHR getMemoryProperties2KHR() const; + template + ExternalBufferProperties getExternalBufferPropertiesKHR( const PhysicalDeviceExternalBufferInfo & externalBufferInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getSparseImageFormatProperties2KHR( const PhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo, uint32_t* pPropertyCount, SparseImageFormatProperties2KHR* pProperties ) const; + template + void getExternalSemaphoreProperties( const PhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, ExternalSemaphoreProperties* pExternalSemaphoreProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - std::vector getSparseImageFormatProperties2KHR( const PhysicalDeviceSparseImageFormatInfo2KHR & formatInfo ) const; + template + ExternalSemaphoreProperties getExternalSemaphoreProperties( const PhysicalDeviceExternalSemaphoreInfo & externalSemaphoreInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getExternalBufferPropertiesKHR( const PhysicalDeviceExternalBufferInfoKHR* pExternalBufferInfo, ExternalBufferPropertiesKHR* pExternalBufferProperties ) const; + template + void getExternalSemaphorePropertiesKHR( const PhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, ExternalSemaphoreProperties* pExternalSemaphoreProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ExternalBufferPropertiesKHR getExternalBufferPropertiesKHR( const PhysicalDeviceExternalBufferInfoKHR & externalBufferInfo ) const; + template + ExternalSemaphoreProperties getExternalSemaphorePropertiesKHR( const PhysicalDeviceExternalSemaphoreInfo & externalSemaphoreInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getExternalSemaphorePropertiesKHR( const PhysicalDeviceExternalSemaphoreInfoKHR* pExternalSemaphoreInfo, ExternalSemaphorePropertiesKHR* pExternalSemaphoreProperties ) const; + template + void getExternalFenceProperties( const PhysicalDeviceExternalFenceInfo* pExternalFenceInfo, ExternalFenceProperties* pExternalFenceProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ExternalSemaphorePropertiesKHR getExternalSemaphorePropertiesKHR( const PhysicalDeviceExternalSemaphoreInfoKHR & externalSemaphoreInfo ) const; + template + ExternalFenceProperties getExternalFenceProperties( const PhysicalDeviceExternalFenceInfo & externalFenceInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getExternalFencePropertiesKHR( const PhysicalDeviceExternalFenceInfoKHR* pExternalFenceInfo, ExternalFencePropertiesKHR* pExternalFenceProperties ) const; + template + void getExternalFencePropertiesKHR( const PhysicalDeviceExternalFenceInfo* pExternalFenceInfo, ExternalFenceProperties* pExternalFenceProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ExternalFencePropertiesKHR getExternalFencePropertiesKHR( const PhysicalDeviceExternalFenceInfoKHR & externalFenceInfo ) const; + template + ExternalFenceProperties getExternalFencePropertiesKHR( const PhysicalDeviceExternalFenceInfo & externalFenceInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result releaseDisplayEXT( DisplayKHR display ) const; + template + Result releaseDisplayEXT( DisplayKHR display, Dispatch const &d = Dispatch() ) const; #else - ResultValueType::type releaseDisplayEXT( DisplayKHR display ) const; + template + ResultValueType::type releaseDisplayEXT( DisplayKHR display, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - Result acquireXlibDisplayEXT( Display* dpy, DisplayKHR display ) const; +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_NV + template + Result acquireXlibDisplayEXT( Display* dpy, DisplayKHR display, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type acquireXlibDisplayEXT( DisplayKHR display ) const; + template + ResultValueType::type acquireXlibDisplayEXT( DisplayKHR display, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ +#endif /*VK_USE_PLATFORM_XLIB_XRANDR_NV*/ -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - Result getRandROutputDisplayEXT( Display* dpy, RROutput rrOutput, DisplayKHR* pDisplay ) const; +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_NV + template + Result getRandROutputDisplayEXT( Display* dpy, RROutput rrOutput, DisplayKHR* pDisplay, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getRandROutputDisplayEXT( Display & dpy, RROutput rrOutput ) const; + template + ResultValueType::type getRandROutputDisplayEXT( Display & dpy, RROutput rrOutput, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ +#endif /*VK_USE_PLATFORM_XLIB_XRANDR_NV*/ - Result getSurfaceCapabilities2EXT( SurfaceKHR surface, SurfaceCapabilities2EXT* pSurfaceCapabilities ) const; + template + Result getSurfaceCapabilities2EXT( SurfaceKHR surface, SurfaceCapabilities2EXT* pSurfaceCapabilities, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getSurfaceCapabilities2EXT( SurfaceKHR surface ) const; + template + ResultValueType::type getSurfaceCapabilities2EXT( SurfaceKHR surface, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getPresentRectanglesKHX( SurfaceKHR surface, uint32_t* pRectCount, Rect2D* pRects ) const; + template + Result getPresentRectanglesKHR( SurfaceKHR surface, uint32_t* pRectCount, Rect2D* pRects, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getPresentRectanglesKHX( SurfaceKHR surface ) const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type getPresentRectanglesKHR( SurfaceKHR surface, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getMultisamplePropertiesEXT( SampleCountFlagBits samples, MultisamplePropertiesEXT* pMultisampleProperties ) const; + template + void getMultisamplePropertiesEXT( SampleCountFlagBits samples, MultisamplePropertiesEXT* pMultisampleProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - MultisamplePropertiesEXT getMultisamplePropertiesEXT( SampleCountFlagBits samples ) const; + template + MultisamplePropertiesEXT getMultisamplePropertiesEXT( SampleCountFlagBits samples, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getSurfaceCapabilities2KHR( const PhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, SurfaceCapabilities2KHR* pSurfaceCapabilities ) const; + template + Result getSurfaceCapabilities2KHR( const PhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, SurfaceCapabilities2KHR* pSurfaceCapabilities, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getSurfaceCapabilities2KHR( const PhysicalDeviceSurfaceInfo2KHR & surfaceInfo ) const; - template - typename ResultValueType>::type getSurfaceCapabilities2KHR( const PhysicalDeviceSurfaceInfo2KHR & surfaceInfo ) const; + template + ResultValueType::type getSurfaceCapabilities2KHR( const PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, Dispatch const &d = Dispatch() ) const; + template + typename ResultValueType>::type getSurfaceCapabilities2KHR( const PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getSurfaceFormats2KHR( const PhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pSurfaceFormatCount, SurfaceFormat2KHR* pSurfaceFormats ) const; + template + Result getSurfaceFormats2KHR( const PhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pSurfaceFormatCount, SurfaceFormat2KHR* pSurfaceFormats, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getSurfaceFormats2KHR( const PhysicalDeviceSurfaceInfo2KHR & surfaceInfo ) const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type getSurfaceFormats2KHR( const PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -30434,798 +36255,1045 @@ static_assert( sizeof( PhysicalDevice ) == sizeof( VkPhysicalDevice ), "handle and wrapper have different size!" ); -#ifndef VULKAN_HPP_NO_SMART_HANDLE - class DeviceDeleter - { - public: - DeviceDeleter( Optional allocator = nullptr ) - : m_allocator( allocator ) - {} - - void operator()( Device device ) - { - device.destroy( m_allocator ); - } - - private: - Optional m_allocator; - }; -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ - - VULKAN_HPP_INLINE void PhysicalDevice::getProperties( PhysicalDeviceProperties* pProperties ) const + template + VULKAN_HPP_INLINE void PhysicalDevice::getProperties( PhysicalDeviceProperties* pProperties, Dispatch const &d) const { - vkGetPhysicalDeviceProperties( m_physicalDevice, reinterpret_cast( pProperties ) ); + d.vkGetPhysicalDeviceProperties( m_physicalDevice, reinterpret_cast( pProperties ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE PhysicalDeviceProperties PhysicalDevice::getProperties() const + template + VULKAN_HPP_INLINE PhysicalDeviceProperties PhysicalDevice::getProperties(Dispatch const &d ) const { PhysicalDeviceProperties properties; - vkGetPhysicalDeviceProperties( m_physicalDevice, reinterpret_cast( &properties ) ); + d.vkGetPhysicalDeviceProperties( m_physicalDevice, reinterpret_cast( &properties ) ); return properties; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void PhysicalDevice::getQueueFamilyProperties( uint32_t* pQueueFamilyPropertyCount, QueueFamilyProperties* pQueueFamilyProperties ) const + template + VULKAN_HPP_INLINE void PhysicalDevice::getQueueFamilyProperties( uint32_t* pQueueFamilyPropertyCount, QueueFamilyProperties* pQueueFamilyProperties, Dispatch const &d) const { - vkGetPhysicalDeviceQueueFamilyProperties( m_physicalDevice, pQueueFamilyPropertyCount, reinterpret_cast( pQueueFamilyProperties ) ); + d.vkGetPhysicalDeviceQueueFamilyProperties( m_physicalDevice, pQueueFamilyPropertyCount, reinterpret_cast( pQueueFamilyProperties ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE std::vector PhysicalDevice::getQueueFamilyProperties() const + template + VULKAN_HPP_INLINE std::vector PhysicalDevice::getQueueFamilyProperties(Dispatch const &d ) const { std::vector queueFamilyProperties; uint32_t queueFamilyPropertyCount; - vkGetPhysicalDeviceQueueFamilyProperties( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); + d.vkGetPhysicalDeviceQueueFamilyProperties( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); queueFamilyProperties.resize( queueFamilyPropertyCount ); - vkGetPhysicalDeviceQueueFamilyProperties( m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); + d.vkGetPhysicalDeviceQueueFamilyProperties( m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); return queueFamilyProperties; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void PhysicalDevice::getMemoryProperties( PhysicalDeviceMemoryProperties* pMemoryProperties ) const + template + VULKAN_HPP_INLINE void PhysicalDevice::getMemoryProperties( PhysicalDeviceMemoryProperties* pMemoryProperties, Dispatch const &d) const { - vkGetPhysicalDeviceMemoryProperties( m_physicalDevice, reinterpret_cast( pMemoryProperties ) ); + d.vkGetPhysicalDeviceMemoryProperties( m_physicalDevice, reinterpret_cast( pMemoryProperties ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE PhysicalDeviceMemoryProperties PhysicalDevice::getMemoryProperties() const + template + VULKAN_HPP_INLINE PhysicalDeviceMemoryProperties PhysicalDevice::getMemoryProperties(Dispatch const &d ) const { PhysicalDeviceMemoryProperties memoryProperties; - vkGetPhysicalDeviceMemoryProperties( m_physicalDevice, reinterpret_cast( &memoryProperties ) ); + d.vkGetPhysicalDeviceMemoryProperties( m_physicalDevice, reinterpret_cast( &memoryProperties ) ); return memoryProperties; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void PhysicalDevice::getFeatures( PhysicalDeviceFeatures* pFeatures ) const + template + VULKAN_HPP_INLINE void PhysicalDevice::getFeatures( PhysicalDeviceFeatures* pFeatures, Dispatch const &d) const { - vkGetPhysicalDeviceFeatures( m_physicalDevice, reinterpret_cast( pFeatures ) ); + d.vkGetPhysicalDeviceFeatures( m_physicalDevice, reinterpret_cast( pFeatures ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE PhysicalDeviceFeatures PhysicalDevice::getFeatures() const + template + VULKAN_HPP_INLINE PhysicalDeviceFeatures PhysicalDevice::getFeatures(Dispatch const &d ) const { PhysicalDeviceFeatures features; - vkGetPhysicalDeviceFeatures( m_physicalDevice, reinterpret_cast( &features ) ); + d.vkGetPhysicalDeviceFeatures( m_physicalDevice, reinterpret_cast( &features ) ); return features; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void PhysicalDevice::getFormatProperties( Format format, FormatProperties* pFormatProperties ) const + template + VULKAN_HPP_INLINE void PhysicalDevice::getFormatProperties( Format format, FormatProperties* pFormatProperties, Dispatch const &d) const { - vkGetPhysicalDeviceFormatProperties( m_physicalDevice, static_cast( format ), reinterpret_cast( pFormatProperties ) ); + d.vkGetPhysicalDeviceFormatProperties( m_physicalDevice, static_cast( format ), reinterpret_cast( pFormatProperties ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE FormatProperties PhysicalDevice::getFormatProperties( Format format ) const + template + VULKAN_HPP_INLINE FormatProperties PhysicalDevice::getFormatProperties( Format format, Dispatch const &d ) const { FormatProperties formatProperties; - vkGetPhysicalDeviceFormatProperties( m_physicalDevice, static_cast( format ), reinterpret_cast( &formatProperties ) ); + d.vkGetPhysicalDeviceFormatProperties( m_physicalDevice, static_cast( format ), reinterpret_cast( &formatProperties ) ); return formatProperties; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result PhysicalDevice::getImageFormatProperties( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ImageFormatProperties* pImageFormatProperties ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::getImageFormatProperties( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ImageFormatProperties* pImageFormatProperties, Dispatch const &d) const { - return static_cast( vkGetPhysicalDeviceImageFormatProperties( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( tiling ), static_cast( usage ), static_cast( flags ), reinterpret_cast( pImageFormatProperties ) ) ); + 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 - VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getImageFormatProperties( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags ) const + template + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getImageFormatProperties( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, Dispatch const &d ) const { ImageFormatProperties imageFormatProperties; - Result result = static_cast( vkGetPhysicalDeviceImageFormatProperties( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( tiling ), static_cast( usage ), static_cast( flags ), reinterpret_cast( &imageFormatProperties ) ) ); - return createResultValue( result, imageFormatProperties, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getImageFormatProperties" ); + Result result = static_cast( d.vkGetPhysicalDeviceImageFormatProperties( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( tiling ), static_cast( usage ), static_cast( flags ), reinterpret_cast( &imageFormatProperties ) ) ); + return createResultValue( result, imageFormatProperties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getImageFormatProperties" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result PhysicalDevice::createDevice( const DeviceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Device* pDevice ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::createDevice( const DeviceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Device* pDevice, Dispatch const &d) const { - return static_cast( vkCreateDevice( m_physicalDevice, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pDevice ) ) ); + return static_cast( d.vkCreateDevice( m_physicalDevice, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pDevice ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::createDevice( const DeviceCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::createDevice( const DeviceCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { Device device; - Result result = static_cast( vkCreateDevice( m_physicalDevice, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &device ) ) ); - return createResultValue( result, device, "VULKAN_HPP_NAMESPACE::PhysicalDevice::createDevice" ); + Result result = static_cast( d.vkCreateDevice( m_physicalDevice, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &device ) ) ); + return createResultValue( result, device, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::createDevice" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueDevice PhysicalDevice::createDeviceUnique( const DeviceCreateInfo & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::createDeviceUnique( const DeviceCreateInfo & createInfo, Optional allocator, Dispatch const &d ) const { - DeviceDeleter deleter( allocator ); - return UniqueDevice( createDevice( createInfo, allocator ), deleter ); + Device device; + Result result = static_cast( d.vkCreateDevice( m_physicalDevice, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &device ) ) ); + + ObjectDestroy deleter( allocator ); + return createResultValue( result, device, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::createDeviceUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result PhysicalDevice::enumerateDeviceLayerProperties( uint32_t* pPropertyCount, LayerProperties* pProperties ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::enumerateDeviceLayerProperties( uint32_t* pPropertyCount, LayerProperties* pProperties, Dispatch const &d) const { - return static_cast( vkEnumerateDeviceLayerProperties( m_physicalDevice, pPropertyCount, reinterpret_cast( pProperties ) ) ); + return static_cast( d.vkEnumerateDeviceLayerProperties( m_physicalDevice, pPropertyCount, reinterpret_cast( pProperties ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::enumerateDeviceLayerProperties() const + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::enumerateDeviceLayerProperties(Dispatch const &d ) const { std::vector properties; uint32_t propertyCount; Result result; do { - result = static_cast( vkEnumerateDeviceLayerProperties( m_physicalDevice, &propertyCount, nullptr ) ); + result = static_cast( d.vkEnumerateDeviceLayerProperties( m_physicalDevice, &propertyCount, nullptr ) ); if ( ( result == Result::eSuccess ) && propertyCount ) { properties.resize( propertyCount ); - result = static_cast( vkEnumerateDeviceLayerProperties( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); + result = static_cast( d.vkEnumerateDeviceLayerProperties( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - assert( propertyCount <= properties.size() ); + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); properties.resize( propertyCount ); - return createResultValue( result, properties, "VULKAN_HPP_NAMESPACE::PhysicalDevice::enumerateDeviceLayerProperties" ); + return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::enumerateDeviceLayerProperties" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result PhysicalDevice::enumerateDeviceExtensionProperties( const char* pLayerName, uint32_t* pPropertyCount, ExtensionProperties* pProperties ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::enumerateDeviceExtensionProperties( const char* pLayerName, uint32_t* pPropertyCount, ExtensionProperties* pProperties, Dispatch const &d) const { - return static_cast( vkEnumerateDeviceExtensionProperties( m_physicalDevice, pLayerName, pPropertyCount, reinterpret_cast( pProperties ) ) ); + return static_cast( d.vkEnumerateDeviceExtensionProperties( m_physicalDevice, pLayerName, pPropertyCount, reinterpret_cast( pProperties ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::enumerateDeviceExtensionProperties( Optional layerName ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::enumerateDeviceExtensionProperties( Optional layerName, Dispatch const &d ) const { std::vector properties; uint32_t propertyCount; Result result; do { - result = static_cast( vkEnumerateDeviceExtensionProperties( m_physicalDevice, layerName ? layerName->c_str() : nullptr, &propertyCount, nullptr ) ); + result = static_cast( d.vkEnumerateDeviceExtensionProperties( m_physicalDevice, layerName ? layerName->c_str() : nullptr, &propertyCount, nullptr ) ); if ( ( result == Result::eSuccess ) && propertyCount ) { properties.resize( propertyCount ); - result = static_cast( vkEnumerateDeviceExtensionProperties( m_physicalDevice, layerName ? layerName->c_str() : nullptr, &propertyCount, reinterpret_cast( properties.data() ) ) ); + result = static_cast( d.vkEnumerateDeviceExtensionProperties( m_physicalDevice, layerName ? layerName->c_str() : nullptr, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - assert( propertyCount <= properties.size() ); + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); properties.resize( propertyCount ); - return createResultValue( result, properties, "VULKAN_HPP_NAMESPACE::PhysicalDevice::enumerateDeviceExtensionProperties" ); + return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::enumerateDeviceExtensionProperties" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void PhysicalDevice::getSparseImageFormatProperties( Format format, ImageType type, SampleCountFlagBits samples, ImageUsageFlags usage, ImageTiling tiling, uint32_t* pPropertyCount, SparseImageFormatProperties* pProperties ) const + template + VULKAN_HPP_INLINE void PhysicalDevice::getSparseImageFormatProperties( Format format, ImageType type, SampleCountFlagBits samples, ImageUsageFlags usage, ImageTiling tiling, uint32_t* pPropertyCount, SparseImageFormatProperties* pProperties, Dispatch const &d) const { - vkGetPhysicalDeviceSparseImageFormatProperties( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( samples ), static_cast( usage ), static_cast( tiling ), pPropertyCount, reinterpret_cast( pProperties ) ); + 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_INLINE std::vector PhysicalDevice::getSparseImageFormatProperties( Format format, ImageType type, SampleCountFlagBits samples, ImageUsageFlags usage, ImageTiling tiling ) const + template + VULKAN_HPP_INLINE std::vector PhysicalDevice::getSparseImageFormatProperties( Format format, ImageType type, SampleCountFlagBits samples, ImageUsageFlags usage, ImageTiling tiling, Dispatch const &d ) const { std::vector properties; uint32_t propertyCount; - vkGetPhysicalDeviceSparseImageFormatProperties( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( samples ), static_cast( usage ), static_cast( tiling ), &propertyCount, nullptr ); + d.vkGetPhysicalDeviceSparseImageFormatProperties( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( samples ), static_cast( usage ), static_cast( tiling ), &propertyCount, nullptr ); properties.resize( propertyCount ); - vkGetPhysicalDeviceSparseImageFormatProperties( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( samples ), static_cast( usage ), static_cast( tiling ), &propertyCount, reinterpret_cast( properties.data() ) ); + d.vkGetPhysicalDeviceSparseImageFormatProperties( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( samples ), static_cast( usage ), static_cast( tiling ), &propertyCount, reinterpret_cast( properties.data() ) ); return properties; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayPropertiesKHR( uint32_t* pPropertyCount, DisplayPropertiesKHR* pProperties ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayPropertiesKHR( uint32_t* pPropertyCount, DisplayPropertiesKHR* pProperties, Dispatch const &d) const { - return static_cast( vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, pPropertyCount, reinterpret_cast( pProperties ) ) ); + return static_cast( d.vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, pPropertyCount, reinterpret_cast( pProperties ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getDisplayPropertiesKHR() const + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getDisplayPropertiesKHR(Dispatch const &d ) const { std::vector properties; uint32_t propertyCount; Result result; do { - result = static_cast( vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, &propertyCount, nullptr ) ); + result = static_cast( d.vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, &propertyCount, nullptr ) ); if ( ( result == Result::eSuccess ) && propertyCount ) { properties.resize( propertyCount ); - result = static_cast( vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); + result = static_cast( d.vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - assert( propertyCount <= properties.size() ); + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); properties.resize( propertyCount ); - return createResultValue( result, properties, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getDisplayPropertiesKHR" ); + return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayPropertiesKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayPlanePropertiesKHR( uint32_t* pPropertyCount, DisplayPlanePropertiesKHR* pProperties ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayPlanePropertiesKHR( uint32_t* pPropertyCount, DisplayPlanePropertiesKHR* pProperties, Dispatch const &d) const { - return static_cast( vkGetPhysicalDeviceDisplayPlanePropertiesKHR( m_physicalDevice, pPropertyCount, reinterpret_cast( pProperties ) ) ); + return static_cast( d.vkGetPhysicalDeviceDisplayPlanePropertiesKHR( m_physicalDevice, pPropertyCount, reinterpret_cast( pProperties ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getDisplayPlanePropertiesKHR() const + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getDisplayPlanePropertiesKHR(Dispatch const &d ) const { std::vector properties; uint32_t propertyCount; Result result; do { - result = static_cast( vkGetPhysicalDeviceDisplayPlanePropertiesKHR( m_physicalDevice, &propertyCount, nullptr ) ); + result = static_cast( d.vkGetPhysicalDeviceDisplayPlanePropertiesKHR( m_physicalDevice, &propertyCount, nullptr ) ); if ( ( result == Result::eSuccess ) && propertyCount ) { properties.resize( propertyCount ); - result = static_cast( vkGetPhysicalDeviceDisplayPlanePropertiesKHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); + result = static_cast( d.vkGetPhysicalDeviceDisplayPlanePropertiesKHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - assert( propertyCount <= properties.size() ); + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); properties.resize( propertyCount ); - return createResultValue( result, properties, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getDisplayPlanePropertiesKHR" ); + return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayPlanePropertiesKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, uint32_t* pDisplayCount, DisplayKHR* pDisplays ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, uint32_t* pDisplayCount, DisplayKHR* pDisplays, Dispatch const &d) const { - return static_cast( vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, pDisplayCount, reinterpret_cast( pDisplays ) ) ); + return static_cast( d.vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, pDisplayCount, reinterpret_cast( pDisplays ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, Dispatch const &d ) const { std::vector displays; uint32_t displayCount; Result result; do { - result = static_cast( vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, &displayCount, nullptr ) ); + result = static_cast( d.vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, &displayCount, nullptr ) ); if ( ( result == Result::eSuccess ) && displayCount ) { displays.resize( displayCount ); - result = static_cast( vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, &displayCount, reinterpret_cast( displays.data() ) ) ); + result = static_cast( d.vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, &displayCount, reinterpret_cast( displays.data() ) ) ); } } while ( result == Result::eIncomplete ); - assert( displayCount <= displays.size() ); + VULKAN_HPP_ASSERT( displayCount <= displays.size() ); displays.resize( displayCount ); - return createResultValue( result, displays, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR" ); + return createResultValue( result, displays, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayModePropertiesKHR( DisplayKHR display, uint32_t* pPropertyCount, DisplayModePropertiesKHR* pProperties ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayModePropertiesKHR( DisplayKHR display, uint32_t* pPropertyCount, DisplayModePropertiesKHR* pProperties, Dispatch const &d) const { - return static_cast( vkGetDisplayModePropertiesKHR( m_physicalDevice, static_cast( display ), pPropertyCount, reinterpret_cast( pProperties ) ) ); + return static_cast( d.vkGetDisplayModePropertiesKHR( m_physicalDevice, static_cast( display ), pPropertyCount, reinterpret_cast( pProperties ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getDisplayModePropertiesKHR( DisplayKHR display ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getDisplayModePropertiesKHR( DisplayKHR display, Dispatch const &d ) const { std::vector properties; uint32_t propertyCount; Result result; do { - result = static_cast( vkGetDisplayModePropertiesKHR( m_physicalDevice, static_cast( display ), &propertyCount, nullptr ) ); + result = static_cast( d.vkGetDisplayModePropertiesKHR( m_physicalDevice, static_cast( display ), &propertyCount, nullptr ) ); if ( ( result == Result::eSuccess ) && propertyCount ) { properties.resize( propertyCount ); - result = static_cast( vkGetDisplayModePropertiesKHR( m_physicalDevice, static_cast( display ), &propertyCount, reinterpret_cast( properties.data() ) ) ); + result = static_cast( d.vkGetDisplayModePropertiesKHR( m_physicalDevice, static_cast( display ), &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - assert( propertyCount <= properties.size() ); + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); properties.resize( propertyCount ); - return createResultValue( result, properties, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getDisplayModePropertiesKHR" ); + return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayModePropertiesKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result PhysicalDevice::createDisplayModeKHR( DisplayKHR display, const DisplayModeCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, DisplayModeKHR* pMode ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::createDisplayModeKHR( DisplayKHR display, const DisplayModeCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, DisplayModeKHR* pMode, Dispatch const &d) const { - return static_cast( vkCreateDisplayModeKHR( m_physicalDevice, static_cast( display ), reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pMode ) ) ); + 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 - VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::createDisplayModeKHR( DisplayKHR display, const DisplayModeCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::createDisplayModeKHR( DisplayKHR display, const DisplayModeCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { DisplayModeKHR mode; - Result result = static_cast( vkCreateDisplayModeKHR( m_physicalDevice, static_cast( display ), reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &mode ) ) ); - return createResultValue( result, mode, "VULKAN_HPP_NAMESPACE::PhysicalDevice::createDisplayModeKHR" ); + Result result = static_cast( d.vkCreateDisplayModeKHR( m_physicalDevice, static_cast( display ), reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &mode ) ) ); + return createResultValue( result, mode, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::createDisplayModeKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayPlaneCapabilitiesKHR( DisplayModeKHR mode, uint32_t planeIndex, DisplayPlaneCapabilitiesKHR* pCapabilities ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayPlaneCapabilitiesKHR( DisplayModeKHR mode, uint32_t planeIndex, DisplayPlaneCapabilitiesKHR* pCapabilities, Dispatch const &d) const { - return static_cast( vkGetDisplayPlaneCapabilitiesKHR( m_physicalDevice, static_cast( mode ), planeIndex, reinterpret_cast( pCapabilities ) ) ); + return static_cast( d.vkGetDisplayPlaneCapabilitiesKHR( m_physicalDevice, static_cast( mode ), planeIndex, reinterpret_cast( pCapabilities ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getDisplayPlaneCapabilitiesKHR( DisplayModeKHR mode, uint32_t planeIndex ) const + template + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getDisplayPlaneCapabilitiesKHR( DisplayModeKHR mode, uint32_t planeIndex, Dispatch const &d ) const { DisplayPlaneCapabilitiesKHR capabilities; - Result result = static_cast( vkGetDisplayPlaneCapabilitiesKHR( m_physicalDevice, static_cast( mode ), planeIndex, reinterpret_cast( &capabilities ) ) ); - return createResultValue( result, capabilities, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getDisplayPlaneCapabilitiesKHR" ); + Result result = static_cast( d.vkGetDisplayPlaneCapabilitiesKHR( m_physicalDevice, static_cast( mode ), planeIndex, reinterpret_cast( &capabilities ) ) ); + return createResultValue( result, capabilities, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayPlaneCapabilitiesKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_MIR_KHR - VULKAN_HPP_INLINE Bool32 PhysicalDevice::getMirPresentationSupportKHR( uint32_t queueFamilyIndex, MirConnection* connection ) const + template + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getMirPresentationSupportKHR( uint32_t queueFamilyIndex, MirConnection* connection, Dispatch const &d) const { - return vkGetPhysicalDeviceMirPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, connection ); + return d.vkGetPhysicalDeviceMirPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, connection ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Bool32 PhysicalDevice::getMirPresentationSupportKHR( uint32_t queueFamilyIndex, MirConnection & connection ) const + template + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getMirPresentationSupportKHR( uint32_t queueFamilyIndex, MirConnection & connection, Dispatch const &d ) const { - return vkGetPhysicalDeviceMirPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &connection ); + return d.vkGetPhysicalDeviceMirPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &connection ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_MIR_KHR*/ - VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceSupportKHR( uint32_t queueFamilyIndex, SurfaceKHR surface, Bool32* pSupported ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceSupportKHR( uint32_t queueFamilyIndex, SurfaceKHR surface, Bool32* pSupported, Dispatch const &d) const { - return static_cast( vkGetPhysicalDeviceSurfaceSupportKHR( m_physicalDevice, queueFamilyIndex, static_cast( surface ), pSupported ) ); + return static_cast( d.vkGetPhysicalDeviceSurfaceSupportKHR( m_physicalDevice, queueFamilyIndex, static_cast( surface ), pSupported ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getSurfaceSupportKHR( uint32_t queueFamilyIndex, SurfaceKHR surface ) const + template + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getSurfaceSupportKHR( uint32_t queueFamilyIndex, SurfaceKHR surface, Dispatch const &d ) const { Bool32 supported; - Result result = static_cast( vkGetPhysicalDeviceSurfaceSupportKHR( m_physicalDevice, queueFamilyIndex, static_cast( surface ), &supported ) ); - return createResultValue( result, supported, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getSurfaceSupportKHR" ); + Result result = static_cast( d.vkGetPhysicalDeviceSurfaceSupportKHR( m_physicalDevice, queueFamilyIndex, static_cast( surface ), &supported ) ); + return createResultValue( result, supported, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getSurfaceSupportKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceCapabilitiesKHR( SurfaceKHR surface, SurfaceCapabilitiesKHR* pSurfaceCapabilities ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceCapabilitiesKHR( SurfaceKHR surface, SurfaceCapabilitiesKHR* pSurfaceCapabilities, Dispatch const &d) const { - return static_cast( vkGetPhysicalDeviceSurfaceCapabilitiesKHR( m_physicalDevice, static_cast( surface ), reinterpret_cast( pSurfaceCapabilities ) ) ); + return static_cast( d.vkGetPhysicalDeviceSurfaceCapabilitiesKHR( m_physicalDevice, static_cast( surface ), reinterpret_cast( pSurfaceCapabilities ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getSurfaceCapabilitiesKHR( SurfaceKHR surface ) const + template + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getSurfaceCapabilitiesKHR( SurfaceKHR surface, Dispatch const &d ) const { SurfaceCapabilitiesKHR surfaceCapabilities; - Result result = static_cast( vkGetPhysicalDeviceSurfaceCapabilitiesKHR( m_physicalDevice, static_cast( surface ), reinterpret_cast( &surfaceCapabilities ) ) ); - return createResultValue( result, surfaceCapabilities, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getSurfaceCapabilitiesKHR" ); + Result result = static_cast( d.vkGetPhysicalDeviceSurfaceCapabilitiesKHR( m_physicalDevice, static_cast( surface ), reinterpret_cast( &surfaceCapabilities ) ) ); + return createResultValue( result, surfaceCapabilities, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getSurfaceCapabilitiesKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceFormatsKHR( SurfaceKHR surface, uint32_t* pSurfaceFormatCount, SurfaceFormatKHR* pSurfaceFormats ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceFormatsKHR( SurfaceKHR surface, uint32_t* pSurfaceFormatCount, SurfaceFormatKHR* pSurfaceFormats, Dispatch const &d) const { - return static_cast( vkGetPhysicalDeviceSurfaceFormatsKHR( m_physicalDevice, static_cast( surface ), pSurfaceFormatCount, reinterpret_cast( pSurfaceFormats ) ) ); + return static_cast( d.vkGetPhysicalDeviceSurfaceFormatsKHR( m_physicalDevice, static_cast( surface ), pSurfaceFormatCount, reinterpret_cast( pSurfaceFormats ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getSurfaceFormatsKHR( SurfaceKHR surface ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getSurfaceFormatsKHR( SurfaceKHR surface, Dispatch const &d ) const { std::vector surfaceFormats; uint32_t surfaceFormatCount; Result result; do { - result = static_cast( vkGetPhysicalDeviceSurfaceFormatsKHR( m_physicalDevice, static_cast( surface ), &surfaceFormatCount, nullptr ) ); + result = static_cast( d.vkGetPhysicalDeviceSurfaceFormatsKHR( m_physicalDevice, static_cast( surface ), &surfaceFormatCount, nullptr ) ); if ( ( result == Result::eSuccess ) && surfaceFormatCount ) { surfaceFormats.resize( surfaceFormatCount ); - result = static_cast( vkGetPhysicalDeviceSurfaceFormatsKHR( m_physicalDevice, static_cast( surface ), &surfaceFormatCount, reinterpret_cast( surfaceFormats.data() ) ) ); + result = static_cast( d.vkGetPhysicalDeviceSurfaceFormatsKHR( m_physicalDevice, static_cast( surface ), &surfaceFormatCount, reinterpret_cast( surfaceFormats.data() ) ) ); } } while ( result == Result::eIncomplete ); - assert( surfaceFormatCount <= surfaceFormats.size() ); + VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); surfaceFormats.resize( surfaceFormatCount ); - return createResultValue( result, surfaceFormats, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getSurfaceFormatsKHR" ); + return createResultValue( result, surfaceFormats, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getSurfaceFormatsKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result PhysicalDevice::getSurfacePresentModesKHR( SurfaceKHR surface, uint32_t* pPresentModeCount, PresentModeKHR* pPresentModes ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::getSurfacePresentModesKHR( SurfaceKHR surface, uint32_t* pPresentModeCount, PresentModeKHR* pPresentModes, Dispatch const &d) const { - return static_cast( vkGetPhysicalDeviceSurfacePresentModesKHR( m_physicalDevice, static_cast( surface ), pPresentModeCount, reinterpret_cast( pPresentModes ) ) ); + return static_cast( d.vkGetPhysicalDeviceSurfacePresentModesKHR( m_physicalDevice, static_cast( surface ), pPresentModeCount, reinterpret_cast( pPresentModes ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getSurfacePresentModesKHR( SurfaceKHR surface ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getSurfacePresentModesKHR( SurfaceKHR surface, Dispatch const &d ) const { std::vector presentModes; uint32_t presentModeCount; Result result; do { - result = static_cast( vkGetPhysicalDeviceSurfacePresentModesKHR( m_physicalDevice, static_cast( surface ), &presentModeCount, nullptr ) ); + result = static_cast( d.vkGetPhysicalDeviceSurfacePresentModesKHR( m_physicalDevice, static_cast( surface ), &presentModeCount, nullptr ) ); if ( ( result == Result::eSuccess ) && presentModeCount ) { presentModes.resize( presentModeCount ); - result = static_cast( vkGetPhysicalDeviceSurfacePresentModesKHR( m_physicalDevice, static_cast( surface ), &presentModeCount, reinterpret_cast( presentModes.data() ) ) ); + result = static_cast( d.vkGetPhysicalDeviceSurfacePresentModesKHR( m_physicalDevice, static_cast( surface ), &presentModeCount, reinterpret_cast( presentModes.data() ) ) ); } } while ( result == Result::eIncomplete ); - assert( presentModeCount <= presentModes.size() ); + VULKAN_HPP_ASSERT( presentModeCount <= presentModes.size() ); presentModes.resize( presentModeCount ); - return createResultValue( result, presentModes, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getSurfacePresentModesKHR" ); + return createResultValue( result, presentModes, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getSurfacePresentModesKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_WAYLAND_KHR - VULKAN_HPP_INLINE Bool32 PhysicalDevice::getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, struct wl_display* display ) const + template + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, struct wl_display* display, Dispatch const &d) const { - return vkGetPhysicalDeviceWaylandPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, display ); + return d.vkGetPhysicalDeviceWaylandPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, display ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Bool32 PhysicalDevice::getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, struct wl_display & display ) const + template + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, struct wl_display & display, Dispatch const &d ) const { - return vkGetPhysicalDeviceWaylandPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &display ); + return d.vkGetPhysicalDeviceWaylandPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &display ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ #ifdef VK_USE_PLATFORM_WIN32_KHR - VULKAN_HPP_INLINE Bool32 PhysicalDevice::getWin32PresentationSupportKHR( uint32_t queueFamilyIndex ) const +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getWin32PresentationSupportKHR( uint32_t queueFamilyIndex, Dispatch const &d) const + { + return d.vkGetPhysicalDeviceWin32PresentationSupportKHR( m_physicalDevice, queueFamilyIndex ); + } +#else + template + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getWin32PresentationSupportKHR( uint32_t queueFamilyIndex, Dispatch const &d ) const { - return vkGetPhysicalDeviceWin32PresentationSupportKHR( m_physicalDevice, queueFamilyIndex ); + return d.vkGetPhysicalDeviceWin32PresentationSupportKHR( m_physicalDevice, queueFamilyIndex ); } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_WIN32_KHR*/ #ifdef VK_USE_PLATFORM_XLIB_KHR - VULKAN_HPP_INLINE Bool32 PhysicalDevice::getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, Display* dpy, VisualID visualID ) const + template + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, Display* dpy, VisualID visualID, Dispatch const &d) const { - return vkGetPhysicalDeviceXlibPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, dpy, visualID ); + return d.vkGetPhysicalDeviceXlibPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, dpy, visualID ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Bool32 PhysicalDevice::getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, Display & dpy, VisualID visualID ) const + template + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, Display & dpy, VisualID visualID, Dispatch const &d ) const { - return vkGetPhysicalDeviceXlibPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &dpy, visualID ); + return d.vkGetPhysicalDeviceXlibPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &dpy, visualID ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_XLIB_KHR*/ #ifdef VK_USE_PLATFORM_XCB_KHR - VULKAN_HPP_INLINE Bool32 PhysicalDevice::getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id ) const + template + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id, Dispatch const &d) const { - return vkGetPhysicalDeviceXcbPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, connection, visual_id ); + return d.vkGetPhysicalDeviceXcbPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, connection, visual_id ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Bool32 PhysicalDevice::getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, xcb_connection_t & connection, xcb_visualid_t visual_id ) const + template + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, xcb_connection_t & connection, xcb_visualid_t visual_id, Dispatch const &d ) const { - return vkGetPhysicalDeviceXcbPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &connection, visual_id ); + return d.vkGetPhysicalDeviceXcbPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &connection, visual_id ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_XCB_KHR*/ - VULKAN_HPP_INLINE Result PhysicalDevice::getExternalImageFormatPropertiesNV( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ExternalMemoryHandleTypeFlagsNV externalHandleType, ExternalImageFormatPropertiesNV* pExternalImageFormatProperties ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::getExternalImageFormatPropertiesNV( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ExternalMemoryHandleTypeFlagsNV externalHandleType, ExternalImageFormatPropertiesNV* pExternalImageFormatProperties, Dispatch const &d) const { - return static_cast( vkGetPhysicalDeviceExternalImageFormatPropertiesNV( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( tiling ), static_cast( usage ), static_cast( flags ), static_cast( externalHandleType ), reinterpret_cast( pExternalImageFormatProperties ) ) ); + 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 - VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getExternalImageFormatPropertiesNV( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ExternalMemoryHandleTypeFlagsNV externalHandleType ) const + template + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getExternalImageFormatPropertiesNV( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ExternalMemoryHandleTypeFlagsNV externalHandleType, Dispatch const &d ) const { ExternalImageFormatPropertiesNV externalImageFormatProperties; - Result result = static_cast( vkGetPhysicalDeviceExternalImageFormatPropertiesNV( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( tiling ), static_cast( usage ), static_cast( flags ), static_cast( externalHandleType ), reinterpret_cast( &externalImageFormatProperties ) ) ); - return createResultValue( result, externalImageFormatProperties, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getExternalImageFormatPropertiesNV" ); + Result result = 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( &externalImageFormatProperties ) ) ); + return createResultValue( result, externalImageFormatProperties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getExternalImageFormatPropertiesNV" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void PhysicalDevice::getGeneratedCommandsPropertiesNVX( DeviceGeneratedCommandsFeaturesNVX* pFeatures, DeviceGeneratedCommandsLimitsNVX* pLimits ) const + template + VULKAN_HPP_INLINE void PhysicalDevice::getGeneratedCommandsPropertiesNVX( DeviceGeneratedCommandsFeaturesNVX* pFeatures, DeviceGeneratedCommandsLimitsNVX* pLimits, Dispatch const &d) const { - vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( m_physicalDevice, reinterpret_cast( pFeatures ), reinterpret_cast( pLimits ) ); + d.vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( m_physicalDevice, reinterpret_cast( pFeatures ), reinterpret_cast( pLimits ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE DeviceGeneratedCommandsLimitsNVX PhysicalDevice::getGeneratedCommandsPropertiesNVX( DeviceGeneratedCommandsFeaturesNVX & features ) const + template + VULKAN_HPP_INLINE DeviceGeneratedCommandsLimitsNVX PhysicalDevice::getGeneratedCommandsPropertiesNVX( DeviceGeneratedCommandsFeaturesNVX & features, Dispatch const &d ) const { DeviceGeneratedCommandsLimitsNVX limits; - vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( m_physicalDevice, reinterpret_cast( &features ), reinterpret_cast( &limits ) ); + d.vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( m_physicalDevice, reinterpret_cast( &features ), reinterpret_cast( &limits ) ); return limits; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void PhysicalDevice::getFeatures2KHR( PhysicalDeviceFeatures2KHR* pFeatures ) const + template + VULKAN_HPP_INLINE void PhysicalDevice::getFeatures2( PhysicalDeviceFeatures2* pFeatures, Dispatch const &d) const + { + d.vkGetPhysicalDeviceFeatures2( m_physicalDevice, reinterpret_cast( pFeatures ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE PhysicalDeviceFeatures2 PhysicalDevice::getFeatures2(Dispatch const &d ) const + { + PhysicalDeviceFeatures2 features; + d.vkGetPhysicalDeviceFeatures2( m_physicalDevice, reinterpret_cast( &features ) ); + return features; + } + template + VULKAN_HPP_INLINE StructureChain PhysicalDevice::getFeatures2(Dispatch const &d ) const + { + StructureChain structureChain; + 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::getFeatures2KHR( PhysicalDeviceFeatures2* pFeatures, Dispatch const &d) const { - vkGetPhysicalDeviceFeatures2KHR( m_physicalDevice, reinterpret_cast( pFeatures ) ); + d.vkGetPhysicalDeviceFeatures2KHR( m_physicalDevice, reinterpret_cast( pFeatures ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE PhysicalDeviceFeatures2KHR PhysicalDevice::getFeatures2KHR() const + template + VULKAN_HPP_INLINE PhysicalDeviceFeatures2 PhysicalDevice::getFeatures2KHR(Dispatch const &d ) const { - PhysicalDeviceFeatures2KHR features; - vkGetPhysicalDeviceFeatures2KHR( m_physicalDevice, reinterpret_cast( &features ) ); + PhysicalDeviceFeatures2 features; + d.vkGetPhysicalDeviceFeatures2KHR( m_physicalDevice, reinterpret_cast( &features ) ); return features; } - template - VULKAN_HPP_INLINE StructureChain PhysicalDevice::getFeatures2KHR() const + template + VULKAN_HPP_INLINE StructureChain PhysicalDevice::getFeatures2KHR(Dispatch const &d ) const + { + StructureChain structureChain; + 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::getProperties2( PhysicalDeviceProperties2* pProperties, Dispatch const &d) const + { + d.vkGetPhysicalDeviceProperties2( m_physicalDevice, reinterpret_cast( pProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE PhysicalDeviceProperties2 PhysicalDevice::getProperties2(Dispatch const &d ) const + { + PhysicalDeviceProperties2 properties; + d.vkGetPhysicalDeviceProperties2( m_physicalDevice, reinterpret_cast( &properties ) ); + return properties; + } + template + VULKAN_HPP_INLINE StructureChain PhysicalDevice::getProperties2(Dispatch const &d ) const { StructureChain structureChain; - PhysicalDeviceFeatures2KHR& features = structureChain.template get(); - vkGetPhysicalDeviceFeatures2KHR( m_physicalDevice, reinterpret_cast( &features ) ); + PhysicalDeviceProperties2& properties = structureChain.template get(); + d.vkGetPhysicalDeviceProperties2( m_physicalDevice, reinterpret_cast( &properties ) ); return structureChain; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void PhysicalDevice::getProperties2KHR( PhysicalDeviceProperties2KHR* pProperties ) const + template + VULKAN_HPP_INLINE void PhysicalDevice::getProperties2KHR( PhysicalDeviceProperties2* pProperties, Dispatch const &d) const { - vkGetPhysicalDeviceProperties2KHR( m_physicalDevice, reinterpret_cast( pProperties ) ); + d.vkGetPhysicalDeviceProperties2KHR( m_physicalDevice, reinterpret_cast( pProperties ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE PhysicalDeviceProperties2KHR PhysicalDevice::getProperties2KHR() const + template + VULKAN_HPP_INLINE PhysicalDeviceProperties2 PhysicalDevice::getProperties2KHR(Dispatch const &d ) const { - PhysicalDeviceProperties2KHR properties; - vkGetPhysicalDeviceProperties2KHR( m_physicalDevice, reinterpret_cast( &properties ) ); + PhysicalDeviceProperties2 properties; + d.vkGetPhysicalDeviceProperties2KHR( m_physicalDevice, reinterpret_cast( &properties ) ); return properties; } - template - VULKAN_HPP_INLINE StructureChain PhysicalDevice::getProperties2KHR() const + template + VULKAN_HPP_INLINE StructureChain PhysicalDevice::getProperties2KHR(Dispatch const &d ) const { StructureChain structureChain; - PhysicalDeviceProperties2KHR& properties = structureChain.template get(); - vkGetPhysicalDeviceProperties2KHR( m_physicalDevice, reinterpret_cast( &properties ) ); + PhysicalDeviceProperties2& properties = structureChain.template get(); + d.vkGetPhysicalDeviceProperties2KHR( m_physicalDevice, reinterpret_cast( &properties ) ); return structureChain; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void PhysicalDevice::getFormatProperties2KHR( Format format, FormatProperties2KHR* pFormatProperties ) const + template + VULKAN_HPP_INLINE void PhysicalDevice::getFormatProperties2( Format format, FormatProperties2* pFormatProperties, Dispatch const &d) const + { + d.vkGetPhysicalDeviceFormatProperties2( m_physicalDevice, static_cast( format ), reinterpret_cast( pFormatProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE FormatProperties2 PhysicalDevice::getFormatProperties2( Format format, Dispatch const &d ) const + { + FormatProperties2 formatProperties; + d.vkGetPhysicalDeviceFormatProperties2( m_physicalDevice, static_cast( format ), reinterpret_cast( &formatProperties ) ); + return formatProperties; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE void PhysicalDevice::getFormatProperties2KHR( Format format, FormatProperties2* pFormatProperties, Dispatch const &d) const { - vkGetPhysicalDeviceFormatProperties2KHR( m_physicalDevice, static_cast( format ), reinterpret_cast( pFormatProperties ) ); + d.vkGetPhysicalDeviceFormatProperties2KHR( m_physicalDevice, static_cast( format ), reinterpret_cast( pFormatProperties ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE FormatProperties2KHR PhysicalDevice::getFormatProperties2KHR( Format format ) const + template + VULKAN_HPP_INLINE FormatProperties2 PhysicalDevice::getFormatProperties2KHR( Format format, Dispatch const &d ) const { - FormatProperties2KHR formatProperties; - vkGetPhysicalDeviceFormatProperties2KHR( m_physicalDevice, static_cast( format ), reinterpret_cast( &formatProperties ) ); + FormatProperties2 formatProperties; + d.vkGetPhysicalDeviceFormatProperties2KHR( m_physicalDevice, static_cast( format ), reinterpret_cast( &formatProperties ) ); return formatProperties; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result PhysicalDevice::getImageFormatProperties2KHR( const PhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo, ImageFormatProperties2KHR* pImageFormatProperties ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::getImageFormatProperties2( const PhysicalDeviceImageFormatInfo2* pImageFormatInfo, ImageFormatProperties2* pImageFormatProperties, Dispatch const &d) const + { + return static_cast( d.vkGetPhysicalDeviceImageFormatProperties2( m_physicalDevice, reinterpret_cast( pImageFormatInfo ), reinterpret_cast( pImageFormatProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getImageFormatProperties2( const PhysicalDeviceImageFormatInfo2 & imageFormatInfo, Dispatch const &d ) const + { + ImageFormatProperties2 imageFormatProperties; + Result result = static_cast( d.vkGetPhysicalDeviceImageFormatProperties2( m_physicalDevice, reinterpret_cast( &imageFormatInfo ), reinterpret_cast( &imageFormatProperties ) ) ); + return createResultValue( result, imageFormatProperties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getImageFormatProperties2" ); + } + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getImageFormatProperties2( const PhysicalDeviceImageFormatInfo2 & imageFormatInfo, Dispatch const &d ) const + { + StructureChain structureChain; + ImageFormatProperties2& imageFormatProperties = structureChain.template get(); + Result result = static_cast( d.vkGetPhysicalDeviceImageFormatProperties2( m_physicalDevice, reinterpret_cast( &imageFormatInfo ), reinterpret_cast( &imageFormatProperties ) ) ); + return createResultValue( result, structureChain, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getImageFormatProperties2" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE Result PhysicalDevice::getImageFormatProperties2KHR( const PhysicalDeviceImageFormatInfo2* pImageFormatInfo, ImageFormatProperties2* pImageFormatProperties, Dispatch const &d) const { - return static_cast( vkGetPhysicalDeviceImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( pImageFormatInfo ), reinterpret_cast( pImageFormatProperties ) ) ); + return static_cast( d.vkGetPhysicalDeviceImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( pImageFormatInfo ), reinterpret_cast( pImageFormatProperties ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getImageFormatProperties2KHR( const PhysicalDeviceImageFormatInfo2KHR & imageFormatInfo ) const + template + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getImageFormatProperties2KHR( const PhysicalDeviceImageFormatInfo2 & imageFormatInfo, Dispatch const &d ) const { - ImageFormatProperties2KHR imageFormatProperties; - Result result = static_cast( vkGetPhysicalDeviceImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( &imageFormatInfo ), reinterpret_cast( &imageFormatProperties ) ) ); - return createResultValue( result, imageFormatProperties, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getImageFormatProperties2KHR" ); + ImageFormatProperties2 imageFormatProperties; + Result result = static_cast( d.vkGetPhysicalDeviceImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( &imageFormatInfo ), reinterpret_cast( &imageFormatProperties ) ) ); + return createResultValue( result, imageFormatProperties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getImageFormatProperties2KHR" ); } - template - VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getImageFormatProperties2KHR( const PhysicalDeviceImageFormatInfo2KHR & imageFormatInfo ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getImageFormatProperties2KHR( const PhysicalDeviceImageFormatInfo2 & imageFormatInfo, Dispatch const &d ) const { StructureChain structureChain; - ImageFormatProperties2KHR& imageFormatProperties = structureChain.template get(); - Result result = static_cast( vkGetPhysicalDeviceImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( &imageFormatInfo ), reinterpret_cast( &imageFormatProperties ) ) ); - return createResultValue( result, structureChain, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getImageFormatProperties2KHR" ); + ImageFormatProperties2& imageFormatProperties = structureChain.template get(); + Result result = static_cast( d.vkGetPhysicalDeviceImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( &imageFormatInfo ), reinterpret_cast( &imageFormatProperties ) ) ); + return createResultValue( result, structureChain, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getImageFormatProperties2KHR" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE void PhysicalDevice::getQueueFamilyProperties2( uint32_t* pQueueFamilyPropertyCount, QueueFamilyProperties2* pQueueFamilyProperties, Dispatch const &d) const + { + d.vkGetPhysicalDeviceQueueFamilyProperties2( m_physicalDevice, pQueueFamilyPropertyCount, reinterpret_cast( pQueueFamilyProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE std::vector PhysicalDevice::getQueueFamilyProperties2(Dispatch const &d ) const + { + std::vector queueFamilyProperties; + uint32_t queueFamilyPropertyCount; + d.vkGetPhysicalDeviceQueueFamilyProperties2( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); + queueFamilyProperties.resize( queueFamilyPropertyCount ); + d.vkGetPhysicalDeviceQueueFamilyProperties2( m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); + return queueFamilyProperties; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void PhysicalDevice::getQueueFamilyProperties2KHR( uint32_t* pQueueFamilyPropertyCount, QueueFamilyProperties2KHR* pQueueFamilyProperties ) const + template + VULKAN_HPP_INLINE void PhysicalDevice::getQueueFamilyProperties2KHR( uint32_t* pQueueFamilyPropertyCount, QueueFamilyProperties2* pQueueFamilyProperties, Dispatch const &d) const { - vkGetPhysicalDeviceQueueFamilyProperties2KHR( m_physicalDevice, pQueueFamilyPropertyCount, reinterpret_cast( pQueueFamilyProperties ) ); + d.vkGetPhysicalDeviceQueueFamilyProperties2KHR( m_physicalDevice, pQueueFamilyPropertyCount, reinterpret_cast( pQueueFamilyProperties ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE std::vector PhysicalDevice::getQueueFamilyProperties2KHR() const + template + VULKAN_HPP_INLINE std::vector PhysicalDevice::getQueueFamilyProperties2KHR(Dispatch const &d ) const { - std::vector queueFamilyProperties; + std::vector queueFamilyProperties; uint32_t queueFamilyPropertyCount; - vkGetPhysicalDeviceQueueFamilyProperties2KHR( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); + d.vkGetPhysicalDeviceQueueFamilyProperties2KHR( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); queueFamilyProperties.resize( queueFamilyPropertyCount ); - vkGetPhysicalDeviceQueueFamilyProperties2KHR( m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); + d.vkGetPhysicalDeviceQueueFamilyProperties2KHR( m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); return queueFamilyProperties; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void PhysicalDevice::getMemoryProperties2KHR( PhysicalDeviceMemoryProperties2KHR* pMemoryProperties ) const + template + VULKAN_HPP_INLINE void PhysicalDevice::getMemoryProperties2( PhysicalDeviceMemoryProperties2* pMemoryProperties, Dispatch const &d) const + { + d.vkGetPhysicalDeviceMemoryProperties2( m_physicalDevice, reinterpret_cast( pMemoryProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE PhysicalDeviceMemoryProperties2 PhysicalDevice::getMemoryProperties2(Dispatch const &d ) const + { + PhysicalDeviceMemoryProperties2 memoryProperties; + d.vkGetPhysicalDeviceMemoryProperties2( m_physicalDevice, reinterpret_cast( &memoryProperties ) ); + return memoryProperties; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE void PhysicalDevice::getMemoryProperties2KHR( PhysicalDeviceMemoryProperties2* pMemoryProperties, Dispatch const &d) const { - vkGetPhysicalDeviceMemoryProperties2KHR( m_physicalDevice, reinterpret_cast( pMemoryProperties ) ); + d.vkGetPhysicalDeviceMemoryProperties2KHR( m_physicalDevice, reinterpret_cast( pMemoryProperties ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE PhysicalDeviceMemoryProperties2KHR PhysicalDevice::getMemoryProperties2KHR() const + template + VULKAN_HPP_INLINE PhysicalDeviceMemoryProperties2 PhysicalDevice::getMemoryProperties2KHR(Dispatch const &d ) const { - PhysicalDeviceMemoryProperties2KHR memoryProperties; - vkGetPhysicalDeviceMemoryProperties2KHR( m_physicalDevice, reinterpret_cast( &memoryProperties ) ); + PhysicalDeviceMemoryProperties2 memoryProperties; + d.vkGetPhysicalDeviceMemoryProperties2KHR( m_physicalDevice, reinterpret_cast( &memoryProperties ) ); return memoryProperties; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void PhysicalDevice::getSparseImageFormatProperties2KHR( const PhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo, uint32_t* pPropertyCount, SparseImageFormatProperties2KHR* pProperties ) const + template + VULKAN_HPP_INLINE void PhysicalDevice::getSparseImageFormatProperties2( const PhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, SparseImageFormatProperties2* pProperties, Dispatch const &d) const + { + d.vkGetPhysicalDeviceSparseImageFormatProperties2( m_physicalDevice, reinterpret_cast( pFormatInfo ), pPropertyCount, reinterpret_cast( pProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE std::vector PhysicalDevice::getSparseImageFormatProperties2( const PhysicalDeviceSparseImageFormatInfo2 & formatInfo, Dispatch const &d ) const + { + 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() ) ); + return properties; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE void PhysicalDevice::getSparseImageFormatProperties2KHR( const PhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, SparseImageFormatProperties2* pProperties, Dispatch const &d) const { - vkGetPhysicalDeviceSparseImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( pFormatInfo ), pPropertyCount, reinterpret_cast( pProperties ) ); + d.vkGetPhysicalDeviceSparseImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( pFormatInfo ), pPropertyCount, reinterpret_cast( pProperties ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE std::vector PhysicalDevice::getSparseImageFormatProperties2KHR( const PhysicalDeviceSparseImageFormatInfo2KHR & formatInfo ) const + template + VULKAN_HPP_INLINE std::vector PhysicalDevice::getSparseImageFormatProperties2KHR( const PhysicalDeviceSparseImageFormatInfo2 & formatInfo, Dispatch const &d ) const { - std::vector properties; + std::vector properties; uint32_t propertyCount; - vkGetPhysicalDeviceSparseImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( &formatInfo ), &propertyCount, nullptr ); + d.vkGetPhysicalDeviceSparseImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( &formatInfo ), &propertyCount, nullptr ); properties.resize( propertyCount ); - vkGetPhysicalDeviceSparseImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( &formatInfo ), &propertyCount, reinterpret_cast( properties.data() ) ); + d.vkGetPhysicalDeviceSparseImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( &formatInfo ), &propertyCount, reinterpret_cast( properties.data() ) ); return properties; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void PhysicalDevice::getExternalBufferPropertiesKHR( const PhysicalDeviceExternalBufferInfoKHR* pExternalBufferInfo, ExternalBufferPropertiesKHR* pExternalBufferProperties ) const + template + VULKAN_HPP_INLINE void PhysicalDevice::getExternalBufferProperties( const PhysicalDeviceExternalBufferInfo* pExternalBufferInfo, ExternalBufferProperties* pExternalBufferProperties, Dispatch const &d) const + { + d.vkGetPhysicalDeviceExternalBufferProperties( m_physicalDevice, reinterpret_cast( pExternalBufferInfo ), reinterpret_cast( pExternalBufferProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE ExternalBufferProperties PhysicalDevice::getExternalBufferProperties( const PhysicalDeviceExternalBufferInfo & externalBufferInfo, Dispatch const &d ) const + { + 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::getExternalBufferPropertiesKHR( const PhysicalDeviceExternalBufferInfo* pExternalBufferInfo, ExternalBufferProperties* pExternalBufferProperties, Dispatch const &d) const { - vkGetPhysicalDeviceExternalBufferPropertiesKHR( m_physicalDevice, reinterpret_cast( pExternalBufferInfo ), reinterpret_cast( pExternalBufferProperties ) ); + d.vkGetPhysicalDeviceExternalBufferPropertiesKHR( m_physicalDevice, reinterpret_cast( pExternalBufferInfo ), reinterpret_cast( pExternalBufferProperties ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ExternalBufferPropertiesKHR PhysicalDevice::getExternalBufferPropertiesKHR( const PhysicalDeviceExternalBufferInfoKHR & externalBufferInfo ) const + template + VULKAN_HPP_INLINE ExternalBufferProperties PhysicalDevice::getExternalBufferPropertiesKHR( const PhysicalDeviceExternalBufferInfo & externalBufferInfo, Dispatch const &d ) const { - ExternalBufferPropertiesKHR externalBufferProperties; - vkGetPhysicalDeviceExternalBufferPropertiesKHR( m_physicalDevice, reinterpret_cast( &externalBufferInfo ), reinterpret_cast( &externalBufferProperties ) ); + ExternalBufferProperties externalBufferProperties; + d.vkGetPhysicalDeviceExternalBufferPropertiesKHR( m_physicalDevice, reinterpret_cast( &externalBufferInfo ), reinterpret_cast( &externalBufferProperties ) ); return externalBufferProperties; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void PhysicalDevice::getExternalSemaphorePropertiesKHR( const PhysicalDeviceExternalSemaphoreInfoKHR* pExternalSemaphoreInfo, ExternalSemaphorePropertiesKHR* pExternalSemaphoreProperties ) const + template + VULKAN_HPP_INLINE void PhysicalDevice::getExternalSemaphoreProperties( const PhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, ExternalSemaphoreProperties* pExternalSemaphoreProperties, Dispatch const &d) const + { + d.vkGetPhysicalDeviceExternalSemaphoreProperties( m_physicalDevice, reinterpret_cast( pExternalSemaphoreInfo ), reinterpret_cast( pExternalSemaphoreProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE ExternalSemaphoreProperties PhysicalDevice::getExternalSemaphoreProperties( const PhysicalDeviceExternalSemaphoreInfo & externalSemaphoreInfo, Dispatch const &d ) const + { + 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 PhysicalDevice::getExternalSemaphorePropertiesKHR( const PhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, ExternalSemaphoreProperties* pExternalSemaphoreProperties, Dispatch const &d) const { - vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( m_physicalDevice, reinterpret_cast( pExternalSemaphoreInfo ), reinterpret_cast( pExternalSemaphoreProperties ) ); + d.vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( m_physicalDevice, reinterpret_cast( pExternalSemaphoreInfo ), reinterpret_cast( pExternalSemaphoreProperties ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ExternalSemaphorePropertiesKHR PhysicalDevice::getExternalSemaphorePropertiesKHR( const PhysicalDeviceExternalSemaphoreInfoKHR & externalSemaphoreInfo ) const + template + VULKAN_HPP_INLINE ExternalSemaphoreProperties PhysicalDevice::getExternalSemaphorePropertiesKHR( const PhysicalDeviceExternalSemaphoreInfo & externalSemaphoreInfo, Dispatch const &d ) const { - ExternalSemaphorePropertiesKHR externalSemaphoreProperties; - vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( m_physicalDevice, reinterpret_cast( &externalSemaphoreInfo ), reinterpret_cast( &externalSemaphoreProperties ) ); + ExternalSemaphoreProperties externalSemaphoreProperties; + d.vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( m_physicalDevice, reinterpret_cast( &externalSemaphoreInfo ), reinterpret_cast( &externalSemaphoreProperties ) ); return externalSemaphoreProperties; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void PhysicalDevice::getExternalFencePropertiesKHR( const PhysicalDeviceExternalFenceInfoKHR* pExternalFenceInfo, ExternalFencePropertiesKHR* pExternalFenceProperties ) const + template + VULKAN_HPP_INLINE void PhysicalDevice::getExternalFenceProperties( const PhysicalDeviceExternalFenceInfo* pExternalFenceInfo, ExternalFenceProperties* pExternalFenceProperties, Dispatch const &d) const + { + d.vkGetPhysicalDeviceExternalFenceProperties( m_physicalDevice, reinterpret_cast( pExternalFenceInfo ), reinterpret_cast( pExternalFenceProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE ExternalFenceProperties PhysicalDevice::getExternalFenceProperties( const PhysicalDeviceExternalFenceInfo & externalFenceInfo, Dispatch const &d ) const + { + 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::getExternalFencePropertiesKHR( const PhysicalDeviceExternalFenceInfo* pExternalFenceInfo, ExternalFenceProperties* pExternalFenceProperties, Dispatch const &d) const { - vkGetPhysicalDeviceExternalFencePropertiesKHR( m_physicalDevice, reinterpret_cast( pExternalFenceInfo ), reinterpret_cast( pExternalFenceProperties ) ); + d.vkGetPhysicalDeviceExternalFencePropertiesKHR( m_physicalDevice, reinterpret_cast( pExternalFenceInfo ), reinterpret_cast( pExternalFenceProperties ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ExternalFencePropertiesKHR PhysicalDevice::getExternalFencePropertiesKHR( const PhysicalDeviceExternalFenceInfoKHR & externalFenceInfo ) const + template + VULKAN_HPP_INLINE ExternalFenceProperties PhysicalDevice::getExternalFencePropertiesKHR( const PhysicalDeviceExternalFenceInfo & externalFenceInfo, Dispatch const &d ) const { - ExternalFencePropertiesKHR externalFenceProperties; - vkGetPhysicalDeviceExternalFencePropertiesKHR( m_physicalDevice, reinterpret_cast( &externalFenceInfo ), reinterpret_cast( &externalFenceProperties ) ); + ExternalFenceProperties externalFenceProperties; + d.vkGetPhysicalDeviceExternalFencePropertiesKHR( m_physicalDevice, reinterpret_cast( &externalFenceInfo ), reinterpret_cast( &externalFenceProperties ) ); return externalFenceProperties; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE Result PhysicalDevice::releaseDisplayEXT( DisplayKHR display ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::releaseDisplayEXT( DisplayKHR display, Dispatch const &d) const { - return static_cast( vkReleaseDisplayEXT( m_physicalDevice, static_cast( display ) ) ); + return static_cast( d.vkReleaseDisplayEXT( m_physicalDevice, static_cast( display ) ) ); } #else - VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::releaseDisplayEXT( DisplayKHR display ) const + template + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::releaseDisplayEXT( DisplayKHR display, Dispatch const &d ) const { - Result result = static_cast( vkReleaseDisplayEXT( m_physicalDevice, static_cast( display ) ) ); - return createResultValue( result, "VULKAN_HPP_NAMESPACE::PhysicalDevice::releaseDisplayEXT" ); + Result result = static_cast( d.vkReleaseDisplayEXT( m_physicalDevice, static_cast( display ) ) ); + return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::releaseDisplayEXT" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - VULKAN_HPP_INLINE Result PhysicalDevice::acquireXlibDisplayEXT( Display* dpy, DisplayKHR display ) const +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_NV + template + VULKAN_HPP_INLINE Result PhysicalDevice::acquireXlibDisplayEXT( Display* dpy, DisplayKHR display, Dispatch const &d) const { - return static_cast( vkAcquireXlibDisplayEXT( m_physicalDevice, dpy, static_cast( display ) ) ); + return static_cast( d.vkAcquireXlibDisplayEXT( m_physicalDevice, dpy, static_cast( display ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::acquireXlibDisplayEXT( DisplayKHR display ) const + template + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::acquireXlibDisplayEXT( DisplayKHR display, Dispatch const &d ) const { Display dpy; - Result result = static_cast( vkAcquireXlibDisplayEXT( m_physicalDevice, &dpy, static_cast( display ) ) ); - return createResultValue( result, dpy, "VULKAN_HPP_NAMESPACE::PhysicalDevice::acquireXlibDisplayEXT" ); + Result result = static_cast( d.vkAcquireXlibDisplayEXT( m_physicalDevice, &dpy, static_cast( display ) ) ); + return createResultValue( result, dpy, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::acquireXlibDisplayEXT" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ +#endif /*VK_USE_PLATFORM_XLIB_XRANDR_NV*/ -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - VULKAN_HPP_INLINE Result PhysicalDevice::getRandROutputDisplayEXT( Display* dpy, RROutput rrOutput, DisplayKHR* pDisplay ) const +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_NV + template + VULKAN_HPP_INLINE Result PhysicalDevice::getRandROutputDisplayEXT( Display* dpy, RROutput rrOutput, DisplayKHR* pDisplay, Dispatch const &d) const { - return static_cast( vkGetRandROutputDisplayEXT( m_physicalDevice, dpy, rrOutput, reinterpret_cast( pDisplay ) ) ); + return static_cast( d.vkGetRandROutputDisplayEXT( m_physicalDevice, dpy, rrOutput, reinterpret_cast( pDisplay ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getRandROutputDisplayEXT( Display & dpy, RROutput rrOutput ) const + template + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getRandROutputDisplayEXT( Display & dpy, RROutput rrOutput, Dispatch const &d ) const { DisplayKHR display; - Result result = static_cast( vkGetRandROutputDisplayEXT( m_physicalDevice, &dpy, rrOutput, reinterpret_cast( &display ) ) ); - return createResultValue( result, display, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getRandROutputDisplayEXT" ); + Result result = static_cast( d.vkGetRandROutputDisplayEXT( m_physicalDevice, &dpy, rrOutput, reinterpret_cast( &display ) ) ); + return createResultValue( result, display, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getRandROutputDisplayEXT" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ +#endif /*VK_USE_PLATFORM_XLIB_XRANDR_NV*/ - VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceCapabilities2EXT( SurfaceKHR surface, SurfaceCapabilities2EXT* pSurfaceCapabilities ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceCapabilities2EXT( SurfaceKHR surface, SurfaceCapabilities2EXT* pSurfaceCapabilities, Dispatch const &d) const { - return static_cast( vkGetPhysicalDeviceSurfaceCapabilities2EXT( m_physicalDevice, static_cast( surface ), reinterpret_cast( pSurfaceCapabilities ) ) ); + return static_cast( d.vkGetPhysicalDeviceSurfaceCapabilities2EXT( m_physicalDevice, static_cast( surface ), reinterpret_cast( pSurfaceCapabilities ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getSurfaceCapabilities2EXT( SurfaceKHR surface ) const + template + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getSurfaceCapabilities2EXT( SurfaceKHR surface, Dispatch const &d ) const { SurfaceCapabilities2EXT surfaceCapabilities; - Result result = static_cast( vkGetPhysicalDeviceSurfaceCapabilities2EXT( m_physicalDevice, static_cast( surface ), reinterpret_cast( &surfaceCapabilities ) ) ); - return createResultValue( result, surfaceCapabilities, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getSurfaceCapabilities2EXT" ); + Result result = static_cast( d.vkGetPhysicalDeviceSurfaceCapabilities2EXT( m_physicalDevice, static_cast( surface ), reinterpret_cast( &surfaceCapabilities ) ) ); + return createResultValue( result, surfaceCapabilities, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getSurfaceCapabilities2EXT" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result PhysicalDevice::getPresentRectanglesKHX( SurfaceKHR surface, uint32_t* pRectCount, Rect2D* pRects ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::getPresentRectanglesKHR( SurfaceKHR surface, uint32_t* pRectCount, Rect2D* pRects, Dispatch const &d) const { - return static_cast( vkGetPhysicalDevicePresentRectanglesKHX( m_physicalDevice, static_cast( surface ), pRectCount, reinterpret_cast( pRects ) ) ); + return static_cast( d.vkGetPhysicalDevicePresentRectanglesKHR( m_physicalDevice, static_cast( surface ), pRectCount, reinterpret_cast( pRects ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getPresentRectanglesKHX( SurfaceKHR surface ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getPresentRectanglesKHR( SurfaceKHR surface, Dispatch const &d ) const { std::vector rects; uint32_t rectCount; Result result; do { - result = static_cast( vkGetPhysicalDevicePresentRectanglesKHX( m_physicalDevice, static_cast( surface ), &rectCount, nullptr ) ); + result = static_cast( d.vkGetPhysicalDevicePresentRectanglesKHR( m_physicalDevice, static_cast( surface ), &rectCount, nullptr ) ); if ( ( result == Result::eSuccess ) && rectCount ) { rects.resize( rectCount ); - result = static_cast( vkGetPhysicalDevicePresentRectanglesKHX( m_physicalDevice, static_cast( surface ), &rectCount, reinterpret_cast( rects.data() ) ) ); + result = static_cast( d.vkGetPhysicalDevicePresentRectanglesKHR( m_physicalDevice, static_cast( surface ), &rectCount, reinterpret_cast( rects.data() ) ) ); } } while ( result == Result::eIncomplete ); - assert( rectCount <= rects.size() ); + VULKAN_HPP_ASSERT( rectCount <= rects.size() ); rects.resize( rectCount ); - return createResultValue( result, rects, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getPresentRectanglesKHX" ); + return createResultValue( result, rects, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getPresentRectanglesKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void PhysicalDevice::getMultisamplePropertiesEXT( SampleCountFlagBits samples, MultisamplePropertiesEXT* pMultisampleProperties ) const + template + VULKAN_HPP_INLINE void PhysicalDevice::getMultisamplePropertiesEXT( SampleCountFlagBits samples, MultisamplePropertiesEXT* pMultisampleProperties, Dispatch const &d) const { - vkGetPhysicalDeviceMultisamplePropertiesEXT( m_physicalDevice, static_cast( samples ), reinterpret_cast( pMultisampleProperties ) ); + d.vkGetPhysicalDeviceMultisamplePropertiesEXT( m_physicalDevice, static_cast( samples ), reinterpret_cast( pMultisampleProperties ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE MultisamplePropertiesEXT PhysicalDevice::getMultisamplePropertiesEXT( SampleCountFlagBits samples ) const + template + VULKAN_HPP_INLINE MultisamplePropertiesEXT PhysicalDevice::getMultisamplePropertiesEXT( SampleCountFlagBits samples, Dispatch const &d ) const { MultisamplePropertiesEXT multisampleProperties; - vkGetPhysicalDeviceMultisamplePropertiesEXT( m_physicalDevice, static_cast( samples ), reinterpret_cast( &multisampleProperties ) ); + d.vkGetPhysicalDeviceMultisamplePropertiesEXT( m_physicalDevice, static_cast( samples ), reinterpret_cast( &multisampleProperties ) ); return multisampleProperties; } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceCapabilities2KHR( const PhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, SurfaceCapabilities2KHR* pSurfaceCapabilities ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceCapabilities2KHR( const PhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, SurfaceCapabilities2KHR* pSurfaceCapabilities, Dispatch const &d) const { - return static_cast( vkGetPhysicalDeviceSurfaceCapabilities2KHR( m_physicalDevice, reinterpret_cast( pSurfaceInfo ), reinterpret_cast( pSurfaceCapabilities ) ) ); + return static_cast( d.vkGetPhysicalDeviceSurfaceCapabilities2KHR( m_physicalDevice, reinterpret_cast( pSurfaceInfo ), reinterpret_cast( pSurfaceCapabilities ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getSurfaceCapabilities2KHR( const PhysicalDeviceSurfaceInfo2KHR & surfaceInfo ) const + template + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getSurfaceCapabilities2KHR( const PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, Dispatch const &d ) const { SurfaceCapabilities2KHR surfaceCapabilities; - Result result = static_cast( vkGetPhysicalDeviceSurfaceCapabilities2KHR( m_physicalDevice, reinterpret_cast( &surfaceInfo ), reinterpret_cast( &surfaceCapabilities ) ) ); - return createResultValue( result, surfaceCapabilities, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getSurfaceCapabilities2KHR" ); + Result result = static_cast( d.vkGetPhysicalDeviceSurfaceCapabilities2KHR( m_physicalDevice, reinterpret_cast( &surfaceInfo ), reinterpret_cast( &surfaceCapabilities ) ) ); + return createResultValue( result, surfaceCapabilities, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getSurfaceCapabilities2KHR" ); } - template - VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getSurfaceCapabilities2KHR( const PhysicalDeviceSurfaceInfo2KHR & surfaceInfo ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getSurfaceCapabilities2KHR( const PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, Dispatch const &d ) const { StructureChain structureChain; SurfaceCapabilities2KHR& surfaceCapabilities = structureChain.template get(); - Result result = static_cast( vkGetPhysicalDeviceSurfaceCapabilities2KHR( m_physicalDevice, reinterpret_cast( &surfaceInfo ), reinterpret_cast( &surfaceCapabilities ) ) ); - return createResultValue( result, structureChain, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getSurfaceCapabilities2KHR" ); + Result result = static_cast( d.vkGetPhysicalDeviceSurfaceCapabilities2KHR( m_physicalDevice, reinterpret_cast( &surfaceInfo ), reinterpret_cast( &surfaceCapabilities ) ) ); + return createResultValue( result, structureChain, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getSurfaceCapabilities2KHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceFormats2KHR( const PhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pSurfaceFormatCount, SurfaceFormat2KHR* pSurfaceFormats ) const + template + VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceFormats2KHR( const PhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pSurfaceFormatCount, SurfaceFormat2KHR* pSurfaceFormats, Dispatch const &d) const { - return static_cast( vkGetPhysicalDeviceSurfaceFormats2KHR( m_physicalDevice, reinterpret_cast( pSurfaceInfo ), pSurfaceFormatCount, reinterpret_cast( pSurfaceFormats ) ) ); + return static_cast( d.vkGetPhysicalDeviceSurfaceFormats2KHR( m_physicalDevice, reinterpret_cast( pSurfaceInfo ), pSurfaceFormatCount, reinterpret_cast( pSurfaceFormats ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getSurfaceFormats2KHR( const PhysicalDeviceSurfaceInfo2KHR & surfaceInfo ) const + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getSurfaceFormats2KHR( const PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, Dispatch const &d ) const { std::vector surfaceFormats; uint32_t surfaceFormatCount; Result result; do { - result = static_cast( vkGetPhysicalDeviceSurfaceFormats2KHR( m_physicalDevice, reinterpret_cast( &surfaceInfo ), &surfaceFormatCount, nullptr ) ); + result = static_cast( d.vkGetPhysicalDeviceSurfaceFormats2KHR( m_physicalDevice, reinterpret_cast( &surfaceInfo ), &surfaceFormatCount, nullptr ) ); if ( ( result == Result::eSuccess ) && surfaceFormatCount ) { surfaceFormats.resize( surfaceFormatCount ); - result = static_cast( vkGetPhysicalDeviceSurfaceFormats2KHR( m_physicalDevice, reinterpret_cast( &surfaceInfo ), &surfaceFormatCount, reinterpret_cast( surfaceFormats.data() ) ) ); + result = static_cast( d.vkGetPhysicalDeviceSurfaceFormats2KHR( m_physicalDevice, reinterpret_cast( &surfaceInfo ), &surfaceFormatCount, reinterpret_cast( surfaceFormats.data() ) ) ); } } while ( result == Result::eIncomplete ); - assert( surfaceFormatCount <= surfaceFormats.size() ); + VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); surfaceFormats.resize( surfaceFormatCount ); - return createResultValue( result, surfaceFormats, "VULKAN_HPP_NAMESPACE::PhysicalDevice::getSurfaceFormats2KHR" ); + return createResultValue( result, surfaceFormats, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getSurfaceFormats2KHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ struct CmdProcessCommandsInfoNVX { CmdProcessCommandsInfoNVX( ObjectTableNVX objectTable_ = ObjectTableNVX(), IndirectCommandsLayoutNVX indirectCommandsLayout_ = IndirectCommandsLayoutNVX(), uint32_t indirectCommandsTokenCount_ = 0, const IndirectCommandsTokenNVX* pIndirectCommandsTokens_ = nullptr, uint32_t maxSequencesCount_ = 0, CommandBuffer targetCommandBuffer_ = CommandBuffer(), Buffer sequencesCountBuffer_ = Buffer(), DeviceSize sequencesCountOffset_ = 0, Buffer sequencesIndexBuffer_ = Buffer(), DeviceSize sequencesIndexOffset_ = 0 ) - : sType( StructureType::eCmdProcessCommandsInfoNVX ) - , pNext( nullptr ) - , objectTable( objectTable_ ) + : objectTable( objectTable_ ) , indirectCommandsLayout( indirectCommandsLayout_ ) , indirectCommandsTokenCount( indirectCommandsTokenCount_ ) , pIndirectCommandsTokens( pIndirectCommandsTokens_ ) @@ -31341,10 +37409,10 @@ } private: - StructureType sType; + StructureType sType = StructureType::eCmdProcessCommandsInfoNVX; public: - const void* pNext; + const void* pNext = nullptr; ObjectTableNVX objectTable; IndirectCommandsLayoutNVX indirectCommandsLayout; uint32_t indirectCommandsTokenCount; @@ -31358,58 +37426,64 @@ }; static_assert( sizeof( CmdProcessCommandsInfoNVX ) == sizeof( VkCmdProcessCommandsInfoNVX ), "struct and wrapper have different size!" ); - struct PhysicalDeviceGroupPropertiesKHX + struct PhysicalDeviceGroupProperties { - operator const VkPhysicalDeviceGroupPropertiesKHX&() const + operator const VkPhysicalDeviceGroupProperties&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( PhysicalDeviceGroupPropertiesKHX const& rhs ) const + bool operator==( PhysicalDeviceGroupProperties const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( physicalDeviceCount == rhs.physicalDeviceCount ) - && ( memcmp( physicalDevices, rhs.physicalDevices, VK_MAX_DEVICE_GROUP_SIZE_KHX * sizeof( PhysicalDevice ) ) == 0 ) + && ( memcmp( physicalDevices, rhs.physicalDevices, VK_MAX_DEVICE_GROUP_SIZE * sizeof( PhysicalDevice ) ) == 0 ) && ( subsetAllocation == rhs.subsetAllocation ); } - bool operator!=( PhysicalDeviceGroupPropertiesKHX const& rhs ) const + bool operator!=( PhysicalDeviceGroupProperties const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::ePhysicalDeviceGroupProperties; public: - void* pNext; + void* pNext = nullptr; uint32_t physicalDeviceCount; - PhysicalDevice physicalDevices[VK_MAX_DEVICE_GROUP_SIZE_KHX]; + PhysicalDevice physicalDevices[VK_MAX_DEVICE_GROUP_SIZE]; Bool32 subsetAllocation; }; - static_assert( sizeof( PhysicalDeviceGroupPropertiesKHX ) == sizeof( VkPhysicalDeviceGroupPropertiesKHX ), "struct and wrapper have different size!" ); + static_assert( sizeof( PhysicalDeviceGroupProperties ) == sizeof( VkPhysicalDeviceGroupProperties ), "struct and wrapper have different size!" ); + + using PhysicalDeviceGroupPropertiesKHR = PhysicalDeviceGroupProperties; #ifndef VULKAN_HPP_NO_SMART_HANDLE - class DebugReportCallbackEXTDeleter; - using UniqueDebugReportCallbackEXT = UniqueHandle; - class SurfaceKHRDeleter; - using UniqueSurfaceKHR = UniqueHandle; + 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: - Instance() + VULKAN_HPP_CONSTEXPR Instance() : m_instance(VK_NULL_HANDLE) {} - Instance( std::nullptr_t ) + VULKAN_HPP_CONSTEXPR Instance( std::nullptr_t ) : m_instance(VK_NULL_HANDLE) {} VULKAN_HPP_TYPESAFE_EXPLICIT Instance( VkInstance instance ) - : m_instance( instance ) + : m_instance( instance ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -31441,149 +37515,247 @@ return m_instance < rhs.m_instance; } - void destroy( const AllocationCallbacks* pAllocator ) const; + template + void destroy( const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroy( Optional allocator = nullptr ) const; + template + void destroy( Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result enumeratePhysicalDevices( uint32_t* pPhysicalDeviceCount, PhysicalDevice* pPhysicalDevices ) const; + template + Result enumeratePhysicalDevices( uint32_t* pPhysicalDeviceCount, PhysicalDevice* pPhysicalDevices, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type enumeratePhysicalDevices() const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type enumeratePhysicalDevices(Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - PFN_vkVoidFunction getProcAddr( const char* pName ) const; + template + PFN_vkVoidFunction getProcAddr( const char* pName, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - PFN_vkVoidFunction getProcAddr( const std::string & name ) const; + template + PFN_vkVoidFunction getProcAddr( const std::string & name, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_ANDROID_KHR - Result createAndroidSurfaceKHR( const AndroidSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; + template + Result createAndroidSurfaceKHR( const AndroidSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createAndroidSurfaceKHR( const AndroidSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createAndroidSurfaceKHR( const AndroidSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueSurfaceKHR createAndroidSurfaceKHRUnique( const AndroidSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createAndroidSurfaceKHRUnique( const AndroidSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - Result createDisplayPlaneSurfaceKHR( const DisplaySurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; + template + Result createDisplayPlaneSurfaceKHR( const DisplaySurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createDisplayPlaneSurfaceKHR( const DisplaySurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createDisplayPlaneSurfaceKHR( const DisplaySurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueSurfaceKHR createDisplayPlaneSurfaceKHRUnique( const DisplaySurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createDisplayPlaneSurfaceKHRUnique( const DisplaySurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_MIR_KHR - Result createMirSurfaceKHR( const MirSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; + template + Result createMirSurfaceKHR( const MirSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createMirSurfaceKHR( const MirSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createMirSurfaceKHR( const MirSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueSurfaceKHR createMirSurfaceKHRUnique( const MirSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createMirSurfaceKHRUnique( const MirSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_MIR_KHR*/ - void destroySurfaceKHR( SurfaceKHR surface, const AllocationCallbacks* pAllocator ) const; + template + void destroySurfaceKHR( SurfaceKHR surface, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void destroySurfaceKHR( SurfaceKHR surface, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + void destroy( SurfaceKHR surface, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroySurfaceKHR( SurfaceKHR surface, Optional allocator = nullptr ) const; + template + void destroy( SurfaceKHR surface, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_VI_NN - Result createViSurfaceNN( const ViSurfaceCreateInfoNN* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; + template + Result createViSurfaceNN( const ViSurfaceCreateInfoNN* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createViSurfaceNN( const ViSurfaceCreateInfoNN & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createViSurfaceNN( const ViSurfaceCreateInfoNN & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueSurfaceKHR createViSurfaceNNUnique( const ViSurfaceCreateInfoNN & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createViSurfaceNNUnique( const ViSurfaceCreateInfoNN & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_VI_NN*/ #ifdef VK_USE_PLATFORM_WAYLAND_KHR - Result createWaylandSurfaceKHR( const WaylandSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; + template + Result createWaylandSurfaceKHR( const WaylandSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createWaylandSurfaceKHR( const WaylandSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createWaylandSurfaceKHR( const WaylandSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueSurfaceKHR createWaylandSurfaceKHRUnique( const WaylandSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createWaylandSurfaceKHRUnique( const WaylandSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ #ifdef VK_USE_PLATFORM_WIN32_KHR - Result createWin32SurfaceKHR( const Win32SurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; + template + Result createWin32SurfaceKHR( const Win32SurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createWin32SurfaceKHR( const Win32SurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createWin32SurfaceKHR( const Win32SurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueSurfaceKHR createWin32SurfaceKHRUnique( const Win32SurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createWin32SurfaceKHRUnique( const Win32SurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_WIN32_KHR*/ #ifdef VK_USE_PLATFORM_XLIB_KHR - Result createXlibSurfaceKHR( const XlibSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; + template + Result createXlibSurfaceKHR( const XlibSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createXlibSurfaceKHR( const XlibSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createXlibSurfaceKHR( const XlibSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueSurfaceKHR createXlibSurfaceKHRUnique( const XlibSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createXlibSurfaceKHRUnique( const XlibSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_XLIB_KHR*/ #ifdef VK_USE_PLATFORM_XCB_KHR - Result createXcbSurfaceKHR( const XcbSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; + template + Result createXcbSurfaceKHR( const XcbSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createXcbSurfaceKHR( const XcbSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createXcbSurfaceKHR( const XcbSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueSurfaceKHR createXcbSurfaceKHRUnique( const XcbSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createXcbSurfaceKHRUnique( const XcbSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_XCB_KHR*/ - Result createDebugReportCallbackEXT( const DebugReportCallbackCreateInfoEXT* pCreateInfo, const AllocationCallbacks* pAllocator, DebugReportCallbackEXT* pCallback ) const; + template + Result createDebugReportCallbackEXT( const DebugReportCallbackCreateInfoEXT* pCreateInfo, const AllocationCallbacks* pAllocator, DebugReportCallbackEXT* pCallback, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createDebugReportCallbackEXT( const DebugReportCallbackCreateInfoEXT & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createDebugReportCallbackEXT( const DebugReportCallbackCreateInfoEXT & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueDebugReportCallbackEXT createDebugReportCallbackEXTUnique( const DebugReportCallbackCreateInfoEXT & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createDebugReportCallbackEXTUnique( const DebugReportCallbackCreateInfoEXT & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyDebugReportCallbackEXT( DebugReportCallbackEXT callback, const AllocationCallbacks* pAllocator ) const; + template + void destroyDebugReportCallbackEXT( DebugReportCallbackEXT callback, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void destroyDebugReportCallbackEXT( DebugReportCallbackEXT callback, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + void destroy( DebugReportCallbackEXT callback, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyDebugReportCallbackEXT( DebugReportCallbackEXT callback, Optional allocator = nullptr ) const; + template + void destroy( DebugReportCallbackEXT callback, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void debugReportMessageEXT( DebugReportFlagsEXT flags, DebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage ) const; + template + void debugReportMessageEXT( DebugReportFlagsEXT flags, DebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void debugReportMessageEXT( DebugReportFlagsEXT flags, DebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const std::string & layerPrefix, const std::string & message ) const; + template + void debugReportMessageEXT( DebugReportFlagsEXT flags, DebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const std::string & layerPrefix, const std::string & message, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result enumeratePhysicalDeviceGroupsKHX( uint32_t* pPhysicalDeviceGroupCount, PhysicalDeviceGroupPropertiesKHX* pPhysicalDeviceGroupProperties ) const; + template + Result enumeratePhysicalDeviceGroups( uint32_t* pPhysicalDeviceGroupCount, PhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type enumeratePhysicalDeviceGroupsKHX() const; + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type enumeratePhysicalDeviceGroups(Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + Result enumeratePhysicalDeviceGroupsKHR( uint32_t* pPhysicalDeviceGroupCount, PhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template , typename Dispatch = DispatchLoaderStatic> + typename ResultValueType>::type enumeratePhysicalDeviceGroupsKHR(Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_IOS_MVK - Result createIOSSurfaceMVK( const IOSSurfaceCreateInfoMVK* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; + template + Result createIOSSurfaceMVK( const IOSSurfaceCreateInfoMVK* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createIOSSurfaceMVK( const IOSSurfaceCreateInfoMVK & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createIOSSurfaceMVK( const IOSSurfaceCreateInfoMVK & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueSurfaceKHR createIOSSurfaceMVKUnique( const IOSSurfaceCreateInfoMVK & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createIOSSurfaceMVKUnique( const IOSSurfaceCreateInfoMVK & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_IOS_MVK*/ #ifdef VK_USE_PLATFORM_MACOS_MVK - Result createMacOSSurfaceMVK( const MacOSSurfaceCreateInfoMVK* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; + template + Result createMacOSSurfaceMVK( const MacOSSurfaceCreateInfoMVK* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createMacOSSurfaceMVK( const MacOSSurfaceCreateInfoMVK & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createMacOSSurfaceMVK( const MacOSSurfaceCreateInfoMVK & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueSurfaceKHR createMacOSSurfaceMVKUnique( const MacOSSurfaceCreateInfoMVK & createInfo, Optional allocator = nullptr ) const; + template + ResultValueType::type createMacOSSurfaceMVKUnique( const MacOSSurfaceCreateInfoMVK & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_MACOS_MVK*/ + template + Result createDebugUtilsMessengerEXT( const DebugUtilsMessengerCreateInfoEXT* pCreateInfo, const AllocationCallbacks* pAllocator, DebugUtilsMessengerEXT* pMessenger, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + ResultValueType::type createDebugUtilsMessengerEXT( const DebugUtilsMessengerCreateInfoEXT & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + ResultValueType::type createDebugUtilsMessengerEXTUnique( const DebugUtilsMessengerCreateInfoEXT & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + void destroyDebugUtilsMessengerEXT( DebugUtilsMessengerEXT messenger, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void destroyDebugUtilsMessengerEXT( DebugUtilsMessengerEXT messenger, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + void destroy( DebugUtilsMessengerEXT messenger, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void destroy( DebugUtilsMessengerEXT messenger, Optional allocator = nullptr, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + void submitDebugUtilsMessageEXT( DebugUtilsMessageSeverityFlagBitsEXT messageSeverity, DebugUtilsMessageTypeFlagsEXT messageTypes, const DebugUtilsMessengerCallbackDataEXT* pCallbackData, Dispatch const &d = Dispatch() ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + void submitDebugUtilsMessageEXT( DebugUtilsMessageSeverityFlagBitsEXT messageSeverity, DebugUtilsMessageTypeFlagsEXT messageTypes, const DebugUtilsMessengerCallbackDataEXT & callbackData, Dispatch const &d = Dispatch() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkInstance() const @@ -31607,441 +37779,597 @@ static_assert( sizeof( Instance ) == sizeof( VkInstance ), "handle and wrapper have different size!" ); -#ifndef VULKAN_HPP_NO_SMART_HANDLE - class DebugReportCallbackEXTDeleter - { - public: - DebugReportCallbackEXTDeleter( Instance instance = Instance(), Optional allocator = nullptr ) - : m_instance( instance ) - , m_allocator( allocator ) - {} - - void operator()( DebugReportCallbackEXT debugReportCallbackEXT ) - { - m_instance.destroyDebugReportCallbackEXT( debugReportCallbackEXT, m_allocator ); - } - - private: - Instance m_instance; - Optional m_allocator; - }; - - class SurfaceKHRDeleter - { - public: - SurfaceKHRDeleter( Instance instance = Instance(), Optional allocator = nullptr ) - : m_instance( instance ) - , m_allocator( allocator ) - {} - - void operator()( SurfaceKHR surfaceKHR ) - { - m_instance.destroySurfaceKHR( surfaceKHR, m_allocator ); - } - - private: - Instance m_instance; - Optional m_allocator; - }; -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ - - VULKAN_HPP_INLINE void Instance::destroy( const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Instance::destroy( const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyInstance( m_instance, reinterpret_cast( pAllocator ) ); + d.vkDestroyInstance( m_instance, reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Instance::destroy( Optional allocator ) const + template + VULKAN_HPP_INLINE void Instance::destroy( Optional allocator, Dispatch const &d ) const { - vkDestroyInstance( m_instance, reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyInstance( m_instance, reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Instance::enumeratePhysicalDevices( uint32_t* pPhysicalDeviceCount, PhysicalDevice* pPhysicalDevices ) const + template + VULKAN_HPP_INLINE Result Instance::enumeratePhysicalDevices( uint32_t* pPhysicalDeviceCount, PhysicalDevice* pPhysicalDevices, Dispatch const &d) const { - return static_cast( vkEnumeratePhysicalDevices( m_instance, pPhysicalDeviceCount, reinterpret_cast( pPhysicalDevices ) ) ); + return static_cast( d.vkEnumeratePhysicalDevices( m_instance, pPhysicalDeviceCount, reinterpret_cast( pPhysicalDevices ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type Instance::enumeratePhysicalDevices() const + template + VULKAN_HPP_INLINE typename ResultValueType>::type Instance::enumeratePhysicalDevices(Dispatch const &d ) const { std::vector physicalDevices; uint32_t physicalDeviceCount; Result result; do { - result = static_cast( vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, nullptr ) ); + result = static_cast( d.vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, nullptr ) ); if ( ( result == Result::eSuccess ) && physicalDeviceCount ) { physicalDevices.resize( physicalDeviceCount ); - result = static_cast( vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, reinterpret_cast( physicalDevices.data() ) ) ); + result = static_cast( d.vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, reinterpret_cast( physicalDevices.data() ) ) ); } } while ( result == Result::eIncomplete ); - assert( physicalDeviceCount <= physicalDevices.size() ); + VULKAN_HPP_ASSERT( physicalDeviceCount <= physicalDevices.size() ); physicalDevices.resize( physicalDeviceCount ); - return createResultValue( result, physicalDevices, "VULKAN_HPP_NAMESPACE::Instance::enumeratePhysicalDevices" ); + return createResultValue( result, physicalDevices, VULKAN_HPP_NAMESPACE_STRING"::Instance::enumeratePhysicalDevices" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE PFN_vkVoidFunction Instance::getProcAddr( const char* pName ) const + template + VULKAN_HPP_INLINE PFN_vkVoidFunction Instance::getProcAddr( const char* pName, Dispatch const &d) const { - return vkGetInstanceProcAddr( m_instance, pName ); + return d.vkGetInstanceProcAddr( m_instance, pName ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE PFN_vkVoidFunction Instance::getProcAddr( const std::string & name ) const + template + VULKAN_HPP_INLINE PFN_vkVoidFunction Instance::getProcAddr( const std::string & name, Dispatch const &d ) const { - return vkGetInstanceProcAddr( m_instance, name.c_str() ); + return d.vkGetInstanceProcAddr( m_instance, name.c_str() ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_ANDROID_KHR - VULKAN_HPP_INLINE Result Instance::createAndroidSurfaceKHR( const AndroidSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + template + VULKAN_HPP_INLINE Result Instance::createAndroidSurfaceKHR( const AndroidSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d) const { - return static_cast( vkCreateAndroidSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + return static_cast( d.vkCreateAndroidSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Instance::createAndroidSurfaceKHR( const AndroidSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createAndroidSurfaceKHR( const AndroidSurfaceCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { SurfaceKHR surface; - Result result = static_cast( vkCreateAndroidSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); - return createResultValue( result, surface, "VULKAN_HPP_NAMESPACE::Instance::createAndroidSurfaceKHR" ); + Result result = static_cast( d.vkCreateAndroidSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createAndroidSurfaceKHR" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createAndroidSurfaceKHRUnique( const AndroidSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createAndroidSurfaceKHRUnique( const AndroidSurfaceCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { - SurfaceKHRDeleter deleter( *this, allocator ); - return UniqueSurfaceKHR( createAndroidSurfaceKHR( createInfo, allocator ), deleter ); + SurfaceKHR surface; + Result result = static_cast( d.vkCreateAndroidSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createAndroidSurfaceKHRUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - VULKAN_HPP_INLINE Result Instance::createDisplayPlaneSurfaceKHR( const DisplaySurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + template + VULKAN_HPP_INLINE Result Instance::createDisplayPlaneSurfaceKHR( const DisplaySurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d) const { - return static_cast( vkCreateDisplayPlaneSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + return static_cast( d.vkCreateDisplayPlaneSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Instance::createDisplayPlaneSurfaceKHR( const DisplaySurfaceCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createDisplayPlaneSurfaceKHR( const DisplaySurfaceCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { SurfaceKHR surface; - Result result = static_cast( vkCreateDisplayPlaneSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); - return createResultValue( result, surface, "VULKAN_HPP_NAMESPACE::Instance::createDisplayPlaneSurfaceKHR" ); + Result result = static_cast( d.vkCreateDisplayPlaneSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createDisplayPlaneSurfaceKHR" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createDisplayPlaneSurfaceKHRUnique( const DisplaySurfaceCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createDisplayPlaneSurfaceKHRUnique( const DisplaySurfaceCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { - SurfaceKHRDeleter deleter( *this, allocator ); - return UniqueSurfaceKHR( createDisplayPlaneSurfaceKHR( createInfo, allocator ), deleter ); + SurfaceKHR surface; + Result result = static_cast( d.vkCreateDisplayPlaneSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createDisplayPlaneSurfaceKHRUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_MIR_KHR - VULKAN_HPP_INLINE Result Instance::createMirSurfaceKHR( const MirSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + template + VULKAN_HPP_INLINE Result Instance::createMirSurfaceKHR( const MirSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d) const { - return static_cast( vkCreateMirSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + return static_cast( d.vkCreateMirSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Instance::createMirSurfaceKHR( const MirSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createMirSurfaceKHR( const MirSurfaceCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { SurfaceKHR surface; - Result result = static_cast( vkCreateMirSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); - return createResultValue( result, surface, "VULKAN_HPP_NAMESPACE::Instance::createMirSurfaceKHR" ); + Result result = static_cast( d.vkCreateMirSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createMirSurfaceKHR" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createMirSurfaceKHRUnique( const MirSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createMirSurfaceKHRUnique( const MirSurfaceCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { - SurfaceKHRDeleter deleter( *this, allocator ); - return UniqueSurfaceKHR( createMirSurfaceKHR( createInfo, allocator ), deleter ); + SurfaceKHR surface; + Result result = static_cast( d.vkCreateMirSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createMirSurfaceKHRUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_MIR_KHR*/ - VULKAN_HPP_INLINE void Instance::destroySurfaceKHR( SurfaceKHR surface, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Instance::destroySurfaceKHR( SurfaceKHR surface, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroySurfaceKHR( m_instance, static_cast( surface ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Instance::destroySurfaceKHR( SurfaceKHR surface, Optional allocator, Dispatch const &d ) const + { + 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( SurfaceKHR surface, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroySurfaceKHR( m_instance, static_cast( surface ), reinterpret_cast( pAllocator ) ); + d.vkDestroySurfaceKHR( m_instance, static_cast( surface ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Instance::destroySurfaceKHR( SurfaceKHR surface, Optional allocator ) const + template + VULKAN_HPP_INLINE void Instance::destroy( SurfaceKHR surface, Optional allocator, Dispatch const &d ) const { - vkDestroySurfaceKHR( m_instance, static_cast( surface ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroySurfaceKHR( m_instance, static_cast( surface ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_VI_NN - VULKAN_HPP_INLINE Result Instance::createViSurfaceNN( const ViSurfaceCreateInfoNN* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + template + VULKAN_HPP_INLINE Result Instance::createViSurfaceNN( const ViSurfaceCreateInfoNN* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d) const { - return static_cast( vkCreateViSurfaceNN( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + return static_cast( d.vkCreateViSurfaceNN( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Instance::createViSurfaceNN( const ViSurfaceCreateInfoNN & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createViSurfaceNN( const ViSurfaceCreateInfoNN & createInfo, Optional allocator, Dispatch const &d ) const { SurfaceKHR surface; - Result result = static_cast( vkCreateViSurfaceNN( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); - return createResultValue( result, surface, "VULKAN_HPP_NAMESPACE::Instance::createViSurfaceNN" ); + Result result = static_cast( d.vkCreateViSurfaceNN( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createViSurfaceNN" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createViSurfaceNNUnique( const ViSurfaceCreateInfoNN & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createViSurfaceNNUnique( const ViSurfaceCreateInfoNN & createInfo, Optional allocator, Dispatch const &d ) const { - SurfaceKHRDeleter deleter( *this, allocator ); - return UniqueSurfaceKHR( createViSurfaceNN( createInfo, allocator ), deleter ); + SurfaceKHR surface; + Result result = static_cast( d.vkCreateViSurfaceNN( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createViSurfaceNNUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_VI_NN*/ #ifdef VK_USE_PLATFORM_WAYLAND_KHR - VULKAN_HPP_INLINE Result Instance::createWaylandSurfaceKHR( const WaylandSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + template + VULKAN_HPP_INLINE Result Instance::createWaylandSurfaceKHR( const WaylandSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d) const { - return static_cast( vkCreateWaylandSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + return static_cast( d.vkCreateWaylandSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Instance::createWaylandSurfaceKHR( const WaylandSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createWaylandSurfaceKHR( const WaylandSurfaceCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { SurfaceKHR surface; - Result result = static_cast( vkCreateWaylandSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); - return createResultValue( result, surface, "VULKAN_HPP_NAMESPACE::Instance::createWaylandSurfaceKHR" ); + Result result = static_cast( d.vkCreateWaylandSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createWaylandSurfaceKHR" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createWaylandSurfaceKHRUnique( const WaylandSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createWaylandSurfaceKHRUnique( const WaylandSurfaceCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { - SurfaceKHRDeleter deleter( *this, allocator ); - return UniqueSurfaceKHR( createWaylandSurfaceKHR( createInfo, allocator ), deleter ); + SurfaceKHR surface; + Result result = static_cast( d.vkCreateWaylandSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createWaylandSurfaceKHRUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ #ifdef VK_USE_PLATFORM_WIN32_KHR - VULKAN_HPP_INLINE Result Instance::createWin32SurfaceKHR( const Win32SurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + template + VULKAN_HPP_INLINE Result Instance::createWin32SurfaceKHR( const Win32SurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d) const { - return static_cast( vkCreateWin32SurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + return static_cast( d.vkCreateWin32SurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Instance::createWin32SurfaceKHR( const Win32SurfaceCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createWin32SurfaceKHR( const Win32SurfaceCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { SurfaceKHR surface; - Result result = static_cast( vkCreateWin32SurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); - return createResultValue( result, surface, "VULKAN_HPP_NAMESPACE::Instance::createWin32SurfaceKHR" ); + Result result = static_cast( d.vkCreateWin32SurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createWin32SurfaceKHR" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createWin32SurfaceKHRUnique( const Win32SurfaceCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createWin32SurfaceKHRUnique( const Win32SurfaceCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { - SurfaceKHRDeleter deleter( *this, allocator ); - return UniqueSurfaceKHR( createWin32SurfaceKHR( createInfo, allocator ), deleter ); + SurfaceKHR surface; + Result result = static_cast( d.vkCreateWin32SurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createWin32SurfaceKHRUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_WIN32_KHR*/ #ifdef VK_USE_PLATFORM_XLIB_KHR - VULKAN_HPP_INLINE Result Instance::createXlibSurfaceKHR( const XlibSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + template + VULKAN_HPP_INLINE Result Instance::createXlibSurfaceKHR( const XlibSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d) const { - return static_cast( vkCreateXlibSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + return static_cast( d.vkCreateXlibSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Instance::createXlibSurfaceKHR( const XlibSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createXlibSurfaceKHR( const XlibSurfaceCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { SurfaceKHR surface; - Result result = static_cast( vkCreateXlibSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); - return createResultValue( result, surface, "VULKAN_HPP_NAMESPACE::Instance::createXlibSurfaceKHR" ); + Result result = static_cast( d.vkCreateXlibSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createXlibSurfaceKHR" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createXlibSurfaceKHRUnique( const XlibSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createXlibSurfaceKHRUnique( const XlibSurfaceCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { - SurfaceKHRDeleter deleter( *this, allocator ); - return UniqueSurfaceKHR( createXlibSurfaceKHR( createInfo, allocator ), deleter ); + SurfaceKHR surface; + Result result = static_cast( d.vkCreateXlibSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createXlibSurfaceKHRUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_XLIB_KHR*/ #ifdef VK_USE_PLATFORM_XCB_KHR - VULKAN_HPP_INLINE Result Instance::createXcbSurfaceKHR( const XcbSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + template + VULKAN_HPP_INLINE Result Instance::createXcbSurfaceKHR( const XcbSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d) const { - return static_cast( vkCreateXcbSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + return static_cast( d.vkCreateXcbSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Instance::createXcbSurfaceKHR( const XcbSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createXcbSurfaceKHR( const XcbSurfaceCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { SurfaceKHR surface; - Result result = static_cast( vkCreateXcbSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); - return createResultValue( result, surface, "VULKAN_HPP_NAMESPACE::Instance::createXcbSurfaceKHR" ); + Result result = static_cast( d.vkCreateXcbSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createXcbSurfaceKHR" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createXcbSurfaceKHRUnique( const XcbSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createXcbSurfaceKHRUnique( const XcbSurfaceCreateInfoKHR & createInfo, Optional allocator, Dispatch const &d ) const { - SurfaceKHRDeleter deleter( *this, allocator ); - return UniqueSurfaceKHR( createXcbSurfaceKHR( createInfo, allocator ), deleter ); + SurfaceKHR surface; + Result result = static_cast( d.vkCreateXcbSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createXcbSurfaceKHRUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_XCB_KHR*/ - VULKAN_HPP_INLINE Result Instance::createDebugReportCallbackEXT( const DebugReportCallbackCreateInfoEXT* pCreateInfo, const AllocationCallbacks* pAllocator, DebugReportCallbackEXT* pCallback ) const + template + VULKAN_HPP_INLINE Result Instance::createDebugReportCallbackEXT( const DebugReportCallbackCreateInfoEXT* pCreateInfo, const AllocationCallbacks* pAllocator, DebugReportCallbackEXT* pCallback, Dispatch const &d) const { - return static_cast( vkCreateDebugReportCallbackEXT( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pCallback ) ) ); + return static_cast( d.vkCreateDebugReportCallbackEXT( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pCallback ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Instance::createDebugReportCallbackEXT( const DebugReportCallbackCreateInfoEXT & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createDebugReportCallbackEXT( const DebugReportCallbackCreateInfoEXT & createInfo, Optional allocator, Dispatch const &d ) const { DebugReportCallbackEXT callback; - Result result = static_cast( vkCreateDebugReportCallbackEXT( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &callback ) ) ); - return createResultValue( result, callback, "VULKAN_HPP_NAMESPACE::Instance::createDebugReportCallbackEXT" ); + Result result = static_cast( d.vkCreateDebugReportCallbackEXT( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &callback ) ) ); + return createResultValue( result, callback, VULKAN_HPP_NAMESPACE_STRING"::Instance::createDebugReportCallbackEXT" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueDebugReportCallbackEXT Instance::createDebugReportCallbackEXTUnique( const DebugReportCallbackCreateInfoEXT & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createDebugReportCallbackEXTUnique( const DebugReportCallbackCreateInfoEXT & createInfo, Optional allocator, Dispatch const &d ) const { - DebugReportCallbackEXTDeleter deleter( *this, allocator ); - return UniqueDebugReportCallbackEXT( createDebugReportCallbackEXT( createInfo, allocator ), deleter ); + DebugReportCallbackEXT callback; + Result result = static_cast( d.vkCreateDebugReportCallbackEXT( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &callback ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, callback, VULKAN_HPP_NAMESPACE_STRING"::Instance::createDebugReportCallbackEXTUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Instance::destroyDebugReportCallbackEXT( DebugReportCallbackEXT callback, const AllocationCallbacks* pAllocator ) const + template + VULKAN_HPP_INLINE void Instance::destroyDebugReportCallbackEXT( DebugReportCallbackEXT callback, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDestroyDebugReportCallbackEXT( m_instance, static_cast( callback ), reinterpret_cast( pAllocator ) ); + d.vkDestroyDebugReportCallbackEXT( m_instance, static_cast( callback ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Instance::destroyDebugReportCallbackEXT( DebugReportCallbackEXT callback, Optional allocator ) const + template + VULKAN_HPP_INLINE void Instance::destroyDebugReportCallbackEXT( DebugReportCallbackEXT callback, Optional allocator, Dispatch const &d ) const { - vkDestroyDebugReportCallbackEXT( m_instance, static_cast( callback ), reinterpret_cast( static_cast( allocator ) ) ); + d.vkDestroyDebugReportCallbackEXT( m_instance, static_cast( callback ), reinterpret_cast( static_cast( allocator ) ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE void Instance::debugReportMessageEXT( DebugReportFlagsEXT flags, DebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage ) const + template + VULKAN_HPP_INLINE void Instance::destroy( DebugReportCallbackEXT callback, const AllocationCallbacks* pAllocator, Dispatch const &d) const { - vkDebugReportMessageEXT( m_instance, static_cast( flags ), static_cast( objectType ), object, location, messageCode, pLayerPrefix, pMessage ); + d.vkDestroyDebugReportCallbackEXT( m_instance, static_cast( callback ), reinterpret_cast( pAllocator ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE void Instance::debugReportMessageEXT( DebugReportFlagsEXT flags, DebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const std::string & layerPrefix, const std::string & message ) const + template + VULKAN_HPP_INLINE void Instance::destroy( DebugReportCallbackEXT callback, Optional allocator, Dispatch const &d ) const + { + 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( DebugReportFlagsEXT flags, DebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage, Dispatch const &d) const + { + 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( DebugReportFlagsEXT flags, DebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const std::string & layerPrefix, const std::string & message, Dispatch const &d ) const { #ifdef VULKAN_HPP_NO_EXCEPTIONS - assert( layerPrefix.size() == message.size() ); + VULKAN_HPP_ASSERT( layerPrefix.size() == message.size() ); #else if ( layerPrefix.size() != message.size() ) { - throw LogicError( "VULKAN_HPP_NAMESPACE::Instance::debugReportMessageEXT: layerPrefix.size() != message.size()" ); + throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::Instance::debugReportMessageEXT: layerPrefix.size() != message.size()" ); } #endif // VULKAN_HPP_NO_EXCEPTIONS - vkDebugReportMessageEXT( m_instance, static_cast( flags ), static_cast( objectType ), object, location, messageCode, layerPrefix.c_str(), message.c_str() ); + 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*/ + + template + VULKAN_HPP_INLINE Result Instance::enumeratePhysicalDeviceGroups( uint32_t* pPhysicalDeviceGroupCount, PhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties, Dispatch const &d) const + { + return static_cast( d.vkEnumeratePhysicalDeviceGroups( m_instance, pPhysicalDeviceGroupCount, reinterpret_cast( pPhysicalDeviceGroupProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type Instance::enumeratePhysicalDeviceGroups(Dispatch const &d ) const + { + std::vector physicalDeviceGroupProperties; + uint32_t physicalDeviceGroupCount; + Result result; + do + { + result = static_cast( d.vkEnumeratePhysicalDeviceGroups( m_instance, &physicalDeviceGroupCount, nullptr ) ); + if ( ( result == Result::eSuccess ) && physicalDeviceGroupCount ) + { + physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); + result = static_cast( d.vkEnumeratePhysicalDeviceGroups( m_instance, &physicalDeviceGroupCount, reinterpret_cast( physicalDeviceGroupProperties.data() ) ) ); + } + } while ( result == Result::eIncomplete ); + VULKAN_HPP_ASSERT( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); + physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); + return createResultValue( result, physicalDeviceGroupProperties, VULKAN_HPP_NAMESPACE_STRING"::Instance::enumeratePhysicalDeviceGroups" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - VULKAN_HPP_INLINE Result Instance::enumeratePhysicalDeviceGroupsKHX( uint32_t* pPhysicalDeviceGroupCount, PhysicalDeviceGroupPropertiesKHX* pPhysicalDeviceGroupProperties ) const + template + VULKAN_HPP_INLINE Result Instance::enumeratePhysicalDeviceGroupsKHR( uint32_t* pPhysicalDeviceGroupCount, PhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties, Dispatch const &d) const { - return static_cast( vkEnumeratePhysicalDeviceGroupsKHX( m_instance, pPhysicalDeviceGroupCount, reinterpret_cast( pPhysicalDeviceGroupProperties ) ) ); + return static_cast( d.vkEnumeratePhysicalDeviceGroupsKHR( m_instance, pPhysicalDeviceGroupCount, reinterpret_cast( pPhysicalDeviceGroupProperties ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType>::type Instance::enumeratePhysicalDeviceGroupsKHX() const + template + VULKAN_HPP_INLINE typename ResultValueType>::type Instance::enumeratePhysicalDeviceGroupsKHR(Dispatch const &d ) const { - std::vector physicalDeviceGroupProperties; + std::vector physicalDeviceGroupProperties; uint32_t physicalDeviceGroupCount; Result result; do { - result = static_cast( vkEnumeratePhysicalDeviceGroupsKHX( m_instance, &physicalDeviceGroupCount, nullptr ) ); + result = static_cast( d.vkEnumeratePhysicalDeviceGroupsKHR( m_instance, &physicalDeviceGroupCount, nullptr ) ); if ( ( result == Result::eSuccess ) && physicalDeviceGroupCount ) { physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); - result = static_cast( vkEnumeratePhysicalDeviceGroupsKHX( m_instance, &physicalDeviceGroupCount, reinterpret_cast( physicalDeviceGroupProperties.data() ) ) ); + result = static_cast( d.vkEnumeratePhysicalDeviceGroupsKHR( m_instance, &physicalDeviceGroupCount, reinterpret_cast( physicalDeviceGroupProperties.data() ) ) ); } } while ( result == Result::eIncomplete ); - assert( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); + VULKAN_HPP_ASSERT( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); - return createResultValue( result, physicalDeviceGroupProperties, "VULKAN_HPP_NAMESPACE::Instance::enumeratePhysicalDeviceGroupsKHX" ); + return createResultValue( result, physicalDeviceGroupProperties, VULKAN_HPP_NAMESPACE_STRING"::Instance::enumeratePhysicalDeviceGroupsKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_IOS_MVK - VULKAN_HPP_INLINE Result Instance::createIOSSurfaceMVK( const IOSSurfaceCreateInfoMVK* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + template + VULKAN_HPP_INLINE Result Instance::createIOSSurfaceMVK( const IOSSurfaceCreateInfoMVK* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d) const { - return static_cast( vkCreateIOSSurfaceMVK( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + return static_cast( d.vkCreateIOSSurfaceMVK( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Instance::createIOSSurfaceMVK( const IOSSurfaceCreateInfoMVK & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createIOSSurfaceMVK( const IOSSurfaceCreateInfoMVK & createInfo, Optional allocator, Dispatch const &d ) const { SurfaceKHR surface; - Result result = static_cast( vkCreateIOSSurfaceMVK( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); - return createResultValue( result, surface, "VULKAN_HPP_NAMESPACE::Instance::createIOSSurfaceMVK" ); + Result result = static_cast( d.vkCreateIOSSurfaceMVK( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createIOSSurfaceMVK" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createIOSSurfaceMVKUnique( const IOSSurfaceCreateInfoMVK & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createIOSSurfaceMVKUnique( const IOSSurfaceCreateInfoMVK & createInfo, Optional allocator, Dispatch const &d ) const { - SurfaceKHRDeleter deleter( *this, allocator ); - return UniqueSurfaceKHR( createIOSSurfaceMVK( createInfo, allocator ), deleter ); + SurfaceKHR surface; + Result result = static_cast( d.vkCreateIOSSurfaceMVK( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createIOSSurfaceMVKUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_IOS_MVK*/ #ifdef VK_USE_PLATFORM_MACOS_MVK - VULKAN_HPP_INLINE Result Instance::createMacOSSurfaceMVK( const MacOSSurfaceCreateInfoMVK* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + template + VULKAN_HPP_INLINE Result Instance::createMacOSSurfaceMVK( const MacOSSurfaceCreateInfoMVK* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface, Dispatch const &d) const { - return static_cast( vkCreateMacOSSurfaceMVK( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + return static_cast( d.vkCreateMacOSSurfaceMVK( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type Instance::createMacOSSurfaceMVK( const MacOSSurfaceCreateInfoMVK & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createMacOSSurfaceMVK( const MacOSSurfaceCreateInfoMVK & createInfo, Optional allocator, Dispatch const &d ) const { SurfaceKHR surface; - Result result = static_cast( vkCreateMacOSSurfaceMVK( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); - return createResultValue( result, surface, "VULKAN_HPP_NAMESPACE::Instance::createMacOSSurfaceMVK" ); + Result result = static_cast( d.vkCreateMacOSSurfaceMVK( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createMacOSSurfaceMVK" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createMacOSSurfaceMVKUnique( const MacOSSurfaceCreateInfoMVK & createInfo, Optional allocator ) const + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createMacOSSurfaceMVKUnique( const MacOSSurfaceCreateInfoMVK & createInfo, Optional allocator, Dispatch const &d ) const { - SurfaceKHRDeleter deleter( *this, allocator ); - return UniqueSurfaceKHR( createMacOSSurfaceMVK( createInfo, allocator ), deleter ); + SurfaceKHR surface; + Result result = static_cast( d.vkCreateMacOSSurfaceMVK( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, surface, VULKAN_HPP_NAMESPACE_STRING"::Instance::createMacOSSurfaceMVKUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_MACOS_MVK*/ - struct DeviceGroupDeviceCreateInfoKHX + template + VULKAN_HPP_INLINE Result Instance::createDebugUtilsMessengerEXT( const DebugUtilsMessengerCreateInfoEXT* pCreateInfo, const AllocationCallbacks* pAllocator, DebugUtilsMessengerEXT* pMessenger, Dispatch const &d) const + { + 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_INLINE ResultValueType::type Instance::createDebugUtilsMessengerEXT( const DebugUtilsMessengerCreateInfoEXT & createInfo, Optional allocator, Dispatch const &d ) const + { + DebugUtilsMessengerEXT messenger; + Result result = static_cast( d.vkCreateDebugUtilsMessengerEXT( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &messenger ) ) ); + return createResultValue( result, messenger, VULKAN_HPP_NAMESPACE_STRING"::Instance::createDebugUtilsMessengerEXT" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + VULKAN_HPP_INLINE ResultValueType::type Instance::createDebugUtilsMessengerEXTUnique( const DebugUtilsMessengerCreateInfoEXT & createInfo, Optional allocator, Dispatch const &d ) const + { + DebugUtilsMessengerEXT messenger; + Result result = static_cast( d.vkCreateDebugUtilsMessengerEXT( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &messenger ) ) ); + + ObjectDestroy deleter( *this, allocator ); + return createResultValue( result, messenger, VULKAN_HPP_NAMESPACE_STRING"::Instance::createDebugUtilsMessengerEXTUnique", deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + template + VULKAN_HPP_INLINE void Instance::destroyDebugUtilsMessengerEXT( DebugUtilsMessengerEXT messenger, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyDebugUtilsMessengerEXT( m_instance, static_cast( messenger ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Instance::destroyDebugUtilsMessengerEXT( DebugUtilsMessengerEXT messenger, Optional allocator, Dispatch const &d ) const + { + 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( DebugUtilsMessengerEXT messenger, const AllocationCallbacks* pAllocator, Dispatch const &d) const + { + d.vkDestroyDebugUtilsMessengerEXT( m_instance, static_cast( messenger ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void Instance::destroy( DebugUtilsMessengerEXT messenger, Optional allocator, Dispatch const &d ) const + { + 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( DebugUtilsMessageSeverityFlagBitsEXT messageSeverity, DebugUtilsMessageTypeFlagsEXT messageTypes, const DebugUtilsMessengerCallbackDataEXT* pCallbackData, Dispatch const &d) const + { + 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( DebugUtilsMessageSeverityFlagBitsEXT messageSeverity, DebugUtilsMessageTypeFlagsEXT messageTypes, const DebugUtilsMessengerCallbackDataEXT & callbackData, Dispatch const &d ) const + { + d.vkSubmitDebugUtilsMessageEXT( m_instance, static_cast( messageSeverity ), static_cast( messageTypes ), reinterpret_cast( &callbackData ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + struct DeviceGroupDeviceCreateInfo { - DeviceGroupDeviceCreateInfoKHX( uint32_t physicalDeviceCount_ = 0, const PhysicalDevice* pPhysicalDevices_ = nullptr ) - : sType( StructureType::eDeviceGroupDeviceCreateInfoKHX ) - , pNext( nullptr ) - , physicalDeviceCount( physicalDeviceCount_ ) + DeviceGroupDeviceCreateInfo( uint32_t physicalDeviceCount_ = 0, const PhysicalDevice* pPhysicalDevices_ = nullptr ) + : physicalDeviceCount( physicalDeviceCount_ ) , pPhysicalDevices( pPhysicalDevices_ ) { } - DeviceGroupDeviceCreateInfoKHX( VkDeviceGroupDeviceCreateInfoKHX const & rhs ) + DeviceGroupDeviceCreateInfo( VkDeviceGroupDeviceCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceGroupDeviceCreateInfoKHX ) ); + memcpy( this, &rhs, sizeof( DeviceGroupDeviceCreateInfo ) ); } - DeviceGroupDeviceCreateInfoKHX& operator=( VkDeviceGroupDeviceCreateInfoKHX const & rhs ) + DeviceGroupDeviceCreateInfo& operator=( VkDeviceGroupDeviceCreateInfo const & rhs ) { - memcpy( this, &rhs, sizeof( DeviceGroupDeviceCreateInfoKHX ) ); + memcpy( this, &rhs, sizeof( DeviceGroupDeviceCreateInfo ) ); return *this; } - DeviceGroupDeviceCreateInfoKHX& setPNext( const void* pNext_ ) + DeviceGroupDeviceCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; return *this; } - DeviceGroupDeviceCreateInfoKHX& setPhysicalDeviceCount( uint32_t physicalDeviceCount_ ) + DeviceGroupDeviceCreateInfo& setPhysicalDeviceCount( uint32_t physicalDeviceCount_ ) { physicalDeviceCount = physicalDeviceCount_; return *this; } - DeviceGroupDeviceCreateInfoKHX& setPPhysicalDevices( const PhysicalDevice* pPhysicalDevices_ ) + DeviceGroupDeviceCreateInfo& setPPhysicalDevices( const PhysicalDevice* pPhysicalDevices_ ) { pPhysicalDevices = pPhysicalDevices_; return *this; } - operator const VkDeviceGroupDeviceCreateInfoKHX&() const + operator const VkDeviceGroupDeviceCreateInfo&() const { - return *reinterpret_cast(this); + return *reinterpret_cast(this); } - bool operator==( DeviceGroupDeviceCreateInfoKHX const& rhs ) const + bool operator==( DeviceGroupDeviceCreateInfo const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) @@ -32049,177 +38377,207 @@ && ( pPhysicalDevices == rhs.pPhysicalDevices ); } - bool operator!=( DeviceGroupDeviceCreateInfoKHX const& rhs ) const + bool operator!=( DeviceGroupDeviceCreateInfo const& rhs ) const { return !operator==( rhs ); } private: - StructureType sType; + StructureType sType = StructureType::eDeviceGroupDeviceCreateInfo; public: - const void* pNext; + const void* pNext = nullptr; uint32_t physicalDeviceCount; const PhysicalDevice* pPhysicalDevices; }; - static_assert( sizeof( DeviceGroupDeviceCreateInfoKHX ) == sizeof( VkDeviceGroupDeviceCreateInfoKHX ), "struct and wrapper have different size!" ); + static_assert( sizeof( DeviceGroupDeviceCreateInfo ) == sizeof( VkDeviceGroupDeviceCreateInfo ), "struct and wrapper have different size!" ); + + using DeviceGroupDeviceCreateInfoKHR = DeviceGroupDeviceCreateInfo; #ifndef VULKAN_HPP_NO_SMART_HANDLE - class InstanceDeleter; - using UniqueInstance = UniqueHandle; + + template <> class UniqueHandleTraits {public: using deleter = ObjectDestroy; }; + using UniqueInstance = UniqueHandle; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ - Result createInstance( const InstanceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Instance* pInstance ); + template + Result createInstance( const InstanceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Instance* pInstance, Dispatch const &d = Dispatch() ); #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createInstance( const InstanceCreateInfo & createInfo, Optional allocator = nullptr ); + template + ResultValueType::type createInstance( const InstanceCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ); #ifndef VULKAN_HPP_NO_SMART_HANDLE - UniqueInstance createInstanceUnique( const InstanceCreateInfo & createInfo, Optional allocator = nullptr ); + template + ResultValueType::type createInstanceUnique( const InstanceCreateInfo & createInfo, Optional allocator = nullptr, Dispatch const &d = Dispatch() ); #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifndef VULKAN_HPP_NO_SMART_HANDLE - class InstanceDeleter - { - public: - InstanceDeleter( Optional allocator = nullptr ) - : m_allocator( allocator ) - {} - - void operator()( Instance instance ) - { - instance.destroy( m_allocator ); - } - - private: - Optional m_allocator; - }; -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ - - VULKAN_HPP_INLINE Result createInstance( const InstanceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Instance* pInstance ) + template + VULKAN_HPP_INLINE Result createInstance( const InstanceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Instance* pInstance, Dispatch const &d) { - return static_cast( vkCreateInstance( reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pInstance ) ) ); + return static_cast( d.vkCreateInstance( reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pInstance ) ) ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type createInstance( const InstanceCreateInfo & createInfo, Optional allocator ) + template + VULKAN_HPP_INLINE ResultValueType::type createInstance( const InstanceCreateInfo & createInfo, Optional allocator, Dispatch const &d ) { Instance instance; - Result result = static_cast( vkCreateInstance( reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &instance ) ) ); - return createResultValue( result, instance, "VULKAN_HPP_NAMESPACE::createInstance" ); + Result result = static_cast( d.vkCreateInstance( reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &instance ) ) ); + return createResultValue( result, instance, VULKAN_HPP_NAMESPACE_STRING"::createInstance" ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE - VULKAN_HPP_INLINE UniqueInstance createInstanceUnique( const InstanceCreateInfo & createInfo, Optional allocator ) + template + VULKAN_HPP_INLINE ResultValueType::type createInstanceUnique( const InstanceCreateInfo & createInfo, Optional allocator, Dispatch const &d ) { - InstanceDeleter deleter( allocator ); - return UniqueInstance( createInstance( createInfo, allocator ), deleter ); + Instance instance; + Result result = static_cast( d.vkCreateInstance( reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &instance ) ) ); + + ObjectDestroy deleter( allocator ); + return createResultValue( result, instance, VULKAN_HPP_NAMESPACE_STRING"::createInstanceUnique", deleter ); } #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } -#ifdef VK_USE_PLATFORM_WIN32_KHR - template <> constexpr bool isStructureChainValid() { return true; } -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ -#ifdef VK_USE_PLATFORM_WIN32_KHR - template <> constexpr bool isStructureChainValid() { return true; } -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } -#ifdef VK_USE_PLATFORM_WIN32_KHR - template <> constexpr bool isStructureChainValid() { return true; } -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; +#ifdef VK_USE_PLATFORM_WIN32_NV + template <> struct isStructureChainValid{ enum { value = true }; }; +#endif /*VK_USE_PLATFORM_WIN32_NV*/ +#ifdef VK_USE_PLATFORM_WIN32_NV + template <> struct isStructureChainValid{ enum { value = true }; }; +#endif /*VK_USE_PLATFORM_WIN32_NV*/ + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; #ifdef VK_USE_PLATFORM_WIN32_KHR - template <> constexpr bool isStructureChainValid() { return true; } + template <> struct isStructureChainValid{ enum { value = true }; }; #endif /*VK_USE_PLATFORM_WIN32_KHR*/ #ifdef VK_USE_PLATFORM_WIN32_KHR - template <> constexpr bool isStructureChainValid() { return true; } + template <> struct isStructureChainValid{ enum { value = true }; }; #endif /*VK_USE_PLATFORM_WIN32_KHR*/ #ifdef VK_USE_PLATFORM_WIN32_KHR - template <> constexpr bool isStructureChainValid() { return true; } + template <> struct isStructureChainValid{ enum { value = true }; }; #endif /*VK_USE_PLATFORM_WIN32_KHR*/ #ifdef VK_USE_PLATFORM_WIN32_KHR - template <> constexpr bool isStructureChainValid() { return true; } + template <> struct isStructureChainValid{ enum { value = true }; }; #endif /*VK_USE_PLATFORM_WIN32_KHR*/ - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } #ifdef VK_USE_PLATFORM_WIN32_KHR - template <> constexpr bool isStructureChainValid() { return true; } + template <> struct isStructureChainValid{ enum { value = true }; }; #endif /*VK_USE_PLATFORM_WIN32_KHR*/ - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + template <> struct isStructureChainValid{ enum { value = true }; }; +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + template <> struct isStructureChainValid{ enum { value = true }; }; +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; +#ifdef VK_USE_PLATFORM_WIN32_NV + template <> struct isStructureChainValid{ enum { value = true }; }; +#endif /*VK_USE_PLATFORM_WIN32_NV*/ + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; #ifdef VK_USE_PLATFORM_WIN32_KHR - template <> constexpr bool isStructureChainValid() { return true; } + template <> struct isStructureChainValid{ enum { value = true }; }; #endif /*VK_USE_PLATFORM_WIN32_KHR*/ - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } - template <> constexpr bool isStructureChainValid() { return true; } + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + template <> struct isStructureChainValid{ enum { value = true }; }; +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; + template <> struct isStructureChainValid{ enum { value = true }; }; VULKAN_HPP_INLINE std::string to_string(FramebufferCreateFlagBits) { return "(void)"; @@ -32410,16 +38768,6 @@ return "{}"; } - VULKAN_HPP_INLINE std::string to_string(DeviceQueueCreateFlagBits) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string(DeviceQueueCreateFlags) - { - return "{}"; - } - VULKAN_HPP_INLINE std::string to_string(ImageViewCreateFlagBits) { return "(void)"; @@ -32480,12 +38828,12 @@ return "{}"; } - VULKAN_HPP_INLINE std::string to_string(DescriptorUpdateTemplateCreateFlagBitsKHR) + VULKAN_HPP_INLINE std::string to_string(DescriptorUpdateTemplateCreateFlagBits) { return "(void)"; } - VULKAN_HPP_INLINE std::string to_string(DescriptorUpdateTemplateCreateFlagsKHR) + VULKAN_HPP_INLINE std::string to_string(DescriptorUpdateTemplateCreateFlags) { return "{}"; } @@ -32636,12 +38984,12 @@ } #endif /*VK_USE_PLATFORM_MACOS_MVK*/ - VULKAN_HPP_INLINE std::string to_string(CommandPoolTrimFlagBitsKHR) + VULKAN_HPP_INLINE std::string to_string(CommandPoolTrimFlagBits) { return "(void)"; } - VULKAN_HPP_INLINE std::string to_string(CommandPoolTrimFlagsKHR) + VULKAN_HPP_INLINE std::string to_string(CommandPoolTrimFlags) { return "{}"; } @@ -32696,6 +39044,36 @@ return "{}"; } + VULKAN_HPP_INLINE std::string to_string(DebugUtilsMessengerCreateFlagBitsEXT) + { + return "(void)"; + } + + VULKAN_HPP_INLINE std::string to_string(DebugUtilsMessengerCreateFlagsEXT) + { + return "{}"; + } + + VULKAN_HPP_INLINE std::string to_string(DebugUtilsMessengerCallbackDataFlagBitsEXT) + { + return "(void)"; + } + + VULKAN_HPP_INLINE std::string to_string(DebugUtilsMessengerCallbackDataFlagsEXT) + { + return "{}"; + } + + VULKAN_HPP_INLINE std::string to_string(PipelineRasterizationConservativeStateCreateFlagBitsEXT) + { + return "(void)"; + } + + VULKAN_HPP_INLINE std::string to_string(PipelineRasterizationConservativeStateCreateFlagsEXT) + { + return "{}"; + } + VULKAN_HPP_INLINE std::string to_string(ImageLayout value) { switch (value) @@ -32709,10 +39087,10 @@ 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::ePresentSrcKHR: return "PresentSrcKHR"; case ImageLayout::eSharedPresentKHR: return "SharedPresentKHR"; - case ImageLayout::eDepthReadOnlyStencilAttachmentOptimalKHR: return "DepthReadOnlyStencilAttachmentOptimalKHR"; - case ImageLayout::eDepthAttachmentStencilReadOnlyOptimalKHR: return "DepthAttachmentStencilReadOnlyOptimalKHR"; default: return "invalid"; } } @@ -33356,6 +39734,40 @@ 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::ePvrtc12BppUnormBlockIMG: return "Pvrtc12BppUnormBlockIMG"; case Format::ePvrtc14BppUnormBlockIMG: return "Pvrtc14BppUnormBlockIMG"; case Format::ePvrtc22BppUnormBlockIMG: return "Pvrtc22BppUnormBlockIMG"; @@ -33364,40 +39776,6 @@ case Format::ePvrtc14BppSrgbBlockIMG: return "Pvrtc14BppSrgbBlockIMG"; case Format::ePvrtc22BppSrgbBlockIMG: return "Pvrtc22BppSrgbBlockIMG"; case Format::ePvrtc24BppSrgbBlockIMG: return "Pvrtc24BppSrgbBlockIMG"; - case Format::eG8B8G8R8422UnormKHR: return "G8B8G8R8422UnormKHR"; - case Format::eB8G8R8G8422UnormKHR: return "B8G8R8G8422UnormKHR"; - case Format::eG8B8R83Plane420UnormKHR: return "G8B8R83Plane420UnormKHR"; - case Format::eG8B8R82Plane420UnormKHR: return "G8B8R82Plane420UnormKHR"; - case Format::eG8B8R83Plane422UnormKHR: return "G8B8R83Plane422UnormKHR"; - case Format::eG8B8R82Plane422UnormKHR: return "G8B8R82Plane422UnormKHR"; - case Format::eG8B8R83Plane444UnormKHR: return "G8B8R83Plane444UnormKHR"; - case Format::eR10X6UnormPack16KHR: return "R10X6UnormPack16KHR"; - case Format::eR10X6G10X6Unorm2Pack16KHR: return "R10X6G10X6Unorm2Pack16KHR"; - case Format::eR10X6G10X6B10X6A10X6Unorm4Pack16KHR: return "R10X6G10X6B10X6A10X6Unorm4Pack16KHR"; - case Format::eG10X6B10X6G10X6R10X6422Unorm4Pack16KHR: return "G10X6B10X6G10X6R10X6422Unorm4Pack16KHR"; - case Format::eB10X6G10X6R10X6G10X6422Unorm4Pack16KHR: return "B10X6G10X6R10X6G10X6422Unorm4Pack16KHR"; - case Format::eG10X6B10X6R10X63Plane420Unorm3Pack16KHR: return "G10X6B10X6R10X63Plane420Unorm3Pack16KHR"; - case Format::eG10X6B10X6R10X62Plane420Unorm3Pack16KHR: return "G10X6B10X6R10X62Plane420Unorm3Pack16KHR"; - case Format::eG10X6B10X6R10X63Plane422Unorm3Pack16KHR: return "G10X6B10X6R10X63Plane422Unorm3Pack16KHR"; - case Format::eG10X6B10X6R10X62Plane422Unorm3Pack16KHR: return "G10X6B10X6R10X62Plane422Unorm3Pack16KHR"; - case Format::eG10X6B10X6R10X63Plane444Unorm3Pack16KHR: return "G10X6B10X6R10X63Plane444Unorm3Pack16KHR"; - case Format::eR12X4UnormPack16KHR: return "R12X4UnormPack16KHR"; - case Format::eR12X4G12X4Unorm2Pack16KHR: return "R12X4G12X4Unorm2Pack16KHR"; - case Format::eR12X4G12X4B12X4A12X4Unorm4Pack16KHR: return "R12X4G12X4B12X4A12X4Unorm4Pack16KHR"; - case Format::eG12X4B12X4G12X4R12X4422Unorm4Pack16KHR: return "G12X4B12X4G12X4R12X4422Unorm4Pack16KHR"; - case Format::eB12X4G12X4R12X4G12X4422Unorm4Pack16KHR: return "B12X4G12X4R12X4G12X4422Unorm4Pack16KHR"; - case Format::eG12X4B12X4R12X43Plane420Unorm3Pack16KHR: return "G12X4B12X4R12X43Plane420Unorm3Pack16KHR"; - case Format::eG12X4B12X4R12X42Plane420Unorm3Pack16KHR: return "G12X4B12X4R12X42Plane420Unorm3Pack16KHR"; - case Format::eG12X4B12X4R12X43Plane422Unorm3Pack16KHR: return "G12X4B12X4R12X43Plane422Unorm3Pack16KHR"; - case Format::eG12X4B12X4R12X42Plane422Unorm3Pack16KHR: return "G12X4B12X4R12X42Plane422Unorm3Pack16KHR"; - case Format::eG12X4B12X4R12X43Plane444Unorm3Pack16KHR: return "G12X4B12X4R12X43Plane444Unorm3Pack16KHR"; - case Format::eG16B16G16R16422UnormKHR: return "G16B16G16R16422UnormKHR"; - case Format::eB16G16R16G16422UnormKHR: return "B16G16R16G16422UnormKHR"; - case Format::eG16B16R163Plane420UnormKHR: return "G16B16R163Plane420UnormKHR"; - case Format::eG16B16R162Plane420UnormKHR: return "G16B16R162Plane420UnormKHR"; - case Format::eG16B16R163Plane422UnormKHR: return "G16B16R163Plane422UnormKHR"; - case Format::eG16B16R162Plane422UnormKHR: return "G16B16R162Plane422UnormKHR"; - case Format::eG16B16R163Plane444UnormKHR: return "G16B16R163Plane444UnormKHR"; default: return "invalid"; } } @@ -33455,8 +39833,79 @@ 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::ePhysicalDeviceVariablePointerFeatures: return "PhysicalDeviceVariablePointerFeatures"; + 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::ePhysicalDeviceShaderDrawParameterFeatures: return "PhysicalDeviceShaderDrawParameterFeatures"; 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"; @@ -33475,48 +39924,13 @@ case StructureType::eDedicatedAllocationBufferCreateInfoNV: return "DedicatedAllocationBufferCreateInfoNV"; case StructureType::eDedicatedAllocationMemoryAllocateInfoNV: return "DedicatedAllocationMemoryAllocateInfoNV"; case StructureType::eTextureLodGatherFormatPropertiesAMD: return "TextureLodGatherFormatPropertiesAMD"; - case StructureType::eRenderPassMultiviewCreateInfoKHX: return "RenderPassMultiviewCreateInfoKHX"; - case StructureType::ePhysicalDeviceMultiviewFeaturesKHX: return "PhysicalDeviceMultiviewFeaturesKHX"; - case StructureType::ePhysicalDeviceMultiviewPropertiesKHX: return "PhysicalDeviceMultiviewPropertiesKHX"; case StructureType::eExternalMemoryImageCreateInfoNV: return "ExternalMemoryImageCreateInfoNV"; case StructureType::eExportMemoryAllocateInfoNV: return "ExportMemoryAllocateInfoNV"; case StructureType::eImportMemoryWin32HandleInfoNV: return "ImportMemoryWin32HandleInfoNV"; case StructureType::eExportMemoryWin32HandleInfoNV: return "ExportMemoryWin32HandleInfoNV"; case StructureType::eWin32KeyedMutexAcquireReleaseInfoNV: return "Win32KeyedMutexAcquireReleaseInfoNV"; - case StructureType::ePhysicalDeviceFeatures2KHR: return "PhysicalDeviceFeatures2KHR"; - case StructureType::ePhysicalDeviceProperties2KHR: return "PhysicalDeviceProperties2KHR"; - case StructureType::eFormatProperties2KHR: return "FormatProperties2KHR"; - case StructureType::eImageFormatProperties2KHR: return "ImageFormatProperties2KHR"; - case StructureType::ePhysicalDeviceImageFormatInfo2KHR: return "PhysicalDeviceImageFormatInfo2KHR"; - case StructureType::eQueueFamilyProperties2KHR: return "QueueFamilyProperties2KHR"; - case StructureType::ePhysicalDeviceMemoryProperties2KHR: return "PhysicalDeviceMemoryProperties2KHR"; - case StructureType::eSparseImageFormatProperties2KHR: return "SparseImageFormatProperties2KHR"; - case StructureType::ePhysicalDeviceSparseImageFormatInfo2KHR: return "PhysicalDeviceSparseImageFormatInfo2KHR"; - case StructureType::eMemoryAllocateFlagsInfoKHX: return "MemoryAllocateFlagsInfoKHX"; - case StructureType::eDeviceGroupRenderPassBeginInfoKHX: return "DeviceGroupRenderPassBeginInfoKHX"; - case StructureType::eDeviceGroupCommandBufferBeginInfoKHX: return "DeviceGroupCommandBufferBeginInfoKHX"; - case StructureType::eDeviceGroupSubmitInfoKHX: return "DeviceGroupSubmitInfoKHX"; - case StructureType::eDeviceGroupBindSparseInfoKHX: return "DeviceGroupBindSparseInfoKHX"; - case StructureType::eAcquireNextImageInfoKHX: return "AcquireNextImageInfoKHX"; - case StructureType::eBindBufferMemoryDeviceGroupInfoKHX: return "BindBufferMemoryDeviceGroupInfoKHX"; - case StructureType::eBindImageMemoryDeviceGroupInfoKHX: return "BindImageMemoryDeviceGroupInfoKHX"; - case StructureType::eDeviceGroupPresentCapabilitiesKHX: return "DeviceGroupPresentCapabilitiesKHX"; - case StructureType::eImageSwapchainCreateInfoKHX: return "ImageSwapchainCreateInfoKHX"; - case StructureType::eBindImageMemorySwapchainInfoKHX: return "BindImageMemorySwapchainInfoKHX"; - case StructureType::eDeviceGroupPresentInfoKHX: return "DeviceGroupPresentInfoKHX"; - case StructureType::eDeviceGroupSwapchainCreateInfoKHX: return "DeviceGroupSwapchainCreateInfoKHX"; case StructureType::eValidationFlagsEXT: return "ValidationFlagsEXT"; case StructureType::eViSurfaceCreateInfoNN: return "ViSurfaceCreateInfoNN"; - case StructureType::ePhysicalDeviceGroupPropertiesKHX: return "PhysicalDeviceGroupPropertiesKHX"; - case StructureType::eDeviceGroupDeviceCreateInfoKHX: return "DeviceGroupDeviceCreateInfoKHX"; - case StructureType::ePhysicalDeviceExternalImageFormatInfoKHR: return "PhysicalDeviceExternalImageFormatInfoKHR"; - case StructureType::eExternalImageFormatPropertiesKHR: return "ExternalImageFormatPropertiesKHR"; - case StructureType::ePhysicalDeviceExternalBufferInfoKHR: return "PhysicalDeviceExternalBufferInfoKHR"; - case StructureType::eExternalBufferPropertiesKHR: return "ExternalBufferPropertiesKHR"; - case StructureType::ePhysicalDeviceIdPropertiesKHR: return "PhysicalDeviceIdPropertiesKHR"; - case StructureType::eExternalMemoryBufferCreateInfoKHR: return "ExternalMemoryBufferCreateInfoKHR"; - case StructureType::eExternalMemoryImageCreateInfoKHR: return "ExternalMemoryImageCreateInfoKHR"; - case StructureType::eExportMemoryAllocateInfoKHR: return "ExportMemoryAllocateInfoKHR"; case StructureType::eImportMemoryWin32HandleInfoKHR: return "ImportMemoryWin32HandleInfoKHR"; case StructureType::eExportMemoryWin32HandleInfoKHR: return "ExportMemoryWin32HandleInfoKHR"; case StructureType::eMemoryWin32HandlePropertiesKHR: return "MemoryWin32HandlePropertiesKHR"; @@ -33525,9 +39939,6 @@ case StructureType::eMemoryFdPropertiesKHR: return "MemoryFdPropertiesKHR"; case StructureType::eMemoryGetFdInfoKHR: return "MemoryGetFdInfoKHR"; case StructureType::eWin32KeyedMutexAcquireReleaseInfoKHR: return "Win32KeyedMutexAcquireReleaseInfoKHR"; - case StructureType::ePhysicalDeviceExternalSemaphoreInfoKHR: return "PhysicalDeviceExternalSemaphoreInfoKHR"; - case StructureType::eExternalSemaphorePropertiesKHR: return "ExternalSemaphorePropertiesKHR"; - case StructureType::eExportSemaphoreCreateInfoKHR: return "ExportSemaphoreCreateInfoKHR"; case StructureType::eImportSemaphoreWin32HandleInfoKHR: return "ImportSemaphoreWin32HandleInfoKHR"; case StructureType::eExportSemaphoreWin32HandleInfoKHR: return "ExportSemaphoreWin32HandleInfoKHR"; case StructureType::eD3D12FenceSubmitInfoKHR: return "D3D12FenceSubmitInfoKHR"; @@ -33535,9 +39946,7 @@ case StructureType::eImportSemaphoreFdInfoKHR: return "ImportSemaphoreFdInfoKHR"; case StructureType::eSemaphoreGetFdInfoKHR: return "SemaphoreGetFdInfoKHR"; case StructureType::ePhysicalDevicePushDescriptorPropertiesKHR: return "PhysicalDevicePushDescriptorPropertiesKHR"; - case StructureType::ePhysicalDevice16BitStorageFeaturesKHR: return "PhysicalDevice16BitStorageFeaturesKHR"; case StructureType::ePresentRegionsKHR: return "PresentRegionsKHR"; - case StructureType::eDescriptorUpdateTemplateCreateInfoKHR: return "DescriptorUpdateTemplateCreateInfoKHR"; case StructureType::eObjectTableCreateInfoNVX: return "ObjectTableCreateInfoNVX"; case StructureType::eIndirectCommandsLayoutCreateInfoNVX: return "IndirectCommandsLayoutCreateInfoNVX"; case StructureType::eCmdProcessCommandsInfoNVX: return "CmdProcessCommandsInfoNVX"; @@ -33555,28 +39964,31 @@ 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::eHdrMetadataEXT: return "HdrMetadataEXT"; case StructureType::eSharedPresentSurfaceCapabilitiesKHR: return "SharedPresentSurfaceCapabilitiesKHR"; - case StructureType::ePhysicalDeviceExternalFenceInfoKHR: return "PhysicalDeviceExternalFenceInfoKHR"; - case StructureType::eExternalFencePropertiesKHR: return "ExternalFencePropertiesKHR"; - case StructureType::eExportFenceCreateInfoKHR: return "ExportFenceCreateInfoKHR"; case StructureType::eImportFenceWin32HandleInfoKHR: return "ImportFenceWin32HandleInfoKHR"; case StructureType::eExportFenceWin32HandleInfoKHR: return "ExportFenceWin32HandleInfoKHR"; case StructureType::eFenceGetWin32HandleInfoKHR: return "FenceGetWin32HandleInfoKHR"; case StructureType::eImportFenceFdInfoKHR: return "ImportFenceFdInfoKHR"; case StructureType::eFenceGetFdInfoKHR: return "FenceGetFdInfoKHR"; - case StructureType::ePhysicalDevicePointClippingPropertiesKHR: return "PhysicalDevicePointClippingPropertiesKHR"; - case StructureType::eRenderPassInputAttachmentAspectCreateInfoKHR: return "RenderPassInputAttachmentAspectCreateInfoKHR"; - case StructureType::eImageViewUsageCreateInfoKHR: return "ImageViewUsageCreateInfoKHR"; - case StructureType::ePipelineTessellationDomainOriginStateCreateInfoKHR: return "PipelineTessellationDomainOriginStateCreateInfoKHR"; case StructureType::ePhysicalDeviceSurfaceInfo2KHR: return "PhysicalDeviceSurfaceInfo2KHR"; case StructureType::eSurfaceCapabilities2KHR: return "SurfaceCapabilities2KHR"; case StructureType::eSurfaceFormat2KHR: return "SurfaceFormat2KHR"; - case StructureType::ePhysicalDeviceVariablePointerFeaturesKHR: return "PhysicalDeviceVariablePointerFeaturesKHR"; case StructureType::eIosSurfaceCreateInfoMVK: return "IosSurfaceCreateInfoMVK"; case StructureType::eMacosSurfaceCreateInfoMVK: return "MacosSurfaceCreateInfoMVK"; - case StructureType::eMemoryDedicatedRequirementsKHR: return "MemoryDedicatedRequirementsKHR"; - case StructureType::eMemoryDedicatedAllocateInfoKHR: return "MemoryDedicatedAllocateInfoKHR"; + 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"; + 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::ePhysicalDeviceSamplerFilterMinmaxPropertiesEXT: return "PhysicalDeviceSamplerFilterMinmaxPropertiesEXT"; case StructureType::eSamplerReductionModeCreateInfoEXT: return "SamplerReductionModeCreateInfoEXT"; case StructureType::eSampleLocationsInfoEXT: return "SampleLocationsInfoEXT"; @@ -33584,28 +39996,26 @@ case StructureType::ePipelineSampleLocationsStateCreateInfoEXT: return "PipelineSampleLocationsStateCreateInfoEXT"; case StructureType::ePhysicalDeviceSampleLocationsPropertiesEXT: return "PhysicalDeviceSampleLocationsPropertiesEXT"; case StructureType::eMultisamplePropertiesEXT: return "MultisamplePropertiesEXT"; - case StructureType::eBufferMemoryRequirementsInfo2KHR: return "BufferMemoryRequirementsInfo2KHR"; - case StructureType::eImageMemoryRequirementsInfo2KHR: return "ImageMemoryRequirementsInfo2KHR"; - case StructureType::eImageSparseMemoryRequirementsInfo2KHR: return "ImageSparseMemoryRequirementsInfo2KHR"; - case StructureType::eMemoryRequirements2KHR: return "MemoryRequirements2KHR"; - case StructureType::eSparseImageMemoryRequirements2KHR: return "SparseImageMemoryRequirements2KHR"; case StructureType::eImageFormatListCreateInfoKHR: return "ImageFormatListCreateInfoKHR"; case StructureType::ePhysicalDeviceBlendOperationAdvancedFeaturesEXT: return "PhysicalDeviceBlendOperationAdvancedFeaturesEXT"; case StructureType::ePhysicalDeviceBlendOperationAdvancedPropertiesEXT: return "PhysicalDeviceBlendOperationAdvancedPropertiesEXT"; case StructureType::ePipelineColorBlendAdvancedStateCreateInfoEXT: return "PipelineColorBlendAdvancedStateCreateInfoEXT"; case StructureType::ePipelineCoverageToColorStateCreateInfoNV: return "PipelineCoverageToColorStateCreateInfoNV"; case StructureType::ePipelineCoverageModulationStateCreateInfoNV: return "PipelineCoverageModulationStateCreateInfoNV"; - case StructureType::eSamplerYcbcrConversionCreateInfoKHR: return "SamplerYcbcrConversionCreateInfoKHR"; - case StructureType::eSamplerYcbcrConversionInfoKHR: return "SamplerYcbcrConversionInfoKHR"; - case StructureType::eBindImagePlaneMemoryInfoKHR: return "BindImagePlaneMemoryInfoKHR"; - case StructureType::eImagePlaneMemoryRequirementsInfoKHR: return "ImagePlaneMemoryRequirementsInfoKHR"; - case StructureType::ePhysicalDeviceSamplerYcbcrConversionFeaturesKHR: return "PhysicalDeviceSamplerYcbcrConversionFeaturesKHR"; - case StructureType::eSamplerYcbcrConversionImageFormatPropertiesKHR: return "SamplerYcbcrConversionImageFormatPropertiesKHR"; - case StructureType::eBindBufferMemoryInfoKHR: return "BindBufferMemoryInfoKHR"; - case StructureType::eBindImageMemoryInfoKHR: return "BindImageMemoryInfoKHR"; case StructureType::eValidationCacheCreateInfoEXT: return "ValidationCacheCreateInfoEXT"; case StructureType::eShaderModuleValidationCacheCreateInfoEXT: return "ShaderModuleValidationCacheCreateInfoEXT"; + case StructureType::eDescriptorSetLayoutBindingFlagsCreateInfoEXT: return "DescriptorSetLayoutBindingFlagsCreateInfoEXT"; + case StructureType::ePhysicalDeviceDescriptorIndexingFeaturesEXT: return "PhysicalDeviceDescriptorIndexingFeaturesEXT"; + case StructureType::ePhysicalDeviceDescriptorIndexingPropertiesEXT: return "PhysicalDeviceDescriptorIndexingPropertiesEXT"; + case StructureType::eDescriptorSetVariableDescriptorCountAllocateInfoEXT: return "DescriptorSetVariableDescriptorCountAllocateInfoEXT"; + case StructureType::eDescriptorSetVariableDescriptorCountLayoutSupportEXT: return "DescriptorSetVariableDescriptorCountLayoutSupportEXT"; case StructureType::eDeviceQueueGlobalPriorityCreateInfoEXT: return "DeviceQueueGlobalPriorityCreateInfoEXT"; + case StructureType::eImportMemoryHostPointerInfoEXT: return "ImportMemoryHostPointerInfoEXT"; + case StructureType::eMemoryHostPointerPropertiesEXT: return "MemoryHostPointerPropertiesEXT"; + case StructureType::ePhysicalDeviceExternalMemoryHostPropertiesEXT: return "PhysicalDeviceExternalMemoryHostPropertiesEXT"; + case StructureType::ePhysicalDeviceShaderCorePropertiesAMD: return "PhysicalDeviceShaderCorePropertiesAMD"; + case StructureType::ePhysicalDeviceVertexAttributeDivisorPropertiesEXT: return "PhysicalDeviceVertexAttributeDivisorPropertiesEXT"; + case StructureType::ePipelineVertexInputDivisorStateCreateInfoEXT: return "PipelineVertexInputDivisorStateCreateInfoEXT"; default: return "invalid"; } } @@ -33640,12 +40050,12 @@ } } - VULKAN_HPP_INLINE std::string to_string(DescriptorUpdateTemplateTypeKHR value) + VULKAN_HPP_INLINE std::string to_string(DescriptorUpdateTemplateType value) { switch (value) { - case DescriptorUpdateTemplateTypeKHR::eDescriptorSet: return "DescriptorSet"; - case DescriptorUpdateTemplateTypeKHR::ePushDescriptors: return "PushDescriptors"; + case DescriptorUpdateTemplateType::eDescriptorSet: return "DescriptorSet"; + case DescriptorUpdateTemplateType::ePushDescriptorsKHR: return "PushDescriptorsKHR"; default: return "invalid"; } } @@ -33680,15 +40090,16 @@ 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::eSurfaceKHR: return "SurfaceKHR"; case ObjectType::eSwapchainKHR: return "SwapchainKHR"; case ObjectType::eDisplayKHR: return "DisplayKHR"; case ObjectType::eDisplayModeKHR: return "DisplayModeKHR"; case ObjectType::eDebugReportCallbackEXT: return "DebugReportCallbackEXT"; - case ObjectType::eDescriptorUpdateTemplateKHR: return "DescriptorUpdateTemplateKHR"; case ObjectType::eObjectTableNVX: return "ObjectTableNVX"; case ObjectType::eIndirectCommandsLayoutNVX: return "IndirectCommandsLayoutNVX"; - case ObjectType::eSamplerYcbcrConversionKHR: return "SamplerYcbcrConversionKHR"; + case ObjectType::eDebugUtilsMessengerEXT: return "DebugUtilsMessengerEXT"; case ObjectType::eValidationCacheEXT: return "ValidationCacheEXT"; default: return "invalid"; } @@ -33702,6 +40113,7 @@ case QueueFlagBits::eCompute: return "Compute"; case QueueFlagBits::eTransfer: return "Transfer"; case QueueFlagBits::eSparseBinding: return "SparseBinding"; + case QueueFlagBits::eProtected: return "Protected"; default: return "invalid"; } } @@ -33714,6 +40126,24 @@ if (value & QueueFlagBits::eCompute) result += "Compute | "; if (value & QueueFlagBits::eTransfer) result += "Transfer | "; if (value & QueueFlagBits::eSparseBinding) result += "SparseBinding | "; + if (value & QueueFlagBits::eProtected) result += "Protected | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + + VULKAN_HPP_INLINE std::string to_string(DeviceQueueCreateFlagBits value) + { + switch (value) + { + case DeviceQueueCreateFlagBits::eProtected: return "Protected"; + default: return "invalid"; + } + } + + 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) + "}"; } @@ -33726,6 +40156,7 @@ case MemoryPropertyFlagBits::eHostCoherent: return "HostCoherent"; case MemoryPropertyFlagBits::eHostCached: return "HostCached"; case MemoryPropertyFlagBits::eLazilyAllocated: return "LazilyAllocated"; + case MemoryPropertyFlagBits::eProtected: return "Protected"; default: return "invalid"; } } @@ -33739,6 +40170,7 @@ if (value & MemoryPropertyFlagBits::eHostCoherent) result += "HostCoherent | "; if (value & MemoryPropertyFlagBits::eHostCached) result += "HostCached | "; if (value & MemoryPropertyFlagBits::eLazilyAllocated) result += "LazilyAllocated | "; + if (value & MemoryPropertyFlagBits::eProtected) result += "Protected | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -33747,7 +40179,7 @@ switch (value) { case MemoryHeapFlagBits::eDeviceLocal: return "DeviceLocal"; - case MemoryHeapFlagBits::eMultiInstanceKHX: return "MultiInstanceKHX"; + case MemoryHeapFlagBits::eMultiInstance: return "MultiInstance"; default: return "invalid"; } } @@ -33757,7 +40189,7 @@ if (!value) return "{}"; std::string result; if (value & MemoryHeapFlagBits::eDeviceLocal) result += "DeviceLocal | "; - if (value & MemoryHeapFlagBits::eMultiInstanceKHX) result += "MultiInstanceKHX | "; + if (value & MemoryHeapFlagBits::eMultiInstance) result += "MultiInstance | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -33856,6 +40288,7 @@ case BufferCreateFlagBits::eSparseBinding: return "SparseBinding"; case BufferCreateFlagBits::eSparseResidency: return "SparseResidency"; case BufferCreateFlagBits::eSparseAliased: return "SparseAliased"; + case BufferCreateFlagBits::eProtected: return "Protected"; default: return "invalid"; } } @@ -33867,6 +40300,7 @@ if (value & BufferCreateFlagBits::eSparseBinding) result += "SparseBinding | "; if (value & BufferCreateFlagBits::eSparseResidency) result += "SparseResidency | "; if (value & BufferCreateFlagBits::eSparseAliased) result += "SparseAliased | "; + if (value & BufferCreateFlagBits::eProtected) result += "Protected | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -33941,13 +40375,14 @@ case ImageCreateFlagBits::eSparseAliased: return "SparseAliased"; case ImageCreateFlagBits::eMutableFormat: return "MutableFormat"; case ImageCreateFlagBits::eCubeCompatible: return "CubeCompatible"; - case ImageCreateFlagBits::eBindSfrKHX: return "BindSfrKHX"; - case ImageCreateFlagBits::e2DArrayCompatibleKHR: return "2DArrayCompatibleKHR"; - case ImageCreateFlagBits::eBlockTexelViewCompatibleKHR: return "BlockTexelViewCompatibleKHR"; - case ImageCreateFlagBits::eExtendedUsageKHR: return "ExtendedUsageKHR"; + 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::eSampleLocationsCompatibleDepthEXT: return "SampleLocationsCompatibleDepthEXT"; - case ImageCreateFlagBits::eDisjointKHR: return "DisjointKHR"; - case ImageCreateFlagBits::eAliasKHR: return "AliasKHR"; default: return "invalid"; } } @@ -33961,13 +40396,14 @@ if (value & ImageCreateFlagBits::eSparseAliased) result += "SparseAliased | "; if (value & ImageCreateFlagBits::eMutableFormat) result += "MutableFormat | "; if (value & ImageCreateFlagBits::eCubeCompatible) result += "CubeCompatible | "; - if (value & ImageCreateFlagBits::eBindSfrKHX) result += "BindSfrKHX | "; - if (value & ImageCreateFlagBits::e2DArrayCompatibleKHR) result += "2DArrayCompatibleKHR | "; - if (value & ImageCreateFlagBits::eBlockTexelViewCompatibleKHR) result += "BlockTexelViewCompatibleKHR | "; - if (value & ImageCreateFlagBits::eExtendedUsageKHR) result += "ExtendedUsageKHR | "; + 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::eSampleLocationsCompatibleDepthEXT) result += "SampleLocationsCompatibleDepthEXT | "; - if (value & ImageCreateFlagBits::eDisjointKHR) result += "DisjointKHR | "; - if (value & ImageCreateFlagBits::eAliasKHR) result += "AliasKHR | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -33978,8 +40414,8 @@ case PipelineCreateFlagBits::eDisableOptimization: return "DisableOptimization"; case PipelineCreateFlagBits::eAllowDerivatives: return "AllowDerivatives"; case PipelineCreateFlagBits::eDerivative: return "Derivative"; - case PipelineCreateFlagBits::eViewIndexFromDeviceIndexKHX: return "ViewIndexFromDeviceIndexKHX"; - case PipelineCreateFlagBits::eDispatchBaseKHX: return "DispatchBaseKHX"; + case PipelineCreateFlagBits::eViewIndexFromDeviceIndex: return "ViewIndexFromDeviceIndex"; + case PipelineCreateFlagBits::eDispatchBase: return "DispatchBase"; default: return "invalid"; } } @@ -33991,8 +40427,8 @@ if (value & PipelineCreateFlagBits::eDisableOptimization) result += "DisableOptimization | "; if (value & PipelineCreateFlagBits::eAllowDerivatives) result += "AllowDerivatives | "; if (value & PipelineCreateFlagBits::eDerivative) result += "Derivative | "; - if (value & PipelineCreateFlagBits::eViewIndexFromDeviceIndexKHX) result += "ViewIndexFromDeviceIndexKHX | "; - if (value & PipelineCreateFlagBits::eDispatchBaseKHX) result += "DispatchBaseKHX | "; + if (value & PipelineCreateFlagBits::eViewIndexFromDeviceIndex) result += "ViewIndexFromDeviceIndex | "; + if (value & PipelineCreateFlagBits::eDispatchBase) result += "DispatchBase | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -34053,17 +40489,17 @@ 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::eSampledImageFilterCubicIMG: return "SampledImageFilterCubicIMG"; - case FormatFeatureFlagBits::eTransferSrcKHR: return "TransferSrcKHR"; - case FormatFeatureFlagBits::eTransferDstKHR: return "TransferDstKHR"; case FormatFeatureFlagBits::eSampledImageFilterMinmaxEXT: return "SampledImageFilterMinmaxEXT"; - case FormatFeatureFlagBits::eMidpointChromaSamplesKHR: return "MidpointChromaSamplesKHR"; - case FormatFeatureFlagBits::eSampledImageYcbcrConversionLinearFilterKHR: return "SampledImageYcbcrConversionLinearFilterKHR"; - case FormatFeatureFlagBits::eSampledImageYcbcrConversionSeparateReconstructionFilterKHR: return "SampledImageYcbcrConversionSeparateReconstructionFilterKHR"; - case FormatFeatureFlagBits::eSampledImageYcbcrConversionChromaReconstructionExplicitKHR: return "SampledImageYcbcrConversionChromaReconstructionExplicitKHR"; - case FormatFeatureFlagBits::eSampledImageYcbcrConversionChromaReconstructionExplicitForceableKHR: return "SampledImageYcbcrConversionChromaReconstructionExplicitForceableKHR"; - case FormatFeatureFlagBits::eDisjointKHR: return "DisjointKHR"; - case FormatFeatureFlagBits::eCositedChromaSamplesKHR: return "CositedChromaSamplesKHR"; default: return "invalid"; } } @@ -34085,17 +40521,17 @@ 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::eSampledImageFilterCubicIMG) result += "SampledImageFilterCubicIMG | "; - if (value & FormatFeatureFlagBits::eTransferSrcKHR) result += "TransferSrcKHR | "; - if (value & FormatFeatureFlagBits::eTransferDstKHR) result += "TransferDstKHR | "; if (value & FormatFeatureFlagBits::eSampledImageFilterMinmaxEXT) result += "SampledImageFilterMinmaxEXT | "; - if (value & FormatFeatureFlagBits::eMidpointChromaSamplesKHR) result += "MidpointChromaSamplesKHR | "; - if (value & FormatFeatureFlagBits::eSampledImageYcbcrConversionLinearFilterKHR) result += "SampledImageYcbcrConversionLinearFilterKHR | "; - if (value & FormatFeatureFlagBits::eSampledImageYcbcrConversionSeparateReconstructionFilterKHR) result += "SampledImageYcbcrConversionSeparateReconstructionFilterKHR | "; - if (value & FormatFeatureFlagBits::eSampledImageYcbcrConversionChromaReconstructionExplicitKHR) result += "SampledImageYcbcrConversionChromaReconstructionExplicitKHR | "; - if (value & FormatFeatureFlagBits::eSampledImageYcbcrConversionChromaReconstructionExplicitForceableKHR) result += "SampledImageYcbcrConversionChromaReconstructionExplicitForceableKHR | "; - if (value & FormatFeatureFlagBits::eDisjointKHR) result += "DisjointKHR | "; - if (value & FormatFeatureFlagBits::eCositedChromaSamplesKHR) result += "CositedChromaSamplesKHR | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -34205,9 +40641,9 @@ case ImageAspectFlagBits::eDepth: return "Depth"; case ImageAspectFlagBits::eStencil: return "Stencil"; case ImageAspectFlagBits::eMetadata: return "Metadata"; - case ImageAspectFlagBits::ePlane0KHR: return "Plane0KHR"; - case ImageAspectFlagBits::ePlane1KHR: return "Plane1KHR"; - case ImageAspectFlagBits::ePlane2KHR: return "Plane2KHR"; + case ImageAspectFlagBits::ePlane0: return "Plane0"; + case ImageAspectFlagBits::ePlane1: return "Plane1"; + case ImageAspectFlagBits::ePlane2: return "Plane2"; default: return "invalid"; } } @@ -34220,9 +40656,9 @@ if (value & ImageAspectFlagBits::eDepth) result += "Depth | "; if (value & ImageAspectFlagBits::eStencil) result += "Stencil | "; if (value & ImageAspectFlagBits::eMetadata) result += "Metadata | "; - if (value & ImageAspectFlagBits::ePlane0KHR) result += "Plane0KHR | "; - if (value & ImageAspectFlagBits::ePlane1KHR) result += "Plane1KHR | "; - if (value & ImageAspectFlagBits::ePlane2KHR) result += "Plane2KHR | "; + if (value & ImageAspectFlagBits::ePlane0) result += "Plane0 | "; + if (value & ImageAspectFlagBits::ePlane1) result += "Plane1 | "; + if (value & ImageAspectFlagBits::ePlane2) result += "Plane2 | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -34321,6 +40757,7 @@ { case CommandPoolCreateFlagBits::eTransient: return "Transient"; case CommandPoolCreateFlagBits::eResetCommandBuffer: return "ResetCommandBuffer"; + case CommandPoolCreateFlagBits::eProtected: return "Protected"; default: return "invalid"; } } @@ -34331,6 +40768,7 @@ 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) + "}"; } @@ -34440,6 +40878,7 @@ switch (value) { case DescriptorPoolCreateFlagBits::eFreeDescriptorSet: return "FreeDescriptorSet"; + case DescriptorPoolCreateFlagBits::eUpdateAfterBindEXT: return "UpdateAfterBindEXT"; default: return "invalid"; } } @@ -34449,6 +40888,7 @@ if (!value) return "{}"; std::string result; if (value & DescriptorPoolCreateFlagBits::eFreeDescriptorSet) result += "FreeDescriptorSet | "; + if (value & DescriptorPoolCreateFlagBits::eUpdateAfterBindEXT) result += "UpdateAfterBindEXT | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -34457,8 +40897,8 @@ switch (value) { case DependencyFlagBits::eByRegion: return "ByRegion"; - case DependencyFlagBits::eViewLocalKHX: return "ViewLocalKHX"; - case DependencyFlagBits::eDeviceGroupKHX: return "DeviceGroupKHX"; + case DependencyFlagBits::eDeviceGroup: return "DeviceGroup"; + case DependencyFlagBits::eViewLocal: return "ViewLocal"; default: return "invalid"; } } @@ -34468,8 +40908,8 @@ if (!value) return "{}"; std::string result; if (value & DependencyFlagBits::eByRegion) result += "ByRegion | "; - if (value & DependencyFlagBits::eViewLocalKHX) result += "ViewLocalKHX | "; - if (value & DependencyFlagBits::eDeviceGroupKHX) result += "DeviceGroupKHX | "; + if (value & DependencyFlagBits::eDeviceGroup) result += "DeviceGroup | "; + if (value & DependencyFlagBits::eViewLocal) result += "ViewLocal | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -34651,9 +41091,9 @@ case DebugReportObjectTypeEXT::eDisplayModeKhr: return "DisplayModeKhr"; case DebugReportObjectTypeEXT::eObjectTableNvx: return "ObjectTableNvx"; case DebugReportObjectTypeEXT::eIndirectCommandsLayoutNvx: return "IndirectCommandsLayoutNvx"; - case DebugReportObjectTypeEXT::eValidationCache: return "ValidationCache"; - case DebugReportObjectTypeEXT::eDescriptorUpdateTemplateKHR: return "DescriptorUpdateTemplateKHR"; - case DebugReportObjectTypeEXT::eSamplerYcbcrConversionKHR: return "SamplerYcbcrConversionKHR"; + case DebugReportObjectTypeEXT::eValidationCacheExt: return "ValidationCacheExt"; + case DebugReportObjectTypeEXT::eSamplerYcbcrConversion: return "SamplerYcbcrConversion"; + case DebugReportObjectTypeEXT::eDescriptorUpdateTemplate: return "DescriptorUpdateTemplate"; default: return "invalid"; } } @@ -34722,6 +41162,39 @@ } } + 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_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(IndirectCommandsLayoutUsageFlagBitsNVX value) { switch (value) @@ -34798,6 +41271,7 @@ switch (value) { case DescriptorSetLayoutCreateFlagBits::ePushDescriptorKHR: return "PushDescriptorKHR"; + case DescriptorSetLayoutCreateFlagBits::eUpdateAfterBindPoolEXT: return "UpdateAfterBindPoolEXT"; default: return "invalid"; } } @@ -34807,176 +41281,185 @@ if (!value) return "{}"; std::string result; if (value & DescriptorSetLayoutCreateFlagBits::ePushDescriptorKHR) result += "PushDescriptorKHR | "; + if (value & DescriptorSetLayoutCreateFlagBits::eUpdateAfterBindPoolEXT) result += "UpdateAfterBindPoolEXT | "; return "{" + result.substr(0, result.size() - 3) + "}"; } - VULKAN_HPP_INLINE std::string to_string(ExternalMemoryHandleTypeFlagBitsKHR value) + VULKAN_HPP_INLINE std::string to_string(ExternalMemoryHandleTypeFlagBits value) { switch (value) { - case ExternalMemoryHandleTypeFlagBitsKHR::eOpaqueFd: return "OpaqueFd"; - case ExternalMemoryHandleTypeFlagBitsKHR::eOpaqueWin32: return "OpaqueWin32"; - case ExternalMemoryHandleTypeFlagBitsKHR::eOpaqueWin32Kmt: return "OpaqueWin32Kmt"; - case ExternalMemoryHandleTypeFlagBitsKHR::eD3D11Texture: return "D3D11Texture"; - case ExternalMemoryHandleTypeFlagBitsKHR::eD3D11TextureKmt: return "D3D11TextureKmt"; - case ExternalMemoryHandleTypeFlagBitsKHR::eD3D12Heap: return "D3D12Heap"; - case ExternalMemoryHandleTypeFlagBitsKHR::eD3D12Resource: return "D3D12Resource"; + 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"; + case ExternalMemoryHandleTypeFlagBits::eAndroidHardwareBufferANDROID: return "AndroidHardwareBufferANDROID"; + case ExternalMemoryHandleTypeFlagBits::eHostAllocationEXT: return "HostAllocationEXT"; + case ExternalMemoryHandleTypeFlagBits::eHostMappedForeignMemoryEXT: return "HostMappedForeignMemoryEXT"; default: return "invalid"; } } - VULKAN_HPP_INLINE std::string to_string(ExternalMemoryHandleTypeFlagsKHR value) + VULKAN_HPP_INLINE std::string to_string(ExternalMemoryHandleTypeFlags value) { if (!value) return "{}"; std::string result; - if (value & ExternalMemoryHandleTypeFlagBitsKHR::eOpaqueFd) result += "OpaqueFd | "; - if (value & ExternalMemoryHandleTypeFlagBitsKHR::eOpaqueWin32) result += "OpaqueWin32 | "; - if (value & ExternalMemoryHandleTypeFlagBitsKHR::eOpaqueWin32Kmt) result += "OpaqueWin32Kmt | "; - if (value & ExternalMemoryHandleTypeFlagBitsKHR::eD3D11Texture) result += "D3D11Texture | "; - if (value & ExternalMemoryHandleTypeFlagBitsKHR::eD3D11TextureKmt) result += "D3D11TextureKmt | "; - if (value & ExternalMemoryHandleTypeFlagBitsKHR::eD3D12Heap) result += "D3D12Heap | "; - if (value & ExternalMemoryHandleTypeFlagBitsKHR::eD3D12Resource) result += "D3D12Resource | "; + 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 (value & ExternalMemoryHandleTypeFlagBits::eAndroidHardwareBufferANDROID) result += "AndroidHardwareBufferANDROID | "; + if (value & ExternalMemoryHandleTypeFlagBits::eHostAllocationEXT) result += "HostAllocationEXT | "; + if (value & ExternalMemoryHandleTypeFlagBits::eHostMappedForeignMemoryEXT) result += "HostMappedForeignMemoryEXT | "; return "{" + result.substr(0, result.size() - 3) + "}"; } - VULKAN_HPP_INLINE std::string to_string(ExternalMemoryFeatureFlagBitsKHR value) + VULKAN_HPP_INLINE std::string to_string(ExternalMemoryFeatureFlagBits value) { switch (value) { - case ExternalMemoryFeatureFlagBitsKHR::eDedicatedOnly: return "DedicatedOnly"; - case ExternalMemoryFeatureFlagBitsKHR::eExportable: return "Exportable"; - case ExternalMemoryFeatureFlagBitsKHR::eImportable: return "Importable"; + case ExternalMemoryFeatureFlagBits::eDedicatedOnly: return "DedicatedOnly"; + case ExternalMemoryFeatureFlagBits::eExportable: return "Exportable"; + case ExternalMemoryFeatureFlagBits::eImportable: return "Importable"; default: return "invalid"; } } - VULKAN_HPP_INLINE std::string to_string(ExternalMemoryFeatureFlagsKHR value) + VULKAN_HPP_INLINE std::string to_string(ExternalMemoryFeatureFlags value) { if (!value) return "{}"; std::string result; - if (value & ExternalMemoryFeatureFlagBitsKHR::eDedicatedOnly) result += "DedicatedOnly | "; - if (value & ExternalMemoryFeatureFlagBitsKHR::eExportable) result += "Exportable | "; - if (value & ExternalMemoryFeatureFlagBitsKHR::eImportable) result += "Importable | "; + 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(ExternalSemaphoreHandleTypeFlagBitsKHR value) + VULKAN_HPP_INLINE std::string to_string(ExternalSemaphoreHandleTypeFlagBits value) { switch (value) { - case ExternalSemaphoreHandleTypeFlagBitsKHR::eOpaqueFd: return "OpaqueFd"; - case ExternalSemaphoreHandleTypeFlagBitsKHR::eOpaqueWin32: return "OpaqueWin32"; - case ExternalSemaphoreHandleTypeFlagBitsKHR::eOpaqueWin32Kmt: return "OpaqueWin32Kmt"; - case ExternalSemaphoreHandleTypeFlagBitsKHR::eD3D12Fence: return "D3D12Fence"; - case ExternalSemaphoreHandleTypeFlagBitsKHR::eSyncFd: return "SyncFd"; + 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"; default: return "invalid"; } } - VULKAN_HPP_INLINE std::string to_string(ExternalSemaphoreHandleTypeFlagsKHR value) + VULKAN_HPP_INLINE std::string to_string(ExternalSemaphoreHandleTypeFlags value) { if (!value) return "{}"; std::string result; - if (value & ExternalSemaphoreHandleTypeFlagBitsKHR::eOpaqueFd) result += "OpaqueFd | "; - if (value & ExternalSemaphoreHandleTypeFlagBitsKHR::eOpaqueWin32) result += "OpaqueWin32 | "; - if (value & ExternalSemaphoreHandleTypeFlagBitsKHR::eOpaqueWin32Kmt) result += "OpaqueWin32Kmt | "; - if (value & ExternalSemaphoreHandleTypeFlagBitsKHR::eD3D12Fence) result += "D3D12Fence | "; - if (value & ExternalSemaphoreHandleTypeFlagBitsKHR::eSyncFd) result += "SyncFd | "; + 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 | "; return "{" + result.substr(0, result.size() - 3) + "}"; } - VULKAN_HPP_INLINE std::string to_string(ExternalSemaphoreFeatureFlagBitsKHR value) + VULKAN_HPP_INLINE std::string to_string(ExternalSemaphoreFeatureFlagBits value) { switch (value) { - case ExternalSemaphoreFeatureFlagBitsKHR::eExportable: return "Exportable"; - case ExternalSemaphoreFeatureFlagBitsKHR::eImportable: return "Importable"; + case ExternalSemaphoreFeatureFlagBits::eExportable: return "Exportable"; + case ExternalSemaphoreFeatureFlagBits::eImportable: return "Importable"; default: return "invalid"; } } - VULKAN_HPP_INLINE std::string to_string(ExternalSemaphoreFeatureFlagsKHR value) + VULKAN_HPP_INLINE std::string to_string(ExternalSemaphoreFeatureFlags value) { if (!value) return "{}"; std::string result; - if (value & ExternalSemaphoreFeatureFlagBitsKHR::eExportable) result += "Exportable | "; - if (value & ExternalSemaphoreFeatureFlagBitsKHR::eImportable) result += "Importable | "; + if (value & ExternalSemaphoreFeatureFlagBits::eExportable) result += "Exportable | "; + if (value & ExternalSemaphoreFeatureFlagBits::eImportable) result += "Importable | "; return "{" + result.substr(0, result.size() - 3) + "}"; } - VULKAN_HPP_INLINE std::string to_string(SemaphoreImportFlagBitsKHR value) + VULKAN_HPP_INLINE std::string to_string(SemaphoreImportFlagBits value) { switch (value) { - case SemaphoreImportFlagBitsKHR::eTemporary: return "Temporary"; + case SemaphoreImportFlagBits::eTemporary: return "Temporary"; default: return "invalid"; } } - VULKAN_HPP_INLINE std::string to_string(SemaphoreImportFlagsKHR value) + VULKAN_HPP_INLINE std::string to_string(SemaphoreImportFlags value) { if (!value) return "{}"; std::string result; - if (value & SemaphoreImportFlagBitsKHR::eTemporary) result += "Temporary | "; + if (value & SemaphoreImportFlagBits::eTemporary) result += "Temporary | "; return "{" + result.substr(0, result.size() - 3) + "}"; } - VULKAN_HPP_INLINE std::string to_string(ExternalFenceHandleTypeFlagBitsKHR value) + VULKAN_HPP_INLINE std::string to_string(ExternalFenceHandleTypeFlagBits value) { switch (value) { - case ExternalFenceHandleTypeFlagBitsKHR::eOpaqueFd: return "OpaqueFd"; - case ExternalFenceHandleTypeFlagBitsKHR::eOpaqueWin32: return "OpaqueWin32"; - case ExternalFenceHandleTypeFlagBitsKHR::eOpaqueWin32Kmt: return "OpaqueWin32Kmt"; - case ExternalFenceHandleTypeFlagBitsKHR::eSyncFd: return "SyncFd"; + 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_INLINE std::string to_string(ExternalFenceHandleTypeFlagsKHR value) + VULKAN_HPP_INLINE std::string to_string(ExternalFenceHandleTypeFlags value) { if (!value) return "{}"; std::string result; - if (value & ExternalFenceHandleTypeFlagBitsKHR::eOpaqueFd) result += "OpaqueFd | "; - if (value & ExternalFenceHandleTypeFlagBitsKHR::eOpaqueWin32) result += "OpaqueWin32 | "; - if (value & ExternalFenceHandleTypeFlagBitsKHR::eOpaqueWin32Kmt) result += "OpaqueWin32Kmt | "; - if (value & ExternalFenceHandleTypeFlagBitsKHR::eSyncFd) result += "SyncFd | "; + 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(ExternalFenceFeatureFlagBitsKHR value) + VULKAN_HPP_INLINE std::string to_string(ExternalFenceFeatureFlagBits value) { switch (value) { - case ExternalFenceFeatureFlagBitsKHR::eExportable: return "Exportable"; - case ExternalFenceFeatureFlagBitsKHR::eImportable: return "Importable"; + case ExternalFenceFeatureFlagBits::eExportable: return "Exportable"; + case ExternalFenceFeatureFlagBits::eImportable: return "Importable"; default: return "invalid"; } } - VULKAN_HPP_INLINE std::string to_string(ExternalFenceFeatureFlagsKHR value) + VULKAN_HPP_INLINE std::string to_string(ExternalFenceFeatureFlags value) { if (!value) return "{}"; std::string result; - if (value & ExternalFenceFeatureFlagBitsKHR::eExportable) result += "Exportable | "; - if (value & ExternalFenceFeatureFlagBitsKHR::eImportable) result += "Importable | "; + 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(FenceImportFlagBitsKHR value) + VULKAN_HPP_INLINE std::string to_string(FenceImportFlagBits value) { switch (value) { - case FenceImportFlagBitsKHR::eTemporary: return "Temporary"; + case FenceImportFlagBits::eTemporary: return "Temporary"; default: return "invalid"; } } - VULKAN_HPP_INLINE std::string to_string(FenceImportFlagsKHR value) + VULKAN_HPP_INLINE std::string to_string(FenceImportFlags value) { if (!value) return "{}"; std::string result; - if (value & FenceImportFlagBitsKHR::eTemporary) result += "Temporary | "; + if (value & FenceImportFlagBits::eTemporary) result += "Temporary | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -35026,66 +41509,66 @@ } } - VULKAN_HPP_INLINE std::string to_string(PeerMemoryFeatureFlagBitsKHX value) + VULKAN_HPP_INLINE std::string to_string(PeerMemoryFeatureFlagBits value) { switch (value) { - case PeerMemoryFeatureFlagBitsKHX::eCopySrc: return "CopySrc"; - case PeerMemoryFeatureFlagBitsKHX::eCopyDst: return "CopyDst"; - case PeerMemoryFeatureFlagBitsKHX::eGenericSrc: return "GenericSrc"; - case PeerMemoryFeatureFlagBitsKHX::eGenericDst: return "GenericDst"; + 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_INLINE std::string to_string(PeerMemoryFeatureFlagsKHX value) + VULKAN_HPP_INLINE std::string to_string(PeerMemoryFeatureFlags value) { if (!value) return "{}"; std::string result; - if (value & PeerMemoryFeatureFlagBitsKHX::eCopySrc) result += "CopySrc | "; - if (value & PeerMemoryFeatureFlagBitsKHX::eCopyDst) result += "CopyDst | "; - if (value & PeerMemoryFeatureFlagBitsKHX::eGenericSrc) result += "GenericSrc | "; - if (value & PeerMemoryFeatureFlagBitsKHX::eGenericDst) result += "GenericDst | "; + 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(MemoryAllocateFlagBitsKHX value) + VULKAN_HPP_INLINE std::string to_string(MemoryAllocateFlagBits value) { switch (value) { - case MemoryAllocateFlagBitsKHX::eDeviceMask: return "DeviceMask"; + case MemoryAllocateFlagBits::eDeviceMask: return "DeviceMask"; default: return "invalid"; } } - VULKAN_HPP_INLINE std::string to_string(MemoryAllocateFlagsKHX value) + VULKAN_HPP_INLINE std::string to_string(MemoryAllocateFlags value) { if (!value) return "{}"; std::string result; - if (value & MemoryAllocateFlagBitsKHX::eDeviceMask) result += "DeviceMask | "; + if (value & MemoryAllocateFlagBits::eDeviceMask) result += "DeviceMask | "; return "{" + result.substr(0, result.size() - 3) + "}"; } - VULKAN_HPP_INLINE std::string to_string(DeviceGroupPresentModeFlagBitsKHX value) + VULKAN_HPP_INLINE std::string to_string(DeviceGroupPresentModeFlagBitsKHR value) { switch (value) { - case DeviceGroupPresentModeFlagBitsKHX::eLocal: return "Local"; - case DeviceGroupPresentModeFlagBitsKHX::eRemote: return "Remote"; - case DeviceGroupPresentModeFlagBitsKHX::eSum: return "Sum"; - case DeviceGroupPresentModeFlagBitsKHX::eLocalMultiDevice: return "LocalMultiDevice"; + 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_INLINE std::string to_string(DeviceGroupPresentModeFlagsKHX value) + VULKAN_HPP_INLINE std::string to_string(DeviceGroupPresentModeFlagsKHR value) { if (!value) return "{}"; std::string result; - if (value & DeviceGroupPresentModeFlagBitsKHX::eLocal) result += "Local | "; - if (value & DeviceGroupPresentModeFlagBitsKHX::eRemote) result += "Remote | "; - if (value & DeviceGroupPresentModeFlagBitsKHX::eSum) result += "Sum | "; - if (value & DeviceGroupPresentModeFlagBitsKHX::eLocalMultiDevice) result += "LocalMultiDevice | "; + 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) + "}"; } @@ -35093,7 +41576,8 @@ { switch (value) { - case SwapchainCreateFlagBitsKHR::eBindSfrKHX: return "BindSfrKHX"; + case SwapchainCreateFlagBitsKHR::eSplitInstanceBindRegions: return "SplitInstanceBindRegions"; + case SwapchainCreateFlagBitsKHR::eProtected: return "Protected"; default: return "invalid"; } } @@ -35102,7 +41586,8 @@ { if (!value) return "{}"; std::string result; - if (value & SwapchainCreateFlagBitsKHR::eBindSfrKHX) result += "BindSfrKHX | "; + if (value & SwapchainCreateFlagBitsKHR::eSplitInstanceBindRegions) result += "SplitInstanceBindRegions | "; + if (value & SwapchainCreateFlagBitsKHR::eProtected) result += "Protected | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -35151,12 +41636,12 @@ return "{" + result.substr(0, result.size() - 3) + "}"; } - VULKAN_HPP_INLINE std::string to_string(PointClippingBehaviorKHR value) + VULKAN_HPP_INLINE std::string to_string(PointClippingBehavior value) { switch (value) { - case PointClippingBehaviorKHR::eAllClipPlanes: return "AllClipPlanes"; - case PointClippingBehaviorKHR::eUserClipPlanesOnly: return "UserClipPlanesOnly"; + case PointClippingBehavior::eAllClipPlanes: return "AllClipPlanes"; + case PointClippingBehavior::eUserClipPlanesOnly: return "UserClipPlanesOnly"; default: return "invalid"; } } @@ -35172,45 +41657,45 @@ } } - VULKAN_HPP_INLINE std::string to_string(TessellationDomainOriginKHR value) + VULKAN_HPP_INLINE std::string to_string(TessellationDomainOrigin value) { switch (value) { - case TessellationDomainOriginKHR::eUpperLeft: return "UpperLeft"; - case TessellationDomainOriginKHR::eLowerLeft: return "LowerLeft"; + case TessellationDomainOrigin::eUpperLeft: return "UpperLeft"; + case TessellationDomainOrigin::eLowerLeft: return "LowerLeft"; default: return "invalid"; } } - VULKAN_HPP_INLINE std::string to_string(SamplerYcbcrModelConversionKHR value) + VULKAN_HPP_INLINE std::string to_string(SamplerYcbcrModelConversion value) { switch (value) { - case SamplerYcbcrModelConversionKHR::eRgbIdentity: return "RgbIdentity"; - case SamplerYcbcrModelConversionKHR::eYcbcrIdentity: return "YcbcrIdentity"; - case SamplerYcbcrModelConversionKHR::eYcbcr709: return "Ycbcr709"; - case SamplerYcbcrModelConversionKHR::eYcbcr601: return "Ycbcr601"; - case SamplerYcbcrModelConversionKHR::eYcbcr2020: return "Ycbcr2020"; + 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_INLINE std::string to_string(SamplerYcbcrRangeKHR value) + VULKAN_HPP_INLINE std::string to_string(SamplerYcbcrRange value) { switch (value) { - case SamplerYcbcrRangeKHR::eItuFull: return "ItuFull"; - case SamplerYcbcrRangeKHR::eItuNarrow: return "ItuNarrow"; + case SamplerYcbcrRange::eItuFull: return "ItuFull"; + case SamplerYcbcrRange::eItuNarrow: return "ItuNarrow"; default: return "invalid"; } } - VULKAN_HPP_INLINE std::string to_string(ChromaLocationKHR value) + VULKAN_HPP_INLINE std::string to_string(ChromaLocation value) { switch (value) { - case ChromaLocationKHR::eCositedEven: return "CositedEven"; - case ChromaLocationKHR::eMidpoint: return "Midpoint"; + case ChromaLocation::eCositedEven: return "CositedEven"; + case ChromaLocation::eMidpoint: return "Midpoint"; default: return "invalid"; } } @@ -35270,6 +41755,800 @@ } } + 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_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(DebugUtilsMessageTypeFlagBitsEXT value) + { + switch (value) + { + case DebugUtilsMessageTypeFlagBitsEXT::eGeneral: return "General"; + case DebugUtilsMessageTypeFlagBitsEXT::eValidation: return "Validation"; + case DebugUtilsMessageTypeFlagBitsEXT::ePerformance: return "Performance"; + default: return "invalid"; + } + } + + 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(ConservativeRasterizationModeEXT value) + { + switch (value) + { + case ConservativeRasterizationModeEXT::eDisabled: return "Disabled"; + case ConservativeRasterizationModeEXT::eOverestimate: return "Overestimate"; + case ConservativeRasterizationModeEXT::eUnderestimate: return "Underestimate"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(DescriptorBindingFlagBitsEXT value) + { + switch (value) + { + case DescriptorBindingFlagBitsEXT::eUpdateAfterBind: return "UpdateAfterBind"; + case DescriptorBindingFlagBitsEXT::eUpdateUnusedWhilePending: return "UpdateUnusedWhilePending"; + case DescriptorBindingFlagBitsEXT::ePartiallyBound: return "PartiallyBound"; + case DescriptorBindingFlagBitsEXT::eVariableDescriptorCount: return "VariableDescriptorCount"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(DescriptorBindingFlagsEXT value) + { + if (!value) return "{}"; + std::string result; + if (value & DescriptorBindingFlagBitsEXT::eUpdateAfterBind) result += "UpdateAfterBind | "; + if (value & DescriptorBindingFlagBitsEXT::eUpdateUnusedWhilePending) result += "UpdateUnusedWhilePending | "; + if (value & DescriptorBindingFlagBitsEXT::ePartiallyBound) result += "PartiallyBound | "; + if (value & DescriptorBindingFlagBitsEXT::eVariableDescriptorCount) result += "VariableDescriptorCount | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + + class DispatchLoaderDynamic + { + public: + PFN_vkAcquireNextImage2KHR vkAcquireNextImage2KHR = 0; + PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR = 0; +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_NV + PFN_vkAcquireXlibDisplayEXT vkAcquireXlibDisplayEXT = 0; +#endif /*VK_USE_PLATFORM_XLIB_XRANDR_NV*/ + PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers = 0; + PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets = 0; + PFN_vkAllocateMemory vkAllocateMemory = 0; + PFN_vkBeginCommandBuffer vkBeginCommandBuffer = 0; + PFN_vkBindBufferMemory vkBindBufferMemory = 0; + PFN_vkBindBufferMemory2 vkBindBufferMemory2 = 0; + PFN_vkBindBufferMemory2KHR vkBindBufferMemory2KHR = 0; + PFN_vkBindImageMemory vkBindImageMemory = 0; + PFN_vkBindImageMemory2 vkBindImageMemory2 = 0; + PFN_vkBindImageMemory2KHR vkBindImageMemory2KHR = 0; + PFN_vkCmdBeginDebugUtilsLabelEXT vkCmdBeginDebugUtilsLabelEXT = 0; + PFN_vkCmdBeginQuery vkCmdBeginQuery = 0; + PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass = 0; + PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets = 0; + PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer = 0; + PFN_vkCmdBindPipeline vkCmdBindPipeline = 0; + PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers = 0; + PFN_vkCmdBlitImage vkCmdBlitImage = 0; + PFN_vkCmdClearAttachments vkCmdClearAttachments = 0; + PFN_vkCmdClearColorImage vkCmdClearColorImage = 0; + PFN_vkCmdClearDepthStencilImage vkCmdClearDepthStencilImage = 0; + PFN_vkCmdCopyBuffer vkCmdCopyBuffer = 0; + PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage = 0; + PFN_vkCmdCopyImage vkCmdCopyImage = 0; + PFN_vkCmdCopyImageToBuffer vkCmdCopyImageToBuffer = 0; + PFN_vkCmdCopyQueryPoolResults vkCmdCopyQueryPoolResults = 0; + PFN_vkCmdDebugMarkerBeginEXT vkCmdDebugMarkerBeginEXT = 0; + PFN_vkCmdDebugMarkerEndEXT vkCmdDebugMarkerEndEXT = 0; + PFN_vkCmdDebugMarkerInsertEXT vkCmdDebugMarkerInsertEXT = 0; + PFN_vkCmdDispatch vkCmdDispatch = 0; + PFN_vkCmdDispatchBase vkCmdDispatchBase = 0; + PFN_vkCmdDispatchBaseKHR vkCmdDispatchBaseKHR = 0; + PFN_vkCmdDispatchIndirect vkCmdDispatchIndirect = 0; + PFN_vkCmdDraw vkCmdDraw = 0; + PFN_vkCmdDrawIndexed vkCmdDrawIndexed = 0; + PFN_vkCmdDrawIndexedIndirect vkCmdDrawIndexedIndirect = 0; + PFN_vkCmdDrawIndexedIndirectCountAMD vkCmdDrawIndexedIndirectCountAMD = 0; + PFN_vkCmdDrawIndirect vkCmdDrawIndirect = 0; + PFN_vkCmdDrawIndirectCountAMD vkCmdDrawIndirectCountAMD = 0; + PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabelEXT = 0; + PFN_vkCmdEndQuery vkCmdEndQuery = 0; + PFN_vkCmdEndRenderPass vkCmdEndRenderPass = 0; + PFN_vkCmdExecuteCommands vkCmdExecuteCommands = 0; + PFN_vkCmdFillBuffer vkCmdFillBuffer = 0; + PFN_vkCmdInsertDebugUtilsLabelEXT vkCmdInsertDebugUtilsLabelEXT = 0; + PFN_vkCmdNextSubpass vkCmdNextSubpass = 0; + PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier = 0; + PFN_vkCmdProcessCommandsNVX vkCmdProcessCommandsNVX = 0; + PFN_vkCmdPushConstants vkCmdPushConstants = 0; + PFN_vkCmdPushDescriptorSetKHR vkCmdPushDescriptorSetKHR = 0; + PFN_vkCmdPushDescriptorSetWithTemplateKHR vkCmdPushDescriptorSetWithTemplateKHR = 0; + PFN_vkCmdReserveSpaceForCommandsNVX vkCmdReserveSpaceForCommandsNVX = 0; + PFN_vkCmdResetEvent vkCmdResetEvent = 0; + PFN_vkCmdResetQueryPool vkCmdResetQueryPool = 0; + PFN_vkCmdResolveImage vkCmdResolveImage = 0; + PFN_vkCmdSetBlendConstants vkCmdSetBlendConstants = 0; + PFN_vkCmdSetDepthBias vkCmdSetDepthBias = 0; + PFN_vkCmdSetDepthBounds vkCmdSetDepthBounds = 0; + PFN_vkCmdSetDeviceMask vkCmdSetDeviceMask = 0; + PFN_vkCmdSetDeviceMaskKHR vkCmdSetDeviceMaskKHR = 0; + PFN_vkCmdSetDiscardRectangleEXT vkCmdSetDiscardRectangleEXT = 0; + PFN_vkCmdSetEvent vkCmdSetEvent = 0; + PFN_vkCmdSetLineWidth vkCmdSetLineWidth = 0; + PFN_vkCmdSetSampleLocationsEXT vkCmdSetSampleLocationsEXT = 0; + PFN_vkCmdSetScissor vkCmdSetScissor = 0; + PFN_vkCmdSetStencilCompareMask vkCmdSetStencilCompareMask = 0; + PFN_vkCmdSetStencilReference vkCmdSetStencilReference = 0; + PFN_vkCmdSetStencilWriteMask vkCmdSetStencilWriteMask = 0; + PFN_vkCmdSetViewport vkCmdSetViewport = 0; + PFN_vkCmdSetViewportWScalingNV vkCmdSetViewportWScalingNV = 0; + PFN_vkCmdUpdateBuffer vkCmdUpdateBuffer = 0; + PFN_vkCmdWaitEvents vkCmdWaitEvents = 0; + PFN_vkCmdWriteBufferMarkerAMD vkCmdWriteBufferMarkerAMD = 0; + PFN_vkCmdWriteTimestamp vkCmdWriteTimestamp = 0; +#ifdef VK_USE_PLATFORM_ANDROID_KHR + PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR = 0; +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + PFN_vkCreateBuffer vkCreateBuffer = 0; + PFN_vkCreateBufferView vkCreateBufferView = 0; + PFN_vkCreateCommandPool vkCreateCommandPool = 0; + PFN_vkCreateComputePipelines vkCreateComputePipelines = 0; + PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT = 0; + PFN_vkCreateDebugUtilsMessengerEXT vkCreateDebugUtilsMessengerEXT = 0; + PFN_vkCreateDescriptorPool vkCreateDescriptorPool = 0; + PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout = 0; + PFN_vkCreateDescriptorUpdateTemplate vkCreateDescriptorUpdateTemplate = 0; + PFN_vkCreateDescriptorUpdateTemplateKHR vkCreateDescriptorUpdateTemplateKHR = 0; + PFN_vkCreateDevice vkCreateDevice = 0; + PFN_vkCreateDisplayModeKHR vkCreateDisplayModeKHR = 0; + PFN_vkCreateDisplayPlaneSurfaceKHR vkCreateDisplayPlaneSurfaceKHR = 0; + PFN_vkCreateEvent vkCreateEvent = 0; + PFN_vkCreateFence vkCreateFence = 0; + PFN_vkCreateFramebuffer vkCreateFramebuffer = 0; + PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines = 0; +#ifdef VK_USE_PLATFORM_IOS_MVK + PFN_vkCreateIOSSurfaceMVK vkCreateIOSSurfaceMVK = 0; +#endif /*VK_USE_PLATFORM_IOS_MVK*/ + PFN_vkCreateImage vkCreateImage = 0; + PFN_vkCreateImageView vkCreateImageView = 0; + PFN_vkCreateIndirectCommandsLayoutNVX vkCreateIndirectCommandsLayoutNVX = 0; + PFN_vkCreateInstance vkCreateInstance = 0; +#ifdef VK_USE_PLATFORM_MACOS_MVK + PFN_vkCreateMacOSSurfaceMVK vkCreateMacOSSurfaceMVK = 0; +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ +#ifdef VK_USE_PLATFORM_MIR_KHR + PFN_vkCreateMirSurfaceKHR vkCreateMirSurfaceKHR = 0; +#endif /*VK_USE_PLATFORM_MIR_KHR*/ + PFN_vkCreateObjectTableNVX vkCreateObjectTableNVX = 0; + PFN_vkCreatePipelineCache vkCreatePipelineCache = 0; + PFN_vkCreatePipelineLayout vkCreatePipelineLayout = 0; + PFN_vkCreateQueryPool vkCreateQueryPool = 0; + PFN_vkCreateRenderPass vkCreateRenderPass = 0; + PFN_vkCreateSampler vkCreateSampler = 0; + PFN_vkCreateSamplerYcbcrConversion vkCreateSamplerYcbcrConversion = 0; + PFN_vkCreateSamplerYcbcrConversionKHR vkCreateSamplerYcbcrConversionKHR = 0; + PFN_vkCreateSemaphore vkCreateSemaphore = 0; + PFN_vkCreateShaderModule vkCreateShaderModule = 0; + PFN_vkCreateSharedSwapchainsKHR vkCreateSharedSwapchainsKHR = 0; + PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR = 0; + PFN_vkCreateValidationCacheEXT vkCreateValidationCacheEXT = 0; +#ifdef VK_USE_PLATFORM_VI_NN + PFN_vkCreateViSurfaceNN vkCreateViSurfaceNN = 0; +#endif /*VK_USE_PLATFORM_VI_NN*/ +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + PFN_vkCreateWaylandSurfaceKHR vkCreateWaylandSurfaceKHR = 0; +#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ +#ifdef VK_USE_PLATFORM_WIN32_KHR + PFN_vkCreateWin32SurfaceKHR vkCreateWin32SurfaceKHR = 0; +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ +#ifdef VK_USE_PLATFORM_XCB_KHR + PFN_vkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHR = 0; +#endif /*VK_USE_PLATFORM_XCB_KHR*/ +#ifdef VK_USE_PLATFORM_XLIB_KHR + PFN_vkCreateXlibSurfaceKHR vkCreateXlibSurfaceKHR = 0; +#endif /*VK_USE_PLATFORM_XLIB_KHR*/ + PFN_vkDebugMarkerSetObjectNameEXT vkDebugMarkerSetObjectNameEXT = 0; + PFN_vkDebugMarkerSetObjectTagEXT vkDebugMarkerSetObjectTagEXT = 0; + PFN_vkDebugReportMessageEXT vkDebugReportMessageEXT = 0; + PFN_vkDestroyBuffer vkDestroyBuffer = 0; + PFN_vkDestroyBufferView vkDestroyBufferView = 0; + PFN_vkDestroyCommandPool vkDestroyCommandPool = 0; + PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallbackEXT = 0; + PFN_vkDestroyDebugUtilsMessengerEXT vkDestroyDebugUtilsMessengerEXT = 0; + PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool = 0; + PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout = 0; + PFN_vkDestroyDescriptorUpdateTemplate vkDestroyDescriptorUpdateTemplate = 0; + PFN_vkDestroyDescriptorUpdateTemplateKHR vkDestroyDescriptorUpdateTemplateKHR = 0; + PFN_vkDestroyDevice vkDestroyDevice = 0; + PFN_vkDestroyEvent vkDestroyEvent = 0; + PFN_vkDestroyFence vkDestroyFence = 0; + PFN_vkDestroyFramebuffer vkDestroyFramebuffer = 0; + PFN_vkDestroyImage vkDestroyImage = 0; + PFN_vkDestroyImageView vkDestroyImageView = 0; + PFN_vkDestroyIndirectCommandsLayoutNVX vkDestroyIndirectCommandsLayoutNVX = 0; + PFN_vkDestroyInstance vkDestroyInstance = 0; + PFN_vkDestroyObjectTableNVX vkDestroyObjectTableNVX = 0; + PFN_vkDestroyPipeline vkDestroyPipeline = 0; + PFN_vkDestroyPipelineCache vkDestroyPipelineCache = 0; + PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout = 0; + PFN_vkDestroyQueryPool vkDestroyQueryPool = 0; + PFN_vkDestroyRenderPass vkDestroyRenderPass = 0; + PFN_vkDestroySampler vkDestroySampler = 0; + PFN_vkDestroySamplerYcbcrConversion vkDestroySamplerYcbcrConversion = 0; + PFN_vkDestroySamplerYcbcrConversionKHR vkDestroySamplerYcbcrConversionKHR = 0; + PFN_vkDestroySemaphore vkDestroySemaphore = 0; + PFN_vkDestroyShaderModule vkDestroyShaderModule = 0; + PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR = 0; + PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR = 0; + PFN_vkDestroyValidationCacheEXT vkDestroyValidationCacheEXT = 0; + PFN_vkDeviceWaitIdle vkDeviceWaitIdle = 0; + PFN_vkDisplayPowerControlEXT vkDisplayPowerControlEXT = 0; + PFN_vkEndCommandBuffer vkEndCommandBuffer = 0; + PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties = 0; + PFN_vkEnumerateDeviceLayerProperties vkEnumerateDeviceLayerProperties = 0; + PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties = 0; + PFN_vkEnumerateInstanceLayerProperties vkEnumerateInstanceLayerProperties = 0; + PFN_vkEnumerateInstanceVersion vkEnumerateInstanceVersion = 0; + PFN_vkEnumeratePhysicalDeviceGroups vkEnumeratePhysicalDeviceGroups = 0; + PFN_vkEnumeratePhysicalDeviceGroupsKHR vkEnumeratePhysicalDeviceGroupsKHR = 0; + PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices = 0; + PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges = 0; + PFN_vkFreeCommandBuffers vkFreeCommandBuffers = 0; + PFN_vkFreeDescriptorSets vkFreeDescriptorSets = 0; + PFN_vkFreeMemory vkFreeMemory = 0; +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + PFN_vkGetAndroidHardwareBufferPropertiesANDROID vkGetAndroidHardwareBufferPropertiesANDROID = 0; +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ + PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements = 0; + PFN_vkGetBufferMemoryRequirements2 vkGetBufferMemoryRequirements2 = 0; + PFN_vkGetBufferMemoryRequirements2KHR vkGetBufferMemoryRequirements2KHR = 0; + PFN_vkGetDescriptorSetLayoutSupport vkGetDescriptorSetLayoutSupport = 0; + PFN_vkGetDescriptorSetLayoutSupportKHR vkGetDescriptorSetLayoutSupportKHR = 0; + PFN_vkGetDeviceGroupPeerMemoryFeatures vkGetDeviceGroupPeerMemoryFeatures = 0; + PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR vkGetDeviceGroupPeerMemoryFeaturesKHR = 0; + PFN_vkGetDeviceGroupPresentCapabilitiesKHR vkGetDeviceGroupPresentCapabilitiesKHR = 0; + PFN_vkGetDeviceGroupSurfacePresentModesKHR vkGetDeviceGroupSurfacePresentModesKHR = 0; + PFN_vkGetDeviceMemoryCommitment vkGetDeviceMemoryCommitment = 0; + PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr = 0; + PFN_vkGetDeviceQueue vkGetDeviceQueue = 0; + PFN_vkGetDeviceQueue2 vkGetDeviceQueue2 = 0; + PFN_vkGetDisplayModePropertiesKHR vkGetDisplayModePropertiesKHR = 0; + PFN_vkGetDisplayPlaneCapabilitiesKHR vkGetDisplayPlaneCapabilitiesKHR = 0; + PFN_vkGetDisplayPlaneSupportedDisplaysKHR vkGetDisplayPlaneSupportedDisplaysKHR = 0; + PFN_vkGetEventStatus vkGetEventStatus = 0; + PFN_vkGetFenceFdKHR vkGetFenceFdKHR = 0; + PFN_vkGetFenceStatus vkGetFenceStatus = 0; +#ifdef VK_USE_PLATFORM_WIN32_KHR + PFN_vkGetFenceWin32HandleKHR vkGetFenceWin32HandleKHR = 0; +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements = 0; + PFN_vkGetImageMemoryRequirements2 vkGetImageMemoryRequirements2 = 0; + PFN_vkGetImageMemoryRequirements2KHR vkGetImageMemoryRequirements2KHR = 0; + PFN_vkGetImageSparseMemoryRequirements vkGetImageSparseMemoryRequirements = 0; + PFN_vkGetImageSparseMemoryRequirements2 vkGetImageSparseMemoryRequirements2 = 0; + PFN_vkGetImageSparseMemoryRequirements2KHR vkGetImageSparseMemoryRequirements2KHR = 0; + PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout = 0; + PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = 0; +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + PFN_vkGetMemoryAndroidHardwareBufferANDROID vkGetMemoryAndroidHardwareBufferANDROID = 0; +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ + PFN_vkGetMemoryFdKHR vkGetMemoryFdKHR = 0; + PFN_vkGetMemoryFdPropertiesKHR vkGetMemoryFdPropertiesKHR = 0; + PFN_vkGetMemoryHostPointerPropertiesEXT vkGetMemoryHostPointerPropertiesEXT = 0; +#ifdef VK_USE_PLATFORM_WIN32_KHR + PFN_vkGetMemoryWin32HandleKHR vkGetMemoryWin32HandleKHR = 0; +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ +#ifdef VK_USE_PLATFORM_WIN32_NV + PFN_vkGetMemoryWin32HandleNV vkGetMemoryWin32HandleNV = 0; +#endif /*VK_USE_PLATFORM_WIN32_NV*/ +#ifdef VK_USE_PLATFORM_WIN32_KHR + PFN_vkGetMemoryWin32HandlePropertiesKHR vkGetMemoryWin32HandlePropertiesKHR = 0; +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + PFN_vkGetPastPresentationTimingGOOGLE vkGetPastPresentationTimingGOOGLE = 0; + PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR vkGetPhysicalDeviceDisplayPlanePropertiesKHR = 0; + PFN_vkGetPhysicalDeviceDisplayPropertiesKHR vkGetPhysicalDeviceDisplayPropertiesKHR = 0; + PFN_vkGetPhysicalDeviceExternalBufferProperties vkGetPhysicalDeviceExternalBufferProperties = 0; + PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR vkGetPhysicalDeviceExternalBufferPropertiesKHR = 0; + PFN_vkGetPhysicalDeviceExternalFenceProperties vkGetPhysicalDeviceExternalFenceProperties = 0; + PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR vkGetPhysicalDeviceExternalFencePropertiesKHR = 0; + PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV vkGetPhysicalDeviceExternalImageFormatPropertiesNV = 0; + PFN_vkGetPhysicalDeviceExternalSemaphoreProperties vkGetPhysicalDeviceExternalSemaphoreProperties = 0; + PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = 0; + PFN_vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFeatures = 0; + PFN_vkGetPhysicalDeviceFeatures2 vkGetPhysicalDeviceFeatures2 = 0; + PFN_vkGetPhysicalDeviceFeatures2KHR vkGetPhysicalDeviceFeatures2KHR = 0; + PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties = 0; + PFN_vkGetPhysicalDeviceFormatProperties2 vkGetPhysicalDeviceFormatProperties2 = 0; + PFN_vkGetPhysicalDeviceFormatProperties2KHR vkGetPhysicalDeviceFormatProperties2KHR = 0; + PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = 0; + PFN_vkGetPhysicalDeviceImageFormatProperties vkGetPhysicalDeviceImageFormatProperties = 0; + PFN_vkGetPhysicalDeviceImageFormatProperties2 vkGetPhysicalDeviceImageFormatProperties2 = 0; + PFN_vkGetPhysicalDeviceImageFormatProperties2KHR vkGetPhysicalDeviceImageFormatProperties2KHR = 0; + PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties = 0; + PFN_vkGetPhysicalDeviceMemoryProperties2 vkGetPhysicalDeviceMemoryProperties2 = 0; + PFN_vkGetPhysicalDeviceMemoryProperties2KHR vkGetPhysicalDeviceMemoryProperties2KHR = 0; +#ifdef VK_USE_PLATFORM_MIR_KHR + PFN_vkGetPhysicalDeviceMirPresentationSupportKHR vkGetPhysicalDeviceMirPresentationSupportKHR = 0; +#endif /*VK_USE_PLATFORM_MIR_KHR*/ + PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT vkGetPhysicalDeviceMultisamplePropertiesEXT = 0; + PFN_vkGetPhysicalDevicePresentRectanglesKHR vkGetPhysicalDevicePresentRectanglesKHR = 0; + PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties = 0; + PFN_vkGetPhysicalDeviceProperties2 vkGetPhysicalDeviceProperties2 = 0; + PFN_vkGetPhysicalDeviceProperties2KHR vkGetPhysicalDeviceProperties2KHR = 0; + PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties = 0; + PFN_vkGetPhysicalDeviceQueueFamilyProperties2 vkGetPhysicalDeviceQueueFamilyProperties2 = 0; + PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR vkGetPhysicalDeviceQueueFamilyProperties2KHR = 0; + PFN_vkGetPhysicalDeviceSparseImageFormatProperties vkGetPhysicalDeviceSparseImageFormatProperties = 0; + PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 vkGetPhysicalDeviceSparseImageFormatProperties2 = 0; + PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR vkGetPhysicalDeviceSparseImageFormatProperties2KHR = 0; + PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT vkGetPhysicalDeviceSurfaceCapabilities2EXT = 0; + PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR vkGetPhysicalDeviceSurfaceCapabilities2KHR = 0; + PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR = 0; + PFN_vkGetPhysicalDeviceSurfaceFormats2KHR vkGetPhysicalDeviceSurfaceFormats2KHR = 0; + PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR = 0; + PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR = 0; + PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR = 0; +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR vkGetPhysicalDeviceWaylandPresentationSupportKHR = 0; +#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ +#ifdef VK_USE_PLATFORM_WIN32_KHR + PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR vkGetPhysicalDeviceWin32PresentationSupportKHR = 0; +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ +#ifdef VK_USE_PLATFORM_XCB_KHR + PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR vkGetPhysicalDeviceXcbPresentationSupportKHR = 0; +#endif /*VK_USE_PLATFORM_XCB_KHR*/ +#ifdef VK_USE_PLATFORM_XLIB_KHR + PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR vkGetPhysicalDeviceXlibPresentationSupportKHR = 0; +#endif /*VK_USE_PLATFORM_XLIB_KHR*/ + PFN_vkGetPipelineCacheData vkGetPipelineCacheData = 0; + PFN_vkGetQueryPoolResults vkGetQueryPoolResults = 0; +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_NV + PFN_vkGetRandROutputDisplayEXT vkGetRandROutputDisplayEXT = 0; +#endif /*VK_USE_PLATFORM_XLIB_XRANDR_NV*/ + PFN_vkGetRefreshCycleDurationGOOGLE vkGetRefreshCycleDurationGOOGLE = 0; + PFN_vkGetRenderAreaGranularity vkGetRenderAreaGranularity = 0; + PFN_vkGetSemaphoreFdKHR vkGetSemaphoreFdKHR = 0; +#ifdef VK_USE_PLATFORM_WIN32_KHR + PFN_vkGetSemaphoreWin32HandleKHR vkGetSemaphoreWin32HandleKHR = 0; +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + PFN_vkGetShaderInfoAMD vkGetShaderInfoAMD = 0; + PFN_vkGetSwapchainCounterEXT vkGetSwapchainCounterEXT = 0; + PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR = 0; + PFN_vkGetSwapchainStatusKHR vkGetSwapchainStatusKHR = 0; + PFN_vkGetValidationCacheDataEXT vkGetValidationCacheDataEXT = 0; + PFN_vkImportFenceFdKHR vkImportFenceFdKHR = 0; +#ifdef VK_USE_PLATFORM_WIN32_KHR + PFN_vkImportFenceWin32HandleKHR vkImportFenceWin32HandleKHR = 0; +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + PFN_vkImportSemaphoreFdKHR vkImportSemaphoreFdKHR = 0; +#ifdef VK_USE_PLATFORM_WIN32_KHR + PFN_vkImportSemaphoreWin32HandleKHR vkImportSemaphoreWin32HandleKHR = 0; +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges = 0; + PFN_vkMapMemory vkMapMemory = 0; + PFN_vkMergePipelineCaches vkMergePipelineCaches = 0; + PFN_vkMergeValidationCachesEXT vkMergeValidationCachesEXT = 0; + PFN_vkQueueBeginDebugUtilsLabelEXT vkQueueBeginDebugUtilsLabelEXT = 0; + PFN_vkQueueBindSparse vkQueueBindSparse = 0; + PFN_vkQueueEndDebugUtilsLabelEXT vkQueueEndDebugUtilsLabelEXT = 0; + PFN_vkQueueInsertDebugUtilsLabelEXT vkQueueInsertDebugUtilsLabelEXT = 0; + PFN_vkQueuePresentKHR vkQueuePresentKHR = 0; + PFN_vkQueueSubmit vkQueueSubmit = 0; + PFN_vkQueueWaitIdle vkQueueWaitIdle = 0; + PFN_vkRegisterDeviceEventEXT vkRegisterDeviceEventEXT = 0; + PFN_vkRegisterDisplayEventEXT vkRegisterDisplayEventEXT = 0; + PFN_vkRegisterObjectsNVX vkRegisterObjectsNVX = 0; + PFN_vkReleaseDisplayEXT vkReleaseDisplayEXT = 0; + PFN_vkResetCommandBuffer vkResetCommandBuffer = 0; + PFN_vkResetCommandPool vkResetCommandPool = 0; + PFN_vkResetDescriptorPool vkResetDescriptorPool = 0; + PFN_vkResetEvent vkResetEvent = 0; + PFN_vkResetFences vkResetFences = 0; + PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT = 0; + PFN_vkSetDebugUtilsObjectTagEXT vkSetDebugUtilsObjectTagEXT = 0; + PFN_vkSetEvent vkSetEvent = 0; + PFN_vkSetHdrMetadataEXT vkSetHdrMetadataEXT = 0; + PFN_vkSubmitDebugUtilsMessageEXT vkSubmitDebugUtilsMessageEXT = 0; + PFN_vkTrimCommandPool vkTrimCommandPool = 0; + PFN_vkTrimCommandPoolKHR vkTrimCommandPoolKHR = 0; + PFN_vkUnmapMemory vkUnmapMemory = 0; + PFN_vkUnregisterObjectsNVX vkUnregisterObjectsNVX = 0; + PFN_vkUpdateDescriptorSetWithTemplate vkUpdateDescriptorSetWithTemplate = 0; + PFN_vkUpdateDescriptorSetWithTemplateKHR vkUpdateDescriptorSetWithTemplateKHR = 0; + PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets = 0; + PFN_vkWaitForFences vkWaitForFences = 0; + public: + DispatchLoaderDynamic(Instance instance = Instance(), Device device = Device()) + { + if (instance) + { + init(instance, device); + } + } + + void init(Instance instance, Device device = Device()) + { + vkAcquireNextImage2KHR = PFN_vkAcquireNextImage2KHR(device ? device.getProcAddr( "vkAcquireNextImage2KHR") : instance.getProcAddr( "vkAcquireNextImage2KHR")); + vkAcquireNextImageKHR = PFN_vkAcquireNextImageKHR(device ? device.getProcAddr( "vkAcquireNextImageKHR") : instance.getProcAddr( "vkAcquireNextImageKHR")); +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_NV + vkAcquireXlibDisplayEXT = PFN_vkAcquireXlibDisplayEXT(device ? device.getProcAddr( "vkAcquireXlibDisplayEXT") : instance.getProcAddr( "vkAcquireXlibDisplayEXT")); +#endif /*VK_USE_PLATFORM_XLIB_XRANDR_NV*/ + vkAllocateCommandBuffers = PFN_vkAllocateCommandBuffers(device ? device.getProcAddr( "vkAllocateCommandBuffers") : instance.getProcAddr( "vkAllocateCommandBuffers")); + vkAllocateDescriptorSets = PFN_vkAllocateDescriptorSets(device ? device.getProcAddr( "vkAllocateDescriptorSets") : instance.getProcAddr( "vkAllocateDescriptorSets")); + vkAllocateMemory = PFN_vkAllocateMemory(device ? device.getProcAddr( "vkAllocateMemory") : instance.getProcAddr( "vkAllocateMemory")); + vkBeginCommandBuffer = PFN_vkBeginCommandBuffer(device ? device.getProcAddr( "vkBeginCommandBuffer") : instance.getProcAddr( "vkBeginCommandBuffer")); + vkBindBufferMemory = PFN_vkBindBufferMemory(device ? device.getProcAddr( "vkBindBufferMemory") : instance.getProcAddr( "vkBindBufferMemory")); + vkBindBufferMemory2 = PFN_vkBindBufferMemory2(device ? device.getProcAddr( "vkBindBufferMemory2") : instance.getProcAddr( "vkBindBufferMemory2")); + vkBindBufferMemory2KHR = PFN_vkBindBufferMemory2KHR(device ? device.getProcAddr( "vkBindBufferMemory2KHR") : instance.getProcAddr( "vkBindBufferMemory2KHR")); + vkBindImageMemory = PFN_vkBindImageMemory(device ? device.getProcAddr( "vkBindImageMemory") : instance.getProcAddr( "vkBindImageMemory")); + vkBindImageMemory2 = PFN_vkBindImageMemory2(device ? device.getProcAddr( "vkBindImageMemory2") : instance.getProcAddr( "vkBindImageMemory2")); + vkBindImageMemory2KHR = PFN_vkBindImageMemory2KHR(device ? device.getProcAddr( "vkBindImageMemory2KHR") : instance.getProcAddr( "vkBindImageMemory2KHR")); + vkCmdBeginDebugUtilsLabelEXT = PFN_vkCmdBeginDebugUtilsLabelEXT(device ? device.getProcAddr( "vkCmdBeginDebugUtilsLabelEXT") : instance.getProcAddr( "vkCmdBeginDebugUtilsLabelEXT")); + vkCmdBeginQuery = PFN_vkCmdBeginQuery(device ? device.getProcAddr( "vkCmdBeginQuery") : instance.getProcAddr( "vkCmdBeginQuery")); + vkCmdBeginRenderPass = PFN_vkCmdBeginRenderPass(device ? device.getProcAddr( "vkCmdBeginRenderPass") : instance.getProcAddr( "vkCmdBeginRenderPass")); + vkCmdBindDescriptorSets = PFN_vkCmdBindDescriptorSets(device ? device.getProcAddr( "vkCmdBindDescriptorSets") : instance.getProcAddr( "vkCmdBindDescriptorSets")); + vkCmdBindIndexBuffer = PFN_vkCmdBindIndexBuffer(device ? device.getProcAddr( "vkCmdBindIndexBuffer") : instance.getProcAddr( "vkCmdBindIndexBuffer")); + vkCmdBindPipeline = PFN_vkCmdBindPipeline(device ? device.getProcAddr( "vkCmdBindPipeline") : instance.getProcAddr( "vkCmdBindPipeline")); + vkCmdBindVertexBuffers = PFN_vkCmdBindVertexBuffers(device ? device.getProcAddr( "vkCmdBindVertexBuffers") : instance.getProcAddr( "vkCmdBindVertexBuffers")); + vkCmdBlitImage = PFN_vkCmdBlitImage(device ? device.getProcAddr( "vkCmdBlitImage") : instance.getProcAddr( "vkCmdBlitImage")); + vkCmdClearAttachments = PFN_vkCmdClearAttachments(device ? device.getProcAddr( "vkCmdClearAttachments") : instance.getProcAddr( "vkCmdClearAttachments")); + vkCmdClearColorImage = PFN_vkCmdClearColorImage(device ? device.getProcAddr( "vkCmdClearColorImage") : instance.getProcAddr( "vkCmdClearColorImage")); + vkCmdClearDepthStencilImage = PFN_vkCmdClearDepthStencilImage(device ? device.getProcAddr( "vkCmdClearDepthStencilImage") : instance.getProcAddr( "vkCmdClearDepthStencilImage")); + vkCmdCopyBuffer = PFN_vkCmdCopyBuffer(device ? device.getProcAddr( "vkCmdCopyBuffer") : instance.getProcAddr( "vkCmdCopyBuffer")); + vkCmdCopyBufferToImage = PFN_vkCmdCopyBufferToImage(device ? device.getProcAddr( "vkCmdCopyBufferToImage") : instance.getProcAddr( "vkCmdCopyBufferToImage")); + vkCmdCopyImage = PFN_vkCmdCopyImage(device ? device.getProcAddr( "vkCmdCopyImage") : instance.getProcAddr( "vkCmdCopyImage")); + vkCmdCopyImageToBuffer = PFN_vkCmdCopyImageToBuffer(device ? device.getProcAddr( "vkCmdCopyImageToBuffer") : instance.getProcAddr( "vkCmdCopyImageToBuffer")); + vkCmdCopyQueryPoolResults = PFN_vkCmdCopyQueryPoolResults(device ? device.getProcAddr( "vkCmdCopyQueryPoolResults") : instance.getProcAddr( "vkCmdCopyQueryPoolResults")); + vkCmdDebugMarkerBeginEXT = PFN_vkCmdDebugMarkerBeginEXT(device ? device.getProcAddr( "vkCmdDebugMarkerBeginEXT") : instance.getProcAddr( "vkCmdDebugMarkerBeginEXT")); + vkCmdDebugMarkerEndEXT = PFN_vkCmdDebugMarkerEndEXT(device ? device.getProcAddr( "vkCmdDebugMarkerEndEXT") : instance.getProcAddr( "vkCmdDebugMarkerEndEXT")); + vkCmdDebugMarkerInsertEXT = PFN_vkCmdDebugMarkerInsertEXT(device ? device.getProcAddr( "vkCmdDebugMarkerInsertEXT") : instance.getProcAddr( "vkCmdDebugMarkerInsertEXT")); + vkCmdDispatch = PFN_vkCmdDispatch(device ? device.getProcAddr( "vkCmdDispatch") : instance.getProcAddr( "vkCmdDispatch")); + vkCmdDispatchBase = PFN_vkCmdDispatchBase(device ? device.getProcAddr( "vkCmdDispatchBase") : instance.getProcAddr( "vkCmdDispatchBase")); + vkCmdDispatchBaseKHR = PFN_vkCmdDispatchBaseKHR(device ? device.getProcAddr( "vkCmdDispatchBaseKHR") : instance.getProcAddr( "vkCmdDispatchBaseKHR")); + vkCmdDispatchIndirect = PFN_vkCmdDispatchIndirect(device ? device.getProcAddr( "vkCmdDispatchIndirect") : instance.getProcAddr( "vkCmdDispatchIndirect")); + vkCmdDraw = PFN_vkCmdDraw(device ? device.getProcAddr( "vkCmdDraw") : instance.getProcAddr( "vkCmdDraw")); + vkCmdDrawIndexed = PFN_vkCmdDrawIndexed(device ? device.getProcAddr( "vkCmdDrawIndexed") : instance.getProcAddr( "vkCmdDrawIndexed")); + vkCmdDrawIndexedIndirect = PFN_vkCmdDrawIndexedIndirect(device ? device.getProcAddr( "vkCmdDrawIndexedIndirect") : instance.getProcAddr( "vkCmdDrawIndexedIndirect")); + vkCmdDrawIndexedIndirectCountAMD = PFN_vkCmdDrawIndexedIndirectCountAMD(device ? device.getProcAddr( "vkCmdDrawIndexedIndirectCountAMD") : instance.getProcAddr( "vkCmdDrawIndexedIndirectCountAMD")); + vkCmdDrawIndirect = PFN_vkCmdDrawIndirect(device ? device.getProcAddr( "vkCmdDrawIndirect") : instance.getProcAddr( "vkCmdDrawIndirect")); + vkCmdDrawIndirectCountAMD = PFN_vkCmdDrawIndirectCountAMD(device ? device.getProcAddr( "vkCmdDrawIndirectCountAMD") : instance.getProcAddr( "vkCmdDrawIndirectCountAMD")); + vkCmdEndDebugUtilsLabelEXT = PFN_vkCmdEndDebugUtilsLabelEXT(device ? device.getProcAddr( "vkCmdEndDebugUtilsLabelEXT") : instance.getProcAddr( "vkCmdEndDebugUtilsLabelEXT")); + vkCmdEndQuery = PFN_vkCmdEndQuery(device ? device.getProcAddr( "vkCmdEndQuery") : instance.getProcAddr( "vkCmdEndQuery")); + vkCmdEndRenderPass = PFN_vkCmdEndRenderPass(device ? device.getProcAddr( "vkCmdEndRenderPass") : instance.getProcAddr( "vkCmdEndRenderPass")); + vkCmdExecuteCommands = PFN_vkCmdExecuteCommands(device ? device.getProcAddr( "vkCmdExecuteCommands") : instance.getProcAddr( "vkCmdExecuteCommands")); + vkCmdFillBuffer = PFN_vkCmdFillBuffer(device ? device.getProcAddr( "vkCmdFillBuffer") : instance.getProcAddr( "vkCmdFillBuffer")); + vkCmdInsertDebugUtilsLabelEXT = PFN_vkCmdInsertDebugUtilsLabelEXT(device ? device.getProcAddr( "vkCmdInsertDebugUtilsLabelEXT") : instance.getProcAddr( "vkCmdInsertDebugUtilsLabelEXT")); + vkCmdNextSubpass = PFN_vkCmdNextSubpass(device ? device.getProcAddr( "vkCmdNextSubpass") : instance.getProcAddr( "vkCmdNextSubpass")); + vkCmdPipelineBarrier = PFN_vkCmdPipelineBarrier(device ? device.getProcAddr( "vkCmdPipelineBarrier") : instance.getProcAddr( "vkCmdPipelineBarrier")); + vkCmdProcessCommandsNVX = PFN_vkCmdProcessCommandsNVX(device ? device.getProcAddr( "vkCmdProcessCommandsNVX") : instance.getProcAddr( "vkCmdProcessCommandsNVX")); + vkCmdPushConstants = PFN_vkCmdPushConstants(device ? device.getProcAddr( "vkCmdPushConstants") : instance.getProcAddr( "vkCmdPushConstants")); + vkCmdPushDescriptorSetKHR = PFN_vkCmdPushDescriptorSetKHR(device ? device.getProcAddr( "vkCmdPushDescriptorSetKHR") : instance.getProcAddr( "vkCmdPushDescriptorSetKHR")); + vkCmdPushDescriptorSetWithTemplateKHR = PFN_vkCmdPushDescriptorSetWithTemplateKHR(device ? device.getProcAddr( "vkCmdPushDescriptorSetWithTemplateKHR") : instance.getProcAddr( "vkCmdPushDescriptorSetWithTemplateKHR")); + vkCmdReserveSpaceForCommandsNVX = PFN_vkCmdReserveSpaceForCommandsNVX(device ? device.getProcAddr( "vkCmdReserveSpaceForCommandsNVX") : instance.getProcAddr( "vkCmdReserveSpaceForCommandsNVX")); + vkCmdResetEvent = PFN_vkCmdResetEvent(device ? device.getProcAddr( "vkCmdResetEvent") : instance.getProcAddr( "vkCmdResetEvent")); + vkCmdResetQueryPool = PFN_vkCmdResetQueryPool(device ? device.getProcAddr( "vkCmdResetQueryPool") : instance.getProcAddr( "vkCmdResetQueryPool")); + vkCmdResolveImage = PFN_vkCmdResolveImage(device ? device.getProcAddr( "vkCmdResolveImage") : instance.getProcAddr( "vkCmdResolveImage")); + vkCmdSetBlendConstants = PFN_vkCmdSetBlendConstants(device ? device.getProcAddr( "vkCmdSetBlendConstants") : instance.getProcAddr( "vkCmdSetBlendConstants")); + vkCmdSetDepthBias = PFN_vkCmdSetDepthBias(device ? device.getProcAddr( "vkCmdSetDepthBias") : instance.getProcAddr( "vkCmdSetDepthBias")); + vkCmdSetDepthBounds = PFN_vkCmdSetDepthBounds(device ? device.getProcAddr( "vkCmdSetDepthBounds") : instance.getProcAddr( "vkCmdSetDepthBounds")); + vkCmdSetDeviceMask = PFN_vkCmdSetDeviceMask(device ? device.getProcAddr( "vkCmdSetDeviceMask") : instance.getProcAddr( "vkCmdSetDeviceMask")); + vkCmdSetDeviceMaskKHR = PFN_vkCmdSetDeviceMaskKHR(device ? device.getProcAddr( "vkCmdSetDeviceMaskKHR") : instance.getProcAddr( "vkCmdSetDeviceMaskKHR")); + vkCmdSetDiscardRectangleEXT = PFN_vkCmdSetDiscardRectangleEXT(device ? device.getProcAddr( "vkCmdSetDiscardRectangleEXT") : instance.getProcAddr( "vkCmdSetDiscardRectangleEXT")); + vkCmdSetEvent = PFN_vkCmdSetEvent(device ? device.getProcAddr( "vkCmdSetEvent") : instance.getProcAddr( "vkCmdSetEvent")); + vkCmdSetLineWidth = PFN_vkCmdSetLineWidth(device ? device.getProcAddr( "vkCmdSetLineWidth") : instance.getProcAddr( "vkCmdSetLineWidth")); + vkCmdSetSampleLocationsEXT = PFN_vkCmdSetSampleLocationsEXT(device ? device.getProcAddr( "vkCmdSetSampleLocationsEXT") : instance.getProcAddr( "vkCmdSetSampleLocationsEXT")); + vkCmdSetScissor = PFN_vkCmdSetScissor(device ? device.getProcAddr( "vkCmdSetScissor") : instance.getProcAddr( "vkCmdSetScissor")); + vkCmdSetStencilCompareMask = PFN_vkCmdSetStencilCompareMask(device ? device.getProcAddr( "vkCmdSetStencilCompareMask") : instance.getProcAddr( "vkCmdSetStencilCompareMask")); + vkCmdSetStencilReference = PFN_vkCmdSetStencilReference(device ? device.getProcAddr( "vkCmdSetStencilReference") : instance.getProcAddr( "vkCmdSetStencilReference")); + vkCmdSetStencilWriteMask = PFN_vkCmdSetStencilWriteMask(device ? device.getProcAddr( "vkCmdSetStencilWriteMask") : instance.getProcAddr( "vkCmdSetStencilWriteMask")); + vkCmdSetViewport = PFN_vkCmdSetViewport(device ? device.getProcAddr( "vkCmdSetViewport") : instance.getProcAddr( "vkCmdSetViewport")); + vkCmdSetViewportWScalingNV = PFN_vkCmdSetViewportWScalingNV(device ? device.getProcAddr( "vkCmdSetViewportWScalingNV") : instance.getProcAddr( "vkCmdSetViewportWScalingNV")); + vkCmdUpdateBuffer = PFN_vkCmdUpdateBuffer(device ? device.getProcAddr( "vkCmdUpdateBuffer") : instance.getProcAddr( "vkCmdUpdateBuffer")); + vkCmdWaitEvents = PFN_vkCmdWaitEvents(device ? device.getProcAddr( "vkCmdWaitEvents") : instance.getProcAddr( "vkCmdWaitEvents")); + vkCmdWriteBufferMarkerAMD = PFN_vkCmdWriteBufferMarkerAMD(device ? device.getProcAddr( "vkCmdWriteBufferMarkerAMD") : instance.getProcAddr( "vkCmdWriteBufferMarkerAMD")); + vkCmdWriteTimestamp = PFN_vkCmdWriteTimestamp(device ? device.getProcAddr( "vkCmdWriteTimestamp") : instance.getProcAddr( "vkCmdWriteTimestamp")); +#ifdef VK_USE_PLATFORM_ANDROID_KHR + vkCreateAndroidSurfaceKHR = PFN_vkCreateAndroidSurfaceKHR(instance.getProcAddr( "vkCreateAndroidSurfaceKHR")); +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + vkCreateBuffer = PFN_vkCreateBuffer(device ? device.getProcAddr( "vkCreateBuffer") : instance.getProcAddr( "vkCreateBuffer")); + vkCreateBufferView = PFN_vkCreateBufferView(device ? device.getProcAddr( "vkCreateBufferView") : instance.getProcAddr( "vkCreateBufferView")); + vkCreateCommandPool = PFN_vkCreateCommandPool(device ? device.getProcAddr( "vkCreateCommandPool") : instance.getProcAddr( "vkCreateCommandPool")); + vkCreateComputePipelines = PFN_vkCreateComputePipelines(device ? device.getProcAddr( "vkCreateComputePipelines") : instance.getProcAddr( "vkCreateComputePipelines")); + vkCreateDebugReportCallbackEXT = PFN_vkCreateDebugReportCallbackEXT(instance.getProcAddr( "vkCreateDebugReportCallbackEXT")); + vkCreateDebugUtilsMessengerEXT = PFN_vkCreateDebugUtilsMessengerEXT(instance.getProcAddr( "vkCreateDebugUtilsMessengerEXT")); + vkCreateDescriptorPool = PFN_vkCreateDescriptorPool(device ? device.getProcAddr( "vkCreateDescriptorPool") : instance.getProcAddr( "vkCreateDescriptorPool")); + vkCreateDescriptorSetLayout = PFN_vkCreateDescriptorSetLayout(device ? device.getProcAddr( "vkCreateDescriptorSetLayout") : instance.getProcAddr( "vkCreateDescriptorSetLayout")); + vkCreateDescriptorUpdateTemplate = PFN_vkCreateDescriptorUpdateTemplate(device ? device.getProcAddr( "vkCreateDescriptorUpdateTemplate") : instance.getProcAddr( "vkCreateDescriptorUpdateTemplate")); + vkCreateDescriptorUpdateTemplateKHR = PFN_vkCreateDescriptorUpdateTemplateKHR(device ? device.getProcAddr( "vkCreateDescriptorUpdateTemplateKHR") : instance.getProcAddr( "vkCreateDescriptorUpdateTemplateKHR")); + vkCreateDevice = PFN_vkCreateDevice(device ? device.getProcAddr( "vkCreateDevice") : instance.getProcAddr( "vkCreateDevice")); + vkCreateDisplayModeKHR = PFN_vkCreateDisplayModeKHR(device ? device.getProcAddr( "vkCreateDisplayModeKHR") : instance.getProcAddr( "vkCreateDisplayModeKHR")); + vkCreateDisplayPlaneSurfaceKHR = PFN_vkCreateDisplayPlaneSurfaceKHR(instance.getProcAddr( "vkCreateDisplayPlaneSurfaceKHR")); + vkCreateEvent = PFN_vkCreateEvent(device ? device.getProcAddr( "vkCreateEvent") : instance.getProcAddr( "vkCreateEvent")); + vkCreateFence = PFN_vkCreateFence(device ? device.getProcAddr( "vkCreateFence") : instance.getProcAddr( "vkCreateFence")); + vkCreateFramebuffer = PFN_vkCreateFramebuffer(device ? device.getProcAddr( "vkCreateFramebuffer") : instance.getProcAddr( "vkCreateFramebuffer")); + vkCreateGraphicsPipelines = PFN_vkCreateGraphicsPipelines(device ? device.getProcAddr( "vkCreateGraphicsPipelines") : instance.getProcAddr( "vkCreateGraphicsPipelines")); +#ifdef VK_USE_PLATFORM_IOS_MVK + vkCreateIOSSurfaceMVK = PFN_vkCreateIOSSurfaceMVK(instance.getProcAddr( "vkCreateIOSSurfaceMVK")); +#endif /*VK_USE_PLATFORM_IOS_MVK*/ + vkCreateImage = PFN_vkCreateImage(device ? device.getProcAddr( "vkCreateImage") : instance.getProcAddr( "vkCreateImage")); + vkCreateImageView = PFN_vkCreateImageView(device ? device.getProcAddr( "vkCreateImageView") : instance.getProcAddr( "vkCreateImageView")); + vkCreateIndirectCommandsLayoutNVX = PFN_vkCreateIndirectCommandsLayoutNVX(device ? device.getProcAddr( "vkCreateIndirectCommandsLayoutNVX") : instance.getProcAddr( "vkCreateIndirectCommandsLayoutNVX")); + vkCreateInstance = PFN_vkCreateInstance(instance.getProcAddr( "vkCreateInstance")); +#ifdef VK_USE_PLATFORM_MACOS_MVK + vkCreateMacOSSurfaceMVK = PFN_vkCreateMacOSSurfaceMVK(instance.getProcAddr( "vkCreateMacOSSurfaceMVK")); +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ +#ifdef VK_USE_PLATFORM_MIR_KHR + vkCreateMirSurfaceKHR = PFN_vkCreateMirSurfaceKHR(instance.getProcAddr( "vkCreateMirSurfaceKHR")); +#endif /*VK_USE_PLATFORM_MIR_KHR*/ + vkCreateObjectTableNVX = PFN_vkCreateObjectTableNVX(device ? device.getProcAddr( "vkCreateObjectTableNVX") : instance.getProcAddr( "vkCreateObjectTableNVX")); + vkCreatePipelineCache = PFN_vkCreatePipelineCache(device ? device.getProcAddr( "vkCreatePipelineCache") : instance.getProcAddr( "vkCreatePipelineCache")); + vkCreatePipelineLayout = PFN_vkCreatePipelineLayout(device ? device.getProcAddr( "vkCreatePipelineLayout") : instance.getProcAddr( "vkCreatePipelineLayout")); + vkCreateQueryPool = PFN_vkCreateQueryPool(device ? device.getProcAddr( "vkCreateQueryPool") : instance.getProcAddr( "vkCreateQueryPool")); + vkCreateRenderPass = PFN_vkCreateRenderPass(device ? device.getProcAddr( "vkCreateRenderPass") : instance.getProcAddr( "vkCreateRenderPass")); + vkCreateSampler = PFN_vkCreateSampler(device ? device.getProcAddr( "vkCreateSampler") : instance.getProcAddr( "vkCreateSampler")); + vkCreateSamplerYcbcrConversion = PFN_vkCreateSamplerYcbcrConversion(device ? device.getProcAddr( "vkCreateSamplerYcbcrConversion") : instance.getProcAddr( "vkCreateSamplerYcbcrConversion")); + vkCreateSamplerYcbcrConversionKHR = PFN_vkCreateSamplerYcbcrConversionKHR(device ? device.getProcAddr( "vkCreateSamplerYcbcrConversionKHR") : instance.getProcAddr( "vkCreateSamplerYcbcrConversionKHR")); + vkCreateSemaphore = PFN_vkCreateSemaphore(device ? device.getProcAddr( "vkCreateSemaphore") : instance.getProcAddr( "vkCreateSemaphore")); + vkCreateShaderModule = PFN_vkCreateShaderModule(device ? device.getProcAddr( "vkCreateShaderModule") : instance.getProcAddr( "vkCreateShaderModule")); + vkCreateSharedSwapchainsKHR = PFN_vkCreateSharedSwapchainsKHR(device ? device.getProcAddr( "vkCreateSharedSwapchainsKHR") : instance.getProcAddr( "vkCreateSharedSwapchainsKHR")); + vkCreateSwapchainKHR = PFN_vkCreateSwapchainKHR(device ? device.getProcAddr( "vkCreateSwapchainKHR") : instance.getProcAddr( "vkCreateSwapchainKHR")); + vkCreateValidationCacheEXT = PFN_vkCreateValidationCacheEXT(device ? device.getProcAddr( "vkCreateValidationCacheEXT") : instance.getProcAddr( "vkCreateValidationCacheEXT")); +#ifdef VK_USE_PLATFORM_VI_NN + vkCreateViSurfaceNN = PFN_vkCreateViSurfaceNN(instance.getProcAddr( "vkCreateViSurfaceNN")); +#endif /*VK_USE_PLATFORM_VI_NN*/ +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + vkCreateWaylandSurfaceKHR = PFN_vkCreateWaylandSurfaceKHR(instance.getProcAddr( "vkCreateWaylandSurfaceKHR")); +#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ +#ifdef VK_USE_PLATFORM_WIN32_KHR + vkCreateWin32SurfaceKHR = PFN_vkCreateWin32SurfaceKHR(instance.getProcAddr( "vkCreateWin32SurfaceKHR")); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ +#ifdef VK_USE_PLATFORM_XCB_KHR + vkCreateXcbSurfaceKHR = PFN_vkCreateXcbSurfaceKHR(instance.getProcAddr( "vkCreateXcbSurfaceKHR")); +#endif /*VK_USE_PLATFORM_XCB_KHR*/ +#ifdef VK_USE_PLATFORM_XLIB_KHR + vkCreateXlibSurfaceKHR = PFN_vkCreateXlibSurfaceKHR(instance.getProcAddr( "vkCreateXlibSurfaceKHR")); +#endif /*VK_USE_PLATFORM_XLIB_KHR*/ + vkDebugMarkerSetObjectNameEXT = PFN_vkDebugMarkerSetObjectNameEXT(device ? device.getProcAddr( "vkDebugMarkerSetObjectNameEXT") : instance.getProcAddr( "vkDebugMarkerSetObjectNameEXT")); + vkDebugMarkerSetObjectTagEXT = PFN_vkDebugMarkerSetObjectTagEXT(device ? device.getProcAddr( "vkDebugMarkerSetObjectTagEXT") : instance.getProcAddr( "vkDebugMarkerSetObjectTagEXT")); + vkDebugReportMessageEXT = PFN_vkDebugReportMessageEXT(instance.getProcAddr( "vkDebugReportMessageEXT")); + vkDestroyBuffer = PFN_vkDestroyBuffer(device ? device.getProcAddr( "vkDestroyBuffer") : instance.getProcAddr( "vkDestroyBuffer")); + vkDestroyBufferView = PFN_vkDestroyBufferView(device ? device.getProcAddr( "vkDestroyBufferView") : instance.getProcAddr( "vkDestroyBufferView")); + vkDestroyCommandPool = PFN_vkDestroyCommandPool(device ? device.getProcAddr( "vkDestroyCommandPool") : instance.getProcAddr( "vkDestroyCommandPool")); + vkDestroyDebugReportCallbackEXT = PFN_vkDestroyDebugReportCallbackEXT(instance.getProcAddr( "vkDestroyDebugReportCallbackEXT")); + vkDestroyDebugUtilsMessengerEXT = PFN_vkDestroyDebugUtilsMessengerEXT(instance.getProcAddr( "vkDestroyDebugUtilsMessengerEXT")); + vkDestroyDescriptorPool = PFN_vkDestroyDescriptorPool(device ? device.getProcAddr( "vkDestroyDescriptorPool") : instance.getProcAddr( "vkDestroyDescriptorPool")); + vkDestroyDescriptorSetLayout = PFN_vkDestroyDescriptorSetLayout(device ? device.getProcAddr( "vkDestroyDescriptorSetLayout") : instance.getProcAddr( "vkDestroyDescriptorSetLayout")); + vkDestroyDescriptorUpdateTemplate = PFN_vkDestroyDescriptorUpdateTemplate(device ? device.getProcAddr( "vkDestroyDescriptorUpdateTemplate") : instance.getProcAddr( "vkDestroyDescriptorUpdateTemplate")); + vkDestroyDescriptorUpdateTemplateKHR = PFN_vkDestroyDescriptorUpdateTemplateKHR(device ? device.getProcAddr( "vkDestroyDescriptorUpdateTemplateKHR") : instance.getProcAddr( "vkDestroyDescriptorUpdateTemplateKHR")); + vkDestroyDevice = PFN_vkDestroyDevice(device ? device.getProcAddr( "vkDestroyDevice") : instance.getProcAddr( "vkDestroyDevice")); + vkDestroyEvent = PFN_vkDestroyEvent(device ? device.getProcAddr( "vkDestroyEvent") : instance.getProcAddr( "vkDestroyEvent")); + vkDestroyFence = PFN_vkDestroyFence(device ? device.getProcAddr( "vkDestroyFence") : instance.getProcAddr( "vkDestroyFence")); + vkDestroyFramebuffer = PFN_vkDestroyFramebuffer(device ? device.getProcAddr( "vkDestroyFramebuffer") : instance.getProcAddr( "vkDestroyFramebuffer")); + vkDestroyImage = PFN_vkDestroyImage(device ? device.getProcAddr( "vkDestroyImage") : instance.getProcAddr( "vkDestroyImage")); + vkDestroyImageView = PFN_vkDestroyImageView(device ? device.getProcAddr( "vkDestroyImageView") : instance.getProcAddr( "vkDestroyImageView")); + vkDestroyIndirectCommandsLayoutNVX = PFN_vkDestroyIndirectCommandsLayoutNVX(device ? device.getProcAddr( "vkDestroyIndirectCommandsLayoutNVX") : instance.getProcAddr( "vkDestroyIndirectCommandsLayoutNVX")); + vkDestroyInstance = PFN_vkDestroyInstance(instance.getProcAddr( "vkDestroyInstance")); + vkDestroyObjectTableNVX = PFN_vkDestroyObjectTableNVX(device ? device.getProcAddr( "vkDestroyObjectTableNVX") : instance.getProcAddr( "vkDestroyObjectTableNVX")); + vkDestroyPipeline = PFN_vkDestroyPipeline(device ? device.getProcAddr( "vkDestroyPipeline") : instance.getProcAddr( "vkDestroyPipeline")); + vkDestroyPipelineCache = PFN_vkDestroyPipelineCache(device ? device.getProcAddr( "vkDestroyPipelineCache") : instance.getProcAddr( "vkDestroyPipelineCache")); + vkDestroyPipelineLayout = PFN_vkDestroyPipelineLayout(device ? device.getProcAddr( "vkDestroyPipelineLayout") : instance.getProcAddr( "vkDestroyPipelineLayout")); + vkDestroyQueryPool = PFN_vkDestroyQueryPool(device ? device.getProcAddr( "vkDestroyQueryPool") : instance.getProcAddr( "vkDestroyQueryPool")); + vkDestroyRenderPass = PFN_vkDestroyRenderPass(device ? device.getProcAddr( "vkDestroyRenderPass") : instance.getProcAddr( "vkDestroyRenderPass")); + vkDestroySampler = PFN_vkDestroySampler(device ? device.getProcAddr( "vkDestroySampler") : instance.getProcAddr( "vkDestroySampler")); + vkDestroySamplerYcbcrConversion = PFN_vkDestroySamplerYcbcrConversion(device ? device.getProcAddr( "vkDestroySamplerYcbcrConversion") : instance.getProcAddr( "vkDestroySamplerYcbcrConversion")); + vkDestroySamplerYcbcrConversionKHR = PFN_vkDestroySamplerYcbcrConversionKHR(device ? device.getProcAddr( "vkDestroySamplerYcbcrConversionKHR") : instance.getProcAddr( "vkDestroySamplerYcbcrConversionKHR")); + vkDestroySemaphore = PFN_vkDestroySemaphore(device ? device.getProcAddr( "vkDestroySemaphore") : instance.getProcAddr( "vkDestroySemaphore")); + vkDestroyShaderModule = PFN_vkDestroyShaderModule(device ? device.getProcAddr( "vkDestroyShaderModule") : instance.getProcAddr( "vkDestroyShaderModule")); + vkDestroySurfaceKHR = PFN_vkDestroySurfaceKHR(instance.getProcAddr( "vkDestroySurfaceKHR")); + vkDestroySwapchainKHR = PFN_vkDestroySwapchainKHR(device ? device.getProcAddr( "vkDestroySwapchainKHR") : instance.getProcAddr( "vkDestroySwapchainKHR")); + vkDestroyValidationCacheEXT = PFN_vkDestroyValidationCacheEXT(device ? device.getProcAddr( "vkDestroyValidationCacheEXT") : instance.getProcAddr( "vkDestroyValidationCacheEXT")); + vkDeviceWaitIdle = PFN_vkDeviceWaitIdle(device ? device.getProcAddr( "vkDeviceWaitIdle") : instance.getProcAddr( "vkDeviceWaitIdle")); + vkDisplayPowerControlEXT = PFN_vkDisplayPowerControlEXT(device ? device.getProcAddr( "vkDisplayPowerControlEXT") : instance.getProcAddr( "vkDisplayPowerControlEXT")); + vkEndCommandBuffer = PFN_vkEndCommandBuffer(device ? device.getProcAddr( "vkEndCommandBuffer") : instance.getProcAddr( "vkEndCommandBuffer")); + vkEnumerateDeviceExtensionProperties = PFN_vkEnumerateDeviceExtensionProperties(device ? device.getProcAddr( "vkEnumerateDeviceExtensionProperties") : instance.getProcAddr( "vkEnumerateDeviceExtensionProperties")); + vkEnumerateDeviceLayerProperties = PFN_vkEnumerateDeviceLayerProperties(device ? device.getProcAddr( "vkEnumerateDeviceLayerProperties") : instance.getProcAddr( "vkEnumerateDeviceLayerProperties")); + vkEnumerateInstanceExtensionProperties = PFN_vkEnumerateInstanceExtensionProperties(instance.getProcAddr( "vkEnumerateInstanceExtensionProperties")); + vkEnumerateInstanceLayerProperties = PFN_vkEnumerateInstanceLayerProperties(instance.getProcAddr( "vkEnumerateInstanceLayerProperties")); + vkEnumerateInstanceVersion = PFN_vkEnumerateInstanceVersion(instance.getProcAddr( "vkEnumerateInstanceVersion")); + vkEnumeratePhysicalDeviceGroups = PFN_vkEnumeratePhysicalDeviceGroups(instance.getProcAddr( "vkEnumeratePhysicalDeviceGroups")); + vkEnumeratePhysicalDeviceGroupsKHR = PFN_vkEnumeratePhysicalDeviceGroupsKHR(instance.getProcAddr( "vkEnumeratePhysicalDeviceGroupsKHR")); + vkEnumeratePhysicalDevices = PFN_vkEnumeratePhysicalDevices(instance.getProcAddr( "vkEnumeratePhysicalDevices")); + vkFlushMappedMemoryRanges = PFN_vkFlushMappedMemoryRanges(device ? device.getProcAddr( "vkFlushMappedMemoryRanges") : instance.getProcAddr( "vkFlushMappedMemoryRanges")); + vkFreeCommandBuffers = PFN_vkFreeCommandBuffers(device ? device.getProcAddr( "vkFreeCommandBuffers") : instance.getProcAddr( "vkFreeCommandBuffers")); + vkFreeDescriptorSets = PFN_vkFreeDescriptorSets(device ? device.getProcAddr( "vkFreeDescriptorSets") : instance.getProcAddr( "vkFreeDescriptorSets")); + vkFreeMemory = PFN_vkFreeMemory(device ? device.getProcAddr( "vkFreeMemory") : instance.getProcAddr( "vkFreeMemory")); +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + vkGetAndroidHardwareBufferPropertiesANDROID = PFN_vkGetAndroidHardwareBufferPropertiesANDROID(device ? device.getProcAddr( "vkGetAndroidHardwareBufferPropertiesANDROID") : instance.getProcAddr( "vkGetAndroidHardwareBufferPropertiesANDROID")); +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ + vkGetBufferMemoryRequirements = PFN_vkGetBufferMemoryRequirements(device ? device.getProcAddr( "vkGetBufferMemoryRequirements") : instance.getProcAddr( "vkGetBufferMemoryRequirements")); + vkGetBufferMemoryRequirements2 = PFN_vkGetBufferMemoryRequirements2(device ? device.getProcAddr( "vkGetBufferMemoryRequirements2") : instance.getProcAddr( "vkGetBufferMemoryRequirements2")); + vkGetBufferMemoryRequirements2KHR = PFN_vkGetBufferMemoryRequirements2KHR(device ? device.getProcAddr( "vkGetBufferMemoryRequirements2KHR") : instance.getProcAddr( "vkGetBufferMemoryRequirements2KHR")); + vkGetDescriptorSetLayoutSupport = PFN_vkGetDescriptorSetLayoutSupport(device ? device.getProcAddr( "vkGetDescriptorSetLayoutSupport") : instance.getProcAddr( "vkGetDescriptorSetLayoutSupport")); + vkGetDescriptorSetLayoutSupportKHR = PFN_vkGetDescriptorSetLayoutSupportKHR(device ? device.getProcAddr( "vkGetDescriptorSetLayoutSupportKHR") : instance.getProcAddr( "vkGetDescriptorSetLayoutSupportKHR")); + vkGetDeviceGroupPeerMemoryFeatures = PFN_vkGetDeviceGroupPeerMemoryFeatures(device ? device.getProcAddr( "vkGetDeviceGroupPeerMemoryFeatures") : instance.getProcAddr( "vkGetDeviceGroupPeerMemoryFeatures")); + vkGetDeviceGroupPeerMemoryFeaturesKHR = PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR(device ? device.getProcAddr( "vkGetDeviceGroupPeerMemoryFeaturesKHR") : instance.getProcAddr( "vkGetDeviceGroupPeerMemoryFeaturesKHR")); + vkGetDeviceGroupPresentCapabilitiesKHR = PFN_vkGetDeviceGroupPresentCapabilitiesKHR(device ? device.getProcAddr( "vkGetDeviceGroupPresentCapabilitiesKHR") : instance.getProcAddr( "vkGetDeviceGroupPresentCapabilitiesKHR")); + vkGetDeviceGroupSurfacePresentModesKHR = PFN_vkGetDeviceGroupSurfacePresentModesKHR(device ? device.getProcAddr( "vkGetDeviceGroupSurfacePresentModesKHR") : instance.getProcAddr( "vkGetDeviceGroupSurfacePresentModesKHR")); + vkGetDeviceMemoryCommitment = PFN_vkGetDeviceMemoryCommitment(device ? device.getProcAddr( "vkGetDeviceMemoryCommitment") : instance.getProcAddr( "vkGetDeviceMemoryCommitment")); + vkGetDeviceProcAddr = PFN_vkGetDeviceProcAddr(device ? device.getProcAddr( "vkGetDeviceProcAddr") : instance.getProcAddr( "vkGetDeviceProcAddr")); + vkGetDeviceQueue = PFN_vkGetDeviceQueue(device ? device.getProcAddr( "vkGetDeviceQueue") : instance.getProcAddr( "vkGetDeviceQueue")); + vkGetDeviceQueue2 = PFN_vkGetDeviceQueue2(device ? device.getProcAddr( "vkGetDeviceQueue2") : instance.getProcAddr( "vkGetDeviceQueue2")); + vkGetDisplayModePropertiesKHR = PFN_vkGetDisplayModePropertiesKHR(device ? device.getProcAddr( "vkGetDisplayModePropertiesKHR") : instance.getProcAddr( "vkGetDisplayModePropertiesKHR")); + vkGetDisplayPlaneCapabilitiesKHR = PFN_vkGetDisplayPlaneCapabilitiesKHR(device ? device.getProcAddr( "vkGetDisplayPlaneCapabilitiesKHR") : instance.getProcAddr( "vkGetDisplayPlaneCapabilitiesKHR")); + vkGetDisplayPlaneSupportedDisplaysKHR = PFN_vkGetDisplayPlaneSupportedDisplaysKHR(device ? device.getProcAddr( "vkGetDisplayPlaneSupportedDisplaysKHR") : instance.getProcAddr( "vkGetDisplayPlaneSupportedDisplaysKHR")); + vkGetEventStatus = PFN_vkGetEventStatus(device ? device.getProcAddr( "vkGetEventStatus") : instance.getProcAddr( "vkGetEventStatus")); + vkGetFenceFdKHR = PFN_vkGetFenceFdKHR(device ? device.getProcAddr( "vkGetFenceFdKHR") : instance.getProcAddr( "vkGetFenceFdKHR")); + vkGetFenceStatus = PFN_vkGetFenceStatus(device ? device.getProcAddr( "vkGetFenceStatus") : instance.getProcAddr( "vkGetFenceStatus")); +#ifdef VK_USE_PLATFORM_WIN32_KHR + vkGetFenceWin32HandleKHR = PFN_vkGetFenceWin32HandleKHR(device ? device.getProcAddr( "vkGetFenceWin32HandleKHR") : instance.getProcAddr( "vkGetFenceWin32HandleKHR")); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + vkGetImageMemoryRequirements = PFN_vkGetImageMemoryRequirements(device ? device.getProcAddr( "vkGetImageMemoryRequirements") : instance.getProcAddr( "vkGetImageMemoryRequirements")); + vkGetImageMemoryRequirements2 = PFN_vkGetImageMemoryRequirements2(device ? device.getProcAddr( "vkGetImageMemoryRequirements2") : instance.getProcAddr( "vkGetImageMemoryRequirements2")); + vkGetImageMemoryRequirements2KHR = PFN_vkGetImageMemoryRequirements2KHR(device ? device.getProcAddr( "vkGetImageMemoryRequirements2KHR") : instance.getProcAddr( "vkGetImageMemoryRequirements2KHR")); + vkGetImageSparseMemoryRequirements = PFN_vkGetImageSparseMemoryRequirements(device ? device.getProcAddr( "vkGetImageSparseMemoryRequirements") : instance.getProcAddr( "vkGetImageSparseMemoryRequirements")); + vkGetImageSparseMemoryRequirements2 = PFN_vkGetImageSparseMemoryRequirements2(device ? device.getProcAddr( "vkGetImageSparseMemoryRequirements2") : instance.getProcAddr( "vkGetImageSparseMemoryRequirements2")); + vkGetImageSparseMemoryRequirements2KHR = PFN_vkGetImageSparseMemoryRequirements2KHR(device ? device.getProcAddr( "vkGetImageSparseMemoryRequirements2KHR") : instance.getProcAddr( "vkGetImageSparseMemoryRequirements2KHR")); + vkGetImageSubresourceLayout = PFN_vkGetImageSubresourceLayout(device ? device.getProcAddr( "vkGetImageSubresourceLayout") : instance.getProcAddr( "vkGetImageSubresourceLayout")); + vkGetInstanceProcAddr = PFN_vkGetInstanceProcAddr(instance.getProcAddr( "vkGetInstanceProcAddr")); +#ifdef VK_USE_PLATFORM_ANDROID_ANDROID + vkGetMemoryAndroidHardwareBufferANDROID = PFN_vkGetMemoryAndroidHardwareBufferANDROID(device ? device.getProcAddr( "vkGetMemoryAndroidHardwareBufferANDROID") : instance.getProcAddr( "vkGetMemoryAndroidHardwareBufferANDROID")); +#endif /*VK_USE_PLATFORM_ANDROID_ANDROID*/ + vkGetMemoryFdKHR = PFN_vkGetMemoryFdKHR(device ? device.getProcAddr( "vkGetMemoryFdKHR") : instance.getProcAddr( "vkGetMemoryFdKHR")); + vkGetMemoryFdPropertiesKHR = PFN_vkGetMemoryFdPropertiesKHR(device ? device.getProcAddr( "vkGetMemoryFdPropertiesKHR") : instance.getProcAddr( "vkGetMemoryFdPropertiesKHR")); + vkGetMemoryHostPointerPropertiesEXT = PFN_vkGetMemoryHostPointerPropertiesEXT(device ? device.getProcAddr( "vkGetMemoryHostPointerPropertiesEXT") : instance.getProcAddr( "vkGetMemoryHostPointerPropertiesEXT")); +#ifdef VK_USE_PLATFORM_WIN32_KHR + vkGetMemoryWin32HandleKHR = PFN_vkGetMemoryWin32HandleKHR(device ? device.getProcAddr( "vkGetMemoryWin32HandleKHR") : instance.getProcAddr( "vkGetMemoryWin32HandleKHR")); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ +#ifdef VK_USE_PLATFORM_WIN32_NV + vkGetMemoryWin32HandleNV = PFN_vkGetMemoryWin32HandleNV(device ? device.getProcAddr( "vkGetMemoryWin32HandleNV") : instance.getProcAddr( "vkGetMemoryWin32HandleNV")); +#endif /*VK_USE_PLATFORM_WIN32_NV*/ +#ifdef VK_USE_PLATFORM_WIN32_KHR + vkGetMemoryWin32HandlePropertiesKHR = PFN_vkGetMemoryWin32HandlePropertiesKHR(device ? device.getProcAddr( "vkGetMemoryWin32HandlePropertiesKHR") : instance.getProcAddr( "vkGetMemoryWin32HandlePropertiesKHR")); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + vkGetPastPresentationTimingGOOGLE = PFN_vkGetPastPresentationTimingGOOGLE(device ? device.getProcAddr( "vkGetPastPresentationTimingGOOGLE") : instance.getProcAddr( "vkGetPastPresentationTimingGOOGLE")); + vkGetPhysicalDeviceDisplayPlanePropertiesKHR = PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR(device ? device.getProcAddr( "vkGetPhysicalDeviceDisplayPlanePropertiesKHR") : instance.getProcAddr( "vkGetPhysicalDeviceDisplayPlanePropertiesKHR")); + vkGetPhysicalDeviceDisplayPropertiesKHR = PFN_vkGetPhysicalDeviceDisplayPropertiesKHR(device ? device.getProcAddr( "vkGetPhysicalDeviceDisplayPropertiesKHR") : instance.getProcAddr( "vkGetPhysicalDeviceDisplayPropertiesKHR")); + vkGetPhysicalDeviceExternalBufferProperties = PFN_vkGetPhysicalDeviceExternalBufferProperties(device ? device.getProcAddr( "vkGetPhysicalDeviceExternalBufferProperties") : instance.getProcAddr( "vkGetPhysicalDeviceExternalBufferProperties")); + vkGetPhysicalDeviceExternalBufferPropertiesKHR = PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR(device ? device.getProcAddr( "vkGetPhysicalDeviceExternalBufferPropertiesKHR") : instance.getProcAddr( "vkGetPhysicalDeviceExternalBufferPropertiesKHR")); + vkGetPhysicalDeviceExternalFenceProperties = PFN_vkGetPhysicalDeviceExternalFenceProperties(device ? device.getProcAddr( "vkGetPhysicalDeviceExternalFenceProperties") : instance.getProcAddr( "vkGetPhysicalDeviceExternalFenceProperties")); + vkGetPhysicalDeviceExternalFencePropertiesKHR = PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR(device ? device.getProcAddr( "vkGetPhysicalDeviceExternalFencePropertiesKHR") : instance.getProcAddr( "vkGetPhysicalDeviceExternalFencePropertiesKHR")); + vkGetPhysicalDeviceExternalImageFormatPropertiesNV = PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV(device ? device.getProcAddr( "vkGetPhysicalDeviceExternalImageFormatPropertiesNV") : instance.getProcAddr( "vkGetPhysicalDeviceExternalImageFormatPropertiesNV")); + vkGetPhysicalDeviceExternalSemaphoreProperties = PFN_vkGetPhysicalDeviceExternalSemaphoreProperties(device ? device.getProcAddr( "vkGetPhysicalDeviceExternalSemaphoreProperties") : instance.getProcAddr( "vkGetPhysicalDeviceExternalSemaphoreProperties")); + vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(device ? device.getProcAddr( "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR") : instance.getProcAddr( "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR")); + vkGetPhysicalDeviceFeatures = PFN_vkGetPhysicalDeviceFeatures(device ? device.getProcAddr( "vkGetPhysicalDeviceFeatures") : instance.getProcAddr( "vkGetPhysicalDeviceFeatures")); + vkGetPhysicalDeviceFeatures2 = PFN_vkGetPhysicalDeviceFeatures2(device ? device.getProcAddr( "vkGetPhysicalDeviceFeatures2") : instance.getProcAddr( "vkGetPhysicalDeviceFeatures2")); + vkGetPhysicalDeviceFeatures2KHR = PFN_vkGetPhysicalDeviceFeatures2KHR(device ? device.getProcAddr( "vkGetPhysicalDeviceFeatures2KHR") : instance.getProcAddr( "vkGetPhysicalDeviceFeatures2KHR")); + vkGetPhysicalDeviceFormatProperties = PFN_vkGetPhysicalDeviceFormatProperties(device ? device.getProcAddr( "vkGetPhysicalDeviceFormatProperties") : instance.getProcAddr( "vkGetPhysicalDeviceFormatProperties")); + vkGetPhysicalDeviceFormatProperties2 = PFN_vkGetPhysicalDeviceFormatProperties2(device ? device.getProcAddr( "vkGetPhysicalDeviceFormatProperties2") : instance.getProcAddr( "vkGetPhysicalDeviceFormatProperties2")); + vkGetPhysicalDeviceFormatProperties2KHR = PFN_vkGetPhysicalDeviceFormatProperties2KHR(device ? device.getProcAddr( "vkGetPhysicalDeviceFormatProperties2KHR") : instance.getProcAddr( "vkGetPhysicalDeviceFormatProperties2KHR")); + vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(device ? device.getProcAddr( "vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX") : instance.getProcAddr( "vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX")); + vkGetPhysicalDeviceImageFormatProperties = PFN_vkGetPhysicalDeviceImageFormatProperties(device ? device.getProcAddr( "vkGetPhysicalDeviceImageFormatProperties") : instance.getProcAddr( "vkGetPhysicalDeviceImageFormatProperties")); + vkGetPhysicalDeviceImageFormatProperties2 = PFN_vkGetPhysicalDeviceImageFormatProperties2(device ? device.getProcAddr( "vkGetPhysicalDeviceImageFormatProperties2") : instance.getProcAddr( "vkGetPhysicalDeviceImageFormatProperties2")); + vkGetPhysicalDeviceImageFormatProperties2KHR = PFN_vkGetPhysicalDeviceImageFormatProperties2KHR(device ? device.getProcAddr( "vkGetPhysicalDeviceImageFormatProperties2KHR") : instance.getProcAddr( "vkGetPhysicalDeviceImageFormatProperties2KHR")); + vkGetPhysicalDeviceMemoryProperties = PFN_vkGetPhysicalDeviceMemoryProperties(device ? device.getProcAddr( "vkGetPhysicalDeviceMemoryProperties") : instance.getProcAddr( "vkGetPhysicalDeviceMemoryProperties")); + vkGetPhysicalDeviceMemoryProperties2 = PFN_vkGetPhysicalDeviceMemoryProperties2(device ? device.getProcAddr( "vkGetPhysicalDeviceMemoryProperties2") : instance.getProcAddr( "vkGetPhysicalDeviceMemoryProperties2")); + vkGetPhysicalDeviceMemoryProperties2KHR = PFN_vkGetPhysicalDeviceMemoryProperties2KHR(device ? device.getProcAddr( "vkGetPhysicalDeviceMemoryProperties2KHR") : instance.getProcAddr( "vkGetPhysicalDeviceMemoryProperties2KHR")); +#ifdef VK_USE_PLATFORM_MIR_KHR + vkGetPhysicalDeviceMirPresentationSupportKHR = PFN_vkGetPhysicalDeviceMirPresentationSupportKHR(device ? device.getProcAddr( "vkGetPhysicalDeviceMirPresentationSupportKHR") : instance.getProcAddr( "vkGetPhysicalDeviceMirPresentationSupportKHR")); +#endif /*VK_USE_PLATFORM_MIR_KHR*/ + vkGetPhysicalDeviceMultisamplePropertiesEXT = PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT(device ? device.getProcAddr( "vkGetPhysicalDeviceMultisamplePropertiesEXT") : instance.getProcAddr( "vkGetPhysicalDeviceMultisamplePropertiesEXT")); + vkGetPhysicalDevicePresentRectanglesKHR = PFN_vkGetPhysicalDevicePresentRectanglesKHR(device ? device.getProcAddr( "vkGetPhysicalDevicePresentRectanglesKHR") : instance.getProcAddr( "vkGetPhysicalDevicePresentRectanglesKHR")); + vkGetPhysicalDeviceProperties = PFN_vkGetPhysicalDeviceProperties(device ? device.getProcAddr( "vkGetPhysicalDeviceProperties") : instance.getProcAddr( "vkGetPhysicalDeviceProperties")); + vkGetPhysicalDeviceProperties2 = PFN_vkGetPhysicalDeviceProperties2(device ? device.getProcAddr( "vkGetPhysicalDeviceProperties2") : instance.getProcAddr( "vkGetPhysicalDeviceProperties2")); + vkGetPhysicalDeviceProperties2KHR = PFN_vkGetPhysicalDeviceProperties2KHR(device ? device.getProcAddr( "vkGetPhysicalDeviceProperties2KHR") : instance.getProcAddr( "vkGetPhysicalDeviceProperties2KHR")); + vkGetPhysicalDeviceQueueFamilyProperties = PFN_vkGetPhysicalDeviceQueueFamilyProperties(device ? device.getProcAddr( "vkGetPhysicalDeviceQueueFamilyProperties") : instance.getProcAddr( "vkGetPhysicalDeviceQueueFamilyProperties")); + vkGetPhysicalDeviceQueueFamilyProperties2 = PFN_vkGetPhysicalDeviceQueueFamilyProperties2(device ? device.getProcAddr( "vkGetPhysicalDeviceQueueFamilyProperties2") : instance.getProcAddr( "vkGetPhysicalDeviceQueueFamilyProperties2")); + vkGetPhysicalDeviceQueueFamilyProperties2KHR = PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR(device ? device.getProcAddr( "vkGetPhysicalDeviceQueueFamilyProperties2KHR") : instance.getProcAddr( "vkGetPhysicalDeviceQueueFamilyProperties2KHR")); + vkGetPhysicalDeviceSparseImageFormatProperties = PFN_vkGetPhysicalDeviceSparseImageFormatProperties(device ? device.getProcAddr( "vkGetPhysicalDeviceSparseImageFormatProperties") : instance.getProcAddr( "vkGetPhysicalDeviceSparseImageFormatProperties")); + vkGetPhysicalDeviceSparseImageFormatProperties2 = PFN_vkGetPhysicalDeviceSparseImageFormatProperties2(device ? device.getProcAddr( "vkGetPhysicalDeviceSparseImageFormatProperties2") : instance.getProcAddr( "vkGetPhysicalDeviceSparseImageFormatProperties2")); + vkGetPhysicalDeviceSparseImageFormatProperties2KHR = PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR(device ? device.getProcAddr( "vkGetPhysicalDeviceSparseImageFormatProperties2KHR") : instance.getProcAddr( "vkGetPhysicalDeviceSparseImageFormatProperties2KHR")); + vkGetPhysicalDeviceSurfaceCapabilities2EXT = PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT(device ? device.getProcAddr( "vkGetPhysicalDeviceSurfaceCapabilities2EXT") : instance.getProcAddr( "vkGetPhysicalDeviceSurfaceCapabilities2EXT")); + vkGetPhysicalDeviceSurfaceCapabilities2KHR = PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR(device ? device.getProcAddr( "vkGetPhysicalDeviceSurfaceCapabilities2KHR") : instance.getProcAddr( "vkGetPhysicalDeviceSurfaceCapabilities2KHR")); + vkGetPhysicalDeviceSurfaceCapabilitiesKHR = PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(device ? device.getProcAddr( "vkGetPhysicalDeviceSurfaceCapabilitiesKHR") : instance.getProcAddr( "vkGetPhysicalDeviceSurfaceCapabilitiesKHR")); + vkGetPhysicalDeviceSurfaceFormats2KHR = PFN_vkGetPhysicalDeviceSurfaceFormats2KHR(device ? device.getProcAddr( "vkGetPhysicalDeviceSurfaceFormats2KHR") : instance.getProcAddr( "vkGetPhysicalDeviceSurfaceFormats2KHR")); + vkGetPhysicalDeviceSurfaceFormatsKHR = PFN_vkGetPhysicalDeviceSurfaceFormatsKHR(device ? device.getProcAddr( "vkGetPhysicalDeviceSurfaceFormatsKHR") : instance.getProcAddr( "vkGetPhysicalDeviceSurfaceFormatsKHR")); + vkGetPhysicalDeviceSurfacePresentModesKHR = PFN_vkGetPhysicalDeviceSurfacePresentModesKHR(device ? device.getProcAddr( "vkGetPhysicalDeviceSurfacePresentModesKHR") : instance.getProcAddr( "vkGetPhysicalDeviceSurfacePresentModesKHR")); + vkGetPhysicalDeviceSurfaceSupportKHR = PFN_vkGetPhysicalDeviceSurfaceSupportKHR(device ? device.getProcAddr( "vkGetPhysicalDeviceSurfaceSupportKHR") : instance.getProcAddr( "vkGetPhysicalDeviceSurfaceSupportKHR")); +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + vkGetPhysicalDeviceWaylandPresentationSupportKHR = PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR(device ? device.getProcAddr( "vkGetPhysicalDeviceWaylandPresentationSupportKHR") : instance.getProcAddr( "vkGetPhysicalDeviceWaylandPresentationSupportKHR")); +#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ +#ifdef VK_USE_PLATFORM_WIN32_KHR + vkGetPhysicalDeviceWin32PresentationSupportKHR = PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR(device ? device.getProcAddr( "vkGetPhysicalDeviceWin32PresentationSupportKHR") : instance.getProcAddr( "vkGetPhysicalDeviceWin32PresentationSupportKHR")); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ +#ifdef VK_USE_PLATFORM_XCB_KHR + vkGetPhysicalDeviceXcbPresentationSupportKHR = PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR(device ? device.getProcAddr( "vkGetPhysicalDeviceXcbPresentationSupportKHR") : instance.getProcAddr( "vkGetPhysicalDeviceXcbPresentationSupportKHR")); +#endif /*VK_USE_PLATFORM_XCB_KHR*/ +#ifdef VK_USE_PLATFORM_XLIB_KHR + vkGetPhysicalDeviceXlibPresentationSupportKHR = PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR(device ? device.getProcAddr( "vkGetPhysicalDeviceXlibPresentationSupportKHR") : instance.getProcAddr( "vkGetPhysicalDeviceXlibPresentationSupportKHR")); +#endif /*VK_USE_PLATFORM_XLIB_KHR*/ + vkGetPipelineCacheData = PFN_vkGetPipelineCacheData(device ? device.getProcAddr( "vkGetPipelineCacheData") : instance.getProcAddr( "vkGetPipelineCacheData")); + vkGetQueryPoolResults = PFN_vkGetQueryPoolResults(device ? device.getProcAddr( "vkGetQueryPoolResults") : instance.getProcAddr( "vkGetQueryPoolResults")); +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_NV + vkGetRandROutputDisplayEXT = PFN_vkGetRandROutputDisplayEXT(device ? device.getProcAddr( "vkGetRandROutputDisplayEXT") : instance.getProcAddr( "vkGetRandROutputDisplayEXT")); +#endif /*VK_USE_PLATFORM_XLIB_XRANDR_NV*/ + vkGetRefreshCycleDurationGOOGLE = PFN_vkGetRefreshCycleDurationGOOGLE(device ? device.getProcAddr( "vkGetRefreshCycleDurationGOOGLE") : instance.getProcAddr( "vkGetRefreshCycleDurationGOOGLE")); + vkGetRenderAreaGranularity = PFN_vkGetRenderAreaGranularity(device ? device.getProcAddr( "vkGetRenderAreaGranularity") : instance.getProcAddr( "vkGetRenderAreaGranularity")); + vkGetSemaphoreFdKHR = PFN_vkGetSemaphoreFdKHR(device ? device.getProcAddr( "vkGetSemaphoreFdKHR") : instance.getProcAddr( "vkGetSemaphoreFdKHR")); +#ifdef VK_USE_PLATFORM_WIN32_KHR + vkGetSemaphoreWin32HandleKHR = PFN_vkGetSemaphoreWin32HandleKHR(device ? device.getProcAddr( "vkGetSemaphoreWin32HandleKHR") : instance.getProcAddr( "vkGetSemaphoreWin32HandleKHR")); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + vkGetShaderInfoAMD = PFN_vkGetShaderInfoAMD(device ? device.getProcAddr( "vkGetShaderInfoAMD") : instance.getProcAddr( "vkGetShaderInfoAMD")); + vkGetSwapchainCounterEXT = PFN_vkGetSwapchainCounterEXT(device ? device.getProcAddr( "vkGetSwapchainCounterEXT") : instance.getProcAddr( "vkGetSwapchainCounterEXT")); + vkGetSwapchainImagesKHR = PFN_vkGetSwapchainImagesKHR(device ? device.getProcAddr( "vkGetSwapchainImagesKHR") : instance.getProcAddr( "vkGetSwapchainImagesKHR")); + vkGetSwapchainStatusKHR = PFN_vkGetSwapchainStatusKHR(device ? device.getProcAddr( "vkGetSwapchainStatusKHR") : instance.getProcAddr( "vkGetSwapchainStatusKHR")); + vkGetValidationCacheDataEXT = PFN_vkGetValidationCacheDataEXT(device ? device.getProcAddr( "vkGetValidationCacheDataEXT") : instance.getProcAddr( "vkGetValidationCacheDataEXT")); + vkImportFenceFdKHR = PFN_vkImportFenceFdKHR(device ? device.getProcAddr( "vkImportFenceFdKHR") : instance.getProcAddr( "vkImportFenceFdKHR")); +#ifdef VK_USE_PLATFORM_WIN32_KHR + vkImportFenceWin32HandleKHR = PFN_vkImportFenceWin32HandleKHR(device ? device.getProcAddr( "vkImportFenceWin32HandleKHR") : instance.getProcAddr( "vkImportFenceWin32HandleKHR")); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + vkImportSemaphoreFdKHR = PFN_vkImportSemaphoreFdKHR(device ? device.getProcAddr( "vkImportSemaphoreFdKHR") : instance.getProcAddr( "vkImportSemaphoreFdKHR")); +#ifdef VK_USE_PLATFORM_WIN32_KHR + vkImportSemaphoreWin32HandleKHR = PFN_vkImportSemaphoreWin32HandleKHR(device ? device.getProcAddr( "vkImportSemaphoreWin32HandleKHR") : instance.getProcAddr( "vkImportSemaphoreWin32HandleKHR")); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + vkInvalidateMappedMemoryRanges = PFN_vkInvalidateMappedMemoryRanges(device ? device.getProcAddr( "vkInvalidateMappedMemoryRanges") : instance.getProcAddr( "vkInvalidateMappedMemoryRanges")); + vkMapMemory = PFN_vkMapMemory(device ? device.getProcAddr( "vkMapMemory") : instance.getProcAddr( "vkMapMemory")); + vkMergePipelineCaches = PFN_vkMergePipelineCaches(device ? device.getProcAddr( "vkMergePipelineCaches") : instance.getProcAddr( "vkMergePipelineCaches")); + vkMergeValidationCachesEXT = PFN_vkMergeValidationCachesEXT(device ? device.getProcAddr( "vkMergeValidationCachesEXT") : instance.getProcAddr( "vkMergeValidationCachesEXT")); + vkQueueBeginDebugUtilsLabelEXT = PFN_vkQueueBeginDebugUtilsLabelEXT(device ? device.getProcAddr( "vkQueueBeginDebugUtilsLabelEXT") : instance.getProcAddr( "vkQueueBeginDebugUtilsLabelEXT")); + vkQueueBindSparse = PFN_vkQueueBindSparse(device ? device.getProcAddr( "vkQueueBindSparse") : instance.getProcAddr( "vkQueueBindSparse")); + vkQueueEndDebugUtilsLabelEXT = PFN_vkQueueEndDebugUtilsLabelEXT(device ? device.getProcAddr( "vkQueueEndDebugUtilsLabelEXT") : instance.getProcAddr( "vkQueueEndDebugUtilsLabelEXT")); + vkQueueInsertDebugUtilsLabelEXT = PFN_vkQueueInsertDebugUtilsLabelEXT(device ? device.getProcAddr( "vkQueueInsertDebugUtilsLabelEXT") : instance.getProcAddr( "vkQueueInsertDebugUtilsLabelEXT")); + vkQueuePresentKHR = PFN_vkQueuePresentKHR(device ? device.getProcAddr( "vkQueuePresentKHR") : instance.getProcAddr( "vkQueuePresentKHR")); + vkQueueSubmit = PFN_vkQueueSubmit(device ? device.getProcAddr( "vkQueueSubmit") : instance.getProcAddr( "vkQueueSubmit")); + vkQueueWaitIdle = PFN_vkQueueWaitIdle(device ? device.getProcAddr( "vkQueueWaitIdle") : instance.getProcAddr( "vkQueueWaitIdle")); + vkRegisterDeviceEventEXT = PFN_vkRegisterDeviceEventEXT(device ? device.getProcAddr( "vkRegisterDeviceEventEXT") : instance.getProcAddr( "vkRegisterDeviceEventEXT")); + vkRegisterDisplayEventEXT = PFN_vkRegisterDisplayEventEXT(device ? device.getProcAddr( "vkRegisterDisplayEventEXT") : instance.getProcAddr( "vkRegisterDisplayEventEXT")); + vkRegisterObjectsNVX = PFN_vkRegisterObjectsNVX(device ? device.getProcAddr( "vkRegisterObjectsNVX") : instance.getProcAddr( "vkRegisterObjectsNVX")); + vkReleaseDisplayEXT = PFN_vkReleaseDisplayEXT(device ? device.getProcAddr( "vkReleaseDisplayEXT") : instance.getProcAddr( "vkReleaseDisplayEXT")); + vkResetCommandBuffer = PFN_vkResetCommandBuffer(device ? device.getProcAddr( "vkResetCommandBuffer") : instance.getProcAddr( "vkResetCommandBuffer")); + vkResetCommandPool = PFN_vkResetCommandPool(device ? device.getProcAddr( "vkResetCommandPool") : instance.getProcAddr( "vkResetCommandPool")); + vkResetDescriptorPool = PFN_vkResetDescriptorPool(device ? device.getProcAddr( "vkResetDescriptorPool") : instance.getProcAddr( "vkResetDescriptorPool")); + vkResetEvent = PFN_vkResetEvent(device ? device.getProcAddr( "vkResetEvent") : instance.getProcAddr( "vkResetEvent")); + vkResetFences = PFN_vkResetFences(device ? device.getProcAddr( "vkResetFences") : instance.getProcAddr( "vkResetFences")); + vkSetDebugUtilsObjectNameEXT = PFN_vkSetDebugUtilsObjectNameEXT(device ? device.getProcAddr( "vkSetDebugUtilsObjectNameEXT") : instance.getProcAddr( "vkSetDebugUtilsObjectNameEXT")); + vkSetDebugUtilsObjectTagEXT = PFN_vkSetDebugUtilsObjectTagEXT(device ? device.getProcAddr( "vkSetDebugUtilsObjectTagEXT") : instance.getProcAddr( "vkSetDebugUtilsObjectTagEXT")); + vkSetEvent = PFN_vkSetEvent(device ? device.getProcAddr( "vkSetEvent") : instance.getProcAddr( "vkSetEvent")); + vkSetHdrMetadataEXT = PFN_vkSetHdrMetadataEXT(device ? device.getProcAddr( "vkSetHdrMetadataEXT") : instance.getProcAddr( "vkSetHdrMetadataEXT")); + vkSubmitDebugUtilsMessageEXT = PFN_vkSubmitDebugUtilsMessageEXT(instance.getProcAddr( "vkSubmitDebugUtilsMessageEXT")); + vkTrimCommandPool = PFN_vkTrimCommandPool(device ? device.getProcAddr( "vkTrimCommandPool") : instance.getProcAddr( "vkTrimCommandPool")); + vkTrimCommandPoolKHR = PFN_vkTrimCommandPoolKHR(device ? device.getProcAddr( "vkTrimCommandPoolKHR") : instance.getProcAddr( "vkTrimCommandPoolKHR")); + vkUnmapMemory = PFN_vkUnmapMemory(device ? device.getProcAddr( "vkUnmapMemory") : instance.getProcAddr( "vkUnmapMemory")); + vkUnregisterObjectsNVX = PFN_vkUnregisterObjectsNVX(device ? device.getProcAddr( "vkUnregisterObjectsNVX") : instance.getProcAddr( "vkUnregisterObjectsNVX")); + vkUpdateDescriptorSetWithTemplate = PFN_vkUpdateDescriptorSetWithTemplate(device ? device.getProcAddr( "vkUpdateDescriptorSetWithTemplate") : instance.getProcAddr( "vkUpdateDescriptorSetWithTemplate")); + vkUpdateDescriptorSetWithTemplateKHR = PFN_vkUpdateDescriptorSetWithTemplateKHR(device ? device.getProcAddr( "vkUpdateDescriptorSetWithTemplateKHR") : instance.getProcAddr( "vkUpdateDescriptorSetWithTemplateKHR")); + vkUpdateDescriptorSets = PFN_vkUpdateDescriptorSets(device ? device.getProcAddr( "vkUpdateDescriptorSets") : instance.getProcAddr( "vkUpdateDescriptorSets")); + vkWaitForFences = PFN_vkWaitForFences(device ? device.getProcAddr( "vkWaitForFences") : instance.getProcAddr( "vkWaitForFences")); + } + }; } // namespace VULKAN_HPP_NAMESPACE #endif diff -Nru vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_ios.h vulkan-1.1.73+dfsg/include/vulkan/vulkan_ios.h --- vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_ios.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/include/vulkan/vulkan_ios.h 2018-03-14 09:08:48.000000000 +0000 @@ -0,0 +1,58 @@ +#ifndef VULKAN_IOS_H_ +#define VULKAN_IOS_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_MVK_ios_surface 1 +#define VK_MVK_IOS_SURFACE_SPEC_VERSION 2 +#define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface" + +typedef VkFlags VkIOSSurfaceCreateFlagsMVK; + +typedef struct VkIOSSurfaceCreateInfoMVK { + VkStructureType sType; + const void* pNext; + VkIOSSurfaceCreateFlagsMVK flags; + const void* pView; +} VkIOSSurfaceCreateInfoMVK; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK( + VkInstance instance, + const VkIOSSurfaceCreateInfoMVK* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_macos.h vulkan-1.1.73+dfsg/include/vulkan/vulkan_macos.h --- vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_macos.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/include/vulkan/vulkan_macos.h 2018-03-14 09:08:48.000000000 +0000 @@ -0,0 +1,58 @@ +#ifndef VULKAN_MACOS_H_ +#define VULKAN_MACOS_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_MVK_macos_surface 1 +#define VK_MVK_MACOS_SURFACE_SPEC_VERSION 2 +#define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface" + +typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; + +typedef struct VkMacOSSurfaceCreateInfoMVK { + VkStructureType sType; + const void* pNext; + VkMacOSSurfaceCreateFlagsMVK flags; + const void* pView; +} VkMacOSSurfaceCreateInfoMVK; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateMacOSSurfaceMVK)(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK( + VkInstance instance, + const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_mir.h vulkan-1.1.73+dfsg/include/vulkan/vulkan_mir.h --- vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_mir.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/include/vulkan/vulkan_mir.h 2018-03-14 09:08:48.000000000 +0000 @@ -0,0 +1,65 @@ +#ifndef VULKAN_MIR_H_ +#define VULKAN_MIR_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_KHR_mir_surface 1 +#define VK_KHR_MIR_SURFACE_SPEC_VERSION 4 +#define VK_KHR_MIR_SURFACE_EXTENSION_NAME "VK_KHR_mir_surface" + +typedef VkFlags VkMirSurfaceCreateFlagsKHR; + +typedef struct VkMirSurfaceCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkMirSurfaceCreateFlagsKHR flags; + MirConnection* connection; + MirSurface* mirSurface; +} VkMirSurfaceCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateMirSurfaceKHR)(VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); +typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, MirConnection* connection); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR( + VkInstance instance, + const VkMirSurfaceCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); + +VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceMirPresentationSupportKHR( + VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + MirConnection* connection); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_vi.h vulkan-1.1.73+dfsg/include/vulkan/vulkan_vi.h --- vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_vi.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/include/vulkan/vulkan_vi.h 2018-03-14 09:08:48.000000000 +0000 @@ -0,0 +1,58 @@ +#ifndef VULKAN_VI_H_ +#define VULKAN_VI_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_NN_vi_surface 1 +#define VK_NN_VI_SURFACE_SPEC_VERSION 1 +#define VK_NN_VI_SURFACE_EXTENSION_NAME "VK_NN_vi_surface" + +typedef VkFlags VkViSurfaceCreateFlagsNN; + +typedef struct VkViSurfaceCreateInfoNN { + VkStructureType sType; + const void* pNext; + VkViSurfaceCreateFlagsNN flags; + void* window; +} VkViSurfaceCreateInfoNN; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateViSurfaceNN)(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateViSurfaceNN( + VkInstance instance, + const VkViSurfaceCreateInfoNN* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_wayland.h vulkan-1.1.73+dfsg/include/vulkan/vulkan_wayland.h --- vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_wayland.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/include/vulkan/vulkan_wayland.h 2018-03-14 09:08:48.000000000 +0000 @@ -0,0 +1,65 @@ +#ifndef VULKAN_WAYLAND_H_ +#define VULKAN_WAYLAND_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_KHR_wayland_surface 1 +#define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 6 +#define VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "VK_KHR_wayland_surface" + +typedef VkFlags VkWaylandSurfaceCreateFlagsKHR; + +typedef struct VkWaylandSurfaceCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkWaylandSurfaceCreateFlagsKHR flags; + struct wl_display* display; + struct wl_surface* surface; +} VkWaylandSurfaceCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateWaylandSurfaceKHR)(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); +typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR( + VkInstance instance, + const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); + +VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWaylandPresentationSupportKHR( + VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + struct wl_display* display); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_win32.h vulkan-1.1.73+dfsg/include/vulkan/vulkan_win32.h --- vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_win32.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/include/vulkan/vulkan_win32.h 2018-03-14 09:08:48.000000000 +0000 @@ -0,0 +1,276 @@ +#ifndef VULKAN_WIN32_H_ +#define VULKAN_WIN32_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_KHR_win32_surface 1 +#define VK_KHR_WIN32_SURFACE_SPEC_VERSION 6 +#define VK_KHR_WIN32_SURFACE_EXTENSION_NAME "VK_KHR_win32_surface" + +typedef VkFlags VkWin32SurfaceCreateFlagsKHR; + +typedef struct VkWin32SurfaceCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkWin32SurfaceCreateFlagsKHR flags; + HINSTANCE hinstance; + HWND hwnd; +} VkWin32SurfaceCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateWin32SurfaceKHR)(VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); +typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateWin32SurfaceKHR( + VkInstance instance, + const VkWin32SurfaceCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); + +VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR( + VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex); +#endif + +#define VK_KHR_external_memory_win32 1 +#define VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1 +#define VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_KHR_external_memory_win32" + +typedef struct VkImportMemoryWin32HandleInfoKHR { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBits handleType; + HANDLE handle; + LPCWSTR name; +} VkImportMemoryWin32HandleInfoKHR; + +typedef struct VkExportMemoryWin32HandleInfoKHR { + VkStructureType sType; + const void* pNext; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; + LPCWSTR name; +} VkExportMemoryWin32HandleInfoKHR; + +typedef struct VkMemoryWin32HandlePropertiesKHR { + VkStructureType sType; + void* pNext; + uint32_t memoryTypeBits; +} VkMemoryWin32HandlePropertiesKHR; + +typedef struct VkMemoryGetWin32HandleInfoKHR { + VkStructureType sType; + const void* pNext; + VkDeviceMemory memory; + VkExternalMemoryHandleTypeFlagBits handleType; +} VkMemoryGetWin32HandleInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleKHR)(VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle); +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandlePropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleKHR( + VkDevice device, + const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, + HANDLE* pHandle); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR( + VkDevice device, + VkExternalMemoryHandleTypeFlagBits handleType, + HANDLE handle, + VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties); +#endif + +#define VK_KHR_win32_keyed_mutex 1 +#define VK_KHR_WIN32_KEYED_MUTEX_SPEC_VERSION 1 +#define VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_KHR_win32_keyed_mutex" + +typedef struct VkWin32KeyedMutexAcquireReleaseInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t acquireCount; + const VkDeviceMemory* pAcquireSyncs; + const uint64_t* pAcquireKeys; + const uint32_t* pAcquireTimeouts; + uint32_t releaseCount; + const VkDeviceMemory* pReleaseSyncs; + const uint64_t* pReleaseKeys; +} VkWin32KeyedMutexAcquireReleaseInfoKHR; + + + +#define VK_KHR_external_semaphore_win32 1 +#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION 1 +#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME "VK_KHR_external_semaphore_win32" + +typedef struct VkImportSemaphoreWin32HandleInfoKHR { + VkStructureType sType; + const void* pNext; + VkSemaphore semaphore; + VkSemaphoreImportFlags flags; + VkExternalSemaphoreHandleTypeFlagBits handleType; + HANDLE handle; + LPCWSTR name; +} VkImportSemaphoreWin32HandleInfoKHR; + +typedef struct VkExportSemaphoreWin32HandleInfoKHR { + VkStructureType sType; + const void* pNext; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; + LPCWSTR name; +} VkExportSemaphoreWin32HandleInfoKHR; + +typedef struct VkD3D12FenceSubmitInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t waitSemaphoreValuesCount; + const uint64_t* pWaitSemaphoreValues; + uint32_t signalSemaphoreValuesCount; + const uint64_t* pSignalSemaphoreValues; +} VkD3D12FenceSubmitInfoKHR; + +typedef struct VkSemaphoreGetWin32HandleInfoKHR { + VkStructureType sType; + const void* pNext; + VkSemaphore semaphore; + VkExternalSemaphoreHandleTypeFlagBits handleType; +} VkSemaphoreGetWin32HandleInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreWin32HandleKHR)(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo); +typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreWin32HandleKHR)(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreWin32HandleKHR( + VkDevice device, + const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHR( + VkDevice device, + const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, + HANDLE* pHandle); +#endif + +#define VK_KHR_external_fence_win32 1 +#define VK_KHR_EXTERNAL_FENCE_WIN32_SPEC_VERSION 1 +#define VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME "VK_KHR_external_fence_win32" + +typedef struct VkImportFenceWin32HandleInfoKHR { + VkStructureType sType; + const void* pNext; + VkFence fence; + VkFenceImportFlags flags; + VkExternalFenceHandleTypeFlagBits handleType; + HANDLE handle; + LPCWSTR name; +} VkImportFenceWin32HandleInfoKHR; + +typedef struct VkExportFenceWin32HandleInfoKHR { + VkStructureType sType; + const void* pNext; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; + LPCWSTR name; +} VkExportFenceWin32HandleInfoKHR; + +typedef struct VkFenceGetWin32HandleInfoKHR { + VkStructureType sType; + const void* pNext; + VkFence fence; + VkExternalFenceHandleTypeFlagBits handleType; +} VkFenceGetWin32HandleInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkImportFenceWin32HandleKHR)(VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo); +typedef VkResult (VKAPI_PTR *PFN_vkGetFenceWin32HandleKHR)(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkImportFenceWin32HandleKHR( + VkDevice device, + const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceWin32HandleKHR( + VkDevice device, + const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, + HANDLE* pHandle); +#endif + +#define VK_NV_external_memory_win32 1 +#define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1 +#define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32" + +typedef struct VkImportMemoryWin32HandleInfoNV { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagsNV handleType; + HANDLE handle; +} VkImportMemoryWin32HandleInfoNV; + +typedef struct VkExportMemoryWin32HandleInfoNV { + VkStructureType sType; + const void* pNext; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; +} VkExportMemoryWin32HandleInfoNV; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleNV)(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV( + VkDevice device, + VkDeviceMemory memory, + VkExternalMemoryHandleTypeFlagsNV handleType, + HANDLE* pHandle); +#endif + +#define VK_NV_win32_keyed_mutex 1 +#define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1 +#define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex" + +typedef struct VkWin32KeyedMutexAcquireReleaseInfoNV { + VkStructureType sType; + const void* pNext; + uint32_t acquireCount; + const VkDeviceMemory* pAcquireSyncs; + const uint64_t* pAcquireKeys; + const uint32_t* pAcquireTimeoutMilliseconds; + uint32_t releaseCount; + const VkDeviceMemory* pReleaseSyncs; + const uint64_t* pReleaseKeys; +} VkWin32KeyedMutexAcquireReleaseInfoNV; + + + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_xcb.h vulkan-1.1.73+dfsg/include/vulkan/vulkan_xcb.h --- vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_xcb.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/include/vulkan/vulkan_xcb.h 2018-03-14 09:08:48.000000000 +0000 @@ -0,0 +1,66 @@ +#ifndef VULKAN_XCB_H_ +#define VULKAN_XCB_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_KHR_xcb_surface 1 +#define VK_KHR_XCB_SURFACE_SPEC_VERSION 6 +#define VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface" + +typedef VkFlags VkXcbSurfaceCreateFlagsKHR; + +typedef struct VkXcbSurfaceCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkXcbSurfaceCreateFlagsKHR flags; + xcb_connection_t* connection; + xcb_window_t window; +} VkXcbSurfaceCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateXcbSurfaceKHR)(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); +typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR( + VkInstance instance, + const VkXcbSurfaceCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); + +VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXcbPresentationSupportKHR( + VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + xcb_connection_t* connection, + xcb_visualid_t visual_id); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_xlib.h vulkan-1.1.73+dfsg/include/vulkan/vulkan_xlib.h --- vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_xlib.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/include/vulkan/vulkan_xlib.h 2018-03-14 09:08:48.000000000 +0000 @@ -0,0 +1,66 @@ +#ifndef VULKAN_XLIB_H_ +#define VULKAN_XLIB_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_KHR_xlib_surface 1 +#define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6 +#define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface" + +typedef VkFlags VkXlibSurfaceCreateFlagsKHR; + +typedef struct VkXlibSurfaceCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkXlibSurfaceCreateFlagsKHR flags; + Display* dpy; + Window window; +} VkXlibSurfaceCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateXlibSurfaceKHR)(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); +typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR( + VkInstance instance, + const VkXlibSurfaceCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); + +VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR( + VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + Display* dpy, + VisualID visualID); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_xlib_xrandr.h vulkan-1.1.73+dfsg/include/vulkan/vulkan_xlib_xrandr.h --- vulkan-1.0.65.2+dfsg1/include/vulkan/vulkan_xlib_xrandr.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/include/vulkan/vulkan_xlib_xrandr.h 2018-03-14 09:08:48.000000000 +0000 @@ -0,0 +1,54 @@ +#ifndef VULKAN_XLIB_XRANDR_H_ +#define VULKAN_XLIB_XRANDR_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_EXT_acquire_xlib_display 1 +#define VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION 1 +#define VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_xlib_display" + +typedef VkResult (VKAPI_PTR *PFN_vkAcquireXlibDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display); +typedef VkResult (VKAPI_PTR *PFN_vkGetRandROutputDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkAcquireXlibDisplayEXT( + VkPhysicalDevice physicalDevice, + Display* dpy, + VkDisplayKHR display); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetRandROutputDisplayEXT( + VkPhysicalDevice physicalDevice, + Display* dpy, + RROutput rrOutput, + VkDisplayKHR* pDisplay); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru vulkan-1.0.65.2+dfsg1/layers/buffer_validation.cpp vulkan-1.1.73+dfsg/layers/buffer_validation.cpp --- vulkan-1.0.65.2+dfsg1/layers/buffer_validation.cpp 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/buffer_validation.cpp 2018-04-27 11:24:19.000000000 +0000 @@ -22,7 +22,6 @@ // Allow use of STL min and max functions in Windows #define NOMINMAX -#include #include #include @@ -30,25 +29,14 @@ #include "vk_layer_data.h" #include "vk_layer_utils.h" #include "vk_layer_logging.h" +#include "vk_typemap_helper.h" #include "buffer_validation.h" -// TODO: remove on NDK update (r15 will probably have proper STL impl) -#ifdef __ANDROID__ -namespace std { - -template -std::string to_string(T var) { - std::ostringstream ss; - ss << var; - return ss.str(); -} -} // namespace std -#endif - void SetLayout(layer_data *device_data, GLOBAL_CB_NODE *pCB, ImageSubresourcePair imgpair, const VkImageLayout &layout) { - if (pCB->imageLayoutMap.find(imgpair) != pCB->imageLayoutMap.end()) { - pCB->imageLayoutMap[imgpair].layout = layout; + auto it = pCB->imageLayoutMap.find(imgpair); + if (it != pCB->imageLayoutMap.end()) { + it->second.layout = layout; } else { assert(imgpair.hasSubresource); IMAGE_CMD_BUF_LAYOUT_NODE node; @@ -65,6 +53,11 @@ SetLayout(device_data, pObject, imgpair, layout, VK_IMAGE_ASPECT_DEPTH_BIT); SetLayout(device_data, pObject, imgpair, layout, VK_IMAGE_ASPECT_STENCIL_BIT); SetLayout(device_data, pObject, imgpair, layout, VK_IMAGE_ASPECT_METADATA_BIT); + if (GetDeviceExtensions(device_data)->vk_khr_sampler_ycbcr_conversion) { + SetLayout(device_data, pObject, imgpair, layout, VK_IMAGE_ASPECT_PLANE_0_BIT_KHR); + SetLayout(device_data, pObject, imgpair, layout, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR); + SetLayout(device_data, pObject, imgpair, layout, VK_IMAGE_ASPECT_PLANE_2_BIT_KHR); + } } template @@ -79,7 +72,12 @@ // Set the layout in supplied map void SetLayout(std::unordered_map &imageLayoutMap, ImageSubresourcePair imgpair, VkImageLayout layout) { - imageLayoutMap[imgpair].layout = layout; + auto it = imageLayoutMap.find(imgpair); + if (it != imageLayoutMap.end()) { + it->second.layout = layout; // Update + } else { + imageLayoutMap[imgpair].layout = layout; // Insert + } } bool FindLayoutVerifyNode(layer_data const *device_data, GLOBAL_CB_NODE const *pCB, ImageSubresourcePair imgpair, @@ -97,14 +95,14 @@ } if (node.layout != VK_IMAGE_LAYOUT_MAX_ENUM && node.layout != imgsubIt->second.layout) { log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, HandleToUint64(imgpair.image), - __LINE__, DRAWSTATE_INVALID_LAYOUT, "DS", + DRAWSTATE_INVALID_LAYOUT, "Cannot query for VkImage 0x%" PRIx64 " layout when combined aspect mask %d has multiple layout types: %s and %s", HandleToUint64(imgpair.image), oldAspectMask, string_VkImageLayout(node.layout), string_VkImageLayout(imgsubIt->second.layout)); } if (node.initialLayout != VK_IMAGE_LAYOUT_MAX_ENUM && node.initialLayout != imgsubIt->second.initialLayout) { log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, HandleToUint64(imgpair.image), - __LINE__, DRAWSTATE_INVALID_LAYOUT, "DS", + DRAWSTATE_INVALID_LAYOUT, "Cannot query for VkImage 0x%" PRIx64 " layout when combined aspect mask %d has multiple initial layout types: %s and %s", HandleToUint64(imgpair.image), oldAspectMask, string_VkImageLayout(node.initialLayout), @@ -128,7 +126,7 @@ } if (layout != VK_IMAGE_LAYOUT_MAX_ENUM && layout != imgsubIt->second.layout) { log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, HandleToUint64(imgpair.image), - __LINE__, DRAWSTATE_INVALID_LAYOUT, "DS", + DRAWSTATE_INVALID_LAYOUT, "Cannot query for VkImage 0x%" PRIx64 " layout when combined aspect mask %d has multiple layout types: %s and %s", HandleToUint64(imgpair.image), oldAspectMask, string_VkImageLayout(layout), string_VkImageLayout(imgsubIt->second.layout)); @@ -146,6 +144,11 @@ FindLayoutVerifyNode(device_data, pCB, imgpair, node, VK_IMAGE_ASPECT_DEPTH_BIT); FindLayoutVerifyNode(device_data, pCB, imgpair, node, VK_IMAGE_ASPECT_STENCIL_BIT); FindLayoutVerifyNode(device_data, pCB, imgpair, node, VK_IMAGE_ASPECT_METADATA_BIT); + if (GetDeviceExtensions(device_data)->vk_khr_sampler_ycbcr_conversion) { + FindLayoutVerifyNode(device_data, pCB, imgpair, node, VK_IMAGE_ASPECT_PLANE_0_BIT_KHR); + FindLayoutVerifyNode(device_data, pCB, imgpair, node, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR); + FindLayoutVerifyNode(device_data, pCB, imgpair, node, VK_IMAGE_ASPECT_PLANE_2_BIT_KHR); + } if (node.layout == VK_IMAGE_LAYOUT_MAX_ENUM) { imgpair = {image, false, VkImageSubresource()}; auto imgsubIt = pCB->imageLayoutMap.find(imgpair); @@ -163,6 +166,11 @@ FindLayoutVerifyLayout(device_data, imgpair, layout, VK_IMAGE_ASPECT_DEPTH_BIT); FindLayoutVerifyLayout(device_data, imgpair, layout, VK_IMAGE_ASPECT_STENCIL_BIT); FindLayoutVerifyLayout(device_data, imgpair, layout, VK_IMAGE_ASPECT_METADATA_BIT); + if (GetDeviceExtensions(device_data)->vk_khr_sampler_ycbcr_conversion) { + FindLayoutVerifyLayout(device_data, imgpair, layout, VK_IMAGE_ASPECT_PLANE_0_BIT_KHR); + FindLayoutVerifyLayout(device_data, imgpair, layout, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR); + FindLayoutVerifyLayout(device_data, imgpair, layout, VK_IMAGE_ASPECT_PLANE_2_BIT_KHR); + } if (layout == VK_IMAGE_LAYOUT_MAX_ENUM) { imgpair = {imgpair.image, false, VkImageSubresource()}; auto imgsubIt = (*core_validation::GetImageLayoutMap(device_data)).find(imgpair); @@ -206,13 +214,19 @@ } // find layout in supplied map -bool FindLayout(const std::unordered_map &imageLayoutMap, ImageSubresourcePair imgpair, - VkImageLayout &layout) { +bool FindLayout(layer_data *device_data, const std::unordered_map &imageLayoutMap, + ImageSubresourcePair imgpair, VkImageLayout &layout) { layout = VK_IMAGE_LAYOUT_MAX_ENUM; FindLayout(imageLayoutMap, imgpair, layout, VK_IMAGE_ASPECT_COLOR_BIT); FindLayout(imageLayoutMap, imgpair, layout, VK_IMAGE_ASPECT_DEPTH_BIT); FindLayout(imageLayoutMap, imgpair, layout, VK_IMAGE_ASPECT_STENCIL_BIT); FindLayout(imageLayoutMap, imgpair, layout, VK_IMAGE_ASPECT_METADATA_BIT); + if (GetDeviceExtensions(device_data)->vk_khr_sampler_ycbcr_conversion) { + FindLayout(imageLayoutMap, imgpair, layout, VK_IMAGE_ASPECT_PLANE_0_BIT_KHR); + FindLayout(imageLayoutMap, imgpair, layout, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR); + FindLayout(imageLayoutMap, imgpair, layout, VK_IMAGE_ASPECT_PLANE_2_BIT_KHR); + } + // Image+subresource not found, look for image handle w/o subresource if (layout == VK_IMAGE_LAYOUT_MAX_ENUM) { imgpair = {imgpair.image, false, VkImageSubresource()}; auto imgsubIt = imageLayoutMap.find(imgpair); @@ -225,7 +239,13 @@ // Set the layout on the global level void SetGlobalLayout(layer_data *device_data, ImageSubresourcePair imgpair, const VkImageLayout &layout) { VkImage &image = imgpair.image; - (*core_validation::GetImageLayoutMap(device_data))[imgpair].layout = layout; + auto &lmap = (*core_validation::GetImageLayoutMap(device_data)); + auto data = lmap.find(imgpair); + if (data != lmap.end()) { + data->second.layout = layout; // Update + } else { + lmap[imgpair].layout = layout; // Insert + } auto &image_subresources = (*core_validation::GetImageSubresourceMap(device_data))[image]; auto subresource = std::find(image_subresources.begin(), image_subresources.end(), imgpair); if (subresource == image_subresources.end()) { @@ -235,12 +255,18 @@ // Set the layout on the cmdbuf level void SetLayout(layer_data *device_data, GLOBAL_CB_NODE *pCB, ImageSubresourcePair imgpair, const IMAGE_CMD_BUF_LAYOUT_NODE &node) { - pCB->imageLayoutMap[imgpair] = node; + auto it = pCB->imageLayoutMap.find(imgpair); + if (it != pCB->imageLayoutMap.end()) { + it->second = node; // Update + } else { + pCB->imageLayoutMap[imgpair] = node; // Insert + } } // Set image layout for given VkImageSubresourceRange struct void SetImageLayout(layer_data *device_data, GLOBAL_CB_NODE *cb_node, const IMAGE_STATE *image_state, VkImageSubresourceRange image_subresource_range, const VkImageLayout &layout) { assert(image_state); + cb_node->image_layout_change_count++; // Change the version of this data to force revalidation for (uint32_t level_index = 0; level_index < image_subresource_range.levelCount; ++level_index) { uint32_t level = image_subresource_range.baseMipLevel + level_index; for (uint32_t layer_index = 0; layer_index < image_subresource_range.layerCount; layer_index++) { @@ -287,9 +313,8 @@ const auto report_data = core_validation::GetReportData(device_data); if (pRenderPassInfo->attachmentCount != framebufferInfo.attachmentCount) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pCB->commandBuffer), __LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS", - "You cannot start a render pass using a framebuffer " - "with a different number of attachments."); + HandleToUint64(pCB->commandBuffer), DRAWSTATE_INVALID_RENDERPASS, + "You cannot start a render pass using a framebuffer with a different number of attachments."); } for (uint32_t i = 0; i < pRenderPassInfo->attachmentCount; ++i) { const VkImageView &image_view = framebufferInfo.pAttachments[i]; @@ -311,12 +336,10 @@ } if (initial_layout != VK_IMAGE_LAYOUT_UNDEFINED && initial_layout != node.layout) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS", - "You cannot start a render pass using attachment %u " - "where the render pass initial layout is %s and the previous " - "known layout of the attachment is %s. The layouts must match, or " - "the render pass initial layout for the attachment must be " - "VK_IMAGE_LAYOUT_UNDEFINED", + DRAWSTATE_INVALID_RENDERPASS, + "You cannot start a render pass using attachment %u where the render pass initial layout is %s " + "and the previous known layout of the attachment is %s. The layouts must match, or the render " + "pass initial layout for the attachment must be VK_IMAGE_LAYOUT_UNDEFINED", i, string_VkImageLayout(initial_layout), string_VkImageLayout(node.layout)); } } @@ -365,12 +388,12 @@ if (mem_barrier->oldLayout == VK_IMAGE_LAYOUT_UNDEFINED) { // TODO: Set memory invalid which is in mem_tracker currently } else if (node.layout != mem_barrier->oldLayout) { - skip |= + skip = log_msg(core_validation::GetReportData(device_data), VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(pCB->commandBuffer), __LINE__, - DRAWSTATE_INVALID_IMAGE_LAYOUT, "DS", - "For image 0x%" PRIxLEAST64 " you cannot transition the layout of aspect %d from %s when current layout is %s.", - HandleToUint64(mem_barrier->image), aspect, string_VkImageLayout(mem_barrier->oldLayout), + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(pCB->commandBuffer), VALIDATION_ERROR_0a00095a, + "For image 0x%" PRIx64 + " you cannot transition the layout of aspect=%d level=%d layer=%d from %s when current layout is %s.", + HandleToUint64(mem_barrier->image), aspect, level, layer, string_VkImageLayout(mem_barrier->oldLayout), string_VkImageLayout(node.layout)); } return skip; @@ -399,6 +422,7 @@ VkImageSubresource sub = {aspect, level, layer}; IMAGE_CMD_BUF_LAYOUT_NODE node; if (!FindCmdBufLayout(device_data, pCB, mem_barrier->image, sub, node)) { + pCB->image_layout_change_count++; // Change the version of this data to force revalidation SetLayout(device_data, pCB, mem_barrier->image, sub, IMAGE_CMD_BUF_LAYOUT_NODE(mem_barrier->oldLayout, mem_barrier->newLayout)); return; @@ -411,7 +435,7 @@ bool VerifyAspectsPresent(VkImageAspectFlags aspect_mask, VkFormat format) { if ((aspect_mask & VK_IMAGE_ASPECT_COLOR_BIT) != 0) { - if (!FormatIsColor(format)) return false; + if (!(FormatIsColor(format) || FormatIsMultiplane(format))) return false; } if ((aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT) != 0) { if (!FormatHasDepth(format)) return false; @@ -419,6 +443,10 @@ if ((aspect_mask & VK_IMAGE_ASPECT_STENCIL_BIT) != 0) { if (!FormatHasStencil(format)) return false; } + if (0 != + (aspect_mask & (VK_IMAGE_ASPECT_PLANE_0_BIT_KHR | VK_IMAGE_ASPECT_PLANE_1_BIT_KHR | VK_IMAGE_ASPECT_PLANE_2_BIT_KHR))) { + if (FormatPlaneCount(format) == 1) return false; + } return true; } @@ -467,12 +495,11 @@ } if (msg_code != VALIDATION_ERROR_UNDEFINED) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(img_barrier->image), __LINE__, msg_code, "DS", - "%s: Image barrier 0x%p %sLayout=%s is not compatible with image 0x%" PRIx64 " usage flags 0x%" PRIx32 ". %s", - func_name, img_barrier, ((new_not_old) ? "new" : "old"), string_VkImageLayout(layout), - HandleToUint64(img_barrier->image), usage_flags, validation_error_map[msg_code]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(img_barrier->image), msg_code, + "%s: Image barrier 0x%p %sLayout=%s is not compatible with image 0x%" PRIx64 " usage flags 0x%" PRIx32 ".", + func_name, static_cast(img_barrier), ((new_not_old) ? "new" : "old"), + string_VkImageLayout(layout), HandleToUint64(img_barrier->image), usage_flags); } return skip; } @@ -497,10 +524,10 @@ // TODO: Add unique id for error when available skip |= log_msg( core_validation::GetReportData(device_data), VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 0, "DS", - "Attempting to transition shared presentable image 0x%" PRIxLEAST64 + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, 0, + "Attempting to transition shared presentable image 0x%" PRIx64 " from layout %s to layout %s, but image has already been presented and cannot have its layout transitioned.", - reinterpret_cast(img_barrier->image), string_VkImageLayout(img_barrier->oldLayout), + HandleToUint64(img_barrier->image), string_VkImageLayout(img_barrier->oldLayout), string_VkImageLayout(img_barrier->newLayout)); } } @@ -513,13 +540,11 @@ if ((aspect_mask & ds_mask) != (ds_mask)) { skip |= log_msg(core_validation::GetReportData(device_data), VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, HandleToUint64(img_barrier->image), __LINE__, - VALIDATION_ERROR_0a00096e, "DS", + VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, HandleToUint64(img_barrier->image), VALIDATION_ERROR_0a00096e, "%s: Image barrier 0x%p references image 0x%" PRIx64 - " of format %s that must have the depth and stencil aspects set, but its " - "aspectMask is 0x%" PRIx32 ". %s", - func_name, img_barrier, HandleToUint64(img_barrier->image), string_VkFormat(image_create_info->format), - aspect_mask, validation_error_map[VALIDATION_ERROR_0a00096e]); + " of format %s that must have the depth and stencil aspects set, but its aspectMask is 0x%" PRIx32 ".", + func_name, static_cast(img_barrier), HandleToUint64(img_barrier->image), + string_VkFormat(image_create_info->format), aspect_mask); } } uint32_t level_count = ResolveRemainingLevels(&img_barrier->subresourceRange, image_create_info->mipLevels); @@ -533,32 +558,69 @@ skip |= ValidateImageAspectLayout(device_data, cb_state, img_barrier, level, layer, VK_IMAGE_ASPECT_DEPTH_BIT); skip |= ValidateImageAspectLayout(device_data, cb_state, img_barrier, level, layer, VK_IMAGE_ASPECT_STENCIL_BIT); skip |= ValidateImageAspectLayout(device_data, cb_state, img_barrier, level, layer, VK_IMAGE_ASPECT_METADATA_BIT); + if (GetDeviceExtensions(device_data)->vk_khr_sampler_ycbcr_conversion) { + skip |= ValidateImageAspectLayout(device_data, cb_state, img_barrier, level, layer, + VK_IMAGE_ASPECT_PLANE_0_BIT_KHR); + skip |= ValidateImageAspectLayout(device_data, cb_state, img_barrier, level, layer, + VK_IMAGE_ASPECT_PLANE_1_BIT_KHR); + skip |= ValidateImageAspectLayout(device_data, cb_state, img_barrier, level, layer, + VK_IMAGE_ASPECT_PLANE_2_BIT_KHR); + } } } } return skip; } -void TransitionImageLayouts(layer_data *device_data, VkCommandBuffer cmdBuffer, uint32_t memBarrierCount, - const VkImageMemoryBarrier *pImgMemBarriers) { - GLOBAL_CB_NODE *pCB = GetCBNode(device_data, cmdBuffer); +static bool IsReleaseOp(layer_data *device_data, GLOBAL_CB_NODE *cb_state, VkImageMemoryBarrier const *barrier) { + if (!IsTransferOp(barrier)) return false; + auto pool = GetCommandPoolNode(device_data, cb_state->createInfo.commandPool); + return pool && IsReleaseOp(pool, barrier); +} + +void TransitionImageLayouts(layer_data *device_data, GLOBAL_CB_NODE *cb_state, uint32_t memBarrierCount, + const VkImageMemoryBarrier *pImgMemBarriers) { for (uint32_t i = 0; i < memBarrierCount; ++i) { auto mem_barrier = &pImgMemBarriers[i]; if (!mem_barrier) continue; + // For ownership transfers, the barrier is specified twice; as a release + // operation on the yielding queue family, and as an acquire operation + // on the acquiring queue family. This barrier may also include a layout + // transition, which occurs 'between' the two operations. For validation + // purposes it doesn't seem important which side performs the layout + // transition, but it must not be performed twice. We'll arbitrarily + // choose to perform it as part of the acquire operation. + if (IsReleaseOp(device_data, cb_state, mem_barrier)) { + continue; + } + VkImageCreateInfo *image_create_info = &(GetImageState(device_data, mem_barrier->image)->createInfo); uint32_t level_count = ResolveRemainingLevels(&mem_barrier->subresourceRange, image_create_info->mipLevels); uint32_t layer_count = ResolveRemainingLayers(&mem_barrier->subresourceRange, image_create_info->arrayLayers); + // Special case for 3D images with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR flag bit, where and + // can potentially alias. When recording layout for the entire image, pre-emptively record layouts + // for all (potential) layer sub_resources. + if ((0 != (image_create_info->flags & VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR)) && + (mem_barrier->subresourceRange.baseArrayLayer == 0) && (layer_count == 1)) { + layer_count = image_create_info->extent.depth; // Treat each depth slice as a layer subresource + } + for (uint32_t j = 0; j < level_count; j++) { uint32_t level = mem_barrier->subresourceRange.baseMipLevel + j; for (uint32_t k = 0; k < layer_count; k++) { uint32_t layer = mem_barrier->subresourceRange.baseArrayLayer + k; - TransitionImageAspectLayout(device_data, pCB, mem_barrier, level, layer, VK_IMAGE_ASPECT_COLOR_BIT); - TransitionImageAspectLayout(device_data, pCB, mem_barrier, level, layer, VK_IMAGE_ASPECT_DEPTH_BIT); - TransitionImageAspectLayout(device_data, pCB, mem_barrier, level, layer, VK_IMAGE_ASPECT_STENCIL_BIT); - TransitionImageAspectLayout(device_data, pCB, mem_barrier, level, layer, VK_IMAGE_ASPECT_METADATA_BIT); + TransitionImageAspectLayout(device_data, cb_state, mem_barrier, level, layer, VK_IMAGE_ASPECT_COLOR_BIT); + TransitionImageAspectLayout(device_data, cb_state, mem_barrier, level, layer, VK_IMAGE_ASPECT_DEPTH_BIT); + TransitionImageAspectLayout(device_data, cb_state, mem_barrier, level, layer, VK_IMAGE_ASPECT_STENCIL_BIT); + TransitionImageAspectLayout(device_data, cb_state, mem_barrier, level, layer, VK_IMAGE_ASPECT_METADATA_BIT); + if (GetDeviceExtensions(device_data)->vk_khr_sampler_ycbcr_conversion) { + TransitionImageAspectLayout(device_data, cb_state, mem_barrier, level, layer, VK_IMAGE_ASPECT_PLANE_0_BIT_KHR); + TransitionImageAspectLayout(device_data, cb_state, mem_barrier, level, layer, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR); + TransitionImageAspectLayout(device_data, cb_state, mem_barrier, level, layer, VK_IMAGE_ASPECT_PLANE_2_BIT_KHR); + } } } } @@ -579,12 +641,11 @@ if (node.layout != explicit_layout) { *error = true; // TODO: Improve log message in the next pass - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_INVALID_IMAGE_LAYOUT, "DS", - "%s: Cannot use image 0x%" PRIxLEAST64 - " with specific layout %s that doesn't match the actual current layout %s.", - caller, HandleToUint64(image), string_VkImageLayout(explicit_layout), - string_VkImageLayout(node.layout)); + skip |= log_msg( + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_INVALID_IMAGE_LAYOUT, + "%s: Cannot use image 0x%" PRIx64 " with specific layout %s that doesn't match the actual current layout %s.", + caller, HandleToUint64(image), string_VkImageLayout(explicit_layout), string_VkImageLayout(node.layout)); } } } @@ -594,28 +655,27 @@ if (image_state->createInfo.tiling != VK_IMAGE_TILING_LINEAR) { // LAYOUT_GENERAL is allowed, but may not be performance optimal, flag as perf warning. skip |= log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(cb_node->commandBuffer), __LINE__, - DRAWSTATE_INVALID_IMAGE_LAYOUT, "DS", - "%s: For optimal performance image 0x%" PRIxLEAST64 " layout should be %s instead of GENERAL.", - caller, HandleToUint64(image), string_VkImageLayout(optimal_layout)); + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(cb_node->commandBuffer), + DRAWSTATE_INVALID_IMAGE_LAYOUT, + "%s: For optimal performance image 0x%" PRIx64 " layout should be %s instead of GENERAL.", caller, + HandleToUint64(image), string_VkImageLayout(optimal_layout)); } } else if (GetDeviceExtensions(device_data)->vk_khr_shared_presentable_image) { if (image_state->shared_presentable) { if (VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR != explicit_layout) { // TODO: Add unique error id when available. - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, msg_code, "DS", - "Layout for shared presentable image is %s but must be VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR.", - string_VkImageLayout(optimal_layout)); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, msg_code, + "Layout for shared presentable image is %s but must be VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR.", + string_VkImageLayout(optimal_layout)); } } } else { *error = true; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, msg_code, "DS", - "%s: Layout for image 0x%" PRIxLEAST64 " is %s but can only be %s or VK_IMAGE_LAYOUT_GENERAL. %s", - caller, HandleToUint64(image), string_VkImageLayout(explicit_layout), - string_VkImageLayout(optimal_layout), validation_error_map[msg_code]); + HandleToUint64(cb_node->commandBuffer), msg_code, + "%s: Layout for image 0x%" PRIx64 " is %s but can only be %s or VK_IMAGE_LAYOUT_GENERAL.", caller, + HandleToUint64(image), string_VkImageLayout(explicit_layout), string_VkImageLayout(optimal_layout)); } } return skip; @@ -641,168 +701,139 @@ const debug_report_data *report_data = core_validation::GetReportData(device_data); if (pCreateInfo->format == VK_FORMAT_UNDEFINED) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e0075e, "IMAGE", "vkCreateImage: VkFormat for image must not be VK_FORMAT_UNDEFINED. %s", - validation_error_map[VALIDATION_ERROR_09e0075e]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e0075e, "vkCreateImage: VkFormat for image must not be VK_FORMAT_UNDEFINED."); return skip; } - VkFormatProperties properties = GetFormatProperties(device_data, pCreateInfo->format); + const char *format_string = string_VkFormat(pCreateInfo->format); - if ((pCreateInfo->tiling == VK_IMAGE_TILING_LINEAR) && (properties.linearTilingFeatures == 0)) { + if ((pCreateInfo->flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) && (VK_IMAGE_TYPE_2D != pCreateInfo->imageType)) { std::stringstream ss; - ss << "vkCreateImage format parameter (" << string_VkFormat(pCreateInfo->format) << ") is an unsupported format"; - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e007a2, "IMAGE", "%s. %s", ss.str().c_str(), - validation_error_map[VALIDATION_ERROR_09e007a2]); + ss << "vkCreateImage: Image type must be VK_IMAGE_TYPE_2D when VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT flag bit is set"; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e0076a, "%s.", ss.str().c_str()); + } + const VkPhysicalDeviceLimits *device_limits = &(GetPhysicalDeviceProperties(device_data)->limits); + VkImageFormatProperties format_limits; // Format limits may exceed general device limits + VkResult err = GetImageFormatProperties(device_data, pCreateInfo, &format_limits); + if (VK_SUCCESS != err) { + std::stringstream ss; + ss << "vkCreateImage: The combination of format, type, tiling, usage and flags supplied in the VkImageCreateInfo struct is " + "reported by vkGetPhysicalDeviceImageFormatProperties() as unsupported"; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e00758, "%s.", ss.str().c_str()); return skip; } - if ((pCreateInfo->tiling == VK_IMAGE_TILING_OPTIMAL) && (properties.optimalTilingFeatures == 0)) { + if ((VK_IMAGE_TYPE_1D == pCreateInfo->imageType) && + (pCreateInfo->extent.width > std::max(device_limits->maxImageDimension1D, format_limits.maxExtent.width))) { std::stringstream ss; - ss << "vkCreateImage format parameter (" << string_VkFormat(pCreateInfo->format) << ") is an unsupported format"; - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e007ac, "IMAGE", "%s. %s", ss.str().c_str(), - validation_error_map[VALIDATION_ERROR_09e007ac]); - - return skip; + ss << "vkCreateImage: 1D image width exceeds maximum supported width for format " << format_string; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e0076e, "%s.", ss.str().c_str()); } - // TODO: Add checks for EXTENDED_USAGE images to validate images are compatible - // For EXTENDED_USAGE images, format can match any image COMPATIBLE with original image - if (!GetDeviceExtensions(device_data)->vk_khr_maintenance2 || !(pCreateInfo->flags & VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR)) { - // Validate that format supports usage as color attachment - if (pCreateInfo->usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { - if ((pCreateInfo->tiling == VK_IMAGE_TILING_OPTIMAL) && - ((properties.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) == 0)) { + if (VK_IMAGE_TYPE_2D == pCreateInfo->imageType) { + if (0 == (pCreateInfo->flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT)) { + if (pCreateInfo->extent.width > std::max(device_limits->maxImageDimension2D, format_limits.maxExtent.width) || + pCreateInfo->extent.height > std::max(device_limits->maxImageDimension2D, format_limits.maxExtent.height)) { std::stringstream ss; - ss << "vkCreateImage: VkFormat for TILING_OPTIMAL image (" << string_VkFormat(pCreateInfo->format) - << ") does not support requested Image usage type VK_IMAGE_USAGE_COLOR_ATTACHMENT"; - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e007b2, "IMAGE", "%s. %s", ss.str().c_str(), - validation_error_map[VALIDATION_ERROR_09e007b2]); + ss << "vkCreateImage: 2D image extent exceeds maximum supported width or height for format " << format_string; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e00770, "%s.", ss.str().c_str()); } - if ((pCreateInfo->tiling == VK_IMAGE_TILING_LINEAR) && - ((properties.linearTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) == 0)) { + } else { + if (pCreateInfo->extent.width > std::max(device_limits->maxImageDimensionCube, format_limits.maxExtent.width) || + pCreateInfo->extent.height > std::max(device_limits->maxImageDimensionCube, format_limits.maxExtent.height)) { std::stringstream ss; - ss << "vkCreateImage: VkFormat for TILING_LINEAR image (" << string_VkFormat(pCreateInfo->format) - << ") does not support requested Image usage type VK_IMAGE_USAGE_COLOR_ATTACHMENT"; - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e007a8, "IMAGE", "%s. %s", ss.str().c_str(), - validation_error_map[VALIDATION_ERROR_09e007a8]); + ss << "vkCreateImage: 2D image extent exceeds maximum supported width or height for cube-compatible images with " + "format " + << format_string; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e00772, "%s.", ss.str().c_str()); } } + } - // Validate that format supports usage as depth/stencil attachment - if (pCreateInfo->usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { - if ((pCreateInfo->tiling == VK_IMAGE_TILING_OPTIMAL) && - ((properties.optimalTilingFeatures & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) == 0)) { - std::stringstream ss; - ss << "vkCreateImage: VkFormat for TILING_OPTIMAL image (" << string_VkFormat(pCreateInfo->format) - << ") does not support requested Image usage type VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT"; - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e007b4, "IMAGE", "%s. %s", ss.str().c_str(), - validation_error_map[VALIDATION_ERROR_09e007b4]); - } - if ((pCreateInfo->tiling == VK_IMAGE_TILING_LINEAR) && - ((properties.linearTilingFeatures & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) == 0)) { - std::stringstream ss; - ss << "vkCreateImage: VkFormat for TILING_LINEAR image (" << string_VkFormat(pCreateInfo->format) - << ") does not support requested Image usage type VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT"; - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e007aa, "IMAGE", "%s. %s", ss.str().c_str(), - validation_error_map[VALIDATION_ERROR_09e007aa]); - } + if (VK_IMAGE_TYPE_3D == pCreateInfo->imageType) { + if ((pCreateInfo->extent.width > std::max(device_limits->maxImageDimension3D, format_limits.maxExtent.width)) || + (pCreateInfo->extent.height > std::max(device_limits->maxImageDimension3D, format_limits.maxExtent.height)) || + (pCreateInfo->extent.depth > std::max(device_limits->maxImageDimension3D, format_limits.maxExtent.depth))) { + std::stringstream ss; + ss << "vkCreateImage: 3D image extent exceeds maximum supported width, height, or depth for format " << format_string; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e00776, "%s.", ss.str().c_str()); } } - VkImageFormatProperties ImageFormatProperties = GetImageFormatProperties( - device_data, pCreateInfo->format, pCreateInfo->imageType, pCreateInfo->tiling, pCreateInfo->usage, pCreateInfo->flags); + // NOTE: As of 1/30/2018 the spec VU language is as in the commented code below. I believe this is an + // error in the spec, and have submitted Gitlab Vulkan issue #1151 to have it changed to match the + // implementation shown. DJH + // + // if ((pCreateInfo->mipLevels > format_limits.maxMipLevels) && + // (std::max({ pCreateInfo->extent.width, pCreateInfo->extent.height, pCreateInfo->extent.depth }) > + // device_limits->maxImageDimension3D)) { + if (pCreateInfo->mipLevels > format_limits.maxMipLevels) { + std::stringstream ss; + ss << "vkCreateImage: Image mip levels exceed image format maxMipLevels for format " << format_string; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e0077e, "%s.", ss.str().c_str()); + } + + VkImageUsageFlags attach_flags = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | + VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT; + if ((pCreateInfo->usage & attach_flags) && (pCreateInfo->extent.width > device_limits->maxFramebufferWidth)) { + std::stringstream ss; + ss << "vkCreateImage: Image usage flags include a frame buffer attachment bit and image width exceeds device " + "maxFramebufferWidth"; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e00788, "%s.", ss.str().c_str()); + } + + if ((pCreateInfo->usage & attach_flags) && (pCreateInfo->extent.height > device_limits->maxFramebufferHeight)) { + std::stringstream ss; + ss << "vkCreateImage: Image usage flags include a frame buffer attachment bit and image height exceeds device " + "maxFramebufferHeight"; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e0078a, "%s.", ss.str().c_str()); + } + + uint64_t total_size = (uint64_t)pCreateInfo->extent.width * (uint64_t)pCreateInfo->extent.height * + (uint64_t)pCreateInfo->extent.depth * (uint64_t)pCreateInfo->arrayLayers * + (uint64_t)pCreateInfo->samples * (uint64_t)FormatSize(pCreateInfo->format); + // Round up to imageGranularity boundary VkDeviceSize imageGranularity = GetPhysicalDeviceProperties(device_data)->limits.bufferImageGranularity; - imageGranularity = imageGranularity == 1 ? 0 : imageGranularity; - // TODO : This is also covering 2918 & 2919. Break out into separate checks - if ((pCreateInfo->extent.width <= 0) || (pCreateInfo->extent.height <= 0) || (pCreateInfo->extent.depth <= 0)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, 0, __LINE__, - VALIDATION_ERROR_09e007b8, "Image", - "CreateImage extent is 0 for at least one required dimension for image: " - "Width = %d Height = %d Depth = %d. %s", - pCreateInfo->extent.width, pCreateInfo->extent.height, pCreateInfo->extent.depth, - validation_error_map[VALIDATION_ERROR_09e007b8]); - } - - // TODO: VALIDATION_ERROR_09e00770 VALIDATION_ERROR_09e00772 VALIDATION_ERROR_09e00776 VALIDATION_ERROR_09e0076e - // All these extent-related VUs should be checked here - if ((pCreateInfo->extent.depth > ImageFormatProperties.maxExtent.depth) || - (pCreateInfo->extent.width > ImageFormatProperties.maxExtent.width) || - (pCreateInfo->extent.height > ImageFormatProperties.maxExtent.height)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, 0, __LINE__, - IMAGE_INVALID_FORMAT_LIMITS_VIOLATION, "Image", - "CreateImage extents exceed allowable limits for format: " - "Width = %d Height = %d Depth = %d: Limits for Width = %d Height = %d Depth = %d for format %s.", - pCreateInfo->extent.width, pCreateInfo->extent.height, pCreateInfo->extent.depth, - ImageFormatProperties.maxExtent.width, ImageFormatProperties.maxExtent.height, - ImageFormatProperties.maxExtent.depth, string_VkFormat(pCreateInfo->format)); - } - - uint64_t totalSize = - ((uint64_t)pCreateInfo->extent.width * (uint64_t)pCreateInfo->extent.height * (uint64_t)pCreateInfo->extent.depth * - (uint64_t)pCreateInfo->arrayLayers * (uint64_t)pCreateInfo->samples * (uint64_t)FormatSize(pCreateInfo->format) + - (uint64_t)imageGranularity) & - ~(uint64_t)imageGranularity; - - if (totalSize > ImageFormatProperties.maxResourceSize) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, 0, __LINE__, - IMAGE_INVALID_FORMAT_LIMITS_VIOLATION, "Image", - "CreateImage resource size exceeds allowable maximum " - "Image resource size = 0x%" PRIxLEAST64 ", maximum resource size = 0x%" PRIxLEAST64 " ", - totalSize, ImageFormatProperties.maxResourceSize); - } - - // TODO: VALIDATION_ERROR_09e0077e - if (pCreateInfo->mipLevels > ImageFormatProperties.maxMipLevels) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, 0, __LINE__, - IMAGE_INVALID_FORMAT_LIMITS_VIOLATION, "Image", - "CreateImage mipLevels=%d exceeds allowable maximum supported by format of %d", pCreateInfo->mipLevels, - ImageFormatProperties.maxMipLevels); + uint64_t ig_mask = imageGranularity - 1; + total_size = (total_size + ig_mask) & ~ig_mask; + + if (total_size > format_limits.maxResourceSize) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, 0, + IMAGE_INVALID_FORMAT_LIMITS_VIOLATION, + "CreateImage resource size exceeds allowable maximum Image resource size = 0x%" PRIxLEAST64 + ", maximum resource size = 0x%" PRIxLEAST64 " ", + total_size, format_limits.maxResourceSize); } - if (pCreateInfo->arrayLayers > ImageFormatProperties.maxArrayLayers) { + if (pCreateInfo->arrayLayers > format_limits.maxArrayLayers) { skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, 0, __LINE__, - VALIDATION_ERROR_09e00780, "Image", - "CreateImage arrayLayers=%d exceeds allowable maximum supported by format of %d. %s", pCreateInfo->arrayLayers, - ImageFormatProperties.maxArrayLayers, validation_error_map[VALIDATION_ERROR_09e00780]); - } - - if ((pCreateInfo->samples & ImageFormatProperties.sampleCounts) == 0) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, 0, __LINE__, - VALIDATION_ERROR_09e0078e, "Image", "CreateImage samples %s is not supported by format 0x%.8X. %s", - string_VkSampleCountFlagBits(pCreateInfo->samples), ImageFormatProperties.sampleCounts, - validation_error_map[VALIDATION_ERROR_09e0078e]); - } - - if (pCreateInfo->initialLayout != VK_IMAGE_LAYOUT_UNDEFINED && pCreateInfo->initialLayout != VK_IMAGE_LAYOUT_PREINITIALIZED) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, 0, __LINE__, - VALIDATION_ERROR_09e0b801, "Image", - "vkCreateImage parameter, pCreateInfo->initialLayout, must be VK_IMAGE_LAYOUT_UNDEFINED or " - "VK_IMAGE_LAYOUT_PREINITIALIZED. %s", - validation_error_map[VALIDATION_ERROR_09e0b801]); - } - - if ((pCreateInfo->flags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) && (!GetEnabledFeatures(device_data)->sparseBinding)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e00792, "DS", - "vkCreateImage(): the sparseBinding device feature is disabled: Images cannot be created with the " - "VK_IMAGE_CREATE_SPARSE_BINDING_BIT set. %s", - validation_error_map[VALIDATION_ERROR_09e00792]); + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, 0, VALIDATION_ERROR_09e00780, + "CreateImage arrayLayers=%d exceeds allowable maximum supported by format of %d.", pCreateInfo->arrayLayers, + format_limits.maxArrayLayers); + } + + if ((pCreateInfo->samples & format_limits.sampleCounts) == 0) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, 0, + VALIDATION_ERROR_09e0078e, "CreateImage samples %s is not supported by format 0x%.8X.", + string_VkSampleCountFlagBits(pCreateInfo->samples), format_limits.sampleCounts); } if ((pCreateInfo->flags & VK_IMAGE_CREATE_SPARSE_ALIASED_BIT) && (!GetEnabledFeatures(device_data)->sparseResidencyAliased)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - DRAWSTATE_INVALID_FEATURE, "DS", + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + DRAWSTATE_INVALID_FEATURE, "vkCreateImage(): the sparseResidencyAliased device feature is disabled: Images cannot be created with the " "VK_IMAGE_CREATE_SPARSE_ALIASED_BIT set."); } @@ -813,8 +844,8 @@ FormatIsCompressed_ETC2_EAC(pCreateInfo->format))) { // TODO: Add Maintenance2 VUID skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_UNDEFINED, "DS", + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_UNDEFINED, "vkCreateImage(): If pCreateInfo->flags contains VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR, " "format must be block, ETC or ASTC compressed, but is %s", string_VkFormat(pCreateInfo->format)); @@ -822,8 +853,8 @@ if (!(pCreateInfo->flags & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT)) { // TODO: Add Maintenance2 VUID skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_UNDEFINED, "DS", + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_UNDEFINED, "vkCreateImage(): If pCreateInfo->flags contains VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR, " "flags must also contain VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT."); } @@ -887,26 +918,23 @@ if (range.aspectMask != VK_IMAGE_ASPECT_COLOR_BIT) { char const str[] = "vkCmdClearColorImage aspectMasks for all subresource ranges must be set to VK_IMAGE_ASPECT_COLOR_BIT"; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, DRAWSTATE_INVALID_IMAGE_ASPECT, "IMAGE", str); + HandleToUint64(image_state->image), DRAWSTATE_INVALID_IMAGE_ASPECT, str); } if (FormatIsDepthOrStencil(image_state->createInfo.format)) { char const str[] = "vkCmdClearColorImage called with depth/stencil image."; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_1880000e, "IMAGE", "%s. %s", str, - validation_error_map[VALIDATION_ERROR_1880000e]); + HandleToUint64(image_state->image), VALIDATION_ERROR_1880000e, "%s.", str); } else if (FormatIsCompressed(image_state->createInfo.format)) { char const str[] = "vkCmdClearColorImage called with compressed image."; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_1880000e, "IMAGE", "%s. %s", str, - validation_error_map[VALIDATION_ERROR_1880000e]); + HandleToUint64(image_state->image), VALIDATION_ERROR_1880000e, "%s.", str); } if (!(image_state->createInfo.usage & VK_IMAGE_USAGE_TRANSFER_DST_BIT)) { char const str[] = "vkCmdClearColorImage called with image created without VK_IMAGE_USAGE_TRANSFER_DST_BIT."; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_18800004, "IMAGE", "%s. %s", str, - validation_error_map[VALIDATION_ERROR_18800004]); + HandleToUint64(image_state->image), VALIDATION_ERROR_18800004, "%s.", str); } return skip; } @@ -942,14 +970,14 @@ if (image_state->createInfo.tiling != VK_IMAGE_TILING_LINEAR) { // LAYOUT_GENERAL is allowed, but may not be performance optimal, flag as perf warning. skip |= log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, DRAWSTATE_INVALID_IMAGE_LAYOUT, "DS", + HandleToUint64(image_state->image), DRAWSTATE_INVALID_IMAGE_LAYOUT, "%s: Layout for cleared image should be TRANSFER_DST_OPTIMAL instead of GENERAL.", func_name); } } else if (VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR == dest_image_layout) { if (!GetDeviceExtensions(device_data)->vk_khr_shared_presentable_image) { // TODO: Add unique error id when available. skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, 0, "DS", + HandleToUint64(image_state->image), 0, "Must enable VK_KHR_shared_presentable_image extension before creating images with a layout type " "of VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR."); @@ -957,7 +985,7 @@ if (image_state->shared_presentable) { skip |= log_msg( report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, 0, "DS", + HandleToUint64(image_state->image), 0, "Layout for shared presentable cleared image is %s but can only be VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR.", string_VkImageLayout(dest_image_layout)); } @@ -970,10 +998,9 @@ assert(strcmp(func_name, "vkCmdClearColorImage()") == 0); } skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, error_code, "DS", - "%s: Layout for cleared image is %s but can only be " - "TRANSFER_DST_OPTIMAL or GENERAL. %s", - func_name, string_VkImageLayout(dest_image_layout), validation_error_map[error_code]); + HandleToUint64(image_state->image), error_code, + "%s: Layout for cleared image is %s but can only be TRANSFER_DST_OPTIMAL or GENERAL.", func_name, + string_VkImageLayout(dest_image_layout)); } } @@ -991,12 +1018,10 @@ } else { assert(strcmp(func_name, "vkCmdClearColorImage()") == 0); } - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, 0, - __LINE__, error_code, "DS", - "%s: Cannot clear an image whose layout is %s and " - "doesn't match the current layout %s. %s", - func_name, string_VkImageLayout(dest_image_layout), string_VkImageLayout(node.layout), - validation_error_map[error_code]); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, 0, + error_code, "%s: Cannot clear an image whose layout is %s and doesn't match the current layout %s.", + func_name, string_VkImageLayout(dest_image_layout), string_VkImageLayout(node.layout)); } } } @@ -1088,17 +1113,34 @@ if (((pRanges[i].aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT) != VK_IMAGE_ASPECT_DEPTH_BIT) && ((pRanges[i].aspectMask & VK_IMAGE_ASPECT_STENCIL_BIT) != VK_IMAGE_ASPECT_STENCIL_BIT)) { char const str[] = - "vkCmdClearDepthStencilImage aspectMasks for all subresource ranges must be " - "set to VK_IMAGE_ASPECT_DEPTH_BIT and/or VK_IMAGE_ASPECT_STENCIL_BIT"; + "vkCmdClearDepthStencilImage aspectMasks for all subresource ranges must be set to VK_IMAGE_ASPECT_DEPTH_BIT " + "and/or VK_IMAGE_ASPECT_STENCIL_BIT"; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, DRAWSTATE_INVALID_IMAGE_ASPECT, "IMAGE", str); + HandleToUint64(commandBuffer), DRAWSTATE_INVALID_IMAGE_ASPECT, str); } } if (image_state && !FormatIsDepthOrStencil(image_state->createInfo.format)) { char const str[] = "vkCmdClearDepthStencilImage called without a depth/stencil image."; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image), __LINE__, VALIDATION_ERROR_18a0001c, "IMAGE", "%s. %s", str, - validation_error_map[VALIDATION_ERROR_18a0001c]); + HandleToUint64(image), VALIDATION_ERROR_18a0001c, "%s.", str); + } + if (VK_IMAGE_USAGE_TRANSFER_DST_BIT != (VK_IMAGE_USAGE_TRANSFER_DST_BIT & image_state->createInfo.usage)) { + char const str[] = + "vkCmdClearDepthStencilImage() called with an image that was not created with the VK_IMAGE_USAGE_TRANSFER_DST_BIT " + "set."; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(image), VALIDATION_ERROR_18a00012, "%s.", str); + } + VkFormatProperties props = GetFormatProperties(device_data, image_state->createInfo.format); + VkImageTiling tiling = image_state->createInfo.tiling; + VkFormatFeatureFlags flags = (tiling == VK_IMAGE_TILING_LINEAR ? props.linearTilingFeatures : props.optimalTilingFeatures); + if ((GetDeviceExtensions(device_data)->vk_khr_maintenance1) && + (VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR != (flags & VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR))) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(image), VALIDATION_ERROR_18a00010, + "vkCmdClearDepthStencilImage() called with an image of format %s and tiling %s that does not support " + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR.", + string_VkFormat(image_state->createInfo.format), string_VkImageTiling(image_state->createInfo.tiling)); } } return skip; @@ -1116,22 +1158,29 @@ return result; } -// Returns true if two VkImageCopy structures overlap -static bool RegionIntersects(const VkImageCopy *src, const VkImageCopy *dst, VkImageType type) { +// Returns true if source area of first copy region intersects dest area of second region +// It is assumed that these are copy regions within a single image (otherwise no possibility of collision) +static bool RegionIntersects(const VkImageCopy *rgn0, const VkImageCopy *rgn1, VkImageType type, bool is_multiplane) { bool result = false; - if ((src->srcSubresource.mipLevel == dst->dstSubresource.mipLevel) && - (RangesIntersect(src->srcSubresource.baseArrayLayer, src->srcSubresource.layerCount, dst->dstSubresource.baseArrayLayer, - dst->dstSubresource.layerCount))) { + + // Separate planes within a multiplane image cannot intersect + if (is_multiplane && (rgn0->srcSubresource.aspectMask != rgn1->dstSubresource.aspectMask)) { + return result; + } + + if ((rgn0->srcSubresource.mipLevel == rgn1->dstSubresource.mipLevel) && + (RangesIntersect(rgn0->srcSubresource.baseArrayLayer, rgn0->srcSubresource.layerCount, rgn1->dstSubresource.baseArrayLayer, + rgn1->dstSubresource.layerCount))) { result = true; switch (type) { case VK_IMAGE_TYPE_3D: - result &= RangesIntersect(src->srcOffset.z, src->extent.depth, dst->dstOffset.z, dst->extent.depth); + result &= RangesIntersect(rgn0->srcOffset.z, rgn0->extent.depth, rgn1->dstOffset.z, rgn1->extent.depth); // Intentionally fall through to 2D case case VK_IMAGE_TYPE_2D: - result &= RangesIntersect(src->srcOffset.y, src->extent.height, dst->dstOffset.y, dst->extent.height); + result &= RangesIntersect(rgn0->srcOffset.y, rgn0->extent.height, rgn1->dstOffset.y, rgn1->extent.height); // Intentionally fall through to 1D case case VK_IMAGE_TYPE_1D: - result &= RangesIntersect(src->srcOffset.x, src->extent.width, dst->dstOffset.x, dst->extent.width); + result &= RangesIntersect(rgn0->srcOffset.x, rgn0->extent.width, rgn1->dstOffset.x, rgn1->extent.width); break; default: // Unrecognized or new IMAGE_TYPE enums will be caught in parameter_validation @@ -1173,6 +1222,24 @@ return result; } +// For image copies between compressed/uncompressed formats, the extent is provided in source image texels +// Destination image texel extents must be adjusted by block size for the dest validation checks +VkExtent3D GetAdjustedDestImageExtent(VkFormat src_format, VkFormat dst_format, VkExtent3D extent) { + VkExtent3D adjusted_extent = extent; + if ((FormatIsCompressed(src_format) && (!FormatIsCompressed(dst_format)))) { + VkExtent3D block_size = FormatCompressedTexelBlockExtent(src_format); + adjusted_extent.width /= block_size.width; + adjusted_extent.height /= block_size.height; + adjusted_extent.depth /= block_size.depth; + } else if ((!FormatIsCompressed(src_format) && (FormatIsCompressed(dst_format)))) { + VkExtent3D block_size = FormatCompressedTexelBlockExtent(dst_format); + adjusted_extent.width *= block_size.width; + adjusted_extent.height *= block_size.height; + adjusted_extent.depth *= block_size.depth; + } + return adjusted_extent; +} + // Returns the effective extent of an image subresource, adjusted for mip level and array depth. static inline VkExtent3D GetImageSubresourceExtent(const IMAGE_STATE *img, const VkImageSubresourceLayers *subresource) { const uint32_t mip = subresource->mipLevel; @@ -1246,9 +1313,9 @@ // If the queue family image transfer granularity is (0, 0, 0), then the offset must always be (0, 0, 0) if (IsExtentAllZeroes(&offset_extent) == false) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_IMAGE_TRANSFER_GRANULARITY, "DS", - "%s: pRegion[%d].%s (x=%d, y=%d, z=%d) must be (x=0, y=0, z=0) " - "when the command buffer's queue family image transfer granularity is (w=0, h=0, d=0).", + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_IMAGE_TRANSFER_GRANULARITY, + "%s: pRegion[%d].%s (x=%d, y=%d, z=%d) must be (x=0, y=0, z=0) when the command buffer's queue family " + "image transfer granularity is (w=0, h=0, d=0).", function, i, member, offset->x, offset->y, offset->z); } } else { @@ -1256,9 +1323,9 @@ // integer multiples of the image transfer granularity. if (IsExtentAligned(&offset_extent, granularity) == false) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_IMAGE_TRANSFER_GRANULARITY, "DS", - "%s: pRegion[%d].%s (x=%d, y=%d, z=%d) dimensions must be even integer " - "multiples of this command buffer's queue family image transfer granularity (w=%d, h=%d, d=%d).", + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_IMAGE_TRANSFER_GRANULARITY, + "%s: pRegion[%d].%s (x=%d, y=%d, z=%d) dimensions must be even integer multiples of this command " + "buffer's queue family image transfer granularity (w=%d, h=%d, d=%d).", function, i, member, offset->x, offset->y, offset->z, granularity->width, granularity->height, granularity->depth); } @@ -1277,7 +1344,7 @@ // subresource extent. if (IsExtentEqual(extent, subresource_extent) == false) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_IMAGE_TRANSFER_GRANULARITY, "DS", + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_IMAGE_TRANSFER_GRANULARITY, "%s: pRegion[%d].%s (w=%d, h=%d, d=%d) must match the image subresource extents (w=%d, h=%d, d=%d) " "when the command buffer's queue family image transfer granularity is (w=0, h=0, d=0).", function, i, member, extent->width, extent->height, extent->depth, subresource_extent->width, @@ -1312,53 +1379,20 @@ assert(false); } if (!(x_ok && y_ok && z_ok)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_IMAGE_TRANSFER_GRANULARITY, "DS", - "%s: pRegion[%d].%s (w=%d, h=%d, d=%d) dimensions must be even integer multiples of this command buffer's " - "queue family image transfer granularity (w=%d, h=%d, d=%d) or offset (x=%d, y=%d, z=%d) + " - "extent (w=%d, h=%d, d=%d) must match the image subresource extents (w=%d, h=%d, d=%d).", - function, i, member, extent->width, extent->height, extent->depth, granularity->width, granularity->height, - granularity->depth, offset->x, offset->y, offset->z, extent->width, extent->height, extent->depth, - subresource_extent->width, subresource_extent->height, subresource_extent->depth); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_IMAGE_TRANSFER_GRANULARITY, + "%s: pRegion[%d].%s (w=%d, h=%d, d=%d) dimensions must be even integer multiples of this command " + "buffer's queue family image transfer granularity (w=%d, h=%d, d=%d) or offset (x=%d, y=%d, z=%d) + " + "extent (w=%d, h=%d, d=%d) must match the image subresource extents (w=%d, h=%d, d=%d).", + function, i, member, extent->width, extent->height, extent->depth, granularity->width, + granularity->height, granularity->depth, offset->x, offset->y, offset->z, extent->width, extent->height, + extent->depth, subresource_extent->width, subresource_extent->height, subresource_extent->depth); } } return skip; } -// Check a uint32_t width or stride value against a queue family's Image Transfer Granularity width value -static inline bool CheckItgInt(layer_data *device_data, const GLOBAL_CB_NODE *cb_node, const uint32_t value, - const uint32_t granularity, const uint32_t i, const char *function, const char *member) { - const debug_report_data *report_data = core_validation::GetReportData(device_data); - - bool skip = false; - if (SafeModulo(value, granularity) != 0) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_IMAGE_TRANSFER_GRANULARITY, "DS", - "%s: pRegion[%d].%s (%d) must be an even integer multiple of this command buffer's queue family image " - "transfer granularity width (%d).", - function, i, member, value, granularity); - } - return skip; -} - -// Check a VkDeviceSize value against a queue family's Image Transfer Granularity width value -static inline bool CheckItgSize(layer_data *device_data, const GLOBAL_CB_NODE *cb_node, const VkDeviceSize value, - const uint32_t granularity, const uint32_t i, const char *function, const char *member) { - const debug_report_data *report_data = core_validation::GetReportData(device_data); - bool skip = false; - if (SafeModulo(value, granularity) != 0) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_IMAGE_TRANSFER_GRANULARITY, "DS", - "%s: pRegion[%d].%s (%" PRIdLEAST64 - ") must be an even integer multiple of this command buffer's queue family image transfer " - "granularity width (%d).", - function, i, member, value, granularity); - } - return skip; -} - -// Check valid usage Image Tranfer Granularity requirements for elements of a VkBufferImageCopy structure +// Check valid usage Image Transfer Granularity requirements for elements of a VkBufferImageCopy structure bool ValidateCopyBufferImageTransferGranularityRequirements(layer_data *device_data, const GLOBAL_CB_NODE *cb_node, const IMAGE_STATE *img, const VkBufferImageCopy *region, const uint32_t i, const char *function) { @@ -1378,9 +1412,6 @@ // must equal the image subresource depth } else { VkExtent3D granularity = GetScaledItg(device_data, cb_node, img); - skip |= CheckItgSize(device_data, cb_node, region->bufferOffset, granularity.width, i, function, "bufferOffset"); - skip |= CheckItgInt(device_data, cb_node, region->bufferRowLength, granularity.width, i, function, "bufferRowLength"); - skip |= CheckItgInt(device_data, cb_node, region->bufferImageHeight, granularity.width, i, function, "bufferImageHeight"); skip |= CheckItgOffset(device_data, cb_node, ®ion->imageOffset, &granularity, i, function, "imageOffset"); VkExtent3D subresource_extent = GetImageSubresourceExtent(img, ®ion->imageSubresource); skip |= CheckItgExtent(device_data, cb_node, ®ion->imageExtent, ®ion->imageOffset, &granularity, &subresource_extent, @@ -1389,7 +1420,7 @@ return skip; } -// Check valid usage Image Tranfer Granularity requirements for elements of a VkImageCopy structure +// Check valid usage Image Transfer Granularity requirements for elements of a VkImageCopy structure bool ValidateCopyImageTransferGranularityRequirements(layer_data *device_data, const GLOBAL_CB_NODE *cb_node, const IMAGE_STATE *src_img, const IMAGE_STATE *dst_img, const VkImageCopy *region, const uint32_t i, const char *function) { @@ -1398,27 +1429,18 @@ VkExtent3D granularity = GetScaledItg(device_data, cb_node, src_img); skip |= CheckItgOffset(device_data, cb_node, ®ion->srcOffset, &granularity, i, function, "srcOffset"); VkExtent3D subresource_extent = GetImageSubresourceExtent(src_img, ®ion->srcSubresource); - VkExtent3D extent = region->extent; - if (FormatIsCompressed(src_img->createInfo.format) && !FormatIsCompressed(dst_img->createInfo.format)) { - // Src is compressed and dest is uncompressed, adjust extent: - VkExtent3D block_size = FormatCompressedTexelBlockExtent(src_img->createInfo.format); - extent.width /= block_size.width; - extent.height /= block_size.height; - } + const VkExtent3D extent = region->extent; skip |= CheckItgExtent(device_data, cb_node, &extent, ®ion->srcOffset, &granularity, &subresource_extent, src_img->createInfo.imageType, i, function, "extent"); // Destination image checks granularity = GetScaledItg(device_data, cb_node, dst_img); skip |= CheckItgOffset(device_data, cb_node, ®ion->dstOffset, &granularity, i, function, "dstOffset"); + // Adjust dest extent, if necessary + const VkExtent3D dest_effective_extent = + GetAdjustedDestImageExtent(src_img->createInfo.format, dst_img->createInfo.format, extent); subresource_extent = GetImageSubresourceExtent(dst_img, ®ion->dstSubresource); - if (!FormatIsCompressed(src_img->createInfo.format) && FormatIsCompressed(dst_img->createInfo.format)) { - // Src is uncompressed and dest is compressed, adjust extent: - VkExtent3D block_size = FormatCompressedTexelBlockExtent(dst_img->createInfo.format); - extent.width *= block_size.width; - extent.height *= block_size.height; - } - skip |= CheckItgExtent(device_data, cb_node, &extent, ®ion->dstOffset, &granularity, &subresource_extent, + skip |= CheckItgExtent(device_data, cb_node, &dest_effective_extent, ®ion->dstOffset, &granularity, &subresource_extent, dst_img->createInfo.imageType, i, function, "extent"); return skip; } @@ -1429,283 +1451,324 @@ bool skip = false; for (uint32_t i = 0; i < regionCount; i++) { - VkImageCopy image_copy = ic_regions[i]; + const VkImageCopy region = ic_regions[i]; + + // For comp<->uncomp copies, the copy extent for the dest image must be adjusted + const VkExtent3D src_copy_extent = region.extent; + const VkExtent3D dst_copy_extent = + GetAdjustedDestImageExtent(src_state->createInfo.format, dst_state->createInfo.format, region.extent); + bool slice_override = false; uint32_t depth_slices = 0; // Special case for copying between a 1D/2D array and a 3D image // TBD: This seems like the only way to reconcile 3 mutually-exclusive VU checks for 2D/3D copies. Heads up. if ((VK_IMAGE_TYPE_3D == src_state->createInfo.imageType) && (VK_IMAGE_TYPE_3D != dst_state->createInfo.imageType)) { - depth_slices = image_copy.dstSubresource.layerCount; // Slice count from 2D subresource + depth_slices = region.dstSubresource.layerCount; // Slice count from 2D subresource slice_override = (depth_slices != 1); } else if ((VK_IMAGE_TYPE_3D == dst_state->createInfo.imageType) && (VK_IMAGE_TYPE_3D != src_state->createInfo.imageType)) { - depth_slices = image_copy.srcSubresource.layerCount; // Slice count from 2D subresource + depth_slices = region.srcSubresource.layerCount; // Slice count from 2D subresource slice_override = (depth_slices != 1); } // Do all checks on source image // if (src_state->createInfo.imageType == VK_IMAGE_TYPE_1D) { - if ((0 != image_copy.srcOffset.y) || (1 != image_copy.extent.height)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(src_state->image), __LINE__, VALIDATION_ERROR_09c00124, "IMAGE", - "vkCmdCopyImage(): pRegion[%d] srcOffset.y is %d and extent.height is %d. For 1D images these must " - "be 0 and 1, respectively. %s", - i, image_copy.srcOffset.y, image_copy.extent.height, validation_error_map[VALIDATION_ERROR_09c00124]); + if ((0 != region.srcOffset.y) || (1 != src_copy_extent.height)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(src_state->image), VALIDATION_ERROR_09c00124, + "vkCmdCopyImage(): pRegion[%d] srcOffset.y is %d and extent.height is %d. For 1D images these must " + "be 0 and 1, respectively.", + i, region.srcOffset.y, src_copy_extent.height); } } - if ((src_state->createInfo.imageType == VK_IMAGE_TYPE_1D) || (src_state->createInfo.imageType == VK_IMAGE_TYPE_2D)) { - if ((0 != image_copy.srcOffset.z) || (1 != image_copy.extent.depth)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(src_state->image), __LINE__, VALIDATION_ERROR_09c00128, "IMAGE", - "vkCmdCopyImage(): pRegion[%d] srcOffset.z is %d and extent.depth is %d. For 1D and 2D images " - "these must be 0 and 1, respectively. %s", - i, image_copy.srcOffset.z, image_copy.extent.depth, validation_error_map[VALIDATION_ERROR_09c00128]); - } + // VUID-VkImageCopy-srcImage-01785 + if ((src_state->createInfo.imageType == VK_IMAGE_TYPE_1D) && ((0 != region.srcOffset.z) || (1 != src_copy_extent.depth))) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(src_state->image), VALIDATION_ERROR_09c00df2, + "vkCmdCopyImage(): pRegion[%d] srcOffset.z is %d and extent.depth is %d. For 1D images " + "these must be 0 and 1, respectively.", + i, region.srcOffset.z, src_copy_extent.depth); + } + + // VUID-VkImageCopy-srcImage-01787 + if ((src_state->createInfo.imageType == VK_IMAGE_TYPE_2D) && (0 != region.srcOffset.z)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(src_state->image), VALIDATION_ERROR_09c00df6, + "vkCmdCopyImage(): pRegion[%d] srcOffset.z is %d. For 2D images the z-offset must be 0.", i, + region.srcOffset.z); } - // VU01199 changed with mnt1 if (GetDeviceExtensions(device_data)->vk_khr_maintenance1) { if (src_state->createInfo.imageType == VK_IMAGE_TYPE_3D) { - if ((0 != image_copy.srcSubresource.baseArrayLayer) || (1 != image_copy.srcSubresource.layerCount)) { + if ((0 != region.srcSubresource.baseArrayLayer) || (1 != region.srcSubresource.layerCount)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(src_state->image), __LINE__, VALIDATION_ERROR_09c0011a, "IMAGE", + HandleToUint64(src_state->image), VALIDATION_ERROR_09c0011a, "vkCmdCopyImage(): pRegion[%d] srcSubresource.baseArrayLayer is %d and srcSubresource.layerCount " - "is %d. For VK_IMAGE_TYPE_3D images these must be 0 and 1, respectively. %s", - i, image_copy.srcSubresource.baseArrayLayer, image_copy.srcSubresource.layerCount, - validation_error_map[VALIDATION_ERROR_09c0011a]); + "is %d. For VK_IMAGE_TYPE_3D images these must be 0 and 1, respectively.", + i, region.srcSubresource.baseArrayLayer, region.srcSubresource.layerCount); } } } else { // Pre maint 1 if (src_state->createInfo.imageType == VK_IMAGE_TYPE_3D || dst_state->createInfo.imageType == VK_IMAGE_TYPE_3D) { - if ((0 != image_copy.srcSubresource.baseArrayLayer) || (1 != image_copy.srcSubresource.layerCount)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(src_state->image), __LINE__, VALIDATION_ERROR_09c0011a, "IMAGE", - "vkCmdCopyImage(): pRegion[%d] srcSubresource.baseArrayLayer is %d and " - "srcSubresource.layerCount is %d. For copies with either source or dest of type " - "VK_IMAGE_TYPE_3D, these must be 0 and 1, respectively. %s", - i, image_copy.srcSubresource.baseArrayLayer, image_copy.srcSubresource.layerCount, - validation_error_map[VALIDATION_ERROR_09c0011a]); + if ((0 != region.srcSubresource.baseArrayLayer) || (1 != region.srcSubresource.layerCount)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(src_state->image), VALIDATION_ERROR_09c0011a, + "vkCmdCopyImage(): pRegion[%d] srcSubresource.baseArrayLayer is %d and " + "srcSubresource.layerCount is %d. For copies with either source or dest of type " + "VK_IMAGE_TYPE_3D, these must be 0 and 1, respectively.", + i, region.srcSubresource.baseArrayLayer, region.srcSubresource.layerCount); } } } - // TODO: this VU is redundant with VU01224. Gitlab issue 812 submitted to get it removed from the spec. - if ((image_copy.srcSubresource.baseArrayLayer >= src_state->createInfo.arrayLayers) || - (image_copy.srcSubresource.baseArrayLayer + image_copy.srcSubresource.layerCount > src_state->createInfo.arrayLayers)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(src_state->image), __LINE__, VALIDATION_ERROR_09c0012a, "IMAGE", - "vkCmdCopyImage(): pRegion[%d] srcSubresource.baseArrayLayer (%d) must be less than the source image's " - "arrayLayers (%d), and the sum of baseArrayLayer and srcSubresource.layerCount (%d) must be less than " - "or equal to the source image's arrayLayers. %s", - i, image_copy.srcSubresource.baseArrayLayer, src_state->createInfo.arrayLayers, - image_copy.srcSubresource.layerCount, validation_error_map[VALIDATION_ERROR_09c0012a]); - } - - // Checks that apply only to compressed images - if (FormatIsCompressed(src_state->createInfo.format)) { - VkExtent3D block_size = FormatCompressedTexelBlockExtent(src_state->createInfo.format); - + // Source checks that apply only to compressed images (or to _422 images if ycbcr enabled) + bool ext_ycbcr = GetDeviceExtensions(device_data)->vk_khr_sampler_ycbcr_conversion; + if (FormatIsCompressed(src_state->createInfo.format) || + (ext_ycbcr && FormatIsSinglePlane_422(src_state->createInfo.format))) { + const VkExtent3D block_size = FormatCompressedTexelBlockExtent(src_state->createInfo.format); // image offsets must be multiples of block dimensions - if ((SafeModulo(image_copy.srcOffset.x, block_size.width) != 0) || - (SafeModulo(image_copy.srcOffset.y, block_size.height) != 0) || - (SafeModulo(image_copy.srcOffset.z, block_size.depth) != 0)) { + if ((SafeModulo(region.srcOffset.x, block_size.width) != 0) || + (SafeModulo(region.srcOffset.y, block_size.height) != 0) || + (SafeModulo(region.srcOffset.z, block_size.depth) != 0)) { + UNIQUE_VALIDATION_ERROR_CODE vuid = ext_ycbcr ? VALIDATION_ERROR_09c00d7e : VALIDATION_ERROR_09c0013a; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(src_state->image), __LINE__, VALIDATION_ERROR_09c0013a, "IMAGE", + HandleToUint64(src_state->image), vuid, "vkCmdCopyImage(): pRegion[%d] srcOffset (%d, %d) must be multiples of the compressed image's " - "texel width & height (%d, %d). %s.", - i, image_copy.srcOffset.x, image_copy.srcOffset.y, block_size.width, block_size.height, - validation_error_map[VALIDATION_ERROR_09c0013a]); - } - - // Extent width must be a multiple of block width, or extent+offset width must equal subresource width - VkExtent3D adj_extent = image_copy.extent; - if (!FormatIsCompressed(dst_state->createInfo.format)) { - // Copying from compressed source. Modify extent to be extent / texel block size - adj_extent.width /= block_size.width; - adj_extent.height /= block_size.height; - } - - VkExtent3D mip_extent = GetImageSubresourceExtent(src_state, &(image_copy.srcSubresource)); - if ((SafeModulo(adj_extent.width, block_size.width) != 0) && - (adj_extent.width + image_copy.srcOffset.x != mip_extent.width)) { + "texel width & height (%d, %d).", + i, region.srcOffset.x, region.srcOffset.y, block_size.width, block_size.height); + } + + const VkExtent3D mip_extent = GetImageSubresourceExtent(src_state, &(region.srcSubresource)); + if ((SafeModulo(src_copy_extent.width, block_size.width) != 0) && + (src_copy_extent.width + region.srcOffset.x != mip_extent.width)) { + UNIQUE_VALIDATION_ERROR_CODE vuid = ext_ycbcr ? VALIDATION_ERROR_09c00d80 : VALIDATION_ERROR_09c0013c; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(src_state->image), __LINE__, VALIDATION_ERROR_09c0013c, "IMAGE", + HandleToUint64(src_state->image), vuid, "vkCmdCopyImage(): pRegion[%d] extent width (%d) must be a multiple of the compressed texture block " - "width (%d), or when added to srcOffset.x (%d) must equal the image subresource width (%d). %s.", - i, adj_extent.width, block_size.width, image_copy.srcOffset.x, mip_extent.width, - validation_error_map[VALIDATION_ERROR_09c0013c]); + "width (%d), or when added to srcOffset.x (%d) must equal the image subresource width (%d).", + i, src_copy_extent.width, block_size.width, region.srcOffset.x, mip_extent.width); } // Extent height must be a multiple of block height, or extent+offset height must equal subresource height - if ((SafeModulo(adj_extent.height, block_size.height) != 0) && - (adj_extent.height + image_copy.srcOffset.y != mip_extent.height)) { + if ((SafeModulo(src_copy_extent.height, block_size.height) != 0) && + (src_copy_extent.height + region.srcOffset.y != mip_extent.height)) { + UNIQUE_VALIDATION_ERROR_CODE vuid = ext_ycbcr ? VALIDATION_ERROR_09c00d82 : VALIDATION_ERROR_09c0013e; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(src_state->image), __LINE__, VALIDATION_ERROR_09c0013e, "IMAGE", + HandleToUint64(src_state->image), vuid, "vkCmdCopyImage(): pRegion[%d] extent height (%d) must be a multiple of the compressed texture block " - "height (%d), or when added to srcOffset.y (%d) must equal the image subresource height (%d). %s.", - i, adj_extent.height, block_size.height, image_copy.srcOffset.y, mip_extent.height, - validation_error_map[VALIDATION_ERROR_09c0013e]); + "height (%d), or when added to srcOffset.y (%d) must equal the image subresource height (%d).", + i, src_copy_extent.height, block_size.height, region.srcOffset.y, mip_extent.height); } // Extent depth must be a multiple of block depth, or extent+offset depth must equal subresource depth - uint32_t copy_depth = (slice_override ? depth_slices : image_copy.extent.depth); - if ((SafeModulo(copy_depth, block_size.depth) != 0) && (copy_depth + image_copy.srcOffset.z != mip_extent.depth)) { + uint32_t copy_depth = (slice_override ? depth_slices : src_copy_extent.depth); + if ((SafeModulo(copy_depth, block_size.depth) != 0) && (copy_depth + region.srcOffset.z != mip_extent.depth)) { + UNIQUE_VALIDATION_ERROR_CODE vuid = ext_ycbcr ? VALIDATION_ERROR_09c00d84 : VALIDATION_ERROR_09c00140; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(src_state->image), __LINE__, VALIDATION_ERROR_09c00140, "IMAGE", + HandleToUint64(src_state->image), vuid, "vkCmdCopyImage(): pRegion[%d] extent width (%d) must be a multiple of the compressed texture block " - "depth (%d), or when added to srcOffset.z (%d) must equal the image subresource depth (%d). %s.", - i, image_copy.extent.depth, block_size.depth, image_copy.srcOffset.z, mip_extent.depth, - validation_error_map[VALIDATION_ERROR_09c00140]); + "depth (%d), or when added to srcOffset.z (%d) must equal the image subresource depth (%d).", + i, src_copy_extent.depth, block_size.depth, region.srcOffset.z, mip_extent.depth); } } // Compressed // Do all checks on dest image // if (dst_state->createInfo.imageType == VK_IMAGE_TYPE_1D) { - if ((0 != image_copy.dstOffset.y) || (1 != image_copy.extent.height)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(dst_state->image), __LINE__, VALIDATION_ERROR_09c00130, "IMAGE", - "vkCmdCopyImage(): pRegion[%d] dstOffset.y is %d and extent.height is %d. For 1D images these must " - "be 0 and 1, respectively. %s", - i, image_copy.dstOffset.y, image_copy.extent.height, validation_error_map[VALIDATION_ERROR_09c00130]); + if ((0 != region.dstOffset.y) || (1 != dst_copy_extent.height)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(dst_state->image), VALIDATION_ERROR_09c00130, + "vkCmdCopyImage(): pRegion[%d] dstOffset.y is %d and dst_copy_extent.height is %d. For 1D images " + "these must be 0 and 1, respectively.", + i, region.dstOffset.y, dst_copy_extent.height); } } - if ((dst_state->createInfo.imageType == VK_IMAGE_TYPE_1D) || (dst_state->createInfo.imageType == VK_IMAGE_TYPE_2D)) { - if ((0 != image_copy.dstOffset.z) || (1 != image_copy.extent.depth)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(dst_state->image), __LINE__, VALIDATION_ERROR_09c00134, "IMAGE", - "vkCmdCopyImage(): pRegion[%d] dstOffset.z is %d and extent.depth is %d. For 1D and 2D images " - "these must be 0 and 1, respectively. %s", - i, image_copy.dstOffset.z, image_copy.extent.depth, validation_error_map[VALIDATION_ERROR_09c00134]); - } + // VUID-VkImageCopy-dstImage-01786 + if ((dst_state->createInfo.imageType == VK_IMAGE_TYPE_1D) && ((0 != region.dstOffset.z) || (1 != dst_copy_extent.depth))) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(dst_state->image), VALIDATION_ERROR_09c00df4, + "vkCmdCopyImage(): pRegion[%d] dstOffset.z is %d and extent.depth is %d. For 1D images these must be 0 " + "and 1, respectively.", + i, region.dstOffset.z, dst_copy_extent.depth); + } + + // VUID-VkImageCopy-dstImage-01788 + if ((dst_state->createInfo.imageType == VK_IMAGE_TYPE_2D) && (0 != region.dstOffset.z)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(dst_state->image), VALIDATION_ERROR_09c00df8, + "vkCmdCopyImage(): pRegion[%d] dstOffset.z is %d. For 2D images the z-offset must be 0.", i, + region.dstOffset.z); } if (dst_state->createInfo.imageType == VK_IMAGE_TYPE_3D) { - if ((0 != image_copy.dstSubresource.baseArrayLayer) || (1 != image_copy.dstSubresource.layerCount)) { + if ((0 != region.dstSubresource.baseArrayLayer) || (1 != region.dstSubresource.layerCount)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(dst_state->image), __LINE__, VALIDATION_ERROR_09c0011a, "IMAGE", + HandleToUint64(dst_state->image), VALIDATION_ERROR_09c0011a, "vkCmdCopyImage(): pRegion[%d] dstSubresource.baseArrayLayer is %d and dstSubresource.layerCount " - "is %d. For VK_IMAGE_TYPE_3D images these must be 0 and 1, respectively. %s", - i, image_copy.dstSubresource.baseArrayLayer, image_copy.dstSubresource.layerCount, - validation_error_map[VALIDATION_ERROR_09c0011a]); + "is %d. For VK_IMAGE_TYPE_3D images these must be 0 and 1, respectively.", + i, region.dstSubresource.baseArrayLayer, region.dstSubresource.layerCount); } } // VU01199 changed with mnt1 if (GetDeviceExtensions(device_data)->vk_khr_maintenance1) { if (dst_state->createInfo.imageType == VK_IMAGE_TYPE_3D) { - if ((0 != image_copy.dstSubresource.baseArrayLayer) || (1 != image_copy.dstSubresource.layerCount)) { + if ((0 != region.dstSubresource.baseArrayLayer) || (1 != region.dstSubresource.layerCount)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(dst_state->image), __LINE__, VALIDATION_ERROR_09c0011a, "IMAGE", + HandleToUint64(dst_state->image), VALIDATION_ERROR_09c0011a, "vkCmdCopyImage(): pRegion[%d] dstSubresource.baseArrayLayer is %d and dstSubresource.layerCount " - "is %d. For VK_IMAGE_TYPE_3D images these must be 0 and 1, respectively. %s", - i, image_copy.dstSubresource.baseArrayLayer, image_copy.dstSubresource.layerCount, - validation_error_map[VALIDATION_ERROR_09c0011a]); + "is %d. For VK_IMAGE_TYPE_3D images these must be 0 and 1, respectively.", + i, region.dstSubresource.baseArrayLayer, region.dstSubresource.layerCount); } } } else { // Pre maint 1 if (src_state->createInfo.imageType == VK_IMAGE_TYPE_3D || dst_state->createInfo.imageType == VK_IMAGE_TYPE_3D) { - if ((0 != image_copy.dstSubresource.baseArrayLayer) || (1 != image_copy.dstSubresource.layerCount)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(dst_state->image), __LINE__, VALIDATION_ERROR_09c0011a, "IMAGE", - "vkCmdCopyImage(): pRegion[%d] dstSubresource.baseArrayLayer is %d and " - "dstSubresource.layerCount is %d. For copies with either source or dest of type " - "VK_IMAGE_TYPE_3D, these must be 0 and 1, respectively. %s", - i, image_copy.dstSubresource.baseArrayLayer, image_copy.dstSubresource.layerCount, - validation_error_map[VALIDATION_ERROR_09c0011a]); + if ((0 != region.dstSubresource.baseArrayLayer) || (1 != region.dstSubresource.layerCount)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(dst_state->image), VALIDATION_ERROR_09c0011a, + "vkCmdCopyImage(): pRegion[%d] dstSubresource.baseArrayLayer is %d and " + "dstSubresource.layerCount is %d. For copies with either source or dest of type " + "VK_IMAGE_TYPE_3D, these must be 0 and 1, respectively.", + i, region.dstSubresource.baseArrayLayer, region.dstSubresource.layerCount); } } } - // TODO: this VU is redundant with VU01224. Gitlab issue 812 submitted to get it removed from the spec. - if ((image_copy.dstSubresource.baseArrayLayer >= dst_state->createInfo.arrayLayers) || - (image_copy.dstSubresource.baseArrayLayer + image_copy.dstSubresource.layerCount > dst_state->createInfo.arrayLayers)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(dst_state->image), __LINE__, VALIDATION_ERROR_09c00136, "IMAGE", - "vkCmdCopyImage(): pRegion[%d] dstSubresource.baseArrayLayer (%d) must be less than the dest image's " - "arrayLayers (%d), and the sum of baseArrayLayer and dstSubresource.layerCount (%d) must be less than " - "or equal to the dest image's arrayLayers. %s", - i, image_copy.dstSubresource.baseArrayLayer, dst_state->createInfo.arrayLayers, - image_copy.dstSubresource.layerCount, validation_error_map[VALIDATION_ERROR_09c00136]); - } - - // Checks that apply only to compressed images - if (FormatIsCompressed(dst_state->createInfo.format)) { - VkExtent3D block_size = FormatCompressedTexelBlockExtent(dst_state->createInfo.format); + // Dest checks that apply only to compressed images (or to _422 images if ycbcr enabled) + if (FormatIsCompressed(dst_state->createInfo.format) || + (ext_ycbcr && FormatIsSinglePlane_422(dst_state->createInfo.format))) { + const VkExtent3D block_size = FormatCompressedTexelBlockExtent(dst_state->createInfo.format); // image offsets must be multiples of block dimensions - if ((SafeModulo(image_copy.dstOffset.x, block_size.width) != 0) || - (SafeModulo(image_copy.dstOffset.y, block_size.height) != 0) || - (SafeModulo(image_copy.dstOffset.z, block_size.depth) != 0)) { + if ((SafeModulo(region.dstOffset.x, block_size.width) != 0) || + (SafeModulo(region.dstOffset.y, block_size.height) != 0) || + (SafeModulo(region.dstOffset.z, block_size.depth) != 0)) { + UNIQUE_VALIDATION_ERROR_CODE vuid = ext_ycbcr ? VALIDATION_ERROR_09c00d86 : VALIDATION_ERROR_09c00144; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(dst_state->image), __LINE__, VALIDATION_ERROR_09c00144, "IMAGE", + HandleToUint64(dst_state->image), vuid, "vkCmdCopyImage(): pRegion[%d] dstOffset (%d, %d) must be multiples of the compressed image's " - "texel width & height (%d, %d). %s.", - i, image_copy.dstOffset.x, image_copy.dstOffset.y, block_size.width, block_size.height, - validation_error_map[VALIDATION_ERROR_09c00144]); - } - - // Extent width must be a multiple of block width, or extent+offset width must equal subresource width - VkExtent3D adj_extent = image_copy.extent; - if (!FormatIsCompressed(src_state->createInfo.format)) { - // Copying from uncompressed source. Modify extent to be extent * texel block size - adj_extent.width *= block_size.width; - adj_extent.height *= block_size.height; - } - - VkExtent3D mip_extent = GetImageSubresourceExtent(dst_state, &(image_copy.dstSubresource)); - if ((SafeModulo(adj_extent.width, block_size.width) != 0) && - (adj_extent.width + image_copy.dstOffset.x != mip_extent.width)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(dst_state->image), __LINE__, VALIDATION_ERROR_09c00146, "IMAGE", - "vkCmdCopyImage(): pRegion[%d] extent width (%d) must be a multiple of the compressed texture block " - "width (%d), or when added to dstOffset.x (%d) must equal the image subresource width (%d). %s.", - i, adj_extent.width, block_size.width, image_copy.dstOffset.x, mip_extent.width, - validation_error_map[VALIDATION_ERROR_09c00146]); + "texel width & height (%d, %d).", + i, region.dstOffset.x, region.dstOffset.y, block_size.width, block_size.height); } - // Extent height must be a multiple of block height, or extent+offset height must equal subresource height - if ((SafeModulo(adj_extent.height, block_size.height) != 0) && - (adj_extent.height + image_copy.dstOffset.y != mip_extent.height)) { + const VkExtent3D mip_extent = GetImageSubresourceExtent(dst_state, &(region.dstSubresource)); + if ((SafeModulo(dst_copy_extent.width, block_size.width) != 0) && + (dst_copy_extent.width + region.dstOffset.x != mip_extent.width)) { + UNIQUE_VALIDATION_ERROR_CODE vuid = ext_ycbcr ? VALIDATION_ERROR_09c00d88 : VALIDATION_ERROR_09c00146; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(dst_state->image), __LINE__, VALIDATION_ERROR_09c00148, "IMAGE", - "vkCmdCopyImage(): pRegion[%d] extent height (%d) must be a multiple of the compressed texture block " - "height (%d), or when added to dstOffset.y (%d) must equal the image subresource height (%d). %s.", - i, adj_extent.height, block_size.height, image_copy.dstOffset.y, mip_extent.height, - validation_error_map[VALIDATION_ERROR_09c00148]); + HandleToUint64(dst_state->image), vuid, + "vkCmdCopyImage(): pRegion[%d] dst_copy_extent width (%d) must be a multiple of the compressed texture " + "block width (%d), or when added to dstOffset.x (%d) must equal the image subresource width (%d).", + i, dst_copy_extent.width, block_size.width, region.dstOffset.x, mip_extent.width); } - // Extent depth must be a multiple of block depth, or extent+offset depth must equal subresource depth - uint32_t copy_depth = (slice_override ? depth_slices : image_copy.extent.depth); - if ((SafeModulo(copy_depth, block_size.depth) != 0) && (copy_depth + image_copy.dstOffset.z != mip_extent.depth)) { + // Extent height must be a multiple of block height, or dst_copy_extent+offset height must equal subresource height + if ((SafeModulo(dst_copy_extent.height, block_size.height) != 0) && + (dst_copy_extent.height + region.dstOffset.y != mip_extent.height)) { + UNIQUE_VALIDATION_ERROR_CODE vuid = ext_ycbcr ? VALIDATION_ERROR_09c00d8a : VALIDATION_ERROR_09c00148; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(dst_state->image), vuid, + "vkCmdCopyImage(): pRegion[%d] dst_copy_extent height (%d) must be a multiple of the compressed " + "texture block height (%d), or when added to dstOffset.y (%d) must equal the image subresource " + "height (%d).", + i, dst_copy_extent.height, block_size.height, region.dstOffset.y, mip_extent.height); + } + + // Extent depth must be a multiple of block depth, or dst_copy_extent+offset depth must equal subresource depth + uint32_t copy_depth = (slice_override ? depth_slices : dst_copy_extent.depth); + if ((SafeModulo(copy_depth, block_size.depth) != 0) && (copy_depth + region.dstOffset.z != mip_extent.depth)) { + UNIQUE_VALIDATION_ERROR_CODE vuid = ext_ycbcr ? VALIDATION_ERROR_09c00d8c : VALIDATION_ERROR_09c0014a; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(dst_state->image), __LINE__, VALIDATION_ERROR_09c0014a, "IMAGE", - "vkCmdCopyImage(): pRegion[%d] extent width (%d) must be a multiple of the compressed texture block " - "depth (%d), or when added to dstOffset.z (%d) must equal the image subresource depth (%d). %s.", - i, image_copy.extent.depth, block_size.depth, image_copy.dstOffset.z, mip_extent.depth, - validation_error_map[VALIDATION_ERROR_09c0014a]); + HandleToUint64(dst_state->image), vuid, + "vkCmdCopyImage(): pRegion[%d] dst_copy_extent width (%d) must be a multiple of the compressed texture " + "block depth (%d), or when added to dstOffset.z (%d) must equal the image subresource depth (%d).", + i, dst_copy_extent.depth, block_size.depth, region.dstOffset.z, mip_extent.depth); } } // Compressed } return skip; } +// vkCmdCopyImage checks that only apply if the multiplane extension is enabled +bool CopyImageMultiplaneValidation(const layer_data *dev_data, VkCommandBuffer command_buffer, const IMAGE_STATE *src_image_state, + const IMAGE_STATE *dst_image_state, const VkImageCopy region) { + bool skip = false; + const debug_report_data *report_data = core_validation::GetReportData(dev_data); + + // Neither image is multiplane + if ((!FormatIsMultiplane(src_image_state->createInfo.format)) && (!FormatIsMultiplane(dst_image_state->createInfo.format))) { + // If neither image is multi-plane the aspectMask member of src and dst must match + if (region.srcSubresource.aspectMask != region.dstSubresource.aspectMask) { + std::stringstream ss; + ss << "vkCmdCopyImage: Copy between non-multiplane images with differing aspectMasks ( 0x" << std::hex + << region.srcSubresource.aspectMask << " and 0x" << region.dstSubresource.aspectMask << " )"; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(command_buffer), VALIDATION_ERROR_09c00c1e, "%s.", ss.str().c_str()); + } + } else { + // Source image multiplane checks + uint32_t planes = FormatPlaneCount(src_image_state->createInfo.format); + VkImageAspectFlags aspect = region.srcSubresource.aspectMask; + if ((2 == planes) && (aspect != VK_IMAGE_ASPECT_PLANE_0_BIT_KHR) && (aspect != VK_IMAGE_ASPECT_PLANE_1_BIT_KHR)) { + std::stringstream ss; + ss << "vkCmdCopyImage: Source image aspect mask (0x" << std::hex << aspect << ") is invalid for 2-plane format"; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(command_buffer), VALIDATION_ERROR_09c00c20, "%s.", ss.str().c_str()); + } + if ((3 == planes) && (aspect != VK_IMAGE_ASPECT_PLANE_0_BIT_KHR) && (aspect != VK_IMAGE_ASPECT_PLANE_1_BIT_KHR) && + (aspect != VK_IMAGE_ASPECT_PLANE_2_BIT_KHR)) { + std::stringstream ss; + ss << "vkCmdCopyImage: Source image aspect mask (0x" << std::hex << aspect << ") is invalid for 3-plane format"; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(command_buffer), VALIDATION_ERROR_09c00c22, "%s.", ss.str().c_str()); + } + // Single-plane to multi-plane + if ((!FormatIsMultiplane(src_image_state->createInfo.format)) && (FormatIsMultiplane(dst_image_state->createInfo.format)) && + (VK_IMAGE_ASPECT_COLOR_BIT != aspect)) { + std::stringstream ss; + ss << "vkCmdCopyImage: Source image aspect mask (0x" << std::hex << aspect << ") is not VK_IMAGE_ASPECT_COLOR_BIT"; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(command_buffer), VALIDATION_ERROR_09c00c2a, "%s.", ss.str().c_str()); + } + + // Dest image multiplane checks + planes = FormatPlaneCount(dst_image_state->createInfo.format); + aspect = region.dstSubresource.aspectMask; + if ((2 == planes) && (aspect != VK_IMAGE_ASPECT_PLANE_0_BIT_KHR) && (aspect != VK_IMAGE_ASPECT_PLANE_1_BIT_KHR)) { + std::stringstream ss; + ss << "vkCmdCopyImage: Dest image aspect mask (0x" << std::hex << aspect << ") is invalid for 2-plane format"; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(command_buffer), VALIDATION_ERROR_09c00c24, "%s.", ss.str().c_str()); + } + if ((3 == planes) && (aspect != VK_IMAGE_ASPECT_PLANE_0_BIT_KHR) && (aspect != VK_IMAGE_ASPECT_PLANE_1_BIT_KHR) && + (aspect != VK_IMAGE_ASPECT_PLANE_2_BIT_KHR)) { + std::stringstream ss; + ss << "vkCmdCopyImage: Dest image aspect mask (0x" << std::hex << aspect << ") is invalid for 3-plane format"; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(command_buffer), VALIDATION_ERROR_09c00c26, "%s.", ss.str().c_str()); + } + // Multi-plane to single-plane + if ((FormatIsMultiplane(src_image_state->createInfo.format)) && (!FormatIsMultiplane(dst_image_state->createInfo.format)) && + (VK_IMAGE_ASPECT_COLOR_BIT != aspect)) { + std::stringstream ss; + ss << "vkCmdCopyImage: Dest image aspect mask (0x" << std::hex << aspect << ") is not VK_IMAGE_ASPECT_COLOR_BIT"; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(command_buffer), VALIDATION_ERROR_09c00c28, "%s.", ss.str().c_str()); + } + } + + return skip; +} + bool PreCallValidateCmdCopyImage(layer_data *device_data, GLOBAL_CB_NODE *cb_node, IMAGE_STATE *src_image_state, IMAGE_STATE *dst_image_state, uint32_t region_count, const VkImageCopy *regions, VkImageLayout src_image_layout, VkImageLayout dst_image_layout) { @@ -1716,6 +1779,13 @@ VkCommandBuffer command_buffer = cb_node->commandBuffer; for (uint32_t i = 0; i < region_count; i++) { + const VkImageCopy region = regions[i]; + + // For comp/uncomp copies, the copy extent for the dest image must be adjusted + VkExtent3D src_copy_extent = region.extent; + VkExtent3D dst_copy_extent = + GetAdjustedDestImageExtent(src_image_state->createInfo.format, dst_image_state->createInfo.format, region.extent); + bool slice_override = false; uint32_t depth_slices = 0; @@ -1723,28 +1793,26 @@ // TBD: This seems like the only way to reconcile 3 mutually-exclusive VU checks for 2D/3D copies. Heads up. if ((VK_IMAGE_TYPE_3D == src_image_state->createInfo.imageType) && (VK_IMAGE_TYPE_3D != dst_image_state->createInfo.imageType)) { - depth_slices = regions[i].dstSubresource.layerCount; // Slice count from 2D subresource + depth_slices = region.dstSubresource.layerCount; // Slice count from 2D subresource slice_override = (depth_slices != 1); } else if ((VK_IMAGE_TYPE_3D == dst_image_state->createInfo.imageType) && (VK_IMAGE_TYPE_3D != src_image_state->createInfo.imageType)) { - depth_slices = regions[i].srcSubresource.layerCount; // Slice count from 2D subresource + depth_slices = region.srcSubresource.layerCount; // Slice count from 2D subresource slice_override = (depth_slices != 1); } - if (regions[i].srcSubresource.layerCount == 0) { + if (region.srcSubresource.layerCount == 0) { std::stringstream ss; ss << "vkCmdCopyImage: number of layers in pRegions[" << i << "] srcSubresource is zero"; - skip |= - log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, DRAWSTATE_INVALID_IMAGE_ASPECT, "IMAGE", "%s", ss.str().c_str()); + skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(command_buffer), DRAWSTATE_INVALID_IMAGE_ASPECT, "%s", ss.str().c_str()); } - if (regions[i].dstSubresource.layerCount == 0) { + if (region.dstSubresource.layerCount == 0) { std::stringstream ss; ss << "vkCmdCopyImage: number of layers in pRegions[" << i << "] dstSubresource is zero"; - skip |= - log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, DRAWSTATE_INVALID_IMAGE_ASPECT, "IMAGE", "%s", ss.str().c_str()); + skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(command_buffer), DRAWSTATE_INVALID_IMAGE_ASPECT, "%s", ss.str().c_str()); } if (GetDeviceExtensions(device_data)->vk_khr_maintenance1) { @@ -1753,219 +1821,203 @@ // The number of depth slices in srcSubresource and dstSubresource must match // Depth comes from layerCount for 1D,2D resources, from extent.depth for 3D uint32_t src_slices = - (VK_IMAGE_TYPE_3D == src_image_state->createInfo.imageType ? regions[i].extent.depth - : regions[i].srcSubresource.layerCount); + (VK_IMAGE_TYPE_3D == src_image_state->createInfo.imageType ? src_copy_extent.depth + : region.srcSubresource.layerCount); uint32_t dst_slices = - (VK_IMAGE_TYPE_3D == dst_image_state->createInfo.imageType ? regions[i].extent.depth - : regions[i].dstSubresource.layerCount); + (VK_IMAGE_TYPE_3D == dst_image_state->createInfo.imageType ? dst_copy_extent.depth + : region.dstSubresource.layerCount); if (src_slices != dst_slices) { std::stringstream ss; ss << "vkCmdCopyImage: number of depth slices in source and destination subresources for pRegions[" << i << "] do not match"; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - reinterpret_cast(command_buffer), __LINE__, VALIDATION_ERROR_09c00118, "IMAGE", - "%s. %s", ss.str().c_str(), validation_error_map[VALIDATION_ERROR_09c00118]); + HandleToUint64(command_buffer), VALIDATION_ERROR_09c00118, "%s.", ss.str().c_str()); } } } else { // For each region the layerCount member of srcSubresource and dstSubresource must match - if (regions[i].srcSubresource.layerCount != regions[i].dstSubresource.layerCount) { + if (region.srcSubresource.layerCount != region.dstSubresource.layerCount) { std::stringstream ss; ss << "vkCmdCopyImage: number of layers in source and destination subresources for pRegions[" << i << "] do not match"; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_09c00118, "IMAGE", "%s. %s", - ss.str().c_str(), validation_error_map[VALIDATION_ERROR_09c00118]); + HandleToUint64(command_buffer), VALIDATION_ERROR_09c00118, "%s.", ss.str().c_str()); } } - // For each region, the aspectMask member of srcSubresource and dstSubresource must match - if (regions[i].srcSubresource.aspectMask != regions[i].dstSubresource.aspectMask) { - char const str[] = "vkCmdCopyImage: Src and dest aspectMasks for each region must match"; - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_09c00112, "IMAGE", "%s. %s", str, - validation_error_map[VALIDATION_ERROR_09c00112]); + // Do multiplane-specific checks, if extension enabled + if (GetDeviceExtensions(device_data)->vk_khr_sampler_ycbcr_conversion) { + skip |= CopyImageMultiplaneValidation(device_data, command_buffer, src_image_state, dst_image_state, region); + } + + if (!GetDeviceExtensions(device_data)->vk_khr_sampler_ycbcr_conversion) { + // not multi-plane, the aspectMask member of srcSubresource and dstSubresource must match + if (region.srcSubresource.aspectMask != region.dstSubresource.aspectMask) { + char const str[] = "vkCmdCopyImage: Src and dest aspectMasks for each region must match"; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(command_buffer), VALIDATION_ERROR_09c00112, "%s.", str); + } } // For each region, the aspectMask member of srcSubresource must be present in the source image - if (!VerifyAspectsPresent(regions[i].srcSubresource.aspectMask, src_image_state->createInfo.format)) { + if (!VerifyAspectsPresent(region.srcSubresource.aspectMask, src_image_state->createInfo.format)) { std::stringstream ss; ss << "vkCmdCopyImage: pRegion[" << i << "] srcSubresource.aspectMask cannot specify aspects not present in source image"; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_09c0011c, "IMAGE", "%s. %s", - ss.str().c_str(), validation_error_map[VALIDATION_ERROR_09c0011c]); + HandleToUint64(command_buffer), VALIDATION_ERROR_09c0011c, "%s.", ss.str().c_str()); } // For each region, the aspectMask member of dstSubresource must be present in the destination image - if (!VerifyAspectsPresent(regions[i].dstSubresource.aspectMask, dst_image_state->createInfo.format)) { + if (!VerifyAspectsPresent(region.dstSubresource.aspectMask, dst_image_state->createInfo.format)) { std::stringstream ss; ss << "vkCmdCopyImage: pRegion[" << i << "] dstSubresource.aspectMask cannot specify aspects not present in dest image"; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_09c0011e, "IMAGE", "%s. %s", - ss.str().c_str(), validation_error_map[VALIDATION_ERROR_09c0011e]); + HandleToUint64(command_buffer), VALIDATION_ERROR_09c0011e, "%s.", ss.str().c_str()); } // AspectMask must not contain VK_IMAGE_ASPECT_METADATA_BIT - if ((regions[i].srcSubresource.aspectMask & VK_IMAGE_ASPECT_METADATA_BIT) || - (regions[i].dstSubresource.aspectMask & VK_IMAGE_ASPECT_METADATA_BIT)) { + if ((region.srcSubresource.aspectMask & VK_IMAGE_ASPECT_METADATA_BIT) || + (region.dstSubresource.aspectMask & VK_IMAGE_ASPECT_METADATA_BIT)) { std::stringstream ss; ss << "vkCmdCopyImage: pRegions[" << i << "] may not specify aspectMask containing VK_IMAGE_ASPECT_METADATA_BIT"; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_0a600150, "IMAGE", "%s. %s", - ss.str().c_str(), validation_error_map[VALIDATION_ERROR_0a600150]); + HandleToUint64(command_buffer), VALIDATION_ERROR_0a600150, "%s.", ss.str().c_str()); } // For each region, if aspectMask contains VK_IMAGE_ASPECT_COLOR_BIT, it must not contain either of // VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT - if ((regions[i].srcSubresource.aspectMask & VK_IMAGE_ASPECT_COLOR_BIT) && - (regions[i].srcSubresource.aspectMask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT))) { + if ((region.srcSubresource.aspectMask & VK_IMAGE_ASPECT_COLOR_BIT) && + (region.srcSubresource.aspectMask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT))) { char const str[] = "vkCmdCopyImage aspectMask cannot specify both COLOR and DEPTH/STENCIL aspects"; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_0a60014e, "IMAGE", "%s. %s", str, - validation_error_map[VALIDATION_ERROR_0a60014e]); + HandleToUint64(command_buffer), VALIDATION_ERROR_0a60014e, "%s.", str); } // MipLevel must be less than the mipLevels specified in VkImageCreateInfo when the image was created - if (regions[i].srcSubresource.mipLevel >= src_image_state->createInfo.mipLevels) { + if (region.srcSubresource.mipLevel >= src_image_state->createInfo.mipLevels) { std::stringstream ss; ss << "vkCmdCopyImage: pRegions[" << i << "] specifies a src mipLevel greater than the number specified when the srcImage was created."; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_0a600152, "IMAGE", "%s. %s", - ss.str().c_str(), validation_error_map[VALIDATION_ERROR_0a600152]); + HandleToUint64(command_buffer), VALIDATION_ERROR_19000d40, "%s.", ss.str().c_str()); } - if (regions[i].dstSubresource.mipLevel >= dst_image_state->createInfo.mipLevels) { + if (region.dstSubresource.mipLevel >= dst_image_state->createInfo.mipLevels) { std::stringstream ss; ss << "vkCmdCopyImage: pRegions[" << i << "] specifies a dst mipLevel greater than the number specified when the dstImage was created."; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_0a600152, "IMAGE", "%s. %s", - ss.str().c_str(), validation_error_map[VALIDATION_ERROR_0a600152]); + HandleToUint64(command_buffer), VALIDATION_ERROR_19000d42, "%s.", ss.str().c_str()); } // (baseArrayLayer + layerCount) must be less than or equal to the arrayLayers specified in VkImageCreateInfo when the // image was created - if ((regions[i].srcSubresource.baseArrayLayer + regions[i].srcSubresource.layerCount) > - src_image_state->createInfo.arrayLayers) { + if ((region.srcSubresource.baseArrayLayer + region.srcSubresource.layerCount) > src_image_state->createInfo.arrayLayers) { std::stringstream ss; ss << "vkCmdCopyImage: srcImage arrayLayers was " << src_image_state->createInfo.arrayLayers << " but subRegion[" << i - << "] baseArrayLayer + layerCount is " - << (regions[i].srcSubresource.baseArrayLayer + regions[i].srcSubresource.layerCount); + << "] baseArrayLayer + layerCount is " << (region.srcSubresource.baseArrayLayer + region.srcSubresource.layerCount); skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_0a600154, "IMAGE", "%s. %s", - ss.str().c_str(), validation_error_map[VALIDATION_ERROR_0a600154]); + HandleToUint64(command_buffer), VALIDATION_ERROR_19000d44, "%s.", ss.str().c_str()); } - if ((regions[i].dstSubresource.baseArrayLayer + regions[i].dstSubresource.layerCount) > - dst_image_state->createInfo.arrayLayers) { + if ((region.dstSubresource.baseArrayLayer + region.dstSubresource.layerCount) > dst_image_state->createInfo.arrayLayers) { std::stringstream ss; ss << "vkCmdCopyImage: dstImage arrayLayers was " << dst_image_state->createInfo.arrayLayers << " but subRegion[" << i - << "] baseArrayLayer + layerCount is " - << (regions[i].dstSubresource.baseArrayLayer + regions[i].dstSubresource.layerCount); + << "] baseArrayLayer + layerCount is " << (region.dstSubresource.baseArrayLayer + region.dstSubresource.layerCount); skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_0a600154, "IMAGE", "%s. %s", - ss.str().c_str(), validation_error_map[VALIDATION_ERROR_0a600154]); + HandleToUint64(command_buffer), VALIDATION_ERROR_19000d46, "%s.", ss.str().c_str()); } // Check region extents for 1D-1D, 2D-2D, and 3D-3D copies if (src_image_state->createInfo.imageType == dst_image_state->createInfo.imageType) { // The source region specified by a given element of regions must be a region that is contained within srcImage - VkExtent3D img_extent = GetImageSubresourceExtent(src_image_state, &(regions[i].srcSubresource)); - if (0 != ExceedsBounds(®ions[i].srcOffset, ®ions[i].extent, &img_extent)) { + VkExtent3D img_extent = GetImageSubresourceExtent(src_image_state, &(region.srcSubresource)); + if (0 != ExceedsBounds(®ion.srcOffset, &src_copy_extent, &img_extent)) { std::stringstream ss; - ss << "vkCmdCopyImage: Source pRegion[" << i << "] with mipLevel [ " << regions[i].srcSubresource.mipLevel - << " ], offset [ " << regions[i].srcOffset.x << ", " << regions[i].srcOffset.y << ", " << regions[i].srcOffset.z - << " ], extent [ " << regions[i].extent.width << ", " << regions[i].extent.height << ", " - << regions[i].extent.depth << " ] exceeds the source image dimensions"; + ss << "vkCmdCopyImage: Source pRegion[" << i << "] with mipLevel [ " << region.srcSubresource.mipLevel + << " ], offset [ " << region.srcOffset.x << ", " << region.srcOffset.y << ", " << region.srcOffset.z + << " ], extent [ " << src_copy_extent.width << ", " << src_copy_extent.height << ", " << src_copy_extent.depth + << " ] exceeds the source image dimensions"; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_190000f4, "IMAGE", "%s. %s", - ss.str().c_str(), validation_error_map[VALIDATION_ERROR_190000f4]); + HandleToUint64(command_buffer), VALIDATION_ERROR_190000f4, "%s.", ss.str().c_str()); } // The destination region specified by a given element of regions must be a region that is contained within dst_image - img_extent = GetImageSubresourceExtent(dst_image_state, &(regions[i].dstSubresource)); - if (0 != ExceedsBounds(®ions[i].dstOffset, ®ions[i].extent, &img_extent)) { + img_extent = GetImageSubresourceExtent(dst_image_state, &(region.dstSubresource)); + if (0 != ExceedsBounds(®ion.dstOffset, &dst_copy_extent, &img_extent)) { std::stringstream ss; - ss << "vkCmdCopyImage: Dest pRegion[" << i << "] with mipLevel [ " << regions[i].dstSubresource.mipLevel - << " ], offset [ " << regions[i].dstOffset.x << ", " << regions[i].dstOffset.y << ", " << regions[i].dstOffset.z - << " ], extent [ " << regions[i].extent.width << ", " << regions[i].extent.height << ", " - << regions[i].extent.depth << " ] exceeds the destination image dimensions"; + ss << "vkCmdCopyImage: Dest pRegion[" << i << "] with mipLevel [ " << region.dstSubresource.mipLevel + << " ], offset [ " << region.dstOffset.x << ", " << region.dstOffset.y << ", " << region.dstOffset.z + << " ], extent [ " << dst_copy_extent.width << ", " << dst_copy_extent.height << ", " << dst_copy_extent.depth + << " ] exceeds the destination image dimensions"; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_190000f6, "IMAGE", "%s. %s", - ss.str().c_str(), validation_error_map[VALIDATION_ERROR_190000f6]); + HandleToUint64(command_buffer), VALIDATION_ERROR_190000f6, "%s.", ss.str().c_str()); } } // Each dimension offset + extent limits must fall with image subresource extent - VkExtent3D subresource_extent = GetImageSubresourceExtent(src_image_state, &(regions[i].srcSubresource)); - VkExtent3D copy_extent = regions[i].extent; - if (slice_override) copy_extent.depth = depth_slices; - uint32_t extent_check = ExceedsBounds(&(regions[i].srcOffset), ©_extent, &subresource_extent); + VkExtent3D subresource_extent = GetImageSubresourceExtent(src_image_state, &(region.srcSubresource)); + if (slice_override) src_copy_extent.depth = depth_slices; + uint32_t extent_check = ExceedsBounds(&(region.srcOffset), &src_copy_extent, &subresource_extent); if (extent_check & x_bit) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_09c00120, "IMAGE", + HandleToUint64(command_buffer), VALIDATION_ERROR_09c00120, "vkCmdCopyImage: Source image pRegion %1d x-dimension offset [%1d] + extent [%1d] exceeds subResource " - "width [%1d]. %s", - i, regions[i].srcOffset.x, regions[i].extent.width, subresource_extent.width, - validation_error_map[VALIDATION_ERROR_09c00120]); + "width [%1d].", + i, region.srcOffset.x, src_copy_extent.width, subresource_extent.width); } if (extent_check & y_bit) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_09c00122, "IMAGE", + HandleToUint64(command_buffer), VALIDATION_ERROR_09c00122, "vkCmdCopyImage: Source image pRegion %1d y-dimension offset [%1d] + extent [%1d] exceeds subResource " - "height [%1d]. %s", - i, regions[i].srcOffset.y, regions[i].extent.height, subresource_extent.height, - validation_error_map[VALIDATION_ERROR_09c00122]); + "height [%1d].", + i, region.srcOffset.y, src_copy_extent.height, subresource_extent.height); } if (extent_check & z_bit) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_09c00126, "IMAGE", + HandleToUint64(command_buffer), VALIDATION_ERROR_09c00126, "vkCmdCopyImage: Source image pRegion %1d z-dimension offset [%1d] + extent [%1d] exceeds subResource " - "depth [%1d]. %s", - i, regions[i].srcOffset.z, copy_extent.depth, subresource_extent.depth, - validation_error_map[VALIDATION_ERROR_09c00126]); + "depth [%1d].", + i, region.srcOffset.z, src_copy_extent.depth, subresource_extent.depth); } - subresource_extent = GetImageSubresourceExtent(dst_image_state, &(regions[i].dstSubresource)); - copy_extent = regions[i].extent; - if (slice_override) copy_extent.depth = depth_slices; - extent_check = ExceedsBounds(&(regions[i].dstOffset), ©_extent, &subresource_extent); + // Adjust dest extent if necessary + subresource_extent = GetImageSubresourceExtent(dst_image_state, &(region.dstSubresource)); + if (slice_override) dst_copy_extent.depth = depth_slices; + + extent_check = ExceedsBounds(&(region.dstOffset), &dst_copy_extent, &subresource_extent); if (extent_check & x_bit) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_09c0012c, "IMAGE", + HandleToUint64(command_buffer), VALIDATION_ERROR_09c0012c, "vkCmdCopyImage: Dest image pRegion %1d x-dimension offset [%1d] + extent [%1d] exceeds subResource " - "width [%1d]. %s", - i, regions[i].dstOffset.x, regions[i].extent.width, subresource_extent.width, - validation_error_map[VALIDATION_ERROR_09c0012c]); + "width [%1d].", + i, region.dstOffset.x, dst_copy_extent.width, subresource_extent.width); } if (extent_check & y_bit) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_09c0012e, "IMAGE", + HandleToUint64(command_buffer), VALIDATION_ERROR_09c0012e, "vkCmdCopyImage: Dest image pRegion %1d y-dimension offset [%1d] + extent [%1d] exceeds subResource " - "height [%1d]. %s", - i, regions[i].dstOffset.y, regions[i].extent.height, subresource_extent.height, - validation_error_map[VALIDATION_ERROR_09c0012e]); + "height [%1d].", + i, region.dstOffset.y, dst_copy_extent.height, subresource_extent.height); } if (extent_check & z_bit) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_09c00132, "IMAGE", + HandleToUint64(command_buffer), VALIDATION_ERROR_09c00132, "vkCmdCopyImage: Dest image pRegion %1d z-dimension offset [%1d] + extent [%1d] exceeds subResource " - "depth [%1d]. %s", - i, regions[i].dstOffset.z, copy_extent.depth, subresource_extent.depth, - validation_error_map[VALIDATION_ERROR_09c00132]); + "depth [%1d].", + i, region.dstOffset.z, dst_copy_extent.depth, subresource_extent.depth); } // The union of all source regions, and the union of all destination regions, specified by the elements of regions, // must not overlap in memory if (src_image_state->image == dst_image_state->image) { for (uint32_t j = 0; j < region_count; j++) { - if (RegionIntersects(®ions[i], ®ions[j], src_image_state->createInfo.imageType)) { + if (RegionIntersects(®ion, ®ions[j], src_image_state->createInfo.imageType, + FormatIsMultiplane(src_image_state->createInfo.format))) { std::stringstream ss; ss << "vkCmdCopyImage: pRegions[" << i << "] src overlaps with pRegions[" << j << "]."; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_190000f8, "IMAGE", "%s. %s", - ss.str().c_str(), validation_error_map[VALIDATION_ERROR_190000f8]); + HandleToUint64(command_buffer), VALIDATION_ERROR_190000f8, "%s.", ss.str().c_str()); } } } @@ -1978,7 +2030,7 @@ if (src_image_state->createInfo.format != dst_image_state->createInfo.format) { char const str[] = "vkCmdCopyImage called with unmatched source and dest image depth/stencil formats."; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, DRAWSTATE_MISMATCHED_IMAGE_FORMAT, "IMAGE", str); + HandleToUint64(command_buffer), DRAWSTATE_MISMATCHED_IMAGE_FORMAT, str); } } else { size_t srcSize = FormatSize(src_image_state->createInfo.format); @@ -1986,8 +2038,7 @@ if (srcSize != destSize) { char const str[] = "vkCmdCopyImage called with unmatched source and dest image format sizes."; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_1900010e, "IMAGE", "%s. %s", str, - validation_error_map[VALIDATION_ERROR_1900010e]); + HandleToUint64(command_buffer), VALIDATION_ERROR_1900010e, "%s.", str); } } @@ -1995,8 +2046,7 @@ if (src_image_state->createInfo.samples != dst_image_state->createInfo.samples) { char const str[] = "vkCmdCopyImage() called on image pair with non-identical sample counts."; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, VALIDATION_ERROR_19000110, "IMAGE", "%s %s", str, - validation_error_map[VALIDATION_ERROR_19000110]); + HandleToUint64(command_buffer), VALIDATION_ERROR_19000110, "%s", str); } skip |= ValidateMemoryIsBoundToImage(device_data, src_image_state, "vkCmdCopyImage()", VALIDATION_ERROR_190000fe); @@ -2067,12 +2117,12 @@ // There are times where app needs to use ClearAttachments (generally when reusing a buffer inside of a render pass) // This warning should be made more specific. It'd be best to avoid triggering this test if it's a use that must call // CmdClearAttachments. - skip |= - log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), 0, DRAWSTATE_CLEAR_CMD_BEFORE_DRAW, "DS", - "vkCmdClearAttachments() issued on command buffer object 0x%p prior to any Draw Cmds." - " It is recommended you use RenderPass LOAD_OP_CLEAR on Attachments prior to any Draw.", - commandBuffer); + skip |= log_msg( + report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), DRAWSTATE_CLEAR_CMD_BEFORE_DRAW, + "vkCmdClearAttachments() issued on command buffer object 0x%" PRIx64 + " prior to any Draw Cmds. It is recommended you use RenderPass LOAD_OP_CLEAR on Attachments prior to any Draw.", + HandleToUint64(commandBuffer)); } skip |= outsideRenderPass(device_data, cb_node, "vkCmdClearAttachments()", VALIDATION_ERROR_18600017); } @@ -2089,23 +2139,20 @@ if (0 == clear_desc->aspectMask) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_01c00c03, "IMAGE", "%s", - validation_error_map[VALIDATION_ERROR_01c00c03]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_01c00c03, " "); } else if (clear_desc->aspectMask & VK_IMAGE_ASPECT_METADATA_BIT) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_01c00028, "IMAGE", "%s", - validation_error_map[VALIDATION_ERROR_01c00028]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_01c00028, " "); } else if (clear_desc->aspectMask & VK_IMAGE_ASPECT_COLOR_BIT) { if (clear_desc->colorAttachment >= subpass_desc->colorAttachmentCount) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_1860001e, "DS", - "vkCmdClearAttachments() color attachment index %d out of range for active subpass %d. %s", - clear_desc->colorAttachment, cb_node->activeSubpass, - validation_error_map[VALIDATION_ERROR_1860001e]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_1860001e, + "vkCmdClearAttachments() color attachment index %d out of range for active subpass %d.", + clear_desc->colorAttachment, cb_node->activeSubpass); } else if (subpass_desc->pColorAttachments[clear_desc->colorAttachment].attachment == VK_ATTACHMENT_UNUSED) { skip |= log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(commandBuffer), __LINE__, - DRAWSTATE_MISSING_ATTACHMENT_REFERENCE, "DS", + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(commandBuffer), + DRAWSTATE_MISSING_ATTACHMENT_REFERENCE, "vkCmdClearAttachments() color attachment index %d is VK_ATTACHMENT_UNUSED; ignored.", clear_desc->colorAttachment); } else { @@ -2115,24 +2162,22 @@ if ((clear_desc->aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT) || (clear_desc->aspectMask & VK_IMAGE_ASPECT_STENCIL_BIT)) { char const str[] = - "vkCmdClearAttachments aspectMask [%d] must set only VK_IMAGE_ASPECT_COLOR_BIT of a color attachment. %s"; + "vkCmdClearAttachments() aspectMask [%d] must set only VK_IMAGE_ASPECT_COLOR_BIT of a color attachment."; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_01c00026, "IMAGE", str, i, - validation_error_map[VALIDATION_ERROR_01c00026]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_01c00026, str, i); } } else { // Must be depth and/or stencil if (((clear_desc->aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT) != VK_IMAGE_ASPECT_DEPTH_BIT) && ((clear_desc->aspectMask & VK_IMAGE_ASPECT_STENCIL_BIT) != VK_IMAGE_ASPECT_STENCIL_BIT)) { - char const str[] = "vkCmdClearAttachments aspectMask [%d] is not a valid combination of bits. %s"; + char const str[] = "vkCmdClearAttachments() aspectMask [%d] is not a valid combination of bits."; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_01c00c01, "IMAGE", str, i, - validation_error_map[VALIDATION_ERROR_01c00c01]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_01c00c01, str, i); } if (!subpass_desc->pDepthStencilAttachment || (subpass_desc->pDepthStencilAttachment->attachment == VK_ATTACHMENT_UNUSED)) { skip |= log_msg( report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, DRAWSTATE_MISSING_ATTACHMENT_REFERENCE, "DS", + HandleToUint64(commandBuffer), DRAWSTATE_MISSING_ATTACHMENT_REFERENCE, "vkCmdClearAttachments() depth/stencil clear with no depth/stencil attachment in subpass; ignored"); } else { image_view = framebuffer->createInfo.pAttachments[subpass_desc->pDepthStencilAttachment->attachment]; @@ -2143,26 +2188,38 @@ for (uint32_t j = 0; j < rectCount; j++) { // The rectangular region specified by a given element of pRects must be contained within the render area of // the current render pass instance - // TODO: This check should be moved to CmdExecuteCommands or QueueSubmit to cover secondary CB cases - if ((cb_node->createInfo.level == VK_COMMAND_BUFFER_LEVEL_PRIMARY) && - (false == ContainsRect(cb_node->activeRenderPassBeginInfo.renderArea, pRects[j].rect))) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_18600020, "DS", + if (cb_node->createInfo.level == VK_COMMAND_BUFFER_LEVEL_PRIMARY) { + if (false == ContainsRect(cb_node->activeRenderPassBeginInfo.renderArea, pRects[j].rect)) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_18600020, "vkCmdClearAttachments(): The area defined by pRects[%d] is not contained in the area of " - "the current render pass instance. %s", - j, validation_error_map[VALIDATION_ERROR_18600020]); + "the current render pass instance.", + j); + } + } else { + cb_node->cmd_execute_commands_functions.emplace_back([=](GLOBAL_CB_NODE *prim_cb, VkFramebuffer fb) { + if (false == ContainsRect(prim_cb->activeRenderPassBeginInfo.renderArea, pRects[j].rect)) { + return log_msg( + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_18600020, + "vkCmdClearAttachments(): The area defined by pRects[%d] is not contained in the area of " + "the current render pass instance.", + j); + } + return false; + }); } // The layers specified by a given element of pRects must be contained within every attachment that // pAttachments refers to auto attachment_layer_count = image_view_state->create_info.subresourceRange.layerCount; if ((pRects[j].baseArrayLayer >= attachment_layer_count) || (pRects[j].baseArrayLayer + pRects[j].layerCount > attachment_layer_count)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_18600022, "DS", - "vkCmdClearAttachments(): The layers defined in pRects[%d] are not contained in the layers of " - "pAttachment[%d]. %s", - j, i, validation_error_map[VALIDATION_ERROR_18600022]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_18600022, + "vkCmdClearAttachments(): The layers defined in pRects[%d] are not contained in the layers " + "of pAttachment[%d].", + j, i); } } } @@ -2189,51 +2246,47 @@ if (pRegions[i].srcSubresource.layerCount == 0) { char const str[] = "vkCmdResolveImage: number of layers in source subresource is zero"; skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_MISMATCHED_IMAGE_ASPECT, "IMAGE", str); + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_MISMATCHED_IMAGE_ASPECT, str); } if (pRegions[i].dstSubresource.layerCount == 0) { char const str[] = "vkCmdResolveImage: number of layers in destination subresource is zero"; skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_MISMATCHED_IMAGE_ASPECT, "IMAGE", str); + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_MISMATCHED_IMAGE_ASPECT, str); } if (pRegions[i].srcSubresource.layerCount != pRegions[i].dstSubresource.layerCount) { skip |= log_msg( report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_0a200216, "IMAGE", - "vkCmdResolveImage: layerCount in source and destination subresource of pRegions[%d] does not match. %s", i, - validation_error_map[VALIDATION_ERROR_0a200216]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_0a200216, + "vkCmdResolveImage: layerCount in source and destination subresource of pRegions[%d] does not match.", i); } if ((pRegions[i].srcSubresource.aspectMask != VK_IMAGE_ASPECT_COLOR_BIT) || (pRegions[i].dstSubresource.aspectMask != VK_IMAGE_ASPECT_COLOR_BIT)) { char const str[] = "vkCmdResolveImage: src and dest aspectMasks for each region must specify only VK_IMAGE_ASPECT_COLOR_BIT"; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_0a200214, "IMAGE", "%s. %s", str, - validation_error_map[VALIDATION_ERROR_0a200214]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_0a200214, "%s.", str); } } if (src_image_state->createInfo.format != dst_image_state->createInfo.format) { char const str[] = "vkCmdResolveImage called with unmatched source and dest formats."; skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_MISMATCHED_IMAGE_FORMAT, "IMAGE", str); + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_MISMATCHED_IMAGE_FORMAT, str); } if (src_image_state->createInfo.imageType != dst_image_state->createInfo.imageType) { char const str[] = "vkCmdResolveImage called with unmatched source and dest image types."; skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_MISMATCHED_IMAGE_TYPE, "IMAGE", str); + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_MISMATCHED_IMAGE_TYPE, str); } if (src_image_state->createInfo.samples == VK_SAMPLE_COUNT_1_BIT) { char const str[] = "vkCmdResolveImage called with source sample count less than 2."; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_1c800202, "IMAGE", "%s. %s", str, - validation_error_map[VALIDATION_ERROR_1c800202]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_1c800202, "%s.", str); } if (dst_image_state->createInfo.samples != VK_SAMPLE_COUNT_1_BIT) { char const str[] = "vkCmdResolveImage called with dest sample count greater than 1."; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_1c800206, "IMAGE", "%s. %s", str, - validation_error_map[VALIDATION_ERROR_1c800206]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_1c800206, "%s.", str); } // TODO: Need to validate image layouts, which will include layout validation for shared presentable images } else { @@ -2260,10 +2313,14 @@ } bool PreCallValidateCmdBlitImage(layer_data *device_data, GLOBAL_CB_NODE *cb_node, IMAGE_STATE *src_image_state, - IMAGE_STATE *dst_image_state, uint32_t regionCount, const VkImageBlit *pRegions, VkFilter filter) { + IMAGE_STATE *dst_image_state, uint32_t region_count, const VkImageBlit *regions, + VkImageLayout src_image_layout, VkImageLayout dst_image_layout, VkFilter filter) { const debug_report_data *report_data = core_validation::GetReportData(device_data); bool skip = false; + if (cb_node) { + skip |= ValidateCmd(device_data, cb_node, CMD_BLITIMAGE, "vkCmdBlitImage()"); + } if (cb_node && src_image_state && dst_image_state) { skip |= ValidateImageSampleCount(device_data, src_image_state, VK_SAMPLE_COUNT_1_BIT, "vkCmdBlitImage(): srcImage", VALIDATION_ERROR_184001d2); @@ -2287,55 +2344,51 @@ VkFormatProperties props = GetFormatProperties(device_data, src_format); VkImageTiling tiling = src_image_state->createInfo.tiling; - VkFormatFeatureFlags flags = - (tiling == VK_IMAGE_TILING_LINEAR ? props.linearTilingFeatures : props.optimalTilingFeatures); + VkFormatFeatureFlags flags = (tiling == VK_IMAGE_TILING_LINEAR ? props.linearTilingFeatures : props.optimalTilingFeatures); if (VK_FORMAT_FEATURE_BLIT_SRC_BIT != (flags & VK_FORMAT_FEATURE_BLIT_SRC_BIT)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_184001b4, "IMAGE", - "vkCmdBlitImage: source image format %s does not support VK_FORMAT_FEATURE_BLIT_SRC_BIT feature. %s", - string_VkFormat(src_format), validation_error_map[VALIDATION_ERROR_184001b4]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_184001b4, + "vkCmdBlitImage: source image format %s does not support VK_FORMAT_FEATURE_BLIT_SRC_BIT feature.", + string_VkFormat(src_format)); } if ((VK_FILTER_LINEAR == filter) && (VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT != (flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT))) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_184001d6, "IMAGE", - "vkCmdBlitImage: source image format %s does not support linear filtering. %s", - string_VkFormat(src_format), validation_error_map[VALIDATION_ERROR_184001d6]); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_184001d6, + "vkCmdBlitImage: source image format %s does not support linear filtering.", string_VkFormat(src_format)); } if ((VK_FILTER_CUBIC_IMG == filter) && (VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG != (flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG))) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_184001d8, "IMAGE", - "vkCmdBlitImage: source image format %s does not support cubic filtering. %s", - string_VkFormat(src_format), validation_error_map[VALIDATION_ERROR_184001d8]); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_184001d8, + "vkCmdBlitImage: source image format %s does not support cubic filtering.", string_VkFormat(src_format)); } if ((VK_FILTER_CUBIC_IMG == filter) && (VK_IMAGE_TYPE_3D != src_type)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_184001da, "IMAGE", - "vkCmdBlitImage: source image type must be VK_IMAGE_TYPE_3D when cubic filtering is specified. %s", - validation_error_map[VALIDATION_ERROR_184001da]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_184001da, + "vkCmdBlitImage: source image type must be VK_IMAGE_TYPE_3D when cubic filtering is specified."); } props = GetFormatProperties(device_data, dst_format); tiling = dst_image_state->createInfo.tiling; flags = (tiling == VK_IMAGE_TILING_LINEAR ? props.linearTilingFeatures : props.optimalTilingFeatures); if (VK_FORMAT_FEATURE_BLIT_DST_BIT != (flags & VK_FORMAT_FEATURE_BLIT_DST_BIT)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_184001be, "IMAGE", - "vkCmdBlitImage: destination image format %s does not support VK_FORMAT_FEATURE_BLIT_DST_BIT feature. %s", - string_VkFormat(dst_format), validation_error_map[VALIDATION_ERROR_184001be]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_184001be, + "vkCmdBlitImage: destination image format %s does not support VK_FORMAT_FEATURE_BLIT_DST_BIT feature.", + string_VkFormat(dst_format)); } if ((VK_SAMPLE_COUNT_1_BIT != src_image_state->createInfo.samples) || (VK_SAMPLE_COUNT_1_BIT != dst_image_state->createInfo.samples)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_184001c8, "IMAGE", - "vkCmdBlitImage: source or dest image has sample count other than VK_SAMPLE_COUNT_1_BIT. %s", - validation_error_map[VALIDATION_ERROR_184001c8]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_184001c8, + "vkCmdBlitImage: source or dest image has sample count other than VK_SAMPLE_COUNT_1_BIT."); } // Validate consistency for unsigned formats @@ -2345,8 +2398,7 @@ << "the other one must also have unsigned integer format. " << "Source format is " << string_VkFormat(src_format) << " Destination format is " << string_VkFormat(dst_format); skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_184001cc, "IMAGE", "%s. %s", - ss.str().c_str(), validation_error_map[VALIDATION_ERROR_184001cc]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_184001cc, "%s.", ss.str().c_str()); } // Validate consistency for signed formats @@ -2356,8 +2408,7 @@ << "the other one must also have signed integer format. " << "Source format is " << string_VkFormat(src_format) << " Destination format is " << string_VkFormat(dst_format); skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_184001ca, "IMAGE", "%s. %s", - ss.str().c_str(), validation_error_map[VALIDATION_ERROR_184001ca]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_184001ca, "%s.", ss.str().c_str()); } // Validate filter for Depth/Stencil formats @@ -2366,8 +2417,7 @@ ss << "vkCmdBlitImage: If the format of srcImage is a depth, stencil, or depth stencil " << "then filter must be VK_FILTER_NEAREST."; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_184001d0, "IMAGE", "%s. %s", - ss.str().c_str(), validation_error_map[VALIDATION_ERROR_184001d0]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_184001d0, "%s.", ss.str().c_str()); } // Validate aspect bits and formats for depth/stencil images @@ -2379,8 +2429,7 @@ << "Source format is " << string_VkFormat(src_format) << " Destination format is " << string_VkFormat(dst_format); skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_184001ce, "IMAGE", "%s. %s", - ss.str().c_str(), validation_error_map[VALIDATION_ERROR_184001ce]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_184001ce, "%s.", ss.str().c_str()); } #if 0 // TODO: Cannot find VU statements or spec language for these in CmdBlitImage. Verify or remove. @@ -2390,11 +2439,10 @@ if (FormatIsDepthAndStencil(src_format)) { if ((srcAspect != VK_IMAGE_ASPECT_DEPTH_BIT) && (srcAspect != VK_IMAGE_ASPECT_STENCIL_BIT)) { std::stringstream ss; - ss << "vkCmdBlitImage: Combination depth/stencil image formats must have only one of " - "VK_IMAGE_ASPECT_DEPTH_BIT " + ss << "vkCmdBlitImage: Combination depth/stencil image formats must have only one of VK_IMAGE_ASPECT_DEPTH_BIT " << "and VK_IMAGE_ASPECT_STENCIL_BIT set in srcImage and dstImage"; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_INVALID_IMAGE_ASPECT, "IMAGE", + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_INVALID_IMAGE_ASPECT, "%s", ss.str().c_str()); } } @@ -2404,7 +2452,7 @@ ss << "vkCmdBlitImage: Stencil-only image formats must have only the VK_IMAGE_ASPECT_STENCIL_BIT " << "set in both the srcImage and dstImage"; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_INVALID_IMAGE_ASPECT, "IMAGE", + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_INVALID_IMAGE_ASPECT, "%s", ss.str().c_str()); } } @@ -2414,7 +2462,7 @@ ss << "vkCmdBlitImage: Depth-only image formats must have only the VK_IMAGE_ASPECT_DEPTH " << "set in both the srcImage and dstImage"; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_INVALID_IMAGE_ASPECT, "IMAGE", + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_INVALID_IMAGE_ASPECT, "%s", ss.str().c_str()); } } @@ -2423,8 +2471,15 @@ } // Depth or Stencil // Do per-region checks - for (uint32_t i = 0; i < regionCount; i++) { - VkImageBlit rgn = pRegions[i]; + for (uint32_t i = 0; i < region_count; i++) { + const VkImageBlit rgn = regions[i]; + bool hit_error = false; + skip |= + VerifyImageLayout(device_data, cb_node, src_image_state, rgn.srcSubresource, src_image_layout, + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, "vkCmdBlitImage()", VALIDATION_ERROR_184001bc, &hit_error); + skip |= + VerifyImageLayout(device_data, cb_node, dst_image_state, rgn.dstSubresource, dst_image_layout, + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, "vkCmdBlitImage()", VALIDATION_ERROR_184001c6, &hit_error); // Warn for zero-sized regions if ((rgn.srcOffsets[0].x == rgn.srcOffsets[1].x) || (rgn.srcOffsets[0].y == rgn.srcOffsets[1].y) || @@ -2432,59 +2487,54 @@ std::stringstream ss; ss << "vkCmdBlitImage: pRegions[" << i << "].srcOffsets specify a zero-volume area."; skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_INVALID_EXTENTS, "IMAGE", "%s", - ss.str().c_str()); + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_INVALID_EXTENTS, "%s", ss.str().c_str()); } if ((rgn.dstOffsets[0].x == rgn.dstOffsets[1].x) || (rgn.dstOffsets[0].y == rgn.dstOffsets[1].y) || (rgn.dstOffsets[0].z == rgn.dstOffsets[1].z)) { std::stringstream ss; ss << "vkCmdBlitImage: pRegions[" << i << "].dstOffsets specify a zero-volume area."; skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_INVALID_EXTENTS, "IMAGE", "%s", - ss.str().c_str()); + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_INVALID_EXTENTS, "%s", ss.str().c_str()); } if (rgn.srcSubresource.layerCount == 0) { char const str[] = "vkCmdBlitImage: number of layers in source subresource is zero"; skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_MISMATCHED_IMAGE_ASPECT, "IMAGE", str); + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_MISMATCHED_IMAGE_ASPECT, str); } if (rgn.dstSubresource.layerCount == 0) { char const str[] = "vkCmdBlitImage: number of layers in destination subresource is zero"; skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_MISMATCHED_IMAGE_ASPECT, "IMAGE", str); + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_MISMATCHED_IMAGE_ASPECT, str); } // Check that src/dst layercounts match if (rgn.srcSubresource.layerCount != rgn.dstSubresource.layerCount) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_09a001de, "IMAGE", - "vkCmdBlitImage: layerCount in source and destination subresource of pRegions[%d] does not match. %s", - i, validation_error_map[VALIDATION_ERROR_09a001de]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_09a001de, + "vkCmdBlitImage: layerCount in source and destination subresource of pRegions[%d] does not match.", i); } if (rgn.srcSubresource.aspectMask != rgn.dstSubresource.aspectMask) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_09a001dc, "IMAGE", - "vkCmdBlitImage: aspectMask members for pRegion[%d] do not match. %s", i, - validation_error_map[VALIDATION_ERROR_09a001dc]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_09a001dc, + "vkCmdBlitImage: aspectMask members for pRegion[%d] do not match.", i); } if (!VerifyAspectsPresent(rgn.srcSubresource.aspectMask, src_format)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_09a001e2, "IMAGE", + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_09a001e2, "vkCmdBlitImage: region [%d] source aspectMask (0x%x) specifies aspects not present in source " - "image format %s. %s", - i, rgn.srcSubresource.aspectMask, string_VkFormat(src_format), - validation_error_map[VALIDATION_ERROR_09a001e2]); + "image format %s.", + i, rgn.srcSubresource.aspectMask, string_VkFormat(src_format)); } if (!VerifyAspectsPresent(rgn.dstSubresource.aspectMask, dst_format)) { skip |= log_msg( report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_09a001e4, "IMAGE", - "vkCmdBlitImage: region [%d] dest aspectMask (0x%x) specifies aspects not present in dest image format %s. %s", - i, rgn.dstSubresource.aspectMask, string_VkFormat(dst_format), validation_error_map[VALIDATION_ERROR_09a001e4]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_09a001e4, + "vkCmdBlitImage: region [%d] dest aspectMask (0x%x) specifies aspects not present in dest image format %s.", i, + rgn.dstSubresource.aspectMask, string_VkFormat(dst_format)); } // Validate source image offsets @@ -2492,20 +2542,20 @@ if (VK_IMAGE_TYPE_1D == src_type) { if ((0 != rgn.srcOffsets[0].y) || (1 != rgn.srcOffsets[1].y)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_09a001ea, "IMAGE", + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_09a001ea, "vkCmdBlitImage: region [%d], source image of type VK_IMAGE_TYPE_1D with srcOffset[].y values " - "of (%1d, %1d). These must be (0, 1). %s", - i, rgn.srcOffsets[0].y, rgn.srcOffsets[1].y, validation_error_map[VALIDATION_ERROR_09a001ea]); + "of (%1d, %1d). These must be (0, 1).", + i, rgn.srcOffsets[0].y, rgn.srcOffsets[1].y); } } if ((VK_IMAGE_TYPE_1D == src_type) || (VK_IMAGE_TYPE_2D == src_type)) { if ((0 != rgn.srcOffsets[0].z) || (1 != rgn.srcOffsets[1].z)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_09a001ee, "IMAGE", + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_09a001ee, "vkCmdBlitImage: region [%d], source image of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D with " - "srcOffset[].z values of (%1d, %1d). These must be (0, 1). %s", - i, rgn.srcOffsets[0].z, rgn.srcOffsets[1].z, validation_error_map[VALIDATION_ERROR_09a001ee]); + "srcOffset[].z values of (%1d, %1d). These must be (0, 1).", + i, rgn.srcOffsets[0].z, rgn.srcOffsets[1].z); } } @@ -2513,40 +2563,39 @@ if ((rgn.srcOffsets[0].x < 0) || (rgn.srcOffsets[0].x > static_cast(src_extent.width)) || (rgn.srcOffsets[1].x < 0) || (rgn.srcOffsets[1].x > static_cast(src_extent.width))) { oob = true; - skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_09a001e6, "IMAGE", - "vkCmdBlitImage: region [%d] srcOffset[].x values (%1d, %1d) exceed srcSubresource width extent (%1d). %s", i, - rgn.srcOffsets[0].x, rgn.srcOffsets[1].x, src_extent.width, validation_error_map[VALIDATION_ERROR_09a001e6]); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_09a001e6, + "vkCmdBlitImage: region [%d] srcOffset[].x values (%1d, %1d) exceed srcSubresource width extent (%1d).", + i, rgn.srcOffsets[0].x, rgn.srcOffsets[1].x, src_extent.width); } if ((rgn.srcOffsets[0].y < 0) || (rgn.srcOffsets[0].y > static_cast(src_extent.height)) || (rgn.srcOffsets[1].y < 0) || (rgn.srcOffsets[1].y > static_cast(src_extent.height))) { oob = true; skip |= log_msg( report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_09a001e8, "IMAGE", - "vkCmdBlitImage: region [%d] srcOffset[].y values (%1d, %1d) exceed srcSubresource height extent (%1d). %s", i, - rgn.srcOffsets[0].y, rgn.srcOffsets[1].y, src_extent.height, validation_error_map[VALIDATION_ERROR_09a001e8]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_09a001e8, + "vkCmdBlitImage: region [%d] srcOffset[].y values (%1d, %1d) exceed srcSubresource height extent (%1d).", i, + rgn.srcOffsets[0].y, rgn.srcOffsets[1].y, src_extent.height); } if ((rgn.srcOffsets[0].z < 0) || (rgn.srcOffsets[0].z > static_cast(src_extent.depth)) || (rgn.srcOffsets[1].z < 0) || (rgn.srcOffsets[1].z > static_cast(src_extent.depth))) { oob = true; - skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_09a001ec, "IMAGE", - "vkCmdBlitImage: region [%d] srcOffset[].z values (%1d, %1d) exceed srcSubresource depth extent (%1d). %s", i, - rgn.srcOffsets[0].z, rgn.srcOffsets[1].z, src_extent.depth, validation_error_map[VALIDATION_ERROR_09a001ec]); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_09a001ec, + "vkCmdBlitImage: region [%d] srcOffset[].z values (%1d, %1d) exceed srcSubresource depth extent (%1d).", + i, rgn.srcOffsets[0].z, rgn.srcOffsets[1].z, src_extent.depth); } if (rgn.srcSubresource.mipLevel >= src_image_state->createInfo.mipLevels) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_184001ae, "IMAGE", - "vkCmdBlitImage: region [%d] source image, attempt to access a non-existant mip level %1d. %s", i, - rgn.srcSubresource.mipLevel, validation_error_map[VALIDATION_ERROR_184001ae]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_184001ae, + "vkCmdBlitImage: region [%d] source image, attempt to access a non-existant mip level %1d.", i, + rgn.srcSubresource.mipLevel); } else if (oob) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_184001ae, "IMAGE", - "vkCmdBlitImage: region [%d] source image blit region exceeds image dimensions. %s", i, - validation_error_map[VALIDATION_ERROR_184001ae]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_184001ae, + "vkCmdBlitImage: region [%d] source image blit region exceeds image dimensions.", i); } // Validate dest image offsets @@ -2554,20 +2603,20 @@ if (VK_IMAGE_TYPE_1D == dst_type) { if ((0 != rgn.dstOffsets[0].y) || (1 != rgn.dstOffsets[1].y)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_09a001f4, "IMAGE", + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_09a001f4, "vkCmdBlitImage: region [%d], dest image of type VK_IMAGE_TYPE_1D with dstOffset[].y values of " - "(%1d, %1d). These must be (0, 1). %s", - i, rgn.dstOffsets[0].y, rgn.dstOffsets[1].y, validation_error_map[VALIDATION_ERROR_09a001f4]); + "(%1d, %1d). These must be (0, 1).", + i, rgn.dstOffsets[0].y, rgn.dstOffsets[1].y); } } if ((VK_IMAGE_TYPE_1D == dst_type) || (VK_IMAGE_TYPE_2D == dst_type)) { if ((0 != rgn.dstOffsets[0].z) || (1 != rgn.dstOffsets[1].z)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_09a001f8, "IMAGE", + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_09a001f8, "vkCmdBlitImage: region [%d], dest image of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D with " - "dstOffset[].z values of (%1d, %1d). These must be (0, 1). %s", - i, rgn.dstOffsets[0].z, rgn.dstOffsets[1].z, validation_error_map[VALIDATION_ERROR_09a001f8]); + "dstOffset[].z values of (%1d, %1d). These must be (0, 1).", + i, rgn.dstOffsets[0].z, rgn.dstOffsets[1].z); } } @@ -2575,50 +2624,49 @@ if ((rgn.dstOffsets[0].x < 0) || (rgn.dstOffsets[0].x > static_cast(dst_extent.width)) || (rgn.dstOffsets[1].x < 0) || (rgn.dstOffsets[1].x > static_cast(dst_extent.width))) { oob = true; - skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_09a001f0, "IMAGE", - "vkCmdBlitImage: region [%d] dstOffset[].x values (%1d, %1d) exceed dstSubresource width extent (%1d). %s", i, - rgn.dstOffsets[0].x, rgn.dstOffsets[1].x, dst_extent.width, validation_error_map[VALIDATION_ERROR_09a001f0]); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_09a001f0, + "vkCmdBlitImage: region [%d] dstOffset[].x values (%1d, %1d) exceed dstSubresource width extent (%1d).", + i, rgn.dstOffsets[0].x, rgn.dstOffsets[1].x, dst_extent.width); } if ((rgn.dstOffsets[0].y < 0) || (rgn.dstOffsets[0].y > static_cast(dst_extent.height)) || (rgn.dstOffsets[1].y < 0) || (rgn.dstOffsets[1].y > static_cast(dst_extent.height))) { oob = true; skip |= log_msg( report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_09a001f2, "IMAGE", - "vkCmdBlitImage: region [%d] dstOffset[].y values (%1d, %1d) exceed dstSubresource height extent (%1d). %s", i, - rgn.dstOffsets[0].y, rgn.dstOffsets[1].y, dst_extent.height, validation_error_map[VALIDATION_ERROR_09a001f2]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_09a001f2, + "vkCmdBlitImage: region [%d] dstOffset[].y values (%1d, %1d) exceed dstSubresource height extent (%1d).", i, + rgn.dstOffsets[0].y, rgn.dstOffsets[1].y, dst_extent.height); } if ((rgn.dstOffsets[0].z < 0) || (rgn.dstOffsets[0].z > static_cast(dst_extent.depth)) || (rgn.dstOffsets[1].z < 0) || (rgn.dstOffsets[1].z > static_cast(dst_extent.depth))) { oob = true; - skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_09a001f6, "IMAGE", - "vkCmdBlitImage: region [%d] dstOffset[].z values (%1d, %1d) exceed dstSubresource depth extent (%1d). %s", i, - rgn.dstOffsets[0].z, rgn.dstOffsets[1].z, dst_extent.depth, validation_error_map[VALIDATION_ERROR_09a001f6]); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_09a001f6, + "vkCmdBlitImage: region [%d] dstOffset[].z values (%1d, %1d) exceed dstSubresource depth extent (%1d).", + i, rgn.dstOffsets[0].z, rgn.dstOffsets[1].z, dst_extent.depth); } if (rgn.dstSubresource.mipLevel >= dst_image_state->createInfo.mipLevels) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_184001b0, "IMAGE", - "vkCmdBlitImage: region [%d] destination image, attempt to access a non-existant mip level %1d. %s", - i, rgn.dstSubresource.mipLevel, validation_error_map[VALIDATION_ERROR_184001b0]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_184001b0, + "vkCmdBlitImage: region [%d] destination image, attempt to access a non-existant mip level %1d.", i, + rgn.dstSubresource.mipLevel); } else if (oob) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_184001b0, "IMAGE", - "vkCmdBlitImage: region [%d] destination image blit region exceeds image dimensions. %s", i, - validation_error_map[VALIDATION_ERROR_184001b0]); + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_184001b0, + "vkCmdBlitImage: region [%d] destination image blit region exceeds image dimensions.", i); } if ((VK_IMAGE_TYPE_3D == src_type) || (VK_IMAGE_TYPE_3D == dst_type)) { if ((0 != rgn.srcSubresource.baseArrayLayer) || (1 != rgn.srcSubresource.layerCount) || (0 != rgn.dstSubresource.baseArrayLayer) || (1 != rgn.dstSubresource.layerCount)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_09a001e0, "IMAGE", + HandleToUint64(cb_node->commandBuffer), VALIDATION_ERROR_09a001e0, "vkCmdBlitImage: region [%d] blit to/from a 3D image type with a non-zero baseArrayLayer, or a " - "layerCount other than 1. %s", - i, validation_error_map[VALIDATION_ERROR_09a001e0]); + "layerCount other than 1.", + i); } } } // per-region checks @@ -2629,7 +2677,13 @@ } void PreCallRecordCmdBlitImage(layer_data *device_data, GLOBAL_CB_NODE *cb_node, IMAGE_STATE *src_image_state, - IMAGE_STATE *dst_image_state) { + IMAGE_STATE *dst_image_state, uint32_t region_count, const VkImageBlit *regions, + VkImageLayout src_image_layout, VkImageLayout dst_image_layout) { + // Make sure that all image slices are updated to correct layout + for (uint32_t i = 0; i < region_count; ++i) { + SetImageLayout(device_data, cb_node, src_image_state, regions[i].srcSubresource, src_image_layout); + SetImageLayout(device_data, cb_node, dst_image_state, regions[i].dstSubresource, dst_image_layout); + } // Update bindings between images and cmd buffer AddCommandBufferBindingImage(device_data, cb_node, src_image_state); AddCommandBufferBindingImage(device_data, cb_node, dst_image_state); @@ -2647,33 +2701,31 @@ // the IMAGE is the same // as the global IMAGE layout bool ValidateCmdBufImageLayouts(layer_data *device_data, GLOBAL_CB_NODE *pCB, - std::unordered_map const & globalImageLayoutMap, - std::unordered_map & overlayLayoutMap) { + std::unordered_map const &globalImageLayoutMap, + std::unordered_map &overlayLayoutMap) { bool skip = false; const debug_report_data *report_data = core_validation::GetReportData(device_data); for (auto cb_image_data : pCB->imageLayoutMap) { VkImageLayout imageLayout; - if (FindLayout(overlayLayoutMap, cb_image_data.first, imageLayout) || - FindLayout(globalImageLayoutMap, cb_image_data.first, imageLayout)) { + if (FindLayout(device_data, overlayLayoutMap, cb_image_data.first, imageLayout) || + FindLayout(device_data, globalImageLayoutMap, cb_image_data.first, imageLayout)) { if (cb_image_data.second.initialLayout == VK_IMAGE_LAYOUT_UNDEFINED) { // TODO: Set memory invalid which is in mem_tracker currently } else if (imageLayout != cb_image_data.second.initialLayout) { if (cb_image_data.first.hasSubresource) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pCB->commandBuffer), __LINE__, DRAWSTATE_INVALID_IMAGE_LAYOUT, "DS", - "Cannot submit cmd buffer using image (0x%" PRIx64 - ") [sub-resource: aspectMask 0x%X array layer %u, mip level %u], " - "with layout %s when first use is %s.", - HandleToUint64(cb_image_data.first.image), cb_image_data.first.subresource.aspectMask, - cb_image_data.first.subresource.arrayLayer, cb_image_data.first.subresource.mipLevel, - string_VkImageLayout(imageLayout), string_VkImageLayout(cb_image_data.second.initialLayout)); + skip |= log_msg( + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(pCB->commandBuffer), DRAWSTATE_INVALID_IMAGE_LAYOUT, + "Cannot submit cmd buffer using image (0x%" PRIx64 + ") [sub-resource: aspectMask 0x%X array layer %u, mip level %u], with layout %s when first use is %s.", + HandleToUint64(cb_image_data.first.image), cb_image_data.first.subresource.aspectMask, + cb_image_data.first.subresource.arrayLayer, cb_image_data.first.subresource.mipLevel, + string_VkImageLayout(imageLayout), string_VkImageLayout(cb_image_data.second.initialLayout)); } else { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pCB->commandBuffer), __LINE__, DRAWSTATE_INVALID_IMAGE_LAYOUT, "DS", - "Cannot submit cmd buffer using image (0x%" PRIx64 - ") with layout %s when " - "first use is %s.", + HandleToUint64(pCB->commandBuffer), DRAWSTATE_INVALID_IMAGE_LAYOUT, + "Cannot submit cmd buffer using image (0x%" PRIx64 ") with layout %s when first use is %s.", HandleToUint64(cb_image_data.first.image), string_VkImageLayout(imageLayout), string_VkImageLayout(cb_image_data.second.initialLayout)); } @@ -2725,17 +2777,16 @@ if (accessMask & ~(required_bit | optional_bits)) { // TODO: Verify against Valid Use skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cmdBuffer), __LINE__, DRAWSTATE_INVALID_BARRIER, "DS", + HandleToUint64(cmdBuffer), DRAWSTATE_INVALID_BARRIER, "Additional bits in %s accessMask 0x%X %s are specified when layout is %s.", type, accessMask, string_VkAccessFlags(accessMask).c_str(), string_VkImageLayout(layout)); } } else { if (!required_bit) { skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cmdBuffer), __LINE__, DRAWSTATE_INVALID_BARRIER, "DS", - "%s AccessMask %d %s must contain at least one of access bits %d " - "%s when layout is %s, unless the app has previously added a " - "barrier for this transition.", + HandleToUint64(cmdBuffer), DRAWSTATE_INVALID_BARRIER, + "%s AccessMask %d %s must contain at least one of access bits %d %s when layout is %s, unless the app " + "has previously added a barrier for this transition.", type, accessMask, string_VkAccessFlags(accessMask).c_str(), optional_bits, string_VkAccessFlags(optional_bits).c_str(), string_VkImageLayout(layout)); } else { @@ -2746,10 +2797,9 @@ opt_bits = "and may have optional bits " + ss.str() + ' ' + string_VkAccessFlags(optional_bits); } skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cmdBuffer), __LINE__, DRAWSTATE_INVALID_BARRIER, "DS", - "%s AccessMask %d %s must have required access bit %d %s %s when " - "layout is %s, unless the app has previously added a barrier for " - "this transition.", + HandleToUint64(cmdBuffer), DRAWSTATE_INVALID_BARRIER, + "%s AccessMask %d %s must have required access bit %d %s %s when layout is %s, unless the app has " + "previously added a barrier for this transition.", type, accessMask, string_VkAccessFlags(accessMask).c_str(), required_bit, string_VkAccessFlags(required_bit).c_str(), opt_bits.c_str(), string_VkImageLayout(layout)); } @@ -2767,9 +2817,9 @@ if (attachment_description.loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR) { if ((first_layout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL) || (first_layout == VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_12200688, "DS", "Cannot clear attachment %d with invalid first layout %s. %s", - attachment, string_VkImageLayout(first_layout), validation_error_map[VALIDATION_ERROR_12200688]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_12200688, "Cannot clear attachment %d with invalid first layout %s.", attachment, + string_VkImageLayout(first_layout)); } } return skip; @@ -2779,6 +2829,29 @@ const debug_report_data *report_data = core_validation::GetReportData(device_data); bool skip = false; + for (uint32_t i = 0; i < pCreateInfo->attachmentCount; ++i) { + VkFormat format = pCreateInfo->pAttachments[i].format; + if (pCreateInfo->pAttachments[i].initialLayout == VK_IMAGE_LAYOUT_UNDEFINED) { + if ((FormatIsColor(format) || FormatHasDepth(format)) && + pCreateInfo->pAttachments[i].loadOp == VK_ATTACHMENT_LOAD_OP_LOAD) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + DRAWSTATE_INVALID_RENDERPASS, + "Render pass has an attachment with loadOp == VK_ATTACHMENT_LOAD_OP_LOAD and initialLayout == " + "VK_IMAGE_LAYOUT_UNDEFINED. This is probably not what you intended. Consider using " + "VK_ATTACHMENT_LOAD_OP_DONT_CARE instead if the image truely is undefined at the start of the " + "render pass."); + } + if (FormatHasStencil(format) && pCreateInfo->pAttachments[i].stencilLoadOp == VK_ATTACHMENT_LOAD_OP_LOAD) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + DRAWSTATE_INVALID_RENDERPASS, + "Render pass has an attachment with stencilLoadOp == VK_ATTACHMENT_LOAD_OP_LOAD and initialLayout " + "== VK_IMAGE_LAYOUT_UNDEFINED. This is probably not what you intended. Consider using " + "VK_ATTACHMENT_LOAD_OP_DONT_CARE instead if the image truely is undefined at the start of the " + "render pass."); + } + } + } + // Track when we're observing the first use of an attachment std::vector attach_first_use(pCreateInfo->attachmentCount, true); for (uint32_t i = 0; i < pCreateInfo->subpassCount; ++i) { @@ -2798,14 +2871,14 @@ case VK_IMAGE_LAYOUT_GENERAL: // May not be optimal. TODO: reconsider this warning based on other constraints. skip |= log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, DRAWSTATE_INVALID_IMAGE_LAYOUT, "DS", + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, DRAWSTATE_INVALID_IMAGE_LAYOUT, "Layout for input attachment is GENERAL but should be READ_ONLY_OPTIMAL."); break; default: // No other layouts are acceptable skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, DRAWSTATE_INVALID_IMAGE_LAYOUT, "DS", + DRAWSTATE_INVALID_IMAGE_LAYOUT, "Layout for input attachment is %s but can only be READ_ONLY_OPTIMAL or GENERAL.", string_VkImageLayout(subpass.pInputAttachments[j].layout)); } @@ -2819,12 +2892,11 @@ (subpass.pColorAttachments[c].attachment == attach_index && subpass.pColorAttachments[c].layout != layout); } if (found_layout_mismatch) { - skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_140006ae, "DS", - "CreateRenderPass: Subpass %u pInputAttachments[%u] (%u) has layout %u, but is also used as a depth/color " - "attachment with a different layout. %s", - i, j, attach_index, layout, validation_error_map[VALIDATION_ERROR_140006ae]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_140006ae, + "CreateRenderPass: Subpass %u pInputAttachments[%u] (%u) has layout %u, but is also used as a " + "depth/color attachment with a different layout.", + i, j, attach_index, layout); } if (attach_first_use[attach_index]) { @@ -2840,10 +2912,10 @@ if (!used_as_depth && !used_as_color && pCreateInfo->pAttachments[attach_index].loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR) { skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_1400069c, "DS", - "CreateRenderPass: attachment %u is first used as an input attachment in subpass %u with loadOp=CLEAR. %s", - attach_index, attach_index, validation_error_map[VALIDATION_ERROR_1400069c]); + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_1400069c, + "CreateRenderPass: attachment %u is first used as an input attachment in subpass %u with loadOp=CLEAR.", + attach_index, attach_index); } } attach_first_use[attach_index] = false; @@ -2865,13 +2937,13 @@ case VK_IMAGE_LAYOUT_GENERAL: // May not be optimal; TODO: reconsider this warning based on other constraints? skip |= log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, DRAWSTATE_INVALID_IMAGE_LAYOUT, "DS", + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, DRAWSTATE_INVALID_IMAGE_LAYOUT, "Layout for color attachment is GENERAL but should be COLOR_ATTACHMENT_OPTIMAL."); break; default: skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, DRAWSTATE_INVALID_IMAGE_LAYOUT, "DS", + DRAWSTATE_INVALID_IMAGE_LAYOUT, "Layout for color attachment is %s but can only be COLOR_ATTACHMENT_OPTIMAL or GENERAL.", string_VkImageLayout(subpass.pColorAttachments[j].layout)); } @@ -2885,34 +2957,34 @@ if (subpass.pDepthStencilAttachment && subpass.pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) { switch (subpass.pDepthStencilAttachment->layout) { - case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL: - case VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL: - // These are ideal. - break; - - case VK_IMAGE_LAYOUT_GENERAL: - // May not be optimal; TODO: reconsider this warning based on other constraints? GENERAL can be better than - // doing a bunch of transitions. - skip |= log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, DRAWSTATE_INVALID_IMAGE_LAYOUT, "DS", - "GENERAL layout for depth attachment may not give optimal performance."); - break; + case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL: + case VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL: + // These are ideal. + break; - case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR: - case VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR: - if (GetDeviceExtensions(device_data)->vk_khr_maintenance2) { + case VK_IMAGE_LAYOUT_GENERAL: + // May not be optimal; TODO: reconsider this warning based on other constraints? GENERAL can be better than + // doing a bunch of transitions. + skip |= log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, DRAWSTATE_INVALID_IMAGE_LAYOUT, + "GENERAL layout for depth attachment may not give optimal performance."); break; - } else { - // Intentionally fall through to generic error message - } - default: - // No other layouts are acceptable - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, DRAWSTATE_INVALID_IMAGE_LAYOUT, "DS", - "Layout for depth attachment is %s but can only be DEPTH_STENCIL_ATTACHMENT_OPTIMAL, " - "DEPTH_STENCIL_READ_ONLY_OPTIMAL or GENERAL.", - string_VkImageLayout(subpass.pDepthStencilAttachment->layout)); + case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR: + case VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR: + if (GetDeviceExtensions(device_data)->vk_khr_maintenance2) { + break; + } else { + // Intentionally fall through to generic error message + } + + default: + // No other layouts are acceptable + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + DRAWSTATE_INVALID_IMAGE_LAYOUT, + "Layout for depth attachment is %s but can only be DEPTH_STENCIL_ATTACHMENT_OPTIMAL, " + "DEPTH_STENCIL_READ_ONLY_OPTIMAL or GENERAL.", + string_VkImageLayout(subpass.pDepthStencilAttachment->layout)); } auto attach_index = subpass.pDepthStencilAttachment->attachment; @@ -2944,9 +3016,9 @@ if (layout != VK_IMAGE_LAYOUT_PREINITIALIZED && layout != VK_IMAGE_LAYOUT_GENERAL) { skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(mem_info->mem), __LINE__, DRAWSTATE_INVALID_IMAGE_LAYOUT, "DS", - "Mapping an image with layout %s can result in undefined behavior if this memory is " - "used by the device. Only GENERAL or PREINITIALIZED should be used.", + HandleToUint64(mem_info->mem), DRAWSTATE_INVALID_IMAGE_LAYOUT, + "Mapping an image with layout %s can result in undefined behavior if this memory is used " + "by the device. Only GENERAL or PREINITIALIZED should be used.", string_VkImageLayout(layout)); } } @@ -2974,17 +3046,16 @@ if (!correct_usage) { if (msgCode == -1) { // TODO: Fix callers with msgCode == -1 to use correct validation checks. - skip = log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, get_debug_report_enum[obj_type], obj_handle, __LINE__, - MEMTRACK_INVALID_USAGE_FLAG, "MEM", - "Invalid usage flag for %s 0x%" PRIxLEAST64 - " used by %s. In this case, %s should have %s set during creation.", - type_str, obj_handle, func_name, type_str, usage_str); + skip = + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, get_debug_report_enum[obj_type], obj_handle, + MEMTRACK_INVALID_USAGE_FLAG, + "Invalid usage flag for %s 0x%" PRIx64 " used by %s. In this case, %s should have %s set during creation.", + type_str, obj_handle, func_name, type_str, usage_str); } else { - const char *valid_usage = (msgCode == -1) ? "" : validation_error_map[msgCode]; - skip = log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, get_debug_report_enum[obj_type], obj_handle, __LINE__, msgCode, "MEM", - "Invalid usage flag for %s 0x%" PRIxLEAST64 " used by %s. In this case, %s should have %s set during creation. %s", - type_str, obj_handle, func_name, type_str, usage_str, valid_usage); + skip = + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, get_debug_report_enum[obj_type], obj_handle, msgCode, + "Invalid usage flag for %s 0x%" PRIx64 " used by %s. In this case, %s should have %s set during creation.", + type_str, obj_handle, func_name, type_str, usage_str); } } return skip; @@ -3013,29 +3084,24 @@ // TODO: Add check for VALIDATION_ERROR_1ec0071e (sparse address space accounting) if ((pCreateInfo->flags & VK_BUFFER_CREATE_SPARSE_BINDING_BIT) && (!GetEnabledFeatures(device_data)->sparseBinding)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_01400726, "DS", + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_01400726, "vkCreateBuffer(): the sparseBinding device feature is disabled: Buffers cannot be created with the " - "VK_BUFFER_CREATE_SPARSE_BINDING_BIT set. %s", - validation_error_map[VALIDATION_ERROR_01400726]); + "VK_BUFFER_CREATE_SPARSE_BINDING_BIT set."); } if ((pCreateInfo->flags & VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT) && (!GetEnabledFeatures(device_data)->sparseResidencyBuffer)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_01400728, "DS", - "vkCreateBuffer(): the sparseResidencyBuffer device feature is disabled: Buffers cannot be created with the " - "VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT set. %s", - validation_error_map[VALIDATION_ERROR_01400728]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_01400728, + "vkCreateBuffer(): the sparseResidencyBuffer device feature is disabled: Buffers cannot be created with " + "the VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT set."); } if ((pCreateInfo->flags & VK_BUFFER_CREATE_SPARSE_ALIASED_BIT) && (!GetEnabledFeatures(device_data)->sparseResidencyAliased)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_0140072a, "DS", - "vkCreateBuffer(): the sparseResidencyAliased device feature is disabled: Buffers cannot be created with the " - "VK_BUFFER_CREATE_SPARSE_ALIASED_BIT set. %s", - validation_error_map[VALIDATION_ERROR_0140072a]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0140072a, + "vkCreateBuffer(): the sparseResidencyAliased device feature is disabled: Buffers cannot be created with " + "the VK_BUFFER_CREATE_SPARSE_ALIASED_BIT set."); } return skip; } @@ -3073,53 +3139,58 @@ if (FormatIsColor(format)) { if ((aspect_mask & VK_IMAGE_ASPECT_COLOR_BIT) != VK_IMAGE_ASPECT_COLOR_BIT) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image), __LINE__, VALIDATION_ERROR_0a400c01, "IMAGE", - "%s: Color image formats must have the VK_IMAGE_ASPECT_COLOR_BIT set. %s", func_name, - validation_error_map[VALIDATION_ERROR_0a400c01]); + HandleToUint64(image), VALIDATION_ERROR_0a400c01, + "%s: Color image formats must have the VK_IMAGE_ASPECT_COLOR_BIT set.", func_name); } else if ((aspect_mask & VK_IMAGE_ASPECT_COLOR_BIT) != aspect_mask) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image), __LINE__, VALIDATION_ERROR_0a400c01, "IMAGE", - "%s: Color image formats must have ONLY the VK_IMAGE_ASPECT_COLOR_BIT set. %s", func_name, - validation_error_map[VALIDATION_ERROR_0a400c01]); + HandleToUint64(image), VALIDATION_ERROR_0a400c01, + "%s: Color image formats must have ONLY the VK_IMAGE_ASPECT_COLOR_BIT set.", func_name); } } else if (FormatIsDepthAndStencil(format)) { if ((aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) == 0) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image), __LINE__, VALIDATION_ERROR_0a400c01, "IMAGE", - "%s: Depth/stencil image formats must have " - "at least one of VK_IMAGE_ASPECT_DEPTH_BIT " - "and VK_IMAGE_ASPECT_STENCIL_BIT set. %s", - func_name, validation_error_map[VALIDATION_ERROR_0a400c01]); + HandleToUint64(image), VALIDATION_ERROR_0a400c01, + "%s: Depth/stencil image formats must have at least one of VK_IMAGE_ASPECT_DEPTH_BIT and " + "VK_IMAGE_ASPECT_STENCIL_BIT set.", + func_name); } else if ((aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) != aspect_mask) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image), __LINE__, VALIDATION_ERROR_0a400c01, "IMAGE", + HandleToUint64(image), VALIDATION_ERROR_0a400c01, "%s: Combination depth/stencil image formats can have only the VK_IMAGE_ASPECT_DEPTH_BIT and " - "VK_IMAGE_ASPECT_STENCIL_BIT set. %s", - func_name, validation_error_map[VALIDATION_ERROR_0a400c01]); + "VK_IMAGE_ASPECT_STENCIL_BIT set.", + func_name); } } else if (FormatIsDepthOnly(format)) { if ((aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT) != VK_IMAGE_ASPECT_DEPTH_BIT) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image), __LINE__, VALIDATION_ERROR_0a400c01, "IMAGE", - "%s: Depth-only image formats must have the VK_IMAGE_ASPECT_DEPTH_BIT set. %s", func_name, - validation_error_map[VALIDATION_ERROR_0a400c01]); + HandleToUint64(image), VALIDATION_ERROR_0a400c01, + "%s: Depth-only image formats must have the VK_IMAGE_ASPECT_DEPTH_BIT set.", func_name); } else if ((aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT) != aspect_mask) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image), __LINE__, VALIDATION_ERROR_0a400c01, "IMAGE", - "%s: Depth-only image formats can have only the VK_IMAGE_ASPECT_DEPTH_BIT set. %s", func_name, - validation_error_map[VALIDATION_ERROR_0a400c01]); + HandleToUint64(image), VALIDATION_ERROR_0a400c01, + "%s: Depth-only image formats can have only the VK_IMAGE_ASPECT_DEPTH_BIT set.", func_name); } } else if (FormatIsStencilOnly(format)) { if ((aspect_mask & VK_IMAGE_ASPECT_STENCIL_BIT) != VK_IMAGE_ASPECT_STENCIL_BIT) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image), __LINE__, VALIDATION_ERROR_0a400c01, "IMAGE", - "%s: Stencil-only image formats must have the VK_IMAGE_ASPECT_STENCIL_BIT set. %s", func_name, - validation_error_map[VALIDATION_ERROR_0a400c01]); + HandleToUint64(image), VALIDATION_ERROR_0a400c01, + "%s: Stencil-only image formats must have the VK_IMAGE_ASPECT_STENCIL_BIT set.", func_name); } else if ((aspect_mask & VK_IMAGE_ASPECT_STENCIL_BIT) != aspect_mask) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image), __LINE__, VALIDATION_ERROR_0a400c01, "IMAGE", - "%s: Stencil-only image formats can have only the VK_IMAGE_ASPECT_STENCIL_BIT set. %s", func_name, - validation_error_map[VALIDATION_ERROR_0a400c01]); + HandleToUint64(image), VALIDATION_ERROR_0a400c01, + "%s: Stencil-only image formats can have only the VK_IMAGE_ASPECT_STENCIL_BIT set.", func_name); + } + } else if (FormatIsMultiplane(format)) { + VkImageAspectFlags valid_flags = VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_PLANE_0_BIT | VK_IMAGE_ASPECT_PLANE_1_BIT; + if (3 == FormatPlaneCount(format)) { + valid_flags = valid_flags | VK_IMAGE_ASPECT_PLANE_2_BIT; + } + if ((aspect_mask & valid_flags) != aspect_mask) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(image), VALIDATION_ERROR_0a400c01, + "%s: Multi-plane image formats may have only VK_IMAGE_ASPECT_COLOR_BIT or VK_IMAGE_ASPECT_PLANE_n_BITs " + "set, where n = [0, 1, 2].", + func_name); } } return skip; @@ -3138,61 +3209,55 @@ // Validate mip levels if (subresourceRange.baseMipLevel >= image_mip_count) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, image_handle, __LINE__, - errorCodes.base_mip_err, "IMAGE", + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, image_handle, + errorCodes.base_mip_err, "%s: %s.baseMipLevel (= %" PRIu32 - ") is greater or equal to the mip level count of the image (i.e. greater or equal to %" PRIu32 "). %s", - cmd_name, param_name, subresourceRange.baseMipLevel, image_mip_count, - validation_error_map[errorCodes.base_mip_err]); + ") is greater or equal to the mip level count of the image (i.e. greater or equal to %" PRIu32 ").", + cmd_name, param_name, subresourceRange.baseMipLevel, image_mip_count); } if (subresourceRange.levelCount != VK_REMAINING_MIP_LEVELS) { if (subresourceRange.levelCount == 0) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, image_handle, - __LINE__, errorCodes.mip_count_err, "IMAGE", "%s: %s.levelCount is 0. %s", cmd_name, param_name, - validation_error_map[errorCodes.mip_count_err]); + errorCodes.mip_count_err, "%s: %s.levelCount is 0.", cmd_name, param_name); } else { const uint64_t necessary_mip_count = uint64_t{subresourceRange.baseMipLevel} + uint64_t{subresourceRange.levelCount}; if (necessary_mip_count > image_mip_count) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, image_handle, - __LINE__, errorCodes.mip_count_err, "IMAGE", + errorCodes.mip_count_err, "%s: %s.baseMipLevel + .levelCount (= %" PRIu32 " + %" PRIu32 " = %" PRIu64 - ") is greater than the mip level count of the image (i.e. greater than %" PRIu32 "). %s", + ") is greater than the mip level count of the image (i.e. greater than %" PRIu32 ").", cmd_name, param_name, subresourceRange.baseMipLevel, subresourceRange.levelCount, - necessary_mip_count, image_mip_count, validation_error_map[errorCodes.mip_count_err]); + necessary_mip_count, image_mip_count); } } } // Validate array layers if (subresourceRange.baseArrayLayer >= image_layer_count) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, image_handle, __LINE__, - errorCodes.base_layer_err, "IMAGE", - "%s: %s.baseArrayLayer (= %" PRIu32 - ") is greater or equal to the %s of the image when it was created (i.e. greater or equal to %" PRIu32 "). %s", - cmd_name, param_name, subresourceRange.baseArrayLayer, image_layer_count_var_name, image_layer_count, - validation_error_map[errorCodes.base_layer_err]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, image_handle, + errorCodes.base_layer_err, + "%s: %s.baseArrayLayer (= %" PRIu32 + ") is greater or equal to the %s of the image when it was created (i.e. greater or equal to %" PRIu32 ").", + cmd_name, param_name, subresourceRange.baseArrayLayer, image_layer_count_var_name, image_layer_count); } if (subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS) { if (subresourceRange.layerCount == 0) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, image_handle, - __LINE__, errorCodes.layer_count_err, "IMAGE", "%s: %s.layerCount is 0. %s", cmd_name, param_name, - validation_error_map[errorCodes.layer_count_err]); + errorCodes.layer_count_err, "%s: %s.layerCount is 0.", cmd_name, param_name); } else { const uint64_t necessary_layer_count = uint64_t{subresourceRange.baseArrayLayer} + uint64_t{subresourceRange.layerCount}; if (necessary_layer_count > image_layer_count) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, image_handle, - __LINE__, errorCodes.layer_count_err, "IMAGE", + errorCodes.layer_count_err, "%s: %s.baseArrayLayer + .layerCount (= %" PRIu32 " + %" PRIu32 " = %" PRIu64 - ") is greater than the %s of the image when it was created (i.e. greater than %" PRIu32 "). %s", + ") is greater than the %s of the image when it was created (i.e. greater than %" PRIu32 ").", cmd_name, param_name, subresourceRange.baseArrayLayer, subresourceRange.layerCount, - necessary_layer_count, image_layer_count_var_name, image_layer_count, - validation_error_map[errorCodes.layer_count_err]); + necessary_layer_count, image_layer_count_var_name, image_layer_count); } } } @@ -3212,11 +3277,11 @@ SubresourceRangeErrorCodes subresourceRangeErrorCodes = {}; subresourceRangeErrorCodes.base_mip_err = VALIDATION_ERROR_0ac00b8c; - subresourceRangeErrorCodes.mip_count_err = VALIDATION_ERROR_0ac00b8e; + subresourceRangeErrorCodes.mip_count_err = VALIDATION_ERROR_0ac00d6c; subresourceRangeErrorCodes.base_layer_err = is_khr_maintenance1 ? (is_3D_to_2D_map ? VALIDATION_ERROR_0ac00b98 : VALIDATION_ERROR_0ac00b94) : VALIDATION_ERROR_0ac00b90; subresourceRangeErrorCodes.layer_count_err = - is_khr_maintenance1 ? (is_3D_to_2D_map ? VALIDATION_ERROR_0ac00b9a : VALIDATION_ERROR_0ac00b96) : VALIDATION_ERROR_0ac00b92; + is_khr_maintenance1 ? (is_3D_to_2D_map ? VALIDATION_ERROR_0ac00b9a : VALIDATION_ERROR_0ac00b96) : VALIDATION_ERROR_0ac00d6e; return ValidateImageSubresourceRange(device_data, image_state->createInfo.mipLevels, image_layer_count, subresourceRange, "vkCreateImageView", "pCreateInfo->subresourceRange", image_layer_count_var_name, @@ -3227,9 +3292,9 @@ const VkImageSubresourceRange &subresourceRange, const char *param_name) { SubresourceRangeErrorCodes subresourceRangeErrorCodes = {}; subresourceRangeErrorCodes.base_mip_err = VALIDATION_ERROR_18800b7c; - subresourceRangeErrorCodes.mip_count_err = VALIDATION_ERROR_18800b7e; + subresourceRangeErrorCodes.mip_count_err = VALIDATION_ERROR_18800d38; subresourceRangeErrorCodes.base_layer_err = VALIDATION_ERROR_18800b80; - subresourceRangeErrorCodes.layer_count_err = VALIDATION_ERROR_18800b82; + subresourceRangeErrorCodes.layer_count_err = VALIDATION_ERROR_18800d3a; return ValidateImageSubresourceRange(device_data, image_state->createInfo.mipLevels, image_state->createInfo.arrayLayers, subresourceRange, "vkCmdClearColorImage", param_name, "arrayLayers", @@ -3240,9 +3305,9 @@ const VkImageSubresourceRange &subresourceRange, const char *param_name) { SubresourceRangeErrorCodes subresourceRangeErrorCodes = {}; subresourceRangeErrorCodes.base_mip_err = VALIDATION_ERROR_18a00b84; - subresourceRangeErrorCodes.mip_count_err = VALIDATION_ERROR_18a00b86; + subresourceRangeErrorCodes.mip_count_err = VALIDATION_ERROR_18a00d3c; subresourceRangeErrorCodes.base_layer_err = VALIDATION_ERROR_18a00b88; - subresourceRangeErrorCodes.layer_count_err = VALIDATION_ERROR_18a00b8a; + subresourceRangeErrorCodes.layer_count_err = VALIDATION_ERROR_18a00d3e; return ValidateImageSubresourceRange(device_data, image_state->createInfo.mipLevels, image_state->createInfo.arrayLayers, subresourceRange, "vkCmdClearDepthStencilImage", param_name, "arrayLayers", @@ -3254,9 +3319,9 @@ const char *param_name) { SubresourceRangeErrorCodes subresourceRangeErrorCodes = {}; subresourceRangeErrorCodes.base_mip_err = VALIDATION_ERROR_0a000b9c; - subresourceRangeErrorCodes.mip_count_err = VALIDATION_ERROR_0a000b9e; + subresourceRangeErrorCodes.mip_count_err = VALIDATION_ERROR_0a000d78; subresourceRangeErrorCodes.base_layer_err = VALIDATION_ERROR_0a000ba0; - subresourceRangeErrorCodes.layer_count_err = VALIDATION_ERROR_0a000ba2; + subresourceRangeErrorCodes.layer_count_err = VALIDATION_ERROR_0a000d7a; return ValidateImageSubresourceRange(device_data, image_state->createInfo.mipLevels, image_state->createInfo.arrayLayers, subresourceRange, cmd_name, param_name, "arrayLayers", HandleToUint64(image_state->image), @@ -3271,7 +3336,7 @@ skip |= ValidateImageUsageFlags( device_data, image_state, VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT | - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, + VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, false, -1, "vkCreateImageView()", "VK_IMAGE_USAGE_[SAMPLED|STORAGE|COLOR_ATTACHMENT|DEPTH_STENCIL_ATTACHMENT|INPUT_ATTACHMENT]_BIT"); // If this isn't a sparse image, it needs to have memory backing it at CreateImageView time @@ -3291,6 +3356,21 @@ VkImageType image_type = image_state->createInfo.imageType; VkImageViewType view_type = create_info->viewType; + // If there's a chained VkImageViewUsageCreateInfo struct, modify image_usage to match + auto chained_ivuci_struct = lvl_find_in_chain(create_info->pNext); + if (chained_ivuci_struct) { + if (chained_ivuci_struct->usage & ~image_usage) { + std::stringstream ss; + ss << "vkCreateImageView(): Chained VkImageViewUsageCreateInfo usage field (0x" << std::hex + << chained_ivuci_struct->usage << ") must not include flags not present in underlying image's usage (0x" + << image_usage << ")."; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_3f200c66, "%s", ss.str().c_str()); + } + + image_usage = chained_ivuci_struct->usage; + } + // Validate VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT state if (image_flags & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) { if ((!GetDeviceExtensions(device_data)->vk_khr_maintenance2 || @@ -3304,8 +3384,7 @@ << ". Images created with the VK_IMAGE_CREATE_MUTABLE_FORMAT BIT " << "can support ImageViews with differing formats but they must be in the same compatibility class."; skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_0ac007f4, "IMAGE", "%s %s", ss.str().c_str(), - validation_error_map[VALIDATION_ERROR_0ac007f4]); + VALIDATION_ERROR_0ac007f4, "%s", ss.str().c_str()); } } } else { @@ -3315,9 +3394,8 @@ ss << "vkCreateImageView() format " << string_VkFormat(view_format) << " differs from image " << HandleToUint64(create_info->image) << " format " << string_VkFormat(image_format) << ". Formats MUST be IDENTICAL unless VK_IMAGE_CREATE_MUTABLE_FORMAT BIT was set on image creation."; - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_0ac007f6, "IMAGE", "%s %s", ss.str().c_str(), - validation_error_map[VALIDATION_ERROR_0ac007f6]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0ac007f6, "%s", ss.str().c_str()); } } @@ -3328,10 +3406,9 @@ case VK_IMAGE_TYPE_1D: if (view_type != VK_IMAGE_VIEW_TYPE_1D && view_type != VK_IMAGE_VIEW_TYPE_1D_ARRAY) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_0ac007fa, "IMAGE", - "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s. %s", - string_VkImageViewType(view_type), string_VkImageType(image_type), - validation_error_map[VALIDATION_ERROR_0ac007fa]); + VALIDATION_ERROR_0ac007fa, + "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s.", + string_VkImageViewType(view_type), string_VkImageType(image_type)); } break; case VK_IMAGE_TYPE_2D: @@ -3339,16 +3416,14 @@ if ((view_type == VK_IMAGE_VIEW_TYPE_CUBE || view_type == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY) && !(image_flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_0ac007d6, "IMAGE", - "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s. %s", - string_VkImageViewType(view_type), string_VkImageType(image_type), - validation_error_map[VALIDATION_ERROR_0ac007d6]); + VALIDATION_ERROR_0ac007d6, + "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s.", + string_VkImageViewType(view_type), string_VkImageType(image_type)); } else if (view_type != VK_IMAGE_VIEW_TYPE_CUBE && view_type != VK_IMAGE_VIEW_TYPE_CUBE_ARRAY) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_0ac007fa, "IMAGE", - "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s. %s", - string_VkImageViewType(view_type), string_VkImageType(image_type), - validation_error_map[VALIDATION_ERROR_0ac007fa]); + VALIDATION_ERROR_0ac007fa, + "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s.", + string_VkImageViewType(view_type), string_VkImageType(image_type)); } } break; @@ -3357,39 +3432,34 @@ if (view_type != VK_IMAGE_VIEW_TYPE_3D) { if ((view_type == VK_IMAGE_VIEW_TYPE_2D || view_type == VK_IMAGE_VIEW_TYPE_2D_ARRAY)) { if (!(image_flags & VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR)) { - skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_0ac007da, "IMAGE", - "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s. %s", - string_VkImageViewType(view_type), string_VkImageType(image_type), - validation_error_map[VALIDATION_ERROR_0ac007da]); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0ac007da, + "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s.", + string_VkImageViewType(view_type), string_VkImageType(image_type)); } else if ((image_flags & (VK_IMAGE_CREATE_SPARSE_BINDING_BIT | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT))) { - skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_0ac007fa, "IMAGE", - "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s when the " - "VK_IMAGE_CREATE_SPARSE_BINDING_BIT, VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, or " - "VK_IMAGE_CREATE_SPARSE_ALIASED_BIT flags are enabled. %s", - string_VkImageViewType(view_type), string_VkImageType(image_type), - validation_error_map[VALIDATION_ERROR_0ac007fa]); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0ac007fa, + "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s " + "when the VK_IMAGE_CREATE_SPARSE_BINDING_BIT, VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, or " + "VK_IMAGE_CREATE_SPARSE_ALIASED_BIT flags are enabled.", + string_VkImageViewType(view_type), string_VkImageType(image_type)); } } else { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_0ac007fa, "IMAGE", - "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s. %s", - string_VkImageViewType(view_type), string_VkImageType(image_type), - validation_error_map[VALIDATION_ERROR_0ac007fa]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0ac007fa, + "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s.", + string_VkImageViewType(view_type), string_VkImageType(image_type)); } } } else { if (view_type != VK_IMAGE_VIEW_TYPE_3D) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_0ac007fa, "IMAGE", - "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s. %s", - string_VkImageViewType(view_type), string_VkImageType(image_type), - validation_error_map[VALIDATION_ERROR_0ac007fa]); + VALIDATION_ERROR_0ac007fa, + "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s.", + string_VkImageViewType(view_type), string_VkImageType(image_type)); } } break; @@ -3422,41 +3492,35 @@ if (check_tiling_features) { if (tiling_features == 0) { skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - error_codes[0], "IMAGE", - "vkCreateImageView() pCreateInfo->format %s cannot be used with an image having the " - "%s flag set. %s", - string_VkFormat(view_format), string_VkImageTiling(image_tiling), validation_error_map[error_codes[0]]); + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, error_codes[0], + "vkCreateImageView() pCreateInfo->format %s cannot be used with an image having the %s flag set.", + string_VkFormat(view_format), string_VkImageTiling(image_tiling)); } else if ((image_usage & VK_IMAGE_USAGE_SAMPLED_BIT) && !(tiling_features & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT)) { skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - error_codes[1], "IMAGE", - "vkCreateImageView() pCreateInfo->format %s cannot be used with an image having the " - "%s and VK_IMAGE_USAGE_SAMPLED_BIT flags set. %s", - string_VkFormat(view_format), string_VkImageTiling(image_tiling), validation_error_map[error_codes[1]]); + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, error_codes[1], + "vkCreateImageView() pCreateInfo->format %s cannot be used with an image having the %s and " + "VK_IMAGE_USAGE_SAMPLED_BIT flags set.", + string_VkFormat(view_format), string_VkImageTiling(image_tiling)); } else if ((image_usage & VK_IMAGE_USAGE_STORAGE_BIT) && !(tiling_features & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT)) { skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - error_codes[2], "IMAGE", - "vkCreateImageView() pCreateInfo->format %s cannot be used with an image having the " - "%s and VK_IMAGE_USAGE_STORAGE_BIT flags set. %s", - string_VkFormat(view_format), string_VkImageTiling(image_tiling), validation_error_map[error_codes[2]]); + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, error_codes[2], + "vkCreateImageView() pCreateInfo->format %s cannot be used with an image having the %s and " + "VK_IMAGE_USAGE_STORAGE_BIT flags set.", + string_VkFormat(view_format), string_VkImageTiling(image_tiling)); } else if ((image_usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) && !(tiling_features & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT)) { skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - error_codes[3], "IMAGE", - "vkCreateImageView() pCreateInfo->format %s cannot be used with an image having the " - "%s and VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT flags set. %s", - string_VkFormat(view_format), string_VkImageTiling(image_tiling), validation_error_map[error_codes[3]]); + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, error_codes[3], + "vkCreateImageView() pCreateInfo->format %s cannot be used with an image having the %s and " + "VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT flags set.", + string_VkFormat(view_format), string_VkImageTiling(image_tiling)); } else if ((image_usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) && !(tiling_features & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT)) { skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - error_codes[4], "IMAGE", - "vkCreateImageView() pCreateInfo->format %s cannot be used with an image having the " - "%s and VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT flags set. %s", - string_VkFormat(view_format), string_VkImageTiling(image_tiling), validation_error_map[error_codes[4]]); + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, error_codes[4], + "vkCreateImageView() pCreateInfo->format %s cannot be used with an image having the %s and " + "VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT flags set.", + string_VkFormat(view_format), string_VkImageTiling(image_tiling)); } } } @@ -3513,14 +3577,13 @@ auto buffer_state = GetBufferState(device_data, buffer); if (!buffer_state) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, HandleToUint64(buffer), - __LINE__, DRAWSTATE_DOUBLE_DESTROY, "DS", - "Cannot free buffer 0x%" PRIxLEAST64 " that has not been allocated.", HandleToUint64(buffer)); + DRAWSTATE_DOUBLE_DESTROY, "Cannot free buffer 0x%" PRIx64 " that has not been allocated.", + HandleToUint64(buffer)); } else { if (buffer_state->in_use.load()) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, - HandleToUint64(buffer), __LINE__, VALIDATION_ERROR_23c00734, "DS", - "Cannot free buffer 0x%" PRIxLEAST64 " that is in use by a command buffer. %s", HandleToUint64(buffer), - validation_error_map[VALIDATION_ERROR_23c00734]); + HandleToUint64(buffer), VALIDATION_ERROR_23c00734, + "Cannot free buffer 0x%" PRIx64 " that is in use by a command buffer.", HandleToUint64(buffer)); } } return skip; @@ -3620,33 +3683,30 @@ if (image_state->createInfo.imageType == VK_IMAGE_TYPE_1D) { if ((pRegions[i].imageOffset.y != 0) || (pRegions[i].imageExtent.height != 1)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_0160018e, "IMAGE", - "%s(): pRegion[%d] imageOffset.y is %d and imageExtent.height is %d. For 1D images these " - "must be 0 and 1, respectively. %s", - function, i, pRegions[i].imageOffset.y, pRegions[i].imageExtent.height, - validation_error_map[VALIDATION_ERROR_0160018e]); + HandleToUint64(image_state->image), VALIDATION_ERROR_0160018e, + "%s(): pRegion[%d] imageOffset.y is %d and imageExtent.height is %d. For 1D images these must be 0 " + "and 1, respectively.", + function, i, pRegions[i].imageOffset.y, pRegions[i].imageExtent.height); } } if ((image_state->createInfo.imageType == VK_IMAGE_TYPE_1D) || (image_state->createInfo.imageType == VK_IMAGE_TYPE_2D)) { if ((pRegions[i].imageOffset.z != 0) || (pRegions[i].imageExtent.depth != 1)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_01600192, "IMAGE", + HandleToUint64(image_state->image), VALIDATION_ERROR_01600192, "%s(): pRegion[%d] imageOffset.z is %d and imageExtent.depth is %d. For 1D and 2D images these " - "must be 0 and 1, respectively. %s", - function, i, pRegions[i].imageOffset.z, pRegions[i].imageExtent.depth, - validation_error_map[VALIDATION_ERROR_01600192]); + "must be 0 and 1, respectively.", + function, i, pRegions[i].imageOffset.z, pRegions[i].imageExtent.depth); } } if (image_state->createInfo.imageType == VK_IMAGE_TYPE_3D) { if ((0 != pRegions[i].imageSubresource.baseArrayLayer) || (1 != pRegions[i].imageSubresource.layerCount)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_016001aa, "IMAGE", - "%s(): pRegion[%d] imageSubresource.baseArrayLayer is %d and imageSubresource.layerCount is " - "%d. For 3D images these must be 0 and 1, respectively. %s", - function, i, pRegions[i].imageSubresource.baseArrayLayer, pRegions[i].imageSubresource.layerCount, - validation_error_map[VALIDATION_ERROR_016001aa]); + HandleToUint64(image_state->image), VALIDATION_ERROR_016001aa, + "%s(): pRegion[%d] imageSubresource.baseArrayLayer is %d and imageSubresource.layerCount is %d. " + "For 3D images these must be 0 and 1, respectively.", + function, i, pRegions[i].imageSubresource.baseArrayLayer, pRegions[i].imageSubresource.layerCount); } } @@ -3655,38 +3715,36 @@ auto texel_size = FormatSize(image_state->createInfo.format); if (!FormatIsDepthAndStencil(image_state->createInfo.format) && SafeModulo(pRegions[i].bufferOffset, texel_size) != 0) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_01600182, "IMAGE", + HandleToUint64(image_state->image), VALIDATION_ERROR_01600182, "%s(): pRegion[%d] bufferOffset 0x%" PRIxLEAST64 - " must be a multiple of this format's texel size (" PRINTF_SIZE_T_SPECIFIER "). %s", - function, i, pRegions[i].bufferOffset, texel_size, validation_error_map[VALIDATION_ERROR_01600182]); + " must be a multiple of this format's texel size (" PRINTF_SIZE_T_SPECIFIER ").", + function, i, pRegions[i].bufferOffset, texel_size); } // BufferOffset must be a multiple of 4 if (SafeModulo(pRegions[i].bufferOffset, 4) != 0) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_01600184, "IMAGE", - "%s(): pRegion[%d] bufferOffset 0x%" PRIxLEAST64 " must be a multiple of 4. %s", function, i, - pRegions[i].bufferOffset, validation_error_map[VALIDATION_ERROR_01600184]); + HandleToUint64(image_state->image), VALIDATION_ERROR_01600184, + "%s(): pRegion[%d] bufferOffset 0x%" PRIxLEAST64 " must be a multiple of 4.", function, i, + pRegions[i].bufferOffset); } // BufferRowLength must be 0, or greater than or equal to the width member of imageExtent if ((pRegions[i].bufferRowLength != 0) && (pRegions[i].bufferRowLength < pRegions[i].imageExtent.width)) { - skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_01600186, "IMAGE", - "%s(): pRegion[%d] bufferRowLength (%d) must be zero or greater-than-or-equal-to imageExtent.width (%d). %s", - function, i, pRegions[i].bufferRowLength, pRegions[i].imageExtent.width, - validation_error_map[VALIDATION_ERROR_01600186]); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(image_state->image), VALIDATION_ERROR_01600186, + "%s(): pRegion[%d] bufferRowLength (%d) must be zero or greater-than-or-equal-to imageExtent.width (%d).", + function, i, pRegions[i].bufferRowLength, pRegions[i].imageExtent.width); } // BufferImageHeight must be 0, or greater than or equal to the height member of imageExtent if ((pRegions[i].bufferImageHeight != 0) && (pRegions[i].bufferImageHeight < pRegions[i].imageExtent.height)) { skip |= log_msg( report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_01600188, "IMAGE", - "%s(): pRegion[%d] bufferImageHeight (%d) must be zero or greater-than-or-equal-to imageExtent.height (%d). %s", - function, i, pRegions[i].bufferImageHeight, pRegions[i].imageExtent.height, - validation_error_map[VALIDATION_ERROR_01600188]); + HandleToUint64(image_state->image), VALIDATION_ERROR_01600188, + "%s(): pRegion[%d] bufferImageHeight (%d) must be zero or greater-than-or-equal-to imageExtent.height (%d).", + function, i, pRegions[i].bufferImageHeight, pRegions[i].imageExtent.height); } // subresource aspectMask must have exactly 1 bit set @@ -3694,19 +3752,17 @@ std::bitset aspect_mask_bits(pRegions[i].imageSubresource.aspectMask); if (aspect_mask_bits.count() != 1) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_016001a8, "IMAGE", - "%s: aspectMasks for imageSubresource in each region must have only a single bit set. %s", function, - validation_error_map[VALIDATION_ERROR_016001a8]); + HandleToUint64(image_state->image), VALIDATION_ERROR_016001a8, + "%s: aspectMasks for imageSubresource in each region must have only a single bit set.", function); } // image subresource aspect bit must match format if (!VerifyAspectsPresent(pRegions[i].imageSubresource.aspectMask, image_state->createInfo.format)) { skip |= log_msg( report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_016001a6, "IMAGE", - "%s(): pRegion[%d] subresource aspectMask 0x%x specifies aspects that are not present in image format 0x%x. %s", - function, i, pRegions[i].imageSubresource.aspectMask, image_state->createInfo.format, - validation_error_map[VALIDATION_ERROR_016001a6]); + HandleToUint64(image_state->image), VALIDATION_ERROR_016001a6, + "%s(): pRegion[%d] subresource aspectMask 0x%x specifies aspects that are not present in image format 0x%x.", + function, i, pRegions[i].imageSubresource.aspectMask, image_state->createInfo.format); } // Checks that apply only to compressed images @@ -3720,43 +3776,40 @@ if (SafeModulo(pRegions[i].bufferRowLength, block_size.width) != 0) { skip |= log_msg( report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_01600196, "IMAGE", - "%s(): pRegion[%d] bufferRowLength (%d) must be a multiple of the compressed image's texel width (%d). %s.", - function, i, pRegions[i].bufferRowLength, block_size.width, validation_error_map[VALIDATION_ERROR_01600196]); + HandleToUint64(image_state->image), VALIDATION_ERROR_01600196, + "%s(): pRegion[%d] bufferRowLength (%d) must be a multiple of the compressed image's texel width (%d)..", + function, i, pRegions[i].bufferRowLength, block_size.width); } // BufferRowHeight must be a multiple of block height if (SafeModulo(pRegions[i].bufferImageHeight, block_size.height) != 0) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_01600198, "IMAGE", - "%s(): pRegion[%d] bufferImageHeight (%d) must be a multiple of the compressed image's texel " - "height (%d). %s.", - function, i, pRegions[i].bufferImageHeight, block_size.height, - validation_error_map[VALIDATION_ERROR_01600198]); + skip |= log_msg( + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(image_state->image), VALIDATION_ERROR_01600198, + "%s(): pRegion[%d] bufferImageHeight (%d) must be a multiple of the compressed image's texel height (%d)..", + function, i, pRegions[i].bufferImageHeight, block_size.height); } // image offsets must be multiples of block dimensions if ((SafeModulo(pRegions[i].imageOffset.x, block_size.width) != 0) || (SafeModulo(pRegions[i].imageOffset.y, block_size.height) != 0) || (SafeModulo(pRegions[i].imageOffset.z, block_size.depth) != 0)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_0160019a, "IMAGE", - "%s(): pRegion[%d] imageOffset(x,y) (%d, %d) must be multiples of the compressed image's texel " - "width & height (%d, %d). %s.", - function, i, pRegions[i].imageOffset.x, pRegions[i].imageOffset.y, block_size.width, - block_size.height, validation_error_map[VALIDATION_ERROR_0160019a]); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(image_state->image), VALIDATION_ERROR_0160019a, + "%s(): pRegion[%d] imageOffset(x,y) (%d, %d) must be multiples of the compressed image's texel " + "width & height (%d, %d)..", + function, i, pRegions[i].imageOffset.x, pRegions[i].imageOffset.y, block_size.width, block_size.height); } // bufferOffset must be a multiple of block size (linear bytes) size_t block_size_in_bytes = FormatSize(image_state->createInfo.format); if (SafeModulo(pRegions[i].bufferOffset, block_size_in_bytes) != 0) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_0160019c, "IMAGE", + HandleToUint64(image_state->image), VALIDATION_ERROR_0160019c, "%s(): pRegion[%d] bufferOffset (0x%" PRIxLEAST64 - ") must be a multiple of the compressed image's texel block " - "size (" PRINTF_SIZE_T_SPECIFIER "). %s.", - function, i, pRegions[i].bufferOffset, block_size_in_bytes, - validation_error_map[VALIDATION_ERROR_0160019c]); + ") must be a multiple of the compressed image's texel block size (" PRINTF_SIZE_T_SPECIFIER ")..", + function, i, pRegions[i].bufferOffset, block_size_in_bytes); } // imageExtent width must be a multiple of block width, or extent+offset width must equal subresource width @@ -3764,33 +3817,33 @@ if ((SafeModulo(pRegions[i].imageExtent.width, block_size.width) != 0) && (pRegions[i].imageExtent.width + pRegions[i].imageOffset.x != mip_extent.width)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_0160019e, "IMAGE", + HandleToUint64(image_state->image), VALIDATION_ERROR_0160019e, "%s(): pRegion[%d] extent width (%d) must be a multiple of the compressed texture block width " - "(%d), or when added to offset.x (%d) must equal the image subresource width (%d). %s.", + "(%d), or when added to offset.x (%d) must equal the image subresource width (%d)..", function, i, pRegions[i].imageExtent.width, block_size.width, pRegions[i].imageOffset.x, - mip_extent.width, validation_error_map[VALIDATION_ERROR_0160019e]); + mip_extent.width); } // imageExtent height must be a multiple of block height, or extent+offset height must equal subresource height if ((SafeModulo(pRegions[i].imageExtent.height, block_size.height) != 0) && (pRegions[i].imageExtent.height + pRegions[i].imageOffset.y != mip_extent.height)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_016001a0, "IMAGE", + HandleToUint64(image_state->image), VALIDATION_ERROR_016001a0, "%s(): pRegion[%d] extent height (%d) must be a multiple of the compressed texture block height " - "(%d), or when added to offset.y (%d) must equal the image subresource height (%d). %s.", + "(%d), or when added to offset.y (%d) must equal the image subresource height (%d)..", function, i, pRegions[i].imageExtent.height, block_size.height, pRegions[i].imageOffset.y, - mip_extent.height, validation_error_map[VALIDATION_ERROR_016001a0]); + mip_extent.height); } // imageExtent depth must be a multiple of block depth, or extent+offset depth must equal subresource depth if ((SafeModulo(pRegions[i].imageExtent.depth, block_size.depth) != 0) && (pRegions[i].imageExtent.depth + pRegions[i].imageOffset.z != mip_extent.depth)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), __LINE__, VALIDATION_ERROR_016001a2, "IMAGE", + HandleToUint64(image_state->image), VALIDATION_ERROR_016001a2, "%s(): pRegion[%d] extent width (%d) must be a multiple of the compressed texture block depth " - "(%d), or when added to offset.z (%d) must equal the image subresource depth (%d). %s.", + "(%d), or when added to offset.z (%d) must equal the image subresource depth (%d)..", function, i, pRegions[i].imageExtent.depth, block_size.depth, pRegions[i].imageOffset.z, - mip_extent.depth, validation_error_map[VALIDATION_ERROR_016001a2]); + mip_extent.depth); } } } @@ -3810,9 +3863,8 @@ if (IsExtentSizeZero(&extent)) // Warn on zero area subresource { skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - (uint64_t)0, __LINE__, IMAGE_ZERO_AREA_SUBREGION, "IMAGE", - "%s: pRegion[%d] imageExtent of {%1d, %1d, %1d} has zero area", func_name, i, extent.width, - extent.height, extent.depth); + (uint64_t)0, IMAGE_ZERO_AREA_SUBREGION, "%s: pRegion[%d] imageExtent of {%1d, %1d, %1d} has zero area", + func_name, i, extent.width, extent.height, extent.depth); } VkExtent3D image_extent = GetImageSubresourceExtent(image_state, &(pRegions[i].imageSubresource)); @@ -3833,8 +3885,7 @@ if (0 != ExceedsBounds(&offset, &extent, &image_extent)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, (uint64_t)0, - __LINE__, msg_code, "IMAGE", "%s: pRegion[%d] exceeds image bounds. %s.", func_name, i, - validation_error_map[msg_code]); + msg_code, "%s: pRegion[%d] exceeds image bounds..", func_name, i); } } @@ -3900,8 +3951,7 @@ if (buffer_size < max_buffer_offset) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, (uint64_t)0, - __LINE__, msg_code, "IMAGE", "%s: pRegion[%d] exceeds buffer size of %" PRIu64 " bytes. %s.", func_name, - i, buffer_size, validation_error_map[msg_code]); + msg_code, "%s: pRegion[%d] exceeds buffer size of %" PRIu64 " bytes..", func_name, i, buffer_size); } } } @@ -3916,14 +3966,7 @@ bool skip = ValidateBufferImageCopyData(report_data, regionCount, pRegions, src_image_state, "vkCmdCopyImageToBuffer"); // Validate command buffer state - if (CB_RECORDING != cb_node->state) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_19202413, "DS", - "Cannot call vkCmdCopyImageToBuffer() on command buffer which is not in recording state. %s.", - validation_error_map[VALIDATION_ERROR_19202413]); - } else { - skip |= ValidateCmdSubpassState(device_data, cb_node, CMD_COPYIMAGETOBUFFER); - } + skip |= ValidateCmd(device_data, cb_node, CMD_COPYIMAGETOBUFFER, "vkCmdCopyImageToBuffer()"); // Command pool must support graphics, compute, or transfer operations auto pPool = GetCommandPoolNode(device_data, cb_node->createInfo.commandPool); @@ -3931,12 +3974,11 @@ VkQueueFlags queue_flags = GetPhysDevProperties(device_data)->queue_family_properties[pPool->queueFamilyIndex].queueFlags; if (0 == (queue_flags & (VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT))) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->createInfo.commandPool), __LINE__, VALIDATION_ERROR_19202415, "DS", + HandleToUint64(cb_node->createInfo.commandPool), VALIDATION_ERROR_19202415, "Cannot call vkCmdCopyImageToBuffer() on a command buffer allocated from a pool without graphics, compute, " - "or transfer capabilities. %s.", - validation_error_map[VALIDATION_ERROR_19202415]); + "or transfer capabilities.."); } - skip |= ValidateImageBounds(report_data, src_image_state, regionCount, pRegions, "vkCmdCopyBufferToImage()", + skip |= ValidateImageBounds(report_data, src_image_state, regionCount, pRegions, "vkCmdCopyImageToBuffer()", VALIDATION_ERROR_1920016c); skip |= ValidateBufferBounds(report_data, src_image_state, dst_buffer_state, regionCount, pRegions, "vkCmdCopyImageToBuffer()", VALIDATION_ERROR_1920016e); @@ -3992,24 +4034,16 @@ bool skip = ValidateBufferImageCopyData(report_data, regionCount, pRegions, dst_image_state, "vkCmdCopyBufferToImage"); // Validate command buffer state - if (CB_RECORDING != cb_node->state) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_18e02413, "DS", - "Cannot call vkCmdCopyBufferToImage() on command buffer which is not in recording state. %s.", - validation_error_map[VALIDATION_ERROR_18e02413]); - } else { - skip |= ValidateCmdSubpassState(device_data, cb_node, CMD_COPYBUFFERTOIMAGE); - } + skip |= ValidateCmd(device_data, cb_node, CMD_COPYBUFFERTOIMAGE, "vkCmdCopyBufferToImage()"); // Command pool must support graphics, compute, or transfer operations auto pPool = GetCommandPoolNode(device_data, cb_node->createInfo.commandPool); VkQueueFlags queue_flags = GetPhysDevProperties(device_data)->queue_family_properties[pPool->queueFamilyIndex].queueFlags; if (0 == (queue_flags & (VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT))) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->createInfo.commandPool), __LINE__, VALIDATION_ERROR_18e02415, "DS", + HandleToUint64(cb_node->createInfo.commandPool), VALIDATION_ERROR_18e02415, "Cannot call vkCmdCopyBufferToImage() on a command buffer allocated from a pool without graphics, compute, " - "or transfer capabilities. %s.", - validation_error_map[VALIDATION_ERROR_18e02415]); + "or transfer capabilities.."); } skip |= ValidateImageBounds(report_data, dst_image_state, regionCount, pRegions, "vkCmdCopyBufferToImage()", VALIDATION_ERROR_18e00158); @@ -4058,14 +4092,13 @@ bool skip = false; const VkImageAspectFlags sub_aspect = pSubresource->aspectMask; - // VU 00733: The aspectMask member of pSubresource must only have a single bit set + // The aspectMask member of pSubresource must only have a single bit set const int num_bits = sizeof(sub_aspect) * CHAR_BIT; std::bitset aspect_mask_bits(sub_aspect); if (aspect_mask_bits.count() != 1) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, HandleToUint64(image), - __LINE__, VALIDATION_ERROR_2a6007ca, "IMAGE", - "vkGetImageSubresourceLayout(): VkImageSubresource.aspectMask must have exactly 1 bit set. %s", - validation_error_map[VALIDATION_ERROR_2a6007ca]); + VALIDATION_ERROR_2a6007ca, + "vkGetImageSubresourceLayout(): VkImageSubresource.aspectMask must have exactly 1 bit set."); } IMAGE_STATE *image_entry = GetImageState(device_data, image); @@ -4073,48 +4106,58 @@ return skip; } - // VU 00732: image must have been created with tiling equal to VK_IMAGE_TILING_LINEAR + // image must have been created with tiling equal to VK_IMAGE_TILING_LINEAR if (image_entry->createInfo.tiling != VK_IMAGE_TILING_LINEAR) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, HandleToUint64(image), - __LINE__, VALIDATION_ERROR_2a6007c8, "IMAGE", - "vkGetImageSubresourceLayout(): Image must have tiling of VK_IMAGE_TILING_LINEAR. %s", - validation_error_map[VALIDATION_ERROR_2a6007c8]); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, HandleToUint64(image), + VALIDATION_ERROR_2a6007c8, "vkGetImageSubresourceLayout(): Image must have tiling of VK_IMAGE_TILING_LINEAR."); } - // VU 00739: mipLevel must be less than the mipLevels specified in VkImageCreateInfo when the image was created + // mipLevel must be less than the mipLevels specified in VkImageCreateInfo when the image was created if (pSubresource->mipLevel >= image_entry->createInfo.mipLevels) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, HandleToUint64(image), - __LINE__, VALIDATION_ERROR_0a4007cc, "IMAGE", - "vkGetImageSubresourceLayout(): pSubresource.mipLevel (%d) must be less than %d. %s", - pSubresource->mipLevel, image_entry->createInfo.mipLevels, validation_error_map[VALIDATION_ERROR_0a4007cc]); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, HandleToUint64(image), + VALIDATION_ERROR_2a600d68, "vkGetImageSubresourceLayout(): pSubresource.mipLevel (%d) must be less than %d.", + pSubresource->mipLevel, image_entry->createInfo.mipLevels); } - // VU 00740: arrayLayer must be less than the arrayLayers specified in VkImageCreateInfo when the image was created + // arrayLayer must be less than the arrayLayers specified in VkImageCreateInfo when the image was created if (pSubresource->arrayLayer >= image_entry->createInfo.arrayLayers) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, HandleToUint64(image), - __LINE__, VALIDATION_ERROR_0a4007ce, "IMAGE", - "vkGetImageSubresourceLayout(): pSubresource.arrayLayer (%d) must be less than %d. %s", - pSubresource->arrayLayer, image_entry->createInfo.arrayLayers, validation_error_map[VALIDATION_ERROR_0a4007ce]); + VALIDATION_ERROR_2a600d6a, "vkGetImageSubresourceLayout(): pSubresource.arrayLayer (%d) must be less than %d.", + pSubresource->arrayLayer, image_entry->createInfo.arrayLayers); } - // VU 00741: subresource's aspect must be compatible with image's format. + // subresource's aspect must be compatible with image's format. const VkFormat img_format = image_entry->createInfo.format; - if (FormatIsColor(img_format)) { + if (FormatIsMultiplane(img_format)) { + VkImageAspectFlags allowed_flags = (VK_IMAGE_ASPECT_PLANE_0_BIT_KHR | VK_IMAGE_ASPECT_PLANE_1_BIT_KHR); + UNIQUE_VALIDATION_ERROR_CODE vuid = VALIDATION_ERROR_2a600c5a; // 2-plane version + if (FormatPlaneCount(img_format) > 2u) { + allowed_flags |= VK_IMAGE_ASPECT_PLANE_2_BIT_KHR; + vuid = VALIDATION_ERROR_2a600c5c; // 3-plane version + } + if (sub_aspect != (sub_aspect & allowed_flags)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(image), vuid, + "vkGetImageSubresourceLayout(): For multi-planar images, VkImageSubresource.aspectMask (0x%" PRIx32 + ") must be a single-plane specifier flag.", + sub_aspect); + } + } else if (FormatIsColor(img_format)) { if (sub_aspect != VK_IMAGE_ASPECT_COLOR_BIT) { skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, HandleToUint64(image), __LINE__, - VALIDATION_ERROR_0a400c01, "IMAGE", - "vkGetImageSubresourceLayout(): For color formats, VkImageSubresource.aspectMask must be VK_IMAGE_ASPECT_COLOR. %s", - validation_error_map[VALIDATION_ERROR_0a400c01]); + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, HandleToUint64(image), + VALIDATION_ERROR_0a400c01, + "vkGetImageSubresourceLayout(): For color formats, VkImageSubresource.aspectMask must be VK_IMAGE_ASPECT_COLOR."); } } else if (FormatIsDepthOrStencil(img_format)) { if ((sub_aspect != VK_IMAGE_ASPECT_DEPTH_BIT) && (sub_aspect != VK_IMAGE_ASPECT_STENCIL_BIT)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image), __LINE__, VALIDATION_ERROR_0a400c01, "IMAGE", + HandleToUint64(image), VALIDATION_ERROR_0a400c01, "vkGetImageSubresourceLayout(): For depth/stencil formats, VkImageSubresource.aspectMask must be " - "either VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT. %s", - validation_error_map[VALIDATION_ERROR_0a400c01]); + "either VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT."); } } return skip; diff -Nru vulkan-1.0.65.2+dfsg1/layers/buffer_validation.h vulkan-1.1.73+dfsg/layers/buffer_validation.h --- vulkan-1.0.65.2+dfsg1/layers/buffer_validation.h 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/buffer_validation.h 2018-04-27 11:24:19.000000000 +0000 @@ -85,8 +85,8 @@ bool FindLayout(const std::unordered_map &imageLayoutMap, ImageSubresourcePair imgpair, VkImageLayout &layout, const VkImageAspectFlags aspectMask); -bool FindLayout(const std::unordered_map &imageLayoutMap, ImageSubresourcePair imgpair, - VkImageLayout &layout); +bool FindLayout(layer_data *device_data, const std::unordered_map &imageLayoutMap, + ImageSubresourcePair imgpair, VkImageLayout &layout); void SetGlobalLayout(layer_data *device_data, ImageSubresourcePair imgpair, const VkImageLayout &layout); @@ -97,8 +97,7 @@ void SetLayout(std::unordered_map &imageLayoutMap, ImageSubresourcePair imgpair, VkImageLayout layout); -void SetImageViewLayout(layer_data *device_data, GLOBAL_CB_NODE *pCB, VkImageView imageView, - const VkImageLayout &layout); +void SetImageViewLayout(layer_data *device_data, GLOBAL_CB_NODE *pCB, VkImageView imageView, const VkImageLayout &layout); bool VerifyFramebufferAndRenderPassLayouts(layer_data *dev_data, GLOBAL_CB_NODE *pCB, const VkRenderPassBeginInfo *pRenderPassBegin, const FRAMEBUFFER_STATE *framebuffer_state); @@ -122,7 +121,7 @@ bool ValidateBarriersToImages(layer_data *device_data, GLOBAL_CB_NODE const *cb_state, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers, const char *func_name); -void TransitionImageLayouts(layer_data *device_data, VkCommandBuffer cmdBuffer, uint32_t memBarrierCount, +void TransitionImageLayouts(layer_data *device_data, GLOBAL_CB_NODE *cb_state, uint32_t memBarrierCount, const VkImageMemoryBarrier *pImgMemBarriers); bool VerifySourceImageLayout(layer_data *dev_data, GLOBAL_CB_NODE *cb_node, VkImage srcImage, VkImageSubresourceLayers subLayers, @@ -148,10 +147,12 @@ IMAGE_STATE *dst_image_state); bool PreCallValidateCmdBlitImage(layer_data *device_data, GLOBAL_CB_NODE *cb_node, IMAGE_STATE *src_image_state, - IMAGE_STATE *dst_image_state, uint32_t regionCount, const VkImageBlit *pRegions, VkFilter filter); + IMAGE_STATE *dst_image_state, uint32_t region_count, const VkImageBlit *regions, + VkImageLayout src_image_layout, VkImageLayout dst_image_layout, VkFilter filter); void PreCallRecordCmdBlitImage(layer_data *device_data, GLOBAL_CB_NODE *cb_node, IMAGE_STATE *src_image_state, - IMAGE_STATE *dst_image_state); + IMAGE_STATE *dst_image_state, uint32_t region_count, const VkImageBlit *regions, + VkImageLayout src_image_layout, VkImageLayout dst_image_layout); bool ValidateCmdBufImageLayouts(layer_data *device_data, GLOBAL_CB_NODE *pCB, std::unordered_map const &globalImageLayoutMap, diff -Nru vulkan-1.0.65.2+dfsg1/layers/CMakeLists.txt vulkan-1.1.73+dfsg/layers/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/layers/CMakeLists.txt 2018-01-10 14:19:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/CMakeLists.txt 2018-05-04 08:50:24.000000000 +0000 @@ -21,6 +21,11 @@ add_definitions(-DVK_USE_PLATFORM_MIR_KHR -DVK_USE_PLATFORM_MIR_KHX) include_directories(${MIR_INCLUDE_DIR}) endif() +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + add_definitions(-DVK_USE_PLATFORM_MACOS_MVK) + if(CMAKE_GENERATOR MATCHES "^Xcode.*") + add_custom_target(mk_layer_config_dir ALL COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/$) + endif() else() message(FATAL_ERROR "Unsupported Platform!") endif() @@ -40,7 +45,6 @@ set(LAYER_JSON_FILES ${LAYER_JSON_FILES_WITH_DEPENDENCIES} ${LAYER_JSON_FILES_NO_DEPENDENCIES}) if (WIN32) - if (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)) if (CMAKE_GENERATOR MATCHES "^Visual Studio.*") foreach (config_file ${LAYER_JSON_FILES}) FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/windows/${config_file}.json src_json) @@ -49,6 +53,7 @@ COMMAND copy ${src_json} ${dst_json} VERBATIM ) + set_target_properties(${config_file}-json PROPERTIES FOLDER ${LVL_TARGET_FOLDER}) endforeach(config_file) else() foreach (config_file ${LAYER_JSON_FILES}) @@ -60,6 +65,7 @@ ) endforeach(config_file) endif() + if (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)) # Copy vk_validation_error_messages.h from source to build dir for scripts to pick up FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/vk_validation_error_messages.h src_val_msgs) FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/vk_validation_error_messages.h dst_val_msgs) @@ -67,8 +73,9 @@ COMMAND copy ${src_val_msgs} ${dst_val_msgs} VERBATIM ) + set_target_properties(vk_validation_error_messages PROPERTIES FOLDER ${LVL_TARGET_FOLDER}) endif() -else() +elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") # extra setup for out-of-tree builds if (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)) foreach (config_file ${LAYER_JSON_FILES}) @@ -83,16 +90,42 @@ VERBATIM ) endif() +elseif(APPLE) + # extra setup for out-of-tree builds + if (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)) + if (CMAKE_GENERATOR MATCHES "^Xcode.*") + foreach (config_file ${LAYER_JSON_FILES}) + add_custom_target(${config_file}-json ALL + DEPENDS mk_layer_config_dir + COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/macos/${config_file}.json $ + VERBATIM + ) + endforeach(config_file) + else() + foreach (config_file ${LAYER_JSON_FILES}) + add_custom_target(${config_file}-json ALL + COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/macos/${config_file}.json + VERBATIM + ) + endforeach(config_file) + endif() + # Add link to vk_validation_error_messages.h in build dir for scripts to pick up + add_custom_target(vk_validation_error_messages ALL + COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/vk_validation_error_messages.h + VERBATIM + ) + endif() +endif() +# If a layer has a direct dependency on a project with the same name, use it. +if ((Win32) OR (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR))) + foreach (config_file ${LAYER_JSON_FILES_WITH_DEPENDENCIES}) + add_dependencies(${config_file}-json ${config_file}) + endforeach(config_file) + # If a layer has no direct dependencies, give it one so it copies in the proper order + foreach (config_file ${LAYER_JSON_FILES_NO_DEPENDENCIES}) + add_dependencies(${config_file}-json VkLayer_utils) + endforeach(config_file) endif() -# If a layer has a direcgt dependency on a project with the same name, use it. -foreach (config_file ${LAYER_JSON_FILES_WITH_DEPENDENCIES}) - add_dependencies(${config_file}-json ${config_file}) -endforeach(config_file) -# If a layer has no direct dependencies, give it one so it copies in the proper order -foreach (config_file ${LAYER_JSON_FILES_NO_DEPENDENCIES}) - add_dependencies(${config_file}-json VkLayer_utils) -endforeach(config_file) - # Add targets for JSON file install on Linux. # Need to remove the "./" from the library path before installing to /etc. @@ -118,11 +151,23 @@ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DEF_FILE} VkLayer_${target}.def VERBATIM ) + set_target_properties(copy-${target}-def-file PROPERTIES FOLDER ${LVL_TARGET_FOLDER}) add_library(VkLayer_${target} SHARED ${ARGN} VkLayer_${target}.def) add_dependencies(VkLayer_${target} generate_helper_files) target_link_Libraries(VkLayer_${target} VkLayer_utils) add_dependencies(VkLayer_${target} generate_helper_files VkLayer_utils) endmacro() +elseif(APPLE) + macro(add_vk_layer target) + add_library(VkLayer_${target} SHARED ${ARGN}) + target_link_Libraries(VkLayer_${target} VkLayer_utils) + add_dependencies(VkLayer_${target} generate_helper_files VkLayer_utils) + set_target_properties(VkLayer_${target} PROPERTIES + LINK_FLAGS "-Wl" + INSTALL_RPATH "@loader_path/" + ) + install(TARGETS VkLayer_${target} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + endmacro() else() macro(add_vk_layer target) add_library(VkLayer_${target} SHARED ${ARGN}) @@ -140,17 +185,16 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../loader ${CMAKE_CURRENT_SOURCE_DIR}/../include/vulkan ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_PROJECT_BINARY_DIR} + ${PROJECT_BINARY_DIR} ${CMAKE_BINARY_DIR} ) if (WIN32) - set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D_CRT_SECURE_NO_WARNINGS") - set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -D_CRT_SECURE_NO_WARNINGS") - set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -D_CRT_SECURE_NO_WARNINGS") - set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -D_CRT_SECURE_NO_WARNINGS") - set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_CRT_SECURE_NO_WARNINGS /bigobj") - set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_CRT_SECURE_NO_WARNINGS /bigobj") + # Applies to all configurations + add_definitions(-D_CRT_SECURE_NO_WARNINGS) + # Avoid: fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj + set_source_files_properties(core_validation.cpp threading.cpp + PROPERTIES COMPILE_FLAGS "/bigobj") # Turn off transitional "changed behavior" warning message for Visual Studio versions prior to 2015. # The changed behavior is that constructor initializers are now fixed to clear the struct members. add_compile_options("$<$,$,19>>:/wd4351>") @@ -159,10 +203,12 @@ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith -Wno-unused-function -Wno-sign-compare") endif() -if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "mips64") - if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") - set_source_files_properties(core_validation.cpp PROPERTIES COMPILE_FLAGS -mxgot) - endif() +# Clang (and not gcc) warns about unused const variables. +# Generated files may purposely contain unused consts, so +# silence this warning in Clang. +if (CMAKE_C_COMPILER_ID MATCHES "Clang") + set_source_files_properties(parameter_validation.cpp PROPERTIES + COMPILE_FLAGS "-Wno-unused-const-variable") endif() run_vk_xml_generate(threading_generator.py thread_check.h) @@ -171,20 +217,7 @@ run_vk_xml_generate(dispatch_table_helper_generator.py vk_dispatch_table_helper.h) run_vk_xml_generate(object_tracker_generator.py object_tracker.cpp) -# Layer Utils Library -# For Windows, we use a static lib because the Windows loader has a fairly restrictive loader search -# path that can't be easily modified to point it to the same directory that contains the layers. -if (WIN32) - add_library(VkLayer_utils STATIC vk_layer_config.cpp vk_layer_extension_utils.cpp vk_layer_utils.cpp vk_format_utils.cpp) -else() - add_library(VkLayer_utils SHARED vk_layer_config.cpp vk_layer_extension_utils.cpp vk_layer_utils.cpp vk_format_utils.cpp) - if(INSTALL_LVL_FILES) - install(TARGETS VkLayer_utils DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() -endif() -add_dependencies(VkLayer_utils generate_helper_files) - -add_vk_layer(core_validation core_validation.cpp vk_layer_table.cpp descriptor_sets.cpp buffer_validation.cpp shader_validation.cpp) +add_vk_layer(core_validation core_validation.cpp vk_layer_table.cpp descriptor_sets.cpp buffer_validation.cpp shader_validation.cpp xxhash.c) add_vk_layer(object_tracker object_tracker.cpp object_tracker_utils.cpp vk_layer_table.cpp) # generated add_vk_layer(threading threading.cpp thread_check.h vk_layer_table.cpp) diff -Nru vulkan-1.0.65.2+dfsg1/layers/core_validation.cpp vulkan-1.1.73+dfsg/layers/core_validation.cpp --- vulkan-1.0.65.2+dfsg1/layers/core_validation.cpp 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/core_validation.cpp 2018-04-27 11:24:19.000000000 +0000 @@ -37,6 +37,7 @@ #define NOMINMAX #include +#include #include #include #include @@ -49,7 +50,7 @@ #include #include #include -#include +#include #include "vk_loader_platform.h" #include "vk_dispatch_table_helper.h" @@ -67,10 +68,11 @@ #include "vk_layer_data.h" #include "vk_layer_extension_utils.h" #include "vk_layer_utils.h" +#include "vk_typemap_helper.h" #if defined __ANDROID__ #include -#define LOGCONSOLE(...) ((void)__android_log_print(ANDROID_LOG_INFO, "DS", __VA_ARGS__)) +#define LOGCONSOLE(...) ((void)__android_log_print(ANDROID_LOG_INFO, "CORE_VALIDATION", __VA_ARGS__)) #else #define LOGCONSOLE(...) \ { \ @@ -79,19 +81,6 @@ } #endif -// TODO: remove on NDK update (r15 will probably have proper STL impl) -#ifdef __ANDROID__ -namespace std { - -template -std::string to_string(T var) { - std::ostringstream ss; - ss << var; - return ss.str(); -} -} -#endif - // This intentionally includes a cpp file #include "vk_safe_struct.cpp" @@ -99,15 +88,51 @@ using lock_guard_t = std::lock_guard; using unique_lock_t = std::unique_lock; +// These functions are defined *outside* the core_validation namespace as their type +// is also defined outside that namespace +size_t PipelineLayoutCompatDef::hash() const { + hash_util::HashCombiner hc; + // The set number is integral to the CompatDef's distinctiveness + hc << set << push_constant_ranges.get(); + const auto &descriptor_set_layouts = *set_layouts_id.get(); + for (uint32_t i = 0; i <= set; i++) { + hc << descriptor_set_layouts[i].get(); + } + return hc.Value(); +} + +bool PipelineLayoutCompatDef::operator==(const PipelineLayoutCompatDef &other) const { + if ((set != other.set) || (push_constant_ranges != other.push_constant_ranges)) { + return false; + } + + if (set_layouts_id == other.set_layouts_id) { + // if it's the same set_layouts_id, then *any* subset will match + return true; + } + + // They aren't exactly the same PipelineLayoutSetLayouts, so we need to check if the required subsets match + const auto &descriptor_set_layouts = *set_layouts_id.get(); + assert(set < descriptor_set_layouts.size()); + const auto &other_ds_layouts = *other.set_layouts_id.get(); + assert(set < other_ds_layouts.size()); + for (uint32_t i = 0; i <= set; i++) { + if (descriptor_set_layouts[i] != other_ds_layouts[i]) { + return false; + } + } + return true; +} + namespace core_validation { +using std::max; +using std::string; +using std::stringstream; +using std::unique_ptr; using std::unordered_map; using std::unordered_set; -using std::unique_ptr; using std::vector; -using std::string; -using std::stringstream; -using std::max; // WSI Image Objects bypass usual Image Object creation methods. A special Memory // Object value will be used to identify them internally. @@ -115,14 +140,11 @@ // 2nd special memory handle used to flag object as unbound from memory static const VkDeviceMemory MEMORY_UNBOUND = VkDeviceMemory(~((uint64_t)(0)) - 1); -// A special value of (0xFFFFFFFF, 0xFFFFFFFF) indicates that the surface size will be determined -// by the extent of a swapchain targeting the surface. -static const uint32_t kSurfaceSizeFromSwapchain = 0xFFFFFFFFu; - struct instance_layer_data { VkInstance instance = VK_NULL_HANDLE; debug_report_data *report_data = nullptr; - std::vector logging_callback; + vector logging_callback; + vector logging_messenger; VkLayerInstanceDispatchTable dispatch_table; CALL_STATE vkEnumeratePhysicalDevicesState = UNCALLED; @@ -135,6 +157,7 @@ unordered_map surface_map; InstanceExtensions extensions; + uint32_t api_version; }; struct layer_data { @@ -153,7 +176,7 @@ unordered_map commandPoolMap; unordered_map descriptorPoolMap; unordered_map setMap; - unordered_map> descriptorSetLayoutMap; + unordered_map> descriptorSetLayoutMap; unordered_map pipelineLayoutMap; unordered_map> memObjMap; unordered_map fenceMap; @@ -181,7 +204,15 @@ PHYS_DEV_PROPERTIES_NODE phys_dev_properties = {}; VkPhysicalDeviceMemoryProperties phys_dev_mem_props = {}; VkPhysicalDeviceProperties phys_dev_props = {}; + // Device extension properties -- storing properties gathered from VkPhysicalDeviceProperties2KHR::pNext chain + struct DeviceExtensionProperties { + uint32_t max_push_descriptors; // from VkPhysicalDevicePushDescriptorPropertiesKHR::maxPushDescriptors + VkPhysicalDeviceDescriptorIndexingPropertiesEXT descriptor_indexing_props; + VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptor_indexing_features; + }; + DeviceExtensionProperties phys_dev_ext_props = {}; bool external_sync_warning = false; + uint32_t api_version = 0; }; // TODO : Do we need to guard access to layer_data_map w/ lock? @@ -191,7 +222,14 @@ static uint32_t loader_layer_if_version = CURRENT_LOADER_LAYER_INTERFACE_VERSION; static const VkLayerProperties global_layer = { - "VK_LAYER_LUNARG_core_validation", VK_LAYER_API_VERSION, 1, "LunarG Validation Layer", + "VK_LAYER_LUNARG_core_validation", + VK_LAYER_API_VERSION, + 1, + "LunarG Validation Layer", +}; + +static const VkExtensionProperties device_extensions[] = { + {VK_EXT_VALIDATION_CACHE_EXTENSION_NAME, VK_EXT_VALIDATION_CACHE_SPEC_VERSION}, }; template @@ -324,9 +362,7 @@ return &it->second; } -DeviceExtensions const *GetEnabledExtensions(layer_data const *dev_data) { - return &dev_data->extensions; -} +DeviceExtensions const *GetEnabledExtensions(layer_data const *dev_data) { return &dev_data->extensions; } // Return ptr to memory binding for given handle of specified type static BINDABLE *GetObjectMemBinding(layer_data *dev_data, uint64_t handle, VulkanObjectType type) { @@ -357,7 +393,21 @@ const VkMemoryAllocateInfo *pAllocateInfo) { assert(object != NULL); - dev_data->memObjMap[mem] = unique_ptr(new DEVICE_MEM_INFO(object, mem, pAllocateInfo)); + auto *mem_info = new DEVICE_MEM_INFO(object, mem, pAllocateInfo); + dev_data->memObjMap[mem] = unique_ptr(mem_info); + + // TODO: If the number of things we search for goes much higher, need a map... + mem_info->global_valid = nullptr != lvl_find_in_chain(pAllocateInfo->pNext); +#ifdef VK_USE_PLATFORM_WIN32_KHR + mem_info->global_valid |= nullptr != lvl_find_in_chain(pAllocateInfo->pNext); +#endif + + auto dedicated = lvl_find_in_chain(pAllocateInfo->pNext); + if (dedicated) { + mem_info->is_dedicated = true; + mem_info->dedicated_buffer = dedicated->buffer; + mem_info->dedicated_image = dedicated->image; + } } // For given bound_object_handle, bound to given mem allocation, verify that the range for the bound object is valid @@ -367,7 +417,7 @@ if (mem_info) { if (!mem_info->bound_ranges[bound_object_handle].valid) { return log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(mem), __LINE__, MEMTRACK_INVALID_MEM_REGION, "MEM", + HandleToUint64(mem), MEMTRACK_INVALID_MEM_REGION, "%s: Cannot read invalid region of memory allocation 0x%" PRIx64 " for bound %s object 0x%" PRIx64 ", please fill the memory before using.", functionName, HandleToUint64(mem), object_string[type], bound_object_handle); @@ -382,7 +432,7 @@ if (image_state->binding.mem == MEMTRACKER_SWAP_CHAIN_IMAGE_KEY) { if (!image_state->valid) { return log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(image_state->binding.mem), __LINE__, MEMTRACK_INVALID_MEM_REGION, "MEM", + HandleToUint64(image_state->binding.mem), MEMTRACK_INVALID_MEM_REGION, "%s: Cannot read invalid swapchain image 0x%" PRIx64 ", please fill the memory before using.", functionName, HandleToUint64(image_state->image)); } @@ -532,17 +582,17 @@ const char *type_name, UNIQUE_VALIDATION_ERROR_CODE error_code) { bool result = false; if (VK_NULL_HANDLE == mem) { - result = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, handle, - __LINE__, error_code, "MEM", "%s: Vk%s object 0x%" PRIxLEAST64 - " used with no memory bound. Memory should be bound by calling " - "vkBind%sMemory(). %s", - api_name, type_name, handle, type_name, validation_error_map[error_code]); + result = + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, handle, error_code, + "%s: Vk%s object 0x%" PRIx64 " used with no memory bound. Memory should be bound by calling vkBind%sMemory().", + api_name, type_name, handle, type_name); } else if (MEMORY_UNBOUND == mem) { - result = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, handle, - __LINE__, error_code, "MEM", "%s: Vk%s object 0x%" PRIxLEAST64 - " used with no memory bound and previously bound memory was freed. " - "Memory must not be freed prior to this operation. %s", - api_name, type_name, handle, validation_error_map[error_code]); + result = + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, handle, error_code, + "%s: Vk%s object 0x%" PRIx64 + " used with no memory bound and previously bound memory was freed. Memory must not be freed prior to this " + "operation.", + api_name, type_name, handle); } return result; } @@ -571,17 +621,22 @@ // SetMemBinding is used to establish immutable, non-sparse binding between a single image/buffer object and memory object. // Corresponding valid usage checks are in ValidateSetMemBinding(). -static void SetMemBinding(layer_data *dev_data, VkDeviceMemory mem, uint64_t handle, VulkanObjectType type, const char *apiName) { +static void SetMemBinding(layer_data *dev_data, VkDeviceMemory mem, BINDABLE *mem_binding, VkDeviceSize memory_offset, + uint64_t handle, VulkanObjectType type, const char *apiName) { + assert(mem_binding); + mem_binding->binding.mem = mem; + mem_binding->UpdateBoundMemorySet(); // force recreation of cached set + mem_binding->binding.offset = memory_offset; + mem_binding->binding.size = mem_binding->requirements.size; + if (mem != VK_NULL_HANDLE) { - BINDABLE *mem_binding = GetObjectMemBinding(dev_data, handle, type); - assert(mem_binding); DEVICE_MEM_INFO *mem_info = GetMemObjInfo(dev_data, mem); if (mem_info) { mem_info->obj_bindings.insert({handle, type}); // For image objects, make sure default memory state is correctly set // TODO : What's the best/correct way to handle this? if (kVulkanObjectTypeImage == type) { - auto const image_state = GetImageState(dev_data, VkImage(handle)); + auto const image_state = reinterpret_cast(mem_binding); if (image_state) { VkImageCreateInfo ici = image_state->createInfo; if (ici.usage & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) { @@ -589,7 +644,6 @@ } } } - mem_binding->binding.mem = mem; } } } @@ -611,38 +665,37 @@ if (mem_binding->sparse) { UNIQUE_VALIDATION_ERROR_CODE error_code = VALIDATION_ERROR_1740082a; const char *handle_type = "IMAGE"; - if (strcmp(apiName, "vkBindBufferMemory()") == 0) { + if (type == kVulkanObjectTypeBuffer) { error_code = VALIDATION_ERROR_1700080c; handle_type = "BUFFER"; } else { - assert(strcmp(apiName, "vkBindImageMemory()") == 0); + assert(type == kVulkanObjectTypeImage); } skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(mem), __LINE__, error_code, "MEM", - "In %s, attempting to bind memory (0x%" PRIxLEAST64 ") to object (0x%" PRIxLEAST64 - ") which was created with sparse memory flags (VK_%s_CREATE_SPARSE_*_BIT). %s", - apiName, HandleToUint64(mem), handle, handle_type, validation_error_map[error_code]); + HandleToUint64(mem), error_code, + "In %s, attempting to bind memory (0x%" PRIx64 ") to object (0x%" PRIx64 + ") which was created with sparse memory flags (VK_%s_CREATE_SPARSE_*_BIT).", + apiName, HandleToUint64(mem), handle, handle_type); } DEVICE_MEM_INFO *mem_info = GetMemObjInfo(dev_data, mem); if (mem_info) { DEVICE_MEM_INFO *prev_binding = GetMemObjInfo(dev_data, mem_binding->binding.mem); if (prev_binding) { UNIQUE_VALIDATION_ERROR_CODE error_code = VALIDATION_ERROR_17400828; - if (strcmp(apiName, "vkBindBufferMemory()") == 0) { + if (type == kVulkanObjectTypeBuffer) { error_code = VALIDATION_ERROR_1700080a; } else { - assert(strcmp(apiName, "vkBindImageMemory()") == 0); + assert(type == kVulkanObjectTypeImage); } skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(mem), __LINE__, error_code, "MEM", - "In %s, attempting to bind memory (0x%" PRIxLEAST64 ") to object (0x%" PRIxLEAST64 - ") which has already been bound to mem object 0x%" PRIxLEAST64 ". %s", - apiName, HandleToUint64(mem), handle, HandleToUint64(prev_binding->mem), - validation_error_map[error_code]); + HandleToUint64(mem), error_code, + "In %s, attempting to bind memory (0x%" PRIx64 ") to object (0x%" PRIx64 + ") which has already been bound to mem object 0x%" PRIx64 ".", + apiName, HandleToUint64(mem), handle, HandleToUint64(prev_binding->mem)); } else if (mem_binding->binding.mem == MEMORY_UNBOUND) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(mem), __LINE__, MEMTRACK_REBIND_OBJECT, "MEM", - "In %s, attempting to bind memory (0x%" PRIxLEAST64 ") to object (0x%" PRIxLEAST64 + HandleToUint64(mem), MEMTRACK_REBIND_OBJECT, + "In %s, attempting to bind memory (0x%" PRIx64 ") to object (0x%" PRIx64 ") which was previous bound to memory that has since been freed. Memory bindings are immutable in " "Vulkan so this attempt to bind to new memory is not allowed.", apiName, HandleToUint64(mem), handle); @@ -672,6 +725,7 @@ mem_info->obj_bindings.insert({handle, type}); // Need to set mem binding for this object mem_binding->sparse_bindings.insert(binding); + mem_binding->UpdateBoundMemorySet(); } } return skip; @@ -681,10 +735,9 @@ static bool validate_status(layer_data *dev_data, GLOBAL_CB_NODE *pNode, CBStatusFlags status_mask, VkFlags msg_flags, const char *fail_msg, UNIQUE_VALIDATION_ERROR_CODE const msg_code) { if (!(pNode->status & status_mask)) { - char const *const message = validation_error_map[msg_code]; return log_msg(dev_data->report_data, msg_flags, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pNode->commandBuffer), __LINE__, msg_code, "DS", "command buffer object 0x%p: %s. %s.", - pNode->commandBuffer, fail_msg, message); + HandleToUint64(pNode->commandBuffer), msg_code, "command buffer object 0x%" PRIx64 ": %s..", + HandleToUint64(pNode->commandBuffer), fail_msg); } return false; } @@ -761,9 +814,8 @@ static bool validate_draw_state_flags(layer_data *dev_data, GLOBAL_CB_NODE *pCB, const PIPELINE_STATE *pPipe, bool indexed, UNIQUE_VALIDATION_ERROR_CODE const msg_code) { bool result = false; - if (pPipe->graphicsPipelineCI.pInputAssemblyState && - ((pPipe->graphicsPipelineCI.pInputAssemblyState->topology == VK_PRIMITIVE_TOPOLOGY_LINE_LIST) || - (pPipe->graphicsPipelineCI.pInputAssemblyState->topology == VK_PRIMITIVE_TOPOLOGY_LINE_STRIP))) { + if (pPipe->topology_at_rasterizer == VK_PRIMITIVE_TOPOLOGY_LINE_LIST || + pPipe->topology_at_rasterizer == VK_PRIMITIVE_TOPOLOGY_LINE_STRIP) { result |= validate_status(dev_data, pCB, CBSTATUS_LINE_WIDTH_SET, VK_DEBUG_REPORT_ERROR_BIT_EXT, "Dynamic line width state not set for this command buffer", msg_code); } @@ -803,11 +855,11 @@ uint32_t secondary_attach, const char *msg, const char *caller, UNIQUE_VALIDATION_ERROR_CODE error_code) { return log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, - HandleToUint64(rp1_state->renderPass), __LINE__, error_code, "DS", + HandleToUint64(rp1_state->renderPass), error_code, "%s: RenderPasses incompatible between %s w/ renderPass 0x%" PRIx64 " and %s w/ renderPass 0x%" PRIx64 - " Attachment %u is not compatible with %u: %s. %s", + " Attachment %u is not compatible with %u: %s.", caller, type1_string, HandleToUint64(rp1_state->renderPass), type2_string, HandleToUint64(rp2_state->renderPass), - primary_attach, secondary_attach, msg, validation_error_map[error_code]); + primary_attach, secondary_attach, msg); } static bool validateAttachmentCompatibility(layer_data const *dev_data, const char *type1_string, @@ -845,9 +897,8 @@ secondary_attach, "They have different samples.", caller, error_code); } if (primaryPassCI.pAttachments[primary_attach].flags != secondaryPassCI.pAttachments[secondary_attach].flags) { - skip |= - logInvalidAttachmentMessage(dev_data, type1_string, rp1_state, type2_string, rp2_state, primary_attach, secondary_attach, - "They have different flags.", caller, error_code); + skip |= logInvalidAttachmentMessage(dev_data, type1_string, rp1_state, type2_string, rp2_state, primary_attach, + secondary_attach, "They have different flags.", caller, error_code); } return skip; @@ -914,13 +965,12 @@ bool skip = false; if (rp1_state->createInfo.subpassCount != rp2_state->createInfo.subpassCount) { - skip |= - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, - HandleToUint64(rp1_state->renderPass), __LINE__, error_code, "DS", - "%s: RenderPasses incompatible between %s w/ renderPass 0x%" PRIx64 - " with a subpassCount of %u and %s w/ renderPass 0x%" PRIx64 " with a subpassCount of %u. %s", - caller, type1_string, HandleToUint64(rp1_state->renderPass), rp1_state->createInfo.subpassCount, type2_string, - HandleToUint64(rp2_state->renderPass), rp2_state->createInfo.subpassCount, validation_error_map[error_code]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, + HandleToUint64(rp1_state->renderPass), error_code, + "%s: RenderPasses incompatible between %s w/ renderPass 0x%" PRIx64 + " with a subpassCount of %u and %s w/ renderPass 0x%" PRIx64 " with a subpassCount of %u.", + caller, type1_string, HandleToUint64(rp1_state->renderPass), rp1_state->createInfo.subpassCount, + type2_string, HandleToUint64(rp2_state->renderPass), rp2_state->createInfo.subpassCount); } else { for (uint32_t i = 0; i < rp1_state->createInfo.subpassCount; ++i) { skip |= validateSubpassCompatibility(dev_data, type1_string, rp1_state, type2_string, rp2_state, i, caller, error_code); @@ -972,22 +1022,22 @@ (pCB->currentDrawData.buffers[vertex_binding] == VK_NULL_HANDLE)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pCB->commandBuffer), __LINE__, DRAWSTATE_VTX_INDEX_OUT_OF_BOUNDS, "DS", - "The Pipeline State Object (0x%" PRIxLEAST64 - ") expects that this Command Buffer's vertex binding Index %u " - "should be set via vkCmdBindVertexBuffers. This is because VkVertexInputBindingDescription struct " - "at index " PRINTF_SIZE_T_SPECIFIER " of pVertexBindingDescriptions has a binding value of %u.", + HandleToUint64(pCB->commandBuffer), DRAWSTATE_VTX_INDEX_OUT_OF_BOUNDS, + "The Pipeline State Object (0x%" PRIx64 + ") expects that this Command Buffer's vertex binding Index %u should be set via " + "vkCmdBindVertexBuffers. This is because VkVertexInputBindingDescription struct at " + "index " PRINTF_SIZE_T_SPECIFIER " of pVertexBindingDescriptions has a binding value of %u.", HandleToUint64(state.pipeline_state->pipeline), vertex_binding, i, vertex_binding); } } } else { if (!pCB->currentDrawData.buffers.empty() && !pCB->vertex_buffer_used) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(pCB->commandBuffer), __LINE__, - DRAWSTATE_VTX_INDEX_OUT_OF_BOUNDS, "DS", - "Vertex buffers are bound to command buffer (0x%p" - ") but no vertex buffers are attached to this Pipeline State Object (0x%" PRIxLEAST64 ").", - pCB->commandBuffer, HandleToUint64(state.pipeline_state->pipeline)); + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(pCB->commandBuffer), + DRAWSTATE_VTX_INDEX_OUT_OF_BOUNDS, + "Vertex buffers are bound to command buffer (0x%" PRIx64 + ") but no vertex buffers are attached to this Pipeline State Object (0x%" PRIx64 ").", + HandleToUint64(pCB->commandBuffer), HandleToUint64(state.pipeline_state->pipeline)); } } // If Viewport or scissors are dynamic, verify that dynamic count matches PSO count. @@ -1007,7 +1057,7 @@ list_bits(ss, missingViewportMask); ss << " are used by pipeline state object, but were not provided via calls to vkCmdSetViewport()."; skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS", "%s", ss.str().c_str()); + DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "%s", ss.str().c_str()); } } @@ -1020,7 +1070,7 @@ list_bits(ss, missingScissorMask); ss << " are used by pipeline state object, but were not provided via calls to vkCmdSetScissor()."; skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS", "%s", ss.str().c_str()); + DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "%s", ss.str().c_str()); } } } @@ -1051,16 +1101,16 @@ if (!dev_data->extensions.vk_amd_mixed_attachment_samples && ((subpass_num_samples & static_cast(pso_num_samples)) != subpass_num_samples)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, DRAWSTATE_NUM_SAMPLES_MISMATCH, "DS", - "Num samples mismatch! At draw-time in Pipeline (0x%" PRIxLEAST64 - ") with %u samples while current RenderPass (0x%" PRIxLEAST64 ") w/ %u samples!", + HandleToUint64(pPipeline->pipeline), DRAWSTATE_NUM_SAMPLES_MISMATCH, + "Num samples mismatch! At draw-time in Pipeline (0x%" PRIx64 + ") with %u samples while current RenderPass (0x%" PRIx64 ") w/ %u samples!", HandleToUint64(pPipeline->pipeline), pso_num_samples, HandleToUint64(pCB->activeRenderPass->renderPass), subpass_num_samples); } } else { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, DRAWSTATE_NUM_SAMPLES_MISMATCH, "DS", - "No active render pass found at draw-time in Pipeline (0x%" PRIxLEAST64 ")!", + HandleToUint64(pPipeline->pipeline), DRAWSTATE_NUM_SAMPLES_MISMATCH, + "No active render pass found at draw-time in Pipeline (0x%" PRIx64 ")!", HandleToUint64(pPipeline->pipeline)); } } @@ -1102,10 +1152,10 @@ pPipeline->rp_state.get(), caller, rp_error); } if (pPipeline->graphicsPipelineCI.subpass != pCB->activeSubpass) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, sp_error, "DS", - "Pipeline was built for subpass %u but used in subpass %u. %s", pPipeline->graphicsPipelineCI.subpass, - pCB->activeSubpass, validation_error_map[sp_error]); + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, + HandleToUint64(pPipeline->pipeline), sp_error, "Pipeline was built for subpass %u but used in subpass %u.", + pPipeline->graphicsPipelineCI.subpass, pCB->activeSubpass); } } @@ -1141,7 +1191,7 @@ if (nullptr == pPipe) { result |= log_msg( dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_INVALID_PIPELINE, "DS", + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_INVALID_PIPELINE, "At Draw/Dispatch time no valid VkPipeline is bound! This is illegal. Please bind one with vkCmdBindPipeline()."); // Early return as any further checks below will be busted w/o a pipeline if (result) return true; @@ -1151,43 +1201,47 @@ result = validate_draw_state_flags(dev_data, cb_node, pPipe, indexed, msg_code); // Now complete other state checks - if (VK_NULL_HANDLE != state.pipeline_layout.layout) { - string errorString; - auto pipeline_layout = pPipe->pipeline_layout; + string errorString; + auto const &pipeline_layout = pPipe->pipeline_layout; - for (const auto &set_binding_pair : pPipe->active_slots) { - uint32_t setIndex = set_binding_pair.first; - // If valid set is not bound throw an error - if ((state.boundDescriptorSets.size() <= setIndex) || (!state.boundDescriptorSets[setIndex])) { - result |= - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_DESCRIPTOR_SET_NOT_BOUND, "DS", - "VkPipeline 0x%" PRIxLEAST64 " uses set #%u but that set is not bound.", - HandleToUint64(pPipe->pipeline), setIndex); - } else if (!verify_set_layout_compatibility(state.boundDescriptorSets[setIndex], &pipeline_layout, setIndex, - errorString)) { - // Set is bound but not compatible w/ overlapping pipeline_layout from PSO - VkDescriptorSet setHandle = state.boundDescriptorSets[setIndex]->GetSet(); - result |= - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, - HandleToUint64(setHandle), __LINE__, DRAWSTATE_PIPELINE_LAYOUTS_INCOMPATIBLE, "DS", - "VkDescriptorSet (0x%" PRIxLEAST64 - ") bound as set #%u is not compatible with overlapping VkPipelineLayout 0x%" PRIxLEAST64 " due to: %s", - HandleToUint64(setHandle), setIndex, HandleToUint64(pipeline_layout.layout), errorString.c_str()); - } else { // Valid set is bound and layout compatible, validate that it's updated - // Pull the set node - cvdescriptorset::DescriptorSet *descriptor_set = state.boundDescriptorSets[setIndex]; - // Validate the draw-time state for this descriptor set - std::string err_str; - if (!descriptor_set->IsPushDescriptor() && - !descriptor_set->ValidateDrawState(set_binding_pair.second, state.dynamicOffsets[setIndex], cb_node, function, + for (const auto &set_binding_pair : pPipe->active_slots) { + uint32_t setIndex = set_binding_pair.first; + // If valid set is not bound throw an error + if ((state.boundDescriptorSets.size() <= setIndex) || (!state.boundDescriptorSets[setIndex])) { + result |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_DESCRIPTOR_SET_NOT_BOUND, + "VkPipeline 0x%" PRIx64 " uses set #%u but that set is not bound.", HandleToUint64(pPipe->pipeline), + setIndex); + } else if (!verify_set_layout_compatibility(state.boundDescriptorSets[setIndex], &pipeline_layout, setIndex, errorString)) { + // Set is bound but not compatible w/ overlapping pipeline_layout from PSO + VkDescriptorSet setHandle = state.boundDescriptorSets[setIndex]->GetSet(); + result |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, + HandleToUint64(setHandle), DRAWSTATE_PIPELINE_LAYOUTS_INCOMPATIBLE, + "VkDescriptorSet (0x%" PRIx64 + ") bound as set #%u is not compatible with overlapping VkPipelineLayout 0x%" PRIx64 " due to: %s", + HandleToUint64(setHandle), setIndex, HandleToUint64(pipeline_layout.layout), errorString.c_str()); + } else { // Valid set is bound and layout compatible, validate that it's updated + // Pull the set node + cvdescriptorset::DescriptorSet *descriptor_set = state.boundDescriptorSets[setIndex]; + // Validate the draw-time state for this descriptor set + std::string err_str; + if (!descriptor_set->IsPushDescriptor()) { + // For the "bindless" style resource usage with many descriptors, need to optimize command <-> descriptor + // binding validation. Take the requested binding set and prefilter it to eliminate redundant validation checks. + // Here, the currently bound pipeline determines whether an image validation check is redundant... + // for images are the "req" portion of the binding_req is indirectly (but tightly) coupled to the pipeline. + const cvdescriptorset::PrefilterBindRequestMap reduced_map(*descriptor_set, set_binding_pair.second, cb_node, + pPipe); + const auto &binding_req_map = reduced_map.Map(); + + if (!descriptor_set->ValidateDrawState(binding_req_map, state.dynamicOffsets[setIndex], cb_node, function, &err_str)) { auto set = descriptor_set->GetSet(); - result |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, HandleToUint64(set), __LINE__, - DRAWSTATE_DESCRIPTOR_SET_NOT_UPDATED, "DS", - "Descriptor set 0x%" PRIxLEAST64 " encountered the following validation error at %s time: %s", - HandleToUint64(set), function, err_str.c_str()); + result |= log_msg( + dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, + HandleToUint64(set), DRAWSTATE_DESCRIPTOR_SET_NOT_UPDATED, + "Descriptor set 0x%" PRIx64 " bound as set #%u encountered the following validation error at %s time: %s", + HandleToUint64(set), setIndex, function, err_str.c_str()); } } } @@ -1203,16 +1257,20 @@ static void UpdateDrawState(layer_data *dev_data, GLOBAL_CB_NODE *cb_state, const VkPipelineBindPoint bind_point) { auto const &state = cb_state->lastBound[bind_point]; PIPELINE_STATE *pPipe = state.pipeline_state; - if (VK_NULL_HANDLE != state.pipeline_layout.layout) { + if (VK_NULL_HANDLE != state.pipeline_layout) { for (const auto &set_binding_pair : pPipe->active_slots) { uint32_t setIndex = set_binding_pair.first; // Pull the set node cvdescriptorset::DescriptorSet *descriptor_set = state.boundDescriptorSets[setIndex]; if (!descriptor_set->IsPushDescriptor()) { + // For the "bindless" style resource usage with many descriptors, need to optimize command <-> descriptor binding + const cvdescriptorset::PrefilterBindRequestMap reduced_map(*descriptor_set, set_binding_pair.second, cb_state); + const auto &binding_req_map = reduced_map.Map(); + // Bind this set and its active descriptor resources to the command buffer - descriptor_set->BindCommandBuffer(cb_state, set_binding_pair.second); + descriptor_set->BindCommandBuffer(cb_state, binding_req_map); // For given active slots record updated images & buffers - descriptor_set->GetStorageUpdates(set_binding_pair.second, &cb_state->updateBuffers, &cb_state->updateImages); + descriptor_set->GetStorageUpdates(binding_req_map, &cb_state->updateBuffers, &cb_state->updateImages); } } } @@ -1221,35 +1279,8 @@ } } -// Validate HW line width capabilities prior to setting requested line width. -static bool verifyLineWidth(layer_data *dev_data, DRAW_STATE_ERROR dsError, VulkanObjectType object_type, const uint64_t &target, - float lineWidth) { - bool skip = false; - - // First check to see if the physical device supports wide lines. - if ((VK_FALSE == dev_data->enabled_features.wideLines) && (1.0f != lineWidth)) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, get_debug_report_enum[object_type], target, __LINE__, - dsError, "DS", - "Attempt to set lineWidth to %f but physical device wideLines feature " - "not supported/enabled so lineWidth must be 1.0f!", - lineWidth); - } else { - // Otherwise, make sure the width falls in the valid range. - if ((dev_data->phys_dev_properties.properties.limits.lineWidthRange[0] > lineWidth) || - (dev_data->phys_dev_properties.properties.limits.lineWidthRange[1] < lineWidth)) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, get_debug_report_enum[object_type], target, - __LINE__, dsError, "DS", - "Attempt to set lineWidth to %f but physical device limits line width " - "to between [%f, %f]!", - lineWidth, dev_data->phys_dev_properties.properties.limits.lineWidthRange[0], - dev_data->phys_dev_properties.properties.limits.lineWidthRange[1]); - } - } - - return skip; -} - -static bool ValidatePipelineLocked(layer_data *dev_data, std::vector> const &pPipelines, int pipelineIndex) { +static bool ValidatePipelineLocked(layer_data *dev_data, std::vector> const &pPipelines, + int pipelineIndex) { bool skip = false; PIPELINE_STATE *pPipeline = pPipelines[pipelineIndex].get(); @@ -1263,15 +1294,13 @@ (pPipeline->graphicsPipelineCI.basePipelineIndex != -1))) { // This check is a superset of VALIDATION_ERROR_096005a8 and VALIDATION_ERROR_096005aa skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS", + HandleToUint64(pPipeline->pipeline), DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "Invalid Pipeline CreateInfo: exactly one of base pipeline index and handle must be specified"); } else if (pPipeline->graphicsPipelineCI.basePipelineIndex != -1) { if (pPipeline->graphicsPipelineCI.basePipelineIndex >= pipelineIndex) { - skip |= - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_208005a0, "DS", - "Invalid Pipeline CreateInfo: base pipeline must occur earlier in array than derivative pipeline. %s", - validation_error_map[VALIDATION_ERROR_208005a0]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, + HandleToUint64(pPipeline->pipeline), VALIDATION_ERROR_208005a0, + "Invalid Pipeline CreateInfo: base pipeline must occur earlier in array than derivative pipeline."); } else { pBasePipeline = pPipelines[pPipeline->graphicsPipelineCI.basePipelineIndex].get(); } @@ -1281,7 +1310,7 @@ if (pBasePipeline && !(pBasePipeline->graphicsPipelineCI.flags & VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS", + HandleToUint64(pPipeline->pipeline), DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "Invalid Pipeline CreateInfo: base pipeline does not allow derivatives."); } } @@ -1290,7 +1319,8 @@ } // UNLOCKED pipeline validation. DO NOT lookup objects in the layer_data->* maps in this function. -static bool ValidatePipelineUnlocked(layer_data *dev_data, std::vector> const &pPipelines, int pipelineIndex) { +static bool ValidatePipelineUnlocked(layer_data *dev_data, std::vector> const &pPipelines, + int pipelineIndex) { bool skip = false; PIPELINE_STATE *pPipeline = pPipelines[pipelineIndex].get(); @@ -1298,14 +1328,12 @@ // Ensure the subpass index is valid. If not, then validate_and_capture_pipeline_shader_state // produces nonsense errors that confuse users. Other layers should already // emit errors for renderpass being invalid. - auto subpass_desc = &pPipeline->render_pass_ci.pSubpasses[pPipeline->graphicsPipelineCI.subpass]; - if (pPipeline->graphicsPipelineCI.subpass >= pPipeline->render_pass_ci.subpassCount) { + auto subpass_desc = &pPipeline->rp_state->createInfo.pSubpasses[pPipeline->graphicsPipelineCI.subpass]; + if (pPipeline->graphicsPipelineCI.subpass >= pPipeline->rp_state->createInfo.subpassCount) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_096005ee, "DS", - "Invalid Pipeline CreateInfo State: Subpass index %u " - "is out of range for this renderpass (0..%u). %s", - pPipeline->graphicsPipelineCI.subpass, pPipeline->render_pass_ci.subpassCount - 1, - validation_error_map[VALIDATION_ERROR_096005ee]); + HandleToUint64(pPipeline->pipeline), VALIDATION_ERROR_096005ee, + "Invalid Pipeline CreateInfo State: Subpass index %u is out of range for this renderpass (0..%u).", + pPipeline->graphicsPipelineCI.subpass, pPipeline->rp_state->createInfo.subpassCount - 1); subpass_desc = nullptr; } @@ -1314,12 +1342,11 @@ if (color_blend_state->attachmentCount != subpass_desc->colorAttachmentCount) { skip |= log_msg( dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_096005d4, "DS", - "vkCreateGraphicsPipelines(): Render pass (0x%" PRIxLEAST64 - ") subpass %u has colorAttachmentCount of %u which doesn't match the pColorBlendState->attachmentCount of %u. %s", + HandleToUint64(pPipeline->pipeline), VALIDATION_ERROR_096005d4, + "vkCreateGraphicsPipelines(): Render pass (0x%" PRIx64 + ") subpass %u has colorAttachmentCount of %u which doesn't match the pColorBlendState->attachmentCount of %u.", HandleToUint64(pPipeline->rp_state->renderPass), pPipeline->graphicsPipelineCI.subpass, - subpass_desc->colorAttachmentCount, color_blend_state->attachmentCount, - validation_error_map[VALIDATION_ERROR_096005d4]); + subpass_desc->colorAttachmentCount, color_blend_state->attachmentCount); } if (!dev_data->enabled_features.independentBlend) { if (pPipeline->attachments.size() > 1) { @@ -1332,10 +1359,9 @@ sizeof(pAttachments[0]))) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_0f4004ba, "DS", - "Invalid Pipeline CreateInfo: If independent blend feature not " - "enabled, all elements of pAttachments must be identical. %s", - validation_error_map[VALIDATION_ERROR_0f4004ba]); + HandleToUint64(pPipeline->pipeline), VALIDATION_ERROR_0f4004ba, + "Invalid Pipeline CreateInfo: If independent blend feature not enabled, all elements of " + "pAttachments must be identical."); break; } } @@ -1344,9 +1370,8 @@ if (!dev_data->enabled_features.logicOp && (pPipeline->graphicsPipelineCI.pColorBlendState->logicOpEnable != VK_FALSE)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_0f4004bc, "DS", - "Invalid Pipeline CreateInfo: If logic operations feature not enabled, logicOpEnable must be VK_FALSE. %s", - validation_error_map[VALIDATION_ERROR_0f4004bc]); + HandleToUint64(pPipeline->pipeline), VALIDATION_ERROR_0f4004bc, + "Invalid Pipeline CreateInfo: If logic operations feature not enabled, logicOpEnable must be VK_FALSE."); } } @@ -1358,7 +1383,7 @@ for (uint32_t stage = VK_SHADER_STAGE_VERTEX_BIT; stage & VK_SHADER_STAGE_ALL_GRAPHICS; stage <<= 1) { if (pPipeline->duplicate_shaders & stage) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS", + HandleToUint64(pPipeline->pipeline), DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "Invalid Pipeline CreateInfo State: Multiple shaders provided for stage %s", string_VkShaderStageFlagBits(VkShaderStageFlagBits(stage))); } @@ -1367,31 +1392,27 @@ // VS is required if (!(pPipeline->active_shaders & VK_SHADER_STAGE_VERTEX_BIT)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_096005ae, "DS", - "Invalid Pipeline CreateInfo State: Vertex Shader required. %s", - validation_error_map[VALIDATION_ERROR_096005ae]); + HandleToUint64(pPipeline->pipeline), VALIDATION_ERROR_096005ae, + "Invalid Pipeline CreateInfo State: Vertex Shader required."); } // Either both or neither TC/TE shaders should be defined bool has_control = (pPipeline->active_shaders & VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) != 0; bool has_eval = (pPipeline->active_shaders & VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT) != 0; if (has_control && !has_eval) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_096005b2, "DS", - "Invalid Pipeline CreateInfo State: TE and TC shaders must be included or excluded as a pair. %s", - validation_error_map[VALIDATION_ERROR_096005b2]); + HandleToUint64(pPipeline->pipeline), VALIDATION_ERROR_096005b2, + "Invalid Pipeline CreateInfo State: TE and TC shaders must be included or excluded as a pair."); } if (!has_control && has_eval) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_096005b4, "DS", - "Invalid Pipeline CreateInfo State: TE and TC shaders must be included or excluded as a pair. %s", - validation_error_map[VALIDATION_ERROR_096005b4]); + HandleToUint64(pPipeline->pipeline), VALIDATION_ERROR_096005b4, + "Invalid Pipeline CreateInfo State: TE and TC shaders must be included or excluded as a pair."); } // Compute shaders should be specified independent of Gfx shaders if (pPipeline->active_shaders & VK_SHADER_STAGE_COMPUTE_BIT) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_096005b0, "DS", - "Invalid Pipeline CreateInfo State: Do not specify Compute Shader for Gfx Pipeline. %s", - validation_error_map[VALIDATION_ERROR_096005b0]); + HandleToUint64(pPipeline->pipeline), VALIDATION_ERROR_096005b0, + "Invalid Pipeline CreateInfo State: Do not specify Compute Shader for Gfx Pipeline."); } // VK_PRIMITIVE_TOPOLOGY_PATCH_LIST primitive topology is only valid for tessellation pipelines. // Mismatching primitive topology and tessellation fails graphics pipeline creation. @@ -1399,49 +1420,37 @@ (!pPipeline->graphicsPipelineCI.pInputAssemblyState || pPipeline->graphicsPipelineCI.pInputAssemblyState->topology != VK_PRIMITIVE_TOPOLOGY_PATCH_LIST)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_096005c0, "DS", - "Invalid Pipeline CreateInfo State: " - "VK_PRIMITIVE_TOPOLOGY_PATCH_LIST must be set as IA " - "topology for tessellation pipelines. %s", - validation_error_map[VALIDATION_ERROR_096005c0]); + HandleToUint64(pPipeline->pipeline), VALIDATION_ERROR_096005c0, + "Invalid Pipeline CreateInfo State: VK_PRIMITIVE_TOPOLOGY_PATCH_LIST must be set as IA topology for " + "tessellation pipelines."); } if (pPipeline->graphicsPipelineCI.pInputAssemblyState && pPipeline->graphicsPipelineCI.pInputAssemblyState->topology == VK_PRIMITIVE_TOPOLOGY_PATCH_LIST) { if (!has_control || !has_eval) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_096005c2, "DS", - "Invalid Pipeline CreateInfo State: " - "VK_PRIMITIVE_TOPOLOGY_PATCH_LIST primitive " - "topology is only valid for tessellation pipelines. %s", - validation_error_map[VALIDATION_ERROR_096005c2]); + HandleToUint64(pPipeline->pipeline), VALIDATION_ERROR_096005c2, + "Invalid Pipeline CreateInfo State: VK_PRIMITIVE_TOPOLOGY_PATCH_LIST primitive topology is only valid " + "for tessellation pipelines."); } } // If a rasterization state is provided... if (pPipeline->graphicsPipelineCI.pRasterizationState) { - // Make sure that the line width conforms to the HW. - if (!isDynamic(pPipeline, VK_DYNAMIC_STATE_LINE_WIDTH)) { - skip |= - verifyLineWidth(dev_data, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, kVulkanObjectTypePipeline, - HandleToUint64(pPipeline->pipeline), pPipeline->graphicsPipelineCI.pRasterizationState->lineWidth); - } - if ((pPipeline->graphicsPipelineCI.pRasterizationState->depthClampEnable == VK_TRUE) && (!dev_data->enabled_features.depthClamp)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_1020061c, "DS", - "vkCreateGraphicsPipelines(): the depthClamp device feature is disabled: the depthClampEnable " - "member of the VkPipelineRasterizationStateCreateInfo structure must be set to VK_FALSE. %s", - validation_error_map[VALIDATION_ERROR_1020061c]); + HandleToUint64(pPipeline->pipeline), VALIDATION_ERROR_1020061c, + "vkCreateGraphicsPipelines(): the depthClamp device feature is disabled: the depthClampEnable member " + "of the VkPipelineRasterizationStateCreateInfo structure must be set to VK_FALSE."); } if (!isDynamic(pPipeline, VK_DYNAMIC_STATE_DEPTH_BIAS) && (pPipeline->graphicsPipelineCI.pRasterizationState->depthBiasClamp != 0.0) && (!dev_data->enabled_features.depthBiasClamp)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, DRAWSTATE_INVALID_FEATURE, "DS", - "vkCreateGraphicsPipelines(): the depthBiasClamp device feature is disabled: the depthBiasClamp " - "member of the VkPipelineRasterizationStateCreateInfo structure must be set to 0.0 unless the " + HandleToUint64(pPipeline->pipeline), DRAWSTATE_INVALID_FEATURE, + "vkCreateGraphicsPipelines(): the depthBiasClamp device feature is disabled: the depthBiasClamp member " + "of the VkPipelineRasterizationStateCreateInfo structure must be set to 0.0 unless the " "VK_DYNAMIC_STATE_DEPTH_BIAS dynamic state is enabled"); } @@ -1450,10 +1459,9 @@ if ((pPipeline->graphicsPipelineCI.pMultisampleState->alphaToOneEnable == VK_TRUE) && (!dev_data->enabled_features.alphaToOne)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_10000622, "DS", + HandleToUint64(pPipeline->pipeline), VALIDATION_ERROR_10000622, "vkCreateGraphicsPipelines(): the alphaToOne device feature is disabled: the alphaToOneEnable " - "member of the VkPipelineMultisampleStateCreateInfo structure must be set to VK_FALSE. %s", - validation_error_map[VALIDATION_ERROR_10000622]); + "member of the VkPipelineMultisampleStateCreateInfo structure must be set to VK_FALSE."); } // If subpass uses a depth/stencil attachment, pDepthStencilState must be a pointer to a valid structure @@ -1461,18 +1469,17 @@ subpass_desc->pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) { if (!pPipeline->graphicsPipelineCI.pDepthStencilState) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_096005e0, "DS", - "Invalid Pipeline CreateInfo State: pDepthStencilState is NULL when rasterization is " - "enabled and subpass uses a depth/stencil attachment. %s", - validation_error_map[VALIDATION_ERROR_096005e0]); + HandleToUint64(pPipeline->pipeline), VALIDATION_ERROR_096005e0, + "Invalid Pipeline CreateInfo State: pDepthStencilState is NULL when rasterization is enabled " + "and subpass uses a depth/stencil attachment."); } else if ((pPipeline->graphicsPipelineCI.pDepthStencilState->depthBoundsTestEnable == VK_TRUE) && (!dev_data->enabled_features.depthBounds)) { - skip |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, DRAWSTATE_INVALID_FEATURE, "DS", - "vkCreateGraphicsPipelines(): the depthBounds device feature is disabled: the depthBoundsTestEnable " - "member of the VkPipelineDepthStencilStateCreateInfo structure must be set to VK_FALSE."); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, + HandleToUint64(pPipeline->pipeline), VALIDATION_ERROR_0f6004ac, + "vkCreateGraphicsPipelines(): the depthBounds device feature is disabled: the " + "depthBoundsTestEnable member of the VkPipelineDepthStencilStateCreateInfo structure must be " + "set to VK_FALSE."); } } @@ -1486,10 +1493,9 @@ } if (color_attachment_count > 0 && pPipeline->graphicsPipelineCI.pColorBlendState == nullptr) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_096005e2, "DS", - "Invalid Pipeline CreateInfo State: pColorBlendState is NULL when rasterization is " - "enabled and subpass uses color attachments. %s", - validation_error_map[VALIDATION_ERROR_096005e2]); + HandleToUint64(pPipeline->pipeline), VALIDATION_ERROR_096005e2, + "Invalid Pipeline CreateInfo State: pColorBlendState is NULL when rasterization is enabled and " + "subpass uses color attachments."); } } } @@ -1501,14 +1507,15 @@ VkFormat format = vi->pVertexAttributeDescriptions[j].format; // Internal call to get format info. Still goes through layers, could potentially go directly to ICD. VkFormatProperties properties; - dev_data->instance_data->dispatch_table.GetPhysicalDeviceFormatProperties(dev_data->physical_device, format, &properties); + dev_data->instance_data->dispatch_table.GetPhysicalDeviceFormatProperties(dev_data->physical_device, format, + &properties); if ((properties.bufferFeatures & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) == 0) { - skip |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_14a004de, "IMAGE", - "vkCreateGraphicsPipelines: pCreateInfo[%d].pVertexInputState->vertexAttributeDescriptions[%d].format " - "(%s) is not a supported vertex buffer format. %s", - pipelineIndex, j, string_VkFormat(format), validation_error_map[VALIDATION_ERROR_14a004de]); + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_14a004de, + "vkCreateGraphicsPipelines: pCreateInfo[%d].pVertexInputState->vertexAttributeDescriptions[%d].format " + "(%s) is not a supported vertex buffer format.", + pipelineIndex, j, string_VkFormat(format)); } } } @@ -1517,21 +1524,24 @@ VkSampleCountFlagBits max_sample_count = static_cast(0); for (uint32_t i = 0; i < subpass_desc->colorAttachmentCount; ++i) { if (subpass_desc->pColorAttachments[i].attachment != VK_ATTACHMENT_UNUSED) { - max_sample_count = std::max(max_sample_count, pPipeline->render_pass_ci.pAttachments[subpass_desc->pColorAttachments[i].attachment].samples); + max_sample_count = + std::max(max_sample_count, + pPipeline->rp_state->createInfo.pAttachments[subpass_desc->pColorAttachments[i].attachment].samples); } } if (subpass_desc->pDepthStencilAttachment && subpass_desc->pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) { - max_sample_count = std::max(max_sample_count, pPipeline->render_pass_ci.pAttachments[subpass_desc->pDepthStencilAttachment->attachment].samples); + max_sample_count = + std::max(max_sample_count, + pPipeline->rp_state->createInfo.pAttachments[subpass_desc->pDepthStencilAttachment->attachment].samples); } if (pPipeline->graphicsPipelineCI.pMultisampleState->rasterizationSamples != max_sample_count) { - skip |= - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_09600bc2, "DS", - "vkCreateGraphicsPipelines: pCreateInfo[%d].pMultisampleState->rasterizationSamples (%s) != max attachment samples (%s) " - "used in subpass %u. %s", - pipelineIndex, string_VkSampleCountFlagBits(pPipeline->graphicsPipelineCI.pMultisampleState->rasterizationSamples), - string_VkSampleCountFlagBits(max_sample_count), pPipeline->graphicsPipelineCI.subpass, - validation_error_map[VALIDATION_ERROR_09600bc2]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, + HandleToUint64(pPipeline->pipeline), VALIDATION_ERROR_09600bc2, + "vkCreateGraphicsPipelines: pCreateInfo[%d].pMultisampleState->rasterizationSamples (%s) != max " + "attachment samples (%s) used in subpass %u.", + pipelineIndex, + string_VkSampleCountFlagBits(pPipeline->graphicsPipelineCI.pMultisampleState->rasterizationSamples), + string_VkSampleCountFlagBits(max_sample_count), pPipeline->graphicsPipelineCI.subpass); } } @@ -1559,16 +1569,16 @@ auto set_node = dev_data->setMap.find(set); if (set_node == dev_data->setMap.end()) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, - HandleToUint64(set), __LINE__, DRAWSTATE_DOUBLE_DESTROY, "DS", - "Cannot call %s() on descriptor set 0x%" PRIxLEAST64 " that has not been allocated.", func_str.c_str(), + HandleToUint64(set), DRAWSTATE_DOUBLE_DESTROY, + "Cannot call %s() on descriptor set 0x%" PRIx64 " that has not been allocated.", func_str.c_str(), HandleToUint64(set)); } else { // TODO : This covers various error cases so should pass error enum into this function and use passed in enum here if (set_node->second->in_use.load()) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, - HandleToUint64(set), __LINE__, VALIDATION_ERROR_2860026a, "DS", - "Cannot call %s() on descriptor set 0x%" PRIxLEAST64 " that is in use by a command buffer. %s", - func_str.c_str(), HandleToUint64(set), validation_error_map[VALIDATION_ERROR_2860026a]); + HandleToUint64(set), VALIDATION_ERROR_2860026a, + "Cannot call %s() on descriptor set 0x%" PRIx64 " that is in use by a command buffer.", + func_str.c_str(), HandleToUint64(set)); } } return skip; @@ -1625,11 +1635,11 @@ if (pCB->activeSubpassContents == VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS && (cmd_type != CMD_EXECUTECOMMANDS && cmd_type != CMD_NEXTSUBPASS && cmd_type != CMD_ENDRENDERPASS)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pCB->commandBuffer), __LINE__, DRAWSTATE_INVALID_COMMAND_BUFFER, "DS", + HandleToUint64(pCB->commandBuffer), DRAWSTATE_INVALID_COMMAND_BUFFER, "Commands cannot be called in a subpass using secondary command buffers."); } else if (pCB->activeSubpassContents == VK_SUBPASS_CONTENTS_INLINE && cmd_type == CMD_EXECUTECOMMANDS) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pCB->commandBuffer), __LINE__, DRAWSTATE_INVALID_COMMAND_BUFFER, "DS", + HandleToUint64(pCB->commandBuffer), DRAWSTATE_INVALID_COMMAND_BUFFER, "vkCmdExecuteCommands() cannot be called in a subpass using inline commands."); } return skip; @@ -1651,19 +1661,17 @@ } } return log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, error_code, "DS", - "Cannot call %s on a command buffer allocated from a pool without %s capabilities. %s.", caller_name, - required_flags_string.c_str(), validation_error_map[error_code]); + HandleToUint64(cb_node->commandBuffer), error_code, + "Cannot call %s on a command buffer allocated from a pool without %s capabilities..", caller_name, + required_flags_string.c_str()); } } return false; } -static char const * GetCauseStr(VK_OBJECT obj) { - if (obj.type == kVulkanObjectTypeDescriptorSet) - return "destroyed or updated"; - if (obj.type == kVulkanObjectTypeCommandBuffer) - return "destroyed or rerecorded"; +static char const *GetCauseStr(VK_OBJECT obj) { + if (obj.type == kVulkanObjectTypeDescriptorSet) return "destroyed or updated"; + if (obj.type == kVulkanObjectTypeCommandBuffer) return "destroyed or rerecorded"; return "destroyed"; } @@ -1673,12 +1681,79 @@ const char *type_str = object_string[obj.type]; const char *cause_str = GetCauseStr(obj); skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_state->commandBuffer), __LINE__, DRAWSTATE_INVALID_COMMAND_BUFFER, "DS", - "You are adding %s to command buffer 0x%p that is invalid because bound %s 0x%" PRIxLEAST64 " was %s.", - call_source, cb_state->commandBuffer, type_str, obj.handle, cause_str); - } - return skip; -} + HandleToUint64(cb_state->commandBuffer), DRAWSTATE_INVALID_COMMAND_BUFFER, + "You are adding %s to command buffer 0x%" PRIx64 " that is invalid because bound %s 0x%" PRIx64 " was %s.", + call_source, HandleToUint64(cb_state->commandBuffer), type_str, obj.handle, cause_str); + } + return skip; +} + +// 'commandBuffer must be in the recording state' valid usage error code for each command +// Note: grepping for ^^^^^^^^^ in vk_validation_database is easily massaged into the following list +// Note: C++11 doesn't automatically devolve enum types to the underlying type for hash traits purposes (fixed in C++14) +using CmdTypeHashType = std::underlying_type::type; +static const std::unordered_map must_be_recording_map = { + {CMD_NONE, VALIDATION_ERROR_UNDEFINED}, // UNMATCHED + {CMD_BEGINQUERY, VALIDATION_ERROR_17802413}, + {CMD_BEGINRENDERPASS, VALIDATION_ERROR_17a02413}, + {CMD_BINDDESCRIPTORSETS, VALIDATION_ERROR_17c02413}, + {CMD_BINDINDEXBUFFER, VALIDATION_ERROR_17e02413}, + {CMD_BINDPIPELINE, VALIDATION_ERROR_18002413}, + {CMD_BINDVERTEXBUFFERS, VALIDATION_ERROR_18202413}, + {CMD_BLITIMAGE, VALIDATION_ERROR_18402413}, + {CMD_CLEARATTACHMENTS, VALIDATION_ERROR_18602413}, + {CMD_CLEARCOLORIMAGE, VALIDATION_ERROR_18802413}, + {CMD_CLEARDEPTHSTENCILIMAGE, VALIDATION_ERROR_18a02413}, + {CMD_COPYBUFFER, VALIDATION_ERROR_18c02413}, + {CMD_COPYBUFFERTOIMAGE, VALIDATION_ERROR_18e02413}, + {CMD_COPYIMAGE, VALIDATION_ERROR_19002413}, + {CMD_COPYIMAGETOBUFFER, VALIDATION_ERROR_19202413}, + {CMD_COPYQUERYPOOLRESULTS, VALIDATION_ERROR_19402413}, + {CMD_DEBUGMARKERBEGINEXT, VALIDATION_ERROR_19602413}, + {CMD_DEBUGMARKERENDEXT, VALIDATION_ERROR_19802413}, + {CMD_DEBUGMARKERINSERTEXT, VALIDATION_ERROR_19a02413}, + {CMD_DISPATCH, VALIDATION_ERROR_19c02413}, + // Exclude KHX (if not already present) { CMD_DISPATCHBASEKHX, VALIDATION_ERROR_19e02413 }, + {CMD_DISPATCHINDIRECT, VALIDATION_ERROR_1a002413}, + {CMD_DRAW, VALIDATION_ERROR_1a202413}, + {CMD_DRAWINDEXED, VALIDATION_ERROR_1a402413}, + {CMD_DRAWINDEXEDINDIRECT, VALIDATION_ERROR_1a602413}, + // Exclude vendor ext (if not already present) { CMD_DRAWINDEXEDINDIRECTCOUNTAMD, VALIDATION_ERROR_1a802413 }, + {CMD_DRAWINDIRECT, VALIDATION_ERROR_1aa02413}, + // Exclude vendor ext (if not already present) { CMD_DRAWINDIRECTCOUNTAMD, VALIDATION_ERROR_1ac02413 }, + {CMD_ENDCOMMANDBUFFER, VALIDATION_ERROR_27400076}, + {CMD_ENDQUERY, VALIDATION_ERROR_1ae02413}, + {CMD_ENDRENDERPASS, VALIDATION_ERROR_1b002413}, + {CMD_EXECUTECOMMANDS, VALIDATION_ERROR_1b202413}, + {CMD_FILLBUFFER, VALIDATION_ERROR_1b402413}, + {CMD_NEXTSUBPASS, VALIDATION_ERROR_1b602413}, + {CMD_PIPELINEBARRIER, VALIDATION_ERROR_1b802413}, + // Exclude vendor ext (if not already present) { CMD_PROCESSCOMMANDSNVX, VALIDATION_ERROR_1ba02413 }, + {CMD_PUSHCONSTANTS, VALIDATION_ERROR_1bc02413}, + {CMD_PUSHDESCRIPTORSETKHR, VALIDATION_ERROR_1be02413}, + {CMD_PUSHDESCRIPTORSETWITHTEMPLATEKHR, VALIDATION_ERROR_1c002413}, + // Exclude vendor ext (if not already present) { CMD_RESERVESPACEFORCOMMANDSNVX, VALIDATION_ERROR_1c202413 }, + {CMD_RESETEVENT, VALIDATION_ERROR_1c402413}, + {CMD_RESETQUERYPOOL, VALIDATION_ERROR_1c602413}, + {CMD_RESOLVEIMAGE, VALIDATION_ERROR_1c802413}, + {CMD_SETBLENDCONSTANTS, VALIDATION_ERROR_1ca02413}, + {CMD_SETDEPTHBIAS, VALIDATION_ERROR_1cc02413}, + {CMD_SETDEPTHBOUNDS, VALIDATION_ERROR_1ce02413}, + // Exclude KHX (if not already present) { CMD_SETDEVICEMASKKHX, VALIDATION_ERROR_1d002413 }, + {CMD_SETDISCARDRECTANGLEEXT, VALIDATION_ERROR_1d202413}, + {CMD_SETEVENT, VALIDATION_ERROR_1d402413}, + {CMD_SETLINEWIDTH, VALIDATION_ERROR_1d602413}, + {CMD_SETSAMPLELOCATIONSEXT, VALIDATION_ERROR_3e202413}, + {CMD_SETSCISSOR, VALIDATION_ERROR_1d802413}, + {CMD_SETSTENCILCOMPAREMASK, VALIDATION_ERROR_1da02413}, + {CMD_SETSTENCILREFERENCE, VALIDATION_ERROR_1dc02413}, + {CMD_SETSTENCILWRITEMASK, VALIDATION_ERROR_1de02413}, + {CMD_SETVIEWPORT, VALIDATION_ERROR_1e002413}, + // Exclude vendor ext (if not already present) { CMD_SETVIEWPORTWSCALINGNV, VALIDATION_ERROR_1e202413 }, + {CMD_UPDATEBUFFER, VALIDATION_ERROR_1e402413}, + {CMD_WAITEVENTS, VALIDATION_ERROR_1e602413}, + {CMD_WRITETIMESTAMP, VALIDATION_ERROR_1e802413}, +}; // Validate the given command being added to the specified cmd buffer, flagging errors if CB is not in the recording state or if // there's an issue with the Cmd ordering @@ -1692,9 +1767,16 @@ return ReportInvalidCommandBuffer(dev_data, cb_state, caller_name); default: + auto error_it = must_be_recording_map.find(cmd); + // This assert lets us know that a vkCmd.* entrypoint has been added without enabling it in the map + assert(error_it != must_be_recording_map.cend()); + if (error_it == must_be_recording_map.cend()) { + error_it = must_be_recording_map.find(CMD_NONE); // But we'll handle the asserting case, in case of a test gap + } + const auto error = error_it->second; return log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_state->commandBuffer), __LINE__, DRAWSTATE_NO_BEGIN_COMMAND_BUFFER, "DS", - "You must call vkBeginCommandBuffer() before this call to %s", caller_name); + HandleToUint64(cb_state->commandBuffer), error, + "You must call vkBeginCommandBuffer() before this call to %s.", caller_name); } } @@ -1780,7 +1862,7 @@ } // Reset the command buffer state // Maintain the createInfo and set state to CB_NEW, but clear all other state -static void resetCB(layer_data *dev_data, const VkCommandBuffer cb) { +static void ResetCommandBufferState(layer_data *dev_data, const VkCommandBuffer cb) { GLOBAL_CB_NODE *pCB = dev_data->commandBufferMap[cb]; if (pCB) { pCB->in_use.store(0); @@ -1791,6 +1873,7 @@ pCB->hasDrawCmd = false; pCB->state = CB_NEW; pCB->submitCount = 0; + pCB->image_layout_change_count = 1; // Start at 1. 0 is insert value for validation cache versions, s.t. new == dirty pCB->status = 0; pCB->static_status = 0; pCB->viewportMask = 0; @@ -1820,9 +1903,7 @@ pCB->primaryCommandBuffer = VK_NULL_HANDLE; // If secondary, invalidate any primary command buffer that may call us. if (pCB->createInfo.level == VK_COMMAND_BUFFER_LEVEL_SECONDARY) { - invalidateCommandBuffers(dev_data, - pCB->linkedCommandBuffers, - {HandleToUint64(cb), kVulkanObjectTypeCommandBuffer}); + invalidateCommandBuffers(dev_data, pCB->linkedCommandBuffers, {HandleToUint64(cb), kVulkanObjectTypeCommandBuffer}); } // Remove reverse command buffer links. @@ -1903,9 +1984,9 @@ bool inside = false; if (pCB->activeRenderPass) { inside = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pCB->commandBuffer), __LINE__, msgCode, "DS", - "%s: It is invalid to issue this call inside an active render pass (0x%" PRIxLEAST64 "). %s", apiName, - HandleToUint64(pCB->activeRenderPass->renderPass), validation_error_map[msgCode]); + HandleToUint64(pCB->commandBuffer), msgCode, + "%s: It is invalid to issue this call inside an active render pass (0x%" PRIx64 ").", apiName, + HandleToUint64(pCB->activeRenderPass->renderPass)); } return inside; } @@ -1918,18 +1999,20 @@ ((pCB->createInfo.level == VK_COMMAND_BUFFER_LEVEL_SECONDARY) && (!pCB->activeRenderPass) && !(pCB->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT))) { outside = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pCB->commandBuffer), __LINE__, msgCode, "DS", - "%s: This call must be issued inside an active render pass. %s", apiName, validation_error_map[msgCode]); + HandleToUint64(pCB->commandBuffer), msgCode, "%s: This call must be issued inside an active render pass.", + apiName); } return outside; } static void init_core_validation(instance_layer_data *instance_data, const VkAllocationCallbacks *pAllocator) { - layer_debug_actions(instance_data->report_data, instance_data->logging_callback, pAllocator, "lunarg_core_validation"); + layer_debug_report_actions(instance_data->report_data, instance_data->logging_callback, pAllocator, "lunarg_core_validation"); + layer_debug_messenger_actions(instance_data->report_data, instance_data->logging_messenger, pAllocator, + "lunarg_core_validation"); } // For the given ValidationCheck enum, set all relevant instance disabled flags to true -void SetDisabledFlags(instance_layer_data *instance_data, VkValidationFlagsEXT *val_flags_struct) { +void SetDisabledFlags(instance_layer_data *instance_data, const VkValidationFlagsEXT *val_flags_struct) { for (uint32_t i = 0; i < val_flags_struct->disabledValidationCheckCount; ++i) { switch (val_flags_struct->pDisabledValidationChecks[i]) { case VK_VALIDATION_CHECK_SHADERS_EXT: @@ -1963,22 +2046,18 @@ instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(*pInstance), instance_layer_data_map); instance_data->instance = *pInstance; layer_init_instance_dispatch_table(*pInstance, &instance_data->dispatch_table, fpGetInstanceProcAddr); - instance_data->report_data = debug_report_create_instance( + instance_data->report_data = debug_utils_create_instance( &instance_data->dispatch_table, *pInstance, pCreateInfo->enabledExtensionCount, pCreateInfo->ppEnabledExtensionNames); - instance_data->extensions.InitFromInstanceCreateInfo(pCreateInfo); + + instance_data->api_version = instance_data->extensions.InitFromInstanceCreateInfo( + (pCreateInfo->pApplicationInfo ? pCreateInfo->pApplicationInfo->apiVersion : VK_API_VERSION_1_0), pCreateInfo); init_core_validation(instance_data, pAllocator); ValidateLayerOrdering(*pCreateInfo); // Parse any pNext chains - if (pCreateInfo->pNext) { - GENERIC_HEADER *struct_header = (GENERIC_HEADER *)pCreateInfo->pNext; - while (struct_header) { - // Check for VkValidationFlagsExt - if (VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT == struct_header->sType) { - SetDisabledFlags(instance_data, (VkValidationFlagsEXT *)struct_header); - } - struct_header = (GENERIC_HEADER *)struct_header->pNext; - } + const auto *validation_flags_ext = lvl_find_in_chain(pCreateInfo->pNext); + if (validation_flags_ext) { + SetDisabledFlags(instance_data, validation_flags_ext); } return result; @@ -1995,25 +2074,29 @@ lock_guard_t lock(global_lock); // Clean up logging callback, if any + while (instance_data->logging_messenger.size() > 0) { + VkDebugUtilsMessengerEXT messenger = instance_data->logging_messenger.back(); + layer_destroy_messenger_callback(instance_data->report_data, messenger, pAllocator); + instance_data->logging_messenger.pop_back(); + } while (instance_data->logging_callback.size() > 0) { VkDebugReportCallbackEXT callback = instance_data->logging_callback.back(); - layer_destroy_msg_callback(instance_data->report_data, callback, pAllocator); + layer_destroy_report_callback(instance_data->report_data, callback, pAllocator); instance_data->logging_callback.pop_back(); } - layer_debug_report_destroy_instance(instance_data->report_data); + layer_debug_utils_destroy_instance(instance_data->report_data); FreeLayerDataPtr(key, instance_layer_data_map); } static bool ValidatePhysicalDeviceQueueFamily(instance_layer_data *instance_data, const PHYSICAL_DEVICE_STATE *pd_state, uint32_t requested_queue_family, int32_t err_code, const char *cmd_name, - const char *queue_family_var_name, const char *vu_note = nullptr) { + const char *queue_family_var_name) { bool skip = false; - if (!vu_note) vu_note = validation_error_map[err_code]; - - const char *conditional_ext_cmd = - instance_data->extensions.vk_khr_get_physical_device_properties_2 ? "or vkGetPhysicalDeviceQueueFamilyProperties2KHR" : ""; + const char *conditional_ext_cmd = instance_data->extensions.vk_khr_get_physical_device_properties_2 + ? "or vkGetPhysicalDeviceQueueFamilyProperties2[KHR]" + : ""; std::string count_note = (UNCALLED == pd_state->vkGetPhysicalDeviceQueueFamilyPropertiesState) ? "the pQueueFamilyPropertyCount was never obtained" @@ -2021,11 +2104,11 @@ if (requested_queue_family >= pd_state->queue_family_count) { skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, - HandleToUint64(pd_state->phys_device), __LINE__, err_code, "DL", + HandleToUint64(pd_state->phys_device), err_code, "%s: %s (= %" PRIu32 ") is not less than any previously obtained pQueueFamilyPropertyCount from " - "vkGetPhysicalDeviceQueueFamilyProperties%s (%s). %s", - cmd_name, queue_family_var_name, requested_queue_family, conditional_ext_cmd, count_note.c_str(), vu_note); + "vkGetPhysicalDeviceQueueFamilyProperties%s (%s).", + cmd_name, queue_family_var_name, requested_queue_family, conditional_ext_cmd, count_note.c_str()); } return skip; } @@ -2049,7 +2132,7 @@ const auto queue_family_props_count = pd_state->queue_family_properties.size(); const bool queue_family_has_props = requested_queue_family < queue_family_props_count; const char *conditional_ext_cmd = instance_data->extensions.vk_khr_get_physical_device_properties_2 - ? "or vkGetPhysicalDeviceQueueFamilyProperties2KHR" + ? "or vkGetPhysicalDeviceQueueFamilyProperties2[KHR]" : ""; std::string count_note = !queue_family_has_props @@ -2059,17 +2142,13 @@ if (!queue_family_has_props || requested_queue_count > pd_state->queue_family_properties[requested_queue_family].queueCount) { - skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, HandleToUint64(pd_state->phys_device), __LINE__, - VALIDATION_ERROR_06c002fc, "DL", - "vkCreateDevice: pCreateInfo->pQueueCreateInfos[%" PRIu32 "].queueCount (=%" PRIu32 - ") is not " - "less than or equal to available queue count for this " - "pCreateInfo->pQueueCreateInfos[%" PRIu32 "].queueFamilyIndex} (=%" PRIu32 - ") obtained previously " - "from vkGetPhysicalDeviceQueueFamilyProperties%s (%s). %s", - i, requested_queue_count, i, requested_queue_family, conditional_ext_cmd, count_note.c_str(), - validation_error_map[VALIDATION_ERROR_06c002fc]); + skip |= log_msg( + instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, + HandleToUint64(pd_state->phys_device), VALIDATION_ERROR_06c002fc, + "vkCreateDevice: pCreateInfo->pQueueCreateInfos[%" PRIu32 "].queueCount (=%" PRIu32 + ") is not less than or equal to available queue count for this pCreateInfo->pQueueCreateInfos[%" PRIu32 + "].queueFamilyIndex} (=%" PRIu32 ") obtained previously from vkGetPhysicalDeviceQueueFamilyProperties%s (%s).", + i, requested_queue_count, i, requested_queue_family, conditional_ext_cmd, count_note.c_str()); } } } @@ -2092,9 +2171,9 @@ for (uint32_t i = 0; i < total_bools; i++) { if (requested[i] > actual[i]) { skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, DEVLIMITS_INVALID_FEATURE_REQUESTED, "DL", - "While calling vkCreateDevice(), requesting feature '%s' in VkPhysicalDeviceFeatures struct, " - "which is not available on this device.", + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, DEVLIMITS_INVALID_FEATURE_REQUESTED, + "While calling vkCreateDevice(), requesting feature '%s' in VkPhysicalDeviceFeatures struct, which is " + "not available on this device.", GetPhysDevFeatureString(i)); errors++; } @@ -2103,9 +2182,9 @@ // If user didn't request features, notify them that they should // TODO: Verify this against the spec. I believe this is an invalid use of the API and should return an error skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, - 0, __LINE__, DEVLIMITS_INVALID_FEATURE_REQUESTED, "DL", - "You requested features that are unavailable on this device. You should first query feature " - "availability by calling vkGetPhysicalDeviceFeatures()."); + 0, DEVLIMITS_INVALID_FEATURE_REQUESTED, + "You requested features that are unavailable on this device. You should first query feature availability " + "by calling vkGetPhysicalDeviceFeatures()."); } return skip; } @@ -2121,15 +2200,25 @@ // TODO: object_tracker should perhaps do this instead // and it does not seem to currently work anyway -- the loader just crashes before this point if (!GetPhysicalDeviceState(instance_data, gpu)) { - skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, - 0, __LINE__, DEVLIMITS_MUST_QUERY_COUNT, "DL", - "Invalid call to vkCreateDevice() w/o first calling vkEnumeratePhysicalDevices()."); + skip |= + log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, + DEVLIMITS_MUST_QUERY_COUNT, "Invalid call to vkCreateDevice() w/o first calling vkEnumeratePhysicalDevices()."); } // Check that any requested features are available - if (pCreateInfo->pEnabledFeatures) { - skip |= ValidateRequestedFeatures(instance_data, pd_state, pCreateInfo->pEnabledFeatures); + // The enabled features can come from either pEnabledFeatures, or from the pNext chain + const VkPhysicalDeviceFeatures *enabled_features_found = pCreateInfo->pEnabledFeatures; + if (nullptr == enabled_features_found) { + const auto *features2 = lvl_find_in_chain(pCreateInfo->pNext); + if (features2) { + enabled_features_found = &(features2->features); + } + } + + if (enabled_features_found) { + skip |= ValidateRequestedFeatures(instance_data, pd_state, enabled_features_found); } + skip |= ValidateDeviceQueueCreateInfos(instance_data, pd_state, pCreateInfo->queueCreateInfoCount, pCreateInfo->pQueueCreateInfos); @@ -2165,25 +2254,49 @@ // Save PhysicalDevice handle device_data->physical_device = gpu; - device_data->report_data = layer_debug_report_create_device(instance_data->report_data, *pDevice); - device_data->extensions.InitFromDeviceCreateInfo(&instance_data->extensions, pCreateInfo); + device_data->report_data = layer_debug_utils_create_device(instance_data->report_data, *pDevice); // Get physical device limits for this device instance_data->dispatch_table.GetPhysicalDeviceProperties(gpu, &(device_data->phys_dev_properties.properties)); + + device_data->api_version = device_data->extensions.InitFromDeviceCreateInfo( + &instance_data->extensions, device_data->phys_dev_properties.properties.apiVersion, pCreateInfo); + uint32_t count; instance_data->dispatch_table.GetPhysicalDeviceQueueFamilyProperties(gpu, &count, nullptr); device_data->phys_dev_properties.queue_family_properties.resize(count); instance_data->dispatch_table.GetPhysicalDeviceQueueFamilyProperties( gpu, &count, &device_data->phys_dev_properties.queue_family_properties[0]); // TODO: device limits should make sure these are compatible - if (pCreateInfo->pEnabledFeatures) { - device_data->enabled_features = *pCreateInfo->pEnabledFeatures; + if (enabled_features_found) { + device_data->enabled_features = *enabled_features_found; } else { memset(&device_data->enabled_features, 0, sizeof(VkPhysicalDeviceFeatures)); } // Store physical device properties and physical device mem limits into device layer_data structs instance_data->dispatch_table.GetPhysicalDeviceMemoryProperties(gpu, &device_data->phys_dev_mem_props); instance_data->dispatch_table.GetPhysicalDeviceProperties(gpu, &device_data->phys_dev_props); + + if (device_data->extensions.vk_khr_push_descriptor) { + // Get the needed push_descriptor limits + auto push_descriptor_prop = lvl_init_struct(); + auto prop2 = lvl_init_struct(&push_descriptor_prop); + instance_data->dispatch_table.GetPhysicalDeviceProperties2KHR(gpu, &prop2); + device_data->phys_dev_ext_props.max_push_descriptors = push_descriptor_prop.maxPushDescriptors; + } + if (device_data->extensions.vk_ext_descriptor_indexing) { + // Get the needed descriptor_indexing limits + auto descriptor_indexing_props = lvl_init_struct(); + auto prop2 = lvl_init_struct(&descriptor_indexing_props); + instance_data->dispatch_table.GetPhysicalDeviceProperties2KHR(gpu, &prop2); + device_data->phys_dev_ext_props.descriptor_indexing_props = descriptor_indexing_props; + } + + const auto *descriptor_indexing_features = lvl_find_in_chain(pCreateInfo->pNext); + if (descriptor_indexing_features) { + device_data->phys_dev_ext_props.descriptor_indexing_features = *descriptor_indexing_features; + } + lock.unlock(); ValidateLayerOrdering(*pCreateInfo); @@ -2218,7 +2331,7 @@ // Queues persist until device is destroyed dev_data->queueMap.clear(); // Report any memory leaks - layer_debug_report_destroy_device(device); + layer_debug_utils_destroy_device(device); lock.unlock(); #if DISPATCH_MAP_DEBUG @@ -2237,20 +2350,20 @@ UNIQUE_VALIDATION_ERROR_CODE geo_error_id, UNIQUE_VALIDATION_ERROR_CODE tess_error_id) { bool skip = false; if (!dev_data->enabled_features.geometryShader && (stageMask & VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT)) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - geo_error_id, "DL", - "%s call includes a stageMask with VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT bit set when " - "device does not have geometryShader feature enabled. %s", - caller, validation_error_map[geo_error_id]); + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, geo_error_id, + "%s call includes a stageMask with VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT bit set when device does not have " + "geometryShader feature enabled.", + caller); } if (!dev_data->enabled_features.tessellationShader && (stageMask & (VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT | VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT))) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - tess_error_id, "DL", - "%s call includes a stageMask with VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT " - "and/or VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT bit(s) set when device " - "does not have tessellationShader feature enabled. %s", - caller, validation_error_map[tess_error_id]); + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, tess_error_id, + "%s call includes a stageMask with VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT and/or " + "VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT bit(s) set when device does not have " + "tessellationShader feature enabled.", + caller); } return skip; } @@ -2296,10 +2409,10 @@ bool skip = false; // sequence number we want to validate up to, per queue - std::unordered_map target_seqs { { initial_queue, initial_seq } }; + std::unordered_map target_seqs{{initial_queue, initial_seq}}; // sequence number we've completed validation for, per queue std::unordered_map done_seqs; - std::vector worklist { initial_queue }; + std::vector worklist{initial_queue}; while (worklist.size()) { auto queue = worklist.back(); @@ -2313,8 +2426,7 @@ for (auto &wait : sub_it->waitSemaphores) { auto other_queue = GetQueueState(dev_data, wait.queue); - if (other_queue == queue) - continue; // semaphores /always/ point backwards, so no point here. + if (other_queue == queue) continue; // semaphores /always/ point backwards, so no point here. auto other_target_seq = std::max(target_seqs[other_queue], wait.seq); auto other_done_seq = std::max(done_seqs[other_queue], other_queue->seq); @@ -2335,7 +2447,7 @@ for (auto event : queryEventsPair.second) { if (dev_data->eventMap[event].needsSignaled) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT, 0, 0, DRAWSTATE_INVALID_QUERY, "DS", + VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT, 0, DRAWSTATE_INVALID_QUERY, "Cannot get query results on queryPool 0x%" PRIx64 " with index %d which was guarded by unsignaled event 0x%" PRIx64 ".", HandleToUint64(queryEventsPair.first.pool), queryEventsPair.first.index, @@ -2463,9 +2575,9 @@ if ((pCB->in_use.load() || current_submit_count > 1) && !(pCB->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, 0, - __LINE__, VALIDATION_ERROR_31a0008e, "DS", - "Command Buffer 0x%p is already in use and is not marked for simultaneous use. %s", pCB->commandBuffer, - validation_error_map[VALIDATION_ERROR_31a0008e]); + VALIDATION_ERROR_31a0008e, + "Command Buffer 0x%" PRIx64 " is already in use and is not marked for simultaneous use.", + HandleToUint64(pCB->commandBuffer)); } return skip; } @@ -2478,10 +2590,11 @@ if ((cb_state->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT) && (cb_state->submitCount + current_submit_count > 1)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, 0, - __LINE__, DRAWSTATE_COMMAND_BUFFER_SINGLE_SUBMIT_VIOLATION, "DS", - "Commandbuffer 0x%p was begun w/ VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT " - "set, but has been submitted 0x%" PRIxLEAST64 " times.", - cb_state->commandBuffer, cb_state->submitCount + current_submit_count); + DRAWSTATE_COMMAND_BUFFER_SINGLE_SUBMIT_VIOLATION, + "Commandbuffer 0x%" PRIx64 + " was begun w/ VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT set, but has been submitted 0x%" PRIxLEAST64 + " times.", + HandleToUint64(cb_state->commandBuffer), cb_state->submitCount + current_submit_count); } // Validate that cmd buffers have been updated @@ -2493,16 +2606,16 @@ case CB_NEW: skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - (uint64_t)(cb_state->commandBuffer), __LINE__, vu_id, "DS", - "Command buffer 0x%p used in the call to %s is unrecorded and contains no commands. %s", - cb_state->commandBuffer, call_source, validation_error_map[vu_id]); + (uint64_t)(cb_state->commandBuffer), vu_id, + "Command buffer 0x%" PRIx64 " used in the call to %s is unrecorded and contains no commands.", + HandleToUint64(cb_state->commandBuffer), call_source); break; case CB_RECORDING: skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_state->commandBuffer), __LINE__, DRAWSTATE_NO_END_COMMAND_BUFFER, "DS", - "You must call vkEndCommandBuffer() on command buffer 0x%p before this call to %s!", - cb_state->commandBuffer, call_source); + HandleToUint64(cb_state->commandBuffer), DRAWSTATE_NO_END_COMMAND_BUFFER, + "You must call vkEndCommandBuffer() on command buffer 0x%" PRIx64 " before this call to %s!", + HandleToUint64(cb_state->commandBuffer), call_source); break; default: /* recorded */ @@ -2520,9 +2633,9 @@ for (auto drawDataElement : cb_node->drawData) { for (auto buffer : drawDataElement.buffers) { auto buffer_state = GetBufferState(dev_data, buffer); - if (!buffer_state) { + if (buffer != VK_NULL_HANDLE && !buffer_state) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, - HandleToUint64(buffer), __LINE__, DRAWSTATE_INVALID_BUFFER, "DS", + HandleToUint64(buffer), DRAWSTATE_INVALID_BUFFER, "Cannot submit cmd buffer using deleted buffer 0x%" PRIx64 ".", HandleToUint64(buffer)); } } @@ -2545,11 +2658,12 @@ } if (!found) { - skip = log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, get_debug_report_enum[object->type], object->handle, __LINE__, - DRAWSTATE_INVALID_QUEUE_FAMILY, "DS", "vkQueueSubmit: Command buffer 0x%" PRIxLEAST64 " contains %s 0x%" PRIxLEAST64 - " which was not created allowing concurrent access to this queue family %d.", - HandleToUint64(cb_node->commandBuffer), object_string[object->type], object->handle, queue_state->queueFamilyIndex); + skip = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, get_debug_report_enum[object->type], + object->handle, DRAWSTATE_INVALID_QUEUE_FAMILY, + "vkQueueSubmit: Command buffer 0x%" PRIx64 " contains %s 0x%" PRIx64 + " which was not created allowing concurrent access to this queue family %d.", + HandleToUint64(cb_node->commandBuffer), object_string[object->type], object->handle, + queue_state->queueFamilyIndex); } } return skip; @@ -2565,11 +2679,11 @@ if (pPool && queue_state) { if (pPool->queueFamilyIndex != queue_state->queueFamilyIndex) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pCB->commandBuffer), __LINE__, VALIDATION_ERROR_31a00094, "DS", - "vkQueueSubmit: Primary command buffer 0x%p created in queue family %d is being submitted on queue " - "0x%p from queue family %d. %s", - pCB->commandBuffer, pPool->queueFamilyIndex, queue, queue_state->queueFamilyIndex, - validation_error_map[VALIDATION_ERROR_31a00094]); + HandleToUint64(pCB->commandBuffer), VALIDATION_ERROR_31a00094, + "vkQueueSubmit: Primary command buffer 0x%" PRIx64 + " created in queue family %d is being submitted on queue 0x%" PRIx64 " from queue family %d.", + HandleToUint64(pCB->commandBuffer), pPool->queueFamilyIndex, HandleToUint64(queue), + queue_state->queueFamilyIndex); } // Ensure that any bound images or buffers created with SHARING_MODE_CONCURRENT have access to the current queue family @@ -2609,11 +2723,12 @@ if ((pSubCB->primaryCommandBuffer != pCB->commandBuffer) && !(pSubCB->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT)) { log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, 0, - __LINE__, VALIDATION_ERROR_31a00092, "DS", - "Commandbuffer 0x%p was submitted with secondary buffer 0x%p but that buffer has subsequently been bound to " - "primary cmd buffer 0x%p and it does not have VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT set. %s", - pCB->commandBuffer, pSubCB->commandBuffer, pSubCB->primaryCommandBuffer, - validation_error_map[VALIDATION_ERROR_31a00092]); + VALIDATION_ERROR_31a00092, + "Commandbuffer 0x%" PRIx64 " was submitted with secondary buffer 0x%" PRIx64 + " but that buffer has subsequently been bound to primary cmd buffer 0x%" PRIx64 + " and it does not have VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT set.", + HandleToUint64(pCB->commandBuffer), HandleToUint64(pSubCB->commandBuffer), + HandleToUint64(pSubCB->primaryCommandBuffer)); } } @@ -2629,15 +2744,15 @@ if (pFence->state == FENCE_INFLIGHT) { // TODO: opportunities for VALIDATION_ERROR_31a00080, VALIDATION_ERROR_316008b4, VALIDATION_ERROR_16400a0e skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT, - HandleToUint64(pFence->fence), __LINE__, DRAWSTATE_INVALID_FENCE, "DS", + HandleToUint64(pFence->fence), DRAWSTATE_INVALID_FENCE, "Fence 0x%" PRIx64 " is already in use by another submission.", HandleToUint64(pFence->fence)); } else if (pFence->state == FENCE_RETIRED) { // TODO: opportunities for VALIDATION_ERROR_31a0007e, VALIDATION_ERROR_316008b2, VALIDATION_ERROR_16400a0e skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT, - HandleToUint64(pFence->fence), __LINE__, MEMTRACK_INVALID_FENCE_STATE, "MEM", - "Fence 0x%" PRIxLEAST64 " submitted in SIGNALED state. Fences must be reset before being submitted", + HandleToUint64(pFence->fence), MEMTRACK_INVALID_FENCE_STATE, + "Fence 0x%" PRIx64 " submitted in SIGNALED state. Fences must be reset before being submitted", HandleToUint64(pFence->fence)); } } @@ -2668,10 +2783,10 @@ if (!dev_data->external_sync_warning) { dev_data->external_sync_warning = true; log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT, - HandleToUint64(fence), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS", + HandleToUint64(fence), DRAWSTATE_QUEUE_FORWARD_PROGRESS, "vkQueueSubmit(): Signaling external fence 0x%" PRIx64 " on queue 0x%" PRIx64 - " will disable validation of preceding command buffer lifecycle states and the in-use status of " - "associated objects.", + " will disable validation of preceding command buffer lifecycle states and the in-use status of associated " + "objects.", HandleToUint64(fence), HandleToUint64(queue)); } } @@ -2720,7 +2835,7 @@ if (!dev_data->external_sync_warning) { dev_data->external_sync_warning = true; log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT, - HandleToUint64(semaphore), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS", + HandleToUint64(semaphore), DRAWSTATE_QUEUE_FORWARD_PROGRESS, "vkQueueSubmit(): Signaling external semaphore 0x%" PRIx64 " on queue 0x%" PRIx64 " will disable validation of preceding command buffer lifecycle states and the in-use status of " "associated objects.", @@ -2735,12 +2850,11 @@ cbs.push_back(submit->pCommandBuffers[i]); for (auto secondaryCmdBuffer : cb_node->linkedCommandBuffers) { cbs.push_back(secondaryCmdBuffer->commandBuffer); + UpdateCmdBufImageLayouts(dev_data, secondaryCmdBuffer); + incrementResources(dev_data, secondaryCmdBuffer); } UpdateCmdBufImageLayouts(dev_data, cb_node); incrementResources(dev_data, cb_node); - for (auto secondaryCmdBuffer : cb_node->linkedCommandBuffers) { - incrementResources(dev_data, secondaryCmdBuffer); - } } } pQueue->submissions.emplace_back(cbs, semaphore_waits, semaphore_signals, semaphore_externals, @@ -2777,9 +2891,9 @@ if (unsignaled_semaphores.count(semaphore) || (!(signaled_semaphores.count(semaphore)) && !(pSemaphore->signaled))) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT, - HandleToUint64(semaphore), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS", - "Queue 0x%p is waiting on semaphore 0x%" PRIx64 " that has no way to be signaled.", queue, - HandleToUint64(semaphore)); + HandleToUint64(semaphore), DRAWSTATE_QUEUE_FORWARD_PROGRESS, + "Queue 0x%" PRIx64 " is waiting on semaphore 0x%" PRIx64 " that has no way to be signaled.", + HandleToUint64(queue), HandleToUint64(semaphore)); } else { signaled_semaphores.erase(semaphore); unsignaled_semaphores.insert(semaphore); @@ -2795,10 +2909,10 @@ if (pSemaphore && (pSemaphore->scope == kSyncScopeInternal || internal_semaphores.count(semaphore))) { if (signaled_semaphores.count(semaphore) || (!(unsignaled_semaphores.count(semaphore)) && pSemaphore->signaled)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT, - HandleToUint64(semaphore), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS", - "Queue 0x%p is signaling semaphore 0x%" PRIx64 + HandleToUint64(semaphore), DRAWSTATE_QUEUE_FORWARD_PROGRESS, + "Queue 0x%" PRIx64 " is signaling semaphore 0x%" PRIx64 " that has already been signaled but not waited on by queue 0x%" PRIx64 ".", - queue, HandleToUint64(semaphore), HandleToUint64(pSemaphore->signaler.first)); + HandleToUint64(queue), HandleToUint64(semaphore), HandleToUint64(pSemaphore->signaler.first)); } else { unsignaled_semaphores.erase(semaphore); signaled_semaphores.insert(semaphore); @@ -2856,10 +2970,9 @@ bool skip = false; if (dev_data->memObjMap.size() >= dev_data->phys_dev_properties.properties.limits.maxMemoryAllocationCount) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(dev_data->device), __LINE__, VALIDATION_ERROR_16c004f8, "MEM", - "Number of currently valid memory objects is not less than the maximum allowed (%u). %s", - dev_data->phys_dev_properties.properties.limits.maxMemoryAllocationCount, - validation_error_map[VALIDATION_ERROR_16c004f8]); + HandleToUint64(dev_data->device), VALIDATION_ERROR_UNDEFINED, + "Number of currently valid memory objects is not less than the maximum allowed (%u).", + dev_data->phys_dev_properties.properties.limits.maxMemoryAllocationCount); } return skip; } @@ -2892,10 +3005,10 @@ if (dev_data->instance_data->disabled.object_in_use) return false; bool skip = false; if (obj_node->in_use.load()) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, get_debug_report_enum[obj_struct.type], - obj_struct.handle, __LINE__, error_code, "DS", - "Cannot call %s on %s 0x%" PRIx64 " that is currently in use by a command buffer. %s", caller_name, - object_string[obj_struct.type], obj_struct.handle, validation_error_map[error_code]); + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, get_debug_report_enum[obj_struct.type], obj_struct.handle, + error_code, "Cannot call %s on %s 0x%" PRIx64 " that is currently in use by a command buffer.", caller_name, + object_string[obj_struct.type], obj_struct.handle); } return skip; } @@ -2914,26 +3027,25 @@ static void PostCallRecordFreeMemory(layer_data *dev_data, VkDeviceMemory mem, DEVICE_MEM_INFO *mem_info, VK_OBJECT obj_struct) { // Clear mem binding for any bound objects for (auto obj : mem_info->obj_bindings) { - log_msg(dev_data->report_data, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, get_debug_report_enum[obj.type], obj.handle, __LINE__, - MEMTRACK_FREED_MEM_REF, "MEM", "VK Object 0x%" PRIxLEAST64 " still has a reference to mem obj 0x%" PRIxLEAST64, - obj.handle, HandleToUint64(mem_info->mem)); + log_msg(dev_data->report_data, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, get_debug_report_enum[obj.type], obj.handle, + MEMTRACK_FREED_MEM_REF, "VK Object 0x%" PRIx64 " still has a reference to mem obj 0x%" PRIx64, + HandleToUint64(obj.handle), HandleToUint64(mem_info->mem)); + BINDABLE *bindable_state = nullptr; switch (obj.type) { - case kVulkanObjectTypeImage: { - auto image_state = GetImageState(dev_data, reinterpret_cast(obj.handle)); - assert(image_state); // Any destroyed images should already be removed from bindings - image_state->binding.mem = MEMORY_UNBOUND; + case kVulkanObjectTypeImage: + bindable_state = GetImageState(dev_data, reinterpret_cast(obj.handle)); break; - } - case kVulkanObjectTypeBuffer: { - auto buffer_state = GetBufferState(dev_data, reinterpret_cast(obj.handle)); - assert(buffer_state); // Any destroyed buffers should already be removed from bindings - buffer_state->binding.mem = MEMORY_UNBOUND; + case kVulkanObjectTypeBuffer: + bindable_state = GetBufferState(dev_data, reinterpret_cast(obj.handle)); break; - } default: // Should only have buffer or image objects bound to memory assert(0); } + + assert(bindable_state); + bindable_state->binding.mem = MEMORY_UNBOUND; + bindable_state->UpdateBoundMemorySet(); } // Any bound cmd buffers are now invalid invalidateCommandBuffers(dev_data, mem_info->cb_bindings, obj_struct); @@ -2965,8 +3077,7 @@ if (size == 0) { skip = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(mem), __LINE__, MEMTRACK_INVALID_MAP, "MEM", - "VkMapMemory: Attempting to map memory range of size zero"); + HandleToUint64(mem), MEMTRACK_INVALID_MAP, "VkMapMemory: Attempting to map memory range of size zero"); } auto mem_element = dev_data->memObjMap.find(mem); @@ -2974,17 +3085,16 @@ auto mem_info = mem_element->second.get(); // It is an application error to call VkMapMemory on an object that is already mapped if (mem_info->mem_range.size != 0) { - skip = - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(mem), __LINE__, MEMTRACK_INVALID_MAP, "MEM", - "VkMapMemory: Attempting to map memory on an already-mapped object 0x%" PRIxLEAST64, HandleToUint64(mem)); + skip = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, + HandleToUint64(mem), MEMTRACK_INVALID_MAP, + "VkMapMemory: Attempting to map memory on an already-mapped object 0x%" PRIx64, HandleToUint64(mem)); } // Validate that offset + size is within object's allocationSize if (size == VK_WHOLE_SIZE) { if (offset >= mem_info->alloc_info.allocationSize) { skip = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(mem), __LINE__, MEMTRACK_INVALID_MAP, "MEM", + HandleToUint64(mem), MEMTRACK_INVALID_MAP, "Mapping Memory from 0x%" PRIx64 " to 0x%" PRIx64 " with size of VK_WHOLE_SIZE oversteps total array size 0x%" PRIx64, offset, mem_info->alloc_info.allocationSize, mem_info->alloc_info.allocationSize); @@ -2992,10 +3102,9 @@ } else { if ((offset + size) > mem_info->alloc_info.allocationSize) { skip = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(mem), __LINE__, VALIDATION_ERROR_31200552, "MEM", - "Mapping Memory from 0x%" PRIx64 " to 0x%" PRIx64 " oversteps total array size 0x%" PRIx64 ". %s", - offset, size + offset, mem_info->alloc_info.allocationSize, - validation_error_map[VALIDATION_ERROR_31200552]); + HandleToUint64(mem), VALIDATION_ERROR_31200552, + "Mapping Memory from 0x%" PRIx64 " to 0x%" PRIx64 " oversteps total array size 0x%" PRIx64 ".", + offset, size + offset, mem_info->alloc_info.allocationSize); } } } @@ -3017,9 +3126,8 @@ if (!mem_info->mem_range.size) { // Valid Usage: memory must currently be mapped skip = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(mem), __LINE__, VALIDATION_ERROR_33600562, "MEM", - "Unmapping Memory without memory being mapped: mem obj 0x%" PRIxLEAST64 ". %s", HandleToUint64(mem), - validation_error_map[VALIDATION_ERROR_33600562]); + HandleToUint64(mem), VALIDATION_ERROR_33600562, + "Unmapping Memory without memory being mapped: mem obj 0x%" PRIx64 ".", HandleToUint64(mem)); } mem_info->mem_range.size = 0; if (mem_info->shadow_copy) { @@ -3047,8 +3155,8 @@ size = mem_info->alloc_info.allocationSize - offset; } mem_info->shadow_pad_size = dev_data->phys_dev_properties.properties.limits.minMemoryMapAlignment; - assert(SafeModulo(mem_info->shadow_pad_size, - dev_data->phys_dev_properties.properties.limits.minMemoryMapAlignment) == 0); + assert(SafeModulo(mem_info->shadow_pad_size, dev_data->phys_dev_properties.properties.limits.minMemoryMapAlignment) == + 0); // Ensure start of mapped region reflects hardware alignment constraints uint64_t map_alignment = dev_data->phys_dev_properties.properties.limits.minMemoryMapAlignment; @@ -3063,7 +3171,7 @@ ~(map_alignment - 1)) + start_offset; assert(SafeModulo(reinterpret_cast(mem_info->shadow_copy) + mem_info->shadow_pad_size - start_offset, - map_alignment) == 0); + map_alignment) == 0); memset(mem_info->shadow_copy, NoncoherentMemoryFillValue, static_cast(2 * mem_info->shadow_pad_size + size)); *ppData = static_cast(mem_info->shadow_copy) + mem_info->shadow_pad_size; @@ -3080,12 +3188,11 @@ auto pFence = GetFenceNode(dev_data, fence); if (pFence && pFence->scope == kSyncScopeInternal) { if (pFence->state == FENCE_UNSIGNALED) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT, - HandleToUint64(fence), __LINE__, MEMTRACK_INVALID_FENCE_STATE, "MEM", - "%s called for fence 0x%" PRIxLEAST64 - " which has not been submitted on a Queue or during " - "acquire next image.", - apiCall, HandleToUint64(fence)); + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT, + HandleToUint64(fence), MEMTRACK_INVALID_FENCE_STATE, + "%s called for fence 0x%" PRIx64 " which has not been submitted on a Queue or during acquire next image.", + apiCall, HandleToUint64(fence)); } } return skip; @@ -3188,6 +3295,16 @@ PostCallRecordGetDeviceQueue(dev_data, queueFamilyIndex, *pQueue); } +VKAPI_ATTR void VKAPI_CALL GetDeviceQueue2(VkDevice device, VkDeviceQueueInfo2 *pQueueInfo, VkQueue *pQueue) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + dev_data->dispatch_table.GetDeviceQueue2(device, pQueueInfo, pQueue); + lock_guard_t lock(global_lock); + + if (*pQueue != VK_NULL_HANDLE) { + PostCallRecordGetDeviceQueue(dev_data, pQueueInfo->queueFamilyIndex, *pQueue); + } +} + static bool PreCallValidateQueueWaitIdle(layer_data *dev_data, VkQueue queue, QUEUE_STATE **queue_state) { *queue_state = GetQueueState(dev_data, queue); if (dev_data->instance_data->disabled.queue_wait_idle) return false; @@ -3251,9 +3368,9 @@ bool skip = false; if (*fence_node) { if ((*fence_node)->scope == kSyncScopeInternal && (*fence_node)->state == FENCE_INFLIGHT) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT, - HandleToUint64(fence), __LINE__, VALIDATION_ERROR_24e008c0, "DS", "Fence 0x%" PRIx64 " is in use. %s", - HandleToUint64(fence), validation_error_map[VALIDATION_ERROR_24e008c0]); + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT, + HandleToUint64(fence), VALIDATION_ERROR_24e008c0, "Fence 0x%" PRIx64 " is in use.", HandleToUint64(fence)); } } return skip; @@ -3373,64 +3490,60 @@ static bool PreCallValidateGetQueryPoolResults(layer_data *dev_data, VkQueryPool query_pool, uint32_t first_query, uint32_t query_count, VkQueryResultFlags flags, unordered_map> *queries_in_flight) { + bool skip = false; + auto query_pool_state = dev_data->queryPoolMap.find(query_pool); + if (query_pool_state != dev_data->queryPoolMap.end()) { + if ((query_pool_state->second.createInfo.queryType == VK_QUERY_TYPE_TIMESTAMP) && (flags & VK_QUERY_RESULT_PARTIAL_BIT)) { + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT, 0, + VALIDATION_ERROR_2fa00664, + "QueryPool 0x%" PRIx64 + " was created with a queryType of VK_QUERY_TYPE_TIMESTAMP but flags contains VK_QUERY_RESULT_PARTIAL_BIT.", + HandleToUint64(query_pool)); + } + } + // TODO: clean this up, it's insanely wasteful. for (auto cmd_buffer : dev_data->commandBufferMap) { if (cmd_buffer.second->in_use.load()) { for (auto query_state_pair : cmd_buffer.second->queryToStateMap) { - (*queries_in_flight)[query_state_pair.first].push_back( - cmd_buffer.first); + (*queries_in_flight)[query_state_pair.first].push_back(cmd_buffer.first); } } } + if (dev_data->instance_data->disabled.get_query_pool_results) return false; - bool skip = false; for (uint32_t i = 0; i < query_count; ++i) { QueryObject query = {query_pool, first_query + i}; auto qif_pair = queries_in_flight->find(query); auto query_state_pair = dev_data->queryToStateMap.find(query); if (query_state_pair != dev_data->queryToStateMap.end()) { // Available and in flight - if (qif_pair != queries_in_flight->end() && query_state_pair != dev_data->queryToStateMap.end() && - query_state_pair->second) { - for (auto cmd_buffer : qif_pair->second) { - auto cb = GetCBNode(dev_data, cmd_buffer); - auto query_event_pair = cb->waitedEventsBeforeQueryReset.find(query); - if (query_event_pair == cb->waitedEventsBeforeQueryReset.end()) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT, 0, __LINE__, DRAWSTATE_INVALID_QUERY, "DS", - "Cannot get query results on queryPool 0x%" PRIx64 " with index %d which is in flight.", - HandleToUint64(query_pool), first_query + i); + if (qif_pair != queries_in_flight->end()) { + if (query_state_pair->second) { + for (auto cmd_buffer : qif_pair->second) { + auto cb = GetCBNode(dev_data, cmd_buffer); + auto query_event_pair = cb->waitedEventsBeforeQueryReset.find(query); + if (query_event_pair == cb->waitedEventsBeforeQueryReset.end()) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT, 0, DRAWSTATE_INVALID_QUERY, + "Cannot get query results on queryPool 0x%" PRIx64 " with index %d which is in flight.", + HandleToUint64(query_pool), first_query + i); + } } } - // Unavailable and in flight - } else if (qif_pair != queries_in_flight->end() && query_state_pair != dev_data->queryToStateMap.end() && - !query_state_pair->second) { - // TODO : Can there be the same query in use by multiple command buffers in flight? - bool make_available = false; - for (auto cmd_buffer : qif_pair->second) { - auto cb = GetCBNode(dev_data, cmd_buffer); - make_available |= cb->queryToStateMap[query]; - } - if (!(((flags & VK_QUERY_RESULT_PARTIAL_BIT) || (flags & VK_QUERY_RESULT_WAIT_BIT)) && make_available)) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT, 0, __LINE__, DRAWSTATE_INVALID_QUERY, "DS", - "Cannot get query results on queryPool 0x%" PRIx64 " with index %d which is unavailable.", - HandleToUint64(query_pool), first_query + i); - } - // Unavailable - } else if (query_state_pair != dev_data->queryToStateMap.end() && !query_state_pair->second) { + } else if (!query_state_pair->second) { // Unavailable and Not in flight skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT, 0, - __LINE__, DRAWSTATE_INVALID_QUERY, "DS", + DRAWSTATE_INVALID_QUERY, "Cannot get query results on queryPool 0x%" PRIx64 " with index %d which is unavailable.", HandleToUint64(query_pool), first_query + i); - // Uninitialized - } else if (query_state_pair == dev_data->queryToStateMap.end()) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT, 0, - __LINE__, DRAWSTATE_INVALID_QUERY, "DS", - "Cannot get query results on queryPool 0x%" PRIx64 - " with index %d as data has not been collected for this index.", - HandleToUint64(query_pool), first_query + i); } + } else { // Uninitialized + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT, 0, + DRAWSTATE_INVALID_QUERY, + "Cannot get query results on queryPool 0x%" PRIx64 + " with index %d as data has not been collected for this index.", + HandleToUint64(query_pool), first_query + i); } } return skip; @@ -3505,13 +3618,13 @@ const char *r2_linear_str = range2->linear ? "linear" : "non-linear"; const char *r2_type_str = range2->image ? "image" : "buffer"; auto obj_type = range1->image ? VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT : VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT; - *skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, obj_type, range1->handle, 0, - MEMTRACK_INVALID_ALIASING, "MEM", "%s %s 0x%" PRIx64 " is aliased with %s %s 0x%" PRIx64 - " which may indicate a bug. For further info refer to the " - "Buffer-Image Granularity section of the Vulkan specification. " - "(https://www.khronos.org/registry/vulkan/specs/1.0-extensions/" - "xhtml/vkspec.html#resources-bufferimagegranularity)", - r1_linear_str, r1_type_str, range1->handle, r2_linear_str, r2_type_str, range2->handle); + *skip |= log_msg( + dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, obj_type, range1->handle, MEMTRACK_INVALID_ALIASING, + "%s %s 0x%" PRIx64 " is aliased with %s %s 0x%" PRIx64 + " which may indicate a bug. For further info refer to the Buffer-Image Granularity section of the Vulkan " + "specification. " + "(https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#resources-bufferimagegranularity)", + r1_linear_str, r1_type_str, range1->handle, r2_linear_str, r2_type_str, range2->handle); } // Ranges intersect return true; @@ -3572,11 +3685,11 @@ if (memoryOffset >= mem_info->alloc_info.allocationSize) { UNIQUE_VALIDATION_ERROR_CODE error_code = is_image ? VALIDATION_ERROR_1740082c : VALIDATION_ERROR_1700080e; skip = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(mem_info->mem), __LINE__, error_code, "MEM", - "In %s, attempting to bind memory (0x%" PRIxLEAST64 ") to object (0x%" PRIxLEAST64 - "), memoryOffset=0x%" PRIxLEAST64 " must be less than the memory allocation size 0x%" PRIxLEAST64 ". %s", - api_name, HandleToUint64(mem_info->mem), handle, memoryOffset, mem_info->alloc_info.allocationSize, - validation_error_map[error_code]); + HandleToUint64(mem_info->mem), error_code, + "In %s, attempting to bind memory (0x%" PRIx64 ") to object (0x%" PRIx64 "), memoryOffset=0x%" PRIxLEAST64 + " must be less than the memory allocation size 0x%" PRIxLEAST64 ".", + api_name, HandleToUint64(mem_info->mem), HandleToUint64(handle), memoryOffset, + mem_info->alloc_info.allocationSize); } return skip; @@ -3720,32 +3833,31 @@ bool skip = false; if (((1 << mem_info->alloc_info.memoryTypeIndex) & memory_type_bits) == 0) { skip = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(mem_info->mem), __LINE__, msgCode, "MT", + HandleToUint64(mem_info->mem), msgCode, "%s(): MemoryRequirements->memoryTypeBits (0x%X) for this object type are not compatible with the memory " - "type (0x%X) of this memory object 0x%" PRIx64 ". %s", - funcName, memory_type_bits, mem_info->alloc_info.memoryTypeIndex, HandleToUint64(mem_info->mem), - validation_error_map[msgCode]); + "type (0x%X) of this memory object 0x%" PRIx64 ".", + funcName, memory_type_bits, mem_info->alloc_info.memoryTypeIndex, HandleToUint64(mem_info->mem)); } return skip; } static bool PreCallValidateBindBufferMemory(layer_data *dev_data, VkBuffer buffer, BUFFER_STATE *buffer_state, VkDeviceMemory mem, - VkDeviceSize memoryOffset) { + VkDeviceSize memoryOffset, const char *api_name) { bool skip = false; if (buffer_state) { unique_lock_t lock(global_lock); // Track objects tied to memory uint64_t buffer_handle = HandleToUint64(buffer); - skip = ValidateSetMemBinding(dev_data, mem, buffer_handle, kVulkanObjectTypeBuffer, "vkBindBufferMemory()"); + skip = ValidateSetMemBinding(dev_data, mem, buffer_handle, kVulkanObjectTypeBuffer, api_name); if (!buffer_state->memory_requirements_checked) { // There's not an explicit requirement in the spec to call vkGetBufferMemoryRequirements() prior to calling // BindBufferMemory, but it's implied in that memory being bound must conform with VkMemoryRequirements from // vkGetBufferMemoryRequirements() skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, - buffer_handle, __LINE__, DRAWSTATE_INVALID_BUFFER, "DS", - "vkBindBufferMemory(): Binding memory to buffer 0x%" PRIxLEAST64 + buffer_handle, DRAWSTATE_INVALID_BUFFER, + "%s: Binding memory to buffer 0x%" PRIx64 " but vkGetBufferMemoryRequirements() has not been called on that buffer.", - buffer_handle); + api_name, HandleToUint64(buffer_handle)); // Make the call for them so we can verify the state lock.unlock(); dev_data->dispatch_table.GetBufferMemoryRequirements(dev_data->device, buffer, &buffer_state->requirements); @@ -3753,35 +3865,49 @@ } // Validate bound memory range information - auto mem_info = GetMemObjInfo(dev_data, mem); + const auto mem_info = GetMemObjInfo(dev_data, mem); if (mem_info) { - skip |= ValidateInsertBufferMemoryRange(dev_data, buffer, mem_info, memoryOffset, buffer_state->requirements, - "vkBindBufferMemory()"); - skip |= ValidateMemoryTypes(dev_data, mem_info, buffer_state->requirements.memoryTypeBits, "vkBindBufferMemory()", + skip |= ValidateInsertBufferMemoryRange(dev_data, buffer, mem_info, memoryOffset, buffer_state->requirements, api_name); + skip |= ValidateMemoryTypes(dev_data, mem_info, buffer_state->requirements.memoryTypeBits, api_name, VALIDATION_ERROR_17000816); } // Validate memory requirements alignment if (SafeModulo(memoryOffset, buffer_state->requirements.alignment) != 0) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, - buffer_handle, __LINE__, VALIDATION_ERROR_17000818, "DS", - "vkBindBufferMemory(): memoryOffset is 0x%" PRIxLEAST64 - " but must be an integer multiple of the " - "VkMemoryRequirements::alignment value 0x%" PRIxLEAST64 - ", returned from a call to vkGetBufferMemoryRequirements with buffer. %s", - memoryOffset, buffer_state->requirements.alignment, validation_error_map[VALIDATION_ERROR_17000818]); + buffer_handle, VALIDATION_ERROR_17000818, + "%s: memoryOffset is 0x%" PRIxLEAST64 + " but must be an integer multiple of the VkMemoryRequirements::alignment value 0x%" PRIxLEAST64 + ", returned from a call to vkGetBufferMemoryRequirements with buffer.", + api_name, memoryOffset, buffer_state->requirements.alignment); } - // Validate memory requirements size - if (buffer_state->requirements.size > (mem_info->alloc_info.allocationSize - memoryOffset)) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, - buffer_handle, __LINE__, VALIDATION_ERROR_1700081a, "DS", - "vkBindBufferMemory(): memory size minus memoryOffset is 0x%" PRIxLEAST64 - " but must be at least as large as " - "VkMemoryRequirements::size value 0x%" PRIxLEAST64 - ", returned from a call to vkGetBufferMemoryRequirements with buffer. %s", - mem_info->alloc_info.allocationSize - memoryOffset, buffer_state->requirements.size, - validation_error_map[VALIDATION_ERROR_1700081a]); + if (mem_info) { + // Validate memory requirements size + if (buffer_state->requirements.size > (mem_info->alloc_info.allocationSize - memoryOffset)) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, + buffer_handle, VALIDATION_ERROR_1700081a, + "%s: memory size minus memoryOffset is 0x%" PRIxLEAST64 + " but must be at least as large as VkMemoryRequirements::size value 0x%" PRIxLEAST64 + ", returned from a call to vkGetBufferMemoryRequirements with buffer.", + api_name, mem_info->alloc_info.allocationSize - memoryOffset, buffer_state->requirements.size); + } + + // Validate dedicated allocation + if (mem_info->is_dedicated && ((mem_info->dedicated_buffer != buffer) || (memoryOffset != 0))) { + // TODO: Add vkBindBufferMemory2KHR error message when added to spec. + auto validation_error = VALIDATION_ERROR_UNDEFINED; + if (strcmp(api_name, "vkBindBufferMemory()") == 0) { + validation_error = VALIDATION_ERROR_17000bc8; + } + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, + buffer_handle, validation_error, + "%s: for dedicated memory allocation 0x%" PRIxLEAST64 + ", VkMemoryDedicatedAllocateInfoKHR::buffer 0x%" PRIXLEAST64 " must be equal to buffer 0x%" PRIxLEAST64 + " and memoryOffset 0x%" PRIxLEAST64 " must be zero.", + api_name, HandleToUint64(mem), HandleToUint64(mem_info->dedicated_buffer), buffer_handle, memoryOffset); + } } // Validate device limits alignments @@ -3808,12 +3934,11 @@ for (int i = 0; i < 3; i++) { if (usage & usage_list[i]) { if (SafeModulo(memoryOffset, offset_requirement[i]) != 0) { - skip |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, buffer_handle, - __LINE__, msgCode[i], "DS", "vkBindBufferMemory(): %s memoryOffset is 0x%" PRIxLEAST64 - " but must be a multiple of " - "device limit %s 0x%" PRIxLEAST64 ". %s", - memory_type[i], memoryOffset, offset_name[i], offset_requirement[i], validation_error_map[msgCode[i]]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, + buffer_handle, msgCode[i], + "%s: %s memoryOffset is 0x%" PRIxLEAST64 + " but must be a multiple of device limit %s 0x%" PRIxLEAST64 ".", + api_name, memory_type[i], memoryOffset, offset_name[i], offset_requirement[i]); } } } @@ -3822,7 +3947,7 @@ } static void PostCallRecordBindBufferMemory(layer_data *dev_data, VkBuffer buffer, BUFFER_STATE *buffer_state, VkDeviceMemory mem, - VkDeviceSize memoryOffset) { + VkDeviceSize memoryOffset, const char *api_name) { if (buffer_state) { unique_lock_t lock(global_lock); // Track bound memory range information @@ -3833,49 +3958,239 @@ // Track objects tied to memory uint64_t buffer_handle = HandleToUint64(buffer); - SetMemBinding(dev_data, mem, buffer_handle, kVulkanObjectTypeBuffer, "vkBindBufferMemory()"); - - buffer_state->binding.mem = mem; - buffer_state->binding.offset = memoryOffset; - buffer_state->binding.size = buffer_state->requirements.size; + SetMemBinding(dev_data, mem, buffer_state, memoryOffset, buffer_handle, kVulkanObjectTypeBuffer, api_name); } } VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memoryOffset) { layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; - auto buffer_state = GetBufferState(dev_data, buffer); - bool skip = PreCallValidateBindBufferMemory(dev_data, buffer, buffer_state, mem, memoryOffset); + BUFFER_STATE *buffer_state; + { + unique_lock_t lock(global_lock); + buffer_state = GetBufferState(dev_data, buffer); + } + bool skip = PreCallValidateBindBufferMemory(dev_data, buffer, buffer_state, mem, memoryOffset, "vkBindBufferMemory()"); if (!skip) { result = dev_data->dispatch_table.BindBufferMemory(device, buffer, mem, memoryOffset); if (result == VK_SUCCESS) { - PostCallRecordBindBufferMemory(dev_data, buffer, buffer_state, mem, memoryOffset); + PostCallRecordBindBufferMemory(dev_data, buffer, buffer_state, mem, memoryOffset, "vkBindBufferMemory()"); } } return result; } -VKAPI_ATTR void VKAPI_CALL GetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, - VkMemoryRequirements *pMemoryRequirements) { +static bool PreCallValidateBindBufferMemory2(layer_data *dev_data, std::vector *buffer_state, + uint32_t bindInfoCount, const VkBindBufferMemoryInfoKHR *pBindInfos) { + { + unique_lock_t lock(global_lock); + for (uint32_t i = 0; i < bindInfoCount; i++) { + (*buffer_state)[i] = GetBufferState(dev_data, pBindInfos[i].buffer); + } + } + bool skip = false; + char api_name[64]; + for (uint32_t i = 0; i < bindInfoCount; i++) { + sprintf(api_name, "vkBindBufferMemory2() pBindInfos[%u]", i); + skip |= PreCallValidateBindBufferMemory(dev_data, pBindInfos[i].buffer, (*buffer_state)[i], pBindInfos[i].memory, + pBindInfos[i].memoryOffset, api_name); + } + return skip; +} + +static void PostCallRecordBindBufferMemory2(layer_data *dev_data, const std::vector &buffer_state, + uint32_t bindInfoCount, const VkBindBufferMemoryInfoKHR *pBindInfos) { + for (uint32_t i = 0; i < bindInfoCount; i++) { + PostCallRecordBindBufferMemory(dev_data, pBindInfos[i].buffer, buffer_state[i], pBindInfos[i].memory, + pBindInfos[i].memoryOffset, "vkBindBufferMemory2()"); + } +} + +VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory2(VkDevice device, uint32_t bindInfoCount, + const VkBindBufferMemoryInfoKHR *pBindInfos) { layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - dev_data->dispatch_table.GetBufferMemoryRequirements(device, buffer, pMemoryRequirements); - auto buffer_state = GetBufferState(dev_data, buffer); + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + std::vector buffer_state(bindInfoCount); + if (!PreCallValidateBindBufferMemory2(dev_data, &buffer_state, bindInfoCount, pBindInfos)) { + result = dev_data->dispatch_table.BindBufferMemory2(device, bindInfoCount, pBindInfos); + if (result == VK_SUCCESS) { + PostCallRecordBindBufferMemory2(dev_data, buffer_state, bindInfoCount, pBindInfos); + } + } + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount, + const VkBindBufferMemoryInfoKHR *pBindInfos) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + std::vector buffer_state(bindInfoCount); + if (!PreCallValidateBindBufferMemory2(dev_data, &buffer_state, bindInfoCount, pBindInfos)) { + result = dev_data->dispatch_table.BindBufferMemory2KHR(device, bindInfoCount, pBindInfos); + if (result == VK_SUCCESS) { + PostCallRecordBindBufferMemory2(dev_data, buffer_state, bindInfoCount, pBindInfos); + } + } + return result; +} + +static void PostCallRecordGetBufferMemoryRequirements(layer_data *dev_data, VkBuffer buffer, + VkMemoryRequirements *pMemoryRequirements) { + BUFFER_STATE *buffer_state; + { + unique_lock_t lock(global_lock); + buffer_state = GetBufferState(dev_data, buffer); + } if (buffer_state) { buffer_state->requirements = *pMemoryRequirements; buffer_state->memory_requirements_checked = true; } } -VKAPI_ATTR void VKAPI_CALL GetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements *pMemoryRequirements) { +VKAPI_ATTR void VKAPI_CALL GetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, + VkMemoryRequirements *pMemoryRequirements) { layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - dev_data->dispatch_table.GetImageMemoryRequirements(device, image, pMemoryRequirements); - auto image_state = GetImageState(dev_data, image); + dev_data->dispatch_table.GetBufferMemoryRequirements(device, buffer, pMemoryRequirements); + PostCallRecordGetBufferMemoryRequirements(dev_data, buffer, pMemoryRequirements); +} + +VKAPI_ATTR void VKAPI_CALL GetBufferMemoryRequirements2(VkDevice device, const VkBufferMemoryRequirementsInfo2KHR *pInfo, + VkMemoryRequirements2KHR *pMemoryRequirements) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + dev_data->dispatch_table.GetBufferMemoryRequirements2(device, pInfo, pMemoryRequirements); + PostCallRecordGetBufferMemoryRequirements(dev_data, pInfo->buffer, &pMemoryRequirements->memoryRequirements); +} + +VKAPI_ATTR void VKAPI_CALL GetBufferMemoryRequirements2KHR(VkDevice device, const VkBufferMemoryRequirementsInfo2KHR *pInfo, + VkMemoryRequirements2KHR *pMemoryRequirements) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + dev_data->dispatch_table.GetBufferMemoryRequirements2KHR(device, pInfo, pMemoryRequirements); + PostCallRecordGetBufferMemoryRequirements(dev_data, pInfo->buffer, &pMemoryRequirements->memoryRequirements); +} + +static void PostCallRecordGetImageMemoryRequirements(layer_data *dev_data, VkImage image, + VkMemoryRequirements *pMemoryRequirements) { + IMAGE_STATE *image_state; + { + unique_lock_t lock(global_lock); + image_state = GetImageState(dev_data, image); + } if (image_state) { image_state->requirements = *pMemoryRequirements; image_state->memory_requirements_checked = true; } } +VKAPI_ATTR void VKAPI_CALL GetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements *pMemoryRequirements) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + dev_data->dispatch_table.GetImageMemoryRequirements(device, image, pMemoryRequirements); + PostCallRecordGetImageMemoryRequirements(dev_data, image, pMemoryRequirements); +} + +VKAPI_ATTR void VKAPI_CALL GetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2KHR *pInfo, + VkMemoryRequirements2KHR *pMemoryRequirements) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + dev_data->dispatch_table.GetImageMemoryRequirements2(device, pInfo, pMemoryRequirements); + PostCallRecordGetImageMemoryRequirements(dev_data, pInfo->image, &pMemoryRequirements->memoryRequirements); +} + +VKAPI_ATTR void VKAPI_CALL GetImageMemoryRequirements2KHR(VkDevice device, const VkImageMemoryRequirementsInfo2KHR *pInfo, + VkMemoryRequirements2KHR *pMemoryRequirements) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + dev_data->dispatch_table.GetImageMemoryRequirements2KHR(device, pInfo, pMemoryRequirements); + PostCallRecordGetImageMemoryRequirements(dev_data, pInfo->image, &pMemoryRequirements->memoryRequirements); +} + +static void PostCallRecordGetImageSparseMemoryRequirements(IMAGE_STATE *image_state, uint32_t req_count, + VkSparseImageMemoryRequirements *reqs) { + image_state->get_sparse_reqs_called = true; + image_state->sparse_requirements.resize(req_count); + if (reqs) { + std::copy(reqs, reqs + req_count, image_state->sparse_requirements.begin()); + } + for (const auto &req : image_state->sparse_requirements) { + if (req.formatProperties.aspectMask & VK_IMAGE_ASPECT_METADATA_BIT) { + image_state->sparse_metadata_required = true; + } + } +} + +VKAPI_ATTR void VKAPI_CALL GetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t *pSparseMemoryRequirementCount, + VkSparseImageMemoryRequirements *pSparseMemoryRequirements) { + // TODO : Implement tracking here, just passthrough initially + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + dev_data->dispatch_table.GetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, + pSparseMemoryRequirements); + unique_lock_t lock(global_lock); + auto image_state = GetImageState(dev_data, image); + PostCallRecordGetImageSparseMemoryRequirements(image_state, *pSparseMemoryRequirementCount, pSparseMemoryRequirements); +} + +static void PostCallRecordGetImageSparseMemoryRequirements2(IMAGE_STATE *image_state, uint32_t req_count, + VkSparseImageMemoryRequirements2KHR *reqs) { + std::vector sparse_reqs(req_count); + // Migrate to old struct type for common handling with GetImageSparseMemoryRequirements() + for (uint32_t i = 0; i < req_count; ++i) { + assert(!reqs[i].pNext); // TODO: If an extension is ever added here we need to handle it + sparse_reqs[i] = reqs[i].memoryRequirements; + } + PostCallRecordGetImageSparseMemoryRequirements(image_state, req_count, sparse_reqs.data()); +} + +VKAPI_ATTR void VKAPI_CALL GetImageSparseMemoryRequirements2(VkDevice device, const VkImageSparseMemoryRequirementsInfo2KHR *pInfo, + uint32_t *pSparseMemoryRequirementCount, + VkSparseImageMemoryRequirements2KHR *pSparseMemoryRequirements) { + // TODO : Implement tracking here, just passthrough initially + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + dev_data->dispatch_table.GetImageSparseMemoryRequirements2(device, pInfo, pSparseMemoryRequirementCount, + pSparseMemoryRequirements); + unique_lock_t lock(global_lock); + auto image_state = GetImageState(dev_data, pInfo->image); + PostCallRecordGetImageSparseMemoryRequirements2(image_state, *pSparseMemoryRequirementCount, pSparseMemoryRequirements); +} + +VKAPI_ATTR void VKAPI_CALL GetImageSparseMemoryRequirements2KHR(VkDevice device, + const VkImageSparseMemoryRequirementsInfo2KHR *pInfo, + uint32_t *pSparseMemoryRequirementCount, + VkSparseImageMemoryRequirements2KHR *pSparseMemoryRequirements) { + // TODO : Implement tracking here, just passthrough initially + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + dev_data->dispatch_table.GetImageSparseMemoryRequirements2KHR(device, pInfo, pSparseMemoryRequirementCount, + pSparseMemoryRequirements); + unique_lock_t lock(global_lock); + auto image_state = GetImageState(dev_data, pInfo->image); + PostCallRecordGetImageSparseMemoryRequirements2(image_state, *pSparseMemoryRequirementCount, pSparseMemoryRequirements); +} + +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, + VkImageType type, VkSampleCountFlagBits samples, + VkImageUsageFlags usage, VkImageTiling tiling, + uint32_t *pPropertyCount, + VkSparseImageFormatProperties *pProperties) { + // TODO : Implement this intercept, track sparse image format properties and make sure they are obeyed. + instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); + instance_data->dispatch_table.GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, + pPropertyCount, pProperties); +} + +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties2( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, uint32_t *pPropertyCount, + VkSparseImageFormatProperties2KHR *pProperties) { + // TODO : Implement this intercept, track sparse image format properties and make sure they are obeyed. + instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); + instance_data->dispatch_table.GetPhysicalDeviceSparseImageFormatProperties2(physicalDevice, pFormatInfo, pPropertyCount, + pProperties); +} + +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties2KHR( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, uint32_t *pPropertyCount, + VkSparseImageFormatProperties2KHR *pProperties) { + // TODO : Implement this intercept, track sparse image format properties and make sure they are obeyed. + instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); + instance_data->dispatch_table.GetPhysicalDeviceSparseImageFormatProperties2KHR(physicalDevice, pFormatInfo, pPropertyCount, + pProperties); +} + VKAPI_ATTR void VKAPI_CALL DestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks *pAllocator) { layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); // Common data objects used pre & post call @@ -3985,7 +4300,11 @@ } static void PostCallRecordDestroyDescriptorSetLayout(layer_data *dev_data, VkDescriptorSetLayout ds_layout) { - dev_data->descriptorSetLayoutMap.erase(ds_layout); + auto layout_it = dev_data->descriptorSetLayoutMap.find(ds_layout); + if (layout_it != dev_data->descriptorSetLayoutMap.end()) { + layout_it->second.get()->MarkDestroyed(); + dev_data->descriptorSetLayoutMap.erase(layout_it); + } } VKAPI_ATTR void VKAPI_CALL DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, @@ -4009,16 +4328,18 @@ return skip; } -static void PostCallRecordDestroyDescriptorPool(layer_data *dev_data, VkDescriptorPool descriptorPool, - DESCRIPTOR_POOL_STATE *desc_pool_state, VK_OBJECT obj_struct) { - // Any bound cmd buffers are now invalid - invalidateCommandBuffers(dev_data, desc_pool_state->cb_bindings, obj_struct); - // Free sets that were in this pool - for (auto ds : desc_pool_state->sets) { - freeDescriptorSet(dev_data, ds); +static void PreCallRecordDestroyDescriptorPool(layer_data *dev_data, VkDescriptorPool descriptorPool, + DESCRIPTOR_POOL_STATE *desc_pool_state, VK_OBJECT obj_struct) { + if (desc_pool_state) { + // Any bound cmd buffers are now invalid + invalidateCommandBuffers(dev_data, desc_pool_state->cb_bindings, obj_struct); + // Free sets that were in this pool + for (auto ds : desc_pool_state->sets) { + freeDescriptorSet(dev_data, ds); + } + dev_data->descriptorPoolMap.erase(descriptorPool); + delete desc_pool_state; } - dev_data->descriptorPoolMap.erase(descriptorPool); - delete desc_pool_state; } VKAPI_ATTR void VKAPI_CALL DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, @@ -4029,14 +4350,12 @@ unique_lock_t lock(global_lock); bool skip = PreCallValidateDestroyDescriptorPool(dev_data, descriptorPool, &desc_pool_state, &obj_struct); if (!skip) { + PreCallRecordDestroyDescriptorPool(dev_data, descriptorPool, desc_pool_state, obj_struct); lock.unlock(); dev_data->dispatch_table.DestroyDescriptorPool(device, descriptorPool, pAllocator); - lock.lock(); - if (descriptorPool != VK_NULL_HANDLE) { - PostCallRecordDestroyDescriptorPool(dev_data, descriptorPool, desc_pool_state, obj_struct); - } } } + // Verify cmdBuffer in given cb_node is not in global in-flight set, and return skip result // If this is a secondary command buffer, then make sure its primary is also in-flight // If primary is not in-flight, then remove secondary from global in-flight set @@ -4046,9 +4365,9 @@ bool skip = false; if (cb_node->in_use.load()) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, error_code, "DS", - "Attempt to %s command buffer (0x%p) which is in use. %s", action, cb_node->commandBuffer, - validation_error_map[error_code]); + HandleToUint64(cb_node->commandBuffer), error_code, + "Attempt to %s command buffer (0x%" PRIx64 ") which is in use.", action, + HandleToUint64(cb_node->commandBuffer)); } return skip; } @@ -4063,6 +4382,24 @@ return skip; } +// Free all command buffers in given list, removing all references/links to them using ResetCommandBufferState +static void FreeCommandBufferStates(layer_data *dev_data, COMMAND_POOL_NODE *pool_state, const uint32_t command_buffer_count, + const VkCommandBuffer *command_buffers) { + for (uint32_t i = 0; i < command_buffer_count; i++) { + auto cb_state = GetCBNode(dev_data, command_buffers[i]); + // Remove references to command buffer's state and delete + if (cb_state) { + // reset prior to delete, removing various references to it. + // TODO: fix this, it's insane. + ResetCommandBufferState(dev_data, cb_state->commandBuffer); + // Remove the cb_state's references from layer_data and COMMAND_POOL_NODE + dev_data->commandBufferMap.erase(cb_state->commandBuffer); + pool_state->commandBuffers.erase(command_buffers[i]); + delete cb_state; + } + } +} + VKAPI_ATTR void VKAPI_CALL FreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers) { layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); @@ -4080,20 +4417,7 @@ if (skip) return; auto pPool = GetCommandPoolNode(dev_data, commandPool); - for (uint32_t i = 0; i < commandBufferCount; i++) { - auto cb_node = GetCBNode(dev_data, pCommandBuffers[i]); - // Delete CB information structure, and remove from commandBufferMap - if (cb_node) { - // reset prior to delete for data clean-up - // TODO: fix this, it's insane. - resetCB(dev_data, cb_node->commandBuffer); - dev_data->commandBufferMap.erase(cb_node->commandBuffer); - delete cb_node; - } - - // Remove commandBuffer reference from commandPoolMap - pPool->commandBuffers.remove(pCommandBuffers[i]); - } + FreeCommandBufferStates(dev_data, pPool, commandBufferCount, pCommandBuffers); lock.unlock(); dev_data->dispatch_table.FreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers); @@ -4120,10 +4444,9 @@ if (pCreateInfo && pCreateInfo->queryType == VK_QUERY_TYPE_PIPELINE_STATISTICS) { if (!dev_data->enabled_features.pipelineStatisticsQuery) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT, 0, - __LINE__, VALIDATION_ERROR_11c0062e, "DS", - "Query pool with type VK_QUERY_TYPE_PIPELINE_STATISTICS created on a device " - "with VkDeviceCreateInfo.pEnabledFeatures.pipelineStatisticsQuery == VK_FALSE. %s", - validation_error_map[VALIDATION_ERROR_11c0062e]); + VALIDATION_ERROR_11c0062e, + "Query pool with type VK_QUERY_TYPE_PIPELINE_STATISTICS created on a device with " + "VkDeviceCreateInfo.pEnabledFeatures.pipelineStatisticsQuery == VK_FALSE."); } } @@ -4139,50 +4462,38 @@ return result; } -static bool PreCallValidateDestroyCommandPool(layer_data *dev_data, VkCommandPool pool, COMMAND_POOL_NODE **cp_state) { - *cp_state = GetCommandPoolNode(dev_data, pool); +static bool PreCallValidateDestroyCommandPool(layer_data *dev_data, VkCommandPool pool) { + COMMAND_POOL_NODE *cp_state = GetCommandPoolNode(dev_data, pool); if (dev_data->instance_data->disabled.destroy_command_pool) return false; bool skip = false; - if (*cp_state) { + if (cp_state) { // Verify that command buffers in pool are complete (not in-flight) - skip |= checkCommandBuffersInFlight(dev_data, *cp_state, "destroy command pool with", VALIDATION_ERROR_24000052); + skip |= checkCommandBuffersInFlight(dev_data, cp_state, "destroy command pool with", VALIDATION_ERROR_24000052); } return skip; } -static void PostCallRecordDestroyCommandPool(layer_data *dev_data, VkCommandPool pool, COMMAND_POOL_NODE *cp_state) { - // Must remove cmdpool from cmdpoolmap, after removing all cmdbuffers in its list from the commandBufferMap - for (auto cb : cp_state->commandBuffers) { - auto cb_node = GetCBNode(dev_data, cb); - clear_cmd_buf_and_mem_references(dev_data, cb_node); - // Remove references to this cb_node prior to delete - // TODO : Need better solution here, resetCB? - for (auto obj : cb_node->object_bindings) { - removeCommandBufferBinding(dev_data, &obj, cb_node); - } - for (auto framebuffer : cb_node->framebuffers) { - auto fb_state = GetFramebufferState(dev_data, framebuffer); - if (fb_state) fb_state->cb_bindings.erase(cb_node); - } - dev_data->commandBufferMap.erase(cb); // Remove this command buffer - delete cb_node; // delete CB info structure +static void PreCallRecordDestroyCommandPool(layer_data *dev_data, VkCommandPool pool) { + COMMAND_POOL_NODE *cp_state = GetCommandPoolNode(dev_data, pool); + // Remove cmdpool from cmdpoolmap, after freeing layer data for the command buffers + // "When a pool is destroyed, all command buffers allocated from the pool are freed." + if (cp_state) { + // Create a vector, as FreeCommandBufferStates deletes from cp_state->commandBuffers during iteration. + std::vector cb_vec{cp_state->commandBuffers.begin(), cp_state->commandBuffers.end()}; + FreeCommandBufferStates(dev_data, cp_state, static_cast(cb_vec.size()), cb_vec.data()); + dev_data->commandPoolMap.erase(pool); } - dev_data->commandPoolMap.erase(pool); } // Destroy commandPool along with all of the commandBuffers allocated from that pool VKAPI_ATTR void VKAPI_CALL DestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks *pAllocator) { layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - COMMAND_POOL_NODE *cp_state = nullptr; unique_lock_t lock(global_lock); - bool skip = PreCallValidateDestroyCommandPool(dev_data, commandPool, &cp_state); + bool skip = PreCallValidateDestroyCommandPool(dev_data, commandPool); if (!skip) { + PreCallRecordDestroyCommandPool(dev_data, commandPool); lock.unlock(); dev_data->dispatch_table.DestroyCommandPool(device, commandPool, pAllocator); - lock.lock(); - if (commandPool != VK_NULL_HANDLE) { - PostCallRecordDestroyCommandPool(dev_data, commandPool, cp_state); - } } } @@ -4203,7 +4514,7 @@ if (VK_SUCCESS == result) { lock.lock(); for (auto cmdBuffer : pPool->commandBuffers) { - resetCB(dev_data, cmdBuffer); + ResetCommandBufferState(dev_data, cmdBuffer); } lock.unlock(); } @@ -4217,10 +4528,9 @@ for (uint32_t i = 0; i < fenceCount; ++i) { auto pFence = GetFenceNode(dev_data, pFences[i]); if (pFence && pFence->scope == kSyncScopeInternal && pFence->state == FENCE_INFLIGHT) { - skip |= - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT, - HandleToUint64(pFences[i]), __LINE__, VALIDATION_ERROR_32e008c6, "DS", "Fence 0x%" PRIx64 " is in use. %s", - HandleToUint64(pFences[i]), validation_error_map[VALIDATION_ERROR_32e008c6]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT, + HandleToUint64(pFences[i]), VALIDATION_ERROR_32e008c6, "Fence 0x%" PRIx64 " is in use.", + HandleToUint64(pFences[i])); } } lock.unlock(); @@ -4252,11 +4562,11 @@ for (auto cb_node : cb_nodes) { if (cb_node->state == CB_RECORDING) { log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_node->commandBuffer), __LINE__, DRAWSTATE_INVALID_COMMAND_BUFFER, "DS", - "Invalidating a command buffer that's currently being recorded: 0x%p.", cb_node->commandBuffer); + HandleToUint64(cb_node->commandBuffer), DRAWSTATE_INVALID_COMMAND_BUFFER, + "Invalidating a command buffer that's currently being recorded: 0x%" PRIx64 ".", + HandleToUint64(cb_node->commandBuffer)); cb_node->state = CB_INVALID_INCOMPLETE; - } - else if (cb_node->state == CB_RECORDED) { + } else if (cb_node->state == CB_RECORDED) { cb_node->state = CB_INVALID_COMPLETE; } cb_node->broken_bindings.push_back(obj); @@ -4276,7 +4586,7 @@ bool skip = false; if (*framebuffer_state) { skip |= - ValidateObjectNotInUse(dev_data, *framebuffer_state, *obj_struct, "vkDestroyFrameBuffer", VALIDATION_ERROR_250006f8); + ValidateObjectNotInUse(dev_data, *framebuffer_state, *obj_struct, "vkDestroyFramebuffer", VALIDATION_ERROR_250006f8); } return skip; } @@ -4380,14 +4690,13 @@ return format_properties; } -VkImageFormatProperties GetImageFormatProperties(core_validation::layer_data *device_data, VkFormat format, VkImageType image_type, - VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags) { - VkImageFormatProperties image_format_properties; +VkResult GetImageFormatProperties(core_validation::layer_data *device_data, const VkImageCreateInfo *image_ci, + VkImageFormatProperties *pImageFormatProperties) { instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(device_data->instance_data->instance), instance_layer_data_map); - instance_data->dispatch_table.GetPhysicalDeviceImageFormatProperties(device_data->physical_device, format, image_type, tiling, - usage, flags, &image_format_properties); - return image_format_properties; + return instance_data->dispatch_table.GetPhysicalDeviceImageFormatProperties( + device_data->physical_device, image_ci->format, image_ci->imageType, image_ci->tiling, image_ci->usage, image_ci->flags, + pImageFormatProperties); } const debug_report_data *GetReportData(const core_validation::layer_data *device_data) { return device_data->report_data; } @@ -4426,12 +4735,12 @@ return &device_data->imageViewMap; } -const PHYS_DEV_PROPERTIES_NODE *GetPhysDevProperties(const layer_data *device_data) { - return &device_data->phys_dev_properties; -} +const PHYS_DEV_PROPERTIES_NODE *GetPhysDevProperties(const layer_data *device_data) { return &device_data->phys_dev_properties; } -const VkPhysicalDeviceFeatures *GetEnabledFeatures(const layer_data *device_data) { - return &device_data->enabled_features; +const VkPhysicalDeviceFeatures *GetEnabledFeatures(const layer_data *device_data) { return &device_data->enabled_features; } + +const VkPhysicalDeviceDescriptorIndexingFeaturesEXT *GetEnabledDescriptorIndexingFeatures(const layer_data *device_data) { + return &device_data->phys_dev_ext_props.descriptor_indexing_features; } const DeviceExtensions *GetDeviceExtensions(const layer_data *device_data) { return &device_data->extensions; } @@ -4510,6 +4819,50 @@ return result; } +// Validation cache: +// CV is the bottommost implementor of this extension. Don't pass calls down. +VKAPI_ATTR VkResult VKAPI_CALL CreateValidationCacheEXT(VkDevice device, const VkValidationCacheCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkValidationCacheEXT *pValidationCache) { + *pValidationCache = ValidationCache::Create(pCreateInfo); + return *pValidationCache ? VK_SUCCESS : VK_ERROR_INITIALIZATION_FAILED; +} + +VKAPI_ATTR void VKAPI_CALL DestroyValidationCacheEXT(VkDevice device, VkValidationCacheEXT validationCache, + const VkAllocationCallbacks *pAllocator) { + delete (ValidationCache *)validationCache; +} + +VKAPI_ATTR VkResult VKAPI_CALL GetValidationCacheDataEXT(VkDevice device, VkValidationCacheEXT validationCache, size_t *pDataSize, + void *pData) { + size_t inSize = *pDataSize; + ((ValidationCache *)validationCache)->Write(pDataSize, pData); + return (pData && *pDataSize != inSize) ? VK_INCOMPLETE : VK_SUCCESS; +} + +VKAPI_ATTR VkResult VKAPI_CALL MergeValidationCachesEXT(VkDevice device, VkValidationCacheEXT dstCache, uint32_t srcCacheCount, + const VkValidationCacheEXT *pSrcCaches) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + bool skip = false; + auto dst = (ValidationCache *)dstCache; + auto src = (ValidationCache const *const *)pSrcCaches; + VkResult result = VK_SUCCESS; + for (uint32_t i = 0; i < srcCacheCount; i++) { + if (src[i] == dst) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT, + 0, VALIDATION_ERROR_3e600c00, + "vkMergeValidationCachesEXT: dstCache (0x%" PRIx64 ") must not appear in pSrcCaches array.", + HandleToUint64(dstCache)); + result = VK_ERROR_VALIDATION_FAILED_EXT; + } + if (!skip) { + dst->Merge(src[i]); + } + } + + return result; +} + // utility function to set collective state for pipeline void set_pipeline_state(PIPELINE_STATE *pPipe) { // If any attachment used by this pipeline has blendEnable, set top-level blendEnable @@ -4546,8 +4899,8 @@ (pipe_state->attachments[i].srcAlphaBlendFactor == VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA)) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pipe_state->pipeline), __LINE__, DRAWSTATE_INVALID_FEATURE, "DS", - "CmdBindPipeline: vkPipeline (0x%" PRIxLEAST64 ") attachment[" PRINTF_SIZE_T_SPECIFIER + HandleToUint64(pipe_state->pipeline), DRAWSTATE_INVALID_FEATURE, + "CmdBindPipeline: vkPipeline (0x%" PRIx64 ") attachment[" PRINTF_SIZE_T_SPECIFIER "] has a dual-source blend factor but this device feature is not enabled.", HandleToUint64(pipe_state->pipeline), i); } @@ -4575,7 +4928,6 @@ for (i = 0; i < count; i++) { pipe_state.push_back(std::unique_ptr(new PIPELINE_STATE)); pipe_state[i]->initGraphicsPipeline(&pCreateInfos[i], GetRenderPassStateSharedPtr(dev_data, pCreateInfos[i].renderPass)); - pipe_state[i]->render_pass_ci.initialize(GetRenderPassState(dev_data, pCreateInfos[i].renderPass)->createInfo.ptr()); pipe_state[i]->pipeline_layout = *getPipelineLayout(dev_data, pCreateInfos[i].layout); } @@ -4664,7 +5016,10 @@ static bool PreCallValidateCreateDescriptorSetLayout(layer_data *dev_data, const VkDescriptorSetLayoutCreateInfo *create_info) { if (dev_data->instance_data->disabled.create_descriptor_set_layout) return false; - return cvdescriptorset::DescriptorSetLayout::ValidateCreateInfo(dev_data->report_data, create_info); + return cvdescriptorset::DescriptorSetLayout::ValidateCreateInfo( + dev_data->report_data, create_info, dev_data->extensions.vk_khr_push_descriptor, + dev_data->phys_dev_ext_props.max_push_descriptors, dev_data->extensions.vk_ext_descriptor_indexing, + &dev_data->phys_dev_ext_props.descriptor_indexing_features); } static void PostCallRecordCreateDescriptorSetLayout(layer_data *dev_data, const VkDescriptorSetLayoutCreateInfo *create_info, @@ -4703,39 +5058,37 @@ // This is a pain just to adapt the log message to the caller, but better to sort it out only when there is a problem. if (0 == strcmp(caller_name, "vkCreatePipelineLayout()")) { if (offset >= maxPushConstantsSize) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_11a0024c, "DS", - "%s call has push constants index %u with offset %u that " - "exceeds this device's maxPushConstantSize of %u. %s", - caller_name, index, offset, maxPushConstantsSize, validation_error_map[VALIDATION_ERROR_11a0024c]); + skip |= log_msg( + dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_11a0024c, + "%s call has push constants index %u with offset %u that exceeds this device's maxPushConstantSize of %u.", + caller_name, index, offset, maxPushConstantsSize); } if (size > maxPushConstantsSize - offset) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_11a00254, "DS", - "%s call has push constants index %u with offset %u and size %u that " - "exceeds this device's maxPushConstantSize of %u. %s", - caller_name, index, offset, size, maxPushConstantsSize, - validation_error_map[VALIDATION_ERROR_11a00254]); + VALIDATION_ERROR_11a00254, + "%s call has push constants index %u with offset %u and size %u that exceeds this device's " + "maxPushConstantSize of %u.", + caller_name, index, offset, size, maxPushConstantsSize); } } else if (0 == strcmp(caller_name, "vkCmdPushConstants()")) { if (offset >= maxPushConstantsSize) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_1bc002e4, "DS", - "%s call has push constants index %u with offset %u that " - "exceeds this device's maxPushConstantSize of %u. %s", - caller_name, index, offset, maxPushConstantsSize, validation_error_map[VALIDATION_ERROR_1bc002e4]); + skip |= log_msg( + dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_1bc002e4, + "%s call has push constants index %u with offset %u that exceeds this device's maxPushConstantSize of %u.", + caller_name, index, offset, maxPushConstantsSize); } if (size > maxPushConstantsSize - offset) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_1bc002e6, "DS", - "%s call has push constants index %u with offset %u and size %u that " - "exceeds this device's maxPushConstantSize of %u. %s", - caller_name, index, offset, size, maxPushConstantsSize, - validation_error_map[VALIDATION_ERROR_1bc002e6]); + VALIDATION_ERROR_1bc002e6, + "%s call has push constants index %u with offset %u and size %u that exceeds this device's " + "maxPushConstantSize of %u.", + caller_name, index, offset, size, maxPushConstantsSize); } } else { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, DRAWSTATE_INTERNAL_ERROR, "DS", "%s caller not supported.", caller_name); + DRAWSTATE_INTERNAL_ERROR, "%s caller not supported.", caller_name); } } // size needs to be non-zero and a multiple of 4. @@ -4743,118 +5096,616 @@ if (0 == strcmp(caller_name, "vkCreatePipelineLayout()")) { if (size == 0) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_11a00250, "DS", - "%s call has push constants index %u with " - "size %u. Size must be greater than zero. %s", - caller_name, index, size, validation_error_map[VALIDATION_ERROR_11a00250]); + VALIDATION_ERROR_11a00250, + "%s call has push constants index %u with size %u. Size must be greater than zero.", caller_name, + index, size); } if (size & 0x3) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_11a00252, "DS", - "%s call has push constants index %u with " - "size %u. Size must be a multiple of 4. %s", - caller_name, index, size, validation_error_map[VALIDATION_ERROR_11a00252]); + VALIDATION_ERROR_11a00252, + "%s call has push constants index %u with size %u. Size must be a multiple of 4.", caller_name, + index, size); } } else if (0 == strcmp(caller_name, "vkCmdPushConstants()")) { if (size == 0) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_1bc2c21b, "DS", - "%s call has push constants index %u with " - "size %u. Size must be greater than zero. %s", - caller_name, index, size, validation_error_map[VALIDATION_ERROR_1bc2c21b]); + VALIDATION_ERROR_1bc2c21b, + "%s call has push constants index %u with size %u. Size must be greater than zero.", caller_name, + index, size); } if (size & 0x3) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_1bc002e2, "DS", - "%s call has push constants index %u with " - "size %u. Size must be a multiple of 4. %s", - caller_name, index, size, validation_error_map[VALIDATION_ERROR_1bc002e2]); + VALIDATION_ERROR_1bc002e2, + "%s call has push constants index %u with size %u. Size must be a multiple of 4.", caller_name, + index, size); } } else { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, DRAWSTATE_INTERNAL_ERROR, "DS", "%s caller not supported.", caller_name); + DRAWSTATE_INTERNAL_ERROR, "%s caller not supported.", caller_name); } } // offset needs to be a multiple of 4. if ((offset & 0x3) != 0) { if (0 == strcmp(caller_name, "vkCreatePipelineLayout()")) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_11a0024e, "DS", - "%s call has push constants index %u with " - "offset %u. Offset must be a multiple of 4. %s", - caller_name, index, offset, validation_error_map[VALIDATION_ERROR_11a0024e]); + VALIDATION_ERROR_11a0024e, + "%s call has push constants index %u with offset %u. Offset must be a multiple of 4.", caller_name, + index, offset); } else if (0 == strcmp(caller_name, "vkCmdPushConstants()")) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_1bc002e0, "DS", - "%s call has push constants with " - "offset %u. Offset must be a multiple of 4. %s", - caller_name, offset, validation_error_map[VALIDATION_ERROR_1bc002e0]); + VALIDATION_ERROR_1bc002e0, "%s call has push constants with offset %u. Offset must be a multiple of 4.", + caller_name, offset); } else { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, DRAWSTATE_INTERNAL_ERROR, "DS", "%s caller not supported.", caller_name); + DRAWSTATE_INTERNAL_ERROR, "%s caller not supported.", caller_name); } } return skip; } -VKAPI_ATTR VkResult VKAPI_CALL CreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkPipelineLayout *pPipelineLayout) { +enum DSL_DESCRIPTOR_GROUPS { + DSL_TYPE_SAMPLERS = 0, + DSL_TYPE_UNIFORM_BUFFERS, + DSL_TYPE_STORAGE_BUFFERS, + DSL_TYPE_SAMPLED_IMAGES, + DSL_TYPE_STORAGE_IMAGES, + DSL_TYPE_INPUT_ATTACHMENTS, + DSL_NUM_DESCRIPTOR_GROUPS +}; + +// Used by PreCallValiateCreatePipelineLayout. +// Returns an array of size DSL_NUM_DESCRIPTOR_GROUPS of the maximum number of descriptors used in any single pipeline stage +std::valarray GetDescriptorCountMaxPerStage( + const layer_data *dev_data, const std::vector> set_layouts, + bool skip_update_after_bind) { + // Identify active pipeline stages + std::vector stage_flags = {VK_SHADER_STAGE_VERTEX_BIT, VK_SHADER_STAGE_FRAGMENT_BIT, + VK_SHADER_STAGE_COMPUTE_BIT}; + if (dev_data->enabled_features.geometryShader) { + stage_flags.push_back(VK_SHADER_STAGE_GEOMETRY_BIT); + } + if (dev_data->enabled_features.tessellationShader) { + stage_flags.push_back(VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT); + stage_flags.push_back(VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT); + } + + // Allow iteration over enum values + std::vector dsl_groups = {DSL_TYPE_SAMPLERS, DSL_TYPE_UNIFORM_BUFFERS, DSL_TYPE_STORAGE_BUFFERS, + DSL_TYPE_SAMPLED_IMAGES, DSL_TYPE_STORAGE_IMAGES, DSL_TYPE_INPUT_ATTACHMENTS}; + + // Sum by layouts per stage, then pick max of stages per type + std::valarray max_sum(0U, DSL_NUM_DESCRIPTOR_GROUPS); // max descriptor sum among all pipeline stages + for (auto stage : stage_flags) { + std::valarray stage_sum(0U, DSL_NUM_DESCRIPTOR_GROUPS); // per-stage sums + for (auto dsl : set_layouts) { + if (skip_update_after_bind && + (dsl->GetCreateFlags() & VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT)) { + continue; + } + + for (uint32_t binding_idx = 0; binding_idx < dsl->GetBindingCount(); binding_idx++) { + const VkDescriptorSetLayoutBinding *binding = dsl->GetDescriptorSetLayoutBindingPtrFromIndex(binding_idx); + if (0 != (stage & binding->stageFlags)) { + switch (binding->descriptorType) { + case VK_DESCRIPTOR_TYPE_SAMPLER: + stage_sum[DSL_TYPE_SAMPLERS] += binding->descriptorCount; + break; + case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: + case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: + stage_sum[DSL_TYPE_UNIFORM_BUFFERS] += binding->descriptorCount; + break; + case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: + case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: + stage_sum[DSL_TYPE_STORAGE_BUFFERS] += binding->descriptorCount; + break; + case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE: + case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: + stage_sum[DSL_TYPE_SAMPLED_IMAGES] += binding->descriptorCount; + break; + case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: + case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: + stage_sum[DSL_TYPE_STORAGE_IMAGES] += binding->descriptorCount; + break; + case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: + stage_sum[DSL_TYPE_SAMPLED_IMAGES] += binding->descriptorCount; + stage_sum[DSL_TYPE_SAMPLERS] += binding->descriptorCount; + break; + case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT: + stage_sum[DSL_TYPE_INPUT_ATTACHMENTS] += binding->descriptorCount; + break; + default: + break; + } + } + } + } + for (auto type : dsl_groups) { + max_sum[type] = std::max(stage_sum[type], max_sum[type]); + } + } + return max_sum; +} + +// Used by PreCallValidateCreatePipelineLayout. +// Returns an array of size VK_DESCRIPTOR_TYPE_RANGE_SIZE of the summed descriptors by type. +// Note: descriptors only count against the limit once even if used by multiple stages. +std::valarray GetDescriptorSum( + const layer_data *dev_data, const std::vector> &set_layouts, + bool skip_update_after_bind) { + std::valarray sum_by_type(0U, VK_DESCRIPTOR_TYPE_RANGE_SIZE); + for (auto dsl : set_layouts) { + if (skip_update_after_bind && (dsl->GetCreateFlags() & VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT)) { + continue; + } + + for (uint32_t binding_idx = 0; binding_idx < dsl->GetBindingCount(); binding_idx++) { + const VkDescriptorSetLayoutBinding *binding = dsl->GetDescriptorSetLayoutBindingPtrFromIndex(binding_idx); + sum_by_type[binding->descriptorType] += binding->descriptorCount; + } + } + return sum_by_type; +} + +static bool PreCallValiateCreatePipelineLayout(const layer_data *dev_data, const VkPipelineLayoutCreateInfo *pCreateInfo) { bool skip = false; - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - // TODO : Add checks for VALIDATION_ERRORS 865-870 - // Push Constant Range checks + + // Validate layout count against device physical limit + if (pCreateInfo->setLayoutCount > dev_data->phys_dev_props.limits.maxBoundDescriptorSets) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe0023c, + "vkCreatePipelineLayout(): setLayoutCount (%d) exceeds physical device maxBoundDescriptorSets limit (%d).", + pCreateInfo->setLayoutCount, dev_data->phys_dev_props.limits.maxBoundDescriptorSets); + } + + // Validate Push Constant ranges uint32_t i, j; for (i = 0; i < pCreateInfo->pushConstantRangeCount; ++i) { skip |= validatePushConstantRange(dev_data, pCreateInfo->pPushConstantRanges[i].offset, pCreateInfo->pPushConstantRanges[i].size, "vkCreatePipelineLayout()", i); if (0 == pCreateInfo->pPushConstantRanges[i].stageFlags) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_11a2dc03, "DS", "vkCreatePipelineLayout() call has no stageFlags set. %s", - validation_error_map[VALIDATION_ERROR_11a2dc03]); + VALIDATION_ERROR_11a2dc03, "vkCreatePipelineLayout() call has no stageFlags set."); } } - if (skip) return VK_ERROR_VALIDATION_FAILED_EXT; // As of 1.0.28, there is a VU that states that a stage flag cannot appear more than once in the list of push constant ranges. for (i = 0; i < pCreateInfo->pushConstantRangeCount; ++i) { for (j = i + 1; j < pCreateInfo->pushConstantRangeCount; ++j) { if (0 != (pCreateInfo->pPushConstantRanges[i].stageFlags & pCreateInfo->pPushConstantRanges[j].stageFlags)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_0fe00248, "DS", - "vkCreatePipelineLayout() Duplicate stage flags found in ranges %d and %d. %s", i, j, - validation_error_map[VALIDATION_ERROR_0fe00248]); + VALIDATION_ERROR_0fe00248, + "vkCreatePipelineLayout() Duplicate stage flags found in ranges %d and %d.", i, j); } } } + // Early-out + if (skip) return skip; + std::vector> set_layouts(pCreateInfo->setLayoutCount, nullptr); - unique_lock_t lock(global_lock); unsigned int push_descriptor_set_count = 0; - for (i = 0; i < pCreateInfo->setLayoutCount; ++i) { - set_layouts[i] = GetDescriptorSetLayout(dev_data, pCreateInfo->pSetLayouts[i]); - if (set_layouts[i]->IsPushDescriptor()) ++push_descriptor_set_count; - } - lock.unlock(); + { + unique_lock_t lock(global_lock); // Lock while accessing global state + for (i = 0; i < pCreateInfo->setLayoutCount; ++i) { + set_layouts[i] = GetDescriptorSetLayout(dev_data, pCreateInfo->pSetLayouts[i]); + if (set_layouts[i]->IsPushDescriptor()) ++push_descriptor_set_count; + } + } // Unlock + if (push_descriptor_set_count > 1) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_0fe0024a, "DS", - "vkCreatePipelineLayout() Multiple push descriptor sets found. %s", - validation_error_map[VALIDATION_ERROR_0fe0024a]); + VALIDATION_ERROR_0fe0024a, "vkCreatePipelineLayout() Multiple push descriptor sets found."); + } + + // Max descriptors by type, within a single pipeline stage + std::valarray max_descriptors_per_stage = GetDescriptorCountMaxPerStage(dev_data, set_layouts, true); + // Samplers + if (max_descriptors_per_stage[DSL_TYPE_SAMPLERS] > dev_data->phys_dev_props.limits.maxPerStageDescriptorSamplers) { + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe0023e, + "vkCreatePipelineLayout(): max per-stage sampler bindings count (%d) exceeds device " + "maxPerStageDescriptorSamplers limit (%d).", + max_descriptors_per_stage[DSL_TYPE_SAMPLERS], dev_data->phys_dev_props.limits.maxPerStageDescriptorSamplers); + } + + // Uniform buffers + if (max_descriptors_per_stage[DSL_TYPE_UNIFORM_BUFFERS] > dev_data->phys_dev_props.limits.maxPerStageDescriptorUniformBuffers) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe00240, + "vkCreatePipelineLayout(): max per-stage uniform buffer bindings count (%d) exceeds device " + "maxPerStageDescriptorUniformBuffers limit (%d).", + max_descriptors_per_stage[DSL_TYPE_UNIFORM_BUFFERS], + dev_data->phys_dev_props.limits.maxPerStageDescriptorUniformBuffers); + } + + // Storage buffers + if (max_descriptors_per_stage[DSL_TYPE_STORAGE_BUFFERS] > dev_data->phys_dev_props.limits.maxPerStageDescriptorStorageBuffers) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe00242, + "vkCreatePipelineLayout(): max per-stage storage buffer bindings count (%d) exceeds device " + "maxPerStageDescriptorStorageBuffers limit (%d).", + max_descriptors_per_stage[DSL_TYPE_STORAGE_BUFFERS], + dev_data->phys_dev_props.limits.maxPerStageDescriptorStorageBuffers); } + + // Sampled images + if (max_descriptors_per_stage[DSL_TYPE_SAMPLED_IMAGES] > dev_data->phys_dev_props.limits.maxPerStageDescriptorSampledImages) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe00244, + "vkCreatePipelineLayout(): max per-stage sampled image bindings count (%d) exceeds device " + "maxPerStageDescriptorSampledImages limit (%d).", + max_descriptors_per_stage[DSL_TYPE_SAMPLED_IMAGES], + dev_data->phys_dev_props.limits.maxPerStageDescriptorSampledImages); + } + + // Storage images + if (max_descriptors_per_stage[DSL_TYPE_STORAGE_IMAGES] > dev_data->phys_dev_props.limits.maxPerStageDescriptorStorageImages) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe00246, + "vkCreatePipelineLayout(): max per-stage storage image bindings count (%d) exceeds device " + "maxPerStageDescriptorStorageImages limit (%d).", + max_descriptors_per_stage[DSL_TYPE_STORAGE_IMAGES], + dev_data->phys_dev_props.limits.maxPerStageDescriptorStorageImages); + } + + // Input attachments + if (max_descriptors_per_stage[DSL_TYPE_INPUT_ATTACHMENTS] > + dev_data->phys_dev_props.limits.maxPerStageDescriptorInputAttachments) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe00d18, + "vkCreatePipelineLayout(): max per-stage input attachment bindings count (%d) exceeds device " + "maxPerStageDescriptorInputAttachments limit (%d).", + max_descriptors_per_stage[DSL_TYPE_INPUT_ATTACHMENTS], + dev_data->phys_dev_props.limits.maxPerStageDescriptorInputAttachments); + } + + // Total descriptors by type + // + std::valarray sum_all_stages = GetDescriptorSum(dev_data, set_layouts, true); + // Samplers + uint32_t sum = sum_all_stages[VK_DESCRIPTOR_TYPE_SAMPLER] + sum_all_stages[VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER]; + if (sum > dev_data->phys_dev_props.limits.maxDescriptorSetSamplers) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe00d1a, + "vkCreatePipelineLayout(): sum of sampler bindings among all stages (%d) exceeds device " + "maxDescriptorSetSamplers limit (%d).", + sum, dev_data->phys_dev_props.limits.maxDescriptorSetSamplers); + } + + // Uniform buffers + if (sum_all_stages[VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER] > dev_data->phys_dev_props.limits.maxDescriptorSetUniformBuffers) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe00d1c, + "vkCreatePipelineLayout(): sum of uniform buffer bindings among all stages (%d) exceeds device " + "maxDescriptorSetUniformBuffers limit (%d).", + sum_all_stages[VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER], + dev_data->phys_dev_props.limits.maxDescriptorSetUniformBuffers); + } + + // Dynamic uniform buffers + if (sum_all_stages[VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC] > + dev_data->phys_dev_props.limits.maxDescriptorSetUniformBuffersDynamic) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe00d1e, + "vkCreatePipelineLayout(): sum of dynamic uniform buffer bindings among all stages (%d) exceeds device " + "maxDescriptorSetUniformBuffersDynamic limit (%d).", + sum_all_stages[VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC], + dev_data->phys_dev_props.limits.maxDescriptorSetUniformBuffersDynamic); + } + + // Storage buffers + if (sum_all_stages[VK_DESCRIPTOR_TYPE_STORAGE_BUFFER] > dev_data->phys_dev_props.limits.maxDescriptorSetStorageBuffers) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe00d20, + "vkCreatePipelineLayout(): sum of storage buffer bindings among all stages (%d) exceeds device " + "maxDescriptorSetStorageBuffers limit (%d).", + sum_all_stages[VK_DESCRIPTOR_TYPE_STORAGE_BUFFER], + dev_data->phys_dev_props.limits.maxDescriptorSetStorageBuffers); + } + + // Dynamic storage buffers + if (sum_all_stages[VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC] > + dev_data->phys_dev_props.limits.maxDescriptorSetStorageBuffersDynamic) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe00d22, + "vkCreatePipelineLayout(): sum of dynamic storage buffer bindings among all stages (%d) exceeds device " + "maxDescriptorSetStorageBuffersDynamic limit (%d).", + sum_all_stages[VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC], + dev_data->phys_dev_props.limits.maxDescriptorSetStorageBuffersDynamic); + } + + // Sampled images + sum = sum_all_stages[VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE] + sum_all_stages[VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER] + + sum_all_stages[VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER]; + if (sum > dev_data->phys_dev_props.limits.maxDescriptorSetSampledImages) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe00d24, + "vkCreatePipelineLayout(): sum of sampled image bindings among all stages (%d) exceeds device " + "maxDescriptorSetSampledImages limit (%d).", + sum, dev_data->phys_dev_props.limits.maxDescriptorSetSampledImages); + } + + // Storage images + sum = sum_all_stages[VK_DESCRIPTOR_TYPE_STORAGE_IMAGE] + sum_all_stages[VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER]; + if (sum > dev_data->phys_dev_props.limits.maxDescriptorSetStorageImages) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe00d26, + "vkCreatePipelineLayout(): sum of storage image bindings among all stages (%d) exceeds device " + "maxDescriptorSetStorageImages limit (%d).", + sum, dev_data->phys_dev_props.limits.maxDescriptorSetStorageImages); + } + + // Input attachments + if (sum_all_stages[VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT] > dev_data->phys_dev_props.limits.maxDescriptorSetInputAttachments) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe00d28, + "vkCreatePipelineLayout(): sum of input attachment bindings among all stages (%d) exceeds device " + "maxDescriptorSetInputAttachments limit (%d).", + sum_all_stages[VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT], + dev_data->phys_dev_props.limits.maxDescriptorSetInputAttachments); + } + + if (dev_data->extensions.vk_ext_descriptor_indexing) { + // XXX TODO: replace with correct VU messages + + // Max descriptors by type, within a single pipeline stage + std::valarray max_descriptors_per_stage_update_after_bind = + GetDescriptorCountMaxPerStage(dev_data, set_layouts, false); + // Samplers + if (max_descriptors_per_stage_update_after_bind[DSL_TYPE_SAMPLERS] > + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxPerStageDescriptorUpdateAfterBindSamplers) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe0179c, + "vkCreatePipelineLayout(): max per-stage sampler bindings count (%d) exceeds device " + "maxPerStageDescriptorUpdateAfterBindSamplers limit (%d).", + max_descriptors_per_stage_update_after_bind[DSL_TYPE_SAMPLERS], + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxPerStageDescriptorUpdateAfterBindSamplers); + } + + // Uniform buffers + if (max_descriptors_per_stage_update_after_bind[DSL_TYPE_UNIFORM_BUFFERS] > + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxPerStageDescriptorUpdateAfterBindUniformBuffers) { + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe0179e, + "vkCreatePipelineLayout(): max per-stage uniform buffer bindings count (%d) exceeds device " + "maxPerStageDescriptorUpdateAfterBindUniformBuffers limit (%d).", + max_descriptors_per_stage_update_after_bind[DSL_TYPE_UNIFORM_BUFFERS], + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxPerStageDescriptorUpdateAfterBindUniformBuffers); + } + + // Storage buffers + if (max_descriptors_per_stage_update_after_bind[DSL_TYPE_STORAGE_BUFFERS] > + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxPerStageDescriptorUpdateAfterBindStorageBuffers) { + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe017a0, + "vkCreatePipelineLayout(): max per-stage storage buffer bindings count (%d) exceeds device " + "maxPerStageDescriptorUpdateAfterBindStorageBuffers limit (%d).", + max_descriptors_per_stage_update_after_bind[DSL_TYPE_STORAGE_BUFFERS], + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxPerStageDescriptorUpdateAfterBindStorageBuffers); + } + + // Sampled images + if (max_descriptors_per_stage_update_after_bind[DSL_TYPE_SAMPLED_IMAGES] > + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxPerStageDescriptorUpdateAfterBindSampledImages) { + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe017a2, + "vkCreatePipelineLayout(): max per-stage sampled image bindings count (%d) exceeds device " + "maxPerStageDescriptorUpdateAfterBindSampledImages limit (%d).", + max_descriptors_per_stage_update_after_bind[DSL_TYPE_SAMPLED_IMAGES], + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxPerStageDescriptorUpdateAfterBindSampledImages); + } + + // Storage images + if (max_descriptors_per_stage_update_after_bind[DSL_TYPE_STORAGE_IMAGES] > + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxPerStageDescriptorUpdateAfterBindStorageImages) { + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe017a4, + "vkCreatePipelineLayout(): max per-stage storage image bindings count (%d) exceeds device " + "maxPerStageDescriptorUpdateAfterBindStorageImages limit (%d).", + max_descriptors_per_stage_update_after_bind[DSL_TYPE_STORAGE_IMAGES], + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxPerStageDescriptorUpdateAfterBindStorageImages); + } + + // Input attachments + if (max_descriptors_per_stage_update_after_bind[DSL_TYPE_INPUT_ATTACHMENTS] > + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxPerStageDescriptorUpdateAfterBindInputAttachments) { + skip |= log_msg( + dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe017a6, + "vkCreatePipelineLayout(): max per-stage input attachment bindings count (%d) exceeds device " + "maxPerStageDescriptorUpdateAfterBindInputAttachments limit (%d).", + max_descriptors_per_stage_update_after_bind[DSL_TYPE_INPUT_ATTACHMENTS], + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxPerStageDescriptorUpdateAfterBindInputAttachments); + } + + // Total descriptors by type, summed across all pipeline stages + // + std::valarray sum_all_stages_update_after_bind = GetDescriptorSum(dev_data, set_layouts, false); + // Samplers + sum = sum_all_stages_update_after_bind[VK_DESCRIPTOR_TYPE_SAMPLER] + + sum_all_stages_update_after_bind[VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER]; + if (sum > dev_data->phys_dev_ext_props.descriptor_indexing_props.maxDescriptorSetUpdateAfterBindSamplers) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe017b8, + "vkCreatePipelineLayout(): sum of sampler bindings among all stages (%d) exceeds device " + "maxDescriptorSetUpdateAfterBindSamplers limit (%d).", + sum, dev_data->phys_dev_ext_props.descriptor_indexing_props.maxDescriptorSetUpdateAfterBindSamplers); + } + + // Uniform buffers + if (sum_all_stages_update_after_bind[VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER] > + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxDescriptorSetUpdateAfterBindUniformBuffers) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe017ba, + "vkCreatePipelineLayout(): sum of uniform buffer bindings among all stages (%d) exceeds device " + "maxDescriptorSetUpdateAfterBindUniformBuffers limit (%d).", + sum_all_stages_update_after_bind[VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER], + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxDescriptorSetUpdateAfterBindUniformBuffers); + } + + // Dynamic uniform buffers + if (sum_all_stages_update_after_bind[VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC] > + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic) { + skip |= log_msg( + dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe017bc, + "vkCreatePipelineLayout(): sum of dynamic uniform buffer bindings among all stages (%d) exceeds device " + "maxDescriptorSetUpdateAfterBindUniformBuffersDynamic limit (%d).", + sum_all_stages_update_after_bind[VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC], + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic); + } + + // Storage buffers + if (sum_all_stages_update_after_bind[VK_DESCRIPTOR_TYPE_STORAGE_BUFFER] > + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxDescriptorSetUpdateAfterBindStorageBuffers) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe017be, + "vkCreatePipelineLayout(): sum of storage buffer bindings among all stages (%d) exceeds device " + "maxDescriptorSetUpdateAfterBindStorageBuffers limit (%d).", + sum_all_stages_update_after_bind[VK_DESCRIPTOR_TYPE_STORAGE_BUFFER], + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxDescriptorSetUpdateAfterBindStorageBuffers); + } + + // Dynamic storage buffers + if (sum_all_stages_update_after_bind[VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC] > + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic) { + skip |= log_msg( + dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe017c0, + "vkCreatePipelineLayout(): sum of dynamic storage buffer bindings among all stages (%d) exceeds device " + "maxDescriptorSetUpdateAfterBindStorageBuffersDynamic limit (%d).", + sum_all_stages_update_after_bind[VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC], + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic); + } + + // Sampled images + sum = sum_all_stages_update_after_bind[VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE] + + sum_all_stages_update_after_bind[VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER] + + sum_all_stages_update_after_bind[VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER]; + if (sum > dev_data->phys_dev_ext_props.descriptor_indexing_props.maxDescriptorSetUpdateAfterBindSampledImages) { + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe017c2, + "vkCreatePipelineLayout(): sum of sampled image bindings among all stages (%d) exceeds device " + "maxDescriptorSetUpdateAfterBindSampledImages limit (%d).", + sum, dev_data->phys_dev_ext_props.descriptor_indexing_props.maxDescriptorSetUpdateAfterBindSampledImages); + } + + // Storage images + sum = sum_all_stages_update_after_bind[VK_DESCRIPTOR_TYPE_STORAGE_IMAGE] + + sum_all_stages_update_after_bind[VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER]; + if (sum > dev_data->phys_dev_ext_props.descriptor_indexing_props.maxDescriptorSetUpdateAfterBindStorageImages) { + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe017c4, + "vkCreatePipelineLayout(): sum of storage image bindings among all stages (%d) exceeds device " + "maxDescriptorSetUpdateAfterBindStorageImages limit (%d).", + sum, dev_data->phys_dev_ext_props.descriptor_indexing_props.maxDescriptorSetUpdateAfterBindStorageImages); + } + + // Input attachments + if (sum_all_stages_update_after_bind[VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT] > + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxDescriptorSetUpdateAfterBindInputAttachments) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0fe017c6, + "vkCreatePipelineLayout(): sum of input attachment bindings among all stages (%d) exceeds device " + "maxDescriptorSetUpdateAfterBindInputAttachments limit (%d).", + sum_all_stages_update_after_bind[VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT], + dev_data->phys_dev_ext_props.descriptor_indexing_props.maxDescriptorSetUpdateAfterBindInputAttachments); + } + } + return skip; +} + +// For repeatable sorting, not very useful for "memory in range" search +struct PushConstantRangeCompare { + bool operator()(const VkPushConstantRange *lhs, const VkPushConstantRange *rhs) const { + if (lhs->offset == rhs->offset) { + if (lhs->size == rhs->size) { + // The comparison is arbitrary, but avoids false aliasing by comparing all fields. + return lhs->stageFlags < rhs->stageFlags; + } + // If the offsets are the same then sorting by the end of range is useful for validation + return lhs->size < rhs->size; + } + return lhs->offset < rhs->offset; + } +}; + +static PushConstantRangesDict push_constant_ranges_dict; + +PushConstantRangesId get_canonical_id(const VkPipelineLayoutCreateInfo *info) { + if (!info->pPushConstantRanges) { + // Hand back the empty entry (creating as needed)... + return push_constant_ranges_dict.look_up(PushConstantRanges()); + } + + // Sort the input ranges to ensure equivalent ranges map to the same id + std::set sorted; + for (uint32_t i = 0; i < info->pushConstantRangeCount; i++) { + sorted.insert(info->pPushConstantRanges + i); + } + + PushConstantRanges ranges(sorted.size()); + for (const auto range : sorted) { + ranges.emplace_back(*range); + } + return push_constant_ranges_dict.look_up(std::move(ranges)); +} + +// Dictionary of canoncial form of the pipeline set layout of descriptor set layouts +static PipelineLayoutSetLayoutsDict pipeline_layout_set_layouts_dict; + +// Dictionary of canonical form of the "compatible for set" records +static PipelineLayoutCompatDict pipeline_layout_compat_dict; + +static PipelineLayoutCompatId get_canonical_id(const uint32_t set_index, const PushConstantRangesId pcr_id, + const PipelineLayoutSetLayoutsId set_layouts_id) { + return pipeline_layout_compat_dict.look_up(PipelineLayoutCompatDef(set_index, pcr_id, set_layouts_id)); +} + +static void PostCallRecordCreatePipelineLayout(layer_data *dev_data, const VkPipelineLayoutCreateInfo *pCreateInfo, + const VkPipelineLayout *pPipelineLayout) { + unique_lock_t lock(global_lock); // Lock while accessing state + + PIPELINE_LAYOUT_NODE &plNode = dev_data->pipelineLayoutMap[*pPipelineLayout]; + plNode.layout = *pPipelineLayout; + plNode.set_layouts.resize(pCreateInfo->setLayoutCount); + PipelineLayoutSetLayoutsDef set_layouts(pCreateInfo->setLayoutCount); + for (uint32_t i = 0; i < pCreateInfo->setLayoutCount; ++i) { + plNode.set_layouts[i] = GetDescriptorSetLayout(dev_data, pCreateInfo->pSetLayouts[i]); + set_layouts[i] = plNode.set_layouts[i]->get_layout_id(); + } + + // Get canonical form IDs for the "compatible for set" contents + plNode.push_constant_ranges = get_canonical_id(pCreateInfo); + auto set_layouts_id = pipeline_layout_set_layouts_dict.look_up(set_layouts); + plNode.compat_for_set.reserve(pCreateInfo->setLayoutCount); + + // Create table of "compatible for set N" cannonical forms for trivial accept validation + for (uint32_t i = 0; i < pCreateInfo->setLayoutCount; ++i) { + plNode.compat_for_set.emplace_back(get_canonical_id(i, plNode.push_constant_ranges, set_layouts_id)); + } + + // Implicit unlock +}; + +VKAPI_ATTR VkResult VKAPI_CALL CreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkPipelineLayout *pPipelineLayout) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + + bool skip = PreCallValiateCreatePipelineLayout(dev_data, pCreateInfo); if (skip) return VK_ERROR_VALIDATION_FAILED_EXT; VkResult result = dev_data->dispatch_table.CreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout); + if (VK_SUCCESS == result) { - lock.lock(); - PIPELINE_LAYOUT_NODE &plNode = dev_data->pipelineLayoutMap[*pPipelineLayout]; - plNode.layout = *pPipelineLayout; - plNode.set_layouts.resize(pCreateInfo->setLayoutCount); - plNode.set_layouts.swap(set_layouts); - plNode.push_constant_ranges.resize(pCreateInfo->pushConstantRangeCount); - for (i = 0; i < pCreateInfo->pushConstantRangeCount; ++i) { - plNode.push_constant_ranges[i] = pCreateInfo->pPushConstantRanges[i]; - } - lock.unlock(); + PostCallRecordCreatePipelineLayout(dev_data, pCreateInfo, pPipelineLayout); } return result; } @@ -4867,7 +5718,7 @@ DESCRIPTOR_POOL_STATE *pNewNode = new DESCRIPTOR_POOL_STATE(*pDescriptorPool, pCreateInfo); if (NULL == pNewNode) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT, - HandleToUint64(*pDescriptorPool), __LINE__, DRAWSTATE_OUT_OF_MEMORY, "DS", + HandleToUint64(*pDescriptorPool), DRAWSTATE_OUT_OF_MEMORY, "Out of memory while attempting to allocate DESCRIPTOR_POOL_STATE in vkCreateDescriptorPool()")) return VK_ERROR_VALIDATION_FAILED_EXT; } else { @@ -4947,10 +5798,9 @@ if (pool_state && !(VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT & pool_state->createInfo.flags)) { // Can't Free from a NON_FREE pool skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT, - HandleToUint64(pool), __LINE__, VALIDATION_ERROR_28600270, "DS", + HandleToUint64(pool), VALIDATION_ERROR_28600270, "It is invalid to call vkFreeDescriptorSets() with a pool created without setting " - "VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT. %s", - validation_error_map[VALIDATION_ERROR_28600270]); + "VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT."); } return skip; } @@ -5049,11 +5899,11 @@ if (pPool) { for (uint32_t i = 0; i < pCreateInfo->commandBufferCount; i++) { // Add command buffer to its commandPool map - pPool->commandBuffers.push_back(pCommandBuffer[i]); + pPool->commandBuffers.insert(pCommandBuffer[i]); GLOBAL_CB_NODE *pCB = new GLOBAL_CB_NODE; // Add command buffer to map dev_data->commandBufferMap[pCommandBuffer[i]] = pCB; - resetCB(dev_data, pCommandBuffer[i]); + ResetCommandBufferState(dev_data, pCommandBuffer[i]); pCB->createInfo = *pCreateInfo; pCB->device = device; } @@ -5085,10 +5935,10 @@ // This implicitly resets the Cmd Buffer so make sure any fence is done and then clear memory references if (cb_node->in_use.load()) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_16e00062, "MEM", - "Calling vkBeginCommandBuffer() on active command buffer %p before it has completed. " - "You must check command buffer fence before this call. %s", - commandBuffer, validation_error_map[VALIDATION_ERROR_16e00062]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_16e00062, + "Calling vkBeginCommandBuffer() on active command buffer %" PRIx64 + " before it has completed. You must check command buffer fence before this call.", + HandleToUint64(commandBuffer)); } clear_cmd_buf_and_mem_references(dev_data, cb_node); if (cb_node->createInfo.level != VK_COMMAND_BUFFER_LEVEL_PRIMARY) { @@ -5097,9 +5947,9 @@ if (!pInfo) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_16e00066, "DS", - "vkBeginCommandBuffer(): Secondary Command Buffer (0x%p) must have inheritance info. %s", commandBuffer, - validation_error_map[VALIDATION_ERROR_16e00066]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_16e00066, + "vkBeginCommandBuffer(): Secondary Command Buffer (0x%" PRIx64 ") must have inheritance info.", + HandleToUint64(commandBuffer)); } else { if (pBeginInfo->flags & VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT) { assert(pInfo->renderPass); @@ -5120,12 +5970,12 @@ if ((pInfo->occlusionQueryEnable == VK_FALSE || dev_data->enabled_features.occlusionQueryPrecise == VK_FALSE) && (pInfo->queryFlags & VK_QUERY_CONTROL_PRECISE_BIT)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(commandBuffer), __LINE__, - VALIDATION_ERROR_16e00068, "DS", - "vkBeginCommandBuffer(): Secondary Command Buffer (0x%p) must not have " - "VK_QUERY_CONTROL_PRECISE_BIT if occulusionQuery is disabled or the device does not " - "support precise occlusion queries. %s", - commandBuffer, validation_error_map[VALIDATION_ERROR_16e00068]); + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(commandBuffer), + VALIDATION_ERROR_16e00068, + "vkBeginCommandBuffer(): Secondary Command Buffer (0x%" PRIx64 + ") must not have VK_QUERY_CONTROL_PRECISE_BIT if occulusionQuery is disabled or the device " + "does not support precise occlusion queries.", + HandleToUint64(commandBuffer)); } } if (pInfo && pInfo->renderPass != VK_NULL_HANDLE) { @@ -5133,35 +5983,34 @@ if (renderPass) { if (pInfo->subpass >= renderPass->createInfo.subpassCount) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(commandBuffer), __LINE__, - VALIDATION_ERROR_0280006c, "DS", - "vkBeginCommandBuffer(): Secondary Command Buffers (0x%p) must have a subpass index (%d) " - "that is less than the number of subpasses (%d). %s", - commandBuffer, pInfo->subpass, renderPass->createInfo.subpassCount, - validation_error_map[VALIDATION_ERROR_0280006c]); + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(commandBuffer), + VALIDATION_ERROR_0280006c, + "vkBeginCommandBuffer(): Secondary Command Buffers (0x%" PRIx64 + ") must have a subpass index (%d) that is less than the number of subpasses (%d).", + HandleToUint64(commandBuffer), pInfo->subpass, renderPass->createInfo.subpassCount); } } } } if (CB_RECORDING == cb_node->state) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_16e00062, "DS", - "vkBeginCommandBuffer(): Cannot call Begin on command buffer (0x%p" - ") in the RECORDING state. Must first call vkEndCommandBuffer(). %s", - commandBuffer, validation_error_map[VALIDATION_ERROR_16e00062]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_16e00062, + "vkBeginCommandBuffer(): Cannot call Begin on command buffer (0x%" PRIx64 + ") in the RECORDING state. Must first call vkEndCommandBuffer().", + HandleToUint64(commandBuffer)); } else if (CB_RECORDED == cb_node->state || CB_INVALID_COMPLETE == cb_node->state) { VkCommandPool cmdPool = cb_node->createInfo.commandPool; auto pPool = GetCommandPoolNode(dev_data, cmdPool); if (!(VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT & pPool->createFlags)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_16e00064, "DS", - "Call to vkBeginCommandBuffer() on command buffer (0x%p" - ") attempts to implicitly reset cmdBuffer created from command pool (0x%" PRIxLEAST64 - ") that does NOT have the VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT bit set. %s", - commandBuffer, HandleToUint64(cmdPool), validation_error_map[VALIDATION_ERROR_16e00064]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_16e00064, + "Call to vkBeginCommandBuffer() on command buffer (0x%" PRIx64 + ") attempts to implicitly reset cmdBuffer created from command pool (0x%" PRIx64 + ") that does NOT have the VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT bit set.", + HandleToUint64(commandBuffer), HandleToUint64(cmdPool)); } - resetCB(dev_data, commandBuffer); + ResetCommandBufferState(dev_data, commandBuffer); } // Set updated state here in case implicit reset occurs above cb_node->state = CB_RECORDING; @@ -5187,6 +6036,13 @@ return result; } +static void PostCallRecordEndCommandBuffer(layer_data *dev_data, GLOBAL_CB_NODE *cb_state) { + // Cached validation is specific to a specific recording of a specific command buffer. + for (auto descriptor_set : cb_state->validated_descriptor_sets) { + descriptor_set->ClearCachedValidation(cb_state); + } + cb_state->validated_descriptor_sets.clear(); +} VKAPI_ATTR VkResult VKAPI_CALL EndCommandBuffer(VkCommandBuffer commandBuffer) { bool skip = false; @@ -5200,18 +6056,19 @@ // https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/pull/516#discussion_r63013756 skip |= insideRenderPass(dev_data, pCB, "vkEndCommandBuffer()", VALIDATION_ERROR_27400078); } - skip |= ValidateCmd(dev_data, pCB, CMD_END, "vkEndCommandBuffer()"); + skip |= ValidateCmd(dev_data, pCB, CMD_ENDCOMMANDBUFFER, "vkEndCommandBuffer()"); for (auto query : pCB->activeQueries) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_2740007a, "DS", - "Ending command buffer with in progress query: queryPool 0x%" PRIx64 ", index %d. %s", - HandleToUint64(query.pool), query.index, validation_error_map[VALIDATION_ERROR_2740007a]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_2740007a, + "Ending command buffer with in progress query: queryPool 0x%" PRIx64 ", index %d.", + HandleToUint64(query.pool), query.index); } } if (!skip) { lock.unlock(); auto result = dev_data->dispatch_table.EndCommandBuffer(commandBuffer); lock.lock(); + PostCallRecordEndCommandBuffer(dev_data, pCB); if (VK_SUCCESS == result) { pCB->state = CB_RECORDED; } @@ -5230,10 +6087,10 @@ auto pPool = GetCommandPoolNode(dev_data, cmdPool); if (!(VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT & pPool->createFlags)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_3260005c, "DS", - "Attempt to reset command buffer (0x%p) created from command pool (0x%" PRIxLEAST64 - ") that does NOT have the VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT bit set. %s", - commandBuffer, HandleToUint64(cmdPool), validation_error_map[VALIDATION_ERROR_3260005c]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_3260005c, + "Attempt to reset command buffer (0x%" PRIx64 ") created from command pool (0x%" PRIx64 + ") that does NOT have the VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT bit set.", + HandleToUint64(commandBuffer), HandleToUint64(cmdPool)); } skip |= checkCommandBufferInFlight(dev_data, pCB, "reset", VALIDATION_ERROR_3260005a); lock.unlock(); @@ -5241,7 +6098,7 @@ VkResult result = dev_data->dispatch_table.ResetCommandBuffer(commandBuffer, flags); if (VK_SUCCESS == result) { lock.lock(); - resetCB(dev_data, commandBuffer); + ResetCommandBufferState(dev_data, commandBuffer); lock.unlock(); } return result; @@ -5257,7 +6114,7 @@ skip |= ValidateCmdQueueFlags(dev_data, cb_state, "vkCmdBindPipeline()", VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT, VALIDATION_ERROR_18002415); skip |= ValidateCmd(dev_data, cb_state, CMD_BINDPIPELINE, "vkCmdBindPipeline()"); - // TODO: VALIDATION_ERROR_18000612 VALIDATION_ERROR_18000616 + // TODO: VALIDATION_ERROR_18000612 VALIDATION_ERROR_18000616 -- using ValidatePipelineBindPoint auto pipe_state = getPipelineState(dev_data, pipeline); if (VK_PIPELINE_BIND_POINT_GRAPHICS == pipelineBindPoint) { @@ -5282,12 +6139,11 @@ GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer); if (pCB) { skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetViewport()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_1e002415); - skip |= ValidateCmd(dev_data, pCB, CMD_SETVIEWPORTSTATE, "vkCmdSetViewport()"); + skip |= ValidateCmd(dev_data, pCB, CMD_SETVIEWPORT, "vkCmdSetViewport()"); if (pCB->static_status & CBSTATUS_VIEWPORT_SET) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_1e00098a, "DS", - "vkCmdSetViewport(): pipeline was created without VK_DYNAMIC_STATE_VIEWPORT flag. %s.", - validation_error_map[VALIDATION_ERROR_1e00098a]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_1e00098a, + "vkCmdSetViewport(): pipeline was created without VK_DYNAMIC_STATE_VIEWPORT flag.."); } if (!skip) { pCB->viewportMask |= ((1u << viewportCount) - 1u) << firstViewport; @@ -5306,12 +6162,11 @@ GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer); if (pCB) { skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetScissor()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_1d802415); - skip |= ValidateCmd(dev_data, pCB, CMD_SETSCISSORSTATE, "vkCmdSetScissor()"); + skip |= ValidateCmd(dev_data, pCB, CMD_SETSCISSOR, "vkCmdSetScissor()"); if (pCB->static_status & CBSTATUS_SCISSOR_SET) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_1d80049c, "DS", - "vkCmdSetScissor(): pipeline was created without VK_DYNAMIC_STATE_SCISSOR flag. %s.", - validation_error_map[VALIDATION_ERROR_1d80049c]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_1d80049c, + "vkCmdSetScissor(): pipeline was created without VK_DYNAMIC_STATE_SCISSOR flag.."); } if (!skip) { pCB->scissorMask |= ((1u << scissorCount) - 1u) << firstScissor; @@ -5329,17 +6184,12 @@ GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer); if (pCB) { skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetLineWidth()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_1d602415); - skip |= ValidateCmd(dev_data, pCB, CMD_SETLINEWIDTHSTATE, "vkCmdSetLineWidth()"); + skip |= ValidateCmd(dev_data, pCB, CMD_SETLINEWIDTH, "vkCmdSetLineWidth()"); if (pCB->static_status & CBSTATUS_LINE_WIDTH_SET) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_1d600626, "DS", - "vkCmdSetLineWidth called but pipeline was created without VK_DYNAMIC_STATE_LINE_WIDTH " - "flag. %s", - validation_error_map[VALIDATION_ERROR_1d600626]); - } else { - skip |= verifyLineWidth(dev_data, DRAWSTATE_INVALID_SET, kVulkanObjectTypeCommandBuffer, HandleToUint64(commandBuffer), - lineWidth); + HandleToUint64(commandBuffer), VALIDATION_ERROR_1d600626, + "vkCmdSetLineWidth called but pipeline was created without VK_DYNAMIC_STATE_LINE_WIDTH flag."); } if (!skip) { pCB->status |= CBSTATUS_LINE_WIDTH_SET; @@ -5357,19 +6207,17 @@ GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer); if (pCB) { skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetDepthBias()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_1cc02415); - skip |= ValidateCmd(dev_data, pCB, CMD_SETDEPTHBIASSTATE, "vkCmdSetDepthBias()"); + skip |= ValidateCmd(dev_data, pCB, CMD_SETDEPTHBIAS, "vkCmdSetDepthBias()"); if (pCB->static_status & CBSTATUS_DEPTH_BIAS_SET) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_1cc0062a, "DS", - "vkCmdSetDepthBias(): pipeline was created without VK_DYNAMIC_STATE_DEPTH_BIAS flag. %s.", - validation_error_map[VALIDATION_ERROR_1cc0062a]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_1cc0062a, + "vkCmdSetDepthBias(): pipeline was created without VK_DYNAMIC_STATE_DEPTH_BIAS flag.."); } if ((depthBiasClamp != 0.0) && (!dev_data->enabled_features.depthBiasClamp)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_1cc0062c, "DS", - "vkCmdSetDepthBias(): the depthBiasClamp device feature is disabled: the depthBiasClamp " - "parameter must be set to 0.0. %s", - validation_error_map[VALIDATION_ERROR_1cc0062c]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_1cc0062c, + "vkCmdSetDepthBias(): the depthBiasClamp device feature is disabled: the depthBiasClamp parameter must " + "be set to 0.0."); } if (!skip) { pCB->status |= CBSTATUS_DEPTH_BIAS_SET; @@ -5387,12 +6235,11 @@ GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer); if (pCB) { skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetBlendConstants()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_1ca02415); - skip |= ValidateCmd(dev_data, pCB, CMD_SETBLENDSTATE, "vkCmdSetBlendConstants()"); + skip |= ValidateCmd(dev_data, pCB, CMD_SETBLENDCONSTANTS, "vkCmdSetBlendConstants()"); if (pCB->static_status & CBSTATUS_BLEND_CONSTANTS_SET) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_1ca004c8, "DS", - "vkCmdSetBlendConstants(): pipeline was created without VK_DYNAMIC_STATE_BLEND_CONSTANTS flag. %s.", - validation_error_map[VALIDATION_ERROR_1ca004c8]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_1ca004c8, + "vkCmdSetBlendConstants(): pipeline was created without VK_DYNAMIC_STATE_BLEND_CONSTANTS flag.."); } if (!skip) { pCB->status |= CBSTATUS_BLEND_CONSTANTS_SET; @@ -5409,12 +6256,11 @@ GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer); if (pCB) { skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetDepthBounds()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_1ce02415); - skip |= ValidateCmd(dev_data, pCB, CMD_SETDEPTHBOUNDSSTATE, "vkCmdSetDepthBounds()"); + skip |= ValidateCmd(dev_data, pCB, CMD_SETDEPTHBOUNDS, "vkCmdSetDepthBounds()"); if (pCB->static_status & CBSTATUS_DEPTH_BOUNDS_SET) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_1ce004ae, "DS", - "vkCmdSetDepthBounds(): pipeline was created without VK_DYNAMIC_STATE_DEPTH_BOUNDS flag. %s.", - validation_error_map[VALIDATION_ERROR_1ce004ae]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_1ce004ae, + "vkCmdSetDepthBounds(): pipeline was created without VK_DYNAMIC_STATE_DEPTH_BOUNDS flag.."); } if (!skip) { pCB->status |= CBSTATUS_DEPTH_BOUNDS_SET; @@ -5433,12 +6279,12 @@ if (pCB) { skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetStencilCompareMask()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_1da02415); - skip |= ValidateCmd(dev_data, pCB, CMD_SETSTENCILREADMASKSTATE, "vkCmdSetStencilCompareMask()"); + skip |= ValidateCmd(dev_data, pCB, CMD_SETSTENCILCOMPAREMASK, "vkCmdSetStencilCompareMask()"); if (pCB->static_status & CBSTATUS_STENCIL_READ_MASK_SET) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_1da004b4, "DS", - "vkCmdSetStencilCompareMask(): pipeline was created without VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK flag. %s.", - validation_error_map[VALIDATION_ERROR_1da004b4]); + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_1da004b4, + "vkCmdSetStencilCompareMask(): pipeline was created without VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK flag.."); } if (!skip) { pCB->status |= CBSTATUS_STENCIL_READ_MASK_SET; @@ -5456,12 +6302,11 @@ if (pCB) { skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetStencilWriteMask()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_1de02415); - skip |= ValidateCmd(dev_data, pCB, CMD_SETSTENCILWRITEMASKSTATE, "vkCmdSetStencilWriteMask()"); + skip |= ValidateCmd(dev_data, pCB, CMD_SETSTENCILWRITEMASK, "vkCmdSetStencilWriteMask()"); if (pCB->static_status & CBSTATUS_STENCIL_WRITE_MASK_SET) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_1de004b6, "DS", - "vkCmdSetStencilWriteMask(): pipeline was created without VK_DYNAMIC_STATE_STENCIL_WRITE_MASK flag. %s.", - validation_error_map[VALIDATION_ERROR_1de004b6]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_1de004b6, + "vkCmdSetStencilWriteMask(): pipeline was created without VK_DYNAMIC_STATE_STENCIL_WRITE_MASK flag.."); } if (!skip) { pCB->status |= CBSTATUS_STENCIL_WRITE_MASK_SET; @@ -5479,12 +6324,11 @@ if (pCB) { skip |= ValidateCmdQueueFlags(dev_data, pCB, "vkCmdSetStencilReference()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_1dc02415); - skip |= ValidateCmd(dev_data, pCB, CMD_SETSTENCILREFERENCESTATE, "vkCmdSetStencilReference()"); + skip |= ValidateCmd(dev_data, pCB, CMD_SETSTENCILREFERENCE, "vkCmdSetStencilReference()"); if (pCB->static_status & CBSTATUS_STENCIL_REFERENCE_SET) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_1dc004b8, "DS", - "vkCmdSetStencilReference(): pipeline was created without VK_DYNAMIC_STATE_STENCIL_REFERENCE flag. %s.", - validation_error_map[VALIDATION_ERROR_1dc004b8]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_1dc004b8, + "vkCmdSetStencilReference(): pipeline was created without VK_DYNAMIC_STATE_STENCIL_REFERENCE flag.."); } if (!skip) { pCB->status |= CBSTATUS_STENCIL_REFERENCE_SET; @@ -5494,62 +6338,128 @@ if (!skip) dev_data->dispatch_table.CmdSetStencilReference(commandBuffer, faceMask, reference); } -static void PreCallRecordCmdBindDescriptorSets(layer_data *device_data, GLOBAL_CB_NODE *cb_state, - VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, - uint32_t setCount, const VkDescriptorSet *pDescriptorSets, - uint32_t dynamicOffsetCount, const uint32_t *pDynamicOffsets) { - uint32_t total_dynamic_descriptors = 0; - string error_string = ""; - uint32_t last_set_index = firstSet + setCount - 1; - auto last_bound = &cb_state->lastBound[pipelineBindPoint]; +// Update pipeline_layout bind points applying the "Pipeline Layout Compatibility" rules +static void UpdateLastBoundDescriptorSets(layer_data *device_data, GLOBAL_CB_NODE *cb_state, + VkPipelineBindPoint pipeline_bind_point, const PIPELINE_LAYOUT_NODE *pipeline_layout, + uint32_t first_set, uint32_t set_count, + const std::vector descriptor_sets, + uint32_t dynamic_offset_count, const uint32_t *p_dynamic_offsets) { + // Defensive + assert(set_count); + if (0 == set_count) return; + assert(pipeline_layout); + if (!pipeline_layout) return; + + uint32_t required_size = first_set + set_count; + const uint32_t last_binding_index = required_size - 1; + assert(last_binding_index < pipeline_layout->compat_for_set.size()); + + // Some useful shorthand + auto &last_bound = cb_state->lastBound[pipeline_bind_point]; + + auto &bound_sets = last_bound.boundDescriptorSets; + auto &dynamic_offsets = last_bound.dynamicOffsets; + auto &bound_compat_ids = last_bound.compat_id_for_set; + auto &pipe_compat_ids = pipeline_layout->compat_for_set; + + const uint32_t current_size = static_cast(bound_sets.size()); + assert(current_size == dynamic_offsets.size()); + assert(current_size == bound_compat_ids.size()); + + // We need this three times in this function, but nowhere else + auto push_descriptor_cleanup = [&last_bound](const cvdescriptorset::DescriptorSet *ds) -> bool { + if (ds && ds->IsPushDescriptor()) { + assert(ds == last_bound.push_descriptor_set.get()); + last_bound.push_descriptor_set = nullptr; + return true; + } + return false; + }; - if (last_set_index >= last_bound->boundDescriptorSets.size()) { - last_bound->boundDescriptorSets.resize(last_set_index + 1); - last_bound->dynamicOffsets.resize(last_set_index + 1); + // Clean up the "disturbed" before and after the range to be set + if (required_size < current_size) { + if (bound_compat_ids[last_binding_index] != pipe_compat_ids[last_binding_index]) { + // We're disturbing those after last, we'll shrink below, but first need to check for and cleanup the push_descriptor + for (auto set_idx = required_size; set_idx < current_size; ++set_idx) { + if (push_descriptor_cleanup(bound_sets[set_idx])) break; + } + } else { + // We're not disturbing past last, so leave the upper binding data alone. + required_size = current_size; + } } - auto old_final_bound_set = last_bound->boundDescriptorSets[last_set_index]; - auto pipeline_layout = getPipelineLayout(device_data, layout); - for (uint32_t set_idx = 0; set_idx < setCount; set_idx++) { - cvdescriptorset::DescriptorSet *descriptor_set = GetSetNode(device_data, pDescriptorSets[set_idx]); - if (descriptor_set) { - last_bound->pipeline_layout = *pipeline_layout; - if ((last_bound->boundDescriptorSets[set_idx + firstSet] != nullptr) && - last_bound->boundDescriptorSets[set_idx + firstSet]->IsPushDescriptor()) { - last_bound->push_descriptor_set = nullptr; - last_bound->boundDescriptorSets[set_idx + firstSet] = nullptr; - } + // We resize if we need more set entries or if those past "last" are disturbed + if (required_size != current_size) { + // TODO: put these size tied things in a struct (touches many lines) + bound_sets.resize(required_size); + dynamic_offsets.resize(required_size); + bound_compat_ids.resize(required_size); + } - last_bound->boundDescriptorSets[set_idx + firstSet] = descriptor_set; + // For any previously bound sets, need to set them to "invalid" if they were disturbed by this update + for (uint32_t set_idx = 0; set_idx < first_set; ++set_idx) { + if (bound_compat_ids[set_idx] != pipe_compat_ids[set_idx]) { + push_descriptor_cleanup(bound_sets[set_idx]); + bound_sets[set_idx] = nullptr; + dynamic_offsets[set_idx].clear(); + bound_compat_ids[set_idx] = pipe_compat_ids[set_idx]; + } + } + // Now update the bound sets with the input sets + const uint32_t *input_dynamic_offsets = p_dynamic_offsets; // "read" pointer for dynamic offset data + for (uint32_t input_idx = 0; input_idx < set_count; input_idx++) { + auto set_idx = input_idx + first_set; // set_idx is index within layout, input_idx is index within input descriptor sets + cvdescriptorset::DescriptorSet *descriptor_set = descriptor_sets[input_idx]; + + // Record binding (or push) + push_descriptor_cleanup(bound_sets[set_idx]); + bound_sets[set_idx] = descriptor_set; + bound_compat_ids[set_idx] = pipe_compat_ids[set_idx]; // compat ids are canonical *per* set index + + if (descriptor_set) { auto set_dynamic_descriptor_count = descriptor_set->GetDynamicDescriptorCount(); - last_bound->dynamicOffsets[firstSet + set_idx].clear(); - if (set_dynamic_descriptor_count) { - last_bound->dynamicOffsets[firstSet + set_idx] = - std::vector(pDynamicOffsets + total_dynamic_descriptors, - pDynamicOffsets + total_dynamic_descriptors + set_dynamic_descriptor_count); - total_dynamic_descriptors += set_dynamic_descriptor_count; - } - } - // For any previously bound sets, need to set them to "invalid" if they were disturbed by this update - if (firstSet > 0) { - for (uint32_t i = 0; i < firstSet; ++i) { - if (last_bound->boundDescriptorSets[i] && - !verify_set_layout_compatibility(last_bound->boundDescriptorSets[i], pipeline_layout, i, error_string)) { - last_bound->boundDescriptorSets[i] = VK_NULL_HANDLE; - } + // TODO: Add logic for tracking push_descriptor offsets (here or in caller) + if (set_dynamic_descriptor_count && input_dynamic_offsets) { + const uint32_t *end_offset = input_dynamic_offsets + set_dynamic_descriptor_count; + dynamic_offsets[set_idx] = std::vector(input_dynamic_offsets, end_offset); + input_dynamic_offsets = end_offset; + assert(input_dynamic_offsets <= (p_dynamic_offsets + dynamic_offset_count)); + } else { + dynamic_offsets[set_idx].clear(); } - } - // Check if newly last bound set invalidates any remaining bound sets - if ((last_bound->boundDescriptorSets.size() - 1) > (last_set_index)) { - if (old_final_bound_set && - !verify_set_layout_compatibility(old_final_bound_set, pipeline_layout, last_set_index, error_string)) { - last_bound->boundDescriptorSets.resize(last_set_index + 1); + if (!descriptor_set->IsPushDescriptor()) { + // Can't cache validation of push_descriptors + cb_state->validated_descriptor_sets.insert(descriptor_set); } } } } +// Update the bound state for the bind point, including the effects of incompatible pipeline layouts +static void PreCallRecordCmdBindDescriptorSets(layer_data *device_data, GLOBAL_CB_NODE *cb_state, + VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, + uint32_t setCount, const VkDescriptorSet *pDescriptorSets, + uint32_t dynamicOffsetCount, const uint32_t *pDynamicOffsets) { + auto pipeline_layout = getPipelineLayout(device_data, layout); + std::vector descriptor_sets; + descriptor_sets.reserve(setCount); + + // Construct a list of the descriptors + bool found_non_null = false; + for (uint32_t i = 0; i < setCount; i++) { + cvdescriptorset::DescriptorSet *descriptor_set = GetSetNode(device_data, pDescriptorSets[i]); + descriptor_sets.emplace_back(descriptor_set); + found_non_null |= descriptor_set != nullptr; + } + if (found_non_null) { // which implies setCount > 0 + UpdateLastBoundDescriptorSets(device_data, cb_state, pipelineBindPoint, pipeline_layout, firstSet, setCount, + descriptor_sets, dynamicOffsetCount, pDynamicOffsets); + cb_state->lastBound[pipelineBindPoint].pipeline_layout = layout; + } +} + static bool PreCallValidateCmdBindDescriptorSets(layer_data *device_data, GLOBAL_CB_NODE *cb_state, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet *pDescriptorSets, @@ -5566,28 +6476,27 @@ if (last_set_index >= cb_state->lastBound[pipelineBindPoint].boundDescriptorSets.size()) { cb_state->lastBound[pipelineBindPoint].boundDescriptorSets.resize(last_set_index + 1); cb_state->lastBound[pipelineBindPoint].dynamicOffsets.resize(last_set_index + 1); + cb_state->lastBound[pipelineBindPoint].compat_id_for_set.resize(last_set_index + 1); } auto pipeline_layout = getPipelineLayout(device_data, layout); for (uint32_t set_idx = 0; set_idx < setCount; set_idx++) { cvdescriptorset::DescriptorSet *descriptor_set = GetSetNode(device_data, pDescriptorSets[set_idx]); if (descriptor_set) { if (!descriptor_set->IsUpdated() && (descriptor_set->GetTotalDescriptorCount() != 0)) { - skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, HandleToUint64(pDescriptorSets[set_idx]), __LINE__, - DRAWSTATE_DESCRIPTOR_SET_NOT_UPDATED, "DS", - "Descriptor Set 0x%" PRIxLEAST64 - " bound but it was never updated. You may want to either update it or not bind it.", - HandleToUint64(pDescriptorSets[set_idx])); + skip |= log_msg( + device_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, + HandleToUint64(pDescriptorSets[set_idx]), DRAWSTATE_DESCRIPTOR_SET_NOT_UPDATED, + "Descriptor Set 0x%" PRIx64 " bound but it was never updated. You may want to either update it or not bind it.", + HandleToUint64(pDescriptorSets[set_idx])); } // Verify that set being bound is compatible with overlapping setLayout of pipelineLayout if (!verify_set_layout_compatibility(descriptor_set, pipeline_layout, set_idx + firstSet, error_string)) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, - HandleToUint64(pDescriptorSets[set_idx]), __LINE__, VALIDATION_ERROR_17c002cc, "DS", - "descriptorSet #%u being bound is not compatible with overlapping descriptorSetLayout " - "at index %u of pipelineLayout 0x%" PRIxLEAST64 " due to: %s. %s", - set_idx, set_idx + firstSet, HandleToUint64(layout), error_string.c_str(), - validation_error_map[VALIDATION_ERROR_17c002cc]); + HandleToUint64(pDescriptorSets[set_idx]), VALIDATION_ERROR_17c002cc, + "descriptorSet #%u being bound is not compatible with overlapping descriptorSetLayout at index %u of " + "pipelineLayout 0x%" PRIx64 " due to: %s.", + set_idx, set_idx + firstSet, HandleToUint64(layout), error_string.c_str()); } auto set_dynamic_descriptor_count = descriptor_set->GetDynamicDescriptorCount(); @@ -5597,10 +6506,10 @@ if ((total_dynamic_descriptors + set_dynamic_descriptor_count) > dynamicOffsetCount) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, HandleToUint64(pDescriptorSets[set_idx]), - __LINE__, DRAWSTATE_INVALID_DYNAMIC_OFFSET_COUNT, "DS", - "descriptorSet #%u (0x%" PRIxLEAST64 - ") requires %u dynamicOffsets, but only %u dynamicOffsets are left in pDynamicOffsets " - "array. There must be one dynamic offset for each dynamic descriptor being bound.", + DRAWSTATE_INVALID_DYNAMIC_OFFSET_COUNT, + "descriptorSet #%u (0x%" PRIx64 + ") requires %u dynamicOffsets, but only %u dynamicOffsets are left in pDynamicOffsets array. " + "There must be one dynamic offset for each dynamic descriptor being bound.", set_idx, HandleToUint64(pDescriptorSets[set_idx]), descriptor_set->GetDynamicDescriptorCount(), (dynamicOffsetCount - total_dynamic_descriptors)); } else { // Validate dynamic offsets and Dynamic Offset Minimums @@ -5611,13 +6520,11 @@ device_data->phys_dev_properties.properties.limits.minUniformBufferOffsetAlignment) != 0) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, - VALIDATION_ERROR_17c002d4, "DS", + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, VALIDATION_ERROR_17c002d4, "vkCmdBindDescriptorSets(): pDynamicOffsets[%d] is %d but must be a multiple of " - "device limit minUniformBufferOffsetAlignment 0x%" PRIxLEAST64 ". %s", + "device limit minUniformBufferOffsetAlignment 0x%" PRIxLEAST64 ".", cur_dyn_offset, pDynamicOffsets[cur_dyn_offset], - device_data->phys_dev_properties.properties.limits.minUniformBufferOffsetAlignment, - validation_error_map[VALIDATION_ERROR_17c002d4]); + device_data->phys_dev_properties.properties.limits.minUniformBufferOffsetAlignment); } cur_dyn_offset++; } else if (descriptor_set->GetTypeFromGlobalIndex(d) == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC) { @@ -5625,13 +6532,11 @@ device_data->phys_dev_properties.properties.limits.minStorageBufferOffsetAlignment) != 0) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, - VALIDATION_ERROR_17c002d4, "DS", + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, VALIDATION_ERROR_17c002d4, "vkCmdBindDescriptorSets(): pDynamicOffsets[%d] is %d but must be a multiple of " - "device limit minStorageBufferOffsetAlignment 0x%" PRIxLEAST64 ". %s", + "device limit minStorageBufferOffsetAlignment 0x%" PRIxLEAST64 ".", cur_dyn_offset, pDynamicOffsets[cur_dyn_offset], - device_data->phys_dev_properties.properties.limits.minStorageBufferOffsetAlignment, - validation_error_map[VALIDATION_ERROR_17c002d4]); + device_data->phys_dev_properties.properties.limits.minStorageBufferOffsetAlignment); } cur_dyn_offset++; } @@ -5642,18 +6547,18 @@ } } else { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, - HandleToUint64(pDescriptorSets[set_idx]), __LINE__, DRAWSTATE_INVALID_SET, "DS", - "Attempt to bind descriptor set 0x%" PRIxLEAST64 " that doesn't exist!", + HandleToUint64(pDescriptorSets[set_idx]), DRAWSTATE_INVALID_SET, + "Attempt to bind descriptor set 0x%" PRIx64 " that doesn't exist!", HandleToUint64(pDescriptorSets[set_idx])); } } // dynamicOffsetCount must equal the total number of dynamic descriptors in the sets being bound if (total_dynamic_descriptors != dynamicOffsetCount) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_state->commandBuffer), __LINE__, VALIDATION_ERROR_17c002ce, "DS", - "Attempting to bind %u descriptorSets with %u dynamic descriptors, but dynamicOffsetCount " - "is %u. It should exactly match the number of dynamic descriptors. %s", - setCount, total_dynamic_descriptors, dynamicOffsetCount, validation_error_map[VALIDATION_ERROR_17c002ce]); + HandleToUint64(cb_state->commandBuffer), VALIDATION_ERROR_17c002ce, + "Attempting to bind %u descriptorSets with %u dynamic descriptors, but dynamicOffsetCount is %u. It should " + "exactly match the number of dynamic descriptors.", + setCount, total_dynamic_descriptors, dynamicOffsetCount); } return skip; } @@ -5677,24 +6582,83 @@ pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); } else { lock.unlock(); + } +} +// Validates that the supplied bind point is supported for the command buffer (vis. the command pool) +// Takes array of error codes as some of the VUID's (e.g. vkCmdBindPipeline) are written per bindpoint +// TODO add vkCmdBindPipeline bind_point validation using this call. +bool ValidatePipelineBindPoint(layer_data *device_data, GLOBAL_CB_NODE *cb_state, VkPipelineBindPoint bind_point, + const char *func_name, + const std::array &bind_errors) { + bool skip = false; + auto pool = GetCommandPoolNode(device_data, cb_state->createInfo.commandPool); + if (pool) { // The loss of a pool in a recording cmd is reported in DestroyCommandPool + static const VkQueueFlags flag_mask[VK_PIPELINE_BIND_POINT_RANGE_SIZE] = {VK_QUEUE_GRAPHICS_BIT, VK_QUEUE_COMPUTE_BIT}; + const auto bind_point_index = bind_point - VK_PIPELINE_BIND_POINT_BEGIN_RANGE; // typeof enum is not defined, use auto + const auto &qfp = GetPhysDevProperties(device_data)->queue_family_properties[pool->queueFamilyIndex]; + if (0 == (qfp.queueFlags & flag_mask[bind_point_index])) { + const UNIQUE_VALIDATION_ERROR_CODE error = bind_errors[bind_point_index]; + auto cb_u64 = HandleToUint64(cb_state->commandBuffer); + auto cp_u64 = HandleToUint64(cb_state->createInfo.commandPool); + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + cb_u64, error, + "%s: CommandBuffer 0x%" PRIxLEAST64 " was allocated from VkCommandPool 0x%" PRIxLEAST64 + " that does not support bindpoint %s.", + func_name, cb_u64, cp_u64, string_VkPipelineBindPoint(bind_point)); + } } + return skip; } -static void PreCallRecordCmdPushDescriptorSetKHR(layer_data *device_data, VkCommandBuffer commandBuffer, +static bool PreCallValidateCmdPushDescriptorSetKHR(layer_data *device_data, GLOBAL_CB_NODE *cb_state, + const VkPipelineBindPoint bind_point, const VkPipelineLayout layout, + const uint32_t set, const uint32_t descriptor_write_count, + const VkWriteDescriptorSet *descriptor_writes, const char *func_name) { + bool skip = false; + skip |= ValidateCmd(device_data, cb_state, CMD_PUSHDESCRIPTORSETKHR, func_name); + skip |= ValidateCmdQueueFlags(device_data, cb_state, func_name, (VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT), + VALIDATION_ERROR_1be02415); + skip |= ValidatePipelineBindPoint(device_data, cb_state, bind_point, func_name, + {{VALIDATION_ERROR_1be002d6, VALIDATION_ERROR_1be002d6}}); + auto layout_data = getPipelineLayout(device_data, layout); + + // Validate the set index points to a push descriptor set and is in range + if (layout_data) { + const auto &set_layouts = layout_data->set_layouts; + const auto layout_u64 = HandleToUint64(layout); + if (set < set_layouts.size()) { + const auto *dsl = set_layouts[set].get(); + if (dsl && (0 == (dsl->GetCreateFlags() & VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR))) { + skip = log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT, layout_u64, VALIDATION_ERROR_1be002da, + "%s: Set index %" PRIu32 + " does not match push descriptor set layout index for VkPipelineLayout 0x%" PRIxLEAST64 ".", + func_name, set, layout_u64); + } + } else { + skip = log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT, + layout_u64, VALIDATION_ERROR_1be002d8, + "%s: Set index %" PRIu32 " is outside of range for VkPipelineLayout 0x%" PRIxLEAST64 " (set < %" PRIu32 + ").", + func_name, set, layout_u64, static_cast(set_layouts.size())); + } + } + + return skip; +} +static void PreCallRecordCmdPushDescriptorSetKHR(layer_data *device_data, GLOBAL_CB_NODE *cb_state, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites) { - auto cb_state = GetCBNode(device_data, commandBuffer); - - if (set >= cb_state->lastBound[pipelineBindPoint].boundDescriptorSets.size()) { - cb_state->lastBound[pipelineBindPoint].boundDescriptorSets.resize(set + 1); - cb_state->lastBound[pipelineBindPoint].dynamicOffsets.resize(set + 1); - } - const auto &layout_state = getPipelineLayout(device_data, layout); + const auto &pipeline_layout = getPipelineLayout(device_data, layout); + if (!pipeline_layout) return; std::unique_ptr new_desc{ - new cvdescriptorset::DescriptorSet(0, 0, layout_state->set_layouts[set], device_data)}; - cb_state->lastBound[pipelineBindPoint].boundDescriptorSets[set] = new_desc.get(); + new cvdescriptorset::DescriptorSet(0, 0, pipeline_layout->set_layouts[set], 0, device_data)}; + + std::vector descriptor_sets = {new_desc.get()}; + UpdateLastBoundDescriptorSets(device_data, cb_state, pipelineBindPoint, pipeline_layout, set, 1, descriptor_sets, 0, nullptr); cb_state->lastBound[pipelineBindPoint].push_descriptor_set = std::move(new_desc); + cb_state->lastBound[pipelineBindPoint].pipeline_layout = layout; } VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, @@ -5702,11 +6666,16 @@ const VkWriteDescriptorSet *pDescriptorWrites) { layer_data *device_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); unique_lock_t lock(global_lock); - PreCallRecordCmdPushDescriptorSetKHR(device_data, commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, - pDescriptorWrites); - lock.unlock(); - device_data->dispatch_table.CmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, - pDescriptorWrites); + auto cb_state = GetCBNode(device_data, commandBuffer); + bool skip = PreCallValidateCmdPushDescriptorSetKHR(device_data, cb_state, pipelineBindPoint, layout, set, descriptorWriteCount, + pDescriptorWrites, "vkCmdPushDescriptorSetKHR()"); + if (!skip) { + PreCallRecordCmdPushDescriptorSetKHR(device_data, cb_state, pipelineBindPoint, layout, set, descriptorWriteCount, + pDescriptorWrites); + lock.unlock(); + device_data->dispatch_table.CmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, + pDescriptorWrites); + } } static VkDeviceSize GetIndexAlignment(VkIndexType indexType) { @@ -5733,22 +6702,20 @@ assert(cb_node); assert(buffer_state); - skip |= ValidateBufferUsageFlags(dev_data, buffer_state, VK_BUFFER_USAGE_INDEX_BUFFER_BIT, true, - VALIDATION_ERROR_17e00362, "vkCmdBindIndexBuffer()", "VK_BUFFER_USAGE_INDEX_BUFFER_BIT"); + skip |= ValidateBufferUsageFlags(dev_data, buffer_state, VK_BUFFER_USAGE_INDEX_BUFFER_BIT, true, VALIDATION_ERROR_17e00362, + "vkCmdBindIndexBuffer()", "VK_BUFFER_USAGE_INDEX_BUFFER_BIT"); skip |= ValidateCmdQueueFlags(dev_data, cb_node, "vkCmdBindIndexBuffer()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_17e02415); skip |= ValidateCmd(dev_data, cb_node, CMD_BINDINDEXBUFFER, "vkCmdBindIndexBuffer()"); skip |= ValidateMemoryIsBoundToBuffer(dev_data, buffer_state, "vkCmdBindIndexBuffer()", VALIDATION_ERROR_17e00364); auto offset_align = GetIndexAlignment(indexType); if (offset % offset_align) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_17e00360, "DS", - "vkCmdBindIndexBuffer() offset (0x%" PRIxLEAST64 ") does not fall on alignment (%s) boundary. %s", offset, - string_VkIndexType(indexType), - validation_error_map[VALIDATION_ERROR_17e00360]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_17e00360, + "vkCmdBindIndexBuffer() offset (0x%" PRIxLEAST64 ") does not fall on alignment (%s) boundary.", offset, + string_VkIndexType(indexType)); } - if (skip) - return; + if (skip) return; std::function function = [=]() { return ValidateBufferMemoryIsValid(dev_data, buffer_state, "vkCmdBindIndexBuffer()"); @@ -5782,23 +6749,21 @@ assert(cb_node); skip |= ValidateCmdQueueFlags(dev_data, cb_node, "vkCmdBindVertexBuffers()", VK_QUEUE_GRAPHICS_BIT, VALIDATION_ERROR_18202415); - skip |= ValidateCmd(dev_data, cb_node, CMD_BINDVERTEXBUFFER, "vkCmdBindVertexBuffers()"); + skip |= ValidateCmd(dev_data, cb_node, CMD_BINDVERTEXBUFFERS, "vkCmdBindVertexBuffers()"); for (uint32_t i = 0; i < bindingCount; ++i) { auto buffer_state = GetBufferState(dev_data, pBuffers[i]); assert(buffer_state); - skip |= ValidateBufferUsageFlags(dev_data, buffer_state, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, true, - VALIDATION_ERROR_182004e6, "vkCmdBindVertexBuffers()", "VK_BUFFER_USAGE_VERTEX_BUFFER_BIT"); + skip |= ValidateBufferUsageFlags(dev_data, buffer_state, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, true, VALIDATION_ERROR_182004e6, + "vkCmdBindVertexBuffers()", "VK_BUFFER_USAGE_VERTEX_BUFFER_BIT"); skip |= ValidateMemoryIsBoundToBuffer(dev_data, buffer_state, "vkCmdBindVertexBuffers()", VALIDATION_ERROR_182004e8); if (pOffsets[i] >= buffer_state->createInfo.size) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, - HandleToUint64(buffer_state->buffer), __LINE__, VALIDATION_ERROR_182004e4, "DS", - "vkCmdBindVertexBuffers() offset (0x%" PRIxLEAST64 ") is beyond the end of the buffer. %s", - pOffsets[i], validation_error_map[VALIDATION_ERROR_182004e4]); + HandleToUint64(buffer_state->buffer), VALIDATION_ERROR_182004e4, + "vkCmdBindVertexBuffers() offset (0x%" PRIxLEAST64 ") is beyond the end of the buffer.", pOffsets[i]); } } - if (skip) - return; + if (skip) return; for (uint32_t i = 0; i < bindingCount; ++i) { auto buffer_state = GetBufferState(dev_data, pBuffers[i]); @@ -6106,10 +7071,10 @@ bool skip = false; if (image_state->createInfo.samples != sample_count) { skip = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(image_state->image), 0, msgCode, "DS", - "%s for image 0x%" PRIxLEAST64 " was created with a sample count of %s but must be %s. %s", location, + HandleToUint64(image_state->image), msgCode, + "%s for image 0x%" PRIx64 " was created with a sample count of %s but must be %s.", location, HandleToUint64(image_state->image), string_VkSampleCountFlagBits(image_state->createInfo.samples), - string_VkSampleCountFlagBits(sample_count), validation_error_map[msgCode]); + string_VkSampleCountFlagBits(sample_count)); } return skip; } @@ -6124,10 +7089,12 @@ auto src_image_state = GetImageState(dev_data, srcImage); auto dst_image_state = GetImageState(dev_data, dstImage); - bool skip = PreCallValidateCmdBlitImage(dev_data, cb_node, src_image_state, dst_image_state, regionCount, pRegions, filter); + bool skip = PreCallValidateCmdBlitImage(dev_data, cb_node, src_image_state, dst_image_state, regionCount, pRegions, + srcImageLayout, dstImageLayout, filter); if (!skip) { - PreCallRecordCmdBlitImage(dev_data, cb_node, src_image_state, dst_image_state); + PreCallRecordCmdBlitImage(dev_data, cb_node, src_image_state, dst_image_state, regionCount, pRegions, srcImageLayout, + dstImageLayout); lock.unlock(); dev_data->dispatch_table.CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter); @@ -6145,7 +7112,7 @@ auto dst_image_state = GetImageState(device_data, dstImage); if (cb_node && src_buffer_state && dst_image_state) { skip = PreCallValidateCmdCopyBufferToImage(device_data, dstImageLayout, cb_node, src_buffer_state, dst_image_state, - regionCount, pRegions, "vkCmdCopyBufferToImage()"); + regionCount, pRegions, "vkCmdCopyBufferToImage()"); } else { lock.unlock(); assert(0); @@ -6170,7 +7137,7 @@ auto dst_buffer_state = GetBufferState(device_data, dstBuffer); if (cb_node && src_image_state && dst_buffer_state) { skip = PreCallValidateCmdCopyImageToBuffer(device_data, srcImageLayout, cb_node, src_image_state, dst_buffer_state, - regionCount, pRegions, "vkCmdCopyImageToBuffer()"); + regionCount, pRegions, "vkCmdCopyImageToBuffer()"); } else { lock.unlock(); assert(0); @@ -6310,9 +7277,11 @@ VKAPI_ATTR void VKAPI_CALL GetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource *pSubresource, VkSubresourceLayout *pLayout) { layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + unique_lock_t lock(global_lock); bool skip = PreCallValidateGetImageSubresourceLayout(device_data, image, pSubresource); if (!skip) { + lock.unlock(); device_data->dispatch_table.GetImageSubresourceLayout(device, image, pSubresource, pLayout); } } @@ -6351,7 +7320,7 @@ if (!pCB->waitedEvents.count(event)) { pCB->writeEventsBeforeWait.push_back(event); } - pCB->eventUpdates.emplace_back([=](VkQueue q){return setEventStageMask(q, commandBuffer, event, stageMask);}); + pCB->eventUpdates.emplace_back([=](VkQueue q) { return setEventStageMask(q, commandBuffer, event, stageMask); }); } lock.unlock(); if (!skip) dev_data->dispatch_table.CmdSetEvent(commandBuffer, event, stageMask); @@ -6379,7 +7348,8 @@ pCB->writeEventsBeforeWait.push_back(event); } // TODO : Add check for VALIDATION_ERROR_32c008f8 - pCB->eventUpdates.emplace_back([=](VkQueue q){return setEventStageMask(q, commandBuffer, event, VkPipelineStageFlags(0));}); + pCB->eventUpdates.emplace_back( + [=](VkQueue q) { return setEventStageMask(q, commandBuffer, event, VkPipelineStageFlags(0)); }); } lock.unlock(); if (!skip) dev_data->dispatch_table.CmdResetEvent(commandBuffer, event, stageMask); @@ -6439,39 +7409,35 @@ if (!sub_image_found) { skip |= log_msg( device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, rp_handle, - __LINE__, VALIDATION_ERROR_1b800936, "CORE", + VALIDATION_ERROR_1b800936, "%s: Barrier pImageMemoryBarriers[%d].image (0x%" PRIx64 - ") is not referenced by the VkSubpassDescription for active subpass (%d) of current renderPass (0x%" PRIx64 "). %s", - funcName, img_index, HandleToUint64(img_bar_image), active_subpass, rp_handle, - validation_error_map[VALIDATION_ERROR_1b800936]); + ") is not referenced by the VkSubpassDescription for active subpass (%d) of current renderPass (0x%" PRIx64 ").", + funcName, img_index, HandleToUint64(img_bar_image), active_subpass, rp_handle); } } else { // !image_match auto const fb_handle = HandleToUint64(fb_state->framebuffer); - skip |= - log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT, fb_handle, - __LINE__, VALIDATION_ERROR_1b800936, "CORE", - "%s: Barrier pImageMemoryBarriers[%d].image (0x%" PRIx64 - ") does not match an image from the current framebuffer (0x%" PRIx64 "). %s", - funcName, img_index, HandleToUint64(img_bar_image), fb_handle, validation_error_map[VALIDATION_ERROR_1b800936]); + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT, + fb_handle, VALIDATION_ERROR_1b800936, + "%s: Barrier pImageMemoryBarriers[%d].image (0x%" PRIx64 + ") does not match an image from the current framebuffer (0x%" PRIx64 ").", + funcName, img_index, HandleToUint64(img_bar_image), fb_handle); } if (img_barrier.oldLayout != img_barrier.newLayout) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_state->commandBuffer), __LINE__, VALIDATION_ERROR_1b80093a, "CORE", + HandleToUint64(cb_state->commandBuffer), VALIDATION_ERROR_1b80093a, "%s: As the Image Barrier for image 0x%" PRIx64 - " is being executed within a render pass instance, oldLayout must equal newLayout yet they are " - "%s and %s. %s", + " is being executed within a render pass instance, oldLayout must equal newLayout yet they are %s and %s.", funcName, HandleToUint64(img_barrier.image), string_VkImageLayout(img_barrier.oldLayout), - string_VkImageLayout(img_barrier.newLayout), validation_error_map[VALIDATION_ERROR_1b80093a]); + string_VkImageLayout(img_barrier.newLayout)); } else { if (sub_image_found && sub_image_layout != img_barrier.oldLayout) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, - rp_handle, __LINE__, VALIDATION_ERROR_1b800938, "CORE", + rp_handle, VALIDATION_ERROR_1b800938, "%s: Barrier pImageMemoryBarriers[%d].image (0x%" PRIx64 ") is referenced by the VkSubpassDescription for active subpass (%d) of current renderPass (0x%" PRIx64 - ") as having layout %s, but image barrier has layout %s. %s", + ") as having layout %s, but image barrier has layout %s.", funcName, img_index, HandleToUint64(img_bar_image), active_subpass, rp_handle, - string_VkImageLayout(img_barrier.oldLayout), string_VkImageLayout(sub_image_layout), - validation_error_map[VALIDATION_ERROR_1b800938]); + string_VkImageLayout(img_barrier.oldLayout), string_VkImageLayout(sub_image_layout)); } } return skip; @@ -6488,37 +7454,32 @@ const auto &img_src_access_mask = img_barrier.srcAccessMask; if (img_src_access_mask != (sub_src_access_mask & img_src_access_mask)) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, - rp_handle, __LINE__, VALIDATION_ERROR_1b80092e, "CORE", + rp_handle, VALIDATION_ERROR_1b80092e, "%s: Barrier pImageMemoryBarriers[%d].srcAccessMask(0x%X) is not a subset of VkSubpassDependency " - "srcAccessMask(0x%X) of " - "subpass %d of renderPass 0x%" PRIx64 ". %s", - funcName, i, img_src_access_mask, sub_src_access_mask, active_subpass, rp_handle, - validation_error_map[VALIDATION_ERROR_1b80092e]); + "srcAccessMask(0x%X) of subpass %d of renderPass 0x%" PRIx64 ".", + funcName, i, img_src_access_mask, sub_src_access_mask, active_subpass, rp_handle); } const auto &img_dst_access_mask = img_barrier.dstAccessMask; if (img_dst_access_mask != (sub_dst_access_mask & img_dst_access_mask)) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, - rp_handle, __LINE__, VALIDATION_ERROR_1b800930, "CORE", + rp_handle, VALIDATION_ERROR_1b800930, "%s: Barrier pImageMemoryBarriers[%d].dstAccessMask(0x%X) is not a subset of VkSubpassDependency " - "dstAccessMask(0x%X) of " - "subpass %d of renderPass 0x%" PRIx64 ". %s", - funcName, i, img_dst_access_mask, sub_dst_access_mask, active_subpass, rp_handle, - validation_error_map[VALIDATION_ERROR_1b800930]); + "dstAccessMask(0x%X) of subpass %d of renderPass 0x%" PRIx64 ".", + funcName, i, img_dst_access_mask, sub_dst_access_mask, active_subpass, rp_handle); } if (VK_QUEUE_FAMILY_IGNORED != img_barrier.srcQueueFamilyIndex || VK_QUEUE_FAMILY_IGNORED != img_barrier.dstQueueFamilyIndex) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, - rp_handle, __LINE__, VALIDATION_ERROR_1b80093c, "CORE", + rp_handle, VALIDATION_ERROR_1b80093c, "%s: Barrier pImageMemoryBarriers[%d].srcQueueFamilyIndex is %d and " - "pImageMemoryBarriers[%d].dstQueueFamilyIndex is %d but both must be VK_QUEUE_FAMILY_IGNORED. %s", - funcName, i, img_barrier.srcQueueFamilyIndex, i, img_barrier.dstQueueFamilyIndex, - validation_error_map[VALIDATION_ERROR_1b80093c]); + "pImageMemoryBarriers[%d].dstQueueFamilyIndex is %d but both must be VK_QUEUE_FAMILY_IGNORED.", + funcName, i, img_barrier.srcQueueFamilyIndex, i, img_barrier.dstQueueFamilyIndex); } // Secondary CBs can have null framebuffer so queue up validation in that case 'til FB is known if (VK_NULL_HANDLE == cb_state->activeFramebuffer) { assert(VK_COMMAND_BUFFER_LEVEL_SECONDARY == cb_state->createInfo.level); // Secondary CB case w/o FB specified delay validation - cb_state->cmd_execute_commands_functions.emplace_back([=](VkFramebuffer fb) { + cb_state->cmd_execute_commands_functions.emplace_back([=](GLOBAL_CB_NODE *primary_cb, VkFramebuffer fb) { return ValidateImageBarrierImage(device_data, funcName, cb_state, fb, active_subpass, sub_desc, rp_handle, i, img_barrier); }); @@ -6543,11 +7504,11 @@ const auto active_subpass = cb_state->activeSubpass; auto rp_handle = HandleToUint64(rp_state->renderPass); if (!rp_state->hasSelfDependency[active_subpass]) { - skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, - rp_handle, __LINE__, VALIDATION_ERROR_1b800928, "CORE", - "%s: Barriers cannot be set during subpass %d of renderPass 0x%" PRIx64 - " with no self-dependency specified. %s", - funcName, active_subpass, rp_handle, validation_error_map[VALIDATION_ERROR_1b800928]); + skip |= + log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, rp_handle, + VALIDATION_ERROR_1b800928, + "%s: Barriers cannot be set during subpass %d of renderPass 0x%" PRIx64 " with no self-dependency specified.", + funcName, active_subpass, rp_handle); } else { assert(rp_state->subpass_to_dependency_index[cb_state->activeSubpass] != -1); // Grab ref to current subpassDescription up-front for use below @@ -6558,28 +7519,24 @@ if ((sub_src_stage_mask != VK_PIPELINE_STAGE_ALL_COMMANDS_BIT) && (src_stage_mask != (sub_src_stage_mask & src_stage_mask))) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, - rp_handle, __LINE__, VALIDATION_ERROR_1b80092a, "CORE", - "%s: Barrier srcStageMask(0x%X) is not a subset of VkSubpassDependency srcStageMask(0x%X) of " - "subpass %d of renderPass 0x%" PRIx64 ". %s", - funcName, src_stage_mask, sub_src_stage_mask, active_subpass, rp_handle, - validation_error_map[VALIDATION_ERROR_1b80092a]); + rp_handle, VALIDATION_ERROR_1b80092a, + "%s: Barrier srcStageMask(0x%X) is not a subset of VkSubpassDependency srcStageMask(0x%X) of subpass " + "%d of renderPass 0x%" PRIx64 ".", + funcName, src_stage_mask, sub_src_stage_mask, active_subpass, rp_handle); } if ((sub_dst_stage_mask != VK_PIPELINE_STAGE_ALL_COMMANDS_BIT) && (dst_stage_mask != (sub_dst_stage_mask & dst_stage_mask))) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, - rp_handle, __LINE__, VALIDATION_ERROR_1b80092c, "CORE", - "%s: Barrier dstStageMask(0x%X) is not a subset of VkSubpassDependency dstStageMask(0x%X) of " - "subpass %d of renderPass 0x%" PRIx64 ". %s", - funcName, dst_stage_mask, sub_dst_stage_mask, active_subpass, rp_handle, - validation_error_map[VALIDATION_ERROR_1b80092c]); + rp_handle, VALIDATION_ERROR_1b80092c, + "%s: Barrier dstStageMask(0x%X) is not a subset of VkSubpassDependency dstStageMask(0x%X) of subpass " + "%d of renderPass 0x%" PRIx64 ".", + funcName, dst_stage_mask, sub_dst_stage_mask, active_subpass, rp_handle); } if (0 != buffer_mem_barrier_count) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, - rp_handle, __LINE__, VALIDATION_ERROR_1b800934, "CORE", - "%s: bufferMemoryBarrierCount is non-zero (%d) for " - "subpass %d of renderPass 0x%" PRIx64 ". %s", - funcName, buffer_mem_barrier_count, active_subpass, rp_handle, - validation_error_map[VALIDATION_ERROR_1b800934]); + rp_handle, VALIDATION_ERROR_1b800934, + "%s: bufferMemoryBarrierCount is non-zero (%d) for subpass %d of renderPass 0x%" PRIx64 ".", funcName, + buffer_mem_barrier_count, active_subpass, rp_handle); } const auto &sub_src_access_mask = sub_dep.srcAccessMask; const auto &sub_dst_access_mask = sub_dep.dstAccessMask; @@ -6587,34 +7544,28 @@ const auto &mb_src_access_mask = mem_barriers[i].srcAccessMask; if (mb_src_access_mask != (sub_src_access_mask & mb_src_access_mask)) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, rp_handle, __LINE__, VALIDATION_ERROR_1b80092e, "CORE", + VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, rp_handle, VALIDATION_ERROR_1b80092e, "%s: Barrier pMemoryBarriers[%d].srcAccessMask(0x%X) is not a subset of VkSubpassDependency " - "srcAccessMask(0x%X) of " - "subpass %d of renderPass 0x%" PRIx64 ". %s", - funcName, i, mb_src_access_mask, sub_src_access_mask, active_subpass, rp_handle, - validation_error_map[VALIDATION_ERROR_1b80092e]); + "srcAccessMask(0x%X) of subpass %d of renderPass 0x%" PRIx64 ".", + funcName, i, mb_src_access_mask, sub_src_access_mask, active_subpass, rp_handle); } const auto &mb_dst_access_mask = mem_barriers[i].dstAccessMask; if (mb_dst_access_mask != (sub_dst_access_mask & mb_dst_access_mask)) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, rp_handle, __LINE__, VALIDATION_ERROR_1b800930, "CORE", + VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, rp_handle, VALIDATION_ERROR_1b800930, "%s: Barrier pMemoryBarriers[%d].dstAccessMask(0x%X) is not a subset of VkSubpassDependency " - "dstAccessMask(0x%X) of " - "subpass %d of renderPass 0x%" PRIx64 ". %s", - funcName, i, mb_dst_access_mask, sub_dst_access_mask, active_subpass, rp_handle, - validation_error_map[VALIDATION_ERROR_1b800930]); + "dstAccessMask(0x%X) of subpass %d of renderPass 0x%" PRIx64 ".", + funcName, i, mb_dst_access_mask, sub_dst_access_mask, active_subpass, rp_handle); } } skip |= ValidateRenderPassImageBarriers(device_data, funcName, cb_state, active_subpass, sub_desc, rp_handle, sub_src_access_mask, sub_dst_access_mask, image_mem_barrier_count, image_barriers); if (sub_dep.dependencyFlags != dependency_flags) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, - rp_handle, __LINE__, VALIDATION_ERROR_1b800932, "CORE", - "%s: dependencyFlags param (0x%X) does not equal VkSubpassDependency " - "dependencyFlags value (0x%X) for " - "subpass %d of renderPass 0x%" PRIx64 ". %s", - funcName, dependency_flags, sub_dep.dependencyFlags, cb_state->activeSubpass, rp_handle, - validation_error_map[VALIDATION_ERROR_1b800932]); + rp_handle, VALIDATION_ERROR_1b800932, + "%s: dependencyFlags param (0x%X) does not equal VkSubpassDependency dependencyFlags value (0x%X) for " + "subpass %d of renderPass 0x%" PRIx64 ".", + funcName, dependency_flags, sub_dep.dependencyFlags, cb_state->activeSubpass, rp_handle); } } return skip; @@ -6687,7 +7638,254 @@ return true; } -static bool ValidateBarriers(layer_data *device_data, const char *funcName, GLOBAL_CB_NODE const *cb_state, +namespace barrier_queue_families { +enum VuIndex { + kSrcOrDstMustBeIgnore, + kSpecialOrIgnoreOnly, + kSrcIgnoreRequiresDstIgnore, + kDstValidOrSpecialIfNotIgnore, + kSrcValidOrSpecialIfNotIgnore, + kSrcAndDestMustBeIgnore, + kBothIgnoreOrBothValid, + kSubmitQueueMustMatchSrcOrDst +}; +static const char *vu_summary[] = {"Source or destination queue family must be ignored.", + "Source or destination queue family must be special or ignored.", + "Destination queue family must be ignored if source queue family is.", + "Destination queue family must be valid, ignored, or special.", + "Source queue family must be valid, ignored, or special.", + "Source and destination queue family must both be ignored.", + "Source and destination queue family must both be ignore or both valid.", + "Source or destination queue family must match submit queue family, if not ignored."}; + +static const UNIQUE_VALIDATION_ERROR_CODE image_error_codes[] = { + VALIDATION_ERROR_0a000aca, // VUID-VkImageMemoryBarrier-image-01381 -- kSrcOrDstMustBeIgnore + VALIDATION_ERROR_0a000dcc, // VUID-VkImageMemoryBarrier-image-01766 -- kSpecialOrIgnoreOnly + VALIDATION_ERROR_0a000962, // VUID-VkImageMemoryBarrier-image-01201 -- kSrcIgnoreRequiresDstIgnore + VALIDATION_ERROR_0a000dd0, // VUID-VkImageMemoryBarrier-image-01768 -- kDstValidOrSpecialIfNotIgnore + VALIDATION_ERROR_0a000dce, // VUID-VkImageMemoryBarrier-image-01767 -- kSrcValidOrSpecialIfNotIgnore + VALIDATION_ERROR_0a00095e, // VUID-VkImageMemoryBarrier-image-01199 -- kSrcAndDestMustBeIgnore + VALIDATION_ERROR_0a000960, // VUID-VkImageMemoryBarrier-image-01200 -- kBothIgnoreOrBothValid + VALIDATION_ERROR_0a00096a, // VUID-VkImageMemoryBarrier-image-01205 -- kSubmitQueueMustMatchSrcOrDst +}; + +static const UNIQUE_VALIDATION_ERROR_CODE buffer_error_codes[] = { + VALIDATION_ERROR_0180094e, // VUID-VkBufferMemoryBarrier-buffer-01191 -- kSrcOrDstMustBeIgnore + VALIDATION_ERROR_01800dc6, // VUID-VkBufferMemoryBarrier-buffer-01763 -- kSpecialOrIgnoreOnly + VALIDATION_ERROR_01800952, // VUID-VkBufferMemoryBarrier-buffer-01193 -- kSrcIgnoreRequiresDstIgnore + VALIDATION_ERROR_01800dca, // VUID-VkBufferMemoryBarrier-buffer-01765 -- kDstValidOrSpecialIfNotIgnore + VALIDATION_ERROR_01800dc8, // VUID-VkBufferMemoryBarrier-buffer-01764 -- kSrcValidOrSpecialIfNotIgnore + VALIDATION_ERROR_0180094c, // VUID-VkBufferMemoryBarrier-buffer-01190 -- kSrcAndDestMustBeIgnore + VALIDATION_ERROR_01800950, // VUID-VkBufferMemoryBarrier-buffer-01192 -- kBothIgnoreOrBothValid + VALIDATION_ERROR_01800958, // VUID-VkBufferMemoryBarrier-buffer-01196 -- kSubmitQueueMustMatchSrcOrDst +}; + +class ValidatorState { + public: + ValidatorState(const layer_data *device_data, const char *func_name, const GLOBAL_CB_NODE *cb_state, + const uint64_t barrier_handle64, const VkSharingMode sharing_mode, const VulkanObjectType object_type, + const UNIQUE_VALIDATION_ERROR_CODE *val_codes) + : report_data_(device_data->report_data), + func_name_(func_name), + cb_handle64_(HandleToUint64(cb_state->commandBuffer)), + barrier_handle64_(barrier_handle64), + sharing_mode_(sharing_mode), + object_type_(object_type), + val_codes_(val_codes), + limit_(static_cast(device_data->phys_dev_properties.queue_family_properties.size())), + mem_ext_(device_data->extensions.vk_khr_external_memory) {} + + // Create a validator state from an image state... reducing the image specific to the generic version. + ValidatorState(const layer_data *device_data, const char *func_name, const GLOBAL_CB_NODE *cb_state, + const VkImageMemoryBarrier *barrier, const IMAGE_STATE *state) + : ValidatorState(device_data, func_name, cb_state, HandleToUint64(barrier->image), state->createInfo.sharingMode, + kVulkanObjectTypeImage, image_error_codes) {} + + // Create a validator state from an buffer state... reducing the buffer specific to the generic version. + ValidatorState(const layer_data *device_data, const char *func_name, const GLOBAL_CB_NODE *cb_state, + const VkBufferMemoryBarrier *barrier, const BUFFER_STATE *state) + : ValidatorState(device_data, func_name, cb_state, HandleToUint64(barrier->buffer), state->createInfo.sharingMode, + kVulkanObjectTypeImage, buffer_error_codes) {} + + // Log the messages using boilerplate from object state, and Vu specific information from the template arg + // One and two family versions, in the single family version, Vu holds the name of the passed parameter + bool LogMsg(VuIndex vu_index, uint32_t family, const char *param_name) const { + const UNIQUE_VALIDATION_ERROR_CODE val_code = val_codes_[vu_index]; + const char *annotation = GetFamilyAnnotation(family); + return log_msg(report_data_, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, cb_handle64_, + val_code, "%s: Barrier using %s 0x%" PRIx64 " created with sharingMode %s, has %s %u%s. %s", func_name_, + GetTypeString(), barrier_handle64_, GetModeString(), param_name, family, annotation, vu_summary[vu_index]); + } + + bool LogMsg(VuIndex vu_index, uint32_t src_family, uint32_t dst_family) const { + const UNIQUE_VALIDATION_ERROR_CODE val_code = val_codes_[vu_index]; + const char *src_annotation = GetFamilyAnnotation(src_family); + const char *dst_annotation = GetFamilyAnnotation(dst_family); + return log_msg(report_data_, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, cb_handle64_, + val_code, + "%s: Barrier using %s 0x%" PRIx64 + " created with sharingMode %s, has srcQueueFamilyIndex %u%s and dstQueueFamilyIndex %u%s. %s", + func_name_, GetTypeString(), barrier_handle64_, GetModeString(), src_family, src_annotation, dst_family, + dst_annotation, vu_summary[vu_index]); + } + + // This abstract Vu can only be tested at submit time, thus we need a callback from the closure containing the needed + // data. Note that the mem_barrier is copied to the closure as the lambda lifespan exceed the guarantees of validity for + // application input. + static bool ValidateAtQueueSubmit(const VkQueue queue, const layer_data *device_data, uint32_t src_family, uint32_t dst_family, + const ValidatorState &val) { + auto queue_data_it = device_data->queueMap.find(queue); + if (queue_data_it == device_data->queueMap.end()) return false; + + uint32_t queue_family = queue_data_it->second.queueFamilyIndex; + if ((src_family != queue_family) && (dst_family != queue_family)) { + const UNIQUE_VALIDATION_ERROR_CODE val_code = val.val_codes_[kSubmitQueueMustMatchSrcOrDst]; + const char *src_annotation = val.GetFamilyAnnotation(src_family); + const char *dst_annotation = val.GetFamilyAnnotation(dst_family); + return log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT, + HandleToUint64(queue), val_code, + "%s: Barrier submitted to queue with family index %u, using %s 0x%" PRIx64 + " created with sharingMode %s, has srcQueueFamilyIndex %u%s and dstQueueFamilyIndex %u%s. %s", + "vkQueueSubmit", queue_family, val.GetTypeString(), val.barrier_handle64_, val.GetModeString(), + src_family, src_annotation, dst_family, dst_annotation, vu_summary[kSubmitQueueMustMatchSrcOrDst]); + } + return false; + } + // Logical helpers for semantic clarity + inline bool KhrExternalMem() const { return mem_ext_; } + inline bool IsValid(uint32_t queue_family) const { return (queue_family < limit_); } + inline bool IsSpecial(uint32_t queue_family) const { + return (queue_family == VK_QUEUE_FAMILY_EXTERNAL_KHR) || (queue_family == VK_QUEUE_FAMILY_FOREIGN_EXT); + } + inline bool IsValidOrSpecial(uint32_t queue_family) const { + return IsValid(queue_family) || (mem_ext_ && IsSpecial(queue_family)); + } + inline bool IsIgnored(uint32_t queue_family) const { return queue_family == VK_QUEUE_FAMILY_IGNORED; } + + // Helpers for LogMsg (and log_msg) + const char *GetModeString() const { return string_VkSharingMode(sharing_mode_); } + + // Descriptive text for the various types of queue family index + const char *GetFamilyAnnotation(uint32_t family) const { + const char *external = " (VK_QUEUE_FAMILY_EXTERNAL_KHR)"; + const char *foreign = " (VK_QUEUE_FAMILY_FOREIGN_EXT)"; + const char *ignored = " (VK_QUEUE_FAMILY_IGNORED)"; + const char *valid = " (VALID)"; + const char *invalid = " (INVALID)"; + switch (family) { + case VK_QUEUE_FAMILY_EXTERNAL_KHR: + return external; + case VK_QUEUE_FAMILY_FOREIGN_EXT: + return foreign; + case VK_QUEUE_FAMILY_IGNORED: + return ignored; + default: + if (IsValid(family)) { + return valid; + } + return invalid; + }; + } + const char *GetTypeString() const { return object_string[object_type_]; } + VkSharingMode GetSharingMode() const { return sharing_mode_; } + + protected: + const debug_report_data *const report_data_; + const char *const func_name_; + const uint64_t cb_handle64_; + const uint64_t barrier_handle64_; + const VkSharingMode sharing_mode_; + const VulkanObjectType object_type_; + const UNIQUE_VALIDATION_ERROR_CODE *val_codes_; + const uint32_t limit_; + const bool mem_ext_; +}; + +bool Validate(const layer_data *device_data, const char *func_name, GLOBAL_CB_NODE *cb_state, const ValidatorState &val, + const uint32_t src_queue_family, const uint32_t dst_queue_family) { + bool skip = false; + + const bool mode_concurrent = val.GetSharingMode() == VK_SHARING_MODE_CONCURRENT; + const bool src_ignored = val.IsIgnored(src_queue_family); + const bool dst_ignored = val.IsIgnored(dst_queue_family); + if (val.KhrExternalMem()) { + if (mode_concurrent) { + if (!(src_ignored || dst_ignored)) { + skip |= val.LogMsg(kSrcOrDstMustBeIgnore, src_queue_family, dst_queue_family); + } + if ((src_ignored && !(dst_ignored || val.IsSpecial(dst_queue_family))) || + (dst_ignored && !(src_ignored || val.IsSpecial(src_queue_family)))) { + skip |= val.LogMsg(kSpecialOrIgnoreOnly, src_queue_family, dst_queue_family); + } + } else { + // VK_SHARING_MODE_EXCLUSIVE + if (src_ignored && !dst_ignored) { + skip |= val.LogMsg(kSrcIgnoreRequiresDstIgnore, src_queue_family, dst_queue_family); + } + if (!dst_ignored && !val.IsValidOrSpecial(dst_queue_family)) { + skip |= val.LogMsg(kDstValidOrSpecialIfNotIgnore, dst_queue_family, "dstQueueFamilyIndex"); + } + if (!src_ignored && !val.IsValidOrSpecial(src_queue_family)) { + skip |= val.LogMsg(kSrcValidOrSpecialIfNotIgnore, src_queue_family, "srcQueueFamilyIndex"); + } + } + } else { + // No memory extension + if (mode_concurrent) { + if (!src_ignored || !dst_ignored) { + skip |= val.LogMsg(kSrcAndDestMustBeIgnore, src_queue_family, dst_queue_family); + } + } else { + // VK_SHARING_MODE_EXCLUSIVE + if (!((src_ignored && dst_ignored) || (val.IsValid(src_queue_family) && val.IsValid(dst_queue_family)))) { + skip |= val.LogMsg(kBothIgnoreOrBothValid, src_queue_family, dst_queue_family); + } + } + } + if (!mode_concurrent && !src_ignored && !dst_ignored) { + // Only enqueue submit time check if it is needed. If more submit time checks are added, change the criteria + // TODO create a better named list, or rename the submit time lists to something that matches the broader usage... + // Note: if we want to create a semantic that separates state lookup, validation, and state update this should go + // to a local queue of update_state_actions or something. + cb_state->eventUpdates.emplace_back([device_data, src_queue_family, dst_queue_family, val](VkQueue queue) { + return ValidatorState::ValidateAtQueueSubmit(queue, device_data, src_queue_family, dst_queue_family, val); + }); + } + return skip; +} +} // namespace barrier_queue_families + +// Type specific wrapper for image barriers +bool ValidateBarrierQueueFamilies(const layer_data *device_data, const char *func_name, GLOBAL_CB_NODE *cb_state, + const VkImageMemoryBarrier *barrier, const IMAGE_STATE *state_data) { + // State data is required + if (!state_data) { + return false; + } + + // Create the validator state from the image state + barrier_queue_families::ValidatorState val(device_data, func_name, cb_state, barrier, state_data); + const uint32_t src_queue_family = barrier->srcQueueFamilyIndex; + const uint32_t dst_queue_family = barrier->dstQueueFamilyIndex; + return barrier_queue_families::Validate(device_data, func_name, cb_state, val, src_queue_family, dst_queue_family); +} + +// Type specific wrapper for buffer barriers +bool ValidateBarrierQueueFamilies(const layer_data *device_data, const char *func_name, GLOBAL_CB_NODE *cb_state, + const VkBufferMemoryBarrier *barrier, const BUFFER_STATE *state_data) { + // State data is required + if (!state_data) { + return false; + } + + // Create the validator state from the buffer state + barrier_queue_families::ValidatorState val(device_data, func_name, cb_state, barrier, state_data); + const uint32_t src_queue_family = barrier->srcQueueFamilyIndex; + const uint32_t dst_queue_family = barrier->dstQueueFamilyIndex; + return barrier_queue_families::Validate(device_data, func_name, cb_state, val, src_queue_family, dst_queue_family); +} + +static bool ValidateBarriers(layer_data *device_data, const char *funcName, GLOBAL_CB_NODE *cb_state, VkPipelineStageFlags src_stage_mask, VkPipelineStageFlags dst_stage_mask, uint32_t memBarrierCount, const VkMemoryBarrier *pMemBarriers, uint32_t bufferBarrierCount, const VkBufferMemoryBarrier *pBufferMemBarriers, uint32_t imageMemBarrierCount, @@ -6697,88 +7895,48 @@ const auto &mem_barrier = pMemBarriers[i]; if (!ValidateAccessMaskPipelineStage(mem_barrier.srcAccessMask, src_stage_mask)) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_state->commandBuffer), __LINE__, VALIDATION_ERROR_1b800940, "DS", - "%s: pMemBarriers[%d].srcAccessMask (0x%X) is not supported by srcStageMask (0x%X). %s", funcName, i, - mem_barrier.srcAccessMask, src_stage_mask, validation_error_map[VALIDATION_ERROR_1b800940]); + HandleToUint64(cb_state->commandBuffer), VALIDATION_ERROR_1b800940, + "%s: pMemBarriers[%d].srcAccessMask (0x%X) is not supported by srcStageMask (0x%X).", funcName, i, + mem_barrier.srcAccessMask, src_stage_mask); } if (!ValidateAccessMaskPipelineStage(mem_barrier.dstAccessMask, dst_stage_mask)) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_state->commandBuffer), __LINE__, VALIDATION_ERROR_1b800942, "DS", - "%s: pMemBarriers[%d].dstAccessMask (0x%X) is not supported by dstStageMask (0x%X). %s", funcName, i, - mem_barrier.dstAccessMask, dst_stage_mask, validation_error_map[VALIDATION_ERROR_1b800942]); + HandleToUint64(cb_state->commandBuffer), VALIDATION_ERROR_1b800942, + "%s: pMemBarriers[%d].dstAccessMask (0x%X) is not supported by dstStageMask (0x%X).", funcName, i, + mem_barrier.dstAccessMask, dst_stage_mask); } } for (uint32_t i = 0; i < imageMemBarrierCount; ++i) { auto mem_barrier = &pImageMemBarriers[i]; if (!ValidateAccessMaskPipelineStage(mem_barrier->srcAccessMask, src_stage_mask)) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_state->commandBuffer), __LINE__, VALIDATION_ERROR_1b800940, "DS", - "%s: pImageMemBarriers[%d].srcAccessMask (0x%X) is not supported by srcStageMask (0x%X). %s", funcName, - i, mem_barrier->srcAccessMask, src_stage_mask, validation_error_map[VALIDATION_ERROR_1b800940]); + HandleToUint64(cb_state->commandBuffer), VALIDATION_ERROR_1b800940, + "%s: pImageMemBarriers[%d].srcAccessMask (0x%X) is not supported by srcStageMask (0x%X).", funcName, i, + mem_barrier->srcAccessMask, src_stage_mask); } if (!ValidateAccessMaskPipelineStage(mem_barrier->dstAccessMask, dst_stage_mask)) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_state->commandBuffer), __LINE__, VALIDATION_ERROR_1b800942, "DS", - "%s: pImageMemBarriers[%d].dstAccessMask (0x%X) is not supported by dstStageMask (0x%X). %s", funcName, - i, mem_barrier->dstAccessMask, dst_stage_mask, validation_error_map[VALIDATION_ERROR_1b800942]); + HandleToUint64(cb_state->commandBuffer), VALIDATION_ERROR_1b800942, + "%s: pImageMemBarriers[%d].dstAccessMask (0x%X) is not supported by dstStageMask (0x%X).", funcName, i, + mem_barrier->dstAccessMask, dst_stage_mask); } + auto image_data = GetImageState(device_data, mem_barrier->image); - if (image_data) { - uint32_t src_q_f_index = mem_barrier->srcQueueFamilyIndex; - uint32_t dst_q_f_index = mem_barrier->dstQueueFamilyIndex; - if (image_data->createInfo.sharingMode == VK_SHARING_MODE_CONCURRENT) { - // srcQueueFamilyIndex and dstQueueFamilyIndex must both - // be VK_QUEUE_FAMILY_IGNORED - if ((src_q_f_index != VK_QUEUE_FAMILY_IGNORED) || (dst_q_f_index != VK_QUEUE_FAMILY_IGNORED)) { - skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(cb_state->commandBuffer), - __LINE__, DRAWSTATE_INVALID_QUEUE_INDEX, "DS", - "%s: Image Barrier for image 0x%" PRIx64 - " was created with sharingMode of " - "VK_SHARING_MODE_CONCURRENT. Src and dst " - "queueFamilyIndices must be VK_QUEUE_FAMILY_IGNORED.", - funcName, HandleToUint64(mem_barrier->image)); - } - } else { - // Sharing mode is VK_SHARING_MODE_EXCLUSIVE. srcQueueFamilyIndex and - // dstQueueFamilyIndex must either both be VK_QUEUE_FAMILY_IGNORED, - // or both be a valid queue family - if (((src_q_f_index == VK_QUEUE_FAMILY_IGNORED) || (dst_q_f_index == VK_QUEUE_FAMILY_IGNORED)) && - (src_q_f_index != dst_q_f_index)) { - skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(cb_state->commandBuffer), - __LINE__, DRAWSTATE_INVALID_QUEUE_INDEX, "DS", - "%s: Image 0x%" PRIx64 - " was created with sharingMode " - "of VK_SHARING_MODE_EXCLUSIVE. If one of src- or " - "dstQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, both " - "must be.", - funcName, HandleToUint64(mem_barrier->image)); - } else if (((src_q_f_index != VK_QUEUE_FAMILY_IGNORED) && (dst_q_f_index != VK_QUEUE_FAMILY_IGNORED)) && - ((src_q_f_index >= device_data->phys_dev_properties.queue_family_properties.size()) || - (dst_q_f_index >= device_data->phys_dev_properties.queue_family_properties.size()))) { - skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(cb_state->commandBuffer), - __LINE__, DRAWSTATE_INVALID_QUEUE_INDEX, "DS", - "%s: Image 0x%" PRIx64 - " was created with sharingMode " - "of VK_SHARING_MODE_EXCLUSIVE, but srcQueueFamilyIndex %d" - " or dstQueueFamilyIndex %d is greater than " PRINTF_SIZE_T_SPECIFIER - "queueFamilies crated for this device.", - funcName, HandleToUint64(mem_barrier->image), src_q_f_index, dst_q_f_index, - device_data->phys_dev_properties.queue_family_properties.size()); - } - } - } + skip |= ValidateBarrierQueueFamilies(device_data, funcName, cb_state, mem_barrier, image_data); if (mem_barrier->newLayout == VK_IMAGE_LAYOUT_UNDEFINED || mem_barrier->newLayout == VK_IMAGE_LAYOUT_PREINITIALIZED) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_state->commandBuffer), __LINE__, DRAWSTATE_INVALID_BARRIER, "DS", - "%s: Image Layout cannot be transitioned to UNDEFINED or " - "PREINITIALIZED.", - funcName); + HandleToUint64(cb_state->commandBuffer), VALIDATION_ERROR_0a00095c, + "%s: Image Layout cannot be transitioned to UNDEFINED or PREINITIALIZED.", funcName); } + if (image_data) { + // There is no VUID for this, but there is blanket text: + // "Non-sparse resources must be bound completely and contiguously to a single VkDeviceMemory object before + // recording commands in a command buffer." + // TODO: Update this when VUID is defined + skip |= ValidateMemoryIsBoundToImage(device_data, image_data, funcName, VALIDATION_ERROR_UNDEFINED); + auto aspect_mask = mem_barrier->subresourceRange.aspectMask; skip |= ValidateImageAspectMask(device_data, image_data->image, image_data->createInfo.format, aspect_mask, funcName); @@ -6794,44 +7952,39 @@ if (!ValidateAccessMaskPipelineStage(mem_barrier->srcAccessMask, src_stage_mask)) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_state->commandBuffer), __LINE__, VALIDATION_ERROR_1b800940, "DS", - "%s: pBufferMemBarriers[%d].srcAccessMask (0x%X) is not supported by srcStageMask (0x%X). %s", funcName, - i, mem_barrier->srcAccessMask, src_stage_mask, validation_error_map[VALIDATION_ERROR_1b800940]); + HandleToUint64(cb_state->commandBuffer), VALIDATION_ERROR_1b800940, + "%s: pBufferMemBarriers[%d].srcAccessMask (0x%X) is not supported by srcStageMask (0x%X).", funcName, i, + mem_barrier->srcAccessMask, src_stage_mask); } if (!ValidateAccessMaskPipelineStage(mem_barrier->dstAccessMask, dst_stage_mask)) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_state->commandBuffer), __LINE__, VALIDATION_ERROR_1b800942, "DS", - "%s: pBufferMemBarriers[%d].dstAccessMask (0x%X) is not supported by dstStageMask (0x%X). %s", funcName, - i, mem_barrier->dstAccessMask, dst_stage_mask, validation_error_map[VALIDATION_ERROR_1b800942]); + HandleToUint64(cb_state->commandBuffer), VALIDATION_ERROR_1b800942, + "%s: pBufferMemBarriers[%d].dstAccessMask (0x%X) is not supported by dstStageMask (0x%X).", funcName, i, + mem_barrier->dstAccessMask, dst_stage_mask); } // Validate buffer barrier queue family indices - if ((mem_barrier->srcQueueFamilyIndex != VK_QUEUE_FAMILY_IGNORED && - mem_barrier->srcQueueFamilyIndex >= device_data->phys_dev_properties.queue_family_properties.size()) || - (mem_barrier->dstQueueFamilyIndex != VK_QUEUE_FAMILY_IGNORED && - mem_barrier->dstQueueFamilyIndex >= device_data->phys_dev_properties.queue_family_properties.size())) { - skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_state->commandBuffer), __LINE__, DRAWSTATE_INVALID_QUEUE_INDEX, "DS", - "%s: Buffer Barrier 0x%" PRIx64 - " has QueueFamilyIndex greater " - "than the number of QueueFamilies (" PRINTF_SIZE_T_SPECIFIER ") for this device.", - funcName, HandleToUint64(mem_barrier->buffer), - device_data->phys_dev_properties.queue_family_properties.size()); - } - auto buffer_state = GetBufferState(device_data, mem_barrier->buffer); + skip |= ValidateBarrierQueueFamilies(device_data, funcName, cb_state, mem_barrier, buffer_state); + if (buffer_state) { - auto buffer_size = buffer_state->requirements.size; + // There is no VUID for this, but there is blanket text: + // "Non-sparse resources must be bound completely and contiguously to a single VkDeviceMemory object before + // recording commands in a command buffer" + // TODO: Update this when VUID is defined + skip |= ValidateMemoryIsBoundToBuffer(device_data, buffer_state, funcName, VALIDATION_ERROR_UNDEFINED); + + auto buffer_size = buffer_state->createInfo.size; if (mem_barrier->offset >= buffer_size) { skip |= log_msg( device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_state->commandBuffer), __LINE__, DRAWSTATE_INVALID_BARRIER, "DS", + HandleToUint64(cb_state->commandBuffer), VALIDATION_ERROR_01800946, "%s: Buffer Barrier 0x%" PRIx64 " has offset 0x%" PRIx64 " which is not less than total size 0x%" PRIx64 ".", funcName, HandleToUint64(mem_barrier->buffer), HandleToUint64(mem_barrier->offset), HandleToUint64(buffer_size)); } else if (mem_barrier->size != VK_WHOLE_SIZE && (mem_barrier->offset + mem_barrier->size > buffer_size)) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(cb_state->commandBuffer), __LINE__, DRAWSTATE_INVALID_BARRIER, "DS", + HandleToUint64(cb_state->commandBuffer), VALIDATION_ERROR_0180094a, "%s: Buffer Barrier 0x%" PRIx64 " has offset 0x%" PRIx64 " and size 0x%" PRIx64 " whose sum is greater than total size 0x%" PRIx64 ".", funcName, HandleToUint64(mem_barrier->buffer), HandleToUint64(mem_barrier->offset), @@ -6858,7 +8011,7 @@ auto global_event_data = GetEventNode(dev_data, event); if (!global_event_data) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT, - HandleToUint64(event), __LINE__, DRAWSTATE_INVALID_EVENT, "DS", + HandleToUint64(event), DRAWSTATE_INVALID_EVENT, "Event 0x%" PRIx64 " cannot be waited on if it has never been set.", HandleToUint64(event)); } else { stageMask |= global_event_data->stageMask; @@ -6869,13 +8022,11 @@ // but set event can be called at any time. if (sourceStageMask != stageMask && sourceStageMask != (stageMask | VK_PIPELINE_STAGE_HOST_BIT)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pCB->commandBuffer), __LINE__, VALIDATION_ERROR_1e62d401, "DS", - "Submitting cmdbuffer with call to VkCmdWaitEvents " - "using srcStageMask 0x%X which must be the bitwise " - "OR of the stageMask parameters used in calls to " - "vkCmdSetEvent and VK_PIPELINE_STAGE_HOST_BIT if " - "used with vkSetEvent but instead is 0x%X. %s", - sourceStageMask, stageMask, validation_error_map[VALIDATION_ERROR_1e62d401]); + HandleToUint64(pCB->commandBuffer), VALIDATION_ERROR_1e62d401, + "Submitting cmdbuffer with call to VkCmdWaitEvents using srcStageMask 0x%X which must be the bitwise OR of " + "the stageMask parameters used in calls to vkCmdSetEvent and VK_PIPELINE_STAGE_HOST_BIT if used with " + "vkSetEvent but instead is 0x%X.", + sourceStageMask, stageMask); } return skip; } @@ -6920,22 +8071,59 @@ for (const auto &item : stage_flag_bit_array) { if (stage_mask & item) { if ((supported_pipeline_stages_table[item] & queue_flags) == 0) { - skip |= - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, error_code, "DL", - "%s(): %s flag %s is not compatible with the queue family properties of this " - "command buffer. %s", - function, src_or_dest, string_VkPipelineStageFlagBits(static_cast(item)), - validation_error_map[error_code]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(command_buffer), error_code, + "%s(): %s flag %s is not compatible with the queue family properties of this command buffer.", + function, src_or_dest, string_VkPipelineStageFlagBits(static_cast(item))); } } } return skip; } +// Check if all barriers are of a given operation type. +template +static bool AllTransferOp(const COMMAND_POOL_NODE *pool, OpCheck &op_check, uint32_t count, const Barrier *barriers) { + if (!pool) return false; + + for (uint32_t b = 0; b < count; b++) { + if (!op_check(pool, barriers + b)) return false; + } + return true; +} + +enum BarrierOperationsType { + kAllAcquire, // All Barrier operations are "ownership acquire" operations + kAllRelease, // All Barrier operations are "ownership release" operations + kGeneral, // Either no ownership operations or a mix of ownership operation types and/or non-ownership operations +}; + +// Look at the barriers to see if we they are all release or all acquire, the result impacts queue properties validation +BarrierOperationsType ComputeBarrierOperationsType(layer_data *device_data, GLOBAL_CB_NODE *cb_state, uint32_t buffer_barrier_count, + const VkBufferMemoryBarrier *buffer_barriers, uint32_t image_barrier_count, + const VkImageMemoryBarrier *image_barriers) { + auto pool = GetCommandPoolNode(device_data, cb_state->createInfo.commandPool); + BarrierOperationsType op_type = kGeneral; + + // Look at the barrier details only if they exist + // Note: AllTransferOp returns true for count == 0 + if ((buffer_barrier_count + image_barrier_count) != 0) { + if (AllTransferOp(pool, IsReleaseOp, buffer_barrier_count, buffer_barriers) && + AllTransferOp(pool, IsReleaseOp, image_barrier_count, image_barriers)) { + op_type = kAllRelease; + } else if (AllTransferOp(pool, IsAcquireOp, buffer_barrier_count, buffer_barriers) && + AllTransferOp(pool, IsAcquireOp, image_barrier_count, image_barriers)) { + op_type = kAllAcquire; + } + } + + return op_type; +} + bool ValidateStageMasksAgainstQueueCapabilities(layer_data *dev_data, GLOBAL_CB_NODE const *cb_state, VkPipelineStageFlags source_stage_mask, VkPipelineStageFlags dest_stage_mask, - const char *function, UNIQUE_VALIDATION_ERROR_CODE error_code) { + BarrierOperationsType barrier_op_type, const char *function, + UNIQUE_VALIDATION_ERROR_CODE error_code) { bool skip = false; uint32_t queue_family_index = dev_data->commandPoolMap[cb_state->createInfo.commandPool].queueFamilyIndex; instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(dev_data->physical_device), instance_layer_data_map); @@ -6948,11 +8136,13 @@ if (queue_family_index < physical_device_state->queue_family_properties.size()) { VkQueueFlags specified_queue_flags = physical_device_state->queue_family_properties[queue_family_index].queueFlags; - if ((source_stage_mask & VK_PIPELINE_STAGE_ALL_COMMANDS_BIT) == 0) { + // Only check the source stage mask if any barriers aren't "acquire ownership" + if ((barrier_op_type != kAllAcquire) && (source_stage_mask & VK_PIPELINE_STAGE_ALL_COMMANDS_BIT) == 0) { skip |= CheckStageMaskQueueCompatibility(dev_data, cb_state->commandBuffer, source_stage_mask, specified_queue_flags, function, "srcStageMask", error_code); } - if ((dest_stage_mask & VK_PIPELINE_STAGE_ALL_COMMANDS_BIT) == 0) { + // Only check the dest stage mask if any barriers aren't "release ownership" + if ((barrier_op_type != kAllRelease) && (dest_stage_mask & VK_PIPELINE_STAGE_ALL_COMMANDS_BIT) == 0) { skip |= CheckStageMaskQueueCompatibility(dev_data, cb_state->commandBuffer, dest_stage_mask, specified_queue_flags, function, "dstStageMask", error_code); } @@ -6970,8 +8160,10 @@ unique_lock_t lock(global_lock); GLOBAL_CB_NODE *cb_state = GetCBNode(dev_data, commandBuffer); if (cb_state) { - skip |= ValidateStageMasksAgainstQueueCapabilities(dev_data, cb_state, sourceStageMask, dstStageMask, "vkCmdWaitEvents", - VALIDATION_ERROR_1e600918); + auto barrier_op_type = ComputeBarrierOperationsType(dev_data, cb_state, bufferMemoryBarrierCount, pBufferMemoryBarriers, + imageMemoryBarrierCount, pImageMemoryBarriers); + skip |= ValidateStageMasksAgainstQueueCapabilities(dev_data, cb_state, sourceStageMask, dstStageMask, barrier_op_type, + "vkCmdWaitEvents", VALIDATION_ERROR_1e600918); skip |= ValidateStageMaskGsTsEnables(dev_data, sourceStageMask, "vkCmdWaitEvents()", VALIDATION_ERROR_1e60090e, VALIDATION_ERROR_1e600912); skip |= ValidateStageMaskGsTsEnables(dev_data, dstStageMask, "vkCmdWaitEvents()", VALIDATION_ERROR_1e600910, @@ -6988,16 +8180,16 @@ for (uint32_t i = 0; i < eventCount; ++i) { auto event_state = GetEventNode(dev_data, pEvents[i]); if (event_state) { - addCommandBufferBinding(&event_state->cb_bindings, {HandleToUint64(pEvents[i]), kVulkanObjectTypeEvent}, cb_state); + addCommandBufferBinding(&event_state->cb_bindings, {HandleToUint64(pEvents[i]), kVulkanObjectTypeEvent}, + cb_state); event_state->cb_bindings.insert(cb_state); } cb_state->waitedEvents.insert(pEvents[i]); cb_state->events.push_back(pEvents[i]); } - cb_state->eventUpdates.emplace_back([=](VkQueue q){ - return validateEventStageMask(q, cb_state, eventCount, first_event_index, sourceStageMask); - }); - TransitionImageLayouts(dev_data, commandBuffer, imageMemoryBarrierCount, pImageMemoryBarriers); + cb_state->eventUpdates.emplace_back( + [=](VkQueue q) { return validateEventStageMask(q, cb_state, eventCount, first_event_index, sourceStageMask); }); + TransitionImageLayouts(dev_data, cb_state, imageMemoryBarrierCount, pImageMemoryBarriers); } } lock.unlock(); @@ -7013,8 +8205,10 @@ uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers) { bool skip = false; - skip |= ValidateStageMasksAgainstQueueCapabilities(device_data, cb_state, srcStageMask, dstStageMask, "vkCmdPipelineBarrier", - VALIDATION_ERROR_1b80093e); + auto barrier_op_type = ComputeBarrierOperationsType(device_data, cb_state, bufferMemoryBarrierCount, pBufferMemoryBarriers, + imageMemoryBarrierCount, pImageMemoryBarriers); + skip |= ValidateStageMasksAgainstQueueCapabilities(device_data, cb_state, srcStageMask, dstStageMask, barrier_op_type, + "vkCmdPipelineBarrier", VALIDATION_ERROR_1b80093e); skip |= ValidateCmdQueueFlags(device_data, cb_state, "vkCmdPipelineBarrier()", VK_QUEUE_TRANSFER_BIT | VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT, VALIDATION_ERROR_1b802415); skip |= ValidateCmd(device_data, cb_state, CMD_PIPELINEBARRIER, "vkCmdPipelineBarrier()"); @@ -7038,7 +8232,7 @@ static void PreCallRecordCmdPipelineBarrier(layer_data *device_data, GLOBAL_CB_NODE *cb_state, VkCommandBuffer commandBuffer, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers) { - TransitionImageLayouts(device_data, commandBuffer, imageMemoryBarrierCount, pImageMemoryBarriers); + TransitionImageLayouts(device_data, cb_state, imageMemoryBarrierCount, pImageMemoryBarriers); } VKAPI_ATTR void VKAPI_CALL CmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, @@ -7062,9 +8256,9 @@ } lock.unlock(); if (!skip) { - device_data->dispatch_table.CmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, - pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, - imageMemoryBarrierCount, pImageMemoryBarriers); + device_data->dispatch_table.CmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, + memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, + pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); } } @@ -7116,9 +8310,9 @@ if (cb_state) { if (!cb_state->activeQueries.count(query)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_1ae00652, "DS", - "Ending a query before it was started: queryPool 0x%" PRIx64 ", index %d. %s", - HandleToUint64(queryPool), slot, validation_error_map[VALIDATION_ERROR_1ae00652]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_1ae00f06, + "Ending a query before it was started: queryPool 0x%" PRIx64 ", index %d.", HandleToUint64(queryPool), + slot); } skip |= ValidateCmdQueueFlags(dev_data, cb_state, "VkCmdEndQuery()", VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT, VALIDATION_ERROR_1ae02415); @@ -7133,7 +8327,7 @@ lock.lock(); if (cb_state) { cb_state->activeQueries.erase(query); - cb_state->queryUpdates.emplace_back([=](VkQueue q){return setQueryState(q, commandBuffer, query, true);}); + cb_state->queryUpdates.emplace_back([=](VkQueue q) { return setQueryState(q, commandBuffer, query, true); }); addCommandBufferBinding(&GetQueryPoolNode(dev_data, queryPool)->cb_bindings, {HandleToUint64(queryPool), kVulkanObjectTypeQueryPool}, cb_state); } @@ -7145,10 +8339,10 @@ layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); unique_lock_t lock(global_lock); GLOBAL_CB_NODE *cb_state = GetCBNode(dev_data, commandBuffer); - skip |= insideRenderPass(dev_data, cb_state, "vkCmdResetQueryPool()", VALIDATION_ERROR_1c600017); - skip |= ValidateCmd(dev_data, cb_state, CMD_RESETQUERYPOOL, "VkCmdResetQueryPool()"); - skip |= ValidateCmdQueueFlags(dev_data, cb_state, "VkCmdResetQueryPool()", VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT, - VALIDATION_ERROR_1c602415); + skip |= insideRenderPass(dev_data, cb_state, "vkCmdResetQueryPool()", VALIDATION_ERROR_1c600017); + skip |= ValidateCmd(dev_data, cb_state, CMD_RESETQUERYPOOL, "VkCmdResetQueryPool()"); + skip |= ValidateCmdQueueFlags(dev_data, cb_state, "VkCmdResetQueryPool()", VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT, + VALIDATION_ERROR_1c602415); lock.unlock(); if (skip) return; @@ -7159,7 +8353,7 @@ for (uint32_t i = 0; i < queryCount; i++) { QueryObject query = {queryPool, firstQuery + i}; cb_state->waitedEventsBeforeQueryReset[query] = cb_state->waitedEvents; - cb_state->queryUpdates.emplace_back([=](VkQueue q){return setQueryState(q, commandBuffer, query, false);}); + cb_state->queryUpdates.emplace_back([=](VkQueue q) { return setQueryState(q, commandBuffer, query, false); }); } addCommandBufferBinding(&GetQueryPoolNode(dev_data, queryPool)->cb_bindings, {HandleToUint64(queryPool), kVulkanObjectTypeQueryPool}, cb_state); @@ -7172,8 +8366,7 @@ if (!query_data->second) return true; } else { auto it = dev_data->queryToStateMap.find(query); - if (it == dev_data->queryToStateMap.end() || !it->second) - return true; + if (it == dev_data->queryToStateMap.end() || !it->second) return true; } return false; @@ -7187,7 +8380,7 @@ for (uint32_t i = 0; i < queryCount; i++) { if (IsQueryInvalid(dev_data, queue_data, queryPool, firstQuery + i)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pCB->commandBuffer), __LINE__, DRAWSTATE_INVALID_QUERY, "DS", + HandleToUint64(pCB->commandBuffer), DRAWSTATE_INVALID_QUERY, "Requesting a copy from query to buffer with invalid query: queryPool 0x%" PRIx64 ", index %d", HandleToUint64(queryPool), firstQuery + i); } @@ -7219,8 +8412,8 @@ if (skip) return; - dev_data->dispatch_table.CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, - stride, flags); + dev_data->dispatch_table.CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, + flags); lock.lock(); if (cb_node && dst_buff_state) { @@ -7229,9 +8422,7 @@ SetBufferMemoryValid(dev_data, dst_buff_state, true); return false; }); - cb_node->queryUpdates.emplace_back([=](VkQueue q) { - return validateQuery(q, cb_node, queryPool, firstQuery, queryCount); - }); + cb_node->queryUpdates.emplace_back([=](VkQueue q) { return validateQuery(q, cb_node, queryPool, firstQuery, queryCount); }); addCommandBufferBinding(&GetQueryPoolNode(dev_data, queryPool)->cb_bindings, {HandleToUint64(queryPool), kVulkanObjectTypeQueryPool}, cb_node); } @@ -7250,32 +8441,44 @@ } skip |= validatePushConstantRange(dev_data, offset, size, "vkCmdPushConstants()"); if (0 == stageFlags) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_1bc2dc03, "DS", - "vkCmdPushConstants() call has no stageFlags set. %s", validation_error_map[VALIDATION_ERROR_1bc2dc03]); + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_1bc2dc03, "vkCmdPushConstants() call has no stageFlags set."); } - // Check if specified push constant range falls within a pipeline-defined range which has matching stageFlags. - // The spec doesn't seem to disallow having multiple push constant ranges with the - // same offset and size, but different stageFlags. So we can't just check the - // stageFlags in the first range with matching offset and size. + // Check if pipeline_layout VkPushConstantRange(s) overlapping offset, size have stageFlags set for each stage in the command + // stageFlags argument, *and* that the command stageFlags argument has bits set for the stageFlags in each overlapping range. if (!skip) { - const auto &ranges = getPipelineLayout(dev_data, layout)->push_constant_ranges; - bool found_matching_range = false; + const auto &ranges = *getPipelineLayout(dev_data, layout)->push_constant_ranges; + VkShaderStageFlags found_stages = 0; for (const auto &range : ranges) { - if ((stageFlags == range.stageFlags) && (offset >= range.offset) && (offset + size <= range.offset + range.size)) { - found_matching_range = true; - break; - } - } - if (!found_matching_range) { + if ((offset >= range.offset) && (offset + size <= range.offset + range.size)) { + VkShaderStageFlags matching_stages = range.stageFlags & stageFlags; + if (matching_stages != range.stageFlags) { + // VALIDATION_ERROR_1bc00e08 VUID-vkCmdPushConstants-offset-01796 + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(commandBuffer), + VALIDATION_ERROR_1bc00e08, + "vkCmdPushConstants(): stageFlags (0x%" PRIx32 ", offset (%" PRIu32 "), and size (%" PRIu32 + "), " + "must contain all stages in overlapping VkPushConstantRange stageFlags (0x%" PRIx32 + "), offset (%" PRIu32 "), and size (%" PRIu32 ") in pipeline layout 0x%" PRIx64 ".", + (uint32_t)stageFlags, offset, size, (uint32_t)range.stageFlags, range.offset, range.size, + HandleToUint64(layout)); + } + + // Accumulate all stages we've found + found_stages = matching_stages | found_stages; + } + } + if (found_stages != stageFlags) { + // VALIDATION_ERROR_1bc00e06 VUID-vkCmdPushConstants-offset-01795 + uint32_t missing_stages = ~found_stages & stageFlags; skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_1bc002de, "DS", - "vkCmdPushConstants() stageFlags = 0x%" PRIx32 - " do not match the stageFlags in any of the ranges with" - " offset = %d and size = %d in pipeline layout 0x%" PRIx64 ". %s", - (uint32_t)stageFlags, offset, size, HandleToUint64(layout), - validation_error_map[VALIDATION_ERROR_1bc002de]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_1bc00e06, + "vkCmdPushConstants(): stageFlags = 0x%" PRIx32 ", VkPushConstantRange in pipeline layout 0x%" PRIx64 + " overlapping offset = %d and size = %d, do not contain stageFlags 0x%" PRIx32 ".", + (uint32_t)stageFlags, HandleToUint64(layout), offset, size, missing_stages); } } lock.unlock(); @@ -7289,8 +8492,9 @@ unique_lock_t lock(global_lock); GLOBAL_CB_NODE *cb_state = GetCBNode(dev_data, commandBuffer); if (cb_state) { - skip |= ValidateCmdQueueFlags(dev_data, cb_state, "vkCmdWriteTimestamp()", VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT, - VALIDATION_ERROR_1e802415); + skip |= + ValidateCmdQueueFlags(dev_data, cb_state, "vkCmdWriteTimestamp()", + VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT, VALIDATION_ERROR_1e802415); skip |= ValidateCmd(dev_data, cb_state, CMD_WRITETIMESTAMP, "vkCmdWriteTimestamp()"); } lock.unlock(); @@ -7302,7 +8506,7 @@ lock.lock(); if (cb_state) { QueryObject query = {queryPool, slot}; - cb_state->queryUpdates.emplace_back([=](VkQueue q) {return setQueryState(q, commandBuffer, query, true);}); + cb_state->queryUpdates.emplace_back([=](VkQueue q) { return setQueryState(q, commandBuffer, query, true); }); } } @@ -7322,11 +8526,10 @@ if (ici != nullptr) { if ((ici->usage & usage_flag) == 0) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, error_code, "DS", + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, error_code, "vkCreateFramebuffer: Framebuffer Attachment (%d) conflicts with the image's " - "IMAGE_USAGE flags (%s). %s", - attachments[attach].attachment, string_VkImageUsageFlagBits(usage_flag), - validation_error_map[error_code]); + "IMAGE_USAGE flags (%s).", + attachments[attach].attachment, string_VkImageUsageFlagBits(usage_flag)); } } } @@ -7352,13 +8555,11 @@ if (rp_state) { const VkRenderPassCreateInfo *rpci = rp_state->createInfo.ptr(); if (rpci->attachmentCount != pCreateInfo->attachmentCount) { - skip |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, - HandleToUint64(pCreateInfo->renderPass), __LINE__, VALIDATION_ERROR_094006d8, "DS", - "vkCreateFramebuffer(): VkFramebufferCreateInfo attachmentCount of %u does not match attachmentCount of %u of " - "renderPass (0x%" PRIxLEAST64 ") being used to create Framebuffer. %s", - pCreateInfo->attachmentCount, rpci->attachmentCount, HandleToUint64(pCreateInfo->renderPass), - validation_error_map[VALIDATION_ERROR_094006d8]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, + HandleToUint64(pCreateInfo->renderPass), VALIDATION_ERROR_094006d8, + "vkCreateFramebuffer(): VkFramebufferCreateInfo attachmentCount of %u does not match attachmentCount " + "of %u of renderPass (0x%" PRIx64 ") being used to create Framebuffer.", + pCreateInfo->attachmentCount, rpci->attachmentCount, HandleToUint64(pCreateInfo->renderPass)); } else { // attachmentCounts match, so make sure corresponding attachment details line up const VkImageView *image_views = pCreateInfo->pAttachments; @@ -7366,67 +8567,63 @@ auto view_state = GetImageViewState(dev_data, image_views[i]); auto &ivci = view_state->create_info; if (ivci.format != rpci->pAttachments[i].format) { - skip |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, - HandleToUint64(pCreateInfo->renderPass), __LINE__, VALIDATION_ERROR_094006e0, "DS", - "vkCreateFramebuffer(): VkFramebufferCreateInfo attachment #%u has format of %s that does not match " - "the format of " - "%s used by the corresponding attachment for renderPass (0x%" PRIxLEAST64 "). %s", - i, string_VkFormat(ivci.format), string_VkFormat(rpci->pAttachments[i].format), - HandleToUint64(pCreateInfo->renderPass), validation_error_map[VALIDATION_ERROR_094006e0]); + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, + HandleToUint64(pCreateInfo->renderPass), VALIDATION_ERROR_094006e0, + "vkCreateFramebuffer(): VkFramebufferCreateInfo attachment #%u has format of %s that does not " + "match the format of %s used by the corresponding attachment for renderPass (0x%" PRIx64 ").", + i, string_VkFormat(ivci.format), string_VkFormat(rpci->pAttachments[i].format), + HandleToUint64(pCreateInfo->renderPass)); } const VkImageCreateInfo *ici = &GetImageState(dev_data, ivci.image)->createInfo; if (ici->samples != rpci->pAttachments[i].samples) { skip |= log_msg( dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, - HandleToUint64(pCreateInfo->renderPass), __LINE__, VALIDATION_ERROR_094006e2, "DS", - "vkCreateFramebuffer(): VkFramebufferCreateInfo attachment #%u has %s samples that do not match " - "the %s samples used by the corresponding attachment for renderPass (0x%" PRIxLEAST64 "). %s", + HandleToUint64(pCreateInfo->renderPass), VALIDATION_ERROR_094006e2, + "vkCreateFramebuffer(): VkFramebufferCreateInfo attachment #%u has %s samples that do not match the %s " + "samples used by the corresponding attachment for renderPass (0x%" PRIx64 ").", i, string_VkSampleCountFlagBits(ici->samples), string_VkSampleCountFlagBits(rpci->pAttachments[i].samples), - HandleToUint64(pCreateInfo->renderPass), validation_error_map[VALIDATION_ERROR_094006e2]); + HandleToUint64(pCreateInfo->renderPass)); } // Verify that view only has a single mip level if (ivci.subresourceRange.levelCount != 1) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, - 0, __LINE__, VALIDATION_ERROR_094006e6, "DS", - "vkCreateFramebuffer(): VkFramebufferCreateInfo attachment #%u has mip levelCount of %u " - "but only a single mip level (levelCount == 1) is allowed when creating a Framebuffer. %s", - i, ivci.subresourceRange.levelCount, validation_error_map[VALIDATION_ERROR_094006e6]); + 0, VALIDATION_ERROR_094006e6, + "vkCreateFramebuffer(): VkFramebufferCreateInfo attachment #%u has mip levelCount of %u but " + "only a single mip level (levelCount == 1) is allowed when creating a Framebuffer.", + i, ivci.subresourceRange.levelCount); } const uint32_t mip_level = ivci.subresourceRange.baseMipLevel; uint32_t mip_width = max(1u, ici->extent.width >> mip_level); uint32_t mip_height = max(1u, ici->extent.height >> mip_level); if ((ivci.subresourceRange.layerCount < pCreateInfo->layers) || (mip_width < pCreateInfo->width) || (mip_height < pCreateInfo->height)) { - skip |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_094006e4, "DS", - "vkCreateFramebuffer(): VkFramebufferCreateInfo attachment #%u mip level %u has dimensions smaller " - "than the corresponding framebuffer dimensions. Here are the respective dimensions for attachment #%u, " - "framebuffer:\n" - "width: %u, %u\n" - "height: %u, %u\n" - "layerCount: %u, %u\n%s", - i, ivci.subresourceRange.baseMipLevel, i, mip_width, pCreateInfo->width, mip_height, pCreateInfo->height, - ivci.subresourceRange.layerCount, pCreateInfo->layers, validation_error_map[VALIDATION_ERROR_094006e4]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, + 0, VALIDATION_ERROR_094006e4, + "vkCreateFramebuffer(): VkFramebufferCreateInfo attachment #%u mip level %u has dimensions " + "smaller than the corresponding framebuffer dimensions. Here are the respective dimensions for " + "attachment #%u, framebuffer:\n" + "width: %u, %u\n" + "height: %u, %u\n" + "layerCount: %u, %u\n", + i, ivci.subresourceRange.baseMipLevel, i, mip_width, pCreateInfo->width, mip_height, + pCreateInfo->height, ivci.subresourceRange.layerCount, pCreateInfo->layers); } if (((ivci.components.r != VK_COMPONENT_SWIZZLE_IDENTITY) && (ivci.components.r != VK_COMPONENT_SWIZZLE_R)) || ((ivci.components.g != VK_COMPONENT_SWIZZLE_IDENTITY) && (ivci.components.g != VK_COMPONENT_SWIZZLE_G)) || ((ivci.components.b != VK_COMPONENT_SWIZZLE_IDENTITY) && (ivci.components.b != VK_COMPONENT_SWIZZLE_B)) || ((ivci.components.a != VK_COMPONENT_SWIZZLE_IDENTITY) && (ivci.components.a != VK_COMPONENT_SWIZZLE_A))) { - skip |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_094006e8, "DS", - "vkCreateFramebuffer(): VkFramebufferCreateInfo attachment #%u has non-identy swizzle. All framebuffer " - "attachments must have been created with the identity swizzle. Here are the actual swizzle values:\n" - "r swizzle = %s\n" - "g swizzle = %s\n" - "b swizzle = %s\n" - "a swizzle = %s\n" - "%s", - i, string_VkComponentSwizzle(ivci.components.r), string_VkComponentSwizzle(ivci.components.g), - string_VkComponentSwizzle(ivci.components.b), string_VkComponentSwizzle(ivci.components.a), - validation_error_map[VALIDATION_ERROR_094006e8]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, + 0, VALIDATION_ERROR_094006e8, + "vkCreateFramebuffer(): VkFramebufferCreateInfo attachment #%u has non-identy swizzle. All " + "framebuffer attachments must have been created with the identity swizzle. Here are the actual " + "swizzle values:\n" + "r swizzle = %s\n" + "g swizzle = %s\n" + "b swizzle = %s\n" + "a swizzle = %s\n", + i, string_VkComponentSwizzle(ivci.components.r), string_VkComponentSwizzle(ivci.components.g), + string_VkComponentSwizzle(ivci.components.b), string_VkComponentSwizzle(ivci.components.a)); } } } @@ -7449,50 +8646,41 @@ } // Verify FB dimensions are within physical device limits if (pCreateInfo->width > dev_data->phys_dev_properties.properties.limits.maxFramebufferWidth) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_094006ec, "DS", - "vkCreateFramebuffer(): Requested VkFramebufferCreateInfo width exceeds physical device limits. " - "Requested width: %u, device max: %u\n" - "%s", - pCreateInfo->width, dev_data->phys_dev_properties.properties.limits.maxFramebufferWidth, - validation_error_map[VALIDATION_ERROR_094006ec]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_094006ec, + "vkCreateFramebuffer(): Requested VkFramebufferCreateInfo width exceeds physical device limits. Requested " + "width: %u, device max: %u\n", + pCreateInfo->width, dev_data->phys_dev_properties.properties.limits.maxFramebufferWidth); } if (pCreateInfo->height > dev_data->phys_dev_properties.properties.limits.maxFramebufferHeight) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_094006f0, "DS", - "vkCreateFramebuffer(): Requested VkFramebufferCreateInfo height exceeds physical device limits. " - "Requested height: %u, device max: %u\n" - "%s", - pCreateInfo->height, dev_data->phys_dev_properties.properties.limits.maxFramebufferHeight, - validation_error_map[VALIDATION_ERROR_094006f0]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_094006f0, + "vkCreateFramebuffer(): Requested VkFramebufferCreateInfo height exceeds physical device limits. Requested " + "height: %u, device max: %u\n", + pCreateInfo->height, dev_data->phys_dev_properties.properties.limits.maxFramebufferHeight); } if (pCreateInfo->layers > dev_data->phys_dev_properties.properties.limits.maxFramebufferLayers) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_094006f4, "DS", - "vkCreateFramebuffer(): Requested VkFramebufferCreateInfo layers exceeds physical device limits. " - "Requested layers: %u, device max: %u\n" - "%s", - pCreateInfo->layers, dev_data->phys_dev_properties.properties.limits.maxFramebufferLayers, - validation_error_map[VALIDATION_ERROR_094006f4]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_094006f4, + "vkCreateFramebuffer(): Requested VkFramebufferCreateInfo layers exceeds physical device limits. Requested " + "layers: %u, device max: %u\n", + pCreateInfo->layers, dev_data->phys_dev_properties.properties.limits.maxFramebufferLayers); } // Verify FB dimensions are greater than zero if (pCreateInfo->width <= 0) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_094006ea, "DS", - "vkCreateFramebuffer(): Requested VkFramebufferCreateInfo width must be greater than zero. %s", - validation_error_map[VALIDATION_ERROR_094006ea]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_094006ea, + "vkCreateFramebuffer(): Requested VkFramebufferCreateInfo width must be greater than zero."); } if (pCreateInfo->height <= 0) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_094006ee, "DS", - "vkCreateFramebuffer(): Requested VkFramebufferCreateInfo height must be greater than zero. %s", - validation_error_map[VALIDATION_ERROR_094006ee]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_094006ee, + "vkCreateFramebuffer(): Requested VkFramebufferCreateInfo height must be greater than zero."); } if (pCreateInfo->layers <= 0) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_094006f2, "DS", - "vkCreateFramebuffer(): Requested VkFramebufferCreateInfo layers must be greater than zero. %s", - validation_error_map[VALIDATION_ERROR_094006f2]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_094006f2, + "vkCreateFramebuffer(): Requested VkFramebufferCreateInfo layers must be greater than zero."); } return skip; } @@ -7580,7 +8768,7 @@ if (!(FindDependency(subpass, dependent_subpasses[k], subpass_to_node, processed_nodes) || FindDependency(dependent_subpasses[k], subpass, subpass_to_node, processed_nodes))) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS", + DRAWSTATE_INVALID_RENDERPASS, "A dependency between subpasses %d and %d must exist but one is not specified.", subpass, dependent_subpasses[k]); result = false; @@ -7620,7 +8808,7 @@ } if (!has_preserved) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS", + DRAWSTATE_INVALID_RENDERPASS, "Attachment %d is used by a later subpass and must be preserved in subpass %d.", attachment, index); } } @@ -7687,17 +8875,15 @@ for (auto other_attachment : overlapping_attachments[i]) { if (!(pCreateInfo->pAttachments[attachment].flags & VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT, - HandleToUint64(framebuffer->framebuffer), __LINE__, VALIDATION_ERROR_12200682, "DS", - "Attachment %d aliases attachment %d but doesn't " - "set VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT. %s", - attachment, other_attachment, validation_error_map[VALIDATION_ERROR_12200682]); + HandleToUint64(framebuffer->framebuffer), VALIDATION_ERROR_12200682, + "Attachment %d aliases attachment %d but doesn't set VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT.", + attachment, other_attachment); } if (!(pCreateInfo->pAttachments[other_attachment].flags & VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT, - HandleToUint64(framebuffer->framebuffer), __LINE__, VALIDATION_ERROR_12200682, "DS", - "Attachment %d aliases attachment %d but doesn't " - "set VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT. %s", - other_attachment, attachment, validation_error_map[VALIDATION_ERROR_12200682]); + HandleToUint64(framebuffer->framebuffer), VALIDATION_ERROR_12200682, + "Attachment %d aliases attachment %d but doesn't set VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT.", + other_attachment, attachment); } } } @@ -7733,7 +8919,7 @@ if (attachmentIndices.count(attachment)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS", + DRAWSTATE_INVALID_RENDERPASS, "Cannot use same attachment (%u) as both color and depth output in same subpass (%u).", attachment, i); } } @@ -7784,13 +8970,12 @@ const VkSubpassDependency &dependency = pCreateInfo->pDependencies[i]; if (dependency.srcSubpass == VK_SUBPASS_EXTERNAL || dependency.dstSubpass == VK_SUBPASS_EXTERNAL) { if (dependency.srcSubpass == dependency.dstSubpass) { - skip |= - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS", "The src and dest subpasses cannot both be external."); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + DRAWSTATE_INVALID_RENDERPASS, "The src and dest subpasses cannot both be external."); } } else if (dependency.srcSubpass > dependency.dstSubpass) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS", + DRAWSTATE_INVALID_RENDERPASS, "Dependency graph must be specified such that an earlier pass cannot depend on a later pass."); } else if (dependency.srcSubpass == dependency.dstSubpass) { has_self_dependency[dependency.srcSubpass] = true; @@ -7808,8 +8993,7 @@ layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); bool spirv_valid; - if (PreCallValidateCreateShaderModule(dev_data, pCreateInfo, &spirv_valid)) - return VK_ERROR_VALIDATION_FAILED_EXT; + if (PreCallValidateCreateShaderModule(dev_data, pCreateInfo, &spirv_valid)) return VK_ERROR_VALIDATION_FAILED_EXT; VkResult res = dev_data->dispatch_table.CreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule); @@ -7824,10 +9008,10 @@ static bool ValidateAttachmentIndex(layer_data *dev_data, uint32_t attachment, uint32_t attachment_count, const char *type) { bool skip = false; if (attachment >= attachment_count && attachment != VK_ATTACHMENT_UNUSED) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_12200684, "DS", - "CreateRenderPass: %s attachment %d must be less than the total number of attachments %d. %s", type, - attachment, attachment_count, validation_error_map[VALIDATION_ERROR_12200684]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_12200684, + "CreateRenderPass: %s attachment %d must be less than the total number of attachments %d.", type, + attachment, attachment_count); } return skip; } @@ -7840,18 +9024,16 @@ const VkSubpassDescription &subpass = pCreateInfo->pSubpasses[i]; if (subpass.pipelineBindPoint != VK_PIPELINE_BIND_POINT_GRAPHICS) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_14000698, "DS", - "CreateRenderPass: Pipeline bind point for subpass %d must be VK_PIPELINE_BIND_POINT_GRAPHICS. %s", i, - validation_error_map[VALIDATION_ERROR_14000698]); + VALIDATION_ERROR_14000698, + "CreateRenderPass: Pipeline bind point for subpass %d must be VK_PIPELINE_BIND_POINT_GRAPHICS.", i); } for (uint32_t j = 0; j < subpass.preserveAttachmentCount; ++j) { uint32_t attachment = subpass.pPreserveAttachments[j]; if (attachment == VK_ATTACHMENT_UNUSED) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_140006aa, "DS", - "CreateRenderPass: Preserve attachment (%d) must not be VK_ATTACHMENT_UNUSED. %s", j, - validation_error_map[VALIDATION_ERROR_140006aa]); + VALIDATION_ERROR_140006aa, + "CreateRenderPass: Preserve attachment (%d) must not be VK_ATTACHMENT_UNUSED.", j); } else { skip |= ValidateAttachmentIndex(dev_data, attachment, pCreateInfo->attachmentCount, "Preserve"); @@ -7865,10 +9047,10 @@ } if (found) { skip |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_140006ac, "DS", - "CreateRenderPass: subpass %u pPreserveAttachments[%u] (%u) must not be used elsewhere in the subpass. %s", - i, j, attachment, validation_error_map[VALIDATION_ERROR_140006ac]); + dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_140006ac, + "CreateRenderPass: subpass %u pPreserveAttachments[%u] (%u) must not be used elsewhere in the subpass.", i, + j, attachment); } } } @@ -7889,20 +9071,19 @@ if (!skip && attachment != VK_ATTACHMENT_UNUSED && pCreateInfo->pAttachments[attachment].samples != VK_SAMPLE_COUNT_1_BIT) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, - 0, __LINE__, VALIDATION_ERROR_140006a2, "DS", - "CreateRenderPass: Subpass %u requests multisample resolve into attachment %u, " - "which must have VK_SAMPLE_COUNT_1_BIT but has %s. %s", - i, attachment, string_VkSampleCountFlagBits(pCreateInfo->pAttachments[attachment].samples), - validation_error_map[VALIDATION_ERROR_140006a2]); + 0, VALIDATION_ERROR_140006a2, + "CreateRenderPass: Subpass %u requests multisample resolve into attachment %u, which must " + "have VK_SAMPLE_COUNT_1_BIT but has %s.", + i, attachment, string_VkSampleCountFlagBits(pCreateInfo->pAttachments[attachment].samples)); } if (!skip && subpass.pResolveAttachments[j].attachment != VK_ATTACHMENT_UNUSED && subpass.pColorAttachments[j].attachment == VK_ATTACHMENT_UNUSED) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, - 0, __LINE__, VALIDATION_ERROR_1400069e, "DS", - "CreateRenderPass: Subpass %u requests multisample resolve from attachment %u " - "which has attachment=VK_ATTACHMENT_UNUSED. %s", - i, attachment, validation_error_map[VALIDATION_ERROR_1400069e]); + 0, VALIDATION_ERROR_1400069e, + "CreateRenderPass: Subpass %u requests multisample resolve from attachment %u which has " + "attachment=VK_ATTACHMENT_UNUSED.", + i, attachment); } } attachment = subpass.pColorAttachments[j].attachment; @@ -7913,36 +9094,35 @@ if (subpass_performs_resolve && pCreateInfo->pAttachments[attachment].samples == VK_SAMPLE_COUNT_1_BIT) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, - 0, __LINE__, VALIDATION_ERROR_140006a0, "DS", - "CreateRenderPass: Subpass %u requests multisample resolve from attachment %u " - "which has VK_SAMPLE_COUNT_1_BIT. %s", - i, attachment, validation_error_map[VALIDATION_ERROR_140006a0]); + 0, VALIDATION_ERROR_140006a0, + "CreateRenderPass: Subpass %u requests multisample resolve from attachment %u which has " + "VK_SAMPLE_COUNT_1_BIT.", + i, attachment); } if (subpass_performs_resolve && subpass.pResolveAttachments[j].attachment != VK_ATTACHMENT_UNUSED) { const auto &color_desc = pCreateInfo->pAttachments[attachment]; const auto &resolve_desc = pCreateInfo->pAttachments[subpass.pResolveAttachments[j].attachment]; if (color_desc.format != resolve_desc.format) { - skip |= - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, - 0, __LINE__, VALIDATION_ERROR_140006a4, "DS", - "CreateRenderPass: Subpass %u pColorAttachments[%u] resolves to an attachment with a " - "different format. " - "color format: %u, resolve format: %u. %s", - i, j, color_desc.format, resolve_desc.format, validation_error_map[VALIDATION_ERROR_140006a4]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, VALIDATION_ERROR_140006a4, + "CreateRenderPass: Subpass %u pColorAttachments[%u] resolves to an attachment with a " + "different format. color format: %u, resolve format: %u.", + i, j, color_desc.format, resolve_desc.format); } } - if (dev_data->extensions.vk_amd_mixed_attachment_samples && - subpass.pDepthStencilAttachment && subpass.pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) { - const auto depth_stencil_sample_count = pCreateInfo->pAttachments[subpass.pDepthStencilAttachment->attachment].samples; + if (dev_data->extensions.vk_amd_mixed_attachment_samples && subpass.pDepthStencilAttachment && + subpass.pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) { + const auto depth_stencil_sample_count = + pCreateInfo->pAttachments[subpass.pDepthStencilAttachment->attachment].samples; if (pCreateInfo->pAttachments[attachment].samples > depth_stencil_sample_count) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_14000bc4, "DS", + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, VALIDATION_ERROR_14000bc4, "CreateRenderPass: Subpass %u pColorAttachments[%u] has %s which is larger than " - "depth/stencil attachment %s. %s", + "depth/stencil attachment %s.", i, j, string_VkSampleCountFlagBits(pCreateInfo->pAttachments[attachment].samples), - string_VkSampleCountFlagBits(depth_stencil_sample_count), validation_error_map[VALIDATION_ERROR_14000bc4]); + string_VkSampleCountFlagBits(depth_stencil_sample_count)); } } } @@ -7962,26 +9142,19 @@ skip |= ValidateAttachmentIndex(dev_data, attachment, pCreateInfo->attachmentCount, "Input"); } - if (!dev_data->extensions.vk_amd_mixed_attachment_samples && - sample_count && !IsPowerOfTwo(sample_count)) { + if (!dev_data->extensions.vk_amd_mixed_attachment_samples && sample_count && !IsPowerOfTwo(sample_count)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_0082b401, "DS", - "CreateRenderPass: Subpass %u attempts to render to " - "attachments with inconsistent sample counts. %s", - i, validation_error_map[VALIDATION_ERROR_0082b401]); + VALIDATION_ERROR_0082b401, + "CreateRenderPass: Subpass %u attempts to render to attachments with inconsistent sample counts.", i); } } return skip; } -static void MarkAttachmentFirstUse(RENDER_PASS_STATE *render_pass, - uint32_t index, - bool is_read) { - if (index == VK_ATTACHMENT_UNUSED) - return; +static void MarkAttachmentFirstUse(RENDER_PASS_STATE *render_pass, uint32_t index, bool is_read) { + if (index == VK_ATTACHMENT_UNUSED) return; - if (!render_pass->attachment_first_read.count(index)) - render_pass->attachment_first_read[index] = is_read; + if (!render_pass->attachment_first_read.count(index)) render_pass->attachment_first_read[index] = is_read; } VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, @@ -8052,8 +9225,8 @@ bool skip = false; if (pCB->createInfo.level != VK_COMMAND_BUFFER_LEVEL_PRIMARY) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pCB->commandBuffer), __LINE__, error_code, "DS", - "Cannot execute command %s on a secondary command buffer. %s", cmd_name, validation_error_map[error_code]); + HandleToUint64(pCB->commandBuffer), error_code, "Cannot execute command %s on a secondary command buffer.", + cmd_name); } return skip; } @@ -8067,11 +9240,10 @@ pRenderPassBegin->renderArea.offset.y < 0 || (pRenderPassBegin->renderArea.offset.y + pRenderPassBegin->renderArea.extent.height) > pFramebufferInfo->height) { skip |= static_cast(log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - DRAWSTATE_INVALID_RENDER_AREA, "CORE", - "Cannot execute a render pass with renderArea not within the bound of the " - "framebuffer. RenderArea: x %d, y %d, width %d, height %d. Framebuffer: width %d, " - "height %d.", + dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + DRAWSTATE_INVALID_RENDER_AREA, + "Cannot execute a render pass with renderArea not within the bound of the framebuffer. RenderArea: x %d, y %d, width " + "%d, height %d. Framebuffer: width %d, height %d.", pRenderPassBegin->renderArea.offset.x, pRenderPassBegin->renderArea.offset.y, pRenderPassBegin->renderArea.extent.width, pRenderPassBegin->renderArea.extent.height, pFramebufferInfo->width, pFramebufferInfo->height)); } @@ -8089,8 +9261,7 @@ bool check_color_depth_load_op = !FormatIsStencilOnly(format); bool check_stencil_load_op = FormatIsDepthAndStencil(format) || !check_color_depth_load_op; - return ((check_color_depth_load_op && (color_depth_op == op)) || - (check_stencil_load_op && (stencil_op == op))); + return ((check_color_depth_load_op && (color_depth_op == op)) || (check_stencil_load_op && (stencil_op == op))); } VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, @@ -8140,17 +9311,16 @@ } } if (clear_op_size > pRenderPassBegin->clearValueCount) { - skip |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, - HandleToUint64(render_pass_state->renderPass), __LINE__, VALIDATION_ERROR_1200070c, "DS", - "In vkCmdBeginRenderPass() the VkRenderPassBeginInfo struct has a clearValueCount of %u but there must " - "be at least %u entries in pClearValues array to account for the highest index attachment in renderPass " - "0x%" PRIx64 - " that uses VK_ATTACHMENT_LOAD_OP_CLEAR is %u. Note that the pClearValues array " - "is indexed by attachment number so even if some pClearValues entries between 0 and %u correspond to " - "attachments that aren't cleared they will be ignored. %s", - pRenderPassBegin->clearValueCount, clear_op_size, HandleToUint64(render_pass_state->renderPass), clear_op_size, - clear_op_size - 1, validation_error_map[VALIDATION_ERROR_1200070c]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, + HandleToUint64(render_pass_state->renderPass), VALIDATION_ERROR_1200070c, + "In vkCmdBeginRenderPass() the VkRenderPassBeginInfo struct has a clearValueCount of %u but there " + "must be at least %u entries in pClearValues array to account for the highest index attachment in " + "renderPass 0x%" PRIx64 + " that uses VK_ATTACHMENT_LOAD_OP_CLEAR is %u. Note that the pClearValues array is indexed by " + "attachment number so even if some pClearValues entries between 0 and %u correspond to attachments " + "that aren't cleared they will be ignored.", + pRenderPassBegin->clearValueCount, clear_op_size, HandleToUint64(render_pass_state->renderPass), + clear_op_size, clear_op_size - 1); } skip |= VerifyRenderAreaBounds(dev_data, pRenderPassBegin); skip |= VerifyFramebufferAndRenderPassLayouts(dev_data, cb_node, pRenderPassBegin, @@ -8201,9 +9371,8 @@ auto subpassCount = pCB->activeRenderPass->createInfo.subpassCount; if (pCB->activeSubpass == subpassCount - 1) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_1b60071a, "DS", - "vkCmdNextSubpass(): Attempted to advance beyond final subpass. %s", - validation_error_map[VALIDATION_ERROR_1b60071a]); + HandleToUint64(commandBuffer), VALIDATION_ERROR_1b60071a, + "vkCmdNextSubpass(): Attempted to advance beyond final subpass."); } } lock.unlock(); @@ -8233,9 +9402,8 @@ if (rp_state) { if (pCB->activeSubpass != rp_state->createInfo.subpassCount - 1) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(commandBuffer), __LINE__, - VALIDATION_ERROR_1b00071c, "DS", "vkCmdEndRenderPass(): Called before reaching final subpass. %s", - validation_error_map[VALIDATION_ERROR_1b00071c]); + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(commandBuffer), + VALIDATION_ERROR_1b00071c, "vkCmdEndRenderPass(): Called before reaching final subpass."); } for (size_t i = 0; i < rp_state->createInfo.attachmentCount; ++i) { @@ -8289,20 +9457,19 @@ if (secondary_fb != VK_NULL_HANDLE) { if (primary_fb != secondary_fb) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(primaryBuffer), __LINE__, VALIDATION_ERROR_1b2000c6, "DS", + HandleToUint64(primaryBuffer), VALIDATION_ERROR_1b2000c6, "vkCmdExecuteCommands() called w/ invalid secondary command buffer 0x%" PRIx64 " which has a framebuffer 0x%" PRIx64 - " that is not the same as the primary command buffer's current active framebuffer 0x%" PRIx64 ". %s", - HandleToUint64(secondaryBuffer), HandleToUint64(secondary_fb), HandleToUint64(primary_fb), - validation_error_map[VALIDATION_ERROR_1b2000c6]); + " that is not the same as the primary command buffer's current active framebuffer 0x%" PRIx64 ".", + HandleToUint64(secondaryBuffer), HandleToUint64(secondary_fb), HandleToUint64(primary_fb)); } auto fb = GetFramebufferState(dev_data, secondary_fb); if (!fb) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(primaryBuffer), __LINE__, DRAWSTATE_INVALID_SECONDARY_COMMAND_BUFFER, "DS", - "vkCmdExecuteCommands() called w/ invalid Cmd Buffer 0x%p " - "which has invalid framebuffer 0x%" PRIx64 ".", - (void *)secondaryBuffer, HandleToUint64(secondary_fb)); + HandleToUint64(primaryBuffer), DRAWSTATE_INVALID_SECONDARY_COMMAND_BUFFER, + "vkCmdExecuteCommands() called w/ invalid Cmd Buffer 0x%" PRIx64 + " which has invalid framebuffer 0x%" PRIx64 ".", + HandleToUint64(secondaryBuffer), HandleToUint64(secondary_fb)); return skip; } } @@ -8321,12 +9488,11 @@ if ((cmdBufStatistics & queryPoolData->second.createInfo.pipelineStatistics) != cmdBufStatistics) { skip |= log_msg( dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pCB->commandBuffer), __LINE__, VALIDATION_ERROR_1b2000d0, "DS", - "vkCmdExecuteCommands() called w/ invalid Cmd Buffer 0x%p " - "which has invalid active query pool 0x%" PRIx64 - ". Pipeline statistics is being queried so the command " - "buffer must have all bits set on the queryPool. %s", - pCB->commandBuffer, HandleToUint64(queryPoolData->first), validation_error_map[VALIDATION_ERROR_1b2000d0]); + HandleToUint64(pCB->commandBuffer), VALIDATION_ERROR_1b2000d0, + "vkCmdExecuteCommands() called w/ invalid Cmd Buffer 0x%" PRIx64 + " which has invalid active query pool 0x%" PRIx64 + ". Pipeline statistics is being queried so the command buffer must have all bits set on the queryPool.", + HandleToUint64(pCB->commandBuffer), HandleToUint64(queryPoolData->first)); } } activeTypes.insert(queryPoolData->second.createInfo.queryType); @@ -8336,25 +9502,24 @@ auto queryPoolData = dev_data->queryPoolMap.find(queryObject.pool); if (queryPoolData != dev_data->queryPoolMap.end() && activeTypes.count(queryPoolData->second.createInfo.queryType)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pCB->commandBuffer), __LINE__, DRAWSTATE_INVALID_SECONDARY_COMMAND_BUFFER, "DS", - "vkCmdExecuteCommands() called w/ invalid Cmd Buffer 0x%p " - "which has invalid active query pool 0x%" PRIx64 - "of type %d but a query of that type has been started on " - "secondary Cmd Buffer 0x%p.", - pCB->commandBuffer, HandleToUint64(queryPoolData->first), queryPoolData->second.createInfo.queryType, - pSubCB->commandBuffer); + HandleToUint64(pCB->commandBuffer), DRAWSTATE_INVALID_SECONDARY_COMMAND_BUFFER, + "vkCmdExecuteCommands() called w/ invalid Cmd Buffer 0x%" PRIx64 + " which has invalid active query pool 0x%" PRIx64 + " of type %d but a query of that type has been started on secondary Cmd Buffer 0x%" PRIx64 ".", + HandleToUint64(pCB->commandBuffer), HandleToUint64(queryPoolData->first), + queryPoolData->second.createInfo.queryType, HandleToUint64(pSubCB->commandBuffer)); } } auto primary_pool = GetCommandPoolNode(dev_data, pCB->createInfo.commandPool); auto secondary_pool = GetCommandPoolNode(dev_data, pSubCB->createInfo.commandPool); if (primary_pool && secondary_pool && (primary_pool->queueFamilyIndex != secondary_pool->queueFamilyIndex)) { - skip |= - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pSubCB->commandBuffer), __LINE__, DRAWSTATE_INVALID_QUEUE_FAMILY, "DS", - "vkCmdExecuteCommands(): Primary command buffer 0x%p" - " created in queue family %d has secondary command buffer 0x%p created in queue family %d.", - pCB->commandBuffer, primary_pool->queueFamilyIndex, pSubCB->commandBuffer, secondary_pool->queueFamilyIndex); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(pSubCB->commandBuffer), DRAWSTATE_INVALID_QUEUE_FAMILY, + "vkCmdExecuteCommands(): Primary command buffer 0x%" PRIx64 + " created in queue family %d has secondary command buffer 0x%" PRIx64 " created in queue family %d.", + HandleToUint64(pCB->commandBuffer), primary_pool->queueFamilyIndex, HandleToUint64(pSubCB->commandBuffer), + secondary_pool->queueFamilyIndex); } return skip; @@ -8374,22 +9539,22 @@ if (VK_COMMAND_BUFFER_LEVEL_PRIMARY == pSubCB->createInfo.level) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pCommandBuffers[i]), __LINE__, VALIDATION_ERROR_1b2000b0, "DS", - "vkCmdExecuteCommands() called w/ Primary Cmd Buffer 0x%p in element %u of pCommandBuffers " - "array. All cmd buffers in pCommandBuffers array must be secondary. %s", - pCommandBuffers[i], i, validation_error_map[VALIDATION_ERROR_1b2000b0]); + HandleToUint64(pCommandBuffers[i]), VALIDATION_ERROR_1b2000b0, + "vkCmdExecuteCommands() called w/ Primary Cmd Buffer 0x%" PRIx64 + " in element %u of pCommandBuffers array. All cmd buffers in pCommandBuffers array must be secondary.", + HandleToUint64(pCommandBuffers[i]), i); } else if (pCB->activeRenderPass) { // Secondary CB w/i RenderPass must have *CONTINUE_BIT set if (pSubCB->beginInfo.pInheritanceInfo != nullptr) { auto secondary_rp_state = GetRenderPassState(dev_data, pSubCB->beginInfo.pInheritanceInfo->renderPass); if (!(pSubCB->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT)) { - skip |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pCommandBuffers[i]), __LINE__, VALIDATION_ERROR_1b2000c0, "DS", - "vkCmdExecuteCommands(): Secondary Command Buffer (0x%p) executed within render pass (0x%" PRIxLEAST64 - ") must have had vkBeginCommandBuffer() called w/ VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT " - "set. %s", - pCommandBuffers[i], HandleToUint64(pCB->activeRenderPass->renderPass), - validation_error_map[VALIDATION_ERROR_1b2000c0]); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(pCommandBuffers[i]), + VALIDATION_ERROR_1b2000c0, + "vkCmdExecuteCommands(): Secondary Command Buffer (0x%" PRIx64 + ") executed within render pass (0x%" PRIx64 + ") must have had vkBeginCommandBuffer() called w/ " + "VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT set.", + HandleToUint64(pCommandBuffers[i]), HandleToUint64(pCB->activeRenderPass->renderPass)); } else { // Make sure render pass is compatible with parent command buffer pass if has continue if (pCB->activeRenderPass->renderPass != secondary_rp_state->renderPass) { @@ -8400,10 +9565,10 @@ // If framebuffer for secondary CB is not NULL, then it must match active FB from primaryCB skip |= validateFramebuffer(dev_data, commandBuffer, pCB, pCommandBuffers[i], pSubCB, "vkCmdExecuteCommands()"); - if (VK_NULL_HANDLE == pSubCB->activeFramebuffer) { + if (!pSubCB->cmd_execute_commands_functions.empty()) { // Inherit primary's activeFramebuffer and while running validate functions for (auto &function : pSubCB->cmd_execute_commands_functions) { - skip |= function(pCB->activeFramebuffer); + skip |= function(pCB, pCB->activeFramebuffer); } } } @@ -8415,34 +9580,33 @@ if (!(pSubCB->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT)) { if (pSubCB->in_use.load() || pCB->linkedCommandBuffers.count(pSubCB)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(pCB->commandBuffer), __LINE__, - VALIDATION_ERROR_1b2000b4, "DS", - "Attempt to simultaneously execute command buffer 0x%p" - " without VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT set! %s", - pCB->commandBuffer, validation_error_map[VALIDATION_ERROR_1b2000b4]); + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(pCB->commandBuffer), + VALIDATION_ERROR_1b2000b4, + "Attempt to simultaneously execute command buffer 0x%" PRIx64 + " without VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT set!", + HandleToUint64(pCB->commandBuffer)); } if (pCB->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT) { // Warn that non-simultaneous secondary cmd buffer renders primary non-simultaneous - skip |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pCommandBuffers[i]), __LINE__, DRAWSTATE_INVALID_CB_SIMULTANEOUS_USE, "DS", - "vkCmdExecuteCommands(): Secondary Command Buffer (0x%p) " - "does not have VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT set and will cause primary command buffer " - "(0x%p) to be treated as if it does not have VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT " - "set, even though it does.", - pCommandBuffers[i], pCB->commandBuffer); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(pCommandBuffers[i]), + DRAWSTATE_INVALID_CB_SIMULTANEOUS_USE, + "vkCmdExecuteCommands(): Secondary Command Buffer (0x%" PRIx64 + ") does not have VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT set and will cause primary " + "command buffer (0x%" PRIx64 + ") to be treated as if it does not have VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT set, even " + "though it does.", + HandleToUint64(pCommandBuffers[i]), HandleToUint64(pCB->commandBuffer)); pCB->beginInfo.flags &= ~VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT; } } if (!pCB->activeQueries.empty() && !dev_data->enabled_features.inheritedQueries) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(pCommandBuffers[i]), __LINE__, VALIDATION_ERROR_1b2000ca, "DS", - "vkCmdExecuteCommands(): Secondary Command Buffer " - "(0x%p) cannot be submitted with a query in " - "flight and inherited queries not " - "supported on this device. %s", - pCommandBuffers[i], validation_error_map[VALIDATION_ERROR_1b2000ca]); + HandleToUint64(pCommandBuffers[i]), VALIDATION_ERROR_1b2000ca, + "vkCmdExecuteCommands(): Secondary Command Buffer (0x%" PRIx64 + ") cannot be submitted with a query in flight and inherited queries not supported on this device.", + HandleToUint64(pCommandBuffers[i])); } // TODO: separate validate from update! This is very tangled. // Propagate layout transitions to the primary cmd buffer @@ -8497,9 +9661,9 @@ if ((dev_data->phys_dev_mem_props.memoryTypes[mem_info->alloc_info.memoryTypeIndex].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0) { skip = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(mem), __LINE__, VALIDATION_ERROR_31200554, "MEM", - "Mapping Memory without VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT set: mem obj 0x%" PRIxLEAST64 ". %s", - HandleToUint64(mem), validation_error_map[VALIDATION_ERROR_31200554]); + HandleToUint64(mem), VALIDATION_ERROR_31200554, + "Mapping Memory without VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT set: mem obj 0x%" PRIx64 ".", + HandleToUint64(mem)); } } skip |= ValidateMapMemRange(dev_data, mem, offset, size); @@ -8538,14 +9702,12 @@ if (mem_info) { if (pMemRanges[i].size == VK_WHOLE_SIZE) { if (mem_info->mem_range.offset > pMemRanges[i].offset) { - skip |= - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(pMemRanges[i].memory), __LINE__, VALIDATION_ERROR_0c20055c, "MEM", - "%s: Flush/Invalidate offset (" PRINTF_SIZE_T_SPECIFIER - ") is less than Memory Object's offset " - "(" PRINTF_SIZE_T_SPECIFIER "). %s", - funcName, static_cast(pMemRanges[i].offset), - static_cast(mem_info->mem_range.offset), validation_error_map[VALIDATION_ERROR_0c20055c]); + skip |= log_msg( + dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, + HandleToUint64(pMemRanges[i].memory), VALIDATION_ERROR_0c20055c, + "%s: Flush/Invalidate offset (" PRINTF_SIZE_T_SPECIFIER + ") is less than Memory Object's offset (" PRINTF_SIZE_T_SPECIFIER ").", + funcName, static_cast(pMemRanges[i].offset), static_cast(mem_info->mem_range.offset)); } } else { const uint64_t data_end = (mem_info->mem_range.size == VK_WHOLE_SIZE) @@ -8555,13 +9717,11 @@ (data_end < (pMemRanges[i].offset + pMemRanges[i].size))) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(pMemRanges[i].memory), __LINE__, VALIDATION_ERROR_0c20055a, "MEM", + HandleToUint64(pMemRanges[i].memory), VALIDATION_ERROR_0c20055a, "%s: Flush/Invalidate size or offset (" PRINTF_SIZE_T_SPECIFIER ", " PRINTF_SIZE_T_SPECIFIER - ") exceed the Memory Object's upper-bound " - "(" PRINTF_SIZE_T_SPECIFIER "). %s", + ") exceed the Memory Object's upper-bound (" PRINTF_SIZE_T_SPECIFIER ").", funcName, static_cast(pMemRanges[i].offset + pMemRanges[i].size), - static_cast(pMemRanges[i].offset), static_cast(data_end), - validation_error_map[VALIDATION_ERROR_0c20055a]); + static_cast(pMemRanges[i].offset), static_cast(data_end)); } } } @@ -8582,18 +9742,18 @@ char *data = static_cast(mem_info->shadow_copy); for (uint64_t j = 0; j < mem_info->shadow_pad_size; ++j) { if (data[j] != NoncoherentMemoryFillValue) { - skip |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(mem_ranges[i].memory), __LINE__, MEMTRACK_INVALID_MAP, "MEM", - "Memory underflow was detected on mem obj 0x%" PRIxLEAST64, HandleToUint64(mem_ranges[i].memory)); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, HandleToUint64(mem_ranges[i].memory), + MEMTRACK_INVALID_MAP, "Memory underflow was detected on mem obj 0x%" PRIx64, + HandleToUint64(mem_ranges[i].memory)); } } for (uint64_t j = (size + mem_info->shadow_pad_size); j < (2 * mem_info->shadow_pad_size + size); ++j) { if (data[j] != NoncoherentMemoryFillValue) { - skip |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(mem_ranges[i].memory), __LINE__, MEMTRACK_INVALID_MAP, "MEM", - "Memory overflow was detected on mem obj 0x%" PRIxLEAST64, HandleToUint64(mem_ranges[i].memory)); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, HandleToUint64(mem_ranges[i].memory), + MEMTRACK_INVALID_MAP, "Memory overflow was detected on mem obj 0x%" PRIx64, + HandleToUint64(mem_ranges[i].memory)); } } memcpy(mem_info->p_driver_data, static_cast(data + mem_info->shadow_pad_size), (size_t)(size)); @@ -8623,17 +9783,17 @@ uint64_t atom_size = dev_data->phys_dev_properties.properties.limits.nonCoherentAtomSize; if (SafeModulo(mem_ranges[i].offset, atom_size) != 0) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(mem_ranges->memory), __LINE__, VALIDATION_ERROR_0c20055e, "MEM", + HandleToUint64(mem_ranges->memory), VALIDATION_ERROR_0c20055e, "%s: Offset in pMemRanges[%d] is 0x%" PRIxLEAST64 - ", which is not a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize (0x%" PRIxLEAST64 "). %s", - func_name, i, mem_ranges[i].offset, atom_size, validation_error_map[VALIDATION_ERROR_0c20055e]); + ", which is not a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize (0x%" PRIxLEAST64 ").", + func_name, i, mem_ranges[i].offset, atom_size); } if ((mem_ranges[i].size != VK_WHOLE_SIZE) && (SafeModulo(mem_ranges[i].size, atom_size) != 0)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - HandleToUint64(mem_ranges->memory), __LINE__, VALIDATION_ERROR_0c200560, "MEM", + HandleToUint64(mem_ranges->memory), VALIDATION_ERROR_0c200adc, "%s: Size in pMemRanges[%d] is 0x%" PRIxLEAST64 - ", which is not a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize (0x%" PRIxLEAST64 "). %s", - func_name, i, mem_ranges[i].size, atom_size, validation_error_map[VALIDATION_ERROR_0c200560]); + ", which is not a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize (0x%" PRIxLEAST64 ").", + func_name, i, mem_ranges[i].size, atom_size); } } return skip; @@ -8689,22 +9849,22 @@ } static bool PreCallValidateBindImageMemory(layer_data *dev_data, VkImage image, IMAGE_STATE *image_state, VkDeviceMemory mem, - VkDeviceSize memoryOffset) { + VkDeviceSize memoryOffset, const char *api_name) { bool skip = false; if (image_state) { unique_lock_t lock(global_lock); // Track objects tied to memory uint64_t image_handle = HandleToUint64(image); - skip = ValidateSetMemBinding(dev_data, mem, image_handle, kVulkanObjectTypeImage, "vkBindImageMemory()"); + skip = ValidateSetMemBinding(dev_data, mem, image_handle, kVulkanObjectTypeImage, api_name); if (!image_state->memory_requirements_checked) { // There's not an explicit requirement in the spec to call vkGetImageMemoryRequirements() prior to calling // BindImageMemory but it's implied in that memory being bound must conform with VkMemoryRequirements from // vkGetImageMemoryRequirements() skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - image_handle, __LINE__, DRAWSTATE_INVALID_IMAGE, "DS", - "vkBindImageMemory(): Binding memory to image 0x%" PRIxLEAST64 + image_handle, DRAWSTATE_INVALID_IMAGE, + "%s: Binding memory to image 0x%" PRIx64 " but vkGetImageMemoryRequirements() has not been called on that image.", - image_handle); + api_name, HandleToUint64(image_handle)); // Make the call for them so we can verify the state lock.unlock(); dev_data->dispatch_table.GetImageMemoryRequirements(dev_data->device, image, &image_state->requirements); @@ -8715,39 +9875,54 @@ auto mem_info = GetMemObjInfo(dev_data, mem); if (mem_info) { skip |= ValidateInsertImageMemoryRange(dev_data, image, mem_info, memoryOffset, image_state->requirements, - image_state->createInfo.tiling == VK_IMAGE_TILING_LINEAR, "vkBindImageMemory()"); - skip |= ValidateMemoryTypes(dev_data, mem_info, image_state->requirements.memoryTypeBits, "vkBindImageMemory()", + image_state->createInfo.tiling == VK_IMAGE_TILING_LINEAR, api_name); + skip |= ValidateMemoryTypes(dev_data, mem_info, image_state->requirements.memoryTypeBits, api_name, VALIDATION_ERROR_1740082e); } // Validate memory requirements alignment if (SafeModulo(memoryOffset, image_state->requirements.alignment) != 0) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - image_handle, __LINE__, VALIDATION_ERROR_17400830, "DS", - "vkBindImageMemory(): memoryOffset is 0x%" PRIxLEAST64 - " but must be an integer multiple of the " - "VkMemoryRequirements::alignment value 0x%" PRIxLEAST64 - ", returned from a call to vkGetImageMemoryRequirements with image. %s", - memoryOffset, image_state->requirements.alignment, validation_error_map[VALIDATION_ERROR_17400830]); + image_handle, VALIDATION_ERROR_17400830, + "%s: memoryOffset is 0x%" PRIxLEAST64 + " but must be an integer multiple of the VkMemoryRequirements::alignment value 0x%" PRIxLEAST64 + ", returned from a call to vkGetImageMemoryRequirements with image.", + api_name, memoryOffset, image_state->requirements.alignment); } - // Validate memory requirements size - if (image_state->requirements.size > mem_info->alloc_info.allocationSize - memoryOffset) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - image_handle, __LINE__, VALIDATION_ERROR_17400832, "DS", - "vkBindImageMemory(): memory size minus memoryOffset is 0x%" PRIxLEAST64 - " but must be at least as large as " - "VkMemoryRequirements::size value 0x%" PRIxLEAST64 - ", returned from a call to vkGetImageMemoryRequirements with image. %s", - mem_info->alloc_info.allocationSize - memoryOffset, image_state->requirements.size, - validation_error_map[VALIDATION_ERROR_17400832]); + if (mem_info) { + // Validate memory requirements size + if (image_state->requirements.size > mem_info->alloc_info.allocationSize - memoryOffset) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + image_handle, VALIDATION_ERROR_17400832, + "%s: memory size minus memoryOffset is 0x%" PRIxLEAST64 + " but must be at least as large as VkMemoryRequirements::size value 0x%" PRIxLEAST64 + ", returned from a call to vkGetImageMemoryRequirements with image.", + api_name, mem_info->alloc_info.allocationSize - memoryOffset, image_state->requirements.size); + } + + // Validate dedicated allocation + if (mem_info->is_dedicated && ((mem_info->dedicated_image != image) || (memoryOffset != 0))) { + // TODO: Add vkBindImageMemory2KHR error message when added to spec. + auto validation_error = VALIDATION_ERROR_UNDEFINED; + if (strcmp(api_name, "vkBindImageMemory()") == 0) { + validation_error = VALIDATION_ERROR_17400bca; + } + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, + image_handle, validation_error, + "%s: for dedicated memory allocation 0x%" PRIxLEAST64 + ", VkMemoryDedicatedAllocateInfoKHR::image 0x%" PRIXLEAST64 " must be equal to image 0x%" PRIxLEAST64 + " and memoryOffset 0x%" PRIxLEAST64 " must be zero.", + api_name, HandleToUint64(mem), HandleToUint64(mem_info->dedicated_image), image_handle, memoryOffset); + } } } return skip; } static void PostCallRecordBindImageMemory(layer_data *dev_data, VkImage image, IMAGE_STATE *image_state, VkDeviceMemory mem, - VkDeviceSize memoryOffset) { + VkDeviceSize memoryOffset, const char *api_name) { if (image_state) { unique_lock_t lock(global_lock); // Track bound memory range information @@ -8759,23 +9934,77 @@ // Track objects tied to memory uint64_t image_handle = HandleToUint64(image); - SetMemBinding(dev_data, mem, image_handle, kVulkanObjectTypeImage, "vkBindImageMemory()"); - - image_state->binding.mem = mem; - image_state->binding.offset = memoryOffset; - image_state->binding.size = image_state->requirements.size; + SetMemBinding(dev_data, mem, image_state, memoryOffset, image_handle, kVulkanObjectTypeImage, api_name); } } VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize memoryOffset) { layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; - auto image_state = GetImageState(dev_data, image); - bool skip = PreCallValidateBindImageMemory(dev_data, image, image_state, mem, memoryOffset); + IMAGE_STATE *image_state; + { + unique_lock_t lock(global_lock); + image_state = GetImageState(dev_data, image); + } + bool skip = PreCallValidateBindImageMemory(dev_data, image, image_state, mem, memoryOffset, "vkBindImageMemory()"); if (!skip) { result = dev_data->dispatch_table.BindImageMemory(device, image, mem, memoryOffset); if (result == VK_SUCCESS) { - PostCallRecordBindImageMemory(dev_data, image, image_state, mem, memoryOffset); + PostCallRecordBindImageMemory(dev_data, image, image_state, mem, memoryOffset, "vkBindImageMemory()"); + } + } + return result; +} + +static bool PreCallValidateBindImageMemory2(layer_data *dev_data, std::vector *image_state, uint32_t bindInfoCount, + const VkBindImageMemoryInfoKHR *pBindInfos) { + { + unique_lock_t lock(global_lock); + for (uint32_t i = 0; i < bindInfoCount; i++) { + (*image_state)[i] = GetImageState(dev_data, pBindInfos[i].image); + } + } + bool skip = false; + char api_name[128]; + for (uint32_t i = 0; i < bindInfoCount; i++) { + sprintf(api_name, "vkBindImageMemory2() pBindInfos[%u]", i); + skip |= PreCallValidateBindImageMemory(dev_data, pBindInfos[i].image, (*image_state)[i], pBindInfos[i].memory, + pBindInfos[i].memoryOffset, api_name); + } + return skip; +} + +static void PostCallRecordBindImageMemory2(layer_data *dev_data, const std::vector &image_state, + uint32_t bindInfoCount, const VkBindImageMemoryInfoKHR *pBindInfos) { + for (uint32_t i = 0; i < bindInfoCount; i++) { + PostCallRecordBindImageMemory(dev_data, pBindInfos[i].image, image_state[i], pBindInfos[i].memory, + pBindInfos[i].memoryOffset, "vkBindImageMemory2()"); + } +} + +VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory2(VkDevice device, uint32_t bindInfoCount, + const VkBindImageMemoryInfoKHR *pBindInfos) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + std::vector image_state(bindInfoCount); + if (!PreCallValidateBindImageMemory2(dev_data, &image_state, bindInfoCount, pBindInfos)) { + result = dev_data->dispatch_table.BindImageMemory2(device, bindInfoCount, pBindInfos); + if (result == VK_SUCCESS) { + PostCallRecordBindImageMemory2(dev_data, image_state, bindInfoCount, pBindInfos); + } + } + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount, + const VkBindImageMemoryInfoKHR *pBindInfos) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + std::vector image_state(bindInfoCount); + if (!PreCallValidateBindImageMemory2(dev_data, &image_state, bindInfoCount, pBindInfos)) { + result = dev_data->dispatch_table.BindImageMemory2KHR(device, bindInfoCount, pBindInfos); + if (result == VK_SUCCESS) { + PostCallRecordBindImageMemory2(dev_data, image_state, bindInfoCount, pBindInfos); } } return result; @@ -8792,8 +10021,8 @@ event_state->stageMask = VK_PIPELINE_STAGE_HOST_BIT; if (event_state->write_in_use) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT, - HandleToUint64(event), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS", - "Cannot call vkSetEvent() on event 0x%" PRIxLEAST64 " that is already in use by a command buffer.", + HandleToUint64(event), DRAWSTATE_QUEUE_FORWARD_PROGRESS, + "Cannot call vkSetEvent() on event 0x%" PRIx64 " that is already in use by a command buffer.", HandleToUint64(event)); } } @@ -8834,9 +10063,9 @@ if (unsignaled_semaphores.count(semaphore) || (!(signaled_semaphores.count(semaphore)) && !(pSemaphore->signaled))) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT, - HandleToUint64(semaphore), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS", - "Queue 0x%p is waiting on semaphore 0x%" PRIx64 " that has no way to be signaled.", queue, - HandleToUint64(semaphore)); + HandleToUint64(semaphore), DRAWSTATE_QUEUE_FORWARD_PROGRESS, + "Queue 0x%" PRIx64 " is waiting on semaphore 0x%" PRIx64 " that has no way to be signaled.", + HandleToUint64(queue), HandleToUint64(semaphore)); } else { signaled_semaphores.erase(semaphore); unsignaled_semaphores.insert(semaphore); @@ -8852,16 +10081,59 @@ if (pSemaphore && pSemaphore->scope == kSyncScopeInternal) { if (signaled_semaphores.count(semaphore) || (!(unsignaled_semaphores.count(semaphore)) && pSemaphore->signaled)) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT, - HandleToUint64(semaphore), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS", - "Queue 0x%p is signaling semaphore 0x%" PRIx64 + HandleToUint64(semaphore), DRAWSTATE_QUEUE_FORWARD_PROGRESS, + "Queue 0x%" PRIx64 " is signaling semaphore 0x%" PRIx64 " that has already been signaled but not waited on by queue 0x%" PRIx64 ".", - queue, HandleToUint64(semaphore), HandleToUint64(pSemaphore->signaler.first)); + HandleToUint64(queue), HandleToUint64(semaphore), HandleToUint64(pSemaphore->signaler.first)); } else { unsignaled_semaphores.erase(semaphore); signaled_semaphores.insert(semaphore); } } } + // Store sparse binding image_state and after binding is complete make sure that any requiring metadata have it bound + std::unordered_set sparse_images; + // If we're binding sparse image memory make sure reqs were queried and note if metadata is required and bound + for (uint32_t i = 0; i < bindInfo.imageBindCount; ++i) { + const auto &opaque_bind = bindInfo.pImageOpaqueBinds[i]; + auto image_state = GetImageState(dev_data, opaque_bind.image); + sparse_images.insert(image_state); + if (!image_state->get_sparse_reqs_called || image_state->sparse_requirements.empty()) { + // For now just warning if sparse image binding occurs without calling to get reqs first + return log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(image_state->image), MEMTRACK_INVALID_STATE, + "vkQueueBindSparse(): Binding sparse memory to image 0x%" PRIx64 + " without first calling vkGetImageSparseMemoryRequirements[2KHR]() to retrieve requirements.", + HandleToUint64(image_state->image)); + } + for (uint32_t j = 0; j < opaque_bind.bindCount; ++j) { + if (opaque_bind.pBinds[j].flags & VK_IMAGE_ASPECT_METADATA_BIT) { + image_state->sparse_metadata_bound = true; + } + } + } + for (uint32_t i = 0; i < bindInfo.imageOpaqueBindCount; ++i) { + auto image_state = GetImageState(dev_data, bindInfo.pImageOpaqueBinds[i].image); + sparse_images.insert(image_state); + if (!image_state->get_sparse_reqs_called || image_state->sparse_requirements.empty()) { + // For now just warning if sparse image binding occurs without calling to get reqs first + return log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(image_state->image), MEMTRACK_INVALID_STATE, + "vkQueueBindSparse(): Binding opaque sparse memory to image 0x%" PRIx64 + " without first calling vkGetImageSparseMemoryRequirements[2KHR]() to retrieve requirements.", + HandleToUint64(image_state->image)); + } + } + for (const auto &sparse_image_state : sparse_images) { + if (sparse_image_state->sparse_metadata_required && !sparse_image_state->sparse_metadata_bound) { + // Warn if sparse image binding metadata required for image with sparse binding, but metadata not bound + return log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(sparse_image_state->image), MEMTRACK_INVALID_STATE, + "vkQueueBindSparse(): Binding sparse memory to image 0x%" PRIx64 + " which requires a metadata aspect but no binding with VK_IMAGE_ASPECT_METADATA_BIT set was made.", + HandleToUint64(sparse_image_state->image)); + } + } } return skip; @@ -8886,10 +10158,10 @@ if (!dev_data->external_sync_warning) { dev_data->external_sync_warning = true; log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT, - HandleToUint64(fence), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS", + HandleToUint64(fence), DRAWSTATE_QUEUE_FORWARD_PROGRESS, "vkQueueBindSparse(): Signaling external fence 0x%" PRIx64 " on queue 0x%" PRIx64 - " will disable validation of preceding command buffer lifecycle states and the in-use status of " - "associated objects.", + " will disable validation of preceding command buffer lifecycle states and the in-use status of associated " + "objects.", HandleToUint64(fence), HandleToUint64(queue)); } } @@ -8961,7 +10233,7 @@ if (!dev_data->external_sync_warning) { dev_data->external_sync_warning = true; log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT, - HandleToUint64(semaphore), __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS", + HandleToUint64(semaphore), DRAWSTATE_QUEUE_FORWARD_PROGRESS, "vkQueueBindSparse(): Signaling external semaphore 0x%" PRIx64 " on queue 0x%" PRIx64 " will disable validation of preceding command buffer lifecycle states and the in-use status of " "associated objects.", @@ -9109,7 +10381,7 @@ bool skip = false; if (fence_node && fence_node->scope == kSyncScopeInternal && fence_node->state == FENCE_INFLIGHT) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT, - HandleToUint64(fence), __LINE__, VALIDATION_ERROR_UNDEFINED, "DS", + HandleToUint64(fence), VALIDATION_ERROR_UNDEFINED, "Cannot call %s on fence 0x%" PRIx64 " that is currently in use.", caller_name, HandleToUint64(fence)); } return skip; @@ -9222,40 +10494,49 @@ // to present to any native window on Android; require the // application to have established support on any other platform. if (!dev_data->instance_data->extensions.vk_khr_android_surface) { - auto support_predicate = [dev_data](decltype(surface_state->gpu_queue_support)::const_reference qs) -> bool { + auto support_predicate = [dev_data](decltype(surface_state->gpu_queue_support)::value_type qs) -> bool { // TODO: should restrict search only to queue families of VkDeviceQueueCreateInfos, not whole phys. device return (qs.first.gpu == dev_data->physical_device) && qs.second; }; - const auto& support = surface_state->gpu_queue_support; + const auto &support = surface_state->gpu_queue_support; bool is_supported = std::any_of(support.begin(), support.end(), support_predicate); if (!is_supported) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(dev_data->device), __LINE__, VALIDATION_ERROR_146009ec, "DS", - "%s: pCreateInfo->surface is not known at this time to be supported for presentation by this device. " - "The vkGetPhysicalDeviceSurfaceSupportKHR() must be called beforehand, and it must return VK_TRUE support " - "with this surface for at least one queue family of this device. %s", - func_name, validation_error_map[VALIDATION_ERROR_146009ec])) + HandleToUint64(dev_data->device), VALIDATION_ERROR_146009ec, + "%s: pCreateInfo->surface is not known at this time to be supported for presentation by this device. The " + "vkGetPhysicalDeviceSurfaceSupportKHR() must be called beforehand, and it must return VK_TRUE support with " + "this surface for at least one queue family of this device.", + func_name)) return true; } } if (most_recent_swapchain != old_swapchain_state || (surface_state->old_swapchain && surface_state->swapchain)) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(dev_data->device), __LINE__, DRAWSTATE_SWAPCHAIN_ALREADY_EXISTS, "DS", + HandleToUint64(dev_data->device), DRAWSTATE_SWAPCHAIN_ALREADY_EXISTS, "%s: surface has an existing swapchain other than oldSwapchain", func_name)) return true; } if (old_swapchain_state && old_swapchain_state->createInfo.surface != pCreateInfo->surface) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, - HandleToUint64(pCreateInfo->oldSwapchain), __LINE__, DRAWSTATE_SWAPCHAIN_WRONG_SURFACE, "DS", + HandleToUint64(pCreateInfo->oldSwapchain), DRAWSTATE_SWAPCHAIN_WRONG_SURFACE, "%s: pCreateInfo->oldSwapchain's surface is not pCreateInfo->surface", func_name)) return true; } + + if ((pCreateInfo->imageExtent.width == 0) || (pCreateInfo->imageExtent.height == 0)) { + if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, + HandleToUint64(dev_data->device), VALIDATION_ERROR_14600d32, + "%s: pCreateInfo->imageExtent = (%d, %d) which is illegal.", func_name, pCreateInfo->imageExtent.width, + pCreateInfo->imageExtent.height)) + return true; + } + auto physical_device_state = GetPhysicalDeviceState(dev_data->instance_data, dev_data->physical_device); if (physical_device_state->vkGetPhysicalDeviceSurfaceCapabilitiesKHRState == UNCALLED) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, - HandleToUint64(dev_data->physical_device), __LINE__, DRAWSTATE_SWAPCHAIN_CREATE_BEFORE_QUERY, "DS", + HandleToUint64(dev_data->physical_device), DRAWSTATE_SWAPCHAIN_CREATE_BEFORE_QUERY, "%s: surface capabilities not retrieved for this physical device", func_name)) return true; } else { // have valid capabilities @@ -9263,21 +10544,19 @@ // Validate pCreateInfo->minImageCount against VkSurfaceCapabilitiesKHR::{min|max}ImageCount: if (pCreateInfo->minImageCount < capabilities.minImageCount) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(dev_data->device), __LINE__, VALIDATION_ERROR_146009ee, "DS", - "%s called with minImageCount = %d, which is outside the bounds returned " - "by vkGetPhysicalDeviceSurfaceCapabilitiesKHR() (i.e. minImageCount = %d, maxImageCount = %d). %s", - func_name, pCreateInfo->minImageCount, capabilities.minImageCount, capabilities.maxImageCount, - validation_error_map[VALIDATION_ERROR_146009ee])) + HandleToUint64(dev_data->device), VALIDATION_ERROR_146009ee, + "%s called with minImageCount = %d, which is outside the bounds returned by " + "vkGetPhysicalDeviceSurfaceCapabilitiesKHR() (i.e. minImageCount = %d, maxImageCount = %d).", + func_name, pCreateInfo->minImageCount, capabilities.minImageCount, capabilities.maxImageCount)) return true; } if ((capabilities.maxImageCount > 0) && (pCreateInfo->minImageCount > capabilities.maxImageCount)) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(dev_data->device), __LINE__, VALIDATION_ERROR_146009f0, "DS", - "%s called with minImageCount = %d, which is outside the bounds returned " - "by vkGetPhysicalDeviceSurfaceCapabilitiesKHR() (i.e. minImageCount = %d, maxImageCount = %d). %s", - func_name, pCreateInfo->minImageCount, capabilities.minImageCount, capabilities.maxImageCount, - validation_error_map[VALIDATION_ERROR_146009f0])) + HandleToUint64(dev_data->device), VALIDATION_ERROR_146009f0, + "%s called with minImageCount = %d, which is outside the bounds returned by " + "vkGetPhysicalDeviceSurfaceCapabilitiesKHR() (i.e. minImageCount = %d, maxImageCount = %d).", + func_name, pCreateInfo->minImageCount, capabilities.minImageCount, capabilities.maxImageCount)) return true; } @@ -9287,14 +10566,13 @@ (pCreateInfo->imageExtent.height < capabilities.minImageExtent.height) || (pCreateInfo->imageExtent.height > capabilities.maxImageExtent.height)) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(dev_data->device), __LINE__, VALIDATION_ERROR_146009f4, "DS", + HandleToUint64(dev_data->device), VALIDATION_ERROR_146009f4, "%s called with imageExtent = (%d,%d), which is outside the bounds returned by " "vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): currentExtent = (%d,%d), minImageExtent = (%d,%d), " - "maxImageExtent = (%d,%d). %s", + "maxImageExtent = (%d,%d).", func_name, pCreateInfo->imageExtent.width, pCreateInfo->imageExtent.height, capabilities.currentExtent.width, capabilities.currentExtent.height, capabilities.minImageExtent.width, - capabilities.minImageExtent.height, capabilities.maxImageExtent.width, capabilities.maxImageExtent.height, - validation_error_map[VALIDATION_ERROR_146009f4])) + capabilities.minImageExtent.height, capabilities.maxImageExtent.width, capabilities.maxImageExtent.height)) return true; } // pCreateInfo->preTransform should have exactly one bit set, and that bit must also be set in @@ -9319,8 +10597,7 @@ } // Log the message that we've built up: if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(dev_data->device), __LINE__, VALIDATION_ERROR_146009fe, "DS", "%s. %s", errorString.c_str(), - validation_error_map[VALIDATION_ERROR_146009fe])) + HandleToUint64(dev_data->device), VALIDATION_ERROR_146009fe, "%s.", errorString.c_str())) return true; } @@ -9346,26 +10623,23 @@ } // Log the message that we've built up: if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(dev_data->device), __LINE__, VALIDATION_ERROR_14600a00, "DS", "%s. %s", errorString.c_str(), - validation_error_map[VALIDATION_ERROR_14600a00])) + HandleToUint64(dev_data->device), VALIDATION_ERROR_14600a00, "%s.", errorString.c_str())) return true; } // Validate pCreateInfo->imageArrayLayers against VkSurfaceCapabilitiesKHR::maxImageArrayLayers: - if ((pCreateInfo->imageArrayLayers < 1) || (pCreateInfo->imageArrayLayers > capabilities.maxImageArrayLayers)) { + if (pCreateInfo->imageArrayLayers > capabilities.maxImageArrayLayers) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(dev_data->device), __LINE__, VALIDATION_ERROR_146009f6, "DS", - "%s called with a non-supported imageArrayLayers (i.e. %d). Minimum value is 1, maximum value is %d. %s", - func_name, pCreateInfo->imageArrayLayers, capabilities.maxImageArrayLayers, - validation_error_map[VALIDATION_ERROR_146009f6])) + HandleToUint64(dev_data->device), VALIDATION_ERROR_146009f6, + "%s called with a non-supported imageArrayLayers (i.e. %d). Maximum value is %d.", func_name, + pCreateInfo->imageArrayLayers, capabilities.maxImageArrayLayers)) return true; } // Validate pCreateInfo->imageUsage against VkSurfaceCapabilitiesKHR::supportedUsageFlags: if (pCreateInfo->imageUsage != (pCreateInfo->imageUsage & capabilities.supportedUsageFlags)) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(dev_data->device), __LINE__, VALIDATION_ERROR_146009f8, "DS", - "%s called with a non-supported pCreateInfo->imageUsage (i.e. 0x%08x). Supported flag bits are 0x%08x. %s", - func_name, pCreateInfo->imageUsage, capabilities.supportedUsageFlags, - validation_error_map[VALIDATION_ERROR_146009f8])) + HandleToUint64(dev_data->device), VALIDATION_ERROR_146009f8, + "%s called with a non-supported pCreateInfo->imageUsage (i.e. 0x%08x). Supported flag bits are 0x%08x.", + func_name, pCreateInfo->imageUsage, capabilities.supportedUsageFlags)) return true; } } @@ -9373,7 +10647,7 @@ // Validate pCreateInfo values with the results of vkGetPhysicalDeviceSurfaceFormatsKHR(): if (physical_device_state->vkGetPhysicalDeviceSurfaceFormatsKHRState != QUERY_DETAILS) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(dev_data->device), __LINE__, DRAWSTATE_SWAPCHAIN_CREATE_BEFORE_QUERY, "DS", + HandleToUint64(dev_data->device), DRAWSTATE_SWAPCHAIN_CREATE_BEFORE_QUERY, "%s called before calling vkGetPhysicalDeviceSurfaceFormatsKHR().", func_name)) return true; } else { @@ -9398,16 +10672,16 @@ if (!foundMatch) { if (!foundFormat) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(dev_data->device), __LINE__, VALIDATION_ERROR_146009f2, "DS", - "%s called with a non-supported pCreateInfo->imageFormat (i.e. %d). %s", func_name, - pCreateInfo->imageFormat, validation_error_map[VALIDATION_ERROR_146009f2])) + HandleToUint64(dev_data->device), VALIDATION_ERROR_146009f2, + "%s called with a non-supported pCreateInfo->imageFormat (i.e. %d).", func_name, + pCreateInfo->imageFormat)) return true; } if (!foundColorSpace) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(dev_data->device), __LINE__, VALIDATION_ERROR_146009f2, "DS", - "%s called with a non-supported pCreateInfo->imageColorSpace (i.e. %d). %s", func_name, - pCreateInfo->imageColorSpace, validation_error_map[VALIDATION_ERROR_146009f2])) + HandleToUint64(dev_data->device), VALIDATION_ERROR_146009f2, + "%s called with a non-supported pCreateInfo->imageColorSpace (i.e. %d).", func_name, + pCreateInfo->imageColorSpace)) return true; } } @@ -9418,7 +10692,7 @@ // FIFO is required to always be supported if (pCreateInfo->presentMode != VK_PRESENT_MODE_FIFO_KHR) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(dev_data->device), __LINE__, DRAWSTATE_SWAPCHAIN_CREATE_BEFORE_QUERY, "DS", + HandleToUint64(dev_data->device), DRAWSTATE_SWAPCHAIN_CREATE_BEFORE_QUERY, "%s called before calling vkGetPhysicalDeviceSurfacePresentModesKHR().", func_name)) return true; } @@ -9428,9 +10702,9 @@ pCreateInfo->presentMode) != physical_device_state->present_modes.end(); if (!foundMatch) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(dev_data->device), __LINE__, VALIDATION_ERROR_14600a02, "DS", - "%s called with a non-supported presentMode (i.e. %s). %s", func_name, - string_VkPresentModeKHR(pCreateInfo->presentMode), validation_error_map[VALIDATION_ERROR_14600a02])) + HandleToUint64(dev_data->device), VALIDATION_ERROR_14600a02, + "%s called with a non-supported presentMode (i.e. %s).", func_name, + string_VkPresentModeKHR(pCreateInfo->presentMode))) return true; } } @@ -9439,18 +10713,17 @@ VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR == pCreateInfo->presentMode) { if (!dev_data->extensions.vk_khr_shared_presentable_image) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(dev_data->device), __LINE__, DRAWSTATE_EXTENSION_NOT_ENABLED, "DS", + HandleToUint64(dev_data->device), DRAWSTATE_EXTENSION_NOT_ENABLED, "%s called with presentMode %s which requires the VK_KHR_shared_presentable_image extension, which has not " "been enabled.", func_name, string_VkPresentModeKHR(pCreateInfo->presentMode))) return true; } else if (pCreateInfo->minImageCount != 1) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - reinterpret_cast(dev_data->device), __LINE__, VALIDATION_ERROR_14600ace, "DS", + HandleToUint64(dev_data->device), VALIDATION_ERROR_14600ace, "%s called with presentMode %s, but minImageCount value is %d. For shared presentable image, minImageCount " - "must be 1. %s", - func_name, string_VkPresentModeKHR(pCreateInfo->presentMode), pCreateInfo->minImageCount, - validation_error_map[VALIDATION_ERROR_14600ace])) + "must be 1.", + func_name, string_VkPresentModeKHR(pCreateInfo->presentMode), pCreateInfo->minImageCount)) return true; } } @@ -9542,16 +10815,16 @@ // Compare the preliminary value of *pSwapchainImageCount with the value this time: if (swapchain_state->vkGetSwapchainImagesKHRState == UNCALLED) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(device), __LINE__, SWAPCHAIN_PRIOR_COUNT, "DS", - "vkGetSwapchainImagesKHR() called with non-NULL pSwapchainImageCount; but no prior positive " - "value has been seen for pSwapchainImages."); + HandleToUint64(device), SWAPCHAIN_PRIOR_COUNT, + "vkGetSwapchainImagesKHR() called with non-NULL pSwapchainImageCount; but no prior positive value has " + "been seen for pSwapchainImages."); } else if (*pSwapchainImageCount > swapchain_state->get_swapchain_image_count) { - skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(device), __LINE__, SWAPCHAIN_INVALID_COUNT, "DS", - "vkGetSwapchainImagesKHR() called with non-NULL pSwapchainImageCount, and with " - "pSwapchainImages set to a value (%d) that is greater than the value (%d) that was returned when " - "pSwapchainImageCount was NULL.", - *pSwapchainImageCount, swapchain_state->get_swapchain_image_count); + skip |= + log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, + HandleToUint64(device), SWAPCHAIN_INVALID_COUNT, + "vkGetSwapchainImagesKHR() called with non-NULL pSwapchainImageCount, and with pSwapchainImages set to a " + "value (%d) that is greater than the value (%d) that was returned when pSwapchainImageCount was NULL.", + *pSwapchainImageCount, swapchain_state->get_swapchain_image_count); } } return skip; @@ -9635,9 +10908,9 @@ auto pSemaphore = GetSemaphoreNode(dev_data, pPresentInfo->pWaitSemaphores[i]); if (pSemaphore && !pSemaphore->signaled) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, 0, - __LINE__, DRAWSTATE_QUEUE_FORWARD_PROGRESS, "DS", - "Queue 0x%p is waiting on semaphore 0x%" PRIx64 " that has no way to be signaled.", queue, - HandleToUint64(pPresentInfo->pWaitSemaphores[i])); + DRAWSTATE_QUEUE_FORWARD_PROGRESS, + "Queue 0x%" PRIx64 " is waiting on semaphore 0x%" PRIx64 " that has no way to be signaled.", + HandleToUint64(queue), HandleToUint64(pPresentInfo->pWaitSemaphores[i])); } } @@ -9647,7 +10920,7 @@ if (pPresentInfo->pImageIndices[i] >= swapchain_data->images.size()) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, - HandleToUint64(pPresentInfo->pSwapchains[i]), __LINE__, DRAWSTATE_SWAPCHAIN_INVALID_IMAGE, "DS", + HandleToUint64(pPresentInfo->pSwapchains[i]), DRAWSTATE_SWAPCHAIN_INVALID_IMAGE, "vkQueuePresentKHR: Swapchain image index too large (%u). There are only %u images in this swapchain.", pPresentInfo->pImageIndices[i], (uint32_t)swapchain_data->images.size()); } else { @@ -9663,22 +10936,20 @@ if (!image_state->acquired) { skip |= log_msg( dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, - HandleToUint64(pPresentInfo->pSwapchains[i]), __LINE__, DRAWSTATE_SWAPCHAIN_IMAGE_NOT_ACQUIRED, "DS", + HandleToUint64(pPresentInfo->pSwapchains[i]), DRAWSTATE_SWAPCHAIN_IMAGE_NOT_ACQUIRED, "vkQueuePresentKHR: Swapchain image index %u has not been acquired.", pPresentInfo->pImageIndices[i]); } vector layouts; if (FindLayouts(dev_data, image, layouts)) { for (auto layout : layouts) { - if ((layout != VK_IMAGE_LAYOUT_PRESENT_SRC_KHR) && - (!dev_data->extensions.vk_khr_shared_presentable_image || - (layout != VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR))) { - skip |= - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT, - HandleToUint64(queue), __LINE__, VALIDATION_ERROR_11200a20, "DS", - "Images passed to present must be in layout " - "VK_IMAGE_LAYOUT_PRESENT_SRC_KHR or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR but is in %s. %s", - string_VkImageLayout(layout), validation_error_map[VALIDATION_ERROR_11200a20]); + if ((layout != VK_IMAGE_LAYOUT_PRESENT_SRC_KHR) && (!dev_data->extensions.vk_khr_shared_presentable_image || + (layout != VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR))) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT, HandleToUint64(queue), VALIDATION_ERROR_11200a20, + "Images passed to present must be in layout VK_IMAGE_LAYOUT_PRESENT_SRC_KHR or " + "VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR but is in %s.", + string_VkImageLayout(layout)); } } } @@ -9694,83 +10965,70 @@ if (support_it == surface_state->gpu_queue_support.end()) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, - HandleToUint64(pPresentInfo->pSwapchains[i]), __LINE__, DRAWSTATE_SWAPCHAIN_UNSUPPORTED_QUEUE, "DS", - "vkQueuePresentKHR: Presenting image without calling " - "vkGetPhysicalDeviceSurfaceSupportKHR"); + HandleToUint64(pPresentInfo->pSwapchains[i]), DRAWSTATE_SWAPCHAIN_UNSUPPORTED_QUEUE, + "vkQueuePresentKHR: Presenting image without calling vkGetPhysicalDeviceSurfaceSupportKHR"); } else if (!support_it->second) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, - HandleToUint64(pPresentInfo->pSwapchains[i]), __LINE__, VALIDATION_ERROR_31800a18, "DS", - "vkQueuePresentKHR: Presenting image on queue that cannot " - "present to this surface. %s", - validation_error_map[VALIDATION_ERROR_31800a18]); + HandleToUint64(pPresentInfo->pSwapchains[i]), VALIDATION_ERROR_31800a18, + "vkQueuePresentKHR: Presenting image on queue that cannot present to this surface."); } } } } if (pPresentInfo && pPresentInfo->pNext) { // Verify ext struct - struct std_header { - VkStructureType sType; - const void *pNext; - }; - std_header *pnext = (std_header *)pPresentInfo->pNext; - while (pnext) { - if (VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR == pnext->sType) { - VkPresentRegionsKHR *present_regions = (VkPresentRegionsKHR *)pnext; - for (uint32_t i = 0; i < present_regions->swapchainCount; ++i) { - auto swapchain_data = GetSwapchainNode(dev_data, pPresentInfo->pSwapchains[i]); - assert(swapchain_data); - VkPresentRegionKHR region = present_regions->pRegions[i]; - for (uint32_t j = 0; j < region.rectangleCount; ++j) { - VkRectLayerKHR rect = region.pRectangles[j]; - // TODO: Need to update these errors to their unique error ids when available - if ((rect.offset.x + rect.extent.width) > swapchain_data->createInfo.imageExtent.width) { - skip |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, - HandleToUint64(pPresentInfo->pSwapchains[i]), __LINE__, DRAWSTATE_SWAPCHAIN_INVALID_IMAGE, "DS", - "vkQueuePresentKHR(): For VkPresentRegionKHR down pNext " - "chain, pRegion[%i].pRectangles[%i], the sum of offset.x " - "(%i) and extent.width (%i) is greater than the " - "corresponding swapchain's imageExtent.width (%i).", - i, j, rect.offset.x, rect.extent.width, swapchain_data->createInfo.imageExtent.width); - } - if ((rect.offset.y + rect.extent.height) > swapchain_data->createInfo.imageExtent.height) { - skip |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, - HandleToUint64(pPresentInfo->pSwapchains[i]), __LINE__, DRAWSTATE_SWAPCHAIN_INVALID_IMAGE, "DS", - "vkQueuePresentKHR(): For VkPresentRegionKHR down pNext " - "chain, pRegion[%i].pRectangles[%i], the sum of offset.y " - "(%i) and extent.height (%i) is greater than the " - "corresponding swapchain's imageExtent.height (%i).", - i, j, rect.offset.y, rect.extent.height, swapchain_data->createInfo.imageExtent.height); - } - if (rect.layer > swapchain_data->createInfo.imageArrayLayers) { - skip |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, - HandleToUint64(pPresentInfo->pSwapchains[i]), __LINE__, DRAWSTATE_SWAPCHAIN_INVALID_IMAGE, "DS", - "vkQueuePresentKHR(): For VkPresentRegionKHR down pNext chain, pRegion[%i].pRectangles[%i], the " - "layer (%i) is greater than the corresponding swapchain's imageArrayLayers (%i).", - i, j, rect.layer, swapchain_data->createInfo.imageArrayLayers); - } + const auto *present_regions = lvl_find_in_chain(pPresentInfo->pNext); + if (present_regions) { + for (uint32_t i = 0; i < present_regions->swapchainCount; ++i) { + auto swapchain_data = GetSwapchainNode(dev_data, pPresentInfo->pSwapchains[i]); + assert(swapchain_data); + VkPresentRegionKHR region = present_regions->pRegions[i]; + for (uint32_t j = 0; j < region.rectangleCount; ++j) { + VkRectLayerKHR rect = region.pRectangles[j]; + if ((rect.offset.x + rect.extent.width) > swapchain_data->createInfo.imageExtent.width) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, HandleToUint64(pPresentInfo->pSwapchains[i]), + VALIDATION_ERROR_11e009da, + "vkQueuePresentKHR(): For VkPresentRegionKHR down pNext chain, " + "pRegion[%i].pRectangles[%i], the sum of offset.x (%i) and extent.width (%i) is greater " + "than the corresponding swapchain's imageExtent.width (%i).", + i, j, rect.offset.x, rect.extent.width, swapchain_data->createInfo.imageExtent.width); + } + if ((rect.offset.y + rect.extent.height) > swapchain_data->createInfo.imageExtent.height) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, HandleToUint64(pPresentInfo->pSwapchains[i]), + VALIDATION_ERROR_11e009da, + "vkQueuePresentKHR(): For VkPresentRegionKHR down pNext chain, " + "pRegion[%i].pRectangles[%i], the sum of offset.y (%i) and extent.height (%i) is greater " + "than the corresponding swapchain's imageExtent.height (%i).", + i, j, rect.offset.y, rect.extent.height, swapchain_data->createInfo.imageExtent.height); + } + if (rect.layer > swapchain_data->createInfo.imageArrayLayers) { + skip |= log_msg( + dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, + HandleToUint64(pPresentInfo->pSwapchains[i]), VALIDATION_ERROR_11e009dc, + "vkQueuePresentKHR(): For VkPresentRegionKHR down pNext chain, pRegion[%i].pRectangles[%i], the layer " + "(%i) is greater than the corresponding swapchain's imageArrayLayers (%i).", + i, j, rect.layer, swapchain_data->createInfo.imageArrayLayers); } } - } else if (VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE == pnext->sType) { - VkPresentTimesInfoGOOGLE *present_times_info = (VkPresentTimesInfoGOOGLE *)pnext; - if (pPresentInfo->swapchainCount != present_times_info->swapchainCount) { - skip |= - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, - HandleToUint64(pPresentInfo->pSwapchains[0]), __LINE__, + } + } - VALIDATION_ERROR_118009be, "DS", - "vkQueuePresentKHR(): VkPresentTimesInfoGOOGLE.swapchainCount is %i but " - "pPresentInfo->swapchainCount is %i. For VkPresentTimesInfoGOOGLE down pNext " - "chain of VkPresentInfoKHR, VkPresentTimesInfoGOOGLE.swapchainCount " - "must equal VkPresentInfoKHR.swapchainCount.", - present_times_info->swapchainCount, pPresentInfo->swapchainCount); - } + const auto *present_times_info = lvl_find_in_chain(pPresentInfo->pNext); + if (present_times_info) { + if (pPresentInfo->swapchainCount != present_times_info->swapchainCount) { + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, + HandleToUint64(pPresentInfo->pSwapchains[0]), + + VALIDATION_ERROR_118009be, + "vkQueuePresentKHR(): VkPresentTimesInfoGOOGLE.swapchainCount is %i but pPresentInfo->swapchainCount " + "is %i. For VkPresentTimesInfoGOOGLE down pNext chain of VkPresentInfoKHR, " + "VkPresentTimesInfoGOOGLE.swapchainCount must equal VkPresentInfoKHR.swapchainCount.", + present_times_info->swapchainCount, pPresentInfo->swapchainCount); } - pnext = (std_header *)pnext->pNext; } } @@ -9889,17 +11147,16 @@ bool skip = false; if (fence == VK_NULL_HANDLE && semaphore == VK_NULL_HANDLE) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(device), __LINE__, DRAWSTATE_SWAPCHAIN_NO_SYNC_FOR_ACQUIRE, "DS", - "vkAcquireNextImageKHR: Semaphore and fence cannot both be VK_NULL_HANDLE. There would be no way " - "to determine the completion of this operation."); + HandleToUint64(device), DRAWSTATE_SWAPCHAIN_NO_SYNC_FOR_ACQUIRE, + "vkAcquireNextImageKHR: Semaphore and fence cannot both be VK_NULL_HANDLE. There would be no way to " + "determine the completion of this operation."); } auto pSemaphore = GetSemaphoreNode(dev_data, semaphore); if (pSemaphore && pSemaphore->scope == kSyncScopeInternal && pSemaphore->signaled) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT, - HandleToUint64(semaphore), __LINE__, VALIDATION_ERROR_16400a0c, "DS", - "vkAcquireNextImageKHR: Semaphore must not be currently signaled or in a wait state. %s", - validation_error_map[VALIDATION_ERROR_16400a0c]); + HandleToUint64(semaphore), VALIDATION_ERROR_16400a0c, + "vkAcquireNextImageKHR: Semaphore must not be currently signaled or in a wait state."); } auto pFence = GetFenceNode(dev_data, fence); @@ -9910,9 +11167,9 @@ auto swapchain_data = GetSwapchainNode(dev_data, swapchain); if (swapchain_data->replaced) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, - HandleToUint64(swapchain), __LINE__, DRAWSTATE_SWAPCHAIN_REPLACED, "DS", - "vkAcquireNextImageKHR: This swapchain has been replaced. The application can still " - "present any images it has acquired, but cannot acquire any more."); + HandleToUint64(swapchain), DRAWSTATE_SWAPCHAIN_REPLACED, + "vkAcquireNextImageKHR: This swapchain has been replaced. The application can still present any images it " + "has acquired, but cannot acquire any more."); } auto physical_device_state = GetPhysicalDeviceState(dev_data->instance_data, dev_data->physical_device); @@ -9922,7 +11179,7 @@ if (acquired_images > swapchain_data->images.size() - physical_device_state->surfaceCapabilities.minImageCount) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, - HandleToUint64(swapchain), __LINE__, DRAWSTATE_SWAPCHAIN_TOO_MANY_IMAGES, "DS", + HandleToUint64(swapchain), DRAWSTATE_SWAPCHAIN_TOO_MANY_IMAGES, "vkAcquireNextImageKHR: Application has already acquired the maximum number of images (0x%" PRIxLEAST64 ")", acquired_images); } @@ -9930,7 +11187,7 @@ if (swapchain_data->images.size() == 0) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, - HandleToUint64(swapchain), __LINE__, DRAWSTATE_SWAPCHAIN_IMAGES_NOT_FOUND, "DS", + HandleToUint64(swapchain), DRAWSTATE_SWAPCHAIN_IMAGES_NOT_FOUND, "vkAcquireNextImageKHR: No images found to acquire from. Application probably did not call " "vkGetSwapchainImagesKHR after swapchain creation."); } @@ -9998,16 +11255,16 @@ // Flag warning here. You can call this without having queried the count, but it may not be // robust on platforms with multiple physical devices. skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, - 0, __LINE__, DEVLIMITS_MISSING_QUERY_COUNT, "DL", - "Call sequence has vkEnumeratePhysicalDevices() w/ non-NULL pPhysicalDevices. You should first " - "call vkEnumeratePhysicalDevices() w/ NULL pPhysicalDevices to query pPhysicalDeviceCount."); + 0, DEVLIMITS_MISSING_QUERY_COUNT, + "Call sequence has vkEnumeratePhysicalDevices() w/ non-NULL pPhysicalDevices. You should first call " + "vkEnumeratePhysicalDevices() w/ NULL pPhysicalDevices to query pPhysicalDeviceCount."); } // TODO : Could also flag a warning if re-calling this function in QUERY_DETAILS state else if (instance_data->physical_devices_count != *pPhysicalDeviceCount) { // Having actual count match count from app is not a requirement, so this can be a warning skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, DEVLIMITS_COUNT_MISMATCH, "DL", - "Call to vkEnumeratePhysicalDevices() w/ pPhysicalDeviceCount value %u, but actual count " - "supported by this instance is %u.", + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, DEVLIMITS_COUNT_MISMATCH, + "Call to vkEnumeratePhysicalDevices() w/ pPhysicalDeviceCount value %u, but actual count supported by " + "this instance is %u.", *pPhysicalDeviceCount, instance_data->physical_devices_count); } instance_data->vkEnumeratePhysicalDevicesState = QUERY_DETAILS; @@ -10040,7 +11297,7 @@ if (UNCALLED == pd_state->vkGetPhysicalDeviceQueueFamilyPropertiesState) { skip |= log_msg( instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, - HandleToUint64(pd_state->phys_device), __LINE__, DEVLIMITS_MISSING_QUERY_COUNT, "DL", + HandleToUint64(pd_state->phys_device), DEVLIMITS_MISSING_QUERY_COUNT, "%s is called with non-NULL pQueueFamilyProperties before obtaining pQueueFamilyPropertyCount. It is recommended " "to first call %s with NULL pQueueFamilyProperties in order to obtain the maximal pQueueFamilyPropertyCount.", caller_name, caller_name); @@ -10048,7 +11305,7 @@ } else if (pd_state->queue_family_count != requested_queue_family_property_count) { skip |= log_msg( instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, - HandleToUint64(pd_state->phys_device), __LINE__, DEVLIMITS_COUNT_MISMATCH, "DL", + HandleToUint64(pd_state->phys_device), DEVLIMITS_COUNT_MISMATCH, "%s is called with non-NULL pQueueFamilyProperties and pQueueFamilyPropertyCount value %" PRIu32 ", but the largest previously returned pQueueFamilyPropertyCount for this physicalDevice is %" PRIu32 ". It is recommended to instead receive all the properties by calling %s with pQueueFamilyPropertyCount that was " @@ -10070,13 +11327,13 @@ "vkGetPhysicalDeviceQueueFamilyProperties()"); } -static bool PreCallValidateGetPhysicalDeviceQueueFamilyProperties2KHR(instance_layer_data *instance_data, - PHYSICAL_DEVICE_STATE *pd_state, - uint32_t *pQueueFamilyPropertyCount, - VkQueueFamilyProperties2KHR *pQueueFamilyProperties) { +static bool PreCallValidateGetPhysicalDeviceQueueFamilyProperties2(instance_layer_data *instance_data, + PHYSICAL_DEVICE_STATE *pd_state, + uint32_t *pQueueFamilyPropertyCount, + VkQueueFamilyProperties2KHR *pQueueFamilyProperties) { return ValidateCommonGetPhysicalDeviceQueueFamilyProperties(instance_data, pd_state, *pQueueFamilyPropertyCount, (nullptr == pQueueFamilyProperties), - "vkGetPhysicalDeviceQueueFamilyProperties2KHR()"); + "vkGetPhysicalDeviceQueueFamilyProperties2[KHR]()"); } // Common function to update state for GetPhysicalDeviceQueueFamilyProperties & 2KHR version @@ -10113,8 +11370,8 @@ StateUpdateCommonGetPhysicalDeviceQueueFamilyProperties(pd_state, count, pqfp); } -static void PostCallRecordGetPhysicalDeviceQueueFamilyProperties2KHR(PHYSICAL_DEVICE_STATE *pd_state, uint32_t count, - VkQueueFamilyProperties2KHR *pQueueFamilyProperties) { +static void PostCallRecordGetPhysicalDeviceQueueFamilyProperties2(PHYSICAL_DEVICE_STATE *pd_state, uint32_t count, + VkQueueFamilyProperties2KHR *pQueueFamilyProperties) { StateUpdateCommonGetPhysicalDeviceQueueFamilyProperties(pd_state, count, pQueueFamilyProperties); } @@ -10140,6 +11397,25 @@ PostCallRecordGetPhysicalDeviceQueueFamilyProperties(physical_device_state, *pQueueFamilyPropertyCount, pQueueFamilyProperties); } +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice, + uint32_t *pQueueFamilyPropertyCount, + VkQueueFamilyProperties2KHR *pQueueFamilyProperties) { + instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); + auto physical_device_state = GetPhysicalDeviceState(instance_data, physicalDevice); + assert(physical_device_state); + unique_lock_t lock(global_lock); + bool skip = PreCallValidateGetPhysicalDeviceQueueFamilyProperties2(instance_data, physical_device_state, + pQueueFamilyPropertyCount, pQueueFamilyProperties); + lock.unlock(); + if (skip) return; + + instance_data->dispatch_table.GetPhysicalDeviceQueueFamilyProperties2(physicalDevice, pQueueFamilyPropertyCount, + pQueueFamilyProperties); + lock.lock(); + PostCallRecordGetPhysicalDeviceQueueFamilyProperties2(physical_device_state, *pQueueFamilyPropertyCount, + pQueueFamilyProperties); +} + VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties2KHR *pQueueFamilyProperties) { @@ -10147,20 +11423,16 @@ auto physical_device_state = GetPhysicalDeviceState(instance_data, physicalDevice); assert(physical_device_state); unique_lock_t lock(global_lock); - - bool skip = PreCallValidateGetPhysicalDeviceQueueFamilyProperties2KHR(instance_data, physical_device_state, - pQueueFamilyPropertyCount, pQueueFamilyProperties); - + bool skip = PreCallValidateGetPhysicalDeviceQueueFamilyProperties2(instance_data, physical_device_state, + pQueueFamilyPropertyCount, pQueueFamilyProperties); lock.unlock(); - if (skip) return; instance_data->dispatch_table.GetPhysicalDeviceQueueFamilyProperties2KHR(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties); - lock.lock(); - PostCallRecordGetPhysicalDeviceQueueFamilyProperties2KHR(physical_device_state, *pQueueFamilyPropertyCount, - pQueueFamilyProperties); + PostCallRecordGetPhysicalDeviceQueueFamilyProperties2(physical_device_state, *pQueueFamilyPropertyCount, + pQueueFamilyProperties); } template @@ -10188,9 +11460,8 @@ if ((surface_state) && (surface_state->swapchain)) { skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, - HandleToUint64(instance), __LINE__, VALIDATION_ERROR_26c009e4, "DS", - "vkDestroySurfaceKHR() called before its associated VkSwapchainKHR was destroyed. %s", - validation_error_map[VALIDATION_ERROR_26c009e4]); + HandleToUint64(instance), VALIDATION_ERROR_26c009e4, + "vkDestroySurfaceKHR() called before its associated VkSwapchainKHR was destroyed."); } instance_data->surface_map.erase(surface); lock.unlock(); @@ -10211,6 +11482,20 @@ } #endif // VK_USE_PLATFORM_ANDROID_KHR +#ifdef VK_USE_PLATFORM_IOS_MVK +VKAPI_ATTR VkResult VKAPI_CALL CreateIOSSurfaceMVK(VkInstance instance, const VkIOSSurfaceCreateInfoMVK *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { + return CreateSurface(instance, pCreateInfo, pAllocator, pSurface, &VkLayerInstanceDispatchTable::CreateIOSSurfaceMVK); +} +#endif // VK_USE_PLATFORM_IOS_MVK + +#ifdef VK_USE_PLATFORM_MACOS_MVK +VKAPI_ATTR VkResult VKAPI_CALL CreateMacOSSurfaceMVK(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { + return CreateSurface(instance, pCreateInfo, pAllocator, pSurface, &VkLayerInstanceDispatchTable::CreateMacOSSurfaceMVK); +} +#endif // VK_USE_PLATFORM_MACOS_MVK + #ifdef VK_USE_PLATFORM_MIR_KHR VKAPI_ATTR VkResult VKAPI_CALL CreateMirSurfaceKHR(VkInstance instance, const VkMirSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { @@ -10474,21 +11759,20 @@ auto prev_mode_count = (uint32_t)physical_device_state->present_modes.size(); switch (call_state) { case UNCALLED: - skip |= log_msg( - instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, - HandleToUint64(physicalDevice), __LINE__, DEVLIMITS_MUST_QUERY_COUNT, "DL", - "vkGetPhysicalDeviceSurfacePresentModesKHR() called with non-NULL pPresentModeCount; but no prior positive " - "value has been seen for pPresentModeCount."); + skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, HandleToUint64(physicalDevice), + DEVLIMITS_MUST_QUERY_COUNT, + "vkGetPhysicalDeviceSurfacePresentModesKHR() called with non-NULL pPresentModeCount; but no prior " + "positive value has been seen for pPresentModeCount."); break; default: // both query count and query details if (*pPresentModeCount != prev_mode_count) { skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, HandleToUint64(physicalDevice), __LINE__, - DEVLIMITS_COUNT_MISMATCH, "DL", - "vkGetPhysicalDeviceSurfacePresentModesKHR() called with *pPresentModeCount (%u) that " - "differs from the value " - "(%u) that was returned when pPresentModes was NULL.", + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, HandleToUint64(physicalDevice), + DEVLIMITS_COUNT_MISMATCH, + "vkGetPhysicalDeviceSurfacePresentModesKHR() called with *pPresentModeCount (%u) that differs " + "from the value (%u) that was returned when pPresentModes was NULL.", *pPresentModeCount, prev_mode_count); } break; @@ -10537,23 +11821,21 @@ // Since we haven't recorded a preliminary value of *pSurfaceFormatCount, that likely means that the application // didn't // previously call this function with a NULL value of pSurfaceFormats: - skip |= log_msg( - instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, - HandleToUint64(physicalDevice), __LINE__, DEVLIMITS_MUST_QUERY_COUNT, "DL", - "vkGetPhysicalDeviceSurfaceFormatsKHR() called with non-NULL pSurfaceFormatCount; but no prior positive " - "value has been seen for pSurfaceFormats."); + skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, HandleToUint64(physicalDevice), + DEVLIMITS_MUST_QUERY_COUNT, + "vkGetPhysicalDeviceSurfaceFormatsKHR() called with non-NULL pSurfaceFormatCount; but no prior " + "positive value has been seen for pSurfaceFormats."); break; default: if (prev_format_count != *pSurfaceFormatCount) { - skip |= log_msg( - instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, HandleToUint64(physicalDevice), __LINE__, - DEVLIMITS_COUNT_MISMATCH, "DL", - "vkGetPhysicalDeviceSurfaceFormatsKHR() called with non-NULL pSurfaceFormatCount, and with pSurfaceFormats " - "set " - "to " - "a value (%u) that is greater than the value (%u) that was returned when pSurfaceFormatCount was NULL.", - *pSurfaceFormatCount, prev_format_count); + skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, HandleToUint64(physicalDevice), + DEVLIMITS_COUNT_MISMATCH, + "vkGetPhysicalDeviceSurfaceFormatsKHR() called with non-NULL pSurfaceFormatCount, and with " + "pSurfaceFormats set to a value (%u) that is greater than the value (%u) that was returned " + "when pSurfaceFormatCount was NULL.", + *pSurfaceFormatCount, prev_format_count); } break; } @@ -10618,6 +11900,107 @@ return result; } +// VK_EXT_debug_utils commands +VKAPI_ATTR VkResult VKAPI_CALL SetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT *pNameInfo) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + VkResult result = VK_SUCCESS; + if (pNameInfo->pObjectName) { + dev_data->report_data->debugUtilsObjectNameMap->insert( + std::make_pair((uint64_t &&) pNameInfo->objectHandle, pNameInfo->pObjectName)); + } else { + dev_data->report_data->debugUtilsObjectNameMap->erase(pNameInfo->objectHandle); + } + if (nullptr != dev_data->dispatch_table.SetDebugUtilsObjectNameEXT) { + result = dev_data->dispatch_table.SetDebugUtilsObjectNameEXT(device, pNameInfo); + } + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL SetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT *pTagInfo) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + VkResult result = VK_SUCCESS; + if (nullptr != dev_data->dispatch_table.SetDebugUtilsObjectTagEXT) { + result = dev_data->dispatch_table.SetDebugUtilsObjectTagEXT(device, pTagInfo); + } + return result; +} + +VKAPI_ATTR void VKAPI_CALL QueueBeginDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT *pLabelInfo) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); + BeginQueueDebugUtilsLabel(dev_data->report_data, queue, pLabelInfo); + if (nullptr != dev_data->dispatch_table.QueueBeginDebugUtilsLabelEXT) { + dev_data->dispatch_table.QueueBeginDebugUtilsLabelEXT(queue, pLabelInfo); + } +} + +VKAPI_ATTR void VKAPI_CALL QueueEndDebugUtilsLabelEXT(VkQueue queue) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); + if (nullptr != dev_data->dispatch_table.QueueEndDebugUtilsLabelEXT) { + dev_data->dispatch_table.QueueEndDebugUtilsLabelEXT(queue); + } + EndQueueDebugUtilsLabel(dev_data->report_data, queue); +} + +VKAPI_ATTR void VKAPI_CALL QueueInsertDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT *pLabelInfo) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); + InsertQueueDebugUtilsLabel(dev_data->report_data, queue, pLabelInfo); + if (nullptr != dev_data->dispatch_table.QueueInsertDebugUtilsLabelEXT) { + dev_data->dispatch_table.QueueInsertDebugUtilsLabelEXT(queue, pLabelInfo); + } +} + +VKAPI_ATTR void VKAPI_CALL CmdBeginDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT *pLabelInfo) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + BeginCmdDebugUtilsLabel(dev_data->report_data, commandBuffer, pLabelInfo); + if (nullptr != dev_data->dispatch_table.CmdBeginDebugUtilsLabelEXT) { + dev_data->dispatch_table.CmdBeginDebugUtilsLabelEXT(commandBuffer, pLabelInfo); + } +} + +VKAPI_ATTR void VKAPI_CALL CmdEndDebugUtilsLabelEXT(VkCommandBuffer commandBuffer) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + if (nullptr != dev_data->dispatch_table.CmdEndDebugUtilsLabelEXT) { + dev_data->dispatch_table.CmdEndDebugUtilsLabelEXT(commandBuffer); + } + EndCmdDebugUtilsLabel(dev_data->report_data, commandBuffer); +} + +VKAPI_ATTR void VKAPI_CALL CmdInsertDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT *pLabelInfo) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + InsertCmdDebugUtilsLabel(dev_data->report_data, commandBuffer, pLabelInfo); + if (nullptr != dev_data->dispatch_table.CmdInsertDebugUtilsLabelEXT) { + dev_data->dispatch_table.CmdInsertDebugUtilsLabelEXT(commandBuffer, pLabelInfo); + } +} + +VKAPI_ATTR VkResult VKAPI_CALL CreateDebugUtilsMessengerEXT(VkInstance instance, + const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDebugUtilsMessengerEXT *pMessenger) { + instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); + VkResult result = instance_data->dispatch_table.CreateDebugUtilsMessengerEXT(instance, pCreateInfo, pAllocator, pMessenger); + + if (VK_SUCCESS == result) { + result = layer_create_messenger_callback(instance_data->report_data, false, pCreateInfo, pAllocator, pMessenger); + } + return result; +} + +VKAPI_ATTR void VKAPI_CALL DestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, + const VkAllocationCallbacks *pAllocator) { + instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); + instance_data->dispatch_table.DestroyDebugUtilsMessengerEXT(instance, messenger, pAllocator); + layer_destroy_messenger_callback(instance_data->report_data, messenger, pAllocator); +} + +VKAPI_ATTR void VKAPI_CALL SubmitDebugUtilsMessageEXT(VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, + VkDebugUtilsMessageTypeFlagsEXT messageTypes, + const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData) { + instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); + instance_data->dispatch_table.SubmitDebugUtilsMessageEXT(instance, messageSeverity, messageTypes, pCallbackData); +} + +// VK_EXT_debug_report commands VKAPI_ATTR VkResult VKAPI_CALL CreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, @@ -10626,7 +12009,7 @@ VkResult res = instance_data->dispatch_table.CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pMsgCallback); if (VK_SUCCESS == res) { lock_guard_t lock(global_lock); - res = layer_create_msg_callback(instance_data->report_data, false, pCreateInfo, pAllocator, pMsgCallback); + res = layer_create_report_callback(instance_data->report_data, false, pCreateInfo, pAllocator, pMsgCallback); } return res; } @@ -10636,7 +12019,7 @@ instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); instance_data->dispatch_table.DestroyDebugReportCallbackEXT(instance, msgCallback, pAllocator); lock_guard_t lock(global_lock); - layer_destroy_msg_callback(instance_data->report_data, msgCallback, pAllocator); + layer_destroy_report_callback(instance_data->report_data, msgCallback, pAllocator); } VKAPI_ATTR void VKAPI_CALL DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, @@ -10665,7 +12048,8 @@ VKAPI_ATTR VkResult VKAPI_CALL EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pCount, VkExtensionProperties *pProperties) { - if (pLayerName && !strcmp(pLayerName, global_layer.layerName)) return util_GetExtensionProperties(0, NULL, pCount, pProperties); + if (pLayerName && !strcmp(pLayerName, global_layer.layerName)) + return util_GetExtensionProperties(1, device_extensions, pCount, pProperties); assert(physicalDevice); @@ -10673,97 +12057,229 @@ return instance_data->dispatch_table.EnumerateDeviceExtensionProperties(physicalDevice, NULL, pCount, pProperties); } -VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroupsKHX( - VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupPropertiesKHX *pPhysicalDeviceGroupProperties) { - bool skip = false; +static bool PreCallValidateEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, + VkPhysicalDeviceGroupPropertiesKHR *pPhysicalDeviceGroupProperties) { instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); + bool skip = false; if (instance_data) { - // For this instance, flag when EnumeratePhysicalDeviceGroupsKHX goes to QUERY_COUNT and then QUERY_DETAILS. - if (NULL == pPhysicalDeviceGroupProperties) { - instance_data->vkEnumeratePhysicalDeviceGroupsState = QUERY_COUNT; - } else { + // For this instance, flag when EnumeratePhysicalDeviceGroups goes to QUERY_COUNT and then QUERY_DETAILS. + if (NULL != pPhysicalDeviceGroupProperties) { if (UNCALLED == instance_data->vkEnumeratePhysicalDeviceGroupsState) { // Flag warning here. You can call this without having queried the count, but it may not be // robust on platforms with multiple physical devices. skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, 0, __LINE__, DEVLIMITS_MISSING_QUERY_COUNT, "DL", - "Call sequence has vkEnumeratePhysicalDeviceGroupsKHX() w/ non-NULL " - "pPhysicalDeviceGroupProperties. You should first " - "call vkEnumeratePhysicalDeviceGroupsKHX() w/ NULL pPhysicalDeviceGroupProperties to query " - "pPhysicalDeviceGroupCount."); - } // TODO : Could also flag a warning if re-calling this function in QUERY_DETAILS state + VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, 0, DEVLIMITS_MISSING_QUERY_COUNT, + "Call sequence has vkEnumeratePhysicalDeviceGroups() w/ non-NULL " + "pPhysicalDeviceGroupProperties. You should first call vkEnumeratePhysicalDeviceGroups() w/ " + "NULL pPhysicalDeviceGroupProperties to query pPhysicalDeviceGroupCount."); + } // TODO : Could also flag a warning if re-calling this function in QUERY_DETAILS state else if (instance_data->physical_device_groups_count != *pPhysicalDeviceGroupCount) { // Having actual count match count from app is not a requirement, so this can be a warning - skip |= - log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, DEVLIMITS_COUNT_MISMATCH, "DL", - "Call to vkEnumeratePhysicalDeviceGroupsKHX() w/ pPhysicalDeviceGroupCount value %u, but actual count " - "supported by this instance is %u.", - *pPhysicalDeviceGroupCount, instance_data->physical_device_groups_count); + skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, DEVLIMITS_COUNT_MISMATCH, + "Call to vkEnumeratePhysicalDeviceGroups() w/ pPhysicalDeviceGroupCount value %u, but actual count " + "supported by this instance is %u.", + *pPhysicalDeviceGroupCount, instance_data->physical_device_groups_count); } + } + } else { + log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, 0, + DEVLIMITS_INVALID_INSTANCE, "Invalid instance (0x%" PRIx64 ") passed into vkEnumeratePhysicalDeviceGroups().", + HandleToUint64(instance)); + } + + return skip; +} + +static void PreCallRecordEnumeratePhysicalDeviceGroups(instance_layer_data *instance_data, + VkPhysicalDeviceGroupPropertiesKHR *pPhysicalDeviceGroupProperties) { + if (instance_data) { + // For this instance, flag when EnumeratePhysicalDeviceGroups goes to QUERY_COUNT and then QUERY_DETAILS. + if (NULL == pPhysicalDeviceGroupProperties) { + instance_data->vkEnumeratePhysicalDeviceGroupsState = QUERY_COUNT; + } else { instance_data->vkEnumeratePhysicalDeviceGroupsState = QUERY_DETAILS; } - if (skip) { - return VK_ERROR_VALIDATION_FAILED_EXT; + } +} + +static void PostCallRecordEnumeratePhysicalDeviceGroups(instance_layer_data *instance_data, uint32_t *pPhysicalDeviceGroupCount, + VkPhysicalDeviceGroupPropertiesKHR *pPhysicalDeviceGroupProperties) { + if (NULL == pPhysicalDeviceGroupProperties) { + instance_data->physical_device_groups_count = *pPhysicalDeviceGroupCount; + } else { // Save physical devices + for (uint32_t i = 0; i < *pPhysicalDeviceGroupCount; i++) { + for (uint32_t j = 0; j < pPhysicalDeviceGroupProperties[i].physicalDeviceCount; j++) { + VkPhysicalDevice cur_phys_dev = pPhysicalDeviceGroupProperties[i].physicalDevices[j]; + auto &phys_device_state = instance_data->physical_device_map[cur_phys_dev]; + phys_device_state.phys_device = cur_phys_dev; + // Init actual features for each physical device + instance_data->dispatch_table.GetPhysicalDeviceFeatures(cur_phys_dev, &phys_device_state.features); + } } - VkResult result = instance_data->dispatch_table.EnumeratePhysicalDeviceGroupsKHX(instance, pPhysicalDeviceGroupCount, - pPhysicalDeviceGroupProperties); - if (NULL == pPhysicalDeviceGroupProperties) { - instance_data->physical_device_groups_count = *pPhysicalDeviceGroupCount; - } else if (result == VK_SUCCESS) { // Save physical devices - for (uint32_t i = 0; i < *pPhysicalDeviceGroupCount; i++) { - for (uint32_t j = 0; j < pPhysicalDeviceGroupProperties[i].physicalDeviceCount; j++) { - VkPhysicalDevice cur_phys_dev = pPhysicalDeviceGroupProperties[i].physicalDevices[j]; - auto &phys_device_state = instance_data->physical_device_map[cur_phys_dev]; - phys_device_state.phys_device = cur_phys_dev; - // Init actual features for each physical device - instance_data->dispatch_table.GetPhysicalDeviceFeatures(cur_phys_dev, &phys_device_state.features); - } + } +} + +VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, + VkPhysicalDeviceGroupPropertiesKHR *pPhysicalDeviceGroupProperties) { + bool skip = false; + instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); + + skip = PreCallValidateEnumeratePhysicalDeviceGroups(instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties); + if (skip) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + PreCallRecordEnumeratePhysicalDeviceGroups(instance_data, pPhysicalDeviceGroupProperties); + VkResult result = instance_data->dispatch_table.EnumeratePhysicalDeviceGroups(instance, pPhysicalDeviceGroupCount, + pPhysicalDeviceGroupProperties); + if (result == VK_SUCCESS) { + PostCallRecordEnumeratePhysicalDeviceGroups(instance_data, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties); + } + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroupsKHR( + VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupPropertiesKHR *pPhysicalDeviceGroupProperties) { + bool skip = false; + instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); + + skip = PreCallValidateEnumeratePhysicalDeviceGroups(instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties); + if (skip) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + PreCallRecordEnumeratePhysicalDeviceGroups(instance_data, pPhysicalDeviceGroupProperties); + VkResult result = instance_data->dispatch_table.EnumeratePhysicalDeviceGroupsKHR(instance, pPhysicalDeviceGroupCount, + pPhysicalDeviceGroupProperties); + if (result == VK_SUCCESS) { + PostCallRecordEnumeratePhysicalDeviceGroups(instance_data, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties); + } + return result; +} + +static bool PreCallValidateCreateDescriptorUpdateTemplate(const char *func_name, layer_data *device_data, + const VkDescriptorUpdateTemplateCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDescriptorUpdateTemplateKHR *pDescriptorUpdateTemplate) { + bool skip = false; + const auto layout = GetDescriptorSetLayout(device_data, pCreateInfo->descriptorSetLayout); + if (VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET == pCreateInfo->templateType && !layout) { + auto ds_uint = HandleToUint64(pCreateInfo->descriptorSetLayout); + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT, + ds_uint, VALIDATION_ERROR_052002bc, "%s: Invalid pCreateInfo->descriptorSetLayout (%" PRIx64 ")", func_name, + ds_uint); + } else if (VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR == pCreateInfo->templateType) { + auto bind_point = pCreateInfo->pipelineBindPoint; + bool valid_bp = (bind_point == VK_PIPELINE_BIND_POINT_GRAPHICS) || (bind_point == VK_PIPELINE_BIND_POINT_COMPUTE); + if (!valid_bp) { + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_052002be, "%s: Invalid pCreateInfo->pipelineBindPoint (%" PRIu32 ").", func_name, + static_cast(bind_point)); + } + const auto pipeline_layout = getPipelineLayout(device_data, pCreateInfo->pipelineLayout); + if (!pipeline_layout) { + uint64_t pl_uint = HandleToUint64(pCreateInfo->pipelineLayout); + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT, pl_uint, VALIDATION_ERROR_052002c0, + "%s: Invalid pCreateInfo->pipelineLayout (%" PRIx64 ")", func_name, pl_uint); + } else { + const uint32_t pd_set = pCreateInfo->set; + if ((pd_set >= pipeline_layout->set_layouts.size()) || !pipeline_layout->set_layouts[pd_set] || + !pipeline_layout->set_layouts[pd_set]->IsPushDescriptor()) { + uint64_t pl_uint = HandleToUint64(pCreateInfo->pipelineLayout); + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT, pl_uint, VALIDATION_ERROR_052002c2, + "%s: pCreateInfo->set (%" PRIu32 + ") does not refer to the push descriptor set layout for " + "pCreateInfo->pipelineLayout (%" PRIx64 ").", + func_name, pd_set, pl_uint); } } - return result; - } else { - log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, 0, __LINE__, - DEVLIMITS_INVALID_INSTANCE, "DL", - "Invalid instance (0x%" PRIxLEAST64 ") passed into vkEnumeratePhysicalDeviceGroupsKHX().", - HandleToUint64(instance)); } - return VK_ERROR_VALIDATION_FAILED_EXT; + return skip; +} + +static void PostCallRecordCreateDescriptorUpdateTemplate(layer_data *device_data, + const VkDescriptorUpdateTemplateCreateInfoKHR *pCreateInfo, + VkDescriptorUpdateTemplateKHR *pDescriptorUpdateTemplate) { + // Shadow template createInfo for later updates + safe_VkDescriptorUpdateTemplateCreateInfo *local_create_info = new safe_VkDescriptorUpdateTemplateCreateInfo(pCreateInfo); + std::unique_ptr template_state(new TEMPLATE_STATE(*pDescriptorUpdateTemplate, local_create_info)); + device_data->desc_template_map[*pDescriptorUpdateTemplate] = std::move(template_state); +} + +VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorUpdateTemplate(VkDevice device, + const VkDescriptorUpdateTemplateCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDescriptorUpdateTemplateKHR *pDescriptorUpdateTemplate) { + layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + unique_lock_t lock(global_lock); + bool skip = PreCallValidateCreateDescriptorUpdateTemplate("vkCreateDescriptorUpdateTemplate()", device_data, pCreateInfo, + pAllocator, pDescriptorUpdateTemplate); + + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + if (!skip) { + lock.unlock(); + result = + device_data->dispatch_table.CreateDescriptorUpdateTemplate(device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); + if (VK_SUCCESS == result) { + lock.lock(); + PostCallRecordCreateDescriptorUpdateTemplate(device_data, pCreateInfo, pDescriptorUpdateTemplate); + } + } + return result; } VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorUpdateTemplateKHR(VkDevice device, const VkDescriptorUpdateTemplateCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorUpdateTemplateKHR *pDescriptorUpdateTemplate) { - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - VkResult result = - dev_data->dispatch_table.CreateDescriptorUpdateTemplateKHR(device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); - if (VK_SUCCESS == result) { - lock_guard_t lock(global_lock); - // Shadow template createInfo for later updates - safe_VkDescriptorUpdateTemplateCreateInfoKHR *local_create_info = - new safe_VkDescriptorUpdateTemplateCreateInfoKHR(pCreateInfo); - std::unique_ptr template_state(new TEMPLATE_STATE(*pDescriptorUpdateTemplate, local_create_info)); - dev_data->desc_template_map[*pDescriptorUpdateTemplate] = std::move(template_state); + layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + unique_lock_t lock(global_lock); + bool skip = PreCallValidateCreateDescriptorUpdateTemplate("vkCreateDescriptorUpdateTemplateKHR()", device_data, pCreateInfo, + pAllocator, pDescriptorUpdateTemplate); + + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + if (!skip) { + lock.unlock(); + result = device_data->dispatch_table.CreateDescriptorUpdateTemplateKHR(device, pCreateInfo, pAllocator, + pDescriptorUpdateTemplate); + if (VK_SUCCESS == result) { + lock.lock(); + PostCallRecordCreateDescriptorUpdateTemplate(device_data, pCreateInfo, pDescriptorUpdateTemplate); + } } return result; } +static void PreCallRecordDestroyDescriptorUpdateTemplate(layer_data *device_data, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate) { + device_data->desc_template_map.erase(descriptorUpdateTemplate); +} + +VKAPI_ATTR void VKAPI_CALL DestroyDescriptorUpdateTemplate(VkDevice device, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + const VkAllocationCallbacks *pAllocator) { + layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + unique_lock_t lock(global_lock); + PreCallRecordDestroyDescriptorUpdateTemplate(device_data, descriptorUpdateTemplate); + lock.unlock(); + device_data->dispatch_table.DestroyDescriptorUpdateTemplate(device, descriptorUpdateTemplate, pAllocator); +} + VKAPI_ATTR void VKAPI_CALL DestroyDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const VkAllocationCallbacks *pAllocator) { - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); unique_lock_t lock(global_lock); - dev_data->desc_template_map.erase(descriptorUpdateTemplate); + PreCallRecordDestroyDescriptorUpdateTemplate(device_data, descriptorUpdateTemplate); lock.unlock(); - dev_data->dispatch_table.DestroyDescriptorUpdateTemplateKHR(device, descriptorUpdateTemplate, pAllocator); + device_data->dispatch_table.DestroyDescriptorUpdateTemplateKHR(device, descriptorUpdateTemplate, pAllocator); } // PostCallRecord* handles recording state updates following call down chain to UpdateDescriptorSetsWithTemplate() -static void PostCallRecordUpdateDescriptorSetWithTemplateKHR(layer_data *device_data, VkDescriptorSet descriptorSet, - VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, - const void *pData) { +static void PostCallRecordUpdateDescriptorSetWithTemplate(layer_data *device_data, VkDescriptorSet descriptorSet, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + const void *pData) { auto const template_map_entry = device_data->desc_template_map.find(descriptorUpdateTemplate); if (template_map_entry == device_data->desc_template_map.end()) { assert(0); @@ -10772,20 +12288,40 @@ cvdescriptorset::PerformUpdateDescriptorSetsWithTemplateKHR(device_data, descriptorSet, template_map_entry->second, pData); } +VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + const void *pData) { + layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + device_data->dispatch_table.UpdateDescriptorSetWithTemplate(device, descriptorSet, descriptorUpdateTemplate, pData); + + PostCallRecordUpdateDescriptorSetWithTemplate(device_data, descriptorSet, descriptorUpdateTemplate, pData); +} + VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void *pData) { layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); device_data->dispatch_table.UpdateDescriptorSetWithTemplateKHR(device, descriptorSet, descriptorUpdateTemplate, pData); - PostCallRecordUpdateDescriptorSetWithTemplateKHR(device_data, descriptorSet, descriptorUpdateTemplate, pData); + PostCallRecordUpdateDescriptorSetWithTemplate(device_data, descriptorSet, descriptorUpdateTemplate, pData); } VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void *pData) { layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); - dev_data->dispatch_table.CmdPushDescriptorSetWithTemplateKHR(commandBuffer, descriptorUpdateTemplate, layout, set, pData); + unique_lock_t lock(global_lock); + bool skip = false; + GLOBAL_CB_NODE *cb_state = GetCBNode(dev_data, commandBuffer); + // Minimal validation for command buffer state + if (cb_state) { + skip |= ValidateCmd(dev_data, cb_state, CMD_PUSHDESCRIPTORSETWITHTEMPLATEKHR, "vkCmdPushDescriptorSetWithTemplateKHR()"); + } + lock.unlock(); + + if (!skip) { + dev_data->dispatch_table.CmdPushDescriptorSetWithTemplateKHR(commandBuffer, descriptorUpdateTemplate, layout, set, pData); + } } static void PostCallRecordGetPhysicalDeviceDisplayPlanePropertiesKHR(instance_layer_data *instanceData, @@ -10829,16 +12365,16 @@ if (physical_device_state->vkGetPhysicalDeviceDisplayPlanePropertiesKHRState == UNCALLED) { skip |= log_msg( instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, - HandleToUint64(physicalDevice), __LINE__, SWAPCHAIN_GET_SUPPORTED_DISPLAYS_WITHOUT_QUERY, "DL", + HandleToUint64(physicalDevice), SWAPCHAIN_GET_SUPPORTED_DISPLAYS_WITHOUT_QUERY, "Potential problem with calling %s() without first querying vkGetPhysicalDeviceDisplayPlanePropertiesKHR.", api_name); } else { if (planeIndex >= physical_device_state->display_plane_property_count) { skip |= log_msg( instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, - HandleToUint64(physicalDevice), __LINE__, VALIDATION_ERROR_29c009c2, "DL", + HandleToUint64(physicalDevice), VALIDATION_ERROR_29c009c2, "%s(): planeIndex must be in the range [0, %d] that was returned by vkGetPhysicalDeviceDisplayPlanePropertiesKHR. " - "Do you have the plane index hardcoded? %s", - api_name, physical_device_state->display_plane_property_count - 1, validation_error_map[VALIDATION_ERROR_29c009c2]); + "Do you have the plane index hardcoded?", + api_name, physical_device_state->display_plane_property_count - 1); } } return skip; @@ -10888,11 +12424,11 @@ } VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectNameEXT(VkDevice device, const VkDebugMarkerObjectNameInfoEXT *pNameInfo) { - std::unique_lock lock(global_lock); + unique_lock_t lock(global_lock); layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); if (pNameInfo->pObjectName) { device_data->report_data->debugObjectNameMap->insert( - std::make_pair((uint64_t &&)pNameInfo->object, pNameInfo->pObjectName)); + std::make_pair((uint64_t &&) pNameInfo->object, pNameInfo->pObjectName)); } else { device_data->report_data->debugObjectNameMap->erase(pNameInfo->object); } @@ -10909,12 +12445,32 @@ VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT *pMarkerInfo) { layer_data *device_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); - device_data->dispatch_table.CmdDebugMarkerBeginEXT(commandBuffer, pMarkerInfo); + unique_lock_t lock(global_lock); + bool skip = false; + GLOBAL_CB_NODE *cb_state = GetCBNode(device_data, commandBuffer); + // Minimal validation for command buffer state + if (cb_state) { + skip |= ValidateCmd(device_data, cb_state, CMD_DEBUGMARKERBEGINEXT, "vkCmdDebugMarkerBeginEXT()"); + } + lock.unlock(); + if (!skip) { + device_data->dispatch_table.CmdDebugMarkerBeginEXT(commandBuffer, pMarkerInfo); + } } VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer) { layer_data *device_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); - device_data->dispatch_table.CmdDebugMarkerEndEXT(commandBuffer); + unique_lock_t lock(global_lock); + bool skip = false; + GLOBAL_CB_NODE *cb_state = GetCBNode(device_data, commandBuffer); + // Minimal validation for command buffer state + if (cb_state) { + skip |= ValidateCmd(device_data, cb_state, CMD_DEBUGMARKERENDEXT, "vkCmdDebugMarkerEndEXT()"); + } + lock.unlock(); + if (!skip) { + device_data->dispatch_table.CmdDebugMarkerEndEXT(commandBuffer); + } } VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT *pMarkerInfo) { @@ -10922,202 +12478,280 @@ device_data->dispatch_table.CmdDebugMarkerInsertEXT(commandBuffer, pMarkerInfo); } +VKAPI_ATTR void VKAPI_CALL CmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, + uint32_t discardRectangleCount, const VkRect2D *pDiscardRectangles) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + unique_lock_t lock(global_lock); + bool skip = false; + GLOBAL_CB_NODE *cb_state = GetCBNode(dev_data, commandBuffer); + // Minimal validation for command buffer state + if (cb_state) { + skip |= ValidateCmd(dev_data, cb_state, CMD_SETDISCARDRECTANGLEEXT, "vkCmdSetDiscardRectangleEXT()"); + } + lock.unlock(); + + if (!skip) { + dev_data->dispatch_table.CmdSetDiscardRectangleEXT(commandBuffer, firstDiscardRectangle, discardRectangleCount, + pDiscardRectangles); + } +} + +VKAPI_ATTR void VKAPI_CALL CmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer, + const VkSampleLocationsInfoEXT *pSampleLocationsInfo) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + unique_lock_t lock(global_lock); + bool skip = false; + GLOBAL_CB_NODE *cb_state = GetCBNode(dev_data, commandBuffer); + // Minimal validation for command buffer state + if (cb_state) { + skip |= ValidateCmd(dev_data, cb_state, CMD_SETSAMPLELOCATIONSEXT, "vkCmdSetSampleLocationsEXT()"); + } + lock.unlock(); + + if (!skip) { + dev_data->dispatch_table.CmdSetSampleLocationsEXT(commandBuffer, pSampleLocationsInfo); + } +} + VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetDeviceProcAddr(VkDevice device, const char *funcName); VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetPhysicalDeviceProcAddr(VkInstance instance, const char *funcName); VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetInstanceProcAddr(VkInstance instance, const char *funcName); // Map of all APIs to be intercepted by this layer static const std::unordered_map name_to_funcptr_map = { - {"vkGetInstanceProcAddr", (void*)GetInstanceProcAddr}, - {"vk_layerGetPhysicalDeviceProcAddr", (void*)GetPhysicalDeviceProcAddr}, - {"vkGetDeviceProcAddr", (void*)GetDeviceProcAddr}, - {"vkCreateInstance", (void*)CreateInstance}, - {"vkCreateDevice", (void*)CreateDevice}, - {"vkEnumeratePhysicalDevices", (void*)EnumeratePhysicalDevices}, - {"vkGetPhysicalDeviceQueueFamilyProperties", (void*)GetPhysicalDeviceQueueFamilyProperties}, - {"vkDestroyInstance", (void*)DestroyInstance}, - {"vkEnumerateInstanceLayerProperties", (void*)EnumerateInstanceLayerProperties}, - {"vkEnumerateDeviceLayerProperties", (void*)EnumerateDeviceLayerProperties}, - {"vkEnumerateInstanceExtensionProperties", (void*)EnumerateInstanceExtensionProperties}, - {"vkEnumerateDeviceExtensionProperties", (void*)EnumerateDeviceExtensionProperties}, - {"vkCreateDescriptorUpdateTemplateKHR", (void*)CreateDescriptorUpdateTemplateKHR}, - {"vkDestroyDescriptorUpdateTemplateKHR", (void*)DestroyDescriptorUpdateTemplateKHR}, - {"vkUpdateDescriptorSetWithTemplateKHR", (void*)UpdateDescriptorSetWithTemplateKHR}, - {"vkCmdPushDescriptorSetWithTemplateKHR", (void*)CmdPushDescriptorSetWithTemplateKHR}, - {"vkCmdPushDescriptorSetKHR", (void*)CmdPushDescriptorSetKHR}, - {"vkCreateSwapchainKHR", (void*)CreateSwapchainKHR}, - {"vkDestroySwapchainKHR", (void*)DestroySwapchainKHR}, - {"vkGetSwapchainImagesKHR", (void*)GetSwapchainImagesKHR}, - {"vkAcquireNextImageKHR", (void*)AcquireNextImageKHR}, - {"vkQueuePresentKHR", (void*)QueuePresentKHR}, - {"vkQueueSubmit", (void*)QueueSubmit}, - {"vkWaitForFences", (void*)WaitForFences}, - {"vkGetFenceStatus", (void*)GetFenceStatus}, - {"vkQueueWaitIdle", (void*)QueueWaitIdle}, - {"vkDeviceWaitIdle", (void*)DeviceWaitIdle}, - {"vkGetDeviceQueue", (void*)GetDeviceQueue}, - {"vkDestroyDevice", (void*)DestroyDevice}, - {"vkDestroyFence", (void*)DestroyFence}, - {"vkResetFences", (void*)ResetFences}, - {"vkDestroySemaphore", (void*)DestroySemaphore}, - {"vkDestroyEvent", (void*)DestroyEvent}, - {"vkDestroyQueryPool", (void*)DestroyQueryPool}, - {"vkDestroyBuffer", (void*)DestroyBuffer}, - {"vkDestroyBufferView", (void*)DestroyBufferView}, - {"vkDestroyImage", (void*)DestroyImage}, - {"vkDestroyImageView", (void*)DestroyImageView}, - {"vkDestroyShaderModule", (void*)DestroyShaderModule}, - {"vkDestroyPipeline", (void*)DestroyPipeline}, - {"vkDestroyPipelineLayout", (void*)DestroyPipelineLayout}, - {"vkDestroySampler", (void*)DestroySampler}, - {"vkDestroyDescriptorSetLayout", (void*)DestroyDescriptorSetLayout}, - {"vkDestroyDescriptorPool", (void*)DestroyDescriptorPool}, - {"vkDestroyFramebuffer", (void*)DestroyFramebuffer}, - {"vkDestroyRenderPass", (void*)DestroyRenderPass}, - {"vkCreateBuffer", (void*)CreateBuffer}, - {"vkCreateBufferView", (void*)CreateBufferView}, - {"vkCreateImage", (void*)CreateImage}, - {"vkCreateImageView", (void*)CreateImageView}, - {"vkCreateFence", (void*)CreateFence}, - {"vkCreatePipelineCache", (void*)CreatePipelineCache}, - {"vkDestroyPipelineCache", (void*)DestroyPipelineCache}, - {"vkGetPipelineCacheData", (void*)GetPipelineCacheData}, - {"vkMergePipelineCaches", (void*)MergePipelineCaches}, - {"vkCreateGraphicsPipelines", (void*)CreateGraphicsPipelines}, - {"vkCreateComputePipelines", (void*)CreateComputePipelines}, - {"vkCreateSampler", (void*)CreateSampler}, - {"vkCreateDescriptorSetLayout", (void*)CreateDescriptorSetLayout}, - {"vkCreatePipelineLayout", (void*)CreatePipelineLayout}, - {"vkCreateDescriptorPool", (void*)CreateDescriptorPool}, - {"vkResetDescriptorPool", (void*)ResetDescriptorPool}, - {"vkAllocateDescriptorSets", (void*)AllocateDescriptorSets}, - {"vkFreeDescriptorSets", (void*)FreeDescriptorSets}, - {"vkUpdateDescriptorSets", (void*)UpdateDescriptorSets}, - {"vkCreateCommandPool", (void*)CreateCommandPool}, - {"vkDestroyCommandPool", (void*)DestroyCommandPool}, - {"vkResetCommandPool", (void*)ResetCommandPool}, - {"vkCreateQueryPool", (void*)CreateQueryPool}, - {"vkAllocateCommandBuffers", (void*)AllocateCommandBuffers}, - {"vkFreeCommandBuffers", (void*)FreeCommandBuffers}, - {"vkBeginCommandBuffer", (void*)BeginCommandBuffer}, - {"vkEndCommandBuffer", (void*)EndCommandBuffer}, - {"vkResetCommandBuffer", (void*)ResetCommandBuffer}, - {"vkCmdBindPipeline", (void*)CmdBindPipeline}, - {"vkCmdSetViewport", (void*)CmdSetViewport}, - {"vkCmdSetScissor", (void*)CmdSetScissor}, - {"vkCmdSetLineWidth", (void*)CmdSetLineWidth}, - {"vkCmdSetDepthBias", (void*)CmdSetDepthBias}, - {"vkCmdSetBlendConstants", (void*)CmdSetBlendConstants}, - {"vkCmdSetDepthBounds", (void*)CmdSetDepthBounds}, - {"vkCmdSetStencilCompareMask", (void*)CmdSetStencilCompareMask}, - {"vkCmdSetStencilWriteMask", (void*)CmdSetStencilWriteMask}, - {"vkCmdSetStencilReference", (void*)CmdSetStencilReference}, - {"vkCmdBindDescriptorSets", (void*)CmdBindDescriptorSets}, - {"vkCmdBindVertexBuffers", (void*)CmdBindVertexBuffers}, - {"vkCmdBindIndexBuffer", (void*)CmdBindIndexBuffer}, - {"vkCmdDraw", (void*)CmdDraw}, - {"vkCmdDrawIndexed", (void*)CmdDrawIndexed}, - {"vkCmdDrawIndirect", (void*)CmdDrawIndirect}, - {"vkCmdDrawIndexedIndirect", (void*)CmdDrawIndexedIndirect}, - {"vkCmdDispatch", (void*)CmdDispatch}, - {"vkCmdDispatchIndirect", (void*)CmdDispatchIndirect}, - {"vkCmdCopyBuffer", (void*)CmdCopyBuffer}, - {"vkCmdCopyImage", (void*)CmdCopyImage}, - {"vkCmdBlitImage", (void*)CmdBlitImage}, - {"vkCmdCopyBufferToImage", (void*)CmdCopyBufferToImage}, - {"vkCmdCopyImageToBuffer", (void*)CmdCopyImageToBuffer}, - {"vkCmdUpdateBuffer", (void*)CmdUpdateBuffer}, - {"vkCmdFillBuffer", (void*)CmdFillBuffer}, - {"vkCmdClearColorImage", (void*)CmdClearColorImage}, - {"vkCmdClearDepthStencilImage", (void*)CmdClearDepthStencilImage}, - {"vkCmdClearAttachments", (void*)CmdClearAttachments}, - {"vkCmdResolveImage", (void*)CmdResolveImage}, - {"vkGetImageSubresourceLayout", (void*)GetImageSubresourceLayout}, - {"vkCmdSetEvent", (void*)CmdSetEvent}, - {"vkCmdResetEvent", (void*)CmdResetEvent}, - {"vkCmdWaitEvents", (void*)CmdWaitEvents}, - {"vkCmdPipelineBarrier", (void*)CmdPipelineBarrier}, - {"vkCmdBeginQuery", (void*)CmdBeginQuery}, - {"vkCmdEndQuery", (void*)CmdEndQuery}, - {"vkCmdResetQueryPool", (void*)CmdResetQueryPool}, - {"vkCmdCopyQueryPoolResults", (void*)CmdCopyQueryPoolResults}, - {"vkCmdPushConstants", (void*)CmdPushConstants}, - {"vkCmdWriteTimestamp", (void*)CmdWriteTimestamp}, - {"vkCreateFramebuffer", (void*)CreateFramebuffer}, - {"vkCreateShaderModule", (void*)CreateShaderModule}, - {"vkCreateRenderPass", (void*)CreateRenderPass}, - {"vkCmdBeginRenderPass", (void*)CmdBeginRenderPass}, - {"vkCmdNextSubpass", (void*)CmdNextSubpass}, - {"vkCmdEndRenderPass", (void*)CmdEndRenderPass}, - {"vkCmdExecuteCommands", (void*)CmdExecuteCommands}, - {"vkCmdDebugMarkerBeginEXT", (void*)CmdDebugMarkerBeginEXT}, - {"vkCmdDebugMarkerEndEXT", (void*)CmdDebugMarkerEndEXT}, - {"vkCmdDebugMarkerInsertEXT", (void*)CmdDebugMarkerInsertEXT}, - {"vkDebugMarkerSetObjectNameEXT", (void*)DebugMarkerSetObjectNameEXT}, - {"vkDebugMarkerSetObjectTagEXT", (void*)DebugMarkerSetObjectTagEXT}, - {"vkSetEvent", (void*)SetEvent}, - {"vkMapMemory", (void*)MapMemory}, - {"vkUnmapMemory", (void*)UnmapMemory}, - {"vkFlushMappedMemoryRanges", (void*)FlushMappedMemoryRanges}, - {"vkInvalidateMappedMemoryRanges", (void*)InvalidateMappedMemoryRanges}, - {"vkAllocateMemory", (void*)AllocateMemory}, - {"vkFreeMemory", (void*)FreeMemory}, - {"vkBindBufferMemory", (void*)BindBufferMemory}, - {"vkGetBufferMemoryRequirements", (void*)GetBufferMemoryRequirements}, - {"vkGetImageMemoryRequirements", (void*)GetImageMemoryRequirements}, - {"vkGetQueryPoolResults", (void*)GetQueryPoolResults}, - {"vkBindImageMemory", (void*)BindImageMemory}, - {"vkQueueBindSparse", (void*)QueueBindSparse}, - {"vkCreateSemaphore", (void*)CreateSemaphore}, - {"vkCreateEvent", (void*)CreateEvent}, + {"vkGetInstanceProcAddr", (void *)GetInstanceProcAddr}, + {"vk_layerGetPhysicalDeviceProcAddr", (void *)GetPhysicalDeviceProcAddr}, + {"vkGetDeviceProcAddr", (void *)GetDeviceProcAddr}, + {"vkCreateInstance", (void *)CreateInstance}, + {"vkCreateDevice", (void *)CreateDevice}, + {"vkEnumeratePhysicalDevices", (void *)EnumeratePhysicalDevices}, + {"vkGetPhysicalDeviceQueueFamilyProperties", (void *)GetPhysicalDeviceQueueFamilyProperties}, + {"vkDestroyInstance", (void *)DestroyInstance}, + {"vkEnumerateInstanceLayerProperties", (void *)EnumerateInstanceLayerProperties}, + {"vkEnumerateDeviceLayerProperties", (void *)EnumerateDeviceLayerProperties}, + {"vkEnumerateInstanceExtensionProperties", (void *)EnumerateInstanceExtensionProperties}, + {"vkEnumerateDeviceExtensionProperties", (void *)EnumerateDeviceExtensionProperties}, + {"vkCreateDescriptorUpdateTemplate", (void *)CreateDescriptorUpdateTemplate}, + {"vkCreateDescriptorUpdateTemplateKHR", (void *)CreateDescriptorUpdateTemplateKHR}, + {"vkDestroyDescriptorUpdateTemplate", (void *)DestroyDescriptorUpdateTemplate}, + {"vkDestroyDescriptorUpdateTemplateKHR", (void *)DestroyDescriptorUpdateTemplateKHR}, + {"vkUpdateDescriptorSetWithTemplate", (void *)UpdateDescriptorSetWithTemplate}, + {"vkUpdateDescriptorSetWithTemplateKHR", (void *)UpdateDescriptorSetWithTemplateKHR}, + {"vkCmdPushDescriptorSetWithTemplateKHR", (void *)CmdPushDescriptorSetWithTemplateKHR}, + {"vkCmdPushDescriptorSetKHR", (void *)CmdPushDescriptorSetKHR}, + {"vkCreateSwapchainKHR", (void *)CreateSwapchainKHR}, + {"vkDestroySwapchainKHR", (void *)DestroySwapchainKHR}, + {"vkGetSwapchainImagesKHR", (void *)GetSwapchainImagesKHR}, + {"vkAcquireNextImageKHR", (void *)AcquireNextImageKHR}, + {"vkQueuePresentKHR", (void *)QueuePresentKHR}, + {"vkQueueSubmit", (void *)QueueSubmit}, + {"vkWaitForFences", (void *)WaitForFences}, + {"vkGetFenceStatus", (void *)GetFenceStatus}, + {"vkQueueWaitIdle", (void *)QueueWaitIdle}, + {"vkDeviceWaitIdle", (void *)DeviceWaitIdle}, + {"vkGetDeviceQueue", (void *)GetDeviceQueue}, + {"vkGetDeviceQueue2", (void *)GetDeviceQueue2}, + {"vkDestroyDevice", (void *)DestroyDevice}, + {"vkDestroyFence", (void *)DestroyFence}, + {"vkResetFences", (void *)ResetFences}, + {"vkDestroySemaphore", (void *)DestroySemaphore}, + {"vkDestroyEvent", (void *)DestroyEvent}, + {"vkDestroyQueryPool", (void *)DestroyQueryPool}, + {"vkDestroyBuffer", (void *)DestroyBuffer}, + {"vkDestroyBufferView", (void *)DestroyBufferView}, + {"vkDestroyImage", (void *)DestroyImage}, + {"vkDestroyImageView", (void *)DestroyImageView}, + {"vkDestroyShaderModule", (void *)DestroyShaderModule}, + {"vkDestroyPipeline", (void *)DestroyPipeline}, + {"vkDestroyPipelineLayout", (void *)DestroyPipelineLayout}, + {"vkDestroySampler", (void *)DestroySampler}, + {"vkDestroyDescriptorSetLayout", (void *)DestroyDescriptorSetLayout}, + {"vkDestroyDescriptorPool", (void *)DestroyDescriptorPool}, + {"vkDestroyFramebuffer", (void *)DestroyFramebuffer}, + {"vkDestroyRenderPass", (void *)DestroyRenderPass}, + {"vkCreateBuffer", (void *)CreateBuffer}, + {"vkCreateBufferView", (void *)CreateBufferView}, + {"vkCreateImage", (void *)CreateImage}, + {"vkCreateImageView", (void *)CreateImageView}, + {"vkCreateFence", (void *)CreateFence}, + {"vkCreatePipelineCache", (void *)CreatePipelineCache}, + {"vkDestroyPipelineCache", (void *)DestroyPipelineCache}, + {"vkGetPipelineCacheData", (void *)GetPipelineCacheData}, + {"vkMergePipelineCaches", (void *)MergePipelineCaches}, + {"vkCreateGraphicsPipelines", (void *)CreateGraphicsPipelines}, + {"vkCreateComputePipelines", (void *)CreateComputePipelines}, + {"vkCreateSampler", (void *)CreateSampler}, + {"vkCreateDescriptorSetLayout", (void *)CreateDescriptorSetLayout}, + {"vkCreatePipelineLayout", (void *)CreatePipelineLayout}, + {"vkCreateDescriptorPool", (void *)CreateDescriptorPool}, + {"vkResetDescriptorPool", (void *)ResetDescriptorPool}, + {"vkAllocateDescriptorSets", (void *)AllocateDescriptorSets}, + {"vkFreeDescriptorSets", (void *)FreeDescriptorSets}, + {"vkUpdateDescriptorSets", (void *)UpdateDescriptorSets}, + {"vkCreateCommandPool", (void *)CreateCommandPool}, + {"vkDestroyCommandPool", (void *)DestroyCommandPool}, + {"vkResetCommandPool", (void *)ResetCommandPool}, + {"vkCreateQueryPool", (void *)CreateQueryPool}, + {"vkAllocateCommandBuffers", (void *)AllocateCommandBuffers}, + {"vkFreeCommandBuffers", (void *)FreeCommandBuffers}, + {"vkBeginCommandBuffer", (void *)BeginCommandBuffer}, + {"vkEndCommandBuffer", (void *)EndCommandBuffer}, + {"vkResetCommandBuffer", (void *)ResetCommandBuffer}, + {"vkCmdBindPipeline", (void *)CmdBindPipeline}, + {"vkCmdSetViewport", (void *)CmdSetViewport}, + {"vkCmdSetScissor", (void *)CmdSetScissor}, + {"vkCmdSetLineWidth", (void *)CmdSetLineWidth}, + {"vkCmdSetDepthBias", (void *)CmdSetDepthBias}, + {"vkCmdSetBlendConstants", (void *)CmdSetBlendConstants}, + {"vkCmdSetDepthBounds", (void *)CmdSetDepthBounds}, + {"vkCmdSetStencilCompareMask", (void *)CmdSetStencilCompareMask}, + {"vkCmdSetStencilWriteMask", (void *)CmdSetStencilWriteMask}, + {"vkCmdSetStencilReference", (void *)CmdSetStencilReference}, + {"vkCmdBindDescriptorSets", (void *)CmdBindDescriptorSets}, + {"vkCmdBindVertexBuffers", (void *)CmdBindVertexBuffers}, + {"vkCmdBindIndexBuffer", (void *)CmdBindIndexBuffer}, + {"vkCmdDraw", (void *)CmdDraw}, + {"vkCmdDrawIndexed", (void *)CmdDrawIndexed}, + {"vkCmdDrawIndirect", (void *)CmdDrawIndirect}, + {"vkCmdDrawIndexedIndirect", (void *)CmdDrawIndexedIndirect}, + {"vkCmdDispatch", (void *)CmdDispatch}, + {"vkCmdDispatchIndirect", (void *)CmdDispatchIndirect}, + {"vkCmdCopyBuffer", (void *)CmdCopyBuffer}, + {"vkCmdCopyImage", (void *)CmdCopyImage}, + {"vkCmdBlitImage", (void *)CmdBlitImage}, + {"vkCmdCopyBufferToImage", (void *)CmdCopyBufferToImage}, + {"vkCmdCopyImageToBuffer", (void *)CmdCopyImageToBuffer}, + {"vkCmdUpdateBuffer", (void *)CmdUpdateBuffer}, + {"vkCmdFillBuffer", (void *)CmdFillBuffer}, + {"vkCmdClearColorImage", (void *)CmdClearColorImage}, + {"vkCmdClearDepthStencilImage", (void *)CmdClearDepthStencilImage}, + {"vkCmdClearAttachments", (void *)CmdClearAttachments}, + {"vkCmdResolveImage", (void *)CmdResolveImage}, + {"vkGetImageSubresourceLayout", (void *)GetImageSubresourceLayout}, + {"vkCmdSetEvent", (void *)CmdSetEvent}, + {"vkCmdResetEvent", (void *)CmdResetEvent}, + {"vkCmdWaitEvents", (void *)CmdWaitEvents}, + {"vkCmdPipelineBarrier", (void *)CmdPipelineBarrier}, + {"vkCmdBeginQuery", (void *)CmdBeginQuery}, + {"vkCmdEndQuery", (void *)CmdEndQuery}, + {"vkCmdResetQueryPool", (void *)CmdResetQueryPool}, + {"vkCmdCopyQueryPoolResults", (void *)CmdCopyQueryPoolResults}, + {"vkCmdPushConstants", (void *)CmdPushConstants}, + {"vkCmdWriteTimestamp", (void *)CmdWriteTimestamp}, + {"vkCreateFramebuffer", (void *)CreateFramebuffer}, + {"vkCreateShaderModule", (void *)CreateShaderModule}, + {"vkCreateRenderPass", (void *)CreateRenderPass}, + {"vkCmdBeginRenderPass", (void *)CmdBeginRenderPass}, + {"vkCmdNextSubpass", (void *)CmdNextSubpass}, + {"vkCmdEndRenderPass", (void *)CmdEndRenderPass}, + {"vkCmdExecuteCommands", (void *)CmdExecuteCommands}, + {"vkCmdDebugMarkerBeginEXT", (void *)CmdDebugMarkerBeginEXT}, + {"vkCmdDebugMarkerEndEXT", (void *)CmdDebugMarkerEndEXT}, + {"vkCmdDebugMarkerInsertEXT", (void *)CmdDebugMarkerInsertEXT}, + {"vkDebugMarkerSetObjectNameEXT", (void *)DebugMarkerSetObjectNameEXT}, + {"vkDebugMarkerSetObjectTagEXT", (void *)DebugMarkerSetObjectTagEXT}, + {"vkSetEvent", (void *)SetEvent}, + {"vkMapMemory", (void *)MapMemory}, + {"vkUnmapMemory", (void *)UnmapMemory}, + {"vkFlushMappedMemoryRanges", (void *)FlushMappedMemoryRanges}, + {"vkInvalidateMappedMemoryRanges", (void *)InvalidateMappedMemoryRanges}, + {"vkAllocateMemory", (void *)AllocateMemory}, + {"vkFreeMemory", (void *)FreeMemory}, + {"vkBindBufferMemory", (void *)BindBufferMemory}, + {"vkBindBufferMemory2", (void *)BindBufferMemory2}, + {"vkBindBufferMemory2KHR", (void *)BindBufferMemory2KHR}, + {"vkGetBufferMemoryRequirements", (void *)GetBufferMemoryRequirements}, + {"vkGetBufferMemoryRequirements2", (void *)GetBufferMemoryRequirements2}, + {"vkGetBufferMemoryRequirements2KHR", (void *)GetBufferMemoryRequirements2KHR}, + {"vkGetImageMemoryRequirements", (void *)GetImageMemoryRequirements}, + {"vkGetImageMemoryRequirements2", (void *)GetImageMemoryRequirements2}, + {"vkGetImageMemoryRequirements2KHR", (void *)GetImageMemoryRequirements2KHR}, + {"vkGetImageSparseMemoryRequirements", (void *)GetImageSparseMemoryRequirements}, + {"vkGetImageSparseMemoryRequirements2", (void *)GetImageSparseMemoryRequirements2}, + {"vkGetImageSparseMemoryRequirements2KHR", (void *)GetImageSparseMemoryRequirements2KHR}, + {"vkGetPhysicalDeviceSparseImageFormatProperties", (void *)GetPhysicalDeviceSparseImageFormatProperties}, + {"vkGetPhysicalDeviceSparseImageFormatProperties2", (void *)GetPhysicalDeviceSparseImageFormatProperties2}, + {"vkGetPhysicalDeviceSparseImageFormatProperties2KHR", (void *)GetPhysicalDeviceSparseImageFormatProperties2KHR}, + {"vkGetQueryPoolResults", (void *)GetQueryPoolResults}, + {"vkBindImageMemory", (void *)BindImageMemory}, + {"vkBindImageMemory2", (void *)BindImageMemory2}, + {"vkBindImageMemory2KHR", (void *)BindImageMemory2KHR}, + {"vkQueueBindSparse", (void *)QueueBindSparse}, + {"vkCreateSemaphore", (void *)CreateSemaphore}, + {"vkCreateEvent", (void *)CreateEvent}, #ifdef VK_USE_PLATFORM_ANDROID_KHR - {"vkCreateAndroidSurfaceKHR", (void*)CreateAndroidSurfaceKHR}, + {"vkCreateAndroidSurfaceKHR", (void *)CreateAndroidSurfaceKHR}, #endif #ifdef VK_USE_PLATFORM_MIR_KHR - {"vkCreateMirSurfaceKHR", (void*)CreateMirSurfaceKHR}, - {"vkGetPhysicalDeviceMirPresentationSupportKHR", (void*)GetPhysicalDeviceMirPresentationSupportKHR}, + {"vkCreateMirSurfaceKHR", (void *)CreateMirSurfaceKHR}, + {"vkGetPhysicalDeviceMirPresentationSupportKHR", (void *)GetPhysicalDeviceMirPresentationSupportKHR}, #endif #ifdef VK_USE_PLATFORM_WAYLAND_KHR - {"vkCreateWaylandSurfaceKHR", (void*)CreateWaylandSurfaceKHR}, - {"vkGetPhysicalDeviceWaylandPresentationSupportKHR", (void*)GetPhysicalDeviceWaylandPresentationSupportKHR}, + {"vkCreateWaylandSurfaceKHR", (void *)CreateWaylandSurfaceKHR}, + {"vkGetPhysicalDeviceWaylandPresentationSupportKHR", (void *)GetPhysicalDeviceWaylandPresentationSupportKHR}, #endif #ifdef VK_USE_PLATFORM_WIN32_KHR - {"vkCreateWin32SurfaceKHR", (void*)CreateWin32SurfaceKHR}, - {"vkGetPhysicalDeviceWin32PresentationSupportKHR", (void*)GetPhysicalDeviceWin32PresentationSupportKHR}, - {"vkImportSemaphoreWin32HandleKHR", (void*)ImportSemaphoreWin32HandleKHR}, - {"vkGetSemaphoreWin32HandleKHR", (void*)GetSemaphoreWin32HandleKHR}, - {"vkImportFenceWin32HandleKHR", (void*)ImportFenceWin32HandleKHR}, - {"vkGetFenceWin32HandleKHR", (void*)GetFenceWin32HandleKHR}, + {"vkCreateWin32SurfaceKHR", (void *)CreateWin32SurfaceKHR}, + {"vkGetPhysicalDeviceWin32PresentationSupportKHR", (void *)GetPhysicalDeviceWin32PresentationSupportKHR}, + {"vkImportSemaphoreWin32HandleKHR", (void *)ImportSemaphoreWin32HandleKHR}, + {"vkGetSemaphoreWin32HandleKHR", (void *)GetSemaphoreWin32HandleKHR}, + {"vkImportFenceWin32HandleKHR", (void *)ImportFenceWin32HandleKHR}, + {"vkGetFenceWin32HandleKHR", (void *)GetFenceWin32HandleKHR}, #endif #ifdef VK_USE_PLATFORM_XCB_KHR - {"vkCreateXcbSurfaceKHR", (void*)CreateXcbSurfaceKHR}, - {"vkGetPhysicalDeviceXcbPresentationSupportKHR", (void*)GetPhysicalDeviceXcbPresentationSupportKHR}, + {"vkCreateXcbSurfaceKHR", (void *)CreateXcbSurfaceKHR}, + {"vkGetPhysicalDeviceXcbPresentationSupportKHR", (void *)GetPhysicalDeviceXcbPresentationSupportKHR}, #endif #ifdef VK_USE_PLATFORM_XLIB_KHR - {"vkCreateXlibSurfaceKHR", (void*)CreateXlibSurfaceKHR}, - {"vkGetPhysicalDeviceXlibPresentationSupportKHR", (void*)GetPhysicalDeviceXlibPresentationSupportKHR}, + {"vkCreateXlibSurfaceKHR", (void *)CreateXlibSurfaceKHR}, + {"vkGetPhysicalDeviceXlibPresentationSupportKHR", (void *)GetPhysicalDeviceXlibPresentationSupportKHR}, +#endif +#ifdef VK_USE_PLATFORM_IOS_MVK + {"vkCreateIOSSurfaceMVK", (void *)CreateIOSSurfaceMVK}, +#endif +#ifdef VK_USE_PLATFORM_MACOS_MVK + {"vkCreateMacOSSurfaceMVK", (void *)CreateMacOSSurfaceMVK}, #endif - {"vkCreateDisplayPlaneSurfaceKHR", (void*)CreateDisplayPlaneSurfaceKHR}, - {"vkDestroySurfaceKHR", (void*)DestroySurfaceKHR}, - {"vkGetPhysicalDeviceSurfaceCapabilitiesKHR", (void*)GetPhysicalDeviceSurfaceCapabilitiesKHR}, - {"vkGetPhysicalDeviceSurfaceCapabilities2KHR", (void*)GetPhysicalDeviceSurfaceCapabilities2KHR}, - {"vkGetPhysicalDeviceSurfaceCapabilities2EXT", (void*)GetPhysicalDeviceSurfaceCapabilities2EXT}, - {"vkGetPhysicalDeviceSurfaceSupportKHR", (void*)GetPhysicalDeviceSurfaceSupportKHR}, - {"vkGetPhysicalDeviceSurfacePresentModesKHR", (void*)GetPhysicalDeviceSurfacePresentModesKHR}, - {"vkGetPhysicalDeviceSurfaceFormatsKHR", (void*)GetPhysicalDeviceSurfaceFormatsKHR}, - {"vkGetPhysicalDeviceSurfaceFormats2KHR", (void*)GetPhysicalDeviceSurfaceFormats2KHR}, - {"vkGetPhysicalDeviceQueueFamilyProperties2KHR", (void*)GetPhysicalDeviceQueueFamilyProperties2KHR}, - {"vkEnumeratePhysicalDeviceGroupsKHX", (void*)EnumeratePhysicalDeviceGroupsKHX}, - {"vkCreateDebugReportCallbackEXT", (void*)CreateDebugReportCallbackEXT}, - {"vkDestroyDebugReportCallbackEXT", (void*)DestroyDebugReportCallbackEXT}, - {"vkDebugReportMessageEXT", (void*)DebugReportMessageEXT}, - {"vkGetPhysicalDeviceDisplayPlanePropertiesKHR", (void*)GetPhysicalDeviceDisplayPlanePropertiesKHR}, - {"vkGetDisplayPlaneSupportedDisplaysKHR", (void*)GetDisplayPlaneSupportedDisplaysKHR}, - {"vkGetDisplayPlaneCapabilitiesKHR", (void*)GetDisplayPlaneCapabilitiesKHR}, - {"vkImportSemaphoreFdKHR", (void*)ImportSemaphoreFdKHR}, - {"vkGetSemaphoreFdKHR", (void*)GetSemaphoreFdKHR}, - {"vkImportFenceFdKHR", (void*)ImportFenceFdKHR}, - {"vkGetFenceFdKHR", (void*)GetFenceFdKHR}, + {"vkCreateDisplayPlaneSurfaceKHR", (void *)CreateDisplayPlaneSurfaceKHR}, + {"vkDestroySurfaceKHR", (void *)DestroySurfaceKHR}, + {"vkGetPhysicalDeviceSurfaceCapabilitiesKHR", (void *)GetPhysicalDeviceSurfaceCapabilitiesKHR}, + {"vkGetPhysicalDeviceSurfaceCapabilities2KHR", (void *)GetPhysicalDeviceSurfaceCapabilities2KHR}, + {"vkGetPhysicalDeviceSurfaceCapabilities2EXT", (void *)GetPhysicalDeviceSurfaceCapabilities2EXT}, + {"vkGetPhysicalDeviceSurfaceSupportKHR", (void *)GetPhysicalDeviceSurfaceSupportKHR}, + {"vkGetPhysicalDeviceSurfacePresentModesKHR", (void *)GetPhysicalDeviceSurfacePresentModesKHR}, + {"vkGetPhysicalDeviceSurfaceFormatsKHR", (void *)GetPhysicalDeviceSurfaceFormatsKHR}, + {"vkGetPhysicalDeviceSurfaceFormats2KHR", (void *)GetPhysicalDeviceSurfaceFormats2KHR}, + {"vkGetPhysicalDeviceQueueFamilyProperties2", (void *)GetPhysicalDeviceQueueFamilyProperties2}, + {"vkGetPhysicalDeviceQueueFamilyProperties2KHR", (void *)GetPhysicalDeviceQueueFamilyProperties2KHR}, + {"vkEnumeratePhysicalDeviceGroups", (void *)EnumeratePhysicalDeviceGroups}, + {"vkEnumeratePhysicalDeviceGroupsKHR", (void *)EnumeratePhysicalDeviceGroupsKHR}, + {"vkCreateDebugReportCallbackEXT", (void *)CreateDebugReportCallbackEXT}, + {"vkDestroyDebugReportCallbackEXT", (void *)DestroyDebugReportCallbackEXT}, + {"vkDebugReportMessageEXT", (void *)DebugReportMessageEXT}, + {"vkGetPhysicalDeviceDisplayPlanePropertiesKHR", (void *)GetPhysicalDeviceDisplayPlanePropertiesKHR}, + {"vkGetDisplayPlaneSupportedDisplaysKHR", (void *)GetDisplayPlaneSupportedDisplaysKHR}, + {"vkGetDisplayPlaneCapabilitiesKHR", (void *)GetDisplayPlaneCapabilitiesKHR}, + {"vkImportSemaphoreFdKHR", (void *)ImportSemaphoreFdKHR}, + {"vkGetSemaphoreFdKHR", (void *)GetSemaphoreFdKHR}, + {"vkImportFenceFdKHR", (void *)ImportFenceFdKHR}, + {"vkGetFenceFdKHR", (void *)GetFenceFdKHR}, + {"vkCreateValidationCacheEXT", (void *)CreateValidationCacheEXT}, + {"vkDestroyValidationCacheEXT", (void *)DestroyValidationCacheEXT}, + {"vkGetValidationCacheDataEXT", (void *)GetValidationCacheDataEXT}, + {"vkMergeValidationCachesEXT", (void *)MergeValidationCachesEXT}, + {"vkCmdSetDiscardRectangleEXT", (void *)CmdSetDiscardRectangleEXT}, + {"vkCmdSetSampleLocationsEXT", (void *)CmdSetSampleLocationsEXT}, + {"vkSetDebugUtilsObjectNameEXT", (void *)SetDebugUtilsObjectNameEXT}, + {"vkSetDebugUtilsObjectTagEXT", (void *)SetDebugUtilsObjectTagEXT}, + {"vkQueueBeginDebugUtilsLabelEXT", (void *)QueueBeginDebugUtilsLabelEXT}, + {"vkQueueEndDebugUtilsLabelEXT", (void *)QueueEndDebugUtilsLabelEXT}, + {"vkQueueInsertDebugUtilsLabelEXT", (void *)QueueInsertDebugUtilsLabelEXT}, + {"vkCmdBeginDebugUtilsLabelEXT", (void *)CmdBeginDebugUtilsLabelEXT}, + {"vkCmdEndDebugUtilsLabelEXT", (void *)CmdEndDebugUtilsLabelEXT}, + {"vkCmdInsertDebugUtilsLabelEXT", (void *)CmdInsertDebugUtilsLabelEXT}, + {"vkCreateDebugUtilsMessengerEXT", (void *)CreateDebugUtilsMessengerEXT}, + {"vkDestroyDebugUtilsMessengerEXT", (void *)DestroyDebugUtilsMessengerEXT}, + {"vkSubmitDebugUtilsMessageEXT", (void *)SubmitDebugUtilsMessageEXT}, }; VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetDeviceProcAddr(VkDevice device, const char *funcName) { diff -Nru vulkan-1.0.65.2+dfsg1/layers/core_validation_error_enums.h vulkan-1.1.73+dfsg/layers/core_validation_error_enums.h --- vulkan-1.0.65.2+dfsg1/layers/core_validation_error_enums.h 2017-07-03 14:21:22.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/core_validation_error_enums.h 2018-03-14 09:08:48.000000000 +0000 @@ -203,25 +203,25 @@ }; enum SWAPCHAIN_ERROR { - SWAPCHAIN_INVALID_HANDLE, // Handle used that isn't currently valid - SWAPCHAIN_NULL_POINTER, // Pointer set to NULL, instead of being a valid pointer - SWAPCHAIN_EXT_NOT_ENABLED_BUT_USED, // Did not enable WSI extension, but called WSI function - SWAPCHAIN_DEL_OBJECT_BEFORE_CHILDREN, // Called vkDestroyDevice() before vkDestroySwapchainKHR() - SWAPCHAIN_CREATE_UNSUPPORTED_SURFACE, // Called vkCreateSwapchainKHR() with a pCreateInfo->surface that wasn't supported - SWAPCHAIN_CREATE_SWAP_WITHOUT_QUERY, // Called vkCreateSwapchainKHR() without calling a query - SWAPCHAIN_CREATE_SWAP_OUT_OF_BOUNDS_EXTENTS, // Called vkCreateSwapchainKHR() with out-of-bounds imageExtent - SWAPCHAIN_CREATE_SWAP_EXTENTS_NO_MATCH_WIN, // Called vkCreateSwapchainKHR w/imageExtent that doesn't match window's extent - SWAPCHAIN_CREATE_SWAP_BAD_PRE_TRANSFORM, // Called vkCreateSwapchainKHR() with a non-supported preTransform - SWAPCHAIN_CREATE_SWAP_BAD_COMPOSITE_ALPHA, // Called vkCreateSwapchainKHR() with a non-supported compositeAlpha - SWAPCHAIN_CREATE_SWAP_BAD_IMG_ARRAY_LAYERS, // Called vkCreateSwapchainKHR() with a non-supported imageArrayLayers - SWAPCHAIN_CREATE_SWAP_BAD_IMG_USAGE_FLAGS, // Called vkCreateSwapchainKHR() with a non-supported imageUsageFlags - SWAPCHAIN_CREATE_SWAP_BAD_IMG_COLOR_SPACE, // Called vkCreateSwapchainKHR() with a non-supported imageColorSpace - SWAPCHAIN_CREATE_SWAP_BAD_IMG_FORMAT, // Called vkCreateSwapchainKHR() with a non-supported imageFormat - SWAPCHAIN_CREATE_SWAP_BAD_IMG_FMT_CLR_SP, // Called vkCreateSwapchainKHR() with a non-supported imageColorSpace - SWAPCHAIN_CREATE_SWAP_BAD_PRESENT_MODE, // Called vkCreateSwapchainKHR() with a non-supported presentMode - SWAPCHAIN_CREATE_SWAP_BAD_SHARING_MODE, // Called vkCreateSwapchainKHR() with a non-supported imageSharingMode - SWAPCHAIN_CREATE_SWAP_BAD_SHARING_VALUES, // Called vkCreateSwapchainKHR() with bad values when imageSharingMode is - // VK_SHARING_MODE_CONCURRENT + SWAPCHAIN_INVALID_HANDLE, // Handle used that isn't currently valid + SWAPCHAIN_NULL_POINTER, // Pointer set to NULL, instead of being a valid pointer + SWAPCHAIN_EXT_NOT_ENABLED_BUT_USED, // Did not enable WSI extension, but called WSI function + SWAPCHAIN_DEL_OBJECT_BEFORE_CHILDREN, // Called vkDestroyDevice() before vkDestroySwapchainKHR() + SWAPCHAIN_CREATE_UNSUPPORTED_SURFACE, // Called vkCreateSwapchainKHR() with a pCreateInfo->surface that wasn't supported + SWAPCHAIN_CREATE_SWAP_WITHOUT_QUERY, // Called vkCreateSwapchainKHR() without calling a query + SWAPCHAIN_CREATE_SWAP_OUT_OF_BOUNDS_EXTENTS, // Called vkCreateSwapchainKHR() with out-of-bounds imageExtent + SWAPCHAIN_CREATE_SWAP_EXTENTS_NO_MATCH_WIN, // Called vkCreateSwapchainKHR w/imageExtent that doesn't match window's extent + SWAPCHAIN_CREATE_SWAP_BAD_PRE_TRANSFORM, // Called vkCreateSwapchainKHR() with a non-supported preTransform + SWAPCHAIN_CREATE_SWAP_BAD_COMPOSITE_ALPHA, // Called vkCreateSwapchainKHR() with a non-supported compositeAlpha + SWAPCHAIN_CREATE_SWAP_BAD_IMG_ARRAY_LAYERS, // Called vkCreateSwapchainKHR() with a non-supported imageArrayLayers + SWAPCHAIN_CREATE_SWAP_BAD_IMG_USAGE_FLAGS, // Called vkCreateSwapchainKHR() with a non-supported imageUsageFlags + SWAPCHAIN_CREATE_SWAP_BAD_IMG_COLOR_SPACE, // Called vkCreateSwapchainKHR() with a non-supported imageColorSpace + SWAPCHAIN_CREATE_SWAP_BAD_IMG_FORMAT, // Called vkCreateSwapchainKHR() with a non-supported imageFormat + SWAPCHAIN_CREATE_SWAP_BAD_IMG_FMT_CLR_SP, // Called vkCreateSwapchainKHR() with a non-supported imageColorSpace + SWAPCHAIN_CREATE_SWAP_BAD_PRESENT_MODE, // Called vkCreateSwapchainKHR() with a non-supported presentMode + SWAPCHAIN_CREATE_SWAP_BAD_SHARING_MODE, // Called vkCreateSwapchainKHR() with a non-supported imageSharingMode + SWAPCHAIN_CREATE_SWAP_BAD_SHARING_VALUES, // Called vkCreateSwapchainKHR() with bad values when imageSharingMode is + // VK_SHARING_MODE_CONCURRENT SWAPCHAIN_BAD_BOOL, // VkBool32 that doesn't have value of VK_TRUE or VK_FALSE (e.g. is a non-zero form of true) SWAPCHAIN_PRIOR_COUNT, // Query must be called first to get value of pCount, then called second time SWAPCHAIN_INVALID_COUNT, // Second time a query called, the pCount value didn't match first time diff -Nru vulkan-1.0.65.2+dfsg1/layers/core_validation.h vulkan-1.1.73+dfsg/layers/core_validation.h --- vulkan-1.0.65.2+dfsg1/layers/core_validation.h 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/core_validation.h 2018-04-27 11:24:19.000000000 +0000 @@ -21,29 +21,6 @@ * Author: Mark Lobodzinski */ -#ifndef NOEXCEPT -// Check for noexcept support -#if defined(__clang__) -#if __has_feature(cxx_noexcept) -#define HAS_NOEXCEPT -#endif -#else -#if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ * 10 + __GNUC_MINOR__ >= 46 -#define HAS_NOEXCEPT -#else -#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026 && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS -#define HAS_NOEXCEPT -#endif -#endif -#endif - -#ifdef HAS_NOEXCEPT -#define NOEXCEPT noexcept -#else -#define NOEXCEPT -#endif -#endif - #pragma once #include "core_validation_error_enums.h" #include "vk_validation_error_messages.h" @@ -91,13 +68,6 @@ // TODO : Is there a way to track when Cmd Buffer finishes & remove mem references at that point? // TODO : Could potentially store a list of freed mem allocs to flag when they're incorrectly used - - -struct GENERIC_HEADER { - VkStructureType sType; - const void *pNext; -}; - enum SyncScope { kSyncScopeInternal, kSyncScopeExternalTemporary, @@ -184,7 +154,7 @@ return hash()((uint64_t)(gq.gpu)) ^ hash()(gq.queue_family_index); } }; -} +} // namespace std struct SURFACE_STATE { VkSurfaceKHR surface = VK_NULL_HANDLE; diff -Nru vulkan-1.0.65.2+dfsg1/layers/core_validation_layer.md vulkan-1.1.73+dfsg/layers/core_validation_layer.md --- vulkan-1.0.65.2+dfsg1/layers/core_validation_layer.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/core_validation_layer.md 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,44 @@ +# VK\_LAYER\_LUNARG\_core\_validation +The `VK_LAYER_LUNARG_core_validation` layer validates the status of descriptor sets, command buffers, shader modules, pipeline states, renderpass usage, synchronization, dynamic states and is the workhorse layer for many other types of valid usage. + +`VK_LAYER_LUNARG_core_validation` validates that: + + - the descriptor set state and pipeline state at each draw call are consistent + - pipelines are created correctly, known when used and bound at draw time + - descriptor sets are known and consist of valid types, formats, and layout + - descriptor set regions are valid, bound, and updated appropriately + - command buffers referenced are known and valid + - command sequencing for specific state dependencies and renderpass use is correct + - memory is available + - dynamic state is correctly set. + +The `VK_LAYER_LUNARG_core_validation` layer will print errors if validation checks are not correctly met. `VK_LAYER_LUNARG_core_validation` will also display the values of the objects tracked. + +## Memory/Resource related functionality +This layer additionally attempts to ensure that memory objects are managed correctly by the application. These memory objects may be bound to pipelines, objects, and command buffers, and then submitted to the GPU for work. Specifically the layer validates that: + + - the correct memory objects have been bound + - memory objects are specified correctly upon command buffer submittal + - only existing memory objects are referenced + - destroyed memory objects are not referenced + - the application has confirmed any memory objects to be reused or destroyed have been properly unbound + - checks texture formats and render target formats. + +Errors will be printed if validation checks are not correctly met and warnings if improper (but not illegal) use of memory is detected. This validation layer also dumps all memory references and bindings for each operation. + +## Shader validation functionality +Checks performed by this layer apply to the VS->FS and FS->CB interfaces with the pipeline. These checks include: + + - validating that all variables which are part of a shader interface are decorated with either `spv::DecLocation` or `spv::DecBuiltin` (that is, only the SSO rendezvous-by-location model is supported) + - emitting a warning if a location is declared only in the producing stage (useless work is being done) + - emitting an error if a location is declared only in the consuming stage (garbage will be read). + +A special error checking case invoked when the FS stage writes a built-in corresponding to the legacy `gl_FragColor`. In this case, an error is emitted if + + - the FS also writes any user-defined output + - the CB has any attachment with a `UINT` or `SINT` type. + +These extra checks are to ensure that the legacy broadcast of `gl_FragColor` to all bound color attachments is well-defined. + +## Swapchain validation functionality +This area of functionality validates the use of the WSI (Window System Integration) "swapchain" extensions (i.e., `VK_EXT_KHR_swapchain` and `VK_EXT_KHR_device_swapchain`). diff -Nru vulkan-1.0.65.2+dfsg1/layers/core_validation_types.h vulkan-1.1.73+dfsg/layers/core_validation_types.h --- vulkan-1.0.65.2+dfsg1/layers/core_validation_types.h 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/core_validation_types.h 2018-04-27 11:24:19.000000000 +0000 @@ -23,29 +23,7 @@ #ifndef CORE_VALIDATION_TYPES_H_ #define CORE_VALIDATION_TYPES_H_ -#ifndef NOEXCEPT -// Check for noexcept support -#if defined(__clang__) -#if __has_feature(cxx_noexcept) -#define HAS_NOEXCEPT -#endif -#else -#if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ * 10 + __GNUC_MINOR__ >= 46 -#define HAS_NOEXCEPT -#else -#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026 && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS -#define HAS_NOEXCEPT -#endif -#endif -#endif - -#ifdef HAS_NOEXCEPT -#define NOEXCEPT noexcept -#else -#define NOEXCEPT -#endif -#endif - +#include "hash_vk_types.h" #include "vk_safe_struct.h" #include "vulkan/vulkan.h" #include "vk_validation_error_messages.h" @@ -62,11 +40,12 @@ #include #include -// Fwd declarations +// Fwd declarations -- including descriptor_set.h creates an ugly include loop namespace cvdescriptorset { +class DescriptorSetLayoutDef; class DescriptorSetLayout; class DescriptorSet; -}; +} // namespace cvdescriptorset struct GLOBAL_CB_NODE; @@ -93,10 +72,26 @@ struct COMMAND_POOL_NODE : public BASE_NODE { VkCommandPoolCreateFlags createFlags; uint32_t queueFamilyIndex; - // TODO: why is this std::list? - std::list commandBuffers; // container of cmd buffers allocated from this pool + // Cmd buffers allocated from this pool + std::unordered_set commandBuffers; }; +// Utilities for barriers and the commmand pool +template +static bool IsTransferOp(const Barrier *barrier) { + return barrier->srcQueueFamilyIndex != barrier->dstQueueFamilyIndex; +} + +template +static bool IsReleaseOp(const COMMAND_POOL_NODE *pool, const Barrier *barrier) { + return (assume_transfer || IsTransferOp(barrier)) && (pool->queueFamilyIndex == barrier->srcQueueFamilyIndex); +} + +template +static bool IsAcquireOp(const COMMAND_POOL_NODE *pool, const Barrier *barrier) { + return (assume_transfer || IsTransferOp(barrier)) && (pool->queueFamilyIndex == barrier->dstQueueFamilyIndex); +} + // Generic wrapper for vulkan objects struct VK_OBJECT { uint64_t handle; @@ -110,10 +105,10 @@ struct hash { size_t operator()(VK_OBJECT obj) const NOEXCEPT { return hash()(obj.handle) ^ hash()(obj.type); } }; -} +} // namespace std class PHYS_DEV_PROPERTIES_NODE { -public: + public: VkPhysicalDeviceProperties properties; std::vector queue_family_properties; }; @@ -180,7 +175,7 @@ return intermediate ^ hash()(mb.size); } }; -} +} // namespace std // Superclass for bindable object state (currently images and buffers) class BINDABLE : public BASE_NODE { @@ -196,19 +191,28 @@ // There's more data for sparse bindings so need better long-term solution // TODO : Need to update solution to track all sparse binding data std::unordered_set sparse_bindings; - BINDABLE() : sparse(false), binding{}, requirements{}, memory_requirements_checked(false), sparse_bindings{} {}; - // Return unordered set of memory objects that are bound - std::unordered_set GetBoundMemory() { - std::unordered_set mem_set; + + std::unordered_set bound_memory_set_; + + BINDABLE() + : sparse(false), binding{}, requirements{}, memory_requirements_checked(false), sparse_bindings{}, bound_memory_set_{} {}; + + // Update the cached set of memory bindings. + // Code that changes binding.mem or sparse_bindings must call UpdateBoundMemorySet() + void UpdateBoundMemorySet() { + bound_memory_set_.clear(); if (!sparse) { - mem_set.insert(binding.mem); + bound_memory_set_.insert(binding.mem); } else { for (auto sb : sparse_bindings) { - mem_set.insert(sb.mem); + bound_memory_set_.insert(sb.mem); } } - return mem_set; } + + // Return unordered set of memory objects that are bound + // Instead of creating a set from scratch each query, return the cached one + const std::unordered_set &GetBoundMemory() const { return bound_memory_set_; } }; class BUFFER_STATE : public BINDABLE { @@ -233,7 +237,7 @@ ~BUFFER_STATE() { if ((createInfo.sharingMode == VK_SHARING_MODE_CONCURRENT) && (createInfo.queueFamilyIndexCount > 0)) { - delete [] createInfo.pQueueFamilyIndices; + delete[] createInfo.pQueueFamilyIndices; createInfo.pQueueFamilyIndices = nullptr; } }; @@ -258,12 +262,25 @@ public: VkImage image; VkImageCreateInfo createInfo; - bool valid; // If this is a swapchain image backing memory track valid here as it doesn't have DEVICE_MEM_INFO - bool acquired; // If this is a swapchain image, has it been acquired by the app. - bool shared_presentable; // True for a front-buffered swapchain image - bool layout_locked; // A front-buffered image that has been presented can never have layout transitioned + bool valid; // If this is a swapchain image backing memory track valid here as it doesn't have DEVICE_MEM_INFO + bool acquired; // If this is a swapchain image, has it been acquired by the app. + bool shared_presentable; // True for a front-buffered swapchain image + bool layout_locked; // A front-buffered image that has been presented can never have layout transitioned + bool get_sparse_reqs_called; // Track if GetImageSparseMemoryRequirements() has been called for this image + bool sparse_metadata_required; // Track if sparse metadata aspect is required for this image + bool sparse_metadata_bound; // Track if sparse metadata aspect is bound to this image + std::vector sparse_requirements; IMAGE_STATE(VkImage img, const VkImageCreateInfo *pCreateInfo) - : image(img), createInfo(*pCreateInfo), valid(false), acquired(false), shared_presentable(false), layout_locked(false) { + : image(img), + createInfo(*pCreateInfo), + valid(false), + acquired(false), + shared_presentable(false), + layout_locked(false), + get_sparse_reqs_called(false), + sparse_metadata_required(false), + sparse_metadata_bound(false), + sparse_requirements{} { if ((createInfo.sharingMode == VK_SHARING_MODE_CONCURRENT) && (createInfo.queueFamilyIndexCount > 0)) { uint32_t *pQueueFamilyIndices = new uint32_t[createInfo.queueFamilyIndexCount]; for (uint32_t i = 0; i < createInfo.queueFamilyIndexCount; i++) { @@ -281,7 +298,7 @@ ~IMAGE_STATE() { if ((createInfo.sharingMode == VK_SHARING_MODE_CONCURRENT) && (createInfo.queueFamilyIndexCount > 0)) { - delete [] createInfo.pQueueFamilyIndices; + delete[] createInfo.pQueueFamilyIndices; createInfo.pQueueFamilyIndices = nullptr; } }; @@ -316,9 +333,12 @@ // Data struct for tracking memory object struct DEVICE_MEM_INFO : public BASE_NODE { void *object; // Dispatchable object used to create this memory (device of swapchain) - bool global_valid; // If allocation is mapped, set to "true" to be picked up by subsequently bound ranges + bool global_valid; // If allocation is mapped or external, set to "true" to be picked up by subsequently bound ranges VkDeviceMemory mem; VkMemoryAllocateInfo alloc_info; + bool is_dedicated; + VkBuffer dedicated_buffer; + VkImage dedicated_image; std::unordered_set obj_bindings; // objects bound to this memory std::unordered_map bound_ranges; // Map of object to its binding range // Convenience vectors image/buff handles to speed up iterating over images or buffers independently @@ -337,6 +357,9 @@ global_valid(false), mem(in_mem), alloc_info(*p_alloc_info), + is_dedicated(false), + dedicated_buffer(VK_NULL_HANDLE), + dedicated_image(VK_NULL_HANDLE), mem_range{}, shadow_copy_base(0), shadow_copy(0), @@ -385,69 +408,79 @@ RENDER_PASS_STATE(VkRenderPassCreateInfo const *pCreateInfo) : createInfo(pCreateInfo) {} }; -// Cmd Buffer Tracking +// vkCmd tracking -- complete as of header 1.0.68 +// please keep in "none, then sorted" order +// Note: grepping vulkan.h for VKAPI_CALL.*vkCmd will return all functions except vkEndCommandBuffer + enum CMD_TYPE { CMD_NONE, - CMD_BINDPIPELINE, - CMD_BINDPIPELINEDELTA, - CMD_SETVIEWPORTSTATE, - CMD_SETSCISSORSTATE, - CMD_SETLINEWIDTHSTATE, - CMD_SETDEPTHBIASSTATE, - CMD_SETBLENDSTATE, - CMD_SETDEPTHBOUNDSSTATE, - CMD_SETSTENCILREADMASKSTATE, - CMD_SETSTENCILWRITEMASKSTATE, - CMD_SETSTENCILREFERENCESTATE, + CMD_BEGINQUERY, + CMD_BEGINRENDERPASS, CMD_BINDDESCRIPTORSETS, CMD_BINDINDEXBUFFER, - CMD_BINDVERTEXBUFFER, + CMD_BINDPIPELINE, + CMD_BINDVERTEXBUFFERS, + CMD_BLITIMAGE, + CMD_CLEARATTACHMENTS, + CMD_CLEARCOLORIMAGE, + CMD_CLEARDEPTHSTENCILIMAGE, + CMD_COPYBUFFER, + CMD_COPYBUFFERTOIMAGE, + CMD_COPYIMAGE, + CMD_COPYIMAGETOBUFFER, + CMD_COPYQUERYPOOLRESULTS, + CMD_DEBUGMARKERBEGINEXT, + CMD_DEBUGMARKERENDEXT, + CMD_DEBUGMARKERINSERTEXT, + CMD_DISPATCH, + CMD_DISPATCHBASEKHX, + CMD_DISPATCHINDIRECT, CMD_DRAW, CMD_DRAWINDEXED, - CMD_DRAWINDIRECT, - CMD_DRAWINDIRECTCOUNTAMD, CMD_DRAWINDEXEDINDIRECT, CMD_DRAWINDEXEDINDIRECTCOUNTAMD, - CMD_DISPATCH, - CMD_DISPATCHINDIRECT, - CMD_COPYBUFFER, - CMD_COPYIMAGE, - CMD_BLITIMAGE, - CMD_COPYBUFFERTOIMAGE, - CMD_COPYIMAGETOBUFFER, - CMD_CLONEIMAGEDATA, - CMD_UPDATEBUFFER, + CMD_DRAWINDIRECT, + CMD_DRAWINDIRECTCOUNTAMD, + CMD_ENDCOMMANDBUFFER, // Should be the last command in any RECORDED cmd buffer + CMD_ENDQUERY, + CMD_ENDRENDERPASS, + CMD_EXECUTECOMMANDS, CMD_FILLBUFFER, - CMD_CLEARCOLORIMAGE, - CMD_CLEARATTACHMENTS, - CMD_CLEARDEPTHSTENCILIMAGE, + CMD_NEXTSUBPASS, + CMD_PIPELINEBARRIER, + CMD_PROCESSCOMMANDSNVX, + CMD_PUSHCONSTANTS, + CMD_PUSHDESCRIPTORSETKHR, + CMD_PUSHDESCRIPTORSETWITHTEMPLATEKHR, + CMD_RESERVESPACEFORCOMMANDSNVX, + CMD_RESETEVENT, + CMD_RESETQUERYPOOL, CMD_RESOLVEIMAGE, + CMD_SETBLENDCONSTANTS, + CMD_SETDEPTHBIAS, + CMD_SETDEPTHBOUNDS, + CMD_SETDEVICEMASKKHX, + CMD_SETDISCARDRECTANGLEEXT, CMD_SETEVENT, - CMD_RESETEVENT, + CMD_SETLINEWIDTH, + CMD_SETSAMPLELOCATIONSEXT, + CMD_SETSCISSOR, + CMD_SETSTENCILCOMPAREMASK, + CMD_SETSTENCILREFERENCE, + CMD_SETSTENCILWRITEMASK, + CMD_SETVIEWPORT, + CMD_SETVIEWPORTWSCALINGNV, + CMD_UPDATEBUFFER, CMD_WAITEVENTS, - CMD_PIPELINEBARRIER, - CMD_BEGINQUERY, - CMD_ENDQUERY, - CMD_RESETQUERYPOOL, - CMD_COPYQUERYPOOLRESULTS, CMD_WRITETIMESTAMP, - CMD_PUSHCONSTANTS, - CMD_INITATOMICCOUNTERS, - CMD_LOADATOMICCOUNTERS, - CMD_SAVEATOMICCOUNTERS, - CMD_BEGINRENDERPASS, - CMD_NEXTSUBPASS, - CMD_ENDRENDERPASS, - CMD_EXECUTECOMMANDS, - CMD_END, // Should be last command in any RECORDED cmd buffer }; enum CB_STATE { - CB_NEW, // Newly created CB w/o any cmds - CB_RECORDING, // BeginCB has been called on this CB - CB_RECORDED, // EndCB has been called on this CB - CB_INVALID_COMPLETE, // had a complete recording, but was since invalidated - CB_INVALID_INCOMPLETE, // fouled before recording was completed + CB_NEW, // Newly created CB w/o any cmds + CB_RECORDING, // BeginCB has been called on this CB + CB_RECORDED, // EndCB has been called on this CB + CB_INVALID_COMPLETE, // had a complete recording, but was since invalidated + CB_INVALID_INCOMPLETE, // fouled before recording was completed }; // CB Status -- used to track status of various bindings on cmd buffer objects @@ -471,13 +504,12 @@ struct TEMPLATE_STATE { VkDescriptorUpdateTemplateKHR desc_update_template; - safe_VkDescriptorUpdateTemplateCreateInfoKHR create_info; + safe_VkDescriptorUpdateTemplateCreateInfo create_info; - TEMPLATE_STATE(VkDescriptorUpdateTemplateKHR update_template, safe_VkDescriptorUpdateTemplateCreateInfoKHR *pCreateInfo) + TEMPLATE_STATE(VkDescriptorUpdateTemplateKHR update_template, safe_VkDescriptorUpdateTemplateCreateInfo *pCreateInfo) : desc_update_template(update_template), create_info(*pCreateInfo) {} }; - struct QueryObject { VkQueryPool pool; uint32_t index; @@ -494,7 +526,7 @@ return hash()((uint64_t)(query.pool)) ^ hash()(query.index); } }; -} +} // namespace std struct DRAW_DATA { std::vector buffers; }; @@ -526,20 +558,52 @@ return hashVal; } }; -} +} // namespace std + +// Canonical dictionary for PushConstantRanges +using PushConstantRangesDict = hash_util::Dictionary; +using PushConstantRangesId = PushConstantRangesDict::Id; + +// Canonical dictionary for the pipeline layout's layout of descriptorsetlayouts +using DescriptorSetLayoutDef = cvdescriptorset::DescriptorSetLayoutDef; +using DescriptorSetLayoutId = std::shared_ptr; +using PipelineLayoutSetLayoutsDef = std::vector; +using PipelineLayoutSetLayoutsDict = + hash_util::Dictionary>; +using PipelineLayoutSetLayoutsId = PipelineLayoutSetLayoutsDict::Id; + +// Defines/stores a compatibility defintion for set N +// The "layout layout" must store at least set+1 entries, but only the first set+1 are considered for hash and equality testing +// Note: the "cannonical" data are referenced by Id, not including handle or device specific state +// Note: hash and equality only consider layout_id entries [0, set] for determining uniqueness +struct PipelineLayoutCompatDef { + uint32_t set; + PushConstantRangesId push_constant_ranges; + PipelineLayoutSetLayoutsId set_layouts_id; + PipelineLayoutCompatDef(const uint32_t set_index, const PushConstantRangesId pcr_id, const PipelineLayoutSetLayoutsId sl_id) + : set(set_index), push_constant_ranges(pcr_id), set_layouts_id(sl_id) {} + size_t hash() const; + bool operator==(const PipelineLayoutCompatDef &other) const; +}; + +// Canonical dictionary for PipelineLayoutCompat records +using PipelineLayoutCompatDict = hash_util::Dictionary>; +using PipelineLayoutCompatId = PipelineLayoutCompatDict::Id; // Store layouts and pushconstants for PipelineLayout struct PIPELINE_LAYOUT_NODE { VkPipelineLayout layout; std::vector> set_layouts; - std::vector push_constant_ranges; + PushConstantRangesId push_constant_ranges; + std::vector compat_for_set; - PIPELINE_LAYOUT_NODE() : layout(VK_NULL_HANDLE), set_layouts{}, push_constant_ranges{} {} + PIPELINE_LAYOUT_NODE() : layout(VK_NULL_HANDLE), set_layouts{}, push_constant_ranges{}, compat_for_set{} {} void reset() { layout = VK_NULL_HANDLE; set_layouts.clear(); - push_constant_ranges.clear(); + push_constant_ranges.reset(); + compat_for_set.clear(); } }; @@ -559,9 +623,8 @@ std::vector vertexBindingDescriptions; std::vector attachments; bool blendConstantsEnabled; // Blend constants enabled for any attachments - // Store RPCI b/c renderPass may be destroyed after Pipeline creation - safe_VkRenderPassCreateInfo render_pass_ci; PIPELINE_LAYOUT_NODE pipeline_layout; + VkPrimitiveTopology topology_at_rasterizer; // Default constructor PIPELINE_STATE() @@ -575,11 +638,27 @@ vertexBindingDescriptions(), attachments(), blendConstantsEnabled(false), - render_pass_ci(), - pipeline_layout() {} + pipeline_layout(), + topology_at_rasterizer{} {} void initGraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateInfo, std::shared_ptr &&rpstate) { - graphicsPipelineCI.initialize(pCreateInfo); + bool uses_color_attachment = false; + bool uses_depthstencil_attachment = false; + if (pCreateInfo->subpass < rpstate->createInfo.subpassCount) { + const auto &subpass = rpstate->createInfo.pSubpasses[pCreateInfo->subpass]; + + for (uint32_t i = 0; i < subpass.colorAttachmentCount; ++i) { + if (subpass.pColorAttachments[i].attachment != VK_ATTACHMENT_UNUSED) { + uses_color_attachment = true; + break; + } + } + + if (subpass.pDepthStencilAttachment && subpass.pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) { + uses_depthstencil_attachment = true; + } + } + graphicsPipelineCI.initialize(pCreateInfo, uses_color_attachment, uses_depthstencil_attachment); // Make sure compute pipeline is null VkComputePipelineCreateInfo emptyComputeCI = {}; computePipelineCI.initialize(&emptyComputeCI); @@ -588,20 +667,23 @@ this->duplicate_shaders |= this->active_shaders & pPSSCI->stage; this->active_shaders |= pPSSCI->stage; } - if (pCreateInfo->pVertexInputState) { - const VkPipelineVertexInputStateCreateInfo *pVICI = pCreateInfo->pVertexInputState; + if (graphicsPipelineCI.pVertexInputState) { + const auto pVICI = graphicsPipelineCI.pVertexInputState; if (pVICI->vertexBindingDescriptionCount) { this->vertexBindingDescriptions = std::vector( pVICI->pVertexBindingDescriptions, pVICI->pVertexBindingDescriptions + pVICI->vertexBindingDescriptionCount); } } - if (pCreateInfo->pColorBlendState) { - const VkPipelineColorBlendStateCreateInfo *pCBCI = pCreateInfo->pColorBlendState; + if (graphicsPipelineCI.pColorBlendState) { + const auto pCBCI = graphicsPipelineCI.pColorBlendState; if (pCBCI->attachmentCount) { this->attachments = std::vector(pCBCI->pAttachments, pCBCI->pAttachments + pCBCI->attachmentCount); } } + if (graphicsPipelineCI.pInputAssemblyState) { + topology_at_rasterizer = graphicsPipelineCI.pInputAssemblyState->topology; + } rp_state = rpstate; } @@ -609,7 +691,7 @@ computePipelineCI.initialize(pCreateInfo); // Make sure gfx pipeline is null VkGraphicsPipelineCreateInfo emptyGraphicsCI = {}; - graphicsPipelineCI.initialize(&emptyGraphicsCI); + graphicsPipelineCI.initialize(&emptyGraphicsCI, false, false); switch (computePipelineCI.stage.stage) { case VK_SHADER_STAGE_COMPUTE_BIT: this->active_shaders |= VK_SHADER_STAGE_COMPUTE_BIT; @@ -624,17 +706,18 @@ // Track last states that are bound per pipeline bind point (Gfx & Compute) struct LAST_BOUND_STATE { PIPELINE_STATE *pipeline_state; - PIPELINE_LAYOUT_NODE pipeline_layout; + VkPipelineLayout pipeline_layout; // Track each set that has been bound // Ordered bound set tracking where index is set# that given set is bound to std::vector boundDescriptorSets; std::unique_ptr push_descriptor_set; // one dynamic offset per dynamic descriptor bound to this CB std::vector> dynamicOffsets; + std::vector compat_id_for_set; void reset() { pipeline_state = nullptr; - pipeline_layout.reset(); + pipeline_layout = VK_NULL_HANDLE; boundDescriptorSets.clear(); push_descriptor_set = nullptr; dynamicOffsets.clear(); @@ -646,13 +729,15 @@ VkCommandBufferAllocateInfo createInfo = {}; VkCommandBufferBeginInfo beginInfo; VkCommandBufferInheritanceInfo inheritanceInfo; - VkDevice device; // device this CB belongs to + VkDevice device; // device this CB belongs to bool hasDrawCmd; - CB_STATE state; // Track cmd buffer update state - uint64_t submitCount; // Number of times CB has been submitted - CBStatusFlags status; // Track status of various bindings on cmd buffer - CBStatusFlags static_status; // All state bits provided by current graphics pipeline - // rather than dynamic state + CB_STATE state; // Track cmd buffer update state + uint64_t submitCount; // Number of times CB has been submitted + typedef uint64_t ImageLayoutUpdateCount; + ImageLayoutUpdateCount image_layout_change_count; // The sequence number for changes to image layout (for cached validation) + CBStatusFlags status; // Track status of various bindings on cmd buffer + CBStatusFlags static_status; // All state bits provided by current graphics pipeline + // rather than dynamic state // Currently storing "lastBound" objects on per-CB basis // long-term may want to create caches of "lastBound" states and could have // each individual CMD_NODE referencing its own "lastBound" state @@ -694,10 +779,11 @@ // Validation functions run at primary CB queue submit time std::vector> queue_submit_functions; // Validation functions run when secondary CB is executed in primary - std::vector> cmd_execute_commands_functions; + std::vector> cmd_execute_commands_functions; std::unordered_set memObjs; std::vector> eventUpdates; std::vector> queryUpdates; + std::unordered_set validated_descriptor_sets; }; struct SEMAPHORE_WAIT { @@ -761,7 +847,7 @@ bool destroy_query_pool; bool get_query_pool_results; bool destroy_buffer; - bool shader_validation; // Skip validation for shaders + bool shader_validation; // Skip validation for shaders void SetAll(bool value) { std::fill(&command_buffer_state, &shader_validation + 1, value); } }; @@ -772,7 +858,7 @@ }; class FRAMEBUFFER_STATE : public BASE_NODE { -public: + public: VkFramebuffer framebuffer; safe_VkFramebufferCreateInfo createInfo; std::shared_ptr rp_state; @@ -806,6 +892,7 @@ const PHYS_DEV_PROPERTIES_NODE *GetPhysDevProperties(const layer_data *device_data); const VkPhysicalDeviceFeatures *GetEnabledFeatures(const layer_data *device_data); const DeviceExtensions *GetEnabledExtensions(const layer_data *device_data); +const VkPhysicalDeviceDescriptorIndexingFeaturesEXT *GetEnabledDescriptorIndexingFeatures(const layer_data *device_data); void invalidateCommandBuffers(const layer_data *, std::unordered_set const &, VK_OBJECT); bool ValidateMemoryIsBoundToBuffer(const layer_data *, const BUFFER_STATE *, const char *, UNIQUE_VALIDATION_ERROR_CODE); @@ -824,7 +911,8 @@ bool ValidateCmdQueueFlags(layer_data *dev_data, const GLOBAL_CB_NODE *cb_node, const char *caller_name, VkQueueFlags flags, UNIQUE_VALIDATION_ERROR_CODE error_code); bool ValidateCmd(layer_data *my_data, const GLOBAL_CB_NODE *pCB, const CMD_TYPE cmd, const char *caller_name); -bool insideRenderPass(const layer_data *my_data, const GLOBAL_CB_NODE *pCB, const char *apiName, UNIQUE_VALIDATION_ERROR_CODE msgCode); +bool insideRenderPass(const layer_data *my_data, const GLOBAL_CB_NODE *pCB, const char *apiName, + UNIQUE_VALIDATION_ERROR_CODE msgCode); void SetImageMemoryValid(layer_data *dev_data, IMAGE_STATE *image_state, bool valid); bool outsideRenderPass(const layer_data *my_data, GLOBAL_CB_NODE *pCB, const char *apiName, UNIQUE_VALIDATION_ERROR_CODE msgCode); void SetLayout(GLOBAL_CB_NODE *pCB, ImageSubresourcePair imgpair, const IMAGE_CMD_BUF_LAYOUT_NODE &node); @@ -836,14 +924,12 @@ bool ValidateBufferMemoryIsValid(layer_data *dev_data, BUFFER_STATE *buffer_state, const char *functionName); void SetBufferMemoryValid(layer_data *dev_data, BUFFER_STATE *buffer_state, bool valid); bool ValidateCmdSubpassState(const layer_data *dev_data, const GLOBAL_CB_NODE *pCB, const CMD_TYPE cmd_type); - - +bool ValidateCmd(layer_data *dev_data, const GLOBAL_CB_NODE *cb_state, const CMD_TYPE cmd, const char *caller_name); // Prototypes for layer_data accessor functions. These should be in their own header file at some point VkFormatProperties GetFormatProperties(core_validation::layer_data *device_data, VkFormat format); -VkImageFormatProperties GetImageFormatProperties(core_validation::layer_data *device_data, VkFormat format, - VkImageType image_type, VkImageTiling tiling, VkImageUsageFlags usage, - VkImageCreateFlags flags); +VkResult GetImageFormatProperties(core_validation::layer_data *device_data, const VkImageCreateInfo *image_ci, + VkImageFormatProperties *image_format_properties); const debug_report_data *GetReportData(const layer_data *); const VkPhysicalDeviceProperties *GetPhysicalDeviceProperties(layer_data *); const CHECK_DISABLED *GetDisables(layer_data *); @@ -855,6 +941,6 @@ std::unordered_map> *GetBufferViewMap(layer_data *device_data); std::unordered_map> *GetImageViewMap(layer_data *device_data); const DeviceExtensions *GetDeviceExtensions(const layer_data *); -} +} // namespace core_validation #endif // CORE_VALIDATION_TYPES_H_ diff -Nru vulkan-1.0.65.2+dfsg1/layers/descriptor_sets.cpp vulkan-1.1.73+dfsg/layers/descriptor_sets.cpp --- vulkan-1.0.65.2+dfsg1/layers/descriptor_sets.cpp 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/descriptor_sets.cpp 2018-04-27 11:24:19.000000000 +0000 @@ -16,182 +16,199 @@ * limitations under the License. * * Author: Tobin Ehlis + * John Zulauf */ // Allow use of STL min and max functions in Windows #define NOMINMAX #include "descriptor_sets.h" +#include "hash_vk_types.h" #include "vk_enum_string_helper.h" #include "vk_safe_struct.h" +#include "vk_typemap_helper.h" #include "buffer_validation.h" #include #include +#include + +// ExtendedBinding collects a VkDescriptorSetLayoutBinding and any extended +// state that comes from a different array/structure so they can stay together +// while being sorted by binding number. +struct ExtendedBinding { + ExtendedBinding(const VkDescriptorSetLayoutBinding *l, VkDescriptorBindingFlagsEXT f) : layout_binding(l), binding_flags(f) {} + + const VkDescriptorSetLayoutBinding *layout_binding; + VkDescriptorBindingFlagsEXT binding_flags; +}; + +struct BindingNumCmp { + bool operator()(const ExtendedBinding &a, const ExtendedBinding &b) const { + return a.layout_binding->binding < b.layout_binding->binding; + } +}; + +using DescriptorSetLayoutDef = cvdescriptorset::DescriptorSetLayoutDef; +using DescriptorSetLayoutId = cvdescriptorset::DescriptorSetLayoutId; + +// Canonical dictionary of DescriptorSetLayoutDef (without any handle/device specific information) +cvdescriptorset::DescriptorSetLayoutDict descriptor_set_layout_dict; + +DescriptorSetLayoutId get_canonical_id(const VkDescriptorSetLayoutCreateInfo *p_create_info) { + return descriptor_set_layout_dict.look_up(DescriptorSetLayoutDef(p_create_info)); +} // Construct DescriptorSetLayout instance from given create info -cvdescriptorset::DescriptorSetLayout::DescriptorSetLayout(const VkDescriptorSetLayoutCreateInfo *p_create_info, - const VkDescriptorSetLayout layout) - : layout_(layout), - flags_(p_create_info->flags), - binding_count_(p_create_info->bindingCount), - descriptor_count_(0), - dynamic_descriptor_count_(0) { - // Dyn array indicies are ordered by binding # and array index of any array within the binding - // so we store up bindings w/ count in ordered map in order to create dyn array mappings below +// Proactively reserve and resize as possible, as the reallocation was visible in profiling +cvdescriptorset::DescriptorSetLayoutDef::DescriptorSetLayoutDef(const VkDescriptorSetLayoutCreateInfo *p_create_info) + : flags_(p_create_info->flags), binding_count_(0), descriptor_count_(0), dynamic_descriptor_count_(0) { + const auto *flags_create_info = lvl_find_in_chain(p_create_info->pNext); + + binding_type_stats_ = {0, 0, 0}; + std::set sorted_bindings; + const uint32_t input_bindings_count = p_create_info->bindingCount; + // Sort the input bindings in binding number order, eliminating duplicates + for (uint32_t i = 0; i < input_bindings_count; i++) { + VkDescriptorBindingFlagsEXT flags = 0; + if (flags_create_info && flags_create_info->bindingCount == p_create_info->bindingCount) { + flags = flags_create_info->pBindingFlags[i]; + } + sorted_bindings.insert(ExtendedBinding(p_create_info->pBindings + i, flags)); + } + + // Store the create info in the sorted order from above std::map binding_to_dyn_count; - for (uint32_t i = 0; i < binding_count_; ++i) { - auto binding_num = p_create_info->pBindings[i].binding; - descriptor_count_ += p_create_info->pBindings[i].descriptorCount; - uint32_t insert_index = 0; // Track vector index where we insert element - if (bindings_.empty() || binding_num > bindings_.back().binding) { - bindings_.push_back(safe_VkDescriptorSetLayoutBinding(&p_create_info->pBindings[i])); - insert_index = static_cast(bindings_.size()) - 1; - } else { // out-of-order binding number, need to insert into vector in-order - auto it = bindings_.begin(); - // Find currently binding's spot in vector - while (binding_num > it->binding) { - assert(it != bindings_.end()); - ++insert_index; - ++it; - } - bindings_.insert(it, safe_VkDescriptorSetLayoutBinding(&p_create_info->pBindings[i])); - } - // In cases where we should ignore pImmutableSamplers make sure it's NULL - if ((p_create_info->pBindings[i].pImmutableSamplers) && - ((p_create_info->pBindings[i].descriptorType != VK_DESCRIPTOR_TYPE_SAMPLER) && - (p_create_info->pBindings[i].descriptorType != VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER))) { - bindings_[insert_index].pImmutableSamplers = nullptr; - } - if (p_create_info->pBindings[i].descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC || - p_create_info->pBindings[i].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC) { - binding_to_dyn_count[p_create_info->pBindings[i].binding] = p_create_info->pBindings[i].descriptorCount; - dynamic_descriptor_count_ += p_create_info->pBindings[i].descriptorCount; + uint32_t index = 0; + binding_count_ = static_cast(sorted_bindings.size()); + bindings_.reserve(binding_count_); + binding_flags_.reserve(binding_count_); + binding_to_index_map_.reserve(binding_count_); + for (auto input_binding : sorted_bindings) { + // Add to binding and map, s.t. it is robust to invalid duplication of binding_num + const auto binding_num = input_binding.layout_binding->binding; + binding_to_index_map_[binding_num] = index++; + bindings_.emplace_back(input_binding.layout_binding); + auto &binding_info = bindings_.back(); + binding_flags_.emplace_back(input_binding.binding_flags); + + descriptor_count_ += binding_info.descriptorCount; + if (binding_info.descriptorCount > 0) { + non_empty_bindings_.insert(binding_num); + } + + if (binding_info.descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC || + binding_info.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC) { + binding_to_dyn_count[binding_num] = binding_info.descriptorCount; + dynamic_descriptor_count_ += binding_info.descriptorCount; + binding_type_stats_.dynamic_buffer_count++; + } else if ((binding_info.descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) || + (binding_info.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER)) { + binding_type_stats_.non_dynamic_buffer_count++; + } else { + binding_type_stats_.image_sampler_count++; } } assert(bindings_.size() == binding_count_); + assert(binding_flags_.size() == binding_count_); uint32_t global_index = 0; - // Vector order is finalized so create maps of bindings to indices + binding_to_global_index_range_map_.reserve(binding_count_); + // Vector order is finalized so create maps of bindings to descriptors and descriptors to indices for (uint32_t i = 0; i < binding_count_; ++i) { auto binding_num = bindings_[i].binding; - binding_to_index_map_[binding_num] = i; - binding_to_global_start_index_map_[binding_num] = global_index; - global_index += bindings_[i].descriptorCount ? bindings_[i].descriptorCount - 1 : 0; - binding_to_global_end_index_map_[binding_num] = global_index; - global_index += bindings_[i].descriptorCount ? 1 : 0; + auto final_index = global_index + bindings_[i].descriptorCount; + binding_to_global_index_range_map_[binding_num] = IndexRange(global_index, final_index); + if (final_index != global_index) { + global_start_to_index_map_[global_index] = i; + } + global_index = final_index; } + // Now create dyn offset array mapping for any dynamic descriptors uint32_t dyn_array_idx = 0; + binding_to_dynamic_array_idx_map_.reserve(binding_to_dyn_count.size()); for (const auto &bc_pair : binding_to_dyn_count) { binding_to_dynamic_array_idx_map_[bc_pair.first] = dyn_array_idx; dyn_array_idx += bc_pair.second; } } -// Validate descriptor set layout create info -bool cvdescriptorset::DescriptorSetLayout::ValidateCreateInfo(debug_report_data *report_data, - const VkDescriptorSetLayoutCreateInfo *create_info) { - bool skip = false; - std::unordered_set bindings; - for (uint32_t i = 0; i < create_info->bindingCount; ++i) { - if (!bindings.insert(create_info->pBindings[i].binding).second) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_0500022e, "DS", "duplicated binding number in VkDescriptorSetLayoutBinding. %s", - validation_error_map[VALIDATION_ERROR_0500022e]); - } - } - return skip; -} - -// put all bindings into the given set -void cvdescriptorset::DescriptorSetLayout::FillBindingSet(std::unordered_set *binding_set) const { - for (auto binding_index_pair : binding_to_index_map_) binding_set->insert(binding_index_pair.first); -} - -VkDescriptorSetLayoutBinding const *cvdescriptorset::DescriptorSetLayout::GetDescriptorSetLayoutBindingPtrFromBinding( - const uint32_t binding) const { +size_t cvdescriptorset::DescriptorSetLayoutDef::hash() const { + hash_util::HashCombiner hc; + hc << flags_; + hc.Combine(bindings_); + return hc.Value(); +} +// + +// Return valid index or "end" i.e. binding_count_; +// The asserts in "Get" are reduced to the set where no valid answer(like null or 0) could be given +// Common code for all binding lookups. +uint32_t cvdescriptorset::DescriptorSetLayoutDef::GetIndexFromBinding(uint32_t binding) const { const auto &bi_itr = binding_to_index_map_.find(binding); - if (bi_itr != binding_to_index_map_.end()) { - return bindings_[bi_itr->second].ptr(); - } - return nullptr; + if (bi_itr != binding_to_index_map_.cend()) return bi_itr->second; + return GetBindingCount(); } -VkDescriptorSetLayoutBinding const *cvdescriptorset::DescriptorSetLayout::GetDescriptorSetLayoutBindingPtrFromIndex( +VkDescriptorSetLayoutBinding const *cvdescriptorset::DescriptorSetLayoutDef::GetDescriptorSetLayoutBindingPtrFromIndex( const uint32_t index) const { if (index >= bindings_.size()) return nullptr; return bindings_[index].ptr(); } -// Return descriptorCount for given binding, 0 if index is unavailable -uint32_t cvdescriptorset::DescriptorSetLayout::GetDescriptorCountFromBinding(const uint32_t binding) const { - const auto &bi_itr = binding_to_index_map_.find(binding); - if (bi_itr != binding_to_index_map_.end()) { - return bindings_[bi_itr->second].descriptorCount; - } - return 0; -} // Return descriptorCount for given index, 0 if index is unavailable -uint32_t cvdescriptorset::DescriptorSetLayout::GetDescriptorCountFromIndex(const uint32_t index) const { +uint32_t cvdescriptorset::DescriptorSetLayoutDef::GetDescriptorCountFromIndex(const uint32_t index) const { if (index >= bindings_.size()) return 0; return bindings_[index].descriptorCount; } -// For the given binding, return descriptorType -VkDescriptorType cvdescriptorset::DescriptorSetLayout::GetTypeFromBinding(const uint32_t binding) const { - assert(binding_to_index_map_.count(binding)); - const auto &bi_itr = binding_to_index_map_.find(binding); - if (bi_itr != binding_to_index_map_.end()) { - return bindings_[bi_itr->second].descriptorType; - } - return VK_DESCRIPTOR_TYPE_MAX_ENUM; -} // For the given index, return descriptorType -VkDescriptorType cvdescriptorset::DescriptorSetLayout::GetTypeFromIndex(const uint32_t index) const { +VkDescriptorType cvdescriptorset::DescriptorSetLayoutDef::GetTypeFromIndex(const uint32_t index) const { assert(index < bindings_.size()); - return bindings_[index].descriptorType; -} -// For the given global index, return descriptorType -// Currently just counting up through bindings_, may improve this in future -VkDescriptorType cvdescriptorset::DescriptorSetLayout::GetTypeFromGlobalIndex(const uint32_t index) const { - uint32_t global_offset = 0; - for (auto binding : bindings_) { - global_offset += binding.descriptorCount; - if (index < global_offset) return binding.descriptorType; - } - assert(0); // requested global index is out of bounds + if (index < bindings_.size()) return bindings_[index].descriptorType; return VK_DESCRIPTOR_TYPE_MAX_ENUM; } -// For the given binding, return stageFlags -VkShaderStageFlags cvdescriptorset::DescriptorSetLayout::GetStageFlagsFromBinding(const uint32_t binding) const { - assert(binding_to_index_map_.count(binding)); - const auto &bi_itr = binding_to_index_map_.find(binding); - if (bi_itr != binding_to_index_map_.end()) { - return bindings_[bi_itr->second].stageFlags; - } +// For the given index, return stageFlags +VkShaderStageFlags cvdescriptorset::DescriptorSetLayoutDef::GetStageFlagsFromIndex(const uint32_t index) const { + assert(index < bindings_.size()); + if (index < bindings_.size()) return bindings_[index].stageFlags; return VkShaderStageFlags(0); } -// For the given binding, return start index -uint32_t cvdescriptorset::DescriptorSetLayout::GetGlobalStartIndexFromBinding(const uint32_t binding) const { - assert(binding_to_global_start_index_map_.count(binding)); - const auto &btgsi_itr = binding_to_global_start_index_map_.find(binding); - if (btgsi_itr != binding_to_global_start_index_map_.end()) { - return btgsi_itr->second; - } - // In error case max uint32_t so index is out of bounds to break ASAP - assert(0); - return 0xFFFFFFFF; +// Return binding flags for given index, 0 if index is unavailable +VkDescriptorBindingFlagsEXT cvdescriptorset::DescriptorSetLayoutDef::GetDescriptorBindingFlagsFromIndex( + const uint32_t index) const { + if (index >= binding_flags_.size()) return 0; + return binding_flags_[index]; } -// For the given binding, return end index -uint32_t cvdescriptorset::DescriptorSetLayout::GetGlobalEndIndexFromBinding(const uint32_t binding) const { - assert(binding_to_global_end_index_map_.count(binding)); - const auto &btgei_itr = binding_to_global_end_index_map_.find(binding); - if (btgei_itr != binding_to_global_end_index_map_.end()) { - return btgei_itr->second; - } + +// For the given global index, return index +uint32_t cvdescriptorset::DescriptorSetLayoutDef::GetIndexFromGlobalIndex(const uint32_t global_index) const { + auto start_it = global_start_to_index_map_.upper_bound(global_index); + uint32_t index = binding_count_; + assert(start_it != global_start_to_index_map_.cbegin()); + if (start_it != global_start_to_index_map_.cbegin()) { + --start_it; + index = start_it->second; +#ifndef NDEBUG + const auto &range = GetGlobalIndexRangeFromBinding(bindings_[index].binding); + assert(range.start <= global_index && global_index < range.end); +#endif + } + return index; +} + +// For the given binding, return the global index range +// As start and end are often needed in pairs, get both with a single hash lookup. +const cvdescriptorset::IndexRange &cvdescriptorset::DescriptorSetLayoutDef::GetGlobalIndexRangeFromBinding( + const uint32_t binding) const { + assert(binding_to_global_index_range_map_.count(binding)); // In error case max uint32_t so index is out of bounds to break ASAP - assert(0); - return 0xFFFFFFFF; + const static IndexRange kInvalidRange = {0xFFFFFFFF, 0xFFFFFFFF}; + const auto &range_it = binding_to_global_index_range_map_.find(binding); + if (range_it != binding_to_global_index_range_map_.end()) { + return range_it->second; + } + return kInvalidRange; } + // For given binding, return ptr to ImmutableSampler array -VkSampler const *cvdescriptorset::DescriptorSetLayout::GetImmutableSamplerPtrFromBinding(const uint32_t binding) const { - assert(binding_to_index_map_.count(binding)); +VkSampler const *cvdescriptorset::DescriptorSetLayoutDef::GetImmutableSamplerPtrFromBinding(const uint32_t binding) const { const auto &bi_itr = binding_to_index_map_.find(binding); if (bi_itr != binding_to_index_map_.end()) { return bindings_[bi_itr->second].pImmutableSamplers; @@ -199,17 +216,18 @@ return nullptr; } // Move to next valid binding having a non-zero binding count -uint32_t cvdescriptorset::DescriptorSetLayout::GetNextValidBinding(const uint32_t binding) const { - uint32_t new_binding = binding; - do { - new_binding++; - } while (GetDescriptorCountFromBinding(new_binding) == 0); - return new_binding; +uint32_t cvdescriptorset::DescriptorSetLayoutDef::GetNextValidBinding(const uint32_t binding) const { + auto it = non_empty_bindings_.upper_bound(binding); + assert(it != non_empty_bindings_.cend()); + if (it != non_empty_bindings_.cend()) return *it; + return GetMaxBinding() + 1; } // For given index, return ptr to ImmutableSampler array -VkSampler const *cvdescriptorset::DescriptorSetLayout::GetImmutableSamplerPtrFromIndex(const uint32_t index) const { - assert(index < bindings_.size()); - return bindings_[index].pImmutableSamplers; +VkSampler const *cvdescriptorset::DescriptorSetLayoutDef::GetImmutableSamplerPtrFromIndex(const uint32_t index) const { + if (index < bindings_.size()) { + return bindings_[index].pImmutableSamplers; + } + return nullptr; } // If our layout is compatible with rh_ds_layout, return true, // else return false and fill in error_msg will description of what causes incompatibility @@ -217,42 +235,55 @@ std::string *error_msg) const { // Trivial case if (layout_ == rh_ds_layout->GetDescriptorSetLayout()) return true; - if (descriptor_count_ != rh_ds_layout->descriptor_count_) { + if (get_layout_def() == rh_ds_layout->get_layout_def()) return true; + bool detailed_compat_check = + get_layout_def()->IsCompatible(layout_, rh_ds_layout->GetDescriptorSetLayout(), rh_ds_layout->get_layout_def(), error_msg); + // The detailed check should never tell us mismatching DSL are compatible + assert(!detailed_compat_check); + return detailed_compat_check; +} + +// Do a detailed compatibility check of this def (referenced by ds_layout), vs. the rhs (layout and def) +// Should only be called if trivial accept has failed, and in that context should return false. +bool cvdescriptorset::DescriptorSetLayoutDef::IsCompatible(VkDescriptorSetLayout ds_layout, VkDescriptorSetLayout rh_ds_layout, + DescriptorSetLayoutDef const *const rh_ds_layout_def, + std::string *error_msg) const { + if (descriptor_count_ != rh_ds_layout_def->descriptor_count_) { std::stringstream error_str; - error_str << "DescriptorSetLayout " << layout_ << " has " << descriptor_count_ << " descriptors, but DescriptorSetLayout " - << rh_ds_layout->GetDescriptorSetLayout() << ", which comes from pipelineLayout, has " - << rh_ds_layout->descriptor_count_ << " descriptors."; + error_str << "DescriptorSetLayout " << ds_layout << " has " << descriptor_count_ << " descriptors, but DescriptorSetLayout " + << rh_ds_layout << ", which comes from pipelineLayout, has " << rh_ds_layout_def->descriptor_count_ + << " descriptors."; *error_msg = error_str.str(); return false; // trivial fail case } + // Descriptor counts match so need to go through bindings one-by-one // and verify that type and stageFlags match for (auto binding : bindings_) { // TODO : Do we also need to check immutable samplers? // VkDescriptorSetLayoutBinding *rh_binding; - if (binding.descriptorCount != rh_ds_layout->GetDescriptorCountFromBinding(binding.binding)) { + if (binding.descriptorCount != rh_ds_layout_def->GetDescriptorCountFromBinding(binding.binding)) { std::stringstream error_str; - error_str << "Binding " << binding.binding << " for DescriptorSetLayout " << layout_ << " has a descriptorCount of " + error_str << "Binding " << binding.binding << " for DescriptorSetLayout " << ds_layout << " has a descriptorCount of " << binding.descriptorCount << " but binding " << binding.binding << " for DescriptorSetLayout " - << rh_ds_layout->GetDescriptorSetLayout() << ", which comes from pipelineLayout, has a descriptorCount of " - << rh_ds_layout->GetDescriptorCountFromBinding(binding.binding); + << rh_ds_layout << ", which comes from pipelineLayout, has a descriptorCount of " + << rh_ds_layout_def->GetDescriptorCountFromBinding(binding.binding); *error_msg = error_str.str(); return false; - } else if (binding.descriptorType != rh_ds_layout->GetTypeFromBinding(binding.binding)) { + } else if (binding.descriptorType != rh_ds_layout_def->GetTypeFromBinding(binding.binding)) { std::stringstream error_str; - error_str << "Binding " << binding.binding << " for DescriptorSetLayout " << layout_ << " is type '" + error_str << "Binding " << binding.binding << " for DescriptorSetLayout " << ds_layout << " is type '" << string_VkDescriptorType(binding.descriptorType) << "' but binding " << binding.binding - << " for DescriptorSetLayout " << rh_ds_layout->GetDescriptorSetLayout() - << ", which comes from pipelineLayout, is type '" - << string_VkDescriptorType(rh_ds_layout->GetTypeFromBinding(binding.binding)) << "'"; + << " for DescriptorSetLayout " << rh_ds_layout << ", which comes from pipelineLayout, is type '" + << string_VkDescriptorType(rh_ds_layout_def->GetTypeFromBinding(binding.binding)) << "'"; *error_msg = error_str.str(); return false; - } else if (binding.stageFlags != rh_ds_layout->GetStageFlagsFromBinding(binding.binding)) { + } else if (binding.stageFlags != rh_ds_layout_def->GetStageFlagsFromBinding(binding.binding)) { std::stringstream error_str; - error_str << "Binding " << binding.binding << " for DescriptorSetLayout " << layout_ << " has stageFlags " - << binding.stageFlags << " but binding " << binding.binding << " for DescriptorSetLayout " - << rh_ds_layout->GetDescriptorSetLayout() << ", which comes from pipelineLayout, has stageFlags " - << rh_ds_layout->GetStageFlagsFromBinding(binding.binding); + error_str << "Binding " << binding.binding << " for DescriptorSetLayout " << ds_layout << " has stageFlags " + << binding.stageFlags << " but binding " << binding.binding << " for DescriptorSetLayout " << rh_ds_layout + << ", which comes from pipelineLayout, has stageFlags " + << rh_ds_layout_def->GetStageFlagsFromBinding(binding.binding); *error_msg = error_str.str(); return false; } @@ -260,7 +291,7 @@ return true; } -bool cvdescriptorset::DescriptorSetLayout::IsNextBindingConsistent(const uint32_t binding) const { +bool cvdescriptorset::DescriptorSetLayoutDef::IsNextBindingConsistent(const uint32_t binding) const { if (!binding_to_index_map_.count(binding + 1)) return false; auto const &bi_itr = binding_to_index_map_.find(binding); if (bi_itr != binding_to_index_map_.end()) { @@ -269,9 +300,11 @@ auto type = bindings_[bi_itr->second].descriptorType; auto stage_flags = bindings_[bi_itr->second].stageFlags; auto immut_samp = bindings_[bi_itr->second].pImmutableSamplers ? true : false; + auto flags = binding_flags_[bi_itr->second]; if ((type != bindings_[next_bi_itr->second].descriptorType) || (stage_flags != bindings_[next_bi_itr->second].stageFlags) || - (immut_samp != (bindings_[next_bi_itr->second].pImmutableSamplers ? true : false))) { + (immut_samp != (bindings_[next_bi_itr->second].pImmutableSamplers ? true : false)) || + (flags != binding_flags_[next_bi_itr->second])) { return false; } return true; @@ -283,9 +316,9 @@ // descriptor updates and verify that for any binding boundaries that are crossed, the next binding(s) are all consistent // Consistency means that their type, stage flags, and whether or not they use immutable samplers matches // If so, return true. If not, fill in error_msg and return false -bool cvdescriptorset::DescriptorSetLayout::VerifyUpdateConsistency(uint32_t current_binding, uint32_t offset, uint32_t update_count, - const char *type, const VkDescriptorSet set, - std::string *error_msg) const { +bool cvdescriptorset::DescriptorSetLayoutDef::VerifyUpdateConsistency(uint32_t current_binding, uint32_t offset, + uint32_t update_count, const char *type, + const VkDescriptorSet set, std::string *error_msg) const { // Verify consecutive bindings match (if needed) auto orig_binding = current_binding; // Track count of descriptors in the current_bindings that are remaining to be updated @@ -303,8 +336,9 @@ if (!IsNextBindingConsistent(current_binding++)) { std::stringstream error_str; error_str << "Attempting " << type << " descriptor set " << set << " binding #" << orig_binding << " with #" - << update_count << " descriptors being updated but this update oversteps the bounds of this binding and the " - "next binding is not consistent with current binding so this update is invalid."; + << update_count + << " descriptors being updated but this update oversteps the bounds of this binding and the next binding is " + "not consistent with current binding so this update is invalid."; *error_msg = error_str.str(); return false; } @@ -315,19 +349,207 @@ return true; } +// The DescriptorSetLayout stores the per handle data for a descriptor set layout, and references the common defintion for the +// handle invariant portion +cvdescriptorset::DescriptorSetLayout::DescriptorSetLayout(const VkDescriptorSetLayoutCreateInfo *p_create_info, + const VkDescriptorSetLayout layout) + : layout_(layout), layout_destroyed_(false), layout_id_(get_canonical_id(p_create_info)) {} + +// Validate descriptor set layout create info +bool cvdescriptorset::DescriptorSetLayout::ValidateCreateInfo( + const debug_report_data *report_data, const VkDescriptorSetLayoutCreateInfo *create_info, const bool push_descriptor_ext, + const uint32_t max_push_descriptors, const bool descriptor_indexing_ext, + const VkPhysicalDeviceDescriptorIndexingFeaturesEXT *descriptor_indexing_features) { + bool skip = false; + std::unordered_set bindings; + uint64_t total_descriptors = 0; + + const auto *flags_create_info = lvl_find_in_chain(create_info->pNext); + + const bool push_descriptor_set = !!(create_info->flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR); + if (push_descriptor_set && !push_descriptor_ext) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + DRAWSTATE_EXTENSION_NOT_ENABLED, + "Attempted to use %s in %s but its required extension %s has not been enabled.\n", + "VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR", "VkDescriptorSetLayoutCreateInfo::flags", + VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME); + } + + const bool update_after_bind_set = !!(create_info->flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT); + if (update_after_bind_set && !descriptor_indexing_ext) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + DRAWSTATE_EXTENSION_NOT_ENABLED, + "Attemped to use %s in %s but its required extension %s has not been enabled.\n", + "VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT", "VkDescriptorSetLayoutCreateInfo::flags", + VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME); + } + + auto valid_type = [push_descriptor_set](const VkDescriptorType type) { + return !push_descriptor_set || + ((type != VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC) && (type != VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)); + }; + + uint32_t max_binding = 0; + + for (uint32_t i = 0; i < create_info->bindingCount; ++i) { + const auto &binding_info = create_info->pBindings[i]; + max_binding = std::max(max_binding, binding_info.binding); + + if (!bindings.insert(binding_info.binding).second) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0500022e, "duplicated binding number in VkDescriptorSetLayoutBinding."); + } + if (!valid_type(binding_info.descriptorType)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_05000230, + "invalid type %s ,for push descriptors in VkDescriptorSetLayoutBinding entry %" PRIu32 ".", + string_VkDescriptorType(binding_info.descriptorType), i); + } + total_descriptors += binding_info.descriptorCount; + } + + if (flags_create_info) { + if (flags_create_info->bindingCount != 0 && flags_create_info->bindingCount != create_info->bindingCount) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_46a01774, + "VkDescriptorSetLayoutCreateInfo::bindingCount (%d) != " + "VkDescriptorSetLayoutBindingFlagsCreateInfoEXT::bindingCount (%d)", + create_info->bindingCount, flags_create_info->bindingCount); + } + + if (flags_create_info->bindingCount == create_info->bindingCount) { + for (uint32_t i = 0; i < create_info->bindingCount; ++i) { + const auto &binding_info = create_info->pBindings[i]; + + if (flags_create_info->pBindingFlags[i] & VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT) { + if (!update_after_bind_set) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_05001770, "Invalid flags for VkDescriptorSetLayoutBinding entry %" PRIu32, i); + } + + if (binding_info.descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER && + !descriptor_indexing_features->descriptorBindingUniformBufferUpdateAfterBind) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_46a0177a, "Invalid flags for VkDescriptorSetLayoutBinding entry %" PRIu32, i); + } + if ((binding_info.descriptorType == VK_DESCRIPTOR_TYPE_SAMPLER || + binding_info.descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER || + binding_info.descriptorType == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE) && + !descriptor_indexing_features->descriptorBindingSampledImageUpdateAfterBind) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_46a0177c, "Invalid flags for VkDescriptorSetLayoutBinding entry %" PRIu32, i); + } + if (binding_info.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE && + !descriptor_indexing_features->descriptorBindingStorageImageUpdateAfterBind) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_46a0177e, "Invalid flags for VkDescriptorSetLayoutBinding entry %" PRIu32, i); + } + if (binding_info.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER && + !descriptor_indexing_features->descriptorBindingStorageBufferUpdateAfterBind) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_46a01780, "Invalid flags for VkDescriptorSetLayoutBinding entry %" PRIu32, i); + } + if (binding_info.descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER && + !descriptor_indexing_features->descriptorBindingUniformTexelBufferUpdateAfterBind) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_46a01782, "Invalid flags for VkDescriptorSetLayoutBinding entry %" PRIu32, i); + } + if (binding_info.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER && + !descriptor_indexing_features->descriptorBindingStorageTexelBufferUpdateAfterBind) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_46a01784, "Invalid flags for VkDescriptorSetLayoutBinding entry %" PRIu32, i); + } + if ((binding_info.descriptorType == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT || + binding_info.descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC || + binding_info.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_46a01786, "Invalid flags for VkDescriptorSetLayoutBinding entry %" PRIu32, i); + } + } + + if (flags_create_info->pBindingFlags[i] & VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT) { + if (!descriptor_indexing_features->descriptorBindingUpdateUnusedWhilePending) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_46a01788, "Invalid flags for VkDescriptorSetLayoutBinding entry %" PRIu32, i); + } + } + + if (flags_create_info->pBindingFlags[i] & VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT) { + if (!descriptor_indexing_features->descriptorBindingPartiallyBound) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_46a0178a, "Invalid flags for VkDescriptorSetLayoutBinding entry %" PRIu32, i); + } + } + + if (flags_create_info->pBindingFlags[i] & VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT) { + if (binding_info.binding != max_binding) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_46a01778, "Invalid flags for VkDescriptorSetLayoutBinding entry %" PRIu32, i); + } + + if (!descriptor_indexing_features->descriptorBindingVariableDescriptorCount) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_46a0178c, "Invalid flags for VkDescriptorSetLayoutBinding entry %" PRIu32, i); + } + if ((binding_info.descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC || + binding_info.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_46a0178e, "Invalid flags for VkDescriptorSetLayoutBinding entry %" PRIu32, i); + } + } + + if (push_descriptor_set && + (flags_create_info->pBindingFlags[i] & + (VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT | VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT | + VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT))) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_46a01776, "Invalid flags for VkDescriptorSetLayoutBinding entry %" PRIu32, i); + } + } + } + } + + if ((push_descriptor_set) && (total_descriptors > max_push_descriptors)) { + const char *undefined = push_descriptor_ext ? "" : " -- undefined"; + skip |= log_msg( + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, VALIDATION_ERROR_05000232, + "for push descriptor, total descriptor count in layout (%" PRIu64 + ") must not be greater than VkPhysicalDevicePushDescriptorPropertiesKHR::maxPushDescriptors (%" PRIu32 "%s).", + total_descriptors, max_push_descriptors, undefined); + } + + return skip; +} + cvdescriptorset::AllocateDescriptorSetsData::AllocateDescriptorSetsData(uint32_t count) : required_descriptors_by_type{}, layout_nodes(count, nullptr) {} cvdescriptorset::DescriptorSet::DescriptorSet(const VkDescriptorSet set, const VkDescriptorPool pool, - const std::shared_ptr &layout, const layer_data *dev_data) + const std::shared_ptr &layout, uint32_t variable_count, + layer_data *dev_data) : some_update_(false), set_(set), pool_state_(nullptr), p_layout_(layout), device_data_(dev_data), - limits_(GetPhysDevProperties(dev_data)->properties.limits) { + limits_(GetPhysDevProperties(dev_data)->properties.limits), + variable_count_(variable_count) { pool_state_ = GetDescriptorPoolState(dev_data, pool); // Foreach binding, create default descriptors of given type + descriptors_.reserve(p_layout_->GetTotalDescriptorCount()); for (uint32_t i = 0; i < p_layout_->GetBindingCount(); ++i) { auto type = p_layout_->GetTypeFromIndex(i); switch (type) { @@ -405,7 +627,7 @@ // that any update buffers are valid, and that any dynamic offsets are within the bounds of their buffers. // Return true if state is acceptable, or false and write an error message into error string bool cvdescriptorset::DescriptorSet::ValidateDrawState(const std::map &bindings, - const std::vector &dynamic_offsets, const GLOBAL_CB_NODE *cb_node, + const std::vector &dynamic_offsets, GLOBAL_CB_NODE *cb_node, const char *caller, std::string *error) const { for (auto binding_pair : bindings) { auto binding = binding_pair.first; @@ -416,11 +638,20 @@ *error = error_str.str(); return false; } - auto start_idx = p_layout_->GetGlobalStartIndexFromBinding(binding); - auto end_idx = p_layout_->GetGlobalEndIndexFromBinding(binding); + IndexRange index_range = p_layout_->GetGlobalIndexRangeFromBinding(binding); auto array_idx = 0; // Track array idx if we're dealing with array descriptors - for (uint32_t i = start_idx; i <= end_idx; ++i, ++array_idx) { - if (!descriptors_[i]->updated) { + + if (IsVariableDescriptorCount(binding)) { + // Only validate the first N descriptors if it uses variable_count + index_range.end = index_range.start + GetVariableDescriptorCount(); + } + + for (uint32_t i = index_range.start; i < index_range.end; ++i, ++array_idx) { + if (p_layout_->GetDescriptorBindingFlagsFromBinding(binding) & VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT) { + // Can't validate the descriptor because it may not have been updated, + // or the view could have been destroyed + continue; + } else if (!descriptors_[i]->updated) { std::stringstream error_str; error_str << "Descriptor in binding #" << binding << " at global descriptor index " << i << " is being used in draw but has not been updated."; @@ -438,7 +669,7 @@ << " references invalid buffer " << buffer << "."; *error = error_str.str(); return false; - } else { + } else if (!buffer_node->sparse) { for (auto mem_binding : buffer_node->GetBoundMemory()) { if (!GetMemObjInfo(device_data_, mem_binding)) { std::stringstream error_str; @@ -448,6 +679,13 @@ return false; } } + } else { + // Enqueue sparse resource validation, as these can only be validated at submit time + auto device_data_copy = device_data_; // Cannot capture members by value, so make capturable copy. + std::function function = [device_data_copy, caller, buffer_node]() { + return core_validation::ValidateBufferMemoryIsValid(device_data_copy, buffer_node, caller); + }; + cb_node->queue_submit_functions.push_back(function); } if (descriptors_[i]->IsDynamic()) { // Validate that dynamic offsets are within the buffer @@ -527,8 +765,8 @@ caller, VALIDATION_ERROR_046002b0, &hit_error); if (hit_error) { *error = - "Image layout specified at vkUpdateDescriptorSets() time doesn't match actual image layout at " - "time descriptor is used. See previous error callback for specific details."; + "Image layout specified at vkUpdateDescriptorSets() time doesn't match actual image layout at time " + "descriptor is used. See previous error callback for specific details."; return false; } } @@ -549,6 +787,22 @@ return false; } } + if (descriptor_class == ImageSampler || descriptor_class == PlainSampler) { + // Verify Sampler still valid + VkSampler sampler; + if (descriptor_class == ImageSampler) { + sampler = static_cast(descriptors_[i].get())->GetSampler(); + } else { + sampler = static_cast(descriptors_[i].get())->GetSampler(); + } + if (!ValidateSampler(sampler, device_data_)) { + std::stringstream error_str; + error_str << "Descriptor in binding #" << binding << " at global descriptor index " << i + << " is using sampler " << sampler << " that has been destroyed."; + *error = error_str.str(); + return false; + } + } } } } @@ -566,7 +820,7 @@ if (!p_layout_->HasBinding(binding)) { continue; } - auto start_idx = p_layout_->GetGlobalStartIndexFromBinding(binding); + uint32_t start_idx = p_layout_->GetGlobalIndexRangeFromBinding(binding).start; if (descriptors_[start_idx]->IsStorage()) { if (Image == descriptors_[start_idx]->descriptor_class) { for (uint32_t i = 0; i < p_layout_->GetDescriptorCountFromBinding(binding); ++i) { @@ -611,7 +865,7 @@ uint32_t update_index = 0; while (descriptors_remaining) { uint32_t update_count = std::min(descriptors_remaining, GetDescriptorCountFromBinding(binding_being_updated)); - auto global_idx = p_layout_->GetGlobalStartIndexFromBinding(binding_being_updated) + offset; + auto global_idx = p_layout_->GetGlobalIndexRangeFromBinding(binding_being_updated).start + offset; // Loop over the updates for a single binding at a time for (uint32_t di = 0; di < update_count; ++di, ++update_index) { descriptors_[global_idx + di]->WriteUpdate(update, update_index); @@ -623,22 +877,36 @@ } if (update->descriptorCount) some_update_ = true; - InvalidateBoundCmdBuffers(); + if (!(p_layout_->GetDescriptorBindingFlagsFromBinding(update->dstBinding) & + (VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT | VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT))) { + InvalidateBoundCmdBuffers(); + } } // Validate Copy update bool cvdescriptorset::DescriptorSet::ValidateCopyUpdate(const debug_report_data *report_data, const VkCopyDescriptorSet *update, const DescriptorSet *src_set, UNIQUE_VALIDATION_ERROR_CODE *error_code, std::string *error_msg) { - // Verify idle ds - if (in_use.load()) { - // TODO : Re-using Free Idle error code, need copy update idle error code - *error_code = VALIDATION_ERROR_2860026a; - std::stringstream error_str; - error_str << "Cannot call vkUpdateDescriptorSets() to perform copy update on descriptor set " << set_ - << " that is in use by a command buffer"; - *error_msg = error_str.str(); + // Verify dst layout still valid + if (p_layout_->IsDestroyed()) { + *error_code = VALIDATION_ERROR_03207601; + string_sprintf(error_msg, + "Cannot call vkUpdateDescriptorSets() to perform copy update on descriptor set dstSet 0x%" PRIxLEAST64 + " created with destroyed VkDescriptorSetLayout 0x%" PRIxLEAST64, + HandleToUint64(set_), HandleToUint64(p_layout_->GetDescriptorSetLayout())); return false; } + + // Verify src layout still valid + if (src_set->p_layout_->IsDestroyed()) { + *error_code = VALIDATION_ERROR_0322d201; + string_sprintf( + error_msg, + "Cannot call vkUpdateDescriptorSets() to perform copy update of dstSet 0x%" PRIxLEAST64 + " from descriptor set srcSet 0x%" PRIxLEAST64 " created with destroyed VkDescriptorSetLayout 0x%" PRIxLEAST64, + HandleToUint64(set_), HandleToUint64(src_set->set_), HandleToUint64(src_set->p_layout_->GetDescriptorSetLayout())); + return false; + } + if (!p_layout_->HasBinding(update->dstBinding)) { *error_code = VALIDATION_ERROR_032002b6; std::stringstream error_str; @@ -653,27 +921,39 @@ *error_msg = error_str.str(); return false; } + // Verify idle ds + if (in_use.load() && + !(p_layout_->GetDescriptorBindingFlagsFromBinding(update->dstBinding) & + (VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT | VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT))) { + // TODO : Re-using Free Idle error code, need copy update idle error code + *error_code = VALIDATION_ERROR_2860026a; + std::stringstream error_str; + error_str << "Cannot call vkUpdateDescriptorSets() to perform copy update on descriptor set " << set_ + << " that is in use by a command buffer"; + *error_msg = error_str.str(); + return false; + } // src & dst set bindings are valid // Check bounds of src & dst - auto src_start_idx = src_set->GetGlobalStartIndexFromBinding(update->srcBinding) + update->srcArrayElement; + auto src_start_idx = src_set->GetGlobalIndexRangeFromBinding(update->srcBinding).start + update->srcArrayElement; if ((src_start_idx + update->descriptorCount) > src_set->GetTotalDescriptorCount()) { // SRC update out of bounds *error_code = VALIDATION_ERROR_032002b4; std::stringstream error_str; error_str << "Attempting copy update from descriptorSet " << update->srcSet << " binding#" << update->srcBinding - << " with offset index of " << src_set->GetGlobalStartIndexFromBinding(update->srcBinding) + << " with offset index of " << src_set->GetGlobalIndexRangeFromBinding(update->srcBinding).start << " plus update array offset of " << update->srcArrayElement << " and update of " << update->descriptorCount << " descriptors oversteps total number of descriptors in set: " << src_set->GetTotalDescriptorCount(); *error_msg = error_str.str(); return false; } - auto dst_start_idx = p_layout_->GetGlobalStartIndexFromBinding(update->dstBinding) + update->dstArrayElement; + auto dst_start_idx = p_layout_->GetGlobalIndexRangeFromBinding(update->dstBinding).start + update->dstArrayElement; if ((dst_start_idx + update->descriptorCount) > p_layout_->GetTotalDescriptorCount()) { // DST update out of bounds *error_code = VALIDATION_ERROR_032002b8; std::stringstream error_str; error_str << "Attempting copy update to descriptorSet " << set_ << " binding#" << update->dstBinding - << " with offset index of " << p_layout_->GetGlobalStartIndexFromBinding(update->dstBinding) + << " with offset index of " << p_layout_->GetGlobalIndexRangeFromBinding(update->dstBinding).start << " plus update array offset of " << update->dstArrayElement << " and update of " << update->descriptorCount << " descriptors oversteps total number of descriptors in set: " << p_layout_->GetTotalDescriptorCount(); *error_msg = error_str.str(); @@ -700,6 +980,67 @@ set_, error_msg))) { return false; } + + if ((src_set->GetLayout()->GetCreateFlags() & VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT) && + !(GetLayout()->GetCreateFlags() & VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT)) { + *error_code = VALIDATION_ERROR_03200efc; + std::stringstream error_str; + error_str << "If pname:srcSet's (" << update->srcSet + << ") layout was created with the " + "ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT flag " + "set, then pname:dstSet's (" + << update->dstSet + << ") layout must: also have been created with the " + "ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT flag set"; + *error_msg = error_str.str(); + return false; + } + + if (!(src_set->GetLayout()->GetCreateFlags() & VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT) && + (GetLayout()->GetCreateFlags() & VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT)) { + *error_code = VALIDATION_ERROR_03200efe; + std::stringstream error_str; + error_str << "If pname:srcSet's (" << update->srcSet + << ") layout was created without the " + "ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT flag " + "set, then pname:dstSet's (" + << update->dstSet + << ") layout must: also have been created without the " + "ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT flag set"; + *error_msg = error_str.str(); + return false; + } + + if ((src_set->GetPoolState()->createInfo.flags & VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT) && + !(GetPoolState()->createInfo.flags & VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT)) { + *error_code = VALIDATION_ERROR_03200f00; + std::stringstream error_str; + error_str << "If the descriptor pool from which pname:srcSet (" << update->srcSet + << ") was allocated was created " + "with the ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag " + "set, then the descriptor pool from which pname:dstSet (" + << update->dstSet + << ") was allocated must: " + "also have been created with the ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag set"; + *error_msg = error_str.str(); + return false; + } + + if (!(src_set->GetPoolState()->createInfo.flags & VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT) && + (GetPoolState()->createInfo.flags & VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT)) { + *error_code = VALIDATION_ERROR_03200f02; + std::stringstream error_str; + error_str << "If the descriptor pool from which pname:srcSet (" << update->srcSet + << ") was allocated was created " + "without the ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag " + "set, then the descriptor pool from which pname:dstSet (" + << update->dstSet + << ") was allocated must: " + "also have been created without the ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag set"; + *error_msg = error_str.str(); + return false; + } + // Update parameters all look good and descriptor updated so verify update contents if (!VerifyCopyUpdateContents(update, src_set, src_type, src_start_idx, error_code, error_msg)) return false; @@ -708,8 +1049,8 @@ } // Perform Copy update void cvdescriptorset::DescriptorSet::PerformCopyUpdate(const VkCopyDescriptorSet *update, const DescriptorSet *src_set) { - auto src_start_idx = src_set->GetGlobalStartIndexFromBinding(update->srcBinding) + update->srcArrayElement; - auto dst_start_idx = p_layout_->GetGlobalStartIndexFromBinding(update->dstBinding) + update->dstArrayElement; + auto src_start_idx = src_set->GetGlobalIndexRangeFromBinding(update->srcBinding).start + update->srcArrayElement; + auto dst_start_idx = p_layout_->GetGlobalIndexRangeFromBinding(update->dstBinding).start + update->dstArrayElement; // Update parameters all look good so perform update for (uint32_t di = 0; di < update->descriptorCount; ++di) { auto src = src_set->descriptors_[src_start_idx + di].get(); @@ -722,7 +1063,10 @@ } } - InvalidateBoundCmdBuffers(); + if (!(p_layout_->GetDescriptorBindingFlagsFromBinding(update->dstBinding) & + (VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT | VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT))) { + InvalidateBoundCmdBuffers(); + } } // Bind cb_node to this set and this set to cb_node. @@ -740,13 +1084,78 @@ // resources for (auto binding_req_pair : binding_req_map) { auto binding = binding_req_pair.first; - auto start_idx = p_layout_->GetGlobalStartIndexFromBinding(binding); - auto end_idx = p_layout_->GetGlobalEndIndexFromBinding(binding); - for (uint32_t i = start_idx; i <= end_idx; ++i) { + auto range = p_layout_->GetGlobalIndexRangeFromBinding(binding); + for (uint32_t i = range.start; i < range.end; ++i) { descriptors_[i]->BindCommandBuffer(device_data_, cb_node); } } } +void cvdescriptorset::DescriptorSet::FilterAndTrackOneBindingReq(const BindingReqMap::value_type &binding_req_pair, + const BindingReqMap &in_req, BindingReqMap *out_req, + TrackedBindings *bindings) { + assert(out_req); + assert(bindings); + const auto binding = binding_req_pair.first; + // Use insert and look at the boolean ("was inserted") in the returned pair to see if this is a new set member. + // Saves one hash lookup vs. find ... compare w/ end ... insert. + const auto it_bool_pair = bindings->insert(binding); + if (it_bool_pair.second) { + out_req->emplace(binding_req_pair); + } +} +void cvdescriptorset::DescriptorSet::FilterAndTrackOneBindingReq(const BindingReqMap::value_type &binding_req_pair, + const BindingReqMap &in_req, BindingReqMap *out_req, + TrackedBindings *bindings, uint32_t limit) { + if (bindings->size() < limit) FilterAndTrackOneBindingReq(binding_req_pair, in_req, out_req, bindings); +} + +void cvdescriptorset::DescriptorSet::FilterAndTrackBindingReqs(GLOBAL_CB_NODE *cb_state, const BindingReqMap &in_req, + BindingReqMap *out_req) { + TrackedBindings &bound = cached_validation_[cb_state].command_binding_and_usage; + if (bound.size() == GetBindingCount()) { + return; // All bindings are bound, out req is empty + } + for (const auto &binding_req_pair : in_req) { + const auto binding = binding_req_pair.first; + // If a binding doesn't exist, or has already been bound, skip it + if (p_layout_->HasBinding(binding)) { + FilterAndTrackOneBindingReq(binding_req_pair, in_req, out_req, &bound); + } + } +} + +void cvdescriptorset::DescriptorSet::FilterAndTrackBindingReqs(GLOBAL_CB_NODE *cb_state, PIPELINE_STATE *pipeline, + const BindingReqMap &in_req, BindingReqMap *out_req) { + auto &validated = cached_validation_[cb_state]; + auto &image_sample_val = validated.image_samplers[pipeline]; + auto *const dynamic_buffers = &validated.dynamic_buffers; + auto *const non_dynamic_buffers = &validated.non_dynamic_buffers; + const auto &stats = p_layout_->GetBindingTypeStats(); + for (const auto &binding_req_pair : in_req) { + auto binding = binding_req_pair.first; + VkDescriptorSetLayoutBinding const *layout_binding = p_layout_->GetDescriptorSetLayoutBindingPtrFromBinding(binding); + if (!layout_binding) { + continue; + } + // Caching criteria differs per type. + // If image_layout have changed , the image descriptors need to be validated against them. + if ((layout_binding->descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC) || + (layout_binding->descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)) { + FilterAndTrackOneBindingReq(binding_req_pair, in_req, out_req, dynamic_buffers, stats.dynamic_buffer_count); + } else if ((layout_binding->descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) || + (layout_binding->descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER)) { + FilterAndTrackOneBindingReq(binding_req_pair, in_req, out_req, non_dynamic_buffers, stats.non_dynamic_buffer_count); + } else { + // This is rather crude, as the changed layouts may not impact the bound descriptors, + // but the simple "versioning" is a simple "dirt" test. + auto &version = image_sample_val[binding]; // Take advantage of default construtor zero initialzing new entries + if (version != cb_state->image_layout_change_count) { + version = cb_state->image_layout_change_count; + out_req->emplace(binding_req_pair); + } + } + } +} cvdescriptorset::SamplerDescriptor::SamplerDescriptor(const VkSampler *immut) : sampler_(VK_NULL_HANDLE), immutable_(false) { updated = false; @@ -819,8 +1228,9 @@ // Only Color bit must be set if ((aspect_mask & VK_IMAGE_ASPECT_COLOR_BIT) != VK_IMAGE_ASPECT_COLOR_BIT) { std::stringstream error_str; - error_str << "ImageView (" << image_view << ") uses layout VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL but does " - "not have VK_IMAGE_ASPECT_COLOR_BIT set."; + error_str + << "ImageView (" << image_view + << ") uses layout VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL but does not have VK_IMAGE_ASPECT_COLOR_BIT set."; *error_msg = error_str.str(); return false; } @@ -905,23 +1315,22 @@ // TODO : Need to create custom enum error codes for these cases if (image_node->shared_presentable) { if (VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR != image_layout) { - error_str - << "ImageView (" << image_view - << ") of VK_DESCRIPTOR_TYPE_STORAGE_IMAGE type with a front-buffered image is being updated with " - "layout " - << string_VkImageLayout(image_layout) - << " but according to spec section 13.1 Descriptor Types, 'Front-buffered images that report support " - "for " - "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT must be in the VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR layout.'"; + error_str << "ImageView (" << image_view + << ") of VK_DESCRIPTOR_TYPE_STORAGE_IMAGE type with a front-buffered image is being updated with " + "layout " + << string_VkImageLayout(image_layout) + << " but according to spec section 13.1 Descriptor Types, 'Front-buffered images that report " + "support for VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT must be in the " + "VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR layout.'"; *error_msg = error_str.str(); return false; } } else if (VK_IMAGE_LAYOUT_GENERAL != image_layout) { - error_str - << "ImageView (" << image_view << ") of VK_DESCRIPTOR_TYPE_STORAGE_IMAGE type is being updated with layout " - << string_VkImageLayout(image_layout) - << " but according to spec section 13.1 Descriptor Types, 'Load and store operations on storage images can " - "only be done on images in VK_IMAGE_LAYOUT_GENERAL layout.'"; + error_str << "ImageView (" << image_view + << ") of VK_DESCRIPTOR_TYPE_STORAGE_IMAGE type is being updated with layout " + << string_VkImageLayout(image_layout) + << " but according to spec section 13.1 Descriptor Types, 'Load and store operations on storage " + "images can only be done on images in VK_IMAGE_LAYOUT_GENERAL layout.'"; *error_msg = error_str.str(); return false; } @@ -949,7 +1358,9 @@ } void cvdescriptorset::SamplerDescriptor::WriteUpdate(const VkWriteDescriptorSet *update, const uint32_t index) { - sampler_ = update->pImageInfo[index].sampler; + if (!immutable_) { + sampler_ = update->pImageInfo[index].sampler; + } updated = true; } @@ -981,7 +1392,9 @@ void cvdescriptorset::ImageSamplerDescriptor::WriteUpdate(const VkWriteDescriptorSet *update, const uint32_t index) { updated = true; const auto &image_info = update->pImageInfo[index]; - sampler_ = image_info.sampler; + if (!immutable_) { + sampler_ = image_info.sampler; + } image_view_ = image_info.imageView; image_layout_ = image_info.imageLayout; } @@ -1016,7 +1429,7 @@ updated = false; descriptor_class = Image; if (VK_DESCRIPTOR_TYPE_STORAGE_IMAGE == type) storage_ = true; -}; +} void cvdescriptorset::ImageDescriptor::WriteUpdate(const VkWriteDescriptorSet *update, const uint32_t index) { updated = true; @@ -1079,7 +1492,7 @@ updated = false; descriptor_class = TexelBuffer; if (VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER == type) storage_ = true; -}; +} void cvdescriptorset::TexelDescriptor::WriteUpdate(const VkWriteDescriptorSet *update, const uint32_t index) { updated = true; @@ -1114,7 +1527,7 @@ if (!set_node) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, - HandleToUint64(dest_set), __LINE__, DRAWSTATE_INVALID_DESCRIPTOR_SET, "DS", + HandleToUint64(dest_set), DRAWSTATE_INVALID_DESCRIPTOR_SET, "Cannot call vkUpdateDescriptorSets() on descriptor set 0x%" PRIxLEAST64 " that has not been allocated.", HandleToUint64(dest_set)); } else { @@ -1122,10 +1535,10 @@ std::string error_str; if (!set_node->ValidateWriteUpdate(report_data, &p_wds[i], &error_code, &error_str)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, - HandleToUint64(dest_set), __LINE__, error_code, "DS", - "vkUpdateDescriptorsSets() failed write update validation for Descriptor Set 0x%" PRIx64 - " with error: %s. %s", - HandleToUint64(dest_set), error_str.c_str(), validation_error_map[error_code]); + HandleToUint64(dest_set), error_code, + "vkUpdateDescriptorSets() failed write update validation for Descriptor Set 0x%" PRIx64 + " with error: %s.", + HandleToUint64(dest_set), error_str.c_str()); } } } @@ -1142,10 +1555,10 @@ std::string error_str; if (!dst_node->ValidateCopyUpdate(report_data, &p_cds[i], src_node, &error_code, &error_str)) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, - HandleToUint64(dst_set), __LINE__, error_code, "DS", - "vkUpdateDescriptorsSets() failed copy update from Descriptor Set 0x%" PRIx64 - " to Descriptor Set 0x%" PRIx64 " with error: %s. %s", - HandleToUint64(src_set), HandleToUint64(dst_set), error_str.c_str(), validation_error_map[error_code]); + HandleToUint64(dst_set), error_code, + "vkUpdateDescriptorSets() failed copy update from Descriptor Set 0x%" PRIx64 + " to Descriptor Set 0x%" PRIx64 " with error: %s.", + HandleToUint64(src_set), HandleToUint64(dst_set), error_str.c_str()); } } return skip; @@ -1196,6 +1609,7 @@ auto binding_being_updated = create_info.pDescriptorUpdateEntries[i].dstBinding; auto dst_array_element = create_info.pDescriptorUpdateEntries[i].dstArrayElement; + desc_writes.reserve(desc_writes.size() + create_info.pDescriptorUpdateEntries[i].descriptorCount); for (uint32_t j = 0; j < create_info.pDescriptorUpdateEntries[i].descriptorCount; j++) { desc_writes.emplace_back(); auto &write_entry = desc_writes.back(); @@ -1249,14 +1663,13 @@ // If an error would occur for this update, return false and fill in details in error_msg string bool cvdescriptorset::DescriptorSet::ValidateWriteUpdate(const debug_report_data *report_data, const VkWriteDescriptorSet *update, UNIQUE_VALIDATION_ERROR_CODE *error_code, std::string *error_msg) { - // Verify idle ds - if (in_use.load()) { - // TODO : Re-using Free Idle error code, need write update idle error code - *error_code = VALIDATION_ERROR_2860026a; - std::stringstream error_str; - error_str << "Cannot call vkUpdateDescriptorSets() to perform write update on descriptor set " << set_ - << " that is in use by a command buffer"; - *error_msg = error_str.str(); + // Verify dst layout still valid + if (p_layout_->IsDestroyed()) { + *error_code = VALIDATION_ERROR_15c00280; + string_sprintf(error_msg, + "Cannot call vkUpdateDescriptorSets() to perform write update on descriptor set 0x%" PRIxLEAST64 + " created with destroyed VkDescriptorSetLayout 0x%" PRIxLEAST64, + HandleToUint64(set_), HandleToUint64(p_layout_->GetDescriptorSetLayout())); return false; } // Verify dst binding exists @@ -1276,8 +1689,20 @@ return false; } } + // Verify idle ds + if (in_use.load() && + !(p_layout_->GetDescriptorBindingFlagsFromBinding(update->dstBinding) & + (VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT | VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT))) { + // TODO : Re-using Free Idle error code, need write update idle error code + *error_code = VALIDATION_ERROR_2860026a; + std::stringstream error_str; + error_str << "Cannot call vkUpdateDescriptorSets() to perform write update on descriptor set " << set_ + << " that is in use by a command buffer"; + *error_msg = error_str.str(); + return false; + } // We know that binding is valid, verify update and do update on each descriptor - auto start_idx = p_layout_->GetGlobalStartIndexFromBinding(update->dstBinding) + update->dstArrayElement; + auto start_idx = p_layout_->GetGlobalIndexRangeFromBinding(update->dstBinding).start + update->dstArrayElement; auto type = p_layout_->GetTypeFromBinding(update->dstBinding); if (type != update->descriptorType) { *error_code = VALIDATION_ERROR_15c0027e; @@ -1678,45 +2103,76 @@ } // Any unknown layouts will be flagged as errors during ValidateAllocateDescriptorSets() call } -}; +} // Verify that the state at allocate time is correct, but don't actually allocate the sets yet bool cvdescriptorset::ValidateAllocateDescriptorSets(const core_validation::layer_data *dev_data, const VkDescriptorSetAllocateInfo *p_alloc_info, const AllocateDescriptorSetsData *ds_data) { bool skip = false; auto report_data = core_validation::GetReportData(dev_data); + auto pool_state = GetDescriptorPoolState(dev_data, p_alloc_info->descriptorPool); for (uint32_t i = 0; i < p_alloc_info->descriptorSetCount; i++) { auto layout = GetDescriptorSetLayout(dev_data, p_alloc_info->pSetLayouts[i]); - if (!layout) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT, - HandleToUint64(p_alloc_info->pSetLayouts[i]), __LINE__, DRAWSTATE_INVALID_LAYOUT, "DS", - "Unable to find set layout node for layout 0x%" PRIxLEAST64 " specified in vkAllocateDescriptorSets() call", - HandleToUint64(p_alloc_info->pSetLayouts[i])); + if (layout) { // nullptr layout indicates no valid layout handle for this device, validated/logged in object_tracker + if (layout->GetCreateFlags() & VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT, + HandleToUint64(p_alloc_info->pSetLayouts[i]), VALIDATION_ERROR_04c00268, + "Layout 0x%" PRIxLEAST64 " specified at pSetLayouts[%" PRIu32 + "] in vkAllocateDescriptorSets() was created with invalid flag %s set.", + HandleToUint64(p_alloc_info->pSetLayouts[i]), i, + "VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR"); + } + if (layout->GetCreateFlags() & VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT && + !(pool_state->createInfo.flags & VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT, + 0, VALIDATION_ERROR_04c017c8, + "Descriptor set layout create flags and pool create flags mismatch for index (%d)", i); + } } } if (!GetDeviceExtensions(dev_data)->vk_khr_maintenance1) { - auto pool_state = GetDescriptorPoolState(dev_data, p_alloc_info->descriptorPool); // Track number of descriptorSets allowable in this pool if (pool_state->availableSets < p_alloc_info->descriptorSetCount) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT, - HandleToUint64(pool_state->pool), __LINE__, VALIDATION_ERROR_04c00264, "DS", + HandleToUint64(pool_state->pool), VALIDATION_ERROR_04c00264, "Unable to allocate %u descriptorSets from pool 0x%" PRIxLEAST64 - ". This pool only has %d descriptorSets remaining. %s", - p_alloc_info->descriptorSetCount, HandleToUint64(pool_state->pool), pool_state->availableSets, - validation_error_map[VALIDATION_ERROR_04c00264]); + ". This pool only has %d descriptorSets remaining.", + p_alloc_info->descriptorSetCount, HandleToUint64(pool_state->pool), pool_state->availableSets); } // Determine whether descriptor counts are satisfiable for (uint32_t i = 0; i < VK_DESCRIPTOR_TYPE_RANGE_SIZE; i++) { if (ds_data->required_descriptors_by_type[i] > pool_state->availableDescriptorTypeCount[i]) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT, - HandleToUint64(pool_state->pool), __LINE__, VALIDATION_ERROR_04c00266, "DS", + HandleToUint64(pool_state->pool), VALIDATION_ERROR_04c00266, "Unable to allocate %u descriptors of type %s from pool 0x%" PRIxLEAST64 - ". This pool only has %d descriptors of this type remaining. %s", + ". This pool only has %d descriptors of this type remaining.", ds_data->required_descriptors_by_type[i], string_VkDescriptorType(VkDescriptorType(i)), - HandleToUint64(pool_state->pool), pool_state->availableDescriptorTypeCount[i], - validation_error_map[VALIDATION_ERROR_04c00266]); + HandleToUint64(pool_state->pool), pool_state->availableDescriptorTypeCount[i]); + } + } + } + + const auto *count_allocate_info = lvl_find_in_chain(p_alloc_info->pNext); + + if (count_allocate_info) { + if (count_allocate_info->descriptorSetCount != 0 && + count_allocate_info->descriptorSetCount != p_alloc_info->descriptorSetCount) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT, 0, + VALIDATION_ERROR_46c017ca, + "VkDescriptorSetAllocateInfo::descriptorSetCount (%d) != " + "VkDescriptorSetVariableDescriptorCountAllocateInfoEXT::descriptorSetCount (%d)", + p_alloc_info->descriptorSetCount, count_allocate_info->descriptorSetCount); + } + if (count_allocate_info->descriptorSetCount == p_alloc_info->descriptorSetCount) { + for (uint32_t i = 0; i < p_alloc_info->descriptorSetCount; i++) { + auto layout = GetDescriptorSetLayout(dev_data, p_alloc_info->pSetLayouts[i]); + if (count_allocate_info->pDescriptorCounts[i] > layout->GetDescriptorCountFromBinding(layout->GetMaxBinding())) { + skip |= log_msg( + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT, 0, + VALIDATION_ERROR_46c017cc, "pDescriptorCounts[%d] = (%d), binding's descriptorCount = (%d)", i, + count_allocate_info->pDescriptorCounts[i], layout->GetDescriptorCountFromBinding(layout->GetMaxBinding())); + } } } } @@ -1729,20 +2185,43 @@ const AllocateDescriptorSetsData *ds_data, std::unordered_map *pool_map, std::unordered_map *set_map, - const layer_data *dev_data) { + layer_data *dev_data) { auto pool_state = (*pool_map)[p_alloc_info->descriptorPool]; // Account for sets and individual descriptors allocated from pool pool_state->availableSets -= p_alloc_info->descriptorSetCount; for (uint32_t i = 0; i < VK_DESCRIPTOR_TYPE_RANGE_SIZE; i++) { pool_state->availableDescriptorTypeCount[i] -= ds_data->required_descriptors_by_type[i]; } + + const auto *variable_count_info = lvl_find_in_chain(p_alloc_info->pNext); + bool variable_count_valid = variable_count_info && variable_count_info->descriptorSetCount == p_alloc_info->descriptorSetCount; + // Create tracking object for each descriptor set; insert into global map and the pool's set. for (uint32_t i = 0; i < p_alloc_info->descriptorSetCount; i++) { + uint32_t variable_count = variable_count_valid ? variable_count_info->pDescriptorCounts[i] : 0; + auto new_ds = new cvdescriptorset::DescriptorSet(descriptor_sets[i], p_alloc_info->descriptorPool, ds_data->layout_nodes[i], - dev_data); + variable_count, dev_data); pool_state->sets.insert(new_ds); new_ds->in_use.store(0); (*set_map)[descriptor_sets[i]] = new_ds; } } + +cvdescriptorset::PrefilterBindRequestMap::PrefilterBindRequestMap(cvdescriptorset::DescriptorSet &ds, const BindingReqMap &in_map, + GLOBAL_CB_NODE *cb_state) + : filtered_map_(), orig_map_(in_map) { + if (ds.GetTotalDescriptorCount() > kManyDescriptors_) { + filtered_map_.reset(new std::map()); + ds.FilterAndTrackBindingReqs(cb_state, orig_map_, filtered_map_.get()); + } +} +cvdescriptorset::PrefilterBindRequestMap::PrefilterBindRequestMap(cvdescriptorset::DescriptorSet &ds, const BindingReqMap &in_map, + GLOBAL_CB_NODE *cb_state, PIPELINE_STATE *pipeline) + : filtered_map_(), orig_map_(in_map) { + if (ds.GetTotalDescriptorCount() > kManyDescriptors_) { + filtered_map_.reset(new std::map()); + ds.FilterAndTrackBindingReqs(cb_state, pipeline, orig_map_, filtered_map_.get()); + } +} diff -Nru vulkan-1.0.65.2+dfsg1/layers/descriptor_sets.h vulkan-1.1.73+dfsg/layers/descriptor_sets.h --- vulkan-1.0.65.2+dfsg1/layers/descriptor_sets.h 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/descriptor_sets.h 2018-04-27 11:24:19.000000000 +0000 @@ -16,36 +16,15 @@ * limitations under the License. * * Author: Tobin Ehlis + * John Zulauf */ #ifndef CORE_VALIDATION_DESCRIPTOR_SETS_H_ #define CORE_VALIDATION_DESCRIPTOR_SETS_H_ -// Check for noexcept support -#ifndef NOEXCEPT -#if defined(__clang__) -#if __has_feature(cxx_noexcept) -#define HAS_NOEXCEPT -#endif -#else -#if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ * 10 + __GNUC_MINOR__ >= 46 -#define HAS_NOEXCEPT -#else -#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026 && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS -#define HAS_NOEXCEPT -#endif -#endif -#endif - -#ifdef HAS_NOEXCEPT -#define NOEXCEPT noexcept -#else -#define NOEXCEPT -#endif -#endif - #include "core_validation_error_enums.h" #include "vk_validation_error_messages.h" #include "core_validation_types.h" +#include "hash_vk_types.h" #include "vk_layer_logging.h" #include "vk_layer_utils.h" #include "vk_safe_struct.h" @@ -53,6 +32,7 @@ #include "vk_object_types.h" #include #include +#include #include #include #include @@ -60,13 +40,30 @@ using core_validation::layer_data; // Descriptor Data structures +namespace cvdescriptorset { + +// Utility structs/classes/types +// Index range for global indices below, end is exclusive, i.e. [start,end) +struct IndexRange { + IndexRange(uint32_t start_in, uint32_t end_in) : start(start_in), end(end_in) {} + IndexRange() = default; + uint32_t start; + uint32_t end; +}; +typedef std::map BindingReqMap; /* - * DescriptorSetLayout class + * DescriptorSetLayoutDef/DescriptorSetLayout classes * - * Overview - This class encapsulates the Vulkan VkDescriptorSetLayout data (layout). + * Overview - These two classes encapsulate the Vulkan VkDescriptorSetLayout data (layout). * A layout consists of some number of bindings, each of which has a binding#, a * type, descriptor count, stage flags, and pImmutableSamplers. + + * The DescriptorSetLayoutDef represents a canonicalization of the input data and contains + * neither per handle or per device state. It is possible for different handles on + * different devices to share a common def. This is used and useful for quick compatibiltiy + * validation. The DescriptorSetLayout refers to a DescriptorSetLayoutDef and contains + * all per handle state. * * Index vs Binding - A layout is created with an array of VkDescriptorSetLayoutBinding * where each array index will have a corresponding binding# that is defined in that struct. @@ -91,39 +88,53 @@ * 10, then the GlobalStartIndex of the 2nd lowest binding# will be 10 where 0-9 are the * global indices for the lowest binding#. */ -namespace cvdescriptorset { -class DescriptorSetLayout { +class DescriptorSetLayoutDef { public: // Constructors and destructor - DescriptorSetLayout(const VkDescriptorSetLayoutCreateInfo *p_create_info, const VkDescriptorSetLayout layout); - // Validate create info - should be called prior to creation - static bool ValidateCreateInfo(debug_report_data *, const VkDescriptorSetLayoutCreateInfo *); - // Straightforward Get functions - VkDescriptorSetLayout GetDescriptorSetLayout() const { return layout_; }; + DescriptorSetLayoutDef(const VkDescriptorSetLayoutCreateInfo *p_create_info); + size_t hash() const; + uint32_t GetTotalDescriptorCount() const { return descriptor_count_; }; uint32_t GetDynamicDescriptorCount() const { return dynamic_descriptor_count_; }; VkDescriptorSetLayoutCreateFlags GetCreateFlags() const { return flags_; } // For a given binding, return the number of descriptors in that binding and all successive bindings uint32_t GetBindingCount() const { return binding_count_; }; - // Fill passed-in set with bindings - void FillBindingSet(std::unordered_set *) const; + // Non-empty binding numbers in order + const std::set &GetSortedBindingSet() const { return non_empty_bindings_; } // Return true if given binding is present in this layout bool HasBinding(const uint32_t binding) const { return binding_to_index_map_.count(binding) > 0; }; - // Return true if this layout is compatible with passed in layout from a pipelineLayout, - // else return false and update error_msg with description of incompatibility - bool IsCompatible(DescriptorSetLayout const *const, std::string *) const; + // Return true if this DSL Def (referenced by the 1st layout) is compatible with another DSL Def (ref'd from the 2nd layout) + // else return false and update error_msg with description of incompatibility + bool IsCompatible(VkDescriptorSetLayout, VkDescriptorSetLayout, DescriptorSetLayoutDef const *const, std::string *) const; // Return true if binding 1 beyond given exists and has same type, stageFlags & immutable sampler use bool IsNextBindingConsistent(const uint32_t) const; + uint32_t GetIndexFromBinding(uint32_t binding) const; // Various Get functions that can either be passed a binding#, which will // be automatically translated into the appropriate index, or the index# can be passed in directly - VkDescriptorSetLayoutBinding const *GetDescriptorSetLayoutBindingPtrFromBinding(const uint32_t) const; + uint32_t GetMaxBinding() const { return bindings_[bindings_.size() - 1].binding; } VkDescriptorSetLayoutBinding const *GetDescriptorSetLayoutBindingPtrFromIndex(const uint32_t) const; - uint32_t GetDescriptorCountFromBinding(const uint32_t) const; + VkDescriptorSetLayoutBinding const *GetDescriptorSetLayoutBindingPtrFromBinding(uint32_t binding) const { + return GetDescriptorSetLayoutBindingPtrFromIndex(GetIndexFromBinding(binding)); + } + const std::vector &GetBindings() const { return bindings_; } uint32_t GetDescriptorCountFromIndex(const uint32_t) const; - VkDescriptorType GetTypeFromBinding(const uint32_t) const; + uint32_t GetDescriptorCountFromBinding(const uint32_t binding) const { + return GetDescriptorCountFromIndex(GetIndexFromBinding(binding)); + } VkDescriptorType GetTypeFromIndex(const uint32_t) const; - VkDescriptorType GetTypeFromGlobalIndex(const uint32_t) const; - VkShaderStageFlags GetStageFlagsFromBinding(const uint32_t) const; + VkDescriptorType GetTypeFromBinding(const uint32_t binding) const { return GetTypeFromIndex(GetIndexFromBinding(binding)); } + VkShaderStageFlags GetStageFlagsFromIndex(const uint32_t) const; + VkShaderStageFlags GetStageFlagsFromBinding(const uint32_t binding) const { + return GetStageFlagsFromIndex(GetIndexFromBinding(binding)); + } + VkDescriptorBindingFlagsEXT GetDescriptorBindingFlagsFromIndex(const uint32_t) const; + VkDescriptorBindingFlagsEXT GetDescriptorBindingFlagsFromBinding(const uint32_t binding) const { + return GetDescriptorBindingFlagsFromIndex(GetIndexFromBinding(binding)); + } + uint32_t GetIndexFromGlobalIndex(const uint32_t global_index) const; + VkDescriptorType GetTypeFromGlobalIndex(const uint32_t global_index) const { + return GetTypeFromIndex(GetIndexFromGlobalIndex(global_index)); + } VkSampler const *GetImmutableSamplerPtrFromBinding(const uint32_t) const; VkSampler const *GetImmutableSamplerPtrFromIndex(const uint32_t) const; // For a given binding and array index, return the corresponding index into the dynamic offset array @@ -135,10 +146,10 @@ } return dyn_off->second; } - // For a particular binding, get the global index - // These calls should be guarded by a call to "HasBinding(binding)" to verify that the given binding exists - uint32_t GetGlobalStartIndexFromBinding(const uint32_t) const; - uint32_t GetGlobalEndIndexFromBinding(const uint32_t) const; + // For a particular binding, get the global index range + // This call should be guarded by a call to "HasBinding(binding)" to verify that the given binding exists + const IndexRange &GetGlobalIndexRangeFromBinding(const uint32_t) const; + // Helper function to get the next valid binding for a descriptor uint32_t GetNextValidBinding(const uint32_t) const; // For a particular binding starting at offset and having update_count descriptors @@ -146,18 +157,130 @@ bool VerifyUpdateConsistency(uint32_t, uint32_t, uint32_t, const char *, const VkDescriptorSet, std::string *) const; bool IsPushDescriptor() const { return GetCreateFlags() & VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR; }; + struct BindingTypeStats { + uint32_t dynamic_buffer_count; + uint32_t non_dynamic_buffer_count; + uint32_t image_sampler_count; + }; + const BindingTypeStats &GetBindingTypeStats() const { return binding_type_stats_; } + private: - VkDescriptorSetLayout layout_; - std::map binding_to_index_map_; - std::unordered_map binding_to_global_start_index_map_; - std::unordered_map binding_to_global_end_index_map_; - // For a given binding map to associated index in the dynamic offset array - std::unordered_map binding_to_dynamic_array_idx_map_; + // Only the first two data members are used for hash and equality checks, the other members are derived from them, and are used + // to speed up the various lookups/queries/validations VkDescriptorSetLayoutCreateFlags flags_; - uint32_t binding_count_; // # of bindings in this layout std::vector bindings_; + std::vector binding_flags_; + + // Convenience data structures for rapid lookup of various descriptor set layout properties + std::set non_empty_bindings_; // Containing non-emtpy bindings in numerical order + std::unordered_map binding_to_index_map_; + // The following map allows an non-iterative lookup of a binding from a global index... + std::map global_start_to_index_map_; // The index corresponding for a starting global (descriptor) index + std::unordered_map binding_to_global_index_range_map_; // range is exclusive of .end + // For a given binding map to associated index in the dynamic offset array + std::unordered_map binding_to_dynamic_array_idx_map_; + + uint32_t binding_count_; // # of bindings in this layout uint32_t descriptor_count_; // total # descriptors in this layout uint32_t dynamic_descriptor_count_; + BindingTypeStats binding_type_stats_; +}; + +static bool operator==(const DescriptorSetLayoutDef &lhs, const DescriptorSetLayoutDef &rhs) { + return (lhs.GetCreateFlags() == rhs.GetCreateFlags()) && (lhs.GetBindings() == rhs.GetBindings()); +} + +// Canonical dictionary of DSL definitions -- independent of device or handle +using DescriptorSetLayoutDict = hash_util::Dictionary>; +using DescriptorSetLayoutId = DescriptorSetLayoutDict::Id; + +class DescriptorSetLayout { + public: + // Constructors and destructor + DescriptorSetLayout(const VkDescriptorSetLayoutCreateInfo *p_create_info, const VkDescriptorSetLayout layout); + // Validate create info - should be called prior to creation + static bool ValidateCreateInfo(const debug_report_data *, const VkDescriptorSetLayoutCreateInfo *, const bool, const uint32_t, + const bool, const VkPhysicalDeviceDescriptorIndexingFeaturesEXT *descriptor_indexing_features); + bool HasBinding(const uint32_t binding) const { return layout_id_->HasBinding(binding); } + // Return true if this layout is compatible with passed in layout from a pipelineLayout, + // else return false and update error_msg with description of incompatibility + bool IsCompatible(DescriptorSetLayout const *const, std::string *) const; + // Straightforward Get functions + VkDescriptorSetLayout GetDescriptorSetLayout() const { return layout_; }; + bool IsDestroyed() const { return layout_destroyed_; } + void MarkDestroyed() { layout_destroyed_ = true; } + const DescriptorSetLayoutDef *get_layout_def() const { return layout_id_.get(); } + DescriptorSetLayoutId get_layout_id() const { return layout_id_; } + uint32_t GetTotalDescriptorCount() const { return layout_id_->GetTotalDescriptorCount(); }; + uint32_t GetDynamicDescriptorCount() const { return layout_id_->GetDynamicDescriptorCount(); }; + uint32_t GetBindingCount() const { return layout_id_->GetBindingCount(); }; + VkDescriptorSetLayoutCreateFlags GetCreateFlags() const { return layout_id_->GetCreateFlags(); } + bool IsNextBindingConsistent(const uint32_t) const; + uint32_t GetIndexFromBinding(uint32_t binding) const { return layout_id_->GetIndexFromBinding(binding); } + // Various Get functions that can either be passed a binding#, which will + // be automatically translated into the appropriate index, or the index# can be passed in directly + uint32_t GetMaxBinding() const { return layout_id_->GetMaxBinding(); } + VkDescriptorSetLayoutBinding const *GetDescriptorSetLayoutBindingPtrFromIndex(const uint32_t index) const { + return layout_id_->GetDescriptorSetLayoutBindingPtrFromIndex(index); + } + VkDescriptorSetLayoutBinding const *GetDescriptorSetLayoutBindingPtrFromBinding(uint32_t binding) const { + return layout_id_->GetDescriptorSetLayoutBindingPtrFromBinding(binding); + } + const std::vector &GetBindings() const { return layout_id_->GetBindings(); } + uint32_t GetDescriptorCountFromIndex(const uint32_t index) const { return layout_id_->GetDescriptorCountFromIndex(index); } + uint32_t GetDescriptorCountFromBinding(const uint32_t binding) const { + return layout_id_->GetDescriptorCountFromBinding(binding); + } + VkDescriptorType GetTypeFromIndex(const uint32_t index) const { return layout_id_->GetTypeFromIndex(index); } + VkDescriptorType GetTypeFromBinding(const uint32_t binding) const { return layout_id_->GetTypeFromBinding(binding); } + VkShaderStageFlags GetStageFlagsFromIndex(const uint32_t index) const { return layout_id_->GetStageFlagsFromIndex(index); } + VkShaderStageFlags GetStageFlagsFromBinding(const uint32_t binding) const { + return layout_id_->GetStageFlagsFromBinding(binding); + } + VkDescriptorBindingFlagsEXT GetDescriptorBindingFlagsFromIndex(const uint32_t index) const { + return layout_id_->GetDescriptorBindingFlagsFromIndex(index); + } + VkDescriptorBindingFlagsEXT GetDescriptorBindingFlagsFromBinding(const uint32_t binding) const { + return layout_id_->GetDescriptorBindingFlagsFromBinding(binding); + } + uint32_t GetIndexFromGlobalIndex(const uint32_t global_index) const { + return layout_id_->GetIndexFromGlobalIndex(global_index); + } + VkDescriptorType GetTypeFromGlobalIndex(const uint32_t global_index) const { + return GetTypeFromIndex(GetIndexFromGlobalIndex(global_index)); + } + VkSampler const *GetImmutableSamplerPtrFromBinding(const uint32_t binding) const { + return layout_id_->GetImmutableSamplerPtrFromBinding(binding); + } + VkSampler const *GetImmutableSamplerPtrFromIndex(const uint32_t index) const { + return layout_id_->GetImmutableSamplerPtrFromIndex(index); + } + // For a given binding and array index, return the corresponding index into the dynamic offset array + int32_t GetDynamicOffsetIndexFromBinding(uint32_t binding) const { + return layout_id_->GetDynamicOffsetIndexFromBinding(binding); + } + // For a particular binding, get the global index range + // This call should be guarded by a call to "HasBinding(binding)" to verify that the given binding exists + const IndexRange &GetGlobalIndexRangeFromBinding(const uint32_t binding) const { + return layout_id_->GetGlobalIndexRangeFromBinding(binding); + } + // Helper function to get the next valid binding for a descriptor + uint32_t GetNextValidBinding(const uint32_t binding) const { return layout_id_->GetNextValidBinding(binding); } + // For a particular binding starting at offset and having update_count descriptors + // updated, verify that for any binding boundaries crossed, the update is consistent + bool VerifyUpdateConsistency(uint32_t current_binding, uint32_t offset, uint32_t update_count, const char *type, + const VkDescriptorSet set, std::string *error_msg) const { + return layout_id_->VerifyUpdateConsistency(current_binding, offset, update_count, type, set, error_msg); + } + bool IsPushDescriptor() const { return layout_id_->IsPushDescriptor(); } + + using BindingTypeStats = DescriptorSetLayoutDef::BindingTypeStats; + const BindingTypeStats &GetBindingTypeStats() const { return layout_id_->GetBindingTypeStats(); } + + private: + VkDescriptorSetLayout layout_; + bool layout_destroyed_; + DescriptorSetLayoutId layout_id_; }; /* @@ -301,7 +424,7 @@ void PerformAllocateDescriptorSets(const VkDescriptorSetAllocateInfo *, const VkDescriptorSet *, const AllocateDescriptorSetsData *, std::unordered_map *, std::unordered_map *, - const core_validation::layer_data *); + core_validation::layer_data *); /* * DescriptorSet class @@ -324,7 +447,7 @@ class DescriptorSet : public BASE_NODE { public: DescriptorSet(const VkDescriptorSet, const VkDescriptorPool, const std::shared_ptr &, - const core_validation::layer_data *); + uint32_t variable_count, core_validation::layer_data *); ~DescriptorSet(); // A number of common Get* functions that return data based on layout from which this set was created uint32_t GetTotalDescriptorCount() const { return p_layout_->GetTotalDescriptorCount(); }; @@ -346,7 +469,7 @@ // Is this set compatible with the given layout? bool IsCompatible(DescriptorSetLayout const *const, std::string *) const; // For given bindings validate state at time of draw is correct, returning false on error and writing error details into string* - bool ValidateDrawState(const std::map &, const std::vector &, const GLOBAL_CB_NODE *, + bool ValidateDrawState(const std::map &, const std::vector &, GLOBAL_CB_NODE *, const char *caller, std::string *) const; // For given set of bindings, add any buffers and images that will be updated to their respective unordered_sets & return number // of objects inserted @@ -365,27 +488,45 @@ // Perform a CopyUpdate whose contents were just validated using ValidateCopyUpdate void PerformCopyUpdate(const VkCopyDescriptorSet *, const DescriptorSet *); - std::shared_ptr const GetLayout() const { return p_layout_; }; + const std::shared_ptr GetLayout() const { return p_layout_; }; VkDescriptorSet GetSet() const { return set_; }; // Return unordered_set of all command buffers that this set is bound to std::unordered_set GetBoundCmdBuffers() const { return cb_bindings; } // Bind given cmd_buffer to this descriptor set void BindCommandBuffer(GLOBAL_CB_NODE *, const std::map &); + + // Track work that has been bound or validated to avoid duplicate work, important when large descriptor arrays + // are present + typedef std::unordered_set TrackedBindings; + static void FilterAndTrackOneBindingReq(const BindingReqMap::value_type &binding_req_pair, const BindingReqMap &in_req, + BindingReqMap *out_req, TrackedBindings *set); + static void FilterAndTrackOneBindingReq(const BindingReqMap::value_type &binding_req_pair, const BindingReqMap &in_req, + BindingReqMap *out_req, TrackedBindings *set, uint32_t limit); + void FilterAndTrackBindingReqs(GLOBAL_CB_NODE *, const BindingReqMap &in_req, BindingReqMap *out_req); + void FilterAndTrackBindingReqs(GLOBAL_CB_NODE *, PIPELINE_STATE *, const BindingReqMap &in_req, BindingReqMap *out_req); + void ClearCachedDynamicDescriptorValidation(GLOBAL_CB_NODE *cb_state) { cached_validation_[cb_state].dynamic_buffers.clear(); } + void ClearCachedValidation(GLOBAL_CB_NODE *cb_state) { cached_validation_.erase(cb_state); } // If given cmd_buffer is in the cb_bindings set, remove it - void RemoveBoundCommandBuffer(GLOBAL_CB_NODE *cb_node) { cb_bindings.erase(cb_node); } + void RemoveBoundCommandBuffer(GLOBAL_CB_NODE *cb_node) { + cb_bindings.erase(cb_node); + ClearCachedValidation(cb_node); + } VkSampler const *GetImmutableSamplerPtrFromBinding(const uint32_t index) const { return p_layout_->GetImmutableSamplerPtrFromBinding(index); }; // For a particular binding, get the global index - uint32_t GetGlobalStartIndexFromBinding(const uint32_t binding) const { - return p_layout_->GetGlobalStartIndexFromBinding(binding); - }; - uint32_t GetGlobalEndIndexFromBinding(const uint32_t binding) const { - return p_layout_->GetGlobalEndIndexFromBinding(binding); + const IndexRange &GetGlobalIndexRangeFromBinding(const uint32_t binding) const { + return p_layout_->GetGlobalIndexRangeFromBinding(binding); }; // Return true if any part of set has ever been updated bool IsUpdated() const { return some_update_; }; bool IsPushDescriptor() const { return p_layout_->IsPushDescriptor(); }; + bool IsVariableDescriptorCount(uint32_t binding) const { + return !!(p_layout_->GetDescriptorBindingFlagsFromBinding(binding) & + VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT); + } + uint32_t GetVariableDescriptorCount() const { return variable_count_; } + DESCRIPTOR_POOL_STATE *GetPoolState() const { return pool_state_; } private: bool VerifyWriteUpdateContents(const VkWriteDescriptorSet *, const uint32_t, UNIQUE_VALIDATION_ERROR_CODE *, @@ -403,8 +544,38 @@ const std::shared_ptr p_layout_; std::vector> descriptors_; // Ptr to device data used for various data look-ups - const core_validation::layer_data *device_data_; + core_validation::layer_data *const device_data_; const VkPhysicalDeviceLimits limits_; + uint32_t variable_count_; + + // Cached binding and validation support: + // + // For the lifespan of a given command buffer recording, do lazy evaluation, caching, and dirtying of + // expensive validation operation (typically per-draw) + typedef std::unordered_map TrackedBindingMap; + typedef std::unordered_map ValidatedBindings; + // Track the validation caching of bindings vs. the command buffer and draw state + typedef std::unordered_map VersionedBindings; + struct CachedValidation { + TrackedBindings command_binding_and_usage; // Persistent for the life of the recording + TrackedBindings non_dynamic_buffers; // Persistent for the life of the recording + TrackedBindings dynamic_buffers; // Dirtied (flushed) each BindDescriptorSet + std::unordered_map image_samplers; // Tested vs. changes to CB's ImageLayout + }; + typedef std::unordered_map CachedValidationMap; + // Image and ImageView bindings are validated per pipeline and not invalidate by repeated binding + CachedValidationMap cached_validation_; }; -} +// For the "bindless" style resource usage with many descriptors, need to optimize binding and validation +class PrefilterBindRequestMap { + public: + static const uint32_t kManyDescriptors_ = 64; // TODO base this number on measured data + std::unique_ptr filtered_map_; + const BindingReqMap &orig_map_; + + PrefilterBindRequestMap(DescriptorSet &ds, const BindingReqMap &in_map, GLOBAL_CB_NODE *cb_state); + PrefilterBindRequestMap(DescriptorSet &ds, const BindingReqMap &in_map, GLOBAL_CB_NODE *cb_state, PIPELINE_STATE *); + const BindingReqMap &Map() const { return (filtered_map_) ? *filtered_map_ : orig_map_; } +}; +} // namespace cvdescriptorset #endif // CORE_VALIDATION_DESCRIPTOR_SETS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/layers/hash_util.h vulkan-1.1.73+dfsg/layers/hash_util.h --- vulkan-1.0.65.2+dfsg1/layers/hash_util.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/hash_util.h 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,164 @@ +/* Copyright (c) 2015-2016 The Khronos Group Inc. + * Copyright (c) 2015-2016 Valve Corporation + * Copyright (c) 2015-2016 LunarG, Inc. + * Copyright (C) 2015-2016 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: John Zulauf + */ +#ifndef HASH_UTIL_H_ +#define HASH_UTIL_H_ + +#define NOMINMAX +#include +#include +#include +#include +#include +#include +#include +#include + +// Hash and equality utilities for supporting hashing containers (e.g. unordered_set, unordered_map) +namespace hash_util { + +// True iff both pointers are null or both are non-null +template +bool similar_for_nullity(const T *const lhs, const T *const rhs) { + return ((lhs != nullptr) && (rhs != nullptr)) || ((lhs == nullptr) && (rhs == nullptr)); +} + +// Wrap std hash to avoid manual casts for the holes in std::hash (in C++11) +template +size_t HashWithUnderlying(Value value, typename std::enable_if::value, void *>::type = nullptr) { + return std::hash()(value); +} + +template +size_t HashWithUnderlying(Value value, typename std::enable_if::value, void *>::type = nullptr) { + using Underlying = typename std::underlying_type::type; + return std::hash()(static_cast(value)); +} + +class HashCombiner { + public: + using Key = size_t; + + template + struct WrappedHash { + size_t operator()(const Value &value) const { return HashWithUnderlying(value); } + }; + + HashCombiner(Key combined = 0) : combined_(combined) {} + // magic and combination algorithm based on boost::hash_combine + // http://www.boost.org/doc/libs/1_43_0/doc/html/hash/reference.html#boost.hash_combine + // Magic value is 2^size / ((1-sqrt(5)/2) + static const uint64_t kMagic = sizeof(Key) > 4 ? Key(0x9e3779b97f4a7c16UL) : Key(0x9e3779b9U); + + // If you need to override the default hash + template > + HashCombiner &Combine(const Value &value) { + combined_ ^= Hasher()(value) + kMagic + (combined_ << 6) + (combined_ >> 2); + return *this; + } + + template ::value_type>> + HashCombiner &Combine(Iterator first, Iterator end) { + using Value = typename std::iterator_traits::value_type; + auto current = first; + for (; current != end; ++current) { + Combine(*current); + } + return *this; + } + + template > + HashCombiner &Combine(const std::vector &vector) { + return Combine(vector.cbegin(), vector.cend()); + } + + template + HashCombiner &operator<<(const Value &value) { + return Combine(value); + } + + Key Value() const { return combined_; } + void Reset(Key combined = 0) { combined_ = combined; } + + private: + Key combined_; +}; + +// A template to inherit std::hash overloads from when T::hash() is defined +template +struct HasHashMember { + size_t operator()(const T &value) const { return value.hash(); } +}; + +// A template to inherit std::hash overloads from when is an *ordered* constainer +template +struct IsOrderedContainer { + size_t operator()(const T &value) const { return HashCombiner().Combine(value.cbegin(), value.cend()).Value(); } +}; + +// The dictionary provides a way of referencing canonical/reference +// data by id, such that the id's are invariant with dictionary +// resize/insert and that no entries point to identical data. This +// approach uses the address of the unique data and as the unique +// ID for a give value of T. +// +// Note: This ID is unique for a given application execution, neither +// globally unique, invariant, nor repeatable from execution to +// execution. +// +// The entries of the dictionary are shared_pointers (the contents of +// which are invariant with resize/insert), with the hash and equality +// template arguments wrapped in a shared pointer dereferencing +// function object +template , typename KeyEqual = std::equal_to> +class Dictionary { + public: + using Def = T; + using Id = std::shared_ptr; + + // Find the unique entry match the provided value, adding if needed + // TODO: segregate lookup from insert, using reader/write locks to reduce contention -- if needed + template + Id look_up(U &&value) { + // We create an Id from the value, which will either be retained by dict (if new) or deleted on return (if extant) + Id from_input = std::make_shared(std::forward(value)); + + // Insert takes care of the "unique" id part by rejecting the insert if a key matching by_value exists, but returning us + // the Id of the extant shared_pointer(id->def) instead. + // return the value of the Iterator from the pair returned by insert + Guard g(lock); // Dict isn't thread safe, and use is presumed to be multi-threaded + return *dict.insert(from_input).first; + } + + private: + struct HashKeyValue { + size_t operator()(const Id &value) const { return Hasher()(*value); } + }; + struct KeyValueEqual { + bool operator()(const Id &lhs, const Id &rhs) const { return KeyEqual()(*lhs, *rhs); } + }; + using Dict = std::unordered_set; + using Lock = std::mutex; + using Guard = std::lock_guard; + Lock lock; + Dict dict; +}; +} // namespace hash_util + +#endif // HASH_UTILS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/layers/hash_vk_types.h vulkan-1.1.73+dfsg/layers/hash_vk_types.h --- vulkan-1.0.65.2+dfsg1/layers/hash_vk_types.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/hash_vk_types.h 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,86 @@ +/* Copyright (c) 2018 The Khronos Group Inc. + * Copyright (c) 2018 Valve Corporation + * Copyright (c) 2018 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: John Zulauf + */ +#ifndef HASH_VK_TYPES_H_ +#define HASH_VK_TYPES_H_ + +// Includes everything needed for overloading std::hash +#include "hash_util.h" + +#include +#include "vk_safe_struct.h" +#include + +// Hash and equality and/or compare functions for selected Vk types (and useful collections thereof) + +// VkDescriptorSetLayoutBinding +static bool operator==(const safe_VkDescriptorSetLayoutBinding &lhs, const safe_VkDescriptorSetLayoutBinding &rhs) { + if ((lhs.binding != rhs.binding) || (lhs.descriptorType != rhs.descriptorType) || + (lhs.descriptorCount != rhs.descriptorCount) || (lhs.stageFlags != rhs.stageFlags) || + !hash_util::similar_for_nullity(lhs.pImmutableSamplers, rhs.pImmutableSamplers)) { + return false; + } + if (lhs.pImmutableSamplers) { // either one will do as they *are* similar for nullity (i.e. either both null or both non-null) + for (uint32_t samp = 0; samp < lhs.descriptorCount; samp++) { + if (lhs.pImmutableSamplers[samp] != rhs.pImmutableSamplers[samp]) { + return false; + } + } + } + return true; +} + +namespace std { +template <> +struct hash { + size_t operator()(const safe_VkDescriptorSetLayoutBinding &value) const { + hash_util::HashCombiner hc; + hc << value.binding << value.descriptorType << value.descriptorCount << value.stageFlags; + if (value.pImmutableSamplers) { + for (uint32_t samp = 0; samp < value.descriptorCount; samp++) { + hc << value.pImmutableSamplers[samp]; + } + } + return hc.Value(); + } +}; +} // namespace std + +// VkPushConstantRange +static bool operator==(const VkPushConstantRange &lhs, const VkPushConstantRange &rhs) { + return (lhs.stageFlags == rhs.stageFlags) && (lhs.offset == rhs.offset) && (lhs.size == rhs.size); +} + +namespace std { +template <> +struct hash { + size_t operator()(const VkPushConstantRange &value) const { + hash_util::HashCombiner hc; + return (hc << value.stageFlags << value.offset << value.size).Value(); + } +}; +} // namespace std + +using PushConstantRanges = std::vector; + +namespace std { +template <> +struct hash : public hash_util::IsOrderedContainer {}; +} // namespace std + +#endif // HASH_VK_TYPES_H_ diff -Nru vulkan-1.0.65.2+dfsg1/layers/linux/VkLayer_core_validation.json vulkan-1.1.73+dfsg/layers/linux/VkLayer_core_validation.json --- vulkan-1.0.65.2+dfsg1/layers/linux/VkLayer_core_validation.json 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/linux/VkLayer_core_validation.json 2018-04-27 11:24:19.000000000 +0000 @@ -4,7 +4,7 @@ "name": "VK_LAYER_LUNARG_core_validation", "type": "GLOBAL", "library_path": "./libVkLayer_core_validation.so", - "api_version": "1.0.65", + "api_version": "1.1.73", "implementation_version": "1", "description": "LunarG Validation Layer", "instance_extensions": [ @@ -23,6 +23,15 @@ "vkCmdDebugMarkerEndEXT", "vkCmdDebugMarkerInsertEXT" ] + }, + { + "name": "VK_EXT_validation_cache", + "spec_version": "1", + "entrypoints": ["vkCreateValidationCacheEXT", + "vkDestroyValidationCacheEXT", + "vkGetValidationCacheDataEXT", + "vkMergeValidationCachesEXT" + ] } ] } diff -Nru vulkan-1.0.65.2+dfsg1/layers/linux/VkLayer_object_tracker.json vulkan-1.1.73+dfsg/layers/linux/VkLayer_object_tracker.json --- vulkan-1.0.65.2+dfsg1/layers/linux/VkLayer_object_tracker.json 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/linux/VkLayer_object_tracker.json 2018-04-27 11:24:19.000000000 +0000 @@ -4,7 +4,7 @@ "name": "VK_LAYER_LUNARG_object_tracker", "type": "GLOBAL", "library_path": "./libVkLayer_object_tracker.so", - "api_version": "1.0.65", + "api_version": "1.1.73", "implementation_version": "1", "description": "LunarG Validation Layer", "instance_extensions": [ diff -Nru vulkan-1.0.65.2+dfsg1/layers/linux/VkLayer_parameter_validation.json vulkan-1.1.73+dfsg/layers/linux/VkLayer_parameter_validation.json --- vulkan-1.0.65.2+dfsg1/layers/linux/VkLayer_parameter_validation.json 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/linux/VkLayer_parameter_validation.json 2018-04-27 11:24:19.000000000 +0000 @@ -4,7 +4,7 @@ "name": "VK_LAYER_LUNARG_parameter_validation", "type": "GLOBAL", "library_path": "./libVkLayer_parameter_validation.so", - "api_version": "1.0.65", + "api_version": "1.1.73", "implementation_version": "1", "description": "LunarG Validation Layer", "instance_extensions": [ diff -Nru vulkan-1.0.65.2+dfsg1/layers/linux/VkLayer_standard_validation.json vulkan-1.1.73+dfsg/layers/linux/VkLayer_standard_validation.json --- vulkan-1.0.65.2+dfsg1/layers/linux/VkLayer_standard_validation.json 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/linux/VkLayer_standard_validation.json 2018-04-27 11:24:19.000000000 +0000 @@ -3,7 +3,7 @@ "layer": { "name": "VK_LAYER_LUNARG_standard_validation", "type": "GLOBAL", - "api_version": "1.0.65", + "api_version": "1.1.73", "implementation_version": "1", "description": "LunarG Standard Validation", "component_layers": [ diff -Nru vulkan-1.0.65.2+dfsg1/layers/linux/VkLayer_threading.json vulkan-1.1.73+dfsg/layers/linux/VkLayer_threading.json --- vulkan-1.0.65.2+dfsg1/layers/linux/VkLayer_threading.json 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/linux/VkLayer_threading.json 2018-04-27 11:24:19.000000000 +0000 @@ -4,7 +4,7 @@ "name": "VK_LAYER_GOOGLE_threading", "type": "GLOBAL", "library_path": "./libVkLayer_threading.so", - "api_version": "1.0.65", + "api_version": "1.1.73", "implementation_version": "1", "description": "Google Validation Layer", "instance_extensions": [ diff -Nru vulkan-1.0.65.2+dfsg1/layers/linux/VkLayer_unique_objects.json vulkan-1.1.73+dfsg/layers/linux/VkLayer_unique_objects.json --- vulkan-1.0.65.2+dfsg1/layers/linux/VkLayer_unique_objects.json 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/linux/VkLayer_unique_objects.json 2018-04-27 11:24:19.000000000 +0000 @@ -4,7 +4,7 @@ "name": "VK_LAYER_GOOGLE_unique_objects", "type": "GLOBAL", "library_path": "./libVkLayer_unique_objects.so", - "api_version": "1.0.65", + "api_version": "1.1.73", "implementation_version": "1", "description": "Google Validation Layer" } diff -Nru vulkan-1.0.65.2+dfsg1/layers/macos/VkLayer_core_validation.json vulkan-1.1.73+dfsg/layers/macos/VkLayer_core_validation.json --- vulkan-1.0.65.2+dfsg1/layers/macos/VkLayer_core_validation.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/macos/VkLayer_core_validation.json 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,29 @@ +{ + "file_format_version" : "1.1.0", + "layer" : { + "name": "VK_LAYER_LUNARG_core_validation", + "type": "GLOBAL", + "library_path": "./libVkLayer_core_validation.dylib", + "api_version": "1.0.69", + "implementation_version": "1", + "description": "LunarG Validation Layer", + "instance_extensions": [ + { + "name": "VK_EXT_debug_report", + "spec_version": "6" + } + ], + "device_extensions": [ + { + "name": "VK_EXT_debug_marker", + "spec_version": "4", + "entrypoints": ["vkDebugMarkerSetObjectTagEXT", + "vkDebugMarkerSetObjectNameEXT", + "vkCmdDebugMarkerBeginEXT", + "vkCmdDebugMarkerEndEXT", + "vkCmdDebugMarkerInsertEXT" + ] + } + ] + } +} diff -Nru vulkan-1.0.65.2+dfsg1/layers/macos/VkLayer_device_simulation.json vulkan-1.1.73+dfsg/layers/macos/VkLayer_device_simulation.json --- vulkan-1.0.65.2+dfsg1/layers/macos/VkLayer_device_simulation.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/macos/VkLayer_device_simulation.json 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,11 @@ +{ + "file_format_version" : "1.1.0", + "layer" : { + "name": "VK_LAYER_LUNARG_device_simulation", + "type": "GLOBAL", + "library_path": "./libVkLayer_device_simulation.dylib", + "api_version": "1.0.69", + "implementation_version": "1.2.0", + "description": "LunarG device simulation layer" + } +} diff -Nru vulkan-1.0.65.2+dfsg1/layers/macos/VkLayer_object_tracker.json vulkan-1.1.73+dfsg/layers/macos/VkLayer_object_tracker.json --- vulkan-1.0.65.2+dfsg1/layers/macos/VkLayer_object_tracker.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/macos/VkLayer_object_tracker.json 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,29 @@ +{ + "file_format_version" : "1.1.0", + "layer" : { + "name": "VK_LAYER_LUNARG_object_tracker", + "type": "GLOBAL", + "library_path": "./libVkLayer_object_tracker.dylib", + "api_version": "1.0.69", + "implementation_version": "1", + "description": "LunarG Validation Layer", + "instance_extensions": [ + { + "name": "VK_EXT_debug_report", + "spec_version": "6" + } + ], + "device_extensions": [ + { + "name": "VK_EXT_debug_marker", + "spec_version": "4", + "entrypoints": ["vkDebugMarkerSetObjectTagEXT", + "vkDebugMarkerSetObjectNameEXT", + "vkCmdDebugMarkerBeginEXT", + "vkCmdDebugMarkerEndEXT", + "vkCmdDebugMarkerInsertEXT" + ] + } + ] + } +} diff -Nru vulkan-1.0.65.2+dfsg1/layers/macos/VkLayer_parameter_validation.json vulkan-1.1.73+dfsg/layers/macos/VkLayer_parameter_validation.json --- vulkan-1.0.65.2+dfsg1/layers/macos/VkLayer_parameter_validation.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/macos/VkLayer_parameter_validation.json 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,29 @@ +{ + "file_format_version" : "1.1.0", + "layer" : { + "name": "VK_LAYER_LUNARG_parameter_validation", + "type": "GLOBAL", + "library_path": "./libVkLayer_parameter_validation.dylib", + "api_version": "1.0.69", + "implementation_version": "1", + "description": "LunarG Validation Layer", + "instance_extensions": [ + { + "name": "VK_EXT_debug_report", + "spec_version": "6" + } + ], + "device_extensions": [ + { + "name": "VK_EXT_debug_marker", + "spec_version": "4", + "entrypoints": ["vkDebugMarkerSetObjectTagEXT", + "vkDebugMarkerSetObjectNameEXT", + "vkCmdDebugMarkerBeginEXT", + "vkCmdDebugMarkerEndEXT", + "vkCmdDebugMarkerInsertEXT" + ] + } + ] + } +} diff -Nru vulkan-1.0.65.2+dfsg1/layers/macos/VkLayer_standard_validation.json vulkan-1.1.73+dfsg/layers/macos/VkLayer_standard_validation.json --- vulkan-1.0.65.2+dfsg1/layers/macos/VkLayer_standard_validation.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/macos/VkLayer_standard_validation.json 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,17 @@ +{ + "file_format_version": "1.1.1", + "layer": { + "name": "VK_LAYER_LUNARG_standard_validation", + "type": "GLOBAL", + "api_version": "1.0.69", + "implementation_version": "1", + "description": "LunarG Standard Validation", + "component_layers": [ + "VK_LAYER_GOOGLE_threading", + "VK_LAYER_LUNARG_parameter_validation", + "VK_LAYER_LUNARG_object_tracker", + "VK_LAYER_LUNARG_core_validation", + "VK_LAYER_GOOGLE_unique_objects" + ] + } +} diff -Nru vulkan-1.0.65.2+dfsg1/layers/macos/VkLayer_threading.json vulkan-1.1.73+dfsg/layers/macos/VkLayer_threading.json --- vulkan-1.0.65.2+dfsg1/layers/macos/VkLayer_threading.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/macos/VkLayer_threading.json 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,17 @@ +{ + "file_format_version" : "1.1.0", + "layer" : { + "name": "VK_LAYER_GOOGLE_threading", + "type": "GLOBAL", + "library_path": "./libVkLayer_threading.dylib", + "api_version": "1.0.69", + "implementation_version": "1", + "description": "Google Validation Layer", + "instance_extensions": [ + { + "name": "VK_EXT_debug_report", + "spec_version": "6" + } + ] + } +} diff -Nru vulkan-1.0.65.2+dfsg1/layers/macos/VkLayer_unique_objects.json vulkan-1.1.73+dfsg/layers/macos/VkLayer_unique_objects.json --- vulkan-1.0.65.2+dfsg1/layers/macos/VkLayer_unique_objects.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/macos/VkLayer_unique_objects.json 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,11 @@ +{ + "file_format_version" : "1.1.0", + "layer" : { + "name": "VK_LAYER_GOOGLE_unique_objects", + "type": "GLOBAL", + "library_path": "./libVkLayer_unique_objects.dylib", + "api_version": "1.0.69", + "implementation_version": "1", + "description": "Google Validation Layer" + } +} diff -Nru vulkan-1.0.65.2+dfsg1/layers/object_tracker.h vulkan-1.1.73+dfsg/layers/object_tracker.h --- vulkan-1.0.65.2+dfsg1/layers/object_tracker.h 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/object_tracker.h 2018-04-27 11:24:19.000000000 +0000 @@ -35,7 +35,6 @@ #include "vk_layer_table.h" #include "vk_object_types.h" #include "vulkan/vk_layer.h" -#include "vk_object_types.h" #include "vk_enum_string_helper.h" #include "vk_layer_extension_utils.h" #include "vk_layer_table.h" @@ -82,9 +81,6 @@ VkQueue queue; }; -// Layer name string to be logged with validation messages. -const char LayerName[] = "ObjectTracker"; - typedef std::unordered_map object_map_type; struct layer_data { @@ -96,11 +92,15 @@ debug_report_data *report_data; std::vector logging_callback; + std::vector logging_messenger; // The following are for keeping track of the temporary callbacks that can // be used in vkCreateInstance and vkDestroyInstance: - uint32_t num_tmp_callbacks; - VkDebugReportCallbackCreateInfoEXT *tmp_dbg_create_infos; - VkDebugReportCallbackEXT *tmp_callbacks; + uint32_t num_tmp_report_callbacks; + VkDebugReportCallbackCreateInfoEXT *tmp_report_create_infos; + VkDebugReportCallbackEXT *tmp_report_callbacks; + uint32_t num_tmp_debug_messengers; + VkDebugUtilsMessengerCreateInfoEXT *tmp_messenger_create_infos; + VkDebugUtilsMessengerEXT *tmp_debug_messengers; std::vector queue_family_properties; @@ -119,9 +119,12 @@ num_objects{}, num_total_objects(0), report_data(nullptr), - num_tmp_callbacks(0), - tmp_dbg_create_infos(nullptr), - tmp_callbacks(nullptr), + num_tmp_report_callbacks(0), + tmp_report_create_infos(nullptr), + tmp_report_callbacks(nullptr), + num_tmp_debug_messengers(0), + tmp_messenger_create_infos(nullptr), + tmp_debug_messengers(nullptr), object_map{}, dispatch_table{} { object_map.resize(kVulkanObjectTypeMax + 1); @@ -137,6 +140,7 @@ extern const std::unordered_map name_to_funcptr_map; void DeviceReportUndestroyedObjects(VkDevice device, VulkanObjectType object_type, enum UNIQUE_VALIDATION_ERROR_CODE error_code); +void DeviceDestroyUndestroyedObjects(VkDevice device, VulkanObjectType object_type); void CreateQueue(VkDevice device, VkQueue vkObj); void AddQueueInfo(VkDevice device, uint32_t queue_node_index, VkQueue queue); void ValidateQueueFlags(VkQueue queue, const char *function); @@ -145,7 +149,9 @@ void AllocateDescriptorSet(VkDevice device, VkDescriptorPool descriptor_pool, VkDescriptorSet descriptor_set); void CreateSwapchainImageObject(VkDevice dispatchable_object, VkImage swapchain_image, VkSwapchainKHR swapchain); void ReportUndestroyedObjects(VkDevice device, UNIQUE_VALIDATION_ERROR_CODE error_code); - +void DestroyUndestroyedObjects(VkDevice device); +bool ValidateDeviceObject(uint64_t device_handle, enum UNIQUE_VALIDATION_ERROR_CODE invalid_handle_code, + enum UNIQUE_VALIDATION_ERROR_CODE wrong_device_code); template bool ValidateObject(T1 dispatchable_object, T2 object, VulkanObjectType object_type, bool null_allowed, @@ -154,6 +160,11 @@ return false; } auto object_handle = HandleToUint64(object); + + if (object_type == kVulkanObjectTypeDevice) { + return ValidateDeviceObject(object_handle, invalid_handle_code, wrong_device_code); + } + VkDebugReportObjectTypeEXT debug_object_type = get_debug_report_enum[object_type]; layer_data *device_data = GetLayerDataPtr(get_dispatch_key(dispatchable_object), layer_data_map); @@ -172,10 +183,10 @@ // Object found on other device, report an error if object has a device parent error code if ((wrong_device_code != VALIDATION_ERROR_UNDEFINED) && (object_type != kVulkanObjectTypeSurfaceKHR)) { return log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, debug_object_type, - object_handle, __LINE__, wrong_device_code, LayerName, + object_handle, wrong_device_code, "Object 0x%" PRIxLEAST64 - " was not created, allocated or retrieved from the correct device. %s", - object_handle, validation_error_map[wrong_device_code]); + " was not created, allocated or retrieved from the correct device.", + object_handle); } else { return false; } @@ -183,9 +194,8 @@ } } // Report an error if object was not found anywhere - return log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, debug_object_type, object_handle, __LINE__, - invalid_handle_code, LayerName, "Invalid %s Object 0x%" PRIxLEAST64 ". %s", object_string[object_type], - object_handle, validation_error_map[invalid_handle_code]); + return log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, debug_object_type, object_handle, + invalid_handle_code, "Invalid %s Object 0x%" PRIxLEAST64 ".", object_string[object_type], object_handle); } } return false; @@ -200,9 +210,9 @@ if (!instance_data->object_map[object_type].count(object_handle)) { VkDebugReportObjectTypeEXT debug_object_type = get_debug_report_enum[object_type]; - log_msg(instance_data->report_data, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, debug_object_type, object_handle, __LINE__, - OBJTRACK_NONE, LayerName, "OBJ[0x%" PRIxLEAST64 "] : CREATE %s object 0x%" PRIxLEAST64, object_track_index++, - object_string[object_type], object_handle); + log_msg(instance_data->report_data, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, debug_object_type, object_handle, OBJTRACK_NONE, + "OBJ[0x%" PRIxLEAST64 "] : CREATE %s object 0x%" PRIxLEAST64, object_track_index++, object_string[object_type], + object_handle); ObjTrackState *pNewObjNode = new ObjTrackState; pNewObjNode->object_type = object_type; @@ -216,6 +226,28 @@ } template +void DestroyObjectSilently(T1 dispatchable_object, T2 object, VulkanObjectType object_type) { + layer_data *device_data = GetLayerDataPtr(get_dispatch_key(dispatchable_object), layer_data_map); + + auto object_handle = HandleToUint64(object); + assert(object_handle != VK_NULL_HANDLE); + + auto item = device_data->object_map[object_type].find(object_handle); + assert(item != device_data->object_map[object_type].end()); + + ObjTrackState *pNode = item->second; + assert(device_data->num_total_objects > 0); + + device_data->num_total_objects--; + assert(device_data->num_objects[pNode->object_type] > 0); + + device_data->num_objects[pNode->object_type]--; + + delete pNode; + device_data->object_map[object_type].erase(item); +} + +template void DestroyObject(T1 dispatchable_object, T2 object, VulkanObjectType object_type, const VkAllocationCallbacks *pAllocator, enum UNIQUE_VALIDATION_ERROR_CODE expected_custom_allocator_code, enum UNIQUE_VALIDATION_ERROR_CODE expected_default_allocator_code) { @@ -229,38 +261,32 @@ auto item = device_data->object_map[object_type].find(object_handle); if (item != device_data->object_map[object_type].end()) { ObjTrackState *pNode = item->second; - assert(device_data->num_total_objects > 0); - device_data->num_total_objects--; - assert(device_data->num_objects[pNode->object_type] > 0); - device_data->num_objects[pNode->object_type]--; - log_msg(device_data->report_data, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, debug_object_type, object_handle, __LINE__, - OBJTRACK_NONE, LayerName, + log_msg(device_data->report_data, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, debug_object_type, object_handle, OBJTRACK_NONE, "OBJ_STAT Destroy %s obj 0x%" PRIxLEAST64 " (%" PRIu64 " total objs remain & %" PRIu64 " %s objs).", - object_string[object_type], HandleToUint64(object), device_data->num_total_objects, - device_data->num_objects[pNode->object_type], object_string[object_type]); + object_string[object_type], HandleToUint64(object), device_data->num_total_objects - 1, + device_data->num_objects[pNode->object_type] - 1, object_string[object_type]); auto allocated_with_custom = (pNode->status & OBJSTATUS_CUSTOM_ALLOCATOR) ? true : false; if (allocated_with_custom && !custom_allocator && expected_custom_allocator_code != VALIDATION_ERROR_UNDEFINED) { // This check only verifies that custom allocation callbacks were provided to both Create and Destroy calls, // it cannot verify that these allocation callbacks are compatible with each other. - log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, debug_object_type, object_handle, __LINE__, - expected_custom_allocator_code, LayerName, - "Custom allocator not specified while destroying %s obj 0x%" PRIxLEAST64 " but specified at creation. %s", - object_string[object_type], object_handle, validation_error_map[expected_custom_allocator_code]); + log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, debug_object_type, object_handle, + expected_custom_allocator_code, + "Custom allocator not specified while destroying %s obj 0x%" PRIxLEAST64 " but specified at creation.", + object_string[object_type], object_handle); } else if (!allocated_with_custom && custom_allocator && expected_default_allocator_code != VALIDATION_ERROR_UNDEFINED) { - log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, debug_object_type, object_handle, __LINE__, - expected_default_allocator_code, LayerName, - "Custom allocator specified while destroying %s obj 0x%" PRIxLEAST64 " but not specified at creation. %s", - object_string[object_type], object_handle, validation_error_map[expected_default_allocator_code]); + log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, debug_object_type, object_handle, + expected_default_allocator_code, + "Custom allocator specified while destroying %s obj 0x%" PRIxLEAST64 " but not specified at creation.", + object_string[object_type], object_handle); } - delete pNode; - device_data->object_map[object_type].erase(item); + DestroyObjectSilently(dispatchable_object, object, object_type); } else { log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, object_handle, - __LINE__, OBJTRACK_UNKNOWN_OBJECT, LayerName, + OBJTRACK_UNKNOWN_OBJECT, "Unable to remove %s obj 0x%" PRIxLEAST64 ". Was it created? Has it already been destroyed?", object_string[object_type], object_handle); } diff -Nru vulkan-1.0.65.2+dfsg1/layers/object_tracker_layer.md vulkan-1.1.73+dfsg/layers/object_tracker_layer.md --- vulkan-1.0.65.2+dfsg1/layers/object_tracker_layer.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/object_tracker_layer.md 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,12 @@ +# VK\_LAYER\_LUNARG\_object\_tracker +The `VK_LAYER_LUNARG_object_tracker` layer tracks all Vulkan objects. Object lifetimes are validated along with issues related to unknown objects and object destruction and cleanup. + +All Vulkan dispatchable and non-dispatchable objects are tracked by the `VK_LAYER_LUNARG_object_tracker` layer. + +This layer validates that: + + - only known objects are referenced and destroyed + - lookups are performed only on objects being tracked + - objects are correctly freed/destroyed. + +The `VK_LAYER_LUNARG_object_tracker` layer will print errors if validation checks are not correctly met and warnings if improper reference of objects is detected. diff -Nru vulkan-1.0.65.2+dfsg1/layers/object_tracker_utils.cpp vulkan-1.1.73+dfsg/layers/object_tracker_utils.cpp --- vulkan-1.0.65.2+dfsg1/layers/object_tracker_utils.cpp 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/object_tracker_utils.cpp 2018-04-27 11:24:19.000000000 +0000 @@ -32,7 +32,8 @@ uint32_t loader_layer_if_version = CURRENT_LOADER_LAYER_INTERFACE_VERSION; void InitObjectTracker(layer_data *my_data, const VkAllocationCallbacks *pAllocator) { - layer_debug_actions(my_data->report_data, my_data->logging_callback, pAllocator, "lunarg_object_tracker"); + layer_debug_report_actions(my_data->report_data, my_data->logging_callback, pAllocator, "lunarg_object_tracker"); + layer_debug_messenger_actions(my_data->report_data, my_data->logging_messenger, pAllocator, "lunarg_object_tracker"); } // Add new queue to head of global queue list @@ -48,7 +49,7 @@ device_data->queue_info_map[queue] = p_queue_info; } else { log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT, - HandleToUint64(queue), __LINE__, OBJTRACK_INTERNAL_ERROR, LayerName, + HandleToUint64(queue), OBJTRACK_INTERNAL_ERROR, "ERROR: VK_ERROR_OUT_OF_HOST_MEMORY -- could not allocate memory for Queue Information"); } } @@ -72,7 +73,7 @@ assert(device_data->num_objects[obj_index] > 0); device_data->num_objects[obj_index]--; log_msg(device_data->report_data, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT, - queue->second->handle, __LINE__, OBJTRACK_NONE, LayerName, + queue->second->handle, OBJTRACK_NONE, "OBJ_STAT Destroy Queue obj 0x%" PRIxLEAST64 " (%" PRIu64 " total objs remain & %" PRIu64 " Queue objs).", queue->second->handle, device_data->num_total_objects, device_data->num_objects[obj_index]); delete queue->second; @@ -91,22 +92,39 @@ if ((instance_data->queue_family_properties[pQueueInfo->queue_node_index].queueFlags & VK_QUEUE_SPARSE_BINDING_BIT) == 0) { log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT, - HandleToUint64(queue), __LINE__, VALIDATION_ERROR_31600011, LayerName, - "Attempting %s on a non-memory-management capable queue -- VK_QUEUE_SPARSE_BINDING_BIT not set. %s", - function, validation_error_map[VALIDATION_ERROR_31600011]); + HandleToUint64(queue), VALIDATION_ERROR_31600011, + "Attempting %s on a non-memory-management capable queue -- VK_QUEUE_SPARSE_BINDING_BIT not set.", function); } } } } +// Look for this device object in any of the instance child devices lists. +// NOTE: This is of dubious value. In most circumstances Vulkan will die a flaming death if a dispatchable object is invalid. +// However, if this layer is loaded first and GetProcAddress is used to make API calls, it will detect bad DOs. +bool ValidateDeviceObject(uint64_t device_handle, enum UNIQUE_VALIDATION_ERROR_CODE invalid_handle_code, + enum UNIQUE_VALIDATION_ERROR_CODE wrong_device_code) { + VkInstance last_instance = nullptr; + for (auto layer_data : layer_data_map) { + for (auto object : layer_data.second->object_map[kVulkanObjectTypeDevice]) { + // Grab last instance to use for possible error message + last_instance = layer_data.second->instance; + if (object.second->handle == device_handle) return false; + } + } + + layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(last_instance), layer_data_map); + return log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, device_handle, + invalid_handle_code, "Invalid Device Object 0x%" PRIxLEAST64 ".", device_handle); +} + void AllocateCommandBuffer(VkDevice device, const VkCommandPool command_pool, const VkCommandBuffer command_buffer, VkCommandBufferLevel level) { layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); log_msg(device_data->report_data, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(command_buffer), __LINE__, OBJTRACK_NONE, LayerName, - "OBJ[0x%" PRIxLEAST64 "] : CREATE %s object 0x%" PRIxLEAST64, object_track_index++, - "VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT", HandleToUint64(command_buffer)); + HandleToUint64(command_buffer), OBJTRACK_NONE, "OBJ[0x%" PRIxLEAST64 "] : CREATE %s object 0x%" PRIxLEAST64, + object_track_index++, "VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT", HandleToUint64(command_buffer)); ObjTrackState *pNewObjNode = new ObjTrackState; pNewObjNode->object_type = kVulkanObjectTypeCommandBuffer; @@ -132,17 +150,15 @@ if (pNode->parent_object != HandleToUint64(command_pool)) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - object_handle, __LINE__, VALIDATION_ERROR_28411407, LayerName, + object_handle, VALIDATION_ERROR_28411407, "FreeCommandBuffers is attempting to free Command Buffer 0x%" PRIxLEAST64 - " belonging to Command Pool 0x%" PRIxLEAST64 " from pool 0x%" PRIxLEAST64 "). %s", - HandleToUint64(command_buffer), pNode->parent_object, HandleToUint64(command_pool), - validation_error_map[VALIDATION_ERROR_28411407]); + " belonging to Command Pool 0x%" PRIxLEAST64 " from pool 0x%" PRIxLEAST64 ").", + HandleToUint64(command_buffer), pNode->parent_object, HandleToUint64(command_pool)); } } else { - skip |= - log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - object_handle, __LINE__, VALIDATION_ERROR_28400060, LayerName, "Invalid %s Object 0x%" PRIxLEAST64 ". %s", - object_string[kVulkanObjectTypeCommandBuffer], object_handle, validation_error_map[VALIDATION_ERROR_28400060]); + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + object_handle, VALIDATION_ERROR_28400060, "Invalid %s Object 0x%" PRIxLEAST64 ".", + object_string[kVulkanObjectTypeCommandBuffer], object_handle); } return skip; } @@ -151,9 +167,8 @@ layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); log_msg(device_data->report_data, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, - HandleToUint64(descriptor_set), __LINE__, OBJTRACK_NONE, LayerName, - "OBJ[0x%" PRIxLEAST64 "] : CREATE %s object 0x%" PRIxLEAST64, object_track_index++, - "VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT", HandleToUint64(descriptor_set)); + HandleToUint64(descriptor_set), OBJTRACK_NONE, "OBJ[0x%" PRIxLEAST64 "] : CREATE %s object 0x%" PRIxLEAST64, + object_track_index++, "VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT", HandleToUint64(descriptor_set)); ObjTrackState *pNewObjNode = new ObjTrackState; pNewObjNode->object_type = kVulkanObjectTypeDescriptorSet; @@ -175,46 +190,42 @@ if (pNode->parent_object != HandleToUint64(descriptor_pool)) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, - object_handle, __LINE__, VALIDATION_ERROR_28613007, LayerName, + object_handle, VALIDATION_ERROR_28613007, "FreeDescriptorSets is attempting to free descriptorSet 0x%" PRIxLEAST64 - " belonging to Descriptor Pool 0x%" PRIxLEAST64 " from pool 0x%" PRIxLEAST64 "). %s", - HandleToUint64(descriptor_set), pNode->parent_object, HandleToUint64(descriptor_pool), - validation_error_map[VALIDATION_ERROR_28613007]); + " belonging to Descriptor Pool 0x%" PRIxLEAST64 " from pool 0x%" PRIxLEAST64 ").", + HandleToUint64(descriptor_set), pNode->parent_object, HandleToUint64(descriptor_pool)); } } else { - skip |= - log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, - object_handle, __LINE__, VALIDATION_ERROR_2860026c, LayerName, "Invalid %s Object 0x%" PRIxLEAST64 ". %s", - object_string[kVulkanObjectTypeDescriptorSet], object_handle, validation_error_map[VALIDATION_ERROR_2860026c]); + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, + object_handle, VALIDATION_ERROR_2860026c, "Invalid %s Object 0x%" PRIxLEAST64 ".", + object_string[kVulkanObjectTypeDescriptorSet], object_handle); } return skip; } -template +template static bool ValidateDescriptorWrite(DispObj disp, VkWriteDescriptorSet const *desc, bool isPush) { bool skip = false; if (!isPush && desc->dstSet) { - skip |= ValidateObject(disp, desc->dstSet, kVulkanObjectTypeDescriptorSet, false, - VALIDATION_ERROR_15c00280, VALIDATION_ERROR_15c00009); + skip |= ValidateObject(disp, desc->dstSet, kVulkanObjectTypeDescriptorSet, false, VALIDATION_ERROR_15c00280, + VALIDATION_ERROR_15c00009); } if ((desc->descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER) || (desc->descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER)) { for (uint32_t idx2 = 0; idx2 < desc->descriptorCount; ++idx2) { - skip |= ValidateObject(disp, desc->pTexelBufferView[idx2], kVulkanObjectTypeBufferView, - false, VALIDATION_ERROR_15c00286, VALIDATION_ERROR_15c00009); + skip |= ValidateObject(disp, desc->pTexelBufferView[idx2], kVulkanObjectTypeBufferView, false, + VALIDATION_ERROR_15c00286, VALIDATION_ERROR_15c00009); } } if ((desc->descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) || - (desc->descriptorType == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE) || - (desc->descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) || + (desc->descriptorType == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE) || (desc->descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) || (desc->descriptorType == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT)) { for (uint32_t idx3 = 0; idx3 < desc->descriptorCount; ++idx3) { - skip |= - ValidateObject(disp, desc->pImageInfo[idx3].imageView, kVulkanObjectTypeImageView, - false, VALIDATION_ERROR_15c0028c, VALIDATION_ERROR_04600009); + skip |= ValidateObject(disp, desc->pImageInfo[idx3].imageView, kVulkanObjectTypeImageView, false, + VALIDATION_ERROR_15c0028c, VALIDATION_ERROR_04600009); } } @@ -224,9 +235,8 @@ (desc->descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)) { for (uint32_t idx4 = 0; idx4 < desc->descriptorCount; ++idx4) { if (desc->pBufferInfo[idx4].buffer) { - skip |= - ValidateObject(disp, desc->pBufferInfo[idx4].buffer, kVulkanObjectTypeBuffer, - false, VALIDATION_ERROR_04401a01, VALIDATION_ERROR_UNDEFINED); + skip |= ValidateObject(disp, desc->pBufferInfo[idx4].buffer, kVulkanObjectTypeBuffer, false, + VALIDATION_ERROR_04401a01, VALIDATION_ERROR_UNDEFINED); } } } @@ -259,7 +269,7 @@ layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); log_msg(device_data->report_data, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT, - HandleToUint64(vkObj), __LINE__, OBJTRACK_NONE, LayerName, "OBJ[0x%" PRIxLEAST64 "] : CREATE %s object 0x%" PRIxLEAST64, + HandleToUint64(vkObj), OBJTRACK_NONE, "OBJ[0x%" PRIxLEAST64 "] : CREATE %s object 0x%" PRIxLEAST64, object_track_index++, "VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT", HandleToUint64(vkObj)); ObjTrackState *p_obj_node = NULL; @@ -280,9 +290,8 @@ void CreateSwapchainImageObject(VkDevice dispatchable_object, VkImage swapchain_image, VkSwapchainKHR swapchain) { layer_data *device_data = GetLayerDataPtr(get_dispatch_key(dispatchable_object), layer_data_map); log_msg(device_data->report_data, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(swapchain_image), __LINE__, OBJTRACK_NONE, LayerName, - "OBJ[0x%" PRIxLEAST64 "] : CREATE %s object 0x%" PRIxLEAST64, object_track_index++, "SwapchainImage", - HandleToUint64(swapchain_image)); + HandleToUint64(swapchain_image), OBJTRACK_NONE, "OBJ[0x%" PRIxLEAST64 "] : CREATE %s object 0x%" PRIxLEAST64, + object_track_index++, "SwapchainImage", HandleToUint64(swapchain_image)); ObjTrackState *pNewObjNode = new ObjTrackState; pNewObjNode->object_type = kVulkanObjectTypeImage; @@ -294,13 +303,21 @@ void DeviceReportUndestroyedObjects(VkDevice device, VulkanObjectType object_type, enum UNIQUE_VALIDATION_ERROR_CODE error_code) { layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - for (auto item = device_data->object_map[object_type].begin(); item != device_data->object_map[object_type].end();) { - ObjTrackState *object_info = item->second; + for (const auto &item : device_data->object_map[object_type]) { + const ObjTrackState *object_info = item.second; log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, get_debug_report_enum[object_type], object_info->handle, - __LINE__, error_code, LayerName, - "OBJ ERROR : For device 0x%" PRIxLEAST64 ", %s object 0x%" PRIxLEAST64 " has not been destroyed. %s", - HandleToUint64(device), object_string[object_type], object_info->handle, validation_error_map[error_code]); - item = device_data->object_map[object_type].erase(item); + error_code, "OBJ ERROR : For device 0x%" PRIxLEAST64 ", %s object 0x%" PRIxLEAST64 " has not been destroyed.", + HandleToUint64(device), object_string[object_type], object_info->handle); + } +} + +void DeviceDestroyUndestroyedObjects(VkDevice device, VulkanObjectType object_type) { + layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + while (!device_data->object_map[object_type].empty()) { + auto item = device_data->object_map[object_type].begin(); + + ObjTrackState *object_info = item->second; + DestroyObjectSilently(device, object_info->handle, object_type); } } @@ -311,12 +328,13 @@ layer_data *instance_data = GetLayerDataPtr(key, layer_data_map); // Enable the temporary callback(s) here to catch cleanup issues: - bool callback_setup = false; - if (instance_data->num_tmp_callbacks > 0) { - if (!layer_enable_tmp_callbacks(instance_data->report_data, instance_data->num_tmp_callbacks, - instance_data->tmp_dbg_create_infos, instance_data->tmp_callbacks)) { - callback_setup = true; - } + if (instance_data->num_tmp_debug_messengers > 0) { + layer_enable_tmp_debug_messengers(instance_data->report_data, instance_data->num_tmp_debug_messengers, + instance_data->tmp_messenger_create_infos, instance_data->tmp_debug_messengers); + } + if (instance_data->num_tmp_report_callbacks > 0) { + layer_enable_tmp_report_callbacks(instance_data->report_data, instance_data->num_tmp_report_callbacks, + instance_data->tmp_report_create_infos, instance_data->tmp_report_callbacks); } // TODO: The instance handle can not be validated here. The loader will likely have to validate it. @@ -326,16 +344,14 @@ for (auto iit = instance_data->object_map[kVulkanObjectTypePhysicalDevice].begin(); iit != instance_data->object_map[kVulkanObjectTypePhysicalDevice].end();) { ObjTrackState *pNode = iit->second; - VkPhysicalDevice physical_device = reinterpret_cast(pNode->handle); + DestroyObject(instance, physical_device, kVulkanObjectTypePhysicalDevice, nullptr, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); iit = instance_data->object_map[kVulkanObjectTypePhysicalDevice].begin(); } - DestroyObject(instance, instance, kVulkanObjectTypeInstance, pAllocator, VALIDATION_ERROR_258004ec, VALIDATION_ERROR_258004ee); - // Report any remaining objects in LL - + // Destroy child devices for (auto iit = instance_data->object_map[kVulkanObjectTypeDevice].begin(); iit != instance_data->object_map[kVulkanObjectTypeDevice].end();) { ObjTrackState *pNode = iit->second; @@ -343,34 +359,52 @@ VkDevice device = reinterpret_cast(pNode->handle); VkDebugReportObjectTypeEXT debug_object_type = get_debug_report_enum[pNode->object_type]; - log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, debug_object_type, pNode->handle, __LINE__, - OBJTRACK_OBJECT_LEAK, LayerName, "OBJ ERROR : %s object 0x%" PRIxLEAST64 " has not been destroyed.", + log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, debug_object_type, pNode->handle, OBJTRACK_OBJECT_LEAK, + "OBJ ERROR : %s object 0x%" PRIxLEAST64 " has not been destroyed.", string_VkDebugReportObjectTypeEXT(debug_object_type), pNode->handle); + // Report any remaining objects in LL ReportUndestroyedObjects(device, VALIDATION_ERROR_258004ea); + DestroyUndestroyedObjects(device); + + DestroyObject(instance, device, kVulkanObjectTypeDevice, pAllocator, VALIDATION_ERROR_258004ec, VALIDATION_ERROR_258004ee); + iit = instance_data->object_map[kVulkanObjectTypeDevice].begin(); } + instance_data->object_map[kVulkanObjectTypeDevice].clear(); VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(ot_instance_table_map, instance); pInstanceTable->DestroyInstance(instance, pAllocator); // Disable and cleanup the temporary callback(s): - if (callback_setup) { - layer_disable_tmp_callbacks(instance_data->report_data, instance_data->num_tmp_callbacks, instance_data->tmp_callbacks); - } - if (instance_data->num_tmp_callbacks > 0) { - layer_free_tmp_callbacks(instance_data->tmp_dbg_create_infos, instance_data->tmp_callbacks); - instance_data->num_tmp_callbacks = 0; + layer_disable_tmp_debug_messengers(instance_data->report_data, instance_data->num_tmp_debug_messengers, + instance_data->tmp_debug_messengers); + layer_disable_tmp_report_callbacks(instance_data->report_data, instance_data->num_tmp_report_callbacks, + instance_data->tmp_report_callbacks); + if (instance_data->num_tmp_debug_messengers > 0) { + layer_free_tmp_debug_messengers(instance_data->tmp_messenger_create_infos, instance_data->tmp_debug_messengers); + instance_data->num_tmp_debug_messengers = 0; + } + if (instance_data->num_tmp_report_callbacks > 0) { + layer_free_tmp_report_callbacks(instance_data->tmp_report_create_infos, instance_data->tmp_report_callbacks); + instance_data->num_tmp_report_callbacks = 0; } // Clean up logging callback, if any + while (instance_data->logging_messenger.size() > 0) { + VkDebugUtilsMessengerEXT messenger = instance_data->logging_messenger.back(); + layer_destroy_messenger_callback(instance_data->report_data, messenger, pAllocator); + instance_data->logging_messenger.pop_back(); + } while (instance_data->logging_callback.size() > 0) { VkDebugReportCallbackEXT callback = instance_data->logging_callback.back(); - layer_destroy_msg_callback(instance_data->report_data, callback, pAllocator); + layer_destroy_report_callback(instance_data->report_data, callback, pAllocator); instance_data->logging_callback.pop_back(); } - layer_debug_report_destroy_instance(instance_data->report_data); + DestroyObject(instance, instance, kVulkanObjectTypeInstance, pAllocator, VALIDATION_ERROR_258004ec, VALIDATION_ERROR_258004ee); + + layer_debug_utils_destroy_instance(instance_data->report_data); FreeLayerDataPtr(key, layer_data_map); lock.unlock(); @@ -380,11 +414,14 @@ VKAPI_ATTR void VKAPI_CALL DestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator) { std::unique_lock lock(global_lock); + layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); ValidateObject(device, device, kVulkanObjectTypeDevice, true, VALIDATION_ERROR_24a05601, VALIDATION_ERROR_UNDEFINED); - DestroyObject(device, device, kVulkanObjectTypeDevice, pAllocator, VALIDATION_ERROR_24a002f6, VALIDATION_ERROR_24a002f8); + DestroyObject(device_data->instance, device, kVulkanObjectTypeDevice, pAllocator, VALIDATION_ERROR_24a002f6, + VALIDATION_ERROR_24a002f8); // Report any remaining objects associated with this VkDevice object in LL ReportUndestroyedObjects(device, VALIDATION_ERROR_24a002f4); + DestroyUndestroyedObjects(device); // Clean up Queue's MemRef Linked Lists DestroyQueueDataStructures(device); @@ -412,6 +449,20 @@ AddQueueInfo(device, queueFamilyIndex, *pQueue); } +VKAPI_ATTR void VKAPI_CALL GetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2 *pQueueInfo, VkQueue *pQueue) { + std::unique_lock lock(global_lock); + ValidateObject(device, device, kVulkanObjectTypeDevice, false, VALIDATION_ERROR_43405601, VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + + get_dispatch_table(ot_device_table_map, device)->GetDeviceQueue2(device, pQueueInfo, pQueue); + + lock.lock(); + if (*pQueue != VK_NULL_HANDLE) { + CreateQueue(device, *pQueue); + AddQueueInfo(device, pQueueInfo->queueFamilyIndex, *pQueue); + } +} + VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet *pDescriptorCopies) { @@ -550,7 +601,7 @@ VkResult result = pInstanceTable->CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pCallback); if (VK_SUCCESS == result) { layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); - result = layer_create_msg_callback(instance_data->report_data, false, pCreateInfo, pAllocator, pCallback); + result = layer_create_report_callback(instance_data->report_data, false, pCreateInfo, pAllocator, pCallback); CreateObject(instance, *pCallback, kVulkanObjectTypeDebugReportCallbackEXT, pAllocator); } return result; @@ -561,7 +612,7 @@ VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(ot_instance_table_map, instance); pInstanceTable->DestroyDebugReportCallbackEXT(instance, msgCallback, pAllocator); layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); - layer_destroy_msg_callback(instance_data->report_data, msgCallback, pAllocator); + layer_destroy_report_callback(instance_data->report_data, msgCallback, pAllocator); DestroyObject(instance, msgCallback, kVulkanObjectTypeDebugReportCallbackEXT, pAllocator, VALIDATION_ERROR_242009b4, VALIDATION_ERROR_242009b6); } @@ -573,7 +624,159 @@ pInstanceTable->DebugReportMessageEXT(instance, flags, objType, object, location, msgCode, pLayerPrefix, pMsg); } -static const VkExtensionProperties instance_extensions[] = {{VK_EXT_DEBUG_REPORT_EXTENSION_NAME, VK_EXT_DEBUG_REPORT_SPEC_VERSION}}; +// VK_EXT_debug_utils commands +VKAPI_ATTR VkResult VKAPI_CALL SetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT *pNameInfo) { + bool skip = VK_FALSE; + std::unique_lock lock(global_lock); + skip |= ValidateObject(device, device, kVulkanObjectTypeDevice, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (skip) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + if (pNameInfo->pObjectName) { + dev_data->report_data->debugUtilsObjectNameMap->insert( + std::make_pair((uint64_t &&) pNameInfo->objectHandle, pNameInfo->pObjectName)); + } else { + dev_data->report_data->debugUtilsObjectNameMap->erase(pNameInfo->objectHandle); + } + VkResult result = dev_data->dispatch_table.SetDebugUtilsObjectNameEXT(device, pNameInfo); + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL SetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT *pTagInfo) { + bool skip = VK_FALSE; + std::unique_lock lock(global_lock); + skip |= ValidateObject(device, device, kVulkanObjectTypeDevice, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (skip) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + VkResult result = dev_data->dispatch_table.SetDebugUtilsObjectTagEXT(device, pTagInfo); + return result; +} + +VKAPI_ATTR void VKAPI_CALL QueueBeginDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT *pLabelInfo) { + bool skip = VK_FALSE; + std::unique_lock lock(global_lock); + skip |= ValidateObject(queue, queue, kVulkanObjectTypeQueue, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); + if (!skip) { + BeginQueueDebugUtilsLabel(dev_data->report_data, queue, pLabelInfo); + if (dev_data->dispatch_table.QueueBeginDebugUtilsLabelEXT) { + dev_data->dispatch_table.QueueBeginDebugUtilsLabelEXT(queue, pLabelInfo); + } + } +} + +VKAPI_ATTR void VKAPI_CALL QueueEndDebugUtilsLabelEXT(VkQueue queue) { + bool skip = VK_FALSE; + std::unique_lock lock(global_lock); + skip |= ValidateObject(queue, queue, kVulkanObjectTypeQueue, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); + if (!skip) { + if (dev_data->dispatch_table.QueueEndDebugUtilsLabelEXT) { + dev_data->dispatch_table.QueueEndDebugUtilsLabelEXT(queue); + } + EndQueueDebugUtilsLabel(dev_data->report_data, queue); + } +} + +VKAPI_ATTR void VKAPI_CALL QueueInsertDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT *pLabelInfo) { + bool skip = VK_FALSE; + std::unique_lock lock(global_lock); + skip |= ValidateObject(queue, queue, kVulkanObjectTypeQueue, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); + if (!skip) { + InsertQueueDebugUtilsLabel(dev_data->report_data, queue, pLabelInfo); + if (dev_data->dispatch_table.QueueInsertDebugUtilsLabelEXT) { + dev_data->dispatch_table.QueueInsertDebugUtilsLabelEXT(queue, pLabelInfo); + } + } +} + +VKAPI_ATTR void VKAPI_CALL CmdBeginDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT *pLabelInfo) { + bool skip = VK_FALSE; + std::unique_lock lock(global_lock); + skip |= ValidateObject(commandBuffer, commandBuffer, kVulkanObjectTypeCommandBuffer, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + if (!skip) { + BeginCmdDebugUtilsLabel(dev_data->report_data, commandBuffer, pLabelInfo); + if (dev_data->dispatch_table.CmdBeginDebugUtilsLabelEXT) { + dev_data->dispatch_table.CmdBeginDebugUtilsLabelEXT(commandBuffer, pLabelInfo); + } + } +} + +VKAPI_ATTR void VKAPI_CALL CmdEndDebugUtilsLabelEXT(VkCommandBuffer commandBuffer) { + bool skip = VK_FALSE; + std::unique_lock lock(global_lock); + skip |= ValidateObject(commandBuffer, commandBuffer, kVulkanObjectTypeCommandBuffer, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + if (!skip) { + if (dev_data->dispatch_table.CmdEndDebugUtilsLabelEXT) { + dev_data->dispatch_table.CmdEndDebugUtilsLabelEXT(commandBuffer); + } + EndCmdDebugUtilsLabel(dev_data->report_data, commandBuffer); + } +} + +VKAPI_ATTR void VKAPI_CALL CmdInsertDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT *pLabelInfo) { + bool skip = VK_FALSE; + std::unique_lock lock(global_lock); + skip |= ValidateObject(commandBuffer, commandBuffer, kVulkanObjectTypeCommandBuffer, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + if (!skip) { + InsertCmdDebugUtilsLabel(dev_data->report_data, commandBuffer, pLabelInfo); + if (dev_data->dispatch_table.CmdInsertDebugUtilsLabelEXT) { + dev_data->dispatch_table.CmdInsertDebugUtilsLabelEXT(commandBuffer, pLabelInfo); + } + } +} + +VKAPI_ATTR VkResult VKAPI_CALL CreateDebugUtilsMessengerEXT(VkInstance instance, + const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDebugUtilsMessengerEXT *pMessenger) { + VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(ot_instance_table_map, instance); + VkResult result = pInstanceTable->CreateDebugUtilsMessengerEXT(instance, pCreateInfo, pAllocator, pMessenger); + if (VK_SUCCESS == result) { + layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); + result = layer_create_messenger_callback(instance_data->report_data, false, pCreateInfo, pAllocator, pMessenger); + CreateObject(instance, *pMessenger, kVulkanObjectTypeDebugUtilsMessengerEXT, pAllocator); + } + return result; +} + +VKAPI_ATTR void VKAPI_CALL DestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, + const VkAllocationCallbacks *pAllocator) { + VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(ot_instance_table_map, instance); + pInstanceTable->DestroyDebugUtilsMessengerEXT(instance, messenger, pAllocator); + layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); + layer_destroy_messenger_callback(instance_data->report_data, messenger, pAllocator); + DestroyObject(instance, messenger, kVulkanObjectTypeDebugUtilsMessengerEXT, pAllocator, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); +} + +VKAPI_ATTR void VKAPI_CALL SubmitDebugUtilsMessageEXT(VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, + VkDebugUtilsMessageTypeFlagsEXT messageTypes, + const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData) { + VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(ot_instance_table_map, instance); + pInstanceTable->SubmitDebugUtilsMessageEXT(instance, messageSeverity, messageTypes, pCallbackData); +} + +static const VkExtensionProperties instance_extensions[] = {{VK_EXT_DEBUG_REPORT_EXTENSION_NAME, VK_EXT_DEBUG_REPORT_SPEC_VERSION}, + {VK_EXT_DEBUG_UTILS_EXTENSION_NAME, VK_EXT_DEBUG_UTILS_SPEC_VERSION}}; static const VkLayerProperties globalLayerProps = {"VK_LAYER_LUNARG_object_tracker", VK_LAYER_API_VERSION, // specVersion @@ -634,15 +837,16 @@ } layer_data *device_data = GetLayerDataPtr(get_dispatch_key(*pDevice), layer_data_map); - device_data->report_data = layer_debug_report_create_device(phy_dev_data->report_data, *pDevice); + device_data->report_data = layer_debug_utils_create_device(phy_dev_data->report_data, *pDevice); layer_init_device_dispatch_table(*pDevice, &device_data->dispatch_table, fpGetDeviceProcAddr); // Add link back to physDev device_data->physical_device = physicalDevice; + device_data->instance = phy_dev_data->instance; initDeviceTable(*pDevice, fpGetDeviceProcAddr, ot_device_table_map); - CreateObject(*pDevice, *pDevice, kVulkanObjectTypeDevice, pAllocator); + CreateObject(phy_dev_data->instance, *pDevice, kVulkanObjectTypeDevice, pAllocator); return result; } @@ -669,6 +873,41 @@ return result; } +VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDescriptorSetLayout *pSetLayout) { + bool skip = false; + { + std::lock_guard lock(global_lock); + skip |= + ValidateObject(device, device, kVulkanObjectTypeDevice, false, VALIDATION_ERROR_1f805601, VALIDATION_ERROR_UNDEFINED); + if (pCreateInfo) { + if (pCreateInfo->pBindings) { + for (uint32_t binding_index = 0; binding_index < pCreateInfo->bindingCount; ++binding_index) { + const VkDescriptorSetLayoutBinding &binding = pCreateInfo->pBindings[binding_index]; + const bool is_sampler_type = binding.descriptorType == VK_DESCRIPTOR_TYPE_SAMPLER || + binding.descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + if (binding.pImmutableSamplers && is_sampler_type) { + for (uint32_t index2 = 0; index2 < binding.descriptorCount; ++index2) { + const VkSampler sampler = binding.pImmutableSamplers[index2]; + skip |= ValidateObject(device, sampler, kVulkanObjectTypeSampler, false, VALIDATION_ERROR_04e00234, + VALIDATION_ERROR_UNDEFINED); + } + } + } + } + } + } + if (skip) return VK_ERROR_VALIDATION_FAILED_EXT; + VkResult result = + get_dispatch_table(ot_device_table_map, device)->CreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout); + if (VK_SUCCESS == result) { + std::lock_guard lock(global_lock); + CreateObject(device, *pSetLayout, kVulkanObjectTypeDescriptorSetLayout, pAllocator); + } + return result; +} + VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties *pQueueFamilyProperties) { @@ -721,11 +960,13 @@ // Look for one or more debug report create info structures, and copy the // callback(s) for each one found (for use by vkDestroyInstance) - layer_copy_tmp_callbacks(pCreateInfo->pNext, &instance_data->num_tmp_callbacks, &instance_data->tmp_dbg_create_infos, - &instance_data->tmp_callbacks); + layer_copy_tmp_debug_messengers(pCreateInfo->pNext, &instance_data->num_tmp_debug_messengers, + &instance_data->tmp_messenger_create_infos, &instance_data->tmp_debug_messengers); + layer_copy_tmp_report_callbacks(pCreateInfo->pNext, &instance_data->num_tmp_report_callbacks, + &instance_data->tmp_report_create_infos, &instance_data->tmp_report_callbacks); - instance_data->report_data = debug_report_create_instance(pInstanceTable, *pInstance, pCreateInfo->enabledExtensionCount, - pCreateInfo->ppEnabledExtensionNames); + instance_data->report_data = debug_utils_create_instance(pInstanceTable, *pInstance, pCreateInfo->enabledExtensionCount, + pCreateInfo->ppEnabledExtensionNames); InitObjectTracker(instance_data, pAllocator); @@ -948,6 +1189,34 @@ get_dispatch_table(ot_device_table_map, device)->DestroyCommandPool(device, commandPool, pAllocator); } +// Note: This is the core version of this routine. The extension version is below. +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice, + uint32_t *pQueueFamilyPropertyCount, + VkQueueFamilyProperties2KHR *pQueueFamilyProperties) { + bool skip = false; + { + std::lock_guard lock(global_lock); + skip |= ValidateObject(physicalDevice, physicalDevice, kVulkanObjectTypePhysicalDevice, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + } + if (skip) { + return; + } + get_dispatch_table(ot_instance_table_map, physicalDevice) + ->GetPhysicalDeviceQueueFamilyProperties2(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties); + std::lock_guard lock(global_lock); + if (pQueueFamilyProperties != NULL) { + layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map); + if (instance_data->queue_family_properties.size() < *pQueueFamilyPropertyCount) { + instance_data->queue_family_properties.resize(*pQueueFamilyPropertyCount); + } + for (uint32_t i = 0; i < *pQueueFamilyPropertyCount; i++) { + instance_data->queue_family_properties[i] = pQueueFamilyProperties[i].queueFamilyProperties; + } + } +} + +// Note: This is the extension version of this routine. The core version is above. VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties2KHR *pQueueFamilyProperties) { diff -Nru vulkan-1.0.65.2+dfsg1/layers/parameter_name.h vulkan-1.1.73+dfsg/layers/parameter_name.h --- vulkan-1.0.65.2+dfsg1/layers/parameter_name.h 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/parameter_name.h 2018-03-14 09:08:48.000000000 +0000 @@ -61,43 +61,43 @@ ParameterName(const char *source) : source_(source) { assert(IsValid()); } /** - * Construct a ParameterName object from a std::string object, without formatting. - * - * @param source Paramater name string without format specifiers. - * - * @pre The source string must not contain the %i format specifier. - */ + * Construct a ParameterName object from a std::string object, without formatting. + * + * @param source Paramater name string without format specifiers. + * + * @pre The source string must not contain the %i format specifier. + */ ParameterName(const std::string &source) : source_(source) { assert(IsValid()); } /** - * Construct a ParameterName object from a std::string object, without formatting. - * - * @param source Paramater name string without format specifiers. - * - * @pre The source string must not contain the %i format specifier. - */ + * Construct a ParameterName object from a std::string object, without formatting. + * + * @param source Paramater name string without format specifiers. + * + * @pre The source string must not contain the %i format specifier. + */ ParameterName(const std::string &&source) : source_(std::move(source)) { assert(IsValid()); } /** - * Construct a ParameterName object from a std::string object, with formatting. - * - * @param source Paramater name string with format specifiers. - * @param args Array index values to be used for formatting. - * - * @pre The number of %i format specifiers contained by the source string must match the number of elements contained - * by the index vector. - */ + * Construct a ParameterName object from a std::string object, with formatting. + * + * @param source Paramater name string with format specifiers. + * @param args Array index values to be used for formatting. + * + * @pre The number of %i format specifiers contained by the source string must match the number of elements contained + * by the index vector. + */ ParameterName(const std::string &source, const IndexVector &args) : source_(source), args_(args) { assert(IsValid()); } /** - * Construct a ParameterName object from a std::string object, with formatting. - * - * @param source Paramater name string with format specifiers. - * @param args Array index values to be used for formatting. - * - * @pre The number of %i format specifiers contained by the source string must match the number of elements contained - * by the index vector. - */ + * Construct a ParameterName object from a std::string object, with formatting. + * + * @param source Paramater name string with format specifiers. + * @param args Array index values to be used for formatting. + * + * @pre The number of %i format specifiers contained by the source string must match the number of elements contained + * by the index vector. + */ ParameterName(const std::string &&source, const IndexVector &&args) : source_(std::move(source)), args_(std::move(args)) { assert(IsValid()); } diff -Nru vulkan-1.0.65.2+dfsg1/layers/parameter_validation.h vulkan-1.1.73+dfsg/layers/parameter_validation.h --- vulkan-1.0.65.2+dfsg1/layers/parameter_validation.h 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/parameter_validation.h 2018-04-27 11:24:19.000000000 +0000 @@ -24,8 +24,10 @@ #include #include #include +#include #include #include +#include #include #include "vulkan/vulkan.h" @@ -34,18 +36,18 @@ #include "vk_validation_error_messages.h" #include "vk_extension_helper.h" - #include "parameter_name.h" namespace parameter_validation { extern const uint32_t GeneratedHeaderVersion; -extern const std::unordered_map name_to_funcptr_map; +extern const std::unordered_map name_to_funcptr_map; extern const VkQueryPipelineStatisticFlags AllVkQueryPipelineStatisticFlagBits; extern const VkColorComponentFlags AllVkColorComponentFlagBits; extern const VkShaderStageFlags AllVkShaderStageFlagBits; extern const VkQueryControlFlags AllVkQueryControlFlagBits; +extern const VkImageUsageFlags AllVkImageUsageFlagBits; extern const std::vector AllVkCompareOpEnums; extern const std::vector AllVkStencilOpEnums; @@ -60,14 +62,20 @@ debug_report_data *report_data = nullptr; std::vector logging_callback; + std::vector logging_messenger; // The following are for keeping track of the temporary callbacks that can // be used in vkCreateInstance and vkDestroyInstance: - uint32_t num_tmp_callbacks = 0; - VkDebugReportCallbackCreateInfoEXT *tmp_dbg_create_infos = nullptr; - VkDebugReportCallbackEXT *tmp_callbacks = nullptr; + uint32_t num_tmp_report_callbacks = 0; + VkDebugReportCallbackCreateInfoEXT *tmp_report_create_infos = nullptr; + VkDebugReportCallbackEXT *tmp_report_callbacks = nullptr; + uint32_t num_tmp_debug_messengers = 0; + VkDebugUtilsMessengerCreateInfoEXT *tmp_messenger_create_infos = nullptr; + VkDebugUtilsMessengerEXT *tmp_debug_messengers = nullptr; + InstanceExtensions extensions = {}; VkLayerInstanceDispatchTable dispatch_table = {}; + uint32_t api_version; }; struct layer_data { @@ -79,6 +87,14 @@ VkPhysicalDevice physical_device = VK_NULL_HANDLE; VkDevice device = VK_NULL_HANDLE; DeviceExtensions extensions; + uint32_t api_version; + + struct SubpassesUsageStates { + std::unordered_set subpasses_using_color_attachment; + std::unordered_set subpasses_using_depthstencil_attachment; + }; + + std::unordered_map renderpasses_states; VkLayerDispatchTable dispatch_table = {}; }; @@ -117,9 +133,6 @@ const void *pNext; }; -// Layer name string to be logged with validation messages. -const char LayerName[] = "ParameterValidation"; - // String returned by string_VkStructureType for an unrecognized type. const std::string UnsupportedStructureTypeString = "Unhandled VkStructureType"; @@ -134,33 +147,47 @@ // The value of all VK_xxx_MAX_ENUM tokens const uint32_t MaxEnumValue = 0x7FFFFFFF; +// Misc parameters of log_msg that are likely constant per command (or low frequency change) +struct LogMiscParams { + const debug_report_data *debug_data; + VkDebugReportObjectTypeEXT objectType; + uint64_t srcObject; + const char *api_name; +}; /** -* Validate a minimum value. -* -* Verify that the specified value is greater than the specified lower bound. -* -* @param report_data debug_report_data object for routing validation messages. -* @param api_name Name of API call being validated. -* @param parameter_name Name of parameter being validated. -* @param value Value to validate. -* @param lower_bound Lower bound value to use for validation. -* @return Boolean value indicating that the call should be skipped. -*/ + * Validate a minimum value. + * + * Verify that the specified value is greater than the specified lower bound. + * + * @param report_data debug_report_data object for routing validation messages. + * @param api_name Name of API call being validated. + * @param parameter_name Name of parameter being validated. + * @param value Value to validate. + * @param lower_bound Lower bound value to use for validation. + * @return Boolean value indicating that the call should be skipped. + */ template -bool ValidateGreaterThan(debug_report_data *report_data, const char *api_name, const ParameterName ¶meter_name, T value, - T lower_bound) { +bool ValidateGreaterThan(const T value, const T lower_bound, const ParameterName ¶meter_name, + const UNIQUE_VALIDATION_ERROR_CODE vuid, const LogMiscParams &misc) { bool skip_call = false; if (value <= lower_bound) { + std::ostringstream ss; + ss << misc.api_name << ": parameter " << parameter_name.get_name() << " (= " << value << ") is greater than " + << lower_bound; skip_call |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, LayerName, - "%s: parameter %s must be greater than %d", api_name, parameter_name.get_name().c_str(), lower_bound); + log_msg(misc.debug_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, misc.objectType, misc.srcObject, vuid, "%s", ss.str().c_str()); } return skip_call; } +template +bool ValidateGreaterThanZero(const T value, const ParameterName ¶meter_name, const UNIQUE_VALIDATION_ERROR_CODE vuid, + const LogMiscParams &misc) { + return ValidateGreaterThan(value, T{0}, parameter_name, vuid, misc); +} /** * Validate a required pointer. * @@ -177,9 +204,8 @@ bool skip_call = false; if (value == NULL) { - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - vuid, LayerName, "%s: required parameter %s specified as NULL. %s", apiName, - parameterName.get_name().c_str(), validation_error_map[vuid]); + skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid, + "%s: required parameter %s specified as NULL.", apiName, parameterName.get_name().c_str()); } return skip_call; @@ -202,64 +228,64 @@ * @param arrayRequired The 'array' parameter may not be NULL when true. * @return Boolean value indicating that the call should be skipped. */ -template +template bool validate_array(debug_report_data *report_data, const char *apiName, const ParameterName &countName, - const ParameterName &arrayName, T count, const void *array, bool countRequired, bool arrayRequired, + const ParameterName &arrayName, T1 count, const T2 *array, bool countRequired, bool arrayRequired, UNIQUE_VALIDATION_ERROR_CODE count_required_vuid, UNIQUE_VALIDATION_ERROR_CODE array_required_vuid) { bool skip_call = false; // Count parameters not tagged as optional cannot be 0 if (countRequired && (count == 0)) { - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - count_required_vuid, LayerName, "%s: parameter %s must be greater than 0. %s", apiName, - countName.get_name().c_str(), validation_error_map[count_required_vuid]); + skip_call |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, count_required_vuid, + "%s: parameter %s must be greater than 0.", apiName, countName.get_name().c_str()); } // Array parameters not tagged as optional cannot be NULL, unless the count is 0 - if ((array == NULL) && arrayRequired && (count != 0)) { - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - array_required_vuid, LayerName, "%s: required parameter %s specified as NULL. %s", apiName, - arrayName.get_name().c_str(), validation_error_map[array_required_vuid]); + if (arrayRequired && (count != 0) && (*array == NULL)) { + skip_call |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, array_required_vuid, + "%s: required parameter %s specified as NULL.", apiName, arrayName.get_name().c_str()); } return skip_call; } /** -* Validate pointer to array count and pointer to array. -* -* Verify that required count and array parameters are not NULL. If count -* is not NULL and its value is not optional, verify that it is not 0. If the -* array parameter is NULL, and it is not optional, verify that count is 0. -* The array parameter will typically be optional for this case (where count is -* a pointer), allowing the caller to retrieve the available count. -* -* @param report_data debug_report_data object for routing validation messages. -* @param apiName Name of API call being validated. -* @param countName Name of count parameter. -* @param arrayName Name of array parameter. -* @param count Pointer to the number of elements in the array. -* @param array Array to validate. -* @param countPtrRequired The 'count' parameter may not be NULL when true. -* @param countValueRequired The '*count' value may not be 0 when true. -* @param arrayRequired The 'array' parameter may not be NULL when true. -* @return Boolean value indicating that the call should be skipped. -*/ -template + * Validate pointer to array count and pointer to array. + * + * Verify that required count and array parameters are not NULL. If count + * is not NULL and its value is not optional, verify that it is not 0. If the + * array parameter is NULL, and it is not optional, verify that count is 0. + * The array parameter will typically be optional for this case (where count is + * a pointer), allowing the caller to retrieve the available count. + * + * @param report_data debug_report_data object for routing validation messages. + * @param apiName Name of API call being validated. + * @param countName Name of count parameter. + * @param arrayName Name of array parameter. + * @param count Pointer to the number of elements in the array. + * @param array Array to validate. + * @param countPtrRequired The 'count' parameter may not be NULL when true. + * @param countValueRequired The '*count' value may not be 0 when true. + * @param arrayRequired The 'array' parameter may not be NULL when true. + * @return Boolean value indicating that the call should be skipped. + */ +template bool validate_array(debug_report_data *report_data, const char *apiName, const ParameterName &countName, - const ParameterName &arrayName, const T *count, const void *array, bool countPtrRequired, + const ParameterName &arrayName, const T1 *count, const T2 *array, bool countPtrRequired, bool countValueRequired, bool arrayRequired, UNIQUE_VALIDATION_ERROR_CODE count_required_vuid, UNIQUE_VALIDATION_ERROR_CODE array_required_vuid) { bool skip_call = false; if (count == NULL) { if (countPtrRequired) { - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - REQUIRED_PARAMETER, LayerName, "%s: required parameter %s specified as NULL", apiName, - countName.get_name().c_str()); + skip_call |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, REQUIRED_PARAMETER, + "%s: required parameter %s specified as NULL", apiName, countName.get_name().c_str()); } } else { - skip_call |= validate_array(report_data, apiName, countName, arrayName, array ? (*count) : 0, array, countValueRequired, + skip_call |= validate_array(report_data, apiName, countName, arrayName, *array ? (*count) : 0, &array, countValueRequired, arrayRequired, count_required_vuid, array_required_vuid); } @@ -290,14 +316,13 @@ if (value == NULL) { if (required) { - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - REQUIRED_PARAMETER, LayerName, "%s: required parameter %s specified as NULL", apiName, - parameterName.get_name().c_str()); + skip_call |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, REQUIRED_PARAMETER, + "%s: required parameter %s specified as NULL", apiName, parameterName.get_name().c_str()); } } else if (value->sType != sType) { - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, vuid, - LayerName, "%s: parameter %s->sType must be %s. %s", apiName, parameterName.get_name().c_str(), - sTypeName, validation_error_map[vuid]); + skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid, + "%s: parameter %s->sType must be %s.", apiName, parameterName.get_name().c_str(), sTypeName); } return skip_call; @@ -329,14 +354,14 @@ bool skip_call = false; if ((count == 0) || (array == NULL)) { - skip_call |= validate_array(report_data, apiName, countName, arrayName, count, array, countRequired, arrayRequired, + skip_call |= validate_array(report_data, apiName, countName, arrayName, count, &array, countRequired, arrayRequired, VALIDATION_ERROR_UNDEFINED, vuid); } else { // Verify that all structs in the array have the correct type for (uint32_t i = 0; i < count; ++i) { if (array[i].sType != sType) { skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, INVALID_STRUCT_STYPE, LayerName, "%s: parameter %s[%d].sType must be %s", apiName, + INVALID_STRUCT_STYPE, "%s: parameter %s[%d].sType must be %s", apiName, arrayName.get_name().c_str(), i, sTypeName); } } @@ -375,9 +400,9 @@ if (count == NULL) { if (countPtrRequired) { - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - REQUIRED_PARAMETER, LayerName, "%s: required parameter %s specified as NULL", apiName, - countName.get_name().c_str()); + skip_call |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, REQUIRED_PARAMETER, + "%s: required parameter %s specified as NULL", apiName, countName.get_name().c_str()); } } else { skip_call |= validate_struct_type_array(report_data, apiName, countName, arrayName, sTypeName, (*count), array, sType, @@ -388,51 +413,51 @@ } /** -* Validate a Vulkan handle. -* -* Verify that the specified handle is not VK_NULL_HANDLE. -* -* @param report_data debug_report_data object for routing validation messages. -* @param api_name Name of API call being validated. -* @param parameter_name Name of struct parameter being validated. -* @param value Handle to validate. -* @return Boolean value indicating that the call should be skipped. -*/ + * Validate a Vulkan handle. + * + * Verify that the specified handle is not VK_NULL_HANDLE. + * + * @param report_data debug_report_data object for routing validation messages. + * @param api_name Name of API call being validated. + * @param parameter_name Name of struct parameter being validated. + * @param value Handle to validate. + * @return Boolean value indicating that the call should be skipped. + */ template bool validate_required_handle(debug_report_data *report_data, const char *api_name, const ParameterName ¶meter_name, T value) { bool skip_call = false; if (value == VK_NULL_HANDLE) { - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - REQUIRED_PARAMETER, LayerName, "%s: required parameter %s specified as VK_NULL_HANDLE", api_name, - parameter_name.get_name().c_str()); + skip_call |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, REQUIRED_PARAMETER, + "%s: required parameter %s specified as VK_NULL_HANDLE", api_name, parameter_name.get_name().c_str()); } return skip_call; } /** -* Validate an array of Vulkan handles. -* -* Verify that required count and array parameters are not NULL. If count -* is not NULL and its value is not optional, verify that it is not 0. -* If the array contains 1 or more handles, verify that no handle is set to -* VK_NULL_HANDLE. -* -* @note This function is only intended to validate arrays of handles when none -* of the handles are allowed to be VK_NULL_HANDLE. For arrays of handles -* that are allowed to contain VK_NULL_HANDLE, use validate_array() instead. -* -* @param report_data debug_report_data object for routing validation messages. -* @param api_name Name of API call being validated. -* @param count_name Name of count parameter. -* @param array_name Name of array parameter. -* @param count Number of elements in the array. -* @param array Array to validate. -* @param count_required The 'count' parameter may not be 0 when true. -* @param array_required The 'array' parameter may not be NULL when true. -* @return Boolean value indicating that the call should be skipped. -*/ + * Validate an array of Vulkan handles. + * + * Verify that required count and array parameters are not NULL. If count + * is not NULL and its value is not optional, verify that it is not 0. + * If the array contains 1 or more handles, verify that no handle is set to + * VK_NULL_HANDLE. + * + * @note This function is only intended to validate arrays of handles when none + * of the handles are allowed to be VK_NULL_HANDLE. For arrays of handles + * that are allowed to contain VK_NULL_HANDLE, use validate_array() instead. + * + * @param report_data debug_report_data object for routing validation messages. + * @param api_name Name of API call being validated. + * @param count_name Name of count parameter. + * @param array_name Name of array parameter. + * @param count Number of elements in the array. + * @param array Array to validate. + * @param count_required The 'count' parameter may not be 0 when true. + * @param array_required The 'array' parameter may not be NULL when true. + * @return Boolean value indicating that the call should be skipped. + */ template bool validate_handle_array(debug_report_data *report_data, const char *api_name, const ParameterName &count_name, const ParameterName &array_name, uint32_t count, const T *array, bool count_required, @@ -440,16 +465,15 @@ bool skip_call = false; if ((count == 0) || (array == NULL)) { - skip_call |= validate_array(report_data, api_name, count_name, array_name, count, array, count_required, array_required, + skip_call |= validate_array(report_data, api_name, count_name, array_name, count, &array, count_required, array_required, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); } else { // Verify that no handles in the array are VK_NULL_HANDLE for (uint32_t i = 0; i < count; ++i) { if (array[i] == VK_NULL_HANDLE) { - skip_call |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - REQUIRED_PARAMETER, LayerName, "%s: required parameter %s[%d] specified as VK_NULL_HANDLE", api_name, - array_name.get_name().c_str(), i); + skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + REQUIRED_PARAMETER, "%s: required parameter %s[%d] specified as VK_NULL_HANDLE", api_name, + array_name.get_name().c_str(), i); } } } @@ -482,15 +506,15 @@ bool skip_call = false; if ((count == 0) || (array == NULL)) { - skip_call |= validate_array(report_data, apiName, countName, arrayName, count, array, countRequired, arrayRequired, + skip_call |= validate_array(report_data, apiName, countName, arrayName, count, &array, countRequired, arrayRequired, count_required_vuid, array_required_vuid); } else { // Verify that strings in the array are not NULL for (uint32_t i = 0; i < count; ++i) { if (array[i] == NULL) { skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, REQUIRED_PARAMETER, LayerName, "%s: required parameter %s[%d] specified as NULL", - apiName, arrayName.get_name().c_str(), i); + REQUIRED_PARAMETER, "%s: required parameter %s[%d] specified as NULL", apiName, + arrayName.get_name().c_str(), i); } } } @@ -511,7 +535,7 @@ * @param allowed_struct_names Names of allowed structs. * @param next Pointer to validate. * @param allowed_type_count Total number of allowed structure types. - * @param allowed_types Array of strcuture types allowed for pNext. + * @param allowed_types Array of structure types allowed for pNext. * @param header_version Version of header defining the pNext validation rules. * @return Boolean value indicating that the call should be skipped. */ @@ -524,20 +548,19 @@ std::unordered_set> unique_stype_check; const char disclaimer[] = - "This warning is based on the Valid Usage documentation for version %d of the Vulkan header. It " - "is possible that you are using a struct from a private extension or an extension that was added " - "to a later version of the Vulkan header, in which case your use of %s is perfectly valid but " - "is not guaranteed to work correctly with validation enabled"; + "This warning is based on the Valid Usage documentation for version %d of the Vulkan header. It is possible that you are " + "using a struct from a private extension or an extension that was added to a later version of the Vulkan header, in which " + "case your use of %s is perfectly valid but is not guaranteed to work correctly with validation enabled"; // TODO: The valid pNext structure types are not recursive. Each structure has its own list of valid sTypes for pNext. // Codegen a map of vectors containing the allowable pNext types for each struct and use that here -- also simplifies parms. if (next != NULL) { if (allowed_type_count == 0) { - std::string message = "%s: value of %s must be NULL. %s "; + std::string message = "%s: value of %s must be NULL. "; message += disclaimer; - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - vuid, LayerName, message.c_str(), api_name, parameter_name.get_name().c_str(), - validation_error_map[vuid], header_version, parameter_name.get_name().c_str()); + skip_call |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid, + message.c_str(), api_name, parameter_name.get_name().c_str(), header_version, + parameter_name.get_name().c_str()); } else { const VkStructureType *start = allowed_types; const VkStructureType *end = allowed_types + allowed_type_count; @@ -549,8 +572,8 @@ if (cycle_check.find(current->pNext) != cycle_check.end()) { std::string message = "%s: %s chain contains a cycle -- pNext pointer " PRIx64 " is repeated."; skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, INVALID_STRUCT_PNEXT, LayerName, message.c_str(), api_name, - parameter_name.get_name().c_str(), reinterpret_cast(next)); + INVALID_STRUCT_PNEXT, message.c_str(), api_name, parameter_name.get_name().c_str(), + reinterpret_cast(next)); break; } else { cycle_check.insert(current->pNext); @@ -560,8 +583,8 @@ if (unique_stype_check.find(current->sType) != unique_stype_check.end()) { std::string message = "%s: %s chain contains duplicate structure types: %s appears multiple times."; skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, INVALID_STRUCT_PNEXT, LayerName, message.c_str(), api_name, - parameter_name.get_name().c_str(), type_name.c_str()); + INVALID_STRUCT_PNEXT, message.c_str(), api_name, parameter_name.get_name().c_str(), + type_name.c_str()); } else { unique_stype_check.insert(current->sType); } @@ -569,21 +592,19 @@ if (std::find(start, end, current->sType) == end) { if (type_name == UnsupportedStructureTypeString) { std::string message = - "%s: %s chain includes a structure with unknown VkStructureType (%d); Allowed structures are [%s]. %s "; + "%s: %s chain includes a structure with unknown VkStructureType (%d); Allowed structures are [%s]. "; message += disclaimer; skip_call |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, - 0, __LINE__, vuid, LayerName, message.c_str(), api_name, - parameter_name.get_name().c_str(), current->sType, allowed_struct_names, - validation_error_map[vuid], header_version, parameter_name.get_name().c_str()); + 0, vuid, message.c_str(), api_name, parameter_name.get_name().c_str(), current->sType, + allowed_struct_names, header_version, parameter_name.get_name().c_str()); } else { std::string message = - "%s: %s chain includes a structure with unexpected VkStructureType %s; Allowed structures are [%s]. " - "%s "; + "%s: %s chain includes a structure with unexpected VkStructureType %s; Allowed structures are [%s]. "; message += disclaimer; - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, - 0, __LINE__, vuid, LayerName, message.c_str(), api_name, - parameter_name.get_name().c_str(), type_name.c_str(), allowed_struct_names, - validation_error_map[vuid], header_version, parameter_name.get_name().c_str()); + skip_call |= + log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid, + message.c_str(), api_name, parameter_name.get_name().c_str(), type_name.c_str(), + allowed_struct_names, header_version, parameter_name.get_name().c_str()); } } current = reinterpret_cast(current->pNext); @@ -595,85 +616,84 @@ } /** -* Validate a VkBool32 value. -* -* Generate a warning if a VkBool32 value is neither VK_TRUE nor VK_FALSE. -* -* @param report_data debug_report_data object for routing validation messages. -* @param apiName Name of API call being validated. -* @param parameterName Name of parameter being validated. -* @param value Boolean value to validate. -* @return Boolean value indicating that the call should be skipped. -*/ + * Validate a VkBool32 value. + * + * Generate a warning if a VkBool32 value is neither VK_TRUE nor VK_FALSE. + * + * @param report_data debug_report_data object for routing validation messages. + * @param apiName Name of API call being validated. + * @param parameterName Name of parameter being validated. + * @param value Boolean value to validate. + * @return Boolean value indicating that the call should be skipped. + */ static bool validate_bool32(debug_report_data *report_data, const char *apiName, const ParameterName ¶meterName, VkBool32 value) { bool skip_call = false; if ((value != VK_TRUE) && (value != VK_FALSE)) { - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - UNRECOGNIZED_VALUE, LayerName, "%s: value of %s (%d) is neither VK_TRUE nor VK_FALSE", apiName, - parameterName.get_name().c_str(), value); + skip_call |= + log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, UNRECOGNIZED_VALUE, + "%s: value of %s (%d) is neither VK_TRUE nor VK_FALSE", apiName, parameterName.get_name().c_str(), value); } return skip_call; } /** -* Validate a Vulkan enumeration value. -* -* Generate a warning if an enumeration token value does not fall within the core enumeration -* begin and end token values, and was not added to the enumeration by an extension. Extension -* provided enumerations use the equation specified in Appendix C.10 of the Vulkan specification, -* with 1,000,000,000 as the base token value. -* -* @note This function does not expect to process enumerations defining bitmask flag bits. -* -* @param report_data debug_report_data object for routing validation messages. -* @param apiName Name of API call being validated. -* @param parameterName Name of parameter being validated. -* @param enumName Name of the enumeration being validated. -* @param valid_values The list of valid values for the enumeration. -* @param value Enumeration value to validate. -* @return Boolean value indicating that the call should be skipped. -*/ + * Validate a Vulkan enumeration value. + * + * Generate a warning if an enumeration token value does not fall within the core enumeration + * begin and end token values, and was not added to the enumeration by an extension. Extension + * provided enumerations use the equation specified in Appendix C.10 of the Vulkan specification, + * with 1,000,000,000 as the base token value. + * + * @note This function does not expect to process enumerations defining bitmask flag bits. + * + * @param report_data debug_report_data object for routing validation messages. + * @param apiName Name of API call being validated. + * @param parameterName Name of parameter being validated. + * @param enumName Name of the enumeration being validated. + * @param valid_values The list of valid values for the enumeration. + * @param value Enumeration value to validate. + * @return Boolean value indicating that the call should be skipped. + */ template bool validate_ranged_enum(debug_report_data *report_data, const char *apiName, const ParameterName ¶meterName, const char *enumName, const std::vector &valid_values, T value, UNIQUE_VALIDATION_ERROR_CODE vuid) { bool skip = false; if (std::find(valid_values.begin(), valid_values.end(), value) == valid_values.end()) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, vuid, - LayerName, - "%s: value of %s (%d) does not fall within the begin..end range of the core %s " - "enumeration tokens and is not an extension added token. %s", - apiName, parameterName.get_name().c_str(), value, enumName, validation_error_map[vuid]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid, + "%s: value of %s (%d) does not fall within the begin..end range of the core %s enumeration tokens and is " + "not an extension added token.", + apiName, parameterName.get_name().c_str(), value, enumName); } return skip; } /** -* Validate an array of Vulkan enumeration value. -* -* Process all enumeration token values in the specified array and generate a warning if a value -* does not fall within the core enumeration begin and end token values, and was not added to -* the enumeration by an extension. Extension provided enumerations use the equation specified -* in Appendix C.10 of the Vulkan specification, with 1,000,000,000 as the base token value. -* -* @note This function does not expect to process enumerations defining bitmask flag bits. -* -* @param report_data debug_report_data object for routing validation messages. -* @param apiName Name of API call being validated. -* @param countName Name of count parameter. -* @param arrayName Name of array parameter. -* @param enumName Name of the enumeration being validated. -* @param valid_values The list of valid values for the enumeration. -* @param count Number of enumeration values in the array. -* @param array Array of enumeration values to validate. -* @param countRequired The 'count' parameter may not be 0 when true. -* @param arrayRequired The 'array' parameter may not be NULL when true. -* @return Boolean value indicating that the call should be skipped. -*/ + * Validate an array of Vulkan enumeration value. + * + * Process all enumeration token values in the specified array and generate a warning if a value + * does not fall within the core enumeration begin and end token values, and was not added to + * the enumeration by an extension. Extension provided enumerations use the equation specified + * in Appendix C.10 of the Vulkan specification, with 1,000,000,000 as the base token value. + * + * @note This function does not expect to process enumerations defining bitmask flag bits. + * + * @param report_data debug_report_data object for routing validation messages. + * @param apiName Name of API call being validated. + * @param countName Name of count parameter. + * @param arrayName Name of array parameter. + * @param enumName Name of the enumeration being validated. + * @param valid_values The list of valid values for the enumeration. + * @param count Number of enumeration values in the array. + * @param array Array of enumeration values to validate. + * @param countRequired The 'count' parameter may not be 0 when true. + * @param arrayRequired The 'array' parameter may not be NULL when true. + * @return Boolean value indicating that the call should be skipped. + */ template static bool validate_ranged_enum_array(debug_report_data *report_data, const char *apiName, const ParameterName &countName, const ParameterName &arrayName, const char *enumName, const std::vector &valid_values, @@ -681,13 +701,13 @@ bool skip_call = false; if ((count == 0) || (array == NULL)) { - skip_call |= validate_array(report_data, apiName, countName, arrayName, count, array, countRequired, arrayRequired, + skip_call |= validate_array(report_data, apiName, countName, arrayName, count, &array, countRequired, arrayRequired, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); } else { for (uint32_t i = 0; i < count; ++i) { if (std::find(valid_values.begin(), valid_values.end(), array[i]) == valid_values.end()) { skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, UNRECOGNIZED_VALUE, LayerName, + UNRECOGNIZED_VALUE, "%s: value of %s[%d] (%d) does not fall within the begin..end range of the core %s " "enumeration tokens and is not an extension added token", apiName, arrayName.get_name().c_str(), i, array[i], enumName); @@ -699,47 +719,45 @@ } /** -* Verify that a reserved VkFlags value is zero. -* -* Verify that the specified value is zero, to check VkFlags values that are reserved for -* future use. -* -* @param report_data debug_report_data object for routing validation messages. -* @param api_name Name of API call being validated. -* @param parameter_name Name of parameter being validated. -* @param value Value to validate. -* @return Boolean value indicating that the call should be skipped. -*/ + * Verify that a reserved VkFlags value is zero. + * + * Verify that the specified value is zero, to check VkFlags values that are reserved for + * future use. + * + * @param report_data debug_report_data object for routing validation messages. + * @param api_name Name of API call being validated. + * @param parameter_name Name of parameter being validated. + * @param value Value to validate. + * @return Boolean value indicating that the call should be skipped. + */ static bool validate_reserved_flags(debug_report_data *report_data, const char *api_name, const ParameterName ¶meter_name, VkFlags value, UNIQUE_VALIDATION_ERROR_CODE vuid) { bool skip_call = false; if (value != 0) { - skip_call |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - vuid, LayerName, "%s: parameter %s must be 0. %s", api_name, parameter_name.get_name().c_str(), - validation_error_map[vuid]); + skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid, + "%s: parameter %s must be 0.", api_name, parameter_name.get_name().c_str()); } return skip_call; } /** -* Validate a Vulkan bitmask value. -* -* Generate a warning if a value with a VkFlags derived type does not contain valid flag bits -* for that type. -* -* @param report_data debug_report_data object for routing validation messages. -* @param api_name Name of API call being validated. -* @param parameter_name Name of parameter being validated. -* @param flag_bits_name Name of the VkFlags type being validated. -* @param all_flags A bit mask combining all valid flag bits for the VkFlags type being validated. -* @param value VkFlags value to validate. -* @param flags_required The 'value' parameter may not be 0 when true. -* @param singleFlag The 'value' parameter may not contain more than one bit from all_flags. -* @return Boolean value indicating that the call should be skipped. -*/ + * Validate a Vulkan bitmask value. + * + * Generate a warning if a value with a VkFlags derived type does not contain valid flag bits + * for that type. + * + * @param report_data debug_report_data object for routing validation messages. + * @param api_name Name of API call being validated. + * @param parameter_name Name of parameter being validated. + * @param flag_bits_name Name of the VkFlags type being validated. + * @param all_flags A bit mask combining all valid flag bits for the VkFlags type being validated. + * @param value VkFlags value to validate. + * @param flags_required The 'value' parameter may not be 0 when true. + * @param singleFlag The 'value' parameter may not contain more than one bit from all_flags. + * @return Boolean value indicating that the call should be skipped. + */ static bool validate_flags(debug_report_data *report_data, const char *api_name, const ParameterName ¶meter_name, const char *flag_bits_name, VkFlags all_flags, VkFlags value, bool flags_required, bool singleFlag, UNIQUE_VALIDATION_ERROR_CODE vuid) { @@ -747,50 +765,48 @@ if (value == 0) { if (flags_required) { - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - vuid, LayerName, "%s: value of %s must not be 0. %s", api_name, - parameter_name.get_name().c_str(), validation_error_map[vuid]); + skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, vuid, + "%s: value of %s must not be 0.", api_name, parameter_name.get_name().c_str()); } } else if ((value & (~all_flags)) != 0) { - skip_call |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - UNRECOGNIZED_VALUE, LayerName, "%s: value of %s contains flag bits that are not recognized members of %s", - api_name, parameter_name.get_name().c_str(), flag_bits_name); + skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + UNRECOGNIZED_VALUE, "%s: value of %s contains flag bits that are not recognized members of %s", + api_name, parameter_name.get_name().c_str(), flag_bits_name); } else if (singleFlag && (std::bitset(value).count() > 1)) { - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - UNRECOGNIZED_VALUE, LayerName, - "%s: value of %s contains multiple members of %s when only a single value is allowed", api_name, - parameter_name.get_name().c_str(), flag_bits_name); + skip_call |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, UNRECOGNIZED_VALUE, + "%s: value of %s contains multiple members of %s when only a single value is allowed", api_name, + parameter_name.get_name().c_str(), flag_bits_name); } return skip_call; } /** -* Validate an array of Vulkan bitmask values. -* -* Generate a warning if a value with a VkFlags derived type does not contain valid flag bits -* for that type. -* -* @param report_data debug_report_data object for routing validation messages. -* @param api_name Name of API call being validated. -* @param count_name Name of parameter being validated. -* @param array_name Name of parameter being validated. -* @param flag_bits_name Name of the VkFlags type being validated. -* @param all_flags A bitmask combining all valid flag bits for the VkFlags type being validated. -* @param count Number of VkFlags values in the array. -* @param array Array of VkFlags value to validate. -* @param count_required The 'count' parameter may not be 0 when true. -* @param array_required The 'array' parameter may not be NULL when true. -* @return Boolean value indicating that the call should be skipped. -*/ + * Validate an array of Vulkan bitmask values. + * + * Generate a warning if a value with a VkFlags derived type does not contain valid flag bits + * for that type. + * + * @param report_data debug_report_data object for routing validation messages. + * @param api_name Name of API call being validated. + * @param count_name Name of parameter being validated. + * @param array_name Name of parameter being validated. + * @param flag_bits_name Name of the VkFlags type being validated. + * @param all_flags A bitmask combining all valid flag bits for the VkFlags type being validated. + * @param count Number of VkFlags values in the array. + * @param array Array of VkFlags value to validate. + * @param count_required The 'count' parameter may not be 0 when true. + * @param array_required The 'array' parameter may not be NULL when true. + * @return Boolean value indicating that the call should be skipped. + */ static bool validate_flags_array(debug_report_data *report_data, const char *api_name, const ParameterName &count_name, const ParameterName &array_name, const char *flag_bits_name, VkFlags all_flags, uint32_t count, const VkFlags *array, bool count_required, bool array_required) { bool skip_call = false; if ((count == 0) || (array == NULL)) { - skip_call |= validate_array(report_data, api_name, count_name, array_name, count, array, count_required, array_required, + skip_call |= validate_array(report_data, api_name, count_name, array_name, count, &array, count_required, array_required, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); } else { // Verify that all VkFlags values in the array @@ -800,14 +816,14 @@ // elements in the array are allowed be 0 if (array_required) { skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, REQUIRED_PARAMETER, LayerName, "%s: value of %s[%d] must not be 0", api_name, + REQUIRED_PARAMETER, "%s: value of %s[%d] must not be 0", api_name, array_name.get_name().c_str(), i); } } else if ((array[i] & (~all_flags)) != 0) { - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, UNRECOGNIZED_VALUE, LayerName, - "%s: value of %s[%d] contains flag bits that are not recognized members of %s", api_name, - array_name.get_name().c_str(), i, flag_bits_name); + skip_call |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + UNRECOGNIZED_VALUE, "%s: value of %s[%d] contains flag bits that are not recognized members of %s", + api_name, array_name.get_name().c_str(), i, flag_bits_name); } } } @@ -816,14 +832,14 @@ } /** -* Get VkResult code description. -* -* Returns a string describing the specified VkResult code. The description is based on the language in the Vulkan API -* specification. -* -* @param value VkResult code to process. -* @return String describing the specified VkResult code. -*/ + * Get VkResult code description. + * + * Returns a string describing the specified VkResult code. The description is based on the language in the Vulkan API + * specification. + * + * @param value VkResult code to process. + * @return String describing the specified VkResult code. + */ static std::string get_result_description(VkResult result) { // clang-format off switch (result) { @@ -863,15 +879,15 @@ } /** -* Validate return code. -* -* Print a message describing the reason for failure when an error code is returned. -* -* @param report_data debug_report_data object for routing validation messages. -* @param apiName Name of API call being validated. -* @param ignore vector of VkResult return codes to be ignored -* @param value VkResult value to validate. -*/ + * Validate return code. + * + * Print a message describing the reason for failure when an error code is returned. + * + * @param report_data debug_report_data object for routing validation messages. + * @param apiName Name of API call being validated. + * @param ignore vector of VkResult return codes to be ignored + * @param value VkResult value to validate. + */ static void validate_result(debug_report_data *report_data, const char *apiName, std::vector const &ignore, VkResult result) { if (result < 0 && result != VK_ERROR_VALIDATION_FAILED_EXT) { @@ -881,13 +897,12 @@ std::string resultName = string_VkResult(result); if (resultName == UnsupportedResultString) { // Unrecognized result code - log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - FAILURE_RETURN_CODE, LayerName, "%s: returned a result code indicating that an error has occurred", apiName); + log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, FAILURE_RETURN_CODE, + "%s: returned a result code indicating that an error has occurred", apiName); } else { std::string resultDesc = get_result_description(result); - log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - FAILURE_RETURN_CODE, LayerName, "%s: returned %s, indicating that %s", apiName, resultName.c_str(), - resultDesc.c_str()); + log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, FAILURE_RETURN_CODE, + "%s: returned %s, indicating that %s", apiName, resultName.c_str(), resultDesc.c_str()); } } } diff -Nru vulkan-1.0.65.2+dfsg1/layers/parameter_validation_layer.md vulkan-1.1.73+dfsg/layers/parameter_validation_layer.md --- vulkan-1.0.65.2+dfsg1/layers/parameter_validation_layer.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/parameter_validation_layer.md 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,8 @@ +# VK\_LAYER\_LUNARG\_parameter\_validation +The `VK_LAYER_LUNARG_parameter_validation` validation layer checks the input parameters to API calls for validity. This layer performs the following tasks: + + - validation of structures; structures are recursed if necessary + - validation of enumerated type values + - null pointer conditions + - stateless valid usage checks + - validation of `VkResult`. diff -Nru vulkan-1.0.65.2+dfsg1/layers/parameter_validation_utils.cpp vulkan-1.1.73+dfsg/layers/parameter_validation_utils.cpp --- vulkan-1.0.65.2+dfsg1/layers/parameter_validation_utils.cpp 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/parameter_validation_utils.cpp 2018-04-27 11:24:19.000000000 +0000 @@ -25,7 +25,6 @@ #include #include #include -#include #include #include @@ -39,6 +38,7 @@ #include "vulkan/vk_layer.h" #include "vk_layer_config.h" #include "vk_dispatch_table_helper.h" +#include "vk_typemap_helper.h" #include "vk_layer_table.h" #include "vk_layer_data.h" @@ -49,17 +49,15 @@ #include "parameter_name.h" #include "parameter_validation.h" -// TODO: remove on NDK update (r15 will probably have proper STL impl) -#ifdef __ANDROID__ -namespace std { - -template -std::string to_string(T var) { - std::ostringstream ss; - ss << var; - return ss.str(); -} -} // namespace std +#if defined __ANDROID__ +#include +#define LOGCONSOLE(...) ((void)__android_log_print(ANDROID_LOG_INFO, "PARAMETER_VALIDATION", __VA_ARGS__)) +#else +#define LOGCONSOLE(...) \ + { \ + printf(__VA_ARGS__); \ + printf("\n"); \ + } #endif namespace parameter_validation { @@ -80,8 +78,18 @@ VkDebugReportCallbackEXT *pMsgCallback); extern bool parameter_validation_vkDestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT msgCallback, const VkAllocationCallbacks *pAllocator); +extern bool parameter_validation_vkCreateDebugUtilsMessengerEXT(VkInstance instance, + const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDebugUtilsMessengerEXT *pMessenger); +extern bool parameter_validation_vkDestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, + const VkAllocationCallbacks *pAllocator); extern bool parameter_validation_vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCommandPool *pCommandPool); +extern bool parameter_validation_vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass); +extern bool parameter_validation_vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, + const VkAllocationCallbacks *pAllocator); // TODO : This can be much smarter, using separate locks for separate global data std::mutex global_lock; @@ -93,17 +101,30 @@ void InitializeManualParameterValidationFunctionPointers(void); static void init_parameter_validation(instance_layer_data *instance_data, const VkAllocationCallbacks *pAllocator) { - layer_debug_actions(instance_data->report_data, instance_data->logging_callback, pAllocator, "lunarg_parameter_validation"); + layer_debug_report_actions(instance_data->report_data, instance_data->logging_callback, pAllocator, + "lunarg_parameter_validation"); + layer_debug_messenger_actions(instance_data->report_data, instance_data->logging_messenger, pAllocator, + "lunarg_parameter_validation"); } -static const VkExtensionProperties instance_extensions[] = {{VK_EXT_DEBUG_REPORT_EXTENSION_NAME, VK_EXT_DEBUG_REPORT_SPEC_VERSION}}; +static const VkExtensionProperties instance_extensions[] = {{VK_EXT_DEBUG_REPORT_EXTENSION_NAME, VK_EXT_DEBUG_REPORT_SPEC_VERSION}, + {VK_EXT_DEBUG_UTILS_EXTENSION_NAME, VK_EXT_DEBUG_UTILS_SPEC_VERSION}}; static const VkLayerProperties global_layer = { - "VK_LAYER_LUNARG_parameter_validation", VK_LAYER_API_VERSION, 1, "LunarG Validation Layer", + "VK_LAYER_LUNARG_parameter_validation", + VK_LAYER_API_VERSION, + 1, + "LunarG Validation Layer", }; static const int MaxParamCheckerStringLength = 256; +template +static inline bool in_inclusive_range(const T &value, const T &min, const T &max) { + // Using only < for generality and || for early abort + return !((value < min) || (max < value)); +} + static bool validate_string(debug_report_data *report_data, const char *apiName, const ParameterName &stringName, const char *validateString) { assert(apiName != nullptr); @@ -116,35 +137,31 @@ if (result == VK_STRING_ERROR_NONE) { return skip; } else if (result & VK_STRING_ERROR_LENGTH) { - skip = log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - INVALID_USAGE, LayerName, "%s: string %s exceeds max length %d", apiName, stringName.get_name().c_str(), - MaxParamCheckerStringLength); + skip = log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, INVALID_USAGE, + "%s: string %s exceeds max length %d", apiName, stringName.get_name().c_str(), MaxParamCheckerStringLength); } else if (result & VK_STRING_ERROR_BAD_DATA) { - skip = log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - INVALID_USAGE, LayerName, "%s: string %s contains invalid characters or is badly formed", apiName, - stringName.get_name().c_str()); + skip = log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, INVALID_USAGE, + "%s: string %s contains invalid characters or is badly formed", apiName, stringName.get_name().c_str()); } return skip; } static bool ValidateDeviceQueueFamily(layer_data *device_data, uint32_t queue_family, const char *cmd_name, - const char *parameter_name, int32_t error_code, bool optional = false, - const char *vu_note = nullptr) { + const char *parameter_name, int32_t error_code, bool optional = false) { bool skip = false; - if (!vu_note) vu_note = validation_error_map[error_code]; if (!optional && queue_family == VK_QUEUE_FAMILY_IGNORED) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(device_data->device), __LINE__, error_code, LayerName, - "%s: %s is VK_QUEUE_FAMILY_IGNORED, but it is required to provide a valid queue family index value. %s", - cmd_name, parameter_name, vu_note); + HandleToUint64(device_data->device), error_code, + "%s: %s is VK_QUEUE_FAMILY_IGNORED, but it is required to provide a valid queue family index value.", + cmd_name, parameter_name); } else if (device_data->queueFamilyIndexMap.find(queue_family) == device_data->queueFamilyIndexMap.end()) { - skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(device_data->device), __LINE__, error_code, LayerName, - "%s: %s (= %" PRIu32 - ") is not one of the queue families given via VkDeviceQueueCreateInfo structures when " - "the device was created. %s", - cmd_name, parameter_name, queue_family, vu_note); + skip |= + log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, + HandleToUint64(device_data->device), error_code, + "%s: %s (= %" PRIu32 + ") is not one of the queue families given via VkDeviceQueueCreateInfo structures when the device was created.", + cmd_name, parameter_name, queue_family); } return skip; @@ -152,11 +169,8 @@ static bool ValidateQueueFamilies(layer_data *device_data, uint32_t queue_family_count, const uint32_t *queue_families, const char *cmd_name, const char *array_parameter_name, int32_t unique_error_code, - int32_t valid_error_code, bool optional = false, const char *unique_vu_note = nullptr, - const char *valid_vu_note = nullptr) { + int32_t valid_error_code, bool optional = false) { bool skip = false; - if (!unique_vu_note) unique_vu_note = validation_error_map[unique_error_code]; - if (!valid_vu_note) valid_vu_note = validation_error_map[valid_error_code]; if (queue_families) { std::unordered_set set; for (uint32_t i = 0; i < queue_family_count; ++i) { @@ -164,13 +178,13 @@ if (set.count(queue_families[i])) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(device_data->device), __LINE__, VALIDATION_ERROR_056002e8, LayerName, - "%s: %s (=%" PRIu32 ") is not unique within %s array. %s", cmd_name, parameter_name.c_str(), - queue_families[i], array_parameter_name, unique_vu_note); + HandleToUint64(device_data->device), VALIDATION_ERROR_056002e8, + "%s: %s (=%" PRIu32 ") is not unique within %s array.", cmd_name, parameter_name.c_str(), + queue_families[i], array_parameter_name); } else { set.insert(queue_families[i]); skip |= ValidateDeviceQueueFamily(device_data, queue_families[i], cmd_name, parameter_name.c_str(), - valid_error_code, optional, valid_vu_note); + valid_error_code, optional); } } } @@ -204,27 +218,69 @@ layer_init_instance_dispatch_table(*pInstance, &my_instance_data->dispatch_table, fpGetInstanceProcAddr); my_instance_data->instance = *pInstance; my_instance_data->report_data = - debug_report_create_instance(&my_instance_data->dispatch_table, *pInstance, pCreateInfo->enabledExtensionCount, - pCreateInfo->ppEnabledExtensionNames); + debug_utils_create_instance(&my_instance_data->dispatch_table, *pInstance, pCreateInfo->enabledExtensionCount, + pCreateInfo->ppEnabledExtensionNames); // Look for one or more debug report create info structures // and setup a callback(s) for each one found. - if (!layer_copy_tmp_callbacks(pCreateInfo->pNext, &my_instance_data->num_tmp_callbacks, - &my_instance_data->tmp_dbg_create_infos, &my_instance_data->tmp_callbacks)) { - if (my_instance_data->num_tmp_callbacks > 0) { + if (!layer_copy_tmp_debug_messengers(pCreateInfo->pNext, &my_instance_data->num_tmp_debug_messengers, + &my_instance_data->tmp_messenger_create_infos, + &my_instance_data->tmp_debug_messengers)) { + if (my_instance_data->num_tmp_debug_messengers > 0) { // Setup the temporary callback(s) here to catch early issues: - if (layer_enable_tmp_callbacks(my_instance_data->report_data, my_instance_data->num_tmp_callbacks, - my_instance_data->tmp_dbg_create_infos, my_instance_data->tmp_callbacks)) { + if (layer_enable_tmp_debug_messengers(my_instance_data->report_data, my_instance_data->num_tmp_debug_messengers, + my_instance_data->tmp_messenger_create_infos, + my_instance_data->tmp_debug_messengers)) { // Failure of setting up one or more of the callback. // Therefore, clean up and don't use those callbacks: - layer_free_tmp_callbacks(my_instance_data->tmp_dbg_create_infos, my_instance_data->tmp_callbacks); - my_instance_data->num_tmp_callbacks = 0; + layer_free_tmp_debug_messengers(my_instance_data->tmp_messenger_create_infos, + my_instance_data->tmp_debug_messengers); + my_instance_data->num_tmp_debug_messengers = 0; + } + } + } + if (!layer_copy_tmp_report_callbacks(pCreateInfo->pNext, &my_instance_data->num_tmp_report_callbacks, + &my_instance_data->tmp_report_create_infos, &my_instance_data->tmp_report_callbacks)) { + if (my_instance_data->num_tmp_report_callbacks > 0) { + // Setup the temporary callback(s) here to catch early issues: + if (layer_enable_tmp_report_callbacks(my_instance_data->report_data, my_instance_data->num_tmp_report_callbacks, + my_instance_data->tmp_report_create_infos, + my_instance_data->tmp_report_callbacks)) { + // Failure of setting up one or more of the callback. + // Therefore, clean up and don't use those callbacks: + layer_free_tmp_report_callbacks(my_instance_data->tmp_report_create_infos, + my_instance_data->tmp_report_callbacks); + my_instance_data->num_tmp_report_callbacks = 0; } } } init_parameter_validation(my_instance_data, pAllocator); - my_instance_data->extensions.InitFromInstanceCreateInfo(pCreateInfo); + // Note: From the spec-- + // Providing a NULL VkInstanceCreateInfo::pApplicationInfo or providing an apiVersion of 0 is equivalent to providing + // an apiVersion of VK_MAKE_VERSION(1, 0, 0). (a.k.a. VK_API_VERSION_1_0) + uint32_t api_version = (pCreateInfo->pApplicationInfo && pCreateInfo->pApplicationInfo->apiVersion) + ? pCreateInfo->pApplicationInfo->apiVersion + : VK_API_VERSION_1_0; + + uint32_t effective_api_version = my_instance_data->extensions.InitFromInstanceCreateInfo(api_version, pCreateInfo); + + uint32_t api_version_nopatch = VK_MAKE_VERSION(VK_VERSION_MAJOR(api_version), VK_VERSION_MINOR(api_version), 0); + if (api_version_nopatch != effective_api_version) { + const char *effective_api_string = + (effective_api_version == VK_API_VERSION_1_0) ? "VK_API_VERSION_1_0" : "VK_API_VERSION_1_1"; + if (api_version_nopatch < VK_API_VERSION_1_0) { + log_msg(my_instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_UNDEFINED, + "Invalid CreateInstance->pCreateInfo->pApplicationInfo.apiVersion number (0x%08x). Using %s.\n", + api_version, effective_api_string); + } else { + log_msg(my_instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_UNDEFINED, + "Unrecognized CreateInstance->pCreateInfo->pApplicationInfo.apiVersion number (0x%08x). Assuming %s.\n", + api_version, effective_api_string); + } + } // Ordinarily we'd check these before calling down the chain, but none of the layer support is in place until now, if we // survive we can report the issue now. @@ -244,9 +300,13 @@ } // Disable the tmp callbacks: - if (my_instance_data->num_tmp_callbacks > 0) { - layer_disable_tmp_callbacks(my_instance_data->report_data, my_instance_data->num_tmp_callbacks, - my_instance_data->tmp_callbacks); + if (my_instance_data->num_tmp_debug_messengers > 0) { + layer_disable_tmp_debug_messengers(my_instance_data->report_data, my_instance_data->num_tmp_debug_messengers, + my_instance_data->tmp_debug_messengers); + } + if (my_instance_data->num_tmp_report_callbacks > 0) { + layer_disable_tmp_report_callbacks(my_instance_data->report_data, my_instance_data->num_tmp_report_callbacks, + my_instance_data->tmp_report_callbacks); } } @@ -261,9 +321,15 @@ // Enable the temporary callback(s) here to catch vkDestroyInstance issues: bool callback_setup = false; - if (instance_data->num_tmp_callbacks > 0) { - if (!layer_enable_tmp_callbacks(instance_data->report_data, instance_data->num_tmp_callbacks, - instance_data->tmp_dbg_create_infos, instance_data->tmp_callbacks)) { + if (instance_data->num_tmp_debug_messengers > 0) { + if (!layer_enable_tmp_debug_messengers(instance_data->report_data, instance_data->num_tmp_debug_messengers, + instance_data->tmp_messenger_create_infos, instance_data->tmp_debug_messengers)) { + callback_setup = true; + } + } + if (instance_data->num_tmp_report_callbacks > 0) { + if (!layer_enable_tmp_report_callbacks(instance_data->report_data, instance_data->num_tmp_report_callbacks, + instance_data->tmp_report_create_infos, instance_data->tmp_report_callbacks)) { callback_setup = true; } } @@ -272,24 +338,36 @@ // Disable and cleanup the temporary callback(s): if (callback_setup) { - layer_disable_tmp_callbacks(instance_data->report_data, instance_data->num_tmp_callbacks, instance_data->tmp_callbacks); - } - if (instance_data->num_tmp_callbacks > 0) { - layer_free_tmp_callbacks(instance_data->tmp_dbg_create_infos, instance_data->tmp_callbacks); - instance_data->num_tmp_callbacks = 0; + layer_disable_tmp_debug_messengers(instance_data->report_data, instance_data->num_tmp_debug_messengers, + instance_data->tmp_debug_messengers); + layer_disable_tmp_report_callbacks(instance_data->report_data, instance_data->num_tmp_report_callbacks, + instance_data->tmp_report_callbacks); + } + if (instance_data->num_tmp_debug_messengers > 0) { + layer_free_tmp_debug_messengers(instance_data->tmp_messenger_create_infos, instance_data->tmp_debug_messengers); + instance_data->num_tmp_debug_messengers = 0; + } + if (instance_data->num_tmp_report_callbacks > 0) { + layer_free_tmp_report_callbacks(instance_data->tmp_report_create_infos, instance_data->tmp_report_callbacks); + instance_data->num_tmp_report_callbacks = 0; } if (!skip) { instance_data->dispatch_table.DestroyInstance(instance, pAllocator); // Clean up logging callback, if any + while (instance_data->logging_messenger.size() > 0) { + VkDebugUtilsMessengerEXT messenger = instance_data->logging_messenger.back(); + layer_destroy_messenger_callback(instance_data->report_data, messenger, pAllocator); + instance_data->logging_messenger.pop_back(); + } while (instance_data->logging_callback.size() > 0) { VkDebugReportCallbackEXT callback = instance_data->logging_callback.back(); - layer_destroy_msg_callback(instance_data->report_data, callback, pAllocator); + layer_destroy_report_callback(instance_data->report_data, callback, pAllocator); instance_data->logging_callback.pop_back(); } - layer_debug_report_destroy_instance(instance_data->report_data); + layer_debug_utils_destroy_instance(instance_data->report_data); } FreeLayerDataPtr(key, instance_layer_data_map); @@ -305,7 +383,11 @@ auto instance_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); VkResult result = instance_data->dispatch_table.CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pMsgCallback); if (result == VK_SUCCESS) { - result = layer_create_msg_callback(instance_data->report_data, false, pCreateInfo, pAllocator, pMsgCallback); + result = layer_create_report_callback(instance_data->report_data, false, pCreateInfo, pAllocator, pMsgCallback); + // If something happened during this call, clean up the message callback that was created earlier in the lower levels + if (VK_SUCCESS != result) { + instance_data->dispatch_table.DestroyDebugReportCallbackEXT(instance, *pMsgCallback, pAllocator); + } } return result; } @@ -316,7 +398,36 @@ if (!skip) { auto instance_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); instance_data->dispatch_table.DestroyDebugReportCallbackEXT(instance, msgCallback, pAllocator); - layer_destroy_msg_callback(instance_data->report_data, msgCallback, pAllocator); + layer_destroy_report_callback(instance_data->report_data, msgCallback, pAllocator); + } +} + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDebugUtilsMessengerEXT(VkInstance instance, + const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDebugUtilsMessengerEXT *pMessenger) { + bool skip = parameter_validation_vkCreateDebugUtilsMessengerEXT(instance, pCreateInfo, pAllocator, pMessenger); + if (skip) return VK_ERROR_VALIDATION_FAILED_EXT; + + auto instance_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); + VkResult result = instance_data->dispatch_table.CreateDebugUtilsMessengerEXT(instance, pCreateInfo, pAllocator, pMessenger); + if (VK_SUCCESS == result) { + result = layer_create_messenger_callback(instance_data->report_data, false, pCreateInfo, pAllocator, pMessenger); + // If something happened during this call, clean up the message callback that was created earlier in the lower levels + if (VK_SUCCESS != result) { + instance_data->dispatch_table.DestroyDebugUtilsMessengerEXT(instance, *pMessenger, pAllocator); + } + } + return result; +} + +VKAPI_ATTR void VKAPI_CALL vkDestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, + const VkAllocationCallbacks *pAllocator) { + bool skip = parameter_validation_vkDestroyDebugUtilsMessengerEXT(instance, messenger, pAllocator); + if (!skip) { + auto instance_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); + instance_data->dispatch_table.DestroyDebugUtilsMessengerEXT(instance, messenger, pAllocator); + layer_destroy_messenger_callback(instance_data->report_data, messenger, pAllocator); } } @@ -346,48 +457,20 @@ if (maint1 && negative_viewport) { skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_056002ec, LayerName, + VALIDATION_ERROR_056002ec, "VkDeviceCreateInfo->ppEnabledExtensionNames must not simultaneously include VK_KHR_maintenance1 and " - "VK_AMD_negative_viewport_height. %s", - validation_error_map[VALIDATION_ERROR_056002ec]); + "VK_AMD_negative_viewport_height."); } if (pCreateInfo->pNext != NULL && pCreateInfo->pEnabledFeatures) { // Check for get_physical_device_properties2 struct - struct std_header { - VkStructureType sType; - const void *pNext; - }; - std_header *cur_pnext = (std_header *)pCreateInfo->pNext; - while (cur_pnext) { - if (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR == cur_pnext->sType) { - // Cannot include VkPhysicalDeviceFeatures2KHR and have non-null pEnabledFeatures - skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, - 0, __LINE__, INVALID_USAGE, LayerName, - "VkDeviceCreateInfo->pNext includes a VkPhysicalDeviceFeatures2KHR struct when " - "pCreateInfo->pEnabledFeatures is non-NULL."); - break; - } - cur_pnext = (std_header *)cur_pnext->pNext; - } - } - if (pCreateInfo->pNext != NULL && pCreateInfo->pEnabledFeatures) { - // Check for get_physical_device_properties2 struct - struct std_header { - VkStructureType sType; - const void *pNext; - }; - std_header *cur_pnext = (std_header *)pCreateInfo->pNext; - while (cur_pnext) { - if (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR == cur_pnext->sType) { - // Cannot include VkPhysicalDeviceFeatures2KHR and have non-null pEnabledFeatures - skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, - 0, __LINE__, INVALID_USAGE, LayerName, - "VkDeviceCreateInfo->pNext includes a VkPhysicalDeviceFeatures2KHR struct when " - "pCreateInfo->pEnabledFeatures is non-NULL."); - break; - } - cur_pnext = (std_header *)cur_pnext->pNext; + const auto *features2 = lvl_find_in_chain(pCreateInfo->pNext); + if (features2) { + // Cannot include VkPhysicalDeviceFeatures2KHR and have non-null pEnabledFeatures + skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + INVALID_USAGE, + "VkDeviceCreateInfo->pNext includes a VkPhysicalDeviceFeatures2KHR struct when " + "pCreateInfo->pEnabledFeatures is non-NULL."); } } @@ -399,20 +482,19 @@ const uint32_t requested_queue_family = pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex; if (requested_queue_family == VK_QUEUE_FAMILY_IGNORED) { skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, HandleToUint64(physicalDevice), __LINE__, - VALIDATION_ERROR_06c002fa, LayerName, + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, HandleToUint64(physicalDevice), + VALIDATION_ERROR_06c002fa, "vkCreateDevice: pCreateInfo->pQueueCreateInfos[%" PRIu32 - "].queueFamilyIndex is " - "VK_QUEUE_FAMILY_IGNORED, but it is required to provide a valid queue family index value. %s", - i, validation_error_map[VALIDATION_ERROR_06c002fa]); + "].queueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, but it is required to provide a valid queue family " + "index value.", + i); } else if (set.count(requested_queue_family)) { skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, HandleToUint64(physicalDevice), __LINE__, - VALIDATION_ERROR_056002e8, LayerName, + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, HandleToUint64(physicalDevice), + VALIDATION_ERROR_056002e8, "vkCreateDevice: pCreateInfo->pQueueCreateInfos[%" PRIu32 "].queueFamilyIndex (=%" PRIu32 - ") is " - "not unique within pCreateInfo->pQueueCreateInfos array. %s", - i, requested_queue_family, validation_error_map[VALIDATION_ERROR_056002e8]); + ") is not unique within pCreateInfo->pQueueCreateInfos array.", + i, requested_queue_family); } else { set.insert(requested_queue_family); } @@ -422,11 +504,11 @@ const float queue_priority = pCreateInfo->pQueueCreateInfos[i].pQueuePriorities[j]; if (!(queue_priority >= 0.f) || !(queue_priority <= 1.f)) { skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, HandleToUint64(physicalDevice), __LINE__, - VALIDATION_ERROR_06c002fe, LayerName, + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, HandleToUint64(physicalDevice), + VALIDATION_ERROR_06c002fe, "vkCreateDevice: pCreateInfo->pQueueCreateInfos[%" PRIu32 "].pQueuePriorities[%" PRIu32 - "] (=%f) is not between 0 and 1 (inclusive). %s", - i, j, queue_priority, validation_error_map[VALIDATION_ERROR_06c002fe]); + "] (=%f) is not between 0 and 1 (inclusive).", + i, j, queue_priority); } } } @@ -471,16 +553,28 @@ lock.lock(); - validate_result(my_instance_data->report_data, "vkCreateDevice", {}, result); - if (result == VK_SUCCESS) { layer_data *my_device_data = GetLayerDataPtr(get_dispatch_key(*pDevice), layer_data_map); assert(my_device_data != nullptr); - my_device_data->report_data = layer_debug_report_create_device(my_instance_data->report_data, *pDevice); + my_device_data->report_data = layer_debug_utils_create_device(my_instance_data->report_data, *pDevice); layer_init_device_dispatch_table(*pDevice, &my_device_data->dispatch_table, fpGetDeviceProcAddr); - my_device_data->extensions.InitFromDeviceCreateInfo(&my_instance_data->extensions, pCreateInfo); + // Query and save physical device limits for this device + VkPhysicalDeviceProperties device_properties = {}; + my_instance_data->dispatch_table.GetPhysicalDeviceProperties(physicalDevice, &device_properties); + + my_device_data->api_version = my_device_data->extensions.InitFromDeviceCreateInfo( + &my_instance_data->extensions, device_properties.apiVersion, pCreateInfo); + + uint32_t specified_api_version = device_properties.apiVersion & ~VK_VERSION_PATCH(~0); + if (!(specified_api_version == VK_API_VERSION_1_0) && !(specified_api_version == VK_API_VERSION_1_1)) { + LOGCONSOLE( + "Warning: Unrecognized CreateInstance->pCreateInfo->pApplicationInfo.apiVersion number -- (0x%8x) assuming " + "%s.\n", + device_properties.apiVersion, + (my_device_data->api_version == VK_API_VERSION_1_0) ? "VK_API_VERSION_1_0" : "VK_API_VERSION_1_1"); + } // Store createdevice data if ((pCreateInfo != nullptr) && (pCreateInfo->pQueueCreateInfos != nullptr)) { @@ -490,16 +584,21 @@ } } - // Query and save physical device limits for this device - VkPhysicalDeviceProperties device_properties = {}; - my_instance_data->dispatch_table.GetPhysicalDeviceProperties(physicalDevice, &device_properties); memcpy(&my_device_data->device_limits, &device_properties.limits, sizeof(VkPhysicalDeviceLimits)); my_device_data->physical_device = physicalDevice; my_device_data->device = *pDevice; // Save app-enabled features in this device's layer_data structure - if (pCreateInfo->pEnabledFeatures) { - my_device_data->physical_device_features = *pCreateInfo->pEnabledFeatures; + // The enabled features can come from either pEnabledFeatures, or from the pNext chain + const VkPhysicalDeviceFeatures *enabled_features_found = pCreateInfo->pEnabledFeatures; + if ((nullptr == enabled_features_found) && my_device_data->extensions.vk_khr_get_physical_device_properties_2) { + const auto *features2 = lvl_find_in_chain(pCreateInfo->pNext); + if (features2) { + enabled_features_found = &(features2->features); + } + } + if (enabled_features_found) { + my_device_data->physical_device_features = *enabled_features_found; } else { memset(&my_device_data->physical_device_features, 0, sizeof(VkPhysicalDeviceFeatures)); } @@ -519,7 +618,7 @@ } if (!skip) { - layer_debug_report_destroy_device(device); + layer_debug_utils_destroy_device(device); device_data->dispatch_table.DestroyDevice(device, pAllocator); } FreeLayerDataPtr(key, layer_data_map); @@ -534,11 +633,11 @@ const auto &queue_data = device_data->queueFamilyIndexMap.find(queueFamilyIndex); if (queue_data != device_data->queueFamilyIndexMap.end() && queue_data->second <= queueIndex) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - HandleToUint64(device), __LINE__, VALIDATION_ERROR_29600302, LayerName, + HandleToUint64(device), VALIDATION_ERROR_29600302, "vkGetDeviceQueue: queueIndex (=%" PRIu32 - ") is not less than the number of queues requested from " - "queueFamilyIndex (=%" PRIu32 ") when the device was created (i.e. is not less than %" PRIu32 "). %s", - queueIndex, queueFamilyIndex, queue_data->second, validation_error_map[VALIDATION_ERROR_29600302]); + ") is not less than the number of queues requested from queueFamilyIndex (=%" PRIu32 + ") when the device was created (i.e. is not less than %" PRIu32 ").", + queueIndex, queueFamilyIndex, queue_data->second); } return skip; } @@ -577,11 +676,10 @@ if ((pCreateInfo->queryType == VK_QUERY_TYPE_PIPELINE_STATISTICS) && (pCreateInfo->pipelineStatistics != 0) && ((pCreateInfo->pipelineStatistics & (~AllVkQueryPipelineStatisticFlagBits)) != 0)) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_11c00630, LayerName, - "vkCreateQueryPool(): if pCreateInfo->queryType is " - "VK_QUERY_TYPE_PIPELINE_STATISTICS, pCreateInfo->pipelineStatistics must be " - "a valid combination of VkQueryPipelineStatisticFlagBits values. %s", - validation_error_map[VALIDATION_ERROR_11c00630]); + VALIDATION_ERROR_11c00630, + "vkCreateQueryPool(): if pCreateInfo->queryType is VK_QUERY_TYPE_PIPELINE_STATISTICS, " + "pCreateInfo->pipelineStatistics must be a valid combination of VkQueryPipelineStatisticFlagBits " + "values."); } } if (!skip) { @@ -590,42 +688,111 @@ return result; } +VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass) { + layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + bool skip = false; + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + + { + std::unique_lock lock(global_lock); + skip |= parameter_validation_vkCreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass); + + typedef bool (*PFN_manual_vkCreateRenderPass)(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass); + PFN_manual_vkCreateRenderPass custom_func = (PFN_manual_vkCreateRenderPass)custom_functions["vkCreateRenderPass"]; + if (custom_func != nullptr) { + skip |= custom_func(device, pCreateInfo, pAllocator, pRenderPass); + } + } + + if (!skip) { + result = device_data->dispatch_table.CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass); + + // track the state necessary for checking vkCreateGraphicsPipeline (subpass usage of depth and color attachments) + if (result == VK_SUCCESS) { + std::unique_lock lock(global_lock); + const auto renderPass = *pRenderPass; + auto &renderpass_state = device_data->renderpasses_states[renderPass]; + + for (uint32_t subpass = 0; subpass < pCreateInfo->subpassCount; ++subpass) { + bool uses_color = false; + for (uint32_t i = 0; i < pCreateInfo->pSubpasses[subpass].colorAttachmentCount && !uses_color; ++i) + if (pCreateInfo->pSubpasses[subpass].pColorAttachments[i].attachment != VK_ATTACHMENT_UNUSED) uses_color = true; + + bool uses_depthstencil = false; + if (pCreateInfo->pSubpasses[subpass].pDepthStencilAttachment) + if (pCreateInfo->pSubpasses[subpass].pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) + uses_depthstencil = true; + + if (uses_color) renderpass_state.subpasses_using_color_attachment.insert(subpass); + if (uses_depthstencil) renderpass_state.subpasses_using_depthstencil_attachment.insert(subpass); + } + } + } + return result; +} + +VKAPI_ATTR void VKAPI_CALL vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks *pAllocator) { + layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + bool skip = false; + + { + std::unique_lock lock(global_lock); + skip |= parameter_validation_vkDestroyRenderPass(device, renderPass, pAllocator); + + typedef bool (*PFN_manual_vkDestroyRenderPass)(VkDevice device, VkRenderPass renderPass, + const VkAllocationCallbacks *pAllocator); + PFN_manual_vkDestroyRenderPass custom_func = (PFN_manual_vkDestroyRenderPass)custom_functions["vkDestroyRenderPass"]; + if (custom_func != nullptr) { + skip |= custom_func(device, renderPass, pAllocator); + } + } + + if (!skip) { + device_data->dispatch_table.DestroyRenderPass(device, renderPass, pAllocator); + + // track the state necessary for checking vkCreateGraphicsPipeline (subpass usage of depth and color attachments) + { + std::unique_lock lock(global_lock); + device_data->renderpasses_states.erase(renderPass); + } + } +} + bool pv_vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer) { bool skip = false; layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); debug_report_data *report_data = device_data->report_data; + const LogMiscParams log_misc{report_data, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, VK_NULL_HANDLE, "vkCreateBuffer"}; + if (pCreateInfo != nullptr) { - // Buffer size must be greater than 0 (error 00663) - skip |= - ValidateGreaterThan(report_data, "vkCreateBuffer", "pCreateInfo->size", static_cast(pCreateInfo->size), 0u); + skip |= ValidateGreaterThanZero(pCreateInfo->size, "pCreateInfo->size", VALIDATION_ERROR_01400720, log_misc); // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml if (pCreateInfo->sharingMode == VK_SHARING_MODE_CONCURRENT) { // If sharingMode is VK_SHARING_MODE_CONCURRENT, queueFamilyIndexCount must be greater than 1 if (pCreateInfo->queueFamilyIndexCount <= 1) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_01400724, LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_01400724, "vkCreateBuffer: if pCreateInfo->sharingMode is VK_SHARING_MODE_CONCURRENT, " - "pCreateInfo->queueFamilyIndexCount must be greater than 1. %s", - validation_error_map[VALIDATION_ERROR_01400724]); + "pCreateInfo->queueFamilyIndexCount must be greater than 1."); } // If sharingMode is VK_SHARING_MODE_CONCURRENT, pQueueFamilyIndices must be a pointer to an array of // queueFamilyIndexCount uint32_t values if (pCreateInfo->pQueueFamilyIndices == nullptr) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_01400722, LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_01400722, "vkCreateBuffer: if pCreateInfo->sharingMode is VK_SHARING_MODE_CONCURRENT, " "pCreateInfo->pQueueFamilyIndices must be a pointer to an array of " - "pCreateInfo->queueFamilyIndexCount uint32_t values. %s", - validation_error_map[VALIDATION_ERROR_01400722]); + "pCreateInfo->queueFamilyIndexCount uint32_t values."); } else { - // TODO: Not in the spec VUs. Probably missing -- KhronosGroup/Vulkan-Docs#501. Update error codes when resolved. skip |= ValidateQueueFamilies(device_data, pCreateInfo->queueFamilyIndexCount, pCreateInfo->pQueueFamilyIndices, "vkCreateBuffer", "pCreateInfo->pQueueFamilyIndices", INVALID_USAGE, INVALID_USAGE, - false, "", ""); + false); } } @@ -633,11 +800,10 @@ // VK_BUFFER_CREATE_SPARSE_BINDING_BIT if (((pCreateInfo->flags & (VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | VK_BUFFER_CREATE_SPARSE_ALIASED_BIT)) != 0) && ((pCreateInfo->flags & VK_BUFFER_CREATE_SPARSE_BINDING_BIT) != VK_BUFFER_CREATE_SPARSE_BINDING_BIT)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_0140072c, LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0140072c, "vkCreateBuffer: if pCreateInfo->flags contains VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT or " - "VK_BUFFER_CREATE_SPARSE_ALIASED_BIT, it must also contain VK_BUFFER_CREATE_SPARSE_BINDING_BIT. %s", - validation_error_map[VALIDATION_ERROR_0140072c]); + "VK_BUFFER_CREATE_SPARSE_ALIASED_BIT, it must also contain VK_BUFFER_CREATE_SPARSE_BINDING_BIT."); } } @@ -650,11 +816,12 @@ layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); debug_report_data *report_data = device_data->report_data; + const LogMiscParams log_misc{report_data, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, VK_NULL_HANDLE, "vkCreateImage"}; + if (pCreateInfo != nullptr) { if ((device_data->physical_device_features.textureCompressionETC2 == false) && FormatIsCompressed_ETC2_EAC(pCreateInfo->format)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - DEVICE_FEATURE, LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, DEVICE_FEATURE, "vkCreateImage(): Attempting to create VkImage with format %s. The textureCompressionETC2 feature is " "not enabled: neither ETC2 nor EAC formats can be used to create images.", string_VkFormat(pCreateInfo->format)); @@ -662,19 +829,16 @@ if ((device_data->physical_device_features.textureCompressionASTC_LDR == false) && FormatIsCompressed_ASTC_LDR(pCreateInfo->format)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - DEVICE_FEATURE, LayerName, - "vkCreateImage(): Attempting to create VkImage with format %s. The textureCompressionASTC_LDR feature is " - "not enabled: ASTC formats cannot be used to create images.", - string_VkFormat(pCreateInfo->format)); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, DEVICE_FEATURE, + "vkCreateImage(): Attempting to create VkImage with format %s. The textureCompressionASTC_LDR feature " + "is not enabled: ASTC formats cannot be used to create images.", + string_VkFormat(pCreateInfo->format)); } if ((device_data->physical_device_features.textureCompressionBC == false) && FormatIsCompressed_BC(pCreateInfo->format)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - DEVICE_FEATURE, LayerName, - "vkCreateImage(): Attempting to create VkImage with format %s. The textureCompressionBC feature is " - "not enabled: BC compressed formats cannot be used to create images.", + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, DEVICE_FEATURE, + "vkCreateImage(): Attempting to create VkImage with format %s. The textureCompressionBC feature is not " + "enabled: BC compressed formats cannot be used to create images.", string_VkFormat(pCreateInfo->format)); } @@ -682,166 +846,204 @@ if (pCreateInfo->sharingMode == VK_SHARING_MODE_CONCURRENT) { // If sharingMode is VK_SHARING_MODE_CONCURRENT, queueFamilyIndexCount must be greater than 1 if (pCreateInfo->queueFamilyIndexCount <= 1) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e0075c, LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e0075c, "vkCreateImage(): if pCreateInfo->sharingMode is VK_SHARING_MODE_CONCURRENT, " - "pCreateInfo->queueFamilyIndexCount must be greater than 1. %s", - validation_error_map[VALIDATION_ERROR_09e0075c]); + "pCreateInfo->queueFamilyIndexCount must be greater than 1."); } // If sharingMode is VK_SHARING_MODE_CONCURRENT, pQueueFamilyIndices must be a pointer to an array of // queueFamilyIndexCount uint32_t values if (pCreateInfo->pQueueFamilyIndices == nullptr) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e0075a, LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e0075a, "vkCreateImage(): if pCreateInfo->sharingMode is VK_SHARING_MODE_CONCURRENT, " "pCreateInfo->pQueueFamilyIndices must be a pointer to an array of " - "pCreateInfo->queueFamilyIndexCount uint32_t values. %s", - validation_error_map[VALIDATION_ERROR_09e0075a]); + "pCreateInfo->queueFamilyIndexCount uint32_t values."); } else { - // TODO: Not in the spec VUs. Probably missing -- KhronosGroup/Vulkan-Docs#501. Update error codes when resolved. - skip |= ValidateQueueFamilies(device_data, pCreateInfo->queueFamilyIndexCount, pCreateInfo->pQueueFamilyIndices, - "vkCreateImage", "pCreateInfo->pQueueFamilyIndices", INVALID_USAGE, INVALID_USAGE, - false, "", ""); + skip |= + ValidateQueueFamilies(device_data, pCreateInfo->queueFamilyIndexCount, pCreateInfo->pQueueFamilyIndices, + "vkCreateImage", "pCreateInfo->pQueueFamilyIndices", INVALID_USAGE, INVALID_USAGE, false); } } - // width, height, and depth members of extent must be greater than 0 - skip |= ValidateGreaterThan(report_data, "vkCreateImage", "pCreateInfo->extent.width", pCreateInfo->extent.width, 0u); - skip |= ValidateGreaterThan(report_data, "vkCreateImage", "pCreateInfo->extent.height", pCreateInfo->extent.height, 0u); - skip |= ValidateGreaterThan(report_data, "vkCreateImage", "pCreateInfo->extent.depth", pCreateInfo->extent.depth, 0u); + skip |= + ValidateGreaterThanZero(pCreateInfo->extent.width, "pCreateInfo->extent.width", VALIDATION_ERROR_09e00760, log_misc); + skip |= + ValidateGreaterThanZero(pCreateInfo->extent.height, "pCreateInfo->extent.height", VALIDATION_ERROR_09e00762, log_misc); + skip |= + ValidateGreaterThanZero(pCreateInfo->extent.depth, "pCreateInfo->extent.depth", VALIDATION_ERROR_09e00764, log_misc); - // mipLevels must be greater than 0 - skip |= ValidateGreaterThan(report_data, "vkCreateImage", "pCreateInfo->mipLevels", pCreateInfo->mipLevels, 0u); + skip |= ValidateGreaterThanZero(pCreateInfo->mipLevels, "pCreateInfo->mipLevels", VALIDATION_ERROR_09e00766, log_misc); + skip |= ValidateGreaterThanZero(pCreateInfo->arrayLayers, "pCreateInfo->arrayLayers", VALIDATION_ERROR_09e00768, log_misc); - // arrayLayers must be greater than 0 - skip |= ValidateGreaterThan(report_data, "vkCreateImage", "pCreateInfo->arrayLayers", pCreateInfo->arrayLayers, 0u); + // InitialLayout must be PREINITIALIZED or UNDEFINED + if ((pCreateInfo->initialLayout != VK_IMAGE_LAYOUT_UNDEFINED) && + (pCreateInfo->initialLayout != VK_IMAGE_LAYOUT_PREINITIALIZED)) { + skip |= log_msg( + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, VALIDATION_ERROR_09e007c2, + "vkCreateImage(): initialLayout is %s, must be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED.", + string_VkImageLayout(pCreateInfo->initialLayout)); + } // If imageType is VK_IMAGE_TYPE_1D, both extent.height and extent.depth must be 1 - if ((pCreateInfo->imageType == VK_IMAGE_TYPE_1D) && (pCreateInfo->extent.height != 1) && (pCreateInfo->extent.depth != 1)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e00778, LayerName, - "vkCreateImage(): if pCreateInfo->imageType is VK_IMAGE_TYPE_1D, both " - "pCreateInfo->extent.height and pCreateInfo->extent.depth must be 1. %s", - validation_error_map[VALIDATION_ERROR_09e00778]); + if ((pCreateInfo->imageType == VK_IMAGE_TYPE_1D) && + ((pCreateInfo->extent.height != 1) || (pCreateInfo->extent.depth != 1))) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e00778, + "vkCreateImage(): if pCreateInfo->imageType is VK_IMAGE_TYPE_1D, both pCreateInfo->extent.height and " + "pCreateInfo->extent.depth must be 1."); } if (pCreateInfo->imageType == VK_IMAGE_TYPE_2D) { - // If imageType is VK_IMAGE_TYPE_2D and flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, extent.width and - // extent.height must be equal - if ((pCreateInfo->flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) && - (pCreateInfo->extent.width != pCreateInfo->extent.height)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e00774, LayerName, - "vkCreateImage(): if pCreateInfo->imageType is VK_IMAGE_TYPE_2D and " - "pCreateInfo->flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, " - "pCreateInfo->extent.width and pCreateInfo->extent.height must be equal. %s", - validation_error_map[VALIDATION_ERROR_09e00774]); + if (pCreateInfo->flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) { + if (pCreateInfo->extent.width != pCreateInfo->extent.height) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + VK_NULL_HANDLE, VALIDATION_ERROR_09e00774, + "vkCreateImage(): pCreateInfo->flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, but " + "pCreateInfo->extent.width (=%" PRIu32 ") and pCreateInfo->extent.height (=%" PRIu32 + ") are not equal.", + pCreateInfo->extent.width, pCreateInfo->extent.height); + } + + if (pCreateInfo->arrayLayers < 6) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + VK_NULL_HANDLE, VALIDATION_ERROR_09e00774, + "vkCreateImage(): pCreateInfo->flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, but " + "pCreateInfo->arrayLayers (=%" PRIu32 ") is not greater than or equal to 6.", + pCreateInfo->arrayLayers); + } } if (pCreateInfo->extent.depth != 1) { - skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e0077a, LayerName, - "vkCreateImage(): if pCreateInfo->imageType is VK_IMAGE_TYPE_2D, pCreateInfo->extent.depth must be 1. %s", - validation_error_map[VALIDATION_ERROR_09e0077a]); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e0077a, + "vkCreateImage(): if pCreateInfo->imageType is VK_IMAGE_TYPE_2D, pCreateInfo->extent.depth must be 1."); + } + } + + // 3D image may have only 1 layer + if ((pCreateInfo->imageType == VK_IMAGE_TYPE_3D) && (pCreateInfo->arrayLayers != 1)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e00782, + "vkCreateImage(): if pCreateInfo->imageType is VK_IMAGE_TYPE_3D, pCreateInfo->arrayLayers must be 1."); + } + + // If multi-sample, validate type, usage, tiling and mip levels. + if ((pCreateInfo->samples != VK_SAMPLE_COUNT_1_BIT) && + ((pCreateInfo->imageType != VK_IMAGE_TYPE_2D) || (pCreateInfo->flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) || + (pCreateInfo->tiling != VK_IMAGE_TILING_OPTIMAL) || (pCreateInfo->mipLevels != 1))) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e00784, + "vkCreateImage(): Multi-sample image with incompatible type, usage, tiling, or mips."); + } + + if (0 != (pCreateInfo->usage & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT)) { + VkImageUsageFlags legal_flags = (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | + VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT); + // At least one of the legal attachment bits must be set + if (0 == (pCreateInfo->usage & legal_flags)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e0078c, + "vkCreateImage(): Transient attachment image without a compatible attachment flag set."); + } + // No flags other than the legal attachment bits may be set + legal_flags |= VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT; + if (0 != (pCreateInfo->usage & ~legal_flags)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e00786, + "vkCreateImage(): Transient attachment image with incompatible usage flags set."); } } // mipLevels must be less than or equal to floor(log2(max(extent.width,extent.height,extent.depth)))+1 uint32_t maxDim = std::max(std::max(pCreateInfo->extent.width, pCreateInfo->extent.height), pCreateInfo->extent.depth); - if (pCreateInfo->mipLevels > (floor(log2(maxDim)) + 1)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e0077c, LayerName, - "vkCreateImage(): pCreateInfo->mipLevels must be less than or equal to " - "floor(log2(max(pCreateInfo->extent.width, pCreateInfo->extent.height, pCreateInfo->extent.depth)))+1. %s", - validation_error_map[VALIDATION_ERROR_09e0077c]); + if (maxDim > 0 && pCreateInfo->mipLevels > (floor(log2(maxDim)) + 1)) { + skip |= log_msg( + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, VALIDATION_ERROR_09e0077c, + "vkCreateImage(): pCreateInfo->mipLevels must be less than or equal to " + "floor(log2(max(pCreateInfo->extent.width, pCreateInfo->extent.height, pCreateInfo->extent.depth)))+1."); + } + + if ((pCreateInfo->flags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) && (!device_data->physical_device_features.sparseBinding)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, VK_NULL_HANDLE, + VALIDATION_ERROR_09e00792, + "vkCreateImage(): pCreateInfo->flags contains VK_IMAGE_CREATE_SPARSE_BINDING_BIT, but the " + "VkPhysicalDeviceFeatures::sparseBinding feature is disabled."); } // If flags contains VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT or VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, it must also contain // VK_IMAGE_CREATE_SPARSE_BINDING_BIT if (((pCreateInfo->flags & (VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT)) != 0) && ((pCreateInfo->flags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) != VK_IMAGE_CREATE_SPARSE_BINDING_BIT)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e007b6, LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e007b6, "vkCreateImage: if pCreateInfo->flags contains VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT or " - "VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, it must also contain VK_IMAGE_CREATE_SPARSE_BINDING_BIT. %s", - validation_error_map[VALIDATION_ERROR_09e007b6]); + "VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, it must also contain VK_IMAGE_CREATE_SPARSE_BINDING_BIT."); } // Check for combinations of attributes that are incompatible with having VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT set if ((pCreateInfo->flags & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) != 0) { // Linear tiling is unsupported if (VK_IMAGE_TILING_LINEAR == pCreateInfo->tiling) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - INVALID_USAGE, LayerName, - "vkCreateImage: if pCreateInfo->flags contains VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT " - "then image tiling of VK_IMAGE_TILING_LINEAR is not supported"); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, INVALID_USAGE, + "vkCreateImage: if pCreateInfo->flags contains VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT then image " + "tiling of VK_IMAGE_TILING_LINEAR is not supported"); } // Sparse 1D image isn't valid if (VK_IMAGE_TYPE_1D == pCreateInfo->imageType) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e00794, LayerName, - "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 1D image. %s", - validation_error_map[VALIDATION_ERROR_09e00794]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e00794, + "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 1D image."); } // Sparse 2D image when device doesn't support it if ((VK_FALSE == device_data->physical_device_features.sparseResidencyImage2D) && (VK_IMAGE_TYPE_2D == pCreateInfo->imageType)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e00796, LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e00796, "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 2D image if corresponding " - "feature is not enabled on the device. %s", - validation_error_map[VALIDATION_ERROR_09e00796]); + "feature is not enabled on the device."); } // Sparse 3D image when device doesn't support it if ((VK_FALSE == device_data->physical_device_features.sparseResidencyImage3D) && (VK_IMAGE_TYPE_3D == pCreateInfo->imageType)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e00798, LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e00798, "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 3D image if corresponding " - "feature is not enabled on the device. %s", - validation_error_map[VALIDATION_ERROR_09e00798]); + "feature is not enabled on the device."); } // Multi-sample 2D image when device doesn't support it if (VK_IMAGE_TYPE_2D == pCreateInfo->imageType) { if ((VK_FALSE == device_data->physical_device_features.sparseResidency2Samples) && (VK_SAMPLE_COUNT_2_BIT == pCreateInfo->samples)) { - skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e0079a, LayerName, - "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 2-sample image if corresponding " - "feature is not enabled on the device. %s", - validation_error_map[VALIDATION_ERROR_09e0079a]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e0079a, + "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 2-sample image if " + "corresponding feature is not enabled on the device."); } else if ((VK_FALSE == device_data->physical_device_features.sparseResidency4Samples) && (VK_SAMPLE_COUNT_4_BIT == pCreateInfo->samples)) { - skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e0079c, LayerName, - "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 4-sample image if corresponding " - "feature is not enabled on the device. %s", - validation_error_map[VALIDATION_ERROR_09e0079c]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e0079c, + "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 4-sample image if " + "corresponding feature is not enabled on the device."); } else if ((VK_FALSE == device_data->physical_device_features.sparseResidency8Samples) && (VK_SAMPLE_COUNT_8_BIT == pCreateInfo->samples)) { - skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e0079e, LayerName, - "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 8-sample image if corresponding " - "feature is not enabled on the device. %s", - validation_error_map[VALIDATION_ERROR_09e0079e]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e0079e, + "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 8-sample image if " + "corresponding feature is not enabled on the device."); } else if ((VK_FALSE == device_data->physical_device_features.sparseResidency16Samples) && (VK_SAMPLE_COUNT_16_BIT == pCreateInfo->samples)) { - skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e007a0, LayerName, - "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 16-sample image if corresponding " - "feature is not enabled on the device. %s", - validation_error_map[VALIDATION_ERROR_09e007a0]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_09e007a0, + "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 16-sample image if " + "corresponding feature is not enabled on the device."); } } } @@ -859,8 +1061,8 @@ if ((pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_1D) || (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_2D)) { if ((pCreateInfo->subresourceRange.layerCount != 1) && (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, - LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, 1, + "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_%dD, " "pCreateInfo->subresourceRange.layerCount must be 1", ((pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_1D) ? 1 : 2)); @@ -869,8 +1071,8 @@ (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_2D_ARRAY)) { if ((pCreateInfo->subresourceRange.layerCount < 1) && (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, - LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, 1, + "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_%dD_ARRAY, " "pCreateInfo->subresourceRange.layerCount must be >= 1", ((pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_1D_ARRAY) ? 1 : 2)); @@ -878,40 +1080,215 @@ } else if (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_CUBE) { if ((pCreateInfo->subresourceRange.layerCount != 6) && (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, - LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, 1, + "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_CUBE, " "pCreateInfo->subresourceRange.layerCount must be 6"); } } else if (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY) { if (((pCreateInfo->subresourceRange.layerCount == 0) || ((pCreateInfo->subresourceRange.layerCount % 6) != 0)) && (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, - LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, 1, + "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_CUBE_ARRAY, " "pCreateInfo->subresourceRange.layerCount must be a multiple of 6"); } if (!device_data->physical_device_features.imageCubeArray) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, - LayerName, "vkCreateImageView: Device feature imageCubeArray not enabled."); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, 1, + "vkCreateImageView: Device feature imageCubeArray not enabled."); } } else if (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_3D) { if (pCreateInfo->subresourceRange.baseArrayLayer != 0) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, - LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, 1, + "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_3D, " "pCreateInfo->subresourceRange.baseArrayLayer must be 0"); } if ((pCreateInfo->subresourceRange.layerCount != 1) && (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, - LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, 1, + "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_3D, " "pCreateInfo->subresourceRange.layerCount must be 1"); } } + + // Validate chained VkImageViewUsageCreateInfo struct, if present + if (nullptr != pCreateInfo->pNext) { + auto chained_ivuci_struct = lvl_find_in_chain(pCreateInfo->pNext); + if (chained_ivuci_struct) { + if (0 == chained_ivuci_struct->usage) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_3f230603, + "vkCreateImageView: Chained VkImageViewUsageCreateInfo usage field must not be 0."); + } else if (chained_ivuci_struct->usage & ~AllVkImageUsageFlagBits) { + std::stringstream ss; + ss << "vkCreateImageView: Chained VkImageViewUsageCreateInfo usage field (0x" << std::hex + << chained_ivuci_struct->usage << ") contains invalid flag bits."; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_3f230601, "%s", ss.str().c_str()); + } + } + } + } + return skip; +} + +bool pv_VkViewport(const layer_data *device_data, const VkViewport &viewport, const char *fn_name, const char *param_name, + VkDebugReportObjectTypeEXT object_type, uint64_t object = 0) { + bool skip = false; + debug_report_data *report_data = device_data->report_data; + + // Note: for numerical correctness + // - float comparisons should expect NaN (comparison always false). + // - VkPhysicalDeviceLimits::maxViewportDimensions is uint32_t, not float -> careful. + + const auto f_lte_u32_exact = [](const float v1_f, const uint32_t v2_u32) { + if (std::isnan(v1_f)) return false; + if (v1_f <= 0.0f) return true; + + float intpart; + const float fract = modff(v1_f, &intpart); + + assert(std::numeric_limits::radix == 2); + const float u32_max_plus1 = ldexpf(1.0f, 32); // hopefully exact + if (intpart >= u32_max_plus1) return false; + + uint32_t v1_u32 = static_cast(intpart); + if (v1_u32 < v2_u32) + return true; + else if (v1_u32 == v2_u32 && fract == 0.0f) + return true; + else + return false; + }; + + const auto f_lte_u32_direct = [](const float v1_f, const uint32_t v2_u32) { + const float v2_f = static_cast(v2_u32); // not accurate for > radix^digits; and undefined rounding mode + return (v1_f <= v2_f); + }; + + // width + bool width_healthy = true; + const auto max_w = device_data->device_limits.maxViewportDimensions[0]; + + if (!(viewport.width > 0.0f)) { + width_healthy = false; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, object_type, object, VALIDATION_ERROR_15000dd4, + "%s: %s.width (=%f) is not greater than 0.0.", fn_name, param_name, viewport.width); + } else if (!(f_lte_u32_exact(viewport.width, max_w) || f_lte_u32_direct(viewport.width, max_w))) { + width_healthy = false; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, object_type, object, VALIDATION_ERROR_15000dd6, + "%s: %s.width (=%f) exceeds VkPhysicalDeviceLimits::maxViewportDimensions[0] (=%" PRIu32 ").", fn_name, + param_name, viewport.width, max_w); + } else if (!f_lte_u32_exact(viewport.width, max_w) && f_lte_u32_direct(viewport.width, max_w)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, object_type, object, NONE, + "%s: %s.width (=%f) technically exceeds VkPhysicalDeviceLimits::maxViewportDimensions[0] (=%" PRIu32 + "), but it is within the static_cast(maxViewportDimensions[0]) limit.", + fn_name, param_name, viewport.width, max_w); + } + + // height + bool height_healthy = true; + const bool negative_height_enabled = device_data->api_version >= VK_API_VERSION_1_1 || + device_data->extensions.vk_khr_maintenance1 || + device_data->extensions.vk_amd_negative_viewport_height; + const auto max_h = device_data->device_limits.maxViewportDimensions[1]; + + if (!negative_height_enabled && !(viewport.height > 0.0f)) { + height_healthy = false; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, object_type, object, VALIDATION_ERROR_15000dd8, + "%s: %s.height (=%f) is not greater 0.0.", fn_name, param_name, viewport.height); + } else if (!(f_lte_u32_exact(fabsf(viewport.height), max_h) || f_lte_u32_direct(fabsf(viewport.height), max_h))) { + height_healthy = false; + + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, object_type, object, VALIDATION_ERROR_15000dda, + "%s: Absolute value of %s.height (=%f) exceeds VkPhysicalDeviceLimits::maxViewportDimensions[1] (=%" PRIu32 + ").", + fn_name, param_name, viewport.height, max_h); + } else if (!f_lte_u32_exact(fabsf(viewport.height), max_h) && f_lte_u32_direct(fabsf(viewport.height), max_h)) { + height_healthy = false; + + skip |= log_msg( + report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, object_type, object, NONE, + "%s: Absolute value of %s.height (=%f) technically exceeds VkPhysicalDeviceLimits::maxViewportDimensions[1] (=%" PRIu32 + "), but it is within the static_cast(maxViewportDimensions[1]) limit.", + fn_name, param_name, viewport.height, max_h); + } + + // x + bool x_healthy = true; + if (!(viewport.x >= device_data->device_limits.viewportBoundsRange[0])) { + x_healthy = false; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, object_type, object, VALIDATION_ERROR_15000ddc, + "%s: %s.x (=%f) is less than VkPhysicalDeviceLimits::viewportBoundsRange[0] (=%f).", fn_name, param_name, + viewport.x, device_data->device_limits.viewportBoundsRange[0]); + } + + // x + width + if (x_healthy && width_healthy) { + const float right_bound = viewport.x + viewport.width; + if (!(right_bound <= device_data->device_limits.viewportBoundsRange[1])) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, object_type, object, VALIDATION_ERROR_150009a0, + "%s: %s.x + %s.width (=%f + %f = %f) is greater than VkPhysicalDeviceLimits::viewportBoundsRange[1] (=%f).", + fn_name, param_name, param_name, viewport.x, viewport.width, right_bound, + device_data->device_limits.viewportBoundsRange[1]); + } + } + + // y + bool y_healthy = true; + if (!(viewport.y >= device_data->device_limits.viewportBoundsRange[0])) { + y_healthy = false; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, object_type, object, VALIDATION_ERROR_15000dde, + "%s: %s.y (=%f) is less than VkPhysicalDeviceLimits::viewportBoundsRange[0] (=%f).", fn_name, param_name, + viewport.y, device_data->device_limits.viewportBoundsRange[0]); + } else if (negative_height_enabled && !(viewport.y <= device_data->device_limits.viewportBoundsRange[1])) { + y_healthy = false; + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, object_type, object, VALIDATION_ERROR_15000de0, + "%s: %s.y (=%f) exceeds VkPhysicalDeviceLimits::viewportBoundsRange[1] (=%f).", fn_name, param_name, + viewport.y, device_data->device_limits.viewportBoundsRange[1]); + } + + // y + height + if (y_healthy && height_healthy) { + const float boundary = viewport.y + viewport.height; + + if (!(boundary <= device_data->device_limits.viewportBoundsRange[1])) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, object_type, object, VALIDATION_ERROR_150009a2, + "%s: %s.y + %s.height (=%f + %f = %f) exceeds VkPhysicalDeviceLimits::viewportBoundsRange[1] (=%f).", + fn_name, param_name, param_name, viewport.y, viewport.height, boundary, + device_data->device_limits.viewportBoundsRange[1]); + } else if (negative_height_enabled && !(boundary >= device_data->device_limits.viewportBoundsRange[0])) { + skip |= log_msg( + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, object_type, object, VALIDATION_ERROR_15000de2, + "%s: %s.y + %s.height (=%f + %f = %f) is less than VkPhysicalDeviceLimits::viewportBoundsRange[0] (=%f).", fn_name, + param_name, param_name, viewport.y, viewport.height, boundary, device_data->device_limits.viewportBoundsRange[0]); + } + } + + if (!device_data->extensions.vk_ext_depth_range_unrestricted) { + // minDepth + if (!(viewport.minDepth >= 0.0) || !(viewport.minDepth <= 1.0)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, object_type, object, VALIDATION_ERROR_150009a4, + + "%s: VK_EXT_depth_range_unrestricted extension is not enabled and %s.minDepth (=%f) is not within the " + "[0.0, 1.0] range.", + fn_name, param_name, viewport.minDepth); + } + + // maxDepth + if (!(viewport.maxDepth >= 0.0) || !(viewport.maxDepth <= 1.0)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, object_type, object, VALIDATION_ERROR_150009a6, + + "%s: VK_EXT_depth_range_unrestricted extension is not enabled and %s.maxDepth (=%f) is not within the " + "[0.0, 1.0] range.", + fn_name, param_name, viewport.maxDepth); + } } + return skip; } @@ -924,6 +1301,25 @@ if (pCreateInfos != nullptr) { for (uint32_t i = 0; i < createInfoCount; ++i) { + bool has_dynamic_viewport = false; + bool has_dynamic_scissor = false; + bool has_dynamic_line_width = false; + bool has_dynamic_viewport_w_scaling_nv = false; + bool has_dynamic_discard_rectangle_ext = false; + bool has_dynamic_sample_locations_ext = false; + if (pCreateInfos[i].pDynamicState != nullptr) { + const auto &dynamic_state_info = *pCreateInfos[i].pDynamicState; + for (uint32_t state_index = 0; state_index < dynamic_state_info.dynamicStateCount; ++state_index) { + const auto &dynamic_state = dynamic_state_info.pDynamicStates[state_index]; + if (dynamic_state == VK_DYNAMIC_STATE_VIEWPORT) has_dynamic_viewport = true; + if (dynamic_state == VK_DYNAMIC_STATE_SCISSOR) has_dynamic_scissor = true; + if (dynamic_state == VK_DYNAMIC_STATE_LINE_WIDTH) has_dynamic_line_width = true; + if (dynamic_state == VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV) has_dynamic_viewport_w_scaling_nv = true; + if (dynamic_state == VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT) has_dynamic_discard_rectangle_ext = true; + if (dynamic_state == VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT) has_dynamic_sample_locations_ext = true; + } + } + // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml if (pCreateInfos[i].pVertexInputState != nullptr) { auto const &vertex_input_state = pCreateInfos[i].pVertexInputState; @@ -931,22 +1327,20 @@ auto const &vertex_bind_desc = vertex_input_state->pVertexBindingDescriptions[d]; if (vertex_bind_desc.binding >= device_data->device_limits.maxVertexInputBindings) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_14c004d4, LayerName, + VALIDATION_ERROR_14c004d4, "vkCreateGraphicsPipelines: parameter " "pCreateInfos[%u].pVertexInputState->pVertexBindingDescriptions[%u].binding (%u) is " - "greater than or equal to VkPhysicalDeviceLimits::maxVertexInputBindings (%u). %s", - i, d, vertex_bind_desc.binding, device_data->device_limits.maxVertexInputBindings, - validation_error_map[VALIDATION_ERROR_14c004d4]); + "greater than or equal to VkPhysicalDeviceLimits::maxVertexInputBindings (%u).", + i, d, vertex_bind_desc.binding, device_data->device_limits.maxVertexInputBindings); } if (vertex_bind_desc.stride > device_data->device_limits.maxVertexInputBindingStride) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_14c004d6, LayerName, + VALIDATION_ERROR_14c004d6, "vkCreateGraphicsPipelines: parameter " "pCreateInfos[%u].pVertexInputState->pVertexBindingDescriptions[%u].stride (%u) is greater " - "than VkPhysicalDeviceLimits::maxVertexInputBindingStride (%u). %s", - i, d, vertex_bind_desc.stride, device_data->device_limits.maxVertexInputBindingStride, - validation_error_map[VALIDATION_ERROR_14c004d6]); + "than VkPhysicalDeviceLimits::maxVertexInputBindingStride (%u).", + i, d, vertex_bind_desc.stride, device_data->device_limits.maxVertexInputBindingStride); } } @@ -954,32 +1348,29 @@ auto const &vertex_attrib_desc = vertex_input_state->pVertexAttributeDescriptions[d]; if (vertex_attrib_desc.location >= device_data->device_limits.maxVertexInputAttributes) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_14a004d8, LayerName, + VALIDATION_ERROR_14a004d8, "vkCreateGraphicsPipelines: parameter " "pCreateInfos[%u].pVertexInputState->pVertexAttributeDescriptions[%u].location (%u) is " - "greater than or equal to VkPhysicalDeviceLimits::maxVertexInputAttributes (%u). %s", - i, d, vertex_attrib_desc.location, device_data->device_limits.maxVertexInputAttributes, - validation_error_map[VALIDATION_ERROR_14a004d8]); + "greater than or equal to VkPhysicalDeviceLimits::maxVertexInputAttributes (%u).", + i, d, vertex_attrib_desc.location, device_data->device_limits.maxVertexInputAttributes); } if (vertex_attrib_desc.binding >= device_data->device_limits.maxVertexInputBindings) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_14a004da, LayerName, + VALIDATION_ERROR_14a004da, "vkCreateGraphicsPipelines: parameter " "pCreateInfos[%u].pVertexInputState->pVertexAttributeDescriptions[%u].binding (%u) is " - "greater than or equal to VkPhysicalDeviceLimits::maxVertexInputBindings (%u). %s", - i, d, vertex_attrib_desc.binding, device_data->device_limits.maxVertexInputBindings, - validation_error_map[VALIDATION_ERROR_14a004da]); + "greater than or equal to VkPhysicalDeviceLimits::maxVertexInputBindings (%u).", + i, d, vertex_attrib_desc.binding, device_data->device_limits.maxVertexInputBindings); } if (vertex_attrib_desc.offset > device_data->device_limits.maxVertexInputAttributeOffset) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_14a004dc, LayerName, + VALIDATION_ERROR_14a004dc, "vkCreateGraphicsPipelines: parameter " "pCreateInfos[%u].pVertexInputState->pVertexAttributeDescriptions[%u].offset (%u) is " - "greater than VkPhysicalDeviceLimits::maxVertexInputAttributeOffset (%u). %s", - i, d, vertex_attrib_desc.offset, device_data->device_limits.maxVertexInputAttributeOffset, - validation_error_map[VALIDATION_ERROR_14a004dc]); + "greater than VkPhysicalDeviceLimits::maxVertexInputAttributeOffset (%u).", + i, d, vertex_attrib_desc.offset, device_data->device_limits.maxVertexInputAttributeOffset); } } } @@ -1000,11 +1391,11 @@ if (has_control && has_eval) { if (pCreateInfos[i].pTessellationState == nullptr) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_096005b6, LayerName, + VALIDATION_ERROR_096005b6, "vkCreateGraphicsPipelines: if pCreateInfos[%d].pStages includes a tessellation control " "shader stage and a tessellation evaluation shader stage, " - "pCreateInfos[%d].pTessellationState must not be NULL. %s", - i, i, validation_error_map[VALIDATION_ERROR_096005b6]); + "pCreateInfos[%d].pTessellationState must not be NULL.", + i, i); } else { skip |= validate_struct_pnext( report_data, "vkCreateGraphicsPipelines", @@ -1019,23 +1410,22 @@ if (pCreateInfos[i].pTessellationState->sType != VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_1082b00b, LayerName, + VALIDATION_ERROR_1082b00b, "vkCreateGraphicsPipelines: parameter pCreateInfos[%d].pTessellationState->sType must " - "be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO. %s", - i, validation_error_map[VALIDATION_ERROR_1082b00b]); + "be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO.", + i); } if (pCreateInfos[i].pTessellationState->patchControlPoints == 0 || pCreateInfos[i].pTessellationState->patchControlPoints > device_data->device_limits.maxTessellationPatchSize) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_1080097c, LayerName, + VALIDATION_ERROR_1080097c, "vkCreateGraphicsPipelines: invalid parameter " "pCreateInfos[%d].pTessellationState->patchControlPoints value %u. patchControlPoints " - "should be >0 and <=%u. %s", + "should be >0 and <=%u.", i, pCreateInfos[i].pTessellationState->patchControlPoints, - device_data->device_limits.maxTessellationPatchSize, - validation_error_map[VALIDATION_ERROR_1080097c]); + device_data->device_limits.maxTessellationPatchSize); } } } @@ -1045,131 +1435,173 @@ if ((pCreateInfos[i].pRasterizationState != nullptr) && (pCreateInfos[i].pRasterizationState->rasterizerDiscardEnable == VK_FALSE)) { if (pCreateInfos[i].pViewportState == nullptr) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_096005dc, LayerName, - "vkCreateGraphicsPipelines: if pCreateInfos[%d].pRasterizationState->rasterizerDiscardEnable " - "is VK_FALSE, pCreateInfos[%d].pViewportState must be a pointer to a valid " - "VkPipelineViewportStateCreateInfo structure. %s", - i, i, validation_error_map[VALIDATION_ERROR_096005dc]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, + VK_NULL_HANDLE, VALIDATION_ERROR_096005dc, + "vkCreateGraphicsPipelines: Rasterization is enabled (pCreateInfos[%" PRIu32 + "].pRasterizationState->rasterizerDiscardEnable is VK_FALSE), but pCreateInfos[%" PRIu32 + "].pViewportState (=NULL) is not a valid pointer.", + i, i); } else { - if (pCreateInfos[i].pViewportState->scissorCount != pCreateInfos[i].pViewportState->viewportCount) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_10c00988, LayerName, - "Graphics Pipeline viewport count (%u) must match scissor count (%u). %s", - pCreateInfos[i].pViewportState->viewportCount, pCreateInfos[i].pViewportState->scissorCount, - validation_error_map[VALIDATION_ERROR_10c00988]); + const auto &viewport_state = *pCreateInfos[i].pViewportState; + + if (viewport_state.sType != VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, + VK_NULL_HANDLE, VALIDATION_ERROR_10c2b00b, + "vkCreateGraphicsPipelines: pCreateInfos[%" PRIu32 + "].pViewportState->sType is not VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO.", + i); } + const VkStructureType allowed_structs_VkPipelineViewportStateCreateInfo[] = { + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV}; skip |= validate_struct_pnext( report_data, "vkCreateGraphicsPipelines", - ParameterName("pCreateInfos[%i].pViewportState->pNext", ParameterName::IndexVector{i}), NULL, - pCreateInfos[i].pViewportState->pNext, 0, NULL, GeneratedHeaderVersion, VALIDATION_ERROR_10c1c40d); + ParameterName("pCreateInfos[%i].pViewportState->pNext", ParameterName::IndexVector{i}), + "VkPipelineViewportSwizzleStateCreateInfoNV, VkPipelineViewportWScalingStateCreateInfoNV", + viewport_state.pNext, ARRAY_SIZE(allowed_structs_VkPipelineViewportStateCreateInfo), + allowed_structs_VkPipelineViewportStateCreateInfo, 65, VALIDATION_ERROR_10c1c40d); skip |= validate_reserved_flags( report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pViewportState->flags", ParameterName::IndexVector{i}), - pCreateInfos[i].pViewportState->flags, VALIDATION_ERROR_10c09005); + viewport_state.flags, VALIDATION_ERROR_10c09005); - if (pCreateInfos[i].pViewportState->sType != VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, INVALID_STRUCT_STYPE, LayerName, - "vkCreateGraphicsPipelines: parameter pCreateInfos[%d].pViewportState->sType must be " - "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO", - i); - } - - if (device_data->physical_device_features.multiViewport == false) { - if (pCreateInfos[i].pViewportState->viewportCount != 1) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_10c00980, LayerName, - "vkCreateGraphicsPipelines: The multiViewport feature is not enabled, so " - "pCreateInfos[%d].pViewportState->viewportCount must be 1 but is %d. %s", - i, pCreateInfos[i].pViewportState->viewportCount, - validation_error_map[VALIDATION_ERROR_10c00980]); + if (!device_data->physical_device_features.multiViewport) { + if (viewport_state.viewportCount != 1) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, + VK_NULL_HANDLE, VALIDATION_ERROR_10c00980, + "vkCreateGraphicsPipelines: The VkPhysicalDeviceFeatures::multiViewport feature is " + "disabled, but pCreateInfos[%" PRIu32 "].pViewportState->viewportCount (=%" PRIu32 + ") is not 1.", + i, viewport_state.viewportCount); } - if (pCreateInfos[i].pViewportState->scissorCount != 1) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_10c00982, LayerName, - "vkCreateGraphicsPipelines: The multiViewport feature is not enabled, so " - "pCreateInfos[%d].pViewportState->scissorCount must be 1 but is %d. %s", - i, pCreateInfos[i].pViewportState->scissorCount, - validation_error_map[VALIDATION_ERROR_10c00982]); + + if (viewport_state.scissorCount != 1) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, + VK_NULL_HANDLE, VALIDATION_ERROR_10c00982, + "vkCreateGraphicsPipelines: The VkPhysicalDeviceFeatures::multiViewport feature is " + "disabled, but pCreateInfos[%" PRIu32 "].pViewportState->scissorCount (=%" PRIu32 + ") is not 1.", + i, viewport_state.scissorCount); } - } else { - if ((pCreateInfos[i].pViewportState->viewportCount < 1) || - (pCreateInfos[i].pViewportState->viewportCount > device_data->device_limits.maxViewports)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_10c00984, LayerName, - "vkCreateGraphicsPipelines: multiViewport feature is enabled; " - "pCreateInfos[%d].pViewportState->viewportCount is %d but must be between 1 and " - "maxViewports (%d), inclusive. %s", - i, pCreateInfos[i].pViewportState->viewportCount, device_data->device_limits.maxViewports, - validation_error_map[VALIDATION_ERROR_10c00984]); + } else { // multiViewport enabled + if (viewport_state.viewportCount == 0) { + skip |= log_msg( + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, + VK_NULL_HANDLE, VALIDATION_ERROR_10c30a1b, + "vkCreateGraphicsPipelines: pCreateInfos[%" PRIu32 "].pViewportState->viewportCount is 0.", i); + } else if (viewport_state.viewportCount > device_data->device_limits.maxViewports) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, + VK_NULL_HANDLE, VALIDATION_ERROR_10c00984, + "vkCreateGraphicsPipelines: pCreateInfos[%" PRIu32 + "].pViewportState->viewportCount (=%" PRIu32 + ") is greater than VkPhysicalDeviceLimits::maxViewports (=%" PRIu32 ").", + i, viewport_state.viewportCount, device_data->device_limits.maxViewports); } - if ((pCreateInfos[i].pViewportState->scissorCount < 1) || - (pCreateInfos[i].pViewportState->scissorCount > device_data->device_limits.maxViewports)) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_10c00986, LayerName, - "vkCreateGraphicsPipelines: multiViewport feature is enabled; " - "pCreateInfos[%d].pViewportState->scissorCount is %d but must be between 1 and " - "maxViewports (%d), inclusive. %s", - i, pCreateInfos[i].pViewportState->scissorCount, device_data->device_limits.maxViewports, - validation_error_map[VALIDATION_ERROR_10c00986]); + + if (viewport_state.scissorCount == 0) { + skip |= log_msg( + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, + VK_NULL_HANDLE, VALIDATION_ERROR_10c2b61b, + "vkCreateGraphicsPipelines: pCreateInfos[%" PRIu32 "].pViewportState->scissorCount is 0.", i); + } else if (viewport_state.scissorCount > device_data->device_limits.maxViewports) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, + VK_NULL_HANDLE, VALIDATION_ERROR_10c00986, + "vkCreateGraphicsPipelines: pCreateInfos[%" PRIu32 + "].pViewportState->scissorCount (=%" PRIu32 + ") is greater than VkPhysicalDeviceLimits::maxViewports (=%" PRIu32 ").", + i, viewport_state.scissorCount, device_data->device_limits.maxViewports); } } - if (pCreateInfos[i].pDynamicState != nullptr) { - bool has_dynamic_viewport = false; - bool has_dynamic_scissor = false; - - for (uint32_t state_index = 0; state_index < pCreateInfos[i].pDynamicState->dynamicStateCount; - ++state_index) { - if (pCreateInfos[i].pDynamicState->pDynamicStates[state_index] == VK_DYNAMIC_STATE_VIEWPORT) { - has_dynamic_viewport = true; - } else if (pCreateInfos[i].pDynamicState->pDynamicStates[state_index] == VK_DYNAMIC_STATE_SCISSOR) { - has_dynamic_scissor = true; - } - } + if (viewport_state.scissorCount != viewport_state.viewportCount) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, + VK_NULL_HANDLE, VALIDATION_ERROR_10c00988, + "vkCreateGraphicsPipelines: pCreateInfos[%" PRIu32 "].pViewportState->scissorCount (=%" PRIu32 + ") is not identical to pCreateInfos[%" PRIu32 "].pViewportState->viewportCount (=%" PRIu32 ").", + i, viewport_state.scissorCount, i, viewport_state.viewportCount); + } - // If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_VIEWPORT, the pViewports - // member of pViewportState must be a pointer to an array of pViewportState->viewportCount VkViewport - // structures - if (!has_dynamic_viewport && (pCreateInfos[i].pViewportState->pViewports == nullptr)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_096005d6, LayerName, - "vkCreateGraphicsPipelines: if pCreateInfos[%d].pDynamicState->pDynamicStates does not " - "contain VK_DYNAMIC_STATE_VIEWPORT, pCreateInfos[%d].pViewportState->pViewports must " - "not be NULL. %s", - i, i, validation_error_map[VALIDATION_ERROR_096005d6]); - } + if (!has_dynamic_viewport && viewport_state.viewportCount > 0 && viewport_state.pViewports == nullptr) { + skip |= log_msg( + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, VK_NULL_HANDLE, + VALIDATION_ERROR_096005d6, + "vkCreateGraphicsPipelines: The viewport state is static (pCreateInfos[%" PRIu32 + "].pDynamicState->pDynamicStates does not contain VK_DYNAMIC_STATE_VIEWPORT), but pCreateInfos[%" PRIu32 + "].pViewportState->pViewports (=NULL) is an invalid pointer.", + i, i); + } - // If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_SCISSOR, the pScissors - // member - // of pViewportState must be a pointer to an array of pViewportState->scissorCount VkRect2D structures - if (!has_dynamic_scissor && (pCreateInfos[i].pViewportState->pScissors == nullptr)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_096005d8, LayerName, - "vkCreateGraphicsPipelines: if pCreateInfos[%d].pDynamicState->pDynamicStates does not " - "contain VK_DYNAMIC_STATE_SCISSOR, pCreateInfos[%d].pViewportState->pScissors must not " - "be NULL. %s", - i, i, validation_error_map[VALIDATION_ERROR_096005d8]); + if (!has_dynamic_scissor && viewport_state.scissorCount > 0 && viewport_state.pScissors == nullptr) { + skip |= log_msg( + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, VK_NULL_HANDLE, + VALIDATION_ERROR_096005d8, + "vkCreateGraphicsPipelines: The scissor state is static (pCreateInfos[%" PRIu32 + "].pDynamicState->pDynamicStates does not contain VK_DYNAMIC_STATE_SCISSOR), but pCreateInfos[%" PRIu32 + "].pViewportState->pScissors (=NULL) is an invalid pointer.", + i, i); + } + + // validate the VkViewports + if (!has_dynamic_viewport && viewport_state.pViewports) { + for (uint32_t viewport_i = 0; viewport_i < viewport_state.viewportCount; ++viewport_i) { + const auto &viewport = viewport_state.pViewports[viewport_i]; // will crash on invalid ptr + const char fn_name[] = "vkCreateGraphicsPipelines"; + const std::string param_name = "pCreateInfos[" + std::to_string(i) + "].pViewportState->pViewports[" + + std::to_string(viewport_i) + "]"; + skip |= pv_VkViewport(device_data, viewport, fn_name, param_name.c_str(), + VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT); } } + + if (has_dynamic_viewport_w_scaling_nv && !device_data->extensions.vk_nv_clip_space_w_scaling) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, + VK_NULL_HANDLE, EXTENSION_NOT_ENABLED, + "vkCreateGraphicsPipelines: pCreateInfos[%" PRIu32 + "].pDynamicState->pDynamicStates contains VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV, but " + "VK_NV_clip_space_w_scaling extension is not enabled.", + i); + } + + if (has_dynamic_discard_rectangle_ext && !device_data->extensions.vk_ext_discard_rectangles) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, + VK_NULL_HANDLE, EXTENSION_NOT_ENABLED, + "vkCreateGraphicsPipelines: pCreateInfos[%" PRIu32 + "].pDynamicState->pDynamicStates contains VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT, but " + "VK_EXT_discard_rectangles extension is not enabled.", + i); + } + + if (has_dynamic_sample_locations_ext && !device_data->extensions.vk_ext_sample_locations) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, + VK_NULL_HANDLE, EXTENSION_NOT_ENABLED, + "vkCreateGraphicsPipelines: pCreateInfos[%" PRIu32 + "].pDynamicState->pDynamicStates contains VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, but " + "VK_EXT_sample_locations extension is not enabled.", + i); + } } if (pCreateInfos[i].pMultisampleState == nullptr) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_096005de, LayerName, + VALIDATION_ERROR_096005de, "vkCreateGraphicsPipelines: if pCreateInfos[%d].pRasterizationState->rasterizerDiscardEnable " - "is VK_FALSE, pCreateInfos[%d].pMultisampleState must not be NULL. %s", - i, i, validation_error_map[VALIDATION_ERROR_096005de]); + "is VK_FALSE, pCreateInfos[%d].pMultisampleState must not be NULL.", + i, i); } else { + const VkStructureType valid_next_stypes[] = {LvlTypeMap::kSType, + LvlTypeMap::kSType, + LvlTypeMap::kSType}; + const char *valid_struct_names = + "VkPipelineCoverageModulationStateCreateInfoNV, VkPipelineCoverageToColorStateCreateInfoNV, " + "VkPipelineSampleLocationsStateCreateInfoEXT"; skip |= validate_struct_pnext( report_data, "vkCreateGraphicsPipelines", - ParameterName("pCreateInfos[%i].pMultisampleState->pNext", ParameterName::IndexVector{i}), NULL, - pCreateInfos[i].pMultisampleState->pNext, 0, NULL, GeneratedHeaderVersion, VALIDATION_ERROR_1001c40d); + ParameterName("pCreateInfos[%i].pMultisampleState->pNext", ParameterName::IndexVector{i}), + valid_struct_names, pCreateInfos[i].pMultisampleState->pNext, 3, valid_next_stypes, GeneratedHeaderVersion, + VALIDATION_ERROR_1001c40d); skip |= validate_reserved_flags( report_data, "vkCreateGraphicsPipelines", @@ -1185,7 +1617,7 @@ report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pMultisampleState->rasterizationSamples", ParameterName::IndexVector{i}), ParameterName("pCreateInfos[%i].pMultisampleState->pSampleMask", ParameterName::IndexVector{i}), - pCreateInfos[i].pMultisampleState->rasterizationSamples, pCreateInfos[i].pMultisampleState->pSampleMask, + pCreateInfos[i].pMultisampleState->rasterizationSamples, &pCreateInfos[i].pMultisampleState->pSampleMask, true, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); skip |= validate_bool32( @@ -1200,15 +1632,44 @@ if (pCreateInfos[i].pMultisampleState->sType != VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, INVALID_STRUCT_STYPE, LayerName, + INVALID_STRUCT_STYPE, "vkCreateGraphicsPipelines: parameter pCreateInfos[%d].pMultisampleState->sType must be " "VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO", i); } + if (pCreateInfos[i].pMultisampleState->sampleShadingEnable == VK_TRUE) { + if (!device_data->physical_device_features.sampleRateShading) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_10000620, + "vkCreateGraphicsPipelines(): parameter " + "pCreateInfos[%d].pMultisampleState->sampleShadingEnable.", + i); + } + // TODO Add documentation issue about when minSampleShading must be in range and when it is ignored + // For now a "least noise" test *only* when sampleShadingEnable is VK_TRUE. + if (!in_inclusive_range(pCreateInfos[i].pMultisampleState->minSampleShading, 0.F, 1.0F)) { + skip |= log_msg( + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_10000624, + "vkCreateGraphicsPipelines(): parameter pCreateInfos[%d].pMultisampleState->minSampleShading.", i); + } + } } - // TODO: Conditional NULL check based on subpass depth/stencil attachment - if (pCreateInfos[i].pDepthStencilState != nullptr) { + bool uses_color_attachment = false; + bool uses_depthstencil_attachment = false; + { + const auto subpasses_uses_it = device_data->renderpasses_states.find(pCreateInfos[i].renderPass); + if (subpasses_uses_it != device_data->renderpasses_states.end()) { + const auto &subpasses_uses = subpasses_uses_it->second; + if (subpasses_uses.subpasses_using_color_attachment.count(pCreateInfos[i].subpass)) + uses_color_attachment = true; + if (subpasses_uses.subpasses_using_depthstencil_attachment.count(pCreateInfos[i].subpass)) + uses_depthstencil_attachment = true; + } + } + + if (pCreateInfos[i].pDepthStencilState != nullptr && uses_depthstencil_attachment) { skip |= validate_struct_pnext( report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pDepthStencilState->pNext", ParameterName::IndexVector{i}), NULL, @@ -1295,15 +1756,14 @@ if (pCreateInfos[i].pDepthStencilState->sType != VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, INVALID_STRUCT_STYPE, LayerName, + INVALID_STRUCT_STYPE, "vkCreateGraphicsPipelines: parameter pCreateInfos[%d].pDepthStencilState->sType must be " "VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO", i); } } - // TODO: Conditional NULL check based on subpass color attachment - if (pCreateInfos[i].pColorBlendState != nullptr) { + if (pCreateInfos[i].pColorBlendState != nullptr && uses_color_attachment) { skip |= validate_struct_pnext( report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pColorBlendState->pNext", ParameterName::IndexVector{i}), NULL, @@ -1323,7 +1783,7 @@ report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pColorBlendState->attachmentCount", ParameterName::IndexVector{i}), ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments", ParameterName::IndexVector{i}), - pCreateInfos[i].pColorBlendState->attachmentCount, pCreateInfos[i].pColorBlendState->pAttachments, false, + pCreateInfos[i].pColorBlendState->attachmentCount, &pCreateInfos[i].pColorBlendState->pAttachments, false, true, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); if (pCreateInfos[i].pColorBlendState->pAttachments != NULL) { @@ -1394,7 +1854,7 @@ if (pCreateInfos[i].pColorBlendState->sType != VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, INVALID_STRUCT_STYPE, LayerName, + INVALID_STRUCT_STYPE, "vkCreateGraphicsPipelines: parameter pCreateInfos[%d].pColorBlendState->sType must be " "VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO", i); @@ -1409,57 +1869,51 @@ } } } - } - if (pCreateInfos != nullptr) { - if (pCreateInfos->flags & VK_PIPELINE_CREATE_DERIVATIVE_BIT) { - if (pCreateInfos->basePipelineIndex != -1) { - if (pCreateInfos->basePipelineHandle != VK_NULL_HANDLE) { - skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_096005a8, LayerName, - "vkCreateGraphicsPipelines parameter, pCreateInfos->basePipelineHandle, must be VK_NULL_HANDLE if " - "pCreateInfos->flags " - "contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag and pCreateInfos->basePipelineIndex is not -1. %s", - validation_error_map[VALIDATION_ERROR_096005a8]); + if (pCreateInfos[i].flags & VK_PIPELINE_CREATE_DERIVATIVE_BIT) { + if (pCreateInfos[i].basePipelineIndex != -1) { + if (pCreateInfos[i].basePipelineHandle != VK_NULL_HANDLE) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_096005a8, + "vkCreateGraphicsPipelines parameter, pCreateInfos->basePipelineHandle, must be " + "VK_NULL_HANDLE if pCreateInfos->flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag " + "and pCreateInfos->basePipelineIndex is not -1."); } } - if (pCreateInfos->basePipelineHandle != VK_NULL_HANDLE) { - if (pCreateInfos->basePipelineIndex != -1) { - skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_096005aa, LayerName, - "vkCreateGraphicsPipelines parameter, pCreateInfos->basePipelineIndex, must be -1 if " - "pCreateInfos->flags " - "contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag and pCreateInfos->basePipelineHandle is not " - "VK_NULL_HANDLE. %s", - validation_error_map[VALIDATION_ERROR_096005aa]); + if (pCreateInfos[i].basePipelineHandle != VK_NULL_HANDLE) { + if (pCreateInfos[i].basePipelineIndex != -1) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_096005aa, + "vkCreateGraphicsPipelines parameter, pCreateInfos->basePipelineIndex, must be -1 if " + "pCreateInfos->flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag and " + "pCreateInfos->basePipelineHandle is not VK_NULL_HANDLE."); } } } - if (pCreateInfos->pRasterizationState != nullptr) { - if (pCreateInfos->pRasterizationState->cullMode & ~VK_CULL_MODE_FRONT_AND_BACK) { - skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - UNRECOGNIZED_VALUE, LayerName, - "vkCreateGraphicsPipelines parameter, VkCullMode pCreateInfos->pRasterizationState->cullMode, is an " - "unrecognized enumerator"); + if (pCreateInfos[i].pRasterizationState) { + if ((pCreateInfos[i].pRasterizationState->polygonMode != VK_POLYGON_MODE_FILL) && + (device_data->physical_device_features.fillModeNonSolid == false)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + DEVICE_FEATURE, + "vkCreateGraphicsPipelines parameter, VkPolygonMode " + "pCreateInfos->pRasterizationState->polygonMode cannot be VK_POLYGON_MODE_POINT or " + "VK_POLYGON_MODE_LINE if VkPhysicalDeviceFeatures->fillModeNonSolid is false."); } - if ((pCreateInfos->pRasterizationState->polygonMode != VK_POLYGON_MODE_FILL) && - (device_data->physical_device_features.fillModeNonSolid == false)) { - skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - DEVICE_FEATURE, LayerName, - "vkCreateGraphicsPipelines parameter, VkPolygonMode pCreateInfos->pRasterizationState->polygonMode cannot " - "be " - "VK_POLYGON_MODE_POINT or VK_POLYGON_MODE_LINE if VkPhysicalDeviceFeatures->fillModeNonSolid is false."); + if (!has_dynamic_line_width && !device_data->physical_device_features.wideLines && + (pCreateInfos[i].pRasterizationState->lineWidth != 1.0f)) { + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, 0, VALIDATION_ERROR_096005da, + "The line width state is static (pCreateInfos[%" PRIu32 + "].pDynamicState->pDynamicStates does not contain VK_DYNAMIC_STATE_LINE_WIDTH) and " + "VkPhysicalDeviceFeatures::wideLines is disabled, but pCreateInfos[%" PRIu32 + "].pRasterizationState->lineWidth (=%f) is not 1.0.", + i, i, pCreateInfos[i].pRasterizationState->lineWidth); } } - size_t i = 0; for (size_t j = 0; j < pCreateInfos[i].stageCount; j++) { skip |= validate_string(device_data->report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pStages[%i].pName", ParameterName::IndexVector{i, j}), @@ -1493,12 +1947,32 @@ debug_report_data *report_data = device_data->report_data; if (pCreateInfo != nullptr) { - if ((device_data->physical_device_features.samplerAnisotropy == false) && (pCreateInfo->maxAnisotropy != 1.0)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - DEVICE_FEATURE, LayerName, - "vkCreateSampler(): The samplerAnisotropy feature was not enabled at device-creation time, so the " - "maxAnisotropy member of the VkSamplerCreateInfo structure must be 1.0 but is %f.", - pCreateInfo->maxAnisotropy); + const auto &features = device_data->physical_device_features; + const auto &limits = device_data->device_limits; + if (pCreateInfo->anisotropyEnable == VK_TRUE) { + if (!in_inclusive_range(pCreateInfo->maxAnisotropy, 1.0F, limits.maxSamplerAnisotropy)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_1260085e, + "vkCreateSampler(): value of %s must be in range [1.0, %f] %s, but %f found.", + "pCreateInfo->maxAnisotropy", limits.maxSamplerAnisotropy, + "VkPhysicalDeviceLimits::maxSamplerAnistropy", pCreateInfo->maxAnisotropy); + } + + // Anistropy cannot be enabled in sampler unless enabled as a feature + if (features.samplerAnisotropy == VK_FALSE) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_1260085c, + "vkCreateSampler(): Anisotropic sampling feature is not enabled, %s must be VK_FALSE.", + "pCreateInfo->anisotropyEnable"); + } + + // Anistropy and unnormalized coordinates cannot be enabled simultaneously + if (pCreateInfo->unnormalizedCoordinates == VK_TRUE) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_12600868, + "vkCreateSampler(): pCreateInfo->anisotropyEnable and pCreateInfo->unnormalizedCoordinates must " + "not both be VK_TRUE."); + } } // If compareEnable is VK_TRUE, compareOp must be a valid VkCompareOp value @@ -1522,12 +1996,21 @@ ((pCreateInfo->addressModeU == VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE) || (pCreateInfo->addressModeV == VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE) || (pCreateInfo->addressModeW == VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE))) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_1260086e, LayerName, - "vkCreateSampler(): A VkSamplerAddressMode value is set to VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE " - "but the VK_KHR_sampler_mirror_clamp_to_edge extension has not been enabled. %s", - validation_error_map[VALIDATION_ERROR_1260086e]); + skip |= log_msg( + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, VALIDATION_ERROR_1260086e, + "vkCreateSampler(): A VkSamplerAddressMode value is set to VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE " + "but the VK_KHR_sampler_mirror_clamp_to_edge extension has not been enabled."); + } + + // Checks for the IMG cubic filtering extension + if (device_data->extensions.vk_img_filter_cubic) { + if ((pCreateInfo->anisotropyEnable == VK_TRUE) && + ((pCreateInfo->minFilter == VK_FILTER_CUBIC_IMG) || (pCreateInfo->magFilter == VK_FILTER_CUBIC_IMG))) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_12600872, + "vkCreateSampler(): Anisotropic sampling must not be VK_TRUE when either minFilter or magFilter " + "are VK_FILTER_CUBIC_IMG."); + } } } @@ -1554,10 +2037,9 @@ ++descriptor_index) { if (pCreateInfo->pBindings[i].pImmutableSamplers[descriptor_index] == VK_NULL_HANDLE) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, REQUIRED_PARAMETER, LayerName, + REQUIRED_PARAMETER, "vkCreateDescriptorSetLayout: required parameter " - "pCreateInfo->pBindings[%d].pImmutableSamplers[%d]" - " specified as VK_NULL_HANDLE", + "pCreateInfo->pBindings[%d].pImmutableSamplers[%d] specified as VK_NULL_HANDLE", i, descriptor_index); } } @@ -1566,12 +2048,12 @@ // If descriptorCount is not 0, stageFlags must be a valid combination of VkShaderStageFlagBits values if ((pCreateInfo->pBindings[i].stageFlags != 0) && ((pCreateInfo->pBindings[i].stageFlags & (~AllVkShaderStageFlagBits)) != 0)) { - skip |= log_msg( - report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_04e00236, LayerName, - "vkCreateDescriptorSetLayout(): if pCreateInfo->pBindings[%d].descriptorCount is not 0, " - "pCreateInfo->pBindings[%d].stageFlags must be a valid combination of VkShaderStageFlagBits values. %s", - i, i, validation_error_map[VALIDATION_ERROR_04e00236]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_04e00236, + "vkCreateDescriptorSetLayout(): if pCreateInfo->pBindings[%d].descriptorCount is not 0, " + "pCreateInfo->pBindings[%d].stageFlags must be a valid combination of VkShaderStageFlagBits " + "values.", + i, i); } } } @@ -1590,7 +2072,7 @@ // This is an array of handles, where the elements are allowed to be VK_NULL_HANDLE, and does not require any validation beyond // validate_array() skip |= validate_array(report_data, "vkFreeDescriptorSets", "descriptorSetCount", "pDescriptorSets", descriptorSetCount, - pDescriptorSets, true, true, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + &pDescriptorSets, true, true, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); return skip; } @@ -1606,10 +2088,9 @@ // descriptorCount must be greater than 0 if (pDescriptorWrites[i].descriptorCount == 0) { skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_15c0441b, LayerName, - "vkUpdateDescriptorSets(): parameter pDescriptorWrites[%d].descriptorCount must be greater than 0. %s", - i, validation_error_map[VALIDATION_ERROR_15c0441b]); + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_15c0441b, + "vkUpdateDescriptorSets(): parameter pDescriptorWrites[%d].descriptorCount must be greater than 0.", i); } // dstSet must be a valid VkDescriptorSet handle @@ -1627,12 +2108,12 @@ // pImageInfo must be a pointer to an array of descriptorCount valid VkDescriptorImageInfo structures if (pDescriptorWrites[i].pImageInfo == nullptr) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_15c00284, LayerName, + VALIDATION_ERROR_15c00284, "vkUpdateDescriptorSets(): if pDescriptorWrites[%d].descriptorType is " "VK_DESCRIPTOR_TYPE_SAMPLER, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, " "VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE or " - "VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, pDescriptorWrites[%d].pImageInfo must not be NULL. %s", - i, i, validation_error_map[VALIDATION_ERROR_15c00284]); + "VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, pDescriptorWrites[%d].pImageInfo must not be NULL.", + i, i); } else if (pDescriptorWrites[i].descriptorType != VK_DESCRIPTOR_TYPE_SAMPLER) { // If descriptorType is VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, // VK_DESCRIPTOR_TYPE_STORAGE_IMAGE or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, the imageView and imageLayout @@ -1660,12 +2141,12 @@ // pointer to an array of descriptorCount valid VkDescriptorBufferInfo structures if (pDescriptorWrites[i].pBufferInfo == nullptr) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_15c00288, LayerName, + VALIDATION_ERROR_15c00288, "vkUpdateDescriptorSets(): if pDescriptorWrites[%d].descriptorType is " "VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, " "VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, " - "pDescriptorWrites[%d].pBufferInfo must not be NULL. %s", - i, i, validation_error_map[VALIDATION_ERROR_15c00288]); + "pDescriptorWrites[%d].pBufferInfo must not be NULL.", + i, i); } else { for (uint32_t descriptorIndex = 0; descriptorIndex < pDescriptorWrites[i].descriptorCount; ++descriptorIndex) { skip |= validate_required_handle(report_data, "vkUpdateDescriptorSets", @@ -1680,11 +2161,11 @@ // pTexelBufferView must be a pointer to an array of descriptorCount valid VkBufferView handles if (pDescriptorWrites[i].pTexelBufferView == nullptr) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_15c00286, LayerName, + VALIDATION_ERROR_15c00286, "vkUpdateDescriptorSets(): if pDescriptorWrites[%d].descriptorType is " "VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER or VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, " - "pDescriptorWrites[%d].pTexelBufferView must not be NULL. %s", - i, i, validation_error_map[VALIDATION_ERROR_15c00286]); + "pDescriptorWrites[%d].pTexelBufferView must not be NULL.", + i, i); } else { for (uint32_t descriptor_index = 0; descriptor_index < pDescriptorWrites[i].descriptorCount; ++descriptor_index) { @@ -1702,13 +2183,12 @@ for (uint32_t j = 0; j < pDescriptorWrites[i].descriptorCount; j++) { if (pDescriptorWrites[i].pBufferInfo != NULL) { if (SafeModulo(pDescriptorWrites[i].pBufferInfo[j].offset, uniformAlignment) != 0) { - skip |= log_msg( - device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, VALIDATION_ERROR_15c0028e, LayerName, - "vkUpdateDescriptorSets(): pDescriptorWrites[%d].pBufferInfo[%d].offset (0x%" PRIxLEAST64 - ") must be a multiple of device limit minUniformBufferOffsetAlignment 0x%" PRIxLEAST64 ". %s", - i, j, pDescriptorWrites[i].pBufferInfo[j].offset, uniformAlignment, - validation_error_map[VALIDATION_ERROR_15c0028e]); + skip |= + log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, VALIDATION_ERROR_15c0028e, + "vkUpdateDescriptorSets(): pDescriptorWrites[%d].pBufferInfo[%d].offset (0x%" PRIxLEAST64 + ") must be a multiple of device limit minUniformBufferOffsetAlignment 0x%" PRIxLEAST64 ".", + i, j, pDescriptorWrites[i].pBufferInfo[j].offset, uniformAlignment); } } } @@ -1718,13 +2198,12 @@ for (uint32_t j = 0; j < pDescriptorWrites[i].descriptorCount; j++) { if (pDescriptorWrites[i].pBufferInfo != NULL) { if (SafeModulo(pDescriptorWrites[i].pBufferInfo[j].offset, storageAlignment) != 0) { - skip |= log_msg( - device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, VALIDATION_ERROR_15c00290, LayerName, - "vkUpdateDescriptorSets(): pDescriptorWrites[%d].pBufferInfo[%d].offset (0x%" PRIxLEAST64 - ") must be a multiple of device limit minStorageBufferOffsetAlignment 0x%" PRIxLEAST64 ". %s", - i, j, pDescriptorWrites[i].pBufferInfo[j].offset, storageAlignment, - validation_error_map[VALIDATION_ERROR_15c00290]); + skip |= + log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, VALIDATION_ERROR_15c00290, + "vkUpdateDescriptorSets(): pDescriptorWrites[%d].pBufferInfo[%d].offset (0x%" PRIxLEAST64 + ") must be a multiple of device limit minStorageBufferOffsetAlignment 0x%" PRIxLEAST64 ".", + i, j, pDescriptorWrites[i].pBufferInfo[j].offset, storageAlignment); } } } @@ -1743,28 +2222,25 @@ for (uint32_t i = 0; i < pCreateInfo->attachmentCount; ++i) { if (pCreateInfo->pAttachments[i].format == VK_FORMAT_UNDEFINED) { std::stringstream ss; - ss << "vkCreateRenderPass: pCreateInfo->pAttachments[" << i << "].format is VK_FORMAT_UNDEFINED. " - << validation_error_map[VALIDATION_ERROR_00809201]; + ss << "vkCreateRenderPass: pCreateInfo->pAttachments[" << i << "].format is VK_FORMAT_UNDEFINED. "; skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_00809201, "IMAGE", "%s", ss.str().c_str()); + VALIDATION_ERROR_00809201, "%s", ss.str().c_str()); } if (pCreateInfo->pAttachments[i].finalLayout == VK_IMAGE_LAYOUT_UNDEFINED || pCreateInfo->pAttachments[i].finalLayout == VK_IMAGE_LAYOUT_PREINITIALIZED) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_00800696, "DL", + VALIDATION_ERROR_00800696, "pCreateInfo->pAttachments[%d].finalLayout must not be VK_IMAGE_LAYOUT_UNDEFINED or " - "VK_IMAGE_LAYOUT_PREINITIALIZED. %s", - i, validation_error_map[VALIDATION_ERROR_00800696]); + "VK_IMAGE_LAYOUT_PREINITIALIZED.", + i); } } for (uint32_t i = 0; i < pCreateInfo->subpassCount; ++i) { if (pCreateInfo->pSubpasses[i].colorAttachmentCount > max_color_attachments) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_1400069a, "DL", - "Cannot create a render pass with %d color attachments. Max is %d. %s", - pCreateInfo->pSubpasses[i].colorAttachmentCount, max_color_attachments, - validation_error_map[VALIDATION_ERROR_1400069a]); + VALIDATION_ERROR_1400069a, "Cannot create a render pass with %d color attachments. Max is %d.", + pCreateInfo->pSubpasses[i].colorAttachmentCount, max_color_attachments); } } return skip; @@ -1780,7 +2256,7 @@ // This is an array of handles, where the elements are allowed to be VK_NULL_HANDLE, and does not require any validation beyond // validate_array() skip |= validate_array(report_data, "vkFreeCommandBuffers", "commandBufferCount", "pCommandBuffers", commandBufferCount, - pCommandBuffers, true, true, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + &pCommandBuffers, true, true, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); return skip; } @@ -1817,10 +2293,9 @@ if (pInfo != NULL) { if ((device_data->physical_device_features.inheritedQueries == VK_FALSE) && (pInfo->occlusionQueryEnable != VK_FALSE)) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - HandleToUint64(commandBuffer), __LINE__, VALIDATION_ERROR_02a00070, LayerName, + HandleToUint64(commandBuffer), VALIDATION_ERROR_02a00070, "Cannot set inherited occlusionQueryEnable in vkBeginCommandBuffer() when device does not support " - "inheritedQueries. %s", - validation_error_map[VALIDATION_ERROR_02a00070]); + "inheritedQueries."); } if ((device_data->physical_device_features.inheritedQueries != VK_FALSE) && (pInfo->occlusionQueryEnable != VK_FALSE)) { skip |= validate_flags(device_data->report_data, "vkBeginCommandBuffer", "pBeginInfo->pInheritanceInfo->queryFlags", @@ -1837,139 +2312,124 @@ bool skip = false; layer_data *device_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); - skip |= validate_array(device_data->report_data, "vkCmdSetViewport", "viewportCount", "pViewports", viewportCount, pViewports, - true, true, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + if (!device_data->physical_device_features.multiViewport) { + if (firstViewport != 0) { + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_1e000990, + "vkCmdSetViewport: The multiViewport feature is disabled, but firstViewport (=%" PRIu32 ") is not 0.", + firstViewport); + } + if (viewportCount > 1) { + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_1e000992, + "vkCmdSetViewport: The multiViewport feature is disabled, but viewportCount (=%" PRIu32 ") is not 1.", + viewportCount); + } + } else { // multiViewport enabled + const uint64_t sum = static_cast(firstViewport) + static_cast(viewportCount); + if (sum > device_data->device_limits.maxViewports) { + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_1e00098e, + "vkCmdSetViewport: firstViewport + viewportCount (=%" PRIu32 " + %" PRIu32 " = %" PRIu64 + ") is greater than VkPhysicalDeviceLimits::maxViewports (=%" PRIu32 ").", + firstViewport, viewportCount, sum, device_data->device_limits.maxViewports); + } + } - if (viewportCount > 0 && pViewports != nullptr) { - const VkPhysicalDeviceLimits &limits = device_data->device_limits; - for (uint32_t viewportIndex = 0; viewportIndex < viewportCount; ++viewportIndex) { - const VkViewport &viewport = pViewports[viewportIndex]; + if (pViewports) { + for (uint32_t viewport_i = 0; viewport_i < viewportCount; ++viewport_i) { + const auto &viewport = pViewports[viewport_i]; // will crash on invalid ptr + const char fn_name[] = "vkCmdSetViewport"; + const std::string param_name = "pViewports[" + std::to_string(viewport_i) + "]"; + skip |= pv_VkViewport(device_data, viewport, fn_name, param_name.c_str(), + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, HandleToUint64(commandBuffer)); + } + } - if (device_data->physical_device_features.multiViewport == false) { - if (viewportCount != 1) { - skip |= log_msg( - device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, DEVICE_FEATURE, LayerName, - "vkCmdSetViewport(): The multiViewport feature is not enabled, so viewportCount must be 1 but is %d.", - viewportCount); - } - if (firstViewport != 0) { - skip |= log_msg( - device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, DEVICE_FEATURE, LayerName, - "vkCmdSetViewport(): The multiViewport feature is not enabled, so firstViewport must be 0 but is %d.", - firstViewport); - } - } + return skip; +} - if (viewport.width <= 0 || viewport.width > limits.maxViewportDimensions[0]) { - skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_15000996, LayerName, - "vkCmdSetViewport %d: width (%f) exceeds permitted bounds (0,%u). %s", viewportIndex, - viewport.width, limits.maxViewportDimensions[0], validation_error_map[VALIDATION_ERROR_15000996]); - } +bool pv_vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D *pScissors) { + bool skip = false; + layer_data *device_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + debug_report_data *report_data = device_data->report_data; - if (device_data->extensions.vk_amd_negative_viewport_height || device_data->extensions.vk_khr_maintenance1) { - // Check lower bound against negative viewport height instead of zero - if (viewport.height <= -(static_cast(limits.maxViewportDimensions[1])) || - (viewport.height > limits.maxViewportDimensions[1])) { - skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, VALIDATION_ERROR_1500099a, LayerName, - "vkCmdSetViewport %d: height (%f) exceeds permitted bounds (-%u,%u). %s", viewportIndex, - viewport.height, limits.maxViewportDimensions[1], limits.maxViewportDimensions[1], - validation_error_map[VALIDATION_ERROR_1500099a]); - } - } else { - if ((viewport.height <= 0) || (viewport.height > limits.maxViewportDimensions[1])) { - skip |= - log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_15000998, LayerName, - "vkCmdSetViewport %d: height (%f) exceeds permitted bounds (0,%u). %s", viewportIndex, - viewport.height, limits.maxViewportDimensions[1], validation_error_map[VALIDATION_ERROR_15000998]); - } - } + if (!device_data->physical_device_features.multiViewport) { + if (firstScissor != 0) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_1d8004a2, + "vkCmdSetScissor: The multiViewport feature is disabled, but firstScissor (=%" PRIu32 ") is not 0.", + firstScissor); + } + if (scissorCount > 1) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_1d8004a4, + "vkCmdSetScissor: The multiViewport feature is disabled, but scissorCount (=%" PRIu32 ") is not 1.", + scissorCount); + } + } else { // multiViewport enabled + const uint64_t sum = static_cast(firstScissor) + static_cast(scissorCount); + if (sum > device_data->device_limits.maxViewports) { + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_1d8004a0, + "vkCmdSetScissor: firstScissor + scissorCount (=%" PRIu32 " + %" PRIu32 " = %" PRIu64 + ") is greater than VkPhysicalDeviceLimits::maxViewports (=%" PRIu32 ").", + firstScissor, scissorCount, sum, device_data->device_limits.maxViewports); + } + } - if (viewport.x < limits.viewportBoundsRange[0] || viewport.x > limits.viewportBoundsRange[1]) { - skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_1500099e, LayerName, - "vkCmdSetViewport %d: x (%f) exceeds permitted bounds (%f,%f). %s", viewportIndex, viewport.x, - limits.viewportBoundsRange[0], limits.viewportBoundsRange[1], - validation_error_map[VALIDATION_ERROR_1500099e]); + if (pScissors) { + for (uint32_t scissor_i = 0; scissor_i < scissorCount; ++scissor_i) { + const auto &scissor = pScissors[scissor_i]; // will crash on invalid ptr + + if (scissor.offset.x < 0) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_1d8004a6, + "vkCmdSetScissor: pScissors[%" PRIu32 "].offset.x (=%" PRIi32 ") is negative.", scissor_i, + scissor.offset.x); } - if (viewport.y < limits.viewportBoundsRange[0] || viewport.y > limits.viewportBoundsRange[1]) { - skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_1500099e, LayerName, - "vkCmdSetViewport %d: y (%f) exceeds permitted bounds (%f,%f). %s", viewportIndex, viewport.y, - limits.viewportBoundsRange[0], limits.viewportBoundsRange[1], - validation_error_map[VALIDATION_ERROR_1500099e]); + if (scissor.offset.y < 0) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_1d8004a6, + "vkCmdSetScissor: pScissors[%" PRIu32 "].offset.y (=%" PRIi32 ") is negative.", scissor_i, + scissor.offset.y); } - if (viewport.x + viewport.width > limits.viewportBoundsRange[1]) { - skip |= - log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_150009a0, LayerName, - "vkCmdSetViewport %d: x (%f) + width (%f) exceeds permitted bound (%f). %s", viewportIndex, viewport.x, - viewport.width, limits.viewportBoundsRange[1], validation_error_map[VALIDATION_ERROR_150009a0]); + const int64_t x_sum = static_cast(scissor.offset.x) + static_cast(scissor.extent.width); + if (x_sum > INT32_MAX) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_1d8004a8, + "vkCmdSetScissor: offset.x + extent.width (=%" PRIi32 " + %" PRIu32 " = %" PRIi64 + ") of pScissors[%" PRIu32 "] will overflow int32_t.", + scissor.offset.x, scissor.extent.width, x_sum, scissor_i); } - if (viewport.y + viewport.height > limits.viewportBoundsRange[1]) { - skip |= - log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_150009a2, LayerName, - "vkCmdSetViewport %d: y (%f) + height (%f) exceeds permitted bound (%f). %s", viewportIndex, viewport.y, - viewport.height, limits.viewportBoundsRange[1], validation_error_map[VALIDATION_ERROR_150009a2]); + const int64_t y_sum = static_cast(scissor.offset.y) + static_cast(scissor.extent.height); + if (y_sum > INT32_MAX) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_1d8004aa, + "vkCmdSetScissor: offset.y + extent.height (=%" PRIi32 " + %" PRIu32 " = %" PRIi64 + ") of pScissors[%" PRIu32 "] will overflow int32_t.", + scissor.offset.y, scissor.extent.height, y_sum, scissor_i); } } } + return skip; } -bool pv_vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D *pScissors) { +bool pv_vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) { bool skip = false; layer_data *device_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); debug_report_data *report_data = device_data->report_data; - if (device_data->physical_device_features.multiViewport == false) { - if (scissorCount != 1) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - DEVICE_FEATURE, LayerName, - "vkCmdSetScissor(): The multiViewport feature is not enabled, so scissorCount must be 1 but is %d.", - scissorCount); - } - if (firstScissor != 0) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - DEVICE_FEATURE, LayerName, - "vkCmdSetScissor(): The multiViewport feature is not enabled, so firstScissor must be 0 but is %d.", - firstScissor); - } + if (!device_data->physical_device_features.wideLines && (lineWidth != 1.0f)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_1d600628, + "VkPhysicalDeviceFeatures::wideLines is disabled, but lineWidth (=%f) is not 1.0.", lineWidth); } - for (uint32_t scissorIndex = 0; scissorIndex < scissorCount; ++scissorIndex) { - const VkRect2D &pScissor = pScissors[scissorIndex]; - - if (pScissor.offset.x < 0) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_1d8004a6, LayerName, "vkCmdSetScissor %d: offset.x (%d) must not be negative. %s", - scissorIndex, pScissor.offset.x, validation_error_map[VALIDATION_ERROR_1d8004a6]); - } else if (static_cast(pScissor.extent.width) > (INT_MAX - pScissor.offset.x)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_1d8004a8, LayerName, - "vkCmdSetScissor %d: adding offset.x (%d) and extent.width (%u) will overflow. %s", scissorIndex, - pScissor.offset.x, pScissor.extent.width, validation_error_map[VALIDATION_ERROR_1d8004a8]); - } - - if (pScissor.offset.y < 0) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_1d8004a6, LayerName, "vkCmdSetScissor %d: offset.y (%d) must not be negative. %s", - scissorIndex, pScissor.offset.y, validation_error_map[VALIDATION_ERROR_1d8004a6]); - } else if (static_cast(pScissor.extent.height) > (INT_MAX - pScissor.offset.y)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_1d8004aa, LayerName, - "vkCmdSetScissor %d: adding offset.y (%d) and extent.height (%u) will overflow. %s", scissorIndex, - pScissor.offset.y, pScissor.extent.height, validation_error_map[VALIDATION_ERROR_1d8004aa]); - } - } return skip; } @@ -1981,14 +2441,14 @@ // TODO: Verify against Valid Usage section. I don't see a non-zero vertexCount listed, may need to add that and make // this an error or leave as is. skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, REQUIRED_PARAMETER, LayerName, "vkCmdDraw parameter, uint32_t vertexCount, is 0"); + REQUIRED_PARAMETER, "vkCmdDraw parameter, uint32_t vertexCount, is 0"); } if (instanceCount == 0) { // TODO: Verify against Valid Usage section. I don't see a non-zero instanceCount listed, may need to add that and make // this an error or leave as is. skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, REQUIRED_PARAMETER, LayerName, "vkCmdDraw parameter, uint32_t instanceCount, is 0"); + REQUIRED_PARAMETER, "vkCmdDraw parameter, uint32_t instanceCount, is 0"); } return skip; } @@ -1999,7 +2459,7 @@ if (!device_data->physical_device_features.multiDrawIndirect && ((count > 1))) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, DEVICE_FEATURE, LayerName, + DEVICE_FEATURE, "CmdDrawIndirect(): Device feature multiDrawIndirect disabled: count must be 0 or 1 but is %d", count); } return skip; @@ -2010,10 +2470,9 @@ bool skip = false; layer_data *device_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); if (!device_data->physical_device_features.multiDrawIndirect && ((count > 1))) { - skip |= - log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - DEVICE_FEATURE, LayerName, - "CmdDrawIndexedIndirect(): Device feature multiDrawIndirect disabled: count must be 0 or 1 but is %d", count); + skip |= log_msg( + device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, DEVICE_FEATURE, + "CmdDrawIndexedIndirect(): Device feature multiDrawIndirect disabled: count must be 0 or 1 but is %d", count); } return skip; } @@ -2023,22 +2482,24 @@ bool skip = false; layer_data *device_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + VkImageAspectFlags legal_aspect_flags = + VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT; + if (device_data->extensions.vk_khr_sampler_ycbcr_conversion) { + legal_aspect_flags |= (VK_IMAGE_ASPECT_PLANE_0_BIT_KHR | VK_IMAGE_ASPECT_PLANE_1_BIT_KHR | VK_IMAGE_ASPECT_PLANE_2_BIT_KHR); + } + if (pRegions != nullptr) { - if ((pRegions->srcSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | - VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { + if ((pRegions->srcSubresource.aspectMask & legal_aspect_flags) == 0) { skip |= log_msg( - device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_0a600c01, LayerName, - "vkCmdCopyImage() parameter, VkImageAspect pRegions->srcSubresource.aspectMask, is an unrecognized enumerator. %s", - validation_error_map[VALIDATION_ERROR_0a600c01]); + device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0a600c01, + "vkCmdCopyImage() parameter, VkImageAspect pRegions->srcSubresource.aspectMask, is an unrecognized enumerator."); } - if ((pRegions->dstSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | - VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { + if ((pRegions->dstSubresource.aspectMask & legal_aspect_flags) == 0) { skip |= log_msg( - device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_0a600c01, LayerName, - "vkCmdCopyImage() parameter, VkImageAspect pRegions->dstSubresource.aspectMask, is an unrecognized enumerator. %s", - validation_error_map[VALIDATION_ERROR_0a600c01]); + device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_0a600c01, + "vkCmdCopyImage() parameter, VkImageAspect pRegions->dstSubresource.aspectMask, is an unrecognized enumerator."); } } return skip; @@ -2049,19 +2510,23 @@ bool skip = false; layer_data *device_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + VkImageAspectFlags legal_aspect_flags = + VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT; + if (device_data->extensions.vk_khr_sampler_ycbcr_conversion) { + legal_aspect_flags |= (VK_IMAGE_ASPECT_PLANE_0_BIT_KHR | VK_IMAGE_ASPECT_PLANE_1_BIT_KHR | VK_IMAGE_ASPECT_PLANE_2_BIT_KHR); + } + if (pRegions != nullptr) { - if ((pRegions->srcSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | - VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { + if ((pRegions->srcSubresource.aspectMask & legal_aspect_flags) == 0) { skip |= log_msg( - device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - UNRECOGNIZED_VALUE, LayerName, + device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + UNRECOGNIZED_VALUE, "vkCmdBlitImage() parameter, VkImageAspect pRegions->srcSubresource.aspectMask, is an unrecognized enumerator"); } - if ((pRegions->dstSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | - VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { + if ((pRegions->dstSubresource.aspectMask & legal_aspect_flags) == 0) { skip |= log_msg( - device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - UNRECOGNIZED_VALUE, LayerName, + device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + UNRECOGNIZED_VALUE, "vkCmdBlitImage() parameter, VkImageAspect pRegions->dstSubresource.aspectMask, is an unrecognized enumerator"); } } @@ -2073,14 +2538,18 @@ bool skip = false; layer_data *device_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + VkImageAspectFlags legal_aspect_flags = + VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT; + if (device_data->extensions.vk_khr_sampler_ycbcr_conversion) { + legal_aspect_flags |= (VK_IMAGE_ASPECT_PLANE_0_BIT_KHR | VK_IMAGE_ASPECT_PLANE_1_BIT_KHR | VK_IMAGE_ASPECT_PLANE_2_BIT_KHR); + } + if (pRegions != nullptr) { - if ((pRegions->imageSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | - VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { - skip |= log_msg( - device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - UNRECOGNIZED_VALUE, LayerName, - "vkCmdCopyBufferToImage() parameter, VkImageAspect pRegions->imageSubresource.aspectMask, is an unrecognized " - "enumerator"); + if ((pRegions->imageSubresource.aspectMask & legal_aspect_flags) == 0) { + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + UNRECOGNIZED_VALUE, + "vkCmdCopyBufferToImage() parameter, VkImageAspect pRegions->imageSubresource.aspectMask, is an " + "unrecognized enumerator"); } } return skip; @@ -2091,11 +2560,16 @@ bool skip = false; layer_data *device_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + VkImageAspectFlags legal_aspect_flags = + VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT; + if (device_data->extensions.vk_khr_sampler_ycbcr_conversion) { + legal_aspect_flags |= (VK_IMAGE_ASPECT_PLANE_0_BIT_KHR | VK_IMAGE_ASPECT_PLANE_1_BIT_KHR | VK_IMAGE_ASPECT_PLANE_2_BIT_KHR); + } + if (pRegions != nullptr) { - if ((pRegions->imageSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | - VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { - log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - UNRECOGNIZED_VALUE, LayerName, + if ((pRegions->imageSubresource.aspectMask & legal_aspect_flags) == 0) { + log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + UNRECOGNIZED_VALUE, "vkCmdCopyImageToBuffer parameter, VkImageAspect pRegions->imageSubresource.aspectMask, is an unrecognized " "enumerator"); } @@ -2110,22 +2584,22 @@ if (dstOffset & 3) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_1e400048, LayerName, - "vkCmdUpdateBuffer() parameter, VkDeviceSize dstOffset (0x%" PRIxLEAST64 "), is not a multiple of 4. %s", - dstOffset, validation_error_map[VALIDATION_ERROR_1e400048]); + VALIDATION_ERROR_1e400048, + "vkCmdUpdateBuffer() parameter, VkDeviceSize dstOffset (0x%" PRIxLEAST64 "), is not a multiple of 4.", + dstOffset); } if ((dataSize <= 0) || (dataSize > 65536)) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_1e40004a, LayerName, + VALIDATION_ERROR_1e40004a, "vkCmdUpdateBuffer() parameter, VkDeviceSize dataSize (0x%" PRIxLEAST64 - "), must be greater than zero and less than or equal to 65536. %s", - dataSize, validation_error_map[VALIDATION_ERROR_1e40004a]); + "), must be greater than zero and less than or equal to 65536.", + dataSize); } else if (dataSize & 3) { - skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_1e40004c, LayerName, - "vkCmdUpdateBuffer() parameter, VkDeviceSize dataSize (0x%" PRIxLEAST64 "), is not a multiple of 4. %s", - dataSize, validation_error_map[VALIDATION_ERROR_1e40004c]); + skip |= + log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_1e40004c, + "vkCmdUpdateBuffer() parameter, VkDeviceSize dataSize (0x%" PRIxLEAST64 "), is not a multiple of 4.", dataSize); } return skip; } @@ -2136,23 +2610,22 @@ layer_data *device_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); if (dstOffset & 3) { - skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_1b400032, LayerName, - "vkCmdFillBuffer() parameter, VkDeviceSize dstOffset (0x%" PRIxLEAST64 "), is not a multiple of 4. %s", - dstOffset, validation_error_map[VALIDATION_ERROR_1b400032]); + skip |= + log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_1b400032, + "vkCmdFillBuffer() parameter, VkDeviceSize dstOffset (0x%" PRIxLEAST64 "), is not a multiple of 4.", dstOffset); } if (size != VK_WHOLE_SIZE) { if (size <= 0) { - skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_1b400034, LayerName, - "vkCmdFillBuffer() parameter, VkDeviceSize size (0x%" PRIxLEAST64 "), must be greater than zero. %s", - size, validation_error_map[VALIDATION_ERROR_1b400034]); + skip |= + log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_1b400034, + "vkCmdFillBuffer() parameter, VkDeviceSize size (0x%" PRIxLEAST64 "), must be greater than zero.", size); } else if (size & 3) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_1b400038, LayerName, - "vkCmdFillBuffer() parameter, VkDeviceSize size (0x%" PRIxLEAST64 "), is not a multiple of 4. %s", size, - validation_error_map[VALIDATION_ERROR_1b400038]); + VALIDATION_ERROR_1b400038, + "vkCmdFillBuffer() parameter, VkDeviceSize size (0x%" PRIxLEAST64 "), is not a multiple of 4.", size); } } return skip; @@ -2184,7 +2657,7 @@ instance_layer_data *local_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); bool skip = validate_array(local_data->report_data, "vkEnumerateDeviceExtensionProperties", "pPropertyCount", "pProperties", - pPropertyCount, pProperties, true, false, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_2761f401); + pPropertyCount, &pProperties, true, false, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_2761f401); if (skip) return VK_ERROR_VALIDATION_FAILED_EXT; return local_data->dispatch_table.EnumerateDeviceExtensionProperties(physicalDevice, NULL, pPropertyCount, pProperties); @@ -2193,9 +2666,8 @@ static bool require_device_extension(layer_data *device_data, bool flag, char const *function_name, char const *extension_name) { if (!flag) { return log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, EXTENSION_NOT_ENABLED, LayerName, - "%s() called even though the %s extension was not enabled for this VkDevice.", function_name, - extension_name); + EXTENSION_NOT_ENABLED, "%s() called even though the %s extension was not enabled for this VkDevice.", + function_name, extension_name); } return false; @@ -2207,21 +2679,22 @@ layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); debug_report_data *report_data = device_data->report_data; + const LogMiscParams log_misc{report_data, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, VK_NULL_HANDLE, + "vkCreateSwapchainKHR"}; + if (pCreateInfo != nullptr) { if ((device_data->physical_device_features.textureCompressionETC2 == false) && FormatIsCompressed_ETC2_EAC(pCreateInfo->imageFormat)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - DEVICE_FEATURE, LayerName, - "vkCreateSwapchainKHR(): Attempting to create swapchain VkImage with format %s. The " - "textureCompressionETC2 feature is not enabled: neither ETC2 nor EAC formats can be used to create " - "images.", - string_VkFormat(pCreateInfo->imageFormat)); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, DEVICE_FEATURE, + "vkCreateSwapchainKHR(): Attempting to create swapchain VkImage with format %s. The textureCompressionETC2 " + "feature is not enabled: neither ETC2 nor EAC formats can be used to create images.", + string_VkFormat(pCreateInfo->imageFormat)); } if ((device_data->physical_device_features.textureCompressionASTC_LDR == false) && FormatIsCompressed_ASTC_LDR(pCreateInfo->imageFormat)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - DEVICE_FEATURE, LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, DEVICE_FEATURE, "vkCreateSwapchainKHR(): Attempting to create swapchain VkImage with format %s. The " "textureCompressionASTC_LDR feature is not enabled: ASTC formats cannot be used to create images.", string_VkFormat(pCreateInfo->imageFormat)); @@ -2229,8 +2702,7 @@ if ((device_data->physical_device_features.textureCompressionBC == false) && FormatIsCompressed_BC(pCreateInfo->imageFormat)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - DEVICE_FEATURE, LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, DEVICE_FEATURE, "vkCreateSwapchainKHR(): Attempting to create swapchain VkImage with format %s. The " "textureCompressionBC feature is not enabled: BC compressed formats cannot be used to create images.", string_VkFormat(pCreateInfo->imageFormat)); @@ -2240,33 +2712,29 @@ if (pCreateInfo->imageSharingMode == VK_SHARING_MODE_CONCURRENT) { // If imageSharingMode is VK_SHARING_MODE_CONCURRENT, queueFamilyIndexCount must be greater than 1 if (pCreateInfo->queueFamilyIndexCount <= 1) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_146009fc, LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_146009fc, "vkCreateSwapchainKHR(): if pCreateInfo->imageSharingMode is VK_SHARING_MODE_CONCURRENT, " - "pCreateInfo->queueFamilyIndexCount must be greater than 1. %s", - validation_error_map[VALIDATION_ERROR_146009fc]); + "pCreateInfo->queueFamilyIndexCount must be greater than 1."); } // If imageSharingMode is VK_SHARING_MODE_CONCURRENT, pQueueFamilyIndices must be a pointer to an array of // queueFamilyIndexCount uint32_t values if (pCreateInfo->pQueueFamilyIndices == nullptr) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_146009fa, LayerName, + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_146009fa, "vkCreateSwapchainKHR(): if pCreateInfo->imageSharingMode is VK_SHARING_MODE_CONCURRENT, " "pCreateInfo->pQueueFamilyIndices must be a pointer to an array of " - "pCreateInfo->queueFamilyIndexCount uint32_t values. %s", - validation_error_map[VALIDATION_ERROR_146009fa]); + "pCreateInfo->queueFamilyIndexCount uint32_t values."); } else { - // TODO: Not in the spec VUs. Probably missing -- KhronosGroup/Vulkan-Docs#501. Update error codes when resolved. skip |= ValidateQueueFamilies(device_data, pCreateInfo->queueFamilyIndexCount, pCreateInfo->pQueueFamilyIndices, "vkCreateSwapchainKHR", "pCreateInfo->pQueueFamilyIndices", INVALID_USAGE, - INVALID_USAGE, false, "", ""); + INVALID_USAGE, false); } } - // imageArrayLayers must be greater than 0 - skip |= ValidateGreaterThan(report_data, "vkCreateSwapchainKHR", "pCreateInfo->imageArrayLayers", - pCreateInfo->imageArrayLayers, 0u); + skip |= ValidateGreaterThanZero(pCreateInfo->imageArrayLayers, "pCreateInfo->imageArrayLayers", VALIDATION_ERROR_146009f6, + log_misc); } return skip; @@ -2277,39 +2745,29 @@ layer_data *device_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); if (pPresentInfo && pPresentInfo->pNext) { - // Verify ext struct - struct std_header { - VkStructureType sType; - const void *pNext; - }; - std_header *pnext = (std_header *)pPresentInfo->pNext; - while (pnext) { - if (VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR == pnext->sType) { - // TODO: This and all other pNext extension dependencies should be added to code-generation - skip |= require_device_extension(device_data, device_data->extensions.vk_khr_incremental_present, - "vkQueuePresentKHR", VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME); - VkPresentRegionsKHR *present_regions = (VkPresentRegionsKHR *)pnext; - if (present_regions->swapchainCount != pPresentInfo->swapchainCount) { - skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, INVALID_USAGE, LayerName, - "QueuePresentKHR(): pPresentInfo->swapchainCount has a value of %i" - " but VkPresentRegionsKHR extension swapchainCount is %i. These values must be equal.", - pPresentInfo->swapchainCount, present_regions->swapchainCount); - } - skip |= validate_struct_pnext(device_data->report_data, "QueuePresentKHR", "pCreateInfo->pNext->pNext", NULL, - present_regions->pNext, 0, NULL, GeneratedHeaderVersion, VALIDATION_ERROR_1121c40d); - skip |= validate_array(device_data->report_data, "QueuePresentKHR", "pCreateInfo->pNext->swapchainCount", - "pCreateInfo->pNext->pRegions", present_regions->swapchainCount, present_regions->pRegions, - true, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); - for (uint32_t i = 0; i < present_regions->swapchainCount; ++i) { - skip |= - validate_array(device_data->report_data, "QueuePresentKHR", "pCreateInfo->pNext->pRegions[].rectangleCount", + const auto *present_regions = lvl_find_in_chain(pPresentInfo->pNext); + if (present_regions) { + // TODO: This and all other pNext extension dependencies should be added to code-generation + skip |= require_device_extension(device_data, device_data->extensions.vk_khr_incremental_present, "vkQueuePresentKHR", + VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME); + if (present_regions->swapchainCount != pPresentInfo->swapchainCount) { + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + INVALID_USAGE, + "QueuePresentKHR(): pPresentInfo->swapchainCount has a value of %i but VkPresentRegionsKHR " + "extension swapchainCount is %i. These values must be equal.", + pPresentInfo->swapchainCount, present_regions->swapchainCount); + } + skip |= validate_struct_pnext(device_data->report_data, "QueuePresentKHR", "pCreateInfo->pNext->pNext", NULL, + present_regions->pNext, 0, NULL, GeneratedHeaderVersion, VALIDATION_ERROR_1121c40d); + skip |= validate_array(device_data->report_data, "QueuePresentKHR", "pCreateInfo->pNext->swapchainCount", + "pCreateInfo->pNext->pRegions", present_regions->swapchainCount, &present_regions->pRegions, + true, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + for (uint32_t i = 0; i < present_regions->swapchainCount; ++i) { + skip |= validate_array(device_data->report_data, "QueuePresentKHR", "pCreateInfo->pNext->pRegions[].rectangleCount", "pCreateInfo->pNext->pRegions[].pRectangles", present_regions->pRegions[i].rectangleCount, - present_regions->pRegions[i].pRectangles, true, false, VALIDATION_ERROR_UNDEFINED, + &present_regions->pRegions[i].pRectangles, true, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); - } } - pnext = (std_header *)pnext->pNext; } } @@ -2324,9 +2782,7 @@ if (pCreateInfo->hwnd == nullptr) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_15a00a38, LayerName, - "vkCreateWin32SurfaceKHR(): hwnd must be a valid Win32 HWND but hwnd is NULL. %s", - validation_error_map[VALIDATION_ERROR_15a00a38]); + VALIDATION_ERROR_15a00a38, "vkCreateWin32SurfaceKHR(): hwnd must be a valid Win32 HWND but hwnd is NULL."); } return skip; @@ -2352,9 +2808,8 @@ if (pCreateInfo) { if (pCreateInfo->maxSets <= 0) { skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT, VK_NULL_HANDLE, __LINE__, VALIDATION_ERROR_0480025a, - LayerName, "vkCreateDescriptorPool(): pCreateInfo->maxSets is not greater than 0. %s", - validation_error_map[VALIDATION_ERROR_0480025a]); + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT, VK_NULL_HANDLE, VALIDATION_ERROR_0480025a, + "vkCreateDescriptorPool(): pCreateInfo->maxSets is not greater than 0."); } if (pCreateInfo->pPoolSizes) { @@ -2362,9 +2817,8 @@ if (pCreateInfo->pPoolSizes[i].descriptorCount <= 0) { skip |= log_msg( device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT, - VK_NULL_HANDLE, __LINE__, VALIDATION_ERROR_04a0025c, LayerName, - "vkCreateDescriptorPool(): pCreateInfo->pPoolSizes[%" PRIu32 "].descriptorCount is not greater than 0. %s", - i, validation_error_map[VALIDATION_ERROR_04a0025c]); + VK_NULL_HANDLE, VALIDATION_ERROR_04a0025c, + "vkCreateDescriptorPool(): pCreateInfo->pPoolSizes[%" PRIu32 "].descriptorCount is not greater than 0.", i); } } } @@ -2373,6 +2827,91 @@ return skip; } +bool pv_vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) { + bool skip = false; + layer_data *device_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + + if (groupCountX > device_data->device_limits.maxComputeWorkGroupCount[0]) { + skip |= + log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_19c00304, + "vkCmdDispatch(): groupCountX (%" PRIu32 ") exceeds device limit maxComputeWorkGroupCount[0] (%" PRIu32 ").", + groupCountX, device_data->device_limits.maxComputeWorkGroupCount[0]); + } + + if (groupCountY > device_data->device_limits.maxComputeWorkGroupCount[1]) { + skip |= + log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_19c00306, + "vkCmdDispatch(): groupCountY (%" PRIu32 ") exceeds device limit maxComputeWorkGroupCount[1] (%" PRIu32 ").", + groupCountY, device_data->device_limits.maxComputeWorkGroupCount[1]); + } + + if (groupCountZ > device_data->device_limits.maxComputeWorkGroupCount[2]) { + skip |= + log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_19c00308, + "vkCmdDispatch(): groupCountZ (%" PRIu32 ") exceeds device limit maxComputeWorkGroupCount[2] (%" PRIu32 ").", + groupCountZ, device_data->device_limits.maxComputeWorkGroupCount[2]); + } + + return skip; +} + +bool pv_vkCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, + uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) { + bool skip = false; + layer_data *device_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + + // Paired if {} else if {} tests used to avoid any possible uint underflow + uint32_t limit = device_data->device_limits.maxComputeWorkGroupCount[0]; + if (baseGroupX >= limit) { + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_19e0034a, + "vkCmdDispatch(): baseGroupX (%" PRIu32 + ") equals or exceeds device limit maxComputeWorkGroupCount[0] (%" PRIu32 ").", + baseGroupX, limit); + } else if (groupCountX > (limit - baseGroupX)) { + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_19e00350, + "vkCmdDispatchBaseKHR(): baseGroupX (%" PRIu32 ") + groupCountX (%" PRIu32 + ") exceeds device limit maxComputeWorkGroupCount[0] (%" PRIu32 ").", + baseGroupX, groupCountX, limit); + } + + limit = device_data->device_limits.maxComputeWorkGroupCount[1]; + if (baseGroupY >= limit) { + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_19e0034c, + "vkCmdDispatch(): baseGroupY (%" PRIu32 + ") equals or exceeds device limit maxComputeWorkGroupCount[1] (%" PRIu32 ").", + baseGroupY, limit); + } else if (groupCountY > (limit - baseGroupY)) { + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_19e00352, + "vkCmdDispatchBaseKHR(): baseGroupY (%" PRIu32 ") + groupCountY (%" PRIu32 + ") exceeds device limit maxComputeWorkGroupCount[1] (%" PRIu32 ").", + baseGroupY, groupCountY, limit); + } + + limit = device_data->device_limits.maxComputeWorkGroupCount[2]; + if (baseGroupZ >= limit) { + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_19e0034e, + "vkCmdDispatch(): baseGroupZ (%" PRIu32 + ") equals or exceeds device limit maxComputeWorkGroupCount[2] (%" PRIu32 ").", + baseGroupZ, limit); + } else if (groupCountZ > (limit - baseGroupZ)) { + skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + HandleToUint64(commandBuffer), VALIDATION_ERROR_19e00354, + "vkCmdDispatchBaseKHR(): baseGroupZ (%" PRIu32 ") + groupCountZ (%" PRIu32 + ") exceeds device limit maxComputeWorkGroupCount[2] (%" PRIu32 ").", + baseGroupZ, groupCountZ, limit); + } + + return skip; +} + VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char *funcName) { const auto item = name_to_funcptr_map.find(funcName); if (item != name_to_funcptr_map.end()) { @@ -2408,32 +2947,35 @@ // If additional validation is needed outside of the generated checks, a manual routine can be added to this file // and the address filled in here. The autogenerated source will call these routines if the pointers are not NULL. void InitializeManualParameterValidationFunctionPointers() { - custom_functions["vkGetDeviceQueue"] = (void*)pv_vkGetDeviceQueue; - custom_functions["vkCreateBuffer"] = (void*)pv_vkCreateBuffer; - custom_functions["vkCreateImage"] = (void*)pv_vkCreateImage; - custom_functions["vkCreateImageView"] = (void*)pv_vkCreateImageView; - custom_functions["vkCreateGraphicsPipelines"] = (void*)pv_vkCreateGraphicsPipelines; - custom_functions["vkCreateComputePipelines"] = (void*)pv_vkCreateComputePipelines; - custom_functions["vkCreateSampler"] = (void*)pv_vkCreateSampler; - custom_functions["vkCreateDescriptorSetLayout"] = (void*)pv_vkCreateDescriptorSetLayout; - custom_functions["vkFreeDescriptorSets"] = (void*)pv_vkFreeDescriptorSets; - custom_functions["vkUpdateDescriptorSets"] = (void*)pv_vkUpdateDescriptorSets; - custom_functions["vkCreateRenderPass"] = (void*)pv_vkCreateRenderPass; - custom_functions["vkBeginCommandBuffer"] = (void*)pv_vkBeginCommandBuffer; - custom_functions["vkCmdSetViewport"] = (void*)pv_vkCmdSetViewport; - custom_functions["vkCmdSetScissor"] = (void*)pv_vkCmdSetScissor; - custom_functions["vkCmdDraw"] = (void*)pv_vkCmdDraw; - custom_functions["vkCmdDrawIndirect"] = (void*)pv_vkCmdDrawIndirect; - custom_functions["vkCmdDrawIndexedIndirect"] = (void*)pv_vkCmdDrawIndexedIndirect; - custom_functions["vkCmdCopyImage"] = (void*)pv_vkCmdCopyImage; - custom_functions["vkCmdBlitImage"] = (void*)pv_vkCmdBlitImage; - custom_functions["vkCmdCopyBufferToImage"] = (void*)pv_vkCmdCopyBufferToImage; - custom_functions["vkCmdCopyImageToBuffer"] = (void*)pv_vkCmdCopyImageToBuffer; - custom_functions["vkCmdUpdateBuffer"] = (void*)pv_vkCmdUpdateBuffer; - custom_functions["vkCmdFillBuffer"] = (void*)pv_vkCmdFillBuffer; - custom_functions["vkCreateSwapchainKHR"] = (void*)pv_vkCreateSwapchainKHR; - custom_functions["vkQueuePresentKHR"] = (void*)pv_vkQueuePresentKHR; - custom_functions["vkCreateDescriptorPool"] = (void*)pv_vkCreateDescriptorPool; + custom_functions["vkGetDeviceQueue"] = (void *)pv_vkGetDeviceQueue; + custom_functions["vkCreateBuffer"] = (void *)pv_vkCreateBuffer; + custom_functions["vkCreateImage"] = (void *)pv_vkCreateImage; + custom_functions["vkCreateImageView"] = (void *)pv_vkCreateImageView; + custom_functions["vkCreateGraphicsPipelines"] = (void *)pv_vkCreateGraphicsPipelines; + custom_functions["vkCreateComputePipelines"] = (void *)pv_vkCreateComputePipelines; + custom_functions["vkCreateSampler"] = (void *)pv_vkCreateSampler; + custom_functions["vkCreateDescriptorSetLayout"] = (void *)pv_vkCreateDescriptorSetLayout; + custom_functions["vkFreeDescriptorSets"] = (void *)pv_vkFreeDescriptorSets; + custom_functions["vkUpdateDescriptorSets"] = (void *)pv_vkUpdateDescriptorSets; + custom_functions["vkCreateRenderPass"] = (void *)pv_vkCreateRenderPass; + custom_functions["vkBeginCommandBuffer"] = (void *)pv_vkBeginCommandBuffer; + custom_functions["vkCmdSetViewport"] = (void *)pv_vkCmdSetViewport; + custom_functions["vkCmdSetScissor"] = (void *)pv_vkCmdSetScissor; + custom_functions["vkCmdSetLineWidth"] = (void *)pv_vkCmdSetLineWidth; + custom_functions["vkCmdDraw"] = (void *)pv_vkCmdDraw; + custom_functions["vkCmdDrawIndirect"] = (void *)pv_vkCmdDrawIndirect; + custom_functions["vkCmdDrawIndexedIndirect"] = (void *)pv_vkCmdDrawIndexedIndirect; + custom_functions["vkCmdCopyImage"] = (void *)pv_vkCmdCopyImage; + custom_functions["vkCmdBlitImage"] = (void *)pv_vkCmdBlitImage; + custom_functions["vkCmdCopyBufferToImage"] = (void *)pv_vkCmdCopyBufferToImage; + custom_functions["vkCmdCopyImageToBuffer"] = (void *)pv_vkCmdCopyImageToBuffer; + custom_functions["vkCmdUpdateBuffer"] = (void *)pv_vkCmdUpdateBuffer; + custom_functions["vkCmdFillBuffer"] = (void *)pv_vkCmdFillBuffer; + custom_functions["vkCreateSwapchainKHR"] = (void *)pv_vkCreateSwapchainKHR; + custom_functions["vkQueuePresentKHR"] = (void *)pv_vkQueuePresentKHR; + custom_functions["vkCreateDescriptorPool"] = (void *)pv_vkCreateDescriptorPool; + custom_functions["vkCmdDispatch"] = (void *)pv_vkCmdDispatch; + custom_functions["vkCmdDispatchBaseKHR"] = (void *)pv_vkCmdDispatchBaseKHR; } } // namespace parameter_validation diff -Nru vulkan-1.0.65.2+dfsg1/layers/shader_validation.cpp vulkan-1.1.73+dfsg/layers/shader_validation.cpp --- vulkan-1.0.65.2+dfsg1/layers/shader_validation.cpp 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/shader_validation.cpp 2018-04-27 11:24:19.000000000 +0000 @@ -35,6 +35,7 @@ #include "core_validation_types.h" #include "shader_validation.h" #include "spirv-tools/libspirv.h" +#include "xxhash.h" enum FORMAT_TYPE { FORMAT_TYPE_FLOAT = 1, // UNORM, SNORM, FLOAT, USCALED, SSCALED, SRGB -- anything we consider float in the shader @@ -170,6 +171,8 @@ return "image"; case spv::StorageClassPushConstant: return "push constant"; + case spv::StorageClassStorageBuffer: + return "storage buffer"; default: return "unknown"; } @@ -313,27 +316,27 @@ case spv::OpTypeMatrix: // Match on element type, count. return types_match(a, b, a_insn.word(2), b_insn.word(2), a_arrayed, b_arrayed, false) && - a_insn.word(3) == b_insn.word(3); + a_insn.word(3) == b_insn.word(3); case spv::OpTypeArray: // Match on element type, count. these all have the same layout. we don't get here if b_arrayed. This differs from // vector & matrix types in that the array size is the id of a constant instruction, * not a literal within OpTypeArray return types_match(a, b, a_insn.word(2), b_insn.word(2), a_arrayed, b_arrayed, false) && - get_constant_value(a, a_insn.word(3)) == get_constant_value(b, b_insn.word(3)); + get_constant_value(a, a_insn.word(3)) == get_constant_value(b, b_insn.word(3)); case spv::OpTypeStruct: // Match on all element types - { - if (a_insn.len() != b_insn.len()) { - return false; // Structs cannot match if member counts differ - } + { + if (a_insn.len() != b_insn.len()) { + return false; // Structs cannot match if member counts differ + } - for (unsigned i = 2; i < a_insn.len(); i++) { - if (!types_match(a, b, a_insn.word(i), b_insn.word(i), a_arrayed, b_arrayed, false)) { - return false; + for (unsigned i = 2; i < a_insn.len(); i++) { + if (!types_match(a, b, a_insn.word(i), b_insn.word(i), a_arrayed, b_arrayed, false)) { + return false; + } } - } - return true; - } + return true; + } default: // Remaining types are CLisms, or may not appear in the interfaces we are interested in. Just claim no match. return false; @@ -397,14 +400,10 @@ } static unsigned get_format_type(VkFormat fmt) { - if (FormatIsSInt(fmt)) - return FORMAT_TYPE_SINT; - if (FormatIsUInt(fmt)) - return FORMAT_TYPE_UINT; - if (FormatIsDepthAndStencil(fmt)) - return FORMAT_TYPE_FLOAT | FORMAT_TYPE_UINT; - if (fmt == VK_FORMAT_UNDEFINED) - return 0; + if (FormatIsSInt(fmt)) return FORMAT_TYPE_SINT; + if (FormatIsUInt(fmt)) return FORMAT_TYPE_UINT; + if (FormatIsDepthAndStencil(fmt)) return FORMAT_TYPE_FLOAT | FORMAT_TYPE_UINT; + if (fmt == VK_FORMAT_UNDEFINED) return 0; // everything else -- UNORM/SNORM/FLOAT/USCALED/SSCALED is all float in the shader. return FORMAT_TYPE_FLOAT; } @@ -503,7 +502,7 @@ auto component_it = member_components.find(member_index); unsigned component = component_it == member_components.end() ? 0 : component_it->second; bool is_relaxed_precision = member_relaxed_precision.find(member_index) != member_relaxed_precision.end(); - bool member_is_patch = is_patch || member_patch.count(member_index)>0; + bool member_is_patch = is_patch || member_patch.count(member_index) > 0; for (unsigned int offset = 0; offset < num_locations; offset++) { interface_var v = {}; @@ -584,13 +583,14 @@ unsigned id = insn.word(2); unsigned type = insn.word(1); - int location = value_or_default(var_locations, id, -1); - int builtin = value_or_default(var_builtins, id, -1); + int location = value_or_default(var_locations, id, static_cast(-1)); + int builtin = value_or_default(var_builtins, id, static_cast(-1)); unsigned component = value_or_default(var_components, id, 0); // Unspecified is OK, is 0 bool is_patch = var_patch.find(id) != var_patch.end(); bool is_relaxed_precision = var_relaxed_precision.find(id) != var_relaxed_precision.end(); - if (builtin != -1) continue; + if (builtin != -1) + continue; else if (!collect_interface_block_members(src, &out, blocks, is_array_of_verts, id, type, is_patch, location)) { // A user-defined interface variable, with a location. Where a variable occupied multiple locations, emit // one result for each. @@ -643,10 +643,47 @@ return out; } +static bool is_writable_descriptor_type(shader_module const *module, uint32_t type_id) { + auto type = module->get_def(type_id); + + // Strip off any array or ptrs. Where we remove array levels, adjust the descriptor count for each dimension. + while (type.opcode() == spv::OpTypeArray || type.opcode() == spv::OpTypePointer) { + if (type.opcode() == spv::OpTypeArray) { + type = module->get_def(type.word(2)); + } else { + if (type.word(2) == spv::StorageClassStorageBuffer) { + return true; + } + type = module->get_def(type.word(3)); + } + } + + switch (type.opcode()) { + case spv::OpTypeImage: { + auto dim = type.word(3); + auto sampled = type.word(7); + return sampled == 2 && dim != spv::DimSubpassData; + } + + case spv::OpTypeStruct: + for (auto insn : *module) { + if (insn.opcode() == spv::OpDecorate && insn.word(1) == type.word(1)) { + if (insn.word(2) == spv::DecorationBufferBlock) { + return true; + } + } + } + } + + return false; +} + static std::vector> collect_interface_by_descriptor_slot( - debug_report_data const *report_data, shader_module const *src, std::unordered_set const &accessible_ids) { + debug_report_data const *report_data, shader_module const *src, std::unordered_set const &accessible_ids, + bool *has_writable_descriptor) { std::unordered_map var_sets; std::unordered_map var_bindings; + std::unordered_map var_nonwritable; for (auto insn : *src) { // All variables in the Uniform or UniformConstant storage classes are required to be decorated with both @@ -659,6 +696,10 @@ if (insn.word(2) == spv::DecorationBinding) { var_bindings[insn.word(1)] = insn.word(3); } + + if (insn.word(2) == spv::DecorationNonWritable) { + var_nonwritable[insn.word(1)] = 1; + } } } @@ -669,7 +710,8 @@ assert(insn != src->end()); if (insn.opcode() == spv::OpVariable && - (insn.word(3) == spv::StorageClassUniform || insn.word(3) == spv::StorageClassUniformConstant)) { + (insn.word(3) == spv::StorageClassUniform || insn.word(3) == spv::StorageClassUniformConstant || + insn.word(3) == spv::StorageClassStorageBuffer)) { unsigned set = value_or_default(var_sets, insn.word(2), 0); unsigned binding = value_or_default(var_bindings, insn.word(2), 0); @@ -677,14 +719,16 @@ v.id = insn.word(2); v.type_id = insn.word(1); out.emplace_back(std::make_pair(set, binding), v); + + if (var_nonwritable.find(id) == var_nonwritable.end() && is_writable_descriptor_type(src, insn.word(1))) { + *has_writable_descriptor = true; + } } } return out; } - - static bool validate_vi_consistency(debug_report_data const *report_data, VkPipelineVertexInputStateCreateInfo const *vi) { // Walk the binding descriptions, which describe the step rate and stride of each vertex buffer. Each binding should // be specified only once. @@ -696,8 +740,8 @@ auto &binding = bindings[desc->binding]; if (binding) { // TODO: VALIDATION_ERROR_096005cc perhaps? - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - SHADER_CHECKER_INCONSISTENT_VI, "SC", "Duplicate vertex input binding descriptions for binding %d", + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + SHADER_CHECKER_INCONSISTENT_VI, "Duplicate vertex input binding descriptions for binding %d", desc->binding); } else { binding = desc; @@ -735,16 +779,16 @@ auto b_first = b_at_end ? 0 : it_b->first.first; if (!a_at_end && (b_at_end || a_first < b_first)) { if (!used && log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, - 0, __LINE__, SHADER_CHECKER_OUTPUT_NOT_CONSUMED, "SC", + 0, SHADER_CHECKER_OUTPUT_NOT_CONSUMED, "Vertex attribute at location %d not consumed by vertex shader", a_first)) { skip = true; } used = false; it_a++; } else if (!b_at_end && (a_at_end || b_first < a_first)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, 0, __LINE__, - SHADER_CHECKER_INPUT_NOT_PRODUCED, "SC", "Vertex shader consumes input at location %d but not provided", - b_first); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, 0, + SHADER_CHECKER_INPUT_NOT_PRODUCED, "Vertex shader consumes input at location %d but not provided", b_first); it_b++; } else { unsigned attrib_type = get_format_type(it_a->second->format); @@ -752,8 +796,8 @@ // Type checking if (!(attrib_type & input_type)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - SHADER_CHECKER_INTERFACE_TYPE_MISMATCH, "SC", + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + SHADER_CHECKER_INTERFACE_TYPE_MISMATCH, "Attribute type of `%s` at location %d does not match vertex shader input type of `%s`", string_VkFormat(it_a->second->format), a_first, describe_type(vs, it_b->second.type_id).c_str()); } @@ -770,7 +814,7 @@ static bool validate_fs_outputs_against_render_pass(debug_report_data const *report_data, shader_module const *fs, spirv_inst_iter entrypoint, PIPELINE_STATE const *pipeline, uint32_t subpass_index) { - auto rpci = pipeline->render_pass_ci.ptr(); + auto rpci = pipeline->rp_state->createInfo.ptr(); std::map color_attachments; auto subpass = rpci->pSubpasses[subpass_index]; @@ -798,17 +842,16 @@ bool b_at_end = color_attachments.size() == 0 || it_b == color_attachments.end(); if (!a_at_end && (b_at_end || it_a->first.first < it_b->first)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - SHADER_CHECKER_OUTPUT_NOT_CONSUMED, "SC", + skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + SHADER_CHECKER_OUTPUT_NOT_CONSUMED, "fragment shader writes to output location %d with no matching attachment", it_a->first.first); it_a++; } else if (!b_at_end && (a_at_end || it_a->first.first > it_b->first)) { // Only complain if there are unmasked channels for this attachment. If the writemask is 0, it's acceptable for the // shader to not produce a matching output. if (pipeline->attachments[it_b->first].colorWriteMask != 0) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - SHADER_CHECKER_INPUT_NOT_PRODUCED, "SC", "Attachment %d not written by fragment shader", it_b->first); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + SHADER_CHECKER_INPUT_NOT_PRODUCED, "Attachment %d not written by fragment shader", it_b->first); } it_b++; } else { @@ -817,8 +860,8 @@ // Type checking if (!(output_type & att_type)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - SHADER_CHECKER_INTERFACE_TYPE_MISMATCH, "SC", + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + SHADER_CHECKER_INTERFACE_TYPE_MISMATCH, "Attachment %d of type `%s` does not match fragment shader output type of `%s`", it_b->first, string_VkFormat(it_b->second), describe_type(fs, it_a->second.type_id).c_str()); } @@ -974,11 +1017,11 @@ found_range = true; if ((range.stageFlags & stage) == 0) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, SHADER_CHECKER_PUSH_CONSTANT_NOT_ACCESSIBLE_FROM_STAGE, "SC", - "Push constant range covering variable starting at " - "offset %u not accessible from stage %s", - offset, string_VkShaderStageFlagBits(stage)); + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + SHADER_CHECKER_PUSH_CONSTANT_NOT_ACCESSIBLE_FROM_STAGE, + "Push constant range covering variable starting at offset %u not accessible from stage %s", + offset, string_VkShaderStageFlagBits(stage)); } break; @@ -987,10 +1030,8 @@ if (!found_range) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, SHADER_CHECKER_PUSH_CONSTANT_OUT_OF_RANGE, "SC", - "Push constant range covering variable starting at " - "offset %u not declared in layout", - offset); + SHADER_CHECKER_PUSH_CONSTANT_OUT_OF_RANGE, + "Push constant range covering variable starting at offset %u not declared in layout", offset); } } } @@ -1025,14 +1066,12 @@ for (auto i = 0u; i < spec->mapEntryCount; i++) { // TODO: This is a good place for VALIDATION_ERROR_1360060a. if (spec->pMapEntries[i].offset + spec->pMapEntries[i].size > spec->dataSize) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, 0, __LINE__, - VALIDATION_ERROR_1360060c, "SC", - "Specialization entry %u (for constant id %u) references memory outside provided " - "specialization data (bytes %u.." PRINTF_SIZE_T_SPECIFIER "; " PRINTF_SIZE_T_SPECIFIER - " bytes provided). %s.", - i, spec->pMapEntries[i].constantID, spec->pMapEntries[i].offset, - spec->pMapEntries[i].offset + spec->pMapEntries[i].size - 1, spec->dataSize, - validation_error_map[VALIDATION_ERROR_1360060c]); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, 0, + VALIDATION_ERROR_1360060c, + "Specialization entry %u (for constant id %u) references memory outside provided specialization " + "data (bytes %u.." PRINTF_SIZE_T_SPECIFIER "; " PRINTF_SIZE_T_SPECIFIER " bytes provided)..", + i, spec->pMapEntries[i].constantID, spec->pMapEntries[i].offset, + spec->pMapEntries[i].offset + spec->pMapEntries[i].size - 1, spec->dataSize); } } } @@ -1043,15 +1082,21 @@ static bool descriptor_type_match(shader_module const *module, uint32_t type_id, VkDescriptorType descriptor_type, unsigned &descriptor_count) { auto type = module->get_def(type_id); - + bool is_storage_buffer = false; descriptor_count = 1; // Strip off any array or ptrs. Where we remove array levels, adjust the descriptor count for each dimension. - while (type.opcode() == spv::OpTypeArray || type.opcode() == spv::OpTypePointer) { - if (type.opcode() == spv::OpTypeArray) { + while (type.opcode() == spv::OpTypeArray || type.opcode() == spv::OpTypePointer || type.opcode() == spv::OpTypeRuntimeArray) { + if (type.opcode() == spv::OpTypeRuntimeArray) { + descriptor_count = 0; + type = module->get_def(type.word(2)); + } else if (type.opcode() == spv::OpTypeArray) { descriptor_count *= get_constant_value(module, type.word(3)); type = module->get_def(type.word(2)); } else { + if (type.word(2) == spv::StorageClassStorageBuffer) { + is_storage_buffer = true; + } type = module->get_def(type.word(3)); } } @@ -1061,11 +1106,16 @@ for (auto insn : *module) { if (insn.opcode() == spv::OpDecorate && insn.word(1) == type.word(1)) { if (insn.word(2) == spv::DecorationBlock) { - return descriptor_type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER || - descriptor_type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC; + if (is_storage_buffer) { + return descriptor_type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER || + descriptor_type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC; + } else { + return descriptor_type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER || + descriptor_type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC; + } } else if (insn.word(2) == spv::DecorationBufferBlock) { return descriptor_type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER || - descriptor_type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC; + descriptor_type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC; } } } @@ -1104,7 +1154,7 @@ } } else if (sampled == 1) { return descriptor_type == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE || - descriptor_type == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + descriptor_type == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; } else { return descriptor_type == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE; } @@ -1118,11 +1168,8 @@ static bool require_feature(debug_report_data const *report_data, VkBool32 feature, char const *feature_name) { if (!feature) { - if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - SHADER_CHECKER_FEATURE_NOT_ENABLED, "SC", - "Shader requires VkPhysicalDeviceFeatures::%s but is not " - "enabled on the device", - feature_name)) { + if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + SHADER_CHECKER_FEATURE_NOT_ENABLED, "Shader requires %s but is not enabled on the device", feature_name)) { return true; } } @@ -1132,10 +1179,8 @@ static bool require_extension(debug_report_data const *report_data, bool extension, char const *extension_name) { if (!extension) { - if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - SHADER_CHECKER_FEATURE_NOT_ENABLED, "SC", - "Shader requires extension %s but is not " - "enabled on the device", + if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + SHADER_CHECKER_FEATURE_NOT_ENABLED, "Shader requires extension %s but is not enabled on the device", extension_name)) { return true; } @@ -1144,24 +1189,23 @@ return false; } -static bool validate_shader_capabilities(layer_data *dev_data, shader_module const *src) { +static bool validate_shader_capabilities(layer_data *dev_data, shader_module const *src, VkShaderStageFlagBits stage, + bool has_writable_descriptor) { bool skip = false; auto report_data = GetReportData(dev_data); - auto const & enabledFeatures = GetEnabledFeatures(dev_data); - auto const & extensions = GetEnabledExtensions(dev_data); + auto const &enabledFeatures = GetEnabledFeatures(dev_data); + auto const &extensions = GetEnabledExtensions(dev_data); + auto const &descriptorIndexingFeatures = GetEnabledDescriptorIndexingFeatures(dev_data); struct CapabilityInfo { char const *name; - VkBool32 const VkPhysicalDeviceFeatures::*feature; - bool const DeviceExtensions::*extension; + VkBool32 const *feature; + bool const *extension; }; - using F = VkPhysicalDeviceFeatures; - using E = DeviceExtensions; - // clang-format off - static const std::unordered_map capabilities = { + static const std::unordered_multimap capabilities = { // Capabilities always supported by a Vulkan 1.0 implementation -- no // feature bits. {spv::CapabilityMatrix, {nullptr}}, @@ -1175,57 +1219,131 @@ // Capabilities that are optionally supported, but require a feature to // be enabled on the device - {spv::CapabilityGeometry, {"geometryShader", &F::geometryShader}}, - {spv::CapabilityTessellation, {"tessellationShader", &F::tessellationShader}}, - {spv::CapabilityFloat64, {"shaderFloat64", &F::shaderFloat64}}, - {spv::CapabilityInt64, {"shaderInt64", &F::shaderInt64}}, - {spv::CapabilityTessellationPointSize, {"shaderTessellationAndGeometryPointSize", &F::shaderTessellationAndGeometryPointSize}}, - {spv::CapabilityGeometryPointSize, {"shaderTessellationAndGeometryPointSize", &F::shaderTessellationAndGeometryPointSize}}, - {spv::CapabilityImageGatherExtended, {"shaderImageGatherExtended", &F::shaderImageGatherExtended}}, - {spv::CapabilityStorageImageMultisample, {"shaderStorageImageMultisample", &F::shaderStorageImageMultisample}}, - {spv::CapabilityUniformBufferArrayDynamicIndexing, {"shaderUniformBufferArrayDynamicIndexing", &F::shaderUniformBufferArrayDynamicIndexing}}, - {spv::CapabilitySampledImageArrayDynamicIndexing, {"shaderSampledImageArrayDynamicIndexing", &F::shaderSampledImageArrayDynamicIndexing}}, - {spv::CapabilityStorageBufferArrayDynamicIndexing, {"shaderStorageBufferArrayDynamicIndexing", &F::shaderStorageBufferArrayDynamicIndexing}}, - {spv::CapabilityStorageImageArrayDynamicIndexing, {"shaderStorageImageArrayDynamicIndexing", &F::shaderStorageBufferArrayDynamicIndexing}}, - {spv::CapabilityClipDistance, {"shaderClipDistance", &F::shaderClipDistance}}, - {spv::CapabilityCullDistance, {"shaderCullDistance", &F::shaderCullDistance}}, - {spv::CapabilityImageCubeArray, {"imageCubeArray", &F::imageCubeArray}}, - {spv::CapabilitySampleRateShading, {"sampleRateShading", &F::sampleRateShading}}, - {spv::CapabilitySparseResidency, {"shaderResourceResidency", &F::shaderResourceResidency}}, - {spv::CapabilityMinLod, {"shaderResourceMinLod", &F::shaderResourceMinLod}}, - {spv::CapabilitySampledCubeArray, {"imageCubeArray", &F::imageCubeArray}}, - {spv::CapabilityImageMSArray, {"shaderStorageImageMultisample", &F::shaderStorageImageMultisample}}, - {spv::CapabilityStorageImageExtendedFormats, {"shaderStorageImageExtendedFormats", &F::shaderStorageImageExtendedFormats}}, - {spv::CapabilityInterpolationFunction, {"sampleRateShading", &F::sampleRateShading}}, - {spv::CapabilityStorageImageReadWithoutFormat, {"shaderStorageImageReadWithoutFormat", &F::shaderStorageImageReadWithoutFormat}}, - {spv::CapabilityStorageImageWriteWithoutFormat, {"shaderStorageImageWriteWithoutFormat", &F::shaderStorageImageWriteWithoutFormat}}, - {spv::CapabilityMultiViewport, {"multiViewport", &F::multiViewport}}, + {spv::CapabilityGeometry, {"VkPhysicalDeviceFeatures::geometryShader", &enabledFeatures->geometryShader}}, + {spv::CapabilityTessellation, {"VkPhysicalDeviceFeatures::tessellationShader", &enabledFeatures->tessellationShader}}, + {spv::CapabilityFloat64, {"VkPhysicalDeviceFeatures::shaderFloat64", &enabledFeatures->shaderFloat64}}, + {spv::CapabilityInt64, {"VkPhysicalDeviceFeatures::shaderInt64", &enabledFeatures->shaderInt64}}, + {spv::CapabilityTessellationPointSize, {"VkPhysicalDeviceFeatures::shaderTessellationAndGeometryPointSize", &enabledFeatures->shaderTessellationAndGeometryPointSize}}, + {spv::CapabilityGeometryPointSize, {"VkPhysicalDeviceFeatures::shaderTessellationAndGeometryPointSize", &enabledFeatures->shaderTessellationAndGeometryPointSize}}, + {spv::CapabilityImageGatherExtended, {"VkPhysicalDeviceFeatures::shaderImageGatherExtended", &enabledFeatures->shaderImageGatherExtended}}, + {spv::CapabilityStorageImageMultisample, {"VkPhysicalDeviceFeatures::shaderStorageImageMultisample", &enabledFeatures->shaderStorageImageMultisample}}, + {spv::CapabilityUniformBufferArrayDynamicIndexing, {"VkPhysicalDeviceFeatures::shaderUniformBufferArrayDynamicIndexing", &enabledFeatures->shaderUniformBufferArrayDynamicIndexing}}, + {spv::CapabilitySampledImageArrayDynamicIndexing, {"VkPhysicalDeviceFeatures::shaderSampledImageArrayDynamicIndexing", &enabledFeatures->shaderSampledImageArrayDynamicIndexing}}, + {spv::CapabilityStorageBufferArrayDynamicIndexing, {"VkPhysicalDeviceFeatures::shaderStorageBufferArrayDynamicIndexing", &enabledFeatures->shaderStorageBufferArrayDynamicIndexing}}, + {spv::CapabilityStorageImageArrayDynamicIndexing, {"VkPhysicalDeviceFeatures::shaderStorageImageArrayDynamicIndexing", &enabledFeatures->shaderStorageBufferArrayDynamicIndexing}}, + {spv::CapabilityClipDistance, {"VkPhysicalDeviceFeatures::shaderClipDistance", &enabledFeatures->shaderClipDistance}}, + {spv::CapabilityCullDistance, {"VkPhysicalDeviceFeatures::shaderCullDistance", &enabledFeatures->shaderCullDistance}}, + {spv::CapabilityImageCubeArray, {"VkPhysicalDeviceFeatures::imageCubeArray", &enabledFeatures->imageCubeArray}}, + {spv::CapabilitySampleRateShading, {"VkPhysicalDeviceFeatures::sampleRateShading", &enabledFeatures->sampleRateShading}}, + {spv::CapabilitySparseResidency, {"VkPhysicalDeviceFeatures::shaderResourceResidency", &enabledFeatures->shaderResourceResidency}}, + {spv::CapabilityMinLod, {"VkPhysicalDeviceFeatures::shaderResourceMinLod", &enabledFeatures->shaderResourceMinLod}}, + {spv::CapabilitySampledCubeArray, {"VkPhysicalDeviceFeatures::imageCubeArray", &enabledFeatures->imageCubeArray}}, + {spv::CapabilityImageMSArray, {"VkPhysicalDeviceFeatures::shaderStorageImageMultisample", &enabledFeatures->shaderStorageImageMultisample}}, + {spv::CapabilityStorageImageExtendedFormats, {"VkPhysicalDeviceFeatures::shaderStorageImageExtendedFormats", &enabledFeatures->shaderStorageImageExtendedFormats}}, + {spv::CapabilityInterpolationFunction, {"VkPhysicalDeviceFeatures::sampleRateShading", &enabledFeatures->sampleRateShading}}, + {spv::CapabilityStorageImageReadWithoutFormat, {"VkPhysicalDeviceFeatures::shaderStorageImageReadWithoutFormat", &enabledFeatures->shaderStorageImageReadWithoutFormat}}, + {spv::CapabilityStorageImageWriteWithoutFormat, {"VkPhysicalDeviceFeatures::shaderStorageImageWriteWithoutFormat", &enabledFeatures->shaderStorageImageWriteWithoutFormat}}, + {spv::CapabilityMultiViewport, {"VkPhysicalDeviceFeatures::multiViewport", &enabledFeatures->multiViewport}}, + + // XXX TODO: Descriptor indexing capability enums are not yet available in the spirv-tools we fetch. +#define CapabilityShaderNonUniformEXT 5301 +#define CapabilityRuntimeDescriptorArrayEXT 5302 +#define CapabilityInputAttachmentArrayDynamicIndexingEXT 5303 +#define CapabilityUniformTexelBufferArrayDynamicIndexingEXT 5304 +#define CapabilityStorageTexelBufferArrayDynamicIndexingEXT 5305 +#define CapabilityUniformBufferArrayNonUniformIndexingEXT 5306 +#define CapabilitySampledImageArrayNonUniformIndexingEXT 5307 +#define CapabilityStorageBufferArrayNonUniformIndexingEXT 5308 +#define CapabilityStorageImageArrayNonUniformIndexingEXT 5309 +#define CapabilityInputAttachmentArrayNonUniformIndexingEXT 5310 +#define CapabilityUniformTexelBufferArrayNonUniformIndexingEXT 5311 +#define CapabilityStorageTexelBufferArrayNonUniformIndexingEXT 5312 + {CapabilityShaderNonUniformEXT, {VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, nullptr, &extensions->vk_ext_descriptor_indexing}}, + {CapabilityRuntimeDescriptorArrayEXT, {"VkPhysicalDeviceDescriptorIndexingFeaturesEXT::runtimeDescriptorArray", &descriptorIndexingFeatures->runtimeDescriptorArray}}, + {CapabilityInputAttachmentArrayDynamicIndexingEXT, {"VkPhysicalDeviceDescriptorIndexingFeaturesEXT::shaderInputAttachmentArrayDynamicIndexing", &descriptorIndexingFeatures->shaderInputAttachmentArrayDynamicIndexing}}, + {CapabilityUniformTexelBufferArrayDynamicIndexingEXT, {"VkPhysicalDeviceDescriptorIndexingFeaturesEXT::shaderUniformTexelBufferArrayDynamicIndexing", &descriptorIndexingFeatures->shaderUniformTexelBufferArrayDynamicIndexing}}, + {CapabilityStorageTexelBufferArrayDynamicIndexingEXT, {"VkPhysicalDeviceDescriptorIndexingFeaturesEXT::shaderStorageTexelBufferArrayDynamicIndexing", &descriptorIndexingFeatures->shaderStorageTexelBufferArrayDynamicIndexing}}, + {CapabilityUniformBufferArrayNonUniformIndexingEXT, {"VkPhysicalDeviceDescriptorIndexingFeaturesEXT::shaderUniformBufferArrayNonUniformIndexing", &descriptorIndexingFeatures->shaderUniformBufferArrayNonUniformIndexing}}, + {CapabilitySampledImageArrayNonUniformIndexingEXT, {"VkPhysicalDeviceDescriptorIndexingFeaturesEXT::shaderSampledImageArrayNonUniformIndexing", &descriptorIndexingFeatures->shaderSampledImageArrayNonUniformIndexing}}, + {CapabilityStorageBufferArrayNonUniformIndexingEXT, {"VkPhysicalDeviceDescriptorIndexingFeaturesEXT::shaderStorageBufferArrayNonUniformIndexing", &descriptorIndexingFeatures->shaderStorageBufferArrayNonUniformIndexing}}, + {CapabilityStorageImageArrayNonUniformIndexingEXT, {"VkPhysicalDeviceDescriptorIndexingFeaturesEXT::shaderStorageImageArrayNonUniformIndexing", &descriptorIndexingFeatures->shaderStorageImageArrayNonUniformIndexing}}, + {CapabilityInputAttachmentArrayNonUniformIndexingEXT, {"VkPhysicalDeviceDescriptorIndexingFeaturesEXT::shaderInputAttachmentArrayNonUniformIndexing", &descriptorIndexingFeatures->shaderInputAttachmentArrayNonUniformIndexing}}, + {CapabilityUniformTexelBufferArrayNonUniformIndexingEXT, {"VkPhysicalDeviceDescriptorIndexingFeaturesEXT::shaderUniformTexelBufferArrayNonUniformIndexing", &descriptorIndexingFeatures->shaderUniformTexelBufferArrayNonUniformIndexing}}, + {CapabilityStorageTexelBufferArrayNonUniformIndexingEXT , {"VkPhysicalDeviceDescriptorIndexingFeaturesEXT::shaderStorageTexelBufferArrayNonUniformIndexing", &descriptorIndexingFeatures->shaderStorageTexelBufferArrayNonUniformIndexing}}, // Capabilities that require an extension - {spv::CapabilityDrawParameters, {VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME, nullptr, &E::vk_khr_shader_draw_parameters}}, - {spv::CapabilityGeometryShaderPassthroughNV, {VK_NV_GEOMETRY_SHADER_PASSTHROUGH_EXTENSION_NAME, nullptr, &E::vk_nv_geometry_shader_passthrough}}, - {spv::CapabilitySampleMaskOverrideCoverageNV, {VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_EXTENSION_NAME, nullptr, &E::vk_nv_sample_mask_override_coverage}}, - {spv::CapabilityShaderViewportIndexLayerNV, {VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME, nullptr, &E::vk_nv_viewport_array2}}, - {spv::CapabilityShaderViewportMaskNV, {VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME, nullptr, &E::vk_nv_viewport_array2}}, - {spv::CapabilitySubgroupBallotKHR, {VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME, nullptr, &E::vk_ext_shader_subgroup_ballot }}, - {spv::CapabilitySubgroupVoteKHR, {VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME, nullptr, &E::vk_ext_shader_subgroup_vote }}, + {spv::CapabilityDrawParameters, {VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME, nullptr, &extensions->vk_khr_shader_draw_parameters}}, + {spv::CapabilityGeometryShaderPassthroughNV, {VK_NV_GEOMETRY_SHADER_PASSTHROUGH_EXTENSION_NAME, nullptr, &extensions->vk_nv_geometry_shader_passthrough}}, + {spv::CapabilitySampleMaskOverrideCoverageNV, {VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_EXTENSION_NAME, nullptr, &extensions->vk_nv_sample_mask_override_coverage}}, + {spv::CapabilityShaderViewportIndexLayerEXT, {VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME, nullptr, &extensions->vk_ext_shader_viewport_index_layer}}, + {spv::CapabilityShaderViewportIndexLayerNV, {VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME, nullptr, &extensions->vk_nv_viewport_array2}}, + {spv::CapabilityShaderViewportMaskNV, {VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME, nullptr, &extensions->vk_nv_viewport_array2}}, + {spv::CapabilitySubgroupBallotKHR, {VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME, nullptr, &extensions->vk_ext_shader_subgroup_ballot }}, + {spv::CapabilitySubgroupVoteKHR, {VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME, nullptr, &extensions->vk_ext_shader_subgroup_vote }}, }; // clang-format on for (auto insn : *src) { if (insn.opcode() == spv::OpCapability) { - auto it = capabilities.find(insn.word(1)); - if (it != capabilities.end()) { - if (it->second.feature) { - skip |= require_feature(report_data, enabledFeatures->*(it->second.feature), it->second.name); + size_t n = capabilities.count(insn.word(1)); + if (1 == n) { // key occurs exactly once + auto it = capabilities.find(insn.word(1)); + if (it != capabilities.end()) { + if (it->second.feature) { + skip |= require_feature(report_data, *(it->second.feature), it->second.name); + } + if (it->second.extension) { + skip |= require_extension(report_data, *(it->second.extension), it->second.name); + } + } + } else if (1 < n) { // key occurs multiple times, at least one must be enabled + bool needs_feature = false, has_feature = false; + bool needs_ext = false, has_ext = false; + std::string feature_names = "(one of) [ "; + std::string extension_names = feature_names; + auto caps = capabilities.equal_range(insn.word(1)); + for (auto it = caps.first; it != caps.second; ++it) { + if (it->second.feature) { + needs_feature = true; + has_feature = has_feature || *(it->second.feature); + feature_names += it->second.name; + feature_names += " "; + } + if (it->second.extension) { + needs_ext = true; + has_ext = has_ext || *(it->second.extension); + extension_names += it->second.name; + extension_names += " "; + } + } + if (needs_feature) { + feature_names += "]"; + skip |= require_feature(report_data, has_feature, feature_names.c_str()); } - if (it->second.extension) { - skip |= require_extension(report_data, extensions->*(it->second.extension), it->second.name); + if (needs_ext) { + extension_names += "]"; + skip |= require_extension(report_data, has_ext, extension_names.c_str()); } } } } + if (has_writable_descriptor) { + switch (stage) { + case VK_SHADER_STAGE_COMPUTE_BIT: + /* No feature requirements for writes and atomics from compute + * stage */ + break; + case VK_SHADER_STAGE_FRAGMENT_BIT: + skip |= require_feature(report_data, enabledFeatures->fragmentStoresAndAtomics, "fragmentStoresAndAtomics"); + break; + default: + skip |= + require_feature(report_data, enabledFeatures->vertexPipelineStoresAndAtomics, "vertexPipelineStoresAndAtomics"); + break; + } + } + return skip; } @@ -1251,7 +1369,7 @@ return arrayed ? DESCRIPTOR_REQ_VIEW_TYPE_1D_ARRAY : DESCRIPTOR_REQ_VIEW_TYPE_1D; case spv::Dim2D: return (msaa ? DESCRIPTOR_REQ_MULTI_SAMPLE : DESCRIPTOR_REQ_SINGLE_SAMPLE) | - (arrayed ? DESCRIPTOR_REQ_VIEW_TYPE_2D_ARRAY : DESCRIPTOR_REQ_VIEW_TYPE_2D); + (arrayed ? DESCRIPTOR_REQ_VIEW_TYPE_2D_ARRAY : DESCRIPTOR_REQ_VIEW_TYPE_2D); case spv::Dim3D: return DESCRIPTOR_REQ_VIEW_TYPE_3D; case spv::DimCube: @@ -1279,10 +1397,42 @@ return pipelineLayout->set_layouts[slot.first]->GetDescriptorSetLayoutBindingPtrFromBinding(slot.second); } +static void process_execution_modes(shader_module const *src, spirv_inst_iter entrypoint, PIPELINE_STATE *pipeline) { + auto entrypoint_id = entrypoint.word(1); + bool is_point_mode = false; + + for (auto insn : *src) { + if (insn.opcode() == spv::OpExecutionMode && insn.word(1) == entrypoint_id) { + switch (insn.word(2)) { + case spv::ExecutionModePointMode: + // In tessellation shaders, PointMode is separate and trumps the tessellation topology. + is_point_mode = true; + break; + + case spv::ExecutionModeOutputPoints: + pipeline->topology_at_rasterizer = VK_PRIMITIVE_TOPOLOGY_POINT_LIST; + break; + + case spv::ExecutionModeIsolines: + case spv::ExecutionModeOutputLineStrip: + pipeline->topology_at_rasterizer = VK_PRIMITIVE_TOPOLOGY_LINE_STRIP; + break; -static bool validate_pipeline_shader_stage( - layer_data *dev_data, VkPipelineShaderStageCreateInfo const *pStage, PIPELINE_STATE *pipeline, - shader_module const **out_module, spirv_inst_iter *out_entrypoint) { + case spv::ExecutionModeTriangles: + case spv::ExecutionModeQuads: + case spv::ExecutionModeOutputTriangleStrip: + pipeline->topology_at_rasterizer = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP; + break; + } + } + } + + if (is_point_mode) pipeline->topology_at_rasterizer = VK_PRIMITIVE_TOPOLOGY_POINT_LIST; +} + +static bool validate_pipeline_shader_stage(layer_data *dev_data, VkPipelineShaderStageCreateInfo const *pStage, + PIPELINE_STATE *pipeline, shader_module const **out_module, + spirv_inst_iter *out_entrypoint) { bool skip = false; auto module = *out_module = GetShaderModuleState(dev_data, pStage->module); auto report_data = GetReportData(dev_data); @@ -1292,24 +1442,27 @@ // Find the entrypoint auto entrypoint = *out_entrypoint = find_entrypoint(module, pStage->pName, pStage->stage); if (entrypoint == module->end()) { - if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_10600586, "SC", "No entrypoint found named `%s` for stage %s. %s.", pStage->pName, - string_VkShaderStageFlagBits(pStage->stage), validation_error_map[VALIDATION_ERROR_10600586])) { + if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_10600586, "No entrypoint found named `%s` for stage %s..", pStage->pName, + string_VkShaderStageFlagBits(pStage->stage))) { return true; // no point continuing beyond here, any analysis is just going to be garbage. } } - // Validate shader capabilities against enabled device features - skip |= validate_shader_capabilities(dev_data, module); - // Mark accessible ids auto accessible_ids = mark_accessible_ids(module, entrypoint); + process_execution_modes(module, entrypoint, pipeline); // Validate descriptor set layout against what the entrypoint actually uses - auto descriptor_uses = collect_interface_by_descriptor_slot(report_data, module, accessible_ids); + bool has_writable_descriptor = false; + auto descriptor_uses = collect_interface_by_descriptor_slot(report_data, module, accessible_ids, &has_writable_descriptor); + + // Validate shader capabilities against enabled device features + skip |= validate_shader_capabilities(dev_data, module, pStage->stage, has_writable_descriptor); skip |= validate_specialization_offsets(report_data, pStage); - skip |= validate_push_constant_usage(report_data, &pipeline->pipeline_layout.push_constant_ranges, module, accessible_ids, pStage->stage); + skip |= validate_push_constant_usage(report_data, pipeline->pipeline_layout.push_constant_ranges.get(), module, accessible_ids, + pStage->stage); // Validate descriptor use for (auto use : descriptor_uses) { @@ -1322,29 +1475,25 @@ unsigned required_descriptor_count; if (!binding) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - SHADER_CHECKER_MISSING_DESCRIPTOR, "SC", + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + SHADER_CHECKER_MISSING_DESCRIPTOR, "Shader uses descriptor slot %u.%u (used as type `%s`) but not declared in pipeline layout", use.first.first, use.first.second, describe_type(module, use.second.type_id).c_str()); } else if (~binding->stageFlags & pStage->stage) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, 0, __LINE__, - SHADER_CHECKER_DESCRIPTOR_NOT_ACCESSIBLE_FROM_STAGE, "SC", - "Shader uses descriptor slot %u.%u (used " - "as type `%s`) but descriptor not " - "accessible from stage %s", + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, 0, + SHADER_CHECKER_DESCRIPTOR_NOT_ACCESSIBLE_FROM_STAGE, + "Shader uses descriptor slot %u.%u (used as type `%s`) but descriptor not accessible from stage %s", use.first.first, use.first.second, describe_type(module, use.second.type_id).c_str(), string_VkShaderStageFlagBits(pStage->stage)); } else if (!descriptor_type_match(module, use.second.type_id, binding->descriptorType, required_descriptor_count)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - SHADER_CHECKER_DESCRIPTOR_TYPE_MISMATCH, "SC", - "Type mismatch on descriptor slot " - "%u.%u (used as type `%s`) but " - "descriptor of type %s", - use.first.first, use.first.second, describe_type(module, use.second.type_id).c_str(), + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + SHADER_CHECKER_DESCRIPTOR_TYPE_MISMATCH, + "Type mismatch on descriptor slot %u.%u (used as type `%s`) but descriptor of type %s", use.first.first, + use.first.second, describe_type(module, use.second.type_id).c_str(), string_VkDescriptorType(binding->descriptorType)); } else if (binding->descriptorCount < required_descriptor_count) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - SHADER_CHECKER_DESCRIPTOR_TYPE_MISMATCH, "SC", + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + SHADER_CHECKER_DESCRIPTOR_TYPE_MISMATCH, "Shader expects at least %u descriptors for binding %u.%u (used as type `%s`) but only %u provided", required_descriptor_count, use.first.first, use.first.second, describe_type(module, use.second.type_id).c_str(), binding->descriptorCount); @@ -1355,23 +1504,23 @@ if (pStage->stage == VK_SHADER_STAGE_FRAGMENT_BIT) { auto input_attachment_uses = collect_interface_by_input_attachment_index(module, accessible_ids); - auto rpci = pipeline->render_pass_ci.ptr(); + auto rpci = pipeline->rp_state->createInfo.ptr(); auto subpass = pipeline->graphicsPipelineCI.subpass; for (auto use : input_attachment_uses) { auto input_attachments = rpci->pSubpasses[subpass].pInputAttachments; auto index = (input_attachments && use.first < rpci->pSubpasses[subpass].inputAttachmentCount) - ? input_attachments[use.first].attachment - : VK_ATTACHMENT_UNUSED; + ? input_attachments[use.first].attachment + : VK_ATTACHMENT_UNUSED; if (index == VK_ATTACHMENT_UNUSED) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - SHADER_CHECKER_MISSING_INPUT_ATTACHMENT, "SC", + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + SHADER_CHECKER_MISSING_INPUT_ATTACHMENT, "Shader consumes input attachment index %d but not provided in subpass", use.first); } else if (!(get_format_type(rpci->pAttachments[index].format) & get_fundamental_type(module, use.second.type_id))) { skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - SHADER_CHECKER_INPUT_ATTACHMENT_TYPE_MISMATCH, "SC", + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + SHADER_CHECKER_INPUT_ATTACHMENT_TYPE_MISMATCH, "Subpass input attachment %u format of %s does not match type used in shader `%s`", use.first, string_VkFormat(rpci->pAttachments[index].format), describe_type(module, use.second.type_id).c_str()); } @@ -1404,13 +1553,12 @@ if (b_at_end || ((!a_at_end) && (a_first < b_first))) { skip |= log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, SHADER_CHECKER_OUTPUT_NOT_CONSUMED, "SC", - "%s writes to output location %u.%u which is not consumed by %s", producer_stage->name, a_first.first, - a_first.second, consumer_stage->name); + SHADER_CHECKER_OUTPUT_NOT_CONSUMED, "%s writes to output location %u.%u which is not consumed by %s", + producer_stage->name, a_first.first, a_first.second, consumer_stage->name); a_it++; } else if (a_at_end || a_first > b_first) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - SHADER_CHECKER_INPUT_NOT_PRODUCED, "SC", "%s consumes input location %u.%u which is not written by %s", + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + SHADER_CHECKER_INPUT_NOT_PRODUCED, "%s consumes input location %u.%u which is not written by %s", consumer_stage->name, b_first.first, b_first.second, producer_stage->name); b_it++; } else { @@ -1421,22 +1569,21 @@ if (!types_match(producer, consumer, a_it->second.type_id, b_it->second.type_id, producer_stage->arrayed_output && !a_it->second.is_patch && !a_it->second.is_block_member, consumer_stage->arrayed_input && !b_it->second.is_patch && !b_it->second.is_block_member, true)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - SHADER_CHECKER_INTERFACE_TYPE_MISMATCH, "SC", "Type mismatch on location %u.%u: '%s' vs '%s'", + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + SHADER_CHECKER_INTERFACE_TYPE_MISMATCH, "Type mismatch on location %u.%u: '%s' vs '%s'", a_first.first, a_first.second, describe_type(producer, a_it->second.type_id).c_str(), describe_type(consumer, b_it->second.type_id).c_str()); } if (a_it->second.is_patch != b_it->second.is_patch) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, 0, __LINE__, - SHADER_CHECKER_INTERFACE_TYPE_MISMATCH, "SC", - "Decoration mismatch on location %u.%u: is per-%s in %s stage but " - "per-%s in %s stage", + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, 0, + SHADER_CHECKER_INTERFACE_TYPE_MISMATCH, + "Decoration mismatch on location %u.%u: is per-%s in %s stage but per-%s in %s stage", a_first.first, a_first.second, a_it->second.is_patch ? "patch" : "vertex", producer_stage->name, b_it->second.is_patch ? "patch" : "vertex", consumer_stage->name); } if (a_it->second.is_relaxed_precision != b_it->second.is_relaxed_precision) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, 0, __LINE__, - SHADER_CHECKER_INTERFACE_TYPE_MISMATCH, "SC", + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, 0, + SHADER_CHECKER_INTERFACE_TYPE_MISMATCH, "Decoration mismatch on location %u.%u: %s and %s stages differ in precision", a_first.first, a_first.second, producer_stage->name, consumer_stage->name); } @@ -1491,18 +1638,20 @@ for (; producer != fragment_stage && consumer <= fragment_stage; consumer++) { assert(shaders[producer]); - if (shaders[consumer] && shaders[consumer]->has_valid_spirv && shaders[producer]->has_valid_spirv) { - skip |= validate_interface_between_stages(report_data, shaders[producer], entrypoints[producer], - &shader_stage_attribs[producer], shaders[consumer], entrypoints[consumer], - &shader_stage_attribs[consumer]); + if (shaders[consumer]) { + if (shaders[consumer]->has_valid_spirv && shaders[producer]->has_valid_spirv) { + skip |= validate_interface_between_stages(report_data, shaders[producer], entrypoints[producer], + &shader_stage_attribs[producer], shaders[consumer], entrypoints[consumer], + &shader_stage_attribs[consumer]); + } producer = consumer; } } if (shaders[fragment_stage] && shaders[fragment_stage]->has_valid_spirv) { - skip |= validate_fs_outputs_against_render_pass(report_data, shaders[fragment_stage], entrypoints[fragment_stage], - pipeline, pCreateInfo->subpass); + skip |= validate_fs_outputs_against_render_pass(report_data, shaders[fragment_stage], entrypoints[fragment_stage], pipeline, + pCreateInfo->subpass); } return skip; @@ -1517,6 +1666,17 @@ return validate_pipeline_shader_stage(dev_data, &pCreateInfo->stage, pipeline, &module, &entrypoint); } +uint32_t ValidationCache::MakeShaderHash(VkShaderModuleCreateInfo const *smci) { return XXH32(smci->pCode, smci->codeSize, 0); } + +static ValidationCache *GetValidationCacheInfo(VkShaderModuleCreateInfo const *pCreateInfo) { + while ((pCreateInfo = (VkShaderModuleCreateInfo const *)pCreateInfo->pNext) != nullptr) { + if (pCreateInfo->sType == VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT) + return (ValidationCache *)((VkShaderModuleValidationCacheCreateInfoEXT const *)pCreateInfo)->validationCache; + } + + return nullptr; +} + bool PreCallValidateCreateShaderModule(layer_data *dev_data, VkShaderModuleCreateInfo const *pCreateInfo, bool *spirv_valid) { bool skip = false; spv_result_t spv_valid = SPV_SUCCESS; @@ -1529,23 +1689,33 @@ auto have_glsl_shader = GetEnabledExtensions(dev_data)->vk_nv_glsl_shader; if (!have_glsl_shader && (pCreateInfo->codeSize % 4)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, - __LINE__, VALIDATION_ERROR_12a00ac0, "SC", - "SPIR-V module not valid: Codesize must be a multiple of 4 but is " PRINTF_SIZE_T_SPECIFIER ". %s", - pCreateInfo->codeSize, validation_error_map[VALIDATION_ERROR_12a00ac0]); + skip |= log_msg( + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, VALIDATION_ERROR_12a00ac0, + "SPIR-V module not valid: Codesize must be a multiple of 4 but is " PRINTF_SIZE_T_SPECIFIER ".", pCreateInfo->codeSize); } else { + auto cache = GetValidationCacheInfo(pCreateInfo); + uint32_t hash = 0; + if (cache) { + hash = ValidationCache::MakeShaderHash(pCreateInfo); + if (cache->Contains(hash)) return false; + } + // Use SPIRV-Tools validator to try and catch any issues with the module itself spv_context ctx = spvContextCreate(SPV_ENV_VULKAN_1_0); - spv_const_binary_t binary{ pCreateInfo->pCode, pCreateInfo->codeSize / sizeof(uint32_t) }; + spv_const_binary_t binary{pCreateInfo->pCode, pCreateInfo->codeSize / sizeof(uint32_t)}; spv_diagnostic diag = nullptr; spv_valid = spvValidate(ctx, &binary, &diag); if (spv_valid != SPV_SUCCESS) { if (!have_glsl_shader || (pCreateInfo->pCode[0] == spv::MagicNumber)) { - skip |= log_msg(report_data, - spv_valid == SPV_WARNING ? VK_DEBUG_REPORT_WARNING_BIT_EXT : VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, SHADER_CHECKER_INCONSISTENT_SPIRV, "SC", - "SPIR-V module not valid: %s", diag && diag->error ? diag->error : "(no error text)"); + skip |= + log_msg(report_data, spv_valid == SPV_WARNING ? VK_DEBUG_REPORT_WARNING_BIT_EXT : VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, SHADER_CHECKER_INCONSISTENT_SPIRV, + "SPIR-V module not valid: %s", diag && diag->error ? diag->error : "(no error text)"); + } + } else { + if (cache) { + cache->Insert(hash); } } diff -Nru vulkan-1.0.65.2+dfsg1/layers/shader_validation.h vulkan-1.1.73+dfsg/layers/shader_validation.h --- vulkan-1.0.65.2+dfsg1/layers/shader_validation.h 2017-07-03 14:21:22.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/shader_validation.h 2018-03-14 09:08:48.000000000 +0000 @@ -20,6 +20,8 @@ #ifndef VULKAN_SHADER_VALIDATION_H #define VULKAN_SHADER_VALIDATION_H +#include + // A forward iterator over spirv instructions. Provides easy access to len, opcode, and content words // without the caller needing to care too much about the physical SPIRV module layout. struct spirv_inst_iter { @@ -100,9 +102,99 @@ void build_def_index(); }; +class ValidationCache { + // hashes of shaders that have passed validation before, and can be skipped. + // we don't store negative results, as we would have to also store what was + // wrong with them; also, we expect they will get fixed, so we're less + // likely to see them again. + std::unordered_set good_shader_hashes; + ValidationCache() {} + + public: + static VkValidationCacheEXT Create(VkValidationCacheCreateInfoEXT const *pCreateInfo) { + auto cache = new ValidationCache(); + cache->Load(pCreateInfo); + return VkValidationCacheEXT(cache); + } + + void Load(VkValidationCacheCreateInfoEXT const *pCreateInfo) { + const auto headerSize = 2 * sizeof(uint32_t) + VK_UUID_SIZE; + auto size = headerSize; + if (!pCreateInfo->pInitialData || pCreateInfo->initialDataSize < size) return; + + uint32_t const *data = (uint32_t const *)pCreateInfo->pInitialData; + if (data[0] != size) return; + if (data[1] != VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT) return; + uint8_t expected_uuid[VK_UUID_SIZE]; + Sha1ToVkUuid(SPIRV_TOOLS_COMMIT_ID, expected_uuid); + if (memcmp(&data[2], expected_uuid, VK_UUID_SIZE) != 0) return; // different version + + data = (uint32_t const *)(reinterpret_cast(data) + headerSize); + + for (; size < pCreateInfo->initialDataSize; data++, size += sizeof(uint32_t)) { + good_shader_hashes.insert(*data); + } + } + + void Write(size_t *pDataSize, void *pData) { + const auto headerSize = 2 * sizeof(uint32_t) + VK_UUID_SIZE; // 4 bytes for header size + 4 bytes for version number + UUID + if (!pData) { + *pDataSize = headerSize + good_shader_hashes.size() * sizeof(uint32_t); + return; + } + + if (*pDataSize < headerSize) { + *pDataSize = 0; + return; // Too small for even the header! + } + + uint32_t *out = (uint32_t *)pData; + size_t actualSize = headerSize; + + // Write the header + *out++ = headerSize; + *out++ = VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT; + Sha1ToVkUuid(SPIRV_TOOLS_COMMIT_ID, reinterpret_cast(out)); + out = (uint32_t *)(reinterpret_cast(out) + VK_UUID_SIZE); + + for (auto it = good_shader_hashes.begin(); it != good_shader_hashes.end() && actualSize < *pDataSize; + it++, out++, actualSize += sizeof(uint32_t)) { + *out = *it; + } + + *pDataSize = actualSize; + } + + void Merge(ValidationCache const *other) { + good_shader_hashes.reserve(good_shader_hashes.size() + other->good_shader_hashes.size()); + for (auto h : other->good_shader_hashes) good_shader_hashes.insert(h); + } + + static uint32_t MakeShaderHash(VkShaderModuleCreateInfo const *smci); + + bool Contains(uint32_t hash) { return good_shader_hashes.count(hash) != 0; } + + void Insert(uint32_t hash) { good_shader_hashes.insert(hash); } + + private: + void Sha1ToVkUuid(const char *sha1_str, uint8_t uuid[VK_UUID_SIZE]) { + // Convert sha1_str from a hex string to binary. We only need VK_UUID_BYTES of + // output, so pad with zeroes if the input string is shorter than that, and truncate + // if it's longer. + char padded_sha1_str[2 * VK_UUID_SIZE + 1] = {}; + strncpy(padded_sha1_str, sha1_str, 2 * VK_UUID_SIZE + 1); + char byte_str[3] = {}; + for (uint32_t i = 0; i < VK_UUID_SIZE; ++i) { + byte_str[0] = padded_sha1_str[2 * i + 0]; + byte_str[1] = padded_sha1_str[2 * i + 1]; + uuid[i] = static_cast(strtol(byte_str, NULL, 16)); + } + } +}; + bool validate_and_capture_pipeline_shader_state(layer_data *dev_data, PIPELINE_STATE *pPipeline); bool validate_compute_pipeline(layer_data *dev_data, PIPELINE_STATE *pPipeline); typedef std::pair descriptor_slot_t; bool PreCallValidateCreateShaderModule(layer_data *dev_data, VkShaderModuleCreateInfo const *pCreateInfo, bool *spirv_valid); -#endif //VULKAN_SHADER_VALIDATION_H +#endif // VULKAN_SHADER_VALIDATION_H diff -Nru vulkan-1.0.65.2+dfsg1/layers/threading.cpp vulkan-1.1.73+dfsg/layers/threading.cpp --- vulkan-1.0.65.2+dfsg1/layers/threading.cpp 2017-07-03 14:21:22.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/threading.cpp 2018-03-14 09:08:48.000000000 +0000 @@ -42,7 +42,8 @@ static uint32_t loader_layer_if_version = CURRENT_LOADER_LAYER_INTERFACE_VERSION; static void initThreading(layer_data *my_data, const VkAllocationCallbacks *pAllocator) { - layer_debug_actions(my_data->report_data, my_data->logging_callback, pAllocator, "google_threading"); + layer_debug_report_actions(my_data->report_data, my_data->logging_callback, pAllocator, "google_threading"); + layer_debug_messenger_actions(my_data->report_data, my_data->logging_messenger, pAllocator, "google_threading"); } VKAPI_ATTR VkResult VKAPI_CALL CreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, @@ -67,14 +68,16 @@ my_data->instance_dispatch_table = new VkLayerInstanceDispatchTable; layer_init_instance_dispatch_table(*pInstance, my_data->instance_dispatch_table, fpGetInstanceProcAddr); - my_data->report_data = debug_report_create_instance(my_data->instance_dispatch_table, *pInstance, - pCreateInfo->enabledExtensionCount, pCreateInfo->ppEnabledExtensionNames); + my_data->report_data = debug_utils_create_instance(my_data->instance_dispatch_table, *pInstance, + pCreateInfo->enabledExtensionCount, pCreateInfo->ppEnabledExtensionNames); initThreading(my_data, pAllocator); // Look for one or more debug report create info structures, and copy the // callback(s) for each one found (for use by vkDestroyInstance) - layer_copy_tmp_callbacks(pCreateInfo->pNext, &my_data->num_tmp_callbacks, &my_data->tmp_dbg_create_infos, - &my_data->tmp_callbacks); + layer_copy_tmp_debug_messengers(pCreateInfo->pNext, &my_data->num_tmp_debug_messengers, &my_data->tmp_messenger_create_infos, + &my_data->tmp_debug_messengers); + layer_copy_tmp_report_callbacks(pCreateInfo->pNext, &my_data->num_tmp_report_callbacks, &my_data->tmp_report_create_infos, + &my_data->tmp_report_callbacks); return result; } @@ -85,9 +88,15 @@ // Enable the temporary callback(s) here to catch cleanup issues: bool callback_setup = false; - if (my_data->num_tmp_callbacks > 0) { - if (!layer_enable_tmp_callbacks(my_data->report_data, my_data->num_tmp_callbacks, my_data->tmp_dbg_create_infos, - my_data->tmp_callbacks)) { + if (my_data->num_tmp_debug_messengers > 0) { + if (!layer_enable_tmp_debug_messengers(my_data->report_data, my_data->num_tmp_debug_messengers, + my_data->tmp_messenger_create_infos, my_data->tmp_debug_messengers)) { + callback_setup = true; + } + } + if (my_data->num_tmp_report_callbacks > 0) { + if (!layer_enable_tmp_report_callbacks(my_data->report_data, my_data->num_tmp_report_callbacks, + my_data->tmp_report_create_infos, my_data->tmp_report_callbacks)) { callback_setup = true; } } @@ -105,21 +114,31 @@ // Disable and cleanup the temporary callback(s): if (callback_setup) { - layer_disable_tmp_callbacks(my_data->report_data, my_data->num_tmp_callbacks, my_data->tmp_callbacks); + layer_disable_tmp_debug_messengers(my_data->report_data, my_data->num_tmp_debug_messengers, my_data->tmp_debug_messengers); + layer_disable_tmp_report_callbacks(my_data->report_data, my_data->num_tmp_report_callbacks, my_data->tmp_report_callbacks); } - if (my_data->num_tmp_callbacks > 0) { - layer_free_tmp_callbacks(my_data->tmp_dbg_create_infos, my_data->tmp_callbacks); - my_data->num_tmp_callbacks = 0; + if (my_data->num_tmp_debug_messengers > 0) { + layer_free_tmp_debug_messengers(my_data->tmp_messenger_create_infos, my_data->tmp_debug_messengers); + my_data->num_tmp_debug_messengers = 0; + } + if (my_data->num_tmp_report_callbacks > 0) { + layer_free_tmp_report_callbacks(my_data->tmp_report_create_infos, my_data->tmp_report_callbacks); + my_data->num_tmp_report_callbacks = 0; + } + + // Clean up logging callbacks, if any + while (my_data->logging_messenger.size() > 0) { + VkDebugUtilsMessengerEXT messenger = my_data->logging_messenger.back(); + layer_destroy_messenger_callback(my_data->report_data, messenger, pAllocator); + my_data->logging_messenger.pop_back(); } - - // Clean up logging callback, if any while (my_data->logging_callback.size() > 0) { VkDebugReportCallbackEXT callback = my_data->logging_callback.back(); - layer_destroy_msg_callback(my_data->report_data, callback, pAllocator); + layer_destroy_report_callback(my_data->report_data, callback, pAllocator); my_data->logging_callback.pop_back(); } - layer_debug_report_destroy_instance(my_data->report_data); + layer_debug_utils_destroy_instance(my_data->report_data); delete my_data->instance_dispatch_table; FreeLayerDataPtr(key, layer_data_map); } @@ -151,7 +170,7 @@ my_device_data->device_dispatch_table = new VkLayerDispatchTable; layer_init_device_dispatch_table(*pDevice, my_device_data->device_dispatch_table, fpGetDeviceProcAddr); - my_device_data->report_data = layer_debug_report_create_device(my_instance_data->report_data, *pDevice); + my_device_data->report_data = layer_debug_utils_create_device(my_instance_data->report_data, *pDevice); return result; } @@ -194,13 +213,14 @@ return result; } -static const VkExtensionProperties threading_extensions[] = { - {VK_EXT_DEBUG_REPORT_EXTENSION_NAME, VK_EXT_DEBUG_REPORT_SPEC_VERSION}}; +static const VkExtensionProperties threading_extensions[] = {{VK_EXT_DEBUG_REPORT_EXTENSION_NAME, VK_EXT_DEBUG_REPORT_SPEC_VERSION}, + {VK_EXT_DEBUG_UTILS_EXTENSION_NAME, VK_EXT_DEBUG_UTILS_SPEC_VERSION}}; static const VkLayerProperties layerProps = { "VK_LAYER_GOOGLE_threading", VK_LAYER_API_VERSION, // specVersion - 1, "Google Validation Layer", + 1, + "Google Validation Layer", }; VKAPI_ATTR VkResult VKAPI_CALL EnumerateInstanceLayerProperties(uint32_t *pCount, VkLayerProperties *pProperties) { @@ -271,6 +291,52 @@ return pTable->GetPhysicalDeviceProcAddr(instance, funcName); } +// VK_EXT_debug_utils commands +VKAPI_ATTR VkResult VKAPI_CALL CreateDebugUtilsMessengerEXT(VkInstance instance, + const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDebugUtilsMessengerEXT *pMessenger) { + layer_data *my_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); + bool threadChecks = startMultiThread(); + if (threadChecks) { + startReadObject(my_data, instance); + } + VkResult result = my_data->instance_dispatch_table->CreateDebugUtilsMessengerEXT(instance, pCreateInfo, pAllocator, pMessenger); + + if (VK_SUCCESS == result) { + result = layer_create_messenger_callback(my_data->report_data, false, pCreateInfo, pAllocator, pMessenger); + // If something happened during this call, clean up the message callback that was created earlier in the lower levels + if (VK_SUCCESS != result) { + my_data->instance_dispatch_table->DestroyDebugUtilsMessengerEXT(instance, *pMessenger, pAllocator); + } + } + if (threadChecks) { + finishReadObject(my_data, instance); + } else { + finishMultiThread(); + } + return result; +} + +VKAPI_ATTR void VKAPI_CALL DestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, + const VkAllocationCallbacks *pAllocator) { + layer_data *my_data = GetLayerDataPtr(get_dispatch_key(instance), layer_data_map); + bool threadChecks = startMultiThread(); + if (threadChecks) { + startReadObject(my_data, instance); + startWriteObject(my_data, messenger); + } + my_data->instance_dispatch_table->DestroyDebugUtilsMessengerEXT(instance, messenger, pAllocator); + layer_destroy_messenger_callback(my_data->report_data, messenger, pAllocator); + if (threadChecks) { + finishReadObject(my_data, instance); + finishWriteObject(my_data, messenger); + } else { + finishMultiThread(); + } +} + +// VK_EXT_debug_report commands VKAPI_ATTR VkResult VKAPI_CALL CreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, @@ -283,7 +349,11 @@ VkResult result = my_data->instance_dispatch_table->CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pMsgCallback); if (VK_SUCCESS == result) { - result = layer_create_msg_callback(my_data->report_data, false, pCreateInfo, pAllocator, pMsgCallback); + result = layer_create_report_callback(my_data->report_data, false, pCreateInfo, pAllocator, pMsgCallback); + // If something happened during this call, clean up the message callback that was created earlier in the lower levels + if (VK_SUCCESS != result) { + my_data->instance_dispatch_table->DestroyDebugReportCallbackEXT(instance, *pMsgCallback, pAllocator); + } } if (threadChecks) { finishReadObject(my_data, instance); @@ -302,7 +372,7 @@ startWriteObject(my_data, callback); } my_data->instance_dispatch_table->DestroyDebugReportCallbackEXT(instance, callback, pAllocator); - layer_destroy_msg_callback(my_data->report_data, callback, pAllocator); + layer_destroy_report_callback(my_data->report_data, callback, pAllocator); if (threadChecks) { finishReadObject(my_data, instance); finishWriteObject(my_data, callback); @@ -399,6 +469,23 @@ } // namespace threading // vk_layer_logging.h expects these to be defined +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDebugUtilsMessengerEXT(VkInstance instance, + const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDebugUtilsMessengerEXT *pMessenger) { + return threading::CreateDebugUtilsMessengerEXT(instance, pCreateInfo, pAllocator, pMessenger); +} + +VKAPI_ATTR void VKAPI_CALL vkDestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, + const VkAllocationCallbacks *pAllocator) { + threading::DestroyDebugUtilsMessengerEXT(instance, messenger, pAllocator); +} + +VKAPI_ATTR void VKAPI_CALL vkSubmitDebugUtilsMessageEXT(VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, + VkDebugUtilsMessageTypeFlagsEXT messageTypes, + const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData) { + threading::SubmitDebugUtilsMessageEXT(instance, messageSeverity, messageTypes, pCallbackData); +} VKAPI_ATTR VkResult VKAPI_CALL vkCreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, diff -Nru vulkan-1.0.65.2+dfsg1/layers/threading.h vulkan-1.1.73+dfsg/layers/threading.h --- vulkan-1.0.65.2+dfsg1/layers/threading.h 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/threading.h 2018-04-27 11:24:19.000000000 +0000 @@ -26,11 +26,20 @@ #include "vk_layer_config.h" #include "vk_layer_logging.h" -#if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(_M_X64) || defined(__ia64) || defined(_M_IA64) || \ - defined(__aarch64__) || defined(__powerpc64__) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(DISTINCT_NONDISPATCHABLE_PHONY_HANDLE) +// The following line must match the vulkan_core.h condition guarding VK_DEFINE_NON_DISPATCHABLE_HANDLE +#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64) || defined(__ia64) || \ + defined(_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) // If pointers are 64-bit, then there can be separate counters for each // NONDISPATCHABLE_HANDLE type. Otherwise they are all typedef uint64_t. #define DISTINCT_NONDISPATCHABLE_HANDLES +// Make sure we catch any disagreement between us and the vulkan definition +static_assert(std::is_pointer::value, + "Mismatched non-dispatchable handle handle, expected pointer type."); +#else +// Make sure we catch any disagreement between us and the vulkan definition +static_assert(std::is_same::value, + "Mismatched non-dispatchable handle handle, expected uint64_t."); #endif // Draw State ERROR codes @@ -94,10 +103,11 @@ if (use_data->reader_count == 0) { // There are no readers. Two writers just collided. if (use_data->thread != tid) { - skipCall |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, objectType, (uint64_t)(object), 0, - THREADING_CHECKER_MULTIPLE_THREADS, "THREADING", - "THREADING ERROR : object of type %s is simultaneously used in thread %ld and thread %ld", - typeName, use_data->thread, tid); + skipCall |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, objectType, (uint64_t)(object), + THREADING_CHECKER_MULTIPLE_THREADS, + "THREADING ERROR : object of type %s is simultaneously used in " + "thread 0x%" PRIx64 " and thread 0x%" PRIx64, + typeName, (uint64_t)use_data->thread, (uint64_t)tid); if (skipCall) { // Wait for thread-safe access to object instead of skipping call. while (uses.find(object) != uses.end()) { @@ -121,10 +131,11 @@ } else { // There are readers. This writer collided with them. if (use_data->thread != tid) { - skipCall |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, objectType, (uint64_t)(object), 0, - THREADING_CHECKER_MULTIPLE_THREADS, "THREADING", - "THREADING ERROR : object of type %s is simultaneously used in thread %ld and thread %ld", - typeName, use_data->thread, tid); + skipCall |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, objectType, (uint64_t)(object), + THREADING_CHECKER_MULTIPLE_THREADS, + "THREADING ERROR : object of type %s is simultaneously used in " + "thread 0x%" PRIx64 " and thread 0x%" PRIx64, + typeName, (uint64_t)use_data->thread, (uint64_t)tid); if (skipCall) { // Wait for thread-safe access to object instead of skipping call. while (uses.find(object) != uses.end()) { @@ -179,10 +190,11 @@ use_data->thread = tid; } else if (uses[object].writer_count > 0 && uses[object].thread != tid) { // There is a writer of the object. - skipCall |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, objectType, (uint64_t)(object), 0, - THREADING_CHECKER_MULTIPLE_THREADS, "THREADING", - "THREADING ERROR : object of type %s is simultaneously used in thread %ld and thread %ld", typeName, - uses[object].thread, tid); + skipCall |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, objectType, (uint64_t)(object), + THREADING_CHECKER_MULTIPLE_THREADS, + "THREADING ERROR : object of type %s is simultaneously used in " + "thread 0x%" PRIx64 " and thread 0x%" PRIx64, + typeName, (uint64_t)uses[object].thread, (uint64_t)tid); if (skipCall) { // Wait for thread-safe access to object instead of skipping call. while (uses.find(object) != uses.end()) { @@ -225,13 +237,19 @@ debug_report_data *report_data; std::vector logging_callback; + std::vector logging_messenger; VkLayerDispatchTable *device_dispatch_table; VkLayerInstanceDispatchTable *instance_dispatch_table; + // The following are for keeping track of the temporary callbacks that can // be used in vkCreateInstance and vkDestroyInstance: - uint32_t num_tmp_callbacks; - VkDebugReportCallbackCreateInfoEXT *tmp_dbg_create_infos; - VkDebugReportCallbackEXT *tmp_callbacks; + uint32_t num_tmp_report_callbacks; + VkDebugReportCallbackCreateInfoEXT *tmp_report_create_infos; + VkDebugReportCallbackEXT *tmp_report_callbacks; + uint32_t num_tmp_debug_messengers; + VkDebugUtilsMessengerCreateInfoEXT *tmp_messenger_create_infos; + VkDebugUtilsMessengerEXT *tmp_debug_messengers; + counter c_VkCommandBuffer; counter c_VkDevice; counter c_VkInstance; @@ -267,15 +285,19 @@ counter c_VkDescriptorUpdateTemplateKHR; counter c_VkValidationCacheEXT; counter c_VkSamplerYcbcrConversionKHR; + counter c_VkDebugUtilsMessengerEXT; #else // DISTINCT_NONDISPATCHABLE_HANDLES counter c_uint64_t; #endif // DISTINCT_NONDISPATCHABLE_HANDLES layer_data() : report_data(nullptr), - num_tmp_callbacks(0), - tmp_dbg_create_infos(nullptr), - tmp_callbacks(nullptr), + num_tmp_report_callbacks(0), + tmp_report_create_infos(nullptr), + tmp_report_callbacks(nullptr), + num_tmp_debug_messengers(0), + tmp_messenger_create_infos(nullptr), + tmp_debug_messengers(nullptr), c_VkCommandBuffer("VkCommandBuffer", VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT), c_VkDevice("VkDevice", VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT), c_VkInstance("VkInstance", VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT), @@ -303,13 +325,17 @@ c_VkShaderModule("VkShaderModule", VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT), c_VkDebugReportCallbackEXT("VkDebugReportCallbackEXT", VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT), c_VkObjectTableNVX("VkObjectTableNVX", VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT), - c_VkIndirectCommandsLayoutNVX("VkIndirectCommandsLayoutNVX", VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT), + c_VkIndirectCommandsLayoutNVX("VkIndirectCommandsLayoutNVX", + VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT), c_VkDisplayKHR("VkDisplayKHR", VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT), c_VkDisplayModeKHR("VkDisplayModeKHR", VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT), c_VkSurfaceKHR("VkSurfaceKHR", VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT), c_VkSwapchainKHR("VkSwapchainKHR", VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT), - c_VkDescriptorUpdateTemplateKHR("VkDescriptorUpdateTemplateKHR", VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT), - c_VkSamplerYcbcrConversionKHR("VkSamplerYcbcrConversionKHR", VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR_EXT) + c_VkDescriptorUpdateTemplateKHR("VkDescriptorUpdateTemplateKHR", + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT), + c_VkSamplerYcbcrConversionKHR("VkSamplerYcbcrConversionKHR", + VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR_EXT), + c_VkDebugUtilsMessengerEXT("VkDebugUtilsMessengerEXT", VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT) #else // DISTINCT_NONDISPATCHABLE_HANDLES c_uint64_t("NON_DISPATCHABLE_HANDLE", VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT) #endif // DISTINCT_NONDISPATCHABLE_HANDLES @@ -360,6 +386,7 @@ WRAPPER(VkDescriptorUpdateTemplateKHR) WRAPPER(VkValidationCacheEXT) WRAPPER(VkSamplerYcbcrConversionKHR) +WRAPPER(VkDebugUtilsMessengerEXT) #else // DISTINCT_NONDISPATCHABLE_HANDLES WRAPPER(uint64_t) #endif // DISTINCT_NONDISPATCHABLE_HANDLES diff -Nru vulkan-1.0.65.2+dfsg1/layers/threading_layer.md vulkan-1.1.73+dfsg/layers/threading_layer.md --- vulkan-1.0.65.2+dfsg1/layers/threading_layer.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/threading_layer.md 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,2 @@ +# VK\_LAYER\_GOOGLE\_threading +The `VK_LAYER_GOOGLE_threading` layer checks multi-threading of API calls for validity. Checks performed by this layer include ensuring that only one thread at a time uses an object in free-threaded API calls. diff -Nru vulkan-1.0.65.2+dfsg1/layers/unique_objects.cpp vulkan-1.1.73+dfsg/layers/unique_objects.cpp --- vulkan-1.0.65.2+dfsg1/layers/unique_objects.cpp 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/unique_objects.cpp 2018-04-27 11:24:19.000000000 +0000 @@ -46,6 +46,7 @@ #include "vk_enum_string_helper.h" #include "vk_validation_error_messages.h" #include "vk_object_types.h" +#include "vk_extension_helper.h" #include "vulkan/vk_layer.h" // This intentionally includes a cpp file @@ -58,7 +59,9 @@ static uint32_t loader_layer_if_version = CURRENT_LOADER_LAYER_INTERFACE_VERSION; static void initUniqueObjects(instance_layer_data *instance_data, const VkAllocationCallbacks *pAllocator) { - layer_debug_actions(instance_data->report_data, instance_data->logging_callback, pAllocator, "google_unique_objects"); + layer_debug_report_actions(instance_data->report_data, instance_data->logging_callback, pAllocator, "google_unique_objects"); + layer_debug_messenger_actions(instance_data->report_data, instance_data->logging_messenger, pAllocator, + "google_unique_objects"); } // Check enabled instance extensions against supported instance extension whitelist @@ -67,11 +70,11 @@ for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { // Check for recognized instance extensions - if (!white_list(pCreateInfo->ppEnabledExtensionNames[i], kUniqueObjectsSupportedInstanceExtensions)) { - log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_UNDEFINED, "UniqueObjects", - "Instance Extension %s is not supported by this layer. Using this extension may adversely affect " - "validation results and/or produce undefined behavior.", + if (!white_list(pCreateInfo->ppEnabledExtensionNames[i], kInstanceExtensionNames)) { + log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_UNDEFINED, + "Instance Extension %s is not supported by this layer. Using this extension may adversely affect validation " + "results and/or produce undefined behavior.", pCreateInfo->ppEnabledExtensionNames[i]); } } @@ -83,11 +86,11 @@ for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { // Check for recognized device extensions - if (!white_list(pCreateInfo->ppEnabledExtensionNames[i], kUniqueObjectsSupportedDeviceExtensions)) { - log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_UNDEFINED, "UniqueObjects", - "Device Extension %s is not supported by this layer. Using this extension may adversely affect " - "validation results and/or produce undefined behavior.", + if (!white_list(pCreateInfo->ppEnabledExtensionNames[i], kDeviceExtensionNames)) { + log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + VALIDATION_ERROR_UNDEFINED, + "Device Extension %s is not supported by this layer. Using this extension may adversely affect validation " + "results and/or produce undefined behavior.", pCreateInfo->ppEnabledExtensionNames[i]); } } @@ -117,18 +120,27 @@ layer_init_instance_dispatch_table(*pInstance, &instance_data->dispatch_table, fpGetInstanceProcAddr); instance_data->instance = *pInstance; - instance_data->report_data = - debug_report_create_instance(&instance_data->dispatch_table, *pInstance, pCreateInfo->enabledExtensionCount, - pCreateInfo->ppEnabledExtensionNames); + instance_data->report_data = debug_utils_create_instance( + &instance_data->dispatch_table, *pInstance, pCreateInfo->enabledExtensionCount, pCreateInfo->ppEnabledExtensionNames); // Set up temporary debug callbacks to output messages at CreateInstance-time - if (!layer_copy_tmp_callbacks(pCreateInfo->pNext, &instance_data->num_tmp_callbacks, &instance_data->tmp_dbg_create_infos, - &instance_data->tmp_callbacks)) { - if (instance_data->num_tmp_callbacks > 0) { - if (layer_enable_tmp_callbacks(instance_data->report_data, instance_data->num_tmp_callbacks, - instance_data->tmp_dbg_create_infos, instance_data->tmp_callbacks)) { - layer_free_tmp_callbacks(instance_data->tmp_dbg_create_infos, instance_data->tmp_callbacks); - instance_data->num_tmp_callbacks = 0; + if (!layer_copy_tmp_debug_messengers(pCreateInfo->pNext, &instance_data->num_tmp_debug_messengers, + &instance_data->tmp_messenger_create_infos, &instance_data->tmp_debug_messengers)) { + if (instance_data->num_tmp_debug_messengers > 0) { + if (layer_enable_tmp_debug_messengers(instance_data->report_data, instance_data->num_tmp_debug_messengers, + instance_data->tmp_messenger_create_infos, instance_data->tmp_debug_messengers)) { + layer_free_tmp_debug_messengers(instance_data->tmp_messenger_create_infos, instance_data->tmp_debug_messengers); + instance_data->num_tmp_debug_messengers = 0; + } + } + } + if (!layer_copy_tmp_report_callbacks(pCreateInfo->pNext, &instance_data->num_tmp_report_callbacks, + &instance_data->tmp_report_create_infos, &instance_data->tmp_report_callbacks)) { + if (instance_data->num_tmp_report_callbacks > 0) { + if (layer_enable_tmp_report_callbacks(instance_data->report_data, instance_data->num_tmp_report_callbacks, + instance_data->tmp_report_create_infos, instance_data->tmp_report_callbacks)) { + layer_free_tmp_report_callbacks(instance_data->tmp_report_create_infos, instance_data->tmp_report_callbacks); + instance_data->num_tmp_report_callbacks = 0; } } } @@ -137,10 +149,17 @@ InstanceExtensionWhitelist(pCreateInfo, *pInstance); // Disable and free tmp callbacks, no longer necessary - if (instance_data->num_tmp_callbacks > 0) { - layer_disable_tmp_callbacks(instance_data->report_data, instance_data->num_tmp_callbacks, instance_data->tmp_callbacks); - layer_free_tmp_callbacks(instance_data->tmp_dbg_create_infos, instance_data->tmp_callbacks); - instance_data->num_tmp_callbacks = 0; + if (instance_data->num_tmp_debug_messengers > 0) { + layer_disable_tmp_debug_messengers(instance_data->report_data, instance_data->num_tmp_debug_messengers, + instance_data->tmp_debug_messengers); + layer_free_tmp_debug_messengers(instance_data->tmp_messenger_create_infos, instance_data->tmp_debug_messengers); + instance_data->num_tmp_debug_messengers = 0; + } + if (instance_data->num_tmp_report_callbacks > 0) { + layer_disable_tmp_report_callbacks(instance_data->report_data, instance_data->num_tmp_report_callbacks, + instance_data->tmp_report_callbacks); + layer_free_tmp_report_callbacks(instance_data->tmp_report_create_infos, instance_data->tmp_report_callbacks); + instance_data->num_tmp_report_callbacks = 0; } return result; @@ -153,13 +172,18 @@ disp_table->DestroyInstance(instance, pAllocator); // Clean up logging callback, if any + while (instance_data->logging_messenger.size() > 0) { + VkDebugUtilsMessengerEXT messenger = instance_data->logging_messenger.back(); + layer_destroy_messenger_callback(instance_data->report_data, messenger, pAllocator); + instance_data->logging_messenger.pop_back(); + } while (instance_data->logging_callback.size() > 0) { VkDebugReportCallbackEXT callback = instance_data->logging_callback.back(); - layer_destroy_msg_callback(instance_data->report_data, callback, pAllocator); + layer_destroy_report_callback(instance_data->report_data, callback, pAllocator); instance_data->logging_callback.pop_back(); } - layer_debug_report_destroy_instance(instance_data->report_data); + layer_debug_utils_destroy_instance(instance_data->report_data); FreeLayerDataPtr(key, instance_layer_data_map); } @@ -185,7 +209,7 @@ } layer_data *my_device_data = GetLayerDataPtr(get_dispatch_key(*pDevice), layer_data_map); - my_device_data->report_data = layer_debug_report_create_device(my_instance_data->report_data, *pDevice); + my_device_data->report_data = layer_debug_utils_create_device(my_instance_data->report_data, *pDevice); // Setup layer's device dispatch table layer_init_device_dispatch_table(*pDevice, &my_device_data->dispatch_table, fpGetDeviceProcAddr); @@ -202,7 +226,7 @@ dispatch_key key = get_dispatch_key(device); layer_data *dev_data = GetLayerDataPtr(key, layer_data_map); - layer_debug_report_destroy_device(device); + layer_debug_utils_destroy_device(device); dev_data->dispatch_table.DestroyDevice(device, pAllocator); FreeLayerDataPtr(key, layer_data_map); @@ -269,7 +293,6 @@ return table.GetInstanceProcAddr(instance, funcName); } - VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetPhysicalDeviceProcAddr(VkInstance instance, const char *funcName) { instance_layer_data *instance_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); VkLayerInstanceDispatchTable *disp_table = &instance_data->dispatch_table; @@ -290,29 +313,29 @@ for (uint32_t idx0 = 0; idx0 < createInfoCount; ++idx0) { local_pCreateInfos[idx0].initialize(&pCreateInfos[idx0]); if (pCreateInfos[idx0].basePipelineHandle) { - local_pCreateInfos[idx0].basePipelineHandle = Unwrap(device_data, pCreateInfos[idx0].basePipelineHandle); + local_pCreateInfos[idx0].basePipelineHandle = Unwrap(pCreateInfos[idx0].basePipelineHandle); } if (pCreateInfos[idx0].layout) { - local_pCreateInfos[idx0].layout = Unwrap(device_data, pCreateInfos[idx0].layout); + local_pCreateInfos[idx0].layout = Unwrap(pCreateInfos[idx0].layout); } if (pCreateInfos[idx0].stage.module) { - local_pCreateInfos[idx0].stage.module = Unwrap(device_data, pCreateInfos[idx0].stage.module); + local_pCreateInfos[idx0].stage.module = Unwrap(pCreateInfos[idx0].stage.module); } } } if (pipelineCache) { std::lock_guard lock(global_lock); - pipelineCache = Unwrap(device_data, pipelineCache); + pipelineCache = Unwrap(pipelineCache); } - VkResult result = device_data->dispatch_table.CreateComputePipelines( - device, pipelineCache, createInfoCount, local_pCreateInfos->ptr(), pAllocator, pPipelines); + VkResult result = device_data->dispatch_table.CreateComputePipelines(device, pipelineCache, createInfoCount, + local_pCreateInfos->ptr(), pAllocator, pPipelines); delete[] local_pCreateInfos; { std::lock_guard lock(global_lock); for (uint32_t i = 0; i < createInfoCount; ++i) { if (pPipelines[i] != VK_NULL_HANDLE) { - pPipelines[i] = WrapNew(device_data, pPipelines[i]); + pPipelines[i] = WrapNew(pPipelines[i]); } } } @@ -328,44 +351,107 @@ local_pCreateInfos = new safe_VkGraphicsPipelineCreateInfo[createInfoCount]; std::lock_guard lock(global_lock); for (uint32_t idx0 = 0; idx0 < createInfoCount; ++idx0) { - local_pCreateInfos[idx0].initialize(&pCreateInfos[idx0]); + bool uses_color_attachment = false; + bool uses_depthstencil_attachment = false; + { + const auto subpasses_uses_it = device_data->renderpasses_states.find(Unwrap(pCreateInfos[idx0].renderPass)); + if (subpasses_uses_it != device_data->renderpasses_states.end()) { + const auto &subpasses_uses = subpasses_uses_it->second; + if (subpasses_uses.subpasses_using_color_attachment.count(pCreateInfos[idx0].subpass)) + uses_color_attachment = true; + if (subpasses_uses.subpasses_using_depthstencil_attachment.count(pCreateInfos[idx0].subpass)) + uses_depthstencil_attachment = true; + } + } + + local_pCreateInfos[idx0].initialize(&pCreateInfos[idx0], uses_color_attachment, uses_depthstencil_attachment); + if (pCreateInfos[idx0].basePipelineHandle) { - local_pCreateInfos[idx0].basePipelineHandle = Unwrap(device_data, pCreateInfos[idx0].basePipelineHandle); + local_pCreateInfos[idx0].basePipelineHandle = Unwrap(pCreateInfos[idx0].basePipelineHandle); } if (pCreateInfos[idx0].layout) { - local_pCreateInfos[idx0].layout = Unwrap(device_data, pCreateInfos[idx0].layout); + local_pCreateInfos[idx0].layout = Unwrap(pCreateInfos[idx0].layout); } if (pCreateInfos[idx0].pStages) { for (uint32_t idx1 = 0; idx1 < pCreateInfos[idx0].stageCount; ++idx1) { if (pCreateInfos[idx0].pStages[idx1].module) { - local_pCreateInfos[idx0].pStages[idx1].module = Unwrap(device_data, pCreateInfos[idx0].pStages[idx1].module); + local_pCreateInfos[idx0].pStages[idx1].module = Unwrap(pCreateInfos[idx0].pStages[idx1].module); } } } if (pCreateInfos[idx0].renderPass) { - local_pCreateInfos[idx0].renderPass = Unwrap(device_data, pCreateInfos[idx0].renderPass); + local_pCreateInfos[idx0].renderPass = Unwrap(pCreateInfos[idx0].renderPass); } } } if (pipelineCache) { std::lock_guard lock(global_lock); - pipelineCache = Unwrap(device_data, pipelineCache); + pipelineCache = Unwrap(pipelineCache); } - VkResult result = device_data->dispatch_table.CreateGraphicsPipelines( - device, pipelineCache, createInfoCount, local_pCreateInfos->ptr(), pAllocator, pPipelines); + VkResult result = device_data->dispatch_table.CreateGraphicsPipelines(device, pipelineCache, createInfoCount, + local_pCreateInfos->ptr(), pAllocator, pPipelines); delete[] local_pCreateInfos; { std::lock_guard lock(global_lock); for (uint32_t i = 0; i < createInfoCount; ++i) { if (pPipelines[i] != VK_NULL_HANDLE) { - pPipelines[i] = WrapNew(device_data, pPipelines[i]); + pPipelines[i] = WrapNew(pPipelines[i]); } } } return result; } +static void PostCallCreateRenderPass(layer_data *dev_data, const VkRenderPassCreateInfo *pCreateInfo, VkRenderPass renderPass) { + auto &renderpass_state = dev_data->renderpasses_states[renderPass]; + + for (uint32_t subpass = 0; subpass < pCreateInfo->subpassCount; ++subpass) { + bool uses_color = false; + for (uint32_t i = 0; i < pCreateInfo->pSubpasses[subpass].colorAttachmentCount && !uses_color; ++i) + if (pCreateInfo->pSubpasses[subpass].pColorAttachments[i].attachment != VK_ATTACHMENT_UNUSED) uses_color = true; + + bool uses_depthstencil = false; + if (pCreateInfo->pSubpasses[subpass].pDepthStencilAttachment) + if (pCreateInfo->pSubpasses[subpass].pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) + uses_depthstencil = true; + + if (uses_color) renderpass_state.subpasses_using_color_attachment.insert(subpass); + if (uses_depthstencil) renderpass_state.subpasses_using_depthstencil_attachment.insert(subpass); + } +} + +VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + VkResult result = dev_data->dispatch_table.CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass); + if (VK_SUCCESS == result) { + std::lock_guard lock(global_lock); + + PostCallCreateRenderPass(dev_data, pCreateInfo, *pRenderPass); + + *pRenderPass = WrapNew(*pRenderPass); + } + return result; +} + +static void PostCallDestroyRenderPass(layer_data *dev_data, VkRenderPass renderPass) { + dev_data->renderpasses_states.erase(renderPass); +} + +VKAPI_ATTR void VKAPI_CALL DestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks *pAllocator) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + std::unique_lock lock(global_lock); + uint64_t renderPass_id = reinterpret_cast(renderPass); + renderPass = (VkRenderPass)unique_id_mapping[renderPass_id]; + unique_id_mapping.erase(renderPass_id); + lock.unlock(); + dev_data->dispatch_table.DestroyRenderPass(device, renderPass, pAllocator); + + lock.lock(); + PostCallDestroyRenderPass(dev_data, renderPass); +} + VKAPI_ATTR VkResult VKAPI_CALL CreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain) { layer_data *my_map_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); @@ -373,19 +459,17 @@ if (pCreateInfo) { std::lock_guard lock(global_lock); local_pCreateInfo = new safe_VkSwapchainCreateInfoKHR(pCreateInfo); - local_pCreateInfo->oldSwapchain = Unwrap(my_map_data, pCreateInfo->oldSwapchain); + local_pCreateInfo->oldSwapchain = Unwrap(pCreateInfo->oldSwapchain); // Surface is instance-level object - local_pCreateInfo->surface = Unwrap(my_map_data->instance_data, pCreateInfo->surface); + local_pCreateInfo->surface = Unwrap(pCreateInfo->surface); } - VkResult result = my_map_data->dispatch_table.CreateSwapchainKHR( - device, local_pCreateInfo->ptr(), pAllocator, pSwapchain); - if (local_pCreateInfo) { - delete local_pCreateInfo; - } + VkResult result = my_map_data->dispatch_table.CreateSwapchainKHR(device, local_pCreateInfo->ptr(), pAllocator, pSwapchain); + delete local_pCreateInfo; + if (VK_SUCCESS == result) { std::lock_guard lock(global_lock); - *pSwapchain = WrapNew(my_map_data, *pSwapchain); + *pSwapchain = WrapNew(*pSwapchain); } return result; } @@ -403,21 +487,21 @@ local_pCreateInfos[i].initialize(&pCreateInfos[i]); if (pCreateInfos[i].surface) { // Surface is instance-level object - local_pCreateInfos[i].surface = Unwrap(dev_data->instance_data, pCreateInfos[i].surface); + local_pCreateInfos[i].surface = Unwrap(pCreateInfos[i].surface); } if (pCreateInfos[i].oldSwapchain) { - local_pCreateInfos[i].oldSwapchain = Unwrap(dev_data, pCreateInfos[i].oldSwapchain); + local_pCreateInfos[i].oldSwapchain = Unwrap(pCreateInfos[i].oldSwapchain); } } } } - VkResult result = dev_data->dispatch_table.CreateSharedSwapchainsKHR( - device, swapchainCount, local_pCreateInfos->ptr(), pAllocator, pSwapchains); - if (local_pCreateInfos) delete[] local_pCreateInfos; + VkResult result = dev_data->dispatch_table.CreateSharedSwapchainsKHR(device, swapchainCount, local_pCreateInfos->ptr(), + pAllocator, pSwapchains); + delete[] local_pCreateInfos; if (VK_SUCCESS == result) { std::lock_guard lock(global_lock); for (uint32_t i = 0; i < swapchainCount; i++) { - pSwapchains[i] = WrapNew(dev_data, pSwapchains[i]); + pSwapchains[i] = WrapNew(pSwapchains[i]); } } return result; @@ -426,24 +510,45 @@ VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pSwapchainImageCount, VkImage *pSwapchainImages) { layer_data *my_device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + VkSwapchainKHR wrapped_swapchain_handle = swapchain; if (VK_NULL_HANDLE != swapchain) { std::lock_guard lock(global_lock); - swapchain = Unwrap(my_device_data, swapchain); + swapchain = Unwrap(swapchain); } VkResult result = my_device_data->dispatch_table.GetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages); - // TODO : Need to add corresponding code to delete these images - if (VK_SUCCESS == result) { + if ((VK_SUCCESS == result) || (VK_INCOMPLETE == result)) { if ((*pSwapchainImageCount > 0) && pSwapchainImages) { std::lock_guard lock(global_lock); - for (uint32_t i = 0; i < *pSwapchainImageCount; ++i) { - pSwapchainImages[i] = WrapNew(my_device_data, pSwapchainImages[i]); + auto &wrapped_swapchain_image_handles = my_device_data->swapchain_wrapped_image_handle_map[wrapped_swapchain_handle]; + for (uint32_t i = static_cast(wrapped_swapchain_image_handles.size()); i < *pSwapchainImageCount; i++) { + wrapped_swapchain_image_handles.emplace_back(WrapNew(pSwapchainImages[i])); + } + for (uint32_t i = 0; i < *pSwapchainImageCount; i++) { + pSwapchainImages[i] = wrapped_swapchain_image_handles[i]; } } } return result; } +VKAPI_ATTR void VKAPI_CALL DestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks *pAllocator) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + std::unique_lock lock(global_lock); + + auto &image_array = dev_data->swapchain_wrapped_image_handle_map[swapchain]; + for (auto &image_handle : image_array) { + unique_id_mapping.erase(HandleToUint64(image_handle)); + } + dev_data->swapchain_wrapped_image_handle_map.erase(swapchain); + + uint64_t swapchain_id = HandleToUint64(swapchain); + swapchain = (VkSwapchainKHR)unique_id_mapping[swapchain_id]; + unique_id_mapping.erase(swapchain_id); + lock.unlock(); + dev_data->dispatch_table.DestroySwapchainKHR(device, swapchain, pAllocator); +} + VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo) { layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); safe_VkPresentInfoKHR *local_pPresentInfo = NULL; @@ -453,12 +558,12 @@ local_pPresentInfo = new safe_VkPresentInfoKHR(pPresentInfo); if (local_pPresentInfo->pWaitSemaphores) { for (uint32_t index1 = 0; index1 < local_pPresentInfo->waitSemaphoreCount; ++index1) { - local_pPresentInfo->pWaitSemaphores[index1] = Unwrap(dev_data, pPresentInfo->pWaitSemaphores[index1]); + local_pPresentInfo->pWaitSemaphores[index1] = Unwrap(pPresentInfo->pWaitSemaphores[index1]); } } if (local_pPresentInfo->pSwapchains) { for (uint32_t index1 = 0; index1 < local_pPresentInfo->swapchainCount; ++index1) { - local_pPresentInfo->pSwapchains[index1] = Unwrap(dev_data, pPresentInfo->pSwapchains[index1]); + local_pPresentInfo->pSwapchains[index1] = Unwrap(pPresentInfo->pSwapchains[index1]); } } } @@ -473,33 +578,66 @@ } } - if (local_pPresentInfo) delete local_pPresentInfo; + delete local_pPresentInfo; return result; } +// This is the core version of this routine. The extension version is below. +VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorUpdateTemplate(VkDevice device, + const VkDescriptorUpdateTemplateCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDescriptorUpdateTemplateKHR *pDescriptorUpdateTemplate) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + safe_VkDescriptorUpdateTemplateCreateInfo *local_create_info = NULL; + { + std::lock_guard lock(global_lock); + if (pCreateInfo) { + local_create_info = new safe_VkDescriptorUpdateTemplateCreateInfo(pCreateInfo); + if (pCreateInfo->descriptorSetLayout) { + local_create_info->descriptorSetLayout = Unwrap(pCreateInfo->descriptorSetLayout); + } + if (pCreateInfo->pipelineLayout) { + local_create_info->pipelineLayout = Unwrap(pCreateInfo->pipelineLayout); + } + } + } + VkResult result = dev_data->dispatch_table.CreateDescriptorUpdateTemplate(device, local_create_info->ptr(), pAllocator, + pDescriptorUpdateTemplate); + if (VK_SUCCESS == result) { + std::lock_guard lock(global_lock); + *pDescriptorUpdateTemplate = WrapNew(*pDescriptorUpdateTemplate); + + // Shadow template createInfo for later updates + std::unique_ptr template_state(new TEMPLATE_STATE(*pDescriptorUpdateTemplate, local_create_info)); + dev_data->desc_template_map[(uint64_t)*pDescriptorUpdateTemplate] = std::move(template_state); + } + return result; +} + +// This is the extension version of this routine. The core version is above. VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorUpdateTemplateKHR(VkDevice device, const VkDescriptorUpdateTemplateCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorUpdateTemplateKHR *pDescriptorUpdateTemplate) { layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - safe_VkDescriptorUpdateTemplateCreateInfoKHR *local_create_info = NULL; + safe_VkDescriptorUpdateTemplateCreateInfo *local_create_info = NULL; { std::lock_guard lock(global_lock); if (pCreateInfo) { - local_create_info = new safe_VkDescriptorUpdateTemplateCreateInfoKHR(pCreateInfo); + local_create_info = new safe_VkDescriptorUpdateTemplateCreateInfo(pCreateInfo); if (pCreateInfo->descriptorSetLayout) { - local_create_info->descriptorSetLayout = Unwrap(dev_data, pCreateInfo->descriptorSetLayout); + local_create_info->descriptorSetLayout = Unwrap(pCreateInfo->descriptorSetLayout); } if (pCreateInfo->pipelineLayout) { - local_create_info->pipelineLayout = Unwrap(dev_data, pCreateInfo->pipelineLayout); + local_create_info->pipelineLayout = Unwrap(pCreateInfo->pipelineLayout); } } } - VkResult result = dev_data->dispatch_table.CreateDescriptorUpdateTemplateKHR( - device, local_create_info->ptr(), pAllocator, pDescriptorUpdateTemplate); + VkResult result = dev_data->dispatch_table.CreateDescriptorUpdateTemplateKHR(device, local_create_info->ptr(), pAllocator, + pDescriptorUpdateTemplate); if (VK_SUCCESS == result) { std::lock_guard lock(global_lock); - *pDescriptorUpdateTemplate = WrapNew(dev_data, *pDescriptorUpdateTemplate); + *pDescriptorUpdateTemplate = WrapNew(*pDescriptorUpdateTemplate); // Shadow template createInfo for later updates std::unique_ptr template_state(new TEMPLATE_STATE(*pDescriptorUpdateTemplate, local_create_info)); @@ -508,6 +646,20 @@ return result; } +// This is the core version of this routine. The extension version is below. +VKAPI_ATTR void VKAPI_CALL DestroyDescriptorUpdateTemplate(VkDevice device, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + const VkAllocationCallbacks *pAllocator) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + std::unique_lock lock(global_lock); + uint64_t descriptor_update_template_id = reinterpret_cast(descriptorUpdateTemplate); + dev_data->desc_template_map.erase(descriptor_update_template_id); + descriptorUpdateTemplate = (VkDescriptorUpdateTemplate)unique_id_mapping[descriptor_update_template_id]; + unique_id_mapping.erase(descriptor_update_template_id); + lock.unlock(); + dev_data->dispatch_table.DestroyDescriptorUpdateTemplate(device, descriptorUpdateTemplate, pAllocator); +} + +// This is the extension version of this routine. The core version is above. VKAPI_ATTR void VKAPI_CALL DestroyDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const VkAllocationCallbacks *pAllocator) { @@ -515,8 +667,8 @@ std::unique_lock lock(global_lock); uint64_t descriptor_update_template_id = reinterpret_cast(descriptorUpdateTemplate); dev_data->desc_template_map.erase(descriptor_update_template_id); - descriptorUpdateTemplate = (VkDescriptorUpdateTemplateKHR)dev_data->unique_id_mapping[descriptor_update_template_id]; - dev_data->unique_id_mapping.erase(descriptor_update_template_id); + descriptorUpdateTemplate = (VkDescriptorUpdateTemplate)unique_id_mapping[descriptor_update_template_id]; + unique_id_mapping.erase(descriptor_update_template_id); lock.unlock(); dev_data->dispatch_table.DestroyDescriptorUpdateTemplateKHR(device, descriptorUpdateTemplate, pAllocator); } @@ -545,8 +697,8 @@ allocation_size = std::max(allocation_size, offset + sizeof(VkDescriptorImageInfo)); VkDescriptorImageInfo *wrapped_entry = new VkDescriptorImageInfo(*image_entry); - wrapped_entry->sampler = Unwrap(dev_data, image_entry->sampler); - wrapped_entry->imageView = Unwrap(dev_data, image_entry->imageView); + wrapped_entry->sampler = Unwrap(image_entry->sampler); + wrapped_entry->imageView = Unwrap(image_entry->imageView); template_entries.emplace_back(offset, kVulkanObjectTypeImage, reinterpret_cast(wrapped_entry)); } break; @@ -558,7 +710,7 @@ allocation_size = std::max(allocation_size, offset + sizeof(VkDescriptorBufferInfo)); VkDescriptorBufferInfo *wrapped_entry = new VkDescriptorBufferInfo(*buffer_entry); - wrapped_entry->buffer = Unwrap(dev_data, buffer_entry->buffer); + wrapped_entry->buffer = Unwrap(buffer_entry->buffer); template_entries.emplace_back(offset, kVulkanObjectTypeBuffer, reinterpret_cast(wrapped_entry)); } break; @@ -567,7 +719,7 @@ auto buffer_view_handle = reinterpret_cast(update_entry); allocation_size = std::max(allocation_size, offset + sizeof(VkBufferView)); - VkBufferView wrapped_entry = Unwrap(dev_data, *buffer_view_handle); + VkBufferView wrapped_entry = Unwrap(*buffer_view_handle); template_entries.emplace_back(offset, kVulkanObjectTypeBufferView, reinterpret_cast(wrapped_entry)); } break; default: @@ -603,19 +755,36 @@ return (void *)unwrapped_data; } +// This is the core version of this routine. The extension version is below. +VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + const void *pData) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + uint64_t template_handle = reinterpret_cast(descriptorUpdateTemplate); + { + std::lock_guard lock(global_lock); + descriptorSet = Unwrap(descriptorSet); + descriptorUpdateTemplate = (VkDescriptorUpdateTemplate)unique_id_mapping[template_handle]; + } + void *unwrapped_buffer = BuildUnwrappedUpdateTemplateBuffer(dev_data, template_handle, pData); + dev_data->dispatch_table.UpdateDescriptorSetWithTemplate(device, descriptorSet, descriptorUpdateTemplate, unwrapped_buffer); + free(unwrapped_buffer); +} + +// This is the extension version of this routine. The core version is above. VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void *pData) { layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); uint64_t template_handle = reinterpret_cast(descriptorUpdateTemplate); + void *unwrapped_buffer = nullptr; { std::lock_guard lock(global_lock); - descriptorSet = Unwrap(dev_data, descriptorSet); - descriptorUpdateTemplate = (VkDescriptorUpdateTemplateKHR)dev_data->unique_id_mapping[template_handle]; + descriptorSet = Unwrap(descriptorSet); + descriptorUpdateTemplate = (VkDescriptorUpdateTemplate)unique_id_mapping[template_handle]; + unwrapped_buffer = BuildUnwrappedUpdateTemplateBuffer(dev_data, template_handle, pData); } - void *unwrapped_buffer = BuildUnwrappedUpdateTemplateBuffer(dev_data, template_handle, pData); - dev_data->dispatch_table.UpdateDescriptorSetWithTemplateKHR(device, descriptorSet, descriptorUpdateTemplate, - unwrapped_buffer); + dev_data->dispatch_table.UpdateDescriptorSetWithTemplateKHR(device, descriptorSet, descriptorUpdateTemplate, unwrapped_buffer); free(unwrapped_buffer); } @@ -624,14 +793,15 @@ VkPipelineLayout layout, uint32_t set, const void *pData) { layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); uint64_t template_handle = reinterpret_cast(descriptorUpdateTemplate); + void *unwrapped_buffer = nullptr; { std::lock_guard lock(global_lock); - descriptorUpdateTemplate = Unwrap(dev_data, descriptorUpdateTemplate); - layout = Unwrap(dev_data, layout); + descriptorUpdateTemplate = Unwrap(descriptorUpdateTemplate); + layout = Unwrap(layout); + unwrapped_buffer = BuildUnwrappedUpdateTemplateBuffer(dev_data, template_handle, pData); } - void *unwrapped_buffer = BuildUnwrappedUpdateTemplateBuffer(dev_data, template_handle, pData); dev_data->dispatch_table.CmdPushDescriptorSetWithTemplateKHR(commandBuffer, descriptorUpdateTemplate, layout, set, - unwrapped_buffer); + unwrapped_buffer); free(unwrapped_buffer); } @@ -640,12 +810,12 @@ VkDisplayPropertiesKHR *pProperties) { instance_layer_data *my_map_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); - VkResult result = my_map_data->dispatch_table.GetPhysicalDeviceDisplayPropertiesKHR( - physicalDevice, pPropertyCount, pProperties); + VkResult result = + my_map_data->dispatch_table.GetPhysicalDeviceDisplayPropertiesKHR(physicalDevice, pPropertyCount, pProperties); if ((result == VK_SUCCESS || result == VK_INCOMPLETE) && pProperties) { std::lock_guard lock(global_lock); for (uint32_t idx0 = 0; idx0 < *pPropertyCount; ++idx0) { - pProperties[idx0].display = WrapNew(my_map_data, pProperties[idx0].display); + pProperties[idx0].display = WrapNew(pProperties[idx0].display); } } return result; @@ -654,15 +824,15 @@ VKAPI_ATTR VkResult VKAPI_CALL GetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, uint32_t planeIndex, uint32_t *pDisplayCount, VkDisplayKHR *pDisplays) { instance_layer_data *my_map_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); - VkResult result = my_map_data->dispatch_table.GetDisplayPlaneSupportedDisplaysKHR(physicalDevice, planeIndex, - pDisplayCount, pDisplays); + VkResult result = + my_map_data->dispatch_table.GetDisplayPlaneSupportedDisplaysKHR(physicalDevice, planeIndex, pDisplayCount, pDisplays); if (VK_SUCCESS == result) { if ((*pDisplayCount > 0) && pDisplays) { std::lock_guard lock(global_lock); for (uint32_t i = 0; i < *pDisplayCount; i++) { // TODO: this looks like it really wants a /reverse/ mapping. What's going on here? - auto it = my_map_data->unique_id_mapping.find(reinterpret_cast(pDisplays[i])); - assert(it != my_map_data->unique_id_mapping.end()); + auto it = unique_id_mapping.find(reinterpret_cast(pDisplays[i])); + assert(it != unique_id_mapping.end()); pDisplays[i] = reinterpret_cast(it->second); } } @@ -675,15 +845,14 @@ instance_layer_data *my_map_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); { std::lock_guard lock(global_lock); - display = Unwrap(my_map_data, display); + display = Unwrap(display); } - VkResult result = my_map_data->dispatch_table.GetDisplayModePropertiesKHR( - physicalDevice, display, pPropertyCount, pProperties); + VkResult result = my_map_data->dispatch_table.GetDisplayModePropertiesKHR(physicalDevice, display, pPropertyCount, pProperties); if (result == VK_SUCCESS && pProperties) { std::lock_guard lock(global_lock); for (uint32_t idx0 = 0; idx0 < *pPropertyCount; ++idx0) { - pProperties[idx0].displayMode = WrapNew(my_map_data, pProperties[idx0].displayMode); + pProperties[idx0].displayMode = WrapNew(pProperties[idx0].displayMode); } } return result; @@ -694,41 +863,71 @@ instance_layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); { std::lock_guard lock(global_lock); - mode = Unwrap(dev_data, mode); + mode = Unwrap(mode); } - VkResult result = - dev_data->dispatch_table.GetDisplayPlaneCapabilitiesKHR(physicalDevice, mode, planeIndex, pCapabilities); + VkResult result = dev_data->dispatch_table.GetDisplayPlaneCapabilitiesKHR(physicalDevice, mode, planeIndex, pCapabilities); return result; } #endif VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectTagEXT(VkDevice device, const VkDebugMarkerObjectTagInfoEXT *pTagInfo) { layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - auto local_tag_info = new safe_VkDebugMarkerObjectTagInfoEXT(pTagInfo); + safe_VkDebugMarkerObjectTagInfoEXT local_tag_info(pTagInfo); { std::lock_guard lock(global_lock); - auto it = device_data->unique_id_mapping.find(reinterpret_cast(local_tag_info->object)); - if (it != device_data->unique_id_mapping.end()) { - local_tag_info->object = it->second; + auto it = unique_id_mapping.find(reinterpret_cast(local_tag_info.object)); + if (it != unique_id_mapping.end()) { + local_tag_info.object = it->second; } } VkResult result = device_data->dispatch_table.DebugMarkerSetObjectTagEXT( - device, reinterpret_cast(local_tag_info)); + device, reinterpret_cast(&local_tag_info)); return result; } VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectNameEXT(VkDevice device, const VkDebugMarkerObjectNameInfoEXT *pNameInfo) { layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - auto local_name_info = new safe_VkDebugMarkerObjectNameInfoEXT(pNameInfo); + safe_VkDebugMarkerObjectNameInfoEXT local_name_info(pNameInfo); { std::lock_guard lock(global_lock); - auto it = device_data->unique_id_mapping.find(reinterpret_cast(local_name_info->object)); - if (it != device_data->unique_id_mapping.end()) { - local_name_info->object = it->second; + auto it = unique_id_mapping.find(reinterpret_cast(local_name_info.object)); + if (it != unique_id_mapping.end()) { + local_name_info.object = it->second; } } VkResult result = device_data->dispatch_table.DebugMarkerSetObjectNameEXT( - device, reinterpret_cast(local_name_info)); + device, reinterpret_cast(&local_name_info)); + return result; +} + +// VK_EXT_debug_utils +VKAPI_ATTR VkResult VKAPI_CALL SetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT *pTagInfo) { + layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + safe_VkDebugUtilsObjectTagInfoEXT local_tag_info(pTagInfo); + { + std::lock_guard lock(global_lock); + auto it = unique_id_mapping.find(reinterpret_cast(local_tag_info.objectHandle)); + if (it != unique_id_mapping.end()) { + local_tag_info.objectHandle = it->second; + } + } + VkResult result = device_data->dispatch_table.SetDebugUtilsObjectTagEXT( + device, reinterpret_cast(&local_tag_info)); + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL SetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT *pNameInfo) { + layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + safe_VkDebugUtilsObjectNameInfoEXT local_name_info(pNameInfo); + { + std::lock_guard lock(global_lock); + auto it = unique_id_mapping.find(reinterpret_cast(local_name_info.objectHandle)); + if (it != unique_id_mapping.end()) { + local_name_info.objectHandle = it->second; + } + } + VkResult result = device_data->dispatch_table.SetDebugUtilsObjectNameEXT( + device, reinterpret_cast(&local_name_info)); return result; } diff -Nru vulkan-1.0.65.2+dfsg1/layers/unique_objects.h vulkan-1.1.73+dfsg/layers/unique_objects.h --- vulkan-1.0.65.2+dfsg1/layers/unique_objects.h 2017-07-03 14:21:22.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/unique_objects.h 2018-03-14 09:08:48.000000000 +0000 @@ -21,6 +21,9 @@ #include "vulkan/vulkan.h" +#include +#include + #include "vk_layer_data.h" #include "vk_safe_struct.h" #include "vk_layer_utils.h" @@ -32,29 +35,33 @@ // All increments must be guarded by global_lock static uint64_t global_unique_id = 1; +static std::unordered_map unique_id_mapping; // Map uniqueID to actual object handle struct TEMPLATE_STATE { VkDescriptorUpdateTemplateKHR desc_update_template; - safe_VkDescriptorUpdateTemplateCreateInfoKHR create_info; + safe_VkDescriptorUpdateTemplateCreateInfo create_info; - TEMPLATE_STATE(VkDescriptorUpdateTemplateKHR update_template, safe_VkDescriptorUpdateTemplateCreateInfoKHR *pCreateInfo) + TEMPLATE_STATE(VkDescriptorUpdateTemplateKHR update_template, safe_VkDescriptorUpdateTemplateCreateInfo *pCreateInfo) : desc_update_template(update_template), create_info(*pCreateInfo) {} }; struct instance_layer_data { + VkInstance instance; debug_report_data *report_data; std::vector logging_callback; + std::vector logging_messenger; VkLayerInstanceDispatchTable dispatch_table = {}; // The following are for keeping track of the temporary callbacks that can // be used in vkCreateInstance and vkDestroyInstance: - uint32_t num_tmp_callbacks; - VkDebugReportCallbackCreateInfoEXT *tmp_dbg_create_infos; - VkDebugReportCallbackEXT *tmp_callbacks; - - std::unordered_map unique_id_mapping; // Map uniqueID to actual object handle + uint32_t num_tmp_report_callbacks; + VkDebugReportCallbackCreateInfoEXT *tmp_report_create_infos; + VkDebugReportCallbackEXT *tmp_report_callbacks; + uint32_t num_tmp_debug_messengers; + VkDebugUtilsMessengerCreateInfoEXT *tmp_messenger_create_infos; + VkDebugUtilsMessengerEXT *tmp_debug_messengers; }; struct layer_data { @@ -66,9 +73,19 @@ std::unordered_map> desc_template_map; bool wsi_enabled; - std::unordered_map unique_id_mapping; // Map uniqueID to actual object handle VkPhysicalDevice gpu; + struct SubpassesUsageStates { + std::unordered_set subpasses_using_color_attachment; + std::unordered_set subpasses_using_depthstencil_attachment; + }; + // Uses unwrapped handles + std::unordered_map renderpasses_states; + + // Map of wrapped swapchain handles to arrays of wrapped swapchain image IDs + // Each swapchain has an immutable list of wrapped swapchain image IDs -- always return these IDs if they exist + std::unordered_map> swapchain_wrapped_image_handle_map; + layer_data() : wsi_enabled(false), gpu(VK_NULL_HANDLE){}; }; @@ -99,21 +116,19 @@ return false; } - /* Unwrap a handle. */ // must hold lock! -template -HandleType Unwrap(MapType *layer_data, HandleType wrappedHandle) { +template +HandleType Unwrap(HandleType wrappedHandle) { // TODO: don't use operator[] here. - return (HandleType)layer_data->unique_id_mapping[reinterpret_cast(wrappedHandle)]; + return (HandleType)unique_id_mapping[reinterpret_cast(wrappedHandle)]; } -/* Wrap a newly created handle with a new unique ID, and return the new ID. */ -// must hold lock! -template -HandleType WrapNew(MapType *layer_data, HandleType newlyCreatedHandle) { +// Wrap a newly created handle with a new unique ID, and return the new ID -- must hold lock! +template +HandleType WrapNew(HandleType newlyCreatedHandle) { auto unique_id = global_unique_id++; - layer_data->unique_id_mapping[unique_id] = reinterpret_cast(newlyCreatedHandle); + unique_id_mapping[unique_id] = reinterpret_cast(newlyCreatedHandle); return (HandleType)unique_id; } diff -Nru vulkan-1.0.65.2+dfsg1/layers/unique_objects_layer.md vulkan-1.1.73+dfsg/layers/unique_objects_layer.md --- vulkan-1.0.65.2+dfsg1/layers/unique_objects_layer.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/unique_objects_layer.md 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,7 @@ +# VK\_LAYER\_GOOGLE\_unique\_objects +The `VK_LAYER_LUNARG_unique_objects` is a validation-supporting utility layer which enables consistent and coherent validation in addition to proper operation on systems which return non-unique object handles. This layer aliases all non-dispatchable Vulkan objects with a unique identifier at object-creation time. The aliased handles are used during validation to ensure that duplicate object handles are correctly managed and tracked by the validation layers. + +Note: + +* For optimal efficiency, this layer MUST be last in the chain (closest to the display driver). +* If you are developing Vulkan extensions which include new APIs taking one or more Vulkan dispatchable objects as parameters, you may find it necessary to disable the unique objects layer in order use the validation layers. The best way to do this is to explicitly load the layers in the optimal order specified earlier but without this layer. This should result in a minimal decrease in functionality but still allow you to benefit from using the validation layers. diff -Nru vulkan-1.0.65.2+dfsg1/layers/vk_format_utils.cpp vulkan-1.1.73+dfsg/layers/vk_format_utils.cpp --- vulkan-1.0.65.2+dfsg1/layers/vk_format_utils.cpp 2017-07-03 14:21:22.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/vk_format_utils.cpp 2018-04-27 11:24:19.000000000 +0000 @@ -189,7 +189,7 @@ {VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK, {8, 4, VK_FORMAT_COMPATIBILITY_CLASS_ETC2_RGBA_BIT}}, {VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK, {8, 4, VK_FORMAT_COMPATIBILITY_CLASS_ETC2_RGBA_BIT}}, {VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, {16, 4, VK_FORMAT_COMPATIBILITY_CLASS_ETC2_EAC_RGBA_BIT}}, - {VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, {8, 4, VK_FORMAT_COMPATIBILITY_CLASS_ETC2_EAC_RGBA_BIT}}, + {VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, {16, 4, VK_FORMAT_COMPATIBILITY_CLASS_ETC2_EAC_RGBA_BIT}}, {VK_FORMAT_EAC_R11_UNORM_BLOCK, {8, 1, VK_FORMAT_COMPATIBILITY_CLASS_EAC_R_BIT}}, {VK_FORMAT_EAC_R11_SNORM_BLOCK, {8, 1, VK_FORMAT_COMPATIBILITY_CLASS_EAC_R_BIT}}, {VK_FORMAT_EAC_R11G11_UNORM_BLOCK, {16, 2, VK_FORMAT_COMPATIBILITY_CLASS_EAC_RG_BIT}}, @@ -229,7 +229,40 @@ {VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG, {8, 4, VK_FORMAT_COMPATIBILITY_CLASS_PVRTC1_2BPP_BIT}}, {VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG, {8, 4, VK_FORMAT_COMPATIBILITY_CLASS_PVRTC1_4BPP_BIT}}, {VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG, {8, 4, VK_FORMAT_COMPATIBILITY_CLASS_PVRTC2_2BPP_BIT}}, - {VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG, {8, 4, VK_FORMAT_COMPATIBILITY_CLASS_PVRTC2_4BPP_BIT}} + {VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG, {8, 4, VK_FORMAT_COMPATIBILITY_CLASS_PVRTC2_4BPP_BIT}}, + /* KHR_sampler_YCbCr_conversion */ + {VK_FORMAT_G8B8G8R8_422_UNORM_KHR, {4, 4, VK_FORMAT_COMPATIBILITY_CLASS_32BIT_G8B8G8R8}}, + {VK_FORMAT_B8G8R8G8_422_UNORM_KHR, {4, 4, VK_FORMAT_COMPATIBILITY_CLASS_32BIT_B8G8R8G8}}, + {VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR, {8, 4, VK_FORMAT_COMPATIBILITY_CLASS_64BIT_R10G10B10A10}}, + {VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR, {8, 4, VK_FORMAT_COMPATIBILITY_CLASS_64BIT_G10B10G10R10}}, + {VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR, {8, 4, VK_FORMAT_COMPATIBILITY_CLASS_64BIT_B10G10R10G10}}, + {VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR, {8, 4, VK_FORMAT_COMPATIBILITY_CLASS_64BIT_R12G12B12A12}}, + {VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR, {8, 4, VK_FORMAT_COMPATIBILITY_CLASS_64BIT_G12B12G12R12}}, + {VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR, {8, 4, VK_FORMAT_COMPATIBILITY_CLASS_64BIT_B12G12R12G12}}, + {VK_FORMAT_G16B16G16R16_422_UNORM_KHR, {8, 4, VK_FORMAT_COMPATIBILITY_CLASS_64BIT_G16B16G16R16}}, + {VK_FORMAT_B16G16R16G16_422_UNORM_KHR, {8, 4, VK_FORMAT_COMPATIBILITY_CLASS_64BIT_B16G16R16G16}} +#if 0 // TBD - Figure out what 'size' means for multi-planar formats + {VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_8BIT_3PLANE_420}}, + {VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_8BIT_2PLANE_420}}, + {VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_8BIT_3PLANE_422}}, + {VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_8BIT_2PLANE_422}}, + {VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_8BIT_3PLANE_444}}, + {VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_10BIT_3PLANE_420}}, + {VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_10BIT_2PLANE_420}}, + {VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_10BIT_3PLANE_422}}, + {VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_10BIT_2PLANE_422}}, + {VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_10BIT_3PLANE_444}}, + {VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_12BIT_3PLANE_420}}, + {VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_12BIT_2PLANE_420}}, + {VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_12BIT_3PLANE_422}}, + {VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_12BIT_2PLANE_422}}, + {VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_12BIT_3PLANE_444}}, + {VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_16BIT_3PLANE_420}}, + {VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_16BIT_2PLANE_420}}, + {VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_16BIT_3PLANE_422}}, + {VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_16BIT_2PLANE_422}}, + {VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR, {0, 3, VK_FORMAT_COMPATIBILITY_CLASS_16BIT_3PLANE_444}} +#endif }; // Renable formatting @@ -349,11 +382,30 @@ return found; } +// Single-plane "_422" formats are treated as 2x1 compressed (for copies) +VK_LAYER_EXPORT bool FormatIsSinglePlane_422(VkFormat format) { + bool found = false; + + switch (format) { + case VK_FORMAT_G8B8G8R8_422_UNORM_KHR: + case VK_FORMAT_B8G8R8G8_422_UNORM_KHR: + case VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR: + case VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR: + case VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR: + case VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR: + case VK_FORMAT_G16B16G16R16_422_UNORM_KHR: + case VK_FORMAT_B16G16R16G16_422_UNORM_KHR: + found = true; + break; + default: + break; + } + return found; +} + // Return true if format is compressed VK_LAYER_EXPORT bool FormatIsCompressed(VkFormat format) { - return (FormatIsCompressed_ASTC_LDR(format) || - FormatIsCompressed_BC(format) || - FormatIsCompressed_ETC2_EAC(format) || + return (FormatIsCompressed_ASTC_LDR(format) || FormatIsCompressed_BC(format) || FormatIsCompressed_ETC2_EAC(format) || FormatIsCompressed_PVRTC(format)); } @@ -471,7 +523,7 @@ } return is_norm; -}; +} // Return true if format is of type UNORM VK_LAYER_EXPORT bool FormatIsUNorm(VkFormat format) { @@ -529,7 +581,7 @@ } return is_unorm; -}; +} // Return true if format is of type SNORM VK_LAYER_EXPORT bool FormatIsSNorm(VkFormat format) { @@ -560,7 +612,7 @@ } return is_snorm; -}; +} // Return true if format is an integer format VK_LAYER_EXPORT bool FormatIsInt(VkFormat format) { return (FormatIsSInt(format) || FormatIsUInt(format)); } @@ -860,12 +912,56 @@ case VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG: block_size = {4, 4, 1}; break; + // With KHR_sampler_ycbcr_conversion, these formats are treated as 2x1 compressed (for copies) + case VK_FORMAT_G8B8G8R8_422_UNORM_KHR: + case VK_FORMAT_B8G8R8G8_422_UNORM_KHR: + case VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR: + case VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR: + case VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR: + case VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR: + case VK_FORMAT_G16B16G16R16_422_UNORM_KHR: + case VK_FORMAT_B16G16R16G16_422_UNORM_KHR: + block_size = {2, 1, 1}; + break; + default: break; } return block_size; } +VK_LAYER_EXPORT uint32_t FormatPlaneCount(VkFormat format) { + switch (format) { + case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR: + case VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR: + case VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR: + case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR: + case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR: + case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR: + case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR: + case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR: + case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR: + case VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR: + case VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR: + case VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR: + return 3; + break; + case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR: + case VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR: + case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR: + case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR: + case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR: + case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR: + case VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR: + case VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR: + return 2; + break; + default: + return 1; + break; + } +} + // Return format class of the specified format VK_LAYER_EXPORT VkFormatCompatibilityClass FormatCompatibilityClass(VkFormat format) { auto item = vk_format_table.find(format); @@ -885,7 +981,7 @@ } // Return the number of channels for a given format -unsigned int FormatChannelCount(VkFormat format) { +uint32_t FormatChannelCount(VkFormat format) { auto item = vk_format_table.find(format); if (item != vk_format_table.end()) { return item->second.channel_count; @@ -901,3 +997,88 @@ } return result; } + +struct VULKAN_PER_PLANE_COMPATIBILITY { + uint32_t width_divisor; + uint32_t height_divisor; + VkFormat compatible_format; +}; + +struct VULKAN_MULTIPLANE_COMPATIBILITY { + VULKAN_PER_PLANE_COMPATIBILITY per_plane[VK_MULTIPLANE_FORMAT_MAX_PLANES]; +}; + +// Source: Vulkan spec Table 45. Plane Format Compatibility Table +// clang-format off +const std::map vk_multiplane_compatibility_map { + { VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR, { { { 1, 1, VK_FORMAT_R8_UNORM }, + { 2, 2, VK_FORMAT_R8_UNORM }, + { 2, 2, VK_FORMAT_R8_UNORM } } } }, + { VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR, { { { 1, 1, VK_FORMAT_R8_UNORM }, + { 2, 2, VK_FORMAT_R8G8_UNORM }, + { 1, 1, VK_FORMAT_UNDEFINED } } } }, + { VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR, { { { 1, 1, VK_FORMAT_R8_UNORM }, + { 2, 1, VK_FORMAT_R8_UNORM }, + { 2, 1, VK_FORMAT_R8_UNORM } } } }, + { VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR, { { { 1, 1, VK_FORMAT_R8_UNORM }, + { 2, 1, VK_FORMAT_R8G8_UNORM }, + { 1, 1, VK_FORMAT_UNDEFINED } } } }, + { VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR, { { { 1, 1, VK_FORMAT_R8_UNORM }, + { 1, 1, VK_FORMAT_R8_UNORM }, + { 1, 1, VK_FORMAT_R8_UNORM } } } }, + { VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR, { { { 1, 1, VK_FORMAT_R10X6_UNORM_PACK16_KHR }, + { 2, 2, VK_FORMAT_R10X6_UNORM_PACK16_KHR }, + { 2, 2, VK_FORMAT_R10X6_UNORM_PACK16_KHR } } } }, + { VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR, { { { 1, 1, VK_FORMAT_R10X6_UNORM_PACK16_KHR }, + { 2, 2, VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR }, + { 1, 1, VK_FORMAT_UNDEFINED } } } }, + { VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR, { { { 1, 1, VK_FORMAT_R10X6_UNORM_PACK16_KHR }, + { 2, 1, VK_FORMAT_R10X6_UNORM_PACK16_KHR }, + { 2, 1, VK_FORMAT_R10X6_UNORM_PACK16_KHR } } } }, + { VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR, { { { 1, 1, VK_FORMAT_R10X6_UNORM_PACK16_KHR }, + { 2, 1, VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR }, + { 1, 1, VK_FORMAT_UNDEFINED } } } }, + { VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR, { { { 1, 1, VK_FORMAT_R10X6_UNORM_PACK16_KHR }, + { 1, 1, VK_FORMAT_R10X6_UNORM_PACK16_KHR }, + { 1, 1, VK_FORMAT_R10X6_UNORM_PACK16_KHR } } } }, + { VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR, { { { 1, 1, VK_FORMAT_R12X4_UNORM_PACK16_KHR }, + { 2, 2, VK_FORMAT_R12X4_UNORM_PACK16_KHR }, + { 2, 2, VK_FORMAT_R12X4_UNORM_PACK16_KHR } } } }, + { VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR, { { { 1, 1, VK_FORMAT_R12X4_UNORM_PACK16_KHR }, + { 2, 2, VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR }, + { 1, 1, VK_FORMAT_UNDEFINED } } } }, + { VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR, { { { 1, 1, VK_FORMAT_R12X4_UNORM_PACK16_KHR }, + { 2, 1, VK_FORMAT_R12X4_UNORM_PACK16_KHR }, + { 2, 1, VK_FORMAT_R12X4_UNORM_PACK16_KHR } } } }, + { VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR, { { { 1, 1, VK_FORMAT_R12X4_UNORM_PACK16_KHR }, + { 2, 1, VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR }, + { 1, 1, VK_FORMAT_UNDEFINED } } } }, + { VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR, { { { 1, 1, VK_FORMAT_R12X4_UNORM_PACK16_KHR }, + { 1, 1, VK_FORMAT_R12X4_UNORM_PACK16_KHR }, + { 1, 1, VK_FORMAT_R12X4_UNORM_PACK16_KHR } } } }, + { VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR, { { { 1, 1, VK_FORMAT_R16_UNORM }, + { 2, 2, VK_FORMAT_R16_UNORM }, + { 2, 2, VK_FORMAT_R16_UNORM } } } }, + { VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR, { { { 1, 1, VK_FORMAT_R16_UNORM }, + { 2, 2, VK_FORMAT_R16G16_UNORM }, + { 1, 1, VK_FORMAT_UNDEFINED } } } }, + { VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR, { { { 1, 1, VK_FORMAT_R16_UNORM }, + { 2, 1, VK_FORMAT_R16_UNORM }, + { 2, 1, VK_FORMAT_R16_UNORM } } } }, + { VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR, { { { 1, 1, VK_FORMAT_R16_UNORM }, + { 2, 1, VK_FORMAT_R16G16_UNORM }, + { 1, 1, VK_FORMAT_UNDEFINED } } } }, + { VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR, { { { 1, 1, VK_FORMAT_R16_UNORM }, + { 1, 1, VK_FORMAT_R16_UNORM }, + { 1, 1, VK_FORMAT_R16_UNORM } } } } +}; +// clang-format on + +VK_LAYER_EXPORT VkFormat FindMultiplaneCompatibleFormat(VkFormat mp_fmt, uint32_t plane) { + auto it = vk_multiplane_compatibility_map.find(mp_fmt); + if ((it == vk_multiplane_compatibility_map.end()) || (plane >= VK_MULTIPLANE_FORMAT_MAX_PLANES)) { + return VK_FORMAT_UNDEFINED; + } + + return it->second.per_plane[plane].compatible_format; +} diff -Nru vulkan-1.0.65.2+dfsg1/layers/vk_format_utils.h vulkan-1.1.73+dfsg/layers/vk_format_utils.h --- vulkan-1.0.65.2+dfsg1/layers/vk_format_utils.h 2017-07-03 14:21:22.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/vk_format_utils.h 2018-04-27 11:24:19.000000000 +0000 @@ -38,6 +38,8 @@ extern "C" { #endif +#define VK_MULTIPLANE_FORMAT_MAX_PLANES 3 + typedef enum VkFormatCompatibilityClass { VK_FORMAT_COMPATIBILITY_CLASS_NONE_BIT = 0, VK_FORMAT_COMPATIBILITY_CLASS_8_BIT = 1, @@ -88,7 +90,38 @@ VK_FORMAT_COMPATIBILITY_CLASS_PVRTC1_4BPP_BIT = 46, VK_FORMAT_COMPATIBILITY_CLASS_PVRTC2_2BPP_BIT = 47, VK_FORMAT_COMPATIBILITY_CLASS_PVRTC2_4BPP_BIT = 48, - VK_FORMAT_COMPATIBILITY_CLASS_MAX_ENUM = 49 + /* KHR_sampler_YCbCr_conversion */ + VK_FORMAT_COMPATIBILITY_CLASS_32BIT_G8B8G8R8 = 49, + VK_FORMAT_COMPATIBILITY_CLASS_32BIT_B8G8R8G8 = 50, + VK_FORMAT_COMPATIBILITY_CLASS_64BIT_R10G10B10A10 = 51, + VK_FORMAT_COMPATIBILITY_CLASS_64BIT_G10B10G10R10 = 52, + VK_FORMAT_COMPATIBILITY_CLASS_64BIT_B10G10R10G10 = 53, + VK_FORMAT_COMPATIBILITY_CLASS_64BIT_R12G12B12A12 = 54, + VK_FORMAT_COMPATIBILITY_CLASS_64BIT_G12B12G12R12 = 55, + VK_FORMAT_COMPATIBILITY_CLASS_64BIT_B12G12R12G12 = 56, + VK_FORMAT_COMPATIBILITY_CLASS_64BIT_G16B16G16R16 = 57, + VK_FORMAT_COMPATIBILITY_CLASS_64BIT_B16G16R16G16 = 58, + VK_FORMAT_COMPATIBILITY_CLASS_8BIT_3PLANE_420 = 59, + VK_FORMAT_COMPATIBILITY_CLASS_8BIT_2PLANE_420 = 60, + VK_FORMAT_COMPATIBILITY_CLASS_8BIT_3PLANE_422 = 61, + VK_FORMAT_COMPATIBILITY_CLASS_8BIT_2PLANE_422 = 62, + VK_FORMAT_COMPATIBILITY_CLASS_8BIT_3PLANE_444 = 63, + VK_FORMAT_COMPATIBILITY_CLASS_10BIT_3PLANE_420 = 64, + VK_FORMAT_COMPATIBILITY_CLASS_10BIT_2PLANE_420 = 65, + VK_FORMAT_COMPATIBILITY_CLASS_10BIT_3PLANE_422 = 66, + VK_FORMAT_COMPATIBILITY_CLASS_10BIT_2PLANE_422 = 67, + VK_FORMAT_COMPATIBILITY_CLASS_10BIT_3PLANE_444 = 68, + VK_FORMAT_COMPATIBILITY_CLASS_12BIT_3PLANE_420 = 69, + VK_FORMAT_COMPATIBILITY_CLASS_12BIT_2PLANE_420 = 70, + VK_FORMAT_COMPATIBILITY_CLASS_12BIT_3PLANE_422 = 71, + VK_FORMAT_COMPATIBILITY_CLASS_12BIT_2PLANE_422 = 72, + VK_FORMAT_COMPATIBILITY_CLASS_12BIT_3PLANE_444 = 73, + VK_FORMAT_COMPATIBILITY_CLASS_16BIT_3PLANE_420 = 74, + VK_FORMAT_COMPATIBILITY_CLASS_16BIT_2PLANE_420 = 75, + VK_FORMAT_COMPATIBILITY_CLASS_16BIT_3PLANE_422 = 76, + VK_FORMAT_COMPATIBILITY_CLASS_16BIT_2PLANE_422 = 77, + VK_FORMAT_COMPATIBILITY_CLASS_16BIT_3PLANE_444 = 78, + VK_FORMAT_COMPATIBILITY_CLASS_MAX_ENUM = 79 } VkFormatCompatibilityClass; VK_LAYER_EXPORT bool FormatIsDepthOrStencil(VkFormat format); @@ -99,6 +132,7 @@ VK_LAYER_EXPORT bool FormatIsCompressed_ASTC_LDR(VkFormat format); VK_LAYER_EXPORT bool FormatIsCompressed_BC(VkFormat format); VK_LAYER_EXPORT bool FormatIsCompressed_PVRTC(VkFormat format); +VK_LAYER_EXPORT bool FormatIsSinglePlane_422(VkFormat format); VK_LAYER_EXPORT bool FormatIsNorm(VkFormat format); VK_LAYER_EXPORT bool FormatIsUNorm(VkFormat format); VK_LAYER_EXPORT bool FormatIsSNorm(VkFormat format); @@ -111,16 +145,21 @@ VK_LAYER_EXPORT bool FormatIsSScaled(VkFormat format); VK_LAYER_EXPORT bool FormatIsCompressed(VkFormat format); -static inline bool FormatIsUndef(VkFormat format) { return (format == VK_FORMAT_UNDEFINED); } -static inline bool FormatIsColor(VkFormat format) { return !(FormatIsUndef(format) || FormatIsDepthOrStencil(format)); } -static inline bool FormatHasDepth(VkFormat format) { return (FormatIsDepthOnly(format) || FormatIsDepthAndStencil(format)); } -static inline bool FormatHasStencil(VkFormat format) { return (FormatIsStencilOnly(format) || FormatIsDepthAndStencil(format)); } - +VK_LAYER_EXPORT uint32_t FormatPlaneCount(VkFormat format); +VK_LAYER_EXPORT uint32_t FormatChannelCount(VkFormat format); VK_LAYER_EXPORT VkExtent3D FormatCompressedTexelBlockExtent(VkFormat format); VK_LAYER_EXPORT size_t FormatSize(VkFormat format); -VK_LAYER_EXPORT unsigned int FormatChannelCount(VkFormat format); VK_LAYER_EXPORT VkFormatCompatibilityClass FormatCompatibilityClass(VkFormat format); VK_LAYER_EXPORT VkDeviceSize SafeModulo(VkDeviceSize dividend, VkDeviceSize divisor); +VK_LAYER_EXPORT VkFormat FindMultiplaneCompatibleFormat(VkFormat fmt, uint32_t plane); + +static inline bool FormatIsUndef(VkFormat format) { return (format == VK_FORMAT_UNDEFINED); } +static inline bool FormatHasDepth(VkFormat format) { return (FormatIsDepthOnly(format) || FormatIsDepthAndStencil(format)); } +static inline bool FormatHasStencil(VkFormat format) { return (FormatIsStencilOnly(format) || FormatIsDepthAndStencil(format)); } +static inline bool FormatIsMultiplane(VkFormat format) { return ((FormatPlaneCount(format)) > 1u); } +static inline bool FormatIsColor(VkFormat format) { + return !(FormatIsUndef(format) || FormatIsDepthOrStencil(format) || FormatIsMultiplane(format)); +} #ifdef __cplusplus } diff -Nru vulkan-1.0.65.2+dfsg1/layers/vk_layer_config.cpp vulkan-1.1.73+dfsg/layers/vk_layer_config.cpp --- vulkan-1.0.65.2+dfsg1/layers/vk_layer_config.cpp 2017-07-03 14:21:22.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/vk_layer_config.cpp 2018-04-27 11:24:19.000000000 +0000 @@ -31,6 +31,10 @@ #include #include +#if defined(_WIN32) +#include +#endif + #define MAX_CHARS_PER_LINE 4096 class ConfigFile { @@ -69,11 +73,11 @@ #endif } -const char *getLayerOption(const char *_option) { return g_configFileObj.getOption(_option); } +VK_LAYER_EXPORT const char *getLayerOption(const char *_option) { return g_configFileObj.getOption(_option); } // If option is NULL or stdout, return stdout, otherwise try to open option // as a filename. If successful, return file handle, otherwise stdout -FILE *getLayerLogOutput(const char *_option, const char *layerName) { +VK_LAYER_EXPORT FILE *getLayerLogOutput(const char *_option, const char *layerName) { FILE *log_output = NULL; if (!_option || !strcmp("stdout", _option)) log_output = stdout; @@ -92,8 +96,8 @@ } // Map option strings to flag enum values -VkFlags GetLayerOptionFlags(std::string _option, std::unordered_map const &enum_data, - uint32_t option_default) { +VK_LAYER_EXPORT VkFlags GetLayerOptionFlags(std::string _option, std::unordered_map const &enum_data, + uint32_t option_default) { VkDebugReportFlagsEXT flags = option_default; std::string option_list = g_configFileObj.getOption(_option.c_str()); @@ -128,7 +132,7 @@ return flags; } -void setLayerOption(const char *_option, const char *_val) { g_configFileObj.setOption(_option, _val); } +VK_LAYER_EXPORT void setLayerOption(const char *_option, const char *_val) { g_configFileObj.setOption(_option, _val); } // Constructor for ConfigFile. Initialize layers to log error messages to stdout by default. If a vk_layer_settings file is present, // its settings will override the defaults. @@ -244,31 +248,74 @@ } } -void print_msg_flags(VkFlags msgFlags, char *msg_flags) { +VK_LAYER_EXPORT void PrintMessageFlags(VkFlags vk_flags, char *msg_flags) { bool separator = false; msg_flags[0] = 0; - if (msgFlags & VK_DEBUG_REPORT_DEBUG_BIT_EXT) { + if (vk_flags & VK_DEBUG_REPORT_DEBUG_BIT_EXT) { strcat(msg_flags, "DEBUG"); separator = true; } - if (msgFlags & VK_DEBUG_REPORT_INFORMATION_BIT_EXT) { + if (vk_flags & VK_DEBUG_REPORT_INFORMATION_BIT_EXT) { if (separator) strcat(msg_flags, ","); strcat(msg_flags, "INFO"); separator = true; } - if (msgFlags & VK_DEBUG_REPORT_WARNING_BIT_EXT) { + if (vk_flags & VK_DEBUG_REPORT_WARNING_BIT_EXT) { if (separator) strcat(msg_flags, ","); strcat(msg_flags, "WARN"); separator = true; } - if (msgFlags & VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT) { + if (vk_flags & VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT) { if (separator) strcat(msg_flags, ","); strcat(msg_flags, "PERF"); separator = true; } - if (msgFlags & VK_DEBUG_REPORT_ERROR_BIT_EXT) { + if (vk_flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) { if (separator) strcat(msg_flags, ","); strcat(msg_flags, "ERROR"); } } + +VK_LAYER_EXPORT void PrintMessageSeverity(VkFlags vk_flags, char *msg_flags) { + bool separator = false; + + msg_flags[0] = 0; + if (vk_flags & VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT) { + strcat(msg_flags, "VERBOSE"); + separator = true; + } + if (vk_flags & VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT) { + if (separator) strcat(msg_flags, ","); + strcat(msg_flags, "INFO"); + separator = true; + } + if (vk_flags & VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) { + if (separator) strcat(msg_flags, ","); + strcat(msg_flags, "WARN"); + separator = true; + } + if (vk_flags & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) { + if (separator) strcat(msg_flags, ","); + strcat(msg_flags, "ERROR"); + } +} + +VK_LAYER_EXPORT void PrintMessageType(VkFlags vk_flags, char *msg_flags) { + bool separator = false; + + msg_flags[0] = 0; + if (vk_flags & VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT) { + strcat(msg_flags, "GEN"); + separator = true; + } + if (vk_flags & VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT) { + strcat(msg_flags, "SPEC"); + separator = true; + } + if (vk_flags & VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT) { + if (separator) strcat(msg_flags, ","); + strcat(msg_flags, "PERF"); + separator = true; + } +} diff -Nru vulkan-1.0.65.2+dfsg1/layers/vk_layer_config.h vulkan-1.1.73+dfsg/layers/vk_layer_config.h --- vulkan-1.0.65.2+dfsg1/layers/vk_layer_config.h 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/vk_layer_config.h 2018-03-14 09:08:48.000000000 +0000 @@ -57,13 +57,15 @@ {std::string("error"), VK_DEBUG_REPORT_ERROR_BIT_EXT}, {std::string("debug"), VK_DEBUG_REPORT_DEBUG_BIT_EXT}}; -const char *getLayerOption(const char *_option); -FILE *getLayerLogOutput(const char *_option, const char *layerName); -VkFlags GetLayerOptionFlags(std::string _option, std::unordered_map const &enum_data, - uint32_t option_default); +VK_LAYER_EXPORT const char *getLayerOption(const char *_option); +VK_LAYER_EXPORT FILE *getLayerLogOutput(const char *_option, const char *layerName); +VK_LAYER_EXPORT VkFlags GetLayerOptionFlags(std::string _option, std::unordered_map const &enum_data, + uint32_t option_default); -void setLayerOption(const char *_option, const char *_val); -void print_msg_flags(VkFlags msgFlags, char *msg_flags); +VK_LAYER_EXPORT void setLayerOption(const char *_option, const char *_val); +VK_LAYER_EXPORT void PrintMessageFlags(VkFlags vk_flags, char *msg_flags); +VK_LAYER_EXPORT void PrintMessageSeverity(VkFlags vk_flags, char *msg_flags); +VK_LAYER_EXPORT void PrintMessageType(VkFlags vk_flags, char *msg_flags); #ifdef __cplusplus } diff -Nru vulkan-1.0.65.2+dfsg1/layers/vk_layer_logging.h vulkan-1.1.73+dfsg/layers/vk_layer_logging.h --- vulkan-1.0.65.2+dfsg1/layers/vk_layer_logging.h 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/vk_layer_logging.h 2018-04-27 11:24:19.000000000 +0000 @@ -1,6 +1,6 @@ -/* Copyright (c) 2015-2016 The Khronos Group Inc. - * Copyright (c) 2015-2016 Valve Corporation - * Copyright (c) 2015-2016 LunarG, Inc. +/* 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. @@ -16,6 +16,7 @@ * * Author: Courtney Goeltzenleuchter * Author: Tobin Ehlis + * Author: Mark Young * */ @@ -28,6 +29,8 @@ #include "vk_layer_table.h" #include "vk_loader_platform.h" #include "vulkan/vk_layer.h" +#include "vk_object_types.h" +#include "vk_validation_error_messages.h" #include #include #include @@ -35,52 +38,140 @@ #include #include #include +#include +#include +// TODO: Could be autogenerated for the specific handles for extra type safety... +template +static inline uint64_t HandleToUint64(HANDLE_T *h) { + return reinterpret_cast(h); +} + +static inline uint64_t HandleToUint64(uint64_t h) { return h; } + +// Data we store per label for logging +typedef struct _LoggingLabelData { + std::string name; + float color[4]; +} LoggingLabelData; typedef struct _debug_report_data { VkLayerDbgFunctionNode *debug_callback_list; VkLayerDbgFunctionNode *default_debug_callback_list; - VkFlags active_flags; + VkDebugUtilsMessageSeverityFlagsEXT active_severities; + VkDebugUtilsMessageTypeFlagsEXT active_types; bool g_DEBUG_REPORT; + bool g_DEBUG_UTILS; std::unordered_map *debugObjectNameMap; + std::unordered_map *debugUtilsObjectNameMap; + std::unordered_map> *debugUtilsQueueLabels; + bool queueLabelHasInsert; + std::unordered_map> *debugUtilsCmdBufLabels; + bool cmdBufLabelHasInsert; } debug_report_data; template debug_report_data *GetLayerDataPtr(void *data_key, std::unordered_map &data_map); +static inline void DebugReportFlagsToAnnotFlags(VkDebugReportFlagsEXT dr_flags, bool default_flag_is_spec, + VkDebugUtilsMessageSeverityFlagsEXT *da_severity, + VkDebugUtilsMessageTypeFlagsEXT *da_type) { + // All layer warnings are spec warnings currently. At least as far as anything not specifically + // called out. In the future, we'll label things using the new split severity and type values. + *da_type = VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT; + *da_severity = 0; + if ((dr_flags & VK_DEBUG_REPORT_DEBUG_BIT_EXT) != 0) { + *da_severity |= VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT; + *da_type |= VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT; + } + if ((dr_flags & VK_DEBUG_REPORT_INFORMATION_BIT_EXT) != 0) { + *da_severity |= VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT; + *da_type |= VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT; + } + if ((dr_flags & VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT) != 0) { + *da_severity |= VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT; + *da_type |= VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT; + } + if ((dr_flags & VK_DEBUG_REPORT_WARNING_BIT_EXT) != 0) { + *da_severity |= VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT; + } + if ((dr_flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) != 0) { + *da_severity |= VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT; + } +} + // Forward Declarations -static inline bool debug_report_log_msg(const debug_report_data *debug_data, VkFlags msgFlags, - VkDebugReportObjectTypeEXT objectType, uint64_t srcObject, size_t location, int32_t msgCode, - const char *pLayerPrefix, const char *pMsg); +static inline bool debug_log_msg(const debug_report_data *debug_data, VkFlags msg_flags, VkDebugReportObjectTypeEXT object_type, + uint64_t src_object, size_t location, int32_t msg_code, const char *layer_prefix, + const char *message, const char *text_vuid = NULL); // Add a debug message callback node structure to the specified callback linked list -static inline void AddDebugMessageCallback(debug_report_data *debug_data, VkLayerDbgFunctionNode **list_head, - VkLayerDbgFunctionNode *new_node) { +static inline void AddDebugCallbackNode(debug_report_data *debug_data, VkLayerDbgFunctionNode **list_head, + VkLayerDbgFunctionNode *new_node) { new_node->pNext = *list_head; *list_head = new_node; } +// Remove specified debug messenger node structure from the specified linked list +static inline void RemoveDebugUtilsMessenger(debug_report_data *debug_data, VkLayerDbgFunctionNode **list_head, + VkDebugUtilsMessengerEXT messenger) { + VkLayerDbgFunctionNode *cur_callback = *list_head; + VkLayerDbgFunctionNode *prev_callback = cur_callback; + bool matched = false; + VkFlags local_severities = 0; + VkFlags local_types = 0; + + while (cur_callback) { + if (cur_callback->is_messenger && cur_callback->messenger.messenger == messenger) { + matched = true; + prev_callback->pNext = cur_callback->pNext; + if (*list_head == cur_callback) { + *list_head = cur_callback->pNext; + } + debug_log_msg(debug_data, VK_DEBUG_REPORT_DEBUG_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT, + reinterpret_cast(cur_callback->messenger.messenger), 0, 0, "DebugUtilsMessenger", + "Destroyed messenger\n"); + } else { + matched = false; + local_severities |= cur_callback->messenger.messageSeverity; + local_types |= cur_callback->messenger.messageType; + } + prev_callback = cur_callback; + cur_callback = cur_callback->pNext; + if (matched) { + free(prev_callback); + } + } + debug_data->active_severities = local_severities; + debug_data->active_types = local_types; +} + // Remove specified debug message callback node structure from the specified callback linked list -static inline void RemoveDebugMessageCallback(debug_report_data *debug_data, VkLayerDbgFunctionNode **list_head, - VkDebugReportCallbackEXT callback) { +static inline void RemoveDebugUtilsMessageCallback(debug_report_data *debug_data, VkLayerDbgFunctionNode **list_head, + VkDebugReportCallbackEXT callback) { VkLayerDbgFunctionNode *cur_callback = *list_head; VkLayerDbgFunctionNode *prev_callback = cur_callback; bool matched = false; - VkFlags local_flags = 0; + VkFlags local_severities = 0; + VkFlags local_types = 0; while (cur_callback) { - if (cur_callback->msgCallback == callback) { + if (!cur_callback->is_messenger && cur_callback->report.msgCallback == callback) { matched = true; prev_callback->pNext = cur_callback->pNext; if (*list_head == cur_callback) { *list_head = cur_callback->pNext; } - debug_report_log_msg(debug_data, VK_DEBUG_REPORT_DEBUG_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT, - reinterpret_cast(cur_callback->msgCallback), 0, 0, "DebugReport", - "Destroyed callback\n"); + debug_log_msg(debug_data, VK_DEBUG_REPORT_DEBUG_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT, + reinterpret_cast(cur_callback->report.msgCallback), 0, 0, "DebugReport", + "Destroyed callback\n"); } else { matched = false; - local_flags |= cur_callback->msgFlags; + VkFlags this_severities = 0; + VkFlags this_types = 0; + DebugReportFlagsToAnnotFlags(cur_callback->report.msgFlags, true, &this_severities, &this_types); + local_severities |= this_severities; + local_types |= this_types; } prev_callback = cur_callback; cur_callback = cur_callback->pNext; @@ -88,7 +179,8 @@ free(prev_callback); } } - debug_data->active_flags = local_flags; + debug_data->active_severities = local_severities; + debug_data->active_types = local_types; } // Removes all debug callback function nodes from the specified callback linked lists and frees their resources @@ -98,56 +190,254 @@ while (current_callback) { prev_callback = current_callback->pNext; - debug_report_log_msg(debug_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT, - (uint64_t)current_callback->msgCallback, 0, 0, "DebugReport", - "Debug Report callbacks not removed before DestroyInstance"); + if (!current_callback->is_messenger) { + debug_log_msg(debug_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT, + (uint64_t)current_callback->report.msgCallback, 0, 0, "DebugReport", + "Debug Report callbacks not removed before DestroyInstance"); + } else { + debug_log_msg(debug_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT, + (uint64_t)current_callback->messenger.messenger, 0, 0, "Messenger", + "Debug messengers not removed before DestroyInstance"); + } free(current_callback); current_callback = prev_callback; } *list_head = NULL; } -// Utility function to handle reporting -static inline bool debug_report_log_msg(const debug_report_data *debug_data, VkFlags msgFlags, - VkDebugReportObjectTypeEXT objectType, uint64_t srcObject, size_t location, int32_t msgCode, - const char *pLayerPrefix, const char *pMsg) { +// Note that text_vuid is a default parameter, and is optional. See the above forward declaration +static inline bool debug_log_msg(const debug_report_data *debug_data, VkFlags msg_flags, VkDebugReportObjectTypeEXT object_type, + uint64_t src_object, size_t location, int32_t msg_code, const char *layer_prefix, + const char *message, const char *text_vuid) { bool bail = false; - VkLayerDbgFunctionNode *pTrav = NULL; + VkLayerDbgFunctionNode *layer_dbg_node = NULL; if (debug_data->debug_callback_list != NULL) { - pTrav = debug_data->debug_callback_list; + layer_dbg_node = debug_data->debug_callback_list; + } else { + layer_dbg_node = debug_data->default_debug_callback_list; + } + + VkDebugUtilsMessageSeverityFlagsEXT severity; + VkDebugUtilsMessageTypeFlagsEXT types; + VkDebugUtilsMessengerCallbackDataEXT callback_data; + VkDebugUtilsObjectNameInfoEXT object_name_info; + + // Convert the info to the VK_EXT_debug_utils form in case we need it. + DebugReportFlagsToAnnotFlags(msg_flags, true, &severity, &types); + object_name_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT; + object_name_info.pNext = NULL; + object_name_info.objectType = convertDebugReportObjectToCoreObject(object_type); + object_name_info.objectHandle = (uint64_t)(uintptr_t)src_object; + object_name_info.pObjectName = NULL; + + callback_data.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT; + callback_data.pNext = NULL; + callback_data.flags = 0; + callback_data.pMessageIdName = text_vuid; + callback_data.messageIdNumber = msg_code; + callback_data.pMessage = message; + callback_data.queueLabelCount = 0; + callback_data.pQueueLabels = NULL; + callback_data.cmdBufLabelCount = 0; + callback_data.pCmdBufLabels = NULL; + callback_data.objectCount = 1; + callback_data.pObjects = &object_name_info; + + VkDebugUtilsLabelEXT *queue_labels = nullptr; + VkDebugUtilsLabelEXT *cmd_buf_labels = nullptr; + std::string new_debug_report_message = ""; + std::ostringstream oss; + + if (0 != src_object) { + oss << "Object: 0x" << std::hex << src_object; + // If this is a queue, add any queue labels to the callback data. + if (VK_OBJECT_TYPE_QUEUE == object_name_info.objectType) { + auto label_iter = debug_data->debugUtilsQueueLabels->find(reinterpret_cast(src_object)); + if (label_iter != debug_data->debugUtilsQueueLabels->end()) { + queue_labels = new VkDebugUtilsLabelEXT[label_iter->second.size()]; + if (nullptr != queue_labels) { + // Record the labels, but record them in reverse order since we want the + // most recent at the top. + uint32_t label_size = static_cast(label_iter->second.size()); + uint32_t last_index = label_size - 1; + for (uint32_t label = 0; label < label_size; ++label) { + queue_labels[last_index - label].sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT; + queue_labels[last_index - label].pNext = nullptr; + queue_labels[last_index - label].pLabelName = label_iter->second[label].name.c_str(); + queue_labels[last_index - label].color[0] = label_iter->second[label].color[0]; + queue_labels[last_index - label].color[1] = label_iter->second[label].color[1]; + queue_labels[last_index - label].color[2] = label_iter->second[label].color[2]; + queue_labels[last_index - label].color[3] = label_iter->second[label].color[3]; + } + callback_data.queueLabelCount = label_size; + callback_data.pQueueLabels = queue_labels; + } + } + // If this is a command buffer, add any command buffer labels to the callback data. + } else if (VK_OBJECT_TYPE_COMMAND_BUFFER == object_name_info.objectType) { + auto label_iter = debug_data->debugUtilsCmdBufLabels->find(reinterpret_cast(src_object)); + if (label_iter != debug_data->debugUtilsCmdBufLabels->end()) { + cmd_buf_labels = new VkDebugUtilsLabelEXT[label_iter->second.size()]; + if (nullptr != cmd_buf_labels) { + // Record the labels, but record them in reverse order since we want the + // most recent at the top. + uint32_t label_size = static_cast(label_iter->second.size()); + uint32_t last_index = label_size - 1; + for (uint32_t label = 0; label < label_size; ++label) { + cmd_buf_labels[last_index - label].sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT; + cmd_buf_labels[last_index - label].pNext = nullptr; + cmd_buf_labels[last_index - label].pLabelName = label_iter->second[label].name.c_str(); + cmd_buf_labels[last_index - label].color[0] = label_iter->second[label].color[0]; + cmd_buf_labels[last_index - label].color[1] = label_iter->second[label].color[1]; + cmd_buf_labels[last_index - label].color[2] = label_iter->second[label].color[2]; + cmd_buf_labels[last_index - label].color[3] = label_iter->second[label].color[3]; + } + callback_data.cmdBufLabelCount = label_size; + callback_data.pCmdBufLabels = cmd_buf_labels; + } + } + } + // Look for any debug utils or marker names to use for this object + callback_data.pObjects[0].pObjectName = NULL; + auto utils_name_iter = debug_data->debugUtilsObjectNameMap->find(src_object); + if (utils_name_iter != debug_data->debugUtilsObjectNameMap->end()) { + callback_data.pObjects[0].pObjectName = utils_name_iter->second.c_str(); + } else { + auto marker_name_iter = debug_data->debugObjectNameMap->find(src_object); + if (marker_name_iter != debug_data->debugObjectNameMap->end()) { + callback_data.pObjects[0].pObjectName = marker_name_iter->second.c_str(); + } + } + if (NULL != callback_data.pObjects[0].pObjectName) { + oss << " (Name = " << callback_data.pObjects[0].pObjectName << " : Type = "; + } else { + oss << " (Type = "; + } + oss << std::to_string(object_type) << ")"; } else { - pTrav = debug_data->default_debug_callback_list; + oss << "Object: VK_NULL_HANDLE (Type = " << std::to_string(object_type) << ")"; + } + new_debug_report_message += oss.str(); + new_debug_report_message += " | "; + new_debug_report_message += message; + + while (layer_dbg_node) { + // If the app uses the VK_EXT_debug_report extension, call all of those registered callbacks. + if (!layer_dbg_node->is_messenger && (layer_dbg_node->report.msgFlags & msg_flags)) { + if (text_vuid != nullptr) { + // If a text vuid is supplied for the old debug report extension, prepend it to the message string + new_debug_report_message.insert(0, " ] "); + new_debug_report_message.insert(0, text_vuid); + new_debug_report_message.insert(0, " [ "); + } + + if (layer_dbg_node->report.pfnMsgCallback(msg_flags, object_type, src_object, location, msg_code, layer_prefix, + new_debug_report_message.c_str(), layer_dbg_node->pUserData)) { + bail = true; + } + // If the app uses the VK_EXT_debug_utils extension, call all of those registered callbacks. + } else if (layer_dbg_node->is_messenger && (layer_dbg_node->messenger.messageSeverity & severity) && + (layer_dbg_node->messenger.messageType & types)) { + if (layer_dbg_node->messenger.pfnUserCallback(static_cast(severity), types, + &callback_data, layer_dbg_node->pUserData)) { + bail = true; + } + } + layer_dbg_node = layer_dbg_node->pNext; } - while (pTrav) { - if (pTrav->msgFlags & msgFlags) { - auto it = debug_data->debugObjectNameMap->find(srcObject); + if (nullptr != queue_labels) { + delete[] queue_labels; + } + if (nullptr != cmd_buf_labels) { + delete[] cmd_buf_labels; + } + + return bail; +} + +static inline void DebugAnnotFlagsToReportFlags(VkDebugUtilsMessageSeverityFlagBitsEXT da_severity, + VkDebugUtilsMessageTypeFlagsEXT da_type, VkDebugReportFlagsEXT *dr_flags) { + *dr_flags = 0; + + if ((da_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) != 0) { + *dr_flags |= VK_DEBUG_REPORT_ERROR_BIT_EXT; + } else if ((da_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) != 0) { + if ((da_type & VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT) != 0) { + *dr_flags |= VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT; + } else { + *dr_flags |= VK_DEBUG_REPORT_WARNING_BIT_EXT; + } + } else if ((da_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT) != 0) { + *dr_flags |= VK_DEBUG_REPORT_INFORMATION_BIT_EXT; + } else if ((da_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT) != 0) { + *dr_flags |= VK_DEBUG_REPORT_DEBUG_BIT_EXT; + } +} + +static inline bool debug_messenger_log_msg(const debug_report_data *debug_data, + VkDebugUtilsMessageSeverityFlagBitsEXT message_severity, + VkDebugUtilsMessageTypeFlagsEXT message_type, + VkDebugUtilsMessengerCallbackDataEXT *callback_data) { + bool bail = false; + VkLayerDbgFunctionNode *layer_dbg_node = NULL; + + if (debug_data->debug_callback_list != NULL) { + layer_dbg_node = debug_data->debug_callback_list; + } else { + layer_dbg_node = debug_data->default_debug_callback_list; + } + + VkDebugReportFlagsEXT object_flags = 0; + + DebugAnnotFlagsToReportFlags(message_severity, message_type, &object_flags); + + while (layer_dbg_node) { + if (layer_dbg_node->is_messenger && (layer_dbg_node->messenger.messageSeverity & message_severity) && + (layer_dbg_node->messenger.messageType & message_type)) { + // Loop through each object and give it the proper name if it was set. + for (uint32_t obj = 0; obj < callback_data->objectCount; obj++) { + auto it = debug_data->debugUtilsObjectNameMap->find(callback_data->pObjects[obj].objectHandle); + if (it == debug_data->debugUtilsObjectNameMap->end()) { + continue; + } + callback_data->pObjects[obj].pObjectName = it->second.c_str(); + } + if (layer_dbg_node->messenger.pfnUserCallback(message_severity, message_type, callback_data, + layer_dbg_node->pUserData)) { + bail = true; + } + } else if (!layer_dbg_node->is_messenger && layer_dbg_node->report.msgFlags & object_flags) { + auto it = debug_data->debugObjectNameMap->find(callback_data->pObjects[0].objectHandle); + VkDebugReportObjectTypeEXT object_type = get_debug_report_enum[callback_data->pObjects[0].objectType]; if (it == debug_data->debugObjectNameMap->end()) { - if (pTrav->pfnMsgCallback(msgFlags, objectType, srcObject, location, msgCode, pLayerPrefix, pMsg, - pTrav->pUserData)) { + if (layer_dbg_node->report.pfnMsgCallback(object_flags, object_type, callback_data->pObjects[0].objectHandle, 0, + callback_data->messageIdNumber, callback_data->pMessageIdName, + callback_data->pMessage, layer_dbg_node->pUserData)) { bail = true; } } else { std::string newMsg = "SrcObject name = "; newMsg.append(it->second.c_str()); newMsg.append(" "); - newMsg.append(pMsg); - if (pTrav->pfnMsgCallback(msgFlags, objectType, srcObject, location, msgCode, pLayerPrefix, newMsg.c_str(), - pTrav->pUserData)) { + newMsg.append(callback_data->pMessage); + if (layer_dbg_node->report.pfnMsgCallback(object_flags, object_type, callback_data->pObjects[0].objectHandle, 0, + callback_data->messageIdNumber, callback_data->pMessageIdName, + newMsg.c_str(), layer_dbg_node->pUserData)) { bail = true; } } } - pTrav = pTrav->pNext; + layer_dbg_node = layer_dbg_node->pNext; } return bail; } -static inline debug_report_data *debug_report_create_instance( +static inline debug_report_data *debug_utils_create_instance( VkLayerInstanceDispatchTable *table, VkInstance inst, uint32_t extension_count, - const char *const *ppEnabledExtensions) // layer or extension name to be enabled + const char *const *enabled_extensions) // layer or extension name to be enabled { debug_report_data *debug_data = (debug_report_data *)malloc(sizeof(debug_report_data)); if (!debug_data) return NULL; @@ -155,78 +445,162 @@ memset(debug_data, 0, sizeof(debug_report_data)); for (uint32_t i = 0; i < extension_count; i++) { // TODO: Check other property fields - if (strcmp(ppEnabledExtensions[i], VK_EXT_DEBUG_REPORT_EXTENSION_NAME) == 0) { + if (strcmp(enabled_extensions[i], VK_EXT_DEBUG_REPORT_EXTENSION_NAME) == 0) { debug_data->g_DEBUG_REPORT = true; + } else if (strcmp(enabled_extensions[i], VK_EXT_DEBUG_UTILS_EXTENSION_NAME) == 0) { + debug_data->g_DEBUG_UTILS = true; } } debug_data->debugObjectNameMap = new std::unordered_map; + debug_data->debugUtilsObjectNameMap = new std::unordered_map; + debug_data->debugUtilsQueueLabels = new std::unordered_map>; + debug_data->debugUtilsCmdBufLabels = new std::unordered_map>; + debug_data->queueLabelHasInsert = false; + debug_data->cmdBufLabelHasInsert = false; return debug_data; } -static inline void layer_debug_report_destroy_instance(debug_report_data *debug_data) { +static inline void layer_debug_utils_destroy_instance(debug_report_data *debug_data) { if (debug_data) { RemoveAllMessageCallbacks(debug_data, &debug_data->default_debug_callback_list); RemoveAllMessageCallbacks(debug_data, &debug_data->debug_callback_list); delete debug_data->debugObjectNameMap; + delete debug_data->debugUtilsObjectNameMap; + delete debug_data->debugUtilsQueueLabels; + delete debug_data->debugUtilsCmdBufLabels; free(debug_data); } } -static inline debug_report_data *layer_debug_report_create_device(debug_report_data *instance_debug_data, VkDevice device) { +static inline debug_report_data *layer_debug_utils_create_device(debug_report_data *instance_debug_data, VkDevice device) { // DEBUG_REPORT shares data between Instance and Device, // so just return instance's data pointer return instance_debug_data; } -static inline void layer_debug_report_destroy_device(VkDevice device) { +static inline void layer_debug_utils_destroy_device(VkDevice device) { // Nothing to do since we're using instance data record } -static inline void layer_destroy_msg_callback(debug_report_data *debug_data, VkDebugReportCallbackEXT callback, - const VkAllocationCallbacks *pAllocator) { - RemoveDebugMessageCallback(debug_data, &debug_data->debug_callback_list, callback); - RemoveDebugMessageCallback(debug_data, &debug_data->default_debug_callback_list, callback); +static inline void layer_destroy_messenger_callback(debug_report_data *debug_data, VkDebugUtilsMessengerEXT messenger, + const VkAllocationCallbacks *allocator) { + RemoveDebugUtilsMessenger(debug_data, &debug_data->debug_callback_list, messenger); + RemoveDebugUtilsMessenger(debug_data, &debug_data->default_debug_callback_list, messenger); } -static inline VkResult layer_create_msg_callback(debug_report_data *debug_data, bool default_callback, - const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT *pCallback) { +static inline VkResult layer_create_messenger_callback(debug_report_data *debug_data, bool default_callback, + const VkDebugUtilsMessengerCreateInfoEXT *create_info, + const VkAllocationCallbacks *allocator, + VkDebugUtilsMessengerEXT *messenger) { VkLayerDbgFunctionNode *pNewDbgFuncNode = (VkLayerDbgFunctionNode *)malloc(sizeof(VkLayerDbgFunctionNode)); if (!pNewDbgFuncNode) return VK_ERROR_OUT_OF_HOST_MEMORY; + memset(pNewDbgFuncNode, 0, sizeof(VkLayerDbgFunctionNode)); + pNewDbgFuncNode->is_messenger = true; // Handle of 0 is logging_callback so use allocated Node address as unique handle - if (!(*pCallback)) *pCallback = (VkDebugReportCallbackEXT)pNewDbgFuncNode; - pNewDbgFuncNode->msgCallback = *pCallback; - pNewDbgFuncNode->pfnMsgCallback = pCreateInfo->pfnCallback; - pNewDbgFuncNode->msgFlags = pCreateInfo->flags; - pNewDbgFuncNode->pUserData = pCreateInfo->pUserData; + if (!(*messenger)) *messenger = (VkDebugUtilsMessengerEXT)pNewDbgFuncNode; + pNewDbgFuncNode->messenger.messenger = *messenger; + pNewDbgFuncNode->messenger.pfnUserCallback = create_info->pfnUserCallback; + pNewDbgFuncNode->messenger.messageSeverity = create_info->messageSeverity; + pNewDbgFuncNode->messenger.messageType = create_info->messageType; + pNewDbgFuncNode->pUserData = create_info->pUserData; + debug_data->active_severities |= create_info->messageSeverity; + debug_data->active_types |= create_info->messageType; if (default_callback) { - AddDebugMessageCallback(debug_data, &debug_data->default_debug_callback_list, pNewDbgFuncNode); - debug_data->active_flags |= pCreateInfo->flags; + AddDebugCallbackNode(debug_data, &debug_data->default_debug_callback_list, pNewDbgFuncNode); } else { - AddDebugMessageCallback(debug_data, &debug_data->debug_callback_list, pNewDbgFuncNode); - debug_data->active_flags = pCreateInfo->flags; + AddDebugCallbackNode(debug_data, &debug_data->debug_callback_list, pNewDbgFuncNode); } - debug_report_log_msg(debug_data, VK_DEBUG_REPORT_DEBUG_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT, - (uint64_t)*pCallback, 0, 0, "DebugReport", "Added callback"); + VkDebugUtilsMessengerCallbackDataEXT callback_data = {}; + VkDebugUtilsObjectNameInfoEXT blank_object = {}; + callback_data.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT; + callback_data.pNext = NULL; + callback_data.flags = 0; + callback_data.pMessageIdName = "Layer Internal Message"; + callback_data.messageIdNumber = 0; + callback_data.pMessage = "Added messenger"; + callback_data.queueLabelCount = 0; + callback_data.pQueueLabels = NULL; + callback_data.cmdBufLabelCount = 0; + callback_data.pCmdBufLabels = NULL; + callback_data.objectCount = 1; + callback_data.pObjects = &blank_object; + blank_object.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT; + blank_object.pNext = NULL; + blank_object.objectType = VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT; + blank_object.objectHandle = HandleToUint64(*messenger); + blank_object.pObjectName = NULL; + debug_messenger_log_msg(debug_data, VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT, + VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT, &callback_data); return VK_SUCCESS; } -static inline PFN_vkVoidFunction debug_report_get_instance_proc_addr(debug_report_data *debug_data, const char *funcName) { - if (!debug_data || !debug_data->g_DEBUG_REPORT) { - return NULL; +static inline void layer_destroy_report_callback(debug_report_data *debug_data, VkDebugReportCallbackEXT callback, + const VkAllocationCallbacks *allocator) { + RemoveDebugUtilsMessageCallback(debug_data, &debug_data->debug_callback_list, callback); + RemoveDebugUtilsMessageCallback(debug_data, &debug_data->default_debug_callback_list, callback); +} + +static inline VkResult layer_create_report_callback(debug_report_data *debug_data, bool default_callback, + const VkDebugReportCallbackCreateInfoEXT *create_info, + const VkAllocationCallbacks *allocator, VkDebugReportCallbackEXT *callback) { + VkLayerDbgFunctionNode *pNewDbgFuncNode = (VkLayerDbgFunctionNode *)malloc(sizeof(VkLayerDbgFunctionNode)); + if (!pNewDbgFuncNode) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + memset(pNewDbgFuncNode, 0, sizeof(VkLayerDbgFunctionNode)); + pNewDbgFuncNode->is_messenger = false; + + // Handle of 0 is logging_callback so use allocated Node address as unique handle + if (!(*callback)) *callback = (VkDebugReportCallbackEXT)pNewDbgFuncNode; + pNewDbgFuncNode->report.msgCallback = *callback; + pNewDbgFuncNode->report.pfnMsgCallback = create_info->pfnCallback; + pNewDbgFuncNode->report.msgFlags = create_info->flags; + pNewDbgFuncNode->pUserData = create_info->pUserData; + + VkFlags local_severity = 0; + VkFlags local_type = 0; + DebugReportFlagsToAnnotFlags(create_info->flags, true, &local_severity, &local_type); + debug_data->active_severities |= local_severity; + debug_data->active_types |= local_type; + if (default_callback) { + AddDebugCallbackNode(debug_data, &debug_data->default_debug_callback_list, pNewDbgFuncNode); + } else { + AddDebugCallbackNode(debug_data, &debug_data->debug_callback_list, pNewDbgFuncNode); } - if (!strcmp(funcName, "vkCreateDebugReportCallbackEXT")) { - return (PFN_vkVoidFunction)vkCreateDebugReportCallbackEXT; + debug_log_msg(debug_data, VK_DEBUG_REPORT_DEBUG_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT, (uint64_t)*callback, 0, + 0, "DebugReport", "Added callback"); + return VK_SUCCESS; +} + +static inline PFN_vkVoidFunction debug_utils_get_instance_proc_addr(debug_report_data *debug_data, const char *func_name) { + if (!debug_data) { + return NULL; } - if (!strcmp(funcName, "vkDestroyDebugReportCallbackEXT")) { - return (PFN_vkVoidFunction)vkDestroyDebugReportCallbackEXT; + if (debug_data->g_DEBUG_REPORT) { + if (!strcmp(func_name, "vkCreateDebugReportCallbackEXT")) { + return (PFN_vkVoidFunction)vkCreateDebugReportCallbackEXT; + } + if (!strcmp(func_name, "vkDestroyDebugReportCallbackEXT")) { + return (PFN_vkVoidFunction)vkDestroyDebugReportCallbackEXT; + } + if (!strcmp(func_name, "vkDebugReportMessageEXT")) { + return (PFN_vkVoidFunction)vkDebugReportMessageEXT; + } } - if (!strcmp(funcName, "vkDebugReportMessageEXT")) { - return (PFN_vkVoidFunction)vkDebugReportMessageEXT; + if (debug_data->g_DEBUG_UTILS) { + if (!strcmp(func_name, "vkCreateDebugUtilsMessengerEXT")) { + return (PFN_vkVoidFunction)vkCreateDebugUtilsMessengerEXT; + } + if (!strcmp(func_name, "vkDestroyDebugUtilsMessengerEXT")) { + return (PFN_vkVoidFunction)vkDestroyDebugUtilsMessengerEXT; + } + if (!strcmp(func_name, "vkSubmitDebugUtilsMessageEXT")) { + return (PFN_vkVoidFunction)vkSubmitDebugUtilsMessageEXT; + } } return NULL; } @@ -236,8 +610,9 @@ // then allocates an array that can hold that many structs, as well as that // many VkDebugReportCallbackEXT handles. It then copies each // VkDebugReportCallbackCreateInfoEXT, and initializes each handle. -static VkResult layer_copy_tmp_callbacks(const void *pChain, uint32_t *num_callbacks, VkDebugReportCallbackCreateInfoEXT **infos, - VkDebugReportCallbackEXT **callbacks) { +static inline VkResult layer_copy_tmp_report_callbacks(const void *pChain, uint32_t *num_callbacks, + VkDebugReportCallbackCreateInfoEXT **infos, + VkDebugReportCallbackEXT **callbacks) { uint32_t n = *num_callbacks = 0; const void *pNext = pChain; @@ -280,22 +655,23 @@ return VK_SUCCESS; } -// This utility frees the arrays allocated by layer_copy_tmp_callbacks() -static void layer_free_tmp_callbacks(VkDebugReportCallbackCreateInfoEXT *infos, VkDebugReportCallbackEXT *callbacks) { +// This utility frees the arrays allocated by layer_copy_tmp_report_callbacks() +static inline void layer_free_tmp_report_callbacks(VkDebugReportCallbackCreateInfoEXT *infos, VkDebugReportCallbackEXT *callbacks) { free(infos); free(callbacks); } // This utility enables all of the VkDebugReportCallbackCreateInfoEXT structs -// that were copied by layer_copy_tmp_callbacks() -static VkResult layer_enable_tmp_callbacks(debug_report_data *debug_data, uint32_t num_callbacks, - VkDebugReportCallbackCreateInfoEXT *infos, VkDebugReportCallbackEXT *callbacks) { +// that were copied by layer_copy_tmp_report_callbacks() +static inline VkResult layer_enable_tmp_report_callbacks(debug_report_data *debug_data, uint32_t num_callbacks, + VkDebugReportCallbackCreateInfoEXT *infos, + VkDebugReportCallbackEXT *callbacks) { VkResult rtn = VK_SUCCESS; for (uint32_t i = 0; i < num_callbacks; i++) { - rtn = layer_create_msg_callback(debug_data, false, &infos[i], NULL, &callbacks[i]); + rtn = layer_create_report_callback(debug_data, false, &infos[i], NULL, &callbacks[i]); if (rtn != VK_SUCCESS) { for (uint32_t j = 0; j < i; j++) { - layer_destroy_msg_callback(debug_data, callbacks[j], NULL); + layer_destroy_report_callback(debug_data, callbacks[j], NULL); } return rtn; } @@ -304,25 +680,129 @@ } // This utility disables all of the VkDebugReportCallbackCreateInfoEXT structs -// that were copied by layer_copy_tmp_callbacks() -static void layer_disable_tmp_callbacks(debug_report_data *debug_data, uint32_t num_callbacks, - VkDebugReportCallbackEXT *callbacks) { +// that were copied by layer_copy_tmp_report_callbacks() +static inline void layer_disable_tmp_report_callbacks(debug_report_data *debug_data, uint32_t num_callbacks, + VkDebugReportCallbackEXT *callbacks) { for (uint32_t i = 0; i < num_callbacks; i++) { - layer_destroy_msg_callback(debug_data, callbacks[i], NULL); + layer_destroy_report_callback(debug_data, callbacks[i], NULL); + } +} + +// This utility (called at vkCreateInstance() time), looks at a pNext chain. +// It counts any VkDebugUtilsMessengerCreateInfoEXT structs that it finds. It +// then allocates an array that can hold that many structs, as well as that +// many VkDebugUtilsMessengerEXT handles. It then copies each +// VkDebugUtilsMessengerCreateInfoEXT, and initializes each handle. +static inline VkResult layer_copy_tmp_debug_messengers(const void *pChain, uint32_t *num_messengers, + VkDebugUtilsMessengerCreateInfoEXT **infos, + VkDebugUtilsMessengerEXT **messengers) { + uint32_t n = *num_messengers = 0; + + const void *pNext = pChain; + while (pNext) { + // 1st, count the number VkDebugUtilsMessengerCreateInfoEXT: + if (((VkDebugUtilsMessengerCreateInfoEXT *)pNext)->sType == VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT) { + n++; + } + pNext = (void *)((VkDebugUtilsMessengerCreateInfoEXT *)pNext)->pNext; + } + if (n == 0) { + return VK_SUCCESS; + } + + // 2nd, allocate memory for each VkDebugUtilsMessengerCreateInfoEXT: + VkDebugUtilsMessengerCreateInfoEXT *pInfos = *infos = + ((VkDebugUtilsMessengerCreateInfoEXT *)malloc(n * sizeof(VkDebugUtilsMessengerCreateInfoEXT))); + if (!pInfos) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + // 3rd, allocate memory for a unique handle for each messenger: + VkDebugUtilsMessengerEXT *pMessengers = *messengers = + ((VkDebugUtilsMessengerEXT *)malloc(n * sizeof(VkDebugUtilsMessengerEXT))); + if (!pMessengers) { + free(pInfos); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + // 4th, copy each VkDebugUtilsMessengerCreateInfoEXT for use by + // vkDestroyInstance, and assign a unique handle to each callback (just + // use the address of the copied VkDebugUtilsMessengerCreateInfoEXT): + pNext = pChain; + while (pNext) { + if (((VkInstanceCreateInfo *)pNext)->sType == VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT) { + memcpy(pInfos, pNext, sizeof(VkDebugUtilsMessengerCreateInfoEXT)); + *pMessengers++ = (VkDebugUtilsMessengerEXT)pInfos++; + } + pNext = (void *)((VkInstanceCreateInfo *)pNext)->pNext; + } + + *num_messengers = n; + return VK_SUCCESS; +} + +// This utility frees the arrays allocated by layer_copy_tmp_debug_messengers() +static inline void layer_free_tmp_debug_messengers(VkDebugUtilsMessengerCreateInfoEXT *infos, + VkDebugUtilsMessengerEXT *messengers) { + free(infos); + free(messengers); +} + +// This utility enables all of the VkDebugUtilsMessengerCreateInfoEXT structs +// that were copied by layer_copy_tmp_debug_messengers() +static inline VkResult layer_enable_tmp_debug_messengers(debug_report_data *debug_data, uint32_t num_messengers, + VkDebugUtilsMessengerCreateInfoEXT *infos, + VkDebugUtilsMessengerEXT *messengers) { + VkResult rtn = VK_SUCCESS; + for (uint32_t i = 0; i < num_messengers; i++) { + rtn = layer_create_messenger_callback(debug_data, false, &infos[i], NULL, &messengers[i]); + if (rtn != VK_SUCCESS) { + for (uint32_t j = 0; j < i; j++) { + layer_destroy_messenger_callback(debug_data, messengers[j], NULL); + } + return rtn; + } + } + return rtn; +} + +// This utility disables all of the VkDebugUtilsMessengerCreateInfoEXT structs +// that were copied by layer_copy_tmp_debug_messengers() +static inline void layer_disable_tmp_debug_messengers(debug_report_data *debug_data, uint32_t num_messengers, + VkDebugUtilsMessengerEXT *messengers) { + for (uint32_t i = 0; i < num_messengers; i++) { + layer_destroy_messenger_callback(debug_data, messengers[i], NULL); } } // Checks if the message will get logged. // Allows layer to defer collecting & formating data if the // message will be discarded. -static inline bool will_log_msg(debug_report_data *debug_data, VkFlags msgFlags) { - if (!debug_data || !(debug_data->active_flags & msgFlags)) { +static inline bool will_log_msg(debug_report_data *debug_data, VkFlags msg_flags) { + VkFlags local_severity = 0; + VkFlags local_type = 0; + DebugReportFlagsToAnnotFlags(msg_flags, true, &local_severity, &local_type); + if (!debug_data || !(debug_data->active_severities & local_severity) || !(debug_data->active_types & local_type)) { // Message is not wanted return false; } return true; } +#ifndef WIN32 +static inline int string_sprintf(std::string *output, const char *fmt, ...) __attribute__((format(printf, 2, 3))); +#endif +static inline int string_sprintf(std::string *output, const char *fmt, ...) { + std::string &formatted = *output; + va_list argptr; + va_start(argptr, fmt); + int reserve = vsnprintf(nullptr, 0, fmt, argptr); + va_end(argptr); + formatted.reserve(reserve + 1); + va_start(argptr, fmt); + int result = vsnprintf((char *)formatted.data(), formatted.capacity(), fmt, argptr); + va_end(argptr); + assert(result == reserve); + return result; +} #ifdef WIN32 static inline int vasprintf(char **strp, char const *fmt, va_list ap) { @@ -339,18 +819,55 @@ } #endif -// Output log message via DEBUG_REPORT -// Takes format and variable arg list so that output string -// is only computed if a message needs to be logged +// Output log message via DEBUG_REPORT. Takes format and variable arg list so that output string is only computed if a message +// needs to be logged #ifndef WIN32 -static inline bool log_msg(const debug_report_data *debug_data, VkFlags msgFlags, VkDebugReportObjectTypeEXT objectType, - uint64_t srcObject, size_t location, int32_t msgCode, const char *pLayerPrefix, const char *format, ...) - __attribute__((format(printf, 8, 9))); +static inline bool log_msg(const debug_report_data *debug_data, VkFlags msg_flags, VkDebugReportObjectTypeEXT object_type, + uint64_t src_object, int32_t msg_code, const char *format, ...) __attribute__((format(printf, 6, 7))); +static inline bool log_msg(const debug_report_data *debug_data, VkFlags msg_flags, VkDebugReportObjectTypeEXT object_type, + uint64_t src_object, std::string vuid_text, const char *format, ...) + __attribute__((format(printf, 6, 7))); #endif -static inline bool log_msg(const debug_report_data *debug_data, VkFlags msgFlags, VkDebugReportObjectTypeEXT objectType, - uint64_t srcObject, size_t location, int32_t msgCode, const char *pLayerPrefix, const char *format, - ...) { - if (!debug_data || !(debug_data->active_flags & msgFlags)) { +static inline bool log_msg(const debug_report_data *debug_data, VkFlags msg_flags, VkDebugReportObjectTypeEXT object_type, + uint64_t src_object, int32_t msg_code, const char *format, ...) { + VkFlags local_severity = 0; + VkFlags local_type = 0; + DebugReportFlagsToAnnotFlags(msg_flags, true, &local_severity, &local_type); + if (!debug_data || !(debug_data->active_severities & local_severity) || !(debug_data->active_types & local_type)) { + // Message is not wanted + return false; + } + + va_list argptr; + va_start(argptr, format); + char *str; + if (-1 == vasprintf(&str, format, argptr)) { + // On failure, glibc vasprintf leaves str undefined + str = nullptr; + } + va_end(argptr); + + std::string str_plus_spec_text(str); + + // If the msg_code is in the error map, tack on spec text to error message. + if (validation_error_map.find(msg_code) != validation_error_map.end()) { + str_plus_spec_text += " "; + str_plus_spec_text += validation_error_map[msg_code]; + } + + bool result = debug_log_msg(debug_data, msg_flags, object_type, src_object, 0, msg_code, "Validation", + str_plus_spec_text.c_str() ? str_plus_spec_text.c_str() : "Allocation failure"); + free(str); + return result; +} + +// Overload of log_msg that takes a VUID string in place of a numerical VUID abstraction +static inline bool log_msg(const debug_report_data *debug_data, VkFlags msg_flags, VkDebugReportObjectTypeEXT object_type, + uint64_t src_object, std::string vuid_text, const char *format, ...) { + VkFlags local_severity = 0; + VkFlags local_type = 0; + DebugReportFlagsToAnnotFlags(msg_flags, true, &local_severity, &local_type); + if (!debug_data || !(debug_data->active_severities & local_severity) || !(debug_data->active_types & local_type)) { // Message is not wanted return false; } @@ -363,37 +880,47 @@ str = nullptr; } va_end(argptr); - bool result = debug_report_log_msg(debug_data, msgFlags, objectType, srcObject, location, msgCode, pLayerPrefix, - str ? str : "Allocation failure"); + + std::string str_plus_spec_text(str); + + // If the msg_code is in the error map, get ID, look up spec text, and tack it onto error message. + if (validation_error_text_map.find(vuid_text.c_str()) != validation_error_text_map.end()) { + str_plus_spec_text += " "; + str_plus_spec_text += validation_error_map[validation_error_text_map[vuid_text.c_str()]]; + } + + // Append layer prefix with VUID string, pass in UNDEFINED for numerical VUID + static const int UNDEFINED_VUID = -1; + bool result = debug_log_msg(debug_data, msg_flags, object_type, src_object, 0, UNDEFINED_VUID, "Validation", + str_plus_spec_text.c_str() ? str_plus_spec_text.c_str() : "Allocation failure", vuid_text.c_str()); + free(str); return result; } -static inline VKAPI_ATTR VkBool32 VKAPI_CALL log_callback(VkFlags msgFlags, VkDebugReportObjectTypeEXT objType, uint64_t srcObject, - size_t location, int32_t msgCode, const char *pLayerPrefix, - const char *pMsg, void *pUserData) { - char msg_flags[30]; - - print_msg_flags(msgFlags, msg_flags); - - fprintf((FILE *)pUserData, "%s(%s): object: 0x%" PRIx64 " type: %d location: %lu msgCode: %d: %s\n", pLayerPrefix, msg_flags, - srcObject, objType, (unsigned long)location, msgCode, pMsg); - fflush((FILE *)pUserData); +static inline VKAPI_ATTR VkBool32 VKAPI_CALL report_log_callback(VkFlags msg_flags, VkDebugReportObjectTypeEXT obj_type, + uint64_t src_object, size_t location, int32_t msg_code, + const char *layer_prefix, const char *message, void *user_data) { + char msg_flag_string[30]; + + PrintMessageFlags(msg_flags, msg_flag_string); + + fprintf((FILE *)user_data, "%s(%s): msg_code: %d: %s\n", layer_prefix, msg_flag_string, msg_code, message); + fflush((FILE *)user_data); return false; } -static inline VKAPI_ATTR VkBool32 VKAPI_CALL win32_debug_output_msg(VkFlags msgFlags, VkDebugReportObjectTypeEXT objType, - uint64_t srcObject, size_t location, int32_t msgCode, - const char *pLayerPrefix, const char *pMsg, void *pUserData) { +static inline VKAPI_ATTR VkBool32 VKAPI_CALL report_win32_debug_output_msg(VkFlags msg_flags, VkDebugReportObjectTypeEXT obj_type, + uint64_t src_object, size_t location, int32_t msg_code, + const char *layer_prefix, const char *message, + void *user_data) { #ifdef WIN32 - char msg_flags[30]; + char msg_flag_string[30]; char buf[2048]; - print_msg_flags(msgFlags, msg_flags); - _snprintf(buf, sizeof(buf) - 1, - "%s (%s): object: 0x%" PRIxPTR " type: %d location: " PRINTF_SIZE_T_SPECIFIER " msgCode: %d: %s\n", pLayerPrefix, - msg_flags, (size_t)srcObject, objType, location, msgCode, pMsg); + PrintMessageFlags(msg_flags, msg_flag_string); + _snprintf(buf, sizeof(buf) - 1, "%s (%s): msg_code: %d: %s\n", layer_prefix, msg_flag_string, msg_code, message); OutputDebugString(buf); #endif @@ -401,9 +928,9 @@ return false; } -static inline VKAPI_ATTR VkBool32 VKAPI_CALL DebugBreakCallback(VkFlags msgFlags, VkDebugReportObjectTypeEXT objType, - uint64_t srcObject, size_t location, int32_t msgCode, - const char *pLayerPrefix, const char *pMsg, void *pUserData) { +static inline VKAPI_ATTR VkBool32 VKAPI_CALL DebugBreakCallback(VkFlags msgFlags, VkDebugReportObjectTypeEXT obj_type, + uint64_t src_object, size_t location, int32_t msg_code, + const char *layer_prefix, const char *message, void *user_data) { #ifdef WIN32 DebugBreak(); #else @@ -413,16 +940,194 @@ return false; } +static inline VKAPI_ATTR VkBool32 VKAPI_CALL messenger_log_callback(VkDebugUtilsMessageSeverityFlagBitsEXT message_severity, + VkDebugUtilsMessageTypeFlagsEXT message_type, + const VkDebugUtilsMessengerCallbackDataEXT *callback_data, + void *user_data) { + char msg_severity[30]; + char msg_type[30]; + + PrintMessageSeverity(message_severity, msg_severity); + PrintMessageType(message_type, msg_type); + + fprintf((FILE *)user_data, "%s(%s / %s): msgNum: %d - %s\n", callback_data->pMessageIdName, msg_severity, msg_type, + callback_data->messageIdNumber, callback_data->pMessage); + fprintf((FILE *)user_data, " Objects: %d\n", callback_data->objectCount); + for (uint32_t obj = 0; obj < callback_data->objectCount; ++obj) { + fprintf((FILE *)user_data, " [%d] 0x%" PRIx64 ", type: %d, name: %s\n", obj, + callback_data->pObjects[obj].objectHandle, callback_data->pObjects[obj].objectType, + callback_data->pObjects[obj].pObjectName); + } + fflush((FILE *)user_data); -// TODO: Could be autogenerated for the specific handles for extra type safety... -template -static inline uint64_t HandleToUint64(HANDLE_T *h) { - return reinterpret_cast(h); + return false; } -template -uint64_t HandleToUint64(HANDLE_T h); +static inline VKAPI_ATTR VkBool32 VKAPI_CALL messenger_win32_debug_output_msg( + VkDebugUtilsMessageSeverityFlagBitsEXT message_severity, VkDebugUtilsMessageTypeFlagsEXT message_type, + const VkDebugUtilsMessengerCallbackDataEXT *callback_data, void *user_data) { +#ifdef WIN32 + char buf[2048]; + char msg_severity[30]; + char msg_type[30]; -static inline uint64_t HandleToUint64(uint64_t h) { return h; } + PrintMessageSeverity(message_severity, msg_severity); + PrintMessageType(message_type, msg_type); + + size_t buffer_space = sizeof(buf) - 1; + size_t remaining_space = buffer_space; + _snprintf(buf, sizeof(buf) - 1, "%s(%s / %s): msgNum: %d - %s\n", callback_data->pMessageIdName, msg_severity, msg_type, + callback_data->messageIdNumber, callback_data->pMessage); + remaining_space = buffer_space - strlen(buf); + _snprintf(buf, remaining_space, " Objects: %d\n", callback_data->objectCount); + for (uint32_t obj = 0; obj < callback_data->objectCount; ++obj) { + remaining_space = buffer_space - strlen(buf); + if (remaining_space > 0) { + _snprintf(buf, remaining_space, " [%d] 0x%" PRIx64 ", type: %d, name: %s\n", obj, + callback_data->pObjects[obj].objectHandle, callback_data->pObjects[obj].objectType, + callback_data->pObjects[obj].pObjectName); + } + } + OutputDebugString(buf); +#endif + + return false; +} + +// This utility converts from the VkDebugUtilsLabelEXT structure into the logging version of the structure. +// In the logging version, we only record what we absolutely need to convey back to the callbacks. +static inline void InsertLabelIntoLog(const VkDebugUtilsLabelEXT *utils_label, std::vector &log_vector) { + LoggingLabelData log_label_data = {}; + log_label_data.name = utils_label->pLabelName; + log_label_data.color[0] = utils_label->color[0]; + log_label_data.color[1] = utils_label->color[1]; + log_label_data.color[2] = utils_label->color[2]; + log_label_data.color[3] = utils_label->color[3]; + log_vector.push_back(log_label_data); +} + +static inline void BeginQueueDebugUtilsLabel(debug_report_data *report_data, VkQueue queue, + const VkDebugUtilsLabelEXT *label_info) { + if (nullptr != label_info && nullptr != label_info->pLabelName) { + auto label_iter = report_data->debugUtilsQueueLabels->find(queue); + if (label_iter == report_data->debugUtilsQueueLabels->end()) { + std::vector new_queue_labels; + InsertLabelIntoLog(label_info, new_queue_labels); + report_data->debugUtilsQueueLabels->insert({queue, new_queue_labels}); + } else { + // If the last thing was a label insert, we need to pop it off of the label vector before any + // changes. This is because a label added with "vkQueueInsertDebugUtilsLabelEXT" is only a + // temporary location that exists until the next operation occurs. In this case, a new + // "vkQueueBeginDebugUtilsLabelEXT" has occurred erasing the previous inserted label. + if (report_data->queueLabelHasInsert) { + report_data->queueLabelHasInsert = false; + label_iter->second.pop_back(); + } + InsertLabelIntoLog(label_info, label_iter->second); + } + } +} + +static inline void EndQueueDebugUtilsLabel(debug_report_data *report_data, VkQueue queue) { + auto label_iter = report_data->debugUtilsQueueLabels->find(queue); + if (label_iter != report_data->debugUtilsQueueLabels->end()) { + // If the last thing was a label insert, we need to pop it off of the label vector before any + // changes. This is because a label added with "vkQueueInsertDebugUtilsLabelEXT" is only a + // temporary location that exists until the next operation occurs. In this case, a + // "vkQueueEndDebugUtilsLabelEXT" has occurred erasing the inserted label. + if (report_data->queueLabelHasInsert) { + report_data->queueLabelHasInsert = false; + label_iter->second.pop_back(); + } + // Now pop the normal item + label_iter->second.pop_back(); + } +} + +static inline void InsertQueueDebugUtilsLabel(debug_report_data *report_data, VkQueue queue, + const VkDebugUtilsLabelEXT *label_info) { + if (nullptr != label_info && nullptr != label_info->pLabelName) { + auto label_iter = report_data->debugUtilsQueueLabels->find(queue); + if (label_iter == report_data->debugUtilsQueueLabels->end()) { + std::vector new_queue_labels; + InsertLabelIntoLog(label_info, new_queue_labels); + report_data->debugUtilsQueueLabels->insert({queue, new_queue_labels}); + } else { + // If the last thing was a label insert, we need to pop it off of the label vector before any + // changes. This is because a label added with "vkQueueInsertDebugUtilsLabelEXT" is only a + // temporary location that exists until the next operation occurs. In this case, a new + // "vkQueueInsertDebugUtilsLabelEXT" has occurred erasing the previous inserted label. + if (report_data->queueLabelHasInsert) { + label_iter->second.pop_back(); + } + // Insert this new label and mark it as one that has been "inserted" so we can remove it on + // the next queue label operation. + InsertLabelIntoLog(label_info, label_iter->second); + report_data->queueLabelHasInsert = true; + } + } +} + +static inline void BeginCmdDebugUtilsLabel(debug_report_data *report_data, VkCommandBuffer command_buffer, + const VkDebugUtilsLabelEXT *label_info) { + if (nullptr != label_info && nullptr != label_info->pLabelName) { + auto label_iter = report_data->debugUtilsCmdBufLabels->find(command_buffer); + if (label_iter == report_data->debugUtilsCmdBufLabels->end()) { + std::vector new_cmdbuf_labels; + InsertLabelIntoLog(label_info, new_cmdbuf_labels); + report_data->debugUtilsCmdBufLabels->insert({command_buffer, new_cmdbuf_labels}); + } else { + // If the last thing was a label insert, we need to pop it off of the label vector before any + // changes. This is because a label added with "vkCmdInsertDebugUtilsLabelEXT" is only a + // temporary location that exists until the next operation occurs. In this case, a + // "vkCmdBeginDebugUtilsLabelEXT" has occurred erasing the inserted label. + if (report_data->cmdBufLabelHasInsert) { + report_data->cmdBufLabelHasInsert = false; + label_iter->second.pop_back(); + } + InsertLabelIntoLog(label_info, label_iter->second); + } + } +} + +static inline void EndCmdDebugUtilsLabel(debug_report_data *report_data, VkCommandBuffer command_buffer) { + auto label_iter = report_data->debugUtilsCmdBufLabels->find(command_buffer); + if (label_iter != report_data->debugUtilsCmdBufLabels->end()) { + // If the last thing was a label insert, we need to pop it off of the label vector before any + // changes. This is because a label added with "vkCmdInsertDebugUtilsLabelEXT" is only a + // temporary location that exists until the next operation occurs. In this case, a + // "vkCmdEndDebugUtilsLabelEXT" has occurred erasing the inserted label. + if (report_data->cmdBufLabelHasInsert) { + report_data->cmdBufLabelHasInsert = false; + label_iter->second.pop_back(); + } + // Now pop the normal item + label_iter->second.pop_back(); + } +} + +static inline void InsertCmdDebugUtilsLabel(debug_report_data *report_data, VkCommandBuffer command_buffer, + const VkDebugUtilsLabelEXT *label_info) { + if (nullptr != label_info && nullptr != label_info->pLabelName) { + auto label_iter = report_data->debugUtilsCmdBufLabels->find(command_buffer); + if (label_iter == report_data->debugUtilsCmdBufLabels->end()) { + std::vector new_cmdbuf_labels; + InsertLabelIntoLog(label_info, new_cmdbuf_labels); + report_data->debugUtilsCmdBufLabels->insert({command_buffer, new_cmdbuf_labels}); + } else { + // If the last thing was a label insert, we need to pop it off of the label vector before any + // changes. This is because a label added with "vkCmdInsertDebugUtilsLabelEXT" is only a + // temporary location that exists until the next operation occurs. In this case, a new + // "vkCmdInsertDebugUtilsLabelEXT" has occurred erasing the previous inserted label. + if (report_data->cmdBufLabelHasInsert) { + label_iter->second.pop_back(); + } + // Insert this new label and mark it as one that has been "inserted" so we can remove it on + // the next command buffer label operation. + InsertLabelIntoLog(label_info, label_iter->second); + report_data->cmdBufLabelHasInsert = true; + } + } +} #endif // LAYER_LOGGING_H diff -Nru vulkan-1.0.65.2+dfsg1/layers/vk_layer_utils.cpp vulkan-1.1.73+dfsg/layers/vk_layer_utils.cpp --- vulkan-1.0.65.2+dfsg1/layers/vk_layer_utils.cpp 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/vk_layer_utils.cpp 2018-03-14 09:08:48.000000000 +0000 @@ -91,8 +91,9 @@ // If a vk_layer_settings.txt file is present and an application defines a debug callback, both callbacks // will be active. If no vk_layer_settings.txt file is present, creating an application-defined debug // callback will cause the default callbacks to be unregisterd and removed. -VK_LAYER_EXPORT void layer_debug_actions(debug_report_data *report_data, std::vector &logging_callback, - const VkAllocationCallbacks *pAllocator, const char *layer_identifier) { +VK_LAYER_EXPORT void layer_debug_report_actions(debug_report_data *report_data, + std::vector &logging_callback, + const VkAllocationCallbacks *pAllocator, const char *layer_identifier) { VkDebugReportCallbackEXT callback = VK_NULL_HANDLE; std::string report_flags_key = layer_identifier; @@ -115,9 +116,9 @@ memset(&dbgCreateInfo, 0, sizeof(dbgCreateInfo)); dbgCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT; dbgCreateInfo.flags = report_flags; - dbgCreateInfo.pfnCallback = log_callback; + dbgCreateInfo.pfnCallback = report_log_callback; dbgCreateInfo.pUserData = (void *)log_output; - layer_create_msg_callback(report_data, default_layer_callback, &dbgCreateInfo, pAllocator, &callback); + layer_create_report_callback(report_data, default_layer_callback, &dbgCreateInfo, pAllocator, &callback); logging_callback.push_back(callback); } @@ -128,9 +129,9 @@ memset(&dbgCreateInfo, 0, sizeof(dbgCreateInfo)); dbgCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT; dbgCreateInfo.flags = report_flags; - dbgCreateInfo.pfnCallback = win32_debug_output_msg; + dbgCreateInfo.pfnCallback = report_win32_debug_output_msg; dbgCreateInfo.pUserData = NULL; - layer_create_msg_callback(report_data, default_layer_callback, &dbgCreateInfo, pAllocator, &callback); + layer_create_report_callback(report_data, default_layer_callback, &dbgCreateInfo, pAllocator, &callback); logging_callback.push_back(callback); } @@ -143,8 +144,64 @@ dbgCreateInfo.flags = report_flags; dbgCreateInfo.pfnCallback = DebugBreakCallback; dbgCreateInfo.pUserData = NULL; - layer_create_msg_callback(report_data, default_layer_callback, &dbgCreateInfo, pAllocator, &callback); + layer_create_report_callback(report_data, default_layer_callback, &dbgCreateInfo, pAllocator, &callback); logging_callback.push_back(callback); } +} + +VK_LAYER_EXPORT void layer_debug_messenger_actions(debug_report_data *report_data, + std::vector &logging_messenger, + const VkAllocationCallbacks *pAllocator, const char *layer_identifier) { + VkDebugUtilsMessengerEXT messenger = VK_NULL_HANDLE; + + std::string report_flags_key = layer_identifier; + std::string debug_action_key = layer_identifier; + std::string log_filename_key = layer_identifier; + report_flags_key.append(".report_flags"); + debug_action_key.append(".debug_action"); + log_filename_key.append(".log_filename"); + + // Initialize layer options + VkDebugReportFlagsEXT report_flags = GetLayerOptionFlags(report_flags_key, report_flags_option_definitions, 0); + VkLayerDbgActionFlags debug_action = GetLayerOptionFlags(debug_action_key, debug_actions_option_definitions, 0); + // Flag as default if these settings are not from a vk_layer_settings.txt file + bool default_layer_callback = (debug_action & VK_DBG_LAYER_ACTION_DEFAULT) ? true : false; + VkDebugUtilsMessengerCreateInfoEXT dbgCreateInfo; + memset(&dbgCreateInfo, 0, sizeof(dbgCreateInfo)); + dbgCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT; + dbgCreateInfo.messageType = VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT; + if (report_flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) { + dbgCreateInfo.messageSeverity |= VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT; + } + if (report_flags & VK_DEBUG_REPORT_WARNING_BIT_EXT) { + dbgCreateInfo.messageSeverity |= VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT; + } + if (report_flags & VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT) { + dbgCreateInfo.messageSeverity |= VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT; + dbgCreateInfo.messageType |= VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT; + } + if (report_flags & VK_DEBUG_REPORT_INFORMATION_BIT_EXT) { + dbgCreateInfo.messageSeverity |= VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT; + } + if (report_flags & VK_DEBUG_REPORT_DEBUG_BIT_EXT) { + dbgCreateInfo.messageSeverity |= VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT; + } + if (debug_action & VK_DBG_LAYER_ACTION_LOG_MSG) { + const char *log_filename = getLayerOption(log_filename_key.c_str()); + FILE *log_output = getLayerLogOutput(log_filename, layer_identifier); + dbgCreateInfo.pfnUserCallback = messenger_log_callback; + dbgCreateInfo.pUserData = (void *)log_output; + layer_create_messenger_callback(report_data, default_layer_callback, &dbgCreateInfo, pAllocator, &messenger); + logging_messenger.push_back(messenger); + } + + messenger = VK_NULL_HANDLE; + + if (debug_action & VK_DBG_LAYER_ACTION_DEBUG_OUTPUT) { + dbgCreateInfo.pfnUserCallback = messenger_win32_debug_output_msg; + dbgCreateInfo.pUserData = NULL; + layer_create_messenger_callback(report_data, default_layer_callback, &dbgCreateInfo, pAllocator, &messenger); + logging_messenger.push_back(messenger); + } } diff -Nru vulkan-1.0.65.2+dfsg1/layers/vk_layer_utils.h vulkan-1.1.73+dfsg/layers/vk_layer_utils.h --- vulkan-1.0.65.2+dfsg1/layers/vk_layer_utils.h 2017-07-03 07:19:24.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/vk_layer_utils.h 2018-03-14 09:08:48.000000000 +0000 @@ -44,8 +44,13 @@ } VkStringErrorFlagBits; typedef VkFlags VkStringErrorFlags; -VK_LAYER_EXPORT void layer_debug_actions(debug_report_data *report_data, std::vector &logging_callback, - const VkAllocationCallbacks *pAllocator, const char *layer_identifier); +VK_LAYER_EXPORT void layer_debug_report_actions(debug_report_data *report_data, + std::vector &logging_callback, + const VkAllocationCallbacks *pAllocator, const char *layer_identifier); + +VK_LAYER_EXPORT void layer_debug_messenger_actions(debug_report_data *report_data, + std::vector &logging_messenger, + const VkAllocationCallbacks *pAllocator, const char *layer_identifier); VK_LAYER_EXPORT VkStringErrorFlags vk_string_validate(const int max_length, const char *char_array); VK_LAYER_EXPORT bool white_list(const char *item, const char *whitelist); diff -Nru vulkan-1.0.65.2+dfsg1/layers/vk_validation_error_database.txt vulkan-1.1.73+dfsg/layers/vk_validation_error_database.txt --- vulkan-1.0.65.2+dfsg1/layers/vk_validation_error_database.txt 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/vk_validation_error_database.txt 2018-04-27 11:24:19.000000000 +0000 @@ -10,583 +10,567 @@ # core|ext: Either 'core' for core spec or some extension string that indicates the extension required for this VU to be relevant # errormsg: The unique error message for this check that includes spec language and link # note: Free txt field with any custom notes related to the check in question -VALIDATION_ERROR_00000009~^~Y~^~None~^~VkAcquireNextImageInfoKHX~^~VUID-VkAcquireNextImageInfoKHX-commonparent~^~core~^~The spec valid usage text states 'Each of fence, semaphore, and swapchain that are valid handles must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-commonparent)~^~implicit -VALIDATION_ERROR_00000a10~^~N~^~Unknown~^~vkAcquireNextImage2KHX~^~VUID-VkAcquireNextImageInfoKHX-semaphore-01288~^~core~^~The spec valid usage text states 'If semaphore is not VK_NULL_HANDLE it must be unsignaled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-semaphore-01288)~^~ -VALIDATION_ERROR_00000a12~^~N~^~Unknown~^~vkAcquireNextImage2KHX~^~VUID-VkAcquireNextImageInfoKHX-fence-01289~^~core~^~The spec valid usage text states 'If fence is not VK_NULL_HANDLE it must be unsignaled and must not be associated with any other queue command that has not yet completed execution on that queue' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-fence-01289)~^~ -VALIDATION_ERROR_00000a14~^~N~^~Unknown~^~vkAcquireNextImage2KHX~^~VUID-VkAcquireNextImageInfoKHX-deviceMask-01290~^~core~^~The spec valid usage text states 'deviceMask must be a valid device mask' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-deviceMask-01290)~^~ -VALIDATION_ERROR_00000a16~^~N~^~Unknown~^~vkAcquireNextImage2KHX~^~VUID-VkAcquireNextImageInfoKHX-deviceMask-01291~^~core~^~The spec valid usage text states 'deviceMask must not be zero' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-deviceMask-01291)~^~ -VALIDATION_ERROR_00000d16~^~N~^~None~^~VkAcquireNextImageInfoKHX~^~VUID-VkAcquireNextImageInfoKHX-swapchain-01675~^~core~^~The spec valid usage text states 'swapchain must not be in the retired state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-swapchain-01675)~^~ -VALIDATION_ERROR_00008801~^~Y~^~Unknown~^~vkAcquireNextImage2KHX~^~VUID-VkAcquireNextImageInfoKHX-fence-parameter~^~core~^~The spec valid usage text states 'If fence is not VK_NULL_HANDLE, fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-fence-parameter)~^~implicit -VALIDATION_ERROR_0001c40d~^~Y~^~Unknown~^~vkAcquireNextImage2KHX~^~VUID-VkAcquireNextImageInfoKHX-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-pNext-pNext)~^~implicit -VALIDATION_ERROR_0002b00b~^~Y~^~Unknown~^~vkAcquireNextImage2KHX~^~VUID-VkAcquireNextImageInfoKHX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-sType-sType)~^~implicit -VALIDATION_ERROR_0002b801~^~Y~^~Unknown~^~vkAcquireNextImage2KHX~^~VUID-VkAcquireNextImageInfoKHX-semaphore-parameter~^~core~^~The spec valid usage text states 'If semaphore is not VK_NULL_HANDLE, semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-semaphore-parameter)~^~implicit -VALIDATION_ERROR_0002f001~^~Y~^~Unknown~^~vkAcquireNextImage2KHX~^~VUID-VkAcquireNextImageInfoKHX-swapchain-parameter~^~core~^~The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-swapchain-parameter)~^~implicit -VALIDATION_ERROR_002004f0~^~Y~^~Unknown~^~vkCmdBindPipeline~^~VUID-VkAllocationCallbacks-pfnAllocation-00632~^~core~^~The spec valid usage text states 'pfnAllocation must be a valid pointer to a valid user-defined PFN_vkAllocationFunction' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnAllocation-00632)~^~ -VALIDATION_ERROR_002004f2~^~Y~^~Unknown~^~vkCmdBindPipeline~^~VUID-VkAllocationCallbacks-pfnReallocation-00633~^~core~^~The spec valid usage text states 'pfnReallocation must be a valid pointer to a valid user-defined PFN_vkReallocationFunction' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnReallocation-00633)~^~ -VALIDATION_ERROR_002004f4~^~Y~^~Unknown~^~vkCmdBindPipeline~^~VUID-VkAllocationCallbacks-pfnFree-00634~^~core~^~The spec valid usage text states 'pfnFree must be a valid pointer to a valid user-defined PFN_vkFreeFunction' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnFree-00634)~^~ -VALIDATION_ERROR_002004f6~^~N~^~Unknown~^~vkCmdBindPipeline~^~VUID-VkAllocationCallbacks-pfnInternalAllocation-00635~^~core~^~The spec valid usage text states 'If either of pfnInternalAllocation or pfnInternalFree is not NULL, both must be valid callbacks' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnInternalAllocation-00635)~^~ -VALIDATION_ERROR_004009c0~^~N~^~Unknown~^~vkCreateAndroidSurfaceKHR~^~VUID-VkAndroidSurfaceCreateInfoKHR-window-01248~^~core~^~The spec valid usage text states 'window must point to a valid Android ANativeWindow.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAndroidSurfaceCreateInfoKHR-window-01248)~^~TBD in parameter validation layer. -VALIDATION_ERROR_00409005~^~Y~^~Unknown~^~vkCreateAndroidSurfaceKHR~^~VUID-VkAndroidSurfaceCreateInfoKHR-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAndroidSurfaceCreateInfoKHR-flags-zerobitmask)~^~implicit -VALIDATION_ERROR_0041c40d~^~Y~^~Unknown~^~vkCreateAndroidSurfaceKHR~^~VUID-VkAndroidSurfaceCreateInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAndroidSurfaceCreateInfoKHR-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0042b00b~^~Y~^~Unknown~^~vkCreateAndroidSurfaceKHR~^~VUID-VkAndroidSurfaceCreateInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAndroidSurfaceCreateInfoKHR-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0060f001~^~N~^~Unknown~^~vkCreateInstance~^~VUID-VkApplicationInfo-pApplicationName-parameter~^~core~^~The spec valid usage text states 'If pApplicationName is not NULL, pApplicationName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkApplicationInfo-pApplicationName-parameter)~^~implicit -VALIDATION_ERROR_00615c01~^~N~^~Unknown~^~vkCreateInstance~^~VUID-VkApplicationInfo-pEngineName-parameter~^~core~^~The spec valid usage text states 'If pEngineName is not NULL, pEngineName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkApplicationInfo-pEngineName-parameter)~^~implicit -VALIDATION_ERROR_0061c40d~^~Y~^~Unknown~^~vkCreateInstance~^~VUID-VkApplicationInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkApplicationInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0062b00b~^~Y~^~Unknown~^~vkCreateInstance~^~VUID-VkApplicationInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_APPLICATION_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkApplicationInfo-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_00800696~^~Y~^~AttachmentDescriptionInvalidFinalLayout~^~vkCreateRenderPass~^~VUID-VkAttachmentDescription-finalLayout-00843~^~core~^~The spec valid usage text states 'finalLayout must not be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-finalLayout-00843)~^~ -VALIDATION_ERROR_00808e01~^~Y~^~Unknown~^~vkCreateRenderPass~^~VUID-VkAttachmentDescription-finalLayout-parameter~^~core~^~The spec valid usage text states 'finalLayout must be a valid VkImageLayout value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-finalLayout-parameter)~^~implicit -VALIDATION_ERROR_00809001~^~Y~^~Unknown~^~vkCreateRenderPass~^~VUID-VkAttachmentDescription-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkAttachmentDescriptionFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-flags-parameter)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_00809201~^~Y~^~Unknown~^~vkCreateRenderPass~^~VUID-VkAttachmentDescription-format-parameter~^~core~^~The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-format-parameter)~^~implicit -VALIDATION_ERROR_0080b801~^~Y~^~Unknown~^~vkCreateRenderPass~^~VUID-VkAttachmentDescription-initialLayout-parameter~^~core~^~The spec valid usage text states 'initialLayout must be a valid VkImageLayout value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-initialLayout-parameter)~^~implicit -VALIDATION_ERROR_0080c201~^~Y~^~Unknown~^~vkCreateRenderPass~^~VUID-VkAttachmentDescription-loadOp-parameter~^~core~^~The spec valid usage text states 'loadOp must be a valid VkAttachmentLoadOp value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-loadOp-parameter)~^~implicit -VALIDATION_ERROR_0082b401~^~Y~^~CreateRenderPassAttachments~^~vkCreateRenderPass~^~VUID-VkAttachmentDescription-samples-parameter~^~core~^~The spec valid usage text states 'samples must be a valid VkSampleCountFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-samples-parameter)~^~implicit -VALIDATION_ERROR_0082e001~^~Y~^~Unknown~^~vkCreateRenderPass~^~VUID-VkAttachmentDescription-stencilLoadOp-parameter~^~core~^~The spec valid usage text states 'stencilLoadOp must be a valid VkAttachmentLoadOp value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-stencilLoadOp-parameter)~^~implicit -VALIDATION_ERROR_0082e201~^~Y~^~Unknown~^~vkCreateRenderPass~^~VUID-VkAttachmentDescription-stencilStoreOp-parameter~^~core~^~The spec valid usage text states 'stencilStoreOp must be a valid VkAttachmentStoreOp value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-stencilStoreOp-parameter)~^~implicit -VALIDATION_ERROR_0082e401~^~Y~^~Unknown~^~vkCreateRenderPass~^~VUID-VkAttachmentDescription-storeOp-parameter~^~core~^~The spec valid usage text states 'storeOp must be a valid VkAttachmentStoreOp value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-storeOp-parameter)~^~implicit -VALIDATION_ERROR_00a006b2~^~N~^~Unknown~^~vkCreateRenderPass~^~VUID-VkAttachmentReference-layout-00857~^~core~^~The spec valid usage text states 'layout must not be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentReference-layout-00857)~^~ -VALIDATION_ERROR_00a0be01~^~Y~^~Unknown~^~vkCreateRenderPass~^~VUID-VkAttachmentReference-layout-parameter~^~core~^~The spec valid usage text states 'layout must be a valid VkImageLayout value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentReference-layout-parameter)~^~implicit -VALIDATION_ERROR_00c00009~^~Y~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-commonparent~^~core~^~The spec valid usage text states 'Both of buffer, and memory must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-commonparent)~^~implicit -VALIDATION_ERROR_00c00820~^~N~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-None-01040~^~core~^~The spec valid usage text states 'All valid usage rules from vkBindBufferMemory apply to the identically named members of VkBindBufferMemoryInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-None-01040)~^~ -VALIDATION_ERROR_00c00822~^~N~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-deviceIndexCount-01041~^~core~^~The spec valid usage text states 'deviceIndexCount must either be zero or equal to the number of physical devices in the logical device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-deviceIndexCount-01041)~^~ -VALIDATION_ERROR_00c00824~^~N~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-pDeviceIndices-01042~^~core~^~The spec valid usage text states 'All elements of pDeviceIndices must be valid device indices' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-pDeviceIndices-01042)~^~ -VALIDATION_ERROR_00c00826~^~N~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-None-01043~^~core~^~The spec valid usage text states 'All instances of memory that are bound to must have been allocated' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-None-01043)~^~ -VALIDATION_ERROR_00c00c72~^~N~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-buffer-01593~^~core~^~The spec valid usage text states 'buffer must not already be backed by a memory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-buffer-01593)~^~ -VALIDATION_ERROR_00c00c74~^~N~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-buffer-01594~^~core~^~The spec valid usage text states 'buffer must not have been created with any sparse memory binding flags' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-buffer-01594)~^~ -VALIDATION_ERROR_00c00c76~^~N~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-memoryOffset-01595~^~core~^~The spec valid usage text states 'memoryOffset must be less than the size of memory' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-memoryOffset-01595)~^~ -VALIDATION_ERROR_00c00c78~^~N~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-buffer-01596~^~core~^~The spec valid usage text states 'If buffer was created with the VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT or VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minTexelBufferOffsetAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-buffer-01596)~^~ -VALIDATION_ERROR_00c00c7a~^~N~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-buffer-01597~^~core~^~The spec valid usage text states 'If buffer was created with the VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minUniformBufferOffsetAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-buffer-01597)~^~ -VALIDATION_ERROR_00c00c7c~^~N~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-buffer-01598~^~core~^~The spec valid usage text states 'If buffer was created with the VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minStorageBufferOffsetAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-buffer-01598)~^~ -VALIDATION_ERROR_00c00c7e~^~N~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-memory-01599~^~core~^~The spec valid usage text states 'memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-memory-01599)~^~ -VALIDATION_ERROR_00c00c80~^~N~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-memoryOffset-01600~^~core~^~The spec valid usage text states 'memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-memoryOffset-01600)~^~ -VALIDATION_ERROR_00c00c82~^~N~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-size-01601~^~core~^~The spec valid usage text states 'The size member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer must be less than or equal to the size of memory minus memoryOffset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-size-01601)~^~ -VALIDATION_ERROR_00c00c84~^~N~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-buffer-01602~^~(VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If buffer requires a dedicated allocation(as reported by vkGetBufferMemoryRequirements2KHR in VkMemoryDedicatedRequirementsKHR::requiresDedicatedAllocation for image), memory must have been created with VkMemoryDedicatedAllocateInfoKHR::buffer equal to buffer and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-buffer-01602)~^~ -VALIDATION_ERROR_00c00c86~^~N~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-buffer-01603~^~(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'If buffer was created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must have been created with VkDedicatedAllocationMemoryAllocateInfoNV::buffer equal to buffer and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-buffer-01603)~^~ -VALIDATION_ERROR_00c00c88~^~N~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-buffer-01604~^~(VK_NV_dedicated_allocation)+!(VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If buffer was not created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must not have been allocated dedicated for a specific buffer or image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-buffer-01604)~^~ -VALIDATION_ERROR_00c00c8a~^~N~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-pNext-01605~^~(VK_KHX_device_group)~^~The spec valid usage text states 'If the pNext chain includes VkBindBufferMemoryDeviceGroupInfoKHX, all instances of memory specified by VkBindBufferMemoryDeviceGroupInfoKHX::pDeviceIndices must have been allocated' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-pNext-01605)~^~ -VALIDATION_ERROR_00c01a01~^~Y~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-buffer-parameter~^~core~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-buffer-parameter)~^~implicit -VALIDATION_ERROR_00c0c601~^~Y~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-memory-parameter~^~core~^~The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-memory-parameter)~^~implicit -VALIDATION_ERROR_00c13e01~^~N~^~Unknown~^~vkBindBufferMemory2KHR~^~VUID-VkBindBufferMemoryInfoKHR-pDeviceIndices-parameter~^~core~^~The spec valid usage text states 'If deviceIndexCount is not 0, pDeviceIndices must be a pointer to an array of deviceIndexCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-pDeviceIndices-parameter)~^~implicit -VALIDATION_ERROR_00c1c40d~^~Y~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkBindBufferMemoryDeviceGroupInfoKHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_00c2b00b~^~N~^~None~^~VkBindBufferMemoryInfoKHR~^~VUID-VkBindBufferMemoryInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_00e00009~^~Y~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-commonparent~^~core~^~The spec valid usage text states 'Both of image, and memory that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-commonparent)~^~implicit -VALIDATION_ERROR_00e00838~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-None-01052~^~core~^~The spec valid usage text states 'All valid usage rules from vkBindImageMemory apply to the identically named members of VkBindImageMemoryInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-None-01052)~^~ -VALIDATION_ERROR_00e0083a~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-deviceIndexCount-01053~^~core~^~The spec valid usage text states 'At least one of deviceIndexCount and SFRRectCount must be zero.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-deviceIndexCount-01053)~^~ -VALIDATION_ERROR_00e0083c~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-deviceIndexCount-01054~^~core~^~The spec valid usage text states 'deviceIndexCount must either be zero or equal to the number of physical devices in the logical device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-deviceIndexCount-01054)~^~ -VALIDATION_ERROR_00e0083e~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-pDeviceIndices-01055~^~core~^~The spec valid usage text states 'All elements of pDeviceIndices must be valid device indices.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pDeviceIndices-01055)~^~ -VALIDATION_ERROR_00e00840~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-SFRRectCount-01056~^~core~^~The spec valid usage text states 'SFRRectCount must either be zero or equal to the number of physical devices in the logical device squared' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-SFRRectCount-01056)~^~ -VALIDATION_ERROR_00e00842~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-SFRRectCount-01057~^~core~^~The spec valid usage text states 'If SFRRectCount is not zero, then image must have been created with the VK_IMAGE_CREATE_BIND_SFR_BIT_KHX bit set.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-SFRRectCount-01057)~^~ -VALIDATION_ERROR_00e00844~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-pSFRRects-01058~^~core~^~The spec valid usage text states 'All elements of pSFRRects must be valid rectangles contained within the dimensions of the image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pSFRRects-01058)~^~ -VALIDATION_ERROR_00e00846~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-pSFRRects-01059~^~core~^~The spec valid usage text states 'Elements of pSFRRects that correspond to the same instance of the image must not overlap and their union must cover the entire image.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pSFRRects-01059)~^~ -VALIDATION_ERROR_00e0084a~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-offset-01061~^~core~^~The spec valid usage text states 'For each element of pSFRRects, offset.x must be a multiple of the sparse image block width (VkSparseImageFormatProperties::imageGranularity.width) of all non-metadata aspects of the image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-offset-01061)~^~ -VALIDATION_ERROR_00e0084c~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-extent-01062~^~core~^~The spec valid usage text states 'For each element of pSFRRects, extent.width must either be a multiple of the sparse image block width of all non-metadata aspects of the image, or else (extent.width + offset.x) must equal the width of the image subresource' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-extent-01062)~^~ -VALIDATION_ERROR_00e0084e~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-offset-01063~^~core~^~The spec valid usage text states 'For each element of pSFRRects, offset.y must be a multiple of the sparse image block height (VkSparseImageFormatProperties::imageGranularity.height) of all non-metadata aspects of the image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-offset-01063)~^~ -VALIDATION_ERROR_00e00850~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-extent-01064~^~core~^~The spec valid usage text states 'For each element of pSFRRects, extent.height must either be a multiple of the sparse image block height of all non-metadata aspects of the image, or else (extent.height + offset.y) must equal the height of the image subresource' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-extent-01064)~^~ -VALIDATION_ERROR_00e00852~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-None-01065~^~core~^~The spec valid usage text states 'All instances of memory that are bound must have been allocated' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-None-01065)~^~ -VALIDATION_ERROR_00e00854~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-image-01066~^~core~^~The spec valid usage text states 'If image was created with a valid swapchain handle in VkImageSwapchainCreateInfoKHX::swapchain, then the image must be bound to memory from that swapchain (using VkBindImageMemorySwapchainInfoKHX).' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-image-01066)~^~ -VALIDATION_ERROR_00e00c92~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-image-01609~^~core~^~The spec valid usage text states 'image must not already be backed by a memory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-image-01609)~^~ -VALIDATION_ERROR_00e00c94~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-image-01610~^~core~^~The spec valid usage text states 'image must not have been created with any sparse memory binding flags' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-image-01610)~^~ -VALIDATION_ERROR_00e00c96~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-memoryOffset-01611~^~core~^~The spec valid usage text states 'memoryOffset must be less than the size of memory' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-memoryOffset-01611)~^~ -VALIDATION_ERROR_00e00c98~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-memory-01612~^~!(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-memory-01612)~^~ -VALIDATION_ERROR_00e00c9a~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-memoryOffset-01613~^~!(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-memoryOffset-01613)~^~ -VALIDATION_ERROR_00e00c9c~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-memory-01614~^~!(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'The difference of the size of memory and memoryOffset must be greater than or equal to the size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with the same image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-memory-01614)~^~ -VALIDATION_ERROR_00e00c9e~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-pNext-01615~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the pNext chain does not include an instance of the VkBindImagePlaneMemoryInfoKHR structure, memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2KHR with image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01615)~^~ -VALIDATION_ERROR_00e00ca0~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-pNext-01616~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the pNext chain does not include an instance of the VkBindImagePlaneMemoryInfoKHR structure, memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2KHR with image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01616)~^~ -VALIDATION_ERROR_00e00ca2~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-pNext-01617~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the pNext chain does not include an instance of the VkBindImagePlaneMemoryInfoKHR structure, the difference of the size of memory and memoryOffset must be greater than or equal to the size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2KHR with the same image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01617)~^~ -VALIDATION_ERROR_00e00ca4~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-pNext-01618~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfoKHR structure, image must have been created with the VK_IMAGE_CREATE_DISJOINT_BIT_KHR bit set.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01618)~^~ -VALIDATION_ERROR_00e00ca6~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-pNext-01619~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfoKHR structure, memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2KHR with image and the correct planeAspect for this plane in the VkImagePlaneMemoryRequirementsInfoKHR structure attached to the VkImageMemoryRequirementsInfo2KHR's pNext chain' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01619)~^~ -VALIDATION_ERROR_00e00ca8~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-pNext-01620~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfoKHR structure, memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2KHR with image and the correct planeAspect for this plane in the VkImagePlaneMemoryRequirementsInfoKHR structure attached to the VkImageMemoryRequirementsInfo2KHR's pNext chain' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01620)~^~ -VALIDATION_ERROR_00e00caa~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-pNext-01621~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfoKHR structure, the difference of the size of memory and memoryOffset must be greater than or equal to the size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2KHR with the same image and the correct planeAspect for this plane in the VkImagePlaneMemoryRequirementsInfoKHR structure attached to the VkImageMemoryRequirementsInfo2KHR's pNext chain' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01621)~^~ -VALIDATION_ERROR_00e00cac~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-image-01622~^~(VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If image requires a dedicated allocation (as reported by vkGetImageMemoryRequirements2KHR in VkMemoryDedicatedRequirementsKHR::requiresDedicatedAllocation for image), memory must have been created with VkMemoryDedicatedAllocateInfoKHR::image equal to image and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-image-01622)~^~ -VALIDATION_ERROR_00e00cae~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-image-01623~^~(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'If image was created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must have been created with VkDedicatedAllocationMemoryAllocateInfoNV::image equal to image and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-image-01623)~^~ -VALIDATION_ERROR_00e00cb0~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-image-01624~^~(VK_NV_dedicated_allocation)+!(VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If image was not created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must not have been allocated dedicated for a specific buffer or image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-image-01624)~^~ -VALIDATION_ERROR_00e00cb2~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-memory-01625~^~!(VK_KHX_device_group)~^~The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-memory-01625)~^~ -VALIDATION_ERROR_00e00cb4~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-pNext-01626~^~(VK_KHX_device_group)~^~The spec valid usage text states 'If the pNext chain includes VkBindImageMemoryDeviceGroupInfoKHX, all instances of memory specified by VkBindImageMemoryDeviceGroupInfoKHX::pDeviceIndices must have been allocated' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01626)~^~ -VALIDATION_ERROR_00e00cb6~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-pNext-01627~^~(VK_KHX_device_group)~^~The spec valid usage text states 'If the pNext chain includes VkBindImageMemoryDeviceGroupInfoKHX, and VkBindImageMemoryDeviceGroupInfoKHX::SFRRectCount is not zero, then image must have been created with the VK_IMAGE_CREATE_BIND_SFR_BIT_KHX bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01627)~^~ -VALIDATION_ERROR_00e00cb8~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-pNext-01628~^~(VK_KHX_device_group)~^~The spec valid usage text states 'If the pNext chain includes VkBindImageMemoryDeviceGroupInfoKHX, all elements of VkBindImageMemoryDeviceGroupInfoKHX::pSFRRects must be valid rectangles contained within the dimensions of image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01628)~^~ -VALIDATION_ERROR_00e00cba~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-pNext-01629~^~(VK_KHX_device_group)~^~The spec valid usage text states 'If the pNext chain includes VkBindImageMemoryDeviceGroupInfoKHX, the union of the areas of all elements of VkBindImageMemoryDeviceGroupInfoKHX::pSFRRects that correspond to the same instance of pname: image must cover the entire image.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01629)~^~ -VALIDATION_ERROR_00e00cbc~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-image-01630~^~(VK_KHX_device_group)~^~The spec valid usage text states 'If image was created with a valid swapchain handle in VkImageSwapchainCreateInfoKHX::swapchain, then the pNext chain must include a valid instance of VkBindImageMemorySwapchainInfoKHX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-image-01630)~^~ -VALIDATION_ERROR_00e00cbe~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-pNext-01631~^~(VK_KHX_device_group)~^~The spec valid usage text states 'If the pNext chain includes an instance of VkBindImageMemorySwapchainInfoKHX, memory must be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01631)~^~ -VALIDATION_ERROR_00e00cc0~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-pNext-01632~^~(VK_KHX_device_group)~^~The spec valid usage text states 'If the pNext chain does not include an instance of VkBindImageMemorySwapchainInfoKHX, memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01632)~^~ -VALIDATION_ERROR_00e0a001~^~Y~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-image-parameter~^~core~^~The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-image-parameter)~^~implicit -VALIDATION_ERROR_00e0c601~^~Y~^~Unknown~^~vkBindImageMemory2KHR~^~VUID-VkBindImageMemoryInfoKHR-memory-parameter~^~core~^~The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-memory-parameter)~^~implicit -VALIDATION_ERROR_00e13e01~^~N~^~Unknown~^~vkBindImageMemory2KHR~^~VUID-VkBindImageMemoryInfoKHR-pDeviceIndices-parameter~^~core~^~The spec valid usage text states 'If deviceIndexCount is not 0, pDeviceIndices must be a pointer to an array of deviceIndexCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pDeviceIndices-parameter)~^~implicit -VALIDATION_ERROR_00e1c40d~^~Y~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkBindImageMemoryDeviceGroupInfoKHX, VkBindImageMemorySwapchainInfoKHX, or VkBindImagePlaneMemoryInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_00e22001~^~N~^~Unknown~^~vkBindImageMemory2KHR~^~VUID-VkBindImageMemoryInfoKHR-pSFRRects-parameter~^~core~^~The spec valid usage text states 'If SFRRectCount is not 0, pSFRRects must be a pointer to an array of SFRRectCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pSFRRects-parameter)~^~implicit -VALIDATION_ERROR_00e2b00b~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_00e2b00f~^~N~^~None~^~VkBindImageMemoryInfoKHR~^~VUID-VkBindImageMemoryInfoKHR-sType-unique~^~core~^~The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-sType-unique)~^~implicit -VALIDATION_ERROR_01000856~^~N~^~Unknown~^~vkBindImageMemory2KHR~^~VUID-VkBindImageMemorySwapchainInfoKHX-swapchain-01067~^~core~^~The spec valid usage text states 'At least one of swapchain and VkBindImageMemoryInfoKHR::memory must be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemorySwapchainInfoKHX-swapchain-01067)~^~ -VALIDATION_ERROR_01000858~^~N~^~Unknown~^~vkBindImageMemory2KHR~^~VUID-VkBindImageMemorySwapchainInfoKHX-imageIndex-01068~^~core~^~The spec valid usage text states 'imageIndex must be less than the number of images in swapchain' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemorySwapchainInfoKHX-imageIndex-01068)~^~ -VALIDATION_ERROR_01000cd8~^~N~^~None~^~VkBindImageMemorySwapchainInfoKHX~^~VUID-VkBindImageMemorySwapchainInfoKHX-imageIndex-01644~^~core~^~The spec valid usage text states 'imageIndex must be less than the number of images in swapchain' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemorySwapchainInfoKHX-imageIndex-01644)~^~ -VALIDATION_ERROR_0102b00b~^~N~^~Unknown~^~vkBindImageMemory2KHR~^~VUID-VkBindImageMemorySwapchainInfoKHX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemorySwapchainInfoKHX-sType-sType)~^~implicit -VALIDATION_ERROR_0102f001~^~N~^~Unknown~^~vkBindImageMemory2KHR~^~VUID-VkBindImageMemorySwapchainInfoKHX-swapchain-parameter~^~core~^~The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemorySwapchainInfoKHX-swapchain-parameter)~^~implicit -VALIDATION_ERROR_01200009~^~Y~^~Unknown~^~vkQueueBindSparse~^~VUID-VkBindSparseInfo-commonparent~^~core~^~The spec valid usage text states 'Both of the elements of pSignalSemaphores, and the elements of pWaitSemaphores that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-commonparent)~^~implicit -VALIDATION_ERROR_01210201~^~Y~^~None~^~vkQueueBindSparse~^~VUID-VkBindSparseInfo-pBufferBinds-parameter~^~core~^~The spec valid usage text states 'If bufferBindCount is not 0, pBufferBinds must be a valid pointer to an array of bufferBindCount valid VkSparseBufferMemoryBindInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pBufferBinds-parameter)~^~implicit -VALIDATION_ERROR_01218001~^~Y~^~None~^~vkQueueBindSparse~^~VUID-VkBindSparseInfo-pImageBinds-parameter~^~core~^~The spec valid usage text states 'If imageBindCount is not 0, pImageBinds must be a valid pointer to an array of imageBindCount valid VkSparseImageMemoryBindInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pImageBinds-parameter)~^~implicit -VALIDATION_ERROR_01218c01~^~Y~^~None~^~vkQueueBindSparse~^~VUID-VkBindSparseInfo-pImageOpaqueBinds-parameter~^~core~^~The spec valid usage text states 'If imageOpaqueBindCount is not 0, pImageOpaqueBinds must be a valid pointer to an array of imageOpaqueBindCount valid VkSparseImageOpaqueMemoryBindInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pImageOpaqueBinds-parameter)~^~implicit -VALIDATION_ERROR_0121c40d~^~Y~^~Unknown~^~vkQueueBindSparse~^~VUID-VkBindSparseInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkDeviceGroupBindSparseInfoKHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pNext-pNext)~^~implicit -VALIDATION_ERROR_01223401~^~Y~^~Unknown~^~vkQueueBindSparse~^~VUID-VkBindSparseInfo-pSignalSemaphores-parameter~^~core~^~The spec valid usage text states 'If signalSemaphoreCount is not 0, pSignalSemaphores must be a valid pointer to an array of signalSemaphoreCount valid VkSemaphore handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pSignalSemaphores-parameter)~^~implicit -VALIDATION_ERROR_01227601~^~Y~^~Unknown~^~vkQueueBindSparse~^~VUID-VkBindSparseInfo-pWaitSemaphores-parameter~^~core~^~The spec valid usage text states 'If waitSemaphoreCount is not 0, pWaitSemaphores must be a valid pointer to an array of waitSemaphoreCount valid VkSemaphore handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pWaitSemaphores-parameter)~^~implicit -VALIDATION_ERROR_0122b00b~^~N~^~Unknown~^~vkQueueBindSparse~^~VUID-VkBindSparseInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_01400720~^~N~^~None~^~vkCreateBuffer~^~VUID-VkBufferCreateInfo-size-00912~^~core~^~The spec valid usage text states 'size must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-size-00912)~^~ -VALIDATION_ERROR_01400722~^~Y~^~None~^~vkCreateBuffer~^~VUID-VkBufferCreateInfo-sharingMode-00913~^~core~^~The spec valid usage text states 'If sharingMode is VK_SHARING_MODE_CONCURRENT, pQueueFamilyIndices must be a valid pointer to an array of queueFamilyIndexCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-sharingMode-00913)~^~ -VALIDATION_ERROR_01400724~^~Y~^~None~^~vkCreateBuffer~^~VUID-VkBufferCreateInfo-sharingMode-00914~^~core~^~The spec valid usage text states 'If sharingMode is VK_SHARING_MODE_CONCURRENT, queueFamilyIndexCount must be greater than 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-sharingMode-00914)~^~ -VALIDATION_ERROR_01400726~^~Y~^~None~^~vkCreateBuffer~^~VUID-VkBufferCreateInfo-flags-00915~^~core~^~The spec valid usage text states 'If the sparse bindings feature is not enabled, flags must not contain VK_BUFFER_CREATE_SPARSE_BINDING_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-flags-00915)~^~ -VALIDATION_ERROR_01400728~^~Y~^~None~^~vkCreateBuffer~^~VUID-VkBufferCreateInfo-flags-00916~^~core~^~The spec valid usage text states 'If the sparse buffer residency feature is not enabled, flags must not contain VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-flags-00916)~^~ -VALIDATION_ERROR_0140072a~^~Y~^~None~^~vkCreateBuffer~^~VUID-VkBufferCreateInfo-flags-00917~^~core~^~The spec valid usage text states 'If the sparse aliased residency feature is not enabled, flags must not contain VK_BUFFER_CREATE_SPARSE_ALIASED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-flags-00917)~^~ -VALIDATION_ERROR_0140072c~^~Y~^~SparseBindingImageBufferCreate~^~vkCreateBuffer~^~VUID-VkBufferCreateInfo-flags-00918~^~core~^~The spec valid usage text states 'If flags contains VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT or VK_BUFFER_CREATE_SPARSE_ALIASED_BIT, it must also contain VK_BUFFER_CREATE_SPARSE_BINDING_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-flags-00918)~^~ -VALIDATION_ERROR_0140072e~^~N~^~Unknown~^~vkCreateBuffer~^~VUID-VkBufferCreateInfo-handleTypes-00919~^~core~^~The spec valid usage text states 'If any of the handle types specified in VkExternalMemoryImageCreateInfoKHR::handleTypes requires dedicated allocation, as reported by vkGetPhysicalDeviceExternalBufferPropertiesKHR in VkExternalBufferPropertiesKHR::externalMemoryProperties::externalMemoryFeatures, the pNext chain must contain an instance of VkDedicatedAllocationBufferCreateInfoNV with its dedicatedAllocation field set to VK_TRUE.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferCreateInfo-handleTypes-00919)~^~ -VALIDATION_ERROR_01400730~^~N~^~Unknown~^~vkCreateBuffer~^~VUID-VkBufferCreateInfo-pNext-00920~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If the pNext chain contains an instance of VkExternalMemoryBufferCreateInfoKHR, its handleTypes member must only contain bits that are also in VkExternalBufferPropertiesKHR::externalMemoryProperties.pname:compatibleHandleTypes, as returned by vkGetPhysicalDeviceExternalBufferPropertiesKHR with pExternalBufferInfo->handleType equal to any one of the handle types specified in VkExternalMemoryBufferCreateInfoKHR::handleTypes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferCreateInfo-pNext-00920)~^~ -VALIDATION_ERROR_01400ade~^~N~^~None~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-sharingMode-01391~^~!(VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'If sharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the physicalDevice that was used to create device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-sharingMode-01391)~^~ -VALIDATION_ERROR_01400b16~^~N~^~None~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-sharingMode-01419~^~(VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'If sharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by either vkGetPhysicalDeviceQueueFamilyProperties or vkGetPhysicalDeviceQueueFamilyProperties2KHR for the physicalDevice that was used to create device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferCreateInfo-sharingMode-01419)~^~ +VALIDATION_ERROR_00000009~^~Y~^~None~^~VkAcquireNextImageInfoKHR~^~VUID-VkAcquireNextImageInfoKHR-commonparent~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'Each of fence, semaphore, and swapchain that are valid handles must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-commonparent)~^~implicit +VALIDATION_ERROR_00000a10~^~N~^~Unknown~^~VkAcquireNextImageInfoKHR~^~VUID-VkAcquireNextImageInfoKHR-semaphore-01288~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If semaphore is not VK_NULL_HANDLE it must be unsignaled' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-semaphore-01288)~^~ +VALIDATION_ERROR_00000a12~^~N~^~Unknown~^~VkAcquireNextImageInfoKHR~^~VUID-VkAcquireNextImageInfoKHR-fence-01289~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If fence is not VK_NULL_HANDLE it must be unsignaled and must not be associated with any other queue command that has not yet completed execution on that queue' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-fence-01289)~^~ +VALIDATION_ERROR_00000a14~^~N~^~Unknown~^~VkAcquireNextImageInfoKHR~^~VUID-VkAcquireNextImageInfoKHR-deviceMask-01290~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'deviceMask must be a valid device mask' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-deviceMask-01290)~^~ +VALIDATION_ERROR_00000a16~^~N~^~Unknown~^~VkAcquireNextImageInfoKHR~^~VUID-VkAcquireNextImageInfoKHR-deviceMask-01291~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'deviceMask must not be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-deviceMask-01291)~^~ +VALIDATION_ERROR_00000d16~^~N~^~None~^~VkAcquireNextImageInfoKHR~^~VUID-VkAcquireNextImageInfoKHR-swapchain-01675~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'swapchain must not be in the retired state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-swapchain-01675)~^~ +VALIDATION_ERROR_00000dea~^~N~^~None~^~VkAcquireNextImageInfoKHR~^~VUID-VkAcquireNextImageInfoKHR-semaphore-01781~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If semaphore is not VK_NULL_HANDLE it must not have any uncompleted signal or wait operations pending' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-semaphore-01781)~^~ +VALIDATION_ERROR_00000dec~^~N~^~None~^~VkAcquireNextImageInfoKHR~^~VUID-VkAcquireNextImageInfoKHR-semaphore-01782~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'semaphore and fence must not both be equal to VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-semaphore-01782)~^~ +VALIDATION_ERROR_00000e18~^~N~^~None~^~VkAcquireNextImageInfoKHR~^~VUID-VkAcquireNextImageInfoKHR-semaphore-01804~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'semaphore and fence must not both be equal to VK_NULL_HANDLE.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-semaphore-01804)~^~ +VALIDATION_ERROR_00008801~^~Y~^~Unknown~^~VkAcquireNextImageInfoKHR~^~VUID-VkAcquireNextImageInfoKHR-fence-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If fence is not VK_NULL_HANDLE, fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-fence-parameter)~^~implicit +VALIDATION_ERROR_0001c40d~^~Y~^~Unknown~^~VkAcquireNextImageInfoKHR~^~VUID-VkAcquireNextImageInfoKHR-pNext-pNext~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-pNext-pNext)~^~implicit +VALIDATION_ERROR_0002b00b~^~Y~^~Unknown~^~VkAcquireNextImageInfoKHR~^~VUID-VkAcquireNextImageInfoKHR-sType-sType~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-sType-sType)~^~implicit +VALIDATION_ERROR_0002b801~^~Y~^~Unknown~^~VkAcquireNextImageInfoKHR~^~VUID-VkAcquireNextImageInfoKHR-semaphore-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If semaphore is not VK_NULL_HANDLE, semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-semaphore-parameter)~^~implicit +VALIDATION_ERROR_0002f001~^~Y~^~Unknown~^~VkAcquireNextImageInfoKHR~^~VUID-VkAcquireNextImageInfoKHR-swapchain-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-swapchain-parameter)~^~implicit +VALIDATION_ERROR_002004f0~^~Y~^~Unknown~^~VkAllocationCallbacks~^~VUID-VkAllocationCallbacks-pfnAllocation-00632~^~core~^~The spec valid usage text states 'pfnAllocation must be a valid pointer to a valid user-defined PFN_vkAllocationFunction' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnAllocation-00632)~^~ +VALIDATION_ERROR_002004f2~^~Y~^~Unknown~^~VkAllocationCallbacks~^~VUID-VkAllocationCallbacks-pfnReallocation-00633~^~core~^~The spec valid usage text states 'pfnReallocation must be a valid pointer to a valid user-defined PFN_vkReallocationFunction' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnReallocation-00633)~^~ +VALIDATION_ERROR_002004f4~^~Y~^~Unknown~^~VkAllocationCallbacks~^~VUID-VkAllocationCallbacks-pfnFree-00634~^~core~^~The spec valid usage text states 'pfnFree must be a valid pointer to a valid user-defined PFN_vkFreeFunction' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnFree-00634)~^~ +VALIDATION_ERROR_002004f6~^~N~^~Unknown~^~VkAllocationCallbacks~^~VUID-VkAllocationCallbacks-pfnInternalAllocation-00635~^~core~^~The spec valid usage text states 'If either of pfnInternalAllocation or pfnInternalFree is not NULL, both must be valid callbacks' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnInternalAllocation-00635)~^~ +VALIDATION_ERROR_004009c0~^~N~^~Unknown~^~VkAndroidSurfaceCreateInfoKHR~^~VUID-VkAndroidSurfaceCreateInfoKHR-window-01248~^~(VK_KHR_surface)+(VK_KHR_android_surface)~^~The spec valid usage text states 'window must point to a valid Android ANativeWindow.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAndroidSurfaceCreateInfoKHR-window-01248)~^~TBD in parameter validation layer. +VALIDATION_ERROR_00409005~^~Y~^~Unknown~^~VkAndroidSurfaceCreateInfoKHR~^~VUID-VkAndroidSurfaceCreateInfoKHR-flags-zerobitmask~^~(VK_KHR_surface)+(VK_KHR_android_surface)~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAndroidSurfaceCreateInfoKHR-flags-zerobitmask)~^~implicit +VALIDATION_ERROR_0041c40d~^~Y~^~Unknown~^~VkAndroidSurfaceCreateInfoKHR~^~VUID-VkAndroidSurfaceCreateInfoKHR-pNext-pNext~^~(VK_KHR_surface)+(VK_KHR_android_surface)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAndroidSurfaceCreateInfoKHR-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0042b00b~^~Y~^~Unknown~^~VkAndroidSurfaceCreateInfoKHR~^~VUID-VkAndroidSurfaceCreateInfoKHR-sType-sType~^~(VK_KHR_surface)+(VK_KHR_android_surface)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAndroidSurfaceCreateInfoKHR-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0060f001~^~N~^~Unknown~^~VkApplicationInfo~^~VUID-VkApplicationInfo-pApplicationName-parameter~^~core~^~The spec valid usage text states 'If pApplicationName is not NULL, pApplicationName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkApplicationInfo-pApplicationName-parameter)~^~implicit +VALIDATION_ERROR_00615c01~^~N~^~Unknown~^~VkApplicationInfo~^~VUID-VkApplicationInfo-pEngineName-parameter~^~core~^~The spec valid usage text states 'If pEngineName is not NULL, pEngineName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkApplicationInfo-pEngineName-parameter)~^~implicit +VALIDATION_ERROR_0061c40d~^~Y~^~Unknown~^~VkApplicationInfo~^~VUID-VkApplicationInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkApplicationInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0062b00b~^~Y~^~Unknown~^~VkApplicationInfo~^~VUID-VkApplicationInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_APPLICATION_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkApplicationInfo-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_00800696~^~Y~^~AttachmentDescriptionInvalidFinalLayout~^~VkAttachmentDescription~^~VUID-VkAttachmentDescription-finalLayout-00843~^~core~^~The spec valid usage text states 'finalLayout must not be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-finalLayout-00843)~^~ +VALIDATION_ERROR_00808e01~^~Y~^~Unknown~^~VkAttachmentDescription~^~VUID-VkAttachmentDescription-finalLayout-parameter~^~core~^~The spec valid usage text states 'finalLayout must be a valid VkImageLayout value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-finalLayout-parameter)~^~implicit +VALIDATION_ERROR_00809001~^~Y~^~Unknown~^~VkAttachmentDescription~^~VUID-VkAttachmentDescription-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkAttachmentDescriptionFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-flags-parameter)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_00809201~^~Y~^~Unknown~^~VkAttachmentDescription~^~VUID-VkAttachmentDescription-format-parameter~^~core~^~The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-format-parameter)~^~implicit +VALIDATION_ERROR_0080b801~^~Y~^~Unknown~^~VkAttachmentDescription~^~VUID-VkAttachmentDescription-initialLayout-parameter~^~core~^~The spec valid usage text states 'initialLayout must be a valid VkImageLayout value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-initialLayout-parameter)~^~implicit +VALIDATION_ERROR_0080c201~^~Y~^~Unknown~^~VkAttachmentDescription~^~VUID-VkAttachmentDescription-loadOp-parameter~^~core~^~The spec valid usage text states 'loadOp must be a valid VkAttachmentLoadOp value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-loadOp-parameter)~^~implicit +VALIDATION_ERROR_0082b401~^~Y~^~CreateRenderPassAttachments~^~VkAttachmentDescription~^~VUID-VkAttachmentDescription-samples-parameter~^~core~^~The spec valid usage text states 'samples must be a valid VkSampleCountFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-samples-parameter)~^~implicit +VALIDATION_ERROR_0082e001~^~Y~^~Unknown~^~VkAttachmentDescription~^~VUID-VkAttachmentDescription-stencilLoadOp-parameter~^~core~^~The spec valid usage text states 'stencilLoadOp must be a valid VkAttachmentLoadOp value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-stencilLoadOp-parameter)~^~implicit +VALIDATION_ERROR_0082e201~^~Y~^~Unknown~^~VkAttachmentDescription~^~VUID-VkAttachmentDescription-stencilStoreOp-parameter~^~core~^~The spec valid usage text states 'stencilStoreOp must be a valid VkAttachmentStoreOp value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-stencilStoreOp-parameter)~^~implicit +VALIDATION_ERROR_0082e401~^~Y~^~Unknown~^~VkAttachmentDescription~^~VUID-VkAttachmentDescription-storeOp-parameter~^~core~^~The spec valid usage text states 'storeOp must be a valid VkAttachmentStoreOp value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-storeOp-parameter)~^~implicit +VALIDATION_ERROR_00a006b2~^~N~^~Unknown~^~VkAttachmentReference~^~VUID-VkAttachmentReference-layout-00857~^~core~^~The spec valid usage text states 'layout must not be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentReference-layout-00857)~^~ +VALIDATION_ERROR_00a0be01~^~Y~^~Unknown~^~VkAttachmentReference~^~VUID-VkAttachmentReference-layout-parameter~^~core~^~The spec valid usage text states 'layout must be a valid VkImageLayout value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentReference-layout-parameter)~^~implicit +VALIDATION_ERROR_00c00009~^~Y~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-commonparent~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'Both of buffer, and memory must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-commonparent)~^~implicit +VALIDATION_ERROR_00c00c72~^~N~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-buffer-01593~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'buffer must not already be backed by a memory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-buffer-01593)~^~ +VALIDATION_ERROR_00c00c74~^~N~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-buffer-01594~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'buffer must not have been created with any sparse memory binding flags' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-buffer-01594)~^~ +VALIDATION_ERROR_00c00c76~^~N~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-memoryOffset-01595~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'memoryOffset must be less than the size of memory' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-memoryOffset-01595)~^~ +VALIDATION_ERROR_00c00c78~^~N~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-buffer-01596~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'If buffer was created with the VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT or VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minTexelBufferOffsetAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-buffer-01596)~^~ +VALIDATION_ERROR_00c00c7a~^~N~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-buffer-01597~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'If buffer was created with the VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minUniformBufferOffsetAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-buffer-01597)~^~ +VALIDATION_ERROR_00c00c7c~^~N~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-buffer-01598~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'If buffer was created with the VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minStorageBufferOffsetAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-buffer-01598)~^~ +VALIDATION_ERROR_00c00c7e~^~N~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-memory-01599~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-memory-01599)~^~ +VALIDATION_ERROR_00c00c80~^~N~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-memoryOffset-01600~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-memoryOffset-01600)~^~ +VALIDATION_ERROR_00c00c82~^~N~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-size-01601~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'The size member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer must be less than or equal to the size of memory minus memoryOffset' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-size-01601)~^~ +VALIDATION_ERROR_00c00c84~^~N~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-buffer-01602~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If buffer requires a dedicated allocation(as reported by vkGetBufferMemoryRequirements2 in VkMemoryDedicatedRequirements::requiresDedicatedAllocation for buffer), memory must have been created with VkMemoryDedicatedAllocateInfo::buffer equal to buffer and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-buffer-01602)~^~ +VALIDATION_ERROR_00c00c86~^~N~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-buffer-01603~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'If buffer was created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must have been created with VkDedicatedAllocationMemoryAllocateInfoNV::buffer equal to buffer and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-buffer-01603)~^~ +VALIDATION_ERROR_00c00c88~^~N~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-buffer-01604~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_NV_dedicated_allocation)+!(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If buffer was not created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must not have been allocated dedicated for a specific buffer or image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfo-buffer-01604)~^~ +VALIDATION_ERROR_00c00c8a~^~N~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-pNext-01605~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If the pNext chain includes VkBindBufferMemoryDeviceGroupInfo, all instances of memory specified by VkBindBufferMemoryDeviceGroupInfo::pDeviceIndices must have been allocated' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-pNext-01605)~^~ +VALIDATION_ERROR_00c00ed8~^~N~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-memory-01900~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If the VkMemoryAllocateInfo provided when memory was allocated included an instance of VkMemoryDedicatedAllocateInfo in its pNext chain, and VkMemoryDedicatedAllocateInfo::buffer was not VK_NULL_HANDLE, then buffer must equal VkMemoryDedicatedAllocateInfo::buffer and memoryOffset must be zero.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-memory-01900)~^~ +VALIDATION_ERROR_00c01a01~^~Y~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-buffer-parameter~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-buffer-parameter)~^~implicit +VALIDATION_ERROR_00c0c601~^~Y~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-memory-parameter~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-memory-parameter)~^~implicit +VALIDATION_ERROR_00c1c40d~^~Y~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkBindBufferMemoryDeviceGroupInfo' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-pNext-pNext)~^~implicit +VALIDATION_ERROR_00c2b00b~^~N~^~None~^~VkBindBufferMemoryInfo~^~VUID-VkBindBufferMemoryInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-sType-sType)~^~implicit +VALIDATION_ERROR_00e00009~^~Y~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-commonparent~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'Both of image, and memory that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-commonparent)~^~implicit +VALIDATION_ERROR_00e00c92~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-image-01609~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'image must not already be backed by a memory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-image-01609)~^~ +VALIDATION_ERROR_00e00c94~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-image-01610~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'image must not have been created with any sparse memory binding flags' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-image-01610)~^~ +VALIDATION_ERROR_00e00c96~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-memoryOffset-01611~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'memoryOffset must be less than the size of memory' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-memoryOffset-01611)~^~ +VALIDATION_ERROR_00e00c98~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-memory-01612~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfo-memory-01612)~^~ +VALIDATION_ERROR_00e00c9a~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-memoryOffset-01613~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfo-memoryOffset-01613)~^~ +VALIDATION_ERROR_00e00c9c~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-memory-01614~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'The difference of the size of memory and memoryOffset must be greater than or equal to the size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with the same image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfo-memory-01614)~^~ +VALIDATION_ERROR_00e00c9e~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-pNext-01615~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the pNext chain does not include an instance of the VkBindImagePlaneMemoryInfo structure, memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2 with image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01615)~^~ +VALIDATION_ERROR_00e00ca0~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-pNext-01616~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the pNext chain does not include an instance of the VkBindImagePlaneMemoryInfo structure, memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2 with image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01616)~^~ +VALIDATION_ERROR_00e00ca2~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-pNext-01617~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the pNext chain does not include an instance of the VkBindImagePlaneMemoryInfo structure, the difference of the size of memory and memoryOffset must be greater than or equal to the size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2 with the same image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01617)~^~ +VALIDATION_ERROR_00e00ca4~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-pNext-01618~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfo structure, image must have been created with the VK_IMAGE_CREATE_DISJOINT_BIT bit set.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01618)~^~ +VALIDATION_ERROR_00e00ca6~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-pNext-01619~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfo structure, memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2 with image and the correct planeAspect for this plane in the VkImagePlaneMemoryRequirementsInfo structure attached to the VkImageMemoryRequirementsInfo2's pNext chain' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01619)~^~ +VALIDATION_ERROR_00e00ca8~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-pNext-01620~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfo structure, memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2 with image and the correct planeAspect for this plane in the VkImagePlaneMemoryRequirementsInfo structure attached to the VkImageMemoryRequirementsInfo2's pNext chain' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01620)~^~ +VALIDATION_ERROR_00e00caa~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-pNext-01621~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfo structure, the difference of the size of memory and memoryOffset must be greater than or equal to the size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2 with the same image and the correct planeAspect for this plane in the VkImagePlaneMemoryRequirementsInfo structure attached to the VkImageMemoryRequirementsInfo2's pNext chain' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01621)~^~ +VALIDATION_ERROR_00e00cac~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-image-01622~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If image requires a dedicated allocation (as reported by vkGetImageMemoryRequirements2 in VkMemoryDedicatedRequirements::requiresDedicatedAllocation for image), memory must have been created with VkMemoryDedicatedAllocateInfo::image equal to image and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-image-01622)~^~ +VALIDATION_ERROR_00e00cae~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-image-01623~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'If image was created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must have been created with VkDedicatedAllocationMemoryAllocateInfoNV::image equal to image and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-image-01623)~^~ +VALIDATION_ERROR_00e00cb0~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-image-01624~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_NV_dedicated_allocation)+!(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If image was not created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must not have been allocated dedicated for a specific buffer or image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfo-image-01624)~^~ +VALIDATION_ERROR_00e00cb2~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-memory-01625~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+!(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfo-memory-01625)~^~ +VALIDATION_ERROR_00e00cb4~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-pNext-01626~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If the pNext chain includes VkBindImageMemoryDeviceGroupInfo, all instances of memory specified by VkBindImageMemoryDeviceGroupInfo::pDeviceIndices must have been allocated' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01626)~^~ +VALIDATION_ERROR_00e00cb6~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-pNext-01627~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If the pNext chain includes VkBindImageMemoryDeviceGroupInfo, and VkBindImageMemoryDeviceGroupInfo::splitInstanceBindRegionCount is not zero, then image must have been created with the VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01627)~^~ +VALIDATION_ERROR_00e00cb8~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-pNext-01628~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If the pNext chain includes VkBindImageMemoryDeviceGroupInfo, all elements of VkBindImageMemoryDeviceGroupInfo::pSplitInstanceBindRegions must be valid rectangles contained within the dimensions of image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01628)~^~ +VALIDATION_ERROR_00e00cba~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-pNext-01629~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If the pNext chain includes VkBindImageMemoryDeviceGroupInfo, the union of the areas of all elements of VkBindImageMemoryDeviceGroupInfo::pSplitInstanceBindRegions that correspond to the same instance of image must cover the entire image.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01629)~^~ +VALIDATION_ERROR_00e00cbc~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-image-01630~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)+(VK_KHR_swapchain)~^~The spec valid usage text states 'If image was created with a valid swapchain handle in VkImageSwapchainCreateInfoKHR::swapchain, then the pNext chain must include a valid instance of VkBindImageMemorySwapchainInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-image-01630)~^~ +VALIDATION_ERROR_00e00cbe~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-pNext-01631~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)+(VK_KHR_swapchain)~^~The spec valid usage text states 'If the pNext chain includes an instance of VkBindImageMemorySwapchainInfoKHR, memory must be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01631)~^~ +VALIDATION_ERROR_00e00cc0~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-pNext-01632~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)+(VK_KHR_swapchain)~^~The spec valid usage text states 'If the pNext chain does not include an instance of VkBindImageMemorySwapchainInfoKHR, memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01632)~^~ +VALIDATION_ERROR_00e00ede~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-memory-01903~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If the VkMemoryAllocateInfo provided when memory was allocated included an instance of VkMemoryDedicatedAllocateInfo in its pNext chain, and VkMemoryDedicatedAllocateInfo::image was not VK_NULL_HANDLE, then image must equal VkMemoryDedicatedAllocateInfo::image and memoryOffset must be zero.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-memory-01903)~^~ +VALIDATION_ERROR_00e0a001~^~Y~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-image-parameter~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-image-parameter)~^~implicit +VALIDATION_ERROR_00e1c40d~^~Y~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkBindImageMemoryDeviceGroupInfo, VkBindImageMemorySwapchainInfoKHR, or VkBindImagePlaneMemoryInfo' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-pNext)~^~implicit +VALIDATION_ERROR_00e2b00b~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-sType-sType)~^~implicit +VALIDATION_ERROR_00e2b00f~^~N~^~None~^~VkBindImageMemoryInfo~^~VUID-VkBindImageMemoryInfo-sType-unique~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-sType-unique)~^~implicit +VALIDATION_ERROR_01000cd8~^~N~^~None~^~VkBindImageMemorySwapchainInfoKHR~^~VUID-VkBindImageMemorySwapchainInfoKHR-imageIndex-01644~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)+(VK_KHR_swapchain)~^~The spec valid usage text states 'imageIndex must be less than the number of images in swapchain' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemorySwapchainInfoKHR-imageIndex-01644)~^~ +VALIDATION_ERROR_0102b00b~^~N~^~Unknown~^~VkBindImageMemorySwapchainInfoKHR~^~VUID-VkBindImageMemorySwapchainInfoKHR-sType-sType~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)+(VK_KHR_swapchain)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemorySwapchainInfoKHR-sType-sType)~^~implicit +VALIDATION_ERROR_0102f001~^~N~^~Unknown~^~VkBindImageMemorySwapchainInfoKHR~^~VUID-VkBindImageMemorySwapchainInfoKHR-swapchain-parameter~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)+(VK_KHR_swapchain)~^~The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemorySwapchainInfoKHR-swapchain-parameter)~^~implicit +VALIDATION_ERROR_01200009~^~Y~^~Unknown~^~VkBindSparseInfo~^~VUID-VkBindSparseInfo-commonparent~^~core~^~The spec valid usage text states 'Both of the elements of pSignalSemaphores, and the elements of pWaitSemaphores that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-commonparent)~^~implicit +VALIDATION_ERROR_01210201~^~Y~^~None~^~VkBindSparseInfo~^~VUID-VkBindSparseInfo-pBufferBinds-parameter~^~core~^~The spec valid usage text states 'If bufferBindCount is not 0, pBufferBinds must be a valid pointer to an array of bufferBindCount valid VkSparseBufferMemoryBindInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pBufferBinds-parameter)~^~implicit +VALIDATION_ERROR_01218001~^~Y~^~None~^~VkBindSparseInfo~^~VUID-VkBindSparseInfo-pImageBinds-parameter~^~core~^~The spec valid usage text states 'If imageBindCount is not 0, pImageBinds must be a valid pointer to an array of imageBindCount valid VkSparseImageMemoryBindInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pImageBinds-parameter)~^~implicit +VALIDATION_ERROR_01218c01~^~Y~^~None~^~VkBindSparseInfo~^~VUID-VkBindSparseInfo-pImageOpaqueBinds-parameter~^~core~^~The spec valid usage text states 'If imageOpaqueBindCount is not 0, pImageOpaqueBinds must be a valid pointer to an array of imageOpaqueBindCount valid VkSparseImageOpaqueMemoryBindInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pImageOpaqueBinds-parameter)~^~implicit +VALIDATION_ERROR_0121c40d~^~Y~^~Unknown~^~VkBindSparseInfo~^~VUID-VkBindSparseInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkDeviceGroupBindSparseInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pNext-pNext)~^~implicit +VALIDATION_ERROR_01223401~^~Y~^~Unknown~^~VkBindSparseInfo~^~VUID-VkBindSparseInfo-pSignalSemaphores-parameter~^~core~^~The spec valid usage text states 'If signalSemaphoreCount is not 0, pSignalSemaphores must be a valid pointer to an array of signalSemaphoreCount valid VkSemaphore handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pSignalSemaphores-parameter)~^~implicit +VALIDATION_ERROR_01227601~^~Y~^~Unknown~^~VkBindSparseInfo~^~VUID-VkBindSparseInfo-pWaitSemaphores-parameter~^~core~^~The spec valid usage text states 'If waitSemaphoreCount is not 0, pWaitSemaphores must be a valid pointer to an array of waitSemaphoreCount valid VkSemaphore handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pWaitSemaphores-parameter)~^~implicit +VALIDATION_ERROR_0122b00b~^~N~^~Unknown~^~VkBindSparseInfo~^~VUID-VkBindSparseInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_01400720~^~Y~^~InvalidCreateBufferSize~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-size-00912~^~core~^~The spec valid usage text states 'size must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-size-00912)~^~ +VALIDATION_ERROR_01400722~^~Y~^~None~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-sharingMode-00913~^~core~^~The spec valid usage text states 'If sharingMode is VK_SHARING_MODE_CONCURRENT, pQueueFamilyIndices must be a valid pointer to an array of queueFamilyIndexCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-sharingMode-00913)~^~ +VALIDATION_ERROR_01400724~^~Y~^~None~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-sharingMode-00914~^~core~^~The spec valid usage text states 'If sharingMode is VK_SHARING_MODE_CONCURRENT, queueFamilyIndexCount must be greater than 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-sharingMode-00914)~^~ +VALIDATION_ERROR_01400726~^~Y~^~None~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-flags-00915~^~core~^~The spec valid usage text states 'If the sparse bindings feature is not enabled, flags must not contain VK_BUFFER_CREATE_SPARSE_BINDING_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-flags-00915)~^~ +VALIDATION_ERROR_01400728~^~Y~^~None~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-flags-00916~^~core~^~The spec valid usage text states 'If the sparse buffer residency feature is not enabled, flags must not contain VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-flags-00916)~^~ +VALIDATION_ERROR_0140072a~^~Y~^~None~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-flags-00917~^~core~^~The spec valid usage text states 'If the sparse aliased residency feature is not enabled, flags must not contain VK_BUFFER_CREATE_SPARSE_ALIASED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-flags-00917)~^~ +VALIDATION_ERROR_0140072c~^~Y~^~SparseBindingImageBufferCreate~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-flags-00918~^~core~^~The spec valid usage text states 'If flags contains VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT or VK_BUFFER_CREATE_SPARSE_ALIASED_BIT, it must also contain VK_BUFFER_CREATE_SPARSE_BINDING_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-flags-00918)~^~ +VALIDATION_ERROR_01400730~^~N~^~Unknown~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-pNext-00920~^~(VK_VERSION_1_1,VK_KHR_external_memory)~^~The spec valid usage text states 'If the pNext chain contains an instance of VkExternalMemoryBufferCreateInfo, its handleTypes member must only contain bits that are also in VkExternalBufferProperties::externalMemoryProperties.pname:compatibleHandleTypes, as returned by vkGetPhysicalDeviceExternalBufferProperties with pExternalBufferInfo-&gt;handleType equal to any one of the handle types specified in VkExternalMemoryBufferCreateInfo::handleTypes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferCreateInfo-pNext-00920)~^~ +VALIDATION_ERROR_01400ade~^~N~^~None~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-sharingMode-01391~^~!(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'If sharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the physicalDevice that was used to create device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-sharingMode-01391)~^~ +VALIDATION_ERROR_01400b16~^~N~^~None~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-sharingMode-01419~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'If sharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by either vkGetPhysicalDeviceQueueFamilyProperties or vkGetPhysicalDeviceQueueFamilyProperties2 for the physicalDevice that was used to create device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferCreateInfo-sharingMode-01419)~^~ VALIDATION_ERROR_01400c46~^~N~^~None~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-pNext-01571~^~(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'If the pNext chain contains an instance of VkDedicatedAllocationBufferCreateInfoNV, and the dedicatedAllocation member of the chained structure is VK_TRUE, then flags must not include VK_BUFFER_CREATE_SPARSE_BINDING_BIT, VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT, or VK_BUFFER_CREATE_SPARSE_ALIASED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferCreateInfo-pNext-01571)~^~ -VALIDATION_ERROR_01409001~^~Y~^~None~^~vkCreateBuffer~^~VUID-VkBufferCreateInfo-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkBufferCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-flags-parameter)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0141c40d~^~Y~^~Unknown~^~vkCreateBuffer~^~VUID-VkBufferCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDedicatedAllocationBufferCreateInfoNV or VkExternalMemoryBufferCreateInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-pNext-pNext)~^~implicit -VALIDATION_ERROR_0142b00b~^~Y~^~None~^~vkCreateBuffer~^~VUID-VkBufferCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_01400ebe~^~N~^~None~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-flags-01887~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If the protected memory feature is not enabled, flags must not contain VK_BUFFER_CREATE_PROTECTED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferCreateInfo-flags-01887)~^~ +VALIDATION_ERROR_01400ec0~^~N~^~None~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-None-01888~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If any of the bits VK_BUFFER_CREATE_SPARSE_BINDING_BIT, VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT, or VK_BUFFER_CREATE_SPARSE_ALIASED_BIT are set, VK_BUFFER_CREATE_PROTECTED_BIT must not also be set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferCreateInfo-None-01888)~^~ +VALIDATION_ERROR_01409001~^~Y~^~None~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkBufferCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-flags-parameter)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0141c40d~^~Y~^~Unknown~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDedicatedAllocationBufferCreateInfoNV or VkExternalMemoryBufferCreateInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-pNext-pNext)~^~implicit +VALIDATION_ERROR_0142b00b~^~Y~^~None~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. VALIDATION_ERROR_0142b00f~^~N~^~None~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-sType-unique~^~core~^~The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-sType-unique)~^~implicit -VALIDATION_ERROR_0142c001~^~Y~^~None~^~vkCreateBuffer~^~VUID-VkBufferCreateInfo-sharingMode-parameter~^~core~^~The spec valid usage text states 'sharingMode must be a valid VkSharingMode value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-sharingMode-parameter)~^~implicit -VALIDATION_ERROR_01430601~^~N~^~None~^~vkCreateBuffer~^~VUID-VkBufferCreateInfo-usage-parameter~^~core~^~The spec valid usage text states 'usage must be a valid combination of VkBufferUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-usage-parameter)~^~implicit -VALIDATION_ERROR_01430603~^~Y~^~None~^~vkCreateBuffer~^~VUID-VkBufferCreateInfo-usage-requiredbitmask~^~core~^~The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-usage-requiredbitmask)~^~implicit -VALIDATION_ERROR_01600182~^~Y~^~MiscImageLayerTests~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-bufferOffset-00193~^~!(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the the calling command's VkImage parameter's format is not a depth/stencil format, then bufferOffset must be a multiple of the format's element size' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-00193)~^~ -VALIDATION_ERROR_01600184~^~Y~^~MiscImageLayerTests~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-bufferOffset-00194~^~core~^~The spec valid usage text states 'bufferOffset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-00194)~^~ -VALIDATION_ERROR_01600186~^~Y~^~MiscImageLayerTests~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-bufferRowLength-00195~^~core~^~The spec valid usage text states 'bufferRowLength must be 0, or greater than or equal to the width member of imageExtent' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferRowLength-00195)~^~ -VALIDATION_ERROR_01600188~^~Y~^~MiscImageLayerTests~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-bufferImageHeight-00196~^~core~^~The spec valid usage text states 'bufferImageHeight must be 0, or greater than or equal to the height member of imageExtent' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferImageHeight-00196)~^~ -VALIDATION_ERROR_0160018a~^~N~^~Unknown~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-imageOffset-00197~^~core~^~The spec valid usage text states 'imageOffset.x and (imageExtent.width + imageOffset.x) must both be greater than or equal to 0 and less than or equal to the image subresource width' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageOffset-00197)~^~ -VALIDATION_ERROR_0160018c~^~N~^~Unknown~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-imageOffset-00198~^~core~^~The spec valid usage text states 'imageOffset.y and (imageExtent.height + imageOffset.y) must both be greater than or equal to 0 and less than or equal to the image subresource height' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageOffset-00198)~^~ -VALIDATION_ERROR_0160018e~^~Y~^~None~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-srcImage-00199~^~core~^~The spec valid usage text states 'If the calling command's srcImage (vkCmdCopyImageToBuffer) or dstImage (vkCmdCopyBufferToImage) is of type VK_IMAGE_TYPE_1D, then imageOffset.y must be 0 and imageExtent.height must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-srcImage-00199)~^~ -VALIDATION_ERROR_01600190~^~N~^~Unknown~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-imageOffset-00200~^~core~^~The spec valid usage text states 'imageOffset.z and (imageExtent.depth + imageOffset.z) must both be greater than or equal to 0 and less than or equal to the image subresource depth' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageOffset-00200)~^~This VU has two distinct conditions and the implemented check looks at both, but there are two distinct test cases for this enum -VALIDATION_ERROR_01600192~^~Y~^~MiscImageLayerTests~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-srcImage-00201~^~core~^~The spec valid usage text states 'If the calling command's srcImage (vkCmdCopyImageToBuffer) or dstImage (vkCmdCopyBufferToImage) is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then imageOffset.z must be 0 and imageExtent.depth must be 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-srcImage-00201)~^~ -VALIDATION_ERROR_01600196~^~Y~^~ImageBufferCopyTests~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-bufferRowLength-00203~^~core~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferRowLength-00203)~^~ -VALIDATION_ERROR_01600198~^~Y~^~ImageBufferCopyTests~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-bufferImageHeight-00204~^~core~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferImageHeight-00204)~^~ -VALIDATION_ERROR_0160019a~^~Y~^~ImageBufferCopyTests~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-imageOffset-00205~^~core~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageOffset-00205)~^~ -VALIDATION_ERROR_0160019c~^~Y~^~ImageBufferCopyTests~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-bufferOffset-00206~^~core~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-00206)~^~ -VALIDATION_ERROR_0160019e~^~Y~^~ImageBufferCopyTests~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-imageExtent-00207~^~core~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageExtent-00207)~^~ -VALIDATION_ERROR_016001a0~^~Y~^~ImageBufferCopyTests~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-imageExtent-00208~^~core~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageExtent-00208)~^~ -VALIDATION_ERROR_016001a2~^~Y~^~None~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-imageExtent-00209~^~core~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageExtent-00209)~^~ -VALIDATION_ERROR_016001a4~^~N~^~Unknown~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-bufferOffset-00210~^~core~^~The spec valid usage text states 'bufferOffset, bufferRowLength, bufferImageHeight and all members of imageOffset and imageExtent must respect the image transfer granularity requirements of the queue family that it will be submitted against, as described in Physical Device Enumeration' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-00210)~^~ -VALIDATION_ERROR_016001a6~^~Y~^~ImageBufferCopyTests~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-aspectMask-00211~^~core~^~The spec valid usage text states 'The aspectMask member of imageSubresource must specify aspects present in the calling command's VkImage parameter' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-aspectMask-00211)~^~ -VALIDATION_ERROR_016001a8~^~Y~^~ImageBufferCopyTests~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-aspectMask-00212~^~core~^~The spec valid usage text states 'The aspectMask member of imageSubresource must only have a single bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-aspectMask-00212)~^~ -VALIDATION_ERROR_016001aa~^~Y~^~None~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-baseArrayLayer-00213~^~core~^~The spec valid usage text states 'If the calling command's VkImage parameter is of VkImageType VK_IMAGE_TYPE_3D, the baseArrayLayer and layerCount members of imageSubresource must be 0 and 1, respectively' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-baseArrayLayer-00213)~^~ -VALIDATION_ERROR_016001ac~^~N~^~Unknown~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-None-00214~^~core~^~The spec valid usage text states 'When copying to the depth aspect of an image subresource, the data in the source buffer must be in the range [0,1]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-None-00214)~^~ -VALIDATION_ERROR_01600c2c~^~N~^~None~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-bufferOffset-01558~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter's format is not a depth/stencil format or a multi-planar format,cthen bufferOffset must be a multiple of the format's element size' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-01558)~^~ -VALIDATION_ERROR_01600c2e~^~N~^~None~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-bufferOffset-01559~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter's format is a multi-planar format, then bufferOffset must be a multiple of the element size of the compatible format for the format and the aspectMask of the imageSubresource as defined in Compatible formats of planes of multi-planar formats' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-01559)~^~ -VALIDATION_ERROR_01600c30~^~N~^~None~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-aspectMask-01560~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter's format is a multi-planar format, then the aspectMask member of imageSubresource must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR, or VK_IMAGE_ASPECT_PLANE_2_BIT_KHR (with VK_IMAGE_ASPECT_PLANE_2_BIT_KHR valid only for image formats with three planes)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-aspectMask-01560)~^~ -VALIDATION_ERROR_0160aa01~^~N~^~Unknown~^~vkCmdCopyImageToBuffer~^~VUID-VkBufferImageCopy-imageSubresource-parameter~^~core~^~The spec valid usage text states 'imageSubresource must be a valid VkImageSubresourceLayers structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageSubresource-parameter)~^~implicit -VALIDATION_ERROR_01800946~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-offset-01187~^~core~^~The spec valid usage text states 'offset must be less than the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-offset-01187)~^~ -VALIDATION_ERROR_01800948~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-size-01188~^~core~^~The spec valid usage text states 'If size is not equal to VK_WHOLE_SIZE, size must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-size-01188)~^~ -VALIDATION_ERROR_0180094a~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-size-01189~^~core~^~The spec valid usage text states 'If size is not equal to VK_WHOLE_SIZE, size must be less than or equal to than the size of buffer minus offset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-size-01189)~^~ -VALIDATION_ERROR_0180094c~^~N~^~None~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01190~^~!(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, srcQueueFamilyIndex and dstQueueFamilyIndex must both be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01190)~^~ -VALIDATION_ERROR_0180094e~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01191~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, at least one of srcQueueFamilyIndex and dstQueueFamilyIndex must be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01191)~^~ -VALIDATION_ERROR_01800950~^~N~^~None~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01192~^~!(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, srcQueueFamilyIndex and dstQueueFamilyIndex must either both be VK_QUEUE_FAMILY_IGNORED, or both be a valid queue family (see Queue Family Properties)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01192)~^~ -VALIDATION_ERROR_01800952~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01193~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, dstQueueFamilyIndex must also be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01193)~^~ -VALIDATION_ERROR_01800954~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01194~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or VK_QUEUE_FAMILY_EXTERNAL_KHR (see Queue Family Properties)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01194)~^~ -VALIDATION_ERROR_01800956~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01195~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and dstQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or VK_QUEUE_FAMILY_EXTERNAL_KHR (see Queue Family Properties)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01195)~^~ -VALIDATION_ERROR_01800958~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01196~^~core~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, and srcQueueFamilyIndex and dstQueueFamilyIndex are not VK_QUEUE_FAMILY_IGNORED, at least one of them must be the same as the family of the queue that will execute this barrier' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01196)~^~ -VALIDATION_ERROR_01800ac8~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01380~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, and one of srcQueueFamilyIndex and dstQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, the other must be VK_QUEUE_FAMILY_IGNORED or VK_QUEUE_FAMILY_EXTERNAL_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01380)~^~ -VALIDATION_ERROR_01801a01~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-parameter~^~core~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-parameter)~^~implicit -VALIDATION_ERROR_01806801~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-dstAccessMask-parameter~^~core~^~The spec valid usage text states 'dstAccessMask must be a valid combination of VkAccessFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-dstAccessMask-parameter)~^~implicit -VALIDATION_ERROR_0181c40d~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0182b00b~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0182c401~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-srcAccessMask-parameter~^~core~^~The spec valid usage text states 'srcAccessMask must be a valid combination of VkAccessFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-srcAccessMask-parameter)~^~implicit -VALIDATION_ERROR_01a0073a~^~N~^~Unknown~^~vkCreateBufferView~^~VUID-VkBufferViewCreateInfo-offset-00925~^~core~^~The spec valid usage text states 'offset must be less than the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-offset-00925)~^~ -VALIDATION_ERROR_01a0073c~^~N~^~Unknown~^~vkCreateBufferView~^~VUID-VkBufferViewCreateInfo-offset-00926~^~core~^~The spec valid usage text states 'offset must be a multiple of VkPhysicalDeviceLimits::minTexelBufferOffsetAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-offset-00926)~^~ -VALIDATION_ERROR_01a00740~^~N~^~Unknown~^~vkCreateBufferView~^~VUID-VkBufferViewCreateInfo-range-00928~^~core~^~The spec valid usage text states 'If range is not equal to VK_WHOLE_SIZE, range must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-range-00928)~^~ -VALIDATION_ERROR_01a00742~^~N~^~Unknown~^~vkCreateBufferView~^~VUID-VkBufferViewCreateInfo-range-00929~^~core~^~The spec valid usage text states 'If range is not equal to VK_WHOLE_SIZE, range must be a multiple of the element size of format' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-range-00929)~^~ -VALIDATION_ERROR_01a00744~^~N~^~Unknown~^~vkCreateBufferView~^~VUID-VkBufferViewCreateInfo-range-00930~^~core~^~The spec valid usage text states 'If range is not equal to VK_WHOLE_SIZE, range divided by the element size of format must be less than or equal to VkPhysicalDeviceLimits::maxTexelBufferElements' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-range-00930)~^~ -VALIDATION_ERROR_01a00746~^~N~^~Unknown~^~vkCreateBufferView~^~VUID-VkBufferViewCreateInfo-offset-00931~^~core~^~The spec valid usage text states 'If range is not equal to VK_WHOLE_SIZE, the sum of offset and range must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-offset-00931)~^~ -VALIDATION_ERROR_01a00748~^~Y~^~None~^~vkCreateBufferView~^~VUID-VkBufferViewCreateInfo-buffer-00932~^~core~^~The spec valid usage text states 'buffer must have been created with a usage value containing at least one of VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT or VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-buffer-00932)~^~ -VALIDATION_ERROR_01a0074a~^~N~^~Unknown~^~vkCreateBufferView~^~VUID-VkBufferViewCreateInfo-buffer-00933~^~core~^~The spec valid usage text states 'If buffer was created with usage containing VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT, format must be supported for uniform texel buffers, as specified by the VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT flag in VkFormatProperties::bufferFeatures returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-buffer-00933)~^~ -VALIDATION_ERROR_01a0074c~^~N~^~Unknown~^~vkCreateBufferView~^~VUID-VkBufferViewCreateInfo-buffer-00934~^~core~^~The spec valid usage text states 'If buffer was created with usage containing VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, format must be supported for storage texel buffers, as specified by the VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT flag in VkFormatProperties::bufferFeatures returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-buffer-00934)~^~ -VALIDATION_ERROR_01a0074e~^~Y~^~Unknown~^~vkCreateBufferView~^~VUID-VkBufferViewCreateInfo-buffer-00935~^~core~^~The spec valid usage text states 'If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-buffer-00935)~^~ -VALIDATION_ERROR_01a01a01~^~Y~^~None~^~vkCreateBufferView~^~VUID-VkBufferViewCreateInfo-buffer-parameter~^~core~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-buffer-parameter)~^~implicit -VALIDATION_ERROR_01a09005~^~Y~^~Unknown~^~vkCreateBufferView~^~VUID-VkBufferViewCreateInfo-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-flags-zerobitmask)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_01a09201~^~Y~^~Unknown~^~vkCreateBufferView~^~VUID-VkBufferViewCreateInfo-format-parameter~^~core~^~The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-format-parameter)~^~implicit -VALIDATION_ERROR_01a1c40d~^~Y~^~Unknown~^~vkCreateBufferView~^~VUID-VkBufferViewCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_01a2b00b~^~Y~^~Unknown~^~vkCreateBufferView~^~VUID-VkBufferViewCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_01c00026~^~Y~^~None~^~vkCmdClearAttachments~^~VUID-VkClearAttachment-aspectMask-00019~^~core~^~The spec valid usage text states 'If aspectMask includes VK_IMAGE_ASPECT_COLOR_BIT, it must not include VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkClearAttachment-aspectMask-00019)~^~ -VALIDATION_ERROR_01c00028~^~Y~^~Unknown~^~vkCmdClearAttachments~^~VUID-VkClearAttachment-aspectMask-00020~^~core~^~The spec valid usage text states 'aspectMask must not include VK_IMAGE_ASPECT_METADATA_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkClearAttachment-aspectMask-00020)~^~ -VALIDATION_ERROR_01c0002a~^~N~^~Unknown~^~vkCmdClearAttachments~^~VUID-VkClearAttachment-clearValue-00021~^~core~^~The spec valid usage text states 'clearValue must be a valid VkClearValue union' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkClearAttachment-clearValue-00021)~^~ -VALIDATION_ERROR_01c00c01~^~Y~^~Unknown~^~vkCmdClearAttachments~^~VUID-VkClearAttachment-aspectMask-parameter~^~core~^~The spec valid usage text states 'aspectMask must be a valid combination of VkImageAspectFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkClearAttachment-aspectMask-parameter)~^~implicit -VALIDATION_ERROR_01c00c03~^~Y~^~Unknown~^~vkCmdClearAttachments~^~VUID-VkClearAttachment-aspectMask-requiredbitmask~^~core~^~The spec valid usage text states 'aspectMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkClearAttachment-aspectMask-requiredbitmask)~^~implicit -VALIDATION_ERROR_01e0002c~^~N~^~Unknown~^~vkCmdClearAttachments~^~VUID-VkClearDepthStencilValue-depth-00022~^~core~^~The spec valid usage text states 'depth must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkClearDepthStencilValue-depth-00022)~^~ -VALIDATION_ERROR_0200002e~^~N~^~Unknown~^~vkCmdClearAttachments~^~VUID-VkClearValue-depthStencil-00023~^~core~^~The spec valid usage text states 'depthStencil must be a valid VkClearDepthStencilValue structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkClearValue-depthStencil-00023)~^~ -VALIDATION_ERROR_02200009~^~Y~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-commonparent~^~core~^~The spec valid usage text states 'Each of indirectCommandsLayout, objectTable, sequencesCountBuffer, sequencesIndexBuffer, and targetCommandBuffer that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-commonparent)~^~implicit -VALIDATION_ERROR_02200a66~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-objectTable-01331~^~core~^~The spec valid usage text states 'The provided objectTable must include all objects referenced by the generation process.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-objectTable-01331)~^~ -VALIDATION_ERROR_02200a68~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsTokenCount-01332~^~core~^~The spec valid usage text states 'indirectCommandsTokenCount must match the indirectCommandsLayout's tokenCount.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsTokenCount-01332)~^~ -VALIDATION_ERROR_02200a6a~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-tokenType-01333~^~core~^~The spec valid usage text states 'The tokenType member of each entry in the pIndirectCommandsTokens array must match the values used at creation time of indirectCommandsLayout' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-tokenType-01333)~^~ -VALIDATION_ERROR_02200a6c~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01334~^~core~^~The spec valid usage text states 'If targetCommandBuffer is provided, it must have reserved command space.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01334)~^~ -VALIDATION_ERROR_02200a6e~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01335~^~core~^~The spec valid usage text states 'If targetCommandBuffer is provided, the objectTable must match the reservation's objectTable and must have had all referenced objects registered at reservation time.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01335)~^~ -VALIDATION_ERROR_02200a70~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01336~^~core~^~The spec valid usage text states 'If targetCommandBuffer is provided, the indirectCommandsLayout must match the reservation's indirectCommandsLayout.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01336)~^~ -VALIDATION_ERROR_02200a72~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01337~^~core~^~The spec valid usage text states 'If targetCommandBuffer is provided, the maxSequencesCount must not exceed the reservation's maxSequencesCount.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01337)~^~ -VALIDATION_ERROR_02200a74~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-01338~^~core~^~The spec valid usage text states 'If sequencesCountBuffer is used, its usage flag must have VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-01338)~^~ -VALIDATION_ERROR_02200a76~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-01339~^~core~^~The spec valid usage text states 'If sequencesCountBuffer is used, sequencesCountOffset must be aligned to VkDeviceGeneratedCommandsLimitsNVX::minSequenceCountBufferOffsetAlignment.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-01339)~^~ -VALIDATION_ERROR_02200a78~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-01340~^~core~^~The spec valid usage text states 'If sequencesIndexBuffer is used, its usage flag must have VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-01340)~^~ -VALIDATION_ERROR_02200a7a~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-01341~^~core~^~The spec valid usage text states 'If sequencesIndexBuffer is used, sequencesIndexOffset must be aligned to VkDeviceGeneratedCommandsLimitsNVX::minSequenceIndexBufferOffsetAlignment.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-01341)~^~ -VALIDATION_ERROR_0220b401~^~Y~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsLayout-parameter~^~core~^~The spec valid usage text states 'indirectCommandsLayout must be a valid VkIndirectCommandsLayoutNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsLayout-parameter)~^~implicit -VALIDATION_ERROR_0220b61b~^~Y~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsTokenCount-arraylength~^~core~^~The spec valid usage text states 'indirectCommandsTokenCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsTokenCount-arraylength)~^~implicit -VALIDATION_ERROR_0220d801~^~Y~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-objectTable-parameter~^~core~^~The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-objectTable-parameter)~^~implicit -VALIDATION_ERROR_02219401~^~Y~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-pIndirectCommandsTokens-parameter~^~core~^~The spec valid usage text states 'pIndirectCommandsTokens must be a valid pointer to an array of indirectCommandsTokenCount valid VkIndirectCommandsTokenNVX structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-pIndirectCommandsTokens-parameter)~^~implicit -VALIDATION_ERROR_0221c40d~^~Y~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-pNext-pNext)~^~implicit -VALIDATION_ERROR_0222b00b~^~Y~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sType-sType)~^~implicit -VALIDATION_ERROR_0222ba01~^~Y~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-parameter~^~core~^~The spec valid usage text states 'If sequencesCountBuffer is not VK_NULL_HANDLE, sequencesCountBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-parameter)~^~implicit -VALIDATION_ERROR_0222bc01~^~Y~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-parameter~^~core~^~The spec valid usage text states 'If sequencesIndexBuffer is not VK_NULL_HANDLE, sequencesIndexBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-parameter)~^~implicit -VALIDATION_ERROR_0222f601~^~Y~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-parameter~^~core~^~The spec valid usage text states 'If targetCommandBuffer is not NULL, targetCommandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-parameter)~^~implicit -VALIDATION_ERROR_02400009~^~Y~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-VkCmdReserveSpaceForCommandsInfoNVX-commonparent~^~core~^~The spec valid usage text states 'Both of indirectCommandsLayout, and objectTable must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-commonparent)~^~implicit -VALIDATION_ERROR_0240b401~^~Y~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-VkCmdReserveSpaceForCommandsInfoNVX-indirectCommandsLayout-parameter~^~core~^~The spec valid usage text states 'indirectCommandsLayout must be a valid VkIndirectCommandsLayoutNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-indirectCommandsLayout-parameter)~^~implicit -VALIDATION_ERROR_0240d801~^~Y~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-VkCmdReserveSpaceForCommandsInfoNVX-objectTable-parameter~^~core~^~The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-objectTable-parameter)~^~implicit -VALIDATION_ERROR_0241c40d~^~Y~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-VkCmdReserveSpaceForCommandsInfoNVX-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-pNext-pNext)~^~implicit -VALIDATION_ERROR_0242b00b~^~Y~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-VkCmdReserveSpaceForCommandsInfoNVX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-sType-sType)~^~implicit -VALIDATION_ERROR_02600058~^~N~^~Unknown~^~vkAllocateCommandBuffers~^~VUID-VkCommandBufferAllocateInfo-commandBufferCount-00044~^~core~^~The spec valid usage text states 'commandBufferCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferAllocateInfo-commandBufferCount-00044)~^~ -VALIDATION_ERROR_02602801~^~Y~^~None~^~vkAllocateCommandBuffers~^~VUID-VkCommandBufferAllocateInfo-commandPool-parameter~^~core~^~The spec valid usage text states 'commandPool must be a valid VkCommandPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferAllocateInfo-commandPool-parameter)~^~implicit -VALIDATION_ERROR_0260c001~^~Y~^~Unknown~^~vkAllocateCommandBuffers~^~VUID-VkCommandBufferAllocateInfo-level-parameter~^~core~^~The spec valid usage text states 'level must be a valid VkCommandBufferLevel value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferAllocateInfo-level-parameter)~^~implicit -VALIDATION_ERROR_0261c40d~^~Y~^~Unknown~^~vkAllocateCommandBuffers~^~VUID-VkCommandBufferAllocateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferAllocateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0262b00b~^~Y~^~Unknown~^~vkAllocateCommandBuffers~^~VUID-VkCommandBufferAllocateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferAllocateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0280006a~^~Y~^~SecondaryCommandBufferNullRenderpass~^~vkBeginCommandBuffer~^~VUID-VkCommandBufferBeginInfo-flags-00053~^~core~^~The spec valid usage text states 'If flags contains VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, the renderPass member of pInheritanceInfo must be a valid VkRenderPass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferBeginInfo-flags-00053)~^~ -VALIDATION_ERROR_0280006c~^~Y~^~Unknown~^~vkBeginCommandBuffer~^~VUID-VkCommandBufferBeginInfo-flags-00054~^~core~^~The spec valid usage text states 'If flags contains VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, the subpass member of pInheritanceInfo must be a valid subpass index within the renderPass member of pInheritanceInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferBeginInfo-flags-00054)~^~ -VALIDATION_ERROR_0280006e~^~Y~^~None~^~vkBeginCommandBuffer~^~VUID-VkCommandBufferBeginInfo-flags-00055~^~core~^~The spec valid usage text states 'If flags contains VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, the framebuffer member of pInheritanceInfo must be either VK_NULL_HANDLE, or a valid VkFramebuffer that is compatible with the renderPass member of pInheritanceInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferBeginInfo-flags-00055)~^~ -VALIDATION_ERROR_02809001~^~Y~^~Unknown~^~vkBeginCommandBuffer~^~VUID-VkCommandBufferBeginInfo-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkCommandBufferUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferBeginInfo-flags-parameter)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0281c40d~^~Y~^~Unknown~^~vkBeginCommandBuffer~^~VUID-VkCommandBufferBeginInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkDeviceGroupCommandBufferBeginInfoKHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferBeginInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0282b00b~^~Y~^~Unknown~^~vkBeginCommandBuffer~^~VUID-VkCommandBufferBeginInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferBeginInfo-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_02a00009~^~Y~^~Unknown~^~vkBeginCommandBuffer~^~VUID-VkCommandBufferInheritanceInfo-commonparent~^~core~^~The spec valid usage text states 'Both of framebuffer, and renderPass that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferInheritanceInfo-commonparent)~^~implicit -VALIDATION_ERROR_02a00070~^~Y~^~Unknown~^~vkBeginCommandBuffer~^~VUID-VkCommandBufferInheritanceInfo-occlusionQueryEnable-00056~^~core~^~The spec valid usage text states 'If the inherited queries feature is not enabled, occlusionQueryEnable must be VK_FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferInheritanceInfo-occlusionQueryEnable-00056)~^~ -VALIDATION_ERROR_02a00072~^~Y~^~Unknown~^~vkBeginCommandBuffer~^~VUID-VkCommandBufferInheritanceInfo-queryFlags-00057~^~core~^~The spec valid usage text states 'If the inherited queries feature is enabled, queryFlags must be a valid combination of VkQueryControlFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferInheritanceInfo-queryFlags-00057)~^~ -VALIDATION_ERROR_02a00074~^~N~^~Unknown~^~vkBeginCommandBuffer~^~VUID-VkCommandBufferInheritanceInfo-pipelineStatistics-00058~^~core~^~The spec valid usage text states 'If the pipeline statistics queries feature is not enabled, pipelineStatistics must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferInheritanceInfo-pipelineStatistics-00058)~^~ -VALIDATION_ERROR_02a1c40d~^~N~^~Unknown~^~vkBeginCommandBuffer~^~VUID-VkCommandBufferInheritanceInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferInheritanceInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_02a2b00b~^~N~^~Unknown~^~vkBeginCommandBuffer~^~VUID-VkCommandBufferInheritanceInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferInheritanceInfo-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_02c0004e~^~Y~^~Unknown~^~vkCreateCommandPool~^~VUID-VkCommandPoolCreateInfo-queueFamilyIndex-00039~^~core~^~The spec valid usage text states 'queueFamilyIndex must be the index of a queue family available in the calling command's device parameter' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandPoolCreateInfo-queueFamilyIndex-00039)~^~ -VALIDATION_ERROR_02c09001~^~Y~^~Unknown~^~vkCreateCommandPool~^~VUID-VkCommandPoolCreateInfo-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkCommandPoolCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandPoolCreateInfo-flags-parameter)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_02c1c40d~^~Y~^~Unknown~^~vkCreateCommandPool~^~VUID-VkCommandPoolCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandPoolCreateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_02c2b00b~^~Y~^~Unknown~^~vkCreateCommandPool~^~VUID-VkCommandPoolCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandPoolCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_02e00001~^~Y~^~Unknown~^~vkCreateImageView~^~VUID-VkComponentMapping-a-parameter~^~core~^~The spec valid usage text states 'a must be a valid VkComponentSwizzle value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComponentMapping-a-parameter)~^~implicit -VALIDATION_ERROR_02e01001~^~Y~^~Unknown~^~vkCreateImageView~^~VUID-VkComponentMapping-b-parameter~^~core~^~The spec valid usage text states 'b must be a valid VkComponentSwizzle value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComponentMapping-b-parameter)~^~implicit -VALIDATION_ERROR_02e09a01~^~Y~^~Unknown~^~vkCreateImageView~^~VUID-VkComponentMapping-g-parameter~^~core~^~The spec valid usage text states 'g must be a valid VkComponentSwizzle value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComponentMapping-g-parameter)~^~implicit -VALIDATION_ERROR_02e2a201~^~Y~^~Unknown~^~vkCreateImageView~^~VUID-VkComponentMapping-r-parameter~^~core~^~The spec valid usage text states 'r must be a valid VkComponentSwizzle value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComponentMapping-r-parameter)~^~implicit -VALIDATION_ERROR_03000009~^~Y~^~Unknown~^~vkCreateComputePipelines~^~VUID-VkComputePipelineCreateInfo-commonparent~^~core~^~The spec valid usage text states 'Both of basePipelineHandle, and layout that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-commonparent)~^~implicit -VALIDATION_ERROR_03000572~^~Y~^~None~^~vkCreateComputePipelines~^~VUID-VkComputePipelineCreateInfo-flags-00697~^~core~^~The spec valid usage text states 'If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineIndex is -1, basePipelineHandle must be a valid handle to a compute VkPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-flags-00697)~^~ -VALIDATION_ERROR_03000574~^~N~^~Unknown~^~vkCreateComputePipelines~^~VUID-VkComputePipelineCreateInfo-flags-00698~^~core~^~The spec valid usage text states 'If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineHandle is VK_NULL_HANDLE, basePipelineIndex must be a valid index into the calling command's pCreateInfos parameter' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-flags-00698)~^~ -VALIDATION_ERROR_03000576~^~N~^~Unknown~^~vkCreateComputePipelines~^~VUID-VkComputePipelineCreateInfo-flags-00699~^~core~^~The spec valid usage text states 'If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineIndex is not -1, basePipelineHandle must be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-flags-00699)~^~ -VALIDATION_ERROR_03000578~^~N~^~Unknown~^~vkCreateComputePipelines~^~VUID-VkComputePipelineCreateInfo-flags-00700~^~core~^~The spec valid usage text states 'If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineHandle is not VK_NULL_HANDLE, basePipelineIndex must be -1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-flags-00700)~^~ -VALIDATION_ERROR_0300057a~^~N~^~Unknown~^~vkCreateComputePipelines~^~VUID-VkComputePipelineCreateInfo-stage-00701~^~core~^~The spec valid usage text states 'The stage member of stage must be VK_SHADER_STAGE_COMPUTE_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-stage-00701)~^~ -VALIDATION_ERROR_0300057c~^~N~^~Unknown~^~vkCreateComputePipelines~^~VUID-VkComputePipelineCreateInfo-stage-00702~^~core~^~The spec valid usage text states 'The shader code for the entry point identified by stage and the rest of the state identified by this structure must adhere to the pipeline linking rules described in the Shader Interfaces chapter' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-stage-00702)~^~ -VALIDATION_ERROR_0300057e~^~N~^~Unknown~^~vkCreateComputePipelines~^~VUID-VkComputePipelineCreateInfo-layout-00703~^~core~^~The spec valid usage text states 'layout must be consistent with the layout of the compute shader specified in stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-layout-00703)~^~ +VALIDATION_ERROR_0142c001~^~Y~^~None~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-sharingMode-parameter~^~core~^~The spec valid usage text states 'sharingMode must be a valid VkSharingMode value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-sharingMode-parameter)~^~implicit +VALIDATION_ERROR_01430601~^~N~^~None~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-usage-parameter~^~core~^~The spec valid usage text states 'usage must be a valid combination of VkBufferUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-usage-parameter)~^~implicit +VALIDATION_ERROR_01430603~^~Y~^~None~^~VkBufferCreateInfo~^~VUID-VkBufferCreateInfo-usage-requiredbitmask~^~core~^~The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-usage-requiredbitmask)~^~implicit +VALIDATION_ERROR_01600182~^~Y~^~MiscImageLayerTests~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-bufferOffset-00193~^~!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter's format is not a depth/stencil format, then bufferOffset must be a multiple of the format's element size' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-00193)~^~ +VALIDATION_ERROR_01600184~^~Y~^~MiscImageLayerTests~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-bufferOffset-00194~^~core~^~The spec valid usage text states 'bufferOffset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-00194)~^~ +VALIDATION_ERROR_01600186~^~Y~^~MiscImageLayerTests~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-bufferRowLength-00195~^~core~^~The spec valid usage text states 'bufferRowLength must be 0, or greater than or equal to the width member of imageExtent' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferRowLength-00195)~^~ +VALIDATION_ERROR_01600188~^~Y~^~MiscImageLayerTests~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-bufferImageHeight-00196~^~core~^~The spec valid usage text states 'bufferImageHeight must be 0, or greater than or equal to the height member of imageExtent' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferImageHeight-00196)~^~ +VALIDATION_ERROR_0160018a~^~N~^~Unknown~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-imageOffset-00197~^~core~^~The spec valid usage text states 'imageOffset.x and (imageExtent.width + imageOffset.x) must both be greater than or equal to 0 and less than or equal to the image subresource width' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageOffset-00197)~^~ +VALIDATION_ERROR_0160018c~^~N~^~Unknown~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-imageOffset-00198~^~core~^~The spec valid usage text states 'imageOffset.y and (imageExtent.height + imageOffset.y) must both be greater than or equal to 0 and less than or equal to the image subresource height' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageOffset-00198)~^~ +VALIDATION_ERROR_0160018e~^~Y~^~None~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-srcImage-00199~^~core~^~The spec valid usage text states 'If the calling command's srcImage (vkCmdCopyImageToBuffer) or dstImage (vkCmdCopyBufferToImage) is of type VK_IMAGE_TYPE_1D, then imageOffset.y must be 0 and imageExtent.height must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-srcImage-00199)~^~ +VALIDATION_ERROR_01600190~^~N~^~Unknown~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-imageOffset-00200~^~core~^~The spec valid usage text states 'imageOffset.z and (imageExtent.depth + imageOffset.z) must both be greater than or equal to 0 and less than or equal to the image subresource depth' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageOffset-00200)~^~This VU has two distinct conditions and the implemented check looks at both, but there are two distinct test cases for this enum +VALIDATION_ERROR_01600192~^~Y~^~MiscImageLayerTests~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-srcImage-00201~^~core~^~The spec valid usage text states 'If the calling command's srcImage (vkCmdCopyImageToBuffer) or dstImage (vkCmdCopyBufferToImage) is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then imageOffset.z must be 0 and imageExtent.depth must be 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-srcImage-00201)~^~ +VALIDATION_ERROR_01600196~^~Y~^~ImageBufferCopyTests~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-bufferRowLength-00203~^~!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, bufferRowLength must be a multiple of the compressed texel block width' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferRowLength-00203)~^~ +VALIDATION_ERROR_01600198~^~Y~^~ImageBufferCopyTests~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-bufferImageHeight-00204~^~!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, bufferImageHeight must be a multiple of the compressed texel block height' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferImageHeight-00204)~^~ +VALIDATION_ERROR_0160019a~^~Y~^~ImageBufferCopyTests~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-imageOffset-00205~^~!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, all members of imageOffset must be a multiple of the corresponding dimensions of the compressed texel block' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageOffset-00205)~^~ +VALIDATION_ERROR_0160019c~^~Y~^~ImageBufferCopyTests~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-bufferOffset-00206~^~!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, bufferOffset must be a multiple of the compressed texel block size in bytes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-00206)~^~ +VALIDATION_ERROR_0160019e~^~Y~^~ImageBufferCopyTests~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-imageExtent-00207~^~!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, imageExtent.width must be a multiple of the compressed texel block width or (imageExtent.width + imageOffset.x) must equal the image subresource width' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageExtent-00207)~^~ +VALIDATION_ERROR_016001a0~^~Y~^~ImageBufferCopyTests~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-imageExtent-00208~^~!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, imageExtent.height must be a multiple of the compressed texel block height or (imageExtent.height + imageOffset.y) must equal the image subresource height' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageExtent-00208)~^~ +VALIDATION_ERROR_016001a2~^~Y~^~None~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-imageExtent-00209~^~!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, imageExtent.depth must be a multiple of the compressed texel block depth or (imageExtent.depth + imageOffset.z) must equal the image subresource depth' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageExtent-00209)~^~ +VALIDATION_ERROR_016001a6~^~Y~^~ImageBufferCopyTests~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-aspectMask-00211~^~core~^~The spec valid usage text states 'The aspectMask member of imageSubresource must specify aspects present in the calling command's VkImage parameter' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-aspectMask-00211)~^~ +VALIDATION_ERROR_016001a8~^~Y~^~ImageBufferCopyTests~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-aspectMask-00212~^~core~^~The spec valid usage text states 'The aspectMask member of imageSubresource must only have a single bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-aspectMask-00212)~^~ +VALIDATION_ERROR_016001aa~^~Y~^~None~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-baseArrayLayer-00213~^~core~^~The spec valid usage text states 'If the calling command's VkImage parameter is of VkImageType VK_IMAGE_TYPE_3D, the baseArrayLayer and layerCount members of imageSubresource must be 0 and 1, respectively' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-baseArrayLayer-00213)~^~ +VALIDATION_ERROR_016001ac~^~N~^~Unknown~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-None-00214~^~core~^~The spec valid usage text states 'When copying to the depth aspect of an image subresource, the data in the source buffer must be in the range [0,1]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-None-00214)~^~ +VALIDATION_ERROR_01600c2c~^~N~^~None~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-bufferOffset-01558~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter's format is not a depth/stencil format or a multi-planar format, then bufferOffset must be a multiple of the format's element size' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-01558)~^~ +VALIDATION_ERROR_01600c2e~^~N~^~None~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-bufferOffset-01559~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter's format is a multi-planar format, then bufferOffset must be a multiple of the element size of the compatible format for the format and the aspectMask of the imageSubresource as defined in features-formats-compatible-planes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-01559)~^~ +VALIDATION_ERROR_01600c30~^~N~^~None~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-aspectMask-01560~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter's format is a multi-planar format, then the aspectMask member of imageSubresource must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT (with VK_IMAGE_ASPECT_PLANE_2_BIT valid only for image formats with three planes)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-aspectMask-01560)~^~ +VALIDATION_ERROR_01600d8e~^~N~^~None~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-None-01735~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, or a single-plane, "_422" image format, bufferRowLength must be a multiple of the compressed texel block width' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-None-01735)~^~ +VALIDATION_ERROR_01600d90~^~N~^~None~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-None-01736~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, or a single-plane, "_422" image format, bufferImageHeight must be a multiple of the compressed texel block height' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-None-01736)~^~ +VALIDATION_ERROR_01600d92~^~N~^~None~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-None-01737~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, or a single-plane, "_422" image format, all members of imageOffset must be a multiple of the corresponding dimensions of the compressed texel block' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-None-01737)~^~ +VALIDATION_ERROR_01600d94~^~N~^~None~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-None-01738~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, or a single-plane, "_422" image format, bufferOffset must be a multiple of the compressed texel block size in bytes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-None-01738)~^~ +VALIDATION_ERROR_01600d96~^~N~^~None~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-None-01739~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, or a single-plane, "_422" image format, imageExtent.width must be a multiple of the compressed texel block width or (imageExtent.width + imageOffset.x) must equal the image subresource width' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-None-01739)~^~ +VALIDATION_ERROR_01600d98~^~N~^~None~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-None-01740~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, or a single-plane, "_422" image format, imageExtent.height must be a multiple of the compressed texel block height or (imageExtent.height + imageOffset.y) must equal the image subresource height' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-None-01740)~^~ +VALIDATION_ERROR_01600d9a~^~N~^~None~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-None-01741~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, or a single-plane, "_422" image format, imageExtent.depth must be a multiple of the compressed texel block depth or (imageExtent.depth + imageOffset.z) must equal the image subresource depth' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-None-01741)~^~ +VALIDATION_ERROR_0160aa01~^~N~^~Unknown~^~VkBufferImageCopy~^~VUID-VkBufferImageCopy-imageSubresource-parameter~^~core~^~The spec valid usage text states 'imageSubresource must be a valid VkImageSubresourceLayers structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageSubresource-parameter)~^~implicit +VALIDATION_ERROR_01800946~^~Y~^~InvalidBarriers~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-offset-01187~^~core~^~The spec valid usage text states 'offset must be less than the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-offset-01187)~^~ +VALIDATION_ERROR_01800948~^~N~^~Unknown~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-size-01188~^~core~^~The spec valid usage text states 'If size is not equal to VK_WHOLE_SIZE, size must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-size-01188)~^~ +VALIDATION_ERROR_0180094a~^~Y~^~InvalidBarriers~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-size-01189~^~core~^~The spec valid usage text states 'If size is not equal to VK_WHOLE_SIZE, size must be less than or equal to than the size of buffer minus offset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-size-01189)~^~ +VALIDATION_ERROR_0180094c~^~Y~^~InvalidBarrierQueueFamily~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01190~^~!(VK_VERSION_1_1,VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, srcQueueFamilyIndex and dstQueueFamilyIndex must both be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01190)~^~ +VALIDATION_ERROR_0180094e~^~Y~^~InvalidBarrierQueueFamilyWithMemExt~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01191~^~(VK_VERSION_1_1,VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, at least one of srcQueueFamilyIndex and dstQueueFamilyIndex must be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01191)~^~ +VALIDATION_ERROR_01800950~^~Y~^~InvalidBarrierQueueFamily~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01192~^~!(VK_VERSION_1_1,VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, srcQueueFamilyIndex and dstQueueFamilyIndex must either both be VK_QUEUE_FAMILY_IGNORED, or both be a valid queue family (see devsandqueues-queueprops)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01192)~^~ +VALIDATION_ERROR_01800952~^~Y~^~InvalidBarrierQueueFamilyWithMemExt~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01193~^~(VK_VERSION_1_1,VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, dstQueueFamilyIndex must also be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01193)~^~ +VALIDATION_ERROR_01800958~^~Y~^~InvalidBarrierQueueFamily~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01196~^~core~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, and srcQueueFamilyIndex and dstQueueFamilyIndex are not VK_QUEUE_FAMILY_IGNORED, at least one of them must be the same as the family of the queue that will execute this barrier' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01196)~^~ +VALIDATION_ERROR_01800dc6~^~Y~^~InvalidBarrierQueueFamilyWithMemExt~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01763~^~(VK_VERSION_1_1,VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, and one of srcQueueFamilyIndex and dstQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, the other must be VK_QUEUE_FAMILY_IGNORED or a special queue family reserved for external memory ownership transfers, as described in synchronization-queue-transfers.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01763)~^~ +VALIDATION_ERROR_01800dc8~^~Y~^~InvalidBarrierQueueFamilyWithMemExt~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01764~^~(VK_VERSION_1_1,VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in synchronization-queue-transfers.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01764)~^~ +VALIDATION_ERROR_01800dca~^~Y~^~InvalidBarrierQueueFamilyWithMemExt~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01765~^~(VK_VERSION_1_1,VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and dstQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in synchronization-queue-transfers.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01765)~^~ +VALIDATION_ERROR_01800f16~^~N~^~None~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01931~^~core~^~The spec valid usage text states 'If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01931)~^~ +VALIDATION_ERROR_01801a01~^~Y~^~Unknown~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-buffer-parameter~^~core~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-parameter)~^~implicit +VALIDATION_ERROR_01806801~^~Y~^~Unknown~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-dstAccessMask-parameter~^~core~^~The spec valid usage text states 'dstAccessMask must be a valid combination of VkAccessFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-dstAccessMask-parameter)~^~implicit +VALIDATION_ERROR_0181c40d~^~Y~^~Unknown~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0182b00b~^~N~^~Unknown~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0182c401~^~Y~^~Unknown~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-srcAccessMask-parameter~^~core~^~The spec valid usage text states 'srcAccessMask must be a valid combination of VkAccessFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-srcAccessMask-parameter)~^~implicit +VALIDATION_ERROR_01a0073a~^~N~^~Unknown~^~VkBufferViewCreateInfo~^~VUID-VkBufferViewCreateInfo-offset-00925~^~core~^~The spec valid usage text states 'offset must be less than the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-offset-00925)~^~ +VALIDATION_ERROR_01a0073c~^~N~^~Unknown~^~VkBufferViewCreateInfo~^~VUID-VkBufferViewCreateInfo-offset-00926~^~core~^~The spec valid usage text states 'offset must be a multiple of VkPhysicalDeviceLimits::minTexelBufferOffsetAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-offset-00926)~^~ +VALIDATION_ERROR_01a00740~^~N~^~Unknown~^~VkBufferViewCreateInfo~^~VUID-VkBufferViewCreateInfo-range-00928~^~core~^~The spec valid usage text states 'If range is not equal to VK_WHOLE_SIZE, range must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-range-00928)~^~ +VALIDATION_ERROR_01a00742~^~N~^~Unknown~^~VkBufferViewCreateInfo~^~VUID-VkBufferViewCreateInfo-range-00929~^~core~^~The spec valid usage text states 'If range is not equal to VK_WHOLE_SIZE, range must be a multiple of the element size of format' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-range-00929)~^~ +VALIDATION_ERROR_01a00744~^~N~^~Unknown~^~VkBufferViewCreateInfo~^~VUID-VkBufferViewCreateInfo-range-00930~^~core~^~The spec valid usage text states 'If range is not equal to VK_WHOLE_SIZE, range divided by the element size of format must be less than or equal to VkPhysicalDeviceLimits::maxTexelBufferElements' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-range-00930)~^~ +VALIDATION_ERROR_01a00746~^~N~^~Unknown~^~VkBufferViewCreateInfo~^~VUID-VkBufferViewCreateInfo-offset-00931~^~core~^~The spec valid usage text states 'If range is not equal to VK_WHOLE_SIZE, the sum of offset and range must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-offset-00931)~^~ +VALIDATION_ERROR_01a00748~^~Y~^~None~^~VkBufferViewCreateInfo~^~VUID-VkBufferViewCreateInfo-buffer-00932~^~core~^~The spec valid usage text states 'buffer must have been created with a usage value containing at least one of VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT or VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-buffer-00932)~^~ +VALIDATION_ERROR_01a0074a~^~N~^~Unknown~^~VkBufferViewCreateInfo~^~VUID-VkBufferViewCreateInfo-buffer-00933~^~core~^~The spec valid usage text states 'If buffer was created with usage containing VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT, format must be supported for uniform texel buffers, as specified by the VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT flag in VkFormatProperties::bufferFeatures returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-buffer-00933)~^~ +VALIDATION_ERROR_01a0074c~^~N~^~Unknown~^~VkBufferViewCreateInfo~^~VUID-VkBufferViewCreateInfo-buffer-00934~^~core~^~The spec valid usage text states 'If buffer was created with usage containing VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, format must be supported for storage texel buffers, as specified by the VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT flag in VkFormatProperties::bufferFeatures returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-buffer-00934)~^~ +VALIDATION_ERROR_01a0074e~^~Y~^~Unknown~^~VkBufferViewCreateInfo~^~VUID-VkBufferViewCreateInfo-buffer-00935~^~core~^~The spec valid usage text states 'If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-buffer-00935)~^~ +VALIDATION_ERROR_01a01a01~^~Y~^~None~^~VkBufferViewCreateInfo~^~VUID-VkBufferViewCreateInfo-buffer-parameter~^~core~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-buffer-parameter)~^~implicit +VALIDATION_ERROR_01a09005~^~Y~^~Unknown~^~VkBufferViewCreateInfo~^~VUID-VkBufferViewCreateInfo-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-flags-zerobitmask)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_01a09201~^~Y~^~Unknown~^~VkBufferViewCreateInfo~^~VUID-VkBufferViewCreateInfo-format-parameter~^~core~^~The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-format-parameter)~^~implicit +VALIDATION_ERROR_01a1c40d~^~Y~^~Unknown~^~VkBufferViewCreateInfo~^~VUID-VkBufferViewCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_01a2b00b~^~Y~^~Unknown~^~VkBufferViewCreateInfo~^~VUID-VkBufferViewCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferViewCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_01c00026~^~Y~^~None~^~VkClearAttachment~^~VUID-VkClearAttachment-aspectMask-00019~^~core~^~The spec valid usage text states 'If aspectMask includes VK_IMAGE_ASPECT_COLOR_BIT, it must not include VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkClearAttachment-aspectMask-00019)~^~ +VALIDATION_ERROR_01c00028~^~Y~^~Unknown~^~VkClearAttachment~^~VUID-VkClearAttachment-aspectMask-00020~^~core~^~The spec valid usage text states 'aspectMask must not include VK_IMAGE_ASPECT_METADATA_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkClearAttachment-aspectMask-00020)~^~ +VALIDATION_ERROR_01c0002a~^~N~^~Unknown~^~VkClearAttachment~^~VUID-VkClearAttachment-clearValue-00021~^~core~^~The spec valid usage text states 'clearValue must be a valid VkClearValue union' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkClearAttachment-clearValue-00021)~^~ +VALIDATION_ERROR_01c00c01~^~Y~^~Unknown~^~VkClearAttachment~^~VUID-VkClearAttachment-aspectMask-parameter~^~core~^~The spec valid usage text states 'aspectMask must be a valid combination of VkImageAspectFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkClearAttachment-aspectMask-parameter)~^~implicit +VALIDATION_ERROR_01c00c03~^~Y~^~Unknown~^~VkClearAttachment~^~VUID-VkClearAttachment-aspectMask-requiredbitmask~^~core~^~The spec valid usage text states 'aspectMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkClearAttachment-aspectMask-requiredbitmask)~^~implicit +VALIDATION_ERROR_01c00e22~^~N~^~None~^~VkClearAttachment~^~VUID-VkClearAttachment-commandBuffer-01809~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then the attachment to be cleared must not be a protected image.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkClearAttachment-commandBuffer-01809)~^~ +VALIDATION_ERROR_01c00e24~^~N~^~None~^~VkClearAttachment~^~VUID-VkClearAttachment-commandBuffer-01810~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, then the attachment to be cleared must not be an unprotected image.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkClearAttachment-commandBuffer-01810)~^~ +VALIDATION_ERROR_01e0002c~^~N~^~Unknown~^~VkClearDepthStencilValue~^~VUID-VkClearDepthStencilValue-depth-00022~^~(VK_EXT_depth_range_unrestricted)~^~The spec valid usage text states 'Unless the VK_EXT_depth_range_unrestricted extension is enabled depth must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkClearDepthStencilValue-depth-00022)~^~ +VALIDATION_ERROR_0200002e~^~N~^~Unknown~^~VkClearValue~^~VUID-VkClearValue-depthStencil-00023~^~core~^~The spec valid usage text states 'depthStencil must be a valid VkClearDepthStencilValue structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkClearValue-depthStencil-00023)~^~ +VALIDATION_ERROR_02200009~^~Y~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-commonparent~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'Each of indirectCommandsLayout, objectTable, sequencesCountBuffer, sequencesIndexBuffer, and targetCommandBuffer that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-commonparent)~^~implicit +VALIDATION_ERROR_02200a66~^~N~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-objectTable-01331~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'The provided objectTable must include all objects referenced by the generation process.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-objectTable-01331)~^~ +VALIDATION_ERROR_02200a68~^~N~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsTokenCount-01332~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'indirectCommandsTokenCount must match the indirectCommandsLayout's tokenCount.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsTokenCount-01332)~^~ +VALIDATION_ERROR_02200a6a~^~N~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-tokenType-01333~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'The tokenType member of each entry in the pIndirectCommandsTokens array must match the values used at creation time of indirectCommandsLayout' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-tokenType-01333)~^~ +VALIDATION_ERROR_02200a6c~^~N~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01334~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If targetCommandBuffer is provided, it must have reserved command space.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01334)~^~ +VALIDATION_ERROR_02200a6e~^~N~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01335~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If targetCommandBuffer is provided, the objectTable must match the reservation's objectTable and must have had all referenced objects registered at reservation time.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01335)~^~ +VALIDATION_ERROR_02200a70~^~N~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01336~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If targetCommandBuffer is provided, the indirectCommandsLayout must match the reservation's indirectCommandsLayout.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01336)~^~ +VALIDATION_ERROR_02200a72~^~N~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01337~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If targetCommandBuffer is provided, the maxSequencesCount must not exceed the reservation's maxSequencesCount.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01337)~^~ +VALIDATION_ERROR_02200a74~^~N~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-01338~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If sequencesCountBuffer is used, its usage flag must have VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-01338)~^~ +VALIDATION_ERROR_02200a76~^~N~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-01339~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If sequencesCountBuffer is used, sequencesCountOffset must be aligned to VkDeviceGeneratedCommandsLimitsNVX::minSequenceCountBufferOffsetAlignment.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-01339)~^~ +VALIDATION_ERROR_02200a78~^~N~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-01340~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If sequencesIndexBuffer is used, its usage flag must have VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-01340)~^~ +VALIDATION_ERROR_02200a7a~^~N~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-01341~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If sequencesIndexBuffer is used, sequencesIndexOffset must be aligned to VkDeviceGeneratedCommandsLimitsNVX::minSequenceIndexBufferOffsetAlignment.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-01341)~^~ +VALIDATION_ERROR_0220b401~^~Y~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsLayout-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'indirectCommandsLayout must be a valid VkIndirectCommandsLayoutNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsLayout-parameter)~^~implicit +VALIDATION_ERROR_0220b61b~^~Y~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsTokenCount-arraylength~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'indirectCommandsTokenCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsTokenCount-arraylength)~^~implicit +VALIDATION_ERROR_0220d801~^~Y~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-objectTable-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-objectTable-parameter)~^~implicit +VALIDATION_ERROR_02219401~^~Y~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-pIndirectCommandsTokens-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'pIndirectCommandsTokens must be a valid pointer to an array of indirectCommandsTokenCount valid VkIndirectCommandsTokenNVX structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-pIndirectCommandsTokens-parameter)~^~implicit +VALIDATION_ERROR_0221c40d~^~Y~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-pNext-pNext~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-pNext-pNext)~^~implicit +VALIDATION_ERROR_0222b00b~^~Y~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-sType-sType~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sType-sType)~^~implicit +VALIDATION_ERROR_0222ba01~^~Y~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If sequencesCountBuffer is not VK_NULL_HANDLE, sequencesCountBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-parameter)~^~implicit +VALIDATION_ERROR_0222bc01~^~Y~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If sequencesIndexBuffer is not VK_NULL_HANDLE, sequencesIndexBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-parameter)~^~implicit +VALIDATION_ERROR_0222f601~^~Y~^~Unknown~^~VkCmdProcessCommandsInfoNVX~^~VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If targetCommandBuffer is not NULL, targetCommandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-parameter)~^~implicit +VALIDATION_ERROR_02400009~^~Y~^~Unknown~^~VkCmdReserveSpaceForCommandsInfoNVX~^~VUID-VkCmdReserveSpaceForCommandsInfoNVX-commonparent~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'Both of indirectCommandsLayout, and objectTable must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-commonparent)~^~implicit +VALIDATION_ERROR_0240b401~^~Y~^~Unknown~^~VkCmdReserveSpaceForCommandsInfoNVX~^~VUID-VkCmdReserveSpaceForCommandsInfoNVX-indirectCommandsLayout-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'indirectCommandsLayout must be a valid VkIndirectCommandsLayoutNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-indirectCommandsLayout-parameter)~^~implicit +VALIDATION_ERROR_0240d801~^~Y~^~Unknown~^~VkCmdReserveSpaceForCommandsInfoNVX~^~VUID-VkCmdReserveSpaceForCommandsInfoNVX-objectTable-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-objectTable-parameter)~^~implicit +VALIDATION_ERROR_0241c40d~^~Y~^~Unknown~^~VkCmdReserveSpaceForCommandsInfoNVX~^~VUID-VkCmdReserveSpaceForCommandsInfoNVX-pNext-pNext~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-pNext-pNext)~^~implicit +VALIDATION_ERROR_0242b00b~^~Y~^~Unknown~^~VkCmdReserveSpaceForCommandsInfoNVX~^~VUID-VkCmdReserveSpaceForCommandsInfoNVX-sType-sType~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-sType-sType)~^~implicit +VALIDATION_ERROR_02600058~^~N~^~Unknown~^~VkCommandBufferAllocateInfo~^~VUID-VkCommandBufferAllocateInfo-commandBufferCount-00044~^~core~^~The spec valid usage text states 'commandBufferCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferAllocateInfo-commandBufferCount-00044)~^~ +VALIDATION_ERROR_02602801~^~Y~^~None~^~VkCommandBufferAllocateInfo~^~VUID-VkCommandBufferAllocateInfo-commandPool-parameter~^~core~^~The spec valid usage text states 'commandPool must be a valid VkCommandPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferAllocateInfo-commandPool-parameter)~^~implicit +VALIDATION_ERROR_0260c001~^~Y~^~Unknown~^~VkCommandBufferAllocateInfo~^~VUID-VkCommandBufferAllocateInfo-level-parameter~^~core~^~The spec valid usage text states 'level must be a valid VkCommandBufferLevel value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferAllocateInfo-level-parameter)~^~implicit +VALIDATION_ERROR_0261c40d~^~Y~^~Unknown~^~VkCommandBufferAllocateInfo~^~VUID-VkCommandBufferAllocateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferAllocateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0262b00b~^~Y~^~Unknown~^~VkCommandBufferAllocateInfo~^~VUID-VkCommandBufferAllocateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferAllocateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0280006a~^~Y~^~SecondaryCommandBufferNullRenderpass~^~VkCommandBufferBeginInfo~^~VUID-VkCommandBufferBeginInfo-flags-00053~^~core~^~The spec valid usage text states 'If flags contains VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, the renderPass member of pInheritanceInfo must be a valid VkRenderPass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferBeginInfo-flags-00053)~^~ +VALIDATION_ERROR_0280006c~^~Y~^~Unknown~^~VkCommandBufferBeginInfo~^~VUID-VkCommandBufferBeginInfo-flags-00054~^~core~^~The spec valid usage text states 'If flags contains VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, the subpass member of pInheritanceInfo must be a valid subpass index within the renderPass member of pInheritanceInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferBeginInfo-flags-00054)~^~ +VALIDATION_ERROR_0280006e~^~Y~^~None~^~VkCommandBufferBeginInfo~^~VUID-VkCommandBufferBeginInfo-flags-00055~^~core~^~The spec valid usage text states 'If flags contains VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, the framebuffer member of pInheritanceInfo must be either VK_NULL_HANDLE, or a valid VkFramebuffer that is compatible with the renderPass member of pInheritanceInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferBeginInfo-flags-00055)~^~ +VALIDATION_ERROR_02809001~^~Y~^~Unknown~^~VkCommandBufferBeginInfo~^~VUID-VkCommandBufferBeginInfo-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkCommandBufferUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferBeginInfo-flags-parameter)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0281c40d~^~Y~^~Unknown~^~VkCommandBufferBeginInfo~^~VUID-VkCommandBufferBeginInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkDeviceGroupCommandBufferBeginInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferBeginInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0282b00b~^~Y~^~Unknown~^~VkCommandBufferBeginInfo~^~VUID-VkCommandBufferBeginInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferBeginInfo-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_02a00009~^~Y~^~Unknown~^~VkCommandBufferInheritanceInfo~^~VUID-VkCommandBufferInheritanceInfo-commonparent~^~core~^~The spec valid usage text states 'Both of framebuffer, and renderPass that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferInheritanceInfo-commonparent)~^~implicit +VALIDATION_ERROR_02a00070~^~Y~^~Unknown~^~VkCommandBufferInheritanceInfo~^~VUID-VkCommandBufferInheritanceInfo-occlusionQueryEnable-00056~^~core~^~The spec valid usage text states 'If the inherited queries feature is not enabled, occlusionQueryEnable must be VK_FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferInheritanceInfo-occlusionQueryEnable-00056)~^~ +VALIDATION_ERROR_02a00072~^~Y~^~Unknown~^~VkCommandBufferInheritanceInfo~^~VUID-VkCommandBufferInheritanceInfo-queryFlags-00057~^~core~^~The spec valid usage text states 'If the inherited queries feature is enabled, queryFlags must be a valid combination of VkQueryControlFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferInheritanceInfo-queryFlags-00057)~^~ +VALIDATION_ERROR_02a00074~^~N~^~Unknown~^~VkCommandBufferInheritanceInfo~^~VUID-VkCommandBufferInheritanceInfo-pipelineStatistics-00058~^~core~^~The spec valid usage text states 'If the pipeline statistics queries feature is not enabled, pipelineStatistics must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferInheritanceInfo-pipelineStatistics-00058)~^~ +VALIDATION_ERROR_02a1c40d~^~N~^~Unknown~^~VkCommandBufferInheritanceInfo~^~VUID-VkCommandBufferInheritanceInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferInheritanceInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_02a2b00b~^~N~^~Unknown~^~VkCommandBufferInheritanceInfo~^~VUID-VkCommandBufferInheritanceInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferInheritanceInfo-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_02c0004e~^~Y~^~Unknown~^~VkCommandPoolCreateInfo~^~VUID-VkCommandPoolCreateInfo-queueFamilyIndex-00039~^~core~^~The spec valid usage text states 'queueFamilyIndex must be the index of a queue family available in the calling command's device parameter' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandPoolCreateInfo-queueFamilyIndex-00039)~^~ +VALIDATION_ERROR_02c09001~^~Y~^~Unknown~^~VkCommandPoolCreateInfo~^~VUID-VkCommandPoolCreateInfo-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkCommandPoolCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandPoolCreateInfo-flags-parameter)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_02c1c40d~^~Y~^~Unknown~^~VkCommandPoolCreateInfo~^~VUID-VkCommandPoolCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandPoolCreateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_02c2b00b~^~Y~^~Unknown~^~VkCommandPoolCreateInfo~^~VUID-VkCommandPoolCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandPoolCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_02e00001~^~Y~^~Unknown~^~VkComponentMapping~^~VUID-VkComponentMapping-a-parameter~^~core~^~The spec valid usage text states 'a must be a valid VkComponentSwizzle value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComponentMapping-a-parameter)~^~implicit +VALIDATION_ERROR_02e01001~^~Y~^~Unknown~^~VkComponentMapping~^~VUID-VkComponentMapping-b-parameter~^~core~^~The spec valid usage text states 'b must be a valid VkComponentSwizzle value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComponentMapping-b-parameter)~^~implicit +VALIDATION_ERROR_02e09a01~^~Y~^~Unknown~^~VkComponentMapping~^~VUID-VkComponentMapping-g-parameter~^~core~^~The spec valid usage text states 'g must be a valid VkComponentSwizzle value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComponentMapping-g-parameter)~^~implicit +VALIDATION_ERROR_02e2a201~^~Y~^~Unknown~^~VkComponentMapping~^~VUID-VkComponentMapping-r-parameter~^~core~^~The spec valid usage text states 'r must be a valid VkComponentSwizzle value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComponentMapping-r-parameter)~^~implicit +VALIDATION_ERROR_03000009~^~Y~^~Unknown~^~VkComputePipelineCreateInfo~^~VUID-VkComputePipelineCreateInfo-commonparent~^~core~^~The spec valid usage text states 'Both of basePipelineHandle, and layout that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-commonparent)~^~implicit +VALIDATION_ERROR_03000572~^~Y~^~None~^~VkComputePipelineCreateInfo~^~VUID-VkComputePipelineCreateInfo-flags-00697~^~core~^~The spec valid usage text states 'If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineIndex is -1, basePipelineHandle must be a valid handle to a compute VkPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-flags-00697)~^~ +VALIDATION_ERROR_03000574~^~N~^~Unknown~^~VkComputePipelineCreateInfo~^~VUID-VkComputePipelineCreateInfo-flags-00698~^~core~^~The spec valid usage text states 'If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineHandle is VK_NULL_HANDLE, basePipelineIndex must be a valid index into the calling command's pCreateInfos parameter' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-flags-00698)~^~ +VALIDATION_ERROR_03000576~^~N~^~Unknown~^~VkComputePipelineCreateInfo~^~VUID-VkComputePipelineCreateInfo-flags-00699~^~core~^~The spec valid usage text states 'If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineIndex is not -1, basePipelineHandle must be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-flags-00699)~^~ +VALIDATION_ERROR_03000578~^~N~^~Unknown~^~VkComputePipelineCreateInfo~^~VUID-VkComputePipelineCreateInfo-flags-00700~^~core~^~The spec valid usage text states 'If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineHandle is not VK_NULL_HANDLE, basePipelineIndex must be -1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-flags-00700)~^~ +VALIDATION_ERROR_0300057a~^~N~^~Unknown~^~VkComputePipelineCreateInfo~^~VUID-VkComputePipelineCreateInfo-stage-00701~^~core~^~The spec valid usage text states 'The stage member of stage must be VK_SHADER_STAGE_COMPUTE_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-stage-00701)~^~ +VALIDATION_ERROR_0300057c~^~N~^~Unknown~^~VkComputePipelineCreateInfo~^~VUID-VkComputePipelineCreateInfo-stage-00702~^~core~^~The spec valid usage text states 'The shader code for the entry point identified by stage and the rest of the state identified by this structure must adhere to the pipeline linking rules described in the Shader Interfaces chapter' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-stage-00702)~^~ +VALIDATION_ERROR_0300057e~^~N~^~Unknown~^~VkComputePipelineCreateInfo~^~VUID-VkComputePipelineCreateInfo-layout-00703~^~core~^~The spec valid usage text states 'layout must be consistent with the layout of the compute shader specified in stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-layout-00703)~^~ VALIDATION_ERROR_03000d2e~^~N~^~None~^~VkComputePipelineCreateInfo~^~VUID-VkComputePipelineCreateInfo-layout-01687~^~core~^~The spec valid usage text states 'The number of resources in layout accessible to the compute shader stage must be less than or equal to VkPhysicalDeviceLimits::maxPerStageResources' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-layout-01687)~^~ -VALIDATION_ERROR_03009001~^~Y~^~Unknown~^~vkCreateComputePipelines~^~VUID-VkComputePipelineCreateInfo-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkPipelineCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-flags-parameter)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0300be01~^~Y~^~None~^~vkCreateComputePipelines~^~VUID-VkComputePipelineCreateInfo-layout-parameter~^~core~^~The spec valid usage text states 'layout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-layout-parameter)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0301c40d~^~Y~^~Unknown~^~vkCreateComputePipelines~^~VUID-VkComputePipelineCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-pNext-pNext)~^~implicit, TBD parameter validation layer. -VALIDATION_ERROR_0302b00b~^~N~^~Unknown~^~vkCreateComputePipelines~^~VUID-VkComputePipelineCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0302d801~^~N~^~Unknown~^~vkCreateComputePipelines~^~VUID-VkComputePipelineCreateInfo-stage-parameter~^~core~^~The spec valid usage text states 'stage must be a valid VkPipelineShaderStageCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-stage-parameter)~^~implicit -VALIDATION_ERROR_03200009~^~Y~^~Unknown~^~vkUpdateDescriptorSets~^~VUID-VkCopyDescriptorSet-commonparent~^~core~^~The spec valid usage text states 'Both of dstSet, and srcSet must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-commonparent)~^~implicit -VALIDATION_ERROR_032002b2~^~Y~^~Unknown~^~vkUpdateDescriptorSets~^~VUID-VkCopyDescriptorSet-srcBinding-00345~^~core~^~The spec valid usage text states 'srcBinding must be a valid binding within srcSet' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-srcBinding-00345)~^~ -VALIDATION_ERROR_032002b4~^~Y~^~Unknown~^~vkUpdateDescriptorSets~^~VUID-VkCopyDescriptorSet-srcArrayElement-00346~^~core~^~The spec valid usage text states 'The sum of srcArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding specified by srcBinding, and all applicable consecutive bindings, as described by consecutive binding updates' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-srcArrayElement-00346)~^~ -VALIDATION_ERROR_032002b6~^~Y~^~Unknown~^~vkUpdateDescriptorSets~^~VUID-VkCopyDescriptorSet-dstBinding-00347~^~core~^~The spec valid usage text states 'dstBinding must be a valid binding within dstSet' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-dstBinding-00347)~^~ -VALIDATION_ERROR_032002b8~^~Y~^~Unknown~^~vkUpdateDescriptorSets~^~VUID-VkCopyDescriptorSet-dstArrayElement-00348~^~core~^~The spec valid usage text states 'The sum of dstArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding specified by dstBinding, and all applicable consecutive bindings, as described by consecutive binding updates' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-dstArrayElement-00348)~^~ -VALIDATION_ERROR_032002ba~^~Y~^~Unknown~^~vkUpdateDescriptorSets~^~VUID-VkCopyDescriptorSet-srcSet-00349~^~core~^~The spec valid usage text states 'If srcSet is equal to dstSet, then the source and destination ranges of descriptors must not overlap, where the ranges may include array elements from consecutive bindings as described by consecutive binding updates' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-srcSet-00349)~^~ -VALIDATION_ERROR_03207601~^~Y~^~None~^~vkUpdateDescriptorSets~^~VUID-VkCopyDescriptorSet-dstSet-parameter~^~core~^~The spec valid usage text states 'dstSet must be a valid VkDescriptorSet handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-dstSet-parameter)~^~implicit -VALIDATION_ERROR_0321c40d~^~Y~^~Unknown~^~vkUpdateDescriptorSets~^~VUID-VkCopyDescriptorSet-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0322b00b~^~N~^~Unknown~^~vkUpdateDescriptorSets~^~VUID-VkCopyDescriptorSet-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0322d201~^~Y~^~None~^~vkUpdateDescriptorSets~^~VUID-VkCopyDescriptorSet-srcSet-parameter~^~core~^~The spec valid usage text states 'srcSet must be a valid VkDescriptorSet handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-srcSet-parameter)~^~implicit -VALIDATION_ERROR_0340009e~^~N~^~Unknown~^~vkQueueSubmit~^~VUID-VkD3D12FenceSubmitInfoKHR-waitSemaphoreValuesCount-00079~^~core~^~The spec valid usage text states 'waitSemaphoreValuesCount must be the same value as VkSubmitInfo::waitSemaphoreCount, where VkSubmitInfo is in the pNext chain of this VkD3D12FenceSubmitInfoKHR structure.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-waitSemaphoreValuesCount-00079)~^~ -VALIDATION_ERROR_034000a0~^~N~^~Unknown~^~vkQueueSubmit~^~VUID-VkD3D12FenceSubmitInfoKHR-signalSemaphoreValuesCount-00080~^~core~^~The spec valid usage text states 'signalSemaphoreValuesCount must be the same value as VkSubmitInfo::signalSemaphoreCount, where VkSubmitInfo is in the pNext chain of this VkD3D12FenceSubmitInfoKHR structure.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-signalSemaphoreValuesCount-00080)~^~ -VALIDATION_ERROR_03423201~^~N~^~Unknown~^~vkQueueSubmit~^~VUID-VkD3D12FenceSubmitInfoKHR-pSignalSemaphoreValues-parameter~^~core~^~The spec valid usage text states 'If signalSemaphoreValuesCount is not 0, and pSignalSemaphoreValues is not NULL, pSignalSemaphoreValues must be a valid pointer to an array of signalSemaphoreValuesCount uint64_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-pSignalSemaphoreValues-parameter)~^~implicit -VALIDATION_ERROR_03427401~^~N~^~Unknown~^~vkQueueSubmit~^~VUID-VkD3D12FenceSubmitInfoKHR-pWaitSemaphoreValues-parameter~^~core~^~The spec valid usage text states 'If waitSemaphoreValuesCount is not 0, and pWaitSemaphoreValues is not NULL, pWaitSemaphoreValues must be a valid pointer to an array of waitSemaphoreValuesCount uint64_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-pWaitSemaphoreValues-parameter)~^~implicit -VALIDATION_ERROR_0342b00b~^~N~^~Unknown~^~vkQueueSubmit~^~VUID-VkD3D12FenceSubmitInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_0361a801~^~Y~^~Unknown~^~vkCmdDebugMarkerBeginEXT~^~VUID-VkDebugMarkerMarkerInfoEXT-pMarkerName-parameter~^~core~^~The spec valid usage text states 'pMarkerName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerMarkerInfoEXT-pMarkerName-parameter)~^~implicit -VALIDATION_ERROR_0361c40d~^~Y~^~Unknown~^~vkCmdDebugMarkerBeginEXT~^~VUID-VkDebugMarkerMarkerInfoEXT-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerMarkerInfoEXT-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0362b00b~^~Y~^~Unknown~^~vkCmdDebugMarkerBeginEXT~^~VUID-VkDebugMarkerMarkerInfoEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerMarkerInfoEXT-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_03800ba4~^~N~^~None~^~VkDebugMarkerObjectNameInfoEXT~^~VUID-VkDebugMarkerObjectNameInfoEXT-objectType-01490~^~core~^~The spec valid usage text states 'objectType must not be VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-objectType-01490)~^~ -VALIDATION_ERROR_03800ba6~^~N~^~None~^~VkDebugMarkerObjectNameInfoEXT~^~VUID-VkDebugMarkerObjectNameInfoEXT-object-01491~^~core~^~The spec valid usage text states 'object must not be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-object-01491)~^~ -VALIDATION_ERROR_03800ba8~^~N~^~None~^~VkDebugMarkerObjectNameInfoEXT~^~VUID-VkDebugMarkerObjectNameInfoEXT-object-01492~^~core~^~The spec valid usage text states 'object must be a Vulkan object of the type associated with objectType as defined in VkDebugReportObjectTypeEXT and Vulkan Handle Relationship.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-object-01492)~^~ -VALIDATION_ERROR_0380da01~^~Y~^~Unknown~^~vkDebugMarkerSetObjectNameEXT~^~VUID-VkDebugMarkerObjectNameInfoEXT-objectType-parameter~^~core~^~The spec valid usage text states 'objectType must be a valid VkDebugReportObjectTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-objectType-parameter)~^~implicit -VALIDATION_ERROR_0381c40d~^~Y~^~Unknown~^~vkDebugMarkerSetObjectNameEXT~^~VUID-VkDebugMarkerObjectNameInfoEXT-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0381ce01~^~Y~^~Unknown~^~vkDebugMarkerSetObjectNameEXT~^~VUID-VkDebugMarkerObjectNameInfoEXT-pObjectName-parameter~^~core~^~The spec valid usage text states 'pObjectName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-pObjectName-parameter)~^~implicit -VALIDATION_ERROR_0382b00b~^~Y~^~Unknown~^~vkDebugMarkerSetObjectNameEXT~^~VUID-VkDebugMarkerObjectNameInfoEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_03a00baa~^~N~^~None~^~VkDebugMarkerObjectTagInfoEXT~^~VUID-VkDebugMarkerObjectTagInfoEXT-objectType-01493~^~core~^~The spec valid usage text states 'objectType must not be VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-objectType-01493)~^~ -VALIDATION_ERROR_03a00bac~^~N~^~None~^~VkDebugMarkerObjectTagInfoEXT~^~VUID-VkDebugMarkerObjectTagInfoEXT-object-01494~^~core~^~The spec valid usage text states 'object must not be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-object-01494)~^~ -VALIDATION_ERROR_03a00bae~^~N~^~None~^~VkDebugMarkerObjectTagInfoEXT~^~VUID-VkDebugMarkerObjectTagInfoEXT-object-01495~^~core~^~The spec valid usage text states 'object must be a Vulkan object of the type associated with objectType as defined in VkDebugReportObjectTypeEXT and Vulkan Handle Relationship.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-object-01495)~^~ -VALIDATION_ERROR_03a0da01~^~Y~^~Unknown~^~vkDebugMarkerSetObjectTagEXT~^~VUID-VkDebugMarkerObjectTagInfoEXT-objectType-parameter~^~core~^~The spec valid usage text states 'objectType must be a valid VkDebugReportObjectTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-objectType-parameter)~^~implicit -VALIDATION_ERROR_03a1c40d~^~Y~^~Unknown~^~vkDebugMarkerSetObjectTagEXT~^~VUID-VkDebugMarkerObjectTagInfoEXT-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_03a25a01~^~Y~^~Unknown~^~vkDebugMarkerSetObjectTagEXT~^~VUID-VkDebugMarkerObjectTagInfoEXT-pTag-parameter~^~core~^~The spec valid usage text states 'pTag must be a valid pointer to an array of tagSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-pTag-parameter)~^~implicit -VALIDATION_ERROR_03a2b00b~^~Y~^~Unknown~^~vkDebugMarkerSetObjectTagEXT~^~VUID-VkDebugMarkerObjectTagInfoEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_03a2f41b~^~Y~^~Unknown~^~vkDebugMarkerSetObjectTagEXT~^~VUID-VkDebugMarkerObjectTagInfoEXT-tagSize-arraylength~^~core~^~The spec valid usage text states 'tagSize must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-tagSize-arraylength)~^~implicit -VALIDATION_ERROR_03c00ad2~^~N~^~Unknown~^~vkCreateDebugReportCallbackEXT~^~VUID-VkDebugReportCallbackCreateInfoEXT-pfnCallback-01385~^~core~^~The spec valid usage text states 'pfnCallback must be a valid PFN_vkDebugReportCallbackEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugReportCallbackCreateInfoEXT-pfnCallback-01385)~^~ -VALIDATION_ERROR_03c00bb0~^~N~^~None~^~VkDebugReportCallbackCreateInfoEXT~^~VUID-VkDebugReportCallbackCreateInfoEXT-object-01496~^~core~^~The spec valid usage text states 'object must be a Vulkan object or VK_NULL_HANDLE.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugReportCallbackCreateInfoEXT-object-01496)~^~ -VALIDATION_ERROR_03c00bb2~^~N~^~None~^~VkDebugReportCallbackCreateInfoEXT~^~VUID-VkDebugReportCallbackCreateInfoEXT-objectType-01497~^~core~^~The spec valid usage text states 'If objectType is not VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT and object is not VK_NULL_HANDLE, object must be a Vulkan object of the corresponding type associated with objectType as defined in VkDebugReportObjectTypeEXT and Vulkan Handle Relationship.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugReportCallbackCreateInfoEXT-objectType-01497)~^~ -VALIDATION_ERROR_03c09001~^~Y~^~Unknown~^~vkCreateDebugReportCallbackEXT~^~VUID-VkDebugReportCallbackCreateInfoEXT-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkDebugReportFlagBitsEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugReportCallbackCreateInfoEXT-flags-parameter)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_03c1c40d~^~Y~^~Unknown~^~vkCreateDebugReportCallbackEXT~^~VUID-VkDebugReportCallbackCreateInfoEXT-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugReportCallbackCreateInfoEXT-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_03c2b00b~^~Y~^~Unknown~^~vkCreateDebugReportCallbackEXT~^~VUID-VkDebugReportCallbackCreateInfoEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugReportCallbackCreateInfoEXT-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_03e00732~^~N~^~Unknown~^~vkCreateBuffer~^~VUID-VkDedicatedAllocationBufferCreateInfoNV-dedicatedAllocation-00921~^~core~^~The spec valid usage text states 'If dedicatedAllocation is VK_TRUE, VkBufferCreateInfo::flags must not include VK_BUFFER_CREATE_SPARSE_BINDING_BIT, VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT, or VK_BUFFER_CREATE_SPARSE_ALIASED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationBufferCreateInfoNV-dedicatedAllocation-00921)~^~ -VALIDATION_ERROR_03e2b00b~^~N~^~Unknown~^~vkCreateBuffer~^~VUID-VkDedicatedAllocationBufferCreateInfoNV-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationBufferCreateInfoNV-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_040007c4~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkDedicatedAllocationImageCreateInfoNV-dedicatedAllocation-00994~^~core~^~The spec valid usage text states 'If dedicatedAllocation is VK_TRUE, VkImageCreateInfo::flags must not include VK_IMAGE_CREATE_SPARSE_BINDING_BIT, VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, or VK_IMAGE_CREATE_SPARSE_ALIASED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationImageCreateInfoNV-dedicatedAllocation-00994)~^~ -VALIDATION_ERROR_0402b00b~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkDedicatedAllocationImageCreateInfoNV-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationImageCreateInfoNV-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_04200009~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-commonparent~^~core~^~The spec valid usage text states 'Both of buffer, and image that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-commonparent)~^~implicit -VALIDATION_ERROR_04200512~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00649~^~core~^~The spec valid usage text states 'At least one of image and buffer must be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00649)~^~ -VALIDATION_ERROR_04200514~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00650~^~core~^~The spec valid usage text states 'If image is not VK_NULL_HANDLE, the image must have been created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00650)~^~ -VALIDATION_ERROR_04200516~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00651~^~core~^~The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, the buffer must have been created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00651)~^~ -VALIDATION_ERROR_04200518~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00652~^~core~^~The spec valid usage text states 'If image is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00652)~^~ -VALIDATION_ERROR_0420051a~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00653~^~core~^~The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00653)~^~ -VALIDATION_ERROR_0420051c~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00654~^~(VK_KHR_external_memory_win32,VK_KHR_external_memory_fd)~^~The spec valid usage text states 'If image is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation, the memory being imported must also be a dedicated image allocation and image must be identical to the image associated with the imported memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00654)~^~ -VALIDATION_ERROR_0420051e~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00655~^~(VK_KHR_external_memory_win32,VK_KHR_external_memory_fd)~^~The spec valid usage text states 'If buffer is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation, the memory being imported must also be a dedicated buffer allocation and buffer must be identical to the buffer associated with the imported memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00655)~^~ -VALIDATION_ERROR_04201a01~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-parameter~^~core~^~The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-parameter)~^~implicit -VALIDATION_ERROR_0420a001~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-parameter~^~core~^~The spec valid usage text states 'If image is not VK_NULL_HANDLE, image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-parameter)~^~implicit -VALIDATION_ERROR_0422b00b~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_044002a8~^~Y~^~DSBufferInfoErrors~^~vkUpdateDescriptorSets~^~VUID-VkDescriptorBufferInfo-offset-00340~^~core~^~The spec valid usage text states 'offset must be less than the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorBufferInfo-offset-00340)~^~ -VALIDATION_ERROR_044002aa~^~Y~^~DSBufferInfoErrors~^~vkUpdateDescriptorSets~^~VUID-VkDescriptorBufferInfo-range-00341~^~core~^~The spec valid usage text states 'If range is not equal to VK_WHOLE_SIZE, range must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorBufferInfo-range-00341)~^~ -VALIDATION_ERROR_044002ac~^~Y~^~DSBufferInfoErrors~^~vkUpdateDescriptorSets~^~VUID-VkDescriptorBufferInfo-range-00342~^~core~^~The spec valid usage text states 'If range is not equal to VK_WHOLE_SIZE, range must be less than or equal to the size of buffer minus offset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorBufferInfo-range-00342)~^~ -VALIDATION_ERROR_04401a01~^~Y~^~Unknown~^~vkUpdateDescriptorSets~^~VUID-VkDescriptorBufferInfo-buffer-parameter~^~core~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorBufferInfo-buffer-parameter)~^~implicit -VALIDATION_ERROR_04600009~^~Y~^~Unknown~^~vkUpdateDescriptorSets~^~VUID-VkDescriptorImageInfo-commonparent~^~core~^~The spec valid usage text states 'Both of imageView, and sampler that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorImageInfo-commonparent)~^~implicit -VALIDATION_ERROR_046002ae~^~Y~^~Maint1BindingSliceOf3DImage~^~vkUpdateDescriptorSets~^~VUID-VkDescriptorImageInfo-imageView-00343~^~(VK_KHR_maintenance1)~^~The spec valid usage text states 'imageView must not be 2D or 2D array image view created from a 3D image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorImageInfo-imageView-00343)~^~ -VALIDATION_ERROR_046002b0~^~Y~^~Unknown~^~vkUpdateDescriptorSets~^~VUID-VkDescriptorImageInfo-imageLayout-00344~^~core~^~The spec valid usage text states 'imageLayout must match the actual VkImageLayout of each subresource accessible from imageView at the time this descriptor is accessed' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorImageInfo-imageLayout-00344)~^~ -VALIDATION_ERROR_04600c36~^~N~^~None~^~VkDescriptorImageInfo~^~VUID-VkDescriptorImageInfo-sampler-01563~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If sampler is used and enables sampler Y'CBCR conversion:' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorImageInfo-sampler-01563)~^~ -VALIDATION_ERROR_04600c38~^~N~^~None~^~VkDescriptorImageInfo~^~VUID-VkDescriptorImageInfo-sampler-01564~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If sampler is used and does not enable sampler Y'CBCR conversion and the VkFormat of the image is a multi-planar format, the image must have been created with VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, and the aspectMask of the imageView must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR or (for three-plane formats only) VK_IMAGE_ASPECT_PLANE_2_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorImageInfo-sampler-01564)~^~ -VALIDATION_ERROR_0480025a~^~Y~^~InvalidCreateDescriptorPool~^~vkCreateDescriptorPool~^~VUID-VkDescriptorPoolCreateInfo-maxSets-00301~^~core~^~The spec valid usage text states 'maxSets must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolCreateInfo-maxSets-00301)~^~ -VALIDATION_ERROR_04809001~^~Y~^~Unknown~^~vkCreateDescriptorPool~^~VUID-VkDescriptorPoolCreateInfo-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkDescriptorPoolCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolCreateInfo-flags-parameter)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0481c40d~^~Y~^~Unknown~^~vkCreateDescriptorPool~^~VUID-VkDescriptorPoolCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolCreateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0481e401~^~Y~^~Unknown~^~vkCreateDescriptorPool~^~VUID-VkDescriptorPoolCreateInfo-pPoolSizes-parameter~^~core~^~The spec valid usage text states 'pPoolSizes must be a valid pointer to an array of poolSizeCount valid VkDescriptorPoolSize structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolCreateInfo-pPoolSizes-parameter)~^~implicit -VALIDATION_ERROR_0482881b~^~Y~^~Unknown~^~vkCreateDescriptorPool~^~VUID-VkDescriptorPoolCreateInfo-poolSizeCount-arraylength~^~core~^~The spec valid usage text states 'poolSizeCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolCreateInfo-poolSizeCount-arraylength)~^~implicit -VALIDATION_ERROR_0482b00b~^~Y~^~Unknown~^~vkCreateDescriptorPool~^~VUID-VkDescriptorPoolCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_04a0025c~^~Y~^~InvalidCreateDescriptorPool~^~vkCreateDescriptorPool~^~VUID-VkDescriptorPoolSize-descriptorCount-00302~^~core~^~The spec valid usage text states 'descriptorCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolSize-descriptorCount-00302)~^~ -VALIDATION_ERROR_04a30401~^~Y~^~Unknown~^~vkCreateDescriptorPool~^~VUID-VkDescriptorPoolSize-type-parameter~^~core~^~The spec valid usage text states 'type must be a valid VkDescriptorType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolSize-type-parameter)~^~implicit -VALIDATION_ERROR_04c00009~^~Y~^~Unknown~^~vkAllocateDescriptorSets~^~VUID-VkDescriptorSetAllocateInfo-commonparent~^~core~^~The spec valid usage text states 'Both of descriptorPool, and the elements of pSetLayouts must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-commonparent)~^~implicit -VALIDATION_ERROR_04c00264~^~Y~^~AllocDescriptorFromEmptyPool~^~vkAllocateDescriptorSets~^~VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-00306~^~!(VK_KHR_maintenance1)~^~The spec valid usage text states 'descriptorSetCount must not be greater than the number of sets that are currently available for allocation in descriptorPool' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-00306)~^~ -VALIDATION_ERROR_04c00266~^~Y~^~AllocDescriptorFromEmptyPool~^~vkAllocateDescriptorSets~^~VUID-VkDescriptorSetAllocateInfo-descriptorPool-00307~^~!(VK_KHR_maintenance1)~^~The spec valid usage text states 'descriptorPool must have enough free descriptor capacity remaining to allocate the descriptor sets of the specified layouts' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-descriptorPool-00307)~^~ -VALIDATION_ERROR_04c00268~^~N~^~None~^~VkDescriptorSetAllocateInfo~^~VUID-VkDescriptorSetAllocateInfo-pSetLayouts-00308~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'Each element of pSetLayouts must not have been created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-pSetLayouts-00308)~^~ -VALIDATION_ERROR_04c04601~^~Y~^~None~^~vkAllocateDescriptorSets~^~VUID-VkDescriptorSetAllocateInfo-descriptorPool-parameter~^~core~^~The spec valid usage text states 'descriptorPool must be a valid VkDescriptorPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-descriptorPool-parameter)~^~implicit -VALIDATION_ERROR_04c04a1b~^~N~^~Unknown~^~vkAllocateDescriptorSets~^~VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-arraylength~^~core~^~The spec valid usage text states 'descriptorSetCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-arraylength)~^~implicit -VALIDATION_ERROR_04c1c40d~^~Y~^~Unknown~^~vkAllocateDescriptorSets~^~VUID-VkDescriptorSetAllocateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_04c22c01~^~Y~^~None~^~vkAllocateDescriptorSets~^~VUID-VkDescriptorSetAllocateInfo-pSetLayouts-parameter~^~core~^~The spec valid usage text states 'pSetLayouts must be a valid pointer to an array of descriptorSetCount valid VkDescriptorSetLayout handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-pSetLayouts-parameter)~^~implicit -VALIDATION_ERROR_04c2b00b~^~Y~^~Unknown~^~vkAllocateDescriptorSets~^~VUID-VkDescriptorSetAllocateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_04e00234~^~N~^~None~^~vkCreateDescriptorSetLayout~^~VUID-VkDescriptorSetLayoutBinding-descriptorType-00282~^~core~^~The spec valid usage text states 'If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLER or VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and descriptorCount is not 0 and pImmutableSamplers is not NULL, pImmutableSamplers must be a valid pointer to an array of descriptorCount valid VkSampler handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutBinding-descriptorType-00282)~^~ -VALIDATION_ERROR_04e00236~^~Y~^~Unknown~^~vkCreateDescriptorSetLayout~^~VUID-VkDescriptorSetLayoutBinding-descriptorCount-00283~^~core~^~The spec valid usage text states 'If descriptorCount is not 0, stageFlags must be a valid combination of VkShaderStageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutBinding-descriptorCount-00283)~^~ +VALIDATION_ERROR_03009001~^~Y~^~Unknown~^~VkComputePipelineCreateInfo~^~VUID-VkComputePipelineCreateInfo-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkPipelineCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-flags-parameter)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0300be01~^~Y~^~None~^~VkComputePipelineCreateInfo~^~VUID-VkComputePipelineCreateInfo-layout-parameter~^~core~^~The spec valid usage text states 'layout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-layout-parameter)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0301c40d~^~Y~^~Unknown~^~VkComputePipelineCreateInfo~^~VUID-VkComputePipelineCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-pNext-pNext)~^~implicit, TBD parameter validation layer. +VALIDATION_ERROR_0302b00b~^~N~^~Unknown~^~VkComputePipelineCreateInfo~^~VUID-VkComputePipelineCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0302d801~^~N~^~Unknown~^~VkComputePipelineCreateInfo~^~VUID-VkComputePipelineCreateInfo-stage-parameter~^~core~^~The spec valid usage text states 'stage must be a valid VkPipelineShaderStageCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-stage-parameter)~^~implicit +VALIDATION_ERROR_03200009~^~Y~^~Unknown~^~VkCopyDescriptorSet~^~VUID-VkCopyDescriptorSet-commonparent~^~core~^~The spec valid usage text states 'Both of dstSet, and srcSet must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-commonparent)~^~implicit +VALIDATION_ERROR_032002b2~^~Y~^~Unknown~^~VkCopyDescriptorSet~^~VUID-VkCopyDescriptorSet-srcBinding-00345~^~core~^~The spec valid usage text states 'srcBinding must be a valid binding within srcSet' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-srcBinding-00345)~^~ +VALIDATION_ERROR_032002b4~^~Y~^~Unknown~^~VkCopyDescriptorSet~^~VUID-VkCopyDescriptorSet-srcArrayElement-00346~^~core~^~The spec valid usage text states 'The sum of srcArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding specified by srcBinding, and all applicable consecutive bindings, as described by descriptorsets-updates-consecutive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-srcArrayElement-00346)~^~ +VALIDATION_ERROR_032002b6~^~Y~^~Unknown~^~VkCopyDescriptorSet~^~VUID-VkCopyDescriptorSet-dstBinding-00347~^~core~^~The spec valid usage text states 'dstBinding must be a valid binding within dstSet' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-dstBinding-00347)~^~ +VALIDATION_ERROR_032002b8~^~Y~^~Unknown~^~VkCopyDescriptorSet~^~VUID-VkCopyDescriptorSet-dstArrayElement-00348~^~core~^~The spec valid usage text states 'The sum of dstArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding specified by dstBinding, and all applicable consecutive bindings, as described by descriptorsets-updates-consecutive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-dstArrayElement-00348)~^~ +VALIDATION_ERROR_032002ba~^~Y~^~Unknown~^~VkCopyDescriptorSet~^~VUID-VkCopyDescriptorSet-srcSet-00349~^~core~^~The spec valid usage text states 'If srcSet is equal to dstSet, then the source and destination ranges of descriptors must not overlap, where the ranges may include array elements from consecutive bindings as described by descriptorsets-updates-consecutive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-srcSet-00349)~^~ +VALIDATION_ERROR_03200efc~^~Y~^~None~^~VkCopyDescriptorSet~^~VUID-VkCopyDescriptorSet-srcSet-01918~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If srcSet's layout was created with the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT flag set, then dstSet's layout must also have been created with the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT flag set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCopyDescriptorSet-srcSet-01918)~^~ +VALIDATION_ERROR_03200efe~^~Y~^~None~^~VkCopyDescriptorSet~^~VUID-VkCopyDescriptorSet-srcSet-01919~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If srcSet's layout was created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT flag set, then dstSet's layout must also have been created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT flag set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCopyDescriptorSet-srcSet-01919)~^~ +VALIDATION_ERROR_03200f00~^~Y~^~None~^~VkCopyDescriptorSet~^~VUID-VkCopyDescriptorSet-srcSet-01920~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If the descriptor pool from which srcSet was allocated was created with the VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag set, then the descriptor pool from which dstSet was allocated must also have been created with the VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCopyDescriptorSet-srcSet-01920)~^~ +VALIDATION_ERROR_03200f02~^~Y~^~None~^~VkCopyDescriptorSet~^~VUID-VkCopyDescriptorSet-srcSet-01921~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If the descriptor pool from which srcSet was allocated was created without the VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag set, then the descriptor pool from which dstSet was allocated must also have been created without the VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCopyDescriptorSet-srcSet-01921)~^~ +VALIDATION_ERROR_03207601~^~Y~^~UpdateDestroyDescriptorSetLayout~^~VkCopyDescriptorSet~^~VUID-VkCopyDescriptorSet-dstSet-parameter~^~core~^~The spec valid usage text states 'dstSet must be a valid VkDescriptorSet handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-dstSet-parameter)~^~implicit +VALIDATION_ERROR_0321c40d~^~Y~^~Unknown~^~VkCopyDescriptorSet~^~VUID-VkCopyDescriptorSet-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0322b00b~^~N~^~Unknown~^~VkCopyDescriptorSet~^~VUID-VkCopyDescriptorSet-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0322d201~^~Y~^~UpdateDestroyDescriptorSetLayout~^~VkCopyDescriptorSet~^~VUID-VkCopyDescriptorSet-srcSet-parameter~^~core~^~The spec valid usage text states 'srcSet must be a valid VkDescriptorSet handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-srcSet-parameter)~^~implicit +VALIDATION_ERROR_0340009e~^~N~^~Unknown~^~VkD3D12FenceSubmitInfoKHR~^~VUID-VkD3D12FenceSubmitInfoKHR-waitSemaphoreValuesCount-00079~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'waitSemaphoreValuesCount must be the same value as VkSubmitInfo::waitSemaphoreCount, where VkSubmitInfo is in the pNext chain of this VkD3D12FenceSubmitInfoKHR structure.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-waitSemaphoreValuesCount-00079)~^~ +VALIDATION_ERROR_034000a0~^~N~^~Unknown~^~VkD3D12FenceSubmitInfoKHR~^~VUID-VkD3D12FenceSubmitInfoKHR-signalSemaphoreValuesCount-00080~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'signalSemaphoreValuesCount must be the same value as VkSubmitInfo::signalSemaphoreCount, where VkSubmitInfo is in the pNext chain of this VkD3D12FenceSubmitInfoKHR structure.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-signalSemaphoreValuesCount-00080)~^~ +VALIDATION_ERROR_03423201~^~N~^~Unknown~^~VkD3D12FenceSubmitInfoKHR~^~VUID-VkD3D12FenceSubmitInfoKHR-pSignalSemaphoreValues-parameter~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'If signalSemaphoreValuesCount is not 0, and pSignalSemaphoreValues is not NULL, pSignalSemaphoreValues must be a valid pointer to an array of signalSemaphoreValuesCount uint64_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-pSignalSemaphoreValues-parameter)~^~implicit +VALIDATION_ERROR_03427401~^~N~^~Unknown~^~VkD3D12FenceSubmitInfoKHR~^~VUID-VkD3D12FenceSubmitInfoKHR-pWaitSemaphoreValues-parameter~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'If waitSemaphoreValuesCount is not 0, and pWaitSemaphoreValues is not NULL, pWaitSemaphoreValues must be a valid pointer to an array of waitSemaphoreValuesCount uint64_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-pWaitSemaphoreValues-parameter)~^~implicit +VALIDATION_ERROR_0342b00b~^~N~^~Unknown~^~VkD3D12FenceSubmitInfoKHR~^~VUID-VkD3D12FenceSubmitInfoKHR-sType-sType~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-sType-sType)~^~implicit +VALIDATION_ERROR_0361a801~^~Y~^~Unknown~^~VkDebugMarkerMarkerInfoEXT~^~VUID-VkDebugMarkerMarkerInfoEXT-pMarkerName-parameter~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'pMarkerName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerMarkerInfoEXT-pMarkerName-parameter)~^~implicit +VALIDATION_ERROR_0361c40d~^~Y~^~Unknown~^~VkDebugMarkerMarkerInfoEXT~^~VUID-VkDebugMarkerMarkerInfoEXT-pNext-pNext~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerMarkerInfoEXT-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0362b00b~^~Y~^~Unknown~^~VkDebugMarkerMarkerInfoEXT~^~VUID-VkDebugMarkerMarkerInfoEXT-sType-sType~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerMarkerInfoEXT-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_03800ba4~^~N~^~None~^~VkDebugMarkerObjectNameInfoEXT~^~VUID-VkDebugMarkerObjectNameInfoEXT-objectType-01490~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'objectType must not be VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-objectType-01490)~^~ +VALIDATION_ERROR_03800ba6~^~N~^~None~^~VkDebugMarkerObjectNameInfoEXT~^~VUID-VkDebugMarkerObjectNameInfoEXT-object-01491~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'object must not be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-object-01491)~^~ +VALIDATION_ERROR_03800ba8~^~N~^~None~^~VkDebugMarkerObjectNameInfoEXT~^~VUID-VkDebugMarkerObjectNameInfoEXT-object-01492~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'object must be a Vulkan object of the type associated with objectType as defined in debug-report-object-types.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-object-01492)~^~ +VALIDATION_ERROR_0380da01~^~Y~^~Unknown~^~VkDebugMarkerObjectNameInfoEXT~^~VUID-VkDebugMarkerObjectNameInfoEXT-objectType-parameter~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'objectType must be a valid VkDebugReportObjectTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-objectType-parameter)~^~implicit +VALIDATION_ERROR_0381c40d~^~Y~^~Unknown~^~VkDebugMarkerObjectNameInfoEXT~^~VUID-VkDebugMarkerObjectNameInfoEXT-pNext-pNext~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0381ce01~^~Y~^~Unknown~^~VkDebugMarkerObjectNameInfoEXT~^~VUID-VkDebugMarkerObjectNameInfoEXT-pObjectName-parameter~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'pObjectName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-pObjectName-parameter)~^~implicit +VALIDATION_ERROR_0382b00b~^~Y~^~Unknown~^~VkDebugMarkerObjectNameInfoEXT~^~VUID-VkDebugMarkerObjectNameInfoEXT-sType-sType~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_03a00baa~^~N~^~None~^~VkDebugMarkerObjectTagInfoEXT~^~VUID-VkDebugMarkerObjectTagInfoEXT-objectType-01493~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'objectType must not be VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-objectType-01493)~^~ +VALIDATION_ERROR_03a00bac~^~N~^~None~^~VkDebugMarkerObjectTagInfoEXT~^~VUID-VkDebugMarkerObjectTagInfoEXT-object-01494~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'object must not be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-object-01494)~^~ +VALIDATION_ERROR_03a00bae~^~N~^~None~^~VkDebugMarkerObjectTagInfoEXT~^~VUID-VkDebugMarkerObjectTagInfoEXT-object-01495~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'object must be a Vulkan object of the type associated with objectType as defined in debug-report-object-types.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-object-01495)~^~ +VALIDATION_ERROR_03a0da01~^~Y~^~Unknown~^~VkDebugMarkerObjectTagInfoEXT~^~VUID-VkDebugMarkerObjectTagInfoEXT-objectType-parameter~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'objectType must be a valid VkDebugReportObjectTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-objectType-parameter)~^~implicit +VALIDATION_ERROR_03a1c40d~^~Y~^~Unknown~^~VkDebugMarkerObjectTagInfoEXT~^~VUID-VkDebugMarkerObjectTagInfoEXT-pNext-pNext~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_03a25a01~^~Y~^~Unknown~^~VkDebugMarkerObjectTagInfoEXT~^~VUID-VkDebugMarkerObjectTagInfoEXT-pTag-parameter~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'pTag must be a valid pointer to an array of tagSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-pTag-parameter)~^~implicit +VALIDATION_ERROR_03a2b00b~^~Y~^~Unknown~^~VkDebugMarkerObjectTagInfoEXT~^~VUID-VkDebugMarkerObjectTagInfoEXT-sType-sType~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_03a2f41b~^~Y~^~Unknown~^~VkDebugMarkerObjectTagInfoEXT~^~VUID-VkDebugMarkerObjectTagInfoEXT-tagSize-arraylength~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'tagSize must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-tagSize-arraylength)~^~implicit +VALIDATION_ERROR_03c00ad2~^~N~^~Unknown~^~VkDebugReportCallbackCreateInfoEXT~^~VUID-VkDebugReportCallbackCreateInfoEXT-pfnCallback-01385~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'pfnCallback must be a valid PFN_vkDebugReportCallbackEXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugReportCallbackCreateInfoEXT-pfnCallback-01385)~^~ +VALIDATION_ERROR_03c09001~^~Y~^~Unknown~^~VkDebugReportCallbackCreateInfoEXT~^~VUID-VkDebugReportCallbackCreateInfoEXT-flags-parameter~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'flags must be a valid combination of VkDebugReportFlagBitsEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugReportCallbackCreateInfoEXT-flags-parameter)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_03c2b00b~^~Y~^~Unknown~^~VkDebugReportCallbackCreateInfoEXT~^~VUID-VkDebugReportCallbackCreateInfoEXT-sType-sType~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugReportCallbackCreateInfoEXT-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_03e2b00b~^~N~^~Unknown~^~VkDedicatedAllocationBufferCreateInfoNV~^~VUID-VkDedicatedAllocationBufferCreateInfoNV-sType-sType~^~(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationBufferCreateInfoNV-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_040007c4~^~N~^~Unknown~^~VkDedicatedAllocationImageCreateInfoNV~^~VUID-VkDedicatedAllocationImageCreateInfoNV-dedicatedAllocation-00994~^~(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'If dedicatedAllocation is VK_TRUE, VkImageCreateInfo::flags must not include VK_IMAGE_CREATE_SPARSE_BINDING_BIT, VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, or VK_IMAGE_CREATE_SPARSE_ALIASED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationImageCreateInfoNV-dedicatedAllocation-00994)~^~ +VALIDATION_ERROR_0402b00b~^~N~^~Unknown~^~VkDedicatedAllocationImageCreateInfoNV~^~VUID-VkDedicatedAllocationImageCreateInfoNV-sType-sType~^~(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationImageCreateInfoNV-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_04200009~^~N~^~Unknown~^~VkDedicatedAllocationMemoryAllocateInfoNV~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-commonparent~^~(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'Both of buffer, and image that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-commonparent)~^~implicit +VALIDATION_ERROR_04200512~^~N~^~Unknown~^~VkDedicatedAllocationMemoryAllocateInfoNV~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00649~^~(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'At least one of image and buffer must be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00649)~^~ +VALIDATION_ERROR_04200514~^~N~^~Unknown~^~VkDedicatedAllocationMemoryAllocateInfoNV~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00650~^~(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'If image is not VK_NULL_HANDLE, the image must have been created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00650)~^~ +VALIDATION_ERROR_04200516~^~N~^~Unknown~^~VkDedicatedAllocationMemoryAllocateInfoNV~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00651~^~(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, the buffer must have been created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00651)~^~ +VALIDATION_ERROR_04200518~^~N~^~Unknown~^~VkDedicatedAllocationMemoryAllocateInfoNV~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00652~^~(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'If image is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00652)~^~ +VALIDATION_ERROR_0420051a~^~N~^~Unknown~^~VkDedicatedAllocationMemoryAllocateInfoNV~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00653~^~(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00653)~^~ +VALIDATION_ERROR_0420051c~^~N~^~Unknown~^~VkDedicatedAllocationMemoryAllocateInfoNV~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00654~^~(VK_NV_dedicated_allocation)+(VK_KHR_external_memory_win32,VK_KHR_external_memory_fd)~^~The spec valid usage text states 'If image is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation, the memory being imported must also be a dedicated image allocation and image must be identical to the image associated with the imported memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00654)~^~ +VALIDATION_ERROR_0420051e~^~N~^~Unknown~^~VkDedicatedAllocationMemoryAllocateInfoNV~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00655~^~(VK_NV_dedicated_allocation)+(VK_KHR_external_memory_win32,VK_KHR_external_memory_fd)~^~The spec valid usage text states 'If buffer is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation, the memory being imported must also be a dedicated buffer allocation and buffer must be identical to the buffer associated with the imported memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00655)~^~ +VALIDATION_ERROR_04201a01~^~N~^~Unknown~^~VkDedicatedAllocationMemoryAllocateInfoNV~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-parameter~^~(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-parameter)~^~implicit +VALIDATION_ERROR_0420a001~^~N~^~Unknown~^~VkDedicatedAllocationMemoryAllocateInfoNV~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-parameter~^~(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'If image is not VK_NULL_HANDLE, image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-parameter)~^~implicit +VALIDATION_ERROR_0422b00b~^~N~^~Unknown~^~VkDedicatedAllocationMemoryAllocateInfoNV~^~VUID-VkDedicatedAllocationMemoryAllocateInfoNV-sType-sType~^~(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_044002a8~^~Y~^~DSBufferInfoErrors~^~VkDescriptorBufferInfo~^~VUID-VkDescriptorBufferInfo-offset-00340~^~core~^~The spec valid usage text states 'offset must be less than the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorBufferInfo-offset-00340)~^~ +VALIDATION_ERROR_044002aa~^~Y~^~DSBufferInfoErrors~^~VkDescriptorBufferInfo~^~VUID-VkDescriptorBufferInfo-range-00341~^~core~^~The spec valid usage text states 'If range is not equal to VK_WHOLE_SIZE, range must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorBufferInfo-range-00341)~^~ +VALIDATION_ERROR_044002ac~^~Y~^~DSBufferInfoErrors~^~VkDescriptorBufferInfo~^~VUID-VkDescriptorBufferInfo-range-00342~^~core~^~The spec valid usage text states 'If range is not equal to VK_WHOLE_SIZE, range must be less than or equal to the size of buffer minus offset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorBufferInfo-range-00342)~^~ +VALIDATION_ERROR_04401a01~^~Y~^~Unknown~^~VkDescriptorBufferInfo~^~VUID-VkDescriptorBufferInfo-buffer-parameter~^~core~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorBufferInfo-buffer-parameter)~^~implicit +VALIDATION_ERROR_04600009~^~Y~^~Unknown~^~VkDescriptorImageInfo~^~VUID-VkDescriptorImageInfo-commonparent~^~core~^~The spec valid usage text states 'Both of imageView, and sampler that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorImageInfo-commonparent)~^~implicit +VALIDATION_ERROR_046002ae~^~Y~^~Maint1BindingSliceOf3DImage~^~VkDescriptorImageInfo~^~VUID-VkDescriptorImageInfo-imageView-00343~^~(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'imageView must not be 2D or 2D array image view created from a 3D image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorImageInfo-imageView-00343)~^~ +VALIDATION_ERROR_046002b0~^~Y~^~Unknown~^~VkDescriptorImageInfo~^~VUID-VkDescriptorImageInfo-imageLayout-00344~^~core~^~The spec valid usage text states 'imageLayout must match the actual VkImageLayout of each subresource accessible from imageView at the time this descriptor is accessed' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorImageInfo-imageLayout-00344)~^~ +VALIDATION_ERROR_04600c36~^~N~^~None~^~VkDescriptorImageInfo~^~VUID-VkDescriptorImageInfo-sampler-01563~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If sampler is used and enables sampler Y'CBCR conversion:' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorImageInfo-sampler-01563)~^~ +VALIDATION_ERROR_04600c38~^~N~^~None~^~VkDescriptorImageInfo~^~VUID-VkDescriptorImageInfo-sampler-01564~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If sampler is used and does not enable sampler Y'CBCR conversion and the VkFormat of the image is a multi-planar format, the image must have been created with VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, and the aspectMask of the imageView must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT or (for three-plane formats only) VK_IMAGE_ASPECT_PLANE_2_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorImageInfo-sampler-01564)~^~ +VALIDATION_ERROR_0480025a~^~Y~^~InvalidCreateDescriptorPool~^~VkDescriptorPoolCreateInfo~^~VUID-VkDescriptorPoolCreateInfo-maxSets-00301~^~core~^~The spec valid usage text states 'maxSets must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolCreateInfo-maxSets-00301)~^~ +VALIDATION_ERROR_04809001~^~Y~^~Unknown~^~VkDescriptorPoolCreateInfo~^~VUID-VkDescriptorPoolCreateInfo-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkDescriptorPoolCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolCreateInfo-flags-parameter)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0481c40d~^~Y~^~Unknown~^~VkDescriptorPoolCreateInfo~^~VUID-VkDescriptorPoolCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolCreateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0481e401~^~Y~^~Unknown~^~VkDescriptorPoolCreateInfo~^~VUID-VkDescriptorPoolCreateInfo-pPoolSizes-parameter~^~core~^~The spec valid usage text states 'pPoolSizes must be a valid pointer to an array of poolSizeCount valid VkDescriptorPoolSize structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolCreateInfo-pPoolSizes-parameter)~^~implicit +VALIDATION_ERROR_0482881b~^~Y~^~Unknown~^~VkDescriptorPoolCreateInfo~^~VUID-VkDescriptorPoolCreateInfo-poolSizeCount-arraylength~^~core~^~The spec valid usage text states 'poolSizeCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolCreateInfo-poolSizeCount-arraylength)~^~implicit +VALIDATION_ERROR_0482b00b~^~Y~^~Unknown~^~VkDescriptorPoolCreateInfo~^~VUID-VkDescriptorPoolCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_04a0025c~^~Y~^~InvalidCreateDescriptorPool~^~VkDescriptorPoolSize~^~VUID-VkDescriptorPoolSize-descriptorCount-00302~^~core~^~The spec valid usage text states 'descriptorCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolSize-descriptorCount-00302)~^~ +VALIDATION_ERROR_04a30401~^~Y~^~Unknown~^~VkDescriptorPoolSize~^~VUID-VkDescriptorPoolSize-type-parameter~^~core~^~The spec valid usage text states 'type must be a valid VkDescriptorType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolSize-type-parameter)~^~implicit +VALIDATION_ERROR_04c00009~^~Y~^~Unknown~^~VkDescriptorSetAllocateInfo~^~VUID-VkDescriptorSetAllocateInfo-commonparent~^~core~^~The spec valid usage text states 'Both of descriptorPool, and the elements of pSetLayouts must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-commonparent)~^~implicit +VALIDATION_ERROR_04c00264~^~Y~^~AllocDescriptorFromEmptyPool~^~VkDescriptorSetAllocateInfo~^~VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-00306~^~!(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'descriptorSetCount must not be greater than the number of sets that are currently available for allocation in descriptorPool' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-00306)~^~ +VALIDATION_ERROR_04c00266~^~Y~^~AllocDescriptorFromEmptyPool~^~VkDescriptorSetAllocateInfo~^~VUID-VkDescriptorSetAllocateInfo-descriptorPool-00307~^~!(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'descriptorPool must have enough free descriptor capacity remaining to allocate the descriptor sets of the specified layouts' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-descriptorPool-00307)~^~ +VALIDATION_ERROR_04c00268~^~Y~^~AllocatePushDescriptorSet~^~VkDescriptorSetAllocateInfo~^~VUID-VkDescriptorSetAllocateInfo-pSetLayouts-00308~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'Each element of pSetLayouts must not have been created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-pSetLayouts-00308)~^~ +VALIDATION_ERROR_04c017c8~^~Y~^~DescriptorIndexingSetLayout~^~VkDescriptorSetAllocateInfo~^~VUID-VkDescriptorSetAllocateInfo-pSetLayouts-03044~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If any element of pSetLayouts was created with the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set, descriptorPool must have been created with the VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-pSetLayouts-03044)~^~ +VALIDATION_ERROR_04c04601~^~Y~^~None~^~VkDescriptorSetAllocateInfo~^~VUID-VkDescriptorSetAllocateInfo-descriptorPool-parameter~^~core~^~The spec valid usage text states 'descriptorPool must be a valid VkDescriptorPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-descriptorPool-parameter)~^~implicit +VALIDATION_ERROR_04c04a1b~^~N~^~Unknown~^~VkDescriptorSetAllocateInfo~^~VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-arraylength~^~core~^~The spec valid usage text states 'descriptorSetCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-arraylength)~^~implicit +VALIDATION_ERROR_04c1c40d~^~Y~^~Unknown~^~VkDescriptorSetAllocateInfo~^~VUID-VkDescriptorSetAllocateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkDescriptorSetVariableDescriptorCountAllocateInfoEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_04c22c01~^~Y~^~None~^~VkDescriptorSetAllocateInfo~^~VUID-VkDescriptorSetAllocateInfo-pSetLayouts-parameter~^~core~^~The spec valid usage text states 'pSetLayouts must be a valid pointer to an array of descriptorSetCount valid VkDescriptorSetLayout handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-pSetLayouts-parameter)~^~implicit +VALIDATION_ERROR_04c2b00b~^~Y~^~Unknown~^~VkDescriptorSetAllocateInfo~^~VUID-VkDescriptorSetAllocateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_04e00234~^~Y~^~None~^~VkDescriptorSetLayoutBinding~^~VUID-VkDescriptorSetLayoutBinding-descriptorType-00282~^~core~^~The spec valid usage text states 'If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLER or VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and descriptorCount is not 0 and pImmutableSamplers is not NULL, pImmutableSamplers must be a valid pointer to an array of descriptorCount valid VkSampler handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutBinding-descriptorType-00282)~^~ +VALIDATION_ERROR_04e00236~^~Y~^~Unknown~^~VkDescriptorSetLayoutBinding~^~VUID-VkDescriptorSetLayoutBinding-descriptorCount-00283~^~core~^~The spec valid usage text states 'If descriptorCount is not 0, stageFlags must be a valid combination of VkShaderStageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutBinding-descriptorCount-00283)~^~ VALIDATION_ERROR_04e00bcc~^~N~^~None~^~VkDescriptorSetLayoutBinding~^~VUID-VkDescriptorSetLayoutBinding-descriptorType-01510~^~core~^~The spec valid usage text states 'If descriptorType is VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT and descriptorCount is not 0, then stageFlags must be 0 or VK_SHADER_STAGE_FRAGMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutBinding-descriptorType-01510)~^~ -VALIDATION_ERROR_04e04e01~^~Y~^~Unknown~^~vkCreateDescriptorSetLayout~^~VUID-VkDescriptorSetLayoutBinding-descriptorType-parameter~^~core~^~The spec valid usage text states 'descriptorType must be a valid VkDescriptorType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutBinding-descriptorType-parameter)~^~implicit -VALIDATION_ERROR_0500022e~^~Y~^~DuplicateDescriptorBinding~^~vkCreateDescriptorSetLayout~^~VUID-VkDescriptorSetLayoutCreateInfo-binding-00279~^~core~^~The spec valid usage text states 'The VkDescriptorSetLayoutBinding::binding members of the elements of the pBindings array must each have different values.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-binding-00279)~^~ -VALIDATION_ERROR_05000230~^~N~^~Unknown~^~vkCreateDescriptorSetLayout~^~VUID-VkDescriptorSetLayoutCreateInfo-flags-00280~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'If flags contains VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then all elements of pBindings must not have a descriptorType of VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-flags-00280)~^~ -VALIDATION_ERROR_05000232~^~N~^~Unknown~^~vkCreateDescriptorSetLayout~^~VUID-VkDescriptorSetLayoutCreateInfo-flags-00281~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'If flags contains VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then the total number of elements of all bindings must be less than or equal to VkPhysicalDevicePushDescriptorPropertiesKHR::maxPushDescriptors' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-flags-00281)~^~ -VALIDATION_ERROR_05009001~^~Y~^~Unknown~^~vkCreateDescriptorSetLayout~^~VUID-VkDescriptorSetLayoutCreateInfo-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkDescriptorSetLayoutCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-flags-parameter)~^~implicit -VALIDATION_ERROR_0500fc01~^~Y~^~Unknown~^~vkCreateDescriptorSetLayout~^~VUID-VkDescriptorSetLayoutCreateInfo-pBindings-parameter~^~core~^~The spec valid usage text states 'If bindingCount is not 0, pBindings must be a valid pointer to an array of bindingCount valid VkDescriptorSetLayoutBinding structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-pBindings-parameter)~^~implicit -VALIDATION_ERROR_0501c40d~^~Y~^~Unknown~^~vkCreateDescriptorSetLayout~^~VUID-VkDescriptorSetLayoutCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0502b00b~^~Y~^~Unknown~^~vkCreateDescriptorSetLayout~^~VUID-VkDescriptorSetLayoutCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_05200009~^~Y~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-VkDescriptorUpdateTemplateCreateInfoKHR-commonparent~^~core~^~The spec valid usage text states 'Both of descriptorSetLayout, and pipelineLayout that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-commonparent)~^~implicit -VALIDATION_ERROR_052002bc~^~N~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-VkDescriptorUpdateTemplateCreateInfoKHR-templateType-00350~^~core~^~The spec valid usage text states 'If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR, descriptorSetLayout must be a valid VkDescriptorSetLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-templateType-00350)~^~ -VALIDATION_ERROR_052002be~^~N~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-VkDescriptorUpdateTemplateCreateInfoKHR-templateType-00351~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, pipelineBindPoint must be a valid VkPipelineBindPoint value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-templateType-00351)~^~ -VALIDATION_ERROR_052002c0~^~N~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-VkDescriptorUpdateTemplateCreateInfoKHR-templateType-00352~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, pipelineLayout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-templateType-00352)~^~ -VALIDATION_ERROR_052002c2~^~N~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-VkDescriptorUpdateTemplateCreateInfoKHR-templateType-00353~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, set must be the unique set number in the pipeline layout that uses a descriptor set layout that was created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-templateType-00353)~^~ -VALIDATION_ERROR_05204c01~^~Y~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-VkDescriptorUpdateTemplateCreateInfoKHR-descriptorSetLayout-parameter~^~core~^~The spec valid usage text states 'If descriptorSetLayout is not VK_NULL_HANDLE, descriptorSetLayout must be a valid VkDescriptorSetLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-descriptorSetLayout-parameter)~^~implicit -VALIDATION_ERROR_0520501b~^~Y~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-VkDescriptorUpdateTemplateCreateInfoKHR-descriptorUpdateEntryCount-arraylength~^~core~^~The spec valid usage text states 'descriptorUpdateEntryCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-descriptorUpdateEntryCount-arraylength)~^~implicit -VALIDATION_ERROR_05209005~^~Y~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-VkDescriptorUpdateTemplateCreateInfoKHR-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-flags-zerobitmask)~^~implicit -VALIDATION_ERROR_05213201~^~Y~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-VkDescriptorUpdateTemplateCreateInfoKHR-pDescriptorUpdateEntries-parameter~^~core~^~The spec valid usage text states 'pDescriptorUpdateEntries must be a valid pointer to an array of descriptorUpdateEntryCount valid VkDescriptorUpdateTemplateEntryKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-pDescriptorUpdateEntries-parameter)~^~implicit -VALIDATION_ERROR_0521c40d~^~Y~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-VkDescriptorUpdateTemplateCreateInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_05227e01~^~Y~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-VkDescriptorUpdateTemplateCreateInfoKHR-pipelineBindPoint-parameter~^~core~^~The spec valid usage text states 'If pipelineBindPoint is not 0, pipelineBindPoint must be a valid VkPipelineBindPoint value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-pipelineBindPoint-parameter)~^~implicit -VALIDATION_ERROR_05228201~^~Y~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-VkDescriptorUpdateTemplateCreateInfoKHR-pipelineLayout-parameter~^~core~^~The spec valid usage text states 'If pipelineLayout is not VK_NULL_HANDLE, pipelineLayout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-pipelineLayout-parameter)~^~implicit -VALIDATION_ERROR_0522b00b~^~Y~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-VkDescriptorUpdateTemplateCreateInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_0522f801~^~Y~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-VkDescriptorUpdateTemplateCreateInfoKHR-templateType-parameter~^~core~^~The spec valid usage text states 'templateType must be a valid VkDescriptorUpdateTemplateTypeKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-templateType-parameter)~^~implicit -VALIDATION_ERROR_054002c4~^~N~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-VkDescriptorUpdateTemplateEntryKHR-dstBinding-00354~^~core~^~The spec valid usage text states 'dstBinding must be a valid binding in the descriptor set layout implicitly specified when using a descriptor update template to update descriptors.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateEntryKHR-dstBinding-00354)~^~ -VALIDATION_ERROR_054002c6~^~N~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-VkDescriptorUpdateTemplateEntryKHR-dstArrayElement-00355~^~core~^~The spec valid usage text states 'dstArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding implicitly specified when using a descriptor update template to update descriptors, and all applicable consecutive bindings, as described by consecutive binding updates' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateEntryKHR-dstArrayElement-00355)~^~ -VALIDATION_ERROR_05404e01~^~Y~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-VkDescriptorUpdateTemplateEntryKHR-descriptorType-parameter~^~core~^~The spec valid usage text states 'descriptorType must be a valid VkDescriptorType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateEntryKHR-descriptorType-parameter)~^~implicit -VALIDATION_ERROR_056002e8~^~Y~^~Unknown~^~vkCreateDevice~^~VUID-VkDeviceCreateInfo-queueFamilyIndex-00372~^~core~^~The spec valid usage text states 'The queueFamilyIndex member of each element of pQueueCreateInfos must be unique within pQueueCreateInfos' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-queueFamilyIndex-00372)~^~ -VALIDATION_ERROR_056002ea~^~N~^~Unknown~^~vkCreateDevice~^~VUID-VkDeviceCreateInfo-pNext-00373~^~(VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'If the pNext chain includes a VkPhysicalDeviceFeatures2KHR structure, then pEnabledFeatures must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceCreateInfo-pNext-00373)~^~ -VALIDATION_ERROR_056002ec~^~Y~^~Maintenance1AndNegativeViewport~^~vkCreateDevice~^~VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-00374~^~(VK_KHR_maintenance1)+(VK_AMD_negative_viewport_height)~^~The spec valid usage text states 'ppEnabledExtensionNames must not contain both VK_KHR_maintenance1 and VK_AMD_negative_viewport_height' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-00374)~^~ -VALIDATION_ERROR_05609005~^~Y~^~Unknown~^~vkCreateDevice~^~VUID-VkDeviceCreateInfo-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-flags-zerobitmask)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_05615a01~^~N~^~Unknown~^~vkCreateDevice~^~VUID-VkDeviceCreateInfo-pEnabledFeatures-parameter~^~core~^~The spec valid usage text states 'If pEnabledFeatures is not NULL, pEnabledFeatures must be a valid pointer to a valid VkPhysicalDeviceFeatures structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-pEnabledFeatures-parameter)~^~implicit -VALIDATION_ERROR_0561c40d~^~N~^~Unknown~^~vkCreateDevice~^~VUID-VkDeviceCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDeviceGroupDeviceCreateInfoKHX, VkPhysicalDevice16BitStorageFeaturesKHR, VkPhysicalDeviceFeatures2KHR, VkPhysicalDeviceMultiviewFeaturesKHX, VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR, or VkPhysicalDeviceVariablePointerFeaturesKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-pNext-pNext)~^~implicit -VALIDATION_ERROR_0561fe01~^~Y~^~Unknown~^~vkCreateDevice~^~VUID-VkDeviceCreateInfo-pQueueCreateInfos-parameter~^~core~^~The spec valid usage text states 'pQueueCreateInfos must be a valid pointer to an array of queueCreateInfoCount valid VkDeviceQueueCreateInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-pQueueCreateInfos-parameter)~^~implicit -VALIDATION_ERROR_05628e01~^~Y~^~Unknown~^~vkCreateDevice~^~VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-parameter~^~core~^~The spec valid usage text states 'If enabledExtensionCount is not 0, ppEnabledExtensionNames must be a valid pointer to an array of enabledExtensionCount null-terminated UTF-8 strings' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-parameter)~^~implicit -VALIDATION_ERROR_05629001~^~Y~^~Unknown~^~vkCreateDevice~^~VUID-VkDeviceCreateInfo-ppEnabledLayerNames-parameter~^~core~^~The spec valid usage text states 'If enabledLayerCount is not 0, ppEnabledLayerNames must be a valid pointer to an array of enabledLayerCount null-terminated UTF-8 strings' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-ppEnabledLayerNames-parameter)~^~implicit -VALIDATION_ERROR_0562a01b~^~N~^~Unknown~^~vkCreateDevice~^~VUID-VkDeviceCreateInfo-queueCreateInfoCount-arraylength~^~core~^~The spec valid usage text states 'queueCreateInfoCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-queueCreateInfoCount-arraylength)~^~implicit -VALIDATION_ERROR_0562b00b~^~Y~^~Unknown~^~vkCreateDevice~^~VUID-VkDeviceCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0562b00f~^~N~^~Unknown~^~vkCreateDevice~^~VUID-VkDeviceCreateInfo-sType-unique~^~core~^~The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-sType-unique)~^~implicit -VALIDATION_ERROR_05805801~^~Y~^~Unknown~^~vkRegisterDeviceEventEXT~^~VUID-VkDeviceEventInfoEXT-deviceEvent-parameter~^~core~^~The spec valid usage text states 'deviceEvent must be a valid VkDeviceEventTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceEventInfoEXT-deviceEvent-parameter)~^~implicit -VALIDATION_ERROR_0581c40d~^~Y~^~Unknown~^~vkRegisterDeviceEventEXT~^~VUID-VkDeviceEventInfoEXT-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceEventInfoEXT-pNext-pNext)~^~implicit -VALIDATION_ERROR_0582b00b~^~Y~^~Unknown~^~vkRegisterDeviceEventEXT~^~VUID-VkDeviceEventInfoEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceEventInfoEXT-sType-sType)~^~implicit -VALIDATION_ERROR_05a1c40d~^~N~^~Unknown~^~vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX~^~VUID-VkDeviceGeneratedCommandsFeaturesNVX-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGeneratedCommandsFeaturesNVX-pNext-pNext)~^~implicit -VALIDATION_ERROR_05a2b00b~^~Y~^~Unknown~^~vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX~^~VUID-VkDeviceGeneratedCommandsFeaturesNVX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGeneratedCommandsFeaturesNVX-sType-sType)~^~implicit -VALIDATION_ERROR_05c1c40d~^~N~^~Unknown~^~vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX~^~VUID-VkDeviceGeneratedCommandsLimitsNVX-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGeneratedCommandsLimitsNVX-pNext-pNext)~^~implicit -VALIDATION_ERROR_05c2b00b~^~Y~^~Unknown~^~vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX~^~VUID-VkDeviceGeneratedCommandsLimitsNVX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGeneratedCommandsLimitsNVX-sType-sType)~^~implicit -VALIDATION_ERROR_05e008bc~^~N~^~Unknown~^~vkQueueBindSparse~^~VUID-VkDeviceGroupBindSparseInfoKHX-resourceDeviceIndex-01118~^~core~^~The spec valid usage text states 'resourceDeviceIndex and memoryDeviceIndex must both be valid device indices.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupBindSparseInfoKHX-resourceDeviceIndex-01118)~^~ -VALIDATION_ERROR_05e008be~^~N~^~Unknown~^~vkQueueBindSparse~^~VUID-VkDeviceGroupBindSparseInfoKHX-memoryDeviceIndex-01119~^~core~^~The spec valid usage text states 'Each memory allocation bound in this batch must have allocated an instance for memoryDeviceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupBindSparseInfoKHX-memoryDeviceIndex-01119)~^~ -VALIDATION_ERROR_05e2b00b~^~N~^~Unknown~^~vkQueueBindSparse~^~VUID-VkDeviceGroupBindSparseInfoKHX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupBindSparseInfoKHX-sType-sType)~^~implicit -VALIDATION_ERROR_060000d4~^~N~^~Unknown~^~vkCmdExecuteCommands~^~VUID-VkDeviceGroupCommandBufferBeginInfoKHX-deviceMask-00106~^~core~^~The spec valid usage text states 'deviceMask must be a valid device mask value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupCommandBufferBeginInfoKHX-deviceMask-00106)~^~ -VALIDATION_ERROR_060000d6~^~N~^~Unknown~^~vkCmdExecuteCommands~^~VUID-VkDeviceGroupCommandBufferBeginInfoKHX-deviceMask-00107~^~core~^~The spec valid usage text states 'deviceMask must not be zero' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupCommandBufferBeginInfoKHX-deviceMask-00107)~^~ -VALIDATION_ERROR_0602b00b~^~N~^~Unknown~^~vkCmdExecuteCommands~^~VUID-VkDeviceGroupCommandBufferBeginInfoKHX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupCommandBufferBeginInfoKHX-sType-sType)~^~implicit -VALIDATION_ERROR_062002ee~^~N~^~Unknown~^~vkCreateDevice~^~VUID-VkDeviceGroupDeviceCreateInfoKHX-pPhysicalDevices-00375~^~core~^~The spec valid usage text states 'Each element of pPhysicalDevices must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfoKHX-pPhysicalDevices-00375)~^~ -VALIDATION_ERROR_062002f0~^~N~^~Unknown~^~vkCreateDevice~^~VUID-VkDeviceGroupDeviceCreateInfoKHX-pPhysicalDevices-00376~^~core~^~The spec valid usage text states 'All elements of pPhysicalDevices must be in the same device group as enumerated by vkEnumeratePhysicalDeviceGroupsKHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfoKHX-pPhysicalDevices-00376)~^~ -VALIDATION_ERROR_062002f2~^~N~^~Unknown~^~vkCreateDevice~^~VUID-VkDeviceGroupDeviceCreateInfoKHX-physicalDeviceCount-00377~^~core~^~The spec valid usage text states 'If physicalDeviceCount is not 0, the physicalDevice parameter of vkCreateDevice must be an element of pPhysicalDevices.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfoKHX-physicalDeviceCount-00377)~^~ -VALIDATION_ERROR_0621dc01~^~N~^~Unknown~^~vkCreateDevice~^~VUID-VkDeviceGroupDeviceCreateInfoKHX-pPhysicalDevices-parameter~^~core~^~The spec valid usage text states 'If physicalDeviceCount is not 0, pPhysicalDevices must be a valid pointer to an array of physicalDeviceCount valid VkPhysicalDevice handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfoKHX-pPhysicalDevices-parameter)~^~implicit -VALIDATION_ERROR_0622b00b~^~N~^~Unknown~^~vkCreateDevice~^~VUID-VkDeviceGroupDeviceCreateInfoKHX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfoKHX-sType-sType)~^~implicit -VALIDATION_ERROR_06400a22~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-VkDeviceGroupPresentInfoKHX-swapchainCount-01297~^~core~^~The spec valid usage text states 'swapchainCount must equal 0 or VkPresentInfoKHR::swapchainCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-swapchainCount-01297)~^~ -VALIDATION_ERROR_06400a24~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-VkDeviceGroupPresentInfoKHX-mode-01298~^~core~^~The spec valid usage text states 'If mode is VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHX, then each element of pDeviceMasks must have exactly one bit set, and the corresponding element of VkDeviceGroupPresentCapabilitiesKHX::presentMask must be non-zero' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-mode-01298)~^~ -VALIDATION_ERROR_06400a26~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-VkDeviceGroupPresentInfoKHX-mode-01299~^~core~^~The spec valid usage text states 'If mode is VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHX, then each element of pDeviceMasks must have exactly one bit set, and some physical device in the logical device must include that bit in its VkDeviceGroupPresentCapabilitiesKHX::presentMask.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-mode-01299)~^~ -VALIDATION_ERROR_06400a28~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-VkDeviceGroupPresentInfoKHX-mode-01300~^~core~^~The spec valid usage text states 'If mode is VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHX, then each element of pDeviceMasks must have a value for which all set bits are set in one of the elements of VkDeviceGroupPresentCapabilitiesKHX::presentMask' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-mode-01300)~^~ -VALIDATION_ERROR_06400a2a~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-VkDeviceGroupPresentInfoKHX-mode-01301~^~core~^~The spec valid usage text states 'If mode is VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHX, then for each bit set in each element of pDeviceMasks, the corresponding element of VkDeviceGroupPresentCapabilitiesKHX::presentMask must be non-zero' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-mode-01301)~^~ -VALIDATION_ERROR_06400a2c~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-VkDeviceGroupPresentInfoKHX-pDeviceMasks-01302~^~core~^~The spec valid usage text states 'The value of each element of pDeviceMasks must be equal to the device mask passed in VkAcquireNextImageInfoKHX::deviceMask when the image index was last acquired' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-pDeviceMasks-01302)~^~ -VALIDATION_ERROR_06400a2e~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-VkDeviceGroupPresentInfoKHX-mode-01303~^~core~^~The spec valid usage text states 'mode must have exactly one bit set, and that bit must have been included in VkDeviceGroupSwapchainCreateInfoKHX::modes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-mode-01303)~^~ -VALIDATION_ERROR_0640ce01~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-VkDeviceGroupPresentInfoKHX-mode-parameter~^~core~^~The spec valid usage text states 'mode must be a valid VkDeviceGroupPresentModeFlagBitsKHX value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-mode-parameter)~^~implicit -VALIDATION_ERROR_06414001~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-VkDeviceGroupPresentInfoKHX-pDeviceMasks-parameter~^~core~^~The spec valid usage text states 'If swapchainCount is not 0, pDeviceMasks must be a valid pointer to an array of swapchainCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-pDeviceMasks-parameter)~^~implicit -VALIDATION_ERROR_0642b00b~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-VkDeviceGroupPresentInfoKHX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-sType-sType)~^~implicit -VALIDATION_ERROR_06600712~^~N~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-VkDeviceGroupRenderPassBeginInfoKHX-deviceMask-00905~^~core~^~The spec valid usage text states 'deviceMask must be a valid device mask value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfoKHX-deviceMask-00905)~^~ -VALIDATION_ERROR_06600714~^~N~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-VkDeviceGroupRenderPassBeginInfoKHX-deviceMask-00906~^~core~^~The spec valid usage text states 'deviceMask must not be zero' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfoKHX-deviceMask-00906)~^~ -VALIDATION_ERROR_06600716~^~N~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-VkDeviceGroupRenderPassBeginInfoKHX-deviceMask-00907~^~core~^~The spec valid usage text states 'deviceMask must be a subset of the command buffer's initial device mask' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfoKHX-deviceMask-00907)~^~ -VALIDATION_ERROR_06600718~^~N~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-VkDeviceGroupRenderPassBeginInfoKHX-deviceRenderAreaCount-00908~^~core~^~The spec valid usage text states 'deviceRenderAreaCount must either be zero or equal to the number of physical devices in the logical device.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfoKHX-deviceRenderAreaCount-00908)~^~ -VALIDATION_ERROR_06614201~^~N~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-VkDeviceGroupRenderPassBeginInfoKHX-pDeviceRenderAreas-parameter~^~core~^~The spec valid usage text states 'If deviceRenderAreaCount is not 0, pDeviceRenderAreas must be a valid pointer to an array of deviceRenderAreaCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfoKHX-pDeviceRenderAreas-parameter)~^~implicit -VALIDATION_ERROR_0662b00b~^~N~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-VkDeviceGroupRenderPassBeginInfoKHX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfoKHX-sType-sType)~^~implicit -VALIDATION_ERROR_068000a4~^~N~^~Unknown~^~vkQueueSubmit~^~VUID-VkDeviceGroupSubmitInfoKHX-waitSemaphoreCount-00082~^~core~^~The spec valid usage text states 'waitSemaphoreCount must equal VkSubmitInfo::waitSemaphoreCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSubmitInfoKHX-waitSemaphoreCount-00082)~^~ -VALIDATION_ERROR_068000a6~^~N~^~Unknown~^~vkQueueSubmit~^~VUID-VkDeviceGroupSubmitInfoKHX-commandBufferCount-00083~^~core~^~The spec valid usage text states 'commandBufferCount must equal VkSubmitInfo::commandBufferCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSubmitInfoKHX-commandBufferCount-00083)~^~ -VALIDATION_ERROR_068000a8~^~N~^~Unknown~^~vkQueueSubmit~^~VUID-VkDeviceGroupSubmitInfoKHX-signalSemaphoreCount-00084~^~core~^~The spec valid usage text states 'signalSemaphoreCount must equal VkSubmitInfo::signalSemaphoreCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSubmitInfoKHX-signalSemaphoreCount-00084)~^~ -VALIDATION_ERROR_068000aa~^~N~^~Unknown~^~vkQueueSubmit~^~VUID-VkDeviceGroupSubmitInfoKHX-pWaitSemaphoreDeviceIndices-00085~^~core~^~The spec valid usage text states 'All elements of pWaitSemaphoreDeviceIndices and pSignalSemaphoreDeviceIndices must be valid device indices' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSubmitInfoKHX-pWaitSemaphoreDeviceIndices-00085)~^~ -VALIDATION_ERROR_068000ac~^~N~^~Unknown~^~vkQueueSubmit~^~VUID-VkDeviceGroupSubmitInfoKHX-pCommandBufferDeviceMasks-00086~^~core~^~The spec valid usage text states 'All elements of pCommandBufferDeviceMasks must be valid device masks' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSubmitInfoKHX-pCommandBufferDeviceMasks-00086)~^~ -VALIDATION_ERROR_06811201~^~N~^~Unknown~^~vkQueueSubmit~^~VUID-VkDeviceGroupSubmitInfoKHX-pCommandBufferDeviceMasks-parameter~^~core~^~The spec valid usage text states 'If commandBufferCount is not 0, pCommandBufferDeviceMasks must be a valid pointer to an array of commandBufferCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSubmitInfoKHX-pCommandBufferDeviceMasks-parameter)~^~implicit -VALIDATION_ERROR_06823001~^~N~^~Unknown~^~vkQueueSubmit~^~VUID-VkDeviceGroupSubmitInfoKHX-pSignalSemaphoreDeviceIndices-parameter~^~core~^~The spec valid usage text states 'If signalSemaphoreCount is not 0, pSignalSemaphoreDeviceIndices must be a valid pointer to an array of signalSemaphoreCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSubmitInfoKHX-pSignalSemaphoreDeviceIndices-parameter)~^~implicit -VALIDATION_ERROR_06827201~^~N~^~Unknown~^~vkQueueSubmit~^~VUID-VkDeviceGroupSubmitInfoKHX-pWaitSemaphoreDeviceIndices-parameter~^~core~^~The spec valid usage text states 'If waitSemaphoreCount is not 0, pWaitSemaphoreDeviceIndices must be a valid pointer to an array of waitSemaphoreCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSubmitInfoKHX-pWaitSemaphoreDeviceIndices-parameter)~^~implicit -VALIDATION_ERROR_0682b00b~^~N~^~Unknown~^~vkQueueSubmit~^~VUID-VkDeviceGroupSubmitInfoKHX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSubmitInfoKHX-sType-sType)~^~implicit -VALIDATION_ERROR_06a0d001~^~N~^~Unknown~^~vkCreateSwapchainKHR~^~VUID-VkDeviceGroupSwapchainCreateInfoKHX-modes-parameter~^~core~^~The spec valid usage text states 'modes must be a valid combination of VkDeviceGroupPresentModeFlagBitsKHX values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSwapchainCreateInfoKHX-modes-parameter)~^~implicit -VALIDATION_ERROR_06a0d003~^~N~^~Unknown~^~vkCreateSwapchainKHR~^~VUID-VkDeviceGroupSwapchainCreateInfoKHX-modes-requiredbitmask~^~core~^~The spec valid usage text states 'modes must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSwapchainCreateInfoKHX-modes-requiredbitmask)~^~implicit -VALIDATION_ERROR_06a2b00b~^~N~^~Unknown~^~vkCreateSwapchainKHR~^~VUID-VkDeviceGroupSwapchainCreateInfoKHX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSwapchainCreateInfoKHX-sType-sType)~^~implicit -VALIDATION_ERROR_06c002fa~^~Y~^~Unknown~^~vkDestroyDevice~^~VUID-VkDeviceQueueCreateInfo-queueFamilyIndex-00381~^~core~^~The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-queueFamilyIndex-00381)~^~ -VALIDATION_ERROR_06c002fc~^~Y~^~Unknown~^~vkDestroyDevice~^~VUID-VkDeviceQueueCreateInfo-queueCount-00382~^~core~^~The spec valid usage text states 'queueCount must be less than or equal to the queueCount member of the VkQueueFamilyProperties structure, as returned by vkGetPhysicalDeviceQueueFamilyProperties in the pQueueFamilyProperties[queueFamilyIndex]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-queueCount-00382)~^~ -VALIDATION_ERROR_06c002fe~^~Y~^~Unknown~^~vkDestroyDevice~^~VUID-VkDeviceQueueCreateInfo-pQueuePriorities-00383~^~core~^~The spec valid usage text states 'Each element of pQueuePriorities must be between 0.0 and 1.0 inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-pQueuePriorities-00383)~^~ -VALIDATION_ERROR_06c09005~^~Y~^~Unknown~^~vkDestroyDevice~^~VUID-VkDeviceQueueCreateInfo-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-flags-zerobitmask)~^~implicit -VALIDATION_ERROR_06c1c40d~^~Y~^~Unknown~^~vkDestroyDevice~^~VUID-VkDeviceQueueCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkDeviceQueueGlobalPriorityCreateInfoEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-pNext-pNext)~^~implicit -VALIDATION_ERROR_06c20401~^~Y~^~Unknown~^~vkDestroyDevice~^~VUID-VkDeviceQueueCreateInfo-pQueuePriorities-parameter~^~core~^~The spec valid usage text states 'pQueuePriorities must be a valid pointer to an array of queueCount float values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-pQueuePriorities-parameter)~^~implicit -VALIDATION_ERROR_06c29e1b~^~Y~^~Unknown~^~vkDestroyDevice~^~VUID-VkDeviceQueueCreateInfo-queueCount-arraylength~^~core~^~The spec valid usage text states 'queueCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-queueCount-arraylength)~^~implicit -VALIDATION_ERROR_06c2b00b~^~N~^~Unknown~^~vkDestroyDevice~^~VUID-VkDeviceQueueCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-sType-sType)~^~implicit -VALIDATION_ERROR_06e00342~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-VkDispatchIndirectCommand-x-00417~^~core~^~The spec valid usage text states 'x must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[0]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDispatchIndirectCommand-x-00417)~^~ -VALIDATION_ERROR_06e00344~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-VkDispatchIndirectCommand-y-00418~^~core~^~The spec valid usage text states 'y must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[1]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDispatchIndirectCommand-y-00418)~^~ -VALIDATION_ERROR_06e00346~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-VkDispatchIndirectCommand-z-00419~^~core~^~The spec valid usage text states 'z must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[2]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDispatchIndirectCommand-z-00419)~^~ -VALIDATION_ERROR_07006201~^~Y~^~Unknown~^~vkRegisterDisplayEventEXT~^~VUID-VkDisplayEventInfoEXT-displayEvent-parameter~^~core~^~The spec valid usage text states 'displayEvent must be a valid VkDisplayEventTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayEventInfoEXT-displayEvent-parameter)~^~implicit -VALIDATION_ERROR_0701c40d~^~Y~^~Unknown~^~vkRegisterDisplayEventEXT~^~VUID-VkDisplayEventInfoEXT-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayEventInfoEXT-pNext-pNext)~^~implicit -VALIDATION_ERROR_0702b00b~^~Y~^~Unknown~^~vkRegisterDisplayEventEXT~^~VUID-VkDisplayEventInfoEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayEventInfoEXT-sType-sType)~^~implicit -VALIDATION_ERROR_072009c4~^~N~^~Unknown~^~vkCreateDisplayModeKHR~^~VUID-VkDisplayModeCreateInfoKHR-width-01250~^~core~^~The spec valid usage text states 'The width and height members of the visibleRegion member of parameters must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-width-01250)~^~ -VALIDATION_ERROR_072009c6~^~N~^~Unknown~^~vkCreateDisplayModeKHR~^~VUID-VkDisplayModeCreateInfoKHR-refreshRate-01251~^~core~^~The spec valid usage text states 'The refreshRate member of parameters must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-refreshRate-01251)~^~ -VALIDATION_ERROR_07209005~^~Y~^~Unknown~^~vkCreateDisplayModeKHR~^~VUID-VkDisplayModeCreateInfoKHR-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-flags-zerobitmask)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0721c40d~^~Y~^~Unknown~^~vkCreateDisplayModeKHR~^~VUID-VkDisplayModeCreateInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0722b00b~^~Y~^~Unknown~^~vkCreateDisplayModeKHR~^~VUID-VkDisplayModeCreateInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0741c40d~^~Y~^~Unknown~^~vkDisplayPowerControlEXT~^~VUID-VkDisplayPowerInfoEXT-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayPowerInfoEXT-pNext-pNext)~^~implicit -VALIDATION_ERROR_07428a01~^~Y~^~Unknown~^~vkDisplayPowerControlEXT~^~VUID-VkDisplayPowerInfoEXT-powerState-parameter~^~core~^~The spec valid usage text states 'powerState must be a valid VkDisplayPowerStateEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayPowerInfoEXT-powerState-parameter)~^~implicit -VALIDATION_ERROR_0742b00b~^~Y~^~Unknown~^~vkDisplayPowerControlEXT~^~VUID-VkDisplayPowerInfoEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayPowerInfoEXT-sType-sType)~^~implicit -VALIDATION_ERROR_076009d2~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-VkDisplayPresentInfoKHR-srcRect-01257~^~core~^~The spec valid usage text states 'srcRect must specify a rectangular region that is a subset of the image being presented' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayPresentInfoKHR-srcRect-01257)~^~ -VALIDATION_ERROR_076009d4~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-VkDisplayPresentInfoKHR-dstRect-01258~^~core~^~The spec valid usage text states 'dstRect must specify a rectangular region that is a subset of the visibleRegion parameter of the display mode the swapchain being presented uses' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayPresentInfoKHR-dstRect-01258)~^~ -VALIDATION_ERROR_076009d6~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-VkDisplayPresentInfoKHR-persistentContent-01259~^~core~^~The spec valid usage text states 'If the persistentContent member of the VkDisplayPropertiesKHR structure returned by vkGetPhysicalDeviceDisplayPropertiesKHR for the display the present operation targets then persistent must be VK_FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayPresentInfoKHR-persistentContent-01259)~^~ -VALIDATION_ERROR_0762b00b~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-VkDisplayPresentInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayPresentInfoKHR-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_078009c8~^~N~^~Unknown~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-planeIndex-01252~^~core~^~The spec valid usage text states 'planeIndex must be less than the number of display planes supported by the device as determined by calling vkGetPhysicalDeviceDisplayPlanePropertiesKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-planeIndex-01252)~^~ -VALIDATION_ERROR_078009ca~^~N~^~Unknown~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-planeReorderPossible-01253~^~core~^~The spec valid usage text states 'If the planeReorderPossible member of the VkDisplayPropertiesKHR structure returned by vkGetPhysicalDeviceDisplayPropertiesKHR for the display corresponding to displayMode is VK_TRUE then planeStackIndex must be less than the number of display planes supported by the device as determined by calling vkGetPhysicalDeviceDisplayPlanePropertiesKHR; otherwise planeStackIndex must equal the currentStackIndex member of VkDisplayPlanePropertiesKHR returned by vkGetPhysicalDeviceDisplayPlanePropertiesKHR for the display plane corresponding to displayMode' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-planeReorderPossible-01253)~^~ -VALIDATION_ERROR_078009cc~^~N~^~Unknown~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-01254~^~core~^~The spec valid usage text states 'If alphaMode is VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR then globalAlpha must be between 0 and 1, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-01254)~^~ -VALIDATION_ERROR_078009ce~^~N~^~Unknown~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-01255~^~core~^~The spec valid usage text states 'alphaMode must be 0 or one of the bits present in the supportedAlpha member of VkDisplayPlaneCapabilitiesKHR returned by vkGetDisplayPlaneCapabilitiesKHR for the display plane corresponding to displayMode' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-01255)~^~ -VALIDATION_ERROR_078009d0~^~N~^~Unknown~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-width-01256~^~core~^~The spec valid usage text states 'The width and height members of imageExtent must be less than the maxImageDimensions2D member of VkPhysicalDeviceLimits' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-width-01256)~^~ -VALIDATION_ERROR_07800a01~^~Y~^~Unknown~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-parameter~^~core~^~The spec valid usage text states 'alphaMode must be a valid VkDisplayPlaneAlphaFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-parameter)~^~implicit -VALIDATION_ERROR_07806401~^~Y~^~Unknown~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-displayMode-parameter~^~core~^~The spec valid usage text states 'displayMode must be a valid VkDisplayModeKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-displayMode-parameter)~^~implicit -VALIDATION_ERROR_07809005~^~Y~^~Unknown~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-flags-zerobitmask)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0781c40d~^~Y~^~Unknown~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0782b00b~^~Y~^~Unknown~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_07830201~^~Y~^~Unknown~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-transform-parameter~^~core~^~The spec valid usage text states 'transform must be a valid VkSurfaceTransformFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-transform-parameter)~^~implicit -VALIDATION_ERROR_07a00450~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-VkDrawIndexedIndirectCommand-None-00552~^~core~^~The spec valid usage text states 'For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDrawIndexedIndirectCommand-None-00552)~^~ -VALIDATION_ERROR_07a00452~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-VkDrawIndexedIndirectCommand-indexSize-00553~^~core~^~The spec valid usage text states '(indexSize * (firstIndex + indexCount) + offset) must be less than or equal to the size of the currently bound index buffer, with indexSize being based on the type specified by indexType, where the index buffer, indexType, and offset are specified via vkCmdBindIndexBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDrawIndexedIndirectCommand-indexSize-00553)~^~ -VALIDATION_ERROR_07a00454~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-VkDrawIndexedIndirectCommand-firstInstance-00554~^~core~^~The spec valid usage text states 'If the drawIndirectFirstInstance feature is not enabled, firstInstance must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDrawIndexedIndirectCommand-firstInstance-00554)~^~ -VALIDATION_ERROR_07c003e8~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-VkDrawIndirectCommand-None-00500~^~core~^~The spec valid usage text states 'For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDrawIndirectCommand-None-00500)~^~ -VALIDATION_ERROR_07c003ea~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-VkDrawIndirectCommand-firstInstance-00501~^~core~^~The spec valid usage text states 'If the drawIndirectFirstInstance feature is not enabled, firstInstance must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDrawIndirectCommand-firstInstance-00501)~^~ -VALIDATION_ERROR_07e09005~^~Y~^~Unknown~^~vkCreateEvent~^~VUID-VkEventCreateInfo-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkEventCreateInfo-flags-zerobitmask)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_07e1c40d~^~Y~^~Unknown~^~vkCreateEvent~^~VUID-VkEventCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkEventCreateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_07e2b00b~^~Y~^~Unknown~^~vkCreateEvent~^~VUID-VkEventCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkEventCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_08000520~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkExportMemoryAllocateInfoKHR-handleTypes-00656~^~core~^~The spec valid usage text states 'The bits in handleTypes must be supported and compatible, as reported by VkExternalImageFormatPropertiesKHR or VkExternalBufferPropertiesKHR.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryAllocateInfoKHR-handleTypes-00656)~^~ -VALIDATION_ERROR_08009e01~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkExportMemoryAllocateInfoKHR-handleTypes-parameter~^~core~^~The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryAllocateInfoKHR-handleTypes-parameter)~^~implicit -VALIDATION_ERROR_0801c40d~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkExportMemoryAllocateInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryAllocateInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_0802b00b~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkExportMemoryAllocateInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryAllocateInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_08209e01~^~N~^~Unknown~^~vkGetMemoryFdPropertiesKHR~^~VUID-VkExportMemoryAllocateInfoNV-handleTypes-parameter~^~core~^~The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryAllocateInfoNV-handleTypes-parameter)~^~implicit -VALIDATION_ERROR_0821c40d~^~N~^~Unknown~^~vkGetMemoryFdPropertiesKHR~^~VUID-VkExportMemoryAllocateInfoNV-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryAllocateInfoNV-pNext-pNext)~^~implicit -VALIDATION_ERROR_0822b00b~^~N~^~Unknown~^~vkGetMemoryFdPropertiesKHR~^~VUID-VkExportMemoryAllocateInfoNV-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryAllocateInfoNV-sType-sType)~^~implicit -VALIDATION_ERROR_08400522~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkExportMemoryWin32HandleInfoKHR-handleTypes-00657~^~core~^~The spec valid usage text states 'If VkExportMemoryAllocateInfoKHR::handleTypes does not include VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR, VkExportMemoryWin32HandleInfoKHR must not be in the pNext chain of VkMemoryAllocateInfo.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoKHR-handleTypes-00657)~^~ -VALIDATION_ERROR_0840f401~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkExportMemoryWin32HandleInfoKHR-pAttributes-parameter~^~core~^~The spec valid usage text states 'If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoKHR-pAttributes-parameter)~^~implicit -VALIDATION_ERROR_0841c40d~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkExportMemoryWin32HandleInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_0842b00b~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-VkExportMemoryWin32HandleInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_0860f401~^~N~^~Unknown~^~vkGetMemoryFdPropertiesKHR~^~VUID-VkExportMemoryWin32HandleInfoNV-pAttributes-parameter~^~core~^~The spec valid usage text states 'If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoNV-pAttributes-parameter)~^~implicit -VALIDATION_ERROR_0861c40d~^~N~^~Unknown~^~vkGetMemoryFdPropertiesKHR~^~VUID-VkExportMemoryWin32HandleInfoNV-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoNV-pNext-pNext)~^~implicit -VALIDATION_ERROR_0862b00b~^~N~^~Unknown~^~vkGetMemoryFdPropertiesKHR~^~VUID-VkExportMemoryWin32HandleInfoNV-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoNV-sType-sType)~^~implicit -VALIDATION_ERROR_088008c8~^~N~^~Unknown~^~vkCreateSemaphore~^~VUID-VkExportSemaphoreCreateInfoKHR-handleTypes-01124~^~core~^~The spec valid usage text states 'The bits in handleTypes must be supported and compatible, as reported by VkExternalSemaphorePropertiesKHR.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportSemaphoreCreateInfoKHR-handleTypes-01124)~^~ -VALIDATION_ERROR_08809e01~^~N~^~Unknown~^~vkCreateSemaphore~^~VUID-VkExportSemaphoreCreateInfoKHR-handleTypes-parameter~^~core~^~The spec valid usage text states 'handleTypes must be a valid combination of VkExternalSemaphoreHandleTypeFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportSemaphoreCreateInfoKHR-handleTypes-parameter)~^~implicit -VALIDATION_ERROR_0881c40d~^~N~^~Unknown~^~vkCreateSemaphore~^~VUID-VkExportSemaphoreCreateInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportSemaphoreCreateInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_0882b00b~^~N~^~Unknown~^~vkCreateSemaphore~^~VUID-VkExportSemaphoreCreateInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportSemaphoreCreateInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_08a008ca~^~N~^~Unknown~^~vkCreateSemaphore~^~VUID-VkExportSemaphoreWin32HandleInfoKHR-handleTypes-01125~^~core~^~The spec valid usage text states 'If VkExportSemaphoreCreateInfoKHR::handleTypes does not include VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR or VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHR, VkExportSemaphoreWin32HandleInfoKHR must not be in the pNext chain of VkSemaphoreCreateInfo.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportSemaphoreWin32HandleInfoKHR-handleTypes-01125)~^~ -VALIDATION_ERROR_08a0f401~^~N~^~Unknown~^~vkCreateSemaphore~^~VUID-VkExportSemaphoreWin32HandleInfoKHR-pAttributes-parameter~^~core~^~The spec valid usage text states 'If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportSemaphoreWin32HandleInfoKHR-pAttributes-parameter)~^~implicit -VALIDATION_ERROR_08a1c40d~^~N~^~Unknown~^~vkCreateSemaphore~^~VUID-VkExportSemaphoreWin32HandleInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportSemaphoreWin32HandleInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_08a2b00b~^~N~^~Unknown~^~vkCreateSemaphore~^~VUID-VkExportSemaphoreWin32HandleInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportSemaphoreWin32HandleInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_08c09e01~^~N~^~Unknown~^~vkCreateBuffer~^~VUID-VkExternalMemoryBufferCreateInfoKHR-handleTypes-parameter~^~core~^~The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryBufferCreateInfoKHR-handleTypes-parameter)~^~implicit -VALIDATION_ERROR_08c1c40d~^~N~^~Unknown~^~vkCreateBuffer~^~VUID-VkExternalMemoryBufferCreateInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryBufferCreateInfoKHR-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_08c2b00b~^~N~^~Unknown~^~vkCreateBuffer~^~VUID-VkExternalMemoryBufferCreateInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryBufferCreateInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_08e09e01~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkExternalMemoryImageCreateInfoKHR-handleTypes-parameter~^~core~^~The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfoKHR-handleTypes-parameter)~^~implicit -VALIDATION_ERROR_08e09e03~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkExternalMemoryImageCreateInfoKHR-handleTypes-requiredbitmask~^~core~^~The spec valid usage text states 'handleTypes must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfoKHR-handleTypes-requiredbitmask)~^~implicit -VALIDATION_ERROR_08e1c40d~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkExternalMemoryImageCreateInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_08e2b00b~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkExternalMemoryImageCreateInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_09009e01~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkExternalMemoryImageCreateInfoNV-handleTypes-parameter~^~core~^~The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfoNV-handleTypes-parameter)~^~implicit -VALIDATION_ERROR_0901c40d~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkExternalMemoryImageCreateInfoNV-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfoNV-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0902b00b~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkExternalMemoryImageCreateInfoNV-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfoNV-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_09209001~^~Y~^~Unknown~^~vkCreateFence~^~VUID-VkFenceCreateInfo-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkFenceCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceCreateInfo-flags-parameter)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0921c40d~^~Y~^~Unknown~^~vkCreateFence~^~VUID-VkFenceCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkExportFenceCreateInfoKHR or VkExportFenceWin32HandleInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceCreateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0922b00b~^~Y~^~Unknown~^~vkCreateFence~^~VUID-VkFenceCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_04e04e01~^~Y~^~Unknown~^~VkDescriptorSetLayoutBinding~^~VUID-VkDescriptorSetLayoutBinding-descriptorType-parameter~^~core~^~The spec valid usage text states 'descriptorType must be a valid VkDescriptorType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutBinding-descriptorType-parameter)~^~implicit +VALIDATION_ERROR_0500022e~^~Y~^~DuplicateDescriptorBinding~^~VkDescriptorSetLayoutCreateInfo~^~VUID-VkDescriptorSetLayoutCreateInfo-binding-00279~^~core~^~The spec valid usage text states 'The VkDescriptorSetLayoutBinding::binding members of the elements of the pBindings array must each have different values.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-binding-00279)~^~ +VALIDATION_ERROR_05000230~^~Y~^~InvalidPushDescriptorSetLayout~^~VkDescriptorSetLayoutCreateInfo~^~VUID-VkDescriptorSetLayoutCreateInfo-flags-00280~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'If flags contains VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then all elements of pBindings must not have a descriptorType of VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-flags-00280)~^~ +VALIDATION_ERROR_05000232~^~Y~^~InvalidPushDescriptorSetLayout~^~VkDescriptorSetLayoutCreateInfo~^~VUID-VkDescriptorSetLayoutCreateInfo-flags-00281~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'If flags contains VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then the total number of elements of all bindings must be less than or equal to VkPhysicalDevicePushDescriptorPropertiesKHR::maxPushDescriptors' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-flags-00281)~^~ +VALIDATION_ERROR_05001770~^~Y~^~DescriptorIndexingSetLayout~^~VkDescriptorSetLayoutCreateInfo~^~VUID-VkDescriptorSetLayoutCreateInfo-flags-03000~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If any binding has the VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT bit set, flags must include VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-flags-03000)~^~ +VALIDATION_ERROR_05001772~^~N~^~None~^~VkDescriptorSetLayoutCreateInfo~^~VUID-VkDescriptorSetLayoutCreateInfo-descriptorType-03001~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If any binding has the VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT bit set, then all bindings must not have descriptorType of VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-descriptorType-03001)~^~ +VALIDATION_ERROR_05009001~^~Y~^~Unknown~^~VkDescriptorSetLayoutCreateInfo~^~VUID-VkDescriptorSetLayoutCreateInfo-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkDescriptorSetLayoutCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-flags-parameter)~^~implicit +VALIDATION_ERROR_0500fc01~^~Y~^~Unknown~^~VkDescriptorSetLayoutCreateInfo~^~VUID-VkDescriptorSetLayoutCreateInfo-pBindings-parameter~^~core~^~The spec valid usage text states 'If bindingCount is not 0, pBindings must be a valid pointer to an array of bindingCount valid VkDescriptorSetLayoutBinding structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-pBindings-parameter)~^~implicit +VALIDATION_ERROR_0501c40d~^~Y~^~Unknown~^~VkDescriptorSetLayoutCreateInfo~^~VUID-VkDescriptorSetLayoutCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkDescriptorSetLayoutBindingFlagsCreateInfoEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0502b00b~^~Y~^~Unknown~^~VkDescriptorSetLayoutCreateInfo~^~VUID-VkDescriptorSetLayoutCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_05200009~^~Y~^~Unknown~^~VkDescriptorUpdateTemplateCreateInfo~^~VUID-VkDescriptorUpdateTemplateCreateInfo-commonparent~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'Both of descriptorSetLayout, and pipelineLayout that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-commonparent)~^~implicit +VALIDATION_ERROR_052002bc~^~Y~^~CreateDescriptorUpdateTemplate~^~VkDescriptorUpdateTemplateCreateInfo~^~VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00350~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, descriptorSetLayout must be a valid VkDescriptorSetLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00350)~^~ +VALIDATION_ERROR_052002be~^~Y~^~CreateDescriptorUpdateTemplate~^~VkDescriptorUpdateTemplateCreateInfo~^~VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00351~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)+(VK_KHR_push_descriptor)~^~The spec valid usage text states 'If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, pipelineBindPoint must be a valid VkPipelineBindPoint value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00351)~^~ +VALIDATION_ERROR_052002c0~^~Y~^~CreateDescriptorUpdateTemplate~^~VkDescriptorUpdateTemplateCreateInfo~^~VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00352~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)+(VK_KHR_push_descriptor)~^~The spec valid usage text states 'If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, pipelineLayout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00352)~^~ +VALIDATION_ERROR_052002c2~^~Y~^~CreateDescriptorUpdateTemplate~^~VkDescriptorUpdateTemplateCreateInfo~^~VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00353~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)+(VK_KHR_push_descriptor)~^~The spec valid usage text states 'If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, set must be the unique set number in the pipeline layout that uses a descriptor set layout that was created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00353)~^~ +VALIDATION_ERROR_05204c01~^~Y~^~Unknown~^~VkDescriptorUpdateTemplateCreateInfo~^~VUID-VkDescriptorUpdateTemplateCreateInfo-descriptorSetLayout-parameter~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'If descriptorSetLayout is not VK_NULL_HANDLE, descriptorSetLayout must be a valid VkDescriptorSetLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-descriptorSetLayout-parameter)~^~implicit +VALIDATION_ERROR_0520501b~^~Y~^~Unknown~^~VkDescriptorUpdateTemplateCreateInfo~^~VUID-VkDescriptorUpdateTemplateCreateInfo-descriptorUpdateEntryCount-arraylength~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'descriptorUpdateEntryCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-descriptorUpdateEntryCount-arraylength)~^~implicit +VALIDATION_ERROR_05209005~^~Y~^~Unknown~^~VkDescriptorUpdateTemplateCreateInfo~^~VUID-VkDescriptorUpdateTemplateCreateInfo-flags-zerobitmask~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-flags-zerobitmask)~^~implicit +VALIDATION_ERROR_05213201~^~Y~^~Unknown~^~VkDescriptorUpdateTemplateCreateInfo~^~VUID-VkDescriptorUpdateTemplateCreateInfo-pDescriptorUpdateEntries-parameter~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'pDescriptorUpdateEntries must be a valid pointer to an array of descriptorUpdateEntryCount valid VkDescriptorUpdateTemplateEntry structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-pDescriptorUpdateEntries-parameter)~^~implicit +VALIDATION_ERROR_0521c40d~^~Y~^~Unknown~^~VkDescriptorUpdateTemplateCreateInfo~^~VUID-VkDescriptorUpdateTemplateCreateInfo-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-pNext-pNext)~^~implicit +VALIDATION_ERROR_0522b00b~^~Y~^~Unknown~^~VkDescriptorUpdateTemplateCreateInfo~^~VUID-VkDescriptorUpdateTemplateCreateInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-sType-sType)~^~implicit +VALIDATION_ERROR_0522f801~^~Y~^~Unknown~^~VkDescriptorUpdateTemplateCreateInfo~^~VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-parameter~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'templateType must be a valid VkDescriptorUpdateTemplateType value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-parameter)~^~implicit +VALIDATION_ERROR_054002c4~^~N~^~Unknown~^~VkDescriptorUpdateTemplateEntry~^~VUID-VkDescriptorUpdateTemplateEntry-dstBinding-00354~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'dstBinding must be a valid binding in the descriptor set layout implicitly specified when using a descriptor update template to update descriptors.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateEntry-dstBinding-00354)~^~ +VALIDATION_ERROR_054002c6~^~N~^~Unknown~^~VkDescriptorUpdateTemplateEntry~^~VUID-VkDescriptorUpdateTemplateEntry-dstArrayElement-00355~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'dstArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding implicitly specified when using a descriptor update template to update descriptors, and all applicable consecutive bindings, as described by descriptorsets-updates-consecutive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateEntry-dstArrayElement-00355)~^~ +VALIDATION_ERROR_05404e01~^~Y~^~Unknown~^~VkDescriptorUpdateTemplateEntry~^~VUID-VkDescriptorUpdateTemplateEntry-descriptorType-parameter~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'descriptorType must be a valid VkDescriptorType value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateEntry-descriptorType-parameter)~^~implicit +VALIDATION_ERROR_056002e8~^~Y~^~Unknown~^~VkDeviceCreateInfo~^~VUID-VkDeviceCreateInfo-queueFamilyIndex-00372~^~core~^~The spec valid usage text states '' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-queueFamilyIndex-00372)~^~ +VALIDATION_ERROR_056002ea~^~N~^~Unknown~^~VkDeviceCreateInfo~^~VUID-VkDeviceCreateInfo-pNext-00373~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'If the pNext chain includes a VkPhysicalDeviceFeatures2 structure, then pEnabledFeatures must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceCreateInfo-pNext-00373)~^~ +VALIDATION_ERROR_056002ec~^~Y~^~Maintenance1AndNegativeViewport~^~VkDeviceCreateInfo~^~VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-00374~^~(VK_AMD_negative_viewport_height)+!(VK_VERSION_1_1)+(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'ppEnabledExtensionNames must not contain both VK_KHR_maintenance1 and VK_AMD_negative_viewport_height' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-00374)~^~ +VALIDATION_ERROR_05600e60~^~N~^~None~^~VkDeviceCreateInfo~^~VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-01840~^~(VK_AMD_negative_viewport_height)+(VK_VERSION_1_1)~^~The spec valid usage text states 'ppEnabledExtensionNames must not contain VK_AMD_negative_viewport_height' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-01840)~^~ +VALIDATION_ERROR_05609005~^~Y~^~Unknown~^~VkDeviceCreateInfo~^~VUID-VkDeviceCreateInfo-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-flags-zerobitmask)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_05615a01~^~N~^~Unknown~^~VkDeviceCreateInfo~^~VUID-VkDeviceCreateInfo-pEnabledFeatures-parameter~^~core~^~The spec valid usage text states 'If pEnabledFeatures is not NULL, pEnabledFeatures must be a valid pointer to a valid VkPhysicalDeviceFeatures structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-pEnabledFeatures-parameter)~^~implicit +VALIDATION_ERROR_0561c40d~^~N~^~Unknown~^~VkDeviceCreateInfo~^~VUID-VkDeviceCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDeviceGroupDeviceCreateInfo, VkPhysicalDevice16BitStorageFeatures, VkPhysicalDeviceDescriptorIndexingFeaturesEXT, VkPhysicalDeviceFeatures2, VkPhysicalDeviceMultiviewFeatures, VkPhysicalDeviceProtectedMemoryFeatures, VkPhysicalDeviceSamplerYcbcrConversionFeatures, or VkPhysicalDeviceVariablePointerFeatures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-pNext-pNext)~^~implicit +VALIDATION_ERROR_0561fe01~^~Y~^~Unknown~^~VkDeviceCreateInfo~^~VUID-VkDeviceCreateInfo-pQueueCreateInfos-parameter~^~core~^~The spec valid usage text states 'pQueueCreateInfos must be a valid pointer to an array of queueCreateInfoCount valid VkDeviceQueueCreateInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-pQueueCreateInfos-parameter)~^~implicit +VALIDATION_ERROR_05628e01~^~Y~^~Unknown~^~VkDeviceCreateInfo~^~VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-parameter~^~core~^~The spec valid usage text states 'If enabledExtensionCount is not 0, ppEnabledExtensionNames must be a valid pointer to an array of enabledExtensionCount null-terminated UTF-8 strings' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-parameter)~^~implicit +VALIDATION_ERROR_05629001~^~Y~^~Unknown~^~VkDeviceCreateInfo~^~VUID-VkDeviceCreateInfo-ppEnabledLayerNames-parameter~^~core~^~The spec valid usage text states 'If enabledLayerCount is not 0, ppEnabledLayerNames must be a valid pointer to an array of enabledLayerCount null-terminated UTF-8 strings' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-ppEnabledLayerNames-parameter)~^~implicit +VALIDATION_ERROR_0562a01b~^~N~^~Unknown~^~VkDeviceCreateInfo~^~VUID-VkDeviceCreateInfo-queueCreateInfoCount-arraylength~^~core~^~The spec valid usage text states 'queueCreateInfoCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-queueCreateInfoCount-arraylength)~^~implicit +VALIDATION_ERROR_0562b00b~^~Y~^~Unknown~^~VkDeviceCreateInfo~^~VUID-VkDeviceCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0562b00f~^~N~^~Unknown~^~VkDeviceCreateInfo~^~VUID-VkDeviceCreateInfo-sType-unique~^~core~^~The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-sType-unique)~^~implicit +VALIDATION_ERROR_05805801~^~Y~^~Unknown~^~VkDeviceEventInfoEXT~^~VUID-VkDeviceEventInfoEXT-deviceEvent-parameter~^~(VK_EXT_display_control)~^~The spec valid usage text states 'deviceEvent must be a valid VkDeviceEventTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceEventInfoEXT-deviceEvent-parameter)~^~implicit +VALIDATION_ERROR_0581c40d~^~Y~^~Unknown~^~VkDeviceEventInfoEXT~^~VUID-VkDeviceEventInfoEXT-pNext-pNext~^~(VK_EXT_display_control)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceEventInfoEXT-pNext-pNext)~^~implicit +VALIDATION_ERROR_0582b00b~^~Y~^~Unknown~^~VkDeviceEventInfoEXT~^~VUID-VkDeviceEventInfoEXT-sType-sType~^~(VK_EXT_display_control)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceEventInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_05a1c40d~^~N~^~Unknown~^~VkDeviceGeneratedCommandsFeaturesNVX~^~VUID-VkDeviceGeneratedCommandsFeaturesNVX-pNext-pNext~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGeneratedCommandsFeaturesNVX-pNext-pNext)~^~implicit +VALIDATION_ERROR_05a2b00b~^~Y~^~Unknown~^~VkDeviceGeneratedCommandsFeaturesNVX~^~VUID-VkDeviceGeneratedCommandsFeaturesNVX-sType-sType~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGeneratedCommandsFeaturesNVX-sType-sType)~^~implicit +VALIDATION_ERROR_05c1c40d~^~N~^~Unknown~^~VkDeviceGeneratedCommandsLimitsNVX~^~VUID-VkDeviceGeneratedCommandsLimitsNVX-pNext-pNext~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGeneratedCommandsLimitsNVX-pNext-pNext)~^~implicit +VALIDATION_ERROR_05c2b00b~^~Y~^~Unknown~^~VkDeviceGeneratedCommandsLimitsNVX~^~VUID-VkDeviceGeneratedCommandsLimitsNVX-sType-sType~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGeneratedCommandsLimitsNVX-sType-sType)~^~implicit +VALIDATION_ERROR_05e008bc~^~N~^~Unknown~^~VkDeviceGroupBindSparseInfo~^~VUID-VkDeviceGroupBindSparseInfo-resourceDeviceIndex-01118~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'resourceDeviceIndex and memoryDeviceIndex must both be valid device indices.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupBindSparseInfo-resourceDeviceIndex-01118)~^~ +VALIDATION_ERROR_05e008be~^~N~^~Unknown~^~VkDeviceGroupBindSparseInfo~^~VUID-VkDeviceGroupBindSparseInfo-memoryDeviceIndex-01119~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'Each memory allocation bound in this batch must have allocated an instance for memoryDeviceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupBindSparseInfo-memoryDeviceIndex-01119)~^~ +VALIDATION_ERROR_05e2b00b~^~N~^~Unknown~^~VkDeviceGroupBindSparseInfo~^~VUID-VkDeviceGroupBindSparseInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupBindSparseInfo-sType-sType)~^~implicit +VALIDATION_ERROR_060000d4~^~N~^~Unknown~^~VkDeviceGroupCommandBufferBeginInfo~^~VUID-VkDeviceGroupCommandBufferBeginInfo-deviceMask-00106~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'deviceMask must be a valid device mask value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupCommandBufferBeginInfo-deviceMask-00106)~^~ +VALIDATION_ERROR_060000d6~^~N~^~Unknown~^~VkDeviceGroupCommandBufferBeginInfo~^~VUID-VkDeviceGroupCommandBufferBeginInfo-deviceMask-00107~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'deviceMask must not be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupCommandBufferBeginInfo-deviceMask-00107)~^~ +VALIDATION_ERROR_0602b00b~^~N~^~Unknown~^~VkDeviceGroupCommandBufferBeginInfo~^~VUID-VkDeviceGroupCommandBufferBeginInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupCommandBufferBeginInfo-sType-sType)~^~implicit +VALIDATION_ERROR_062002ee~^~N~^~Unknown~^~VkDeviceGroupDeviceCreateInfo~^~VUID-VkDeviceGroupDeviceCreateInfo-pPhysicalDevices-00375~^~(VK_VERSION_1_1,VK_KHR_device_group_creation)~^~The spec valid usage text states 'Each element of pPhysicalDevices must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfo-pPhysicalDevices-00375)~^~ +VALIDATION_ERROR_062002f0~^~N~^~Unknown~^~VkDeviceGroupDeviceCreateInfo~^~VUID-VkDeviceGroupDeviceCreateInfo-pPhysicalDevices-00376~^~(VK_VERSION_1_1,VK_KHR_device_group_creation)~^~The spec valid usage text states 'All elements of pPhysicalDevices must be in the same device group as enumerated by vkEnumeratePhysicalDeviceGroups' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfo-pPhysicalDevices-00376)~^~ +VALIDATION_ERROR_062002f2~^~N~^~Unknown~^~VkDeviceGroupDeviceCreateInfo~^~VUID-VkDeviceGroupDeviceCreateInfo-physicalDeviceCount-00377~^~(VK_VERSION_1_1,VK_KHR_device_group_creation)~^~The spec valid usage text states 'If physicalDeviceCount is not 0, the physicalDevice parameter of vkCreateDevice must be an element of pPhysicalDevices.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfo-physicalDeviceCount-00377)~^~ +VALIDATION_ERROR_0621dc01~^~N~^~Unknown~^~VkDeviceGroupDeviceCreateInfo~^~VUID-VkDeviceGroupDeviceCreateInfo-pPhysicalDevices-parameter~^~(VK_VERSION_1_1,VK_KHR_device_group_creation)~^~The spec valid usage text states 'If physicalDeviceCount is not 0, pPhysicalDevices must be a valid pointer to an array of physicalDeviceCount valid VkPhysicalDevice handles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfo-pPhysicalDevices-parameter)~^~implicit +VALIDATION_ERROR_0622b00b~^~N~^~Unknown~^~VkDeviceGroupDeviceCreateInfo~^~VUID-VkDeviceGroupDeviceCreateInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_device_group_creation)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfo-sType-sType)~^~implicit +VALIDATION_ERROR_06400a22~^~N~^~Unknown~^~VkDeviceGroupPresentInfoKHR~^~VUID-VkDeviceGroupPresentInfoKHR-swapchainCount-01297~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'swapchainCount must equal 0 or VkPresentInfoKHR::swapchainCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-swapchainCount-01297)~^~ +VALIDATION_ERROR_06400a24~^~N~^~Unknown~^~VkDeviceGroupPresentInfoKHR~^~VUID-VkDeviceGroupPresentInfoKHR-mode-01298~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If mode is VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR, then each element of pDeviceMasks must have exactly one bit set, and the corresponding element of VkDeviceGroupPresentCapabilitiesKHR::presentMask must be non-zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-mode-01298)~^~ +VALIDATION_ERROR_06400a26~^~N~^~Unknown~^~VkDeviceGroupPresentInfoKHR~^~VUID-VkDeviceGroupPresentInfoKHR-mode-01299~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If mode is VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR, then each element of pDeviceMasks must have exactly one bit set, and some physical device in the logical device must include that bit in its VkDeviceGroupPresentCapabilitiesKHR::presentMask.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-mode-01299)~^~ +VALIDATION_ERROR_06400a28~^~N~^~Unknown~^~VkDeviceGroupPresentInfoKHR~^~VUID-VkDeviceGroupPresentInfoKHR-mode-01300~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If mode is VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR, then each element of pDeviceMasks must have a value for which all set bits are set in one of the elements of VkDeviceGroupPresentCapabilitiesKHR::presentMask' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-mode-01300)~^~ +VALIDATION_ERROR_06400a2a~^~N~^~Unknown~^~VkDeviceGroupPresentInfoKHR~^~VUID-VkDeviceGroupPresentInfoKHR-mode-01301~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If mode is VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR, then for each bit set in each element of pDeviceMasks, the corresponding element of VkDeviceGroupPresentCapabilitiesKHR::presentMask must be non-zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-mode-01301)~^~ +VALIDATION_ERROR_06400a2c~^~N~^~Unknown~^~VkDeviceGroupPresentInfoKHR~^~VUID-VkDeviceGroupPresentInfoKHR-pDeviceMasks-01302~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'The value of each element of pDeviceMasks must be equal to the device mask passed in VkAcquireNextImageInfoKHR::deviceMask when the image index was last acquired' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-pDeviceMasks-01302)~^~ +VALIDATION_ERROR_06400a2e~^~N~^~Unknown~^~VkDeviceGroupPresentInfoKHR~^~VUID-VkDeviceGroupPresentInfoKHR-mode-01303~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'mode must have exactly one bit set, and that bit must have been included in VkDeviceGroupSwapchainCreateInfoKHR::modes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-mode-01303)~^~ +VALIDATION_ERROR_0640ce01~^~N~^~Unknown~^~VkDeviceGroupPresentInfoKHR~^~VUID-VkDeviceGroupPresentInfoKHR-mode-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'mode must be a valid VkDeviceGroupPresentModeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-mode-parameter)~^~implicit +VALIDATION_ERROR_06414001~^~N~^~Unknown~^~VkDeviceGroupPresentInfoKHR~^~VUID-VkDeviceGroupPresentInfoKHR-pDeviceMasks-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If swapchainCount is not 0, pDeviceMasks must be a valid pointer to an array of swapchainCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-pDeviceMasks-parameter)~^~implicit +VALIDATION_ERROR_0642b00b~^~N~^~Unknown~^~VkDeviceGroupPresentInfoKHR~^~VUID-VkDeviceGroupPresentInfoKHR-sType-sType~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-sType-sType)~^~implicit +VALIDATION_ERROR_06600712~^~N~^~Unknown~^~VkDeviceGroupRenderPassBeginInfo~^~VUID-VkDeviceGroupRenderPassBeginInfo-deviceMask-00905~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'deviceMask must be a valid device mask value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfo-deviceMask-00905)~^~ +VALIDATION_ERROR_06600714~^~N~^~Unknown~^~VkDeviceGroupRenderPassBeginInfo~^~VUID-VkDeviceGroupRenderPassBeginInfo-deviceMask-00906~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'deviceMask must not be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfo-deviceMask-00906)~^~ +VALIDATION_ERROR_06600716~^~N~^~Unknown~^~VkDeviceGroupRenderPassBeginInfo~^~VUID-VkDeviceGroupRenderPassBeginInfo-deviceMask-00907~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'deviceMask must be a subset of the command buffer's initial device mask' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfo-deviceMask-00907)~^~ +VALIDATION_ERROR_06600718~^~N~^~Unknown~^~VkDeviceGroupRenderPassBeginInfo~^~VUID-VkDeviceGroupRenderPassBeginInfo-deviceRenderAreaCount-00908~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'deviceRenderAreaCount must either be zero or equal to the number of physical devices in the logical device.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfo-deviceRenderAreaCount-00908)~^~ +VALIDATION_ERROR_06614201~^~N~^~Unknown~^~VkDeviceGroupRenderPassBeginInfo~^~VUID-VkDeviceGroupRenderPassBeginInfo-pDeviceRenderAreas-parameter~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If deviceRenderAreaCount is not 0, pDeviceRenderAreas must be a valid pointer to an array of deviceRenderAreaCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfo-pDeviceRenderAreas-parameter)~^~implicit +VALIDATION_ERROR_0662b00b~^~N~^~Unknown~^~VkDeviceGroupRenderPassBeginInfo~^~VUID-VkDeviceGroupRenderPassBeginInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfo-sType-sType)~^~implicit +VALIDATION_ERROR_068000a4~^~N~^~Unknown~^~VkDeviceGroupSubmitInfo~^~VUID-VkDeviceGroupSubmitInfo-waitSemaphoreCount-00082~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'waitSemaphoreCount must equal VkSubmitInfo::waitSemaphoreCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSubmitInfo-waitSemaphoreCount-00082)~^~ +VALIDATION_ERROR_068000a6~^~N~^~Unknown~^~VkDeviceGroupSubmitInfo~^~VUID-VkDeviceGroupSubmitInfo-commandBufferCount-00083~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'commandBufferCount must equal VkSubmitInfo::commandBufferCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSubmitInfo-commandBufferCount-00083)~^~ +VALIDATION_ERROR_068000a8~^~N~^~Unknown~^~VkDeviceGroupSubmitInfo~^~VUID-VkDeviceGroupSubmitInfo-signalSemaphoreCount-00084~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'signalSemaphoreCount must equal VkSubmitInfo::signalSemaphoreCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSubmitInfo-signalSemaphoreCount-00084)~^~ +VALIDATION_ERROR_068000aa~^~N~^~Unknown~^~VkDeviceGroupSubmitInfo~^~VUID-VkDeviceGroupSubmitInfo-pWaitSemaphoreDeviceIndices-00085~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'All elements of pWaitSemaphoreDeviceIndices and pSignalSemaphoreDeviceIndices must be valid device indices' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSubmitInfo-pWaitSemaphoreDeviceIndices-00085)~^~ +VALIDATION_ERROR_068000ac~^~N~^~Unknown~^~VkDeviceGroupSubmitInfo~^~VUID-VkDeviceGroupSubmitInfo-pCommandBufferDeviceMasks-00086~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'All elements of pCommandBufferDeviceMasks must be valid device masks' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSubmitInfo-pCommandBufferDeviceMasks-00086)~^~ +VALIDATION_ERROR_06811201~^~N~^~Unknown~^~VkDeviceGroupSubmitInfo~^~VUID-VkDeviceGroupSubmitInfo-pCommandBufferDeviceMasks-parameter~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If commandBufferCount is not 0, pCommandBufferDeviceMasks must be a valid pointer to an array of commandBufferCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSubmitInfo-pCommandBufferDeviceMasks-parameter)~^~implicit +VALIDATION_ERROR_06823001~^~N~^~Unknown~^~VkDeviceGroupSubmitInfo~^~VUID-VkDeviceGroupSubmitInfo-pSignalSemaphoreDeviceIndices-parameter~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If signalSemaphoreCount is not 0, pSignalSemaphoreDeviceIndices must be a valid pointer to an array of signalSemaphoreCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSubmitInfo-pSignalSemaphoreDeviceIndices-parameter)~^~implicit +VALIDATION_ERROR_06827201~^~N~^~Unknown~^~VkDeviceGroupSubmitInfo~^~VUID-VkDeviceGroupSubmitInfo-pWaitSemaphoreDeviceIndices-parameter~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If waitSemaphoreCount is not 0, pWaitSemaphoreDeviceIndices must be a valid pointer to an array of waitSemaphoreCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSubmitInfo-pWaitSemaphoreDeviceIndices-parameter)~^~implicit +VALIDATION_ERROR_0682b00b~^~N~^~Unknown~^~VkDeviceGroupSubmitInfo~^~VUID-VkDeviceGroupSubmitInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSubmitInfo-sType-sType)~^~implicit +VALIDATION_ERROR_06a0d001~^~N~^~Unknown~^~VkDeviceGroupSwapchainCreateInfoKHR~^~VUID-VkDeviceGroupSwapchainCreateInfoKHR-modes-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'modes must be a valid combination of VkDeviceGroupPresentModeFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSwapchainCreateInfoKHR-modes-parameter)~^~implicit +VALIDATION_ERROR_06a0d003~^~N~^~Unknown~^~VkDeviceGroupSwapchainCreateInfoKHR~^~VUID-VkDeviceGroupSwapchainCreateInfoKHR-modes-requiredbitmask~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'modes must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSwapchainCreateInfoKHR-modes-requiredbitmask)~^~implicit +VALIDATION_ERROR_06a2b00b~^~N~^~Unknown~^~VkDeviceGroupSwapchainCreateInfoKHR~^~VUID-VkDeviceGroupSwapchainCreateInfoKHR-sType-sType~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSwapchainCreateInfoKHR-sType-sType)~^~implicit +VALIDATION_ERROR_06c002fa~^~Y~^~Unknown~^~VkDeviceQueueCreateInfo~^~VUID-VkDeviceQueueCreateInfo-queueFamilyIndex-00381~^~core~^~The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-queueFamilyIndex-00381)~^~ +VALIDATION_ERROR_06c002fc~^~Y~^~Unknown~^~VkDeviceQueueCreateInfo~^~VUID-VkDeviceQueueCreateInfo-queueCount-00382~^~core~^~The spec valid usage text states 'queueCount must be less than or equal to the queueCount member of the VkQueueFamilyProperties structure, as returned by vkGetPhysicalDeviceQueueFamilyProperties in the pQueueFamilyProperties[queueFamilyIndex]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-queueCount-00382)~^~ +VALIDATION_ERROR_06c002fe~^~Y~^~Unknown~^~VkDeviceQueueCreateInfo~^~VUID-VkDeviceQueueCreateInfo-pQueuePriorities-00383~^~core~^~The spec valid usage text states 'Each element of pQueuePriorities must be between 0.0 and 1.0 inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-pQueuePriorities-00383)~^~ +VALIDATION_ERROR_06c09001~^~Y~^~None~^~VkDeviceQueueCreateInfo~^~VUID-VkDeviceQueueCreateInfo-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkDeviceQueueCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-flags-parameter)~^~implicit +VALIDATION_ERROR_06c1c40d~^~Y~^~Unknown~^~VkDeviceQueueCreateInfo~^~VUID-VkDeviceQueueCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkDeviceQueueGlobalPriorityCreateInfoEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-pNext-pNext)~^~implicit +VALIDATION_ERROR_06c20401~^~Y~^~Unknown~^~VkDeviceQueueCreateInfo~^~VUID-VkDeviceQueueCreateInfo-pQueuePriorities-parameter~^~core~^~The spec valid usage text states 'pQueuePriorities must be a valid pointer to an array of queueCount float values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-pQueuePriorities-parameter)~^~implicit +VALIDATION_ERROR_06c29e1b~^~Y~^~Unknown~^~VkDeviceQueueCreateInfo~^~VUID-VkDeviceQueueCreateInfo-queueCount-arraylength~^~core~^~The spec valid usage text states 'queueCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-queueCount-arraylength)~^~implicit +VALIDATION_ERROR_06c2b00b~^~N~^~Unknown~^~VkDeviceQueueCreateInfo~^~VUID-VkDeviceQueueCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-sType-sType)~^~implicit +VALIDATION_ERROR_06e00342~^~N~^~Unknown~^~VkDispatchIndirectCommand~^~VUID-VkDispatchIndirectCommand-x-00417~^~core~^~The spec valid usage text states 'x must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[0]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDispatchIndirectCommand-x-00417)~^~ +VALIDATION_ERROR_06e00344~^~N~^~Unknown~^~VkDispatchIndirectCommand~^~VUID-VkDispatchIndirectCommand-y-00418~^~core~^~The spec valid usage text states 'y must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[1]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDispatchIndirectCommand-y-00418)~^~ +VALIDATION_ERROR_06e00346~^~N~^~Unknown~^~VkDispatchIndirectCommand~^~VUID-VkDispatchIndirectCommand-z-00419~^~core~^~The spec valid usage text states 'z must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[2]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDispatchIndirectCommand-z-00419)~^~ +VALIDATION_ERROR_07006201~^~Y~^~Unknown~^~VkDisplayEventInfoEXT~^~VUID-VkDisplayEventInfoEXT-displayEvent-parameter~^~(VK_EXT_display_control)~^~The spec valid usage text states 'displayEvent must be a valid VkDisplayEventTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayEventInfoEXT-displayEvent-parameter)~^~implicit +VALIDATION_ERROR_0701c40d~^~Y~^~Unknown~^~VkDisplayEventInfoEXT~^~VUID-VkDisplayEventInfoEXT-pNext-pNext~^~(VK_EXT_display_control)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayEventInfoEXT-pNext-pNext)~^~implicit +VALIDATION_ERROR_0702b00b~^~Y~^~Unknown~^~VkDisplayEventInfoEXT~^~VUID-VkDisplayEventInfoEXT-sType-sType~^~(VK_EXT_display_control)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayEventInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_072009c4~^~N~^~Unknown~^~VkDisplayModeCreateInfoKHR~^~VUID-VkDisplayModeCreateInfoKHR-width-01250~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'The width and height members of the visibleRegion member of parameters must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-width-01250)~^~ +VALIDATION_ERROR_072009c6~^~N~^~Unknown~^~VkDisplayModeCreateInfoKHR~^~VUID-VkDisplayModeCreateInfoKHR-refreshRate-01251~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'The refreshRate member of parameters must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-refreshRate-01251)~^~ +VALIDATION_ERROR_07209005~^~Y~^~Unknown~^~VkDisplayModeCreateInfoKHR~^~VUID-VkDisplayModeCreateInfoKHR-flags-zerobitmask~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-flags-zerobitmask)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0721c40d~^~Y~^~Unknown~^~VkDisplayModeCreateInfoKHR~^~VUID-VkDisplayModeCreateInfoKHR-pNext-pNext~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0722b00b~^~Y~^~Unknown~^~VkDisplayModeCreateInfoKHR~^~VUID-VkDisplayModeCreateInfoKHR-sType-sType~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0741c40d~^~Y~^~Unknown~^~VkDisplayPowerInfoEXT~^~VUID-VkDisplayPowerInfoEXT-pNext-pNext~^~(VK_KHR_surface)+(VK_KHR_display)+(VK_EXT_display_control)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayPowerInfoEXT-pNext-pNext)~^~implicit +VALIDATION_ERROR_07428a01~^~Y~^~Unknown~^~VkDisplayPowerInfoEXT~^~VUID-VkDisplayPowerInfoEXT-powerState-parameter~^~(VK_KHR_surface)+(VK_KHR_display)+(VK_EXT_display_control)~^~The spec valid usage text states 'powerState must be a valid VkDisplayPowerStateEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayPowerInfoEXT-powerState-parameter)~^~implicit +VALIDATION_ERROR_0742b00b~^~Y~^~Unknown~^~VkDisplayPowerInfoEXT~^~VUID-VkDisplayPowerInfoEXT-sType-sType~^~(VK_KHR_surface)+(VK_KHR_display)+(VK_EXT_display_control)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayPowerInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_076009d2~^~N~^~Unknown~^~VkDisplayPresentInfoKHR~^~VUID-VkDisplayPresentInfoKHR-srcRect-01257~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_display_swapchain)~^~The spec valid usage text states 'srcRect must specify a rectangular region that is a subset of the image being presented' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayPresentInfoKHR-srcRect-01257)~^~ +VALIDATION_ERROR_076009d4~^~N~^~Unknown~^~VkDisplayPresentInfoKHR~^~VUID-VkDisplayPresentInfoKHR-dstRect-01258~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_display_swapchain)~^~The spec valid usage text states 'dstRect must specify a rectangular region that is a subset of the visibleRegion parameter of the display mode the swapchain being presented uses' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayPresentInfoKHR-dstRect-01258)~^~ +VALIDATION_ERROR_076009d6~^~N~^~Unknown~^~VkDisplayPresentInfoKHR~^~VUID-VkDisplayPresentInfoKHR-persistentContent-01259~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_display_swapchain)~^~The spec valid usage text states 'If the persistentContent member of the VkDisplayPropertiesKHR structure returned by vkGetPhysicalDeviceDisplayPropertiesKHR for the display the present operation targets then persistent must be VK_FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayPresentInfoKHR-persistentContent-01259)~^~ +VALIDATION_ERROR_0762b00b~^~N~^~Unknown~^~VkDisplayPresentInfoKHR~^~VUID-VkDisplayPresentInfoKHR-sType-sType~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_display_swapchain)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayPresentInfoKHR-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_078009c8~^~N~^~Unknown~^~VkDisplaySurfaceCreateInfoKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-planeIndex-01252~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'planeIndex must be less than the number of display planes supported by the device as determined by calling vkGetPhysicalDeviceDisplayPlanePropertiesKHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-planeIndex-01252)~^~ +VALIDATION_ERROR_078009ca~^~N~^~Unknown~^~VkDisplaySurfaceCreateInfoKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-planeReorderPossible-01253~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'If the planeReorderPossible member of the VkDisplayPropertiesKHR structure returned by vkGetPhysicalDeviceDisplayPropertiesKHR for the display corresponding to displayMode is VK_TRUE then planeStackIndex must be less than the number of display planes supported by the device as determined by calling vkGetPhysicalDeviceDisplayPlanePropertiesKHR; otherwise planeStackIndex must equal the currentStackIndex member of VkDisplayPlanePropertiesKHR returned by vkGetPhysicalDeviceDisplayPlanePropertiesKHR for the display plane corresponding to displayMode' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-planeReorderPossible-01253)~^~ +VALIDATION_ERROR_078009cc~^~N~^~Unknown~^~VkDisplaySurfaceCreateInfoKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-01254~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'If alphaMode is VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR then globalAlpha must be between 0 and 1, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-01254)~^~ +VALIDATION_ERROR_078009ce~^~N~^~Unknown~^~VkDisplaySurfaceCreateInfoKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-01255~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'alphaMode must be 0 or one of the bits present in the supportedAlpha member of VkDisplayPlaneCapabilitiesKHR returned by vkGetDisplayPlaneCapabilitiesKHR for the display plane corresponding to displayMode' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-01255)~^~ +VALIDATION_ERROR_078009d0~^~N~^~Unknown~^~VkDisplaySurfaceCreateInfoKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-width-01256~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'The width and height members of imageExtent must be less than the maxImageDimensions2D member of VkPhysicalDeviceLimits' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-width-01256)~^~ +VALIDATION_ERROR_07800a01~^~Y~^~Unknown~^~VkDisplaySurfaceCreateInfoKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'alphaMode must be a valid VkDisplayPlaneAlphaFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-parameter)~^~implicit +VALIDATION_ERROR_07806401~^~Y~^~Unknown~^~VkDisplaySurfaceCreateInfoKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-displayMode-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'displayMode must be a valid VkDisplayModeKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-displayMode-parameter)~^~implicit +VALIDATION_ERROR_07809005~^~Y~^~Unknown~^~VkDisplaySurfaceCreateInfoKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-flags-zerobitmask~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-flags-zerobitmask)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0781c40d~^~Y~^~Unknown~^~VkDisplaySurfaceCreateInfoKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-pNext-pNext~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0782b00b~^~Y~^~Unknown~^~VkDisplaySurfaceCreateInfoKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-sType-sType~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_07830201~^~Y~^~Unknown~^~VkDisplaySurfaceCreateInfoKHR~^~VUID-VkDisplaySurfaceCreateInfoKHR-transform-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'transform must be a valid VkSurfaceTransformFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-transform-parameter)~^~implicit +VALIDATION_ERROR_07a00450~^~N~^~Unknown~^~VkDrawIndexedIndirectCommand~^~VUID-VkDrawIndexedIndirectCommand-None-00552~^~core~^~The spec valid usage text states 'For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in fxvertex-input' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDrawIndexedIndirectCommand-None-00552)~^~ +VALIDATION_ERROR_07a00452~^~N~^~Unknown~^~VkDrawIndexedIndirectCommand~^~VUID-VkDrawIndexedIndirectCommand-indexSize-00553~^~core~^~The spec valid usage text states '(indexSize * (firstIndex + indexCount) + offset) must be less than or equal to the size of the bound index buffer, with indexSize being based on the type specified by indexType, where the index buffer, indexType, and offset are specified via vkCmdBindIndexBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDrawIndexedIndirectCommand-indexSize-00553)~^~ +VALIDATION_ERROR_07a00454~^~N~^~Unknown~^~VkDrawIndexedIndirectCommand~^~VUID-VkDrawIndexedIndirectCommand-firstInstance-00554~^~core~^~The spec valid usage text states 'If the drawIndirectFirstInstance feature is not enabled, firstInstance must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDrawIndexedIndirectCommand-firstInstance-00554)~^~ +VALIDATION_ERROR_07c003e8~^~N~^~Unknown~^~VkDrawIndirectCommand~^~VUID-VkDrawIndirectCommand-None-00500~^~core~^~The spec valid usage text states 'For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in fxvertex-input' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDrawIndirectCommand-None-00500)~^~ +VALIDATION_ERROR_07c003ea~^~N~^~Unknown~^~VkDrawIndirectCommand~^~VUID-VkDrawIndirectCommand-firstInstance-00501~^~core~^~The spec valid usage text states 'If the drawIndirectFirstInstance feature is not enabled, firstInstance must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDrawIndirectCommand-firstInstance-00501)~^~ +VALIDATION_ERROR_07e09005~^~Y~^~Unknown~^~VkEventCreateInfo~^~VUID-VkEventCreateInfo-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkEventCreateInfo-flags-zerobitmask)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_07e1c40d~^~Y~^~Unknown~^~VkEventCreateInfo~^~VUID-VkEventCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkEventCreateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_07e2b00b~^~Y~^~Unknown~^~VkEventCreateInfo~^~VUID-VkEventCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkEventCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_08000520~^~N~^~Unknown~^~VkExportMemoryAllocateInfo~^~VUID-VkExportMemoryAllocateInfo-handleTypes-00656~^~(VK_VERSION_1_1,VK_KHR_external_memory)~^~The spec valid usage text states 'The bits in handleTypes must be supported and compatible, as reported by VkExternalImageFormatProperties or VkExternalBufferProperties.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryAllocateInfo-handleTypes-00656)~^~ +VALIDATION_ERROR_08009e01~^~N~^~Unknown~^~VkExportMemoryAllocateInfo~^~VUID-VkExportMemoryAllocateInfo-handleTypes-parameter~^~(VK_VERSION_1_1,VK_KHR_external_memory)~^~The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryAllocateInfo-handleTypes-parameter)~^~implicit +VALIDATION_ERROR_0802b00b~^~N~^~Unknown~^~VkExportMemoryAllocateInfo~^~VUID-VkExportMemoryAllocateInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_external_memory)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryAllocateInfo-sType-sType)~^~implicit +VALIDATION_ERROR_08209e01~^~N~^~Unknown~^~VkExportMemoryAllocateInfoNV~^~VUID-VkExportMemoryAllocateInfoNV-handleTypes-parameter~^~(VK_NV_external_memory)~^~The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryAllocateInfoNV-handleTypes-parameter)~^~implicit +VALIDATION_ERROR_0822b00b~^~N~^~Unknown~^~VkExportMemoryAllocateInfoNV~^~VUID-VkExportMemoryAllocateInfoNV-sType-sType~^~(VK_NV_external_memory)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryAllocateInfoNV-sType-sType)~^~implicit +VALIDATION_ERROR_08400522~^~N~^~Unknown~^~VkExportMemoryWin32HandleInfoKHR~^~VUID-VkExportMemoryWin32HandleInfoKHR-handleTypes-00657~^~(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'If VkExportMemoryAllocateInfo::handleTypes does not include VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, VkExportMemoryWin32HandleInfoKHR must not be in the pNext chain of VkMemoryAllocateInfo.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoKHR-handleTypes-00657)~^~ +VALIDATION_ERROR_0840f401~^~N~^~Unknown~^~VkExportMemoryWin32HandleInfoKHR~^~VUID-VkExportMemoryWin32HandleInfoKHR-pAttributes-parameter~^~(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoKHR-pAttributes-parameter)~^~implicit +VALIDATION_ERROR_0842b00b~^~N~^~Unknown~^~VkExportMemoryWin32HandleInfoKHR~^~VUID-VkExportMemoryWin32HandleInfoKHR-sType-sType~^~(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoKHR-sType-sType)~^~implicit +VALIDATION_ERROR_0860f401~^~N~^~Unknown~^~VkExportMemoryWin32HandleInfoNV~^~VUID-VkExportMemoryWin32HandleInfoNV-pAttributes-parameter~^~(VK_NV_external_memory_win32)~^~The spec valid usage text states 'If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoNV-pAttributes-parameter)~^~implicit +VALIDATION_ERROR_0862b00b~^~N~^~Unknown~^~VkExportMemoryWin32HandleInfoNV~^~VUID-VkExportMemoryWin32HandleInfoNV-sType-sType~^~(VK_NV_external_memory_win32)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoNV-sType-sType)~^~implicit +VALIDATION_ERROR_088008c8~^~N~^~Unknown~^~VkExportSemaphoreCreateInfo~^~VUID-VkExportSemaphoreCreateInfo-handleTypes-01124~^~(VK_VERSION_1_1,VK_KHR_external_semaphore)~^~The spec valid usage text states 'The bits in handleTypes must be supported and compatible, as reported by VkExternalSemaphoreProperties.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportSemaphoreCreateInfo-handleTypes-01124)~^~ +VALIDATION_ERROR_08809e01~^~N~^~Unknown~^~VkExportSemaphoreCreateInfo~^~VUID-VkExportSemaphoreCreateInfo-handleTypes-parameter~^~(VK_VERSION_1_1,VK_KHR_external_semaphore)~^~The spec valid usage text states 'handleTypes must be a valid combination of VkExternalSemaphoreHandleTypeFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportSemaphoreCreateInfo-handleTypes-parameter)~^~implicit +VALIDATION_ERROR_0882b00b~^~N~^~Unknown~^~VkExportSemaphoreCreateInfo~^~VUID-VkExportSemaphoreCreateInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_external_semaphore)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportSemaphoreCreateInfo-sType-sType)~^~implicit +VALIDATION_ERROR_08a008ca~^~N~^~Unknown~^~VkExportSemaphoreWin32HandleInfoKHR~^~VUID-VkExportSemaphoreWin32HandleInfoKHR-handleTypes-01125~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'If VkExportSemaphoreCreateInfo::handleTypes does not include VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT or VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT, VkExportSemaphoreWin32HandleInfoKHR must not be in the pNext chain of VkSemaphoreCreateInfo.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportSemaphoreWin32HandleInfoKHR-handleTypes-01125)~^~ +VALIDATION_ERROR_08a0f401~^~N~^~Unknown~^~VkExportSemaphoreWin32HandleInfoKHR~^~VUID-VkExportSemaphoreWin32HandleInfoKHR-pAttributes-parameter~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportSemaphoreWin32HandleInfoKHR-pAttributes-parameter)~^~implicit +VALIDATION_ERROR_08a2b00b~^~N~^~Unknown~^~VkExportSemaphoreWin32HandleInfoKHR~^~VUID-VkExportSemaphoreWin32HandleInfoKHR-sType-sType~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportSemaphoreWin32HandleInfoKHR-sType-sType)~^~implicit +VALIDATION_ERROR_08c09e01~^~N~^~Unknown~^~VkExternalMemoryBufferCreateInfo~^~VUID-VkExternalMemoryBufferCreateInfo-handleTypes-parameter~^~(VK_VERSION_1_1,VK_KHR_external_memory)~^~The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalMemoryBufferCreateInfo-handleTypes-parameter)~^~implicit +VALIDATION_ERROR_08c2b00b~^~N~^~Unknown~^~VkExternalMemoryBufferCreateInfo~^~VUID-VkExternalMemoryBufferCreateInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_external_memory)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalMemoryBufferCreateInfo-sType-sType)~^~implicit +VALIDATION_ERROR_08e09e01~^~N~^~Unknown~^~VkExternalMemoryImageCreateInfo~^~VUID-VkExternalMemoryImageCreateInfo-handleTypes-parameter~^~(VK_VERSION_1_1,VK_KHR_external_memory)~^~The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfo-handleTypes-parameter)~^~implicit +VALIDATION_ERROR_08e09e03~^~N~^~Unknown~^~VkExternalMemoryImageCreateInfo~^~VUID-VkExternalMemoryImageCreateInfo-handleTypes-requiredbitmask~^~(VK_VERSION_1_1,VK_KHR_external_memory)~^~The spec valid usage text states 'handleTypes must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfo-handleTypes-requiredbitmask)~^~implicit +VALIDATION_ERROR_08e2b00b~^~N~^~Unknown~^~VkExternalMemoryImageCreateInfo~^~VUID-VkExternalMemoryImageCreateInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_external_memory)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfo-sType-sType)~^~implicit +VALIDATION_ERROR_09009e01~^~N~^~Unknown~^~VkExternalMemoryImageCreateInfoNV~^~VUID-VkExternalMemoryImageCreateInfoNV-handleTypes-parameter~^~(VK_NV_external_memory)~^~The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfoNV-handleTypes-parameter)~^~implicit +VALIDATION_ERROR_0902b00b~^~N~^~Unknown~^~VkExternalMemoryImageCreateInfoNV~^~VUID-VkExternalMemoryImageCreateInfoNV-sType-sType~^~(VK_NV_external_memory)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfoNV-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_09209001~^~Y~^~Unknown~^~VkFenceCreateInfo~^~VUID-VkFenceCreateInfo-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkFenceCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceCreateInfo-flags-parameter)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0921c40d~^~Y~^~Unknown~^~VkFenceCreateInfo~^~VUID-VkFenceCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkExportFenceCreateInfo or VkExportFenceWin32HandleInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceCreateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0922b00b~^~Y~^~Unknown~^~VkFenceCreateInfo~^~VUID-VkFenceCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. VALIDATION_ERROR_0922b00f~^~N~^~None~^~VkFenceCreateInfo~^~VUID-VkFenceCreateInfo-sType-unique~^~core~^~The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceCreateInfo-sType-unique)~^~implicit -VALIDATION_ERROR_09400009~^~Y~^~FramebufferCreateErrors~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-commonparent~^~core~^~The spec valid usage text states 'Both of renderPass, and the elements of pAttachments that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-commonparent)~^~implicit -VALIDATION_ERROR_094006d8~^~Y~^~FramebufferCreateErrors~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-attachmentCount-00876~^~core~^~The spec valid usage text states 'attachmentCount must be equal to the attachment count specified in renderPass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-attachmentCount-00876)~^~ -VALIDATION_ERROR_094006da~^~Y~^~FramebufferCreateErrors~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-pAttachments-00877~^~core~^~The spec valid usage text states 'Each element of pAttachments that is used as a color attachment or resolve attachment by renderPass must have been created with a usage value including VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00877)~^~ -VALIDATION_ERROR_094006dc~^~Y~^~FramebufferCreateErrors~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-pAttachments-00878~^~core~^~The spec valid usage text states 'Each element of pAttachments that is used as a depth/stencil attachment by renderPass must have been created with a usage value including VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00878)~^~ -VALIDATION_ERROR_094006de~^~Y~^~FramebufferCreateErrors~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-pAttachments-00879~^~core~^~The spec valid usage text states 'Each element of pAttachments that is used as an input attachment by renderPass must have been created with a usage value including VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00879)~^~ -VALIDATION_ERROR_094006e0~^~Y~^~FramebufferCreateErrors~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-pAttachments-00880~^~core~^~The spec valid usage text states 'Each element of pAttachments must have been created with an VkFormat value that matches the VkFormat specified by the corresponding VkAttachmentDescription in renderPass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00880)~^~ -VALIDATION_ERROR_094006e2~^~Y~^~FramebufferCreateErrors~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-pAttachments-00881~^~core~^~The spec valid usage text states 'Each element of pAttachments must have been created with a samples value that matches the samples value specified by the corresponding VkAttachmentDescription in renderPass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00881)~^~ -VALIDATION_ERROR_094006e4~^~Y~^~FramebufferCreateErrors~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-pAttachments-00882~^~core~^~The spec valid usage text states 'Each element of pAttachments must have dimensions at least as large as the corresponding framebuffer dimension' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00882)~^~ -VALIDATION_ERROR_094006e6~^~Y~^~FramebufferCreateErrors~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-pAttachments-00883~^~core~^~The spec valid usage text states 'Each element of pAttachments must only specify a single mip level' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00883)~^~ -VALIDATION_ERROR_094006e8~^~Y~^~FramebufferCreateErrors~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-pAttachments-00884~^~core~^~The spec valid usage text states 'Each element of pAttachments must have been created with the identity swizzle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00884)~^~ -VALIDATION_ERROR_094006ea~^~Y~^~FramebufferCreateErrors~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-width-00885~^~core~^~The spec valid usage text states 'width must be greater than 0.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-width-00885)~^~ -VALIDATION_ERROR_094006ec~^~Y~^~FramebufferCreateErrors~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-width-00886~^~core~^~The spec valid usage text states 'width must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferWidth' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-width-00886)~^~ -VALIDATION_ERROR_094006ee~^~Y~^~FramebufferCreateErrors~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-height-00887~^~core~^~The spec valid usage text states 'height must be greater than 0.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-height-00887)~^~ -VALIDATION_ERROR_094006f0~^~Y~^~FramebufferCreateErrors~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-height-00888~^~core~^~The spec valid usage text states 'height must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferHeight' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-height-00888)~^~ -VALIDATION_ERROR_094006f2~^~Y~^~FramebufferCreateErrors~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-layers-00889~^~core~^~The spec valid usage text states 'layers must be greater than 0.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-layers-00889)~^~ -VALIDATION_ERROR_094006f4~^~Y~^~FramebufferCreateErrors~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-layers-00890~^~core~^~The spec valid usage text states 'layers must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferLayers' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-layers-00890)~^~ -VALIDATION_ERROR_094006f6~^~N~^~Unknown~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-pAttachments-00891~^~(VK_KHR_maintenance1)~^~The spec valid usage text states 'Each element of pAttachments that is a 2D or 2D array image view taken from a 3D image must not be a depth/stencil format' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00891)~^~ -VALIDATION_ERROR_09409005~^~Y~^~Unknown~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-flags-zerobitmask)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0940f201~^~Y~^~FramebufferCreateErrors~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-pAttachments-parameter~^~core~^~The spec valid usage text states 'If attachmentCount is not 0, pAttachments must be a valid pointer to an array of attachmentCount valid VkImageView handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-parameter)~^~implicit -VALIDATION_ERROR_0941c40d~^~Y~^~Unknown~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0942ae01~^~Y~^~FramebufferCreateErrors~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-renderPass-parameter~^~core~^~The spec valid usage text states 'renderPass must be a valid VkRenderPass handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-renderPass-parameter)~^~implicit -VALIDATION_ERROR_0942b00b~^~Y~^~Unknown~^~vkCreateFramebuffer~^~VUID-VkFramebufferCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_09600009~^~Y~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-commonparent~^~core~^~The spec valid usage text states 'Each of basePipelineHandle, layout, and renderPass that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-commonparent)~^~implicit -VALIDATION_ERROR_096005a4~^~N~^~None~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-flags-00722~^~core~^~The spec valid usage text states 'If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineIndex is -1, basePipelineHandle must be a valid handle to a graphics VkPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-flags-00722)~^~ -VALIDATION_ERROR_096005a6~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-flags-00723~^~core~^~The spec valid usage text states 'If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineHandle is VK_NULL_HANDLE, basePipelineIndex must be a valid index into the calling command's pCreateInfos parameter' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-flags-00723)~^~ -VALIDATION_ERROR_096005a8~^~Y~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-flags-00724~^~core~^~The spec valid usage text states 'If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineIndex is not -1, basePipelineHandle must be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-flags-00724)~^~ -VALIDATION_ERROR_096005aa~^~Y~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-flags-00725~^~core~^~The spec valid usage text states 'If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineHandle is not VK_NULL_HANDLE, basePipelineIndex must be -1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-flags-00725)~^~ -VALIDATION_ERROR_096005ac~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-stage-00726~^~core~^~The spec valid usage text states 'The stage member of each element of pStages must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-stage-00726)~^~ -VALIDATION_ERROR_096005ae~^~Y~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-stage-00727~^~core~^~The spec valid usage text states 'The stage member of one element of pStages must be VK_SHADER_STAGE_VERTEX_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-stage-00727)~^~ -VALIDATION_ERROR_096005b0~^~Y~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-stage-00728~^~core~^~The spec valid usage text states 'The stage member of each element of pStages must not be VK_SHADER_STAGE_COMPUTE_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-stage-00728)~^~ -VALIDATION_ERROR_096005b2~^~Y~^~CreatePipelineTessErrors~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00729~^~core~^~The spec valid usage text states 'If pStages includes a tessellation control shader stage, it must include a tessellation evaluation shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00729)~^~ -VALIDATION_ERROR_096005b4~^~Y~^~CreatePipelineTessErrors~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00730~^~core~^~The spec valid usage text states 'If pStages includes a tessellation evaluation shader stage, it must include a tessellation control shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00730)~^~ -VALIDATION_ERROR_096005b6~^~Y~^~CreatePipelineTessErrors~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00731~^~core~^~The spec valid usage text states 'If pStages includes a tessellation control shader stage and a tessellation evaluation shader stage, pTessellationState must be a valid pointer to a valid VkPipelineTessellationStateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00731)~^~ -VALIDATION_ERROR_096005b8~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00732~^~core~^~The spec valid usage text states 'If pStages includes tessellation shader stages, the shader code of at least one stage must contain an OpExecutionMode instruction that specifies the type of subdivision in the pipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00732)~^~ -VALIDATION_ERROR_096005ba~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00733~^~core~^~The spec valid usage text states 'If pStages includes tessellation shader stages, and the shader code of both stages contain an OpExecutionMode instruction that specifies the type of subdivision in the pipeline, they must both specify the same subdivision mode' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00733)~^~ -VALIDATION_ERROR_096005bc~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00734~^~core~^~The spec valid usage text states 'If pStages includes tessellation shader stages, the shader code of at least one stage must contain an OpExecutionMode instruction that specifies the output patch size in the pipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00734)~^~ -VALIDATION_ERROR_096005be~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00735~^~core~^~The spec valid usage text states 'If pStages includes tessellation shader stages, and the shader code of both contain an OpExecutionMode instruction that specifies the out patch size in the pipeline, they must both specify the same patch size' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00735)~^~ -VALIDATION_ERROR_096005c0~^~Y~^~CreatePipelineTessErrors~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00736~^~core~^~The spec valid usage text states 'If pStages includes tessellation shader stages, the topology member of pInputAssembly must be VK_PRIMITIVE_TOPOLOGY_PATCH_LIST' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00736)~^~ -VALIDATION_ERROR_096005c2~^~Y~^~CreatePipelineTessErrors~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-topology-00737~^~core~^~The spec valid usage text states 'If the topology member of pInputAssembly is VK_PRIMITIVE_TOPOLOGY_PATCH_LIST, pStages must include tessellation shader stages' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-topology-00737)~^~ -VALIDATION_ERROR_096005c4~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00738~^~core~^~The spec valid usage text states 'If pStages includes a geometry shader stage, and does not include any tessellation shader stages, its shader code must contain an OpExecutionMode instruction that specifies an input primitive type that is compatible with the primitive topology specified in pInputAssembly' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00738)~^~ -VALIDATION_ERROR_096005c6~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00739~^~core~^~The spec valid usage text states 'If pStages includes a geometry shader stage, and also includes tessellation shader stages, its shader code must contain an OpExecutionMode instruction that specifies an input primitive type that is compatible with the primitive topology that is output by the tessellation stages' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00739)~^~ -VALIDATION_ERROR_096005c8~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00740~^~core~^~The spec valid usage text states 'If pStages includes a fragment shader stage and a geometry shader stage, and the fragment shader code reads from an input variable that is decorated with PrimitiveID, then the geometry shader code must write to a matching output variable, decorated with PrimitiveID, in all execution paths' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00740)~^~ -VALIDATION_ERROR_096005ca~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00741~^~core~^~The spec valid usage text states 'If pStages includes a fragment shader stage, its shader code must not read from any input attachment that is defined as VK_ATTACHMENT_UNUSED in subpass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00741)~^~ -VALIDATION_ERROR_096005cc~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00742~^~core~^~The spec valid usage text states 'The shader code for the entry points identified by pStages, and the rest of the state identified by this structure must adhere to the pipeline linking rules described in the Shader Interfaces chapter' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00742)~^~ -VALIDATION_ERROR_096005ce~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-subpass-00743~^~core~^~The spec valid usage text states 'If rasterization is not disabled and subpass uses a depth/stencil attachment in renderpass that has a layout of VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00743)~^~ -VALIDATION_ERROR_096005d0~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-subpass-00744~^~core~^~The spec valid usage text states 'If rasterization is not disabled and subpass uses a depth/stencil attachment in renderpass that has a layout of VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00744)~^~ -VALIDATION_ERROR_096005d2~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-blendEnable-00745~^~core~^~The spec valid usage text states 'If rasterization is not disabled and the subpass uses color attachments, then for each color attachment in the subpass the blendEnable member of the corresponding element of the pAttachment member of pColorBlendState must be VK_FALSE if the format of the attachment does not support color blend operations, as specified by the VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT flag in VkFormatProperties::linearTilingFeatures or VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-blendEnable-00745)~^~ -VALIDATION_ERROR_096005d4~^~Y~^~NumBlendAttachMismatch~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-attachmentCount-00746~^~core~^~The spec valid usage text states 'If rasterization is not disabled and the subpass uses color attachments, the attachmentCount member of pColorBlendState must be equal to the colorAttachmentCount used to create subpass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-attachmentCount-00746)~^~ -VALIDATION_ERROR_096005d6~^~Y~^~PSOViewportCountWithoutDataAndDynScissorMismatch~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00747~^~core~^~The spec valid usage text states 'If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_VIEWPORT, the pViewports member of pViewportState must be a valid pointer to an array of pViewportState::viewportCount VkViewport structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00747)~^~ -VALIDATION_ERROR_096005d8~^~Y~^~PSOScissorCountWithoutDataAndDynViewportMismatch~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00748~^~core~^~The spec valid usage text states 'If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_SCISSOR, the pScissors member of pViewportState must be a valid pointer to an array of pViewportState::scissorCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00748)~^~ -VALIDATION_ERROR_096005da~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00749~^~core~^~The spec valid usage text states 'If the wide lines feature is not enabled, and no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_LINE_WIDTH, the lineWidth member of pRasterizationState must be 1.0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00749)~^~ -VALIDATION_ERROR_096005dc~^~Y~^~PSOViewportStateNotSet~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00750~^~core~^~The spec valid usage text states 'If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, pViewportState must be a valid pointer to a valid VkPipelineViewportStateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00750)~^~ -VALIDATION_ERROR_096005de~^~Y~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00751~^~core~^~The spec valid usage text states 'If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, pMultisampleState must be a valid pointer to a valid VkPipelineMultisampleStateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00751)~^~ -VALIDATION_ERROR_096005e0~^~Y~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00752~^~core~^~The spec valid usage text states 'If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, and subpass uses a depth/stencil attachment, pDepthStencilState must be a valid pointer to a valid VkPipelineDepthStencilStateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00752)~^~ -VALIDATION_ERROR_096005e2~^~Y~^~PipelineRenderpassCompatibility~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00753~^~core~^~The spec valid usage text states 'If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, and subpass uses color attachments, pColorBlendState must be a valid pointer to a valid VkPipelineColorBlendStateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00753)~^~ -VALIDATION_ERROR_096005e4~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00754~^~core~^~The spec valid usage text states 'If the depth bias clamping feature is not enabled, no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_DEPTH_BIAS, and the depthBiasEnable member of pRasterizationState is VK_TRUE, the depthBiasClamp member of pRasterizationState must be 0.0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00754)~^~ -VALIDATION_ERROR_096005e6~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00755~^~!(VK_EXT_depth_range_unrestricted)~^~The spec valid usage text states 'If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_DEPTH_BOUNDS, and the depthBoundsTestEnable member of pDepthStencilState is VK_TRUE, the minDepthBounds and maxDepthBounds members of pDepthStencilState must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00755)~^~ -VALIDATION_ERROR_096005e8~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-layout-00756~^~core~^~The spec valid usage text states 'layout must be consistent with all shaders specified in pStages' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-layout-00756)~^~ -VALIDATION_ERROR_096005ea~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-subpass-00757~^~!(VK_AMD_mixed_attachment_samples)+!(VK_NV_framebuffer_mixed_samples)~^~The spec valid usage text states 'If subpass uses color and/or depth/stencil attachments, then the rasterizationSamples member of pMultisampleState must be the same as the sample count for those subpass attachments' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00757)~^~ -VALIDATION_ERROR_096005ec~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-subpass-00758~^~core~^~The spec valid usage text states 'If subpass does not use any color and/or depth/stencil attachments, then the rasterizationSamples member of pMultisampleState must follow the rules for a zero-attachment subpass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00758)~^~ -VALIDATION_ERROR_096005ee~^~Y~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-subpass-00759~^~core~^~The spec valid usage text states 'subpass must be a valid subpass within renderpass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00759)~^~ -VALIDATION_ERROR_096005f0~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-renderPass-00760~^~(VK_KHX_multiview)~^~The spec valid usage text states 'If the renderPass has multiview enabled and subpass has more than one bit set in the view mask and multiviewTessellationShader is not enabled, then pStages must not include tessellation shaders.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-renderPass-00760)~^~ -VALIDATION_ERROR_096005f2~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-renderPass-00761~^~(VK_KHX_multiview)~^~The spec valid usage text states 'If the renderPass has multiview enabled and subpass has more than one bit set in the view mask and multiviewGeometryShader is not enabled, then pStages must not include a geometry shader.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-renderPass-00761)~^~ -VALIDATION_ERROR_096005f4~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-renderPass-00762~^~(VK_KHX_multiview)~^~The spec valid usage text states 'If the renderPass has multiview enabled and subpass has more than one bit set in the view mask, shaders in the pipeline must not write to the Layer built-in output' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-renderPass-00762)~^~ -VALIDATION_ERROR_096005f6~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-renderPass-00763~^~(VK_KHX_multiview)~^~The spec valid usage text states 'If the renderPass has multiview enabled, then all shaders must not include variables decorated with the Layer built-in decoration in their interfaces.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-renderPass-00763)~^~ -VALIDATION_ERROR_096005f8~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-flags-00764~^~(VK_KHX_device_group)~^~The spec valid usage text states 'flags must not contain the VK_PIPELINE_CREATE_DISPATCH_BASE_KHX flag.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-flags-00764)~^~ +VALIDATION_ERROR_09400009~^~Y~^~FramebufferCreateErrors~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-commonparent~^~core~^~The spec valid usage text states 'Both of renderPass, and the elements of pAttachments that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-commonparent)~^~implicit +VALIDATION_ERROR_094006d8~^~Y~^~FramebufferCreateErrors~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-attachmentCount-00876~^~core~^~The spec valid usage text states 'attachmentCount must be equal to the attachment count specified in renderPass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-attachmentCount-00876)~^~ +VALIDATION_ERROR_094006da~^~Y~^~FramebufferCreateErrors~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-pAttachments-00877~^~core~^~The spec valid usage text states 'Each element of pAttachments that is used as a color attachment or resolve attachment by renderPass must have been created with a usage value including VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00877)~^~ +VALIDATION_ERROR_094006dc~^~Y~^~FramebufferCreateErrors~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-pAttachments-00878~^~core~^~The spec valid usage text states 'Each element of pAttachments that is used as a depth/stencil attachment by renderPass must have been created with a usage value including VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00878)~^~ +VALIDATION_ERROR_094006de~^~Y~^~FramebufferCreateErrors~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-pAttachments-00879~^~core~^~The spec valid usage text states 'Each element of pAttachments that is used as an input attachment by renderPass must have been created with a usage value including VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00879)~^~ +VALIDATION_ERROR_094006e0~^~Y~^~FramebufferCreateErrors~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-pAttachments-00880~^~core~^~The spec valid usage text states 'Each element of pAttachments must have been created with an VkFormat value that matches the VkFormat specified by the corresponding VkAttachmentDescription in renderPass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00880)~^~ +VALIDATION_ERROR_094006e2~^~Y~^~FramebufferCreateErrors~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-pAttachments-00881~^~core~^~The spec valid usage text states 'Each element of pAttachments must have been created with a samples value that matches the samples value specified by the corresponding VkAttachmentDescription in renderPass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00881)~^~ +VALIDATION_ERROR_094006e4~^~Y~^~FramebufferCreateErrors~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-pAttachments-00882~^~core~^~The spec valid usage text states 'Each element of pAttachments must have dimensions at least as large as the corresponding framebuffer dimension' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00882)~^~ +VALIDATION_ERROR_094006e6~^~Y~^~FramebufferCreateErrors~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-pAttachments-00883~^~core~^~The spec valid usage text states 'Each element of pAttachments must only specify a single mip level' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00883)~^~ +VALIDATION_ERROR_094006e8~^~Y~^~FramebufferCreateErrors~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-pAttachments-00884~^~core~^~The spec valid usage text states 'Each element of pAttachments must have been created with the identity swizzle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00884)~^~ +VALIDATION_ERROR_094006ea~^~Y~^~FramebufferCreateErrors~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-width-00885~^~core~^~The spec valid usage text states 'width must be greater than 0.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-width-00885)~^~ +VALIDATION_ERROR_094006ec~^~Y~^~FramebufferCreateErrors~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-width-00886~^~core~^~The spec valid usage text states 'width must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferWidth' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-width-00886)~^~ +VALIDATION_ERROR_094006ee~^~Y~^~FramebufferCreateErrors~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-height-00887~^~core~^~The spec valid usage text states 'height must be greater than 0.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-height-00887)~^~ +VALIDATION_ERROR_094006f0~^~Y~^~FramebufferCreateErrors~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-height-00888~^~core~^~The spec valid usage text states 'height must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferHeight' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-height-00888)~^~ +VALIDATION_ERROR_094006f2~^~Y~^~FramebufferCreateErrors~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-layers-00889~^~core~^~The spec valid usage text states 'layers must be greater than 0.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-layers-00889)~^~ +VALIDATION_ERROR_094006f4~^~Y~^~FramebufferCreateErrors~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-layers-00890~^~core~^~The spec valid usage text states 'layers must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferLayers' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-layers-00890)~^~ +VALIDATION_ERROR_094006f6~^~N~^~Unknown~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-pAttachments-00891~^~(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'Each element of pAttachments that is a 2D or 2D array image view taken from a 3D image must not be a depth/stencil format' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00891)~^~ +VALIDATION_ERROR_09409005~^~Y~^~Unknown~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-flags-zerobitmask)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0940f201~^~Y~^~FramebufferCreateErrors~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-pAttachments-parameter~^~core~^~The spec valid usage text states 'If attachmentCount is not 0, pAttachments must be a valid pointer to an array of attachmentCount valid VkImageView handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-parameter)~^~implicit +VALIDATION_ERROR_0941c40d~^~Y~^~Unknown~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_0942ae01~^~Y~^~FramebufferCreateErrors~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-renderPass-parameter~^~core~^~The spec valid usage text states 'renderPass must be a valid VkRenderPass handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-renderPass-parameter)~^~implicit +VALIDATION_ERROR_0942b00b~^~Y~^~Unknown~^~VkFramebufferCreateInfo~^~VUID-VkFramebufferCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_09600009~^~Y~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-commonparent~^~core~^~The spec valid usage text states 'Each of basePipelineHandle, layout, and renderPass that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-commonparent)~^~implicit +VALIDATION_ERROR_096005a4~^~N~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-flags-00722~^~core~^~The spec valid usage text states 'If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineIndex is -1, basePipelineHandle must be a valid handle to a graphics VkPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-flags-00722)~^~ +VALIDATION_ERROR_096005a6~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-flags-00723~^~core~^~The spec valid usage text states 'If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineHandle is VK_NULL_HANDLE, basePipelineIndex must be a valid index into the calling command's pCreateInfos parameter' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-flags-00723)~^~ +VALIDATION_ERROR_096005a8~^~Y~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-flags-00724~^~core~^~The spec valid usage text states 'If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineIndex is not -1, basePipelineHandle must be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-flags-00724)~^~ +VALIDATION_ERROR_096005aa~^~Y~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-flags-00725~^~core~^~The spec valid usage text states 'If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineHandle is not VK_NULL_HANDLE, basePipelineIndex must be -1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-flags-00725)~^~ +VALIDATION_ERROR_096005ac~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-stage-00726~^~core~^~The spec valid usage text states 'The stage member of each element of pStages must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-stage-00726)~^~ +VALIDATION_ERROR_096005ae~^~Y~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-stage-00727~^~core~^~The spec valid usage text states 'The stage member of one element of pStages must be VK_SHADER_STAGE_VERTEX_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-stage-00727)~^~ +VALIDATION_ERROR_096005b0~^~Y~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-stage-00728~^~core~^~The spec valid usage text states 'The stage member of each element of pStages must not be VK_SHADER_STAGE_COMPUTE_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-stage-00728)~^~ +VALIDATION_ERROR_096005b2~^~Y~^~CreatePipelineTessErrors~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00729~^~core~^~The spec valid usage text states 'If pStages includes a tessellation control shader stage, it must include a tessellation evaluation shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00729)~^~ +VALIDATION_ERROR_096005b4~^~Y~^~CreatePipelineTessErrors~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00730~^~core~^~The spec valid usage text states 'If pStages includes a tessellation evaluation shader stage, it must include a tessellation control shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00730)~^~ +VALIDATION_ERROR_096005b6~^~Y~^~CreatePipelineTessErrors~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00731~^~core~^~The spec valid usage text states 'If pStages includes a tessellation control shader stage and a tessellation evaluation shader stage, pTessellationState must be a valid pointer to a valid VkPipelineTessellationStateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00731)~^~ +VALIDATION_ERROR_096005b8~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00732~^~core~^~The spec valid usage text states 'If pStages includes tessellation shader stages, the shader code of at least one stage must contain an OpExecutionMode instruction that specifies the type of subdivision in the pipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00732)~^~ +VALIDATION_ERROR_096005ba~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00733~^~core~^~The spec valid usage text states 'If pStages includes tessellation shader stages, and the shader code of both stages contain an OpExecutionMode instruction that specifies the type of subdivision in the pipeline, they must both specify the same subdivision mode' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00733)~^~ +VALIDATION_ERROR_096005bc~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00734~^~core~^~The spec valid usage text states 'If pStages includes tessellation shader stages, the shader code of at least one stage must contain an OpExecutionMode instruction that specifies the output patch size in the pipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00734)~^~ +VALIDATION_ERROR_096005be~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00735~^~core~^~The spec valid usage text states 'If pStages includes tessellation shader stages, and the shader code of both contain an OpExecutionMode instruction that specifies the out patch size in the pipeline, they must both specify the same patch size' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00735)~^~ +VALIDATION_ERROR_096005c0~^~Y~^~CreatePipelineTessErrors~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00736~^~core~^~The spec valid usage text states 'If pStages includes tessellation shader stages, the topology member of pInputAssembly must be VK_PRIMITIVE_TOPOLOGY_PATCH_LIST' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00736)~^~ +VALIDATION_ERROR_096005c2~^~Y~^~CreatePipelineTessErrors~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-topology-00737~^~core~^~The spec valid usage text states 'If the topology member of pInputAssembly is VK_PRIMITIVE_TOPOLOGY_PATCH_LIST, pStages must include tessellation shader stages' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-topology-00737)~^~ +VALIDATION_ERROR_096005c4~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00738~^~core~^~The spec valid usage text states 'If pStages includes a geometry shader stage, and does not include any tessellation shader stages, its shader code must contain an OpExecutionMode instruction that specifies an input primitive type that is compatible with the primitive topology specified in pInputAssembly' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00738)~^~ +VALIDATION_ERROR_096005c6~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00739~^~core~^~The spec valid usage text states 'If pStages includes a geometry shader stage, and also includes tessellation shader stages, its shader code must contain an OpExecutionMode instruction that specifies an input primitive type that is compatible with the primitive topology that is output by the tessellation stages' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00739)~^~ +VALIDATION_ERROR_096005c8~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00740~^~core~^~The spec valid usage text states 'If pStages includes a fragment shader stage and a geometry shader stage, and the fragment shader code reads from an input variable that is decorated with PrimitiveID, then the geometry shader code must write to a matching output variable, decorated with PrimitiveID, in all execution paths' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00740)~^~ +VALIDATION_ERROR_096005ca~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00741~^~core~^~The spec valid usage text states 'If pStages includes a fragment shader stage, its shader code must not read from any input attachment that is defined as VK_ATTACHMENT_UNUSED in subpass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00741)~^~ +VALIDATION_ERROR_096005cc~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pStages-00742~^~core~^~The spec valid usage text states 'The shader code for the entry points identified by pStages, and the rest of the state identified by this structure must adhere to the pipeline linking rules described in the Shader Interfaces chapter' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00742)~^~ +VALIDATION_ERROR_096005ce~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-subpass-00743~^~!(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'If rasterization is not disabled and subpass uses a depth/stencil attachment in renderPass that has a layout of VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL in the VkAttachmentReference defined by subpass, the depthWriteEnable member of pDepthStencilState must be VK_FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00743)~^~ +VALIDATION_ERROR_096005d0~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-subpass-00744~^~!(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'If rasterization is not disabled and subpass uses a depth/stencil attachment in renderPass that has a layout of VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL in the VkAttachmentReference defined by subpass, the failOp, passOp and depthFailOp members of each of the front and back members of pDepthStencilState must be VK_STENCIL_OP_KEEP' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00744)~^~ +VALIDATION_ERROR_096005d2~^~N~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-subpass-00745~^~core~^~The spec valid usage text states 'If rasterization is not disabled and the subpass uses color attachments, then for each color attachment in the subpass the blendEnable member of the corresponding element of the pAttachment member of pColorBlendState must be VK_FALSE if the format of the attachment does not support color blend operations, as specified by the VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT flag in VkFormatProperties::linearTilingFeatures or VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00745)~^~ +VALIDATION_ERROR_096005d4~^~Y~^~NumBlendAttachMismatch~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-attachmentCount-00746~^~core~^~The spec valid usage text states 'If rasterization is not disabled and the subpass uses color attachments, the attachmentCount member of pColorBlendState must be equal to the colorAttachmentCount used to create subpass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-attachmentCount-00746)~^~ +VALIDATION_ERROR_096005d6~^~Y~^~PSOViewportStateTests,PSOViewportStateMultiViewportTests~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00747~^~core~^~The spec valid usage text states 'If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_VIEWPORT, the pViewports member of pViewportState must be a valid pointer to an array of pViewportState::viewportCount VkViewport structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00747)~^~ +VALIDATION_ERROR_096005d8~^~Y~^~PSOViewportStateTests,PSOViewportStateMultiViewportTests~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00748~^~core~^~The spec valid usage text states 'If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_SCISSOR, the pScissors member of pViewportState must be a valid pointer to an array of pViewportState::scissorCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00748)~^~ +VALIDATION_ERROR_096005da~^~Y~^~PSOLineWidthInvalid~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00749~^~core~^~The spec valid usage text states 'If the wide lines feature is not enabled, and no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_LINE_WIDTH, the lineWidth member of pRasterizationState must be 1.0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00749)~^~ +VALIDATION_ERROR_096005dc~^~Y~^~PSOViewportStateTests~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00750~^~core~^~The spec valid usage text states 'If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, pViewportState must be a valid pointer to a valid VkPipelineViewportStateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00750)~^~ +VALIDATION_ERROR_096005de~^~Y~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00751~^~core~^~The spec valid usage text states 'If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, pMultisampleState must be a valid pointer to a valid VkPipelineMultisampleStateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00751)~^~ +VALIDATION_ERROR_096005e0~^~Y~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00752~^~core~^~The spec valid usage text states 'If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, and subpass uses a depth/stencil attachment, pDepthStencilState must be a valid pointer to a valid VkPipelineDepthStencilStateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00752)~^~ +VALIDATION_ERROR_096005e2~^~Y~^~PipelineRenderpassCompatibility~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00753~^~core~^~The spec valid usage text states 'If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, and subpass uses color attachments, pColorBlendState must be a valid pointer to a valid VkPipelineColorBlendStateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00753)~^~ +VALIDATION_ERROR_096005e4~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00754~^~core~^~The spec valid usage text states 'If the depth bias clamping feature is not enabled, no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_DEPTH_BIAS, and the depthBiasEnable member of pRasterizationState is VK_TRUE, the depthBiasClamp member of pRasterizationState must be 0.0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00754)~^~ +VALIDATION_ERROR_096005e6~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00755~^~(VK_EXT_depth_range_unrestricted)~^~The spec valid usage text states 'If the VK_EXT_depth_range_unrestricted extension is not enabled and no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_DEPTH_BOUNDS, and the depthBoundsTestEnable member of pDepthStencilState is VK_TRUE, the minDepthBounds and maxDepthBounds members of pDepthStencilState must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00755)~^~ +VALIDATION_ERROR_096005e8~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-layout-00756~^~core~^~The spec valid usage text states 'layout must be consistent with all shaders specified in pStages' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-layout-00756)~^~ +VALIDATION_ERROR_096005ea~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-subpass-00757~^~!(VK_AMD_mixed_attachment_samples)+!(VK_NV_framebuffer_mixed_samples)~^~The spec valid usage text states 'If subpass uses color and/or depth/stencil attachments, then the rasterizationSamples member of pMultisampleState must be the same as the sample count for those subpass attachments' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00757)~^~ +VALIDATION_ERROR_096005ec~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-subpass-00758~^~core~^~The spec valid usage text states 'If subpass does not use any color and/or depth/stencil attachments, then the rasterizationSamples member of pMultisampleState must follow the rules for a zero-attachment subpass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00758)~^~ +VALIDATION_ERROR_096005ee~^~Y~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-subpass-00759~^~core~^~The spec valid usage text states 'subpass must be a valid subpass within renderPass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00759)~^~ +VALIDATION_ERROR_096005f0~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-renderPass-00760~^~(VK_VERSION_1_1,VK_KHR_multiview)~^~The spec valid usage text states 'If the renderPass has multiview enabled and subpass has more than one bit set in the view mask and multiviewTessellationShader is not enabled, then pStages must not include tessellation shaders.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-renderPass-00760)~^~ +VALIDATION_ERROR_096005f2~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-renderPass-00761~^~(VK_VERSION_1_1,VK_KHR_multiview)~^~The spec valid usage text states 'If the renderPass has multiview enabled and subpass has more than one bit set in the view mask and multiviewGeometryShader is not enabled, then pStages must not include a geometry shader.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-renderPass-00761)~^~ +VALIDATION_ERROR_096005f4~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-renderPass-00762~^~(VK_VERSION_1_1,VK_KHR_multiview)~^~The spec valid usage text states 'If the renderPass has multiview enabled and subpass has more than one bit set in the view mask, shaders in the pipeline must not write to the Layer built-in output' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-renderPass-00762)~^~ +VALIDATION_ERROR_096005f6~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-renderPass-00763~^~(VK_VERSION_1_1,VK_KHR_multiview)~^~The spec valid usage text states 'If the renderPass has multiview enabled, then all shaders must not include variables decorated with the Layer built-in decoration in their interfaces.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-renderPass-00763)~^~ +VALIDATION_ERROR_096005f8~^~N~^~Unknown~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-flags-00764~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'flags must not contain the VK_PIPELINE_CREATE_DISPATCH_BASE flag.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-flags-00764)~^~ VALIDATION_ERROR_09600b06~^~N~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-subpass-01411~^~(VK_NV_framebuffer_mixed_samples)~^~The spec valid usage text states 'If subpass has a depth/stencil attachment and depth test, stencil test, or depth bounds test are enabled, then the rasterizationSamples member of pMultisampleState must be the same as the sample count of the depth/stencil attachment' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-01411)~^~ VALIDATION_ERROR_09600b08~^~N~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-subpass-01412~^~(VK_NV_framebuffer_mixed_samples)~^~The spec valid usage text states 'If subpass has any color attachments, then the rasterizationSamples member of pMultisampleState must be greater than or equal to the sample count for those subpass attachments' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-01412)~^~ VALIDATION_ERROR_09600bc2~^~Y~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-subpass-01505~^~(VK_AMD_mixed_attachment_samples)~^~The spec valid usage text states 'If subpass uses color and/or depth/stencil attachments, then the rasterizationSamples member of pMultisampleState must equal the maximum of the sample counts of those subpass attachments' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-01505)~^~ @@ -594,1021 +578,1043 @@ VALIDATION_ERROR_09600be4~^~N~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01522~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, and the sampleLocationsEnable member of a VkPipelineSampleLocationsStateCreateInfoEXT structure chained to the pNext chain of pMultisampleState is VK_TRUE, sampleLocationsInfo.sampleLocationGridSize.height must evenly divide VkMultisamplePropertiesEXT::sampleLocationGridSize.height as returned by vkGetPhysicalDeviceMultisamplePropertiesEXT with a samples parameter equaling rasterizationSamples' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01522)~^~ VALIDATION_ERROR_09600be6~^~N~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01523~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, and the sampleLocationsEnable member of a VkPipelineSampleLocationsStateCreateInfoEXT structure chained to the pNext chain of pMultisampleState is VK_TRUE, sampleLocationsInfo.sampleLocationsPerPixel must equal rasterizationSamples' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01523)~^~ VALIDATION_ERROR_09600be8~^~N~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-sampleLocationsEnable-01524~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If the sampleLocationsEnable member of a VkPipelineSampleLocationsStateCreateInfoEXT structure chained to the pNext chain of pMultisampleState is VK_TRUE, the fragment shader code must not statically use the extended instruction InterpolateAtSample' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-sampleLocationsEnable-01524)~^~ -VALIDATION_ERROR_09600c3a~^~N~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pStages-01565~^~(VK_KHR_maintenance2)~^~The spec valid usage text states 'If pStages includes a fragment shader stage and an input attachment was referenced by the VkRenderPassInputAttachmentAspectCreateInfoKHR at renderpass create time, its shader code must not read from any aspect that was not specified in the aspectMask of the corresponding VkInputAttachmentAspectReferenceKHR structure.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-01565)~^~ +VALIDATION_ERROR_09600c3a~^~N~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pStages-01565~^~(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'If pStages includes a fragment shader stage and an input attachment was referenced by the VkRenderPassInputAttachmentAspectCreateInfo at renderPass create time, its shader code must not read from any aspect that was not specified in the aspectMask of the corresponding VkInputAttachmentAspectReference structure.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-01565)~^~ VALIDATION_ERROR_09600d30~^~N~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-layout-01688~^~core~^~The spec valid usage text states 'The number of resources in layout accessible to each shader stage that is used by the pipeline must be less than or equal to VkPhysicalDeviceLimits::maxPerStageResources' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-layout-01688)~^~ VALIDATION_ERROR_09600d66~^~N~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01715~^~(VK_NV_clip_space_w_scaling)~^~The spec valid usage text states 'If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV, and the viewportWScalingEnable member of a VkPipelineViewportWScalingStateCreateInfoNV structure, chained to the pNext chain of pViewportState, is VK_TRUE, the pViewportWScalings member of the VkPipelineViewportWScalingStateCreateInfoNV must be a pointer to an array of VkPipelineViewportWScalingStateCreateInfoNV::viewportCount valid VkViewportWScalingNV structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01715)~^~ -VALIDATION_ERROR_09609001~^~Y~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkPipelineCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-flags-parameter)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0960be01~^~Y~^~None~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-layout-parameter~^~core~^~The spec valid usage text states 'layout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-layout-parameter)~^~implicit -VALIDATION_ERROR_09615601~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pDynamicState-parameter~^~core~^~The spec valid usage text states 'If pDynamicState is not NULL, pDynamicState must be a valid pointer to a valid VkPipelineDynamicStateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicState-parameter)~^~implicit -VALIDATION_ERROR_09619801~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pInputAssemblyState-parameter~^~core~^~The spec valid usage text states 'pInputAssemblyState must be a valid pointer to a valid VkPipelineInputAssemblyStateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pInputAssemblyState-parameter)~^~implicit -VALIDATION_ERROR_0961c40d~^~Y~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkPipelineDiscardRectangleStateCreateInfoEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_09620801~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pRasterizationState-parameter~^~core~^~The spec valid usage text states 'pRasterizationState must be a valid pointer to a valid VkPipelineRasterizationStateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pRasterizationState-parameter)~^~implicit -VALIDATION_ERROR_09623e01~^~Y~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pStages-parameter~^~core~^~The spec valid usage text states 'pStages must be a valid pointer to an array of stageCount valid VkPipelineShaderStageCreateInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-parameter)~^~implicit -VALIDATION_ERROR_09626801~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-pVertexInputState-parameter~^~core~^~The spec valid usage text states 'pVertexInputState must be a valid pointer to a valid VkPipelineVertexInputStateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pVertexInputState-parameter)~^~implicit -VALIDATION_ERROR_0962ae01~^~Y~^~None~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-renderPass-parameter~^~core~^~The spec valid usage text states 'renderPass must be a valid VkRenderPass handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-renderPass-parameter)~^~implicit -VALIDATION_ERROR_0962b00b~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-sType-sType)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_0962da1b~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-stageCount-arraylength~^~core~^~The spec valid usage text states 'stageCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-stageCount-arraylength)~^~implicit -VALIDATION_ERROR_09800a48~^~N~^~Unknown~^~vkCreateIOSSurfaceMVK~^~VUID-VkIOSSurfaceCreateInfoMVK-pView-01316~^~core~^~The spec valid usage text states 'pView must be a valid UIView and must be backed by a CALayer instance of type CAMetalLayer.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIOSSurfaceCreateInfoMVK-pView-01316)~^~ -VALIDATION_ERROR_09809005~^~Y~^~Unknown~^~vkCreateIOSSurfaceMVK~^~VUID-VkIOSSurfaceCreateInfoMVK-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIOSSurfaceCreateInfoMVK-flags-zerobitmask)~^~implicit -VALIDATION_ERROR_0981c40d~^~Y~^~Unknown~^~vkCreateIOSSurfaceMVK~^~VUID-VkIOSSurfaceCreateInfoMVK-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIOSSurfaceCreateInfoMVK-pNext-pNext)~^~implicit -VALIDATION_ERROR_09826a01~^~N~^~Unknown~^~vkCreateIOSSurfaceMVK~^~VUID-VkIOSSurfaceCreateInfoMVK-pView-parameter~^~core~^~The spec valid usage text states 'pView must be a pointer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIOSSurfaceCreateInfoMVK-pView-parameter)~^~implicit -VALIDATION_ERROR_0982b00b~^~Y~^~Unknown~^~vkCreateIOSSurfaceMVK~^~VUID-VkIOSSurfaceCreateInfoMVK-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIOSSurfaceCreateInfoMVK-sType-sType)~^~implicit -VALIDATION_ERROR_09a001dc~^~Y~^~Unknown~^~vkCmdBlitImage~^~VUID-VkImageBlit-aspectMask-00238~^~core~^~The spec valid usage text states 'The aspectMask member of srcSubresource and dstSubresource must match' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-aspectMask-00238)~^~ -VALIDATION_ERROR_09a001de~^~Y~^~Unknown~^~vkCmdBlitImage~^~VUID-VkImageBlit-layerCount-00239~^~core~^~The spec valid usage text states 'The layerCount member of srcSubresource and dstSubresource must match' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-layerCount-00239)~^~ -VALIDATION_ERROR_09a001e0~^~Y~^~MiscBlitImageTests~^~vkCmdBlitImage~^~VUID-VkImageBlit-srcImage-00240~^~core~^~The spec valid usage text states 'If either of the calling command's srcImage or dstImage parameters are of VkImageType VK_IMAGE_TYPE_3D, the baseArrayLayer and layerCount members of both srcSubresource and dstSubresource must be 0 and 1, respectively' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-srcImage-00240)~^~ -VALIDATION_ERROR_09a001e2~^~Y~^~MiscBlitImageTests~^~vkCmdBlitImage~^~VUID-VkImageBlit-aspectMask-00241~^~core~^~The spec valid usage text states 'The aspectMask member of srcSubresource must specify aspects present in the calling command's srcImage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-aspectMask-00241)~^~ -VALIDATION_ERROR_09a001e4~^~Y~^~MiscBlitImageTests~^~vkCmdBlitImage~^~VUID-VkImageBlit-aspectMask-00242~^~core~^~The spec valid usage text states 'The aspectMask member of dstSubresource must specify aspects present in the calling command's dstImage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-aspectMask-00242)~^~ -VALIDATION_ERROR_09a001e6~^~Y~^~BlitImageOffsets~^~vkCmdBlitImage~^~VUID-VkImageBlit-srcOffset-00243~^~core~^~The spec valid usage text states 'srcOffset[0].x and srcOffset[1].x must both be greater than or equal to 0 and less than or equal to the source image subresource width' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-srcOffset-00243)~^~ -VALIDATION_ERROR_09a001e8~^~Y~^~BlitImageOffsets~^~vkCmdBlitImage~^~VUID-VkImageBlit-srcOffset-00244~^~core~^~The spec valid usage text states 'srcOffset[0].y and srcOffset[1].y must both be greater than or equal to 0 and less than or equal to the source image subresource height' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-srcOffset-00244)~^~ -VALIDATION_ERROR_09a001ea~^~Y~^~BlitImageOffsets~^~vkCmdBlitImage~^~VUID-VkImageBlit-srcImage-00245~^~core~^~The spec valid usage text states 'If the calling command's srcImage is of type VK_IMAGE_TYPE_1D, then srcOffset[0].y must be 0 and srcOffset[1].y must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-srcImage-00245)~^~ -VALIDATION_ERROR_09a001ec~^~Y~^~BlitImageOffsets~^~vkCmdBlitImage~^~VUID-VkImageBlit-srcOffset-00246~^~core~^~The spec valid usage text states 'srcOffset[0].z and srcOffset[1].z must both be greater than or equal to 0 and less than or equal to the source image subresource depth' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-srcOffset-00246)~^~ -VALIDATION_ERROR_09a001ee~^~Y~^~BlitImageOffsets~^~vkCmdBlitImage~^~VUID-VkImageBlit-srcImage-00247~^~core~^~The spec valid usage text states 'If the calling command's srcImage is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then srcOffset[0].z must be 0 and srcOffset[1].z must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-srcImage-00247)~^~ -VALIDATION_ERROR_09a001f0~^~Y~^~BlitImageOffsets~^~vkCmdBlitImage~^~VUID-VkImageBlit-dstOffset-00248~^~core~^~The spec valid usage text states 'dstOffset[0].x and dstOffset[1].x must both be greater than or equal to 0 and less than or equal to the destination image subresource width' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-dstOffset-00248)~^~ -VALIDATION_ERROR_09a001f2~^~Y~^~BlitImageOffsets~^~vkCmdBlitImage~^~VUID-VkImageBlit-dstOffset-00249~^~core~^~The spec valid usage text states 'dstOffset[0].y and dstOffset[1].y must both be greater than or equal to 0 and less than or equal to the destination image subresource height' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-dstOffset-00249)~^~ -VALIDATION_ERROR_09a001f4~^~Y~^~BlitImageOffsets~^~vkCmdBlitImage~^~VUID-VkImageBlit-dstImage-00250~^~core~^~The spec valid usage text states 'If the calling command's dstImage is of type VK_IMAGE_TYPE_1D, then dstOffset[0].y must be 0 and dstOffset[1].y must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-dstImage-00250)~^~ -VALIDATION_ERROR_09a001f6~^~Y~^~BlitImageOffsets~^~vkCmdBlitImage~^~VUID-VkImageBlit-dstOffset-00251~^~core~^~The spec valid usage text states 'dstOffset[0].z and dstOffset[1].z must both be greater than or equal to 0 and less than or equal to the destination image subresource depth' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-dstOffset-00251)~^~ -VALIDATION_ERROR_09a001f8~^~Y~^~BlitImageOffsets~^~vkCmdBlitImage~^~VUID-VkImageBlit-dstImage-00252~^~core~^~The spec valid usage text states 'If the calling command's dstImage is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then dstOffset[0].z must be 0 and dstOffset[1].z must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-dstImage-00252)~^~ -VALIDATION_ERROR_09a07a01~^~N~^~Unknown~^~vkCmdBlitImage~^~VUID-VkImageBlit-dstSubresource-parameter~^~core~^~The spec valid usage text states 'dstSubresource must be a valid VkImageSubresourceLayers structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-dstSubresource-parameter)~^~implicit -VALIDATION_ERROR_09a2d601~^~N~^~Unknown~^~vkCmdBlitImage~^~VUID-VkImageBlit-srcSubresource-parameter~^~core~^~The spec valid usage text states 'srcSubresource must be a valid VkImageSubresourceLayers structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-srcSubresource-parameter)~^~implicit -VALIDATION_ERROR_09c00112~^~Y~^~CopyImageAspectMismatch~^~vkCmdCopyImage~^~VUID-VkImageCopy-aspectMask-00137~^~!(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'The aspectMask member of srcSubresource and dstSubresource must match' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-aspectMask-00137)~^~ -VALIDATION_ERROR_09c00114~^~N~^~None~^~vkCmdCopyImage~^~VUID-VkImageCopy-layerCount-00138~^~!(VK_KHR_maintenance1)~^~The spec valid usage text states 'The layerCount member of srcSubresource and dstSubresource must match' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-layerCount-00138)~^~ -VALIDATION_ERROR_09c00116~^~N~^~None~^~vkCmdCopyImage~^~VUID-VkImageCopy-srcImage-00139~^~!(VK_KHR_maintenance1)~^~The spec valid usage text states 'If either of the calling command's srcImage or dstImage parameters are of VkImageType VK_IMAGE_TYPE_3D, the baseArrayLayer and layerCount members of both srcSubresource and dstSubresource must be 0 and 1, respectively' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcImage-00139)~^~ -VALIDATION_ERROR_09c00118~^~Y~^~CopyImageLayerCountMismatch~^~vkCmdCopyImage~^~VUID-VkImageCopy-extent-00140~^~(VK_KHR_maintenance1)~^~The spec valid usage text states 'The number of slices of the extent (for 3D) or layers of the srcSubresource (for non-3D) must match the number of slices of the extent (for 3D) or layers of the dstSubresource (for non-3D)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-extent-00140)~^~ -VALIDATION_ERROR_09c0011a~^~Y~^~CopyImageTypeExtentMismatch~^~vkCmdCopyImage~^~VUID-VkImageCopy-srcImage-00141~^~(VK_KHR_maintenance1)~^~The spec valid usage text states 'If either of the calling command's srcImage or dstImage parameters are of VkImageType VK_IMAGE_TYPE_3D, the baseArrayLayer and layerCount members of the corresponding subresource must be 0 and 1, respectively' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-00141)~^~ -VALIDATION_ERROR_09c0011c~^~Y~^~CopyImageAspectMismatch~^~vkCmdCopyImage~^~VUID-VkImageCopy-aspectMask-00142~^~core~^~The spec valid usage text states 'The aspectMask member of srcSubresource must specify aspects present in the calling command's srcImage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-aspectMask-00142)~^~ -VALIDATION_ERROR_09c0011e~^~Y~^~CopyImageAspectMismatch~^~vkCmdCopyImage~^~VUID-VkImageCopy-aspectMask-00143~^~core~^~The spec valid usage text states 'The aspectMask member of dstSubresource must specify aspects present in the calling command's dstImage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-aspectMask-00143)~^~ -VALIDATION_ERROR_09c00120~^~Y~^~CopyImageSrcSizeExceeded~^~vkCmdCopyImage~^~VUID-VkImageCopy-srcOffset-00144~^~core~^~The spec valid usage text states 'srcOffset.x and (extent.width + srcOffset.x) must both be greater than or equal to 0 and less than or equal to the source image subresource width' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcOffset-00144)~^~ -VALIDATION_ERROR_09c00122~^~Y~^~CopyImageSrcSizeExceeded~^~vkCmdCopyImage~^~VUID-VkImageCopy-srcOffset-00145~^~core~^~The spec valid usage text states 'srcOffset.y and (extent.height + srcOffset.y) must both be greater than or equal to 0 and less than or equal to the source image subresource height' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcOffset-00145)~^~ -VALIDATION_ERROR_09c00124~^~Y~^~CopyImageTypeExtentMismatch~^~vkCmdCopyImage~^~VUID-VkImageCopy-srcImage-00146~^~core~^~The spec valid usage text states 'If the calling command's srcImage is of type VK_IMAGE_TYPE_1D, then srcOffset.y must be 0 and extent.height must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcImage-00146)~^~ -VALIDATION_ERROR_09c00126~^~Y~^~CopyImageSrcSizeExceeded~^~vkCmdCopyImage~^~VUID-VkImageCopy-srcOffset-00147~^~core~^~The spec valid usage text states 'srcOffset.z and (extent.depth + srcOffset.z) must both be greater than or equal to 0 and less than or equal to the source image subresource depth' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcOffset-00147)~^~ -VALIDATION_ERROR_09c00128~^~Y~^~CopyImageTypeExtentMismatch~^~vkCmdCopyImage~^~VUID-VkImageCopy-srcImage-00148~^~core~^~The spec valid usage text states 'If the calling command's srcImage is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then srcOffset.z must be 0 and extent.depth must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcImage-00148)~^~ -VALIDATION_ERROR_09c0012a~^~Y~^~CopyImageTypeExtentMismatch~^~vkCmdCopyImage~^~VUID-VkImageCopy-srcSubresource-00149~^~core~^~The spec valid usage text states 'srcSubresource.baseArrayLayer must be less than and (srcSubresource.layerCount + srcSubresource.baseArrayLayer) must be less than or equal to the number of layers in the source image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcSubresource-00149)~^~ -VALIDATION_ERROR_09c0012c~^~Y~^~CopyImageDstSizeExceeded~^~vkCmdCopyImage~^~VUID-VkImageCopy-dstOffset-00150~^~core~^~The spec valid usage text states 'dstOffset.x and (extent.width + dstOffset.x) must both be greater than or equal to 0 and less than or equal to the destination image subresource width' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstOffset-00150)~^~ -VALIDATION_ERROR_09c0012e~^~Y~^~CopyImageDstSizeExceeded~^~vkCmdCopyImage~^~VUID-VkImageCopy-dstOffset-00151~^~core~^~The spec valid usage text states 'dstOffset.y and (extent.height + dstOffset.y) must both be greater than or equal to 0 and less than or equal to the destination image subresource height' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstOffset-00151)~^~ -VALIDATION_ERROR_09c00130~^~Y~^~CopyImageTypeExtentMismatch~^~vkCmdCopyImage~^~VUID-VkImageCopy-dstImage-00152~^~core~^~The spec valid usage text states 'If the calling command's dstImage is of type VK_IMAGE_TYPE_1D, then dstOffset.y must be 0 and extent.height must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstImage-00152)~^~ -VALIDATION_ERROR_09c00132~^~Y~^~CopyImageDstSizeExceeded~^~vkCmdCopyImage~^~VUID-VkImageCopy-dstOffset-00153~^~core~^~The spec valid usage text states 'dstOffset.z and (extent.depth + dstOffset.z) must both be greater than or equal to 0 and less than or equal to the destination image subresource depth' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstOffset-00153)~^~ -VALIDATION_ERROR_09c00134~^~Y~^~CopyImageTypeExtentMismatch~^~vkCmdCopyImage~^~VUID-VkImageCopy-dstImage-00154~^~core~^~The spec valid usage text states 'If the calling command's dstImage is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then dstOffset.z must be 0 and extent.depth must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstImage-00154)~^~ -VALIDATION_ERROR_09c00136~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-VkImageCopy-dstSubresource-00155~^~core~^~The spec valid usage text states 'dstSubresource.baseArrayLayer must be less than and (dstSubresource.layerCount + dstSubresource.baseArrayLayer) must be less than or equal to the number of layers in the destination image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstSubresource-00155)~^~ -VALIDATION_ERROR_09c0013a~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-VkImageCopy-srcOffset-00157~^~core~^~The spec valid usage text states 'If the calling command's srcImage is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcOffset-00157)~^~ -VALIDATION_ERROR_09c0013c~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-VkImageCopy-extent-00158~^~core~^~The spec valid usage text states 'If the calling command's srcImage is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-extent-00158)~^~ -VALIDATION_ERROR_09c0013e~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-VkImageCopy-extent-00159~^~core~^~The spec valid usage text states 'If the calling command's srcImage is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-extent-00159)~^~ -VALIDATION_ERROR_09c00140~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-VkImageCopy-extent-00160~^~core~^~The spec valid usage text states 'If the calling command's srcImage is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-extent-00160)~^~ -VALIDATION_ERROR_09c00144~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-VkImageCopy-dstOffset-00162~^~core~^~The spec valid usage text states 'If the calling command's dstImage is a compressed format image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstOffset-00162)~^~ -VALIDATION_ERROR_09c00146~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-VkImageCopy-extent-00163~^~core~^~The spec valid usage text states 'If the calling command's dstImage is a compressed format image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-extent-00163)~^~ -VALIDATION_ERROR_09c00148~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-VkImageCopy-extent-00164~^~core~^~The spec valid usage text states 'If the calling command's dstImage is a compressed format image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-extent-00164)~^~ -VALIDATION_ERROR_09c0014a~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-VkImageCopy-extent-00165~^~core~^~The spec valid usage text states 'If the calling command's dstImage is a compressed format image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-extent-00165)~^~ -VALIDATION_ERROR_09c0014c~^~N~^~Unknown~^~vkCmdCopyImage~^~VUID-VkImageCopy-srcOffset-00166~^~core~^~The spec valid usage text states 'srcOffset, dstOffset, and extent must respect the image transfer granularity requirements of the queue family that it will be submitted against, as described in Physical Device Enumeration' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcOffset-00166)~^~ -VALIDATION_ERROR_09c00c1e~^~N~^~None~^~VkImageCopy~^~VUID-VkImageCopy-srcImage-01551~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If neither the calling command's srcImage nor the calling command's dstImage has a multi-planar image format then the aspectMask member of srcSubresource and dstSubresource must match' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-01551)~^~ -VALIDATION_ERROR_09c00c20~^~N~^~None~^~VkImageCopy~^~VUID-VkImageCopy-srcImage-01552~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's srcImage has a VkFormat with two planes then the srcSubresource aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR or VK_IMAGE_ASPECT_PLANE_1_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-01552)~^~ -VALIDATION_ERROR_09c00c22~^~N~^~None~^~VkImageCopy~^~VUID-VkImageCopy-srcImage-01553~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's srcImage has a VkFormat with three planes then the srcSubresource aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR, or VK_IMAGE_ASPECT_PLANE_2_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-01553)~^~ -VALIDATION_ERROR_09c00c24~^~N~^~None~^~VkImageCopy~^~VUID-VkImageCopy-dstImage-01554~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's dstImage has a VkFormat with two planes then the dstSubresource aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR or VK_IMAGE_ASPECT_PLANE_1_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-dstImage-01554)~^~ -VALIDATION_ERROR_09c00c26~^~N~^~None~^~VkImageCopy~^~VUID-VkImageCopy-dstImage-01555~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's dstImage has a VkFormat with three planes then the dstSubresource aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR, or VK_IMAGE_ASPECT_PLANE_2_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-dstImage-01555)~^~ -VALIDATION_ERROR_09c00c28~^~N~^~None~^~VkImageCopy~^~VUID-VkImageCopy-srcImage-01556~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's srcImage has a multi-planar image format and the dstImage does not have a multi-planar image format, the dstSubresource aspectMask must be VK_IMAGE_ASPECT_COLOR_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-01556)~^~ -VALIDATION_ERROR_09c00c2a~^~N~^~None~^~VkImageCopy~^~VUID-VkImageCopy-dstImage-01557~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's dstImage has a multi-planar image format and the srcImage does not have a multi-planar image format, the srcSubresource aspectMask must be VK_IMAGE_ASPECT_COLOR_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-dstImage-01557)~^~ -VALIDATION_ERROR_09c07a01~^~N~^~Unknown~^~vkCmdCopyImage~^~VUID-VkImageCopy-dstSubresource-parameter~^~core~^~The spec valid usage text states 'dstSubresource must be a valid VkImageSubresourceLayers structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstSubresource-parameter)~^~implicit -VALIDATION_ERROR_09c2d601~^~N~^~Unknown~^~vkCmdCopyImage~^~VUID-VkImageCopy-srcSubresource-parameter~^~core~^~The spec valid usage text states 'srcSubresource must be a valid VkImageSubresourceLayers structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcSubresource-parameter)~^~implicit -VALIDATION_ERROR_09e00758~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-format-00940~^~core~^~The spec valid usage text states 'The combination of format, imageType, tiling, usage, and flags must be supported, as indicated by a VK_SUCCESS return value from vkGetPhysicalDeviceImageFormatProperties invoked with the same values passed to the corresponding parameters.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-format-00940)~^~ -VALIDATION_ERROR_09e0075a~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-sharingMode-00941~^~core~^~The spec valid usage text states 'If sharingMode is VK_SHARING_MODE_CONCURRENT, pQueueFamilyIndices must be a valid pointer to an array of queueFamilyIndexCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-sharingMode-00941)~^~ -VALIDATION_ERROR_09e0075c~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-sharingMode-00942~^~core~^~The spec valid usage text states 'If sharingMode is VK_SHARING_MODE_CONCURRENT, queueFamilyIndexCount must be greater than 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-sharingMode-00942)~^~ -VALIDATION_ERROR_09e0075e~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-format-00943~^~core~^~The spec valid usage text states 'format must not be VK_FORMAT_UNDEFINED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-format-00943)~^~ -VALIDATION_ERROR_09e00760~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-extent-00944~^~core~^~The spec valid usage text states 'extent::width must be greater than 0.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-extent-00944)~^~ -VALIDATION_ERROR_09e00762~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-extent-00945~^~core~^~The spec valid usage text states 'extent::height must be greater than 0.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-extent-00945)~^~ -VALIDATION_ERROR_09e00764~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-extent-00946~^~core~^~The spec valid usage text states 'extent::depth must be greater than 0.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-extent-00946)~^~ -VALIDATION_ERROR_09e00766~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-mipLevels-00947~^~core~^~The spec valid usage text states 'mipLevels must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-mipLevels-00947)~^~ -VALIDATION_ERROR_09e00768~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-arrayLayers-00948~^~core~^~The spec valid usage text states 'arrayLayers must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-arrayLayers-00948)~^~ -VALIDATION_ERROR_09e0076a~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-flags-00949~^~core~^~The spec valid usage text states 'If flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, imageType must be VK_IMAGE_TYPE_2D' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-flags-00949)~^~ -VALIDATION_ERROR_09e0076c~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-flags-00950~^~(VK_KHR_maintenance1)~^~The spec valid usage text states 'If flags contains VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR, imageType must be VK_IMAGE_TYPE_3D' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-flags-00950)~^~ -VALIDATION_ERROR_09e0076e~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-imageType-00951~^~core~^~The spec valid usage text states 'If imageType is VK_IMAGE_TYPE_1D, extent.width must be less than or equal to VkPhysicalDeviceLimits::maxImageDimension1D, or VkImageFormatProperties::maxExtent.width (as returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure) - whichever is higher' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00951)~^~ -VALIDATION_ERROR_09e00770~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-imageType-00952~^~core~^~The spec valid usage text states 'If imageType is VK_IMAGE_TYPE_2D and flags does not contain VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, extent.width and extent.height must be less than or equal to VkPhysicalDeviceLimits::maxImageDimension2D, or VkImageFormatProperties::maxExtent.width/height (as returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure) - whichever is higher' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00952)~^~ -VALIDATION_ERROR_09e00772~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-imageType-00953~^~core~^~The spec valid usage text states 'If imageType is VK_IMAGE_TYPE_2D and flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, extent.width and extent.height must be less than or equal to VkPhysicalDeviceLimits::maxImageDimensionCube, or VkImageFormatProperties::maxExtent.width/height (as returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure) - whichever is higher' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00953)~^~ -VALIDATION_ERROR_09e00774~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-imageType-00954~^~core~^~The spec valid usage text states 'If imageType is VK_IMAGE_TYPE_2D and flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, extent.width and extent.height must be equal and arrayLayers must be greater than or equal to 6' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00954)~^~ -VALIDATION_ERROR_09e00776~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-imageType-00955~^~core~^~The spec valid usage text states 'If imageType is VK_IMAGE_TYPE_3D, extent.width, extent.height and extent.depth must be less than or equal to VkPhysicalDeviceLimits::maxImageDimension3D, or VkImageFormatProperties::maxExtent.width/height/depth (as returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure) - whichever is higher' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00955)~^~ -VALIDATION_ERROR_09e00778~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-imageType-00956~^~core~^~The spec valid usage text states 'If imageType is VK_IMAGE_TYPE_1D, both extent.height and extent.depth must be 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00956)~^~ -VALIDATION_ERROR_09e0077a~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-imageType-00957~^~core~^~The spec valid usage text states 'If imageType is VK_IMAGE_TYPE_2D, extent.depth must be 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00957)~^~ -VALIDATION_ERROR_09e0077c~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-mipLevels-00958~^~core~^~The spec valid usage text states 'mipLevels must be less than or equal to {lfloor}log2(max(extent.width, extent.height, extent.depth)){rfloor} + 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-mipLevels-00958)~^~ -VALIDATION_ERROR_09e0077e~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-extent-00959~^~core~^~The spec valid usage text states 'If any of extent.width, extent.height, or extent.depth are greater than the equivalently named members of VkPhysicalDeviceLimits::maxImageDimension3D, mipLevels must be less than or equal to VkImageFormatProperties::maxMipLevels (as returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-extent-00959)~^~ -VALIDATION_ERROR_09e00780~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-arrayLayers-00960~^~core~^~The spec valid usage text states 'arrayLayers must be less than or equal to VkImageFormatProperties::maxArrayLayers (as returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-arrayLayers-00960)~^~ -VALIDATION_ERROR_09e00782~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-imageType-00961~^~core~^~The spec valid usage text states 'If imageType is VK_IMAGE_TYPE_3D, arrayLayers must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00961)~^~ -VALIDATION_ERROR_09e00784~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-samples-00962~^~core~^~The spec valid usage text states 'If samples is not VK_SAMPLE_COUNT_1_BIT, imageType must be VK_IMAGE_TYPE_2D, flags must not contain VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, tiling must be VK_IMAGE_TILING_OPTIMAL, and mipLevels must be equal to 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-samples-00962)~^~ -VALIDATION_ERROR_09e00786~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-usage-00963~^~core~^~The spec valid usage text states 'If usage includes VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, then bits other than VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, and VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT must not be set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-usage-00963)~^~ -VALIDATION_ERROR_09e00788~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-usage-00964~^~core~^~The spec valid usage text states 'If usage includes VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, or VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, extent.width must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferWidth' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-usage-00964)~^~ -VALIDATION_ERROR_09e0078a~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-usage-00965~^~core~^~The spec valid usage text states 'If usage includes VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, or VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, extent.height must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferHeight' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-usage-00965)~^~ -VALIDATION_ERROR_09e0078c~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-usage-00966~^~core~^~The spec valid usage text states 'If usage includes VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, usage must also contain at least one of VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, or VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-usage-00966)~^~ -VALIDATION_ERROR_09e0078e~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-samples-00967~^~core~^~The spec valid usage text states 'samples must be a bit value that is set in VkImageFormatProperties::sampleCounts returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-samples-00967)~^~ -VALIDATION_ERROR_09e00790~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-usage-00968~^~core~^~The spec valid usage text states 'If the multisampled storage images feature is not enabled, and usage contains VK_IMAGE_USAGE_STORAGE_BIT, samples must be VK_SAMPLE_COUNT_1_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-usage-00968)~^~ -VALIDATION_ERROR_09e00792~^~Y~^~None~^~vkCreateImage~^~VUID-VkImageCreateInfo-flags-00969~^~core~^~The spec valid usage text states 'If the sparse bindings feature is not enabled, flags must not contain VK_IMAGE_CREATE_SPARSE_BINDING_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-flags-00969)~^~ -VALIDATION_ERROR_09e00794~^~Y~^~SparseResidencyImageCreateUnsupportedTypes~^~vkCreateImage~^~VUID-VkImageCreateInfo-imageType-00970~^~core~^~The spec valid usage text states 'If imageType is VK_IMAGE_TYPE_1D, flags must not contain VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00970)~^~ -VALIDATION_ERROR_09e00796~^~Y~^~SparseResidencyImageCreateUnsupportedTypes~^~vkCreateImage~^~VUID-VkImageCreateInfo-imageType-00971~^~core~^~The spec valid usage text states 'If the sparse residency for 2D images feature is not enabled, and imageType is VK_IMAGE_TYPE_2D, flags must not contain VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00971)~^~ -VALIDATION_ERROR_09e00798~^~Y~^~SparseResidencyImageCreateUnsupportedTypes~^~vkCreateImage~^~VUID-VkImageCreateInfo-imageType-00972~^~core~^~The spec valid usage text states 'If the sparse residency for 3D images feature is not enabled, and imageType is VK_IMAGE_TYPE_3D, flags must not contain VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00972)~^~ -VALIDATION_ERROR_09e0079a~^~Y~^~SparseResidencyImageCreateUnsupportedSamples~^~vkCreateImage~^~VUID-VkImageCreateInfo-imageType-00973~^~core~^~The spec valid usage text states 'If the sparse residency for images with 2 samples feature is not enabled, imageType is VK_IMAGE_TYPE_2D, and samples is VK_SAMPLE_COUNT_2_BIT, flags must not contain VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00973)~^~ -VALIDATION_ERROR_09e0079c~^~Y~^~SparseResidencyImageCreateUnsupportedSamples~^~vkCreateImage~^~VUID-VkImageCreateInfo-imageType-00974~^~core~^~The spec valid usage text states 'If the sparse residency for images with 4 samples feature is not enabled, imageType is VK_IMAGE_TYPE_2D, and samples is VK_SAMPLE_COUNT_4_BIT, flags must not contain VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00974)~^~ -VALIDATION_ERROR_09e0079e~^~Y~^~SparseResidencyImageCreateUnsupportedSamples~^~vkCreateImage~^~VUID-VkImageCreateInfo-imageType-00975~^~core~^~The spec valid usage text states 'If the sparse residency for images with 8 samples feature is not enabled, imageType is VK_IMAGE_TYPE_2D, and samples is VK_SAMPLE_COUNT_8_BIT, flags must not contain VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00975)~^~ -VALIDATION_ERROR_09e007a0~^~Y~^~SparseResidencyImageCreateUnsupportedSamples~^~vkCreateImage~^~VUID-VkImageCreateInfo-imageType-00976~^~core~^~The spec valid usage text states 'If the sparse residency for images with 16 samples feature is not enabled, imageType is VK_IMAGE_TYPE_2D, and samples is VK_SAMPLE_COUNT_16_BIT, flags must not contain VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00976)~^~ -VALIDATION_ERROR_09e007a2~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-tiling-00977~^~core~^~The spec valid usage text states 'If tiling is VK_IMAGE_TILING_LINEAR, format must be a format that has at least one supported feature bit present in the value of VkFormatProperties::linearTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00977)~^~ -VALIDATION_ERROR_09e007a4~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-tiling-00978~^~core~^~The spec valid usage text states 'If tiling is VK_IMAGE_TILING_LINEAR, and VkFormatProperties::linearTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT, usage must not contain VK_IMAGE_USAGE_SAMPLED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00978)~^~ -VALIDATION_ERROR_09e007a6~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-tiling-00979~^~core~^~The spec valid usage text states 'If tiling is VK_IMAGE_TILING_LINEAR, and VkFormatProperties::linearTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT, usage must not contain VK_IMAGE_USAGE_STORAGE_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00979)~^~ -VALIDATION_ERROR_09e007a8~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-tiling-00980~^~core~^~The spec valid usage text states 'If tiling is VK_IMAGE_TILING_LINEAR, and VkFormatProperties::linearTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT, usage must not contain VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00980)~^~ -VALIDATION_ERROR_09e007aa~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-tiling-00981~^~core~^~The spec valid usage text states 'If tiling is VK_IMAGE_TILING_LINEAR, and VkFormatProperties::linearTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, usage must not contain VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00981)~^~ -VALIDATION_ERROR_09e007ac~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-tiling-00982~^~core~^~The spec valid usage text states 'If tiling is VK_IMAGE_TILING_OPTIMAL, format must be a format that has at least one supported feature bit present in the value of VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00982)~^~ -VALIDATION_ERROR_09e007ae~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-tiling-00983~^~core~^~The spec valid usage text states 'If tiling is VK_IMAGE_TILING_OPTIMAL, and VkFormatProperties::optimalTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT, usage must not contain VK_IMAGE_USAGE_SAMPLED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00983)~^~ -VALIDATION_ERROR_09e007b0~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-tiling-00984~^~core~^~The spec valid usage text states 'If tiling is VK_IMAGE_TILING_OPTIMAL, and VkFormatProperties::optimalTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT, usage must not contain VK_IMAGE_USAGE_STORAGE_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00984)~^~ -VALIDATION_ERROR_09e007b2~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-tiling-00985~^~core~^~The spec valid usage text states 'If tiling is VK_IMAGE_TILING_OPTIMAL, and VkFormatProperties::optimalTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT, usage must not contain VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00985)~^~ -VALIDATION_ERROR_09e007b4~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-tiling-00986~^~core~^~The spec valid usage text states 'If tiling is VK_IMAGE_TILING_OPTIMAL, and VkFormatProperties::optimalTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, usage must not contain VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00986)~^~ -VALIDATION_ERROR_09e007b6~^~Y~^~SparseBindingImageBufferCreate~^~vkCreateImage~^~VUID-VkImageCreateInfo-flags-00987~^~core~^~The spec valid usage text states 'If flags contains VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT or VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, it must also contain VK_IMAGE_CREATE_SPARSE_BINDING_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-flags-00987)~^~ -VALIDATION_ERROR_09e007b8~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-pNext-00988~^~(VK_NV_external_memory+VK_KHR_external_memory)~^~The spec valid usage text states 'If the pNext chain contains an instance of VkExternalMemoryImageCreateInfoNV, it must not contain an instance of VkExternalMemoryImageCreateInfoKHR.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-pNext-00988)~^~ -VALIDATION_ERROR_09e007ba~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-pNext-00989~^~core~^~The spec valid usage text states 'If the pNext chain contains an instance of VkExternalMemoryImageCreateInfoKHR, and any of the handle types specified in VkExternalMemoryImageCreateInfoKHR::handleTypes require a dedicated allocation, as reported by vkGetPhysicalDeviceImageFormatProperties2KHR in VkExternalImageFormatPropertiesKHR::externalMemoryProperties::externalMemoryFeatures, the pNext chain must contain an instance of VkDedicatedAllocationImageCreateInfoNV with its dedicatedAllocation field set to VK_TRUE.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-pNext-00989)~^~ -VALIDATION_ERROR_09e007bc~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-pNext-00990~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If the pNext chain contains an instance of VkExternalMemoryImageCreateInfoKHR, its handleTypes member must only contain bits that are also in VkExternalImageFormatPropertiesKHR::externalMemoryProperties::compatibleHandleTypes, as returned by vkGetPhysicalDeviceImageFormatProperties2KHR with format, imageType, tiling, usage, and flags equal to those in this structure, and with an instance of VkPhysicalDeviceExternalImageFormatInfoKHR in the pNext chain, with a handleType equal to any one of the handle types specified in VkExternalMemoryImageCreateInfoKHR::handleTypes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-pNext-00990)~^~ -VALIDATION_ERROR_09e007be~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-pNext-00991~^~(VK_NV_external_memory+VK_NV_external_memory_capabilities)~^~The spec valid usage text states 'If the pNext chain contains an instance of VkExternalMemoryImageCreateInfoNV, its handleTypes member must only contain bits that are also in VkExternalImageFormatPropertiesNV::externalMemoryProperties::compatibleHandleTypes, as returned by vkGetPhysicalDeviceExternalImageFormatPropertiesNV with format, imageType, tiling, usage, and flags equal to those in this structure, and with externalHandleType equal to any one of the handle types specified in VkExternalMemoryImageCreateInfoNV::handleTypes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-pNext-00991)~^~ -VALIDATION_ERROR_09e007c0~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-flags-00992~^~(VK_KHX_device_group)~^~The spec valid usage text states 'If flags contains VK_IMAGE_CREATE_BIND_SFR_BIT_KHX, then mipLevels must be one, arrayLayers must be one, imageType must be VK_IMAGE_TYPE_2D, and tiling must be VK_IMAGE_TILING_OPTIMAL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-flags-00992)~^~ -VALIDATION_ERROR_09e007c2~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-initialLayout-00993~^~core~^~The spec valid usage text states 'initialLayout must be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-initialLayout-00993)~^~ -VALIDATION_ERROR_09e00ae0~^~N~^~None~^~VkImageCreateInfo~^~VUID-VkImageCreateInfo-sharingMode-01392~^~!(VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'If sharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the physicalDevice that was used to create device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-sharingMode-01392)~^~ -VALIDATION_ERROR_09e00b18~^~N~^~None~^~VkImageCreateInfo~^~VUID-VkImageCreateInfo-sharingMode-01420~^~(VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'If sharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by either vkGetPhysicalDeviceQueueFamilyProperties or vkGetPhysicalDeviceQueueFamilyProperties2KHR for the physicalDevice that was used to create device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-sharingMode-01420)~^~ -VALIDATION_ERROR_09e00b1a~^~N~^~None~^~VkImageCreateInfo~^~VUID-VkImageCreateInfo-physicalDeviceCount-01421~^~(VK_KHX_device_group)~^~The spec valid usage text states 'If the logical device was created with VkDeviceGroupDeviceCreateInfoKHX::physicalDeviceCount equal to 1, flags must not contain VK_IMAGE_CREATE_BIND_SFR_BIT_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-physicalDeviceCount-01421)~^~ -VALIDATION_ERROR_09e00b46~^~N~^~None~^~VkImageCreateInfo~^~VUID-VkImageCreateInfo-pNext-01443~^~(VK_KHR_external_memory,VK_NV_external_memory)~^~The spec valid usage text states 'If the pNext chain includes a' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-pNext-01443)~^~ -VALIDATION_ERROR_09e00bfa~^~N~^~None~^~VkImageCreateInfo~^~VUID-VkImageCreateInfo-flags-01533~^~(VK_KHR_external_memory,VK_NV_external_memory)+(VK_KHR_external_memory[VkExternalMemoryImageCreateInfoKHRVkExternalMemoryImageCreateInfoKHRVkExternalMemoryImageCreateInfoKHRVkExternalMemoryImageCreateInfoKHRVkExternalMemoryImageCreateInfoKHRVkMemoryDedicatedAllocateInfoKHRVkMemoryDedicatedAllocateInfoKHRVkMemoryDedicatedAllocateInfoKHRVkMemoryDedicatedAllocateInfoKHRVkMemoryDedicatedAllocateInfoKHRVkMemoryDedicatedAllocateInfoKHRVkMemoryDedicatedAllocateInfoKHRVkMemoryDedicatedAllocateInfoKHRVkMemoryDedicatedAllocateInfoKHRallocationSize must be less than or equal to VkPhysicalDeviceMemoryProperties::memoryHeaps[pAllocateInfo->memoryTypeIndex].size as returned by vkGetPhysicalDeviceMemoryProperties for the VkPhysicalDevice that device was created from.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateMemory-pAllocateInfo-01713)~^~ -VALIDATION_ERROR_16c00d64~^~N~^~None~^~vkAllocateMemory~^~VUID-vkAllocateMemory-pAllocateInfo-01714~^~core~^~The spec valid usage text states 'pAllocateInfo->memoryTypeIndex must be less than VkPhysicalDeviceMemoryProperties::memoryTypeCount as returned by vkGetPhysicalDeviceMemoryProperties for the VkPhysicalDevice that device was created from.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateMemory-pAllocateInfo-01714)~^~ +VALIDATION_ERROR_16c00d62~^~N~^~None~^~vkAllocateMemory~^~VUID-vkAllocateMemory-pAllocateInfo-01713~^~core~^~The spec valid usage text states 'pAllocateInfo-&gt;allocationSize must be less than or equal to VkPhysicalDeviceMemoryProperties::memoryHeaps[pAllocateInfo-&gt;memoryTypeIndex].size as returned by vkGetPhysicalDeviceMemoryProperties for the VkPhysicalDevice that device was created from.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateMemory-pAllocateInfo-01713)~^~ +VALIDATION_ERROR_16c00d64~^~N~^~None~^~vkAllocateMemory~^~VUID-vkAllocateMemory-pAllocateInfo-01714~^~core~^~The spec valid usage text states 'pAllocateInfo-&gt;memoryTypeIndex must be less than VkPhysicalDeviceMemoryProperties::memoryTypeCount as returned by vkGetPhysicalDeviceMemoryProperties for the VkPhysicalDevice that device was created from.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateMemory-pAllocateInfo-01714)~^~ VALIDATION_ERROR_16c05601~^~Y~^~None~^~vkAllocateMemory~^~VUID-vkAllocateMemory-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateMemory-device-parameter)~^~implicit VALIDATION_ERROR_16c0ea01~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-vkAllocateMemory-pAllocateInfo-parameter~^~core~^~The spec valid usage text states 'pAllocateInfo must be a valid pointer to a valid VkMemoryAllocateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateMemory-pAllocateInfo-parameter)~^~implicit VALIDATION_ERROR_16c0ec01~^~N~^~Unknown~^~vkAllocateMemory~^~VUID-vkAllocateMemory-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateMemory-pAllocator-parameter)~^~implicit @@ -1629,17 +1635,19 @@ VALIDATION_ERROR_17000818~^~Y~^~BindInvalidMemory~^~vkBindBufferMemory~^~VUID-vkBindBufferMemory-memoryOffset-01036~^~core~^~The spec valid usage text states 'memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory-memoryOffset-01036)~^~ VALIDATION_ERROR_1700081a~^~Y~^~BindInvalidMemory~^~vkBindBufferMemory~^~VUID-vkBindBufferMemory-size-01037~^~core~^~The spec valid usage text states 'The size member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer must be less than or equal to the size of memory minus memoryOffset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory-size-01037)~^~ VALIDATION_ERROR_1700081c~^~N~^~Unknown~^~vkBindBufferMemory~^~VUID-vkBindBufferMemory-buffer-01038~^~(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'If buffer was created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must have been created with VkDedicatedAllocationMemoryAllocateInfoNV::buffer equal to a buffer handle created with identical creation parameters to buffer and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory-buffer-01038)~^~ -VALIDATION_ERROR_1700081e~^~N~^~Unknown~^~vkBindBufferMemory~^~VUID-vkBindBufferMemory-buffer-01039~^~(VK_NV_dedicated_allocation)+!(VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If buffer was not created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must not have been allocated dedicated for a specific buffer or image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory-buffer-01039)~^~ -VALIDATION_ERROR_17000b48~^~N~^~None~^~vkBindBufferMemory~^~VUID-vkBindBufferMemory-buffer-01444~^~(VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If buffer requires a dedicated allocation(as reported by vkGetBufferMemoryRequirements2KHR in VkMemoryDedicatedRequirementsKHR::requiresDedicatedAllocation for image), memory must have been created with VkMemoryDedicatedAllocateInfoKHR::buffer equal to buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory-buffer-01444)~^~ -VALIDATION_ERROR_17000bc8~^~N~^~None~^~vkBindBufferMemory~^~VUID-vkBindBufferMemory-memory-01508~^~(VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If the VkmemoryAllocateInfo provided when memory was allocated included an instance of VkMemoryDedicatedAllocateInfo in its pNext chain, and VkMemoryDedicatedAllocateInfo::buffer was not VK_NULL_HANDLE, then buffer must equal VkMemoryDedicatedAllocateInfo::buffer and memoryOffset must be zero.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory-memory-01508)~^~ +VALIDATION_ERROR_1700081e~^~N~^~Unknown~^~vkBindBufferMemory~^~VUID-vkBindBufferMemory-buffer-01039~^~(VK_NV_dedicated_allocation)+!(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If buffer was not created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must not have been allocated dedicated for a specific buffer or image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory-buffer-01039)~^~ +VALIDATION_ERROR_17000b48~^~N~^~None~^~vkBindBufferMemory~^~VUID-vkBindBufferMemory-buffer-01444~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If buffer requires a dedicated allocation(as reported by vkGetBufferMemoryRequirements2 in VkMemoryDedicatedRequirements::requiresDedicatedAllocation for buffer), memory must have been created with VkMemoryDedicatedAllocateInfo::buffer equal to buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory-buffer-01444)~^~ +VALIDATION_ERROR_17000bc8~^~Y~^~DedicatedAllocation~^~vkBindBufferMemory~^~VUID-vkBindBufferMemory-memory-01508~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If the VkMemoryAllocateInfo provided when memory was allocated included an instance of VkMemoryDedicatedAllocateInfo in its pNext chain, and VkMemoryDedicatedAllocateInfo::buffer was not VK_NULL_HANDLE, then buffer must equal VkMemoryDedicatedAllocateInfo::buffer, and memoryOffset must be zero.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory-memory-01508)~^~ +VALIDATION_ERROR_17000ed4~^~N~^~None~^~vkBindBufferMemory~^~VUID-vkBindBufferMemory-None-01898~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If buffer was created with the VK_BUFFER_CREATE_PROTECTED_BIT bit set, the buffer must be bound to a memory object allocated with a memory type that reports VK_MEMORY_PROPERTY_PROTECTED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory-None-01898)~^~ +VALIDATION_ERROR_17000ed6~^~N~^~None~^~vkBindBufferMemory~^~VUID-vkBindBufferMemory-None-01899~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If buffer was created with the VK_BUFFER_CREATE_PROTECTED_BIT bit not set, the buffer must not be bound to a memory object created with a memory type that reports VK_MEMORY_PROPERTY_PROTECTED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory-None-01899)~^~ VALIDATION_ERROR_17001a01~^~Y~^~VertexBufferInvalid~^~vkBindBufferMemory~^~VUID-vkBindBufferMemory-buffer-parameter~^~core~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory-buffer-parameter)~^~implicit VALIDATION_ERROR_17001a07~^~Y~^~Unknown~^~vkBindBufferMemory~^~VUID-vkBindBufferMemory-buffer-parent~^~core~^~The spec valid usage text states 'buffer must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory-buffer-parent)~^~implicit VALIDATION_ERROR_17005601~^~Y~^~None~^~vkBindBufferMemory~^~VUID-vkBindBufferMemory-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory-device-parameter)~^~implicit VALIDATION_ERROR_1700c601~^~Y~^~BindInvalidMemory~^~vkBindBufferMemory~^~VUID-vkBindBufferMemory-memory-parameter~^~core~^~The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory-memory-parameter)~^~implicit VALIDATION_ERROR_1700c607~^~Y~^~Unknown~^~vkBindBufferMemory~^~VUID-vkBindBufferMemory-memory-parent~^~core~^~The spec valid usage text states 'memory must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory-memory-parent)~^~implicit -VALIDATION_ERROR_1720161b~^~N~^~None~^~vkBindBufferMemory2KHR~^~VUID-vkBindBufferMemory2KHR-bindInfoCount-arraylength~^~core~^~The spec valid usage text states 'bindInfoCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory2KHR-bindInfoCount-arraylength)~^~implicit -VALIDATION_ERROR_17205601~^~Y~^~None~^~vkBindBufferMemory2KHR~^~VUID-vkBindBufferMemory2KHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory2KHR-device-parameter)~^~implicit -VALIDATION_ERROR_1720fa01~^~Y~^~None~^~vkBindBufferMemory2KHR~^~VUID-vkBindBufferMemory2KHR-pBindInfos-parameter~^~core~^~The spec valid usage text states 'pBindInfos must be a valid pointer to an array of bindInfoCount valid VkBindBufferMemoryInfoKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory2KHR-pBindInfos-parameter)~^~implicit +VALIDATION_ERROR_1720161b~^~N~^~None~^~vkBindBufferMemory2~^~VUID-vkBindBufferMemory2-bindInfoCount-arraylength~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'bindInfoCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory2-bindInfoCount-arraylength)~^~implicit +VALIDATION_ERROR_17205601~^~Y~^~None~^~vkBindBufferMemory2~^~VUID-vkBindBufferMemory2-device-parameter~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory2-device-parameter)~^~implicit +VALIDATION_ERROR_1720fa01~^~Y~^~None~^~vkBindBufferMemory2~^~VUID-vkBindBufferMemory2-pBindInfos-parameter~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'pBindInfos must be a valid pointer to an array of bindInfoCount valid VkBindBufferMemoryInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory2-pBindInfos-parameter)~^~implicit VALIDATION_ERROR_17400828~^~Y~^~BindInvalidMemory~^~vkBindImageMemory~^~VUID-vkBindImageMemory-image-01044~^~core~^~The spec valid usage text states 'image must not already be backed by a memory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-image-01044)~^~ VALIDATION_ERROR_1740082a~^~Y~^~BindInvalidMemory~^~vkBindImageMemory~^~VUID-vkBindImageMemory-image-01045~^~core~^~The spec valid usage text states 'image must not have been created with any sparse memory binding flags' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-image-01045)~^~ VALIDATION_ERROR_1740082c~^~Y~^~BindInvalidMemory~^~vkBindImageMemory~^~VUID-vkBindImageMemory-memoryOffset-01046~^~core~^~The spec valid usage text states 'memoryOffset must be less than the size of memory' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-memoryOffset-01046)~^~ @@ -1647,46 +1655,47 @@ VALIDATION_ERROR_17400830~^~Y~^~BindInvalidMemory~^~vkBindImageMemory~^~VUID-vkBindImageMemory-memoryOffset-01048~^~core~^~The spec valid usage text states 'memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-memoryOffset-01048)~^~ VALIDATION_ERROR_17400832~^~Y~^~BindInvalidMemory~^~vkBindImageMemory~^~VUID-vkBindImageMemory-size-01049~^~core~^~The spec valid usage text states 'The size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image must be less than or equal to the size of memory minus memoryOffset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-size-01049)~^~ VALIDATION_ERROR_17400834~^~N~^~Unknown~^~vkBindImageMemory~^~VUID-vkBindImageMemory-image-01050~^~(VK_NV_dedicated_allocation)~^~The spec valid usage text states 'If image was created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must have been created with VkDedicatedAllocationMemoryAllocateInfoNV::image equal to an image handle created with identical creation parameters to image and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory-image-01050)~^~ -VALIDATION_ERROR_17400836~^~N~^~Unknown~^~vkBindImageMemory~^~VUID-vkBindImageMemory-image-01051~^~(VK_NV_dedicated_allocation)+!(VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If image was not created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must not have been allocated dedicated for a specific buffer or image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-image-01051)~^~ -VALIDATION_ERROR_17400b4a~^~N~^~None~^~vkBindImageMemory~^~VUID-vkBindImageMemory-image-01445~^~(VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If image requires a dedicated allocation (as reported by vkGetImageMemoryRequirements2KHR in VkMemoryDedicatedRequirementsKHR::requiresDedicatedAllocation for image), memory must have been created with VkMemoryDedicatedAllocateInfoKHR::image equal to image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory-image-01445)~^~ -VALIDATION_ERROR_17400bca~^~N~^~None~^~vkBindImageMemory~^~VUID-vkBindImageMemory-memory-01509~^~(VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If the VkmemoryAllocateInfo provided when memory was allocated included an instance of VkMemoryDedicatedAllocateInfo in its pNext chain, and VkMemoryDedicatedAllocateInfo::image was not VK_NULL_HANDLE, then image must equal VkMemoryDedicatedAllocateInfo::image and memoryOffset must be zero.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory-memory-01509)~^~ -VALIDATION_ERROR_17400c90~^~N~^~None~^~vkBindImageMemory~^~VUID-vkBindImageMemory-image-01608~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'image must not have been created with the VK_IMAGE_CREATE_DISJOINT_BIT_KHR set.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory-image-01608)~^~ +VALIDATION_ERROR_17400836~^~N~^~Unknown~^~vkBindImageMemory~^~VUID-vkBindImageMemory-image-01051~^~(VK_NV_dedicated_allocation)+!(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If image was not created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must not have been allocated dedicated for a specific buffer or image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-image-01051)~^~ +VALIDATION_ERROR_17400b4a~^~N~^~None~^~vkBindImageMemory~^~VUID-vkBindImageMemory-image-01445~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If image requires a dedicated allocation (as reported by vkGetImageMemoryRequirements2 in VkMemoryDedicatedRequirements::requiresDedicatedAllocation for image), memory must have been created with VkMemoryDedicatedAllocateInfo::image equal to image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory-image-01445)~^~ +VALIDATION_ERROR_17400bca~^~Y~^~DedicatedAllocation~^~vkBindImageMemory~^~VUID-vkBindImageMemory-memory-01509~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If the VkMemoryAllocateInfo provided when memory was allocated included an instance of VkMemoryDedicatedAllocateInfo in its pNext chain, and VkMemoryDedicatedAllocateInfo::image was not VK_NULL_HANDLE, then image must equal VkMemoryDedicatedAllocateInfo::image and memoryOffset must be zero.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory-memory-01509)~^~ +VALIDATION_ERROR_17400c90~^~N~^~None~^~vkBindImageMemory~^~VUID-vkBindImageMemory-image-01608~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'image must not have been created with the VK_IMAGE_CREATE_DISJOINT_BIT set.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory-image-01608)~^~ +VALIDATION_ERROR_17400eda~^~N~^~None~^~vkBindImageMemory~^~VUID-vkBindImageMemory-None-01901~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If image was created with the VK_IMAGE_CREATE_PROTECTED_BIT bit set, the image must be bound to a memory object allocated with a memory type that reports VK_MEMORY_PROPERTY_PROTECTED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory-None-01901)~^~ +VALIDATION_ERROR_17400edc~^~N~^~None~^~vkBindImageMemory~^~VUID-vkBindImageMemory-None-01902~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If image was created with the VK_IMAGE_CREATE_PROTECTED_BIT bit not set, the image must not be bound to a memory object created with a memory type that reports VK_MEMORY_PROPERTY_PROTECTED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory-None-01902)~^~ VALIDATION_ERROR_17405601~^~Y~^~None~^~vkBindImageMemory~^~VUID-vkBindImageMemory-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-device-parameter)~^~implicit VALIDATION_ERROR_1740a001~^~Y~^~BindMemoryToDestroyedObject~^~vkBindImageMemory~^~VUID-vkBindImageMemory-image-parameter~^~core~^~The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-image-parameter)~^~implicit VALIDATION_ERROR_1740a007~^~Y~^~Unknown~^~vkBindImageMemory~^~VUID-vkBindImageMemory-image-parent~^~core~^~The spec valid usage text states 'image must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-image-parent)~^~implicit VALIDATION_ERROR_1740c601~^~Y~^~BindInvalidMemory~^~vkBindImageMemory~^~VUID-vkBindImageMemory-memory-parameter~^~core~^~The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-memory-parameter)~^~implicit VALIDATION_ERROR_1740c607~^~Y~^~Unknown~^~vkBindImageMemory~^~VUID-vkBindImageMemory-memory-parent~^~core~^~The spec valid usage text states 'memory must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-memory-parent)~^~implicit -VALIDATION_ERROR_1760161b~^~N~^~None~^~vkBindImageMemory2KHR~^~VUID-vkBindImageMemory2KHR-bindInfoCount-arraylength~^~core~^~The spec valid usage text states 'bindInfoCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory2KHR-bindInfoCount-arraylength)~^~implicit -VALIDATION_ERROR_17605601~^~Y~^~None~^~vkBindImageMemory2KHR~^~VUID-vkBindImageMemory2KHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory2KHR-device-parameter)~^~implicit -VALIDATION_ERROR_1760fa01~^~Y~^~None~^~vkBindImageMemory2KHR~^~VUID-vkBindImageMemory2KHR-pBindInfos-parameter~^~core~^~The spec valid usage text states 'pBindInfos must be a valid pointer to an array of bindInfoCount valid VkBindImageMemoryInfoKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory2KHR-pBindInfos-parameter)~^~implicit +VALIDATION_ERROR_1760161b~^~N~^~None~^~vkBindImageMemory2~^~VUID-vkBindImageMemory2-bindInfoCount-arraylength~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'bindInfoCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory2-bindInfoCount-arraylength)~^~implicit +VALIDATION_ERROR_17605601~^~Y~^~None~^~vkBindImageMemory2~^~VUID-vkBindImageMemory2-device-parameter~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory2-device-parameter)~^~implicit +VALIDATION_ERROR_1760fa01~^~Y~^~None~^~vkBindImageMemory2~^~VUID-vkBindImageMemory2-pBindInfos-parameter~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)~^~The spec valid usage text states 'pBindInfos must be a valid pointer to an array of bindInfoCount valid VkBindImageMemoryInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory2-pBindInfos-parameter)~^~implicit VALIDATION_ERROR_17800009~^~Y~^~Unknown~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-commonparent~^~core~^~The spec valid usage text states 'Both of commandBuffer, and queryPool must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-commonparent)~^~implicit -VALIDATION_ERROR_1780063c~^~N~^~Unknown~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-queryPool-00798~^~core~^~The spec valid usage text states 'The query identified by queryPool and query must currently not be active' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-queryPool-00798)~^~ -VALIDATION_ERROR_1780063e~^~N~^~Unknown~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-queryPool-00799~^~core~^~The spec valid usage text states 'The query identified by queryPool and query must be unavailable' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-queryPool-00799)~^~ VALIDATION_ERROR_17800640~^~N~^~Unknown~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-queryType-00800~^~core~^~The spec valid usage text states 'If the precise occlusion queries feature is not enabled, or the queryType used to create queryPool was not VK_QUERY_TYPE_OCCLUSION, flags must not contain VK_QUERY_CONTROL_PRECISE_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-queryType-00800)~^~ -VALIDATION_ERROR_17800642~^~N~^~Unknown~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-queryPool-00801~^~core~^~The spec valid usage text states 'queryPool must have been created with a queryType that differs from that of any other queries that have been made active, and are currently still active within commandBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-queryPool-00801)~^~ VALIDATION_ERROR_17800644~^~N~^~Unknown~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-query-00802~^~core~^~The spec valid usage text states 'query must be less than the number of queries in queryPool' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-query-00802)~^~ VALIDATION_ERROR_17800646~^~N~^~Unknown~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-queryType-00803~^~core~^~The spec valid usage text states 'If the queryType used to create queryPool was VK_QUERY_TYPE_OCCLUSION, the VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-queryType-00803)~^~ VALIDATION_ERROR_17800648~^~N~^~Unknown~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-queryType-00804~^~core~^~The spec valid usage text states 'If the queryType used to create queryPool was VK_QUERY_TYPE_PIPELINE_STATISTICS and any of the pipelineStatistics indicate graphics operations, the VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-queryType-00804)~^~ VALIDATION_ERROR_1780064a~^~N~^~Unknown~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-queryType-00805~^~core~^~The spec valid usage text states 'If the queryType used to create queryPool was VK_QUERY_TYPE_PIPELINE_STATISTICS and any of the pipelineStatistics indicate compute operations, the VkCommandPool that commandBuffer was allocated from must support compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-queryType-00805)~^~ -VALIDATION_ERROR_1780064c~^~N~^~Unknown~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-None-00806~^~(VK_KHX_multiview)~^~The spec valid usage text states 'All queries used by the command must not be active' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginQuery-None-00806)~^~ -VALIDATION_ERROR_1780064e~^~N~^~Unknown~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-None-00807~^~(VK_KHX_multiview)~^~The spec valid usage text states 'All queries used by the command must be unavailable' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginQuery-None-00807)~^~ -VALIDATION_ERROR_17800650~^~N~^~Unknown~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-query-00808~^~(VK_KHX_multiview)~^~The spec valid usage text states 'If vkCmdBeginQuery is called within a render pass instance, the sum of query and the number of bits set in the current subpass's view mask must be less than or equal to the number of queries in queryPool' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginQuery-query-00808)~^~ +VALIDATION_ERROR_1780064e~^~N~^~Unknown~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-None-00807~^~core~^~The spec valid usage text states 'All queries used by the command must be unavailable' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-None-00807)~^~ +VALIDATION_ERROR_17800650~^~N~^~Unknown~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-query-00808~^~(VK_VERSION_1_1,VK_KHR_multiview)~^~The spec valid usage text states 'If vkCmdBeginQuery is called within a render pass instance, the sum of query and the number of bits set in the current subpass's view mask must be less than or equal to the number of queries in queryPool' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginQuery-query-00808)~^~ +VALIDATION_ERROR_17800eba~^~N~^~None~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-commandBuffer-01885~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'commandBuffer must not be a protected command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginQuery-commandBuffer-01885)~^~ +VALIDATION_ERROR_17800f04~^~N~^~None~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-queryPool-01922~^~core~^~The spec valid usage text states 'queryPool must have been created with a queryType that differs from that of any queries that are active within commandBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-queryPool-01922)~^~ VALIDATION_ERROR_17802401~^~Y~^~None~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_17802413~^~N~^~Unknown~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_17802413~^~Y~^~None~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-commandBuffer-recording)~^~implicit VALIDATION_ERROR_17802415~^~Y~^~Unknown~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_17809001~^~Y~^~Unknown~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkQueryControlFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-flags-parameter)~^~implicit, TBD in parameter validation layer. VALIDATION_ERROR_17829801~^~Y~^~None~^~vkCmdBeginQuery~^~VUID-vkCmdBeginQuery-queryPool-parameter~^~core~^~The spec valid usage text states 'queryPool must be a valid VkQueryPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-queryPool-parameter)~^~implicit VALIDATION_ERROR_17a00017~^~Y~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-vkCmdBeginRenderPass-renderpass~^~core~^~The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-renderpass)~^~implicit VALIDATION_ERROR_17a00019~^~Y~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-vkCmdBeginRenderPass-bufferlevel~^~core~^~The spec valid usage text states 'commandBuffer must be a primary VkCommandBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-bufferlevel)~^~implicit VALIDATION_ERROR_17a006fe~^~N~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-vkCmdBeginRenderPass-initialLayout-00895~^~core~^~The spec valid usage text states 'If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL then the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-initialLayout-00895)~^~ -VALIDATION_ERROR_17a00700~^~N~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-vkCmdBeginRenderPass-initialLayout-00896~^~core~^~The spec valid usage text states 'If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-initialLayout-00896)~^~ +VALIDATION_ERROR_17a00700~^~N~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-vkCmdBeginRenderPass-initialLayout-00896~^~!(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, or VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL then the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-initialLayout-00896)~^~ VALIDATION_ERROR_17a00702~^~N~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-vkCmdBeginRenderPass-initialLayout-00897~^~core~^~The spec valid usage text states 'If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL then the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with VK_IMAGE_USAGE_SAMPLED_BIT or VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-initialLayout-00897)~^~ VALIDATION_ERROR_17a00704~^~N~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-vkCmdBeginRenderPass-initialLayout-00898~^~core~^~The spec valid usage text states 'If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL then the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-initialLayout-00898)~^~ VALIDATION_ERROR_17a00706~^~N~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-vkCmdBeginRenderPass-initialLayout-00899~^~core~^~The spec valid usage text states 'If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL then the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-initialLayout-00899)~^~ VALIDATION_ERROR_17a00708~^~N~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-vkCmdBeginRenderPass-initialLayout-00900~^~core~^~The spec valid usage text states 'If any of the initialLayout members of the VkAttachmentDescription structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is not VK_IMAGE_LAYOUT_UNDEFINED, then each such initialLayout must be equal to the current layout of the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-initialLayout-00900)~^~ -VALIDATION_ERROR_17a0070a~^~N~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-vkCmdBeginRenderPass-srcStageMask-00901~^~core~^~The spec valid usage text states 'The srcStageMask and dstStageMask members of any element of the pDependencies member of VkRenderPassCreateInfo used to create renderpass must be supported by the capabilities of the queue family identified by the queueFamilyIndex member of the VkCommandPoolCreateInfo used to create the command pool which commandBuffer was allocated from.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-srcStageMask-00901)~^~ +VALIDATION_ERROR_17a0070a~^~N~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-vkCmdBeginRenderPass-srcStageMask-00901~^~core~^~The spec valid usage text states 'The srcStageMask and dstStageMask members of any element of the pDependencies member of VkRenderPassCreateInfo used to create renderPass must be supported by the capabilities of the queue family identified by the queueFamilyIndex member of the VkCommandPoolCreateInfo used to create the command pool which commandBuffer was allocated from.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-srcStageMask-00901)~^~ +VALIDATION_ERROR_17a00dbc~^~N~^~None~^~vkCmdBeginRenderPass~^~VUID-vkCmdBeginRenderPass-initialLayout-01758~^~(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, or VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL then the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginRenderPass-initialLayout-01758)~^~ VALIDATION_ERROR_17a02401~^~Y~^~None~^~vkCmdBeginRenderPass~^~VUID-vkCmdBeginRenderPass-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_17a02413~^~N~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-vkCmdBeginRenderPass-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_17a02413~^~Y~^~None~^~vkCmdBeginRenderPass~^~VUID-vkCmdBeginRenderPass-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-commandBuffer-recording)~^~implicit VALIDATION_ERROR_17a02415~^~Y~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-vkCmdBeginRenderPass-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_17a03201~^~Y~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-vkCmdBeginRenderPass-contents-parameter~^~core~^~The spec valid usage text states 'contents must be a valid VkSubpassContents value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-contents-parameter)~^~implicit VALIDATION_ERROR_17a21801~^~N~^~Unknown~^~vkCmdBeginRenderPass~^~VUID-vkCmdBeginRenderPass-pRenderPassBegin-parameter~^~core~^~The spec valid usage text states 'pRenderPassBegin must be a valid pointer to a valid VkRenderPassBeginInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-pRenderPassBegin-parameter)~^~implicit @@ -1697,7 +1706,7 @@ VALIDATION_ERROR_17c002d2~^~N~^~Unknown~^~vkCmdBindDescriptorSets~^~VUID-vkCmdBindDescriptorSets-pipelineBindPoint-00361~^~core~^~The spec valid usage text states 'pipelineBindPoint must be supported by the commandBuffer's parent VkCommandPool's queue family' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindDescriptorSets-pipelineBindPoint-00361)~^~ VALIDATION_ERROR_17c002d4~^~Y~^~Unknown~^~vkCmdBindDescriptorSets~^~VUID-vkCmdBindDescriptorSets-pDynamicOffsets-00362~^~core~^~The spec valid usage text states 'Each element of pDynamicOffsets must satisfy the required alignment for the corresponding descriptor binding's descriptor type' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindDescriptorSets-pDynamicOffsets-00362)~^~ VALIDATION_ERROR_17c02401~^~Y~^~None~^~vkCmdBindDescriptorSets~^~VUID-vkCmdBindDescriptorSets-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindDescriptorSets-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_17c02413~^~N~^~Unknown~^~vkCmdBindDescriptorSets~^~VUID-vkCmdBindDescriptorSets-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindDescriptorSets-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_17c02413~^~Y~^~None~^~vkCmdBindDescriptorSets~^~VUID-vkCmdBindDescriptorSets-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindDescriptorSets-commandBuffer-recording)~^~implicit VALIDATION_ERROR_17c02415~^~Y~^~Unknown~^~vkCmdBindDescriptorSets~^~VUID-vkCmdBindDescriptorSets-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindDescriptorSets-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_17c04a1b~^~N~^~Unknown~^~vkCmdBindDescriptorSets~^~VUID-vkCmdBindDescriptorSets-descriptorSetCount-arraylength~^~core~^~The spec valid usage text states 'descriptorSetCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindDescriptorSets-descriptorSetCount-arraylength)~^~implicit VALIDATION_ERROR_17c0be01~^~Y~^~DescriptorSetCompatibility~^~vkCmdBindDescriptorSets~^~VUID-vkCmdBindDescriptorSets-layout-parameter~^~core~^~The spec valid usage text states 'layout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindDescriptorSets-layout-parameter)~^~implicit @@ -1711,7 +1720,7 @@ VALIDATION_ERROR_17e00364~^~Y~^~Unknown~^~vkCmdBindIndexBuffer~^~VUID-vkCmdBindIndexBuffer-buffer-00434~^~core~^~The spec valid usage text states 'If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindIndexBuffer-buffer-00434)~^~ VALIDATION_ERROR_17e01a01~^~Y~^~None~^~vkCmdBindIndexBuffer~^~VUID-vkCmdBindIndexBuffer-buffer-parameter~^~core~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindIndexBuffer-buffer-parameter)~^~implicit VALIDATION_ERROR_17e02401~^~Y~^~None~^~vkCmdBindIndexBuffer~^~VUID-vkCmdBindIndexBuffer-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindIndexBuffer-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_17e02413~^~N~^~Unknown~^~vkCmdBindIndexBuffer~^~VUID-vkCmdBindIndexBuffer-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindIndexBuffer-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_17e02413~^~Y~^~None~^~vkCmdBindIndexBuffer~^~VUID-vkCmdBindIndexBuffer-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindIndexBuffer-commandBuffer-recording)~^~implicit VALIDATION_ERROR_17e02415~^~Y~^~Unknown~^~vkCmdBindIndexBuffer~^~VUID-vkCmdBindIndexBuffer-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindIndexBuffer-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_17e0b201~^~Y~^~Unknown~^~vkCmdBindIndexBuffer~^~VUID-vkCmdBindIndexBuffer-indexType-parameter~^~core~^~The spec valid usage text states 'indexType must be a valid VkIndexType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindIndexBuffer-indexType-parameter)~^~implicit VALIDATION_ERROR_18000009~^~Y~^~Unknown~^~vkCmdBindPipeline~^~VUID-vkCmdBindPipeline-commonparent~^~core~^~The spec valid usage text states 'Both of commandBuffer, and pipeline must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindPipeline-commonparent)~^~implicit @@ -1722,7 +1731,7 @@ VALIDATION_ERROR_1800061a~^~N~^~Unknown~^~vkCmdBindPipeline~^~VUID-vkCmdBindPipeline-pipeline-00781~^~core~^~The spec valid usage text states 'If the variable multisample rate feature is not supported, pipeline is a graphics pipeline, the current subpass has no attachments, and this is not the first call to this function with a graphics pipeline after transitioning to the current subpass, then the sample count specified by this pipeline must match that set in the previous pipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindPipeline-pipeline-00781)~^~ VALIDATION_ERROR_18000bea~^~N~^~None~^~vkCmdBindPipeline~^~VUID-vkCmdBindPipeline-variableSampleLocations-01525~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If VkPhysicalDeviceSampleLocationsPropertiesEXT::variableSampleLocations is VK_FALSE, and pipeline is a graphics pipeline created with a VkPipelineSampleLocationsStateCreateInfoEXT structure having its sampleLocationsEnable member set to VK_TRUE but without VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT enabled then the current render pass instance must have been begun by specifying a VkRenderPassSampleLocationsBeginInfoEXT structure whose pPostSubpassSampleLocations member contains an element with a subpassIndex matching the current subpass index and the sampleLocationsInfo member of that element must match the sampleLocationsInfo specified in VkPipelineSampleLocationsStateCreateInfoEXT when the pipeline was created' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBindPipeline-variableSampleLocations-01525)~^~ VALIDATION_ERROR_18002401~^~Y~^~None~^~vkCmdBindPipeline~^~VUID-vkCmdBindPipeline-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindPipeline-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_18002413~^~N~^~Unknown~^~vkCmdBindPipeline~^~VUID-vkCmdBindPipeline-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindPipeline-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_18002413~^~Y~^~None~^~vkCmdBindPipeline~^~VUID-vkCmdBindPipeline-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindPipeline-commandBuffer-recording)~^~implicit VALIDATION_ERROR_18002415~^~Y~^~Unknown~^~vkCmdBindPipeline~^~VUID-vkCmdBindPipeline-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindPipeline-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_18027c01~^~Y~^~PipelineNotBound,InvalidPipeline~^~vkCmdBindPipeline~^~VUID-vkCmdBindPipeline-pipeline-parameter~^~core~^~The spec valid usage text states 'pipeline must be a valid VkPipeline handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindPipeline-pipeline-parameter)~^~implicit VALIDATION_ERROR_18027e01~^~Y~^~Unknown~^~vkCmdBindPipeline~^~VUID-vkCmdBindPipeline-pipelineBindPoint-parameter~^~core~^~The spec valid usage text states 'pipelineBindPoint must be a valid VkPipelineBindPoint value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindPipeline-pipelineBindPoint-parameter)~^~implicit @@ -1734,7 +1743,7 @@ VALIDATION_ERROR_182004e8~^~Y~^~Unknown~^~vkCmdBindVertexBuffers~^~VUID-vkCmdBindVertexBuffers-pBuffers-00628~^~core~^~The spec valid usage text states 'Each element of pBuffers that is non-sparse must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindVertexBuffers-pBuffers-00628)~^~ VALIDATION_ERROR_1820181b~^~Y~^~Unknown~^~vkCmdBindVertexBuffers~^~VUID-vkCmdBindVertexBuffers-bindingCount-arraylength~^~core~^~The spec valid usage text states 'bindingCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindVertexBuffers-bindingCount-arraylength)~^~implicit VALIDATION_ERROR_18202401~^~Y~^~None~^~vkCmdBindVertexBuffers~^~VUID-vkCmdBindVertexBuffers-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindVertexBuffers-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_18202413~^~N~^~Unknown~^~vkCmdBindVertexBuffers~^~VUID-vkCmdBindVertexBuffers-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindVertexBuffers-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_18202413~^~Y~^~None~^~vkCmdBindVertexBuffers~^~VUID-vkCmdBindVertexBuffers-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindVertexBuffers-commandBuffer-recording)~^~implicit VALIDATION_ERROR_18202415~^~Y~^~Unknown~^~vkCmdBindVertexBuffers~^~VUID-vkCmdBindVertexBuffers-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindVertexBuffers-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_18210601~^~Y~^~None~^~vkCmdBindVertexBuffers~^~VUID-vkCmdBindVertexBuffers-pBuffers-parameter~^~core~^~The spec valid usage text states 'pBuffers must be a valid pointer to an array of bindingCount valid VkBuffer handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindVertexBuffers-pBuffers-parameter)~^~implicit VALIDATION_ERROR_1821d201~^~Y~^~Unknown~^~vkCmdBindVertexBuffers~^~VUID-vkCmdBindVertexBuffers-pOffsets-parameter~^~core~^~The spec valid usage text states 'pOffsets must be a valid pointer to an array of bindingCount VkDeviceSize values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBindVertexBuffers-pOffsets-parameter)~^~implicit @@ -1747,12 +1756,12 @@ VALIDATION_ERROR_184001b6~^~Y~^~None~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-srcImage-00219~^~core~^~The spec valid usage text states 'srcImage must have been created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-srcImage-00219)~^~ VALIDATION_ERROR_184001b8~^~Y~^~Unknown~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-srcImage-00220~^~core~^~The spec valid usage text states 'If srcImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-srcImage-00220)~^~ VALIDATION_ERROR_184001ba~^~N~^~Unknown~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-srcImageLayout-00221~^~core~^~The spec valid usage text states 'srcImageLayout must specify the layout of the image subresources of srcImage specified in pRegions at the time this command is executed on a VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-srcImageLayout-00221)~^~ -VALIDATION_ERROR_184001bc~^~N~^~Unknown~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-srcImageLayout-00222~^~!(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'srcImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-srcImageLayout-00222)~^~ +VALIDATION_ERROR_184001bc~^~Y~^~BlitImageLayout~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-srcImageLayout-00222~^~!(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'srcImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-srcImageLayout-00222)~^~ VALIDATION_ERROR_184001be~^~Y~^~MiscBlitImageTests~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-dstImage-00223~^~core~^~The spec valid usage text states 'dstImage must use a format that supports VK_FORMAT_FEATURE_BLIT_DST_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-dstImage-00223)~^~ VALIDATION_ERROR_184001c0~^~Y~^~None~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-dstImage-00224~^~core~^~The spec valid usage text states 'dstImage must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-dstImage-00224)~^~ VALIDATION_ERROR_184001c2~^~Y~^~Unknown~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-dstImage-00225~^~core~^~The spec valid usage text states 'If dstImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-dstImage-00225)~^~ VALIDATION_ERROR_184001c4~^~N~^~Unknown~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-dstImageLayout-00226~^~core~^~The spec valid usage text states 'dstImageLayout must specify the layout of the image subresources of dstImage specified in pRegions at the time this command is executed on a VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-dstImageLayout-00226)~^~ -VALIDATION_ERROR_184001c6~^~N~^~Unknown~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-dstImageLayout-00227~^~!(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'dstImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-dstImageLayout-00227)~^~ +VALIDATION_ERROR_184001c6~^~Y~^~BlitImageLayout~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-dstImageLayout-00227~^~!(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'dstImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-dstImageLayout-00227)~^~ VALIDATION_ERROR_184001c8~^~Y~^~MiscBlitImageTests~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-srcImage-00228~^~core~^~The spec valid usage text states 'The sample count of srcImage and dstImage must both be equal to VK_SAMPLE_COUNT_1_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-srcImage-00228)~^~ VALIDATION_ERROR_184001ca~^~Y~^~BlitImageFormatTypes~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-srcImage-00229~^~core~^~The spec valid usage text states 'If either of srcImage or dstImage was created with a signed integer VkFormat, the other must also have been created with a signed integer VkFormat' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-srcImage-00229)~^~ VALIDATION_ERROR_184001cc~^~Y~^~BlitImageFormatTypes~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-srcImage-00230~^~core~^~The spec valid usage text states 'If either of srcImage or dstImage was created with an unsigned integer VkFormat, the other must also have been created with an unsigned integer VkFormat' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-srcImage-00230)~^~ @@ -1765,14 +1774,17 @@ VALIDATION_ERROR_184001da~^~Y~^~BlitImageFilters~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-filter-00237~^~(VK_IMG_filter_cubic)~^~The spec valid usage text states 'If filter is VK_FILTER_CUBIC_IMG, srcImage must have a VkImageType of VK_IMAGE_TYPE_3D' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-filter-00237)~^~ VALIDATION_ERROR_18400aec~^~N~^~None~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-srcImageLayout-01398~^~(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'srcImageLayout must be VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-srcImageLayout-01398)~^~ VALIDATION_ERROR_18400aee~^~N~^~None~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-dstImageLayout-01399~^~(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'dstImageLayout must be VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-dstImageLayout-01399)~^~ -VALIDATION_ERROR_18400c32~^~N~^~None~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-srcImage-01561~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'srcImage must not use a format listed in Formats requiring sampler Y'CBCR conversion for VK_IMAGE_ASPECT_COLOR_BIT image views' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-srcImage-01561)~^~ -VALIDATION_ERROR_18400c34~^~N~^~None~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-dstImage-01562~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'dstImage must not use a format listed in Formats requiring sampler Y'CBCR conversion for VK_IMAGE_ASPECT_COLOR_BIT image views' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-dstImage-01562)~^~ +VALIDATION_ERROR_18400c32~^~N~^~None~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-srcImage-01561~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'srcImage must not use a format listed in features-formats-requiring-sampler-ycbcr-conversion' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-srcImage-01561)~^~ +VALIDATION_ERROR_18400c34~^~N~^~None~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-dstImage-01562~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'dstImage must not use a format listed in features-formats-requiring-sampler-ycbcr-conversion' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-dstImage-01562)~^~ VALIDATION_ERROR_18400d52~^~N~^~None~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-srcSubresource-01705~^~core~^~The spec valid usage text states 'The srcSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-srcSubresource-01705)~^~ VALIDATION_ERROR_18400d54~^~N~^~None~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-dstSubresource-01706~^~core~^~The spec valid usage text states 'The dstSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-dstSubresource-01706)~^~ VALIDATION_ERROR_18400d56~^~N~^~None~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-srcSubresource-01707~^~core~^~The spec valid usage text states 'The srcSubresource.baseArrayLayer + srcSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-srcSubresource-01707)~^~ VALIDATION_ERROR_18400d58~^~N~^~None~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-dstSubresource-01708~^~core~^~The spec valid usage text states 'The dstSubresource.baseArrayLayer + dstSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-dstSubresource-01708)~^~ +VALIDATION_ERROR_18400e54~^~N~^~None~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-commandBuffer-01834~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then srcImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-commandBuffer-01834)~^~ +VALIDATION_ERROR_18400e56~^~N~^~None~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-commandBuffer-01835~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-commandBuffer-01835)~^~ +VALIDATION_ERROR_18400e58~^~N~^~None~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-commandBuffer-01836~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstImage must not be an unprotected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-commandBuffer-01836)~^~ VALIDATION_ERROR_18402401~^~Y~^~None~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_18402413~^~N~^~Unknown~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_18402413~^~Y~^~None~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-commandBuffer-recording)~^~implicit VALIDATION_ERROR_18402415~^~Y~^~Unknown~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_18407201~^~Y~^~None~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-dstImage-parameter~^~core~^~The spec valid usage text states 'dstImage must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-dstImage-parameter)~^~implicit VALIDATION_ERROR_18407401~^~Y~^~Unknown~^~vkCmdBlitImage~^~VUID-vkCmdBlitImage-dstImageLayout-parameter~^~core~^~The spec valid usage text states 'dstImageLayout must be a valid VkImageLayout value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-dstImageLayout-parameter)~^~implicit @@ -1785,33 +1797,32 @@ VALIDATION_ERROR_1860001e~^~Y~^~MissingClearAttachment~^~vkCmdClearAttachments~^~VUID-vkCmdClearAttachments-aspectMask-00015~^~core~^~The spec valid usage text states 'If the aspectMask member of any element of pAttachments contains VK_IMAGE_ASPECT_COLOR_BIT, the colorAttachment member of that element must refer to a valid color attachment in the current subpass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearAttachments-aspectMask-00015)~^~ VALIDATION_ERROR_18600020~^~Y~^~CmdClearAttachmentTests~^~vkCmdClearAttachments~^~VUID-vkCmdClearAttachments-pRects-00016~^~core~^~The spec valid usage text states 'The rectangular region specified by each element of pRects must be contained within the render area of the current render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearAttachments-pRects-00016)~^~ VALIDATION_ERROR_18600022~^~Y~^~CmdClearAttachmentTests~^~vkCmdClearAttachments~^~VUID-vkCmdClearAttachments-pRects-00017~^~core~^~The spec valid usage text states 'The layers specified by each element of pRects must be contained within every attachment that pAttachments refers to' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearAttachments-pRects-00017)~^~ -VALIDATION_ERROR_18600024~^~N~^~Unknown~^~vkCmdClearAttachments~^~VUID-vkCmdClearAttachments-baseArrayLayer-00018~^~(VK_KHX_multiview)~^~The spec valid usage text states 'If the render pass instance this is recorded in uses multiview, then baseArrayLayer must be zero and layerCount must be one.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearAttachments-baseArrayLayer-00018)~^~ +VALIDATION_ERROR_18600024~^~N~^~Unknown~^~vkCmdClearAttachments~^~VUID-vkCmdClearAttachments-baseArrayLayer-00018~^~(VK_VERSION_1_1,VK_KHR_multiview)~^~The spec valid usage text states 'If the render pass instance this is recorded in uses multiview, then baseArrayLayer must be zero and layerCount must be one.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearAttachments-baseArrayLayer-00018)~^~ VALIDATION_ERROR_18600e1b~^~Y~^~Unknown~^~vkCmdClearAttachments~^~VUID-vkCmdClearAttachments-attachmentCount-arraylength~^~core~^~The spec valid usage text states 'attachmentCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearAttachments-attachmentCount-arraylength)~^~implicit VALIDATION_ERROR_18602401~^~Y~^~None~^~vkCmdClearAttachments~^~VUID-vkCmdClearAttachments-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearAttachments-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_18602413~^~N~^~Unknown~^~vkCmdClearAttachments~^~VUID-vkCmdClearAttachments-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearAttachments-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_18602413~^~Y~^~None~^~vkCmdClearAttachments~^~VUID-vkCmdClearAttachments-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearAttachments-commandBuffer-recording)~^~implicit VALIDATION_ERROR_18602415~^~Y~^~Unknown~^~vkCmdClearAttachments~^~VUID-vkCmdClearAttachments-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearAttachments-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1860f201~^~Y~^~Unknown~^~vkCmdClearAttachments~^~VUID-vkCmdClearAttachments-pAttachments-parameter~^~core~^~The spec valid usage text states 'pAttachments must be a valid pointer to an array of attachmentCount valid VkClearAttachment structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearAttachments-pAttachments-parameter)~^~implicit VALIDATION_ERROR_18620e01~^~Y~^~Unknown~^~vkCmdClearAttachments~^~VUID-vkCmdClearAttachments-pRects-parameter~^~core~^~The spec valid usage text states 'pRects must be a valid pointer to an array of rectCount VkClearRect structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearAttachments-pRects-parameter)~^~implicit VALIDATION_ERROR_1862aa1b~^~Y~^~Unknown~^~vkCmdClearAttachments~^~VUID-vkCmdClearAttachments-rectCount-arraylength~^~core~^~The spec valid usage text states 'rectCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearAttachments-rectCount-arraylength)~^~implicit -VALIDATION_ERROR_18800002~^~N~^~Unknown~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-image-00001~^~(VK_KHR_maintenance1)~^~The spec valid usage text states 'image must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearColorImage-image-00001)~^~ +VALIDATION_ERROR_18800002~^~N~^~Unknown~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-image-00001~^~(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'image must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearColorImage-image-00001)~^~ VALIDATION_ERROR_18800004~^~Y~^~Unknown~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-image-00002~^~core~^~The spec valid usage text states 'image must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-image-00002)~^~ VALIDATION_ERROR_18800006~^~Y~^~Unknown~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-image-00003~^~core~^~The spec valid usage text states 'If image is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-image-00003)~^~ VALIDATION_ERROR_18800008~^~Y~^~InvalidImageLayout~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-imageLayout-00004~^~core~^~The spec valid usage text states 'imageLayout must specify the layout of the image subresource ranges of image specified in pRanges at the time this command is executed on a VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-imageLayout-00004)~^~ VALIDATION_ERROR_18800009~^~Y~^~Unknown~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-commonparent~^~core~^~The spec valid usage text states 'Both of commandBuffer, and image must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-commonparent)~^~implicit VALIDATION_ERROR_1880000a~^~Y~^~InvalidImageLayout~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-imageLayout-00005~^~!(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'imageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-imageLayout-00005)~^~ -VALIDATION_ERROR_1880000c~^~N~^~Unknown~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-pRanges-00006~^~core~^~The spec valid usage text states 'The image range of any given element of pRanges must be an image subresource range that is contained within image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-pRanges-00006)~^~ VALIDATION_ERROR_1880000e~^~Y~^~Unknown~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-image-00007~^~core~^~The spec valid usage text states 'image must not have a compressed or depth/stencil format' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-image-00007)~^~ VALIDATION_ERROR_18800017~^~Y~^~Unknown~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-renderpass~^~core~^~The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-renderpass)~^~implicit VALIDATION_ERROR_18800ae4~^~N~^~None~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-imageLayout-01394~^~(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'imageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearColorImage-imageLayout-01394)~^~ VALIDATION_ERROR_18800b7c~^~Y~^~ClearColorImageWithBadRange~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-baseMipLevel-01470~^~core~^~The spec valid usage text states 'The VkImageSubresourceRange::baseMipLevel members of the elements of the pRanges array must each be less than the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-baseMipLevel-01470)~^~ -VALIDATION_ERROR_18800b7e~^~Y~^~ClearColorImageWithBadRange~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-levelCount-01471~^~core~^~The spec valid usage text states 'If the VkImageSubresourceRange::levelCount member of any element of the pRanges array is not VK_REMAINING_MIP_LEVELS, it must be non-zero and VkImageSubresourceRange::baseMipLevel + VkImageSubresourceRange::levelCount for that element of the pRanges array must be less than or equal to the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-levelCount-01471)~^~ VALIDATION_ERROR_18800b80~^~Y~^~ClearColorImageWithBadRange~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-baseArrayLayer-01472~^~core~^~The spec valid usage text states 'The VkImageSubresourceRange::baseArrayLayer members of the elements of the pRanges array must each be less than the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-baseArrayLayer-01472)~^~ -VALIDATION_ERROR_18800b82~^~Y~^~ClearColorImageWithBadRange~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-layerCount-01473~^~core~^~The spec valid usage text states 'If the VkImageSubresourceRange::layerCount member of any element of the pRanges array is not VK_REMAINING_ARRAY_LAYERS, it must be non-zero and VkImageSubresourceRange::baseArrayLayer + VkImageSubresourceRange::layerCount for that element of the pRanges array must be less than or equal to the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-layerCount-01473)~^~ -VALIDATION_ERROR_18800c12~^~N~^~None~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-image-01545~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'image must not use a format listed in Formats requiring sampler Y'CBCR conversion for VK_IMAGE_ASPECT_COLOR_BIT image views' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearColorImage-image-01545)~^~ -VALIDATION_ERROR_18800d38~^~N~^~None~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-pRanges-01692~^~core~^~The spec valid usage text states 'For each VkImageSubresourceRange element of pRanges, if the levelCount member is not VK_REMAINING_MIP_LEVELS, then baseMipLevel + levelCount must be less than the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-pRanges-01692)~^~ -VALIDATION_ERROR_18800d3a~^~N~^~None~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-pRanges-01693~^~core~^~The spec valid usage text states 'For each VkImageSubresourceRange element of pRanges, if the layerCount member is not VK_REMAINING_ARRAY_LAYERS, then baseArrayLayer + layerCount must be less than the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-pRanges-01693)~^~ +VALIDATION_ERROR_18800c12~^~N~^~None~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-image-01545~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'image must not use a format listed in features-formats-requiring-sampler-ycbcr-conversion' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearColorImage-image-01545)~^~ +VALIDATION_ERROR_18800d38~^~Y~^~ClearColorImageWithBadRange~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-pRanges-01692~^~core~^~The spec valid usage text states 'For each VkImageSubresourceRange element of pRanges, if the levelCount member is not VK_REMAINING_MIP_LEVELS, then baseMipLevel + levelCount must be less than the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-pRanges-01692)~^~ +VALIDATION_ERROR_18800d3a~^~Y~^~ClearColorImageWithBadRange~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-pRanges-01693~^~core~^~The spec valid usage text states 'For each VkImageSubresourceRange element of pRanges, if the layerCount member is not VK_REMAINING_ARRAY_LAYERS, then baseArrayLayer + layerCount must be less than the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-pRanges-01693)~^~ +VALIDATION_ERROR_18800e1a~^~N~^~None~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-commandBuffer-01805~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then image must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearColorImage-commandBuffer-01805)~^~ +VALIDATION_ERROR_18800e1c~^~N~^~None~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-commandBuffer-01806~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, then image must not be an unprotected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearColorImage-commandBuffer-01806)~^~ VALIDATION_ERROR_18802401~^~Y~^~None~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_18802413~^~N~^~Unknown~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_18802413~^~Y~^~None~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-commandBuffer-recording)~^~implicit VALIDATION_ERROR_18802415~^~Y~^~Unknown~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1880a001~^~Y~^~None~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-image-parameter~^~core~^~The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-image-parameter)~^~implicit VALIDATION_ERROR_1880a601~^~Y~^~Unknown~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-imageLayout-parameter~^~core~^~The spec valid usage text states 'imageLayout must be a valid VkImageLayout value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-imageLayout-parameter)~^~implicit @@ -1819,22 +1830,21 @@ VALIDATION_ERROR_18820601~^~Y~^~Unknown~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-pRanges-parameter~^~core~^~The spec valid usage text states 'pRanges must be a valid pointer to an array of rangeCount valid VkImageSubresourceRange structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-pRanges-parameter)~^~implicit VALIDATION_ERROR_1882a41b~^~Y~^~Unknown~^~vkCmdClearColorImage~^~VUID-vkCmdClearColorImage-rangeCount-arraylength~^~core~^~The spec valid usage text states 'rangeCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-rangeCount-arraylength)~^~implicit VALIDATION_ERROR_18a00009~^~Y~^~Unknown~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-commonparent~^~core~^~The spec valid usage text states 'Both of commandBuffer, and image must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-commonparent)~^~implicit -VALIDATION_ERROR_18a00010~^~N~^~Unknown~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-image-00008~^~(VK_KHR_maintenance1)~^~The spec valid usage text states 'image must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-image-00008)~^~ -VALIDATION_ERROR_18a00012~^~N~^~Unknown~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-image-00009~^~core~^~The spec valid usage text states 'image must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-image-00009)~^~ +VALIDATION_ERROR_18a00010~^~Y~^~Unknown~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-image-00008~^~(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'image must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-image-00008)~^~ +VALIDATION_ERROR_18a00012~^~Y~^~ClearDepthStencilImageErrors~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-image-00009~^~core~^~The spec valid usage text states 'image must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-image-00009)~^~ VALIDATION_ERROR_18a00014~^~Y~^~Unknown~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-image-00010~^~core~^~The spec valid usage text states 'If image is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-image-00010)~^~ VALIDATION_ERROR_18a00016~^~Y~^~InvalidImageLayout~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-imageLayout-00011~^~core~^~The spec valid usage text states 'imageLayout must specify the layout of the image subresource ranges of image specified in pRanges at the time this command is executed on a VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-imageLayout-00011)~^~ -VALIDATION_ERROR_18a00017~^~Y~^~Unknown~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-renderpass~^~core~^~The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-renderpass)~^~implicit +VALIDATION_ERROR_18a00017~^~Y~^~ClearDepthStencilImageErrors~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-renderpass~^~core~^~The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-renderpass)~^~implicit VALIDATION_ERROR_18a00018~^~Y~^~InvalidImageLayout~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-imageLayout-00012~^~core~^~The spec valid usage text states 'imageLayout must be either of VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-imageLayout-00012)~^~ -VALIDATION_ERROR_18a0001a~^~N~^~Unknown~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-pRanges-00013~^~core~^~The spec valid usage text states 'The image range of any given element of pRanges must be an image subresource range that is contained within image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-pRanges-00013)~^~ VALIDATION_ERROR_18a0001c~^~Y~^~Unknown~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-image-00014~^~core~^~The spec valid usage text states 'image must have a depth/stencil format' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-image-00014)~^~ VALIDATION_ERROR_18a00b84~^~Y~^~ClearDepthStencilWithBadRange~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-baseMipLevel-01474~^~core~^~The spec valid usage text states 'The VkImageSubresourceRange::baseMipLevel members of the elements of the pRanges array must each be less than the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-baseMipLevel-01474)~^~ -VALIDATION_ERROR_18a00b86~^~Y~^~ClearDepthStencilWithBadRange~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-levelCount-01475~^~core~^~The spec valid usage text states 'If the VkImageSubresourceRange::levelCount member of any element of the pRanges array is not VK_REMAINING_MIP_LEVELS, it must be non-zero and VkImageSubresourceRange::baseMipLevel + VkImageSubresourceRange::levelCount for that element of the pRanges array must be less than or equal to the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-levelCount-01475)~^~ VALIDATION_ERROR_18a00b88~^~Y~^~ClearDepthStencilWithBadRange~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-baseArrayLayer-01476~^~core~^~The spec valid usage text states 'The VkImageSubresourceRange::baseArrayLayer members of the elements of the pRanges array must each be less than the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-baseArrayLayer-01476)~^~ -VALIDATION_ERROR_18a00b8a~^~Y~^~ClearDepthStencilWithBadRange~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-layerCount-01477~^~core~^~The spec valid usage text states 'If the VkImageSubresourceRange::layerCount member of any element of the pRanges array is not VK_REMAINING_ARRAY_LAYERS, it must be non-zero and VkImageSubresourceRange::baseArrayLayer + VkImageSubresourceRange::layerCount for that element of the pRanges array must be less than or equal to the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-layerCount-01477)~^~ -VALIDATION_ERROR_18a00d3c~^~N~^~None~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-pRanges-01694~^~core~^~The spec valid usage text states 'For each VkImageSubresourceRange element of pRanges, if the levelCount member is not VK_REMAINING_MIP_LEVELS, then baseMipLevel + levelCount must be less than the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-pRanges-01694)~^~ -VALIDATION_ERROR_18a00d3e~^~N~^~None~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-pRanges-01695~^~core~^~The spec valid usage text states 'For each VkImageSubresourceRange element of pRanges, if the layerCount member is not VK_REMAINING_ARRAY_LAYERS, then baseArrayLayer + layerCount must be less than the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-pRanges-01695)~^~ +VALIDATION_ERROR_18a00d3c~^~Y~^~ClearDepthStencilWithBadRange~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-pRanges-01694~^~core~^~The spec valid usage text states 'For each VkImageSubresourceRange element of pRanges, if the levelCount member is not VK_REMAINING_MIP_LEVELS, then baseMipLevel + levelCount must be less than the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-pRanges-01694)~^~ +VALIDATION_ERROR_18a00d3e~^~Y~^~ClearDepthStencilWithBadRange~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-pRanges-01695~^~core~^~The spec valid usage text states 'For each VkImageSubresourceRange element of pRanges, if the layerCount member is not VK_REMAINING_ARRAY_LAYERS, then baseArrayLayer + layerCount must be less than the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-pRanges-01695)~^~ +VALIDATION_ERROR_18a00e1e~^~N~^~None~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-commandBuffer-01807~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then image must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-commandBuffer-01807)~^~ +VALIDATION_ERROR_18a00e20~^~N~^~None~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-commandBuffer-01808~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, then image must not be an unprotected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-commandBuffer-01808)~^~ VALIDATION_ERROR_18a02401~^~Y~^~None~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_18a02413~^~N~^~Unknown~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_18a02413~^~Y~^~None~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-commandBuffer-recording)~^~implicit VALIDATION_ERROR_18a02415~^~Y~^~Unknown~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_18a0a001~^~Y~^~None~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-image-parameter~^~core~^~The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-image-parameter)~^~implicit VALIDATION_ERROR_18a0a601~^~Y~^~Unknown~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-imageLayout-parameter~^~core~^~The spec valid usage text states 'imageLayout must be a valid VkImageLayout value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-imageLayout-parameter)~^~implicit @@ -1853,8 +1863,11 @@ VALIDATION_ERROR_18c000ee~^~Y~^~Unknown~^~vkCmdCopyBuffer~^~VUID-vkCmdCopyBuffer-srcBuffer-00119~^~core~^~The spec valid usage text states 'If srcBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBuffer-srcBuffer-00119)~^~ VALIDATION_ERROR_18c000f0~^~Y~^~None~^~vkCmdCopyBuffer~^~VUID-vkCmdCopyBuffer-dstBuffer-00120~^~core~^~The spec valid usage text states 'dstBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_DST_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBuffer-dstBuffer-00120)~^~ VALIDATION_ERROR_18c000f2~^~Y~^~Unknown~^~vkCmdCopyBuffer~^~VUID-vkCmdCopyBuffer-dstBuffer-00121~^~core~^~The spec valid usage text states 'If dstBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBuffer-dstBuffer-00121)~^~ +VALIDATION_ERROR_18c00e3c~^~N~^~None~^~vkCmdCopyBuffer~^~VUID-vkCmdCopyBuffer-commandBuffer-01822~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then srcBuffer must not be a protected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBuffer-commandBuffer-01822)~^~ +VALIDATION_ERROR_18c00e3e~^~N~^~None~^~vkCmdCopyBuffer~^~VUID-vkCmdCopyBuffer-commandBuffer-01823~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstBuffer must not be a protected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBuffer-commandBuffer-01823)~^~ +VALIDATION_ERROR_18c00e40~^~N~^~None~^~vkCmdCopyBuffer~^~VUID-vkCmdCopyBuffer-commandBuffer-01824~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstBuffer must not be an unprotected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBuffer-commandBuffer-01824)~^~ VALIDATION_ERROR_18c02401~^~Y~^~None~^~vkCmdCopyBuffer~^~VUID-vkCmdCopyBuffer-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBuffer-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_18c02413~^~N~^~Unknown~^~vkCmdCopyBuffer~^~VUID-vkCmdCopyBuffer-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBuffer-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_18c02413~^~Y~^~None~^~vkCmdCopyBuffer~^~VUID-vkCmdCopyBuffer-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBuffer-commandBuffer-recording)~^~implicit VALIDATION_ERROR_18c02415~^~Y~^~Unknown~^~vkCmdCopyBuffer~^~VUID-vkCmdCopyBuffer-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBuffer-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_18c06c01~^~Y~^~None~^~vkCmdCopyBuffer~^~VUID-vkCmdCopyBuffer-dstBuffer-parameter~^~core~^~The spec valid usage text states 'dstBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBuffer-dstBuffer-parameter)~^~implicit VALIDATION_ERROR_18c21001~^~Y~^~Unknown~^~vkCmdCopyBuffer~^~VUID-vkCmdCopyBuffer-pRegions-parameter~^~core~^~The spec valid usage text states 'pRegions must be a valid pointer to an array of regionCount VkBufferCopy structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBuffer-pRegions-parameter)~^~implicit @@ -1866,7 +1879,7 @@ VALIDATION_ERROR_18e00158~^~Y~^~ImageBufferCopyTests~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-pRegions-00172~^~core~^~The spec valid usage text states 'The image region specified by each element of pRegions must be a region that is contained within dstImage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-pRegions-00172)~^~ VALIDATION_ERROR_18e0015a~^~N~^~Unknown~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-pRegions-00173~^~core~^~The spec valid usage text states 'The union of all source regions, and the union of all destination regions, specified by the elements of pRegions, must not overlap in memory' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-pRegions-00173)~^~ VALIDATION_ERROR_18e0015c~^~Y~^~None~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-srcBuffer-00174~^~core~^~The spec valid usage text states 'srcBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_SRC_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-srcBuffer-00174)~^~ -VALIDATION_ERROR_18e0015e~^~N~^~Unknown~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-dstImage-00175~^~(VK_KHR_maintenance1)~^~The spec valid usage text states 'dstImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBufferToImage-dstImage-00175)~^~ +VALIDATION_ERROR_18e0015e~^~N~^~Unknown~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-dstImage-00175~^~(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'dstImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBufferToImage-dstImage-00175)~^~ VALIDATION_ERROR_18e00160~^~Y~^~Unknown~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-srcBuffer-00176~^~core~^~The spec valid usage text states 'If srcBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-srcBuffer-00176)~^~ VALIDATION_ERROR_18e00162~^~Y~^~None~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-dstImage-00177~^~core~^~The spec valid usage text states 'dstImage must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-dstImage-00177)~^~ VALIDATION_ERROR_18e00164~^~Y~^~Unknown~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-dstImage-00178~^~core~^~The spec valid usage text states 'If dstImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-dstImage-00178)~^~ @@ -1876,6 +1889,10 @@ VALIDATION_ERROR_18e00ae8~^~N~^~None~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-dstImageLayout-01396~^~(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'dstImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBufferToImage-dstImageLayout-01396)~^~ VALIDATION_ERROR_18e00d4a~^~N~^~None~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-imageSubresource-01701~^~core~^~The spec valid usage text states 'The imageSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-imageSubresource-01701)~^~ VALIDATION_ERROR_18e00d4c~^~N~^~None~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-imageSubresource-01702~^~core~^~The spec valid usage text states 'The imageSubresource.baseArrayLayer + imageSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-imageSubresource-01702)~^~ +VALIDATION_ERROR_18e00e02~^~N~^~None~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-imageOffset-01793~^~core~^~The spec valid usage text states 'The imageOffset and and imageExtent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer's command pool's queue family, as described in VkQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-imageOffset-01793)~^~ +VALIDATION_ERROR_18e00e48~^~N~^~None~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-commandBuffer-01828~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then srcBuffer must not be a protected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBufferToImage-commandBuffer-01828)~^~ +VALIDATION_ERROR_18e00e4a~^~N~^~None~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-commandBuffer-01829~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBufferToImage-commandBuffer-01829)~^~ +VALIDATION_ERROR_18e00e4c~^~N~^~None~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-commandBuffer-01830~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstImage must not be an unprotected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBufferToImage-commandBuffer-01830)~^~ VALIDATION_ERROR_18e02401~^~Y~^~None~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-commandBuffer-parameter)~^~implicit VALIDATION_ERROR_18e02413~^~Y~^~ImageBufferCopyTests~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-commandBuffer-recording)~^~implicit VALIDATION_ERROR_18e02415~^~Y~^~None~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-commandBuffer-cmdpool)~^~implicit @@ -1889,30 +1906,36 @@ VALIDATION_ERROR_190000f4~^~Y~^~CopyImageSrcSizeExceeded~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-pRegions-00122~^~core~^~The spec valid usage text states 'The source region specified by each element of pRegions must be a region that is contained within srcImage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-pRegions-00122)~^~ VALIDATION_ERROR_190000f6~^~Y~^~CopyImageDstSizeExceeded~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-pRegions-00123~^~core~^~The spec valid usage text states 'The destination region specified by each element of pRegions must be a region that is contained within dstImage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-pRegions-00123)~^~ VALIDATION_ERROR_190000f8~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-pRegions-00124~^~core~^~The spec valid usage text states 'The union of all source regions, and the union of all destination regions, specified by the elements of pRegions, must not overlap in memory' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-pRegions-00124)~^~ -VALIDATION_ERROR_190000fa~^~N~^~Unknown~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcImage-00125~^~(VK_KHR_maintenance1)~^~The spec valid usage text states 'srcImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-srcImage-00125)~^~ +VALIDATION_ERROR_190000fa~^~N~^~Unknown~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcImage-00125~^~(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'srcImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-srcImage-00125)~^~ VALIDATION_ERROR_190000fc~^~Y~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcImage-00126~^~core~^~The spec valid usage text states 'srcImage must have been created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcImage-00126)~^~ -VALIDATION_ERROR_190000fe~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcImage-00127~^~!(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If srcImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcImage-00127)~^~ +VALIDATION_ERROR_190000fe~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcImage-00127~^~!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If srcImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcImage-00127)~^~ VALIDATION_ERROR_19000100~^~N~^~Unknown~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcImageLayout-00128~^~core~^~The spec valid usage text states 'srcImageLayout must specify the layout of the image subresources of srcImage specified in pRegions at the time this command is executed on a VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcImageLayout-00128)~^~ -VALIDATION_ERROR_19000102~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcImageLayout-00129~^~(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'srcImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-srcImageLayout-00129)~^~ -VALIDATION_ERROR_19000104~^~N~^~Unknown~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstImage-00130~^~(VK_KHR_maintenance1)~^~The spec valid usage text states 'dstImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-dstImage-00130)~^~ +VALIDATION_ERROR_19000102~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcImageLayout-00129~^~!(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'srcImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcImageLayout-00129)~^~ +VALIDATION_ERROR_19000104~^~N~^~Unknown~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstImage-00130~^~(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'dstImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-dstImage-00130)~^~ VALIDATION_ERROR_19000106~^~Y~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstImage-00131~^~core~^~The spec valid usage text states 'dstImage must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstImage-00131)~^~ -VALIDATION_ERROR_19000108~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstImage-00132~^~!(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If dstImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstImage-00132)~^~ +VALIDATION_ERROR_19000108~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstImage-00132~^~!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If dstImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstImage-00132)~^~ VALIDATION_ERROR_1900010a~^~N~^~Unknown~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstImageLayout-00133~^~core~^~The spec valid usage text states 'dstImageLayout must specify the layout of the image subresources of dstImage specified in pRegions at the time this command is executed on a VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstImageLayout-00133)~^~ VALIDATION_ERROR_1900010c~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstImageLayout-00134~^~!(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'dstImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstImageLayout-00134)~^~ -VALIDATION_ERROR_1900010e~^~Y~^~CopyImageFormatSizeMismatch~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcImage-00135~^~!(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'The VkFormat of each of srcImage and dstImage must be compatible, as defined below' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcImage-00135)~^~ +VALIDATION_ERROR_1900010e~^~Y~^~CopyImageFormatSizeMismatch~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcImage-00135~^~!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'The VkFormat of each of srcImage and dstImage must be compatible, as defined below' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcImage-00135)~^~ VALIDATION_ERROR_19000110~^~Y~^~CopyImageSampleCountMismatch~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcImage-00136~^~core~^~The spec valid usage text states 'The sample count of srcImage and dstImage must match' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcImage-00136)~^~ VALIDATION_ERROR_19000ae6~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstImageLayout-01395~^~(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'dstImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-dstImageLayout-01395)~^~ -VALIDATION_ERROR_19000c14~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcImage-01546~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If srcImage is non-sparse then the image or disjoint plane to be copied must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-srcImage-01546)~^~ -VALIDATION_ERROR_19000c16~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstImage-01547~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If dstImage is non-sparse then the image or disjoint plane that is the destination of the copy must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-dstImage-01547)~^~ -VALIDATION_ERROR_19000c18~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcImage-01548~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the VkFormat of each of srcImage and dstImage is not a multi-planar format, the VkFormat of each of srcImage and dstImage must be compatible, as defined below' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-srcImage-01548)~^~ -VALIDATION_ERROR_19000c1a~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-None-01549~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'In a copy to or from a plane of a multi-planar image, the VkFormat of the image and plane must be compatible according to the description of compatible planes for the plane being copied' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-None-01549)~^~ -VALIDATION_ERROR_19000c1c~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-aspectMask-01550~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'When a copy is performed to or from an image with a multi-planar format, the aspectMask of the srcSubresource and/or dstSubresource that refers to the multi-planar image must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR, or VK_IMAGE_ASPECT_PLANE_2_BIT_KHR (with VK_IMAGE_ASPECT_PLANE_2_BIT_KHR valid only for a VkFormat with three planes)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-aspectMask-01550)~^~ -VALIDATION_ERROR_19000d40~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcSubresource-01696~^~core~^~The spec valid usage text states 'The srcSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcSubresource-01696)~^~ -VALIDATION_ERROR_19000d42~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstSubresource-01697~^~core~^~The spec valid usage text states 'The dstSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstSubresource-01697)~^~ -VALIDATION_ERROR_19000d44~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcSubresource-01698~^~core~^~The spec valid usage text states 'The srcSubresource.baseArrayLayer + srcSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcSubresource-01698)~^~ -VALIDATION_ERROR_19000d46~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstSubresource-01699~^~core~^~The spec valid usage text states 'The dstSubresource.baseArrayLayer + dstSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstSubresource-01699)~^~ +VALIDATION_ERROR_19000c14~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcImage-01546~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If srcImage is non-sparse then the image or disjoint plane to be copied must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-srcImage-01546)~^~ +VALIDATION_ERROR_19000c16~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstImage-01547~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If dstImage is non-sparse then the image or disjoint plane that is the destination of the copy must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-dstImage-01547)~^~ +VALIDATION_ERROR_19000c18~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcImage-01548~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the VkFormat of each of srcImage and dstImage is not a multi-planar format, the VkFormat of each of srcImage and dstImage must be compatible, as defined below' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-srcImage-01548)~^~ +VALIDATION_ERROR_19000c1a~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-None-01549~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'In a copy to or from a plane of a multi-planar image, the VkFormat of the image and plane must be compatible according to the description of compatible planes for the plane being copied' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-None-01549)~^~ +VALIDATION_ERROR_19000c1c~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-aspectMask-01550~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'When a copy is performed to or from an image with a multi-planar format, the aspectMask of the srcSubresource and/or dstSubresource that refers to the multi-planar image must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT (with VK_IMAGE_ASPECT_PLANE_2_BIT valid only for a VkFormat with three planes)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-aspectMask-01550)~^~ +VALIDATION_ERROR_19000d40~^~Y~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcSubresource-01696~^~core~^~The spec valid usage text states 'The srcSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcSubresource-01696)~^~ +VALIDATION_ERROR_19000d42~^~Y~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstSubresource-01697~^~core~^~The spec valid usage text states 'The dstSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstSubresource-01697)~^~ +VALIDATION_ERROR_19000d44~^~Y~^~CopyImageTypeExtentMismatch~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcSubresource-01698~^~core~^~The spec valid usage text states 'The srcSubresource.baseArrayLayer + srcSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcSubresource-01698)~^~ +VALIDATION_ERROR_19000d46~^~Y~^~CopyImageTypeExtentMismatch~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstSubresource-01699~^~core~^~The spec valid usage text states 'The dstSubresource.baseArrayLayer + dstSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstSubresource-01699)~^~ +VALIDATION_ERROR_19000dee~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcOffset-01783~^~core~^~The spec valid usage text states 'The srcOffset and and extent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer's command pool's queue family, as described in VkQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcOffset-01783)~^~ +VALIDATION_ERROR_19000df0~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstOffset-01784~^~core~^~The spec valid usage text states 'The dstOffset and and extent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer's command pool's queue family, as described in VkQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstOffset-01784)~^~ +VALIDATION_ERROR_19000e42~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-commandBuffer-01825~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then srcImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-commandBuffer-01825)~^~ +VALIDATION_ERROR_19000e44~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-commandBuffer-01826~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-commandBuffer-01826)~^~ +VALIDATION_ERROR_19000e46~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-commandBuffer-01827~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstImage must not be an unprotected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-commandBuffer-01827)~^~ +VALIDATION_ERROR_19000efa~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcImageLayout-01917~^~(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'srcImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-srcImageLayout-01917)~^~ VALIDATION_ERROR_19002401~^~Y~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_19002413~^~N~^~Unknown~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_19002413~^~Y~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-commandBuffer-recording)~^~implicit VALIDATION_ERROR_19002415~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_19007201~^~Y~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstImage-parameter~^~core~^~The spec valid usage text states 'dstImage must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstImage-parameter)~^~implicit VALIDATION_ERROR_19007401~^~Y~^~Unknown~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstImageLayout-parameter~^~core~^~The spec valid usage text states 'dstImageLayout must be a valid VkImageLayout value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstImageLayout-parameter)~^~implicit @@ -1925,7 +1948,7 @@ VALIDATION_ERROR_1920016c~^~Y~^~ImageBufferCopyTests~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-pRegions-00182~^~core~^~The spec valid usage text states 'The image region specified by each element of pRegions must be a region that is contained within srcImage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-pRegions-00182)~^~ VALIDATION_ERROR_1920016e~^~Y~^~ImageBufferCopyTests~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-pRegions-00183~^~core~^~The spec valid usage text states 'The buffer region specified by each element of pRegions must be a region that is contained within dstBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-pRegions-00183)~^~ VALIDATION_ERROR_19200170~^~N~^~Unknown~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-pRegions-00184~^~core~^~The spec valid usage text states 'The union of all source regions, and the union of all destination regions, specified by the elements of pRegions, must not overlap in memory' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-pRegions-00184)~^~ -VALIDATION_ERROR_19200172~^~N~^~Unknown~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-srcImage-00185~^~(VK_KHR_maintenance1)~^~The spec valid usage text states 'srcImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-srcImage-00185)~^~ +VALIDATION_ERROR_19200172~^~N~^~Unknown~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-srcImage-00185~^~(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'srcImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-srcImage-00185)~^~ VALIDATION_ERROR_19200174~^~Y~^~None~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-srcImage-00186~^~core~^~The spec valid usage text states 'srcImage must have been created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-srcImage-00186)~^~ VALIDATION_ERROR_19200176~^~Y~^~Unknown~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-srcImage-00187~^~core~^~The spec valid usage text states 'If srcImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-srcImage-00187)~^~ VALIDATION_ERROR_19200178~^~Y~^~Unknown~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-srcImage-00188~^~core~^~The spec valid usage text states 'srcImage must have a sample count equal to VK_SAMPLE_COUNT_1_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-srcImage-00188)~^~ @@ -1936,6 +1959,10 @@ VALIDATION_ERROR_19200aea~^~N~^~None~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-srcImageLayout-01397~^~(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'srcImageLayout must be VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-srcImageLayout-01397)~^~ VALIDATION_ERROR_19200d4e~^~N~^~None~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-imageSubresource-01703~^~core~^~The spec valid usage text states 'The imageSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-imageSubresource-01703)~^~ VALIDATION_ERROR_19200d50~^~N~^~None~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-imageSubresource-01704~^~core~^~The spec valid usage text states 'The imageSubresource.baseArrayLayer + imageSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-imageSubresource-01704)~^~ +VALIDATION_ERROR_19200e04~^~N~^~None~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-imageOffset-01794~^~core~^~The spec valid usage text states 'The imageOffset and and imageExtent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer's command pool's queue family, as described in VkQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-imageOffset-01794)~^~ +VALIDATION_ERROR_19200e4e~^~N~^~None~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-commandBuffer-01831~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then srcImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-commandBuffer-01831)~^~ +VALIDATION_ERROR_19200e50~^~N~^~None~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-commandBuffer-01832~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstBuffer must not be a protected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-commandBuffer-01832)~^~ +VALIDATION_ERROR_19200e52~^~N~^~None~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-commandBuffer-01833~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstBuffer must not be an unprotected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-commandBuffer-01833)~^~ VALIDATION_ERROR_19202401~^~Y~^~None~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-commandBuffer-parameter)~^~implicit VALIDATION_ERROR_19202413~^~Y~^~ImageBufferCopyTests~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-commandBuffer-recording)~^~implicit VALIDATION_ERROR_19202415~^~Y~^~None~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-commandBuffer-cmdpool)~^~implicit @@ -1956,127 +1983,139 @@ VALIDATION_ERROR_19400674~^~Y~^~Unknown~^~vkCmdCopyQueryPoolResults~^~VUID-vkCmdCopyQueryPoolResults-dstBuffer-00826~^~core~^~The spec valid usage text states 'If dstBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyQueryPoolResults-dstBuffer-00826)~^~ VALIDATION_ERROR_19400676~^~N~^~Unknown~^~vkCmdCopyQueryPoolResults~^~VUID-vkCmdCopyQueryPoolResults-queryType-00827~^~core~^~The spec valid usage text states 'If the queryType used to create queryPool was VK_QUERY_TYPE_TIMESTAMP, flags must not contain VK_QUERY_RESULT_PARTIAL_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyQueryPoolResults-queryType-00827)~^~ VALIDATION_ERROR_19402401~^~Y~^~None~^~vkCmdCopyQueryPoolResults~^~VUID-vkCmdCopyQueryPoolResults-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyQueryPoolResults-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_19402413~^~N~^~Unknown~^~vkCmdCopyQueryPoolResults~^~VUID-vkCmdCopyQueryPoolResults-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyQueryPoolResults-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_19402413~^~Y~^~None~^~vkCmdCopyQueryPoolResults~^~VUID-vkCmdCopyQueryPoolResults-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyQueryPoolResults-commandBuffer-recording)~^~implicit VALIDATION_ERROR_19402415~^~Y~^~Unknown~^~vkCmdCopyQueryPoolResults~^~VUID-vkCmdCopyQueryPoolResults-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyQueryPoolResults-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_19406c01~^~Y~^~None~^~vkCmdCopyQueryPoolResults~^~VUID-vkCmdCopyQueryPoolResults-dstBuffer-parameter~^~core~^~The spec valid usage text states 'dstBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyQueryPoolResults-dstBuffer-parameter)~^~implicit VALIDATION_ERROR_19409001~^~Y~^~Unknown~^~vkCmdCopyQueryPoolResults~^~VUID-vkCmdCopyQueryPoolResults-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkQueryResultFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyQueryPoolResults-flags-parameter)~^~implicit, TBD in parameter validation layer. VALIDATION_ERROR_19429801~^~Y~^~None~^~vkCmdCopyQueryPoolResults~^~VUID-vkCmdCopyQueryPoolResults-queryPool-parameter~^~core~^~The spec valid usage text states 'queryPool must be a valid VkQueryPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyQueryPoolResults-queryPool-parameter)~^~implicit -VALIDATION_ERROR_19602401~^~Y~^~None~^~vkCmdDebugMarkerBeginEXT~^~VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_19602413~^~N~^~Unknown~^~vkCmdDebugMarkerBeginEXT~^~VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-recording)~^~implicit -VALIDATION_ERROR_19602415~^~N~^~Unknown~^~vkCmdDebugMarkerBeginEXT~^~VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_1961a601~^~N~^~Unknown~^~vkCmdDebugMarkerBeginEXT~^~VUID-vkCmdDebugMarkerBeginEXT-pMarkerInfo-parameter~^~core~^~The spec valid usage text states 'pMarkerInfo must be a valid pointer to a valid VkDebugMarkerMarkerInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerBeginEXT-pMarkerInfo-parameter)~^~implicit -VALIDATION_ERROR_198009ae~^~N~^~Unknown~^~vkCmdDebugMarkerEndEXT~^~VUID-vkCmdDebugMarkerEndEXT-commandBuffer-01239~^~core~^~The spec valid usage text states 'There must be an outstanding vkCmdDebugMarkerBeginEXT command prior to the vkCmdDebugMarkerEndEXT on the queue that commandBuffer is submitted to' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-01239)~^~ -VALIDATION_ERROR_198009b0~^~N~^~Unknown~^~vkCmdDebugMarkerEndEXT~^~VUID-vkCmdDebugMarkerEndEXT-commandBuffer-01240~^~core~^~The spec valid usage text states 'If commandBuffer is a secondary command buffer, there must be an outstanding vkCmdDebugMarkerBeginEXT command recorded to commandBuffer that has not previously been ended by a call to vkCmdDebugMarkerEndEXT.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-01240)~^~ -VALIDATION_ERROR_19802401~^~Y~^~None~^~vkCmdDebugMarkerEndEXT~^~VUID-vkCmdDebugMarkerEndEXT-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_19802413~^~N~^~Unknown~^~vkCmdDebugMarkerEndEXT~^~VUID-vkCmdDebugMarkerEndEXT-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-recording)~^~implicit -VALIDATION_ERROR_19802415~^~N~^~Unknown~^~vkCmdDebugMarkerEndEXT~^~VUID-vkCmdDebugMarkerEndEXT-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_19a02401~^~Y~^~None~^~vkCmdDebugMarkerInsertEXT~^~VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_19a02413~^~N~^~Unknown~^~vkCmdDebugMarkerInsertEXT~^~VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-recording)~^~implicit -VALIDATION_ERROR_19a02415~^~N~^~Unknown~^~vkCmdDebugMarkerInsertEXT~^~VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_19a1a601~^~N~^~Unknown~^~vkCmdDebugMarkerInsertEXT~^~VUID-vkCmdDebugMarkerInsertEXT-pMarkerInfo-parameter~^~core~^~The spec valid usage text states 'pMarkerInfo must be a valid pointer to a valid VkDebugMarkerMarkerInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerInsertEXT-pMarkerInfo-parameter)~^~implicit +VALIDATION_ERROR_19602401~^~Y~^~None~^~vkCmdDebugMarkerBeginEXT~^~VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-parameter~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-parameter)~^~implicit +VALIDATION_ERROR_19602413~^~Y~^~None~^~vkCmdDebugMarkerBeginEXT~^~VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-recording~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_19602415~^~N~^~Unknown~^~vkCmdDebugMarkerBeginEXT~^~VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-cmdpool~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-cmdpool)~^~implicit +VALIDATION_ERROR_1961a601~^~N~^~Unknown~^~vkCmdDebugMarkerBeginEXT~^~VUID-vkCmdDebugMarkerBeginEXT-pMarkerInfo-parameter~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'pMarkerInfo must be a valid pointer to a valid VkDebugMarkerMarkerInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerBeginEXT-pMarkerInfo-parameter)~^~implicit +VALIDATION_ERROR_198009ae~^~N~^~Unknown~^~vkCmdDebugMarkerEndEXT~^~VUID-vkCmdDebugMarkerEndEXT-commandBuffer-01239~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'There must be an outstanding vkCmdDebugMarkerBeginEXT command prior to the vkCmdDebugMarkerEndEXT on the queue that commandBuffer is submitted to' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-01239)~^~ +VALIDATION_ERROR_198009b0~^~N~^~Unknown~^~vkCmdDebugMarkerEndEXT~^~VUID-vkCmdDebugMarkerEndEXT-commandBuffer-01240~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'If commandBuffer is a secondary command buffer, there must be an outstanding vkCmdDebugMarkerBeginEXT command recorded to commandBuffer that has not previously been ended by a call to vkCmdDebugMarkerEndEXT.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-01240)~^~ +VALIDATION_ERROR_19802401~^~Y~^~None~^~vkCmdDebugMarkerEndEXT~^~VUID-vkCmdDebugMarkerEndEXT-commandBuffer-parameter~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-parameter)~^~implicit +VALIDATION_ERROR_19802413~^~Y~^~None~^~vkCmdDebugMarkerEndEXT~^~VUID-vkCmdDebugMarkerEndEXT-commandBuffer-recording~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_19802415~^~N~^~Unknown~^~vkCmdDebugMarkerEndEXT~^~VUID-vkCmdDebugMarkerEndEXT-commandBuffer-cmdpool~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-cmdpool)~^~implicit +VALIDATION_ERROR_19a02401~^~Y~^~None~^~vkCmdDebugMarkerInsertEXT~^~VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-parameter~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-parameter)~^~implicit +VALIDATION_ERROR_19a02413~^~Y~^~None~^~vkCmdDebugMarkerInsertEXT~^~VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-recording~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_19a02415~^~N~^~Unknown~^~vkCmdDebugMarkerInsertEXT~^~VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-cmdpool~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-cmdpool)~^~implicit +VALIDATION_ERROR_19a1a601~^~N~^~Unknown~^~vkCmdDebugMarkerInsertEXT~^~VUID-vkCmdDebugMarkerInsertEXT-pMarkerInfo-parameter~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'pMarkerInfo must be a valid pointer to a valid VkDebugMarkerMarkerInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerInsertEXT-pMarkerInfo-parameter)~^~implicit VALIDATION_ERROR_19c00017~^~Y~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-renderpass~^~core~^~The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-renderpass)~^~implicit -VALIDATION_ERROR_19c00304~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-groupCountX-00386~^~core~^~The spec valid usage text states 'groupCountX must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[0]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-groupCountX-00386)~^~ -VALIDATION_ERROR_19c00306~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-groupCountY-00387~^~core~^~The spec valid usage text states 'groupCountY must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[1]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-groupCountY-00387)~^~ -VALIDATION_ERROR_19c00308~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-groupCountZ-00388~^~core~^~The spec valid usage text states 'groupCountZ must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[2]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-groupCountZ-00388)~^~ -VALIDATION_ERROR_19c0030a~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-None-00389~^~core~^~The spec valid usage text states 'For each set n that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00389)~^~ -VALIDATION_ERROR_19c0030c~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-None-00390~^~core~^~The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the currently bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00390)~^~ +VALIDATION_ERROR_19c00304~^~Y~^~CmdDispatchExceedLimits~^~vkCmdDispatch~^~VUID-vkCmdDispatch-groupCountX-00386~^~core~^~The spec valid usage text states 'groupCountX must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[0]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-groupCountX-00386)~^~ +VALIDATION_ERROR_19c00306~^~Y~^~CmdDispatchExceedLimits~^~vkCmdDispatch~^~VUID-vkCmdDispatch-groupCountY-00387~^~core~^~The spec valid usage text states 'groupCountY must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[1]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-groupCountY-00387)~^~ +VALIDATION_ERROR_19c00308~^~Y~^~CmdDispatchExceedLimits~^~vkCmdDispatch~^~VUID-vkCmdDispatch-groupCountZ-00388~^~core~^~The spec valid usage text states 'groupCountZ must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[2]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-groupCountZ-00388)~^~ +VALIDATION_ERROR_19c0030a~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-None-00389~^~core~^~The spec valid usage text states 'For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00389)~^~ +VALIDATION_ERROR_19c0030c~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-None-00390~^~core~^~The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00390)~^~ VALIDATION_ERROR_19c0030e~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-None-00391~^~core~^~The spec valid usage text states 'A valid compute pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_COMPUTE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00391)~^~ -VALIDATION_ERROR_19c00310~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-None-00392~^~core~^~The spec valid usage text states 'For each push constant that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE, a push constant value must have been set for VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for push constants with the one used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00392)~^~ -VALIDATION_ERROR_19c00312~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-None-00393~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00393)~^~ -VALIDATION_ERROR_19c00314~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-None-00394~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00394)~^~ -VALIDATION_ERROR_19c00316~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-None-00395~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00395)~^~ -VALIDATION_ERROR_19c00318~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-None-00396~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00396)~^~ -VALIDATION_ERROR_19c0031a~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-None-00397~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00397)~^~ +VALIDATION_ERROR_19c00310~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-None-00392~^~core~^~The spec valid usage text states 'For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE, a push constant value must have been set for VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for push constants with the one used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00392)~^~ +VALIDATION_ERROR_19c00312~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-None-00393~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00393)~^~ +VALIDATION_ERROR_19c00314~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-None-00394~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00394)~^~ +VALIDATION_ERROR_19c00316~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-None-00395~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00395)~^~ +VALIDATION_ERROR_19c00318~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-None-00396~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00396)~^~ +VALIDATION_ERROR_19c0031a~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-None-00397~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00397)~^~ VALIDATION_ERROR_19c0031c~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-linearTilingFeatures-00398~^~core~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-linearTilingFeatures-00398)~^~ VALIDATION_ERROR_19c0031e~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-linearTilingFeatures-00399~^~(VK_IMG_filter_cubic)~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatch-linearTilingFeatures-00399)~^~ VALIDATION_ERROR_19c00320~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-None-00400~^~(VK_IMG_filter_cubic)~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must not have a VkImageViewType of VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatch-None-00400)~^~ +VALIDATION_ERROR_19c00e68~^~N~^~None~^~vkCmdDispatch~^~VUID-vkCmdDispatch-commandBuffer-01844~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_COMPUTE reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatch-commandBuffer-01844)~^~ +VALIDATION_ERROR_19c00e6a~^~N~^~None~^~vkCmdDispatch~^~VUID-vkCmdDispatch-commandBuffer-01845~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_POINT_COMPUTE writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatch-commandBuffer-01845)~^~ +VALIDATION_ERROR_19c00e6c~^~N~^~None~^~vkCmdDispatch~^~VUID-vkCmdDispatch-commandBuffer-01846~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage other than the compute pipeline stage in the VkPipeline object bound to VK_PIPELINE_POINT_COMPUTE reads from any image or buffer, the image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatch-commandBuffer-01846)~^~ VALIDATION_ERROR_19c02401~^~Y~^~None~^~vkCmdDispatch~^~VUID-vkCmdDispatch-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_19c02413~^~N~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_19c02413~^~Y~^~None~^~vkCmdDispatch~^~VUID-vkCmdDispatch-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-commandBuffer-recording)~^~implicit VALIDATION_ERROR_19c02415~^~Y~^~Unknown~^~vkCmdDispatch~^~VUID-vkCmdDispatch-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_19e00017~^~N~^~Unknown~^~vkCmdDispatchBaseKHX~^~VUID-vkCmdDispatchBaseKHX-renderpass~^~core~^~The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-renderpass)~^~implicit -VALIDATION_ERROR_19e00348~^~N~^~Unknown~^~vkCmdDispatchBaseKHX~^~VUID-vkCmdDispatchBaseKHX-None-00420~^~core~^~The spec valid usage text states 'All valid usage rules from vkCmdDispatch apply' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-None-00420)~^~ -VALIDATION_ERROR_19e0034a~^~N~^~Unknown~^~vkCmdDispatchBaseKHX~^~VUID-vkCmdDispatchBaseKHX-baseGroupX-00421~^~core~^~The spec valid usage text states 'baseGroupX must be less than VkPhysicalDeviceLimits::maxComputeWorkGroupCount[0]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-baseGroupX-00421)~^~ -VALIDATION_ERROR_19e0034c~^~N~^~Unknown~^~vkCmdDispatchBaseKHX~^~VUID-vkCmdDispatchBaseKHX-baseGroupX-00422~^~core~^~The spec valid usage text states 'baseGroupX must be less than VkPhysicaYDeviceLimits::maxComputeWorkGroupCount[1]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-baseGroupX-00422)~^~ -VALIDATION_ERROR_19e0034e~^~N~^~Unknown~^~vkCmdDispatchBaseKHX~^~VUID-vkCmdDispatchBaseKHX-baseGroupZ-00423~^~core~^~The spec valid usage text states 'baseGroupZ must be less than VkPhysicalDeviceLimits::maxComputeWorkGroupCount[2]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-baseGroupZ-00423)~^~ -VALIDATION_ERROR_19e00350~^~N~^~Unknown~^~vkCmdDispatchBaseKHX~^~VUID-vkCmdDispatchBaseKHX-groupCountX-00424~^~core~^~The spec valid usage text states 'groupCountX must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[0] minus baseGroupX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-groupCountX-00424)~^~ -VALIDATION_ERROR_19e00352~^~N~^~Unknown~^~vkCmdDispatchBaseKHX~^~VUID-vkCmdDispatchBaseKHX-groupCountY-00425~^~core~^~The spec valid usage text states 'groupCountY must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[1] minus baseGroupY' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-groupCountY-00425)~^~ -VALIDATION_ERROR_19e00354~^~N~^~Unknown~^~vkCmdDispatchBaseKHX~^~VUID-vkCmdDispatchBaseKHX-groupCountZ-00426~^~core~^~The spec valid usage text states 'groupCountZ must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[2] minus baseGroupZ' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-groupCountZ-00426)~^~ -VALIDATION_ERROR_19e00356~^~N~^~Unknown~^~vkCmdDispatchBaseKHX~^~VUID-vkCmdDispatchBaseKHX-baseGroupX-00427~^~core~^~The spec valid usage text states 'If any of baseGroupX, baseGroupY, or baseGroupZ are not zero, then the currently bound compute pipeline must have been created with the VK_PIPELINE_CREATE_DISPATCH_BASE_KHX flag.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-baseGroupX-00427)~^~ -VALIDATION_ERROR_19e02401~^~Y~^~Unknown~^~vkCmdDispatchBaseKHX~^~VUID-vkCmdDispatchBaseKHX-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_19e02413~^~N~^~Unknown~^~vkCmdDispatchBaseKHX~^~VUID-vkCmdDispatchBaseKHX-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-commandBuffer-recording)~^~implicit -VALIDATION_ERROR_19e02415~^~N~^~Unknown~^~vkCmdDispatchBaseKHX~^~VUID-vkCmdDispatchBaseKHX-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-commandBuffer-cmdpool)~^~implicit +VALIDATION_ERROR_19e00017~^~N~^~Unknown~^~vkCmdDispatchBase~^~VUID-vkCmdDispatchBase-renderpass~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-renderpass)~^~implicit +VALIDATION_ERROR_19e00348~^~N~^~Unknown~^~vkCmdDispatchBase~^~VUID-vkCmdDispatchBase-None-00420~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'All valid usage rules from vkCmdDispatch apply' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-None-00420)~^~ +VALIDATION_ERROR_19e0034a~^~Y~^~CmdDispatchExceedLimits~^~vkCmdDispatchBase~^~VUID-vkCmdDispatchBase-baseGroupX-00421~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'baseGroupX must be less than VkPhysicalDeviceLimits::maxComputeWorkGroupCount[0]' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-baseGroupX-00421)~^~ +VALIDATION_ERROR_19e0034c~^~Y~^~CmdDispatchExceedLimits~^~vkCmdDispatchBase~^~VUID-vkCmdDispatchBase-baseGroupX-00422~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'baseGroupX must be less than VkPhysicalDeviceLimits::maxComputeWorkGroupCount[1]' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-baseGroupX-00422)~^~ +VALIDATION_ERROR_19e0034e~^~Y~^~CmdDispatchExceedLimits~^~vkCmdDispatchBase~^~VUID-vkCmdDispatchBase-baseGroupZ-00423~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'baseGroupZ must be less than VkPhysicalDeviceLimits::maxComputeWorkGroupCount[2]' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-baseGroupZ-00423)~^~ +VALIDATION_ERROR_19e00350~^~Y~^~CmdDispatchExceedLimits~^~vkCmdDispatchBase~^~VUID-vkCmdDispatchBase-groupCountX-00424~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'groupCountX must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[0] minus baseGroupX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-groupCountX-00424)~^~ +VALIDATION_ERROR_19e00352~^~Y~^~CmdDispatchExceedLimits~^~vkCmdDispatchBase~^~VUID-vkCmdDispatchBase-groupCountY-00425~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'groupCountY must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[1] minus baseGroupY' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-groupCountY-00425)~^~ +VALIDATION_ERROR_19e00354~^~Y~^~CmdDispatchExceedLimits~^~vkCmdDispatchBase~^~VUID-vkCmdDispatchBase-groupCountZ-00426~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'groupCountZ must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[2] minus baseGroupZ' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-groupCountZ-00426)~^~ +VALIDATION_ERROR_19e00356~^~N~^~Unknown~^~vkCmdDispatchBase~^~VUID-vkCmdDispatchBase-baseGroupX-00427~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If any of baseGroupX, baseGroupY, or baseGroupZ are not zero, then the bound compute pipeline must have been created with the VK_PIPELINE_CREATE_DISPATCH_BASE flag.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-baseGroupX-00427)~^~ +VALIDATION_ERROR_19e02401~^~Y~^~Unknown~^~vkCmdDispatchBase~^~VUID-vkCmdDispatchBase-commandBuffer-parameter~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-commandBuffer-parameter)~^~implicit +VALIDATION_ERROR_19e02413~^~N~^~Unknown~^~vkCmdDispatchBase~^~VUID-vkCmdDispatchBase-commandBuffer-recording~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_19e02415~^~N~^~Unknown~^~vkCmdDispatchBase~^~VUID-vkCmdDispatchBase-commandBuffer-cmdpool~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1a000009~^~Y~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-commonparent~^~core~^~The spec valid usage text states 'Both of buffer, and commandBuffer must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-commonparent)~^~implicit VALIDATION_ERROR_1a000017~^~Y~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-renderpass~^~core~^~The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-renderpass)~^~implicit VALIDATION_ERROR_1a000322~^~Y~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-buffer-00401~^~core~^~The spec valid usage text states 'If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-buffer-00401)~^~ -VALIDATION_ERROR_1a000324~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-None-00402~^~core~^~The spec valid usage text states 'For each set n that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00402)~^~ -VALIDATION_ERROR_1a000326~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-None-00403~^~core~^~The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the currently bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00403)~^~ +VALIDATION_ERROR_1a000324~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-None-00402~^~core~^~The spec valid usage text states 'For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00402)~^~ +VALIDATION_ERROR_1a000326~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-None-00403~^~core~^~The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00403)~^~ VALIDATION_ERROR_1a000328~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-None-00404~^~core~^~The spec valid usage text states 'A valid compute pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_COMPUTE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00404)~^~ VALIDATION_ERROR_1a00032a~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-buffer-00405~^~core~^~The spec valid usage text states 'buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-buffer-00405)~^~ VALIDATION_ERROR_1a00032c~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-offset-00406~^~core~^~The spec valid usage text states 'offset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-offset-00406)~^~ VALIDATION_ERROR_1a00032e~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-offset-00407~^~core~^~The spec valid usage text states 'The sum of offset and the size of VkDispatchIndirectCommand must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-offset-00407)~^~ -VALIDATION_ERROR_1a000330~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-None-00408~^~core~^~The spec valid usage text states 'For each push constant that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE, a push constant value must have been set for VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for push constants with the one used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00408)~^~ -VALIDATION_ERROR_1a000332~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-None-00409~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00409)~^~ -VALIDATION_ERROR_1a000334~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-None-00410~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00410)~^~ -VALIDATION_ERROR_1a000336~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-None-00411~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00411)~^~ -VALIDATION_ERROR_1a000338~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-None-00412~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00412)~^~ -VALIDATION_ERROR_1a00033a~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-None-00413~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00413)~^~ +VALIDATION_ERROR_1a000330~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-None-00408~^~core~^~The spec valid usage text states 'For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE, a push constant value must have been set for VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for push constants with the one used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00408)~^~ +VALIDATION_ERROR_1a000332~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-None-00409~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00409)~^~ +VALIDATION_ERROR_1a000334~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-None-00410~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00410)~^~ +VALIDATION_ERROR_1a000336~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-None-00411~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00411)~^~ +VALIDATION_ERROR_1a000338~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-None-00412~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00412)~^~ +VALIDATION_ERROR_1a00033a~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-None-00413~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00413)~^~ VALIDATION_ERROR_1a00033c~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-linearTilingFeatures-00414~^~core~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-linearTilingFeatures-00414)~^~ VALIDATION_ERROR_1a00033e~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-linearTilingFeatures-00415~^~(VK_IMG_filter_cubic)~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchIndirect-linearTilingFeatures-00415)~^~ VALIDATION_ERROR_1a000340~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-None-00416~^~(VK_IMG_filter_cubic)~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must not have a VkImageViewType of VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00416)~^~ +VALIDATION_ERROR_1a000e6e~^~N~^~None~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-commandBuffer-01847~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_COMPUTE reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchIndirect-commandBuffer-01847)~^~ +VALIDATION_ERROR_1a000e70~^~N~^~None~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-commandBuffer-01848~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_POINT_COMPUTE writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchIndirect-commandBuffer-01848)~^~ +VALIDATION_ERROR_1a000e72~^~N~^~None~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-commandBuffer-01849~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage other than the compute pipeline stage in the VkPipeline object bound to VK_PIPELINE_POINT_COMPUTE reads from any image or buffer, the image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchIndirect-commandBuffer-01849)~^~ VALIDATION_ERROR_1a001a01~^~Y~^~None~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-buffer-parameter~^~core~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-buffer-parameter)~^~implicit VALIDATION_ERROR_1a002401~^~Y~^~None~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1a002413~^~N~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1a002413~^~Y~^~None~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1a002415~^~Y~^~Unknown~^~vkCmdDispatchIndirect~^~VUID-vkCmdDispatchIndirect-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1a200017~^~Y~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-renderpass~^~core~^~The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-renderpass)~^~implicit -VALIDATION_ERROR_1a200366~^~Y~^~RenderPassIncompatible~^~vkCmdDraw~^~VUID-vkCmdDraw-renderPass-00435~^~core~^~The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-renderPass-00435)~^~ -VALIDATION_ERROR_1a200368~^~Y~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-subpass-00436~^~core~^~The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-subpass-00436)~^~ -VALIDATION_ERROR_1a20036a~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00437~^~core~^~The spec valid usage text states 'For each set n that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00437)~^~ -VALIDATION_ERROR_1a20036c~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00438~^~core~^~The spec valid usage text states 'For each push constant that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00438)~^~ -VALIDATION_ERROR_1a20036e~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00439~^~core~^~The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the currently bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00439)~^~ +VALIDATION_ERROR_1a200366~^~Y~^~RenderPassIncompatible~^~vkCmdDraw~^~VUID-vkCmdDraw-renderPass-00435~^~core~^~The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-renderPass-00435)~^~ +VALIDATION_ERROR_1a200368~^~Y~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-subpass-00436~^~core~^~The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-subpass-00436)~^~ +VALIDATION_ERROR_1a20036a~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00437~^~core~^~The spec valid usage text states 'For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00437)~^~ +VALIDATION_ERROR_1a20036c~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00438~^~core~^~The spec valid usage text states 'For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00438)~^~ +VALIDATION_ERROR_1a20036e~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00439~^~core~^~The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00439)~^~ VALIDATION_ERROR_1a200370~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00440~^~core~^~The spec valid usage text states 'All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must have valid buffers bound' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00440)~^~ -VALIDATION_ERROR_1a200372~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00441~^~core~^~The spec valid usage text states 'For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00441)~^~ +VALIDATION_ERROR_1a200372~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00441~^~core~^~The spec valid usage text states 'For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in fxvertex-input' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00441)~^~ VALIDATION_ERROR_1a200374~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00442~^~core~^~The spec valid usage text states 'A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00442)~^~ -VALIDATION_ERROR_1a200376~^~Y~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00443~^~core~^~The spec valid usage text states 'If the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00443)~^~ +VALIDATION_ERROR_1a200376~^~Y~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00443~^~core~^~The spec valid usage text states 'If the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00443)~^~ VALIDATION_ERROR_1a200378~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00444~^~core~^~The spec valid usage text states 'Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00444)~^~ -VALIDATION_ERROR_1a20037a~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00445~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00445)~^~ -VALIDATION_ERROR_1a20037c~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00446~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00446)~^~ -VALIDATION_ERROR_1a20037e~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00447~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00447)~^~ -VALIDATION_ERROR_1a200380~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00448~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00448)~^~ -VALIDATION_ERROR_1a200382~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00449~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00449)~^~ +VALIDATION_ERROR_1a20037a~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00445~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00445)~^~ +VALIDATION_ERROR_1a20037c~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00446~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00446)~^~ +VALIDATION_ERROR_1a20037e~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00447~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00447)~^~ +VALIDATION_ERROR_1a200380~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00448~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00448)~^~ +VALIDATION_ERROR_1a200382~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00449~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00449)~^~ VALIDATION_ERROR_1a200384~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-linearTilingFeatures-00450~^~core~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-linearTilingFeatures-00450)~^~ VALIDATION_ERROR_1a200386~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-linearTilingFeatures-00451~^~(VK_IMG_filter_cubic)~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDraw-linearTilingFeatures-00451)~^~ VALIDATION_ERROR_1a200388~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-None-00452~^~(VK_IMG_filter_cubic)~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must not have a VkImageViewType of VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDraw-None-00452)~^~ -VALIDATION_ERROR_1a20038a~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-maxMultiviewInstanceIndex-00453~^~(VK_KHX_multiview)~^~The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewPropertiesKHX::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDraw-maxMultiviewInstanceIndex-00453)~^~ +VALIDATION_ERROR_1a20038a~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-maxMultiviewInstanceIndex-00453~^~(VK_VERSION_1_1,VK_KHR_multiview)~^~The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDraw-maxMultiviewInstanceIndex-00453)~^~ VALIDATION_ERROR_1a200bb6~^~N~^~None~^~vkCmdDraw~^~VUID-vkCmdDraw-None-01499~^~core~^~The spec valid usage text states 'Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-01499)~^~ -VALIDATION_ERROR_1a200bd0~^~N~^~None~^~vkCmdDraw~^~VUID-vkCmdDraw-sampleLocationsEnable-01512~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If the currently bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDraw-sampleLocationsEnable-01512)~^~ +VALIDATION_ERROR_1a200bd0~^~N~^~None~^~vkCmdDraw~^~VUID-vkCmdDraw-sampleLocationsEnable-01512~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If the bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDraw-sampleLocationsEnable-01512)~^~ +VALIDATION_ERROR_1a200e74~^~N~^~None~^~vkCmdDraw~^~VUID-vkCmdDraw-commandBuffer-01850~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDraw-commandBuffer-01850)~^~ +VALIDATION_ERROR_1a200e76~^~N~^~None~^~vkCmdDraw~^~VUID-vkCmdDraw-commandBuffer-01851~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDraw-commandBuffer-01851)~^~ +VALIDATION_ERROR_1a200e78~^~N~^~None~^~vkCmdDraw~^~VUID-vkCmdDraw-commandBuffer-01852~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDraw-commandBuffer-01852)~^~ VALIDATION_ERROR_1a202401~^~Y~^~None~^~vkCmdDraw~^~VUID-vkCmdDraw-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1a202413~^~N~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1a202413~^~Y~^~None~^~vkCmdDraw~^~VUID-vkCmdDraw-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1a202415~^~Y~^~Unknown~^~vkCmdDraw~^~VUID-vkCmdDraw-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1a400017~^~Y~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-renderpass~^~core~^~The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-renderpass)~^~implicit -VALIDATION_ERROR_1a40038c~^~Y~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-renderPass-00454~^~core~^~The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-renderPass-00454)~^~ -VALIDATION_ERROR_1a40038e~^~Y~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-subpass-00455~^~core~^~The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-subpass-00455)~^~ -VALIDATION_ERROR_1a400390~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00456~^~core~^~The spec valid usage text states 'For each set n that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00456)~^~ -VALIDATION_ERROR_1a400392~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00457~^~core~^~The spec valid usage text states 'For each push constant that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00457)~^~ -VALIDATION_ERROR_1a400394~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00458~^~core~^~The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the currently bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00458)~^~ +VALIDATION_ERROR_1a40038c~^~Y~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-renderPass-00454~^~core~^~The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-renderPass-00454)~^~ +VALIDATION_ERROR_1a40038e~^~Y~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-subpass-00455~^~core~^~The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-subpass-00455)~^~ +VALIDATION_ERROR_1a400390~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00456~^~core~^~The spec valid usage text states 'For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00456)~^~ +VALIDATION_ERROR_1a400392~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00457~^~core~^~The spec valid usage text states 'For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00457)~^~ +VALIDATION_ERROR_1a400394~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00458~^~core~^~The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00458)~^~ VALIDATION_ERROR_1a400396~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00459~^~core~^~The spec valid usage text states 'All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must have valid buffers bound' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00459)~^~ -VALIDATION_ERROR_1a400398~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00460~^~core~^~The spec valid usage text states 'For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00460)~^~ +VALIDATION_ERROR_1a400398~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00460~^~core~^~The spec valid usage text states 'For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in fxvertex-input' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00460)~^~ VALIDATION_ERROR_1a40039a~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00461~^~core~^~The spec valid usage text states 'A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00461)~^~ -VALIDATION_ERROR_1a40039c~^~Y~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00462~^~core~^~The spec valid usage text states 'If the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00462)~^~ -VALIDATION_ERROR_1a40039e~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-indexSize-00463~^~core~^~The spec valid usage text states '(indexSize * (firstIndex + indexCount) + offset) must be less than or equal to the size of the currently bound index buffer, with indexSize being based on the type specified by indexType, where the index buffer, indexType, and offset are specified via vkCmdBindIndexBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-indexSize-00463)~^~ +VALIDATION_ERROR_1a40039c~^~Y~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00462~^~core~^~The spec valid usage text states 'If the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00462)~^~ +VALIDATION_ERROR_1a40039e~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-indexSize-00463~^~core~^~The spec valid usage text states '(indexSize * (firstIndex + indexCount) + offset) must be less than or equal to the size of the bound index buffer, with indexSize being based on the type specified by indexType, where the index buffer, indexType, and offset are specified via vkCmdBindIndexBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-indexSize-00463)~^~ VALIDATION_ERROR_1a4003a0~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00464~^~core~^~The spec valid usage text states 'Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00464)~^~ -VALIDATION_ERROR_1a4003a2~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00465~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00465)~^~ -VALIDATION_ERROR_1a4003a4~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00466~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00466)~^~ -VALIDATION_ERROR_1a4003a6~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00467~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00467)~^~ -VALIDATION_ERROR_1a4003a8~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00468~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00468)~^~ -VALIDATION_ERROR_1a4003aa~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00469~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00469)~^~ +VALIDATION_ERROR_1a4003a2~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00465~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00465)~^~ +VALIDATION_ERROR_1a4003a4~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00466~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00466)~^~ +VALIDATION_ERROR_1a4003a6~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00467~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00467)~^~ +VALIDATION_ERROR_1a4003a8~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00468~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00468)~^~ +VALIDATION_ERROR_1a4003aa~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00469~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00469)~^~ VALIDATION_ERROR_1a4003ac~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-linearTilingFeatures-00470~^~core~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-linearTilingFeatures-00470)~^~ VALIDATION_ERROR_1a4003ae~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-linearTilingFeatures-00471~^~(VK_IMG_filter_cubic)~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-linearTilingFeatures-00471)~^~ VALIDATION_ERROR_1a4003b0~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-00472~^~(VK_IMG_filter_cubic)~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must not have a VkImageViewType of VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00472)~^~ -VALIDATION_ERROR_1a4003b2~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-maxMultiviewInstanceIndex-00473~^~(VK_KHX_multiview)~^~The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewPropertiesKHX::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-maxMultiviewInstanceIndex-00473)~^~ +VALIDATION_ERROR_1a4003b2~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-maxMultiviewInstanceIndex-00473~^~(VK_VERSION_1_1,VK_KHR_multiview)~^~The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-maxMultiviewInstanceIndex-00473)~^~ VALIDATION_ERROR_1a400bb8~^~N~^~None~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-None-01500~^~core~^~The spec valid usage text states 'Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-01500)~^~ -VALIDATION_ERROR_1a400bd2~^~N~^~None~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-sampleLocationsEnable-01513~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If the currently bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-sampleLocationsEnable-01513)~^~ +VALIDATION_ERROR_1a400bd2~^~N~^~None~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-sampleLocationsEnable-01513~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If the bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-sampleLocationsEnable-01513)~^~ +VALIDATION_ERROR_1a400e7a~^~N~^~None~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-commandBuffer-01853~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-commandBuffer-01853)~^~ +VALIDATION_ERROR_1a400e7c~^~N~^~None~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-commandBuffer-01854~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-commandBuffer-01854)~^~ +VALIDATION_ERROR_1a400e7e~^~N~^~None~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-commandBuffer-01855~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-commandBuffer-01855)~^~ VALIDATION_ERROR_1a402401~^~Y~^~None~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1a402413~^~N~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1a402413~^~Y~^~None~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1a402415~^~Y~^~Unknown~^~vkCmdDrawIndexed~^~VUID-vkCmdDrawIndexed-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1a600009~^~Y~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-commonparent~^~core~^~The spec valid usage text states 'Both of buffer, and commandBuffer must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-commonparent)~^~implicit VALIDATION_ERROR_1a600017~^~Y~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-renderpass~^~core~^~The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-renderpass)~^~implicit @@ -2085,71 +2124,77 @@ VALIDATION_ERROR_1a600420~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-drawCount-00528~^~core~^~The spec valid usage text states 'If drawCount is greater than 1, stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawIndexedIndirectCommand)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-drawCount-00528)~^~ VALIDATION_ERROR_1a600422~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-drawCount-00529~^~core~^~The spec valid usage text states 'If the multi-draw indirect feature is not enabled, drawCount must be 0 or 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-drawCount-00529)~^~ VALIDATION_ERROR_1a600424~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-firstInstance-00530~^~core~^~The spec valid usage text states 'If the drawIndirectFirstInstance feature is not enabled, all the firstInstance members of the VkDrawIndexedIndirectCommand structures accessed by this command must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-firstInstance-00530)~^~ -VALIDATION_ERROR_1a600426~^~Y~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-renderPass-00531~^~core~^~The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-renderPass-00531)~^~ -VALIDATION_ERROR_1a600428~^~Y~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-subpass-00532~^~core~^~The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-subpass-00532)~^~ -VALIDATION_ERROR_1a60042a~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00533~^~core~^~The spec valid usage text states 'For each set n that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00533)~^~ -VALIDATION_ERROR_1a60042c~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00534~^~core~^~The spec valid usage text states 'For each push constant that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00534)~^~ -VALIDATION_ERROR_1a60042e~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00535~^~core~^~The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the currently bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00535)~^~ +VALIDATION_ERROR_1a600426~^~Y~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-renderPass-00531~^~core~^~The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-renderPass-00531)~^~ +VALIDATION_ERROR_1a600428~^~Y~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-subpass-00532~^~core~^~The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-subpass-00532)~^~ +VALIDATION_ERROR_1a60042a~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00533~^~core~^~The spec valid usage text states 'For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00533)~^~ +VALIDATION_ERROR_1a60042c~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00534~^~core~^~The spec valid usage text states 'For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00534)~^~ +VALIDATION_ERROR_1a60042e~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00535~^~core~^~The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00535)~^~ VALIDATION_ERROR_1a600430~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00536~^~core~^~The spec valid usage text states 'All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must have valid buffers bound' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00536)~^~ VALIDATION_ERROR_1a600432~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00537~^~core~^~The spec valid usage text states 'A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00537)~^~ -VALIDATION_ERROR_1a600434~^~Y~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00538~^~core~^~The spec valid usage text states 'If the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00538)~^~ +VALIDATION_ERROR_1a600434~^~Y~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00538~^~core~^~The spec valid usage text states 'If the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00538)~^~ VALIDATION_ERROR_1a600436~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-drawCount-00539~^~core~^~The spec valid usage text states 'If drawCount is equal to 1, (offset + sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-drawCount-00539)~^~ VALIDATION_ERROR_1a600438~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-drawCount-00540~^~core~^~The spec valid usage text states 'If drawCount is greater than 1, (stride {times} (drawCount - 1) + offset + sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-drawCount-00540)~^~ VALIDATION_ERROR_1a60043a~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-drawCount-00541~^~core~^~The spec valid usage text states 'drawCount must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-drawCount-00541)~^~ VALIDATION_ERROR_1a60043c~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00542~^~core~^~The spec valid usage text states 'Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00542)~^~ -VALIDATION_ERROR_1a60043e~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00543~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00543)~^~ -VALIDATION_ERROR_1a600440~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00544~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00544)~^~ -VALIDATION_ERROR_1a600442~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00545~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00545)~^~ -VALIDATION_ERROR_1a600444~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00546~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00546)~^~ -VALIDATION_ERROR_1a600446~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00547~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00547)~^~ +VALIDATION_ERROR_1a60043e~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00543~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00543)~^~ +VALIDATION_ERROR_1a600440~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00544~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00544)~^~ +VALIDATION_ERROR_1a600442~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00545~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00545)~^~ +VALIDATION_ERROR_1a600444~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00546~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00546)~^~ +VALIDATION_ERROR_1a600446~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00547~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00547)~^~ VALIDATION_ERROR_1a600448~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-linearTilingFeatures-00548~^~core~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-linearTilingFeatures-00548)~^~ VALIDATION_ERROR_1a60044a~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-linearTilingFeatures-00549~^~(VK_IMG_filter_cubic)~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-linearTilingFeatures-00549)~^~ VALIDATION_ERROR_1a60044c~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-00550~^~(VK_IMG_filter_cubic)~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must not have a VkImageViewType of VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00550)~^~ -VALIDATION_ERROR_1a60044e~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-maxMultiviewInstanceIndex-00551~^~(VK_KHX_multiview)~^~The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewPropertiesKHX::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-maxMultiviewInstanceIndex-00551)~^~ +VALIDATION_ERROR_1a60044e~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-maxMultiviewInstanceIndex-00551~^~(VK_VERSION_1_1,VK_KHR_multiview)~^~The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-maxMultiviewInstanceIndex-00551)~^~ VALIDATION_ERROR_1a600bbe~^~N~^~None~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-None-01503~^~core~^~The spec valid usage text states 'Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-01503)~^~ -VALIDATION_ERROR_1a600bd8~^~N~^~None~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-sampleLocationsEnable-01516~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If the currently bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-sampleLocationsEnable-01516)~^~ +VALIDATION_ERROR_1a600bd8~^~N~^~None~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-sampleLocationsEnable-01516~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If the bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-sampleLocationsEnable-01516)~^~ VALIDATION_ERROR_1a600d02~^~N~^~None~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-buffer-01665~^~core~^~The spec valid usage text states 'buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-buffer-01665)~^~ +VALIDATION_ERROR_1a600e8c~^~N~^~None~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-commandBuffer-01862~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-commandBuffer-01862)~^~ +VALIDATION_ERROR_1a600e8e~^~N~^~None~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-commandBuffer-01863~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-commandBuffer-01863)~^~ +VALIDATION_ERROR_1a600e90~^~N~^~None~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-commandBuffer-01864~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-commandBuffer-01864)~^~ VALIDATION_ERROR_1a601a01~^~Y~^~None~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-buffer-parameter~^~core~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-buffer-parameter)~^~implicit VALIDATION_ERROR_1a602401~^~Y~^~None~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1a602413~^~N~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1a602413~^~Y~^~None~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1a602415~^~Y~^~Unknown~^~vkCmdDrawIndexedIndirect~^~VUID-vkCmdDrawIndexedIndirect-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_1a800009~^~Y~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-commonparent~^~core~^~The spec valid usage text states 'Each of buffer, commandBuffer, and countBuffer must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commonparent)~^~implicit -VALIDATION_ERROR_1a800017~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-renderpass~^~core~^~The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-renderpass)~^~implicit -VALIDATION_ERROR_1a800456~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-offset-00555~^~core~^~The spec valid usage text states 'offset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-offset-00555)~^~ -VALIDATION_ERROR_1a800458~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-countBufferOffset-00556~^~core~^~The spec valid usage text states 'countBufferOffset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBufferOffset-00556)~^~ -VALIDATION_ERROR_1a80045a~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-stride-00557~^~core~^~The spec valid usage text states 'stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawIndirectCommand)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-stride-00557)~^~ -VALIDATION_ERROR_1a80045c~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-maxDrawCount-00558~^~core~^~The spec valid usage text states 'If maxDrawCount is greater than or equal to 1, (stride {times} (maxDrawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-maxDrawCount-00558)~^~ -VALIDATION_ERROR_1a80045e~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-firstInstance-00559~^~core~^~The spec valid usage text states 'If the drawIndirectFirstInstance feature is not enabled, all the firstInstance members of the VkDrawIndexedIndirectCommand structures accessed by this command must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-firstInstance-00559)~^~ -VALIDATION_ERROR_1a800460~^~Y~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-renderPass-00560~^~core~^~The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-renderPass-00560)~^~ -VALIDATION_ERROR_1a800462~^~Y~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-subpass-00561~^~core~^~The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-subpass-00561)~^~ -VALIDATION_ERROR_1a800464~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00562~^~core~^~The spec valid usage text states 'For each set n that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00562)~^~ -VALIDATION_ERROR_1a800466~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00563~^~core~^~The spec valid usage text states 'For each push constant that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00563)~^~ -VALIDATION_ERROR_1a800468~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00564~^~core~^~The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the currently bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00564)~^~ -VALIDATION_ERROR_1a80046a~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00565~^~core~^~The spec valid usage text states 'All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must have valid buffers bound' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00565)~^~ -VALIDATION_ERROR_1a80046c~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00566~^~core~^~The spec valid usage text states 'A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00566)~^~ -VALIDATION_ERROR_1a80046e~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00567~^~core~^~The spec valid usage text states 'If the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00567)~^~ -VALIDATION_ERROR_1a800470~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-00568~^~core~^~The spec valid usage text states 'If count stored in countBuffer is equal to 1, (offset + sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-00568)~^~ -VALIDATION_ERROR_1a800472~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-00569~^~core~^~The spec valid usage text states 'If count stored in countBuffer is greater than 1, (stride {times} (drawCount - 1) + offset + sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-00569)~^~ -VALIDATION_ERROR_1a800474~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-drawCount-00570~^~core~^~The spec valid usage text states 'drawCount must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-drawCount-00570)~^~ -VALIDATION_ERROR_1a800476~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00571~^~core~^~The spec valid usage text states 'Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00571)~^~ -VALIDATION_ERROR_1a800478~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00572~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00572)~^~ -VALIDATION_ERROR_1a80047a~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00573~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00573)~^~ -VALIDATION_ERROR_1a80047c~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00574~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00574)~^~ -VALIDATION_ERROR_1a80047e~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00575~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00575)~^~ -VALIDATION_ERROR_1a800480~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00576~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00576)~^~ -VALIDATION_ERROR_1a800482~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-linearTilingFeatures-00577~^~core~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-linearTilingFeatures-00577)~^~ -VALIDATION_ERROR_1a800484~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-maxMultiviewInstanceIndex-00578~^~(VK_KHX_multiview)~^~The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewPropertiesKHX::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-maxMultiviewInstanceIndex-00578)~^~ -VALIDATION_ERROR_1a800bc0~^~N~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-01504~^~core~^~The spec valid usage text states 'Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-01504)~^~ -VALIDATION_ERROR_1a800bda~^~N~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-sampleLocationsEnable-01517~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If the currently bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-sampleLocationsEnable-01517)~^~ -VALIDATION_ERROR_1a800d04~^~N~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-01666~^~core~^~The spec valid usage text states 'If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-01666)~^~ -VALIDATION_ERROR_1a800d06~^~N~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-01667~^~core~^~The spec valid usage text states 'buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-01667)~^~ -VALIDATION_ERROR_1a800d08~^~N~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-01668~^~core~^~The spec valid usage text states 'If countBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-01668)~^~ -VALIDATION_ERROR_1a800d0a~^~N~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-01669~^~core~^~The spec valid usage text states 'countBuffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-01669)~^~ -VALIDATION_ERROR_1a801a01~^~Y~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-parameter~^~core~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-parameter)~^~implicit -VALIDATION_ERROR_1a802401~^~Y~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1a802413~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-recording)~^~implicit -VALIDATION_ERROR_1a802415~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_1a803401~^~Y~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-parameter~^~core~^~The spec valid usage text states 'countBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-parameter)~^~implicit +VALIDATION_ERROR_1a800009~^~Y~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-commonparent~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'Each of buffer, commandBuffer, and countBuffer must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commonparent)~^~implicit +VALIDATION_ERROR_1a800017~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-renderpass~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-renderpass)~^~implicit +VALIDATION_ERROR_1a800456~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-offset-00555~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'offset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-offset-00555)~^~ +VALIDATION_ERROR_1a800458~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-countBufferOffset-00556~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'countBufferOffset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBufferOffset-00556)~^~ +VALIDATION_ERROR_1a80045a~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-stride-00557~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawIndirectCommand)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-stride-00557)~^~ +VALIDATION_ERROR_1a80045c~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-maxDrawCount-00558~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If maxDrawCount is greater than or equal to 1, (stride {times} (maxDrawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-maxDrawCount-00558)~^~ +VALIDATION_ERROR_1a80045e~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-firstInstance-00559~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If the drawIndirectFirstInstance feature is not enabled, all the firstInstance members of the VkDrawIndexedIndirectCommand structures accessed by this command must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-firstInstance-00559)~^~ +VALIDATION_ERROR_1a800460~^~Y~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-renderPass-00560~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-renderPass-00560)~^~ +VALIDATION_ERROR_1a800462~^~Y~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-subpass-00561~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-subpass-00561)~^~ +VALIDATION_ERROR_1a800464~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00562~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00562)~^~ +VALIDATION_ERROR_1a800466~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00563~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00563)~^~ +VALIDATION_ERROR_1a800468~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00564~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00564)~^~ +VALIDATION_ERROR_1a80046a~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00565~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must have valid buffers bound' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00565)~^~ +VALIDATION_ERROR_1a80046c~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00566~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00566)~^~ +VALIDATION_ERROR_1a80046e~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00567~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00567)~^~ +VALIDATION_ERROR_1a800470~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-00568~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If count stored in countBuffer is equal to 1, (offset + sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-00568)~^~ +VALIDATION_ERROR_1a800472~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-00569~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If count stored in countBuffer is greater than 1, (stride {times} (drawCount - 1) + offset + sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-00569)~^~ +VALIDATION_ERROR_1a800474~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-drawCount-00570~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'drawCount must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-drawCount-00570)~^~ +VALIDATION_ERROR_1a800476~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00571~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00571)~^~ +VALIDATION_ERROR_1a800478~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00572~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00572)~^~ +VALIDATION_ERROR_1a80047a~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00573~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00573)~^~ +VALIDATION_ERROR_1a80047c~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00574~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00574)~^~ +VALIDATION_ERROR_1a80047e~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00575~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00575)~^~ +VALIDATION_ERROR_1a800480~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-00576~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00576)~^~ +VALIDATION_ERROR_1a800482~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-linearTilingFeatures-00577~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-linearTilingFeatures-00577)~^~ +VALIDATION_ERROR_1a800484~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-maxMultiviewInstanceIndex-00578~^~(VK_AMD_draw_indirect_count)+(VK_VERSION_1_1,VK_KHR_multiview)~^~The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-maxMultiviewInstanceIndex-00578)~^~ +VALIDATION_ERROR_1a800bc0~^~N~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-None-01504~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-01504)~^~ +VALIDATION_ERROR_1a800bda~^~N~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-sampleLocationsEnable-01517~^~(VK_AMD_draw_indirect_count)+(VK_EXT_sample_locations)~^~The spec valid usage text states 'If the bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-sampleLocationsEnable-01517)~^~ +VALIDATION_ERROR_1a800d04~^~N~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-01666~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-01666)~^~ +VALIDATION_ERROR_1a800d06~^~N~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-01667~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-01667)~^~ +VALIDATION_ERROR_1a800d08~^~N~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-01668~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If countBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-01668)~^~ +VALIDATION_ERROR_1a800d0a~^~N~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-01669~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'countBuffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-01669)~^~ +VALIDATION_ERROR_1a800e92~^~N~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-01865~^~(VK_AMD_draw_indirect_count)+(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-01865)~^~ +VALIDATION_ERROR_1a800e94~^~N~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-01866~^~(VK_AMD_draw_indirect_count)+(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-01866)~^~ +VALIDATION_ERROR_1a800e96~^~N~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-01867~^~(VK_AMD_draw_indirect_count)+(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-01867)~^~ +VALIDATION_ERROR_1a801a01~^~Y~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-parameter~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-parameter)~^~implicit +VALIDATION_ERROR_1a802401~^~Y~^~None~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-parameter~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-parameter)~^~implicit +VALIDATION_ERROR_1a802413~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-recording~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1a802415~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-cmdpool~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-cmdpool)~^~implicit +VALIDATION_ERROR_1a803401~^~Y~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-parameter~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'countBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-parameter)~^~implicit VALIDATION_ERROR_1aa00009~^~Y~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-commonparent~^~core~^~The spec valid usage text states 'Both of buffer, and commandBuffer must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-commonparent)~^~implicit VALIDATION_ERROR_1aa00017~^~Y~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-renderpass~^~core~^~The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-renderpass)~^~implicit VALIDATION_ERROR_1aa003b4~^~Y~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-buffer-00474~^~core~^~The spec valid usage text states 'If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-buffer-00474)~^~ @@ -2157,85 +2202,91 @@ VALIDATION_ERROR_1aa003b8~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-drawCount-00476~^~core~^~The spec valid usage text states 'If drawCount is greater than 1, stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawIndirectCommand)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-drawCount-00476)~^~ VALIDATION_ERROR_1aa003ba~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-drawCount-00477~^~core~^~The spec valid usage text states 'If the multi-draw indirect feature is not enabled, drawCount must be 0 or 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-drawCount-00477)~^~ VALIDATION_ERROR_1aa003bc~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-firstInstance-00478~^~core~^~The spec valid usage text states 'If the drawIndirectFirstInstance feature is not enabled, all the firstInstance members of the VkDrawIndirectCommand structures accessed by this command must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-firstInstance-00478)~^~ -VALIDATION_ERROR_1aa003be~^~Y~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-renderPass-00479~^~core~^~The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-renderPass-00479)~^~ -VALIDATION_ERROR_1aa003c0~^~Y~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-subpass-00480~^~core~^~The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-subpass-00480)~^~ -VALIDATION_ERROR_1aa003c2~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00481~^~core~^~The spec valid usage text states 'For each set n that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00481)~^~ -VALIDATION_ERROR_1aa003c4~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00482~^~core~^~The spec valid usage text states 'For each push constant that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00482)~^~ -VALIDATION_ERROR_1aa003c6~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00483~^~core~^~The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the currently bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00483)~^~ +VALIDATION_ERROR_1aa003be~^~Y~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-renderPass-00479~^~core~^~The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-renderPass-00479)~^~ +VALIDATION_ERROR_1aa003c0~^~Y~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-subpass-00480~^~core~^~The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-subpass-00480)~^~ +VALIDATION_ERROR_1aa003c2~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00481~^~core~^~The spec valid usage text states 'For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00481)~^~ +VALIDATION_ERROR_1aa003c4~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00482~^~core~^~The spec valid usage text states 'For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00482)~^~ +VALIDATION_ERROR_1aa003c6~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00483~^~core~^~The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00483)~^~ VALIDATION_ERROR_1aa003c8~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00484~^~core~^~The spec valid usage text states 'All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must have valid buffers bound' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00484)~^~ VALIDATION_ERROR_1aa003ca~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00485~^~core~^~The spec valid usage text states 'A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00485)~^~ -VALIDATION_ERROR_1aa003cc~^~Y~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00486~^~core~^~The spec valid usage text states 'If the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00486)~^~ +VALIDATION_ERROR_1aa003cc~^~Y~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00486~^~core~^~The spec valid usage text states 'If the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00486)~^~ VALIDATION_ERROR_1aa003ce~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-drawCount-00487~^~core~^~The spec valid usage text states 'If drawCount is equal to 1, (offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-drawCount-00487)~^~ VALIDATION_ERROR_1aa003d0~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-drawCount-00488~^~core~^~The spec valid usage text states 'If drawCount is greater than 1, (stride {times} (drawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-drawCount-00488)~^~ VALIDATION_ERROR_1aa003d2~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-drawCount-00489~^~core~^~The spec valid usage text states 'drawCount must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-drawCount-00489)~^~ VALIDATION_ERROR_1aa003d4~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00490~^~core~^~The spec valid usage text states 'Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00490)~^~ -VALIDATION_ERROR_1aa003d6~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00491~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00491)~^~ -VALIDATION_ERROR_1aa003d8~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00492~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00492)~^~ -VALIDATION_ERROR_1aa003da~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00493~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00493)~^~ -VALIDATION_ERROR_1aa003dc~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00494~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00494)~^~ -VALIDATION_ERROR_1aa003de~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00495~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00495)~^~ +VALIDATION_ERROR_1aa003d6~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00491~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00491)~^~ +VALIDATION_ERROR_1aa003d8~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00492~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00492)~^~ +VALIDATION_ERROR_1aa003da~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00493~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00493)~^~ +VALIDATION_ERROR_1aa003dc~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00494~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00494)~^~ +VALIDATION_ERROR_1aa003de~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00495~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00495)~^~ VALIDATION_ERROR_1aa003e0~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-linearTilingFeatures-00496~^~core~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-linearTilingFeatures-00496)~^~ VALIDATION_ERROR_1aa003e2~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-linearTilingFeatures-00497~^~(VK_IMG_filter_cubic)~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirect-linearTilingFeatures-00497)~^~ VALIDATION_ERROR_1aa003e4~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-00498~^~(VK_IMG_filter_cubic)~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must not have a VkImageViewType of VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00498)~^~ -VALIDATION_ERROR_1aa003e6~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-maxMultiviewInstanceIndex-00499~^~(VK_KHX_multiview)~^~The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewPropertiesKHX::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirect-maxMultiviewInstanceIndex-00499)~^~ +VALIDATION_ERROR_1aa003e6~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-maxMultiviewInstanceIndex-00499~^~(VK_VERSION_1_1,VK_KHR_multiview)~^~The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirect-maxMultiviewInstanceIndex-00499)~^~ VALIDATION_ERROR_1aa00bba~^~N~^~None~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-None-01501~^~core~^~The spec valid usage text states 'Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-01501)~^~ -VALIDATION_ERROR_1aa00bd4~^~N~^~None~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-sampleLocationsEnable-01514~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If the currently bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirect-sampleLocationsEnable-01514)~^~ +VALIDATION_ERROR_1aa00bd4~^~N~^~None~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-sampleLocationsEnable-01514~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If the bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirect-sampleLocationsEnable-01514)~^~ VALIDATION_ERROR_1aa00cf8~^~N~^~None~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-buffer-01660~^~core~^~The spec valid usage text states 'buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-buffer-01660)~^~ +VALIDATION_ERROR_1aa00e80~^~N~^~None~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-commandBuffer-01856~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirect-commandBuffer-01856)~^~ +VALIDATION_ERROR_1aa00e82~^~N~^~None~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-commandBuffer-01857~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirect-commandBuffer-01857)~^~ +VALIDATION_ERROR_1aa00e84~^~N~^~None~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-commandBuffer-01858~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirect-commandBuffer-01858)~^~ VALIDATION_ERROR_1aa01a01~^~Y~^~None~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-buffer-parameter~^~core~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-buffer-parameter)~^~implicit VALIDATION_ERROR_1aa02401~^~Y~^~None~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1aa02413~^~N~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1aa02413~^~Y~^~None~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1aa02415~^~Y~^~Unknown~^~vkCmdDrawIndirect~^~VUID-vkCmdDrawIndirect-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_1ac00009~^~Y~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-commonparent~^~core~^~The spec valid usage text states 'Each of buffer, commandBuffer, and countBuffer must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commonparent)~^~implicit -VALIDATION_ERROR_1ac00017~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-renderpass~^~core~^~The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-renderpass)~^~implicit -VALIDATION_ERROR_1ac003ec~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-offset-00502~^~core~^~The spec valid usage text states 'offset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-offset-00502)~^~ -VALIDATION_ERROR_1ac003ee~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-countBufferOffset-00503~^~core~^~The spec valid usage text states 'countBufferOffset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBufferOffset-00503)~^~ -VALIDATION_ERROR_1ac003f0~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-stride-00504~^~core~^~The spec valid usage text states 'stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawIndirectCommand)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-stride-00504)~^~ -VALIDATION_ERROR_1ac003f2~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-maxDrawCount-00505~^~core~^~The spec valid usage text states 'If maxDrawCount is greater than or equal to 1, (stride {times} (maxDrawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-maxDrawCount-00505)~^~ -VALIDATION_ERROR_1ac003f4~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-firstInstance-00506~^~core~^~The spec valid usage text states 'If the drawIndirectFirstInstance feature is not enabled, all the firstInstance members of the VkDrawIndirectCommand structures accessed by this command must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-firstInstance-00506)~^~ -VALIDATION_ERROR_1ac003f6~^~Y~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-renderPass-00507~^~core~^~The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-renderPass-00507)~^~ -VALIDATION_ERROR_1ac003f8~^~Y~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-subpass-00508~^~core~^~The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-subpass-00508)~^~ -VALIDATION_ERROR_1ac003fa~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00509~^~core~^~The spec valid usage text states 'For each set n that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00509)~^~ -VALIDATION_ERROR_1ac003fc~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00510~^~core~^~The spec valid usage text states 'For each push constant that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00510)~^~ -VALIDATION_ERROR_1ac003fe~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00511~^~core~^~The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the currently bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00511)~^~ -VALIDATION_ERROR_1ac00400~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00512~^~core~^~The spec valid usage text states 'All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must have valid buffers bound' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00512)~^~ -VALIDATION_ERROR_1ac00402~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00513~^~core~^~The spec valid usage text states 'A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00513)~^~ -VALIDATION_ERROR_1ac00404~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00514~^~core~^~The spec valid usage text states 'If the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00514)~^~ -VALIDATION_ERROR_1ac00406~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-countBuffer-00515~^~core~^~The spec valid usage text states 'If the count stored in countBuffer is equal to 1, (offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-00515)~^~ -VALIDATION_ERROR_1ac00408~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-countBuffer-00516~^~core~^~The spec valid usage text states 'If the count stored in countBuffer is greater than 1, (stride {times} (drawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-00516)~^~ -VALIDATION_ERROR_1ac0040a~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-countBuffer-00517~^~core~^~The spec valid usage text states 'The count stored in countBuffer must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-00517)~^~ -VALIDATION_ERROR_1ac0040c~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00518~^~core~^~The spec valid usage text states 'Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00518)~^~ -VALIDATION_ERROR_1ac0040e~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00519~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00519)~^~ -VALIDATION_ERROR_1ac00410~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00520~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00520)~^~ -VALIDATION_ERROR_1ac00412~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00521~^~core~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00521)~^~ -VALIDATION_ERROR_1ac00414~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00522~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00522)~^~ -VALIDATION_ERROR_1ac00416~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00523~^~core~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00523)~^~ -VALIDATION_ERROR_1ac00418~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-linearTilingFeatures-00524~^~core~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-linearTilingFeatures-00524)~^~ -VALIDATION_ERROR_1ac0041a~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-maxMultiviewInstanceIndex-00525~^~(VK_KHX_multiview)~^~The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewPropertiesKHX::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-maxMultiviewInstanceIndex-00525)~^~ -VALIDATION_ERROR_1ac00bbc~^~N~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-01502~^~core~^~The spec valid usage text states 'Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-01502)~^~ -VALIDATION_ERROR_1ac00bd6~^~N~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-sampleLocationsEnable-01515~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If the currently bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-sampleLocationsEnable-01515)~^~ -VALIDATION_ERROR_1ac00cfa~^~N~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-buffer-01661~^~core~^~The spec valid usage text states 'If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-buffer-01661)~^~ -VALIDATION_ERROR_1ac00cfc~^~N~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-buffer-01662~^~core~^~The spec valid usage text states 'buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-buffer-01662)~^~ -VALIDATION_ERROR_1ac00cfe~^~N~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-countBuffer-01663~^~core~^~The spec valid usage text states 'If countBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-01663)~^~ -VALIDATION_ERROR_1ac00d00~^~N~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-countBuffer-01664~^~core~^~The spec valid usage text states 'countBuffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-01664)~^~ -VALIDATION_ERROR_1ac01a01~^~Y~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-buffer-parameter~^~core~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-buffer-parameter)~^~implicit -VALIDATION_ERROR_1ac02401~^~Y~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1ac02413~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commandBuffer-recording)~^~implicit -VALIDATION_ERROR_1ac02415~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_1ac03401~^~Y~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-countBuffer-parameter~^~core~^~The spec valid usage text states 'countBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-parameter)~^~implicit +VALIDATION_ERROR_1ac00009~^~Y~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-commonparent~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'Each of buffer, commandBuffer, and countBuffer must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commonparent)~^~implicit +VALIDATION_ERROR_1ac00017~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-renderpass~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-renderpass)~^~implicit +VALIDATION_ERROR_1ac003ec~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-offset-00502~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'offset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-offset-00502)~^~ +VALIDATION_ERROR_1ac003ee~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-countBufferOffset-00503~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'countBufferOffset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBufferOffset-00503)~^~ +VALIDATION_ERROR_1ac003f0~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-stride-00504~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawIndirectCommand)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-stride-00504)~^~ +VALIDATION_ERROR_1ac003f2~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-maxDrawCount-00505~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If maxDrawCount is greater than or equal to 1, (stride {times} (maxDrawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-maxDrawCount-00505)~^~ +VALIDATION_ERROR_1ac003f4~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-firstInstance-00506~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If the drawIndirectFirstInstance feature is not enabled, all the firstInstance members of the VkDrawIndirectCommand structures accessed by this command must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-firstInstance-00506)~^~ +VALIDATION_ERROR_1ac003f6~^~Y~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-renderPass-00507~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-renderPass-00507)~^~ +VALIDATION_ERROR_1ac003f8~^~Y~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-subpass-00508~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-subpass-00508)~^~ +VALIDATION_ERROR_1ac003fa~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00509~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00509)~^~ +VALIDATION_ERROR_1ac003fc~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00510~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00510)~^~ +VALIDATION_ERROR_1ac003fe~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00511~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00511)~^~ +VALIDATION_ERROR_1ac00400~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00512~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must have valid buffers bound' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00512)~^~ +VALIDATION_ERROR_1ac00402~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00513~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00513)~^~ +VALIDATION_ERROR_1ac00404~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00514~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00514)~^~ +VALIDATION_ERROR_1ac00406~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-countBuffer-00515~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If the count stored in countBuffer is equal to 1, (offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-00515)~^~ +VALIDATION_ERROR_1ac00408~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-countBuffer-00516~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If the count stored in countBuffer is greater than 1, (stride {times} (drawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-00516)~^~ +VALIDATION_ERROR_1ac0040a~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-countBuffer-00517~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'The count stored in countBuffer must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-00517)~^~ +VALIDATION_ERROR_1ac0040c~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00518~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00518)~^~ +VALIDATION_ERROR_1ac0040e~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00519~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00519)~^~ +VALIDATION_ERROR_1ac00410~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00520~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00520)~^~ +VALIDATION_ERROR_1ac00412~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00521~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00521)~^~ +VALIDATION_ERROR_1ac00414~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00522~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00522)~^~ +VALIDATION_ERROR_1ac00416~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-00523~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00523)~^~ +VALIDATION_ERROR_1ac00418~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-linearTilingFeatures-00524~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-linearTilingFeatures-00524)~^~ +VALIDATION_ERROR_1ac0041a~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-maxMultiviewInstanceIndex-00525~^~(VK_AMD_draw_indirect_count)+(VK_VERSION_1_1,VK_KHR_multiview)~^~The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-maxMultiviewInstanceIndex-00525)~^~ +VALIDATION_ERROR_1ac00bbc~^~N~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-None-01502~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-01502)~^~ +VALIDATION_ERROR_1ac00bd6~^~N~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-sampleLocationsEnable-01515~^~(VK_AMD_draw_indirect_count)+(VK_EXT_sample_locations)~^~The spec valid usage text states 'If the bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-sampleLocationsEnable-01515)~^~ +VALIDATION_ERROR_1ac00cfa~^~N~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-buffer-01661~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-buffer-01661)~^~ +VALIDATION_ERROR_1ac00cfc~^~N~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-buffer-01662~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-buffer-01662)~^~ +VALIDATION_ERROR_1ac00cfe~^~N~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-countBuffer-01663~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'If countBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-01663)~^~ +VALIDATION_ERROR_1ac00d00~^~N~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-countBuffer-01664~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'countBuffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-01664)~^~ +VALIDATION_ERROR_1ac00e86~^~N~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-commandBuffer-01859~^~(VK_AMD_draw_indirect_count)+(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commandBuffer-01859)~^~ +VALIDATION_ERROR_1ac00e88~^~N~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-commandBuffer-01860~^~(VK_AMD_draw_indirect_count)+(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commandBuffer-01860)~^~ +VALIDATION_ERROR_1ac00e8a~^~N~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-commandBuffer-01861~^~(VK_AMD_draw_indirect_count)+(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commandBuffer-01861)~^~ +VALIDATION_ERROR_1ac01a01~^~Y~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-buffer-parameter~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-buffer-parameter)~^~implicit +VALIDATION_ERROR_1ac02401~^~Y~^~None~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-commandBuffer-parameter~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commandBuffer-parameter)~^~implicit +VALIDATION_ERROR_1ac02413~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-commandBuffer-recording~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1ac02415~^~N~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-commandBuffer-cmdpool~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commandBuffer-cmdpool)~^~implicit +VALIDATION_ERROR_1ac03401~^~Y~^~Unknown~^~vkCmdDrawIndirectCountAMD~^~VUID-vkCmdDrawIndirectCountAMD-countBuffer-parameter~^~(VK_AMD_draw_indirect_count)~^~The spec valid usage text states 'countBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-parameter)~^~implicit VALIDATION_ERROR_1ae00009~^~Y~^~Unknown~^~vkCmdEndQuery~^~VUID-vkCmdEndQuery-commonparent~^~core~^~The spec valid usage text states 'Both of commandBuffer, and queryPool must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndQuery-commonparent)~^~implicit -VALIDATION_ERROR_1ae00652~^~Y~^~Unknown~^~vkCmdEndQuery~^~VUID-vkCmdEndQuery-queryPool-00809~^~core~^~The spec valid usage text states 'The query identified by queryPool and query must currently be active' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndQuery-queryPool-00809)~^~ VALIDATION_ERROR_1ae00654~^~N~^~Unknown~^~vkCmdEndQuery~^~VUID-vkCmdEndQuery-query-00810~^~core~^~The spec valid usage text states 'query must be less than the number of queries in queryPool' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndQuery-query-00810)~^~ -VALIDATION_ERROR_1ae00656~^~N~^~Unknown~^~vkCmdEndQuery~^~VUID-vkCmdEndQuery-None-00811~^~(VK_KHX_multiview)~^~The spec valid usage text states 'All queries used by the command must be active' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdEndQuery-None-00811)~^~ -VALIDATION_ERROR_1ae00658~^~N~^~Unknown~^~vkCmdEndQuery~^~VUID-vkCmdEndQuery-query-00812~^~(VK_KHX_multiview)~^~The spec valid usage text states 'If vkCmdEndQuery is called within a render pass instance, the sum of query and the number of bits set in the current subpass's view mask must be less than or equal to the number of queries in queryPool' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdEndQuery-query-00812)~^~ +VALIDATION_ERROR_1ae00658~^~N~^~Unknown~^~vkCmdEndQuery~^~VUID-vkCmdEndQuery-query-00812~^~(VK_VERSION_1_1,VK_KHR_multiview)~^~The spec valid usage text states 'If vkCmdEndQuery is called within a render pass instance, the sum of query and the number of bits set in the current subpass's view mask must be less than or equal to the number of queries in queryPool' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdEndQuery-query-00812)~^~ +VALIDATION_ERROR_1ae00ebc~^~N~^~None~^~vkCmdEndQuery~^~VUID-vkCmdEndQuery-commandBuffer-01886~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'commandBuffer must not be a protected command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdEndQuery-commandBuffer-01886)~^~ +VALIDATION_ERROR_1ae00f06~^~Y~^~None~^~vkCmdEndQuery~^~VUID-vkCmdEndQuery-None-01923~^~core~^~The spec valid usage text states 'All queries used by the command must be active' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndQuery-None-01923)~^~ VALIDATION_ERROR_1ae02401~^~Y~^~None~^~vkCmdEndQuery~^~VUID-vkCmdEndQuery-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndQuery-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1ae02413~^~N~^~Unknown~^~vkCmdEndQuery~^~VUID-vkCmdEndQuery-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndQuery-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1ae02413~^~Y~^~None~^~vkCmdEndQuery~^~VUID-vkCmdEndQuery-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndQuery-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1ae02415~^~Y~^~Unknown~^~vkCmdEndQuery~^~VUID-vkCmdEndQuery-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndQuery-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1ae29801~^~Y~^~None~^~vkCmdEndQuery~^~VUID-vkCmdEndQuery-queryPool-parameter~^~core~^~The spec valid usage text states 'queryPool must be a valid VkQueryPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndQuery-queryPool-parameter)~^~implicit VALIDATION_ERROR_1b000017~^~Y~^~Unknown~^~vkCmdEndRenderPass~^~VUID-vkCmdEndRenderPass-renderpass~^~core~^~The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndRenderPass-renderpass)~^~implicit VALIDATION_ERROR_1b000019~^~Y~^~Unknown~^~vkCmdEndRenderPass~^~VUID-vkCmdEndRenderPass-bufferlevel~^~core~^~The spec valid usage text states 'commandBuffer must be a primary VkCommandBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndRenderPass-bufferlevel)~^~implicit VALIDATION_ERROR_1b00071c~^~Y~^~Unknown~^~vkCmdEndRenderPass~^~VUID-vkCmdEndRenderPass-None-00910~^~core~^~The spec valid usage text states 'The current subpass index must be equal to the number of subpasses in the render pass minus one' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndRenderPass-None-00910)~^~ VALIDATION_ERROR_1b002401~^~Y~^~None~^~vkCmdEndRenderPass~^~VUID-vkCmdEndRenderPass-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndRenderPass-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1b002413~^~N~^~Unknown~^~vkCmdEndRenderPass~^~VUID-vkCmdEndRenderPass-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndRenderPass-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1b002413~^~Y~^~None~^~vkCmdEndRenderPass~^~VUID-vkCmdEndRenderPass-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndRenderPass-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1b002415~^~Y~^~Unknown~^~vkCmdEndRenderPass~^~VUID-vkCmdEndRenderPass-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndRenderPass-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1b200009~^~Y~^~Unknown~^~vkCmdExecuteCommands~^~VUID-vkCmdExecuteCommands-commonparent~^~core~^~The spec valid usage text states 'Both of commandBuffer, and the elements of pCommandBuffers must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdExecuteCommands-commonparent)~^~implicit VALIDATION_ERROR_1b200019~^~Y~^~Unknown~^~vkCmdExecuteCommands~^~VUID-vkCmdExecuteCommands-bufferlevel~^~core~^~The spec valid usage text states 'commandBuffer must be a primary VkCommandBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdExecuteCommands-bufferlevel)~^~implicit @@ -2258,8 +2309,10 @@ VALIDATION_ERROR_1b2000ce~^~N~^~Unknown~^~vkCmdExecuteCommands~^~VUID-vkCmdExecuteCommands-commandBuffer-00103~^~core~^~The spec valid usage text states 'If commandBuffer has a VK_QUERY_TYPE_OCCLUSION query active, then each element of pCommandBuffers must have been recorded with VkCommandBufferInheritanceInfo::queryFlags having all bits set that are set for the query' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdExecuteCommands-commandBuffer-00103)~^~ VALIDATION_ERROR_1b2000d0~^~Y~^~Unknown~^~vkCmdExecuteCommands~^~VUID-vkCmdExecuteCommands-commandBuffer-00104~^~core~^~The spec valid usage text states 'If commandBuffer has a VK_QUERY_TYPE_PIPELINE_STATISTICS query active, then each element of pCommandBuffers must have been recorded with VkCommandBufferInheritanceInfo::pipelineStatistics having all bits set that are set in the VkQueryPool the query uses' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdExecuteCommands-commandBuffer-00104)~^~ VALIDATION_ERROR_1b2000d2~^~N~^~Unknown~^~vkCmdExecuteCommands~^~VUID-vkCmdExecuteCommands-pCommandBuffers-00105~^~core~^~The spec valid usage text states 'Each element of pCommandBuffers must not begin any query types that are active in commandBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdExecuteCommands-pCommandBuffers-00105)~^~ +VALIDATION_ERROR_1b200e38~^~N~^~None~^~vkCmdExecuteCommands~^~VUID-vkCmdExecuteCommands-commandBuffer-01820~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, then each element of pCommandBuffers must be a protected command buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdExecuteCommands-commandBuffer-01820)~^~ +VALIDATION_ERROR_1b200e3a~^~N~^~None~^~vkCmdExecuteCommands~^~VUID-vkCmdExecuteCommands-commandBuffer-01821~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then each element of pCommandBuffers must be an unprotected command buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdExecuteCommands-commandBuffer-01821)~^~ VALIDATION_ERROR_1b202401~^~Y~^~None~^~vkCmdExecuteCommands~^~VUID-vkCmdExecuteCommands-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdExecuteCommands-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1b202413~^~N~^~Unknown~^~vkCmdExecuteCommands~^~VUID-vkCmdExecuteCommands-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdExecuteCommands-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1b202413~^~Y~^~None~^~vkCmdExecuteCommands~^~VUID-vkCmdExecuteCommands-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdExecuteCommands-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1b202415~^~Y~^~Unknown~^~vkCmdExecuteCommands~^~VUID-vkCmdExecuteCommands-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdExecuteCommands-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1b20261b~^~N~^~Unknown~^~vkCmdExecuteCommands~^~VUID-vkCmdExecuteCommands-commandBufferCount-arraylength~^~core~^~The spec valid usage text states 'commandBufferCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdExecuteCommands-commandBufferCount-arraylength)~^~implicit VALIDATION_ERROR_1b211401~^~Y~^~None~^~vkCmdExecuteCommands~^~VUID-vkCmdExecuteCommands-pCommandBuffers-parameter~^~core~^~The spec valid usage text states 'pCommandBuffers must be a valid pointer to an array of commandBufferCount valid VkCommandBuffer handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdExecuteCommands-pCommandBuffers-parameter)~^~implicit @@ -2271,17 +2324,19 @@ VALIDATION_ERROR_1b400036~^~N~^~Unknown~^~vkCmdFillBuffer~^~VUID-vkCmdFillBuffer-size-00027~^~core~^~The spec valid usage text states 'If size is not equal to VK_WHOLE_SIZE, size must be less than or equal to the size of dstBuffer minus dstOffset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdFillBuffer-size-00027)~^~ VALIDATION_ERROR_1b400038~^~Y~^~Unknown~^~vkCmdFillBuffer~^~VUID-vkCmdFillBuffer-size-00028~^~core~^~The spec valid usage text states 'If size is not equal to VK_WHOLE_SIZE, size must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdFillBuffer-size-00028)~^~ VALIDATION_ERROR_1b40003a~^~Y~^~None~^~vkCmdFillBuffer~^~VUID-vkCmdFillBuffer-dstBuffer-00029~^~core~^~The spec valid usage text states 'dstBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_DST_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdFillBuffer-dstBuffer-00029)~^~ -VALIDATION_ERROR_1b40003c~^~N~^~None~^~vkCmdFillBuffer~^~VUID-vkCmdFillBuffer-commandBuffer-00030~^~!(VK_KHR_maintenance1)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdFillBuffer-commandBuffer-00030)~^~ +VALIDATION_ERROR_1b40003c~^~N~^~None~^~vkCmdFillBuffer~^~VUID-vkCmdFillBuffer-commandBuffer-00030~^~!(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdFillBuffer-commandBuffer-00030)~^~ VALIDATION_ERROR_1b40003e~^~Y~^~Unknown~^~vkCmdFillBuffer~^~VUID-vkCmdFillBuffer-dstBuffer-00031~^~core~^~The spec valid usage text states 'If dstBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdFillBuffer-dstBuffer-00031)~^~ +VALIDATION_ERROR_1b400e26~^~N~^~None~^~vkCmdFillBuffer~^~VUID-vkCmdFillBuffer-commandBuffer-01811~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstBuffer must not be a protected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdFillBuffer-commandBuffer-01811)~^~ +VALIDATION_ERROR_1b400e28~^~N~^~None~^~vkCmdFillBuffer~^~VUID-vkCmdFillBuffer-commandBuffer-01812~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstBuffer must not be an unprotected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdFillBuffer-commandBuffer-01812)~^~ VALIDATION_ERROR_1b402401~^~Y~^~None~^~vkCmdFillBuffer~^~VUID-vkCmdFillBuffer-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdFillBuffer-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1b402413~^~N~^~Unknown~^~vkCmdFillBuffer~^~VUID-vkCmdFillBuffer-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdFillBuffer-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1b402413~^~Y~^~None~^~vkCmdFillBuffer~^~VUID-vkCmdFillBuffer-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdFillBuffer-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1b402415~^~Y~^~Unknown~^~vkCmdFillBuffer~^~VUID-vkCmdFillBuffer-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdFillBuffer-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1b406c01~^~Y~^~None~^~vkCmdFillBuffer~^~VUID-vkCmdFillBuffer-dstBuffer-parameter~^~core~^~The spec valid usage text states 'dstBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdFillBuffer-dstBuffer-parameter)~^~implicit VALIDATION_ERROR_1b600017~^~Y~^~Unknown~^~vkCmdNextSubpass~^~VUID-vkCmdNextSubpass-renderpass~^~core~^~The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdNextSubpass-renderpass)~^~implicit VALIDATION_ERROR_1b600019~^~Y~^~Unknown~^~vkCmdNextSubpass~^~VUID-vkCmdNextSubpass-bufferlevel~^~core~^~The spec valid usage text states 'commandBuffer must be a primary VkCommandBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdNextSubpass-bufferlevel)~^~implicit VALIDATION_ERROR_1b60071a~^~Y~^~Unknown~^~vkCmdNextSubpass~^~VUID-vkCmdNextSubpass-None-00909~^~core~^~The spec valid usage text states 'The current subpass index must be less than the number of subpasses in the render pass minus one' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdNextSubpass-None-00909)~^~ VALIDATION_ERROR_1b602401~^~Y~^~None~^~vkCmdNextSubpass~^~VUID-vkCmdNextSubpass-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdNextSubpass-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1b602413~^~N~^~Unknown~^~vkCmdNextSubpass~^~VUID-vkCmdNextSubpass-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdNextSubpass-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1b602413~^~Y~^~None~^~vkCmdNextSubpass~^~VUID-vkCmdNextSubpass-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdNextSubpass-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1b602415~^~Y~^~Unknown~^~vkCmdNextSubpass~^~VUID-vkCmdNextSubpass-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdNextSubpass-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1b603201~^~Y~^~Unknown~^~vkCmdNextSubpass~^~VUID-vkCmdNextSubpass-contents-parameter~^~core~^~The spec valid usage text states 'contents must be a valid VkSubpassContents value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdNextSubpass-contents-parameter)~^~implicit VALIDATION_ERROR_1b800920~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-srcStageMask-01168~^~core~^~The spec valid usage text states 'If the geometry shaders feature is not enabled, srcStageMask must not contain VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-srcStageMask-01168)~^~ @@ -2302,9 +2357,9 @@ VALIDATION_ERROR_1b80093e~^~Y~^~InvalidBarriers~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-srcStageMask-01183~^~core~^~The spec valid usage text states 'Any pipeline stage included in srcStageMask or dstStageMask must be supported by the capabilities of the queue family specified by the queueFamilyIndex member of the VkCommandPoolCreateInfo structure that was used to create the VkCommandPool that commandBuffer was allocated from, as specified in the table of supported pipeline stages.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-srcStageMask-01183)~^~ VALIDATION_ERROR_1b800940~^~Y~^~InvalidBarriers~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-pMemoryBarriers-01184~^~core~^~The spec valid usage text states 'Each element of pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers must not have any access flag included in its srcAccessMask member if that bit is not supported by any of the pipeline stages in srcStageMask, as specified in the table of supported access types.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-pMemoryBarriers-01184)~^~ VALIDATION_ERROR_1b800942~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-pMemoryBarriers-01185~^~core~^~The spec valid usage text states 'Each element of pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers must not have any access flag included in its dstAccessMask member if that bit is not supported by any of the pipeline stages in dstStageMask, as specified in the table of supported access types.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-pMemoryBarriers-01185)~^~ -VALIDATION_ERROR_1b800944~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-dependencyFlags-01186~^~(VK_KHX_multiview)~^~The spec valid usage text states 'If vkCmdPipelineBarrier is called outside of a render pass instance, dependencyFlags must not include VK_DEPENDENCY_VIEW_LOCAL_BIT_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPipelineBarrier-dependencyFlags-01186)~^~ +VALIDATION_ERROR_1b800944~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-dependencyFlags-01186~^~(VK_VERSION_1_1,VK_KHR_multiview)~^~The spec valid usage text states 'If vkCmdPipelineBarrier is called outside of a render pass instance, dependencyFlags must not include VK_DEPENDENCY_VIEW_LOCAL_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPipelineBarrier-dependencyFlags-01186)~^~ VALIDATION_ERROR_1b802401~^~Y~^~None~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1b802413~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1b802413~^~Y~^~None~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1b802415~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1b803e01~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-dependencyFlags-parameter~^~core~^~The spec valid usage text states 'dependencyFlags must be a valid combination of VkDependencyFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-dependencyFlags-parameter)~^~implicit VALIDATION_ERROR_1b807801~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-dstStageMask-parameter~^~core~^~The spec valid usage text states 'dstStageMask must be a valid combination of VkPipelineStageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-dstStageMask-parameter)~^~implicit @@ -2314,62 +2369,62 @@ VALIDATION_ERROR_1b81ac01~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-pMemoryBarriers-parameter~^~core~^~The spec valid usage text states 'If memoryBarrierCount is not 0, pMemoryBarriers must be a valid pointer to an array of memoryBarrierCount valid VkMemoryBarrier structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-pMemoryBarriers-parameter)~^~implicit VALIDATION_ERROR_1b82d401~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-srcStageMask-parameter~^~core~^~The spec valid usage text states 'srcStageMask must be a valid combination of VkPipelineStageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-srcStageMask-parameter)~^~implicit VALIDATION_ERROR_1b82d403~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-srcStageMask-requiredbitmask~^~core~^~The spec valid usage text states 'srcStageMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-srcStageMask-requiredbitmask)~^~implicit -VALIDATION_ERROR_1ba00017~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-vkCmdProcessCommandsNVX-renderpass~^~core~^~The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-renderpass)~^~implicit -VALIDATION_ERROR_1ba02401~^~Y~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-vkCmdProcessCommandsNVX-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1ba02413~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-vkCmdProcessCommandsNVX-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-commandBuffer-recording)~^~implicit -VALIDATION_ERROR_1ba02415~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-vkCmdProcessCommandsNVX-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_1ba1f201~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-vkCmdProcessCommandsNVX-pProcessCommandsInfo-parameter~^~core~^~The spec valid usage text states 'pProcessCommandsInfo must be a valid pointer to a valid VkCmdProcessCommandsInfoNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-pProcessCommandsInfo-parameter)~^~implicit +VALIDATION_ERROR_1ba00017~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-vkCmdProcessCommandsNVX-renderpass~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-renderpass)~^~implicit +VALIDATION_ERROR_1ba02401~^~Y~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-vkCmdProcessCommandsNVX-commandBuffer-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-commandBuffer-parameter)~^~implicit +VALIDATION_ERROR_1ba02413~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-vkCmdProcessCommandsNVX-commandBuffer-recording~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1ba02415~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-vkCmdProcessCommandsNVX-commandBuffer-cmdpool~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-commandBuffer-cmdpool)~^~implicit +VALIDATION_ERROR_1ba1f201~^~N~^~Unknown~^~vkCmdProcessCommandsNVX~^~VUID-vkCmdProcessCommandsNVX-pProcessCommandsInfo-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'pProcessCommandsInfo must be a valid pointer to a valid VkCmdProcessCommandsInfoNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-pProcessCommandsInfo-parameter)~^~implicit VALIDATION_ERROR_1bc00009~^~Y~^~Unknown~^~vkCmdPushConstants~^~VUID-vkCmdPushConstants-commonparent~^~core~^~The spec valid usage text states 'Both of commandBuffer, and layout must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-commonparent)~^~implicit -VALIDATION_ERROR_1bc002de~^~Y~^~InvalidPushConstants~^~vkCmdPushConstants~^~VUID-vkCmdPushConstants-stageFlags-00367~^~core~^~The spec valid usage text states 'stageFlags must match exactly the shader stages used in layout for the range specified by offset and size' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-stageFlags-00367)~^~ VALIDATION_ERROR_1bc002e0~^~Y~^~Unknown~^~vkCmdPushConstants~^~VUID-vkCmdPushConstants-offset-00368~^~core~^~The spec valid usage text states 'offset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-offset-00368)~^~ VALIDATION_ERROR_1bc002e2~^~Y~^~Unknown~^~vkCmdPushConstants~^~VUID-vkCmdPushConstants-size-00369~^~core~^~The spec valid usage text states 'size must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-size-00369)~^~ VALIDATION_ERROR_1bc002e4~^~Y~^~Unknown~^~vkCmdPushConstants~^~VUID-vkCmdPushConstants-offset-00370~^~core~^~The spec valid usage text states 'offset must be less than VkPhysicalDeviceLimits::maxPushConstantsSize' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-offset-00370)~^~ VALIDATION_ERROR_1bc002e6~^~Y~^~Unknown~^~vkCmdPushConstants~^~VUID-vkCmdPushConstants-size-00371~^~core~^~The spec valid usage text states 'size must be less than or equal to VkPhysicalDeviceLimits::maxPushConstantsSize minus offset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-size-00371)~^~ +VALIDATION_ERROR_1bc00e06~^~Y~^~InvalidPushConstants~^~vkCmdPushConstants~^~VUID-vkCmdPushConstants-offset-01795~^~core~^~The spec valid usage text states 'For each byte in the range specified by offset and size and for each shader stage in stageFlags, there must be a push constant range in layout that includes that byte and that stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-offset-01795)~^~ +VALIDATION_ERROR_1bc00e08~^~Y~^~InvalidPushConstants~^~vkCmdPushConstants~^~VUID-vkCmdPushConstants-offset-01796~^~core~^~The spec valid usage text states 'For each byte in the range specified by offset and size and for each push constant range that overlaps that byte, stageFlags must include all stages in that push constant range's VkPushConstantRange::stageFlags' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-offset-01796)~^~ VALIDATION_ERROR_1bc02401~^~Y~^~None~^~vkCmdPushConstants~^~VUID-vkCmdPushConstants-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1bc02413~^~N~^~Unknown~^~vkCmdPushConstants~^~VUID-vkCmdPushConstants-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1bc02413~^~Y~^~None~^~vkCmdPushConstants~^~VUID-vkCmdPushConstants-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1bc02415~^~Y~^~Unknown~^~vkCmdPushConstants~^~VUID-vkCmdPushConstants-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1bc0be01~^~Y~^~None~^~vkCmdPushConstants~^~VUID-vkCmdPushConstants-layout-parameter~^~core~^~The spec valid usage text states 'layout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-layout-parameter)~^~implicit VALIDATION_ERROR_1bc26201~^~Y~^~Unknown~^~vkCmdPushConstants~^~VUID-vkCmdPushConstants-pValues-parameter~^~core~^~The spec valid usage text states 'pValues must be a valid pointer to an array of size bytes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-pValues-parameter)~^~implicit VALIDATION_ERROR_1bc2c21b~^~Y~^~Unknown~^~vkCmdPushConstants~^~VUID-vkCmdPushConstants-size-arraylength~^~core~^~The spec valid usage text states 'size must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-size-arraylength)~^~implicit VALIDATION_ERROR_1bc2dc01~^~N~^~Unknown~^~vkCmdPushConstants~^~VUID-vkCmdPushConstants-stageFlags-parameter~^~core~^~The spec valid usage text states 'stageFlags must be a valid combination of VkShaderStageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-stageFlags-parameter)~^~implicit VALIDATION_ERROR_1bc2dc03~^~Y~^~Unknown~^~vkCmdPushConstants~^~VUID-vkCmdPushConstants-stageFlags-requiredbitmask~^~core~^~The spec valid usage text states 'stageFlags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-stageFlags-requiredbitmask)~^~implicit -VALIDATION_ERROR_1be00009~^~Y~^~Unknown~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-commonparent~^~core~^~The spec valid usage text states 'Both of commandBuffer, and layout must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-commonparent)~^~implicit -VALIDATION_ERROR_1be002d6~^~N~^~Unknown~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-00363~^~core~^~The spec valid usage text states 'pipelineBindPoint must be supported by the commandBuffer's parent VkCommandPool's queue family' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-00363)~^~ -VALIDATION_ERROR_1be002d8~^~N~^~Unknown~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-set-00364~^~core~^~The spec valid usage text states 'set must be less than VkPipelineLayoutCreateInfo::setLayoutCount provided when layout was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-set-00364)~^~ -VALIDATION_ERROR_1be002da~^~N~^~Unknown~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-set-00365~^~core~^~The spec valid usage text states 'set must be the unique set number in the pipeline layout that uses a descriptor set layout that was created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-set-00365)~^~ -VALIDATION_ERROR_1be02401~^~Y~^~Unknown~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1be02413~^~N~^~Unknown~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-commandBuffer-recording)~^~implicit -VALIDATION_ERROR_1be02415~^~N~^~Unknown~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_1be0541b~^~Y~^~Unknown~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-descriptorWriteCount-arraylength~^~core~^~The spec valid usage text states 'descriptorWriteCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-descriptorWriteCount-arraylength)~^~implicit -VALIDATION_ERROR_1be0be01~^~Y~^~Unknown~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-layout-parameter~^~core~^~The spec valid usage text states 'layout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-layout-parameter)~^~implicit -VALIDATION_ERROR_1be13601~^~Y~^~Unknown~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-pDescriptorWrites-parameter~^~core~^~The spec valid usage text states 'pDescriptorWrites must be a valid pointer to an array of descriptorWriteCount valid VkWriteDescriptorSet structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-pDescriptorWrites-parameter)~^~implicit -VALIDATION_ERROR_1be27e01~^~Y~^~Unknown~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-parameter~^~core~^~The spec valid usage text states 'pipelineBindPoint must be a valid VkPipelineBindPoint value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-parameter)~^~implicit -VALIDATION_ERROR_1c000009~^~Y~^~Unknown~^~vkCmdPushDescriptorSetWithTemplateKHR~^~VUID-vkCmdPushDescriptorSetWithTemplateKHR-commonparent~^~core~^~The spec valid usage text states 'Each of commandBuffer, descriptorUpdateTemplate, and layout must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commonparent)~^~implicit -VALIDATION_ERROR_1c0002dc~^~N~^~Unknown~^~vkCmdPushDescriptorSetWithTemplateKHR~^~VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-00366~^~core~^~The spec valid usage text states 'The pipelineBindPoint specified during the creation of the descriptor update template must be supported by the commandBuffer's parent VkCommandPool's queue family' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-00366)~^~ -VALIDATION_ERROR_1c000d2c~^~N~^~None~^~vkCmdPushDescriptorSetWithTemplateKHR~^~VUID-vkCmdPushDescriptorSetWithTemplateKHR-pData-01686~^~core~^~The spec valid usage text states 'pData must be a valid pointer to a memory that contains one or more valid instances of VkDescriptorImageInfo, VkDescriptorBufferInfo, or VkBufferView in a layout defined by descriptorUpdateTemplate when it was created with vkCreateDescriptorUpdateTemplateKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-pData-01686)~^~ -VALIDATION_ERROR_1c002401~^~Y~^~Unknown~^~vkCmdPushDescriptorSetWithTemplateKHR~^~VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1c002413~^~N~^~Unknown~^~vkCmdPushDescriptorSetWithTemplateKHR~^~VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-recording)~^~implicit -VALIDATION_ERROR_1c002415~^~N~^~Unknown~^~vkCmdPushDescriptorSetWithTemplateKHR~^~VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_1c005201~^~Y~^~Unknown~^~vkCmdPushDescriptorSetWithTemplateKHR~^~VUID-vkCmdPushDescriptorSetWithTemplateKHR-descriptorUpdateTemplate-parameter~^~core~^~The spec valid usage text states 'descriptorUpdateTemplate must be a valid VkDescriptorUpdateTemplateKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-descriptorUpdateTemplate-parameter)~^~implicit -VALIDATION_ERROR_1c00be01~^~Y~^~Unknown~^~vkCmdPushDescriptorSetWithTemplateKHR~^~VUID-vkCmdPushDescriptorSetWithTemplateKHR-layout-parameter~^~core~^~The spec valid usage text states 'layout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-layout-parameter)~^~implicit -VALIDATION_ERROR_1c012201~^~N~^~Unknown~^~vkCmdPushDescriptorSetWithTemplateKHR~^~VUID-vkCmdPushDescriptorSetWithTemplateKHR-pData-parameter~^~core~^~The spec valid usage text states 'pData must be a pointer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-pData-parameter)~^~implicit -VALIDATION_ERROR_1c200017~^~N~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-vkCmdReserveSpaceForCommandsNVX-renderpass~^~core~^~The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-renderpass)~^~implicit -VALIDATION_ERROR_1c200019~^~N~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-vkCmdReserveSpaceForCommandsNVX-bufferlevel~^~core~^~The spec valid usage text states 'commandBuffer must be a secondary VkCommandBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-bufferlevel)~^~implicit -VALIDATION_ERROR_1c200a62~^~N~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-01329~^~core~^~The spec valid usage text states 'The provided commandBuffer must not have had a prior space reservation since its creation or the last reset.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-01329)~^~ -VALIDATION_ERROR_1c200a64~^~N~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-01330~^~core~^~The spec valid usage text states 'The state of the commandBuffer must be legal to execute all commands within the sequence provided by the indirectCommandsLayout member of pProcessCommandsInfo.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-01330)~^~ -VALIDATION_ERROR_1c202401~^~Y~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1c202413~^~N~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-recording)~^~implicit -VALIDATION_ERROR_1c202415~^~N~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_1c221a01~^~N~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-vkCmdReserveSpaceForCommandsNVX-pReserveSpaceInfo-parameter~^~core~^~The spec valid usage text states 'pReserveSpaceInfo must be a valid pointer to a valid VkCmdReserveSpaceForCommandsInfoNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-pReserveSpaceInfo-parameter)~^~implicit +VALIDATION_ERROR_1be00009~^~Y~^~Unknown~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-commonparent~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'Both of commandBuffer, and layout must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-commonparent)~^~implicit +VALIDATION_ERROR_1be002d6~^~Y~^~PushDescriptorSetCmdPushBadArgs~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-00363~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'pipelineBindPoint must be supported by the commandBuffer's parent VkCommandPool's queue family' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-00363)~^~ +VALIDATION_ERROR_1be002d8~^~Y~^~PushDescriptorSetCmdPushBadArgs~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-set-00364~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'set must be less than VkPipelineLayoutCreateInfo::setLayoutCount provided when layout was created' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-set-00364)~^~ +VALIDATION_ERROR_1be002da~^~Y~^~PushDescriptorSetCmdPushBadArgs~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-set-00365~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'set must be the unique set number in the pipeline layout that uses a descriptor set layout that was created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-set-00365)~^~ +VALIDATION_ERROR_1be02401~^~Y~^~Unknown~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-commandBuffer-parameter~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-commandBuffer-parameter)~^~implicit +VALIDATION_ERROR_1be02413~^~Y~^~None~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-commandBuffer-recording~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1be02415~^~Y~^~PushDescriptorSetCmdPushBadArgs~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-commandBuffer-cmdpool~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-commandBuffer-cmdpool)~^~implicit +VALIDATION_ERROR_1be0541b~^~N~^~Unknown~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-descriptorWriteCount-arraylength~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'descriptorWriteCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-descriptorWriteCount-arraylength)~^~implicit +VALIDATION_ERROR_1be0be01~^~Y~^~Unknown~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-layout-parameter~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'layout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-layout-parameter)~^~implicit +VALIDATION_ERROR_1be13601~^~Y~^~Unknown~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-pDescriptorWrites-parameter~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'pDescriptorWrites must be a valid pointer to an array of descriptorWriteCount valid VkWriteDescriptorSet structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-pDescriptorWrites-parameter)~^~implicit +VALIDATION_ERROR_1be27e01~^~Y~^~Unknown~^~vkCmdPushDescriptorSetKHR~^~VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-parameter~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'pipelineBindPoint must be a valid VkPipelineBindPoint value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-parameter)~^~implicit +VALIDATION_ERROR_1c000009~^~Y~^~Unknown~^~vkCmdPushDescriptorSetWithTemplateKHR~^~VUID-vkCmdPushDescriptorSetWithTemplateKHR-commonparent~^~(VK_KHR_push_descriptor)+(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'Each of commandBuffer, descriptorUpdateTemplate, and layout must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commonparent)~^~implicit +VALIDATION_ERROR_1c0002dc~^~N~^~Unknown~^~vkCmdPushDescriptorSetWithTemplateKHR~^~VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-00366~^~(VK_KHR_push_descriptor)+(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'The pipelineBindPoint specified during the creation of the descriptor update template must be supported by the commandBuffer's parent VkCommandPool's queue family' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-00366)~^~ +VALIDATION_ERROR_1c000d2c~^~N~^~None~^~vkCmdPushDescriptorSetWithTemplateKHR~^~VUID-vkCmdPushDescriptorSetWithTemplateKHR-pData-01686~^~(VK_KHR_push_descriptor)+(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'pData must be a valid pointer to a memory that contains one or more valid instances of VkDescriptorImageInfo, VkDescriptorBufferInfo, or VkBufferView in a layout defined by descriptorUpdateTemplate when it was created with vkCreateDescriptorUpdateTemplateKHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-pData-01686)~^~ +VALIDATION_ERROR_1c002401~^~Y~^~Unknown~^~vkCmdPushDescriptorSetWithTemplateKHR~^~VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-parameter~^~(VK_KHR_push_descriptor)+(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-parameter)~^~implicit +VALIDATION_ERROR_1c002413~^~Y~^~None~^~vkCmdPushDescriptorSetWithTemplateKHR~^~VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-recording~^~(VK_KHR_push_descriptor)+(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1c002415~^~N~^~Unknown~^~vkCmdPushDescriptorSetWithTemplateKHR~^~VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-cmdpool~^~(VK_KHR_push_descriptor)+(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-cmdpool)~^~implicit +VALIDATION_ERROR_1c005201~^~Y~^~Unknown~^~vkCmdPushDescriptorSetWithTemplateKHR~^~VUID-vkCmdPushDescriptorSetWithTemplateKHR-descriptorUpdateTemplate-parameter~^~(VK_KHR_push_descriptor)+(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'descriptorUpdateTemplate must be a valid VkDescriptorUpdateTemplate handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-descriptorUpdateTemplate-parameter)~^~implicit +VALIDATION_ERROR_1c00be01~^~Y~^~Unknown~^~vkCmdPushDescriptorSetWithTemplateKHR~^~VUID-vkCmdPushDescriptorSetWithTemplateKHR-layout-parameter~^~(VK_KHR_push_descriptor)+(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'layout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-layout-parameter)~^~implicit +VALIDATION_ERROR_1c200017~^~N~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-vkCmdReserveSpaceForCommandsNVX-renderpass~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-renderpass)~^~implicit +VALIDATION_ERROR_1c200019~^~N~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-vkCmdReserveSpaceForCommandsNVX-bufferlevel~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'commandBuffer must be a secondary VkCommandBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-bufferlevel)~^~implicit +VALIDATION_ERROR_1c200a62~^~N~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-01329~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'The provided commandBuffer must not have had a prior space reservation since its creation or the last reset.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-01329)~^~ +VALIDATION_ERROR_1c200a64~^~N~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-01330~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'The state of the commandBuffer must be legal to execute all commands within the sequence provided by the indirectCommandsLayout member of pProcessCommandsInfo.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-01330)~^~ +VALIDATION_ERROR_1c202401~^~Y~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-parameter)~^~implicit +VALIDATION_ERROR_1c202413~^~N~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-recording~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1c202415~^~N~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-cmdpool~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-cmdpool)~^~implicit +VALIDATION_ERROR_1c221a01~^~N~^~Unknown~^~vkCmdReserveSpaceForCommandsNVX~^~VUID-vkCmdReserveSpaceForCommandsNVX-pReserveSpaceInfo-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'pReserveSpaceInfo must be a valid pointer to a valid VkCmdReserveSpaceForCommandsInfoNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-pReserveSpaceInfo-parameter)~^~implicit VALIDATION_ERROR_1c400009~^~Y~^~Unknown~^~vkCmdResetEvent~^~VUID-vkCmdResetEvent-commonparent~^~core~^~The spec valid usage text states 'Both of commandBuffer, and event must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetEvent-commonparent)~^~implicit VALIDATION_ERROR_1c400017~^~Y~^~Unknown~^~vkCmdResetEvent~^~VUID-vkCmdResetEvent-renderpass~^~core~^~The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetEvent-renderpass)~^~implicit VALIDATION_ERROR_1c400902~^~N~^~Unknown~^~vkCmdResetEvent~^~VUID-vkCmdResetEvent-stageMask-01153~^~core~^~The spec valid usage text states 'stageMask must not include VK_PIPELINE_STAGE_HOST_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetEvent-stageMask-01153)~^~ VALIDATION_ERROR_1c400904~^~Y~^~Unknown~^~vkCmdResetEvent~^~VUID-vkCmdResetEvent-stageMask-01154~^~core~^~The spec valid usage text states 'If the geometry shaders feature is not enabled, stageMask must not contain VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetEvent-stageMask-01154)~^~ VALIDATION_ERROR_1c400906~^~Y~^~Unknown~^~vkCmdResetEvent~^~VUID-vkCmdResetEvent-stageMask-01155~^~core~^~The spec valid usage text states 'If the tessellation shaders feature is not enabled, stageMask must not contain VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetEvent-stageMask-01155)~^~ VALIDATION_ERROR_1c400908~^~N~^~Unknown~^~vkCmdResetEvent~^~VUID-vkCmdResetEvent-event-01156~^~core~^~The spec valid usage text states 'When this command executes, event must not be waited on by a vkCmdWaitEvents command that is currently executing' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetEvent-event-01156)~^~ -VALIDATION_ERROR_1c40090a~^~N~^~Unknown~^~vkCmdResetEvent~^~VUID-vkCmdResetEvent-commandBuffer-01157~^~(VK_KHX_device_group)~^~The spec valid usage text states 'commandBuffer's current device mask must include exactly one physical device.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdResetEvent-commandBuffer-01157)~^~ +VALIDATION_ERROR_1c40090a~^~N~^~Unknown~^~vkCmdResetEvent~^~VUID-vkCmdResetEvent-commandBuffer-01157~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'commandBuffer's current device mask must include exactly one physical device.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdResetEvent-commandBuffer-01157)~^~ VALIDATION_ERROR_1c402401~^~Y~^~None~^~vkCmdResetEvent~^~VUID-vkCmdResetEvent-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetEvent-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1c402413~^~N~^~Unknown~^~vkCmdResetEvent~^~VUID-vkCmdResetEvent-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetEvent-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1c402413~^~Y~^~None~^~vkCmdResetEvent~^~VUID-vkCmdResetEvent-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetEvent-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1c402415~^~Y~^~Unknown~^~vkCmdResetEvent~^~VUID-vkCmdResetEvent-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetEvent-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1c407e01~^~Y~^~None~^~vkCmdResetEvent~^~VUID-vkCmdResetEvent-event-parameter~^~core~^~The spec valid usage text states 'event must be a valid VkEvent handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetEvent-event-parameter)~^~implicit VALIDATION_ERROR_1c42de01~^~N~^~Unknown~^~vkCmdResetEvent~^~VUID-vkCmdResetEvent-stageMask-parameter~^~core~^~The spec valid usage text states 'stageMask must be a valid combination of VkPipelineStageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetEvent-stageMask-parameter)~^~implicit @@ -2379,7 +2434,7 @@ VALIDATION_ERROR_1c600638~^~N~^~Unknown~^~vkCmdResetQueryPool~^~VUID-vkCmdResetQueryPool-firstQuery-00796~^~core~^~The spec valid usage text states 'firstQuery must be less than the number of queries in queryPool' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetQueryPool-firstQuery-00796)~^~ VALIDATION_ERROR_1c60063a~^~N~^~Unknown~^~vkCmdResetQueryPool~^~VUID-vkCmdResetQueryPool-firstQuery-00797~^~core~^~The spec valid usage text states 'The sum of firstQuery and queryCount must be less than or equal to the number of queries in queryPool' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetQueryPool-firstQuery-00797)~^~ VALIDATION_ERROR_1c602401~^~Y~^~None~^~vkCmdResetQueryPool~^~VUID-vkCmdResetQueryPool-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetQueryPool-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1c602413~^~N~^~Unknown~^~vkCmdResetQueryPool~^~VUID-vkCmdResetQueryPool-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetQueryPool-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1c602413~^~Y~^~None~^~vkCmdResetQueryPool~^~VUID-vkCmdResetQueryPool-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetQueryPool-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1c602415~^~Y~^~Unknown~^~vkCmdResetQueryPool~^~VUID-vkCmdResetQueryPool-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetQueryPool-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1c629801~^~Y~^~None~^~vkCmdResetQueryPool~^~VUID-vkCmdResetQueryPool-queryPool-parameter~^~core~^~The spec valid usage text states 'queryPool must be a valid VkQueryPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetQueryPool-queryPool-parameter)~^~implicit VALIDATION_ERROR_1c800009~^~Y~^~Unknown~^~vkCmdResolveImage~^~VUID-vkCmdResolveImage-commonparent~^~core~^~The spec valid usage text states 'Each of commandBuffer, dstImage, and srcImage must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-commonparent)~^~implicit @@ -2404,8 +2459,11 @@ VALIDATION_ERROR_1c800d5c~^~N~^~None~^~vkCmdResolveImage~^~VUID-vkCmdResolveImage-dstSubresource-01710~^~core~^~The spec valid usage text states 'The dstSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-dstSubresource-01710)~^~ VALIDATION_ERROR_1c800d5e~^~N~^~None~^~vkCmdResolveImage~^~VUID-vkCmdResolveImage-srcSubresource-01711~^~core~^~The spec valid usage text states 'The srcSubresource.baseArrayLayer + srcSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-srcSubresource-01711)~^~ VALIDATION_ERROR_1c800d60~^~N~^~None~^~vkCmdResolveImage~^~VUID-vkCmdResolveImage-dstSubresource-01712~^~core~^~The spec valid usage text states 'The dstSubresource.baseArrayLayer + dstSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-dstSubresource-01712)~^~ +VALIDATION_ERROR_1c800e5a~^~N~^~None~^~vkCmdResolveImage~^~VUID-vkCmdResolveImage-commandBuffer-01837~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then srcImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdResolveImage-commandBuffer-01837)~^~ +VALIDATION_ERROR_1c800e5c~^~N~^~None~^~vkCmdResolveImage~^~VUID-vkCmdResolveImage-commandBuffer-01838~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdResolveImage-commandBuffer-01838)~^~ +VALIDATION_ERROR_1c800e5e~^~N~^~None~^~vkCmdResolveImage~^~VUID-vkCmdResolveImage-commandBuffer-01839~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstImage must not be an unprotected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdResolveImage-commandBuffer-01839)~^~ VALIDATION_ERROR_1c802401~^~Y~^~None~^~vkCmdResolveImage~^~VUID-vkCmdResolveImage-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1c802413~^~N~^~Unknown~^~vkCmdResolveImage~^~VUID-vkCmdResolveImage-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1c802413~^~Y~^~None~^~vkCmdResolveImage~^~VUID-vkCmdResolveImage-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1c802415~^~Y~^~Unknown~^~vkCmdResolveImage~^~VUID-vkCmdResolveImage-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1c807201~^~Y~^~None~^~vkCmdResolveImage~^~VUID-vkCmdResolveImage-dstImage-parameter~^~core~^~The spec valid usage text states 'dstImage must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-dstImage-parameter)~^~implicit VALIDATION_ERROR_1c807401~^~Y~^~Unknown~^~vkCmdResolveImage~^~VUID-vkCmdResolveImage-dstImageLayout-parameter~^~core~^~The spec valid usage text states 'dstImageLayout must be a valid VkImageLayout value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-dstImageLayout-parameter)~^~implicit @@ -2413,106 +2471,104 @@ VALIDATION_ERROR_1c82ac1b~^~Y~^~Unknown~^~vkCmdResolveImage~^~VUID-vkCmdResolveImage-regionCount-arraylength~^~core~^~The spec valid usage text states 'regionCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-regionCount-arraylength)~^~implicit VALIDATION_ERROR_1c82ce01~^~Y~^~None~^~vkCmdResolveImage~^~VUID-vkCmdResolveImage-srcImage-parameter~^~core~^~The spec valid usage text states 'srcImage must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-srcImage-parameter)~^~implicit VALIDATION_ERROR_1c82d001~^~Y~^~Unknown~^~vkCmdResolveImage~^~VUID-vkCmdResolveImage-srcImageLayout-parameter~^~core~^~The spec valid usage text states 'srcImageLayout must be a valid VkImageLayout value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-srcImageLayout-parameter)~^~implicit -VALIDATION_ERROR_1ca004c8~^~Y~^~Unknown~^~vkCmdSetBlendConstants~^~VUID-vkCmdSetBlendConstants-None-00612~^~core~^~The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_BLEND_CONSTANTS dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetBlendConstants-None-00612)~^~ +VALIDATION_ERROR_1ca004c8~^~Y~^~Unknown~^~vkCmdSetBlendConstants~^~VUID-vkCmdSetBlendConstants-None-00612~^~core~^~The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_BLEND_CONSTANTS dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetBlendConstants-None-00612)~^~ VALIDATION_ERROR_1ca02401~^~Y~^~None~^~vkCmdSetBlendConstants~^~VUID-vkCmdSetBlendConstants-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetBlendConstants-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1ca02413~^~N~^~Unknown~^~vkCmdSetBlendConstants~^~VUID-vkCmdSetBlendConstants-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetBlendConstants-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1ca02413~^~Y~^~None~^~vkCmdSetBlendConstants~^~VUID-vkCmdSetBlendConstants-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetBlendConstants-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1ca02415~^~Y~^~Unknown~^~vkCmdSetBlendConstants~^~VUID-vkCmdSetBlendConstants-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetBlendConstants-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_1cc0062a~^~Y~^~Unknown~^~vkCmdSetDepthBias~^~VUID-vkCmdSetDepthBias-None-00789~^~core~^~The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_DEPTH_BIAS dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBias-None-00789)~^~ +VALIDATION_ERROR_1cc0062a~^~Y~^~Unknown~^~vkCmdSetDepthBias~^~VUID-vkCmdSetDepthBias-None-00789~^~core~^~The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_DEPTH_BIAS dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBias-None-00789)~^~ VALIDATION_ERROR_1cc0062c~^~Y~^~None~^~vkCmdSetDepthBias~^~VUID-vkCmdSetDepthBias-depthBiasClamp-00790~^~core~^~The spec valid usage text states 'If the depth bias clamping feature is not enabled, depthBiasClamp must be 0.0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBias-depthBiasClamp-00790)~^~ VALIDATION_ERROR_1cc02401~^~Y~^~None~^~vkCmdSetDepthBias~^~VUID-vkCmdSetDepthBias-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBias-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1cc02413~^~N~^~Unknown~^~vkCmdSetDepthBias~^~VUID-vkCmdSetDepthBias-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBias-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1cc02413~^~Y~^~None~^~vkCmdSetDepthBias~^~VUID-vkCmdSetDepthBias-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBias-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1cc02415~^~Y~^~Unknown~^~vkCmdSetDepthBias~^~VUID-vkCmdSetDepthBias-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBias-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_1ce004ae~^~Y~^~Unknown~^~vkCmdSetDepthBounds~^~VUID-vkCmdSetDepthBounds-None-00599~^~core~^~The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_DEPTH_BOUNDS dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBounds-None-00599)~^~ -VALIDATION_ERROR_1ce004b0~^~N~^~Unknown~^~vkCmdSetDepthBounds~^~VUID-vkCmdSetDepthBounds-minDepthBounds-00600~^~!(VK_EXT_depth_range_unrestricted)~^~The spec valid usage text states 'minDepthBounds must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBounds-minDepthBounds-00600)~^~ -VALIDATION_ERROR_1ce004b2~^~N~^~Unknown~^~vkCmdSetDepthBounds~^~VUID-vkCmdSetDepthBounds-maxDepthBounds-00601~^~!(VK_EXT_depth_range_unrestricted)~^~The spec valid usage text states 'maxDepthBounds must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBounds-maxDepthBounds-00601)~^~ +VALIDATION_ERROR_1ce004ae~^~Y~^~Unknown~^~vkCmdSetDepthBounds~^~VUID-vkCmdSetDepthBounds-None-00599~^~core~^~The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_DEPTH_BOUNDS dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBounds-None-00599)~^~ +VALIDATION_ERROR_1ce004b0~^~N~^~Unknown~^~vkCmdSetDepthBounds~^~VUID-vkCmdSetDepthBounds-minDepthBounds-00600~^~(VK_EXT_depth_range_unrestricted)~^~The spec valid usage text states 'Unless the VK_EXT_depth_range_unrestricted extension is enabled minDepthBounds must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDepthBounds-minDepthBounds-00600)~^~ +VALIDATION_ERROR_1ce004b2~^~N~^~Unknown~^~vkCmdSetDepthBounds~^~VUID-vkCmdSetDepthBounds-maxDepthBounds-00601~^~(VK_EXT_depth_range_unrestricted)~^~The spec valid usage text states 'Unless the VK_EXT_depth_range_unrestricted extension is enabled maxDepthBounds must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDepthBounds-maxDepthBounds-00601)~^~ VALIDATION_ERROR_1ce02401~^~Y~^~None~^~vkCmdSetDepthBounds~^~VUID-vkCmdSetDepthBounds-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBounds-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1ce02413~^~N~^~Unknown~^~vkCmdSetDepthBounds~^~VUID-vkCmdSetDepthBounds-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBounds-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1ce02413~^~Y~^~None~^~vkCmdSetDepthBounds~^~VUID-vkCmdSetDepthBounds-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBounds-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1ce02415~^~Y~^~Unknown~^~vkCmdSetDepthBounds~^~VUID-vkCmdSetDepthBounds-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBounds-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_1d0000d8~^~N~^~Unknown~^~vkCmdSetDeviceMaskKHX~^~VUID-vkCmdSetDeviceMaskKHX-deviceMask-00108~^~core~^~The spec valid usage text states 'deviceMask must be a valid device mask value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDeviceMaskKHX-deviceMask-00108)~^~ -VALIDATION_ERROR_1d0000da~^~N~^~Unknown~^~vkCmdSetDeviceMaskKHX~^~VUID-vkCmdSetDeviceMaskKHX-deviceMask-00109~^~core~^~The spec valid usage text states 'deviceMask must not be zero' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDeviceMaskKHX-deviceMask-00109)~^~ -VALIDATION_ERROR_1d0000dc~^~N~^~Unknown~^~vkCmdSetDeviceMaskKHX~^~VUID-vkCmdSetDeviceMaskKHX-deviceMask-00110~^~core~^~The spec valid usage text states 'deviceMask must not include any set bits that were not in the VkDeviceGroupCommandBufferBeginInfoKHX::deviceMask value when the command buffer began recording.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDeviceMaskKHX-deviceMask-00110)~^~ -VALIDATION_ERROR_1d0000de~^~N~^~Unknown~^~vkCmdSetDeviceMaskKHX~^~VUID-vkCmdSetDeviceMaskKHX-deviceMask-00111~^~core~^~The spec valid usage text states 'If vkCmdSetDeviceMaskKHX is called inside a render pass instance, deviceMask must not include any set bits that were not in the VkDeviceGroupRenderPassBeginInfoKHX::deviceMask value when the render pass instance began recording.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDeviceMaskKHX-deviceMask-00111)~^~ -VALIDATION_ERROR_1d002401~^~Y~^~Unknown~^~vkCmdSetDeviceMaskKHX~^~VUID-vkCmdSetDeviceMaskKHX-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDeviceMaskKHX-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1d002413~^~N~^~Unknown~^~vkCmdSetDeviceMaskKHX~^~VUID-vkCmdSetDeviceMaskKHX-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDeviceMaskKHX-commandBuffer-recording)~^~implicit -VALIDATION_ERROR_1d002415~^~N~^~Unknown~^~vkCmdSetDeviceMaskKHX~^~VUID-vkCmdSetDeviceMaskKHX-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, compute, or transfer operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDeviceMaskKHX-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_1d20048e~^~N~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-None-00583~^~core~^~The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-None-00583)~^~ -VALIDATION_ERROR_1d200490~^~N~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-firstDiscardRectangle-00584~^~core~^~The spec valid usage text states 'firstDiscardRectangle must be less than VkPhysicalDeviceDiscardRectanglePropertiesEXT.maxDiscardRectangles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-firstDiscardRectangle-00584)~^~ -VALIDATION_ERROR_1d200492~^~N~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-firstDiscardRectangle-00585~^~core~^~The spec valid usage text states 'The sum of firstDiscardRectangle and discardRectangleCount must be between 1 and VkPhysicalDeviceDiscardRectanglePropertiesEXT::maxDiscardRectangles, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-firstDiscardRectangle-00585)~^~ -VALIDATION_ERROR_1d200494~^~N~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-pDiscardRectangles-00586~^~core~^~The spec valid usage text states 'pDiscardRectangles must be a valid pointer to an array of discardRectangleCount valid VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-pDiscardRectangles-00586)~^~ -VALIDATION_ERROR_1d200496~^~N~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-x-00587~^~core~^~The spec valid usage text states 'The x and y members of offset in VkRect2D must be greater than or equal to 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-x-00587)~^~ -VALIDATION_ERROR_1d200498~^~N~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-offset-00588~^~core~^~The spec valid usage text states 'Evaluation of (offset.x + extent.width) in VkRect2D must not cause a signed integer addition overflow' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-offset-00588)~^~ -VALIDATION_ERROR_1d20049a~^~N~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-offset-00589~^~core~^~The spec valid usage text states 'Evaluation of (offset.y + extent.height) in VkRect2D must not cause a signed integer addition overflow' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-offset-00589)~^~ -VALIDATION_ERROR_1d202401~^~Y~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1d202413~^~N~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-recording)~^~implicit -VALIDATION_ERROR_1d202415~^~N~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_1d205c1b~^~Y~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-discardRectangleCount-arraylength~^~core~^~The spec valid usage text states 'discardRectangleCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-discardRectangleCount-arraylength)~^~implicit -VALIDATION_ERROR_1d214601~^~Y~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-pDiscardRectangles-parameter~^~core~^~The spec valid usage text states 'pDiscardRectangles must be a valid pointer to an array of discardRectangleCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-pDiscardRectangles-parameter)~^~implicit +VALIDATION_ERROR_1d0000d8~^~N~^~Unknown~^~vkCmdSetDeviceMask~^~VUID-vkCmdSetDeviceMask-deviceMask-00108~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'deviceMask must be a valid device mask value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDeviceMask-deviceMask-00108)~^~ +VALIDATION_ERROR_1d0000da~^~N~^~Unknown~^~vkCmdSetDeviceMask~^~VUID-vkCmdSetDeviceMask-deviceMask-00109~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'deviceMask must not be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDeviceMask-deviceMask-00109)~^~ +VALIDATION_ERROR_1d0000dc~^~N~^~Unknown~^~vkCmdSetDeviceMask~^~VUID-vkCmdSetDeviceMask-deviceMask-00110~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'deviceMask must not include any set bits that were not in the VkDeviceGroupCommandBufferBeginInfo::deviceMask value when the command buffer began recording.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDeviceMask-deviceMask-00110)~^~ +VALIDATION_ERROR_1d0000de~^~N~^~Unknown~^~vkCmdSetDeviceMask~^~VUID-vkCmdSetDeviceMask-deviceMask-00111~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If vkCmdSetDeviceMask is called inside a render pass instance, deviceMask must not include any set bits that were not in the VkDeviceGroupRenderPassBeginInfo::deviceMask value when the render pass instance began recording.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDeviceMask-deviceMask-00111)~^~ +VALIDATION_ERROR_1d002401~^~Y~^~Unknown~^~vkCmdSetDeviceMask~^~VUID-vkCmdSetDeviceMask-commandBuffer-parameter~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDeviceMask-commandBuffer-parameter)~^~implicit +VALIDATION_ERROR_1d002413~^~N~^~Unknown~^~vkCmdSetDeviceMask~^~VUID-vkCmdSetDeviceMask-commandBuffer-recording~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDeviceMask-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1d002415~^~N~^~Unknown~^~vkCmdSetDeviceMask~^~VUID-vkCmdSetDeviceMask-commandBuffer-cmdpool~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, compute, or transfer operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDeviceMask-commandBuffer-cmdpool)~^~implicit +VALIDATION_ERROR_1d20048e~^~N~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-None-00583~^~(VK_EXT_discard_rectangles)~^~The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-None-00583)~^~ +VALIDATION_ERROR_1d200492~^~N~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-firstDiscardRectangle-00585~^~(VK_EXT_discard_rectangles)~^~The spec valid usage text states 'The sum of firstDiscardRectangle and discardRectangleCount must be less than or equal to VkPhysicalDeviceDiscardRectanglePropertiesEXT::maxDiscardRectangles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-firstDiscardRectangle-00585)~^~ +VALIDATION_ERROR_1d200496~^~N~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-x-00587~^~(VK_EXT_discard_rectangles)~^~The spec valid usage text states 'The x and y member of offset in each VkRect2D element of pDiscardRectangles must be greater than or equal to 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-x-00587)~^~ +VALIDATION_ERROR_1d200498~^~N~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-offset-00588~^~(VK_EXT_discard_rectangles)~^~The spec valid usage text states 'Evaluation of (offset.x + extent.width) in each VkRect2D element of pDiscardRectangles must not cause a signed integer addition overflow' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-offset-00588)~^~ +VALIDATION_ERROR_1d20049a~^~N~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-offset-00589~^~(VK_EXT_discard_rectangles)~^~The spec valid usage text states 'Evaluation of (offset.y + extent.height) in each VkRect2D element of pDiscardRectangles must not cause a signed integer addition overflow' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-offset-00589)~^~ +VALIDATION_ERROR_1d202401~^~Y~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-parameter~^~(VK_EXT_discard_rectangles)~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-parameter)~^~implicit +VALIDATION_ERROR_1d202413~^~Y~^~None~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-recording~^~(VK_EXT_discard_rectangles)~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1d202415~^~N~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-cmdpool~^~(VK_EXT_discard_rectangles)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-cmdpool)~^~implicit +VALIDATION_ERROR_1d205c1b~^~Y~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-discardRectangleCount-arraylength~^~(VK_EXT_discard_rectangles)~^~The spec valid usage text states 'discardRectangleCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-discardRectangleCount-arraylength)~^~implicit +VALIDATION_ERROR_1d214601~^~Y~^~Unknown~^~vkCmdSetDiscardRectangleEXT~^~VUID-vkCmdSetDiscardRectangleEXT-pDiscardRectangles-parameter~^~(VK_EXT_discard_rectangles)~^~The spec valid usage text states 'pDiscardRectangles must be a valid pointer to an array of discardRectangleCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-pDiscardRectangles-parameter)~^~implicit VALIDATION_ERROR_1d400009~^~Y~^~Unknown~^~vkCmdSetEvent~^~VUID-vkCmdSetEvent-commonparent~^~core~^~The spec valid usage text states 'Both of commandBuffer, and event must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetEvent-commonparent)~^~implicit VALIDATION_ERROR_1d400017~^~Y~^~Unknown~^~vkCmdSetEvent~^~VUID-vkCmdSetEvent-renderpass~^~core~^~The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetEvent-renderpass)~^~implicit VALIDATION_ERROR_1d4008fa~^~N~^~Unknown~^~vkCmdSetEvent~^~VUID-vkCmdSetEvent-stageMask-01149~^~core~^~The spec valid usage text states 'stageMask must not include VK_PIPELINE_STAGE_HOST_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetEvent-stageMask-01149)~^~ VALIDATION_ERROR_1d4008fc~^~Y~^~StageMaskGsTsEnabled~^~vkCmdSetEvent~^~VUID-vkCmdSetEvent-stageMask-01150~^~core~^~The spec valid usage text states 'If the geometry shaders feature is not enabled, stageMask must not contain VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetEvent-stageMask-01150)~^~ VALIDATION_ERROR_1d4008fe~^~Y~^~StageMaskGsTsEnabled~^~vkCmdSetEvent~^~VUID-vkCmdSetEvent-stageMask-01151~^~core~^~The spec valid usage text states 'If the tessellation shaders feature is not enabled, stageMask must not contain VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetEvent-stageMask-01151)~^~ -VALIDATION_ERROR_1d400900~^~N~^~Unknown~^~vkCmdSetEvent~^~VUID-vkCmdSetEvent-commandBuffer-01152~^~(VK_KHX_device_group)~^~The spec valid usage text states 'commandBuffer's current device mask must include exactly one physical device.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetEvent-commandBuffer-01152)~^~ +VALIDATION_ERROR_1d400900~^~N~^~Unknown~^~vkCmdSetEvent~^~VUID-vkCmdSetEvent-commandBuffer-01152~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'commandBuffer's current device mask must include exactly one physical device.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetEvent-commandBuffer-01152)~^~ VALIDATION_ERROR_1d402401~^~Y~^~None~^~vkCmdSetEvent~^~VUID-vkCmdSetEvent-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetEvent-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1d402413~^~N~^~Unknown~^~vkCmdSetEvent~^~VUID-vkCmdSetEvent-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetEvent-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1d402413~^~Y~^~None~^~vkCmdSetEvent~^~VUID-vkCmdSetEvent-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetEvent-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1d402415~^~Y~^~Unknown~^~vkCmdSetEvent~^~VUID-vkCmdSetEvent-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetEvent-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1d407e01~^~Y~^~None~^~vkCmdSetEvent~^~VUID-vkCmdSetEvent-event-parameter~^~core~^~The spec valid usage text states 'event must be a valid VkEvent handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetEvent-event-parameter)~^~implicit VALIDATION_ERROR_1d42de01~^~N~^~Unknown~^~vkCmdSetEvent~^~VUID-vkCmdSetEvent-stageMask-parameter~^~core~^~The spec valid usage text states 'stageMask must be a valid combination of VkPipelineStageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetEvent-stageMask-parameter)~^~implicit VALIDATION_ERROR_1d42de03~^~Y~^~Unknown~^~vkCmdSetEvent~^~VUID-vkCmdSetEvent-stageMask-requiredbitmask~^~core~^~The spec valid usage text states 'stageMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetEvent-stageMask-requiredbitmask)~^~implicit -VALIDATION_ERROR_1d600626~^~Y~^~Unknown~^~vkCmdSetLineWidth~^~VUID-vkCmdSetLineWidth-None-00787~^~core~^~The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_LINE_WIDTH dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetLineWidth-None-00787)~^~ -VALIDATION_ERROR_1d600628~^~N~^~Unknown~^~vkCmdSetLineWidth~^~VUID-vkCmdSetLineWidth-lineWidth-00788~^~core~^~The spec valid usage text states 'If the wide lines feature is not enabled, lineWidth must be 1.0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetLineWidth-lineWidth-00788)~^~ +VALIDATION_ERROR_1d600626~^~Y~^~Unknown~^~vkCmdSetLineWidth~^~VUID-vkCmdSetLineWidth-None-00787~^~core~^~The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_LINE_WIDTH dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetLineWidth-None-00787)~^~ +VALIDATION_ERROR_1d600628~^~Y~^~PSOLineWidthInvalid~^~vkCmdSetLineWidth~^~VUID-vkCmdSetLineWidth-lineWidth-00788~^~core~^~The spec valid usage text states 'If the wide lines feature is not enabled, lineWidth must be 1.0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetLineWidth-lineWidth-00788)~^~ VALIDATION_ERROR_1d602401~^~Y~^~None~^~vkCmdSetLineWidth~^~VUID-vkCmdSetLineWidth-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetLineWidth-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1d602413~^~N~^~Unknown~^~vkCmdSetLineWidth~^~VUID-vkCmdSetLineWidth-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetLineWidth-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1d602413~^~Y~^~None~^~vkCmdSetLineWidth~^~VUID-vkCmdSetLineWidth-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetLineWidth-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1d602415~^~Y~^~Unknown~^~vkCmdSetLineWidth~^~VUID-vkCmdSetLineWidth-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetLineWidth-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_1d80049c~^~Y~^~Unknown~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-None-00590~^~core~^~The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_SCISSOR dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-None-00590)~^~ +VALIDATION_ERROR_1d80049c~^~Y~^~Unknown~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-None-00590~^~core~^~The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_SCISSOR dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-None-00590)~^~ VALIDATION_ERROR_1d80049e~^~N~^~Unknown~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-firstScissor-00591~^~core~^~The spec valid usage text states 'firstScissor must be less than VkPhysicalDeviceLimits::maxViewports' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-firstScissor-00591)~^~ -VALIDATION_ERROR_1d8004a0~^~N~^~Unknown~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-firstScissor-00592~^~core~^~The spec valid usage text states 'The sum of firstScissor and scissorCount must be between 1 and VkPhysicalDeviceLimits::maxViewports, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-firstScissor-00592)~^~ -VALIDATION_ERROR_1d8004a2~^~N~^~Unknown~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-firstScissor-00593~^~core~^~The spec valid usage text states 'If the multiple viewports feature is not enabled, firstScissor must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-firstScissor-00593)~^~ -VALIDATION_ERROR_1d8004a4~^~N~^~Unknown~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-scissorCount-00594~^~core~^~The spec valid usage text states 'If the multiple viewports feature is not enabled, scissorCount must be 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-scissorCount-00594)~^~ -VALIDATION_ERROR_1d8004a6~^~Y~^~ViewportAndScissorBoundsChecking~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-x-00595~^~core~^~The spec valid usage text states 'The x and y members of offset must be greater than or equal to 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-x-00595)~^~ -VALIDATION_ERROR_1d8004a8~^~Y~^~ViewportAndScissorBoundsChecking~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-offset-00596~^~core~^~The spec valid usage text states 'Evaluation of (offset.x + extent.width) must not cause a signed integer addition overflow' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-offset-00596)~^~ -VALIDATION_ERROR_1d8004aa~^~Y~^~ViewportAndScissorBoundsChecking~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-offset-00597~^~core~^~The spec valid usage text states 'Evaluation of (offset.y + extent.height) must not cause a signed integer addition overflow' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-offset-00597)~^~ +VALIDATION_ERROR_1d8004a0~^~Y~^~SetDynScissorParamMultiviewportTests~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-firstScissor-00592~^~core~^~The spec valid usage text states 'The sum of firstScissor and scissorCount must be between 1 and VkPhysicalDeviceLimits::maxViewports, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-firstScissor-00592)~^~ +VALIDATION_ERROR_1d8004a2~^~Y~^~SetDynScissorParamTests~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-firstScissor-00593~^~core~^~The spec valid usage text states 'If the multiple viewports feature is not enabled, firstScissor must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-firstScissor-00593)~^~ +VALIDATION_ERROR_1d8004a4~^~Y~^~SetDynScissorParamTests~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-scissorCount-00594~^~core~^~The spec valid usage text states 'If the multiple viewports feature is not enabled, scissorCount must be 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-scissorCount-00594)~^~ +VALIDATION_ERROR_1d8004a6~^~Y~^~SetDynScissorParamTests~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-x-00595~^~core~^~The spec valid usage text states 'The x and y members of offset must be greater than or equal to 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-x-00595)~^~ +VALIDATION_ERROR_1d8004a8~^~Y~^~SetDynScissorParamTests~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-offset-00596~^~core~^~The spec valid usage text states 'Evaluation of (offset.x + extent.width) must not cause a signed integer addition overflow' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-offset-00596)~^~ +VALIDATION_ERROR_1d8004aa~^~Y~^~SetDynScissorParamTests~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-offset-00597~^~core~^~The spec valid usage text states 'Evaluation of (offset.y + extent.height) must not cause a signed integer addition overflow' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-offset-00597)~^~ VALIDATION_ERROR_1d802401~^~Y~^~None~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1d802413~^~N~^~Unknown~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1d802413~^~Y~^~None~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1d802415~^~Y~^~Unknown~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1d822601~^~Y~^~Unknown~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-pScissors-parameter~^~core~^~The spec valid usage text states 'pScissors must be a valid pointer to an array of scissorCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-pScissors-parameter)~^~implicit VALIDATION_ERROR_1d82b61b~^~Y~^~Unknown~^~vkCmdSetScissor~^~VUID-vkCmdSetScissor-scissorCount-arraylength~^~core~^~The spec valid usage text states 'scissorCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-scissorCount-arraylength)~^~implicit -VALIDATION_ERROR_1da004b4~^~Y~^~Unknown~^~vkCmdSetStencilCompareMask~^~VUID-vkCmdSetStencilCompareMask-None-00602~^~core~^~The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilCompareMask-None-00602)~^~ +VALIDATION_ERROR_1da004b4~^~Y~^~Unknown~^~vkCmdSetStencilCompareMask~^~VUID-vkCmdSetStencilCompareMask-None-00602~^~core~^~The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilCompareMask-None-00602)~^~ VALIDATION_ERROR_1da02401~^~Y~^~None~^~vkCmdSetStencilCompareMask~^~VUID-vkCmdSetStencilCompareMask-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilCompareMask-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1da02413~^~N~^~Unknown~^~vkCmdSetStencilCompareMask~^~VUID-vkCmdSetStencilCompareMask-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilCompareMask-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1da02413~^~Y~^~None~^~vkCmdSetStencilCompareMask~^~VUID-vkCmdSetStencilCompareMask-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilCompareMask-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1da02415~^~Y~^~Unknown~^~vkCmdSetStencilCompareMask~^~VUID-vkCmdSetStencilCompareMask-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilCompareMask-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1da08401~^~N~^~Unknown~^~vkCmdSetStencilCompareMask~^~VUID-vkCmdSetStencilCompareMask-faceMask-parameter~^~core~^~The spec valid usage text states 'faceMask must be a valid combination of VkStencilFaceFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilCompareMask-faceMask-parameter)~^~implicit VALIDATION_ERROR_1da08403~^~Y~^~Unknown~^~vkCmdSetStencilCompareMask~^~VUID-vkCmdSetStencilCompareMask-faceMask-requiredbitmask~^~core~^~The spec valid usage text states 'faceMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilCompareMask-faceMask-requiredbitmask)~^~implicit -VALIDATION_ERROR_1dc004b8~^~Y~^~Unknown~^~vkCmdSetStencilReference~^~VUID-vkCmdSetStencilReference-None-00604~^~core~^~The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_STENCIL_REFERENCE dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilReference-None-00604)~^~ +VALIDATION_ERROR_1dc004b8~^~Y~^~Unknown~^~vkCmdSetStencilReference~^~VUID-vkCmdSetStencilReference-None-00604~^~core~^~The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_STENCIL_REFERENCE dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilReference-None-00604)~^~ VALIDATION_ERROR_1dc02401~^~Y~^~None~^~vkCmdSetStencilReference~^~VUID-vkCmdSetStencilReference-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilReference-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1dc02413~^~N~^~Unknown~^~vkCmdSetStencilReference~^~VUID-vkCmdSetStencilReference-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilReference-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1dc02413~^~Y~^~None~^~vkCmdSetStencilReference~^~VUID-vkCmdSetStencilReference-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilReference-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1dc02415~^~Y~^~Unknown~^~vkCmdSetStencilReference~^~VUID-vkCmdSetStencilReference-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilReference-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1dc08401~^~N~^~Unknown~^~vkCmdSetStencilReference~^~VUID-vkCmdSetStencilReference-faceMask-parameter~^~core~^~The spec valid usage text states 'faceMask must be a valid combination of VkStencilFaceFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilReference-faceMask-parameter)~^~implicit VALIDATION_ERROR_1dc08403~^~Y~^~Unknown~^~vkCmdSetStencilReference~^~VUID-vkCmdSetStencilReference-faceMask-requiredbitmask~^~core~^~The spec valid usage text states 'faceMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilReference-faceMask-requiredbitmask)~^~implicit -VALIDATION_ERROR_1de004b6~^~Y~^~Unknown~^~vkCmdSetStencilWriteMask~^~VUID-vkCmdSetStencilWriteMask-None-00603~^~core~^~The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_STENCIL_WRITE_MASK dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilWriteMask-None-00603)~^~ +VALIDATION_ERROR_1de004b6~^~Y~^~Unknown~^~vkCmdSetStencilWriteMask~^~VUID-vkCmdSetStencilWriteMask-None-00603~^~core~^~The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_STENCIL_WRITE_MASK dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilWriteMask-None-00603)~^~ VALIDATION_ERROR_1de02401~^~Y~^~None~^~vkCmdSetStencilWriteMask~^~VUID-vkCmdSetStencilWriteMask-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilWriteMask-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1de02413~^~N~^~Unknown~^~vkCmdSetStencilWriteMask~^~VUID-vkCmdSetStencilWriteMask-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilWriteMask-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1de02413~^~Y~^~None~^~vkCmdSetStencilWriteMask~^~VUID-vkCmdSetStencilWriteMask-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilWriteMask-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1de02415~^~Y~^~Unknown~^~vkCmdSetStencilWriteMask~^~VUID-vkCmdSetStencilWriteMask-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilWriteMask-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1de08401~^~N~^~Unknown~^~vkCmdSetStencilWriteMask~^~VUID-vkCmdSetStencilWriteMask-faceMask-parameter~^~core~^~The spec valid usage text states 'faceMask must be a valid combination of VkStencilFaceFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilWriteMask-faceMask-parameter)~^~implicit VALIDATION_ERROR_1de08403~^~Y~^~Unknown~^~vkCmdSetStencilWriteMask~^~VUID-vkCmdSetStencilWriteMask-faceMask-requiredbitmask~^~core~^~The spec valid usage text states 'faceMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilWriteMask-faceMask-requiredbitmask)~^~implicit -VALIDATION_ERROR_1e00098a~^~Y~^~Unknown~^~vkCmdSetViewport~^~VUID-vkCmdSetViewport-None-01221~^~core~^~The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_VIEWPORT dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-None-01221)~^~ -VALIDATION_ERROR_1e00098c~^~N~^~Unknown~^~vkCmdSetViewport~^~VUID-vkCmdSetViewport-firstViewport-01222~^~core~^~The spec valid usage text states 'firstViewport must be less than VkPhysicalDeviceLimits::maxViewports' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-firstViewport-01222)~^~ -VALIDATION_ERROR_1e00098e~^~N~^~Unknown~^~vkCmdSetViewport~^~VUID-vkCmdSetViewport-firstViewport-01223~^~core~^~The spec valid usage text states 'The sum of firstViewport and viewportCount must be between 1 and VkPhysicalDeviceLimits::maxViewports, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-firstViewport-01223)~^~ -VALIDATION_ERROR_1e000990~^~N~^~Unknown~^~vkCmdSetViewport~^~VUID-vkCmdSetViewport-firstViewport-01224~^~core~^~The spec valid usage text states 'If the multiple viewports feature is not enabled, firstViewport must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-firstViewport-01224)~^~ -VALIDATION_ERROR_1e000992~^~N~^~Unknown~^~vkCmdSetViewport~^~VUID-vkCmdSetViewport-viewportCount-01225~^~core~^~The spec valid usage text states 'If the multiple viewports feature is not enabled, viewportCount must be 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-viewportCount-01225)~^~ -VALIDATION_ERROR_1e000994~^~N~^~Unknown~^~vkCmdSetViewport~^~VUID-vkCmdSetViewport-pViewports-01226~^~core~^~The spec valid usage text states 'pViewports must be a valid pointer to an array of viewportCount valid VkViewport structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-pViewports-01226)~^~ +VALIDATION_ERROR_1e00098a~^~Y~^~Unknown~^~vkCmdSetViewport~^~VUID-vkCmdSetViewport-None-01221~^~core~^~The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_VIEWPORT dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-None-01221)~^~ +VALIDATION_ERROR_1e00098c~^~N~^~Unknown~^~vkCmdSetViewport~^~VUID-vkCmdSetViewport-firstViewport-01222~^~core~^~The spec valid usage text states 'firstViewport must be less than VkPhysicalDeviceLimits::maxViewports' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-firstViewport-01222)~^~redundant VU +VALIDATION_ERROR_1e00098e~^~Y~^~SetDynViewportParamMultiviewportTests~^~vkCmdSetViewport~^~VUID-vkCmdSetViewport-firstViewport-01223~^~core~^~The spec valid usage text states 'The sum of firstViewport and viewportCount must be between 1 and VkPhysicalDeviceLimits::maxViewports, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-firstViewport-01223)~^~ +VALIDATION_ERROR_1e000990~^~Y~^~SetDynViewportParamTests~^~vkCmdSetViewport~^~VUID-vkCmdSetViewport-firstViewport-01224~^~core~^~The spec valid usage text states 'If the multiple viewports feature is not enabled, firstViewport must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-firstViewport-01224)~^~ +VALIDATION_ERROR_1e000992~^~Y~^~SetDynViewportParamTests~^~vkCmdSetViewport~^~VUID-vkCmdSetViewport-viewportCount-01225~^~core~^~The spec valid usage text states 'If the multiple viewports feature is not enabled, viewportCount must be 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-viewportCount-01225)~^~ VALIDATION_ERROR_1e002401~^~Y~^~None~^~vkCmdSetViewport~^~VUID-vkCmdSetViewport-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1e002413~^~N~^~Unknown~^~vkCmdSetViewport~^~VUID-vkCmdSetViewport-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1e002413~^~Y~^~None~^~vkCmdSetViewport~^~VUID-vkCmdSetViewport-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1e002415~^~Y~^~CommandQueueFlags~^~vkCmdSetViewport~^~VUID-vkCmdSetViewport-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_1e030a1b~^~N~^~Unknown~^~vkCmdSetViewport~^~VUID-vkCmdSetViewport-viewportCount-arraylength~^~core~^~The spec valid usage text states 'viewportCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-viewportCount-arraylength)~^~implicit -VALIDATION_ERROR_1e200a54~^~N~^~Unknown~^~vkCmdSetViewportWScalingNV~^~VUID-vkCmdSetViewportWScalingNV-None-01322~^~core~^~The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-None-01322)~^~ -VALIDATION_ERROR_1e200a56~^~N~^~Unknown~^~vkCmdSetViewportWScalingNV~^~VUID-vkCmdSetViewportWScalingNV-firstViewport-01323~^~core~^~The spec valid usage text states 'firstViewport must be less than VkPhysicalDeviceLimits::maxViewports' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-firstViewport-01323)~^~ -VALIDATION_ERROR_1e200a58~^~N~^~Unknown~^~vkCmdSetViewportWScalingNV~^~VUID-vkCmdSetViewportWScalingNV-firstViewport-01324~^~core~^~The spec valid usage text states 'The sum of firstViewport and viewportCount must be between 1 and VkPhysicalDeviceLimits::maxViewports, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-firstViewport-01324)~^~ -VALIDATION_ERROR_1e200a5a~^~N~^~Unknown~^~vkCmdSetViewportWScalingNV~^~VUID-vkCmdSetViewportWScalingNV-pViewportScalings-01325~^~core~^~The spec valid usage text states 'pViewportScalings must be a pointer to an array of viewportCount valid VkViewportWScalingNV structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-pViewportScalings-01325)~^~ -VALIDATION_ERROR_1e202401~^~Y~^~Unknown~^~vkCmdSetViewportWScalingNV~^~VUID-vkCmdSetViewportWScalingNV-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1e202413~^~N~^~Unknown~^~vkCmdSetViewportWScalingNV~^~VUID-vkCmdSetViewportWScalingNV-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-commandBuffer-recording)~^~implicit -VALIDATION_ERROR_1e202415~^~N~^~Unknown~^~vkCmdSetViewportWScalingNV~^~VUID-vkCmdSetViewportWScalingNV-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_1e230a1b~^~N~^~Unknown~^~vkCmdSetViewportWScalingNV~^~VUID-vkCmdSetViewportWScalingNV-viewportCount-arraylength~^~core~^~The spec valid usage text states 'viewportCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-viewportCount-arraylength)~^~implicit +VALIDATION_ERROR_1e030a1b~^~Y~^~SetDynViewportParamTests~^~vkCmdSetViewport~^~VUID-vkCmdSetViewport-viewportCount-arraylength~^~core~^~The spec valid usage text states 'viewportCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-viewportCount-arraylength)~^~implicit +VALIDATION_ERROR_1e03fa01~^~Y~^~SetDynViewportParamTests~^~vkCmdSetViewport~^~VUID-vkCmdSetViewport-pViewports-parameter~^~core~^~The spec valid usage text states 'pViewports must be a valid pointer to an array of viewportCount VkViewport structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-pViewports-parameter)~^~implicit +VALIDATION_ERROR_1e200a54~^~N~^~Unknown~^~vkCmdSetViewportWScalingNV~^~VUID-vkCmdSetViewportWScalingNV-None-01322~^~(VK_NV_clip_space_w_scaling)~^~The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-None-01322)~^~ +VALIDATION_ERROR_1e200a56~^~N~^~Unknown~^~vkCmdSetViewportWScalingNV~^~VUID-vkCmdSetViewportWScalingNV-firstViewport-01323~^~(VK_NV_clip_space_w_scaling)~^~The spec valid usage text states 'firstViewport must be less than VkPhysicalDeviceLimits::maxViewports' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-firstViewport-01323)~^~ +VALIDATION_ERROR_1e200a58~^~N~^~Unknown~^~vkCmdSetViewportWScalingNV~^~VUID-vkCmdSetViewportWScalingNV-firstViewport-01324~^~(VK_NV_clip_space_w_scaling)~^~The spec valid usage text states 'The sum of firstViewport and viewportCount must be between 1 and VkPhysicalDeviceLimits::maxViewports, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-firstViewport-01324)~^~ +VALIDATION_ERROR_1e202401~^~Y~^~Unknown~^~vkCmdSetViewportWScalingNV~^~VUID-vkCmdSetViewportWScalingNV-commandBuffer-parameter~^~(VK_NV_clip_space_w_scaling)~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-commandBuffer-parameter)~^~implicit +VALIDATION_ERROR_1e202413~^~N~^~Unknown~^~vkCmdSetViewportWScalingNV~^~VUID-vkCmdSetViewportWScalingNV-commandBuffer-recording~^~(VK_NV_clip_space_w_scaling)~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1e202415~^~N~^~Unknown~^~vkCmdSetViewportWScalingNV~^~VUID-vkCmdSetViewportWScalingNV-commandBuffer-cmdpool~^~(VK_NV_clip_space_w_scaling)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-commandBuffer-cmdpool)~^~implicit +VALIDATION_ERROR_1e230a1b~^~Y~^~Unknown~^~vkCmdSetViewportWScalingNV~^~VUID-vkCmdSetViewportWScalingNV-viewportCount-arraylength~^~(VK_NV_clip_space_w_scaling)~^~The spec valid usage text states 'viewportCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-viewportCount-arraylength)~^~implicit +VALIDATION_ERROR_1e23fc01~^~Y~^~None~^~vkCmdSetViewportWScalingNV~^~VUID-vkCmdSetViewportWScalingNV-pViewportWScalings-parameter~^~(VK_NV_clip_space_w_scaling)~^~The spec valid usage text states 'pViewportWScalings must be a valid pointer to an array of viewportCount VkViewportWScalingNV structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-pViewportWScalings-parameter)~^~implicit VALIDATION_ERROR_1e400009~^~Y~^~Unknown~^~vkCmdUpdateBuffer~^~VUID-vkCmdUpdateBuffer-commonparent~^~core~^~The spec valid usage text states 'Both of commandBuffer, and dstBuffer must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-commonparent)~^~implicit VALIDATION_ERROR_1e400017~^~Y~^~Unknown~^~vkCmdUpdateBuffer~^~VUID-vkCmdUpdateBuffer-renderpass~^~core~^~The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-renderpass)~^~implicit VALIDATION_ERROR_1e400040~^~N~^~Unknown~^~vkCmdUpdateBuffer~^~VUID-vkCmdUpdateBuffer-dstOffset-00032~^~core~^~The spec valid usage text states 'dstOffset must be less than the size of dstBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-dstOffset-00032)~^~ @@ -2522,8 +2578,10 @@ VALIDATION_ERROR_1e400048~^~Y~^~Unknown~^~vkCmdUpdateBuffer~^~VUID-vkCmdUpdateBuffer-dstOffset-00036~^~core~^~The spec valid usage text states 'dstOffset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-dstOffset-00036)~^~ VALIDATION_ERROR_1e40004a~^~Y~^~Unknown~^~vkCmdUpdateBuffer~^~VUID-vkCmdUpdateBuffer-dataSize-00037~^~core~^~The spec valid usage text states 'dataSize must be less than or equal to 65536' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-dataSize-00037)~^~ VALIDATION_ERROR_1e40004c~^~Y~^~Unknown~^~vkCmdUpdateBuffer~^~VUID-vkCmdUpdateBuffer-dataSize-00038~^~core~^~The spec valid usage text states 'dataSize must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-dataSize-00038)~^~ +VALIDATION_ERROR_1e400e2a~^~N~^~None~^~vkCmdUpdateBuffer~^~VUID-vkCmdUpdateBuffer-commandBuffer-01813~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstBuffer must not be a protected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdUpdateBuffer-commandBuffer-01813)~^~ +VALIDATION_ERROR_1e400e2c~^~N~^~None~^~vkCmdUpdateBuffer~^~VUID-vkCmdUpdateBuffer-commandBuffer-01814~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstBuffer must not be an unprotected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdUpdateBuffer-commandBuffer-01814)~^~ VALIDATION_ERROR_1e402401~^~Y~^~None~^~vkCmdUpdateBuffer~^~VUID-vkCmdUpdateBuffer-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1e402413~^~N~^~Unknown~^~vkCmdUpdateBuffer~^~VUID-vkCmdUpdateBuffer-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1e402413~^~Y~^~None~^~vkCmdUpdateBuffer~^~VUID-vkCmdUpdateBuffer-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1e402415~^~Y~^~Unknown~^~vkCmdUpdateBuffer~^~VUID-vkCmdUpdateBuffer-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1e403c1b~^~Y~^~Unknown~^~vkCmdUpdateBuffer~^~VUID-vkCmdUpdateBuffer-dataSize-arraylength~^~core~^~The spec valid usage text states 'dataSize must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-dataSize-arraylength)~^~implicit VALIDATION_ERROR_1e406c01~^~Y~^~None~^~vkCmdUpdateBuffer~^~VUID-vkCmdUpdateBuffer-dstBuffer-parameter~^~core~^~The spec valid usage text states 'dstBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-dstBuffer-parameter)~^~implicit @@ -2538,9 +2596,9 @@ VALIDATION_ERROR_1e600918~^~Y~^~InvalidBarriers~^~vkCmdWaitEvents~^~VUID-vkCmdWaitEvents-srcStageMask-01164~^~core~^~The spec valid usage text states 'Any pipeline stage included in srcStageMask or dstStageMask must be supported by the capabilities of the queue family specified by the queueFamilyIndex member of the VkCommandPoolCreateInfo structure that was used to create the VkCommandPool that commandBuffer was allocated from, as specified in the table of supported pipeline stages.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWaitEvents-srcStageMask-01164)~^~ VALIDATION_ERROR_1e60091a~^~N~^~Unknown~^~vkCmdWaitEvents~^~VUID-vkCmdWaitEvents-pMemoryBarriers-01165~^~core~^~The spec valid usage text states 'Each element of pMemoryBarriers, pBufferMemoryBarriers or pImageMemoryBarriers must not have any access flag included in its srcAccessMask member if that bit is not supported by any of the pipeline stages in srcStageMask, as specified in the table of supported access types.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWaitEvents-pMemoryBarriers-01165)~^~ VALIDATION_ERROR_1e60091c~^~N~^~Unknown~^~vkCmdWaitEvents~^~VUID-vkCmdWaitEvents-pMemoryBarriers-01166~^~core~^~The spec valid usage text states 'Each element of pMemoryBarriers, pBufferMemoryBarriers or pImageMemoryBarriers must not have any access flag included in its dstAccessMask member if that bit is not supported by any of the pipeline stages in dstStageMask, as specified in the table of supported access types.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWaitEvents-pMemoryBarriers-01166)~^~ -VALIDATION_ERROR_1e60091e~^~N~^~Unknown~^~vkCmdWaitEvents~^~VUID-vkCmdWaitEvents-commandBuffer-01167~^~(VK_KHX_device_group)~^~The spec valid usage text states 'commandBuffer's current device mask must include exactly one physical device.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWaitEvents-commandBuffer-01167)~^~ +VALIDATION_ERROR_1e60091e~^~N~^~Unknown~^~vkCmdWaitEvents~^~VUID-vkCmdWaitEvents-commandBuffer-01167~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'commandBuffer's current device mask must include exactly one physical device.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWaitEvents-commandBuffer-01167)~^~ VALIDATION_ERROR_1e602401~^~Y~^~None~^~vkCmdWaitEvents~^~VUID-vkCmdWaitEvents-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWaitEvents-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1e602413~^~N~^~Unknown~^~vkCmdWaitEvents~^~VUID-vkCmdWaitEvents-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWaitEvents-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1e602413~^~Y~^~None~^~vkCmdWaitEvents~^~VUID-vkCmdWaitEvents-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWaitEvents-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1e602415~^~Y~^~Unknown~^~vkCmdWaitEvents~^~VUID-vkCmdWaitEvents-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWaitEvents-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1e607801~^~N~^~Unknown~^~vkCmdWaitEvents~^~VUID-vkCmdWaitEvents-dstStageMask-parameter~^~core~^~The spec valid usage text states 'dstStageMask must be a valid combination of VkPipelineStageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWaitEvents-dstStageMask-parameter)~^~implicit VALIDATION_ERROR_1e607803~^~Y~^~Unknown~^~vkCmdWaitEvents~^~VUID-vkCmdWaitEvents-dstStageMask-requiredbitmask~^~core~^~The spec valid usage text states 'dstStageMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWaitEvents-dstStageMask-requiredbitmask)~^~implicit @@ -2554,18 +2612,18 @@ VALIDATION_ERROR_1e800009~^~Y~^~Unknown~^~vkCmdWriteTimestamp~^~VUID-vkCmdWriteTimestamp-commonparent~^~core~^~The spec valid usage text states 'Both of commandBuffer, and queryPool must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWriteTimestamp-commonparent)~^~implicit VALIDATION_ERROR_1e800678~^~N~^~Unknown~^~vkCmdWriteTimestamp~^~VUID-vkCmdWriteTimestamp-queryPool-00828~^~core~^~The spec valid usage text states 'The query identified by queryPool and query must be unavailable' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWriteTimestamp-queryPool-00828)~^~ VALIDATION_ERROR_1e80067a~^~N~^~Unknown~^~vkCmdWriteTimestamp~^~VUID-vkCmdWriteTimestamp-timestampValidBits-00829~^~core~^~The spec valid usage text states 'The command pool's queue family must support a non-zero timestampValidBits' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWriteTimestamp-timestampValidBits-00829)~^~ -VALIDATION_ERROR_1e80067c~^~N~^~Unknown~^~vkCmdWriteTimestamp~^~VUID-vkCmdWriteTimestamp-None-00830~^~(VK_KHX_multiview)~^~The spec valid usage text states 'All queries used by the command must be unavailable' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteTimestamp-None-00830)~^~ -VALIDATION_ERROR_1e80067e~^~N~^~Unknown~^~vkCmdWriteTimestamp~^~VUID-vkCmdWriteTimestamp-query-00831~^~(VK_KHX_multiview)~^~The spec valid usage text states 'If vkCmdWriteTimestamp is called within a render pass instance, the sum of query and the number of bits set in the current subpass's view mask must be less than or equal to the number of queries in queryPool' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteTimestamp-query-00831)~^~ +VALIDATION_ERROR_1e80067c~^~N~^~Unknown~^~vkCmdWriteTimestamp~^~VUID-vkCmdWriteTimestamp-None-00830~^~(VK_VERSION_1_1,VK_KHR_multiview)~^~The spec valid usage text states 'All queries used by the command must be unavailable' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteTimestamp-None-00830)~^~ +VALIDATION_ERROR_1e80067e~^~N~^~Unknown~^~vkCmdWriteTimestamp~^~VUID-vkCmdWriteTimestamp-query-00831~^~(VK_VERSION_1_1,VK_KHR_multiview)~^~The spec valid usage text states 'If vkCmdWriteTimestamp is called within a render pass instance, the sum of query and the number of bits set in the current subpass's view mask must be less than or equal to the number of queries in queryPool' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteTimestamp-query-00831)~^~ VALIDATION_ERROR_1e800b10~^~N~^~None~^~vkCmdWriteTimestamp~^~VUID-vkCmdWriteTimestamp-queryPool-01416~^~core~^~The spec valid usage text states 'queryPool must have been created with a queryType of VK_QUERY_TYPE_TIMESTAMP' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWriteTimestamp-queryPool-01416)~^~ VALIDATION_ERROR_1e802401~^~Y~^~None~^~vkCmdWriteTimestamp~^~VUID-vkCmdWriteTimestamp-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWriteTimestamp-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_1e802413~^~N~^~Unknown~^~vkCmdWriteTimestamp~^~VUID-vkCmdWriteTimestamp-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWriteTimestamp-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_1e802413~^~Y~^~None~^~vkCmdWriteTimestamp~^~VUID-vkCmdWriteTimestamp-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWriteTimestamp-commandBuffer-recording)~^~implicit VALIDATION_ERROR_1e802415~^~Y~^~Unknown~^~vkCmdWriteTimestamp~^~VUID-vkCmdWriteTimestamp-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWriteTimestamp-commandBuffer-cmdpool)~^~implicit VALIDATION_ERROR_1e828401~^~Y~^~Unknown~^~vkCmdWriteTimestamp~^~VUID-vkCmdWriteTimestamp-pipelineStage-parameter~^~core~^~The spec valid usage text states 'pipelineStage must be a valid VkPipelineStageFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWriteTimestamp-pipelineStage-parameter)~^~implicit VALIDATION_ERROR_1e829801~^~Y~^~None~^~vkCmdWriteTimestamp~^~VUID-vkCmdWriteTimestamp-queryPool-parameter~^~core~^~The spec valid usage text states 'queryPool must be a valid VkQueryPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWriteTimestamp-queryPool-parameter)~^~implicit -VALIDATION_ERROR_1ea0bc01~^~Y~^~None~^~vkCreateAndroidSurfaceKHR~^~VUID-vkCreateAndroidSurfaceKHR-instance-parameter~^~core~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateAndroidSurfaceKHR-instance-parameter)~^~implicit -VALIDATION_ERROR_1ea0ec01~^~N~^~Unknown~^~vkCreateAndroidSurfaceKHR~^~VUID-vkCreateAndroidSurfaceKHR-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateAndroidSurfaceKHR-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_1ea11e01~^~N~^~Unknown~^~vkCreateAndroidSurfaceKHR~^~VUID-vkCreateAndroidSurfaceKHR-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkAndroidSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateAndroidSurfaceKHR-pCreateInfo-parameter)~^~implicit -VALIDATION_ERROR_1ea24801~^~Y~^~Unknown~^~vkCreateAndroidSurfaceKHR~^~VUID-vkCreateAndroidSurfaceKHR-pSurface-parameter~^~core~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateAndroidSurfaceKHR-pSurface-parameter)~^~implicit +VALIDATION_ERROR_1ea0bc01~^~Y~^~None~^~vkCreateAndroidSurfaceKHR~^~VUID-vkCreateAndroidSurfaceKHR-instance-parameter~^~(VK_KHR_surface)+(VK_KHR_android_surface)~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateAndroidSurfaceKHR-instance-parameter)~^~implicit +VALIDATION_ERROR_1ea0ec01~^~N~^~Unknown~^~vkCreateAndroidSurfaceKHR~^~VUID-vkCreateAndroidSurfaceKHR-pAllocator-parameter~^~(VK_KHR_surface)+(VK_KHR_android_surface)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateAndroidSurfaceKHR-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_1ea11e01~^~N~^~Unknown~^~vkCreateAndroidSurfaceKHR~^~VUID-vkCreateAndroidSurfaceKHR-pCreateInfo-parameter~^~(VK_KHR_surface)+(VK_KHR_android_surface)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkAndroidSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateAndroidSurfaceKHR-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_1ea24801~^~Y~^~Unknown~^~vkCreateAndroidSurfaceKHR~^~VUID-vkCreateAndroidSurfaceKHR-pSurface-parameter~^~(VK_KHR_surface)+(VK_KHR_android_surface)~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateAndroidSurfaceKHR-pSurface-parameter)~^~implicit VALIDATION_ERROR_1ec0071e~^~N~^~None~^~vkCreateBuffer~^~VUID-vkCreateBuffer-flags-00911~^~core~^~The spec valid usage text states 'If the flags member of pCreateInfo includes VK_BUFFER_CREATE_SPARSE_BINDING_BIT, creating this VkBuffer must not cause the total required sparse memory for all currently valid sparse resources on the device to exceed VkPhysicalDeviceLimits::sparseAddressSpaceSize' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateBuffer-flags-00911)~^~ VALIDATION_ERROR_1ec05601~^~Y~^~None~^~vkCreateBuffer~^~VUID-vkCreateBuffer-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateBuffer-device-parameter)~^~implicit VALIDATION_ERROR_1ec0ec01~^~N~^~None~^~vkCreateBuffer~^~VUID-vkCreateBuffer-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateBuffer-pAllocator-parameter)~^~implicit @@ -2588,10 +2646,10 @@ VALIDATION_ERROR_1f21e201~^~Y~^~Unknown~^~vkCreateComputePipelines~^~VUID-vkCreateComputePipelines-pPipelines-parameter~^~core~^~The spec valid usage text states 'pPipelines must be a valid pointer to an array of createInfoCount VkPipeline handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateComputePipelines-pPipelines-parameter)~^~implicit VALIDATION_ERROR_1f228001~^~Y~^~None~^~vkCreateComputePipelines~^~VUID-vkCreateComputePipelines-pipelineCache-parameter~^~core~^~The spec valid usage text states 'If pipelineCache is not VK_NULL_HANDLE, pipelineCache must be a valid VkPipelineCache handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateComputePipelines-pipelineCache-parameter)~^~implicit VALIDATION_ERROR_1f228007~^~Y~^~Unknown~^~vkCreateComputePipelines~^~VUID-vkCreateComputePipelines-pipelineCache-parent~^~core~^~The spec valid usage text states 'If pipelineCache is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateComputePipelines-pipelineCache-parent)~^~implicit -VALIDATION_ERROR_1f40bc01~^~N~^~Unknown~^~vkCreateDebugReportCallbackEXT~^~VUID-vkCreateDebugReportCallbackEXT-instance-parameter~^~core~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDebugReportCallbackEXT-instance-parameter)~^~implicit -VALIDATION_ERROR_1f40ec01~^~N~^~Unknown~^~vkCreateDebugReportCallbackEXT~^~VUID-vkCreateDebugReportCallbackEXT-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDebugReportCallbackEXT-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_1f410801~^~Y~^~Unknown~^~vkCreateDebugReportCallbackEXT~^~VUID-vkCreateDebugReportCallbackEXT-pCallback-parameter~^~core~^~The spec valid usage text states 'pCallback must be a valid pointer to a VkDebugReportCallbackEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDebugReportCallbackEXT-pCallback-parameter)~^~implicit -VALIDATION_ERROR_1f411e01~^~N~^~Unknown~^~vkCreateDebugReportCallbackEXT~^~VUID-vkCreateDebugReportCallbackEXT-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDebugReportCallbackCreateInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDebugReportCallbackEXT-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_1f40bc01~^~N~^~Unknown~^~vkCreateDebugReportCallbackEXT~^~VUID-vkCreateDebugReportCallbackEXT-instance-parameter~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDebugReportCallbackEXT-instance-parameter)~^~implicit +VALIDATION_ERROR_1f40ec01~^~N~^~Unknown~^~vkCreateDebugReportCallbackEXT~^~VUID-vkCreateDebugReportCallbackEXT-pAllocator-parameter~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDebugReportCallbackEXT-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_1f410801~^~Y~^~Unknown~^~vkCreateDebugReportCallbackEXT~^~VUID-vkCreateDebugReportCallbackEXT-pCallback-parameter~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'pCallback must be a valid pointer to a VkDebugReportCallbackEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDebugReportCallbackEXT-pCallback-parameter)~^~implicit +VALIDATION_ERROR_1f411e01~^~N~^~Unknown~^~vkCreateDebugReportCallbackEXT~^~VUID-vkCreateDebugReportCallbackEXT-pCreateInfo-parameter~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDebugReportCallbackCreateInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDebugReportCallbackEXT-pCreateInfo-parameter)~^~implicit VALIDATION_ERROR_1f605601~^~Y~^~None~^~vkCreateDescriptorPool~^~VUID-vkCreateDescriptorPool-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorPool-device-parameter)~^~implicit VALIDATION_ERROR_1f60ec01~^~N~^~Unknown~^~vkCreateDescriptorPool~^~VUID-vkCreateDescriptorPool-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorPool-pAllocator-parameter)~^~implicit VALIDATION_ERROR_1f611e01~^~N~^~Unknown~^~vkCreateDescriptorPool~^~VUID-vkCreateDescriptorPool-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDescriptorPoolCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorPool-pCreateInfo-parameter)~^~implicit @@ -2600,24 +2658,24 @@ VALIDATION_ERROR_1f80ec01~^~N~^~Unknown~^~vkCreateDescriptorSetLayout~^~VUID-vkCreateDescriptorSetLayout-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorSetLayout-pAllocator-parameter)~^~implicit VALIDATION_ERROR_1f811e01~^~N~^~Unknown~^~vkCreateDescriptorSetLayout~^~VUID-vkCreateDescriptorSetLayout-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDescriptorSetLayoutCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorSetLayout-pCreateInfo-parameter)~^~implicit VALIDATION_ERROR_1f822a01~^~Y~^~Unknown~^~vkCreateDescriptorSetLayout~^~VUID-vkCreateDescriptorSetLayout-pSetLayout-parameter~^~core~^~The spec valid usage text states 'pSetLayout must be a valid pointer to a VkDescriptorSetLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorSetLayout-pSetLayout-parameter)~^~implicit -VALIDATION_ERROR_1fa05601~^~Y~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-vkCreateDescriptorUpdateTemplateKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorUpdateTemplateKHR-device-parameter)~^~implicit -VALIDATION_ERROR_1fa0ec01~^~N~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-vkCreateDescriptorUpdateTemplateKHR-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorUpdateTemplateKHR-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_1fa11e01~^~N~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-vkCreateDescriptorUpdateTemplateKHR-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDescriptorUpdateTemplateCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorUpdateTemplateKHR-pCreateInfo-parameter)~^~implicit -VALIDATION_ERROR_1fa13401~^~Y~^~Unknown~^~vkCreateDescriptorUpdateTemplateKHR~^~VUID-vkCreateDescriptorUpdateTemplateKHR-pDescriptorUpdateTemplate-parameter~^~core~^~The spec valid usage text states 'pDescriptorUpdateTemplate must be a valid pointer to a VkDescriptorUpdateTemplateKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorUpdateTemplateKHR-pDescriptorUpdateTemplate-parameter)~^~implicit +VALIDATION_ERROR_1fa05601~^~Y~^~Unknown~^~vkCreateDescriptorUpdateTemplate~^~VUID-vkCreateDescriptorUpdateTemplate-device-parameter~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDescriptorUpdateTemplate-device-parameter)~^~implicit +VALIDATION_ERROR_1fa0ec01~^~N~^~Unknown~^~vkCreateDescriptorUpdateTemplate~^~VUID-vkCreateDescriptorUpdateTemplate-pAllocator-parameter~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDescriptorUpdateTemplate-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_1fa11e01~^~N~^~Unknown~^~vkCreateDescriptorUpdateTemplate~^~VUID-vkCreateDescriptorUpdateTemplate-pCreateInfo-parameter~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDescriptorUpdateTemplateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDescriptorUpdateTemplate-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_1fa13401~^~Y~^~Unknown~^~vkCreateDescriptorUpdateTemplate~^~VUID-vkCreateDescriptorUpdateTemplate-pDescriptorUpdateTemplate-parameter~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'pDescriptorUpdateTemplate must be a valid pointer to a VkDescriptorUpdateTemplate handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDescriptorUpdateTemplate-pDescriptorUpdateTemplate-parameter)~^~implicit VALIDATION_ERROR_1fc00ad6~^~N~^~None~^~vkCreateDevice~^~VUID-vkCreateDevice-ppEnabledExtensionNames-01387~^~core~^~The spec valid usage text states 'All required extensions for each extension in the VkDeviceCreateInfo::ppEnabledExtensionNames list must also be present in that list.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDevice-ppEnabledExtensionNames-01387)~^~ VALIDATION_ERROR_1fc0ec01~^~N~^~Unknown~^~vkCreateDevice~^~VUID-vkCreateDevice-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDevice-pAllocator-parameter)~^~implicit VALIDATION_ERROR_1fc11e01~^~N~^~Unknown~^~vkCreateDevice~^~VUID-vkCreateDevice-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDeviceCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDevice-pCreateInfo-parameter)~^~implicit VALIDATION_ERROR_1fc13801~^~Y~^~Unknown~^~vkCreateDevice~^~VUID-vkCreateDevice-pDevice-parameter~^~core~^~The spec valid usage text states 'pDevice must be a valid pointer to a VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDevice-pDevice-parameter)~^~implicit VALIDATION_ERROR_1fc27a01~^~Y~^~Unknown~^~vkCreateDevice~^~VUID-vkCreateDevice-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDevice-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_1fe06001~^~Y~^~Unknown~^~vkCreateDisplayModeKHR~^~VUID-vkCreateDisplayModeKHR-display-parameter~^~core~^~The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDisplayModeKHR-display-parameter)~^~implicit -VALIDATION_ERROR_1fe0ec01~^~N~^~Unknown~^~vkCreateDisplayModeKHR~^~VUID-vkCreateDisplayModeKHR-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDisplayModeKHR-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_1fe11e01~^~N~^~Unknown~^~vkCreateDisplayModeKHR~^~VUID-vkCreateDisplayModeKHR-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDisplayModeCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDisplayModeKHR-pCreateInfo-parameter)~^~implicit -VALIDATION_ERROR_1fe1bc01~^~Y~^~Unknown~^~vkCreateDisplayModeKHR~^~VUID-vkCreateDisplayModeKHR-pMode-parameter~^~core~^~The spec valid usage text states 'pMode must be a valid pointer to a VkDisplayModeKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDisplayModeKHR-pMode-parameter)~^~implicit -VALIDATION_ERROR_1fe27a01~^~Y~^~Unknown~^~vkCreateDisplayModeKHR~^~VUID-vkCreateDisplayModeKHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDisplayModeKHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2000bc01~^~Y~^~None~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-vkCreateDisplayPlaneSurfaceKHR-instance-parameter~^~core~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDisplayPlaneSurfaceKHR-instance-parameter)~^~implicit -VALIDATION_ERROR_2000ec01~^~N~^~Unknown~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-vkCreateDisplayPlaneSurfaceKHR-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDisplayPlaneSurfaceKHR-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_20011e01~^~N~^~Unknown~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-vkCreateDisplayPlaneSurfaceKHR-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDisplaySurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDisplayPlaneSurfaceKHR-pCreateInfo-parameter)~^~implicit -VALIDATION_ERROR_20024801~^~Y~^~Unknown~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-vkCreateDisplayPlaneSurfaceKHR-pSurface-parameter~^~core~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDisplayPlaneSurfaceKHR-pSurface-parameter)~^~implicit +VALIDATION_ERROR_1fe06001~^~Y~^~Unknown~^~vkCreateDisplayModeKHR~^~VUID-vkCreateDisplayModeKHR-display-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDisplayModeKHR-display-parameter)~^~implicit +VALIDATION_ERROR_1fe0ec01~^~N~^~Unknown~^~vkCreateDisplayModeKHR~^~VUID-vkCreateDisplayModeKHR-pAllocator-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDisplayModeKHR-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_1fe11e01~^~N~^~Unknown~^~vkCreateDisplayModeKHR~^~VUID-vkCreateDisplayModeKHR-pCreateInfo-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDisplayModeCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDisplayModeKHR-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_1fe1bc01~^~Y~^~Unknown~^~vkCreateDisplayModeKHR~^~VUID-vkCreateDisplayModeKHR-pMode-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'pMode must be a valid pointer to a VkDisplayModeKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDisplayModeKHR-pMode-parameter)~^~implicit +VALIDATION_ERROR_1fe27a01~^~Y~^~Unknown~^~vkCreateDisplayModeKHR~^~VUID-vkCreateDisplayModeKHR-physicalDevice-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDisplayModeKHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2000bc01~^~Y~^~None~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-vkCreateDisplayPlaneSurfaceKHR-instance-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDisplayPlaneSurfaceKHR-instance-parameter)~^~implicit +VALIDATION_ERROR_2000ec01~^~N~^~Unknown~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-vkCreateDisplayPlaneSurfaceKHR-pAllocator-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDisplayPlaneSurfaceKHR-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_20011e01~^~N~^~Unknown~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-vkCreateDisplayPlaneSurfaceKHR-pCreateInfo-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDisplaySurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDisplayPlaneSurfaceKHR-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_20024801~^~Y~^~Unknown~^~vkCreateDisplayPlaneSurfaceKHR~^~VUID-vkCreateDisplayPlaneSurfaceKHR-pSurface-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDisplayPlaneSurfaceKHR-pSurface-parameter)~^~implicit VALIDATION_ERROR_20205601~^~Y~^~None~^~vkCreateEvent~^~VUID-vkCreateEvent-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateEvent-device-parameter)~^~implicit VALIDATION_ERROR_2020ec01~^~N~^~Unknown~^~vkCreateEvent~^~VUID-vkCreateEvent-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateEvent-pAllocator-parameter)~^~implicit VALIDATION_ERROR_20211e01~^~N~^~Unknown~^~vkCreateEvent~^~VUID-vkCreateEvent-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkEventCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateEvent-pCreateInfo-parameter)~^~implicit @@ -2639,10 +2697,10 @@ VALIDATION_ERROR_2081e201~^~Y~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-vkCreateGraphicsPipelines-pPipelines-parameter~^~core~^~The spec valid usage text states 'pPipelines must be a valid pointer to an array of createInfoCount VkPipeline handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateGraphicsPipelines-pPipelines-parameter)~^~implicit VALIDATION_ERROR_20828001~^~Y~^~None~^~vkCreateGraphicsPipelines~^~VUID-vkCreateGraphicsPipelines-pipelineCache-parameter~^~core~^~The spec valid usage text states 'If pipelineCache is not VK_NULL_HANDLE, pipelineCache must be a valid VkPipelineCache handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateGraphicsPipelines-pipelineCache-parameter)~^~implicit VALIDATION_ERROR_20828007~^~Y~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-vkCreateGraphicsPipelines-pipelineCache-parent~^~core~^~The spec valid usage text states 'If pipelineCache is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateGraphicsPipelines-pipelineCache-parent)~^~implicit -VALIDATION_ERROR_20a0bc01~^~Y~^~Unknown~^~vkCreateIOSSurfaceMVK~^~VUID-vkCreateIOSSurfaceMVK-instance-parameter~^~core~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateIOSSurfaceMVK-instance-parameter)~^~implicit -VALIDATION_ERROR_20a0ec01~^~N~^~Unknown~^~vkCreateIOSSurfaceMVK~^~VUID-vkCreateIOSSurfaceMVK-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateIOSSurfaceMVK-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_20a11e01~^~N~^~Unknown~^~vkCreateIOSSurfaceMVK~^~VUID-vkCreateIOSSurfaceMVK-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkIOSSurfaceCreateInfoMVK structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateIOSSurfaceMVK-pCreateInfo-parameter)~^~implicit -VALIDATION_ERROR_20a24801~^~Y~^~Unknown~^~vkCreateIOSSurfaceMVK~^~VUID-vkCreateIOSSurfaceMVK-pSurface-parameter~^~core~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateIOSSurfaceMVK-pSurface-parameter)~^~implicit +VALIDATION_ERROR_20a0bc01~^~Y~^~Unknown~^~vkCreateIOSSurfaceMVK~^~VUID-vkCreateIOSSurfaceMVK-instance-parameter~^~(VK_KHR_surface)+(VK_MVK_ios_surface)~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateIOSSurfaceMVK-instance-parameter)~^~implicit +VALIDATION_ERROR_20a0ec01~^~N~^~Unknown~^~vkCreateIOSSurfaceMVK~^~VUID-vkCreateIOSSurfaceMVK-pAllocator-parameter~^~(VK_KHR_surface)+(VK_MVK_ios_surface)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateIOSSurfaceMVK-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_20a11e01~^~N~^~Unknown~^~vkCreateIOSSurfaceMVK~^~VUID-vkCreateIOSSurfaceMVK-pCreateInfo-parameter~^~(VK_KHR_surface)+(VK_MVK_ios_surface)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkIOSSurfaceCreateInfoMVK structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateIOSSurfaceMVK-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_20a24801~^~Y~^~Unknown~^~vkCreateIOSSurfaceMVK~^~VUID-vkCreateIOSSurfaceMVK-pSurface-parameter~^~(VK_KHR_surface)+(VK_MVK_ios_surface)~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateIOSSurfaceMVK-pSurface-parameter)~^~implicit VALIDATION_ERROR_20c00756~^~N~^~Unknown~^~vkCreateImage~^~VUID-vkCreateImage-flags-00939~^~core~^~The spec valid usage text states 'If the flags member of pCreateInfo includes VK_IMAGE_CREATE_SPARSE_BINDING_BIT, creating this VkImage must not cause the total required sparse memory for all currently valid sparse resources on the device to exceed VkPhysicalDeviceLimits::sparseAddressSpaceSize' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateImage-flags-00939)~^~ VALIDATION_ERROR_20c05601~^~Y~^~None~^~vkCreateImage~^~VUID-vkCreateImage-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateImage-device-parameter)~^~implicit VALIDATION_ERROR_20c0ec01~^~N~^~Unknown~^~vkCreateImage~^~VUID-vkCreateImage-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateImage-pAllocator-parameter)~^~implicit @@ -2652,26 +2710,26 @@ VALIDATION_ERROR_20e0ec01~^~N~^~Unknown~^~vkCreateImageView~^~VUID-vkCreateImageView-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateImageView-pAllocator-parameter)~^~implicit VALIDATION_ERROR_20e11e01~^~N~^~Unknown~^~vkCreateImageView~^~VUID-vkCreateImageView-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkImageViewCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateImageView-pCreateInfo-parameter)~^~implicit VALIDATION_ERROR_20e26a01~^~Y~^~Unknown~^~vkCreateImageView~^~VUID-vkCreateImageView-pView-parameter~^~core~^~The spec valid usage text states 'pView must be a valid pointer to a VkImageView handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateImageView-pView-parameter)~^~implicit -VALIDATION_ERROR_21005601~^~Y~^~Unknown~^~vkCreateIndirectCommandsLayoutNVX~^~VUID-vkCreateIndirectCommandsLayoutNVX-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateIndirectCommandsLayoutNVX-device-parameter)~^~implicit -VALIDATION_ERROR_2100ec01~^~N~^~Unknown~^~vkCreateIndirectCommandsLayoutNVX~^~VUID-vkCreateIndirectCommandsLayoutNVX-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateIndirectCommandsLayoutNVX-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_21011e01~^~N~^~Unknown~^~vkCreateIndirectCommandsLayoutNVX~^~VUID-vkCreateIndirectCommandsLayoutNVX-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkIndirectCommandsLayoutCreateInfoNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateIndirectCommandsLayoutNVX-pCreateInfo-parameter)~^~implicit -VALIDATION_ERROR_21019201~^~Y~^~Unknown~^~vkCreateIndirectCommandsLayoutNVX~^~VUID-vkCreateIndirectCommandsLayoutNVX-pIndirectCommandsLayout-parameter~^~core~^~The spec valid usage text states 'pIndirectCommandsLayout must be a valid pointer to a VkIndirectCommandsLayoutNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateIndirectCommandsLayoutNVX-pIndirectCommandsLayout-parameter)~^~implicit +VALIDATION_ERROR_21005601~^~Y~^~Unknown~^~vkCreateIndirectCommandsLayoutNVX~^~VUID-vkCreateIndirectCommandsLayoutNVX-device-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateIndirectCommandsLayoutNVX-device-parameter)~^~implicit +VALIDATION_ERROR_2100ec01~^~N~^~Unknown~^~vkCreateIndirectCommandsLayoutNVX~^~VUID-vkCreateIndirectCommandsLayoutNVX-pAllocator-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateIndirectCommandsLayoutNVX-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_21011e01~^~N~^~Unknown~^~vkCreateIndirectCommandsLayoutNVX~^~VUID-vkCreateIndirectCommandsLayoutNVX-pCreateInfo-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkIndirectCommandsLayoutCreateInfoNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateIndirectCommandsLayoutNVX-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_21019201~^~Y~^~Unknown~^~vkCreateIndirectCommandsLayoutNVX~^~VUID-vkCreateIndirectCommandsLayoutNVX-pIndirectCommandsLayout-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'pIndirectCommandsLayout must be a valid pointer to a VkIndirectCommandsLayoutNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateIndirectCommandsLayoutNVX-pIndirectCommandsLayout-parameter)~^~implicit VALIDATION_ERROR_21200ad8~^~N~^~None~^~vkCreateInstance~^~VUID-vkCreateInstance-ppEnabledExtensionNames-01388~^~core~^~The spec valid usage text states 'All required extensions for each extension in the VkInstanceCreateInfo::ppEnabledExtensionNames list must also be present in that list.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateInstance-ppEnabledExtensionNames-01388)~^~ VALIDATION_ERROR_2120ec01~^~N~^~Unknown~^~vkCreateInstance~^~VUID-vkCreateInstance-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateInstance-pAllocator-parameter)~^~implicit, A bad pointer can cause the loader to seg fault. Unfortunately, the validity of the allocator is hard to determine. The structure does not contain an sType and is not created by the Vulkan API. We could try to catch an access violation exception but the loader is written in C, which does not support exceptions. It's not clear if this could be validated in a layer before loader consumption. We could also try to install a signal handler in the loader. VALIDATION_ERROR_21211e01~^~N~^~Unknown~^~vkCreateInstance~^~VUID-vkCreateInstance-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkInstanceCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateInstance-pCreateInfo-parameter)~^~implicit, We check the sType correctly, but this can cause the loader to seg fault when pCreateInfo is a nullptr. VALIDATION_ERROR_21219c01~^~Y~^~Unknown~^~vkCreateInstance~^~VUID-vkCreateInstance-pInstance-parameter~^~core~^~The spec valid usage text states 'pInstance must be a valid pointer to a VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateInstance-pInstance-parameter)~^~implicit, How should this be validated? Aside from insidious type-casting, the type will be validated by the compiler. The instance has not been created yet and will likely have no presence in the layers. -VALIDATION_ERROR_2140bc01~^~Y~^~Unknown~^~vkCreateMacOSSurfaceMVK~^~VUID-vkCreateMacOSSurfaceMVK-instance-parameter~^~core~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateMacOSSurfaceMVK-instance-parameter)~^~implicit -VALIDATION_ERROR_2140ec01~^~N~^~Unknown~^~vkCreateMacOSSurfaceMVK~^~VUID-vkCreateMacOSSurfaceMVK-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateMacOSSurfaceMVK-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_21411e01~^~N~^~Unknown~^~vkCreateMacOSSurfaceMVK~^~VUID-vkCreateMacOSSurfaceMVK-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkMacOSSurfaceCreateInfoMVK structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateMacOSSurfaceMVK-pCreateInfo-parameter)~^~implicit -VALIDATION_ERROR_21424801~^~Y~^~Unknown~^~vkCreateMacOSSurfaceMVK~^~VUID-vkCreateMacOSSurfaceMVK-pSurface-parameter~^~core~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateMacOSSurfaceMVK-pSurface-parameter)~^~implicit -VALIDATION_ERROR_2160bc01~^~Y~^~None~^~vkCreateMirSurfaceKHR~^~VUID-vkCreateMirSurfaceKHR-instance-parameter~^~core~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateMirSurfaceKHR-instance-parameter)~^~implicit -VALIDATION_ERROR_2160ec01~^~N~^~Unknown~^~vkCreateMirSurfaceKHR~^~VUID-vkCreateMirSurfaceKHR-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateMirSurfaceKHR-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_21611e01~^~N~^~Unknown~^~vkCreateMirSurfaceKHR~^~VUID-vkCreateMirSurfaceKHR-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkMirSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateMirSurfaceKHR-pCreateInfo-parameter)~^~implicit -VALIDATION_ERROR_21624801~^~Y~^~Unknown~^~vkCreateMirSurfaceKHR~^~VUID-vkCreateMirSurfaceKHR-pSurface-parameter~^~core~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateMirSurfaceKHR-pSurface-parameter)~^~implicit -VALIDATION_ERROR_21805601~^~Y~^~Unknown~^~vkCreateObjectTableNVX~^~VUID-vkCreateObjectTableNVX-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateObjectTableNVX-device-parameter)~^~implicit -VALIDATION_ERROR_2180ec01~^~N~^~Unknown~^~vkCreateObjectTableNVX~^~VUID-vkCreateObjectTableNVX-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateObjectTableNVX-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_21811e01~^~N~^~Unknown~^~vkCreateObjectTableNVX~^~VUID-vkCreateObjectTableNVX-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkObjectTableCreateInfoNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateObjectTableNVX-pCreateInfo-parameter)~^~implicit -VALIDATION_ERROR_2181d001~^~Y~^~Unknown~^~vkCreateObjectTableNVX~^~VUID-vkCreateObjectTableNVX-pObjectTable-parameter~^~core~^~The spec valid usage text states 'pObjectTable must be a valid pointer to a VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateObjectTableNVX-pObjectTable-parameter)~^~implicit +VALIDATION_ERROR_2140bc01~^~Y~^~Unknown~^~vkCreateMacOSSurfaceMVK~^~VUID-vkCreateMacOSSurfaceMVK-instance-parameter~^~(VK_KHR_surface)+(VK_MVK_macos_surface)~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateMacOSSurfaceMVK-instance-parameter)~^~implicit +VALIDATION_ERROR_2140ec01~^~N~^~Unknown~^~vkCreateMacOSSurfaceMVK~^~VUID-vkCreateMacOSSurfaceMVK-pAllocator-parameter~^~(VK_KHR_surface)+(VK_MVK_macos_surface)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateMacOSSurfaceMVK-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_21411e01~^~N~^~Unknown~^~vkCreateMacOSSurfaceMVK~^~VUID-vkCreateMacOSSurfaceMVK-pCreateInfo-parameter~^~(VK_KHR_surface)+(VK_MVK_macos_surface)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkMacOSSurfaceCreateInfoMVK structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateMacOSSurfaceMVK-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_21424801~^~Y~^~Unknown~^~vkCreateMacOSSurfaceMVK~^~VUID-vkCreateMacOSSurfaceMVK-pSurface-parameter~^~(VK_KHR_surface)+(VK_MVK_macos_surface)~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateMacOSSurfaceMVK-pSurface-parameter)~^~implicit +VALIDATION_ERROR_2160bc01~^~Y~^~None~^~vkCreateMirSurfaceKHR~^~VUID-vkCreateMirSurfaceKHR-instance-parameter~^~(VK_KHR_surface)+(VK_KHR_mir_surface)~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateMirSurfaceKHR-instance-parameter)~^~implicit +VALIDATION_ERROR_2160ec01~^~N~^~Unknown~^~vkCreateMirSurfaceKHR~^~VUID-vkCreateMirSurfaceKHR-pAllocator-parameter~^~(VK_KHR_surface)+(VK_KHR_mir_surface)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateMirSurfaceKHR-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_21611e01~^~N~^~Unknown~^~vkCreateMirSurfaceKHR~^~VUID-vkCreateMirSurfaceKHR-pCreateInfo-parameter~^~(VK_KHR_surface)+(VK_KHR_mir_surface)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkMirSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateMirSurfaceKHR-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_21624801~^~Y~^~Unknown~^~vkCreateMirSurfaceKHR~^~VUID-vkCreateMirSurfaceKHR-pSurface-parameter~^~(VK_KHR_surface)+(VK_KHR_mir_surface)~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateMirSurfaceKHR-pSurface-parameter)~^~implicit +VALIDATION_ERROR_21805601~^~Y~^~Unknown~^~vkCreateObjectTableNVX~^~VUID-vkCreateObjectTableNVX-device-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateObjectTableNVX-device-parameter)~^~implicit +VALIDATION_ERROR_2180ec01~^~N~^~Unknown~^~vkCreateObjectTableNVX~^~VUID-vkCreateObjectTableNVX-pAllocator-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateObjectTableNVX-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_21811e01~^~N~^~Unknown~^~vkCreateObjectTableNVX~^~VUID-vkCreateObjectTableNVX-pCreateInfo-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkObjectTableCreateInfoNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateObjectTableNVX-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_2181d001~^~Y~^~Unknown~^~vkCreateObjectTableNVX~^~VUID-vkCreateObjectTableNVX-pObjectTable-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'pObjectTable must be a valid pointer to a VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateObjectTableNVX-pObjectTable-parameter)~^~implicit VALIDATION_ERROR_21a05601~^~Y~^~None~^~vkCreatePipelineCache~^~VUID-vkCreatePipelineCache-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreatePipelineCache-device-parameter)~^~implicit VALIDATION_ERROR_21a0ec01~^~N~^~Unknown~^~vkCreatePipelineCache~^~VUID-vkCreatePipelineCache-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreatePipelineCache-pAllocator-parameter)~^~implicit VALIDATION_ERROR_21a11e01~^~N~^~Unknown~^~vkCreatePipelineCache~^~VUID-vkCreatePipelineCache-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkPipelineCacheCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreatePipelineCache-pCreateInfo-parameter)~^~implicit @@ -2700,50 +2758,47 @@ VALIDATION_ERROR_2260ec01~^~N~^~Unknown~^~vkCreateShaderModule~^~VUID-vkCreateShaderModule-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateShaderModule-pAllocator-parameter)~^~implicit VALIDATION_ERROR_22611e01~^~N~^~Unknown~^~vkCreateShaderModule~^~VUID-vkCreateShaderModule-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkShaderModuleCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateShaderModule-pCreateInfo-parameter)~^~implicit VALIDATION_ERROR_22622e01~^~Y~^~Unknown~^~vkCreateShaderModule~^~VUID-vkCreateShaderModule-pShaderModule-parameter~^~core~^~The spec valid usage text states 'pShaderModule must be a valid pointer to a VkShaderModule handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateShaderModule-pShaderModule-parameter)~^~implicit -VALIDATION_ERROR_22805601~^~Y~^~None~^~vkCreateSharedSwapchainsKHR~^~VUID-vkCreateSharedSwapchainsKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-device-parameter)~^~implicit -VALIDATION_ERROR_2280ec01~^~N~^~Unknown~^~vkCreateSharedSwapchainsKHR~^~VUID-vkCreateSharedSwapchainsKHR-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_22812001~^~Y~^~Unknown~^~vkCreateSharedSwapchainsKHR~^~VUID-vkCreateSharedSwapchainsKHR-pCreateInfos-parameter~^~core~^~The spec valid usage text states 'pCreateInfos must be a valid pointer to an array of swapchainCount valid VkSwapchainCreateInfoKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-pCreateInfos-parameter)~^~implicit -VALIDATION_ERROR_22825801~^~Y~^~Unknown~^~vkCreateSharedSwapchainsKHR~^~VUID-vkCreateSharedSwapchainsKHR-pSwapchains-parameter~^~core~^~The spec valid usage text states 'pSwapchains must be a valid pointer to an array of swapchainCount VkSwapchainKHR handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-pSwapchains-parameter)~^~implicit -VALIDATION_ERROR_2282f21b~^~Y~^~Unknown~^~vkCreateSharedSwapchainsKHR~^~VUID-vkCreateSharedSwapchainsKHR-swapchainCount-arraylength~^~core~^~The spec valid usage text states 'swapchainCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-swapchainCount-arraylength)~^~implicit -VALIDATION_ERROR_22a05601~^~Y~^~None~^~vkCreateSwapchainKHR~^~VUID-vkCreateSwapchainKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSwapchainKHR-device-parameter)~^~implicit -VALIDATION_ERROR_22a0ec01~^~N~^~Unknown~^~vkCreateSwapchainKHR~^~VUID-vkCreateSwapchainKHR-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSwapchainKHR-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_22a11e01~^~N~^~Unknown~^~vkCreateSwapchainKHR~^~VUID-vkCreateSwapchainKHR-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkSwapchainCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSwapchainKHR-pCreateInfo-parameter)~^~implicit -VALIDATION_ERROR_22a25201~^~Y~^~Unknown~^~vkCreateSwapchainKHR~^~VUID-vkCreateSwapchainKHR-pSwapchain-parameter~^~core~^~The spec valid usage text states 'pSwapchain must be a valid pointer to a VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSwapchainKHR-pSwapchain-parameter)~^~implicit -VALIDATION_ERROR_22c0bc01~^~Y~^~Unknown~^~vkCreateViSurfaceNN~^~VUID-vkCreateViSurfaceNN-instance-parameter~^~core~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateViSurfaceNN-instance-parameter)~^~implicit -VALIDATION_ERROR_22c0ec01~^~N~^~Unknown~^~vkCreateViSurfaceNN~^~VUID-vkCreateViSurfaceNN-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateViSurfaceNN-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_22c11e01~^~N~^~Unknown~^~vkCreateViSurfaceNN~^~VUID-vkCreateViSurfaceNN-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkViSurfaceCreateInfoNN structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateViSurfaceNN-pCreateInfo-parameter)~^~implicit -VALIDATION_ERROR_22c24801~^~Y~^~Unknown~^~vkCreateViSurfaceNN~^~VUID-vkCreateViSurfaceNN-pSurface-parameter~^~core~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateViSurfaceNN-pSurface-parameter)~^~implicit -VALIDATION_ERROR_22e0bc01~^~Y~^~None~^~vkCreateWaylandSurfaceKHR~^~VUID-vkCreateWaylandSurfaceKHR-instance-parameter~^~core~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateWaylandSurfaceKHR-instance-parameter)~^~implicit -VALIDATION_ERROR_22e0ec01~^~N~^~Unknown~^~vkCreateWaylandSurfaceKHR~^~VUID-vkCreateWaylandSurfaceKHR-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateWaylandSurfaceKHR-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_22e11e01~^~N~^~Unknown~^~vkCreateWaylandSurfaceKHR~^~VUID-vkCreateWaylandSurfaceKHR-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkWaylandSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateWaylandSurfaceKHR-pCreateInfo-parameter)~^~implicit -VALIDATION_ERROR_22e24801~^~Y~^~Unknown~^~vkCreateWaylandSurfaceKHR~^~VUID-vkCreateWaylandSurfaceKHR-pSurface-parameter~^~core~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateWaylandSurfaceKHR-pSurface-parameter)~^~implicit -VALIDATION_ERROR_2300bc01~^~Y~^~None~^~vkCreateWin32SurfaceKHR~^~VUID-vkCreateWin32SurfaceKHR-instance-parameter~^~core~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateWin32SurfaceKHR-instance-parameter)~^~implicit -VALIDATION_ERROR_2300ec01~^~N~^~Unknown~^~vkCreateWin32SurfaceKHR~^~VUID-vkCreateWin32SurfaceKHR-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateWin32SurfaceKHR-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_23011e01~^~N~^~Unknown~^~vkCreateWin32SurfaceKHR~^~VUID-vkCreateWin32SurfaceKHR-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkWin32SurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateWin32SurfaceKHR-pCreateInfo-parameter)~^~implicit -VALIDATION_ERROR_23024801~^~Y~^~Unknown~^~vkCreateWin32SurfaceKHR~^~VUID-vkCreateWin32SurfaceKHR-pSurface-parameter~^~core~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateWin32SurfaceKHR-pSurface-parameter)~^~implicit -VALIDATION_ERROR_2320bc01~^~Y~^~None~^~vkCreateXcbSurfaceKHR~^~VUID-vkCreateXcbSurfaceKHR-instance-parameter~^~core~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateXcbSurfaceKHR-instance-parameter)~^~implicit -VALIDATION_ERROR_2320ec01~^~N~^~Unknown~^~vkCreateXcbSurfaceKHR~^~VUID-vkCreateXcbSurfaceKHR-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateXcbSurfaceKHR-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_23211e01~^~N~^~Unknown~^~vkCreateXcbSurfaceKHR~^~VUID-vkCreateXcbSurfaceKHR-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkXcbSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateXcbSurfaceKHR-pCreateInfo-parameter)~^~implicit -VALIDATION_ERROR_23224801~^~Y~^~Unknown~^~vkCreateXcbSurfaceKHR~^~VUID-vkCreateXcbSurfaceKHR-pSurface-parameter~^~core~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateXcbSurfaceKHR-pSurface-parameter)~^~implicit -VALIDATION_ERROR_2340bc01~^~Y~^~None~^~vkCreateXlibSurfaceKHR~^~VUID-vkCreateXlibSurfaceKHR-instance-parameter~^~core~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateXlibSurfaceKHR-instance-parameter)~^~implicit -VALIDATION_ERROR_2340ec01~^~N~^~Unknown~^~vkCreateXlibSurfaceKHR~^~VUID-vkCreateXlibSurfaceKHR-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateXlibSurfaceKHR-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_23411e01~^~N~^~Unknown~^~vkCreateXlibSurfaceKHR~^~VUID-vkCreateXlibSurfaceKHR-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkXlibSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateXlibSurfaceKHR-pCreateInfo-parameter)~^~implicit -VALIDATION_ERROR_23424801~^~Y~^~Unknown~^~vkCreateXlibSurfaceKHR~^~VUID-vkCreateXlibSurfaceKHR-pSurface-parameter~^~core~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateXlibSurfaceKHR-pSurface-parameter)~^~implicit -VALIDATION_ERROR_236009a8~^~N~^~Unknown~^~vkDebugMarkerSetObjectNameEXT~^~VUID-vkDebugMarkerSetObjectNameEXT-pNameInfo-01236~^~core~^~The spec valid usage text states 'pNameInfo.object must be a Vulkan object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugMarkerSetObjectNameEXT-pNameInfo-01236)~^~ -VALIDATION_ERROR_23605601~^~Y~^~None~^~vkDebugMarkerSetObjectNameEXT~^~VUID-vkDebugMarkerSetObjectNameEXT-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugMarkerSetObjectNameEXT-device-parameter)~^~implicit -VALIDATION_ERROR_2361c201~^~N~^~Unknown~^~vkDebugMarkerSetObjectNameEXT~^~VUID-vkDebugMarkerSetObjectNameEXT-pNameInfo-parameter~^~core~^~The spec valid usage text states 'pNameInfo must be a valid pointer to a valid VkDebugMarkerObjectNameInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugMarkerSetObjectNameEXT-pNameInfo-parameter)~^~implicit -VALIDATION_ERROR_238009aa~^~N~^~Unknown~^~vkDebugMarkerSetObjectTagEXT~^~VUID-vkDebugMarkerSetObjectTagEXT-pTagInfo-01237~^~core~^~The spec valid usage text states 'pTagInfo.object must be a Vulkan object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugMarkerSetObjectTagEXT-pTagInfo-01237)~^~ -VALIDATION_ERROR_238009ac~^~N~^~Unknown~^~vkDebugMarkerSetObjectTagEXT~^~VUID-vkDebugMarkerSetObjectTagEXT-pTagInfo-01238~^~core~^~The spec valid usage text states 'pTagInfo.tagName must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugMarkerSetObjectTagEXT-pTagInfo-01238)~^~ -VALIDATION_ERROR_23805601~^~Y~^~None~^~vkDebugMarkerSetObjectTagEXT~^~VUID-vkDebugMarkerSetObjectTagEXT-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugMarkerSetObjectTagEXT-device-parameter)~^~implicit -VALIDATION_ERROR_23825c01~^~N~^~Unknown~^~vkDebugMarkerSetObjectTagEXT~^~VUID-vkDebugMarkerSetObjectTagEXT-pTagInfo-parameter~^~core~^~The spec valid usage text states 'pTagInfo must be a valid pointer to a valid VkDebugMarkerObjectTagInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugMarkerSetObjectTagEXT-pTagInfo-parameter)~^~implicit -VALIDATION_ERROR_23a009b2~^~N~^~Unknown~^~vkDebugReportMessageEXT~^~VUID-vkDebugReportMessageEXT-object-01241~^~core~^~The spec valid usage text states 'object must be a Vulkan object or VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugReportMessageEXT-object-01241)~^~ -VALIDATION_ERROR_23a00bb4~^~N~^~None~^~vkDebugReportMessageEXT~^~VUID-vkDebugReportMessageEXT-objectType-01498~^~core~^~The spec valid usage text states 'If objectType is not VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT and object is not VK_NULL_HANDLE, object must be a Vulkan object of the corresponding type associated with objectType as defined in VkDebugReportObjectTypeEXT and Vulkan Handle Relationship.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugReportMessageEXT-objectType-01498)~^~ -VALIDATION_ERROR_23a09001~^~N~^~Unknown~^~vkDebugReportMessageEXT~^~VUID-vkDebugReportMessageEXT-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkDebugReportFlagBitsEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugReportMessageEXT-flags-parameter)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_23a09003~^~Y~^~Unknown~^~vkDebugReportMessageEXT~^~VUID-vkDebugReportMessageEXT-flags-requiredbitmask~^~core~^~The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugReportMessageEXT-flags-requiredbitmask)~^~implicit -VALIDATION_ERROR_23a0bc01~^~N~^~Unknown~^~vkDebugReportMessageEXT~^~VUID-vkDebugReportMessageEXT-instance-parameter~^~core~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugReportMessageEXT-instance-parameter)~^~implicit -VALIDATION_ERROR_23a0da01~^~Y~^~Unknown~^~vkDebugReportMessageEXT~^~VUID-vkDebugReportMessageEXT-objectType-parameter~^~core~^~The spec valid usage text states 'objectType must be a valid VkDebugReportObjectTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugReportMessageEXT-objectType-parameter)~^~implicit -VALIDATION_ERROR_23a1a001~^~Y~^~Unknown~^~vkDebugReportMessageEXT~^~VUID-vkDebugReportMessageEXT-pLayerPrefix-parameter~^~core~^~The spec valid usage text states 'pLayerPrefix must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugReportMessageEXT-pLayerPrefix-parameter)~^~implicit -VALIDATION_ERROR_23a1b801~^~Y~^~Unknown~^~vkDebugReportMessageEXT~^~VUID-vkDebugReportMessageEXT-pMessage-parameter~^~core~^~The spec valid usage text states 'pMessage must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugReportMessageEXT-pMessage-parameter)~^~implicit +VALIDATION_ERROR_22805601~^~Y~^~None~^~vkCreateSharedSwapchainsKHR~^~VUID-vkCreateSharedSwapchainsKHR-device-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_display_swapchain)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-device-parameter)~^~implicit +VALIDATION_ERROR_2280ec01~^~N~^~Unknown~^~vkCreateSharedSwapchainsKHR~^~VUID-vkCreateSharedSwapchainsKHR-pAllocator-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_display_swapchain)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_22812001~^~Y~^~Unknown~^~vkCreateSharedSwapchainsKHR~^~VUID-vkCreateSharedSwapchainsKHR-pCreateInfos-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_display_swapchain)~^~The spec valid usage text states 'pCreateInfos must be a valid pointer to an array of swapchainCount valid VkSwapchainCreateInfoKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-pCreateInfos-parameter)~^~implicit +VALIDATION_ERROR_22825801~^~Y~^~Unknown~^~vkCreateSharedSwapchainsKHR~^~VUID-vkCreateSharedSwapchainsKHR-pSwapchains-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_display_swapchain)~^~The spec valid usage text states 'pSwapchains must be a valid pointer to an array of swapchainCount VkSwapchainKHR handles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-pSwapchains-parameter)~^~implicit +VALIDATION_ERROR_2282f21b~^~Y~^~Unknown~^~vkCreateSharedSwapchainsKHR~^~VUID-vkCreateSharedSwapchainsKHR-swapchainCount-arraylength~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_display_swapchain)~^~The spec valid usage text states 'swapchainCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-swapchainCount-arraylength)~^~implicit +VALIDATION_ERROR_22a05601~^~Y~^~None~^~vkCreateSwapchainKHR~^~VUID-vkCreateSwapchainKHR-device-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSwapchainKHR-device-parameter)~^~implicit +VALIDATION_ERROR_22a0ec01~^~N~^~Unknown~^~vkCreateSwapchainKHR~^~VUID-vkCreateSwapchainKHR-pAllocator-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSwapchainKHR-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_22a11e01~^~N~^~Unknown~^~vkCreateSwapchainKHR~^~VUID-vkCreateSwapchainKHR-pCreateInfo-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkSwapchainCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSwapchainKHR-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_22a25201~^~Y~^~Unknown~^~vkCreateSwapchainKHR~^~VUID-vkCreateSwapchainKHR-pSwapchain-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'pSwapchain must be a valid pointer to a VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSwapchainKHR-pSwapchain-parameter)~^~implicit +VALIDATION_ERROR_22c0bc01~^~Y~^~Unknown~^~vkCreateViSurfaceNN~^~VUID-vkCreateViSurfaceNN-instance-parameter~^~(VK_KHR_surface)+(VK_NN_vi_surface)~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateViSurfaceNN-instance-parameter)~^~implicit +VALIDATION_ERROR_22c0ec01~^~N~^~Unknown~^~vkCreateViSurfaceNN~^~VUID-vkCreateViSurfaceNN-pAllocator-parameter~^~(VK_KHR_surface)+(VK_NN_vi_surface)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateViSurfaceNN-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_22c11e01~^~N~^~Unknown~^~vkCreateViSurfaceNN~^~VUID-vkCreateViSurfaceNN-pCreateInfo-parameter~^~(VK_KHR_surface)+(VK_NN_vi_surface)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkViSurfaceCreateInfoNN structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateViSurfaceNN-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_22c24801~^~Y~^~Unknown~^~vkCreateViSurfaceNN~^~VUID-vkCreateViSurfaceNN-pSurface-parameter~^~(VK_KHR_surface)+(VK_NN_vi_surface)~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateViSurfaceNN-pSurface-parameter)~^~implicit +VALIDATION_ERROR_22e0bc01~^~Y~^~None~^~vkCreateWaylandSurfaceKHR~^~VUID-vkCreateWaylandSurfaceKHR-instance-parameter~^~(VK_KHR_surface)+(VK_KHR_wayland_surface)~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateWaylandSurfaceKHR-instance-parameter)~^~implicit +VALIDATION_ERROR_22e0ec01~^~N~^~Unknown~^~vkCreateWaylandSurfaceKHR~^~VUID-vkCreateWaylandSurfaceKHR-pAllocator-parameter~^~(VK_KHR_surface)+(VK_KHR_wayland_surface)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateWaylandSurfaceKHR-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_22e11e01~^~N~^~Unknown~^~vkCreateWaylandSurfaceKHR~^~VUID-vkCreateWaylandSurfaceKHR-pCreateInfo-parameter~^~(VK_KHR_surface)+(VK_KHR_wayland_surface)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkWaylandSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateWaylandSurfaceKHR-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_22e24801~^~Y~^~Unknown~^~vkCreateWaylandSurfaceKHR~^~VUID-vkCreateWaylandSurfaceKHR-pSurface-parameter~^~(VK_KHR_surface)+(VK_KHR_wayland_surface)~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateWaylandSurfaceKHR-pSurface-parameter)~^~implicit +VALIDATION_ERROR_2300bc01~^~Y~^~None~^~vkCreateWin32SurfaceKHR~^~VUID-vkCreateWin32SurfaceKHR-instance-parameter~^~(VK_KHR_surface)+(VK_KHR_win32_surface)~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateWin32SurfaceKHR-instance-parameter)~^~implicit +VALIDATION_ERROR_2300ec01~^~N~^~Unknown~^~vkCreateWin32SurfaceKHR~^~VUID-vkCreateWin32SurfaceKHR-pAllocator-parameter~^~(VK_KHR_surface)+(VK_KHR_win32_surface)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateWin32SurfaceKHR-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_23011e01~^~N~^~Unknown~^~vkCreateWin32SurfaceKHR~^~VUID-vkCreateWin32SurfaceKHR-pCreateInfo-parameter~^~(VK_KHR_surface)+(VK_KHR_win32_surface)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkWin32SurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateWin32SurfaceKHR-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_23024801~^~Y~^~Unknown~^~vkCreateWin32SurfaceKHR~^~VUID-vkCreateWin32SurfaceKHR-pSurface-parameter~^~(VK_KHR_surface)+(VK_KHR_win32_surface)~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateWin32SurfaceKHR-pSurface-parameter)~^~implicit +VALIDATION_ERROR_2320bc01~^~Y~^~None~^~vkCreateXcbSurfaceKHR~^~VUID-vkCreateXcbSurfaceKHR-instance-parameter~^~(VK_KHR_surface)+(VK_KHR_xcb_surface)~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateXcbSurfaceKHR-instance-parameter)~^~implicit +VALIDATION_ERROR_2320ec01~^~N~^~Unknown~^~vkCreateXcbSurfaceKHR~^~VUID-vkCreateXcbSurfaceKHR-pAllocator-parameter~^~(VK_KHR_surface)+(VK_KHR_xcb_surface)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateXcbSurfaceKHR-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_23211e01~^~N~^~Unknown~^~vkCreateXcbSurfaceKHR~^~VUID-vkCreateXcbSurfaceKHR-pCreateInfo-parameter~^~(VK_KHR_surface)+(VK_KHR_xcb_surface)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkXcbSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateXcbSurfaceKHR-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_23224801~^~Y~^~Unknown~^~vkCreateXcbSurfaceKHR~^~VUID-vkCreateXcbSurfaceKHR-pSurface-parameter~^~(VK_KHR_surface)+(VK_KHR_xcb_surface)~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateXcbSurfaceKHR-pSurface-parameter)~^~implicit +VALIDATION_ERROR_2340bc01~^~Y~^~None~^~vkCreateXlibSurfaceKHR~^~VUID-vkCreateXlibSurfaceKHR-instance-parameter~^~(VK_KHR_surface)+(VK_KHR_xlib_surface)~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateXlibSurfaceKHR-instance-parameter)~^~implicit +VALIDATION_ERROR_2340ec01~^~N~^~Unknown~^~vkCreateXlibSurfaceKHR~^~VUID-vkCreateXlibSurfaceKHR-pAllocator-parameter~^~(VK_KHR_surface)+(VK_KHR_xlib_surface)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateXlibSurfaceKHR-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_23411e01~^~N~^~Unknown~^~vkCreateXlibSurfaceKHR~^~VUID-vkCreateXlibSurfaceKHR-pCreateInfo-parameter~^~(VK_KHR_surface)+(VK_KHR_xlib_surface)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkXlibSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateXlibSurfaceKHR-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_23424801~^~Y~^~Unknown~^~vkCreateXlibSurfaceKHR~^~VUID-vkCreateXlibSurfaceKHR-pSurface-parameter~^~(VK_KHR_surface)+(VK_KHR_xlib_surface)~^~The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateXlibSurfaceKHR-pSurface-parameter)~^~implicit +VALIDATION_ERROR_23605601~^~Y~^~None~^~vkDebugMarkerSetObjectNameEXT~^~VUID-vkDebugMarkerSetObjectNameEXT-device-parameter~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugMarkerSetObjectNameEXT-device-parameter)~^~implicit +VALIDATION_ERROR_2361c201~^~N~^~Unknown~^~vkDebugMarkerSetObjectNameEXT~^~VUID-vkDebugMarkerSetObjectNameEXT-pNameInfo-parameter~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'pNameInfo must be a valid pointer to a valid VkDebugMarkerObjectNameInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugMarkerSetObjectNameEXT-pNameInfo-parameter)~^~implicit +VALIDATION_ERROR_23805601~^~Y~^~None~^~vkDebugMarkerSetObjectTagEXT~^~VUID-vkDebugMarkerSetObjectTagEXT-device-parameter~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugMarkerSetObjectTagEXT-device-parameter)~^~implicit +VALIDATION_ERROR_23825c01~^~N~^~Unknown~^~vkDebugMarkerSetObjectTagEXT~^~VUID-vkDebugMarkerSetObjectTagEXT-pTagInfo-parameter~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'pTagInfo must be a valid pointer to a valid VkDebugMarkerObjectTagInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugMarkerSetObjectTagEXT-pTagInfo-parameter)~^~implicit +VALIDATION_ERROR_23a009b2~^~N~^~Unknown~^~vkDebugReportMessageEXT~^~VUID-vkDebugReportMessageEXT-object-01241~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'object must be a Vulkan object or VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugReportMessageEXT-object-01241)~^~ +VALIDATION_ERROR_23a00bb4~^~N~^~None~^~vkDebugReportMessageEXT~^~VUID-vkDebugReportMessageEXT-objectType-01498~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'If objectType is not VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT and object is not VK_NULL_HANDLE, object must be a Vulkan object of the corresponding type associated with objectType as defined in debug-report-object-types.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugReportMessageEXT-objectType-01498)~^~ +VALIDATION_ERROR_23a09001~^~N~^~Unknown~^~vkDebugReportMessageEXT~^~VUID-vkDebugReportMessageEXT-flags-parameter~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'flags must be a valid combination of VkDebugReportFlagBitsEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugReportMessageEXT-flags-parameter)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_23a09003~^~Y~^~Unknown~^~vkDebugReportMessageEXT~^~VUID-vkDebugReportMessageEXT-flags-requiredbitmask~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugReportMessageEXT-flags-requiredbitmask)~^~implicit +VALIDATION_ERROR_23a0bc01~^~N~^~Unknown~^~vkDebugReportMessageEXT~^~VUID-vkDebugReportMessageEXT-instance-parameter~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugReportMessageEXT-instance-parameter)~^~implicit +VALIDATION_ERROR_23a0da01~^~Y~^~Unknown~^~vkDebugReportMessageEXT~^~VUID-vkDebugReportMessageEXT-objectType-parameter~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'objectType must be a valid VkDebugReportObjectTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugReportMessageEXT-objectType-parameter)~^~implicit +VALIDATION_ERROR_23a1a001~^~Y~^~Unknown~^~vkDebugReportMessageEXT~^~VUID-vkDebugReportMessageEXT-pLayerPrefix-parameter~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'pLayerPrefix must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugReportMessageEXT-pLayerPrefix-parameter)~^~implicit +VALIDATION_ERROR_23a1b801~^~Y~^~Unknown~^~vkDebugReportMessageEXT~^~VUID-vkDebugReportMessageEXT-pMessage-parameter~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'pMessage must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugReportMessageEXT-pMessage-parameter)~^~implicit VALIDATION_ERROR_23c00734~^~Y~^~Unknown~^~vkDestroyBuffer~^~VUID-vkDestroyBuffer-buffer-00922~^~core~^~The spec valid usage text states 'All submitted commands that refer to buffer, either directly or via a VkBufferView, must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyBuffer-buffer-00922)~^~ VALIDATION_ERROR_23c00736~^~Y~^~Unknown~^~vkDestroyBuffer~^~VUID-vkDestroyBuffer-buffer-00923~^~core~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when buffer was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyBuffer-buffer-00923)~^~ VALIDATION_ERROR_23c00738~^~Y~^~Unknown~^~vkDestroyBuffer~^~VUID-vkDestroyBuffer-buffer-00924~^~core~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when buffer was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyBuffer-buffer-00924)~^~ @@ -2765,12 +2820,12 @@ VALIDATION_ERROR_24002807~^~Y~^~Unknown~^~vkDestroyCommandPool~^~VUID-vkDestroyCommandPool-commandPool-parent~^~core~^~The spec valid usage text states 'If commandPool is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyCommandPool-commandPool-parent)~^~implicit VALIDATION_ERROR_24005601~^~Y~^~None~^~vkDestroyCommandPool~^~VUID-vkDestroyCommandPool-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyCommandPool-device-parameter)~^~implicit VALIDATION_ERROR_2400ec01~^~N~^~Unknown~^~vkDestroyCommandPool~^~VUID-vkDestroyCommandPool-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyCommandPool-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_242009b4~^~Y~^~Unknown~^~vkDestroyDebugReportCallbackEXT~^~VUID-vkDestroyDebugReportCallbackEXT-instance-01242~^~core~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when callback was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-instance-01242)~^~ -VALIDATION_ERROR_242009b6~^~Y~^~Unknown~^~vkDestroyDebugReportCallbackEXT~^~VUID-vkDestroyDebugReportCallbackEXT-instance-01243~^~core~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when callback was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-instance-01243)~^~ -VALIDATION_ERROR_24201e01~^~N~^~Unknown~^~vkDestroyDebugReportCallbackEXT~^~VUID-vkDestroyDebugReportCallbackEXT-callback-parameter~^~core~^~The spec valid usage text states 'callback must be a valid VkDebugReportCallbackEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-callback-parameter)~^~implicit -VALIDATION_ERROR_24201e07~^~N~^~Unknown~^~vkDestroyDebugReportCallbackEXT~^~VUID-vkDestroyDebugReportCallbackEXT-callback-parent~^~core~^~The spec valid usage text states 'callback must have been created, allocated, or retrieved from instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-callback-parent)~^~implicit -VALIDATION_ERROR_2420bc01~^~N~^~Unknown~^~vkDestroyDebugReportCallbackEXT~^~VUID-vkDestroyDebugReportCallbackEXT-instance-parameter~^~core~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-instance-parameter)~^~implicit -VALIDATION_ERROR_2420ec01~^~N~^~Unknown~^~vkDestroyDebugReportCallbackEXT~^~VUID-vkDestroyDebugReportCallbackEXT-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_242009b4~^~Y~^~Unknown~^~vkDestroyDebugReportCallbackEXT~^~VUID-vkDestroyDebugReportCallbackEXT-instance-01242~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when callback was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-instance-01242)~^~ +VALIDATION_ERROR_242009b6~^~Y~^~Unknown~^~vkDestroyDebugReportCallbackEXT~^~VUID-vkDestroyDebugReportCallbackEXT-instance-01243~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when callback was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-instance-01243)~^~ +VALIDATION_ERROR_24201e01~^~N~^~Unknown~^~vkDestroyDebugReportCallbackEXT~^~VUID-vkDestroyDebugReportCallbackEXT-callback-parameter~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'callback must be a valid VkDebugReportCallbackEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-callback-parameter)~^~implicit +VALIDATION_ERROR_24201e07~^~N~^~Unknown~^~vkDestroyDebugReportCallbackEXT~^~VUID-vkDestroyDebugReportCallbackEXT-callback-parent~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'callback must have been created, allocated, or retrieved from instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-callback-parent)~^~implicit +VALIDATION_ERROR_2420bc01~^~N~^~Unknown~^~vkDestroyDebugReportCallbackEXT~^~VUID-vkDestroyDebugReportCallbackEXT-instance-parameter~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-instance-parameter)~^~implicit +VALIDATION_ERROR_2420ec01~^~N~^~Unknown~^~vkDestroyDebugReportCallbackEXT~^~VUID-vkDestroyDebugReportCallbackEXT-pAllocator-parameter~^~(VK_EXT_debug_report)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-pAllocator-parameter)~^~implicit VALIDATION_ERROR_2440025e~^~Y~^~None~^~vkDestroyDescriptorPool~^~VUID-vkDestroyDescriptorPool-descriptorPool-00303~^~core~^~The spec valid usage text states 'All submitted commands that refer to descriptorPool (via any allocated descriptor sets) must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorPool-descriptorPool-00303)~^~ VALIDATION_ERROR_24400260~^~Y~^~Unknown~^~vkDestroyDescriptorPool~^~VUID-vkDestroyDescriptorPool-descriptorPool-00304~^~core~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when descriptorPool was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorPool-descriptorPool-00304)~^~ VALIDATION_ERROR_24400262~^~Y~^~Unknown~^~vkDestroyDescriptorPool~^~VUID-vkDestroyDescriptorPool-descriptorPool-00305~^~core~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when descriptorPool was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorPool-descriptorPool-00305)~^~ @@ -2784,12 +2839,12 @@ VALIDATION_ERROR_24604c07~^~Y~^~Unknown~^~vkDestroyDescriptorSetLayout~^~VUID-vkDestroyDescriptorSetLayout-descriptorSetLayout-parent~^~core~^~The spec valid usage text states 'If descriptorSetLayout is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorSetLayout-descriptorSetLayout-parent)~^~implicit VALIDATION_ERROR_24605601~^~Y~^~None~^~vkDestroyDescriptorSetLayout~^~VUID-vkDestroyDescriptorSetLayout-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorSetLayout-device-parameter)~^~implicit VALIDATION_ERROR_2460ec01~^~N~^~Unknown~^~vkDestroyDescriptorSetLayout~^~VUID-vkDestroyDescriptorSetLayout-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorSetLayout-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_248002c8~^~Y~^~Unknown~^~vkDestroyDescriptorUpdateTemplateKHR~^~VUID-vkDestroyDescriptorUpdateTemplateKHR-descriptorSetLayout-00356~^~core~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when descriptorSetLayout was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplateKHR-descriptorSetLayout-00356)~^~ -VALIDATION_ERROR_248002ca~^~Y~^~Unknown~^~vkDestroyDescriptorUpdateTemplateKHR~^~VUID-vkDestroyDescriptorUpdateTemplateKHR-descriptorSetLayout-00357~^~core~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when descriptorSetLayout was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplateKHR-descriptorSetLayout-00357)~^~ -VALIDATION_ERROR_24805201~^~Y~^~Unknown~^~vkDestroyDescriptorUpdateTemplateKHR~^~VUID-vkDestroyDescriptorUpdateTemplateKHR-descriptorUpdateTemplate-parameter~^~core~^~The spec valid usage text states 'If descriptorUpdateTemplate is not VK_NULL_HANDLE, descriptorUpdateTemplate must be a valid VkDescriptorUpdateTemplateKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplateKHR-descriptorUpdateTemplate-parameter)~^~implicit -VALIDATION_ERROR_24805207~^~Y~^~Unknown~^~vkDestroyDescriptorUpdateTemplateKHR~^~VUID-vkDestroyDescriptorUpdateTemplateKHR-descriptorUpdateTemplate-parent~^~core~^~The spec valid usage text states 'If descriptorUpdateTemplate is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplateKHR-descriptorUpdateTemplate-parent)~^~implicit -VALIDATION_ERROR_24805601~^~Y~^~Unknown~^~vkDestroyDescriptorUpdateTemplateKHR~^~VUID-vkDestroyDescriptorUpdateTemplateKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplateKHR-device-parameter)~^~implicit -VALIDATION_ERROR_2480ec01~^~N~^~Unknown~^~vkDestroyDescriptorUpdateTemplateKHR~^~VUID-vkDestroyDescriptorUpdateTemplateKHR-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplateKHR-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_248002c8~^~Y~^~Unknown~^~vkDestroyDescriptorUpdateTemplate~^~VUID-vkDestroyDescriptorUpdateTemplate-descriptorSetLayout-00356~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when descriptorSetLayout was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplate-descriptorSetLayout-00356)~^~ +VALIDATION_ERROR_248002ca~^~Y~^~Unknown~^~vkDestroyDescriptorUpdateTemplate~^~VUID-vkDestroyDescriptorUpdateTemplate-descriptorSetLayout-00357~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when descriptorSetLayout was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplate-descriptorSetLayout-00357)~^~ +VALIDATION_ERROR_24805201~^~Y~^~Unknown~^~vkDestroyDescriptorUpdateTemplate~^~VUID-vkDestroyDescriptorUpdateTemplate-descriptorUpdateTemplate-parameter~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'If descriptorUpdateTemplate is not VK_NULL_HANDLE, descriptorUpdateTemplate must be a valid VkDescriptorUpdateTemplate handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplate-descriptorUpdateTemplate-parameter)~^~implicit +VALIDATION_ERROR_24805207~^~Y~^~Unknown~^~vkDestroyDescriptorUpdateTemplate~^~VUID-vkDestroyDescriptorUpdateTemplate-descriptorUpdateTemplate-parent~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'If descriptorUpdateTemplate is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplate-descriptorUpdateTemplate-parent)~^~implicit +VALIDATION_ERROR_24805601~^~Y~^~Unknown~^~vkDestroyDescriptorUpdateTemplate~^~VUID-vkDestroyDescriptorUpdateTemplate-device-parameter~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplate-device-parameter)~^~implicit +VALIDATION_ERROR_2480ec01~^~N~^~Unknown~^~vkDestroyDescriptorUpdateTemplate~^~VUID-vkDestroyDescriptorUpdateTemplate-pAllocator-parameter~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplate-pAllocator-parameter)~^~implicit VALIDATION_ERROR_24a002f4~^~Y~^~Unknown~^~vkDestroyDevice~^~VUID-vkDestroyDevice-device-00378~^~core~^~The spec valid usage text states 'All child objects created on device must have been destroyed prior to destroying device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDevice-device-00378)~^~ VALIDATION_ERROR_24a002f6~^~Y~^~Unknown~^~vkDestroyDevice~^~VUID-vkDestroyDevice-device-00379~^~core~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when device was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDevice-device-00379)~^~ VALIDATION_ERROR_24a002f8~^~Y~^~Unknown~^~vkDestroyDevice~^~VUID-vkDestroyDevice-device-00380~^~core~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when device was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDevice-device-00380)~^~ @@ -2830,25 +2885,25 @@ VALIDATION_ERROR_2540b001~^~Y~^~None~^~vkDestroyImageView~^~VUID-vkDestroyImageView-imageView-parameter~^~core~^~The spec valid usage text states 'If imageView is not VK_NULL_HANDLE, imageView must be a valid VkImageView handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyImageView-imageView-parameter)~^~implicit VALIDATION_ERROR_2540b007~^~Y~^~Unknown~^~vkDestroyImageView~^~VUID-vkDestroyImageView-imageView-parent~^~core~^~The spec valid usage text states 'If imageView is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyImageView-imageView-parent)~^~implicit VALIDATION_ERROR_2540ec01~^~N~^~Unknown~^~vkDestroyImageView~^~VUID-vkDestroyImageView-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyImageView-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_25600a90~^~N~^~Unknown~^~vkDestroyIndirectCommandsLayoutNVX~^~VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-01352~^~core~^~The spec valid usage text states 'All submitted commands that refer to indirectCommandsLayout must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-01352)~^~ -VALIDATION_ERROR_25600a92~^~N~^~Unknown~^~vkDestroyIndirectCommandsLayoutNVX~^~VUID-vkDestroyIndirectCommandsLayoutNVX-objectTable-01353~^~core~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when objectTable was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-objectTable-01353)~^~ -VALIDATION_ERROR_25600a94~^~N~^~Unknown~^~vkDestroyIndirectCommandsLayoutNVX~^~VUID-vkDestroyIndirectCommandsLayoutNVX-objectTable-01354~^~core~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when objectTable was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-objectTable-01354)~^~ -VALIDATION_ERROR_25605601~^~Y~^~Unknown~^~vkDestroyIndirectCommandsLayoutNVX~^~VUID-vkDestroyIndirectCommandsLayoutNVX-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-device-parameter)~^~implicit -VALIDATION_ERROR_2560b401~^~Y~^~Unknown~^~vkDestroyIndirectCommandsLayoutNVX~^~VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-parameter~^~core~^~The spec valid usage text states 'indirectCommandsLayout must be a valid VkIndirectCommandsLayoutNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-parameter)~^~implicit -VALIDATION_ERROR_2560b407~^~Y~^~Unknown~^~vkDestroyIndirectCommandsLayoutNVX~^~VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-parent~^~core~^~The spec valid usage text states 'indirectCommandsLayout must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-parent)~^~implicit -VALIDATION_ERROR_2560ec01~^~N~^~Unknown~^~vkDestroyIndirectCommandsLayoutNVX~^~VUID-vkDestroyIndirectCommandsLayoutNVX-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_25600a90~^~N~^~Unknown~^~vkDestroyIndirectCommandsLayoutNVX~^~VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-01352~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'All submitted commands that refer to indirectCommandsLayout must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-01352)~^~ +VALIDATION_ERROR_25600a92~^~N~^~Unknown~^~vkDestroyIndirectCommandsLayoutNVX~^~VUID-vkDestroyIndirectCommandsLayoutNVX-objectTable-01353~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when objectTable was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-objectTable-01353)~^~ +VALIDATION_ERROR_25600a94~^~N~^~Unknown~^~vkDestroyIndirectCommandsLayoutNVX~^~VUID-vkDestroyIndirectCommandsLayoutNVX-objectTable-01354~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when objectTable was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-objectTable-01354)~^~ +VALIDATION_ERROR_25605601~^~Y~^~Unknown~^~vkDestroyIndirectCommandsLayoutNVX~^~VUID-vkDestroyIndirectCommandsLayoutNVX-device-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-device-parameter)~^~implicit +VALIDATION_ERROR_2560b401~^~Y~^~Unknown~^~vkDestroyIndirectCommandsLayoutNVX~^~VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'indirectCommandsLayout must be a valid VkIndirectCommandsLayoutNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-parameter)~^~implicit +VALIDATION_ERROR_2560b407~^~Y~^~Unknown~^~vkDestroyIndirectCommandsLayoutNVX~^~VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-parent~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'indirectCommandsLayout must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-parent)~^~implicit +VALIDATION_ERROR_2560ec01~^~N~^~Unknown~^~vkDestroyIndirectCommandsLayoutNVX~^~VUID-vkDestroyIndirectCommandsLayoutNVX-pAllocator-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-pAllocator-parameter)~^~implicit VALIDATION_ERROR_258004ea~^~Y~^~Unknown~^~vkDestroyInstance~^~VUID-vkDestroyInstance-instance-00629~^~core~^~The spec valid usage text states 'All child objects created using instance must have been destroyed prior to destroying instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyInstance-instance-00629)~^~ VALIDATION_ERROR_258004ec~^~Y~^~Unknown~^~vkDestroyInstance~^~VUID-vkDestroyInstance-instance-00630~^~core~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when instance was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyInstance-instance-00630)~^~ VALIDATION_ERROR_258004ee~^~Y~^~Unknown~^~vkDestroyInstance~^~VUID-vkDestroyInstance-instance-00631~^~core~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when instance was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyInstance-instance-00631)~^~ VALIDATION_ERROR_2580bc01~^~Y~^~None~^~vkDestroyInstance~^~VUID-vkDestroyInstance-instance-parameter~^~core~^~The spec valid usage text states 'If instance is not NULL, instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyInstance-instance-parameter)~^~implicit, We have a check for this in object tracker but I believe it's bogus. This can't be validated in a layer. Validataion would have to occur in a loader. VALIDATION_ERROR_2580ec01~^~N~^~Unknown~^~vkDestroyInstance~^~VUID-vkDestroyInstance-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyInstance-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_25a00aa2~^~N~^~Unknown~^~vkDestroyObjectTableNVX~^~VUID-vkDestroyObjectTableNVX-objectTable-01361~^~core~^~The spec valid usage text states 'All submitted commands that refer to objectTable must have completed execution.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-01361)~^~ -VALIDATION_ERROR_25a00aa4~^~N~^~Unknown~^~vkDestroyObjectTableNVX~^~VUID-vkDestroyObjectTableNVX-objectTable-01362~^~core~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when objectTable was created, a compatible set of callbacks must be provided here.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-01362)~^~ -VALIDATION_ERROR_25a00aa6~^~N~^~Unknown~^~vkDestroyObjectTableNVX~^~VUID-vkDestroyObjectTableNVX-objectTable-01363~^~core~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when objectTable was created, pAllocator must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-01363)~^~ -VALIDATION_ERROR_25a05601~^~Y~^~Unknown~^~vkDestroyObjectTableNVX~^~VUID-vkDestroyObjectTableNVX-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyObjectTableNVX-device-parameter)~^~implicit -VALIDATION_ERROR_25a0d801~^~Y~^~Unknown~^~vkDestroyObjectTableNVX~^~VUID-vkDestroyObjectTableNVX-objectTable-parameter~^~core~^~The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-parameter)~^~implicit -VALIDATION_ERROR_25a0d807~^~Y~^~Unknown~^~vkDestroyObjectTableNVX~^~VUID-vkDestroyObjectTableNVX-objectTable-parent~^~core~^~The spec valid usage text states 'objectTable must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-parent)~^~implicit -VALIDATION_ERROR_25a0ec01~^~N~^~Unknown~^~vkDestroyObjectTableNVX~^~VUID-vkDestroyObjectTableNVX-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyObjectTableNVX-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_25a00aa2~^~N~^~Unknown~^~vkDestroyObjectTableNVX~^~VUID-vkDestroyObjectTableNVX-objectTable-01361~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'All submitted commands that refer to objectTable must have completed execution.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-01361)~^~ +VALIDATION_ERROR_25a00aa4~^~N~^~Unknown~^~vkDestroyObjectTableNVX~^~VUID-vkDestroyObjectTableNVX-objectTable-01362~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when objectTable was created, a compatible set of callbacks must be provided here.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-01362)~^~ +VALIDATION_ERROR_25a00aa6~^~N~^~Unknown~^~vkDestroyObjectTableNVX~^~VUID-vkDestroyObjectTableNVX-objectTable-01363~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when objectTable was created, pAllocator must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-01363)~^~ +VALIDATION_ERROR_25a05601~^~Y~^~Unknown~^~vkDestroyObjectTableNVX~^~VUID-vkDestroyObjectTableNVX-device-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyObjectTableNVX-device-parameter)~^~implicit +VALIDATION_ERROR_25a0d801~^~Y~^~Unknown~^~vkDestroyObjectTableNVX~^~VUID-vkDestroyObjectTableNVX-objectTable-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-parameter)~^~implicit +VALIDATION_ERROR_25a0d807~^~Y~^~Unknown~^~vkDestroyObjectTableNVX~^~VUID-vkDestroyObjectTableNVX-objectTable-parent~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'objectTable must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-parent)~^~implicit +VALIDATION_ERROR_25a0ec01~^~N~^~Unknown~^~vkDestroyObjectTableNVX~^~VUID-vkDestroyObjectTableNVX-pAllocator-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyObjectTableNVX-pAllocator-parameter)~^~implicit VALIDATION_ERROR_25c005fa~^~Y~^~PipelineInUseDestroyedSignaled~^~vkDestroyPipeline~^~VUID-vkDestroyPipeline-pipeline-00765~^~core~^~The spec valid usage text states 'All submitted commands that refer to pipeline must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyPipeline-pipeline-00765)~^~ VALIDATION_ERROR_25c005fc~^~Y~^~Unknown~^~vkDestroyPipeline~^~VUID-vkDestroyPipeline-pipeline-00766~^~core~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when pipeline was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyPipeline-pipeline-00766)~^~ VALIDATION_ERROR_25c005fe~^~Y~^~Unknown~^~vkDestroyPipeline~^~VUID-vkDestroyPipeline-pipeline-00767~^~core~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when pipeline was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyPipeline-pipeline-00767)~^~ @@ -2902,28 +2957,29 @@ VALIDATION_ERROR_26a0ec01~^~N~^~Unknown~^~vkDestroyShaderModule~^~VUID-vkDestroyShaderModule-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyShaderModule-pAllocator-parameter)~^~implicit VALIDATION_ERROR_26a2be01~^~Y~^~None~^~vkDestroyShaderModule~^~VUID-vkDestroyShaderModule-shaderModule-parameter~^~core~^~The spec valid usage text states 'If shaderModule is not VK_NULL_HANDLE, shaderModule must be a valid VkShaderModule handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyShaderModule-shaderModule-parameter)~^~implicit VALIDATION_ERROR_26a2be07~^~Y~^~Unknown~^~vkDestroyShaderModule~^~VUID-vkDestroyShaderModule-shaderModule-parent~^~core~^~The spec valid usage text states 'If shaderModule is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyShaderModule-shaderModule-parent)~^~implicit -VALIDATION_ERROR_26c009e4~^~Y~^~Unknown~^~vkDestroySurfaceKHR~^~VUID-vkDestroySurfaceKHR-surface-01266~^~core~^~The spec valid usage text states 'All VkSwapchainKHR objects created for surface must have been destroyed prior to destroying surface' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-01266)~^~ -VALIDATION_ERROR_26c009e6~^~Y~^~Unknown~^~vkDestroySurfaceKHR~^~VUID-vkDestroySurfaceKHR-surface-01267~^~core~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when surface was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-01267)~^~ -VALIDATION_ERROR_26c009e8~^~Y~^~Unknown~^~vkDestroySurfaceKHR~^~VUID-vkDestroySurfaceKHR-surface-01268~^~core~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when surface was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-01268)~^~ -VALIDATION_ERROR_26c0bc01~^~Y~^~None~^~vkDestroySurfaceKHR~^~VUID-vkDestroySurfaceKHR-instance-parameter~^~core~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySurfaceKHR-instance-parameter)~^~implicit -VALIDATION_ERROR_26c0ec01~^~N~^~Unknown~^~vkDestroySurfaceKHR~^~VUID-vkDestroySurfaceKHR-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySurfaceKHR-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_26c2ec01~^~Y~^~None~^~vkDestroySurfaceKHR~^~VUID-vkDestroySurfaceKHR-surface-parameter~^~core~^~The spec valid usage text states 'If surface is not VK_NULL_HANDLE, surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-parameter)~^~implicit -VALIDATION_ERROR_26c2ec07~^~Y~^~Unknown~^~vkDestroySurfaceKHR~^~VUID-vkDestroySurfaceKHR-surface-parent~^~core~^~The spec valid usage text states 'If surface is a valid handle, it must have been created, allocated, or retrieved from instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-parent)~^~implicit -VALIDATION_ERROR_26e00009~^~N~^~None~^~vkDestroySwapchainKHR~^~VUID-vkDestroySwapchainKHR-commonparent~^~core~^~The spec valid usage text states 'Both of device, and swapchain that are valid handles must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySwapchainKHR-commonparent)~^~implicit -VALIDATION_ERROR_26e00a04~^~N~^~Unknown~^~vkDestroySwapchainKHR~^~VUID-vkDestroySwapchainKHR-swapchain-01282~^~core~^~The spec valid usage text states 'All uses of presentable images acquired from swapchain must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySwapchainKHR-swapchain-01282)~^~ -VALIDATION_ERROR_26e00a06~^~Y~^~Unknown~^~vkDestroySwapchainKHR~^~VUID-vkDestroySwapchainKHR-swapchain-01283~^~core~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when swapchain was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySwapchainKHR-swapchain-01283)~^~ -VALIDATION_ERROR_26e00a08~^~Y~^~Unknown~^~vkDestroySwapchainKHR~^~VUID-vkDestroySwapchainKHR-swapchain-01284~^~core~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when swapchain was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySwapchainKHR-swapchain-01284)~^~ -VALIDATION_ERROR_26e05601~^~N~^~Unknown~^~vkDestroySwapchainKHR~^~VUID-vkDestroySwapchainKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySwapchainKHR-device-parameter)~^~implicit -VALIDATION_ERROR_26e0ec01~^~N~^~Unknown~^~vkDestroySwapchainKHR~^~VUID-vkDestroySwapchainKHR-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySwapchainKHR-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_26e2f001~^~N~^~Unknown~^~vkDestroySwapchainKHR~^~VUID-vkDestroySwapchainKHR-swapchain-parameter~^~core~^~The spec valid usage text states 'If swapchain is not VK_NULL_HANDLE, swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySwapchainKHR-swapchain-parameter)~^~implicit +VALIDATION_ERROR_26c009e4~^~Y~^~Unknown~^~vkDestroySurfaceKHR~^~VUID-vkDestroySurfaceKHR-surface-01266~^~(VK_KHR_surface)~^~The spec valid usage text states 'All VkSwapchainKHR objects created for surface must have been destroyed prior to destroying surface' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-01266)~^~ +VALIDATION_ERROR_26c009e6~^~Y~^~Unknown~^~vkDestroySurfaceKHR~^~VUID-vkDestroySurfaceKHR-surface-01267~^~(VK_KHR_surface)~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when surface was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-01267)~^~ +VALIDATION_ERROR_26c009e8~^~Y~^~Unknown~^~vkDestroySurfaceKHR~^~VUID-vkDestroySurfaceKHR-surface-01268~^~(VK_KHR_surface)~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when surface was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-01268)~^~ +VALIDATION_ERROR_26c0bc01~^~Y~^~None~^~vkDestroySurfaceKHR~^~VUID-vkDestroySurfaceKHR-instance-parameter~^~(VK_KHR_surface)~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySurfaceKHR-instance-parameter)~^~implicit +VALIDATION_ERROR_26c0ec01~^~N~^~Unknown~^~vkDestroySurfaceKHR~^~VUID-vkDestroySurfaceKHR-pAllocator-parameter~^~(VK_KHR_surface)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySurfaceKHR-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_26c2ec01~^~Y~^~None~^~vkDestroySurfaceKHR~^~VUID-vkDestroySurfaceKHR-surface-parameter~^~(VK_KHR_surface)~^~The spec valid usage text states 'If surface is not VK_NULL_HANDLE, surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-parameter)~^~implicit +VALIDATION_ERROR_26c2ec07~^~Y~^~Unknown~^~vkDestroySurfaceKHR~^~VUID-vkDestroySurfaceKHR-surface-parent~^~(VK_KHR_surface)~^~The spec valid usage text states 'If surface is a valid handle, it must have been created, allocated, or retrieved from instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-parent)~^~implicit +VALIDATION_ERROR_26e00009~^~N~^~None~^~vkDestroySwapchainKHR~^~VUID-vkDestroySwapchainKHR-commonparent~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'Both of device, and swapchain that are valid handles must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySwapchainKHR-commonparent)~^~implicit +VALIDATION_ERROR_26e00a04~^~N~^~Unknown~^~vkDestroySwapchainKHR~^~VUID-vkDestroySwapchainKHR-swapchain-01282~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'All uses of presentable images acquired from swapchain must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySwapchainKHR-swapchain-01282)~^~ +VALIDATION_ERROR_26e00a06~^~Y~^~Unknown~^~vkDestroySwapchainKHR~^~VUID-vkDestroySwapchainKHR-swapchain-01283~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when swapchain was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySwapchainKHR-swapchain-01283)~^~ +VALIDATION_ERROR_26e00a08~^~Y~^~Unknown~^~vkDestroySwapchainKHR~^~VUID-vkDestroySwapchainKHR-swapchain-01284~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when swapchain was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySwapchainKHR-swapchain-01284)~^~ +VALIDATION_ERROR_26e05601~^~N~^~Unknown~^~vkDestroySwapchainKHR~^~VUID-vkDestroySwapchainKHR-device-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySwapchainKHR-device-parameter)~^~implicit +VALIDATION_ERROR_26e0ec01~^~N~^~Unknown~^~vkDestroySwapchainKHR~^~VUID-vkDestroySwapchainKHR-pAllocator-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySwapchainKHR-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_26e2f001~^~N~^~Unknown~^~vkDestroySwapchainKHR~^~VUID-vkDestroySwapchainKHR-swapchain-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'If swapchain is not VK_NULL_HANDLE, swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySwapchainKHR-swapchain-parameter)~^~implicit VALIDATION_ERROR_27005601~^~Y~^~None~^~vkDeviceWaitIdle~^~VUID-vkDeviceWaitIdle-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDeviceWaitIdle-device-parameter)~^~implicit -VALIDATION_ERROR_27205601~^~Y~^~Unknown~^~vkDisplayPowerControlEXT~^~VUID-vkDisplayPowerControlEXT-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDisplayPowerControlEXT-device-parameter)~^~implicit -VALIDATION_ERROR_27206001~^~Y~^~Unknown~^~vkDisplayPowerControlEXT~^~VUID-vkDisplayPowerControlEXT-display-parameter~^~core~^~The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDisplayPowerControlEXT-display-parameter)~^~implicit -VALIDATION_ERROR_27214e01~^~N~^~Unknown~^~vkDisplayPowerControlEXT~^~VUID-vkDisplayPowerControlEXT-pDisplayPowerInfo-parameter~^~core~^~The spec valid usage text states 'pDisplayPowerInfo must be a valid pointer to a valid VkDisplayPowerInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDisplayPowerControlEXT-pDisplayPowerInfo-parameter)~^~implicit -VALIDATION_ERROR_27400076~^~N~^~Unknown~^~vkEndCommandBuffer~^~VUID-vkEndCommandBuffer-commandBuffer-00059~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEndCommandBuffer-commandBuffer-00059)~^~ +VALIDATION_ERROR_27205601~^~Y~^~Unknown~^~vkDisplayPowerControlEXT~^~VUID-vkDisplayPowerControlEXT-device-parameter~^~(VK_KHR_surface)+(VK_KHR_display)+(VK_EXT_display_control)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDisplayPowerControlEXT-device-parameter)~^~implicit +VALIDATION_ERROR_27206001~^~Y~^~Unknown~^~vkDisplayPowerControlEXT~^~VUID-vkDisplayPowerControlEXT-display-parameter~^~(VK_KHR_surface)+(VK_KHR_display)+(VK_EXT_display_control)~^~The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDisplayPowerControlEXT-display-parameter)~^~implicit +VALIDATION_ERROR_27214e01~^~N~^~Unknown~^~vkDisplayPowerControlEXT~^~VUID-vkDisplayPowerControlEXT-pDisplayPowerInfo-parameter~^~(VK_KHR_surface)+(VK_KHR_display)+(VK_EXT_display_control)~^~The spec valid usage text states 'pDisplayPowerInfo must be a valid pointer to a valid VkDisplayPowerInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDisplayPowerControlEXT-pDisplayPowerInfo-parameter)~^~implicit +VALIDATION_ERROR_27400076~^~Y~^~None~^~vkEndCommandBuffer~^~VUID-vkEndCommandBuffer-commandBuffer-00059~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEndCommandBuffer-commandBuffer-00059)~^~ VALIDATION_ERROR_27400078~^~Y~^~Unknown~^~vkEndCommandBuffer~^~VUID-vkEndCommandBuffer-commandBuffer-00060~^~core~^~The spec valid usage text states 'If commandBuffer is a primary command buffer, there must not be an active render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEndCommandBuffer-commandBuffer-00060)~^~ VALIDATION_ERROR_2740007a~^~Y~^~Unknown~^~vkEndCommandBuffer~^~VUID-vkEndCommandBuffer-commandBuffer-00061~^~core~^~The spec valid usage text states 'All queries made active during the recording of commandBuffer must have been made inactive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEndCommandBuffer-commandBuffer-00061)~^~ VALIDATION_ERROR_2740007c~^~N~^~Unknown~^~vkEndCommandBuffer~^~VUID-vkEndCommandBuffer-commandBuffer-00062~^~(VK_EXT_debug_marker)~^~The spec valid usage text states 'If commandBuffer is a secondary command buffer, there must not be an outstanding vkCmdDebugMarkerBeginEXT command recorded to commandBuffer that has not previously been ended by a call to vkCmdDebugMarkerEndEXT.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkEndCommandBuffer-commandBuffer-00062)~^~ +VALIDATION_ERROR_27400e2e~^~N~^~None~^~vkEndCommandBuffer~^~VUID-vkEndCommandBuffer-commandBuffer-01815~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'If commandBuffer is a secondary command buffer, there must not be an outstanding vkCmdBeginDebugUtilsLabelEXT command recorded to commandBuffer that has not previously been ended by a call to vkCmdEndDebugUtilsLabelEXT.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkEndCommandBuffer-commandBuffer-01815)~^~ VALIDATION_ERROR_27402401~^~Y~^~None~^~vkEndCommandBuffer~^~VUID-vkEndCommandBuffer-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEndCommandBuffer-commandBuffer-parameter)~^~implicit VALIDATION_ERROR_27619e01~^~N~^~Unknown~^~vkEnumerateDeviceExtensionProperties~^~VUID-vkEnumerateDeviceExtensionProperties-pLayerName-parameter~^~core~^~The spec valid usage text states 'If pLayerName is not NULL, pLayerName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumerateDeviceExtensionProperties-pLayerName-parameter)~^~implicit VALIDATION_ERROR_2761f401~^~Y~^~Unknown~^~vkEnumerateDeviceExtensionProperties~^~VUID-vkEnumerateDeviceExtensionProperties-pProperties-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkExtensionProperties structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumerateDeviceExtensionProperties-pProperties-parameter)~^~implicit @@ -2937,9 +2993,9 @@ VALIDATION_ERROR_27a1f601~^~N~^~Unknown~^~vkEnumerateInstanceExtensionProperties~^~VUID-vkEnumerateInstanceExtensionProperties-pPropertyCount-parameter~^~core~^~The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumerateInstanceExtensionProperties-pPropertyCount-parameter)~^~implicit VALIDATION_ERROR_27c1f401~^~N~^~Unknown~^~vkEnumerateInstanceLayerProperties~^~VUID-vkEnumerateInstanceLayerProperties-pProperties-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkLayerProperties structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumerateInstanceLayerProperties-pProperties-parameter)~^~implicit VALIDATION_ERROR_27c1f601~^~N~^~Unknown~^~vkEnumerateInstanceLayerProperties~^~VUID-vkEnumerateInstanceLayerProperties-pPropertyCount-parameter~^~core~^~The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumerateInstanceLayerProperties-pPropertyCount-parameter)~^~implicit -VALIDATION_ERROR_27e0bc01~^~Y~^~Unknown~^~vkEnumeratePhysicalDeviceGroupsKHX~^~VUID-vkEnumeratePhysicalDeviceGroupsKHX-instance-parameter~^~core~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumeratePhysicalDeviceGroupsKHX-instance-parameter)~^~implicit -VALIDATION_ERROR_27e1d801~^~N~^~Unknown~^~vkEnumeratePhysicalDeviceGroupsKHX~^~VUID-vkEnumeratePhysicalDeviceGroupsKHX-pPhysicalDeviceGroupCount-parameter~^~core~^~The spec valid usage text states 'pPhysicalDeviceGroupCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumeratePhysicalDeviceGroupsKHX-pPhysicalDeviceGroupCount-parameter)~^~implicit -VALIDATION_ERROR_27e1da01~^~Y~^~Unknown~^~vkEnumeratePhysicalDeviceGroupsKHX~^~VUID-vkEnumeratePhysicalDeviceGroupsKHX-pPhysicalDeviceGroupProperties-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pPhysicalDeviceGroupCount is not 0, and pPhysicalDeviceGroupProperties is not NULL, pPhysicalDeviceGroupProperties must be a valid pointer to an array of pPhysicalDeviceGroupCount VkPhysicalDeviceGroupPropertiesKHX structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumeratePhysicalDeviceGroupsKHX-pPhysicalDeviceGroupProperties-parameter)~^~implicit +VALIDATION_ERROR_27e0bc01~^~Y~^~Unknown~^~vkEnumeratePhysicalDeviceGroups~^~VUID-vkEnumeratePhysicalDeviceGroups-instance-parameter~^~(VK_VERSION_1_1,VK_KHR_device_group_creation)~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkEnumeratePhysicalDeviceGroups-instance-parameter)~^~implicit +VALIDATION_ERROR_27e1d801~^~N~^~Unknown~^~vkEnumeratePhysicalDeviceGroups~^~VUID-vkEnumeratePhysicalDeviceGroups-pPhysicalDeviceGroupCount-parameter~^~(VK_VERSION_1_1,VK_KHR_device_group_creation)~^~The spec valid usage text states 'pPhysicalDeviceGroupCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkEnumeratePhysicalDeviceGroups-pPhysicalDeviceGroupCount-parameter)~^~implicit +VALIDATION_ERROR_27e1da01~^~Y~^~Unknown~^~vkEnumeratePhysicalDeviceGroups~^~VUID-vkEnumeratePhysicalDeviceGroups-pPhysicalDeviceGroupProperties-parameter~^~(VK_VERSION_1_1,VK_KHR_device_group_creation)~^~The spec valid usage text states 'If the value referenced by pPhysicalDeviceGroupCount is not 0, and pPhysicalDeviceGroupProperties is not NULL, pPhysicalDeviceGroupProperties must be a valid pointer to an array of pPhysicalDeviceGroupCount VkPhysicalDeviceGroupProperties structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkEnumeratePhysicalDeviceGroups-pPhysicalDeviceGroupProperties-parameter)~^~implicit VALIDATION_ERROR_2800bc01~^~Y~^~None~^~vkEnumeratePhysicalDevices~^~VUID-vkEnumeratePhysicalDevices-instance-parameter~^~core~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumeratePhysicalDevices-instance-parameter)~^~implicit VALIDATION_ERROR_2801d601~^~N~^~Unknown~^~vkEnumeratePhysicalDevices~^~VUID-vkEnumeratePhysicalDevices-pPhysicalDeviceCount-parameter~^~core~^~The spec valid usage text states 'pPhysicalDeviceCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumeratePhysicalDevices-pPhysicalDeviceCount-parameter)~^~implicit VALIDATION_ERROR_2801dc01~^~Y~^~Unknown~^~vkEnumeratePhysicalDevices~^~VUID-vkEnumeratePhysicalDevices-pPhysicalDevices-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pPhysicalDeviceCount is not 0, and pPhysicalDevices is not NULL, pPhysicalDevices must be a valid pointer to an array of pPhysicalDeviceCount VkPhysicalDevice handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumeratePhysicalDevices-pPhysicalDevices-parameter)~^~implicit @@ -2971,20 +3027,19 @@ VALIDATION_ERROR_28a01a07~^~Y~^~Unknown~^~vkGetBufferMemoryRequirements~^~VUID-vkGetBufferMemoryRequirements-buffer-parent~^~core~^~The spec valid usage text states 'buffer must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetBufferMemoryRequirements-buffer-parent)~^~implicit VALIDATION_ERROR_28a05601~^~Y~^~None~^~vkGetBufferMemoryRequirements~^~VUID-vkGetBufferMemoryRequirements-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetBufferMemoryRequirements-device-parameter)~^~implicit VALIDATION_ERROR_28a1b401~^~Y~^~Unknown~^~vkGetBufferMemoryRequirements~^~VUID-vkGetBufferMemoryRequirements-pMemoryRequirements-parameter~^~core~^~The spec valid usage text states 'pMemoryRequirements must be a valid pointer to a VkMemoryRequirements structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetBufferMemoryRequirements-pMemoryRequirements-parameter)~^~implicit -VALIDATION_ERROR_28c00566~^~N~^~Unknown~^~vkGetDeviceGroupPeerMemoryFeaturesKHX~^~VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-heapIndex-00691~^~core~^~The spec valid usage text states 'heapIndex must be less than memoryHeapCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-heapIndex-00691)~^~ -VALIDATION_ERROR_28c00568~^~N~^~Unknown~^~vkGetDeviceGroupPeerMemoryFeaturesKHX~^~VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-localDeviceIndex-00692~^~core~^~The spec valid usage text states 'localDeviceIndex must be a valid device index' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-localDeviceIndex-00692)~^~ -VALIDATION_ERROR_28c0056a~^~N~^~Unknown~^~vkGetDeviceGroupPeerMemoryFeaturesKHX~^~VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-remoteDeviceIndex-00693~^~core~^~The spec valid usage text states 'remoteDeviceIndex must be a valid device index' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-remoteDeviceIndex-00693)~^~ -VALIDATION_ERROR_28c0056c~^~N~^~Unknown~^~vkGetDeviceGroupPeerMemoryFeaturesKHX~^~VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-localDeviceIndex-00694~^~core~^~The spec valid usage text states 'localDeviceIndex must not equal remoteDeviceIndex' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-localDeviceIndex-00694)~^~ -VALIDATION_ERROR_28c05601~^~Y~^~Unknown~^~vkGetDeviceGroupPeerMemoryFeaturesKHX~^~VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-device-parameter)~^~implicit -VALIDATION_ERROR_28c1d401~^~N~^~Unknown~^~vkGetDeviceGroupPeerMemoryFeaturesKHX~^~VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-pPeerMemoryFeatures-parameter~^~core~^~The spec valid usage text states 'pPeerMemoryFeatures must be a valid pointer to a VkPeerMemoryFeatureFlagsKHX value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-pPeerMemoryFeatures-parameter)~^~implicit -VALIDATION_ERROR_28c1d403~^~N~^~Unknown~^~vkGetDeviceGroupPeerMemoryFeaturesKHX~^~VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-pPeerMemoryFeatures-requiredbitmask~^~core~^~The spec valid usage text states 'pPeerMemoryFeatures must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-pPeerMemoryFeatures-requiredbitmask)~^~implicit -VALIDATION_ERROR_28e05601~^~Y~^~Unknown~^~vkGetDeviceGroupPresentCapabilitiesKHX~^~VUID-vkGetDeviceGroupPresentCapabilitiesKHX-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupPresentCapabilitiesKHX-device-parameter)~^~implicit -VALIDATION_ERROR_28e13c01~^~N~^~Unknown~^~vkGetDeviceGroupPresentCapabilitiesKHX~^~VUID-vkGetDeviceGroupPresentCapabilitiesKHX-pDeviceGroupPresentCapabilities-parameter~^~core~^~The spec valid usage text states 'pDeviceGroupPresentCapabilities must be a valid pointer to a VkDeviceGroupPresentCapabilitiesKHX structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupPresentCapabilitiesKHX-pDeviceGroupPresentCapabilities-parameter)~^~implicit -VALIDATION_ERROR_29000009~^~Y~^~None~^~vkGetDeviceGroupSurfacePresentModesKHX~^~VUID-vkGetDeviceGroupSurfacePresentModesKHX-commonparent~^~core~^~The spec valid usage text states 'Both of device, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupSurfacePresentModesKHX-commonparent)~^~implicit -VALIDATION_ERROR_29005601~^~Y~^~Unknown~^~vkGetDeviceGroupSurfacePresentModesKHX~^~VUID-vkGetDeviceGroupSurfacePresentModesKHX-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupSurfacePresentModesKHX-device-parameter)~^~implicit -VALIDATION_ERROR_2901be01~^~N~^~Unknown~^~vkGetDeviceGroupSurfacePresentModesKHX~^~VUID-vkGetDeviceGroupSurfacePresentModesKHX-pModes-parameter~^~core~^~The spec valid usage text states 'pModes must be a valid pointer to a VkDeviceGroupPresentModeFlagsKHX value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupSurfacePresentModesKHX-pModes-parameter)~^~implicit -VALIDATION_ERROR_2901be03~^~N~^~Unknown~^~vkGetDeviceGroupSurfacePresentModesKHX~^~VUID-vkGetDeviceGroupSurfacePresentModesKHX-pModes-requiredbitmask~^~core~^~The spec valid usage text states 'pModes must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupSurfacePresentModesKHX-pModes-requiredbitmask)~^~implicit -VALIDATION_ERROR_2902ec01~^~Y~^~Unknown~^~vkGetDeviceGroupSurfacePresentModesKHX~^~VUID-vkGetDeviceGroupSurfacePresentModesKHX-surface-parameter~^~core~^~The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupSurfacePresentModesKHX-surface-parameter)~^~implicit +VALIDATION_ERROR_28c00566~^~N~^~Unknown~^~vkGetDeviceGroupPeerMemoryFeatures~^~VUID-vkGetDeviceGroupPeerMemoryFeatures-heapIndex-00691~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'heapIndex must be less than memoryHeapCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeatures-heapIndex-00691)~^~ +VALIDATION_ERROR_28c00568~^~N~^~Unknown~^~vkGetDeviceGroupPeerMemoryFeatures~^~VUID-vkGetDeviceGroupPeerMemoryFeatures-localDeviceIndex-00692~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'localDeviceIndex must be a valid device index' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeatures-localDeviceIndex-00692)~^~ +VALIDATION_ERROR_28c0056a~^~N~^~Unknown~^~vkGetDeviceGroupPeerMemoryFeatures~^~VUID-vkGetDeviceGroupPeerMemoryFeatures-remoteDeviceIndex-00693~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'remoteDeviceIndex must be a valid device index' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeatures-remoteDeviceIndex-00693)~^~ +VALIDATION_ERROR_28c0056c~^~N~^~Unknown~^~vkGetDeviceGroupPeerMemoryFeatures~^~VUID-vkGetDeviceGroupPeerMemoryFeatures-localDeviceIndex-00694~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'localDeviceIndex must not equal remoteDeviceIndex' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeatures-localDeviceIndex-00694)~^~ +VALIDATION_ERROR_28c05601~^~Y~^~Unknown~^~vkGetDeviceGroupPeerMemoryFeatures~^~VUID-vkGetDeviceGroupPeerMemoryFeatures-device-parameter~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeatures-device-parameter)~^~implicit +VALIDATION_ERROR_28c1d401~^~Y~^~Unknown~^~vkGetDeviceGroupPeerMemoryFeatures~^~VUID-vkGetDeviceGroupPeerMemoryFeatures-pPeerMemoryFeatures-parameter~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'pPeerMemoryFeatures must be a valid pointer to a VkPeerMemoryFeatureFlags value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeatures-pPeerMemoryFeatures-parameter)~^~implicit +VALIDATION_ERROR_28c1d403~^~N~^~Unknown~^~vkGetDeviceGroupPeerMemoryFeatures~^~VUID-vkGetDeviceGroupPeerMemoryFeatures-pPeerMemoryFeatures-requiredbitmask~^~(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'pPeerMemoryFeatures must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeatures-pPeerMemoryFeatures-requiredbitmask)~^~implicit +VALIDATION_ERROR_28e05601~^~Y~^~Unknown~^~vkGetDeviceGroupPresentCapabilitiesKHR~^~VUID-vkGetDeviceGroupPresentCapabilitiesKHR-device-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupPresentCapabilitiesKHR-device-parameter)~^~implicit +VALIDATION_ERROR_28e13c01~^~N~^~Unknown~^~vkGetDeviceGroupPresentCapabilitiesKHR~^~VUID-vkGetDeviceGroupPresentCapabilitiesKHR-pDeviceGroupPresentCapabilities-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'pDeviceGroupPresentCapabilities must be a valid pointer to a VkDeviceGroupPresentCapabilitiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupPresentCapabilitiesKHR-pDeviceGroupPresentCapabilities-parameter)~^~implicit +VALIDATION_ERROR_29000009~^~Y~^~None~^~vkGetDeviceGroupSurfacePresentModesKHR~^~VUID-vkGetDeviceGroupSurfacePresentModesKHR-commonparent~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'Both of device, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupSurfacePresentModesKHR-commonparent)~^~implicit +VALIDATION_ERROR_29005601~^~Y~^~Unknown~^~vkGetDeviceGroupSurfacePresentModesKHR~^~VUID-vkGetDeviceGroupSurfacePresentModesKHR-device-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupSurfacePresentModesKHR-device-parameter)~^~implicit +VALIDATION_ERROR_2901be01~^~N~^~Unknown~^~vkGetDeviceGroupSurfacePresentModesKHR~^~VUID-vkGetDeviceGroupSurfacePresentModesKHR-pModes-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'pModes must be a valid pointer to a VkDeviceGroupPresentModeFlagsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupSurfacePresentModesKHR-pModes-parameter)~^~implicit +VALIDATION_ERROR_2902ec01~^~Y~^~Unknown~^~vkGetDeviceGroupSurfacePresentModesKHR~^~VUID-vkGetDeviceGroupSurfacePresentModesKHR-surface-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupSurfacePresentModesKHR-surface-parameter)~^~implicit VALIDATION_ERROR_29200564~^~N~^~Unknown~^~vkGetDeviceMemoryCommitment~^~VUID-vkGetDeviceMemoryCommitment-memory-00690~^~core~^~The spec valid usage text states 'memory must have been created with a memory type that reports VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceMemoryCommitment-memory-00690)~^~ VALIDATION_ERROR_29205601~^~Y~^~None~^~vkGetDeviceMemoryCommitment~^~VUID-vkGetDeviceMemoryCommitment-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceMemoryCommitment-device-parameter)~^~implicit VALIDATION_ERROR_2920c601~^~Y~^~None~^~vkGetDeviceMemoryCommitment~^~VUID-vkGetDeviceMemoryCommitment-memory-parameter~^~core~^~The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceMemoryCommitment-memory-parameter)~^~implicit @@ -2994,26 +3049,27 @@ VALIDATION_ERROR_2941c001~^~N~^~Unknown~^~vkGetDeviceProcAddr~^~VUID-vkGetDeviceProcAddr-pName-parameter~^~core~^~The spec valid usage text states 'pName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceProcAddr-pName-parameter)~^~implicit, The loader uses strcmp to dispatch and can fail to dispatch when name is not null-terminated. i.e. Validation layers are never called. VALIDATION_ERROR_29600300~^~Y~^~Unknown~^~vkGetDeviceQueue~^~VUID-vkGetDeviceQueue-queueFamilyIndex-00384~^~core~^~The spec valid usage text states 'queueFamilyIndex must be one of the queue family indices specified when device was created, via the VkDeviceQueueCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceQueue-queueFamilyIndex-00384)~^~ VALIDATION_ERROR_29600302~^~Y~^~Unknown~^~vkGetDeviceQueue~^~VUID-vkGetDeviceQueue-queueIndex-00385~^~core~^~The spec valid usage text states 'queueIndex must be less than the number of queues created for the specified queue family index when device was created, via the queueCount member of the VkDeviceQueueCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceQueue-queueIndex-00385)~^~ +VALIDATION_ERROR_29600e62~^~N~^~None~^~vkGetDeviceQueue~^~VUID-vkGetDeviceQueue-flags-01841~^~core~^~The spec valid usage text states 'VkDeviceQueueCreateInfo::flags must have been set to zero when device was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceQueue-flags-01841)~^~ VALIDATION_ERROR_29605601~^~Y~^~None~^~vkGetDeviceQueue~^~VUID-vkGetDeviceQueue-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceQueue-device-parameter)~^~implicit VALIDATION_ERROR_2961fc01~^~Y~^~Unknown~^~vkGetDeviceQueue~^~VUID-vkGetDeviceQueue-pQueue-parameter~^~core~^~The spec valid usage text states 'pQueue must be a valid pointer to a VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceQueue-pQueue-parameter)~^~implicit -VALIDATION_ERROR_29806001~^~Y~^~Unknown~^~vkGetDisplayModePropertiesKHR~^~VUID-vkGetDisplayModePropertiesKHR-display-parameter~^~core~^~The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayModePropertiesKHR-display-parameter)~^~implicit -VALIDATION_ERROR_2981f401~^~Y~^~Unknown~^~vkGetDisplayModePropertiesKHR~^~VUID-vkGetDisplayModePropertiesKHR-pProperties-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkDisplayModePropertiesKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayModePropertiesKHR-pProperties-parameter)~^~implicit -VALIDATION_ERROR_2981f601~^~N~^~Unknown~^~vkGetDisplayModePropertiesKHR~^~VUID-vkGetDisplayModePropertiesKHR-pPropertyCount-parameter~^~core~^~The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayModePropertiesKHR-pPropertyCount-parameter)~^~implicit -VALIDATION_ERROR_29827a01~^~Y~^~Unknown~^~vkGetDisplayModePropertiesKHR~^~VUID-vkGetDisplayModePropertiesKHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayModePropertiesKHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_29a0ce01~^~Y~^~Unknown~^~vkGetDisplayPlaneCapabilitiesKHR~^~VUID-vkGetDisplayPlaneCapabilitiesKHR-mode-parameter~^~core~^~The spec valid usage text states 'mode must be a valid VkDisplayModeKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayPlaneCapabilitiesKHR-mode-parameter)~^~implicit -VALIDATION_ERROR_29a10a01~^~Y~^~Unknown~^~vkGetDisplayPlaneCapabilitiesKHR~^~VUID-vkGetDisplayPlaneCapabilitiesKHR-pCapabilities-parameter~^~core~^~The spec valid usage text states 'pCapabilities must be a valid pointer to a VkDisplayPlaneCapabilitiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayPlaneCapabilitiesKHR-pCapabilities-parameter)~^~implicit -VALIDATION_ERROR_29a27a01~^~Y~^~Unknown~^~vkGetDisplayPlaneCapabilitiesKHR~^~VUID-vkGetDisplayPlaneCapabilitiesKHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayPlaneCapabilitiesKHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_29c009c2~^~Y~^~Unknown~^~vkGetDisplayPlaneSupportedDisplaysKHR~^~VUID-vkGetDisplayPlaneSupportedDisplaysKHR-planeIndex-01249~^~core~^~The spec valid usage text states 'planeIndex must be less than the number of display planes supported by the device as determined by calling vkGetPhysicalDeviceDisplayPlanePropertiesKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayPlaneSupportedDisplaysKHR-planeIndex-01249)~^~ -VALIDATION_ERROR_29c14a01~^~N~^~Unknown~^~vkGetDisplayPlaneSupportedDisplaysKHR~^~VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplayCount-parameter~^~core~^~The spec valid usage text states 'pDisplayCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplayCount-parameter)~^~implicit -VALIDATION_ERROR_29c15201~^~Y~^~Unknown~^~vkGetDisplayPlaneSupportedDisplaysKHR~^~VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplays-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pDisplayCount is not 0, and pDisplays is not NULL, pDisplays must be a valid pointer to an array of pDisplayCount VkDisplayKHR handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplays-parameter)~^~implicit -VALIDATION_ERROR_29c27a01~^~Y~^~Unknown~^~vkGetDisplayPlaneSupportedDisplaysKHR~^~VUID-vkGetDisplayPlaneSupportedDisplaysKHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayPlaneSupportedDisplaysKHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_29806001~^~Y~^~Unknown~^~vkGetDisplayModePropertiesKHR~^~VUID-vkGetDisplayModePropertiesKHR-display-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayModePropertiesKHR-display-parameter)~^~implicit +VALIDATION_ERROR_2981f401~^~Y~^~Unknown~^~vkGetDisplayModePropertiesKHR~^~VUID-vkGetDisplayModePropertiesKHR-pProperties-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkDisplayModePropertiesKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayModePropertiesKHR-pProperties-parameter)~^~implicit +VALIDATION_ERROR_2981f601~^~N~^~Unknown~^~vkGetDisplayModePropertiesKHR~^~VUID-vkGetDisplayModePropertiesKHR-pPropertyCount-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayModePropertiesKHR-pPropertyCount-parameter)~^~implicit +VALIDATION_ERROR_29827a01~^~Y~^~Unknown~^~vkGetDisplayModePropertiesKHR~^~VUID-vkGetDisplayModePropertiesKHR-physicalDevice-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayModePropertiesKHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_29a0ce01~^~Y~^~Unknown~^~vkGetDisplayPlaneCapabilitiesKHR~^~VUID-vkGetDisplayPlaneCapabilitiesKHR-mode-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'mode must be a valid VkDisplayModeKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayPlaneCapabilitiesKHR-mode-parameter)~^~implicit +VALIDATION_ERROR_29a10a01~^~Y~^~Unknown~^~vkGetDisplayPlaneCapabilitiesKHR~^~VUID-vkGetDisplayPlaneCapabilitiesKHR-pCapabilities-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'pCapabilities must be a valid pointer to a VkDisplayPlaneCapabilitiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayPlaneCapabilitiesKHR-pCapabilities-parameter)~^~implicit +VALIDATION_ERROR_29a27a01~^~Y~^~Unknown~^~vkGetDisplayPlaneCapabilitiesKHR~^~VUID-vkGetDisplayPlaneCapabilitiesKHR-physicalDevice-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayPlaneCapabilitiesKHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_29c009c2~^~Y~^~Unknown~^~vkGetDisplayPlaneSupportedDisplaysKHR~^~VUID-vkGetDisplayPlaneSupportedDisplaysKHR-planeIndex-01249~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'planeIndex must be less than the number of display planes supported by the device as determined by calling vkGetPhysicalDeviceDisplayPlanePropertiesKHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayPlaneSupportedDisplaysKHR-planeIndex-01249)~^~ +VALIDATION_ERROR_29c14a01~^~N~^~Unknown~^~vkGetDisplayPlaneSupportedDisplaysKHR~^~VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplayCount-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'pDisplayCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplayCount-parameter)~^~implicit +VALIDATION_ERROR_29c15201~^~Y~^~Unknown~^~vkGetDisplayPlaneSupportedDisplaysKHR~^~VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplays-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'If the value referenced by pDisplayCount is not 0, and pDisplays is not NULL, pDisplays must be a valid pointer to an array of pDisplayCount VkDisplayKHR handles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplays-parameter)~^~implicit +VALIDATION_ERROR_29c27a01~^~Y~^~Unknown~^~vkGetDisplayPlaneSupportedDisplaysKHR~^~VUID-vkGetDisplayPlaneSupportedDisplaysKHR-physicalDevice-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayPlaneSupportedDisplaysKHR-physicalDevice-parameter)~^~implicit VALIDATION_ERROR_29e05601~^~Y~^~None~^~vkGetEventStatus~^~VUID-vkGetEventStatus-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetEventStatus-device-parameter)~^~implicit VALIDATION_ERROR_29e07e01~^~Y~^~None~^~vkGetEventStatus~^~VUID-vkGetEventStatus-event-parameter~^~core~^~The spec valid usage text states 'event must be a valid VkEvent handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetEventStatus-event-parameter)~^~implicit VALIDATION_ERROR_29e07e07~^~Y~^~Unknown~^~vkGetEventStatus~^~VUID-vkGetEventStatus-event-parent~^~core~^~The spec valid usage text states 'event must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetEventStatus-event-parent)~^~implicit VALIDATION_ERROR_2a005601~^~Y~^~None~^~vkGetFenceStatus~^~VUID-vkGetFenceStatus-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetFenceStatus-device-parameter)~^~implicit VALIDATION_ERROR_2a008801~^~Y~^~None~^~vkGetFenceStatus~^~VUID-vkGetFenceStatus-fence-parameter~^~core~^~The spec valid usage text states 'fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetFenceStatus-fence-parameter)~^~implicit VALIDATION_ERROR_2a008807~^~Y~^~Unknown~^~vkGetFenceStatus~^~VUID-vkGetFenceStatus-fence-parent~^~core~^~The spec valid usage text states 'fence must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetFenceStatus-fence-parent)~^~implicit -VALIDATION_ERROR_2a200c68~^~N~^~None~^~vkGetImageMemoryRequirements~^~VUID-vkGetImageMemoryRequirements-image-01588~^~core~^~The spec valid usage text states 'image must not have been created with the VK_IMAGE_CREATE_DISJOINT_BIT_KHR flag set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageMemoryRequirements-image-01588)~^~ +VALIDATION_ERROR_2a200c68~^~N~^~None~^~vkGetImageMemoryRequirements~^~VUID-vkGetImageMemoryRequirements-image-01588~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'image must not have been created with the VK_IMAGE_CREATE_DISJOINT_BIT flag set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageMemoryRequirements-image-01588)~^~ VALIDATION_ERROR_2a205601~^~Y~^~None~^~vkGetImageMemoryRequirements~^~VUID-vkGetImageMemoryRequirements-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageMemoryRequirements-device-parameter)~^~implicit VALIDATION_ERROR_2a20a001~^~Y~^~CreateUnknownObject~^~vkGetImageMemoryRequirements~^~VUID-vkGetImageMemoryRequirements-image-parameter~^~core~^~The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageMemoryRequirements-image-parameter)~^~implicit VALIDATION_ERROR_2a20a007~^~Y~^~Unknown~^~vkGetImageMemoryRequirements~^~VUID-vkGetImageMemoryRequirements-image-parent~^~core~^~The spec valid usage text states 'image must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageMemoryRequirements-image-parent)~^~implicit @@ -3025,10 +3081,11 @@ VALIDATION_ERROR_2a423801~^~Y~^~Unknown~^~vkGetImageSparseMemoryRequirements~^~VUID-vkGetImageSparseMemoryRequirements-pSparseMemoryRequirements-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pSparseMemoryRequirementCount is not 0, and pSparseMemoryRequirements is not NULL, pSparseMemoryRequirements must be a valid pointer to an array of pSparseMemoryRequirementCount VkSparseImageMemoryRequirements structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSparseMemoryRequirements-pSparseMemoryRequirements-parameter)~^~implicit VALIDATION_ERROR_2a6007c8~^~Y~^~Unknown~^~vkGetImageSubresourceLayout~^~VUID-vkGetImageSubresourceLayout-image-00996~^~core~^~The spec valid usage text states 'image must have been created with tiling equal to VK_IMAGE_TILING_LINEAR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-image-00996)~^~ VALIDATION_ERROR_2a6007ca~^~Y~^~Unknown~^~vkGetImageSubresourceLayout~^~VUID-vkGetImageSubresourceLayout-aspectMask-00997~^~core~^~The spec valid usage text states 'The aspectMask member of pSubresource must only have a single bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-aspectMask-00997)~^~ -VALIDATION_ERROR_2a600c5a~^~N~^~None~^~vkGetImageSubresourceLayout~^~VUID-vkGetImageSubresourceLayout-format-01581~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the format of image is a multi-planar format with two planes, the aspectMask member of pSubresource must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR or VK_IMAGE_ASPECT_PLANE_1_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageSubresourceLayout-format-01581)~^~ -VALIDATION_ERROR_2a600c5c~^~N~^~None~^~vkGetImageSubresourceLayout~^~VUID-vkGetImageSubresourceLayout-format-01582~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the format of image is a multi-planar format with three planes, the aspectMask member of pSubresource must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR or VK_IMAGE_ASPECT_PLANE_2_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageSubresourceLayout-format-01582)~^~ -VALIDATION_ERROR_2a600d68~^~N~^~None~^~vkGetImageSubresourceLayout~^~VUID-vkGetImageSubresourceLayout-mipLevel-01716~^~core~^~The spec valid usage text states 'The mipLevel member of pSubresource must be less than the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-mipLevel-01716)~^~ -VALIDATION_ERROR_2a600d6a~^~N~^~None~^~vkGetImageSubresourceLayout~^~VUID-vkGetImageSubresourceLayout-arrayLayer-01717~^~core~^~The spec valid usage text states 'The arrayLayer member of pSubresource must be less than the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-arrayLayer-01717)~^~ +VALIDATION_ERROR_2a600c5a~^~Y~^~MultiplaneImageLayoutBadAspectFlags~^~vkGetImageSubresourceLayout~^~VUID-vkGetImageSubresourceLayout-format-01581~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the format of image is a multi-planar format with two planes, the aspectMask member of pSubresource must be VK_IMAGE_ASPECT_PLANE_0_BIT or VK_IMAGE_ASPECT_PLANE_1_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageSubresourceLayout-format-01581)~^~ +VALIDATION_ERROR_2a600c5c~^~Y~^~MultiplaneImageLayoutBadAspectFlags~^~vkGetImageSubresourceLayout~^~VUID-vkGetImageSubresourceLayout-format-01582~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the format of image is a multi-planar format with three planes, the aspectMask member of pSubresource must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT or VK_IMAGE_ASPECT_PLANE_2_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageSubresourceLayout-format-01582)~^~ +VALIDATION_ERROR_2a600d68~^~Y~^~ExerciseGetImageSubresourceLayout~^~vkGetImageSubresourceLayout~^~VUID-vkGetImageSubresourceLayout-mipLevel-01716~^~core~^~The spec valid usage text states 'The mipLevel member of pSubresource must be less than the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-mipLevel-01716)~^~ +VALIDATION_ERROR_2a600d6a~^~Y~^~ExerciseGetImageSubresourceLayout~^~vkGetImageSubresourceLayout~^~VUID-vkGetImageSubresourceLayout-arrayLayer-01717~^~core~^~The spec valid usage text states 'The arrayLayer member of pSubresource must be less than the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-arrayLayer-01717)~^~ +VALIDATION_ERROR_2a600ece~^~N~^~None~^~vkGetImageSubresourceLayout~^~VUID-vkGetImageSubresourceLayout-image-01895~^~(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'If image was created with the VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID external memory handle type, then image must be bound to memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageSubresourceLayout-image-01895)~^~ VALIDATION_ERROR_2a605601~^~Y~^~None~^~vkGetImageSubresourceLayout~^~VUID-vkGetImageSubresourceLayout-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-device-parameter)~^~implicit VALIDATION_ERROR_2a60a001~^~Y~^~None~^~vkGetImageSubresourceLayout~^~VUID-vkGetImageSubresourceLayout-image-parameter~^~core~^~The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-image-parameter)~^~implicit VALIDATION_ERROR_2a60a007~^~Y~^~Unknown~^~vkGetImageSubresourceLayout~^~VUID-vkGetImageSubresourceLayout-image-parent~^~core~^~The spec valid usage text states 'image must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-image-parent)~^~implicit @@ -3036,79 +3093,68 @@ VALIDATION_ERROR_2a624401~^~Y~^~Unknown~^~vkGetImageSubresourceLayout~^~VUID-vkGetImageSubresourceLayout-pSubresource-parameter~^~core~^~The spec valid usage text states 'pSubresource must be a valid pointer to a valid VkImageSubresource structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-pSubresource-parameter)~^~implicit VALIDATION_ERROR_2a80bc01~^~N~^~Unknown~^~vkGetInstanceProcAddr~^~VUID-vkGetInstanceProcAddr-instance-parameter~^~core~^~The spec valid usage text states 'If instance is not NULL, instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetInstanceProcAddr-instance-parameter)~^~implicit, This can't be validated in a layer. Validation would have to occur in a loader. VALIDATION_ERROR_2a81c001~^~N~^~Unknown~^~vkGetInstanceProcAddr~^~VUID-vkGetInstanceProcAddr-pName-parameter~^~core~^~The spec valid usage text states 'pName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetInstanceProcAddr-pName-parameter)~^~implicit, The loader uses strcmp to dispatch and can fail to dispatch when name is not null-terminated. i.e. Validation layers are never called. -VALIDATION_ERROR_2aa0053e~^~N~^~Unknown~^~vkGetMemoryFdKHR~^~VUID-vkGetMemoryFdKHR-handleType-00671~^~core~^~The spec valid usage text states 'handleType must have been included in VkExportMemoryAllocateInfoKHR::handleTypes when memory was created.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdKHR-handleType-00671)~^~ -VALIDATION_ERROR_2aa00540~^~N~^~Unknown~^~vkGetMemoryFdKHR~^~VUID-vkGetMemoryFdKHR-handleType-00672~^~core~^~The spec valid usage text states 'handleType must be defined as a POSIX file descriptor handle.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdKHR-handleType-00672)~^~ -VALIDATION_ERROR_2aa05601~^~Y~^~Unknown~^~vkGetMemoryFdKHR~^~VUID-vkGetMemoryFdKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdKHR-device-parameter)~^~implicit -VALIDATION_ERROR_2aa09c01~^~N~^~Unknown~^~vkGetMemoryFdKHR~^~VUID-vkGetMemoryFdKHR-handleType-parameter~^~core~^~The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdKHR-handleType-parameter)~^~implicit -VALIDATION_ERROR_2aa0c601~^~N~^~Unknown~^~vkGetMemoryFdKHR~^~VUID-vkGetMemoryFdKHR-memory-parameter~^~core~^~The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdKHR-memory-parameter)~^~implicit -VALIDATION_ERROR_2aa0c607~^~N~^~Unknown~^~vkGetMemoryFdKHR~^~VUID-vkGetMemoryFdKHR-memory-parent~^~core~^~The spec valid usage text states 'memory must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdKHR-memory-parent)~^~implicit -VALIDATION_ERROR_2aa16c01~^~Y~^~Unknown~^~vkGetMemoryFdKHR~^~VUID-vkGetMemoryFdKHR-pFd-parameter~^~core~^~The spec valid usage text states 'pFd must be a valid pointer to a int value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdKHR-pFd-parameter)~^~implicit -VALIDATION_ERROR_2aa39e01~^~N~^~None~^~vkGetMemoryFdKHR~^~VUID-vkGetMemoryFdKHR-pGetFdInfo-parameter~^~core~^~The spec valid usage text states 'pGetFdInfo must be a valid pointer to a valid VkMemoryGetFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdKHR-pGetFdInfo-parameter)~^~implicit -VALIDATION_ERROR_2ac00542~^~N~^~Unknown~^~vkGetMemoryFdPropertiesKHR~^~VUID-vkGetMemoryFdPropertiesKHR-fd-00673~^~core~^~The spec valid usage text states 'fd must be an external memory handle created outside of the Vulkan API.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-fd-00673)~^~ -VALIDATION_ERROR_2ac00544~^~N~^~Unknown~^~vkGetMemoryFdPropertiesKHR~^~VUID-vkGetMemoryFdPropertiesKHR-handleType-00674~^~core~^~The spec valid usage text states 'handleType must not be one of the handle types defined as opaque.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-handleType-00674)~^~ -VALIDATION_ERROR_2ac05601~^~Y~^~Unknown~^~vkGetMemoryFdPropertiesKHR~^~VUID-vkGetMemoryFdPropertiesKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-device-parameter)~^~implicit -VALIDATION_ERROR_2ac09c01~^~Y~^~Unknown~^~vkGetMemoryFdPropertiesKHR~^~VUID-vkGetMemoryFdPropertiesKHR-handleType-parameter~^~core~^~The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-handleType-parameter)~^~implicit -VALIDATION_ERROR_2ac1ae01~^~N~^~Unknown~^~vkGetMemoryFdPropertiesKHR~^~VUID-vkGetMemoryFdPropertiesKHR-pMemoryFdProperties-parameter~^~core~^~The spec valid usage text states 'pMemoryFdProperties must be a valid pointer to a VkMemoryFdPropertiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-pMemoryFdProperties-parameter)~^~implicit -VALIDATION_ERROR_2ae0052c~^~N~^~Unknown~^~vkGetMemoryWin32HandleKHR~^~VUID-vkGetMemoryWin32HandleKHR-handleType-00662~^~core~^~The spec valid usage text states 'handleType must have been included in VkExportMemoryAllocateInfoKHR::handleTypes when memory was created.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-handleType-00662)~^~ -VALIDATION_ERROR_2ae0052e~^~N~^~Unknown~^~vkGetMemoryWin32HandleKHR~^~VUID-vkGetMemoryWin32HandleKHR-handleType-00663~^~core~^~The spec valid usage text states 'If handleType is defined as an NT handle, vkGetMemoryWin32HandleKHR must be called no more than once for each valid unique combination of memory and handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-handleType-00663)~^~ -VALIDATION_ERROR_2ae00530~^~N~^~Unknown~^~vkGetMemoryWin32HandleKHR~^~VUID-vkGetMemoryWin32HandleKHR-handleType-00664~^~core~^~The spec valid usage text states 'handleType must be defined as an NT handle or a global share handle.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-handleType-00664)~^~ -VALIDATION_ERROR_2ae05601~^~Y~^~Unknown~^~vkGetMemoryWin32HandleKHR~^~VUID-vkGetMemoryWin32HandleKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-device-parameter)~^~implicit -VALIDATION_ERROR_2ae09c01~^~N~^~Unknown~^~vkGetMemoryWin32HandleKHR~^~VUID-vkGetMemoryWin32HandleKHR-handleType-parameter~^~core~^~The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-handleType-parameter)~^~implicit -VALIDATION_ERROR_2ae0c601~^~N~^~Unknown~^~vkGetMemoryWin32HandleKHR~^~VUID-vkGetMemoryWin32HandleKHR-memory-parameter~^~core~^~The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-memory-parameter)~^~implicit -VALIDATION_ERROR_2ae0c607~^~N~^~Unknown~^~vkGetMemoryWin32HandleKHR~^~VUID-vkGetMemoryWin32HandleKHR-memory-parent~^~core~^~The spec valid usage text states 'memory must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-memory-parent)~^~implicit -VALIDATION_ERROR_2ae17c01~^~Y~^~Unknown~^~vkGetMemoryWin32HandleKHR~^~VUID-vkGetMemoryWin32HandleKHR-pHandle-parameter~^~core~^~The spec valid usage text states 'pHandle must be a valid pointer to a HANDLE value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-pHandle-parameter)~^~implicit -VALIDATION_ERROR_2ae3a001~^~N~^~None~^~vkGetMemoryWin32HandleKHR~^~VUID-vkGetMemoryWin32HandleKHR-pGetWin32HandleInfo-parameter~^~core~^~The spec valid usage text states 'pGetWin32HandleInfo must be a valid pointer to a valid VkMemoryGetWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-pGetWin32HandleInfo-parameter)~^~implicit -VALIDATION_ERROR_2b000a5c~^~N~^~Unknown~^~vkGetMemoryWin32HandleNV~^~VUID-vkGetMemoryWin32HandleNV-handleType-01326~^~core~^~The spec valid usage text states 'handleType must be a flag specified in VkExportMemoryAllocateInfoNV::handleTypes when allocating memory' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-handleType-01326)~^~ -VALIDATION_ERROR_2b005601~^~Y~^~None~^~vkGetMemoryWin32HandleNV~^~VUID-vkGetMemoryWin32HandleNV-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-device-parameter)~^~implicit -VALIDATION_ERROR_2b009c01~^~N~^~Unknown~^~vkGetMemoryWin32HandleNV~^~VUID-vkGetMemoryWin32HandleNV-handleType-parameter~^~core~^~The spec valid usage text states 'handleType must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-handleType-parameter)~^~implicit -VALIDATION_ERROR_2b009c03~^~Y~^~Unknown~^~vkGetMemoryWin32HandleNV~^~VUID-vkGetMemoryWin32HandleNV-handleType-requiredbitmask~^~core~^~The spec valid usage text states 'handleType must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-handleType-requiredbitmask)~^~implicit -VALIDATION_ERROR_2b00c601~^~Y~^~None~^~vkGetMemoryWin32HandleNV~^~VUID-vkGetMemoryWin32HandleNV-memory-parameter~^~core~^~The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-memory-parameter)~^~implicit -VALIDATION_ERROR_2b00c607~^~Y~^~Unknown~^~vkGetMemoryWin32HandleNV~^~VUID-vkGetMemoryWin32HandleNV-memory-parent~^~core~^~The spec valid usage text states 'memory must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-memory-parent)~^~implicit -VALIDATION_ERROR_2b017c01~^~Y~^~Unknown~^~vkGetMemoryWin32HandleNV~^~VUID-vkGetMemoryWin32HandleNV-pHandle-parameter~^~core~^~The spec valid usage text states 'pHandle must be a valid pointer to a HANDLE value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-pHandle-parameter)~^~implicit -VALIDATION_ERROR_2b200532~^~N~^~Unknown~^~vkGetMemoryWin32HandlePropertiesKHR~^~VUID-vkGetMemoryWin32HandlePropertiesKHR-handle-00665~^~core~^~The spec valid usage text states 'handle must be an external memory handle created outside of the Vulkan API.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-handle-00665)~^~ -VALIDATION_ERROR_2b200534~^~N~^~Unknown~^~vkGetMemoryWin32HandlePropertiesKHR~^~VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-00666~^~core~^~The spec valid usage text states 'handleType must not be one of the handle types defined as opaque.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-00666)~^~ -VALIDATION_ERROR_2b205601~^~Y~^~Unknown~^~vkGetMemoryWin32HandlePropertiesKHR~^~VUID-vkGetMemoryWin32HandlePropertiesKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-device-parameter)~^~implicit -VALIDATION_ERROR_2b209c01~^~Y~^~Unknown~^~vkGetMemoryWin32HandlePropertiesKHR~^~VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-parameter~^~core~^~The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-parameter)~^~implicit -VALIDATION_ERROR_2b21b601~^~N~^~Unknown~^~vkGetMemoryWin32HandlePropertiesKHR~^~VUID-vkGetMemoryWin32HandlePropertiesKHR-pMemoryWin32HandleProperties-parameter~^~core~^~The spec valid usage text states 'pMemoryWin32HandleProperties must be a valid pointer to a VkMemoryWin32HandlePropertiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-pMemoryWin32HandleProperties-parameter)~^~implicit -VALIDATION_ERROR_2b400009~^~Y~^~None~^~vkGetPastPresentationTimingGOOGLE~^~VUID-vkGetPastPresentationTimingGOOGLE-commonparent~^~core~^~The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-commonparent)~^~implicit -VALIDATION_ERROR_2b405601~^~Y~^~Unknown~^~vkGetPastPresentationTimingGOOGLE~^~VUID-vkGetPastPresentationTimingGOOGLE-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-device-parameter)~^~implicit -VALIDATION_ERROR_2b41ec01~^~N~^~Unknown~^~vkGetPastPresentationTimingGOOGLE~^~VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimingCount-parameter~^~core~^~The spec valid usage text states 'pPresentationTimingCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimingCount-parameter)~^~implicit -VALIDATION_ERROR_2b41ee01~^~Y~^~Unknown~^~vkGetPastPresentationTimingGOOGLE~^~VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimings-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pPresentationTimingCount is not 0, and pPresentationTimings is not NULL, pPresentationTimings must be a valid pointer to an array of pPresentationTimingCount VkPastPresentationTimingGOOGLE structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimings-parameter)~^~implicit -VALIDATION_ERROR_2b42f001~^~Y~^~Unknown~^~vkGetPastPresentationTimingGOOGLE~^~VUID-vkGetPastPresentationTimingGOOGLE-swapchain-parameter~^~core~^~The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-swapchain-parameter)~^~implicit -VALIDATION_ERROR_2b61f401~^~Y~^~Unknown~^~vkGetPhysicalDeviceDisplayPlanePropertiesKHR~^~VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pProperties-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkDisplayPlanePropertiesKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pProperties-parameter)~^~implicit -VALIDATION_ERROR_2b61f601~^~N~^~Unknown~^~vkGetPhysicalDeviceDisplayPlanePropertiesKHR~^~VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pPropertyCount-parameter~^~core~^~The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pPropertyCount-parameter)~^~implicit -VALIDATION_ERROR_2b627a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceDisplayPlanePropertiesKHR~^~VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2b81f401~^~Y~^~Unknown~^~vkGetPhysicalDeviceDisplayPropertiesKHR~^~VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pProperties-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkDisplayPropertiesKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pProperties-parameter)~^~implicit -VALIDATION_ERROR_2b81f601~^~N~^~Unknown~^~vkGetPhysicalDeviceDisplayPropertiesKHR~^~VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pPropertyCount-parameter~^~core~^~The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pPropertyCount-parameter)~^~implicit -VALIDATION_ERROR_2b827a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceDisplayPropertiesKHR~^~VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2ba16201~^~N~^~Unknown~^~vkGetPhysicalDeviceExternalBufferPropertiesKHR~^~VUID-vkGetPhysicalDeviceExternalBufferPropertiesKHR-pExternalBufferInfo-parameter~^~core~^~The spec valid usage text states 'pExternalBufferInfo must be a valid pointer to a valid VkPhysicalDeviceExternalBufferInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalBufferPropertiesKHR-pExternalBufferInfo-parameter)~^~implicit -VALIDATION_ERROR_2ba16401~^~N~^~Unknown~^~vkGetPhysicalDeviceExternalBufferPropertiesKHR~^~VUID-vkGetPhysicalDeviceExternalBufferPropertiesKHR-pExternalBufferProperties-parameter~^~core~^~The spec valid usage text states 'pExternalBufferProperties must be a valid pointer to a VkExternalBufferPropertiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalBufferPropertiesKHR-pExternalBufferProperties-parameter)~^~implicit -VALIDATION_ERROR_2ba27a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceExternalBufferPropertiesKHR~^~VUID-vkGetPhysicalDeviceExternalBufferPropertiesKHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalBufferPropertiesKHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2bc08201~^~Y~^~Unknown~^~vkGetPhysicalDeviceExternalImageFormatPropertiesNV~^~VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-externalHandleType-parameter~^~core~^~The spec valid usage text states 'externalHandleType must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-externalHandleType-parameter)~^~implicit -VALIDATION_ERROR_2bc09001~^~Y~^~Unknown~^~vkGetPhysicalDeviceExternalImageFormatPropertiesNV~^~VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkImageCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-flags-parameter)~^~implicit, TBD in parameter validation layer. -VALIDATION_ERROR_2bc09201~^~Y~^~Unknown~^~vkGetPhysicalDeviceExternalImageFormatPropertiesNV~^~VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-format-parameter~^~core~^~The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-format-parameter)~^~implicit -VALIDATION_ERROR_2bc16601~^~Y~^~Unknown~^~vkGetPhysicalDeviceExternalImageFormatPropertiesNV~^~VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-pExternalImageFormatProperties-parameter~^~core~^~The spec valid usage text states 'pExternalImageFormatProperties must be a valid pointer to a VkExternalImageFormatPropertiesNV structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-pExternalImageFormatProperties-parameter)~^~implicit -VALIDATION_ERROR_2bc27a01~^~Y~^~None~^~vkGetPhysicalDeviceExternalImageFormatPropertiesNV~^~VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2bc2fa01~^~Y~^~Unknown~^~vkGetPhysicalDeviceExternalImageFormatPropertiesNV~^~VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-tiling-parameter~^~core~^~The spec valid usage text states 'tiling must be a valid VkImageTiling value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-tiling-parameter)~^~implicit -VALIDATION_ERROR_2bc30401~^~Y~^~Unknown~^~vkGetPhysicalDeviceExternalImageFormatPropertiesNV~^~VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-type-parameter~^~core~^~The spec valid usage text states 'type must be a valid VkImageType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-type-parameter)~^~implicit -VALIDATION_ERROR_2bc30601~^~N~^~Unknown~^~vkGetPhysicalDeviceExternalImageFormatPropertiesNV~^~VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-parameter~^~core~^~The spec valid usage text states 'usage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-parameter)~^~implicit -VALIDATION_ERROR_2bc30603~^~Y~^~Unknown~^~vkGetPhysicalDeviceExternalImageFormatPropertiesNV~^~VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-requiredbitmask~^~core~^~The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-requiredbitmask)~^~implicit -VALIDATION_ERROR_2be16801~^~N~^~Unknown~^~vkGetPhysicalDeviceExternalSemaphorePropertiesKHR~^~VUID-vkGetPhysicalDeviceExternalSemaphorePropertiesKHR-pExternalSemaphoreInfo-parameter~^~core~^~The spec valid usage text states 'pExternalSemaphoreInfo must be a valid pointer to a valid VkPhysicalDeviceExternalSemaphoreInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalSemaphorePropertiesKHR-pExternalSemaphoreInfo-parameter)~^~implicit -VALIDATION_ERROR_2be16a01~^~N~^~Unknown~^~vkGetPhysicalDeviceExternalSemaphorePropertiesKHR~^~VUID-vkGetPhysicalDeviceExternalSemaphorePropertiesKHR-pExternalSemaphoreProperties-parameter~^~core~^~The spec valid usage text states 'pExternalSemaphoreProperties must be a valid pointer to a VkExternalSemaphorePropertiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalSemaphorePropertiesKHR-pExternalSemaphoreProperties-parameter)~^~implicit -VALIDATION_ERROR_2be27a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceExternalSemaphorePropertiesKHR~^~VUID-vkGetPhysicalDeviceExternalSemaphorePropertiesKHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalSemaphorePropertiesKHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2aa05601~^~Y~^~Unknown~^~vkGetMemoryFdKHR~^~VUID-vkGetMemoryFdKHR-device-parameter~^~(VK_KHR_external_memory_fd)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryFdKHR-device-parameter)~^~implicit +VALIDATION_ERROR_2aa16c01~^~Y~^~Unknown~^~vkGetMemoryFdKHR~^~VUID-vkGetMemoryFdKHR-pFd-parameter~^~(VK_KHR_external_memory_fd)~^~The spec valid usage text states 'pFd must be a valid pointer to a int value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryFdKHR-pFd-parameter)~^~implicit +VALIDATION_ERROR_2aa39e01~^~N~^~None~^~vkGetMemoryFdKHR~^~VUID-vkGetMemoryFdKHR-pGetFdInfo-parameter~^~(VK_KHR_external_memory_fd)~^~The spec valid usage text states 'pGetFdInfo must be a valid pointer to a valid VkMemoryGetFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryFdKHR-pGetFdInfo-parameter)~^~implicit +VALIDATION_ERROR_2ac00542~^~N~^~Unknown~^~vkGetMemoryFdPropertiesKHR~^~VUID-vkGetMemoryFdPropertiesKHR-fd-00673~^~(VK_KHR_external_memory_fd)~^~The spec valid usage text states 'fd must be an external memory handle created outside of the Vulkan API.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-fd-00673)~^~ +VALIDATION_ERROR_2ac00544~^~N~^~Unknown~^~vkGetMemoryFdPropertiesKHR~^~VUID-vkGetMemoryFdPropertiesKHR-handleType-00674~^~(VK_KHR_external_memory_fd)~^~The spec valid usage text states 'handleType must not be VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-handleType-00674)~^~ +VALIDATION_ERROR_2ac05601~^~Y~^~Unknown~^~vkGetMemoryFdPropertiesKHR~^~VUID-vkGetMemoryFdPropertiesKHR-device-parameter~^~(VK_KHR_external_memory_fd)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-device-parameter)~^~implicit +VALIDATION_ERROR_2ac09c01~^~Y~^~Unknown~^~vkGetMemoryFdPropertiesKHR~^~VUID-vkGetMemoryFdPropertiesKHR-handleType-parameter~^~(VK_KHR_external_memory_fd)~^~The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-handleType-parameter)~^~implicit +VALIDATION_ERROR_2ac1ae01~^~N~^~Unknown~^~vkGetMemoryFdPropertiesKHR~^~VUID-vkGetMemoryFdPropertiesKHR-pMemoryFdProperties-parameter~^~(VK_KHR_external_memory_fd)~^~The spec valid usage text states 'pMemoryFdProperties must be a valid pointer to a VkMemoryFdPropertiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-pMemoryFdProperties-parameter)~^~implicit +VALIDATION_ERROR_2ae05601~^~Y~^~Unknown~^~vkGetMemoryWin32HandleKHR~^~VUID-vkGetMemoryWin32HandleKHR-device-parameter~^~(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-device-parameter)~^~implicit +VALIDATION_ERROR_2ae17c01~^~Y~^~Unknown~^~vkGetMemoryWin32HandleKHR~^~VUID-vkGetMemoryWin32HandleKHR-pHandle-parameter~^~(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'pHandle must be a valid pointer to a HANDLE value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-pHandle-parameter)~^~implicit +VALIDATION_ERROR_2ae3a001~^~N~^~None~^~vkGetMemoryWin32HandleKHR~^~VUID-vkGetMemoryWin32HandleKHR-pGetWin32HandleInfo-parameter~^~(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'pGetWin32HandleInfo must be a valid pointer to a valid VkMemoryGetWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-pGetWin32HandleInfo-parameter)~^~implicit +VALIDATION_ERROR_2b000a5c~^~N~^~Unknown~^~vkGetMemoryWin32HandleNV~^~VUID-vkGetMemoryWin32HandleNV-handleType-01326~^~(VK_NV_external_memory_win32)~^~The spec valid usage text states 'handleType must be a flag specified in VkExportMemoryAllocateInfoNV::handleTypes when allocating memory' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-handleType-01326)~^~ +VALIDATION_ERROR_2b005601~^~Y~^~None~^~vkGetMemoryWin32HandleNV~^~VUID-vkGetMemoryWin32HandleNV-device-parameter~^~(VK_NV_external_memory_win32)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-device-parameter)~^~implicit +VALIDATION_ERROR_2b009c01~^~N~^~Unknown~^~vkGetMemoryWin32HandleNV~^~VUID-vkGetMemoryWin32HandleNV-handleType-parameter~^~(VK_NV_external_memory_win32)~^~The spec valid usage text states 'handleType must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-handleType-parameter)~^~implicit +VALIDATION_ERROR_2b009c03~^~Y~^~Unknown~^~vkGetMemoryWin32HandleNV~^~VUID-vkGetMemoryWin32HandleNV-handleType-requiredbitmask~^~(VK_NV_external_memory_win32)~^~The spec valid usage text states 'handleType must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-handleType-requiredbitmask)~^~implicit +VALIDATION_ERROR_2b00c601~^~Y~^~None~^~vkGetMemoryWin32HandleNV~^~VUID-vkGetMemoryWin32HandleNV-memory-parameter~^~(VK_NV_external_memory_win32)~^~The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-memory-parameter)~^~implicit +VALIDATION_ERROR_2b00c607~^~Y~^~Unknown~^~vkGetMemoryWin32HandleNV~^~VUID-vkGetMemoryWin32HandleNV-memory-parent~^~(VK_NV_external_memory_win32)~^~The spec valid usage text states 'memory must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-memory-parent)~^~implicit +VALIDATION_ERROR_2b017c01~^~Y~^~Unknown~^~vkGetMemoryWin32HandleNV~^~VUID-vkGetMemoryWin32HandleNV-pHandle-parameter~^~(VK_NV_external_memory_win32)~^~The spec valid usage text states 'pHandle must be a valid pointer to a HANDLE value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-pHandle-parameter)~^~implicit +VALIDATION_ERROR_2b200532~^~N~^~Unknown~^~vkGetMemoryWin32HandlePropertiesKHR~^~VUID-vkGetMemoryWin32HandlePropertiesKHR-handle-00665~^~(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'handle must be an external memory handle created outside of the Vulkan API.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-handle-00665)~^~ +VALIDATION_ERROR_2b200534~^~N~^~Unknown~^~vkGetMemoryWin32HandlePropertiesKHR~^~VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-00666~^~(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'handleType must not be one of the handle types defined as opaque.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-00666)~^~ +VALIDATION_ERROR_2b205601~^~Y~^~Unknown~^~vkGetMemoryWin32HandlePropertiesKHR~^~VUID-vkGetMemoryWin32HandlePropertiesKHR-device-parameter~^~(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-device-parameter)~^~implicit +VALIDATION_ERROR_2b209c01~^~Y~^~Unknown~^~vkGetMemoryWin32HandlePropertiesKHR~^~VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-parameter~^~(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-parameter)~^~implicit +VALIDATION_ERROR_2b21b601~^~N~^~Unknown~^~vkGetMemoryWin32HandlePropertiesKHR~^~VUID-vkGetMemoryWin32HandlePropertiesKHR-pMemoryWin32HandleProperties-parameter~^~(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'pMemoryWin32HandleProperties must be a valid pointer to a VkMemoryWin32HandlePropertiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-pMemoryWin32HandleProperties-parameter)~^~implicit +VALIDATION_ERROR_2b400009~^~Y~^~None~^~vkGetPastPresentationTimingGOOGLE~^~VUID-vkGetPastPresentationTimingGOOGLE-commonparent~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_GOOGLE_display_timing)~^~The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-commonparent)~^~implicit +VALIDATION_ERROR_2b405601~^~Y~^~Unknown~^~vkGetPastPresentationTimingGOOGLE~^~VUID-vkGetPastPresentationTimingGOOGLE-device-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_GOOGLE_display_timing)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-device-parameter)~^~implicit +VALIDATION_ERROR_2b41ec01~^~N~^~Unknown~^~vkGetPastPresentationTimingGOOGLE~^~VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimingCount-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_GOOGLE_display_timing)~^~The spec valid usage text states 'pPresentationTimingCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimingCount-parameter)~^~implicit +VALIDATION_ERROR_2b41ee01~^~Y~^~Unknown~^~vkGetPastPresentationTimingGOOGLE~^~VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimings-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_GOOGLE_display_timing)~^~The spec valid usage text states 'If the value referenced by pPresentationTimingCount is not 0, and pPresentationTimings is not NULL, pPresentationTimings must be a valid pointer to an array of pPresentationTimingCount VkPastPresentationTimingGOOGLE structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimings-parameter)~^~implicit +VALIDATION_ERROR_2b42f001~^~Y~^~Unknown~^~vkGetPastPresentationTimingGOOGLE~^~VUID-vkGetPastPresentationTimingGOOGLE-swapchain-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_GOOGLE_display_timing)~^~The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-swapchain-parameter)~^~implicit +VALIDATION_ERROR_2b61f401~^~Y~^~Unknown~^~vkGetPhysicalDeviceDisplayPlanePropertiesKHR~^~VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pProperties-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkDisplayPlanePropertiesKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pProperties-parameter)~^~implicit +VALIDATION_ERROR_2b61f601~^~N~^~Unknown~^~vkGetPhysicalDeviceDisplayPlanePropertiesKHR~^~VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pPropertyCount-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pPropertyCount-parameter)~^~implicit +VALIDATION_ERROR_2b627a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceDisplayPlanePropertiesKHR~^~VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-physicalDevice-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2b81f401~^~Y~^~Unknown~^~vkGetPhysicalDeviceDisplayPropertiesKHR~^~VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pProperties-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkDisplayPropertiesKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pProperties-parameter)~^~implicit +VALIDATION_ERROR_2b81f601~^~N~^~Unknown~^~vkGetPhysicalDeviceDisplayPropertiesKHR~^~VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pPropertyCount-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pPropertyCount-parameter)~^~implicit +VALIDATION_ERROR_2b827a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceDisplayPropertiesKHR~^~VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-physicalDevice-parameter~^~(VK_KHR_surface)+(VK_KHR_display)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2ba16201~^~N~^~Unknown~^~vkGetPhysicalDeviceExternalBufferProperties~^~VUID-vkGetPhysicalDeviceExternalBufferProperties-pExternalBufferInfo-parameter~^~(VK_VERSION_1_1,VK_KHR_external_memory_capabilities)~^~The spec valid usage text states 'pExternalBufferInfo must be a valid pointer to a valid VkPhysicalDeviceExternalBufferInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalBufferProperties-pExternalBufferInfo-parameter)~^~implicit +VALIDATION_ERROR_2ba16401~^~N~^~Unknown~^~vkGetPhysicalDeviceExternalBufferProperties~^~VUID-vkGetPhysicalDeviceExternalBufferProperties-pExternalBufferProperties-parameter~^~(VK_VERSION_1_1,VK_KHR_external_memory_capabilities)~^~The spec valid usage text states 'pExternalBufferProperties must be a valid pointer to a VkExternalBufferProperties structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalBufferProperties-pExternalBufferProperties-parameter)~^~implicit +VALIDATION_ERROR_2ba27a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceExternalBufferProperties~^~VUID-vkGetPhysicalDeviceExternalBufferProperties-physicalDevice-parameter~^~(VK_VERSION_1_1,VK_KHR_external_memory_capabilities)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalBufferProperties-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2bc08201~^~Y~^~Unknown~^~vkGetPhysicalDeviceExternalImageFormatPropertiesNV~^~VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-externalHandleType-parameter~^~(VK_NV_external_memory_capabilities)~^~The spec valid usage text states 'externalHandleType must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-externalHandleType-parameter)~^~implicit +VALIDATION_ERROR_2bc09001~^~Y~^~Unknown~^~vkGetPhysicalDeviceExternalImageFormatPropertiesNV~^~VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-flags-parameter~^~(VK_NV_external_memory_capabilities)~^~The spec valid usage text states 'flags must be a valid combination of VkImageCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-flags-parameter)~^~implicit, TBD in parameter validation layer. +VALIDATION_ERROR_2bc09201~^~Y~^~Unknown~^~vkGetPhysicalDeviceExternalImageFormatPropertiesNV~^~VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-format-parameter~^~(VK_NV_external_memory_capabilities)~^~The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-format-parameter)~^~implicit +VALIDATION_ERROR_2bc16601~^~Y~^~Unknown~^~vkGetPhysicalDeviceExternalImageFormatPropertiesNV~^~VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-pExternalImageFormatProperties-parameter~^~(VK_NV_external_memory_capabilities)~^~The spec valid usage text states 'pExternalImageFormatProperties must be a valid pointer to a VkExternalImageFormatPropertiesNV structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-pExternalImageFormatProperties-parameter)~^~implicit +VALIDATION_ERROR_2bc27a01~^~Y~^~None~^~vkGetPhysicalDeviceExternalImageFormatPropertiesNV~^~VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-physicalDevice-parameter~^~(VK_NV_external_memory_capabilities)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2bc2fa01~^~Y~^~Unknown~^~vkGetPhysicalDeviceExternalImageFormatPropertiesNV~^~VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-tiling-parameter~^~(VK_NV_external_memory_capabilities)~^~The spec valid usage text states 'tiling must be a valid VkImageTiling value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-tiling-parameter)~^~implicit +VALIDATION_ERROR_2bc30401~^~Y~^~Unknown~^~vkGetPhysicalDeviceExternalImageFormatPropertiesNV~^~VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-type-parameter~^~(VK_NV_external_memory_capabilities)~^~The spec valid usage text states 'type must be a valid VkImageType value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-type-parameter)~^~implicit +VALIDATION_ERROR_2bc30601~^~N~^~Unknown~^~vkGetPhysicalDeviceExternalImageFormatPropertiesNV~^~VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-parameter~^~(VK_NV_external_memory_capabilities)~^~The spec valid usage text states 'usage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-parameter)~^~implicit +VALIDATION_ERROR_2bc30603~^~Y~^~Unknown~^~vkGetPhysicalDeviceExternalImageFormatPropertiesNV~^~VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-requiredbitmask~^~(VK_NV_external_memory_capabilities)~^~The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-requiredbitmask)~^~implicit +VALIDATION_ERROR_2be16801~^~N~^~Unknown~^~vkGetPhysicalDeviceExternalSemaphoreProperties~^~VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-pExternalSemaphoreInfo-parameter~^~(VK_VERSION_1_1,VK_KHR_external_semaphore_capabilities)~^~The spec valid usage text states 'pExternalSemaphoreInfo must be a valid pointer to a valid VkPhysicalDeviceExternalSemaphoreInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-pExternalSemaphoreInfo-parameter)~^~implicit +VALIDATION_ERROR_2be16a01~^~N~^~Unknown~^~vkGetPhysicalDeviceExternalSemaphoreProperties~^~VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-pExternalSemaphoreProperties-parameter~^~(VK_VERSION_1_1,VK_KHR_external_semaphore_capabilities)~^~The spec valid usage text states 'pExternalSemaphoreProperties must be a valid pointer to a VkExternalSemaphoreProperties structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-pExternalSemaphoreProperties-parameter)~^~implicit +VALIDATION_ERROR_2be27a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceExternalSemaphoreProperties~^~VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-physicalDevice-parameter~^~(VK_VERSION_1_1,VK_KHR_external_semaphore_capabilities)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-physicalDevice-parameter)~^~implicit VALIDATION_ERROR_2c016e01~^~Y~^~None~^~vkGetPhysicalDeviceFeatures~^~VUID-vkGetPhysicalDeviceFeatures-pFeatures-parameter~^~core~^~The spec valid usage text states 'pFeatures must be a valid pointer to a VkPhysicalDeviceFeatures structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFeatures-pFeatures-parameter)~^~implicit VALIDATION_ERROR_2c027a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceFeatures~^~VUID-vkGetPhysicalDeviceFeatures-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFeatures-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2c216e01~^~N~^~Unknown~^~vkGetPhysicalDeviceFeatures2KHR~^~VUID-vkGetPhysicalDeviceFeatures2KHR-pFeatures-parameter~^~core~^~The spec valid usage text states 'pFeatures must be a valid pointer to a VkPhysicalDeviceFeatures2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFeatures2KHR-pFeatures-parameter)~^~implicit -VALIDATION_ERROR_2c227a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceFeatures2KHR~^~VUID-vkGetPhysicalDeviceFeatures2KHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFeatures2KHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2c216e01~^~N~^~Unknown~^~vkGetPhysicalDeviceFeatures2~^~VUID-vkGetPhysicalDeviceFeatures2-pFeatures-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'pFeatures must be a valid pointer to a VkPhysicalDeviceFeatures2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceFeatures2-pFeatures-parameter)~^~implicit +VALIDATION_ERROR_2c227a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceFeatures2~^~VUID-vkGetPhysicalDeviceFeatures2-physicalDevice-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceFeatures2-physicalDevice-parameter)~^~implicit VALIDATION_ERROR_2c409201~^~Y~^~Unknown~^~vkGetPhysicalDeviceFormatProperties~^~VUID-vkGetPhysicalDeviceFormatProperties-format-parameter~^~core~^~The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFormatProperties-format-parameter)~^~implicit VALIDATION_ERROR_2c417601~^~Y~^~Unknown~^~vkGetPhysicalDeviceFormatProperties~^~VUID-vkGetPhysicalDeviceFormatProperties-pFormatProperties-parameter~^~core~^~The spec valid usage text states 'pFormatProperties must be a valid pointer to a VkFormatProperties structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFormatProperties-pFormatProperties-parameter)~^~implicit VALIDATION_ERROR_2c427a01~^~Y~^~None~^~vkGetPhysicalDeviceFormatProperties~^~VUID-vkGetPhysicalDeviceFormatProperties-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFormatProperties-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2c609201~^~Y~^~Unknown~^~vkGetPhysicalDeviceFormatProperties2KHR~^~VUID-vkGetPhysicalDeviceFormatProperties2KHR-format-parameter~^~core~^~The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFormatProperties2KHR-format-parameter)~^~implicit -VALIDATION_ERROR_2c617601~^~N~^~Unknown~^~vkGetPhysicalDeviceFormatProperties2KHR~^~VUID-vkGetPhysicalDeviceFormatProperties2KHR-pFormatProperties-parameter~^~core~^~The spec valid usage text states 'pFormatProperties must be a valid pointer to a VkFormatProperties2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFormatProperties2KHR-pFormatProperties-parameter)~^~implicit -VALIDATION_ERROR_2c627a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceFormatProperties2KHR~^~VUID-vkGetPhysicalDeviceFormatProperties2KHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFormatProperties2KHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2c816e01~^~N~^~Unknown~^~vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX~^~VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-pFeatures-parameter~^~core~^~The spec valid usage text states 'pFeatures must be a valid pointer to a VkDeviceGeneratedCommandsFeaturesNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-pFeatures-parameter)~^~implicit -VALIDATION_ERROR_2c81a401~^~N~^~Unknown~^~vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX~^~VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-pLimits-parameter~^~core~^~The spec valid usage text states 'pLimits must be a valid pointer to a VkDeviceGeneratedCommandsLimitsNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-pLimits-parameter)~^~implicit -VALIDATION_ERROR_2c827a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX~^~VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2c609201~^~Y~^~Unknown~^~vkGetPhysicalDeviceFormatProperties2~^~VUID-vkGetPhysicalDeviceFormatProperties2-format-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceFormatProperties2-format-parameter)~^~implicit +VALIDATION_ERROR_2c617601~^~N~^~Unknown~^~vkGetPhysicalDeviceFormatProperties2~^~VUID-vkGetPhysicalDeviceFormatProperties2-pFormatProperties-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'pFormatProperties must be a valid pointer to a VkFormatProperties2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceFormatProperties2-pFormatProperties-parameter)~^~implicit +VALIDATION_ERROR_2c627a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceFormatProperties2~^~VUID-vkGetPhysicalDeviceFormatProperties2-physicalDevice-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceFormatProperties2-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2c816e01~^~N~^~Unknown~^~vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX~^~VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-pFeatures-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'pFeatures must be a valid pointer to a VkDeviceGeneratedCommandsFeaturesNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-pFeatures-parameter)~^~implicit +VALIDATION_ERROR_2c81a401~^~N~^~Unknown~^~vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX~^~VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-pLimits-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'pLimits must be a valid pointer to a VkDeviceGeneratedCommandsLimitsNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-pLimits-parameter)~^~implicit +VALIDATION_ERROR_2c827a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX~^~VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-physicalDevice-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-physicalDevice-parameter)~^~implicit VALIDATION_ERROR_2ca09001~^~Y~^~Unknown~^~vkGetPhysicalDeviceImageFormatProperties~^~VUID-vkGetPhysicalDeviceImageFormatProperties-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkImageCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties-flags-parameter)~^~implicit, TBD in parameter validation layer. VALIDATION_ERROR_2ca09201~^~Y~^~Unknown~^~vkGetPhysicalDeviceImageFormatProperties~^~VUID-vkGetPhysicalDeviceImageFormatProperties-format-parameter~^~core~^~The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties-format-parameter)~^~implicit VALIDATION_ERROR_2ca18401~^~Y~^~Unknown~^~vkGetPhysicalDeviceImageFormatProperties~^~VUID-vkGetPhysicalDeviceImageFormatProperties-pImageFormatProperties-parameter~^~core~^~The spec valid usage text states 'pImageFormatProperties must be a valid pointer to a VkImageFormatProperties structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties-pImageFormatProperties-parameter)~^~implicit @@ -3117,31 +3163,32 @@ VALIDATION_ERROR_2ca30401~^~Y~^~Unknown~^~vkGetPhysicalDeviceImageFormatProperties~^~VUID-vkGetPhysicalDeviceImageFormatProperties-type-parameter~^~core~^~The spec valid usage text states 'type must be a valid VkImageType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties-type-parameter)~^~implicit VALIDATION_ERROR_2ca30601~^~N~^~Unknown~^~vkGetPhysicalDeviceImageFormatProperties~^~VUID-vkGetPhysicalDeviceImageFormatProperties-usage-parameter~^~core~^~The spec valid usage text states 'usage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties-usage-parameter)~^~implicit VALIDATION_ERROR_2ca30603~^~Y~^~Unknown~^~vkGetPhysicalDeviceImageFormatProperties~^~VUID-vkGetPhysicalDeviceImageFormatProperties-usage-requiredbitmask~^~core~^~The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties-usage-requiredbitmask)~^~implicit -VALIDATION_ERROR_2cc18201~^~N~^~Unknown~^~vkGetPhysicalDeviceImageFormatProperties2KHR~^~VUID-vkGetPhysicalDeviceImageFormatProperties2KHR-pImageFormatInfo-parameter~^~core~^~The spec valid usage text states 'pImageFormatInfo must be a valid pointer to a valid VkPhysicalDeviceImageFormatInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties2KHR-pImageFormatInfo-parameter)~^~implicit -VALIDATION_ERROR_2cc18401~^~N~^~Unknown~^~vkGetPhysicalDeviceImageFormatProperties2KHR~^~VUID-vkGetPhysicalDeviceImageFormatProperties2KHR-pImageFormatProperties-parameter~^~core~^~The spec valid usage text states 'pImageFormatProperties must be a valid pointer to a VkImageFormatProperties2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties2KHR-pImageFormatProperties-parameter)~^~implicit -VALIDATION_ERROR_2cc27a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceImageFormatProperties2KHR~^~VUID-vkGetPhysicalDeviceImageFormatProperties2KHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties2KHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2cc00e98~^~N~^~None~^~vkGetPhysicalDeviceImageFormatProperties2~^~VUID-vkGetPhysicalDeviceImageFormatProperties2-pNext-01868~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)+(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'If the pNext chain of pImageFormatProperties contains an instance of VkAndroidHardwareBufferUsageANDROID, the pNext chain of pImageFormatInfo must contain an instance of VkPhysicalDeviceExternalImageFormatInfo with handleType set to VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties2-pNext-01868)~^~ +VALIDATION_ERROR_2cc18201~^~N~^~Unknown~^~vkGetPhysicalDeviceImageFormatProperties2~^~VUID-vkGetPhysicalDeviceImageFormatProperties2-pImageFormatInfo-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'pImageFormatInfo must be a valid pointer to a valid VkPhysicalDeviceImageFormatInfo2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties2-pImageFormatInfo-parameter)~^~implicit +VALIDATION_ERROR_2cc18401~^~N~^~Unknown~^~vkGetPhysicalDeviceImageFormatProperties2~^~VUID-vkGetPhysicalDeviceImageFormatProperties2-pImageFormatProperties-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'pImageFormatProperties must be a valid pointer to a VkImageFormatProperties2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties2-pImageFormatProperties-parameter)~^~implicit +VALIDATION_ERROR_2cc27a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceImageFormatProperties2~^~VUID-vkGetPhysicalDeviceImageFormatProperties2-physicalDevice-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties2-physicalDevice-parameter)~^~implicit VALIDATION_ERROR_2ce1b001~^~Y~^~Unknown~^~vkGetPhysicalDeviceMemoryProperties~^~VUID-vkGetPhysicalDeviceMemoryProperties-pMemoryProperties-parameter~^~core~^~The spec valid usage text states 'pMemoryProperties must be a valid pointer to a VkPhysicalDeviceMemoryProperties structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMemoryProperties-pMemoryProperties-parameter)~^~implicit VALIDATION_ERROR_2ce27a01~^~Y~^~None~^~vkGetPhysicalDeviceMemoryProperties~^~VUID-vkGetPhysicalDeviceMemoryProperties-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMemoryProperties-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2d01b001~^~N~^~Unknown~^~vkGetPhysicalDeviceMemoryProperties2KHR~^~VUID-vkGetPhysicalDeviceMemoryProperties2KHR-pMemoryProperties-parameter~^~core~^~The spec valid usage text states 'pMemoryProperties must be a valid pointer to a VkPhysicalDeviceMemoryProperties2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMemoryProperties2KHR-pMemoryProperties-parameter)~^~implicit -VALIDATION_ERROR_2d027a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceMemoryProperties2KHR~^~VUID-vkGetPhysicalDeviceMemoryProperties2KHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMemoryProperties2KHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2d2009e2~^~Y~^~Unknown~^~vkGetPhysicalDeviceMirPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-queueFamilyIndex-01265~^~core~^~The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-queueFamilyIndex-01265)~^~ -VALIDATION_ERROR_2d203001~^~Y~^~Unknown~^~vkGetPhysicalDeviceMirPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-connection-parameter~^~core~^~The spec valid usage text states 'connection must be a valid pointer to a MirConnection value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-connection-parameter)~^~implicit -VALIDATION_ERROR_2d227a01~^~Y~^~None~^~vkGetPhysicalDeviceMirPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2d400009~^~Y~^~None~^~vkGetPhysicalDevicePresentRectanglesKHX~^~VUID-vkGetPhysicalDevicePresentRectanglesKHX-commonparent~^~core~^~The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHX-commonparent)~^~implicit -VALIDATION_ERROR_2d420a01~^~N~^~Unknown~^~vkGetPhysicalDevicePresentRectanglesKHX~^~VUID-vkGetPhysicalDevicePresentRectanglesKHX-pRectCount-parameter~^~core~^~The spec valid usage text states 'pRectCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHX-pRectCount-parameter)~^~implicit -VALIDATION_ERROR_2d420e01~^~Y~^~Unknown~^~vkGetPhysicalDevicePresentRectanglesKHX~^~VUID-vkGetPhysicalDevicePresentRectanglesKHX-pRects-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pRectCount is not 0, and pRects is not NULL, pRects must be a valid pointer to an array of pRectCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHX-pRects-parameter)~^~implicit -VALIDATION_ERROR_2d427a01~^~Y~^~Unknown~^~vkGetPhysicalDevicePresentRectanglesKHX~^~VUID-vkGetPhysicalDevicePresentRectanglesKHX-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHX-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2d42ec01~^~Y~^~Unknown~^~vkGetPhysicalDevicePresentRectanglesKHX~^~VUID-vkGetPhysicalDevicePresentRectanglesKHX-surface-parameter~^~core~^~The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHX-surface-parameter)~^~implicit +VALIDATION_ERROR_2d01b001~^~N~^~Unknown~^~vkGetPhysicalDeviceMemoryProperties2~^~VUID-vkGetPhysicalDeviceMemoryProperties2-pMemoryProperties-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'pMemoryProperties must be a valid pointer to a VkPhysicalDeviceMemoryProperties2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceMemoryProperties2-pMemoryProperties-parameter)~^~implicit +VALIDATION_ERROR_2d027a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceMemoryProperties2~^~VUID-vkGetPhysicalDeviceMemoryProperties2-physicalDevice-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceMemoryProperties2-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2d2009e2~^~Y~^~Unknown~^~vkGetPhysicalDeviceMirPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-queueFamilyIndex-01265~^~(VK_KHR_surface)+(VK_KHR_mir_surface)~^~The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-queueFamilyIndex-01265)~^~ +VALIDATION_ERROR_2d203001~^~Y~^~Unknown~^~vkGetPhysicalDeviceMirPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-connection-parameter~^~(VK_KHR_surface)+(VK_KHR_mir_surface)~^~The spec valid usage text states 'connection must be a valid pointer to a MirConnection value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-connection-parameter)~^~implicit +VALIDATION_ERROR_2d227a01~^~Y~^~None~^~vkGetPhysicalDeviceMirPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-physicalDevice-parameter~^~(VK_KHR_surface)+(VK_KHR_mir_surface)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2d400009~^~Y~^~None~^~vkGetPhysicalDevicePresentRectanglesKHR~^~VUID-vkGetPhysicalDevicePresentRectanglesKHR-commonparent~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHR-commonparent)~^~implicit +VALIDATION_ERROR_2d420a01~^~N~^~Unknown~^~vkGetPhysicalDevicePresentRectanglesKHR~^~VUID-vkGetPhysicalDevicePresentRectanglesKHR-pRectCount-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'pRectCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHR-pRectCount-parameter)~^~implicit +VALIDATION_ERROR_2d420e01~^~Y~^~Unknown~^~vkGetPhysicalDevicePresentRectanglesKHR~^~VUID-vkGetPhysicalDevicePresentRectanglesKHR-pRects-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If the value referenced by pRectCount is not 0, and pRects is not NULL, pRects must be a valid pointer to an array of pRectCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHR-pRects-parameter)~^~implicit +VALIDATION_ERROR_2d427a01~^~Y~^~Unknown~^~vkGetPhysicalDevicePresentRectanglesKHR~^~VUID-vkGetPhysicalDevicePresentRectanglesKHR-physicalDevice-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2d42ec01~^~Y~^~Unknown~^~vkGetPhysicalDevicePresentRectanglesKHR~^~VUID-vkGetPhysicalDevicePresentRectanglesKHR-surface-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHR-surface-parameter)~^~implicit VALIDATION_ERROR_2d61f401~^~Y~^~Unknown~^~vkGetPhysicalDeviceProperties~^~VUID-vkGetPhysicalDeviceProperties-pProperties-parameter~^~core~^~The spec valid usage text states 'pProperties must be a valid pointer to a VkPhysicalDeviceProperties structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceProperties-pProperties-parameter)~^~implicit VALIDATION_ERROR_2d627a01~^~Y~^~None~^~vkGetPhysicalDeviceProperties~^~VUID-vkGetPhysicalDeviceProperties-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceProperties-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2d81f401~^~N~^~Unknown~^~vkGetPhysicalDeviceProperties2KHR~^~VUID-vkGetPhysicalDeviceProperties2KHR-pProperties-parameter~^~core~^~The spec valid usage text states 'pProperties must be a valid pointer to a VkPhysicalDeviceProperties2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceProperties2KHR-pProperties-parameter)~^~implicit -VALIDATION_ERROR_2d827a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceProperties2KHR~^~VUID-vkGetPhysicalDeviceProperties2KHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceProperties2KHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2d81f401~^~N~^~Unknown~^~vkGetPhysicalDeviceProperties2~^~VUID-vkGetPhysicalDeviceProperties2-pProperties-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'pProperties must be a valid pointer to a VkPhysicalDeviceProperties2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceProperties2-pProperties-parameter)~^~implicit +VALIDATION_ERROR_2d827a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceProperties2~^~VUID-vkGetPhysicalDeviceProperties2-physicalDevice-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceProperties2-physicalDevice-parameter)~^~implicit VALIDATION_ERROR_2da20001~^~Y~^~Unknown~^~vkGetPhysicalDeviceQueueFamilyProperties~^~VUID-vkGetPhysicalDeviceQueueFamilyProperties-pQueueFamilyProperties-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pQueueFamilyPropertyCount is not 0, and pQueueFamilyProperties is not NULL, pQueueFamilyProperties must be a valid pointer to an array of pQueueFamilyPropertyCount VkQueueFamilyProperties structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceQueueFamilyProperties-pQueueFamilyProperties-parameter)~^~implicit VALIDATION_ERROR_2da20201~^~N~^~Unknown~^~vkGetPhysicalDeviceQueueFamilyProperties~^~VUID-vkGetPhysicalDeviceQueueFamilyProperties-pQueueFamilyPropertyCount-parameter~^~core~^~The spec valid usage text states 'pQueueFamilyPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceQueueFamilyProperties-pQueueFamilyPropertyCount-parameter)~^~implicit VALIDATION_ERROR_2da27a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceQueueFamilyProperties~^~VUID-vkGetPhysicalDeviceQueueFamilyProperties-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceQueueFamilyProperties-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2dc20001~^~Y~^~Unknown~^~vkGetPhysicalDeviceQueueFamilyProperties2KHR~^~VUID-vkGetPhysicalDeviceQueueFamilyProperties2KHR-pQueueFamilyProperties-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pQueueFamilyPropertyCount is not 0, and pQueueFamilyProperties is not NULL, pQueueFamilyProperties must be a valid pointer to an array of pQueueFamilyPropertyCount VkQueueFamilyProperties2KHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceQueueFamilyProperties2KHR-pQueueFamilyProperties-parameter)~^~implicit -VALIDATION_ERROR_2dc20201~^~N~^~Unknown~^~vkGetPhysicalDeviceQueueFamilyProperties2KHR~^~VUID-vkGetPhysicalDeviceQueueFamilyProperties2KHR-pQueueFamilyPropertyCount-parameter~^~core~^~The spec valid usage text states 'pQueueFamilyPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceQueueFamilyProperties2KHR-pQueueFamilyPropertyCount-parameter)~^~implicit -VALIDATION_ERROR_2dc27a01~^~N~^~Unknown~^~vkGetPhysicalDeviceQueueFamilyProperties2KHR~^~VUID-vkGetPhysicalDeviceQueueFamilyProperties2KHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceQueueFamilyProperties2KHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2dc20001~^~Y~^~Unknown~^~vkGetPhysicalDeviceQueueFamilyProperties2~^~VUID-vkGetPhysicalDeviceQueueFamilyProperties2-pQueueFamilyProperties-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'If the value referenced by pQueueFamilyPropertyCount is not 0, and pQueueFamilyProperties is not NULL, pQueueFamilyProperties must be a valid pointer to an array of pQueueFamilyPropertyCount VkQueueFamilyProperties2 structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceQueueFamilyProperties2-pQueueFamilyProperties-parameter)~^~implicit +VALIDATION_ERROR_2dc20201~^~N~^~Unknown~^~vkGetPhysicalDeviceQueueFamilyProperties2~^~VUID-vkGetPhysicalDeviceQueueFamilyProperties2-pQueueFamilyPropertyCount-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'pQueueFamilyPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceQueueFamilyProperties2-pQueueFamilyPropertyCount-parameter)~^~implicit +VALIDATION_ERROR_2dc27a01~^~N~^~Unknown~^~vkGetPhysicalDeviceQueueFamilyProperties2~^~VUID-vkGetPhysicalDeviceQueueFamilyProperties2-physicalDevice-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceQueueFamilyProperties2-physicalDevice-parameter)~^~implicit VALIDATION_ERROR_2de0088c~^~N~^~Unknown~^~vkGetPhysicalDeviceSparseImageFormatProperties~^~VUID-vkGetPhysicalDeviceSparseImageFormatProperties-samples-01094~^~core~^~The spec valid usage text states 'samples must be a bit value that is set in VkImageFormatProperties::sampleCounts returned by vkGetPhysicalDeviceImageFormatProperties with format, type, tiling, and usage equal to those in this command and flags equal to the value that is set in VkImageCreateInfo::flags when the image is created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties-samples-01094)~^~ VALIDATION_ERROR_2de09201~^~Y~^~Unknown~^~vkGetPhysicalDeviceSparseImageFormatProperties~^~VUID-vkGetPhysicalDeviceSparseImageFormatProperties-format-parameter~^~core~^~The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties-format-parameter)~^~implicit VALIDATION_ERROR_2de1f401~^~Y~^~Unknown~^~vkGetPhysicalDeviceSparseImageFormatProperties~^~VUID-vkGetPhysicalDeviceSparseImageFormatProperties-pProperties-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkSparseImageFormatProperties structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties-pProperties-parameter)~^~implicit @@ -3152,51 +3199,51 @@ VALIDATION_ERROR_2de30401~^~Y~^~Unknown~^~vkGetPhysicalDeviceSparseImageFormatProperties~^~VUID-vkGetPhysicalDeviceSparseImageFormatProperties-type-parameter~^~core~^~The spec valid usage text states 'type must be a valid VkImageType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties-type-parameter)~^~implicit VALIDATION_ERROR_2de30601~^~N~^~Unknown~^~vkGetPhysicalDeviceSparseImageFormatProperties~^~VUID-vkGetPhysicalDeviceSparseImageFormatProperties-usage-parameter~^~core~^~The spec valid usage text states 'usage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties-usage-parameter)~^~implicit VALIDATION_ERROR_2de30603~^~Y~^~Unknown~^~vkGetPhysicalDeviceSparseImageFormatProperties~^~VUID-vkGetPhysicalDeviceSparseImageFormatProperties-usage-requiredbitmask~^~core~^~The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties-usage-requiredbitmask)~^~implicit -VALIDATION_ERROR_2e017401~^~N~^~Unknown~^~vkGetPhysicalDeviceSparseImageFormatProperties2KHR~^~VUID-vkGetPhysicalDeviceSparseImageFormatProperties2KHR-pFormatInfo-parameter~^~core~^~The spec valid usage text states 'pFormatInfo must be a valid pointer to a valid VkPhysicalDeviceSparseImageFormatInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties2KHR-pFormatInfo-parameter)~^~implicit -VALIDATION_ERROR_2e01f401~^~Y~^~Unknown~^~vkGetPhysicalDeviceSparseImageFormatProperties2KHR~^~VUID-vkGetPhysicalDeviceSparseImageFormatProperties2KHR-pProperties-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkSparseImageFormatProperties2KHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties2KHR-pProperties-parameter)~^~implicit -VALIDATION_ERROR_2e01f601~^~N~^~Unknown~^~vkGetPhysicalDeviceSparseImageFormatProperties2KHR~^~VUID-vkGetPhysicalDeviceSparseImageFormatProperties2KHR-pPropertyCount-parameter~^~core~^~The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties2KHR-pPropertyCount-parameter)~^~implicit -VALIDATION_ERROR_2e027a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceSparseImageFormatProperties2KHR~^~VUID-vkGetPhysicalDeviceSparseImageFormatProperties2KHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties2KHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2e200009~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceCapabilities2EXT~^~VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-commonparent~^~core~^~The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-commonparent)~^~implicit -VALIDATION_ERROR_2e224a01~^~N~^~Unknown~^~vkGetPhysicalDeviceSurfaceCapabilities2EXT~^~VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-pSurfaceCapabilities-parameter~^~core~^~The spec valid usage text states 'pSurfaceCapabilities must be a valid pointer to a VkSurfaceCapabilities2EXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-pSurfaceCapabilities-parameter)~^~implicit -VALIDATION_ERROR_2e227a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfaceCapabilities2EXT~^~VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2e22ec01~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfaceCapabilities2EXT~^~VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-surface-parameter~^~core~^~The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-surface-parameter)~^~implicit -VALIDATION_ERROR_2e424a01~^~N~^~Unknown~^~vkGetPhysicalDeviceSurfaceCapabilities2KHR~^~VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceCapabilities-parameter~^~core~^~The spec valid usage text states 'pSurfaceCapabilities must be a valid pointer to a VkSurfaceCapabilities2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceCapabilities-parameter)~^~implicit -VALIDATION_ERROR_2e425001~^~N~^~Unknown~^~vkGetPhysicalDeviceSurfaceCapabilities2KHR~^~VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceInfo-parameter~^~core~^~The spec valid usage text states 'pSurfaceInfo must be a valid pointer to a valid VkPhysicalDeviceSurfaceInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceInfo-parameter)~^~implicit -VALIDATION_ERROR_2e427a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfaceCapabilities2KHR~^~VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2e600009~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceCapabilitiesKHR~^~VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-commonparent~^~core~^~The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-commonparent)~^~implicit -VALIDATION_ERROR_2e624a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfaceCapabilitiesKHR~^~VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-pSurfaceCapabilities-parameter~^~core~^~The spec valid usage text states 'pSurfaceCapabilities must be a valid pointer to a VkSurfaceCapabilitiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-pSurfaceCapabilities-parameter)~^~implicit -VALIDATION_ERROR_2e627a01~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceCapabilitiesKHR~^~VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2e62ec01~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceCapabilitiesKHR~^~VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-surface-parameter~^~core~^~The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-surface-parameter)~^~implicit -VALIDATION_ERROR_2e824c01~^~N~^~Unknown~^~vkGetPhysicalDeviceSurfaceFormats2KHR~^~VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceFormatCount-parameter~^~core~^~The spec valid usage text states 'pSurfaceFormatCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceFormatCount-parameter)~^~implicit -VALIDATION_ERROR_2e824e01~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfaceFormats2KHR~^~VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceFormats-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pSurfaceFormatCount is not 0, and pSurfaceFormats is not NULL, pSurfaceFormats must be a valid pointer to an array of pSurfaceFormatCount VkSurfaceFormat2KHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceFormats-parameter)~^~implicit -VALIDATION_ERROR_2e825001~^~N~^~Unknown~^~vkGetPhysicalDeviceSurfaceFormats2KHR~^~VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceInfo-parameter~^~core~^~The spec valid usage text states 'pSurfaceInfo must be a valid pointer to a valid VkPhysicalDeviceSurfaceInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceInfo-parameter)~^~implicit -VALIDATION_ERROR_2e827a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfaceFormats2KHR~^~VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2ea00009~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceFormatsKHR~^~VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-commonparent~^~core~^~The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-commonparent)~^~implicit -VALIDATION_ERROR_2ea24c01~^~N~^~Unknown~^~vkGetPhysicalDeviceSurfaceFormatsKHR~^~VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormatCount-parameter~^~core~^~The spec valid usage text states 'pSurfaceFormatCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormatCount-parameter)~^~implicit -VALIDATION_ERROR_2ea24e01~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfaceFormatsKHR~^~VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormats-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pSurfaceFormatCount is not 0, and pSurfaceFormats is not NULL, pSurfaceFormats must be a valid pointer to an array of pSurfaceFormatCount VkSurfaceFormatKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormats-parameter)~^~implicit -VALIDATION_ERROR_2ea27a01~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceFormatsKHR~^~VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2ea2ec01~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceFormatsKHR~^~VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-surface-parameter~^~core~^~The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-surface-parameter)~^~implicit -VALIDATION_ERROR_2ec00009~^~Y~^~None~^~vkGetPhysicalDeviceSurfacePresentModesKHR~^~VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-commonparent~^~core~^~The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-commonparent)~^~implicit -VALIDATION_ERROR_2ec1e801~^~N~^~Unknown~^~vkGetPhysicalDeviceSurfacePresentModesKHR~^~VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModeCount-parameter~^~core~^~The spec valid usage text states 'pPresentModeCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModeCount-parameter)~^~implicit -VALIDATION_ERROR_2ec1ea01~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfacePresentModesKHR~^~VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModes-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pPresentModeCount is not 0, and pPresentModes is not NULL, pPresentModes must be a valid pointer to an array of pPresentModeCount VkPresentModeKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModes-parameter)~^~implicit -VALIDATION_ERROR_2ec27a01~^~Y~^~None~^~vkGetPhysicalDeviceSurfacePresentModesKHR~^~VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2ec2ec01~^~Y~^~None~^~vkGetPhysicalDeviceSurfacePresentModesKHR~^~VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-surface-parameter~^~core~^~The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-surface-parameter)~^~implicit -VALIDATION_ERROR_2ee00009~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceSupportKHR~^~VUID-vkGetPhysicalDeviceSurfaceSupportKHR-commonparent~^~core~^~The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-commonparent)~^~implicit -VALIDATION_ERROR_2ee009ea~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfaceSupportKHR~^~VUID-vkGetPhysicalDeviceSurfaceSupportKHR-queueFamilyIndex-01269~^~core~^~The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-queueFamilyIndex-01269)~^~ -VALIDATION_ERROR_2ee24601~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfaceSupportKHR~^~VUID-vkGetPhysicalDeviceSurfaceSupportKHR-pSupported-parameter~^~core~^~The spec valid usage text states 'pSupported must be a valid pointer to a VkBool32 value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-pSupported-parameter)~^~implicit -VALIDATION_ERROR_2ee27a01~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceSupportKHR~^~VUID-vkGetPhysicalDeviceSurfaceSupportKHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2ee2ec01~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceSupportKHR~^~VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter~^~core~^~The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter)~^~implicit -VALIDATION_ERROR_2f000a34~^~Y~^~Unknown~^~vkGetPhysicalDeviceWaylandPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-queueFamilyIndex-01306~^~core~^~The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-queueFamilyIndex-01306)~^~ -VALIDATION_ERROR_2f006001~^~Y~^~Unknown~^~vkGetPhysicalDeviceWaylandPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-display-parameter~^~core~^~The spec valid usage text states 'display must be a valid pointer to a wl_display value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-display-parameter)~^~implicit -VALIDATION_ERROR_2f027a01~^~Y~^~None~^~vkGetPhysicalDeviceWaylandPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2f200a3a~^~Y~^~Unknown~^~vkGetPhysicalDeviceWin32PresentationSupportKHR~^~VUID-vkGetPhysicalDeviceWin32PresentationSupportKHR-queueFamilyIndex-01309~^~core~^~The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceWin32PresentationSupportKHR-queueFamilyIndex-01309)~^~ -VALIDATION_ERROR_2f227a01~^~Y~^~None~^~vkGetPhysicalDeviceWin32PresentationSupportKHR~^~VUID-vkGetPhysicalDeviceWin32PresentationSupportKHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceWin32PresentationSupportKHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2f400a40~^~Y~^~Unknown~^~vkGetPhysicalDeviceXcbPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-queueFamilyIndex-01312~^~core~^~The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-queueFamilyIndex-01312)~^~ -VALIDATION_ERROR_2f403001~^~Y~^~Unknown~^~vkGetPhysicalDeviceXcbPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-connection-parameter~^~core~^~The spec valid usage text states 'connection must be a valid pointer to a xcb_connection_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-connection-parameter)~^~implicit -VALIDATION_ERROR_2f427a01~^~Y~^~None~^~vkGetPhysicalDeviceXcbPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2f600a46~^~Y~^~Unknown~^~vkGetPhysicalDeviceXlibPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-queueFamilyIndex-01315~^~core~^~The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-queueFamilyIndex-01315)~^~ -VALIDATION_ERROR_2f606601~^~Y~^~Unknown~^~vkGetPhysicalDeviceXlibPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-dpy-parameter~^~core~^~The spec valid usage text states 'dpy must be a valid pointer to a Display value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-dpy-parameter)~^~implicit -VALIDATION_ERROR_2f627a01~^~Y~^~None~^~vkGetPhysicalDeviceXlibPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2e017401~^~N~^~Unknown~^~vkGetPhysicalDeviceSparseImageFormatProperties2~^~VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-pFormatInfo-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'pFormatInfo must be a valid pointer to a valid VkPhysicalDeviceSparseImageFormatInfo2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-pFormatInfo-parameter)~^~implicit +VALIDATION_ERROR_2e01f401~^~Y~^~Unknown~^~vkGetPhysicalDeviceSparseImageFormatProperties2~^~VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-pProperties-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkSparseImageFormatProperties2 structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-pProperties-parameter)~^~implicit +VALIDATION_ERROR_2e01f601~^~N~^~Unknown~^~vkGetPhysicalDeviceSparseImageFormatProperties2~^~VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-pPropertyCount-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-pPropertyCount-parameter)~^~implicit +VALIDATION_ERROR_2e027a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceSparseImageFormatProperties2~^~VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-physicalDevice-parameter~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2e200009~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceCapabilities2EXT~^~VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-commonparent~^~(VK_KHR_surface)+(VK_EXT_display_surface_counter)~^~The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-commonparent)~^~implicit +VALIDATION_ERROR_2e224a01~^~N~^~Unknown~^~vkGetPhysicalDeviceSurfaceCapabilities2EXT~^~VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-pSurfaceCapabilities-parameter~^~(VK_KHR_surface)+(VK_EXT_display_surface_counter)~^~The spec valid usage text states 'pSurfaceCapabilities must be a valid pointer to a VkSurfaceCapabilities2EXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-pSurfaceCapabilities-parameter)~^~implicit +VALIDATION_ERROR_2e227a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfaceCapabilities2EXT~^~VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-physicalDevice-parameter~^~(VK_KHR_surface)+(VK_EXT_display_surface_counter)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2e22ec01~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfaceCapabilities2EXT~^~VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-surface-parameter~^~(VK_KHR_surface)+(VK_EXT_display_surface_counter)~^~The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-surface-parameter)~^~implicit +VALIDATION_ERROR_2e424a01~^~N~^~Unknown~^~vkGetPhysicalDeviceSurfaceCapabilities2KHR~^~VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceCapabilities-parameter~^~(VK_KHR_surface)+(VK_KHR_get_surface_capabilities2)~^~The spec valid usage text states 'pSurfaceCapabilities must be a valid pointer to a VkSurfaceCapabilities2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceCapabilities-parameter)~^~implicit +VALIDATION_ERROR_2e425001~^~N~^~Unknown~^~vkGetPhysicalDeviceSurfaceCapabilities2KHR~^~VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceInfo-parameter~^~(VK_KHR_surface)+(VK_KHR_get_surface_capabilities2)~^~The spec valid usage text states 'pSurfaceInfo must be a valid pointer to a valid VkPhysicalDeviceSurfaceInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceInfo-parameter)~^~implicit +VALIDATION_ERROR_2e427a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfaceCapabilities2KHR~^~VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-physicalDevice-parameter~^~(VK_KHR_surface)+(VK_KHR_get_surface_capabilities2)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2e600009~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceCapabilitiesKHR~^~VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-commonparent~^~(VK_KHR_surface)~^~The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-commonparent)~^~implicit +VALIDATION_ERROR_2e624a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfaceCapabilitiesKHR~^~VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-pSurfaceCapabilities-parameter~^~(VK_KHR_surface)~^~The spec valid usage text states 'pSurfaceCapabilities must be a valid pointer to a VkSurfaceCapabilitiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-pSurfaceCapabilities-parameter)~^~implicit +VALIDATION_ERROR_2e627a01~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceCapabilitiesKHR~^~VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-physicalDevice-parameter~^~(VK_KHR_surface)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2e62ec01~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceCapabilitiesKHR~^~VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-surface-parameter~^~(VK_KHR_surface)~^~The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-surface-parameter)~^~implicit +VALIDATION_ERROR_2e824c01~^~N~^~Unknown~^~vkGetPhysicalDeviceSurfaceFormats2KHR~^~VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceFormatCount-parameter~^~(VK_KHR_surface)+(VK_KHR_get_surface_capabilities2)~^~The spec valid usage text states 'pSurfaceFormatCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceFormatCount-parameter)~^~implicit +VALIDATION_ERROR_2e824e01~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfaceFormats2KHR~^~VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceFormats-parameter~^~(VK_KHR_surface)+(VK_KHR_get_surface_capabilities2)~^~The spec valid usage text states 'If the value referenced by pSurfaceFormatCount is not 0, and pSurfaceFormats is not NULL, pSurfaceFormats must be a valid pointer to an array of pSurfaceFormatCount VkSurfaceFormat2KHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceFormats-parameter)~^~implicit +VALIDATION_ERROR_2e825001~^~N~^~Unknown~^~vkGetPhysicalDeviceSurfaceFormats2KHR~^~VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceInfo-parameter~^~(VK_KHR_surface)+(VK_KHR_get_surface_capabilities2)~^~The spec valid usage text states 'pSurfaceInfo must be a valid pointer to a valid VkPhysicalDeviceSurfaceInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceInfo-parameter)~^~implicit +VALIDATION_ERROR_2e827a01~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfaceFormats2KHR~^~VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-physicalDevice-parameter~^~(VK_KHR_surface)+(VK_KHR_get_surface_capabilities2)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2ea00009~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceFormatsKHR~^~VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-commonparent~^~(VK_KHR_surface)~^~The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-commonparent)~^~implicit +VALIDATION_ERROR_2ea24c01~^~N~^~Unknown~^~vkGetPhysicalDeviceSurfaceFormatsKHR~^~VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormatCount-parameter~^~(VK_KHR_surface)~^~The spec valid usage text states 'pSurfaceFormatCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormatCount-parameter)~^~implicit +VALIDATION_ERROR_2ea24e01~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfaceFormatsKHR~^~VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormats-parameter~^~(VK_KHR_surface)~^~The spec valid usage text states 'If the value referenced by pSurfaceFormatCount is not 0, and pSurfaceFormats is not NULL, pSurfaceFormats must be a valid pointer to an array of pSurfaceFormatCount VkSurfaceFormatKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormats-parameter)~^~implicit +VALIDATION_ERROR_2ea27a01~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceFormatsKHR~^~VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-physicalDevice-parameter~^~(VK_KHR_surface)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2ea2ec01~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceFormatsKHR~^~VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-surface-parameter~^~(VK_KHR_surface)~^~The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-surface-parameter)~^~implicit +VALIDATION_ERROR_2ec00009~^~Y~^~None~^~vkGetPhysicalDeviceSurfacePresentModesKHR~^~VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-commonparent~^~(VK_KHR_surface)~^~The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-commonparent)~^~implicit +VALIDATION_ERROR_2ec1e801~^~N~^~Unknown~^~vkGetPhysicalDeviceSurfacePresentModesKHR~^~VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModeCount-parameter~^~(VK_KHR_surface)~^~The spec valid usage text states 'pPresentModeCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModeCount-parameter)~^~implicit +VALIDATION_ERROR_2ec1ea01~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfacePresentModesKHR~^~VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModes-parameter~^~(VK_KHR_surface)~^~The spec valid usage text states 'If the value referenced by pPresentModeCount is not 0, and pPresentModes is not NULL, pPresentModes must be a valid pointer to an array of pPresentModeCount VkPresentModeKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModes-parameter)~^~implicit +VALIDATION_ERROR_2ec27a01~^~Y~^~None~^~vkGetPhysicalDeviceSurfacePresentModesKHR~^~VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-physicalDevice-parameter~^~(VK_KHR_surface)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2ec2ec01~^~Y~^~None~^~vkGetPhysicalDeviceSurfacePresentModesKHR~^~VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-surface-parameter~^~(VK_KHR_surface)~^~The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-surface-parameter)~^~implicit +VALIDATION_ERROR_2ee00009~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceSupportKHR~^~VUID-vkGetPhysicalDeviceSurfaceSupportKHR-commonparent~^~(VK_KHR_surface)~^~The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-commonparent)~^~implicit +VALIDATION_ERROR_2ee009ea~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfaceSupportKHR~^~VUID-vkGetPhysicalDeviceSurfaceSupportKHR-queueFamilyIndex-01269~^~(VK_KHR_surface)~^~The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-queueFamilyIndex-01269)~^~ +VALIDATION_ERROR_2ee24601~^~Y~^~Unknown~^~vkGetPhysicalDeviceSurfaceSupportKHR~^~VUID-vkGetPhysicalDeviceSurfaceSupportKHR-pSupported-parameter~^~(VK_KHR_surface)~^~The spec valid usage text states 'pSupported must be a valid pointer to a VkBool32 value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-pSupported-parameter)~^~implicit +VALIDATION_ERROR_2ee27a01~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceSupportKHR~^~VUID-vkGetPhysicalDeviceSurfaceSupportKHR-physicalDevice-parameter~^~(VK_KHR_surface)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2ee2ec01~^~Y~^~None~^~vkGetPhysicalDeviceSurfaceSupportKHR~^~VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter~^~(VK_KHR_surface)~^~The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter)~^~implicit +VALIDATION_ERROR_2f000a34~^~Y~^~Unknown~^~vkGetPhysicalDeviceWaylandPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-queueFamilyIndex-01306~^~(VK_KHR_surface)+(VK_KHR_wayland_surface)~^~The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-queueFamilyIndex-01306)~^~ +VALIDATION_ERROR_2f006001~^~Y~^~Unknown~^~vkGetPhysicalDeviceWaylandPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-display-parameter~^~(VK_KHR_surface)+(VK_KHR_wayland_surface)~^~The spec valid usage text states 'display must be a valid pointer to a wl_display value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-display-parameter)~^~implicit +VALIDATION_ERROR_2f027a01~^~Y~^~None~^~vkGetPhysicalDeviceWaylandPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-physicalDevice-parameter~^~(VK_KHR_surface)+(VK_KHR_wayland_surface)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2f200a3a~^~Y~^~Unknown~^~vkGetPhysicalDeviceWin32PresentationSupportKHR~^~VUID-vkGetPhysicalDeviceWin32PresentationSupportKHR-queueFamilyIndex-01309~^~(VK_KHR_surface)+(VK_KHR_win32_surface)~^~The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceWin32PresentationSupportKHR-queueFamilyIndex-01309)~^~ +VALIDATION_ERROR_2f227a01~^~Y~^~None~^~vkGetPhysicalDeviceWin32PresentationSupportKHR~^~VUID-vkGetPhysicalDeviceWin32PresentationSupportKHR-physicalDevice-parameter~^~(VK_KHR_surface)+(VK_KHR_win32_surface)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceWin32PresentationSupportKHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2f400a40~^~Y~^~Unknown~^~vkGetPhysicalDeviceXcbPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-queueFamilyIndex-01312~^~(VK_KHR_surface)+(VK_KHR_xcb_surface)~^~The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-queueFamilyIndex-01312)~^~ +VALIDATION_ERROR_2f403001~^~Y~^~Unknown~^~vkGetPhysicalDeviceXcbPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-connection-parameter~^~(VK_KHR_surface)+(VK_KHR_xcb_surface)~^~The spec valid usage text states 'connection must be a valid pointer to a xcb_connection_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-connection-parameter)~^~implicit +VALIDATION_ERROR_2f427a01~^~Y~^~None~^~vkGetPhysicalDeviceXcbPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-physicalDevice-parameter~^~(VK_KHR_surface)+(VK_KHR_xcb_surface)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2f600a46~^~Y~^~Unknown~^~vkGetPhysicalDeviceXlibPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-queueFamilyIndex-01315~^~(VK_KHR_surface)+(VK_KHR_xlib_surface)~^~The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-queueFamilyIndex-01315)~^~ +VALIDATION_ERROR_2f606601~^~Y~^~Unknown~^~vkGetPhysicalDeviceXlibPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-dpy-parameter~^~(VK_KHR_surface)+(VK_KHR_xlib_surface)~^~The spec valid usage text states 'dpy must be a valid pointer to a Display value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-dpy-parameter)~^~implicit +VALIDATION_ERROR_2f627a01~^~Y~^~None~^~vkGetPhysicalDeviceXlibPresentationSupportKHR~^~VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-physicalDevice-parameter~^~(VK_KHR_surface)+(VK_KHR_xlib_surface)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-physicalDevice-parameter)~^~implicit VALIDATION_ERROR_2f805601~^~Y~^~None~^~vkGetPipelineCacheData~^~VUID-vkGetPipelineCacheData-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPipelineCacheData-device-parameter)~^~implicit VALIDATION_ERROR_2f812201~^~Y~^~Unknown~^~vkGetPipelineCacheData~^~VUID-vkGetPipelineCacheData-pData-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pDataSize is not 0, and pData is not NULL, pData must be a valid pointer to an array of pDataSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPipelineCacheData-pData-parameter)~^~implicit VALIDATION_ERROR_2f812401~^~N~^~Unknown~^~vkGetPipelineCacheData~^~VUID-vkGetPipelineCacheData-pDataSize-parameter~^~core~^~The spec valid usage text states 'pDataSize must be a valid pointer to a size_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPipelineCacheData-pDataSize-parameter)~^~implicit @@ -3207,66 +3254,49 @@ VALIDATION_ERROR_2fa0065e~^~N~^~Unknown~^~vkGetQueryPoolResults~^~VUID-vkGetQueryPoolResults-flags-00815~^~core~^~The spec valid usage text states 'If VK_QUERY_RESULT_64_BIT is set in flags then pData and stride must be multiples of 8' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetQueryPoolResults-flags-00815)~^~ VALIDATION_ERROR_2fa00660~^~N~^~Unknown~^~vkGetQueryPoolResults~^~VUID-vkGetQueryPoolResults-firstQuery-00816~^~core~^~The spec valid usage text states 'The sum of firstQuery and queryCount must be less than or equal to the number of queries in queryPool' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetQueryPoolResults-firstQuery-00816)~^~ VALIDATION_ERROR_2fa00662~^~N~^~Unknown~^~vkGetQueryPoolResults~^~VUID-vkGetQueryPoolResults-dataSize-00817~^~core~^~The spec valid usage text states 'dataSize must be large enough to contain the result of each query, as described here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetQueryPoolResults-dataSize-00817)~^~ -VALIDATION_ERROR_2fa00664~^~N~^~Unknown~^~vkGetQueryPoolResults~^~VUID-vkGetQueryPoolResults-queryType-00818~^~core~^~The spec valid usage text states 'If the queryType used to create queryPool was VK_QUERY_TYPE_TIMESTAMP, flags must not contain VK_QUERY_RESULT_PARTIAL_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetQueryPoolResults-queryType-00818)~^~ +VALIDATION_ERROR_2fa00664~^~Y~^~QueryPoolInUseDestroyedSignaled~^~vkGetQueryPoolResults~^~VUID-vkGetQueryPoolResults-queryType-00818~^~core~^~The spec valid usage text states 'If the queryType used to create queryPool was VK_QUERY_TYPE_TIMESTAMP, flags must not contain VK_QUERY_RESULT_PARTIAL_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetQueryPoolResults-queryType-00818)~^~ VALIDATION_ERROR_2fa03c1b~^~Y~^~Unknown~^~vkGetQueryPoolResults~^~VUID-vkGetQueryPoolResults-dataSize-arraylength~^~core~^~The spec valid usage text states 'dataSize must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetQueryPoolResults-dataSize-arraylength)~^~implicit VALIDATION_ERROR_2fa05601~^~Y~^~None~^~vkGetQueryPoolResults~^~VUID-vkGetQueryPoolResults-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetQueryPoolResults-device-parameter)~^~implicit VALIDATION_ERROR_2fa09001~^~Y~^~Unknown~^~vkGetQueryPoolResults~^~VUID-vkGetQueryPoolResults-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkQueryResultFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetQueryPoolResults-flags-parameter)~^~implicit, TBD in parameter validation layer. VALIDATION_ERROR_2fa12201~^~Y~^~Unknown~^~vkGetQueryPoolResults~^~VUID-vkGetQueryPoolResults-pData-parameter~^~core~^~The spec valid usage text states 'pData must be a valid pointer to an array of dataSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetQueryPoolResults-pData-parameter)~^~implicit VALIDATION_ERROR_2fa29801~^~Y~^~None~^~vkGetQueryPoolResults~^~VUID-vkGetQueryPoolResults-queryPool-parameter~^~core~^~The spec valid usage text states 'queryPool must be a valid VkQueryPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetQueryPoolResults-queryPool-parameter)~^~implicit VALIDATION_ERROR_2fa29807~^~Y~^~Unknown~^~vkGetQueryPoolResults~^~VUID-vkGetQueryPoolResults-queryPool-parent~^~core~^~The spec valid usage text states 'queryPool must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetQueryPoolResults-queryPool-parent)~^~implicit -VALIDATION_ERROR_2fc06601~^~Y~^~Unknown~^~vkGetRandROutputDisplayEXT~^~VUID-vkGetRandROutputDisplayEXT-dpy-parameter~^~core~^~The spec valid usage text states 'dpy must be a valid pointer to a Display value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRandROutputDisplayEXT-dpy-parameter)~^~implicit -VALIDATION_ERROR_2fc14801~^~Y~^~Unknown~^~vkGetRandROutputDisplayEXT~^~VUID-vkGetRandROutputDisplayEXT-pDisplay-parameter~^~core~^~The spec valid usage text states 'pDisplay must be a valid pointer to a VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRandROutputDisplayEXT-pDisplay-parameter)~^~implicit -VALIDATION_ERROR_2fc27a01~^~Y~^~Unknown~^~vkGetRandROutputDisplayEXT~^~VUID-vkGetRandROutputDisplayEXT-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRandROutputDisplayEXT-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_2fe00009~^~Y~^~None~^~vkGetRefreshCycleDurationGOOGLE~^~VUID-vkGetRefreshCycleDurationGOOGLE-commonparent~^~core~^~The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRefreshCycleDurationGOOGLE-commonparent)~^~implicit -VALIDATION_ERROR_2fe05601~^~Y~^~Unknown~^~vkGetRefreshCycleDurationGOOGLE~^~VUID-vkGetRefreshCycleDurationGOOGLE-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRefreshCycleDurationGOOGLE-device-parameter)~^~implicit -VALIDATION_ERROR_2fe15001~^~Y~^~Unknown~^~vkGetRefreshCycleDurationGOOGLE~^~VUID-vkGetRefreshCycleDurationGOOGLE-pDisplayTimingProperties-parameter~^~core~^~The spec valid usage text states 'pDisplayTimingProperties must be a valid pointer to a VkRefreshCycleDurationGOOGLE structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRefreshCycleDurationGOOGLE-pDisplayTimingProperties-parameter)~^~implicit -VALIDATION_ERROR_2fe2f001~^~Y~^~Unknown~^~vkGetRefreshCycleDurationGOOGLE~^~VUID-vkGetRefreshCycleDurationGOOGLE-swapchain-parameter~^~core~^~The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRefreshCycleDurationGOOGLE-swapchain-parameter)~^~implicit +VALIDATION_ERROR_2fc06601~^~Y~^~Unknown~^~vkGetRandROutputDisplayEXT~^~VUID-vkGetRandROutputDisplayEXT-dpy-parameter~^~(VK_KHR_surface)+(VK_KHR_display)+(VK_EXT_direct_mode_display)+(VK_EXT_acquire_xlib_display)~^~The spec valid usage text states 'dpy must be a valid pointer to a Display value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetRandROutputDisplayEXT-dpy-parameter)~^~implicit +VALIDATION_ERROR_2fc14801~^~Y~^~Unknown~^~vkGetRandROutputDisplayEXT~^~VUID-vkGetRandROutputDisplayEXT-pDisplay-parameter~^~(VK_KHR_surface)+(VK_KHR_display)+(VK_EXT_direct_mode_display)+(VK_EXT_acquire_xlib_display)~^~The spec valid usage text states 'pDisplay must be a valid pointer to a VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetRandROutputDisplayEXT-pDisplay-parameter)~^~implicit +VALIDATION_ERROR_2fc27a01~^~Y~^~Unknown~^~vkGetRandROutputDisplayEXT~^~VUID-vkGetRandROutputDisplayEXT-physicalDevice-parameter~^~(VK_KHR_surface)+(VK_KHR_display)+(VK_EXT_direct_mode_display)+(VK_EXT_acquire_xlib_display)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetRandROutputDisplayEXT-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_2fe00009~^~Y~^~None~^~vkGetRefreshCycleDurationGOOGLE~^~VUID-vkGetRefreshCycleDurationGOOGLE-commonparent~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_GOOGLE_display_timing)~^~The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetRefreshCycleDurationGOOGLE-commonparent)~^~implicit +VALIDATION_ERROR_2fe05601~^~Y~^~Unknown~^~vkGetRefreshCycleDurationGOOGLE~^~VUID-vkGetRefreshCycleDurationGOOGLE-device-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_GOOGLE_display_timing)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetRefreshCycleDurationGOOGLE-device-parameter)~^~implicit +VALIDATION_ERROR_2fe15001~^~Y~^~Unknown~^~vkGetRefreshCycleDurationGOOGLE~^~VUID-vkGetRefreshCycleDurationGOOGLE-pDisplayTimingProperties-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_GOOGLE_display_timing)~^~The spec valid usage text states 'pDisplayTimingProperties must be a valid pointer to a VkRefreshCycleDurationGOOGLE structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetRefreshCycleDurationGOOGLE-pDisplayTimingProperties-parameter)~^~implicit +VALIDATION_ERROR_2fe2f001~^~Y~^~Unknown~^~vkGetRefreshCycleDurationGOOGLE~^~VUID-vkGetRefreshCycleDurationGOOGLE-swapchain-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_GOOGLE_display_timing)~^~The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetRefreshCycleDurationGOOGLE-swapchain-parameter)~^~implicit VALIDATION_ERROR_30005601~^~Y~^~None~^~vkGetRenderAreaGranularity~^~VUID-vkGetRenderAreaGranularity-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRenderAreaGranularity-device-parameter)~^~implicit VALIDATION_ERROR_30017a01~^~Y~^~Unknown~^~vkGetRenderAreaGranularity~^~VUID-vkGetRenderAreaGranularity-pGranularity-parameter~^~core~^~The spec valid usage text states 'pGranularity must be a valid pointer to a VkExtent2D structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRenderAreaGranularity-pGranularity-parameter)~^~implicit VALIDATION_ERROR_3002ae01~^~Y~^~None~^~vkGetRenderAreaGranularity~^~VUID-vkGetRenderAreaGranularity-renderPass-parameter~^~core~^~The spec valid usage text states 'renderPass must be a valid VkRenderPass handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRenderAreaGranularity-renderPass-parameter)~^~implicit VALIDATION_ERROR_3002ae07~^~Y~^~Unknown~^~vkGetRenderAreaGranularity~^~VUID-vkGetRenderAreaGranularity-renderPass-parent~^~core~^~The spec valid usage text states 'renderPass must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRenderAreaGranularity-renderPass-parent)~^~implicit -VALIDATION_ERROR_302008d8~^~N~^~Unknown~^~vkGetSemaphoreFdKHR~^~VUID-vkGetSemaphoreFdKHR-handleType-01132~^~core~^~The spec valid usage text states 'handleType must have been included in VkExportSemaphoreCreateInfoKHR::handleTypes when semaphore's current payload was created.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-handleType-01132)~^~ -VALIDATION_ERROR_302008da~^~N~^~Unknown~^~vkGetSemaphoreFdKHR~^~VUID-vkGetSemaphoreFdKHR-semaphore-01133~^~core~^~The spec valid usage text states 'semaphore must not currently have its payload replaced by an imported payload as described below in Importing Semaphore Payloads unless that imported payload's handle type was included in VkExternalSemaphorePropertiesKHR::exportFromImportedHandleTypes for handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-semaphore-01133)~^~ -VALIDATION_ERROR_302008dc~^~N~^~Unknown~^~vkGetSemaphoreFdKHR~^~VUID-vkGetSemaphoreFdKHR-handleType-01134~^~core~^~The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, as defined below in Importing Semaphore Payloads, there must be no queue waiting on semaphore.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-handleType-01134)~^~ -VALIDATION_ERROR_302008de~^~N~^~Unknown~^~vkGetSemaphoreFdKHR~^~VUID-vkGetSemaphoreFdKHR-handleType-01135~^~core~^~The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, semaphore must be signaled, or have an associated semaphore signal operation pending execution.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-handleType-01135)~^~ -VALIDATION_ERROR_302008e0~^~N~^~Unknown~^~vkGetSemaphoreFdKHR~^~VUID-vkGetSemaphoreFdKHR-handleType-01136~^~core~^~The spec valid usage text states 'handleType must be defined as a POSIX file descriptor handle.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-handleType-01136)~^~ -VALIDATION_ERROR_30205601~^~Y~^~Unknown~^~vkGetSemaphoreFdKHR~^~VUID-vkGetSemaphoreFdKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-device-parameter)~^~implicit -VALIDATION_ERROR_30209c01~^~N~^~Unknown~^~vkGetSemaphoreFdKHR~^~VUID-vkGetSemaphoreFdKHR-handleType-parameter~^~core~^~The spec valid usage text states 'handleType must be a valid VkExternalSemaphoreHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-handleType-parameter)~^~implicit -VALIDATION_ERROR_30216c01~^~Y~^~Unknown~^~vkGetSemaphoreFdKHR~^~VUID-vkGetSemaphoreFdKHR-pFd-parameter~^~core~^~The spec valid usage text states 'pFd must be a valid pointer to a int value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-pFd-parameter)~^~implicit -VALIDATION_ERROR_3022b801~^~N~^~Unknown~^~vkGetSemaphoreFdKHR~^~VUID-vkGetSemaphoreFdKHR-semaphore-parameter~^~core~^~The spec valid usage text states 'semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-semaphore-parameter)~^~implicit -VALIDATION_ERROR_3022b807~^~N~^~Unknown~^~vkGetSemaphoreFdKHR~^~VUID-vkGetSemaphoreFdKHR-semaphore-parent~^~core~^~The spec valid usage text states 'semaphore must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-semaphore-parent)~^~implicit -VALIDATION_ERROR_30239e01~^~N~^~None~^~vkGetSemaphoreFdKHR~^~VUID-vkGetSemaphoreFdKHR-pGetFdInfo-parameter~^~core~^~The spec valid usage text states 'pGetFdInfo must be a valid pointer to a valid VkSemaphoreGetFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-pGetFdInfo-parameter)~^~implicit -VALIDATION_ERROR_304008cc~^~N~^~Unknown~^~vkGetSemaphoreWin32HandleKHR~^~VUID-vkGetSemaphoreWin32HandleKHR-handleType-01126~^~core~^~The spec valid usage text states 'handleType must have been included in VkExportSemaphoreCreateInfoKHR::handleTypes when the semaphore's current payload was created.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-handleType-01126)~^~ -VALIDATION_ERROR_304008ce~^~N~^~Unknown~^~vkGetSemaphoreWin32HandleKHR~^~VUID-vkGetSemaphoreWin32HandleKHR-handleType-01127~^~core~^~The spec valid usage text states 'If handleType is defined as an NT handle, vkGetSemaphoreWin32HandleKHR must be called no more than once for each valid unique combination of semaphore and handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-handleType-01127)~^~ -VALIDATION_ERROR_304008d0~^~N~^~Unknown~^~vkGetSemaphoreWin32HandleKHR~^~VUID-vkGetSemaphoreWin32HandleKHR-semaphore-01128~^~core~^~The spec valid usage text states 'semaphore must not currently have its payload replaced by an imported payload as described below in Importing Semaphore Payloads unless that imported payload's handle type was included in VkExternalSemaphorePropertiesKHR::exportFromImportedHandleTypes for handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-semaphore-01128)~^~ -VALIDATION_ERROR_304008d2~^~N~^~Unknown~^~vkGetSemaphoreWin32HandleKHR~^~VUID-vkGetSemaphoreWin32HandleKHR-handleType-01129~^~core~^~The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, as defined below in Importing Semaphore Payloads, there must be no queue waiting on semaphore.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-handleType-01129)~^~ -VALIDATION_ERROR_304008d4~^~N~^~Unknown~^~vkGetSemaphoreWin32HandleKHR~^~VUID-vkGetSemaphoreWin32HandleKHR-handleType-01130~^~core~^~The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, semaphore must be signaled, or have an associated semaphore signal operation pending execution.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-handleType-01130)~^~ -VALIDATION_ERROR_304008d6~^~N~^~Unknown~^~vkGetSemaphoreWin32HandleKHR~^~VUID-vkGetSemaphoreWin32HandleKHR-handleType-01131~^~core~^~The spec valid usage text states 'handleType must be defined as an NT handle or a global share handle.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-handleType-01131)~^~ -VALIDATION_ERROR_30405601~^~Y~^~Unknown~^~vkGetSemaphoreWin32HandleKHR~^~VUID-vkGetSemaphoreWin32HandleKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-device-parameter)~^~implicit -VALIDATION_ERROR_30409c01~^~N~^~Unknown~^~vkGetSemaphoreWin32HandleKHR~^~VUID-vkGetSemaphoreWin32HandleKHR-handleType-parameter~^~core~^~The spec valid usage text states 'handleType must be a valid VkExternalSemaphoreHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-handleType-parameter)~^~implicit -VALIDATION_ERROR_30417c01~^~Y~^~Unknown~^~vkGetSemaphoreWin32HandleKHR~^~VUID-vkGetSemaphoreWin32HandleKHR-pHandle-parameter~^~core~^~The spec valid usage text states 'pHandle must be a valid pointer to a HANDLE value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-pHandle-parameter)~^~implicit -VALIDATION_ERROR_3042b801~^~N~^~Unknown~^~vkGetSemaphoreWin32HandleKHR~^~VUID-vkGetSemaphoreWin32HandleKHR-semaphore-parameter~^~core~^~The spec valid usage text states 'semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-semaphore-parameter)~^~implicit -VALIDATION_ERROR_3042b807~^~N~^~Unknown~^~vkGetSemaphoreWin32HandleKHR~^~VUID-vkGetSemaphoreWin32HandleKHR-semaphore-parent~^~core~^~The spec valid usage text states 'semaphore must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-semaphore-parent)~^~implicit -VALIDATION_ERROR_3043a001~^~N~^~None~^~vkGetSemaphoreWin32HandleKHR~^~VUID-vkGetSemaphoreWin32HandleKHR-pGetWin32HandleInfo-parameter~^~core~^~The spec valid usage text states 'pGetWin32HandleInfo must be a valid pointer to a valid VkSemaphoreGetWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-pGetWin32HandleInfo-parameter)~^~implicit -VALIDATION_ERROR_30600009~^~Y~^~None~^~vkGetSwapchainCounterEXT~^~VUID-vkGetSwapchainCounterEXT-commonparent~^~core~^~The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-commonparent)~^~implicit -VALIDATION_ERROR_306009ba~^~N~^~Unknown~^~vkGetSwapchainCounterEXT~^~VUID-vkGetSwapchainCounterEXT-swapchain-01245~^~core~^~The spec valid usage text states 'One or more present commands on swapchain must have been processed by the presentation engine.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-swapchain-01245)~^~ -VALIDATION_ERROR_30603601~^~Y~^~Unknown~^~vkGetSwapchainCounterEXT~^~VUID-vkGetSwapchainCounterEXT-counter-parameter~^~core~^~The spec valid usage text states 'counter must be a valid VkSurfaceCounterFlagBitsEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-counter-parameter)~^~implicit -VALIDATION_ERROR_30605601~^~Y~^~Unknown~^~vkGetSwapchainCounterEXT~^~VUID-vkGetSwapchainCounterEXT-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-device-parameter)~^~implicit -VALIDATION_ERROR_30611c01~^~Y~^~Unknown~^~vkGetSwapchainCounterEXT~^~VUID-vkGetSwapchainCounterEXT-pCounterValue-parameter~^~core~^~The spec valid usage text states 'pCounterValue must be a valid pointer to a uint64_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-pCounterValue-parameter)~^~implicit -VALIDATION_ERROR_3062f001~^~Y~^~Unknown~^~vkGetSwapchainCounterEXT~^~VUID-vkGetSwapchainCounterEXT-swapchain-parameter~^~core~^~The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-swapchain-parameter)~^~implicit -VALIDATION_ERROR_30800009~^~N~^~None~^~vkGetSwapchainImagesKHR~^~VUID-vkGetSwapchainImagesKHR-commonparent~^~core~^~The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-commonparent)~^~implicit -VALIDATION_ERROR_30805601~^~Y~^~None~^~vkGetSwapchainImagesKHR~^~VUID-vkGetSwapchainImagesKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-device-parameter)~^~implicit -VALIDATION_ERROR_30825401~^~N~^~Unknown~^~vkGetSwapchainImagesKHR~^~VUID-vkGetSwapchainImagesKHR-pSwapchainImageCount-parameter~^~core~^~The spec valid usage text states 'pSwapchainImageCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-pSwapchainImageCount-parameter)~^~implicit -VALIDATION_ERROR_30825601~^~Y~^~Unknown~^~vkGetSwapchainImagesKHR~^~VUID-vkGetSwapchainImagesKHR-pSwapchainImages-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pSwapchainImageCount is not 0, and pSwapchainImages is not NULL, pSwapchainImages must be a valid pointer to an array of pSwapchainImageCount VkImage handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-pSwapchainImages-parameter)~^~implicit -VALIDATION_ERROR_3082f001~^~Y~^~Unknown~^~vkGetSwapchainImagesKHR~^~VUID-vkGetSwapchainImagesKHR-swapchain-parameter~^~core~^~The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-swapchain-parameter)~^~implicit -VALIDATION_ERROR_30a00009~^~Y~^~None~^~vkGetSwapchainStatusKHR~^~VUID-vkGetSwapchainStatusKHR-commonparent~^~core~^~The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainStatusKHR-commonparent)~^~implicit -VALIDATION_ERROR_30a05601~^~Y~^~Unknown~^~vkGetSwapchainStatusKHR~^~VUID-vkGetSwapchainStatusKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainStatusKHR-device-parameter)~^~implicit -VALIDATION_ERROR_30a2f001~^~Y~^~Unknown~^~vkGetSwapchainStatusKHR~^~VUID-vkGetSwapchainStatusKHR-swapchain-parameter~^~core~^~The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainStatusKHR-swapchain-parameter)~^~implicit -VALIDATION_ERROR_30c008ec~^~N~^~Unknown~^~vkImportSemaphoreFdKHR~^~VUID-vkImportSemaphoreFdKHR-semaphore-01142~^~core~^~The spec valid usage text states 'semaphore must not be associated with any queue command that has not yet completed execution on that queue' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportSemaphoreFdKHR-semaphore-01142)~^~ -VALIDATION_ERROR_30c05601~^~Y~^~Unknown~^~vkImportSemaphoreFdKHR~^~VUID-vkImportSemaphoreFdKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportSemaphoreFdKHR-device-parameter)~^~implicit -VALIDATION_ERROR_30c18e01~^~N~^~Unknown~^~vkImportSemaphoreFdKHR~^~VUID-vkImportSemaphoreFdKHR-pImportSemaphoreFdInfo-parameter~^~core~^~The spec valid usage text states 'pImportSemaphoreFdInfo must be a valid pointer to a valid VkImportSemaphoreFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportSemaphoreFdKHR-pImportSemaphoreFdInfo-parameter)~^~implicit -VALIDATION_ERROR_30e05601~^~Y~^~Unknown~^~vkImportSemaphoreWin32HandleKHR~^~VUID-vkImportSemaphoreWin32HandleKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportSemaphoreWin32HandleKHR-device-parameter)~^~implicit -VALIDATION_ERROR_30e19001~^~N~^~Unknown~^~vkImportSemaphoreWin32HandleKHR~^~VUID-vkImportSemaphoreWin32HandleKHR-pImportSemaphoreWin32HandleInfo-parameter~^~core~^~The spec valid usage text states 'pImportSemaphoreWin32HandleInfo must be a valid pointer to a valid VkImportSemaphoreWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportSemaphoreWin32HandleKHR-pImportSemaphoreWin32HandleInfo-parameter)~^~implicit +VALIDATION_ERROR_30205601~^~Y~^~Unknown~^~vkGetSemaphoreFdKHR~^~VUID-vkGetSemaphoreFdKHR-device-parameter~^~(VK_KHR_external_semaphore_fd)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-device-parameter)~^~implicit +VALIDATION_ERROR_30216c01~^~Y~^~Unknown~^~vkGetSemaphoreFdKHR~^~VUID-vkGetSemaphoreFdKHR-pFd-parameter~^~(VK_KHR_external_semaphore_fd)~^~The spec valid usage text states 'pFd must be a valid pointer to a int value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-pFd-parameter)~^~implicit +VALIDATION_ERROR_30239e01~^~N~^~None~^~vkGetSemaphoreFdKHR~^~VUID-vkGetSemaphoreFdKHR-pGetFdInfo-parameter~^~(VK_KHR_external_semaphore_fd)~^~The spec valid usage text states 'pGetFdInfo must be a valid pointer to a valid VkSemaphoreGetFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-pGetFdInfo-parameter)~^~implicit +VALIDATION_ERROR_30405601~^~Y~^~Unknown~^~vkGetSemaphoreWin32HandleKHR~^~VUID-vkGetSemaphoreWin32HandleKHR-device-parameter~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-device-parameter)~^~implicit +VALIDATION_ERROR_30417c01~^~Y~^~Unknown~^~vkGetSemaphoreWin32HandleKHR~^~VUID-vkGetSemaphoreWin32HandleKHR-pHandle-parameter~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'pHandle must be a valid pointer to a HANDLE value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-pHandle-parameter)~^~implicit +VALIDATION_ERROR_3043a001~^~N~^~None~^~vkGetSemaphoreWin32HandleKHR~^~VUID-vkGetSemaphoreWin32HandleKHR-pGetWin32HandleInfo-parameter~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'pGetWin32HandleInfo must be a valid pointer to a valid VkSemaphoreGetWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-pGetWin32HandleInfo-parameter)~^~implicit +VALIDATION_ERROR_30600009~^~Y~^~None~^~vkGetSwapchainCounterEXT~^~VUID-vkGetSwapchainCounterEXT-commonparent~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_EXT_display_control)~^~The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-commonparent)~^~implicit +VALIDATION_ERROR_306009ba~^~N~^~Unknown~^~vkGetSwapchainCounterEXT~^~VUID-vkGetSwapchainCounterEXT-swapchain-01245~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_EXT_display_control)~^~The spec valid usage text states 'One or more present commands on swapchain must have been processed by the presentation engine.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-swapchain-01245)~^~ +VALIDATION_ERROR_30603601~^~Y~^~Unknown~^~vkGetSwapchainCounterEXT~^~VUID-vkGetSwapchainCounterEXT-counter-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_EXT_display_control)~^~The spec valid usage text states 'counter must be a valid VkSurfaceCounterFlagBitsEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-counter-parameter)~^~implicit +VALIDATION_ERROR_30605601~^~Y~^~Unknown~^~vkGetSwapchainCounterEXT~^~VUID-vkGetSwapchainCounterEXT-device-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_EXT_display_control)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-device-parameter)~^~implicit +VALIDATION_ERROR_30611c01~^~Y~^~Unknown~^~vkGetSwapchainCounterEXT~^~VUID-vkGetSwapchainCounterEXT-pCounterValue-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_EXT_display_control)~^~The spec valid usage text states 'pCounterValue must be a valid pointer to a uint64_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-pCounterValue-parameter)~^~implicit +VALIDATION_ERROR_3062f001~^~Y~^~Unknown~^~vkGetSwapchainCounterEXT~^~VUID-vkGetSwapchainCounterEXT-swapchain-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_EXT_display_control)~^~The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-swapchain-parameter)~^~implicit +VALIDATION_ERROR_30800009~^~N~^~None~^~vkGetSwapchainImagesKHR~^~VUID-vkGetSwapchainImagesKHR-commonparent~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-commonparent)~^~implicit +VALIDATION_ERROR_30805601~^~Y~^~None~^~vkGetSwapchainImagesKHR~^~VUID-vkGetSwapchainImagesKHR-device-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-device-parameter)~^~implicit +VALIDATION_ERROR_30825401~^~N~^~Unknown~^~vkGetSwapchainImagesKHR~^~VUID-vkGetSwapchainImagesKHR-pSwapchainImageCount-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'pSwapchainImageCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-pSwapchainImageCount-parameter)~^~implicit +VALIDATION_ERROR_30825601~^~Y~^~Unknown~^~vkGetSwapchainImagesKHR~^~VUID-vkGetSwapchainImagesKHR-pSwapchainImages-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'If the value referenced by pSwapchainImageCount is not 0, and pSwapchainImages is not NULL, pSwapchainImages must be a valid pointer to an array of pSwapchainImageCount VkImage handles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-pSwapchainImages-parameter)~^~implicit +VALIDATION_ERROR_3082f001~^~Y~^~Unknown~^~vkGetSwapchainImagesKHR~^~VUID-vkGetSwapchainImagesKHR-swapchain-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-swapchain-parameter)~^~implicit +VALIDATION_ERROR_30a00009~^~Y~^~None~^~vkGetSwapchainStatusKHR~^~VUID-vkGetSwapchainStatusKHR-commonparent~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainStatusKHR-commonparent)~^~implicit +VALIDATION_ERROR_30a05601~^~Y~^~Unknown~^~vkGetSwapchainStatusKHR~^~VUID-vkGetSwapchainStatusKHR-device-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainStatusKHR-device-parameter)~^~implicit +VALIDATION_ERROR_30a2f001~^~Y~^~Unknown~^~vkGetSwapchainStatusKHR~^~VUID-vkGetSwapchainStatusKHR-swapchain-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainStatusKHR-swapchain-parameter)~^~implicit +VALIDATION_ERROR_30c008ec~^~N~^~Unknown~^~vkImportSemaphoreFdKHR~^~VUID-vkImportSemaphoreFdKHR-semaphore-01142~^~(VK_KHR_external_semaphore_fd)~^~The spec valid usage text states 'semaphore must not be associated with any queue command that has not yet completed execution on that queue' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportSemaphoreFdKHR-semaphore-01142)~^~ +VALIDATION_ERROR_30c05601~^~Y~^~Unknown~^~vkImportSemaphoreFdKHR~^~VUID-vkImportSemaphoreFdKHR-device-parameter~^~(VK_KHR_external_semaphore_fd)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportSemaphoreFdKHR-device-parameter)~^~implicit +VALIDATION_ERROR_30c18e01~^~N~^~Unknown~^~vkImportSemaphoreFdKHR~^~VUID-vkImportSemaphoreFdKHR-pImportSemaphoreFdInfo-parameter~^~(VK_KHR_external_semaphore_fd)~^~The spec valid usage text states 'pImportSemaphoreFdInfo must be a valid pointer to a valid VkImportSemaphoreFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportSemaphoreFdKHR-pImportSemaphoreFdInfo-parameter)~^~implicit +VALIDATION_ERROR_30e05601~^~Y~^~Unknown~^~vkImportSemaphoreWin32HandleKHR~^~VUID-vkImportSemaphoreWin32HandleKHR-device-parameter~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportSemaphoreWin32HandleKHR-device-parameter)~^~implicit +VALIDATION_ERROR_30e19001~^~N~^~Unknown~^~vkImportSemaphoreWin32HandleKHR~^~VUID-vkImportSemaphoreWin32HandleKHR-pImportSemaphoreWin32HandleInfo-parameter~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'pImportSemaphoreWin32HandleInfo must be a valid pointer to a valid VkImportSemaphoreWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportSemaphoreWin32HandleKHR-pImportSemaphoreWin32HandleInfo-parameter)~^~implicit VALIDATION_ERROR_31005601~^~Y~^~None~^~vkInvalidateMappedMemoryRanges~^~VUID-vkInvalidateMappedMemoryRanges-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkInvalidateMappedMemoryRanges-device-parameter)~^~implicit VALIDATION_ERROR_3100c81b~^~N~^~Unknown~^~vkInvalidateMappedMemoryRanges~^~VUID-vkInvalidateMappedMemoryRanges-memoryRangeCount-arraylength~^~core~^~The spec valid usage text states 'memoryRangeCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkInvalidateMappedMemoryRanges-memoryRangeCount-arraylength)~^~implicit VALIDATION_ERROR_3101b201~^~Y~^~Unknown~^~vkInvalidateMappedMemoryRanges~^~VUID-vkInvalidateMappedMemoryRanges-pMemoryRanges-parameter~^~core~^~The spec valid usage text states 'pMemoryRanges must be a valid pointer to an array of memoryRangeCount valid VkMappedMemoryRange structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkInvalidateMappedMemoryRanges-pMemoryRanges-parameter)~^~implicit @@ -3275,7 +3305,7 @@ VALIDATION_ERROR_31200550~^~N~^~Unknown~^~vkMapMemory~^~VUID-vkMapMemory-size-00680~^~core~^~The spec valid usage text states 'If size is not equal to VK_WHOLE_SIZE, size must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMapMemory-size-00680)~^~ VALIDATION_ERROR_31200552~^~Y~^~Unknown~^~vkMapMemory~^~VUID-vkMapMemory-size-00681~^~core~^~The spec valid usage text states 'If size is not equal to VK_WHOLE_SIZE, size must be less than or equal to the size of the memory minus offset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMapMemory-size-00681)~^~ VALIDATION_ERROR_31200554~^~Y~^~Unknown~^~vkMapMemory~^~VUID-vkMapMemory-memory-00682~^~core~^~The spec valid usage text states 'memory must have been created with a memory type that reports VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMapMemory-memory-00682)~^~ -VALIDATION_ERROR_31200556~^~N~^~Unknown~^~vkMapMemory~^~VUID-vkMapMemory-memory-00683~^~(VK_KHX_device_group)~^~The spec valid usage text states 'memory must not have been allocated with multiple instances.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkMapMemory-memory-00683)~^~ +VALIDATION_ERROR_31200556~^~N~^~Unknown~^~vkMapMemory~^~VUID-vkMapMemory-memory-00683~^~(VK_KHR_device_group)~^~The spec valid usage text states 'memory must not have been allocated with multiple instances.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkMapMemory-memory-00683)~^~ VALIDATION_ERROR_31205601~^~Y~^~None~^~vkMapMemory~^~VUID-vkMapMemory-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMapMemory-device-parameter)~^~implicit VALIDATION_ERROR_31209005~^~Y~^~Unknown~^~vkMapMemory~^~VUID-vkMapMemory-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMapMemory-flags-zerobitmask)~^~implicit, TBD in parameter validation layer. VALIDATION_ERROR_3120c601~^~Y~^~None~^~vkMapMemory~^~VUID-vkMapMemory-memory-parameter~^~core~^~The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMapMemory-memory-parameter)~^~implicit @@ -3298,12 +3328,12 @@ VALIDATION_ERROR_31608801~^~Y~^~Unknown~^~vkQueueBindSparse~^~VUID-vkQueueBindSparse-fence-parameter~^~core~^~The spec valid usage text states 'If fence is not VK_NULL_HANDLE, fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueBindSparse-fence-parameter)~^~implicit VALIDATION_ERROR_3160f801~^~Y~^~Unknown~^~vkQueueBindSparse~^~VUID-vkQueueBindSparse-pBindInfo-parameter~^~core~^~The spec valid usage text states 'If bindInfoCount is not 0, pBindInfo must be a valid pointer to an array of bindInfoCount valid VkBindSparseInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueBindSparse-pBindInfo-parameter)~^~implicit VALIDATION_ERROR_31629c01~^~Y~^~Unknown~^~vkQueueBindSparse~^~VUID-vkQueueBindSparse-queue-parameter~^~core~^~The spec valid usage text states 'queue must be a valid VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueBindSparse-queue-parameter)~^~implicit -VALIDATION_ERROR_31800a18~^~Y~^~Unknown~^~vkQueuePresentKHR~^~VUID-vkQueuePresentKHR-pSwapchains-01292~^~core~^~The spec valid usage text states 'Each element of pSwapchains member of pPresentInfo must be a swapchain that is created for a surface for which presentation is supported from queue as determined using a call to vkGetPhysicalDeviceSurfaceSupportKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueuePresentKHR-pSwapchains-01292)~^~ -VALIDATION_ERROR_31800a1a~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-vkQueuePresentKHR-pSwapchains-01293~^~(VK_KHR_display_swapchain)~^~The spec valid usage text states 'If more than one member of pSwapchains was created from a display surface, all display surfaces referenced that refer to the same display must use the same display mode' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueuePresentKHR-pSwapchains-01293)~^~ -VALIDATION_ERROR_31800a1c~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-vkQueuePresentKHR-pWaitSemaphores-01294~^~core~^~The spec valid usage text states 'When a semaphore unsignal operation defined by the elements of the pWaitSemaphores member of pPresentInfo executes on queue, no other queue must be waiting on the same semaphore.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueuePresentKHR-pWaitSemaphores-01294)~^~ -VALIDATION_ERROR_31800a1e~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-vkQueuePresentKHR-pWaitSemaphores-01295~^~core~^~The spec valid usage text states 'All elements of the pWaitSemaphores member of pPresentInfo must be semaphores that are signaled, or have semaphore signal operations previously submitted for execution.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueuePresentKHR-pWaitSemaphores-01295)~^~ -VALIDATION_ERROR_3181e601~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-vkQueuePresentKHR-pPresentInfo-parameter~^~core~^~The spec valid usage text states 'pPresentInfo must be a valid pointer to a valid VkPresentInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueuePresentKHR-pPresentInfo-parameter)~^~implicit -VALIDATION_ERROR_31829c01~^~Y~^~None~^~vkQueuePresentKHR~^~VUID-vkQueuePresentKHR-queue-parameter~^~core~^~The spec valid usage text states 'queue must be a valid VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueuePresentKHR-queue-parameter)~^~implicit +VALIDATION_ERROR_31800a18~^~Y~^~Unknown~^~vkQueuePresentKHR~^~VUID-vkQueuePresentKHR-pSwapchains-01292~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'Each element of pSwapchains member of pPresentInfo must be a swapchain that is created for a surface for which presentation is supported from queue as determined using a call to vkGetPhysicalDeviceSurfaceSupportKHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueuePresentKHR-pSwapchains-01292)~^~ +VALIDATION_ERROR_31800a1a~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-vkQueuePresentKHR-pSwapchains-01293~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_display_swapchain)~^~The spec valid usage text states 'If more than one member of pSwapchains was created from a display surface, all display surfaces referenced that refer to the same display must use the same display mode' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueuePresentKHR-pSwapchains-01293)~^~ +VALIDATION_ERROR_31800a1c~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-vkQueuePresentKHR-pWaitSemaphores-01294~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'When a semaphore unsignal operation defined by the elements of the pWaitSemaphores member of pPresentInfo executes on queue, no other queue must be waiting on the same semaphore.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueuePresentKHR-pWaitSemaphores-01294)~^~ +VALIDATION_ERROR_31800a1e~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-vkQueuePresentKHR-pWaitSemaphores-01295~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'All elements of the pWaitSemaphores member of pPresentInfo must be semaphores that are signaled, or have semaphore signal operations previously submitted for execution.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueuePresentKHR-pWaitSemaphores-01295)~^~ +VALIDATION_ERROR_3181e601~^~N~^~Unknown~^~vkQueuePresentKHR~^~VUID-vkQueuePresentKHR-pPresentInfo-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'pPresentInfo must be a valid pointer to a valid VkPresentInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueuePresentKHR-pPresentInfo-parameter)~^~implicit +VALIDATION_ERROR_31829c01~^~Y~^~None~^~vkQueuePresentKHR~^~VUID-vkQueuePresentKHR-queue-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)~^~The spec valid usage text states 'queue must be a valid VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueuePresentKHR-queue-parameter)~^~implicit VALIDATION_ERROR_31a00009~^~Y~^~Unknown~^~vkQueueSubmit~^~VUID-vkQueueSubmit-commonparent~^~core~^~The spec valid usage text states 'Both of fence, and queue that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueSubmit-commonparent)~^~implicit VALIDATION_ERROR_31a0007e~^~N~^~Unknown~^~vkQueueSubmit~^~VUID-vkQueueSubmit-fence-00063~^~core~^~The spec valid usage text states 'If fence is not VK_NULL_HANDLE, fence must be unsignaled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueSubmit-fence-00063)~^~ VALIDATION_ERROR_31a00080~^~N~^~Unknown~^~vkQueueSubmit~^~VUID-vkQueueSubmit-fence-00064~^~core~^~The spec valid usage text states 'If fence is not VK_NULL_HANDLE, fence must not be associated with any other queue command that has not yet completed execution on that queue' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueSubmit-fence-00064)~^~ @@ -3316,31 +3346,31 @@ VALIDATION_ERROR_31a0008e~^~Y~^~Unknown~^~vkQueueSubmit~^~VUID-vkQueueSubmit-pCommandBuffers-00071~^~core~^~The spec valid usage text states 'If any element of the pCommandBuffers member of any element of pSubmits was not recorded with the VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT, it must not be in the pending state.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueSubmit-pCommandBuffers-00071)~^~ VALIDATION_ERROR_31a00090~^~Y~^~ExecuteUnrecordedSecondaryCB~^~vkQueueSubmit~^~VUID-vkQueueSubmit-pCommandBuffers-00072~^~core~^~The spec valid usage text states 'Any secondary command buffers recorded into any element of the pCommandBuffers member of any element of pSubmits must be in the pending or executable state.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueSubmit-pCommandBuffers-00072)~^~ VALIDATION_ERROR_31a00092~^~Y~^~Unknown~^~vkQueueSubmit~^~VUID-vkQueueSubmit-pCommandBuffers-00073~^~core~^~The spec valid usage text states 'If any secondary command buffers recorded into any element of the pCommandBuffers member of any element of pSubmits was not recorded with the VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT, it must not be in the pending state.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueSubmit-pCommandBuffers-00073)~^~ -VALIDATION_ERROR_31a00094~^~Y~^~Unknown~^~vkQueueSubmit~^~VUID-vkQueueSubmit-pCommandBuffers-00074~^~core~^~The spec valid usage text states 'Each element of the pCommandBuffers member of each element of pSubmits must have been allocated from a VkCommandPool that was created for the same queue family queue belongs to.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueSubmit-pCommandBuffers-00074)~^~ +VALIDATION_ERROR_31a00094~^~Y~^~MismatchedQueueFamiliesOnSubmit~^~vkQueueSubmit~^~VUID-vkQueueSubmit-pCommandBuffers-00074~^~core~^~The spec valid usage text states 'Each element of the pCommandBuffers member of each element of pSubmits must have been allocated from a VkCommandPool that was created for the same queue family queue belongs to.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueSubmit-pCommandBuffers-00074)~^~ VALIDATION_ERROR_31a08801~^~Y~^~None~^~vkQueueSubmit~^~VUID-vkQueueSubmit-fence-parameter~^~core~^~The spec valid usage text states 'If fence is not VK_NULL_HANDLE, fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueSubmit-fence-parameter)~^~implicit VALIDATION_ERROR_31a24001~^~Y~^~Unknown~^~vkQueueSubmit~^~VUID-vkQueueSubmit-pSubmits-parameter~^~core~^~The spec valid usage text states 'If submitCount is not 0, pSubmits must be a valid pointer to an array of submitCount valid VkSubmitInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueSubmit-pSubmits-parameter)~^~implicit VALIDATION_ERROR_31a29c01~^~Y~^~None~^~vkQueueSubmit~^~VUID-vkQueueSubmit-queue-parameter~^~core~^~The spec valid usage text states 'queue must be a valid VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueSubmit-queue-parameter)~^~implicit VALIDATION_ERROR_31c29c01~^~Y~^~None~^~vkQueueWaitIdle~^~VUID-vkQueueWaitIdle-queue-parameter~^~core~^~The spec valid usage text states 'queue must be a valid VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueWaitIdle-queue-parameter)~^~implicit -VALIDATION_ERROR_31e05601~^~Y~^~Unknown~^~vkRegisterDeviceEventEXT~^~VUID-vkRegisterDeviceEventEXT-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterDeviceEventEXT-device-parameter)~^~implicit -VALIDATION_ERROR_31e0ec01~^~N~^~Unknown~^~vkRegisterDeviceEventEXT~^~VUID-vkRegisterDeviceEventEXT-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterDeviceEventEXT-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_31e13a01~^~N~^~Unknown~^~vkRegisterDeviceEventEXT~^~VUID-vkRegisterDeviceEventEXT-pDeviceEventInfo-parameter~^~core~^~The spec valid usage text states 'pDeviceEventInfo must be a valid pointer to a valid VkDeviceEventInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterDeviceEventEXT-pDeviceEventInfo-parameter)~^~implicit -VALIDATION_ERROR_31e17001~^~Y~^~Unknown~^~vkRegisterDeviceEventEXT~^~VUID-vkRegisterDeviceEventEXT-pFence-parameter~^~core~^~The spec valid usage text states 'pFence must be a valid pointer to a VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterDeviceEventEXT-pFence-parameter)~^~implicit -VALIDATION_ERROR_32005601~^~Y~^~Unknown~^~vkRegisterDisplayEventEXT~^~VUID-vkRegisterDisplayEventEXT-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-device-parameter)~^~implicit -VALIDATION_ERROR_32006001~^~Y~^~Unknown~^~vkRegisterDisplayEventEXT~^~VUID-vkRegisterDisplayEventEXT-display-parameter~^~core~^~The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-display-parameter)~^~implicit -VALIDATION_ERROR_3200ec01~^~N~^~Unknown~^~vkRegisterDisplayEventEXT~^~VUID-vkRegisterDisplayEventEXT-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_32014c01~^~N~^~Unknown~^~vkRegisterDisplayEventEXT~^~VUID-vkRegisterDisplayEventEXT-pDisplayEventInfo-parameter~^~core~^~The spec valid usage text states 'pDisplayEventInfo must be a valid pointer to a valid VkDisplayEventInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-pDisplayEventInfo-parameter)~^~implicit -VALIDATION_ERROR_32017001~^~Y~^~Unknown~^~vkRegisterDisplayEventEXT~^~VUID-vkRegisterDisplayEventEXT-pFence-parameter~^~core~^~The spec valid usage text states 'pFence must be a valid pointer to a VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-pFence-parameter)~^~implicit -VALIDATION_ERROR_32200aa8~^~N~^~Unknown~^~vkRegisterObjectsNVX~^~VUID-vkRegisterObjectsNVX-pObjectTableEntry-01364~^~core~^~The spec valid usage text states 'The contents of pObjectTableEntry must yield plausible bindings supported by the device.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterObjectsNVX-pObjectTableEntry-01364)~^~ -VALIDATION_ERROR_32200aaa~^~N~^~Unknown~^~vkRegisterObjectsNVX~^~VUID-vkRegisterObjectsNVX-pObjectIndices-01365~^~core~^~The spec valid usage text states 'At any pObjectIndices there must not be a registered resource already.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterObjectsNVX-pObjectIndices-01365)~^~ -VALIDATION_ERROR_32200aac~^~N~^~Unknown~^~vkRegisterObjectsNVX~^~VUID-vkRegisterObjectsNVX-pObjectIndices-01366~^~core~^~The spec valid usage text states 'Any value inside pObjectIndices must be below the appropriate VkObjectTableCreateInfoNVX::pObjectEntryCounts limits provided at objectTable creation time.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterObjectsNVX-pObjectIndices-01366)~^~ -VALIDATION_ERROR_32205601~^~Y~^~Unknown~^~vkRegisterObjectsNVX~^~VUID-vkRegisterObjectsNVX-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterObjectsNVX-device-parameter)~^~implicit -VALIDATION_ERROR_3220d61b~^~Y~^~Unknown~^~vkRegisterObjectsNVX~^~VUID-vkRegisterObjectsNVX-objectCount-arraylength~^~core~^~The spec valid usage text states 'objectCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterObjectsNVX-objectCount-arraylength)~^~implicit -VALIDATION_ERROR_3220d801~^~Y~^~Unknown~^~vkRegisterObjectsNVX~^~VUID-vkRegisterObjectsNVX-objectTable-parameter~^~core~^~The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterObjectsNVX-objectTable-parameter)~^~implicit -VALIDATION_ERROR_3220d807~^~Y~^~Unknown~^~vkRegisterObjectsNVX~^~VUID-vkRegisterObjectsNVX-objectTable-parent~^~core~^~The spec valid usage text states 'objectTable must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterObjectsNVX-objectTable-parent)~^~implicit -VALIDATION_ERROR_3221cc01~^~Y~^~Unknown~^~vkRegisterObjectsNVX~^~VUID-vkRegisterObjectsNVX-pObjectIndices-parameter~^~core~^~The spec valid usage text states 'pObjectIndices must be a valid pointer to an array of objectCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterObjectsNVX-pObjectIndices-parameter)~^~implicit -VALIDATION_ERROR_32229201~^~Y~^~Unknown~^~vkRegisterObjectsNVX~^~VUID-vkRegisterObjectsNVX-ppObjectTableEntries-parameter~^~core~^~The spec valid usage text states 'ppObjectTableEntries must be a valid pointer to an array of objectCount valid VkObjectTableEntryNVX structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterObjectsNVX-ppObjectTableEntries-parameter)~^~implicit -VALIDATION_ERROR_32406001~^~Y~^~Unknown~^~vkReleaseDisplayEXT~^~VUID-vkReleaseDisplayEXT-display-parameter~^~core~^~The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkReleaseDisplayEXT-display-parameter)~^~implicit -VALIDATION_ERROR_32427a01~^~Y~^~Unknown~^~vkReleaseDisplayEXT~^~VUID-vkReleaseDisplayEXT-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkReleaseDisplayEXT-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_31e05601~^~Y~^~Unknown~^~vkRegisterDeviceEventEXT~^~VUID-vkRegisterDeviceEventEXT-device-parameter~^~(VK_EXT_display_control)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterDeviceEventEXT-device-parameter)~^~implicit +VALIDATION_ERROR_31e0ec01~^~N~^~Unknown~^~vkRegisterDeviceEventEXT~^~VUID-vkRegisterDeviceEventEXT-pAllocator-parameter~^~(VK_EXT_display_control)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterDeviceEventEXT-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_31e13a01~^~N~^~Unknown~^~vkRegisterDeviceEventEXT~^~VUID-vkRegisterDeviceEventEXT-pDeviceEventInfo-parameter~^~(VK_EXT_display_control)~^~The spec valid usage text states 'pDeviceEventInfo must be a valid pointer to a valid VkDeviceEventInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterDeviceEventEXT-pDeviceEventInfo-parameter)~^~implicit +VALIDATION_ERROR_31e17001~^~Y~^~Unknown~^~vkRegisterDeviceEventEXT~^~VUID-vkRegisterDeviceEventEXT-pFence-parameter~^~(VK_EXT_display_control)~^~The spec valid usage text states 'pFence must be a valid pointer to a VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterDeviceEventEXT-pFence-parameter)~^~implicit +VALIDATION_ERROR_32005601~^~Y~^~Unknown~^~vkRegisterDisplayEventEXT~^~VUID-vkRegisterDisplayEventEXT-device-parameter~^~(VK_EXT_display_control)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-device-parameter)~^~implicit +VALIDATION_ERROR_32006001~^~Y~^~Unknown~^~vkRegisterDisplayEventEXT~^~VUID-vkRegisterDisplayEventEXT-display-parameter~^~(VK_EXT_display_control)~^~The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-display-parameter)~^~implicit +VALIDATION_ERROR_3200ec01~^~N~^~Unknown~^~vkRegisterDisplayEventEXT~^~VUID-vkRegisterDisplayEventEXT-pAllocator-parameter~^~(VK_EXT_display_control)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_32014c01~^~N~^~Unknown~^~vkRegisterDisplayEventEXT~^~VUID-vkRegisterDisplayEventEXT-pDisplayEventInfo-parameter~^~(VK_EXT_display_control)~^~The spec valid usage text states 'pDisplayEventInfo must be a valid pointer to a valid VkDisplayEventInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-pDisplayEventInfo-parameter)~^~implicit +VALIDATION_ERROR_32017001~^~Y~^~Unknown~^~vkRegisterDisplayEventEXT~^~VUID-vkRegisterDisplayEventEXT-pFence-parameter~^~(VK_EXT_display_control)~^~The spec valid usage text states 'pFence must be a valid pointer to a VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-pFence-parameter)~^~implicit +VALIDATION_ERROR_32200aa8~^~N~^~Unknown~^~vkRegisterObjectsNVX~^~VUID-vkRegisterObjectsNVX-pObjectTableEntry-01364~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'The contents of pObjectTableEntry must yield plausible bindings supported by the device.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterObjectsNVX-pObjectTableEntry-01364)~^~ +VALIDATION_ERROR_32200aaa~^~N~^~Unknown~^~vkRegisterObjectsNVX~^~VUID-vkRegisterObjectsNVX-pObjectIndices-01365~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'At any pObjectIndices there must not be a registered resource already.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterObjectsNVX-pObjectIndices-01365)~^~ +VALIDATION_ERROR_32200aac~^~N~^~Unknown~^~vkRegisterObjectsNVX~^~VUID-vkRegisterObjectsNVX-pObjectIndices-01366~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'Any value inside pObjectIndices must be below the appropriate VkObjectTableCreateInfoNVX::pObjectEntryCounts limits provided at objectTable creation time.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterObjectsNVX-pObjectIndices-01366)~^~ +VALIDATION_ERROR_32205601~^~Y~^~Unknown~^~vkRegisterObjectsNVX~^~VUID-vkRegisterObjectsNVX-device-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterObjectsNVX-device-parameter)~^~implicit +VALIDATION_ERROR_3220d61b~^~Y~^~Unknown~^~vkRegisterObjectsNVX~^~VUID-vkRegisterObjectsNVX-objectCount-arraylength~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'objectCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterObjectsNVX-objectCount-arraylength)~^~implicit +VALIDATION_ERROR_3220d801~^~Y~^~Unknown~^~vkRegisterObjectsNVX~^~VUID-vkRegisterObjectsNVX-objectTable-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterObjectsNVX-objectTable-parameter)~^~implicit +VALIDATION_ERROR_3220d807~^~Y~^~Unknown~^~vkRegisterObjectsNVX~^~VUID-vkRegisterObjectsNVX-objectTable-parent~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'objectTable must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterObjectsNVX-objectTable-parent)~^~implicit +VALIDATION_ERROR_3221cc01~^~Y~^~Unknown~^~vkRegisterObjectsNVX~^~VUID-vkRegisterObjectsNVX-pObjectIndices-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'pObjectIndices must be a valid pointer to an array of objectCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterObjectsNVX-pObjectIndices-parameter)~^~implicit +VALIDATION_ERROR_32229201~^~Y~^~Unknown~^~vkRegisterObjectsNVX~^~VUID-vkRegisterObjectsNVX-ppObjectTableEntries-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'ppObjectTableEntries must be a valid pointer to an array of objectCount valid VkObjectTableEntryNVX structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterObjectsNVX-ppObjectTableEntries-parameter)~^~implicit +VALIDATION_ERROR_32406001~^~Y~^~Unknown~^~vkReleaseDisplayEXT~^~VUID-vkReleaseDisplayEXT-display-parameter~^~(VK_KHR_surface)+(VK_KHR_display)+(VK_EXT_direct_mode_display)~^~The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkReleaseDisplayEXT-display-parameter)~^~implicit +VALIDATION_ERROR_32427a01~^~Y~^~Unknown~^~vkReleaseDisplayEXT~^~VUID-vkReleaseDisplayEXT-physicalDevice-parameter~^~(VK_KHR_surface)+(VK_KHR_display)+(VK_EXT_direct_mode_display)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkReleaseDisplayEXT-physicalDevice-parameter)~^~implicit VALIDATION_ERROR_3260005a~^~Y~^~Unknown~^~vkResetCommandBuffer~^~VUID-vkResetCommandBuffer-commandBuffer-00045~^~core~^~The spec valid usage text states 'commandBuffer must not be in the pending state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkResetCommandBuffer-commandBuffer-00045)~^~ VALIDATION_ERROR_3260005c~^~Y~^~CommandBufferResetErrors~^~vkResetCommandBuffer~^~VUID-vkResetCommandBuffer-commandBuffer-00046~^~core~^~The spec valid usage text states 'commandBuffer must have been allocated from a pool that was created with the VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkResetCommandBuffer-commandBuffer-00046)~^~ VALIDATION_ERROR_32602401~^~Y~^~Unknown~^~vkResetCommandBuffer~^~VUID-vkResetCommandBuffer-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkResetCommandBuffer-commandBuffer-parameter)~^~implicit @@ -3367,35 +3397,35 @@ VALIDATION_ERROR_33005601~^~Y~^~None~^~vkSetEvent~^~VUID-vkSetEvent-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkSetEvent-device-parameter)~^~implicit VALIDATION_ERROR_33007e01~^~Y~^~None~^~vkSetEvent~^~VUID-vkSetEvent-event-parameter~^~core~^~The spec valid usage text states 'event must be a valid VkEvent handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkSetEvent-event-parameter)~^~implicit VALIDATION_ERROR_33007e07~^~Y~^~Unknown~^~vkSetEvent~^~VUID-vkSetEvent-event-parent~^~core~^~The spec valid usage text states 'event must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkSetEvent-event-parent)~^~implicit -VALIDATION_ERROR_33200009~^~Y~^~None~^~vkSetHdrMetadataEXT~^~VUID-vkSetHdrMetadataEXT-commonparent~^~core~^~The spec valid usage text states 'Both of device, and the elements of pSwapchains must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkSetHdrMetadataEXT-commonparent)~^~implicit -VALIDATION_ERROR_33205601~^~Y~^~Unknown~^~vkSetHdrMetadataEXT~^~VUID-vkSetHdrMetadataEXT-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkSetHdrMetadataEXT-device-parameter)~^~implicit -VALIDATION_ERROR_3321ba01~^~Y~^~Unknown~^~vkSetHdrMetadataEXT~^~VUID-vkSetHdrMetadataEXT-pMetadata-parameter~^~core~^~The spec valid usage text states 'pMetadata must be a valid pointer to an array of swapchainCount valid VkHdrMetadataEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkSetHdrMetadataEXT-pMetadata-parameter)~^~implicit -VALIDATION_ERROR_33225801~^~Y~^~Unknown~^~vkSetHdrMetadataEXT~^~VUID-vkSetHdrMetadataEXT-pSwapchains-parameter~^~core~^~The spec valid usage text states 'pSwapchains must be a valid pointer to an array of swapchainCount valid VkSwapchainKHR handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkSetHdrMetadataEXT-pSwapchains-parameter)~^~implicit -VALIDATION_ERROR_3322f21b~^~N~^~Unknown~^~vkSetHdrMetadataEXT~^~VUID-vkSetHdrMetadataEXT-swapchainCount-arraylength~^~core~^~The spec valid usage text states 'swapchainCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkSetHdrMetadataEXT-swapchainCount-arraylength)~^~implicit -VALIDATION_ERROR_33402801~^~Y~^~Unknown~^~vkTrimCommandPoolKHR~^~VUID-vkTrimCommandPoolKHR-commandPool-parameter~^~core~^~The spec valid usage text states 'commandPool must be a valid VkCommandPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkTrimCommandPoolKHR-commandPool-parameter)~^~implicit -VALIDATION_ERROR_33402807~^~Y~^~Unknown~^~vkTrimCommandPoolKHR~^~VUID-vkTrimCommandPoolKHR-commandPool-parent~^~core~^~The spec valid usage text states 'commandPool must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkTrimCommandPoolKHR-commandPool-parent)~^~implicit -VALIDATION_ERROR_33405601~^~Y~^~Unknown~^~vkTrimCommandPoolKHR~^~VUID-vkTrimCommandPoolKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkTrimCommandPoolKHR-device-parameter)~^~implicit -VALIDATION_ERROR_33409005~^~Y~^~Unknown~^~vkTrimCommandPoolKHR~^~VUID-vkTrimCommandPoolKHR-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkTrimCommandPoolKHR-flags-zerobitmask)~^~implicit +VALIDATION_ERROR_33200009~^~Y~^~None~^~vkSetHdrMetadataEXT~^~VUID-vkSetHdrMetadataEXT-commonparent~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_EXT_hdr_metadata)~^~The spec valid usage text states 'Both of device, and the elements of pSwapchains must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSetHdrMetadataEXT-commonparent)~^~implicit +VALIDATION_ERROR_33205601~^~Y~^~Unknown~^~vkSetHdrMetadataEXT~^~VUID-vkSetHdrMetadataEXT-device-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_EXT_hdr_metadata)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSetHdrMetadataEXT-device-parameter)~^~implicit +VALIDATION_ERROR_3321ba01~^~Y~^~Unknown~^~vkSetHdrMetadataEXT~^~VUID-vkSetHdrMetadataEXT-pMetadata-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_EXT_hdr_metadata)~^~The spec valid usage text states 'pMetadata must be a valid pointer to an array of swapchainCount valid VkHdrMetadataEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSetHdrMetadataEXT-pMetadata-parameter)~^~implicit +VALIDATION_ERROR_33225801~^~Y~^~Unknown~^~vkSetHdrMetadataEXT~^~VUID-vkSetHdrMetadataEXT-pSwapchains-parameter~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_EXT_hdr_metadata)~^~The spec valid usage text states 'pSwapchains must be a valid pointer to an array of swapchainCount valid VkSwapchainKHR handles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSetHdrMetadataEXT-pSwapchains-parameter)~^~implicit +VALIDATION_ERROR_3322f21b~^~N~^~Unknown~^~vkSetHdrMetadataEXT~^~VUID-vkSetHdrMetadataEXT-swapchainCount-arraylength~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_EXT_hdr_metadata)~^~The spec valid usage text states 'swapchainCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSetHdrMetadataEXT-swapchainCount-arraylength)~^~implicit +VALIDATION_ERROR_33402801~^~Y~^~Unknown~^~vkTrimCommandPool~^~VUID-vkTrimCommandPool-commandPool-parameter~^~(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'commandPool must be a valid VkCommandPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkTrimCommandPool-commandPool-parameter)~^~implicit +VALIDATION_ERROR_33402807~^~Y~^~Unknown~^~vkTrimCommandPool~^~VUID-vkTrimCommandPool-commandPool-parent~^~(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'commandPool must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkTrimCommandPool-commandPool-parent)~^~implicit +VALIDATION_ERROR_33405601~^~Y~^~Unknown~^~vkTrimCommandPool~^~VUID-vkTrimCommandPool-device-parameter~^~(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkTrimCommandPool-device-parameter)~^~implicit +VALIDATION_ERROR_33409005~^~Y~^~Unknown~^~vkTrimCommandPool~^~VUID-vkTrimCommandPool-flags-zerobitmask~^~(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkTrimCommandPool-flags-zerobitmask)~^~implicit VALIDATION_ERROR_33600562~^~Y~^~Unknown~^~vkUnmapMemory~^~VUID-vkUnmapMemory-memory-00689~^~core~^~The spec valid usage text states 'memory must be currently mapped' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnmapMemory-memory-00689)~^~ VALIDATION_ERROR_33605601~^~Y~^~None~^~vkUnmapMemory~^~VUID-vkUnmapMemory-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnmapMemory-device-parameter)~^~implicit VALIDATION_ERROR_3360c601~^~Y~^~None~^~vkUnmapMemory~^~VUID-vkUnmapMemory-memory-parameter~^~core~^~The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnmapMemory-memory-parameter)~^~implicit VALIDATION_ERROR_3360c607~^~Y~^~Unknown~^~vkUnmapMemory~^~VUID-vkUnmapMemory-memory-parent~^~core~^~The spec valid usage text states 'memory must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnmapMemory-memory-parent)~^~implicit -VALIDATION_ERROR_33800aba~^~N~^~Unknown~^~vkUnregisterObjectsNVX~^~VUID-vkUnregisterObjectsNVX-pObjectIndices-01373~^~core~^~The spec valid usage text states 'At any pObjectIndices there must be a registered resource already.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnregisterObjectsNVX-pObjectIndices-01373)~^~ -VALIDATION_ERROR_33800abc~^~N~^~Unknown~^~vkUnregisterObjectsNVX~^~VUID-vkUnregisterObjectsNVX-pObjectEntryTypes-01374~^~core~^~The spec valid usage text states 'The pObjectEntryTypes of the resource at pObjectIndices must match.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnregisterObjectsNVX-pObjectEntryTypes-01374)~^~ -VALIDATION_ERROR_33800abe~^~N~^~Unknown~^~vkUnregisterObjectsNVX~^~VUID-vkUnregisterObjectsNVX-None-01375~^~core~^~The spec valid usage text states 'All operations on the device using the registered resource must have been completed.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnregisterObjectsNVX-None-01375)~^~ -VALIDATION_ERROR_33805601~^~Y~^~Unknown~^~vkUnregisterObjectsNVX~^~VUID-vkUnregisterObjectsNVX-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnregisterObjectsNVX-device-parameter)~^~implicit -VALIDATION_ERROR_3380d61b~^~Y~^~Unknown~^~vkUnregisterObjectsNVX~^~VUID-vkUnregisterObjectsNVX-objectCount-arraylength~^~core~^~The spec valid usage text states 'objectCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnregisterObjectsNVX-objectCount-arraylength)~^~implicit -VALIDATION_ERROR_3380d801~^~Y~^~Unknown~^~vkUnregisterObjectsNVX~^~VUID-vkUnregisterObjectsNVX-objectTable-parameter~^~core~^~The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnregisterObjectsNVX-objectTable-parameter)~^~implicit -VALIDATION_ERROR_3380d807~^~Y~^~Unknown~^~vkUnregisterObjectsNVX~^~VUID-vkUnregisterObjectsNVX-objectTable-parent~^~core~^~The spec valid usage text states 'objectTable must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnregisterObjectsNVX-objectTable-parent)~^~implicit -VALIDATION_ERROR_3381c801~^~N~^~Unknown~^~vkUnregisterObjectsNVX~^~VUID-vkUnregisterObjectsNVX-pObjectEntryTypes-parameter~^~core~^~The spec valid usage text states 'pObjectEntryTypes must be a valid pointer to an array of objectCount valid VkObjectEntryTypeNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnregisterObjectsNVX-pObjectEntryTypes-parameter)~^~implicit -VALIDATION_ERROR_3381cc01~^~Y~^~Unknown~^~vkUnregisterObjectsNVX~^~VUID-vkUnregisterObjectsNVX-pObjectIndices-parameter~^~core~^~The spec valid usage text states 'pObjectIndices must be a valid pointer to an array of objectCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnregisterObjectsNVX-pObjectIndices-parameter)~^~implicit -VALIDATION_ERROR_33a00d2a~^~N~^~None~^~vkUpdateDescriptorSetWithTemplateKHR~^~VUID-vkUpdateDescriptorSetWithTemplateKHR-pData-01685~^~core~^~The spec valid usage text states 'pData must be a valid pointer to a memory that contains one or more valid instances of VkDescriptorImageInfo, VkDescriptorBufferInfo, or VkBufferView in a layout defined by descriptorUpdateTemplate when it was created with vkCreateDescriptorUpdateTemplateKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplateKHR-pData-01685)~^~ -VALIDATION_ERROR_33a04801~^~Y~^~Unknown~^~vkUpdateDescriptorSetWithTemplateKHR~^~VUID-vkUpdateDescriptorSetWithTemplateKHR-descriptorSet-parameter~^~core~^~The spec valid usage text states 'descriptorSet must be a valid VkDescriptorSet handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplateKHR-descriptorSet-parameter)~^~implicit -VALIDATION_ERROR_33a05201~^~Y~^~Unknown~^~vkUpdateDescriptorSetWithTemplateKHR~^~VUID-vkUpdateDescriptorSetWithTemplateKHR-descriptorUpdateTemplate-parameter~^~core~^~The spec valid usage text states 'descriptorUpdateTemplate must be a valid VkDescriptorUpdateTemplateKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplateKHR-descriptorUpdateTemplate-parameter)~^~implicit -VALIDATION_ERROR_33a05207~^~Y~^~Unknown~^~vkUpdateDescriptorSetWithTemplateKHR~^~VUID-vkUpdateDescriptorSetWithTemplateKHR-descriptorUpdateTemplate-parent~^~core~^~The spec valid usage text states 'descriptorUpdateTemplate must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplateKHR-descriptorUpdateTemplate-parent)~^~implicit -VALIDATION_ERROR_33a05601~^~Y~^~Unknown~^~vkUpdateDescriptorSetWithTemplateKHR~^~VUID-vkUpdateDescriptorSetWithTemplateKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplateKHR-device-parameter)~^~implicit -VALIDATION_ERROR_33a12201~^~N~^~Unknown~^~vkUpdateDescriptorSetWithTemplateKHR~^~VUID-vkUpdateDescriptorSetWithTemplateKHR-pData-parameter~^~core~^~The spec valid usage text states 'pData must be a pointer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplateKHR-pData-parameter)~^~implicit -VALIDATION_ERROR_33c00274~^~N~^~Unknown~^~vkUpdateDescriptorSets~^~VUID-vkUpdateDescriptorSets-dstSet-00314~^~core~^~The spec valid usage text states 'The dstSet member of each element of pDescriptorWrites or pDescriptorCopies must not be used by any command that was recorded to a command buffer which is in the pending state.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSets-dstSet-00314)~^~ +VALIDATION_ERROR_33800aba~^~N~^~Unknown~^~vkUnregisterObjectsNVX~^~VUID-vkUnregisterObjectsNVX-pObjectIndices-01373~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'At any pObjectIndices there must be a registered resource already.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUnregisterObjectsNVX-pObjectIndices-01373)~^~ +VALIDATION_ERROR_33800abc~^~N~^~Unknown~^~vkUnregisterObjectsNVX~^~VUID-vkUnregisterObjectsNVX-pObjectEntryTypes-01374~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'The pObjectEntryTypes of the resource at pObjectIndices must match.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUnregisterObjectsNVX-pObjectEntryTypes-01374)~^~ +VALIDATION_ERROR_33800abe~^~N~^~Unknown~^~vkUnregisterObjectsNVX~^~VUID-vkUnregisterObjectsNVX-None-01375~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'All operations on the device using the registered resource must have been completed.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUnregisterObjectsNVX-None-01375)~^~ +VALIDATION_ERROR_33805601~^~Y~^~Unknown~^~vkUnregisterObjectsNVX~^~VUID-vkUnregisterObjectsNVX-device-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUnregisterObjectsNVX-device-parameter)~^~implicit +VALIDATION_ERROR_3380d61b~^~Y~^~Unknown~^~vkUnregisterObjectsNVX~^~VUID-vkUnregisterObjectsNVX-objectCount-arraylength~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'objectCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUnregisterObjectsNVX-objectCount-arraylength)~^~implicit +VALIDATION_ERROR_3380d801~^~Y~^~Unknown~^~vkUnregisterObjectsNVX~^~VUID-vkUnregisterObjectsNVX-objectTable-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUnregisterObjectsNVX-objectTable-parameter)~^~implicit +VALIDATION_ERROR_3380d807~^~Y~^~Unknown~^~vkUnregisterObjectsNVX~^~VUID-vkUnregisterObjectsNVX-objectTable-parent~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'objectTable must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUnregisterObjectsNVX-objectTable-parent)~^~implicit +VALIDATION_ERROR_3381c801~^~N~^~Unknown~^~vkUnregisterObjectsNVX~^~VUID-vkUnregisterObjectsNVX-pObjectEntryTypes-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'pObjectEntryTypes must be a valid pointer to an array of objectCount valid VkObjectEntryTypeNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUnregisterObjectsNVX-pObjectEntryTypes-parameter)~^~implicit +VALIDATION_ERROR_3381cc01~^~Y~^~Unknown~^~vkUnregisterObjectsNVX~^~VUID-vkUnregisterObjectsNVX-pObjectIndices-parameter~^~(VK_NVX_device_generated_commands)~^~The spec valid usage text states 'pObjectIndices must be a valid pointer to an array of objectCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUnregisterObjectsNVX-pObjectIndices-parameter)~^~implicit +VALIDATION_ERROR_33a00d2a~^~N~^~None~^~vkUpdateDescriptorSetWithTemplate~^~VUID-vkUpdateDescriptorSetWithTemplate-pData-01685~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'pData must be a valid pointer to a memory that contains one or more valid instances of VkDescriptorImageInfo, VkDescriptorBufferInfo, or VkBufferView in a layout defined by descriptorUpdateTemplate when it was created with vkCreateDescriptorUpdateTemplate' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplate-pData-01685)~^~ +VALIDATION_ERROR_33a04801~^~Y~^~Unknown~^~vkUpdateDescriptorSetWithTemplate~^~VUID-vkUpdateDescriptorSetWithTemplate-descriptorSet-parameter~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'descriptorSet must be a valid VkDescriptorSet handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplate-descriptorSet-parameter)~^~implicit +VALIDATION_ERROR_33a05201~^~Y~^~Unknown~^~vkUpdateDescriptorSetWithTemplate~^~VUID-vkUpdateDescriptorSetWithTemplate-descriptorUpdateTemplate-parameter~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'descriptorUpdateTemplate must be a valid VkDescriptorUpdateTemplate handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplate-descriptorUpdateTemplate-parameter)~^~implicit +VALIDATION_ERROR_33a05207~^~Y~^~Unknown~^~vkUpdateDescriptorSetWithTemplate~^~VUID-vkUpdateDescriptorSetWithTemplate-descriptorUpdateTemplate-parent~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'descriptorUpdateTemplate must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplate-descriptorUpdateTemplate-parent)~^~implicit +VALIDATION_ERROR_33a05601~^~Y~^~Unknown~^~vkUpdateDescriptorSetWithTemplate~^~VUID-vkUpdateDescriptorSetWithTemplate-device-parameter~^~(VK_VERSION_1_1,VK_KHR_descriptor_update_template)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplate-device-parameter)~^~implicit +VALIDATION_ERROR_33c00274~^~N~^~Unknown~^~vkUpdateDescriptorSets~^~VUID-vkUpdateDescriptorSets-dstSet-00314~^~!(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'The dstSet member of each element of pDescriptorWrites or pDescriptorCopies must not be used by any command that was recorded to a command buffer which is in the pending state.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSets-dstSet-00314)~^~ +VALIDATION_ERROR_33c017ce~^~N~^~None~^~vkUpdateDescriptorSets~^~VUID-vkUpdateDescriptorSets-None-03047~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'Descriptor bindings updated by this command which were created without the VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT or VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT bits set must not be used by any command that was recorded to a command buffer which is in the pending state.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUpdateDescriptorSets-None-03047)~^~ VALIDATION_ERROR_33c05601~^~Y~^~None~^~vkUpdateDescriptorSets~^~VUID-vkUpdateDescriptorSets-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSets-device-parameter)~^~implicit VALIDATION_ERROR_33c12c01~^~Y~^~Unknown~^~vkUpdateDescriptorSets~^~VUID-vkUpdateDescriptorSets-pDescriptorCopies-parameter~^~core~^~The spec valid usage text states 'If descriptorCopyCount is not 0, pDescriptorCopies must be a valid pointer to an array of descriptorCopyCount valid VkCopyDescriptorSet structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSets-pDescriptorCopies-parameter)~^~implicit VALIDATION_ERROR_33c13601~^~Y~^~Unknown~^~vkUpdateDescriptorSets~^~VUID-vkUpdateDescriptorSets-pDescriptorWrites-parameter~^~core~^~The spec valid usage text states 'If descriptorWriteCount is not 0, pDescriptorWrites must be a valid pointer to an array of descriptorWriteCount valid VkWriteDescriptorSet structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSets-pDescriptorWrites-parameter)~^~implicit @@ -3403,331 +3433,506 @@ VALIDATION_ERROR_33e08a1b~^~N~^~Unknown~^~vkWaitForFences~^~VUID-vkWaitForFences-fenceCount-arraylength~^~core~^~The spec valid usage text states 'fenceCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkWaitForFences-fenceCount-arraylength)~^~implicit VALIDATION_ERROR_33e17201~^~Y~^~Unknown~^~vkWaitForFences~^~VUID-vkWaitForFences-pFences-parameter~^~core~^~The spec valid usage text states 'pFences must be a valid pointer to an array of fenceCount valid VkFence handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkWaitForFences-pFences-parameter)~^~implicit VALIDATION_ERROR_33e17207~^~Y~^~None~^~vkWaitForFences~^~VUID-vkWaitForFences-pFences-parent~^~core~^~The spec valid usage text states 'Each element of pFences must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkWaitForFences-pFences-parent)~^~implicit -VALIDATION_ERROR_3401c40d~^~N~^~None~^~VkPhysicalDeviceProperties2KHR~^~VUID-VkPhysicalDeviceProperties2KHR-pNext-pNext~^~core~^~The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT, VkPhysicalDeviceDiscardRectanglePropertiesEXT, VkPhysicalDeviceIDPropertiesKHR, VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX, VkPhysicalDeviceMultiviewPropertiesKHX, VkPhysicalDevicePointClippingPropertiesKHR, VkPhysicalDevicePushDescriptorPropertiesKHR, VkPhysicalDeviceSampleLocationsPropertiesEXT, or VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceProperties2KHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3402b00b~^~Y~^~None~^~VkPhysicalDeviceProperties2KHR~^~VUID-VkPhysicalDeviceProperties2KHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceProperties2KHR-sType-sType)~^~implicit -VALIDATION_ERROR_3402b00f~^~N~^~None~^~VkPhysicalDeviceProperties2KHR~^~VUID-VkPhysicalDeviceProperties2KHR-sType-unique~^~core~^~The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceProperties2KHR-sType-unique)~^~implicit -VALIDATION_ERROR_3421c40d~^~N~^~None~^~VkFormatProperties2KHR~^~VUID-VkFormatProperties2KHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFormatProperties2KHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3422b00b~^~Y~^~None~^~VkFormatProperties2KHR~^~VUID-VkFormatProperties2KHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFormatProperties2KHR-sType-sType)~^~implicit -VALIDATION_ERROR_3441c40d~^~N~^~None~^~VkImageFormatProperties2KHR~^~VUID-VkImageFormatProperties2KHR-pNext-pNext~^~core~^~The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkExternalImageFormatPropertiesKHR, VkSamplerYcbcrConversionImageFormatPropertiesKHR, or VkTextureLODGatherFormatPropertiesAMD' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageFormatProperties2KHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3442b00b~^~Y~^~None~^~VkImageFormatProperties2KHR~^~VUID-VkImageFormatProperties2KHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageFormatProperties2KHR-sType-sType)~^~implicit -VALIDATION_ERROR_3442b00f~^~N~^~None~^~VkImageFormatProperties2KHR~^~VUID-VkImageFormatProperties2KHR-sType-unique~^~core~^~The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageFormatProperties2KHR-sType-unique)~^~implicit -VALIDATION_ERROR_3461c40d~^~N~^~None~^~VkPhysicalDeviceMemoryProperties2KHR~^~VUID-VkPhysicalDeviceMemoryProperties2KHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceMemoryProperties2KHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3462b00b~^~Y~^~None~^~VkPhysicalDeviceMemoryProperties2KHR~^~VUID-VkPhysicalDeviceMemoryProperties2KHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceMemoryProperties2KHR-sType-sType)~^~implicit -VALIDATION_ERROR_3481c40d~^~N~^~None~^~VkSurfaceCapabilities2KHR~^~VUID-VkSurfaceCapabilities2KHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkSharedPresentSurfaceCapabilitiesKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSurfaceCapabilities2KHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3482b00b~^~Y~^~None~^~VkSurfaceCapabilities2KHR~^~VUID-VkSurfaceCapabilities2KHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSurfaceCapabilities2KHR-sType-sType)~^~implicit -VALIDATION_ERROR_34a1c40d~^~N~^~None~^~VkDeviceGroupPresentCapabilitiesKHX~^~VUID-VkDeviceGroupPresentCapabilitiesKHX-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentCapabilitiesKHX-pNext-pNext)~^~implicit -VALIDATION_ERROR_34a2b00b~^~Y~^~None~^~VkDeviceGroupPresentCapabilitiesKHX~^~VUID-VkDeviceGroupPresentCapabilitiesKHX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentCapabilitiesKHX-sType-sType)~^~implicit -VALIDATION_ERROR_34c1c40d~^~N~^~None~^~VkExternalBufferPropertiesKHR~^~VUID-VkExternalBufferPropertiesKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalBufferPropertiesKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_34c2b00b~^~Y~^~None~^~VkExternalBufferPropertiesKHR~^~VUID-VkExternalBufferPropertiesKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalBufferPropertiesKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3521c40d~^~N~^~None~^~VkExternalSemaphorePropertiesKHR~^~VUID-VkExternalSemaphorePropertiesKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalSemaphorePropertiesKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3522b00b~^~Y~^~None~^~VkExternalSemaphorePropertiesKHR~^~VUID-VkExternalSemaphorePropertiesKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalSemaphorePropertiesKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3541c40d~^~N~^~None~^~VkQueueFamilyProperties2KHR~^~VUID-VkQueueFamilyProperties2KHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkQueueFamilyProperties2KHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3542b00b~^~N~^~None~^~VkQueueFamilyProperties2KHR~^~VUID-VkQueueFamilyProperties2KHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkQueueFamilyProperties2KHR-sType-sType)~^~implicit -VALIDATION_ERROR_3561c40d~^~N~^~None~^~VkSparseImageFormatProperties2KHR~^~VUID-VkSparseImageFormatProperties2KHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseImageFormatProperties2KHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3562b00b~^~N~^~None~^~VkSparseImageFormatProperties2KHR~^~VUID-VkSparseImageFormatProperties2KHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseImageFormatProperties2KHR-sType-sType)~^~implicit -VALIDATION_ERROR_3581c40d~^~N~^~None~^~VkSurfaceFormat2KHR~^~VUID-VkSurfaceFormat2KHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSurfaceFormat2KHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3582b00b~^~N~^~None~^~VkSurfaceFormat2KHR~^~VUID-VkSurfaceFormat2KHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSurfaceFormat2KHR-sType-sType)~^~implicit -VALIDATION_ERROR_35c1c40d~^~N~^~None~^~VkPhysicalDeviceMultiviewPropertiesKHX~^~VUID-VkPhysicalDeviceMultiviewPropertiesKHX-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceMultiviewPropertiesKHX-pNext-pNext)~^~implicit -VALIDATION_ERROR_35c2b00b~^~N~^~None~^~VkPhysicalDeviceMultiviewPropertiesKHX~^~VUID-VkPhysicalDeviceMultiviewPropertiesKHX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceMultiviewPropertiesKHX-sType-sType)~^~implicit -VALIDATION_ERROR_3601c40d~^~N~^~None~^~VkExternalImageFormatPropertiesKHR~^~VUID-VkExternalImageFormatPropertiesKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalImageFormatPropertiesKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3602b00b~^~N~^~None~^~VkExternalImageFormatPropertiesKHR~^~VUID-VkExternalImageFormatPropertiesKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalImageFormatPropertiesKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3621c40d~^~N~^~None~^~VkPhysicalDeviceIDPropertiesKHR~^~VUID-VkPhysicalDeviceIDPropertiesKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceIDPropertiesKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3622b00b~^~N~^~None~^~VkPhysicalDeviceIDPropertiesKHR~^~VUID-VkPhysicalDeviceIDPropertiesKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceIDPropertiesKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3641c40d~^~N~^~None~^~VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX~^~VUID-VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX-pNext-pNext)~^~implicit -VALIDATION_ERROR_3642b00b~^~N~^~None~^~VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX~^~VUID-VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX-sType-sType)~^~implicit -VALIDATION_ERROR_37e2b00b~^~N~^~None~^~VkSharedPresentSurfaceCapabilitiesKHR~^~VUID-VkSharedPresentSurfaceCapabilitiesKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSharedPresentSurfaceCapabilitiesKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3822b00b~^~N~^~None~^~VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT~^~VUID-VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT-sType-sType)~^~implicit -VALIDATION_ERROR_3842b00b~^~N~^~None~^~VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT~^~VUID-VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT-sType-sType)~^~implicit -VALIDATION_ERROR_3861c40d~^~N~^~None~^~VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT~^~VUID-VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT-pNext-pNext)~^~implicit -VALIDATION_ERROR_3862b00b~^~N~^~None~^~VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT~^~VUID-VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT-sType-sType)~^~implicit -VALIDATION_ERROR_38800b20~^~N~^~None~^~VkPipelineColorBlendAdvancedStateCreateInfoEXT~^~VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-srcPremultiplied-01424~^~core~^~The spec valid usage text states 'If the non-premultiplied source color property is not supported, srcPremultiplied must be VK_TRUE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-srcPremultiplied-01424)~^~ -VALIDATION_ERROR_38800b22~^~N~^~None~^~VkPipelineColorBlendAdvancedStateCreateInfoEXT~^~VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-dstPremultiplied-01425~^~core~^~The spec valid usage text states 'If the non-premultiplied destination color property is not supported, dstPremultiplied must be VK_TRUE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-dstPremultiplied-01425)~^~ -VALIDATION_ERROR_38800b24~^~N~^~None~^~VkPipelineColorBlendAdvancedStateCreateInfoEXT~^~VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-blendOverlap-01426~^~core~^~The spec valid usage text states 'If the correlated overlap property is not supported, blendOverlap must be VK_BLEND_OVERLAP_UNCORRELATED_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-blendOverlap-01426)~^~ -VALIDATION_ERROR_3881c40d~^~N~^~None~^~VkPipelineColorBlendAdvancedStateCreateInfoEXT~^~VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-pNext-pNext)~^~implicit -VALIDATION_ERROR_3882b00b~^~N~^~None~^~VkPipelineColorBlendAdvancedStateCreateInfoEXT~^~VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-sType-sType)~^~implicit -VALIDATION_ERROR_38834a01~^~N~^~None~^~VkPipelineColorBlendAdvancedStateCreateInfoEXT~^~VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-blendOverlap-parameter~^~core~^~The spec valid usage text states 'blendOverlap must be a valid VkBlendOverlapEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-blendOverlap-parameter)~^~implicit -VALIDATION_ERROR_38a00afa~^~N~^~None~^~VkPipelineCoverageModulationStateCreateInfoNV~^~VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationTableEnable-01405~^~core~^~The spec valid usage text states 'If coverageModulationTableEnable is VK_TRUE, coverageModulationTableCount must be equal to the number of rasterization samples divided by the number of color samples in the subpass.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationTableEnable-01405)~^~ -VALIDATION_ERROR_38a09005~^~N~^~None~^~VkPipelineCoverageModulationStateCreateInfoNV~^~VUID-VkPipelineCoverageModulationStateCreateInfoNV-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-flags-zerobitmask)~^~implicit -VALIDATION_ERROR_38a1c40d~^~N~^~None~^~VkPipelineCoverageModulationStateCreateInfoNV~^~VUID-VkPipelineCoverageModulationStateCreateInfoNV-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-pNext-pNext)~^~implicit -VALIDATION_ERROR_38a2b00b~^~N~^~None~^~VkPipelineCoverageModulationStateCreateInfoNV~^~VUID-VkPipelineCoverageModulationStateCreateInfoNV-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-sType-sType)~^~implicit -VALIDATION_ERROR_38a34c01~^~N~^~None~^~VkPipelineCoverageModulationStateCreateInfoNV~^~VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationMode-parameter~^~core~^~The spec valid usage text states 'coverageModulationMode must be a valid VkCoverageModulationModeNV value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationMode-parameter)~^~implicit -VALIDATION_ERROR_38a34e1b~^~N~^~None~^~VkPipelineCoverageModulationStateCreateInfoNV~^~VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationTableCount-arraylength~^~core~^~The spec valid usage text states 'coverageModulationTableCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationTableCount-arraylength)~^~implicit -VALIDATION_ERROR_38c00af8~^~N~^~None~^~VkPipelineCoverageToColorStateCreateInfoNV~^~VUID-VkPipelineCoverageToColorStateCreateInfoNV-coverageToColorEnable-01404~^~core~^~The spec valid usage text states 'If coverageToColorEnable is VK_TRUE, then the render pass subpass indicated by VkGraphicsPipelineCreateInfo::renderPass and VkGraphicsPipelineCreateInfo::subpass must have a color attachment at the location selected by coverageToColorLocation, with a VkFormat of VK_FORMAT_R8_UINT, VK_FORMAT_R8_SINT, VK_FORMAT_R16_UINT, VK_FORMAT_R16_SINT, VK_FORMAT_R32_UINT, or VK_FORMAT_R32_SINT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageToColorStateCreateInfoNV-coverageToColorEnable-01404)~^~ -VALIDATION_ERROR_38c09005~^~N~^~None~^~VkPipelineCoverageToColorStateCreateInfoNV~^~VUID-VkPipelineCoverageToColorStateCreateInfoNV-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageToColorStateCreateInfoNV-flags-zerobitmask)~^~implicit -VALIDATION_ERROR_38c1c40d~^~N~^~None~^~VkPipelineCoverageToColorStateCreateInfoNV~^~VUID-VkPipelineCoverageToColorStateCreateInfoNV-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageToColorStateCreateInfoNV-pNext-pNext)~^~implicit -VALIDATION_ERROR_38c2b00b~^~N~^~None~^~VkPipelineCoverageToColorStateCreateInfoNV~^~VUID-VkPipelineCoverageToColorStateCreateInfoNV-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageToColorStateCreateInfoNV-sType-sType)~^~implicit -VALIDATION_ERROR_38e1c40d~^~N~^~None~^~VkSamplerReductionModeCreateInfoEXT~^~VUID-VkSamplerReductionModeCreateInfoEXT-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerReductionModeCreateInfoEXT-pNext-pNext)~^~implicit -VALIDATION_ERROR_38e2b00b~^~N~^~None~^~VkSamplerReductionModeCreateInfoEXT~^~VUID-VkSamplerReductionModeCreateInfoEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerReductionModeCreateInfoEXT-sType-sType)~^~implicit -VALIDATION_ERROR_38e35001~^~N~^~None~^~VkSamplerReductionModeCreateInfoEXT~^~VUID-VkSamplerReductionModeCreateInfoEXT-reductionMode-parameter~^~core~^~The spec valid usage text states 'reductionMode must be a valid VkSamplerReductionModeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerReductionModeCreateInfoEXT-reductionMode-parameter)~^~implicit -VALIDATION_ERROR_39400b4c~^~N~^~None~^~VkExportFenceCreateInfoKHR~^~VUID-VkExportFenceCreateInfoKHR-handleTypes-01446~^~core~^~The spec valid usage text states 'The bits in handleTypes must be supported and compatible, as reported by VkExternalFencePropertiesKHR.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportFenceCreateInfoKHR-handleTypes-01446)~^~ -VALIDATION_ERROR_39409e01~^~N~^~None~^~VkExportFenceCreateInfoKHR~^~VUID-VkExportFenceCreateInfoKHR-handleTypes-parameter~^~core~^~The spec valid usage text states 'handleTypes must be a valid combination of VkExternalFenceHandleTypeFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportFenceCreateInfoKHR-handleTypes-parameter)~^~implicit -VALIDATION_ERROR_3941c40d~^~N~^~None~^~VkExportFenceCreateInfoKHR~^~VUID-VkExportFenceCreateInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportFenceCreateInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3942b00b~^~N~^~None~^~VkExportFenceCreateInfoKHR~^~VUID-VkExportFenceCreateInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportFenceCreateInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_39609c01~^~Y~^~None~^~VkPhysicalDeviceExternalFenceInfoKHR~^~VUID-VkPhysicalDeviceExternalFenceInfoKHR-handleType-parameter~^~core~^~The spec valid usage text states 'handleType must be a valid VkExternalFenceHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceExternalFenceInfoKHR-handleType-parameter)~^~implicit -VALIDATION_ERROR_3961c40d~^~Y~^~None~^~VkPhysicalDeviceExternalFenceInfoKHR~^~VUID-VkPhysicalDeviceExternalFenceInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceExternalFenceInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3962b00b~^~Y~^~None~^~VkPhysicalDeviceExternalFenceInfoKHR~^~VUID-VkPhysicalDeviceExternalFenceInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceExternalFenceInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3981c40d~^~N~^~None~^~VkExternalFencePropertiesKHR~^~VUID-VkExternalFencePropertiesKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalFencePropertiesKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3982b00b~^~Y~^~None~^~VkExternalFencePropertiesKHR~^~VUID-VkExternalFencePropertiesKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalFencePropertiesKHR-sType-sType)~^~implicit -VALIDATION_ERROR_39a27a01~^~Y~^~None~^~vkGetPhysicalDeviceExternalFencePropertiesKHR~^~VUID-vkGetPhysicalDeviceExternalFencePropertiesKHR-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalFencePropertiesKHR-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_39a3a201~^~N~^~None~^~vkGetPhysicalDeviceExternalFencePropertiesKHR~^~VUID-vkGetPhysicalDeviceExternalFencePropertiesKHR-pExternalFenceInfo-parameter~^~core~^~The spec valid usage text states 'pExternalFenceInfo must be a valid pointer to a valid VkPhysicalDeviceExternalFenceInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalFencePropertiesKHR-pExternalFenceInfo-parameter)~^~implicit -VALIDATION_ERROR_39a3a401~^~N~^~None~^~vkGetPhysicalDeviceExternalFencePropertiesKHR~^~VUID-vkGetPhysicalDeviceExternalFencePropertiesKHR-pExternalFenceProperties-parameter~^~core~^~The spec valid usage text states 'pExternalFenceProperties must be a valid pointer to a VkExternalFencePropertiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalFencePropertiesKHR-pExternalFenceProperties-parameter)~^~implicit -VALIDATION_ERROR_39c00b70~^~N~^~None~^~VkImportFenceFdInfoKHR~^~VUID-VkImportFenceFdInfoKHR-handleType-01464~^~core~^~The spec valid usage text states 'handleType must be a value included in the Handle Types Supported by VkImportFenceFdInfoKHR table.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-handleType-01464)~^~ -VALIDATION_ERROR_39c00b72~^~N~^~None~^~VkImportFenceFdInfoKHR~^~VUID-VkImportFenceFdInfoKHR-handleType-01465~^~core~^~The spec valid usage text states 'The fence from which handleType was exported must have been created on the same underlying physical device as fence.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-handleType-01465)~^~ -VALIDATION_ERROR_39c00c0a~^~N~^~None~^~VkImportFenceFdInfoKHR~^~VUID-VkImportFenceFdInfoKHR-fd-01541~^~core~^~The spec valid usage text states 'fd must obey any requirements listed for handleType in external fence handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-fd-01541)~^~ -VALIDATION_ERROR_39c08801~^~Y~^~None~^~VkImportFenceFdInfoKHR~^~VUID-VkImportFenceFdInfoKHR-fence-parameter~^~core~^~The spec valid usage text states 'fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-fence-parameter)~^~implicit -VALIDATION_ERROR_39c09001~^~Y~^~None~^~VkImportFenceFdInfoKHR~^~VUID-VkImportFenceFdInfoKHR-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkFenceImportFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-flags-parameter)~^~implicit -VALIDATION_ERROR_39c09c01~^~Y~^~None~^~VkImportFenceFdInfoKHR~^~VUID-VkImportFenceFdInfoKHR-handleType-parameter~^~core~^~The spec valid usage text states 'handleType must be a valid VkExternalFenceHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-handleType-parameter)~^~implicit -VALIDATION_ERROR_39c1c40d~^~Y~^~None~^~VkImportFenceFdInfoKHR~^~VUID-VkImportFenceFdInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_39c2b00b~^~Y~^~None~^~VkImportFenceFdInfoKHR~^~VUID-VkImportFenceFdInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_39e00b5a~^~N~^~None~^~VkFenceGetFdInfoKHR~^~VUID-VkFenceGetFdInfoKHR-handleType-01453~^~core~^~The spec valid usage text states 'handleType must have been included in VkExportFenceCreateInfoKHR::handleTypes when fence's current payload was created.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-handleType-01453)~^~ -VALIDATION_ERROR_39e00b5c~^~N~^~None~^~VkFenceGetFdInfoKHR~^~VUID-VkFenceGetFdInfoKHR-handleType-01454~^~core~^~The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, fence must be signaled, or have an associated fence signal operation pending execution.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-handleType-01454)~^~ -VALIDATION_ERROR_39e00b5e~^~N~^~None~^~VkFenceGetFdInfoKHR~^~VUID-VkFenceGetFdInfoKHR-fence-01455~^~core~^~The spec valid usage text states 'fence must not currently have its payload replaced by an imported payload as described below in Importing Fence Payloads unless that imported payload's handle type was included in VkExternalFencePropertiesKHR::exportFromImportedHandleTypes for handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-fence-01455)~^~ -VALIDATION_ERROR_39e00b60~^~N~^~None~^~VkFenceGetFdInfoKHR~^~VUID-VkFenceGetFdInfoKHR-handleType-01456~^~core~^~The spec valid usage text states 'handleType must be defined as a POSIX file descriptor handle.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-handleType-01456)~^~ -VALIDATION_ERROR_39e08801~^~Y~^~None~^~VkFenceGetFdInfoKHR~^~VUID-VkFenceGetFdInfoKHR-fence-parameter~^~core~^~The spec valid usage text states 'fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-fence-parameter)~^~implicit -VALIDATION_ERROR_39e09c01~^~Y~^~None~^~VkFenceGetFdInfoKHR~^~VUID-VkFenceGetFdInfoKHR-handleType-parameter~^~core~^~The spec valid usage text states 'handleType must be a valid VkExternalFenceHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-handleType-parameter)~^~implicit -VALIDATION_ERROR_39e1c40d~^~Y~^~None~^~VkFenceGetFdInfoKHR~^~VUID-VkFenceGetFdInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_39e2b00b~^~Y~^~None~^~VkFenceGetFdInfoKHR~^~VUID-VkFenceGetFdInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3a000b6e~^~N~^~None~^~vkImportFenceFdKHR~^~VUID-vkImportFenceFdKHR-fence-01463~^~core~^~The spec valid usage text states 'fence must not be associated with any queue command that has not yet completed execution on that queue' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportFenceFdKHR-fence-01463)~^~ -VALIDATION_ERROR_3a005601~^~Y~^~None~^~vkImportFenceFdKHR~^~VUID-vkImportFenceFdKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportFenceFdKHR-device-parameter)~^~implicit -VALIDATION_ERROR_3a03a801~^~N~^~None~^~vkImportFenceFdKHR~^~VUID-vkImportFenceFdKHR-pImportFenceFdInfo-parameter~^~core~^~The spec valid usage text states 'pImportFenceFdInfo must be a valid pointer to a valid VkImportFenceFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportFenceFdKHR-pImportFenceFdInfo-parameter)~^~implicit -VALIDATION_ERROR_3a205601~^~Y~^~None~^~vkGetFenceFdKHR~^~VUID-vkGetFenceFdKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetFenceFdKHR-device-parameter)~^~implicit -VALIDATION_ERROR_3a216c01~^~Y~^~None~^~vkGetFenceFdKHR~^~VUID-vkGetFenceFdKHR-pFd-parameter~^~core~^~The spec valid usage text states 'pFd must be a valid pointer to a int value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetFenceFdKHR-pFd-parameter)~^~implicit -VALIDATION_ERROR_3a239e01~^~N~^~None~^~vkGetFenceFdKHR~^~VUID-vkGetFenceFdKHR-pGetFdInfo-parameter~^~core~^~The spec valid usage text states 'pGetFdInfo must be a valid pointer to a valid VkFenceGetFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetFenceFdKHR-pGetFdInfo-parameter)~^~implicit -VALIDATION_ERROR_3a400b62~^~N~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-handleType-01457~^~core~^~The spec valid usage text states 'handleType must be a value included in the Handle Types Supported by VkImportFenceWin32HandleInfoKHR table.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-01457)~^~ -VALIDATION_ERROR_3a400b64~^~N~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-handleType-01458~^~core~^~The spec valid usage text states 'The fence from which handleType or name was exported must have been created on the same underlying physical device as fence.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-01458)~^~ -VALIDATION_ERROR_3a400b66~^~N~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-handleType-01459~^~core~^~The spec valid usage text states 'If handleType is not VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR, name must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-01459)~^~ -VALIDATION_ERROR_3a400b68~^~N~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-handleType-01460~^~core~^~The spec valid usage text states 'If handleType is not 0 and handle is NULL, name must name a valid synchronization primitive of the type specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-01460)~^~ -VALIDATION_ERROR_3a400b6a~^~N~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-handleType-01461~^~core~^~The spec valid usage text states 'If handleType is not 0 and name is NULL, handle must be a valid handle of the type specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-01461)~^~ -VALIDATION_ERROR_3a400b6c~^~N~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-handle-01462~^~core~^~The spec valid usage text states 'If handle is not NULL, name must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handle-01462)~^~ -VALIDATION_ERROR_3a400c06~^~N~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-handle-01539~^~core~^~The spec valid usage text states 'If handle is not NULL, it must obey any requirements listed for handleType in external fence handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handle-01539)~^~ -VALIDATION_ERROR_3a400c08~^~N~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-name-01540~^~core~^~The spec valid usage text states 'If name is not NULL, it must obey any requirements listed for handleType in external fence handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-name-01540)~^~ -VALIDATION_ERROR_3a408801~^~Y~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-fence-parameter~^~core~^~The spec valid usage text states 'fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-fence-parameter)~^~implicit -VALIDATION_ERROR_3a409001~^~Y~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkFenceImportFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-flags-parameter)~^~implicit -VALIDATION_ERROR_3a409c01~^~Y~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-handleType-parameter~^~core~^~The spec valid usage text states 'If handleType is not 0, handleType must be a valid VkExternalFenceHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-parameter)~^~implicit -VALIDATION_ERROR_3a41c40d~^~Y~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3a42b00b~^~Y~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3a600b4e~^~N~^~None~^~VkExportFenceWin32HandleInfoKHR~^~VUID-VkExportFenceWin32HandleInfoKHR-handleTypes-01447~^~core~^~The spec valid usage text states 'If VkExportFenceCreateInfoKHR::handleTypes does not include VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR, VkExportFenceWin32HandleInfoKHR must not be in the pNext chain of VkFenceCreateInfo.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportFenceWin32HandleInfoKHR-handleTypes-01447)~^~ -VALIDATION_ERROR_3a60f401~^~N~^~None~^~VkExportFenceWin32HandleInfoKHR~^~VUID-VkExportFenceWin32HandleInfoKHR-pAttributes-parameter~^~core~^~The spec valid usage text states 'If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportFenceWin32HandleInfoKHR-pAttributes-parameter)~^~implicit -VALIDATION_ERROR_3a61c40d~^~N~^~None~^~VkExportFenceWin32HandleInfoKHR~^~VUID-VkExportFenceWin32HandleInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportFenceWin32HandleInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3a62b00b~^~N~^~None~^~VkExportFenceWin32HandleInfoKHR~^~VUID-VkExportFenceWin32HandleInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportFenceWin32HandleInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3a800b50~^~N~^~None~^~VkFenceGetWin32HandleInfoKHR~^~VUID-VkFenceGetWin32HandleInfoKHR-handleType-01448~^~core~^~The spec valid usage text states 'handleType must have been included in VkExportFenceCreateInfoKHR::handleTypes when the fence's current payload was created.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-01448)~^~ -VALIDATION_ERROR_3a800b52~^~N~^~None~^~VkFenceGetWin32HandleInfoKHR~^~VUID-VkFenceGetWin32HandleInfoKHR-handleType-01449~^~core~^~The spec valid usage text states 'If handleType is defined as an NT handle, vkGetFenceWin32HandleKHR must be called no more than once for each valid unique combination of fence and handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-01449)~^~ -VALIDATION_ERROR_3a800b54~^~N~^~None~^~VkFenceGetWin32HandleInfoKHR~^~VUID-VkFenceGetWin32HandleInfoKHR-fence-01450~^~core~^~The spec valid usage text states 'fence must not currently have its payload replaced by an imported payload as described below in Importing Fence Payloads unless that imported payload's handle type was included in VkExternalFencePropertiesKHR::exportFromImportedHandleTypes for handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-fence-01450)~^~ -VALIDATION_ERROR_3a800b56~^~N~^~None~^~VkFenceGetWin32HandleInfoKHR~^~VUID-VkFenceGetWin32HandleInfoKHR-handleType-01451~^~core~^~The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, fence must be signaled, or have an associated fence signal operation pending execution.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-01451)~^~ -VALIDATION_ERROR_3a800b58~^~N~^~None~^~VkFenceGetWin32HandleInfoKHR~^~VUID-VkFenceGetWin32HandleInfoKHR-handleType-01452~^~core~^~The spec valid usage text states 'handleType must be defined as an NT handle or a global share handle.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-01452)~^~ -VALIDATION_ERROR_3a808801~^~Y~^~None~^~VkFenceGetWin32HandleInfoKHR~^~VUID-VkFenceGetWin32HandleInfoKHR-fence-parameter~^~core~^~The spec valid usage text states 'fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-fence-parameter)~^~implicit -VALIDATION_ERROR_3a809c01~^~Y~^~None~^~VkFenceGetWin32HandleInfoKHR~^~VUID-VkFenceGetWin32HandleInfoKHR-handleType-parameter~^~core~^~The spec valid usage text states 'handleType must be a valid VkExternalFenceHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-parameter)~^~implicit -VALIDATION_ERROR_3a81c40d~^~Y~^~None~^~VkFenceGetWin32HandleInfoKHR~^~VUID-VkFenceGetWin32HandleInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3a82b00b~^~Y~^~None~^~VkFenceGetWin32HandleInfoKHR~^~VUID-VkFenceGetWin32HandleInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3aa05601~^~Y~^~None~^~vkImportFenceWin32HandleKHR~^~VUID-vkImportFenceWin32HandleKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportFenceWin32HandleKHR-device-parameter)~^~implicit -VALIDATION_ERROR_3aa3aa01~^~N~^~None~^~vkImportFenceWin32HandleKHR~^~VUID-vkImportFenceWin32HandleKHR-pImportFenceWin32HandleInfo-parameter~^~core~^~The spec valid usage text states 'pImportFenceWin32HandleInfo must be a valid pointer to a valid VkImportFenceWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportFenceWin32HandleKHR-pImportFenceWin32HandleInfo-parameter)~^~implicit -VALIDATION_ERROR_3ac05601~^~Y~^~None~^~vkGetFenceWin32HandleKHR~^~VUID-vkGetFenceWin32HandleKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetFenceWin32HandleKHR-device-parameter)~^~implicit -VALIDATION_ERROR_3ac17c01~^~Y~^~None~^~vkGetFenceWin32HandleKHR~^~VUID-vkGetFenceWin32HandleKHR-pHandle-parameter~^~core~^~The spec valid usage text states 'pHandle must be a valid pointer to a HANDLE value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetFenceWin32HandleKHR-pHandle-parameter)~^~implicit -VALIDATION_ERROR_3ac3a001~^~N~^~None~^~vkGetFenceWin32HandleKHR~^~VUID-vkGetFenceWin32HandleKHR-pGetWin32HandleInfo-parameter~^~core~^~The spec valid usage text states 'pGetWin32HandleInfo must be a valid pointer to a valid VkFenceGetWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetFenceWin32HandleKHR-pGetWin32HandleInfo-parameter)~^~implicit -VALIDATION_ERROR_3ae09c01~^~Y~^~None~^~VkSemaphoreGetFdInfoKHR~^~VUID-VkSemaphoreGetFdInfoKHR-handleType-parameter~^~core~^~The spec valid usage text states 'handleType must be a valid VkExternalSemaphoreHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-handleType-parameter)~^~implicit -VALIDATION_ERROR_3ae1c40d~^~Y~^~None~^~VkSemaphoreGetFdInfoKHR~^~VUID-VkSemaphoreGetFdInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3ae2b00b~^~Y~^~None~^~VkSemaphoreGetFdInfoKHR~^~VUID-VkSemaphoreGetFdInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3ae2b801~^~Y~^~None~^~VkSemaphoreGetFdInfoKHR~^~VUID-VkSemaphoreGetFdInfoKHR-semaphore-parameter~^~core~^~The spec valid usage text states 'semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-semaphore-parameter)~^~implicit -VALIDATION_ERROR_3b009c01~^~Y~^~None~^~VkSemaphoreGetWin32HandleInfoKHR~^~VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-parameter~^~core~^~The spec valid usage text states 'handleType must be a valid VkExternalSemaphoreHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-parameter)~^~implicit -VALIDATION_ERROR_3b01c40d~^~Y~^~None~^~VkSemaphoreGetWin32HandleInfoKHR~^~VUID-VkSemaphoreGetWin32HandleInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3b02b00b~^~Y~^~None~^~VkSemaphoreGetWin32HandleInfoKHR~^~VUID-VkSemaphoreGetWin32HandleInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3b02b801~^~Y~^~None~^~VkSemaphoreGetWin32HandleInfoKHR~^~VUID-VkSemaphoreGetWin32HandleInfoKHR-semaphore-parameter~^~core~^~The spec valid usage text states 'semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-semaphore-parameter)~^~implicit -VALIDATION_ERROR_3b209c01~^~Y~^~None~^~VkMemoryGetFdInfoKHR~^~VUID-VkMemoryGetFdInfoKHR-handleType-parameter~^~core~^~The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-handleType-parameter)~^~implicit -VALIDATION_ERROR_3b20c601~^~Y~^~None~^~VkMemoryGetFdInfoKHR~^~VUID-VkMemoryGetFdInfoKHR-memory-parameter~^~core~^~The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-memory-parameter)~^~implicit -VALIDATION_ERROR_3b21c40d~^~Y~^~None~^~VkMemoryGetFdInfoKHR~^~VUID-VkMemoryGetFdInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3b22b00b~^~Y~^~None~^~VkMemoryGetFdInfoKHR~^~VUID-VkMemoryGetFdInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3b409c01~^~Y~^~None~^~VkMemoryGetWin32HandleInfoKHR~^~VUID-VkMemoryGetWin32HandleInfoKHR-handleType-parameter~^~core~^~The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-handleType-parameter)~^~implicit -VALIDATION_ERROR_3b40c601~^~Y~^~None~^~VkMemoryGetWin32HandleInfoKHR~^~VUID-VkMemoryGetWin32HandleInfoKHR-memory-parameter~^~core~^~The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-memory-parameter)~^~implicit -VALIDATION_ERROR_3b41c40d~^~Y~^~None~^~VkMemoryGetWin32HandleInfoKHR~^~VUID-VkMemoryGetWin32HandleInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3b42b00b~^~Y~^~None~^~VkMemoryGetWin32HandleInfoKHR~^~VUID-VkMemoryGetWin32HandleInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3b61c40d~^~N~^~None~^~VkMemoryDedicatedRequirementsKHR~^~VUID-VkMemoryDedicatedRequirementsKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedRequirementsKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3b62b00b~^~N~^~None~^~VkMemoryDedicatedRequirementsKHR~^~VUID-VkMemoryDedicatedRequirementsKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedRequirementsKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3b800009~^~N~^~None~^~VkMemoryDedicatedAllocateInfoKHR~^~VUID-VkMemoryDedicatedAllocateInfoKHR-commonparent~^~core~^~The spec valid usage text states 'Both of buffer, and image that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-commonparent)~^~implicit -VALIDATION_ERROR_3b800b30~^~N~^~None~^~VkMemoryDedicatedAllocateInfoKHR~^~VUID-VkMemoryDedicatedAllocateInfoKHR-image-01432~^~core~^~The spec valid usage text states 'At least one of image and buffer must be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-image-01432)~^~ -VALIDATION_ERROR_3b800b32~^~N~^~None~^~VkMemoryDedicatedAllocateInfoKHR~^~VUID-VkMemoryDedicatedAllocateInfoKHR-image-01433~^~core~^~The spec valid usage text states 'If image is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-image-01433)~^~ -VALIDATION_ERROR_3b800b34~^~N~^~None~^~VkMemoryDedicatedAllocateInfoKHR~^~VUID-VkMemoryDedicatedAllocateInfoKHR-image-01434~^~core~^~The spec valid usage text states 'If image is not VK_NULL_HANDLE, image must have been created without VK_IMAGE_CREATE_SPARSE_BINDING_BIT set in VkImageCreateInfo::flags' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-image-01434)~^~ -VALIDATION_ERROR_3b800b36~^~N~^~None~^~VkMemoryDedicatedAllocateInfoKHR~^~VUID-VkMemoryDedicatedAllocateInfoKHR-buffer-01435~^~core~^~The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-buffer-01435)~^~ -VALIDATION_ERROR_3b800b38~^~N~^~None~^~VkMemoryDedicatedAllocateInfoKHR~^~VUID-VkMemoryDedicatedAllocateInfoKHR-buffer-01436~^~core~^~The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, buffer must have been created without VK_BUFFER_CREATE_SPARSE_BINDING_BIT set in VkBufferCreateInfo::flags' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-buffer-01436)~^~ -VALIDATION_ERROR_3b800b3a~^~N~^~None~^~VkMemoryDedicatedAllocateInfoKHR~^~VUID-VkMemoryDedicatedAllocateInfoKHR-image-01437~^~(VK_KHR_external_memory_win32,VK_KHR_external_memory_fd)~^~The spec valid usage text states 'If image is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation, the memory being imported must also be a dedicated image allocation and image must be identical to the image associated with the imported memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-image-01437)~^~ -VALIDATION_ERROR_3b800b3c~^~N~^~None~^~VkMemoryDedicatedAllocateInfoKHR~^~VUID-VkMemoryDedicatedAllocateInfoKHR-buffer-01438~^~(VK_KHR_external_memory_win32,VK_KHR_external_memory_fd)~^~The spec valid usage text states 'If buffer is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation, the memory being imported must also be a dedicated buffer allocation and buffer must be identical to the buffer associated with the imported memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-buffer-01438)~^~ -VALIDATION_ERROR_3b801a01~^~N~^~None~^~VkMemoryDedicatedAllocateInfoKHR~^~VUID-VkMemoryDedicatedAllocateInfoKHR-buffer-parameter~^~core~^~The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-buffer-parameter)~^~implicit -VALIDATION_ERROR_3b80a001~^~N~^~None~^~VkMemoryDedicatedAllocateInfoKHR~^~VUID-VkMemoryDedicatedAllocateInfoKHR-image-parameter~^~core~^~The spec valid usage text states 'If image is not VK_NULL_HANDLE, image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-image-parameter)~^~implicit -VALIDATION_ERROR_3b81c40d~^~N~^~None~^~VkMemoryDedicatedAllocateInfoKHR~^~VUID-VkMemoryDedicatedAllocateInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3b82b00b~^~N~^~None~^~VkMemoryDedicatedAllocateInfoKHR~^~VUID-VkMemoryDedicatedAllocateInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3ba01a01~^~Y~^~None~^~VkBufferMemoryRequirementsInfo2KHR~^~VUID-VkBufferMemoryRequirementsInfo2KHR-buffer-parameter~^~core~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryRequirementsInfo2KHR-buffer-parameter)~^~implicit -VALIDATION_ERROR_3ba1c40d~^~Y~^~None~^~VkBufferMemoryRequirementsInfo2KHR~^~VUID-VkBufferMemoryRequirementsInfo2KHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryRequirementsInfo2KHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3ba2b00b~^~Y~^~None~^~VkBufferMemoryRequirementsInfo2KHR~^~VUID-VkBufferMemoryRequirementsInfo2KHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryRequirementsInfo2KHR-sType-sType)~^~implicit -VALIDATION_ERROR_3bc00c6a~^~N~^~None~^~VkImageMemoryRequirementsInfo2KHR~^~VUID-VkImageMemoryRequirementsInfo2KHR-image-01589~^~core~^~The spec valid usage text states 'If image was created with a multi-planar format and the VK_IMAGE_CREATE_DISJOINT_BIT_KHR flag, there must be a VkImagePlaneMemoryRequirementsInfoKHR in the pNext chain of the VkImageMemoryRequirementsInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2KHR-image-01589)~^~ -VALIDATION_ERROR_3bc00c6c~^~N~^~None~^~VkImageMemoryRequirementsInfo2KHR~^~VUID-VkImageMemoryRequirementsInfo2KHR-image-01590~^~core~^~The spec valid usage text states 'If image was not created with the VK_IMAGE_CREATE_DISJOINT_BIT_KHR flag, there must not be a VkImagePlaneMemoryRequirementsInfoKHR in the pNext chain of the VkImageMemoryRequirementsInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2KHR-image-01590)~^~ -VALIDATION_ERROR_3bc00c6e~^~N~^~None~^~VkImageMemoryRequirementsInfo2KHR~^~VUID-VkImageMemoryRequirementsInfo2KHR-image-01591~^~core~^~The spec valid usage text states 'If image was created with a single-plane format, there must not be a VkImagePlaneMemoryRequirementsInfoKHR in the pNext chain of the VkImageMemoryRequirementsInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2KHR-image-01591)~^~ -VALIDATION_ERROR_3bc0a001~^~Y~^~None~^~VkImageMemoryRequirementsInfo2KHR~^~VUID-VkImageMemoryRequirementsInfo2KHR-image-parameter~^~core~^~The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2KHR-image-parameter)~^~implicit -VALIDATION_ERROR_3bc1c40d~^~Y~^~None~^~VkImageMemoryRequirementsInfo2KHR~^~VUID-VkImageMemoryRequirementsInfo2KHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkImagePlaneMemoryRequirementsInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2KHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3bc2b00b~^~Y~^~None~^~VkImageMemoryRequirementsInfo2KHR~^~VUID-VkImageMemoryRequirementsInfo2KHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2KHR-sType-sType)~^~implicit -VALIDATION_ERROR_3c01c40d~^~N~^~None~^~VkMemoryRequirements2KHR~^~VUID-VkMemoryRequirements2KHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkMemoryDedicatedRequirementsKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryRequirements2KHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3c02b00b~^~Y~^~None~^~VkMemoryRequirements2KHR~^~VUID-VkMemoryRequirements2KHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryRequirements2KHR-sType-sType)~^~implicit -VALIDATION_ERROR_3c405601~^~Y~^~None~^~vkGetImageMemoryRequirements2KHR~^~VUID-vkGetImageMemoryRequirements2KHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageMemoryRequirements2KHR-device-parameter)~^~implicit -VALIDATION_ERROR_3c41b401~^~N~^~None~^~vkGetImageMemoryRequirements2KHR~^~VUID-vkGetImageMemoryRequirements2KHR-pMemoryRequirements-parameter~^~core~^~The spec valid usage text states 'pMemoryRequirements must be a valid pointer to a VkMemoryRequirements2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageMemoryRequirements2KHR-pMemoryRequirements-parameter)~^~implicit -VALIDATION_ERROR_3c439c01~^~N~^~None~^~vkGetImageMemoryRequirements2KHR~^~VUID-vkGetImageMemoryRequirements2KHR-pInfo-parameter~^~core~^~The spec valid usage text states 'pInfo must be a valid pointer to a valid VkImageMemoryRequirementsInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageMemoryRequirements2KHR-pInfo-parameter)~^~implicit -VALIDATION_ERROR_3c605601~^~Y~^~None~^~vkGetBufferMemoryRequirements2KHR~^~VUID-vkGetBufferMemoryRequirements2KHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetBufferMemoryRequirements2KHR-device-parameter)~^~implicit -VALIDATION_ERROR_3c61b401~^~N~^~None~^~vkGetBufferMemoryRequirements2KHR~^~VUID-vkGetBufferMemoryRequirements2KHR-pMemoryRequirements-parameter~^~core~^~The spec valid usage text states 'pMemoryRequirements must be a valid pointer to a VkMemoryRequirements2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetBufferMemoryRequirements2KHR-pMemoryRequirements-parameter)~^~implicit -VALIDATION_ERROR_3c639c01~^~N~^~None~^~vkGetBufferMemoryRequirements2KHR~^~VUID-vkGetBufferMemoryRequirements2KHR-pInfo-parameter~^~core~^~The spec valid usage text states 'pInfo must be a valid pointer to a valid VkBufferMemoryRequirementsInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetBufferMemoryRequirements2KHR-pInfo-parameter)~^~implicit -VALIDATION_ERROR_3ca2b00b~^~N~^~None~^~VkPhysicalDevice16BitStorageFeaturesKHR~^~VUID-VkPhysicalDevice16BitStorageFeaturesKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDevice16BitStorageFeaturesKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3cc00b2e~^~N~^~None~^~VkPhysicalDeviceVariablePointerFeaturesKHR~^~VUID-VkPhysicalDeviceVariablePointerFeaturesKHR-variablePointers-01431~^~core~^~The spec valid usage text states 'If variablePointers is enabled then variablePointersStorageBuffer must also be enabled.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceVariablePointerFeaturesKHR-variablePointers-01431)~^~ -VALIDATION_ERROR_3cc1c40d~^~N~^~None~^~VkPhysicalDeviceVariablePointerFeaturesKHR~^~VUID-VkPhysicalDeviceVariablePointerFeaturesKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceVariablePointerFeaturesKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3cc2b00b~^~N~^~None~^~VkPhysicalDeviceVariablePointerFeaturesKHR~^~VUID-VkPhysicalDeviceVariablePointerFeaturesKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceVariablePointerFeaturesKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3ce00bec~^~N~^~None~^~VkSampleLocationsInfoEXT~^~VUID-VkSampleLocationsInfoEXT-sampleLocationsPerPixel-01526~^~core~^~The spec valid usage text states 'sampleLocationsPerPixel must be a bit value that is set in VkPhysicalDeviceSampleLocationsPropertiesEXT::sampleLocationSampleCounts' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sampleLocationsPerPixel-01526)~^~ -VALIDATION_ERROR_3ce00bee~^~N~^~None~^~VkSampleLocationsInfoEXT~^~VUID-VkSampleLocationsInfoEXT-sampleLocationsCount-01527~^~core~^~The spec valid usage text states 'sampleLocationsCount must equal sampleLocationsPerPixel {times} sampleLocationGridSize.width {times} sampleLocationGridSize.height' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sampleLocationsCount-01527)~^~ -VALIDATION_ERROR_3ce1c40d~^~Y~^~None~^~VkSampleLocationsInfoEXT~^~VUID-VkSampleLocationsInfoEXT-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-pNext-pNext)~^~implicit -VALIDATION_ERROR_3ce2b00b~^~Y~^~None~^~VkSampleLocationsInfoEXT~^~VUID-VkSampleLocationsInfoEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sType-sType)~^~implicit -VALIDATION_ERROR_3ce3b201~^~Y~^~None~^~VkSampleLocationsInfoEXT~^~VUID-VkSampleLocationsInfoEXT-sampleLocationsPerPixel-parameter~^~core~^~The spec valid usage text states 'sampleLocationsPerPixel must be a valid VkSampleCountFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sampleLocationsPerPixel-parameter)~^~implicit -VALIDATION_ERROR_3ce3b41b~^~Y~^~None~^~VkSampleLocationsInfoEXT~^~VUID-VkSampleLocationsInfoEXT-sampleLocationsCount-arraylength~^~core~^~The spec valid usage text states 'sampleLocationsCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sampleLocationsCount-arraylength)~^~implicit -VALIDATION_ERROR_3ce3b601~^~Y~^~None~^~VkSampleLocationsInfoEXT~^~VUID-VkSampleLocationsInfoEXT-pSampleLocations-parameter~^~core~^~The spec valid usage text states 'pSampleLocations must be a valid pointer to an array of sampleLocationsCount VkSampleLocationEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-pSampleLocations-parameter)~^~implicit -VALIDATION_ERROR_3d01c40d~^~N~^~None~^~VkRenderPassSampleLocationsBeginInfoEXT~^~VUID-VkRenderPassSampleLocationsBeginInfoEXT-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassSampleLocationsBeginInfoEXT-pNext-pNext)~^~implicit -VALIDATION_ERROR_3d02b00b~^~N~^~None~^~VkRenderPassSampleLocationsBeginInfoEXT~^~VUID-VkRenderPassSampleLocationsBeginInfoEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassSampleLocationsBeginInfoEXT-sType-sType)~^~implicit -VALIDATION_ERROR_3d03ba01~^~N~^~None~^~VkRenderPassSampleLocationsBeginInfoEXT~^~VUID-VkRenderPassSampleLocationsBeginInfoEXT-pAttachmentInitialSampleLocations-parameter~^~core~^~The spec valid usage text states 'If attachmentInitialSampleLocationsCount is not 0, pAttachmentInitialSampleLocations must be a valid pointer to an array of attachmentInitialSampleLocationsCount valid VkAttachmentSampleLocationsEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassSampleLocationsBeginInfoEXT-pAttachmentInitialSampleLocations-parameter)~^~implicit -VALIDATION_ERROR_3d03be01~^~N~^~None~^~VkRenderPassSampleLocationsBeginInfoEXT~^~VUID-VkRenderPassSampleLocationsBeginInfoEXT-pSubpassSampleLocations-parameter~^~core~^~The spec valid usage text states 'If postSubpassSampleLocationsCount is not 0, pSubpassSampleLocations must be a pointer to an array of postSubpassSampleLocationsCount valid VkSubpassSampleLocationsEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassSampleLocationsBeginInfoEXT-pSubpassSampleLocations-parameter)~^~implicit -VALIDATION_ERROR_3d03e801~^~N~^~None~^~VkRenderPassSampleLocationsBeginInfoEXT~^~VUID-VkRenderPassSampleLocationsBeginInfoEXT-pPostSubpassSampleLocations-parameter~^~core~^~The spec valid usage text states 'If postSubpassSampleLocationsCount is not 0, pPostSubpassSampleLocations must be a valid pointer to an array of postSubpassSampleLocationsCount valid VkSubpassSampleLocationsEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassSampleLocationsBeginInfoEXT-pPostSubpassSampleLocations-parameter)~^~implicit -VALIDATION_ERROR_3d21c40d~^~N~^~None~^~VkPipelineSampleLocationsStateCreateInfoEXT~^~VUID-VkPipelineSampleLocationsStateCreateInfoEXT-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineSampleLocationsStateCreateInfoEXT-pNext-pNext)~^~implicit -VALIDATION_ERROR_3d22b00b~^~N~^~None~^~VkPipelineSampleLocationsStateCreateInfoEXT~^~VUID-VkPipelineSampleLocationsStateCreateInfoEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineSampleLocationsStateCreateInfoEXT-sType-sType)~^~implicit -VALIDATION_ERROR_3d23c601~^~N~^~None~^~VkPipelineSampleLocationsStateCreateInfoEXT~^~VUID-VkPipelineSampleLocationsStateCreateInfoEXT-sampleLocationsInfo-parameter~^~core~^~The spec valid usage text states 'sampleLocationsInfo must be a valid VkSampleLocationsInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineSampleLocationsStateCreateInfoEXT-sampleLocationsInfo-parameter)~^~implicit -VALIDATION_ERROR_3d41c40d~^~N~^~None~^~VkPhysicalDeviceSampleLocationsPropertiesEXT~^~VUID-VkPhysicalDeviceSampleLocationsPropertiesEXT-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSampleLocationsPropertiesEXT-pNext-pNext)~^~implicit -VALIDATION_ERROR_3d42b00b~^~N~^~None~^~VkPhysicalDeviceSampleLocationsPropertiesEXT~^~VUID-VkPhysicalDeviceSampleLocationsPropertiesEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSampleLocationsPropertiesEXT-sType-sType)~^~implicit -VALIDATION_ERROR_3d61c40d~^~N~^~None~^~VkMultisamplePropertiesEXT~^~VUID-VkMultisamplePropertiesEXT-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMultisamplePropertiesEXT-pNext-pNext)~^~implicit -VALIDATION_ERROR_3d62b00b~^~Y~^~None~^~VkMultisamplePropertiesEXT~^~VUID-VkMultisamplePropertiesEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMultisamplePropertiesEXT-sType-sType)~^~implicit -VALIDATION_ERROR_3d827a01~^~Y~^~None~^~vkGetPhysicalDeviceMultisamplePropertiesEXT~^~VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-physicalDevice-parameter~^~core~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-physicalDevice-parameter)~^~implicit -VALIDATION_ERROR_3d82b401~^~Y~^~None~^~vkGetPhysicalDeviceMultisamplePropertiesEXT~^~VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-samples-parameter~^~core~^~The spec valid usage text states 'samples must be a valid VkSampleCountFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-samples-parameter)~^~implicit -VALIDATION_ERROR_3d83ca01~^~N~^~None~^~vkGetPhysicalDeviceMultisamplePropertiesEXT~^~VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-pMultisampleProperties-parameter~^~core~^~The spec valid usage text states 'pMultisampleProperties must be a valid pointer to a VkMultisamplePropertiesEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-pMultisampleProperties-parameter)~^~implicit -VALIDATION_ERROR_3da00bfc~^~N~^~None~^~VkValidationCacheCreateInfoEXT~^~VUID-VkValidationCacheCreateInfoEXT-initialDataSize-01534~^~core~^~The spec valid usage text states 'If initialDataSize is not 0, it must be equal to the size of pInitialData, as returned by vkGetValidationCacheDataEXT when pInitialData was originally retrieved' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-initialDataSize-01534)~^~ -VALIDATION_ERROR_3da00bfe~^~N~^~None~^~VkValidationCacheCreateInfoEXT~^~VUID-VkValidationCacheCreateInfoEXT-initialDataSize-01535~^~core~^~The spec valid usage text states 'If initialDataSize is not 0, pInitialData must have been retrieved from a previous call to vkGetValidationCacheDataEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-initialDataSize-01535)~^~ -VALIDATION_ERROR_3da09005~^~Y~^~None~^~VkValidationCacheCreateInfoEXT~^~VUID-VkValidationCacheCreateInfoEXT-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-flags-zerobitmask)~^~implicit -VALIDATION_ERROR_3da19601~^~Y~^~None~^~VkValidationCacheCreateInfoEXT~^~VUID-VkValidationCacheCreateInfoEXT-pInitialData-parameter~^~core~^~The spec valid usage text states 'If initialDataSize is not 0, pInitialData must be a valid pointer to an array of initialDataSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-pInitialData-parameter)~^~implicit -VALIDATION_ERROR_3da1c40d~^~Y~^~None~^~VkValidationCacheCreateInfoEXT~^~VUID-VkValidationCacheCreateInfoEXT-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-pNext-pNext)~^~implicit -VALIDATION_ERROR_3da2b00b~^~Y~^~None~^~VkValidationCacheCreateInfoEXT~^~VUID-VkValidationCacheCreateInfoEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-sType-sType)~^~implicit -VALIDATION_ERROR_3dc1c40d~^~N~^~None~^~VkShaderModuleValidationCacheCreateInfoEXT~^~VUID-VkShaderModuleValidationCacheCreateInfoEXT-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkShaderModuleValidationCacheCreateInfoEXT-pNext-pNext)~^~implicit -VALIDATION_ERROR_3dc2b00b~^~N~^~None~^~VkShaderModuleValidationCacheCreateInfoEXT~^~VUID-VkShaderModuleValidationCacheCreateInfoEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkShaderModuleValidationCacheCreateInfoEXT-sType-sType)~^~implicit -VALIDATION_ERROR_3dc3c401~^~N~^~None~^~VkShaderModuleValidationCacheCreateInfoEXT~^~VUID-VkShaderModuleValidationCacheCreateInfoEXT-validationCache-parameter~^~core~^~The spec valid usage text states 'validationCache must be a valid VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkShaderModuleValidationCacheCreateInfoEXT-validationCache-parameter)~^~implicit -VALIDATION_ERROR_3de05601~^~Y~^~None~^~vkCreateValidationCacheEXT~^~VUID-vkCreateValidationCacheEXT-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateValidationCacheEXT-device-parameter)~^~implicit -VALIDATION_ERROR_3de0ec01~^~N~^~None~^~vkCreateValidationCacheEXT~^~VUID-vkCreateValidationCacheEXT-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateValidationCacheEXT-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_3de11e01~^~N~^~None~^~vkCreateValidationCacheEXT~^~VUID-vkCreateValidationCacheEXT-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkValidationCacheCreateInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateValidationCacheEXT-pCreateInfo-parameter)~^~implicit -VALIDATION_ERROR_3de3c201~^~Y~^~None~^~vkCreateValidationCacheEXT~^~VUID-vkCreateValidationCacheEXT-pValidationCache-parameter~^~core~^~The spec valid usage text states 'pValidationCache must be a valid pointer to a VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateValidationCacheEXT-pValidationCache-parameter)~^~implicit -VALIDATION_ERROR_3e005601~^~Y~^~None~^~vkGetValidationCacheDataEXT~^~VUID-vkGetValidationCacheDataEXT-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-device-parameter)~^~implicit -VALIDATION_ERROR_3e012201~^~Y~^~None~^~vkGetValidationCacheDataEXT~^~VUID-vkGetValidationCacheDataEXT-pData-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pDataSize is not 0, and pData is not NULL, pData must be a valid pointer to an array of pDataSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-pData-parameter)~^~implicit -VALIDATION_ERROR_3e012401~^~N~^~None~^~vkGetValidationCacheDataEXT~^~VUID-vkGetValidationCacheDataEXT-pDataSize-parameter~^~core~^~The spec valid usage text states 'pDataSize must be a valid pointer to a size_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-pDataSize-parameter)~^~implicit -VALIDATION_ERROR_3e03c401~^~Y~^~None~^~vkGetValidationCacheDataEXT~^~VUID-vkGetValidationCacheDataEXT-validationCache-parameter~^~core~^~The spec valid usage text states 'validationCache must be a valid VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-validationCache-parameter)~^~implicit -VALIDATION_ERROR_3e03c407~^~Y~^~None~^~vkGetValidationCacheDataEXT~^~VUID-vkGetValidationCacheDataEXT-validationCache-parent~^~core~^~The spec valid usage text states 'validationCache must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-validationCache-parent)~^~implicit -VALIDATION_ERROR_3e200bf0~^~N~^~None~^~vkCmdSetSampleLocationsEXT~^~VUID-vkCmdSetSampleLocationsEXT-None-01528~^~core~^~The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-None-01528)~^~ -VALIDATION_ERROR_3e200bf2~^~N~^~None~^~vkCmdSetSampleLocationsEXT~^~VUID-vkCmdSetSampleLocationsEXT-sampleLocationsPerPixel-01529~^~core~^~The spec valid usage text states 'The sampleLocationsPerPixel member of pSampleLocationsInfo must equal the rasterizationSamples member of the VkPipelineMultisampleStateCreateInfo structure the currently bound graphics pipeline has been created with' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-sampleLocationsPerPixel-01529)~^~ -VALIDATION_ERROR_3e200bf4~^~N~^~None~^~vkCmdSetSampleLocationsEXT~^~VUID-vkCmdSetSampleLocationsEXT-variableSampleLocations-01530~^~core~^~The spec valid usage text states 'If VkPhysicalDeviceSampleLocationsPropertiesEXT::variableSampleLocations is VK_FALSE then the current render pass must have been begun by specifying a VkRenderPassSampleLocationsBeginInfoEXT structure whose pPostSubpassSampleLocations member contains an element with a subpassIndex matching the current subpass index and the sampleLocationsInfo member of that element must match the sample locations state pointed to by pSampleLocationsInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-variableSampleLocations-01530)~^~ -VALIDATION_ERROR_3e202401~^~Y~^~None~^~vkCmdSetSampleLocationsEXT~^~VUID-vkCmdSetSampleLocationsEXT-commandBuffer-parameter~^~core~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-commandBuffer-parameter)~^~implicit -VALIDATION_ERROR_3e202413~^~N~^~None~^~vkCmdSetSampleLocationsEXT~^~VUID-vkCmdSetSampleLocationsEXT-commandBuffer-recording~^~core~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-commandBuffer-recording)~^~implicit -VALIDATION_ERROR_3e202415~^~N~^~None~^~vkCmdSetSampleLocationsEXT~^~VUID-vkCmdSetSampleLocationsEXT-commandBuffer-cmdpool~^~core~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-commandBuffer-cmdpool)~^~implicit -VALIDATION_ERROR_3e23c801~^~N~^~None~^~vkCmdSetSampleLocationsEXT~^~VUID-vkCmdSetSampleLocationsEXT-pSampleLocationsInfo-parameter~^~core~^~The spec valid usage text states 'pSampleLocationsInfo must be a valid pointer to a valid VkSampleLocationsInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-pSampleLocationsInfo-parameter)~^~implicit -VALIDATION_ERROR_3e400c02~^~N~^~None~^~vkDestroyValidationCacheEXT~^~VUID-vkDestroyValidationCacheEXT-validationCache-01537~^~core~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when validationCache was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-validationCache-01537)~^~ -VALIDATION_ERROR_3e400c04~^~N~^~None~^~vkDestroyValidationCacheEXT~^~VUID-vkDestroyValidationCacheEXT-validationCache-01538~^~core~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when validationCache was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-validationCache-01538)~^~ -VALIDATION_ERROR_3e405601~^~Y~^~None~^~vkDestroyValidationCacheEXT~^~VUID-vkDestroyValidationCacheEXT-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-device-parameter)~^~implicit -VALIDATION_ERROR_3e40ec01~^~N~^~None~^~vkDestroyValidationCacheEXT~^~VUID-vkDestroyValidationCacheEXT-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_3e43c401~^~Y~^~None~^~vkDestroyValidationCacheEXT~^~VUID-vkDestroyValidationCacheEXT-validationCache-parameter~^~core~^~The spec valid usage text states 'If validationCache is not VK_NULL_HANDLE, validationCache must be a valid VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-validationCache-parameter)~^~implicit -VALIDATION_ERROR_3e43c407~^~Y~^~None~^~vkDestroyValidationCacheEXT~^~VUID-vkDestroyValidationCacheEXT-validationCache-parent~^~core~^~The spec valid usage text states 'If validationCache is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-validationCache-parent)~^~implicit -VALIDATION_ERROR_3e600c00~^~N~^~None~^~vkMergeValidationCachesEXT~^~VUID-vkMergeValidationCachesEXT-dstCache-01536~^~core~^~The spec valid usage text states 'dstCache must not appear in the list of source caches' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMergeValidationCachesEXT-dstCache-01536)~^~ -VALIDATION_ERROR_3e605601~^~Y~^~None~^~vkMergeValidationCachesEXT~^~VUID-vkMergeValidationCachesEXT-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMergeValidationCachesEXT-device-parameter)~^~implicit -VALIDATION_ERROR_3e606e01~^~Y~^~None~^~vkMergeValidationCachesEXT~^~VUID-vkMergeValidationCachesEXT-dstCache-parameter~^~core~^~The spec valid usage text states 'dstCache must be a valid VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMergeValidationCachesEXT-dstCache-parameter)~^~implicit -VALIDATION_ERROR_3e606e07~^~Y~^~None~^~vkMergeValidationCachesEXT~^~VUID-vkMergeValidationCachesEXT-dstCache-parent~^~core~^~The spec valid usage text states 'dstCache must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMergeValidationCachesEXT-dstCache-parent)~^~implicit -VALIDATION_ERROR_3e623c01~^~Y~^~None~^~vkMergeValidationCachesEXT~^~VUID-vkMergeValidationCachesEXT-pSrcCaches-parameter~^~core~^~The spec valid usage text states 'pSrcCaches must be a valid pointer to an array of srcCacheCount valid VkValidationCacheEXT handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMergeValidationCachesEXT-pSrcCaches-parameter)~^~implicit -VALIDATION_ERROR_3e623c07~^~Y~^~None~^~vkMergeValidationCachesEXT~^~VUID-vkMergeValidationCachesEXT-pSrcCaches-parent~^~core~^~The spec valid usage text states 'Each element of pSrcCaches must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMergeValidationCachesEXT-pSrcCaches-parent)~^~implicit -VALIDATION_ERROR_3e62ca1b~^~N~^~None~^~vkMergeValidationCachesEXT~^~VUID-vkMergeValidationCachesEXT-srcCacheCount-arraylength~^~core~^~The spec valid usage text states 'srcCacheCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMergeValidationCachesEXT-srcCacheCount-arraylength)~^~implicit -VALIDATION_ERROR_3e800bf6~^~N~^~None~^~VkAttachmentSampleLocationsEXT~^~VUID-VkAttachmentSampleLocationsEXT-attachmentIndex-01531~^~core~^~The spec valid usage text states 'attachmentIndex must be less than the attachmentCount specified in VkRenderPassCreateInfo the render pass specified by VkRenderPassBeginInfo::renderPass was created with' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentSampleLocationsEXT-attachmentIndex-01531)~^~ -VALIDATION_ERROR_3e83c601~^~N~^~None~^~VkAttachmentSampleLocationsEXT~^~VUID-VkAttachmentSampleLocationsEXT-sampleLocationsInfo-parameter~^~core~^~The spec valid usage text states 'sampleLocationsInfo must be a valid VkSampleLocationsInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentSampleLocationsEXT-sampleLocationsInfo-parameter)~^~implicit -VALIDATION_ERROR_3ea00bf8~^~N~^~None~^~VkSubpassSampleLocationsEXT~^~VUID-VkSubpassSampleLocationsEXT-subpassIndex-01532~^~core~^~The spec valid usage text states 'subpassIndex must be less than the subpassCount specified in VkRenderPassCreateInfo the render pass specified by VkRenderPassBeginInfo::pname::renderPass was created with' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassSampleLocationsEXT-subpassIndex-01532)~^~ -VALIDATION_ERROR_3ea3c601~^~N~^~None~^~VkSubpassSampleLocationsEXT~^~VUID-VkSubpassSampleLocationsEXT-sampleLocationsInfo-parameter~^~core~^~The spec valid usage text states 'sampleLocationsInfo must be a valid VkSampleLocationsInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassSampleLocationsEXT-sampleLocationsInfo-parameter)~^~implicit -VALIDATION_ERROR_3ec1c40d~^~N~^~None~^~VkPhysicalDevicePointClippingPropertiesKHR~^~VUID-VkPhysicalDevicePointClippingPropertiesKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDevicePointClippingPropertiesKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3ec2b00b~^~N~^~None~^~VkPhysicalDevicePointClippingPropertiesKHR~^~VUID-VkPhysicalDevicePointClippingPropertiesKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDevicePointClippingPropertiesKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3ee00c01~^~N~^~None~^~VkInputAttachmentAspectReferenceKHR~^~VUID-VkInputAttachmentAspectReferenceKHR-aspectMask-parameter~^~core~^~The spec valid usage text states 'aspectMask must be a valid combination of VkImageAspectFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkInputAttachmentAspectReferenceKHR-aspectMask-parameter)~^~implicit -VALIDATION_ERROR_3ee00c03~^~N~^~None~^~VkInputAttachmentAspectReferenceKHR~^~VUID-VkInputAttachmentAspectReferenceKHR-aspectMask-requiredbitmask~^~core~^~The spec valid usage text states 'aspectMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkInputAttachmentAspectReferenceKHR-aspectMask-requiredbitmask)~^~implicit -VALIDATION_ERROR_3ee00c40~^~N~^~None~^~VkInputAttachmentAspectReferenceKHR~^~VUID-VkInputAttachmentAspectReferenceKHR-pCreateInfo-01568~^~core~^~The spec valid usage text states 'There must be an input attachment at pCreateInfo::pSubpasses[subpass].pInputAttachments[inputAttachment].' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkInputAttachmentAspectReferenceKHR-pCreateInfo-01568)~^~ -VALIDATION_ERROR_3ee00c42~^~N~^~None~^~VkInputAttachmentAspectReferenceKHR~^~VUID-VkInputAttachmentAspectReferenceKHR-None-01569~^~core~^~The spec valid usage text states 'The specified input attachment must have more than one aspect mask.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkInputAttachmentAspectReferenceKHR-None-01569)~^~ -VALIDATION_ERROR_3ee00c44~^~N~^~None~^~VkInputAttachmentAspectReferenceKHR~^~VUID-VkInputAttachmentAspectReferenceKHR-aspectMask-01570~^~core~^~The spec valid usage text states 'aspectMask must be a subset of the aspect masks in the specified input attachment.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkInputAttachmentAspectReferenceKHR-aspectMask-01570)~^~ -VALIDATION_ERROR_3f01c40d~^~N~^~None~^~VkRenderPassInputAttachmentAspectCreateInfoKHR~^~VUID-VkRenderPassInputAttachmentAspectCreateInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassInputAttachmentAspectCreateInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3f02b00b~^~N~^~None~^~VkRenderPassInputAttachmentAspectCreateInfoKHR~^~VUID-VkRenderPassInputAttachmentAspectCreateInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassInputAttachmentAspectCreateInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3f03ce1b~^~N~^~None~^~VkRenderPassInputAttachmentAspectCreateInfoKHR~^~VUID-VkRenderPassInputAttachmentAspectCreateInfoKHR-aspectReferenceCount-arraylength~^~core~^~The spec valid usage text states 'aspectReferenceCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassInputAttachmentAspectCreateInfoKHR-aspectReferenceCount-arraylength)~^~implicit -VALIDATION_ERROR_3f03d001~^~N~^~None~^~VkRenderPassInputAttachmentAspectCreateInfoKHR~^~VUID-VkRenderPassInputAttachmentAspectCreateInfoKHR-pAspectReferences-parameter~^~core~^~The spec valid usage text states 'pAspectReferences must be a valid pointer to an array of aspectReferenceCount valid VkInputAttachmentAspectReferenceKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassInputAttachmentAspectCreateInfoKHR-pAspectReferences-parameter)~^~implicit -VALIDATION_ERROR_3f200c66~^~N~^~None~^~VkImageViewUsageCreateInfoKHR~^~VUID-VkImageViewUsageCreateInfoKHR-usage-01587~^~core~^~The spec valid usage text states 'usage must not include any set bits that were not set in the usage member of the VkImageCreateInfo structure used to create the image this image view is created from.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewUsageCreateInfoKHR-usage-01587)~^~ -VALIDATION_ERROR_3f21c40d~^~N~^~None~^~VkImageViewUsageCreateInfoKHR~^~VUID-VkImageViewUsageCreateInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewUsageCreateInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3f22b00b~^~N~^~None~^~VkImageViewUsageCreateInfoKHR~^~VUID-VkImageViewUsageCreateInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewUsageCreateInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3f230601~^~N~^~None~^~VkImageViewUsageCreateInfoKHR~^~VUID-VkImageViewUsageCreateInfoKHR-usage-parameter~^~core~^~The spec valid usage text states 'usage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewUsageCreateInfoKHR-usage-parameter)~^~implicit -VALIDATION_ERROR_3f230603~^~N~^~None~^~VkImageViewUsageCreateInfoKHR~^~VUID-VkImageViewUsageCreateInfoKHR-usage-requiredbitmask~^~core~^~The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewUsageCreateInfoKHR-usage-requiredbitmask)~^~implicit -VALIDATION_ERROR_3f41c40d~^~N~^~None~^~VkPipelineTessellationDomainOriginStateCreateInfoKHR~^~VUID-VkPipelineTessellationDomainOriginStateCreateInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineTessellationDomainOriginStateCreateInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3f42b00b~^~N~^~None~^~VkPipelineTessellationDomainOriginStateCreateInfoKHR~^~VUID-VkPipelineTessellationDomainOriginStateCreateInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineTessellationDomainOriginStateCreateInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3f43d201~^~N~^~None~^~VkPipelineTessellationDomainOriginStateCreateInfoKHR~^~VUID-VkPipelineTessellationDomainOriginStateCreateInfoKHR-domainOrigin-parameter~^~core~^~The spec valid usage text states 'domainOrigin must be a valid VkTessellationDomainOriginKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineTessellationDomainOriginStateCreateInfoKHR-domainOrigin-parameter)~^~implicit -VALIDATION_ERROR_3f600c54~^~N~^~None~^~VkImageFormatListCreateInfoKHR~^~VUID-VkImageFormatListCreateInfoKHR-viewFormatCount-01578~^~core~^~The spec valid usage text states 'If viewFormatCount is not 0, all of the formats in the pViewFormats array must be compatible with the format specified in the format field of VkImageCreateInfo, as described in the compatibility table.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-viewFormatCount-01578)~^~ -VALIDATION_ERROR_3f600c56~^~N~^~None~^~VkImageFormatListCreateInfoKHR~^~VUID-VkImageFormatListCreateInfoKHR-flags-01579~^~core~^~The spec valid usage text states 'If VkImageCreateInfo::flags does not contain VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, viewFormatCount must be 0 or 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-flags-01579)~^~ -VALIDATION_ERROR_3f600c58~^~N~^~None~^~VkImageFormatListCreateInfoKHR~^~VUID-VkImageFormatListCreateInfoKHR-viewFormatCount-01580~^~core~^~The spec valid usage text states 'If viewFormatCount is not 0, VkImageCreateInfo::format must be in pViewFormats.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-viewFormatCount-01580)~^~ -VALIDATION_ERROR_3f61c40d~^~N~^~None~^~VkImageFormatListCreateInfoKHR~^~VUID-VkImageFormatListCreateInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3f62b00b~^~N~^~None~^~VkImageFormatListCreateInfoKHR~^~VUID-VkImageFormatListCreateInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3f63e401~^~N~^~None~^~VkImageFormatListCreateInfoKHR~^~VUID-VkImageFormatListCreateInfoKHR-pViewFormats-parameter~^~core~^~The spec valid usage text states 'If viewFormatCount is not 0, pViewFormats must be a valid pointer to an array of viewFormatCount valid VkFormat values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-pViewFormats-parameter)~^~implicit -VALIDATION_ERROR_3f800ce2~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfoKHR~^~VUID-VkSamplerYcbcrConversionCreateInfoKHR-format-01649~^~core~^~The spec valid usage text states 'format must not be VK_FORMAT_UNDEFINED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-format-01649)~^~ -VALIDATION_ERROR_3f800ce4~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfoKHR~^~VUID-VkSamplerYcbcrConversionCreateInfoKHR-format-01650~^~core~^~The spec valid usage text states 'format must support VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT_KHR or VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-format-01650)~^~ -VALIDATION_ERROR_3f800ce6~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfoKHR~^~VUID-VkSamplerYcbcrConversionCreateInfoKHR-xChromaOffset-01651~^~core~^~The spec valid usage text states 'If the format does not support VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR, xChromaOffset and yChromaOffset must not be VK_CHROMA_LOCATION_COSITED_EVEN_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-xChromaOffset-01651)~^~ -VALIDATION_ERROR_3f800ce8~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfoKHR~^~VUID-VkSamplerYcbcrConversionCreateInfoKHR-xChromaOffset-01652~^~core~^~The spec valid usage text states 'If the format does not support VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT_KHR, xChromaOffset and yChromaOffset must not be VK_CHROMA_LOCATION_MIDPOINT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-xChromaOffset-01652)~^~ -VALIDATION_ERROR_3f800cea~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfoKHR~^~VUID-VkSamplerYcbcrConversionCreateInfoKHR-format-01653~^~core~^~The spec valid usage text states 'format must represent unsigned normalized values (i.e. the format must be a UNORM format)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-format-01653)~^~ -VALIDATION_ERROR_3f800cec~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfoKHR~^~VUID-VkSamplerYcbcrConversionCreateInfoKHR-None-01654~^~core~^~The spec valid usage text states 'If the format has a _422 or _420 suffix:' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-None-01654)~^~ -VALIDATION_ERROR_3f800cee~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfoKHR~^~VUID-VkSamplerYcbcrConversionCreateInfoKHR-ycbcrModel-01655~^~core~^~The spec valid usage text states 'If ycbcrModel is not VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR, then components.r, components.g, and components.b must correspond to channels of the format; that is, components.r, components.g, and components.b must not be VK_COMPONENT_SWIZZLE_ZERO or VK_COMPONENT_SWIZZLE_ONE, and must not correspond to a channel which contains zero or one as a consequence of conversion to RGBA' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-ycbcrModel-01655)~^~ -VALIDATION_ERROR_3f800cf0~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfoKHR~^~VUID-VkSamplerYcbcrConversionCreateInfoKHR-forceExplicitReconstruction-01656~^~core~^~The spec valid usage text states 'If the format does not support VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR, forceExplicitReconstruction must be FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-forceExplicitReconstruction-01656)~^~ -VALIDATION_ERROR_3f800cf2~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfoKHR~^~VUID-VkSamplerYcbcrConversionCreateInfoKHR-chromaFilter-01657~^~core~^~The spec valid usage text states 'If the format does not support VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR, chromaFilter must be VK_FILTER_NEAREST' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-chromaFilter-01657)~^~ -VALIDATION_ERROR_3f802c01~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfoKHR~^~VUID-VkSamplerYcbcrConversionCreateInfoKHR-components-parameter~^~core~^~The spec valid usage text states 'components must be a valid VkComponentMapping structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-components-parameter)~^~implicit -VALIDATION_ERROR_3f809201~^~Y~^~None~^~VkSamplerYcbcrConversionCreateInfoKHR~^~VUID-VkSamplerYcbcrConversionCreateInfoKHR-format-parameter~^~core~^~The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-format-parameter)~^~implicit -VALIDATION_ERROR_3f81c40d~^~Y~^~None~^~VkSamplerYcbcrConversionCreateInfoKHR~^~VUID-VkSamplerYcbcrConversionCreateInfoKHR-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-pNext-pNext)~^~implicit -VALIDATION_ERROR_3f82b00b~^~Y~^~None~^~VkSamplerYcbcrConversionCreateInfoKHR~^~VUID-VkSamplerYcbcrConversionCreateInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3f83d401~^~Y~^~None~^~VkSamplerYcbcrConversionCreateInfoKHR~^~VUID-VkSamplerYcbcrConversionCreateInfoKHR-ycbcrModel-parameter~^~core~^~The spec valid usage text states 'ycbcrModel must be a valid VkSamplerYcbcrModelConversionKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-ycbcrModel-parameter)~^~implicit -VALIDATION_ERROR_3f83d601~^~Y~^~None~^~VkSamplerYcbcrConversionCreateInfoKHR~^~VUID-VkSamplerYcbcrConversionCreateInfoKHR-ycbcrRange-parameter~^~core~^~The spec valid usage text states 'ycbcrRange must be a valid VkSamplerYcbcrRangeKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-ycbcrRange-parameter)~^~implicit -VALIDATION_ERROR_3f83d801~^~Y~^~None~^~VkSamplerYcbcrConversionCreateInfoKHR~^~VUID-VkSamplerYcbcrConversionCreateInfoKHR-xChromaOffset-parameter~^~core~^~The spec valid usage text states 'xChromaOffset must be a valid VkChromaLocationKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-xChromaOffset-parameter)~^~implicit -VALIDATION_ERROR_3f83da01~^~Y~^~None~^~VkSamplerYcbcrConversionCreateInfoKHR~^~VUID-VkSamplerYcbcrConversionCreateInfoKHR-yChromaOffset-parameter~^~core~^~The spec valid usage text states 'yChromaOffset must be a valid VkChromaLocationKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-yChromaOffset-parameter)~^~implicit -VALIDATION_ERROR_3f83dc01~^~Y~^~None~^~VkSamplerYcbcrConversionCreateInfoKHR~^~VUID-VkSamplerYcbcrConversionCreateInfoKHR-chromaFilter-parameter~^~core~^~The spec valid usage text states 'chromaFilter must be a valid VkFilter value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-chromaFilter-parameter)~^~implicit -VALIDATION_ERROR_3fa00cd4~^~N~^~None~^~VkBindImagePlaneMemoryInfoKHR~^~VUID-VkBindImagePlaneMemoryInfoKHR-planeAspect-01642~^~core~^~The spec valid usage text states 'planeAspect must be a single valid plane aspect for the image format (that is, planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR or VK_IMAGE_ASPECT_PLANE_1_BIT_KHR for "_2PLANE" formats and planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR, or VK_IMAGE_ASPECT_PLANE_2_BIT_KHR for "_3PLANE" formats)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImagePlaneMemoryInfoKHR-planeAspect-01642)~^~ -VALIDATION_ERROR_3fa00cd6~^~N~^~None~^~VkBindImagePlaneMemoryInfoKHR~^~VUID-VkBindImagePlaneMemoryInfoKHR-None-01643~^~core~^~The spec valid usage text states 'A single call to vkBindImageMemory2KHR must bind all or none of the planes of an image (i.e. bindings to all planes of an image must be made in a single vkBindImageMemory2KHR call), as separate bindings' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImagePlaneMemoryInfoKHR-None-01643)~^~ -VALIDATION_ERROR_3fa2b00b~^~N~^~None~^~VkBindImagePlaneMemoryInfoKHR~^~VUID-VkBindImagePlaneMemoryInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImagePlaneMemoryInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3fa3de01~^~N~^~None~^~VkBindImagePlaneMemoryInfoKHR~^~VUID-VkBindImagePlaneMemoryInfoKHR-planeAspect-parameter~^~core~^~The spec valid usage text states 'planeAspect must be a valid VkImageAspectFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImagePlaneMemoryInfoKHR-planeAspect-parameter)~^~implicit -VALIDATION_ERROR_3fc00c70~^~N~^~None~^~VkImagePlaneMemoryRequirementsInfoKHR~^~VUID-VkImagePlaneMemoryRequirementsInfoKHR-planeAspect-01592~^~core~^~The spec valid usage text states 'planeAspect must be an aspect that exists in the format; that is, for a two-plane image planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR or VK_IMAGE_ASPECT_PLANE_1_BIT_KHR, and for a three-plane image planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR or VK_IMAGE_ASPECT_PLANE_2_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImagePlaneMemoryRequirementsInfoKHR-planeAspect-01592)~^~ -VALIDATION_ERROR_3fc2b00b~^~N~^~None~^~VkImagePlaneMemoryRequirementsInfoKHR~^~VUID-VkImagePlaneMemoryRequirementsInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImagePlaneMemoryRequirementsInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_3fc3de01~^~N~^~None~^~VkImagePlaneMemoryRequirementsInfoKHR~^~VUID-VkImagePlaneMemoryRequirementsInfoKHR-planeAspect-parameter~^~core~^~The spec valid usage text states 'planeAspect must be a valid VkImageAspectFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImagePlaneMemoryRequirementsInfoKHR-planeAspect-parameter)~^~implicit -VALIDATION_ERROR_3fe00ce0~^~N~^~None~^~vkCreateSamplerYcbcrConversionKHR~^~VUID-vkCreateSamplerYcbcrConversionKHR-None-01648~^~core~^~The spec valid usage text states 'The sampler Y'CBCR conversion feature must be enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversionKHR-None-01648)~^~ -VALIDATION_ERROR_3fe05601~^~Y~^~None~^~vkCreateSamplerYcbcrConversionKHR~^~VUID-vkCreateSamplerYcbcrConversionKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversionKHR-device-parameter)~^~implicit -VALIDATION_ERROR_3fe0ec01~^~N~^~None~^~vkCreateSamplerYcbcrConversionKHR~^~VUID-vkCreateSamplerYcbcrConversionKHR-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversionKHR-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_3fe11e01~^~N~^~None~^~vkCreateSamplerYcbcrConversionKHR~^~VUID-vkCreateSamplerYcbcrConversionKHR-pCreateInfo-parameter~^~core~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkSamplerYcbcrConversionCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversionKHR-pCreateInfo-parameter)~^~implicit -VALIDATION_ERROR_3fe3e001~^~Y~^~None~^~vkCreateSamplerYcbcrConversionKHR~^~VUID-vkCreateSamplerYcbcrConversionKHR-pYcbcrConversion-parameter~^~core~^~The spec valid usage text states 'pYcbcrConversion must be a valid pointer to a VkSamplerYcbcrConversionKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversionKHR-pYcbcrConversion-parameter)~^~implicit -VALIDATION_ERROR_40000c8c~^~N~^~None~^~VkBindBufferMemoryDeviceGroupInfoKHX~^~VUID-VkBindBufferMemoryDeviceGroupInfoKHX-deviceIndexCount-01606~^~core~^~The spec valid usage text states 'deviceIndexCount must either be zero or equal to the number of physical devices in the logical device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryDeviceGroupInfoKHX-deviceIndexCount-01606)~^~ -VALIDATION_ERROR_40000c8e~^~N~^~None~^~VkBindBufferMemoryDeviceGroupInfoKHX~^~VUID-VkBindBufferMemoryDeviceGroupInfoKHX-pDeviceIndices-01607~^~core~^~The spec valid usage text states 'All elements of pDeviceIndices must be valid device indices' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryDeviceGroupInfoKHX-pDeviceIndices-01607)~^~ -VALIDATION_ERROR_40013e01~^~N~^~None~^~VkBindBufferMemoryDeviceGroupInfoKHX~^~VUID-VkBindBufferMemoryDeviceGroupInfoKHX-pDeviceIndices-parameter~^~core~^~The spec valid usage text states 'If deviceIndexCount is not 0, pDeviceIndices must be a valid pointer to an array of deviceIndexCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryDeviceGroupInfoKHX-pDeviceIndices-parameter)~^~implicit -VALIDATION_ERROR_4001c40d~^~N~^~None~^~VkBindBufferMemoryDeviceGroupInfoKHX~^~VUID-VkBindBufferMemoryDeviceGroupInfoKHX-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryDeviceGroupInfoKHX-pNext-pNext)~^~implicit -VALIDATION_ERROR_4002b00b~^~N~^~None~^~VkBindBufferMemoryDeviceGroupInfoKHX~^~VUID-VkBindBufferMemoryDeviceGroupInfoKHX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryDeviceGroupInfoKHX-sType-sType)~^~implicit -VALIDATION_ERROR_40200cc2~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfoKHX~^~VUID-VkBindImageMemoryDeviceGroupInfoKHX-deviceIndexCount-01633~^~core~^~The spec valid usage text states 'At least one of deviceIndexCount and SFRRectCount must be zero.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-deviceIndexCount-01633)~^~ -VALIDATION_ERROR_40200cc4~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfoKHX~^~VUID-VkBindImageMemoryDeviceGroupInfoKHX-deviceIndexCount-01634~^~core~^~The spec valid usage text states 'deviceIndexCount must either be zero or equal to the number of physical devices in the logical device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-deviceIndexCount-01634)~^~ -VALIDATION_ERROR_40200cc6~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfoKHX~^~VUID-VkBindImageMemoryDeviceGroupInfoKHX-pDeviceIndices-01635~^~core~^~The spec valid usage text states 'All elements of pDeviceIndices must be valid device indices.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-pDeviceIndices-01635)~^~ -VALIDATION_ERROR_40200cc8~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfoKHX~^~VUID-VkBindImageMemoryDeviceGroupInfoKHX-SFRRectCount-01636~^~core~^~The spec valid usage text states 'SFRRectCount must either be zero or equal to the number of physical devices in the logical device squared' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-SFRRectCount-01636)~^~ -VALIDATION_ERROR_40200cca~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfoKHX~^~VUID-VkBindImageMemoryDeviceGroupInfoKHX-pSFRRects-01637~^~core~^~The spec valid usage text states 'Elements of pSFRRects that correspond to the same instance of an image must not overlap.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-pSFRRects-01637)~^~ -VALIDATION_ERROR_40200ccc~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfoKHX~^~VUID-VkBindImageMemoryDeviceGroupInfoKHX-offset-01638~^~core~^~The spec valid usage text states 'The offset.x member of any element of pSFRRects must be a multiple of the sparse image block width (VkSparseImageFormatProperties::imageGranularity.width) of all non-metadata aspects of the image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-offset-01638)~^~ -VALIDATION_ERROR_40200cce~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfoKHX~^~VUID-VkBindImageMemoryDeviceGroupInfoKHX-offset-01639~^~core~^~The spec valid usage text states 'The offset.y member of any element of pSFRRects must be a multiple of the sparse image block height (VkSparseImageFormatProperties::imageGranularity.height) of all non-metadata aspects of the image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-offset-01639)~^~ -VALIDATION_ERROR_40200cd0~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfoKHX~^~VUID-VkBindImageMemoryDeviceGroupInfoKHX-extent-01640~^~core~^~The spec valid usage text states 'The extent.width member of any element of pSFRRects must either be a multiple of the sparse image block width of all non-metadata aspects of the image, or else extent.width + offset.x must equal the width of the image subresource' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-extent-01640)~^~ -VALIDATION_ERROR_40200cd2~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfoKHX~^~VUID-VkBindImageMemoryDeviceGroupInfoKHX-extent-01641~^~core~^~The spec valid usage text states 'The extent.height member of any element of pSFRRects must either be a multiple of the sparse image block height of all non-metadata aspects of the image, or else extent.height offset.y must equal the width of the image subresource' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-extent-01641)~^~ -VALIDATION_ERROR_40213e01~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfoKHX~^~VUID-VkBindImageMemoryDeviceGroupInfoKHX-pDeviceIndices-parameter~^~core~^~The spec valid usage text states 'If deviceIndexCount is not 0, pDeviceIndices must be a valid pointer to an array of deviceIndexCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-pDeviceIndices-parameter)~^~implicit -VALIDATION_ERROR_4021c40d~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfoKHX~^~VUID-VkBindImageMemoryDeviceGroupInfoKHX-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-pNext-pNext)~^~implicit -VALIDATION_ERROR_40222001~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfoKHX~^~VUID-VkBindImageMemoryDeviceGroupInfoKHX-pSFRRects-parameter~^~core~^~The spec valid usage text states 'If SFRRectCount is not 0, pSFRRects must be a valid pointer to an array of SFRRectCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-pSFRRects-parameter)~^~implicit -VALIDATION_ERROR_4022b00b~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfoKHX~^~VUID-VkBindImageMemoryDeviceGroupInfoKHX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-sType-sType)~^~implicit -VALIDATION_ERROR_40405601~^~Y~^~None~^~vkDestroySamplerYcbcrConversionKHR~^~VUID-vkDestroySamplerYcbcrConversionKHR-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySamplerYcbcrConversionKHR-device-parameter)~^~implicit -VALIDATION_ERROR_4040ec01~^~N~^~None~^~vkDestroySamplerYcbcrConversionKHR~^~VUID-vkDestroySamplerYcbcrConversionKHR-pAllocator-parameter~^~core~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySamplerYcbcrConversionKHR-pAllocator-parameter)~^~implicit -VALIDATION_ERROR_4043e201~^~Y~^~None~^~vkDestroySamplerYcbcrConversionKHR~^~VUID-vkDestroySamplerYcbcrConversionKHR-ycbcrConversion-parameter~^~core~^~The spec valid usage text states 'If ycbcrConversion is not VK_NULL_HANDLE, ycbcrConversion must be a valid VkSamplerYcbcrConversionKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySamplerYcbcrConversionKHR-ycbcrConversion-parameter)~^~implicit -VALIDATION_ERROR_4043e207~^~Y~^~None~^~vkDestroySamplerYcbcrConversionKHR~^~VUID-vkDestroySamplerYcbcrConversionKHR-ycbcrConversion-parent~^~core~^~The spec valid usage text states 'If ycbcrConversion is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySamplerYcbcrConversionKHR-ycbcrConversion-parent)~^~implicit -VALIDATION_ERROR_4062b00b~^~N~^~None~^~VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR~^~VUID-VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR-sType-sType)~^~implicit -VALIDATION_ERROR_4082b00b~^~N~^~None~^~VkSamplerYcbcrConversionImageFormatPropertiesKHR~^~VUID-VkSamplerYcbcrConversionImageFormatPropertiesKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionImageFormatPropertiesKHR-sType-sType)~^~implicit -VALIDATION_ERROR_40a2b00b~^~N~^~None~^~VkSamplerYcbcrConversionInfoKHR~^~VUID-VkSamplerYcbcrConversionInfoKHR-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionInfoKHR-sType-sType)~^~implicit -VALIDATION_ERROR_40a3e601~^~N~^~None~^~VkSamplerYcbcrConversionInfoKHR~^~VUID-VkSamplerYcbcrConversionInfoKHR-conversion-parameter~^~core~^~The spec valid usage text states 'conversion must be a valid VkSamplerYcbcrConversionKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionInfoKHR-conversion-parameter)~^~implicit -VALIDATION_ERROR_40c1c40d~^~N~^~None~^~VkDeviceQueueGlobalPriorityCreateInfoEXT~^~VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-pNext-pNext)~^~implicit -VALIDATION_ERROR_40c2b00b~^~N~^~None~^~VkDeviceQueueGlobalPriorityCreateInfoEXT~^~VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-sType-sType)~^~implicit -VALIDATION_ERROR_40c3ea01~^~N~^~None~^~VkDeviceQueueGlobalPriorityCreateInfoEXT~^~VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-globalPriority-parameter~^~core~^~The spec valid usage text states 'globalPriority must be a valid VkQueueGlobalPriorityEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-globalPriority-parameter)~^~implicit -VALIDATION_ERROR_40e05601~^~Y~^~None~^~vkGetShaderInfoAMD~^~VUID-vkGetShaderInfoAMD-device-parameter~^~core~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetShaderInfoAMD-device-parameter)~^~implicit -VALIDATION_ERROR_40e27c01~^~Y~^~None~^~vkGetShaderInfoAMD~^~VUID-vkGetShaderInfoAMD-pipeline-parameter~^~core~^~The spec valid usage text states 'pipeline must be a valid VkPipeline handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetShaderInfoAMD-pipeline-parameter)~^~implicit -VALIDATION_ERROR_40e27c07~^~Y~^~None~^~vkGetShaderInfoAMD~^~VUID-vkGetShaderInfoAMD-pipeline-parent~^~core~^~The spec valid usage text states 'pipeline must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetShaderInfoAMD-pipeline-parent)~^~implicit -VALIDATION_ERROR_40e39c01~^~Y~^~None~^~vkGetShaderInfoAMD~^~VUID-vkGetShaderInfoAMD-pInfo-parameter~^~core~^~The spec valid usage text states 'If the value referenced by pInfoSize is not 0, and pInfo is not NULL, pInfo must be a valid pointer to an array of pInfoSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetShaderInfoAMD-pInfo-parameter)~^~implicit -VALIDATION_ERROR_40e3ec01~^~Y~^~None~^~vkGetShaderInfoAMD~^~VUID-vkGetShaderInfoAMD-shaderStage-parameter~^~core~^~The spec valid usage text states 'shaderStage must be a valid VkShaderStageFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetShaderInfoAMD-shaderStage-parameter)~^~implicit -VALIDATION_ERROR_40e3ee01~^~Y~^~None~^~vkGetShaderInfoAMD~^~VUID-vkGetShaderInfoAMD-infoType-parameter~^~core~^~The spec valid usage text states 'infoType must be a valid VkShaderInfoTypeAMD value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetShaderInfoAMD-infoType-parameter)~^~implicit -VALIDATION_ERROR_40e3f001~^~N~^~None~^~vkGetShaderInfoAMD~^~VUID-vkGetShaderInfoAMD-pInfoSize-parameter~^~core~^~The spec valid usage text states 'pInfoSize must be a valid pointer to a size_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetShaderInfoAMD-pInfoSize-parameter)~^~implicit +VALIDATION_ERROR_3401c40d~^~N~^~None~^~VkPhysicalDeviceProperties2~^~VUID-VkPhysicalDeviceProperties2-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT, VkPhysicalDeviceConservativeRasterizationPropertiesEXT, VkPhysicalDeviceDescriptorIndexingPropertiesEXT, VkPhysicalDeviceDiscardRectanglePropertiesEXT, VkPhysicalDeviceExternalMemoryHostPropertiesEXT, VkPhysicalDeviceIDProperties, VkPhysicalDeviceMaintenance3Properties, VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX, VkPhysicalDeviceMultiviewProperties, VkPhysicalDevicePointClippingProperties, VkPhysicalDeviceProtectedMemoryProperties, VkPhysicalDevicePushDescriptorPropertiesKHR, VkPhysicalDeviceSampleLocationsPropertiesEXT, VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT, VkPhysicalDeviceShaderCorePropertiesAMD, VkPhysicalDeviceSubgroupProperties, or VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceProperties2-pNext-pNext)~^~implicit +VALIDATION_ERROR_3402b00b~^~Y~^~None~^~VkPhysicalDeviceProperties2~^~VUID-VkPhysicalDeviceProperties2-sType-sType~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceProperties2-sType-sType)~^~implicit +VALIDATION_ERROR_3402b00f~^~N~^~None~^~VkPhysicalDeviceProperties2~^~VUID-VkPhysicalDeviceProperties2-sType-unique~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceProperties2-sType-unique)~^~implicit +VALIDATION_ERROR_3421c40d~^~N~^~None~^~VkFormatProperties2~^~VUID-VkFormatProperties2-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFormatProperties2-pNext-pNext)~^~implicit +VALIDATION_ERROR_3422b00b~^~Y~^~None~^~VkFormatProperties2~^~VUID-VkFormatProperties2-sType-sType~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFormatProperties2-sType-sType)~^~implicit +VALIDATION_ERROR_3441c40d~^~N~^~None~^~VkImageFormatProperties2~^~VUID-VkImageFormatProperties2-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkAndroidHardwareBufferUsageANDROID, VkExternalImageFormatProperties, VkSamplerYcbcrConversionImageFormatProperties, or VkTextureLODGatherFormatPropertiesAMD' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageFormatProperties2-pNext-pNext)~^~implicit +VALIDATION_ERROR_3442b00b~^~Y~^~None~^~VkImageFormatProperties2~^~VUID-VkImageFormatProperties2-sType-sType~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageFormatProperties2-sType-sType)~^~implicit +VALIDATION_ERROR_3442b00f~^~N~^~None~^~VkImageFormatProperties2~^~VUID-VkImageFormatProperties2-sType-unique~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageFormatProperties2-sType-unique)~^~implicit +VALIDATION_ERROR_3461c40d~^~N~^~None~^~VkPhysicalDeviceMemoryProperties2~^~VUID-VkPhysicalDeviceMemoryProperties2-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceMemoryProperties2-pNext-pNext)~^~implicit +VALIDATION_ERROR_3462b00b~^~Y~^~None~^~VkPhysicalDeviceMemoryProperties2~^~VUID-VkPhysicalDeviceMemoryProperties2-sType-sType~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceMemoryProperties2-sType-sType)~^~implicit +VALIDATION_ERROR_3481c40d~^~N~^~None~^~VkSurfaceCapabilities2KHR~^~VUID-VkSurfaceCapabilities2KHR-pNext-pNext~^~(VK_KHR_surface)+(VK_KHR_get_surface_capabilities2)~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkSharedPresentSurfaceCapabilitiesKHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSurfaceCapabilities2KHR-pNext-pNext)~^~implicit +VALIDATION_ERROR_3482b00b~^~Y~^~None~^~VkSurfaceCapabilities2KHR~^~VUID-VkSurfaceCapabilities2KHR-sType-sType~^~(VK_KHR_surface)+(VK_KHR_get_surface_capabilities2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSurfaceCapabilities2KHR-sType-sType)~^~implicit +VALIDATION_ERROR_34a1c40d~^~N~^~None~^~VkDeviceGroupPresentCapabilitiesKHR~^~VUID-VkDeviceGroupPresentCapabilitiesKHR-pNext-pNext~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentCapabilitiesKHR-pNext-pNext)~^~implicit +VALIDATION_ERROR_34a2b00b~^~Y~^~None~^~VkDeviceGroupPresentCapabilitiesKHR~^~VUID-VkDeviceGroupPresentCapabilitiesKHR-sType-sType~^~(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentCapabilitiesKHR-sType-sType)~^~implicit +VALIDATION_ERROR_34c1c40d~^~N~^~None~^~VkExternalBufferProperties~^~VUID-VkExternalBufferProperties-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_external_memory_capabilities)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalBufferProperties-pNext-pNext)~^~implicit +VALIDATION_ERROR_34c2b00b~^~Y~^~None~^~VkExternalBufferProperties~^~VUID-VkExternalBufferProperties-sType-sType~^~(VK_VERSION_1_1,VK_KHR_external_memory_capabilities)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalBufferProperties-sType-sType)~^~implicit +VALIDATION_ERROR_3521c40d~^~N~^~None~^~VkExternalSemaphoreProperties~^~VUID-VkExternalSemaphoreProperties-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_external_semaphore_capabilities)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalSemaphoreProperties-pNext-pNext)~^~implicit +VALIDATION_ERROR_3522b00b~^~Y~^~None~^~VkExternalSemaphoreProperties~^~VUID-VkExternalSemaphoreProperties-sType-sType~^~(VK_VERSION_1_1,VK_KHR_external_semaphore_capabilities)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalSemaphoreProperties-sType-sType)~^~implicit +VALIDATION_ERROR_3541c40d~^~N~^~None~^~VkQueueFamilyProperties2~^~VUID-VkQueueFamilyProperties2-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkQueueFamilyProperties2-pNext-pNext)~^~implicit +VALIDATION_ERROR_3542b00b~^~N~^~None~^~VkQueueFamilyProperties2~^~VUID-VkQueueFamilyProperties2-sType-sType~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkQueueFamilyProperties2-sType-sType)~^~implicit +VALIDATION_ERROR_3561c40d~^~N~^~None~^~VkSparseImageFormatProperties2~^~VUID-VkSparseImageFormatProperties2-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSparseImageFormatProperties2-pNext-pNext)~^~implicit +VALIDATION_ERROR_3562b00b~^~N~^~None~^~VkSparseImageFormatProperties2~^~VUID-VkSparseImageFormatProperties2-sType-sType~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSparseImageFormatProperties2-sType-sType)~^~implicit +VALIDATION_ERROR_3581c40d~^~N~^~None~^~VkSurfaceFormat2KHR~^~VUID-VkSurfaceFormat2KHR-pNext-pNext~^~(VK_KHR_surface)+(VK_KHR_get_surface_capabilities2)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSurfaceFormat2KHR-pNext-pNext)~^~implicit +VALIDATION_ERROR_3582b00b~^~N~^~None~^~VkSurfaceFormat2KHR~^~VUID-VkSurfaceFormat2KHR-sType-sType~^~(VK_KHR_surface)+(VK_KHR_get_surface_capabilities2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSurfaceFormat2KHR-sType-sType)~^~implicit +VALIDATION_ERROR_35c2b00b~^~N~^~None~^~VkPhysicalDeviceMultiviewProperties~^~VUID-VkPhysicalDeviceMultiviewProperties-sType-sType~^~(VK_VERSION_1_1,VK_KHR_multiview)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceMultiviewProperties-sType-sType)~^~implicit +VALIDATION_ERROR_3602b00b~^~N~^~None~^~VkExternalImageFormatProperties~^~VUID-VkExternalImageFormatProperties-sType-sType~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)+(VK_VERSION_1_1,VK_KHR_external_memory_capabilities)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalImageFormatProperties-sType-sType)~^~implicit +VALIDATION_ERROR_3622b00b~^~N~^~None~^~VkPhysicalDeviceIDProperties~^~VUID-VkPhysicalDeviceIDProperties-sType-sType~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)+(VK_VERSION_1_1,VK_KHR_external_memory_capabilities,VK_KHR_external_semaphore_capabilities,VK_KHR_external_fence_capabilities)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceIDProperties-sType-sType)~^~implicit +VALIDATION_ERROR_3642b00b~^~N~^~None~^~VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX~^~VUID-VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX-sType-sType~^~(VK_NVX_multiview_per_view_attributes)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX-sType-sType)~^~implicit +VALIDATION_ERROR_37e2b00b~^~N~^~None~^~VkSharedPresentSurfaceCapabilitiesKHR~^~VUID-VkSharedPresentSurfaceCapabilitiesKHR-sType-sType~^~(VK_KHR_surface)+(VK_KHR_get_surface_capabilities2)+(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSharedPresentSurfaceCapabilitiesKHR-sType-sType)~^~implicit +VALIDATION_ERROR_3822b00b~^~N~^~None~^~VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT~^~VUID-VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT-sType-sType~^~(VK_EXT_blend_operation_advanced)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT-sType-sType)~^~implicit +VALIDATION_ERROR_3842b00b~^~N~^~None~^~VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT~^~VUID-VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT-sType-sType~^~(VK_EXT_blend_operation_advanced)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT-sType-sType)~^~implicit +VALIDATION_ERROR_3862b00b~^~N~^~None~^~VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT~^~VUID-VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT-sType-sType~^~(VK_EXT_sampler_filter_minmax)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT-sType-sType)~^~implicit +VALIDATION_ERROR_38800b20~^~N~^~None~^~VkPipelineColorBlendAdvancedStateCreateInfoEXT~^~VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-srcPremultiplied-01424~^~(VK_EXT_blend_operation_advanced)~^~The spec valid usage text states 'If the non-premultiplied source color property is not supported, srcPremultiplied must be VK_TRUE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-srcPremultiplied-01424)~^~ +VALIDATION_ERROR_38800b22~^~N~^~None~^~VkPipelineColorBlendAdvancedStateCreateInfoEXT~^~VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-dstPremultiplied-01425~^~(VK_EXT_blend_operation_advanced)~^~The spec valid usage text states 'If the non-premultiplied destination color property is not supported, dstPremultiplied must be VK_TRUE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-dstPremultiplied-01425)~^~ +VALIDATION_ERROR_38800b24~^~N~^~None~^~VkPipelineColorBlendAdvancedStateCreateInfoEXT~^~VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-blendOverlap-01426~^~(VK_EXT_blend_operation_advanced)~^~The spec valid usage text states 'If the correlated overlap property is not supported, blendOverlap must be VK_BLEND_OVERLAP_UNCORRELATED_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-blendOverlap-01426)~^~ +VALIDATION_ERROR_3882b00b~^~N~^~None~^~VkPipelineColorBlendAdvancedStateCreateInfoEXT~^~VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-sType-sType~^~(VK_EXT_blend_operation_advanced)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_38834a01~^~N~^~None~^~VkPipelineColorBlendAdvancedStateCreateInfoEXT~^~VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-blendOverlap-parameter~^~(VK_EXT_blend_operation_advanced)~^~The spec valid usage text states 'blendOverlap must be a valid VkBlendOverlapEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-blendOverlap-parameter)~^~implicit +VALIDATION_ERROR_38a00afa~^~N~^~None~^~VkPipelineCoverageModulationStateCreateInfoNV~^~VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationTableEnable-01405~^~(VK_NV_framebuffer_mixed_samples)~^~The spec valid usage text states 'If coverageModulationTableEnable is VK_TRUE, coverageModulationTableCount must be equal to the number of rasterization samples divided by the number of color samples in the subpass.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationTableEnable-01405)~^~ +VALIDATION_ERROR_38a09005~^~N~^~None~^~VkPipelineCoverageModulationStateCreateInfoNV~^~VUID-VkPipelineCoverageModulationStateCreateInfoNV-flags-zerobitmask~^~(VK_NV_framebuffer_mixed_samples)~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-flags-zerobitmask)~^~implicit +VALIDATION_ERROR_38a2b00b~^~N~^~None~^~VkPipelineCoverageModulationStateCreateInfoNV~^~VUID-VkPipelineCoverageModulationStateCreateInfoNV-sType-sType~^~(VK_NV_framebuffer_mixed_samples)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-sType-sType)~^~implicit +VALIDATION_ERROR_38a34c01~^~N~^~None~^~VkPipelineCoverageModulationStateCreateInfoNV~^~VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationMode-parameter~^~(VK_NV_framebuffer_mixed_samples)~^~The spec valid usage text states 'coverageModulationMode must be a valid VkCoverageModulationModeNV value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationMode-parameter)~^~implicit +VALIDATION_ERROR_38a34e1b~^~N~^~None~^~VkPipelineCoverageModulationStateCreateInfoNV~^~VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationTableCount-arraylength~^~(VK_NV_framebuffer_mixed_samples)~^~The spec valid usage text states 'coverageModulationTableCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationTableCount-arraylength)~^~implicit +VALIDATION_ERROR_38c00af8~^~N~^~None~^~VkPipelineCoverageToColorStateCreateInfoNV~^~VUID-VkPipelineCoverageToColorStateCreateInfoNV-coverageToColorEnable-01404~^~(VK_NV_fragment_coverage_to_color)~^~The spec valid usage text states 'If coverageToColorEnable is VK_TRUE, then the render pass subpass indicated by VkGraphicsPipelineCreateInfo::renderPass and VkGraphicsPipelineCreateInfo::subpass must have a color attachment at the location selected by coverageToColorLocation, with a VkFormat of VK_FORMAT_R8_UINT, VK_FORMAT_R8_SINT, VK_FORMAT_R16_UINT, VK_FORMAT_R16_SINT, VK_FORMAT_R32_UINT, or VK_FORMAT_R32_SINT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineCoverageToColorStateCreateInfoNV-coverageToColorEnable-01404)~^~ +VALIDATION_ERROR_38c09005~^~N~^~None~^~VkPipelineCoverageToColorStateCreateInfoNV~^~VUID-VkPipelineCoverageToColorStateCreateInfoNV-flags-zerobitmask~^~(VK_NV_fragment_coverage_to_color)~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineCoverageToColorStateCreateInfoNV-flags-zerobitmask)~^~implicit +VALIDATION_ERROR_38c2b00b~^~N~^~None~^~VkPipelineCoverageToColorStateCreateInfoNV~^~VUID-VkPipelineCoverageToColorStateCreateInfoNV-sType-sType~^~(VK_NV_fragment_coverage_to_color)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineCoverageToColorStateCreateInfoNV-sType-sType)~^~implicit +VALIDATION_ERROR_38e2b00b~^~N~^~None~^~VkSamplerReductionModeCreateInfoEXT~^~VUID-VkSamplerReductionModeCreateInfoEXT-sType-sType~^~(VK_EXT_sampler_filter_minmax)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerReductionModeCreateInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_38e35001~^~N~^~None~^~VkSamplerReductionModeCreateInfoEXT~^~VUID-VkSamplerReductionModeCreateInfoEXT-reductionMode-parameter~^~(VK_EXT_sampler_filter_minmax)~^~The spec valid usage text states 'reductionMode must be a valid VkSamplerReductionModeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerReductionModeCreateInfoEXT-reductionMode-parameter)~^~implicit +VALIDATION_ERROR_39400b4c~^~N~^~None~^~VkExportFenceCreateInfo~^~VUID-VkExportFenceCreateInfo-handleTypes-01446~^~(VK_VERSION_1_1,VK_KHR_external_fence)~^~The spec valid usage text states 'The bits in handleTypes must be supported and compatible, as reported by VkExternalFenceProperties.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportFenceCreateInfo-handleTypes-01446)~^~ +VALIDATION_ERROR_39409e01~^~N~^~None~^~VkExportFenceCreateInfo~^~VUID-VkExportFenceCreateInfo-handleTypes-parameter~^~(VK_VERSION_1_1,VK_KHR_external_fence)~^~The spec valid usage text states 'handleTypes must be a valid combination of VkExternalFenceHandleTypeFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportFenceCreateInfo-handleTypes-parameter)~^~implicit +VALIDATION_ERROR_3942b00b~^~N~^~None~^~VkExportFenceCreateInfo~^~VUID-VkExportFenceCreateInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_external_fence)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportFenceCreateInfo-sType-sType)~^~implicit +VALIDATION_ERROR_39609c01~^~Y~^~None~^~VkPhysicalDeviceExternalFenceInfo~^~VUID-VkPhysicalDeviceExternalFenceInfo-handleType-parameter~^~(VK_VERSION_1_1,VK_KHR_external_fence_capabilities)~^~The spec valid usage text states 'handleType must be a valid VkExternalFenceHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalFenceInfo-handleType-parameter)~^~implicit +VALIDATION_ERROR_3961c40d~^~Y~^~None~^~VkPhysicalDeviceExternalFenceInfo~^~VUID-VkPhysicalDeviceExternalFenceInfo-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_external_fence_capabilities)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalFenceInfo-pNext-pNext)~^~implicit +VALIDATION_ERROR_3962b00b~^~Y~^~None~^~VkPhysicalDeviceExternalFenceInfo~^~VUID-VkPhysicalDeviceExternalFenceInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_external_fence_capabilities)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalFenceInfo-sType-sType)~^~implicit +VALIDATION_ERROR_3981c40d~^~N~^~None~^~VkExternalFenceProperties~^~VUID-VkExternalFenceProperties-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_external_fence_capabilities)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalFenceProperties-pNext-pNext)~^~implicit +VALIDATION_ERROR_3982b00b~^~Y~^~None~^~VkExternalFenceProperties~^~VUID-VkExternalFenceProperties-sType-sType~^~(VK_VERSION_1_1,VK_KHR_external_fence_capabilities)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalFenceProperties-sType-sType)~^~implicit +VALIDATION_ERROR_39a27a01~^~Y~^~None~^~vkGetPhysicalDeviceExternalFenceProperties~^~VUID-vkGetPhysicalDeviceExternalFenceProperties-physicalDevice-parameter~^~(VK_VERSION_1_1,VK_KHR_external_fence_capabilities)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalFenceProperties-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_39a3a201~^~N~^~None~^~vkGetPhysicalDeviceExternalFenceProperties~^~VUID-vkGetPhysicalDeviceExternalFenceProperties-pExternalFenceInfo-parameter~^~(VK_VERSION_1_1,VK_KHR_external_fence_capabilities)~^~The spec valid usage text states 'pExternalFenceInfo must be a valid pointer to a valid VkPhysicalDeviceExternalFenceInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalFenceProperties-pExternalFenceInfo-parameter)~^~implicit +VALIDATION_ERROR_39a3a401~^~N~^~None~^~vkGetPhysicalDeviceExternalFenceProperties~^~VUID-vkGetPhysicalDeviceExternalFenceProperties-pExternalFenceProperties-parameter~^~(VK_VERSION_1_1,VK_KHR_external_fence_capabilities)~^~The spec valid usage text states 'pExternalFenceProperties must be a valid pointer to a VkExternalFenceProperties structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalFenceProperties-pExternalFenceProperties-parameter)~^~implicit +VALIDATION_ERROR_39c00b70~^~N~^~None~^~VkImportFenceFdInfoKHR~^~VUID-VkImportFenceFdInfoKHR-handleType-01464~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'handleType must be a value included in the Handle Types Supported by VkImportFenceFdInfoKHR table.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-handleType-01464)~^~ +VALIDATION_ERROR_39c00c0a~^~N~^~None~^~VkImportFenceFdInfoKHR~^~VUID-VkImportFenceFdInfoKHR-fd-01541~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'fd must obey any requirements listed for handleType in external fence handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-fd-01541)~^~ +VALIDATION_ERROR_39c08801~^~Y~^~None~^~VkImportFenceFdInfoKHR~^~VUID-VkImportFenceFdInfoKHR-fence-parameter~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-fence-parameter)~^~implicit +VALIDATION_ERROR_39c09001~^~Y~^~None~^~VkImportFenceFdInfoKHR~^~VUID-VkImportFenceFdInfoKHR-flags-parameter~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'flags must be a valid combination of VkFenceImportFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-flags-parameter)~^~implicit +VALIDATION_ERROR_39c09c01~^~Y~^~None~^~VkImportFenceFdInfoKHR~^~VUID-VkImportFenceFdInfoKHR-handleType-parameter~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'handleType must be a valid VkExternalFenceHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-handleType-parameter)~^~implicit +VALIDATION_ERROR_39c1c40d~^~Y~^~None~^~VkImportFenceFdInfoKHR~^~VUID-VkImportFenceFdInfoKHR-pNext-pNext~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-pNext-pNext)~^~implicit +VALIDATION_ERROR_39c2b00b~^~Y~^~None~^~VkImportFenceFdInfoKHR~^~VUID-VkImportFenceFdInfoKHR-sType-sType~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-sType-sType)~^~implicit +VALIDATION_ERROR_39e00b5a~^~N~^~None~^~VkFenceGetFdInfoKHR~^~VUID-VkFenceGetFdInfoKHR-handleType-01453~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'handleType must have been included in VkExportFenceCreateInfo::handleTypes when fence's current payload was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-handleType-01453)~^~ +VALIDATION_ERROR_39e00b5c~^~N~^~None~^~VkFenceGetFdInfoKHR~^~VUID-VkFenceGetFdInfoKHR-handleType-01454~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, fence must be signaled, or have an associated fence signal operation pending execution.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-handleType-01454)~^~ +VALIDATION_ERROR_39e00b5e~^~N~^~None~^~VkFenceGetFdInfoKHR~^~VUID-VkFenceGetFdInfoKHR-fence-01455~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'fence must not currently have its payload replaced by an imported payload as described below in Importing Fence Payloads unless that imported payload's handle type was included in VkExternalFenceProperties::exportFromImportedHandleTypes for handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-fence-01455)~^~ +VALIDATION_ERROR_39e00b60~^~N~^~None~^~VkFenceGetFdInfoKHR~^~VUID-VkFenceGetFdInfoKHR-handleType-01456~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'handleType must be defined as a POSIX file descriptor handle.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-handleType-01456)~^~ +VALIDATION_ERROR_39e08801~^~Y~^~None~^~VkFenceGetFdInfoKHR~^~VUID-VkFenceGetFdInfoKHR-fence-parameter~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-fence-parameter)~^~implicit +VALIDATION_ERROR_39e09c01~^~Y~^~None~^~VkFenceGetFdInfoKHR~^~VUID-VkFenceGetFdInfoKHR-handleType-parameter~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'handleType must be a valid VkExternalFenceHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-handleType-parameter)~^~implicit +VALIDATION_ERROR_39e1c40d~^~Y~^~None~^~VkFenceGetFdInfoKHR~^~VUID-VkFenceGetFdInfoKHR-pNext-pNext~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-pNext-pNext)~^~implicit +VALIDATION_ERROR_39e2b00b~^~Y~^~None~^~VkFenceGetFdInfoKHR~^~VUID-VkFenceGetFdInfoKHR-sType-sType~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-sType-sType)~^~implicit +VALIDATION_ERROR_3a000b6e~^~N~^~None~^~vkImportFenceFdKHR~^~VUID-vkImportFenceFdKHR-fence-01463~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'fence must not be associated with any queue command that has not yet completed execution on that queue' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportFenceFdKHR-fence-01463)~^~ +VALIDATION_ERROR_3a005601~^~Y~^~None~^~vkImportFenceFdKHR~^~VUID-vkImportFenceFdKHR-device-parameter~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportFenceFdKHR-device-parameter)~^~implicit +VALIDATION_ERROR_3a03a801~^~N~^~None~^~vkImportFenceFdKHR~^~VUID-vkImportFenceFdKHR-pImportFenceFdInfo-parameter~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'pImportFenceFdInfo must be a valid pointer to a valid VkImportFenceFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportFenceFdKHR-pImportFenceFdInfo-parameter)~^~implicit +VALIDATION_ERROR_3a205601~^~Y~^~None~^~vkGetFenceFdKHR~^~VUID-vkGetFenceFdKHR-device-parameter~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetFenceFdKHR-device-parameter)~^~implicit +VALIDATION_ERROR_3a216c01~^~Y~^~None~^~vkGetFenceFdKHR~^~VUID-vkGetFenceFdKHR-pFd-parameter~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'pFd must be a valid pointer to a int value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetFenceFdKHR-pFd-parameter)~^~implicit +VALIDATION_ERROR_3a239e01~^~N~^~None~^~vkGetFenceFdKHR~^~VUID-vkGetFenceFdKHR-pGetFdInfo-parameter~^~(VK_KHR_external_fence_fd)~^~The spec valid usage text states 'pGetFdInfo must be a valid pointer to a valid VkFenceGetFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetFenceFdKHR-pGetFdInfo-parameter)~^~implicit +VALIDATION_ERROR_3a400b62~^~N~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-handleType-01457~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'handleType must be a value included in the Handle Types Supported by VkImportFenceWin32HandleInfoKHR table.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-01457)~^~ +VALIDATION_ERROR_3a400b66~^~N~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-handleType-01459~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'If handleType is not VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT, name must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-01459)~^~ +VALIDATION_ERROR_3a400b68~^~N~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-handleType-01460~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'If handleType is not 0 and handle is NULL, name must name a valid synchronization primitive of the type specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-01460)~^~ +VALIDATION_ERROR_3a400b6a~^~N~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-handleType-01461~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'If handleType is not 0 and name is NULL, handle must be a valid handle of the type specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-01461)~^~ +VALIDATION_ERROR_3a400b6c~^~N~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-handle-01462~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'If handle is not NULL, name must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handle-01462)~^~ +VALIDATION_ERROR_3a400c06~^~N~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-handle-01539~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'If handle is not NULL, it must obey any requirements listed for handleType in external fence handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handle-01539)~^~ +VALIDATION_ERROR_3a400c08~^~N~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-name-01540~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'If name is not NULL, it must obey any requirements listed for handleType in external fence handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-name-01540)~^~ +VALIDATION_ERROR_3a408801~^~Y~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-fence-parameter~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-fence-parameter)~^~implicit +VALIDATION_ERROR_3a409001~^~Y~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-flags-parameter~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'flags must be a valid combination of VkFenceImportFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-flags-parameter)~^~implicit +VALIDATION_ERROR_3a409c01~^~Y~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-handleType-parameter~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'If handleType is not 0, handleType must be a valid VkExternalFenceHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-parameter)~^~implicit +VALIDATION_ERROR_3a41c40d~^~Y~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-pNext-pNext~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-pNext-pNext)~^~implicit +VALIDATION_ERROR_3a42b00b~^~Y~^~None~^~VkImportFenceWin32HandleInfoKHR~^~VUID-VkImportFenceWin32HandleInfoKHR-sType-sType~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-sType-sType)~^~implicit +VALIDATION_ERROR_3a600b4e~^~N~^~None~^~VkExportFenceWin32HandleInfoKHR~^~VUID-VkExportFenceWin32HandleInfoKHR-handleTypes-01447~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'If VkExportFenceCreateInfo::handleTypes does not include VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT, VkExportFenceWin32HandleInfoKHR must not be in the pNext chain of VkFenceCreateInfo.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportFenceWin32HandleInfoKHR-handleTypes-01447)~^~ +VALIDATION_ERROR_3a60f401~^~N~^~None~^~VkExportFenceWin32HandleInfoKHR~^~VUID-VkExportFenceWin32HandleInfoKHR-pAttributes-parameter~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportFenceWin32HandleInfoKHR-pAttributes-parameter)~^~implicit +VALIDATION_ERROR_3a62b00b~^~N~^~None~^~VkExportFenceWin32HandleInfoKHR~^~VUID-VkExportFenceWin32HandleInfoKHR-sType-sType~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportFenceWin32HandleInfoKHR-sType-sType)~^~implicit +VALIDATION_ERROR_3a800b50~^~N~^~None~^~VkFenceGetWin32HandleInfoKHR~^~VUID-VkFenceGetWin32HandleInfoKHR-handleType-01448~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'handleType must have been included in VkExportFenceCreateInfo::handleTypes when the fence's current payload was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-01448)~^~ +VALIDATION_ERROR_3a800b52~^~N~^~None~^~VkFenceGetWin32HandleInfoKHR~^~VUID-VkFenceGetWin32HandleInfoKHR-handleType-01449~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'If handleType is defined as an NT handle, vkGetFenceWin32HandleKHR must be called no more than once for each valid unique combination of fence and handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-01449)~^~ +VALIDATION_ERROR_3a800b54~^~N~^~None~^~VkFenceGetWin32HandleInfoKHR~^~VUID-VkFenceGetWin32HandleInfoKHR-fence-01450~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'fence must not currently have its payload replaced by an imported payload as described below in Importing Fence Payloads unless that imported payload's handle type was included in VkExternalFenceProperties::exportFromImportedHandleTypes for handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-fence-01450)~^~ +VALIDATION_ERROR_3a800b56~^~N~^~None~^~VkFenceGetWin32HandleInfoKHR~^~VUID-VkFenceGetWin32HandleInfoKHR-handleType-01451~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, fence must be signaled, or have an associated fence signal operation pending execution.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-01451)~^~ +VALIDATION_ERROR_3a800b58~^~N~^~None~^~VkFenceGetWin32HandleInfoKHR~^~VUID-VkFenceGetWin32HandleInfoKHR-handleType-01452~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'handleType must be defined as an NT handle or a global share handle.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-01452)~^~ +VALIDATION_ERROR_3a808801~^~Y~^~None~^~VkFenceGetWin32HandleInfoKHR~^~VUID-VkFenceGetWin32HandleInfoKHR-fence-parameter~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-fence-parameter)~^~implicit +VALIDATION_ERROR_3a809c01~^~Y~^~None~^~VkFenceGetWin32HandleInfoKHR~^~VUID-VkFenceGetWin32HandleInfoKHR-handleType-parameter~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'handleType must be a valid VkExternalFenceHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-parameter)~^~implicit +VALIDATION_ERROR_3a81c40d~^~Y~^~None~^~VkFenceGetWin32HandleInfoKHR~^~VUID-VkFenceGetWin32HandleInfoKHR-pNext-pNext~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-pNext-pNext)~^~implicit +VALIDATION_ERROR_3a82b00b~^~Y~^~None~^~VkFenceGetWin32HandleInfoKHR~^~VUID-VkFenceGetWin32HandleInfoKHR-sType-sType~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-sType-sType)~^~implicit +VALIDATION_ERROR_3aa05601~^~Y~^~None~^~vkImportFenceWin32HandleKHR~^~VUID-vkImportFenceWin32HandleKHR-device-parameter~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportFenceWin32HandleKHR-device-parameter)~^~implicit +VALIDATION_ERROR_3aa3aa01~^~N~^~None~^~vkImportFenceWin32HandleKHR~^~VUID-vkImportFenceWin32HandleKHR-pImportFenceWin32HandleInfo-parameter~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'pImportFenceWin32HandleInfo must be a valid pointer to a valid VkImportFenceWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportFenceWin32HandleKHR-pImportFenceWin32HandleInfo-parameter)~^~implicit +VALIDATION_ERROR_3ac05601~^~Y~^~None~^~vkGetFenceWin32HandleKHR~^~VUID-vkGetFenceWin32HandleKHR-device-parameter~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetFenceWin32HandleKHR-device-parameter)~^~implicit +VALIDATION_ERROR_3ac17c01~^~Y~^~None~^~vkGetFenceWin32HandleKHR~^~VUID-vkGetFenceWin32HandleKHR-pHandle-parameter~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'pHandle must be a valid pointer to a HANDLE value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetFenceWin32HandleKHR-pHandle-parameter)~^~implicit +VALIDATION_ERROR_3ac3a001~^~N~^~None~^~vkGetFenceWin32HandleKHR~^~VUID-vkGetFenceWin32HandleKHR-pGetWin32HandleInfo-parameter~^~(VK_KHR_external_fence_win32)~^~The spec valid usage text states 'pGetWin32HandleInfo must be a valid pointer to a valid VkFenceGetWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetFenceWin32HandleKHR-pGetWin32HandleInfo-parameter)~^~implicit +VALIDATION_ERROR_3ae008d8~^~N~^~None~^~VkSemaphoreGetFdInfoKHR~^~VUID-VkSemaphoreGetFdInfoKHR-handleType-01132~^~(VK_KHR_external_semaphore_fd)~^~The spec valid usage text states 'handleType must have been included in VkExportSemaphoreCreateInfo::handleTypes when semaphore's current payload was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-handleType-01132)~^~ +VALIDATION_ERROR_3ae008da~^~N~^~None~^~VkSemaphoreGetFdInfoKHR~^~VUID-VkSemaphoreGetFdInfoKHR-semaphore-01133~^~(VK_KHR_external_semaphore_fd)~^~The spec valid usage text states 'semaphore must not currently have its payload replaced by an imported payload as described below in Importing Semaphore Payloads unless that imported payload's handle type was included in VkExternalSemaphoreProperties::exportFromImportedHandleTypes for handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-semaphore-01133)~^~ +VALIDATION_ERROR_3ae008dc~^~N~^~None~^~VkSemaphoreGetFdInfoKHR~^~VUID-VkSemaphoreGetFdInfoKHR-handleType-01134~^~(VK_KHR_external_semaphore_fd)~^~The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, as defined below in Importing Semaphore Payloads, there must be no queue waiting on semaphore.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-handleType-01134)~^~ +VALIDATION_ERROR_3ae008de~^~N~^~None~^~VkSemaphoreGetFdInfoKHR~^~VUID-VkSemaphoreGetFdInfoKHR-handleType-01135~^~(VK_KHR_external_semaphore_fd)~^~The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, semaphore must be signaled, or have an associated semaphore signal operation pending execution.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-handleType-01135)~^~ +VALIDATION_ERROR_3ae008e0~^~N~^~None~^~VkSemaphoreGetFdInfoKHR~^~VUID-VkSemaphoreGetFdInfoKHR-handleType-01136~^~(VK_KHR_external_semaphore_fd)~^~The spec valid usage text states 'handleType must be defined as a POSIX file descriptor handle.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-handleType-01136)~^~ +VALIDATION_ERROR_3ae09c01~^~Y~^~None~^~VkSemaphoreGetFdInfoKHR~^~VUID-VkSemaphoreGetFdInfoKHR-handleType-parameter~^~(VK_KHR_external_semaphore_fd)~^~The spec valid usage text states 'handleType must be a valid VkExternalSemaphoreHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-handleType-parameter)~^~implicit +VALIDATION_ERROR_3ae1c40d~^~Y~^~None~^~VkSemaphoreGetFdInfoKHR~^~VUID-VkSemaphoreGetFdInfoKHR-pNext-pNext~^~(VK_KHR_external_semaphore_fd)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-pNext-pNext)~^~implicit +VALIDATION_ERROR_3ae2b00b~^~Y~^~None~^~VkSemaphoreGetFdInfoKHR~^~VUID-VkSemaphoreGetFdInfoKHR-sType-sType~^~(VK_KHR_external_semaphore_fd)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-sType-sType)~^~implicit +VALIDATION_ERROR_3ae2b801~^~Y~^~None~^~VkSemaphoreGetFdInfoKHR~^~VUID-VkSemaphoreGetFdInfoKHR-semaphore-parameter~^~(VK_KHR_external_semaphore_fd)~^~The spec valid usage text states 'semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-semaphore-parameter)~^~implicit +VALIDATION_ERROR_3b0008cc~^~N~^~None~^~VkSemaphoreGetWin32HandleInfoKHR~^~VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01126~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'handleType must have been included in VkExportSemaphoreCreateInfo::handleTypes when the semaphore's current payload was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01126)~^~ +VALIDATION_ERROR_3b0008ce~^~N~^~None~^~VkSemaphoreGetWin32HandleInfoKHR~^~VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01127~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'If handleType is defined as an NT handle, vkGetSemaphoreWin32HandleKHR must be called no more than once for each valid unique combination of semaphore and handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01127)~^~ +VALIDATION_ERROR_3b0008d0~^~N~^~None~^~VkSemaphoreGetWin32HandleInfoKHR~^~VUID-VkSemaphoreGetWin32HandleInfoKHR-semaphore-01128~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'semaphore must not currently have its payload replaced by an imported payload as described below in Importing Semaphore Payloads unless that imported payload's handle type was included in VkExternalSemaphoreProperties::exportFromImportedHandleTypes for handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-semaphore-01128)~^~ +VALIDATION_ERROR_3b0008d2~^~N~^~None~^~VkSemaphoreGetWin32HandleInfoKHR~^~VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01129~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, as defined below in Importing Semaphore Payloads, there must be no queue waiting on semaphore.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01129)~^~ +VALIDATION_ERROR_3b0008d4~^~N~^~None~^~VkSemaphoreGetWin32HandleInfoKHR~^~VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01130~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, semaphore must be signaled, or have an associated semaphore signal operation pending execution.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01130)~^~ +VALIDATION_ERROR_3b0008d6~^~N~^~None~^~VkSemaphoreGetWin32HandleInfoKHR~^~VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01131~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'handleType must be defined as an NT handle or a global share handle.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01131)~^~ +VALIDATION_ERROR_3b009c01~^~Y~^~None~^~VkSemaphoreGetWin32HandleInfoKHR~^~VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-parameter~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'handleType must be a valid VkExternalSemaphoreHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-parameter)~^~implicit +VALIDATION_ERROR_3b01c40d~^~Y~^~None~^~VkSemaphoreGetWin32HandleInfoKHR~^~VUID-VkSemaphoreGetWin32HandleInfoKHR-pNext-pNext~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-pNext-pNext)~^~implicit +VALIDATION_ERROR_3b02b00b~^~Y~^~None~^~VkSemaphoreGetWin32HandleInfoKHR~^~VUID-VkSemaphoreGetWin32HandleInfoKHR-sType-sType~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-sType-sType)~^~implicit +VALIDATION_ERROR_3b02b801~^~Y~^~None~^~VkSemaphoreGetWin32HandleInfoKHR~^~VUID-VkSemaphoreGetWin32HandleInfoKHR-semaphore-parameter~^~(VK_KHR_external_semaphore_win32)~^~The spec valid usage text states 'semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-semaphore-parameter)~^~implicit +VALIDATION_ERROR_3b20053e~^~N~^~None~^~VkMemoryGetFdInfoKHR~^~VUID-VkMemoryGetFdInfoKHR-handleType-00671~^~(VK_KHR_external_memory_fd)~^~The spec valid usage text states 'handleType must have been included in VkExportMemoryAllocateInfo::handleTypes when memory was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-handleType-00671)~^~ +VALIDATION_ERROR_3b200540~^~N~^~None~^~VkMemoryGetFdInfoKHR~^~VUID-VkMemoryGetFdInfoKHR-handleType-00672~^~(VK_KHR_external_memory_fd)~^~The spec valid usage text states 'handleType must be defined as a POSIX file descriptor handle.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-handleType-00672)~^~ +VALIDATION_ERROR_3b209c01~^~Y~^~None~^~VkMemoryGetFdInfoKHR~^~VUID-VkMemoryGetFdInfoKHR-handleType-parameter~^~(VK_KHR_external_memory_fd)~^~The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-handleType-parameter)~^~implicit +VALIDATION_ERROR_3b20c601~^~Y~^~None~^~VkMemoryGetFdInfoKHR~^~VUID-VkMemoryGetFdInfoKHR-memory-parameter~^~(VK_KHR_external_memory_fd)~^~The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-memory-parameter)~^~implicit +VALIDATION_ERROR_3b21c40d~^~Y~^~None~^~VkMemoryGetFdInfoKHR~^~VUID-VkMemoryGetFdInfoKHR-pNext-pNext~^~(VK_KHR_external_memory_fd)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-pNext-pNext)~^~implicit +VALIDATION_ERROR_3b22b00b~^~Y~^~None~^~VkMemoryGetFdInfoKHR~^~VUID-VkMemoryGetFdInfoKHR-sType-sType~^~(VK_KHR_external_memory_fd)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-sType-sType)~^~implicit +VALIDATION_ERROR_3b40052c~^~N~^~None~^~VkMemoryGetWin32HandleInfoKHR~^~VUID-VkMemoryGetWin32HandleInfoKHR-handleType-00662~^~(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'handleType must have been included in VkExportMemoryAllocateInfo::handleTypes when memory was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-handleType-00662)~^~ +VALIDATION_ERROR_3b40052e~^~N~^~None~^~VkMemoryGetWin32HandleInfoKHR~^~VUID-VkMemoryGetWin32HandleInfoKHR-handleType-00663~^~(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'If handleType is defined as an NT handle, vkGetMemoryWin32HandleKHR must be called no more than once for each valid unique combination of memory and handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-handleType-00663)~^~ +VALIDATION_ERROR_3b400530~^~N~^~None~^~VkMemoryGetWin32HandleInfoKHR~^~VUID-VkMemoryGetWin32HandleInfoKHR-handleType-00664~^~(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'handleType must be defined as an NT handle or a global share handle.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-handleType-00664)~^~ +VALIDATION_ERROR_3b409c01~^~Y~^~None~^~VkMemoryGetWin32HandleInfoKHR~^~VUID-VkMemoryGetWin32HandleInfoKHR-handleType-parameter~^~(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-handleType-parameter)~^~implicit +VALIDATION_ERROR_3b40c601~^~Y~^~None~^~VkMemoryGetWin32HandleInfoKHR~^~VUID-VkMemoryGetWin32HandleInfoKHR-memory-parameter~^~(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-memory-parameter)~^~implicit +VALIDATION_ERROR_3b41c40d~^~Y~^~None~^~VkMemoryGetWin32HandleInfoKHR~^~VUID-VkMemoryGetWin32HandleInfoKHR-pNext-pNext~^~(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-pNext-pNext)~^~implicit +VALIDATION_ERROR_3b42b00b~^~Y~^~None~^~VkMemoryGetWin32HandleInfoKHR~^~VUID-VkMemoryGetWin32HandleInfoKHR-sType-sType~^~(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-sType-sType)~^~implicit +VALIDATION_ERROR_3b62b00b~^~N~^~None~^~VkMemoryDedicatedRequirements~^~VUID-VkMemoryDedicatedRequirements-sType-sType~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedRequirements-sType-sType)~^~implicit +VALIDATION_ERROR_3b800009~^~N~^~None~^~VkMemoryDedicatedAllocateInfo~^~VUID-VkMemoryDedicatedAllocateInfo-commonparent~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'Both of buffer, and image that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-commonparent)~^~implicit +VALIDATION_ERROR_3b800b30~^~N~^~None~^~VkMemoryDedicatedAllocateInfo~^~VUID-VkMemoryDedicatedAllocateInfo-image-01432~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'At least one of image and buffer must be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-image-01432)~^~ +VALIDATION_ERROR_3b800b32~^~N~^~None~^~VkMemoryDedicatedAllocateInfo~^~VUID-VkMemoryDedicatedAllocateInfo-image-01433~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If image is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-image-01433)~^~ +VALIDATION_ERROR_3b800b34~^~N~^~None~^~VkMemoryDedicatedAllocateInfo~^~VUID-VkMemoryDedicatedAllocateInfo-image-01434~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If image is not VK_NULL_HANDLE, image must have been created without VK_IMAGE_CREATE_SPARSE_BINDING_BIT set in VkImageCreateInfo::flags' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-image-01434)~^~ +VALIDATION_ERROR_3b800b36~^~N~^~None~^~VkMemoryDedicatedAllocateInfo~^~VUID-VkMemoryDedicatedAllocateInfo-buffer-01435~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-buffer-01435)~^~ +VALIDATION_ERROR_3b800b38~^~N~^~None~^~VkMemoryDedicatedAllocateInfo~^~VUID-VkMemoryDedicatedAllocateInfo-buffer-01436~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, buffer must have been created without VK_BUFFER_CREATE_SPARSE_BINDING_BIT set in VkBufferCreateInfo::flags' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-buffer-01436)~^~ +VALIDATION_ERROR_3b800e0a~^~N~^~None~^~VkMemoryDedicatedAllocateInfo~^~VUID-VkMemoryDedicatedAllocateInfo-image-01797~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)+(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If image is not VK_NULL_HANDLE, image must not have been created with VK_IMAGE_CREATE_DISJOINT_BIT set in VkImageCreateInfo::flags' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-image-01797)~^~ +VALIDATION_ERROR_3b800ea8~^~N~^~None~^~VkMemoryDedicatedAllocateInfo~^~VUID-VkMemoryDedicatedAllocateInfo-image-01876~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)+(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'If image is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation with handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, and the external handle was created by the Vulkan API, then the memory being imported must also be a dedicated image allocation and image must be identical to the image associated with the imported memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-image-01876)~^~ +VALIDATION_ERROR_3b800eaa~^~N~^~None~^~VkMemoryDedicatedAllocateInfo~^~VUID-VkMemoryDedicatedAllocateInfo-buffer-01877~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)+(VK_KHR_external_memory_win32)~^~The spec valid usage text states 'If buffer is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation with handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, and the external handle was created by the Vulkan API, then the memory being imported must also be a dedicated buffer allocation and buffer must be identical to the buffer associated with the imported memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-buffer-01877)~^~ +VALIDATION_ERROR_3b800eac~^~N~^~None~^~VkMemoryDedicatedAllocateInfo~^~VUID-VkMemoryDedicatedAllocateInfo-image-01878~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)+(VK_KHR_external_memory_fd)~^~The spec valid usage text states 'If image is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation with handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT, the memory being imported must also be a dedicated image allocation and image must be identical to the image associated with the imported memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-image-01878)~^~ +VALIDATION_ERROR_3b800eae~^~N~^~None~^~VkMemoryDedicatedAllocateInfo~^~VUID-VkMemoryDedicatedAllocateInfo-buffer-01879~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)+(VK_KHR_external_memory_fd)~^~The spec valid usage text states 'If buffer is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation with handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT, the memory being imported must also be a dedicated buffer allocation and buffer must be identical to the buffer associated with the imported memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-buffer-01879)~^~ +VALIDATION_ERROR_3b801a01~^~N~^~None~^~VkMemoryDedicatedAllocateInfo~^~VUID-VkMemoryDedicatedAllocateInfo-buffer-parameter~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-buffer-parameter)~^~implicit +VALIDATION_ERROR_3b80a001~^~N~^~None~^~VkMemoryDedicatedAllocateInfo~^~VUID-VkMemoryDedicatedAllocateInfo-image-parameter~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'If image is not VK_NULL_HANDLE, image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-image-parameter)~^~implicit +VALIDATION_ERROR_3b82b00b~^~N~^~None~^~VkMemoryDedicatedAllocateInfo~^~VUID-VkMemoryDedicatedAllocateInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_dedicated_allocation)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-sType-sType)~^~implicit +VALIDATION_ERROR_3ba01a01~^~Y~^~None~^~VkBufferMemoryRequirementsInfo2~^~VUID-VkBufferMemoryRequirementsInfo2-buffer-parameter~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryRequirementsInfo2-buffer-parameter)~^~implicit +VALIDATION_ERROR_3ba1c40d~^~Y~^~None~^~VkBufferMemoryRequirementsInfo2~^~VUID-VkBufferMemoryRequirementsInfo2-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryRequirementsInfo2-pNext-pNext)~^~implicit +VALIDATION_ERROR_3ba2b00b~^~Y~^~None~^~VkBufferMemoryRequirementsInfo2~^~VUID-VkBufferMemoryRequirementsInfo2-sType-sType~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryRequirementsInfo2-sType-sType)~^~implicit +VALIDATION_ERROR_3bc00c6a~^~N~^~None~^~VkImageMemoryRequirementsInfo2~^~VUID-VkImageMemoryRequirementsInfo2-image-01589~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If image was created with a multi-planar format and the VK_IMAGE_CREATE_DISJOINT_BIT flag, there must be a VkImagePlaneMemoryRequirementsInfo in the pNext chain of the VkImageMemoryRequirementsInfo2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2-image-01589)~^~ +VALIDATION_ERROR_3bc00c6c~^~N~^~None~^~VkImageMemoryRequirementsInfo2~^~VUID-VkImageMemoryRequirementsInfo2-image-01590~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If image was not created with the VK_IMAGE_CREATE_DISJOINT_BIT flag, there must not be a VkImagePlaneMemoryRequirementsInfo in the pNext chain of the VkImageMemoryRequirementsInfo2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2-image-01590)~^~ +VALIDATION_ERROR_3bc00c6e~^~N~^~None~^~VkImageMemoryRequirementsInfo2~^~VUID-VkImageMemoryRequirementsInfo2-image-01591~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If image was created with a single-plane format, there must not be a VkImagePlaneMemoryRequirementsInfo in the pNext chain of the VkImageMemoryRequirementsInfo2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2-image-01591)~^~ +VALIDATION_ERROR_3bc00ed2~^~N~^~None~^~VkImageMemoryRequirementsInfo2~^~VUID-VkImageMemoryRequirementsInfo2-image-01897~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)+(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'If image was created with the VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID external memory handle type, then image must be bound to memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2-image-01897)~^~ +VALIDATION_ERROR_3bc0a001~^~Y~^~None~^~VkImageMemoryRequirementsInfo2~^~VUID-VkImageMemoryRequirementsInfo2-image-parameter~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2-image-parameter)~^~implicit +VALIDATION_ERROR_3bc1c40d~^~Y~^~None~^~VkImageMemoryRequirementsInfo2~^~VUID-VkImageMemoryRequirementsInfo2-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkImagePlaneMemoryRequirementsInfo' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2-pNext-pNext)~^~implicit +VALIDATION_ERROR_3bc2b00b~^~Y~^~None~^~VkImageMemoryRequirementsInfo2~^~VUID-VkImageMemoryRequirementsInfo2-sType-sType~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2-sType-sType)~^~implicit +VALIDATION_ERROR_3be0a001~^~Y~^~None~^~VkImageSparseMemoryRequirementsInfo2~^~VUID-VkImageSparseMemoryRequirementsInfo2-image-parameter~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageSparseMemoryRequirementsInfo2-image-parameter)~^~implicit +VALIDATION_ERROR_3be1c40d~^~Y~^~None~^~VkImageSparseMemoryRequirementsInfo2~^~VUID-VkImageSparseMemoryRequirementsInfo2-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageSparseMemoryRequirementsInfo2-pNext-pNext)~^~implicit +VALIDATION_ERROR_3be2b00b~^~Y~^~None~^~VkImageSparseMemoryRequirementsInfo2~^~VUID-VkImageSparseMemoryRequirementsInfo2-sType-sType~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageSparseMemoryRequirementsInfo2-sType-sType)~^~implicit +VALIDATION_ERROR_3c01c40d~^~N~^~None~^~VkMemoryRequirements2~^~VUID-VkMemoryRequirements2-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkMemoryDedicatedRequirements' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryRequirements2-pNext-pNext)~^~implicit +VALIDATION_ERROR_3c02b00b~^~Y~^~None~^~VkMemoryRequirements2~^~VUID-VkMemoryRequirements2-sType-sType~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryRequirements2-sType-sType)~^~implicit +VALIDATION_ERROR_3c21c40d~^~N~^~None~^~VkSparseImageMemoryRequirements2~^~VUID-VkSparseImageMemoryRequirements2-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSparseImageMemoryRequirements2-pNext-pNext)~^~implicit +VALIDATION_ERROR_3c22b00b~^~N~^~None~^~VkSparseImageMemoryRequirements2~^~VUID-VkSparseImageMemoryRequirements2-sType-sType~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSparseImageMemoryRequirements2-sType-sType)~^~implicit +VALIDATION_ERROR_3c405601~^~Y~^~None~^~vkGetImageMemoryRequirements2~^~VUID-vkGetImageMemoryRequirements2-device-parameter~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageMemoryRequirements2-device-parameter)~^~implicit +VALIDATION_ERROR_3c41b401~^~N~^~None~^~vkGetImageMemoryRequirements2~^~VUID-vkGetImageMemoryRequirements2-pMemoryRequirements-parameter~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'pMemoryRequirements must be a valid pointer to a VkMemoryRequirements2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageMemoryRequirements2-pMemoryRequirements-parameter)~^~implicit +VALIDATION_ERROR_3c439c01~^~N~^~None~^~vkGetImageMemoryRequirements2~^~VUID-vkGetImageMemoryRequirements2-pInfo-parameter~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'pInfo must be a valid pointer to a valid VkImageMemoryRequirementsInfo2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageMemoryRequirements2-pInfo-parameter)~^~implicit +VALIDATION_ERROR_3c605601~^~Y~^~None~^~vkGetBufferMemoryRequirements2~^~VUID-vkGetBufferMemoryRequirements2-device-parameter~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetBufferMemoryRequirements2-device-parameter)~^~implicit +VALIDATION_ERROR_3c61b401~^~N~^~None~^~vkGetBufferMemoryRequirements2~^~VUID-vkGetBufferMemoryRequirements2-pMemoryRequirements-parameter~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'pMemoryRequirements must be a valid pointer to a VkMemoryRequirements2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetBufferMemoryRequirements2-pMemoryRequirements-parameter)~^~implicit +VALIDATION_ERROR_3c639c01~^~N~^~None~^~vkGetBufferMemoryRequirements2~^~VUID-vkGetBufferMemoryRequirements2-pInfo-parameter~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'pInfo must be a valid pointer to a valid VkBufferMemoryRequirementsInfo2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetBufferMemoryRequirements2-pInfo-parameter)~^~implicit +VALIDATION_ERROR_3c805601~^~Y~^~None~^~vkGetImageSparseMemoryRequirements2~^~VUID-vkGetImageSparseMemoryRequirements2-device-parameter~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageSparseMemoryRequirements2-device-parameter)~^~implicit +VALIDATION_ERROR_3c823601~^~N~^~None~^~vkGetImageSparseMemoryRequirements2~^~VUID-vkGetImageSparseMemoryRequirements2-pSparseMemoryRequirementCount-parameter~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'pSparseMemoryRequirementCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageSparseMemoryRequirements2-pSparseMemoryRequirementCount-parameter)~^~implicit +VALIDATION_ERROR_3c823801~^~Y~^~None~^~vkGetImageSparseMemoryRequirements2~^~VUID-vkGetImageSparseMemoryRequirements2-pSparseMemoryRequirements-parameter~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'If the value referenced by pSparseMemoryRequirementCount is not 0, and pSparseMemoryRequirements is not NULL, pSparseMemoryRequirements must be a valid pointer to an array of pSparseMemoryRequirementCount VkSparseImageMemoryRequirements2 structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageSparseMemoryRequirements2-pSparseMemoryRequirements-parameter)~^~implicit +VALIDATION_ERROR_3c839c01~^~N~^~None~^~vkGetImageSparseMemoryRequirements2~^~VUID-vkGetImageSparseMemoryRequirements2-pInfo-parameter~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)~^~The spec valid usage text states 'pInfo must be a valid pointer to a valid VkImageSparseMemoryRequirementsInfo2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageSparseMemoryRequirements2-pInfo-parameter)~^~implicit +VALIDATION_ERROR_3ca2b00b~^~N~^~None~^~VkPhysicalDevice16BitStorageFeatures~^~VUID-VkPhysicalDevice16BitStorageFeatures-sType-sType~^~(VK_VERSION_1_1,VK_KHR_16bit_storage)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDevice16BitStorageFeatures-sType-sType)~^~implicit +VALIDATION_ERROR_3cc00b2e~^~N~^~None~^~VkPhysicalDeviceVariablePointerFeatures~^~VUID-VkPhysicalDeviceVariablePointerFeatures-variablePointers-01431~^~(VK_VERSION_1_1,VK_KHR_variable_pointers)~^~The spec valid usage text states 'If variablePointers is enabled then variablePointersStorageBuffer must also be enabled.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceVariablePointerFeatures-variablePointers-01431)~^~ +VALIDATION_ERROR_3cc2b00b~^~N~^~None~^~VkPhysicalDeviceVariablePointerFeatures~^~VUID-VkPhysicalDeviceVariablePointerFeatures-sType-sType~^~(VK_VERSION_1_1,VK_KHR_variable_pointers)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceVariablePointerFeatures-sType-sType)~^~implicit +VALIDATION_ERROR_3ce00bec~^~N~^~None~^~VkSampleLocationsInfoEXT~^~VUID-VkSampleLocationsInfoEXT-sampleLocationsPerPixel-01526~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'sampleLocationsPerPixel must be a bit value that is set in VkPhysicalDeviceSampleLocationsPropertiesEXT::sampleLocationSampleCounts' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sampleLocationsPerPixel-01526)~^~ +VALIDATION_ERROR_3ce00bee~^~N~^~None~^~VkSampleLocationsInfoEXT~^~VUID-VkSampleLocationsInfoEXT-sampleLocationsCount-01527~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'sampleLocationsCount must equal sampleLocationsPerPixel {times} sampleLocationGridSize.width {times} sampleLocationGridSize.height' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sampleLocationsCount-01527)~^~ +VALIDATION_ERROR_3ce2b00b~^~Y~^~None~^~VkSampleLocationsInfoEXT~^~VUID-VkSampleLocationsInfoEXT-sType-sType~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_3ce3b201~^~Y~^~None~^~VkSampleLocationsInfoEXT~^~VUID-VkSampleLocationsInfoEXT-sampleLocationsPerPixel-parameter~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'sampleLocationsPerPixel must be a valid VkSampleCountFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sampleLocationsPerPixel-parameter)~^~implicit +VALIDATION_ERROR_3ce3b41b~^~Y~^~None~^~VkSampleLocationsInfoEXT~^~VUID-VkSampleLocationsInfoEXT-sampleLocationsCount-arraylength~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'sampleLocationsCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sampleLocationsCount-arraylength)~^~implicit +VALIDATION_ERROR_3ce3b601~^~Y~^~None~^~VkSampleLocationsInfoEXT~^~VUID-VkSampleLocationsInfoEXT-pSampleLocations-parameter~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'pSampleLocations must be a valid pointer to an array of sampleLocationsCount VkSampleLocationEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-pSampleLocations-parameter)~^~implicit +VALIDATION_ERROR_3d02b00b~^~N~^~None~^~VkRenderPassSampleLocationsBeginInfoEXT~^~VUID-VkRenderPassSampleLocationsBeginInfoEXT-sType-sType~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassSampleLocationsBeginInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_3d03ba01~^~N~^~None~^~VkRenderPassSampleLocationsBeginInfoEXT~^~VUID-VkRenderPassSampleLocationsBeginInfoEXT-pAttachmentInitialSampleLocations-parameter~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If attachmentInitialSampleLocationsCount is not 0, pAttachmentInitialSampleLocations must be a valid pointer to an array of attachmentInitialSampleLocationsCount valid VkAttachmentSampleLocationsEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassSampleLocationsBeginInfoEXT-pAttachmentInitialSampleLocations-parameter)~^~implicit +VALIDATION_ERROR_3d03e801~^~N~^~None~^~VkRenderPassSampleLocationsBeginInfoEXT~^~VUID-VkRenderPassSampleLocationsBeginInfoEXT-pPostSubpassSampleLocations-parameter~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If postSubpassSampleLocationsCount is not 0, pPostSubpassSampleLocations must be a valid pointer to an array of postSubpassSampleLocationsCount valid VkSubpassSampleLocationsEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassSampleLocationsBeginInfoEXT-pPostSubpassSampleLocations-parameter)~^~implicit +VALIDATION_ERROR_3d22b00b~^~N~^~None~^~VkPipelineSampleLocationsStateCreateInfoEXT~^~VUID-VkPipelineSampleLocationsStateCreateInfoEXT-sType-sType~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineSampleLocationsStateCreateInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_3d23c601~^~N~^~None~^~VkPipelineSampleLocationsStateCreateInfoEXT~^~VUID-VkPipelineSampleLocationsStateCreateInfoEXT-sampleLocationsInfo-parameter~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'sampleLocationsInfo must be a valid VkSampleLocationsInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineSampleLocationsStateCreateInfoEXT-sampleLocationsInfo-parameter)~^~implicit +VALIDATION_ERROR_3d42b00b~^~N~^~None~^~VkPhysicalDeviceSampleLocationsPropertiesEXT~^~VUID-VkPhysicalDeviceSampleLocationsPropertiesEXT-sType-sType~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSampleLocationsPropertiesEXT-sType-sType)~^~implicit +VALIDATION_ERROR_3d61c40d~^~N~^~None~^~VkMultisamplePropertiesEXT~^~VUID-VkMultisamplePropertiesEXT-pNext-pNext~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMultisamplePropertiesEXT-pNext-pNext)~^~implicit +VALIDATION_ERROR_3d62b00b~^~Y~^~None~^~VkMultisamplePropertiesEXT~^~VUID-VkMultisamplePropertiesEXT-sType-sType~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMultisamplePropertiesEXT-sType-sType)~^~implicit +VALIDATION_ERROR_3d827a01~^~Y~^~None~^~vkGetPhysicalDeviceMultisamplePropertiesEXT~^~VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-physicalDevice-parameter~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-physicalDevice-parameter)~^~implicit +VALIDATION_ERROR_3d82b401~^~Y~^~None~^~vkGetPhysicalDeviceMultisamplePropertiesEXT~^~VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-samples-parameter~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'samples must be a valid VkSampleCountFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-samples-parameter)~^~implicit +VALIDATION_ERROR_3d83ca01~^~N~^~None~^~vkGetPhysicalDeviceMultisamplePropertiesEXT~^~VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-pMultisampleProperties-parameter~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'pMultisampleProperties must be a valid pointer to a VkMultisamplePropertiesEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-pMultisampleProperties-parameter)~^~implicit +VALIDATION_ERROR_3da00bfc~^~N~^~None~^~VkValidationCacheCreateInfoEXT~^~VUID-VkValidationCacheCreateInfoEXT-initialDataSize-01534~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'If initialDataSize is not 0, it must be equal to the size of pInitialData, as returned by vkGetValidationCacheDataEXT when pInitialData was originally retrieved' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-initialDataSize-01534)~^~ +VALIDATION_ERROR_3da00bfe~^~N~^~None~^~VkValidationCacheCreateInfoEXT~^~VUID-VkValidationCacheCreateInfoEXT-initialDataSize-01535~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'If initialDataSize is not 0, pInitialData must have been retrieved from a previous call to vkGetValidationCacheDataEXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-initialDataSize-01535)~^~ +VALIDATION_ERROR_3da09005~^~Y~^~None~^~VkValidationCacheCreateInfoEXT~^~VUID-VkValidationCacheCreateInfoEXT-flags-zerobitmask~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-flags-zerobitmask)~^~implicit +VALIDATION_ERROR_3da19601~^~Y~^~None~^~VkValidationCacheCreateInfoEXT~^~VUID-VkValidationCacheCreateInfoEXT-pInitialData-parameter~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'If initialDataSize is not 0, pInitialData must be a valid pointer to an array of initialDataSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-pInitialData-parameter)~^~implicit +VALIDATION_ERROR_3da1c40d~^~Y~^~None~^~VkValidationCacheCreateInfoEXT~^~VUID-VkValidationCacheCreateInfoEXT-pNext-pNext~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-pNext-pNext)~^~implicit +VALIDATION_ERROR_3da2b00b~^~Y~^~None~^~VkValidationCacheCreateInfoEXT~^~VUID-VkValidationCacheCreateInfoEXT-sType-sType~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_3dc2b00b~^~N~^~None~^~VkShaderModuleValidationCacheCreateInfoEXT~^~VUID-VkShaderModuleValidationCacheCreateInfoEXT-sType-sType~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkShaderModuleValidationCacheCreateInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_3dc3c401~^~N~^~None~^~VkShaderModuleValidationCacheCreateInfoEXT~^~VUID-VkShaderModuleValidationCacheCreateInfoEXT-validationCache-parameter~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'validationCache must be a valid VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkShaderModuleValidationCacheCreateInfoEXT-validationCache-parameter)~^~implicit +VALIDATION_ERROR_3de05601~^~Y~^~None~^~vkCreateValidationCacheEXT~^~VUID-vkCreateValidationCacheEXT-device-parameter~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateValidationCacheEXT-device-parameter)~^~implicit +VALIDATION_ERROR_3de0ec01~^~N~^~None~^~vkCreateValidationCacheEXT~^~VUID-vkCreateValidationCacheEXT-pAllocator-parameter~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateValidationCacheEXT-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_3de11e01~^~N~^~None~^~vkCreateValidationCacheEXT~^~VUID-vkCreateValidationCacheEXT-pCreateInfo-parameter~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkValidationCacheCreateInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateValidationCacheEXT-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_3de3c201~^~Y~^~None~^~vkCreateValidationCacheEXT~^~VUID-vkCreateValidationCacheEXT-pValidationCache-parameter~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'pValidationCache must be a valid pointer to a VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateValidationCacheEXT-pValidationCache-parameter)~^~implicit +VALIDATION_ERROR_3e005601~^~Y~^~None~^~vkGetValidationCacheDataEXT~^~VUID-vkGetValidationCacheDataEXT-device-parameter~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-device-parameter)~^~implicit +VALIDATION_ERROR_3e012201~^~Y~^~None~^~vkGetValidationCacheDataEXT~^~VUID-vkGetValidationCacheDataEXT-pData-parameter~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'If the value referenced by pDataSize is not 0, and pData is not NULL, pData must be a valid pointer to an array of pDataSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-pData-parameter)~^~implicit +VALIDATION_ERROR_3e012401~^~N~^~None~^~vkGetValidationCacheDataEXT~^~VUID-vkGetValidationCacheDataEXT-pDataSize-parameter~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'pDataSize must be a valid pointer to a size_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-pDataSize-parameter)~^~implicit +VALIDATION_ERROR_3e03c401~^~Y~^~None~^~vkGetValidationCacheDataEXT~^~VUID-vkGetValidationCacheDataEXT-validationCache-parameter~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'validationCache must be a valid VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-validationCache-parameter)~^~implicit +VALIDATION_ERROR_3e03c407~^~Y~^~None~^~vkGetValidationCacheDataEXT~^~VUID-vkGetValidationCacheDataEXT-validationCache-parent~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'validationCache must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-validationCache-parent)~^~implicit +VALIDATION_ERROR_3e200bf0~^~N~^~None~^~vkCmdSetSampleLocationsEXT~^~VUID-vkCmdSetSampleLocationsEXT-None-01528~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-None-01528)~^~ +VALIDATION_ERROR_3e200bf2~^~N~^~None~^~vkCmdSetSampleLocationsEXT~^~VUID-vkCmdSetSampleLocationsEXT-sampleLocationsPerPixel-01529~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'The sampleLocationsPerPixel member of pSampleLocationsInfo must equal the rasterizationSamples member of the VkPipelineMultisampleStateCreateInfo structure the bound graphics pipeline has been created with' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-sampleLocationsPerPixel-01529)~^~ +VALIDATION_ERROR_3e200bf4~^~N~^~None~^~vkCmdSetSampleLocationsEXT~^~VUID-vkCmdSetSampleLocationsEXT-variableSampleLocations-01530~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If VkPhysicalDeviceSampleLocationsPropertiesEXT::variableSampleLocations is VK_FALSE then the current render pass must have been begun by specifying a VkRenderPassSampleLocationsBeginInfoEXT structure whose pPostSubpassSampleLocations member contains an element with a subpassIndex matching the current subpass index and the sampleLocationsInfo member of that element must match the sample locations state pointed to by pSampleLocationsInfo' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-variableSampleLocations-01530)~^~ +VALIDATION_ERROR_3e202401~^~Y~^~None~^~vkCmdSetSampleLocationsEXT~^~VUID-vkCmdSetSampleLocationsEXT-commandBuffer-parameter~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-commandBuffer-parameter)~^~implicit +VALIDATION_ERROR_3e202413~^~Y~^~None~^~vkCmdSetSampleLocationsEXT~^~VUID-vkCmdSetSampleLocationsEXT-commandBuffer-recording~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_3e202415~^~N~^~None~^~vkCmdSetSampleLocationsEXT~^~VUID-vkCmdSetSampleLocationsEXT-commandBuffer-cmdpool~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-commandBuffer-cmdpool)~^~implicit +VALIDATION_ERROR_3e23c801~^~N~^~None~^~vkCmdSetSampleLocationsEXT~^~VUID-vkCmdSetSampleLocationsEXT-pSampleLocationsInfo-parameter~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'pSampleLocationsInfo must be a valid pointer to a valid VkSampleLocationsInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-pSampleLocationsInfo-parameter)~^~implicit +VALIDATION_ERROR_3e400c02~^~N~^~None~^~vkDestroyValidationCacheEXT~^~VUID-vkDestroyValidationCacheEXT-validationCache-01537~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when validationCache was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-validationCache-01537)~^~ +VALIDATION_ERROR_3e400c04~^~N~^~None~^~vkDestroyValidationCacheEXT~^~VUID-vkDestroyValidationCacheEXT-validationCache-01538~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when validationCache was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-validationCache-01538)~^~ +VALIDATION_ERROR_3e405601~^~Y~^~None~^~vkDestroyValidationCacheEXT~^~VUID-vkDestroyValidationCacheEXT-device-parameter~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-device-parameter)~^~implicit +VALIDATION_ERROR_3e40ec01~^~N~^~None~^~vkDestroyValidationCacheEXT~^~VUID-vkDestroyValidationCacheEXT-pAllocator-parameter~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_3e43c401~^~Y~^~None~^~vkDestroyValidationCacheEXT~^~VUID-vkDestroyValidationCacheEXT-validationCache-parameter~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'If validationCache is not VK_NULL_HANDLE, validationCache must be a valid VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-validationCache-parameter)~^~implicit +VALIDATION_ERROR_3e43c407~^~Y~^~None~^~vkDestroyValidationCacheEXT~^~VUID-vkDestroyValidationCacheEXT-validationCache-parent~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'If validationCache is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-validationCache-parent)~^~implicit +VALIDATION_ERROR_3e600c00~^~Y~^~None~^~vkMergeValidationCachesEXT~^~VUID-vkMergeValidationCachesEXT-dstCache-01536~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'dstCache must not appear in the list of source caches' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkMergeValidationCachesEXT-dstCache-01536)~^~ +VALIDATION_ERROR_3e605601~^~Y~^~None~^~vkMergeValidationCachesEXT~^~VUID-vkMergeValidationCachesEXT-device-parameter~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkMergeValidationCachesEXT-device-parameter)~^~implicit +VALIDATION_ERROR_3e606e01~^~Y~^~None~^~vkMergeValidationCachesEXT~^~VUID-vkMergeValidationCachesEXT-dstCache-parameter~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'dstCache must be a valid VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkMergeValidationCachesEXT-dstCache-parameter)~^~implicit +VALIDATION_ERROR_3e606e07~^~Y~^~None~^~vkMergeValidationCachesEXT~^~VUID-vkMergeValidationCachesEXT-dstCache-parent~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'dstCache must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkMergeValidationCachesEXT-dstCache-parent)~^~implicit +VALIDATION_ERROR_3e623c01~^~Y~^~None~^~vkMergeValidationCachesEXT~^~VUID-vkMergeValidationCachesEXT-pSrcCaches-parameter~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'pSrcCaches must be a valid pointer to an array of srcCacheCount valid VkValidationCacheEXT handles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkMergeValidationCachesEXT-pSrcCaches-parameter)~^~implicit +VALIDATION_ERROR_3e623c07~^~Y~^~None~^~vkMergeValidationCachesEXT~^~VUID-vkMergeValidationCachesEXT-pSrcCaches-parent~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'Each element of pSrcCaches must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkMergeValidationCachesEXT-pSrcCaches-parent)~^~implicit +VALIDATION_ERROR_3e62ca1b~^~N~^~None~^~vkMergeValidationCachesEXT~^~VUID-vkMergeValidationCachesEXT-srcCacheCount-arraylength~^~(VK_EXT_validation_cache)~^~The spec valid usage text states 'srcCacheCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkMergeValidationCachesEXT-srcCacheCount-arraylength)~^~implicit +VALIDATION_ERROR_3e800bf6~^~N~^~None~^~VkAttachmentSampleLocationsEXT~^~VUID-VkAttachmentSampleLocationsEXT-attachmentIndex-01531~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'attachmentIndex must be less than the attachmentCount specified in VkRenderPassCreateInfo the render pass specified by VkRenderPassBeginInfo::renderPass was created with' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAttachmentSampleLocationsEXT-attachmentIndex-01531)~^~ +VALIDATION_ERROR_3e83c601~^~N~^~None~^~VkAttachmentSampleLocationsEXT~^~VUID-VkAttachmentSampleLocationsEXT-sampleLocationsInfo-parameter~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'sampleLocationsInfo must be a valid VkSampleLocationsInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAttachmentSampleLocationsEXT-sampleLocationsInfo-parameter)~^~implicit +VALIDATION_ERROR_3ea00bf8~^~N~^~None~^~VkSubpassSampleLocationsEXT~^~VUID-VkSubpassSampleLocationsEXT-subpassIndex-01532~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'subpassIndex must be less than the subpassCount specified in VkRenderPassCreateInfo the render pass specified by VkRenderPassBeginInfo::renderPass was created with' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSubpassSampleLocationsEXT-subpassIndex-01532)~^~ +VALIDATION_ERROR_3ea3c601~^~N~^~None~^~VkSubpassSampleLocationsEXT~^~VUID-VkSubpassSampleLocationsEXT-sampleLocationsInfo-parameter~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'sampleLocationsInfo must be a valid VkSampleLocationsInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSubpassSampleLocationsEXT-sampleLocationsInfo-parameter)~^~implicit +VALIDATION_ERROR_3ec2b00b~^~N~^~None~^~VkPhysicalDevicePointClippingProperties~^~VUID-VkPhysicalDevicePointClippingProperties-sType-sType~^~(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDevicePointClippingProperties-sType-sType)~^~implicit +VALIDATION_ERROR_3ee00c01~^~N~^~None~^~VkInputAttachmentAspectReference~^~VUID-VkInputAttachmentAspectReference-aspectMask-parameter~^~(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'aspectMask must be a valid combination of VkImageAspectFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkInputAttachmentAspectReference-aspectMask-parameter)~^~implicit +VALIDATION_ERROR_3ee00c03~^~N~^~None~^~VkInputAttachmentAspectReference~^~VUID-VkInputAttachmentAspectReference-aspectMask-requiredbitmask~^~(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'aspectMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkInputAttachmentAspectReference-aspectMask-requiredbitmask)~^~implicit +VALIDATION_ERROR_3ee00c40~^~N~^~None~^~VkInputAttachmentAspectReference~^~VUID-VkInputAttachmentAspectReference-pCreateInfo-01568~^~(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'There must be an input attachment at pCreateInfo::pSubpasses[subpass].pInputAttachments[inputAttachmentIndex].' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkInputAttachmentAspectReference-pCreateInfo-01568)~^~ +VALIDATION_ERROR_3ee00c42~^~N~^~None~^~VkInputAttachmentAspectReference~^~VUID-VkInputAttachmentAspectReference-None-01569~^~(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'The specified input attachment must have more than one aspect mask.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkInputAttachmentAspectReference-None-01569)~^~ +VALIDATION_ERROR_3ee00c44~^~N~^~None~^~VkInputAttachmentAspectReference~^~VUID-VkInputAttachmentAspectReference-aspectMask-01570~^~(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'aspectMask must be a subset of the aspect masks in the specified input attachment.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkInputAttachmentAspectReference-aspectMask-01570)~^~ +VALIDATION_ERROR_3f02b00b~^~N~^~None~^~VkRenderPassInputAttachmentAspectCreateInfo~^~VUID-VkRenderPassInputAttachmentAspectCreateInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassInputAttachmentAspectCreateInfo-sType-sType)~^~implicit +VALIDATION_ERROR_3f03ce1b~^~N~^~None~^~VkRenderPassInputAttachmentAspectCreateInfo~^~VUID-VkRenderPassInputAttachmentAspectCreateInfo-aspectReferenceCount-arraylength~^~(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'aspectReferenceCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassInputAttachmentAspectCreateInfo-aspectReferenceCount-arraylength)~^~implicit +VALIDATION_ERROR_3f03d001~^~N~^~None~^~VkRenderPassInputAttachmentAspectCreateInfo~^~VUID-VkRenderPassInputAttachmentAspectCreateInfo-pAspectReferences-parameter~^~(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'pAspectReferences must be a valid pointer to an array of aspectReferenceCount valid VkInputAttachmentAspectReference structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassInputAttachmentAspectCreateInfo-pAspectReferences-parameter)~^~implicit +VALIDATION_ERROR_3f200c66~^~Y~^~InvalidImageViewUsageCreateInfo~^~VkImageViewUsageCreateInfo~^~VUID-VkImageViewUsageCreateInfo-usage-01587~^~(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'usage must not include any set bits that were not set in the usage member of the VkImageCreateInfo structure used to create the image this image view is created from.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewUsageCreateInfo-usage-01587)~^~ +VALIDATION_ERROR_3f22b00b~^~N~^~None~^~VkImageViewUsageCreateInfo~^~VUID-VkImageViewUsageCreateInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewUsageCreateInfo-sType-sType)~^~implicit +VALIDATION_ERROR_3f230601~^~Y~^~InvalidImageViewUsageCreateInfo~^~VkImageViewUsageCreateInfo~^~VUID-VkImageViewUsageCreateInfo-usage-parameter~^~(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'usage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewUsageCreateInfo-usage-parameter)~^~implicit +VALIDATION_ERROR_3f230603~^~Y~^~InvalidImageViewUsageCreateInfo~^~VkImageViewUsageCreateInfo~^~VUID-VkImageViewUsageCreateInfo-usage-requiredbitmask~^~(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewUsageCreateInfo-usage-requiredbitmask)~^~implicit +VALIDATION_ERROR_3f42b00b~^~N~^~None~^~VkPipelineTessellationDomainOriginStateCreateInfo~^~VUID-VkPipelineTessellationDomainOriginStateCreateInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineTessellationDomainOriginStateCreateInfo-sType-sType)~^~implicit +VALIDATION_ERROR_3f43d201~^~N~^~None~^~VkPipelineTessellationDomainOriginStateCreateInfo~^~VUID-VkPipelineTessellationDomainOriginStateCreateInfo-domainOrigin-parameter~^~(VK_VERSION_1_1,VK_KHR_maintenance2)~^~The spec valid usage text states 'domainOrigin must be a valid VkTessellationDomainOrigin value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineTessellationDomainOriginStateCreateInfo-domainOrigin-parameter)~^~implicit +VALIDATION_ERROR_3f600c54~^~N~^~None~^~VkImageFormatListCreateInfoKHR~^~VUID-VkImageFormatListCreateInfoKHR-viewFormatCount-01578~^~(VK_KHR_image_format_list)~^~The spec valid usage text states 'If viewFormatCount is not 0, all of the formats in the pViewFormats array must be compatible with the format specified in the format field of VkImageCreateInfo, as described in the compatibility table.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-viewFormatCount-01578)~^~ +VALIDATION_ERROR_3f600c56~^~N~^~None~^~VkImageFormatListCreateInfoKHR~^~VUID-VkImageFormatListCreateInfoKHR-flags-01579~^~(VK_KHR_image_format_list)~^~The spec valid usage text states 'If VkImageCreateInfo::flags does not contain VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, viewFormatCount must be 0 or 1.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-flags-01579)~^~ +VALIDATION_ERROR_3f600c58~^~N~^~None~^~VkImageFormatListCreateInfoKHR~^~VUID-VkImageFormatListCreateInfoKHR-viewFormatCount-01580~^~(VK_KHR_image_format_list)~^~The spec valid usage text states 'If viewFormatCount is not 0, VkImageCreateInfo::format must be in pViewFormats.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-viewFormatCount-01580)~^~ +VALIDATION_ERROR_3f62b00b~^~N~^~None~^~VkImageFormatListCreateInfoKHR~^~VUID-VkImageFormatListCreateInfoKHR-sType-sType~^~(VK_KHR_image_format_list)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-sType-sType)~^~implicit +VALIDATION_ERROR_3f63e401~^~N~^~None~^~VkImageFormatListCreateInfoKHR~^~VUID-VkImageFormatListCreateInfoKHR-pViewFormats-parameter~^~(VK_KHR_image_format_list)~^~The spec valid usage text states 'If viewFormatCount is not 0, pViewFormats must be a valid pointer to an array of viewFormatCount valid VkFormat values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-pViewFormats-parameter)~^~implicit +VALIDATION_ERROR_3f800ce2~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-format-01649~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)+!(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'format must not be VK_FORMAT_UNDEFINED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-format-01649)~^~ +VALIDATION_ERROR_3f800ce4~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-format-01650~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'format must support VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT or VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-format-01650)~^~ +VALIDATION_ERROR_3f800ce6~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-01651~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the format does not support VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, xChromaOffset and yChromaOffset must not be VK_CHROMA_LOCATION_COSITED_EVEN' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-01651)~^~ +VALIDATION_ERROR_3f800ce8~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-01652~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the format does not support VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT, xChromaOffset and yChromaOffset must not be VK_CHROMA_LOCATION_MIDPOINT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-01652)~^~ +VALIDATION_ERROR_3f800cea~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-format-01653~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'format must represent unsigned normalized values (i.e. the format must be a UNORM format)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-format-01653)~^~ +VALIDATION_ERROR_3f800cec~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-None-01654~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the format has a _422 or _420 suffix:' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-None-01654)~^~ +VALIDATION_ERROR_3f800cee~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrModel-01655~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If ycbcrModel is not VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY, then components.r, components.g, and components.b must correspond to channels of the format; that is, components.r, components.g, and components.b must not be VK_COMPONENT_SWIZZLE_ZERO or VK_COMPONENT_SWIZZLE_ONE, and must not correspond to a channel which contains zero or one as a consequence of conversion to RGBA' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrModel-01655)~^~ +VALIDATION_ERROR_3f800cf0~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-forceExplicitReconstruction-01656~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the format does not support VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT, forceExplicitReconstruction must be FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-forceExplicitReconstruction-01656)~^~ +VALIDATION_ERROR_3f800cf2~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-chromaFilter-01657~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the format does not support VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT, chromaFilter must be VK_FILTER_NEAREST' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-chromaFilter-01657)~^~ +VALIDATION_ERROR_3f800ee0~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-format-01904~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)+(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'If an external format conversion is being created, format must be VK_FORMAT_UNDEFINED, otherwise it must not be VK_FORMAT_UNDEFINED.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-format-01904)~^~ +VALIDATION_ERROR_3f802c01~^~N~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-components-parameter~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'components must be a valid VkComponentMapping structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-components-parameter)~^~implicit +VALIDATION_ERROR_3f809201~^~Y~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-format-parameter~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-format-parameter)~^~implicit +VALIDATION_ERROR_3f81c40d~^~Y~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkExternalFormatANDROID' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-pNext-pNext)~^~implicit +VALIDATION_ERROR_3f82b00b~^~Y~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-sType-sType)~^~implicit +VALIDATION_ERROR_3f83d401~^~Y~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrModel-parameter~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'ycbcrModel must be a valid VkSamplerYcbcrModelConversion value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrModel-parameter)~^~implicit +VALIDATION_ERROR_3f83d601~^~Y~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrRange-parameter~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'ycbcrRange must be a valid VkSamplerYcbcrRange value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrRange-parameter)~^~implicit +VALIDATION_ERROR_3f83d801~^~Y~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-parameter~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'xChromaOffset must be a valid VkChromaLocation value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-parameter)~^~implicit +VALIDATION_ERROR_3f83da01~^~Y~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-yChromaOffset-parameter~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'yChromaOffset must be a valid VkChromaLocation value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-yChromaOffset-parameter)~^~implicit +VALIDATION_ERROR_3f83dc01~^~Y~^~None~^~VkSamplerYcbcrConversionCreateInfo~^~VUID-VkSamplerYcbcrConversionCreateInfo-chromaFilter-parameter~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'chromaFilter must be a valid VkFilter value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-chromaFilter-parameter)~^~implicit +VALIDATION_ERROR_3fa00cd4~^~N~^~None~^~VkBindImagePlaneMemoryInfo~^~VUID-VkBindImagePlaneMemoryInfo-planeAspect-01642~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'planeAspect must be a single valid plane aspect for the image format (that is, planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT or VK_IMAGE_ASPECT_PLANE_1_BIT for "_2PLANE" formats and planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT for "_3PLANE" formats)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImagePlaneMemoryInfo-planeAspect-01642)~^~ +VALIDATION_ERROR_3fa00cd6~^~N~^~None~^~VkBindImagePlaneMemoryInfo~^~VUID-VkBindImagePlaneMemoryInfo-None-01643~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'A single call to vkBindImageMemory2 must bind all or none of the planes of an image (i.e. bindings to all planes of an image must be made in a single vkBindImageMemory2 call), as separate bindings' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImagePlaneMemoryInfo-None-01643)~^~ +VALIDATION_ERROR_3fa2b00b~^~N~^~None~^~VkBindImagePlaneMemoryInfo~^~VUID-VkBindImagePlaneMemoryInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImagePlaneMemoryInfo-sType-sType)~^~implicit +VALIDATION_ERROR_3fa3de01~^~N~^~None~^~VkBindImagePlaneMemoryInfo~^~VUID-VkBindImagePlaneMemoryInfo-planeAspect-parameter~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'planeAspect must be a valid VkImageAspectFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImagePlaneMemoryInfo-planeAspect-parameter)~^~implicit +VALIDATION_ERROR_3fc00c70~^~N~^~None~^~VkImagePlaneMemoryRequirementsInfo~^~VUID-VkImagePlaneMemoryRequirementsInfo-planeAspect-01592~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'planeAspect must be an aspect that exists in the format; that is, for a two-plane image planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT or VK_IMAGE_ASPECT_PLANE_1_BIT, and for a three-plane image planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT or VK_IMAGE_ASPECT_PLANE_2_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImagePlaneMemoryRequirementsInfo-planeAspect-01592)~^~ +VALIDATION_ERROR_3fc2b00b~^~N~^~None~^~VkImagePlaneMemoryRequirementsInfo~^~VUID-VkImagePlaneMemoryRequirementsInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImagePlaneMemoryRequirementsInfo-sType-sType)~^~implicit +VALIDATION_ERROR_3fc3de01~^~N~^~None~^~VkImagePlaneMemoryRequirementsInfo~^~VUID-VkImagePlaneMemoryRequirementsInfo-planeAspect-parameter~^~(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'planeAspect must be a valid VkImageAspectFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImagePlaneMemoryRequirementsInfo-planeAspect-parameter)~^~implicit +VALIDATION_ERROR_3fe00ce0~^~N~^~None~^~vkCreateSamplerYcbcrConversion~^~VUID-vkCreateSamplerYcbcrConversion-None-01648~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'The sampler Y'CBCR conversion feature must be enabled' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversion-None-01648)~^~ +VALIDATION_ERROR_3fe05601~^~Y~^~None~^~vkCreateSamplerYcbcrConversion~^~VUID-vkCreateSamplerYcbcrConversion-device-parameter~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversion-device-parameter)~^~implicit +VALIDATION_ERROR_3fe0ec01~^~N~^~None~^~vkCreateSamplerYcbcrConversion~^~VUID-vkCreateSamplerYcbcrConversion-pAllocator-parameter~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversion-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_3fe11e01~^~N~^~None~^~vkCreateSamplerYcbcrConversion~^~VUID-vkCreateSamplerYcbcrConversion-pCreateInfo-parameter~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkSamplerYcbcrConversionCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversion-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_3fe3e001~^~Y~^~None~^~vkCreateSamplerYcbcrConversion~^~VUID-vkCreateSamplerYcbcrConversion-pYcbcrConversion-parameter~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'pYcbcrConversion must be a valid pointer to a VkSamplerYcbcrConversion handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversion-pYcbcrConversion-parameter)~^~implicit +VALIDATION_ERROR_40000c8c~^~N~^~None~^~VkBindBufferMemoryDeviceGroupInfo~^~VUID-VkBindBufferMemoryDeviceGroupInfo-deviceIndexCount-01606~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'deviceIndexCount must either be zero or equal to the number of physical devices in the logical device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryDeviceGroupInfo-deviceIndexCount-01606)~^~ +VALIDATION_ERROR_40000c8e~^~N~^~None~^~VkBindBufferMemoryDeviceGroupInfo~^~VUID-VkBindBufferMemoryDeviceGroupInfo-pDeviceIndices-01607~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'All elements of pDeviceIndices must be valid device indices' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryDeviceGroupInfo-pDeviceIndices-01607)~^~ +VALIDATION_ERROR_40013e01~^~N~^~None~^~VkBindBufferMemoryDeviceGroupInfo~^~VUID-VkBindBufferMemoryDeviceGroupInfo-pDeviceIndices-parameter~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If deviceIndexCount is not 0, pDeviceIndices must be a valid pointer to an array of deviceIndexCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryDeviceGroupInfo-pDeviceIndices-parameter)~^~implicit +VALIDATION_ERROR_4002b00b~^~N~^~None~^~VkBindBufferMemoryDeviceGroupInfo~^~VUID-VkBindBufferMemoryDeviceGroupInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryDeviceGroupInfo-sType-sType)~^~implicit +VALIDATION_ERROR_40200cc2~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfo~^~VUID-VkBindImageMemoryDeviceGroupInfo-deviceIndexCount-01633~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'At least one of deviceIndexCount and splitInstanceBindRegionCount must be zero.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-deviceIndexCount-01633)~^~ +VALIDATION_ERROR_40200cc4~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfo~^~VUID-VkBindImageMemoryDeviceGroupInfo-deviceIndexCount-01634~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'deviceIndexCount must either be zero or equal to the number of physical devices in the logical device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-deviceIndexCount-01634)~^~ +VALIDATION_ERROR_40200cc6~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfo~^~VUID-VkBindImageMemoryDeviceGroupInfo-pDeviceIndices-01635~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'All elements of pDeviceIndices must be valid device indices.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-pDeviceIndices-01635)~^~ +VALIDATION_ERROR_40200cc8~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfo~^~VUID-VkBindImageMemoryDeviceGroupInfo-splitInstanceBindRegionCount-01636~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'splitInstanceBindRegionCount must either be zero or equal to the number of physical devices in the logical device squared' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-splitInstanceBindRegionCount-01636)~^~ +VALIDATION_ERROR_40200cca~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfo~^~VUID-VkBindImageMemoryDeviceGroupInfo-pSplitInstanceBindRegions-01637~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'Elements of pSplitInstanceBindRegions that correspond to the same instance of an image must not overlap.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-pSplitInstanceBindRegions-01637)~^~ +VALIDATION_ERROR_40200ccc~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfo~^~VUID-VkBindImageMemoryDeviceGroupInfo-offset-01638~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'The offset.x member of any element of pSplitInstanceBindRegions must be a multiple of the sparse image block width (VkSparseImageFormatProperties::imageGranularity.width) of all non-metadata aspects of the image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-offset-01638)~^~ +VALIDATION_ERROR_40200cce~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfo~^~VUID-VkBindImageMemoryDeviceGroupInfo-offset-01639~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'The offset.y member of any element of pSplitInstanceBindRegions must be a multiple of the sparse image block height (VkSparseImageFormatProperties::imageGranularity.height) of all non-metadata aspects of the image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-offset-01639)~^~ +VALIDATION_ERROR_40200cd0~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfo~^~VUID-VkBindImageMemoryDeviceGroupInfo-extent-01640~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'The extent.width member of any element of pSplitInstanceBindRegions must either be a multiple of the sparse image block width of all non-metadata aspects of the image, or else extent.width + offset.x must equal the width of the image subresource' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-extent-01640)~^~ +VALIDATION_ERROR_40200cd2~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfo~^~VUID-VkBindImageMemoryDeviceGroupInfo-extent-01641~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'The extent.height member of any element of pSplitInstanceBindRegions must either be a multiple of the sparse image block height of all non-metadata aspects of the image, or else extent.height offset.y must equal the width of the image subresource' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-extent-01641)~^~ +VALIDATION_ERROR_40213e01~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfo~^~VUID-VkBindImageMemoryDeviceGroupInfo-pDeviceIndices-parameter~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If deviceIndexCount is not 0, pDeviceIndices must be a valid pointer to an array of deviceIndexCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-pDeviceIndices-parameter)~^~implicit +VALIDATION_ERROR_4022b00b~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfo~^~VUID-VkBindImageMemoryDeviceGroupInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-sType-sType)~^~implicit +VALIDATION_ERROR_4023fe01~^~N~^~None~^~VkBindImageMemoryDeviceGroupInfo~^~VUID-VkBindImageMemoryDeviceGroupInfo-pSplitInstanceBindRegions-parameter~^~(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)~^~The spec valid usage text states 'If splitInstanceBindRegionCount is not 0, pSplitInstanceBindRegions must be a valid pointer to an array of splitInstanceBindRegionCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-pSplitInstanceBindRegions-parameter)~^~implicit +VALIDATION_ERROR_40405601~^~Y~^~None~^~vkDestroySamplerYcbcrConversion~^~VUID-vkDestroySamplerYcbcrConversion-device-parameter~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySamplerYcbcrConversion-device-parameter)~^~implicit +VALIDATION_ERROR_4040ec01~^~N~^~None~^~vkDestroySamplerYcbcrConversion~^~VUID-vkDestroySamplerYcbcrConversion-pAllocator-parameter~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySamplerYcbcrConversion-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_4043e201~^~Y~^~None~^~vkDestroySamplerYcbcrConversion~^~VUID-vkDestroySamplerYcbcrConversion-ycbcrConversion-parameter~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If ycbcrConversion is not VK_NULL_HANDLE, ycbcrConversion must be a valid VkSamplerYcbcrConversion handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySamplerYcbcrConversion-ycbcrConversion-parameter)~^~implicit +VALIDATION_ERROR_4043e207~^~Y~^~None~^~vkDestroySamplerYcbcrConversion~^~VUID-vkDestroySamplerYcbcrConversion-ycbcrConversion-parent~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If ycbcrConversion is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySamplerYcbcrConversion-ycbcrConversion-parent)~^~implicit +VALIDATION_ERROR_4062b00b~^~N~^~None~^~VkPhysicalDeviceSamplerYcbcrConversionFeatures~^~VUID-VkPhysicalDeviceSamplerYcbcrConversionFeatures-sType-sType~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSamplerYcbcrConversionFeatures-sType-sType)~^~implicit +VALIDATION_ERROR_4082b00b~^~N~^~None~^~VkSamplerYcbcrConversionImageFormatProperties~^~VUID-VkSamplerYcbcrConversionImageFormatProperties-sType-sType~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionImageFormatProperties-sType-sType)~^~implicit +VALIDATION_ERROR_40a2b00b~^~N~^~None~^~VkSamplerYcbcrConversionInfo~^~VUID-VkSamplerYcbcrConversionInfo-sType-sType~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionInfo-sType-sType)~^~implicit +VALIDATION_ERROR_40a3e601~^~N~^~None~^~VkSamplerYcbcrConversionInfo~^~VUID-VkSamplerYcbcrConversionInfo-conversion-parameter~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'conversion must be a valid VkSamplerYcbcrConversion handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionInfo-conversion-parameter)~^~implicit +VALIDATION_ERROR_40c2b00b~^~N~^~None~^~VkDeviceQueueGlobalPriorityCreateInfoEXT~^~VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-sType-sType~^~(VK_EXT_global_priority)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_40c3ea01~^~N~^~None~^~VkDeviceQueueGlobalPriorityCreateInfoEXT~^~VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-globalPriority-parameter~^~(VK_EXT_global_priority)~^~The spec valid usage text states 'globalPriority must be a valid VkQueueGlobalPriorityEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-globalPriority-parameter)~^~implicit +VALIDATION_ERROR_40e05601~^~Y~^~None~^~vkGetShaderInfoAMD~^~VUID-vkGetShaderInfoAMD-device-parameter~^~(VK_AMD_shader_info)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetShaderInfoAMD-device-parameter)~^~implicit +VALIDATION_ERROR_40e27c01~^~Y~^~None~^~vkGetShaderInfoAMD~^~VUID-vkGetShaderInfoAMD-pipeline-parameter~^~(VK_AMD_shader_info)~^~The spec valid usage text states 'pipeline must be a valid VkPipeline handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetShaderInfoAMD-pipeline-parameter)~^~implicit +VALIDATION_ERROR_40e27c07~^~Y~^~None~^~vkGetShaderInfoAMD~^~VUID-vkGetShaderInfoAMD-pipeline-parent~^~(VK_AMD_shader_info)~^~The spec valid usage text states 'pipeline must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetShaderInfoAMD-pipeline-parent)~^~implicit +VALIDATION_ERROR_40e39c01~^~Y~^~None~^~vkGetShaderInfoAMD~^~VUID-vkGetShaderInfoAMD-pInfo-parameter~^~(VK_AMD_shader_info)~^~The spec valid usage text states 'If the value referenced by pInfoSize is not 0, and pInfo is not NULL, pInfo must be a valid pointer to an array of pInfoSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetShaderInfoAMD-pInfo-parameter)~^~implicit +VALIDATION_ERROR_40e3ec01~^~Y~^~None~^~vkGetShaderInfoAMD~^~VUID-vkGetShaderInfoAMD-shaderStage-parameter~^~(VK_AMD_shader_info)~^~The spec valid usage text states 'shaderStage must be a valid VkShaderStageFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetShaderInfoAMD-shaderStage-parameter)~^~implicit +VALIDATION_ERROR_40e3ee01~^~Y~^~None~^~vkGetShaderInfoAMD~^~VUID-vkGetShaderInfoAMD-infoType-parameter~^~(VK_AMD_shader_info)~^~The spec valid usage text states 'infoType must be a valid VkShaderInfoTypeAMD value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetShaderInfoAMD-infoType-parameter)~^~implicit +VALIDATION_ERROR_40e3f001~^~N~^~None~^~vkGetShaderInfoAMD~^~VUID-vkGetShaderInfoAMD-pInfoSize-parameter~^~(VK_AMD_shader_info)~^~The spec valid usage text states 'pInfoSize must be a valid pointer to a size_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetShaderInfoAMD-pInfoSize-parameter)~^~implicit +VALIDATION_ERROR_41200da6~^~N~^~None~^~VkImportMemoryHostPointerInfoEXT~^~VUID-VkImportMemoryHostPointerInfoEXT-handleType-01747~^~(VK_EXT_external_memory_host)~^~The spec valid usage text states 'If handleType is not 0, it must be supported for import, as reported in VkExternalMemoryPropertiesKHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryHostPointerInfoEXT-handleType-01747)~^~ +VALIDATION_ERROR_41200da8~^~N~^~None~^~VkImportMemoryHostPointerInfoEXT~^~VUID-VkImportMemoryHostPointerInfoEXT-handleType-01748~^~(VK_EXT_external_memory_host)~^~The spec valid usage text states 'If handleType is not 0, it must be VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT or VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryHostPointerInfoEXT-handleType-01748)~^~ +VALIDATION_ERROR_41200daa~^~N~^~None~^~VkImportMemoryHostPointerInfoEXT~^~VUID-VkImportMemoryHostPointerInfoEXT-pHostPointer-01749~^~(VK_EXT_external_memory_host)~^~The spec valid usage text states 'pHostPointer must be a pointer aligned to an integer multiple of VkPhysicalDeviceExternalMemoryHostPropertiesEXT::minImportedHostPointerAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryHostPointerInfoEXT-pHostPointer-01749)~^~ +VALIDATION_ERROR_41200dac~^~N~^~None~^~VkImportMemoryHostPointerInfoEXT~^~VUID-VkImportMemoryHostPointerInfoEXT-handleType-01750~^~(VK_EXT_external_memory_host)~^~The spec valid usage text states 'If handleType is VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT, pHostPointer must be a pointer to allocationSize number of bytes of host memory, where allocationSize is the member of the VkMemoryAllocateInfo structure this structure is chained to' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryHostPointerInfoEXT-handleType-01750)~^~ +VALIDATION_ERROR_41200dae~^~N~^~None~^~VkImportMemoryHostPointerInfoEXT~^~VUID-VkImportMemoryHostPointerInfoEXT-handleType-01751~^~(VK_EXT_external_memory_host)~^~The spec valid usage text states 'If handleType is VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT, pHostPointer must be a pointer to allocationSize number of bytes of host mapped foreign memory, where allocationSize is the member of the VkMemoryAllocateInfo structure this structure is chained to' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryHostPointerInfoEXT-handleType-01751)~^~ +VALIDATION_ERROR_41209c01~^~N~^~None~^~VkImportMemoryHostPointerInfoEXT~^~VUID-VkImportMemoryHostPointerInfoEXT-handleType-parameter~^~(VK_EXT_external_memory_host)~^~The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryHostPointerInfoEXT-handleType-parameter)~^~implicit +VALIDATION_ERROR_4122b00b~^~N~^~None~^~VkImportMemoryHostPointerInfoEXT~^~VUID-VkImportMemoryHostPointerInfoEXT-sType-sType~^~(VK_EXT_external_memory_host)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryHostPointerInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_4141c40d~^~N~^~None~^~VkMemoryHostPointerPropertiesEXT~^~VUID-VkMemoryHostPointerPropertiesEXT-pNext-pNext~^~(VK_EXT_external_memory_host)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryHostPointerPropertiesEXT-pNext-pNext)~^~implicit +VALIDATION_ERROR_4142b00b~^~Y~^~None~^~VkMemoryHostPointerPropertiesEXT~^~VUID-VkMemoryHostPointerPropertiesEXT-sType-sType~^~(VK_EXT_external_memory_host)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryHostPointerPropertiesEXT-sType-sType)~^~implicit +VALIDATION_ERROR_4162b00b~^~N~^~None~^~VkPhysicalDeviceExternalMemoryHostPropertiesEXT~^~VUID-VkPhysicalDeviceExternalMemoryHostPropertiesEXT-sType-sType~^~(VK_EXT_external_memory_host)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalMemoryHostPropertiesEXT-sType-sType)~^~implicit +VALIDATION_ERROR_41800db0~^~N~^~None~^~vkGetMemoryHostPointerPropertiesEXT~^~VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-01752~^~(VK_EXT_external_memory_host)~^~The spec valid usage text states 'handleType must be VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT or VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-01752)~^~ +VALIDATION_ERROR_41800db2~^~N~^~None~^~vkGetMemoryHostPointerPropertiesEXT~^~VUID-vkGetMemoryHostPointerPropertiesEXT-pHostPointer-01753~^~(VK_EXT_external_memory_host)~^~The spec valid usage text states 'pHostPointer must be a pointer aligned to an integer multiple of VkPhysicalDeviceExternalMemoryHostPropertiesEXT::minImportedHostPointerAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryHostPointerPropertiesEXT-pHostPointer-01753)~^~ +VALIDATION_ERROR_41800db4~^~N~^~None~^~vkGetMemoryHostPointerPropertiesEXT~^~VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-01754~^~(VK_EXT_external_memory_host)~^~The spec valid usage text states 'If handleType is VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT, pHostPointer must be a pointer to host memory' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-01754)~^~ +VALIDATION_ERROR_41800db6~^~N~^~None~^~vkGetMemoryHostPointerPropertiesEXT~^~VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-01755~^~(VK_EXT_external_memory_host)~^~The spec valid usage text states 'If handleType is VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT, pHostPointer must be a pointer to host mapped foreign memory' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-01755)~^~ +VALIDATION_ERROR_41805601~^~Y~^~None~^~vkGetMemoryHostPointerPropertiesEXT~^~VUID-vkGetMemoryHostPointerPropertiesEXT-device-parameter~^~(VK_EXT_external_memory_host)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryHostPointerPropertiesEXT-device-parameter)~^~implicit +VALIDATION_ERROR_41809c01~^~Y~^~None~^~vkGetMemoryHostPointerPropertiesEXT~^~VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-parameter~^~(VK_EXT_external_memory_host)~^~The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-parameter)~^~implicit +VALIDATION_ERROR_4183f401~^~N~^~None~^~vkGetMemoryHostPointerPropertiesEXT~^~VUID-vkGetMemoryHostPointerPropertiesEXT-pMemoryHostPointerProperties-parameter~^~(VK_EXT_external_memory_host)~^~The spec valid usage text states 'pMemoryHostPointerProperties must be a valid pointer to a VkMemoryHostPointerPropertiesEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryHostPointerPropertiesEXT-pMemoryHostPointerProperties-parameter)~^~implicit +VALIDATION_ERROR_41a2b00b~^~N~^~None~^~VkPhysicalDeviceConservativeRasterizationPropertiesEXT~^~VUID-VkPhysicalDeviceConservativeRasterizationPropertiesEXT-sType-sType~^~(VK_EXT_conservative_rasterization)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceConservativeRasterizationPropertiesEXT-sType-sType)~^~implicit +VALIDATION_ERROR_41c00dd2~^~N~^~None~^~VkPipelineRasterizationConservativeStateCreateInfoEXT~^~VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-extraPrimitiveOverestimationSize-01769~^~(VK_EXT_conservative_rasterization)~^~The spec valid usage text states 'extraPrimitiveOverestimationSize must be in the range of 0.0 to VkPhysicalDeviceConservativeRasterizationPropertiesEXT::maxExtraPrimitiveOverestimationSize inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-extraPrimitiveOverestimationSize-01769)~^~ +VALIDATION_ERROR_41c09005~^~N~^~None~^~VkPipelineRasterizationConservativeStateCreateInfoEXT~^~VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-flags-zerobitmask~^~(VK_EXT_conservative_rasterization)~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-flags-zerobitmask)~^~implicit +VALIDATION_ERROR_41c2b00b~^~N~^~None~^~VkPipelineRasterizationConservativeStateCreateInfoEXT~^~VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-sType-sType~^~(VK_EXT_conservative_rasterization)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_41c3f801~^~N~^~None~^~VkPipelineRasterizationConservativeStateCreateInfoEXT~^~VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-conservativeRasterizationMode-parameter~^~(VK_EXT_conservative_rasterization)~^~The spec valid usage text states 'conservativeRasterizationMode must be a valid VkConservativeRasterizationModeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-conservativeRasterizationMode-parameter)~^~implicit +VALIDATION_ERROR_41e00009~^~Y~^~None~^~vkCmdWriteBufferMarkerAMD~^~VUID-vkCmdWriteBufferMarkerAMD-commonparent~^~(VK_AMD_buffer_marker)~^~The spec valid usage text states 'Both of commandBuffer, and dstBuffer must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-commonparent)~^~implicit +VALIDATION_ERROR_41e00e0c~^~N~^~None~^~vkCmdWriteBufferMarkerAMD~^~VUID-vkCmdWriteBufferMarkerAMD-dstOffset-01798~^~(VK_AMD_buffer_marker)~^~The spec valid usage text states 'dstOffset must be less than or equal to the size of dstBuffer minus 4.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-dstOffset-01798)~^~ +VALIDATION_ERROR_41e00e0e~^~N~^~None~^~vkCmdWriteBufferMarkerAMD~^~VUID-vkCmdWriteBufferMarkerAMD-dstBuffer-01799~^~(VK_AMD_buffer_marker)~^~The spec valid usage text states 'dstBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_DST_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-dstBuffer-01799)~^~ +VALIDATION_ERROR_41e00e10~^~N~^~None~^~vkCmdWriteBufferMarkerAMD~^~VUID-vkCmdWriteBufferMarkerAMD-dstBuffer-01800~^~(VK_AMD_buffer_marker)~^~The spec valid usage text states 'If dstBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-dstBuffer-01800)~^~ +VALIDATION_ERROR_41e00e12~^~N~^~None~^~vkCmdWriteBufferMarkerAMD~^~VUID-vkCmdWriteBufferMarkerAMD-dstOffset-01801~^~(VK_AMD_buffer_marker)~^~The spec valid usage text states 'dstOffset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-dstOffset-01801)~^~ +VALIDATION_ERROR_41e02401~^~Y~^~None~^~vkCmdWriteBufferMarkerAMD~^~VUID-vkCmdWriteBufferMarkerAMD-commandBuffer-parameter~^~(VK_AMD_buffer_marker)~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-commandBuffer-parameter)~^~implicit +VALIDATION_ERROR_41e02413~^~N~^~None~^~vkCmdWriteBufferMarkerAMD~^~VUID-vkCmdWriteBufferMarkerAMD-commandBuffer-recording~^~(VK_AMD_buffer_marker)~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_41e02415~^~N~^~None~^~vkCmdWriteBufferMarkerAMD~^~VUID-vkCmdWriteBufferMarkerAMD-commandBuffer-cmdpool~^~(VK_AMD_buffer_marker)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-commandBuffer-cmdpool)~^~implicit +VALIDATION_ERROR_41e06c01~^~Y~^~None~^~vkCmdWriteBufferMarkerAMD~^~VUID-vkCmdWriteBufferMarkerAMD-dstBuffer-parameter~^~(VK_AMD_buffer_marker)~^~The spec valid usage text states 'dstBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-dstBuffer-parameter)~^~implicit +VALIDATION_ERROR_41e28401~^~Y~^~None~^~vkCmdWriteBufferMarkerAMD~^~VUID-vkCmdWriteBufferMarkerAMD-pipelineStage-parameter~^~(VK_AMD_buffer_marker)~^~The spec valid usage text states 'pipelineStage must be a valid VkPipelineStageFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-pipelineStage-parameter)~^~implicit +VALIDATION_ERROR_4201c40d~^~N~^~None~^~VkDescriptorSetLayoutSupport~^~VUID-VkDescriptorSetLayoutSupport-pNext-pNext~^~(VK_VERSION_1_1,VK_KHR_maintenance3)~^~The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkDescriptorSetVariableDescriptorCountLayoutSupportEXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutSupport-pNext-pNext)~^~implicit +VALIDATION_ERROR_4202b00b~^~Y~^~None~^~VkDescriptorSetLayoutSupport~^~VUID-VkDescriptorSetLayoutSupport-sType-sType~^~(VK_VERSION_1_1,VK_KHR_maintenance3)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutSupport-sType-sType)~^~implicit +VALIDATION_ERROR_42200e64~^~N~^~None~^~VkDeviceQueueInfo2~^~VUID-VkDeviceQueueInfo2-queueFamilyIndex-01842~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'queueFamilyIndex must be one of the queue family indices specified when device was created, via the VkDeviceQueueCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceQueueInfo2-queueFamilyIndex-01842)~^~ +VALIDATION_ERROR_42200e66~^~N~^~None~^~VkDeviceQueueInfo2~^~VUID-VkDeviceQueueInfo2-queueIndex-01843~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'queueIndex must be less than the number of queues created for the specified queue family index and VkDeviceQueueCreateFlags member flags equal to this flags value when device was created, via the queueCount member of the VkDeviceQueueCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceQueueInfo2-queueIndex-01843)~^~ +VALIDATION_ERROR_42209001~^~N~^~None~^~VkDeviceQueueInfo2~^~VUID-VkDeviceQueueInfo2-flags-parameter~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'flags must be a valid combination of VkDeviceQueueCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceQueueInfo2-flags-parameter)~^~implicit +VALIDATION_ERROR_42209003~^~Y~^~None~^~VkDeviceQueueInfo2~^~VUID-VkDeviceQueueInfo2-flags-requiredbitmask~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceQueueInfo2-flags-requiredbitmask)~^~implicit +VALIDATION_ERROR_4221c40d~^~Y~^~None~^~VkDeviceQueueInfo2~^~VUID-VkDeviceQueueInfo2-pNext-pNext~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceQueueInfo2-pNext-pNext)~^~implicit +VALIDATION_ERROR_4222b00b~^~Y~^~None~^~VkDeviceQueueInfo2~^~VUID-VkDeviceQueueInfo2-sType-sType~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceQueueInfo2-sType-sType)~^~implicit +VALIDATION_ERROR_4242b00b~^~N~^~None~^~VkPhysicalDeviceMaintenance3Properties~^~VUID-VkPhysicalDeviceMaintenance3Properties-sType-sType~^~(VK_VERSION_1_1,VK_KHR_maintenance3)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceMaintenance3Properties-sType-sType)~^~implicit +VALIDATION_ERROR_4262b00b~^~N~^~None~^~VkPhysicalDeviceProtectedMemoryFeatures~^~VUID-VkPhysicalDeviceProtectedMemoryFeatures-sType-sType~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceProtectedMemoryFeatures-sType-sType)~^~implicit +VALIDATION_ERROR_4282b00b~^~N~^~None~^~VkPhysicalDeviceProtectedMemoryProperties~^~VUID-VkPhysicalDeviceProtectedMemoryProperties-sType-sType~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceProtectedMemoryProperties-sType-sType)~^~implicit +VALIDATION_ERROR_42a2b00b~^~N~^~None~^~VkPhysicalDeviceShaderDrawParameterFeatures~^~VUID-VkPhysicalDeviceShaderDrawParameterFeatures-sType-sType~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceShaderDrawParameterFeatures-sType-sType)~^~implicit +VALIDATION_ERROR_42c2b00b~^~N~^~None~^~VkPhysicalDeviceSubgroupProperties~^~VUID-VkPhysicalDeviceSubgroupProperties-sType-sType~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSubgroupProperties-sType-sType)~^~implicit +VALIDATION_ERROR_42e00e30~^~N~^~None~^~VkProtectedSubmitInfo~^~VUID-VkProtectedSubmitInfo-protectedSubmit-01816~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If the protected memory feature is not enabled, protectedSubmit must not be VK_TRUE.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkProtectedSubmitInfo-protectedSubmit-01816)~^~ +VALIDATION_ERROR_42e00e32~^~N~^~None~^~VkProtectedSubmitInfo~^~VUID-VkProtectedSubmitInfo-protectedSubmit-01817~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If protectedSubmit is VK_TRUE, then each element of the pCommandBuffers array must be a protected command buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkProtectedSubmitInfo-protectedSubmit-01817)~^~ +VALIDATION_ERROR_42e00e34~^~N~^~None~^~VkProtectedSubmitInfo~^~VUID-VkProtectedSubmitInfo-protectedSubmit-01818~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If protectedSubmit is VK_FALSE, then each element of the pCommandBuffers array must be an unprotected command buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkProtectedSubmitInfo-protectedSubmit-01818)~^~ +VALIDATION_ERROR_42e00e36~^~N~^~None~^~VkProtectedSubmitInfo~^~VUID-VkProtectedSubmitInfo-pNext-01819~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If the VkSubmitInfo::pNext chain does not include a VkProtectedSubmitInfo structure, then each element of the command buffer of the pCommandBuffers array must be an unprotected command buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkProtectedSubmitInfo-pNext-01819)~^~ +VALIDATION_ERROR_42e2b00b~^~N~^~None~^~VkProtectedSubmitInfo~^~VUID-VkProtectedSubmitInfo-sType-sType~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkProtectedSubmitInfo-sType-sType)~^~implicit +VALIDATION_ERROR_43040001~^~N~^~None~^~vkEnumerateInstanceVersion~^~VUID-vkEnumerateInstanceVersion-pApiVersion-parameter~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'pApiVersion must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkEnumerateInstanceVersion-pApiVersion-parameter)~^~implicit +VALIDATION_ERROR_43205601~^~Y~^~None~^~vkGetDescriptorSetLayoutSupport~^~VUID-vkGetDescriptorSetLayoutSupport-device-parameter~^~(VK_VERSION_1_1,VK_KHR_maintenance3)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDescriptorSetLayoutSupport-device-parameter)~^~implicit +VALIDATION_ERROR_43211e01~^~N~^~None~^~vkGetDescriptorSetLayoutSupport~^~VUID-vkGetDescriptorSetLayoutSupport-pCreateInfo-parameter~^~(VK_VERSION_1_1,VK_KHR_maintenance3)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDescriptorSetLayoutCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDescriptorSetLayoutSupport-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_43240201~^~N~^~None~^~vkGetDescriptorSetLayoutSupport~^~VUID-vkGetDescriptorSetLayoutSupport-pSupport-parameter~^~(VK_VERSION_1_1,VK_KHR_maintenance3)~^~The spec valid usage text states 'pSupport must be a valid pointer to a VkDescriptorSetLayoutSupport structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDescriptorSetLayoutSupport-pSupport-parameter)~^~implicit +VALIDATION_ERROR_43405601~^~Y~^~None~^~vkGetDeviceQueue2~^~VUID-vkGetDeviceQueue2-device-parameter~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceQueue2-device-parameter)~^~implicit +VALIDATION_ERROR_4341fc01~^~Y~^~None~^~vkGetDeviceQueue2~^~VUID-vkGetDeviceQueue2-pQueue-parameter~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'pQueue must be a valid pointer to a VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceQueue2-pQueue-parameter)~^~implicit +VALIDATION_ERROR_43440401~^~N~^~None~^~vkGetDeviceQueue2~^~VUID-vkGetDeviceQueue2-pQueueInfo-parameter~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'pQueueInfo must be a valid pointer to a valid VkDeviceQueueInfo2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceQueue2-pQueueInfo-parameter)~^~implicit +VALIDATION_ERROR_43600ee2~^~N~^~None~^~VkDebugUtilsObjectNameInfoEXT~^~VUID-VkDebugUtilsObjectNameInfoEXT-objectType-01905~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'objectType must not be VK_OBJECT_TYPE_UNKNOWN' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectNameInfoEXT-objectType-01905)~^~ +VALIDATION_ERROR_43600ee4~^~N~^~None~^~VkDebugUtilsObjectNameInfoEXT~^~VUID-VkDebugUtilsObjectNameInfoEXT-objectHandle-01906~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'objectHandle must not be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectNameInfoEXT-objectHandle-01906)~^~ +VALIDATION_ERROR_43600ee6~^~N~^~None~^~VkDebugUtilsObjectNameInfoEXT~^~VUID-VkDebugUtilsObjectNameInfoEXT-objectHandle-01907~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'objectHandle must be a Vulkan object of the type associated with objectType as defined in debugging-object-types.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectNameInfoEXT-objectHandle-01907)~^~ +VALIDATION_ERROR_4360da01~^~Y~^~None~^~VkDebugUtilsObjectNameInfoEXT~^~VUID-VkDebugUtilsObjectNameInfoEXT-objectType-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'objectType must be a valid VkObjectType value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectNameInfoEXT-objectType-parameter)~^~implicit +VALIDATION_ERROR_4361c40d~^~Y~^~None~^~VkDebugUtilsObjectNameInfoEXT~^~VUID-VkDebugUtilsObjectNameInfoEXT-pNext-pNext~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectNameInfoEXT-pNext-pNext)~^~implicit +VALIDATION_ERROR_4361ce01~^~N~^~None~^~VkDebugUtilsObjectNameInfoEXT~^~VUID-VkDebugUtilsObjectNameInfoEXT-pObjectName-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'If pObjectName is not NULL, pObjectName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectNameInfoEXT-pObjectName-parameter)~^~implicit +VALIDATION_ERROR_4362b00b~^~Y~^~None~^~VkDebugUtilsObjectNameInfoEXT~^~VUID-VkDebugUtilsObjectNameInfoEXT-sType-sType~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectNameInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_43800ee8~^~N~^~None~^~VkDebugUtilsObjectTagInfoEXT~^~VUID-VkDebugUtilsObjectTagInfoEXT-objectType-01908~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'objectType must not be VK_OBJECT_TYPE_UNKNOWN' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectTagInfoEXT-objectType-01908)~^~ +VALIDATION_ERROR_43800eea~^~N~^~None~^~VkDebugUtilsObjectTagInfoEXT~^~VUID-VkDebugUtilsObjectTagInfoEXT-objectHandle-01909~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'objectHandle must not be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectTagInfoEXT-objectHandle-01909)~^~ +VALIDATION_ERROR_43800eec~^~N~^~None~^~VkDebugUtilsObjectTagInfoEXT~^~VUID-VkDebugUtilsObjectTagInfoEXT-objectHandle-01910~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'objectHandle must be a Vulkan object of the type associated with objectType as defined in debugging-object-types.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectTagInfoEXT-objectHandle-01910)~^~ +VALIDATION_ERROR_4380da01~^~Y~^~None~^~VkDebugUtilsObjectTagInfoEXT~^~VUID-VkDebugUtilsObjectTagInfoEXT-objectType-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'objectType must be a valid VkObjectType value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectTagInfoEXT-objectType-parameter)~^~implicit +VALIDATION_ERROR_4381c40d~^~Y~^~None~^~VkDebugUtilsObjectTagInfoEXT~^~VUID-VkDebugUtilsObjectTagInfoEXT-pNext-pNext~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectTagInfoEXT-pNext-pNext)~^~implicit +VALIDATION_ERROR_43825a01~^~Y~^~None~^~VkDebugUtilsObjectTagInfoEXT~^~VUID-VkDebugUtilsObjectTagInfoEXT-pTag-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'pTag must be a valid pointer to an array of tagSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectTagInfoEXT-pTag-parameter)~^~implicit +VALIDATION_ERROR_4382b00b~^~Y~^~None~^~VkDebugUtilsObjectTagInfoEXT~^~VUID-VkDebugUtilsObjectTagInfoEXT-sType-sType~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectTagInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_4382f41b~^~Y~^~None~^~VkDebugUtilsObjectTagInfoEXT~^~VUID-VkDebugUtilsObjectTagInfoEXT-tagSize-arraylength~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'tagSize must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectTagInfoEXT-tagSize-arraylength)~^~implicit +VALIDATION_ERROR_43a1c40d~^~Y~^~None~^~VkDebugUtilsLabelEXT~^~VUID-VkDebugUtilsLabelEXT-pNext-pNext~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsLabelEXT-pNext-pNext)~^~implicit +VALIDATION_ERROR_43a2b00b~^~Y~^~None~^~VkDebugUtilsLabelEXT~^~VUID-VkDebugUtilsLabelEXT-sType-sType~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsLabelEXT-sType-sType)~^~implicit +VALIDATION_ERROR_43a40801~^~Y~^~None~^~VkDebugUtilsLabelEXT~^~VUID-VkDebugUtilsLabelEXT-pLabelName-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'pLabelName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsLabelEXT-pLabelName-parameter)~^~implicit +VALIDATION_ERROR_43c09005~^~Y~^~None~^~VkDebugUtilsMessengerCallbackDataEXT~^~VUID-VkDebugUtilsMessengerCallbackDataEXT-flags-zerobitmask~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCallbackDataEXT-flags-zerobitmask)~^~implicit +VALIDATION_ERROR_43c0d61b~^~N~^~None~^~VkDebugUtilsMessengerCallbackDataEXT~^~VUID-VkDebugUtilsMessengerCallbackDataEXT-objectCount-arraylength~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'objectCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCallbackDataEXT-objectCount-arraylength)~^~implicit +VALIDATION_ERROR_43c1b801~^~Y~^~None~^~VkDebugUtilsMessengerCallbackDataEXT~^~VUID-VkDebugUtilsMessengerCallbackDataEXT-pMessage-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'pMessage must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCallbackDataEXT-pMessage-parameter)~^~implicit +VALIDATION_ERROR_43c1c40d~^~Y~^~None~^~VkDebugUtilsMessengerCallbackDataEXT~^~VUID-VkDebugUtilsMessengerCallbackDataEXT-pNext-pNext~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCallbackDataEXT-pNext-pNext)~^~implicit +VALIDATION_ERROR_43c2b00b~^~Y~^~None~^~VkDebugUtilsMessengerCallbackDataEXT~^~VUID-VkDebugUtilsMessengerCallbackDataEXT-sType-sType~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCallbackDataEXT-sType-sType)~^~implicit +VALIDATION_ERROR_43c42201~^~N~^~None~^~VkDebugUtilsMessengerCallbackDataEXT~^~VUID-VkDebugUtilsMessengerCallbackDataEXT-pMessageIdName-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'If pMessageIdName is not NULL, pMessageIdName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCallbackDataEXT-pMessageIdName-parameter)~^~implicit +VALIDATION_ERROR_43e00ef4~^~N~^~None~^~VkDebugUtilsMessengerCreateInfoEXT~^~VUID-VkDebugUtilsMessengerCreateInfoEXT-pfnUserCallback-01914~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'pfnUserCallback must be a valid PFN_vkDebugUtilsMessengerCallbackEXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCreateInfoEXT-pfnUserCallback-01914)~^~ +VALIDATION_ERROR_43e09005~^~Y~^~None~^~VkDebugUtilsMessengerCreateInfoEXT~^~VUID-VkDebugUtilsMessengerCreateInfoEXT-flags-zerobitmask~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCreateInfoEXT-flags-zerobitmask)~^~implicit +VALIDATION_ERROR_43e2b00b~^~Y~^~None~^~VkDebugUtilsMessengerCreateInfoEXT~^~VUID-VkDebugUtilsMessengerCreateInfoEXT-sType-sType~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCreateInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_43e40a01~^~N~^~None~^~VkDebugUtilsMessengerCreateInfoEXT~^~VUID-VkDebugUtilsMessengerCreateInfoEXT-messageSeverity-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'messageSeverity must be a valid combination of VkDebugUtilsMessageSeverityFlagBitsEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCreateInfoEXT-messageSeverity-parameter)~^~implicit +VALIDATION_ERROR_43e40a03~^~Y~^~None~^~VkDebugUtilsMessengerCreateInfoEXT~^~VUID-VkDebugUtilsMessengerCreateInfoEXT-messageSeverity-requiredbitmask~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'messageSeverity must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCreateInfoEXT-messageSeverity-requiredbitmask)~^~implicit +VALIDATION_ERROR_43e40c01~^~N~^~None~^~VkDebugUtilsMessengerCreateInfoEXT~^~VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'messageType must be a valid combination of VkDebugUtilsMessageTypeFlagBitsEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-parameter)~^~implicit +VALIDATION_ERROR_43e40c03~^~Y~^~None~^~VkDebugUtilsMessengerCreateInfoEXT~^~VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-requiredbitmask~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'messageType must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-requiredbitmask)~^~implicit +VALIDATION_ERROR_4400bc01~^~N~^~None~^~vkCreateDebugUtilsMessengerEXT~^~VUID-vkCreateDebugUtilsMessengerEXT-instance-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDebugUtilsMessengerEXT-instance-parameter)~^~implicit +VALIDATION_ERROR_4400ec01~^~N~^~None~^~vkCreateDebugUtilsMessengerEXT~^~VUID-vkCreateDebugUtilsMessengerEXT-pAllocator-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDebugUtilsMessengerEXT-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_44011e01~^~N~^~None~^~vkCreateDebugUtilsMessengerEXT~^~VUID-vkCreateDebugUtilsMessengerEXT-pCreateInfo-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDebugUtilsMessengerCreateInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDebugUtilsMessengerEXT-pCreateInfo-parameter)~^~implicit +VALIDATION_ERROR_44041001~^~Y~^~None~^~vkCreateDebugUtilsMessengerEXT~^~VUID-vkCreateDebugUtilsMessengerEXT-pMessenger-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'pMessenger must be a valid pointer to a VkDebugUtilsMessengerEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDebugUtilsMessengerEXT-pMessenger-parameter)~^~implicit +VALIDATION_ERROR_4420bc01~^~N~^~None~^~vkSubmitDebugUtilsMessageEXT~^~VUID-vkSubmitDebugUtilsMessageEXT-instance-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSubmitDebugUtilsMessageEXT-instance-parameter)~^~implicit +VALIDATION_ERROR_44240a01~^~Y~^~None~^~vkSubmitDebugUtilsMessageEXT~^~VUID-vkSubmitDebugUtilsMessageEXT-messageSeverity-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'messageSeverity must be a valid VkDebugUtilsMessageSeverityFlagBitsEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSubmitDebugUtilsMessageEXT-messageSeverity-parameter)~^~implicit +VALIDATION_ERROR_44241201~^~N~^~None~^~vkSubmitDebugUtilsMessageEXT~^~VUID-vkSubmitDebugUtilsMessageEXT-messageTypes-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'messageTypes must be a valid combination of VkDebugUtilsMessageTypeFlagBitsEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSubmitDebugUtilsMessageEXT-messageTypes-parameter)~^~implicit +VALIDATION_ERROR_44241203~^~Y~^~None~^~vkSubmitDebugUtilsMessageEXT~^~VUID-vkSubmitDebugUtilsMessageEXT-messageTypes-requiredbitmask~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'messageTypes must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSubmitDebugUtilsMessageEXT-messageTypes-requiredbitmask)~^~implicit +VALIDATION_ERROR_44242801~^~N~^~None~^~vkSubmitDebugUtilsMessageEXT~^~VUID-vkSubmitDebugUtilsMessageEXT-pCallbackData-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'pCallbackData must be a valid pointer to a valid VkDebugUtilsMessengerCallbackDataEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSubmitDebugUtilsMessageEXT-pCallbackData-parameter)~^~implicit +VALIDATION_ERROR_4442b00b~^~N~^~None~^~VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT~^~VUID-VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT-sType-sType~^~(VK_EXT_vertex_attribute_divisor)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT-sType-sType)~^~implicit +VALIDATION_ERROR_4462b00b~^~N~^~None~^~VkPipelineVertexInputDivisorStateCreateInfoEXT~^~VUID-VkPipelineVertexInputDivisorStateCreateInfoEXT-sType-sType~^~(VK_EXT_vertex_attribute_divisor)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineVertexInputDivisorStateCreateInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_4464141b~^~N~^~None~^~VkPipelineVertexInputDivisorStateCreateInfoEXT~^~VUID-VkPipelineVertexInputDivisorStateCreateInfoEXT-vertexBindingDivisorCount-arraylength~^~(VK_EXT_vertex_attribute_divisor)~^~The spec valid usage text states 'vertexBindingDivisorCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineVertexInputDivisorStateCreateInfoEXT-vertexBindingDivisorCount-arraylength)~^~implicit +VALIDATION_ERROR_44641601~^~N~^~None~^~VkPipelineVertexInputDivisorStateCreateInfoEXT~^~VUID-VkPipelineVertexInputDivisorStateCreateInfoEXT-pVertexBindingDivisors-parameter~^~(VK_EXT_vertex_attribute_divisor)~^~The spec valid usage text states 'pVertexBindingDivisors must be a valid pointer to an array of vertexBindingDivisorCount VkVertexInputBindingDivisorDescriptionEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineVertexInputDivisorStateCreateInfoEXT-pVertexBindingDivisors-parameter)~^~implicit +VALIDATION_ERROR_44800ecc~^~N~^~None~^~VkExternalFormatANDROID~^~VUID-VkExternalFormatANDROID-externalFormat-01894~^~(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'externalFormat must be 0 or a value returned in the externalFormat member of VkAndroidHardwareBufferFormatPropertiesANDROID by an earlier call to vkGetAndroidHardwareBufferPropertiesANDROID' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalFormatANDROID-externalFormat-01894)~^~ +VALIDATION_ERROR_4482b00b~^~N~^~None~^~VkExternalFormatANDROID~^~VUID-VkExternalFormatANDROID-sType-sType~^~(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalFormatANDROID-sType-sType)~^~implicit +VALIDATION_ERROR_44a00eb0~^~N~^~None~^~VkImportAndroidHardwareBufferInfoANDROID~^~VUID-VkImportAndroidHardwareBufferInfoANDROID-buffer-01880~^~(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'If buffer is not NULL, Android hardware buffers must be supported for import, as reported by VkExternalImageFormatProperties or VkExternalBufferProperties.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportAndroidHardwareBufferInfoANDROID-buffer-01880)~^~ +VALIDATION_ERROR_44a00eb2~^~N~^~None~^~VkImportAndroidHardwareBufferInfoANDROID~^~VUID-VkImportAndroidHardwareBufferInfoANDROID-buffer-01881~^~(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'If buffer is not NULL, it must be a valid Android hardware buffer object with format and usage compatible with Vulkan as described by VkExternalMemoryHandleTypeFlagBits.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportAndroidHardwareBufferInfoANDROID-buffer-01881)~^~ +VALIDATION_ERROR_44a01a01~^~N~^~None~^~VkImportAndroidHardwareBufferInfoANDROID~^~VUID-VkImportAndroidHardwareBufferInfoANDROID-buffer-parameter~^~(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'buffer must be a valid pointer to a AHardwareBuffer value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportAndroidHardwareBufferInfoANDROID-buffer-parameter)~^~implicit +VALIDATION_ERROR_44a2b00b~^~N~^~None~^~VkImportAndroidHardwareBufferInfoANDROID~^~VUID-VkImportAndroidHardwareBufferInfoANDROID-sType-sType~^~(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportAndroidHardwareBufferInfoANDROID-sType-sType)~^~implicit +VALIDATION_ERROR_44c00eb4~^~N~^~None~^~VkMemoryGetAndroidHardwareBufferInfoANDROID~^~VUID-VkMemoryGetAndroidHardwareBufferInfoANDROID-handleTypes-01882~^~(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID must have been included in VkExportMemoryAllocateInfoKHR::handleTypes when memory was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetAndroidHardwareBufferInfoANDROID-handleTypes-01882)~^~ +VALIDATION_ERROR_44c00eb6~^~N~^~None~^~VkMemoryGetAndroidHardwareBufferInfoANDROID~^~VUID-VkMemoryGetAndroidHardwareBufferInfoANDROID-pNext-01883~^~(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'If the pNext chain of the VkMemoryAllocateInfo used to allocate memory included a VkMemoryDedicatedAllocateInfo with non-NULL image member, then that image must already be bound to memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetAndroidHardwareBufferInfoANDROID-pNext-01883)~^~ +VALIDATION_ERROR_44e00ef0~^~N~^~None~^~vkCmdEndDebugUtilsLabelEXT~^~VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'There must be an outstanding vkCmdBeginDebugUtilsLabelEXT command prior to the vkCmdEndDebugUtilsLabelEXT on the queue that commandBuffer is submitted to' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912)~^~ +VALIDATION_ERROR_44e00ef2~^~N~^~None~^~vkCmdEndDebugUtilsLabelEXT~^~VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01913~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'If commandBuffer is a secondary command buffer, there must be an outstanding vkCmdBeginDebugUtilsLabelEXT command recorded to commandBuffer that has not previously been ended by a call to vkCmdEndDebugUtilsLabelEXT.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01913)~^~ +VALIDATION_ERROR_44e02401~^~N~^~None~^~vkCmdEndDebugUtilsLabelEXT~^~VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-parameter)~^~implicit +VALIDATION_ERROR_44e02413~^~N~^~None~^~vkCmdEndDebugUtilsLabelEXT~^~VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-recording~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_44e02415~^~N~^~None~^~vkCmdEndDebugUtilsLabelEXT~^~VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-cmdpool~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-cmdpool)~^~implicit +VALIDATION_ERROR_45000ef6~^~N~^~None~^~vkDestroyDebugUtilsMessengerEXT~^~VUID-vkDestroyDebugUtilsMessengerEXT-messenger-01915~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'If VkAllocationCallbacks were provided when messenger was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugUtilsMessengerEXT-messenger-01915)~^~ +VALIDATION_ERROR_45000ef8~^~N~^~None~^~vkDestroyDebugUtilsMessengerEXT~^~VUID-vkDestroyDebugUtilsMessengerEXT-messenger-01916~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'If no VkAllocationCallbacks were provided when messenger was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugUtilsMessengerEXT-messenger-01916)~^~ +VALIDATION_ERROR_4500bc01~^~N~^~None~^~vkDestroyDebugUtilsMessengerEXT~^~VUID-vkDestroyDebugUtilsMessengerEXT-instance-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugUtilsMessengerEXT-instance-parameter)~^~implicit +VALIDATION_ERROR_4500ec01~^~N~^~None~^~vkDestroyDebugUtilsMessengerEXT~^~VUID-vkDestroyDebugUtilsMessengerEXT-pAllocator-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugUtilsMessengerEXT-pAllocator-parameter)~^~implicit +VALIDATION_ERROR_45042601~^~N~^~None~^~vkDestroyDebugUtilsMessengerEXT~^~VUID-vkDestroyDebugUtilsMessengerEXT-messenger-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'messenger must be a valid VkDebugUtilsMessengerEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugUtilsMessengerEXT-messenger-parameter)~^~implicit +VALIDATION_ERROR_45042607~^~N~^~None~^~vkDestroyDebugUtilsMessengerEXT~^~VUID-vkDestroyDebugUtilsMessengerEXT-messenger-parent~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'messenger must have been created, allocated, or retrieved from instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugUtilsMessengerEXT-messenger-parent)~^~implicit +VALIDATION_ERROR_45200eb8~^~N~^~None~^~vkGetAndroidHardwareBufferPropertiesANDROID~^~VUID-vkGetAndroidHardwareBufferPropertiesANDROID-buffer-01884~^~(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'buffer must be a valid Android hardware buffer object with at least one of the AHARDWAREBUFFER_USAGE_GPU_* usage flags.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetAndroidHardwareBufferPropertiesANDROID-buffer-01884)~^~ +VALIDATION_ERROR_45201a01~^~Y~^~None~^~vkGetAndroidHardwareBufferPropertiesANDROID~^~VUID-vkGetAndroidHardwareBufferPropertiesANDROID-buffer-parameter~^~(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'buffer must be a valid pointer to a valid AHardwareBuffer value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetAndroidHardwareBufferPropertiesANDROID-buffer-parameter)~^~implicit +VALIDATION_ERROR_45205601~^~Y~^~None~^~vkGetAndroidHardwareBufferPropertiesANDROID~^~VUID-vkGetAndroidHardwareBufferPropertiesANDROID-device-parameter~^~(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetAndroidHardwareBufferPropertiesANDROID-device-parameter)~^~implicit +VALIDATION_ERROR_4521f401~^~N~^~None~^~vkGetAndroidHardwareBufferPropertiesANDROID~^~VUID-vkGetAndroidHardwareBufferPropertiesANDROID-pProperties-parameter~^~(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'pProperties must be a valid pointer to a VkAndroidHardwareBufferPropertiesANDROID structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetAndroidHardwareBufferPropertiesANDROID-pProperties-parameter)~^~implicit +VALIDATION_ERROR_45400eee~^~N~^~None~^~vkQueueEndDebugUtilsLabelEXT~^~VUID-vkQueueEndDebugUtilsLabelEXT-None-01911~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'There must be an outstanding vkQueueBeginDebugUtilsLabelEXT command prior to the vkQueueEndDebugUtilsLabelEXT on the queue' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueueEndDebugUtilsLabelEXT-None-01911)~^~ +VALIDATION_ERROR_45429c01~^~N~^~None~^~vkQueueEndDebugUtilsLabelEXT~^~VUID-vkQueueEndDebugUtilsLabelEXT-queue-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'queue must be a valid VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueueEndDebugUtilsLabelEXT-queue-parameter)~^~implicit +VALIDATION_ERROR_4562b00b~^~N~^~None~^~VkAndroidHardwareBufferUsageANDROID~^~VUID-VkAndroidHardwareBufferUsageANDROID-sType-sType~^~(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)+(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAndroidHardwareBufferUsageANDROID-sType-sType)~^~implicit +VALIDATION_ERROR_45a05601~^~Y~^~None~^~vkGetMemoryAndroidHardwareBufferANDROID~^~VUID-vkGetMemoryAndroidHardwareBufferANDROID-device-parameter~^~(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryAndroidHardwareBufferANDROID-device-parameter)~^~implicit +VALIDATION_ERROR_45a10001~^~Y~^~None~^~vkGetMemoryAndroidHardwareBufferANDROID~^~VUID-vkGetMemoryAndroidHardwareBufferANDROID-pBuffer-parameter~^~(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'pBuffer must be a valid pointer to a valid pointer to a AHardwareBuffer value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryAndroidHardwareBufferANDROID-pBuffer-parameter)~^~implicit +VALIDATION_ERROR_45a39c01~^~N~^~None~^~vkGetMemoryAndroidHardwareBufferANDROID~^~VUID-vkGetMemoryAndroidHardwareBufferANDROID-pInfo-parameter~^~(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'pInfo must be a valid pointer to a valid VkMemoryGetAndroidHardwareBufferInfoANDROID structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryAndroidHardwareBufferANDROID-pInfo-parameter)~^~implicit +VALIDATION_ERROR_45c2b00b~^~N~^~None~^~VkAndroidHardwareBufferFormatPropertiesANDROID~^~VUID-VkAndroidHardwareBufferFormatPropertiesANDROID-sType-sType~^~(VK_ANDROID_external_memory_android_hardware_buffer)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAndroidHardwareBufferFormatPropertiesANDROID-sType-sType)~^~implicit +VALIDATION_ERROR_45e02401~^~N~^~None~^~vkCmdBeginDebugUtilsLabelEXT~^~VUID-vkCmdBeginDebugUtilsLabelEXT-commandBuffer-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginDebugUtilsLabelEXT-commandBuffer-parameter)~^~implicit +VALIDATION_ERROR_45e02413~^~N~^~None~^~vkCmdBeginDebugUtilsLabelEXT~^~VUID-vkCmdBeginDebugUtilsLabelEXT-commandBuffer-recording~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginDebugUtilsLabelEXT-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_45e02415~^~N~^~None~^~vkCmdBeginDebugUtilsLabelEXT~^~VUID-vkCmdBeginDebugUtilsLabelEXT-commandBuffer-cmdpool~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginDebugUtilsLabelEXT-commandBuffer-cmdpool)~^~implicit +VALIDATION_ERROR_45e42401~^~N~^~None~^~vkCmdBeginDebugUtilsLabelEXT~^~VUID-vkCmdBeginDebugUtilsLabelEXT-pLabelInfo-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'pLabelInfo must be a valid pointer to a valid VkDebugUtilsLabelEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginDebugUtilsLabelEXT-pLabelInfo-parameter)~^~implicit +VALIDATION_ERROR_46002401~^~N~^~None~^~vkCmdInsertDebugUtilsLabelEXT~^~VUID-vkCmdInsertDebugUtilsLabelEXT-commandBuffer-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdInsertDebugUtilsLabelEXT-commandBuffer-parameter)~^~implicit +VALIDATION_ERROR_46002413~^~N~^~None~^~vkCmdInsertDebugUtilsLabelEXT~^~VUID-vkCmdInsertDebugUtilsLabelEXT-commandBuffer-recording~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdInsertDebugUtilsLabelEXT-commandBuffer-recording)~^~implicit +VALIDATION_ERROR_46002415~^~N~^~None~^~vkCmdInsertDebugUtilsLabelEXT~^~VUID-vkCmdInsertDebugUtilsLabelEXT-commandBuffer-cmdpool~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdInsertDebugUtilsLabelEXT-commandBuffer-cmdpool)~^~implicit +VALIDATION_ERROR_46042401~^~N~^~None~^~vkCmdInsertDebugUtilsLabelEXT~^~VUID-vkCmdInsertDebugUtilsLabelEXT-pLabelInfo-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'pLabelInfo must be a valid pointer to a valid VkDebugUtilsLabelEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdInsertDebugUtilsLabelEXT-pLabelInfo-parameter)~^~implicit +VALIDATION_ERROR_46229c01~^~N~^~None~^~vkQueueBeginDebugUtilsLabelEXT~^~VUID-vkQueueBeginDebugUtilsLabelEXT-queue-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'queue must be a valid VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueueBeginDebugUtilsLabelEXT-queue-parameter)~^~implicit +VALIDATION_ERROR_46242401~^~N~^~None~^~vkQueueBeginDebugUtilsLabelEXT~^~VUID-vkQueueBeginDebugUtilsLabelEXT-pLabelInfo-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'pLabelInfo must be a valid pointer to a valid VkDebugUtilsLabelEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueueBeginDebugUtilsLabelEXT-pLabelInfo-parameter)~^~implicit +VALIDATION_ERROR_46429c01~^~N~^~None~^~vkQueueInsertDebugUtilsLabelEXT~^~VUID-vkQueueInsertDebugUtilsLabelEXT-queue-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'queue must be a valid VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueueInsertDebugUtilsLabelEXT-queue-parameter)~^~implicit +VALIDATION_ERROR_46442401~^~N~^~None~^~vkQueueInsertDebugUtilsLabelEXT~^~VUID-vkQueueInsertDebugUtilsLabelEXT-pLabelInfo-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'pLabelInfo must be a valid pointer to a valid VkDebugUtilsLabelEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueueInsertDebugUtilsLabelEXT-pLabelInfo-parameter)~^~implicit +VALIDATION_ERROR_46605601~^~N~^~None~^~vkSetDebugUtilsObjectNameEXT~^~VUID-vkSetDebugUtilsObjectNameEXT-device-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSetDebugUtilsObjectNameEXT-device-parameter)~^~implicit +VALIDATION_ERROR_4661c201~^~N~^~None~^~vkSetDebugUtilsObjectNameEXT~^~VUID-vkSetDebugUtilsObjectNameEXT-pNameInfo-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'pNameInfo must be a valid pointer to a valid VkDebugUtilsObjectNameInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSetDebugUtilsObjectNameEXT-pNameInfo-parameter)~^~implicit +VALIDATION_ERROR_46805601~^~N~^~None~^~vkSetDebugUtilsObjectTagEXT~^~VUID-vkSetDebugUtilsObjectTagEXT-device-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSetDebugUtilsObjectTagEXT-device-parameter)~^~implicit +VALIDATION_ERROR_46825c01~^~N~^~None~^~vkSetDebugUtilsObjectTagEXT~^~VUID-vkSetDebugUtilsObjectTagEXT-pTagInfo-parameter~^~(VK_EXT_debug_utils)~^~The spec valid usage text states 'pTagInfo must be a valid pointer to a valid VkDebugUtilsObjectTagInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSetDebugUtilsObjectTagEXT-pTagInfo-parameter)~^~implicit +VALIDATION_ERROR_46a01774~^~Y~^~DescriptorIndexingSetLayout~^~VkDescriptorSetLayoutBindingFlagsCreateInfoEXT~^~VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-bindingCount-03002~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If bindingCount is not zero, bindingCount must equal VkDescriptorSetLayoutCreateInfo::bindingCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-bindingCount-03002)~^~ +VALIDATION_ERROR_46a01776~^~Y~^~None~^~VkDescriptorSetLayoutBindingFlagsCreateInfoEXT~^~VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-flags-03003~^~(VK_EXT_descriptor_indexing)+(VK_KHR_push_descriptor)~^~The spec valid usage text states 'If VkDescriptorSetLayoutCreateInfo::flags includes VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then all elements of pBindingFlags must not include VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT, VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT, or VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-flags-03003)~^~ +VALIDATION_ERROR_46a01778~^~Y~^~None~^~VkDescriptorSetLayoutBindingFlagsCreateInfoEXT~^~VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-03004~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If an element of pBindingFlags includes VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT, then all other elements of VkDescriptorSetLayoutCreateInfo::pBindings must have a smaller value of binding' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-03004)~^~ +VALIDATION_ERROR_46a0177a~^~Y~^~DescriptorIndexingSetLayout~^~VkDescriptorSetLayoutBindingFlagsCreateInfoEXT~^~VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingUniformBufferUpdateAfterBind-03005~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingUniformBufferUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingUniformBufferUpdateAfterBind-03005)~^~ +VALIDATION_ERROR_46a0177c~^~Y~^~None~^~VkDescriptorSetLayoutBindingFlagsCreateInfoEXT~^~VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingSampledImageUpdateAfterBind-03006~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingSampledImageUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_SAMPLER, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, or VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingSampledImageUpdateAfterBind-03006)~^~ +VALIDATION_ERROR_46a0177e~^~Y~^~None~^~VkDescriptorSetLayoutBindingFlagsCreateInfoEXT~^~VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingStorageImageUpdateAfterBind-03007~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingStorageImageUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_STORAGE_IMAGE must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingStorageImageUpdateAfterBind-03007)~^~ +VALIDATION_ERROR_46a01780~^~Y~^~None~^~VkDescriptorSetLayoutBindingFlagsCreateInfoEXT~^~VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingStorageBufferUpdateAfterBind-03008~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingStorageBufferUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_STORAGE_BUFFER must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingStorageBufferUpdateAfterBind-03008)~^~ +VALIDATION_ERROR_46a01782~^~Y~^~None~^~VkDescriptorSetLayoutBindingFlagsCreateInfoEXT~^~VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingUniformTexelBufferUpdateAfterBind-03009~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingUniformTexelBufferUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingUniformTexelBufferUpdateAfterBind-03009)~^~ +VALIDATION_ERROR_46a01784~^~Y~^~None~^~VkDescriptorSetLayoutBindingFlagsCreateInfoEXT~^~VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingStorageTexelBufferUpdateAfterBind-03010~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingStorageTexelBufferUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingStorageTexelBufferUpdateAfterBind-03010)~^~ +VALIDATION_ERROR_46a01786~^~Y~^~None~^~VkDescriptorSetLayoutBindingFlagsCreateInfoEXT~^~VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-None-03011~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'All bindings with descriptor type VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-None-03011)~^~ +VALIDATION_ERROR_46a01788~^~Y~^~None~^~VkDescriptorSetLayoutBindingFlagsCreateInfoEXT~^~VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingUpdateUnusedWhilePending-03012~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingUpdateUnusedWhilePending is not enabled, all elements of pBindingFlags must not include VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingUpdateUnusedWhilePending-03012)~^~ +VALIDATION_ERROR_46a0178a~^~Y~^~None~^~VkDescriptorSetLayoutBindingFlagsCreateInfoEXT~^~VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingPartiallyBound-03013~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingPartiallyBound is not enabled, all elements of pBindingFlags must not include VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingPartiallyBound-03013)~^~ +VALIDATION_ERROR_46a0178c~^~Y~^~None~^~VkDescriptorSetLayoutBindingFlagsCreateInfoEXT~^~VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingVariableDescriptorCount-03014~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingVariableDescriptorCount is not enabled, all elements of pBindingFlags must not include VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingVariableDescriptorCount-03014)~^~ +VALIDATION_ERROR_46a0178e~^~Y~^~None~^~VkDescriptorSetLayoutBindingFlagsCreateInfoEXT~^~VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-03015~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If an element of pBindingFlags includes VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT, that element's descriptorType must not be VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-03015)~^~ +VALIDATION_ERROR_46a2b00b~^~N~^~None~^~VkDescriptorSetLayoutBindingFlagsCreateInfoEXT~^~VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-sType-sType~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_46a42a01~^~N~^~None~^~VkDescriptorSetLayoutBindingFlagsCreateInfoEXT~^~VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-parameter~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If bindingCount is not 0, pBindingFlags must be a valid pointer to an array of bindingCount valid combinations of VkDescriptorBindingFlagBitsEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-parameter)~^~implicit +VALIDATION_ERROR_46a42a03~^~N~^~None~^~VkDescriptorSetLayoutBindingFlagsCreateInfoEXT~^~VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-requiredbitmask~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'Each element of pBindingFlags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-requiredbitmask)~^~implicit +VALIDATION_ERROR_46c017ca~^~Y~^~None~^~VkDescriptorSetVariableDescriptorCountAllocateInfoEXT~^~VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-descriptorSetCount-03045~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If descriptorSetCount is not zero, descriptorSetCount must equal VkDescriptorSetAllocateInfo::descriptorSetCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-descriptorSetCount-03045)~^~ +VALIDATION_ERROR_46c017cc~^~Y~^~DescriptorIndexingSetLayout~^~VkDescriptorSetVariableDescriptorCountAllocateInfoEXT~^~VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-pSetLayouts-03046~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If VkDescriptorSetAllocateInfo::pSetLayouts[i] has a variable descriptor count binding, then pDescriptorCounts[i] must be less than or equal to the descriptor count specified for that binding when the descriptor set layout was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-pSetLayouts-03046)~^~ +VALIDATION_ERROR_46c2b00b~^~N~^~None~^~VkDescriptorSetVariableDescriptorCountAllocateInfoEXT~^~VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-sType-sType~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-sType-sType)~^~implicit +VALIDATION_ERROR_46c42c01~^~N~^~None~^~VkDescriptorSetVariableDescriptorCountAllocateInfoEXT~^~VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-pDescriptorCounts-parameter~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'If descriptorSetCount is not 0, pDescriptorCounts must be a valid pointer to an array of descriptorSetCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-pDescriptorCounts-parameter)~^~implicit +VALIDATION_ERROR_46e2b00b~^~N~^~None~^~VkDescriptorSetVariableDescriptorCountLayoutSupportEXT~^~VUID-VkDescriptorSetVariableDescriptorCountLayoutSupportEXT-sType-sType~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetVariableDescriptorCountLayoutSupportEXT-sType-sType)~^~implicit +VALIDATION_ERROR_4702b00b~^~N~^~None~^~VkPhysicalDeviceDescriptorIndexingFeaturesEXT~^~VUID-VkPhysicalDeviceDescriptorIndexingFeaturesEXT-sType-sType~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceDescriptorIndexingFeaturesEXT-sType-sType)~^~implicit +VALIDATION_ERROR_4722b00b~^~N~^~None~^~VkPhysicalDeviceDescriptorIndexingPropertiesEXT~^~VUID-VkPhysicalDeviceDescriptorIndexingPropertiesEXT-sType-sType~^~(VK_EXT_descriptor_indexing)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceDescriptorIndexingPropertiesEXT-sType-sType)~^~implicit +VALIDATION_ERROR_4742b00b~^~N~^~None~^~VkPhysicalDeviceShaderCorePropertiesAMD~^~VUID-VkPhysicalDeviceShaderCorePropertiesAMD-sType-sType~^~(VK_AMD_shader_core_properties)~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceShaderCorePropertiesAMD-sType-sType)~^~implicit +VALIDATION_ERROR_47600e9a~^~N~^~None~^~VkVertexInputBindingDivisorDescriptionEXT~^~VUID-VkVertexInputBindingDivisorDescriptionEXT-binding-01869~^~(VK_EXT_vertex_attribute_divisor)~^~The spec valid usage text states 'binding must be less than VkPhysicalDeviceLimits::maxVertexInputBindings' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkVertexInputBindingDivisorDescriptionEXT-binding-01869)~^~ +VALIDATION_ERROR_47600e9c~^~N~^~None~^~VkVertexInputBindingDivisorDescriptionEXT~^~VUID-VkVertexInputBindingDivisorDescriptionEXT-divisor-01870~^~(VK_EXT_vertex_attribute_divisor)~^~The spec valid usage text states 'divisor must be a value between 0 and VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT::maxVertexAttribDivisor, inclusive.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkVertexInputBindingDivisorDescriptionEXT-divisor-01870)~^~ +VALIDATION_ERROR_47600e9e~^~N~^~None~^~VkVertexInputBindingDivisorDescriptionEXT~^~VUID-VkVertexInputBindingDivisorDescriptionEXT-inputRate-01871~^~(VK_EXT_vertex_attribute_divisor)~^~The spec valid usage text states 'VkVertexInputBindingDescription::inputRate must be of type VK_VERTEX_INPUT_RATE_INSTANCE for this binding.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkVertexInputBindingDivisorDescriptionEXT-inputRate-01871)~^~ diff -Nru vulkan-1.0.65.2+dfsg1/layers/vk_validation_error_messages.h vulkan-1.1.73+dfsg/layers/vk_validation_error_messages.h --- vulkan-1.0.65.2+dfsg1/layers/vk_validation_error_messages.h 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/vk_validation_error_messages.h 2018-04-27 11:24:19.000000000 +0000 @@ -26,6 +26,7 @@ // Disable auto-formatting for generated file // clang-format off +#include #include // enum values for unique validation error codes @@ -40,6 +41,9 @@ VALIDATION_ERROR_00000a14 = 0x00000a14, VALIDATION_ERROR_00000a16 = 0x00000a16, VALIDATION_ERROR_00000d16 = 0x00000d16, + VALIDATION_ERROR_00000dea = 0x00000dea, + VALIDATION_ERROR_00000dec = 0x00000dec, + VALIDATION_ERROR_00000e18 = 0x00000e18, VALIDATION_ERROR_00008801 = 0x00008801, VALIDATION_ERROR_0001c40d = 0x0001c40d, VALIDATION_ERROR_0002b00b = 0x0002b00b, @@ -70,10 +74,6 @@ VALIDATION_ERROR_00a006b2 = 0x00a006b2, VALIDATION_ERROR_00a0be01 = 0x00a0be01, VALIDATION_ERROR_00c00009 = 0x00c00009, - VALIDATION_ERROR_00c00820 = 0x00c00820, - VALIDATION_ERROR_00c00822 = 0x00c00822, - VALIDATION_ERROR_00c00824 = 0x00c00824, - VALIDATION_ERROR_00c00826 = 0x00c00826, VALIDATION_ERROR_00c00c72 = 0x00c00c72, VALIDATION_ERROR_00c00c74 = 0x00c00c74, VALIDATION_ERROR_00c00c76 = 0x00c00c76, @@ -87,26 +87,12 @@ VALIDATION_ERROR_00c00c86 = 0x00c00c86, VALIDATION_ERROR_00c00c88 = 0x00c00c88, VALIDATION_ERROR_00c00c8a = 0x00c00c8a, + VALIDATION_ERROR_00c00ed8 = 0x00c00ed8, VALIDATION_ERROR_00c01a01 = 0x00c01a01, VALIDATION_ERROR_00c0c601 = 0x00c0c601, - VALIDATION_ERROR_00c13e01 = 0x00c13e01, VALIDATION_ERROR_00c1c40d = 0x00c1c40d, VALIDATION_ERROR_00c2b00b = 0x00c2b00b, VALIDATION_ERROR_00e00009 = 0x00e00009, - VALIDATION_ERROR_00e00838 = 0x00e00838, - VALIDATION_ERROR_00e0083a = 0x00e0083a, - VALIDATION_ERROR_00e0083c = 0x00e0083c, - VALIDATION_ERROR_00e0083e = 0x00e0083e, - VALIDATION_ERROR_00e00840 = 0x00e00840, - VALIDATION_ERROR_00e00842 = 0x00e00842, - VALIDATION_ERROR_00e00844 = 0x00e00844, - VALIDATION_ERROR_00e00846 = 0x00e00846, - VALIDATION_ERROR_00e0084a = 0x00e0084a, - VALIDATION_ERROR_00e0084c = 0x00e0084c, - VALIDATION_ERROR_00e0084e = 0x00e0084e, - VALIDATION_ERROR_00e00850 = 0x00e00850, - VALIDATION_ERROR_00e00852 = 0x00e00852, - VALIDATION_ERROR_00e00854 = 0x00e00854, VALIDATION_ERROR_00e00c92 = 0x00e00c92, VALIDATION_ERROR_00e00c94 = 0x00e00c94, VALIDATION_ERROR_00e00c96 = 0x00e00c96, @@ -131,15 +117,11 @@ VALIDATION_ERROR_00e00cbc = 0x00e00cbc, VALIDATION_ERROR_00e00cbe = 0x00e00cbe, VALIDATION_ERROR_00e00cc0 = 0x00e00cc0, + VALIDATION_ERROR_00e00ede = 0x00e00ede, VALIDATION_ERROR_00e0a001 = 0x00e0a001, - VALIDATION_ERROR_00e0c601 = 0x00e0c601, - VALIDATION_ERROR_00e13e01 = 0x00e13e01, VALIDATION_ERROR_00e1c40d = 0x00e1c40d, - VALIDATION_ERROR_00e22001 = 0x00e22001, VALIDATION_ERROR_00e2b00b = 0x00e2b00b, VALIDATION_ERROR_00e2b00f = 0x00e2b00f, - VALIDATION_ERROR_01000856 = 0x01000856, - VALIDATION_ERROR_01000858 = 0x01000858, VALIDATION_ERROR_01000cd8 = 0x01000cd8, VALIDATION_ERROR_0102b00b = 0x0102b00b, VALIDATION_ERROR_0102f001 = 0x0102f001, @@ -158,11 +140,12 @@ VALIDATION_ERROR_01400728 = 0x01400728, VALIDATION_ERROR_0140072a = 0x0140072a, VALIDATION_ERROR_0140072c = 0x0140072c, - VALIDATION_ERROR_0140072e = 0x0140072e, VALIDATION_ERROR_01400730 = 0x01400730, VALIDATION_ERROR_01400ade = 0x01400ade, VALIDATION_ERROR_01400b16 = 0x01400b16, VALIDATION_ERROR_01400c46 = 0x01400c46, + VALIDATION_ERROR_01400ebe = 0x01400ebe, + VALIDATION_ERROR_01400ec0 = 0x01400ec0, VALIDATION_ERROR_01409001 = 0x01409001, VALIDATION_ERROR_0141c40d = 0x0141c40d, VALIDATION_ERROR_0142b00b = 0x0142b00b, @@ -186,7 +169,6 @@ VALIDATION_ERROR_0160019e = 0x0160019e, VALIDATION_ERROR_016001a0 = 0x016001a0, VALIDATION_ERROR_016001a2 = 0x016001a2, - VALIDATION_ERROR_016001a4 = 0x016001a4, VALIDATION_ERROR_016001a6 = 0x016001a6, VALIDATION_ERROR_016001a8 = 0x016001a8, VALIDATION_ERROR_016001aa = 0x016001aa, @@ -194,6 +176,13 @@ VALIDATION_ERROR_01600c2c = 0x01600c2c, VALIDATION_ERROR_01600c2e = 0x01600c2e, VALIDATION_ERROR_01600c30 = 0x01600c30, + VALIDATION_ERROR_01600d8e = 0x01600d8e, + VALIDATION_ERROR_01600d90 = 0x01600d90, + VALIDATION_ERROR_01600d92 = 0x01600d92, + VALIDATION_ERROR_01600d94 = 0x01600d94, + VALIDATION_ERROR_01600d96 = 0x01600d96, + VALIDATION_ERROR_01600d98 = 0x01600d98, + VALIDATION_ERROR_01600d9a = 0x01600d9a, VALIDATION_ERROR_0160aa01 = 0x0160aa01, VALIDATION_ERROR_01800946 = 0x01800946, VALIDATION_ERROR_01800948 = 0x01800948, @@ -202,10 +191,11 @@ VALIDATION_ERROR_0180094e = 0x0180094e, VALIDATION_ERROR_01800950 = 0x01800950, VALIDATION_ERROR_01800952 = 0x01800952, - VALIDATION_ERROR_01800954 = 0x01800954, - VALIDATION_ERROR_01800956 = 0x01800956, VALIDATION_ERROR_01800958 = 0x01800958, - VALIDATION_ERROR_01800ac8 = 0x01800ac8, + VALIDATION_ERROR_01800dc6 = 0x01800dc6, + VALIDATION_ERROR_01800dc8 = 0x01800dc8, + VALIDATION_ERROR_01800dca = 0x01800dca, + VALIDATION_ERROR_01800f16 = 0x01800f16, VALIDATION_ERROR_01801a01 = 0x01801a01, VALIDATION_ERROR_01806801 = 0x01806801, VALIDATION_ERROR_0181c40d = 0x0181c40d, @@ -231,6 +221,8 @@ VALIDATION_ERROR_01c0002a = 0x01c0002a, VALIDATION_ERROR_01c00c01 = 0x01c00c01, VALIDATION_ERROR_01c00c03 = 0x01c00c03, + VALIDATION_ERROR_01c00e22 = 0x01c00e22, + VALIDATION_ERROR_01c00e24 = 0x01c00e24, VALIDATION_ERROR_01e0002c = 0x01e0002c, VALIDATION_ERROR_0200002e = 0x0200002e, VALIDATION_ERROR_02200009 = 0x02200009, @@ -304,6 +296,10 @@ VALIDATION_ERROR_032002b6 = 0x032002b6, VALIDATION_ERROR_032002b8 = 0x032002b8, VALIDATION_ERROR_032002ba = 0x032002ba, + VALIDATION_ERROR_03200efc = 0x03200efc, + VALIDATION_ERROR_03200efe = 0x03200efe, + VALIDATION_ERROR_03200f00 = 0x03200f00, + VALIDATION_ERROR_03200f02 = 0x03200f02, VALIDATION_ERROR_03207601 = 0x03207601, VALIDATION_ERROR_0321c40d = 0x0321c40d, VALIDATION_ERROR_0322b00b = 0x0322b00b, @@ -332,12 +328,8 @@ VALIDATION_ERROR_03a2b00b = 0x03a2b00b, VALIDATION_ERROR_03a2f41b = 0x03a2f41b, VALIDATION_ERROR_03c00ad2 = 0x03c00ad2, - VALIDATION_ERROR_03c00bb0 = 0x03c00bb0, - VALIDATION_ERROR_03c00bb2 = 0x03c00bb2, VALIDATION_ERROR_03c09001 = 0x03c09001, - VALIDATION_ERROR_03c1c40d = 0x03c1c40d, VALIDATION_ERROR_03c2b00b = 0x03c2b00b, - VALIDATION_ERROR_03e00732 = 0x03e00732, VALIDATION_ERROR_03e2b00b = 0x03e2b00b, VALIDATION_ERROR_040007c4 = 0x040007c4, VALIDATION_ERROR_0402b00b = 0x0402b00b, @@ -373,6 +365,7 @@ VALIDATION_ERROR_04c00264 = 0x04c00264, VALIDATION_ERROR_04c00266 = 0x04c00266, VALIDATION_ERROR_04c00268 = 0x04c00268, + VALIDATION_ERROR_04c017c8 = 0x04c017c8, VALIDATION_ERROR_04c04601 = 0x04c04601, VALIDATION_ERROR_04c04a1b = 0x04c04a1b, VALIDATION_ERROR_04c1c40d = 0x04c1c40d, @@ -385,6 +378,8 @@ VALIDATION_ERROR_0500022e = 0x0500022e, VALIDATION_ERROR_05000230 = 0x05000230, VALIDATION_ERROR_05000232 = 0x05000232, + VALIDATION_ERROR_05001770 = 0x05001770, + VALIDATION_ERROR_05001772 = 0x05001772, VALIDATION_ERROR_05009001 = 0x05009001, VALIDATION_ERROR_0500fc01 = 0x0500fc01, VALIDATION_ERROR_0501c40d = 0x0501c40d, @@ -399,8 +394,6 @@ VALIDATION_ERROR_05209005 = 0x05209005, VALIDATION_ERROR_05213201 = 0x05213201, VALIDATION_ERROR_0521c40d = 0x0521c40d, - VALIDATION_ERROR_05227e01 = 0x05227e01, - VALIDATION_ERROR_05228201 = 0x05228201, VALIDATION_ERROR_0522b00b = 0x0522b00b, VALIDATION_ERROR_0522f801 = 0x0522f801, VALIDATION_ERROR_054002c4 = 0x054002c4, @@ -409,6 +402,7 @@ VALIDATION_ERROR_056002e8 = 0x056002e8, VALIDATION_ERROR_056002ea = 0x056002ea, VALIDATION_ERROR_056002ec = 0x056002ec, + VALIDATION_ERROR_05600e60 = 0x05600e60, VALIDATION_ERROR_05609005 = 0x05609005, VALIDATION_ERROR_05615a01 = 0x05615a01, VALIDATION_ERROR_0561c40d = 0x0561c40d, @@ -467,7 +461,7 @@ VALIDATION_ERROR_06c002fa = 0x06c002fa, VALIDATION_ERROR_06c002fc = 0x06c002fc, VALIDATION_ERROR_06c002fe = 0x06c002fe, - VALIDATION_ERROR_06c09005 = 0x06c09005, + VALIDATION_ERROR_06c09001 = 0x06c09001, VALIDATION_ERROR_06c1c40d = 0x06c1c40d, VALIDATION_ERROR_06c20401 = 0x06c20401, VALIDATION_ERROR_06c29e1b = 0x06c29e1b, @@ -511,35 +505,26 @@ VALIDATION_ERROR_07e2b00b = 0x07e2b00b, VALIDATION_ERROR_08000520 = 0x08000520, VALIDATION_ERROR_08009e01 = 0x08009e01, - VALIDATION_ERROR_0801c40d = 0x0801c40d, VALIDATION_ERROR_0802b00b = 0x0802b00b, VALIDATION_ERROR_08209e01 = 0x08209e01, - VALIDATION_ERROR_0821c40d = 0x0821c40d, VALIDATION_ERROR_0822b00b = 0x0822b00b, VALIDATION_ERROR_08400522 = 0x08400522, VALIDATION_ERROR_0840f401 = 0x0840f401, - VALIDATION_ERROR_0841c40d = 0x0841c40d, VALIDATION_ERROR_0842b00b = 0x0842b00b, VALIDATION_ERROR_0860f401 = 0x0860f401, - VALIDATION_ERROR_0861c40d = 0x0861c40d, VALIDATION_ERROR_0862b00b = 0x0862b00b, VALIDATION_ERROR_088008c8 = 0x088008c8, VALIDATION_ERROR_08809e01 = 0x08809e01, - VALIDATION_ERROR_0881c40d = 0x0881c40d, VALIDATION_ERROR_0882b00b = 0x0882b00b, VALIDATION_ERROR_08a008ca = 0x08a008ca, VALIDATION_ERROR_08a0f401 = 0x08a0f401, - VALIDATION_ERROR_08a1c40d = 0x08a1c40d, VALIDATION_ERROR_08a2b00b = 0x08a2b00b, VALIDATION_ERROR_08c09e01 = 0x08c09e01, - VALIDATION_ERROR_08c1c40d = 0x08c1c40d, VALIDATION_ERROR_08c2b00b = 0x08c2b00b, VALIDATION_ERROR_08e09e01 = 0x08e09e01, VALIDATION_ERROR_08e09e03 = 0x08e09e03, - VALIDATION_ERROR_08e1c40d = 0x08e1c40d, VALIDATION_ERROR_08e2b00b = 0x08e2b00b, VALIDATION_ERROR_09009e01 = 0x09009e01, - VALIDATION_ERROR_0901c40d = 0x0901c40d, VALIDATION_ERROR_0902b00b = 0x0902b00b, VALIDATION_ERROR_09209001 = 0x09209001, VALIDATION_ERROR_0921c40d = 0x0921c40d, @@ -621,6 +606,8 @@ VALIDATION_ERROR_09600c3a = 0x09600c3a, VALIDATION_ERROR_09600d30 = 0x09600d30, VALIDATION_ERROR_09600d66 = 0x09600d66, + VALIDATION_ERROR_09600db8 = 0x09600db8, + VALIDATION_ERROR_09600dba = 0x09600dba, VALIDATION_ERROR_09609001 = 0x09609001, VALIDATION_ERROR_0960be01 = 0x0960be01, VALIDATION_ERROR_09615601 = 0x09615601, @@ -635,7 +622,6 @@ VALIDATION_ERROR_09800a48 = 0x09800a48, VALIDATION_ERROR_09809005 = 0x09809005, VALIDATION_ERROR_0981c40d = 0x0981c40d, - VALIDATION_ERROR_09826a01 = 0x09826a01, VALIDATION_ERROR_0982b00b = 0x0982b00b, VALIDATION_ERROR_09a001dc = 0x09a001dc, VALIDATION_ERROR_09a001de = 0x09a001de, @@ -665,14 +651,10 @@ VALIDATION_ERROR_09c00122 = 0x09c00122, VALIDATION_ERROR_09c00124 = 0x09c00124, VALIDATION_ERROR_09c00126 = 0x09c00126, - VALIDATION_ERROR_09c00128 = 0x09c00128, - VALIDATION_ERROR_09c0012a = 0x09c0012a, VALIDATION_ERROR_09c0012c = 0x09c0012c, VALIDATION_ERROR_09c0012e = 0x09c0012e, VALIDATION_ERROR_09c00130 = 0x09c00130, VALIDATION_ERROR_09c00132 = 0x09c00132, - VALIDATION_ERROR_09c00134 = 0x09c00134, - VALIDATION_ERROR_09c00136 = 0x09c00136, VALIDATION_ERROR_09c0013a = 0x09c0013a, VALIDATION_ERROR_09c0013c = 0x09c0013c, VALIDATION_ERROR_09c0013e = 0x09c0013e, @@ -681,7 +663,6 @@ VALIDATION_ERROR_09c00146 = 0x09c00146, VALIDATION_ERROR_09c00148 = 0x09c00148, VALIDATION_ERROR_09c0014a = 0x09c0014a, - VALIDATION_ERROR_09c0014c = 0x09c0014c, VALIDATION_ERROR_09c00c1e = 0x09c00c1e, VALIDATION_ERROR_09c00c20 = 0x09c00c20, VALIDATION_ERROR_09c00c22 = 0x09c00c22, @@ -689,6 +670,22 @@ VALIDATION_ERROR_09c00c26 = 0x09c00c26, VALIDATION_ERROR_09c00c28 = 0x09c00c28, VALIDATION_ERROR_09c00c2a = 0x09c00c2a, + VALIDATION_ERROR_09c00d7e = 0x09c00d7e, + VALIDATION_ERROR_09c00d80 = 0x09c00d80, + VALIDATION_ERROR_09c00d82 = 0x09c00d82, + VALIDATION_ERROR_09c00d84 = 0x09c00d84, + VALIDATION_ERROR_09c00d86 = 0x09c00d86, + VALIDATION_ERROR_09c00d88 = 0x09c00d88, + VALIDATION_ERROR_09c00d8a = 0x09c00d8a, + VALIDATION_ERROR_09c00d8c = 0x09c00d8c, + VALIDATION_ERROR_09c00df2 = 0x09c00df2, + VALIDATION_ERROR_09c00df4 = 0x09c00df4, + VALIDATION_ERROR_09c00df6 = 0x09c00df6, + VALIDATION_ERROR_09c00df8 = 0x09c00df8, + VALIDATION_ERROR_09c00dfa = 0x09c00dfa, + VALIDATION_ERROR_09c00dfc = 0x09c00dfc, + VALIDATION_ERROR_09c00dfe = 0x09c00dfe, + VALIDATION_ERROR_09c00e00 = 0x09c00e00, VALIDATION_ERROR_09c07a01 = 0x09c07a01, VALIDATION_ERROR_09c2d601 = 0x09c2d601, VALIDATION_ERROR_09e00758 = 0x09e00758, @@ -728,19 +725,8 @@ VALIDATION_ERROR_09e0079c = 0x09e0079c, VALIDATION_ERROR_09e0079e = 0x09e0079e, VALIDATION_ERROR_09e007a0 = 0x09e007a0, - VALIDATION_ERROR_09e007a2 = 0x09e007a2, - VALIDATION_ERROR_09e007a4 = 0x09e007a4, - VALIDATION_ERROR_09e007a6 = 0x09e007a6, - VALIDATION_ERROR_09e007a8 = 0x09e007a8, - VALIDATION_ERROR_09e007aa = 0x09e007aa, - VALIDATION_ERROR_09e007ac = 0x09e007ac, - VALIDATION_ERROR_09e007ae = 0x09e007ae, - VALIDATION_ERROR_09e007b0 = 0x09e007b0, - VALIDATION_ERROR_09e007b2 = 0x09e007b2, - VALIDATION_ERROR_09e007b4 = 0x09e007b4, VALIDATION_ERROR_09e007b6 = 0x09e007b6, VALIDATION_ERROR_09e007b8 = 0x09e007b8, - VALIDATION_ERROR_09e007ba = 0x09e007ba, VALIDATION_ERROR_09e007bc = 0x09e007bc, VALIDATION_ERROR_09e007be = 0x09e007be, VALIDATION_ERROR_09e007c0 = 0x09e007c0, @@ -756,6 +742,13 @@ VALIDATION_ERROR_09e00c4e = 0x09e00c4e, VALIDATION_ERROR_09e00c50 = 0x09e00c50, VALIDATION_ERROR_09e00c52 = 0x09e00c52, + VALIDATION_ERROR_09e00ec2 = 0x09e00ec2, + VALIDATION_ERROR_09e00ec4 = 0x09e00ec4, + VALIDATION_ERROR_09e00ec6 = 0x09e00ec6, + VALIDATION_ERROR_09e00ec8 = 0x09e00ec8, + VALIDATION_ERROR_09e00eca = 0x09e00eca, + VALIDATION_ERROR_09e00f08 = 0x09e00f08, + VALIDATION_ERROR_09e00f0a = 0x09e00f0a, VALIDATION_ERROR_09e09001 = 0x09e09001, VALIDATION_ERROR_09e09201 = 0x09e09201, VALIDATION_ERROR_09e0ac01 = 0x09e0ac01, @@ -773,10 +766,7 @@ VALIDATION_ERROR_0a00095e = 0x0a00095e, VALIDATION_ERROR_0a000960 = 0x0a000960, VALIDATION_ERROR_0a000962 = 0x0a000962, - VALIDATION_ERROR_0a000964 = 0x0a000964, - VALIDATION_ERROR_0a000966 = 0x0a000966, VALIDATION_ERROR_0a00096a = 0x0a00096a, - VALIDATION_ERROR_0a00096c = 0x0a00096c, VALIDATION_ERROR_0a00096e = 0x0a00096e, VALIDATION_ERROR_0a000970 = 0x0a000970, VALIDATION_ERROR_0a000972 = 0x0a000972, @@ -785,11 +775,8 @@ VALIDATION_ERROR_0a000978 = 0x0a000978, VALIDATION_ERROR_0a00097a = 0x0a00097a, VALIDATION_ERROR_0a000aca = 0x0a000aca, - VALIDATION_ERROR_0a000acc = 0x0a000acc, VALIDATION_ERROR_0a000b9c = 0x0a000b9c, - VALIDATION_ERROR_0a000b9e = 0x0a000b9e, VALIDATION_ERROR_0a000ba0 = 0x0a000ba0, - VALIDATION_ERROR_0a000ba2 = 0x0a000ba2, VALIDATION_ERROR_0a000cf4 = 0x0a000cf4, VALIDATION_ERROR_0a000cf6 = 0x0a000cf6, VALIDATION_ERROR_0a000d0e = 0x0a000d0e, @@ -797,6 +784,10 @@ VALIDATION_ERROR_0a000d12 = 0x0a000d12, VALIDATION_ERROR_0a000d78 = 0x0a000d78, VALIDATION_ERROR_0a000d7a = 0x0a000d7a, + VALIDATION_ERROR_0a000dcc = 0x0a000dcc, + VALIDATION_ERROR_0a000dce = 0x0a000dce, + VALIDATION_ERROR_0a000dd0 = 0x0a000dd0, + VALIDATION_ERROR_0a000f18 = 0x0a000f18, VALIDATION_ERROR_0a006801 = 0x0a006801, VALIDATION_ERROR_0a00a001 = 0x0a00a001, VALIDATION_ERROR_0a00d401 = 0x0a00d401, @@ -820,21 +811,13 @@ VALIDATION_ERROR_0a20022c = 0x0a20022c, VALIDATION_ERROR_0a207a01 = 0x0a207a01, VALIDATION_ERROR_0a22d601 = 0x0a22d601, - VALIDATION_ERROR_0a4007cc = 0x0a4007cc, - VALIDATION_ERROR_0a4007ce = 0x0a4007ce, VALIDATION_ERROR_0a400c01 = 0x0a400c01, VALIDATION_ERROR_0a400c03 = 0x0a400c03, VALIDATION_ERROR_0a60014e = 0x0a60014e, VALIDATION_ERROR_0a600150 = 0x0a600150, - VALIDATION_ERROR_0a600152 = 0x0a600152, - VALIDATION_ERROR_0a600154 = 0x0a600154, VALIDATION_ERROR_0a600c01 = 0x0a600c01, VALIDATION_ERROR_0a600c03 = 0x0a600c03, VALIDATION_ERROR_0a600d48 = 0x0a600d48, - VALIDATION_ERROR_0a8007fc = 0x0a8007fc, - VALIDATION_ERROR_0a8007fe = 0x0a8007fe, - VALIDATION_ERROR_0a800800 = 0x0a800800, - VALIDATION_ERROR_0a800802 = 0x0a800802, VALIDATION_ERROR_0a800c01 = 0x0a800c01, VALIDATION_ERROR_0a800c03 = 0x0a800c03, VALIDATION_ERROR_0a800d0c = 0x0a800d0c, @@ -857,15 +840,12 @@ VALIDATION_ERROR_0ac007ec = 0x0ac007ec, VALIDATION_ERROR_0ac007ee = 0x0ac007ee, VALIDATION_ERROR_0ac007f0 = 0x0ac007f0, - VALIDATION_ERROR_0ac007f2 = 0x0ac007f2, VALIDATION_ERROR_0ac007f4 = 0x0ac007f4, VALIDATION_ERROR_0ac007f6 = 0x0ac007f6, VALIDATION_ERROR_0ac007f8 = 0x0ac007f8, VALIDATION_ERROR_0ac007fa = 0x0ac007fa, VALIDATION_ERROR_0ac00b8c = 0x0ac00b8c, - VALIDATION_ERROR_0ac00b8e = 0x0ac00b8e, VALIDATION_ERROR_0ac00b90 = 0x0ac00b90, - VALIDATION_ERROR_0ac00b92 = 0x0ac00b92, VALIDATION_ERROR_0ac00b94 = 0x0ac00b94, VALIDATION_ERROR_0ac00b96 = 0x0ac00b96, VALIDATION_ERROR_0ac00b98 = 0x0ac00b98, @@ -876,6 +856,11 @@ VALIDATION_ERROR_0ac00c64 = 0x0ac00c64, VALIDATION_ERROR_0ac00d6c = 0x0ac00d6c, VALIDATION_ERROR_0ac00d6e = 0x0ac00d6e, + VALIDATION_ERROR_0ac00dbe = 0x0ac00dbe, + VALIDATION_ERROR_0ac00dc0 = 0x0ac00dc0, + VALIDATION_ERROR_0ac00dc2 = 0x0ac00dc2, + VALIDATION_ERROR_0ac00dc4 = 0x0ac00dc4, + VALIDATION_ERROR_0ac00ed0 = 0x0ac00ed0, VALIDATION_ERROR_0ac02c01 = 0x0ac02c01, VALIDATION_ERROR_0ac09005 = 0x0ac09005, VALIDATION_ERROR_0ac09201 = 0x0ac09201, @@ -890,8 +875,8 @@ VALIDATION_ERROR_0ae0053a = 0x0ae0053a, VALIDATION_ERROR_0ae0053c = 0x0ae0053c, VALIDATION_ERROR_0ae00be0 = 0x0ae00be0, + VALIDATION_ERROR_0ae00da4 = 0x0ae00da4, VALIDATION_ERROR_0ae09c01 = 0x0ae09c01, - VALIDATION_ERROR_0ae1c40d = 0x0ae1c40d, VALIDATION_ERROR_0ae2b00b = 0x0ae2b00b, VALIDATION_ERROR_0b000524 = 0x0b000524, VALIDATION_ERROR_0b000526 = 0x0b000526, @@ -903,15 +888,12 @@ VALIDATION_ERROR_0b000bdc = 0x0b000bdc, VALIDATION_ERROR_0b000bde = 0x0b000bde, VALIDATION_ERROR_0b009c01 = 0x0b009c01, - VALIDATION_ERROR_0b01c40d = 0x0b01c40d, VALIDATION_ERROR_0b02b00b = 0x0b02b00b, VALIDATION_ERROR_0b200a5e = 0x0b200a5e, VALIDATION_ERROR_0b200a60 = 0x0b200a60, VALIDATION_ERROR_0b209c01 = 0x0b209c01, - VALIDATION_ERROR_0b21c40d = 0x0b21c40d, VALIDATION_ERROR_0b22b00b = 0x0b22b00b, VALIDATION_ERROR_0b4008ee = 0x0b4008ee, - VALIDATION_ERROR_0b4008f0 = 0x0b4008f0, VALIDATION_ERROR_0b400c10 = 0x0b400c10, VALIDATION_ERROR_0b409001 = 0x0b409001, VALIDATION_ERROR_0b409c01 = 0x0b409c01, @@ -919,7 +901,6 @@ VALIDATION_ERROR_0b42b00b = 0x0b42b00b, VALIDATION_ERROR_0b42b801 = 0x0b42b801, VALIDATION_ERROR_0b6008e8 = 0x0b6008e8, - VALIDATION_ERROR_0b6008ea = 0x0b6008ea, VALIDATION_ERROR_0b600b74 = 0x0b600b74, VALIDATION_ERROR_0b600b76 = 0x0b600b76, VALIDATION_ERROR_0b600b78 = 0x0b600b78, @@ -928,7 +909,6 @@ VALIDATION_ERROR_0b600c0e = 0x0b600c0e, VALIDATION_ERROR_0b609001 = 0x0b609001, VALIDATION_ERROR_0b609c01 = 0x0b609c01, - VALIDATION_ERROR_0b609c03 = 0x0b609c03, VALIDATION_ERROR_0b61c40d = 0x0b61c40d, VALIDATION_ERROR_0b62b00b = 0x0b62b00b, VALIDATION_ERROR_0b62b801 = 0x0b62b801, @@ -962,13 +942,11 @@ VALIDATION_ERROR_0c000a4a = 0x0c000a4a, VALIDATION_ERROR_0c009005 = 0x0c009005, VALIDATION_ERROR_0c01c40d = 0x0c01c40d, - VALIDATION_ERROR_0c026a01 = 0x0c026a01, VALIDATION_ERROR_0c02b00b = 0x0c02b00b, VALIDATION_ERROR_0c200558 = 0x0c200558, VALIDATION_ERROR_0c20055a = 0x0c20055a, VALIDATION_ERROR_0c20055c = 0x0c20055c, VALIDATION_ERROR_0c20055e = 0x0c20055e, - VALIDATION_ERROR_0c200560 = 0x0c200560, VALIDATION_ERROR_0c200ada = 0x0c200ada, VALIDATION_ERROR_0c200adc = 0x0c200adc, VALIDATION_ERROR_0c20c601 = 0x0c20c601, @@ -978,18 +956,24 @@ VALIDATION_ERROR_0c400548 = 0x0c400548, VALIDATION_ERROR_0c409001 = 0x0c409001, VALIDATION_ERROR_0c42b00b = 0x0c42b00b, - VALIDATION_ERROR_0c6004fa = 0x0c6004fa, VALIDATION_ERROR_0c6004fc = 0x0c6004fc, VALIDATION_ERROR_0c6004fe = 0x0c6004fe, VALIDATION_ERROR_0c600500 = 0x0c600500, VALIDATION_ERROR_0c600502 = 0x0c600502, - VALIDATION_ERROR_0c600504 = 0x0c600504, VALIDATION_ERROR_0c600506 = 0x0c600506, VALIDATION_ERROR_0c600508 = 0x0c600508, VALIDATION_ERROR_0c60050a = 0x0c60050a, VALIDATION_ERROR_0c60050c = 0x0c60050c, VALIDATION_ERROR_0c60050e = 0x0c60050e, VALIDATION_ERROR_0c600510 = 0x0c600510, + VALIDATION_ERROR_0c600d9c = 0x0c600d9c, + VALIDATION_ERROR_0c600d9e = 0x0c600d9e, + VALIDATION_ERROR_0c600da0 = 0x0c600da0, + VALIDATION_ERROR_0c600da2 = 0x0c600da2, + VALIDATION_ERROR_0c600ea0 = 0x0c600ea0, + VALIDATION_ERROR_0c600ea2 = 0x0c600ea2, + VALIDATION_ERROR_0c600ea4 = 0x0c600ea4, + VALIDATION_ERROR_0c600ea6 = 0x0c600ea6, VALIDATION_ERROR_0c61c40d = 0x0c61c40d, VALIDATION_ERROR_0c62b00b = 0x0c62b00b, VALIDATION_ERROR_0c62b00f = 0x0c62b00f, @@ -1049,7 +1033,6 @@ VALIDATION_ERROR_0d809001 = 0x0d809001, VALIDATION_ERROR_0d809003 = 0x0d809003, VALIDATION_ERROR_0d830401 = 0x0d830401, - VALIDATION_ERROR_0da1c40d = 0x0da1c40d, VALIDATION_ERROR_0da2b00b = 0x0da2b00b, VALIDATION_ERROR_0dc09001 = 0x0dc09001, VALIDATION_ERROR_0dc09c01 = 0x0dc09c01, @@ -1062,10 +1045,7 @@ VALIDATION_ERROR_0e009c01 = 0x0e009c01, VALIDATION_ERROR_0e01c40d = 0x0e01c40d, VALIDATION_ERROR_0e02b00b = 0x0e02b00b, - VALIDATION_ERROR_0e200486 = 0x0e200486, - VALIDATION_ERROR_0e41c40d = 0x0e41c40d, VALIDATION_ERROR_0e42b00b = 0x0e42b00b, - VALIDATION_ERROR_0e42b00f = 0x0e42b00f, VALIDATION_ERROR_0e609001 = 0x0e609001, VALIDATION_ERROR_0e609201 = 0x0e609201, VALIDATION_ERROR_0e61c40d = 0x0e61c40d, @@ -1077,7 +1057,6 @@ VALIDATION_ERROR_0e800488 = 0x0e800488, VALIDATION_ERROR_0e80048a = 0x0e80048a, VALIDATION_ERROR_0e82b00b = 0x0e82b00b, - VALIDATION_ERROR_0ea1c40d = 0x0ea1c40d, VALIDATION_ERROR_0ea2b00b = 0x0ea2b00b, VALIDATION_ERROR_0ec0088e = 0x0ec0088e, VALIDATION_ERROR_0ec09201 = 0x0ec09201, @@ -1130,7 +1109,6 @@ VALIDATION_ERROR_0f80048c = 0x0f80048c, VALIDATION_ERROR_0f805e01 = 0x0f805e01, VALIDATION_ERROR_0f809005 = 0x0f809005, - VALIDATION_ERROR_0f81c40d = 0x0f81c40d, VALIDATION_ERROR_0f82b00b = 0x0f82b00b, VALIDATION_ERROR_0fa00b44 = 0x0fa00b44, VALIDATION_ERROR_0fa07c1b = 0x0fa07c1b, @@ -1162,6 +1140,34 @@ VALIDATION_ERROR_0fe00d24 = 0x0fe00d24, VALIDATION_ERROR_0fe00d26 = 0x0fe00d26, VALIDATION_ERROR_0fe00d28 = 0x0fe00d28, + VALIDATION_ERROR_0fe01790 = 0x0fe01790, + VALIDATION_ERROR_0fe01792 = 0x0fe01792, + VALIDATION_ERROR_0fe01794 = 0x0fe01794, + VALIDATION_ERROR_0fe01796 = 0x0fe01796, + VALIDATION_ERROR_0fe01798 = 0x0fe01798, + VALIDATION_ERROR_0fe0179a = 0x0fe0179a, + VALIDATION_ERROR_0fe0179c = 0x0fe0179c, + VALIDATION_ERROR_0fe0179e = 0x0fe0179e, + VALIDATION_ERROR_0fe017a0 = 0x0fe017a0, + VALIDATION_ERROR_0fe017a2 = 0x0fe017a2, + VALIDATION_ERROR_0fe017a4 = 0x0fe017a4, + VALIDATION_ERROR_0fe017a6 = 0x0fe017a6, + VALIDATION_ERROR_0fe017a8 = 0x0fe017a8, + VALIDATION_ERROR_0fe017aa = 0x0fe017aa, + VALIDATION_ERROR_0fe017ac = 0x0fe017ac, + VALIDATION_ERROR_0fe017ae = 0x0fe017ae, + VALIDATION_ERROR_0fe017b0 = 0x0fe017b0, + VALIDATION_ERROR_0fe017b2 = 0x0fe017b2, + VALIDATION_ERROR_0fe017b4 = 0x0fe017b4, + VALIDATION_ERROR_0fe017b6 = 0x0fe017b6, + VALIDATION_ERROR_0fe017b8 = 0x0fe017b8, + VALIDATION_ERROR_0fe017ba = 0x0fe017ba, + VALIDATION_ERROR_0fe017bc = 0x0fe017bc, + VALIDATION_ERROR_0fe017be = 0x0fe017be, + VALIDATION_ERROR_0fe017c0 = 0x0fe017c0, + VALIDATION_ERROR_0fe017c2 = 0x0fe017c2, + VALIDATION_ERROR_0fe017c4 = 0x0fe017c4, + VALIDATION_ERROR_0fe017c6 = 0x0fe017c6, VALIDATION_ERROR_0fe09005 = 0x0fe09005, VALIDATION_ERROR_0fe1c40d = 0x0fe1c40d, VALIDATION_ERROR_0fe1f801 = 0x0fe1f801, @@ -1178,7 +1184,6 @@ VALIDATION_ERROR_1002b00b = 0x1002b00b, VALIDATION_ERROR_1002b00f = 0x1002b00f, VALIDATION_ERROR_1020061c = 0x1020061c, - VALIDATION_ERROR_1020061e = 0x1020061e, VALIDATION_ERROR_10200b0a = 0x10200b0a, VALIDATION_ERROR_10200b0c = 0x10200b0c, VALIDATION_ERROR_10200bc6 = 0x10200bc6, @@ -1188,6 +1193,7 @@ VALIDATION_ERROR_1021c40d = 0x1021c40d, VALIDATION_ERROR_10228601 = 0x10228601, VALIDATION_ERROR_1022b00b = 0x1022b00b, + VALIDATION_ERROR_1022b00f = 0x1022b00f, VALIDATION_ERROR_1042a601 = 0x1042a601, VALIDATION_ERROR_1042b00b = 0x1042b00b, VALIDATION_ERROR_10600580 = 0x10600580, @@ -1242,12 +1248,8 @@ VALIDATION_ERROR_10c30a1b = 0x10c30a1b, VALIDATION_ERROR_10e0097e = 0x10e0097e, VALIDATION_ERROR_10e09005 = 0x10e09005, - VALIDATION_ERROR_10e1c40d = 0x10e1c40d, VALIDATION_ERROR_10e2b00b = 0x10e2b00b, VALIDATION_ERROR_10e30a1b = 0x10e30a1b, - VALIDATION_ERROR_11000a4e = 0x11000a4e, - VALIDATION_ERROR_11000a50 = 0x11000a50, - VALIDATION_ERROR_11000a52 = 0x11000a52, VALIDATION_ERROR_1102b00b = 0x1102b00b, VALIDATION_ERROR_11030a1b = 0x11030a1b, VALIDATION_ERROR_11200009 = 0x11200009, @@ -1303,6 +1305,11 @@ VALIDATION_ERROR_1220068c = 0x1220068c, VALIDATION_ERROR_12200c3c = 0x12200c3c, VALIDATION_ERROR_12200c3e = 0x12200c3e, + VALIDATION_ERROR_12200f0c = 0x12200f0c, + VALIDATION_ERROR_12200f0e = 0x12200f0e, + VALIDATION_ERROR_12200f10 = 0x12200f10, + VALIDATION_ERROR_12200f12 = 0x12200f12, + VALIDATION_ERROR_12200f14 = 0x12200f14, VALIDATION_ERROR_12209005 = 0x12209005, VALIDATION_ERROR_1220f201 = 0x1220f201, VALIDATION_ERROR_12212601 = 0x12212601, @@ -1311,12 +1318,8 @@ VALIDATION_ERROR_1222b00b = 0x1222b00b, VALIDATION_ERROR_1222b00f = 0x1222b00f, VALIDATION_ERROR_1222e61b = 0x1222e61b, - VALIDATION_ERROR_1240068e = 0x1240068e, - VALIDATION_ERROR_12400690 = 0x12400690, VALIDATION_ERROR_12400692 = 0x12400692, - VALIDATION_ERROR_12400694 = 0x12400694, VALIDATION_ERROR_12411a01 = 0x12411a01, - VALIDATION_ERROR_1241c40d = 0x1241c40d, VALIDATION_ERROR_12426c01 = 0x12426c01, VALIDATION_ERROR_12426e01 = 0x12426e01, VALIDATION_ERROR_1242b00b = 0x1242b00b, @@ -1451,7 +1454,6 @@ VALIDATION_ERROR_140006a0 = 0x140006a0, VALIDATION_ERROR_140006a2 = 0x140006a2, VALIDATION_ERROR_140006a4 = 0x140006a4, - VALIDATION_ERROR_140006a6 = 0x140006a6, VALIDATION_ERROR_140006a8 = 0x140006a8, VALIDATION_ERROR_140006aa = 0x140006aa, VALIDATION_ERROR_140006ac = 0x140006ac, @@ -1471,7 +1473,6 @@ VALIDATION_ERROR_1421c40d = 0x1421c40d, VALIDATION_ERROR_1422b00b = 0x1422b00b, VALIDATION_ERROR_144009b8 = 0x144009b8, - VALIDATION_ERROR_1441c40d = 0x1441c40d, VALIDATION_ERROR_1442b00b = 0x1442b00b, VALIDATION_ERROR_1442ee01 = 0x1442ee01, VALIDATION_ERROR_14600009 = 0x14600009, @@ -1493,8 +1494,9 @@ VALIDATION_ERROR_14600b26 = 0x14600b26, VALIDATION_ERROR_14600b28 = 0x14600b28, VALIDATION_ERROR_14600b2a = 0x14600b2a, - VALIDATION_ERROR_14600d14 = 0x14600d14, VALIDATION_ERROR_14600d32 = 0x14600d32, + VALIDATION_ERROR_14600de4 = 0x14600de4, + VALIDATION_ERROR_14600f1a = 0x14600f1a, VALIDATION_ERROR_14602e01 = 0x14602e01, VALIDATION_ERROR_14609001 = 0x14609001, VALIDATION_ERROR_1460a201 = 0x1460a201, @@ -1512,7 +1514,6 @@ VALIDATION_ERROR_1462ec01 = 0x1462ec01, VALIDATION_ERROR_14805a1b = 0x14805a1b, VALIDATION_ERROR_14814401 = 0x14814401, - VALIDATION_ERROR_1481c40d = 0x1481c40d, VALIDATION_ERROR_1482b00b = 0x1482b00b, VALIDATION_ERROR_14a004d8 = 0x14a004d8, VALIDATION_ERROR_14a004da = 0x14a004da, @@ -1526,16 +1527,18 @@ VALIDATION_ERROR_14e09005 = 0x14e09005, VALIDATION_ERROR_14e1c40d = 0x14e1c40d, VALIDATION_ERROR_14e2b00b = 0x14e2b00b, - VALIDATION_ERROR_14e30e01 = 0x14e30e01, - VALIDATION_ERROR_15000996 = 0x15000996, - VALIDATION_ERROR_15000998 = 0x15000998, - VALIDATION_ERROR_1500099a = 0x1500099a, - VALIDATION_ERROR_1500099c = 0x1500099c, - VALIDATION_ERROR_1500099e = 0x1500099e, VALIDATION_ERROR_150009a0 = 0x150009a0, VALIDATION_ERROR_150009a2 = 0x150009a2, VALIDATION_ERROR_150009a4 = 0x150009a4, VALIDATION_ERROR_150009a6 = 0x150009a6, + VALIDATION_ERROR_15000dd4 = 0x15000dd4, + VALIDATION_ERROR_15000dd6 = 0x15000dd6, + VALIDATION_ERROR_15000dd8 = 0x15000dd8, + VALIDATION_ERROR_15000dda = 0x15000dda, + VALIDATION_ERROR_15000ddc = 0x15000ddc, + VALIDATION_ERROR_15000dde = 0x15000dde, + VALIDATION_ERROR_15000de0 = 0x15000de0, + VALIDATION_ERROR_15000de2 = 0x15000de2, VALIDATION_ERROR_15230c01 = 0x15230c01, VALIDATION_ERROR_15231001 = 0x15231001, VALIDATION_ERROR_15231201 = 0x15231201, @@ -1593,6 +1596,7 @@ VALIDATION_ERROR_15c002a6 = 0x15c002a6, VALIDATION_ERROR_15c00af4 = 0x15c00af4, VALIDATION_ERROR_15c00af6 = 0x15c00af6, + VALIDATION_ERROR_15c017d0 = 0x15c017d0, VALIDATION_ERROR_15c0441b = 0x15c0441b, VALIDATION_ERROR_15c04e01 = 0x15c04e01, VALIDATION_ERROR_15c1c40d = 0x15c1c40d, @@ -1607,6 +1611,7 @@ VALIDATION_ERROR_16009005 = 0x16009005, VALIDATION_ERROR_1601c40d = 0x1601c40d, VALIDATION_ERROR_1602b00b = 0x1602b00b, + VALIDATION_ERROR_16200e16 = 0x16200e16, VALIDATION_ERROR_16205601 = 0x16205601, VALIDATION_ERROR_1620e001 = 0x1620e001, VALIDATION_ERROR_16218601 = 0x16218601, @@ -1614,6 +1619,9 @@ VALIDATION_ERROR_16400a0a = 0x16400a0a, VALIDATION_ERROR_16400a0c = 0x16400a0c, VALIDATION_ERROR_16400a0e = 0x16400a0e, + VALIDATION_ERROR_16400de6 = 0x16400de6, + VALIDATION_ERROR_16400de8 = 0x16400de8, + VALIDATION_ERROR_16400e14 = 0x16400e14, VALIDATION_ERROR_16405601 = 0x16405601, VALIDATION_ERROR_16408801 = 0x16408801, VALIDATION_ERROR_16408807 = 0x16408807, @@ -1630,7 +1638,6 @@ VALIDATION_ERROR_16a05601 = 0x16a05601, VALIDATION_ERROR_16a0ea01 = 0x16a0ea01, VALIDATION_ERROR_16a13001 = 0x16a13001, - VALIDATION_ERROR_16c004f8 = 0x16c004f8, VALIDATION_ERROR_16c00d62 = 0x16c00d62, VALIDATION_ERROR_16c00d64 = 0x16c00d64, VALIDATION_ERROR_16c05601 = 0x16c05601, @@ -1656,6 +1663,8 @@ VALIDATION_ERROR_1700081e = 0x1700081e, VALIDATION_ERROR_17000b48 = 0x17000b48, VALIDATION_ERROR_17000bc8 = 0x17000bc8, + VALIDATION_ERROR_17000ed4 = 0x17000ed4, + VALIDATION_ERROR_17000ed6 = 0x17000ed6, VALIDATION_ERROR_17001a01 = 0x17001a01, VALIDATION_ERROR_17001a07 = 0x17001a07, VALIDATION_ERROR_17005601 = 0x17005601, @@ -1675,6 +1684,8 @@ VALIDATION_ERROR_17400b4a = 0x17400b4a, VALIDATION_ERROR_17400bca = 0x17400bca, VALIDATION_ERROR_17400c90 = 0x17400c90, + VALIDATION_ERROR_17400eda = 0x17400eda, + VALIDATION_ERROR_17400edc = 0x17400edc, VALIDATION_ERROR_17405601 = 0x17405601, VALIDATION_ERROR_1740a001 = 0x1740a001, VALIDATION_ERROR_1740a007 = 0x1740a007, @@ -1684,17 +1695,15 @@ VALIDATION_ERROR_17605601 = 0x17605601, VALIDATION_ERROR_1760fa01 = 0x1760fa01, VALIDATION_ERROR_17800009 = 0x17800009, - VALIDATION_ERROR_1780063c = 0x1780063c, - VALIDATION_ERROR_1780063e = 0x1780063e, VALIDATION_ERROR_17800640 = 0x17800640, - VALIDATION_ERROR_17800642 = 0x17800642, VALIDATION_ERROR_17800644 = 0x17800644, VALIDATION_ERROR_17800646 = 0x17800646, VALIDATION_ERROR_17800648 = 0x17800648, VALIDATION_ERROR_1780064a = 0x1780064a, - VALIDATION_ERROR_1780064c = 0x1780064c, VALIDATION_ERROR_1780064e = 0x1780064e, VALIDATION_ERROR_17800650 = 0x17800650, + VALIDATION_ERROR_17800eba = 0x17800eba, + VALIDATION_ERROR_17800f04 = 0x17800f04, VALIDATION_ERROR_17802401 = 0x17802401, VALIDATION_ERROR_17802413 = 0x17802413, VALIDATION_ERROR_17802415 = 0x17802415, @@ -1709,6 +1718,7 @@ VALIDATION_ERROR_17a00706 = 0x17a00706, VALIDATION_ERROR_17a00708 = 0x17a00708, VALIDATION_ERROR_17a0070a = 0x17a0070a, + VALIDATION_ERROR_17a00dbc = 0x17a00dbc, VALIDATION_ERROR_17a02401 = 0x17a02401, VALIDATION_ERROR_17a02413 = 0x17a02413, VALIDATION_ERROR_17a02415 = 0x17a02415, @@ -1795,6 +1805,9 @@ VALIDATION_ERROR_18400d54 = 0x18400d54, VALIDATION_ERROR_18400d56 = 0x18400d56, VALIDATION_ERROR_18400d58 = 0x18400d58, + VALIDATION_ERROR_18400e54 = 0x18400e54, + VALIDATION_ERROR_18400e56 = 0x18400e56, + VALIDATION_ERROR_18400e58 = 0x18400e58, VALIDATION_ERROR_18402401 = 0x18402401, VALIDATION_ERROR_18402413 = 0x18402413, VALIDATION_ERROR_18402415 = 0x18402415, @@ -1823,17 +1836,16 @@ VALIDATION_ERROR_18800008 = 0x18800008, VALIDATION_ERROR_18800009 = 0x18800009, VALIDATION_ERROR_1880000a = 0x1880000a, - VALIDATION_ERROR_1880000c = 0x1880000c, VALIDATION_ERROR_1880000e = 0x1880000e, VALIDATION_ERROR_18800017 = 0x18800017, VALIDATION_ERROR_18800ae4 = 0x18800ae4, VALIDATION_ERROR_18800b7c = 0x18800b7c, - VALIDATION_ERROR_18800b7e = 0x18800b7e, VALIDATION_ERROR_18800b80 = 0x18800b80, - VALIDATION_ERROR_18800b82 = 0x18800b82, VALIDATION_ERROR_18800c12 = 0x18800c12, VALIDATION_ERROR_18800d38 = 0x18800d38, VALIDATION_ERROR_18800d3a = 0x18800d3a, + VALIDATION_ERROR_18800e1a = 0x18800e1a, + VALIDATION_ERROR_18800e1c = 0x18800e1c, VALIDATION_ERROR_18802401 = 0x18802401, VALIDATION_ERROR_18802413 = 0x18802413, VALIDATION_ERROR_18802415 = 0x18802415, @@ -1849,14 +1861,13 @@ VALIDATION_ERROR_18a00016 = 0x18a00016, VALIDATION_ERROR_18a00017 = 0x18a00017, VALIDATION_ERROR_18a00018 = 0x18a00018, - VALIDATION_ERROR_18a0001a = 0x18a0001a, VALIDATION_ERROR_18a0001c = 0x18a0001c, VALIDATION_ERROR_18a00b84 = 0x18a00b84, - VALIDATION_ERROR_18a00b86 = 0x18a00b86, VALIDATION_ERROR_18a00b88 = 0x18a00b88, - VALIDATION_ERROR_18a00b8a = 0x18a00b8a, VALIDATION_ERROR_18a00d3c = 0x18a00d3c, VALIDATION_ERROR_18a00d3e = 0x18a00d3e, + VALIDATION_ERROR_18a00e1e = 0x18a00e1e, + VALIDATION_ERROR_18a00e20 = 0x18a00e20, VALIDATION_ERROR_18a02401 = 0x18a02401, VALIDATION_ERROR_18a02413 = 0x18a02413, VALIDATION_ERROR_18a02415 = 0x18a02415, @@ -1877,6 +1888,9 @@ VALIDATION_ERROR_18c000ee = 0x18c000ee, VALIDATION_ERROR_18c000f0 = 0x18c000f0, VALIDATION_ERROR_18c000f2 = 0x18c000f2, + VALIDATION_ERROR_18c00e3c = 0x18c00e3c, + VALIDATION_ERROR_18c00e3e = 0x18c00e3e, + VALIDATION_ERROR_18c00e40 = 0x18c00e40, VALIDATION_ERROR_18c02401 = 0x18c02401, VALIDATION_ERROR_18c02413 = 0x18c02413, VALIDATION_ERROR_18c02415 = 0x18c02415, @@ -1900,6 +1914,10 @@ VALIDATION_ERROR_18e00ae8 = 0x18e00ae8, VALIDATION_ERROR_18e00d4a = 0x18e00d4a, VALIDATION_ERROR_18e00d4c = 0x18e00d4c, + VALIDATION_ERROR_18e00e02 = 0x18e00e02, + VALIDATION_ERROR_18e00e48 = 0x18e00e48, + VALIDATION_ERROR_18e00e4a = 0x18e00e4a, + VALIDATION_ERROR_18e00e4c = 0x18e00e4c, VALIDATION_ERROR_18e02401 = 0x18e02401, VALIDATION_ERROR_18e02413 = 0x18e02413, VALIDATION_ERROR_18e02415 = 0x18e02415, @@ -1935,6 +1953,12 @@ VALIDATION_ERROR_19000d42 = 0x19000d42, VALIDATION_ERROR_19000d44 = 0x19000d44, VALIDATION_ERROR_19000d46 = 0x19000d46, + VALIDATION_ERROR_19000dee = 0x19000dee, + VALIDATION_ERROR_19000df0 = 0x19000df0, + VALIDATION_ERROR_19000e42 = 0x19000e42, + VALIDATION_ERROR_19000e44 = 0x19000e44, + VALIDATION_ERROR_19000e46 = 0x19000e46, + VALIDATION_ERROR_19000efa = 0x19000efa, VALIDATION_ERROR_19002401 = 0x19002401, VALIDATION_ERROR_19002413 = 0x19002413, VALIDATION_ERROR_19002415 = 0x19002415, @@ -1960,6 +1984,10 @@ VALIDATION_ERROR_19200aea = 0x19200aea, VALIDATION_ERROR_19200d4e = 0x19200d4e, VALIDATION_ERROR_19200d50 = 0x19200d50, + VALIDATION_ERROR_19200e04 = 0x19200e04, + VALIDATION_ERROR_19200e4e = 0x19200e4e, + VALIDATION_ERROR_19200e50 = 0x19200e50, + VALIDATION_ERROR_19200e52 = 0x19200e52, VALIDATION_ERROR_19202401 = 0x19202401, VALIDATION_ERROR_19202413 = 0x19202413, VALIDATION_ERROR_19202415 = 0x19202415, @@ -2014,6 +2042,9 @@ VALIDATION_ERROR_19c0031c = 0x19c0031c, VALIDATION_ERROR_19c0031e = 0x19c0031e, VALIDATION_ERROR_19c00320 = 0x19c00320, + VALIDATION_ERROR_19c00e68 = 0x19c00e68, + VALIDATION_ERROR_19c00e6a = 0x19c00e6a, + VALIDATION_ERROR_19c00e6c = 0x19c00e6c, VALIDATION_ERROR_19c02401 = 0x19c02401, VALIDATION_ERROR_19c02413 = 0x19c02413, VALIDATION_ERROR_19c02415 = 0x19c02415, @@ -2047,6 +2078,9 @@ VALIDATION_ERROR_1a00033c = 0x1a00033c, VALIDATION_ERROR_1a00033e = 0x1a00033e, VALIDATION_ERROR_1a000340 = 0x1a000340, + VALIDATION_ERROR_1a000e6e = 0x1a000e6e, + VALIDATION_ERROR_1a000e70 = 0x1a000e70, + VALIDATION_ERROR_1a000e72 = 0x1a000e72, VALIDATION_ERROR_1a001a01 = 0x1a001a01, VALIDATION_ERROR_1a002401 = 0x1a002401, VALIDATION_ERROR_1a002413 = 0x1a002413, @@ -2073,6 +2107,9 @@ VALIDATION_ERROR_1a20038a = 0x1a20038a, VALIDATION_ERROR_1a200bb6 = 0x1a200bb6, VALIDATION_ERROR_1a200bd0 = 0x1a200bd0, + VALIDATION_ERROR_1a200e74 = 0x1a200e74, + VALIDATION_ERROR_1a200e76 = 0x1a200e76, + VALIDATION_ERROR_1a200e78 = 0x1a200e78, VALIDATION_ERROR_1a202401 = 0x1a202401, VALIDATION_ERROR_1a202413 = 0x1a202413, VALIDATION_ERROR_1a202415 = 0x1a202415, @@ -2099,6 +2136,9 @@ VALIDATION_ERROR_1a4003b2 = 0x1a4003b2, VALIDATION_ERROR_1a400bb8 = 0x1a400bb8, VALIDATION_ERROR_1a400bd2 = 0x1a400bd2, + VALIDATION_ERROR_1a400e7a = 0x1a400e7a, + VALIDATION_ERROR_1a400e7c = 0x1a400e7c, + VALIDATION_ERROR_1a400e7e = 0x1a400e7e, VALIDATION_ERROR_1a402401 = 0x1a402401, VALIDATION_ERROR_1a402413 = 0x1a402413, VALIDATION_ERROR_1a402415 = 0x1a402415, @@ -2133,6 +2173,9 @@ VALIDATION_ERROR_1a600bbe = 0x1a600bbe, VALIDATION_ERROR_1a600bd8 = 0x1a600bd8, VALIDATION_ERROR_1a600d02 = 0x1a600d02, + VALIDATION_ERROR_1a600e8c = 0x1a600e8c, + VALIDATION_ERROR_1a600e8e = 0x1a600e8e, + VALIDATION_ERROR_1a600e90 = 0x1a600e90, VALIDATION_ERROR_1a601a01 = 0x1a601a01, VALIDATION_ERROR_1a602401 = 0x1a602401, VALIDATION_ERROR_1a602413 = 0x1a602413, @@ -2169,6 +2212,9 @@ VALIDATION_ERROR_1a800d06 = 0x1a800d06, VALIDATION_ERROR_1a800d08 = 0x1a800d08, VALIDATION_ERROR_1a800d0a = 0x1a800d0a, + VALIDATION_ERROR_1a800e92 = 0x1a800e92, + VALIDATION_ERROR_1a800e94 = 0x1a800e94, + VALIDATION_ERROR_1a800e96 = 0x1a800e96, VALIDATION_ERROR_1a801a01 = 0x1a801a01, VALIDATION_ERROR_1a802401 = 0x1a802401, VALIDATION_ERROR_1a802413 = 0x1a802413, @@ -2205,6 +2251,9 @@ VALIDATION_ERROR_1aa00bba = 0x1aa00bba, VALIDATION_ERROR_1aa00bd4 = 0x1aa00bd4, VALIDATION_ERROR_1aa00cf8 = 0x1aa00cf8, + VALIDATION_ERROR_1aa00e80 = 0x1aa00e80, + VALIDATION_ERROR_1aa00e82 = 0x1aa00e82, + VALIDATION_ERROR_1aa00e84 = 0x1aa00e84, VALIDATION_ERROR_1aa01a01 = 0x1aa01a01, VALIDATION_ERROR_1aa02401 = 0x1aa02401, VALIDATION_ERROR_1aa02413 = 0x1aa02413, @@ -2241,16 +2290,19 @@ VALIDATION_ERROR_1ac00cfc = 0x1ac00cfc, VALIDATION_ERROR_1ac00cfe = 0x1ac00cfe, VALIDATION_ERROR_1ac00d00 = 0x1ac00d00, + VALIDATION_ERROR_1ac00e86 = 0x1ac00e86, + VALIDATION_ERROR_1ac00e88 = 0x1ac00e88, + VALIDATION_ERROR_1ac00e8a = 0x1ac00e8a, VALIDATION_ERROR_1ac01a01 = 0x1ac01a01, VALIDATION_ERROR_1ac02401 = 0x1ac02401, VALIDATION_ERROR_1ac02413 = 0x1ac02413, VALIDATION_ERROR_1ac02415 = 0x1ac02415, VALIDATION_ERROR_1ac03401 = 0x1ac03401, VALIDATION_ERROR_1ae00009 = 0x1ae00009, - VALIDATION_ERROR_1ae00652 = 0x1ae00652, VALIDATION_ERROR_1ae00654 = 0x1ae00654, - VALIDATION_ERROR_1ae00656 = 0x1ae00656, VALIDATION_ERROR_1ae00658 = 0x1ae00658, + VALIDATION_ERROR_1ae00ebc = 0x1ae00ebc, + VALIDATION_ERROR_1ae00f06 = 0x1ae00f06, VALIDATION_ERROR_1ae02401 = 0x1ae02401, VALIDATION_ERROR_1ae02413 = 0x1ae02413, VALIDATION_ERROR_1ae02415 = 0x1ae02415, @@ -2282,6 +2334,8 @@ VALIDATION_ERROR_1b2000ce = 0x1b2000ce, VALIDATION_ERROR_1b2000d0 = 0x1b2000d0, VALIDATION_ERROR_1b2000d2 = 0x1b2000d2, + VALIDATION_ERROR_1b200e38 = 0x1b200e38, + VALIDATION_ERROR_1b200e3a = 0x1b200e3a, VALIDATION_ERROR_1b202401 = 0x1b202401, VALIDATION_ERROR_1b202413 = 0x1b202413, VALIDATION_ERROR_1b202415 = 0x1b202415, @@ -2297,6 +2351,8 @@ VALIDATION_ERROR_1b40003a = 0x1b40003a, VALIDATION_ERROR_1b40003c = 0x1b40003c, VALIDATION_ERROR_1b40003e = 0x1b40003e, + VALIDATION_ERROR_1b400e26 = 0x1b400e26, + VALIDATION_ERROR_1b400e28 = 0x1b400e28, VALIDATION_ERROR_1b402401 = 0x1b402401, VALIDATION_ERROR_1b402413 = 0x1b402413, VALIDATION_ERROR_1b402415 = 0x1b402415, @@ -2344,11 +2400,12 @@ VALIDATION_ERROR_1ba02415 = 0x1ba02415, VALIDATION_ERROR_1ba1f201 = 0x1ba1f201, VALIDATION_ERROR_1bc00009 = 0x1bc00009, - VALIDATION_ERROR_1bc002de = 0x1bc002de, VALIDATION_ERROR_1bc002e0 = 0x1bc002e0, VALIDATION_ERROR_1bc002e2 = 0x1bc002e2, VALIDATION_ERROR_1bc002e4 = 0x1bc002e4, VALIDATION_ERROR_1bc002e6 = 0x1bc002e6, + VALIDATION_ERROR_1bc00e06 = 0x1bc00e06, + VALIDATION_ERROR_1bc00e08 = 0x1bc00e08, VALIDATION_ERROR_1bc02401 = 0x1bc02401, VALIDATION_ERROR_1bc02413 = 0x1bc02413, VALIDATION_ERROR_1bc02415 = 0x1bc02415, @@ -2376,7 +2433,6 @@ VALIDATION_ERROR_1c002415 = 0x1c002415, VALIDATION_ERROR_1c005201 = 0x1c005201, VALIDATION_ERROR_1c00be01 = 0x1c00be01, - VALIDATION_ERROR_1c012201 = 0x1c012201, VALIDATION_ERROR_1c200017 = 0x1c200017, VALIDATION_ERROR_1c200019 = 0x1c200019, VALIDATION_ERROR_1c200a62 = 0x1c200a62, @@ -2428,6 +2484,9 @@ VALIDATION_ERROR_1c800d5c = 0x1c800d5c, VALIDATION_ERROR_1c800d5e = 0x1c800d5e, VALIDATION_ERROR_1c800d60 = 0x1c800d60, + VALIDATION_ERROR_1c800e5a = 0x1c800e5a, + VALIDATION_ERROR_1c800e5c = 0x1c800e5c, + VALIDATION_ERROR_1c800e5e = 0x1c800e5e, VALIDATION_ERROR_1c802401 = 0x1c802401, VALIDATION_ERROR_1c802413 = 0x1c802413, VALIDATION_ERROR_1c802415 = 0x1c802415, @@ -2460,9 +2519,7 @@ VALIDATION_ERROR_1d002413 = 0x1d002413, VALIDATION_ERROR_1d002415 = 0x1d002415, VALIDATION_ERROR_1d20048e = 0x1d20048e, - VALIDATION_ERROR_1d200490 = 0x1d200490, VALIDATION_ERROR_1d200492 = 0x1d200492, - VALIDATION_ERROR_1d200494 = 0x1d200494, VALIDATION_ERROR_1d200496 = 0x1d200496, VALIDATION_ERROR_1d200498 = 0x1d200498, VALIDATION_ERROR_1d20049a = 0x1d20049a, @@ -2524,19 +2581,19 @@ VALIDATION_ERROR_1e00098e = 0x1e00098e, VALIDATION_ERROR_1e000990 = 0x1e000990, VALIDATION_ERROR_1e000992 = 0x1e000992, - VALIDATION_ERROR_1e000994 = 0x1e000994, VALIDATION_ERROR_1e002401 = 0x1e002401, VALIDATION_ERROR_1e002413 = 0x1e002413, VALIDATION_ERROR_1e002415 = 0x1e002415, VALIDATION_ERROR_1e030a1b = 0x1e030a1b, + VALIDATION_ERROR_1e03fa01 = 0x1e03fa01, VALIDATION_ERROR_1e200a54 = 0x1e200a54, VALIDATION_ERROR_1e200a56 = 0x1e200a56, VALIDATION_ERROR_1e200a58 = 0x1e200a58, - VALIDATION_ERROR_1e200a5a = 0x1e200a5a, VALIDATION_ERROR_1e202401 = 0x1e202401, VALIDATION_ERROR_1e202413 = 0x1e202413, VALIDATION_ERROR_1e202415 = 0x1e202415, VALIDATION_ERROR_1e230a1b = 0x1e230a1b, + VALIDATION_ERROR_1e23fc01 = 0x1e23fc01, VALIDATION_ERROR_1e400009 = 0x1e400009, VALIDATION_ERROR_1e400017 = 0x1e400017, VALIDATION_ERROR_1e400040 = 0x1e400040, @@ -2546,6 +2603,8 @@ VALIDATION_ERROR_1e400048 = 0x1e400048, VALIDATION_ERROR_1e40004a = 0x1e40004a, VALIDATION_ERROR_1e40004c = 0x1e40004c, + VALIDATION_ERROR_1e400e2a = 0x1e400e2a, + VALIDATION_ERROR_1e400e2c = 0x1e400e2c, VALIDATION_ERROR_1e402401 = 0x1e402401, VALIDATION_ERROR_1e402413 = 0x1e402413, VALIDATION_ERROR_1e402415 = 0x1e402415, @@ -2753,11 +2812,8 @@ VALIDATION_ERROR_2340ec01 = 0x2340ec01, VALIDATION_ERROR_23411e01 = 0x23411e01, VALIDATION_ERROR_23424801 = 0x23424801, - VALIDATION_ERROR_236009a8 = 0x236009a8, VALIDATION_ERROR_23605601 = 0x23605601, VALIDATION_ERROR_2361c201 = 0x2361c201, - VALIDATION_ERROR_238009aa = 0x238009aa, - VALIDATION_ERROR_238009ac = 0x238009ac, VALIDATION_ERROR_23805601 = 0x23805601, VALIDATION_ERROR_23825c01 = 0x23825c01, VALIDATION_ERROR_23a009b2 = 0x23a009b2, @@ -2948,6 +3004,7 @@ VALIDATION_ERROR_27400078 = 0x27400078, VALIDATION_ERROR_2740007a = 0x2740007a, VALIDATION_ERROR_2740007c = 0x2740007c, + VALIDATION_ERROR_27400e2e = 0x27400e2e, VALIDATION_ERROR_27402401 = 0x27402401, VALIDATION_ERROR_27619e01 = 0x27619e01, VALIDATION_ERROR_2761f401 = 0x2761f401, @@ -3007,7 +3064,6 @@ VALIDATION_ERROR_29000009 = 0x29000009, VALIDATION_ERROR_29005601 = 0x29005601, VALIDATION_ERROR_2901be01 = 0x2901be01, - VALIDATION_ERROR_2901be03 = 0x2901be03, VALIDATION_ERROR_2902ec01 = 0x2902ec01, VALIDATION_ERROR_29200564 = 0x29200564, VALIDATION_ERROR_29205601 = 0x29205601, @@ -3018,6 +3074,7 @@ VALIDATION_ERROR_2941c001 = 0x2941c001, VALIDATION_ERROR_29600300 = 0x29600300, VALIDATION_ERROR_29600302 = 0x29600302, + VALIDATION_ERROR_29600e62 = 0x29600e62, VALIDATION_ERROR_29605601 = 0x29605601, VALIDATION_ERROR_2961fc01 = 0x2961fc01, VALIDATION_ERROR_29806001 = 0x29806001, @@ -3053,6 +3110,7 @@ VALIDATION_ERROR_2a600c5c = 0x2a600c5c, VALIDATION_ERROR_2a600d68 = 0x2a600d68, VALIDATION_ERROR_2a600d6a = 0x2a600d6a, + VALIDATION_ERROR_2a600ece = 0x2a600ece, VALIDATION_ERROR_2a605601 = 0x2a605601, VALIDATION_ERROR_2a60a001 = 0x2a60a001, VALIDATION_ERROR_2a60a007 = 0x2a60a007, @@ -3060,12 +3118,7 @@ VALIDATION_ERROR_2a624401 = 0x2a624401, VALIDATION_ERROR_2a80bc01 = 0x2a80bc01, VALIDATION_ERROR_2a81c001 = 0x2a81c001, - VALIDATION_ERROR_2aa0053e = 0x2aa0053e, - VALIDATION_ERROR_2aa00540 = 0x2aa00540, VALIDATION_ERROR_2aa05601 = 0x2aa05601, - VALIDATION_ERROR_2aa09c01 = 0x2aa09c01, - VALIDATION_ERROR_2aa0c601 = 0x2aa0c601, - VALIDATION_ERROR_2aa0c607 = 0x2aa0c607, VALIDATION_ERROR_2aa16c01 = 0x2aa16c01, VALIDATION_ERROR_2aa39e01 = 0x2aa39e01, VALIDATION_ERROR_2ac00542 = 0x2ac00542, @@ -3073,13 +3126,7 @@ VALIDATION_ERROR_2ac05601 = 0x2ac05601, VALIDATION_ERROR_2ac09c01 = 0x2ac09c01, VALIDATION_ERROR_2ac1ae01 = 0x2ac1ae01, - VALIDATION_ERROR_2ae0052c = 0x2ae0052c, - VALIDATION_ERROR_2ae0052e = 0x2ae0052e, - VALIDATION_ERROR_2ae00530 = 0x2ae00530, VALIDATION_ERROR_2ae05601 = 0x2ae05601, - VALIDATION_ERROR_2ae09c01 = 0x2ae09c01, - VALIDATION_ERROR_2ae0c601 = 0x2ae0c601, - VALIDATION_ERROR_2ae0c607 = 0x2ae0c607, VALIDATION_ERROR_2ae17c01 = 0x2ae17c01, VALIDATION_ERROR_2ae3a001 = 0x2ae3a001, VALIDATION_ERROR_2b000a5c = 0x2b000a5c, @@ -3141,6 +3188,7 @@ VALIDATION_ERROR_2ca30401 = 0x2ca30401, VALIDATION_ERROR_2ca30601 = 0x2ca30601, VALIDATION_ERROR_2ca30603 = 0x2ca30603, + VALIDATION_ERROR_2cc00e98 = 0x2cc00e98, VALIDATION_ERROR_2cc18201 = 0x2cc18201, VALIDATION_ERROR_2cc18401 = 0x2cc18401, VALIDATION_ERROR_2cc27a01 = 0x2cc27a01, @@ -3249,28 +3297,11 @@ VALIDATION_ERROR_30017a01 = 0x30017a01, VALIDATION_ERROR_3002ae01 = 0x3002ae01, VALIDATION_ERROR_3002ae07 = 0x3002ae07, - VALIDATION_ERROR_302008d8 = 0x302008d8, - VALIDATION_ERROR_302008da = 0x302008da, - VALIDATION_ERROR_302008dc = 0x302008dc, - VALIDATION_ERROR_302008de = 0x302008de, - VALIDATION_ERROR_302008e0 = 0x302008e0, VALIDATION_ERROR_30205601 = 0x30205601, - VALIDATION_ERROR_30209c01 = 0x30209c01, VALIDATION_ERROR_30216c01 = 0x30216c01, - VALIDATION_ERROR_3022b801 = 0x3022b801, - VALIDATION_ERROR_3022b807 = 0x3022b807, VALIDATION_ERROR_30239e01 = 0x30239e01, - VALIDATION_ERROR_304008cc = 0x304008cc, - VALIDATION_ERROR_304008ce = 0x304008ce, - VALIDATION_ERROR_304008d0 = 0x304008d0, - VALIDATION_ERROR_304008d2 = 0x304008d2, - VALIDATION_ERROR_304008d4 = 0x304008d4, - VALIDATION_ERROR_304008d6 = 0x304008d6, VALIDATION_ERROR_30405601 = 0x30405601, - VALIDATION_ERROR_30409c01 = 0x30409c01, VALIDATION_ERROR_30417c01 = 0x30417c01, - VALIDATION_ERROR_3042b801 = 0x3042b801, - VALIDATION_ERROR_3042b807 = 0x3042b807, VALIDATION_ERROR_3043a001 = 0x3043a001, VALIDATION_ERROR_30600009 = 0x30600009, VALIDATION_ERROR_306009ba = 0x306009ba, @@ -3418,8 +3449,8 @@ VALIDATION_ERROR_33a05201 = 0x33a05201, VALIDATION_ERROR_33a05207 = 0x33a05207, VALIDATION_ERROR_33a05601 = 0x33a05601, - VALIDATION_ERROR_33a12201 = 0x33a12201, VALIDATION_ERROR_33c00274 = 0x33c00274, + VALIDATION_ERROR_33c017ce = 0x33c017ce, VALIDATION_ERROR_33c05601 = 0x33c05601, VALIDATION_ERROR_33c12c01 = 0x33c12c01, VALIDATION_ERROR_33c13601 = 0x33c13601, @@ -3451,41 +3482,31 @@ VALIDATION_ERROR_3562b00b = 0x3562b00b, VALIDATION_ERROR_3581c40d = 0x3581c40d, VALIDATION_ERROR_3582b00b = 0x3582b00b, - VALIDATION_ERROR_35c1c40d = 0x35c1c40d, VALIDATION_ERROR_35c2b00b = 0x35c2b00b, - VALIDATION_ERROR_3601c40d = 0x3601c40d, VALIDATION_ERROR_3602b00b = 0x3602b00b, - VALIDATION_ERROR_3621c40d = 0x3621c40d, VALIDATION_ERROR_3622b00b = 0x3622b00b, - VALIDATION_ERROR_3641c40d = 0x3641c40d, VALIDATION_ERROR_3642b00b = 0x3642b00b, VALIDATION_ERROR_37e2b00b = 0x37e2b00b, VALIDATION_ERROR_3822b00b = 0x3822b00b, VALIDATION_ERROR_3842b00b = 0x3842b00b, - VALIDATION_ERROR_3861c40d = 0x3861c40d, VALIDATION_ERROR_3862b00b = 0x3862b00b, VALIDATION_ERROR_38800b20 = 0x38800b20, VALIDATION_ERROR_38800b22 = 0x38800b22, VALIDATION_ERROR_38800b24 = 0x38800b24, - VALIDATION_ERROR_3881c40d = 0x3881c40d, VALIDATION_ERROR_3882b00b = 0x3882b00b, VALIDATION_ERROR_38834a01 = 0x38834a01, VALIDATION_ERROR_38a00afa = 0x38a00afa, VALIDATION_ERROR_38a09005 = 0x38a09005, - VALIDATION_ERROR_38a1c40d = 0x38a1c40d, VALIDATION_ERROR_38a2b00b = 0x38a2b00b, VALIDATION_ERROR_38a34c01 = 0x38a34c01, VALIDATION_ERROR_38a34e1b = 0x38a34e1b, VALIDATION_ERROR_38c00af8 = 0x38c00af8, VALIDATION_ERROR_38c09005 = 0x38c09005, - VALIDATION_ERROR_38c1c40d = 0x38c1c40d, VALIDATION_ERROR_38c2b00b = 0x38c2b00b, - VALIDATION_ERROR_38e1c40d = 0x38e1c40d, VALIDATION_ERROR_38e2b00b = 0x38e2b00b, VALIDATION_ERROR_38e35001 = 0x38e35001, VALIDATION_ERROR_39400b4c = 0x39400b4c, VALIDATION_ERROR_39409e01 = 0x39409e01, - VALIDATION_ERROR_3941c40d = 0x3941c40d, VALIDATION_ERROR_3942b00b = 0x3942b00b, VALIDATION_ERROR_39609c01 = 0x39609c01, VALIDATION_ERROR_3961c40d = 0x3961c40d, @@ -3496,7 +3517,6 @@ VALIDATION_ERROR_39a3a201 = 0x39a3a201, VALIDATION_ERROR_39a3a401 = 0x39a3a401, VALIDATION_ERROR_39c00b70 = 0x39c00b70, - VALIDATION_ERROR_39c00b72 = 0x39c00b72, VALIDATION_ERROR_39c00c0a = 0x39c00c0a, VALIDATION_ERROR_39c08801 = 0x39c08801, VALIDATION_ERROR_39c09001 = 0x39c09001, @@ -3518,7 +3538,6 @@ VALIDATION_ERROR_3a216c01 = 0x3a216c01, VALIDATION_ERROR_3a239e01 = 0x3a239e01, VALIDATION_ERROR_3a400b62 = 0x3a400b62, - VALIDATION_ERROR_3a400b64 = 0x3a400b64, VALIDATION_ERROR_3a400b66 = 0x3a400b66, VALIDATION_ERROR_3a400b68 = 0x3a400b68, VALIDATION_ERROR_3a400b6a = 0x3a400b6a, @@ -3532,7 +3551,6 @@ VALIDATION_ERROR_3a42b00b = 0x3a42b00b, VALIDATION_ERROR_3a600b4e = 0x3a600b4e, VALIDATION_ERROR_3a60f401 = 0x3a60f401, - VALIDATION_ERROR_3a61c40d = 0x3a61c40d, VALIDATION_ERROR_3a62b00b = 0x3a62b00b, VALIDATION_ERROR_3a800b50 = 0x3a800b50, VALIDATION_ERROR_3a800b52 = 0x3a800b52, @@ -3548,23 +3566,38 @@ VALIDATION_ERROR_3ac05601 = 0x3ac05601, VALIDATION_ERROR_3ac17c01 = 0x3ac17c01, VALIDATION_ERROR_3ac3a001 = 0x3ac3a001, + VALIDATION_ERROR_3ae008d8 = 0x3ae008d8, + VALIDATION_ERROR_3ae008da = 0x3ae008da, + VALIDATION_ERROR_3ae008dc = 0x3ae008dc, + VALIDATION_ERROR_3ae008de = 0x3ae008de, + VALIDATION_ERROR_3ae008e0 = 0x3ae008e0, VALIDATION_ERROR_3ae09c01 = 0x3ae09c01, VALIDATION_ERROR_3ae1c40d = 0x3ae1c40d, VALIDATION_ERROR_3ae2b00b = 0x3ae2b00b, VALIDATION_ERROR_3ae2b801 = 0x3ae2b801, + VALIDATION_ERROR_3b0008cc = 0x3b0008cc, + VALIDATION_ERROR_3b0008ce = 0x3b0008ce, + VALIDATION_ERROR_3b0008d0 = 0x3b0008d0, + VALIDATION_ERROR_3b0008d2 = 0x3b0008d2, + VALIDATION_ERROR_3b0008d4 = 0x3b0008d4, + VALIDATION_ERROR_3b0008d6 = 0x3b0008d6, VALIDATION_ERROR_3b009c01 = 0x3b009c01, VALIDATION_ERROR_3b01c40d = 0x3b01c40d, VALIDATION_ERROR_3b02b00b = 0x3b02b00b, VALIDATION_ERROR_3b02b801 = 0x3b02b801, + VALIDATION_ERROR_3b20053e = 0x3b20053e, + VALIDATION_ERROR_3b200540 = 0x3b200540, VALIDATION_ERROR_3b209c01 = 0x3b209c01, VALIDATION_ERROR_3b20c601 = 0x3b20c601, VALIDATION_ERROR_3b21c40d = 0x3b21c40d, VALIDATION_ERROR_3b22b00b = 0x3b22b00b, + VALIDATION_ERROR_3b40052c = 0x3b40052c, + VALIDATION_ERROR_3b40052e = 0x3b40052e, + VALIDATION_ERROR_3b400530 = 0x3b400530, VALIDATION_ERROR_3b409c01 = 0x3b409c01, VALIDATION_ERROR_3b40c601 = 0x3b40c601, VALIDATION_ERROR_3b41c40d = 0x3b41c40d, VALIDATION_ERROR_3b42b00b = 0x3b42b00b, - VALIDATION_ERROR_3b61c40d = 0x3b61c40d, VALIDATION_ERROR_3b62b00b = 0x3b62b00b, VALIDATION_ERROR_3b800009 = 0x3b800009, VALIDATION_ERROR_3b800b30 = 0x3b800b30, @@ -3572,11 +3605,13 @@ VALIDATION_ERROR_3b800b34 = 0x3b800b34, VALIDATION_ERROR_3b800b36 = 0x3b800b36, VALIDATION_ERROR_3b800b38 = 0x3b800b38, - VALIDATION_ERROR_3b800b3a = 0x3b800b3a, - VALIDATION_ERROR_3b800b3c = 0x3b800b3c, + VALIDATION_ERROR_3b800e0a = 0x3b800e0a, + VALIDATION_ERROR_3b800ea8 = 0x3b800ea8, + VALIDATION_ERROR_3b800eaa = 0x3b800eaa, + VALIDATION_ERROR_3b800eac = 0x3b800eac, + VALIDATION_ERROR_3b800eae = 0x3b800eae, VALIDATION_ERROR_3b801a01 = 0x3b801a01, VALIDATION_ERROR_3b80a001 = 0x3b80a001, - VALIDATION_ERROR_3b81c40d = 0x3b81c40d, VALIDATION_ERROR_3b82b00b = 0x3b82b00b, VALIDATION_ERROR_3ba01a01 = 0x3ba01a01, VALIDATION_ERROR_3ba1c40d = 0x3ba1c40d, @@ -3584,37 +3619,41 @@ VALIDATION_ERROR_3bc00c6a = 0x3bc00c6a, VALIDATION_ERROR_3bc00c6c = 0x3bc00c6c, VALIDATION_ERROR_3bc00c6e = 0x3bc00c6e, + VALIDATION_ERROR_3bc00ed2 = 0x3bc00ed2, VALIDATION_ERROR_3bc0a001 = 0x3bc0a001, VALIDATION_ERROR_3bc1c40d = 0x3bc1c40d, VALIDATION_ERROR_3bc2b00b = 0x3bc2b00b, + VALIDATION_ERROR_3be0a001 = 0x3be0a001, + VALIDATION_ERROR_3be1c40d = 0x3be1c40d, + VALIDATION_ERROR_3be2b00b = 0x3be2b00b, VALIDATION_ERROR_3c01c40d = 0x3c01c40d, VALIDATION_ERROR_3c02b00b = 0x3c02b00b, + VALIDATION_ERROR_3c21c40d = 0x3c21c40d, + VALIDATION_ERROR_3c22b00b = 0x3c22b00b, VALIDATION_ERROR_3c405601 = 0x3c405601, VALIDATION_ERROR_3c41b401 = 0x3c41b401, VALIDATION_ERROR_3c439c01 = 0x3c439c01, VALIDATION_ERROR_3c605601 = 0x3c605601, VALIDATION_ERROR_3c61b401 = 0x3c61b401, VALIDATION_ERROR_3c639c01 = 0x3c639c01, + VALIDATION_ERROR_3c805601 = 0x3c805601, + VALIDATION_ERROR_3c823601 = 0x3c823601, + VALIDATION_ERROR_3c823801 = 0x3c823801, + VALIDATION_ERROR_3c839c01 = 0x3c839c01, VALIDATION_ERROR_3ca2b00b = 0x3ca2b00b, VALIDATION_ERROR_3cc00b2e = 0x3cc00b2e, - VALIDATION_ERROR_3cc1c40d = 0x3cc1c40d, VALIDATION_ERROR_3cc2b00b = 0x3cc2b00b, VALIDATION_ERROR_3ce00bec = 0x3ce00bec, VALIDATION_ERROR_3ce00bee = 0x3ce00bee, - VALIDATION_ERROR_3ce1c40d = 0x3ce1c40d, VALIDATION_ERROR_3ce2b00b = 0x3ce2b00b, VALIDATION_ERROR_3ce3b201 = 0x3ce3b201, VALIDATION_ERROR_3ce3b41b = 0x3ce3b41b, VALIDATION_ERROR_3ce3b601 = 0x3ce3b601, - VALIDATION_ERROR_3d01c40d = 0x3d01c40d, VALIDATION_ERROR_3d02b00b = 0x3d02b00b, VALIDATION_ERROR_3d03ba01 = 0x3d03ba01, - VALIDATION_ERROR_3d03be01 = 0x3d03be01, VALIDATION_ERROR_3d03e801 = 0x3d03e801, - VALIDATION_ERROR_3d21c40d = 0x3d21c40d, VALIDATION_ERROR_3d22b00b = 0x3d22b00b, VALIDATION_ERROR_3d23c601 = 0x3d23c601, - VALIDATION_ERROR_3d41c40d = 0x3d41c40d, VALIDATION_ERROR_3d42b00b = 0x3d42b00b, VALIDATION_ERROR_3d61c40d = 0x3d61c40d, VALIDATION_ERROR_3d62b00b = 0x3d62b00b, @@ -3627,7 +3666,6 @@ VALIDATION_ERROR_3da19601 = 0x3da19601, VALIDATION_ERROR_3da1c40d = 0x3da1c40d, VALIDATION_ERROR_3da2b00b = 0x3da2b00b, - VALIDATION_ERROR_3dc1c40d = 0x3dc1c40d, VALIDATION_ERROR_3dc2b00b = 0x3dc2b00b, VALIDATION_ERROR_3dc3c401 = 0x3dc3c401, VALIDATION_ERROR_3de05601 = 0x3de05601, @@ -3663,29 +3701,24 @@ VALIDATION_ERROR_3e83c601 = 0x3e83c601, VALIDATION_ERROR_3ea00bf8 = 0x3ea00bf8, VALIDATION_ERROR_3ea3c601 = 0x3ea3c601, - VALIDATION_ERROR_3ec1c40d = 0x3ec1c40d, VALIDATION_ERROR_3ec2b00b = 0x3ec2b00b, VALIDATION_ERROR_3ee00c01 = 0x3ee00c01, VALIDATION_ERROR_3ee00c03 = 0x3ee00c03, VALIDATION_ERROR_3ee00c40 = 0x3ee00c40, VALIDATION_ERROR_3ee00c42 = 0x3ee00c42, VALIDATION_ERROR_3ee00c44 = 0x3ee00c44, - VALIDATION_ERROR_3f01c40d = 0x3f01c40d, VALIDATION_ERROR_3f02b00b = 0x3f02b00b, VALIDATION_ERROR_3f03ce1b = 0x3f03ce1b, VALIDATION_ERROR_3f03d001 = 0x3f03d001, VALIDATION_ERROR_3f200c66 = 0x3f200c66, - VALIDATION_ERROR_3f21c40d = 0x3f21c40d, VALIDATION_ERROR_3f22b00b = 0x3f22b00b, VALIDATION_ERROR_3f230601 = 0x3f230601, VALIDATION_ERROR_3f230603 = 0x3f230603, - VALIDATION_ERROR_3f41c40d = 0x3f41c40d, VALIDATION_ERROR_3f42b00b = 0x3f42b00b, VALIDATION_ERROR_3f43d201 = 0x3f43d201, VALIDATION_ERROR_3f600c54 = 0x3f600c54, VALIDATION_ERROR_3f600c56 = 0x3f600c56, VALIDATION_ERROR_3f600c58 = 0x3f600c58, - VALIDATION_ERROR_3f61c40d = 0x3f61c40d, VALIDATION_ERROR_3f62b00b = 0x3f62b00b, VALIDATION_ERROR_3f63e401 = 0x3f63e401, VALIDATION_ERROR_3f800ce2 = 0x3f800ce2, @@ -3697,6 +3730,7 @@ VALIDATION_ERROR_3f800cee = 0x3f800cee, VALIDATION_ERROR_3f800cf0 = 0x3f800cf0, VALIDATION_ERROR_3f800cf2 = 0x3f800cf2, + VALIDATION_ERROR_3f800ee0 = 0x3f800ee0, VALIDATION_ERROR_3f802c01 = 0x3f802c01, VALIDATION_ERROR_3f809201 = 0x3f809201, VALIDATION_ERROR_3f81c40d = 0x3f81c40d, @@ -3721,7 +3755,6 @@ VALIDATION_ERROR_40000c8c = 0x40000c8c, VALIDATION_ERROR_40000c8e = 0x40000c8e, VALIDATION_ERROR_40013e01 = 0x40013e01, - VALIDATION_ERROR_4001c40d = 0x4001c40d, VALIDATION_ERROR_4002b00b = 0x4002b00b, VALIDATION_ERROR_40200cc2 = 0x40200cc2, VALIDATION_ERROR_40200cc4 = 0x40200cc4, @@ -3733,9 +3766,8 @@ VALIDATION_ERROR_40200cd0 = 0x40200cd0, VALIDATION_ERROR_40200cd2 = 0x40200cd2, VALIDATION_ERROR_40213e01 = 0x40213e01, - VALIDATION_ERROR_4021c40d = 0x4021c40d, - VALIDATION_ERROR_40222001 = 0x40222001, VALIDATION_ERROR_4022b00b = 0x4022b00b, + VALIDATION_ERROR_4023fe01 = 0x4023fe01, VALIDATION_ERROR_40405601 = 0x40405601, VALIDATION_ERROR_4040ec01 = 0x4040ec01, VALIDATION_ERROR_4043e201 = 0x4043e201, @@ -3744,7 +3776,6 @@ VALIDATION_ERROR_4082b00b = 0x4082b00b, VALIDATION_ERROR_40a2b00b = 0x40a2b00b, VALIDATION_ERROR_40a3e601 = 0x40a3e601, - VALIDATION_ERROR_40c1c40d = 0x40c1c40d, VALIDATION_ERROR_40c2b00b = 0x40c2b00b, VALIDATION_ERROR_40c3ea01 = 0x40c3ea01, VALIDATION_ERROR_40e05601 = 0x40e05601, @@ -3754,32 +3785,208 @@ VALIDATION_ERROR_40e3ec01 = 0x40e3ec01, VALIDATION_ERROR_40e3ee01 = 0x40e3ee01, VALIDATION_ERROR_40e3f001 = 0x40e3f001, - VALIDATION_ERROR_MAX_ENUM = 1088679938, + VALIDATION_ERROR_41200da6 = 0x41200da6, + VALIDATION_ERROR_41200da8 = 0x41200da8, + VALIDATION_ERROR_41200daa = 0x41200daa, + VALIDATION_ERROR_41200dac = 0x41200dac, + VALIDATION_ERROR_41200dae = 0x41200dae, + VALIDATION_ERROR_41209c01 = 0x41209c01, + VALIDATION_ERROR_4122b00b = 0x4122b00b, + VALIDATION_ERROR_4141c40d = 0x4141c40d, + VALIDATION_ERROR_4142b00b = 0x4142b00b, + VALIDATION_ERROR_4162b00b = 0x4162b00b, + VALIDATION_ERROR_41800db0 = 0x41800db0, + VALIDATION_ERROR_41800db2 = 0x41800db2, + VALIDATION_ERROR_41800db4 = 0x41800db4, + VALIDATION_ERROR_41800db6 = 0x41800db6, + VALIDATION_ERROR_41805601 = 0x41805601, + VALIDATION_ERROR_41809c01 = 0x41809c01, + VALIDATION_ERROR_4183f401 = 0x4183f401, + VALIDATION_ERROR_41a2b00b = 0x41a2b00b, + VALIDATION_ERROR_41c00dd2 = 0x41c00dd2, + VALIDATION_ERROR_41c09005 = 0x41c09005, + VALIDATION_ERROR_41c2b00b = 0x41c2b00b, + VALIDATION_ERROR_41c3f801 = 0x41c3f801, + VALIDATION_ERROR_41e00009 = 0x41e00009, + VALIDATION_ERROR_41e00e0c = 0x41e00e0c, + VALIDATION_ERROR_41e00e0e = 0x41e00e0e, + VALIDATION_ERROR_41e00e10 = 0x41e00e10, + VALIDATION_ERROR_41e00e12 = 0x41e00e12, + VALIDATION_ERROR_41e02401 = 0x41e02401, + VALIDATION_ERROR_41e02413 = 0x41e02413, + VALIDATION_ERROR_41e02415 = 0x41e02415, + VALIDATION_ERROR_41e06c01 = 0x41e06c01, + VALIDATION_ERROR_41e28401 = 0x41e28401, + VALIDATION_ERROR_4201c40d = 0x4201c40d, + VALIDATION_ERROR_4202b00b = 0x4202b00b, + VALIDATION_ERROR_42200e64 = 0x42200e64, + VALIDATION_ERROR_42200e66 = 0x42200e66, + VALIDATION_ERROR_42209001 = 0x42209001, + VALIDATION_ERROR_42209003 = 0x42209003, + VALIDATION_ERROR_4221c40d = 0x4221c40d, + VALIDATION_ERROR_4222b00b = 0x4222b00b, + VALIDATION_ERROR_4242b00b = 0x4242b00b, + VALIDATION_ERROR_4262b00b = 0x4262b00b, + VALIDATION_ERROR_4282b00b = 0x4282b00b, + VALIDATION_ERROR_42a2b00b = 0x42a2b00b, + VALIDATION_ERROR_42c2b00b = 0x42c2b00b, + VALIDATION_ERROR_42e00e30 = 0x42e00e30, + VALIDATION_ERROR_42e00e32 = 0x42e00e32, + VALIDATION_ERROR_42e00e34 = 0x42e00e34, + VALIDATION_ERROR_42e00e36 = 0x42e00e36, + VALIDATION_ERROR_42e2b00b = 0x42e2b00b, + VALIDATION_ERROR_43040001 = 0x43040001, + VALIDATION_ERROR_43205601 = 0x43205601, + VALIDATION_ERROR_43211e01 = 0x43211e01, + VALIDATION_ERROR_43240201 = 0x43240201, + VALIDATION_ERROR_43405601 = 0x43405601, + VALIDATION_ERROR_4341fc01 = 0x4341fc01, + VALIDATION_ERROR_43440401 = 0x43440401, + VALIDATION_ERROR_43600ee2 = 0x43600ee2, + VALIDATION_ERROR_43600ee4 = 0x43600ee4, + VALIDATION_ERROR_43600ee6 = 0x43600ee6, + VALIDATION_ERROR_4360da01 = 0x4360da01, + VALIDATION_ERROR_4361c40d = 0x4361c40d, + VALIDATION_ERROR_4361ce01 = 0x4361ce01, + VALIDATION_ERROR_4362b00b = 0x4362b00b, + VALIDATION_ERROR_43800ee8 = 0x43800ee8, + VALIDATION_ERROR_43800eea = 0x43800eea, + VALIDATION_ERROR_43800eec = 0x43800eec, + VALIDATION_ERROR_4380da01 = 0x4380da01, + VALIDATION_ERROR_4381c40d = 0x4381c40d, + VALIDATION_ERROR_43825a01 = 0x43825a01, + VALIDATION_ERROR_4382b00b = 0x4382b00b, + VALIDATION_ERROR_4382f41b = 0x4382f41b, + VALIDATION_ERROR_43a1c40d = 0x43a1c40d, + VALIDATION_ERROR_43a2b00b = 0x43a2b00b, + VALIDATION_ERROR_43a40801 = 0x43a40801, + VALIDATION_ERROR_43c09005 = 0x43c09005, + VALIDATION_ERROR_43c0d61b = 0x43c0d61b, + VALIDATION_ERROR_43c1b801 = 0x43c1b801, + VALIDATION_ERROR_43c1c40d = 0x43c1c40d, + VALIDATION_ERROR_43c2b00b = 0x43c2b00b, + VALIDATION_ERROR_43c42201 = 0x43c42201, + VALIDATION_ERROR_43e00ef4 = 0x43e00ef4, + VALIDATION_ERROR_43e09005 = 0x43e09005, + VALIDATION_ERROR_43e2b00b = 0x43e2b00b, + VALIDATION_ERROR_43e40a01 = 0x43e40a01, + VALIDATION_ERROR_43e40a03 = 0x43e40a03, + VALIDATION_ERROR_43e40c01 = 0x43e40c01, + VALIDATION_ERROR_43e40c03 = 0x43e40c03, + VALIDATION_ERROR_4400bc01 = 0x4400bc01, + VALIDATION_ERROR_4400ec01 = 0x4400ec01, + VALIDATION_ERROR_44011e01 = 0x44011e01, + VALIDATION_ERROR_44041001 = 0x44041001, + VALIDATION_ERROR_4420bc01 = 0x4420bc01, + VALIDATION_ERROR_44240a01 = 0x44240a01, + VALIDATION_ERROR_44241201 = 0x44241201, + VALIDATION_ERROR_44241203 = 0x44241203, + VALIDATION_ERROR_44242801 = 0x44242801, + VALIDATION_ERROR_4442b00b = 0x4442b00b, + VALIDATION_ERROR_4462b00b = 0x4462b00b, + VALIDATION_ERROR_4464141b = 0x4464141b, + VALIDATION_ERROR_44641601 = 0x44641601, + VALIDATION_ERROR_44800ecc = 0x44800ecc, + VALIDATION_ERROR_4482b00b = 0x4482b00b, + VALIDATION_ERROR_44a00eb0 = 0x44a00eb0, + VALIDATION_ERROR_44a00eb2 = 0x44a00eb2, + VALIDATION_ERROR_44a01a01 = 0x44a01a01, + VALIDATION_ERROR_44a2b00b = 0x44a2b00b, + VALIDATION_ERROR_44c00eb4 = 0x44c00eb4, + VALIDATION_ERROR_44c00eb6 = 0x44c00eb6, + VALIDATION_ERROR_44e00ef0 = 0x44e00ef0, + VALIDATION_ERROR_44e00ef2 = 0x44e00ef2, + VALIDATION_ERROR_44e02401 = 0x44e02401, + VALIDATION_ERROR_44e02413 = 0x44e02413, + VALIDATION_ERROR_44e02415 = 0x44e02415, + VALIDATION_ERROR_45000ef6 = 0x45000ef6, + VALIDATION_ERROR_45000ef8 = 0x45000ef8, + VALIDATION_ERROR_4500bc01 = 0x4500bc01, + VALIDATION_ERROR_4500ec01 = 0x4500ec01, + VALIDATION_ERROR_45042601 = 0x45042601, + VALIDATION_ERROR_45042607 = 0x45042607, + VALIDATION_ERROR_45200eb8 = 0x45200eb8, + VALIDATION_ERROR_45201a01 = 0x45201a01, + VALIDATION_ERROR_45205601 = 0x45205601, + VALIDATION_ERROR_4521f401 = 0x4521f401, + VALIDATION_ERROR_45400eee = 0x45400eee, + VALIDATION_ERROR_45429c01 = 0x45429c01, + VALIDATION_ERROR_4562b00b = 0x4562b00b, + VALIDATION_ERROR_45a05601 = 0x45a05601, + VALIDATION_ERROR_45a10001 = 0x45a10001, + VALIDATION_ERROR_45a39c01 = 0x45a39c01, + VALIDATION_ERROR_45c2b00b = 0x45c2b00b, + VALIDATION_ERROR_45e02401 = 0x45e02401, + VALIDATION_ERROR_45e02413 = 0x45e02413, + VALIDATION_ERROR_45e02415 = 0x45e02415, + VALIDATION_ERROR_45e42401 = 0x45e42401, + VALIDATION_ERROR_46002401 = 0x46002401, + VALIDATION_ERROR_46002413 = 0x46002413, + VALIDATION_ERROR_46002415 = 0x46002415, + VALIDATION_ERROR_46042401 = 0x46042401, + VALIDATION_ERROR_46229c01 = 0x46229c01, + VALIDATION_ERROR_46242401 = 0x46242401, + VALIDATION_ERROR_46429c01 = 0x46429c01, + VALIDATION_ERROR_46442401 = 0x46442401, + VALIDATION_ERROR_46605601 = 0x46605601, + VALIDATION_ERROR_4661c201 = 0x4661c201, + VALIDATION_ERROR_46805601 = 0x46805601, + VALIDATION_ERROR_46825c01 = 0x46825c01, + VALIDATION_ERROR_46a01774 = 0x46a01774, + VALIDATION_ERROR_46a01776 = 0x46a01776, + VALIDATION_ERROR_46a01778 = 0x46a01778, + VALIDATION_ERROR_46a0177a = 0x46a0177a, + VALIDATION_ERROR_46a0177c = 0x46a0177c, + VALIDATION_ERROR_46a0177e = 0x46a0177e, + VALIDATION_ERROR_46a01780 = 0x46a01780, + VALIDATION_ERROR_46a01782 = 0x46a01782, + VALIDATION_ERROR_46a01784 = 0x46a01784, + VALIDATION_ERROR_46a01786 = 0x46a01786, + VALIDATION_ERROR_46a01788 = 0x46a01788, + VALIDATION_ERROR_46a0178a = 0x46a0178a, + VALIDATION_ERROR_46a0178c = 0x46a0178c, + VALIDATION_ERROR_46a0178e = 0x46a0178e, + VALIDATION_ERROR_46a2b00b = 0x46a2b00b, + VALIDATION_ERROR_46a42a01 = 0x46a42a01, + VALIDATION_ERROR_46a42a03 = 0x46a42a03, + VALIDATION_ERROR_46c017ca = 0x46c017ca, + VALIDATION_ERROR_46c017cc = 0x46c017cc, + VALIDATION_ERROR_46c2b00b = 0x46c2b00b, + VALIDATION_ERROR_46c42c01 = 0x46c42c01, + VALIDATION_ERROR_46e2b00b = 0x46e2b00b, + VALIDATION_ERROR_4702b00b = 0x4702b00b, + VALIDATION_ERROR_4722b00b = 0x4722b00b, + VALIDATION_ERROR_4742b00b = 0x4742b00b, + VALIDATION_ERROR_47600e9a = 0x47600e9a, + VALIDATION_ERROR_47600e9c = 0x47600e9c, + VALIDATION_ERROR_47600e9e = 0x47600e9e, + VALIDATION_ERROR_MAX_ENUM = 1, }; -// Mapping from unique validation error enum to the corresponding error message -// The error message should be appended to the end of a custom error message that is passed -// as the pMessage parameter to the PFN_vkDebugReportCallbackEXT function +// Mapping from unique validation error enum to the corresponding spec text static std::unordered_map validation_error_map{ - {VALIDATION_ERROR_00000009, "The spec valid usage text states 'Each of fence, semaphore, and swapchain that are valid handles must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-commonparent)"}, - {VALIDATION_ERROR_00000a10, "The spec valid usage text states 'If semaphore is not VK_NULL_HANDLE it must be unsignaled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-semaphore-01288)"}, - {VALIDATION_ERROR_00000a12, "The spec valid usage text states 'If fence is not VK_NULL_HANDLE it must be unsignaled and must not be associated with any other queue command that has not yet completed execution on that queue' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-fence-01289)"}, - {VALIDATION_ERROR_00000a14, "The spec valid usage text states 'deviceMask must be a valid device mask' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-deviceMask-01290)"}, - {VALIDATION_ERROR_00000a16, "The spec valid usage text states 'deviceMask must not be zero' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-deviceMask-01291)"}, - {VALIDATION_ERROR_00000d16, "The spec valid usage text states 'swapchain must not be in the retired state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-swapchain-01675)"}, - {VALIDATION_ERROR_00008801, "The spec valid usage text states 'If fence is not VK_NULL_HANDLE, fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-fence-parameter)"}, - {VALIDATION_ERROR_0001c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-pNext-pNext)"}, - {VALIDATION_ERROR_0002b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-sType-sType)"}, - {VALIDATION_ERROR_0002b801, "The spec valid usage text states 'If semaphore is not VK_NULL_HANDLE, semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-semaphore-parameter)"}, - {VALIDATION_ERROR_0002f001, "The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-swapchain-parameter)"}, + {VALIDATION_ERROR_00000009, "The spec valid usage text states 'Each of fence, semaphore, and swapchain that are valid handles must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-commonparent)"}, + {VALIDATION_ERROR_00000a10, "The spec valid usage text states 'If semaphore is not VK_NULL_HANDLE it must be unsignaled' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-semaphore-01288)"}, + {VALIDATION_ERROR_00000a12, "The spec valid usage text states 'If fence is not VK_NULL_HANDLE it must be unsignaled and must not be associated with any other queue command that has not yet completed execution on that queue' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-fence-01289)"}, + {VALIDATION_ERROR_00000a14, "The spec valid usage text states 'deviceMask must be a valid device mask' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-deviceMask-01290)"}, + {VALIDATION_ERROR_00000a16, "The spec valid usage text states 'deviceMask must not be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-deviceMask-01291)"}, + {VALIDATION_ERROR_00000d16, "The spec valid usage text states 'swapchain must not be in the retired state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-swapchain-01675)"}, + {VALIDATION_ERROR_00000dea, "The spec valid usage text states 'If semaphore is not VK_NULL_HANDLE it must not have any uncompleted signal or wait operations pending' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-semaphore-01781)"}, + {VALIDATION_ERROR_00000dec, "The spec valid usage text states 'semaphore and fence must not both be equal to VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-semaphore-01782)"}, + {VALIDATION_ERROR_00000e18, "The spec valid usage text states 'semaphore and fence must not both be equal to VK_NULL_HANDLE.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-semaphore-01804)"}, + {VALIDATION_ERROR_00008801, "The spec valid usage text states 'If fence is not VK_NULL_HANDLE, fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-fence-parameter)"}, + {VALIDATION_ERROR_0001c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_0002b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_0002b801, "The spec valid usage text states 'If semaphore is not VK_NULL_HANDLE, semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-semaphore-parameter)"}, + {VALIDATION_ERROR_0002f001, "The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAcquireNextImageInfoKHR-swapchain-parameter)"}, {VALIDATION_ERROR_002004f0, "The spec valid usage text states 'pfnAllocation must be a valid pointer to a valid user-defined PFN_vkAllocationFunction' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnAllocation-00632)"}, {VALIDATION_ERROR_002004f2, "The spec valid usage text states 'pfnReallocation must be a valid pointer to a valid user-defined PFN_vkReallocationFunction' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnReallocation-00633)"}, {VALIDATION_ERROR_002004f4, "The spec valid usage text states 'pfnFree must be a valid pointer to a valid user-defined PFN_vkFreeFunction' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnFree-00634)"}, {VALIDATION_ERROR_002004f6, "The spec valid usage text states 'If either of pfnInternalAllocation or pfnInternalFree is not NULL, both must be valid callbacks' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnInternalAllocation-00635)"}, - {VALIDATION_ERROR_004009c0, "The spec valid usage text states 'window must point to a valid Android ANativeWindow.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAndroidSurfaceCreateInfoKHR-window-01248)"}, - {VALIDATION_ERROR_00409005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAndroidSurfaceCreateInfoKHR-flags-zerobitmask)"}, - {VALIDATION_ERROR_0041c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAndroidSurfaceCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_0042b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAndroidSurfaceCreateInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_004009c0, "The spec valid usage text states 'window must point to a valid Android ANativeWindow.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAndroidSurfaceCreateInfoKHR-window-01248)"}, + {VALIDATION_ERROR_00409005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAndroidSurfaceCreateInfoKHR-flags-zerobitmask)"}, + {VALIDATION_ERROR_0041c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAndroidSurfaceCreateInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_0042b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAndroidSurfaceCreateInfoKHR-sType-sType)"}, {VALIDATION_ERROR_0060f001, "The spec valid usage text states 'If pApplicationName is not NULL, pApplicationName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkApplicationInfo-pApplicationName-parameter)"}, {VALIDATION_ERROR_00615c01, "The spec valid usage text states 'If pEngineName is not NULL, pEngineName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkApplicationInfo-pEngineName-parameter)"}, {VALIDATION_ERROR_0061c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkApplicationInfo-pNext-pNext)"}, @@ -3796,85 +4003,63 @@ {VALIDATION_ERROR_0082e401, "The spec valid usage text states 'storeOp must be a valid VkAttachmentStoreOp value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentDescription-storeOp-parameter)"}, {VALIDATION_ERROR_00a006b2, "The spec valid usage text states 'layout must not be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentReference-layout-00857)"}, {VALIDATION_ERROR_00a0be01, "The spec valid usage text states 'layout must be a valid VkImageLayout value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentReference-layout-parameter)"}, - {VALIDATION_ERROR_00c00009, "The spec valid usage text states 'Both of buffer, and memory must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-commonparent)"}, - {VALIDATION_ERROR_00c00820, "The spec valid usage text states 'All valid usage rules from vkBindBufferMemory apply to the identically named members of VkBindBufferMemoryInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-None-01040)"}, - {VALIDATION_ERROR_00c00822, "The spec valid usage text states 'deviceIndexCount must either be zero or equal to the number of physical devices in the logical device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-deviceIndexCount-01041)"}, - {VALIDATION_ERROR_00c00824, "The spec valid usage text states 'All elements of pDeviceIndices must be valid device indices' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-pDeviceIndices-01042)"}, - {VALIDATION_ERROR_00c00826, "The spec valid usage text states 'All instances of memory that are bound to must have been allocated' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-None-01043)"}, - {VALIDATION_ERROR_00c00c72, "The spec valid usage text states 'buffer must not already be backed by a memory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-buffer-01593)"}, - {VALIDATION_ERROR_00c00c74, "The spec valid usage text states 'buffer must not have been created with any sparse memory binding flags' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-buffer-01594)"}, - {VALIDATION_ERROR_00c00c76, "The spec valid usage text states 'memoryOffset must be less than the size of memory' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-memoryOffset-01595)"}, - {VALIDATION_ERROR_00c00c78, "The spec valid usage text states 'If buffer was created with the VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT or VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minTexelBufferOffsetAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-buffer-01596)"}, - {VALIDATION_ERROR_00c00c7a, "The spec valid usage text states 'If buffer was created with the VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minUniformBufferOffsetAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-buffer-01597)"}, - {VALIDATION_ERROR_00c00c7c, "The spec valid usage text states 'If buffer was created with the VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minStorageBufferOffsetAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-buffer-01598)"}, - {VALIDATION_ERROR_00c00c7e, "The spec valid usage text states 'memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-memory-01599)"}, - {VALIDATION_ERROR_00c00c80, "The spec valid usage text states 'memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-memoryOffset-01600)"}, - {VALIDATION_ERROR_00c00c82, "The spec valid usage text states 'The size member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer must be less than or equal to the size of memory minus memoryOffset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-size-01601)"}, - {VALIDATION_ERROR_00c00c84, "The spec valid usage text states 'If buffer requires a dedicated allocation(as reported by vkGetBufferMemoryRequirements2KHR in VkMemoryDedicatedRequirementsKHR::requiresDedicatedAllocation for image), memory must have been created with VkMemoryDedicatedAllocateInfoKHR::buffer equal to buffer and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-buffer-01602)"}, - {VALIDATION_ERROR_00c00c86, "The spec valid usage text states 'If buffer was created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must have been created with VkDedicatedAllocationMemoryAllocateInfoNV::buffer equal to buffer and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-buffer-01603)"}, - {VALIDATION_ERROR_00c00c88, "The spec valid usage text states 'If buffer was not created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must not have been allocated dedicated for a specific buffer or image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-buffer-01604)"}, - {VALIDATION_ERROR_00c00c8a, "The spec valid usage text states 'If the pNext chain includes VkBindBufferMemoryDeviceGroupInfoKHX, all instances of memory specified by VkBindBufferMemoryDeviceGroupInfoKHX::pDeviceIndices must have been allocated' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-pNext-01605)"}, - {VALIDATION_ERROR_00c01a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-buffer-parameter)"}, - {VALIDATION_ERROR_00c0c601, "The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-memory-parameter)"}, - {VALIDATION_ERROR_00c13e01, "The spec valid usage text states 'If deviceIndexCount is not 0, pDeviceIndices must be a pointer to an array of deviceIndexCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-pDeviceIndices-parameter)"}, - {VALIDATION_ERROR_00c1c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkBindBufferMemoryDeviceGroupInfoKHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_00c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_00e00009, "The spec valid usage text states 'Both of image, and memory that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-commonparent)"}, - {VALIDATION_ERROR_00e00838, "The spec valid usage text states 'All valid usage rules from vkBindImageMemory apply to the identically named members of VkBindImageMemoryInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-None-01052)"}, - {VALIDATION_ERROR_00e0083a, "The spec valid usage text states 'At least one of deviceIndexCount and SFRRectCount must be zero.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-deviceIndexCount-01053)"}, - {VALIDATION_ERROR_00e0083c, "The spec valid usage text states 'deviceIndexCount must either be zero or equal to the number of physical devices in the logical device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-deviceIndexCount-01054)"}, - {VALIDATION_ERROR_00e0083e, "The spec valid usage text states 'All elements of pDeviceIndices must be valid device indices.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pDeviceIndices-01055)"}, - {VALIDATION_ERROR_00e00840, "The spec valid usage text states 'SFRRectCount must either be zero or equal to the number of physical devices in the logical device squared' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-SFRRectCount-01056)"}, - {VALIDATION_ERROR_00e00842, "The spec valid usage text states 'If SFRRectCount is not zero, then image must have been created with the VK_IMAGE_CREATE_BIND_SFR_BIT_KHX bit set.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-SFRRectCount-01057)"}, - {VALIDATION_ERROR_00e00844, "The spec valid usage text states 'All elements of pSFRRects must be valid rectangles contained within the dimensions of the image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pSFRRects-01058)"}, - {VALIDATION_ERROR_00e00846, "The spec valid usage text states 'Elements of pSFRRects that correspond to the same instance of the image must not overlap and their union must cover the entire image.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pSFRRects-01059)"}, - {VALIDATION_ERROR_00e0084a, "The spec valid usage text states 'For each element of pSFRRects, offset.x must be a multiple of the sparse image block width (VkSparseImageFormatProperties::imageGranularity.width) of all non-metadata aspects of the image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-offset-01061)"}, - {VALIDATION_ERROR_00e0084c, "The spec valid usage text states 'For each element of pSFRRects, extent.width must either be a multiple of the sparse image block width of all non-metadata aspects of the image, or else (extent.width + offset.x) must equal the width of the image subresource' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-extent-01062)"}, - {VALIDATION_ERROR_00e0084e, "The spec valid usage text states 'For each element of pSFRRects, offset.y must be a multiple of the sparse image block height (VkSparseImageFormatProperties::imageGranularity.height) of all non-metadata aspects of the image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-offset-01063)"}, - {VALIDATION_ERROR_00e00850, "The spec valid usage text states 'For each element of pSFRRects, extent.height must either be a multiple of the sparse image block height of all non-metadata aspects of the image, or else (extent.height + offset.y) must equal the height of the image subresource' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-extent-01064)"}, - {VALIDATION_ERROR_00e00852, "The spec valid usage text states 'All instances of memory that are bound must have been allocated' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-None-01065)"}, - {VALIDATION_ERROR_00e00854, "The spec valid usage text states 'If image was created with a valid swapchain handle in VkImageSwapchainCreateInfoKHX::swapchain, then the image must be bound to memory from that swapchain (using VkBindImageMemorySwapchainInfoKHX).' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-image-01066)"}, - {VALIDATION_ERROR_00e00c92, "The spec valid usage text states 'image must not already be backed by a memory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-image-01609)"}, - {VALIDATION_ERROR_00e00c94, "The spec valid usage text states 'image must not have been created with any sparse memory binding flags' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-image-01610)"}, - {VALIDATION_ERROR_00e00c96, "The spec valid usage text states 'memoryOffset must be less than the size of memory' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-memoryOffset-01611)"}, - {VALIDATION_ERROR_00e00c98, "The spec valid usage text states 'memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-memory-01612)"}, - {VALIDATION_ERROR_00e00c9a, "The spec valid usage text states 'memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-memoryOffset-01613)"}, - {VALIDATION_ERROR_00e00c9c, "The spec valid usage text states 'The difference of the size of memory and memoryOffset must be greater than or equal to the size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with the same image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-memory-01614)"}, - {VALIDATION_ERROR_00e00c9e, "The spec valid usage text states 'If the pNext chain does not include an instance of the VkBindImagePlaneMemoryInfoKHR structure, memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2KHR with image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01615)"}, - {VALIDATION_ERROR_00e00ca0, "The spec valid usage text states 'If the pNext chain does not include an instance of the VkBindImagePlaneMemoryInfoKHR structure, memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2KHR with image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01616)"}, - {VALIDATION_ERROR_00e00ca2, "The spec valid usage text states 'If the pNext chain does not include an instance of the VkBindImagePlaneMemoryInfoKHR structure, the difference of the size of memory and memoryOffset must be greater than or equal to the size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2KHR with the same image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01617)"}, - {VALIDATION_ERROR_00e00ca4, "The spec valid usage text states 'If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfoKHR structure, image must have been created with the VK_IMAGE_CREATE_DISJOINT_BIT_KHR bit set.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01618)"}, - {VALIDATION_ERROR_00e00ca6, "The spec valid usage text states 'If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfoKHR structure, memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2KHR with image and the correct planeAspect for this plane in the VkImagePlaneMemoryRequirementsInfoKHR structure attached to the VkImageMemoryRequirementsInfo2KHR's pNext chain' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01619)"}, - {VALIDATION_ERROR_00e00ca8, "The spec valid usage text states 'If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfoKHR structure, memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2KHR with image and the correct planeAspect for this plane in the VkImagePlaneMemoryRequirementsInfoKHR structure attached to the VkImageMemoryRequirementsInfo2KHR's pNext chain' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01620)"}, - {VALIDATION_ERROR_00e00caa, "The spec valid usage text states 'If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfoKHR structure, the difference of the size of memory and memoryOffset must be greater than or equal to the size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2KHR with the same image and the correct planeAspect for this plane in the VkImagePlaneMemoryRequirementsInfoKHR structure attached to the VkImageMemoryRequirementsInfo2KHR's pNext chain' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01621)"}, - {VALIDATION_ERROR_00e00cac, "The spec valid usage text states 'If image requires a dedicated allocation (as reported by vkGetImageMemoryRequirements2KHR in VkMemoryDedicatedRequirementsKHR::requiresDedicatedAllocation for image), memory must have been created with VkMemoryDedicatedAllocateInfoKHR::image equal to image and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-image-01622)"}, - {VALIDATION_ERROR_00e00cae, "The spec valid usage text states 'If image was created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must have been created with VkDedicatedAllocationMemoryAllocateInfoNV::image equal to image and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-image-01623)"}, - {VALIDATION_ERROR_00e00cb0, "The spec valid usage text states 'If image was not created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must not have been allocated dedicated for a specific buffer or image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-image-01624)"}, - {VALIDATION_ERROR_00e00cb2, "The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-memory-01625)"}, - {VALIDATION_ERROR_00e00cb4, "The spec valid usage text states 'If the pNext chain includes VkBindImageMemoryDeviceGroupInfoKHX, all instances of memory specified by VkBindImageMemoryDeviceGroupInfoKHX::pDeviceIndices must have been allocated' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01626)"}, - {VALIDATION_ERROR_00e00cb6, "The spec valid usage text states 'If the pNext chain includes VkBindImageMemoryDeviceGroupInfoKHX, and VkBindImageMemoryDeviceGroupInfoKHX::SFRRectCount is not zero, then image must have been created with the VK_IMAGE_CREATE_BIND_SFR_BIT_KHX bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01627)"}, - {VALIDATION_ERROR_00e00cb8, "The spec valid usage text states 'If the pNext chain includes VkBindImageMemoryDeviceGroupInfoKHX, all elements of VkBindImageMemoryDeviceGroupInfoKHX::pSFRRects must be valid rectangles contained within the dimensions of image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01628)"}, - {VALIDATION_ERROR_00e00cba, "The spec valid usage text states 'If the pNext chain includes VkBindImageMemoryDeviceGroupInfoKHX, the union of the areas of all elements of VkBindImageMemoryDeviceGroupInfoKHX::pSFRRects that correspond to the same instance of pname: image must cover the entire image.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01629)"}, - {VALIDATION_ERROR_00e00cbc, "The spec valid usage text states 'If image was created with a valid swapchain handle in VkImageSwapchainCreateInfoKHX::swapchain, then the pNext chain must include a valid instance of VkBindImageMemorySwapchainInfoKHX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-image-01630)"}, - {VALIDATION_ERROR_00e00cbe, "The spec valid usage text states 'If the pNext chain includes an instance of VkBindImageMemorySwapchainInfoKHX, memory must be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01631)"}, - {VALIDATION_ERROR_00e00cc0, "The spec valid usage text states 'If the pNext chain does not include an instance of VkBindImageMemorySwapchainInfoKHX, memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-01632)"}, - {VALIDATION_ERROR_00e0a001, "The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-image-parameter)"}, - {VALIDATION_ERROR_00e0c601, "The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-memory-parameter)"}, - {VALIDATION_ERROR_00e13e01, "The spec valid usage text states 'If deviceIndexCount is not 0, pDeviceIndices must be a pointer to an array of deviceIndexCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pDeviceIndices-parameter)"}, - {VALIDATION_ERROR_00e1c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkBindImageMemoryDeviceGroupInfoKHX, VkBindImageMemorySwapchainInfoKHX, or VkBindImagePlaneMemoryInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_00e22001, "The spec valid usage text states 'If SFRRectCount is not 0, pSFRRects must be a pointer to an array of SFRRectCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-pSFRRects-parameter)"}, - {VALIDATION_ERROR_00e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_00e2b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfoKHR-sType-unique)"}, - {VALIDATION_ERROR_01000856, "The spec valid usage text states 'At least one of swapchain and VkBindImageMemoryInfoKHR::memory must be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemorySwapchainInfoKHX-swapchain-01067)"}, - {VALIDATION_ERROR_01000858, "The spec valid usage text states 'imageIndex must be less than the number of images in swapchain' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemorySwapchainInfoKHX-imageIndex-01068)"}, - {VALIDATION_ERROR_01000cd8, "The spec valid usage text states 'imageIndex must be less than the number of images in swapchain' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemorySwapchainInfoKHX-imageIndex-01644)"}, - {VALIDATION_ERROR_0102b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemorySwapchainInfoKHX-sType-sType)"}, - {VALIDATION_ERROR_0102f001, "The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemorySwapchainInfoKHX-swapchain-parameter)"}, + {VALIDATION_ERROR_00c00009, "The spec valid usage text states 'Both of buffer, and memory must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-commonparent)"}, + {VALIDATION_ERROR_00c00c72, "The spec valid usage text states 'buffer must not already be backed by a memory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-buffer-01593)"}, + {VALIDATION_ERROR_00c00c74, "The spec valid usage text states 'buffer must not have been created with any sparse memory binding flags' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-buffer-01594)"}, + {VALIDATION_ERROR_00c00c76, "The spec valid usage text states 'memoryOffset must be less than the size of memory' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-memoryOffset-01595)"}, + {VALIDATION_ERROR_00c00c78, "The spec valid usage text states 'If buffer was created with the VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT or VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minTexelBufferOffsetAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-buffer-01596)"}, + {VALIDATION_ERROR_00c00c7a, "The spec valid usage text states 'If buffer was created with the VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minUniformBufferOffsetAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-buffer-01597)"}, + {VALIDATION_ERROR_00c00c7c, "The spec valid usage text states 'If buffer was created with the VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minStorageBufferOffsetAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-buffer-01598)"}, + {VALIDATION_ERROR_00c00c7e, "The spec valid usage text states 'memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-memory-01599)"}, + {VALIDATION_ERROR_00c00c80, "The spec valid usage text states 'memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-memoryOffset-01600)"}, + {VALIDATION_ERROR_00c00c82, "The spec valid usage text states 'The size member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer must be less than or equal to the size of memory minus memoryOffset' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-size-01601)"}, + {VALIDATION_ERROR_00c00c84, "The spec valid usage text states 'If buffer requires a dedicated allocation(as reported by vkGetBufferMemoryRequirements2 in VkMemoryDedicatedRequirements::requiresDedicatedAllocation for buffer), memory must have been created with VkMemoryDedicatedAllocateInfo::buffer equal to buffer and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-buffer-01602)"}, + {VALIDATION_ERROR_00c00c86, "The spec valid usage text states 'If buffer was created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must have been created with VkDedicatedAllocationMemoryAllocateInfoNV::buffer equal to buffer and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-buffer-01603)"}, + {VALIDATION_ERROR_00c00c88, "The spec valid usage text states 'If buffer was not created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must not have been allocated dedicated for a specific buffer or image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryInfo-buffer-01604)"}, + {VALIDATION_ERROR_00c00c8a, "The spec valid usage text states 'If the pNext chain includes VkBindBufferMemoryDeviceGroupInfo, all instances of memory specified by VkBindBufferMemoryDeviceGroupInfo::pDeviceIndices must have been allocated' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-pNext-01605)"}, + {VALIDATION_ERROR_00c00ed8, "The spec valid usage text states 'If the VkMemoryAllocateInfo provided when memory was allocated included an instance of VkMemoryDedicatedAllocateInfo in its pNext chain, and VkMemoryDedicatedAllocateInfo::buffer was not VK_NULL_HANDLE, then buffer must equal VkMemoryDedicatedAllocateInfo::buffer and memoryOffset must be zero.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-memory-01900)"}, + {VALIDATION_ERROR_00c01a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-buffer-parameter)"}, + {VALIDATION_ERROR_00c0c601, "The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-memory-parameter)"}, + {VALIDATION_ERROR_00c1c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkBindBufferMemoryDeviceGroupInfo' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-pNext-pNext)"}, + {VALIDATION_ERROR_00c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-sType-sType)"}, + {VALIDATION_ERROR_00e00009, "The spec valid usage text states 'Both of image, and memory that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-commonparent)"}, + {VALIDATION_ERROR_00e00c92, "The spec valid usage text states 'image must not already be backed by a memory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-image-01609)"}, + {VALIDATION_ERROR_00e00c94, "The spec valid usage text states 'image must not have been created with any sparse memory binding flags' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-image-01610)"}, + {VALIDATION_ERROR_00e00c96, "The spec valid usage text states 'memoryOffset must be less than the size of memory' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-memoryOffset-01611)"}, + {VALIDATION_ERROR_00e00c98, "The spec valid usage text states 'memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfo-memory-01612)"}, + {VALIDATION_ERROR_00e00c9a, "The spec valid usage text states 'memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfo-memoryOffset-01613)"}, + {VALIDATION_ERROR_00e00c9c, "The spec valid usage text states 'The difference of the size of memory and memoryOffset must be greater than or equal to the size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with the same image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfo-memory-01614)"}, + {VALIDATION_ERROR_00e00c9e, "The spec valid usage text states 'If the pNext chain does not include an instance of the VkBindImagePlaneMemoryInfo structure, memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2 with image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01615)"}, + {VALIDATION_ERROR_00e00ca0, "The spec valid usage text states 'If the pNext chain does not include an instance of the VkBindImagePlaneMemoryInfo structure, memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2 with image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01616)"}, + {VALIDATION_ERROR_00e00ca2, "The spec valid usage text states 'If the pNext chain does not include an instance of the VkBindImagePlaneMemoryInfo structure, the difference of the size of memory and memoryOffset must be greater than or equal to the size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2 with the same image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01617)"}, + {VALIDATION_ERROR_00e00ca4, "The spec valid usage text states 'If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfo structure, image must have been created with the VK_IMAGE_CREATE_DISJOINT_BIT bit set.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01618)"}, + {VALIDATION_ERROR_00e00ca6, "The spec valid usage text states 'If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfo structure, memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2 with image and the correct planeAspect for this plane in the VkImagePlaneMemoryRequirementsInfo structure attached to the VkImageMemoryRequirementsInfo2's pNext chain' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01619)"}, + {VALIDATION_ERROR_00e00ca8, "The spec valid usage text states 'If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfo structure, memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2 with image and the correct planeAspect for this plane in the VkImagePlaneMemoryRequirementsInfo structure attached to the VkImageMemoryRequirementsInfo2's pNext chain' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01620)"}, + {VALIDATION_ERROR_00e00caa, "The spec valid usage text states 'If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfo structure, the difference of the size of memory and memoryOffset must be greater than or equal to the size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2 with the same image and the correct planeAspect for this plane in the VkImagePlaneMemoryRequirementsInfo structure attached to the VkImageMemoryRequirementsInfo2's pNext chain' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01621)"}, + {VALIDATION_ERROR_00e00cac, "The spec valid usage text states 'If image requires a dedicated allocation (as reported by vkGetImageMemoryRequirements2 in VkMemoryDedicatedRequirements::requiresDedicatedAllocation for image), memory must have been created with VkMemoryDedicatedAllocateInfo::image equal to image and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-image-01622)"}, + {VALIDATION_ERROR_00e00cae, "The spec valid usage text states 'If image was created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must have been created with VkDedicatedAllocationMemoryAllocateInfoNV::image equal to image and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-image-01623)"}, + {VALIDATION_ERROR_00e00cb0, "The spec valid usage text states 'If image was not created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must not have been allocated dedicated for a specific buffer or image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfo-image-01624)"}, + {VALIDATION_ERROR_00e00cb2, "The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryInfo-memory-01625)"}, + {VALIDATION_ERROR_00e00cb4, "The spec valid usage text states 'If the pNext chain includes VkBindImageMemoryDeviceGroupInfo, all instances of memory specified by VkBindImageMemoryDeviceGroupInfo::pDeviceIndices must have been allocated' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01626)"}, + {VALIDATION_ERROR_00e00cb6, "The spec valid usage text states 'If the pNext chain includes VkBindImageMemoryDeviceGroupInfo, and VkBindImageMemoryDeviceGroupInfo::splitInstanceBindRegionCount is not zero, then image must have been created with the VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01627)"}, + {VALIDATION_ERROR_00e00cb8, "The spec valid usage text states 'If the pNext chain includes VkBindImageMemoryDeviceGroupInfo, all elements of VkBindImageMemoryDeviceGroupInfo::pSplitInstanceBindRegions must be valid rectangles contained within the dimensions of image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01628)"}, + {VALIDATION_ERROR_00e00cba, "The spec valid usage text states 'If the pNext chain includes VkBindImageMemoryDeviceGroupInfo, the union of the areas of all elements of VkBindImageMemoryDeviceGroupInfo::pSplitInstanceBindRegions that correspond to the same instance of image must cover the entire image.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01629)"}, + {VALIDATION_ERROR_00e00cbc, "The spec valid usage text states 'If image was created with a valid swapchain handle in VkImageSwapchainCreateInfoKHR::swapchain, then the pNext chain must include a valid instance of VkBindImageMemorySwapchainInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-image-01630)"}, + {VALIDATION_ERROR_00e00cbe, "The spec valid usage text states 'If the pNext chain includes an instance of VkBindImageMemorySwapchainInfoKHR, memory must be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01631)"}, + {VALIDATION_ERROR_00e00cc0, "The spec valid usage text states 'If the pNext chain does not include an instance of VkBindImageMemorySwapchainInfoKHR, memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-01632)"}, + {VALIDATION_ERROR_00e00ede, "The spec valid usage text states 'If the VkMemoryAllocateInfo provided when memory was allocated included an instance of VkMemoryDedicatedAllocateInfo in its pNext chain, and VkMemoryDedicatedAllocateInfo::image was not VK_NULL_HANDLE, then image must equal VkMemoryDedicatedAllocateInfo::image and memoryOffset must be zero.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-memory-01903)"}, + {VALIDATION_ERROR_00e0a001, "The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-image-parameter)"}, + {VALIDATION_ERROR_00e1c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkBindImageMemoryDeviceGroupInfo, VkBindImageMemorySwapchainInfoKHR, or VkBindImagePlaneMemoryInfo' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-pNext-pNext)"}, + {VALIDATION_ERROR_00e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-sType-sType)"}, + {VALIDATION_ERROR_00e2b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryInfo-sType-unique)"}, + {VALIDATION_ERROR_01000cd8, "The spec valid usage text states 'imageIndex must be less than the number of images in swapchain' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemorySwapchainInfoKHR-imageIndex-01644)"}, + {VALIDATION_ERROR_0102b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemorySwapchainInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_0102f001, "The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemorySwapchainInfoKHR-swapchain-parameter)"}, {VALIDATION_ERROR_01200009, "The spec valid usage text states 'Both of the elements of pSignalSemaphores, and the elements of pWaitSemaphores that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-commonparent)"}, {VALIDATION_ERROR_01210201, "The spec valid usage text states 'If bufferBindCount is not 0, pBufferBinds must be a valid pointer to an array of bufferBindCount valid VkSparseBufferMemoryBindInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pBufferBinds-parameter)"}, {VALIDATION_ERROR_01218001, "The spec valid usage text states 'If imageBindCount is not 0, pImageBinds must be a valid pointer to an array of imageBindCount valid VkSparseImageMemoryBindInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pImageBinds-parameter)"}, {VALIDATION_ERROR_01218c01, "The spec valid usage text states 'If imageOpaqueBindCount is not 0, pImageOpaqueBinds must be a valid pointer to an array of imageOpaqueBindCount valid VkSparseImageOpaqueMemoryBindInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pImageOpaqueBinds-parameter)"}, - {VALIDATION_ERROR_0121c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkDeviceGroupBindSparseInfoKHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pNext-pNext)"}, + {VALIDATION_ERROR_0121c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkDeviceGroupBindSparseInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pNext-pNext)"}, {VALIDATION_ERROR_01223401, "The spec valid usage text states 'If signalSemaphoreCount is not 0, pSignalSemaphores must be a valid pointer to an array of signalSemaphoreCount valid VkSemaphore handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pSignalSemaphores-parameter)"}, {VALIDATION_ERROR_01227601, "The spec valid usage text states 'If waitSemaphoreCount is not 0, pWaitSemaphores must be a valid pointer to an array of waitSemaphoreCount valid VkSemaphore handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-pWaitSemaphores-parameter)"}, {VALIDATION_ERROR_0122b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindSparseInfo-sType-sType)"}, @@ -3885,19 +4070,20 @@ {VALIDATION_ERROR_01400728, "The spec valid usage text states 'If the sparse buffer residency feature is not enabled, flags must not contain VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-flags-00916)"}, {VALIDATION_ERROR_0140072a, "The spec valid usage text states 'If the sparse aliased residency feature is not enabled, flags must not contain VK_BUFFER_CREATE_SPARSE_ALIASED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-flags-00917)"}, {VALIDATION_ERROR_0140072c, "The spec valid usage text states 'If flags contains VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT or VK_BUFFER_CREATE_SPARSE_ALIASED_BIT, it must also contain VK_BUFFER_CREATE_SPARSE_BINDING_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-flags-00918)"}, - {VALIDATION_ERROR_0140072e, "The spec valid usage text states 'If any of the handle types specified in VkExternalMemoryImageCreateInfoKHR::handleTypes requires dedicated allocation, as reported by vkGetPhysicalDeviceExternalBufferPropertiesKHR in VkExternalBufferPropertiesKHR::externalMemoryProperties::externalMemoryFeatures, the pNext chain must contain an instance of VkDedicatedAllocationBufferCreateInfoNV with its dedicatedAllocation field set to VK_TRUE.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferCreateInfo-handleTypes-00919)"}, - {VALIDATION_ERROR_01400730, "The spec valid usage text states 'If the pNext chain contains an instance of VkExternalMemoryBufferCreateInfoKHR, its handleTypes member must only contain bits that are also in VkExternalBufferPropertiesKHR::externalMemoryProperties.pname:compatibleHandleTypes, as returned by vkGetPhysicalDeviceExternalBufferPropertiesKHR with pExternalBufferInfo->handleType equal to any one of the handle types specified in VkExternalMemoryBufferCreateInfoKHR::handleTypes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferCreateInfo-pNext-00920)"}, + {VALIDATION_ERROR_01400730, "The spec valid usage text states 'If the pNext chain contains an instance of VkExternalMemoryBufferCreateInfo, its handleTypes member must only contain bits that are also in VkExternalBufferProperties::externalMemoryProperties.pname:compatibleHandleTypes, as returned by vkGetPhysicalDeviceExternalBufferProperties with pExternalBufferInfo-&gt;handleType equal to any one of the handle types specified in VkExternalMemoryBufferCreateInfo::handleTypes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferCreateInfo-pNext-00920)"}, {VALIDATION_ERROR_01400ade, "The spec valid usage text states 'If sharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the physicalDevice that was used to create device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-sharingMode-01391)"}, - {VALIDATION_ERROR_01400b16, "The spec valid usage text states 'If sharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by either vkGetPhysicalDeviceQueueFamilyProperties or vkGetPhysicalDeviceQueueFamilyProperties2KHR for the physicalDevice that was used to create device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferCreateInfo-sharingMode-01419)"}, + {VALIDATION_ERROR_01400b16, "The spec valid usage text states 'If sharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by either vkGetPhysicalDeviceQueueFamilyProperties or vkGetPhysicalDeviceQueueFamilyProperties2 for the physicalDevice that was used to create device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferCreateInfo-sharingMode-01419)"}, {VALIDATION_ERROR_01400c46, "The spec valid usage text states 'If the pNext chain contains an instance of VkDedicatedAllocationBufferCreateInfoNV, and the dedicatedAllocation member of the chained structure is VK_TRUE, then flags must not include VK_BUFFER_CREATE_SPARSE_BINDING_BIT, VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT, or VK_BUFFER_CREATE_SPARSE_ALIASED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferCreateInfo-pNext-01571)"}, + {VALIDATION_ERROR_01400ebe, "The spec valid usage text states 'If the protected memory feature is not enabled, flags must not contain VK_BUFFER_CREATE_PROTECTED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferCreateInfo-flags-01887)"}, + {VALIDATION_ERROR_01400ec0, "The spec valid usage text states 'If any of the bits VK_BUFFER_CREATE_SPARSE_BINDING_BIT, VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT, or VK_BUFFER_CREATE_SPARSE_ALIASED_BIT are set, VK_BUFFER_CREATE_PROTECTED_BIT must not also be set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferCreateInfo-None-01888)"}, {VALIDATION_ERROR_01409001, "The spec valid usage text states 'flags must be a valid combination of VkBufferCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-flags-parameter)"}, - {VALIDATION_ERROR_0141c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDedicatedAllocationBufferCreateInfoNV or VkExternalMemoryBufferCreateInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-pNext-pNext)"}, + {VALIDATION_ERROR_0141c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDedicatedAllocationBufferCreateInfoNV or VkExternalMemoryBufferCreateInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-pNext-pNext)"}, {VALIDATION_ERROR_0142b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-sType-sType)"}, {VALIDATION_ERROR_0142b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-sType-unique)"}, {VALIDATION_ERROR_0142c001, "The spec valid usage text states 'sharingMode must be a valid VkSharingMode value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-sharingMode-parameter)"}, {VALIDATION_ERROR_01430601, "The spec valid usage text states 'usage must be a valid combination of VkBufferUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-usage-parameter)"}, {VALIDATION_ERROR_01430603, "The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferCreateInfo-usage-requiredbitmask)"}, - {VALIDATION_ERROR_01600182, "The spec valid usage text states 'If the the calling command's VkImage parameter's format is not a depth/stencil format, then bufferOffset must be a multiple of the format's element size' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-00193)"}, + {VALIDATION_ERROR_01600182, "The spec valid usage text states 'If the calling command's VkImage parameter's format is not a depth/stencil format, then bufferOffset must be a multiple of the format's element size' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-00193)"}, {VALIDATION_ERROR_01600184, "The spec valid usage text states 'bufferOffset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-00194)"}, {VALIDATION_ERROR_01600186, "The spec valid usage text states 'bufferRowLength must be 0, or greater than or equal to the width member of imageExtent' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferRowLength-00195)"}, {VALIDATION_ERROR_01600188, "The spec valid usage text states 'bufferImageHeight must be 0, or greater than or equal to the height member of imageExtent' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferImageHeight-00196)"}, @@ -3906,33 +4092,40 @@ {VALIDATION_ERROR_0160018e, "The spec valid usage text states 'If the calling command's srcImage (vkCmdCopyImageToBuffer) or dstImage (vkCmdCopyBufferToImage) is of type VK_IMAGE_TYPE_1D, then imageOffset.y must be 0 and imageExtent.height must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-srcImage-00199)"}, {VALIDATION_ERROR_01600190, "The spec valid usage text states 'imageOffset.z and (imageExtent.depth + imageOffset.z) must both be greater than or equal to 0 and less than or equal to the image subresource depth' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageOffset-00200)"}, {VALIDATION_ERROR_01600192, "The spec valid usage text states 'If the calling command's srcImage (vkCmdCopyImageToBuffer) or dstImage (vkCmdCopyBufferToImage) is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then imageOffset.z must be 0 and imageExtent.depth must be 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-srcImage-00201)"}, - {VALIDATION_ERROR_01600196, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferRowLength-00203)"}, - {VALIDATION_ERROR_01600198, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferImageHeight-00204)"}, - {VALIDATION_ERROR_0160019a, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageOffset-00205)"}, - {VALIDATION_ERROR_0160019c, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-00206)"}, - {VALIDATION_ERROR_0160019e, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageExtent-00207)"}, - {VALIDATION_ERROR_016001a0, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageExtent-00208)"}, - {VALIDATION_ERROR_016001a2, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageExtent-00209)"}, - {VALIDATION_ERROR_016001a4, "The spec valid usage text states 'bufferOffset, bufferRowLength, bufferImageHeight and all members of imageOffset and imageExtent must respect the image transfer granularity requirements of the queue family that it will be submitted against, as described in Physical Device Enumeration' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-00210)"}, + {VALIDATION_ERROR_01600196, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, bufferRowLength must be a multiple of the compressed texel block width' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferRowLength-00203)"}, + {VALIDATION_ERROR_01600198, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, bufferImageHeight must be a multiple of the compressed texel block height' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferImageHeight-00204)"}, + {VALIDATION_ERROR_0160019a, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, all members of imageOffset must be a multiple of the corresponding dimensions of the compressed texel block' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageOffset-00205)"}, + {VALIDATION_ERROR_0160019c, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, bufferOffset must be a multiple of the compressed texel block size in bytes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-00206)"}, + {VALIDATION_ERROR_0160019e, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, imageExtent.width must be a multiple of the compressed texel block width or (imageExtent.width + imageOffset.x) must equal the image subresource width' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageExtent-00207)"}, + {VALIDATION_ERROR_016001a0, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, imageExtent.height must be a multiple of the compressed texel block height or (imageExtent.height + imageOffset.y) must equal the image subresource height' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageExtent-00208)"}, + {VALIDATION_ERROR_016001a2, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, imageExtent.depth must be a multiple of the compressed texel block depth or (imageExtent.depth + imageOffset.z) must equal the image subresource depth' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageExtent-00209)"}, {VALIDATION_ERROR_016001a6, "The spec valid usage text states 'The aspectMask member of imageSubresource must specify aspects present in the calling command's VkImage parameter' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-aspectMask-00211)"}, {VALIDATION_ERROR_016001a8, "The spec valid usage text states 'The aspectMask member of imageSubresource must only have a single bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-aspectMask-00212)"}, {VALIDATION_ERROR_016001aa, "The spec valid usage text states 'If the calling command's VkImage parameter is of VkImageType VK_IMAGE_TYPE_3D, the baseArrayLayer and layerCount members of imageSubresource must be 0 and 1, respectively' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-baseArrayLayer-00213)"}, {VALIDATION_ERROR_016001ac, "The spec valid usage text states 'When copying to the depth aspect of an image subresource, the data in the source buffer must be in the range [0,1]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-None-00214)"}, - {VALIDATION_ERROR_01600c2c, "The spec valid usage text states 'If the calling command's VkImage parameter's format is not a depth/stencil format or a multi-planar format,cthen bufferOffset must be a multiple of the format's element size' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-01558)"}, - {VALIDATION_ERROR_01600c2e, "The spec valid usage text states 'If the calling command's VkImage parameter's format is a multi-planar format, then bufferOffset must be a multiple of the element size of the compatible format for the format and the aspectMask of the imageSubresource as defined in Compatible formats of planes of multi-planar formats' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-01559)"}, - {VALIDATION_ERROR_01600c30, "The spec valid usage text states 'If the calling command's VkImage parameter's format is a multi-planar format, then the aspectMask member of imageSubresource must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR, or VK_IMAGE_ASPECT_PLANE_2_BIT_KHR (with VK_IMAGE_ASPECT_PLANE_2_BIT_KHR valid only for image formats with three planes)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-aspectMask-01560)"}, + {VALIDATION_ERROR_01600c2c, "The spec valid usage text states 'If the calling command's VkImage parameter's format is not a depth/stencil format or a multi-planar format, then bufferOffset must be a multiple of the format's element size' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-01558)"}, + {VALIDATION_ERROR_01600c2e, "The spec valid usage text states 'If the calling command's VkImage parameter's format is a multi-planar format, then bufferOffset must be a multiple of the element size of the compatible format for the format and the aspectMask of the imageSubresource as defined in features-formats-compatible-planes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-bufferOffset-01559)"}, + {VALIDATION_ERROR_01600c30, "The spec valid usage text states 'If the calling command's VkImage parameter's format is a multi-planar format, then the aspectMask member of imageSubresource must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT (with VK_IMAGE_ASPECT_PLANE_2_BIT valid only for image formats with three planes)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-aspectMask-01560)"}, + {VALIDATION_ERROR_01600d8e, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, or a single-plane, \"_422\" image format, bufferRowLength must be a multiple of the compressed texel block width' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-None-01735)"}, + {VALIDATION_ERROR_01600d90, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, or a single-plane, \"_422\" image format, bufferImageHeight must be a multiple of the compressed texel block height' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-None-01736)"}, + {VALIDATION_ERROR_01600d92, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, or a single-plane, \"_422\" image format, all members of imageOffset must be a multiple of the corresponding dimensions of the compressed texel block' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-None-01737)"}, + {VALIDATION_ERROR_01600d94, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, or a single-plane, \"_422\" image format, bufferOffset must be a multiple of the compressed texel block size in bytes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-None-01738)"}, + {VALIDATION_ERROR_01600d96, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, or a single-plane, \"_422\" image format, imageExtent.width must be a multiple of the compressed texel block width or (imageExtent.width + imageOffset.x) must equal the image subresource width' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-None-01739)"}, + {VALIDATION_ERROR_01600d98, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, or a single-plane, \"_422\" image format, imageExtent.height must be a multiple of the compressed texel block height or (imageExtent.height + imageOffset.y) must equal the image subresource height' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-None-01740)"}, + {VALIDATION_ERROR_01600d9a, "The spec valid usage text states 'If the calling command's VkImage parameter is a compressed image, or a single-plane, \"_422\" image format, imageExtent.depth must be a multiple of the compressed texel block depth or (imageExtent.depth + imageOffset.z) must equal the image subresource depth' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferImageCopy-None-01741)"}, {VALIDATION_ERROR_0160aa01, "The spec valid usage text states 'imageSubresource must be a valid VkImageSubresourceLayers structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferImageCopy-imageSubresource-parameter)"}, {VALIDATION_ERROR_01800946, "The spec valid usage text states 'offset must be less than the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-offset-01187)"}, {VALIDATION_ERROR_01800948, "The spec valid usage text states 'If size is not equal to VK_WHOLE_SIZE, size must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-size-01188)"}, {VALIDATION_ERROR_0180094a, "The spec valid usage text states 'If size is not equal to VK_WHOLE_SIZE, size must be less than or equal to than the size of buffer minus offset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-size-01189)"}, {VALIDATION_ERROR_0180094c, "The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, srcQueueFamilyIndex and dstQueueFamilyIndex must both be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01190)"}, {VALIDATION_ERROR_0180094e, "The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, at least one of srcQueueFamilyIndex and dstQueueFamilyIndex must be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01191)"}, - {VALIDATION_ERROR_01800950, "The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, srcQueueFamilyIndex and dstQueueFamilyIndex must either both be VK_QUEUE_FAMILY_IGNORED, or both be a valid queue family (see Queue Family Properties)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01192)"}, + {VALIDATION_ERROR_01800950, "The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, srcQueueFamilyIndex and dstQueueFamilyIndex must either both be VK_QUEUE_FAMILY_IGNORED, or both be a valid queue family (see devsandqueues-queueprops)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01192)"}, {VALIDATION_ERROR_01800952, "The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, dstQueueFamilyIndex must also be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01193)"}, - {VALIDATION_ERROR_01800954, "The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or VK_QUEUE_FAMILY_EXTERNAL_KHR (see Queue Family Properties)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01194)"}, - {VALIDATION_ERROR_01800956, "The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and dstQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or VK_QUEUE_FAMILY_EXTERNAL_KHR (see Queue Family Properties)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01195)"}, {VALIDATION_ERROR_01800958, "The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, and srcQueueFamilyIndex and dstQueueFamilyIndex are not VK_QUEUE_FAMILY_IGNORED, at least one of them must be the same as the family of the queue that will execute this barrier' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01196)"}, - {VALIDATION_ERROR_01800ac8, "The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, and one of srcQueueFamilyIndex and dstQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, the other must be VK_QUEUE_FAMILY_IGNORED or VK_QUEUE_FAMILY_EXTERNAL_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01380)"}, + {VALIDATION_ERROR_01800dc6, "The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, and one of srcQueueFamilyIndex and dstQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, the other must be VK_QUEUE_FAMILY_IGNORED or a special queue family reserved for external memory ownership transfers, as described in synchronization-queue-transfers.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01763)"}, + {VALIDATION_ERROR_01800dc8, "The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in synchronization-queue-transfers.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01764)"}, + {VALIDATION_ERROR_01800dca, "The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and dstQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in synchronization-queue-transfers.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01765)"}, + {VALIDATION_ERROR_01800f16, "The spec valid usage text states 'If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01931)"}, {VALIDATION_ERROR_01801a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-parameter)"}, {VALIDATION_ERROR_01806801, "The spec valid usage text states 'dstAccessMask must be a valid combination of VkAccessFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-dstAccessMask-parameter)"}, {VALIDATION_ERROR_0181c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-pNext-pNext)"}, @@ -3958,34 +4151,36 @@ {VALIDATION_ERROR_01c0002a, "The spec valid usage text states 'clearValue must be a valid VkClearValue union' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkClearAttachment-clearValue-00021)"}, {VALIDATION_ERROR_01c00c01, "The spec valid usage text states 'aspectMask must be a valid combination of VkImageAspectFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkClearAttachment-aspectMask-parameter)"}, {VALIDATION_ERROR_01c00c03, "The spec valid usage text states 'aspectMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkClearAttachment-aspectMask-requiredbitmask)"}, - {VALIDATION_ERROR_01e0002c, "The spec valid usage text states 'depth must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkClearDepthStencilValue-depth-00022)"}, + {VALIDATION_ERROR_01c00e22, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then the attachment to be cleared must not be a protected image.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkClearAttachment-commandBuffer-01809)"}, + {VALIDATION_ERROR_01c00e24, "The spec valid usage text states 'If commandBuffer is a protected command buffer, then the attachment to be cleared must not be an unprotected image.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkClearAttachment-commandBuffer-01810)"}, + {VALIDATION_ERROR_01e0002c, "The spec valid usage text states 'Unless the VK_EXT_depth_range_unrestricted extension is enabled depth must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkClearDepthStencilValue-depth-00022)"}, {VALIDATION_ERROR_0200002e, "The spec valid usage text states 'depthStencil must be a valid VkClearDepthStencilValue structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkClearValue-depthStencil-00023)"}, - {VALIDATION_ERROR_02200009, "The spec valid usage text states 'Each of indirectCommandsLayout, objectTable, sequencesCountBuffer, sequencesIndexBuffer, and targetCommandBuffer that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-commonparent)"}, - {VALIDATION_ERROR_02200a66, "The spec valid usage text states 'The provided objectTable must include all objects referenced by the generation process.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-objectTable-01331)"}, - {VALIDATION_ERROR_02200a68, "The spec valid usage text states 'indirectCommandsTokenCount must match the indirectCommandsLayout's tokenCount.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsTokenCount-01332)"}, - {VALIDATION_ERROR_02200a6a, "The spec valid usage text states 'The tokenType member of each entry in the pIndirectCommandsTokens array must match the values used at creation time of indirectCommandsLayout' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-tokenType-01333)"}, - {VALIDATION_ERROR_02200a6c, "The spec valid usage text states 'If targetCommandBuffer is provided, it must have reserved command space.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01334)"}, - {VALIDATION_ERROR_02200a6e, "The spec valid usage text states 'If targetCommandBuffer is provided, the objectTable must match the reservation's objectTable and must have had all referenced objects registered at reservation time.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01335)"}, - {VALIDATION_ERROR_02200a70, "The spec valid usage text states 'If targetCommandBuffer is provided, the indirectCommandsLayout must match the reservation's indirectCommandsLayout.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01336)"}, - {VALIDATION_ERROR_02200a72, "The spec valid usage text states 'If targetCommandBuffer is provided, the maxSequencesCount must not exceed the reservation's maxSequencesCount.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01337)"}, - {VALIDATION_ERROR_02200a74, "The spec valid usage text states 'If sequencesCountBuffer is used, its usage flag must have VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-01338)"}, - {VALIDATION_ERROR_02200a76, "The spec valid usage text states 'If sequencesCountBuffer is used, sequencesCountOffset must be aligned to VkDeviceGeneratedCommandsLimitsNVX::minSequenceCountBufferOffsetAlignment.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-01339)"}, - {VALIDATION_ERROR_02200a78, "The spec valid usage text states 'If sequencesIndexBuffer is used, its usage flag must have VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-01340)"}, - {VALIDATION_ERROR_02200a7a, "The spec valid usage text states 'If sequencesIndexBuffer is used, sequencesIndexOffset must be aligned to VkDeviceGeneratedCommandsLimitsNVX::minSequenceIndexBufferOffsetAlignment.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-01341)"}, - {VALIDATION_ERROR_0220b401, "The spec valid usage text states 'indirectCommandsLayout must be a valid VkIndirectCommandsLayoutNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsLayout-parameter)"}, - {VALIDATION_ERROR_0220b61b, "The spec valid usage text states 'indirectCommandsTokenCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsTokenCount-arraylength)"}, - {VALIDATION_ERROR_0220d801, "The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-objectTable-parameter)"}, - {VALIDATION_ERROR_02219401, "The spec valid usage text states 'pIndirectCommandsTokens must be a valid pointer to an array of indirectCommandsTokenCount valid VkIndirectCommandsTokenNVX structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-pIndirectCommandsTokens-parameter)"}, - {VALIDATION_ERROR_0221c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-pNext-pNext)"}, - {VALIDATION_ERROR_0222b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sType-sType)"}, - {VALIDATION_ERROR_0222ba01, "The spec valid usage text states 'If sequencesCountBuffer is not VK_NULL_HANDLE, sequencesCountBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-parameter)"}, - {VALIDATION_ERROR_0222bc01, "The spec valid usage text states 'If sequencesIndexBuffer is not VK_NULL_HANDLE, sequencesIndexBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-parameter)"}, - {VALIDATION_ERROR_0222f601, "The spec valid usage text states 'If targetCommandBuffer is not NULL, targetCommandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-parameter)"}, - {VALIDATION_ERROR_02400009, "The spec valid usage text states 'Both of indirectCommandsLayout, and objectTable must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-commonparent)"}, - {VALIDATION_ERROR_0240b401, "The spec valid usage text states 'indirectCommandsLayout must be a valid VkIndirectCommandsLayoutNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-indirectCommandsLayout-parameter)"}, - {VALIDATION_ERROR_0240d801, "The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-objectTable-parameter)"}, - {VALIDATION_ERROR_0241c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-pNext-pNext)"}, - {VALIDATION_ERROR_0242b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-sType-sType)"}, + {VALIDATION_ERROR_02200009, "The spec valid usage text states 'Each of indirectCommandsLayout, objectTable, sequencesCountBuffer, sequencesIndexBuffer, and targetCommandBuffer that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-commonparent)"}, + {VALIDATION_ERROR_02200a66, "The spec valid usage text states 'The provided objectTable must include all objects referenced by the generation process.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-objectTable-01331)"}, + {VALIDATION_ERROR_02200a68, "The spec valid usage text states 'indirectCommandsTokenCount must match the indirectCommandsLayout's tokenCount.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsTokenCount-01332)"}, + {VALIDATION_ERROR_02200a6a, "The spec valid usage text states 'The tokenType member of each entry in the pIndirectCommandsTokens array must match the values used at creation time of indirectCommandsLayout' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-tokenType-01333)"}, + {VALIDATION_ERROR_02200a6c, "The spec valid usage text states 'If targetCommandBuffer is provided, it must have reserved command space.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01334)"}, + {VALIDATION_ERROR_02200a6e, "The spec valid usage text states 'If targetCommandBuffer is provided, the objectTable must match the reservation's objectTable and must have had all referenced objects registered at reservation time.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01335)"}, + {VALIDATION_ERROR_02200a70, "The spec valid usage text states 'If targetCommandBuffer is provided, the indirectCommandsLayout must match the reservation's indirectCommandsLayout.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01336)"}, + {VALIDATION_ERROR_02200a72, "The spec valid usage text states 'If targetCommandBuffer is provided, the maxSequencesCount must not exceed the reservation's maxSequencesCount.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01337)"}, + {VALIDATION_ERROR_02200a74, "The spec valid usage text states 'If sequencesCountBuffer is used, its usage flag must have VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-01338)"}, + {VALIDATION_ERROR_02200a76, "The spec valid usage text states 'If sequencesCountBuffer is used, sequencesCountOffset must be aligned to VkDeviceGeneratedCommandsLimitsNVX::minSequenceCountBufferOffsetAlignment.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-01339)"}, + {VALIDATION_ERROR_02200a78, "The spec valid usage text states 'If sequencesIndexBuffer is used, its usage flag must have VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-01340)"}, + {VALIDATION_ERROR_02200a7a, "The spec valid usage text states 'If sequencesIndexBuffer is used, sequencesIndexOffset must be aligned to VkDeviceGeneratedCommandsLimitsNVX::minSequenceIndexBufferOffsetAlignment.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-01341)"}, + {VALIDATION_ERROR_0220b401, "The spec valid usage text states 'indirectCommandsLayout must be a valid VkIndirectCommandsLayoutNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsLayout-parameter)"}, + {VALIDATION_ERROR_0220b61b, "The spec valid usage text states 'indirectCommandsTokenCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsTokenCount-arraylength)"}, + {VALIDATION_ERROR_0220d801, "The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-objectTable-parameter)"}, + {VALIDATION_ERROR_02219401, "The spec valid usage text states 'pIndirectCommandsTokens must be a valid pointer to an array of indirectCommandsTokenCount valid VkIndirectCommandsTokenNVX structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-pIndirectCommandsTokens-parameter)"}, + {VALIDATION_ERROR_0221c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-pNext-pNext)"}, + {VALIDATION_ERROR_0222b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sType-sType)"}, + {VALIDATION_ERROR_0222ba01, "The spec valid usage text states 'If sequencesCountBuffer is not VK_NULL_HANDLE, sequencesCountBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-parameter)"}, + {VALIDATION_ERROR_0222bc01, "The spec valid usage text states 'If sequencesIndexBuffer is not VK_NULL_HANDLE, sequencesIndexBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-parameter)"}, + {VALIDATION_ERROR_0222f601, "The spec valid usage text states 'If targetCommandBuffer is not NULL, targetCommandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-parameter)"}, + {VALIDATION_ERROR_02400009, "The spec valid usage text states 'Both of indirectCommandsLayout, and objectTable must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-commonparent)"}, + {VALIDATION_ERROR_0240b401, "The spec valid usage text states 'indirectCommandsLayout must be a valid VkIndirectCommandsLayoutNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-indirectCommandsLayout-parameter)"}, + {VALIDATION_ERROR_0240d801, "The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-objectTable-parameter)"}, + {VALIDATION_ERROR_0241c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-pNext-pNext)"}, + {VALIDATION_ERROR_0242b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCmdReserveSpaceForCommandsInfoNVX-sType-sType)"}, {VALIDATION_ERROR_02600058, "The spec valid usage text states 'commandBufferCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferAllocateInfo-commandBufferCount-00044)"}, {VALIDATION_ERROR_02602801, "The spec valid usage text states 'commandPool must be a valid VkCommandPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferAllocateInfo-commandPool-parameter)"}, {VALIDATION_ERROR_0260c001, "The spec valid usage text states 'level must be a valid VkCommandBufferLevel value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferAllocateInfo-level-parameter)"}, @@ -3995,7 +4190,7 @@ {VALIDATION_ERROR_0280006c, "The spec valid usage text states 'If flags contains VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, the subpass member of pInheritanceInfo must be a valid subpass index within the renderPass member of pInheritanceInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferBeginInfo-flags-00054)"}, {VALIDATION_ERROR_0280006e, "The spec valid usage text states 'If flags contains VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, the framebuffer member of pInheritanceInfo must be either VK_NULL_HANDLE, or a valid VkFramebuffer that is compatible with the renderPass member of pInheritanceInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferBeginInfo-flags-00055)"}, {VALIDATION_ERROR_02809001, "The spec valid usage text states 'flags must be a valid combination of VkCommandBufferUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferBeginInfo-flags-parameter)"}, - {VALIDATION_ERROR_0281c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkDeviceGroupCommandBufferBeginInfoKHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferBeginInfo-pNext-pNext)"}, + {VALIDATION_ERROR_0281c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkDeviceGroupCommandBufferBeginInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferBeginInfo-pNext-pNext)"}, {VALIDATION_ERROR_0282b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferBeginInfo-sType-sType)"}, {VALIDATION_ERROR_02a00009, "The spec valid usage text states 'Both of framebuffer, and renderPass that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferInheritanceInfo-commonparent)"}, {VALIDATION_ERROR_02a00070, "The spec valid usage text states 'If the inherited queries feature is not enabled, occlusionQueryEnable must be VK_FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCommandBufferInheritanceInfo-occlusionQueryEnable-00056)"}, @@ -4027,58 +4222,58 @@ {VALIDATION_ERROR_0302d801, "The spec valid usage text states 'stage must be a valid VkPipelineShaderStageCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkComputePipelineCreateInfo-stage-parameter)"}, {VALIDATION_ERROR_03200009, "The spec valid usage text states 'Both of dstSet, and srcSet must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-commonparent)"}, {VALIDATION_ERROR_032002b2, "The spec valid usage text states 'srcBinding must be a valid binding within srcSet' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-srcBinding-00345)"}, - {VALIDATION_ERROR_032002b4, "The spec valid usage text states 'The sum of srcArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding specified by srcBinding, and all applicable consecutive bindings, as described by consecutive binding updates' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-srcArrayElement-00346)"}, + {VALIDATION_ERROR_032002b4, "The spec valid usage text states 'The sum of srcArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding specified by srcBinding, and all applicable consecutive bindings, as described by descriptorsets-updates-consecutive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-srcArrayElement-00346)"}, {VALIDATION_ERROR_032002b6, "The spec valid usage text states 'dstBinding must be a valid binding within dstSet' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-dstBinding-00347)"}, - {VALIDATION_ERROR_032002b8, "The spec valid usage text states 'The sum of dstArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding specified by dstBinding, and all applicable consecutive bindings, as described by consecutive binding updates' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-dstArrayElement-00348)"}, - {VALIDATION_ERROR_032002ba, "The spec valid usage text states 'If srcSet is equal to dstSet, then the source and destination ranges of descriptors must not overlap, where the ranges may include array elements from consecutive bindings as described by consecutive binding updates' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-srcSet-00349)"}, + {VALIDATION_ERROR_032002b8, "The spec valid usage text states 'The sum of dstArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding specified by dstBinding, and all applicable consecutive bindings, as described by descriptorsets-updates-consecutive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-dstArrayElement-00348)"}, + {VALIDATION_ERROR_032002ba, "The spec valid usage text states 'If srcSet is equal to dstSet, then the source and destination ranges of descriptors must not overlap, where the ranges may include array elements from consecutive bindings as described by descriptorsets-updates-consecutive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-srcSet-00349)"}, + {VALIDATION_ERROR_03200efc, "The spec valid usage text states 'If srcSet's layout was created with the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT flag set, then dstSet's layout must also have been created with the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT flag set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCopyDescriptorSet-srcSet-01918)"}, + {VALIDATION_ERROR_03200efe, "The spec valid usage text states 'If srcSet's layout was created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT flag set, then dstSet's layout must also have been created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT flag set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCopyDescriptorSet-srcSet-01919)"}, + {VALIDATION_ERROR_03200f00, "The spec valid usage text states 'If the descriptor pool from which srcSet was allocated was created with the VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag set, then the descriptor pool from which dstSet was allocated must also have been created with the VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCopyDescriptorSet-srcSet-01920)"}, + {VALIDATION_ERROR_03200f02, "The spec valid usage text states 'If the descriptor pool from which srcSet was allocated was created without the VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag set, then the descriptor pool from which dstSet was allocated must also have been created without the VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkCopyDescriptorSet-srcSet-01921)"}, {VALIDATION_ERROR_03207601, "The spec valid usage text states 'dstSet must be a valid VkDescriptorSet handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-dstSet-parameter)"}, {VALIDATION_ERROR_0321c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-pNext-pNext)"}, {VALIDATION_ERROR_0322b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-sType-sType)"}, {VALIDATION_ERROR_0322d201, "The spec valid usage text states 'srcSet must be a valid VkDescriptorSet handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkCopyDescriptorSet-srcSet-parameter)"}, - {VALIDATION_ERROR_0340009e, "The spec valid usage text states 'waitSemaphoreValuesCount must be the same value as VkSubmitInfo::waitSemaphoreCount, where VkSubmitInfo is in the pNext chain of this VkD3D12FenceSubmitInfoKHR structure.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-waitSemaphoreValuesCount-00079)"}, - {VALIDATION_ERROR_034000a0, "The spec valid usage text states 'signalSemaphoreValuesCount must be the same value as VkSubmitInfo::signalSemaphoreCount, where VkSubmitInfo is in the pNext chain of this VkD3D12FenceSubmitInfoKHR structure.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-signalSemaphoreValuesCount-00080)"}, - {VALIDATION_ERROR_03423201, "The spec valid usage text states 'If signalSemaphoreValuesCount is not 0, and pSignalSemaphoreValues is not NULL, pSignalSemaphoreValues must be a valid pointer to an array of signalSemaphoreValuesCount uint64_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-pSignalSemaphoreValues-parameter)"}, - {VALIDATION_ERROR_03427401, "The spec valid usage text states 'If waitSemaphoreValuesCount is not 0, and pWaitSemaphoreValues is not NULL, pWaitSemaphoreValues must be a valid pointer to an array of waitSemaphoreValuesCount uint64_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-pWaitSemaphoreValues-parameter)"}, - {VALIDATION_ERROR_0342b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_0361a801, "The spec valid usage text states 'pMarkerName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerMarkerInfoEXT-pMarkerName-parameter)"}, - {VALIDATION_ERROR_0361c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerMarkerInfoEXT-pNext-pNext)"}, - {VALIDATION_ERROR_0362b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerMarkerInfoEXT-sType-sType)"}, - {VALIDATION_ERROR_03800ba4, "The spec valid usage text states 'objectType must not be VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-objectType-01490)"}, - {VALIDATION_ERROR_03800ba6, "The spec valid usage text states 'object must not be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-object-01491)"}, - {VALIDATION_ERROR_03800ba8, "The spec valid usage text states 'object must be a Vulkan object of the type associated with objectType as defined in VkDebugReportObjectTypeEXT and Vulkan Handle Relationship.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-object-01492)"}, - {VALIDATION_ERROR_0380da01, "The spec valid usage text states 'objectType must be a valid VkDebugReportObjectTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-objectType-parameter)"}, - {VALIDATION_ERROR_0381c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-pNext-pNext)"}, - {VALIDATION_ERROR_0381ce01, "The spec valid usage text states 'pObjectName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-pObjectName-parameter)"}, - {VALIDATION_ERROR_0382b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-sType-sType)"}, - {VALIDATION_ERROR_03a00baa, "The spec valid usage text states 'objectType must not be VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-objectType-01493)"}, - {VALIDATION_ERROR_03a00bac, "The spec valid usage text states 'object must not be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-object-01494)"}, - {VALIDATION_ERROR_03a00bae, "The spec valid usage text states 'object must be a Vulkan object of the type associated with objectType as defined in VkDebugReportObjectTypeEXT and Vulkan Handle Relationship.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-object-01495)"}, - {VALIDATION_ERROR_03a0da01, "The spec valid usage text states 'objectType must be a valid VkDebugReportObjectTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-objectType-parameter)"}, - {VALIDATION_ERROR_03a1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-pNext-pNext)"}, - {VALIDATION_ERROR_03a25a01, "The spec valid usage text states 'pTag must be a valid pointer to an array of tagSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-pTag-parameter)"}, - {VALIDATION_ERROR_03a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-sType-sType)"}, - {VALIDATION_ERROR_03a2f41b, "The spec valid usage text states 'tagSize must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-tagSize-arraylength)"}, - {VALIDATION_ERROR_03c00ad2, "The spec valid usage text states 'pfnCallback must be a valid PFN_vkDebugReportCallbackEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugReportCallbackCreateInfoEXT-pfnCallback-01385)"}, - {VALIDATION_ERROR_03c00bb0, "The spec valid usage text states 'object must be a Vulkan object or VK_NULL_HANDLE.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugReportCallbackCreateInfoEXT-object-01496)"}, - {VALIDATION_ERROR_03c00bb2, "The spec valid usage text states 'If objectType is not VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT and object is not VK_NULL_HANDLE, object must be a Vulkan object of the corresponding type associated with objectType as defined in VkDebugReportObjectTypeEXT and Vulkan Handle Relationship.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugReportCallbackCreateInfoEXT-objectType-01497)"}, - {VALIDATION_ERROR_03c09001, "The spec valid usage text states 'flags must be a valid combination of VkDebugReportFlagBitsEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugReportCallbackCreateInfoEXT-flags-parameter)"}, - {VALIDATION_ERROR_03c1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugReportCallbackCreateInfoEXT-pNext-pNext)"}, - {VALIDATION_ERROR_03c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDebugReportCallbackCreateInfoEXT-sType-sType)"}, - {VALIDATION_ERROR_03e00732, "The spec valid usage text states 'If dedicatedAllocation is VK_TRUE, VkBufferCreateInfo::flags must not include VK_BUFFER_CREATE_SPARSE_BINDING_BIT, VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT, or VK_BUFFER_CREATE_SPARSE_ALIASED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationBufferCreateInfoNV-dedicatedAllocation-00921)"}, - {VALIDATION_ERROR_03e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationBufferCreateInfoNV-sType-sType)"}, - {VALIDATION_ERROR_040007c4, "The spec valid usage text states 'If dedicatedAllocation is VK_TRUE, VkImageCreateInfo::flags must not include VK_IMAGE_CREATE_SPARSE_BINDING_BIT, VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, or VK_IMAGE_CREATE_SPARSE_ALIASED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationImageCreateInfoNV-dedicatedAllocation-00994)"}, - {VALIDATION_ERROR_0402b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationImageCreateInfoNV-sType-sType)"}, - {VALIDATION_ERROR_04200009, "The spec valid usage text states 'Both of buffer, and image that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-commonparent)"}, - {VALIDATION_ERROR_04200512, "The spec valid usage text states 'At least one of image and buffer must be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00649)"}, - {VALIDATION_ERROR_04200514, "The spec valid usage text states 'If image is not VK_NULL_HANDLE, the image must have been created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00650)"}, - {VALIDATION_ERROR_04200516, "The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, the buffer must have been created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00651)"}, - {VALIDATION_ERROR_04200518, "The spec valid usage text states 'If image is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00652)"}, - {VALIDATION_ERROR_0420051a, "The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00653)"}, + {VALIDATION_ERROR_0340009e, "The spec valid usage text states 'waitSemaphoreValuesCount must be the same value as VkSubmitInfo::waitSemaphoreCount, where VkSubmitInfo is in the pNext chain of this VkD3D12FenceSubmitInfoKHR structure.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-waitSemaphoreValuesCount-00079)"}, + {VALIDATION_ERROR_034000a0, "The spec valid usage text states 'signalSemaphoreValuesCount must be the same value as VkSubmitInfo::signalSemaphoreCount, where VkSubmitInfo is in the pNext chain of this VkD3D12FenceSubmitInfoKHR structure.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-signalSemaphoreValuesCount-00080)"}, + {VALIDATION_ERROR_03423201, "The spec valid usage text states 'If signalSemaphoreValuesCount is not 0, and pSignalSemaphoreValues is not NULL, pSignalSemaphoreValues must be a valid pointer to an array of signalSemaphoreValuesCount uint64_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-pSignalSemaphoreValues-parameter)"}, + {VALIDATION_ERROR_03427401, "The spec valid usage text states 'If waitSemaphoreValuesCount is not 0, and pWaitSemaphoreValues is not NULL, pWaitSemaphoreValues must be a valid pointer to an array of waitSemaphoreValuesCount uint64_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-pWaitSemaphoreValues-parameter)"}, + {VALIDATION_ERROR_0342b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkD3D12FenceSubmitInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_0361a801, "The spec valid usage text states 'pMarkerName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerMarkerInfoEXT-pMarkerName-parameter)"}, + {VALIDATION_ERROR_0361c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerMarkerInfoEXT-pNext-pNext)"}, + {VALIDATION_ERROR_0362b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerMarkerInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_03800ba4, "The spec valid usage text states 'objectType must not be VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-objectType-01490)"}, + {VALIDATION_ERROR_03800ba6, "The spec valid usage text states 'object must not be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-object-01491)"}, + {VALIDATION_ERROR_03800ba8, "The spec valid usage text states 'object must be a Vulkan object of the type associated with objectType as defined in debug-report-object-types.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-object-01492)"}, + {VALIDATION_ERROR_0380da01, "The spec valid usage text states 'objectType must be a valid VkDebugReportObjectTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-objectType-parameter)"}, + {VALIDATION_ERROR_0381c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-pNext-pNext)"}, + {VALIDATION_ERROR_0381ce01, "The spec valid usage text states 'pObjectName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-pObjectName-parameter)"}, + {VALIDATION_ERROR_0382b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectNameInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_03a00baa, "The spec valid usage text states 'objectType must not be VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-objectType-01493)"}, + {VALIDATION_ERROR_03a00bac, "The spec valid usage text states 'object must not be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-object-01494)"}, + {VALIDATION_ERROR_03a00bae, "The spec valid usage text states 'object must be a Vulkan object of the type associated with objectType as defined in debug-report-object-types.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-object-01495)"}, + {VALIDATION_ERROR_03a0da01, "The spec valid usage text states 'objectType must be a valid VkDebugReportObjectTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-objectType-parameter)"}, + {VALIDATION_ERROR_03a1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-pNext-pNext)"}, + {VALIDATION_ERROR_03a25a01, "The spec valid usage text states 'pTag must be a valid pointer to an array of tagSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-pTag-parameter)"}, + {VALIDATION_ERROR_03a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_03a2f41b, "The spec valid usage text states 'tagSize must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugMarkerObjectTagInfoEXT-tagSize-arraylength)"}, + {VALIDATION_ERROR_03c00ad2, "The spec valid usage text states 'pfnCallback must be a valid PFN_vkDebugReportCallbackEXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugReportCallbackCreateInfoEXT-pfnCallback-01385)"}, + {VALIDATION_ERROR_03c09001, "The spec valid usage text states 'flags must be a valid combination of VkDebugReportFlagBitsEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugReportCallbackCreateInfoEXT-flags-parameter)"}, + {VALIDATION_ERROR_03c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugReportCallbackCreateInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_03e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationBufferCreateInfoNV-sType-sType)"}, + {VALIDATION_ERROR_040007c4, "The spec valid usage text states 'If dedicatedAllocation is VK_TRUE, VkImageCreateInfo::flags must not include VK_IMAGE_CREATE_SPARSE_BINDING_BIT, VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, or VK_IMAGE_CREATE_SPARSE_ALIASED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationImageCreateInfoNV-dedicatedAllocation-00994)"}, + {VALIDATION_ERROR_0402b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationImageCreateInfoNV-sType-sType)"}, + {VALIDATION_ERROR_04200009, "The spec valid usage text states 'Both of buffer, and image that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-commonparent)"}, + {VALIDATION_ERROR_04200512, "The spec valid usage text states 'At least one of image and buffer must be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00649)"}, + {VALIDATION_ERROR_04200514, "The spec valid usage text states 'If image is not VK_NULL_HANDLE, the image must have been created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00650)"}, + {VALIDATION_ERROR_04200516, "The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, the buffer must have been created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00651)"}, + {VALIDATION_ERROR_04200518, "The spec valid usage text states 'If image is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00652)"}, + {VALIDATION_ERROR_0420051a, "The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00653)"}, {VALIDATION_ERROR_0420051c, "The spec valid usage text states 'If image is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation, the memory being imported must also be a dedicated image allocation and image must be identical to the image associated with the imported memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00654)"}, {VALIDATION_ERROR_0420051e, "The spec valid usage text states 'If buffer is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation, the memory being imported must also be a dedicated buffer allocation and buffer must be identical to the buffer associated with the imported memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00655)"}, - {VALIDATION_ERROR_04201a01, "The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-parameter)"}, - {VALIDATION_ERROR_0420a001, "The spec valid usage text states 'If image is not VK_NULL_HANDLE, image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-parameter)"}, - {VALIDATION_ERROR_0422b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-sType-sType)"}, + {VALIDATION_ERROR_04201a01, "The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-parameter)"}, + {VALIDATION_ERROR_0420a001, "The spec valid usage text states 'If image is not VK_NULL_HANDLE, image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-parameter)"}, + {VALIDATION_ERROR_0422b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDedicatedAllocationMemoryAllocateInfoNV-sType-sType)"}, {VALIDATION_ERROR_044002a8, "The spec valid usage text states 'offset must be less than the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorBufferInfo-offset-00340)"}, {VALIDATION_ERROR_044002aa, "The spec valid usage text states 'If range is not equal to VK_WHOLE_SIZE, range must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorBufferInfo-range-00341)"}, {VALIDATION_ERROR_044002ac, "The spec valid usage text states 'If range is not equal to VK_WHOLE_SIZE, range must be less than or equal to the size of buffer minus offset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorBufferInfo-range-00342)"}, @@ -4087,7 +4282,7 @@ {VALIDATION_ERROR_046002ae, "The spec valid usage text states 'imageView must not be 2D or 2D array image view created from a 3D image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorImageInfo-imageView-00343)"}, {VALIDATION_ERROR_046002b0, "The spec valid usage text states 'imageLayout must match the actual VkImageLayout of each subresource accessible from imageView at the time this descriptor is accessed' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorImageInfo-imageLayout-00344)"}, {VALIDATION_ERROR_04600c36, "The spec valid usage text states 'If sampler is used and enables sampler Y'CBCR conversion:' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorImageInfo-sampler-01563)"}, - {VALIDATION_ERROR_04600c38, "The spec valid usage text states 'If sampler is used and does not enable sampler Y'CBCR conversion and the VkFormat of the image is a multi-planar format, the image must have been created with VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, and the aspectMask of the imageView must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR or (for three-plane formats only) VK_IMAGE_ASPECT_PLANE_2_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorImageInfo-sampler-01564)"}, + {VALIDATION_ERROR_04600c38, "The spec valid usage text states 'If sampler is used and does not enable sampler Y'CBCR conversion and the VkFormat of the image is a multi-planar format, the image must have been created with VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, and the aspectMask of the imageView must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT or (for three-plane formats only) VK_IMAGE_ASPECT_PLANE_2_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorImageInfo-sampler-01564)"}, {VALIDATION_ERROR_0480025a, "The spec valid usage text states 'maxSets must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolCreateInfo-maxSets-00301)"}, {VALIDATION_ERROR_04809001, "The spec valid usage text states 'flags must be a valid combination of VkDescriptorPoolCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolCreateInfo-flags-parameter)"}, {VALIDATION_ERROR_0481c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorPoolCreateInfo-pNext-pNext)"}, @@ -4100,9 +4295,10 @@ {VALIDATION_ERROR_04c00264, "The spec valid usage text states 'descriptorSetCount must not be greater than the number of sets that are currently available for allocation in descriptorPool' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-00306)"}, {VALIDATION_ERROR_04c00266, "The spec valid usage text states 'descriptorPool must have enough free descriptor capacity remaining to allocate the descriptor sets of the specified layouts' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-descriptorPool-00307)"}, {VALIDATION_ERROR_04c00268, "The spec valid usage text states 'Each element of pSetLayouts must not have been created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-pSetLayouts-00308)"}, + {VALIDATION_ERROR_04c017c8, "The spec valid usage text states 'If any element of pSetLayouts was created with the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set, descriptorPool must have been created with the VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-pSetLayouts-03044)"}, {VALIDATION_ERROR_04c04601, "The spec valid usage text states 'descriptorPool must be a valid VkDescriptorPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-descriptorPool-parameter)"}, {VALIDATION_ERROR_04c04a1b, "The spec valid usage text states 'descriptorSetCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-arraylength)"}, - {VALIDATION_ERROR_04c1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-pNext-pNext)"}, + {VALIDATION_ERROR_04c1c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkDescriptorSetVariableDescriptorCountAllocateInfoEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-pNext-pNext)"}, {VALIDATION_ERROR_04c22c01, "The spec valid usage text states 'pSetLayouts must be a valid pointer to an array of descriptorSetCount valid VkDescriptorSetLayout handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-pSetLayouts-parameter)"}, {VALIDATION_ERROR_04c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-sType-sType)"}, {VALIDATION_ERROR_04e00234, "The spec valid usage text states 'If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLER or VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and descriptorCount is not 0 and pImmutableSamplers is not NULL, pImmutableSamplers must be a valid pointer to an array of descriptorCount valid VkSampler handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutBinding-descriptorType-00282)"}, @@ -4112,89 +4308,90 @@ {VALIDATION_ERROR_0500022e, "The spec valid usage text states 'The VkDescriptorSetLayoutBinding::binding members of the elements of the pBindings array must each have different values.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-binding-00279)"}, {VALIDATION_ERROR_05000230, "The spec valid usage text states 'If flags contains VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then all elements of pBindings must not have a descriptorType of VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-flags-00280)"}, {VALIDATION_ERROR_05000232, "The spec valid usage text states 'If flags contains VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then the total number of elements of all bindings must be less than or equal to VkPhysicalDevicePushDescriptorPropertiesKHR::maxPushDescriptors' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-flags-00281)"}, + {VALIDATION_ERROR_05001770, "The spec valid usage text states 'If any binding has the VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT bit set, flags must include VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-flags-03000)"}, + {VALIDATION_ERROR_05001772, "The spec valid usage text states 'If any binding has the VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT bit set, then all bindings must not have descriptorType of VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-descriptorType-03001)"}, {VALIDATION_ERROR_05009001, "The spec valid usage text states 'flags must be a valid combination of VkDescriptorSetLayoutCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-flags-parameter)"}, {VALIDATION_ERROR_0500fc01, "The spec valid usage text states 'If bindingCount is not 0, pBindings must be a valid pointer to an array of bindingCount valid VkDescriptorSetLayoutBinding structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-pBindings-parameter)"}, - {VALIDATION_ERROR_0501c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-pNext-pNext)"}, + {VALIDATION_ERROR_0501c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkDescriptorSetLayoutBindingFlagsCreateInfoEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-pNext-pNext)"}, {VALIDATION_ERROR_0502b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-sType-sType)"}, - {VALIDATION_ERROR_05200009, "The spec valid usage text states 'Both of descriptorSetLayout, and pipelineLayout that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-commonparent)"}, - {VALIDATION_ERROR_052002bc, "The spec valid usage text states 'If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR, descriptorSetLayout must be a valid VkDescriptorSetLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-templateType-00350)"}, - {VALIDATION_ERROR_052002be, "The spec valid usage text states 'If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, pipelineBindPoint must be a valid VkPipelineBindPoint value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-templateType-00351)"}, - {VALIDATION_ERROR_052002c0, "The spec valid usage text states 'If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, pipelineLayout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-templateType-00352)"}, - {VALIDATION_ERROR_052002c2, "The spec valid usage text states 'If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, set must be the unique set number in the pipeline layout that uses a descriptor set layout that was created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-templateType-00353)"}, - {VALIDATION_ERROR_05204c01, "The spec valid usage text states 'If descriptorSetLayout is not VK_NULL_HANDLE, descriptorSetLayout must be a valid VkDescriptorSetLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-descriptorSetLayout-parameter)"}, - {VALIDATION_ERROR_0520501b, "The spec valid usage text states 'descriptorUpdateEntryCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-descriptorUpdateEntryCount-arraylength)"}, - {VALIDATION_ERROR_05209005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-flags-zerobitmask)"}, - {VALIDATION_ERROR_05213201, "The spec valid usage text states 'pDescriptorUpdateEntries must be a valid pointer to an array of descriptorUpdateEntryCount valid VkDescriptorUpdateTemplateEntryKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-pDescriptorUpdateEntries-parameter)"}, - {VALIDATION_ERROR_0521c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_05227e01, "The spec valid usage text states 'If pipelineBindPoint is not 0, pipelineBindPoint must be a valid VkPipelineBindPoint value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-pipelineBindPoint-parameter)"}, - {VALIDATION_ERROR_05228201, "The spec valid usage text states 'If pipelineLayout is not VK_NULL_HANDLE, pipelineLayout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-pipelineLayout-parameter)"}, - {VALIDATION_ERROR_0522b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_0522f801, "The spec valid usage text states 'templateType must be a valid VkDescriptorUpdateTemplateTypeKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfoKHR-templateType-parameter)"}, - {VALIDATION_ERROR_054002c4, "The spec valid usage text states 'dstBinding must be a valid binding in the descriptor set layout implicitly specified when using a descriptor update template to update descriptors.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateEntryKHR-dstBinding-00354)"}, - {VALIDATION_ERROR_054002c6, "The spec valid usage text states 'dstArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding implicitly specified when using a descriptor update template to update descriptors, and all applicable consecutive bindings, as described by consecutive binding updates' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateEntryKHR-dstArrayElement-00355)"}, - {VALIDATION_ERROR_05404e01, "The spec valid usage text states 'descriptorType must be a valid VkDescriptorType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorUpdateTemplateEntryKHR-descriptorType-parameter)"}, - {VALIDATION_ERROR_056002e8, "The spec valid usage text states 'The queueFamilyIndex member of each element of pQueueCreateInfos must be unique within pQueueCreateInfos' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-queueFamilyIndex-00372)"}, - {VALIDATION_ERROR_056002ea, "The spec valid usage text states 'If the pNext chain includes a VkPhysicalDeviceFeatures2KHR structure, then pEnabledFeatures must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceCreateInfo-pNext-00373)"}, - {VALIDATION_ERROR_056002ec, "The spec valid usage text states 'ppEnabledExtensionNames must not contain both VK_KHR_maintenance1 and VK_AMD_negative_viewport_height' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-00374)"}, + {VALIDATION_ERROR_05200009, "The spec valid usage text states 'Both of descriptorSetLayout, and pipelineLayout that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-commonparent)"}, + {VALIDATION_ERROR_052002bc, "The spec valid usage text states 'If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, descriptorSetLayout must be a valid VkDescriptorSetLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00350)"}, + {VALIDATION_ERROR_052002be, "The spec valid usage text states 'If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, pipelineBindPoint must be a valid VkPipelineBindPoint value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00351)"}, + {VALIDATION_ERROR_052002c0, "The spec valid usage text states 'If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, pipelineLayout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00352)"}, + {VALIDATION_ERROR_052002c2, "The spec valid usage text states 'If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, set must be the unique set number in the pipeline layout that uses a descriptor set layout that was created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00353)"}, + {VALIDATION_ERROR_05204c01, "The spec valid usage text states 'If descriptorSetLayout is not VK_NULL_HANDLE, descriptorSetLayout must be a valid VkDescriptorSetLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-descriptorSetLayout-parameter)"}, + {VALIDATION_ERROR_0520501b, "The spec valid usage text states 'descriptorUpdateEntryCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-descriptorUpdateEntryCount-arraylength)"}, + {VALIDATION_ERROR_05209005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-flags-zerobitmask)"}, + {VALIDATION_ERROR_05213201, "The spec valid usage text states 'pDescriptorUpdateEntries must be a valid pointer to an array of descriptorUpdateEntryCount valid VkDescriptorUpdateTemplateEntry structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-pDescriptorUpdateEntries-parameter)"}, + {VALIDATION_ERROR_0521c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-pNext-pNext)"}, + {VALIDATION_ERROR_0522b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-sType-sType)"}, + {VALIDATION_ERROR_0522f801, "The spec valid usage text states 'templateType must be a valid VkDescriptorUpdateTemplateType value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-parameter)"}, + {VALIDATION_ERROR_054002c4, "The spec valid usage text states 'dstBinding must be a valid binding in the descriptor set layout implicitly specified when using a descriptor update template to update descriptors.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateEntry-dstBinding-00354)"}, + {VALIDATION_ERROR_054002c6, "The spec valid usage text states 'dstArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding implicitly specified when using a descriptor update template to update descriptors, and all applicable consecutive bindings, as described by descriptorsets-updates-consecutive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateEntry-dstArrayElement-00355)"}, + {VALIDATION_ERROR_05404e01, "The spec valid usage text states 'descriptorType must be a valid VkDescriptorType value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorUpdateTemplateEntry-descriptorType-parameter)"}, + {VALIDATION_ERROR_056002e8, "The spec valid usage text states '' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-queueFamilyIndex-00372)"}, + {VALIDATION_ERROR_056002ea, "The spec valid usage text states 'If the pNext chain includes a VkPhysicalDeviceFeatures2 structure, then pEnabledFeatures must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceCreateInfo-pNext-00373)"}, + {VALIDATION_ERROR_056002ec, "The spec valid usage text states 'ppEnabledExtensionNames must not contain both VK_KHR_maintenance1 and VK_AMD_negative_viewport_height' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-00374)"}, + {VALIDATION_ERROR_05600e60, "The spec valid usage text states 'ppEnabledExtensionNames must not contain VK_AMD_negative_viewport_height' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-01840)"}, {VALIDATION_ERROR_05609005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-flags-zerobitmask)"}, {VALIDATION_ERROR_05615a01, "The spec valid usage text states 'If pEnabledFeatures is not NULL, pEnabledFeatures must be a valid pointer to a valid VkPhysicalDeviceFeatures structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-pEnabledFeatures-parameter)"}, - {VALIDATION_ERROR_0561c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDeviceGroupDeviceCreateInfoKHX, VkPhysicalDevice16BitStorageFeaturesKHR, VkPhysicalDeviceFeatures2KHR, VkPhysicalDeviceMultiviewFeaturesKHX, VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR, or VkPhysicalDeviceVariablePointerFeaturesKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-pNext-pNext)"}, + {VALIDATION_ERROR_0561c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDeviceGroupDeviceCreateInfo, VkPhysicalDevice16BitStorageFeatures, VkPhysicalDeviceDescriptorIndexingFeaturesEXT, VkPhysicalDeviceFeatures2, VkPhysicalDeviceMultiviewFeatures, VkPhysicalDeviceProtectedMemoryFeatures, VkPhysicalDeviceSamplerYcbcrConversionFeatures, or VkPhysicalDeviceVariablePointerFeatures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-pNext-pNext)"}, {VALIDATION_ERROR_0561fe01, "The spec valid usage text states 'pQueueCreateInfos must be a valid pointer to an array of queueCreateInfoCount valid VkDeviceQueueCreateInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-pQueueCreateInfos-parameter)"}, {VALIDATION_ERROR_05628e01, "The spec valid usage text states 'If enabledExtensionCount is not 0, ppEnabledExtensionNames must be a valid pointer to an array of enabledExtensionCount null-terminated UTF-8 strings' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-parameter)"}, {VALIDATION_ERROR_05629001, "The spec valid usage text states 'If enabledLayerCount is not 0, ppEnabledLayerNames must be a valid pointer to an array of enabledLayerCount null-terminated UTF-8 strings' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-ppEnabledLayerNames-parameter)"}, {VALIDATION_ERROR_0562a01b, "The spec valid usage text states 'queueCreateInfoCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-queueCreateInfoCount-arraylength)"}, {VALIDATION_ERROR_0562b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-sType-sType)"}, {VALIDATION_ERROR_0562b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceCreateInfo-sType-unique)"}, - {VALIDATION_ERROR_05805801, "The spec valid usage text states 'deviceEvent must be a valid VkDeviceEventTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceEventInfoEXT-deviceEvent-parameter)"}, - {VALIDATION_ERROR_0581c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceEventInfoEXT-pNext-pNext)"}, - {VALIDATION_ERROR_0582b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceEventInfoEXT-sType-sType)"}, - {VALIDATION_ERROR_05a1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGeneratedCommandsFeaturesNVX-pNext-pNext)"}, - {VALIDATION_ERROR_05a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGeneratedCommandsFeaturesNVX-sType-sType)"}, - {VALIDATION_ERROR_05c1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGeneratedCommandsLimitsNVX-pNext-pNext)"}, - {VALIDATION_ERROR_05c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGeneratedCommandsLimitsNVX-sType-sType)"}, - {VALIDATION_ERROR_05e008bc, "The spec valid usage text states 'resourceDeviceIndex and memoryDeviceIndex must both be valid device indices.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupBindSparseInfoKHX-resourceDeviceIndex-01118)"}, - {VALIDATION_ERROR_05e008be, "The spec valid usage text states 'Each memory allocation bound in this batch must have allocated an instance for memoryDeviceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupBindSparseInfoKHX-memoryDeviceIndex-01119)"}, - {VALIDATION_ERROR_05e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupBindSparseInfoKHX-sType-sType)"}, - {VALIDATION_ERROR_060000d4, "The spec valid usage text states 'deviceMask must be a valid device mask value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupCommandBufferBeginInfoKHX-deviceMask-00106)"}, - {VALIDATION_ERROR_060000d6, "The spec valid usage text states 'deviceMask must not be zero' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupCommandBufferBeginInfoKHX-deviceMask-00107)"}, - {VALIDATION_ERROR_0602b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupCommandBufferBeginInfoKHX-sType-sType)"}, - {VALIDATION_ERROR_062002ee, "The spec valid usage text states 'Each element of pPhysicalDevices must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfoKHX-pPhysicalDevices-00375)"}, - {VALIDATION_ERROR_062002f0, "The spec valid usage text states 'All elements of pPhysicalDevices must be in the same device group as enumerated by vkEnumeratePhysicalDeviceGroupsKHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfoKHX-pPhysicalDevices-00376)"}, - {VALIDATION_ERROR_062002f2, "The spec valid usage text states 'If physicalDeviceCount is not 0, the physicalDevice parameter of vkCreateDevice must be an element of pPhysicalDevices.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfoKHX-physicalDeviceCount-00377)"}, - {VALIDATION_ERROR_0621dc01, "The spec valid usage text states 'If physicalDeviceCount is not 0, pPhysicalDevices must be a valid pointer to an array of physicalDeviceCount valid VkPhysicalDevice handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfoKHX-pPhysicalDevices-parameter)"}, - {VALIDATION_ERROR_0622b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfoKHX-sType-sType)"}, - {VALIDATION_ERROR_06400a22, "The spec valid usage text states 'swapchainCount must equal 0 or VkPresentInfoKHR::swapchainCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-swapchainCount-01297)"}, - {VALIDATION_ERROR_06400a24, "The spec valid usage text states 'If mode is VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHX, then each element of pDeviceMasks must have exactly one bit set, and the corresponding element of VkDeviceGroupPresentCapabilitiesKHX::presentMask must be non-zero' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-mode-01298)"}, - {VALIDATION_ERROR_06400a26, "The spec valid usage text states 'If mode is VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHX, then each element of pDeviceMasks must have exactly one bit set, and some physical device in the logical device must include that bit in its VkDeviceGroupPresentCapabilitiesKHX::presentMask.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-mode-01299)"}, - {VALIDATION_ERROR_06400a28, "The spec valid usage text states 'If mode is VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHX, then each element of pDeviceMasks must have a value for which all set bits are set in one of the elements of VkDeviceGroupPresentCapabilitiesKHX::presentMask' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-mode-01300)"}, - {VALIDATION_ERROR_06400a2a, "The spec valid usage text states 'If mode is VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHX, then for each bit set in each element of pDeviceMasks, the corresponding element of VkDeviceGroupPresentCapabilitiesKHX::presentMask must be non-zero' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-mode-01301)"}, - {VALIDATION_ERROR_06400a2c, "The spec valid usage text states 'The value of each element of pDeviceMasks must be equal to the device mask passed in VkAcquireNextImageInfoKHX::deviceMask when the image index was last acquired' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-pDeviceMasks-01302)"}, - {VALIDATION_ERROR_06400a2e, "The spec valid usage text states 'mode must have exactly one bit set, and that bit must have been included in VkDeviceGroupSwapchainCreateInfoKHX::modes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-mode-01303)"}, - {VALIDATION_ERROR_0640ce01, "The spec valid usage text states 'mode must be a valid VkDeviceGroupPresentModeFlagBitsKHX value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-mode-parameter)"}, - {VALIDATION_ERROR_06414001, "The spec valid usage text states 'If swapchainCount is not 0, pDeviceMasks must be a valid pointer to an array of swapchainCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-pDeviceMasks-parameter)"}, - {VALIDATION_ERROR_0642b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHX-sType-sType)"}, - {VALIDATION_ERROR_06600712, "The spec valid usage text states 'deviceMask must be a valid device mask value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfoKHX-deviceMask-00905)"}, - {VALIDATION_ERROR_06600714, "The spec valid usage text states 'deviceMask must not be zero' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfoKHX-deviceMask-00906)"}, - {VALIDATION_ERROR_06600716, "The spec valid usage text states 'deviceMask must be a subset of the command buffer's initial device mask' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfoKHX-deviceMask-00907)"}, - {VALIDATION_ERROR_06600718, "The spec valid usage text states 'deviceRenderAreaCount must either be zero or equal to the number of physical devices in the logical device.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfoKHX-deviceRenderAreaCount-00908)"}, - {VALIDATION_ERROR_06614201, "The spec valid usage text states 'If deviceRenderAreaCount is not 0, pDeviceRenderAreas must be a valid pointer to an array of deviceRenderAreaCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfoKHX-pDeviceRenderAreas-parameter)"}, - {VALIDATION_ERROR_0662b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfoKHX-sType-sType)"}, - {VALIDATION_ERROR_068000a4, "The spec valid usage text states 'waitSemaphoreCount must equal VkSubmitInfo::waitSemaphoreCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSubmitInfoKHX-waitSemaphoreCount-00082)"}, - {VALIDATION_ERROR_068000a6, "The spec valid usage text states 'commandBufferCount must equal VkSubmitInfo::commandBufferCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSubmitInfoKHX-commandBufferCount-00083)"}, - {VALIDATION_ERROR_068000a8, "The spec valid usage text states 'signalSemaphoreCount must equal VkSubmitInfo::signalSemaphoreCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSubmitInfoKHX-signalSemaphoreCount-00084)"}, - {VALIDATION_ERROR_068000aa, "The spec valid usage text states 'All elements of pWaitSemaphoreDeviceIndices and pSignalSemaphoreDeviceIndices must be valid device indices' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSubmitInfoKHX-pWaitSemaphoreDeviceIndices-00085)"}, - {VALIDATION_ERROR_068000ac, "The spec valid usage text states 'All elements of pCommandBufferDeviceMasks must be valid device masks' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSubmitInfoKHX-pCommandBufferDeviceMasks-00086)"}, - {VALIDATION_ERROR_06811201, "The spec valid usage text states 'If commandBufferCount is not 0, pCommandBufferDeviceMasks must be a valid pointer to an array of commandBufferCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSubmitInfoKHX-pCommandBufferDeviceMasks-parameter)"}, - {VALIDATION_ERROR_06823001, "The spec valid usage text states 'If signalSemaphoreCount is not 0, pSignalSemaphoreDeviceIndices must be a valid pointer to an array of signalSemaphoreCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSubmitInfoKHX-pSignalSemaphoreDeviceIndices-parameter)"}, - {VALIDATION_ERROR_06827201, "The spec valid usage text states 'If waitSemaphoreCount is not 0, pWaitSemaphoreDeviceIndices must be a valid pointer to an array of waitSemaphoreCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSubmitInfoKHX-pWaitSemaphoreDeviceIndices-parameter)"}, - {VALIDATION_ERROR_0682b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSubmitInfoKHX-sType-sType)"}, - {VALIDATION_ERROR_06a0d001, "The spec valid usage text states 'modes must be a valid combination of VkDeviceGroupPresentModeFlagBitsKHX values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSwapchainCreateInfoKHX-modes-parameter)"}, - {VALIDATION_ERROR_06a0d003, "The spec valid usage text states 'modes must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSwapchainCreateInfoKHX-modes-requiredbitmask)"}, - {VALIDATION_ERROR_06a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupSwapchainCreateInfoKHX-sType-sType)"}, + {VALIDATION_ERROR_05805801, "The spec valid usage text states 'deviceEvent must be a valid VkDeviceEventTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceEventInfoEXT-deviceEvent-parameter)"}, + {VALIDATION_ERROR_0581c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceEventInfoEXT-pNext-pNext)"}, + {VALIDATION_ERROR_0582b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceEventInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_05a1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGeneratedCommandsFeaturesNVX-pNext-pNext)"}, + {VALIDATION_ERROR_05a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGeneratedCommandsFeaturesNVX-sType-sType)"}, + {VALIDATION_ERROR_05c1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGeneratedCommandsLimitsNVX-pNext-pNext)"}, + {VALIDATION_ERROR_05c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGeneratedCommandsLimitsNVX-sType-sType)"}, + {VALIDATION_ERROR_05e008bc, "The spec valid usage text states 'resourceDeviceIndex and memoryDeviceIndex must both be valid device indices.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupBindSparseInfo-resourceDeviceIndex-01118)"}, + {VALIDATION_ERROR_05e008be, "The spec valid usage text states 'Each memory allocation bound in this batch must have allocated an instance for memoryDeviceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupBindSparseInfo-memoryDeviceIndex-01119)"}, + {VALIDATION_ERROR_05e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupBindSparseInfo-sType-sType)"}, + {VALIDATION_ERROR_060000d4, "The spec valid usage text states 'deviceMask must be a valid device mask value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupCommandBufferBeginInfo-deviceMask-00106)"}, + {VALIDATION_ERROR_060000d6, "The spec valid usage text states 'deviceMask must not be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupCommandBufferBeginInfo-deviceMask-00107)"}, + {VALIDATION_ERROR_0602b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupCommandBufferBeginInfo-sType-sType)"}, + {VALIDATION_ERROR_062002ee, "The spec valid usage text states 'Each element of pPhysicalDevices must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfo-pPhysicalDevices-00375)"}, + {VALIDATION_ERROR_062002f0, "The spec valid usage text states 'All elements of pPhysicalDevices must be in the same device group as enumerated by vkEnumeratePhysicalDeviceGroups' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfo-pPhysicalDevices-00376)"}, + {VALIDATION_ERROR_062002f2, "The spec valid usage text states 'If physicalDeviceCount is not 0, the physicalDevice parameter of vkCreateDevice must be an element of pPhysicalDevices.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfo-physicalDeviceCount-00377)"}, + {VALIDATION_ERROR_0621dc01, "The spec valid usage text states 'If physicalDeviceCount is not 0, pPhysicalDevices must be a valid pointer to an array of physicalDeviceCount valid VkPhysicalDevice handles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfo-pPhysicalDevices-parameter)"}, + {VALIDATION_ERROR_0622b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupDeviceCreateInfo-sType-sType)"}, + {VALIDATION_ERROR_06400a22, "The spec valid usage text states 'swapchainCount must equal 0 or VkPresentInfoKHR::swapchainCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-swapchainCount-01297)"}, + {VALIDATION_ERROR_06400a24, "The spec valid usage text states 'If mode is VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR, then each element of pDeviceMasks must have exactly one bit set, and the corresponding element of VkDeviceGroupPresentCapabilitiesKHR::presentMask must be non-zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-mode-01298)"}, + {VALIDATION_ERROR_06400a26, "The spec valid usage text states 'If mode is VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR, then each element of pDeviceMasks must have exactly one bit set, and some physical device in the logical device must include that bit in its VkDeviceGroupPresentCapabilitiesKHR::presentMask.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-mode-01299)"}, + {VALIDATION_ERROR_06400a28, "The spec valid usage text states 'If mode is VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR, then each element of pDeviceMasks must have a value for which all set bits are set in one of the elements of VkDeviceGroupPresentCapabilitiesKHR::presentMask' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-mode-01300)"}, + {VALIDATION_ERROR_06400a2a, "The spec valid usage text states 'If mode is VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR, then for each bit set in each element of pDeviceMasks, the corresponding element of VkDeviceGroupPresentCapabilitiesKHR::presentMask must be non-zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-mode-01301)"}, + {VALIDATION_ERROR_06400a2c, "The spec valid usage text states 'The value of each element of pDeviceMasks must be equal to the device mask passed in VkAcquireNextImageInfoKHR::deviceMask when the image index was last acquired' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-pDeviceMasks-01302)"}, + {VALIDATION_ERROR_06400a2e, "The spec valid usage text states 'mode must have exactly one bit set, and that bit must have been included in VkDeviceGroupSwapchainCreateInfoKHR::modes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-mode-01303)"}, + {VALIDATION_ERROR_0640ce01, "The spec valid usage text states 'mode must be a valid VkDeviceGroupPresentModeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-mode-parameter)"}, + {VALIDATION_ERROR_06414001, "The spec valid usage text states 'If swapchainCount is not 0, pDeviceMasks must be a valid pointer to an array of swapchainCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-pDeviceMasks-parameter)"}, + {VALIDATION_ERROR_0642b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_06600712, "The spec valid usage text states 'deviceMask must be a valid device mask value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfo-deviceMask-00905)"}, + {VALIDATION_ERROR_06600714, "The spec valid usage text states 'deviceMask must not be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfo-deviceMask-00906)"}, + {VALIDATION_ERROR_06600716, "The spec valid usage text states 'deviceMask must be a subset of the command buffer's initial device mask' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfo-deviceMask-00907)"}, + {VALIDATION_ERROR_06600718, "The spec valid usage text states 'deviceRenderAreaCount must either be zero or equal to the number of physical devices in the logical device.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfo-deviceRenderAreaCount-00908)"}, + {VALIDATION_ERROR_06614201, "The spec valid usage text states 'If deviceRenderAreaCount is not 0, pDeviceRenderAreas must be a valid pointer to an array of deviceRenderAreaCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfo-pDeviceRenderAreas-parameter)"}, + {VALIDATION_ERROR_0662b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupRenderPassBeginInfo-sType-sType)"}, + {VALIDATION_ERROR_068000a4, "The spec valid usage text states 'waitSemaphoreCount must equal VkSubmitInfo::waitSemaphoreCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSubmitInfo-waitSemaphoreCount-00082)"}, + {VALIDATION_ERROR_068000a6, "The spec valid usage text states 'commandBufferCount must equal VkSubmitInfo::commandBufferCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSubmitInfo-commandBufferCount-00083)"}, + {VALIDATION_ERROR_068000a8, "The spec valid usage text states 'signalSemaphoreCount must equal VkSubmitInfo::signalSemaphoreCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSubmitInfo-signalSemaphoreCount-00084)"}, + {VALIDATION_ERROR_068000aa, "The spec valid usage text states 'All elements of pWaitSemaphoreDeviceIndices and pSignalSemaphoreDeviceIndices must be valid device indices' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSubmitInfo-pWaitSemaphoreDeviceIndices-00085)"}, + {VALIDATION_ERROR_068000ac, "The spec valid usage text states 'All elements of pCommandBufferDeviceMasks must be valid device masks' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSubmitInfo-pCommandBufferDeviceMasks-00086)"}, + {VALIDATION_ERROR_06811201, "The spec valid usage text states 'If commandBufferCount is not 0, pCommandBufferDeviceMasks must be a valid pointer to an array of commandBufferCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSubmitInfo-pCommandBufferDeviceMasks-parameter)"}, + {VALIDATION_ERROR_06823001, "The spec valid usage text states 'If signalSemaphoreCount is not 0, pSignalSemaphoreDeviceIndices must be a valid pointer to an array of signalSemaphoreCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSubmitInfo-pSignalSemaphoreDeviceIndices-parameter)"}, + {VALIDATION_ERROR_06827201, "The spec valid usage text states 'If waitSemaphoreCount is not 0, pWaitSemaphoreDeviceIndices must be a valid pointer to an array of waitSemaphoreCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSubmitInfo-pWaitSemaphoreDeviceIndices-parameter)"}, + {VALIDATION_ERROR_0682b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSubmitInfo-sType-sType)"}, + {VALIDATION_ERROR_06a0d001, "The spec valid usage text states 'modes must be a valid combination of VkDeviceGroupPresentModeFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSwapchainCreateInfoKHR-modes-parameter)"}, + {VALIDATION_ERROR_06a0d003, "The spec valid usage text states 'modes must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSwapchainCreateInfoKHR-modes-requiredbitmask)"}, + {VALIDATION_ERROR_06a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupSwapchainCreateInfoKHR-sType-sType)"}, {VALIDATION_ERROR_06c002fa, "The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-queueFamilyIndex-00381)"}, {VALIDATION_ERROR_06c002fc, "The spec valid usage text states 'queueCount must be less than or equal to the queueCount member of the VkQueueFamilyProperties structure, as returned by vkGetPhysicalDeviceQueueFamilyProperties in the pQueueFamilyProperties[queueFamilyIndex]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-queueCount-00382)"}, {VALIDATION_ERROR_06c002fe, "The spec valid usage text states 'Each element of pQueuePriorities must be between 0.0 and 1.0 inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-pQueuePriorities-00383)"}, - {VALIDATION_ERROR_06c09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-flags-zerobitmask)"}, + {VALIDATION_ERROR_06c09001, "The spec valid usage text states 'flags must be a valid combination of VkDeviceQueueCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-flags-parameter)"}, {VALIDATION_ERROR_06c1c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkDeviceQueueGlobalPriorityCreateInfoEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-pNext-pNext)"}, {VALIDATION_ERROR_06c20401, "The spec valid usage text states 'pQueuePriorities must be a valid pointer to an array of queueCount float values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-pQueuePriorities-parameter)"}, {VALIDATION_ERROR_06c29e1b, "The spec valid usage text states 'queueCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueCreateInfo-queueCount-arraylength)"}, @@ -4202,74 +4399,65 @@ {VALIDATION_ERROR_06e00342, "The spec valid usage text states 'x must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[0]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDispatchIndirectCommand-x-00417)"}, {VALIDATION_ERROR_06e00344, "The spec valid usage text states 'y must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[1]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDispatchIndirectCommand-y-00418)"}, {VALIDATION_ERROR_06e00346, "The spec valid usage text states 'z must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[2]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDispatchIndirectCommand-z-00419)"}, - {VALIDATION_ERROR_07006201, "The spec valid usage text states 'displayEvent must be a valid VkDisplayEventTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayEventInfoEXT-displayEvent-parameter)"}, - {VALIDATION_ERROR_0701c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayEventInfoEXT-pNext-pNext)"}, - {VALIDATION_ERROR_0702b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayEventInfoEXT-sType-sType)"}, - {VALIDATION_ERROR_072009c4, "The spec valid usage text states 'The width and height members of the visibleRegion member of parameters must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-width-01250)"}, - {VALIDATION_ERROR_072009c6, "The spec valid usage text states 'The refreshRate member of parameters must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-refreshRate-01251)"}, - {VALIDATION_ERROR_07209005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-flags-zerobitmask)"}, - {VALIDATION_ERROR_0721c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_0722b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_0741c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayPowerInfoEXT-pNext-pNext)"}, - {VALIDATION_ERROR_07428a01, "The spec valid usage text states 'powerState must be a valid VkDisplayPowerStateEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayPowerInfoEXT-powerState-parameter)"}, - {VALIDATION_ERROR_0742b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayPowerInfoEXT-sType-sType)"}, - {VALIDATION_ERROR_076009d2, "The spec valid usage text states 'srcRect must specify a rectangular region that is a subset of the image being presented' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayPresentInfoKHR-srcRect-01257)"}, - {VALIDATION_ERROR_076009d4, "The spec valid usage text states 'dstRect must specify a rectangular region that is a subset of the visibleRegion parameter of the display mode the swapchain being presented uses' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayPresentInfoKHR-dstRect-01258)"}, - {VALIDATION_ERROR_076009d6, "The spec valid usage text states 'If the persistentContent member of the VkDisplayPropertiesKHR structure returned by vkGetPhysicalDeviceDisplayPropertiesKHR for the display the present operation targets then persistent must be VK_FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayPresentInfoKHR-persistentContent-01259)"}, - {VALIDATION_ERROR_0762b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplayPresentInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_078009c8, "The spec valid usage text states 'planeIndex must be less than the number of display planes supported by the device as determined by calling vkGetPhysicalDeviceDisplayPlanePropertiesKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-planeIndex-01252)"}, - {VALIDATION_ERROR_078009ca, "The spec valid usage text states 'If the planeReorderPossible member of the VkDisplayPropertiesKHR structure returned by vkGetPhysicalDeviceDisplayPropertiesKHR for the display corresponding to displayMode is VK_TRUE then planeStackIndex must be less than the number of display planes supported by the device as determined by calling vkGetPhysicalDeviceDisplayPlanePropertiesKHR; otherwise planeStackIndex must equal the currentStackIndex member of VkDisplayPlanePropertiesKHR returned by vkGetPhysicalDeviceDisplayPlanePropertiesKHR for the display plane corresponding to displayMode' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-planeReorderPossible-01253)"}, - {VALIDATION_ERROR_078009cc, "The spec valid usage text states 'If alphaMode is VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR then globalAlpha must be between 0 and 1, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-01254)"}, - {VALIDATION_ERROR_078009ce, "The spec valid usage text states 'alphaMode must be 0 or one of the bits present in the supportedAlpha member of VkDisplayPlaneCapabilitiesKHR returned by vkGetDisplayPlaneCapabilitiesKHR for the display plane corresponding to displayMode' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-01255)"}, - {VALIDATION_ERROR_078009d0, "The spec valid usage text states 'The width and height members of imageExtent must be less than the maxImageDimensions2D member of VkPhysicalDeviceLimits' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-width-01256)"}, - {VALIDATION_ERROR_07800a01, "The spec valid usage text states 'alphaMode must be a valid VkDisplayPlaneAlphaFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-parameter)"}, - {VALIDATION_ERROR_07806401, "The spec valid usage text states 'displayMode must be a valid VkDisplayModeKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-displayMode-parameter)"}, - {VALIDATION_ERROR_07809005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-flags-zerobitmask)"}, - {VALIDATION_ERROR_0781c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_0782b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_07830201, "The spec valid usage text states 'transform must be a valid VkSurfaceTransformFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-transform-parameter)"}, - {VALIDATION_ERROR_07a00450, "The spec valid usage text states 'For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDrawIndexedIndirectCommand-None-00552)"}, - {VALIDATION_ERROR_07a00452, "The spec valid usage text states '(indexSize * (firstIndex + indexCount) + offset) must be less than or equal to the size of the currently bound index buffer, with indexSize being based on the type specified by indexType, where the index buffer, indexType, and offset are specified via vkCmdBindIndexBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDrawIndexedIndirectCommand-indexSize-00553)"}, + {VALIDATION_ERROR_07006201, "The spec valid usage text states 'displayEvent must be a valid VkDisplayEventTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayEventInfoEXT-displayEvent-parameter)"}, + {VALIDATION_ERROR_0701c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayEventInfoEXT-pNext-pNext)"}, + {VALIDATION_ERROR_0702b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayEventInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_072009c4, "The spec valid usage text states 'The width and height members of the visibleRegion member of parameters must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-width-01250)"}, + {VALIDATION_ERROR_072009c6, "The spec valid usage text states 'The refreshRate member of parameters must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-refreshRate-01251)"}, + {VALIDATION_ERROR_07209005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-flags-zerobitmask)"}, + {VALIDATION_ERROR_0721c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_0722b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayModeCreateInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_0741c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayPowerInfoEXT-pNext-pNext)"}, + {VALIDATION_ERROR_07428a01, "The spec valid usage text states 'powerState must be a valid VkDisplayPowerStateEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayPowerInfoEXT-powerState-parameter)"}, + {VALIDATION_ERROR_0742b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayPowerInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_076009d2, "The spec valid usage text states 'srcRect must specify a rectangular region that is a subset of the image being presented' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayPresentInfoKHR-srcRect-01257)"}, + {VALIDATION_ERROR_076009d4, "The spec valid usage text states 'dstRect must specify a rectangular region that is a subset of the visibleRegion parameter of the display mode the swapchain being presented uses' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayPresentInfoKHR-dstRect-01258)"}, + {VALIDATION_ERROR_076009d6, "The spec valid usage text states 'If the persistentContent member of the VkDisplayPropertiesKHR structure returned by vkGetPhysicalDeviceDisplayPropertiesKHR for the display the present operation targets then persistent must be VK_FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayPresentInfoKHR-persistentContent-01259)"}, + {VALIDATION_ERROR_0762b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplayPresentInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_078009c8, "The spec valid usage text states 'planeIndex must be less than the number of display planes supported by the device as determined by calling vkGetPhysicalDeviceDisplayPlanePropertiesKHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-planeIndex-01252)"}, + {VALIDATION_ERROR_078009ca, "The spec valid usage text states 'If the planeReorderPossible member of the VkDisplayPropertiesKHR structure returned by vkGetPhysicalDeviceDisplayPropertiesKHR for the display corresponding to displayMode is VK_TRUE then planeStackIndex must be less than the number of display planes supported by the device as determined by calling vkGetPhysicalDeviceDisplayPlanePropertiesKHR; otherwise planeStackIndex must equal the currentStackIndex member of VkDisplayPlanePropertiesKHR returned by vkGetPhysicalDeviceDisplayPlanePropertiesKHR for the display plane corresponding to displayMode' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-planeReorderPossible-01253)"}, + {VALIDATION_ERROR_078009cc, "The spec valid usage text states 'If alphaMode is VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR then globalAlpha must be between 0 and 1, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-01254)"}, + {VALIDATION_ERROR_078009ce, "The spec valid usage text states 'alphaMode must be 0 or one of the bits present in the supportedAlpha member of VkDisplayPlaneCapabilitiesKHR returned by vkGetDisplayPlaneCapabilitiesKHR for the display plane corresponding to displayMode' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-01255)"}, + {VALIDATION_ERROR_078009d0, "The spec valid usage text states 'The width and height members of imageExtent must be less than the maxImageDimensions2D member of VkPhysicalDeviceLimits' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-width-01256)"}, + {VALIDATION_ERROR_07800a01, "The spec valid usage text states 'alphaMode must be a valid VkDisplayPlaneAlphaFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-parameter)"}, + {VALIDATION_ERROR_07806401, "The spec valid usage text states 'displayMode must be a valid VkDisplayModeKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-displayMode-parameter)"}, + {VALIDATION_ERROR_07809005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-flags-zerobitmask)"}, + {VALIDATION_ERROR_0781c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_0782b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_07830201, "The spec valid usage text states 'transform must be a valid VkSurfaceTransformFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDisplaySurfaceCreateInfoKHR-transform-parameter)"}, + {VALIDATION_ERROR_07a00450, "The spec valid usage text states 'For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in fxvertex-input' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDrawIndexedIndirectCommand-None-00552)"}, + {VALIDATION_ERROR_07a00452, "The spec valid usage text states '(indexSize * (firstIndex + indexCount) + offset) must be less than or equal to the size of the bound index buffer, with indexSize being based on the type specified by indexType, where the index buffer, indexType, and offset are specified via vkCmdBindIndexBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDrawIndexedIndirectCommand-indexSize-00553)"}, {VALIDATION_ERROR_07a00454, "The spec valid usage text states 'If the drawIndirectFirstInstance feature is not enabled, firstInstance must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDrawIndexedIndirectCommand-firstInstance-00554)"}, - {VALIDATION_ERROR_07c003e8, "The spec valid usage text states 'For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDrawIndirectCommand-None-00500)"}, + {VALIDATION_ERROR_07c003e8, "The spec valid usage text states 'For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in fxvertex-input' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDrawIndirectCommand-None-00500)"}, {VALIDATION_ERROR_07c003ea, "The spec valid usage text states 'If the drawIndirectFirstInstance feature is not enabled, firstInstance must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDrawIndirectCommand-firstInstance-00501)"}, {VALIDATION_ERROR_07e09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkEventCreateInfo-flags-zerobitmask)"}, {VALIDATION_ERROR_07e1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkEventCreateInfo-pNext-pNext)"}, {VALIDATION_ERROR_07e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkEventCreateInfo-sType-sType)"}, - {VALIDATION_ERROR_08000520, "The spec valid usage text states 'The bits in handleTypes must be supported and compatible, as reported by VkExternalImageFormatPropertiesKHR or VkExternalBufferPropertiesKHR.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryAllocateInfoKHR-handleTypes-00656)"}, - {VALIDATION_ERROR_08009e01, "The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryAllocateInfoKHR-handleTypes-parameter)"}, - {VALIDATION_ERROR_0801c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryAllocateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_0802b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryAllocateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_08209e01, "The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryAllocateInfoNV-handleTypes-parameter)"}, - {VALIDATION_ERROR_0821c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryAllocateInfoNV-pNext-pNext)"}, - {VALIDATION_ERROR_0822b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryAllocateInfoNV-sType-sType)"}, - {VALIDATION_ERROR_08400522, "The spec valid usage text states 'If VkExportMemoryAllocateInfoKHR::handleTypes does not include VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR, VkExportMemoryWin32HandleInfoKHR must not be in the pNext chain of VkMemoryAllocateInfo.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoKHR-handleTypes-00657)"}, - {VALIDATION_ERROR_0840f401, "The spec valid usage text states 'If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoKHR-pAttributes-parameter)"}, - {VALIDATION_ERROR_0841c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_0842b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_0860f401, "The spec valid usage text states 'If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoNV-pAttributes-parameter)"}, - {VALIDATION_ERROR_0861c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoNV-pNext-pNext)"}, - {VALIDATION_ERROR_0862b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoNV-sType-sType)"}, - {VALIDATION_ERROR_088008c8, "The spec valid usage text states 'The bits in handleTypes must be supported and compatible, as reported by VkExternalSemaphorePropertiesKHR.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportSemaphoreCreateInfoKHR-handleTypes-01124)"}, - {VALIDATION_ERROR_08809e01, "The spec valid usage text states 'handleTypes must be a valid combination of VkExternalSemaphoreHandleTypeFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportSemaphoreCreateInfoKHR-handleTypes-parameter)"}, - {VALIDATION_ERROR_0881c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportSemaphoreCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_0882b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportSemaphoreCreateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_08a008ca, "The spec valid usage text states 'If VkExportSemaphoreCreateInfoKHR::handleTypes does not include VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR or VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHR, VkExportSemaphoreWin32HandleInfoKHR must not be in the pNext chain of VkSemaphoreCreateInfo.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportSemaphoreWin32HandleInfoKHR-handleTypes-01125)"}, - {VALIDATION_ERROR_08a0f401, "The spec valid usage text states 'If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportSemaphoreWin32HandleInfoKHR-pAttributes-parameter)"}, - {VALIDATION_ERROR_08a1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportSemaphoreWin32HandleInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_08a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportSemaphoreWin32HandleInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_08c09e01, "The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryBufferCreateInfoKHR-handleTypes-parameter)"}, - {VALIDATION_ERROR_08c1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryBufferCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_08c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryBufferCreateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_08e09e01, "The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfoKHR-handleTypes-parameter)"}, - {VALIDATION_ERROR_08e09e03, "The spec valid usage text states 'handleTypes must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfoKHR-handleTypes-requiredbitmask)"}, - {VALIDATION_ERROR_08e1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_08e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_09009e01, "The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfoNV-handleTypes-parameter)"}, - {VALIDATION_ERROR_0901c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfoNV-pNext-pNext)"}, - {VALIDATION_ERROR_0902b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfoNV-sType-sType)"}, + {VALIDATION_ERROR_08000520, "The spec valid usage text states 'The bits in handleTypes must be supported and compatible, as reported by VkExternalImageFormatProperties or VkExternalBufferProperties.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryAllocateInfo-handleTypes-00656)"}, + {VALIDATION_ERROR_08009e01, "The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryAllocateInfo-handleTypes-parameter)"}, + {VALIDATION_ERROR_0802b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryAllocateInfo-sType-sType)"}, + {VALIDATION_ERROR_08209e01, "The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryAllocateInfoNV-handleTypes-parameter)"}, + {VALIDATION_ERROR_0822b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryAllocateInfoNV-sType-sType)"}, + {VALIDATION_ERROR_08400522, "The spec valid usage text states 'If VkExportMemoryAllocateInfo::handleTypes does not include VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, VkExportMemoryWin32HandleInfoKHR must not be in the pNext chain of VkMemoryAllocateInfo.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoKHR-handleTypes-00657)"}, + {VALIDATION_ERROR_0840f401, "The spec valid usage text states 'If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoKHR-pAttributes-parameter)"}, + {VALIDATION_ERROR_0842b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_0860f401, "The spec valid usage text states 'If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoNV-pAttributes-parameter)"}, + {VALIDATION_ERROR_0862b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportMemoryWin32HandleInfoNV-sType-sType)"}, + {VALIDATION_ERROR_088008c8, "The spec valid usage text states 'The bits in handleTypes must be supported and compatible, as reported by VkExternalSemaphoreProperties.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportSemaphoreCreateInfo-handleTypes-01124)"}, + {VALIDATION_ERROR_08809e01, "The spec valid usage text states 'handleTypes must be a valid combination of VkExternalSemaphoreHandleTypeFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportSemaphoreCreateInfo-handleTypes-parameter)"}, + {VALIDATION_ERROR_0882b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportSemaphoreCreateInfo-sType-sType)"}, + {VALIDATION_ERROR_08a008ca, "The spec valid usage text states 'If VkExportSemaphoreCreateInfo::handleTypes does not include VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT or VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT, VkExportSemaphoreWin32HandleInfoKHR must not be in the pNext chain of VkSemaphoreCreateInfo.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportSemaphoreWin32HandleInfoKHR-handleTypes-01125)"}, + {VALIDATION_ERROR_08a0f401, "The spec valid usage text states 'If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportSemaphoreWin32HandleInfoKHR-pAttributes-parameter)"}, + {VALIDATION_ERROR_08a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportSemaphoreWin32HandleInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_08c09e01, "The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalMemoryBufferCreateInfo-handleTypes-parameter)"}, + {VALIDATION_ERROR_08c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalMemoryBufferCreateInfo-sType-sType)"}, + {VALIDATION_ERROR_08e09e01, "The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfo-handleTypes-parameter)"}, + {VALIDATION_ERROR_08e09e03, "The spec valid usage text states 'handleTypes must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfo-handleTypes-requiredbitmask)"}, + {VALIDATION_ERROR_08e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfo-sType-sType)"}, + {VALIDATION_ERROR_09009e01, "The spec valid usage text states 'handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfoNV-handleTypes-parameter)"}, + {VALIDATION_ERROR_0902b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalMemoryImageCreateInfoNV-sType-sType)"}, {VALIDATION_ERROR_09209001, "The spec valid usage text states 'flags must be a valid combination of VkFenceCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceCreateInfo-flags-parameter)"}, - {VALIDATION_ERROR_0921c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkExportFenceCreateInfoKHR or VkExportFenceWin32HandleInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceCreateInfo-pNext-pNext)"}, + {VALIDATION_ERROR_0921c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkExportFenceCreateInfo or VkExportFenceWin32HandleInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceCreateInfo-pNext-pNext)"}, {VALIDATION_ERROR_0922b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceCreateInfo-sType-sType)"}, {VALIDATION_ERROR_0922b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceCreateInfo-sType-unique)"}, {VALIDATION_ERROR_09400009, "The spec valid usage text states 'Both of renderPass, and the elements of pAttachments that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFramebufferCreateInfo-commonparent)"}, @@ -4316,9 +4504,9 @@ {VALIDATION_ERROR_096005c8, "The spec valid usage text states 'If pStages includes a fragment shader stage and a geometry shader stage, and the fragment shader code reads from an input variable that is decorated with PrimitiveID, then the geometry shader code must write to a matching output variable, decorated with PrimitiveID, in all execution paths' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00740)"}, {VALIDATION_ERROR_096005ca, "The spec valid usage text states 'If pStages includes a fragment shader stage, its shader code must not read from any input attachment that is defined as VK_ATTACHMENT_UNUSED in subpass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00741)"}, {VALIDATION_ERROR_096005cc, "The spec valid usage text states 'The shader code for the entry points identified by pStages, and the rest of the state identified by this structure must adhere to the pipeline linking rules described in the Shader Interfaces chapter' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-00742)"}, - {VALIDATION_ERROR_096005ce, "The spec valid usage text states 'If rasterization is not disabled and subpass uses a depth/stencil attachment in renderpass that has a layout of VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00743)"}, - {VALIDATION_ERROR_096005d0, "The spec valid usage text states 'If rasterization is not disabled and subpass uses a depth/stencil attachment in renderpass that has a layout of VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00744)"}, - {VALIDATION_ERROR_096005d2, "The spec valid usage text states 'If rasterization is not disabled and the subpass uses color attachments, then for each color attachment in the subpass the blendEnable member of the corresponding element of the pAttachment member of pColorBlendState must be VK_FALSE if the format of the attachment does not support color blend operations, as specified by the VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT flag in VkFormatProperties::linearTilingFeatures or VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-blendEnable-00745)"}, + {VALIDATION_ERROR_096005ce, "The spec valid usage text states 'If rasterization is not disabled and subpass uses a depth/stencil attachment in renderPass that has a layout of VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL in the VkAttachmentReference defined by subpass, the depthWriteEnable member of pDepthStencilState must be VK_FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00743)"}, + {VALIDATION_ERROR_096005d0, "The spec valid usage text states 'If rasterization is not disabled and subpass uses a depth/stencil attachment in renderPass that has a layout of VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL in the VkAttachmentReference defined by subpass, the failOp, passOp and depthFailOp members of each of the front and back members of pDepthStencilState must be VK_STENCIL_OP_KEEP' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00744)"}, + {VALIDATION_ERROR_096005d2, "The spec valid usage text states 'If rasterization is not disabled and the subpass uses color attachments, then for each color attachment in the subpass the blendEnable member of the corresponding element of the pAttachment member of pColorBlendState must be VK_FALSE if the format of the attachment does not support color blend operations, as specified by the VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT flag in VkFormatProperties::linearTilingFeatures or VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00745)"}, {VALIDATION_ERROR_096005d4, "The spec valid usage text states 'If rasterization is not disabled and the subpass uses color attachments, the attachmentCount member of pColorBlendState must be equal to the colorAttachmentCount used to create subpass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-attachmentCount-00746)"}, {VALIDATION_ERROR_096005d6, "The spec valid usage text states 'If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_VIEWPORT, the pViewports member of pViewportState must be a valid pointer to an array of pViewportState::viewportCount VkViewport structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00747)"}, {VALIDATION_ERROR_096005d8, "The spec valid usage text states 'If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_SCISSOR, the pScissors member of pViewportState must be a valid pointer to an array of pViewportState::scissorCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00748)"}, @@ -4328,16 +4516,16 @@ {VALIDATION_ERROR_096005e0, "The spec valid usage text states 'If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, and subpass uses a depth/stencil attachment, pDepthStencilState must be a valid pointer to a valid VkPipelineDepthStencilStateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00752)"}, {VALIDATION_ERROR_096005e2, "The spec valid usage text states 'If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, and subpass uses color attachments, pColorBlendState must be a valid pointer to a valid VkPipelineColorBlendStateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00753)"}, {VALIDATION_ERROR_096005e4, "The spec valid usage text states 'If the depth bias clamping feature is not enabled, no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_DEPTH_BIAS, and the depthBiasEnable member of pRasterizationState is VK_TRUE, the depthBiasClamp member of pRasterizationState must be 0.0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00754)"}, - {VALIDATION_ERROR_096005e6, "The spec valid usage text states 'If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_DEPTH_BOUNDS, and the depthBoundsTestEnable member of pDepthStencilState is VK_TRUE, the minDepthBounds and maxDepthBounds members of pDepthStencilState must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00755)"}, + {VALIDATION_ERROR_096005e6, "The spec valid usage text states 'If the VK_EXT_depth_range_unrestricted extension is not enabled and no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_DEPTH_BOUNDS, and the depthBoundsTestEnable member of pDepthStencilState is VK_TRUE, the minDepthBounds and maxDepthBounds members of pDepthStencilState must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00755)"}, {VALIDATION_ERROR_096005e8, "The spec valid usage text states 'layout must be consistent with all shaders specified in pStages' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-layout-00756)"}, {VALIDATION_ERROR_096005ea, "The spec valid usage text states 'If subpass uses color and/or depth/stencil attachments, then the rasterizationSamples member of pMultisampleState must be the same as the sample count for those subpass attachments' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00757)"}, {VALIDATION_ERROR_096005ec, "The spec valid usage text states 'If subpass does not use any color and/or depth/stencil attachments, then the rasterizationSamples member of pMultisampleState must follow the rules for a zero-attachment subpass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00758)"}, - {VALIDATION_ERROR_096005ee, "The spec valid usage text states 'subpass must be a valid subpass within renderpass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00759)"}, + {VALIDATION_ERROR_096005ee, "The spec valid usage text states 'subpass must be a valid subpass within renderPass' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-00759)"}, {VALIDATION_ERROR_096005f0, "The spec valid usage text states 'If the renderPass has multiview enabled and subpass has more than one bit set in the view mask and multiviewTessellationShader is not enabled, then pStages must not include tessellation shaders.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-renderPass-00760)"}, {VALIDATION_ERROR_096005f2, "The spec valid usage text states 'If the renderPass has multiview enabled and subpass has more than one bit set in the view mask and multiviewGeometryShader is not enabled, then pStages must not include a geometry shader.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-renderPass-00761)"}, {VALIDATION_ERROR_096005f4, "The spec valid usage text states 'If the renderPass has multiview enabled and subpass has more than one bit set in the view mask, shaders in the pipeline must not write to the Layer built-in output' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-renderPass-00762)"}, {VALIDATION_ERROR_096005f6, "The spec valid usage text states 'If the renderPass has multiview enabled, then all shaders must not include variables decorated with the Layer built-in decoration in their interfaces.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-renderPass-00763)"}, - {VALIDATION_ERROR_096005f8, "The spec valid usage text states 'flags must not contain the VK_PIPELINE_CREATE_DISPATCH_BASE_KHX flag.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-flags-00764)"}, + {VALIDATION_ERROR_096005f8, "The spec valid usage text states 'flags must not contain the VK_PIPELINE_CREATE_DISPATCH_BASE flag.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-flags-00764)"}, {VALIDATION_ERROR_09600b06, "The spec valid usage text states 'If subpass has a depth/stencil attachment and depth test, stencil test, or depth bounds test are enabled, then the rasterizationSamples member of pMultisampleState must be the same as the sample count of the depth/stencil attachment' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-01411)"}, {VALIDATION_ERROR_09600b08, "The spec valid usage text states 'If subpass has any color attachments, then the rasterizationSamples member of pMultisampleState must be greater than or equal to the sample count for those subpass attachments' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-01412)"}, {VALIDATION_ERROR_09600bc2, "The spec valid usage text states 'If subpass uses color and/or depth/stencil attachments, then the rasterizationSamples member of pMultisampleState must equal the maximum of the sample counts of those subpass attachments' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-01505)"}, @@ -4345,9 +4533,11 @@ {VALIDATION_ERROR_09600be4, "The spec valid usage text states 'If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, and the sampleLocationsEnable member of a VkPipelineSampleLocationsStateCreateInfoEXT structure chained to the pNext chain of pMultisampleState is VK_TRUE, sampleLocationsInfo.sampleLocationGridSize.height must evenly divide VkMultisamplePropertiesEXT::sampleLocationGridSize.height as returned by vkGetPhysicalDeviceMultisamplePropertiesEXT with a samples parameter equaling rasterizationSamples' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01522)"}, {VALIDATION_ERROR_09600be6, "The spec valid usage text states 'If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, and the sampleLocationsEnable member of a VkPipelineSampleLocationsStateCreateInfoEXT structure chained to the pNext chain of pMultisampleState is VK_TRUE, sampleLocationsInfo.sampleLocationsPerPixel must equal rasterizationSamples' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01523)"}, {VALIDATION_ERROR_09600be8, "The spec valid usage text states 'If the sampleLocationsEnable member of a VkPipelineSampleLocationsStateCreateInfoEXT structure chained to the pNext chain of pMultisampleState is VK_TRUE, the fragment shader code must not statically use the extended instruction InterpolateAtSample' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-sampleLocationsEnable-01524)"}, - {VALIDATION_ERROR_09600c3a, "The spec valid usage text states 'If pStages includes a fragment shader stage and an input attachment was referenced by the VkRenderPassInputAttachmentAspectCreateInfoKHR at renderpass create time, its shader code must not read from any aspect that was not specified in the aspectMask of the corresponding VkInputAttachmentAspectReferenceKHR structure.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-01565)"}, + {VALIDATION_ERROR_09600c3a, "The spec valid usage text states 'If pStages includes a fragment shader stage and an input attachment was referenced by the VkRenderPassInputAttachmentAspectCreateInfo at renderPass create time, its shader code must not read from any aspect that was not specified in the aspectMask of the corresponding VkInputAttachmentAspectReference structure.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-01565)"}, {VALIDATION_ERROR_09600d30, "The spec valid usage text states 'The number of resources in layout accessible to each shader stage that is used by the pipeline must be less than or equal to VkPhysicalDeviceLimits::maxPerStageResources' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-layout-01688)"}, {VALIDATION_ERROR_09600d66, "The spec valid usage text states 'If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV, and the viewportWScalingEnable member of a VkPipelineViewportWScalingStateCreateInfoNV structure, chained to the pNext chain of pViewportState, is VK_TRUE, the pViewportWScalings member of the VkPipelineViewportWScalingStateCreateInfoNV must be a pointer to an array of VkPipelineViewportWScalingStateCreateInfoNV::viewportCount valid VkViewportWScalingNV structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01715)"}, + {VALIDATION_ERROR_09600db8, "The spec valid usage text states 'If rasterization is not disabled and subpass uses a depth/stencil attachment in renderPass that has a layout of VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL or VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL in the VkAttachmentReference defined by subpass, the depthWriteEnable member of pDepthStencilState must be VK_FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-01756)"}, + {VALIDATION_ERROR_09600dba, "The spec valid usage text states 'If rasterization is not disabled and subpass uses a depth/stencil attachment in renderPass that has a layout of VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL or VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL in the VkAttachmentReference defined by subpass, the failOp, passOp and depthFailOp members of each of the front and back members of pDepthStencilState must be VK_STENCIL_OP_KEEP' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-01757)"}, {VALIDATION_ERROR_09609001, "The spec valid usage text states 'flags must be a valid combination of VkPipelineCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-flags-parameter)"}, {VALIDATION_ERROR_0960be01, "The spec valid usage text states 'layout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-layout-parameter)"}, {VALIDATION_ERROR_09615601, "The spec valid usage text states 'If pDynamicState is not NULL, pDynamicState must be a valid pointer to a valid VkPipelineDynamicStateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicState-parameter)"}, @@ -4359,11 +4549,10 @@ {VALIDATION_ERROR_0962ae01, "The spec valid usage text states 'renderPass must be a valid VkRenderPass handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-renderPass-parameter)"}, {VALIDATION_ERROR_0962b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-sType-sType)"}, {VALIDATION_ERROR_0962da1b, "The spec valid usage text states 'stageCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-stageCount-arraylength)"}, - {VALIDATION_ERROR_09800a48, "The spec valid usage text states 'pView must be a valid UIView and must be backed by a CALayer instance of type CAMetalLayer.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIOSSurfaceCreateInfoMVK-pView-01316)"}, - {VALIDATION_ERROR_09809005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIOSSurfaceCreateInfoMVK-flags-zerobitmask)"}, - {VALIDATION_ERROR_0981c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIOSSurfaceCreateInfoMVK-pNext-pNext)"}, - {VALIDATION_ERROR_09826a01, "The spec valid usage text states 'pView must be a pointer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIOSSurfaceCreateInfoMVK-pView-parameter)"}, - {VALIDATION_ERROR_0982b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIOSSurfaceCreateInfoMVK-sType-sType)"}, + {VALIDATION_ERROR_09800a48, "The spec valid usage text states 'pView must be a valid UIView and must be backed by a CALayer instance of type CAMetalLayer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIOSSurfaceCreateInfoMVK-pView-01316)"}, + {VALIDATION_ERROR_09809005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIOSSurfaceCreateInfoMVK-flags-zerobitmask)"}, + {VALIDATION_ERROR_0981c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIOSSurfaceCreateInfoMVK-pNext-pNext)"}, + {VALIDATION_ERROR_0982b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIOSSurfaceCreateInfoMVK-sType-sType)"}, {VALIDATION_ERROR_09a001dc, "The spec valid usage text states 'The aspectMask member of srcSubresource and dstSubresource must match' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-aspectMask-00238)"}, {VALIDATION_ERROR_09a001de, "The spec valid usage text states 'The layerCount member of srcSubresource and dstSubresource must match' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-layerCount-00239)"}, {VALIDATION_ERROR_09a001e0, "The spec valid usage text states 'If either of the calling command's srcImage or dstImage parameters are of VkImageType VK_IMAGE_TYPE_3D, the baseArrayLayer and layerCount members of both srcSubresource and dstSubresource must be 0 and 1, respectively' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-srcImage-00240)"}, @@ -4392,30 +4581,41 @@ {VALIDATION_ERROR_09c00122, "The spec valid usage text states 'srcOffset.y and (extent.height + srcOffset.y) must both be greater than or equal to 0 and less than or equal to the source image subresource height' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcOffset-00145)"}, {VALIDATION_ERROR_09c00124, "The spec valid usage text states 'If the calling command's srcImage is of type VK_IMAGE_TYPE_1D, then srcOffset.y must be 0 and extent.height must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcImage-00146)"}, {VALIDATION_ERROR_09c00126, "The spec valid usage text states 'srcOffset.z and (extent.depth + srcOffset.z) must both be greater than or equal to 0 and less than or equal to the source image subresource depth' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcOffset-00147)"}, - {VALIDATION_ERROR_09c00128, "The spec valid usage text states 'If the calling command's srcImage is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then srcOffset.z must be 0 and extent.depth must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcImage-00148)"}, - {VALIDATION_ERROR_09c0012a, "The spec valid usage text states 'srcSubresource.baseArrayLayer must be less than and (srcSubresource.layerCount + srcSubresource.baseArrayLayer) must be less than or equal to the number of layers in the source image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcSubresource-00149)"}, {VALIDATION_ERROR_09c0012c, "The spec valid usage text states 'dstOffset.x and (extent.width + dstOffset.x) must both be greater than or equal to 0 and less than or equal to the destination image subresource width' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstOffset-00150)"}, {VALIDATION_ERROR_09c0012e, "The spec valid usage text states 'dstOffset.y and (extent.height + dstOffset.y) must both be greater than or equal to 0 and less than or equal to the destination image subresource height' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstOffset-00151)"}, {VALIDATION_ERROR_09c00130, "The spec valid usage text states 'If the calling command's dstImage is of type VK_IMAGE_TYPE_1D, then dstOffset.y must be 0 and extent.height must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstImage-00152)"}, {VALIDATION_ERROR_09c00132, "The spec valid usage text states 'dstOffset.z and (extent.depth + dstOffset.z) must both be greater than or equal to 0 and less than or equal to the destination image subresource depth' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstOffset-00153)"}, - {VALIDATION_ERROR_09c00134, "The spec valid usage text states 'If the calling command's dstImage is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then dstOffset.z must be 0 and extent.depth must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstImage-00154)"}, - {VALIDATION_ERROR_09c00136, "The spec valid usage text states 'dstSubresource.baseArrayLayer must be less than and (dstSubresource.layerCount + dstSubresource.baseArrayLayer) must be less than or equal to the number of layers in the destination image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstSubresource-00155)"}, - {VALIDATION_ERROR_09c0013a, "The spec valid usage text states 'If the calling command's srcImage is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcOffset-00157)"}, - {VALIDATION_ERROR_09c0013c, "The spec valid usage text states 'If the calling command's srcImage is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-extent-00158)"}, - {VALIDATION_ERROR_09c0013e, "The spec valid usage text states 'If the calling command's srcImage is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-extent-00159)"}, - {VALIDATION_ERROR_09c00140, "The spec valid usage text states 'If the calling command's srcImage is a compressed image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-extent-00160)"}, - {VALIDATION_ERROR_09c00144, "The spec valid usage text states 'If the calling command's dstImage is a compressed format image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstOffset-00162)"}, - {VALIDATION_ERROR_09c00146, "The spec valid usage text states 'If the calling command's dstImage is a compressed format image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-extent-00163)"}, - {VALIDATION_ERROR_09c00148, "The spec valid usage text states 'If the calling command's dstImage is a compressed format image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-extent-00164)"}, - {VALIDATION_ERROR_09c0014a, "The spec valid usage text states 'If the calling command's dstImage is a compressed format image,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-extent-00165)"}, - {VALIDATION_ERROR_09c0014c, "The spec valid usage text states 'srcOffset, dstOffset, and extent must respect the image transfer granularity requirements of the queue family that it will be submitted against, as described in Physical Device Enumeration' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcOffset-00166)"}, + {VALIDATION_ERROR_09c0013a, "The spec valid usage text states 'If the calling command's srcImage is a compressed image, all members of srcOffset must be a multiple of the corresponding dimensions of the compressed texel block' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcOffset-00157)"}, + {VALIDATION_ERROR_09c0013c, "The spec valid usage text states 'If the calling command's srcImage is a compressed image, extent.width must be a multiple of the compressed texel block width or (extent.width + srcOffset.x) must equal the source image subresource width' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-extent-00158)"}, + {VALIDATION_ERROR_09c0013e, "The spec valid usage text states 'If the calling command's srcImage is a compressed image, extent.height must be a multiple of the compressed texel block height or (extent.height + srcOffset.y) must equal the source image subresource height' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-extent-00159)"}, + {VALIDATION_ERROR_09c00140, "The spec valid usage text states 'If the calling command's srcImage is a compressed image, extent.depth must be a multiple of the compressed texel block depth or (extent.depth + srcOffset.z) must equal the source image subresource depth' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-extent-00160)"}, + {VALIDATION_ERROR_09c00144, "The spec valid usage text states 'If the calling command's dstImage is a compressed format image, all members of dstOffset must be a multiple of the corresponding dimensions of the compressed texel block' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstOffset-00162)"}, + {VALIDATION_ERROR_09c00146, "The spec valid usage text states 'If the calling command's dstImage is a compressed format image, extent.width must be a multiple of the compressed texel block width or (extent.width + dstOffset.x) must equal the destination image subresource width' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-extent-00163)"}, + {VALIDATION_ERROR_09c00148, "The spec valid usage text states 'If the calling command's dstImage is a compressed format image, extent.height must be a multiple of the compressed texel block height or (extent.height + dstOffset.y) must equal the destination image subresource height' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-extent-00164)"}, + {VALIDATION_ERROR_09c0014a, "The spec valid usage text states 'If the calling command's dstImage is a compressed format image, extent.depth must be a multiple of the compressed texel block depth or (extent.depth + dstOffset.z) must equal the destination image subresource depth' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-extent-00165)"}, {VALIDATION_ERROR_09c00c1e, "The spec valid usage text states 'If neither the calling command's srcImage nor the calling command's dstImage has a multi-planar image format then the aspectMask member of srcSubresource and dstSubresource must match' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-01551)"}, - {VALIDATION_ERROR_09c00c20, "The spec valid usage text states 'If the calling command's srcImage has a VkFormat with two planes then the srcSubresource aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR or VK_IMAGE_ASPECT_PLANE_1_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-01552)"}, - {VALIDATION_ERROR_09c00c22, "The spec valid usage text states 'If the calling command's srcImage has a VkFormat with three planes then the srcSubresource aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR, or VK_IMAGE_ASPECT_PLANE_2_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-01553)"}, - {VALIDATION_ERROR_09c00c24, "The spec valid usage text states 'If the calling command's dstImage has a VkFormat with two planes then the dstSubresource aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR or VK_IMAGE_ASPECT_PLANE_1_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-dstImage-01554)"}, - {VALIDATION_ERROR_09c00c26, "The spec valid usage text states 'If the calling command's dstImage has a VkFormat with three planes then the dstSubresource aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR, or VK_IMAGE_ASPECT_PLANE_2_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-dstImage-01555)"}, + {VALIDATION_ERROR_09c00c20, "The spec valid usage text states 'If the calling command's srcImage has a VkFormat with two planes then the srcSubresource aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT or VK_IMAGE_ASPECT_PLANE_1_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-01552)"}, + {VALIDATION_ERROR_09c00c22, "The spec valid usage text states 'If the calling command's srcImage has a VkFormat with three planes then the srcSubresource aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-01553)"}, + {VALIDATION_ERROR_09c00c24, "The spec valid usage text states 'If the calling command's dstImage has a VkFormat with two planes then the dstSubresource aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT or VK_IMAGE_ASPECT_PLANE_1_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-dstImage-01554)"}, + {VALIDATION_ERROR_09c00c26, "The spec valid usage text states 'If the calling command's dstImage has a VkFormat with three planes then the dstSubresource aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-dstImage-01555)"}, {VALIDATION_ERROR_09c00c28, "The spec valid usage text states 'If the calling command's srcImage has a multi-planar image format and the dstImage does not have a multi-planar image format, the dstSubresource aspectMask must be VK_IMAGE_ASPECT_COLOR_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-01556)"}, {VALIDATION_ERROR_09c00c2a, "The spec valid usage text states 'If the calling command's dstImage has a multi-planar image format and the srcImage does not have a multi-planar image format, the srcSubresource aspectMask must be VK_IMAGE_ASPECT_COLOR_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-dstImage-01557)"}, + {VALIDATION_ERROR_09c00d7e, "The spec valid usage text states 'If the calling command's srcImage is a compressed image, or a single-plane, \"_422\" image format, all members of srcOffset must be a multiple of the corresponding dimensions of the compressed texel block' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-01727)"}, + {VALIDATION_ERROR_09c00d80, "The spec valid usage text states 'If the calling command's srcImage is a compressed image, or a single-plane, \"_422\" image format, extent.width must be a multiple of the compressed texel block width or (extent.width + srcOffset.x) must equal the source image subresource width' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-01728)"}, + {VALIDATION_ERROR_09c00d82, "The spec valid usage text states 'If the calling command's srcImage is a compressed image, or a single-plane, \"_422\" image format, extent.height must be a multiple of the compressed texel block height or (extent.height + srcOffset.y) must equal the source image subresource height' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-01729)"}, + {VALIDATION_ERROR_09c00d84, "The spec valid usage text states 'If the calling command's srcImage is a compressed image, or a single-plane, \"_422\" image format, extent.depth must be a multiple of the compressed texel block depth or (extent.depth + srcOffset.z) must equal the source image subresource depth' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-01730)"}, + {VALIDATION_ERROR_09c00d86, "The spec valid usage text states 'If the calling command's dstImage is a compressed format image, or a single-plane, \"_422\" image format, all members of dstOffset must be a multiple of the corresponding dimensions of the compressed texel block' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-dstImage-01731)"}, + {VALIDATION_ERROR_09c00d88, "The spec valid usage text states 'If the calling command's dstImage is a compressed format image, or a single-plane, \"_422\" image format, extent.width must be a multiple of the compressed texel block width or (extent.width + dstOffset.x) must equal the destination image subresource width' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-dstImage-01732)"}, + {VALIDATION_ERROR_09c00d8a, "The spec valid usage text states 'If the calling command's dstImage is a compressed format image, or a single-plane, \"_422\" image format, extent.height must be a multiple of the compressed texel block height or (extent.height + dstOffset.y) must equal the destination image subresource height' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-dstImage-01733)"}, + {VALIDATION_ERROR_09c00d8c, "The spec valid usage text states 'If the calling command's dstImage is a compressed format image, or a single-plane, \"_422\" image format, extent.depth must be a multiple of the compressed texel block depth or (extent.depth + dstOffset.z) must equal the destination image subresource depth' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-dstImage-01734)"}, + {VALIDATION_ERROR_09c00df2, "The spec valid usage text states 'If the calling command's srcImage is of type VK_IMAGE_TYPE_1D, then srcOffset.z must be 0 and extent.depth must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcImage-01785)"}, + {VALIDATION_ERROR_09c00df4, "The spec valid usage text states 'If the calling command's dstImage is of type VK_IMAGE_TYPE_1D, then dstOffset.z must be 0 and extent.depth must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstImage-01786)"}, + {VALIDATION_ERROR_09c00df6, "The spec valid usage text states 'If the calling command's srcImage is of type VK_IMAGE_TYPE_2D, then srcOffset.z must be 0.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcImage-01787)"}, + {VALIDATION_ERROR_09c00df8, "The spec valid usage text states 'If the calling command's dstImage is of type VK_IMAGE_TYPE_2D, then dstOffset.z must be 0.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstImage-01788)"}, + {VALIDATION_ERROR_09c00dfa, "The spec valid usage text states 'If the calling command's srcImage or dstImage is of type VK_IMAGE_TYPE_2D, then extent.depth must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcImage-01789)"}, + {VALIDATION_ERROR_09c00dfc, "The spec valid usage text states 'If both srcImage and dstImage are of type VK_IMAGE_TYPE_2D then then extent.depth must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-01790)"}, + {VALIDATION_ERROR_09c00dfe, "The spec valid usage text states 'If the calling command's srcImage is of type VK_IMAGE_TYPE_2D, and the dstImage is of type VK_IMAGE_TYPE_3D, then extent.depth must equal to the layerCount member of srcSubresource.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-01791)"}, + {VALIDATION_ERROR_09c00e00, "The spec valid usage text states 'If the calling command's dstImage is of type VK_IMAGE_TYPE_2D, and the srcImage is of type VK_IMAGE_TYPE_3D, then extent.depth must equal to the layerCount member of dstSubresource.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-dstImage-01792)"}, {VALIDATION_ERROR_09c07a01, "The spec valid usage text states 'dstSubresource must be a valid VkImageSubresourceLayers structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstSubresource-parameter)"}, {VALIDATION_ERROR_09c2d601, "The spec valid usage text states 'srcSubresource must be a valid VkImageSubresourceLayers structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcSubresource-parameter)"}, {VALIDATION_ERROR_09e00758, "The spec valid usage text states 'The combination of format, imageType, tiling, usage, and flags must be supported, as indicated by a VK_SUCCESS return value from vkGetPhysicalDeviceImageFormatProperties invoked with the same values passed to the corresponding parameters.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-format-00940)"}, @@ -4428,7 +4628,7 @@ {VALIDATION_ERROR_09e00766, "The spec valid usage text states 'mipLevels must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-mipLevels-00947)"}, {VALIDATION_ERROR_09e00768, "The spec valid usage text states 'arrayLayers must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-arrayLayers-00948)"}, {VALIDATION_ERROR_09e0076a, "The spec valid usage text states 'If flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, imageType must be VK_IMAGE_TYPE_2D' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-flags-00949)"}, - {VALIDATION_ERROR_09e0076c, "The spec valid usage text states 'If flags contains VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR, imageType must be VK_IMAGE_TYPE_3D' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-flags-00950)"}, + {VALIDATION_ERROR_09e0076c, "The spec valid usage text states 'If flags contains VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, imageType must be VK_IMAGE_TYPE_3D' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-flags-00950)"}, {VALIDATION_ERROR_09e0076e, "The spec valid usage text states 'If imageType is VK_IMAGE_TYPE_1D, extent.width must be less than or equal to VkPhysicalDeviceLimits::maxImageDimension1D, or VkImageFormatProperties::maxExtent.width (as returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure) - whichever is higher' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00951)"}, {VALIDATION_ERROR_09e00770, "The spec valid usage text states 'If imageType is VK_IMAGE_TYPE_2D and flags does not contain VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, extent.width and extent.height must be less than or equal to VkPhysicalDeviceLimits::maxImageDimension2D, or VkImageFormatProperties::maxExtent.width/height (as returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure) - whichever is higher' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00952)"}, {VALIDATION_ERROR_09e00772, "The spec valid usage text states 'If imageType is VK_IMAGE_TYPE_2D and flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, extent.width and extent.height must be less than or equal to VkPhysicalDeviceLimits::maxImageDimensionCube, or VkImageFormatProperties::maxExtent.width/height (as returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure) - whichever is higher' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00953)"}, @@ -4437,7 +4637,7 @@ {VALIDATION_ERROR_09e00778, "The spec valid usage text states 'If imageType is VK_IMAGE_TYPE_1D, both extent.height and extent.depth must be 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00956)"}, {VALIDATION_ERROR_09e0077a, "The spec valid usage text states 'If imageType is VK_IMAGE_TYPE_2D, extent.depth must be 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00957)"}, {VALIDATION_ERROR_09e0077c, "The spec valid usage text states 'mipLevels must be less than or equal to {lfloor}log2(max(extent.width, extent.height, extent.depth)){rfloor} + 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-mipLevels-00958)"}, - {VALIDATION_ERROR_09e0077e, "The spec valid usage text states 'If any of extent.width, extent.height, or extent.depth are greater than the equivalently named members of VkPhysicalDeviceLimits::maxImageDimension3D, mipLevels must be less than or equal to VkImageFormatProperties::maxMipLevels (as returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-extent-00959)"}, + {VALIDATION_ERROR_09e0077e, "The spec valid usage text states 'mipLevels must be less than or equal to VkImageFormatProperties::maxMipLevels (as returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-extent-00959)"}, {VALIDATION_ERROR_09e00780, "The spec valid usage text states 'arrayLayers must be less than or equal to VkImageFormatProperties::maxArrayLayers (as returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-arrayLayers-00960)"}, {VALIDATION_ERROR_09e00782, "The spec valid usage text states 'If imageType is VK_IMAGE_TYPE_3D, arrayLayers must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00961)"}, {VALIDATION_ERROR_09e00784, "The spec valid usage text states 'If samples is not VK_SAMPLE_COUNT_1_BIT, imageType must be VK_IMAGE_TYPE_2D, flags must not contain VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, tiling must be VK_IMAGE_TILING_OPTIMAL, and mipLevels must be equal to 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-samples-00962)"}, @@ -4455,39 +4655,35 @@ {VALIDATION_ERROR_09e0079c, "The spec valid usage text states 'If the sparse residency for images with 4 samples feature is not enabled, imageType is VK_IMAGE_TYPE_2D, and samples is VK_SAMPLE_COUNT_4_BIT, flags must not contain VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00974)"}, {VALIDATION_ERROR_09e0079e, "The spec valid usage text states 'If the sparse residency for images with 8 samples feature is not enabled, imageType is VK_IMAGE_TYPE_2D, and samples is VK_SAMPLE_COUNT_8_BIT, flags must not contain VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00975)"}, {VALIDATION_ERROR_09e007a0, "The spec valid usage text states 'If the sparse residency for images with 16 samples feature is not enabled, imageType is VK_IMAGE_TYPE_2D, and samples is VK_SAMPLE_COUNT_16_BIT, flags must not contain VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00976)"}, - {VALIDATION_ERROR_09e007a2, "The spec valid usage text states 'If tiling is VK_IMAGE_TILING_LINEAR, format must be a format that has at least one supported feature bit present in the value of VkFormatProperties::linearTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00977)"}, - {VALIDATION_ERROR_09e007a4, "The spec valid usage text states 'If tiling is VK_IMAGE_TILING_LINEAR, and VkFormatProperties::linearTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT, usage must not contain VK_IMAGE_USAGE_SAMPLED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00978)"}, - {VALIDATION_ERROR_09e007a6, "The spec valid usage text states 'If tiling is VK_IMAGE_TILING_LINEAR, and VkFormatProperties::linearTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT, usage must not contain VK_IMAGE_USAGE_STORAGE_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00979)"}, - {VALIDATION_ERROR_09e007a8, "The spec valid usage text states 'If tiling is VK_IMAGE_TILING_LINEAR, and VkFormatProperties::linearTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT, usage must not contain VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00980)"}, - {VALIDATION_ERROR_09e007aa, "The spec valid usage text states 'If tiling is VK_IMAGE_TILING_LINEAR, and VkFormatProperties::linearTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, usage must not contain VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00981)"}, - {VALIDATION_ERROR_09e007ac, "The spec valid usage text states 'If tiling is VK_IMAGE_TILING_OPTIMAL, format must be a format that has at least one supported feature bit present in the value of VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00982)"}, - {VALIDATION_ERROR_09e007ae, "The spec valid usage text states 'If tiling is VK_IMAGE_TILING_OPTIMAL, and VkFormatProperties::optimalTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT, usage must not contain VK_IMAGE_USAGE_SAMPLED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00983)"}, - {VALIDATION_ERROR_09e007b0, "The spec valid usage text states 'If tiling is VK_IMAGE_TILING_OPTIMAL, and VkFormatProperties::optimalTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT, usage must not contain VK_IMAGE_USAGE_STORAGE_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00984)"}, - {VALIDATION_ERROR_09e007b2, "The spec valid usage text states 'If tiling is VK_IMAGE_TILING_OPTIMAL, and VkFormatProperties::optimalTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT, usage must not contain VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00985)"}, - {VALIDATION_ERROR_09e007b4, "The spec valid usage text states 'If tiling is VK_IMAGE_TILING_OPTIMAL, and VkFormatProperties::optimalTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, usage must not contain VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00986)"}, {VALIDATION_ERROR_09e007b6, "The spec valid usage text states 'If flags contains VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT or VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, it must also contain VK_IMAGE_CREATE_SPARSE_BINDING_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-flags-00987)"}, - {VALIDATION_ERROR_09e007b8, "The spec valid usage text states 'If the pNext chain contains an instance of VkExternalMemoryImageCreateInfoNV, it must not contain an instance of VkExternalMemoryImageCreateInfoKHR.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-pNext-00988)"}, - {VALIDATION_ERROR_09e007ba, "The spec valid usage text states 'If the pNext chain contains an instance of VkExternalMemoryImageCreateInfoKHR, and any of the handle types specified in VkExternalMemoryImageCreateInfoKHR::handleTypes require a dedicated allocation, as reported by vkGetPhysicalDeviceImageFormatProperties2KHR in VkExternalImageFormatPropertiesKHR::externalMemoryProperties::externalMemoryFeatures, the pNext chain must contain an instance of VkDedicatedAllocationImageCreateInfoNV with its dedicatedAllocation field set to VK_TRUE.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-pNext-00989)"}, - {VALIDATION_ERROR_09e007bc, "The spec valid usage text states 'If the pNext chain contains an instance of VkExternalMemoryImageCreateInfoKHR, its handleTypes member must only contain bits that are also in VkExternalImageFormatPropertiesKHR::externalMemoryProperties::compatibleHandleTypes, as returned by vkGetPhysicalDeviceImageFormatProperties2KHR with format, imageType, tiling, usage, and flags equal to those in this structure, and with an instance of VkPhysicalDeviceExternalImageFormatInfoKHR in the pNext chain, with a handleType equal to any one of the handle types specified in VkExternalMemoryImageCreateInfoKHR::handleTypes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-pNext-00990)"}, + {VALIDATION_ERROR_09e007b8, "The spec valid usage text states 'If the pNext chain contains an instance of VkExternalMemoryImageCreateInfoNV, it must not contain an instance of VkExternalMemoryImageCreateInfo.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-pNext-00988)"}, + {VALIDATION_ERROR_09e007bc, "The spec valid usage text states 'If the pNext chain contains an instance of VkExternalMemoryImageCreateInfo, its handleTypes member must only contain bits that are also in VkExternalImageFormatProperties::externalMemoryProperties::compatibleHandleTypes, as returned by vkGetPhysicalDeviceImageFormatProperties2 with format, imageType, tiling, usage, and flags equal to those in this structure, and with an instance of VkPhysicalDeviceExternalImageFormatInfo in the pNext chain, with a handleType equal to any one of the handle types specified in VkExternalMemoryImageCreateInfo::handleTypes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-pNext-00990)"}, {VALIDATION_ERROR_09e007be, "The spec valid usage text states 'If the pNext chain contains an instance of VkExternalMemoryImageCreateInfoNV, its handleTypes member must only contain bits that are also in VkExternalImageFormatPropertiesNV::externalMemoryProperties::compatibleHandleTypes, as returned by vkGetPhysicalDeviceExternalImageFormatPropertiesNV with format, imageType, tiling, usage, and flags equal to those in this structure, and with externalHandleType equal to any one of the handle types specified in VkExternalMemoryImageCreateInfoNV::handleTypes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-pNext-00991)"}, - {VALIDATION_ERROR_09e007c0, "The spec valid usage text states 'If flags contains VK_IMAGE_CREATE_BIND_SFR_BIT_KHX, then mipLevels must be one, arrayLayers must be one, imageType must be VK_IMAGE_TYPE_2D, and tiling must be VK_IMAGE_TILING_OPTIMAL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-flags-00992)"}, + {VALIDATION_ERROR_09e007c0, "The spec valid usage text states 'If flags contains VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT, then mipLevels must be one, arrayLayers must be one, imageType must be VK_IMAGE_TYPE_2D, and tiling must be VK_IMAGE_TILING_OPTIMAL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-flags-00992)"}, {VALIDATION_ERROR_09e007c2, "The spec valid usage text states 'initialLayout must be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-initialLayout-00993)"}, {VALIDATION_ERROR_09e00ae0, "The spec valid usage text states 'If sharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the physicalDevice that was used to create device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-sharingMode-01392)"}, - {VALIDATION_ERROR_09e00b18, "The spec valid usage text states 'If sharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by either vkGetPhysicalDeviceQueueFamilyProperties or vkGetPhysicalDeviceQueueFamilyProperties2KHR for the physicalDevice that was used to create device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-sharingMode-01420)"}, - {VALIDATION_ERROR_09e00b1a, "The spec valid usage text states 'If the logical device was created with VkDeviceGroupDeviceCreateInfoKHX::physicalDeviceCount equal to 1, flags must not contain VK_IMAGE_CREATE_BIND_SFR_BIT_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-physicalDeviceCount-01421)"}, - {VALIDATION_ERROR_09e00b46, "The spec valid usage text states 'If the pNext chain includes a' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-pNext-01443)"}, + {VALIDATION_ERROR_09e00b18, "The spec valid usage text states 'If sharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by either vkGetPhysicalDeviceQueueFamilyProperties or vkGetPhysicalDeviceQueueFamilyProperties2 for the physicalDevice that was used to create device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-sharingMode-01420)"}, + {VALIDATION_ERROR_09e00b1a, "The spec valid usage text states 'If the logical device was created with VkDeviceGroupDeviceCreateInfo::physicalDeviceCount equal to 1, flags must not contain VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-physicalDeviceCount-01421)"}, + {VALIDATION_ERROR_09e00b46, "The spec valid usage text states 'If the pNext chain includes a ifdef::VK_VERSION_1_1,VK_KHR_external_memory[VkExternalMemoryImageCreateInfo]' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-pNext-01443)"}, {VALIDATION_ERROR_09e00bfa, "The spec valid usage text states 'If flags contains VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT format must be a depth or depth/stencil format' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-flags-01533)"}, - {VALIDATION_ERROR_09e00c48, "The spec valid usage text states 'If flags contains VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR, then format must be a block-compressed image format, an ETC compressed image format, or an ASTC compressed image format.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-flags-01572)"}, - {VALIDATION_ERROR_09e00c4a, "The spec valid usage text states 'If flags contains VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR, then flags must also contain VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-flags-01573)"}, - {VALIDATION_ERROR_09e00c4c, "The spec valid usage text states 'If the image format is one of those listed in Formats requiring sampler Y'CBCR conversion for VK_IMAGE_ASPECT_COLOR_BIT image views:' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-format-01574)"}, - {VALIDATION_ERROR_09e00c4e, "The spec valid usage text states 'If tiling is VK_IMAGE_TILING_OPTIMAL, format is a multi-planar format, and VkFormatProperties::optimalTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_DISJOINT_BIT_KHR, flags must not contain VK_IMAGE_CREATE_DISJOINT_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-tiling-01575)"}, - {VALIDATION_ERROR_09e00c50, "The spec valid usage text states 'If tiling is VK_IMAGE_TILING_LINEAR, format is a multi-planar format, and VkFormatProperties::linearTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_DISJOINT_BIT_KHR, flags must not contain VK_IMAGE_CREATE_DISJOINT_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-tiling-01576)"}, - {VALIDATION_ERROR_09e00c52, "The spec valid usage text states 'If format is not a multi-planar format, and flags does not include VK_IMAGE_CREATE_ALIAS_BIT_KHR, flags must not contain VK_IMAGE_CREATE_DISJOINT_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-format-01577)"}, + {VALIDATION_ERROR_09e00c48, "The spec valid usage text states 'If flags contains VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, then format must be a block-compressed image format, an ETC compressed image format, or an ASTC compressed image format.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-flags-01572)"}, + {VALIDATION_ERROR_09e00c4a, "The spec valid usage text states 'If flags contains VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, then flags must also contain VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-flags-01573)"}, + {VALIDATION_ERROR_09e00c4c, "The spec valid usage text states 'If the image format is one of those listed in features-formats-requiring-sampler-ycbcr-conversion:' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-format-01574)"}, + {VALIDATION_ERROR_09e00c4e, "The spec valid usage text states 'If tiling is VK_IMAGE_TILING_OPTIMAL, format is a multi-planar format, and VkFormatProperties::optimalTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_DISJOINT_BIT, flags must not contain VK_IMAGE_CREATE_DISJOINT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-tiling-01575)"}, + {VALIDATION_ERROR_09e00c50, "The spec valid usage text states 'If tiling is VK_IMAGE_TILING_LINEAR, format is a multi-planar format, and VkFormatProperties::linearTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_DISJOINT_BIT, flags must not contain VK_IMAGE_CREATE_DISJOINT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-tiling-01576)"}, + {VALIDATION_ERROR_09e00c52, "The spec valid usage text states 'If format is not a multi-planar format, and flags does not include VK_IMAGE_CREATE_ALIAS_BIT, flags must not contain VK_IMAGE_CREATE_DISJOINT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-format-01577)"}, + {VALIDATION_ERROR_09e00ec2, "The spec valid usage text states 'If the pNext chain doesn't contain an instance of VkExternalFormatANDROID, or if format is not VK_FORMAT_UNDEFINED, the combination of format, imageType, tiling, usage, and flags must be supported, as indicated by a VK_SUCCESS return value from vkGetPhysicalDeviceImageFormatProperties invoked with the same values passed to the corresponding parameters.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-pNext-01889)"}, + {VALIDATION_ERROR_09e00ec4, "The spec valid usage text states 'If the protected memory feature is not enabled, flags must not contain VK_IMAGE_CREATE_PROTECTED_BIT.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-flags-01890)"}, + {VALIDATION_ERROR_09e00ec6, "The spec valid usage text states 'If any of the bits VK_IMAGE_CREATE_SPARSE_BINDING_BIT, VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, or VK_IMAGE_CREATE_SPARSE_ALIASED_BIT are set, VK_IMAGE_CREATE_PROTECTED_BIT must not also be set.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-None-01891)"}, + {VALIDATION_ERROR_09e00ec8, "The spec valid usage text states 'If the pNext chain includes a VkExternalMemoryImageCreateInfo structure whose handleTypes member includes VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID:' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-pNext-01892)"}, + {VALIDATION_ERROR_09e00eca, "The spec valid usage text states 'If the pNext chain includes a VkExternalFormatANDROID structure whose externalFormat member is not 0:' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCreateInfo-pNext-01893)"}, + {VALIDATION_ERROR_09e00f08, "The spec valid usage text states 'If the sparse aliased residency feature is not enabled, flags must not contain VK_IMAGE_CREATE_SPARSE_ALIASED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-flags-01924)"}, + {VALIDATION_ERROR_09e00f0a, "The spec valid usage text states 'If any of the bits VK_IMAGE_CREATE_SPARSE_BINDING_BIT, VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, or VK_IMAGE_CREATE_SPARSE_ALIASED_BIT are set, VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT must not also be set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-None-01925)"}, {VALIDATION_ERROR_09e09001, "The spec valid usage text states 'flags must be a valid combination of VkImageCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-flags-parameter)"}, {VALIDATION_ERROR_09e09201, "The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-format-parameter)"}, {VALIDATION_ERROR_09e0ac01, "The spec valid usage text states 'imageType must be a valid VkImageType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-imageType-parameter)"}, {VALIDATION_ERROR_09e0b801, "The spec valid usage text states 'initialLayout must be a valid VkImageLayout value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-initialLayout-parameter)"}, - {VALIDATION_ERROR_09e1c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDedicatedAllocationImageCreateInfoNV, VkExternalMemoryImageCreateInfoKHR, VkExternalMemoryImageCreateInfoNV, VkImageFormatListCreateInfoKHR, or VkImageSwapchainCreateInfoKHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-pNext-pNext)"}, + {VALIDATION_ERROR_09e1c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDedicatedAllocationImageCreateInfoNV, VkExternalFormatANDROID, VkExternalMemoryImageCreateInfo, VkExternalMemoryImageCreateInfoNV, VkImageFormatListCreateInfoKHR, or VkImageSwapchainCreateInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-pNext-pNext)"}, {VALIDATION_ERROR_09e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-sType-sType)"}, {VALIDATION_ERROR_09e2b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-sType-unique)"}, {VALIDATION_ERROR_09e2b401, "The spec valid usage text states 'samples must be a valid VkSampleCountFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-samples-parameter)"}, @@ -4498,12 +4694,9 @@ {VALIDATION_ERROR_0a00095a, "The spec valid usage text states 'oldLayout must be VK_IMAGE_LAYOUT_UNDEFINED or the current layout of the image subresources affected by the barrier' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-oldLayout-01197)"}, {VALIDATION_ERROR_0a00095c, "The spec valid usage text states 'newLayout must not be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-newLayout-01198)"}, {VALIDATION_ERROR_0a00095e, "The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, srcQueueFamilyIndex and dstQueueFamilyIndex must both be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01199)"}, - {VALIDATION_ERROR_0a000960, "The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, srcQueueFamilyIndex and dstQueueFamilyIndex must either both be VK_QUEUE_FAMILY_IGNORED, or both be a valid queue family (see Queue Family Properties).' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01200)"}, + {VALIDATION_ERROR_0a000960, "The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, srcQueueFamilyIndex and dstQueueFamilyIndex must either both be VK_QUEUE_FAMILY_IGNORED, or both be a valid queue family (see devsandqueues-queueprops).' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01200)"}, {VALIDATION_ERROR_0a000962, "The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, dstQueueFamilyIndex must also be VK_QUEUE_FAMILY_IGNORED.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01201)"}, - {VALIDATION_ERROR_0a000964, "The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or VK_QUEUE_FAMILY_EXTERNAL_KHR (see Queue Family Properties).' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01202)"}, - {VALIDATION_ERROR_0a000966, "The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and dstQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or VK_QUEUE_FAMILY_EXTERNAL_KHR (see Queue Family Properties).' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01203)"}, {VALIDATION_ERROR_0a00096a, "The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, and srcQueueFamilyIndex and dstQueueFamilyIndex are not VK_QUEUE_FAMILY_IGNORED, at least one of them must be the same as the family of the queue that will execute this barrier' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01205)"}, - {VALIDATION_ERROR_0a00096c, "The spec valid usage text states 'subresourceRange must be a valid image subresource range for the image (see Image Views)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-subresourceRange-01206)"}, {VALIDATION_ERROR_0a00096e, "The spec valid usage text states 'If image has a depth/stencil format with both depth and stencil components, then the aspectMask member of subresourceRange must include both VK_IMAGE_ASPECT_DEPTH_BIT and VK_IMAGE_ASPECT_STENCIL_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01207)"}, {VALIDATION_ERROR_0a000970, "The spec valid usage text states 'If either oldLayout or newLayout is VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL then image must have been created with VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-oldLayout-01208)"}, {VALIDATION_ERROR_0a000972, "The spec valid usage text states 'If either oldLayout or newLayout is VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL then image must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-oldLayout-01209)"}, @@ -4512,18 +4705,19 @@ {VALIDATION_ERROR_0a000978, "The spec valid usage text states 'If either oldLayout or newLayout is VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL then image must have been created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-oldLayout-01212)"}, {VALIDATION_ERROR_0a00097a, "The spec valid usage text states 'If either oldLayout or newLayout is VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL then image must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-oldLayout-01213)"}, {VALIDATION_ERROR_0a000aca, "The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, at least one of srcQueueFamilyIndex and dstQueueFamilyIndex must be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01381)"}, - {VALIDATION_ERROR_0a000acc, "The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, and one of srcQueueFamilyIndex and dstQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, the other must be VK_QUEUE_FAMILY_IGNORED or VK_QUEUE_FAMILY_EXTERNAL_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01382)"}, {VALIDATION_ERROR_0a000b9c, "The spec valid usage text states 'subresourceRange.baseMipLevel must be less than the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-subresourceRange-01486)"}, - {VALIDATION_ERROR_0a000b9e, "The spec valid usage text states 'If subresourceRange::levelCount is not VK_REMAINING_MIP_LEVELS, subresourceRange::levelCount must be non-zero and subresourceRange::baseMipLevel + subresourceRange::levelCount must be less than or equal to the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-subresourceRange-01487)"}, {VALIDATION_ERROR_0a000ba0, "The spec valid usage text states 'subresourceRange.baseArrayLayer must be less than the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-subresourceRange-01488)"}, - {VALIDATION_ERROR_0a000ba2, "The spec valid usage text states 'If subresourceRange::layerCount is not VK_REMAINING_ARRAY_LAYERS, subresourceRange::layerCount must be non-zero and subresourceRange::baseArrayLayer + subresourceRange::layerCount must be less than or equal to the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-subresourceRange-01489)"}, - {VALIDATION_ERROR_0a000cf4, "The spec valid usage text states 'If either oldLayout or newLayout is VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR then image must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-oldLayout-01658)"}, - {VALIDATION_ERROR_0a000cf6, "The spec valid usage text states 'If either oldLayout or newLayout is VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR then image must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-oldLayout-01659)"}, + {VALIDATION_ERROR_0a000cf4, "The spec valid usage text states 'If either oldLayout or newLayout is VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL then image must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-oldLayout-01658)"}, + {VALIDATION_ERROR_0a000cf6, "The spec valid usage text states 'If either oldLayout or newLayout is VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL then image must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-oldLayout-01659)"}, {VALIDATION_ERROR_0a000d0e, "The spec valid usage text states 'If image has a single-plane color format or is not disjoint, then the aspectMask member of subresourceRange must be VK_IMAGE_ASPECT_COLOR_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01671)"}, - {VALIDATION_ERROR_0a000d10, "The spec valid usage text states 'If image has a multi-planar format and the image is disjoint, then the aspectMask member of subresourceRange must include either at least one of VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR, and VK_IMAGE_ASPECT_PLANE_2_BIT_KHR; or must include VK_IMAGE_ASPECT_COLOR_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01672)"}, - {VALIDATION_ERROR_0a000d12, "The spec valid usage text states 'If image has a multi-planar format with only two planes, then the aspectMask member of subresourceRange must not include VK_IMAGE_ASPECT_PLANE_2_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01673)"}, + {VALIDATION_ERROR_0a000d10, "The spec valid usage text states 'If image has a multi-planar format and the image is disjoint, then the aspectMask member of subresourceRange must include either at least one of VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, and VK_IMAGE_ASPECT_PLANE_2_BIT; or must include VK_IMAGE_ASPECT_COLOR_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01672)"}, + {VALIDATION_ERROR_0a000d12, "The spec valid usage text states 'If image has a multi-planar format with only two planes, then the aspectMask member of subresourceRange must not include VK_IMAGE_ASPECT_PLANE_2_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01673)"}, {VALIDATION_ERROR_0a000d78, "The spec valid usage text states 'If subresourceRange.levelCount is not VK_REMAINING_MIP_LEVELS, subresourceRange.baseMipLevel + subresourceRange.levelCount must be less than or equal to the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-subresourceRange-01724)"}, {VALIDATION_ERROR_0a000d7a, "The spec valid usage text states 'If subresourceRange.layerCount is not VK_REMAINING_ARRAY_LAYERS, subresourceRange.baseArrayLayer + subresourceRange.layerCount must be less than or equal to the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-subresourceRange-01725)"}, + {VALIDATION_ERROR_0a000dcc, "The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, and one of srcQueueFamilyIndex and dstQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, the other must be VK_QUEUE_FAMILY_IGNORED or a special queue family reserved for external memory transfers, as described in synchronization-queue-transfers.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01766)"}, + {VALIDATION_ERROR_0a000dce, "The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in synchronization-queue-transfers.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01767)"}, + {VALIDATION_ERROR_0a000dd0, "The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and dstQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in synchronization-queue-transfers.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01768)"}, + {VALIDATION_ERROR_0a000f18, "The spec valid usage text states 'If image is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01932)"}, {VALIDATION_ERROR_0a006801, "The spec valid usage text states 'dstAccessMask must be a valid combination of VkAccessFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-dstAccessMask-parameter)"}, {VALIDATION_ERROR_0a00a001, "The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-image-parameter)"}, {VALIDATION_ERROR_0a00d401, "The spec valid usage text states 'newLayout must be a valid VkImageLayout value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-newLayout-parameter)"}, @@ -4547,32 +4741,24 @@ {VALIDATION_ERROR_0a20022c, "The spec valid usage text states 'If the calling command's dstImage is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then dstOffset.z must be 0 and extent.depth must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageResolve-dstImage-00278)"}, {VALIDATION_ERROR_0a207a01, "The spec valid usage text states 'dstSubresource must be a valid VkImageSubresourceLayers structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageResolve-dstSubresource-parameter)"}, {VALIDATION_ERROR_0a22d601, "The spec valid usage text states 'srcSubresource must be a valid VkImageSubresourceLayers structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageResolve-srcSubresource-parameter)"}, - {VALIDATION_ERROR_0a4007cc, "The spec valid usage text states 'mipLevel must be less than the mipLevels specified in VkImageCreateInfo when the image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSubresource-mipLevel-00998)"}, - {VALIDATION_ERROR_0a4007ce, "The spec valid usage text states 'arrayLayer must be less than the arrayLayers specified in VkImageCreateInfo when the image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSubresource-arrayLayer-00999)"}, {VALIDATION_ERROR_0a400c01, "The spec valid usage text states 'aspectMask must be a valid combination of VkImageAspectFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSubresource-aspectMask-parameter)"}, {VALIDATION_ERROR_0a400c03, "The spec valid usage text states 'aspectMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSubresource-aspectMask-requiredbitmask)"}, {VALIDATION_ERROR_0a60014e, "The spec valid usage text states 'If aspectMask contains VK_IMAGE_ASPECT_COLOR_BIT, it must not contain either of VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSubresourceLayers-aspectMask-00167)"}, {VALIDATION_ERROR_0a600150, "The spec valid usage text states 'aspectMask must not contain VK_IMAGE_ASPECT_METADATA_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSubresourceLayers-aspectMask-00168)"}, - {VALIDATION_ERROR_0a600152, "The spec valid usage text states 'mipLevel must be less than the mipLevels specified in VkImageCreateInfo when the image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSubresourceLayers-mipLevel-00169)"}, - {VALIDATION_ERROR_0a600154, "The spec valid usage text states '(baseArrayLayer + layerCount) must be less than or equal to the arrayLayers specified in VkImageCreateInfo when the image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSubresourceLayers-baseArrayLayer-00170)"}, {VALIDATION_ERROR_0a600c01, "The spec valid usage text states 'aspectMask must be a valid combination of VkImageAspectFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSubresourceLayers-aspectMask-parameter)"}, {VALIDATION_ERROR_0a600c03, "The spec valid usage text states 'aspectMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask)"}, {VALIDATION_ERROR_0a600d48, "The spec valid usage text states 'layerCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSubresourceLayers-layerCount-01700)"}, - {VALIDATION_ERROR_0a8007fc, "The spec valid usage text states 'If levelCount is not VK_REMAINING_MIP_LEVELS, levelCount must be non-zero and (baseMipLevel + levelCount) must be less than or equal to the mipLevels specified in VkImageCreateInfo when the image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSubresourceRange-levelCount-01022)"}, - {VALIDATION_ERROR_0a8007fe, "The spec valid usage text states 'If layerCount is not VK_REMAINING_ARRAY_LAYERS, layerCount must be non-zero and (baseArrayLayer + layerCount) must be less than or equal to the arrayLayers specified in VkImageCreateInfo when the image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSubresourceRange-layerCount-01023)"}, - {VALIDATION_ERROR_0a800800, "The spec valid usage text states 'If the imageType specified in VkImageCreateInfo when the image was created was VK_IMAGE_TYPE_3D and the image view is created with the viewType of VkImageViewCreateInfo set to VK_IMAGE_VIEW_TYPE_2D_ARRAY then layerCount must be VK_REMAINING_ARRAY_LAYERS, or layerCount must be non-zero and (baseArrayLayer + layerCount) must be less than or equal to the extent.depth specified in VkImageCreateInfo when the image was created' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageSubresourceRange-imageType-01024)"}, - {VALIDATION_ERROR_0a800802, "The spec valid usage text states 'If the imageType specified in VkImageCreateInfo when the image was created was not VK_IMAGE_TYPE_3D or the image view is not created with the viewType of VkImageViewCreateInfo set to VK_IMAGE_VIEW_TYPE_2D_ARRAY then layerCount must be VK_REMAINING_ARRAY_LAYERS, or layerCount must be non-zero and (baseArrayLayer + layerCount) must be less than or equal to the arrayLayers specified in VkImageCreateInfo when the image was created' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageSubresourceRange-imageType-01025)"}, {VALIDATION_ERROR_0a800c01, "The spec valid usage text states 'aspectMask must be a valid combination of VkImageAspectFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSubresourceRange-aspectMask-parameter)"}, {VALIDATION_ERROR_0a800c03, "The spec valid usage text states 'aspectMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSubresourceRange-aspectMask-requiredbitmask)"}, - {VALIDATION_ERROR_0a800d0c, "The spec valid usage text states 'If aspectMask includes VK_IMAGE_ASPECT_COLOR_BIT, then it must not include any of VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR, or VK_IMAGE_ASPECT_PLANE_2_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSubresourceRange-aspectMask-01670)"}, + {VALIDATION_ERROR_0a800d0c, "The spec valid usage text states 'If aspectMask includes VK_IMAGE_ASPECT_COLOR_BIT, then it must not include any of VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageSubresourceRange-aspectMask-01670)"}, {VALIDATION_ERROR_0a800d70, "The spec valid usage text states 'If levelCount is not VK_REMAINING_MIP_LEVELS, it must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSubresourceRange-levelCount-01720)"}, {VALIDATION_ERROR_0a800d72, "The spec valid usage text states 'If layerCount is not VK_REMAINING_ARRAY_LAYERS, it must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSubresourceRange-layerCount-01721)"}, - {VALIDATION_ERROR_0aa007c6, "The spec valid usage text states 'If swapchain is not VK_NULL_HANDLE, the fields of VkImageCreateInfo must match the implied image creation parameters of the swapchain' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSwapchainCreateInfoKHX-swapchain-00995)"}, - {VALIDATION_ERROR_0aa2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSwapchainCreateInfoKHX-sType-sType)"}, - {VALIDATION_ERROR_0aa2f001, "The spec valid usage text states 'If swapchain is not VK_NULL_HANDLE, swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSwapchainCreateInfoKHX-swapchain-parameter)"}, + {VALIDATION_ERROR_0aa007c6, "The spec valid usage text states 'If swapchain is not VK_NULL_HANDLE, the fields of VkImageCreateInfo must match the implied image creation parameters of the swapchain' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageSwapchainCreateInfoKHR-swapchain-00995)"}, + {VALIDATION_ERROR_0aa2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageSwapchainCreateInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_0aa2f001, "The spec valid usage text states 'If swapchain is not VK_NULL_HANDLE, swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageSwapchainCreateInfoKHR-swapchain-parameter)"}, {VALIDATION_ERROR_0ac007d6, "The spec valid usage text states 'If image was not created with VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT then viewType must not be VK_IMAGE_VIEW_TYPE_CUBE or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01003)"}, {VALIDATION_ERROR_0ac007d8, "The spec valid usage text states 'If the image cubemap arrays feature is not enabled, viewType must not be VK_IMAGE_VIEW_TYPE_CUBE_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-viewType-01004)"}, - {VALIDATION_ERROR_0ac007da, "The spec valid usage text states 'If image was created with VK_IMAGE_TYPE_3D but without VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR set then viewType must not be VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01005)"}, + {VALIDATION_ERROR_0ac007da, "The spec valid usage text states 'If image was created with VK_IMAGE_TYPE_3D but without VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT set then viewType must not be VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01005)"}, {VALIDATION_ERROR_0ac007dc, "The spec valid usage text states 'If image was created with VK_IMAGE_TILING_LINEAR, format must be format that has at least one supported feature bit present in the value of VkFormatProperties::linearTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01006)"}, {VALIDATION_ERROR_0ac007de, "The spec valid usage text states 'image must have been created with a usage value containing at least one of VK_IMAGE_USAGE_SAMPLED_BIT, VK_IMAGE_USAGE_STORAGE_BIT, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, or VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01007)"}, {VALIDATION_ERROR_0ac007e0, "The spec valid usage text states 'If image was created with VK_IMAGE_TILING_LINEAR and usage contains VK_IMAGE_USAGE_SAMPLED_BIT, format must be supported for sampled images, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT flag in VkFormatProperties::linearTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01008)"}, @@ -4584,240 +4770,236 @@ {VALIDATION_ERROR_0ac007ec, "The spec valid usage text states 'If image was created with VK_IMAGE_TILING_OPTIMAL and usage contains VK_IMAGE_USAGE_STORAGE_BIT, format must be supported for storage images, as specified by the VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT flag in VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01014)"}, {VALIDATION_ERROR_0ac007ee, "The spec valid usage text states 'If image was created with VK_IMAGE_TILING_OPTIMAL and usage contains VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, format must be supported for color attachments, as specified by the VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT flag in VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01015)"}, {VALIDATION_ERROR_0ac007f0, "The spec valid usage text states 'If image was created with VK_IMAGE_TILING_OPTIMAL and usage contains VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, format must be supported for depth/stencil attachments, as specified by the VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT flag in VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01016)"}, - {VALIDATION_ERROR_0ac007f2, "The spec valid usage text states 'subresourceRange must be a valid image subresource range for image (see Image Views)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-subresourceRange-01017)"}, - {VALIDATION_ERROR_0ac007f4, "The spec valid usage text states 'If image was created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01018)"}, - {VALIDATION_ERROR_0ac007f6, "The spec valid usage text states 'If image was not created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag,' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01019)"}, + {VALIDATION_ERROR_0ac007f4, "The spec valid usage text states 'If image was created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, format must be compatible with the format used to create image, as defined in Format Compatibility Classes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01018)"}, + {VALIDATION_ERROR_0ac007f6, "The spec valid usage text states 'If image was not created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, format must be identical to the format used to create image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01019)"}, {VALIDATION_ERROR_0ac007f8, "The spec valid usage text states 'If image is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01020)"}, {VALIDATION_ERROR_0ac007fa, "The spec valid usage text states 'subresourceRange and viewType must be compatible with the image, as described in the compatibility table' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-subResourceRange-01021)"}, {VALIDATION_ERROR_0ac00b8c, "The spec valid usage text states 'subresourceRange.baseMipLevel must be less than the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-subresourceRange-01478)"}, - {VALIDATION_ERROR_0ac00b8e, "The spec valid usage text states 'If subresourceRange::levelCount is not VK_REMAINING_MIP_LEVELS, subresourceRange::levelCount must be non-zero and subresourceRange::baseMipLevel + subresourceRange::levelCount must be less than or equal to the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-subresourceRange-01479)"}, {VALIDATION_ERROR_0ac00b90, "The spec valid usage text states 'subresourceRange.baseArrayLayer must be less than the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-subresourceRange-01480)"}, - {VALIDATION_ERROR_0ac00b92, "The spec valid usage text states 'If subresourceRange::layerCount is not VK_REMAINING_ARRAY_LAYERS, subresourceRange::layerCount must be non-zero and subresourceRange::baseArrayLayer + subresourceRange::layerCount must be less than or equal to the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-subresourceRange-01481)"}, - {VALIDATION_ERROR_0ac00b94, "The spec valid usage text states 'If image is not a 3D image created with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR set, or viewType is not VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY, subresourceRange::baseArrayLayer must be less than the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01482)"}, - {VALIDATION_ERROR_0ac00b96, "The spec valid usage text states 'If subresourceRange::layerCount is not VK_REMAINING_ARRAY_LAYERS, image is not a 3D image created with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR set, or viewType is not VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY, subresourceRange::layerCount must be non-zero and subresourceRange::baseArrayLayer + subresourceRange::layerCount must be less than or equal to the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-subresourceRange-01483)"}, - {VALIDATION_ERROR_0ac00b98, "The spec valid usage text states 'If image is a 3D image created with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR set, and viewType is VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY, subresourceRange::baseArrayLayer must be less than the extent.depth specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01484)"}, - {VALIDATION_ERROR_0ac00b9a, "The spec valid usage text states 'If subresourceRange::layerCount is not VK_REMAINING_ARRAY_LAYERS, image is a 3D image created with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR set, and viewType is VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY, subresourceRange::layerCount must be non-zero and subresourceRange::baseArrayLayer + subresourceRange::layerCount must be less than or equal to the extent.depth specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-subresourceRange-01485)"}, - {VALIDATION_ERROR_0ac00c5e, "The spec valid usage text states 'If image was created with the VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR flag, format must be compatible with, or must be an uncompressed format that is size-compatible with, the format used to create image.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01583)"}, - {VALIDATION_ERROR_0ac00c60, "The spec valid usage text states 'If image was created with the VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR flag, the levelCount and layerCount members of subresourceRange must both be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01584)"}, + {VALIDATION_ERROR_0ac00b94, "The spec valid usage text states 'If image is not a 3D image created with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT set, or viewType is not VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY, subresourceRange::baseArrayLayer must be less than the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01482)"}, + {VALIDATION_ERROR_0ac00b96, "The spec valid usage text states 'If subresourceRange::layerCount is not VK_REMAINING_ARRAY_LAYERS, image is not a 3D image created with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT set, or viewType is not VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY, subresourceRange::layerCount must be non-zero and subresourceRange::baseArrayLayer + subresourceRange::layerCount must be less than or equal to the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-subresourceRange-01483)"}, + {VALIDATION_ERROR_0ac00b98, "The spec valid usage text states 'If image is a 3D image created with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT set, and viewType is VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY, subresourceRange::baseArrayLayer must be less than the extent.depth specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01484)"}, + {VALIDATION_ERROR_0ac00b9a, "The spec valid usage text states 'If subresourceRange::layerCount is not VK_REMAINING_ARRAY_LAYERS, image is a 3D image created with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT set, and viewType is VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY, subresourceRange::layerCount must be non-zero and subresourceRange::baseArrayLayer + subresourceRange::layerCount must be less than or equal to the extent.depth specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-subresourceRange-01485)"}, + {VALIDATION_ERROR_0ac00c5e, "The spec valid usage text states 'If image was created with the VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag, format must be compatible with, or must be an uncompressed format that is size-compatible with, the format used to create image.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01583)"}, + {VALIDATION_ERROR_0ac00c60, "The spec valid usage text states 'If image was created with the VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag, the levelCount and layerCount members of subresourceRange must both be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01584)"}, {VALIDATION_ERROR_0ac00c62, "The spec valid usage text states 'If a VkImageFormatListCreateInfoKHR structure was included in the pNext chain of the VkImageCreateInfo struct used when creating image and the viewFormatCount field of VkImageFormatListCreateInfoKHR is not zero then format must be one of the formats in VkImageFormatListCreateInfoKHR::pViewFormats.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-pNext-01585)"}, - {VALIDATION_ERROR_0ac00c64, "The spec valid usage text states 'If image was created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, if the format of the image is a multi-planar format, and if subresourceRange.aspectMask is one of VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR, or VK_IMAGE_ASPECT_PLANE_2_BIT_KHR, then format must be compatible with the VkFormat for the plane of the image format indicated by subresourceRange.aspectMask, as defined in Compatible formats of planes of multi-planar formats' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01586)"}, + {VALIDATION_ERROR_0ac00c64, "The spec valid usage text states 'If image was created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, if the format of the image is a multi-planar format, and if subresourceRange.aspectMask is one of VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT, then format must be compatible with the VkFormat for the plane of the image format indicated by subresourceRange.aspectMask, as defined in features-formats-compatible-planes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01586)"}, {VALIDATION_ERROR_0ac00d6c, "The spec valid usage text states 'If subresourceRange.levelCount is not VK_REMAINING_MIP_LEVELS, subresourceRange.baseMipLevel + subresourceRange.levelCount must be less than or equal to the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-subresourceRange-01718)"}, {VALIDATION_ERROR_0ac00d6e, "The spec valid usage text states 'If subresourceRange.layerCount is not VK_REMAINING_ARRAY_LAYERS, subresourceRange.baseArrayLayer + subresourceRange.layerCount must be less than or equal to the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-subresourceRange-01719)"}, + {VALIDATION_ERROR_0ac00dbe, "The spec valid usage text states 'If image was created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, but without the VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag, format must be compatible with the format used to create image, as defined in Format Compatibility Classes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01759)"}, + {VALIDATION_ERROR_0ac00dc0, "The spec valid usage text states 'If image was created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, and if the format of the image is not a multi-planar format, format must be compatible with the format used to create image, as defined in Format Compatibility Classes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01760)"}, + {VALIDATION_ERROR_0ac00dc2, "The spec valid usage text states 'If image was created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, but without the VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag, and if the format of the image is not a multi-planar format, format must be compatible with the format used to create image, as defined in Format Compatibility Classes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01761)"}, + {VALIDATION_ERROR_0ac00dc4, "The spec valid usage text states 'If image was not created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag,' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01762)"}, + {VALIDATION_ERROR_0ac00ed0, "The spec valid usage text states 'If image has an external format:' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01896)"}, {VALIDATION_ERROR_0ac02c01, "The spec valid usage text states 'components must be a valid VkComponentMapping structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-components-parameter)"}, {VALIDATION_ERROR_0ac09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-flags-zerobitmask)"}, {VALIDATION_ERROR_0ac09201, "The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-format-parameter)"}, {VALIDATION_ERROR_0ac0a001, "The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-parameter)"}, - {VALIDATION_ERROR_0ac1c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkImageViewUsageCreateInfoKHR or VkSamplerYcbcrConversionInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-pNext-pNext)"}, + {VALIDATION_ERROR_0ac1c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkImageViewUsageCreateInfo or VkSamplerYcbcrConversionInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-pNext-pNext)"}, {VALIDATION_ERROR_0ac2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-sType-sType)"}, {VALIDATION_ERROR_0ac2b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-sType-unique)"}, {VALIDATION_ERROR_0ac2ea01, "The spec valid usage text states 'subresourceRange must be a valid VkImageSubresourceRange structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-subresourceRange-parameter)"}, {VALIDATION_ERROR_0ac30801, "The spec valid usage text states 'viewType must be a valid VkImageViewType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-viewType-parameter)"}, - {VALIDATION_ERROR_0ae00536, "The spec valid usage text states 'If handleType is not 0, it must be supported for import, as reported by VkExternalImageFormatPropertiesKHR or VkExternalBufferPropertiesKHR.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryFdInfoKHR-handleType-00667)"}, - {VALIDATION_ERROR_0ae00538, "The spec valid usage text states 'The memory from which fd was exported must have been created on the same underlying physical device as device.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryFdInfoKHR-fd-00668)"}, - {VALIDATION_ERROR_0ae0053a, "The spec valid usage text states 'If handleType is not 0, it must be defined as a POSIX file descriptor handle.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryFdInfoKHR-handleType-00669)"}, - {VALIDATION_ERROR_0ae0053c, "The spec valid usage text states 'If handleType is not 0, fd must be a valid handle of the type specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryFdInfoKHR-handleType-00670)"}, - {VALIDATION_ERROR_0ae00be0, "The spec valid usage text states 'fd must obey any requirements listed for handleType in external memory handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryFdInfoKHR-fd-01520)"}, - {VALIDATION_ERROR_0ae09c01, "The spec valid usage text states 'If handleType is not 0, handleType must be a valid VkExternalMemoryHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryFdInfoKHR-handleType-parameter)"}, - {VALIDATION_ERROR_0ae1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryFdInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_0ae2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryFdInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_0b000524, "The spec valid usage text states 'If handleType is not 0, it must be supported for import, as reported by VkExternalImageFormatPropertiesKHR or VkExternalBufferPropertiesKHR.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-handleType-00658)"}, - {VALIDATION_ERROR_0b000526, "The spec valid usage text states 'The memory from which handle was exported, or the memory named by name must have been created on the same underlying physical device as device.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-handle-00659)"}, - {VALIDATION_ERROR_0b000528, "The spec valid usage text states 'If handleType is not 0, it must be defined as an NT handle or a global share handle.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-handleType-00660)"}, - {VALIDATION_ERROR_0b00052a, "The spec valid usage text states 'If handleType is not 0 and name is NULL, handle must be a valid handle of the type specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-handleType-00661)"}, - {VALIDATION_ERROR_0b000b3e, "The spec valid usage text states 'If handleType is not VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR, name must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-handleType-01439)"}, - {VALIDATION_ERROR_0b000b40, "The spec valid usage text states 'If handleType is not 0 and handle is NULL, name must name a valid memory resource of the type specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-handleType-01440)"}, - {VALIDATION_ERROR_0b000b42, "The spec valid usage text states 'if handle is not NULL, name must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-handle-01441)"}, - {VALIDATION_ERROR_0b000bdc, "The spec valid usage text states 'If handle is not NULL, it must obey any requirements listed for handleType in external memory handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-handle-01518)"}, - {VALIDATION_ERROR_0b000bde, "The spec valid usage text states 'If name is not NULL, it must obey any requirements listed for handleType in external memory handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-name-01519)"}, - {VALIDATION_ERROR_0b009c01, "The spec valid usage text states 'If handleType is not 0, handleType must be a valid VkExternalMemoryHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-handleType-parameter)"}, - {VALIDATION_ERROR_0b01c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_0b02b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_0b200a5e, "The spec valid usage text states 'handleType must not have more than one bit set.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoNV-handleType-01327)"}, - {VALIDATION_ERROR_0b200a60, "The spec valid usage text states 'handle must be a valid handle to memory, obtained as specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoNV-handle-01328)"}, - {VALIDATION_ERROR_0b209c01, "The spec valid usage text states 'handleType must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoNV-handleType-parameter)"}, - {VALIDATION_ERROR_0b21c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoNV-pNext-pNext)"}, - {VALIDATION_ERROR_0b22b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoNV-sType-sType)"}, - {VALIDATION_ERROR_0b4008ee, "The spec valid usage text states 'handleType must be a value included in the Handle Types Supported by VkImportSemaphoreFdInfoKHR table.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreFdInfoKHR-handleType-01143)"}, - {VALIDATION_ERROR_0b4008f0, "The spec valid usage text states 'The semaphore from which handleType was exported must have been created on the same underlying physical device as semaphore.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreFdInfoKHR-handleType-01144)"}, - {VALIDATION_ERROR_0b400c10, "The spec valid usage text states 'fd must obey any requirements listed for handleType in external semaphore handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreFdInfoKHR-fd-01544)"}, - {VALIDATION_ERROR_0b409001, "The spec valid usage text states 'flags must be a valid combination of VkSemaphoreImportFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreFdInfoKHR-flags-parameter)"}, - {VALIDATION_ERROR_0b409c01, "The spec valid usage text states 'handleType must be a valid VkExternalSemaphoreHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreFdInfoKHR-handleType-parameter)"}, - {VALIDATION_ERROR_0b41c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreFdInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_0b42b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreFdInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_0b42b801, "The spec valid usage text states 'semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreFdInfoKHR-semaphore-parameter)"}, - {VALIDATION_ERROR_0b6008e8, "The spec valid usage text states 'handleType must be a value included in the Handle Types Supported by VkImportSemaphoreWin32HandleInfoKHR table.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-01140)"}, - {VALIDATION_ERROR_0b6008ea, "The spec valid usage text states 'The semaphore from which handleType or name was exported must have been created on the same underlying physical device as semaphore.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-01141)"}, - {VALIDATION_ERROR_0b600b74, "The spec valid usage text states 'If handleType is not VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR or VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHR, name must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-01466)"}, - {VALIDATION_ERROR_0b600b76, "The spec valid usage text states 'If handleType is not 0 and handle is NULL, name must name a valid synchronization primitive of the type specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-01467)"}, - {VALIDATION_ERROR_0b600b78, "The spec valid usage text states 'If handleType is not 0 and name is NULL, handle must be a valid handle of the type specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-01468)"}, - {VALIDATION_ERROR_0b600b7a, "The spec valid usage text states 'If handle is not NULL, name must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-handle-01469)"}, - {VALIDATION_ERROR_0b600c0c, "The spec valid usage text states 'If handle is not NULL, it must obey any requirements listed for handleType in external semaphore handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-handle-01542)"}, - {VALIDATION_ERROR_0b600c0e, "The spec valid usage text states 'If name is not NULL, it must obey any requirements listed for handleType in external semaphore handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-name-01543)"}, - {VALIDATION_ERROR_0b609001, "The spec valid usage text states 'flags must be a valid combination of VkSemaphoreImportFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-flags-parameter)"}, - {VALIDATION_ERROR_0b609c01, "The spec valid usage text states 'If handleType is not 0, handleType must be a valid VkExternalSemaphoreHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-parameter)"}, - {VALIDATION_ERROR_0b609c03, "The spec valid usage text states 'handleType must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-requiredbitmask)"}, - {VALIDATION_ERROR_0b61c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_0b62b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_0b62b801, "The spec valid usage text states 'semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-semaphore-parameter)"}, - {VALIDATION_ERROR_0b800a86, "The spec valid usage text states 'tokenCount must be greater than 0 and below VkDeviceGeneratedCommandsLimitsNVX::maxIndirectCommandsLayoutTokenCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-tokenCount-01347)"}, - {VALIDATION_ERROR_0b800a88, "The spec valid usage text states 'If the VkDeviceGeneratedCommandsFeaturesNVX::computeBindingPointSupport feature is not enabled, then pipelineBindPoint must not be VK_PIPELINE_BIND_POINT_COMPUTE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-computeBindingPointSupport-01348)"}, - {VALIDATION_ERROR_0b800a8a, "The spec valid usage text states 'If pTokens contains an entry of VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NVX it must be the first element of the array and there must be only a single element of such token type.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-pTokens-01349)"}, - {VALIDATION_ERROR_0b800a8c, "The spec valid usage text states 'All state binding tokens in pTokens must occur prior work provoking tokens (VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_NVX, VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_NVX, VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NVX).' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-pTokens-01350)"}, - {VALIDATION_ERROR_0b800a8e, "The spec valid usage text states 'The content of pTokens must include one single work provoking token that is compatible with the pipelineBindPoint.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-pTokens-01351)"}, - {VALIDATION_ERROR_0b809001, "The spec valid usage text states 'flags must be a valid combination of VkIndirectCommandsLayoutUsageFlagBitsNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-flags-parameter)"}, - {VALIDATION_ERROR_0b809003, "The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-flags-requiredbitmask)"}, - {VALIDATION_ERROR_0b81c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-pNext-pNext)"}, - {VALIDATION_ERROR_0b826001, "The spec valid usage text states 'pTokens must be a valid pointer to an array of tokenCount valid VkIndirectCommandsLayoutTokenNVX structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-pTokens-parameter)"}, - {VALIDATION_ERROR_0b827e01, "The spec valid usage text states 'pipelineBindPoint must be a valid VkPipelineBindPoint value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-pipelineBindPoint-parameter)"}, - {VALIDATION_ERROR_0b82b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-sType-sType)"}, - {VALIDATION_ERROR_0b82fc1b, "The spec valid usage text states 'tokenCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-tokenCount-arraylength)"}, - {VALIDATION_ERROR_0ba00a7c, "The spec valid usage text states 'bindingUnit must stay within device supported limits for the appropriate commands.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsLayoutTokenNVX-bindingUnit-01342)"}, - {VALIDATION_ERROR_0ba00a7e, "The spec valid usage text states 'dynamicCount must stay within device supported limits for the appropriate commands.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsLayoutTokenNVX-dynamicCount-01343)"}, - {VALIDATION_ERROR_0ba00a80, "The spec valid usage text states 'divisor must be greater than 0 and a power of two.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsLayoutTokenNVX-divisor-01344)"}, - {VALIDATION_ERROR_0ba2fe01, "The spec valid usage text states 'tokenType must be a valid VkIndirectCommandsTokenTypeNVX value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsLayoutTokenNVX-tokenType-parameter)"}, - {VALIDATION_ERROR_0bc00a82, "The spec valid usage text states 'The buffer's usage flag must have the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsTokenNVX-buffer-01345)"}, - {VALIDATION_ERROR_0bc00a84, "The spec valid usage text states 'The offset must be aligned to VkDeviceGeneratedCommandsLimitsNVX::minCommandsTokenBufferOffsetAlignment.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsTokenNVX-offset-01346)"}, - {VALIDATION_ERROR_0bc01a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsTokenNVX-buffer-parameter)"}, - {VALIDATION_ERROR_0bc2fe01, "The spec valid usage text states 'tokenType must be a valid VkIndirectCommandsTokenTypeNVX value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkIndirectCommandsTokenNVX-tokenType-parameter)"}, + {VALIDATION_ERROR_0ae00536, "The spec valid usage text states 'If handleType is not 0, it must be supported for import, as reported by VkExternalImageFormatProperties or VkExternalBufferProperties.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryFdInfoKHR-handleType-00667)"}, + {VALIDATION_ERROR_0ae00538, "The spec valid usage text states 'The memory from which fd was exported must have been created on the same underlying physical device as device.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryFdInfoKHR-fd-00668)"}, + {VALIDATION_ERROR_0ae0053a, "The spec valid usage text states 'If handleType is not 0, it must be defined as a POSIX file descriptor handle.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryFdInfoKHR-handleType-00669)"}, + {VALIDATION_ERROR_0ae0053c, "The spec valid usage text states 'If handleType is not 0, fd must be a valid handle of the type specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryFdInfoKHR-handleType-00670)"}, + {VALIDATION_ERROR_0ae00be0, "The spec valid usage text states 'fd must obey any requirements listed for handleType in external memory handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryFdInfoKHR-fd-01520)"}, + {VALIDATION_ERROR_0ae00da4, "The spec valid usage text states 'The memory represented by fd must have been created from a physical device and driver that is compatible with device and handleType, as described in external-memory-handle-types-compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryFdInfoKHR-fd-01746)"}, + {VALIDATION_ERROR_0ae09c01, "The spec valid usage text states 'If handleType is not 0, handleType must be a valid VkExternalMemoryHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryFdInfoKHR-handleType-parameter)"}, + {VALIDATION_ERROR_0ae2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryFdInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_0b000524, "The spec valid usage text states 'If handleType is not 0, it must be supported for import, as reported by VkExternalImageFormatProperties or VkExternalBufferProperties.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-handleType-00658)"}, + {VALIDATION_ERROR_0b000526, "The spec valid usage text states 'The memory from which handle was exported, or the memory named by name must have been created on the same underlying physical device as device.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-handle-00659)"}, + {VALIDATION_ERROR_0b000528, "The spec valid usage text states 'If handleType is not 0, it must be defined as an NT handle or a global share handle.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-handleType-00660)"}, + {VALIDATION_ERROR_0b00052a, "The spec valid usage text states 'If handleType is not 0 and name is NULL, handle must be a valid handle of the type specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-handleType-00661)"}, + {VALIDATION_ERROR_0b000b3e, "The spec valid usage text states 'If handleType is not VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, name must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-handleType-01439)"}, + {VALIDATION_ERROR_0b000b40, "The spec valid usage text states 'If handleType is not 0 and handle is NULL, name must name a valid memory resource of the type specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-handleType-01440)"}, + {VALIDATION_ERROR_0b000b42, "The spec valid usage text states 'if handle is not NULL, name must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-handle-01441)"}, + {VALIDATION_ERROR_0b000bdc, "The spec valid usage text states 'If handle is not NULL, it must obey any requirements listed for handleType in external memory handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-handle-01518)"}, + {VALIDATION_ERROR_0b000bde, "The spec valid usage text states 'If name is not NULL, it must obey any requirements listed for handleType in external memory handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-name-01519)"}, + {VALIDATION_ERROR_0b009c01, "The spec valid usage text states 'If handleType is not 0, handleType must be a valid VkExternalMemoryHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-handleType-parameter)"}, + {VALIDATION_ERROR_0b02b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_0b200a5e, "The spec valid usage text states 'handleType must not have more than one bit set.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoNV-handleType-01327)"}, + {VALIDATION_ERROR_0b200a60, "The spec valid usage text states 'handle must be a valid handle to memory, obtained as specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoNV-handle-01328)"}, + {VALIDATION_ERROR_0b209c01, "The spec valid usage text states 'handleType must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoNV-handleType-parameter)"}, + {VALIDATION_ERROR_0b22b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryWin32HandleInfoNV-sType-sType)"}, + {VALIDATION_ERROR_0b4008ee, "The spec valid usage text states 'handleType must be a value included in the Handle Types Supported by VkImportSemaphoreFdInfoKHR table.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreFdInfoKHR-handleType-01143)"}, + {VALIDATION_ERROR_0b400c10, "The spec valid usage text states 'fd must obey any requirements listed for handleType in external semaphore handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreFdInfoKHR-fd-01544)"}, + {VALIDATION_ERROR_0b409001, "The spec valid usage text states 'flags must be a valid combination of VkSemaphoreImportFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreFdInfoKHR-flags-parameter)"}, + {VALIDATION_ERROR_0b409c01, "The spec valid usage text states 'handleType must be a valid VkExternalSemaphoreHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreFdInfoKHR-handleType-parameter)"}, + {VALIDATION_ERROR_0b41c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreFdInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_0b42b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreFdInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_0b42b801, "The spec valid usage text states 'semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreFdInfoKHR-semaphore-parameter)"}, + {VALIDATION_ERROR_0b6008e8, "The spec valid usage text states 'handleType must be a value included in the Handle Types Supported by VkImportSemaphoreWin32HandleInfoKHR table.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-01140)"}, + {VALIDATION_ERROR_0b600b74, "The spec valid usage text states 'If handleType is not VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT or VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT, name must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-01466)"}, + {VALIDATION_ERROR_0b600b76, "The spec valid usage text states 'If handleType is not 0 and handle is NULL, name must name a valid synchronization primitive of the type specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-01467)"}, + {VALIDATION_ERROR_0b600b78, "The spec valid usage text states 'If handleType is not 0 and name is NULL, handle must be a valid handle of the type specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-01468)"}, + {VALIDATION_ERROR_0b600b7a, "The spec valid usage text states 'If handle is not NULL, name must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-handle-01469)"}, + {VALIDATION_ERROR_0b600c0c, "The spec valid usage text states 'If handle is not NULL, it must obey any requirements listed for handleType in external semaphore handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-handle-01542)"}, + {VALIDATION_ERROR_0b600c0e, "The spec valid usage text states 'If name is not NULL, it must obey any requirements listed for handleType in external semaphore handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-name-01543)"}, + {VALIDATION_ERROR_0b609001, "The spec valid usage text states 'flags must be a valid combination of VkSemaphoreImportFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-flags-parameter)"}, + {VALIDATION_ERROR_0b609c01, "The spec valid usage text states 'If handleType is not 0, handleType must be a valid VkExternalSemaphoreHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-parameter)"}, + {VALIDATION_ERROR_0b61c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_0b62b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_0b62b801, "The spec valid usage text states 'semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportSemaphoreWin32HandleInfoKHR-semaphore-parameter)"}, + {VALIDATION_ERROR_0b800a86, "The spec valid usage text states 'tokenCount must be greater than 0 and below VkDeviceGeneratedCommandsLimitsNVX::maxIndirectCommandsLayoutTokenCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-tokenCount-01347)"}, + {VALIDATION_ERROR_0b800a88, "The spec valid usage text states 'If the VkDeviceGeneratedCommandsFeaturesNVX::computeBindingPointSupport feature is not enabled, then pipelineBindPoint must not be VK_PIPELINE_BIND_POINT_COMPUTE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-computeBindingPointSupport-01348)"}, + {VALIDATION_ERROR_0b800a8a, "The spec valid usage text states 'If pTokens contains an entry of VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NVX it must be the first element of the array and there must be only a single element of such token type.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-pTokens-01349)"}, + {VALIDATION_ERROR_0b800a8c, "The spec valid usage text states 'All state binding tokens in pTokens must occur prior work provoking tokens (VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_NVX, VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_NVX, VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NVX).' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-pTokens-01350)"}, + {VALIDATION_ERROR_0b800a8e, "The spec valid usage text states 'The content of pTokens must include one single work provoking token that is compatible with the pipelineBindPoint.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-pTokens-01351)"}, + {VALIDATION_ERROR_0b809001, "The spec valid usage text states 'flags must be a valid combination of VkIndirectCommandsLayoutUsageFlagBitsNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-flags-parameter)"}, + {VALIDATION_ERROR_0b809003, "The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-flags-requiredbitmask)"}, + {VALIDATION_ERROR_0b81c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-pNext-pNext)"}, + {VALIDATION_ERROR_0b826001, "The spec valid usage text states 'pTokens must be a valid pointer to an array of tokenCount valid VkIndirectCommandsLayoutTokenNVX structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-pTokens-parameter)"}, + {VALIDATION_ERROR_0b827e01, "The spec valid usage text states 'pipelineBindPoint must be a valid VkPipelineBindPoint value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-pipelineBindPoint-parameter)"}, + {VALIDATION_ERROR_0b82b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-sType-sType)"}, + {VALIDATION_ERROR_0b82fc1b, "The spec valid usage text states 'tokenCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsLayoutCreateInfoNVX-tokenCount-arraylength)"}, + {VALIDATION_ERROR_0ba00a7c, "The spec valid usage text states 'bindingUnit must stay within device supported limits for the appropriate commands.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsLayoutTokenNVX-bindingUnit-01342)"}, + {VALIDATION_ERROR_0ba00a7e, "The spec valid usage text states 'dynamicCount must stay within device supported limits for the appropriate commands.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsLayoutTokenNVX-dynamicCount-01343)"}, + {VALIDATION_ERROR_0ba00a80, "The spec valid usage text states 'divisor must be greater than 0 and a power of two.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsLayoutTokenNVX-divisor-01344)"}, + {VALIDATION_ERROR_0ba2fe01, "The spec valid usage text states 'tokenType must be a valid VkIndirectCommandsTokenTypeNVX value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsLayoutTokenNVX-tokenType-parameter)"}, + {VALIDATION_ERROR_0bc00a82, "The spec valid usage text states 'The buffer's usage flag must have the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsTokenNVX-buffer-01345)"}, + {VALIDATION_ERROR_0bc00a84, "The spec valid usage text states 'The offset must be aligned to VkDeviceGeneratedCommandsLimitsNVX::minCommandsTokenBufferOffsetAlignment.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsTokenNVX-offset-01346)"}, + {VALIDATION_ERROR_0bc01a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsTokenNVX-buffer-parameter)"}, + {VALIDATION_ERROR_0bc2fe01, "The spec valid usage text states 'tokenType must be a valid VkIndirectCommandsTokenTypeNVX value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkIndirectCommandsTokenNVX-tokenType-parameter)"}, {VALIDATION_ERROR_0be09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkInstanceCreateInfo-flags-zerobitmask)"}, {VALIDATION_ERROR_0be0ee01, "The spec valid usage text states 'If pApplicationInfo is not NULL, pApplicationInfo must be a valid pointer to a valid VkApplicationInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkInstanceCreateInfo-pApplicationInfo-parameter)"}, - {VALIDATION_ERROR_0be1c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDebugReportCallbackCreateInfoEXT or VkValidationFlagsEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkInstanceCreateInfo-pNext-pNext)"}, + {VALIDATION_ERROR_0be1c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDebugReportCallbackCreateInfoEXT, VkDebugUtilsMessengerCreateInfoEXT, or VkValidationFlagsEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkInstanceCreateInfo-pNext-pNext)"}, {VALIDATION_ERROR_0be28e01, "The spec valid usage text states 'If enabledExtensionCount is not 0, ppEnabledExtensionNames must be a valid pointer to an array of enabledExtensionCount null-terminated UTF-8 strings' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkInstanceCreateInfo-ppEnabledExtensionNames-parameter)"}, {VALIDATION_ERROR_0be29001, "The spec valid usage text states 'If enabledLayerCount is not 0, ppEnabledLayerNames must be a valid pointer to an array of enabledLayerCount null-terminated UTF-8 strings' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkInstanceCreateInfo-ppEnabledLayerNames-parameter)"}, {VALIDATION_ERROR_0be2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkInstanceCreateInfo-sType-sType)"}, {VALIDATION_ERROR_0be2b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkInstanceCreateInfo-sType-unique)"}, - {VALIDATION_ERROR_0c000a4a, "The spec valid usage text states 'pView must be a valid NSView and must be backed by a CALayer instance of type CAMetalLayer.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMacOSSurfaceCreateInfoMVK-pView-01317)"}, - {VALIDATION_ERROR_0c009005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMacOSSurfaceCreateInfoMVK-flags-zerobitmask)"}, - {VALIDATION_ERROR_0c01c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMacOSSurfaceCreateInfoMVK-pNext-pNext)"}, - {VALIDATION_ERROR_0c026a01, "The spec valid usage text states 'pView must be a pointer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMacOSSurfaceCreateInfoMVK-pView-parameter)"}, - {VALIDATION_ERROR_0c02b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMacOSSurfaceCreateInfoMVK-sType-sType)"}, + {VALIDATION_ERROR_0c000a4a, "The spec valid usage text states 'pView must be a valid NSView and must be backed by a CALayer instance of type CAMetalLayer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMacOSSurfaceCreateInfoMVK-pView-01317)"}, + {VALIDATION_ERROR_0c009005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMacOSSurfaceCreateInfoMVK-flags-zerobitmask)"}, + {VALIDATION_ERROR_0c01c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMacOSSurfaceCreateInfoMVK-pNext-pNext)"}, + {VALIDATION_ERROR_0c02b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMacOSSurfaceCreateInfoMVK-sType-sType)"}, {VALIDATION_ERROR_0c200558, "The spec valid usage text states 'memory must be currently mapped' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMappedMemoryRange-memory-00684)"}, {VALIDATION_ERROR_0c20055a, "The spec valid usage text states 'If size is not equal to VK_WHOLE_SIZE, offset and size must specify a range contained within the currently mapped range of memory' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMappedMemoryRange-size-00685)"}, {VALIDATION_ERROR_0c20055c, "The spec valid usage text states 'If size is equal to VK_WHOLE_SIZE, offset must be within the currently mapped range of memory' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMappedMemoryRange-size-00686)"}, {VALIDATION_ERROR_0c20055e, "The spec valid usage text states 'offset must be a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMappedMemoryRange-offset-00687)"}, - {VALIDATION_ERROR_0c200560, "The spec valid usage text states 'If size is not equal to VK_WHOLE_SIZE, size must be a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMappedMemoryRange-size-00688)"}, {VALIDATION_ERROR_0c200ada, "The spec valid usage text states 'If size is equal to VK_WHOLE_SIZE, the end of the current mapping of memory must be a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize bytes from the beginning of the memory object.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMappedMemoryRange-size-01389)"}, {VALIDATION_ERROR_0c200adc, "The spec valid usage text states 'If size is not equal to VK_WHOLE_SIZE, size must either be a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize, or offset plus size must equal the size of memory.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMappedMemoryRange-size-01390)"}, {VALIDATION_ERROR_0c20c601, "The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMappedMemoryRange-memory-parameter)"}, {VALIDATION_ERROR_0c21c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMappedMemoryRange-pNext-pNext)"}, {VALIDATION_ERROR_0c22b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMappedMemoryRange-sType-sType)"}, - {VALIDATION_ERROR_0c400546, "The spec valid usage text states 'If VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT_KHX is set, deviceMask must be a valid device mask.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryAllocateFlagsInfoKHX-deviceMask-00675)"}, - {VALIDATION_ERROR_0c400548, "The spec valid usage text states 'If VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT_KHX is set, deviceMask must not be zero' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryAllocateFlagsInfoKHX-deviceMask-00676)"}, - {VALIDATION_ERROR_0c409001, "The spec valid usage text states 'flags must be a valid combination of VkMemoryAllocateFlagBitsKHX values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryAllocateFlagsInfoKHX-flags-parameter)"}, - {VALIDATION_ERROR_0c42b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryAllocateFlagsInfoKHX-sType-sType)"}, - {VALIDATION_ERROR_0c6004fa, "The spec valid usage text states 'allocationSize must be less than or equal to the amount of memory available to the VkMemoryHeap specified by memoryTypeIndex and the calling command's VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryAllocateInfo-allocationSize-00637)"}, + {VALIDATION_ERROR_0c400546, "The spec valid usage text states 'If VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT is set, deviceMask must be a valid device mask.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateFlagsInfo-deviceMask-00675)"}, + {VALIDATION_ERROR_0c400548, "The spec valid usage text states 'If VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT is set, deviceMask must not be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateFlagsInfo-deviceMask-00676)"}, + {VALIDATION_ERROR_0c409001, "The spec valid usage text states 'flags must be a valid combination of VkMemoryAllocateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateFlagsInfo-flags-parameter)"}, + {VALIDATION_ERROR_0c42b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateFlagsInfo-sType-sType)"}, {VALIDATION_ERROR_0c6004fc, "The spec valid usage text states 'allocationSize must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryAllocateInfo-allocationSize-00638)"}, - {VALIDATION_ERROR_0c6004fe, "The spec valid usage text states 'If the pNext chain contains an instance of VkExportMemoryAllocateInfoKHR, and any of the handle types specified in VkExportMemoryAllocateInfoKHR::handleTypes require a dedicated allocation, as reported by vkGetPhysicalDeviceImageFormatProperties2KHR in VkExternalImageFormatPropertiesKHR::externalMemoryProperties::externalMemoryFeatures or VkExternalBufferPropertiesKHR::externalMemoryProperties::externalMemoryFeatures, the pNext chain must contain an instance of' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-pNext-00639)"}, - {VALIDATION_ERROR_0c600500, "The spec valid usage text states 'If the pNext chain contains an instance of VkExportMemoryAllocateInfoKHR, it must not contain an instance of VkExportMemoryAllocateInfoNV or VkExportMemoryWin32HandleInfoNV.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-pNext-00640)"}, + {VALIDATION_ERROR_0c6004fe, "The spec valid usage text states 'If the pNext chain contains an instance of VkExportMemoryAllocateInfo, and any of the handle types specified in VkExportMemoryAllocateInfo::handleTypes require a dedicated allocation, as reported by vkGetPhysicalDeviceImageFormatProperties2 in VkExternalImageFormatProperties::externalMemoryProperties::externalMemoryFeatures or VkExternalBufferProperties::externalMemoryProperties::externalMemoryFeatures, the pNext chain must contain an instance of ifdef::VK_KHR_dedicated_allocation[VkMemoryDedicatedAllocateInfo]' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-pNext-00639)"}, + {VALIDATION_ERROR_0c600500, "The spec valid usage text states 'If the pNext chain contains an instance of VkExportMemoryAllocateInfo, it must not contain an instance of VkExportMemoryAllocateInfoNV or VkExportMemoryWin32HandleInfoNV.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-pNext-00640)"}, {VALIDATION_ERROR_0c600502, "The spec valid usage text states 'If the pNext chain contains an instance of VkImportMemoryWin32HandleInfoKHR, it must not contain an instance of VkImportMemoryWin32HandleInfoNV.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-pNext-00641)"}, - {VALIDATION_ERROR_0c600504, "The spec valid usage text states 'If the parameters define an import operation and the external handle specified was created by the Vulkan API, the values of allocationSize and memoryTypeIndex must match those specified when the memory object being imported was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-allocationSize-00642)"}, - {VALIDATION_ERROR_0c600506, "The spec valid usage text states 'If the parameters define an import operation and the external handle specified was created by the Vulkan API, the device mask specified by VkMemoryAllocateFlagsInfoKHX must match that specified when the memory object being imported was allocated.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-None-00643)"}, + {VALIDATION_ERROR_0c600506, "The spec valid usage text states 'If the parameters define an import operation and the external handle specified was created by the Vulkan API, the device mask specified by VkMemoryAllocateFlagsInfo must match that specified when the memory object being imported was allocated.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-None-00643)"}, {VALIDATION_ERROR_0c600508, "The spec valid usage text states 'If the parameters define an import operation and the external handle specified was created by the Vulkan API, the list of physical devices that comprise the logical device passed to vkAllocateMemory must match the list of physical devices that comprise the logical device on which the memory was originally allocated.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-None-00644)"}, {VALIDATION_ERROR_0c60050a, "The spec valid usage text states 'If the parameters define an import operation and the external handle is an NT handle or a global share handle created outside of the Vulkan API, the value of memoryTypeIndex must be one of those returned by vkGetMemoryWin32HandlePropertiesKHR.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-memoryTypeIndex-00645)"}, - {VALIDATION_ERROR_0c60050c, "The spec valid usage text states 'If the parameters define an import operation and the external handle type is VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR, allocationSize must match the size reported in the memory requirements of the image or buffer member of the instance of VkDedicatedAllocationMemoryAllocateInfoNV included in the pNext chain.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-allocationSize-00646)"}, - {VALIDATION_ERROR_0c60050e, "The spec valid usage text states 'If the parameters define an import operation and the external handle type is VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR, allocationSize must match the size specified when creating the Direct3D 12 heap from which the external handle was extracted.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-allocationSize-00647)"}, + {VALIDATION_ERROR_0c60050c, "The spec valid usage text states 'If the parameters define an import operation and the external handle type is VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, allocationSize must match the size reported in the memory requirements of the image or buffer member of the instance of VkDedicatedAllocationMemoryAllocateInfoNV included in the pNext chain.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-allocationSize-00646)"}, + {VALIDATION_ERROR_0c60050e, "The spec valid usage text states 'If the parameters define an import operation and the external handle type is VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, allocationSize must match the size specified when creating the Direct3D 12 heap from which the external handle was extracted.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-allocationSize-00647)"}, {VALIDATION_ERROR_0c600510, "The spec valid usage text states 'If the parameters define an import operation and the external handle is a POSIX file descriptor created outside of the Vulkan API, the value of memoryTypeIndex must be one of those returned by vkGetMemoryFdPropertiesKHR.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-memoryTypeIndex-00648)"}, - {VALIDATION_ERROR_0c61c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDedicatedAllocationMemoryAllocateInfoNV, VkExportMemoryAllocateInfoKHR, VkExportMemoryAllocateInfoNV, VkExportMemoryWin32HandleInfoKHR, VkExportMemoryWin32HandleInfoNV, VkImportMemoryFdInfoKHR, VkImportMemoryWin32HandleInfoKHR, VkImportMemoryWin32HandleInfoNV, VkMemoryAllocateFlagsInfoKHX, or VkMemoryDedicatedAllocateInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryAllocateInfo-pNext-pNext)"}, + {VALIDATION_ERROR_0c600d9c, "The spec valid usage text states 'If the parameters define an import operation, the external handle specified was created by the Vulkan API, and the external handle type is VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR, then the values of allocationSize and memoryTypeIndex must match those specified when the memory object being imported was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-allocationSize-01742)"}, + {VALIDATION_ERROR_0c600d9e, "The spec valid usage text states 'If the parameters define an import operation, the external handle was created by the Vulkan API, and the external handle type is VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR or VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR, then the values of allocationSize and memoryTypeIndex must match those specified when the memory object being imported was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-allocationSize-01743)"}, + {VALIDATION_ERROR_0c600da0, "The spec valid usage text states 'If the parameters define an import operation and the external handle is a host pointer, the value of memoryTypeIndex must be one of those returned by vkGetMemoryHostPointerPropertiesEXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-memoryTypeIndex-01744)"}, + {VALIDATION_ERROR_0c600da2, "The spec valid usage text states 'If the parameters define an import operation and the external handle is a host pointer, allocationSize must be an integer multiple of VkPhysicalDeviceExternalMemoryHostPropertiesEXT::minImportedHostPointerAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-allocationSize-01745)"}, + {VALIDATION_ERROR_0c600ea0, "The spec valid usage text states 'If the protected memory feature is not enabled, the VkMemoryAllocateInfo::memoryTypeIndex must not indicate a memory type that reports VK_MEMORY_PROPERTY_PROTECTED_BIT.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-memoryTypeIndex-01872)"}, + {VALIDATION_ERROR_0c600ea2, "The spec valid usage text states 'If the parameters define an import operation and the external handle type is VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BIT_ANDROID:' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-None-01873)"}, + {VALIDATION_ERROR_0c600ea4, "The spec valid usage text states 'If the parameters do not define an import operation, and the pNext chain contains an instance of VkExportMemoryAllocateInfo with VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID included in its handleTypes member, and the pNext contains an instance of VkMemoryDedicatedAllocateInfo with image not equal to VK_NULL_HANDLE, then allocationSize must be 0, otherwise allocationSize must be greater than 0.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-pNext-01874)"}, + {VALIDATION_ERROR_0c600ea6, "The spec valid usage text states 'If the parameters define an import operation, the external handle is an Android hardware buffer, and the pNext chain includes an instance of VkMemoryDedicatedAllocateInfo with image that is not VK_NULL_HANDLE:' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryAllocateInfo-pNext-01875)"}, + {VALIDATION_ERROR_0c61c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDedicatedAllocationMemoryAllocateInfoNV, VkExportMemoryAllocateInfo, VkExportMemoryAllocateInfoNV, VkExportMemoryWin32HandleInfoKHR, VkExportMemoryWin32HandleInfoNV, VkImportAndroidHardwareBufferInfoANDROID, VkImportMemoryFdInfoKHR, VkImportMemoryHostPointerInfoEXT, VkImportMemoryWin32HandleInfoKHR, VkImportMemoryWin32HandleInfoNV, VkMemoryAllocateFlagsInfo, or VkMemoryDedicatedAllocateInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryAllocateInfo-pNext-pNext)"}, {VALIDATION_ERROR_0c62b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryAllocateInfo-sType-sType)"}, {VALIDATION_ERROR_0c62b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryAllocateInfo-sType-unique)"}, {VALIDATION_ERROR_0c806801, "The spec valid usage text states 'dstAccessMask must be a valid combination of VkAccessFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryBarrier-dstAccessMask-parameter)"}, {VALIDATION_ERROR_0c81c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryBarrier-pNext-pNext)"}, {VALIDATION_ERROR_0c82b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_BARRIER' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryBarrier-sType-sType)"}, {VALIDATION_ERROR_0c82c401, "The spec valid usage text states 'srcAccessMask must be a valid combination of VkAccessFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryBarrier-srcAccessMask-parameter)"}, - {VALIDATION_ERROR_0ca009de, "The spec valid usage text states 'connection must point to a valid MirConnection.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMirSurfaceCreateInfoKHR-connection-01263)"}, - {VALIDATION_ERROR_0ca009e0, "The spec valid usage text states 'surface must point to a valid MirSurface.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMirSurfaceCreateInfoKHR-surface-01264)"}, - {VALIDATION_ERROR_0ca09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMirSurfaceCreateInfoKHR-flags-zerobitmask)"}, - {VALIDATION_ERROR_0ca1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMirSurfaceCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_0ca2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMirSurfaceCreateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_0cc00a96, "The spec valid usage text states 'If the VkDeviceGeneratedCommandsFeaturesNVX::computeBindingPointSupport feature is not enabled, pObjectEntryUsageFlags must not contain VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-computeBindingPointSupport-01355)"}, - {VALIDATION_ERROR_0cc00a98, "The spec valid usage text states 'Any value within pObjectEntryCounts must not exceed VkDeviceGeneratedCommandsLimitsNVX::maxObjectEntryCounts' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-pObjectEntryCounts-01356)"}, - {VALIDATION_ERROR_0cc00a9a, "The spec valid usage text states 'maxUniformBuffersPerDescriptor must be within the limits supported by the device.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-maxUniformBuffersPerDescriptor-01357)"}, - {VALIDATION_ERROR_0cc00a9c, "The spec valid usage text states 'maxStorageBuffersPerDescriptor must be within the limits supported by the device.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-maxStorageBuffersPerDescriptor-01358)"}, - {VALIDATION_ERROR_0cc00a9e, "The spec valid usage text states 'maxStorageImagesPerDescriptor must be within the limits supported by the device.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-maxStorageImagesPerDescriptor-01359)"}, - {VALIDATION_ERROR_0cc00aa0, "The spec valid usage text states 'maxSampledImagesPerDescriptor must be within the limits supported by the device.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-maxSampledImagesPerDescriptor-01360)"}, - {VALIDATION_ERROR_0cc0d61b, "The spec valid usage text states 'objectCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-objectCount-arraylength)"}, - {VALIDATION_ERROR_0cc1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-pNext-pNext)"}, - {VALIDATION_ERROR_0cc1c601, "The spec valid usage text states 'pObjectEntryCounts must be a valid pointer to an array of objectCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-pObjectEntryCounts-parameter)"}, - {VALIDATION_ERROR_0cc1c801, "The spec valid usage text states 'pObjectEntryTypes must be a valid pointer to an array of objectCount valid VkObjectEntryTypeNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-pObjectEntryTypes-parameter)"}, - {VALIDATION_ERROR_0cc1ca01, "The spec valid usage text states 'pObjectEntryUsageFlags must be a valid pointer to an array of objectCount valid combinations of VkObjectEntryUsageFlagBitsNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-pObjectEntryUsageFlags-parameter)"}, - {VALIDATION_ERROR_0cc1ca03, "The spec valid usage text states 'Each element of pObjectEntryUsageFlags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-pObjectEntryUsageFlags-requiredbitmask)"}, - {VALIDATION_ERROR_0cc2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-sType-sType)"}, - {VALIDATION_ERROR_0ce00009, "The spec valid usage text states 'Both of descriptorSet, and pipelineLayout must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableDescriptorSetEntryNVX-commonparent)"}, - {VALIDATION_ERROR_0ce00ab2, "The spec valid usage text states 'type must be VK_OBJECT_ENTRY_TYPE_DESCRIPTOR_SET_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableDescriptorSetEntryNVX-type-01369)"}, - {VALIDATION_ERROR_0ce04801, "The spec valid usage text states 'descriptorSet must be a valid VkDescriptorSet handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableDescriptorSetEntryNVX-descriptorSet-parameter)"}, - {VALIDATION_ERROR_0ce09001, "The spec valid usage text states 'flags must be a valid combination of VkObjectEntryUsageFlagBitsNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableDescriptorSetEntryNVX-flags-parameter)"}, - {VALIDATION_ERROR_0ce09003, "The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableDescriptorSetEntryNVX-flags-requiredbitmask)"}, - {VALIDATION_ERROR_0ce28201, "The spec valid usage text states 'pipelineLayout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableDescriptorSetEntryNVX-pipelineLayout-parameter)"}, - {VALIDATION_ERROR_0ce30401, "The spec valid usage text states 'type must be a valid VkObjectEntryTypeNVX value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableDescriptorSetEntryNVX-type-parameter)"}, - {VALIDATION_ERROR_0d000aae, "The spec valid usage text states 'If the VkDeviceGeneratedCommandsFeaturesNVX::computeBindingPointSupport feature is not enabled, flags must not contain VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableEntryNVX-computeBindingPointSupport-01367)"}, - {VALIDATION_ERROR_0d009001, "The spec valid usage text states 'flags must be a valid combination of VkObjectEntryUsageFlagBitsNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableEntryNVX-flags-parameter)"}, - {VALIDATION_ERROR_0d009003, "The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableEntryNVX-flags-requiredbitmask)"}, - {VALIDATION_ERROR_0d030401, "The spec valid usage text states 'type must be a valid VkObjectEntryTypeNVX value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableEntryNVX-type-parameter)"}, - {VALIDATION_ERROR_0d200ab6, "The spec valid usage text states 'type must be VK_OBJECT_ENTRY_TYPE_INDEX_BUFFER_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableIndexBufferEntryNVX-type-01371)"}, - {VALIDATION_ERROR_0d201a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableIndexBufferEntryNVX-buffer-parameter)"}, - {VALIDATION_ERROR_0d209001, "The spec valid usage text states 'flags must be a valid combination of VkObjectEntryUsageFlagBitsNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableIndexBufferEntryNVX-flags-parameter)"}, - {VALIDATION_ERROR_0d209003, "The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableIndexBufferEntryNVX-flags-requiredbitmask)"}, - {VALIDATION_ERROR_0d20b201, "The spec valid usage text states 'indexType must be a valid VkIndexType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableIndexBufferEntryNVX-indexType-parameter)"}, - {VALIDATION_ERROR_0d230401, "The spec valid usage text states 'type must be a valid VkObjectEntryTypeNVX value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableIndexBufferEntryNVX-type-parameter)"}, - {VALIDATION_ERROR_0d400ab0, "The spec valid usage text states 'type must be VK_OBJECT_ENTRY_TYPE_PIPELINE_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTablePipelineEntryNVX-type-01368)"}, - {VALIDATION_ERROR_0d409001, "The spec valid usage text states 'flags must be a valid combination of VkObjectEntryUsageFlagBitsNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTablePipelineEntryNVX-flags-parameter)"}, - {VALIDATION_ERROR_0d409003, "The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTablePipelineEntryNVX-flags-requiredbitmask)"}, - {VALIDATION_ERROR_0d427c01, "The spec valid usage text states 'pipeline must be a valid VkPipeline handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTablePipelineEntryNVX-pipeline-parameter)"}, - {VALIDATION_ERROR_0d430401, "The spec valid usage text states 'type must be a valid VkObjectEntryTypeNVX value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTablePipelineEntryNVX-type-parameter)"}, - {VALIDATION_ERROR_0d600ab8, "The spec valid usage text states 'type must be VK_OBJECT_ENTRY_TYPE_PUSH_CONSTANT_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTablePushConstantEntryNVX-type-01372)"}, - {VALIDATION_ERROR_0d609001, "The spec valid usage text states 'flags must be a valid combination of VkObjectEntryUsageFlagBitsNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTablePushConstantEntryNVX-flags-parameter)"}, - {VALIDATION_ERROR_0d609003, "The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTablePushConstantEntryNVX-flags-requiredbitmask)"}, - {VALIDATION_ERROR_0d628201, "The spec valid usage text states 'pipelineLayout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTablePushConstantEntryNVX-pipelineLayout-parameter)"}, - {VALIDATION_ERROR_0d62dc01, "The spec valid usage text states 'stageFlags must be a valid combination of VkShaderStageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTablePushConstantEntryNVX-stageFlags-parameter)"}, - {VALIDATION_ERROR_0d62dc03, "The spec valid usage text states 'stageFlags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTablePushConstantEntryNVX-stageFlags-requiredbitmask)"}, - {VALIDATION_ERROR_0d630401, "The spec valid usage text states 'type must be a valid VkObjectEntryTypeNVX value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTablePushConstantEntryNVX-type-parameter)"}, - {VALIDATION_ERROR_0d800ab4, "The spec valid usage text states 'type must be VK_OBJECT_ENTRY_TYPE_VERTEX_BUFFER_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableVertexBufferEntryNVX-type-01370)"}, - {VALIDATION_ERROR_0d801a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableVertexBufferEntryNVX-buffer-parameter)"}, - {VALIDATION_ERROR_0d809001, "The spec valid usage text states 'flags must be a valid combination of VkObjectEntryUsageFlagBitsNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableVertexBufferEntryNVX-flags-parameter)"}, - {VALIDATION_ERROR_0d809003, "The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableVertexBufferEntryNVX-flags-requiredbitmask)"}, - {VALIDATION_ERROR_0d830401, "The spec valid usage text states 'type must be a valid VkObjectEntryTypeNVX value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkObjectTableVertexBufferEntryNVX-type-parameter)"}, - {VALIDATION_ERROR_0da1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceDiscardRectanglePropertiesEXT-pNext-pNext)"}, - {VALIDATION_ERROR_0da2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceDiscardRectanglePropertiesEXT-sType-sType)"}, - {VALIDATION_ERROR_0dc09001, "The spec valid usage text states 'flags must be a valid combination of VkBufferCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceExternalBufferInfoKHR-flags-parameter)"}, - {VALIDATION_ERROR_0dc09c01, "The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceExternalBufferInfoKHR-handleType-parameter)"}, - {VALIDATION_ERROR_0dc1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceExternalBufferInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_0dc2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceExternalBufferInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_0dc30601, "The spec valid usage text states 'usage must be a valid combination of VkBufferUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceExternalBufferInfoKHR-usage-parameter)"}, - {VALIDATION_ERROR_0dc30603, "The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceExternalBufferInfoKHR-usage-requiredbitmask)"}, - {VALIDATION_ERROR_0de09c01, "The spec valid usage text states 'If handleType is not 0, handleType must be a valid VkExternalMemoryHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceExternalImageFormatInfoKHR-handleType-parameter)"}, - {VALIDATION_ERROR_0de2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceExternalImageFormatInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_0e009c01, "The spec valid usage text states 'handleType must be a valid VkExternalSemaphoreHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceExternalSemaphoreInfoKHR-handleType-parameter)"}, - {VALIDATION_ERROR_0e01c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceExternalSemaphoreInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_0e02b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceExternalSemaphoreInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_0e200486, "The spec valid usage text states 'If any member of this structure is VK_FALSE, as returned by vkGetPhysicalDeviceFeatures, then it must be VK_FALSE when passed as part of the VkDeviceCreateInfo struct when creating a device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceFeatures-None-00579)"}, - {VALIDATION_ERROR_0e41c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkPhysicalDevice16BitStorageFeaturesKHR, VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT, VkPhysicalDeviceMultiviewFeaturesKHX, VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR, or VkPhysicalDeviceVariablePointerFeaturesKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceFeatures2KHR-pNext-pNext)"}, - {VALIDATION_ERROR_0e42b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceFeatures2KHR-sType-sType)"}, - {VALIDATION_ERROR_0e42b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceFeatures2KHR-sType-unique)"}, - {VALIDATION_ERROR_0e609001, "The spec valid usage text states 'flags must be a valid combination of VkImageCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceImageFormatInfo2KHR-flags-parameter)"}, - {VALIDATION_ERROR_0e609201, "The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceImageFormatInfo2KHR-format-parameter)"}, - {VALIDATION_ERROR_0e61c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkPhysicalDeviceExternalImageFormatInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceImageFormatInfo2KHR-pNext-pNext)"}, - {VALIDATION_ERROR_0e62b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceImageFormatInfo2KHR-sType-sType)"}, - {VALIDATION_ERROR_0e62fa01, "The spec valid usage text states 'tiling must be a valid VkImageTiling value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceImageFormatInfo2KHR-tiling-parameter)"}, - {VALIDATION_ERROR_0e630401, "The spec valid usage text states 'type must be a valid VkImageType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceImageFormatInfo2KHR-type-parameter)"}, - {VALIDATION_ERROR_0e630601, "The spec valid usage text states 'usage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceImageFormatInfo2KHR-usage-parameter)"}, - {VALIDATION_ERROR_0e630603, "The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceImageFormatInfo2KHR-usage-requiredbitmask)"}, - {VALIDATION_ERROR_0e800488, "The spec valid usage text states 'If multiviewGeometryShader is enabled then multiview must also be enabled.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceMultiviewFeaturesKHX-multiviewGeometryShader-00580)"}, - {VALIDATION_ERROR_0e80048a, "The spec valid usage text states 'If multiviewTessellationShader is enabled then multiview must also be enabled.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceMultiviewFeaturesKHX-multiviewTessellationShader-00581)"}, - {VALIDATION_ERROR_0e82b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceMultiviewFeaturesKHX-sType-sType)"}, - {VALIDATION_ERROR_0ea1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDevicePushDescriptorPropertiesKHR-pNext-pNext)"}, - {VALIDATION_ERROR_0ea2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDevicePushDescriptorPropertiesKHR-sType-sType)"}, - {VALIDATION_ERROR_0ec0088e, "The spec valid usage text states 'samples must be a bit value that is set in VkImageFormatProperties::sampleCounts returned by vkGetPhysicalDeviceImageFormatProperties with format, type, tiling, and usage equal to those in this command and flags equal to the value that is set in VkImageCreateInfo::flags when the image is created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSparseImageFormatInfo2KHR-samples-01095)"}, - {VALIDATION_ERROR_0ec09201, "The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSparseImageFormatInfo2KHR-format-parameter)"}, - {VALIDATION_ERROR_0ec1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSparseImageFormatInfo2KHR-pNext-pNext)"}, - {VALIDATION_ERROR_0ec2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSparseImageFormatInfo2KHR-sType-sType)"}, - {VALIDATION_ERROR_0ec2b401, "The spec valid usage text states 'samples must be a valid VkSampleCountFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSparseImageFormatInfo2KHR-samples-parameter)"}, - {VALIDATION_ERROR_0ec2fa01, "The spec valid usage text states 'tiling must be a valid VkImageTiling value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSparseImageFormatInfo2KHR-tiling-parameter)"}, - {VALIDATION_ERROR_0ec30401, "The spec valid usage text states 'type must be a valid VkImageType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSparseImageFormatInfo2KHR-type-parameter)"}, - {VALIDATION_ERROR_0ec30601, "The spec valid usage text states 'usage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSparseImageFormatInfo2KHR-usage-parameter)"}, - {VALIDATION_ERROR_0ec30603, "The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSparseImageFormatInfo2KHR-usage-requiredbitmask)"}, - {VALIDATION_ERROR_0ee1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSurfaceInfo2KHR-pNext-pNext)"}, - {VALIDATION_ERROR_0ee2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-sType)"}, - {VALIDATION_ERROR_0ee2ec01, "The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSurfaceInfo2KHR-surface-parameter)"}, + {VALIDATION_ERROR_0ca009de, "The spec valid usage text states 'connection must point to a valid MirConnection.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMirSurfaceCreateInfoKHR-connection-01263)"}, + {VALIDATION_ERROR_0ca009e0, "The spec valid usage text states 'surface must point to a valid MirSurface.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMirSurfaceCreateInfoKHR-surface-01264)"}, + {VALIDATION_ERROR_0ca09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMirSurfaceCreateInfoKHR-flags-zerobitmask)"}, + {VALIDATION_ERROR_0ca1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMirSurfaceCreateInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_0ca2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMirSurfaceCreateInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_0cc00a96, "The spec valid usage text states 'If the VkDeviceGeneratedCommandsFeaturesNVX::computeBindingPointSupport feature is not enabled, pObjectEntryUsageFlags must not contain VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-computeBindingPointSupport-01355)"}, + {VALIDATION_ERROR_0cc00a98, "The spec valid usage text states 'Any value within pObjectEntryCounts must not exceed VkDeviceGeneratedCommandsLimitsNVX::maxObjectEntryCounts' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-pObjectEntryCounts-01356)"}, + {VALIDATION_ERROR_0cc00a9a, "The spec valid usage text states 'maxUniformBuffersPerDescriptor must be within the limits supported by the device.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-maxUniformBuffersPerDescriptor-01357)"}, + {VALIDATION_ERROR_0cc00a9c, "The spec valid usage text states 'maxStorageBuffersPerDescriptor must be within the limits supported by the device.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-maxStorageBuffersPerDescriptor-01358)"}, + {VALIDATION_ERROR_0cc00a9e, "The spec valid usage text states 'maxStorageImagesPerDescriptor must be within the limits supported by the device.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-maxStorageImagesPerDescriptor-01359)"}, + {VALIDATION_ERROR_0cc00aa0, "The spec valid usage text states 'maxSampledImagesPerDescriptor must be within the limits supported by the device.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-maxSampledImagesPerDescriptor-01360)"}, + {VALIDATION_ERROR_0cc0d61b, "The spec valid usage text states 'objectCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-objectCount-arraylength)"}, + {VALIDATION_ERROR_0cc1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-pNext-pNext)"}, + {VALIDATION_ERROR_0cc1c601, "The spec valid usage text states 'pObjectEntryCounts must be a valid pointer to an array of objectCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-pObjectEntryCounts-parameter)"}, + {VALIDATION_ERROR_0cc1c801, "The spec valid usage text states 'pObjectEntryTypes must be a valid pointer to an array of objectCount valid VkObjectEntryTypeNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-pObjectEntryTypes-parameter)"}, + {VALIDATION_ERROR_0cc1ca01, "The spec valid usage text states 'pObjectEntryUsageFlags must be a valid pointer to an array of objectCount valid combinations of VkObjectEntryUsageFlagBitsNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-pObjectEntryUsageFlags-parameter)"}, + {VALIDATION_ERROR_0cc1ca03, "The spec valid usage text states 'Each element of pObjectEntryUsageFlags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-pObjectEntryUsageFlags-requiredbitmask)"}, + {VALIDATION_ERROR_0cc2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableCreateInfoNVX-sType-sType)"}, + {VALIDATION_ERROR_0ce00009, "The spec valid usage text states 'Both of descriptorSet, and pipelineLayout must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableDescriptorSetEntryNVX-commonparent)"}, + {VALIDATION_ERROR_0ce00ab2, "The spec valid usage text states 'type must be VK_OBJECT_ENTRY_TYPE_DESCRIPTOR_SET_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableDescriptorSetEntryNVX-type-01369)"}, + {VALIDATION_ERROR_0ce04801, "The spec valid usage text states 'descriptorSet must be a valid VkDescriptorSet handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableDescriptorSetEntryNVX-descriptorSet-parameter)"}, + {VALIDATION_ERROR_0ce09001, "The spec valid usage text states 'flags must be a valid combination of VkObjectEntryUsageFlagBitsNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableDescriptorSetEntryNVX-flags-parameter)"}, + {VALIDATION_ERROR_0ce09003, "The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableDescriptorSetEntryNVX-flags-requiredbitmask)"}, + {VALIDATION_ERROR_0ce28201, "The spec valid usage text states 'pipelineLayout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableDescriptorSetEntryNVX-pipelineLayout-parameter)"}, + {VALIDATION_ERROR_0ce30401, "The spec valid usage text states 'type must be a valid VkObjectEntryTypeNVX value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableDescriptorSetEntryNVX-type-parameter)"}, + {VALIDATION_ERROR_0d000aae, "The spec valid usage text states 'If the VkDeviceGeneratedCommandsFeaturesNVX::computeBindingPointSupport feature is not enabled, flags must not contain VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableEntryNVX-computeBindingPointSupport-01367)"}, + {VALIDATION_ERROR_0d009001, "The spec valid usage text states 'flags must be a valid combination of VkObjectEntryUsageFlagBitsNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableEntryNVX-flags-parameter)"}, + {VALIDATION_ERROR_0d009003, "The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableEntryNVX-flags-requiredbitmask)"}, + {VALIDATION_ERROR_0d030401, "The spec valid usage text states 'type must be a valid VkObjectEntryTypeNVX value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableEntryNVX-type-parameter)"}, + {VALIDATION_ERROR_0d200ab6, "The spec valid usage text states 'type must be VK_OBJECT_ENTRY_TYPE_INDEX_BUFFER_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableIndexBufferEntryNVX-type-01371)"}, + {VALIDATION_ERROR_0d201a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableIndexBufferEntryNVX-buffer-parameter)"}, + {VALIDATION_ERROR_0d209001, "The spec valid usage text states 'flags must be a valid combination of VkObjectEntryUsageFlagBitsNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableIndexBufferEntryNVX-flags-parameter)"}, + {VALIDATION_ERROR_0d209003, "The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableIndexBufferEntryNVX-flags-requiredbitmask)"}, + {VALIDATION_ERROR_0d20b201, "The spec valid usage text states 'indexType must be a valid VkIndexType value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableIndexBufferEntryNVX-indexType-parameter)"}, + {VALIDATION_ERROR_0d230401, "The spec valid usage text states 'type must be a valid VkObjectEntryTypeNVX value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableIndexBufferEntryNVX-type-parameter)"}, + {VALIDATION_ERROR_0d400ab0, "The spec valid usage text states 'type must be VK_OBJECT_ENTRY_TYPE_PIPELINE_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTablePipelineEntryNVX-type-01368)"}, + {VALIDATION_ERROR_0d409001, "The spec valid usage text states 'flags must be a valid combination of VkObjectEntryUsageFlagBitsNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTablePipelineEntryNVX-flags-parameter)"}, + {VALIDATION_ERROR_0d409003, "The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTablePipelineEntryNVX-flags-requiredbitmask)"}, + {VALIDATION_ERROR_0d427c01, "The spec valid usage text states 'pipeline must be a valid VkPipeline handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTablePipelineEntryNVX-pipeline-parameter)"}, + {VALIDATION_ERROR_0d430401, "The spec valid usage text states 'type must be a valid VkObjectEntryTypeNVX value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTablePipelineEntryNVX-type-parameter)"}, + {VALIDATION_ERROR_0d600ab8, "The spec valid usage text states 'type must be VK_OBJECT_ENTRY_TYPE_PUSH_CONSTANT_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTablePushConstantEntryNVX-type-01372)"}, + {VALIDATION_ERROR_0d609001, "The spec valid usage text states 'flags must be a valid combination of VkObjectEntryUsageFlagBitsNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTablePushConstantEntryNVX-flags-parameter)"}, + {VALIDATION_ERROR_0d609003, "The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTablePushConstantEntryNVX-flags-requiredbitmask)"}, + {VALIDATION_ERROR_0d628201, "The spec valid usage text states 'pipelineLayout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTablePushConstantEntryNVX-pipelineLayout-parameter)"}, + {VALIDATION_ERROR_0d62dc01, "The spec valid usage text states 'stageFlags must be a valid combination of VkShaderStageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTablePushConstantEntryNVX-stageFlags-parameter)"}, + {VALIDATION_ERROR_0d62dc03, "The spec valid usage text states 'stageFlags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTablePushConstantEntryNVX-stageFlags-requiredbitmask)"}, + {VALIDATION_ERROR_0d630401, "The spec valid usage text states 'type must be a valid VkObjectEntryTypeNVX value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTablePushConstantEntryNVX-type-parameter)"}, + {VALIDATION_ERROR_0d800ab4, "The spec valid usage text states 'type must be VK_OBJECT_ENTRY_TYPE_VERTEX_BUFFER_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableVertexBufferEntryNVX-type-01370)"}, + {VALIDATION_ERROR_0d801a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableVertexBufferEntryNVX-buffer-parameter)"}, + {VALIDATION_ERROR_0d809001, "The spec valid usage text states 'flags must be a valid combination of VkObjectEntryUsageFlagBitsNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableVertexBufferEntryNVX-flags-parameter)"}, + {VALIDATION_ERROR_0d809003, "The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableVertexBufferEntryNVX-flags-requiredbitmask)"}, + {VALIDATION_ERROR_0d830401, "The spec valid usage text states 'type must be a valid VkObjectEntryTypeNVX value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkObjectTableVertexBufferEntryNVX-type-parameter)"}, + {VALIDATION_ERROR_0da2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceDiscardRectanglePropertiesEXT-sType-sType)"}, + {VALIDATION_ERROR_0dc09001, "The spec valid usage text states 'flags must be a valid combination of VkBufferCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalBufferInfo-flags-parameter)"}, + {VALIDATION_ERROR_0dc09c01, "The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalBufferInfo-handleType-parameter)"}, + {VALIDATION_ERROR_0dc1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalBufferInfo-pNext-pNext)"}, + {VALIDATION_ERROR_0dc2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalBufferInfo-sType-sType)"}, + {VALIDATION_ERROR_0dc30601, "The spec valid usage text states 'usage must be a valid combination of VkBufferUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalBufferInfo-usage-parameter)"}, + {VALIDATION_ERROR_0dc30603, "The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalBufferInfo-usage-requiredbitmask)"}, + {VALIDATION_ERROR_0de09c01, "The spec valid usage text states 'If handleType is not 0, handleType must be a valid VkExternalMemoryHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalImageFormatInfo-handleType-parameter)"}, + {VALIDATION_ERROR_0de2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalImageFormatInfo-sType-sType)"}, + {VALIDATION_ERROR_0e009c01, "The spec valid usage text states 'handleType must be a valid VkExternalSemaphoreHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalSemaphoreInfo-handleType-parameter)"}, + {VALIDATION_ERROR_0e01c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalSemaphoreInfo-pNext-pNext)"}, + {VALIDATION_ERROR_0e02b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalSemaphoreInfo-sType-sType)"}, + {VALIDATION_ERROR_0e42b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceFeatures2-sType-sType)"}, + {VALIDATION_ERROR_0e609001, "The spec valid usage text states 'flags must be a valid combination of VkImageCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceImageFormatInfo2-flags-parameter)"}, + {VALIDATION_ERROR_0e609201, "The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceImageFormatInfo2-format-parameter)"}, + {VALIDATION_ERROR_0e61c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkPhysicalDeviceExternalImageFormatInfo' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceImageFormatInfo2-pNext-pNext)"}, + {VALIDATION_ERROR_0e62b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceImageFormatInfo2-sType-sType)"}, + {VALIDATION_ERROR_0e62fa01, "The spec valid usage text states 'tiling must be a valid VkImageTiling value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceImageFormatInfo2-tiling-parameter)"}, + {VALIDATION_ERROR_0e630401, "The spec valid usage text states 'type must be a valid VkImageType value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceImageFormatInfo2-type-parameter)"}, + {VALIDATION_ERROR_0e630601, "The spec valid usage text states 'usage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceImageFormatInfo2-usage-parameter)"}, + {VALIDATION_ERROR_0e630603, "The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceImageFormatInfo2-usage-requiredbitmask)"}, + {VALIDATION_ERROR_0e800488, "The spec valid usage text states 'If multiviewGeometryShader is enabled then multiview must also be enabled.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceMultiviewFeatures-multiviewGeometryShader-00580)"}, + {VALIDATION_ERROR_0e80048a, "The spec valid usage text states 'If multiviewTessellationShader is enabled then multiview must also be enabled.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceMultiviewFeatures-multiviewTessellationShader-00581)"}, + {VALIDATION_ERROR_0e82b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceMultiviewFeatures-sType-sType)"}, + {VALIDATION_ERROR_0ea2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDevicePushDescriptorPropertiesKHR-sType-sType)"}, + {VALIDATION_ERROR_0ec0088e, "The spec valid usage text states 'samples must be a bit value that is set in VkImageFormatProperties::sampleCounts returned by vkGetPhysicalDeviceImageFormatProperties with format, type, tiling, and usage equal to those in this command and flags equal to the value that is set in VkImageCreateInfo::flags when the image is created' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSparseImageFormatInfo2-samples-01095)"}, + {VALIDATION_ERROR_0ec09201, "The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSparseImageFormatInfo2-format-parameter)"}, + {VALIDATION_ERROR_0ec1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSparseImageFormatInfo2-pNext-pNext)"}, + {VALIDATION_ERROR_0ec2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSparseImageFormatInfo2-sType-sType)"}, + {VALIDATION_ERROR_0ec2b401, "The spec valid usage text states 'samples must be a valid VkSampleCountFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSparseImageFormatInfo2-samples-parameter)"}, + {VALIDATION_ERROR_0ec2fa01, "The spec valid usage text states 'tiling must be a valid VkImageTiling value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSparseImageFormatInfo2-tiling-parameter)"}, + {VALIDATION_ERROR_0ec30401, "The spec valid usage text states 'type must be a valid VkImageType value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSparseImageFormatInfo2-type-parameter)"}, + {VALIDATION_ERROR_0ec30601, "The spec valid usage text states 'usage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSparseImageFormatInfo2-usage-parameter)"}, + {VALIDATION_ERROR_0ec30603, "The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSparseImageFormatInfo2-usage-requiredbitmask)"}, + {VALIDATION_ERROR_0ee1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSurfaceInfo2KHR-pNext-pNext)"}, + {VALIDATION_ERROR_0ee2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-sType)"}, + {VALIDATION_ERROR_0ee2ec01, "The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSurfaceInfo2KHR-surface-parameter)"}, {VALIDATION_ERROR_0f000600, "The spec valid usage text states 'If initialDataSize is not 0, it must be equal to the size of pInitialData, as returned by vkGetPipelineCacheData when pInitialData was originally retrieved' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCacheCreateInfo-initialDataSize-00768)"}, {VALIDATION_ERROR_0f000602, "The spec valid usage text states 'If initialDataSize is not 0, pInitialData must have been retrieved from a previous call to vkGetPipelineCacheData' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCacheCreateInfo-initialDataSize-00769)"}, {VALIDATION_ERROR_0f009005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCacheCreateInfo-flags-zerobitmask)"}, @@ -4854,11 +5036,10 @@ {VALIDATION_ERROR_0f609601, "The spec valid usage text states 'front must be a valid VkStencilOpState structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineDepthStencilStateCreateInfo-front-parameter)"}, {VALIDATION_ERROR_0f61c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineDepthStencilStateCreateInfo-pNext-pNext)"}, {VALIDATION_ERROR_0f62b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineDepthStencilStateCreateInfo-sType-sType)"}, - {VALIDATION_ERROR_0f80048c, "The spec valid usage text states 'discardRectangleCount must be between 0 and VkPhysicalDeviceDiscardRectanglePropertiesEXT::maxDiscardRectangles, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-discardRectangleCount-00582)"}, - {VALIDATION_ERROR_0f805e01, "The spec valid usage text states 'discardRectangleMode must be a valid VkDiscardRectangleModeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-discardRectangleMode-parameter)"}, - {VALIDATION_ERROR_0f809005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-flags-zerobitmask)"}, - {VALIDATION_ERROR_0f81c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-pNext-pNext)"}, - {VALIDATION_ERROR_0f82b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_0f80048c, "The spec valid usage text states 'discardRectangleCount must be between 0 and VkPhysicalDeviceDiscardRectanglePropertiesEXT::maxDiscardRectangles, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-discardRectangleCount-00582)"}, + {VALIDATION_ERROR_0f805e01, "The spec valid usage text states 'discardRectangleMode must be a valid VkDiscardRectangleModeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-discardRectangleMode-parameter)"}, + {VALIDATION_ERROR_0f809005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-flags-zerobitmask)"}, + {VALIDATION_ERROR_0f82b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-sType-sType)"}, {VALIDATION_ERROR_0fa00b44, "The spec valid usage text states 'Each element of pDynamicStates must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineDynamicStateCreateInfo-pDynamicStates-01442)"}, {VALIDATION_ERROR_0fa07c1b, "The spec valid usage text states 'dynamicStateCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineDynamicStateCreateInfo-dynamicStateCount-arraylength)"}, {VALIDATION_ERROR_0fa09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineDynamicStateCreateInfo-flags-zerobitmask)"}, @@ -4873,11 +5054,11 @@ {VALIDATION_ERROR_0fc2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineInputAssemblyStateCreateInfo-sType-sType)"}, {VALIDATION_ERROR_0fc30001, "The spec valid usage text states 'topology must be a valid VkPrimitiveTopology value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineInputAssemblyStateCreateInfo-topology-parameter)"}, {VALIDATION_ERROR_0fe0023c, "The spec valid usage text states 'setLayoutCount must be less than or equal to VkPhysicalDeviceLimits::maxBoundDescriptorSets' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-setLayoutCount-00286)"}, - {VALIDATION_ERROR_0fe0023e, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_SAMPLER and VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorSamplers' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00287)"}, - {VALIDATION_ERROR_0fe00240, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER and VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorUniformBuffers' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00288)"}, - {VALIDATION_ERROR_0fe00242, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_BUFFER and VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorStorageBuffers' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00289)"}, - {VALIDATION_ERROR_0fe00244, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorSampledImages' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00290)"}, - {VALIDATION_ERROR_0fe00246, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorStorageImages' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00291)"}, + {VALIDATION_ERROR_0fe0023e, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_SAMPLER and VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible to any shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorSamplers' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00287)"}, + {VALIDATION_ERROR_0fe00240, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER and VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible to any shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorUniformBuffers' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00288)"}, + {VALIDATION_ERROR_0fe00242, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_BUFFER and VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible to any shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorStorageBuffers' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00289)"}, + {VALIDATION_ERROR_0fe00244, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible to any shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorSampledImages' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00290)"}, + {VALIDATION_ERROR_0fe00246, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible to any shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorStorageImages' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00291)"}, {VALIDATION_ERROR_0fe00248, "The spec valid usage text states 'Any two elements of pPushConstantRanges must not include the same stage in stageFlags' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pPushConstantRanges-00292)"}, {VALIDATION_ERROR_0fe0024a, "The spec valid usage text states 'pSetLayouts must not contain more than one descriptor set layout that was created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00293)"}, {VALIDATION_ERROR_0fe00d18, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorInputAttachments' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01676)"}, @@ -4889,6 +5070,34 @@ {VALIDATION_ERROR_0fe00d24, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetSampledImages' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01682)"}, {VALIDATION_ERROR_0fe00d26, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetStorageImages' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01683)"}, {VALIDATION_ERROR_0fe00d28, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetInputAttachments' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01684)"}, + {VALIDATION_ERROR_0fe01790, "The spec valid usage text states 'The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_SAMPLER and VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorSamplers' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03016)"}, + {VALIDATION_ERROR_0fe01792, "The spec valid usage text states 'The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER and VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorUniformBuffers' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03017)"}, + {VALIDATION_ERROR_0fe01794, "The spec valid usage text states 'The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_STORAGE_BUFFER and VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorStorageBuffers' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03018)"}, + {VALIDATION_ERROR_0fe01796, "The spec valid usage text states 'The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorSampledImages' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03019)"}, + {VALIDATION_ERROR_0fe01798, "The spec valid usage text states 'The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorStorageImages' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03020)"}, + {VALIDATION_ERROR_0fe0179a, "The spec valid usage text states 'The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorInputAttachments' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03021)"}, + {VALIDATION_ERROR_0fe0179c, "The spec valid usage text states 'The total number of descriptors with a descriptorType of VK_DESCRIPTOR_TYPE_SAMPLER and VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxPerStageDescriptorUpdateAfterBindSamplers' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03022)"}, + {VALIDATION_ERROR_0fe0179e, "The spec valid usage text states 'The total number of descriptors with a descriptorType of VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER and VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxPerStageDescriptorUpdateAfterBindUniformBuffers' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03023)"}, + {VALIDATION_ERROR_0fe017a0, "The spec valid usage text states 'The total number of descriptors with a descriptorType of VK_DESCRIPTOR_TYPE_STORAGE_BUFFER and VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxPerStageDescriptorUpdateAfterBindStorageBuffers' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03024)"}, + {VALIDATION_ERROR_0fe017a2, "The spec valid usage text states 'The total number of descriptors with a descriptorType of VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxPerStageDescriptorUpdateAfterBindSampledImages' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03025)"}, + {VALIDATION_ERROR_0fe017a4, "The spec valid usage text states 'The total number of descriptors with a descriptorType of VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxPerStageDescriptorUpdateAfterBindStorageImages' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03026)"}, + {VALIDATION_ERROR_0fe017a6, "The spec valid usage text states 'The total number of descriptors with a descriptorType of VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxPerStageDescriptorUpdateAfterBindInputAttachments' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03027)"}, + {VALIDATION_ERROR_0fe017a8, "The spec valid usage text states 'The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_SAMPLER and VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetSamplers' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03028)"}, + {VALIDATION_ERROR_0fe017aa, "The spec valid usage text states 'The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER accessible across all shader stagess and and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetUniformBuffers' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03029)"}, + {VALIDATION_ERROR_0fe017ac, "The spec valid usage text states 'The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetUniformBuffersDynamic' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03030)"}, + {VALIDATION_ERROR_0fe017ae, "The spec valid usage text states 'The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_STORAGE_BUFFER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetStorageBuffers' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03031)"}, + {VALIDATION_ERROR_0fe017b0, "The spec valid usage text states 'The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetStorageBuffersDynamic' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03032)"}, + {VALIDATION_ERROR_0fe017b2, "The spec valid usage text states 'The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetSampledImages' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03033)"}, + {VALIDATION_ERROR_0fe017b4, "The spec valid usage text states 'The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetStorageImages' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03034)"}, + {VALIDATION_ERROR_0fe017b6, "The spec valid usage text states 'The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetInputAttachments' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-descriptorType-03035)"}, + {VALIDATION_ERROR_0fe017b8, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_SAMPLER and VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxDescriptorSetUpdateAfterBindSamplers' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03036)"}, + {VALIDATION_ERROR_0fe017ba, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER accessible across all shader stagess and and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxDescriptorSetUpdateAfterBindUniformBuffers' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03037)"}, + {VALIDATION_ERROR_0fe017bc, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxDescriptorSetUpdateAfterBindUniformBuffersDynamic' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03038)"}, + {VALIDATION_ERROR_0fe017be, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_BUFFER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxDescriptorSetUpdateAfterBindStorageBuffers' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03039)"}, + {VALIDATION_ERROR_0fe017c0, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxDescriptorSetUpdateAfterBindStorageBuffersDynamic' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03040)"}, + {VALIDATION_ERROR_0fe017c2, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxDescriptorSetUpdateAfterBindSampledImages' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03041)"}, + {VALIDATION_ERROR_0fe017c4, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxDescriptorSetUpdateAfterBindStorageImages' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03042)"}, + {VALIDATION_ERROR_0fe017c6, "The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxDescriptorSetUpdateAfterBindInputAttachments' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03043)"}, {VALIDATION_ERROR_0fe09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-flags-zerobitmask)"}, {VALIDATION_ERROR_0fe1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pNext-pNext)"}, {VALIDATION_ERROR_0fe1f801, "The spec valid usage text states 'If pushConstantRangeCount is not 0, pPushConstantRanges must be a valid pointer to an array of pushConstantRangeCount valid VkPushConstantRange structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pPushConstantRanges-parameter)"}, @@ -4905,18 +5114,18 @@ {VALIDATION_ERROR_1002b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineMultisampleStateCreateInfo-sType-sType)"}, {VALIDATION_ERROR_1002b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineMultisampleStateCreateInfo-sType-unique)"}, {VALIDATION_ERROR_1020061c, "The spec valid usage text states 'If the depth clamping feature is not enabled, depthClampEnable must be VK_FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineRasterizationStateCreateInfo-depthClampEnable-00782)"}, - {VALIDATION_ERROR_1020061e, "The spec valid usage text states 'If the non-solid fill modes feature is not enabled, polygonMode must be VK_POLYGON_MODE_FILL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineRasterizationStateCreateInfo-polygonMode-00783)"}, {VALIDATION_ERROR_10200b0a, "The spec valid usage text states 'If the non-solid fill modes feature is not enabled, polygonMode must be VK_POLYGON_MODE_FILL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineRasterizationStateCreateInfo-polygonMode-01413)"}, {VALIDATION_ERROR_10200b0c, "The spec valid usage text states 'If the VK_NV_fill_rectangle extension is not enabled, polygonMode must not be VK_POLYGON_MODE_FILL_RECTANGLE_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineRasterizationStateCreateInfo-polygonMode-01414)"}, {VALIDATION_ERROR_10200bc6, "The spec valid usage text states 'If the non-solid fill modes feature is not enabled, polygonMode must be VK_POLYGON_MODE_FILL or VK_POLYGON_MODE_FILL_RECTANGLE_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineRasterizationStateCreateInfo-polygonMode-01507)"}, {VALIDATION_ERROR_10203a01, "The spec valid usage text states 'cullMode must be a valid combination of VkCullModeFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineRasterizationStateCreateInfo-cullMode-parameter)"}, {VALIDATION_ERROR_10209005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineRasterizationStateCreateInfo-flags-zerobitmask)"}, {VALIDATION_ERROR_10209801, "The spec valid usage text states 'frontFace must be a valid VkFrontFace value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineRasterizationStateCreateInfo-frontFace-parameter)"}, - {VALIDATION_ERROR_1021c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkPipelineRasterizationStateRasterizationOrderAMD' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineRasterizationStateCreateInfo-pNext-pNext)"}, + {VALIDATION_ERROR_1021c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkPipelineRasterizationConservativeStateCreateInfoEXT or VkPipelineRasterizationStateRasterizationOrderAMD' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineRasterizationStateCreateInfo-pNext-pNext)"}, {VALIDATION_ERROR_10228601, "The spec valid usage text states 'polygonMode must be a valid VkPolygonMode value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineRasterizationStateCreateInfo-polygonMode-parameter)"}, {VALIDATION_ERROR_1022b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineRasterizationStateCreateInfo-sType-sType)"}, - {VALIDATION_ERROR_1042a601, "The spec valid usage text states 'rasterizationOrder must be a valid VkRasterizationOrderAMD value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineRasterizationStateRasterizationOrderAMD-rasterizationOrder-parameter)"}, - {VALIDATION_ERROR_1042b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineRasterizationStateRasterizationOrderAMD-sType-sType)"}, + {VALIDATION_ERROR_1022b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineRasterizationStateCreateInfo-sType-unique)"}, + {VALIDATION_ERROR_1042a601, "The spec valid usage text states 'rasterizationOrder must be a valid VkRasterizationOrderAMD value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineRasterizationStateRasterizationOrderAMD-rasterizationOrder-parameter)"}, + {VALIDATION_ERROR_1042b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineRasterizationStateRasterizationOrderAMD-sType-sType)"}, {VALIDATION_ERROR_10600580, "The spec valid usage text states 'If the geometry shaders feature is not enabled, stage must not be VK_SHADER_STAGE_GEOMETRY_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineShaderStageCreateInfo-stage-00704)"}, {VALIDATION_ERROR_10600582, "The spec valid usage text states 'If the tessellation shaders feature is not enabled, stage must not be VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT or VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineShaderStageCreateInfo-stage-00705)"}, {VALIDATION_ERROR_10600584, "The spec valid usage text states 'stage must not be VK_SHADER_STAGE_ALL_GRAPHICS, or VK_SHADER_STAGE_ALL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineShaderStageCreateInfo-stage-00706)"}, @@ -4943,7 +5152,7 @@ {VALIDATION_ERROR_1062d801, "The spec valid usage text states 'stage must be a valid VkShaderStageFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineShaderStageCreateInfo-stage-parameter)"}, {VALIDATION_ERROR_1080097c, "The spec valid usage text states 'patchControlPoints must be greater than zero and less than or equal to VkPhysicalDeviceLimits::maxTessellationPatchSize' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineTessellationStateCreateInfo-patchControlPoints-01214)"}, {VALIDATION_ERROR_10809005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineTessellationStateCreateInfo-flags-zerobitmask)"}, - {VALIDATION_ERROR_1081c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkPipelineTessellationDomainOriginStateCreateInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineTessellationStateCreateInfo-pNext-pNext)"}, + {VALIDATION_ERROR_1081c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkPipelineTessellationDomainOriginStateCreateInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineTessellationStateCreateInfo-pNext-pNext)"}, {VALIDATION_ERROR_1082b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineTessellationStateCreateInfo-sType-sType)"}, {VALIDATION_ERROR_10a004ca, "The spec valid usage text states 'vertexBindingDescriptionCount must be less than or equal to VkPhysicalDeviceLimits::maxVertexInputBindings' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineVertexInputStateCreateInfo-vertexBindingDescriptionCount-00613)"}, {VALIDATION_ERROR_10a004cc, "The spec valid usage text states 'vertexAttributeDescriptionCount must be less than or equal to VkPhysicalDeviceLimits::maxVertexInputAttributes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineVertexInputStateCreateInfo-vertexAttributeDescriptionCount-00614)"}, @@ -4951,7 +5160,7 @@ {VALIDATION_ERROR_10a004d0, "The spec valid usage text states 'All elements of pVertexBindingDescriptions must describe distinct binding numbers' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineVertexInputStateCreateInfo-pVertexBindingDescriptions-00616)"}, {VALIDATION_ERROR_10a004d2, "The spec valid usage text states 'All elements of pVertexAttributeDescriptions must describe distinct attribute locations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineVertexInputStateCreateInfo-pVertexAttributeDescriptions-00617)"}, {VALIDATION_ERROR_10a09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineVertexInputStateCreateInfo-flags-zerobitmask)"}, - {VALIDATION_ERROR_10a1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineVertexInputStateCreateInfo-pNext-pNext)"}, + {VALIDATION_ERROR_10a1c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkPipelineVertexInputDivisorStateCreateInfoEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineVertexInputStateCreateInfo-pNext-pNext)"}, {VALIDATION_ERROR_10a26401, "The spec valid usage text states 'If vertexAttributeDescriptionCount is not 0, pVertexAttributeDescriptions must be a valid pointer to an array of vertexAttributeDescriptionCount valid VkVertexInputAttributeDescription structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineVertexInputStateCreateInfo-pVertexAttributeDescriptions-parameter)"}, {VALIDATION_ERROR_10a26601, "The spec valid usage text states 'If vertexBindingDescriptionCount is not 0, pVertexBindingDescriptions must be a valid pointer to an array of vertexBindingDescriptionCount valid VkVertexInputBindingDescription structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineVertexInputStateCreateInfo-pVertexBindingDescriptions-parameter)"}, {VALIDATION_ERROR_10a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineVertexInputStateCreateInfo-sType-sType)"}, @@ -4967,36 +5176,32 @@ {VALIDATION_ERROR_10c2b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineViewportStateCreateInfo-sType-unique)"}, {VALIDATION_ERROR_10c2b61b, "The spec valid usage text states 'scissorCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineViewportStateCreateInfo-scissorCount-arraylength)"}, {VALIDATION_ERROR_10c30a1b, "The spec valid usage text states 'viewportCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineViewportStateCreateInfo-viewportCount-arraylength)"}, - {VALIDATION_ERROR_10e0097e, "The spec valid usage text states 'viewportCount must match the viewportCount set in VkPipelineViewportStateCreateInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineViewportSwizzleStateCreateInfoNV-viewportCount-01215)"}, - {VALIDATION_ERROR_10e09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineViewportSwizzleStateCreateInfoNV-flags-zerobitmask)"}, - {VALIDATION_ERROR_10e1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineViewportSwizzleStateCreateInfoNV-pNext-pNext)"}, - {VALIDATION_ERROR_10e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineViewportSwizzleStateCreateInfoNV-sType-sType)"}, - {VALIDATION_ERROR_10e30a1b, "The spec valid usage text states 'viewportCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineViewportSwizzleStateCreateInfoNV-viewportCount-arraylength)"}, - {VALIDATION_ERROR_11000a4e, "The spec valid usage text states 'If the multiple viewports feature is not enabled and viewportWScalingEnable is VK_TRUE, viewportCount must be 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineViewportWScalingStateCreateInfoNV-viewportWScalingEnable-01319)"}, - {VALIDATION_ERROR_11000a50, "The spec valid usage text states 'viewportCount must be between 1 and VkPhysicalDeviceLimits::maxViewports, inclusive if viewportWScalingEnable is VK_TRUE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineViewportWScalingStateCreateInfoNV-viewportCount-01320)"}, - {VALIDATION_ERROR_11000a52, "The spec valid usage text states 'viewportCount and VkPipelineViewportStateCreateInfo::viewportCount must be identical if viewportWScalingEnable is VK_TRUE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineViewportWScalingStateCreateInfoNV-viewportCount-01321)"}, - {VALIDATION_ERROR_1102b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineViewportWScalingStateCreateInfoNV-sType-sType)"}, - {VALIDATION_ERROR_11030a1b, "The spec valid usage text states 'viewportCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineViewportWScalingStateCreateInfoNV-viewportCount-arraylength)"}, - {VALIDATION_ERROR_11200009, "The spec valid usage text states 'Both of the elements of pSwapchains, and the elements of pWaitSemaphores that are valid handles must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentInfoKHR-commonparent)"}, + {VALIDATION_ERROR_10e0097e, "The spec valid usage text states 'viewportCount must match the viewportCount set in VkPipelineViewportStateCreateInfo' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineViewportSwizzleStateCreateInfoNV-viewportCount-01215)"}, + {VALIDATION_ERROR_10e09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineViewportSwizzleStateCreateInfoNV-flags-zerobitmask)"}, + {VALIDATION_ERROR_10e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineViewportSwizzleStateCreateInfoNV-sType-sType)"}, + {VALIDATION_ERROR_10e30a1b, "The spec valid usage text states 'viewportCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineViewportSwizzleStateCreateInfoNV-viewportCount-arraylength)"}, + {VALIDATION_ERROR_1102b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineViewportWScalingStateCreateInfoNV-sType-sType)"}, + {VALIDATION_ERROR_11030a1b, "The spec valid usage text states 'viewportCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineViewportWScalingStateCreateInfoNV-viewportCount-arraylength)"}, + {VALIDATION_ERROR_11200009, "The spec valid usage text states 'Both of the elements of pSwapchains, and the elements of pWaitSemaphores that are valid handles must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentInfoKHR-commonparent)"}, {VALIDATION_ERROR_11200a20, "The spec valid usage text states 'Each element of pImageIndices must be the index of a presentable image acquired from the swapchain specified by the corresponding element of the pSwapchains array, and the presented image subresource must be in the VK_IMAGE_LAYOUT_PRESENT_SRC_KHR layout at the time the operation is executed on a VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentInfoKHR-pImageIndices-01296)"}, {VALIDATION_ERROR_11200b2c, "The spec valid usage text states 'Each element of pImageIndices must be the index of a presentable image acquired from the swapchain specified by the corresponding element of the pSwapchains array, and the presented image subresource must be in the VK_IMAGE_LAYOUT_PRESENT_SRC_KHR or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR layout at the time the operation is executed on a VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentInfoKHR-pImageIndices-01430)"}, - {VALIDATION_ERROR_11218801, "The spec valid usage text states 'pImageIndices must be a valid pointer to an array of swapchainCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentInfoKHR-pImageIndices-parameter)"}, - {VALIDATION_ERROR_1121c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDeviceGroupPresentInfoKHX, VkDisplayPresentInfoKHR, VkPresentRegionsKHR, or VkPresentTimesInfoGOOGLE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_11221e01, "The spec valid usage text states 'If pResults is not NULL, pResults must be a valid pointer to an array of swapchainCount VkResult values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentInfoKHR-pResults-parameter)"}, - {VALIDATION_ERROR_11225801, "The spec valid usage text states 'pSwapchains must be a valid pointer to an array of swapchainCount valid VkSwapchainKHR handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentInfoKHR-pSwapchains-parameter)"}, - {VALIDATION_ERROR_11227601, "The spec valid usage text states 'If waitSemaphoreCount is not 0, pWaitSemaphores must be a valid pointer to an array of waitSemaphoreCount valid VkSemaphore handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentInfoKHR-pWaitSemaphores-parameter)"}, - {VALIDATION_ERROR_1122b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PRESENT_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_1122b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentInfoKHR-sType-unique)"}, - {VALIDATION_ERROR_1122f21b, "The spec valid usage text states 'swapchainCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentInfoKHR-swapchainCount-arraylength)"}, - {VALIDATION_ERROR_11420c01, "The spec valid usage text states 'If rectangleCount is not 0, and pRectangles is not NULL, pRectangles must be a valid pointer to an array of rectangleCount VkRectLayerKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentRegionKHR-pRectangles-parameter)"}, - {VALIDATION_ERROR_116009d8, "The spec valid usage text states 'swapchainCount must be the same value as VkPresentInfoKHR::swapchainCount, where VkPresentInfoKHR is in the pNext-chain of this VkPresentRegionsKHR structure.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentRegionsKHR-swapchainCount-01260)"}, - {VALIDATION_ERROR_11621001, "The spec valid usage text states 'If pRegions is not NULL, pRegions must be a valid pointer to an array of swapchainCount valid VkPresentRegionKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentRegionsKHR-pRegions-parameter)"}, - {VALIDATION_ERROR_1162b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentRegionsKHR-sType-sType)"}, - {VALIDATION_ERROR_1162f21b, "The spec valid usage text states 'swapchainCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentRegionsKHR-swapchainCount-arraylength)"}, - {VALIDATION_ERROR_118009be, "The spec valid usage text states 'swapchainCount must be the same value as VkPresentInfoKHR::swapchainCount, where VkPresentInfoKHR is in the pNext chain of this VkPresentTimesInfoGOOGLE structure.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentTimesInfoGOOGLE-swapchainCount-01247)"}, - {VALIDATION_ERROR_11825e01, "The spec valid usage text states 'If pTimes is not NULL, pTimes must be a valid pointer to an array of swapchainCount VkPresentTimeGOOGLE structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentTimesInfoGOOGLE-pTimes-parameter)"}, - {VALIDATION_ERROR_1182b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentTimesInfoGOOGLE-sType-sType)"}, - {VALIDATION_ERROR_1182f21b, "The spec valid usage text states 'swapchainCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPresentTimesInfoGOOGLE-swapchainCount-arraylength)"}, + {VALIDATION_ERROR_11218801, "The spec valid usage text states 'pImageIndices must be a valid pointer to an array of swapchainCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentInfoKHR-pImageIndices-parameter)"}, + {VALIDATION_ERROR_1121c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDeviceGroupPresentInfoKHR, VkDisplayPresentInfoKHR, VkPresentRegionsKHR, or VkPresentTimesInfoGOOGLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_11221e01, "The spec valid usage text states 'If pResults is not NULL, pResults must be a valid pointer to an array of swapchainCount VkResult values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentInfoKHR-pResults-parameter)"}, + {VALIDATION_ERROR_11225801, "The spec valid usage text states 'pSwapchains must be a valid pointer to an array of swapchainCount valid VkSwapchainKHR handles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentInfoKHR-pSwapchains-parameter)"}, + {VALIDATION_ERROR_11227601, "The spec valid usage text states 'If waitSemaphoreCount is not 0, pWaitSemaphores must be a valid pointer to an array of waitSemaphoreCount valid VkSemaphore handles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentInfoKHR-pWaitSemaphores-parameter)"}, + {VALIDATION_ERROR_1122b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PRESENT_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_1122b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentInfoKHR-sType-unique)"}, + {VALIDATION_ERROR_1122f21b, "The spec valid usage text states 'swapchainCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentInfoKHR-swapchainCount-arraylength)"}, + {VALIDATION_ERROR_11420c01, "The spec valid usage text states 'If rectangleCount is not 0, and pRectangles is not NULL, pRectangles must be a valid pointer to an array of rectangleCount VkRectLayerKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentRegionKHR-pRectangles-parameter)"}, + {VALIDATION_ERROR_116009d8, "The spec valid usage text states 'swapchainCount must be the same value as VkPresentInfoKHR::swapchainCount, where VkPresentInfoKHR is in the pNext-chain of this VkPresentRegionsKHR structure.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentRegionsKHR-swapchainCount-01260)"}, + {VALIDATION_ERROR_11621001, "The spec valid usage text states 'If pRegions is not NULL, pRegions must be a valid pointer to an array of swapchainCount valid VkPresentRegionKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentRegionsKHR-pRegions-parameter)"}, + {VALIDATION_ERROR_1162b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentRegionsKHR-sType-sType)"}, + {VALIDATION_ERROR_1162f21b, "The spec valid usage text states 'swapchainCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentRegionsKHR-swapchainCount-arraylength)"}, + {VALIDATION_ERROR_118009be, "The spec valid usage text states 'swapchainCount must be the same value as VkPresentInfoKHR::swapchainCount, where VkPresentInfoKHR is in the pNext chain of this VkPresentTimesInfoGOOGLE structure.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentTimesInfoGOOGLE-swapchainCount-01247)"}, + {VALIDATION_ERROR_11825e01, "The spec valid usage text states 'If pTimes is not NULL, pTimes must be a valid pointer to an array of swapchainCount VkPresentTimeGOOGLE structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentTimesInfoGOOGLE-pTimes-parameter)"}, + {VALIDATION_ERROR_1182b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentTimesInfoGOOGLE-sType-sType)"}, + {VALIDATION_ERROR_1182f21b, "The spec valid usage text states 'swapchainCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPresentTimesInfoGOOGLE-swapchainCount-arraylength)"}, {VALIDATION_ERROR_11a0024c, "The spec valid usage text states 'offset must be less than VkPhysicalDeviceLimits::maxPushConstantsSize' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPushConstantRange-offset-00294)"}, {VALIDATION_ERROR_11a0024e, "The spec valid usage text states 'offset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPushConstantRange-offset-00295)"}, {VALIDATION_ERROR_11a00250, "The spec valid usage text states 'size must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPushConstantRange-size-00296)"}, @@ -5010,14 +5215,14 @@ {VALIDATION_ERROR_11c1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkQueryPoolCreateInfo-pNext-pNext)"}, {VALIDATION_ERROR_11c29a01, "The spec valid usage text states 'queryType must be a valid VkQueryType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkQueryPoolCreateInfo-queryType-parameter)"}, {VALIDATION_ERROR_11c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkQueryPoolCreateInfo-sType-sType)"}, - {VALIDATION_ERROR_11e009da, "The spec valid usage text states 'The sum of offset and extent must be no greater than the imageExtent member of the VkSwapchainCreateInfoKHR structure given to vkCreateSwapchainKHR.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRectLayerKHR-offset-01261)"}, - {VALIDATION_ERROR_11e009dc, "The spec valid usage text states 'layer must be less than imageArrayLayers member of the VkSwapchainCreateInfoKHR structure given to vkCreateSwapchainKHR.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRectLayerKHR-layer-01262)"}, + {VALIDATION_ERROR_11e009da, "The spec valid usage text states 'The sum of offset and extent must be no greater than the imageExtent member of the VkSwapchainCreateInfoKHR structure given to vkCreateSwapchainKHR.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRectLayerKHR-offset-01261)"}, + {VALIDATION_ERROR_11e009dc, "The spec valid usage text states 'layer must be less than imageArrayLayers member of the VkSwapchainCreateInfoKHR structure given to vkCreateSwapchainKHR.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRectLayerKHR-layer-01262)"}, {VALIDATION_ERROR_12000009, "The spec valid usage text states 'Both of framebuffer, and renderPass must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassBeginInfo-commonparent)"}, {VALIDATION_ERROR_1200070c, "The spec valid usage text states 'clearValueCount must be greater than the largest attachment index in renderPass that specifies a loadOp (or stencilLoadOp, if the attachment has a depth/stencil format) of VK_ATTACHMENT_LOAD_OP_CLEAR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassBeginInfo-clearValueCount-00902)"}, {VALIDATION_ERROR_1200070e, "The spec valid usage text states 'If clearValueCount is not 0, pClearValues must be a valid pointer to an array of clearValueCount valid VkClearValue unions' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassBeginInfo-clearValueCount-00903)"}, {VALIDATION_ERROR_12000710, "The spec valid usage text states 'renderPass must be compatible with the renderPass member of the VkFramebufferCreateInfo structure specified when creating framebuffer.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassBeginInfo-renderPass-00904)"}, {VALIDATION_ERROR_12009401, "The spec valid usage text states 'framebuffer must be a valid VkFramebuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassBeginInfo-framebuffer-parameter)"}, - {VALIDATION_ERROR_1201c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDeviceGroupRenderPassBeginInfoKHX or VkRenderPassSampleLocationsBeginInfoEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassBeginInfo-pNext-pNext)"}, + {VALIDATION_ERROR_1201c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDeviceGroupRenderPassBeginInfo or VkRenderPassSampleLocationsBeginInfoEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassBeginInfo-pNext-pNext)"}, {VALIDATION_ERROR_1202ae01, "The spec valid usage text states 'renderPass must be a valid VkRenderPass handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassBeginInfo-renderPass-parameter)"}, {VALIDATION_ERROR_1202b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassBeginInfo-sType-sType)"}, {VALIDATION_ERROR_1202b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassBeginInfo-sType-unique)"}, @@ -5028,25 +5233,26 @@ {VALIDATION_ERROR_12200688, "The spec valid usage text states 'For any member of pAttachments with a loadOp equal to VK_ATTACHMENT_LOAD_OP_CLEAR, the first use of that attachment must not specify a layout equal to VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL or VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassCreateInfo-pAttachments-00836)"}, {VALIDATION_ERROR_1220068a, "The spec valid usage text states 'For any element of pDependencies, if the srcSubpass is not VK_SUBPASS_EXTERNAL, all stage flags included in the srcStageMask member of that dependency must be a pipeline stage supported by the pipeline identified by the pipelineBindPoint member of the source subpass.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassCreateInfo-pDependencies-00837)"}, {VALIDATION_ERROR_1220068c, "The spec valid usage text states 'For any element of pDependencies, if the dstSubpass is not VK_SUBPASS_EXTERNAL, all stage flags included in the dstStageMask member of that dependency must be a pipeline stage supported by the pipeline identified by the pipelineBindPoint member of the source subpass.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassCreateInfo-pDependencies-00838)"}, - {VALIDATION_ERROR_12200c3c, "The spec valid usage text states 'For any member of pAttachments with a loadOp equal to VK_ATTACHMENT_LOAD_OP_CLEAR, the first use of that attachment must not specify a layout equal to VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassCreateInfo-pAttachments-01566)"}, - {VALIDATION_ERROR_12200c3e, "The spec valid usage text states 'For any member of pAttachments with a stencilLoadOp equal to VK_ATTACHMENT_LOAD_OP_CLEAR, the first use of that attachment must not specify a layout equal to VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassCreateInfo-pAttachments-01567)"}, + {VALIDATION_ERROR_12200c3c, "The spec valid usage text states 'For any member of pAttachments with a loadOp equal to VK_ATTACHMENT_LOAD_OP_CLEAR, the first use of that attachment must not specify a layout equal to VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassCreateInfo-pAttachments-01566)"}, + {VALIDATION_ERROR_12200c3e, "The spec valid usage text states 'For any member of pAttachments with a stencilLoadOp equal to VK_ATTACHMENT_LOAD_OP_CLEAR, the first use of that attachment must not specify a layout equal to VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassCreateInfo-pAttachments-01567)"}, + {VALIDATION_ERROR_12200f0c, "The spec valid usage text states 'If the pNext chain includes an instance of VkRenderPassInputAttachmentAspectCreateInfo, the subpass member of each element of its pAspectReferences member must be less than subpassCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassCreateInfo-pNext-01926)"}, + {VALIDATION_ERROR_12200f0e, "The spec valid usage text states 'If the pNext chain includes an instance of VkRenderPassInputAttachmentAspectCreateInfo, the inputAttachmentIndex member of each element of its pAspectReferences member must be less than the value of inputAttachmentCount in the member of pSubpasses identified by its subpass member' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassCreateInfo-pNext-01927)"}, + {VALIDATION_ERROR_12200f10, "The spec valid usage text states 'If the pNext chain includes an instance of VkRenderPassMultiviewCreateInfo, and its subpassCount member is not zero, that member must be equal to the value of subpassCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassCreateInfo-pNext-01928)"}, + {VALIDATION_ERROR_12200f12, "The spec valid usage text states 'If the pNext chain includes an instance of VkRenderPassMultiviewCreateInfo, if its dependencyCount member is not zero, it must be equal to dependencyCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassCreateInfo-pNext-01929)"}, + {VALIDATION_ERROR_12200f14, "The spec valid usage text states 'If the pNext chain includes an instance of VkRenderPassMultiviewCreateInfo, for each non-zero element of pViewOffsets, the srcSubpass and dstSubpass members of pDependencies at the same index must not be equal' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassCreateInfo-pNext-01930)"}, {VALIDATION_ERROR_12209005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassCreateInfo-flags-zerobitmask)"}, {VALIDATION_ERROR_1220f201, "The spec valid usage text states 'If attachmentCount is not 0, pAttachments must be a valid pointer to an array of attachmentCount valid VkAttachmentDescription structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassCreateInfo-pAttachments-parameter)"}, {VALIDATION_ERROR_12212601, "The spec valid usage text states 'If dependencyCount is not 0, pDependencies must be a valid pointer to an array of dependencyCount valid VkSubpassDependency structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassCreateInfo-pDependencies-parameter)"}, - {VALIDATION_ERROR_1221c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkRenderPassInputAttachmentAspectCreateInfoKHR or VkRenderPassMultiviewCreateInfoKHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassCreateInfo-pNext-pNext)"}, + {VALIDATION_ERROR_1221c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkRenderPassInputAttachmentAspectCreateInfo or VkRenderPassMultiviewCreateInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassCreateInfo-pNext-pNext)"}, {VALIDATION_ERROR_12224201, "The spec valid usage text states 'pSubpasses must be a valid pointer to an array of subpassCount valid VkSubpassDescription structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassCreateInfo-pSubpasses-parameter)"}, {VALIDATION_ERROR_1222b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassCreateInfo-sType-sType)"}, {VALIDATION_ERROR_1222b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassCreateInfo-sType-unique)"}, {VALIDATION_ERROR_1222e61b, "The spec valid usage text states 'subpassCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassCreateInfo-subpassCount-arraylength)"}, - {VALIDATION_ERROR_1240068e, "The spec valid usage text states 'If subpassCount is not zero, subpassCount must be equal to the subpassCount in the VkRenderPassCreateInfo structure at the start of the chain' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassMultiviewCreateInfoKHX-subpassCount-00839)"}, - {VALIDATION_ERROR_12400690, "The spec valid usage text states 'If dependencyCount is not zero, dependencyCount must be equal to the dependencyCount in the VkRenderPassCreateInfo structure at the start of the chain' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassMultiviewCreateInfoKHX-dependencyCount-00840)"}, - {VALIDATION_ERROR_12400692, "The spec valid usage text states 'Each view index must not be set in more than one element of pCorrelationMasks' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassMultiviewCreateInfoKHX-pCorrelationMasks-00841)"}, - {VALIDATION_ERROR_12400694, "The spec valid usage text states 'If an element of pViewOffsets is non-zero, the corresponding VkSubpassDependency structure must have different values of srcSubpass and dstSubpass.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassMultiviewCreateInfoKHX-pViewOffsets-00842)"}, - {VALIDATION_ERROR_12411a01, "The spec valid usage text states 'If correlationMaskCount is not 0, pCorrelationMasks must be a valid pointer to an array of correlationMaskCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassMultiviewCreateInfoKHX-pCorrelationMasks-parameter)"}, - {VALIDATION_ERROR_1241c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassMultiviewCreateInfoKHX-pNext-pNext)"}, - {VALIDATION_ERROR_12426c01, "The spec valid usage text states 'If subpassCount is not 0, pViewMasks must be a valid pointer to an array of subpassCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassMultiviewCreateInfoKHX-pViewMasks-parameter)"}, - {VALIDATION_ERROR_12426e01, "The spec valid usage text states 'If dependencyCount is not 0, pViewOffsets must be a valid pointer to an array of dependencyCount int32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassMultiviewCreateInfoKHX-pViewOffsets-parameter)"}, - {VALIDATION_ERROR_1242b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassMultiviewCreateInfoKHX-sType-sType)"}, + {VALIDATION_ERROR_12400692, "The spec valid usage text states 'Each view index must not be set in more than one element of pCorrelationMasks' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassMultiviewCreateInfo-pCorrelationMasks-00841)"}, + {VALIDATION_ERROR_12411a01, "The spec valid usage text states 'If correlationMaskCount is not 0, pCorrelationMasks must be a valid pointer to an array of correlationMaskCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassMultiviewCreateInfo-pCorrelationMasks-parameter)"}, + {VALIDATION_ERROR_12426c01, "The spec valid usage text states 'If subpassCount is not 0, pViewMasks must be a valid pointer to an array of subpassCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassMultiviewCreateInfo-pViewMasks-parameter)"}, + {VALIDATION_ERROR_12426e01, "The spec valid usage text states 'If dependencyCount is not 0, pViewOffsets must be a valid pointer to an array of dependencyCount int32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassMultiviewCreateInfo-pViewOffsets-parameter)"}, + {VALIDATION_ERROR_1242b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassMultiviewCreateInfo-sType-sType)"}, {VALIDATION_ERROR_12600201, "The spec valid usage text states 'addressModeU must be a valid VkSamplerAddressMode value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerCreateInfo-addressModeU-parameter)"}, {VALIDATION_ERROR_12600401, "The spec valid usage text states 'addressModeV must be a valid VkSamplerAddressMode value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerCreateInfo-addressModeV-parameter)"}, {VALIDATION_ERROR_12600601, "The spec valid usage text states 'addressModeW must be a valid VkSamplerAddressMode value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerCreateInfo-addressModeW-parameter)"}, @@ -5065,18 +5271,18 @@ {VALIDATION_ERROR_12600872, "The spec valid usage text states 'If either magFilter or minFilter is VK_FILTER_CUBIC_IMG, anisotropyEnable must be VK_FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerCreateInfo-magFilter-01081)"}, {VALIDATION_ERROR_12600b1c, "The spec valid usage text states 'If either magFilter or minFilter is VK_FILTER_CUBIC_IMG, the reductionMode member of VkSamplerReductionModeCreateInfoEXT must be VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerCreateInfo-magFilter-01422)"}, {VALIDATION_ERROR_12600b1e, "The spec valid usage text states 'If compareEnable is VK_TRUE, the reductionMode member of VkSamplerReductionModeCreateInfoEXT must be VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerCreateInfo-compareEnable-01423)"}, - {VALIDATION_ERROR_12600cda, "The spec valid usage text states 'If sampler Y'CBCR conversion is enabled and VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR is not set for the format, minFilter and magFilter must be equal to the sampler Y'CBCR conversion's chromaFilter' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerCreateInfo-minFilter-01645)"}, + {VALIDATION_ERROR_12600cda, "The spec valid usage text states 'If sampler Y'CBCR conversion is enabled and VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT is not set for the format, minFilter and magFilter must be equal to the sampler Y'CBCR conversion's chromaFilter' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerCreateInfo-minFilter-01645)"}, {VALIDATION_ERROR_12600cdc, "The spec valid usage text states 'If sampler Y'CBCR conversion is enabled, addressModeU, addressModeV, and addressModeW must be VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, anisotropyEnable must be VK_FALSE, and unnormalizedCoordinates must be VK_FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerCreateInfo-addressModeU-01646)"}, {VALIDATION_ERROR_12600cde, "The spec valid usage text states 'The sampler reduction mode must be set to VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT if sampler Y'CBCR conversion is enabled' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerCreateInfo-None-01647)"}, {VALIDATION_ERROR_12609005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerCreateInfo-flags-zerobitmask)"}, {VALIDATION_ERROR_1260c401, "The spec valid usage text states 'magFilter must be a valid VkFilter value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerCreateInfo-magFilter-parameter)"}, {VALIDATION_ERROR_1260ca01, "The spec valid usage text states 'minFilter must be a valid VkFilter value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerCreateInfo-minFilter-parameter)"}, {VALIDATION_ERROR_1260cc01, "The spec valid usage text states 'mipmapMode must be a valid VkSamplerMipmapMode value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerCreateInfo-mipmapMode-parameter)"}, - {VALIDATION_ERROR_1261c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkSamplerReductionModeCreateInfoEXT or VkSamplerYcbcrConversionInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerCreateInfo-pNext-pNext)"}, + {VALIDATION_ERROR_1261c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkSamplerReductionModeCreateInfoEXT or VkSamplerYcbcrConversionInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerCreateInfo-pNext-pNext)"}, {VALIDATION_ERROR_1262b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerCreateInfo-sType-sType)"}, {VALIDATION_ERROR_1262b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerCreateInfo-sType-unique)"}, {VALIDATION_ERROR_12809005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreCreateInfo-flags-zerobitmask)"}, - {VALIDATION_ERROR_1281c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkExportSemaphoreCreateInfoKHR or VkExportSemaphoreWin32HandleInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreCreateInfo-pNext-pNext)"}, + {VALIDATION_ERROR_1281c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkExportSemaphoreCreateInfo or VkExportSemaphoreWin32HandleInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreCreateInfo-pNext-pNext)"}, {VALIDATION_ERROR_1282b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreCreateInfo-sType-sType)"}, {VALIDATION_ERROR_1282b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreCreateInfo-sType-unique)"}, {VALIDATION_ERROR_12a0087a, "The spec valid usage text states 'codeSize must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkShaderModuleCreateInfo-codeSize-01085)"}, @@ -5085,7 +5291,7 @@ {VALIDATION_ERROR_12a00880, "The spec valid usage text states 'pCode must adhere to the validation rules described by the Validation Rules within a Module section of the SPIR-V Environment appendix' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkShaderModuleCreateInfo-pCode-01088)"}, {VALIDATION_ERROR_12a00882, "The spec valid usage text states 'pCode must declare the Shader capability for SPIR-V code' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkShaderModuleCreateInfo-pCode-01089)"}, {VALIDATION_ERROR_12a00884, "The spec valid usage text states 'pCode must not declare any capability that is not supported by the API, as described by the Capabilities section of the SPIR-V Environment appendix' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkShaderModuleCreateInfo-pCode-01090)"}, - {VALIDATION_ERROR_12a00886, "The spec valid usage text states 'If pCode declares any of the capabilities that are listed as not required by the implementation, the relevant feature must be enabled, as listed in the SPIR-V Environment appendix' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkShaderModuleCreateInfo-pCode-01091)"}, + {VALIDATION_ERROR_12a00886, "The spec valid usage text states 'If pCode declares any of the capabilities listed as optional in the SPIR-V Environment appendix, the corresponding feature(s) must be enabled.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkShaderModuleCreateInfo-pCode-01091)"}, {VALIDATION_ERROR_12a00ac0, "The spec valid usage text states 'If pCode points to SPIR-V code, codeSize must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkShaderModuleCreateInfo-pCode-01376)"}, {VALIDATION_ERROR_12a00ac2, "The spec valid usage text states 'pCode must point to either valid SPIR-V code, formatted and packed as described by the Khronos SPIR-V Specification or valid GLSL code which must be written to the GL_KHR_vulkan_glsl extension specification' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkShaderModuleCreateInfo-pCode-01377)"}, {VALIDATION_ERROR_12a00ac4, "The spec valid usage text states 'If pCode points to SPIR-V code, that code must adhere to the validation rules described by the Validation Rules within a Module section of the SPIR-V Environment appendix' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkShaderModuleCreateInfo-pCode-01378)"}, @@ -5098,8 +5304,8 @@ {VALIDATION_ERROR_12c01a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseBufferMemoryBindInfo-buffer-parameter)"}, {VALIDATION_ERROR_12c0fe01, "The spec valid usage text states 'pBinds must be a valid pointer to an array of bindCount valid VkSparseMemoryBind structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseBufferMemoryBindInfo-pBinds-parameter)"}, {VALIDATION_ERROR_12e008a0, "The spec valid usage text states 'If the sparse aliased residency feature is not enabled, and if any other resources are bound to ranges of memory, the range of memory being bound must not overlap with those bound ranges' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseImageMemoryBind-memory-01104)"}, - {VALIDATION_ERROR_12e008a2, "The spec valid usage text states 'memory and memoryOffset must match the memory requirements of the calling command's image, as described in section Resource Memory Association' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseImageMemoryBind-memory-01105)"}, - {VALIDATION_ERROR_12e008a4, "The spec valid usage text states 'subresource must be a valid image subresource for image (see Image Views)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseImageMemoryBind-subresource-01106)"}, + {VALIDATION_ERROR_12e008a2, "The spec valid usage text states 'memory and memoryOffset must match the memory requirements of the calling command's image, as described in section resources-association' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseImageMemoryBind-memory-01105)"}, + {VALIDATION_ERROR_12e008a4, "The spec valid usage text states 'subresource must be a valid image subresource for image (see resources-image-views)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseImageMemoryBind-subresource-01106)"}, {VALIDATION_ERROR_12e008a6, "The spec valid usage text states 'offset.x must be a multiple of the sparse image block width (VkSparseImageFormatProperties::imageGranularity.width) of the image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseImageMemoryBind-offset-01107)"}, {VALIDATION_ERROR_12e008a8, "The spec valid usage text states 'extent.width must either be a multiple of the sparse image block width of the image, or else (extent.width + offset.x) must equal the width of the image subresource' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseImageMemoryBind-extent-01108)"}, {VALIDATION_ERROR_12e008aa, "The spec valid usage text states 'offset.y must be a multiple of the sparse image block height (VkSparseImageFormatProperties::imageGranularity.height) of the image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseImageMemoryBind-offset-01109)"}, @@ -5118,7 +5324,7 @@ {VALIDATION_ERROR_1320141b, "The spec valid usage text states 'bindCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseImageOpaqueMemoryBindInfo-bindCount-arraylength)"}, {VALIDATION_ERROR_1320a001, "The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseImageOpaqueMemoryBindInfo-image-parameter)"}, {VALIDATION_ERROR_1320fe01, "The spec valid usage text states 'pBinds must be a valid pointer to an array of bindCount valid VkSparseMemoryBind structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseImageOpaqueMemoryBindInfo-pBinds-parameter)"}, - {VALIDATION_ERROR_13400890, "The spec valid usage text states 'If memory is not VK_NULL_HANDLE, memory and memoryOffset must match the memory requirements of the resource, as described in section Resource Memory Association' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseMemoryBind-memory-01096)"}, + {VALIDATION_ERROR_13400890, "The spec valid usage text states 'If memory is not VK_NULL_HANDLE, memory and memoryOffset must match the memory requirements of the resource, as described in section resources-association' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseMemoryBind-memory-01096)"}, {VALIDATION_ERROR_13400892, "The spec valid usage text states 'If memory is not VK_NULL_HANDLE, memory must not have been created with a memory type that reports VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseMemoryBind-memory-01097)"}, {VALIDATION_ERROR_13400894, "The spec valid usage text states 'size must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseMemoryBind-size-01098)"}, {VALIDATION_ERROR_13400896, "The spec valid usage text states 'resourceOffset must be less than the size of the resource' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseMemoryBind-resourceOffset-01099)"}, @@ -5142,7 +5348,7 @@ {VALIDATION_ERROR_13c0009a, "The spec valid usage text states 'If the tessellation shaders feature is not enabled, each element of pWaitDstStageMask must not contain VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubmitInfo-pWaitDstStageMask-00077)"}, {VALIDATION_ERROR_13c0009c, "The spec valid usage text states 'Each element of pWaitDstStageMask must not include VK_PIPELINE_STAGE_HOST_BIT.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubmitInfo-pWaitDstStageMask-00078)"}, {VALIDATION_ERROR_13c11401, "The spec valid usage text states 'If commandBufferCount is not 0, pCommandBuffers must be a valid pointer to an array of commandBufferCount valid VkCommandBuffer handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubmitInfo-pCommandBuffers-parameter)"}, - {VALIDATION_ERROR_13c1c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkD3D12FenceSubmitInfoKHR, VkDeviceGroupSubmitInfoKHX, VkWin32KeyedMutexAcquireReleaseInfoKHR, or VkWin32KeyedMutexAcquireReleaseInfoNV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubmitInfo-pNext-pNext)"}, + {VALIDATION_ERROR_13c1c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkD3D12FenceSubmitInfoKHR, VkDeviceGroupSubmitInfo, VkProtectedSubmitInfo, VkWin32KeyedMutexAcquireReleaseInfoKHR, or VkWin32KeyedMutexAcquireReleaseInfoNV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubmitInfo-pNext-pNext)"}, {VALIDATION_ERROR_13c23401, "The spec valid usage text states 'If signalSemaphoreCount is not 0, pSignalSemaphores must be a valid pointer to an array of signalSemaphoreCount valid VkSemaphore handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubmitInfo-pSignalSemaphores-parameter)"}, {VALIDATION_ERROR_13c27001, "The spec valid usage text states 'If waitSemaphoreCount is not 0, pWaitDstStageMask must be a valid pointer to an array of waitSemaphoreCount valid combinations of VkPipelineStageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubmitInfo-pWaitDstStageMask-parameter)"}, {VALIDATION_ERROR_13c27003, "The spec valid usage text states 'Each element of pWaitDstStageMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubmitInfo-pWaitDstStageMask-requiredbitmask)"}, @@ -5161,9 +5367,9 @@ {VALIDATION_ERROR_13e006c6, "The spec valid usage text states 'If srcSubpass is equal to dstSubpass and not all of the stages in srcStageMask and dstStageMask are framebuffer-space stages, the logically latest pipeline stage in srcStageMask must be logically earlier than or equal to the logically earliest pipeline stage in dstStageMask' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDependency-srcSubpass-00867)"}, {VALIDATION_ERROR_13e006c8, "The spec valid usage text states 'Any access flag included in srcAccessMask must be supported by one of the pipeline stages in srcStageMask, as specified in the table of supported access types.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDependency-srcAccessMask-00868)"}, {VALIDATION_ERROR_13e006ca, "The spec valid usage text states 'Any access flag included in dstAccessMask must be supported by one of the pipeline stages in dstStageMask, as specified in the table of supported access types.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDependency-dstAccessMask-00869)"}, - {VALIDATION_ERROR_13e006cc, "The spec valid usage text states 'If dependencyFlags includes VK_DEPENDENCY_VIEW_LOCAL_BIT_KHX, then both srcSubpass and dstSubpass must not equal VK_SUBPASS_EXTERNAL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSubpassDependency-dependencyFlags-00870)"}, - {VALIDATION_ERROR_13e006ce, "The spec valid usage text states 'If dependencyFlags includes VK_DEPENDENCY_VIEW_LOCAL_BIT_KHX, then the render pass must have multiview enabled' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSubpassDependency-dependencyFlags-00871)"}, - {VALIDATION_ERROR_13e006d0, "The spec valid usage text states 'If srcSubpass equals dstSubpass and that subpass has more than one bit set in the view mask, then dependencyFlags must include VK_DEPENDENCY_VIEW_LOCAL_BIT_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSubpassDependency-srcSubpass-00872)"}, + {VALIDATION_ERROR_13e006cc, "The spec valid usage text states 'If dependencyFlags includes VK_DEPENDENCY_VIEW_LOCAL_BIT, then both srcSubpass and dstSubpass must not equal VK_SUBPASS_EXTERNAL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSubpassDependency-dependencyFlags-00870)"}, + {VALIDATION_ERROR_13e006ce, "The spec valid usage text states 'If dependencyFlags includes VK_DEPENDENCY_VIEW_LOCAL_BIT, then the render pass must have multiview enabled' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSubpassDependency-dependencyFlags-00871)"}, + {VALIDATION_ERROR_13e006d0, "The spec valid usage text states 'If srcSubpass equals dstSubpass and that subpass has more than one bit set in the view mask, then dependencyFlags must include VK_DEPENDENCY_VIEW_LOCAL_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSubpassDependency-srcSubpass-00872)"}, {VALIDATION_ERROR_13e03e01, "The spec valid usage text states 'dependencyFlags must be a valid combination of VkDependencyFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDependency-dependencyFlags-parameter)"}, {VALIDATION_ERROR_13e06801, "The spec valid usage text states 'dstAccessMask must be a valid combination of VkAccessFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDependency-dstAccessMask-parameter)"}, {VALIDATION_ERROR_13e07801, "The spec valid usage text states 'dstStageMask must be a valid combination of VkPipelineStageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDependency-dstStageMask-parameter)"}, @@ -5178,7 +5384,6 @@ {VALIDATION_ERROR_140006a0, "The spec valid usage text states 'If pResolveAttachments is not NULL, the sample count of each element of pColorAttachments must be anything other than VK_SAMPLE_COUNT_1_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDescription-pResolveAttachments-00848)"}, {VALIDATION_ERROR_140006a2, "The spec valid usage text states 'Each element of pResolveAttachments must have a sample count of VK_SAMPLE_COUNT_1_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDescription-pResolveAttachments-00849)"}, {VALIDATION_ERROR_140006a4, "The spec valid usage text states 'Each element of pResolveAttachments must have the same VkFormat as its corresponding color attachment' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDescription-pResolveAttachments-00850)"}, - {VALIDATION_ERROR_140006a6, "The spec valid usage text states 'All attachments in pColorAttachments and pDepthStencilAttachment that are not VK_ATTACHMENT_UNUSED must have the same sample count' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDescription-pColorAttachments-00851)"}, {VALIDATION_ERROR_140006a8, "The spec valid usage text states 'If any input attachments are VK_ATTACHMENT_UNUSED, then any pipelines bound during the subpass must not access those input attachments from the fragment shader' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDescription-None-00852)"}, {VALIDATION_ERROR_140006aa, "The spec valid usage text states 'The attachment member of each element of pPreserveAttachments must not be VK_ATTACHMENT_UNUSED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDescription-attachment-00853)"}, {VALIDATION_ERROR_140006ac, "The spec valid usage text states 'Each element of pPreserveAttachments must not also be an element of any other member of the subpass description' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDescription-pPreserveAttachments-00854)"}, @@ -5194,53 +5399,52 @@ {VALIDATION_ERROR_1401f001, "The spec valid usage text states 'If preserveAttachmentCount is not 0, pPreserveAttachments must be a valid pointer to an array of preserveAttachmentCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDescription-pPreserveAttachments-parameter)"}, {VALIDATION_ERROR_14021c01, "The spec valid usage text states 'If colorAttachmentCount is not 0, and pResolveAttachments is not NULL, pResolveAttachments must be a valid pointer to an array of colorAttachmentCount valid VkAttachmentReference structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDescription-pResolveAttachments-parameter)"}, {VALIDATION_ERROR_14027e01, "The spec valid usage text states 'pipelineBindPoint must be a valid VkPipelineBindPoint value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDescription-pipelineBindPoint-parameter)"}, - {VALIDATION_ERROR_142009bc, "The spec valid usage text states 'supportedSurfaceCounters must not include VK_SURFACE_COUNTER_VBLANK_EXT unless the surface queried is a display surface.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSurfaceCapabilities2EXT-supportedSurfaceCounters-01246)"}, - {VALIDATION_ERROR_1421c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSurfaceCapabilities2EXT-pNext-pNext)"}, - {VALIDATION_ERROR_1422b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSurfaceCapabilities2EXT-sType-sType)"}, - {VALIDATION_ERROR_144009b8, "The spec valid usage text states 'The bits in surfaceCounters must be supported by VkSwapchainCreateInfoKHR::surface, as reported by vkGetPhysicalDeviceSurfaceCapabilities2EXT.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCounterCreateInfoEXT-surfaceCounters-01244)"}, - {VALIDATION_ERROR_1441c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCounterCreateInfoEXT-pNext-pNext)"}, - {VALIDATION_ERROR_1442b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCounterCreateInfoEXT-sType-sType)"}, - {VALIDATION_ERROR_1442ee01, "The spec valid usage text states 'surfaceCounters must be a valid combination of VkSurfaceCounterFlagBitsEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCounterCreateInfoEXT-surfaceCounters-parameter)"}, - {VALIDATION_ERROR_14600009, "The spec valid usage text states 'Both of oldSwapchain, and surface that are valid handles must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-commonparent)"}, - {VALIDATION_ERROR_146009ec, "The spec valid usage text states 'surface must be a surface that is supported by the device as determined using vkGetPhysicalDeviceSurfaceSupportKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-surface-01270)"}, - {VALIDATION_ERROR_146009ee, "The spec valid usage text states 'minImageCount must be greater than or equal to the value returned in the minImageCount member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-minImageCount-01271)"}, - {VALIDATION_ERROR_146009f0, "The spec valid usage text states 'minImageCount must be less than or equal to the value returned in the maxImageCount member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface if the returned maxImageCount is not zero' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-minImageCount-01272)"}, - {VALIDATION_ERROR_146009f2, "The spec valid usage text states 'imageFormat and imageColorSpace must match the format and colorSpace members, respectively, of one of the VkSurfaceFormatKHR structures returned by vkGetPhysicalDeviceSurfaceFormatsKHR for the surface' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01273)"}, - {VALIDATION_ERROR_146009f4, "The spec valid usage text states 'imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageExtent-01274)"}, - {VALIDATION_ERROR_146009f6, "The spec valid usage text states 'imageArrayLayers must be greater than 0 and less than or equal to the maxImageArrayLayers member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageArrayLayers-01275)"}, + {VALIDATION_ERROR_142009bc, "The spec valid usage text states 'supportedSurfaceCounters must not include VK_SURFACE_COUNTER_VBLANK_EXT unless the surface queried is a display surface.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSurfaceCapabilities2EXT-supportedSurfaceCounters-01246)"}, + {VALIDATION_ERROR_1421c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSurfaceCapabilities2EXT-pNext-pNext)"}, + {VALIDATION_ERROR_1422b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSurfaceCapabilities2EXT-sType-sType)"}, + {VALIDATION_ERROR_144009b8, "The spec valid usage text states 'The bits in surfaceCounters must be supported by VkSwapchainCreateInfoKHR::surface, as reported by vkGetPhysicalDeviceSurfaceCapabilities2EXT.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCounterCreateInfoEXT-surfaceCounters-01244)"}, + {VALIDATION_ERROR_1442b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCounterCreateInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_1442ee01, "The spec valid usage text states 'surfaceCounters must be a valid combination of VkSurfaceCounterFlagBitsEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCounterCreateInfoEXT-surfaceCounters-parameter)"}, + {VALIDATION_ERROR_14600009, "The spec valid usage text states 'Both of oldSwapchain, and surface that are valid handles must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-commonparent)"}, + {VALIDATION_ERROR_146009ec, "The spec valid usage text states 'surface must be a surface that is supported by the device as determined using vkGetPhysicalDeviceSurfaceSupportKHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-surface-01270)"}, + {VALIDATION_ERROR_146009ee, "The spec valid usage text states 'minImageCount must be greater than or equal to the value returned in the minImageCount member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-minImageCount-01271)"}, + {VALIDATION_ERROR_146009f0, "The spec valid usage text states 'minImageCount must be less than or equal to the value returned in the maxImageCount member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface if the returned maxImageCount is not zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-minImageCount-01272)"}, + {VALIDATION_ERROR_146009f2, "The spec valid usage text states 'imageFormat and imageColorSpace must match the format and colorSpace members, respectively, of one of the VkSurfaceFormatKHR structures returned by vkGetPhysicalDeviceSurfaceFormatsKHR for the surface' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01273)"}, + {VALIDATION_ERROR_146009f4, "The spec valid usage text states 'imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageExtent-01274)"}, + {VALIDATION_ERROR_146009f6, "The spec valid usage text states 'imageArrayLayers must be greater than 0 and less than or equal to the maxImageArrayLayers member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageArrayLayers-01275)"}, {VALIDATION_ERROR_146009f8, "The spec valid usage text states 'imageUsage must be a subset of the supported usage flags present in the supportedUsageFlags member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageUsage-01276)"}, - {VALIDATION_ERROR_146009fa, "The spec valid usage text states 'If imageSharingMode is VK_SHARING_MODE_CONCURRENT, pQueueFamilyIndices must be a valid pointer to an array of queueFamilyIndexCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageSharingMode-01277)"}, - {VALIDATION_ERROR_146009fc, "The spec valid usage text states 'If imageSharingMode is VK_SHARING_MODE_CONCURRENT, queueFamilyIndexCount must be greater than 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageSharingMode-01278)"}, - {VALIDATION_ERROR_146009fe, "The spec valid usage text states 'preTransform must be one of the bits present in the supportedTransforms member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-preTransform-01279)"}, - {VALIDATION_ERROR_14600a00, "The spec valid usage text states 'compositeAlpha must be one of the bits present in the supportedCompositeAlpha member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-compositeAlpha-01280)"}, - {VALIDATION_ERROR_14600a02, "The spec valid usage text states 'presentMode must be one of the VkPresentModeKHR values returned by vkGetPhysicalDeviceSurfacePresentModesKHR for the surface' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-presentMode-01281)"}, + {VALIDATION_ERROR_146009fa, "The spec valid usage text states 'If imageSharingMode is VK_SHARING_MODE_CONCURRENT, pQueueFamilyIndices must be a valid pointer to an array of queueFamilyIndexCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageSharingMode-01277)"}, + {VALIDATION_ERROR_146009fc, "The spec valid usage text states 'If imageSharingMode is VK_SHARING_MODE_CONCURRENT, queueFamilyIndexCount must be greater than 1' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageSharingMode-01278)"}, + {VALIDATION_ERROR_146009fe, "The spec valid usage text states 'preTransform must be one of the bits present in the supportedTransforms member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-preTransform-01279)"}, + {VALIDATION_ERROR_14600a00, "The spec valid usage text states 'compositeAlpha must be one of the bits present in the supportedCompositeAlpha member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-compositeAlpha-01280)"}, + {VALIDATION_ERROR_14600a02, "The spec valid usage text states 'presentMode must be one of the VkPresentModeKHR values returned by vkGetPhysicalDeviceSurfacePresentModesKHR for the surface' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-presentMode-01281)"}, {VALIDATION_ERROR_14600ace, "The spec valid usage text states 'minImageCount must be 1 if presentMode is either VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR or VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-minImageCount-01383)"}, {VALIDATION_ERROR_14600ad0, "The spec valid usage text states 'If presentMode is VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR or VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR, imageUsage must be a subset of the supported usage flags present in the sharedPresentSupportedUsageFlags member of the VkSharedPresentSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilities2KHR for surface' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageUsage-01384)"}, {VALIDATION_ERROR_14600ae2, "The spec valid usage text states 'If imageSharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the physicalDevice that was used to create device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageSharingMode-01393)"}, {VALIDATION_ERROR_14600b26, "The spec valid usage text states 'If presentMode is VK_PRESENT_MODE_IMMEDIATE_KHR, VK_PRESENT_MODE_MAILBOX_KHR, VK_PRESENT_MODE_FIFO_KHR or VK_PRESENT_MODE_FIFO_RELAXED_KHR, imageUsage must be a subset of the supported usage flags present in the supportedUsageFlags member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for surface' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-presentMode-01427)"}, - {VALIDATION_ERROR_14600b28, "The spec valid usage text states 'If imageSharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by either vkGetPhysicalDeviceQueueFamilyProperties or vkGetPhysicalDeviceQueueFamilyProperties2KHR for the physicalDevice that was used to create device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageSharingMode-01428)"}, - {VALIDATION_ERROR_14600b2a, "The spec valid usage text states 'If the logical device was created with VkDeviceGroupDeviceCreateInfoKHX::physicalDeviceCount equal to 1, flags must not contain VK_SWAPCHAIN_CREATE_BIND_SFR_BIT_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-physicalDeviceCount-01429)"}, - {VALIDATION_ERROR_14600d14, "The spec valid usage text states 'oldSwapchain must not be in the retired state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-oldSwapchain-01674)"}, - {VALIDATION_ERROR_14600d32, "The spec valid usage text states 'imageExtent members width and height must both be non-zero' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageExtent-01689)"}, - {VALIDATION_ERROR_14602e01, "The spec valid usage text states 'compositeAlpha must be a valid VkCompositeAlphaFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-compositeAlpha-parameter)"}, - {VALIDATION_ERROR_14609001, "The spec valid usage text states 'flags must be a valid combination of VkSwapchainCreateFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-flags-parameter)"}, - {VALIDATION_ERROR_1460a201, "The spec valid usage text states 'imageColorSpace must be a valid VkColorSpaceKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageColorSpace-parameter)"}, - {VALIDATION_ERROR_1460a401, "The spec valid usage text states 'imageFormat must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-parameter)"}, - {VALIDATION_ERROR_1460a801, "The spec valid usage text states 'imageSharingMode must be a valid VkSharingMode value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageSharingMode-parameter)"}, - {VALIDATION_ERROR_1460ae01, "The spec valid usage text states 'imageUsage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageUsage-parameter)"}, - {VALIDATION_ERROR_1460ae03, "The spec valid usage text states 'imageUsage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageUsage-requiredbitmask)"}, - {VALIDATION_ERROR_1460de01, "The spec valid usage text states 'If oldSwapchain is not VK_NULL_HANDLE, oldSwapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-oldSwapchain-parameter)"}, - {VALIDATION_ERROR_1460de07, "The spec valid usage text states 'If oldSwapchain is a valid handle, it must have been created, allocated, or retrieved from surface' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-oldSwapchain-parent)"}, - {VALIDATION_ERROR_1461c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDeviceGroupSwapchainCreateInfoKHX or VkSwapchainCounterCreateInfoEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_14629401, "The spec valid usage text states 'preTransform must be a valid VkSurfaceTransformFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-preTransform-parameter)"}, - {VALIDATION_ERROR_14629601, "The spec valid usage text states 'presentMode must be a valid VkPresentModeKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-presentMode-parameter)"}, - {VALIDATION_ERROR_1462b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_1462b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-sType-unique)"}, - {VALIDATION_ERROR_1462ec01, "The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-surface-parameter)"}, - {VALIDATION_ERROR_14805a1b, "The spec valid usage text states 'disabledValidationCheckCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkValidationFlagsEXT-disabledValidationCheckCount-arraylength)"}, - {VALIDATION_ERROR_14814401, "The spec valid usage text states 'pDisabledValidationChecks must be a valid pointer to an array of disabledValidationCheckCount VkValidationCheckEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkValidationFlagsEXT-pDisabledValidationChecks-parameter)"}, - {VALIDATION_ERROR_1481c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkValidationFlagsEXT-pNext-pNext)"}, - {VALIDATION_ERROR_1482b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkValidationFlagsEXT-sType-sType)"}, + {VALIDATION_ERROR_14600b28, "The spec valid usage text states 'If imageSharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by either vkGetPhysicalDeviceQueueFamilyProperties or vkGetPhysicalDeviceQueueFamilyProperties2 for the physicalDevice that was used to create device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageSharingMode-01428)"}, + {VALIDATION_ERROR_14600b2a, "The spec valid usage text states 'If the logical device was created with VkDeviceGroupDeviceCreateInfo::physicalDeviceCount equal to 1, flags must not contain VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-physicalDeviceCount-01429)"}, + {VALIDATION_ERROR_14600d32, "The spec valid usage text states 'imageExtent members width and height must both be non-zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageExtent-01689)"}, + {VALIDATION_ERROR_14600de4, "The spec valid usage text states 'imageFormat, imageUsage, imageExtent, and imageArrayLayers must be supported for VK_IMAGE_TYPE_2D VK_IMAGE_TILING_OPTIMAL images as reported by vkGetPhysicalDeviceImageFormatProperties.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)"}, + {VALIDATION_ERROR_14600f1a, "The spec valid usage text states 'If oldSwapchain is not VK_NULL_HANDLE, oldSwapchain must be a non-retired swapchain associated with native window referred to by surface' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-oldSwapchain-01933)"}, + {VALIDATION_ERROR_14602e01, "The spec valid usage text states 'compositeAlpha must be a valid VkCompositeAlphaFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-compositeAlpha-parameter)"}, + {VALIDATION_ERROR_14609001, "The spec valid usage text states 'flags must be a valid combination of VkSwapchainCreateFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-flags-parameter)"}, + {VALIDATION_ERROR_1460a201, "The spec valid usage text states 'imageColorSpace must be a valid VkColorSpaceKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageColorSpace-parameter)"}, + {VALIDATION_ERROR_1460a401, "The spec valid usage text states 'imageFormat must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-parameter)"}, + {VALIDATION_ERROR_1460a801, "The spec valid usage text states 'imageSharingMode must be a valid VkSharingMode value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageSharingMode-parameter)"}, + {VALIDATION_ERROR_1460ae01, "The spec valid usage text states 'imageUsage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageUsage-parameter)"}, + {VALIDATION_ERROR_1460ae03, "The spec valid usage text states 'imageUsage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageUsage-requiredbitmask)"}, + {VALIDATION_ERROR_1460de01, "The spec valid usage text states 'If oldSwapchain is not VK_NULL_HANDLE, oldSwapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-oldSwapchain-parameter)"}, + {VALIDATION_ERROR_1460de07, "The spec valid usage text states 'If oldSwapchain is a valid handle, it must have been created, allocated, or retrieved from surface' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-oldSwapchain-parent)"}, + {VALIDATION_ERROR_1461c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDeviceGroupSwapchainCreateInfoKHR or VkSwapchainCounterCreateInfoEXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_14629401, "The spec valid usage text states 'preTransform must be a valid VkSurfaceTransformFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-preTransform-parameter)"}, + {VALIDATION_ERROR_14629601, "The spec valid usage text states 'presentMode must be a valid VkPresentModeKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-presentMode-parameter)"}, + {VALIDATION_ERROR_1462b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_1462b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-sType-unique)"}, + {VALIDATION_ERROR_1462ec01, "The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-surface-parameter)"}, + {VALIDATION_ERROR_14805a1b, "The spec valid usage text states 'disabledValidationCheckCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkValidationFlagsEXT-disabledValidationCheckCount-arraylength)"}, + {VALIDATION_ERROR_14814401, "The spec valid usage text states 'pDisabledValidationChecks must be a valid pointer to an array of disabledValidationCheckCount VkValidationCheckEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkValidationFlagsEXT-pDisabledValidationChecks-parameter)"}, + {VALIDATION_ERROR_1482b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkValidationFlagsEXT-sType-sType)"}, {VALIDATION_ERROR_14a004d8, "The spec valid usage text states 'location must be less than VkPhysicalDeviceLimits::maxVertexInputAttributes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkVertexInputAttributeDescription-location-00620)"}, {VALIDATION_ERROR_14a004da, "The spec valid usage text states 'binding must be less than VkPhysicalDeviceLimits::maxVertexInputBindings' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkVertexInputAttributeDescription-binding-00621)"}, {VALIDATION_ERROR_14a004dc, "The spec valid usage text states 'offset must be less than or equal to VkPhysicalDeviceLimits::maxVertexInputAttributeOffset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkVertexInputAttributeDescription-offset-00622)"}, @@ -5249,49 +5453,51 @@ {VALIDATION_ERROR_14c004d4, "The spec valid usage text states 'binding must be less than VkPhysicalDeviceLimits::maxVertexInputBindings' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkVertexInputBindingDescription-binding-00618)"}, {VALIDATION_ERROR_14c004d6, "The spec valid usage text states 'stride must be less than or equal to VkPhysicalDeviceLimits::maxVertexInputBindingStride' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkVertexInputBindingDescription-stride-00619)"}, {VALIDATION_ERROR_14c0ba01, "The spec valid usage text states 'inputRate must be a valid VkVertexInputRate value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkVertexInputBindingDescription-inputRate-parameter)"}, - {VALIDATION_ERROR_14e00a4c, "The spec valid usage text states 'window must be a valid nn::vi::NativeWindowHandle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViSurfaceCreateInfoNN-window-01318)"}, - {VALIDATION_ERROR_14e09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViSurfaceCreateInfoNN-flags-zerobitmask)"}, - {VALIDATION_ERROR_14e1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViSurfaceCreateInfoNN-pNext-pNext)"}, - {VALIDATION_ERROR_14e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViSurfaceCreateInfoNN-sType-sType)"}, - {VALIDATION_ERROR_14e30e01, "The spec valid usage text states 'window must be a pointer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViSurfaceCreateInfoNN-window-parameter)"}, - {VALIDATION_ERROR_15000996, "The spec valid usage text states 'width must be greater than 0.0 and less than or equal to VkPhysicalDeviceLimits::maxViewportDimensions[0]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViewport-width-01227)"}, - {VALIDATION_ERROR_15000998, "The spec valid usage text states 'height must be greater than 0.0 and less than or equal to VkPhysicalDeviceLimits::maxViewportDimensions[1]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViewport-height-01228)"}, - {VALIDATION_ERROR_1500099a, "The spec valid usage text states 'height must be greater than or equal to -VkPhysicalDeviceLimits::maxViewportDimensions[1] and less than or equal to VkPhysicalDeviceLimits::maxViewportDimensions[1]' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkViewport-height-01229)"}, - {VALIDATION_ERROR_1500099c, "The spec valid usage text states 'If the VK_AMD_negative_viewport_height extension is enabled, height can also be negative.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkViewport-height-01230)"}, - {VALIDATION_ERROR_1500099e, "The spec valid usage text states 'x and y must each be between viewportBoundsRange[0] and viewportBoundsRange[1], inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViewport-x-01231)"}, + {VALIDATION_ERROR_14e00a4c, "The spec valid usage text states 'window must be a valid nn::vi::NativeWindowHandle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkViSurfaceCreateInfoNN-window-01318)"}, + {VALIDATION_ERROR_14e09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkViSurfaceCreateInfoNN-flags-zerobitmask)"}, + {VALIDATION_ERROR_14e1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkViSurfaceCreateInfoNN-pNext-pNext)"}, + {VALIDATION_ERROR_14e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkViSurfaceCreateInfoNN-sType-sType)"}, {VALIDATION_ERROR_150009a0, "The spec valid usage text states '(x + width) must be less than or equal to viewportBoundsRange[1]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViewport-x-01232)"}, {VALIDATION_ERROR_150009a2, "The spec valid usage text states '(y + height) must be less than or equal to viewportBoundsRange[1]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViewport-y-01233)"}, - {VALIDATION_ERROR_150009a4, "The spec valid usage text states 'minDepth must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViewport-minDepth-01234)"}, - {VALIDATION_ERROR_150009a6, "The spec valid usage text states 'maxDepth must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViewport-maxDepth-01235)"}, - {VALIDATION_ERROR_15230c01, "The spec valid usage text states 'w must be a valid VkViewportCoordinateSwizzleNV value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViewportSwizzleNV-w-parameter)"}, - {VALIDATION_ERROR_15231001, "The spec valid usage text states 'x must be a valid VkViewportCoordinateSwizzleNV value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViewportSwizzleNV-x-parameter)"}, - {VALIDATION_ERROR_15231201, "The spec valid usage text states 'y must be a valid VkViewportCoordinateSwizzleNV value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViewportSwizzleNV-y-parameter)"}, - {VALIDATION_ERROR_15231401, "The spec valid usage text states 'z must be a valid VkViewportCoordinateSwizzleNV value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViewportSwizzleNV-z-parameter)"}, - {VALIDATION_ERROR_15400a30, "The spec valid usage text states 'display must point to a valid Wayland wl_display.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWaylandSurfaceCreateInfoKHR-display-01304)"}, - {VALIDATION_ERROR_15400a32, "The spec valid usage text states 'surface must point to a valid Wayland wl_surface.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWaylandSurfaceCreateInfoKHR-surface-01305)"}, - {VALIDATION_ERROR_15409005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWaylandSurfaceCreateInfoKHR-flags-zerobitmask)"}, - {VALIDATION_ERROR_1541c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWaylandSurfaceCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_1542b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWaylandSurfaceCreateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_15600009, "The spec valid usage text states 'Both of the elements of pAcquireSyncs, and the elements of pReleaseSyncs that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-commonparent)"}, - {VALIDATION_ERROR_156000a2, "The spec valid usage text states 'Each member of pAcquireSyncs and pReleaseSyncs must be a device memory object imported by setting VkImportMemoryWin32HandleInfoKHR::handleType to VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pAcquireSyncs-00081)"}, - {VALIDATION_ERROR_1560e201, "The spec valid usage text states 'If acquireCount is not 0, pAcquireKeys must be a valid pointer to an array of acquireCount uint64_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pAcquireKeys-parameter)"}, - {VALIDATION_ERROR_1560e401, "The spec valid usage text states 'If acquireCount is not 0, pAcquireSyncs must be a valid pointer to an array of acquireCount valid VkDeviceMemory handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pAcquireSyncs-parameter)"}, - {VALIDATION_ERROR_1560e801, "The spec valid usage text states 'If acquireCount is not 0, pAcquireTimeouts must be a valid pointer to an array of acquireCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pAcquireTimeouts-parameter)"}, - {VALIDATION_ERROR_15621201, "The spec valid usage text states 'If releaseCount is not 0, pReleaseKeys must be a valid pointer to an array of releaseCount uint64_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pReleaseKeys-parameter)"}, - {VALIDATION_ERROR_15621401, "The spec valid usage text states 'If releaseCount is not 0, pReleaseSyncs must be a valid pointer to an array of releaseCount valid VkDeviceMemory handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pReleaseSyncs-parameter)"}, - {VALIDATION_ERROR_1562b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_15800009, "The spec valid usage text states 'Both of the elements of pAcquireSyncs, and the elements of pReleaseSyncs that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-commonparent)"}, - {VALIDATION_ERROR_1580e201, "The spec valid usage text states 'If acquireCount is not 0, pAcquireKeys must be a valid pointer to an array of acquireCount uint64_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pAcquireKeys-parameter)"}, - {VALIDATION_ERROR_1580e401, "The spec valid usage text states 'If acquireCount is not 0, pAcquireSyncs must be a valid pointer to an array of acquireCount valid VkDeviceMemory handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pAcquireSyncs-parameter)"}, - {VALIDATION_ERROR_1580e601, "The spec valid usage text states 'If acquireCount is not 0, pAcquireTimeoutMilliseconds must be a valid pointer to an array of acquireCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pAcquireTimeoutMilliseconds-parameter)"}, - {VALIDATION_ERROR_15821201, "The spec valid usage text states 'If releaseCount is not 0, pReleaseKeys must be a valid pointer to an array of releaseCount uint64_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pReleaseKeys-parameter)"}, - {VALIDATION_ERROR_15821401, "The spec valid usage text states 'If releaseCount is not 0, pReleaseSyncs must be a valid pointer to an array of releaseCount valid VkDeviceMemory handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pReleaseSyncs-parameter)"}, - {VALIDATION_ERROR_1582b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-sType-sType)"}, - {VALIDATION_ERROR_15a00a36, "The spec valid usage text states 'hinstance must be a valid Win32 HINSTANCE.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32SurfaceCreateInfoKHR-hinstance-01307)"}, - {VALIDATION_ERROR_15a00a38, "The spec valid usage text states 'hwnd must be a valid Win32 HWND.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32SurfaceCreateInfoKHR-hwnd-01308)"}, - {VALIDATION_ERROR_15a09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32SurfaceCreateInfoKHR-flags-zerobitmask)"}, - {VALIDATION_ERROR_15a1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32SurfaceCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_15a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWin32SurfaceCreateInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_150009a4, "The spec valid usage text states 'Unless VK_EXT_depth_range_unrestricted extension is enabled minDepth must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkViewport-minDepth-01234)"}, + {VALIDATION_ERROR_150009a6, "The spec valid usage text states 'Unless VK_EXT_depth_range_unrestricted extension is enabled maxDepth must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkViewport-maxDepth-01235)"}, + {VALIDATION_ERROR_15000dd4, "The spec valid usage text states 'width must be greater than 0.0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViewport-width-01770)"}, + {VALIDATION_ERROR_15000dd6, "The spec valid usage text states 'width must be less than or equal to VkPhysicalDeviceLimits::maxViewportDimensions[0]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViewport-width-01771)"}, + {VALIDATION_ERROR_15000dd8, "The spec valid usage text states 'height must be greater than 0.0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViewport-height-01772)"}, + {VALIDATION_ERROR_15000dda, "The spec valid usage text states 'The absolute value of height must be less than or equal to VkPhysicalDeviceLimits::maxViewportDimensions[1]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViewport-height-01773)"}, + {VALIDATION_ERROR_15000ddc, "The spec valid usage text states 'x must be greater than or equal to viewportBoundsRange[0]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViewport-x-01774)"}, + {VALIDATION_ERROR_15000dde, "The spec valid usage text states 'y must be greater than or equal to viewportBoundsRange[0]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkViewport-y-01775)"}, + {VALIDATION_ERROR_15000de0, "The spec valid usage text states 'y must be less than or equal to viewportBoundsRange[1]' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkViewport-y-01776)"}, + {VALIDATION_ERROR_15000de2, "The spec valid usage text states '(y + height) must be greater than or equal to viewportBoundsRange[0]' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkViewport-y-01777)"}, + {VALIDATION_ERROR_15230c01, "The spec valid usage text states 'w must be a valid VkViewportCoordinateSwizzleNV value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkViewportSwizzleNV-w-parameter)"}, + {VALIDATION_ERROR_15231001, "The spec valid usage text states 'x must be a valid VkViewportCoordinateSwizzleNV value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkViewportSwizzleNV-x-parameter)"}, + {VALIDATION_ERROR_15231201, "The spec valid usage text states 'y must be a valid VkViewportCoordinateSwizzleNV value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkViewportSwizzleNV-y-parameter)"}, + {VALIDATION_ERROR_15231401, "The spec valid usage text states 'z must be a valid VkViewportCoordinateSwizzleNV value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkViewportSwizzleNV-z-parameter)"}, + {VALIDATION_ERROR_15400a30, "The spec valid usage text states 'display must point to a valid Wayland wl_display.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWaylandSurfaceCreateInfoKHR-display-01304)"}, + {VALIDATION_ERROR_15400a32, "The spec valid usage text states 'surface must point to a valid Wayland wl_surface.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWaylandSurfaceCreateInfoKHR-surface-01305)"}, + {VALIDATION_ERROR_15409005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWaylandSurfaceCreateInfoKHR-flags-zerobitmask)"}, + {VALIDATION_ERROR_1541c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWaylandSurfaceCreateInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_1542b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWaylandSurfaceCreateInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_15600009, "The spec valid usage text states 'Both of the elements of pAcquireSyncs, and the elements of pReleaseSyncs that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-commonparent)"}, + {VALIDATION_ERROR_156000a2, "The spec valid usage text states 'Each member of pAcquireSyncs and pReleaseSyncs must be a device memory object imported by setting VkImportMemoryWin32HandleInfoKHR::handleType to VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pAcquireSyncs-00081)"}, + {VALIDATION_ERROR_1560e201, "The spec valid usage text states 'If acquireCount is not 0, pAcquireKeys must be a valid pointer to an array of acquireCount uint64_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pAcquireKeys-parameter)"}, + {VALIDATION_ERROR_1560e401, "The spec valid usage text states 'If acquireCount is not 0, pAcquireSyncs must be a valid pointer to an array of acquireCount valid VkDeviceMemory handles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pAcquireSyncs-parameter)"}, + {VALIDATION_ERROR_1560e801, "The spec valid usage text states 'If acquireCount is not 0, pAcquireTimeouts must be a valid pointer to an array of acquireCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pAcquireTimeouts-parameter)"}, + {VALIDATION_ERROR_15621201, "The spec valid usage text states 'If releaseCount is not 0, pReleaseKeys must be a valid pointer to an array of releaseCount uint64_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pReleaseKeys-parameter)"}, + {VALIDATION_ERROR_15621401, "The spec valid usage text states 'If releaseCount is not 0, pReleaseSyncs must be a valid pointer to an array of releaseCount valid VkDeviceMemory handles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pReleaseSyncs-parameter)"}, + {VALIDATION_ERROR_1562b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_15800009, "The spec valid usage text states 'Both of the elements of pAcquireSyncs, and the elements of pReleaseSyncs that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-commonparent)"}, + {VALIDATION_ERROR_1580e201, "The spec valid usage text states 'If acquireCount is not 0, pAcquireKeys must be a valid pointer to an array of acquireCount uint64_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pAcquireKeys-parameter)"}, + {VALIDATION_ERROR_1580e401, "The spec valid usage text states 'If acquireCount is not 0, pAcquireSyncs must be a valid pointer to an array of acquireCount valid VkDeviceMemory handles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pAcquireSyncs-parameter)"}, + {VALIDATION_ERROR_1580e601, "The spec valid usage text states 'If acquireCount is not 0, pAcquireTimeoutMilliseconds must be a valid pointer to an array of acquireCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pAcquireTimeoutMilliseconds-parameter)"}, + {VALIDATION_ERROR_15821201, "The spec valid usage text states 'If releaseCount is not 0, pReleaseKeys must be a valid pointer to an array of releaseCount uint64_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pReleaseKeys-parameter)"}, + {VALIDATION_ERROR_15821401, "The spec valid usage text states 'If releaseCount is not 0, pReleaseSyncs must be a valid pointer to an array of releaseCount valid VkDeviceMemory handles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pReleaseSyncs-parameter)"}, + {VALIDATION_ERROR_1582b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-sType-sType)"}, + {VALIDATION_ERROR_15a00a36, "The spec valid usage text states 'hinstance must be a valid Win32 HINSTANCE.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32SurfaceCreateInfoKHR-hinstance-01307)"}, + {VALIDATION_ERROR_15a00a38, "The spec valid usage text states 'hwnd must be a valid Win32 HWND.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32SurfaceCreateInfoKHR-hwnd-01308)"}, + {VALIDATION_ERROR_15a09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32SurfaceCreateInfoKHR-flags-zerobitmask)"}, + {VALIDATION_ERROR_15a1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32SurfaceCreateInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_15a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWin32SurfaceCreateInfoKHR-sType-sType)"}, {VALIDATION_ERROR_15c00009, "The spec valid usage text states 'Both of dstSet, and the elements of pTexelBufferView that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWriteDescriptorSet-commonparent)"}, {VALIDATION_ERROR_15c00276, "The spec valid usage text states 'dstBinding must be less than or equal to the maximum value of binding of all VkDescriptorSetLayoutBinding structures specified when dstSet's descriptor set layout was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWriteDescriptorSet-dstBinding-00315)"}, {VALIDATION_ERROR_15c00278, "The spec valid usage text states 'dstBinding must be a binding with a non-zero descriptorCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWriteDescriptorSet-dstBinding-00316)"}, @@ -5299,7 +5505,7 @@ {VALIDATION_ERROR_15c0027c, "The spec valid usage text states 'All consecutive bindings updated via a single VkWriteDescriptorSet structure, except those with a descriptorCount of zero, must all either use immutable samplers or must all not use immutable samplers.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWriteDescriptorSet-descriptorCount-00318)"}, {VALIDATION_ERROR_15c0027e, "The spec valid usage text states 'descriptorType must match the type of dstBinding within dstSet' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWriteDescriptorSet-descriptorType-00319)"}, {VALIDATION_ERROR_15c00280, "The spec valid usage text states 'dstSet must be a valid VkDescriptorSet handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWriteDescriptorSet-dstSet-00320)"}, - {VALIDATION_ERROR_15c00282, "The spec valid usage text states 'The sum of dstArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding specified by dstBinding, and all applicable consecutive bindings, as described by consecutive binding updates' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWriteDescriptorSet-dstArrayElement-00321)"}, + {VALIDATION_ERROR_15c00282, "The spec valid usage text states 'The sum of dstArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding specified by dstBinding, and all applicable consecutive bindings, as described by descriptorsets-updates-consecutive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWriteDescriptorSet-dstArrayElement-00321)"}, {VALIDATION_ERROR_15c00284, "The spec valid usage text states 'If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLER, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, pImageInfo must be a valid pointer to an array of descriptorCount valid VkDescriptorImageInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWriteDescriptorSet-descriptorType-00322)"}, {VALIDATION_ERROR_15c00286, "The spec valid usage text states 'If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER or VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, pTexelBufferView must be a valid pointer to an array of descriptorCount valid VkBufferView handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWriteDescriptorSet-descriptorType-00323)"}, {VALIDATION_ERROR_15c00288, "The spec valid usage text states 'If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, pBufferInfo must be a valid pointer to an array of descriptorCount valid VkDescriptorBufferInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWriteDescriptorSet-descriptorType-00324)"}, @@ -5320,46 +5526,50 @@ {VALIDATION_ERROR_15c002a6, "The spec valid usage text states 'If descriptorType is VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, the imageView member of each element of pImageInfo must have been created with VK_IMAGE_USAGE_STORAGE_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWriteDescriptorSet-descriptorType-00339)"}, {VALIDATION_ERROR_15c00af4, "The spec valid usage text states 'If descriptorType is VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, for each descriptor that will be accessed via load or store operations the imageLayout member for corresponding elements of pImageInfo must be VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWriteDescriptorSet-descriptorType-01402)"}, {VALIDATION_ERROR_15c00af6, "The spec valid usage text states 'If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE or VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, the imageLayout member of each element of pImageInfo must be VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWriteDescriptorSet-descriptorType-01403)"}, + {VALIDATION_ERROR_15c017d0, "The spec valid usage text states 'All consecutive bindings updated via a single VkWriteDescriptorSet structure, except those with a descriptorCount of zero, must have identical VkDescriptorBindingFlagBitsEXT.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkWriteDescriptorSet-descriptorCount-03048)"}, {VALIDATION_ERROR_15c0441b, "The spec valid usage text states 'descriptorCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWriteDescriptorSet-descriptorCount-arraylength)"}, {VALIDATION_ERROR_15c04e01, "The spec valid usage text states 'descriptorType must be a valid VkDescriptorType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWriteDescriptorSet-descriptorType-parameter)"}, {VALIDATION_ERROR_15c1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWriteDescriptorSet-pNext-pNext)"}, {VALIDATION_ERROR_15c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkWriteDescriptorSet-sType-sType)"}, - {VALIDATION_ERROR_15e00a3c, "The spec valid usage text states 'connection must point to a valid X11 xcb_connection_t.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkXcbSurfaceCreateInfoKHR-connection-01310)"}, - {VALIDATION_ERROR_15e00a3e, "The spec valid usage text states 'window must be a valid X11 xcb_window_t.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkXcbSurfaceCreateInfoKHR-window-01311)"}, - {VALIDATION_ERROR_15e09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkXcbSurfaceCreateInfoKHR-flags-zerobitmask)"}, - {VALIDATION_ERROR_15e1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkXcbSurfaceCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_15e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkXcbSurfaceCreateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_16000a42, "The spec valid usage text states 'dpy must point to a valid Xlib Display.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkXlibSurfaceCreateInfoKHR-dpy-01313)"}, - {VALIDATION_ERROR_16000a44, "The spec valid usage text states 'window must be a valid Xlib Window.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkXlibSurfaceCreateInfoKHR-window-01314)"}, - {VALIDATION_ERROR_16009005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkXlibSurfaceCreateInfoKHR-flags-zerobitmask)"}, - {VALIDATION_ERROR_1601c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkXlibSurfaceCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_1602b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkXlibSurfaceCreateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_16205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAcquireNextImage2KHX-device-parameter)"}, - {VALIDATION_ERROR_1620e001, "The spec valid usage text states 'pAcquireInfo must be a valid pointer to a valid VkAcquireNextImageInfoKHX structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAcquireNextImage2KHX-pAcquireInfo-parameter)"}, - {VALIDATION_ERROR_16218601, "The spec valid usage text states 'pImageIndex must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAcquireNextImage2KHX-pImageIndex-parameter)"}, - {VALIDATION_ERROR_16400009, "The spec valid usage text states 'Both of device, and swapchain that are valid handles must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAcquireNextImageKHR-commonparent)"}, - {VALIDATION_ERROR_16400a0a, "The spec valid usage text states 'swapchain must not be in the retired state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAcquireNextImageKHR-swapchain-01285)"}, - {VALIDATION_ERROR_16400a0c, "The spec valid usage text states 'If semaphore is not VK_NULL_HANDLE it must be unsignaled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-01286)"}, - {VALIDATION_ERROR_16400a0e, "The spec valid usage text states 'If fence is not VK_NULL_HANDLE it must be unsignaled and must not be associated with any other queue command that has not yet completed execution on that queue' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAcquireNextImageKHR-fence-01287)"}, - {VALIDATION_ERROR_16405601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAcquireNextImageKHR-device-parameter)"}, - {VALIDATION_ERROR_16408801, "The spec valid usage text states 'If fence is not VK_NULL_HANDLE, fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAcquireNextImageKHR-fence-parameter)"}, - {VALIDATION_ERROR_16408807, "The spec valid usage text states 'If fence is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAcquireNextImageKHR-fence-parent)"}, - {VALIDATION_ERROR_16418601, "The spec valid usage text states 'pImageIndex must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAcquireNextImageKHR-pImageIndex-parameter)"}, - {VALIDATION_ERROR_1642b801, "The spec valid usage text states 'If semaphore is not VK_NULL_HANDLE, semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-parameter)"}, - {VALIDATION_ERROR_1642b807, "The spec valid usage text states 'If semaphore is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-parent)"}, - {VALIDATION_ERROR_1642f001, "The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAcquireNextImageKHR-swapchain-parameter)"}, - {VALIDATION_ERROR_16606001, "The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAcquireXlibDisplayEXT-display-parameter)"}, - {VALIDATION_ERROR_16606601, "The spec valid usage text states 'dpy must be a valid pointer to a Display value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAcquireXlibDisplayEXT-dpy-parameter)"}, - {VALIDATION_ERROR_16627a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAcquireXlibDisplayEXT-physicalDevice-parameter)"}, + {VALIDATION_ERROR_15e00a3c, "The spec valid usage text states 'connection must point to a valid X11 xcb_connection_t.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkXcbSurfaceCreateInfoKHR-connection-01310)"}, + {VALIDATION_ERROR_15e00a3e, "The spec valid usage text states 'window must be a valid X11 xcb_window_t.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkXcbSurfaceCreateInfoKHR-window-01311)"}, + {VALIDATION_ERROR_15e09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkXcbSurfaceCreateInfoKHR-flags-zerobitmask)"}, + {VALIDATION_ERROR_15e1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkXcbSurfaceCreateInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_15e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkXcbSurfaceCreateInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_16000a42, "The spec valid usage text states 'dpy must point to a valid Xlib Display.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkXlibSurfaceCreateInfoKHR-dpy-01313)"}, + {VALIDATION_ERROR_16000a44, "The spec valid usage text states 'window must be a valid Xlib Window.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkXlibSurfaceCreateInfoKHR-window-01314)"}, + {VALIDATION_ERROR_16009005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkXlibSurfaceCreateInfoKHR-flags-zerobitmask)"}, + {VALIDATION_ERROR_1601c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkXlibSurfaceCreateInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_1602b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkXlibSurfaceCreateInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_16200e16, "The spec valid usage text states 'If the number of currently acquired images is greater than the difference between the number of images in the swapchain member of pAcquireInfo and the value of VkSurfaceCapabilitiesKHR::minImageCount as returned by a call to vkGetPhysicalDeviceSurfaceCapabilities2KHR with the surface used to create swapchain, the timeout member of pAcquireInfo must not be UINT64_MAX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireNextImage2KHR-swapchain-01803)"}, + {VALIDATION_ERROR_16205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireNextImage2KHR-device-parameter)"}, + {VALIDATION_ERROR_1620e001, "The spec valid usage text states 'pAcquireInfo must be a valid pointer to a valid VkAcquireNextImageInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireNextImage2KHR-pAcquireInfo-parameter)"}, + {VALIDATION_ERROR_16218601, "The spec valid usage text states 'pImageIndex must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireNextImage2KHR-pImageIndex-parameter)"}, + {VALIDATION_ERROR_16400009, "The spec valid usage text states 'Both of device, and swapchain that are valid handles must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-commonparent)"}, + {VALIDATION_ERROR_16400a0a, "The spec valid usage text states 'swapchain must not be in the retired state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-swapchain-01285)"}, + {VALIDATION_ERROR_16400a0c, "The spec valid usage text states 'If semaphore is not VK_NULL_HANDLE it must be unsignaled' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-01286)"}, + {VALIDATION_ERROR_16400a0e, "The spec valid usage text states 'If fence is not VK_NULL_HANDLE it must be unsignaled and must not be associated with any other queue command that has not yet completed execution on that queue' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-fence-01287)"}, + {VALIDATION_ERROR_16400de6, "The spec valid usage text states 'If semaphore is not VK_NULL_HANDLE it must not have any uncompleted signal or wait operations pending' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-01779)"}, + {VALIDATION_ERROR_16400de8, "The spec valid usage text states 'semaphore and fence must not both be equal to VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-01780)"}, + {VALIDATION_ERROR_16400e14, "The spec valid usage text states 'If the number of currently acquired images is greater than the difference between the number of images in swapchain and the value of VkSurfaceCapabilitiesKHR::minImageCount as returned by a call to vkGetPhysicalDeviceSurfaceCapabilities2KHR with the surface used to create swapchain, timeout must not be UINT64_MAX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-swapchain-01802)"}, + {VALIDATION_ERROR_16405601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-device-parameter)"}, + {VALIDATION_ERROR_16408801, "The spec valid usage text states 'If fence is not VK_NULL_HANDLE, fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-fence-parameter)"}, + {VALIDATION_ERROR_16408807, "The spec valid usage text states 'If fence is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-fence-parent)"}, + {VALIDATION_ERROR_16418601, "The spec valid usage text states 'pImageIndex must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-pImageIndex-parameter)"}, + {VALIDATION_ERROR_1642b801, "The spec valid usage text states 'If semaphore is not VK_NULL_HANDLE, semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-parameter)"}, + {VALIDATION_ERROR_1642b807, "The spec valid usage text states 'If semaphore is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-parent)"}, + {VALIDATION_ERROR_1642f001, "The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-swapchain-parameter)"}, + {VALIDATION_ERROR_16606001, "The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireXlibDisplayEXT-display-parameter)"}, + {VALIDATION_ERROR_16606601, "The spec valid usage text states 'dpy must be a valid pointer to a Display value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireXlibDisplayEXT-dpy-parameter)"}, + {VALIDATION_ERROR_16627a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkAcquireXlibDisplayEXT-physicalDevice-parameter)"}, {VALIDATION_ERROR_16805601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateCommandBuffers-device-parameter)"}, {VALIDATION_ERROR_1680ea01, "The spec valid usage text states 'pAllocateInfo must be a valid pointer to a valid VkCommandBufferAllocateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateCommandBuffers-pAllocateInfo-parameter)"}, {VALIDATION_ERROR_16811401, "The spec valid usage text states 'pCommandBuffers must be a valid pointer to an array of pAllocateInfo::commandBufferCount VkCommandBuffer handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateCommandBuffers-pCommandBuffers-parameter)"}, {VALIDATION_ERROR_16a05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateDescriptorSets-device-parameter)"}, {VALIDATION_ERROR_16a0ea01, "The spec valid usage text states 'pAllocateInfo must be a valid pointer to a valid VkDescriptorSetAllocateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateDescriptorSets-pAllocateInfo-parameter)"}, {VALIDATION_ERROR_16a13001, "The spec valid usage text states 'pDescriptorSets must be a valid pointer to an array of pAllocateInfo::descriptorSetCount VkDescriptorSet handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateDescriptorSets-pDescriptorSets-parameter)"}, - {VALIDATION_ERROR_16c004f8, "The spec valid usage text states 'The number of currently valid memory objects, allocated from device, must be less than VkPhysicalDeviceLimits::maxMemoryAllocationCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateMemory-device-00636)"}, - {VALIDATION_ERROR_16c00d62, "The spec valid usage text states 'pAllocateInfo->allocationSize must be less than or equal to VkPhysicalDeviceMemoryProperties::memoryHeaps[pAllocateInfo->memoryTypeIndex].size as returned by vkGetPhysicalDeviceMemoryProperties for the VkPhysicalDevice that device was created from.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateMemory-pAllocateInfo-01713)"}, - {VALIDATION_ERROR_16c00d64, "The spec valid usage text states 'pAllocateInfo->memoryTypeIndex must be less than VkPhysicalDeviceMemoryProperties::memoryTypeCount as returned by vkGetPhysicalDeviceMemoryProperties for the VkPhysicalDevice that device was created from.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateMemory-pAllocateInfo-01714)"}, + {VALIDATION_ERROR_16c00d62, "The spec valid usage text states 'pAllocateInfo-&gt;allocationSize must be less than or equal to VkPhysicalDeviceMemoryProperties::memoryHeaps[pAllocateInfo-&gt;memoryTypeIndex].size as returned by vkGetPhysicalDeviceMemoryProperties for the VkPhysicalDevice that device was created from.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateMemory-pAllocateInfo-01713)"}, + {VALIDATION_ERROR_16c00d64, "The spec valid usage text states 'pAllocateInfo-&gt;memoryTypeIndex must be less than VkPhysicalDeviceMemoryProperties::memoryTypeCount as returned by vkGetPhysicalDeviceMemoryProperties for the VkPhysicalDevice that device was created from.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateMemory-pAllocateInfo-01714)"}, {VALIDATION_ERROR_16c05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateMemory-device-parameter)"}, {VALIDATION_ERROR_16c0ea01, "The spec valid usage text states 'pAllocateInfo must be a valid pointer to a valid VkMemoryAllocateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateMemory-pAllocateInfo-parameter)"}, {VALIDATION_ERROR_16c0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkAllocateMemory-pAllocator-parameter)"}, @@ -5381,16 +5591,18 @@ {VALIDATION_ERROR_1700081a, "The spec valid usage text states 'The size member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer must be less than or equal to the size of memory minus memoryOffset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory-size-01037)"}, {VALIDATION_ERROR_1700081c, "The spec valid usage text states 'If buffer was created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must have been created with VkDedicatedAllocationMemoryAllocateInfoNV::buffer equal to a buffer handle created with identical creation parameters to buffer and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory-buffer-01038)"}, {VALIDATION_ERROR_1700081e, "The spec valid usage text states 'If buffer was not created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must not have been allocated dedicated for a specific buffer or image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory-buffer-01039)"}, - {VALIDATION_ERROR_17000b48, "The spec valid usage text states 'If buffer requires a dedicated allocation(as reported by vkGetBufferMemoryRequirements2KHR in VkMemoryDedicatedRequirementsKHR::requiresDedicatedAllocation for image), memory must have been created with VkMemoryDedicatedAllocateInfoKHR::buffer equal to buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory-buffer-01444)"}, - {VALIDATION_ERROR_17000bc8, "The spec valid usage text states 'If the VkmemoryAllocateInfo provided when memory was allocated included an instance of VkMemoryDedicatedAllocateInfo in its pNext chain, and VkMemoryDedicatedAllocateInfo::buffer was not VK_NULL_HANDLE, then buffer must equal VkMemoryDedicatedAllocateInfo::buffer and memoryOffset must be zero.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory-memory-01508)"}, + {VALIDATION_ERROR_17000b48, "The spec valid usage text states 'If buffer requires a dedicated allocation(as reported by vkGetBufferMemoryRequirements2 in VkMemoryDedicatedRequirements::requiresDedicatedAllocation for buffer), memory must have been created with VkMemoryDedicatedAllocateInfo::buffer equal to buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory-buffer-01444)"}, + {VALIDATION_ERROR_17000bc8, "The spec valid usage text states 'If the VkMemoryAllocateInfo provided when memory was allocated included an instance of VkMemoryDedicatedAllocateInfo in its pNext chain, and VkMemoryDedicatedAllocateInfo::buffer was not VK_NULL_HANDLE, then buffer must equal VkMemoryDedicatedAllocateInfo::buffer, and memoryOffset must be zero.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory-memory-01508)"}, + {VALIDATION_ERROR_17000ed4, "The spec valid usage text states 'If buffer was created with the VK_BUFFER_CREATE_PROTECTED_BIT bit set, the buffer must be bound to a memory object allocated with a memory type that reports VK_MEMORY_PROPERTY_PROTECTED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory-None-01898)"}, + {VALIDATION_ERROR_17000ed6, "The spec valid usage text states 'If buffer was created with the VK_BUFFER_CREATE_PROTECTED_BIT bit not set, the buffer must not be bound to a memory object created with a memory type that reports VK_MEMORY_PROPERTY_PROTECTED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory-None-01899)"}, {VALIDATION_ERROR_17001a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory-buffer-parameter)"}, {VALIDATION_ERROR_17001a07, "The spec valid usage text states 'buffer must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory-buffer-parent)"}, {VALIDATION_ERROR_17005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory-device-parameter)"}, {VALIDATION_ERROR_1700c601, "The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory-memory-parameter)"}, {VALIDATION_ERROR_1700c607, "The spec valid usage text states 'memory must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory-memory-parent)"}, - {VALIDATION_ERROR_1720161b, "The spec valid usage text states 'bindInfoCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory2KHR-bindInfoCount-arraylength)"}, - {VALIDATION_ERROR_17205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory2KHR-device-parameter)"}, - {VALIDATION_ERROR_1720fa01, "The spec valid usage text states 'pBindInfos must be a valid pointer to an array of bindInfoCount valid VkBindBufferMemoryInfoKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindBufferMemory2KHR-pBindInfos-parameter)"}, + {VALIDATION_ERROR_1720161b, "The spec valid usage text states 'bindInfoCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory2-bindInfoCount-arraylength)"}, + {VALIDATION_ERROR_17205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory2-device-parameter)"}, + {VALIDATION_ERROR_1720fa01, "The spec valid usage text states 'pBindInfos must be a valid pointer to an array of bindInfoCount valid VkBindBufferMemoryInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindBufferMemory2-pBindInfos-parameter)"}, {VALIDATION_ERROR_17400828, "The spec valid usage text states 'image must not already be backed by a memory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-image-01044)"}, {VALIDATION_ERROR_1740082a, "The spec valid usage text states 'image must not have been created with any sparse memory binding flags' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-image-01045)"}, {VALIDATION_ERROR_1740082c, "The spec valid usage text states 'memoryOffset must be less than the size of memory' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-memoryOffset-01046)"}, @@ -5399,29 +5611,29 @@ {VALIDATION_ERROR_17400832, "The spec valid usage text states 'The size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image must be less than or equal to the size of memory minus memoryOffset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-size-01049)"}, {VALIDATION_ERROR_17400834, "The spec valid usage text states 'If image was created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must have been created with VkDedicatedAllocationMemoryAllocateInfoNV::image equal to an image handle created with identical creation parameters to image and memoryOffset must be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory-image-01050)"}, {VALIDATION_ERROR_17400836, "The spec valid usage text states 'If image was not created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must not have been allocated dedicated for a specific buffer or image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-image-01051)"}, - {VALIDATION_ERROR_17400b4a, "The spec valid usage text states 'If image requires a dedicated allocation (as reported by vkGetImageMemoryRequirements2KHR in VkMemoryDedicatedRequirementsKHR::requiresDedicatedAllocation for image), memory must have been created with VkMemoryDedicatedAllocateInfoKHR::image equal to image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory-image-01445)"}, - {VALIDATION_ERROR_17400bca, "The spec valid usage text states 'If the VkmemoryAllocateInfo provided when memory was allocated included an instance of VkMemoryDedicatedAllocateInfo in its pNext chain, and VkMemoryDedicatedAllocateInfo::image was not VK_NULL_HANDLE, then image must equal VkMemoryDedicatedAllocateInfo::image and memoryOffset must be zero.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory-memory-01509)"}, - {VALIDATION_ERROR_17400c90, "The spec valid usage text states 'image must not have been created with the VK_IMAGE_CREATE_DISJOINT_BIT_KHR set.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory-image-01608)"}, + {VALIDATION_ERROR_17400b4a, "The spec valid usage text states 'If image requires a dedicated allocation (as reported by vkGetImageMemoryRequirements2 in VkMemoryDedicatedRequirements::requiresDedicatedAllocation for image), memory must have been created with VkMemoryDedicatedAllocateInfo::image equal to image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory-image-01445)"}, + {VALIDATION_ERROR_17400bca, "The spec valid usage text states 'If the VkMemoryAllocateInfo provided when memory was allocated included an instance of VkMemoryDedicatedAllocateInfo in its pNext chain, and VkMemoryDedicatedAllocateInfo::image was not VK_NULL_HANDLE, then image must equal VkMemoryDedicatedAllocateInfo::image and memoryOffset must be zero.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory-memory-01509)"}, + {VALIDATION_ERROR_17400c90, "The spec valid usage text states 'image must not have been created with the VK_IMAGE_CREATE_DISJOINT_BIT set.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory-image-01608)"}, + {VALIDATION_ERROR_17400eda, "The spec valid usage text states 'If image was created with the VK_IMAGE_CREATE_PROTECTED_BIT bit set, the image must be bound to a memory object allocated with a memory type that reports VK_MEMORY_PROPERTY_PROTECTED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory-None-01901)"}, + {VALIDATION_ERROR_17400edc, "The spec valid usage text states 'If image was created with the VK_IMAGE_CREATE_PROTECTED_BIT bit not set, the image must not be bound to a memory object created with a memory type that reports VK_MEMORY_PROPERTY_PROTECTED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory-None-01902)"}, {VALIDATION_ERROR_17405601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-device-parameter)"}, {VALIDATION_ERROR_1740a001, "The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-image-parameter)"}, {VALIDATION_ERROR_1740a007, "The spec valid usage text states 'image must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-image-parent)"}, {VALIDATION_ERROR_1740c601, "The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-memory-parameter)"}, {VALIDATION_ERROR_1740c607, "The spec valid usage text states 'memory must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory-memory-parent)"}, - {VALIDATION_ERROR_1760161b, "The spec valid usage text states 'bindInfoCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory2KHR-bindInfoCount-arraylength)"}, - {VALIDATION_ERROR_17605601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory2KHR-device-parameter)"}, - {VALIDATION_ERROR_1760fa01, "The spec valid usage text states 'pBindInfos must be a valid pointer to an array of bindInfoCount valid VkBindImageMemoryInfoKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkBindImageMemory2KHR-pBindInfos-parameter)"}, + {VALIDATION_ERROR_1760161b, "The spec valid usage text states 'bindInfoCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory2-bindInfoCount-arraylength)"}, + {VALIDATION_ERROR_17605601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory2-device-parameter)"}, + {VALIDATION_ERROR_1760fa01, "The spec valid usage text states 'pBindInfos must be a valid pointer to an array of bindInfoCount valid VkBindImageMemoryInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkBindImageMemory2-pBindInfos-parameter)"}, {VALIDATION_ERROR_17800009, "The spec valid usage text states 'Both of commandBuffer, and queryPool must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-commonparent)"}, - {VALIDATION_ERROR_1780063c, "The spec valid usage text states 'The query identified by queryPool and query must currently not be active' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-queryPool-00798)"}, - {VALIDATION_ERROR_1780063e, "The spec valid usage text states 'The query identified by queryPool and query must be unavailable' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-queryPool-00799)"}, {VALIDATION_ERROR_17800640, "The spec valid usage text states 'If the precise occlusion queries feature is not enabled, or the queryType used to create queryPool was not VK_QUERY_TYPE_OCCLUSION, flags must not contain VK_QUERY_CONTROL_PRECISE_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-queryType-00800)"}, - {VALIDATION_ERROR_17800642, "The spec valid usage text states 'queryPool must have been created with a queryType that differs from that of any other queries that have been made active, and are currently still active within commandBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-queryPool-00801)"}, {VALIDATION_ERROR_17800644, "The spec valid usage text states 'query must be less than the number of queries in queryPool' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-query-00802)"}, {VALIDATION_ERROR_17800646, "The spec valid usage text states 'If the queryType used to create queryPool was VK_QUERY_TYPE_OCCLUSION, the VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-queryType-00803)"}, {VALIDATION_ERROR_17800648, "The spec valid usage text states 'If the queryType used to create queryPool was VK_QUERY_TYPE_PIPELINE_STATISTICS and any of the pipelineStatistics indicate graphics operations, the VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-queryType-00804)"}, {VALIDATION_ERROR_1780064a, "The spec valid usage text states 'If the queryType used to create queryPool was VK_QUERY_TYPE_PIPELINE_STATISTICS and any of the pipelineStatistics indicate compute operations, the VkCommandPool that commandBuffer was allocated from must support compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-queryType-00805)"}, - {VALIDATION_ERROR_1780064c, "The spec valid usage text states 'All queries used by the command must not be active' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginQuery-None-00806)"}, - {VALIDATION_ERROR_1780064e, "The spec valid usage text states 'All queries used by the command must be unavailable' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginQuery-None-00807)"}, + {VALIDATION_ERROR_1780064e, "The spec valid usage text states 'All queries used by the command must be unavailable' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-None-00807)"}, {VALIDATION_ERROR_17800650, "The spec valid usage text states 'If vkCmdBeginQuery is called within a render pass instance, the sum of query and the number of bits set in the current subpass's view mask must be less than or equal to the number of queries in queryPool' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginQuery-query-00808)"}, + {VALIDATION_ERROR_17800eba, "The spec valid usage text states 'commandBuffer must not be a protected command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginQuery-commandBuffer-01885)"}, + {VALIDATION_ERROR_17800f04, "The spec valid usage text states 'queryPool must have been created with a queryType that differs from that of any queries that are active within commandBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-queryPool-01922)"}, {VALIDATION_ERROR_17802401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-commandBuffer-parameter)"}, {VALIDATION_ERROR_17802413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-commandBuffer-recording)"}, {VALIDATION_ERROR_17802415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginQuery-commandBuffer-cmdpool)"}, @@ -5430,12 +5642,13 @@ {VALIDATION_ERROR_17a00017, "The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-renderpass)"}, {VALIDATION_ERROR_17a00019, "The spec valid usage text states 'commandBuffer must be a primary VkCommandBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-bufferlevel)"}, {VALIDATION_ERROR_17a006fe, "The spec valid usage text states 'If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL then the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-initialLayout-00895)"}, - {VALIDATION_ERROR_17a00700, "The spec valid usage text states 'If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-initialLayout-00896)"}, + {VALIDATION_ERROR_17a00700, "The spec valid usage text states 'If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, or VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL then the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-initialLayout-00896)"}, {VALIDATION_ERROR_17a00702, "The spec valid usage text states 'If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL then the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with VK_IMAGE_USAGE_SAMPLED_BIT or VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-initialLayout-00897)"}, {VALIDATION_ERROR_17a00704, "The spec valid usage text states 'If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL then the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-initialLayout-00898)"}, {VALIDATION_ERROR_17a00706, "The spec valid usage text states 'If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL then the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-initialLayout-00899)"}, {VALIDATION_ERROR_17a00708, "The spec valid usage text states 'If any of the initialLayout members of the VkAttachmentDescription structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is not VK_IMAGE_LAYOUT_UNDEFINED, then each such initialLayout must be equal to the current layout of the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-initialLayout-00900)"}, - {VALIDATION_ERROR_17a0070a, "The spec valid usage text states 'The srcStageMask and dstStageMask members of any element of the pDependencies member of VkRenderPassCreateInfo used to create renderpass must be supported by the capabilities of the queue family identified by the queueFamilyIndex member of the VkCommandPoolCreateInfo used to create the command pool which commandBuffer was allocated from.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-srcStageMask-00901)"}, + {VALIDATION_ERROR_17a0070a, "The spec valid usage text states 'The srcStageMask and dstStageMask members of any element of the pDependencies member of VkRenderPassCreateInfo used to create renderPass must be supported by the capabilities of the queue family identified by the queueFamilyIndex member of the VkCommandPoolCreateInfo used to create the command pool which commandBuffer was allocated from.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-srcStageMask-00901)"}, + {VALIDATION_ERROR_17a00dbc, "The spec valid usage text states 'If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, or VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL then the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginRenderPass-initialLayout-01758)"}, {VALIDATION_ERROR_17a02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-commandBuffer-parameter)"}, {VALIDATION_ERROR_17a02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-commandBuffer-recording)"}, {VALIDATION_ERROR_17a02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBeginRenderPass-commandBuffer-cmdpool)"}, @@ -5516,12 +5729,15 @@ {VALIDATION_ERROR_184001da, "The spec valid usage text states 'If filter is VK_FILTER_CUBIC_IMG, srcImage must have a VkImageType of VK_IMAGE_TYPE_3D' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-filter-00237)"}, {VALIDATION_ERROR_18400aec, "The spec valid usage text states 'srcImageLayout must be VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-srcImageLayout-01398)"}, {VALIDATION_ERROR_18400aee, "The spec valid usage text states 'dstImageLayout must be VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-dstImageLayout-01399)"}, - {VALIDATION_ERROR_18400c32, "The spec valid usage text states 'srcImage must not use a format listed in Formats requiring sampler Y'CBCR conversion for VK_IMAGE_ASPECT_COLOR_BIT image views' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-srcImage-01561)"}, - {VALIDATION_ERROR_18400c34, "The spec valid usage text states 'dstImage must not use a format listed in Formats requiring sampler Y'CBCR conversion for VK_IMAGE_ASPECT_COLOR_BIT image views' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-dstImage-01562)"}, + {VALIDATION_ERROR_18400c32, "The spec valid usage text states 'srcImage must not use a format listed in features-formats-requiring-sampler-ycbcr-conversion' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-srcImage-01561)"}, + {VALIDATION_ERROR_18400c34, "The spec valid usage text states 'dstImage must not use a format listed in features-formats-requiring-sampler-ycbcr-conversion' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-dstImage-01562)"}, {VALIDATION_ERROR_18400d52, "The spec valid usage text states 'The srcSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-srcSubresource-01705)"}, {VALIDATION_ERROR_18400d54, "The spec valid usage text states 'The dstSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-dstSubresource-01706)"}, {VALIDATION_ERROR_18400d56, "The spec valid usage text states 'The srcSubresource.baseArrayLayer + srcSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-srcSubresource-01707)"}, {VALIDATION_ERROR_18400d58, "The spec valid usage text states 'The dstSubresource.baseArrayLayer + dstSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-dstSubresource-01708)"}, + {VALIDATION_ERROR_18400e54, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then srcImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-commandBuffer-01834)"}, + {VALIDATION_ERROR_18400e56, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-commandBuffer-01835)"}, + {VALIDATION_ERROR_18400e58, "The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstImage must not be an unprotected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBlitImage-commandBuffer-01836)"}, {VALIDATION_ERROR_18402401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-commandBuffer-parameter)"}, {VALIDATION_ERROR_18402413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-commandBuffer-recording)"}, {VALIDATION_ERROR_18402415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdBlitImage-commandBuffer-cmdpool)"}, @@ -5544,23 +5760,22 @@ {VALIDATION_ERROR_1860f201, "The spec valid usage text states 'pAttachments must be a valid pointer to an array of attachmentCount valid VkClearAttachment structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearAttachments-pAttachments-parameter)"}, {VALIDATION_ERROR_18620e01, "The spec valid usage text states 'pRects must be a valid pointer to an array of rectCount VkClearRect structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearAttachments-pRects-parameter)"}, {VALIDATION_ERROR_1862aa1b, "The spec valid usage text states 'rectCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearAttachments-rectCount-arraylength)"}, - {VALIDATION_ERROR_18800002, "The spec valid usage text states 'image must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearColorImage-image-00001)"}, + {VALIDATION_ERROR_18800002, "The spec valid usage text states 'image must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearColorImage-image-00001)"}, {VALIDATION_ERROR_18800004, "The spec valid usage text states 'image must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-image-00002)"}, {VALIDATION_ERROR_18800006, "The spec valid usage text states 'If image is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-image-00003)"}, {VALIDATION_ERROR_18800008, "The spec valid usage text states 'imageLayout must specify the layout of the image subresource ranges of image specified in pRanges at the time this command is executed on a VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-imageLayout-00004)"}, {VALIDATION_ERROR_18800009, "The spec valid usage text states 'Both of commandBuffer, and image must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-commonparent)"}, {VALIDATION_ERROR_1880000a, "The spec valid usage text states 'imageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-imageLayout-00005)"}, - {VALIDATION_ERROR_1880000c, "The spec valid usage text states 'The image range of any given element of pRanges must be an image subresource range that is contained within image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-pRanges-00006)"}, {VALIDATION_ERROR_1880000e, "The spec valid usage text states 'image must not have a compressed or depth/stencil format' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-image-00007)"}, {VALIDATION_ERROR_18800017, "The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-renderpass)"}, {VALIDATION_ERROR_18800ae4, "The spec valid usage text states 'imageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearColorImage-imageLayout-01394)"}, {VALIDATION_ERROR_18800b7c, "The spec valid usage text states 'The VkImageSubresourceRange::baseMipLevel members of the elements of the pRanges array must each be less than the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-baseMipLevel-01470)"}, - {VALIDATION_ERROR_18800b7e, "The spec valid usage text states 'If the VkImageSubresourceRange::levelCount member of any element of the pRanges array is not VK_REMAINING_MIP_LEVELS, it must be non-zero and VkImageSubresourceRange::baseMipLevel + VkImageSubresourceRange::levelCount for that element of the pRanges array must be less than or equal to the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-levelCount-01471)"}, {VALIDATION_ERROR_18800b80, "The spec valid usage text states 'The VkImageSubresourceRange::baseArrayLayer members of the elements of the pRanges array must each be less than the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-baseArrayLayer-01472)"}, - {VALIDATION_ERROR_18800b82, "The spec valid usage text states 'If the VkImageSubresourceRange::layerCount member of any element of the pRanges array is not VK_REMAINING_ARRAY_LAYERS, it must be non-zero and VkImageSubresourceRange::baseArrayLayer + VkImageSubresourceRange::layerCount for that element of the pRanges array must be less than or equal to the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-layerCount-01473)"}, - {VALIDATION_ERROR_18800c12, "The spec valid usage text states 'image must not use a format listed in Formats requiring sampler Y'CBCR conversion for VK_IMAGE_ASPECT_COLOR_BIT image views' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearColorImage-image-01545)"}, + {VALIDATION_ERROR_18800c12, "The spec valid usage text states 'image must not use a format listed in features-formats-requiring-sampler-ycbcr-conversion' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearColorImage-image-01545)"}, {VALIDATION_ERROR_18800d38, "The spec valid usage text states 'For each VkImageSubresourceRange element of pRanges, if the levelCount member is not VK_REMAINING_MIP_LEVELS, then baseMipLevel + levelCount must be less than the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-pRanges-01692)"}, {VALIDATION_ERROR_18800d3a, "The spec valid usage text states 'For each VkImageSubresourceRange element of pRanges, if the layerCount member is not VK_REMAINING_ARRAY_LAYERS, then baseArrayLayer + layerCount must be less than the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-pRanges-01693)"}, + {VALIDATION_ERROR_18800e1a, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then image must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearColorImage-commandBuffer-01805)"}, + {VALIDATION_ERROR_18800e1c, "The spec valid usage text states 'If commandBuffer is a protected command buffer, then image must not be an unprotected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearColorImage-commandBuffer-01806)"}, {VALIDATION_ERROR_18802401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-commandBuffer-parameter)"}, {VALIDATION_ERROR_18802413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-commandBuffer-recording)"}, {VALIDATION_ERROR_18802415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-commandBuffer-cmdpool)"}, @@ -5570,20 +5785,19 @@ {VALIDATION_ERROR_18820601, "The spec valid usage text states 'pRanges must be a valid pointer to an array of rangeCount valid VkImageSubresourceRange structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-pRanges-parameter)"}, {VALIDATION_ERROR_1882a41b, "The spec valid usage text states 'rangeCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearColorImage-rangeCount-arraylength)"}, {VALIDATION_ERROR_18a00009, "The spec valid usage text states 'Both of commandBuffer, and image must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-commonparent)"}, - {VALIDATION_ERROR_18a00010, "The spec valid usage text states 'image must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-image-00008)"}, + {VALIDATION_ERROR_18a00010, "The spec valid usage text states 'image must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-image-00008)"}, {VALIDATION_ERROR_18a00012, "The spec valid usage text states 'image must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-image-00009)"}, {VALIDATION_ERROR_18a00014, "The spec valid usage text states 'If image is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-image-00010)"}, {VALIDATION_ERROR_18a00016, "The spec valid usage text states 'imageLayout must specify the layout of the image subresource ranges of image specified in pRanges at the time this command is executed on a VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-imageLayout-00011)"}, {VALIDATION_ERROR_18a00017, "The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-renderpass)"}, {VALIDATION_ERROR_18a00018, "The spec valid usage text states 'imageLayout must be either of VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-imageLayout-00012)"}, - {VALIDATION_ERROR_18a0001a, "The spec valid usage text states 'The image range of any given element of pRanges must be an image subresource range that is contained within image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-pRanges-00013)"}, {VALIDATION_ERROR_18a0001c, "The spec valid usage text states 'image must have a depth/stencil format' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-image-00014)"}, {VALIDATION_ERROR_18a00b84, "The spec valid usage text states 'The VkImageSubresourceRange::baseMipLevel members of the elements of the pRanges array must each be less than the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-baseMipLevel-01474)"}, - {VALIDATION_ERROR_18a00b86, "The spec valid usage text states 'If the VkImageSubresourceRange::levelCount member of any element of the pRanges array is not VK_REMAINING_MIP_LEVELS, it must be non-zero and VkImageSubresourceRange::baseMipLevel + VkImageSubresourceRange::levelCount for that element of the pRanges array must be less than or equal to the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-levelCount-01475)"}, {VALIDATION_ERROR_18a00b88, "The spec valid usage text states 'The VkImageSubresourceRange::baseArrayLayer members of the elements of the pRanges array must each be less than the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-baseArrayLayer-01476)"}, - {VALIDATION_ERROR_18a00b8a, "The spec valid usage text states 'If the VkImageSubresourceRange::layerCount member of any element of the pRanges array is not VK_REMAINING_ARRAY_LAYERS, it must be non-zero and VkImageSubresourceRange::baseArrayLayer + VkImageSubresourceRange::layerCount for that element of the pRanges array must be less than or equal to the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-layerCount-01477)"}, {VALIDATION_ERROR_18a00d3c, "The spec valid usage text states 'For each VkImageSubresourceRange element of pRanges, if the levelCount member is not VK_REMAINING_MIP_LEVELS, then baseMipLevel + levelCount must be less than the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-pRanges-01694)"}, {VALIDATION_ERROR_18a00d3e, "The spec valid usage text states 'For each VkImageSubresourceRange element of pRanges, if the layerCount member is not VK_REMAINING_ARRAY_LAYERS, then baseArrayLayer + layerCount must be less than the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-pRanges-01695)"}, + {VALIDATION_ERROR_18a00e1e, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then image must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-commandBuffer-01807)"}, + {VALIDATION_ERROR_18a00e20, "The spec valid usage text states 'If commandBuffer is a protected command buffer, then image must not be an unprotected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-commandBuffer-01808)"}, {VALIDATION_ERROR_18a02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-commandBuffer-parameter)"}, {VALIDATION_ERROR_18a02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-commandBuffer-recording)"}, {VALIDATION_ERROR_18a02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-commandBuffer-cmdpool)"}, @@ -5604,6 +5818,9 @@ {VALIDATION_ERROR_18c000ee, "The spec valid usage text states 'If srcBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBuffer-srcBuffer-00119)"}, {VALIDATION_ERROR_18c000f0, "The spec valid usage text states 'dstBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_DST_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBuffer-dstBuffer-00120)"}, {VALIDATION_ERROR_18c000f2, "The spec valid usage text states 'If dstBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBuffer-dstBuffer-00121)"}, + {VALIDATION_ERROR_18c00e3c, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then srcBuffer must not be a protected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBuffer-commandBuffer-01822)"}, + {VALIDATION_ERROR_18c00e3e, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstBuffer must not be a protected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBuffer-commandBuffer-01823)"}, + {VALIDATION_ERROR_18c00e40, "The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstBuffer must not be an unprotected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBuffer-commandBuffer-01824)"}, {VALIDATION_ERROR_18c02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBuffer-commandBuffer-parameter)"}, {VALIDATION_ERROR_18c02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBuffer-commandBuffer-recording)"}, {VALIDATION_ERROR_18c02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBuffer-commandBuffer-cmdpool)"}, @@ -5617,7 +5834,7 @@ {VALIDATION_ERROR_18e00158, "The spec valid usage text states 'The image region specified by each element of pRegions must be a region that is contained within dstImage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-pRegions-00172)"}, {VALIDATION_ERROR_18e0015a, "The spec valid usage text states 'The union of all source regions, and the union of all destination regions, specified by the elements of pRegions, must not overlap in memory' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-pRegions-00173)"}, {VALIDATION_ERROR_18e0015c, "The spec valid usage text states 'srcBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_SRC_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-srcBuffer-00174)"}, - {VALIDATION_ERROR_18e0015e, "The spec valid usage text states 'dstImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBufferToImage-dstImage-00175)"}, + {VALIDATION_ERROR_18e0015e, "The spec valid usage text states 'dstImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBufferToImage-dstImage-00175)"}, {VALIDATION_ERROR_18e00160, "The spec valid usage text states 'If srcBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-srcBuffer-00176)"}, {VALIDATION_ERROR_18e00162, "The spec valid usage text states 'dstImage must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-dstImage-00177)"}, {VALIDATION_ERROR_18e00164, "The spec valid usage text states 'If dstImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-dstImage-00178)"}, @@ -5627,6 +5844,10 @@ {VALIDATION_ERROR_18e00ae8, "The spec valid usage text states 'dstImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBufferToImage-dstImageLayout-01396)"}, {VALIDATION_ERROR_18e00d4a, "The spec valid usage text states 'The imageSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-imageSubresource-01701)"}, {VALIDATION_ERROR_18e00d4c, "The spec valid usage text states 'The imageSubresource.baseArrayLayer + imageSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-imageSubresource-01702)"}, + {VALIDATION_ERROR_18e00e02, "The spec valid usage text states 'The imageOffset and and imageExtent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer's command pool's queue family, as described in VkQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-imageOffset-01793)"}, + {VALIDATION_ERROR_18e00e48, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then srcBuffer must not be a protected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBufferToImage-commandBuffer-01828)"}, + {VALIDATION_ERROR_18e00e4a, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBufferToImage-commandBuffer-01829)"}, + {VALIDATION_ERROR_18e00e4c, "The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstImage must not be an unprotected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBufferToImage-commandBuffer-01830)"}, {VALIDATION_ERROR_18e02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-commandBuffer-parameter)"}, {VALIDATION_ERROR_18e02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-commandBuffer-recording)"}, {VALIDATION_ERROR_18e02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-commandBuffer-cmdpool)"}, @@ -5640,12 +5861,12 @@ {VALIDATION_ERROR_190000f4, "The spec valid usage text states 'The source region specified by each element of pRegions must be a region that is contained within srcImage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-pRegions-00122)"}, {VALIDATION_ERROR_190000f6, "The spec valid usage text states 'The destination region specified by each element of pRegions must be a region that is contained within dstImage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-pRegions-00123)"}, {VALIDATION_ERROR_190000f8, "The spec valid usage text states 'The union of all source regions, and the union of all destination regions, specified by the elements of pRegions, must not overlap in memory' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-pRegions-00124)"}, - {VALIDATION_ERROR_190000fa, "The spec valid usage text states 'srcImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-srcImage-00125)"}, + {VALIDATION_ERROR_190000fa, "The spec valid usage text states 'srcImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-srcImage-00125)"}, {VALIDATION_ERROR_190000fc, "The spec valid usage text states 'srcImage must have been created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcImage-00126)"}, {VALIDATION_ERROR_190000fe, "The spec valid usage text states 'If srcImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcImage-00127)"}, {VALIDATION_ERROR_19000100, "The spec valid usage text states 'srcImageLayout must specify the layout of the image subresources of srcImage specified in pRegions at the time this command is executed on a VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcImageLayout-00128)"}, - {VALIDATION_ERROR_19000102, "The spec valid usage text states 'srcImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-srcImageLayout-00129)"}, - {VALIDATION_ERROR_19000104, "The spec valid usage text states 'dstImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-dstImage-00130)"}, + {VALIDATION_ERROR_19000102, "The spec valid usage text states 'srcImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcImageLayout-00129)"}, + {VALIDATION_ERROR_19000104, "The spec valid usage text states 'dstImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-dstImage-00130)"}, {VALIDATION_ERROR_19000106, "The spec valid usage text states 'dstImage must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstImage-00131)"}, {VALIDATION_ERROR_19000108, "The spec valid usage text states 'If dstImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstImage-00132)"}, {VALIDATION_ERROR_1900010a, "The spec valid usage text states 'dstImageLayout must specify the layout of the image subresources of dstImage specified in pRegions at the time this command is executed on a VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstImageLayout-00133)"}, @@ -5657,11 +5878,17 @@ {VALIDATION_ERROR_19000c16, "The spec valid usage text states 'If dstImage is non-sparse then the image or disjoint plane that is the destination of the copy must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-dstImage-01547)"}, {VALIDATION_ERROR_19000c18, "The spec valid usage text states 'If the VkFormat of each of srcImage and dstImage is not a multi-planar format, the VkFormat of each of srcImage and dstImage must be compatible, as defined below' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-srcImage-01548)"}, {VALIDATION_ERROR_19000c1a, "The spec valid usage text states 'In a copy to or from a plane of a multi-planar image, the VkFormat of the image and plane must be compatible according to the description of compatible planes for the plane being copied' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-None-01549)"}, - {VALIDATION_ERROR_19000c1c, "The spec valid usage text states 'When a copy is performed to or from an image with a multi-planar format, the aspectMask of the srcSubresource and/or dstSubresource that refers to the multi-planar image must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR, or VK_IMAGE_ASPECT_PLANE_2_BIT_KHR (with VK_IMAGE_ASPECT_PLANE_2_BIT_KHR valid only for a VkFormat with three planes)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-aspectMask-01550)"}, + {VALIDATION_ERROR_19000c1c, "The spec valid usage text states 'When a copy is performed to or from an image with a multi-planar format, the aspectMask of the srcSubresource and/or dstSubresource that refers to the multi-planar image must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT (with VK_IMAGE_ASPECT_PLANE_2_BIT valid only for a VkFormat with three planes)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-aspectMask-01550)"}, {VALIDATION_ERROR_19000d40, "The spec valid usage text states 'The srcSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcSubresource-01696)"}, {VALIDATION_ERROR_19000d42, "The spec valid usage text states 'The dstSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstSubresource-01697)"}, {VALIDATION_ERROR_19000d44, "The spec valid usage text states 'The srcSubresource.baseArrayLayer + srcSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcSubresource-01698)"}, {VALIDATION_ERROR_19000d46, "The spec valid usage text states 'The dstSubresource.baseArrayLayer + dstSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstSubresource-01699)"}, + {VALIDATION_ERROR_19000dee, "The spec valid usage text states 'The srcOffset and and extent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer's command pool's queue family, as described in VkQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcOffset-01783)"}, + {VALIDATION_ERROR_19000df0, "The spec valid usage text states 'The dstOffset and and extent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer's command pool's queue family, as described in VkQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstOffset-01784)"}, + {VALIDATION_ERROR_19000e42, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then srcImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-commandBuffer-01825)"}, + {VALIDATION_ERROR_19000e44, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-commandBuffer-01826)"}, + {VALIDATION_ERROR_19000e46, "The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstImage must not be an unprotected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-commandBuffer-01827)"}, + {VALIDATION_ERROR_19000efa, "The spec valid usage text states 'srcImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-srcImageLayout-01917)"}, {VALIDATION_ERROR_19002401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-commandBuffer-parameter)"}, {VALIDATION_ERROR_19002413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-commandBuffer-recording)"}, {VALIDATION_ERROR_19002415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-commandBuffer-cmdpool)"}, @@ -5676,7 +5903,7 @@ {VALIDATION_ERROR_1920016c, "The spec valid usage text states 'The image region specified by each element of pRegions must be a region that is contained within srcImage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-pRegions-00182)"}, {VALIDATION_ERROR_1920016e, "The spec valid usage text states 'The buffer region specified by each element of pRegions must be a region that is contained within dstBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-pRegions-00183)"}, {VALIDATION_ERROR_19200170, "The spec valid usage text states 'The union of all source regions, and the union of all destination regions, specified by the elements of pRegions, must not overlap in memory' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-pRegions-00184)"}, - {VALIDATION_ERROR_19200172, "The spec valid usage text states 'srcImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-srcImage-00185)"}, + {VALIDATION_ERROR_19200172, "The spec valid usage text states 'srcImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-srcImage-00185)"}, {VALIDATION_ERROR_19200174, "The spec valid usage text states 'srcImage must have been created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-srcImage-00186)"}, {VALIDATION_ERROR_19200176, "The spec valid usage text states 'If srcImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-srcImage-00187)"}, {VALIDATION_ERROR_19200178, "The spec valid usage text states 'srcImage must have a sample count equal to VK_SAMPLE_COUNT_1_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-srcImage-00188)"}, @@ -5687,6 +5914,10 @@ {VALIDATION_ERROR_19200aea, "The spec valid usage text states 'srcImageLayout must be VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-srcImageLayout-01397)"}, {VALIDATION_ERROR_19200d4e, "The spec valid usage text states 'The imageSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-imageSubresource-01703)"}, {VALIDATION_ERROR_19200d50, "The spec valid usage text states 'The imageSubresource.baseArrayLayer + imageSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-imageSubresource-01704)"}, + {VALIDATION_ERROR_19200e04, "The spec valid usage text states 'The imageOffset and and imageExtent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer's command pool's queue family, as described in VkQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-imageOffset-01794)"}, + {VALIDATION_ERROR_19200e4e, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then srcImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-commandBuffer-01831)"}, + {VALIDATION_ERROR_19200e50, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstBuffer must not be a protected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-commandBuffer-01832)"}, + {VALIDATION_ERROR_19200e52, "The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstBuffer must not be an unprotected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-commandBuffer-01833)"}, {VALIDATION_ERROR_19202401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-commandBuffer-parameter)"}, {VALIDATION_ERROR_19202413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-commandBuffer-recording)"}, {VALIDATION_ERROR_19202415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-commandBuffer-cmdpool)"}, @@ -5712,120 +5943,132 @@ {VALIDATION_ERROR_19406c01, "The spec valid usage text states 'dstBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyQueryPoolResults-dstBuffer-parameter)"}, {VALIDATION_ERROR_19409001, "The spec valid usage text states 'flags must be a valid combination of VkQueryResultFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyQueryPoolResults-flags-parameter)"}, {VALIDATION_ERROR_19429801, "The spec valid usage text states 'queryPool must be a valid VkQueryPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyQueryPoolResults-queryPool-parameter)"}, - {VALIDATION_ERROR_19602401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-parameter)"}, - {VALIDATION_ERROR_19602413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-recording)"}, - {VALIDATION_ERROR_19602415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_1961a601, "The spec valid usage text states 'pMarkerInfo must be a valid pointer to a valid VkDebugMarkerMarkerInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerBeginEXT-pMarkerInfo-parameter)"}, - {VALIDATION_ERROR_198009ae, "The spec valid usage text states 'There must be an outstanding vkCmdDebugMarkerBeginEXT command prior to the vkCmdDebugMarkerEndEXT on the queue that commandBuffer is submitted to' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-01239)"}, - {VALIDATION_ERROR_198009b0, "The spec valid usage text states 'If commandBuffer is a secondary command buffer, there must be an outstanding vkCmdDebugMarkerBeginEXT command recorded to commandBuffer that has not previously been ended by a call to vkCmdDebugMarkerEndEXT.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-01240)"}, - {VALIDATION_ERROR_19802401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-parameter)"}, - {VALIDATION_ERROR_19802413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-recording)"}, - {VALIDATION_ERROR_19802415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_19a02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-parameter)"}, - {VALIDATION_ERROR_19a02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-recording)"}, - {VALIDATION_ERROR_19a02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_19a1a601, "The spec valid usage text states 'pMarkerInfo must be a valid pointer to a valid VkDebugMarkerMarkerInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDebugMarkerInsertEXT-pMarkerInfo-parameter)"}, + {VALIDATION_ERROR_19602401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-parameter)"}, + {VALIDATION_ERROR_19602413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-recording)"}, + {VALIDATION_ERROR_19602415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-cmdpool)"}, + {VALIDATION_ERROR_1961a601, "The spec valid usage text states 'pMarkerInfo must be a valid pointer to a valid VkDebugMarkerMarkerInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerBeginEXT-pMarkerInfo-parameter)"}, + {VALIDATION_ERROR_198009ae, "The spec valid usage text states 'There must be an outstanding vkCmdDebugMarkerBeginEXT command prior to the vkCmdDebugMarkerEndEXT on the queue that commandBuffer is submitted to' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-01239)"}, + {VALIDATION_ERROR_198009b0, "The spec valid usage text states 'If commandBuffer is a secondary command buffer, there must be an outstanding vkCmdDebugMarkerBeginEXT command recorded to commandBuffer that has not previously been ended by a call to vkCmdDebugMarkerEndEXT.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-01240)"}, + {VALIDATION_ERROR_19802401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-parameter)"}, + {VALIDATION_ERROR_19802413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-recording)"}, + {VALIDATION_ERROR_19802415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerEndEXT-commandBuffer-cmdpool)"}, + {VALIDATION_ERROR_19a02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-parameter)"}, + {VALIDATION_ERROR_19a02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-recording)"}, + {VALIDATION_ERROR_19a02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-cmdpool)"}, + {VALIDATION_ERROR_19a1a601, "The spec valid usage text states 'pMarkerInfo must be a valid pointer to a valid VkDebugMarkerMarkerInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDebugMarkerInsertEXT-pMarkerInfo-parameter)"}, {VALIDATION_ERROR_19c00017, "The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-renderpass)"}, {VALIDATION_ERROR_19c00304, "The spec valid usage text states 'groupCountX must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[0]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-groupCountX-00386)"}, {VALIDATION_ERROR_19c00306, "The spec valid usage text states 'groupCountY must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[1]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-groupCountY-00387)"}, {VALIDATION_ERROR_19c00308, "The spec valid usage text states 'groupCountZ must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[2]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-groupCountZ-00388)"}, - {VALIDATION_ERROR_19c0030a, "The spec valid usage text states 'For each set n that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00389)"}, - {VALIDATION_ERROR_19c0030c, "The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the currently bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00390)"}, + {VALIDATION_ERROR_19c0030a, "The spec valid usage text states 'For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00389)"}, + {VALIDATION_ERROR_19c0030c, "The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00390)"}, {VALIDATION_ERROR_19c0030e, "The spec valid usage text states 'A valid compute pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_COMPUTE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00391)"}, - {VALIDATION_ERROR_19c00310, "The spec valid usage text states 'For each push constant that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE, a push constant value must have been set for VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for push constants with the one used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00392)"}, - {VALIDATION_ERROR_19c00312, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00393)"}, - {VALIDATION_ERROR_19c00314, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00394)"}, - {VALIDATION_ERROR_19c00316, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00395)"}, - {VALIDATION_ERROR_19c00318, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00396)"}, - {VALIDATION_ERROR_19c0031a, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00397)"}, + {VALIDATION_ERROR_19c00310, "The spec valid usage text states 'For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE, a push constant value must have been set for VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for push constants with the one used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00392)"}, + {VALIDATION_ERROR_19c00312, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00393)"}, + {VALIDATION_ERROR_19c00314, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00394)"}, + {VALIDATION_ERROR_19c00316, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00395)"}, + {VALIDATION_ERROR_19c00318, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00396)"}, + {VALIDATION_ERROR_19c0031a, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-None-00397)"}, {VALIDATION_ERROR_19c0031c, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-linearTilingFeatures-00398)"}, {VALIDATION_ERROR_19c0031e, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatch-linearTilingFeatures-00399)"}, {VALIDATION_ERROR_19c00320, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must not have a VkImageViewType of VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatch-None-00400)"}, + {VALIDATION_ERROR_19c00e68, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_COMPUTE reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatch-commandBuffer-01844)"}, + {VALIDATION_ERROR_19c00e6a, "The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_POINT_COMPUTE writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatch-commandBuffer-01845)"}, + {VALIDATION_ERROR_19c00e6c, "The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage other than the compute pipeline stage in the VkPipeline object bound to VK_PIPELINE_POINT_COMPUTE reads from any image or buffer, the image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatch-commandBuffer-01846)"}, {VALIDATION_ERROR_19c02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-commandBuffer-parameter)"}, {VALIDATION_ERROR_19c02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-commandBuffer-recording)"}, {VALIDATION_ERROR_19c02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatch-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_19e00017, "The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-renderpass)"}, - {VALIDATION_ERROR_19e00348, "The spec valid usage text states 'All valid usage rules from vkCmdDispatch apply' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-None-00420)"}, - {VALIDATION_ERROR_19e0034a, "The spec valid usage text states 'baseGroupX must be less than VkPhysicalDeviceLimits::maxComputeWorkGroupCount[0]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-baseGroupX-00421)"}, - {VALIDATION_ERROR_19e0034c, "The spec valid usage text states 'baseGroupX must be less than VkPhysicaYDeviceLimits::maxComputeWorkGroupCount[1]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-baseGroupX-00422)"}, - {VALIDATION_ERROR_19e0034e, "The spec valid usage text states 'baseGroupZ must be less than VkPhysicalDeviceLimits::maxComputeWorkGroupCount[2]' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-baseGroupZ-00423)"}, - {VALIDATION_ERROR_19e00350, "The spec valid usage text states 'groupCountX must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[0] minus baseGroupX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-groupCountX-00424)"}, - {VALIDATION_ERROR_19e00352, "The spec valid usage text states 'groupCountY must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[1] minus baseGroupY' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-groupCountY-00425)"}, - {VALIDATION_ERROR_19e00354, "The spec valid usage text states 'groupCountZ must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[2] minus baseGroupZ' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-groupCountZ-00426)"}, - {VALIDATION_ERROR_19e00356, "The spec valid usage text states 'If any of baseGroupX, baseGroupY, or baseGroupZ are not zero, then the currently bound compute pipeline must have been created with the VK_PIPELINE_CREATE_DISPATCH_BASE_KHX flag.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-baseGroupX-00427)"}, - {VALIDATION_ERROR_19e02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-commandBuffer-parameter)"}, - {VALIDATION_ERROR_19e02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-commandBuffer-recording)"}, - {VALIDATION_ERROR_19e02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchBaseKHX-commandBuffer-cmdpool)"}, + {VALIDATION_ERROR_19e00017, "The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-renderpass)"}, + {VALIDATION_ERROR_19e00348, "The spec valid usage text states 'All valid usage rules from vkCmdDispatch apply' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-None-00420)"}, + {VALIDATION_ERROR_19e0034a, "The spec valid usage text states 'baseGroupX must be less than VkPhysicalDeviceLimits::maxComputeWorkGroupCount[0]' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-baseGroupX-00421)"}, + {VALIDATION_ERROR_19e0034c, "The spec valid usage text states 'baseGroupX must be less than VkPhysicalDeviceLimits::maxComputeWorkGroupCount[1]' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-baseGroupX-00422)"}, + {VALIDATION_ERROR_19e0034e, "The spec valid usage text states 'baseGroupZ must be less than VkPhysicalDeviceLimits::maxComputeWorkGroupCount[2]' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-baseGroupZ-00423)"}, + {VALIDATION_ERROR_19e00350, "The spec valid usage text states 'groupCountX must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[0] minus baseGroupX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-groupCountX-00424)"}, + {VALIDATION_ERROR_19e00352, "The spec valid usage text states 'groupCountY must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[1] minus baseGroupY' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-groupCountY-00425)"}, + {VALIDATION_ERROR_19e00354, "The spec valid usage text states 'groupCountZ must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[2] minus baseGroupZ' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-groupCountZ-00426)"}, + {VALIDATION_ERROR_19e00356, "The spec valid usage text states 'If any of baseGroupX, baseGroupY, or baseGroupZ are not zero, then the bound compute pipeline must have been created with the VK_PIPELINE_CREATE_DISPATCH_BASE flag.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-baseGroupX-00427)"}, + {VALIDATION_ERROR_19e02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-commandBuffer-parameter)"}, + {VALIDATION_ERROR_19e02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-commandBuffer-recording)"}, + {VALIDATION_ERROR_19e02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchBase-commandBuffer-cmdpool)"}, {VALIDATION_ERROR_1a000009, "The spec valid usage text states 'Both of buffer, and commandBuffer must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-commonparent)"}, {VALIDATION_ERROR_1a000017, "The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-renderpass)"}, {VALIDATION_ERROR_1a000322, "The spec valid usage text states 'If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-buffer-00401)"}, - {VALIDATION_ERROR_1a000324, "The spec valid usage text states 'For each set n that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00402)"}, - {VALIDATION_ERROR_1a000326, "The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the currently bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00403)"}, + {VALIDATION_ERROR_1a000324, "The spec valid usage text states 'For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00402)"}, + {VALIDATION_ERROR_1a000326, "The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00403)"}, {VALIDATION_ERROR_1a000328, "The spec valid usage text states 'A valid compute pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_COMPUTE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00404)"}, {VALIDATION_ERROR_1a00032a, "The spec valid usage text states 'buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-buffer-00405)"}, {VALIDATION_ERROR_1a00032c, "The spec valid usage text states 'offset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-offset-00406)"}, {VALIDATION_ERROR_1a00032e, "The spec valid usage text states 'The sum of offset and the size of VkDispatchIndirectCommand must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-offset-00407)"}, - {VALIDATION_ERROR_1a000330, "The spec valid usage text states 'For each push constant that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE, a push constant value must have been set for VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for push constants with the one used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00408)"}, - {VALIDATION_ERROR_1a000332, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00409)"}, - {VALIDATION_ERROR_1a000334, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00410)"}, - {VALIDATION_ERROR_1a000336, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00411)"}, - {VALIDATION_ERROR_1a000338, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00412)"}, - {VALIDATION_ERROR_1a00033a, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00413)"}, + {VALIDATION_ERROR_1a000330, "The spec valid usage text states 'For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE, a push constant value must have been set for VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for push constants with the one used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00408)"}, + {VALIDATION_ERROR_1a000332, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00409)"}, + {VALIDATION_ERROR_1a000334, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00410)"}, + {VALIDATION_ERROR_1a000336, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00411)"}, + {VALIDATION_ERROR_1a000338, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00412)"}, + {VALIDATION_ERROR_1a00033a, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00413)"}, {VALIDATION_ERROR_1a00033c, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-linearTilingFeatures-00414)"}, {VALIDATION_ERROR_1a00033e, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchIndirect-linearTilingFeatures-00415)"}, {VALIDATION_ERROR_1a000340, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must not have a VkImageViewType of VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchIndirect-None-00416)"}, + {VALIDATION_ERROR_1a000e6e, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_COMPUTE reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchIndirect-commandBuffer-01847)"}, + {VALIDATION_ERROR_1a000e70, "The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_POINT_COMPUTE writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchIndirect-commandBuffer-01848)"}, + {VALIDATION_ERROR_1a000e72, "The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage other than the compute pipeline stage in the VkPipeline object bound to VK_PIPELINE_POINT_COMPUTE reads from any image or buffer, the image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDispatchIndirect-commandBuffer-01849)"}, {VALIDATION_ERROR_1a001a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-buffer-parameter)"}, {VALIDATION_ERROR_1a002401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-commandBuffer-parameter)"}, {VALIDATION_ERROR_1a002413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-commandBuffer-recording)"}, {VALIDATION_ERROR_1a002415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDispatchIndirect-commandBuffer-cmdpool)"}, {VALIDATION_ERROR_1a200017, "The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-renderpass)"}, - {VALIDATION_ERROR_1a200366, "The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-renderPass-00435)"}, - {VALIDATION_ERROR_1a200368, "The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-subpass-00436)"}, - {VALIDATION_ERROR_1a20036a, "The spec valid usage text states 'For each set n that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00437)"}, - {VALIDATION_ERROR_1a20036c, "The spec valid usage text states 'For each push constant that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00438)"}, - {VALIDATION_ERROR_1a20036e, "The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the currently bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00439)"}, + {VALIDATION_ERROR_1a200366, "The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-renderPass-00435)"}, + {VALIDATION_ERROR_1a200368, "The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-subpass-00436)"}, + {VALIDATION_ERROR_1a20036a, "The spec valid usage text states 'For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00437)"}, + {VALIDATION_ERROR_1a20036c, "The spec valid usage text states 'For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00438)"}, + {VALIDATION_ERROR_1a20036e, "The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00439)"}, {VALIDATION_ERROR_1a200370, "The spec valid usage text states 'All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must have valid buffers bound' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00440)"}, - {VALIDATION_ERROR_1a200372, "The spec valid usage text states 'For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00441)"}, + {VALIDATION_ERROR_1a200372, "The spec valid usage text states 'For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in fxvertex-input' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00441)"}, {VALIDATION_ERROR_1a200374, "The spec valid usage text states 'A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00442)"}, - {VALIDATION_ERROR_1a200376, "The spec valid usage text states 'If the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00443)"}, + {VALIDATION_ERROR_1a200376, "The spec valid usage text states 'If the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00443)"}, {VALIDATION_ERROR_1a200378, "The spec valid usage text states 'Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00444)"}, - {VALIDATION_ERROR_1a20037a, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00445)"}, - {VALIDATION_ERROR_1a20037c, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00446)"}, - {VALIDATION_ERROR_1a20037e, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00447)"}, - {VALIDATION_ERROR_1a200380, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00448)"}, - {VALIDATION_ERROR_1a200382, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00449)"}, + {VALIDATION_ERROR_1a20037a, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00445)"}, + {VALIDATION_ERROR_1a20037c, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00446)"}, + {VALIDATION_ERROR_1a20037e, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00447)"}, + {VALIDATION_ERROR_1a200380, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00448)"}, + {VALIDATION_ERROR_1a200382, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-00449)"}, {VALIDATION_ERROR_1a200384, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-linearTilingFeatures-00450)"}, {VALIDATION_ERROR_1a200386, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDraw-linearTilingFeatures-00451)"}, {VALIDATION_ERROR_1a200388, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must not have a VkImageViewType of VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDraw-None-00452)"}, - {VALIDATION_ERROR_1a20038a, "The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewPropertiesKHX::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDraw-maxMultiviewInstanceIndex-00453)"}, + {VALIDATION_ERROR_1a20038a, "The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDraw-maxMultiviewInstanceIndex-00453)"}, {VALIDATION_ERROR_1a200bb6, "The spec valid usage text states 'Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-None-01499)"}, - {VALIDATION_ERROR_1a200bd0, "The spec valid usage text states 'If the currently bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDraw-sampleLocationsEnable-01512)"}, + {VALIDATION_ERROR_1a200bd0, "The spec valid usage text states 'If the bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDraw-sampleLocationsEnable-01512)"}, + {VALIDATION_ERROR_1a200e74, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDraw-commandBuffer-01850)"}, + {VALIDATION_ERROR_1a200e76, "The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDraw-commandBuffer-01851)"}, + {VALIDATION_ERROR_1a200e78, "The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDraw-commandBuffer-01852)"}, {VALIDATION_ERROR_1a202401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-commandBuffer-parameter)"}, {VALIDATION_ERROR_1a202413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-commandBuffer-recording)"}, {VALIDATION_ERROR_1a202415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-commandBuffer-cmdpool)"}, {VALIDATION_ERROR_1a400017, "The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-renderpass)"}, - {VALIDATION_ERROR_1a40038c, "The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-renderPass-00454)"}, - {VALIDATION_ERROR_1a40038e, "The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-subpass-00455)"}, - {VALIDATION_ERROR_1a400390, "The spec valid usage text states 'For each set n that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00456)"}, - {VALIDATION_ERROR_1a400392, "The spec valid usage text states 'For each push constant that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00457)"}, - {VALIDATION_ERROR_1a400394, "The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the currently bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00458)"}, + {VALIDATION_ERROR_1a40038c, "The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-renderPass-00454)"}, + {VALIDATION_ERROR_1a40038e, "The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-subpass-00455)"}, + {VALIDATION_ERROR_1a400390, "The spec valid usage text states 'For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00456)"}, + {VALIDATION_ERROR_1a400392, "The spec valid usage text states 'For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00457)"}, + {VALIDATION_ERROR_1a400394, "The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00458)"}, {VALIDATION_ERROR_1a400396, "The spec valid usage text states 'All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must have valid buffers bound' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00459)"}, - {VALIDATION_ERROR_1a400398, "The spec valid usage text states 'For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00460)"}, + {VALIDATION_ERROR_1a400398, "The spec valid usage text states 'For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in fxvertex-input' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00460)"}, {VALIDATION_ERROR_1a40039a, "The spec valid usage text states 'A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00461)"}, - {VALIDATION_ERROR_1a40039c, "The spec valid usage text states 'If the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00462)"}, - {VALIDATION_ERROR_1a40039e, "The spec valid usage text states '(indexSize * (firstIndex + indexCount) + offset) must be less than or equal to the size of the currently bound index buffer, with indexSize being based on the type specified by indexType, where the index buffer, indexType, and offset are specified via vkCmdBindIndexBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-indexSize-00463)"}, + {VALIDATION_ERROR_1a40039c, "The spec valid usage text states 'If the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00462)"}, + {VALIDATION_ERROR_1a40039e, "The spec valid usage text states '(indexSize * (firstIndex + indexCount) + offset) must be less than or equal to the size of the bound index buffer, with indexSize being based on the type specified by indexType, where the index buffer, indexType, and offset are specified via vkCmdBindIndexBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-indexSize-00463)"}, {VALIDATION_ERROR_1a4003a0, "The spec valid usage text states 'Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00464)"}, - {VALIDATION_ERROR_1a4003a2, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00465)"}, - {VALIDATION_ERROR_1a4003a4, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00466)"}, - {VALIDATION_ERROR_1a4003a6, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00467)"}, - {VALIDATION_ERROR_1a4003a8, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00468)"}, - {VALIDATION_ERROR_1a4003aa, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00469)"}, + {VALIDATION_ERROR_1a4003a2, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00465)"}, + {VALIDATION_ERROR_1a4003a4, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00466)"}, + {VALIDATION_ERROR_1a4003a6, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00467)"}, + {VALIDATION_ERROR_1a4003a8, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00468)"}, + {VALIDATION_ERROR_1a4003aa, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00469)"}, {VALIDATION_ERROR_1a4003ac, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-linearTilingFeatures-00470)"}, {VALIDATION_ERROR_1a4003ae, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-linearTilingFeatures-00471)"}, {VALIDATION_ERROR_1a4003b0, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must not have a VkImageViewType of VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-None-00472)"}, - {VALIDATION_ERROR_1a4003b2, "The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewPropertiesKHX::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-maxMultiviewInstanceIndex-00473)"}, + {VALIDATION_ERROR_1a4003b2, "The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-maxMultiviewInstanceIndex-00473)"}, {VALIDATION_ERROR_1a400bb8, "The spec valid usage text states 'Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-None-01500)"}, - {VALIDATION_ERROR_1a400bd2, "The spec valid usage text states 'If the currently bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-sampleLocationsEnable-01513)"}, + {VALIDATION_ERROR_1a400bd2, "The spec valid usage text states 'If the bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-sampleLocationsEnable-01513)"}, + {VALIDATION_ERROR_1a400e7a, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-commandBuffer-01853)"}, + {VALIDATION_ERROR_1a400e7c, "The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-commandBuffer-01854)"}, + {VALIDATION_ERROR_1a400e7e, "The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-commandBuffer-01855)"}, {VALIDATION_ERROR_1a402401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-commandBuffer-parameter)"}, {VALIDATION_ERROR_1a402413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-commandBuffer-recording)"}, {VALIDATION_ERROR_1a402415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexed-commandBuffer-cmdpool)"}, @@ -5836,71 +6079,77 @@ {VALIDATION_ERROR_1a600420, "The spec valid usage text states 'If drawCount is greater than 1, stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawIndexedIndirectCommand)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-drawCount-00528)"}, {VALIDATION_ERROR_1a600422, "The spec valid usage text states 'If the multi-draw indirect feature is not enabled, drawCount must be 0 or 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-drawCount-00529)"}, {VALIDATION_ERROR_1a600424, "The spec valid usage text states 'If the drawIndirectFirstInstance feature is not enabled, all the firstInstance members of the VkDrawIndexedIndirectCommand structures accessed by this command must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-firstInstance-00530)"}, - {VALIDATION_ERROR_1a600426, "The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-renderPass-00531)"}, - {VALIDATION_ERROR_1a600428, "The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-subpass-00532)"}, - {VALIDATION_ERROR_1a60042a, "The spec valid usage text states 'For each set n that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00533)"}, - {VALIDATION_ERROR_1a60042c, "The spec valid usage text states 'For each push constant that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00534)"}, - {VALIDATION_ERROR_1a60042e, "The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the currently bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00535)"}, + {VALIDATION_ERROR_1a600426, "The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-renderPass-00531)"}, + {VALIDATION_ERROR_1a600428, "The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-subpass-00532)"}, + {VALIDATION_ERROR_1a60042a, "The spec valid usage text states 'For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00533)"}, + {VALIDATION_ERROR_1a60042c, "The spec valid usage text states 'For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00534)"}, + {VALIDATION_ERROR_1a60042e, "The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00535)"}, {VALIDATION_ERROR_1a600430, "The spec valid usage text states 'All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must have valid buffers bound' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00536)"}, {VALIDATION_ERROR_1a600432, "The spec valid usage text states 'A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00537)"}, - {VALIDATION_ERROR_1a600434, "The spec valid usage text states 'If the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00538)"}, + {VALIDATION_ERROR_1a600434, "The spec valid usage text states 'If the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00538)"}, {VALIDATION_ERROR_1a600436, "The spec valid usage text states 'If drawCount is equal to 1, (offset + sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-drawCount-00539)"}, {VALIDATION_ERROR_1a600438, "The spec valid usage text states 'If drawCount is greater than 1, (stride {times} (drawCount - 1) + offset + sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-drawCount-00540)"}, {VALIDATION_ERROR_1a60043a, "The spec valid usage text states 'drawCount must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-drawCount-00541)"}, {VALIDATION_ERROR_1a60043c, "The spec valid usage text states 'Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00542)"}, - {VALIDATION_ERROR_1a60043e, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00543)"}, - {VALIDATION_ERROR_1a600440, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00544)"}, - {VALIDATION_ERROR_1a600442, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00545)"}, - {VALIDATION_ERROR_1a600444, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00546)"}, - {VALIDATION_ERROR_1a600446, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00547)"}, + {VALIDATION_ERROR_1a60043e, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00543)"}, + {VALIDATION_ERROR_1a600440, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00544)"}, + {VALIDATION_ERROR_1a600442, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00545)"}, + {VALIDATION_ERROR_1a600444, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00546)"}, + {VALIDATION_ERROR_1a600446, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00547)"}, {VALIDATION_ERROR_1a600448, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-linearTilingFeatures-00548)"}, {VALIDATION_ERROR_1a60044a, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-linearTilingFeatures-00549)"}, {VALIDATION_ERROR_1a60044c, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must not have a VkImageViewType of VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-00550)"}, - {VALIDATION_ERROR_1a60044e, "The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewPropertiesKHX::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-maxMultiviewInstanceIndex-00551)"}, + {VALIDATION_ERROR_1a60044e, "The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-maxMultiviewInstanceIndex-00551)"}, {VALIDATION_ERROR_1a600bbe, "The spec valid usage text states 'Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-None-01503)"}, - {VALIDATION_ERROR_1a600bd8, "The spec valid usage text states 'If the currently bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-sampleLocationsEnable-01516)"}, + {VALIDATION_ERROR_1a600bd8, "The spec valid usage text states 'If the bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-sampleLocationsEnable-01516)"}, {VALIDATION_ERROR_1a600d02, "The spec valid usage text states 'buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-buffer-01665)"}, + {VALIDATION_ERROR_1a600e8c, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-commandBuffer-01862)"}, + {VALIDATION_ERROR_1a600e8e, "The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-commandBuffer-01863)"}, + {VALIDATION_ERROR_1a600e90, "The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-commandBuffer-01864)"}, {VALIDATION_ERROR_1a601a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-buffer-parameter)"}, {VALIDATION_ERROR_1a602401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-commandBuffer-parameter)"}, {VALIDATION_ERROR_1a602413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-commandBuffer-recording)"}, {VALIDATION_ERROR_1a602415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirect-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_1a800009, "The spec valid usage text states 'Each of buffer, commandBuffer, and countBuffer must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commonparent)"}, - {VALIDATION_ERROR_1a800017, "The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-renderpass)"}, - {VALIDATION_ERROR_1a800456, "The spec valid usage text states 'offset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-offset-00555)"}, - {VALIDATION_ERROR_1a800458, "The spec valid usage text states 'countBufferOffset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBufferOffset-00556)"}, - {VALIDATION_ERROR_1a80045a, "The spec valid usage text states 'stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawIndirectCommand)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-stride-00557)"}, - {VALIDATION_ERROR_1a80045c, "The spec valid usage text states 'If maxDrawCount is greater than or equal to 1, (stride {times} (maxDrawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-maxDrawCount-00558)"}, - {VALIDATION_ERROR_1a80045e, "The spec valid usage text states 'If the drawIndirectFirstInstance feature is not enabled, all the firstInstance members of the VkDrawIndexedIndirectCommand structures accessed by this command must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-firstInstance-00559)"}, - {VALIDATION_ERROR_1a800460, "The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-renderPass-00560)"}, - {VALIDATION_ERROR_1a800462, "The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-subpass-00561)"}, - {VALIDATION_ERROR_1a800464, "The spec valid usage text states 'For each set n that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00562)"}, - {VALIDATION_ERROR_1a800466, "The spec valid usage text states 'For each push constant that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00563)"}, - {VALIDATION_ERROR_1a800468, "The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the currently bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00564)"}, - {VALIDATION_ERROR_1a80046a, "The spec valid usage text states 'All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must have valid buffers bound' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00565)"}, - {VALIDATION_ERROR_1a80046c, "The spec valid usage text states 'A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00566)"}, - {VALIDATION_ERROR_1a80046e, "The spec valid usage text states 'If the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00567)"}, - {VALIDATION_ERROR_1a800470, "The spec valid usage text states 'If count stored in countBuffer is equal to 1, (offset + sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-00568)"}, - {VALIDATION_ERROR_1a800472, "The spec valid usage text states 'If count stored in countBuffer is greater than 1, (stride {times} (drawCount - 1) + offset + sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-00569)"}, - {VALIDATION_ERROR_1a800474, "The spec valid usage text states 'drawCount must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-drawCount-00570)"}, - {VALIDATION_ERROR_1a800476, "The spec valid usage text states 'Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00571)"}, - {VALIDATION_ERROR_1a800478, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00572)"}, - {VALIDATION_ERROR_1a80047a, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00573)"}, - {VALIDATION_ERROR_1a80047c, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00574)"}, - {VALIDATION_ERROR_1a80047e, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00575)"}, - {VALIDATION_ERROR_1a800480, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00576)"}, - {VALIDATION_ERROR_1a800482, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-linearTilingFeatures-00577)"}, - {VALIDATION_ERROR_1a800484, "The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewPropertiesKHX::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-maxMultiviewInstanceIndex-00578)"}, - {VALIDATION_ERROR_1a800bc0, "The spec valid usage text states 'Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-01504)"}, - {VALIDATION_ERROR_1a800bda, "The spec valid usage text states 'If the currently bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-sampleLocationsEnable-01517)"}, - {VALIDATION_ERROR_1a800d04, "The spec valid usage text states 'If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-01666)"}, - {VALIDATION_ERROR_1a800d06, "The spec valid usage text states 'buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-01667)"}, - {VALIDATION_ERROR_1a800d08, "The spec valid usage text states 'If countBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-01668)"}, - {VALIDATION_ERROR_1a800d0a, "The spec valid usage text states 'countBuffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-01669)"}, - {VALIDATION_ERROR_1a801a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-parameter)"}, - {VALIDATION_ERROR_1a802401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-parameter)"}, - {VALIDATION_ERROR_1a802413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-recording)"}, - {VALIDATION_ERROR_1a802415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_1a803401, "The spec valid usage text states 'countBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-parameter)"}, + {VALIDATION_ERROR_1a800009, "The spec valid usage text states 'Each of buffer, commandBuffer, and countBuffer must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commonparent)"}, + {VALIDATION_ERROR_1a800017, "The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-renderpass)"}, + {VALIDATION_ERROR_1a800456, "The spec valid usage text states 'offset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-offset-00555)"}, + {VALIDATION_ERROR_1a800458, "The spec valid usage text states 'countBufferOffset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBufferOffset-00556)"}, + {VALIDATION_ERROR_1a80045a, "The spec valid usage text states 'stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawIndirectCommand)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-stride-00557)"}, + {VALIDATION_ERROR_1a80045c, "The spec valid usage text states 'If maxDrawCount is greater than or equal to 1, (stride {times} (maxDrawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-maxDrawCount-00558)"}, + {VALIDATION_ERROR_1a80045e, "The spec valid usage text states 'If the drawIndirectFirstInstance feature is not enabled, all the firstInstance members of the VkDrawIndexedIndirectCommand structures accessed by this command must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-firstInstance-00559)"}, + {VALIDATION_ERROR_1a800460, "The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-renderPass-00560)"}, + {VALIDATION_ERROR_1a800462, "The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-subpass-00561)"}, + {VALIDATION_ERROR_1a800464, "The spec valid usage text states 'For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00562)"}, + {VALIDATION_ERROR_1a800466, "The spec valid usage text states 'For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00563)"}, + {VALIDATION_ERROR_1a800468, "The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00564)"}, + {VALIDATION_ERROR_1a80046a, "The spec valid usage text states 'All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must have valid buffers bound' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00565)"}, + {VALIDATION_ERROR_1a80046c, "The spec valid usage text states 'A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00566)"}, + {VALIDATION_ERROR_1a80046e, "The spec valid usage text states 'If the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00567)"}, + {VALIDATION_ERROR_1a800470, "The spec valid usage text states 'If count stored in countBuffer is equal to 1, (offset + sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-00568)"}, + {VALIDATION_ERROR_1a800472, "The spec valid usage text states 'If count stored in countBuffer is greater than 1, (stride {times} (drawCount - 1) + offset + sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-00569)"}, + {VALIDATION_ERROR_1a800474, "The spec valid usage text states 'drawCount must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-drawCount-00570)"}, + {VALIDATION_ERROR_1a800476, "The spec valid usage text states 'Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00571)"}, + {VALIDATION_ERROR_1a800478, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00572)"}, + {VALIDATION_ERROR_1a80047a, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00573)"}, + {VALIDATION_ERROR_1a80047c, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00574)"}, + {VALIDATION_ERROR_1a80047e, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00575)"}, + {VALIDATION_ERROR_1a800480, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-00576)"}, + {VALIDATION_ERROR_1a800482, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-linearTilingFeatures-00577)"}, + {VALIDATION_ERROR_1a800484, "The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-maxMultiviewInstanceIndex-00578)"}, + {VALIDATION_ERROR_1a800bc0, "The spec valid usage text states 'Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-None-01504)"}, + {VALIDATION_ERROR_1a800bda, "The spec valid usage text states 'If the bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-sampleLocationsEnable-01517)"}, + {VALIDATION_ERROR_1a800d04, "The spec valid usage text states 'If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-01666)"}, + {VALIDATION_ERROR_1a800d06, "The spec valid usage text states 'buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-01667)"}, + {VALIDATION_ERROR_1a800d08, "The spec valid usage text states 'If countBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-01668)"}, + {VALIDATION_ERROR_1a800d0a, "The spec valid usage text states 'countBuffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-01669)"}, + {VALIDATION_ERROR_1a800e92, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-01865)"}, + {VALIDATION_ERROR_1a800e94, "The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-01866)"}, + {VALIDATION_ERROR_1a800e96, "The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-01867)"}, + {VALIDATION_ERROR_1a801a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-parameter)"}, + {VALIDATION_ERROR_1a802401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-parameter)"}, + {VALIDATION_ERROR_1a802413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-recording)"}, + {VALIDATION_ERROR_1a802415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-cmdpool)"}, + {VALIDATION_ERROR_1a803401, "The spec valid usage text states 'countBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-parameter)"}, {VALIDATION_ERROR_1aa00009, "The spec valid usage text states 'Both of buffer, and commandBuffer must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-commonparent)"}, {VALIDATION_ERROR_1aa00017, "The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-renderpass)"}, {VALIDATION_ERROR_1aa003b4, "The spec valid usage text states 'If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-buffer-00474)"}, @@ -5908,76 +6157,82 @@ {VALIDATION_ERROR_1aa003b8, "The spec valid usage text states 'If drawCount is greater than 1, stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawIndirectCommand)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-drawCount-00476)"}, {VALIDATION_ERROR_1aa003ba, "The spec valid usage text states 'If the multi-draw indirect feature is not enabled, drawCount must be 0 or 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-drawCount-00477)"}, {VALIDATION_ERROR_1aa003bc, "The spec valid usage text states 'If the drawIndirectFirstInstance feature is not enabled, all the firstInstance members of the VkDrawIndirectCommand structures accessed by this command must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-firstInstance-00478)"}, - {VALIDATION_ERROR_1aa003be, "The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-renderPass-00479)"}, - {VALIDATION_ERROR_1aa003c0, "The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-subpass-00480)"}, - {VALIDATION_ERROR_1aa003c2, "The spec valid usage text states 'For each set n that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00481)"}, - {VALIDATION_ERROR_1aa003c4, "The spec valid usage text states 'For each push constant that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00482)"}, - {VALIDATION_ERROR_1aa003c6, "The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the currently bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00483)"}, + {VALIDATION_ERROR_1aa003be, "The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-renderPass-00479)"}, + {VALIDATION_ERROR_1aa003c0, "The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-subpass-00480)"}, + {VALIDATION_ERROR_1aa003c2, "The spec valid usage text states 'For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00481)"}, + {VALIDATION_ERROR_1aa003c4, "The spec valid usage text states 'For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00482)"}, + {VALIDATION_ERROR_1aa003c6, "The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00483)"}, {VALIDATION_ERROR_1aa003c8, "The spec valid usage text states 'All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must have valid buffers bound' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00484)"}, {VALIDATION_ERROR_1aa003ca, "The spec valid usage text states 'A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00485)"}, - {VALIDATION_ERROR_1aa003cc, "The spec valid usage text states 'If the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00486)"}, + {VALIDATION_ERROR_1aa003cc, "The spec valid usage text states 'If the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00486)"}, {VALIDATION_ERROR_1aa003ce, "The spec valid usage text states 'If drawCount is equal to 1, (offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-drawCount-00487)"}, {VALIDATION_ERROR_1aa003d0, "The spec valid usage text states 'If drawCount is greater than 1, (stride {times} (drawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-drawCount-00488)"}, {VALIDATION_ERROR_1aa003d2, "The spec valid usage text states 'drawCount must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-drawCount-00489)"}, {VALIDATION_ERROR_1aa003d4, "The spec valid usage text states 'Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00490)"}, - {VALIDATION_ERROR_1aa003d6, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00491)"}, - {VALIDATION_ERROR_1aa003d8, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00492)"}, - {VALIDATION_ERROR_1aa003da, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00493)"}, - {VALIDATION_ERROR_1aa003dc, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00494)"}, - {VALIDATION_ERROR_1aa003de, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00495)"}, + {VALIDATION_ERROR_1aa003d6, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00491)"}, + {VALIDATION_ERROR_1aa003d8, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00492)"}, + {VALIDATION_ERROR_1aa003da, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00493)"}, + {VALIDATION_ERROR_1aa003dc, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00494)"}, + {VALIDATION_ERROR_1aa003de, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00495)"}, {VALIDATION_ERROR_1aa003e0, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-linearTilingFeatures-00496)"}, {VALIDATION_ERROR_1aa003e2, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirect-linearTilingFeatures-00497)"}, {VALIDATION_ERROR_1aa003e4, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must not have a VkImageViewType of VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirect-None-00498)"}, - {VALIDATION_ERROR_1aa003e6, "The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewPropertiesKHX::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirect-maxMultiviewInstanceIndex-00499)"}, + {VALIDATION_ERROR_1aa003e6, "The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirect-maxMultiviewInstanceIndex-00499)"}, {VALIDATION_ERROR_1aa00bba, "The spec valid usage text states 'Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-None-01501)"}, - {VALIDATION_ERROR_1aa00bd4, "The spec valid usage text states 'If the currently bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirect-sampleLocationsEnable-01514)"}, + {VALIDATION_ERROR_1aa00bd4, "The spec valid usage text states 'If the bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirect-sampleLocationsEnable-01514)"}, {VALIDATION_ERROR_1aa00cf8, "The spec valid usage text states 'buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-buffer-01660)"}, + {VALIDATION_ERROR_1aa00e80, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirect-commandBuffer-01856)"}, + {VALIDATION_ERROR_1aa00e82, "The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirect-commandBuffer-01857)"}, + {VALIDATION_ERROR_1aa00e84, "The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirect-commandBuffer-01858)"}, {VALIDATION_ERROR_1aa01a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-buffer-parameter)"}, {VALIDATION_ERROR_1aa02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-commandBuffer-parameter)"}, {VALIDATION_ERROR_1aa02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-commandBuffer-recording)"}, {VALIDATION_ERROR_1aa02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirect-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_1ac00009, "The spec valid usage text states 'Each of buffer, commandBuffer, and countBuffer must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commonparent)"}, - {VALIDATION_ERROR_1ac00017, "The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-renderpass)"}, - {VALIDATION_ERROR_1ac003ec, "The spec valid usage text states 'offset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-offset-00502)"}, - {VALIDATION_ERROR_1ac003ee, "The spec valid usage text states 'countBufferOffset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBufferOffset-00503)"}, - {VALIDATION_ERROR_1ac003f0, "The spec valid usage text states 'stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawIndirectCommand)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-stride-00504)"}, - {VALIDATION_ERROR_1ac003f2, "The spec valid usage text states 'If maxDrawCount is greater than or equal to 1, (stride {times} (maxDrawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-maxDrawCount-00505)"}, - {VALIDATION_ERROR_1ac003f4, "The spec valid usage text states 'If the drawIndirectFirstInstance feature is not enabled, all the firstInstance members of the VkDrawIndirectCommand structures accessed by this command must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-firstInstance-00506)"}, - {VALIDATION_ERROR_1ac003f6, "The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-renderPass-00507)"}, - {VALIDATION_ERROR_1ac003f8, "The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-subpass-00508)"}, - {VALIDATION_ERROR_1ac003fa, "The spec valid usage text states 'For each set n that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00509)"}, - {VALIDATION_ERROR_1ac003fc, "The spec valid usage text states 'For each push constant that is statically used by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout Compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00510)"}, - {VALIDATION_ERROR_1ac003fe, "The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the currently bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00511)"}, - {VALIDATION_ERROR_1ac00400, "The spec valid usage text states 'All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must have valid buffers bound' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00512)"}, - {VALIDATION_ERROR_1ac00402, "The spec valid usage text states 'A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00513)"}, - {VALIDATION_ERROR_1ac00404, "The spec valid usage text states 'If the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00514)"}, - {VALIDATION_ERROR_1ac00406, "The spec valid usage text states 'If the count stored in countBuffer is equal to 1, (offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-00515)"}, - {VALIDATION_ERROR_1ac00408, "The spec valid usage text states 'If the count stored in countBuffer is greater than 1, (stride {times} (drawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-00516)"}, - {VALIDATION_ERROR_1ac0040a, "The spec valid usage text states 'The count stored in countBuffer must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-00517)"}, - {VALIDATION_ERROR_1ac0040c, "The spec valid usage text states 'Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00518)"}, - {VALIDATION_ERROR_1ac0040e, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00519)"}, - {VALIDATION_ERROR_1ac00410, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00520)"}, - {VALIDATION_ERROR_1ac00412, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00521)"}, - {VALIDATION_ERROR_1ac00414, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00522)"}, - {VALIDATION_ERROR_1ac00416, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00523)"}, - {VALIDATION_ERROR_1ac00418, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-linearTilingFeatures-00524)"}, - {VALIDATION_ERROR_1ac0041a, "The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewPropertiesKHX::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-maxMultiviewInstanceIndex-00525)"}, - {VALIDATION_ERROR_1ac00bbc, "The spec valid usage text states 'Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-01502)"}, - {VALIDATION_ERROR_1ac00bd6, "The spec valid usage text states 'If the currently bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-sampleLocationsEnable-01515)"}, - {VALIDATION_ERROR_1ac00cfa, "The spec valid usage text states 'If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-buffer-01661)"}, - {VALIDATION_ERROR_1ac00cfc, "The spec valid usage text states 'buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-buffer-01662)"}, - {VALIDATION_ERROR_1ac00cfe, "The spec valid usage text states 'If countBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-01663)"}, - {VALIDATION_ERROR_1ac00d00, "The spec valid usage text states 'countBuffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-01664)"}, - {VALIDATION_ERROR_1ac01a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-buffer-parameter)"}, - {VALIDATION_ERROR_1ac02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commandBuffer-parameter)"}, - {VALIDATION_ERROR_1ac02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commandBuffer-recording)"}, - {VALIDATION_ERROR_1ac02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_1ac03401, "The spec valid usage text states 'countBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-parameter)"}, + {VALIDATION_ERROR_1ac00009, "The spec valid usage text states 'Each of buffer, commandBuffer, and countBuffer must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commonparent)"}, + {VALIDATION_ERROR_1ac00017, "The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-renderpass)"}, + {VALIDATION_ERROR_1ac003ec, "The spec valid usage text states 'offset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-offset-00502)"}, + {VALIDATION_ERROR_1ac003ee, "The spec valid usage text states 'countBufferOffset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBufferOffset-00503)"}, + {VALIDATION_ERROR_1ac003f0, "The spec valid usage text states 'stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawIndirectCommand)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-stride-00504)"}, + {VALIDATION_ERROR_1ac003f2, "The spec valid usage text states 'If maxDrawCount is greater than or equal to 1, (stride {times} (maxDrawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-maxDrawCount-00505)"}, + {VALIDATION_ERROR_1ac003f4, "The spec valid usage text states 'If the drawIndirectFirstInstance feature is not enabled, all the firstInstance members of the VkDrawIndirectCommand structures accessed by this command must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-firstInstance-00506)"}, + {VALIDATION_ERROR_1ac003f6, "The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-renderPass-00507)"}, + {VALIDATION_ERROR_1ac003f8, "The spec valid usage text states 'The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-subpass-00508)"}, + {VALIDATION_ERROR_1ac003fa, "The spec valid usage text states 'For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00509)"}, + {VALIDATION_ERROR_1ac003fc, "The spec valid usage text states 'For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in descriptorsets-compatibility' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00510)"}, + {VALIDATION_ERROR_1ac003fe, "The spec valid usage text states 'Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00511)"}, + {VALIDATION_ERROR_1ac00400, "The spec valid usage text states 'All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must have valid buffers bound' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00512)"}, + {VALIDATION_ERROR_1ac00402, "The spec valid usage text states 'A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00513)"}, + {VALIDATION_ERROR_1ac00404, "The spec valid usage text states 'If the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00514)"}, + {VALIDATION_ERROR_1ac00406, "The spec valid usage text states 'If the count stored in countBuffer is equal to 1, (offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-00515)"}, + {VALIDATION_ERROR_1ac00408, "The spec valid usage text states 'If the count stored in countBuffer is greater than 1, (stride {times} (drawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-00516)"}, + {VALIDATION_ERROR_1ac0040a, "The spec valid usage text states 'The count stored in countBuffer must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-00517)"}, + {VALIDATION_ERROR_1ac0040c, "The spec valid usage text states 'Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00518)"}, + {VALIDATION_ERROR_1ac0040e, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00519)"}, + {VALIDATION_ERROR_1ac00410, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00520)"}, + {VALIDATION_ERROR_1ac00412, "The spec valid usage text states 'If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00521)"}, + {VALIDATION_ERROR_1ac00414, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00522)"}, + {VALIDATION_ERROR_1ac00416, "The spec valid usage text states 'If the robust buffer access feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-00523)"}, + {VALIDATION_ERROR_1ac00418, "The spec valid usage text states 'Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-linearTilingFeatures-00524)"}, + {VALIDATION_ERROR_1ac0041a, "The spec valid usage text states 'If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-maxMultiviewInstanceIndex-00525)"}, + {VALIDATION_ERROR_1ac00bbc, "The spec valid usage text states 'Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-None-01502)"}, + {VALIDATION_ERROR_1ac00bd6, "The spec valid usage text states 'If the bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-sampleLocationsEnable-01515)"}, + {VALIDATION_ERROR_1ac00cfa, "The spec valid usage text states 'If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-buffer-01661)"}, + {VALIDATION_ERROR_1ac00cfc, "The spec valid usage text states 'buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-buffer-01662)"}, + {VALIDATION_ERROR_1ac00cfe, "The spec valid usage text states 'If countBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-01663)"}, + {VALIDATION_ERROR_1ac00d00, "The spec valid usage text states 'countBuffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-01664)"}, + {VALIDATION_ERROR_1ac00e86, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commandBuffer-01859)"}, + {VALIDATION_ERROR_1ac00e88, "The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commandBuffer-01860)"}, + {VALIDATION_ERROR_1ac00e8a, "The spec valid usage text states 'If commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must not be a protected image or protected buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commandBuffer-01861)"}, + {VALIDATION_ERROR_1ac01a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-buffer-parameter)"}, + {VALIDATION_ERROR_1ac02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commandBuffer-parameter)"}, + {VALIDATION_ERROR_1ac02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commandBuffer-recording)"}, + {VALIDATION_ERROR_1ac02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-commandBuffer-cmdpool)"}, + {VALIDATION_ERROR_1ac03401, "The spec valid usage text states 'countBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdDrawIndirectCountAMD-countBuffer-parameter)"}, {VALIDATION_ERROR_1ae00009, "The spec valid usage text states 'Both of commandBuffer, and queryPool must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndQuery-commonparent)"}, - {VALIDATION_ERROR_1ae00652, "The spec valid usage text states 'The query identified by queryPool and query must currently be active' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndQuery-queryPool-00809)"}, {VALIDATION_ERROR_1ae00654, "The spec valid usage text states 'query must be less than the number of queries in queryPool' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndQuery-query-00810)"}, - {VALIDATION_ERROR_1ae00656, "The spec valid usage text states 'All queries used by the command must be active' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdEndQuery-None-00811)"}, {VALIDATION_ERROR_1ae00658, "The spec valid usage text states 'If vkCmdEndQuery is called within a render pass instance, the sum of query and the number of bits set in the current subpass's view mask must be less than or equal to the number of queries in queryPool' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdEndQuery-query-00812)"}, + {VALIDATION_ERROR_1ae00ebc, "The spec valid usage text states 'commandBuffer must not be a protected command buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdEndQuery-commandBuffer-01886)"}, + {VALIDATION_ERROR_1ae00f06, "The spec valid usage text states 'All queries used by the command must be active' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndQuery-None-01923)"}, {VALIDATION_ERROR_1ae02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndQuery-commandBuffer-parameter)"}, {VALIDATION_ERROR_1ae02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndQuery-commandBuffer-recording)"}, {VALIDATION_ERROR_1ae02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdEndQuery-commandBuffer-cmdpool)"}, @@ -6009,6 +6264,8 @@ {VALIDATION_ERROR_1b2000ce, "The spec valid usage text states 'If commandBuffer has a VK_QUERY_TYPE_OCCLUSION query active, then each element of pCommandBuffers must have been recorded with VkCommandBufferInheritanceInfo::queryFlags having all bits set that are set for the query' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdExecuteCommands-commandBuffer-00103)"}, {VALIDATION_ERROR_1b2000d0, "The spec valid usage text states 'If commandBuffer has a VK_QUERY_TYPE_PIPELINE_STATISTICS query active, then each element of pCommandBuffers must have been recorded with VkCommandBufferInheritanceInfo::pipelineStatistics having all bits set that are set in the VkQueryPool the query uses' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdExecuteCommands-commandBuffer-00104)"}, {VALIDATION_ERROR_1b2000d2, "The spec valid usage text states 'Each element of pCommandBuffers must not begin any query types that are active in commandBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdExecuteCommands-pCommandBuffers-00105)"}, + {VALIDATION_ERROR_1b200e38, "The spec valid usage text states 'If commandBuffer is a protected command buffer, then each element of pCommandBuffers must be a protected command buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdExecuteCommands-commandBuffer-01820)"}, + {VALIDATION_ERROR_1b200e3a, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then each element of pCommandBuffers must be an unprotected command buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdExecuteCommands-commandBuffer-01821)"}, {VALIDATION_ERROR_1b202401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdExecuteCommands-commandBuffer-parameter)"}, {VALIDATION_ERROR_1b202413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdExecuteCommands-commandBuffer-recording)"}, {VALIDATION_ERROR_1b202415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdExecuteCommands-commandBuffer-cmdpool)"}, @@ -6024,6 +6281,8 @@ {VALIDATION_ERROR_1b40003a, "The spec valid usage text states 'dstBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_DST_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdFillBuffer-dstBuffer-00029)"}, {VALIDATION_ERROR_1b40003c, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdFillBuffer-commandBuffer-00030)"}, {VALIDATION_ERROR_1b40003e, "The spec valid usage text states 'If dstBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdFillBuffer-dstBuffer-00031)"}, + {VALIDATION_ERROR_1b400e26, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstBuffer must not be a protected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdFillBuffer-commandBuffer-01811)"}, + {VALIDATION_ERROR_1b400e28, "The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstBuffer must not be an unprotected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdFillBuffer-commandBuffer-01812)"}, {VALIDATION_ERROR_1b402401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdFillBuffer-commandBuffer-parameter)"}, {VALIDATION_ERROR_1b402413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdFillBuffer-commandBuffer-recording)"}, {VALIDATION_ERROR_1b402415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdFillBuffer-commandBuffer-cmdpool)"}, @@ -6053,7 +6312,7 @@ {VALIDATION_ERROR_1b80093e, "The spec valid usage text states 'Any pipeline stage included in srcStageMask or dstStageMask must be supported by the capabilities of the queue family specified by the queueFamilyIndex member of the VkCommandPoolCreateInfo structure that was used to create the VkCommandPool that commandBuffer was allocated from, as specified in the table of supported pipeline stages.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-srcStageMask-01183)"}, {VALIDATION_ERROR_1b800940, "The spec valid usage text states 'Each element of pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers must not have any access flag included in its srcAccessMask member if that bit is not supported by any of the pipeline stages in srcStageMask, as specified in the table of supported access types.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-pMemoryBarriers-01184)"}, {VALIDATION_ERROR_1b800942, "The spec valid usage text states 'Each element of pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers must not have any access flag included in its dstAccessMask member if that bit is not supported by any of the pipeline stages in dstStageMask, as specified in the table of supported access types.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-pMemoryBarriers-01185)"}, - {VALIDATION_ERROR_1b800944, "The spec valid usage text states 'If vkCmdPipelineBarrier is called outside of a render pass instance, dependencyFlags must not include VK_DEPENDENCY_VIEW_LOCAL_BIT_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPipelineBarrier-dependencyFlags-01186)"}, + {VALIDATION_ERROR_1b800944, "The spec valid usage text states 'If vkCmdPipelineBarrier is called outside of a render pass instance, dependencyFlags must not include VK_DEPENDENCY_VIEW_LOCAL_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPipelineBarrier-dependencyFlags-01186)"}, {VALIDATION_ERROR_1b802401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-commandBuffer-parameter)"}, {VALIDATION_ERROR_1b802413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-commandBuffer-recording)"}, {VALIDATION_ERROR_1b802415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-commandBuffer-cmdpool)"}, @@ -6065,17 +6324,18 @@ {VALIDATION_ERROR_1b81ac01, "The spec valid usage text states 'If memoryBarrierCount is not 0, pMemoryBarriers must be a valid pointer to an array of memoryBarrierCount valid VkMemoryBarrier structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-pMemoryBarriers-parameter)"}, {VALIDATION_ERROR_1b82d401, "The spec valid usage text states 'srcStageMask must be a valid combination of VkPipelineStageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-srcStageMask-parameter)"}, {VALIDATION_ERROR_1b82d403, "The spec valid usage text states 'srcStageMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-srcStageMask-requiredbitmask)"}, - {VALIDATION_ERROR_1ba00017, "The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-renderpass)"}, - {VALIDATION_ERROR_1ba02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-commandBuffer-parameter)"}, - {VALIDATION_ERROR_1ba02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-commandBuffer-recording)"}, - {VALIDATION_ERROR_1ba02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_1ba1f201, "The spec valid usage text states 'pProcessCommandsInfo must be a valid pointer to a valid VkCmdProcessCommandsInfoNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-pProcessCommandsInfo-parameter)"}, + {VALIDATION_ERROR_1ba00017, "The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-renderpass)"}, + {VALIDATION_ERROR_1ba02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-commandBuffer-parameter)"}, + {VALIDATION_ERROR_1ba02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-commandBuffer-recording)"}, + {VALIDATION_ERROR_1ba02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-commandBuffer-cmdpool)"}, + {VALIDATION_ERROR_1ba1f201, "The spec valid usage text states 'pProcessCommandsInfo must be a valid pointer to a valid VkCmdProcessCommandsInfoNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdProcessCommandsNVX-pProcessCommandsInfo-parameter)"}, {VALIDATION_ERROR_1bc00009, "The spec valid usage text states 'Both of commandBuffer, and layout must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-commonparent)"}, - {VALIDATION_ERROR_1bc002de, "The spec valid usage text states 'stageFlags must match exactly the shader stages used in layout for the range specified by offset and size' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-stageFlags-00367)"}, {VALIDATION_ERROR_1bc002e0, "The spec valid usage text states 'offset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-offset-00368)"}, {VALIDATION_ERROR_1bc002e2, "The spec valid usage text states 'size must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-size-00369)"}, {VALIDATION_ERROR_1bc002e4, "The spec valid usage text states 'offset must be less than VkPhysicalDeviceLimits::maxPushConstantsSize' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-offset-00370)"}, {VALIDATION_ERROR_1bc002e6, "The spec valid usage text states 'size must be less than or equal to VkPhysicalDeviceLimits::maxPushConstantsSize minus offset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-size-00371)"}, + {VALIDATION_ERROR_1bc00e06, "The spec valid usage text states 'For each byte in the range specified by offset and size and for each shader stage in stageFlags, there must be a push constant range in layout that includes that byte and that stage' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-offset-01795)"}, + {VALIDATION_ERROR_1bc00e08, "The spec valid usage text states 'For each byte in the range specified by offset and size and for each push constant range that overlaps that byte, stageFlags must include all stages in that push constant range's VkPushConstantRange::stageFlags' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-offset-01796)"}, {VALIDATION_ERROR_1bc02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-commandBuffer-parameter)"}, {VALIDATION_ERROR_1bc02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-commandBuffer-recording)"}, {VALIDATION_ERROR_1bc02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-commandBuffer-cmdpool)"}, @@ -6084,34 +6344,33 @@ {VALIDATION_ERROR_1bc2c21b, "The spec valid usage text states 'size must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-size-arraylength)"}, {VALIDATION_ERROR_1bc2dc01, "The spec valid usage text states 'stageFlags must be a valid combination of VkShaderStageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-stageFlags-parameter)"}, {VALIDATION_ERROR_1bc2dc03, "The spec valid usage text states 'stageFlags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushConstants-stageFlags-requiredbitmask)"}, - {VALIDATION_ERROR_1be00009, "The spec valid usage text states 'Both of commandBuffer, and layout must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-commonparent)"}, - {VALIDATION_ERROR_1be002d6, "The spec valid usage text states 'pipelineBindPoint must be supported by the commandBuffer's parent VkCommandPool's queue family' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-00363)"}, - {VALIDATION_ERROR_1be002d8, "The spec valid usage text states 'set must be less than VkPipelineLayoutCreateInfo::setLayoutCount provided when layout was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-set-00364)"}, - {VALIDATION_ERROR_1be002da, "The spec valid usage text states 'set must be the unique set number in the pipeline layout that uses a descriptor set layout that was created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-set-00365)"}, - {VALIDATION_ERROR_1be02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-commandBuffer-parameter)"}, - {VALIDATION_ERROR_1be02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-commandBuffer-recording)"}, - {VALIDATION_ERROR_1be02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_1be0541b, "The spec valid usage text states 'descriptorWriteCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-descriptorWriteCount-arraylength)"}, - {VALIDATION_ERROR_1be0be01, "The spec valid usage text states 'layout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-layout-parameter)"}, - {VALIDATION_ERROR_1be13601, "The spec valid usage text states 'pDescriptorWrites must be a valid pointer to an array of descriptorWriteCount valid VkWriteDescriptorSet structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-pDescriptorWrites-parameter)"}, - {VALIDATION_ERROR_1be27e01, "The spec valid usage text states 'pipelineBindPoint must be a valid VkPipelineBindPoint value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-parameter)"}, - {VALIDATION_ERROR_1c000009, "The spec valid usage text states 'Each of commandBuffer, descriptorUpdateTemplate, and layout must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commonparent)"}, - {VALIDATION_ERROR_1c0002dc, "The spec valid usage text states 'The pipelineBindPoint specified during the creation of the descriptor update template must be supported by the commandBuffer's parent VkCommandPool's queue family' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-00366)"}, - {VALIDATION_ERROR_1c000d2c, "The spec valid usage text states 'pData must be a valid pointer to a memory that contains one or more valid instances of VkDescriptorImageInfo, VkDescriptorBufferInfo, or VkBufferView in a layout defined by descriptorUpdateTemplate when it was created with vkCreateDescriptorUpdateTemplateKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-pData-01686)"}, - {VALIDATION_ERROR_1c002401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-parameter)"}, - {VALIDATION_ERROR_1c002413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-recording)"}, - {VALIDATION_ERROR_1c002415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_1c005201, "The spec valid usage text states 'descriptorUpdateTemplate must be a valid VkDescriptorUpdateTemplateKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-descriptorUpdateTemplate-parameter)"}, - {VALIDATION_ERROR_1c00be01, "The spec valid usage text states 'layout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-layout-parameter)"}, - {VALIDATION_ERROR_1c012201, "The spec valid usage text states 'pData must be a pointer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-pData-parameter)"}, - {VALIDATION_ERROR_1c200017, "The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-renderpass)"}, - {VALIDATION_ERROR_1c200019, "The spec valid usage text states 'commandBuffer must be a secondary VkCommandBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-bufferlevel)"}, - {VALIDATION_ERROR_1c200a62, "The spec valid usage text states 'The provided commandBuffer must not have had a prior space reservation since its creation or the last reset.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-01329)"}, - {VALIDATION_ERROR_1c200a64, "The spec valid usage text states 'The state of the commandBuffer must be legal to execute all commands within the sequence provided by the indirectCommandsLayout member of pProcessCommandsInfo.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-01330)"}, - {VALIDATION_ERROR_1c202401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-parameter)"}, - {VALIDATION_ERROR_1c202413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-recording)"}, - {VALIDATION_ERROR_1c202415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_1c221a01, "The spec valid usage text states 'pReserveSpaceInfo must be a valid pointer to a valid VkCmdReserveSpaceForCommandsInfoNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-pReserveSpaceInfo-parameter)"}, + {VALIDATION_ERROR_1be00009, "The spec valid usage text states 'Both of commandBuffer, and layout must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-commonparent)"}, + {VALIDATION_ERROR_1be002d6, "The spec valid usage text states 'pipelineBindPoint must be supported by the commandBuffer's parent VkCommandPool's queue family' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-00363)"}, + {VALIDATION_ERROR_1be002d8, "The spec valid usage text states 'set must be less than VkPipelineLayoutCreateInfo::setLayoutCount provided when layout was created' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-set-00364)"}, + {VALIDATION_ERROR_1be002da, "The spec valid usage text states 'set must be the unique set number in the pipeline layout that uses a descriptor set layout that was created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-set-00365)"}, + {VALIDATION_ERROR_1be02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-commandBuffer-parameter)"}, + {VALIDATION_ERROR_1be02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-commandBuffer-recording)"}, + {VALIDATION_ERROR_1be02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-commandBuffer-cmdpool)"}, + {VALIDATION_ERROR_1be0541b, "The spec valid usage text states 'descriptorWriteCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-descriptorWriteCount-arraylength)"}, + {VALIDATION_ERROR_1be0be01, "The spec valid usage text states 'layout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-layout-parameter)"}, + {VALIDATION_ERROR_1be13601, "The spec valid usage text states 'pDescriptorWrites must be a valid pointer to an array of descriptorWriteCount valid VkWriteDescriptorSet structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-pDescriptorWrites-parameter)"}, + {VALIDATION_ERROR_1be27e01, "The spec valid usage text states 'pipelineBindPoint must be a valid VkPipelineBindPoint value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-parameter)"}, + {VALIDATION_ERROR_1c000009, "The spec valid usage text states 'Each of commandBuffer, descriptorUpdateTemplate, and layout must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commonparent)"}, + {VALIDATION_ERROR_1c0002dc, "The spec valid usage text states 'The pipelineBindPoint specified during the creation of the descriptor update template must be supported by the commandBuffer's parent VkCommandPool's queue family' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-00366)"}, + {VALIDATION_ERROR_1c000d2c, "The spec valid usage text states 'pData must be a valid pointer to a memory that contains one or more valid instances of VkDescriptorImageInfo, VkDescriptorBufferInfo, or VkBufferView in a layout defined by descriptorUpdateTemplate when it was created with vkCreateDescriptorUpdateTemplateKHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-pData-01686)"}, + {VALIDATION_ERROR_1c002401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-parameter)"}, + {VALIDATION_ERROR_1c002413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-recording)"}, + {VALIDATION_ERROR_1c002415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-cmdpool)"}, + {VALIDATION_ERROR_1c005201, "The spec valid usage text states 'descriptorUpdateTemplate must be a valid VkDescriptorUpdateTemplate handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-descriptorUpdateTemplate-parameter)"}, + {VALIDATION_ERROR_1c00be01, "The spec valid usage text states 'layout must be a valid VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdPushDescriptorSetWithTemplateKHR-layout-parameter)"}, + {VALIDATION_ERROR_1c200017, "The spec valid usage text states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-renderpass)"}, + {VALIDATION_ERROR_1c200019, "The spec valid usage text states 'commandBuffer must be a secondary VkCommandBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-bufferlevel)"}, + {VALIDATION_ERROR_1c200a62, "The spec valid usage text states 'The provided commandBuffer must not have had a prior space reservation since its creation or the last reset.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-01329)"}, + {VALIDATION_ERROR_1c200a64, "The spec valid usage text states 'The state of the commandBuffer must be legal to execute all commands within the sequence provided by the indirectCommandsLayout member of pProcessCommandsInfo.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-01330)"}, + {VALIDATION_ERROR_1c202401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-parameter)"}, + {VALIDATION_ERROR_1c202413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-recording)"}, + {VALIDATION_ERROR_1c202415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-cmdpool)"}, + {VALIDATION_ERROR_1c221a01, "The spec valid usage text states 'pReserveSpaceInfo must be a valid pointer to a valid VkCmdReserveSpaceForCommandsInfoNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdReserveSpaceForCommandsNVX-pReserveSpaceInfo-parameter)"}, {VALIDATION_ERROR_1c400009, "The spec valid usage text states 'Both of commandBuffer, and event must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetEvent-commonparent)"}, {VALIDATION_ERROR_1c400017, "The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetEvent-renderpass)"}, {VALIDATION_ERROR_1c400902, "The spec valid usage text states 'stageMask must not include VK_PIPELINE_STAGE_HOST_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResetEvent-stageMask-01153)"}, @@ -6155,6 +6414,9 @@ {VALIDATION_ERROR_1c800d5c, "The spec valid usage text states 'The dstSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-dstSubresource-01710)"}, {VALIDATION_ERROR_1c800d5e, "The spec valid usage text states 'The srcSubresource.baseArrayLayer + srcSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-srcSubresource-01711)"}, {VALIDATION_ERROR_1c800d60, "The spec valid usage text states 'The dstSubresource.baseArrayLayer + dstSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-dstSubresource-01712)"}, + {VALIDATION_ERROR_1c800e5a, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then srcImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdResolveImage-commandBuffer-01837)"}, + {VALIDATION_ERROR_1c800e5c, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdResolveImage-commandBuffer-01838)"}, + {VALIDATION_ERROR_1c800e5e, "The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstImage must not be an unprotected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdResolveImage-commandBuffer-01839)"}, {VALIDATION_ERROR_1c802401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-commandBuffer-parameter)"}, {VALIDATION_ERROR_1c802413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-commandBuffer-recording)"}, {VALIDATION_ERROR_1c802415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-commandBuffer-cmdpool)"}, @@ -6164,40 +6426,38 @@ {VALIDATION_ERROR_1c82ac1b, "The spec valid usage text states 'regionCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-regionCount-arraylength)"}, {VALIDATION_ERROR_1c82ce01, "The spec valid usage text states 'srcImage must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-srcImage-parameter)"}, {VALIDATION_ERROR_1c82d001, "The spec valid usage text states 'srcImageLayout must be a valid VkImageLayout value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdResolveImage-srcImageLayout-parameter)"}, - {VALIDATION_ERROR_1ca004c8, "The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_BLEND_CONSTANTS dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetBlendConstants-None-00612)"}, + {VALIDATION_ERROR_1ca004c8, "The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_BLEND_CONSTANTS dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetBlendConstants-None-00612)"}, {VALIDATION_ERROR_1ca02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetBlendConstants-commandBuffer-parameter)"}, {VALIDATION_ERROR_1ca02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetBlendConstants-commandBuffer-recording)"}, {VALIDATION_ERROR_1ca02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetBlendConstants-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_1cc0062a, "The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_DEPTH_BIAS dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBias-None-00789)"}, + {VALIDATION_ERROR_1cc0062a, "The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_DEPTH_BIAS dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBias-None-00789)"}, {VALIDATION_ERROR_1cc0062c, "The spec valid usage text states 'If the depth bias clamping feature is not enabled, depthBiasClamp must be 0.0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBias-depthBiasClamp-00790)"}, {VALIDATION_ERROR_1cc02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBias-commandBuffer-parameter)"}, {VALIDATION_ERROR_1cc02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBias-commandBuffer-recording)"}, {VALIDATION_ERROR_1cc02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBias-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_1ce004ae, "The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_DEPTH_BOUNDS dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBounds-None-00599)"}, - {VALIDATION_ERROR_1ce004b0, "The spec valid usage text states 'minDepthBounds must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBounds-minDepthBounds-00600)"}, - {VALIDATION_ERROR_1ce004b2, "The spec valid usage text states 'maxDepthBounds must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBounds-maxDepthBounds-00601)"}, + {VALIDATION_ERROR_1ce004ae, "The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_DEPTH_BOUNDS dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBounds-None-00599)"}, + {VALIDATION_ERROR_1ce004b0, "The spec valid usage text states 'Unless the VK_EXT_depth_range_unrestricted extension is enabled minDepthBounds must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDepthBounds-minDepthBounds-00600)"}, + {VALIDATION_ERROR_1ce004b2, "The spec valid usage text states 'Unless the VK_EXT_depth_range_unrestricted extension is enabled maxDepthBounds must be between 0.0 and 1.0, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDepthBounds-maxDepthBounds-00601)"}, {VALIDATION_ERROR_1ce02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBounds-commandBuffer-parameter)"}, {VALIDATION_ERROR_1ce02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBounds-commandBuffer-recording)"}, {VALIDATION_ERROR_1ce02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDepthBounds-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_1d0000d8, "The spec valid usage text states 'deviceMask must be a valid device mask value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDeviceMaskKHX-deviceMask-00108)"}, - {VALIDATION_ERROR_1d0000da, "The spec valid usage text states 'deviceMask must not be zero' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDeviceMaskKHX-deviceMask-00109)"}, - {VALIDATION_ERROR_1d0000dc, "The spec valid usage text states 'deviceMask must not include any set bits that were not in the VkDeviceGroupCommandBufferBeginInfoKHX::deviceMask value when the command buffer began recording.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDeviceMaskKHX-deviceMask-00110)"}, - {VALIDATION_ERROR_1d0000de, "The spec valid usage text states 'If vkCmdSetDeviceMaskKHX is called inside a render pass instance, deviceMask must not include any set bits that were not in the VkDeviceGroupRenderPassBeginInfoKHX::deviceMask value when the render pass instance began recording.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDeviceMaskKHX-deviceMask-00111)"}, - {VALIDATION_ERROR_1d002401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDeviceMaskKHX-commandBuffer-parameter)"}, - {VALIDATION_ERROR_1d002413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDeviceMaskKHX-commandBuffer-recording)"}, - {VALIDATION_ERROR_1d002415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, compute, or transfer operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDeviceMaskKHX-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_1d20048e, "The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-None-00583)"}, - {VALIDATION_ERROR_1d200490, "The spec valid usage text states 'firstDiscardRectangle must be less than VkPhysicalDeviceDiscardRectanglePropertiesEXT.maxDiscardRectangles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-firstDiscardRectangle-00584)"}, - {VALIDATION_ERROR_1d200492, "The spec valid usage text states 'The sum of firstDiscardRectangle and discardRectangleCount must be between 1 and VkPhysicalDeviceDiscardRectanglePropertiesEXT::maxDiscardRectangles, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-firstDiscardRectangle-00585)"}, - {VALIDATION_ERROR_1d200494, "The spec valid usage text states 'pDiscardRectangles must be a valid pointer to an array of discardRectangleCount valid VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-pDiscardRectangles-00586)"}, - {VALIDATION_ERROR_1d200496, "The spec valid usage text states 'The x and y members of offset in VkRect2D must be greater than or equal to 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-x-00587)"}, - {VALIDATION_ERROR_1d200498, "The spec valid usage text states 'Evaluation of (offset.x + extent.width) in VkRect2D must not cause a signed integer addition overflow' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-offset-00588)"}, - {VALIDATION_ERROR_1d20049a, "The spec valid usage text states 'Evaluation of (offset.y + extent.height) in VkRect2D must not cause a signed integer addition overflow' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-offset-00589)"}, - {VALIDATION_ERROR_1d202401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-parameter)"}, - {VALIDATION_ERROR_1d202413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-recording)"}, - {VALIDATION_ERROR_1d202415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_1d205c1b, "The spec valid usage text states 'discardRectangleCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-discardRectangleCount-arraylength)"}, - {VALIDATION_ERROR_1d214601, "The spec valid usage text states 'pDiscardRectangles must be a valid pointer to an array of discardRectangleCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-pDiscardRectangles-parameter)"}, + {VALIDATION_ERROR_1d0000d8, "The spec valid usage text states 'deviceMask must be a valid device mask value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDeviceMask-deviceMask-00108)"}, + {VALIDATION_ERROR_1d0000da, "The spec valid usage text states 'deviceMask must not be zero' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDeviceMask-deviceMask-00109)"}, + {VALIDATION_ERROR_1d0000dc, "The spec valid usage text states 'deviceMask must not include any set bits that were not in the VkDeviceGroupCommandBufferBeginInfo::deviceMask value when the command buffer began recording.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDeviceMask-deviceMask-00110)"}, + {VALIDATION_ERROR_1d0000de, "The spec valid usage text states 'If vkCmdSetDeviceMask is called inside a render pass instance, deviceMask must not include any set bits that were not in the VkDeviceGroupRenderPassBeginInfo::deviceMask value when the render pass instance began recording.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDeviceMask-deviceMask-00111)"}, + {VALIDATION_ERROR_1d002401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDeviceMask-commandBuffer-parameter)"}, + {VALIDATION_ERROR_1d002413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDeviceMask-commandBuffer-recording)"}, + {VALIDATION_ERROR_1d002415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, compute, or transfer operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDeviceMask-commandBuffer-cmdpool)"}, + {VALIDATION_ERROR_1d20048e, "The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-None-00583)"}, + {VALIDATION_ERROR_1d200492, "The spec valid usage text states 'The sum of firstDiscardRectangle and discardRectangleCount must be less than or equal to VkPhysicalDeviceDiscardRectanglePropertiesEXT::maxDiscardRectangles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-firstDiscardRectangle-00585)"}, + {VALIDATION_ERROR_1d200496, "The spec valid usage text states 'The x and y member of offset in each VkRect2D element of pDiscardRectangles must be greater than or equal to 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-x-00587)"}, + {VALIDATION_ERROR_1d200498, "The spec valid usage text states 'Evaluation of (offset.x + extent.width) in each VkRect2D element of pDiscardRectangles must not cause a signed integer addition overflow' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-offset-00588)"}, + {VALIDATION_ERROR_1d20049a, "The spec valid usage text states 'Evaluation of (offset.y + extent.height) in each VkRect2D element of pDiscardRectangles must not cause a signed integer addition overflow' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-offset-00589)"}, + {VALIDATION_ERROR_1d202401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-parameter)"}, + {VALIDATION_ERROR_1d202413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-recording)"}, + {VALIDATION_ERROR_1d202415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-cmdpool)"}, + {VALIDATION_ERROR_1d205c1b, "The spec valid usage text states 'discardRectangleCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-discardRectangleCount-arraylength)"}, + {VALIDATION_ERROR_1d214601, "The spec valid usage text states 'pDiscardRectangles must be a valid pointer to an array of discardRectangleCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetDiscardRectangleEXT-pDiscardRectangles-parameter)"}, {VALIDATION_ERROR_1d400009, "The spec valid usage text states 'Both of commandBuffer, and event must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetEvent-commonparent)"}, {VALIDATION_ERROR_1d400017, "The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetEvent-renderpass)"}, {VALIDATION_ERROR_1d4008fa, "The spec valid usage text states 'stageMask must not include VK_PIPELINE_STAGE_HOST_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetEvent-stageMask-01149)"}, @@ -6210,12 +6470,12 @@ {VALIDATION_ERROR_1d407e01, "The spec valid usage text states 'event must be a valid VkEvent handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetEvent-event-parameter)"}, {VALIDATION_ERROR_1d42de01, "The spec valid usage text states 'stageMask must be a valid combination of VkPipelineStageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetEvent-stageMask-parameter)"}, {VALIDATION_ERROR_1d42de03, "The spec valid usage text states 'stageMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetEvent-stageMask-requiredbitmask)"}, - {VALIDATION_ERROR_1d600626, "The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_LINE_WIDTH dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetLineWidth-None-00787)"}, + {VALIDATION_ERROR_1d600626, "The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_LINE_WIDTH dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetLineWidth-None-00787)"}, {VALIDATION_ERROR_1d600628, "The spec valid usage text states 'If the wide lines feature is not enabled, lineWidth must be 1.0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetLineWidth-lineWidth-00788)"}, {VALIDATION_ERROR_1d602401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetLineWidth-commandBuffer-parameter)"}, {VALIDATION_ERROR_1d602413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetLineWidth-commandBuffer-recording)"}, {VALIDATION_ERROR_1d602415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetLineWidth-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_1d80049c, "The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_SCISSOR dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-None-00590)"}, + {VALIDATION_ERROR_1d80049c, "The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_SCISSOR dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-None-00590)"}, {VALIDATION_ERROR_1d80049e, "The spec valid usage text states 'firstScissor must be less than VkPhysicalDeviceLimits::maxViewports' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-firstScissor-00591)"}, {VALIDATION_ERROR_1d8004a0, "The spec valid usage text states 'The sum of firstScissor and scissorCount must be between 1 and VkPhysicalDeviceLimits::maxViewports, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-firstScissor-00592)"}, {VALIDATION_ERROR_1d8004a2, "The spec valid usage text states 'If the multiple viewports feature is not enabled, firstScissor must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-firstScissor-00593)"}, @@ -6228,42 +6488,42 @@ {VALIDATION_ERROR_1d802415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-commandBuffer-cmdpool)"}, {VALIDATION_ERROR_1d822601, "The spec valid usage text states 'pScissors must be a valid pointer to an array of scissorCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-pScissors-parameter)"}, {VALIDATION_ERROR_1d82b61b, "The spec valid usage text states 'scissorCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetScissor-scissorCount-arraylength)"}, - {VALIDATION_ERROR_1da004b4, "The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilCompareMask-None-00602)"}, + {VALIDATION_ERROR_1da004b4, "The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilCompareMask-None-00602)"}, {VALIDATION_ERROR_1da02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilCompareMask-commandBuffer-parameter)"}, {VALIDATION_ERROR_1da02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilCompareMask-commandBuffer-recording)"}, {VALIDATION_ERROR_1da02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilCompareMask-commandBuffer-cmdpool)"}, {VALIDATION_ERROR_1da08401, "The spec valid usage text states 'faceMask must be a valid combination of VkStencilFaceFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilCompareMask-faceMask-parameter)"}, {VALIDATION_ERROR_1da08403, "The spec valid usage text states 'faceMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilCompareMask-faceMask-requiredbitmask)"}, - {VALIDATION_ERROR_1dc004b8, "The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_STENCIL_REFERENCE dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilReference-None-00604)"}, + {VALIDATION_ERROR_1dc004b8, "The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_STENCIL_REFERENCE dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilReference-None-00604)"}, {VALIDATION_ERROR_1dc02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilReference-commandBuffer-parameter)"}, {VALIDATION_ERROR_1dc02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilReference-commandBuffer-recording)"}, {VALIDATION_ERROR_1dc02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilReference-commandBuffer-cmdpool)"}, {VALIDATION_ERROR_1dc08401, "The spec valid usage text states 'faceMask must be a valid combination of VkStencilFaceFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilReference-faceMask-parameter)"}, {VALIDATION_ERROR_1dc08403, "The spec valid usage text states 'faceMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilReference-faceMask-requiredbitmask)"}, - {VALIDATION_ERROR_1de004b6, "The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_STENCIL_WRITE_MASK dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilWriteMask-None-00603)"}, + {VALIDATION_ERROR_1de004b6, "The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_STENCIL_WRITE_MASK dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilWriteMask-None-00603)"}, {VALIDATION_ERROR_1de02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilWriteMask-commandBuffer-parameter)"}, {VALIDATION_ERROR_1de02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilWriteMask-commandBuffer-recording)"}, {VALIDATION_ERROR_1de02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilWriteMask-commandBuffer-cmdpool)"}, {VALIDATION_ERROR_1de08401, "The spec valid usage text states 'faceMask must be a valid combination of VkStencilFaceFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilWriteMask-faceMask-parameter)"}, {VALIDATION_ERROR_1de08403, "The spec valid usage text states 'faceMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetStencilWriteMask-faceMask-requiredbitmask)"}, - {VALIDATION_ERROR_1e00098a, "The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_VIEWPORT dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-None-01221)"}, + {VALIDATION_ERROR_1e00098a, "The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_VIEWPORT dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-None-01221)"}, {VALIDATION_ERROR_1e00098c, "The spec valid usage text states 'firstViewport must be less than VkPhysicalDeviceLimits::maxViewports' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-firstViewport-01222)"}, {VALIDATION_ERROR_1e00098e, "The spec valid usage text states 'The sum of firstViewport and viewportCount must be between 1 and VkPhysicalDeviceLimits::maxViewports, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-firstViewport-01223)"}, {VALIDATION_ERROR_1e000990, "The spec valid usage text states 'If the multiple viewports feature is not enabled, firstViewport must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-firstViewport-01224)"}, {VALIDATION_ERROR_1e000992, "The spec valid usage text states 'If the multiple viewports feature is not enabled, viewportCount must be 1' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-viewportCount-01225)"}, - {VALIDATION_ERROR_1e000994, "The spec valid usage text states 'pViewports must be a valid pointer to an array of viewportCount valid VkViewport structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-pViewports-01226)"}, {VALIDATION_ERROR_1e002401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-commandBuffer-parameter)"}, {VALIDATION_ERROR_1e002413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-commandBuffer-recording)"}, {VALIDATION_ERROR_1e002415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-commandBuffer-cmdpool)"}, {VALIDATION_ERROR_1e030a1b, "The spec valid usage text states 'viewportCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-viewportCount-arraylength)"}, - {VALIDATION_ERROR_1e200a54, "The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-None-01322)"}, - {VALIDATION_ERROR_1e200a56, "The spec valid usage text states 'firstViewport must be less than VkPhysicalDeviceLimits::maxViewports' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-firstViewport-01323)"}, - {VALIDATION_ERROR_1e200a58, "The spec valid usage text states 'The sum of firstViewport and viewportCount must be between 1 and VkPhysicalDeviceLimits::maxViewports, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-firstViewport-01324)"}, - {VALIDATION_ERROR_1e200a5a, "The spec valid usage text states 'pViewportScalings must be a pointer to an array of viewportCount valid VkViewportWScalingNV structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-pViewportScalings-01325)"}, - {VALIDATION_ERROR_1e202401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-commandBuffer-parameter)"}, - {VALIDATION_ERROR_1e202413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-commandBuffer-recording)"}, - {VALIDATION_ERROR_1e202415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_1e230a1b, "The spec valid usage text states 'viewportCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-viewportCount-arraylength)"}, + {VALIDATION_ERROR_1e03fa01, "The spec valid usage text states 'pViewports must be a valid pointer to an array of viewportCount VkViewport structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-pViewports-parameter)"}, + {VALIDATION_ERROR_1e200a54, "The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-None-01322)"}, + {VALIDATION_ERROR_1e200a56, "The spec valid usage text states 'firstViewport must be less than VkPhysicalDeviceLimits::maxViewports' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-firstViewport-01323)"}, + {VALIDATION_ERROR_1e200a58, "The spec valid usage text states 'The sum of firstViewport and viewportCount must be between 1 and VkPhysicalDeviceLimits::maxViewports, inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-firstViewport-01324)"}, + {VALIDATION_ERROR_1e202401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-commandBuffer-parameter)"}, + {VALIDATION_ERROR_1e202413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-commandBuffer-recording)"}, + {VALIDATION_ERROR_1e202415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-commandBuffer-cmdpool)"}, + {VALIDATION_ERROR_1e230a1b, "The spec valid usage text states 'viewportCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-viewportCount-arraylength)"}, + {VALIDATION_ERROR_1e23fc01, "The spec valid usage text states 'pViewportWScalings must be a valid pointer to an array of viewportCount VkViewportWScalingNV structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetViewportWScalingNV-pViewportWScalings-parameter)"}, {VALIDATION_ERROR_1e400009, "The spec valid usage text states 'Both of commandBuffer, and dstBuffer must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-commonparent)"}, {VALIDATION_ERROR_1e400017, "The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-renderpass)"}, {VALIDATION_ERROR_1e400040, "The spec valid usage text states 'dstOffset must be less than the size of dstBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-dstOffset-00032)"}, @@ -6273,6 +6533,8 @@ {VALIDATION_ERROR_1e400048, "The spec valid usage text states 'dstOffset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-dstOffset-00036)"}, {VALIDATION_ERROR_1e40004a, "The spec valid usage text states 'dataSize must be less than or equal to 65536' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-dataSize-00037)"}, {VALIDATION_ERROR_1e40004c, "The spec valid usage text states 'dataSize must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-dataSize-00038)"}, + {VALIDATION_ERROR_1e400e2a, "The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstBuffer must not be a protected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdUpdateBuffer-commandBuffer-01813)"}, + {VALIDATION_ERROR_1e400e2c, "The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstBuffer must not be an unprotected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdUpdateBuffer-commandBuffer-01814)"}, {VALIDATION_ERROR_1e402401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-commandBuffer-parameter)"}, {VALIDATION_ERROR_1e402413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-commandBuffer-recording)"}, {VALIDATION_ERROR_1e402415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdUpdateBuffer-commandBuffer-cmdpool)"}, @@ -6313,10 +6575,10 @@ {VALIDATION_ERROR_1e802415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWriteTimestamp-commandBuffer-cmdpool)"}, {VALIDATION_ERROR_1e828401, "The spec valid usage text states 'pipelineStage must be a valid VkPipelineStageFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWriteTimestamp-pipelineStage-parameter)"}, {VALIDATION_ERROR_1e829801, "The spec valid usage text states 'queryPool must be a valid VkQueryPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdWriteTimestamp-queryPool-parameter)"}, - {VALIDATION_ERROR_1ea0bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateAndroidSurfaceKHR-instance-parameter)"}, - {VALIDATION_ERROR_1ea0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateAndroidSurfaceKHR-pAllocator-parameter)"}, - {VALIDATION_ERROR_1ea11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkAndroidSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateAndroidSurfaceKHR-pCreateInfo-parameter)"}, - {VALIDATION_ERROR_1ea24801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateAndroidSurfaceKHR-pSurface-parameter)"}, + {VALIDATION_ERROR_1ea0bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateAndroidSurfaceKHR-instance-parameter)"}, + {VALIDATION_ERROR_1ea0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateAndroidSurfaceKHR-pAllocator-parameter)"}, + {VALIDATION_ERROR_1ea11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkAndroidSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateAndroidSurfaceKHR-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_1ea24801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateAndroidSurfaceKHR-pSurface-parameter)"}, {VALIDATION_ERROR_1ec0071e, "The spec valid usage text states 'If the flags member of pCreateInfo includes VK_BUFFER_CREATE_SPARSE_BINDING_BIT, creating this VkBuffer must not cause the total required sparse memory for all currently valid sparse resources on the device to exceed VkPhysicalDeviceLimits::sparseAddressSpaceSize' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateBuffer-flags-00911)"}, {VALIDATION_ERROR_1ec05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateBuffer-device-parameter)"}, {VALIDATION_ERROR_1ec0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateBuffer-pAllocator-parameter)"}, @@ -6339,10 +6601,10 @@ {VALIDATION_ERROR_1f21e201, "The spec valid usage text states 'pPipelines must be a valid pointer to an array of createInfoCount VkPipeline handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateComputePipelines-pPipelines-parameter)"}, {VALIDATION_ERROR_1f228001, "The spec valid usage text states 'If pipelineCache is not VK_NULL_HANDLE, pipelineCache must be a valid VkPipelineCache handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateComputePipelines-pipelineCache-parameter)"}, {VALIDATION_ERROR_1f228007, "The spec valid usage text states 'If pipelineCache is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateComputePipelines-pipelineCache-parent)"}, - {VALIDATION_ERROR_1f40bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDebugReportCallbackEXT-instance-parameter)"}, - {VALIDATION_ERROR_1f40ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDebugReportCallbackEXT-pAllocator-parameter)"}, - {VALIDATION_ERROR_1f410801, "The spec valid usage text states 'pCallback must be a valid pointer to a VkDebugReportCallbackEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDebugReportCallbackEXT-pCallback-parameter)"}, - {VALIDATION_ERROR_1f411e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDebugReportCallbackCreateInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDebugReportCallbackEXT-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_1f40bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDebugReportCallbackEXT-instance-parameter)"}, + {VALIDATION_ERROR_1f40ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDebugReportCallbackEXT-pAllocator-parameter)"}, + {VALIDATION_ERROR_1f410801, "The spec valid usage text states 'pCallback must be a valid pointer to a VkDebugReportCallbackEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDebugReportCallbackEXT-pCallback-parameter)"}, + {VALIDATION_ERROR_1f411e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDebugReportCallbackCreateInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDebugReportCallbackEXT-pCreateInfo-parameter)"}, {VALIDATION_ERROR_1f605601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorPool-device-parameter)"}, {VALIDATION_ERROR_1f60ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorPool-pAllocator-parameter)"}, {VALIDATION_ERROR_1f611e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDescriptorPoolCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorPool-pCreateInfo-parameter)"}, @@ -6351,24 +6613,24 @@ {VALIDATION_ERROR_1f80ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorSetLayout-pAllocator-parameter)"}, {VALIDATION_ERROR_1f811e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDescriptorSetLayoutCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorSetLayout-pCreateInfo-parameter)"}, {VALIDATION_ERROR_1f822a01, "The spec valid usage text states 'pSetLayout must be a valid pointer to a VkDescriptorSetLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorSetLayout-pSetLayout-parameter)"}, - {VALIDATION_ERROR_1fa05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorUpdateTemplateKHR-device-parameter)"}, - {VALIDATION_ERROR_1fa0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorUpdateTemplateKHR-pAllocator-parameter)"}, - {VALIDATION_ERROR_1fa11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDescriptorUpdateTemplateCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorUpdateTemplateKHR-pCreateInfo-parameter)"}, - {VALIDATION_ERROR_1fa13401, "The spec valid usage text states 'pDescriptorUpdateTemplate must be a valid pointer to a VkDescriptorUpdateTemplateKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDescriptorUpdateTemplateKHR-pDescriptorUpdateTemplate-parameter)"}, + {VALIDATION_ERROR_1fa05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDescriptorUpdateTemplate-device-parameter)"}, + {VALIDATION_ERROR_1fa0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDescriptorUpdateTemplate-pAllocator-parameter)"}, + {VALIDATION_ERROR_1fa11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDescriptorUpdateTemplateCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDescriptorUpdateTemplate-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_1fa13401, "The spec valid usage text states 'pDescriptorUpdateTemplate must be a valid pointer to a VkDescriptorUpdateTemplate handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDescriptorUpdateTemplate-pDescriptorUpdateTemplate-parameter)"}, {VALIDATION_ERROR_1fc00ad6, "The spec valid usage text states 'All required extensions for each extension in the VkDeviceCreateInfo::ppEnabledExtensionNames list must also be present in that list.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDevice-ppEnabledExtensionNames-01387)"}, {VALIDATION_ERROR_1fc0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDevice-pAllocator-parameter)"}, {VALIDATION_ERROR_1fc11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDeviceCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDevice-pCreateInfo-parameter)"}, {VALIDATION_ERROR_1fc13801, "The spec valid usage text states 'pDevice must be a valid pointer to a VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDevice-pDevice-parameter)"}, {VALIDATION_ERROR_1fc27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDevice-physicalDevice-parameter)"}, - {VALIDATION_ERROR_1fe06001, "The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDisplayModeKHR-display-parameter)"}, - {VALIDATION_ERROR_1fe0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDisplayModeKHR-pAllocator-parameter)"}, - {VALIDATION_ERROR_1fe11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDisplayModeCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDisplayModeKHR-pCreateInfo-parameter)"}, - {VALIDATION_ERROR_1fe1bc01, "The spec valid usage text states 'pMode must be a valid pointer to a VkDisplayModeKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDisplayModeKHR-pMode-parameter)"}, - {VALIDATION_ERROR_1fe27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDisplayModeKHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2000bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDisplayPlaneSurfaceKHR-instance-parameter)"}, - {VALIDATION_ERROR_2000ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDisplayPlaneSurfaceKHR-pAllocator-parameter)"}, - {VALIDATION_ERROR_20011e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDisplaySurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDisplayPlaneSurfaceKHR-pCreateInfo-parameter)"}, - {VALIDATION_ERROR_20024801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateDisplayPlaneSurfaceKHR-pSurface-parameter)"}, + {VALIDATION_ERROR_1fe06001, "The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDisplayModeKHR-display-parameter)"}, + {VALIDATION_ERROR_1fe0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDisplayModeKHR-pAllocator-parameter)"}, + {VALIDATION_ERROR_1fe11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDisplayModeCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDisplayModeKHR-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_1fe1bc01, "The spec valid usage text states 'pMode must be a valid pointer to a VkDisplayModeKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDisplayModeKHR-pMode-parameter)"}, + {VALIDATION_ERROR_1fe27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDisplayModeKHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2000bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDisplayPlaneSurfaceKHR-instance-parameter)"}, + {VALIDATION_ERROR_2000ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDisplayPlaneSurfaceKHR-pAllocator-parameter)"}, + {VALIDATION_ERROR_20011e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDisplaySurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDisplayPlaneSurfaceKHR-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_20024801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDisplayPlaneSurfaceKHR-pSurface-parameter)"}, {VALIDATION_ERROR_20205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateEvent-device-parameter)"}, {VALIDATION_ERROR_2020ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateEvent-pAllocator-parameter)"}, {VALIDATION_ERROR_20211e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkEventCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateEvent-pCreateInfo-parameter)"}, @@ -6390,10 +6652,10 @@ {VALIDATION_ERROR_2081e201, "The spec valid usage text states 'pPipelines must be a valid pointer to an array of createInfoCount VkPipeline handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateGraphicsPipelines-pPipelines-parameter)"}, {VALIDATION_ERROR_20828001, "The spec valid usage text states 'If pipelineCache is not VK_NULL_HANDLE, pipelineCache must be a valid VkPipelineCache handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateGraphicsPipelines-pipelineCache-parameter)"}, {VALIDATION_ERROR_20828007, "The spec valid usage text states 'If pipelineCache is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateGraphicsPipelines-pipelineCache-parent)"}, - {VALIDATION_ERROR_20a0bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateIOSSurfaceMVK-instance-parameter)"}, - {VALIDATION_ERROR_20a0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateIOSSurfaceMVK-pAllocator-parameter)"}, - {VALIDATION_ERROR_20a11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkIOSSurfaceCreateInfoMVK structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateIOSSurfaceMVK-pCreateInfo-parameter)"}, - {VALIDATION_ERROR_20a24801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateIOSSurfaceMVK-pSurface-parameter)"}, + {VALIDATION_ERROR_20a0bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateIOSSurfaceMVK-instance-parameter)"}, + {VALIDATION_ERROR_20a0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateIOSSurfaceMVK-pAllocator-parameter)"}, + {VALIDATION_ERROR_20a11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkIOSSurfaceCreateInfoMVK structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateIOSSurfaceMVK-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_20a24801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateIOSSurfaceMVK-pSurface-parameter)"}, {VALIDATION_ERROR_20c00756, "The spec valid usage text states 'If the flags member of pCreateInfo includes VK_IMAGE_CREATE_SPARSE_BINDING_BIT, creating this VkImage must not cause the total required sparse memory for all currently valid sparse resources on the device to exceed VkPhysicalDeviceLimits::sparseAddressSpaceSize' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateImage-flags-00939)"}, {VALIDATION_ERROR_20c05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateImage-device-parameter)"}, {VALIDATION_ERROR_20c0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateImage-pAllocator-parameter)"}, @@ -6403,26 +6665,26 @@ {VALIDATION_ERROR_20e0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateImageView-pAllocator-parameter)"}, {VALIDATION_ERROR_20e11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkImageViewCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateImageView-pCreateInfo-parameter)"}, {VALIDATION_ERROR_20e26a01, "The spec valid usage text states 'pView must be a valid pointer to a VkImageView handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateImageView-pView-parameter)"}, - {VALIDATION_ERROR_21005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateIndirectCommandsLayoutNVX-device-parameter)"}, - {VALIDATION_ERROR_2100ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateIndirectCommandsLayoutNVX-pAllocator-parameter)"}, - {VALIDATION_ERROR_21011e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkIndirectCommandsLayoutCreateInfoNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateIndirectCommandsLayoutNVX-pCreateInfo-parameter)"}, - {VALIDATION_ERROR_21019201, "The spec valid usage text states 'pIndirectCommandsLayout must be a valid pointer to a VkIndirectCommandsLayoutNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateIndirectCommandsLayoutNVX-pIndirectCommandsLayout-parameter)"}, + {VALIDATION_ERROR_21005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateIndirectCommandsLayoutNVX-device-parameter)"}, + {VALIDATION_ERROR_2100ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateIndirectCommandsLayoutNVX-pAllocator-parameter)"}, + {VALIDATION_ERROR_21011e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkIndirectCommandsLayoutCreateInfoNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateIndirectCommandsLayoutNVX-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_21019201, "The spec valid usage text states 'pIndirectCommandsLayout must be a valid pointer to a VkIndirectCommandsLayoutNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateIndirectCommandsLayoutNVX-pIndirectCommandsLayout-parameter)"}, {VALIDATION_ERROR_21200ad8, "The spec valid usage text states 'All required extensions for each extension in the VkInstanceCreateInfo::ppEnabledExtensionNames list must also be present in that list.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateInstance-ppEnabledExtensionNames-01388)"}, {VALIDATION_ERROR_2120ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateInstance-pAllocator-parameter)"}, {VALIDATION_ERROR_21211e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkInstanceCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateInstance-pCreateInfo-parameter)"}, {VALIDATION_ERROR_21219c01, "The spec valid usage text states 'pInstance must be a valid pointer to a VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateInstance-pInstance-parameter)"}, - {VALIDATION_ERROR_2140bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateMacOSSurfaceMVK-instance-parameter)"}, - {VALIDATION_ERROR_2140ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateMacOSSurfaceMVK-pAllocator-parameter)"}, - {VALIDATION_ERROR_21411e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkMacOSSurfaceCreateInfoMVK structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateMacOSSurfaceMVK-pCreateInfo-parameter)"}, - {VALIDATION_ERROR_21424801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateMacOSSurfaceMVK-pSurface-parameter)"}, - {VALIDATION_ERROR_2160bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateMirSurfaceKHR-instance-parameter)"}, - {VALIDATION_ERROR_2160ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateMirSurfaceKHR-pAllocator-parameter)"}, - {VALIDATION_ERROR_21611e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkMirSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateMirSurfaceKHR-pCreateInfo-parameter)"}, - {VALIDATION_ERROR_21624801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateMirSurfaceKHR-pSurface-parameter)"}, - {VALIDATION_ERROR_21805601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateObjectTableNVX-device-parameter)"}, - {VALIDATION_ERROR_2180ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateObjectTableNVX-pAllocator-parameter)"}, - {VALIDATION_ERROR_21811e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkObjectTableCreateInfoNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateObjectTableNVX-pCreateInfo-parameter)"}, - {VALIDATION_ERROR_2181d001, "The spec valid usage text states 'pObjectTable must be a valid pointer to a VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateObjectTableNVX-pObjectTable-parameter)"}, + {VALIDATION_ERROR_2140bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateMacOSSurfaceMVK-instance-parameter)"}, + {VALIDATION_ERROR_2140ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateMacOSSurfaceMVK-pAllocator-parameter)"}, + {VALIDATION_ERROR_21411e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkMacOSSurfaceCreateInfoMVK structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateMacOSSurfaceMVK-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_21424801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateMacOSSurfaceMVK-pSurface-parameter)"}, + {VALIDATION_ERROR_2160bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateMirSurfaceKHR-instance-parameter)"}, + {VALIDATION_ERROR_2160ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateMirSurfaceKHR-pAllocator-parameter)"}, + {VALIDATION_ERROR_21611e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkMirSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateMirSurfaceKHR-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_21624801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateMirSurfaceKHR-pSurface-parameter)"}, + {VALIDATION_ERROR_21805601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateObjectTableNVX-device-parameter)"}, + {VALIDATION_ERROR_2180ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateObjectTableNVX-pAllocator-parameter)"}, + {VALIDATION_ERROR_21811e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkObjectTableCreateInfoNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateObjectTableNVX-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_2181d001, "The spec valid usage text states 'pObjectTable must be a valid pointer to a VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateObjectTableNVX-pObjectTable-parameter)"}, {VALIDATION_ERROR_21a05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreatePipelineCache-device-parameter)"}, {VALIDATION_ERROR_21a0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreatePipelineCache-pAllocator-parameter)"}, {VALIDATION_ERROR_21a11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkPipelineCacheCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreatePipelineCache-pCreateInfo-parameter)"}, @@ -6451,50 +6713,47 @@ {VALIDATION_ERROR_2260ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateShaderModule-pAllocator-parameter)"}, {VALIDATION_ERROR_22611e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkShaderModuleCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateShaderModule-pCreateInfo-parameter)"}, {VALIDATION_ERROR_22622e01, "The spec valid usage text states 'pShaderModule must be a valid pointer to a VkShaderModule handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateShaderModule-pShaderModule-parameter)"}, - {VALIDATION_ERROR_22805601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-device-parameter)"}, - {VALIDATION_ERROR_2280ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-pAllocator-parameter)"}, - {VALIDATION_ERROR_22812001, "The spec valid usage text states 'pCreateInfos must be a valid pointer to an array of swapchainCount valid VkSwapchainCreateInfoKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-pCreateInfos-parameter)"}, - {VALIDATION_ERROR_22825801, "The spec valid usage text states 'pSwapchains must be a valid pointer to an array of swapchainCount VkSwapchainKHR handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-pSwapchains-parameter)"}, - {VALIDATION_ERROR_2282f21b, "The spec valid usage text states 'swapchainCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-swapchainCount-arraylength)"}, - {VALIDATION_ERROR_22a05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSwapchainKHR-device-parameter)"}, - {VALIDATION_ERROR_22a0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSwapchainKHR-pAllocator-parameter)"}, - {VALIDATION_ERROR_22a11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkSwapchainCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSwapchainKHR-pCreateInfo-parameter)"}, - {VALIDATION_ERROR_22a25201, "The spec valid usage text states 'pSwapchain must be a valid pointer to a VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSwapchainKHR-pSwapchain-parameter)"}, - {VALIDATION_ERROR_22c0bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateViSurfaceNN-instance-parameter)"}, - {VALIDATION_ERROR_22c0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateViSurfaceNN-pAllocator-parameter)"}, - {VALIDATION_ERROR_22c11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkViSurfaceCreateInfoNN structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateViSurfaceNN-pCreateInfo-parameter)"}, - {VALIDATION_ERROR_22c24801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateViSurfaceNN-pSurface-parameter)"}, - {VALIDATION_ERROR_22e0bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateWaylandSurfaceKHR-instance-parameter)"}, - {VALIDATION_ERROR_22e0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateWaylandSurfaceKHR-pAllocator-parameter)"}, - {VALIDATION_ERROR_22e11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkWaylandSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateWaylandSurfaceKHR-pCreateInfo-parameter)"}, - {VALIDATION_ERROR_22e24801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateWaylandSurfaceKHR-pSurface-parameter)"}, - {VALIDATION_ERROR_2300bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateWin32SurfaceKHR-instance-parameter)"}, - {VALIDATION_ERROR_2300ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateWin32SurfaceKHR-pAllocator-parameter)"}, - {VALIDATION_ERROR_23011e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkWin32SurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateWin32SurfaceKHR-pCreateInfo-parameter)"}, - {VALIDATION_ERROR_23024801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateWin32SurfaceKHR-pSurface-parameter)"}, - {VALIDATION_ERROR_2320bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateXcbSurfaceKHR-instance-parameter)"}, - {VALIDATION_ERROR_2320ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateXcbSurfaceKHR-pAllocator-parameter)"}, - {VALIDATION_ERROR_23211e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkXcbSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateXcbSurfaceKHR-pCreateInfo-parameter)"}, - {VALIDATION_ERROR_23224801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateXcbSurfaceKHR-pSurface-parameter)"}, - {VALIDATION_ERROR_2340bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateXlibSurfaceKHR-instance-parameter)"}, - {VALIDATION_ERROR_2340ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateXlibSurfaceKHR-pAllocator-parameter)"}, - {VALIDATION_ERROR_23411e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkXlibSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateXlibSurfaceKHR-pCreateInfo-parameter)"}, - {VALIDATION_ERROR_23424801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateXlibSurfaceKHR-pSurface-parameter)"}, - {VALIDATION_ERROR_236009a8, "The spec valid usage text states 'pNameInfo.object must be a Vulkan object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugMarkerSetObjectNameEXT-pNameInfo-01236)"}, - {VALIDATION_ERROR_23605601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugMarkerSetObjectNameEXT-device-parameter)"}, - {VALIDATION_ERROR_2361c201, "The spec valid usage text states 'pNameInfo must be a valid pointer to a valid VkDebugMarkerObjectNameInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugMarkerSetObjectNameEXT-pNameInfo-parameter)"}, - {VALIDATION_ERROR_238009aa, "The spec valid usage text states 'pTagInfo.object must be a Vulkan object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugMarkerSetObjectTagEXT-pTagInfo-01237)"}, - {VALIDATION_ERROR_238009ac, "The spec valid usage text states 'pTagInfo.tagName must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugMarkerSetObjectTagEXT-pTagInfo-01238)"}, - {VALIDATION_ERROR_23805601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugMarkerSetObjectTagEXT-device-parameter)"}, - {VALIDATION_ERROR_23825c01, "The spec valid usage text states 'pTagInfo must be a valid pointer to a valid VkDebugMarkerObjectTagInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugMarkerSetObjectTagEXT-pTagInfo-parameter)"}, - {VALIDATION_ERROR_23a009b2, "The spec valid usage text states 'object must be a Vulkan object or VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugReportMessageEXT-object-01241)"}, - {VALIDATION_ERROR_23a00bb4, "The spec valid usage text states 'If objectType is not VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT and object is not VK_NULL_HANDLE, object must be a Vulkan object of the corresponding type associated with objectType as defined in VkDebugReportObjectTypeEXT and Vulkan Handle Relationship.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugReportMessageEXT-objectType-01498)"}, - {VALIDATION_ERROR_23a09001, "The spec valid usage text states 'flags must be a valid combination of VkDebugReportFlagBitsEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugReportMessageEXT-flags-parameter)"}, - {VALIDATION_ERROR_23a09003, "The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugReportMessageEXT-flags-requiredbitmask)"}, - {VALIDATION_ERROR_23a0bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugReportMessageEXT-instance-parameter)"}, - {VALIDATION_ERROR_23a0da01, "The spec valid usage text states 'objectType must be a valid VkDebugReportObjectTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugReportMessageEXT-objectType-parameter)"}, - {VALIDATION_ERROR_23a1a001, "The spec valid usage text states 'pLayerPrefix must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugReportMessageEXT-pLayerPrefix-parameter)"}, - {VALIDATION_ERROR_23a1b801, "The spec valid usage text states 'pMessage must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDebugReportMessageEXT-pMessage-parameter)"}, + {VALIDATION_ERROR_22805601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-device-parameter)"}, + {VALIDATION_ERROR_2280ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-pAllocator-parameter)"}, + {VALIDATION_ERROR_22812001, "The spec valid usage text states 'pCreateInfos must be a valid pointer to an array of swapchainCount valid VkSwapchainCreateInfoKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-pCreateInfos-parameter)"}, + {VALIDATION_ERROR_22825801, "The spec valid usage text states 'pSwapchains must be a valid pointer to an array of swapchainCount VkSwapchainKHR handles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-pSwapchains-parameter)"}, + {VALIDATION_ERROR_2282f21b, "The spec valid usage text states 'swapchainCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSharedSwapchainsKHR-swapchainCount-arraylength)"}, + {VALIDATION_ERROR_22a05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSwapchainKHR-device-parameter)"}, + {VALIDATION_ERROR_22a0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSwapchainKHR-pAllocator-parameter)"}, + {VALIDATION_ERROR_22a11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkSwapchainCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSwapchainKHR-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_22a25201, "The spec valid usage text states 'pSwapchain must be a valid pointer to a VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSwapchainKHR-pSwapchain-parameter)"}, + {VALIDATION_ERROR_22c0bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateViSurfaceNN-instance-parameter)"}, + {VALIDATION_ERROR_22c0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateViSurfaceNN-pAllocator-parameter)"}, + {VALIDATION_ERROR_22c11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkViSurfaceCreateInfoNN structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateViSurfaceNN-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_22c24801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateViSurfaceNN-pSurface-parameter)"}, + {VALIDATION_ERROR_22e0bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateWaylandSurfaceKHR-instance-parameter)"}, + {VALIDATION_ERROR_22e0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateWaylandSurfaceKHR-pAllocator-parameter)"}, + {VALIDATION_ERROR_22e11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkWaylandSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateWaylandSurfaceKHR-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_22e24801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateWaylandSurfaceKHR-pSurface-parameter)"}, + {VALIDATION_ERROR_2300bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateWin32SurfaceKHR-instance-parameter)"}, + {VALIDATION_ERROR_2300ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateWin32SurfaceKHR-pAllocator-parameter)"}, + {VALIDATION_ERROR_23011e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkWin32SurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateWin32SurfaceKHR-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_23024801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateWin32SurfaceKHR-pSurface-parameter)"}, + {VALIDATION_ERROR_2320bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateXcbSurfaceKHR-instance-parameter)"}, + {VALIDATION_ERROR_2320ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateXcbSurfaceKHR-pAllocator-parameter)"}, + {VALIDATION_ERROR_23211e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkXcbSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateXcbSurfaceKHR-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_23224801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateXcbSurfaceKHR-pSurface-parameter)"}, + {VALIDATION_ERROR_2340bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateXlibSurfaceKHR-instance-parameter)"}, + {VALIDATION_ERROR_2340ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateXlibSurfaceKHR-pAllocator-parameter)"}, + {VALIDATION_ERROR_23411e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkXlibSurfaceCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateXlibSurfaceKHR-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_23424801, "The spec valid usage text states 'pSurface must be a valid pointer to a VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateXlibSurfaceKHR-pSurface-parameter)"}, + {VALIDATION_ERROR_23605601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugMarkerSetObjectNameEXT-device-parameter)"}, + {VALIDATION_ERROR_2361c201, "The spec valid usage text states 'pNameInfo must be a valid pointer to a valid VkDebugMarkerObjectNameInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugMarkerSetObjectNameEXT-pNameInfo-parameter)"}, + {VALIDATION_ERROR_23805601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugMarkerSetObjectTagEXT-device-parameter)"}, + {VALIDATION_ERROR_23825c01, "The spec valid usage text states 'pTagInfo must be a valid pointer to a valid VkDebugMarkerObjectTagInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugMarkerSetObjectTagEXT-pTagInfo-parameter)"}, + {VALIDATION_ERROR_23a009b2, "The spec valid usage text states 'object must be a Vulkan object or VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugReportMessageEXT-object-01241)"}, + {VALIDATION_ERROR_23a00bb4, "The spec valid usage text states 'If objectType is not VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT and object is not VK_NULL_HANDLE, object must be a Vulkan object of the corresponding type associated with objectType as defined in debug-report-object-types.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugReportMessageEXT-objectType-01498)"}, + {VALIDATION_ERROR_23a09001, "The spec valid usage text states 'flags must be a valid combination of VkDebugReportFlagBitsEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugReportMessageEXT-flags-parameter)"}, + {VALIDATION_ERROR_23a09003, "The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugReportMessageEXT-flags-requiredbitmask)"}, + {VALIDATION_ERROR_23a0bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugReportMessageEXT-instance-parameter)"}, + {VALIDATION_ERROR_23a0da01, "The spec valid usage text states 'objectType must be a valid VkDebugReportObjectTypeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugReportMessageEXT-objectType-parameter)"}, + {VALIDATION_ERROR_23a1a001, "The spec valid usage text states 'pLayerPrefix must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugReportMessageEXT-pLayerPrefix-parameter)"}, + {VALIDATION_ERROR_23a1b801, "The spec valid usage text states 'pMessage must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDebugReportMessageEXT-pMessage-parameter)"}, {VALIDATION_ERROR_23c00734, "The spec valid usage text states 'All submitted commands that refer to buffer, either directly or via a VkBufferView, must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyBuffer-buffer-00922)"}, {VALIDATION_ERROR_23c00736, "The spec valid usage text states 'If VkAllocationCallbacks were provided when buffer was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyBuffer-buffer-00923)"}, {VALIDATION_ERROR_23c00738, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when buffer was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyBuffer-buffer-00924)"}, @@ -6516,12 +6775,12 @@ {VALIDATION_ERROR_24002807, "The spec valid usage text states 'If commandPool is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyCommandPool-commandPool-parent)"}, {VALIDATION_ERROR_24005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyCommandPool-device-parameter)"}, {VALIDATION_ERROR_2400ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyCommandPool-pAllocator-parameter)"}, - {VALIDATION_ERROR_242009b4, "The spec valid usage text states 'If VkAllocationCallbacks were provided when callback was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-instance-01242)"}, - {VALIDATION_ERROR_242009b6, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when callback was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-instance-01243)"}, - {VALIDATION_ERROR_24201e01, "The spec valid usage text states 'callback must be a valid VkDebugReportCallbackEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-callback-parameter)"}, - {VALIDATION_ERROR_24201e07, "The spec valid usage text states 'callback must have been created, allocated, or retrieved from instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-callback-parent)"}, - {VALIDATION_ERROR_2420bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-instance-parameter)"}, - {VALIDATION_ERROR_2420ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-pAllocator-parameter)"}, + {VALIDATION_ERROR_242009b4, "The spec valid usage text states 'If VkAllocationCallbacks were provided when callback was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-instance-01242)"}, + {VALIDATION_ERROR_242009b6, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when callback was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-instance-01243)"}, + {VALIDATION_ERROR_24201e01, "The spec valid usage text states 'callback must be a valid VkDebugReportCallbackEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-callback-parameter)"}, + {VALIDATION_ERROR_24201e07, "The spec valid usage text states 'callback must have been created, allocated, or retrieved from instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-callback-parent)"}, + {VALIDATION_ERROR_2420bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-instance-parameter)"}, + {VALIDATION_ERROR_2420ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugReportCallbackEXT-pAllocator-parameter)"}, {VALIDATION_ERROR_2440025e, "The spec valid usage text states 'All submitted commands that refer to descriptorPool (via any allocated descriptor sets) must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorPool-descriptorPool-00303)"}, {VALIDATION_ERROR_24400260, "The spec valid usage text states 'If VkAllocationCallbacks were provided when descriptorPool was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorPool-descriptorPool-00304)"}, {VALIDATION_ERROR_24400262, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when descriptorPool was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorPool-descriptorPool-00305)"}, @@ -6535,12 +6794,12 @@ {VALIDATION_ERROR_24604c07, "The spec valid usage text states 'If descriptorSetLayout is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorSetLayout-descriptorSetLayout-parent)"}, {VALIDATION_ERROR_24605601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorSetLayout-device-parameter)"}, {VALIDATION_ERROR_2460ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorSetLayout-pAllocator-parameter)"}, - {VALIDATION_ERROR_248002c8, "The spec valid usage text states 'If VkAllocationCallbacks were provided when descriptorSetLayout was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplateKHR-descriptorSetLayout-00356)"}, - {VALIDATION_ERROR_248002ca, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when descriptorSetLayout was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplateKHR-descriptorSetLayout-00357)"}, - {VALIDATION_ERROR_24805201, "The spec valid usage text states 'If descriptorUpdateTemplate is not VK_NULL_HANDLE, descriptorUpdateTemplate must be a valid VkDescriptorUpdateTemplateKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplateKHR-descriptorUpdateTemplate-parameter)"}, - {VALIDATION_ERROR_24805207, "The spec valid usage text states 'If descriptorUpdateTemplate is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplateKHR-descriptorUpdateTemplate-parent)"}, - {VALIDATION_ERROR_24805601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplateKHR-device-parameter)"}, - {VALIDATION_ERROR_2480ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplateKHR-pAllocator-parameter)"}, + {VALIDATION_ERROR_248002c8, "The spec valid usage text states 'If VkAllocationCallbacks were provided when descriptorSetLayout was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplate-descriptorSetLayout-00356)"}, + {VALIDATION_ERROR_248002ca, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when descriptorSetLayout was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplate-descriptorSetLayout-00357)"}, + {VALIDATION_ERROR_24805201, "The spec valid usage text states 'If descriptorUpdateTemplate is not VK_NULL_HANDLE, descriptorUpdateTemplate must be a valid VkDescriptorUpdateTemplate handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplate-descriptorUpdateTemplate-parameter)"}, + {VALIDATION_ERROR_24805207, "The spec valid usage text states 'If descriptorUpdateTemplate is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplate-descriptorUpdateTemplate-parent)"}, + {VALIDATION_ERROR_24805601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplate-device-parameter)"}, + {VALIDATION_ERROR_2480ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDescriptorUpdateTemplate-pAllocator-parameter)"}, {VALIDATION_ERROR_24a002f4, "The spec valid usage text states 'All child objects created on device must have been destroyed prior to destroying device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDevice-device-00378)"}, {VALIDATION_ERROR_24a002f6, "The spec valid usage text states 'If VkAllocationCallbacks were provided when device was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDevice-device-00379)"}, {VALIDATION_ERROR_24a002f8, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when device was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDevice-device-00380)"}, @@ -6581,25 +6840,25 @@ {VALIDATION_ERROR_2540b001, "The spec valid usage text states 'If imageView is not VK_NULL_HANDLE, imageView must be a valid VkImageView handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyImageView-imageView-parameter)"}, {VALIDATION_ERROR_2540b007, "The spec valid usage text states 'If imageView is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyImageView-imageView-parent)"}, {VALIDATION_ERROR_2540ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyImageView-pAllocator-parameter)"}, - {VALIDATION_ERROR_25600a90, "The spec valid usage text states 'All submitted commands that refer to indirectCommandsLayout must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-01352)"}, - {VALIDATION_ERROR_25600a92, "The spec valid usage text states 'If VkAllocationCallbacks were provided when objectTable was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-objectTable-01353)"}, - {VALIDATION_ERROR_25600a94, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when objectTable was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-objectTable-01354)"}, - {VALIDATION_ERROR_25605601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-device-parameter)"}, - {VALIDATION_ERROR_2560b401, "The spec valid usage text states 'indirectCommandsLayout must be a valid VkIndirectCommandsLayoutNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-parameter)"}, - {VALIDATION_ERROR_2560b407, "The spec valid usage text states 'indirectCommandsLayout must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-parent)"}, - {VALIDATION_ERROR_2560ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-pAllocator-parameter)"}, + {VALIDATION_ERROR_25600a90, "The spec valid usage text states 'All submitted commands that refer to indirectCommandsLayout must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-01352)"}, + {VALIDATION_ERROR_25600a92, "The spec valid usage text states 'If VkAllocationCallbacks were provided when objectTable was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-objectTable-01353)"}, + {VALIDATION_ERROR_25600a94, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when objectTable was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-objectTable-01354)"}, + {VALIDATION_ERROR_25605601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-device-parameter)"}, + {VALIDATION_ERROR_2560b401, "The spec valid usage text states 'indirectCommandsLayout must be a valid VkIndirectCommandsLayoutNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-parameter)"}, + {VALIDATION_ERROR_2560b407, "The spec valid usage text states 'indirectCommandsLayout must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-parent)"}, + {VALIDATION_ERROR_2560ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyIndirectCommandsLayoutNVX-pAllocator-parameter)"}, {VALIDATION_ERROR_258004ea, "The spec valid usage text states 'All child objects created using instance must have been destroyed prior to destroying instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyInstance-instance-00629)"}, {VALIDATION_ERROR_258004ec, "The spec valid usage text states 'If VkAllocationCallbacks were provided when instance was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyInstance-instance-00630)"}, {VALIDATION_ERROR_258004ee, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when instance was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyInstance-instance-00631)"}, {VALIDATION_ERROR_2580bc01, "The spec valid usage text states 'If instance is not NULL, instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyInstance-instance-parameter)"}, {VALIDATION_ERROR_2580ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyInstance-pAllocator-parameter)"}, - {VALIDATION_ERROR_25a00aa2, "The spec valid usage text states 'All submitted commands that refer to objectTable must have completed execution.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-01361)"}, - {VALIDATION_ERROR_25a00aa4, "The spec valid usage text states 'If VkAllocationCallbacks were provided when objectTable was created, a compatible set of callbacks must be provided here.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-01362)"}, - {VALIDATION_ERROR_25a00aa6, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when objectTable was created, pAllocator must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-01363)"}, - {VALIDATION_ERROR_25a05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyObjectTableNVX-device-parameter)"}, - {VALIDATION_ERROR_25a0d801, "The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-parameter)"}, - {VALIDATION_ERROR_25a0d807, "The spec valid usage text states 'objectTable must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-parent)"}, - {VALIDATION_ERROR_25a0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyObjectTableNVX-pAllocator-parameter)"}, + {VALIDATION_ERROR_25a00aa2, "The spec valid usage text states 'All submitted commands that refer to objectTable must have completed execution.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-01361)"}, + {VALIDATION_ERROR_25a00aa4, "The spec valid usage text states 'If VkAllocationCallbacks were provided when objectTable was created, a compatible set of callbacks must be provided here.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-01362)"}, + {VALIDATION_ERROR_25a00aa6, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when objectTable was created, pAllocator must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-01363)"}, + {VALIDATION_ERROR_25a05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyObjectTableNVX-device-parameter)"}, + {VALIDATION_ERROR_25a0d801, "The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-parameter)"}, + {VALIDATION_ERROR_25a0d807, "The spec valid usage text states 'objectTable must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyObjectTableNVX-objectTable-parent)"}, + {VALIDATION_ERROR_25a0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyObjectTableNVX-pAllocator-parameter)"}, {VALIDATION_ERROR_25c005fa, "The spec valid usage text states 'All submitted commands that refer to pipeline must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyPipeline-pipeline-00765)"}, {VALIDATION_ERROR_25c005fc, "The spec valid usage text states 'If VkAllocationCallbacks were provided when pipeline was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyPipeline-pipeline-00766)"}, {VALIDATION_ERROR_25c005fe, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when pipeline was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyPipeline-pipeline-00767)"}, @@ -6653,28 +6912,29 @@ {VALIDATION_ERROR_26a0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyShaderModule-pAllocator-parameter)"}, {VALIDATION_ERROR_26a2be01, "The spec valid usage text states 'If shaderModule is not VK_NULL_HANDLE, shaderModule must be a valid VkShaderModule handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyShaderModule-shaderModule-parameter)"}, {VALIDATION_ERROR_26a2be07, "The spec valid usage text states 'If shaderModule is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyShaderModule-shaderModule-parent)"}, - {VALIDATION_ERROR_26c009e4, "The spec valid usage text states 'All VkSwapchainKHR objects created for surface must have been destroyed prior to destroying surface' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-01266)"}, - {VALIDATION_ERROR_26c009e6, "The spec valid usage text states 'If VkAllocationCallbacks were provided when surface was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-01267)"}, - {VALIDATION_ERROR_26c009e8, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when surface was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-01268)"}, - {VALIDATION_ERROR_26c0bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySurfaceKHR-instance-parameter)"}, - {VALIDATION_ERROR_26c0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySurfaceKHR-pAllocator-parameter)"}, - {VALIDATION_ERROR_26c2ec01, "The spec valid usage text states 'If surface is not VK_NULL_HANDLE, surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-parameter)"}, - {VALIDATION_ERROR_26c2ec07, "The spec valid usage text states 'If surface is a valid handle, it must have been created, allocated, or retrieved from instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-parent)"}, - {VALIDATION_ERROR_26e00009, "The spec valid usage text states 'Both of device, and swapchain that are valid handles must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySwapchainKHR-commonparent)"}, - {VALIDATION_ERROR_26e00a04, "The spec valid usage text states 'All uses of presentable images acquired from swapchain must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySwapchainKHR-swapchain-01282)"}, - {VALIDATION_ERROR_26e00a06, "The spec valid usage text states 'If VkAllocationCallbacks were provided when swapchain was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySwapchainKHR-swapchain-01283)"}, - {VALIDATION_ERROR_26e00a08, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when swapchain was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySwapchainKHR-swapchain-01284)"}, - {VALIDATION_ERROR_26e05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySwapchainKHR-device-parameter)"}, - {VALIDATION_ERROR_26e0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySwapchainKHR-pAllocator-parameter)"}, - {VALIDATION_ERROR_26e2f001, "The spec valid usage text states 'If swapchain is not VK_NULL_HANDLE, swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySwapchainKHR-swapchain-parameter)"}, + {VALIDATION_ERROR_26c009e4, "The spec valid usage text states 'All VkSwapchainKHR objects created for surface must have been destroyed prior to destroying surface' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-01266)"}, + {VALIDATION_ERROR_26c009e6, "The spec valid usage text states 'If VkAllocationCallbacks were provided when surface was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-01267)"}, + {VALIDATION_ERROR_26c009e8, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when surface was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-01268)"}, + {VALIDATION_ERROR_26c0bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySurfaceKHR-instance-parameter)"}, + {VALIDATION_ERROR_26c0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySurfaceKHR-pAllocator-parameter)"}, + {VALIDATION_ERROR_26c2ec01, "The spec valid usage text states 'If surface is not VK_NULL_HANDLE, surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-parameter)"}, + {VALIDATION_ERROR_26c2ec07, "The spec valid usage text states 'If surface is a valid handle, it must have been created, allocated, or retrieved from instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySurfaceKHR-surface-parent)"}, + {VALIDATION_ERROR_26e00009, "The spec valid usage text states 'Both of device, and swapchain that are valid handles must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySwapchainKHR-commonparent)"}, + {VALIDATION_ERROR_26e00a04, "The spec valid usage text states 'All uses of presentable images acquired from swapchain must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySwapchainKHR-swapchain-01282)"}, + {VALIDATION_ERROR_26e00a06, "The spec valid usage text states 'If VkAllocationCallbacks were provided when swapchain was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySwapchainKHR-swapchain-01283)"}, + {VALIDATION_ERROR_26e00a08, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when swapchain was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySwapchainKHR-swapchain-01284)"}, + {VALIDATION_ERROR_26e05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySwapchainKHR-device-parameter)"}, + {VALIDATION_ERROR_26e0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySwapchainKHR-pAllocator-parameter)"}, + {VALIDATION_ERROR_26e2f001, "The spec valid usage text states 'If swapchain is not VK_NULL_HANDLE, swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySwapchainKHR-swapchain-parameter)"}, {VALIDATION_ERROR_27005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDeviceWaitIdle-device-parameter)"}, - {VALIDATION_ERROR_27205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDisplayPowerControlEXT-device-parameter)"}, - {VALIDATION_ERROR_27206001, "The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDisplayPowerControlEXT-display-parameter)"}, - {VALIDATION_ERROR_27214e01, "The spec valid usage text states 'pDisplayPowerInfo must be a valid pointer to a valid VkDisplayPowerInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDisplayPowerControlEXT-pDisplayPowerInfo-parameter)"}, + {VALIDATION_ERROR_27205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDisplayPowerControlEXT-device-parameter)"}, + {VALIDATION_ERROR_27206001, "The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDisplayPowerControlEXT-display-parameter)"}, + {VALIDATION_ERROR_27214e01, "The spec valid usage text states 'pDisplayPowerInfo must be a valid pointer to a valid VkDisplayPowerInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDisplayPowerControlEXT-pDisplayPowerInfo-parameter)"}, {VALIDATION_ERROR_27400076, "The spec valid usage text states 'commandBuffer must be in the recording state.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEndCommandBuffer-commandBuffer-00059)"}, {VALIDATION_ERROR_27400078, "The spec valid usage text states 'If commandBuffer is a primary command buffer, there must not be an active render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEndCommandBuffer-commandBuffer-00060)"}, {VALIDATION_ERROR_2740007a, "The spec valid usage text states 'All queries made active during the recording of commandBuffer must have been made inactive' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEndCommandBuffer-commandBuffer-00061)"}, {VALIDATION_ERROR_2740007c, "The spec valid usage text states 'If commandBuffer is a secondary command buffer, there must not be an outstanding vkCmdDebugMarkerBeginEXT command recorded to commandBuffer that has not previously been ended by a call to vkCmdDebugMarkerEndEXT.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkEndCommandBuffer-commandBuffer-00062)"}, + {VALIDATION_ERROR_27400e2e, "The spec valid usage text states 'If commandBuffer is a secondary command buffer, there must not be an outstanding vkCmdBeginDebugUtilsLabelEXT command recorded to commandBuffer that has not previously been ended by a call to vkCmdEndDebugUtilsLabelEXT.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkEndCommandBuffer-commandBuffer-01815)"}, {VALIDATION_ERROR_27402401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEndCommandBuffer-commandBuffer-parameter)"}, {VALIDATION_ERROR_27619e01, "The spec valid usage text states 'If pLayerName is not NULL, pLayerName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumerateDeviceExtensionProperties-pLayerName-parameter)"}, {VALIDATION_ERROR_2761f401, "The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkExtensionProperties structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumerateDeviceExtensionProperties-pProperties-parameter)"}, @@ -6688,9 +6948,9 @@ {VALIDATION_ERROR_27a1f601, "The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumerateInstanceExtensionProperties-pPropertyCount-parameter)"}, {VALIDATION_ERROR_27c1f401, "The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkLayerProperties structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumerateInstanceLayerProperties-pProperties-parameter)"}, {VALIDATION_ERROR_27c1f601, "The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumerateInstanceLayerProperties-pPropertyCount-parameter)"}, - {VALIDATION_ERROR_27e0bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumeratePhysicalDeviceGroupsKHX-instance-parameter)"}, - {VALIDATION_ERROR_27e1d801, "The spec valid usage text states 'pPhysicalDeviceGroupCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumeratePhysicalDeviceGroupsKHX-pPhysicalDeviceGroupCount-parameter)"}, - {VALIDATION_ERROR_27e1da01, "The spec valid usage text states 'If the value referenced by pPhysicalDeviceGroupCount is not 0, and pPhysicalDeviceGroupProperties is not NULL, pPhysicalDeviceGroupProperties must be a valid pointer to an array of pPhysicalDeviceGroupCount VkPhysicalDeviceGroupPropertiesKHX structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumeratePhysicalDeviceGroupsKHX-pPhysicalDeviceGroupProperties-parameter)"}, + {VALIDATION_ERROR_27e0bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkEnumeratePhysicalDeviceGroups-instance-parameter)"}, + {VALIDATION_ERROR_27e1d801, "The spec valid usage text states 'pPhysicalDeviceGroupCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkEnumeratePhysicalDeviceGroups-pPhysicalDeviceGroupCount-parameter)"}, + {VALIDATION_ERROR_27e1da01, "The spec valid usage text states 'If the value referenced by pPhysicalDeviceGroupCount is not 0, and pPhysicalDeviceGroupProperties is not NULL, pPhysicalDeviceGroupProperties must be a valid pointer to an array of pPhysicalDeviceGroupCount VkPhysicalDeviceGroupProperties structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkEnumeratePhysicalDeviceGroups-pPhysicalDeviceGroupProperties-parameter)"}, {VALIDATION_ERROR_2800bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumeratePhysicalDevices-instance-parameter)"}, {VALIDATION_ERROR_2801d601, "The spec valid usage text states 'pPhysicalDeviceCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumeratePhysicalDevices-pPhysicalDeviceCount-parameter)"}, {VALIDATION_ERROR_2801dc01, "The spec valid usage text states 'If the value referenced by pPhysicalDeviceCount is not 0, and pPhysicalDevices is not NULL, pPhysicalDevices must be a valid pointer to an array of pPhysicalDeviceCount VkPhysicalDevice handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkEnumeratePhysicalDevices-pPhysicalDevices-parameter)"}, @@ -6722,20 +6982,19 @@ {VALIDATION_ERROR_28a01a07, "The spec valid usage text states 'buffer must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetBufferMemoryRequirements-buffer-parent)"}, {VALIDATION_ERROR_28a05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetBufferMemoryRequirements-device-parameter)"}, {VALIDATION_ERROR_28a1b401, "The spec valid usage text states 'pMemoryRequirements must be a valid pointer to a VkMemoryRequirements structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetBufferMemoryRequirements-pMemoryRequirements-parameter)"}, - {VALIDATION_ERROR_28c00566, "The spec valid usage text states 'heapIndex must be less than memoryHeapCount' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-heapIndex-00691)"}, - {VALIDATION_ERROR_28c00568, "The spec valid usage text states 'localDeviceIndex must be a valid device index' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-localDeviceIndex-00692)"}, - {VALIDATION_ERROR_28c0056a, "The spec valid usage text states 'remoteDeviceIndex must be a valid device index' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-remoteDeviceIndex-00693)"}, - {VALIDATION_ERROR_28c0056c, "The spec valid usage text states 'localDeviceIndex must not equal remoteDeviceIndex' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-localDeviceIndex-00694)"}, - {VALIDATION_ERROR_28c05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-device-parameter)"}, - {VALIDATION_ERROR_28c1d401, "The spec valid usage text states 'pPeerMemoryFeatures must be a valid pointer to a VkPeerMemoryFeatureFlagsKHX value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-pPeerMemoryFeatures-parameter)"}, - {VALIDATION_ERROR_28c1d403, "The spec valid usage text states 'pPeerMemoryFeatures must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeaturesKHX-pPeerMemoryFeatures-requiredbitmask)"}, - {VALIDATION_ERROR_28e05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupPresentCapabilitiesKHX-device-parameter)"}, - {VALIDATION_ERROR_28e13c01, "The spec valid usage text states 'pDeviceGroupPresentCapabilities must be a valid pointer to a VkDeviceGroupPresentCapabilitiesKHX structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupPresentCapabilitiesKHX-pDeviceGroupPresentCapabilities-parameter)"}, - {VALIDATION_ERROR_29000009, "The spec valid usage text states 'Both of device, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupSurfacePresentModesKHX-commonparent)"}, - {VALIDATION_ERROR_29005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupSurfacePresentModesKHX-device-parameter)"}, - {VALIDATION_ERROR_2901be01, "The spec valid usage text states 'pModes must be a valid pointer to a VkDeviceGroupPresentModeFlagsKHX value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupSurfacePresentModesKHX-pModes-parameter)"}, - {VALIDATION_ERROR_2901be03, "The spec valid usage text states 'pModes must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupSurfacePresentModesKHX-pModes-requiredbitmask)"}, - {VALIDATION_ERROR_2902ec01, "The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceGroupSurfacePresentModesKHX-surface-parameter)"}, + {VALIDATION_ERROR_28c00566, "The spec valid usage text states 'heapIndex must be less than memoryHeapCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeatures-heapIndex-00691)"}, + {VALIDATION_ERROR_28c00568, "The spec valid usage text states 'localDeviceIndex must be a valid device index' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeatures-localDeviceIndex-00692)"}, + {VALIDATION_ERROR_28c0056a, "The spec valid usage text states 'remoteDeviceIndex must be a valid device index' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeatures-remoteDeviceIndex-00693)"}, + {VALIDATION_ERROR_28c0056c, "The spec valid usage text states 'localDeviceIndex must not equal remoteDeviceIndex' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeatures-localDeviceIndex-00694)"}, + {VALIDATION_ERROR_28c05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeatures-device-parameter)"}, + {VALIDATION_ERROR_28c1d401, "The spec valid usage text states 'pPeerMemoryFeatures must be a valid pointer to a VkPeerMemoryFeatureFlags value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeatures-pPeerMemoryFeatures-parameter)"}, + {VALIDATION_ERROR_28c1d403, "The spec valid usage text states 'pPeerMemoryFeatures must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupPeerMemoryFeatures-pPeerMemoryFeatures-requiredbitmask)"}, + {VALIDATION_ERROR_28e05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupPresentCapabilitiesKHR-device-parameter)"}, + {VALIDATION_ERROR_28e13c01, "The spec valid usage text states 'pDeviceGroupPresentCapabilities must be a valid pointer to a VkDeviceGroupPresentCapabilitiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupPresentCapabilitiesKHR-pDeviceGroupPresentCapabilities-parameter)"}, + {VALIDATION_ERROR_29000009, "The spec valid usage text states 'Both of device, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupSurfacePresentModesKHR-commonparent)"}, + {VALIDATION_ERROR_29005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupSurfacePresentModesKHR-device-parameter)"}, + {VALIDATION_ERROR_2901be01, "The spec valid usage text states 'pModes must be a valid pointer to a VkDeviceGroupPresentModeFlagsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupSurfacePresentModesKHR-pModes-parameter)"}, + {VALIDATION_ERROR_2902ec01, "The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceGroupSurfacePresentModesKHR-surface-parameter)"}, {VALIDATION_ERROR_29200564, "The spec valid usage text states 'memory must have been created with a memory type that reports VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceMemoryCommitment-memory-00690)"}, {VALIDATION_ERROR_29205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceMemoryCommitment-device-parameter)"}, {VALIDATION_ERROR_2920c601, "The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceMemoryCommitment-memory-parameter)"}, @@ -6745,26 +7004,27 @@ {VALIDATION_ERROR_2941c001, "The spec valid usage text states 'pName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceProcAddr-pName-parameter)"}, {VALIDATION_ERROR_29600300, "The spec valid usage text states 'queueFamilyIndex must be one of the queue family indices specified when device was created, via the VkDeviceQueueCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceQueue-queueFamilyIndex-00384)"}, {VALIDATION_ERROR_29600302, "The spec valid usage text states 'queueIndex must be less than the number of queues created for the specified queue family index when device was created, via the queueCount member of the VkDeviceQueueCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceQueue-queueIndex-00385)"}, + {VALIDATION_ERROR_29600e62, "The spec valid usage text states 'VkDeviceQueueCreateInfo::flags must have been set to zero when device was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceQueue-flags-01841)"}, {VALIDATION_ERROR_29605601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceQueue-device-parameter)"}, {VALIDATION_ERROR_2961fc01, "The spec valid usage text states 'pQueue must be a valid pointer to a VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDeviceQueue-pQueue-parameter)"}, - {VALIDATION_ERROR_29806001, "The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayModePropertiesKHR-display-parameter)"}, - {VALIDATION_ERROR_2981f401, "The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkDisplayModePropertiesKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayModePropertiesKHR-pProperties-parameter)"}, - {VALIDATION_ERROR_2981f601, "The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayModePropertiesKHR-pPropertyCount-parameter)"}, - {VALIDATION_ERROR_29827a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayModePropertiesKHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_29a0ce01, "The spec valid usage text states 'mode must be a valid VkDisplayModeKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayPlaneCapabilitiesKHR-mode-parameter)"}, - {VALIDATION_ERROR_29a10a01, "The spec valid usage text states 'pCapabilities must be a valid pointer to a VkDisplayPlaneCapabilitiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayPlaneCapabilitiesKHR-pCapabilities-parameter)"}, - {VALIDATION_ERROR_29a27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayPlaneCapabilitiesKHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_29c009c2, "The spec valid usage text states 'planeIndex must be less than the number of display planes supported by the device as determined by calling vkGetPhysicalDeviceDisplayPlanePropertiesKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayPlaneSupportedDisplaysKHR-planeIndex-01249)"}, - {VALIDATION_ERROR_29c14a01, "The spec valid usage text states 'pDisplayCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplayCount-parameter)"}, - {VALIDATION_ERROR_29c15201, "The spec valid usage text states 'If the value referenced by pDisplayCount is not 0, and pDisplays is not NULL, pDisplays must be a valid pointer to an array of pDisplayCount VkDisplayKHR handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplays-parameter)"}, - {VALIDATION_ERROR_29c27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetDisplayPlaneSupportedDisplaysKHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_29806001, "The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayModePropertiesKHR-display-parameter)"}, + {VALIDATION_ERROR_2981f401, "The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkDisplayModePropertiesKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayModePropertiesKHR-pProperties-parameter)"}, + {VALIDATION_ERROR_2981f601, "The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayModePropertiesKHR-pPropertyCount-parameter)"}, + {VALIDATION_ERROR_29827a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayModePropertiesKHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_29a0ce01, "The spec valid usage text states 'mode must be a valid VkDisplayModeKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayPlaneCapabilitiesKHR-mode-parameter)"}, + {VALIDATION_ERROR_29a10a01, "The spec valid usage text states 'pCapabilities must be a valid pointer to a VkDisplayPlaneCapabilitiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayPlaneCapabilitiesKHR-pCapabilities-parameter)"}, + {VALIDATION_ERROR_29a27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayPlaneCapabilitiesKHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_29c009c2, "The spec valid usage text states 'planeIndex must be less than the number of display planes supported by the device as determined by calling vkGetPhysicalDeviceDisplayPlanePropertiesKHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayPlaneSupportedDisplaysKHR-planeIndex-01249)"}, + {VALIDATION_ERROR_29c14a01, "The spec valid usage text states 'pDisplayCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplayCount-parameter)"}, + {VALIDATION_ERROR_29c15201, "The spec valid usage text states 'If the value referenced by pDisplayCount is not 0, and pDisplays is not NULL, pDisplays must be a valid pointer to an array of pDisplayCount VkDisplayKHR handles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplays-parameter)"}, + {VALIDATION_ERROR_29c27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDisplayPlaneSupportedDisplaysKHR-physicalDevice-parameter)"}, {VALIDATION_ERROR_29e05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetEventStatus-device-parameter)"}, {VALIDATION_ERROR_29e07e01, "The spec valid usage text states 'event must be a valid VkEvent handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetEventStatus-event-parameter)"}, {VALIDATION_ERROR_29e07e07, "The spec valid usage text states 'event must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetEventStatus-event-parent)"}, {VALIDATION_ERROR_2a005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetFenceStatus-device-parameter)"}, {VALIDATION_ERROR_2a008801, "The spec valid usage text states 'fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetFenceStatus-fence-parameter)"}, {VALIDATION_ERROR_2a008807, "The spec valid usage text states 'fence must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetFenceStatus-fence-parent)"}, - {VALIDATION_ERROR_2a200c68, "The spec valid usage text states 'image must not have been created with the VK_IMAGE_CREATE_DISJOINT_BIT_KHR flag set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageMemoryRequirements-image-01588)"}, + {VALIDATION_ERROR_2a200c68, "The spec valid usage text states 'image must not have been created with the VK_IMAGE_CREATE_DISJOINT_BIT flag set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageMemoryRequirements-image-01588)"}, {VALIDATION_ERROR_2a205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageMemoryRequirements-device-parameter)"}, {VALIDATION_ERROR_2a20a001, "The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageMemoryRequirements-image-parameter)"}, {VALIDATION_ERROR_2a20a007, "The spec valid usage text states 'image must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageMemoryRequirements-image-parent)"}, @@ -6776,10 +7036,11 @@ {VALIDATION_ERROR_2a423801, "The spec valid usage text states 'If the value referenced by pSparseMemoryRequirementCount is not 0, and pSparseMemoryRequirements is not NULL, pSparseMemoryRequirements must be a valid pointer to an array of pSparseMemoryRequirementCount VkSparseImageMemoryRequirements structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSparseMemoryRequirements-pSparseMemoryRequirements-parameter)"}, {VALIDATION_ERROR_2a6007c8, "The spec valid usage text states 'image must have been created with tiling equal to VK_IMAGE_TILING_LINEAR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-image-00996)"}, {VALIDATION_ERROR_2a6007ca, "The spec valid usage text states 'The aspectMask member of pSubresource must only have a single bit set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-aspectMask-00997)"}, - {VALIDATION_ERROR_2a600c5a, "The spec valid usage text states 'If the format of image is a multi-planar format with two planes, the aspectMask member of pSubresource must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR or VK_IMAGE_ASPECT_PLANE_1_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageSubresourceLayout-format-01581)"}, - {VALIDATION_ERROR_2a600c5c, "The spec valid usage text states 'If the format of image is a multi-planar format with three planes, the aspectMask member of pSubresource must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR or VK_IMAGE_ASPECT_PLANE_2_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageSubresourceLayout-format-01582)"}, + {VALIDATION_ERROR_2a600c5a, "The spec valid usage text states 'If the format of image is a multi-planar format with two planes, the aspectMask member of pSubresource must be VK_IMAGE_ASPECT_PLANE_0_BIT or VK_IMAGE_ASPECT_PLANE_1_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageSubresourceLayout-format-01581)"}, + {VALIDATION_ERROR_2a600c5c, "The spec valid usage text states 'If the format of image is a multi-planar format with three planes, the aspectMask member of pSubresource must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT or VK_IMAGE_ASPECT_PLANE_2_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageSubresourceLayout-format-01582)"}, {VALIDATION_ERROR_2a600d68, "The spec valid usage text states 'The mipLevel member of pSubresource must be less than the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-mipLevel-01716)"}, {VALIDATION_ERROR_2a600d6a, "The spec valid usage text states 'The arrayLayer member of pSubresource must be less than the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-arrayLayer-01717)"}, + {VALIDATION_ERROR_2a600ece, "The spec valid usage text states 'If image was created with the VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID external memory handle type, then image must be bound to memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageSubresourceLayout-image-01895)"}, {VALIDATION_ERROR_2a605601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-device-parameter)"}, {VALIDATION_ERROR_2a60a001, "The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-image-parameter)"}, {VALIDATION_ERROR_2a60a007, "The spec valid usage text states 'image must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-image-parent)"}, @@ -6787,79 +7048,68 @@ {VALIDATION_ERROR_2a624401, "The spec valid usage text states 'pSubresource must be a valid pointer to a valid VkImageSubresource structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-pSubresource-parameter)"}, {VALIDATION_ERROR_2a80bc01, "The spec valid usage text states 'If instance is not NULL, instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetInstanceProcAddr-instance-parameter)"}, {VALIDATION_ERROR_2a81c001, "The spec valid usage text states 'pName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetInstanceProcAddr-pName-parameter)"}, - {VALIDATION_ERROR_2aa0053e, "The spec valid usage text states 'handleType must have been included in VkExportMemoryAllocateInfoKHR::handleTypes when memory was created.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdKHR-handleType-00671)"}, - {VALIDATION_ERROR_2aa00540, "The spec valid usage text states 'handleType must be defined as a POSIX file descriptor handle.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdKHR-handleType-00672)"}, - {VALIDATION_ERROR_2aa05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdKHR-device-parameter)"}, - {VALIDATION_ERROR_2aa09c01, "The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdKHR-handleType-parameter)"}, - {VALIDATION_ERROR_2aa0c601, "The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdKHR-memory-parameter)"}, - {VALIDATION_ERROR_2aa0c607, "The spec valid usage text states 'memory must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdKHR-memory-parent)"}, - {VALIDATION_ERROR_2aa16c01, "The spec valid usage text states 'pFd must be a valid pointer to a int value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdKHR-pFd-parameter)"}, - {VALIDATION_ERROR_2aa39e01, "The spec valid usage text states 'pGetFdInfo must be a valid pointer to a valid VkMemoryGetFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdKHR-pGetFdInfo-parameter)"}, - {VALIDATION_ERROR_2ac00542, "The spec valid usage text states 'fd must be an external memory handle created outside of the Vulkan API.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-fd-00673)"}, - {VALIDATION_ERROR_2ac00544, "The spec valid usage text states 'handleType must not be one of the handle types defined as opaque.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-handleType-00674)"}, - {VALIDATION_ERROR_2ac05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-device-parameter)"}, - {VALIDATION_ERROR_2ac09c01, "The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-handleType-parameter)"}, - {VALIDATION_ERROR_2ac1ae01, "The spec valid usage text states 'pMemoryFdProperties must be a valid pointer to a VkMemoryFdPropertiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-pMemoryFdProperties-parameter)"}, - {VALIDATION_ERROR_2ae0052c, "The spec valid usage text states 'handleType must have been included in VkExportMemoryAllocateInfoKHR::handleTypes when memory was created.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-handleType-00662)"}, - {VALIDATION_ERROR_2ae0052e, "The spec valid usage text states 'If handleType is defined as an NT handle, vkGetMemoryWin32HandleKHR must be called no more than once for each valid unique combination of memory and handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-handleType-00663)"}, - {VALIDATION_ERROR_2ae00530, "The spec valid usage text states 'handleType must be defined as an NT handle or a global share handle.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-handleType-00664)"}, - {VALIDATION_ERROR_2ae05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-device-parameter)"}, - {VALIDATION_ERROR_2ae09c01, "The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-handleType-parameter)"}, - {VALIDATION_ERROR_2ae0c601, "The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-memory-parameter)"}, - {VALIDATION_ERROR_2ae0c607, "The spec valid usage text states 'memory must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-memory-parent)"}, - {VALIDATION_ERROR_2ae17c01, "The spec valid usage text states 'pHandle must be a valid pointer to a HANDLE value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-pHandle-parameter)"}, - {VALIDATION_ERROR_2ae3a001, "The spec valid usage text states 'pGetWin32HandleInfo must be a valid pointer to a valid VkMemoryGetWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-pGetWin32HandleInfo-parameter)"}, - {VALIDATION_ERROR_2b000a5c, "The spec valid usage text states 'handleType must be a flag specified in VkExportMemoryAllocateInfoNV::handleTypes when allocating memory' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-handleType-01326)"}, - {VALIDATION_ERROR_2b005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-device-parameter)"}, - {VALIDATION_ERROR_2b009c01, "The spec valid usage text states 'handleType must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-handleType-parameter)"}, - {VALIDATION_ERROR_2b009c03, "The spec valid usage text states 'handleType must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-handleType-requiredbitmask)"}, - {VALIDATION_ERROR_2b00c601, "The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-memory-parameter)"}, - {VALIDATION_ERROR_2b00c607, "The spec valid usage text states 'memory must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-memory-parent)"}, - {VALIDATION_ERROR_2b017c01, "The spec valid usage text states 'pHandle must be a valid pointer to a HANDLE value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-pHandle-parameter)"}, - {VALIDATION_ERROR_2b200532, "The spec valid usage text states 'handle must be an external memory handle created outside of the Vulkan API.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-handle-00665)"}, - {VALIDATION_ERROR_2b200534, "The spec valid usage text states 'handleType must not be one of the handle types defined as opaque.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-00666)"}, - {VALIDATION_ERROR_2b205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-device-parameter)"}, - {VALIDATION_ERROR_2b209c01, "The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-parameter)"}, - {VALIDATION_ERROR_2b21b601, "The spec valid usage text states 'pMemoryWin32HandleProperties must be a valid pointer to a VkMemoryWin32HandlePropertiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-pMemoryWin32HandleProperties-parameter)"}, - {VALIDATION_ERROR_2b400009, "The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-commonparent)"}, - {VALIDATION_ERROR_2b405601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-device-parameter)"}, - {VALIDATION_ERROR_2b41ec01, "The spec valid usage text states 'pPresentationTimingCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimingCount-parameter)"}, - {VALIDATION_ERROR_2b41ee01, "The spec valid usage text states 'If the value referenced by pPresentationTimingCount is not 0, and pPresentationTimings is not NULL, pPresentationTimings must be a valid pointer to an array of pPresentationTimingCount VkPastPresentationTimingGOOGLE structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimings-parameter)"}, - {VALIDATION_ERROR_2b42f001, "The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-swapchain-parameter)"}, - {VALIDATION_ERROR_2b61f401, "The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkDisplayPlanePropertiesKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pProperties-parameter)"}, - {VALIDATION_ERROR_2b61f601, "The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pPropertyCount-parameter)"}, - {VALIDATION_ERROR_2b627a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2b81f401, "The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkDisplayPropertiesKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pProperties-parameter)"}, - {VALIDATION_ERROR_2b81f601, "The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pPropertyCount-parameter)"}, - {VALIDATION_ERROR_2b827a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2ba16201, "The spec valid usage text states 'pExternalBufferInfo must be a valid pointer to a valid VkPhysicalDeviceExternalBufferInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalBufferPropertiesKHR-pExternalBufferInfo-parameter)"}, - {VALIDATION_ERROR_2ba16401, "The spec valid usage text states 'pExternalBufferProperties must be a valid pointer to a VkExternalBufferPropertiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalBufferPropertiesKHR-pExternalBufferProperties-parameter)"}, - {VALIDATION_ERROR_2ba27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalBufferPropertiesKHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2bc08201, "The spec valid usage text states 'externalHandleType must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-externalHandleType-parameter)"}, - {VALIDATION_ERROR_2bc09001, "The spec valid usage text states 'flags must be a valid combination of VkImageCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-flags-parameter)"}, - {VALIDATION_ERROR_2bc09201, "The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-format-parameter)"}, - {VALIDATION_ERROR_2bc16601, "The spec valid usage text states 'pExternalImageFormatProperties must be a valid pointer to a VkExternalImageFormatPropertiesNV structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-pExternalImageFormatProperties-parameter)"}, - {VALIDATION_ERROR_2bc27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2bc2fa01, "The spec valid usage text states 'tiling must be a valid VkImageTiling value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-tiling-parameter)"}, - {VALIDATION_ERROR_2bc30401, "The spec valid usage text states 'type must be a valid VkImageType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-type-parameter)"}, - {VALIDATION_ERROR_2bc30601, "The spec valid usage text states 'usage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-parameter)"}, - {VALIDATION_ERROR_2bc30603, "The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-requiredbitmask)"}, - {VALIDATION_ERROR_2be16801, "The spec valid usage text states 'pExternalSemaphoreInfo must be a valid pointer to a valid VkPhysicalDeviceExternalSemaphoreInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalSemaphorePropertiesKHR-pExternalSemaphoreInfo-parameter)"}, - {VALIDATION_ERROR_2be16a01, "The spec valid usage text states 'pExternalSemaphoreProperties must be a valid pointer to a VkExternalSemaphorePropertiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalSemaphorePropertiesKHR-pExternalSemaphoreProperties-parameter)"}, - {VALIDATION_ERROR_2be27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalSemaphorePropertiesKHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2aa05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryFdKHR-device-parameter)"}, + {VALIDATION_ERROR_2aa16c01, "The spec valid usage text states 'pFd must be a valid pointer to a int value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryFdKHR-pFd-parameter)"}, + {VALIDATION_ERROR_2aa39e01, "The spec valid usage text states 'pGetFdInfo must be a valid pointer to a valid VkMemoryGetFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryFdKHR-pGetFdInfo-parameter)"}, + {VALIDATION_ERROR_2ac00542, "The spec valid usage text states 'fd must be an external memory handle created outside of the Vulkan API.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-fd-00673)"}, + {VALIDATION_ERROR_2ac00544, "The spec valid usage text states 'handleType must not be VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-handleType-00674)"}, + {VALIDATION_ERROR_2ac05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-device-parameter)"}, + {VALIDATION_ERROR_2ac09c01, "The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-handleType-parameter)"}, + {VALIDATION_ERROR_2ac1ae01, "The spec valid usage text states 'pMemoryFdProperties must be a valid pointer to a VkMemoryFdPropertiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryFdPropertiesKHR-pMemoryFdProperties-parameter)"}, + {VALIDATION_ERROR_2ae05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-device-parameter)"}, + {VALIDATION_ERROR_2ae17c01, "The spec valid usage text states 'pHandle must be a valid pointer to a HANDLE value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-pHandle-parameter)"}, + {VALIDATION_ERROR_2ae3a001, "The spec valid usage text states 'pGetWin32HandleInfo must be a valid pointer to a valid VkMemoryGetWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleKHR-pGetWin32HandleInfo-parameter)"}, + {VALIDATION_ERROR_2b000a5c, "The spec valid usage text states 'handleType must be a flag specified in VkExportMemoryAllocateInfoNV::handleTypes when allocating memory' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-handleType-01326)"}, + {VALIDATION_ERROR_2b005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-device-parameter)"}, + {VALIDATION_ERROR_2b009c01, "The spec valid usage text states 'handleType must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-handleType-parameter)"}, + {VALIDATION_ERROR_2b009c03, "The spec valid usage text states 'handleType must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-handleType-requiredbitmask)"}, + {VALIDATION_ERROR_2b00c601, "The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-memory-parameter)"}, + {VALIDATION_ERROR_2b00c607, "The spec valid usage text states 'memory must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-memory-parent)"}, + {VALIDATION_ERROR_2b017c01, "The spec valid usage text states 'pHandle must be a valid pointer to a HANDLE value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandleNV-pHandle-parameter)"}, + {VALIDATION_ERROR_2b200532, "The spec valid usage text states 'handle must be an external memory handle created outside of the Vulkan API.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-handle-00665)"}, + {VALIDATION_ERROR_2b200534, "The spec valid usage text states 'handleType must not be one of the handle types defined as opaque.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-00666)"}, + {VALIDATION_ERROR_2b205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-device-parameter)"}, + {VALIDATION_ERROR_2b209c01, "The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-parameter)"}, + {VALIDATION_ERROR_2b21b601, "The spec valid usage text states 'pMemoryWin32HandleProperties must be a valid pointer to a VkMemoryWin32HandlePropertiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryWin32HandlePropertiesKHR-pMemoryWin32HandleProperties-parameter)"}, + {VALIDATION_ERROR_2b400009, "The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-commonparent)"}, + {VALIDATION_ERROR_2b405601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-device-parameter)"}, + {VALIDATION_ERROR_2b41ec01, "The spec valid usage text states 'pPresentationTimingCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimingCount-parameter)"}, + {VALIDATION_ERROR_2b41ee01, "The spec valid usage text states 'If the value referenced by pPresentationTimingCount is not 0, and pPresentationTimings is not NULL, pPresentationTimings must be a valid pointer to an array of pPresentationTimingCount VkPastPresentationTimingGOOGLE structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimings-parameter)"}, + {VALIDATION_ERROR_2b42f001, "The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPastPresentationTimingGOOGLE-swapchain-parameter)"}, + {VALIDATION_ERROR_2b61f401, "The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkDisplayPlanePropertiesKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pProperties-parameter)"}, + {VALIDATION_ERROR_2b61f601, "The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pPropertyCount-parameter)"}, + {VALIDATION_ERROR_2b627a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2b81f401, "The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkDisplayPropertiesKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pProperties-parameter)"}, + {VALIDATION_ERROR_2b81f601, "The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pPropertyCount-parameter)"}, + {VALIDATION_ERROR_2b827a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2ba16201, "The spec valid usage text states 'pExternalBufferInfo must be a valid pointer to a valid VkPhysicalDeviceExternalBufferInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalBufferProperties-pExternalBufferInfo-parameter)"}, + {VALIDATION_ERROR_2ba16401, "The spec valid usage text states 'pExternalBufferProperties must be a valid pointer to a VkExternalBufferProperties structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalBufferProperties-pExternalBufferProperties-parameter)"}, + {VALIDATION_ERROR_2ba27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalBufferProperties-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2bc08201, "The spec valid usage text states 'externalHandleType must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-externalHandleType-parameter)"}, + {VALIDATION_ERROR_2bc09001, "The spec valid usage text states 'flags must be a valid combination of VkImageCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-flags-parameter)"}, + {VALIDATION_ERROR_2bc09201, "The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-format-parameter)"}, + {VALIDATION_ERROR_2bc16601, "The spec valid usage text states 'pExternalImageFormatProperties must be a valid pointer to a VkExternalImageFormatPropertiesNV structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-pExternalImageFormatProperties-parameter)"}, + {VALIDATION_ERROR_2bc27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2bc2fa01, "The spec valid usage text states 'tiling must be a valid VkImageTiling value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-tiling-parameter)"}, + {VALIDATION_ERROR_2bc30401, "The spec valid usage text states 'type must be a valid VkImageType value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-type-parameter)"}, + {VALIDATION_ERROR_2bc30601, "The spec valid usage text states 'usage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-parameter)"}, + {VALIDATION_ERROR_2bc30603, "The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-requiredbitmask)"}, + {VALIDATION_ERROR_2be16801, "The spec valid usage text states 'pExternalSemaphoreInfo must be a valid pointer to a valid VkPhysicalDeviceExternalSemaphoreInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-pExternalSemaphoreInfo-parameter)"}, + {VALIDATION_ERROR_2be16a01, "The spec valid usage text states 'pExternalSemaphoreProperties must be a valid pointer to a VkExternalSemaphoreProperties structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-pExternalSemaphoreProperties-parameter)"}, + {VALIDATION_ERROR_2be27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-physicalDevice-parameter)"}, {VALIDATION_ERROR_2c016e01, "The spec valid usage text states 'pFeatures must be a valid pointer to a VkPhysicalDeviceFeatures structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFeatures-pFeatures-parameter)"}, {VALIDATION_ERROR_2c027a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFeatures-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2c216e01, "The spec valid usage text states 'pFeatures must be a valid pointer to a VkPhysicalDeviceFeatures2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFeatures2KHR-pFeatures-parameter)"}, - {VALIDATION_ERROR_2c227a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFeatures2KHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2c216e01, "The spec valid usage text states 'pFeatures must be a valid pointer to a VkPhysicalDeviceFeatures2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceFeatures2-pFeatures-parameter)"}, + {VALIDATION_ERROR_2c227a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceFeatures2-physicalDevice-parameter)"}, {VALIDATION_ERROR_2c409201, "The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFormatProperties-format-parameter)"}, {VALIDATION_ERROR_2c417601, "The spec valid usage text states 'pFormatProperties must be a valid pointer to a VkFormatProperties structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFormatProperties-pFormatProperties-parameter)"}, {VALIDATION_ERROR_2c427a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFormatProperties-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2c609201, "The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFormatProperties2KHR-format-parameter)"}, - {VALIDATION_ERROR_2c617601, "The spec valid usage text states 'pFormatProperties must be a valid pointer to a VkFormatProperties2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFormatProperties2KHR-pFormatProperties-parameter)"}, - {VALIDATION_ERROR_2c627a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceFormatProperties2KHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2c816e01, "The spec valid usage text states 'pFeatures must be a valid pointer to a VkDeviceGeneratedCommandsFeaturesNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-pFeatures-parameter)"}, - {VALIDATION_ERROR_2c81a401, "The spec valid usage text states 'pLimits must be a valid pointer to a VkDeviceGeneratedCommandsLimitsNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-pLimits-parameter)"}, - {VALIDATION_ERROR_2c827a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2c609201, "The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceFormatProperties2-format-parameter)"}, + {VALIDATION_ERROR_2c617601, "The spec valid usage text states 'pFormatProperties must be a valid pointer to a VkFormatProperties2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceFormatProperties2-pFormatProperties-parameter)"}, + {VALIDATION_ERROR_2c627a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceFormatProperties2-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2c816e01, "The spec valid usage text states 'pFeatures must be a valid pointer to a VkDeviceGeneratedCommandsFeaturesNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-pFeatures-parameter)"}, + {VALIDATION_ERROR_2c81a401, "The spec valid usage text states 'pLimits must be a valid pointer to a VkDeviceGeneratedCommandsLimitsNVX structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-pLimits-parameter)"}, + {VALIDATION_ERROR_2c827a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-physicalDevice-parameter)"}, {VALIDATION_ERROR_2ca09001, "The spec valid usage text states 'flags must be a valid combination of VkImageCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties-flags-parameter)"}, {VALIDATION_ERROR_2ca09201, "The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties-format-parameter)"}, {VALIDATION_ERROR_2ca18401, "The spec valid usage text states 'pImageFormatProperties must be a valid pointer to a VkImageFormatProperties structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties-pImageFormatProperties-parameter)"}, @@ -6868,31 +7118,32 @@ {VALIDATION_ERROR_2ca30401, "The spec valid usage text states 'type must be a valid VkImageType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties-type-parameter)"}, {VALIDATION_ERROR_2ca30601, "The spec valid usage text states 'usage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties-usage-parameter)"}, {VALIDATION_ERROR_2ca30603, "The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties-usage-requiredbitmask)"}, - {VALIDATION_ERROR_2cc18201, "The spec valid usage text states 'pImageFormatInfo must be a valid pointer to a valid VkPhysicalDeviceImageFormatInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties2KHR-pImageFormatInfo-parameter)"}, - {VALIDATION_ERROR_2cc18401, "The spec valid usage text states 'pImageFormatProperties must be a valid pointer to a VkImageFormatProperties2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties2KHR-pImageFormatProperties-parameter)"}, - {VALIDATION_ERROR_2cc27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties2KHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2cc00e98, "The spec valid usage text states 'If the pNext chain of pImageFormatProperties contains an instance of VkAndroidHardwareBufferUsageANDROID, the pNext chain of pImageFormatInfo must contain an instance of VkPhysicalDeviceExternalImageFormatInfo with handleType set to VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties2-pNext-01868)"}, + {VALIDATION_ERROR_2cc18201, "The spec valid usage text states 'pImageFormatInfo must be a valid pointer to a valid VkPhysicalDeviceImageFormatInfo2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties2-pImageFormatInfo-parameter)"}, + {VALIDATION_ERROR_2cc18401, "The spec valid usage text states 'pImageFormatProperties must be a valid pointer to a VkImageFormatProperties2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties2-pImageFormatProperties-parameter)"}, + {VALIDATION_ERROR_2cc27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties2-physicalDevice-parameter)"}, {VALIDATION_ERROR_2ce1b001, "The spec valid usage text states 'pMemoryProperties must be a valid pointer to a VkPhysicalDeviceMemoryProperties structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMemoryProperties-pMemoryProperties-parameter)"}, {VALIDATION_ERROR_2ce27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMemoryProperties-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2d01b001, "The spec valid usage text states 'pMemoryProperties must be a valid pointer to a VkPhysicalDeviceMemoryProperties2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMemoryProperties2KHR-pMemoryProperties-parameter)"}, - {VALIDATION_ERROR_2d027a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMemoryProperties2KHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2d2009e2, "The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-queueFamilyIndex-01265)"}, - {VALIDATION_ERROR_2d203001, "The spec valid usage text states 'connection must be a valid pointer to a MirConnection value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-connection-parameter)"}, - {VALIDATION_ERROR_2d227a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2d400009, "The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHX-commonparent)"}, - {VALIDATION_ERROR_2d420a01, "The spec valid usage text states 'pRectCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHX-pRectCount-parameter)"}, - {VALIDATION_ERROR_2d420e01, "The spec valid usage text states 'If the value referenced by pRectCount is not 0, and pRects is not NULL, pRects must be a valid pointer to an array of pRectCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHX-pRects-parameter)"}, - {VALIDATION_ERROR_2d427a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHX-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2d42ec01, "The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHX-surface-parameter)"}, + {VALIDATION_ERROR_2d01b001, "The spec valid usage text states 'pMemoryProperties must be a valid pointer to a VkPhysicalDeviceMemoryProperties2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceMemoryProperties2-pMemoryProperties-parameter)"}, + {VALIDATION_ERROR_2d027a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceMemoryProperties2-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2d2009e2, "The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-queueFamilyIndex-01265)"}, + {VALIDATION_ERROR_2d203001, "The spec valid usage text states 'connection must be a valid pointer to a MirConnection value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-connection-parameter)"}, + {VALIDATION_ERROR_2d227a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2d400009, "The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHR-commonparent)"}, + {VALIDATION_ERROR_2d420a01, "The spec valid usage text states 'pRectCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHR-pRectCount-parameter)"}, + {VALIDATION_ERROR_2d420e01, "The spec valid usage text states 'If the value referenced by pRectCount is not 0, and pRects is not NULL, pRects must be a valid pointer to an array of pRectCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHR-pRects-parameter)"}, + {VALIDATION_ERROR_2d427a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2d42ec01, "The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDevicePresentRectanglesKHR-surface-parameter)"}, {VALIDATION_ERROR_2d61f401, "The spec valid usage text states 'pProperties must be a valid pointer to a VkPhysicalDeviceProperties structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceProperties-pProperties-parameter)"}, {VALIDATION_ERROR_2d627a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceProperties-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2d81f401, "The spec valid usage text states 'pProperties must be a valid pointer to a VkPhysicalDeviceProperties2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceProperties2KHR-pProperties-parameter)"}, - {VALIDATION_ERROR_2d827a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceProperties2KHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2d81f401, "The spec valid usage text states 'pProperties must be a valid pointer to a VkPhysicalDeviceProperties2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceProperties2-pProperties-parameter)"}, + {VALIDATION_ERROR_2d827a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceProperties2-physicalDevice-parameter)"}, {VALIDATION_ERROR_2da20001, "The spec valid usage text states 'If the value referenced by pQueueFamilyPropertyCount is not 0, and pQueueFamilyProperties is not NULL, pQueueFamilyProperties must be a valid pointer to an array of pQueueFamilyPropertyCount VkQueueFamilyProperties structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceQueueFamilyProperties-pQueueFamilyProperties-parameter)"}, {VALIDATION_ERROR_2da20201, "The spec valid usage text states 'pQueueFamilyPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceQueueFamilyProperties-pQueueFamilyPropertyCount-parameter)"}, {VALIDATION_ERROR_2da27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceQueueFamilyProperties-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2dc20001, "The spec valid usage text states 'If the value referenced by pQueueFamilyPropertyCount is not 0, and pQueueFamilyProperties is not NULL, pQueueFamilyProperties must be a valid pointer to an array of pQueueFamilyPropertyCount VkQueueFamilyProperties2KHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceQueueFamilyProperties2KHR-pQueueFamilyProperties-parameter)"}, - {VALIDATION_ERROR_2dc20201, "The spec valid usage text states 'pQueueFamilyPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceQueueFamilyProperties2KHR-pQueueFamilyPropertyCount-parameter)"}, - {VALIDATION_ERROR_2dc27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceQueueFamilyProperties2KHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2dc20001, "The spec valid usage text states 'If the value referenced by pQueueFamilyPropertyCount is not 0, and pQueueFamilyProperties is not NULL, pQueueFamilyProperties must be a valid pointer to an array of pQueueFamilyPropertyCount VkQueueFamilyProperties2 structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceQueueFamilyProperties2-pQueueFamilyProperties-parameter)"}, + {VALIDATION_ERROR_2dc20201, "The spec valid usage text states 'pQueueFamilyPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceQueueFamilyProperties2-pQueueFamilyPropertyCount-parameter)"}, + {VALIDATION_ERROR_2dc27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceQueueFamilyProperties2-physicalDevice-parameter)"}, {VALIDATION_ERROR_2de0088c, "The spec valid usage text states 'samples must be a bit value that is set in VkImageFormatProperties::sampleCounts returned by vkGetPhysicalDeviceImageFormatProperties with format, type, tiling, and usage equal to those in this command and flags equal to the value that is set in VkImageCreateInfo::flags when the image is created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties-samples-01094)"}, {VALIDATION_ERROR_2de09201, "The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties-format-parameter)"}, {VALIDATION_ERROR_2de1f401, "The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkSparseImageFormatProperties structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties-pProperties-parameter)"}, @@ -6903,51 +7154,51 @@ {VALIDATION_ERROR_2de30401, "The spec valid usage text states 'type must be a valid VkImageType value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties-type-parameter)"}, {VALIDATION_ERROR_2de30601, "The spec valid usage text states 'usage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties-usage-parameter)"}, {VALIDATION_ERROR_2de30603, "The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties-usage-requiredbitmask)"}, - {VALIDATION_ERROR_2e017401, "The spec valid usage text states 'pFormatInfo must be a valid pointer to a valid VkPhysicalDeviceSparseImageFormatInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties2KHR-pFormatInfo-parameter)"}, - {VALIDATION_ERROR_2e01f401, "The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkSparseImageFormatProperties2KHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties2KHR-pProperties-parameter)"}, - {VALIDATION_ERROR_2e01f601, "The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties2KHR-pPropertyCount-parameter)"}, - {VALIDATION_ERROR_2e027a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties2KHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2e200009, "The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-commonparent)"}, - {VALIDATION_ERROR_2e224a01, "The spec valid usage text states 'pSurfaceCapabilities must be a valid pointer to a VkSurfaceCapabilities2EXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-pSurfaceCapabilities-parameter)"}, - {VALIDATION_ERROR_2e227a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2e22ec01, "The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-surface-parameter)"}, - {VALIDATION_ERROR_2e424a01, "The spec valid usage text states 'pSurfaceCapabilities must be a valid pointer to a VkSurfaceCapabilities2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceCapabilities-parameter)"}, - {VALIDATION_ERROR_2e425001, "The spec valid usage text states 'pSurfaceInfo must be a valid pointer to a valid VkPhysicalDeviceSurfaceInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceInfo-parameter)"}, - {VALIDATION_ERROR_2e427a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2e600009, "The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-commonparent)"}, - {VALIDATION_ERROR_2e624a01, "The spec valid usage text states 'pSurfaceCapabilities must be a valid pointer to a VkSurfaceCapabilitiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-pSurfaceCapabilities-parameter)"}, - {VALIDATION_ERROR_2e627a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2e62ec01, "The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-surface-parameter)"}, - {VALIDATION_ERROR_2e824c01, "The spec valid usage text states 'pSurfaceFormatCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceFormatCount-parameter)"}, - {VALIDATION_ERROR_2e824e01, "The spec valid usage text states 'If the value referenced by pSurfaceFormatCount is not 0, and pSurfaceFormats is not NULL, pSurfaceFormats must be a valid pointer to an array of pSurfaceFormatCount VkSurfaceFormat2KHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceFormats-parameter)"}, - {VALIDATION_ERROR_2e825001, "The spec valid usage text states 'pSurfaceInfo must be a valid pointer to a valid VkPhysicalDeviceSurfaceInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceInfo-parameter)"}, - {VALIDATION_ERROR_2e827a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2ea00009, "The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-commonparent)"}, - {VALIDATION_ERROR_2ea24c01, "The spec valid usage text states 'pSurfaceFormatCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormatCount-parameter)"}, - {VALIDATION_ERROR_2ea24e01, "The spec valid usage text states 'If the value referenced by pSurfaceFormatCount is not 0, and pSurfaceFormats is not NULL, pSurfaceFormats must be a valid pointer to an array of pSurfaceFormatCount VkSurfaceFormatKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormats-parameter)"}, - {VALIDATION_ERROR_2ea27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2ea2ec01, "The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-surface-parameter)"}, - {VALIDATION_ERROR_2ec00009, "The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-commonparent)"}, - {VALIDATION_ERROR_2ec1e801, "The spec valid usage text states 'pPresentModeCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModeCount-parameter)"}, - {VALIDATION_ERROR_2ec1ea01, "The spec valid usage text states 'If the value referenced by pPresentModeCount is not 0, and pPresentModes is not NULL, pPresentModes must be a valid pointer to an array of pPresentModeCount VkPresentModeKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModes-parameter)"}, - {VALIDATION_ERROR_2ec27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2ec2ec01, "The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-surface-parameter)"}, - {VALIDATION_ERROR_2ee00009, "The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-commonparent)"}, - {VALIDATION_ERROR_2ee009ea, "The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-queueFamilyIndex-01269)"}, - {VALIDATION_ERROR_2ee24601, "The spec valid usage text states 'pSupported must be a valid pointer to a VkBool32 value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-pSupported-parameter)"}, - {VALIDATION_ERROR_2ee27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2ee2ec01, "The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter)"}, - {VALIDATION_ERROR_2f000a34, "The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-queueFamilyIndex-01306)"}, - {VALIDATION_ERROR_2f006001, "The spec valid usage text states 'display must be a valid pointer to a wl_display value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-display-parameter)"}, - {VALIDATION_ERROR_2f027a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2f200a3a, "The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceWin32PresentationSupportKHR-queueFamilyIndex-01309)"}, - {VALIDATION_ERROR_2f227a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceWin32PresentationSupportKHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2f400a40, "The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-queueFamilyIndex-01312)"}, - {VALIDATION_ERROR_2f403001, "The spec valid usage text states 'connection must be a valid pointer to a xcb_connection_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-connection-parameter)"}, - {VALIDATION_ERROR_2f427a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2f600a46, "The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-queueFamilyIndex-01315)"}, - {VALIDATION_ERROR_2f606601, "The spec valid usage text states 'dpy must be a valid pointer to a Display value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-dpy-parameter)"}, - {VALIDATION_ERROR_2f627a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2e017401, "The spec valid usage text states 'pFormatInfo must be a valid pointer to a valid VkPhysicalDeviceSparseImageFormatInfo2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-pFormatInfo-parameter)"}, + {VALIDATION_ERROR_2e01f401, "The spec valid usage text states 'If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkSparseImageFormatProperties2 structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-pProperties-parameter)"}, + {VALIDATION_ERROR_2e01f601, "The spec valid usage text states 'pPropertyCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-pPropertyCount-parameter)"}, + {VALIDATION_ERROR_2e027a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2e200009, "The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-commonparent)"}, + {VALIDATION_ERROR_2e224a01, "The spec valid usage text states 'pSurfaceCapabilities must be a valid pointer to a VkSurfaceCapabilities2EXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-pSurfaceCapabilities-parameter)"}, + {VALIDATION_ERROR_2e227a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2e22ec01, "The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-surface-parameter)"}, + {VALIDATION_ERROR_2e424a01, "The spec valid usage text states 'pSurfaceCapabilities must be a valid pointer to a VkSurfaceCapabilities2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceCapabilities-parameter)"}, + {VALIDATION_ERROR_2e425001, "The spec valid usage text states 'pSurfaceInfo must be a valid pointer to a valid VkPhysicalDeviceSurfaceInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceInfo-parameter)"}, + {VALIDATION_ERROR_2e427a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2e600009, "The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-commonparent)"}, + {VALIDATION_ERROR_2e624a01, "The spec valid usage text states 'pSurfaceCapabilities must be a valid pointer to a VkSurfaceCapabilitiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-pSurfaceCapabilities-parameter)"}, + {VALIDATION_ERROR_2e627a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2e62ec01, "The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-surface-parameter)"}, + {VALIDATION_ERROR_2e824c01, "The spec valid usage text states 'pSurfaceFormatCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceFormatCount-parameter)"}, + {VALIDATION_ERROR_2e824e01, "The spec valid usage text states 'If the value referenced by pSurfaceFormatCount is not 0, and pSurfaceFormats is not NULL, pSurfaceFormats must be a valid pointer to an array of pSurfaceFormatCount VkSurfaceFormat2KHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceFormats-parameter)"}, + {VALIDATION_ERROR_2e825001, "The spec valid usage text states 'pSurfaceInfo must be a valid pointer to a valid VkPhysicalDeviceSurfaceInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceInfo-parameter)"}, + {VALIDATION_ERROR_2e827a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2ea00009, "The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-commonparent)"}, + {VALIDATION_ERROR_2ea24c01, "The spec valid usage text states 'pSurfaceFormatCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormatCount-parameter)"}, + {VALIDATION_ERROR_2ea24e01, "The spec valid usage text states 'If the value referenced by pSurfaceFormatCount is not 0, and pSurfaceFormats is not NULL, pSurfaceFormats must be a valid pointer to an array of pSurfaceFormatCount VkSurfaceFormatKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormats-parameter)"}, + {VALIDATION_ERROR_2ea27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2ea2ec01, "The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-surface-parameter)"}, + {VALIDATION_ERROR_2ec00009, "The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-commonparent)"}, + {VALIDATION_ERROR_2ec1e801, "The spec valid usage text states 'pPresentModeCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModeCount-parameter)"}, + {VALIDATION_ERROR_2ec1ea01, "The spec valid usage text states 'If the value referenced by pPresentModeCount is not 0, and pPresentModes is not NULL, pPresentModes must be a valid pointer to an array of pPresentModeCount VkPresentModeKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModes-parameter)"}, + {VALIDATION_ERROR_2ec27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2ec2ec01, "The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-surface-parameter)"}, + {VALIDATION_ERROR_2ee00009, "The spec valid usage text states 'Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-commonparent)"}, + {VALIDATION_ERROR_2ee009ea, "The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-queueFamilyIndex-01269)"}, + {VALIDATION_ERROR_2ee24601, "The spec valid usage text states 'pSupported must be a valid pointer to a VkBool32 value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-pSupported-parameter)"}, + {VALIDATION_ERROR_2ee27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2ee2ec01, "The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter)"}, + {VALIDATION_ERROR_2f000a34, "The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-queueFamilyIndex-01306)"}, + {VALIDATION_ERROR_2f006001, "The spec valid usage text states 'display must be a valid pointer to a wl_display value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-display-parameter)"}, + {VALIDATION_ERROR_2f027a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2f200a3a, "The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceWin32PresentationSupportKHR-queueFamilyIndex-01309)"}, + {VALIDATION_ERROR_2f227a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceWin32PresentationSupportKHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2f400a40, "The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-queueFamilyIndex-01312)"}, + {VALIDATION_ERROR_2f403001, "The spec valid usage text states 'connection must be a valid pointer to a xcb_connection_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-connection-parameter)"}, + {VALIDATION_ERROR_2f427a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2f600a46, "The spec valid usage text states 'queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-queueFamilyIndex-01315)"}, + {VALIDATION_ERROR_2f606601, "The spec valid usage text states 'dpy must be a valid pointer to a Display value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-dpy-parameter)"}, + {VALIDATION_ERROR_2f627a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-physicalDevice-parameter)"}, {VALIDATION_ERROR_2f805601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPipelineCacheData-device-parameter)"}, {VALIDATION_ERROR_2f812201, "The spec valid usage text states 'If the value referenced by pDataSize is not 0, and pData is not NULL, pData must be a valid pointer to an array of pDataSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPipelineCacheData-pData-parameter)"}, {VALIDATION_ERROR_2f812401, "The spec valid usage text states 'pDataSize must be a valid pointer to a size_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPipelineCacheData-pDataSize-parameter)"}, @@ -6965,59 +7216,42 @@ {VALIDATION_ERROR_2fa12201, "The spec valid usage text states 'pData must be a valid pointer to an array of dataSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetQueryPoolResults-pData-parameter)"}, {VALIDATION_ERROR_2fa29801, "The spec valid usage text states 'queryPool must be a valid VkQueryPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetQueryPoolResults-queryPool-parameter)"}, {VALIDATION_ERROR_2fa29807, "The spec valid usage text states 'queryPool must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetQueryPoolResults-queryPool-parent)"}, - {VALIDATION_ERROR_2fc06601, "The spec valid usage text states 'dpy must be a valid pointer to a Display value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRandROutputDisplayEXT-dpy-parameter)"}, - {VALIDATION_ERROR_2fc14801, "The spec valid usage text states 'pDisplay must be a valid pointer to a VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRandROutputDisplayEXT-pDisplay-parameter)"}, - {VALIDATION_ERROR_2fc27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRandROutputDisplayEXT-physicalDevice-parameter)"}, - {VALIDATION_ERROR_2fe00009, "The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRefreshCycleDurationGOOGLE-commonparent)"}, - {VALIDATION_ERROR_2fe05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRefreshCycleDurationGOOGLE-device-parameter)"}, - {VALIDATION_ERROR_2fe15001, "The spec valid usage text states 'pDisplayTimingProperties must be a valid pointer to a VkRefreshCycleDurationGOOGLE structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRefreshCycleDurationGOOGLE-pDisplayTimingProperties-parameter)"}, - {VALIDATION_ERROR_2fe2f001, "The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRefreshCycleDurationGOOGLE-swapchain-parameter)"}, + {VALIDATION_ERROR_2fc06601, "The spec valid usage text states 'dpy must be a valid pointer to a Display value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetRandROutputDisplayEXT-dpy-parameter)"}, + {VALIDATION_ERROR_2fc14801, "The spec valid usage text states 'pDisplay must be a valid pointer to a VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetRandROutputDisplayEXT-pDisplay-parameter)"}, + {VALIDATION_ERROR_2fc27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetRandROutputDisplayEXT-physicalDevice-parameter)"}, + {VALIDATION_ERROR_2fe00009, "The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetRefreshCycleDurationGOOGLE-commonparent)"}, + {VALIDATION_ERROR_2fe05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetRefreshCycleDurationGOOGLE-device-parameter)"}, + {VALIDATION_ERROR_2fe15001, "The spec valid usage text states 'pDisplayTimingProperties must be a valid pointer to a VkRefreshCycleDurationGOOGLE structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetRefreshCycleDurationGOOGLE-pDisplayTimingProperties-parameter)"}, + {VALIDATION_ERROR_2fe2f001, "The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetRefreshCycleDurationGOOGLE-swapchain-parameter)"}, {VALIDATION_ERROR_30005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRenderAreaGranularity-device-parameter)"}, {VALIDATION_ERROR_30017a01, "The spec valid usage text states 'pGranularity must be a valid pointer to a VkExtent2D structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRenderAreaGranularity-pGranularity-parameter)"}, {VALIDATION_ERROR_3002ae01, "The spec valid usage text states 'renderPass must be a valid VkRenderPass handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRenderAreaGranularity-renderPass-parameter)"}, {VALIDATION_ERROR_3002ae07, "The spec valid usage text states 'renderPass must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetRenderAreaGranularity-renderPass-parent)"}, - {VALIDATION_ERROR_302008d8, "The spec valid usage text states 'handleType must have been included in VkExportSemaphoreCreateInfoKHR::handleTypes when semaphore's current payload was created.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-handleType-01132)"}, - {VALIDATION_ERROR_302008da, "The spec valid usage text states 'semaphore must not currently have its payload replaced by an imported payload as described below in Importing Semaphore Payloads unless that imported payload's handle type was included in VkExternalSemaphorePropertiesKHR::exportFromImportedHandleTypes for handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-semaphore-01133)"}, - {VALIDATION_ERROR_302008dc, "The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, as defined below in Importing Semaphore Payloads, there must be no queue waiting on semaphore.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-handleType-01134)"}, - {VALIDATION_ERROR_302008de, "The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, semaphore must be signaled, or have an associated semaphore signal operation pending execution.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-handleType-01135)"}, - {VALIDATION_ERROR_302008e0, "The spec valid usage text states 'handleType must be defined as a POSIX file descriptor handle.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-handleType-01136)"}, - {VALIDATION_ERROR_30205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-device-parameter)"}, - {VALIDATION_ERROR_30209c01, "The spec valid usage text states 'handleType must be a valid VkExternalSemaphoreHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-handleType-parameter)"}, - {VALIDATION_ERROR_30216c01, "The spec valid usage text states 'pFd must be a valid pointer to a int value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-pFd-parameter)"}, - {VALIDATION_ERROR_3022b801, "The spec valid usage text states 'semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-semaphore-parameter)"}, - {VALIDATION_ERROR_3022b807, "The spec valid usage text states 'semaphore must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-semaphore-parent)"}, - {VALIDATION_ERROR_30239e01, "The spec valid usage text states 'pGetFdInfo must be a valid pointer to a valid VkSemaphoreGetFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-pGetFdInfo-parameter)"}, - {VALIDATION_ERROR_304008cc, "The spec valid usage text states 'handleType must have been included in VkExportSemaphoreCreateInfoKHR::handleTypes when the semaphore's current payload was created.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-handleType-01126)"}, - {VALIDATION_ERROR_304008ce, "The spec valid usage text states 'If handleType is defined as an NT handle, vkGetSemaphoreWin32HandleKHR must be called no more than once for each valid unique combination of semaphore and handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-handleType-01127)"}, - {VALIDATION_ERROR_304008d0, "The spec valid usage text states 'semaphore must not currently have its payload replaced by an imported payload as described below in Importing Semaphore Payloads unless that imported payload's handle type was included in VkExternalSemaphorePropertiesKHR::exportFromImportedHandleTypes for handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-semaphore-01128)"}, - {VALIDATION_ERROR_304008d2, "The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, as defined below in Importing Semaphore Payloads, there must be no queue waiting on semaphore.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-handleType-01129)"}, - {VALIDATION_ERROR_304008d4, "The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, semaphore must be signaled, or have an associated semaphore signal operation pending execution.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-handleType-01130)"}, - {VALIDATION_ERROR_304008d6, "The spec valid usage text states 'handleType must be defined as an NT handle or a global share handle.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-handleType-01131)"}, - {VALIDATION_ERROR_30405601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-device-parameter)"}, - {VALIDATION_ERROR_30409c01, "The spec valid usage text states 'handleType must be a valid VkExternalSemaphoreHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-handleType-parameter)"}, - {VALIDATION_ERROR_30417c01, "The spec valid usage text states 'pHandle must be a valid pointer to a HANDLE value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-pHandle-parameter)"}, - {VALIDATION_ERROR_3042b801, "The spec valid usage text states 'semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-semaphore-parameter)"}, - {VALIDATION_ERROR_3042b807, "The spec valid usage text states 'semaphore must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-semaphore-parent)"}, - {VALIDATION_ERROR_3043a001, "The spec valid usage text states 'pGetWin32HandleInfo must be a valid pointer to a valid VkSemaphoreGetWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-pGetWin32HandleInfo-parameter)"}, - {VALIDATION_ERROR_30600009, "The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-commonparent)"}, - {VALIDATION_ERROR_306009ba, "The spec valid usage text states 'One or more present commands on swapchain must have been processed by the presentation engine.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-swapchain-01245)"}, - {VALIDATION_ERROR_30603601, "The spec valid usage text states 'counter must be a valid VkSurfaceCounterFlagBitsEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-counter-parameter)"}, - {VALIDATION_ERROR_30605601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-device-parameter)"}, - {VALIDATION_ERROR_30611c01, "The spec valid usage text states 'pCounterValue must be a valid pointer to a uint64_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-pCounterValue-parameter)"}, - {VALIDATION_ERROR_3062f001, "The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-swapchain-parameter)"}, - {VALIDATION_ERROR_30800009, "The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-commonparent)"}, - {VALIDATION_ERROR_30805601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-device-parameter)"}, - {VALIDATION_ERROR_30825401, "The spec valid usage text states 'pSwapchainImageCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-pSwapchainImageCount-parameter)"}, - {VALIDATION_ERROR_30825601, "The spec valid usage text states 'If the value referenced by pSwapchainImageCount is not 0, and pSwapchainImages is not NULL, pSwapchainImages must be a valid pointer to an array of pSwapchainImageCount VkImage handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-pSwapchainImages-parameter)"}, - {VALIDATION_ERROR_3082f001, "The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-swapchain-parameter)"}, - {VALIDATION_ERROR_30a00009, "The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainStatusKHR-commonparent)"}, - {VALIDATION_ERROR_30a05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainStatusKHR-device-parameter)"}, - {VALIDATION_ERROR_30a2f001, "The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetSwapchainStatusKHR-swapchain-parameter)"}, - {VALIDATION_ERROR_30c008ec, "The spec valid usage text states 'semaphore must not be associated with any queue command that has not yet completed execution on that queue' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportSemaphoreFdKHR-semaphore-01142)"}, - {VALIDATION_ERROR_30c05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportSemaphoreFdKHR-device-parameter)"}, - {VALIDATION_ERROR_30c18e01, "The spec valid usage text states 'pImportSemaphoreFdInfo must be a valid pointer to a valid VkImportSemaphoreFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportSemaphoreFdKHR-pImportSemaphoreFdInfo-parameter)"}, - {VALIDATION_ERROR_30e05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportSemaphoreWin32HandleKHR-device-parameter)"}, - {VALIDATION_ERROR_30e19001, "The spec valid usage text states 'pImportSemaphoreWin32HandleInfo must be a valid pointer to a valid VkImportSemaphoreWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportSemaphoreWin32HandleKHR-pImportSemaphoreWin32HandleInfo-parameter)"}, + {VALIDATION_ERROR_30205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-device-parameter)"}, + {VALIDATION_ERROR_30216c01, "The spec valid usage text states 'pFd must be a valid pointer to a int value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-pFd-parameter)"}, + {VALIDATION_ERROR_30239e01, "The spec valid usage text states 'pGetFdInfo must be a valid pointer to a valid VkSemaphoreGetFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSemaphoreFdKHR-pGetFdInfo-parameter)"}, + {VALIDATION_ERROR_30405601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-device-parameter)"}, + {VALIDATION_ERROR_30417c01, "The spec valid usage text states 'pHandle must be a valid pointer to a HANDLE value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-pHandle-parameter)"}, + {VALIDATION_ERROR_3043a001, "The spec valid usage text states 'pGetWin32HandleInfo must be a valid pointer to a valid VkSemaphoreGetWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSemaphoreWin32HandleKHR-pGetWin32HandleInfo-parameter)"}, + {VALIDATION_ERROR_30600009, "The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-commonparent)"}, + {VALIDATION_ERROR_306009ba, "The spec valid usage text states 'One or more present commands on swapchain must have been processed by the presentation engine.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-swapchain-01245)"}, + {VALIDATION_ERROR_30603601, "The spec valid usage text states 'counter must be a valid VkSurfaceCounterFlagBitsEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-counter-parameter)"}, + {VALIDATION_ERROR_30605601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-device-parameter)"}, + {VALIDATION_ERROR_30611c01, "The spec valid usage text states 'pCounterValue must be a valid pointer to a uint64_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-pCounterValue-parameter)"}, + {VALIDATION_ERROR_3062f001, "The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainCounterEXT-swapchain-parameter)"}, + {VALIDATION_ERROR_30800009, "The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-commonparent)"}, + {VALIDATION_ERROR_30805601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-device-parameter)"}, + {VALIDATION_ERROR_30825401, "The spec valid usage text states 'pSwapchainImageCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-pSwapchainImageCount-parameter)"}, + {VALIDATION_ERROR_30825601, "The spec valid usage text states 'If the value referenced by pSwapchainImageCount is not 0, and pSwapchainImages is not NULL, pSwapchainImages must be a valid pointer to an array of pSwapchainImageCount VkImage handles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-pSwapchainImages-parameter)"}, + {VALIDATION_ERROR_3082f001, "The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainImagesKHR-swapchain-parameter)"}, + {VALIDATION_ERROR_30a00009, "The spec valid usage text states 'Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainStatusKHR-commonparent)"}, + {VALIDATION_ERROR_30a05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainStatusKHR-device-parameter)"}, + {VALIDATION_ERROR_30a2f001, "The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetSwapchainStatusKHR-swapchain-parameter)"}, + {VALIDATION_ERROR_30c008ec, "The spec valid usage text states 'semaphore must not be associated with any queue command that has not yet completed execution on that queue' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportSemaphoreFdKHR-semaphore-01142)"}, + {VALIDATION_ERROR_30c05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportSemaphoreFdKHR-device-parameter)"}, + {VALIDATION_ERROR_30c18e01, "The spec valid usage text states 'pImportSemaphoreFdInfo must be a valid pointer to a valid VkImportSemaphoreFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportSemaphoreFdKHR-pImportSemaphoreFdInfo-parameter)"}, + {VALIDATION_ERROR_30e05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportSemaphoreWin32HandleKHR-device-parameter)"}, + {VALIDATION_ERROR_30e19001, "The spec valid usage text states 'pImportSemaphoreWin32HandleInfo must be a valid pointer to a valid VkImportSemaphoreWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportSemaphoreWin32HandleKHR-pImportSemaphoreWin32HandleInfo-parameter)"}, {VALIDATION_ERROR_31005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkInvalidateMappedMemoryRanges-device-parameter)"}, {VALIDATION_ERROR_3100c81b, "The spec valid usage text states 'memoryRangeCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkInvalidateMappedMemoryRanges-memoryRangeCount-arraylength)"}, {VALIDATION_ERROR_3101b201, "The spec valid usage text states 'pMemoryRanges must be a valid pointer to an array of memoryRangeCount valid VkMappedMemoryRange structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkInvalidateMappedMemoryRanges-pMemoryRanges-parameter)"}, @@ -7049,12 +7283,12 @@ {VALIDATION_ERROR_31608801, "The spec valid usage text states 'If fence is not VK_NULL_HANDLE, fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueBindSparse-fence-parameter)"}, {VALIDATION_ERROR_3160f801, "The spec valid usage text states 'If bindInfoCount is not 0, pBindInfo must be a valid pointer to an array of bindInfoCount valid VkBindSparseInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueBindSparse-pBindInfo-parameter)"}, {VALIDATION_ERROR_31629c01, "The spec valid usage text states 'queue must be a valid VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueBindSparse-queue-parameter)"}, - {VALIDATION_ERROR_31800a18, "The spec valid usage text states 'Each element of pSwapchains member of pPresentInfo must be a swapchain that is created for a surface for which presentation is supported from queue as determined using a call to vkGetPhysicalDeviceSurfaceSupportKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueuePresentKHR-pSwapchains-01292)"}, + {VALIDATION_ERROR_31800a18, "The spec valid usage text states 'Each element of pSwapchains member of pPresentInfo must be a swapchain that is created for a surface for which presentation is supported from queue as determined using a call to vkGetPhysicalDeviceSurfaceSupportKHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueuePresentKHR-pSwapchains-01292)"}, {VALIDATION_ERROR_31800a1a, "The spec valid usage text states 'If more than one member of pSwapchains was created from a display surface, all display surfaces referenced that refer to the same display must use the same display mode' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueuePresentKHR-pSwapchains-01293)"}, - {VALIDATION_ERROR_31800a1c, "The spec valid usage text states 'When a semaphore unsignal operation defined by the elements of the pWaitSemaphores member of pPresentInfo executes on queue, no other queue must be waiting on the same semaphore.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueuePresentKHR-pWaitSemaphores-01294)"}, - {VALIDATION_ERROR_31800a1e, "The spec valid usage text states 'All elements of the pWaitSemaphores member of pPresentInfo must be semaphores that are signaled, or have semaphore signal operations previously submitted for execution.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueuePresentKHR-pWaitSemaphores-01295)"}, - {VALIDATION_ERROR_3181e601, "The spec valid usage text states 'pPresentInfo must be a valid pointer to a valid VkPresentInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueuePresentKHR-pPresentInfo-parameter)"}, - {VALIDATION_ERROR_31829c01, "The spec valid usage text states 'queue must be a valid VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueuePresentKHR-queue-parameter)"}, + {VALIDATION_ERROR_31800a1c, "The spec valid usage text states 'When a semaphore unsignal operation defined by the elements of the pWaitSemaphores member of pPresentInfo executes on queue, no other queue must be waiting on the same semaphore.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueuePresentKHR-pWaitSemaphores-01294)"}, + {VALIDATION_ERROR_31800a1e, "The spec valid usage text states 'All elements of the pWaitSemaphores member of pPresentInfo must be semaphores that are signaled, or have semaphore signal operations previously submitted for execution.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueuePresentKHR-pWaitSemaphores-01295)"}, + {VALIDATION_ERROR_3181e601, "The spec valid usage text states 'pPresentInfo must be a valid pointer to a valid VkPresentInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueuePresentKHR-pPresentInfo-parameter)"}, + {VALIDATION_ERROR_31829c01, "The spec valid usage text states 'queue must be a valid VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueuePresentKHR-queue-parameter)"}, {VALIDATION_ERROR_31a00009, "The spec valid usage text states 'Both of fence, and queue that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueSubmit-commonparent)"}, {VALIDATION_ERROR_31a0007e, "The spec valid usage text states 'If fence is not VK_NULL_HANDLE, fence must be unsignaled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueSubmit-fence-00063)"}, {VALIDATION_ERROR_31a00080, "The spec valid usage text states 'If fence is not VK_NULL_HANDLE, fence must not be associated with any other queue command that has not yet completed execution on that queue' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueSubmit-fence-00064)"}, @@ -7072,26 +7306,26 @@ {VALIDATION_ERROR_31a24001, "The spec valid usage text states 'If submitCount is not 0, pSubmits must be a valid pointer to an array of submitCount valid VkSubmitInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueSubmit-pSubmits-parameter)"}, {VALIDATION_ERROR_31a29c01, "The spec valid usage text states 'queue must be a valid VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueSubmit-queue-parameter)"}, {VALIDATION_ERROR_31c29c01, "The spec valid usage text states 'queue must be a valid VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueWaitIdle-queue-parameter)"}, - {VALIDATION_ERROR_31e05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterDeviceEventEXT-device-parameter)"}, - {VALIDATION_ERROR_31e0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterDeviceEventEXT-pAllocator-parameter)"}, - {VALIDATION_ERROR_31e13a01, "The spec valid usage text states 'pDeviceEventInfo must be a valid pointer to a valid VkDeviceEventInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterDeviceEventEXT-pDeviceEventInfo-parameter)"}, - {VALIDATION_ERROR_31e17001, "The spec valid usage text states 'pFence must be a valid pointer to a VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterDeviceEventEXT-pFence-parameter)"}, - {VALIDATION_ERROR_32005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-device-parameter)"}, - {VALIDATION_ERROR_32006001, "The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-display-parameter)"}, - {VALIDATION_ERROR_3200ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-pAllocator-parameter)"}, - {VALIDATION_ERROR_32014c01, "The spec valid usage text states 'pDisplayEventInfo must be a valid pointer to a valid VkDisplayEventInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-pDisplayEventInfo-parameter)"}, - {VALIDATION_ERROR_32017001, "The spec valid usage text states 'pFence must be a valid pointer to a VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-pFence-parameter)"}, - {VALIDATION_ERROR_32200aa8, "The spec valid usage text states 'The contents of pObjectTableEntry must yield plausible bindings supported by the device.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterObjectsNVX-pObjectTableEntry-01364)"}, - {VALIDATION_ERROR_32200aaa, "The spec valid usage text states 'At any pObjectIndices there must not be a registered resource already.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterObjectsNVX-pObjectIndices-01365)"}, - {VALIDATION_ERROR_32200aac, "The spec valid usage text states 'Any value inside pObjectIndices must be below the appropriate VkObjectTableCreateInfoNVX::pObjectEntryCounts limits provided at objectTable creation time.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterObjectsNVX-pObjectIndices-01366)"}, - {VALIDATION_ERROR_32205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterObjectsNVX-device-parameter)"}, - {VALIDATION_ERROR_3220d61b, "The spec valid usage text states 'objectCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterObjectsNVX-objectCount-arraylength)"}, - {VALIDATION_ERROR_3220d801, "The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterObjectsNVX-objectTable-parameter)"}, - {VALIDATION_ERROR_3220d807, "The spec valid usage text states 'objectTable must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterObjectsNVX-objectTable-parent)"}, - {VALIDATION_ERROR_3221cc01, "The spec valid usage text states 'pObjectIndices must be a valid pointer to an array of objectCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterObjectsNVX-pObjectIndices-parameter)"}, - {VALIDATION_ERROR_32229201, "The spec valid usage text states 'ppObjectTableEntries must be a valid pointer to an array of objectCount valid VkObjectTableEntryNVX structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkRegisterObjectsNVX-ppObjectTableEntries-parameter)"}, - {VALIDATION_ERROR_32406001, "The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkReleaseDisplayEXT-display-parameter)"}, - {VALIDATION_ERROR_32427a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkReleaseDisplayEXT-physicalDevice-parameter)"}, + {VALIDATION_ERROR_31e05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterDeviceEventEXT-device-parameter)"}, + {VALIDATION_ERROR_31e0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterDeviceEventEXT-pAllocator-parameter)"}, + {VALIDATION_ERROR_31e13a01, "The spec valid usage text states 'pDeviceEventInfo must be a valid pointer to a valid VkDeviceEventInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterDeviceEventEXT-pDeviceEventInfo-parameter)"}, + {VALIDATION_ERROR_31e17001, "The spec valid usage text states 'pFence must be a valid pointer to a VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterDeviceEventEXT-pFence-parameter)"}, + {VALIDATION_ERROR_32005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-device-parameter)"}, + {VALIDATION_ERROR_32006001, "The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-display-parameter)"}, + {VALIDATION_ERROR_3200ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-pAllocator-parameter)"}, + {VALIDATION_ERROR_32014c01, "The spec valid usage text states 'pDisplayEventInfo must be a valid pointer to a valid VkDisplayEventInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-pDisplayEventInfo-parameter)"}, + {VALIDATION_ERROR_32017001, "The spec valid usage text states 'pFence must be a valid pointer to a VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterDisplayEventEXT-pFence-parameter)"}, + {VALIDATION_ERROR_32200aa8, "The spec valid usage text states 'The contents of pObjectTableEntry must yield plausible bindings supported by the device.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterObjectsNVX-pObjectTableEntry-01364)"}, + {VALIDATION_ERROR_32200aaa, "The spec valid usage text states 'At any pObjectIndices there must not be a registered resource already.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterObjectsNVX-pObjectIndices-01365)"}, + {VALIDATION_ERROR_32200aac, "The spec valid usage text states 'Any value inside pObjectIndices must be below the appropriate VkObjectTableCreateInfoNVX::pObjectEntryCounts limits provided at objectTable creation time.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterObjectsNVX-pObjectIndices-01366)"}, + {VALIDATION_ERROR_32205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterObjectsNVX-device-parameter)"}, + {VALIDATION_ERROR_3220d61b, "The spec valid usage text states 'objectCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterObjectsNVX-objectCount-arraylength)"}, + {VALIDATION_ERROR_3220d801, "The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterObjectsNVX-objectTable-parameter)"}, + {VALIDATION_ERROR_3220d807, "The spec valid usage text states 'objectTable must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterObjectsNVX-objectTable-parent)"}, + {VALIDATION_ERROR_3221cc01, "The spec valid usage text states 'pObjectIndices must be a valid pointer to an array of objectCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterObjectsNVX-pObjectIndices-parameter)"}, + {VALIDATION_ERROR_32229201, "The spec valid usage text states 'ppObjectTableEntries must be a valid pointer to an array of objectCount valid VkObjectTableEntryNVX structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkRegisterObjectsNVX-ppObjectTableEntries-parameter)"}, + {VALIDATION_ERROR_32406001, "The spec valid usage text states 'display must be a valid VkDisplayKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkReleaseDisplayEXT-display-parameter)"}, + {VALIDATION_ERROR_32427a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkReleaseDisplayEXT-physicalDevice-parameter)"}, {VALIDATION_ERROR_3260005a, "The spec valid usage text states 'commandBuffer must not be in the pending state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkResetCommandBuffer-commandBuffer-00045)"}, {VALIDATION_ERROR_3260005c, "The spec valid usage text states 'commandBuffer must have been allocated from a pool that was created with the VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkResetCommandBuffer-commandBuffer-00046)"}, {VALIDATION_ERROR_32602401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkResetCommandBuffer-commandBuffer-parameter)"}, @@ -7118,35 +7352,35 @@ {VALIDATION_ERROR_33005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkSetEvent-device-parameter)"}, {VALIDATION_ERROR_33007e01, "The spec valid usage text states 'event must be a valid VkEvent handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkSetEvent-event-parameter)"}, {VALIDATION_ERROR_33007e07, "The spec valid usage text states 'event must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkSetEvent-event-parent)"}, - {VALIDATION_ERROR_33200009, "The spec valid usage text states 'Both of device, and the elements of pSwapchains must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkSetHdrMetadataEXT-commonparent)"}, - {VALIDATION_ERROR_33205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkSetHdrMetadataEXT-device-parameter)"}, - {VALIDATION_ERROR_3321ba01, "The spec valid usage text states 'pMetadata must be a valid pointer to an array of swapchainCount valid VkHdrMetadataEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkSetHdrMetadataEXT-pMetadata-parameter)"}, - {VALIDATION_ERROR_33225801, "The spec valid usage text states 'pSwapchains must be a valid pointer to an array of swapchainCount valid VkSwapchainKHR handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkSetHdrMetadataEXT-pSwapchains-parameter)"}, - {VALIDATION_ERROR_3322f21b, "The spec valid usage text states 'swapchainCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkSetHdrMetadataEXT-swapchainCount-arraylength)"}, - {VALIDATION_ERROR_33402801, "The spec valid usage text states 'commandPool must be a valid VkCommandPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkTrimCommandPoolKHR-commandPool-parameter)"}, - {VALIDATION_ERROR_33402807, "The spec valid usage text states 'commandPool must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkTrimCommandPoolKHR-commandPool-parent)"}, - {VALIDATION_ERROR_33405601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkTrimCommandPoolKHR-device-parameter)"}, - {VALIDATION_ERROR_33409005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkTrimCommandPoolKHR-flags-zerobitmask)"}, + {VALIDATION_ERROR_33200009, "The spec valid usage text states 'Both of device, and the elements of pSwapchains must have been created, allocated, or retrieved from the same VkInstance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSetHdrMetadataEXT-commonparent)"}, + {VALIDATION_ERROR_33205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSetHdrMetadataEXT-device-parameter)"}, + {VALIDATION_ERROR_3321ba01, "The spec valid usage text states 'pMetadata must be a valid pointer to an array of swapchainCount valid VkHdrMetadataEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSetHdrMetadataEXT-pMetadata-parameter)"}, + {VALIDATION_ERROR_33225801, "The spec valid usage text states 'pSwapchains must be a valid pointer to an array of swapchainCount valid VkSwapchainKHR handles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSetHdrMetadataEXT-pSwapchains-parameter)"}, + {VALIDATION_ERROR_3322f21b, "The spec valid usage text states 'swapchainCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSetHdrMetadataEXT-swapchainCount-arraylength)"}, + {VALIDATION_ERROR_33402801, "The spec valid usage text states 'commandPool must be a valid VkCommandPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkTrimCommandPool-commandPool-parameter)"}, + {VALIDATION_ERROR_33402807, "The spec valid usage text states 'commandPool must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkTrimCommandPool-commandPool-parent)"}, + {VALIDATION_ERROR_33405601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkTrimCommandPool-device-parameter)"}, + {VALIDATION_ERROR_33409005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkTrimCommandPool-flags-zerobitmask)"}, {VALIDATION_ERROR_33600562, "The spec valid usage text states 'memory must be currently mapped' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnmapMemory-memory-00689)"}, {VALIDATION_ERROR_33605601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnmapMemory-device-parameter)"}, {VALIDATION_ERROR_3360c601, "The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnmapMemory-memory-parameter)"}, {VALIDATION_ERROR_3360c607, "The spec valid usage text states 'memory must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnmapMemory-memory-parent)"}, - {VALIDATION_ERROR_33800aba, "The spec valid usage text states 'At any pObjectIndices there must be a registered resource already.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnregisterObjectsNVX-pObjectIndices-01373)"}, - {VALIDATION_ERROR_33800abc, "The spec valid usage text states 'The pObjectEntryTypes of the resource at pObjectIndices must match.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnregisterObjectsNVX-pObjectEntryTypes-01374)"}, - {VALIDATION_ERROR_33800abe, "The spec valid usage text states 'All operations on the device using the registered resource must have been completed.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnregisterObjectsNVX-None-01375)"}, - {VALIDATION_ERROR_33805601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnregisterObjectsNVX-device-parameter)"}, - {VALIDATION_ERROR_3380d61b, "The spec valid usage text states 'objectCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnregisterObjectsNVX-objectCount-arraylength)"}, - {VALIDATION_ERROR_3380d801, "The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnregisterObjectsNVX-objectTable-parameter)"}, - {VALIDATION_ERROR_3380d807, "The spec valid usage text states 'objectTable must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnregisterObjectsNVX-objectTable-parent)"}, - {VALIDATION_ERROR_3381c801, "The spec valid usage text states 'pObjectEntryTypes must be a valid pointer to an array of objectCount valid VkObjectEntryTypeNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnregisterObjectsNVX-pObjectEntryTypes-parameter)"}, - {VALIDATION_ERROR_3381cc01, "The spec valid usage text states 'pObjectIndices must be a valid pointer to an array of objectCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUnregisterObjectsNVX-pObjectIndices-parameter)"}, - {VALIDATION_ERROR_33a00d2a, "The spec valid usage text states 'pData must be a valid pointer to a memory that contains one or more valid instances of VkDescriptorImageInfo, VkDescriptorBufferInfo, or VkBufferView in a layout defined by descriptorUpdateTemplate when it was created with vkCreateDescriptorUpdateTemplateKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplateKHR-pData-01685)"}, - {VALIDATION_ERROR_33a04801, "The spec valid usage text states 'descriptorSet must be a valid VkDescriptorSet handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplateKHR-descriptorSet-parameter)"}, - {VALIDATION_ERROR_33a05201, "The spec valid usage text states 'descriptorUpdateTemplate must be a valid VkDescriptorUpdateTemplateKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplateKHR-descriptorUpdateTemplate-parameter)"}, - {VALIDATION_ERROR_33a05207, "The spec valid usage text states 'descriptorUpdateTemplate must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplateKHR-descriptorUpdateTemplate-parent)"}, - {VALIDATION_ERROR_33a05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplateKHR-device-parameter)"}, - {VALIDATION_ERROR_33a12201, "The spec valid usage text states 'pData must be a pointer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplateKHR-pData-parameter)"}, + {VALIDATION_ERROR_33800aba, "The spec valid usage text states 'At any pObjectIndices there must be a registered resource already.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUnregisterObjectsNVX-pObjectIndices-01373)"}, + {VALIDATION_ERROR_33800abc, "The spec valid usage text states 'The pObjectEntryTypes of the resource at pObjectIndices must match.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUnregisterObjectsNVX-pObjectEntryTypes-01374)"}, + {VALIDATION_ERROR_33800abe, "The spec valid usage text states 'All operations on the device using the registered resource must have been completed.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUnregisterObjectsNVX-None-01375)"}, + {VALIDATION_ERROR_33805601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUnregisterObjectsNVX-device-parameter)"}, + {VALIDATION_ERROR_3380d61b, "The spec valid usage text states 'objectCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUnregisterObjectsNVX-objectCount-arraylength)"}, + {VALIDATION_ERROR_3380d801, "The spec valid usage text states 'objectTable must be a valid VkObjectTableNVX handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUnregisterObjectsNVX-objectTable-parameter)"}, + {VALIDATION_ERROR_3380d807, "The spec valid usage text states 'objectTable must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUnregisterObjectsNVX-objectTable-parent)"}, + {VALIDATION_ERROR_3381c801, "The spec valid usage text states 'pObjectEntryTypes must be a valid pointer to an array of objectCount valid VkObjectEntryTypeNVX values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUnregisterObjectsNVX-pObjectEntryTypes-parameter)"}, + {VALIDATION_ERROR_3381cc01, "The spec valid usage text states 'pObjectIndices must be a valid pointer to an array of objectCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUnregisterObjectsNVX-pObjectIndices-parameter)"}, + {VALIDATION_ERROR_33a00d2a, "The spec valid usage text states 'pData must be a valid pointer to a memory that contains one or more valid instances of VkDescriptorImageInfo, VkDescriptorBufferInfo, or VkBufferView in a layout defined by descriptorUpdateTemplate when it was created with vkCreateDescriptorUpdateTemplate' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplate-pData-01685)"}, + {VALIDATION_ERROR_33a04801, "The spec valid usage text states 'descriptorSet must be a valid VkDescriptorSet handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplate-descriptorSet-parameter)"}, + {VALIDATION_ERROR_33a05201, "The spec valid usage text states 'descriptorUpdateTemplate must be a valid VkDescriptorUpdateTemplate handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplate-descriptorUpdateTemplate-parameter)"}, + {VALIDATION_ERROR_33a05207, "The spec valid usage text states 'descriptorUpdateTemplate must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplate-descriptorUpdateTemplate-parent)"}, + {VALIDATION_ERROR_33a05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUpdateDescriptorSetWithTemplate-device-parameter)"}, {VALIDATION_ERROR_33c00274, "The spec valid usage text states 'The dstSet member of each element of pDescriptorWrites or pDescriptorCopies must not be used by any command that was recorded to a command buffer which is in the pending state.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSets-dstSet-00314)"}, + {VALIDATION_ERROR_33c017ce, "The spec valid usage text states 'Descriptor bindings updated by this command which were created without the VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT or VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT bits set must not be used by any command that was recorded to a command buffer which is in the pending state.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkUpdateDescriptorSets-None-03047)"}, {VALIDATION_ERROR_33c05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSets-device-parameter)"}, {VALIDATION_ERROR_33c12c01, "The spec valid usage text states 'If descriptorCopyCount is not 0, pDescriptorCopies must be a valid pointer to an array of descriptorCopyCount valid VkCopyDescriptorSet structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSets-pDescriptorCopies-parameter)"}, {VALIDATION_ERROR_33c13601, "The spec valid usage text states 'If descriptorWriteCount is not 0, pDescriptorWrites must be a valid pointer to an array of descriptorWriteCount valid VkWriteDescriptorSet structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkUpdateDescriptorSets-pDescriptorWrites-parameter)"}, @@ -7154,331 +7388,4436 @@ {VALIDATION_ERROR_33e08a1b, "The spec valid usage text states 'fenceCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkWaitForFences-fenceCount-arraylength)"}, {VALIDATION_ERROR_33e17201, "The spec valid usage text states 'pFences must be a valid pointer to an array of fenceCount valid VkFence handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkWaitForFences-pFences-parameter)"}, {VALIDATION_ERROR_33e17207, "The spec valid usage text states 'Each element of pFences must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkWaitForFences-pFences-parent)"}, - {VALIDATION_ERROR_3401c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT, VkPhysicalDeviceDiscardRectanglePropertiesEXT, VkPhysicalDeviceIDPropertiesKHR, VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX, VkPhysicalDeviceMultiviewPropertiesKHX, VkPhysicalDevicePointClippingPropertiesKHR, VkPhysicalDevicePushDescriptorPropertiesKHR, VkPhysicalDeviceSampleLocationsPropertiesEXT, or VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceProperties2KHR-pNext-pNext)"}, - {VALIDATION_ERROR_3402b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceProperties2KHR-sType-sType)"}, - {VALIDATION_ERROR_3402b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceProperties2KHR-sType-unique)"}, - {VALIDATION_ERROR_3421c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFormatProperties2KHR-pNext-pNext)"}, - {VALIDATION_ERROR_3422b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFormatProperties2KHR-sType-sType)"}, - {VALIDATION_ERROR_3441c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkExternalImageFormatPropertiesKHR, VkSamplerYcbcrConversionImageFormatPropertiesKHR, or VkTextureLODGatherFormatPropertiesAMD' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageFormatProperties2KHR-pNext-pNext)"}, - {VALIDATION_ERROR_3442b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageFormatProperties2KHR-sType-sType)"}, - {VALIDATION_ERROR_3442b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageFormatProperties2KHR-sType-unique)"}, - {VALIDATION_ERROR_3461c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceMemoryProperties2KHR-pNext-pNext)"}, - {VALIDATION_ERROR_3462b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceMemoryProperties2KHR-sType-sType)"}, - {VALIDATION_ERROR_3481c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkSharedPresentSurfaceCapabilitiesKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSurfaceCapabilities2KHR-pNext-pNext)"}, - {VALIDATION_ERROR_3482b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSurfaceCapabilities2KHR-sType-sType)"}, - {VALIDATION_ERROR_34a1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentCapabilitiesKHX-pNext-pNext)"}, - {VALIDATION_ERROR_34a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceGroupPresentCapabilitiesKHX-sType-sType)"}, - {VALIDATION_ERROR_34c1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalBufferPropertiesKHR-pNext-pNext)"}, - {VALIDATION_ERROR_34c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalBufferPropertiesKHR-sType-sType)"}, - {VALIDATION_ERROR_3521c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalSemaphorePropertiesKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3522b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalSemaphorePropertiesKHR-sType-sType)"}, - {VALIDATION_ERROR_3541c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkQueueFamilyProperties2KHR-pNext-pNext)"}, - {VALIDATION_ERROR_3542b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkQueueFamilyProperties2KHR-sType-sType)"}, - {VALIDATION_ERROR_3561c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseImageFormatProperties2KHR-pNext-pNext)"}, - {VALIDATION_ERROR_3562b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSparseImageFormatProperties2KHR-sType-sType)"}, - {VALIDATION_ERROR_3581c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSurfaceFormat2KHR-pNext-pNext)"}, - {VALIDATION_ERROR_3582b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSurfaceFormat2KHR-sType-sType)"}, - {VALIDATION_ERROR_35c1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceMultiviewPropertiesKHX-pNext-pNext)"}, - {VALIDATION_ERROR_35c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceMultiviewPropertiesKHX-sType-sType)"}, - {VALIDATION_ERROR_3601c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalImageFormatPropertiesKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3602b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalImageFormatPropertiesKHR-sType-sType)"}, - {VALIDATION_ERROR_3621c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceIDPropertiesKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3622b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceIDPropertiesKHR-sType-sType)"}, - {VALIDATION_ERROR_3641c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX-pNext-pNext)"}, - {VALIDATION_ERROR_3642b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX-sType-sType)"}, - {VALIDATION_ERROR_37e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSharedPresentSurfaceCapabilitiesKHR-sType-sType)"}, - {VALIDATION_ERROR_3822b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT-sType-sType)"}, - {VALIDATION_ERROR_3842b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT-sType-sType)"}, - {VALIDATION_ERROR_3861c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT-pNext-pNext)"}, - {VALIDATION_ERROR_3862b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT-sType-sType)"}, - {VALIDATION_ERROR_38800b20, "The spec valid usage text states 'If the non-premultiplied source color property is not supported, srcPremultiplied must be VK_TRUE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-srcPremultiplied-01424)"}, - {VALIDATION_ERROR_38800b22, "The spec valid usage text states 'If the non-premultiplied destination color property is not supported, dstPremultiplied must be VK_TRUE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-dstPremultiplied-01425)"}, - {VALIDATION_ERROR_38800b24, "The spec valid usage text states 'If the correlated overlap property is not supported, blendOverlap must be VK_BLEND_OVERLAP_UNCORRELATED_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-blendOverlap-01426)"}, - {VALIDATION_ERROR_3881c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-pNext-pNext)"}, - {VALIDATION_ERROR_3882b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-sType-sType)"}, - {VALIDATION_ERROR_38834a01, "The spec valid usage text states 'blendOverlap must be a valid VkBlendOverlapEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-blendOverlap-parameter)"}, - {VALIDATION_ERROR_38a00afa, "The spec valid usage text states 'If coverageModulationTableEnable is VK_TRUE, coverageModulationTableCount must be equal to the number of rasterization samples divided by the number of color samples in the subpass.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationTableEnable-01405)"}, - {VALIDATION_ERROR_38a09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-flags-zerobitmask)"}, - {VALIDATION_ERROR_38a1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-pNext-pNext)"}, - {VALIDATION_ERROR_38a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-sType-sType)"}, - {VALIDATION_ERROR_38a34c01, "The spec valid usage text states 'coverageModulationMode must be a valid VkCoverageModulationModeNV value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationMode-parameter)"}, - {VALIDATION_ERROR_38a34e1b, "The spec valid usage text states 'coverageModulationTableCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationTableCount-arraylength)"}, - {VALIDATION_ERROR_38c00af8, "The spec valid usage text states 'If coverageToColorEnable is VK_TRUE, then the render pass subpass indicated by VkGraphicsPipelineCreateInfo::renderPass and VkGraphicsPipelineCreateInfo::subpass must have a color attachment at the location selected by coverageToColorLocation, with a VkFormat of VK_FORMAT_R8_UINT, VK_FORMAT_R8_SINT, VK_FORMAT_R16_UINT, VK_FORMAT_R16_SINT, VK_FORMAT_R32_UINT, or VK_FORMAT_R32_SINT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageToColorStateCreateInfoNV-coverageToColorEnable-01404)"}, - {VALIDATION_ERROR_38c09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageToColorStateCreateInfoNV-flags-zerobitmask)"}, - {VALIDATION_ERROR_38c1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageToColorStateCreateInfoNV-pNext-pNext)"}, - {VALIDATION_ERROR_38c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineCoverageToColorStateCreateInfoNV-sType-sType)"}, - {VALIDATION_ERROR_38e1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerReductionModeCreateInfoEXT-pNext-pNext)"}, - {VALIDATION_ERROR_38e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerReductionModeCreateInfoEXT-sType-sType)"}, - {VALIDATION_ERROR_38e35001, "The spec valid usage text states 'reductionMode must be a valid VkSamplerReductionModeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerReductionModeCreateInfoEXT-reductionMode-parameter)"}, - {VALIDATION_ERROR_39400b4c, "The spec valid usage text states 'The bits in handleTypes must be supported and compatible, as reported by VkExternalFencePropertiesKHR.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportFenceCreateInfoKHR-handleTypes-01446)"}, - {VALIDATION_ERROR_39409e01, "The spec valid usage text states 'handleTypes must be a valid combination of VkExternalFenceHandleTypeFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportFenceCreateInfoKHR-handleTypes-parameter)"}, - {VALIDATION_ERROR_3941c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportFenceCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3942b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportFenceCreateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_39609c01, "The spec valid usage text states 'handleType must be a valid VkExternalFenceHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceExternalFenceInfoKHR-handleType-parameter)"}, - {VALIDATION_ERROR_3961c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceExternalFenceInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3962b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceExternalFenceInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_3981c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalFencePropertiesKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3982b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExternalFencePropertiesKHR-sType-sType)"}, - {VALIDATION_ERROR_39a27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalFencePropertiesKHR-physicalDevice-parameter)"}, - {VALIDATION_ERROR_39a3a201, "The spec valid usage text states 'pExternalFenceInfo must be a valid pointer to a valid VkPhysicalDeviceExternalFenceInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalFencePropertiesKHR-pExternalFenceInfo-parameter)"}, - {VALIDATION_ERROR_39a3a401, "The spec valid usage text states 'pExternalFenceProperties must be a valid pointer to a VkExternalFencePropertiesKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalFencePropertiesKHR-pExternalFenceProperties-parameter)"}, - {VALIDATION_ERROR_39c00b70, "The spec valid usage text states 'handleType must be a value included in the Handle Types Supported by VkImportFenceFdInfoKHR table.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-handleType-01464)"}, - {VALIDATION_ERROR_39c00b72, "The spec valid usage text states 'The fence from which handleType was exported must have been created on the same underlying physical device as fence.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-handleType-01465)"}, - {VALIDATION_ERROR_39c00c0a, "The spec valid usage text states 'fd must obey any requirements listed for handleType in external fence handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-fd-01541)"}, - {VALIDATION_ERROR_39c08801, "The spec valid usage text states 'fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-fence-parameter)"}, - {VALIDATION_ERROR_39c09001, "The spec valid usage text states 'flags must be a valid combination of VkFenceImportFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-flags-parameter)"}, - {VALIDATION_ERROR_39c09c01, "The spec valid usage text states 'handleType must be a valid VkExternalFenceHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-handleType-parameter)"}, - {VALIDATION_ERROR_39c1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_39c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_39e00b5a, "The spec valid usage text states 'handleType must have been included in VkExportFenceCreateInfoKHR::handleTypes when fence's current payload was created.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-handleType-01453)"}, - {VALIDATION_ERROR_39e00b5c, "The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, fence must be signaled, or have an associated fence signal operation pending execution.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-handleType-01454)"}, - {VALIDATION_ERROR_39e00b5e, "The spec valid usage text states 'fence must not currently have its payload replaced by an imported payload as described below in Importing Fence Payloads unless that imported payload's handle type was included in VkExternalFencePropertiesKHR::exportFromImportedHandleTypes for handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-fence-01455)"}, - {VALIDATION_ERROR_39e00b60, "The spec valid usage text states 'handleType must be defined as a POSIX file descriptor handle.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-handleType-01456)"}, - {VALIDATION_ERROR_39e08801, "The spec valid usage text states 'fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-fence-parameter)"}, - {VALIDATION_ERROR_39e09c01, "The spec valid usage text states 'handleType must be a valid VkExternalFenceHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-handleType-parameter)"}, - {VALIDATION_ERROR_39e1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_39e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_3a000b6e, "The spec valid usage text states 'fence must not be associated with any queue command that has not yet completed execution on that queue' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportFenceFdKHR-fence-01463)"}, - {VALIDATION_ERROR_3a005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportFenceFdKHR-device-parameter)"}, - {VALIDATION_ERROR_3a03a801, "The spec valid usage text states 'pImportFenceFdInfo must be a valid pointer to a valid VkImportFenceFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportFenceFdKHR-pImportFenceFdInfo-parameter)"}, - {VALIDATION_ERROR_3a205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetFenceFdKHR-device-parameter)"}, - {VALIDATION_ERROR_3a216c01, "The spec valid usage text states 'pFd must be a valid pointer to a int value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetFenceFdKHR-pFd-parameter)"}, - {VALIDATION_ERROR_3a239e01, "The spec valid usage text states 'pGetFdInfo must be a valid pointer to a valid VkFenceGetFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetFenceFdKHR-pGetFdInfo-parameter)"}, - {VALIDATION_ERROR_3a400b62, "The spec valid usage text states 'handleType must be a value included in the Handle Types Supported by VkImportFenceWin32HandleInfoKHR table.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-01457)"}, - {VALIDATION_ERROR_3a400b64, "The spec valid usage text states 'The fence from which handleType or name was exported must have been created on the same underlying physical device as fence.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-01458)"}, - {VALIDATION_ERROR_3a400b66, "The spec valid usage text states 'If handleType is not VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR, name must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-01459)"}, - {VALIDATION_ERROR_3a400b68, "The spec valid usage text states 'If handleType is not 0 and handle is NULL, name must name a valid synchronization primitive of the type specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-01460)"}, - {VALIDATION_ERROR_3a400b6a, "The spec valid usage text states 'If handleType is not 0 and name is NULL, handle must be a valid handle of the type specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-01461)"}, - {VALIDATION_ERROR_3a400b6c, "The spec valid usage text states 'If handle is not NULL, name must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handle-01462)"}, - {VALIDATION_ERROR_3a400c06, "The spec valid usage text states 'If handle is not NULL, it must obey any requirements listed for handleType in external fence handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handle-01539)"}, - {VALIDATION_ERROR_3a400c08, "The spec valid usage text states 'If name is not NULL, it must obey any requirements listed for handleType in external fence handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-name-01540)"}, - {VALIDATION_ERROR_3a408801, "The spec valid usage text states 'fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-fence-parameter)"}, - {VALIDATION_ERROR_3a409001, "The spec valid usage text states 'flags must be a valid combination of VkFenceImportFlagBitsKHR values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-flags-parameter)"}, - {VALIDATION_ERROR_3a409c01, "The spec valid usage text states 'If handleType is not 0, handleType must be a valid VkExternalFenceHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-parameter)"}, - {VALIDATION_ERROR_3a41c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3a42b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_3a600b4e, "The spec valid usage text states 'If VkExportFenceCreateInfoKHR::handleTypes does not include VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR, VkExportFenceWin32HandleInfoKHR must not be in the pNext chain of VkFenceCreateInfo.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportFenceWin32HandleInfoKHR-handleTypes-01447)"}, - {VALIDATION_ERROR_3a60f401, "The spec valid usage text states 'If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportFenceWin32HandleInfoKHR-pAttributes-parameter)"}, - {VALIDATION_ERROR_3a61c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportFenceWin32HandleInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3a62b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkExportFenceWin32HandleInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_3a800b50, "The spec valid usage text states 'handleType must have been included in VkExportFenceCreateInfoKHR::handleTypes when the fence's current payload was created.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-01448)"}, - {VALIDATION_ERROR_3a800b52, "The spec valid usage text states 'If handleType is defined as an NT handle, vkGetFenceWin32HandleKHR must be called no more than once for each valid unique combination of fence and handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-01449)"}, - {VALIDATION_ERROR_3a800b54, "The spec valid usage text states 'fence must not currently have its payload replaced by an imported payload as described below in Importing Fence Payloads unless that imported payload's handle type was included in VkExternalFencePropertiesKHR::exportFromImportedHandleTypes for handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-fence-01450)"}, - {VALIDATION_ERROR_3a800b56, "The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, fence must be signaled, or have an associated fence signal operation pending execution.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-01451)"}, - {VALIDATION_ERROR_3a800b58, "The spec valid usage text states 'handleType must be defined as an NT handle or a global share handle.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-01452)"}, - {VALIDATION_ERROR_3a808801, "The spec valid usage text states 'fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-fence-parameter)"}, - {VALIDATION_ERROR_3a809c01, "The spec valid usage text states 'handleType must be a valid VkExternalFenceHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-parameter)"}, - {VALIDATION_ERROR_3a81c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3a82b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_3aa05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportFenceWin32HandleKHR-device-parameter)"}, - {VALIDATION_ERROR_3aa3aa01, "The spec valid usage text states 'pImportFenceWin32HandleInfo must be a valid pointer to a valid VkImportFenceWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkImportFenceWin32HandleKHR-pImportFenceWin32HandleInfo-parameter)"}, - {VALIDATION_ERROR_3ac05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetFenceWin32HandleKHR-device-parameter)"}, - {VALIDATION_ERROR_3ac17c01, "The spec valid usage text states 'pHandle must be a valid pointer to a HANDLE value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetFenceWin32HandleKHR-pHandle-parameter)"}, - {VALIDATION_ERROR_3ac3a001, "The spec valid usage text states 'pGetWin32HandleInfo must be a valid pointer to a valid VkFenceGetWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetFenceWin32HandleKHR-pGetWin32HandleInfo-parameter)"}, - {VALIDATION_ERROR_3ae09c01, "The spec valid usage text states 'handleType must be a valid VkExternalSemaphoreHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-handleType-parameter)"}, - {VALIDATION_ERROR_3ae1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3ae2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_3ae2b801, "The spec valid usage text states 'semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-semaphore-parameter)"}, - {VALIDATION_ERROR_3b009c01, "The spec valid usage text states 'handleType must be a valid VkExternalSemaphoreHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-parameter)"}, - {VALIDATION_ERROR_3b01c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3b02b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_3b02b801, "The spec valid usage text states 'semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-semaphore-parameter)"}, - {VALIDATION_ERROR_3b209c01, "The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-handleType-parameter)"}, - {VALIDATION_ERROR_3b20c601, "The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-memory-parameter)"}, - {VALIDATION_ERROR_3b21c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3b22b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_3b409c01, "The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBitsKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-handleType-parameter)"}, - {VALIDATION_ERROR_3b40c601, "The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-memory-parameter)"}, - {VALIDATION_ERROR_3b41c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3b42b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_3b61c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedRequirementsKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3b62b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedRequirementsKHR-sType-sType)"}, - {VALIDATION_ERROR_3b800009, "The spec valid usage text states 'Both of buffer, and image that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-commonparent)"}, - {VALIDATION_ERROR_3b800b30, "The spec valid usage text states 'At least one of image and buffer must be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-image-01432)"}, - {VALIDATION_ERROR_3b800b32, "The spec valid usage text states 'If image is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-image-01433)"}, - {VALIDATION_ERROR_3b800b34, "The spec valid usage text states 'If image is not VK_NULL_HANDLE, image must have been created without VK_IMAGE_CREATE_SPARSE_BINDING_BIT set in VkImageCreateInfo::flags' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-image-01434)"}, - {VALIDATION_ERROR_3b800b36, "The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-buffer-01435)"}, - {VALIDATION_ERROR_3b800b38, "The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, buffer must have been created without VK_BUFFER_CREATE_SPARSE_BINDING_BIT set in VkBufferCreateInfo::flags' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-buffer-01436)"}, - {VALIDATION_ERROR_3b800b3a, "The spec valid usage text states 'If image is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation, the memory being imported must also be a dedicated image allocation and image must be identical to the image associated with the imported memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-image-01437)"}, - {VALIDATION_ERROR_3b800b3c, "The spec valid usage text states 'If buffer is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation, the memory being imported must also be a dedicated buffer allocation and buffer must be identical to the buffer associated with the imported memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-buffer-01438)"}, - {VALIDATION_ERROR_3b801a01, "The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-buffer-parameter)"}, - {VALIDATION_ERROR_3b80a001, "The spec valid usage text states 'If image is not VK_NULL_HANDLE, image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-image-parameter)"}, - {VALIDATION_ERROR_3b81c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3b82b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_3ba01a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryRequirementsInfo2KHR-buffer-parameter)"}, - {VALIDATION_ERROR_3ba1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryRequirementsInfo2KHR-pNext-pNext)"}, - {VALIDATION_ERROR_3ba2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryRequirementsInfo2KHR-sType-sType)"}, - {VALIDATION_ERROR_3bc00c6a, "The spec valid usage text states 'If image was created with a multi-planar format and the VK_IMAGE_CREATE_DISJOINT_BIT_KHR flag, there must be a VkImagePlaneMemoryRequirementsInfoKHR in the pNext chain of the VkImageMemoryRequirementsInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2KHR-image-01589)"}, - {VALIDATION_ERROR_3bc00c6c, "The spec valid usage text states 'If image was not created with the VK_IMAGE_CREATE_DISJOINT_BIT_KHR flag, there must not be a VkImagePlaneMemoryRequirementsInfoKHR in the pNext chain of the VkImageMemoryRequirementsInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2KHR-image-01590)"}, - {VALIDATION_ERROR_3bc00c6e, "The spec valid usage text states 'If image was created with a single-plane format, there must not be a VkImagePlaneMemoryRequirementsInfoKHR in the pNext chain of the VkImageMemoryRequirementsInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2KHR-image-01591)"}, - {VALIDATION_ERROR_3bc0a001, "The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2KHR-image-parameter)"}, - {VALIDATION_ERROR_3bc1c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkImagePlaneMemoryRequirementsInfoKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2KHR-pNext-pNext)"}, - {VALIDATION_ERROR_3bc2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2KHR-sType-sType)"}, - {VALIDATION_ERROR_3c01c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkMemoryDedicatedRequirementsKHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryRequirements2KHR-pNext-pNext)"}, - {VALIDATION_ERROR_3c02b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMemoryRequirements2KHR-sType-sType)"}, - {VALIDATION_ERROR_3c405601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageMemoryRequirements2KHR-device-parameter)"}, - {VALIDATION_ERROR_3c41b401, "The spec valid usage text states 'pMemoryRequirements must be a valid pointer to a VkMemoryRequirements2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageMemoryRequirements2KHR-pMemoryRequirements-parameter)"}, - {VALIDATION_ERROR_3c439c01, "The spec valid usage text states 'pInfo must be a valid pointer to a valid VkImageMemoryRequirementsInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageMemoryRequirements2KHR-pInfo-parameter)"}, - {VALIDATION_ERROR_3c605601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetBufferMemoryRequirements2KHR-device-parameter)"}, - {VALIDATION_ERROR_3c61b401, "The spec valid usage text states 'pMemoryRequirements must be a valid pointer to a VkMemoryRequirements2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetBufferMemoryRequirements2KHR-pMemoryRequirements-parameter)"}, - {VALIDATION_ERROR_3c639c01, "The spec valid usage text states 'pInfo must be a valid pointer to a valid VkBufferMemoryRequirementsInfo2KHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetBufferMemoryRequirements2KHR-pInfo-parameter)"}, - {VALIDATION_ERROR_3ca2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDevice16BitStorageFeaturesKHR-sType-sType)"}, - {VALIDATION_ERROR_3cc00b2e, "The spec valid usage text states 'If variablePointers is enabled then variablePointersStorageBuffer must also be enabled.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceVariablePointerFeaturesKHR-variablePointers-01431)"}, - {VALIDATION_ERROR_3cc1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceVariablePointerFeaturesKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3cc2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceVariablePointerFeaturesKHR-sType-sType)"}, - {VALIDATION_ERROR_3ce00bec, "The spec valid usage text states 'sampleLocationsPerPixel must be a bit value that is set in VkPhysicalDeviceSampleLocationsPropertiesEXT::sampleLocationSampleCounts' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sampleLocationsPerPixel-01526)"}, - {VALIDATION_ERROR_3ce00bee, "The spec valid usage text states 'sampleLocationsCount must equal sampleLocationsPerPixel {times} sampleLocationGridSize.width {times} sampleLocationGridSize.height' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sampleLocationsCount-01527)"}, - {VALIDATION_ERROR_3ce1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-pNext-pNext)"}, - {VALIDATION_ERROR_3ce2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sType-sType)"}, - {VALIDATION_ERROR_3ce3b201, "The spec valid usage text states 'sampleLocationsPerPixel must be a valid VkSampleCountFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sampleLocationsPerPixel-parameter)"}, - {VALIDATION_ERROR_3ce3b41b, "The spec valid usage text states 'sampleLocationsCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sampleLocationsCount-arraylength)"}, - {VALIDATION_ERROR_3ce3b601, "The spec valid usage text states 'pSampleLocations must be a valid pointer to an array of sampleLocationsCount VkSampleLocationEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-pSampleLocations-parameter)"}, - {VALIDATION_ERROR_3d01c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassSampleLocationsBeginInfoEXT-pNext-pNext)"}, - {VALIDATION_ERROR_3d02b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassSampleLocationsBeginInfoEXT-sType-sType)"}, - {VALIDATION_ERROR_3d03ba01, "The spec valid usage text states 'If attachmentInitialSampleLocationsCount is not 0, pAttachmentInitialSampleLocations must be a valid pointer to an array of attachmentInitialSampleLocationsCount valid VkAttachmentSampleLocationsEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassSampleLocationsBeginInfoEXT-pAttachmentInitialSampleLocations-parameter)"}, - {VALIDATION_ERROR_3d03be01, "The spec valid usage text states 'If postSubpassSampleLocationsCount is not 0, pSubpassSampleLocations must be a pointer to an array of postSubpassSampleLocationsCount valid VkSubpassSampleLocationsEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassSampleLocationsBeginInfoEXT-pSubpassSampleLocations-parameter)"}, - {VALIDATION_ERROR_3d03e801, "The spec valid usage text states 'If postSubpassSampleLocationsCount is not 0, pPostSubpassSampleLocations must be a valid pointer to an array of postSubpassSampleLocationsCount valid VkSubpassSampleLocationsEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassSampleLocationsBeginInfoEXT-pPostSubpassSampleLocations-parameter)"}, - {VALIDATION_ERROR_3d21c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineSampleLocationsStateCreateInfoEXT-pNext-pNext)"}, - {VALIDATION_ERROR_3d22b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineSampleLocationsStateCreateInfoEXT-sType-sType)"}, - {VALIDATION_ERROR_3d23c601, "The spec valid usage text states 'sampleLocationsInfo must be a valid VkSampleLocationsInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineSampleLocationsStateCreateInfoEXT-sampleLocationsInfo-parameter)"}, - {VALIDATION_ERROR_3d41c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSampleLocationsPropertiesEXT-pNext-pNext)"}, - {VALIDATION_ERROR_3d42b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSampleLocationsPropertiesEXT-sType-sType)"}, - {VALIDATION_ERROR_3d61c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMultisamplePropertiesEXT-pNext-pNext)"}, - {VALIDATION_ERROR_3d62b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMultisamplePropertiesEXT-sType-sType)"}, - {VALIDATION_ERROR_3d827a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-physicalDevice-parameter)"}, - {VALIDATION_ERROR_3d82b401, "The spec valid usage text states 'samples must be a valid VkSampleCountFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-samples-parameter)"}, - {VALIDATION_ERROR_3d83ca01, "The spec valid usage text states 'pMultisampleProperties must be a valid pointer to a VkMultisamplePropertiesEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-pMultisampleProperties-parameter)"}, - {VALIDATION_ERROR_3da00bfc, "The spec valid usage text states 'If initialDataSize is not 0, it must be equal to the size of pInitialData, as returned by vkGetValidationCacheDataEXT when pInitialData was originally retrieved' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-initialDataSize-01534)"}, - {VALIDATION_ERROR_3da00bfe, "The spec valid usage text states 'If initialDataSize is not 0, pInitialData must have been retrieved from a previous call to vkGetValidationCacheDataEXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-initialDataSize-01535)"}, - {VALIDATION_ERROR_3da09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-flags-zerobitmask)"}, - {VALIDATION_ERROR_3da19601, "The spec valid usage text states 'If initialDataSize is not 0, pInitialData must be a valid pointer to an array of initialDataSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-pInitialData-parameter)"}, - {VALIDATION_ERROR_3da1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-pNext-pNext)"}, - {VALIDATION_ERROR_3da2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-sType-sType)"}, - {VALIDATION_ERROR_3dc1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkShaderModuleValidationCacheCreateInfoEXT-pNext-pNext)"}, - {VALIDATION_ERROR_3dc2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkShaderModuleValidationCacheCreateInfoEXT-sType-sType)"}, - {VALIDATION_ERROR_3dc3c401, "The spec valid usage text states 'validationCache must be a valid VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkShaderModuleValidationCacheCreateInfoEXT-validationCache-parameter)"}, - {VALIDATION_ERROR_3de05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateValidationCacheEXT-device-parameter)"}, - {VALIDATION_ERROR_3de0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateValidationCacheEXT-pAllocator-parameter)"}, - {VALIDATION_ERROR_3de11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkValidationCacheCreateInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateValidationCacheEXT-pCreateInfo-parameter)"}, - {VALIDATION_ERROR_3de3c201, "The spec valid usage text states 'pValidationCache must be a valid pointer to a VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateValidationCacheEXT-pValidationCache-parameter)"}, - {VALIDATION_ERROR_3e005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-device-parameter)"}, - {VALIDATION_ERROR_3e012201, "The spec valid usage text states 'If the value referenced by pDataSize is not 0, and pData is not NULL, pData must be a valid pointer to an array of pDataSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-pData-parameter)"}, - {VALIDATION_ERROR_3e012401, "The spec valid usage text states 'pDataSize must be a valid pointer to a size_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-pDataSize-parameter)"}, - {VALIDATION_ERROR_3e03c401, "The spec valid usage text states 'validationCache must be a valid VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-validationCache-parameter)"}, - {VALIDATION_ERROR_3e03c407, "The spec valid usage text states 'validationCache must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-validationCache-parent)"}, - {VALIDATION_ERROR_3e200bf0, "The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-None-01528)"}, - {VALIDATION_ERROR_3e200bf2, "The spec valid usage text states 'The sampleLocationsPerPixel member of pSampleLocationsInfo must equal the rasterizationSamples member of the VkPipelineMultisampleStateCreateInfo structure the currently bound graphics pipeline has been created with' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-sampleLocationsPerPixel-01529)"}, - {VALIDATION_ERROR_3e200bf4, "The spec valid usage text states 'If VkPhysicalDeviceSampleLocationsPropertiesEXT::variableSampleLocations is VK_FALSE then the current render pass must have been begun by specifying a VkRenderPassSampleLocationsBeginInfoEXT structure whose pPostSubpassSampleLocations member contains an element with a subpassIndex matching the current subpass index and the sampleLocationsInfo member of that element must match the sample locations state pointed to by pSampleLocationsInfo' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-variableSampleLocations-01530)"}, - {VALIDATION_ERROR_3e202401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-commandBuffer-parameter)"}, - {VALIDATION_ERROR_3e202413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-commandBuffer-recording)"}, - {VALIDATION_ERROR_3e202415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-commandBuffer-cmdpool)"}, - {VALIDATION_ERROR_3e23c801, "The spec valid usage text states 'pSampleLocationsInfo must be a valid pointer to a valid VkSampleLocationsInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-pSampleLocationsInfo-parameter)"}, - {VALIDATION_ERROR_3e400c02, "The spec valid usage text states 'If VkAllocationCallbacks were provided when validationCache was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-validationCache-01537)"}, - {VALIDATION_ERROR_3e400c04, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when validationCache was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-validationCache-01538)"}, - {VALIDATION_ERROR_3e405601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-device-parameter)"}, - {VALIDATION_ERROR_3e40ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-pAllocator-parameter)"}, - {VALIDATION_ERROR_3e43c401, "The spec valid usage text states 'If validationCache is not VK_NULL_HANDLE, validationCache must be a valid VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-validationCache-parameter)"}, - {VALIDATION_ERROR_3e43c407, "The spec valid usage text states 'If validationCache is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-validationCache-parent)"}, - {VALIDATION_ERROR_3e600c00, "The spec valid usage text states 'dstCache must not appear in the list of source caches' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMergeValidationCachesEXT-dstCache-01536)"}, - {VALIDATION_ERROR_3e605601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMergeValidationCachesEXT-device-parameter)"}, - {VALIDATION_ERROR_3e606e01, "The spec valid usage text states 'dstCache must be a valid VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMergeValidationCachesEXT-dstCache-parameter)"}, - {VALIDATION_ERROR_3e606e07, "The spec valid usage text states 'dstCache must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMergeValidationCachesEXT-dstCache-parent)"}, - {VALIDATION_ERROR_3e623c01, "The spec valid usage text states 'pSrcCaches must be a valid pointer to an array of srcCacheCount valid VkValidationCacheEXT handles' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMergeValidationCachesEXT-pSrcCaches-parameter)"}, - {VALIDATION_ERROR_3e623c07, "The spec valid usage text states 'Each element of pSrcCaches must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMergeValidationCachesEXT-pSrcCaches-parent)"}, - {VALIDATION_ERROR_3e62ca1b, "The spec valid usage text states 'srcCacheCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkMergeValidationCachesEXT-srcCacheCount-arraylength)"}, - {VALIDATION_ERROR_3e800bf6, "The spec valid usage text states 'attachmentIndex must be less than the attachmentCount specified in VkRenderPassCreateInfo the render pass specified by VkRenderPassBeginInfo::renderPass was created with' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentSampleLocationsEXT-attachmentIndex-01531)"}, - {VALIDATION_ERROR_3e83c601, "The spec valid usage text states 'sampleLocationsInfo must be a valid VkSampleLocationsInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAttachmentSampleLocationsEXT-sampleLocationsInfo-parameter)"}, - {VALIDATION_ERROR_3ea00bf8, "The spec valid usage text states 'subpassIndex must be less than the subpassCount specified in VkRenderPassCreateInfo the render pass specified by VkRenderPassBeginInfo::pname::renderPass was created with' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassSampleLocationsEXT-subpassIndex-01532)"}, - {VALIDATION_ERROR_3ea3c601, "The spec valid usage text states 'sampleLocationsInfo must be a valid VkSampleLocationsInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassSampleLocationsEXT-sampleLocationsInfo-parameter)"}, - {VALIDATION_ERROR_3ec1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDevicePointClippingPropertiesKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3ec2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDevicePointClippingPropertiesKHR-sType-sType)"}, - {VALIDATION_ERROR_3ee00c01, "The spec valid usage text states 'aspectMask must be a valid combination of VkImageAspectFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkInputAttachmentAspectReferenceKHR-aspectMask-parameter)"}, - {VALIDATION_ERROR_3ee00c03, "The spec valid usage text states 'aspectMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkInputAttachmentAspectReferenceKHR-aspectMask-requiredbitmask)"}, - {VALIDATION_ERROR_3ee00c40, "The spec valid usage text states 'There must be an input attachment at pCreateInfo::pSubpasses[subpass].pInputAttachments[inputAttachment].' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkInputAttachmentAspectReferenceKHR-pCreateInfo-01568)"}, - {VALIDATION_ERROR_3ee00c42, "The spec valid usage text states 'The specified input attachment must have more than one aspect mask.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkInputAttachmentAspectReferenceKHR-None-01569)"}, - {VALIDATION_ERROR_3ee00c44, "The spec valid usage text states 'aspectMask must be a subset of the aspect masks in the specified input attachment.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkInputAttachmentAspectReferenceKHR-aspectMask-01570)"}, - {VALIDATION_ERROR_3f01c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassInputAttachmentAspectCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3f02b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassInputAttachmentAspectCreateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_3f03ce1b, "The spec valid usage text states 'aspectReferenceCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassInputAttachmentAspectCreateInfoKHR-aspectReferenceCount-arraylength)"}, - {VALIDATION_ERROR_3f03d001, "The spec valid usage text states 'pAspectReferences must be a valid pointer to an array of aspectReferenceCount valid VkInputAttachmentAspectReferenceKHR structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassInputAttachmentAspectCreateInfoKHR-pAspectReferences-parameter)"}, - {VALIDATION_ERROR_3f200c66, "The spec valid usage text states 'usage must not include any set bits that were not set in the usage member of the VkImageCreateInfo structure used to create the image this image view is created from.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewUsageCreateInfoKHR-usage-01587)"}, - {VALIDATION_ERROR_3f21c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewUsageCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3f22b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewUsageCreateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_3f230601, "The spec valid usage text states 'usage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewUsageCreateInfoKHR-usage-parameter)"}, - {VALIDATION_ERROR_3f230603, "The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewUsageCreateInfoKHR-usage-requiredbitmask)"}, - {VALIDATION_ERROR_3f41c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineTessellationDomainOriginStateCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3f42b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineTessellationDomainOriginStateCreateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_3f43d201, "The spec valid usage text states 'domainOrigin must be a valid VkTessellationDomainOriginKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineTessellationDomainOriginStateCreateInfoKHR-domainOrigin-parameter)"}, - {VALIDATION_ERROR_3f600c54, "The spec valid usage text states 'If viewFormatCount is not 0, all of the formats in the pViewFormats array must be compatible with the format specified in the format field of VkImageCreateInfo, as described in the compatibility table.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-viewFormatCount-01578)"}, - {VALIDATION_ERROR_3f600c56, "The spec valid usage text states 'If VkImageCreateInfo::flags does not contain VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, viewFormatCount must be 0 or 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-flags-01579)"}, - {VALIDATION_ERROR_3f600c58, "The spec valid usage text states 'If viewFormatCount is not 0, VkImageCreateInfo::format must be in pViewFormats.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-viewFormatCount-01580)"}, - {VALIDATION_ERROR_3f61c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3f62b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_3f63e401, "The spec valid usage text states 'If viewFormatCount is not 0, pViewFormats must be a valid pointer to an array of viewFormatCount valid VkFormat values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-pViewFormats-parameter)"}, - {VALIDATION_ERROR_3f800ce2, "The spec valid usage text states 'format must not be VK_FORMAT_UNDEFINED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-format-01649)"}, - {VALIDATION_ERROR_3f800ce4, "The spec valid usage text states 'format must support VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT_KHR or VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-format-01650)"}, - {VALIDATION_ERROR_3f800ce6, "The spec valid usage text states 'If the format does not support VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR, xChromaOffset and yChromaOffset must not be VK_CHROMA_LOCATION_COSITED_EVEN_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-xChromaOffset-01651)"}, - {VALIDATION_ERROR_3f800ce8, "The spec valid usage text states 'If the format does not support VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT_KHR, xChromaOffset and yChromaOffset must not be VK_CHROMA_LOCATION_MIDPOINT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-xChromaOffset-01652)"}, - {VALIDATION_ERROR_3f800cea, "The spec valid usage text states 'format must represent unsigned normalized values (i.e. the format must be a UNORM format)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-format-01653)"}, - {VALIDATION_ERROR_3f800cec, "The spec valid usage text states 'If the format has a _422 or _420 suffix:' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-None-01654)"}, - {VALIDATION_ERROR_3f800cee, "The spec valid usage text states 'If ycbcrModel is not VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR, then components.r, components.g, and components.b must correspond to channels of the format; that is, components.r, components.g, and components.b must not be VK_COMPONENT_SWIZZLE_ZERO or VK_COMPONENT_SWIZZLE_ONE, and must not correspond to a channel which contains zero or one as a consequence of conversion to RGBA' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-ycbcrModel-01655)"}, - {VALIDATION_ERROR_3f800cf0, "The spec valid usage text states 'If the format does not support VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR, forceExplicitReconstruction must be FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-forceExplicitReconstruction-01656)"}, - {VALIDATION_ERROR_3f800cf2, "The spec valid usage text states 'If the format does not support VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR, chromaFilter must be VK_FILTER_NEAREST' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-chromaFilter-01657)"}, - {VALIDATION_ERROR_3f802c01, "The spec valid usage text states 'components must be a valid VkComponentMapping structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-components-parameter)"}, - {VALIDATION_ERROR_3f809201, "The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-format-parameter)"}, - {VALIDATION_ERROR_3f81c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-pNext-pNext)"}, - {VALIDATION_ERROR_3f82b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_3f83d401, "The spec valid usage text states 'ycbcrModel must be a valid VkSamplerYcbcrModelConversionKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-ycbcrModel-parameter)"}, - {VALIDATION_ERROR_3f83d601, "The spec valid usage text states 'ycbcrRange must be a valid VkSamplerYcbcrRangeKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-ycbcrRange-parameter)"}, - {VALIDATION_ERROR_3f83d801, "The spec valid usage text states 'xChromaOffset must be a valid VkChromaLocationKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-xChromaOffset-parameter)"}, - {VALIDATION_ERROR_3f83da01, "The spec valid usage text states 'yChromaOffset must be a valid VkChromaLocationKHR value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-yChromaOffset-parameter)"}, - {VALIDATION_ERROR_3f83dc01, "The spec valid usage text states 'chromaFilter must be a valid VkFilter value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfoKHR-chromaFilter-parameter)"}, - {VALIDATION_ERROR_3fa00cd4, "The spec valid usage text states 'planeAspect must be a single valid plane aspect for the image format (that is, planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR or VK_IMAGE_ASPECT_PLANE_1_BIT_KHR for \"_2PLANE\" formats and planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR, or VK_IMAGE_ASPECT_PLANE_2_BIT_KHR for \"_3PLANE\" formats)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImagePlaneMemoryInfoKHR-planeAspect-01642)"}, - {VALIDATION_ERROR_3fa00cd6, "The spec valid usage text states 'A single call to vkBindImageMemory2KHR must bind all or none of the planes of an image (i.e. bindings to all planes of an image must be made in a single vkBindImageMemory2KHR call), as separate bindings' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImagePlaneMemoryInfoKHR-None-01643)"}, - {VALIDATION_ERROR_3fa2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImagePlaneMemoryInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_3fa3de01, "The spec valid usage text states 'planeAspect must be a valid VkImageAspectFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImagePlaneMemoryInfoKHR-planeAspect-parameter)"}, - {VALIDATION_ERROR_3fc00c70, "The spec valid usage text states 'planeAspect must be an aspect that exists in the format; that is, for a two-plane image planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR or VK_IMAGE_ASPECT_PLANE_1_BIT_KHR, and for a three-plane image planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR or VK_IMAGE_ASPECT_PLANE_2_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImagePlaneMemoryRequirementsInfoKHR-planeAspect-01592)"}, - {VALIDATION_ERROR_3fc2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImagePlaneMemoryRequirementsInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_3fc3de01, "The spec valid usage text states 'planeAspect must be a valid VkImageAspectFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImagePlaneMemoryRequirementsInfoKHR-planeAspect-parameter)"}, - {VALIDATION_ERROR_3fe00ce0, "The spec valid usage text states 'The sampler Y'CBCR conversion feature must be enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversionKHR-None-01648)"}, - {VALIDATION_ERROR_3fe05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversionKHR-device-parameter)"}, - {VALIDATION_ERROR_3fe0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversionKHR-pAllocator-parameter)"}, - {VALIDATION_ERROR_3fe11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkSamplerYcbcrConversionCreateInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversionKHR-pCreateInfo-parameter)"}, - {VALIDATION_ERROR_3fe3e001, "The spec valid usage text states 'pYcbcrConversion must be a valid pointer to a VkSamplerYcbcrConversionKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversionKHR-pYcbcrConversion-parameter)"}, - {VALIDATION_ERROR_40000c8c, "The spec valid usage text states 'deviceIndexCount must either be zero or equal to the number of physical devices in the logical device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryDeviceGroupInfoKHX-deviceIndexCount-01606)"}, - {VALIDATION_ERROR_40000c8e, "The spec valid usage text states 'All elements of pDeviceIndices must be valid device indices' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryDeviceGroupInfoKHX-pDeviceIndices-01607)"}, - {VALIDATION_ERROR_40013e01, "The spec valid usage text states 'If deviceIndexCount is not 0, pDeviceIndices must be a valid pointer to an array of deviceIndexCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryDeviceGroupInfoKHX-pDeviceIndices-parameter)"}, - {VALIDATION_ERROR_4001c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryDeviceGroupInfoKHX-pNext-pNext)"}, - {VALIDATION_ERROR_4002b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindBufferMemoryDeviceGroupInfoKHX-sType-sType)"}, - {VALIDATION_ERROR_40200cc2, "The spec valid usage text states 'At least one of deviceIndexCount and SFRRectCount must be zero.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-deviceIndexCount-01633)"}, - {VALIDATION_ERROR_40200cc4, "The spec valid usage text states 'deviceIndexCount must either be zero or equal to the number of physical devices in the logical device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-deviceIndexCount-01634)"}, - {VALIDATION_ERROR_40200cc6, "The spec valid usage text states 'All elements of pDeviceIndices must be valid device indices.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-pDeviceIndices-01635)"}, - {VALIDATION_ERROR_40200cc8, "The spec valid usage text states 'SFRRectCount must either be zero or equal to the number of physical devices in the logical device squared' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-SFRRectCount-01636)"}, - {VALIDATION_ERROR_40200cca, "The spec valid usage text states 'Elements of pSFRRects that correspond to the same instance of an image must not overlap.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-pSFRRects-01637)"}, - {VALIDATION_ERROR_40200ccc, "The spec valid usage text states 'The offset.x member of any element of pSFRRects must be a multiple of the sparse image block width (VkSparseImageFormatProperties::imageGranularity.width) of all non-metadata aspects of the image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-offset-01638)"}, - {VALIDATION_ERROR_40200cce, "The spec valid usage text states 'The offset.y member of any element of pSFRRects must be a multiple of the sparse image block height (VkSparseImageFormatProperties::imageGranularity.height) of all non-metadata aspects of the image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-offset-01639)"}, - {VALIDATION_ERROR_40200cd0, "The spec valid usage text states 'The extent.width member of any element of pSFRRects must either be a multiple of the sparse image block width of all non-metadata aspects of the image, or else extent.width + offset.x must equal the width of the image subresource' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-extent-01640)"}, - {VALIDATION_ERROR_40200cd2, "The spec valid usage text states 'The extent.height member of any element of pSFRRects must either be a multiple of the sparse image block height of all non-metadata aspects of the image, or else extent.height offset.y must equal the width of the image subresource' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-extent-01641)"}, - {VALIDATION_ERROR_40213e01, "The spec valid usage text states 'If deviceIndexCount is not 0, pDeviceIndices must be a valid pointer to an array of deviceIndexCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-pDeviceIndices-parameter)"}, - {VALIDATION_ERROR_4021c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-pNext-pNext)"}, - {VALIDATION_ERROR_40222001, "The spec valid usage text states 'If SFRRectCount is not 0, pSFRRects must be a valid pointer to an array of SFRRectCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-pSFRRects-parameter)"}, - {VALIDATION_ERROR_4022b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfoKHX-sType-sType)"}, - {VALIDATION_ERROR_40405601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySamplerYcbcrConversionKHR-device-parameter)"}, - {VALIDATION_ERROR_4040ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySamplerYcbcrConversionKHR-pAllocator-parameter)"}, - {VALIDATION_ERROR_4043e201, "The spec valid usage text states 'If ycbcrConversion is not VK_NULL_HANDLE, ycbcrConversion must be a valid VkSamplerYcbcrConversionKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySamplerYcbcrConversionKHR-ycbcrConversion-parameter)"}, - {VALIDATION_ERROR_4043e207, "The spec valid usage text states 'If ycbcrConversion is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySamplerYcbcrConversionKHR-ycbcrConversion-parent)"}, - {VALIDATION_ERROR_4062b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR-sType-sType)"}, - {VALIDATION_ERROR_4082b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionImageFormatPropertiesKHR-sType-sType)"}, - {VALIDATION_ERROR_40a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionInfoKHR-sType-sType)"}, - {VALIDATION_ERROR_40a3e601, "The spec valid usage text states 'conversion must be a valid VkSamplerYcbcrConversionKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionInfoKHR-conversion-parameter)"}, - {VALIDATION_ERROR_40c1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-pNext-pNext)"}, - {VALIDATION_ERROR_40c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-sType-sType)"}, - {VALIDATION_ERROR_40c3ea01, "The spec valid usage text states 'globalPriority must be a valid VkQueueGlobalPriorityEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-globalPriority-parameter)"}, - {VALIDATION_ERROR_40e05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetShaderInfoAMD-device-parameter)"}, - {VALIDATION_ERROR_40e27c01, "The spec valid usage text states 'pipeline must be a valid VkPipeline handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetShaderInfoAMD-pipeline-parameter)"}, - {VALIDATION_ERROR_40e27c07, "The spec valid usage text states 'pipeline must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetShaderInfoAMD-pipeline-parent)"}, - {VALIDATION_ERROR_40e39c01, "The spec valid usage text states 'If the value referenced by pInfoSize is not 0, and pInfo is not NULL, pInfo must be a valid pointer to an array of pInfoSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetShaderInfoAMD-pInfo-parameter)"}, - {VALIDATION_ERROR_40e3ec01, "The spec valid usage text states 'shaderStage must be a valid VkShaderStageFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetShaderInfoAMD-shaderStage-parameter)"}, - {VALIDATION_ERROR_40e3ee01, "The spec valid usage text states 'infoType must be a valid VkShaderInfoTypeAMD value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetShaderInfoAMD-infoType-parameter)"}, - {VALIDATION_ERROR_40e3f001, "The spec valid usage text states 'pInfoSize must be a valid pointer to a size_t value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetShaderInfoAMD-pInfoSize-parameter)"}, + {VALIDATION_ERROR_3401c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT, VkPhysicalDeviceConservativeRasterizationPropertiesEXT, VkPhysicalDeviceDescriptorIndexingPropertiesEXT, VkPhysicalDeviceDiscardRectanglePropertiesEXT, VkPhysicalDeviceExternalMemoryHostPropertiesEXT, VkPhysicalDeviceIDProperties, VkPhysicalDeviceMaintenance3Properties, VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX, VkPhysicalDeviceMultiviewProperties, VkPhysicalDevicePointClippingProperties, VkPhysicalDeviceProtectedMemoryProperties, VkPhysicalDevicePushDescriptorPropertiesKHR, VkPhysicalDeviceSampleLocationsPropertiesEXT, VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT, VkPhysicalDeviceShaderCorePropertiesAMD, VkPhysicalDeviceSubgroupProperties, or VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceProperties2-pNext-pNext)"}, + {VALIDATION_ERROR_3402b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceProperties2-sType-sType)"}, + {VALIDATION_ERROR_3402b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceProperties2-sType-unique)"}, + {VALIDATION_ERROR_3421c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFormatProperties2-pNext-pNext)"}, + {VALIDATION_ERROR_3422b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFormatProperties2-sType-sType)"}, + {VALIDATION_ERROR_3441c40d, "The spec valid usage text states 'Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkAndroidHardwareBufferUsageANDROID, VkExternalImageFormatProperties, VkSamplerYcbcrConversionImageFormatProperties, or VkTextureLODGatherFormatPropertiesAMD' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageFormatProperties2-pNext-pNext)"}, + {VALIDATION_ERROR_3442b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageFormatProperties2-sType-sType)"}, + {VALIDATION_ERROR_3442b00f, "The spec valid usage text states 'Each sType member in the pNext chain must be unique' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageFormatProperties2-sType-unique)"}, + {VALIDATION_ERROR_3461c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceMemoryProperties2-pNext-pNext)"}, + {VALIDATION_ERROR_3462b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceMemoryProperties2-sType-sType)"}, + {VALIDATION_ERROR_3481c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkSharedPresentSurfaceCapabilitiesKHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSurfaceCapabilities2KHR-pNext-pNext)"}, + {VALIDATION_ERROR_3482b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSurfaceCapabilities2KHR-sType-sType)"}, + {VALIDATION_ERROR_34a1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentCapabilitiesKHR-pNext-pNext)"}, + {VALIDATION_ERROR_34a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceGroupPresentCapabilitiesKHR-sType-sType)"}, + {VALIDATION_ERROR_34c1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalBufferProperties-pNext-pNext)"}, + {VALIDATION_ERROR_34c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalBufferProperties-sType-sType)"}, + {VALIDATION_ERROR_3521c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalSemaphoreProperties-pNext-pNext)"}, + {VALIDATION_ERROR_3522b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalSemaphoreProperties-sType-sType)"}, + {VALIDATION_ERROR_3541c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkQueueFamilyProperties2-pNext-pNext)"}, + {VALIDATION_ERROR_3542b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkQueueFamilyProperties2-sType-sType)"}, + {VALIDATION_ERROR_3561c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSparseImageFormatProperties2-pNext-pNext)"}, + {VALIDATION_ERROR_3562b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSparseImageFormatProperties2-sType-sType)"}, + {VALIDATION_ERROR_3581c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSurfaceFormat2KHR-pNext-pNext)"}, + {VALIDATION_ERROR_3582b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSurfaceFormat2KHR-sType-sType)"}, + {VALIDATION_ERROR_35c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceMultiviewProperties-sType-sType)"}, + {VALIDATION_ERROR_3602b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalImageFormatProperties-sType-sType)"}, + {VALIDATION_ERROR_3622b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceIDProperties-sType-sType)"}, + {VALIDATION_ERROR_3642b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX-sType-sType)"}, + {VALIDATION_ERROR_37e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSharedPresentSurfaceCapabilitiesKHR-sType-sType)"}, + {VALIDATION_ERROR_3822b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT-sType-sType)"}, + {VALIDATION_ERROR_3842b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT-sType-sType)"}, + {VALIDATION_ERROR_3862b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT-sType-sType)"}, + {VALIDATION_ERROR_38800b20, "The spec valid usage text states 'If the non-premultiplied source color property is not supported, srcPremultiplied must be VK_TRUE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-srcPremultiplied-01424)"}, + {VALIDATION_ERROR_38800b22, "The spec valid usage text states 'If the non-premultiplied destination color property is not supported, dstPremultiplied must be VK_TRUE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-dstPremultiplied-01425)"}, + {VALIDATION_ERROR_38800b24, "The spec valid usage text states 'If the correlated overlap property is not supported, blendOverlap must be VK_BLEND_OVERLAP_UNCORRELATED_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-blendOverlap-01426)"}, + {VALIDATION_ERROR_3882b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_38834a01, "The spec valid usage text states 'blendOverlap must be a valid VkBlendOverlapEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-blendOverlap-parameter)"}, + {VALIDATION_ERROR_38a00afa, "The spec valid usage text states 'If coverageModulationTableEnable is VK_TRUE, coverageModulationTableCount must be equal to the number of rasterization samples divided by the number of color samples in the subpass.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationTableEnable-01405)"}, + {VALIDATION_ERROR_38a09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-flags-zerobitmask)"}, + {VALIDATION_ERROR_38a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-sType-sType)"}, + {VALIDATION_ERROR_38a34c01, "The spec valid usage text states 'coverageModulationMode must be a valid VkCoverageModulationModeNV value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationMode-parameter)"}, + {VALIDATION_ERROR_38a34e1b, "The spec valid usage text states 'coverageModulationTableCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationTableCount-arraylength)"}, + {VALIDATION_ERROR_38c00af8, "The spec valid usage text states 'If coverageToColorEnable is VK_TRUE, then the render pass subpass indicated by VkGraphicsPipelineCreateInfo::renderPass and VkGraphicsPipelineCreateInfo::subpass must have a color attachment at the location selected by coverageToColorLocation, with a VkFormat of VK_FORMAT_R8_UINT, VK_FORMAT_R8_SINT, VK_FORMAT_R16_UINT, VK_FORMAT_R16_SINT, VK_FORMAT_R32_UINT, or VK_FORMAT_R32_SINT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineCoverageToColorStateCreateInfoNV-coverageToColorEnable-01404)"}, + {VALIDATION_ERROR_38c09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineCoverageToColorStateCreateInfoNV-flags-zerobitmask)"}, + {VALIDATION_ERROR_38c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineCoverageToColorStateCreateInfoNV-sType-sType)"}, + {VALIDATION_ERROR_38e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerReductionModeCreateInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_38e35001, "The spec valid usage text states 'reductionMode must be a valid VkSamplerReductionModeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerReductionModeCreateInfoEXT-reductionMode-parameter)"}, + {VALIDATION_ERROR_39400b4c, "The spec valid usage text states 'The bits in handleTypes must be supported and compatible, as reported by VkExternalFenceProperties.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportFenceCreateInfo-handleTypes-01446)"}, + {VALIDATION_ERROR_39409e01, "The spec valid usage text states 'handleTypes must be a valid combination of VkExternalFenceHandleTypeFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportFenceCreateInfo-handleTypes-parameter)"}, + {VALIDATION_ERROR_3942b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportFenceCreateInfo-sType-sType)"}, + {VALIDATION_ERROR_39609c01, "The spec valid usage text states 'handleType must be a valid VkExternalFenceHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalFenceInfo-handleType-parameter)"}, + {VALIDATION_ERROR_3961c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalFenceInfo-pNext-pNext)"}, + {VALIDATION_ERROR_3962b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalFenceInfo-sType-sType)"}, + {VALIDATION_ERROR_3981c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalFenceProperties-pNext-pNext)"}, + {VALIDATION_ERROR_3982b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalFenceProperties-sType-sType)"}, + {VALIDATION_ERROR_39a27a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalFenceProperties-physicalDevice-parameter)"}, + {VALIDATION_ERROR_39a3a201, "The spec valid usage text states 'pExternalFenceInfo must be a valid pointer to a valid VkPhysicalDeviceExternalFenceInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalFenceProperties-pExternalFenceInfo-parameter)"}, + {VALIDATION_ERROR_39a3a401, "The spec valid usage text states 'pExternalFenceProperties must be a valid pointer to a VkExternalFenceProperties structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceExternalFenceProperties-pExternalFenceProperties-parameter)"}, + {VALIDATION_ERROR_39c00b70, "The spec valid usage text states 'handleType must be a value included in the Handle Types Supported by VkImportFenceFdInfoKHR table.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-handleType-01464)"}, + {VALIDATION_ERROR_39c00c0a, "The spec valid usage text states 'fd must obey any requirements listed for handleType in external fence handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-fd-01541)"}, + {VALIDATION_ERROR_39c08801, "The spec valid usage text states 'fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-fence-parameter)"}, + {VALIDATION_ERROR_39c09001, "The spec valid usage text states 'flags must be a valid combination of VkFenceImportFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-flags-parameter)"}, + {VALIDATION_ERROR_39c09c01, "The spec valid usage text states 'handleType must be a valid VkExternalFenceHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-handleType-parameter)"}, + {VALIDATION_ERROR_39c1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_39c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceFdInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_39e00b5a, "The spec valid usage text states 'handleType must have been included in VkExportFenceCreateInfo::handleTypes when fence's current payload was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-handleType-01453)"}, + {VALIDATION_ERROR_39e00b5c, "The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, fence must be signaled, or have an associated fence signal operation pending execution.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-handleType-01454)"}, + {VALIDATION_ERROR_39e00b5e, "The spec valid usage text states 'fence must not currently have its payload replaced by an imported payload as described below in Importing Fence Payloads unless that imported payload's handle type was included in VkExternalFenceProperties::exportFromImportedHandleTypes for handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-fence-01455)"}, + {VALIDATION_ERROR_39e00b60, "The spec valid usage text states 'handleType must be defined as a POSIX file descriptor handle.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-handleType-01456)"}, + {VALIDATION_ERROR_39e08801, "The spec valid usage text states 'fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-fence-parameter)"}, + {VALIDATION_ERROR_39e09c01, "The spec valid usage text states 'handleType must be a valid VkExternalFenceHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-handleType-parameter)"}, + {VALIDATION_ERROR_39e1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_39e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetFdInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_3a000b6e, "The spec valid usage text states 'fence must not be associated with any queue command that has not yet completed execution on that queue' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportFenceFdKHR-fence-01463)"}, + {VALIDATION_ERROR_3a005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportFenceFdKHR-device-parameter)"}, + {VALIDATION_ERROR_3a03a801, "The spec valid usage text states 'pImportFenceFdInfo must be a valid pointer to a valid VkImportFenceFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportFenceFdKHR-pImportFenceFdInfo-parameter)"}, + {VALIDATION_ERROR_3a205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetFenceFdKHR-device-parameter)"}, + {VALIDATION_ERROR_3a216c01, "The spec valid usage text states 'pFd must be a valid pointer to a int value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetFenceFdKHR-pFd-parameter)"}, + {VALIDATION_ERROR_3a239e01, "The spec valid usage text states 'pGetFdInfo must be a valid pointer to a valid VkFenceGetFdInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetFenceFdKHR-pGetFdInfo-parameter)"}, + {VALIDATION_ERROR_3a400b62, "The spec valid usage text states 'handleType must be a value included in the Handle Types Supported by VkImportFenceWin32HandleInfoKHR table.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-01457)"}, + {VALIDATION_ERROR_3a400b66, "The spec valid usage text states 'If handleType is not VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT, name must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-01459)"}, + {VALIDATION_ERROR_3a400b68, "The spec valid usage text states 'If handleType is not 0 and handle is NULL, name must name a valid synchronization primitive of the type specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-01460)"}, + {VALIDATION_ERROR_3a400b6a, "The spec valid usage text states 'If handleType is not 0 and name is NULL, handle must be a valid handle of the type specified by handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-01461)"}, + {VALIDATION_ERROR_3a400b6c, "The spec valid usage text states 'If handle is not NULL, name must be NULL.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handle-01462)"}, + {VALIDATION_ERROR_3a400c06, "The spec valid usage text states 'If handle is not NULL, it must obey any requirements listed for handleType in external fence handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handle-01539)"}, + {VALIDATION_ERROR_3a400c08, "The spec valid usage text states 'If name is not NULL, it must obey any requirements listed for handleType in external fence handle types compatibility.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-name-01540)"}, + {VALIDATION_ERROR_3a408801, "The spec valid usage text states 'fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-fence-parameter)"}, + {VALIDATION_ERROR_3a409001, "The spec valid usage text states 'flags must be a valid combination of VkFenceImportFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-flags-parameter)"}, + {VALIDATION_ERROR_3a409c01, "The spec valid usage text states 'If handleType is not 0, handleType must be a valid VkExternalFenceHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-handleType-parameter)"}, + {VALIDATION_ERROR_3a41c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_3a42b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportFenceWin32HandleInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_3a600b4e, "The spec valid usage text states 'If VkExportFenceCreateInfo::handleTypes does not include VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT, VkExportFenceWin32HandleInfoKHR must not be in the pNext chain of VkFenceCreateInfo.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportFenceWin32HandleInfoKHR-handleTypes-01447)"}, + {VALIDATION_ERROR_3a60f401, "The spec valid usage text states 'If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportFenceWin32HandleInfoKHR-pAttributes-parameter)"}, + {VALIDATION_ERROR_3a62b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExportFenceWin32HandleInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_3a800b50, "The spec valid usage text states 'handleType must have been included in VkExportFenceCreateInfo::handleTypes when the fence's current payload was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-01448)"}, + {VALIDATION_ERROR_3a800b52, "The spec valid usage text states 'If handleType is defined as an NT handle, vkGetFenceWin32HandleKHR must be called no more than once for each valid unique combination of fence and handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-01449)"}, + {VALIDATION_ERROR_3a800b54, "The spec valid usage text states 'fence must not currently have its payload replaced by an imported payload as described below in Importing Fence Payloads unless that imported payload's handle type was included in VkExternalFenceProperties::exportFromImportedHandleTypes for handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-fence-01450)"}, + {VALIDATION_ERROR_3a800b56, "The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, fence must be signaled, or have an associated fence signal operation pending execution.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-01451)"}, + {VALIDATION_ERROR_3a800b58, "The spec valid usage text states 'handleType must be defined as an NT handle or a global share handle.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-01452)"}, + {VALIDATION_ERROR_3a808801, "The spec valid usage text states 'fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-fence-parameter)"}, + {VALIDATION_ERROR_3a809c01, "The spec valid usage text states 'handleType must be a valid VkExternalFenceHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-handleType-parameter)"}, + {VALIDATION_ERROR_3a81c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_3a82b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkFenceGetWin32HandleInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_3aa05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportFenceWin32HandleKHR-device-parameter)"}, + {VALIDATION_ERROR_3aa3aa01, "The spec valid usage text states 'pImportFenceWin32HandleInfo must be a valid pointer to a valid VkImportFenceWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkImportFenceWin32HandleKHR-pImportFenceWin32HandleInfo-parameter)"}, + {VALIDATION_ERROR_3ac05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetFenceWin32HandleKHR-device-parameter)"}, + {VALIDATION_ERROR_3ac17c01, "The spec valid usage text states 'pHandle must be a valid pointer to a HANDLE value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetFenceWin32HandleKHR-pHandle-parameter)"}, + {VALIDATION_ERROR_3ac3a001, "The spec valid usage text states 'pGetWin32HandleInfo must be a valid pointer to a valid VkFenceGetWin32HandleInfoKHR structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetFenceWin32HandleKHR-pGetWin32HandleInfo-parameter)"}, + {VALIDATION_ERROR_3ae008d8, "The spec valid usage text states 'handleType must have been included in VkExportSemaphoreCreateInfo::handleTypes when semaphore's current payload was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-handleType-01132)"}, + {VALIDATION_ERROR_3ae008da, "The spec valid usage text states 'semaphore must not currently have its payload replaced by an imported payload as described below in Importing Semaphore Payloads unless that imported payload's handle type was included in VkExternalSemaphoreProperties::exportFromImportedHandleTypes for handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-semaphore-01133)"}, + {VALIDATION_ERROR_3ae008dc, "The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, as defined below in Importing Semaphore Payloads, there must be no queue waiting on semaphore.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-handleType-01134)"}, + {VALIDATION_ERROR_3ae008de, "The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, semaphore must be signaled, or have an associated semaphore signal operation pending execution.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-handleType-01135)"}, + {VALIDATION_ERROR_3ae008e0, "The spec valid usage text states 'handleType must be defined as a POSIX file descriptor handle.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-handleType-01136)"}, + {VALIDATION_ERROR_3ae09c01, "The spec valid usage text states 'handleType must be a valid VkExternalSemaphoreHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-handleType-parameter)"}, + {VALIDATION_ERROR_3ae1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_3ae2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_3ae2b801, "The spec valid usage text states 'semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetFdInfoKHR-semaphore-parameter)"}, + {VALIDATION_ERROR_3b0008cc, "The spec valid usage text states 'handleType must have been included in VkExportSemaphoreCreateInfo::handleTypes when the semaphore's current payload was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01126)"}, + {VALIDATION_ERROR_3b0008ce, "The spec valid usage text states 'If handleType is defined as an NT handle, vkGetSemaphoreWin32HandleKHR must be called no more than once for each valid unique combination of semaphore and handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01127)"}, + {VALIDATION_ERROR_3b0008d0, "The spec valid usage text states 'semaphore must not currently have its payload replaced by an imported payload as described below in Importing Semaphore Payloads unless that imported payload's handle type was included in VkExternalSemaphoreProperties::exportFromImportedHandleTypes for handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-semaphore-01128)"}, + {VALIDATION_ERROR_3b0008d2, "The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, as defined below in Importing Semaphore Payloads, there must be no queue waiting on semaphore.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01129)"}, + {VALIDATION_ERROR_3b0008d4, "The spec valid usage text states 'If handleType refers to a handle type with copy payload transference semantics, semaphore must be signaled, or have an associated semaphore signal operation pending execution.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01130)"}, + {VALIDATION_ERROR_3b0008d6, "The spec valid usage text states 'handleType must be defined as an NT handle or a global share handle.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01131)"}, + {VALIDATION_ERROR_3b009c01, "The spec valid usage text states 'handleType must be a valid VkExternalSemaphoreHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-parameter)"}, + {VALIDATION_ERROR_3b01c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_3b02b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_3b02b801, "The spec valid usage text states 'semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSemaphoreGetWin32HandleInfoKHR-semaphore-parameter)"}, + {VALIDATION_ERROR_3b20053e, "The spec valid usage text states 'handleType must have been included in VkExportMemoryAllocateInfo::handleTypes when memory was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-handleType-00671)"}, + {VALIDATION_ERROR_3b200540, "The spec valid usage text states 'handleType must be defined as a POSIX file descriptor handle.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-handleType-00672)"}, + {VALIDATION_ERROR_3b209c01, "The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-handleType-parameter)"}, + {VALIDATION_ERROR_3b20c601, "The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-memory-parameter)"}, + {VALIDATION_ERROR_3b21c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_3b22b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetFdInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_3b40052c, "The spec valid usage text states 'handleType must have been included in VkExportMemoryAllocateInfo::handleTypes when memory was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-handleType-00662)"}, + {VALIDATION_ERROR_3b40052e, "The spec valid usage text states 'If handleType is defined as an NT handle, vkGetMemoryWin32HandleKHR must be called no more than once for each valid unique combination of memory and handleType.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-handleType-00663)"}, + {VALIDATION_ERROR_3b400530, "The spec valid usage text states 'handleType must be defined as an NT handle or a global share handle.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-handleType-00664)"}, + {VALIDATION_ERROR_3b409c01, "The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-handleType-parameter)"}, + {VALIDATION_ERROR_3b40c601, "The spec valid usage text states 'memory must be a valid VkDeviceMemory handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-memory-parameter)"}, + {VALIDATION_ERROR_3b41c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-pNext-pNext)"}, + {VALIDATION_ERROR_3b42b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetWin32HandleInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_3b62b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedRequirements-sType-sType)"}, + {VALIDATION_ERROR_3b800009, "The spec valid usage text states 'Both of buffer, and image that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-commonparent)"}, + {VALIDATION_ERROR_3b800b30, "The spec valid usage text states 'At least one of image and buffer must be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-image-01432)"}, + {VALIDATION_ERROR_3b800b32, "The spec valid usage text states 'If image is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-image-01433)"}, + {VALIDATION_ERROR_3b800b34, "The spec valid usage text states 'If image is not VK_NULL_HANDLE, image must have been created without VK_IMAGE_CREATE_SPARSE_BINDING_BIT set in VkImageCreateInfo::flags' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-image-01434)"}, + {VALIDATION_ERROR_3b800b36, "The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-buffer-01435)"}, + {VALIDATION_ERROR_3b800b38, "The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, buffer must have been created without VK_BUFFER_CREATE_SPARSE_BINDING_BIT set in VkBufferCreateInfo::flags' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-buffer-01436)"}, + {VALIDATION_ERROR_3b800e0a, "The spec valid usage text states 'If image is not VK_NULL_HANDLE, image must not have been created with VK_IMAGE_CREATE_DISJOINT_BIT set in VkImageCreateInfo::flags' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-image-01797)"}, + {VALIDATION_ERROR_3b800ea8, "The spec valid usage text states 'If image is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation with handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, and the external handle was created by the Vulkan API, then the memory being imported must also be a dedicated image allocation and image must be identical to the image associated with the imported memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-image-01876)"}, + {VALIDATION_ERROR_3b800eaa, "The spec valid usage text states 'If buffer is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation with handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, and the external handle was created by the Vulkan API, then the memory being imported must also be a dedicated buffer allocation and buffer must be identical to the buffer associated with the imported memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-buffer-01877)"}, + {VALIDATION_ERROR_3b800eac, "The spec valid usage text states 'If image is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation with handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT, the memory being imported must also be a dedicated image allocation and image must be identical to the image associated with the imported memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-image-01878)"}, + {VALIDATION_ERROR_3b800eae, "The spec valid usage text states 'If buffer is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation with handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT, the memory being imported must also be a dedicated buffer allocation and buffer must be identical to the buffer associated with the imported memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-buffer-01879)"}, + {VALIDATION_ERROR_3b801a01, "The spec valid usage text states 'If buffer is not VK_NULL_HANDLE, buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-buffer-parameter)"}, + {VALIDATION_ERROR_3b80a001, "The spec valid usage text states 'If image is not VK_NULL_HANDLE, image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-image-parameter)"}, + {VALIDATION_ERROR_3b82b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryDedicatedAllocateInfo-sType-sType)"}, + {VALIDATION_ERROR_3ba01a01, "The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryRequirementsInfo2-buffer-parameter)"}, + {VALIDATION_ERROR_3ba1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryRequirementsInfo2-pNext-pNext)"}, + {VALIDATION_ERROR_3ba2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryRequirementsInfo2-sType-sType)"}, + {VALIDATION_ERROR_3bc00c6a, "The spec valid usage text states 'If image was created with a multi-planar format and the VK_IMAGE_CREATE_DISJOINT_BIT flag, there must be a VkImagePlaneMemoryRequirementsInfo in the pNext chain of the VkImageMemoryRequirementsInfo2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2-image-01589)"}, + {VALIDATION_ERROR_3bc00c6c, "The spec valid usage text states 'If image was not created with the VK_IMAGE_CREATE_DISJOINT_BIT flag, there must not be a VkImagePlaneMemoryRequirementsInfo in the pNext chain of the VkImageMemoryRequirementsInfo2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2-image-01590)"}, + {VALIDATION_ERROR_3bc00c6e, "The spec valid usage text states 'If image was created with a single-plane format, there must not be a VkImagePlaneMemoryRequirementsInfo in the pNext chain of the VkImageMemoryRequirementsInfo2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2-image-01591)"}, + {VALIDATION_ERROR_3bc00ed2, "The spec valid usage text states 'If image was created with the VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID external memory handle type, then image must be bound to memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2-image-01897)"}, + {VALIDATION_ERROR_3bc0a001, "The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2-image-parameter)"}, + {VALIDATION_ERROR_3bc1c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkImagePlaneMemoryRequirementsInfo' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2-pNext-pNext)"}, + {VALIDATION_ERROR_3bc2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryRequirementsInfo2-sType-sType)"}, + {VALIDATION_ERROR_3be0a001, "The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageSparseMemoryRequirementsInfo2-image-parameter)"}, + {VALIDATION_ERROR_3be1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageSparseMemoryRequirementsInfo2-pNext-pNext)"}, + {VALIDATION_ERROR_3be2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageSparseMemoryRequirementsInfo2-sType-sType)"}, + {VALIDATION_ERROR_3c01c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkMemoryDedicatedRequirements' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryRequirements2-pNext-pNext)"}, + {VALIDATION_ERROR_3c02b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryRequirements2-sType-sType)"}, + {VALIDATION_ERROR_3c21c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSparseImageMemoryRequirements2-pNext-pNext)"}, + {VALIDATION_ERROR_3c22b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSparseImageMemoryRequirements2-sType-sType)"}, + {VALIDATION_ERROR_3c405601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageMemoryRequirements2-device-parameter)"}, + {VALIDATION_ERROR_3c41b401, "The spec valid usage text states 'pMemoryRequirements must be a valid pointer to a VkMemoryRequirements2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageMemoryRequirements2-pMemoryRequirements-parameter)"}, + {VALIDATION_ERROR_3c439c01, "The spec valid usage text states 'pInfo must be a valid pointer to a valid VkImageMemoryRequirementsInfo2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageMemoryRequirements2-pInfo-parameter)"}, + {VALIDATION_ERROR_3c605601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetBufferMemoryRequirements2-device-parameter)"}, + {VALIDATION_ERROR_3c61b401, "The spec valid usage text states 'pMemoryRequirements must be a valid pointer to a VkMemoryRequirements2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetBufferMemoryRequirements2-pMemoryRequirements-parameter)"}, + {VALIDATION_ERROR_3c639c01, "The spec valid usage text states 'pInfo must be a valid pointer to a valid VkBufferMemoryRequirementsInfo2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetBufferMemoryRequirements2-pInfo-parameter)"}, + {VALIDATION_ERROR_3c805601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageSparseMemoryRequirements2-device-parameter)"}, + {VALIDATION_ERROR_3c823601, "The spec valid usage text states 'pSparseMemoryRequirementCount must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageSparseMemoryRequirements2-pSparseMemoryRequirementCount-parameter)"}, + {VALIDATION_ERROR_3c823801, "The spec valid usage text states 'If the value referenced by pSparseMemoryRequirementCount is not 0, and pSparseMemoryRequirements is not NULL, pSparseMemoryRequirements must be a valid pointer to an array of pSparseMemoryRequirementCount VkSparseImageMemoryRequirements2 structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageSparseMemoryRequirements2-pSparseMemoryRequirements-parameter)"}, + {VALIDATION_ERROR_3c839c01, "The spec valid usage text states 'pInfo must be a valid pointer to a valid VkImageSparseMemoryRequirementsInfo2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetImageSparseMemoryRequirements2-pInfo-parameter)"}, + {VALIDATION_ERROR_3ca2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDevice16BitStorageFeatures-sType-sType)"}, + {VALIDATION_ERROR_3cc00b2e, "The spec valid usage text states 'If variablePointers is enabled then variablePointersStorageBuffer must also be enabled.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceVariablePointerFeatures-variablePointers-01431)"}, + {VALIDATION_ERROR_3cc2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceVariablePointerFeatures-sType-sType)"}, + {VALIDATION_ERROR_3ce00bec, "The spec valid usage text states 'sampleLocationsPerPixel must be a bit value that is set in VkPhysicalDeviceSampleLocationsPropertiesEXT::sampleLocationSampleCounts' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sampleLocationsPerPixel-01526)"}, + {VALIDATION_ERROR_3ce00bee, "The spec valid usage text states 'sampleLocationsCount must equal sampleLocationsPerPixel {times} sampleLocationGridSize.width {times} sampleLocationGridSize.height' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sampleLocationsCount-01527)"}, + {VALIDATION_ERROR_3ce2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_3ce3b201, "The spec valid usage text states 'sampleLocationsPerPixel must be a valid VkSampleCountFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sampleLocationsPerPixel-parameter)"}, + {VALIDATION_ERROR_3ce3b41b, "The spec valid usage text states 'sampleLocationsCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-sampleLocationsCount-arraylength)"}, + {VALIDATION_ERROR_3ce3b601, "The spec valid usage text states 'pSampleLocations must be a valid pointer to an array of sampleLocationsCount VkSampleLocationEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSampleLocationsInfoEXT-pSampleLocations-parameter)"}, + {VALIDATION_ERROR_3d02b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassSampleLocationsBeginInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_3d03ba01, "The spec valid usage text states 'If attachmentInitialSampleLocationsCount is not 0, pAttachmentInitialSampleLocations must be a valid pointer to an array of attachmentInitialSampleLocationsCount valid VkAttachmentSampleLocationsEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassSampleLocationsBeginInfoEXT-pAttachmentInitialSampleLocations-parameter)"}, + {VALIDATION_ERROR_3d03e801, "The spec valid usage text states 'If postSubpassSampleLocationsCount is not 0, pPostSubpassSampleLocations must be a valid pointer to an array of postSubpassSampleLocationsCount valid VkSubpassSampleLocationsEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassSampleLocationsBeginInfoEXT-pPostSubpassSampleLocations-parameter)"}, + {VALIDATION_ERROR_3d22b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineSampleLocationsStateCreateInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_3d23c601, "The spec valid usage text states 'sampleLocationsInfo must be a valid VkSampleLocationsInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineSampleLocationsStateCreateInfoEXT-sampleLocationsInfo-parameter)"}, + {VALIDATION_ERROR_3d42b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSampleLocationsPropertiesEXT-sType-sType)"}, + {VALIDATION_ERROR_3d61c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMultisamplePropertiesEXT-pNext-pNext)"}, + {VALIDATION_ERROR_3d62b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMultisamplePropertiesEXT-sType-sType)"}, + {VALIDATION_ERROR_3d827a01, "The spec valid usage text states 'physicalDevice must be a valid VkPhysicalDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-physicalDevice-parameter)"}, + {VALIDATION_ERROR_3d82b401, "The spec valid usage text states 'samples must be a valid VkSampleCountFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-samples-parameter)"}, + {VALIDATION_ERROR_3d83ca01, "The spec valid usage text states 'pMultisampleProperties must be a valid pointer to a VkMultisamplePropertiesEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-pMultisampleProperties-parameter)"}, + {VALIDATION_ERROR_3da00bfc, "The spec valid usage text states 'If initialDataSize is not 0, it must be equal to the size of pInitialData, as returned by vkGetValidationCacheDataEXT when pInitialData was originally retrieved' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-initialDataSize-01534)"}, + {VALIDATION_ERROR_3da00bfe, "The spec valid usage text states 'If initialDataSize is not 0, pInitialData must have been retrieved from a previous call to vkGetValidationCacheDataEXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-initialDataSize-01535)"}, + {VALIDATION_ERROR_3da09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-flags-zerobitmask)"}, + {VALIDATION_ERROR_3da19601, "The spec valid usage text states 'If initialDataSize is not 0, pInitialData must be a valid pointer to an array of initialDataSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-pInitialData-parameter)"}, + {VALIDATION_ERROR_3da1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-pNext-pNext)"}, + {VALIDATION_ERROR_3da2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkValidationCacheCreateInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_3dc2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkShaderModuleValidationCacheCreateInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_3dc3c401, "The spec valid usage text states 'validationCache must be a valid VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkShaderModuleValidationCacheCreateInfoEXT-validationCache-parameter)"}, + {VALIDATION_ERROR_3de05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateValidationCacheEXT-device-parameter)"}, + {VALIDATION_ERROR_3de0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateValidationCacheEXT-pAllocator-parameter)"}, + {VALIDATION_ERROR_3de11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkValidationCacheCreateInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateValidationCacheEXT-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_3de3c201, "The spec valid usage text states 'pValidationCache must be a valid pointer to a VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateValidationCacheEXT-pValidationCache-parameter)"}, + {VALIDATION_ERROR_3e005601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-device-parameter)"}, + {VALIDATION_ERROR_3e012201, "The spec valid usage text states 'If the value referenced by pDataSize is not 0, and pData is not NULL, pData must be a valid pointer to an array of pDataSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-pData-parameter)"}, + {VALIDATION_ERROR_3e012401, "The spec valid usage text states 'pDataSize must be a valid pointer to a size_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-pDataSize-parameter)"}, + {VALIDATION_ERROR_3e03c401, "The spec valid usage text states 'validationCache must be a valid VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-validationCache-parameter)"}, + {VALIDATION_ERROR_3e03c407, "The spec valid usage text states 'validationCache must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetValidationCacheDataEXT-validationCache-parent)"}, + {VALIDATION_ERROR_3e200bf0, "The spec valid usage text states 'The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-None-01528)"}, + {VALIDATION_ERROR_3e200bf2, "The spec valid usage text states 'The sampleLocationsPerPixel member of pSampleLocationsInfo must equal the rasterizationSamples member of the VkPipelineMultisampleStateCreateInfo structure the bound graphics pipeline has been created with' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-sampleLocationsPerPixel-01529)"}, + {VALIDATION_ERROR_3e200bf4, "The spec valid usage text states 'If VkPhysicalDeviceSampleLocationsPropertiesEXT::variableSampleLocations is VK_FALSE then the current render pass must have been begun by specifying a VkRenderPassSampleLocationsBeginInfoEXT structure whose pPostSubpassSampleLocations member contains an element with a subpassIndex matching the current subpass index and the sampleLocationsInfo member of that element must match the sample locations state pointed to by pSampleLocationsInfo' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-variableSampleLocations-01530)"}, + {VALIDATION_ERROR_3e202401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-commandBuffer-parameter)"}, + {VALIDATION_ERROR_3e202413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-commandBuffer-recording)"}, + {VALIDATION_ERROR_3e202415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-commandBuffer-cmdpool)"}, + {VALIDATION_ERROR_3e23c801, "The spec valid usage text states 'pSampleLocationsInfo must be a valid pointer to a valid VkSampleLocationsInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdSetSampleLocationsEXT-pSampleLocationsInfo-parameter)"}, + {VALIDATION_ERROR_3e400c02, "The spec valid usage text states 'If VkAllocationCallbacks were provided when validationCache was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-validationCache-01537)"}, + {VALIDATION_ERROR_3e400c04, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when validationCache was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-validationCache-01538)"}, + {VALIDATION_ERROR_3e405601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-device-parameter)"}, + {VALIDATION_ERROR_3e40ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-pAllocator-parameter)"}, + {VALIDATION_ERROR_3e43c401, "The spec valid usage text states 'If validationCache is not VK_NULL_HANDLE, validationCache must be a valid VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-validationCache-parameter)"}, + {VALIDATION_ERROR_3e43c407, "The spec valid usage text states 'If validationCache is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyValidationCacheEXT-validationCache-parent)"}, + {VALIDATION_ERROR_3e600c00, "The spec valid usage text states 'dstCache must not appear in the list of source caches' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkMergeValidationCachesEXT-dstCache-01536)"}, + {VALIDATION_ERROR_3e605601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkMergeValidationCachesEXT-device-parameter)"}, + {VALIDATION_ERROR_3e606e01, "The spec valid usage text states 'dstCache must be a valid VkValidationCacheEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkMergeValidationCachesEXT-dstCache-parameter)"}, + {VALIDATION_ERROR_3e606e07, "The spec valid usage text states 'dstCache must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkMergeValidationCachesEXT-dstCache-parent)"}, + {VALIDATION_ERROR_3e623c01, "The spec valid usage text states 'pSrcCaches must be a valid pointer to an array of srcCacheCount valid VkValidationCacheEXT handles' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkMergeValidationCachesEXT-pSrcCaches-parameter)"}, + {VALIDATION_ERROR_3e623c07, "The spec valid usage text states 'Each element of pSrcCaches must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkMergeValidationCachesEXT-pSrcCaches-parent)"}, + {VALIDATION_ERROR_3e62ca1b, "The spec valid usage text states 'srcCacheCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkMergeValidationCachesEXT-srcCacheCount-arraylength)"}, + {VALIDATION_ERROR_3e800bf6, "The spec valid usage text states 'attachmentIndex must be less than the attachmentCount specified in VkRenderPassCreateInfo the render pass specified by VkRenderPassBeginInfo::renderPass was created with' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAttachmentSampleLocationsEXT-attachmentIndex-01531)"}, + {VALIDATION_ERROR_3e83c601, "The spec valid usage text states 'sampleLocationsInfo must be a valid VkSampleLocationsInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAttachmentSampleLocationsEXT-sampleLocationsInfo-parameter)"}, + {VALIDATION_ERROR_3ea00bf8, "The spec valid usage text states 'subpassIndex must be less than the subpassCount specified in VkRenderPassCreateInfo the render pass specified by VkRenderPassBeginInfo::renderPass was created with' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSubpassSampleLocationsEXT-subpassIndex-01532)"}, + {VALIDATION_ERROR_3ea3c601, "The spec valid usage text states 'sampleLocationsInfo must be a valid VkSampleLocationsInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSubpassSampleLocationsEXT-sampleLocationsInfo-parameter)"}, + {VALIDATION_ERROR_3ec2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDevicePointClippingProperties-sType-sType)"}, + {VALIDATION_ERROR_3ee00c01, "The spec valid usage text states 'aspectMask must be a valid combination of VkImageAspectFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkInputAttachmentAspectReference-aspectMask-parameter)"}, + {VALIDATION_ERROR_3ee00c03, "The spec valid usage text states 'aspectMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkInputAttachmentAspectReference-aspectMask-requiredbitmask)"}, + {VALIDATION_ERROR_3ee00c40, "The spec valid usage text states 'There must be an input attachment at pCreateInfo::pSubpasses[subpass].pInputAttachments[inputAttachmentIndex].' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkInputAttachmentAspectReference-pCreateInfo-01568)"}, + {VALIDATION_ERROR_3ee00c42, "The spec valid usage text states 'The specified input attachment must have more than one aspect mask.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkInputAttachmentAspectReference-None-01569)"}, + {VALIDATION_ERROR_3ee00c44, "The spec valid usage text states 'aspectMask must be a subset of the aspect masks in the specified input attachment.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkInputAttachmentAspectReference-aspectMask-01570)"}, + {VALIDATION_ERROR_3f02b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassInputAttachmentAspectCreateInfo-sType-sType)"}, + {VALIDATION_ERROR_3f03ce1b, "The spec valid usage text states 'aspectReferenceCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassInputAttachmentAspectCreateInfo-aspectReferenceCount-arraylength)"}, + {VALIDATION_ERROR_3f03d001, "The spec valid usage text states 'pAspectReferences must be a valid pointer to an array of aspectReferenceCount valid VkInputAttachmentAspectReference structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkRenderPassInputAttachmentAspectCreateInfo-pAspectReferences-parameter)"}, + {VALIDATION_ERROR_3f200c66, "The spec valid usage text states 'usage must not include any set bits that were not set in the usage member of the VkImageCreateInfo structure used to create the image this image view is created from.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewUsageCreateInfo-usage-01587)"}, + {VALIDATION_ERROR_3f22b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewUsageCreateInfo-sType-sType)"}, + {VALIDATION_ERROR_3f230601, "The spec valid usage text states 'usage must be a valid combination of VkImageUsageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewUsageCreateInfo-usage-parameter)"}, + {VALIDATION_ERROR_3f230603, "The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewUsageCreateInfo-usage-requiredbitmask)"}, + {VALIDATION_ERROR_3f42b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineTessellationDomainOriginStateCreateInfo-sType-sType)"}, + {VALIDATION_ERROR_3f43d201, "The spec valid usage text states 'domainOrigin must be a valid VkTessellationDomainOrigin value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineTessellationDomainOriginStateCreateInfo-domainOrigin-parameter)"}, + {VALIDATION_ERROR_3f600c54, "The spec valid usage text states 'If viewFormatCount is not 0, all of the formats in the pViewFormats array must be compatible with the format specified in the format field of VkImageCreateInfo, as described in the compatibility table.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-viewFormatCount-01578)"}, + {VALIDATION_ERROR_3f600c56, "The spec valid usage text states 'If VkImageCreateInfo::flags does not contain VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, viewFormatCount must be 0 or 1.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-flags-01579)"}, + {VALIDATION_ERROR_3f600c58, "The spec valid usage text states 'If viewFormatCount is not 0, VkImageCreateInfo::format must be in pViewFormats.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-viewFormatCount-01580)"}, + {VALIDATION_ERROR_3f62b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-sType-sType)"}, + {VALIDATION_ERROR_3f63e401, "The spec valid usage text states 'If viewFormatCount is not 0, pViewFormats must be a valid pointer to an array of viewFormatCount valid VkFormat values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageFormatListCreateInfoKHR-pViewFormats-parameter)"}, + {VALIDATION_ERROR_3f800ce2, "The spec valid usage text states 'format must not be VK_FORMAT_UNDEFINED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-format-01649)"}, + {VALIDATION_ERROR_3f800ce4, "The spec valid usage text states 'format must support VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT or VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-format-01650)"}, + {VALIDATION_ERROR_3f800ce6, "The spec valid usage text states 'If the format does not support VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, xChromaOffset and yChromaOffset must not be VK_CHROMA_LOCATION_COSITED_EVEN' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-01651)"}, + {VALIDATION_ERROR_3f800ce8, "The spec valid usage text states 'If the format does not support VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT, xChromaOffset and yChromaOffset must not be VK_CHROMA_LOCATION_MIDPOINT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-01652)"}, + {VALIDATION_ERROR_3f800cea, "The spec valid usage text states 'format must represent unsigned normalized values (i.e. the format must be a UNORM format)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-format-01653)"}, + {VALIDATION_ERROR_3f800cec, "The spec valid usage text states 'If the format has a _422 or _420 suffix:' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-None-01654)"}, + {VALIDATION_ERROR_3f800cee, "The spec valid usage text states 'If ycbcrModel is not VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY, then components.r, components.g, and components.b must correspond to channels of the format; that is, components.r, components.g, and components.b must not be VK_COMPONENT_SWIZZLE_ZERO or VK_COMPONENT_SWIZZLE_ONE, and must not correspond to a channel which contains zero or one as a consequence of conversion to RGBA' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrModel-01655)"}, + {VALIDATION_ERROR_3f800cf0, "The spec valid usage text states 'If the format does not support VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT, forceExplicitReconstruction must be FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-forceExplicitReconstruction-01656)"}, + {VALIDATION_ERROR_3f800cf2, "The spec valid usage text states 'If the format does not support VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT, chromaFilter must be VK_FILTER_NEAREST' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-chromaFilter-01657)"}, + {VALIDATION_ERROR_3f800ee0, "The spec valid usage text states 'If an external format conversion is being created, format must be VK_FORMAT_UNDEFINED, otherwise it must not be VK_FORMAT_UNDEFINED.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-format-01904)"}, + {VALIDATION_ERROR_3f802c01, "The spec valid usage text states 'components must be a valid VkComponentMapping structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-components-parameter)"}, + {VALIDATION_ERROR_3f809201, "The spec valid usage text states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-format-parameter)"}, + {VALIDATION_ERROR_3f81c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkExternalFormatANDROID' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-pNext-pNext)"}, + {VALIDATION_ERROR_3f82b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-sType-sType)"}, + {VALIDATION_ERROR_3f83d401, "The spec valid usage text states 'ycbcrModel must be a valid VkSamplerYcbcrModelConversion value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrModel-parameter)"}, + {VALIDATION_ERROR_3f83d601, "The spec valid usage text states 'ycbcrRange must be a valid VkSamplerYcbcrRange value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrRange-parameter)"}, + {VALIDATION_ERROR_3f83d801, "The spec valid usage text states 'xChromaOffset must be a valid VkChromaLocation value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-parameter)"}, + {VALIDATION_ERROR_3f83da01, "The spec valid usage text states 'yChromaOffset must be a valid VkChromaLocation value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-yChromaOffset-parameter)"}, + {VALIDATION_ERROR_3f83dc01, "The spec valid usage text states 'chromaFilter must be a valid VkFilter value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionCreateInfo-chromaFilter-parameter)"}, + {VALIDATION_ERROR_3fa00cd4, "The spec valid usage text states 'planeAspect must be a single valid plane aspect for the image format (that is, planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT or VK_IMAGE_ASPECT_PLANE_1_BIT for \"_2PLANE\" formats and planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT for \"_3PLANE\" formats)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImagePlaneMemoryInfo-planeAspect-01642)"}, + {VALIDATION_ERROR_3fa00cd6, "The spec valid usage text states 'A single call to vkBindImageMemory2 must bind all or none of the planes of an image (i.e. bindings to all planes of an image must be made in a single vkBindImageMemory2 call), as separate bindings' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImagePlaneMemoryInfo-None-01643)"}, + {VALIDATION_ERROR_3fa2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImagePlaneMemoryInfo-sType-sType)"}, + {VALIDATION_ERROR_3fa3de01, "The spec valid usage text states 'planeAspect must be a valid VkImageAspectFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImagePlaneMemoryInfo-planeAspect-parameter)"}, + {VALIDATION_ERROR_3fc00c70, "The spec valid usage text states 'planeAspect must be an aspect that exists in the format; that is, for a two-plane image planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT or VK_IMAGE_ASPECT_PLANE_1_BIT, and for a three-plane image planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT or VK_IMAGE_ASPECT_PLANE_2_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImagePlaneMemoryRequirementsInfo-planeAspect-01592)"}, + {VALIDATION_ERROR_3fc2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImagePlaneMemoryRequirementsInfo-sType-sType)"}, + {VALIDATION_ERROR_3fc3de01, "The spec valid usage text states 'planeAspect must be a valid VkImageAspectFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImagePlaneMemoryRequirementsInfo-planeAspect-parameter)"}, + {VALIDATION_ERROR_3fe00ce0, "The spec valid usage text states 'The sampler Y'CBCR conversion feature must be enabled' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversion-None-01648)"}, + {VALIDATION_ERROR_3fe05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversion-device-parameter)"}, + {VALIDATION_ERROR_3fe0ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversion-pAllocator-parameter)"}, + {VALIDATION_ERROR_3fe11e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkSamplerYcbcrConversionCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversion-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_3fe3e001, "The spec valid usage text states 'pYcbcrConversion must be a valid pointer to a VkSamplerYcbcrConversion handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateSamplerYcbcrConversion-pYcbcrConversion-parameter)"}, + {VALIDATION_ERROR_40000c8c, "The spec valid usage text states 'deviceIndexCount must either be zero or equal to the number of physical devices in the logical device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryDeviceGroupInfo-deviceIndexCount-01606)"}, + {VALIDATION_ERROR_40000c8e, "The spec valid usage text states 'All elements of pDeviceIndices must be valid device indices' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryDeviceGroupInfo-pDeviceIndices-01607)"}, + {VALIDATION_ERROR_40013e01, "The spec valid usage text states 'If deviceIndexCount is not 0, pDeviceIndices must be a valid pointer to an array of deviceIndexCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryDeviceGroupInfo-pDeviceIndices-parameter)"}, + {VALIDATION_ERROR_4002b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindBufferMemoryDeviceGroupInfo-sType-sType)"}, + {VALIDATION_ERROR_40200cc2, "The spec valid usage text states 'At least one of deviceIndexCount and splitInstanceBindRegionCount must be zero.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-deviceIndexCount-01633)"}, + {VALIDATION_ERROR_40200cc4, "The spec valid usage text states 'deviceIndexCount must either be zero or equal to the number of physical devices in the logical device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-deviceIndexCount-01634)"}, + {VALIDATION_ERROR_40200cc6, "The spec valid usage text states 'All elements of pDeviceIndices must be valid device indices.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-pDeviceIndices-01635)"}, + {VALIDATION_ERROR_40200cc8, "The spec valid usage text states 'splitInstanceBindRegionCount must either be zero or equal to the number of physical devices in the logical device squared' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-splitInstanceBindRegionCount-01636)"}, + {VALIDATION_ERROR_40200cca, "The spec valid usage text states 'Elements of pSplitInstanceBindRegions that correspond to the same instance of an image must not overlap.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-pSplitInstanceBindRegions-01637)"}, + {VALIDATION_ERROR_40200ccc, "The spec valid usage text states 'The offset.x member of any element of pSplitInstanceBindRegions must be a multiple of the sparse image block width (VkSparseImageFormatProperties::imageGranularity.width) of all non-metadata aspects of the image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-offset-01638)"}, + {VALIDATION_ERROR_40200cce, "The spec valid usage text states 'The offset.y member of any element of pSplitInstanceBindRegions must be a multiple of the sparse image block height (VkSparseImageFormatProperties::imageGranularity.height) of all non-metadata aspects of the image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-offset-01639)"}, + {VALIDATION_ERROR_40200cd0, "The spec valid usage text states 'The extent.width member of any element of pSplitInstanceBindRegions must either be a multiple of the sparse image block width of all non-metadata aspects of the image, or else extent.width + offset.x must equal the width of the image subresource' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-extent-01640)"}, + {VALIDATION_ERROR_40200cd2, "The spec valid usage text states 'The extent.height member of any element of pSplitInstanceBindRegions must either be a multiple of the sparse image block height of all non-metadata aspects of the image, or else extent.height offset.y must equal the width of the image subresource' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-extent-01641)"}, + {VALIDATION_ERROR_40213e01, "The spec valid usage text states 'If deviceIndexCount is not 0, pDeviceIndices must be a valid pointer to an array of deviceIndexCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-pDeviceIndices-parameter)"}, + {VALIDATION_ERROR_4022b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-sType-sType)"}, + {VALIDATION_ERROR_4023fe01, "The spec valid usage text states 'If splitInstanceBindRegionCount is not 0, pSplitInstanceBindRegions must be a valid pointer to an array of splitInstanceBindRegionCount VkRect2D structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBindImageMemoryDeviceGroupInfo-pSplitInstanceBindRegions-parameter)"}, + {VALIDATION_ERROR_40405601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySamplerYcbcrConversion-device-parameter)"}, + {VALIDATION_ERROR_4040ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySamplerYcbcrConversion-pAllocator-parameter)"}, + {VALIDATION_ERROR_4043e201, "The spec valid usage text states 'If ycbcrConversion is not VK_NULL_HANDLE, ycbcrConversion must be a valid VkSamplerYcbcrConversion handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySamplerYcbcrConversion-ycbcrConversion-parameter)"}, + {VALIDATION_ERROR_4043e207, "The spec valid usage text states 'If ycbcrConversion is a valid handle, it must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroySamplerYcbcrConversion-ycbcrConversion-parent)"}, + {VALIDATION_ERROR_4062b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSamplerYcbcrConversionFeatures-sType-sType)"}, + {VALIDATION_ERROR_4082b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionImageFormatProperties-sType-sType)"}, + {VALIDATION_ERROR_40a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionInfo-sType-sType)"}, + {VALIDATION_ERROR_40a3e601, "The spec valid usage text states 'conversion must be a valid VkSamplerYcbcrConversion handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSamplerYcbcrConversionInfo-conversion-parameter)"}, + {VALIDATION_ERROR_40c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_40c3ea01, "The spec valid usage text states 'globalPriority must be a valid VkQueueGlobalPriorityEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-globalPriority-parameter)"}, + {VALIDATION_ERROR_40e05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetShaderInfoAMD-device-parameter)"}, + {VALIDATION_ERROR_40e27c01, "The spec valid usage text states 'pipeline must be a valid VkPipeline handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetShaderInfoAMD-pipeline-parameter)"}, + {VALIDATION_ERROR_40e27c07, "The spec valid usage text states 'pipeline must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetShaderInfoAMD-pipeline-parent)"}, + {VALIDATION_ERROR_40e39c01, "The spec valid usage text states 'If the value referenced by pInfoSize is not 0, and pInfo is not NULL, pInfo must be a valid pointer to an array of pInfoSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetShaderInfoAMD-pInfo-parameter)"}, + {VALIDATION_ERROR_40e3ec01, "The spec valid usage text states 'shaderStage must be a valid VkShaderStageFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetShaderInfoAMD-shaderStage-parameter)"}, + {VALIDATION_ERROR_40e3ee01, "The spec valid usage text states 'infoType must be a valid VkShaderInfoTypeAMD value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetShaderInfoAMD-infoType-parameter)"}, + {VALIDATION_ERROR_40e3f001, "The spec valid usage text states 'pInfoSize must be a valid pointer to a size_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetShaderInfoAMD-pInfoSize-parameter)"}, + {VALIDATION_ERROR_41200da6, "The spec valid usage text states 'If handleType is not 0, it must be supported for import, as reported in VkExternalMemoryPropertiesKHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryHostPointerInfoEXT-handleType-01747)"}, + {VALIDATION_ERROR_41200da8, "The spec valid usage text states 'If handleType is not 0, it must be VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT or VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryHostPointerInfoEXT-handleType-01748)"}, + {VALIDATION_ERROR_41200daa, "The spec valid usage text states 'pHostPointer must be a pointer aligned to an integer multiple of VkPhysicalDeviceExternalMemoryHostPropertiesEXT::minImportedHostPointerAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryHostPointerInfoEXT-pHostPointer-01749)"}, + {VALIDATION_ERROR_41200dac, "The spec valid usage text states 'If handleType is VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT, pHostPointer must be a pointer to allocationSize number of bytes of host memory, where allocationSize is the member of the VkMemoryAllocateInfo structure this structure is chained to' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryHostPointerInfoEXT-handleType-01750)"}, + {VALIDATION_ERROR_41200dae, "The spec valid usage text states 'If handleType is VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT, pHostPointer must be a pointer to allocationSize number of bytes of host mapped foreign memory, where allocationSize is the member of the VkMemoryAllocateInfo structure this structure is chained to' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryHostPointerInfoEXT-handleType-01751)"}, + {VALIDATION_ERROR_41209c01, "The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryHostPointerInfoEXT-handleType-parameter)"}, + {VALIDATION_ERROR_4122b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportMemoryHostPointerInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_4141c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryHostPointerPropertiesEXT-pNext-pNext)"}, + {VALIDATION_ERROR_4142b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryHostPointerPropertiesEXT-sType-sType)"}, + {VALIDATION_ERROR_4162b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceExternalMemoryHostPropertiesEXT-sType-sType)"}, + {VALIDATION_ERROR_41800db0, "The spec valid usage text states 'handleType must be VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT or VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-01752)"}, + {VALIDATION_ERROR_41800db2, "The spec valid usage text states 'pHostPointer must be a pointer aligned to an integer multiple of VkPhysicalDeviceExternalMemoryHostPropertiesEXT::minImportedHostPointerAlignment' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryHostPointerPropertiesEXT-pHostPointer-01753)"}, + {VALIDATION_ERROR_41800db4, "The spec valid usage text states 'If handleType is VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT, pHostPointer must be a pointer to host memory' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-01754)"}, + {VALIDATION_ERROR_41800db6, "The spec valid usage text states 'If handleType is VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT, pHostPointer must be a pointer to host mapped foreign memory' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-01755)"}, + {VALIDATION_ERROR_41805601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryHostPointerPropertiesEXT-device-parameter)"}, + {VALIDATION_ERROR_41809c01, "The spec valid usage text states 'handleType must be a valid VkExternalMemoryHandleTypeFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-parameter)"}, + {VALIDATION_ERROR_4183f401, "The spec valid usage text states 'pMemoryHostPointerProperties must be a valid pointer to a VkMemoryHostPointerPropertiesEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryHostPointerPropertiesEXT-pMemoryHostPointerProperties-parameter)"}, + {VALIDATION_ERROR_41a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceConservativeRasterizationPropertiesEXT-sType-sType)"}, + {VALIDATION_ERROR_41c00dd2, "The spec valid usage text states 'extraPrimitiveOverestimationSize must be in the range of 0.0 to VkPhysicalDeviceConservativeRasterizationPropertiesEXT::maxExtraPrimitiveOverestimationSize inclusive' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-extraPrimitiveOverestimationSize-01769)"}, + {VALIDATION_ERROR_41c09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-flags-zerobitmask)"}, + {VALIDATION_ERROR_41c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_41c3f801, "The spec valid usage text states 'conservativeRasterizationMode must be a valid VkConservativeRasterizationModeEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-conservativeRasterizationMode-parameter)"}, + {VALIDATION_ERROR_41e00009, "The spec valid usage text states 'Both of commandBuffer, and dstBuffer must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-commonparent)"}, + {VALIDATION_ERROR_41e00e0c, "The spec valid usage text states 'dstOffset must be less than or equal to the size of dstBuffer minus 4.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-dstOffset-01798)"}, + {VALIDATION_ERROR_41e00e0e, "The spec valid usage text states 'dstBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_DST_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-dstBuffer-01799)"}, + {VALIDATION_ERROR_41e00e10, "The spec valid usage text states 'If dstBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-dstBuffer-01800)"}, + {VALIDATION_ERROR_41e00e12, "The spec valid usage text states 'dstOffset must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-dstOffset-01801)"}, + {VALIDATION_ERROR_41e02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-commandBuffer-parameter)"}, + {VALIDATION_ERROR_41e02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-commandBuffer-recording)"}, + {VALIDATION_ERROR_41e02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-commandBuffer-cmdpool)"}, + {VALIDATION_ERROR_41e06c01, "The spec valid usage text states 'dstBuffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-dstBuffer-parameter)"}, + {VALIDATION_ERROR_41e28401, "The spec valid usage text states 'pipelineStage must be a valid VkPipelineStageFlagBits value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdWriteBufferMarkerAMD-pipelineStage-parameter)"}, + {VALIDATION_ERROR_4201c40d, "The spec valid usage text states 'pNext must be NULL or a pointer to a valid instance of VkDescriptorSetVariableDescriptorCountLayoutSupportEXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutSupport-pNext-pNext)"}, + {VALIDATION_ERROR_4202b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutSupport-sType-sType)"}, + {VALIDATION_ERROR_42200e64, "The spec valid usage text states 'queueFamilyIndex must be one of the queue family indices specified when device was created, via the VkDeviceQueueCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceQueueInfo2-queueFamilyIndex-01842)"}, + {VALIDATION_ERROR_42200e66, "The spec valid usage text states 'queueIndex must be less than the number of queues created for the specified queue family index and VkDeviceQueueCreateFlags member flags equal to this flags value when device was created, via the queueCount member of the VkDeviceQueueCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceQueueInfo2-queueIndex-01843)"}, + {VALIDATION_ERROR_42209001, "The spec valid usage text states 'flags must be a valid combination of VkDeviceQueueCreateFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceQueueInfo2-flags-parameter)"}, + {VALIDATION_ERROR_42209003, "The spec valid usage text states 'flags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceQueueInfo2-flags-requiredbitmask)"}, + {VALIDATION_ERROR_4221c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceQueueInfo2-pNext-pNext)"}, + {VALIDATION_ERROR_4222b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDeviceQueueInfo2-sType-sType)"}, + {VALIDATION_ERROR_4242b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceMaintenance3Properties-sType-sType)"}, + {VALIDATION_ERROR_4262b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceProtectedMemoryFeatures-sType-sType)"}, + {VALIDATION_ERROR_4282b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceProtectedMemoryProperties-sType-sType)"}, + {VALIDATION_ERROR_42a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceShaderDrawParameterFeatures-sType-sType)"}, + {VALIDATION_ERROR_42c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceSubgroupProperties-sType-sType)"}, + {VALIDATION_ERROR_42e00e30, "The spec valid usage text states 'If the protected memory feature is not enabled, protectedSubmit must not be VK_TRUE.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkProtectedSubmitInfo-protectedSubmit-01816)"}, + {VALIDATION_ERROR_42e00e32, "The spec valid usage text states 'If protectedSubmit is VK_TRUE, then each element of the pCommandBuffers array must be a protected command buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkProtectedSubmitInfo-protectedSubmit-01817)"}, + {VALIDATION_ERROR_42e00e34, "The spec valid usage text states 'If protectedSubmit is VK_FALSE, then each element of the pCommandBuffers array must be an unprotected command buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkProtectedSubmitInfo-protectedSubmit-01818)"}, + {VALIDATION_ERROR_42e00e36, "The spec valid usage text states 'If the VkSubmitInfo::pNext chain does not include a VkProtectedSubmitInfo structure, then each element of the command buffer of the pCommandBuffers array must be an unprotected command buffer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkProtectedSubmitInfo-pNext-01819)"}, + {VALIDATION_ERROR_42e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkProtectedSubmitInfo-sType-sType)"}, + {VALIDATION_ERROR_43040001, "The spec valid usage text states 'pApiVersion must be a valid pointer to a uint32_t value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkEnumerateInstanceVersion-pApiVersion-parameter)"}, + {VALIDATION_ERROR_43205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDescriptorSetLayoutSupport-device-parameter)"}, + {VALIDATION_ERROR_43211e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDescriptorSetLayoutCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDescriptorSetLayoutSupport-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_43240201, "The spec valid usage text states 'pSupport must be a valid pointer to a VkDescriptorSetLayoutSupport structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDescriptorSetLayoutSupport-pSupport-parameter)"}, + {VALIDATION_ERROR_43405601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceQueue2-device-parameter)"}, + {VALIDATION_ERROR_4341fc01, "The spec valid usage text states 'pQueue must be a valid pointer to a VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceQueue2-pQueue-parameter)"}, + {VALIDATION_ERROR_43440401, "The spec valid usage text states 'pQueueInfo must be a valid pointer to a valid VkDeviceQueueInfo2 structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetDeviceQueue2-pQueueInfo-parameter)"}, + {VALIDATION_ERROR_43600ee2, "The spec valid usage text states 'objectType must not be VK_OBJECT_TYPE_UNKNOWN' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectNameInfoEXT-objectType-01905)"}, + {VALIDATION_ERROR_43600ee4, "The spec valid usage text states 'objectHandle must not be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectNameInfoEXT-objectHandle-01906)"}, + {VALIDATION_ERROR_43600ee6, "The spec valid usage text states 'objectHandle must be a Vulkan object of the type associated with objectType as defined in debugging-object-types.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectNameInfoEXT-objectHandle-01907)"}, + {VALIDATION_ERROR_4360da01, "The spec valid usage text states 'objectType must be a valid VkObjectType value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectNameInfoEXT-objectType-parameter)"}, + {VALIDATION_ERROR_4361c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectNameInfoEXT-pNext-pNext)"}, + {VALIDATION_ERROR_4361ce01, "The spec valid usage text states 'If pObjectName is not NULL, pObjectName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectNameInfoEXT-pObjectName-parameter)"}, + {VALIDATION_ERROR_4362b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectNameInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_43800ee8, "The spec valid usage text states 'objectType must not be VK_OBJECT_TYPE_UNKNOWN' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectTagInfoEXT-objectType-01908)"}, + {VALIDATION_ERROR_43800eea, "The spec valid usage text states 'objectHandle must not be VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectTagInfoEXT-objectHandle-01909)"}, + {VALIDATION_ERROR_43800eec, "The spec valid usage text states 'objectHandle must be a Vulkan object of the type associated with objectType as defined in debugging-object-types.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectTagInfoEXT-objectHandle-01910)"}, + {VALIDATION_ERROR_4380da01, "The spec valid usage text states 'objectType must be a valid VkObjectType value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectTagInfoEXT-objectType-parameter)"}, + {VALIDATION_ERROR_4381c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectTagInfoEXT-pNext-pNext)"}, + {VALIDATION_ERROR_43825a01, "The spec valid usage text states 'pTag must be a valid pointer to an array of tagSize bytes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectTagInfoEXT-pTag-parameter)"}, + {VALIDATION_ERROR_4382b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectTagInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_4382f41b, "The spec valid usage text states 'tagSize must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsObjectTagInfoEXT-tagSize-arraylength)"}, + {VALIDATION_ERROR_43a1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsLabelEXT-pNext-pNext)"}, + {VALIDATION_ERROR_43a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsLabelEXT-sType-sType)"}, + {VALIDATION_ERROR_43a40801, "The spec valid usage text states 'pLabelName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsLabelEXT-pLabelName-parameter)"}, + {VALIDATION_ERROR_43c09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCallbackDataEXT-flags-zerobitmask)"}, + {VALIDATION_ERROR_43c0d61b, "The spec valid usage text states 'objectCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCallbackDataEXT-objectCount-arraylength)"}, + {VALIDATION_ERROR_43c1b801, "The spec valid usage text states 'pMessage must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCallbackDataEXT-pMessage-parameter)"}, + {VALIDATION_ERROR_43c1c40d, "The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCallbackDataEXT-pNext-pNext)"}, + {VALIDATION_ERROR_43c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCallbackDataEXT-sType-sType)"}, + {VALIDATION_ERROR_43c42201, "The spec valid usage text states 'If pMessageIdName is not NULL, pMessageIdName must be a null-terminated UTF-8 string' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCallbackDataEXT-pMessageIdName-parameter)"}, + {VALIDATION_ERROR_43e00ef4, "The spec valid usage text states 'pfnUserCallback must be a valid PFN_vkDebugUtilsMessengerCallbackEXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCreateInfoEXT-pfnUserCallback-01914)"}, + {VALIDATION_ERROR_43e09005, "The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCreateInfoEXT-flags-zerobitmask)"}, + {VALIDATION_ERROR_43e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCreateInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_43e40a01, "The spec valid usage text states 'messageSeverity must be a valid combination of VkDebugUtilsMessageSeverityFlagBitsEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCreateInfoEXT-messageSeverity-parameter)"}, + {VALIDATION_ERROR_43e40a03, "The spec valid usage text states 'messageSeverity must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCreateInfoEXT-messageSeverity-requiredbitmask)"}, + {VALIDATION_ERROR_43e40c01, "The spec valid usage text states 'messageType must be a valid combination of VkDebugUtilsMessageTypeFlagBitsEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-parameter)"}, + {VALIDATION_ERROR_43e40c03, "The spec valid usage text states 'messageType must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-requiredbitmask)"}, + {VALIDATION_ERROR_4400bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDebugUtilsMessengerEXT-instance-parameter)"}, + {VALIDATION_ERROR_4400ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDebugUtilsMessengerEXT-pAllocator-parameter)"}, + {VALIDATION_ERROR_44011e01, "The spec valid usage text states 'pCreateInfo must be a valid pointer to a valid VkDebugUtilsMessengerCreateInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDebugUtilsMessengerEXT-pCreateInfo-parameter)"}, + {VALIDATION_ERROR_44041001, "The spec valid usage text states 'pMessenger must be a valid pointer to a VkDebugUtilsMessengerEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCreateDebugUtilsMessengerEXT-pMessenger-parameter)"}, + {VALIDATION_ERROR_4420bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSubmitDebugUtilsMessageEXT-instance-parameter)"}, + {VALIDATION_ERROR_44240a01, "The spec valid usage text states 'messageSeverity must be a valid VkDebugUtilsMessageSeverityFlagBitsEXT value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSubmitDebugUtilsMessageEXT-messageSeverity-parameter)"}, + {VALIDATION_ERROR_44241201, "The spec valid usage text states 'messageTypes must be a valid combination of VkDebugUtilsMessageTypeFlagBitsEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSubmitDebugUtilsMessageEXT-messageTypes-parameter)"}, + {VALIDATION_ERROR_44241203, "The spec valid usage text states 'messageTypes must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSubmitDebugUtilsMessageEXT-messageTypes-requiredbitmask)"}, + {VALIDATION_ERROR_44242801, "The spec valid usage text states 'pCallbackData must be a valid pointer to a valid VkDebugUtilsMessengerCallbackDataEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSubmitDebugUtilsMessageEXT-pCallbackData-parameter)"}, + {VALIDATION_ERROR_4442b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT-sType-sType)"}, + {VALIDATION_ERROR_4462b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineVertexInputDivisorStateCreateInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_4464141b, "The spec valid usage text states 'vertexBindingDivisorCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineVertexInputDivisorStateCreateInfoEXT-vertexBindingDivisorCount-arraylength)"}, + {VALIDATION_ERROR_44641601, "The spec valid usage text states 'pVertexBindingDivisors must be a valid pointer to an array of vertexBindingDivisorCount VkVertexInputBindingDivisorDescriptionEXT structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPipelineVertexInputDivisorStateCreateInfoEXT-pVertexBindingDivisors-parameter)"}, + {VALIDATION_ERROR_44800ecc, "The spec valid usage text states 'externalFormat must be 0 or a value returned in the externalFormat member of VkAndroidHardwareBufferFormatPropertiesANDROID by an earlier call to vkGetAndroidHardwareBufferPropertiesANDROID' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalFormatANDROID-externalFormat-01894)"}, + {VALIDATION_ERROR_4482b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkExternalFormatANDROID-sType-sType)"}, + {VALIDATION_ERROR_44a00eb0, "The spec valid usage text states 'If buffer is not NULL, Android hardware buffers must be supported for import, as reported by VkExternalImageFormatProperties or VkExternalBufferProperties.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportAndroidHardwareBufferInfoANDROID-buffer-01880)"}, + {VALIDATION_ERROR_44a00eb2, "The spec valid usage text states 'If buffer is not NULL, it must be a valid Android hardware buffer object with format and usage compatible with Vulkan as described by VkExternalMemoryHandleTypeFlagBits.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportAndroidHardwareBufferInfoANDROID-buffer-01881)"}, + {VALIDATION_ERROR_44a01a01, "The spec valid usage text states 'buffer must be a valid pointer to a AHardwareBuffer value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportAndroidHardwareBufferInfoANDROID-buffer-parameter)"}, + {VALIDATION_ERROR_44a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImportAndroidHardwareBufferInfoANDROID-sType-sType)"}, + {VALIDATION_ERROR_44c00eb4, "The spec valid usage text states 'VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID must have been included in VkExportMemoryAllocateInfoKHR::handleTypes when memory was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetAndroidHardwareBufferInfoANDROID-handleTypes-01882)"}, + {VALIDATION_ERROR_44c00eb6, "The spec valid usage text states 'If the pNext chain of the VkMemoryAllocateInfo used to allocate memory included a VkMemoryDedicatedAllocateInfo with non-NULL image member, then that image must already be bound to memory.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkMemoryGetAndroidHardwareBufferInfoANDROID-pNext-01883)"}, + {VALIDATION_ERROR_44e00ef0, "The spec valid usage text states 'There must be an outstanding vkCmdBeginDebugUtilsLabelEXT command prior to the vkCmdEndDebugUtilsLabelEXT on the queue that commandBuffer is submitted to' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912)"}, + {VALIDATION_ERROR_44e00ef2, "The spec valid usage text states 'If commandBuffer is a secondary command buffer, there must be an outstanding vkCmdBeginDebugUtilsLabelEXT command recorded to commandBuffer that has not previously been ended by a call to vkCmdEndDebugUtilsLabelEXT.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01913)"}, + {VALIDATION_ERROR_44e02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-parameter)"}, + {VALIDATION_ERROR_44e02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-recording)"}, + {VALIDATION_ERROR_44e02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-cmdpool)"}, + {VALIDATION_ERROR_45000ef6, "The spec valid usage text states 'If VkAllocationCallbacks were provided when messenger was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugUtilsMessengerEXT-messenger-01915)"}, + {VALIDATION_ERROR_45000ef8, "The spec valid usage text states 'If no VkAllocationCallbacks were provided when messenger was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugUtilsMessengerEXT-messenger-01916)"}, + {VALIDATION_ERROR_4500bc01, "The spec valid usage text states 'instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugUtilsMessengerEXT-instance-parameter)"}, + {VALIDATION_ERROR_4500ec01, "The spec valid usage text states 'If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugUtilsMessengerEXT-pAllocator-parameter)"}, + {VALIDATION_ERROR_45042601, "The spec valid usage text states 'messenger must be a valid VkDebugUtilsMessengerEXT handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugUtilsMessengerEXT-messenger-parameter)"}, + {VALIDATION_ERROR_45042607, "The spec valid usage text states 'messenger must have been created, allocated, or retrieved from instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkDestroyDebugUtilsMessengerEXT-messenger-parent)"}, + {VALIDATION_ERROR_45200eb8, "The spec valid usage text states 'buffer must be a valid Android hardware buffer object with at least one of the AHARDWAREBUFFER_USAGE_GPU_* usage flags.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetAndroidHardwareBufferPropertiesANDROID-buffer-01884)"}, + {VALIDATION_ERROR_45201a01, "The spec valid usage text states 'buffer must be a valid pointer to a valid AHardwareBuffer value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetAndroidHardwareBufferPropertiesANDROID-buffer-parameter)"}, + {VALIDATION_ERROR_45205601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetAndroidHardwareBufferPropertiesANDROID-device-parameter)"}, + {VALIDATION_ERROR_4521f401, "The spec valid usage text states 'pProperties must be a valid pointer to a VkAndroidHardwareBufferPropertiesANDROID structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetAndroidHardwareBufferPropertiesANDROID-pProperties-parameter)"}, + {VALIDATION_ERROR_45400eee, "The spec valid usage text states 'There must be an outstanding vkQueueBeginDebugUtilsLabelEXT command prior to the vkQueueEndDebugUtilsLabelEXT on the queue' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueueEndDebugUtilsLabelEXT-None-01911)"}, + {VALIDATION_ERROR_45429c01, "The spec valid usage text states 'queue must be a valid VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueueEndDebugUtilsLabelEXT-queue-parameter)"}, + {VALIDATION_ERROR_4562b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAndroidHardwareBufferUsageANDROID-sType-sType)"}, + {VALIDATION_ERROR_45a05601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryAndroidHardwareBufferANDROID-device-parameter)"}, + {VALIDATION_ERROR_45a10001, "The spec valid usage text states 'pBuffer must be a valid pointer to a valid pointer to a AHardwareBuffer value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryAndroidHardwareBufferANDROID-pBuffer-parameter)"}, + {VALIDATION_ERROR_45a39c01, "The spec valid usage text states 'pInfo must be a valid pointer to a valid VkMemoryGetAndroidHardwareBufferInfoANDROID structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkGetMemoryAndroidHardwareBufferANDROID-pInfo-parameter)"}, + {VALIDATION_ERROR_45c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkAndroidHardwareBufferFormatPropertiesANDROID-sType-sType)"}, + {VALIDATION_ERROR_45e02401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginDebugUtilsLabelEXT-commandBuffer-parameter)"}, + {VALIDATION_ERROR_45e02413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginDebugUtilsLabelEXT-commandBuffer-recording)"}, + {VALIDATION_ERROR_45e02415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginDebugUtilsLabelEXT-commandBuffer-cmdpool)"}, + {VALIDATION_ERROR_45e42401, "The spec valid usage text states 'pLabelInfo must be a valid pointer to a valid VkDebugUtilsLabelEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdBeginDebugUtilsLabelEXT-pLabelInfo-parameter)"}, + {VALIDATION_ERROR_46002401, "The spec valid usage text states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdInsertDebugUtilsLabelEXT-commandBuffer-parameter)"}, + {VALIDATION_ERROR_46002413, "The spec valid usage text states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdInsertDebugUtilsLabelEXT-commandBuffer-recording)"}, + {VALIDATION_ERROR_46002415, "The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdInsertDebugUtilsLabelEXT-commandBuffer-cmdpool)"}, + {VALIDATION_ERROR_46042401, "The spec valid usage text states 'pLabelInfo must be a valid pointer to a valid VkDebugUtilsLabelEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdInsertDebugUtilsLabelEXT-pLabelInfo-parameter)"}, + {VALIDATION_ERROR_46229c01, "The spec valid usage text states 'queue must be a valid VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueueBeginDebugUtilsLabelEXT-queue-parameter)"}, + {VALIDATION_ERROR_46242401, "The spec valid usage text states 'pLabelInfo must be a valid pointer to a valid VkDebugUtilsLabelEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueueBeginDebugUtilsLabelEXT-pLabelInfo-parameter)"}, + {VALIDATION_ERROR_46429c01, "The spec valid usage text states 'queue must be a valid VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueueInsertDebugUtilsLabelEXT-queue-parameter)"}, + {VALIDATION_ERROR_46442401, "The spec valid usage text states 'pLabelInfo must be a valid pointer to a valid VkDebugUtilsLabelEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkQueueInsertDebugUtilsLabelEXT-pLabelInfo-parameter)"}, + {VALIDATION_ERROR_46605601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSetDebugUtilsObjectNameEXT-device-parameter)"}, + {VALIDATION_ERROR_4661c201, "The spec valid usage text states 'pNameInfo must be a valid pointer to a valid VkDebugUtilsObjectNameInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSetDebugUtilsObjectNameEXT-pNameInfo-parameter)"}, + {VALIDATION_ERROR_46805601, "The spec valid usage text states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSetDebugUtilsObjectTagEXT-device-parameter)"}, + {VALIDATION_ERROR_46825c01, "The spec valid usage text states 'pTagInfo must be a valid pointer to a valid VkDebugUtilsObjectTagInfoEXT structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkSetDebugUtilsObjectTagEXT-pTagInfo-parameter)"}, + {VALIDATION_ERROR_46a01774, "The spec valid usage text states 'If bindingCount is not zero, bindingCount must equal VkDescriptorSetLayoutCreateInfo::bindingCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-bindingCount-03002)"}, + {VALIDATION_ERROR_46a01776, "The spec valid usage text states 'If VkDescriptorSetLayoutCreateInfo::flags includes VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then all elements of pBindingFlags must not include VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT, VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT, or VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-flags-03003)"}, + {VALIDATION_ERROR_46a01778, "The spec valid usage text states 'If an element of pBindingFlags includes VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT, then all other elements of VkDescriptorSetLayoutCreateInfo::pBindings must have a smaller value of binding' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-03004)"}, + {VALIDATION_ERROR_46a0177a, "The spec valid usage text states 'If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingUniformBufferUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingUniformBufferUpdateAfterBind-03005)"}, + {VALIDATION_ERROR_46a0177c, "The spec valid usage text states 'If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingSampledImageUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_SAMPLER, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, or VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingSampledImageUpdateAfterBind-03006)"}, + {VALIDATION_ERROR_46a0177e, "The spec valid usage text states 'If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingStorageImageUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_STORAGE_IMAGE must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingStorageImageUpdateAfterBind-03007)"}, + {VALIDATION_ERROR_46a01780, "The spec valid usage text states 'If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingStorageBufferUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_STORAGE_BUFFER must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingStorageBufferUpdateAfterBind-03008)"}, + {VALIDATION_ERROR_46a01782, "The spec valid usage text states 'If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingUniformTexelBufferUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingUniformTexelBufferUpdateAfterBind-03009)"}, + {VALIDATION_ERROR_46a01784, "The spec valid usage text states 'If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingStorageTexelBufferUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingStorageTexelBufferUpdateAfterBind-03010)"}, + {VALIDATION_ERROR_46a01786, "The spec valid usage text states 'All bindings with descriptor type VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-None-03011)"}, + {VALIDATION_ERROR_46a01788, "The spec valid usage text states 'If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingUpdateUnusedWhilePending is not enabled, all elements of pBindingFlags must not include VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingUpdateUnusedWhilePending-03012)"}, + {VALIDATION_ERROR_46a0178a, "The spec valid usage text states 'If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingPartiallyBound is not enabled, all elements of pBindingFlags must not include VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingPartiallyBound-03013)"}, + {VALIDATION_ERROR_46a0178c, "The spec valid usage text states 'If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingVariableDescriptorCount is not enabled, all elements of pBindingFlags must not include VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingVariableDescriptorCount-03014)"}, + {VALIDATION_ERROR_46a0178e, "The spec valid usage text states 'If an element of pBindingFlags includes VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT, that element's descriptorType must not be VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-03015)"}, + {VALIDATION_ERROR_46a2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_46a42a01, "The spec valid usage text states 'If bindingCount is not 0, pBindingFlags must be a valid pointer to an array of bindingCount valid combinations of VkDescriptorBindingFlagBitsEXT values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-parameter)"}, + {VALIDATION_ERROR_46a42a03, "The spec valid usage text states 'Each element of pBindingFlags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-requiredbitmask)"}, + {VALIDATION_ERROR_46c017ca, "The spec valid usage text states 'If descriptorSetCount is not zero, descriptorSetCount must equal VkDescriptorSetAllocateInfo::descriptorSetCount' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-descriptorSetCount-03045)"}, + {VALIDATION_ERROR_46c017cc, "The spec valid usage text states 'If VkDescriptorSetAllocateInfo::pSetLayouts[i] has a variable descriptor count binding, then pDescriptorCounts[i] must be less than or equal to the descriptor count specified for that binding when the descriptor set layout was created.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-pSetLayouts-03046)"}, + {VALIDATION_ERROR_46c2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-sType-sType)"}, + {VALIDATION_ERROR_46c42c01, "The spec valid usage text states 'If descriptorSetCount is not 0, pDescriptorCounts must be a valid pointer to an array of descriptorSetCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-pDescriptorCounts-parameter)"}, + {VALIDATION_ERROR_46e2b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetVariableDescriptorCountLayoutSupportEXT-sType-sType)"}, + {VALIDATION_ERROR_4702b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceDescriptorIndexingFeaturesEXT-sType-sType)"}, + {VALIDATION_ERROR_4722b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceDescriptorIndexingPropertiesEXT-sType-sType)"}, + {VALIDATION_ERROR_4742b00b, "The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkPhysicalDeviceShaderCorePropertiesAMD-sType-sType)"}, + {VALIDATION_ERROR_47600e9a, "The spec valid usage text states 'binding must be less than VkPhysicalDeviceLimits::maxVertexInputBindings' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkVertexInputBindingDivisorDescriptionEXT-binding-01869)"}, + {VALIDATION_ERROR_47600e9c, "The spec valid usage text states 'divisor must be a value between 0 and VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT::maxVertexAttribDivisor, inclusive.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkVertexInputBindingDivisorDescriptionEXT-divisor-01870)"}, + {VALIDATION_ERROR_47600e9e, "The spec valid usage text states 'VkVertexInputBindingDescription::inputRate must be of type VK_VERTEX_INPUT_RATE_INSTANCE for this binding.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkVertexInputBindingDivisorDescriptionEXT-inputRate-01871)"}, +}; + + +// Mapping from spec validation error text string to unique validation error enum +static std::unordered_map validation_error_text_map{ + {"VUID-VkAcquireNextImageInfoKHR-commonparent", VALIDATION_ERROR_00000009}, + {"VUID-VkAcquireNextImageInfoKHR-semaphore-01288", VALIDATION_ERROR_00000a10}, + {"VUID-VkAcquireNextImageInfoKHR-fence-01289", VALIDATION_ERROR_00000a12}, + {"VUID-VkAcquireNextImageInfoKHR-deviceMask-01290", VALIDATION_ERROR_00000a14}, + {"VUID-VkAcquireNextImageInfoKHR-deviceMask-01291", VALIDATION_ERROR_00000a16}, + {"VUID-VkAcquireNextImageInfoKHR-swapchain-01675", VALIDATION_ERROR_00000d16}, + {"VUID-VkAcquireNextImageInfoKHR-semaphore-01781", VALIDATION_ERROR_00000dea}, + {"VUID-VkAcquireNextImageInfoKHR-semaphore-01782", VALIDATION_ERROR_00000dec}, + {"VUID-VkAcquireNextImageInfoKHR-semaphore-01804", VALIDATION_ERROR_00000e18}, + {"VUID-VkAcquireNextImageInfoKHR-fence-parameter", VALIDATION_ERROR_00008801}, + {"VUID-VkAcquireNextImageInfoKHR-pNext-pNext", VALIDATION_ERROR_0001c40d}, + {"VUID-VkAcquireNextImageInfoKHR-sType-sType", VALIDATION_ERROR_0002b00b}, + {"VUID-VkAcquireNextImageInfoKHR-semaphore-parameter", VALIDATION_ERROR_0002b801}, + {"VUID-VkAcquireNextImageInfoKHR-swapchain-parameter", VALIDATION_ERROR_0002f001}, + {"VUID-VkAllocationCallbacks-pfnAllocation-00632", VALIDATION_ERROR_002004f0}, + {"VUID-VkAllocationCallbacks-pfnReallocation-00633", VALIDATION_ERROR_002004f2}, + {"VUID-VkAllocationCallbacks-pfnFree-00634", VALIDATION_ERROR_002004f4}, + {"VUID-VkAllocationCallbacks-pfnInternalAllocation-00635", VALIDATION_ERROR_002004f6}, + {"VUID-VkAndroidSurfaceCreateInfoKHR-window-01248", VALIDATION_ERROR_004009c0}, + {"VUID-VkAndroidSurfaceCreateInfoKHR-flags-zerobitmask", VALIDATION_ERROR_00409005}, + {"VUID-VkAndroidSurfaceCreateInfoKHR-pNext-pNext", VALIDATION_ERROR_0041c40d}, + {"VUID-VkAndroidSurfaceCreateInfoKHR-sType-sType", VALIDATION_ERROR_0042b00b}, + {"VUID-VkApplicationInfo-pApplicationName-parameter", VALIDATION_ERROR_0060f001}, + {"VUID-VkApplicationInfo-pEngineName-parameter", VALIDATION_ERROR_00615c01}, + {"VUID-VkApplicationInfo-pNext-pNext", VALIDATION_ERROR_0061c40d}, + {"VUID-VkApplicationInfo-sType-sType", VALIDATION_ERROR_0062b00b}, + {"VUID-VkAttachmentDescription-finalLayout-00843", VALIDATION_ERROR_00800696}, + {"VUID-VkAttachmentDescription-finalLayout-parameter", VALIDATION_ERROR_00808e01}, + {"VUID-VkAttachmentDescription-flags-parameter", VALIDATION_ERROR_00809001}, + {"VUID-VkAttachmentDescription-format-parameter", VALIDATION_ERROR_00809201}, + {"VUID-VkAttachmentDescription-initialLayout-parameter", VALIDATION_ERROR_0080b801}, + {"VUID-VkAttachmentDescription-loadOp-parameter", VALIDATION_ERROR_0080c201}, + {"VUID-VkAttachmentDescription-samples-parameter", VALIDATION_ERROR_0082b401}, + {"VUID-VkAttachmentDescription-stencilLoadOp-parameter", VALIDATION_ERROR_0082e001}, + {"VUID-VkAttachmentDescription-stencilStoreOp-parameter", VALIDATION_ERROR_0082e201}, + {"VUID-VkAttachmentDescription-storeOp-parameter", VALIDATION_ERROR_0082e401}, + {"VUID-VkAttachmentReference-layout-00857", VALIDATION_ERROR_00a006b2}, + {"VUID-VkAttachmentReference-layout-parameter", VALIDATION_ERROR_00a0be01}, + {"VUID-VkBindBufferMemoryInfo-commonparent", VALIDATION_ERROR_00c00009}, + {"VUID-VkBindBufferMemoryInfo-buffer-01593", VALIDATION_ERROR_00c00c72}, + {"VUID-VkBindBufferMemoryInfo-buffer-01594", VALIDATION_ERROR_00c00c74}, + {"VUID-VkBindBufferMemoryInfo-memoryOffset-01595", VALIDATION_ERROR_00c00c76}, + {"VUID-VkBindBufferMemoryInfo-buffer-01596", VALIDATION_ERROR_00c00c78}, + {"VUID-VkBindBufferMemoryInfo-buffer-01597", VALIDATION_ERROR_00c00c7a}, + {"VUID-VkBindBufferMemoryInfo-buffer-01598", VALIDATION_ERROR_00c00c7c}, + {"VUID-VkBindBufferMemoryInfo-memory-01599", VALIDATION_ERROR_00c00c7e}, + {"VUID-VkBindBufferMemoryInfo-memoryOffset-01600", VALIDATION_ERROR_00c00c80}, + {"VUID-VkBindBufferMemoryInfo-size-01601", VALIDATION_ERROR_00c00c82}, + {"VUID-VkBindBufferMemoryInfo-buffer-01602", VALIDATION_ERROR_00c00c84}, + {"VUID-VkBindBufferMemoryInfo-buffer-01603", VALIDATION_ERROR_00c00c86}, + {"VUID-VkBindBufferMemoryInfo-buffer-01604", VALIDATION_ERROR_00c00c88}, + {"VUID-VkBindBufferMemoryInfo-pNext-01605", VALIDATION_ERROR_00c00c8a}, + {"VUID-VkBindBufferMemoryInfo-memory-01900", VALIDATION_ERROR_00c00ed8}, + {"VUID-VkBindBufferMemoryInfo-buffer-parameter", VALIDATION_ERROR_00c01a01}, + {"VUID-VkBindBufferMemoryInfo-memory-parameter", VALIDATION_ERROR_00c0c601}, + {"VUID-VkBindBufferMemoryInfo-pNext-pNext", VALIDATION_ERROR_00c1c40d}, + {"VUID-VkBindBufferMemoryInfo-sType-sType", VALIDATION_ERROR_00c2b00b}, + {"VUID-VkBindImageMemoryInfo-commonparent", VALIDATION_ERROR_00e00009}, + {"VUID-VkBindImageMemoryInfo-image-01609", VALIDATION_ERROR_00e00c92}, + {"VUID-VkBindImageMemoryInfo-image-01610", VALIDATION_ERROR_00e00c94}, + {"VUID-VkBindImageMemoryInfo-memoryOffset-01611", VALIDATION_ERROR_00e00c96}, + {"VUID-VkBindImageMemoryInfo-memory-01612", VALIDATION_ERROR_00e00c98}, + {"VUID-VkBindImageMemoryInfo-memoryOffset-01613", VALIDATION_ERROR_00e00c9a}, + {"VUID-VkBindImageMemoryInfo-memory-01614", VALIDATION_ERROR_00e00c9c}, + {"VUID-VkBindImageMemoryInfo-pNext-01615", VALIDATION_ERROR_00e00c9e}, + {"VUID-VkBindImageMemoryInfo-pNext-01616", VALIDATION_ERROR_00e00ca0}, + {"VUID-VkBindImageMemoryInfo-pNext-01617", VALIDATION_ERROR_00e00ca2}, + {"VUID-VkBindImageMemoryInfo-pNext-01618", VALIDATION_ERROR_00e00ca4}, + {"VUID-VkBindImageMemoryInfo-pNext-01619", VALIDATION_ERROR_00e00ca6}, + {"VUID-VkBindImageMemoryInfo-pNext-01620", VALIDATION_ERROR_00e00ca8}, + {"VUID-VkBindImageMemoryInfo-pNext-01621", VALIDATION_ERROR_00e00caa}, + {"VUID-VkBindImageMemoryInfo-image-01622", VALIDATION_ERROR_00e00cac}, + {"VUID-VkBindImageMemoryInfo-image-01623", VALIDATION_ERROR_00e00cae}, + {"VUID-VkBindImageMemoryInfo-image-01624", VALIDATION_ERROR_00e00cb0}, + {"VUID-VkBindImageMemoryInfo-memory-01625", VALIDATION_ERROR_00e00cb2}, + {"VUID-VkBindImageMemoryInfo-pNext-01626", VALIDATION_ERROR_00e00cb4}, + {"VUID-VkBindImageMemoryInfo-pNext-01627", VALIDATION_ERROR_00e00cb6}, + {"VUID-VkBindImageMemoryInfo-pNext-01628", VALIDATION_ERROR_00e00cb8}, + {"VUID-VkBindImageMemoryInfo-pNext-01629", VALIDATION_ERROR_00e00cba}, + {"VUID-VkBindImageMemoryInfo-image-01630", VALIDATION_ERROR_00e00cbc}, + {"VUID-VkBindImageMemoryInfo-pNext-01631", VALIDATION_ERROR_00e00cbe}, + {"VUID-VkBindImageMemoryInfo-pNext-01632", VALIDATION_ERROR_00e00cc0}, + {"VUID-VkBindImageMemoryInfo-memory-01903", VALIDATION_ERROR_00e00ede}, + {"VUID-VkBindImageMemoryInfo-image-parameter", VALIDATION_ERROR_00e0a001}, + {"VUID-VkBindImageMemoryInfo-pNext-pNext", VALIDATION_ERROR_00e1c40d}, + {"VUID-VkBindImageMemoryInfo-sType-sType", VALIDATION_ERROR_00e2b00b}, + {"VUID-VkBindImageMemoryInfo-sType-unique", VALIDATION_ERROR_00e2b00f}, + {"VUID-VkBindImageMemorySwapchainInfoKHR-imageIndex-01644", VALIDATION_ERROR_01000cd8}, + {"VUID-VkBindImageMemorySwapchainInfoKHR-sType-sType", VALIDATION_ERROR_0102b00b}, + {"VUID-VkBindImageMemorySwapchainInfoKHR-swapchain-parameter", VALIDATION_ERROR_0102f001}, + {"VUID-VkBindSparseInfo-commonparent", VALIDATION_ERROR_01200009}, + {"VUID-VkBindSparseInfo-pBufferBinds-parameter", VALIDATION_ERROR_01210201}, + {"VUID-VkBindSparseInfo-pImageBinds-parameter", VALIDATION_ERROR_01218001}, + {"VUID-VkBindSparseInfo-pImageOpaqueBinds-parameter", VALIDATION_ERROR_01218c01}, + {"VUID-VkBindSparseInfo-pNext-pNext", VALIDATION_ERROR_0121c40d}, + {"VUID-VkBindSparseInfo-pSignalSemaphores-parameter", VALIDATION_ERROR_01223401}, + {"VUID-VkBindSparseInfo-pWaitSemaphores-parameter", VALIDATION_ERROR_01227601}, + {"VUID-VkBindSparseInfo-sType-sType", VALIDATION_ERROR_0122b00b}, + {"VUID-VkBufferCreateInfo-size-00912", VALIDATION_ERROR_01400720}, + {"VUID-VkBufferCreateInfo-sharingMode-00913", VALIDATION_ERROR_01400722}, + {"VUID-VkBufferCreateInfo-sharingMode-00914", VALIDATION_ERROR_01400724}, + {"VUID-VkBufferCreateInfo-flags-00915", VALIDATION_ERROR_01400726}, + {"VUID-VkBufferCreateInfo-flags-00916", VALIDATION_ERROR_01400728}, + {"VUID-VkBufferCreateInfo-flags-00917", VALIDATION_ERROR_0140072a}, + {"VUID-VkBufferCreateInfo-flags-00918", VALIDATION_ERROR_0140072c}, + {"VUID-VkBufferCreateInfo-pNext-00920", VALIDATION_ERROR_01400730}, + {"VUID-VkBufferCreateInfo-sharingMode-01391", VALIDATION_ERROR_01400ade}, + {"VUID-VkBufferCreateInfo-sharingMode-01419", VALIDATION_ERROR_01400b16}, + {"VUID-VkBufferCreateInfo-pNext-01571", VALIDATION_ERROR_01400c46}, + {"VUID-VkBufferCreateInfo-flags-01887", VALIDATION_ERROR_01400ebe}, + {"VUID-VkBufferCreateInfo-None-01888", VALIDATION_ERROR_01400ec0}, + {"VUID-VkBufferCreateInfo-flags-parameter", VALIDATION_ERROR_01409001}, + {"VUID-VkBufferCreateInfo-pNext-pNext", VALIDATION_ERROR_0141c40d}, + {"VUID-VkBufferCreateInfo-sType-sType", VALIDATION_ERROR_0142b00b}, + {"VUID-VkBufferCreateInfo-sType-unique", VALIDATION_ERROR_0142b00f}, + {"VUID-VkBufferCreateInfo-sharingMode-parameter", VALIDATION_ERROR_0142c001}, + {"VUID-VkBufferCreateInfo-usage-parameter", VALIDATION_ERROR_01430601}, + {"VUID-VkBufferCreateInfo-usage-requiredbitmask", VALIDATION_ERROR_01430603}, + {"VUID-VkBufferImageCopy-bufferOffset-00193", VALIDATION_ERROR_01600182}, + {"VUID-VkBufferImageCopy-bufferOffset-00194", VALIDATION_ERROR_01600184}, + {"VUID-VkBufferImageCopy-bufferRowLength-00195", VALIDATION_ERROR_01600186}, + {"VUID-VkBufferImageCopy-bufferImageHeight-00196", VALIDATION_ERROR_01600188}, + {"VUID-VkBufferImageCopy-imageOffset-00197", VALIDATION_ERROR_0160018a}, + {"VUID-VkBufferImageCopy-imageOffset-00198", VALIDATION_ERROR_0160018c}, + {"VUID-VkBufferImageCopy-srcImage-00199", VALIDATION_ERROR_0160018e}, + {"VUID-VkBufferImageCopy-imageOffset-00200", VALIDATION_ERROR_01600190}, + {"VUID-VkBufferImageCopy-srcImage-00201", VALIDATION_ERROR_01600192}, + {"VUID-VkBufferImageCopy-bufferRowLength-00203", VALIDATION_ERROR_01600196}, + {"VUID-VkBufferImageCopy-bufferImageHeight-00204", VALIDATION_ERROR_01600198}, + {"VUID-VkBufferImageCopy-imageOffset-00205", VALIDATION_ERROR_0160019a}, + {"VUID-VkBufferImageCopy-bufferOffset-00206", VALIDATION_ERROR_0160019c}, + {"VUID-VkBufferImageCopy-imageExtent-00207", VALIDATION_ERROR_0160019e}, + {"VUID-VkBufferImageCopy-imageExtent-00208", VALIDATION_ERROR_016001a0}, + {"VUID-VkBufferImageCopy-imageExtent-00209", VALIDATION_ERROR_016001a2}, + {"VUID-VkBufferImageCopy-aspectMask-00211", VALIDATION_ERROR_016001a6}, + {"VUID-VkBufferImageCopy-aspectMask-00212", VALIDATION_ERROR_016001a8}, + {"VUID-VkBufferImageCopy-baseArrayLayer-00213", VALIDATION_ERROR_016001aa}, + {"VUID-VkBufferImageCopy-None-00214", VALIDATION_ERROR_016001ac}, + {"VUID-VkBufferImageCopy-bufferOffset-01558", VALIDATION_ERROR_01600c2c}, + {"VUID-VkBufferImageCopy-bufferOffset-01559", VALIDATION_ERROR_01600c2e}, + {"VUID-VkBufferImageCopy-aspectMask-01560", VALIDATION_ERROR_01600c30}, + {"VUID-VkBufferImageCopy-None-01735", VALIDATION_ERROR_01600d8e}, + {"VUID-VkBufferImageCopy-None-01736", VALIDATION_ERROR_01600d90}, + {"VUID-VkBufferImageCopy-None-01737", VALIDATION_ERROR_01600d92}, + {"VUID-VkBufferImageCopy-None-01738", VALIDATION_ERROR_01600d94}, + {"VUID-VkBufferImageCopy-None-01739", VALIDATION_ERROR_01600d96}, + {"VUID-VkBufferImageCopy-None-01740", VALIDATION_ERROR_01600d98}, + {"VUID-VkBufferImageCopy-None-01741", VALIDATION_ERROR_01600d9a}, + {"VUID-VkBufferImageCopy-imageSubresource-parameter", VALIDATION_ERROR_0160aa01}, + {"VUID-VkBufferMemoryBarrier-offset-01187", VALIDATION_ERROR_01800946}, + {"VUID-VkBufferMemoryBarrier-size-01188", VALIDATION_ERROR_01800948}, + {"VUID-VkBufferMemoryBarrier-size-01189", VALIDATION_ERROR_0180094a}, + {"VUID-VkBufferMemoryBarrier-buffer-01190", VALIDATION_ERROR_0180094c}, + {"VUID-VkBufferMemoryBarrier-buffer-01191", VALIDATION_ERROR_0180094e}, + {"VUID-VkBufferMemoryBarrier-buffer-01192", VALIDATION_ERROR_01800950}, + {"VUID-VkBufferMemoryBarrier-buffer-01193", VALIDATION_ERROR_01800952}, + {"VUID-VkBufferMemoryBarrier-buffer-01196", VALIDATION_ERROR_01800958}, + {"VUID-VkBufferMemoryBarrier-buffer-01763", VALIDATION_ERROR_01800dc6}, + {"VUID-VkBufferMemoryBarrier-buffer-01764", VALIDATION_ERROR_01800dc8}, + {"VUID-VkBufferMemoryBarrier-buffer-01765", VALIDATION_ERROR_01800dca}, + {"VUID-VkBufferMemoryBarrier-buffer-01931", VALIDATION_ERROR_01800f16}, + {"VUID-VkBufferMemoryBarrier-buffer-parameter", VALIDATION_ERROR_01801a01}, + {"VUID-VkBufferMemoryBarrier-dstAccessMask-parameter", VALIDATION_ERROR_01806801}, + {"VUID-VkBufferMemoryBarrier-pNext-pNext", VALIDATION_ERROR_0181c40d}, + {"VUID-VkBufferMemoryBarrier-sType-sType", VALIDATION_ERROR_0182b00b}, + {"VUID-VkBufferMemoryBarrier-srcAccessMask-parameter", VALIDATION_ERROR_0182c401}, + {"VUID-VkBufferViewCreateInfo-offset-00925", VALIDATION_ERROR_01a0073a}, + {"VUID-VkBufferViewCreateInfo-offset-00926", VALIDATION_ERROR_01a0073c}, + {"VUID-VkBufferViewCreateInfo-range-00928", VALIDATION_ERROR_01a00740}, + {"VUID-VkBufferViewCreateInfo-range-00929", VALIDATION_ERROR_01a00742}, + {"VUID-VkBufferViewCreateInfo-range-00930", VALIDATION_ERROR_01a00744}, + {"VUID-VkBufferViewCreateInfo-offset-00931", VALIDATION_ERROR_01a00746}, + {"VUID-VkBufferViewCreateInfo-buffer-00932", VALIDATION_ERROR_01a00748}, + {"VUID-VkBufferViewCreateInfo-buffer-00933", VALIDATION_ERROR_01a0074a}, + {"VUID-VkBufferViewCreateInfo-buffer-00934", VALIDATION_ERROR_01a0074c}, + {"VUID-VkBufferViewCreateInfo-buffer-00935", VALIDATION_ERROR_01a0074e}, + {"VUID-VkBufferViewCreateInfo-buffer-parameter", VALIDATION_ERROR_01a01a01}, + {"VUID-VkBufferViewCreateInfo-flags-zerobitmask", VALIDATION_ERROR_01a09005}, + {"VUID-VkBufferViewCreateInfo-format-parameter", VALIDATION_ERROR_01a09201}, + {"VUID-VkBufferViewCreateInfo-pNext-pNext", VALIDATION_ERROR_01a1c40d}, + {"VUID-VkBufferViewCreateInfo-sType-sType", VALIDATION_ERROR_01a2b00b}, + {"VUID-VkClearAttachment-aspectMask-00019", VALIDATION_ERROR_01c00026}, + {"VUID-VkClearAttachment-aspectMask-00020", VALIDATION_ERROR_01c00028}, + {"VUID-VkClearAttachment-clearValue-00021", VALIDATION_ERROR_01c0002a}, + {"VUID-VkClearAttachment-aspectMask-parameter", VALIDATION_ERROR_01c00c01}, + {"VUID-VkClearAttachment-aspectMask-requiredbitmask", VALIDATION_ERROR_01c00c03}, + {"VUID-VkClearAttachment-commandBuffer-01809", VALIDATION_ERROR_01c00e22}, + {"VUID-VkClearAttachment-commandBuffer-01810", VALIDATION_ERROR_01c00e24}, + {"VUID-VkClearDepthStencilValue-depth-00022", VALIDATION_ERROR_01e0002c}, + {"VUID-VkClearValue-depthStencil-00023", VALIDATION_ERROR_0200002e}, + {"VUID-VkCmdProcessCommandsInfoNVX-commonparent", VALIDATION_ERROR_02200009}, + {"VUID-VkCmdProcessCommandsInfoNVX-objectTable-01331", VALIDATION_ERROR_02200a66}, + {"VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsTokenCount-01332", VALIDATION_ERROR_02200a68}, + {"VUID-VkCmdProcessCommandsInfoNVX-tokenType-01333", VALIDATION_ERROR_02200a6a}, + {"VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01334", VALIDATION_ERROR_02200a6c}, + {"VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01335", VALIDATION_ERROR_02200a6e}, + {"VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01336", VALIDATION_ERROR_02200a70}, + {"VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01337", VALIDATION_ERROR_02200a72}, + {"VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-01338", VALIDATION_ERROR_02200a74}, + {"VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-01339", VALIDATION_ERROR_02200a76}, + {"VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-01340", VALIDATION_ERROR_02200a78}, + {"VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-01341", VALIDATION_ERROR_02200a7a}, + {"VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsLayout-parameter", VALIDATION_ERROR_0220b401}, + {"VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsTokenCount-arraylength", VALIDATION_ERROR_0220b61b}, + {"VUID-VkCmdProcessCommandsInfoNVX-objectTable-parameter", VALIDATION_ERROR_0220d801}, + {"VUID-VkCmdProcessCommandsInfoNVX-pIndirectCommandsTokens-parameter", VALIDATION_ERROR_02219401}, + {"VUID-VkCmdProcessCommandsInfoNVX-pNext-pNext", VALIDATION_ERROR_0221c40d}, + {"VUID-VkCmdProcessCommandsInfoNVX-sType-sType", VALIDATION_ERROR_0222b00b}, + {"VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-parameter", VALIDATION_ERROR_0222ba01}, + {"VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-parameter", VALIDATION_ERROR_0222bc01}, + {"VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-parameter", VALIDATION_ERROR_0222f601}, + {"VUID-VkCmdReserveSpaceForCommandsInfoNVX-commonparent", VALIDATION_ERROR_02400009}, + {"VUID-VkCmdReserveSpaceForCommandsInfoNVX-indirectCommandsLayout-parameter", VALIDATION_ERROR_0240b401}, + {"VUID-VkCmdReserveSpaceForCommandsInfoNVX-objectTable-parameter", VALIDATION_ERROR_0240d801}, + {"VUID-VkCmdReserveSpaceForCommandsInfoNVX-pNext-pNext", VALIDATION_ERROR_0241c40d}, + {"VUID-VkCmdReserveSpaceForCommandsInfoNVX-sType-sType", VALIDATION_ERROR_0242b00b}, + {"VUID-VkCommandBufferAllocateInfo-commandBufferCount-00044", VALIDATION_ERROR_02600058}, + {"VUID-VkCommandBufferAllocateInfo-commandPool-parameter", VALIDATION_ERROR_02602801}, + {"VUID-VkCommandBufferAllocateInfo-level-parameter", VALIDATION_ERROR_0260c001}, + {"VUID-VkCommandBufferAllocateInfo-pNext-pNext", VALIDATION_ERROR_0261c40d}, + {"VUID-VkCommandBufferAllocateInfo-sType-sType", VALIDATION_ERROR_0262b00b}, + {"VUID-VkCommandBufferBeginInfo-flags-00053", VALIDATION_ERROR_0280006a}, + {"VUID-VkCommandBufferBeginInfo-flags-00054", VALIDATION_ERROR_0280006c}, + {"VUID-VkCommandBufferBeginInfo-flags-00055", VALIDATION_ERROR_0280006e}, + {"VUID-VkCommandBufferBeginInfo-flags-parameter", VALIDATION_ERROR_02809001}, + {"VUID-VkCommandBufferBeginInfo-pNext-pNext", VALIDATION_ERROR_0281c40d}, + {"VUID-VkCommandBufferBeginInfo-sType-sType", VALIDATION_ERROR_0282b00b}, + {"VUID-VkCommandBufferInheritanceInfo-commonparent", VALIDATION_ERROR_02a00009}, + {"VUID-VkCommandBufferInheritanceInfo-occlusionQueryEnable-00056", VALIDATION_ERROR_02a00070}, + {"VUID-VkCommandBufferInheritanceInfo-queryFlags-00057", VALIDATION_ERROR_02a00072}, + {"VUID-VkCommandBufferInheritanceInfo-pipelineStatistics-00058", VALIDATION_ERROR_02a00074}, + {"VUID-VkCommandBufferInheritanceInfo-pNext-pNext", VALIDATION_ERROR_02a1c40d}, + {"VUID-VkCommandBufferInheritanceInfo-sType-sType", VALIDATION_ERROR_02a2b00b}, + {"VUID-VkCommandPoolCreateInfo-queueFamilyIndex-00039", VALIDATION_ERROR_02c0004e}, + {"VUID-VkCommandPoolCreateInfo-flags-parameter", VALIDATION_ERROR_02c09001}, + {"VUID-VkCommandPoolCreateInfo-pNext-pNext", VALIDATION_ERROR_02c1c40d}, + {"VUID-VkCommandPoolCreateInfo-sType-sType", VALIDATION_ERROR_02c2b00b}, + {"VUID-VkComponentMapping-a-parameter", VALIDATION_ERROR_02e00001}, + {"VUID-VkComponentMapping-b-parameter", VALIDATION_ERROR_02e01001}, + {"VUID-VkComponentMapping-g-parameter", VALIDATION_ERROR_02e09a01}, + {"VUID-VkComponentMapping-r-parameter", VALIDATION_ERROR_02e2a201}, + {"VUID-VkComputePipelineCreateInfo-commonparent", VALIDATION_ERROR_03000009}, + {"VUID-VkComputePipelineCreateInfo-flags-00697", VALIDATION_ERROR_03000572}, + {"VUID-VkComputePipelineCreateInfo-flags-00698", VALIDATION_ERROR_03000574}, + {"VUID-VkComputePipelineCreateInfo-flags-00699", VALIDATION_ERROR_03000576}, + {"VUID-VkComputePipelineCreateInfo-flags-00700", VALIDATION_ERROR_03000578}, + {"VUID-VkComputePipelineCreateInfo-stage-00701", VALIDATION_ERROR_0300057a}, + {"VUID-VkComputePipelineCreateInfo-stage-00702", VALIDATION_ERROR_0300057c}, + {"VUID-VkComputePipelineCreateInfo-layout-00703", VALIDATION_ERROR_0300057e}, + {"VUID-VkComputePipelineCreateInfo-layout-01687", VALIDATION_ERROR_03000d2e}, + {"VUID-VkComputePipelineCreateInfo-flags-parameter", VALIDATION_ERROR_03009001}, + {"VUID-VkComputePipelineCreateInfo-layout-parameter", VALIDATION_ERROR_0300be01}, + {"VUID-VkComputePipelineCreateInfo-pNext-pNext", VALIDATION_ERROR_0301c40d}, + {"VUID-VkComputePipelineCreateInfo-sType-sType", VALIDATION_ERROR_0302b00b}, + {"VUID-VkComputePipelineCreateInfo-stage-parameter", VALIDATION_ERROR_0302d801}, + {"VUID-VkCopyDescriptorSet-commonparent", VALIDATION_ERROR_03200009}, + {"VUID-VkCopyDescriptorSet-srcBinding-00345", VALIDATION_ERROR_032002b2}, + {"VUID-VkCopyDescriptorSet-srcArrayElement-00346", VALIDATION_ERROR_032002b4}, + {"VUID-VkCopyDescriptorSet-dstBinding-00347", VALIDATION_ERROR_032002b6}, + {"VUID-VkCopyDescriptorSet-dstArrayElement-00348", VALIDATION_ERROR_032002b8}, + {"VUID-VkCopyDescriptorSet-srcSet-00349", VALIDATION_ERROR_032002ba}, + {"VUID-VkCopyDescriptorSet-srcSet-01918", VALIDATION_ERROR_03200efc}, + {"VUID-VkCopyDescriptorSet-srcSet-01919", VALIDATION_ERROR_03200efe}, + {"VUID-VkCopyDescriptorSet-srcSet-01920", VALIDATION_ERROR_03200f00}, + {"VUID-VkCopyDescriptorSet-srcSet-01921", VALIDATION_ERROR_03200f02}, + {"VUID-VkCopyDescriptorSet-dstSet-parameter", VALIDATION_ERROR_03207601}, + {"VUID-VkCopyDescriptorSet-pNext-pNext", VALIDATION_ERROR_0321c40d}, + {"VUID-VkCopyDescriptorSet-sType-sType", VALIDATION_ERROR_0322b00b}, + {"VUID-VkCopyDescriptorSet-srcSet-parameter", VALIDATION_ERROR_0322d201}, + {"VUID-VkD3D12FenceSubmitInfoKHR-waitSemaphoreValuesCount-00079", VALIDATION_ERROR_0340009e}, + {"VUID-VkD3D12FenceSubmitInfoKHR-signalSemaphoreValuesCount-00080", VALIDATION_ERROR_034000a0}, + {"VUID-VkD3D12FenceSubmitInfoKHR-pSignalSemaphoreValues-parameter", VALIDATION_ERROR_03423201}, + {"VUID-VkD3D12FenceSubmitInfoKHR-pWaitSemaphoreValues-parameter", VALIDATION_ERROR_03427401}, + {"VUID-VkD3D12FenceSubmitInfoKHR-sType-sType", VALIDATION_ERROR_0342b00b}, + {"VUID-VkDebugMarkerMarkerInfoEXT-pMarkerName-parameter", VALIDATION_ERROR_0361a801}, + {"VUID-VkDebugMarkerMarkerInfoEXT-pNext-pNext", VALIDATION_ERROR_0361c40d}, + {"VUID-VkDebugMarkerMarkerInfoEXT-sType-sType", VALIDATION_ERROR_0362b00b}, + {"VUID-VkDebugMarkerObjectNameInfoEXT-objectType-01490", VALIDATION_ERROR_03800ba4}, + {"VUID-VkDebugMarkerObjectNameInfoEXT-object-01491", VALIDATION_ERROR_03800ba6}, + {"VUID-VkDebugMarkerObjectNameInfoEXT-object-01492", VALIDATION_ERROR_03800ba8}, + {"VUID-VkDebugMarkerObjectNameInfoEXT-objectType-parameter", VALIDATION_ERROR_0380da01}, + {"VUID-VkDebugMarkerObjectNameInfoEXT-pNext-pNext", VALIDATION_ERROR_0381c40d}, + {"VUID-VkDebugMarkerObjectNameInfoEXT-pObjectName-parameter", VALIDATION_ERROR_0381ce01}, + {"VUID-VkDebugMarkerObjectNameInfoEXT-sType-sType", VALIDATION_ERROR_0382b00b}, + {"VUID-VkDebugMarkerObjectTagInfoEXT-objectType-01493", VALIDATION_ERROR_03a00baa}, + {"VUID-VkDebugMarkerObjectTagInfoEXT-object-01494", VALIDATION_ERROR_03a00bac}, + {"VUID-VkDebugMarkerObjectTagInfoEXT-object-01495", VALIDATION_ERROR_03a00bae}, + {"VUID-VkDebugMarkerObjectTagInfoEXT-objectType-parameter", VALIDATION_ERROR_03a0da01}, + {"VUID-VkDebugMarkerObjectTagInfoEXT-pNext-pNext", VALIDATION_ERROR_03a1c40d}, + {"VUID-VkDebugMarkerObjectTagInfoEXT-pTag-parameter", VALIDATION_ERROR_03a25a01}, + {"VUID-VkDebugMarkerObjectTagInfoEXT-sType-sType", VALIDATION_ERROR_03a2b00b}, + {"VUID-VkDebugMarkerObjectTagInfoEXT-tagSize-arraylength", VALIDATION_ERROR_03a2f41b}, + {"VUID-VkDebugReportCallbackCreateInfoEXT-pfnCallback-01385", VALIDATION_ERROR_03c00ad2}, + {"VUID-VkDebugReportCallbackCreateInfoEXT-flags-parameter", VALIDATION_ERROR_03c09001}, + {"VUID-VkDebugReportCallbackCreateInfoEXT-sType-sType", VALIDATION_ERROR_03c2b00b}, + {"VUID-VkDedicatedAllocationBufferCreateInfoNV-sType-sType", VALIDATION_ERROR_03e2b00b}, + {"VUID-VkDedicatedAllocationImageCreateInfoNV-dedicatedAllocation-00994", VALIDATION_ERROR_040007c4}, + {"VUID-VkDedicatedAllocationImageCreateInfoNV-sType-sType", VALIDATION_ERROR_0402b00b}, + {"VUID-VkDedicatedAllocationMemoryAllocateInfoNV-commonparent", VALIDATION_ERROR_04200009}, + {"VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00649", VALIDATION_ERROR_04200512}, + {"VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00650", VALIDATION_ERROR_04200514}, + {"VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00651", VALIDATION_ERROR_04200516}, + {"VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00652", VALIDATION_ERROR_04200518}, + {"VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00653", VALIDATION_ERROR_0420051a}, + {"VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00654", VALIDATION_ERROR_0420051c}, + {"VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00655", VALIDATION_ERROR_0420051e}, + {"VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-parameter", VALIDATION_ERROR_04201a01}, + {"VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-parameter", VALIDATION_ERROR_0420a001}, + {"VUID-VkDedicatedAllocationMemoryAllocateInfoNV-sType-sType", VALIDATION_ERROR_0422b00b}, + {"VUID-VkDescriptorBufferInfo-offset-00340", VALIDATION_ERROR_044002a8}, + {"VUID-VkDescriptorBufferInfo-range-00341", VALIDATION_ERROR_044002aa}, + {"VUID-VkDescriptorBufferInfo-range-00342", VALIDATION_ERROR_044002ac}, + {"VUID-VkDescriptorBufferInfo-buffer-parameter", VALIDATION_ERROR_04401a01}, + {"VUID-VkDescriptorImageInfo-commonparent", VALIDATION_ERROR_04600009}, + {"VUID-VkDescriptorImageInfo-imageView-00343", VALIDATION_ERROR_046002ae}, + {"VUID-VkDescriptorImageInfo-imageLayout-00344", VALIDATION_ERROR_046002b0}, + {"VUID-VkDescriptorImageInfo-sampler-01563", VALIDATION_ERROR_04600c36}, + {"VUID-VkDescriptorImageInfo-sampler-01564", VALIDATION_ERROR_04600c38}, + {"VUID-VkDescriptorPoolCreateInfo-maxSets-00301", VALIDATION_ERROR_0480025a}, + {"VUID-VkDescriptorPoolCreateInfo-flags-parameter", VALIDATION_ERROR_04809001}, + {"VUID-VkDescriptorPoolCreateInfo-pNext-pNext", VALIDATION_ERROR_0481c40d}, + {"VUID-VkDescriptorPoolCreateInfo-pPoolSizes-parameter", VALIDATION_ERROR_0481e401}, + {"VUID-VkDescriptorPoolCreateInfo-poolSizeCount-arraylength", VALIDATION_ERROR_0482881b}, + {"VUID-VkDescriptorPoolCreateInfo-sType-sType", VALIDATION_ERROR_0482b00b}, + {"VUID-VkDescriptorPoolSize-descriptorCount-00302", VALIDATION_ERROR_04a0025c}, + {"VUID-VkDescriptorPoolSize-type-parameter", VALIDATION_ERROR_04a30401}, + {"VUID-VkDescriptorSetAllocateInfo-commonparent", VALIDATION_ERROR_04c00009}, + {"VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-00306", VALIDATION_ERROR_04c00264}, + {"VUID-VkDescriptorSetAllocateInfo-descriptorPool-00307", VALIDATION_ERROR_04c00266}, + {"VUID-VkDescriptorSetAllocateInfo-pSetLayouts-00308", VALIDATION_ERROR_04c00268}, + {"VUID-VkDescriptorSetAllocateInfo-pSetLayouts-03044", VALIDATION_ERROR_04c017c8}, + {"VUID-VkDescriptorSetAllocateInfo-descriptorPool-parameter", VALIDATION_ERROR_04c04601}, + {"VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-arraylength", VALIDATION_ERROR_04c04a1b}, + {"VUID-VkDescriptorSetAllocateInfo-pNext-pNext", VALIDATION_ERROR_04c1c40d}, + {"VUID-VkDescriptorSetAllocateInfo-pSetLayouts-parameter", VALIDATION_ERROR_04c22c01}, + {"VUID-VkDescriptorSetAllocateInfo-sType-sType", VALIDATION_ERROR_04c2b00b}, + {"VUID-VkDescriptorSetLayoutBinding-descriptorType-00282", VALIDATION_ERROR_04e00234}, + {"VUID-VkDescriptorSetLayoutBinding-descriptorCount-00283", VALIDATION_ERROR_04e00236}, + {"VUID-VkDescriptorSetLayoutBinding-descriptorType-01510", VALIDATION_ERROR_04e00bcc}, + {"VUID-VkDescriptorSetLayoutBinding-descriptorType-parameter", VALIDATION_ERROR_04e04e01}, + {"VUID-VkDescriptorSetLayoutCreateInfo-binding-00279", VALIDATION_ERROR_0500022e}, + {"VUID-VkDescriptorSetLayoutCreateInfo-flags-00280", VALIDATION_ERROR_05000230}, + {"VUID-VkDescriptorSetLayoutCreateInfo-flags-00281", VALIDATION_ERROR_05000232}, + {"VUID-VkDescriptorSetLayoutCreateInfo-flags-03000", VALIDATION_ERROR_05001770}, + {"VUID-VkDescriptorSetLayoutCreateInfo-descriptorType-03001", VALIDATION_ERROR_05001772}, + {"VUID-VkDescriptorSetLayoutCreateInfo-flags-parameter", VALIDATION_ERROR_05009001}, + {"VUID-VkDescriptorSetLayoutCreateInfo-pBindings-parameter", VALIDATION_ERROR_0500fc01}, + {"VUID-VkDescriptorSetLayoutCreateInfo-pNext-pNext", VALIDATION_ERROR_0501c40d}, + {"VUID-VkDescriptorSetLayoutCreateInfo-sType-sType", VALIDATION_ERROR_0502b00b}, + {"VUID-VkDescriptorUpdateTemplateCreateInfo-commonparent", VALIDATION_ERROR_05200009}, + {"VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00350", VALIDATION_ERROR_052002bc}, + {"VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00351", VALIDATION_ERROR_052002be}, + {"VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00352", VALIDATION_ERROR_052002c0}, + {"VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00353", VALIDATION_ERROR_052002c2}, + {"VUID-VkDescriptorUpdateTemplateCreateInfo-descriptorSetLayout-parameter", VALIDATION_ERROR_05204c01}, + {"VUID-VkDescriptorUpdateTemplateCreateInfo-descriptorUpdateEntryCount-arraylength", VALIDATION_ERROR_0520501b}, + {"VUID-VkDescriptorUpdateTemplateCreateInfo-flags-zerobitmask", VALIDATION_ERROR_05209005}, + {"VUID-VkDescriptorUpdateTemplateCreateInfo-pDescriptorUpdateEntries-parameter", VALIDATION_ERROR_05213201}, + {"VUID-VkDescriptorUpdateTemplateCreateInfo-pNext-pNext", VALIDATION_ERROR_0521c40d}, + {"VUID-VkDescriptorUpdateTemplateCreateInfo-sType-sType", VALIDATION_ERROR_0522b00b}, + {"VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-parameter", VALIDATION_ERROR_0522f801}, + {"VUID-VkDescriptorUpdateTemplateEntry-dstBinding-00354", VALIDATION_ERROR_054002c4}, + {"VUID-VkDescriptorUpdateTemplateEntry-dstArrayElement-00355", VALIDATION_ERROR_054002c6}, + {"VUID-VkDescriptorUpdateTemplateEntry-descriptorType-parameter", VALIDATION_ERROR_05404e01}, + {"VUID-VkDeviceCreateInfo-queueFamilyIndex-00372", VALIDATION_ERROR_056002e8}, + {"VUID-VkDeviceCreateInfo-pNext-00373", VALIDATION_ERROR_056002ea}, + {"VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-00374", VALIDATION_ERROR_056002ec}, + {"VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-01840", VALIDATION_ERROR_05600e60}, + {"VUID-VkDeviceCreateInfo-flags-zerobitmask", VALIDATION_ERROR_05609005}, + {"VUID-VkDeviceCreateInfo-pEnabledFeatures-parameter", VALIDATION_ERROR_05615a01}, + {"VUID-VkDeviceCreateInfo-pNext-pNext", VALIDATION_ERROR_0561c40d}, + {"VUID-VkDeviceCreateInfo-pQueueCreateInfos-parameter", VALIDATION_ERROR_0561fe01}, + {"VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-parameter", VALIDATION_ERROR_05628e01}, + {"VUID-VkDeviceCreateInfo-ppEnabledLayerNames-parameter", VALIDATION_ERROR_05629001}, + {"VUID-VkDeviceCreateInfo-queueCreateInfoCount-arraylength", VALIDATION_ERROR_0562a01b}, + {"VUID-VkDeviceCreateInfo-sType-sType", VALIDATION_ERROR_0562b00b}, + {"VUID-VkDeviceCreateInfo-sType-unique", VALIDATION_ERROR_0562b00f}, + {"VUID-VkDeviceEventInfoEXT-deviceEvent-parameter", VALIDATION_ERROR_05805801}, + {"VUID-VkDeviceEventInfoEXT-pNext-pNext", VALIDATION_ERROR_0581c40d}, + {"VUID-VkDeviceEventInfoEXT-sType-sType", VALIDATION_ERROR_0582b00b}, + {"VUID-VkDeviceGeneratedCommandsFeaturesNVX-pNext-pNext", VALIDATION_ERROR_05a1c40d}, + {"VUID-VkDeviceGeneratedCommandsFeaturesNVX-sType-sType", VALIDATION_ERROR_05a2b00b}, + {"VUID-VkDeviceGeneratedCommandsLimitsNVX-pNext-pNext", VALIDATION_ERROR_05c1c40d}, + {"VUID-VkDeviceGeneratedCommandsLimitsNVX-sType-sType", VALIDATION_ERROR_05c2b00b}, + {"VUID-VkDeviceGroupBindSparseInfo-resourceDeviceIndex-01118", VALIDATION_ERROR_05e008bc}, + {"VUID-VkDeviceGroupBindSparseInfo-memoryDeviceIndex-01119", VALIDATION_ERROR_05e008be}, + {"VUID-VkDeviceGroupBindSparseInfo-sType-sType", VALIDATION_ERROR_05e2b00b}, + {"VUID-VkDeviceGroupCommandBufferBeginInfo-deviceMask-00106", VALIDATION_ERROR_060000d4}, + {"VUID-VkDeviceGroupCommandBufferBeginInfo-deviceMask-00107", VALIDATION_ERROR_060000d6}, + {"VUID-VkDeviceGroupCommandBufferBeginInfo-sType-sType", VALIDATION_ERROR_0602b00b}, + {"VUID-VkDeviceGroupDeviceCreateInfo-pPhysicalDevices-00375", VALIDATION_ERROR_062002ee}, + {"VUID-VkDeviceGroupDeviceCreateInfo-pPhysicalDevices-00376", VALIDATION_ERROR_062002f0}, + {"VUID-VkDeviceGroupDeviceCreateInfo-physicalDeviceCount-00377", VALIDATION_ERROR_062002f2}, + {"VUID-VkDeviceGroupDeviceCreateInfo-pPhysicalDevices-parameter", VALIDATION_ERROR_0621dc01}, + {"VUID-VkDeviceGroupDeviceCreateInfo-sType-sType", VALIDATION_ERROR_0622b00b}, + {"VUID-VkDeviceGroupPresentInfoKHR-swapchainCount-01297", VALIDATION_ERROR_06400a22}, + {"VUID-VkDeviceGroupPresentInfoKHR-mode-01298", VALIDATION_ERROR_06400a24}, + {"VUID-VkDeviceGroupPresentInfoKHR-mode-01299", VALIDATION_ERROR_06400a26}, + {"VUID-VkDeviceGroupPresentInfoKHR-mode-01300", VALIDATION_ERROR_06400a28}, + {"VUID-VkDeviceGroupPresentInfoKHR-mode-01301", VALIDATION_ERROR_06400a2a}, + {"VUID-VkDeviceGroupPresentInfoKHR-pDeviceMasks-01302", VALIDATION_ERROR_06400a2c}, + {"VUID-VkDeviceGroupPresentInfoKHR-mode-01303", VALIDATION_ERROR_06400a2e}, + {"VUID-VkDeviceGroupPresentInfoKHR-mode-parameter", VALIDATION_ERROR_0640ce01}, + {"VUID-VkDeviceGroupPresentInfoKHR-pDeviceMasks-parameter", VALIDATION_ERROR_06414001}, + {"VUID-VkDeviceGroupPresentInfoKHR-sType-sType", VALIDATION_ERROR_0642b00b}, + {"VUID-VkDeviceGroupRenderPassBeginInfo-deviceMask-00905", VALIDATION_ERROR_06600712}, + {"VUID-VkDeviceGroupRenderPassBeginInfo-deviceMask-00906", VALIDATION_ERROR_06600714}, + {"VUID-VkDeviceGroupRenderPassBeginInfo-deviceMask-00907", VALIDATION_ERROR_06600716}, + {"VUID-VkDeviceGroupRenderPassBeginInfo-deviceRenderAreaCount-00908", VALIDATION_ERROR_06600718}, + {"VUID-VkDeviceGroupRenderPassBeginInfo-pDeviceRenderAreas-parameter", VALIDATION_ERROR_06614201}, + {"VUID-VkDeviceGroupRenderPassBeginInfo-sType-sType", VALIDATION_ERROR_0662b00b}, + {"VUID-VkDeviceGroupSubmitInfo-waitSemaphoreCount-00082", VALIDATION_ERROR_068000a4}, + {"VUID-VkDeviceGroupSubmitInfo-commandBufferCount-00083", VALIDATION_ERROR_068000a6}, + {"VUID-VkDeviceGroupSubmitInfo-signalSemaphoreCount-00084", VALIDATION_ERROR_068000a8}, + {"VUID-VkDeviceGroupSubmitInfo-pWaitSemaphoreDeviceIndices-00085", VALIDATION_ERROR_068000aa}, + {"VUID-VkDeviceGroupSubmitInfo-pCommandBufferDeviceMasks-00086", VALIDATION_ERROR_068000ac}, + {"VUID-VkDeviceGroupSubmitInfo-pCommandBufferDeviceMasks-parameter", VALIDATION_ERROR_06811201}, + {"VUID-VkDeviceGroupSubmitInfo-pSignalSemaphoreDeviceIndices-parameter", VALIDATION_ERROR_06823001}, + {"VUID-VkDeviceGroupSubmitInfo-pWaitSemaphoreDeviceIndices-parameter", VALIDATION_ERROR_06827201}, + {"VUID-VkDeviceGroupSubmitInfo-sType-sType", VALIDATION_ERROR_0682b00b}, + {"VUID-VkDeviceGroupSwapchainCreateInfoKHR-modes-parameter", VALIDATION_ERROR_06a0d001}, + {"VUID-VkDeviceGroupSwapchainCreateInfoKHR-modes-requiredbitmask", VALIDATION_ERROR_06a0d003}, + {"VUID-VkDeviceGroupSwapchainCreateInfoKHR-sType-sType", VALIDATION_ERROR_06a2b00b}, + {"VUID-VkDeviceQueueCreateInfo-queueFamilyIndex-00381", VALIDATION_ERROR_06c002fa}, + {"VUID-VkDeviceQueueCreateInfo-queueCount-00382", VALIDATION_ERROR_06c002fc}, + {"VUID-VkDeviceQueueCreateInfo-pQueuePriorities-00383", VALIDATION_ERROR_06c002fe}, + {"VUID-VkDeviceQueueCreateInfo-flags-parameter", VALIDATION_ERROR_06c09001}, + {"VUID-VkDeviceQueueCreateInfo-pNext-pNext", VALIDATION_ERROR_06c1c40d}, + {"VUID-VkDeviceQueueCreateInfo-pQueuePriorities-parameter", VALIDATION_ERROR_06c20401}, + {"VUID-VkDeviceQueueCreateInfo-queueCount-arraylength", VALIDATION_ERROR_06c29e1b}, + {"VUID-VkDeviceQueueCreateInfo-sType-sType", VALIDATION_ERROR_06c2b00b}, + {"VUID-VkDispatchIndirectCommand-x-00417", VALIDATION_ERROR_06e00342}, + {"VUID-VkDispatchIndirectCommand-y-00418", VALIDATION_ERROR_06e00344}, + {"VUID-VkDispatchIndirectCommand-z-00419", VALIDATION_ERROR_06e00346}, + {"VUID-VkDisplayEventInfoEXT-displayEvent-parameter", VALIDATION_ERROR_07006201}, + {"VUID-VkDisplayEventInfoEXT-pNext-pNext", VALIDATION_ERROR_0701c40d}, + {"VUID-VkDisplayEventInfoEXT-sType-sType", VALIDATION_ERROR_0702b00b}, + {"VUID-VkDisplayModeCreateInfoKHR-width-01250", VALIDATION_ERROR_072009c4}, + {"VUID-VkDisplayModeCreateInfoKHR-refreshRate-01251", VALIDATION_ERROR_072009c6}, + {"VUID-VkDisplayModeCreateInfoKHR-flags-zerobitmask", VALIDATION_ERROR_07209005}, + {"VUID-VkDisplayModeCreateInfoKHR-pNext-pNext", VALIDATION_ERROR_0721c40d}, + {"VUID-VkDisplayModeCreateInfoKHR-sType-sType", VALIDATION_ERROR_0722b00b}, + {"VUID-VkDisplayPowerInfoEXT-pNext-pNext", VALIDATION_ERROR_0741c40d}, + {"VUID-VkDisplayPowerInfoEXT-powerState-parameter", VALIDATION_ERROR_07428a01}, + {"VUID-VkDisplayPowerInfoEXT-sType-sType", VALIDATION_ERROR_0742b00b}, + {"VUID-VkDisplayPresentInfoKHR-srcRect-01257", VALIDATION_ERROR_076009d2}, + {"VUID-VkDisplayPresentInfoKHR-dstRect-01258", VALIDATION_ERROR_076009d4}, + {"VUID-VkDisplayPresentInfoKHR-persistentContent-01259", VALIDATION_ERROR_076009d6}, + {"VUID-VkDisplayPresentInfoKHR-sType-sType", VALIDATION_ERROR_0762b00b}, + {"VUID-VkDisplaySurfaceCreateInfoKHR-planeIndex-01252", VALIDATION_ERROR_078009c8}, + {"VUID-VkDisplaySurfaceCreateInfoKHR-planeReorderPossible-01253", VALIDATION_ERROR_078009ca}, + {"VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-01254", VALIDATION_ERROR_078009cc}, + {"VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-01255", VALIDATION_ERROR_078009ce}, + {"VUID-VkDisplaySurfaceCreateInfoKHR-width-01256", VALIDATION_ERROR_078009d0}, + {"VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-parameter", VALIDATION_ERROR_07800a01}, + {"VUID-VkDisplaySurfaceCreateInfoKHR-displayMode-parameter", VALIDATION_ERROR_07806401}, + {"VUID-VkDisplaySurfaceCreateInfoKHR-flags-zerobitmask", VALIDATION_ERROR_07809005}, + {"VUID-VkDisplaySurfaceCreateInfoKHR-pNext-pNext", VALIDATION_ERROR_0781c40d}, + {"VUID-VkDisplaySurfaceCreateInfoKHR-sType-sType", VALIDATION_ERROR_0782b00b}, + {"VUID-VkDisplaySurfaceCreateInfoKHR-transform-parameter", VALIDATION_ERROR_07830201}, + {"VUID-VkDrawIndexedIndirectCommand-None-00552", VALIDATION_ERROR_07a00450}, + {"VUID-VkDrawIndexedIndirectCommand-indexSize-00553", VALIDATION_ERROR_07a00452}, + {"VUID-VkDrawIndexedIndirectCommand-firstInstance-00554", VALIDATION_ERROR_07a00454}, + {"VUID-VkDrawIndirectCommand-None-00500", VALIDATION_ERROR_07c003e8}, + {"VUID-VkDrawIndirectCommand-firstInstance-00501", VALIDATION_ERROR_07c003ea}, + {"VUID-VkEventCreateInfo-flags-zerobitmask", VALIDATION_ERROR_07e09005}, + {"VUID-VkEventCreateInfo-pNext-pNext", VALIDATION_ERROR_07e1c40d}, + {"VUID-VkEventCreateInfo-sType-sType", VALIDATION_ERROR_07e2b00b}, + {"VUID-VkExportMemoryAllocateInfo-handleTypes-00656", VALIDATION_ERROR_08000520}, + {"VUID-VkExportMemoryAllocateInfo-handleTypes-parameter", VALIDATION_ERROR_08009e01}, + {"VUID-VkExportMemoryAllocateInfo-sType-sType", VALIDATION_ERROR_0802b00b}, + {"VUID-VkExportMemoryAllocateInfoNV-handleTypes-parameter", VALIDATION_ERROR_08209e01}, + {"VUID-VkExportMemoryAllocateInfoNV-sType-sType", VALIDATION_ERROR_0822b00b}, + {"VUID-VkExportMemoryWin32HandleInfoKHR-handleTypes-00657", VALIDATION_ERROR_08400522}, + {"VUID-VkExportMemoryWin32HandleInfoKHR-pAttributes-parameter", VALIDATION_ERROR_0840f401}, + {"VUID-VkExportMemoryWin32HandleInfoKHR-sType-sType", VALIDATION_ERROR_0842b00b}, + {"VUID-VkExportMemoryWin32HandleInfoNV-pAttributes-parameter", VALIDATION_ERROR_0860f401}, + {"VUID-VkExportMemoryWin32HandleInfoNV-sType-sType", VALIDATION_ERROR_0862b00b}, + {"VUID-VkExportSemaphoreCreateInfo-handleTypes-01124", VALIDATION_ERROR_088008c8}, + {"VUID-VkExportSemaphoreCreateInfo-handleTypes-parameter", VALIDATION_ERROR_08809e01}, + {"VUID-VkExportSemaphoreCreateInfo-sType-sType", VALIDATION_ERROR_0882b00b}, + {"VUID-VkExportSemaphoreWin32HandleInfoKHR-handleTypes-01125", VALIDATION_ERROR_08a008ca}, + {"VUID-VkExportSemaphoreWin32HandleInfoKHR-pAttributes-parameter", VALIDATION_ERROR_08a0f401}, + {"VUID-VkExportSemaphoreWin32HandleInfoKHR-sType-sType", VALIDATION_ERROR_08a2b00b}, + {"VUID-VkExternalMemoryBufferCreateInfo-handleTypes-parameter", VALIDATION_ERROR_08c09e01}, + {"VUID-VkExternalMemoryBufferCreateInfo-sType-sType", VALIDATION_ERROR_08c2b00b}, + {"VUID-VkExternalMemoryImageCreateInfo-handleTypes-parameter", VALIDATION_ERROR_08e09e01}, + {"VUID-VkExternalMemoryImageCreateInfo-handleTypes-requiredbitmask", VALIDATION_ERROR_08e09e03}, + {"VUID-VkExternalMemoryImageCreateInfo-sType-sType", VALIDATION_ERROR_08e2b00b}, + {"VUID-VkExternalMemoryImageCreateInfoNV-handleTypes-parameter", VALIDATION_ERROR_09009e01}, + {"VUID-VkExternalMemoryImageCreateInfoNV-sType-sType", VALIDATION_ERROR_0902b00b}, + {"VUID-VkFenceCreateInfo-flags-parameter", VALIDATION_ERROR_09209001}, + {"VUID-VkFenceCreateInfo-pNext-pNext", VALIDATION_ERROR_0921c40d}, + {"VUID-VkFenceCreateInfo-sType-sType", VALIDATION_ERROR_0922b00b}, + {"VUID-VkFenceCreateInfo-sType-unique", VALIDATION_ERROR_0922b00f}, + {"VUID-VkFramebufferCreateInfo-commonparent", VALIDATION_ERROR_09400009}, + {"VUID-VkFramebufferCreateInfo-attachmentCount-00876", VALIDATION_ERROR_094006d8}, + {"VUID-VkFramebufferCreateInfo-pAttachments-00877", VALIDATION_ERROR_094006da}, + {"VUID-VkFramebufferCreateInfo-pAttachments-00878", VALIDATION_ERROR_094006dc}, + {"VUID-VkFramebufferCreateInfo-pAttachments-00879", VALIDATION_ERROR_094006de}, + {"VUID-VkFramebufferCreateInfo-pAttachments-00880", VALIDATION_ERROR_094006e0}, + {"VUID-VkFramebufferCreateInfo-pAttachments-00881", VALIDATION_ERROR_094006e2}, + {"VUID-VkFramebufferCreateInfo-pAttachments-00882", VALIDATION_ERROR_094006e4}, + {"VUID-VkFramebufferCreateInfo-pAttachments-00883", VALIDATION_ERROR_094006e6}, + {"VUID-VkFramebufferCreateInfo-pAttachments-00884", VALIDATION_ERROR_094006e8}, + {"VUID-VkFramebufferCreateInfo-width-00885", VALIDATION_ERROR_094006ea}, + {"VUID-VkFramebufferCreateInfo-width-00886", VALIDATION_ERROR_094006ec}, + {"VUID-VkFramebufferCreateInfo-height-00887", VALIDATION_ERROR_094006ee}, + {"VUID-VkFramebufferCreateInfo-height-00888", VALIDATION_ERROR_094006f0}, + {"VUID-VkFramebufferCreateInfo-layers-00889", VALIDATION_ERROR_094006f2}, + {"VUID-VkFramebufferCreateInfo-layers-00890", VALIDATION_ERROR_094006f4}, + {"VUID-VkFramebufferCreateInfo-pAttachments-00891", VALIDATION_ERROR_094006f6}, + {"VUID-VkFramebufferCreateInfo-flags-zerobitmask", VALIDATION_ERROR_09409005}, + {"VUID-VkFramebufferCreateInfo-pAttachments-parameter", VALIDATION_ERROR_0940f201}, + {"VUID-VkFramebufferCreateInfo-pNext-pNext", VALIDATION_ERROR_0941c40d}, + {"VUID-VkFramebufferCreateInfo-renderPass-parameter", VALIDATION_ERROR_0942ae01}, + {"VUID-VkFramebufferCreateInfo-sType-sType", VALIDATION_ERROR_0942b00b}, + {"VUID-VkGraphicsPipelineCreateInfo-commonparent", VALIDATION_ERROR_09600009}, + {"VUID-VkGraphicsPipelineCreateInfo-flags-00722", VALIDATION_ERROR_096005a4}, + {"VUID-VkGraphicsPipelineCreateInfo-flags-00723", VALIDATION_ERROR_096005a6}, + {"VUID-VkGraphicsPipelineCreateInfo-flags-00724", VALIDATION_ERROR_096005a8}, + {"VUID-VkGraphicsPipelineCreateInfo-flags-00725", VALIDATION_ERROR_096005aa}, + {"VUID-VkGraphicsPipelineCreateInfo-stage-00726", VALIDATION_ERROR_096005ac}, + {"VUID-VkGraphicsPipelineCreateInfo-stage-00727", VALIDATION_ERROR_096005ae}, + {"VUID-VkGraphicsPipelineCreateInfo-stage-00728", VALIDATION_ERROR_096005b0}, + {"VUID-VkGraphicsPipelineCreateInfo-pStages-00729", VALIDATION_ERROR_096005b2}, + {"VUID-VkGraphicsPipelineCreateInfo-pStages-00730", VALIDATION_ERROR_096005b4}, + {"VUID-VkGraphicsPipelineCreateInfo-pStages-00731", VALIDATION_ERROR_096005b6}, + {"VUID-VkGraphicsPipelineCreateInfo-pStages-00732", VALIDATION_ERROR_096005b8}, + {"VUID-VkGraphicsPipelineCreateInfo-pStages-00733", VALIDATION_ERROR_096005ba}, + {"VUID-VkGraphicsPipelineCreateInfo-pStages-00734", VALIDATION_ERROR_096005bc}, + {"VUID-VkGraphicsPipelineCreateInfo-pStages-00735", VALIDATION_ERROR_096005be}, + {"VUID-VkGraphicsPipelineCreateInfo-pStages-00736", VALIDATION_ERROR_096005c0}, + {"VUID-VkGraphicsPipelineCreateInfo-topology-00737", VALIDATION_ERROR_096005c2}, + {"VUID-VkGraphicsPipelineCreateInfo-pStages-00738", VALIDATION_ERROR_096005c4}, + {"VUID-VkGraphicsPipelineCreateInfo-pStages-00739", VALIDATION_ERROR_096005c6}, + {"VUID-VkGraphicsPipelineCreateInfo-pStages-00740", VALIDATION_ERROR_096005c8}, + {"VUID-VkGraphicsPipelineCreateInfo-pStages-00741", VALIDATION_ERROR_096005ca}, + {"VUID-VkGraphicsPipelineCreateInfo-pStages-00742", VALIDATION_ERROR_096005cc}, + {"VUID-VkGraphicsPipelineCreateInfo-subpass-00743", VALIDATION_ERROR_096005ce}, + {"VUID-VkGraphicsPipelineCreateInfo-subpass-00744", VALIDATION_ERROR_096005d0}, + {"VUID-VkGraphicsPipelineCreateInfo-subpass-00745", VALIDATION_ERROR_096005d2}, + {"VUID-VkGraphicsPipelineCreateInfo-attachmentCount-00746", VALIDATION_ERROR_096005d4}, + {"VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00747", VALIDATION_ERROR_096005d6}, + {"VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00748", VALIDATION_ERROR_096005d8}, + {"VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00749", VALIDATION_ERROR_096005da}, + {"VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00750", VALIDATION_ERROR_096005dc}, + {"VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00751", VALIDATION_ERROR_096005de}, + {"VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00752", VALIDATION_ERROR_096005e0}, + {"VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00753", VALIDATION_ERROR_096005e2}, + {"VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00754", VALIDATION_ERROR_096005e4}, + {"VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00755", VALIDATION_ERROR_096005e6}, + {"VUID-VkGraphicsPipelineCreateInfo-layout-00756", VALIDATION_ERROR_096005e8}, + {"VUID-VkGraphicsPipelineCreateInfo-subpass-00757", VALIDATION_ERROR_096005ea}, + {"VUID-VkGraphicsPipelineCreateInfo-subpass-00758", VALIDATION_ERROR_096005ec}, + {"VUID-VkGraphicsPipelineCreateInfo-subpass-00759", VALIDATION_ERROR_096005ee}, + {"VUID-VkGraphicsPipelineCreateInfo-renderPass-00760", VALIDATION_ERROR_096005f0}, + {"VUID-VkGraphicsPipelineCreateInfo-renderPass-00761", VALIDATION_ERROR_096005f2}, + {"VUID-VkGraphicsPipelineCreateInfo-renderPass-00762", VALIDATION_ERROR_096005f4}, + {"VUID-VkGraphicsPipelineCreateInfo-renderPass-00763", VALIDATION_ERROR_096005f6}, + {"VUID-VkGraphicsPipelineCreateInfo-flags-00764", VALIDATION_ERROR_096005f8}, + {"VUID-VkGraphicsPipelineCreateInfo-subpass-01411", VALIDATION_ERROR_09600b06}, + {"VUID-VkGraphicsPipelineCreateInfo-subpass-01412", VALIDATION_ERROR_09600b08}, + {"VUID-VkGraphicsPipelineCreateInfo-subpass-01505", VALIDATION_ERROR_09600bc2}, + {"VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01521", VALIDATION_ERROR_09600be2}, + {"VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01522", VALIDATION_ERROR_09600be4}, + {"VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01523", VALIDATION_ERROR_09600be6}, + {"VUID-VkGraphicsPipelineCreateInfo-sampleLocationsEnable-01524", VALIDATION_ERROR_09600be8}, + {"VUID-VkGraphicsPipelineCreateInfo-pStages-01565", VALIDATION_ERROR_09600c3a}, + {"VUID-VkGraphicsPipelineCreateInfo-layout-01688", VALIDATION_ERROR_09600d30}, + {"VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01715", VALIDATION_ERROR_09600d66}, + {"VUID-VkGraphicsPipelineCreateInfo-subpass-01756", VALIDATION_ERROR_09600db8}, + {"VUID-VkGraphicsPipelineCreateInfo-subpass-01757", VALIDATION_ERROR_09600dba}, + {"VUID-VkGraphicsPipelineCreateInfo-flags-parameter", VALIDATION_ERROR_09609001}, + {"VUID-VkGraphicsPipelineCreateInfo-layout-parameter", VALIDATION_ERROR_0960be01}, + {"VUID-VkGraphicsPipelineCreateInfo-pDynamicState-parameter", VALIDATION_ERROR_09615601}, + {"VUID-VkGraphicsPipelineCreateInfo-pInputAssemblyState-parameter", VALIDATION_ERROR_09619801}, + {"VUID-VkGraphicsPipelineCreateInfo-pNext-pNext", VALIDATION_ERROR_0961c40d}, + {"VUID-VkGraphicsPipelineCreateInfo-pRasterizationState-parameter", VALIDATION_ERROR_09620801}, + {"VUID-VkGraphicsPipelineCreateInfo-pStages-parameter", VALIDATION_ERROR_09623e01}, + {"VUID-VkGraphicsPipelineCreateInfo-pVertexInputState-parameter", VALIDATION_ERROR_09626801}, + {"VUID-VkGraphicsPipelineCreateInfo-renderPass-parameter", VALIDATION_ERROR_0962ae01}, + {"VUID-VkGraphicsPipelineCreateInfo-sType-sType", VALIDATION_ERROR_0962b00b}, + {"VUID-VkGraphicsPipelineCreateInfo-stageCount-arraylength", VALIDATION_ERROR_0962da1b}, + {"VUID-VkIOSSurfaceCreateInfoMVK-pView-01316", VALIDATION_ERROR_09800a48}, + {"VUID-VkIOSSurfaceCreateInfoMVK-flags-zerobitmask", VALIDATION_ERROR_09809005}, + {"VUID-VkIOSSurfaceCreateInfoMVK-pNext-pNext", VALIDATION_ERROR_0981c40d}, + {"VUID-VkIOSSurfaceCreateInfoMVK-sType-sType", VALIDATION_ERROR_0982b00b}, + {"VUID-VkImageBlit-aspectMask-00238", VALIDATION_ERROR_09a001dc}, + {"VUID-VkImageBlit-layerCount-00239", VALIDATION_ERROR_09a001de}, + {"VUID-VkImageBlit-srcImage-00240", VALIDATION_ERROR_09a001e0}, + {"VUID-VkImageBlit-aspectMask-00241", VALIDATION_ERROR_09a001e2}, + {"VUID-VkImageBlit-aspectMask-00242", VALIDATION_ERROR_09a001e4}, + {"VUID-VkImageBlit-srcOffset-00243", VALIDATION_ERROR_09a001e6}, + {"VUID-VkImageBlit-srcOffset-00244", VALIDATION_ERROR_09a001e8}, + {"VUID-VkImageBlit-srcImage-00245", VALIDATION_ERROR_09a001ea}, + {"VUID-VkImageBlit-srcOffset-00246", VALIDATION_ERROR_09a001ec}, + {"VUID-VkImageBlit-srcImage-00247", VALIDATION_ERROR_09a001ee}, + {"VUID-VkImageBlit-dstOffset-00248", VALIDATION_ERROR_09a001f0}, + {"VUID-VkImageBlit-dstOffset-00249", VALIDATION_ERROR_09a001f2}, + {"VUID-VkImageBlit-dstImage-00250", VALIDATION_ERROR_09a001f4}, + {"VUID-VkImageBlit-dstOffset-00251", VALIDATION_ERROR_09a001f6}, + {"VUID-VkImageBlit-dstImage-00252", VALIDATION_ERROR_09a001f8}, + {"VUID-VkImageBlit-dstSubresource-parameter", VALIDATION_ERROR_09a07a01}, + {"VUID-VkImageBlit-srcSubresource-parameter", VALIDATION_ERROR_09a2d601}, + {"VUID-VkImageCopy-aspectMask-00137", VALIDATION_ERROR_09c00112}, + {"VUID-VkImageCopy-layerCount-00138", VALIDATION_ERROR_09c00114}, + {"VUID-VkImageCopy-srcImage-00139", VALIDATION_ERROR_09c00116}, + {"VUID-VkImageCopy-extent-00140", VALIDATION_ERROR_09c00118}, + {"VUID-VkImageCopy-srcImage-00141", VALIDATION_ERROR_09c0011a}, + {"VUID-VkImageCopy-aspectMask-00142", VALIDATION_ERROR_09c0011c}, + {"VUID-VkImageCopy-aspectMask-00143", VALIDATION_ERROR_09c0011e}, + {"VUID-VkImageCopy-srcOffset-00144", VALIDATION_ERROR_09c00120}, + {"VUID-VkImageCopy-srcOffset-00145", VALIDATION_ERROR_09c00122}, + {"VUID-VkImageCopy-srcImage-00146", VALIDATION_ERROR_09c00124}, + {"VUID-VkImageCopy-srcOffset-00147", VALIDATION_ERROR_09c00126}, + {"VUID-VkImageCopy-dstOffset-00150", VALIDATION_ERROR_09c0012c}, + {"VUID-VkImageCopy-dstOffset-00151", VALIDATION_ERROR_09c0012e}, + {"VUID-VkImageCopy-dstImage-00152", VALIDATION_ERROR_09c00130}, + {"VUID-VkImageCopy-dstOffset-00153", VALIDATION_ERROR_09c00132}, + {"VUID-VkImageCopy-srcOffset-00157", VALIDATION_ERROR_09c0013a}, + {"VUID-VkImageCopy-extent-00158", VALIDATION_ERROR_09c0013c}, + {"VUID-VkImageCopy-extent-00159", VALIDATION_ERROR_09c0013e}, + {"VUID-VkImageCopy-extent-00160", VALIDATION_ERROR_09c00140}, + {"VUID-VkImageCopy-dstOffset-00162", VALIDATION_ERROR_09c00144}, + {"VUID-VkImageCopy-extent-00163", VALIDATION_ERROR_09c00146}, + {"VUID-VkImageCopy-extent-00164", VALIDATION_ERROR_09c00148}, + {"VUID-VkImageCopy-extent-00165", VALIDATION_ERROR_09c0014a}, + {"VUID-VkImageCopy-srcImage-01551", VALIDATION_ERROR_09c00c1e}, + {"VUID-VkImageCopy-srcImage-01552", VALIDATION_ERROR_09c00c20}, + {"VUID-VkImageCopy-srcImage-01553", VALIDATION_ERROR_09c00c22}, + {"VUID-VkImageCopy-dstImage-01554", VALIDATION_ERROR_09c00c24}, + {"VUID-VkImageCopy-dstImage-01555", VALIDATION_ERROR_09c00c26}, + {"VUID-VkImageCopy-srcImage-01556", VALIDATION_ERROR_09c00c28}, + {"VUID-VkImageCopy-dstImage-01557", VALIDATION_ERROR_09c00c2a}, + {"VUID-VkImageCopy-srcImage-01727", VALIDATION_ERROR_09c00d7e}, + {"VUID-VkImageCopy-srcImage-01728", VALIDATION_ERROR_09c00d80}, + {"VUID-VkImageCopy-srcImage-01729", VALIDATION_ERROR_09c00d82}, + {"VUID-VkImageCopy-srcImage-01730", VALIDATION_ERROR_09c00d84}, + {"VUID-VkImageCopy-dstImage-01731", VALIDATION_ERROR_09c00d86}, + {"VUID-VkImageCopy-dstImage-01732", VALIDATION_ERROR_09c00d88}, + {"VUID-VkImageCopy-dstImage-01733", VALIDATION_ERROR_09c00d8a}, + {"VUID-VkImageCopy-dstImage-01734", VALIDATION_ERROR_09c00d8c}, + {"VUID-VkImageCopy-srcImage-01785", VALIDATION_ERROR_09c00df2}, + {"VUID-VkImageCopy-dstImage-01786", VALIDATION_ERROR_09c00df4}, + {"VUID-VkImageCopy-srcImage-01787", VALIDATION_ERROR_09c00df6}, + {"VUID-VkImageCopy-dstImage-01788", VALIDATION_ERROR_09c00df8}, + {"VUID-VkImageCopy-srcImage-01789", VALIDATION_ERROR_09c00dfa}, + {"VUID-VkImageCopy-srcImage-01790", VALIDATION_ERROR_09c00dfc}, + {"VUID-VkImageCopy-srcImage-01791", VALIDATION_ERROR_09c00dfe}, + {"VUID-VkImageCopy-dstImage-01792", VALIDATION_ERROR_09c00e00}, + {"VUID-VkImageCopy-dstSubresource-parameter", VALIDATION_ERROR_09c07a01}, + {"VUID-VkImageCopy-srcSubresource-parameter", VALIDATION_ERROR_09c2d601}, + {"VUID-VkImageCreateInfo-format-00940", VALIDATION_ERROR_09e00758}, + {"VUID-VkImageCreateInfo-sharingMode-00941", VALIDATION_ERROR_09e0075a}, + {"VUID-VkImageCreateInfo-sharingMode-00942", VALIDATION_ERROR_09e0075c}, + {"VUID-VkImageCreateInfo-format-00943", VALIDATION_ERROR_09e0075e}, + {"VUID-VkImageCreateInfo-extent-00944", VALIDATION_ERROR_09e00760}, + {"VUID-VkImageCreateInfo-extent-00945", VALIDATION_ERROR_09e00762}, + {"VUID-VkImageCreateInfo-extent-00946", VALIDATION_ERROR_09e00764}, + {"VUID-VkImageCreateInfo-mipLevels-00947", VALIDATION_ERROR_09e00766}, + {"VUID-VkImageCreateInfo-arrayLayers-00948", VALIDATION_ERROR_09e00768}, + {"VUID-VkImageCreateInfo-flags-00949", VALIDATION_ERROR_09e0076a}, + {"VUID-VkImageCreateInfo-flags-00950", VALIDATION_ERROR_09e0076c}, + {"VUID-VkImageCreateInfo-imageType-00951", VALIDATION_ERROR_09e0076e}, + {"VUID-VkImageCreateInfo-imageType-00952", VALIDATION_ERROR_09e00770}, + {"VUID-VkImageCreateInfo-imageType-00953", VALIDATION_ERROR_09e00772}, + {"VUID-VkImageCreateInfo-imageType-00954", VALIDATION_ERROR_09e00774}, + {"VUID-VkImageCreateInfo-imageType-00955", VALIDATION_ERROR_09e00776}, + {"VUID-VkImageCreateInfo-imageType-00956", VALIDATION_ERROR_09e00778}, + {"VUID-VkImageCreateInfo-imageType-00957", VALIDATION_ERROR_09e0077a}, + {"VUID-VkImageCreateInfo-mipLevels-00958", VALIDATION_ERROR_09e0077c}, + {"VUID-VkImageCreateInfo-extent-00959", VALIDATION_ERROR_09e0077e}, + {"VUID-VkImageCreateInfo-arrayLayers-00960", VALIDATION_ERROR_09e00780}, + {"VUID-VkImageCreateInfo-imageType-00961", VALIDATION_ERROR_09e00782}, + {"VUID-VkImageCreateInfo-samples-00962", VALIDATION_ERROR_09e00784}, + {"VUID-VkImageCreateInfo-usage-00963", VALIDATION_ERROR_09e00786}, + {"VUID-VkImageCreateInfo-usage-00964", VALIDATION_ERROR_09e00788}, + {"VUID-VkImageCreateInfo-usage-00965", VALIDATION_ERROR_09e0078a}, + {"VUID-VkImageCreateInfo-usage-00966", VALIDATION_ERROR_09e0078c}, + {"VUID-VkImageCreateInfo-samples-00967", VALIDATION_ERROR_09e0078e}, + {"VUID-VkImageCreateInfo-usage-00968", VALIDATION_ERROR_09e00790}, + {"VUID-VkImageCreateInfo-flags-00969", VALIDATION_ERROR_09e00792}, + {"VUID-VkImageCreateInfo-imageType-00970", VALIDATION_ERROR_09e00794}, + {"VUID-VkImageCreateInfo-imageType-00971", VALIDATION_ERROR_09e00796}, + {"VUID-VkImageCreateInfo-imageType-00972", VALIDATION_ERROR_09e00798}, + {"VUID-VkImageCreateInfo-imageType-00973", VALIDATION_ERROR_09e0079a}, + {"VUID-VkImageCreateInfo-imageType-00974", VALIDATION_ERROR_09e0079c}, + {"VUID-VkImageCreateInfo-imageType-00975", VALIDATION_ERROR_09e0079e}, + {"VUID-VkImageCreateInfo-imageType-00976", VALIDATION_ERROR_09e007a0}, + {"VUID-VkImageCreateInfo-flags-00987", VALIDATION_ERROR_09e007b6}, + {"VUID-VkImageCreateInfo-pNext-00988", VALIDATION_ERROR_09e007b8}, + {"VUID-VkImageCreateInfo-pNext-00990", VALIDATION_ERROR_09e007bc}, + {"VUID-VkImageCreateInfo-pNext-00991", VALIDATION_ERROR_09e007be}, + {"VUID-VkImageCreateInfo-flags-00992", VALIDATION_ERROR_09e007c0}, + {"VUID-VkImageCreateInfo-initialLayout-00993", VALIDATION_ERROR_09e007c2}, + {"VUID-VkImageCreateInfo-sharingMode-01392", VALIDATION_ERROR_09e00ae0}, + {"VUID-VkImageCreateInfo-sharingMode-01420", VALIDATION_ERROR_09e00b18}, + {"VUID-VkImageCreateInfo-physicalDeviceCount-01421", VALIDATION_ERROR_09e00b1a}, + {"VUID-VkImageCreateInfo-pNext-01443", VALIDATION_ERROR_09e00b46}, + {"VUID-VkImageCreateInfo-flags-01533", VALIDATION_ERROR_09e00bfa}, + {"VUID-VkImageCreateInfo-flags-01572", VALIDATION_ERROR_09e00c48}, + {"VUID-VkImageCreateInfo-flags-01573", VALIDATION_ERROR_09e00c4a}, + {"VUID-VkImageCreateInfo-format-01574", VALIDATION_ERROR_09e00c4c}, + {"VUID-VkImageCreateInfo-tiling-01575", VALIDATION_ERROR_09e00c4e}, + {"VUID-VkImageCreateInfo-tiling-01576", VALIDATION_ERROR_09e00c50}, + {"VUID-VkImageCreateInfo-format-01577", VALIDATION_ERROR_09e00c52}, + {"VUID-VkImageCreateInfo-pNext-01889", VALIDATION_ERROR_09e00ec2}, + {"VUID-VkImageCreateInfo-flags-01890", VALIDATION_ERROR_09e00ec4}, + {"VUID-VkImageCreateInfo-None-01891", VALIDATION_ERROR_09e00ec6}, + {"VUID-VkImageCreateInfo-pNext-01892", VALIDATION_ERROR_09e00ec8}, + {"VUID-VkImageCreateInfo-pNext-01893", VALIDATION_ERROR_09e00eca}, + {"VUID-VkImageCreateInfo-flags-01924", VALIDATION_ERROR_09e00f08}, + {"VUID-VkImageCreateInfo-None-01925", VALIDATION_ERROR_09e00f0a}, + {"VUID-VkImageCreateInfo-flags-parameter", VALIDATION_ERROR_09e09001}, + {"VUID-VkImageCreateInfo-format-parameter", VALIDATION_ERROR_09e09201}, + {"VUID-VkImageCreateInfo-imageType-parameter", VALIDATION_ERROR_09e0ac01}, + {"VUID-VkImageCreateInfo-initialLayout-parameter", VALIDATION_ERROR_09e0b801}, + {"VUID-VkImageCreateInfo-pNext-pNext", VALIDATION_ERROR_09e1c40d}, + {"VUID-VkImageCreateInfo-sType-sType", VALIDATION_ERROR_09e2b00b}, + {"VUID-VkImageCreateInfo-sType-unique", VALIDATION_ERROR_09e2b00f}, + {"VUID-VkImageCreateInfo-samples-parameter", VALIDATION_ERROR_09e2b401}, + {"VUID-VkImageCreateInfo-sharingMode-parameter", VALIDATION_ERROR_09e2c001}, + {"VUID-VkImageCreateInfo-tiling-parameter", VALIDATION_ERROR_09e2fa01}, + {"VUID-VkImageCreateInfo-usage-parameter", VALIDATION_ERROR_09e30601}, + {"VUID-VkImageCreateInfo-usage-requiredbitmask", VALIDATION_ERROR_09e30603}, + {"VUID-VkImageMemoryBarrier-oldLayout-01197", VALIDATION_ERROR_0a00095a}, + {"VUID-VkImageMemoryBarrier-newLayout-01198", VALIDATION_ERROR_0a00095c}, + {"VUID-VkImageMemoryBarrier-image-01199", VALIDATION_ERROR_0a00095e}, + {"VUID-VkImageMemoryBarrier-image-01200", VALIDATION_ERROR_0a000960}, + {"VUID-VkImageMemoryBarrier-image-01201", VALIDATION_ERROR_0a000962}, + {"VUID-VkImageMemoryBarrier-image-01205", VALIDATION_ERROR_0a00096a}, + {"VUID-VkImageMemoryBarrier-image-01207", VALIDATION_ERROR_0a00096e}, + {"VUID-VkImageMemoryBarrier-oldLayout-01208", VALIDATION_ERROR_0a000970}, + {"VUID-VkImageMemoryBarrier-oldLayout-01209", VALIDATION_ERROR_0a000972}, + {"VUID-VkImageMemoryBarrier-oldLayout-01210", VALIDATION_ERROR_0a000974}, + {"VUID-VkImageMemoryBarrier-oldLayout-01211", VALIDATION_ERROR_0a000976}, + {"VUID-VkImageMemoryBarrier-oldLayout-01212", VALIDATION_ERROR_0a000978}, + {"VUID-VkImageMemoryBarrier-oldLayout-01213", VALIDATION_ERROR_0a00097a}, + {"VUID-VkImageMemoryBarrier-image-01381", VALIDATION_ERROR_0a000aca}, + {"VUID-VkImageMemoryBarrier-subresourceRange-01486", VALIDATION_ERROR_0a000b9c}, + {"VUID-VkImageMemoryBarrier-subresourceRange-01488", VALIDATION_ERROR_0a000ba0}, + {"VUID-VkImageMemoryBarrier-oldLayout-01658", VALIDATION_ERROR_0a000cf4}, + {"VUID-VkImageMemoryBarrier-oldLayout-01659", VALIDATION_ERROR_0a000cf6}, + {"VUID-VkImageMemoryBarrier-image-01671", VALIDATION_ERROR_0a000d0e}, + {"VUID-VkImageMemoryBarrier-image-01672", VALIDATION_ERROR_0a000d10}, + {"VUID-VkImageMemoryBarrier-image-01673", VALIDATION_ERROR_0a000d12}, + {"VUID-VkImageMemoryBarrier-subresourceRange-01724", VALIDATION_ERROR_0a000d78}, + {"VUID-VkImageMemoryBarrier-subresourceRange-01725", VALIDATION_ERROR_0a000d7a}, + {"VUID-VkImageMemoryBarrier-image-01766", VALIDATION_ERROR_0a000dcc}, + {"VUID-VkImageMemoryBarrier-image-01767", VALIDATION_ERROR_0a000dce}, + {"VUID-VkImageMemoryBarrier-image-01768", VALIDATION_ERROR_0a000dd0}, + {"VUID-VkImageMemoryBarrier-image-01932", VALIDATION_ERROR_0a000f18}, + {"VUID-VkImageMemoryBarrier-dstAccessMask-parameter", VALIDATION_ERROR_0a006801}, + {"VUID-VkImageMemoryBarrier-image-parameter", VALIDATION_ERROR_0a00a001}, + {"VUID-VkImageMemoryBarrier-newLayout-parameter", VALIDATION_ERROR_0a00d401}, + {"VUID-VkImageMemoryBarrier-oldLayout-parameter", VALIDATION_ERROR_0a00dc01}, + {"VUID-VkImageMemoryBarrier-pNext-pNext", VALIDATION_ERROR_0a01c40d}, + {"VUID-VkImageMemoryBarrier-sType-sType", VALIDATION_ERROR_0a02b00b}, + {"VUID-VkImageMemoryBarrier-srcAccessMask-parameter", VALIDATION_ERROR_0a02c401}, + {"VUID-VkImageMemoryBarrier-subresourceRange-parameter", VALIDATION_ERROR_0a02ea01}, + {"VUID-VkImageResolve-aspectMask-00266", VALIDATION_ERROR_0a200214}, + {"VUID-VkImageResolve-layerCount-00267", VALIDATION_ERROR_0a200216}, + {"VUID-VkImageResolve-srcImage-00268", VALIDATION_ERROR_0a200218}, + {"VUID-VkImageResolve-srcOffset-00269", VALIDATION_ERROR_0a20021a}, + {"VUID-VkImageResolve-srcOffset-00270", VALIDATION_ERROR_0a20021c}, + {"VUID-VkImageResolve-srcImage-00271", VALIDATION_ERROR_0a20021e}, + {"VUID-VkImageResolve-srcOffset-00272", VALIDATION_ERROR_0a200220}, + {"VUID-VkImageResolve-srcImage-00273", VALIDATION_ERROR_0a200222}, + {"VUID-VkImageResolve-dstOffset-00274", VALIDATION_ERROR_0a200224}, + {"VUID-VkImageResolve-dstOffset-00275", VALIDATION_ERROR_0a200226}, + {"VUID-VkImageResolve-dstImage-00276", VALIDATION_ERROR_0a200228}, + {"VUID-VkImageResolve-dstOffset-00277", VALIDATION_ERROR_0a20022a}, + {"VUID-VkImageResolve-dstImage-00278", VALIDATION_ERROR_0a20022c}, + {"VUID-VkImageResolve-dstSubresource-parameter", VALIDATION_ERROR_0a207a01}, + {"VUID-VkImageResolve-srcSubresource-parameter", VALIDATION_ERROR_0a22d601}, + {"VUID-VkImageSubresource-aspectMask-parameter", VALIDATION_ERROR_0a400c01}, + {"VUID-VkImageSubresource-aspectMask-requiredbitmask", VALIDATION_ERROR_0a400c03}, + {"VUID-VkImageSubresourceLayers-aspectMask-00167", VALIDATION_ERROR_0a60014e}, + {"VUID-VkImageSubresourceLayers-aspectMask-00168", VALIDATION_ERROR_0a600150}, + {"VUID-VkImageSubresourceLayers-aspectMask-parameter", VALIDATION_ERROR_0a600c01}, + {"VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask", VALIDATION_ERROR_0a600c03}, + {"VUID-VkImageSubresourceLayers-layerCount-01700", VALIDATION_ERROR_0a600d48}, + {"VUID-VkImageSubresourceRange-aspectMask-parameter", VALIDATION_ERROR_0a800c01}, + {"VUID-VkImageSubresourceRange-aspectMask-requiredbitmask", VALIDATION_ERROR_0a800c03}, + {"VUID-VkImageSubresourceRange-aspectMask-01670", VALIDATION_ERROR_0a800d0c}, + {"VUID-VkImageSubresourceRange-levelCount-01720", VALIDATION_ERROR_0a800d70}, + {"VUID-VkImageSubresourceRange-layerCount-01721", VALIDATION_ERROR_0a800d72}, + {"VUID-VkImageSwapchainCreateInfoKHR-swapchain-00995", VALIDATION_ERROR_0aa007c6}, + {"VUID-VkImageSwapchainCreateInfoKHR-sType-sType", VALIDATION_ERROR_0aa2b00b}, + {"VUID-VkImageSwapchainCreateInfoKHR-swapchain-parameter", VALIDATION_ERROR_0aa2f001}, + {"VUID-VkImageViewCreateInfo-image-01003", VALIDATION_ERROR_0ac007d6}, + {"VUID-VkImageViewCreateInfo-viewType-01004", VALIDATION_ERROR_0ac007d8}, + {"VUID-VkImageViewCreateInfo-image-01005", VALIDATION_ERROR_0ac007da}, + {"VUID-VkImageViewCreateInfo-image-01006", VALIDATION_ERROR_0ac007dc}, + {"VUID-VkImageViewCreateInfo-image-01007", VALIDATION_ERROR_0ac007de}, + {"VUID-VkImageViewCreateInfo-image-01008", VALIDATION_ERROR_0ac007e0}, + {"VUID-VkImageViewCreateInfo-image-01009", VALIDATION_ERROR_0ac007e2}, + {"VUID-VkImageViewCreateInfo-image-01010", VALIDATION_ERROR_0ac007e4}, + {"VUID-VkImageViewCreateInfo-image-01011", VALIDATION_ERROR_0ac007e6}, + {"VUID-VkImageViewCreateInfo-image-01012", VALIDATION_ERROR_0ac007e8}, + {"VUID-VkImageViewCreateInfo-image-01013", VALIDATION_ERROR_0ac007ea}, + {"VUID-VkImageViewCreateInfo-image-01014", VALIDATION_ERROR_0ac007ec}, + {"VUID-VkImageViewCreateInfo-image-01015", VALIDATION_ERROR_0ac007ee}, + {"VUID-VkImageViewCreateInfo-image-01016", VALIDATION_ERROR_0ac007f0}, + {"VUID-VkImageViewCreateInfo-image-01018", VALIDATION_ERROR_0ac007f4}, + {"VUID-VkImageViewCreateInfo-image-01019", VALIDATION_ERROR_0ac007f6}, + {"VUID-VkImageViewCreateInfo-image-01020", VALIDATION_ERROR_0ac007f8}, + {"VUID-VkImageViewCreateInfo-subResourceRange-01021", VALIDATION_ERROR_0ac007fa}, + {"VUID-VkImageViewCreateInfo-subresourceRange-01478", VALIDATION_ERROR_0ac00b8c}, + {"VUID-VkImageViewCreateInfo-subresourceRange-01480", VALIDATION_ERROR_0ac00b90}, + {"VUID-VkImageViewCreateInfo-image-01482", VALIDATION_ERROR_0ac00b94}, + {"VUID-VkImageViewCreateInfo-subresourceRange-01483", VALIDATION_ERROR_0ac00b96}, + {"VUID-VkImageViewCreateInfo-image-01484", VALIDATION_ERROR_0ac00b98}, + {"VUID-VkImageViewCreateInfo-subresourceRange-01485", VALIDATION_ERROR_0ac00b9a}, + {"VUID-VkImageViewCreateInfo-image-01583", VALIDATION_ERROR_0ac00c5e}, + {"VUID-VkImageViewCreateInfo-image-01584", VALIDATION_ERROR_0ac00c60}, + {"VUID-VkImageViewCreateInfo-pNext-01585", VALIDATION_ERROR_0ac00c62}, + {"VUID-VkImageViewCreateInfo-image-01586", VALIDATION_ERROR_0ac00c64}, + {"VUID-VkImageViewCreateInfo-subresourceRange-01718", VALIDATION_ERROR_0ac00d6c}, + {"VUID-VkImageViewCreateInfo-subresourceRange-01719", VALIDATION_ERROR_0ac00d6e}, + {"VUID-VkImageViewCreateInfo-image-01759", VALIDATION_ERROR_0ac00dbe}, + {"VUID-VkImageViewCreateInfo-image-01760", VALIDATION_ERROR_0ac00dc0}, + {"VUID-VkImageViewCreateInfo-image-01761", VALIDATION_ERROR_0ac00dc2}, + {"VUID-VkImageViewCreateInfo-image-01762", VALIDATION_ERROR_0ac00dc4}, + {"VUID-VkImageViewCreateInfo-image-01896", VALIDATION_ERROR_0ac00ed0}, + {"VUID-VkImageViewCreateInfo-components-parameter", VALIDATION_ERROR_0ac02c01}, + {"VUID-VkImageViewCreateInfo-flags-zerobitmask", VALIDATION_ERROR_0ac09005}, + {"VUID-VkImageViewCreateInfo-format-parameter", VALIDATION_ERROR_0ac09201}, + {"VUID-VkImageViewCreateInfo-image-parameter", VALIDATION_ERROR_0ac0a001}, + {"VUID-VkImageViewCreateInfo-pNext-pNext", VALIDATION_ERROR_0ac1c40d}, + {"VUID-VkImageViewCreateInfo-sType-sType", VALIDATION_ERROR_0ac2b00b}, + {"VUID-VkImageViewCreateInfo-sType-unique", VALIDATION_ERROR_0ac2b00f}, + {"VUID-VkImageViewCreateInfo-subresourceRange-parameter", VALIDATION_ERROR_0ac2ea01}, + {"VUID-VkImageViewCreateInfo-viewType-parameter", VALIDATION_ERROR_0ac30801}, + {"VUID-VkImportMemoryFdInfoKHR-handleType-00667", VALIDATION_ERROR_0ae00536}, + {"VUID-VkImportMemoryFdInfoKHR-fd-00668", VALIDATION_ERROR_0ae00538}, + {"VUID-VkImportMemoryFdInfoKHR-handleType-00669", VALIDATION_ERROR_0ae0053a}, + {"VUID-VkImportMemoryFdInfoKHR-handleType-00670", VALIDATION_ERROR_0ae0053c}, + {"VUID-VkImportMemoryFdInfoKHR-fd-01520", VALIDATION_ERROR_0ae00be0}, + {"VUID-VkImportMemoryFdInfoKHR-fd-01746", VALIDATION_ERROR_0ae00da4}, + {"VUID-VkImportMemoryFdInfoKHR-handleType-parameter", VALIDATION_ERROR_0ae09c01}, + {"VUID-VkImportMemoryFdInfoKHR-sType-sType", VALIDATION_ERROR_0ae2b00b}, + {"VUID-VkImportMemoryWin32HandleInfoKHR-handleType-00658", VALIDATION_ERROR_0b000524}, + {"VUID-VkImportMemoryWin32HandleInfoKHR-handle-00659", VALIDATION_ERROR_0b000526}, + {"VUID-VkImportMemoryWin32HandleInfoKHR-handleType-00660", VALIDATION_ERROR_0b000528}, + {"VUID-VkImportMemoryWin32HandleInfoKHR-handleType-00661", VALIDATION_ERROR_0b00052a}, + {"VUID-VkImportMemoryWin32HandleInfoKHR-handleType-01439", VALIDATION_ERROR_0b000b3e}, + {"VUID-VkImportMemoryWin32HandleInfoKHR-handleType-01440", VALIDATION_ERROR_0b000b40}, + {"VUID-VkImportMemoryWin32HandleInfoKHR-handle-01441", VALIDATION_ERROR_0b000b42}, + {"VUID-VkImportMemoryWin32HandleInfoKHR-handle-01518", VALIDATION_ERROR_0b000bdc}, + {"VUID-VkImportMemoryWin32HandleInfoKHR-name-01519", VALIDATION_ERROR_0b000bde}, + {"VUID-VkImportMemoryWin32HandleInfoKHR-handleType-parameter", VALIDATION_ERROR_0b009c01}, + {"VUID-VkImportMemoryWin32HandleInfoKHR-sType-sType", VALIDATION_ERROR_0b02b00b}, + {"VUID-VkImportMemoryWin32HandleInfoNV-handleType-01327", VALIDATION_ERROR_0b200a5e}, + {"VUID-VkImportMemoryWin32HandleInfoNV-handle-01328", VALIDATION_ERROR_0b200a60}, + {"VUID-VkImportMemoryWin32HandleInfoNV-handleType-parameter", VALIDATION_ERROR_0b209c01}, + {"VUID-VkImportMemoryWin32HandleInfoNV-sType-sType", VALIDATION_ERROR_0b22b00b}, + {"VUID-VkImportSemaphoreFdInfoKHR-handleType-01143", VALIDATION_ERROR_0b4008ee}, + {"VUID-VkImportSemaphoreFdInfoKHR-fd-01544", VALIDATION_ERROR_0b400c10}, + {"VUID-VkImportSemaphoreFdInfoKHR-flags-parameter", VALIDATION_ERROR_0b409001}, + {"VUID-VkImportSemaphoreFdInfoKHR-handleType-parameter", VALIDATION_ERROR_0b409c01}, + {"VUID-VkImportSemaphoreFdInfoKHR-pNext-pNext", VALIDATION_ERROR_0b41c40d}, + {"VUID-VkImportSemaphoreFdInfoKHR-sType-sType", VALIDATION_ERROR_0b42b00b}, + {"VUID-VkImportSemaphoreFdInfoKHR-semaphore-parameter", VALIDATION_ERROR_0b42b801}, + {"VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-01140", VALIDATION_ERROR_0b6008e8}, + {"VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-01466", VALIDATION_ERROR_0b600b74}, + {"VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-01467", VALIDATION_ERROR_0b600b76}, + {"VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-01468", VALIDATION_ERROR_0b600b78}, + {"VUID-VkImportSemaphoreWin32HandleInfoKHR-handle-01469", VALIDATION_ERROR_0b600b7a}, + {"VUID-VkImportSemaphoreWin32HandleInfoKHR-handle-01542", VALIDATION_ERROR_0b600c0c}, + {"VUID-VkImportSemaphoreWin32HandleInfoKHR-name-01543", VALIDATION_ERROR_0b600c0e}, + {"VUID-VkImportSemaphoreWin32HandleInfoKHR-flags-parameter", VALIDATION_ERROR_0b609001}, + {"VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-parameter", VALIDATION_ERROR_0b609c01}, + {"VUID-VkImportSemaphoreWin32HandleInfoKHR-pNext-pNext", VALIDATION_ERROR_0b61c40d}, + {"VUID-VkImportSemaphoreWin32HandleInfoKHR-sType-sType", VALIDATION_ERROR_0b62b00b}, + {"VUID-VkImportSemaphoreWin32HandleInfoKHR-semaphore-parameter", VALIDATION_ERROR_0b62b801}, + {"VUID-VkIndirectCommandsLayoutCreateInfoNVX-tokenCount-01347", VALIDATION_ERROR_0b800a86}, + {"VUID-VkIndirectCommandsLayoutCreateInfoNVX-computeBindingPointSupport-01348", VALIDATION_ERROR_0b800a88}, + {"VUID-VkIndirectCommandsLayoutCreateInfoNVX-pTokens-01349", VALIDATION_ERROR_0b800a8a}, + {"VUID-VkIndirectCommandsLayoutCreateInfoNVX-pTokens-01350", VALIDATION_ERROR_0b800a8c}, + {"VUID-VkIndirectCommandsLayoutCreateInfoNVX-pTokens-01351", VALIDATION_ERROR_0b800a8e}, + {"VUID-VkIndirectCommandsLayoutCreateInfoNVX-flags-parameter", VALIDATION_ERROR_0b809001}, + {"VUID-VkIndirectCommandsLayoutCreateInfoNVX-flags-requiredbitmask", VALIDATION_ERROR_0b809003}, + {"VUID-VkIndirectCommandsLayoutCreateInfoNVX-pNext-pNext", VALIDATION_ERROR_0b81c40d}, + {"VUID-VkIndirectCommandsLayoutCreateInfoNVX-pTokens-parameter", VALIDATION_ERROR_0b826001}, + {"VUID-VkIndirectCommandsLayoutCreateInfoNVX-pipelineBindPoint-parameter", VALIDATION_ERROR_0b827e01}, + {"VUID-VkIndirectCommandsLayoutCreateInfoNVX-sType-sType", VALIDATION_ERROR_0b82b00b}, + {"VUID-VkIndirectCommandsLayoutCreateInfoNVX-tokenCount-arraylength", VALIDATION_ERROR_0b82fc1b}, + {"VUID-VkIndirectCommandsLayoutTokenNVX-bindingUnit-01342", VALIDATION_ERROR_0ba00a7c}, + {"VUID-VkIndirectCommandsLayoutTokenNVX-dynamicCount-01343", VALIDATION_ERROR_0ba00a7e}, + {"VUID-VkIndirectCommandsLayoutTokenNVX-divisor-01344", VALIDATION_ERROR_0ba00a80}, + {"VUID-VkIndirectCommandsLayoutTokenNVX-tokenType-parameter", VALIDATION_ERROR_0ba2fe01}, + {"VUID-VkIndirectCommandsTokenNVX-buffer-01345", VALIDATION_ERROR_0bc00a82}, + {"VUID-VkIndirectCommandsTokenNVX-offset-01346", VALIDATION_ERROR_0bc00a84}, + {"VUID-VkIndirectCommandsTokenNVX-buffer-parameter", VALIDATION_ERROR_0bc01a01}, + {"VUID-VkIndirectCommandsTokenNVX-tokenType-parameter", VALIDATION_ERROR_0bc2fe01}, + {"VUID-VkInstanceCreateInfo-flags-zerobitmask", VALIDATION_ERROR_0be09005}, + {"VUID-VkInstanceCreateInfo-pApplicationInfo-parameter", VALIDATION_ERROR_0be0ee01}, + {"VUID-VkInstanceCreateInfo-pNext-pNext", VALIDATION_ERROR_0be1c40d}, + {"VUID-VkInstanceCreateInfo-ppEnabledExtensionNames-parameter", VALIDATION_ERROR_0be28e01}, + {"VUID-VkInstanceCreateInfo-ppEnabledLayerNames-parameter", VALIDATION_ERROR_0be29001}, + {"VUID-VkInstanceCreateInfo-sType-sType", VALIDATION_ERROR_0be2b00b}, + {"VUID-VkInstanceCreateInfo-sType-unique", VALIDATION_ERROR_0be2b00f}, + {"VUID-VkMacOSSurfaceCreateInfoMVK-pView-01317", VALIDATION_ERROR_0c000a4a}, + {"VUID-VkMacOSSurfaceCreateInfoMVK-flags-zerobitmask", VALIDATION_ERROR_0c009005}, + {"VUID-VkMacOSSurfaceCreateInfoMVK-pNext-pNext", VALIDATION_ERROR_0c01c40d}, + {"VUID-VkMacOSSurfaceCreateInfoMVK-sType-sType", VALIDATION_ERROR_0c02b00b}, + {"VUID-VkMappedMemoryRange-memory-00684", VALIDATION_ERROR_0c200558}, + {"VUID-VkMappedMemoryRange-size-00685", VALIDATION_ERROR_0c20055a}, + {"VUID-VkMappedMemoryRange-size-00686", VALIDATION_ERROR_0c20055c}, + {"VUID-VkMappedMemoryRange-offset-00687", VALIDATION_ERROR_0c20055e}, + {"VUID-VkMappedMemoryRange-size-01389", VALIDATION_ERROR_0c200ada}, + {"VUID-VkMappedMemoryRange-size-01390", VALIDATION_ERROR_0c200adc}, + {"VUID-VkMappedMemoryRange-memory-parameter", VALIDATION_ERROR_0c20c601}, + {"VUID-VkMappedMemoryRange-pNext-pNext", VALIDATION_ERROR_0c21c40d}, + {"VUID-VkMappedMemoryRange-sType-sType", VALIDATION_ERROR_0c22b00b}, + {"VUID-VkMemoryAllocateFlagsInfo-deviceMask-00675", VALIDATION_ERROR_0c400546}, + {"VUID-VkMemoryAllocateFlagsInfo-deviceMask-00676", VALIDATION_ERROR_0c400548}, + {"VUID-VkMemoryAllocateFlagsInfo-flags-parameter", VALIDATION_ERROR_0c409001}, + {"VUID-VkMemoryAllocateFlagsInfo-sType-sType", VALIDATION_ERROR_0c42b00b}, + {"VUID-VkMemoryAllocateInfo-allocationSize-00638", VALIDATION_ERROR_0c6004fc}, + {"VUID-VkMemoryAllocateInfo-pNext-00639", VALIDATION_ERROR_0c6004fe}, + {"VUID-VkMemoryAllocateInfo-pNext-00640", VALIDATION_ERROR_0c600500}, + {"VUID-VkMemoryAllocateInfo-pNext-00641", VALIDATION_ERROR_0c600502}, + {"VUID-VkMemoryAllocateInfo-None-00643", VALIDATION_ERROR_0c600506}, + {"VUID-VkMemoryAllocateInfo-None-00644", VALIDATION_ERROR_0c600508}, + {"VUID-VkMemoryAllocateInfo-memoryTypeIndex-00645", VALIDATION_ERROR_0c60050a}, + {"VUID-VkMemoryAllocateInfo-allocationSize-00646", VALIDATION_ERROR_0c60050c}, + {"VUID-VkMemoryAllocateInfo-allocationSize-00647", VALIDATION_ERROR_0c60050e}, + {"VUID-VkMemoryAllocateInfo-memoryTypeIndex-00648", VALIDATION_ERROR_0c600510}, + {"VUID-VkMemoryAllocateInfo-allocationSize-01742", VALIDATION_ERROR_0c600d9c}, + {"VUID-VkMemoryAllocateInfo-allocationSize-01743", VALIDATION_ERROR_0c600d9e}, + {"VUID-VkMemoryAllocateInfo-memoryTypeIndex-01744", VALIDATION_ERROR_0c600da0}, + {"VUID-VkMemoryAllocateInfo-allocationSize-01745", VALIDATION_ERROR_0c600da2}, + {"VUID-VkMemoryAllocateInfo-memoryTypeIndex-01872", VALIDATION_ERROR_0c600ea0}, + {"VUID-VkMemoryAllocateInfo-None-01873", VALIDATION_ERROR_0c600ea2}, + {"VUID-VkMemoryAllocateInfo-pNext-01874", VALIDATION_ERROR_0c600ea4}, + {"VUID-VkMemoryAllocateInfo-pNext-01875", VALIDATION_ERROR_0c600ea6}, + {"VUID-VkMemoryAllocateInfo-pNext-pNext", VALIDATION_ERROR_0c61c40d}, + {"VUID-VkMemoryAllocateInfo-sType-sType", VALIDATION_ERROR_0c62b00b}, + {"VUID-VkMemoryAllocateInfo-sType-unique", VALIDATION_ERROR_0c62b00f}, + {"VUID-VkMemoryBarrier-dstAccessMask-parameter", VALIDATION_ERROR_0c806801}, + {"VUID-VkMemoryBarrier-pNext-pNext", VALIDATION_ERROR_0c81c40d}, + {"VUID-VkMemoryBarrier-sType-sType", VALIDATION_ERROR_0c82b00b}, + {"VUID-VkMemoryBarrier-srcAccessMask-parameter", VALIDATION_ERROR_0c82c401}, + {"VUID-VkMirSurfaceCreateInfoKHR-connection-01263", VALIDATION_ERROR_0ca009de}, + {"VUID-VkMirSurfaceCreateInfoKHR-surface-01264", VALIDATION_ERROR_0ca009e0}, + {"VUID-VkMirSurfaceCreateInfoKHR-flags-zerobitmask", VALIDATION_ERROR_0ca09005}, + {"VUID-VkMirSurfaceCreateInfoKHR-pNext-pNext", VALIDATION_ERROR_0ca1c40d}, + {"VUID-VkMirSurfaceCreateInfoKHR-sType-sType", VALIDATION_ERROR_0ca2b00b}, + {"VUID-VkObjectTableCreateInfoNVX-computeBindingPointSupport-01355", VALIDATION_ERROR_0cc00a96}, + {"VUID-VkObjectTableCreateInfoNVX-pObjectEntryCounts-01356", VALIDATION_ERROR_0cc00a98}, + {"VUID-VkObjectTableCreateInfoNVX-maxUniformBuffersPerDescriptor-01357", VALIDATION_ERROR_0cc00a9a}, + {"VUID-VkObjectTableCreateInfoNVX-maxStorageBuffersPerDescriptor-01358", VALIDATION_ERROR_0cc00a9c}, + {"VUID-VkObjectTableCreateInfoNVX-maxStorageImagesPerDescriptor-01359", VALIDATION_ERROR_0cc00a9e}, + {"VUID-VkObjectTableCreateInfoNVX-maxSampledImagesPerDescriptor-01360", VALIDATION_ERROR_0cc00aa0}, + {"VUID-VkObjectTableCreateInfoNVX-objectCount-arraylength", VALIDATION_ERROR_0cc0d61b}, + {"VUID-VkObjectTableCreateInfoNVX-pNext-pNext", VALIDATION_ERROR_0cc1c40d}, + {"VUID-VkObjectTableCreateInfoNVX-pObjectEntryCounts-parameter", VALIDATION_ERROR_0cc1c601}, + {"VUID-VkObjectTableCreateInfoNVX-pObjectEntryTypes-parameter", VALIDATION_ERROR_0cc1c801}, + {"VUID-VkObjectTableCreateInfoNVX-pObjectEntryUsageFlags-parameter", VALIDATION_ERROR_0cc1ca01}, + {"VUID-VkObjectTableCreateInfoNVX-pObjectEntryUsageFlags-requiredbitmask", VALIDATION_ERROR_0cc1ca03}, + {"VUID-VkObjectTableCreateInfoNVX-sType-sType", VALIDATION_ERROR_0cc2b00b}, + {"VUID-VkObjectTableDescriptorSetEntryNVX-commonparent", VALIDATION_ERROR_0ce00009}, + {"VUID-VkObjectTableDescriptorSetEntryNVX-type-01369", VALIDATION_ERROR_0ce00ab2}, + {"VUID-VkObjectTableDescriptorSetEntryNVX-descriptorSet-parameter", VALIDATION_ERROR_0ce04801}, + {"VUID-VkObjectTableDescriptorSetEntryNVX-flags-parameter", VALIDATION_ERROR_0ce09001}, + {"VUID-VkObjectTableDescriptorSetEntryNVX-flags-requiredbitmask", VALIDATION_ERROR_0ce09003}, + {"VUID-VkObjectTableDescriptorSetEntryNVX-pipelineLayout-parameter", VALIDATION_ERROR_0ce28201}, + {"VUID-VkObjectTableDescriptorSetEntryNVX-type-parameter", VALIDATION_ERROR_0ce30401}, + {"VUID-VkObjectTableEntryNVX-computeBindingPointSupport-01367", VALIDATION_ERROR_0d000aae}, + {"VUID-VkObjectTableEntryNVX-flags-parameter", VALIDATION_ERROR_0d009001}, + {"VUID-VkObjectTableEntryNVX-flags-requiredbitmask", VALIDATION_ERROR_0d009003}, + {"VUID-VkObjectTableEntryNVX-type-parameter", VALIDATION_ERROR_0d030401}, + {"VUID-VkObjectTableIndexBufferEntryNVX-type-01371", VALIDATION_ERROR_0d200ab6}, + {"VUID-VkObjectTableIndexBufferEntryNVX-buffer-parameter", VALIDATION_ERROR_0d201a01}, + {"VUID-VkObjectTableIndexBufferEntryNVX-flags-parameter", VALIDATION_ERROR_0d209001}, + {"VUID-VkObjectTableIndexBufferEntryNVX-flags-requiredbitmask", VALIDATION_ERROR_0d209003}, + {"VUID-VkObjectTableIndexBufferEntryNVX-indexType-parameter", VALIDATION_ERROR_0d20b201}, + {"VUID-VkObjectTableIndexBufferEntryNVX-type-parameter", VALIDATION_ERROR_0d230401}, + {"VUID-VkObjectTablePipelineEntryNVX-type-01368", VALIDATION_ERROR_0d400ab0}, + {"VUID-VkObjectTablePipelineEntryNVX-flags-parameter", VALIDATION_ERROR_0d409001}, + {"VUID-VkObjectTablePipelineEntryNVX-flags-requiredbitmask", VALIDATION_ERROR_0d409003}, + {"VUID-VkObjectTablePipelineEntryNVX-pipeline-parameter", VALIDATION_ERROR_0d427c01}, + {"VUID-VkObjectTablePipelineEntryNVX-type-parameter", VALIDATION_ERROR_0d430401}, + {"VUID-VkObjectTablePushConstantEntryNVX-type-01372", VALIDATION_ERROR_0d600ab8}, + {"VUID-VkObjectTablePushConstantEntryNVX-flags-parameter", VALIDATION_ERROR_0d609001}, + {"VUID-VkObjectTablePushConstantEntryNVX-flags-requiredbitmask", VALIDATION_ERROR_0d609003}, + {"VUID-VkObjectTablePushConstantEntryNVX-pipelineLayout-parameter", VALIDATION_ERROR_0d628201}, + {"VUID-VkObjectTablePushConstantEntryNVX-stageFlags-parameter", VALIDATION_ERROR_0d62dc01}, + {"VUID-VkObjectTablePushConstantEntryNVX-stageFlags-requiredbitmask", VALIDATION_ERROR_0d62dc03}, + {"VUID-VkObjectTablePushConstantEntryNVX-type-parameter", VALIDATION_ERROR_0d630401}, + {"VUID-VkObjectTableVertexBufferEntryNVX-type-01370", VALIDATION_ERROR_0d800ab4}, + {"VUID-VkObjectTableVertexBufferEntryNVX-buffer-parameter", VALIDATION_ERROR_0d801a01}, + {"VUID-VkObjectTableVertexBufferEntryNVX-flags-parameter", VALIDATION_ERROR_0d809001}, + {"VUID-VkObjectTableVertexBufferEntryNVX-flags-requiredbitmask", VALIDATION_ERROR_0d809003}, + {"VUID-VkObjectTableVertexBufferEntryNVX-type-parameter", VALIDATION_ERROR_0d830401}, + {"VUID-VkPhysicalDeviceDiscardRectanglePropertiesEXT-sType-sType", VALIDATION_ERROR_0da2b00b}, + {"VUID-VkPhysicalDeviceExternalBufferInfo-flags-parameter", VALIDATION_ERROR_0dc09001}, + {"VUID-VkPhysicalDeviceExternalBufferInfo-handleType-parameter", VALIDATION_ERROR_0dc09c01}, + {"VUID-VkPhysicalDeviceExternalBufferInfo-pNext-pNext", VALIDATION_ERROR_0dc1c40d}, + {"VUID-VkPhysicalDeviceExternalBufferInfo-sType-sType", VALIDATION_ERROR_0dc2b00b}, + {"VUID-VkPhysicalDeviceExternalBufferInfo-usage-parameter", VALIDATION_ERROR_0dc30601}, + {"VUID-VkPhysicalDeviceExternalBufferInfo-usage-requiredbitmask", VALIDATION_ERROR_0dc30603}, + {"VUID-VkPhysicalDeviceExternalImageFormatInfo-handleType-parameter", VALIDATION_ERROR_0de09c01}, + {"VUID-VkPhysicalDeviceExternalImageFormatInfo-sType-sType", VALIDATION_ERROR_0de2b00b}, + {"VUID-VkPhysicalDeviceExternalSemaphoreInfo-handleType-parameter", VALIDATION_ERROR_0e009c01}, + {"VUID-VkPhysicalDeviceExternalSemaphoreInfo-pNext-pNext", VALIDATION_ERROR_0e01c40d}, + {"VUID-VkPhysicalDeviceExternalSemaphoreInfo-sType-sType", VALIDATION_ERROR_0e02b00b}, + {"VUID-VkPhysicalDeviceFeatures2-sType-sType", VALIDATION_ERROR_0e42b00b}, + {"VUID-VkPhysicalDeviceImageFormatInfo2-flags-parameter", VALIDATION_ERROR_0e609001}, + {"VUID-VkPhysicalDeviceImageFormatInfo2-format-parameter", VALIDATION_ERROR_0e609201}, + {"VUID-VkPhysicalDeviceImageFormatInfo2-pNext-pNext", VALIDATION_ERROR_0e61c40d}, + {"VUID-VkPhysicalDeviceImageFormatInfo2-sType-sType", VALIDATION_ERROR_0e62b00b}, + {"VUID-VkPhysicalDeviceImageFormatInfo2-tiling-parameter", VALIDATION_ERROR_0e62fa01}, + {"VUID-VkPhysicalDeviceImageFormatInfo2-type-parameter", VALIDATION_ERROR_0e630401}, + {"VUID-VkPhysicalDeviceImageFormatInfo2-usage-parameter", VALIDATION_ERROR_0e630601}, + {"VUID-VkPhysicalDeviceImageFormatInfo2-usage-requiredbitmask", VALIDATION_ERROR_0e630603}, + {"VUID-VkPhysicalDeviceMultiviewFeatures-multiviewGeometryShader-00580", VALIDATION_ERROR_0e800488}, + {"VUID-VkPhysicalDeviceMultiviewFeatures-multiviewTessellationShader-00581", VALIDATION_ERROR_0e80048a}, + {"VUID-VkPhysicalDeviceMultiviewFeatures-sType-sType", VALIDATION_ERROR_0e82b00b}, + {"VUID-VkPhysicalDevicePushDescriptorPropertiesKHR-sType-sType", VALIDATION_ERROR_0ea2b00b}, + {"VUID-VkPhysicalDeviceSparseImageFormatInfo2-samples-01095", VALIDATION_ERROR_0ec0088e}, + {"VUID-VkPhysicalDeviceSparseImageFormatInfo2-format-parameter", VALIDATION_ERROR_0ec09201}, + {"VUID-VkPhysicalDeviceSparseImageFormatInfo2-pNext-pNext", VALIDATION_ERROR_0ec1c40d}, + {"VUID-VkPhysicalDeviceSparseImageFormatInfo2-sType-sType", VALIDATION_ERROR_0ec2b00b}, + {"VUID-VkPhysicalDeviceSparseImageFormatInfo2-samples-parameter", VALIDATION_ERROR_0ec2b401}, + {"VUID-VkPhysicalDeviceSparseImageFormatInfo2-tiling-parameter", VALIDATION_ERROR_0ec2fa01}, + {"VUID-VkPhysicalDeviceSparseImageFormatInfo2-type-parameter", VALIDATION_ERROR_0ec30401}, + {"VUID-VkPhysicalDeviceSparseImageFormatInfo2-usage-parameter", VALIDATION_ERROR_0ec30601}, + {"VUID-VkPhysicalDeviceSparseImageFormatInfo2-usage-requiredbitmask", VALIDATION_ERROR_0ec30603}, + {"VUID-VkPhysicalDeviceSurfaceInfo2KHR-pNext-pNext", VALIDATION_ERROR_0ee1c40d}, + {"VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-sType", VALIDATION_ERROR_0ee2b00b}, + {"VUID-VkPhysicalDeviceSurfaceInfo2KHR-surface-parameter", VALIDATION_ERROR_0ee2ec01}, + {"VUID-VkPipelineCacheCreateInfo-initialDataSize-00768", VALIDATION_ERROR_0f000600}, + {"VUID-VkPipelineCacheCreateInfo-initialDataSize-00769", VALIDATION_ERROR_0f000602}, + {"VUID-VkPipelineCacheCreateInfo-flags-zerobitmask", VALIDATION_ERROR_0f009005}, + {"VUID-VkPipelineCacheCreateInfo-pInitialData-parameter", VALIDATION_ERROR_0f019601}, + {"VUID-VkPipelineCacheCreateInfo-pNext-pNext", VALIDATION_ERROR_0f01c40d}, + {"VUID-VkPipelineCacheCreateInfo-sType-sType", VALIDATION_ERROR_0f02b00b}, + {"VUID-VkPipelineColorBlendAttachmentState-srcColorBlendFactor-00608", VALIDATION_ERROR_0f2004c0}, + {"VUID-VkPipelineColorBlendAttachmentState-dstColorBlendFactor-00609", VALIDATION_ERROR_0f2004c2}, + {"VUID-VkPipelineColorBlendAttachmentState-srcAlphaBlendFactor-00610", VALIDATION_ERROR_0f2004c4}, + {"VUID-VkPipelineColorBlendAttachmentState-dstAlphaBlendFactor-00611", VALIDATION_ERROR_0f2004c6}, + {"VUID-VkPipelineColorBlendAttachmentState-alphaBlendOp-parameter", VALIDATION_ERROR_0f200801}, + {"VUID-VkPipelineColorBlendAttachmentState-colorBlendOp-01406", VALIDATION_ERROR_0f200afc}, + {"VUID-VkPipelineColorBlendAttachmentState-advancedBlendIndependentBlend-01407", VALIDATION_ERROR_0f200afe}, + {"VUID-VkPipelineColorBlendAttachmentState-advancedBlendIndependentBlend-01408", VALIDATION_ERROR_0f200b00}, + {"VUID-VkPipelineColorBlendAttachmentState-advancedBlendAllOperations-01409", VALIDATION_ERROR_0f200b02}, + {"VUID-VkPipelineColorBlendAttachmentState-colorBlendOp-01410", VALIDATION_ERROR_0f200b04}, + {"VUID-VkPipelineColorBlendAttachmentState-colorBlendOp-parameter", VALIDATION_ERROR_0f202001}, + {"VUID-VkPipelineColorBlendAttachmentState-colorWriteMask-parameter", VALIDATION_ERROR_0f202201}, + {"VUID-VkPipelineColorBlendAttachmentState-dstAlphaBlendFactor-parameter", VALIDATION_ERROR_0f206a01}, + {"VUID-VkPipelineColorBlendAttachmentState-dstColorBlendFactor-parameter", VALIDATION_ERROR_0f207001}, + {"VUID-VkPipelineColorBlendAttachmentState-srcAlphaBlendFactor-parameter", VALIDATION_ERROR_0f22c601}, + {"VUID-VkPipelineColorBlendAttachmentState-srcColorBlendFactor-parameter", VALIDATION_ERROR_0f22cc01}, + {"VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605", VALIDATION_ERROR_0f4004ba}, + {"VUID-VkPipelineColorBlendStateCreateInfo-logicOpEnable-00606", VALIDATION_ERROR_0f4004bc}, + {"VUID-VkPipelineColorBlendStateCreateInfo-logicOpEnable-00607", VALIDATION_ERROR_0f4004be}, + {"VUID-VkPipelineColorBlendStateCreateInfo-flags-zerobitmask", VALIDATION_ERROR_0f409005}, + {"VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-parameter", VALIDATION_ERROR_0f40f201}, + {"VUID-VkPipelineColorBlendStateCreateInfo-pNext-pNext", VALIDATION_ERROR_0f41c40d}, + {"VUID-VkPipelineColorBlendStateCreateInfo-sType-sType", VALIDATION_ERROR_0f42b00b}, + {"VUID-VkPipelineDepthStencilStateCreateInfo-depthBoundsTestEnable-00598", VALIDATION_ERROR_0f6004ac}, + {"VUID-VkPipelineDepthStencilStateCreateInfo-back-parameter", VALIDATION_ERROR_0f601201}, + {"VUID-VkPipelineDepthStencilStateCreateInfo-depthCompareOp-parameter", VALIDATION_ERROR_0f604001}, + {"VUID-VkPipelineDepthStencilStateCreateInfo-flags-zerobitmask", VALIDATION_ERROR_0f609005}, + {"VUID-VkPipelineDepthStencilStateCreateInfo-front-parameter", VALIDATION_ERROR_0f609601}, + {"VUID-VkPipelineDepthStencilStateCreateInfo-pNext-pNext", VALIDATION_ERROR_0f61c40d}, + {"VUID-VkPipelineDepthStencilStateCreateInfo-sType-sType", VALIDATION_ERROR_0f62b00b}, + {"VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-discardRectangleCount-00582", VALIDATION_ERROR_0f80048c}, + {"VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-discardRectangleMode-parameter", VALIDATION_ERROR_0f805e01}, + {"VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-flags-zerobitmask", VALIDATION_ERROR_0f809005}, + {"VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-sType-sType", VALIDATION_ERROR_0f82b00b}, + {"VUID-VkPipelineDynamicStateCreateInfo-pDynamicStates-01442", VALIDATION_ERROR_0fa00b44}, + {"VUID-VkPipelineDynamicStateCreateInfo-dynamicStateCount-arraylength", VALIDATION_ERROR_0fa07c1b}, + {"VUID-VkPipelineDynamicStateCreateInfo-flags-zerobitmask", VALIDATION_ERROR_0fa09005}, + {"VUID-VkPipelineDynamicStateCreateInfo-pDynamicStates-parameter", VALIDATION_ERROR_0fa15801}, + {"VUID-VkPipelineDynamicStateCreateInfo-pNext-pNext", VALIDATION_ERROR_0fa1c40d}, + {"VUID-VkPipelineDynamicStateCreateInfo-sType-sType", VALIDATION_ERROR_0fa2b00b}, + {"VUID-VkPipelineInputAssemblyStateCreateInfo-topology-00428", VALIDATION_ERROR_0fc00358}, + {"VUID-VkPipelineInputAssemblyStateCreateInfo-topology-00429", VALIDATION_ERROR_0fc0035a}, + {"VUID-VkPipelineInputAssemblyStateCreateInfo-topology-00430", VALIDATION_ERROR_0fc0035c}, + {"VUID-VkPipelineInputAssemblyStateCreateInfo-flags-zerobitmask", VALIDATION_ERROR_0fc09005}, + {"VUID-VkPipelineInputAssemblyStateCreateInfo-pNext-pNext", VALIDATION_ERROR_0fc1c40d}, + {"VUID-VkPipelineInputAssemblyStateCreateInfo-sType-sType", VALIDATION_ERROR_0fc2b00b}, + {"VUID-VkPipelineInputAssemblyStateCreateInfo-topology-parameter", VALIDATION_ERROR_0fc30001}, + {"VUID-VkPipelineLayoutCreateInfo-setLayoutCount-00286", VALIDATION_ERROR_0fe0023c}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00287", VALIDATION_ERROR_0fe0023e}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00288", VALIDATION_ERROR_0fe00240}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00289", VALIDATION_ERROR_0fe00242}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00290", VALIDATION_ERROR_0fe00244}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00291", VALIDATION_ERROR_0fe00246}, + {"VUID-VkPipelineLayoutCreateInfo-pPushConstantRanges-00292", VALIDATION_ERROR_0fe00248}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00293", VALIDATION_ERROR_0fe0024a}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01676", VALIDATION_ERROR_0fe00d18}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01677", VALIDATION_ERROR_0fe00d1a}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01678", VALIDATION_ERROR_0fe00d1c}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01679", VALIDATION_ERROR_0fe00d1e}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01680", VALIDATION_ERROR_0fe00d20}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01681", VALIDATION_ERROR_0fe00d22}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01682", VALIDATION_ERROR_0fe00d24}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01683", VALIDATION_ERROR_0fe00d26}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01684", VALIDATION_ERROR_0fe00d28}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03016", VALIDATION_ERROR_0fe01790}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03017", VALIDATION_ERROR_0fe01792}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03018", VALIDATION_ERROR_0fe01794}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03019", VALIDATION_ERROR_0fe01796}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03020", VALIDATION_ERROR_0fe01798}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03021", VALIDATION_ERROR_0fe0179a}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03022", VALIDATION_ERROR_0fe0179c}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03023", VALIDATION_ERROR_0fe0179e}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03024", VALIDATION_ERROR_0fe017a0}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03025", VALIDATION_ERROR_0fe017a2}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03026", VALIDATION_ERROR_0fe017a4}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03027", VALIDATION_ERROR_0fe017a6}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03028", VALIDATION_ERROR_0fe017a8}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03029", VALIDATION_ERROR_0fe017aa}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03030", VALIDATION_ERROR_0fe017ac}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03031", VALIDATION_ERROR_0fe017ae}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03032", VALIDATION_ERROR_0fe017b0}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03033", VALIDATION_ERROR_0fe017b2}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03034", VALIDATION_ERROR_0fe017b4}, + {"VUID-VkPipelineLayoutCreateInfo-descriptorType-03035", VALIDATION_ERROR_0fe017b6}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03036", VALIDATION_ERROR_0fe017b8}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03037", VALIDATION_ERROR_0fe017ba}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03038", VALIDATION_ERROR_0fe017bc}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03039", VALIDATION_ERROR_0fe017be}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03040", VALIDATION_ERROR_0fe017c0}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03041", VALIDATION_ERROR_0fe017c2}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03042", VALIDATION_ERROR_0fe017c4}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03043", VALIDATION_ERROR_0fe017c6}, + {"VUID-VkPipelineLayoutCreateInfo-flags-zerobitmask", VALIDATION_ERROR_0fe09005}, + {"VUID-VkPipelineLayoutCreateInfo-pNext-pNext", VALIDATION_ERROR_0fe1c40d}, + {"VUID-VkPipelineLayoutCreateInfo-pPushConstantRanges-parameter", VALIDATION_ERROR_0fe1f801}, + {"VUID-VkPipelineLayoutCreateInfo-pSetLayouts-parameter", VALIDATION_ERROR_0fe22c01}, + {"VUID-VkPipelineLayoutCreateInfo-sType-sType", VALIDATION_ERROR_0fe2b00b}, + {"VUID-VkPipelineMultisampleStateCreateInfo-sampleShadingEnable-00784", VALIDATION_ERROR_10000620}, + {"VUID-VkPipelineMultisampleStateCreateInfo-alphaToOneEnable-00785", VALIDATION_ERROR_10000622}, + {"VUID-VkPipelineMultisampleStateCreateInfo-minSampleShading-00786", VALIDATION_ERROR_10000624}, + {"VUID-VkPipelineMultisampleStateCreateInfo-rasterizationSamples-01415", VALIDATION_ERROR_10000b0e}, + {"VUID-VkPipelineMultisampleStateCreateInfo-flags-zerobitmask", VALIDATION_ERROR_10009005}, + {"VUID-VkPipelineMultisampleStateCreateInfo-pNext-pNext", VALIDATION_ERROR_1001c40d}, + {"VUID-VkPipelineMultisampleStateCreateInfo-pSampleMask-parameter", VALIDATION_ERROR_10022201}, + {"VUID-VkPipelineMultisampleStateCreateInfo-rasterizationSamples-parameter", VALIDATION_ERROR_1002a801}, + {"VUID-VkPipelineMultisampleStateCreateInfo-sType-sType", VALIDATION_ERROR_1002b00b}, + {"VUID-VkPipelineMultisampleStateCreateInfo-sType-unique", VALIDATION_ERROR_1002b00f}, + {"VUID-VkPipelineRasterizationStateCreateInfo-depthClampEnable-00782", VALIDATION_ERROR_1020061c}, + {"VUID-VkPipelineRasterizationStateCreateInfo-polygonMode-01413", VALIDATION_ERROR_10200b0a}, + {"VUID-VkPipelineRasterizationStateCreateInfo-polygonMode-01414", VALIDATION_ERROR_10200b0c}, + {"VUID-VkPipelineRasterizationStateCreateInfo-polygonMode-01507", VALIDATION_ERROR_10200bc6}, + {"VUID-VkPipelineRasterizationStateCreateInfo-cullMode-parameter", VALIDATION_ERROR_10203a01}, + {"VUID-VkPipelineRasterizationStateCreateInfo-flags-zerobitmask", VALIDATION_ERROR_10209005}, + {"VUID-VkPipelineRasterizationStateCreateInfo-frontFace-parameter", VALIDATION_ERROR_10209801}, + {"VUID-VkPipelineRasterizationStateCreateInfo-pNext-pNext", VALIDATION_ERROR_1021c40d}, + {"VUID-VkPipelineRasterizationStateCreateInfo-polygonMode-parameter", VALIDATION_ERROR_10228601}, + {"VUID-VkPipelineRasterizationStateCreateInfo-sType-sType", VALIDATION_ERROR_1022b00b}, + {"VUID-VkPipelineRasterizationStateCreateInfo-sType-unique", VALIDATION_ERROR_1022b00f}, + {"VUID-VkPipelineRasterizationStateRasterizationOrderAMD-rasterizationOrder-parameter", VALIDATION_ERROR_1042a601}, + {"VUID-VkPipelineRasterizationStateRasterizationOrderAMD-sType-sType", VALIDATION_ERROR_1042b00b}, + {"VUID-VkPipelineShaderStageCreateInfo-stage-00704", VALIDATION_ERROR_10600580}, + {"VUID-VkPipelineShaderStageCreateInfo-stage-00705", VALIDATION_ERROR_10600582}, + {"VUID-VkPipelineShaderStageCreateInfo-stage-00706", VALIDATION_ERROR_10600584}, + {"VUID-VkPipelineShaderStageCreateInfo-pName-00707", VALIDATION_ERROR_10600586}, + {"VUID-VkPipelineShaderStageCreateInfo-maxClipDistances-00708", VALIDATION_ERROR_10600588}, + {"VUID-VkPipelineShaderStageCreateInfo-maxCullDistances-00709", VALIDATION_ERROR_1060058a}, + {"VUID-VkPipelineShaderStageCreateInfo-maxCombinedClipAndCullDistances-00710", VALIDATION_ERROR_1060058c}, + {"VUID-VkPipelineShaderStageCreateInfo-maxSampleMaskWords-00711", VALIDATION_ERROR_1060058e}, + {"VUID-VkPipelineShaderStageCreateInfo-stage-00712", VALIDATION_ERROR_10600590}, + {"VUID-VkPipelineShaderStageCreateInfo-stage-00713", VALIDATION_ERROR_10600592}, + {"VUID-VkPipelineShaderStageCreateInfo-stage-00714", VALIDATION_ERROR_10600594}, + {"VUID-VkPipelineShaderStageCreateInfo-stage-00715", VALIDATION_ERROR_10600596}, + {"VUID-VkPipelineShaderStageCreateInfo-stage-00716", VALIDATION_ERROR_10600598}, + {"VUID-VkPipelineShaderStageCreateInfo-stage-00717", VALIDATION_ERROR_1060059a}, + {"VUID-VkPipelineShaderStageCreateInfo-stage-00718", VALIDATION_ERROR_1060059c}, + {"VUID-VkPipelineShaderStageCreateInfo-stage-00719", VALIDATION_ERROR_1060059e}, + {"VUID-VkPipelineShaderStageCreateInfo-stage-01511", VALIDATION_ERROR_10600bce}, + {"VUID-VkPipelineShaderStageCreateInfo-flags-zerobitmask", VALIDATION_ERROR_10609005}, + {"VUID-VkPipelineShaderStageCreateInfo-module-parameter", VALIDATION_ERROR_1060d201}, + {"VUID-VkPipelineShaderStageCreateInfo-pName-parameter", VALIDATION_ERROR_1061c001}, + {"VUID-VkPipelineShaderStageCreateInfo-pNext-pNext", VALIDATION_ERROR_1061c40d}, + {"VUID-VkPipelineShaderStageCreateInfo-pSpecializationInfo-parameter", VALIDATION_ERROR_10623a01}, + {"VUID-VkPipelineShaderStageCreateInfo-sType-sType", VALIDATION_ERROR_1062b00b}, + {"VUID-VkPipelineShaderStageCreateInfo-stage-parameter", VALIDATION_ERROR_1062d801}, + {"VUID-VkPipelineTessellationStateCreateInfo-patchControlPoints-01214", VALIDATION_ERROR_1080097c}, + {"VUID-VkPipelineTessellationStateCreateInfo-flags-zerobitmask", VALIDATION_ERROR_10809005}, + {"VUID-VkPipelineTessellationStateCreateInfo-pNext-pNext", VALIDATION_ERROR_1081c40d}, + {"VUID-VkPipelineTessellationStateCreateInfo-sType-sType", VALIDATION_ERROR_1082b00b}, + {"VUID-VkPipelineVertexInputStateCreateInfo-vertexBindingDescriptionCount-00613", VALIDATION_ERROR_10a004ca}, + {"VUID-VkPipelineVertexInputStateCreateInfo-vertexAttributeDescriptionCount-00614", VALIDATION_ERROR_10a004cc}, + {"VUID-VkPipelineVertexInputStateCreateInfo-binding-00615", VALIDATION_ERROR_10a004ce}, + {"VUID-VkPipelineVertexInputStateCreateInfo-pVertexBindingDescriptions-00616", VALIDATION_ERROR_10a004d0}, + {"VUID-VkPipelineVertexInputStateCreateInfo-pVertexAttributeDescriptions-00617", VALIDATION_ERROR_10a004d2}, + {"VUID-VkPipelineVertexInputStateCreateInfo-flags-zerobitmask", VALIDATION_ERROR_10a09005}, + {"VUID-VkPipelineVertexInputStateCreateInfo-pNext-pNext", VALIDATION_ERROR_10a1c40d}, + {"VUID-VkPipelineVertexInputStateCreateInfo-pVertexAttributeDescriptions-parameter", VALIDATION_ERROR_10a26401}, + {"VUID-VkPipelineVertexInputStateCreateInfo-pVertexBindingDescriptions-parameter", VALIDATION_ERROR_10a26601}, + {"VUID-VkPipelineVertexInputStateCreateInfo-sType-sType", VALIDATION_ERROR_10a2b00b}, + {"VUID-VkPipelineViewportStateCreateInfo-viewportCount-01216", VALIDATION_ERROR_10c00980}, + {"VUID-VkPipelineViewportStateCreateInfo-scissorCount-01217", VALIDATION_ERROR_10c00982}, + {"VUID-VkPipelineViewportStateCreateInfo-viewportCount-01218", VALIDATION_ERROR_10c00984}, + {"VUID-VkPipelineViewportStateCreateInfo-scissorCount-01219", VALIDATION_ERROR_10c00986}, + {"VUID-VkPipelineViewportStateCreateInfo-scissorCount-01220", VALIDATION_ERROR_10c00988}, + {"VUID-VkPipelineViewportStateCreateInfo-viewportWScalingEnable-01726", VALIDATION_ERROR_10c00d7c}, + {"VUID-VkPipelineViewportStateCreateInfo-flags-zerobitmask", VALIDATION_ERROR_10c09005}, + {"VUID-VkPipelineViewportStateCreateInfo-pNext-pNext", VALIDATION_ERROR_10c1c40d}, + {"VUID-VkPipelineViewportStateCreateInfo-sType-sType", VALIDATION_ERROR_10c2b00b}, + {"VUID-VkPipelineViewportStateCreateInfo-sType-unique", VALIDATION_ERROR_10c2b00f}, + {"VUID-VkPipelineViewportStateCreateInfo-scissorCount-arraylength", VALIDATION_ERROR_10c2b61b}, + {"VUID-VkPipelineViewportStateCreateInfo-viewportCount-arraylength", VALIDATION_ERROR_10c30a1b}, + {"VUID-VkPipelineViewportSwizzleStateCreateInfoNV-viewportCount-01215", VALIDATION_ERROR_10e0097e}, + {"VUID-VkPipelineViewportSwizzleStateCreateInfoNV-flags-zerobitmask", VALIDATION_ERROR_10e09005}, + {"VUID-VkPipelineViewportSwizzleStateCreateInfoNV-sType-sType", VALIDATION_ERROR_10e2b00b}, + {"VUID-VkPipelineViewportSwizzleStateCreateInfoNV-viewportCount-arraylength", VALIDATION_ERROR_10e30a1b}, + {"VUID-VkPipelineViewportWScalingStateCreateInfoNV-sType-sType", VALIDATION_ERROR_1102b00b}, + {"VUID-VkPipelineViewportWScalingStateCreateInfoNV-viewportCount-arraylength", VALIDATION_ERROR_11030a1b}, + {"VUID-VkPresentInfoKHR-commonparent", VALIDATION_ERROR_11200009}, + {"VUID-VkPresentInfoKHR-pImageIndices-01296", VALIDATION_ERROR_11200a20}, + {"VUID-VkPresentInfoKHR-pImageIndices-01430", VALIDATION_ERROR_11200b2c}, + {"VUID-VkPresentInfoKHR-pImageIndices-parameter", VALIDATION_ERROR_11218801}, + {"VUID-VkPresentInfoKHR-pNext-pNext", VALIDATION_ERROR_1121c40d}, + {"VUID-VkPresentInfoKHR-pResults-parameter", VALIDATION_ERROR_11221e01}, + {"VUID-VkPresentInfoKHR-pSwapchains-parameter", VALIDATION_ERROR_11225801}, + {"VUID-VkPresentInfoKHR-pWaitSemaphores-parameter", VALIDATION_ERROR_11227601}, + {"VUID-VkPresentInfoKHR-sType-sType", VALIDATION_ERROR_1122b00b}, + {"VUID-VkPresentInfoKHR-sType-unique", VALIDATION_ERROR_1122b00f}, + {"VUID-VkPresentInfoKHR-swapchainCount-arraylength", VALIDATION_ERROR_1122f21b}, + {"VUID-VkPresentRegionKHR-pRectangles-parameter", VALIDATION_ERROR_11420c01}, + {"VUID-VkPresentRegionsKHR-swapchainCount-01260", VALIDATION_ERROR_116009d8}, + {"VUID-VkPresentRegionsKHR-pRegions-parameter", VALIDATION_ERROR_11621001}, + {"VUID-VkPresentRegionsKHR-sType-sType", VALIDATION_ERROR_1162b00b}, + {"VUID-VkPresentRegionsKHR-swapchainCount-arraylength", VALIDATION_ERROR_1162f21b}, + {"VUID-VkPresentTimesInfoGOOGLE-swapchainCount-01247", VALIDATION_ERROR_118009be}, + {"VUID-VkPresentTimesInfoGOOGLE-pTimes-parameter", VALIDATION_ERROR_11825e01}, + {"VUID-VkPresentTimesInfoGOOGLE-sType-sType", VALIDATION_ERROR_1182b00b}, + {"VUID-VkPresentTimesInfoGOOGLE-swapchainCount-arraylength", VALIDATION_ERROR_1182f21b}, + {"VUID-VkPushConstantRange-offset-00294", VALIDATION_ERROR_11a0024c}, + {"VUID-VkPushConstantRange-offset-00295", VALIDATION_ERROR_11a0024e}, + {"VUID-VkPushConstantRange-size-00296", VALIDATION_ERROR_11a00250}, + {"VUID-VkPushConstantRange-size-00297", VALIDATION_ERROR_11a00252}, + {"VUID-VkPushConstantRange-size-00298", VALIDATION_ERROR_11a00254}, + {"VUID-VkPushConstantRange-stageFlags-parameter", VALIDATION_ERROR_11a2dc01}, + {"VUID-VkPushConstantRange-stageFlags-requiredbitmask", VALIDATION_ERROR_11a2dc03}, + {"VUID-VkQueryPoolCreateInfo-queryType-00791", VALIDATION_ERROR_11c0062e}, + {"VUID-VkQueryPoolCreateInfo-queryType-00792", VALIDATION_ERROR_11c00630}, + {"VUID-VkQueryPoolCreateInfo-flags-zerobitmask", VALIDATION_ERROR_11c09005}, + {"VUID-VkQueryPoolCreateInfo-pNext-pNext", VALIDATION_ERROR_11c1c40d}, + {"VUID-VkQueryPoolCreateInfo-queryType-parameter", VALIDATION_ERROR_11c29a01}, + {"VUID-VkQueryPoolCreateInfo-sType-sType", VALIDATION_ERROR_11c2b00b}, + {"VUID-VkRectLayerKHR-offset-01261", VALIDATION_ERROR_11e009da}, + {"VUID-VkRectLayerKHR-layer-01262", VALIDATION_ERROR_11e009dc}, + {"VUID-VkRenderPassBeginInfo-commonparent", VALIDATION_ERROR_12000009}, + {"VUID-VkRenderPassBeginInfo-clearValueCount-00902", VALIDATION_ERROR_1200070c}, + {"VUID-VkRenderPassBeginInfo-clearValueCount-00903", VALIDATION_ERROR_1200070e}, + {"VUID-VkRenderPassBeginInfo-renderPass-00904", VALIDATION_ERROR_12000710}, + {"VUID-VkRenderPassBeginInfo-framebuffer-parameter", VALIDATION_ERROR_12009401}, + {"VUID-VkRenderPassBeginInfo-pNext-pNext", VALIDATION_ERROR_1201c40d}, + {"VUID-VkRenderPassBeginInfo-renderPass-parameter", VALIDATION_ERROR_1202ae01}, + {"VUID-VkRenderPassBeginInfo-sType-sType", VALIDATION_ERROR_1202b00b}, + {"VUID-VkRenderPassBeginInfo-sType-unique", VALIDATION_ERROR_1202b00f}, + {"VUID-VkRenderPassCreateInfo-None-00832", VALIDATION_ERROR_12200680}, + {"VUID-VkRenderPassCreateInfo-attachment-00833", VALIDATION_ERROR_12200682}, + {"VUID-VkRenderPassCreateInfo-attachment-00834", VALIDATION_ERROR_12200684}, + {"VUID-VkRenderPassCreateInfo-pPreserveAttachments-00835", VALIDATION_ERROR_12200686}, + {"VUID-VkRenderPassCreateInfo-pAttachments-00836", VALIDATION_ERROR_12200688}, + {"VUID-VkRenderPassCreateInfo-pDependencies-00837", VALIDATION_ERROR_1220068a}, + {"VUID-VkRenderPassCreateInfo-pDependencies-00838", VALIDATION_ERROR_1220068c}, + {"VUID-VkRenderPassCreateInfo-pAttachments-01566", VALIDATION_ERROR_12200c3c}, + {"VUID-VkRenderPassCreateInfo-pAttachments-01567", VALIDATION_ERROR_12200c3e}, + {"VUID-VkRenderPassCreateInfo-pNext-01926", VALIDATION_ERROR_12200f0c}, + {"VUID-VkRenderPassCreateInfo-pNext-01927", VALIDATION_ERROR_12200f0e}, + {"VUID-VkRenderPassCreateInfo-pNext-01928", VALIDATION_ERROR_12200f10}, + {"VUID-VkRenderPassCreateInfo-pNext-01929", VALIDATION_ERROR_12200f12}, + {"VUID-VkRenderPassCreateInfo-pNext-01930", VALIDATION_ERROR_12200f14}, + {"VUID-VkRenderPassCreateInfo-flags-zerobitmask", VALIDATION_ERROR_12209005}, + {"VUID-VkRenderPassCreateInfo-pAttachments-parameter", VALIDATION_ERROR_1220f201}, + {"VUID-VkRenderPassCreateInfo-pDependencies-parameter", VALIDATION_ERROR_12212601}, + {"VUID-VkRenderPassCreateInfo-pNext-pNext", VALIDATION_ERROR_1221c40d}, + {"VUID-VkRenderPassCreateInfo-pSubpasses-parameter", VALIDATION_ERROR_12224201}, + {"VUID-VkRenderPassCreateInfo-sType-sType", VALIDATION_ERROR_1222b00b}, + {"VUID-VkRenderPassCreateInfo-sType-unique", VALIDATION_ERROR_1222b00f}, + {"VUID-VkRenderPassCreateInfo-subpassCount-arraylength", VALIDATION_ERROR_1222e61b}, + {"VUID-VkRenderPassMultiviewCreateInfo-pCorrelationMasks-00841", VALIDATION_ERROR_12400692}, + {"VUID-VkRenderPassMultiviewCreateInfo-pCorrelationMasks-parameter", VALIDATION_ERROR_12411a01}, + {"VUID-VkRenderPassMultiviewCreateInfo-pViewMasks-parameter", VALIDATION_ERROR_12426c01}, + {"VUID-VkRenderPassMultiviewCreateInfo-pViewOffsets-parameter", VALIDATION_ERROR_12426e01}, + {"VUID-VkRenderPassMultiviewCreateInfo-sType-sType", VALIDATION_ERROR_1242b00b}, + {"VUID-VkSamplerCreateInfo-addressModeU-parameter", VALIDATION_ERROR_12600201}, + {"VUID-VkSamplerCreateInfo-addressModeV-parameter", VALIDATION_ERROR_12600401}, + {"VUID-VkSamplerCreateInfo-addressModeW-parameter", VALIDATION_ERROR_12600601}, + {"VUID-VkSamplerCreateInfo-mipLodBias-01069", VALIDATION_ERROR_1260085a}, + {"VUID-VkSamplerCreateInfo-anisotropyEnable-01070", VALIDATION_ERROR_1260085c}, + {"VUID-VkSamplerCreateInfo-anisotropyEnable-01071", VALIDATION_ERROR_1260085e}, + {"VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01072", VALIDATION_ERROR_12600860}, + {"VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01073", VALIDATION_ERROR_12600862}, + {"VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01074", VALIDATION_ERROR_12600864}, + {"VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01075", VALIDATION_ERROR_12600866}, + {"VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01076", VALIDATION_ERROR_12600868}, + {"VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01077", VALIDATION_ERROR_1260086a}, + {"VUID-VkSamplerCreateInfo-addressModeU-01078", VALIDATION_ERROR_1260086c}, + {"VUID-VkSamplerCreateInfo-addressModeU-01079", VALIDATION_ERROR_1260086e}, + {"VUID-VkSamplerCreateInfo-compareEnable-01080", VALIDATION_ERROR_12600870}, + {"VUID-VkSamplerCreateInfo-magFilter-01081", VALIDATION_ERROR_12600872}, + {"VUID-VkSamplerCreateInfo-magFilter-01422", VALIDATION_ERROR_12600b1c}, + {"VUID-VkSamplerCreateInfo-compareEnable-01423", VALIDATION_ERROR_12600b1e}, + {"VUID-VkSamplerCreateInfo-minFilter-01645", VALIDATION_ERROR_12600cda}, + {"VUID-VkSamplerCreateInfo-addressModeU-01646", VALIDATION_ERROR_12600cdc}, + {"VUID-VkSamplerCreateInfo-None-01647", VALIDATION_ERROR_12600cde}, + {"VUID-VkSamplerCreateInfo-flags-zerobitmask", VALIDATION_ERROR_12609005}, + {"VUID-VkSamplerCreateInfo-magFilter-parameter", VALIDATION_ERROR_1260c401}, + {"VUID-VkSamplerCreateInfo-minFilter-parameter", VALIDATION_ERROR_1260ca01}, + {"VUID-VkSamplerCreateInfo-mipmapMode-parameter", VALIDATION_ERROR_1260cc01}, + {"VUID-VkSamplerCreateInfo-pNext-pNext", VALIDATION_ERROR_1261c40d}, + {"VUID-VkSamplerCreateInfo-sType-sType", VALIDATION_ERROR_1262b00b}, + {"VUID-VkSamplerCreateInfo-sType-unique", VALIDATION_ERROR_1262b00f}, + {"VUID-VkSemaphoreCreateInfo-flags-zerobitmask", VALIDATION_ERROR_12809005}, + {"VUID-VkSemaphoreCreateInfo-pNext-pNext", VALIDATION_ERROR_1281c40d}, + {"VUID-VkSemaphoreCreateInfo-sType-sType", VALIDATION_ERROR_1282b00b}, + {"VUID-VkSemaphoreCreateInfo-sType-unique", VALIDATION_ERROR_1282b00f}, + {"VUID-VkShaderModuleCreateInfo-codeSize-01085", VALIDATION_ERROR_12a0087a}, + {"VUID-VkShaderModuleCreateInfo-codeSize-01086", VALIDATION_ERROR_12a0087c}, + {"VUID-VkShaderModuleCreateInfo-pCode-01087", VALIDATION_ERROR_12a0087e}, + {"VUID-VkShaderModuleCreateInfo-pCode-01088", VALIDATION_ERROR_12a00880}, + {"VUID-VkShaderModuleCreateInfo-pCode-01089", VALIDATION_ERROR_12a00882}, + {"VUID-VkShaderModuleCreateInfo-pCode-01090", VALIDATION_ERROR_12a00884}, + {"VUID-VkShaderModuleCreateInfo-pCode-01091", VALIDATION_ERROR_12a00886}, + {"VUID-VkShaderModuleCreateInfo-pCode-01376", VALIDATION_ERROR_12a00ac0}, + {"VUID-VkShaderModuleCreateInfo-pCode-01377", VALIDATION_ERROR_12a00ac2}, + {"VUID-VkShaderModuleCreateInfo-pCode-01378", VALIDATION_ERROR_12a00ac4}, + {"VUID-VkShaderModuleCreateInfo-pCode-01379", VALIDATION_ERROR_12a00ac6}, + {"VUID-VkShaderModuleCreateInfo-flags-zerobitmask", VALIDATION_ERROR_12a09005}, + {"VUID-VkShaderModuleCreateInfo-pCode-parameter", VALIDATION_ERROR_12a10c01}, + {"VUID-VkShaderModuleCreateInfo-pNext-pNext", VALIDATION_ERROR_12a1c40d}, + {"VUID-VkShaderModuleCreateInfo-sType-sType", VALIDATION_ERROR_12a2b00b}, + {"VUID-VkSparseBufferMemoryBindInfo-bindCount-arraylength", VALIDATION_ERROR_12c0141b}, + {"VUID-VkSparseBufferMemoryBindInfo-buffer-parameter", VALIDATION_ERROR_12c01a01}, + {"VUID-VkSparseBufferMemoryBindInfo-pBinds-parameter", VALIDATION_ERROR_12c0fe01}, + {"VUID-VkSparseImageMemoryBind-memory-01104", VALIDATION_ERROR_12e008a0}, + {"VUID-VkSparseImageMemoryBind-memory-01105", VALIDATION_ERROR_12e008a2}, + {"VUID-VkSparseImageMemoryBind-subresource-01106", VALIDATION_ERROR_12e008a4}, + {"VUID-VkSparseImageMemoryBind-offset-01107", VALIDATION_ERROR_12e008a6}, + {"VUID-VkSparseImageMemoryBind-extent-01108", VALIDATION_ERROR_12e008a8}, + {"VUID-VkSparseImageMemoryBind-offset-01109", VALIDATION_ERROR_12e008aa}, + {"VUID-VkSparseImageMemoryBind-extent-01110", VALIDATION_ERROR_12e008ac}, + {"VUID-VkSparseImageMemoryBind-offset-01111", VALIDATION_ERROR_12e008ae}, + {"VUID-VkSparseImageMemoryBind-extent-01112", VALIDATION_ERROR_12e008b0}, + {"VUID-VkSparseImageMemoryBind-flags-parameter", VALIDATION_ERROR_12e09001}, + {"VUID-VkSparseImageMemoryBind-memory-parameter", VALIDATION_ERROR_12e0c601}, + {"VUID-VkSparseImageMemoryBind-subresource-parameter", VALIDATION_ERROR_12e2e801}, + {"VUID-VkSparseImageMemoryBindInfo-subresource-01722", VALIDATION_ERROR_13000d74}, + {"VUID-VkSparseImageMemoryBindInfo-subresource-01723", VALIDATION_ERROR_13000d76}, + {"VUID-VkSparseImageMemoryBindInfo-bindCount-arraylength", VALIDATION_ERROR_1300141b}, + {"VUID-VkSparseImageMemoryBindInfo-image-parameter", VALIDATION_ERROR_1300a001}, + {"VUID-VkSparseImageMemoryBindInfo-pBinds-parameter", VALIDATION_ERROR_1300fe01}, + {"VUID-VkSparseImageOpaqueMemoryBindInfo-pBinds-01103", VALIDATION_ERROR_1320089e}, + {"VUID-VkSparseImageOpaqueMemoryBindInfo-bindCount-arraylength", VALIDATION_ERROR_1320141b}, + {"VUID-VkSparseImageOpaqueMemoryBindInfo-image-parameter", VALIDATION_ERROR_1320a001}, + {"VUID-VkSparseImageOpaqueMemoryBindInfo-pBinds-parameter", VALIDATION_ERROR_1320fe01}, + {"VUID-VkSparseMemoryBind-memory-01096", VALIDATION_ERROR_13400890}, + {"VUID-VkSparseMemoryBind-memory-01097", VALIDATION_ERROR_13400892}, + {"VUID-VkSparseMemoryBind-size-01098", VALIDATION_ERROR_13400894}, + {"VUID-VkSparseMemoryBind-resourceOffset-01099", VALIDATION_ERROR_13400896}, + {"VUID-VkSparseMemoryBind-size-01100", VALIDATION_ERROR_13400898}, + {"VUID-VkSparseMemoryBind-memoryOffset-01101", VALIDATION_ERROR_1340089a}, + {"VUID-VkSparseMemoryBind-size-01102", VALIDATION_ERROR_1340089c}, + {"VUID-VkSparseMemoryBind-flags-parameter", VALIDATION_ERROR_13409001}, + {"VUID-VkSparseMemoryBind-memory-parameter", VALIDATION_ERROR_1340c601}, + {"VUID-VkSpecializationInfo-offset-00773", VALIDATION_ERROR_1360060a}, + {"VUID-VkSpecializationInfo-pMapEntries-00774", VALIDATION_ERROR_1360060c}, + {"VUID-VkSpecializationInfo-mapEntryCount-00775", VALIDATION_ERROR_1360060e}, + {"VUID-VkSpecializationInfo-pData-parameter", VALIDATION_ERROR_13612201}, + {"VUID-VkSpecializationMapEntry-constantID-00776", VALIDATION_ERROR_13800610}, + {"VUID-VkStencilOpState-compareOp-parameter", VALIDATION_ERROR_13a02a01}, + {"VUID-VkStencilOpState-depthFailOp-parameter", VALIDATION_ERROR_13a04201}, + {"VUID-VkStencilOpState-failOp-parameter", VALIDATION_ERROR_13a08601}, + {"VUID-VkStencilOpState-passOp-parameter", VALIDATION_ERROR_13a27801}, + {"VUID-VkSubmitInfo-commonparent", VALIDATION_ERROR_13c00009}, + {"VUID-VkSubmitInfo-pCommandBuffers-00075", VALIDATION_ERROR_13c00096}, + {"VUID-VkSubmitInfo-pWaitDstStageMask-00076", VALIDATION_ERROR_13c00098}, + {"VUID-VkSubmitInfo-pWaitDstStageMask-00077", VALIDATION_ERROR_13c0009a}, + {"VUID-VkSubmitInfo-pWaitDstStageMask-00078", VALIDATION_ERROR_13c0009c}, + {"VUID-VkSubmitInfo-pCommandBuffers-parameter", VALIDATION_ERROR_13c11401}, + {"VUID-VkSubmitInfo-pNext-pNext", VALIDATION_ERROR_13c1c40d}, + {"VUID-VkSubmitInfo-pSignalSemaphores-parameter", VALIDATION_ERROR_13c23401}, + {"VUID-VkSubmitInfo-pWaitDstStageMask-parameter", VALIDATION_ERROR_13c27001}, + {"VUID-VkSubmitInfo-pWaitDstStageMask-requiredbitmask", VALIDATION_ERROR_13c27003}, + {"VUID-VkSubmitInfo-pWaitSemaphores-parameter", VALIDATION_ERROR_13c27601}, + {"VUID-VkSubmitInfo-sType-sType", VALIDATION_ERROR_13c2b00b}, + {"VUID-VkSubmitInfo-sType-unique", VALIDATION_ERROR_13c2b00f}, + {"VUID-VkSubpassDependency-srcSubpass-00858", VALIDATION_ERROR_13e006b4}, + {"VUID-VkSubpassDependency-dstSubpass-00859", VALIDATION_ERROR_13e006b6}, + {"VUID-VkSubpassDependency-srcStageMask-00860", VALIDATION_ERROR_13e006b8}, + {"VUID-VkSubpassDependency-dstStageMask-00861", VALIDATION_ERROR_13e006ba}, + {"VUID-VkSubpassDependency-srcStageMask-00862", VALIDATION_ERROR_13e006bc}, + {"VUID-VkSubpassDependency-dstStageMask-00863", VALIDATION_ERROR_13e006be}, + {"VUID-VkSubpassDependency-srcSubpass-00864", VALIDATION_ERROR_13e006c0}, + {"VUID-VkSubpassDependency-srcSubpass-00865", VALIDATION_ERROR_13e006c2}, + {"VUID-VkSubpassDependency-srcSubpass-00866", VALIDATION_ERROR_13e006c4}, + {"VUID-VkSubpassDependency-srcSubpass-00867", VALIDATION_ERROR_13e006c6}, + {"VUID-VkSubpassDependency-srcAccessMask-00868", VALIDATION_ERROR_13e006c8}, + {"VUID-VkSubpassDependency-dstAccessMask-00869", VALIDATION_ERROR_13e006ca}, + {"VUID-VkSubpassDependency-dependencyFlags-00870", VALIDATION_ERROR_13e006cc}, + {"VUID-VkSubpassDependency-dependencyFlags-00871", VALIDATION_ERROR_13e006ce}, + {"VUID-VkSubpassDependency-srcSubpass-00872", VALIDATION_ERROR_13e006d0}, + {"VUID-VkSubpassDependency-dependencyFlags-parameter", VALIDATION_ERROR_13e03e01}, + {"VUID-VkSubpassDependency-dstAccessMask-parameter", VALIDATION_ERROR_13e06801}, + {"VUID-VkSubpassDependency-dstStageMask-parameter", VALIDATION_ERROR_13e07801}, + {"VUID-VkSubpassDependency-dstStageMask-requiredbitmask", VALIDATION_ERROR_13e07803}, + {"VUID-VkSubpassDependency-srcAccessMask-parameter", VALIDATION_ERROR_13e2c401}, + {"VUID-VkSubpassDependency-srcStageMask-parameter", VALIDATION_ERROR_13e2d401}, + {"VUID-VkSubpassDependency-srcStageMask-requiredbitmask", VALIDATION_ERROR_13e2d403}, + {"VUID-VkSubpassDescription-pipelineBindPoint-00844", VALIDATION_ERROR_14000698}, + {"VUID-VkSubpassDescription-colorAttachmentCount-00845", VALIDATION_ERROR_1400069a}, + {"VUID-VkSubpassDescription-loadOp-00846", VALIDATION_ERROR_1400069c}, + {"VUID-VkSubpassDescription-pResolveAttachments-00847", VALIDATION_ERROR_1400069e}, + {"VUID-VkSubpassDescription-pResolveAttachments-00848", VALIDATION_ERROR_140006a0}, + {"VUID-VkSubpassDescription-pResolveAttachments-00849", VALIDATION_ERROR_140006a2}, + {"VUID-VkSubpassDescription-pResolveAttachments-00850", VALIDATION_ERROR_140006a4}, + {"VUID-VkSubpassDescription-None-00852", VALIDATION_ERROR_140006a8}, + {"VUID-VkSubpassDescription-attachment-00853", VALIDATION_ERROR_140006aa}, + {"VUID-VkSubpassDescription-pPreserveAttachments-00854", VALIDATION_ERROR_140006ac}, + {"VUID-VkSubpassDescription-layout-00855", VALIDATION_ERROR_140006ae}, + {"VUID-VkSubpassDescription-flags-00856", VALIDATION_ERROR_140006b0}, + {"VUID-VkSubpassDescription-pColorAttachments-01417", VALIDATION_ERROR_14000b12}, + {"VUID-VkSubpassDescription-pDepthStencilAttachment-01418", VALIDATION_ERROR_14000b14}, + {"VUID-VkSubpassDescription-pColorAttachments-01506", VALIDATION_ERROR_14000bc4}, + {"VUID-VkSubpassDescription-flags-parameter", VALIDATION_ERROR_14009001}, + {"VUID-VkSubpassDescription-pColorAttachments-parameter", VALIDATION_ERROR_14011001}, + {"VUID-VkSubpassDescription-pDepthStencilAttachment-parameter", VALIDATION_ERROR_14012a01}, + {"VUID-VkSubpassDescription-pInputAttachments-parameter", VALIDATION_ERROR_14019a01}, + {"VUID-VkSubpassDescription-pPreserveAttachments-parameter", VALIDATION_ERROR_1401f001}, + {"VUID-VkSubpassDescription-pResolveAttachments-parameter", VALIDATION_ERROR_14021c01}, + {"VUID-VkSubpassDescription-pipelineBindPoint-parameter", VALIDATION_ERROR_14027e01}, + {"VUID-VkSurfaceCapabilities2EXT-supportedSurfaceCounters-01246", VALIDATION_ERROR_142009bc}, + {"VUID-VkSurfaceCapabilities2EXT-pNext-pNext", VALIDATION_ERROR_1421c40d}, + {"VUID-VkSurfaceCapabilities2EXT-sType-sType", VALIDATION_ERROR_1422b00b}, + {"VUID-VkSwapchainCounterCreateInfoEXT-surfaceCounters-01244", VALIDATION_ERROR_144009b8}, + {"VUID-VkSwapchainCounterCreateInfoEXT-sType-sType", VALIDATION_ERROR_1442b00b}, + {"VUID-VkSwapchainCounterCreateInfoEXT-surfaceCounters-parameter", VALIDATION_ERROR_1442ee01}, + {"VUID-VkSwapchainCreateInfoKHR-commonparent", VALIDATION_ERROR_14600009}, + {"VUID-VkSwapchainCreateInfoKHR-surface-01270", VALIDATION_ERROR_146009ec}, + {"VUID-VkSwapchainCreateInfoKHR-minImageCount-01271", VALIDATION_ERROR_146009ee}, + {"VUID-VkSwapchainCreateInfoKHR-minImageCount-01272", VALIDATION_ERROR_146009f0}, + {"VUID-VkSwapchainCreateInfoKHR-imageFormat-01273", VALIDATION_ERROR_146009f2}, + {"VUID-VkSwapchainCreateInfoKHR-imageExtent-01274", VALIDATION_ERROR_146009f4}, + {"VUID-VkSwapchainCreateInfoKHR-imageArrayLayers-01275", VALIDATION_ERROR_146009f6}, + {"VUID-VkSwapchainCreateInfoKHR-imageUsage-01276", VALIDATION_ERROR_146009f8}, + {"VUID-VkSwapchainCreateInfoKHR-imageSharingMode-01277", VALIDATION_ERROR_146009fa}, + {"VUID-VkSwapchainCreateInfoKHR-imageSharingMode-01278", VALIDATION_ERROR_146009fc}, + {"VUID-VkSwapchainCreateInfoKHR-preTransform-01279", VALIDATION_ERROR_146009fe}, + {"VUID-VkSwapchainCreateInfoKHR-compositeAlpha-01280", VALIDATION_ERROR_14600a00}, + {"VUID-VkSwapchainCreateInfoKHR-presentMode-01281", VALIDATION_ERROR_14600a02}, + {"VUID-VkSwapchainCreateInfoKHR-minImageCount-01383", VALIDATION_ERROR_14600ace}, + {"VUID-VkSwapchainCreateInfoKHR-imageUsage-01384", VALIDATION_ERROR_14600ad0}, + {"VUID-VkSwapchainCreateInfoKHR-imageSharingMode-01393", VALIDATION_ERROR_14600ae2}, + {"VUID-VkSwapchainCreateInfoKHR-presentMode-01427", VALIDATION_ERROR_14600b26}, + {"VUID-VkSwapchainCreateInfoKHR-imageSharingMode-01428", VALIDATION_ERROR_14600b28}, + {"VUID-VkSwapchainCreateInfoKHR-physicalDeviceCount-01429", VALIDATION_ERROR_14600b2a}, + {"VUID-VkSwapchainCreateInfoKHR-imageExtent-01689", VALIDATION_ERROR_14600d32}, + {"VUID-VkSwapchainCreateInfoKHR-imageFormat-01778", VALIDATION_ERROR_14600de4}, + {"VUID-VkSwapchainCreateInfoKHR-oldSwapchain-01933", VALIDATION_ERROR_14600f1a}, + {"VUID-VkSwapchainCreateInfoKHR-compositeAlpha-parameter", VALIDATION_ERROR_14602e01}, + {"VUID-VkSwapchainCreateInfoKHR-flags-parameter", VALIDATION_ERROR_14609001}, + {"VUID-VkSwapchainCreateInfoKHR-imageColorSpace-parameter", VALIDATION_ERROR_1460a201}, + {"VUID-VkSwapchainCreateInfoKHR-imageFormat-parameter", VALIDATION_ERROR_1460a401}, + {"VUID-VkSwapchainCreateInfoKHR-imageSharingMode-parameter", VALIDATION_ERROR_1460a801}, + {"VUID-VkSwapchainCreateInfoKHR-imageUsage-parameter", VALIDATION_ERROR_1460ae01}, + {"VUID-VkSwapchainCreateInfoKHR-imageUsage-requiredbitmask", VALIDATION_ERROR_1460ae03}, + {"VUID-VkSwapchainCreateInfoKHR-oldSwapchain-parameter", VALIDATION_ERROR_1460de01}, + {"VUID-VkSwapchainCreateInfoKHR-oldSwapchain-parent", VALIDATION_ERROR_1460de07}, + {"VUID-VkSwapchainCreateInfoKHR-pNext-pNext", VALIDATION_ERROR_1461c40d}, + {"VUID-VkSwapchainCreateInfoKHR-preTransform-parameter", VALIDATION_ERROR_14629401}, + {"VUID-VkSwapchainCreateInfoKHR-presentMode-parameter", VALIDATION_ERROR_14629601}, + {"VUID-VkSwapchainCreateInfoKHR-sType-sType", VALIDATION_ERROR_1462b00b}, + {"VUID-VkSwapchainCreateInfoKHR-sType-unique", VALIDATION_ERROR_1462b00f}, + {"VUID-VkSwapchainCreateInfoKHR-surface-parameter", VALIDATION_ERROR_1462ec01}, + {"VUID-VkValidationFlagsEXT-disabledValidationCheckCount-arraylength", VALIDATION_ERROR_14805a1b}, + {"VUID-VkValidationFlagsEXT-pDisabledValidationChecks-parameter", VALIDATION_ERROR_14814401}, + {"VUID-VkValidationFlagsEXT-sType-sType", VALIDATION_ERROR_1482b00b}, + {"VUID-VkVertexInputAttributeDescription-location-00620", VALIDATION_ERROR_14a004d8}, + {"VUID-VkVertexInputAttributeDescription-binding-00621", VALIDATION_ERROR_14a004da}, + {"VUID-VkVertexInputAttributeDescription-offset-00622", VALIDATION_ERROR_14a004dc}, + {"VUID-VkVertexInputAttributeDescription-format-00623", VALIDATION_ERROR_14a004de}, + {"VUID-VkVertexInputAttributeDescription-format-parameter", VALIDATION_ERROR_14a09201}, + {"VUID-VkVertexInputBindingDescription-binding-00618", VALIDATION_ERROR_14c004d4}, + {"VUID-VkVertexInputBindingDescription-stride-00619", VALIDATION_ERROR_14c004d6}, + {"VUID-VkVertexInputBindingDescription-inputRate-parameter", VALIDATION_ERROR_14c0ba01}, + {"VUID-VkViSurfaceCreateInfoNN-window-01318", VALIDATION_ERROR_14e00a4c}, + {"VUID-VkViSurfaceCreateInfoNN-flags-zerobitmask", VALIDATION_ERROR_14e09005}, + {"VUID-VkViSurfaceCreateInfoNN-pNext-pNext", VALIDATION_ERROR_14e1c40d}, + {"VUID-VkViSurfaceCreateInfoNN-sType-sType", VALIDATION_ERROR_14e2b00b}, + {"VUID-VkViewport-x-01232", VALIDATION_ERROR_150009a0}, + {"VUID-VkViewport-y-01233", VALIDATION_ERROR_150009a2}, + {"VUID-VkViewport-minDepth-01234", VALIDATION_ERROR_150009a4}, + {"VUID-VkViewport-maxDepth-01235", VALIDATION_ERROR_150009a6}, + {"VUID-VkViewport-width-01770", VALIDATION_ERROR_15000dd4}, + {"VUID-VkViewport-width-01771", VALIDATION_ERROR_15000dd6}, + {"VUID-VkViewport-height-01772", VALIDATION_ERROR_15000dd8}, + {"VUID-VkViewport-height-01773", VALIDATION_ERROR_15000dda}, + {"VUID-VkViewport-x-01774", VALIDATION_ERROR_15000ddc}, + {"VUID-VkViewport-y-01775", VALIDATION_ERROR_15000dde}, + {"VUID-VkViewport-y-01776", VALIDATION_ERROR_15000de0}, + {"VUID-VkViewport-y-01777", VALIDATION_ERROR_15000de2}, + {"VUID-VkViewportSwizzleNV-w-parameter", VALIDATION_ERROR_15230c01}, + {"VUID-VkViewportSwizzleNV-x-parameter", VALIDATION_ERROR_15231001}, + {"VUID-VkViewportSwizzleNV-y-parameter", VALIDATION_ERROR_15231201}, + {"VUID-VkViewportSwizzleNV-z-parameter", VALIDATION_ERROR_15231401}, + {"VUID-VkWaylandSurfaceCreateInfoKHR-display-01304", VALIDATION_ERROR_15400a30}, + {"VUID-VkWaylandSurfaceCreateInfoKHR-surface-01305", VALIDATION_ERROR_15400a32}, + {"VUID-VkWaylandSurfaceCreateInfoKHR-flags-zerobitmask", VALIDATION_ERROR_15409005}, + {"VUID-VkWaylandSurfaceCreateInfoKHR-pNext-pNext", VALIDATION_ERROR_1541c40d}, + {"VUID-VkWaylandSurfaceCreateInfoKHR-sType-sType", VALIDATION_ERROR_1542b00b}, + {"VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-commonparent", VALIDATION_ERROR_15600009}, + {"VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pAcquireSyncs-00081", VALIDATION_ERROR_156000a2}, + {"VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pAcquireKeys-parameter", VALIDATION_ERROR_1560e201}, + {"VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pAcquireSyncs-parameter", VALIDATION_ERROR_1560e401}, + {"VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pAcquireTimeouts-parameter", VALIDATION_ERROR_1560e801}, + {"VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pReleaseKeys-parameter", VALIDATION_ERROR_15621201}, + {"VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pReleaseSyncs-parameter", VALIDATION_ERROR_15621401}, + {"VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-sType-sType", VALIDATION_ERROR_1562b00b}, + {"VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-commonparent", VALIDATION_ERROR_15800009}, + {"VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pAcquireKeys-parameter", VALIDATION_ERROR_1580e201}, + {"VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pAcquireSyncs-parameter", VALIDATION_ERROR_1580e401}, + {"VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pAcquireTimeoutMilliseconds-parameter", VALIDATION_ERROR_1580e601}, + {"VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pReleaseKeys-parameter", VALIDATION_ERROR_15821201}, + {"VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pReleaseSyncs-parameter", VALIDATION_ERROR_15821401}, + {"VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-sType-sType", VALIDATION_ERROR_1582b00b}, + {"VUID-VkWin32SurfaceCreateInfoKHR-hinstance-01307", VALIDATION_ERROR_15a00a36}, + {"VUID-VkWin32SurfaceCreateInfoKHR-hwnd-01308", VALIDATION_ERROR_15a00a38}, + {"VUID-VkWin32SurfaceCreateInfoKHR-flags-zerobitmask", VALIDATION_ERROR_15a09005}, + {"VUID-VkWin32SurfaceCreateInfoKHR-pNext-pNext", VALIDATION_ERROR_15a1c40d}, + {"VUID-VkWin32SurfaceCreateInfoKHR-sType-sType", VALIDATION_ERROR_15a2b00b}, + {"VUID-VkWriteDescriptorSet-commonparent", VALIDATION_ERROR_15c00009}, + {"VUID-VkWriteDescriptorSet-dstBinding-00315", VALIDATION_ERROR_15c00276}, + {"VUID-VkWriteDescriptorSet-dstBinding-00316", VALIDATION_ERROR_15c00278}, + {"VUID-VkWriteDescriptorSet-descriptorCount-00317", VALIDATION_ERROR_15c0027a}, + {"VUID-VkWriteDescriptorSet-descriptorCount-00318", VALIDATION_ERROR_15c0027c}, + {"VUID-VkWriteDescriptorSet-descriptorType-00319", VALIDATION_ERROR_15c0027e}, + {"VUID-VkWriteDescriptorSet-dstSet-00320", VALIDATION_ERROR_15c00280}, + {"VUID-VkWriteDescriptorSet-dstArrayElement-00321", VALIDATION_ERROR_15c00282}, + {"VUID-VkWriteDescriptorSet-descriptorType-00322", VALIDATION_ERROR_15c00284}, + {"VUID-VkWriteDescriptorSet-descriptorType-00323", VALIDATION_ERROR_15c00286}, + {"VUID-VkWriteDescriptorSet-descriptorType-00324", VALIDATION_ERROR_15c00288}, + {"VUID-VkWriteDescriptorSet-descriptorType-00325", VALIDATION_ERROR_15c0028a}, + {"VUID-VkWriteDescriptorSet-descriptorType-00326", VALIDATION_ERROR_15c0028c}, + {"VUID-VkWriteDescriptorSet-descriptorType-00327", VALIDATION_ERROR_15c0028e}, + {"VUID-VkWriteDescriptorSet-descriptorType-00328", VALIDATION_ERROR_15c00290}, + {"VUID-VkWriteDescriptorSet-descriptorType-00329", VALIDATION_ERROR_15c00292}, + {"VUID-VkWriteDescriptorSet-descriptorType-00330", VALIDATION_ERROR_15c00294}, + {"VUID-VkWriteDescriptorSet-descriptorType-00331", VALIDATION_ERROR_15c00296}, + {"VUID-VkWriteDescriptorSet-descriptorType-00332", VALIDATION_ERROR_15c00298}, + {"VUID-VkWriteDescriptorSet-descriptorType-00333", VALIDATION_ERROR_15c0029a}, + {"VUID-VkWriteDescriptorSet-descriptorType-00334", VALIDATION_ERROR_15c0029c}, + {"VUID-VkWriteDescriptorSet-descriptorType-00335", VALIDATION_ERROR_15c0029e}, + {"VUID-VkWriteDescriptorSet-descriptorType-00336", VALIDATION_ERROR_15c002a0}, + {"VUID-VkWriteDescriptorSet-descriptorType-00337", VALIDATION_ERROR_15c002a2}, + {"VUID-VkWriteDescriptorSet-descriptorType-00338", VALIDATION_ERROR_15c002a4}, + {"VUID-VkWriteDescriptorSet-descriptorType-00339", VALIDATION_ERROR_15c002a6}, + {"VUID-VkWriteDescriptorSet-descriptorType-01402", VALIDATION_ERROR_15c00af4}, + {"VUID-VkWriteDescriptorSet-descriptorType-01403", VALIDATION_ERROR_15c00af6}, + {"VUID-VkWriteDescriptorSet-descriptorCount-03048", VALIDATION_ERROR_15c017d0}, + {"VUID-VkWriteDescriptorSet-descriptorCount-arraylength", VALIDATION_ERROR_15c0441b}, + {"VUID-VkWriteDescriptorSet-descriptorType-parameter", VALIDATION_ERROR_15c04e01}, + {"VUID-VkWriteDescriptorSet-pNext-pNext", VALIDATION_ERROR_15c1c40d}, + {"VUID-VkWriteDescriptorSet-sType-sType", VALIDATION_ERROR_15c2b00b}, + {"VUID-VkXcbSurfaceCreateInfoKHR-connection-01310", VALIDATION_ERROR_15e00a3c}, + {"VUID-VkXcbSurfaceCreateInfoKHR-window-01311", VALIDATION_ERROR_15e00a3e}, + {"VUID-VkXcbSurfaceCreateInfoKHR-flags-zerobitmask", VALIDATION_ERROR_15e09005}, + {"VUID-VkXcbSurfaceCreateInfoKHR-pNext-pNext", VALIDATION_ERROR_15e1c40d}, + {"VUID-VkXcbSurfaceCreateInfoKHR-sType-sType", VALIDATION_ERROR_15e2b00b}, + {"VUID-VkXlibSurfaceCreateInfoKHR-dpy-01313", VALIDATION_ERROR_16000a42}, + {"VUID-VkXlibSurfaceCreateInfoKHR-window-01314", VALIDATION_ERROR_16000a44}, + {"VUID-VkXlibSurfaceCreateInfoKHR-flags-zerobitmask", VALIDATION_ERROR_16009005}, + {"VUID-VkXlibSurfaceCreateInfoKHR-pNext-pNext", VALIDATION_ERROR_1601c40d}, + {"VUID-VkXlibSurfaceCreateInfoKHR-sType-sType", VALIDATION_ERROR_1602b00b}, + {"VUID-vkAcquireNextImage2KHR-swapchain-01803", VALIDATION_ERROR_16200e16}, + {"VUID-vkAcquireNextImage2KHR-device-parameter", VALIDATION_ERROR_16205601}, + {"VUID-vkAcquireNextImage2KHR-pAcquireInfo-parameter", VALIDATION_ERROR_1620e001}, + {"VUID-vkAcquireNextImage2KHR-pImageIndex-parameter", VALIDATION_ERROR_16218601}, + {"VUID-vkAcquireNextImageKHR-commonparent", VALIDATION_ERROR_16400009}, + {"VUID-vkAcquireNextImageKHR-swapchain-01285", VALIDATION_ERROR_16400a0a}, + {"VUID-vkAcquireNextImageKHR-semaphore-01286", VALIDATION_ERROR_16400a0c}, + {"VUID-vkAcquireNextImageKHR-fence-01287", VALIDATION_ERROR_16400a0e}, + {"VUID-vkAcquireNextImageKHR-semaphore-01779", VALIDATION_ERROR_16400de6}, + {"VUID-vkAcquireNextImageKHR-semaphore-01780", VALIDATION_ERROR_16400de8}, + {"VUID-vkAcquireNextImageKHR-swapchain-01802", VALIDATION_ERROR_16400e14}, + {"VUID-vkAcquireNextImageKHR-device-parameter", VALIDATION_ERROR_16405601}, + {"VUID-vkAcquireNextImageKHR-fence-parameter", VALIDATION_ERROR_16408801}, + {"VUID-vkAcquireNextImageKHR-fence-parent", VALIDATION_ERROR_16408807}, + {"VUID-vkAcquireNextImageKHR-pImageIndex-parameter", VALIDATION_ERROR_16418601}, + {"VUID-vkAcquireNextImageKHR-semaphore-parameter", VALIDATION_ERROR_1642b801}, + {"VUID-vkAcquireNextImageKHR-semaphore-parent", VALIDATION_ERROR_1642b807}, + {"VUID-vkAcquireNextImageKHR-swapchain-parameter", VALIDATION_ERROR_1642f001}, + {"VUID-vkAcquireXlibDisplayEXT-display-parameter", VALIDATION_ERROR_16606001}, + {"VUID-vkAcquireXlibDisplayEXT-dpy-parameter", VALIDATION_ERROR_16606601}, + {"VUID-vkAcquireXlibDisplayEXT-physicalDevice-parameter", VALIDATION_ERROR_16627a01}, + {"VUID-vkAllocateCommandBuffers-device-parameter", VALIDATION_ERROR_16805601}, + {"VUID-vkAllocateCommandBuffers-pAllocateInfo-parameter", VALIDATION_ERROR_1680ea01}, + {"VUID-vkAllocateCommandBuffers-pCommandBuffers-parameter", VALIDATION_ERROR_16811401}, + {"VUID-vkAllocateDescriptorSets-device-parameter", VALIDATION_ERROR_16a05601}, + {"VUID-vkAllocateDescriptorSets-pAllocateInfo-parameter", VALIDATION_ERROR_16a0ea01}, + {"VUID-vkAllocateDescriptorSets-pDescriptorSets-parameter", VALIDATION_ERROR_16a13001}, + {"VUID-vkAllocateMemory-pAllocateInfo-01713", VALIDATION_ERROR_16c00d62}, + {"VUID-vkAllocateMemory-pAllocateInfo-01714", VALIDATION_ERROR_16c00d64}, + {"VUID-vkAllocateMemory-device-parameter", VALIDATION_ERROR_16c05601}, + {"VUID-vkAllocateMemory-pAllocateInfo-parameter", VALIDATION_ERROR_16c0ea01}, + {"VUID-vkAllocateMemory-pAllocator-parameter", VALIDATION_ERROR_16c0ec01}, + {"VUID-vkAllocateMemory-pMemory-parameter", VALIDATION_ERROR_16c1aa01}, + {"VUID-vkBeginCommandBuffer-commandBuffer-00049", VALIDATION_ERROR_16e00062}, + {"VUID-vkBeginCommandBuffer-commandBuffer-00050", VALIDATION_ERROR_16e00064}, + {"VUID-vkBeginCommandBuffer-commandBuffer-00051", VALIDATION_ERROR_16e00066}, + {"VUID-vkBeginCommandBuffer-commandBuffer-00052", VALIDATION_ERROR_16e00068}, + {"VUID-vkBeginCommandBuffer-commandBuffer-parameter", VALIDATION_ERROR_16e02401}, + {"VUID-vkBeginCommandBuffer-pBeginInfo-parameter", VALIDATION_ERROR_16e0f601}, + {"VUID-vkBindBufferMemory-buffer-01029", VALIDATION_ERROR_1700080a}, + {"VUID-vkBindBufferMemory-buffer-01030", VALIDATION_ERROR_1700080c}, + {"VUID-vkBindBufferMemory-memoryOffset-01031", VALIDATION_ERROR_1700080e}, + {"VUID-vkBindBufferMemory-buffer-01032", VALIDATION_ERROR_17000810}, + {"VUID-vkBindBufferMemory-buffer-01033", VALIDATION_ERROR_17000812}, + {"VUID-vkBindBufferMemory-buffer-01034", VALIDATION_ERROR_17000814}, + {"VUID-vkBindBufferMemory-memory-01035", VALIDATION_ERROR_17000816}, + {"VUID-vkBindBufferMemory-memoryOffset-01036", VALIDATION_ERROR_17000818}, + {"VUID-vkBindBufferMemory-size-01037", VALIDATION_ERROR_1700081a}, + {"VUID-vkBindBufferMemory-buffer-01038", VALIDATION_ERROR_1700081c}, + {"VUID-vkBindBufferMemory-buffer-01039", VALIDATION_ERROR_1700081e}, + {"VUID-vkBindBufferMemory-buffer-01444", VALIDATION_ERROR_17000b48}, + {"VUID-vkBindBufferMemory-memory-01508", VALIDATION_ERROR_17000bc8}, + {"VUID-vkBindBufferMemory-None-01898", VALIDATION_ERROR_17000ed4}, + {"VUID-vkBindBufferMemory-None-01899", VALIDATION_ERROR_17000ed6}, + {"VUID-vkBindBufferMemory-buffer-parameter", VALIDATION_ERROR_17001a01}, + {"VUID-vkBindBufferMemory-buffer-parent", VALIDATION_ERROR_17001a07}, + {"VUID-vkBindBufferMemory-device-parameter", VALIDATION_ERROR_17005601}, + {"VUID-vkBindBufferMemory-memory-parameter", VALIDATION_ERROR_1700c601}, + {"VUID-vkBindBufferMemory-memory-parent", VALIDATION_ERROR_1700c607}, + {"VUID-vkBindBufferMemory2-bindInfoCount-arraylength", VALIDATION_ERROR_1720161b}, + {"VUID-vkBindBufferMemory2-device-parameter", VALIDATION_ERROR_17205601}, + {"VUID-vkBindBufferMemory2-pBindInfos-parameter", VALIDATION_ERROR_1720fa01}, + {"VUID-vkBindImageMemory-image-01044", VALIDATION_ERROR_17400828}, + {"VUID-vkBindImageMemory-image-01045", VALIDATION_ERROR_1740082a}, + {"VUID-vkBindImageMemory-memoryOffset-01046", VALIDATION_ERROR_1740082c}, + {"VUID-vkBindImageMemory-memory-01047", VALIDATION_ERROR_1740082e}, + {"VUID-vkBindImageMemory-memoryOffset-01048", VALIDATION_ERROR_17400830}, + {"VUID-vkBindImageMemory-size-01049", VALIDATION_ERROR_17400832}, + {"VUID-vkBindImageMemory-image-01050", VALIDATION_ERROR_17400834}, + {"VUID-vkBindImageMemory-image-01051", VALIDATION_ERROR_17400836}, + {"VUID-vkBindImageMemory-image-01445", VALIDATION_ERROR_17400b4a}, + {"VUID-vkBindImageMemory-memory-01509", VALIDATION_ERROR_17400bca}, + {"VUID-vkBindImageMemory-image-01608", VALIDATION_ERROR_17400c90}, + {"VUID-vkBindImageMemory-None-01901", VALIDATION_ERROR_17400eda}, + {"VUID-vkBindImageMemory-None-01902", VALIDATION_ERROR_17400edc}, + {"VUID-vkBindImageMemory-device-parameter", VALIDATION_ERROR_17405601}, + {"VUID-vkBindImageMemory-image-parameter", VALIDATION_ERROR_1740a001}, + {"VUID-vkBindImageMemory-image-parent", VALIDATION_ERROR_1740a007}, + {"VUID-vkBindImageMemory-memory-parameter", VALIDATION_ERROR_1740c601}, + {"VUID-vkBindImageMemory-memory-parent", VALIDATION_ERROR_1740c607}, + {"VUID-vkBindImageMemory2-bindInfoCount-arraylength", VALIDATION_ERROR_1760161b}, + {"VUID-vkBindImageMemory2-device-parameter", VALIDATION_ERROR_17605601}, + {"VUID-vkBindImageMemory2-pBindInfos-parameter", VALIDATION_ERROR_1760fa01}, + {"VUID-vkCmdBeginQuery-commonparent", VALIDATION_ERROR_17800009}, + {"VUID-vkCmdBeginQuery-queryType-00800", VALIDATION_ERROR_17800640}, + {"VUID-vkCmdBeginQuery-query-00802", VALIDATION_ERROR_17800644}, + {"VUID-vkCmdBeginQuery-queryType-00803", VALIDATION_ERROR_17800646}, + {"VUID-vkCmdBeginQuery-queryType-00804", VALIDATION_ERROR_17800648}, + {"VUID-vkCmdBeginQuery-queryType-00805", VALIDATION_ERROR_1780064a}, + {"VUID-vkCmdBeginQuery-None-00807", VALIDATION_ERROR_1780064e}, + {"VUID-vkCmdBeginQuery-query-00808", VALIDATION_ERROR_17800650}, + {"VUID-vkCmdBeginQuery-commandBuffer-01885", VALIDATION_ERROR_17800eba}, + {"VUID-vkCmdBeginQuery-queryPool-01922", VALIDATION_ERROR_17800f04}, + {"VUID-vkCmdBeginQuery-commandBuffer-parameter", VALIDATION_ERROR_17802401}, + {"VUID-vkCmdBeginQuery-commandBuffer-recording", VALIDATION_ERROR_17802413}, + {"VUID-vkCmdBeginQuery-commandBuffer-cmdpool", VALIDATION_ERROR_17802415}, + {"VUID-vkCmdBeginQuery-flags-parameter", VALIDATION_ERROR_17809001}, + {"VUID-vkCmdBeginQuery-queryPool-parameter", VALIDATION_ERROR_17829801}, + {"VUID-vkCmdBeginRenderPass-renderpass", VALIDATION_ERROR_17a00017}, + {"VUID-vkCmdBeginRenderPass-bufferlevel", VALIDATION_ERROR_17a00019}, + {"VUID-vkCmdBeginRenderPass-initialLayout-00895", VALIDATION_ERROR_17a006fe}, + {"VUID-vkCmdBeginRenderPass-initialLayout-00896", VALIDATION_ERROR_17a00700}, + {"VUID-vkCmdBeginRenderPass-initialLayout-00897", VALIDATION_ERROR_17a00702}, + {"VUID-vkCmdBeginRenderPass-initialLayout-00898", VALIDATION_ERROR_17a00704}, + {"VUID-vkCmdBeginRenderPass-initialLayout-00899", VALIDATION_ERROR_17a00706}, + {"VUID-vkCmdBeginRenderPass-initialLayout-00900", VALIDATION_ERROR_17a00708}, + {"VUID-vkCmdBeginRenderPass-srcStageMask-00901", VALIDATION_ERROR_17a0070a}, + {"VUID-vkCmdBeginRenderPass-initialLayout-01758", VALIDATION_ERROR_17a00dbc}, + {"VUID-vkCmdBeginRenderPass-commandBuffer-parameter", VALIDATION_ERROR_17a02401}, + {"VUID-vkCmdBeginRenderPass-commandBuffer-recording", VALIDATION_ERROR_17a02413}, + {"VUID-vkCmdBeginRenderPass-commandBuffer-cmdpool", VALIDATION_ERROR_17a02415}, + {"VUID-vkCmdBeginRenderPass-contents-parameter", VALIDATION_ERROR_17a03201}, + {"VUID-vkCmdBeginRenderPass-pRenderPassBegin-parameter", VALIDATION_ERROR_17a21801}, + {"VUID-vkCmdBindDescriptorSets-commonparent", VALIDATION_ERROR_17c00009}, + {"VUID-vkCmdBindDescriptorSets-pDescriptorSets-00358", VALIDATION_ERROR_17c002cc}, + {"VUID-vkCmdBindDescriptorSets-dynamicOffsetCount-00359", VALIDATION_ERROR_17c002ce}, + {"VUID-vkCmdBindDescriptorSets-firstSet-00360", VALIDATION_ERROR_17c002d0}, + {"VUID-vkCmdBindDescriptorSets-pipelineBindPoint-00361", VALIDATION_ERROR_17c002d2}, + {"VUID-vkCmdBindDescriptorSets-pDynamicOffsets-00362", VALIDATION_ERROR_17c002d4}, + {"VUID-vkCmdBindDescriptorSets-commandBuffer-parameter", VALIDATION_ERROR_17c02401}, + {"VUID-vkCmdBindDescriptorSets-commandBuffer-recording", VALIDATION_ERROR_17c02413}, + {"VUID-vkCmdBindDescriptorSets-commandBuffer-cmdpool", VALIDATION_ERROR_17c02415}, + {"VUID-vkCmdBindDescriptorSets-descriptorSetCount-arraylength", VALIDATION_ERROR_17c04a1b}, + {"VUID-vkCmdBindDescriptorSets-layout-parameter", VALIDATION_ERROR_17c0be01}, + {"VUID-vkCmdBindDescriptorSets-pDescriptorSets-parameter", VALIDATION_ERROR_17c13001}, + {"VUID-vkCmdBindDescriptorSets-pDynamicOffsets-parameter", VALIDATION_ERROR_17c15401}, + {"VUID-vkCmdBindDescriptorSets-pipelineBindPoint-parameter", VALIDATION_ERROR_17c27e01}, + {"VUID-vkCmdBindIndexBuffer-commonparent", VALIDATION_ERROR_17e00009}, + {"VUID-vkCmdBindIndexBuffer-offset-00431", VALIDATION_ERROR_17e0035e}, + {"VUID-vkCmdBindIndexBuffer-offset-00432", VALIDATION_ERROR_17e00360}, + {"VUID-vkCmdBindIndexBuffer-buffer-00433", VALIDATION_ERROR_17e00362}, + {"VUID-vkCmdBindIndexBuffer-buffer-00434", VALIDATION_ERROR_17e00364}, + {"VUID-vkCmdBindIndexBuffer-buffer-parameter", VALIDATION_ERROR_17e01a01}, + {"VUID-vkCmdBindIndexBuffer-commandBuffer-parameter", VALIDATION_ERROR_17e02401}, + {"VUID-vkCmdBindIndexBuffer-commandBuffer-recording", VALIDATION_ERROR_17e02413}, + {"VUID-vkCmdBindIndexBuffer-commandBuffer-cmdpool", VALIDATION_ERROR_17e02415}, + {"VUID-vkCmdBindIndexBuffer-indexType-parameter", VALIDATION_ERROR_17e0b201}, + {"VUID-vkCmdBindPipeline-commonparent", VALIDATION_ERROR_18000009}, + {"VUID-vkCmdBindPipeline-pipelineBindPoint-00777", VALIDATION_ERROR_18000612}, + {"VUID-vkCmdBindPipeline-pipelineBindPoint-00778", VALIDATION_ERROR_18000614}, + {"VUID-vkCmdBindPipeline-pipelineBindPoint-00779", VALIDATION_ERROR_18000616}, + {"VUID-vkCmdBindPipeline-pipelineBindPoint-00780", VALIDATION_ERROR_18000618}, + {"VUID-vkCmdBindPipeline-pipeline-00781", VALIDATION_ERROR_1800061a}, + {"VUID-vkCmdBindPipeline-variableSampleLocations-01525", VALIDATION_ERROR_18000bea}, + {"VUID-vkCmdBindPipeline-commandBuffer-parameter", VALIDATION_ERROR_18002401}, + {"VUID-vkCmdBindPipeline-commandBuffer-recording", VALIDATION_ERROR_18002413}, + {"VUID-vkCmdBindPipeline-commandBuffer-cmdpool", VALIDATION_ERROR_18002415}, + {"VUID-vkCmdBindPipeline-pipeline-parameter", VALIDATION_ERROR_18027c01}, + {"VUID-vkCmdBindPipeline-pipelineBindPoint-parameter", VALIDATION_ERROR_18027e01}, + {"VUID-vkCmdBindVertexBuffers-commonparent", VALIDATION_ERROR_18200009}, + {"VUID-vkCmdBindVertexBuffers-firstBinding-00624", VALIDATION_ERROR_182004e0}, + {"VUID-vkCmdBindVertexBuffers-firstBinding-00625", VALIDATION_ERROR_182004e2}, + {"VUID-vkCmdBindVertexBuffers-pOffsets-00626", VALIDATION_ERROR_182004e4}, + {"VUID-vkCmdBindVertexBuffers-pBuffers-00627", VALIDATION_ERROR_182004e6}, + {"VUID-vkCmdBindVertexBuffers-pBuffers-00628", VALIDATION_ERROR_182004e8}, + {"VUID-vkCmdBindVertexBuffers-bindingCount-arraylength", VALIDATION_ERROR_1820181b}, + {"VUID-vkCmdBindVertexBuffers-commandBuffer-parameter", VALIDATION_ERROR_18202401}, + {"VUID-vkCmdBindVertexBuffers-commandBuffer-recording", VALIDATION_ERROR_18202413}, + {"VUID-vkCmdBindVertexBuffers-commandBuffer-cmdpool", VALIDATION_ERROR_18202415}, + {"VUID-vkCmdBindVertexBuffers-pBuffers-parameter", VALIDATION_ERROR_18210601}, + {"VUID-vkCmdBindVertexBuffers-pOffsets-parameter", VALIDATION_ERROR_1821d201}, + {"VUID-vkCmdBlitImage-commonparent", VALIDATION_ERROR_18400009}, + {"VUID-vkCmdBlitImage-renderpass", VALIDATION_ERROR_18400017}, + {"VUID-vkCmdBlitImage-pRegions-00215", VALIDATION_ERROR_184001ae}, + {"VUID-vkCmdBlitImage-pRegions-00216", VALIDATION_ERROR_184001b0}, + {"VUID-vkCmdBlitImage-pRegions-00217", VALIDATION_ERROR_184001b2}, + {"VUID-vkCmdBlitImage-srcImage-00218", VALIDATION_ERROR_184001b4}, + {"VUID-vkCmdBlitImage-srcImage-00219", VALIDATION_ERROR_184001b6}, + {"VUID-vkCmdBlitImage-srcImage-00220", VALIDATION_ERROR_184001b8}, + {"VUID-vkCmdBlitImage-srcImageLayout-00221", VALIDATION_ERROR_184001ba}, + {"VUID-vkCmdBlitImage-srcImageLayout-00222", VALIDATION_ERROR_184001bc}, + {"VUID-vkCmdBlitImage-dstImage-00223", VALIDATION_ERROR_184001be}, + {"VUID-vkCmdBlitImage-dstImage-00224", VALIDATION_ERROR_184001c0}, + {"VUID-vkCmdBlitImage-dstImage-00225", VALIDATION_ERROR_184001c2}, + {"VUID-vkCmdBlitImage-dstImageLayout-00226", VALIDATION_ERROR_184001c4}, + {"VUID-vkCmdBlitImage-dstImageLayout-00227", VALIDATION_ERROR_184001c6}, + {"VUID-vkCmdBlitImage-srcImage-00228", VALIDATION_ERROR_184001c8}, + {"VUID-vkCmdBlitImage-srcImage-00229", VALIDATION_ERROR_184001ca}, + {"VUID-vkCmdBlitImage-srcImage-00230", VALIDATION_ERROR_184001cc}, + {"VUID-vkCmdBlitImage-srcImage-00231", VALIDATION_ERROR_184001ce}, + {"VUID-vkCmdBlitImage-srcImage-00232", VALIDATION_ERROR_184001d0}, + {"VUID-vkCmdBlitImage-srcImage-00233", VALIDATION_ERROR_184001d2}, + {"VUID-vkCmdBlitImage-dstImage-00234", VALIDATION_ERROR_184001d4}, + {"VUID-vkCmdBlitImage-filter-00235", VALIDATION_ERROR_184001d6}, + {"VUID-vkCmdBlitImage-filter-00236", VALIDATION_ERROR_184001d8}, + {"VUID-vkCmdBlitImage-filter-00237", VALIDATION_ERROR_184001da}, + {"VUID-vkCmdBlitImage-srcImageLayout-01398", VALIDATION_ERROR_18400aec}, + {"VUID-vkCmdBlitImage-dstImageLayout-01399", VALIDATION_ERROR_18400aee}, + {"VUID-vkCmdBlitImage-srcImage-01561", VALIDATION_ERROR_18400c32}, + {"VUID-vkCmdBlitImage-dstImage-01562", VALIDATION_ERROR_18400c34}, + {"VUID-vkCmdBlitImage-srcSubresource-01705", VALIDATION_ERROR_18400d52}, + {"VUID-vkCmdBlitImage-dstSubresource-01706", VALIDATION_ERROR_18400d54}, + {"VUID-vkCmdBlitImage-srcSubresource-01707", VALIDATION_ERROR_18400d56}, + {"VUID-vkCmdBlitImage-dstSubresource-01708", VALIDATION_ERROR_18400d58}, + {"VUID-vkCmdBlitImage-commandBuffer-01834", VALIDATION_ERROR_18400e54}, + {"VUID-vkCmdBlitImage-commandBuffer-01835", VALIDATION_ERROR_18400e56}, + {"VUID-vkCmdBlitImage-commandBuffer-01836", VALIDATION_ERROR_18400e58}, + {"VUID-vkCmdBlitImage-commandBuffer-parameter", VALIDATION_ERROR_18402401}, + {"VUID-vkCmdBlitImage-commandBuffer-recording", VALIDATION_ERROR_18402413}, + {"VUID-vkCmdBlitImage-commandBuffer-cmdpool", VALIDATION_ERROR_18402415}, + {"VUID-vkCmdBlitImage-dstImage-parameter", VALIDATION_ERROR_18407201}, + {"VUID-vkCmdBlitImage-dstImageLayout-parameter", VALIDATION_ERROR_18407401}, + {"VUID-vkCmdBlitImage-filter-parameter", VALIDATION_ERROR_18408c01}, + {"VUID-vkCmdBlitImage-pRegions-parameter", VALIDATION_ERROR_18421001}, + {"VUID-vkCmdBlitImage-regionCount-arraylength", VALIDATION_ERROR_1842ac1b}, + {"VUID-vkCmdBlitImage-srcImage-parameter", VALIDATION_ERROR_1842ce01}, + {"VUID-vkCmdBlitImage-srcImageLayout-parameter", VALIDATION_ERROR_1842d001}, + {"VUID-vkCmdClearAttachments-renderpass", VALIDATION_ERROR_18600017}, + {"VUID-vkCmdClearAttachments-aspectMask-00015", VALIDATION_ERROR_1860001e}, + {"VUID-vkCmdClearAttachments-pRects-00016", VALIDATION_ERROR_18600020}, + {"VUID-vkCmdClearAttachments-pRects-00017", VALIDATION_ERROR_18600022}, + {"VUID-vkCmdClearAttachments-baseArrayLayer-00018", VALIDATION_ERROR_18600024}, + {"VUID-vkCmdClearAttachments-attachmentCount-arraylength", VALIDATION_ERROR_18600e1b}, + {"VUID-vkCmdClearAttachments-commandBuffer-parameter", VALIDATION_ERROR_18602401}, + {"VUID-vkCmdClearAttachments-commandBuffer-recording", VALIDATION_ERROR_18602413}, + {"VUID-vkCmdClearAttachments-commandBuffer-cmdpool", VALIDATION_ERROR_18602415}, + {"VUID-vkCmdClearAttachments-pAttachments-parameter", VALIDATION_ERROR_1860f201}, + {"VUID-vkCmdClearAttachments-pRects-parameter", VALIDATION_ERROR_18620e01}, + {"VUID-vkCmdClearAttachments-rectCount-arraylength", VALIDATION_ERROR_1862aa1b}, + {"VUID-vkCmdClearColorImage-image-00001", VALIDATION_ERROR_18800002}, + {"VUID-vkCmdClearColorImage-image-00002", VALIDATION_ERROR_18800004}, + {"VUID-vkCmdClearColorImage-image-00003", VALIDATION_ERROR_18800006}, + {"VUID-vkCmdClearColorImage-imageLayout-00004", VALIDATION_ERROR_18800008}, + {"VUID-vkCmdClearColorImage-commonparent", VALIDATION_ERROR_18800009}, + {"VUID-vkCmdClearColorImage-imageLayout-00005", VALIDATION_ERROR_1880000a}, + {"VUID-vkCmdClearColorImage-image-00007", VALIDATION_ERROR_1880000e}, + {"VUID-vkCmdClearColorImage-renderpass", VALIDATION_ERROR_18800017}, + {"VUID-vkCmdClearColorImage-imageLayout-01394", VALIDATION_ERROR_18800ae4}, + {"VUID-vkCmdClearColorImage-baseMipLevel-01470", VALIDATION_ERROR_18800b7c}, + {"VUID-vkCmdClearColorImage-baseArrayLayer-01472", VALIDATION_ERROR_18800b80}, + {"VUID-vkCmdClearColorImage-image-01545", VALIDATION_ERROR_18800c12}, + {"VUID-vkCmdClearColorImage-pRanges-01692", VALIDATION_ERROR_18800d38}, + {"VUID-vkCmdClearColorImage-pRanges-01693", VALIDATION_ERROR_18800d3a}, + {"VUID-vkCmdClearColorImage-commandBuffer-01805", VALIDATION_ERROR_18800e1a}, + {"VUID-vkCmdClearColorImage-commandBuffer-01806", VALIDATION_ERROR_18800e1c}, + {"VUID-vkCmdClearColorImage-commandBuffer-parameter", VALIDATION_ERROR_18802401}, + {"VUID-vkCmdClearColorImage-commandBuffer-recording", VALIDATION_ERROR_18802413}, + {"VUID-vkCmdClearColorImage-commandBuffer-cmdpool", VALIDATION_ERROR_18802415}, + {"VUID-vkCmdClearColorImage-image-parameter", VALIDATION_ERROR_1880a001}, + {"VUID-vkCmdClearColorImage-imageLayout-parameter", VALIDATION_ERROR_1880a601}, + {"VUID-vkCmdClearColorImage-pColor-parameter", VALIDATION_ERROR_18810e01}, + {"VUID-vkCmdClearColorImage-pRanges-parameter", VALIDATION_ERROR_18820601}, + {"VUID-vkCmdClearColorImage-rangeCount-arraylength", VALIDATION_ERROR_1882a41b}, + {"VUID-vkCmdClearDepthStencilImage-commonparent", VALIDATION_ERROR_18a00009}, + {"VUID-vkCmdClearDepthStencilImage-image-00008", VALIDATION_ERROR_18a00010}, + {"VUID-vkCmdClearDepthStencilImage-image-00009", VALIDATION_ERROR_18a00012}, + {"VUID-vkCmdClearDepthStencilImage-image-00010", VALIDATION_ERROR_18a00014}, + {"VUID-vkCmdClearDepthStencilImage-imageLayout-00011", VALIDATION_ERROR_18a00016}, + {"VUID-vkCmdClearDepthStencilImage-renderpass", VALIDATION_ERROR_18a00017}, + {"VUID-vkCmdClearDepthStencilImage-imageLayout-00012", VALIDATION_ERROR_18a00018}, + {"VUID-vkCmdClearDepthStencilImage-image-00014", VALIDATION_ERROR_18a0001c}, + {"VUID-vkCmdClearDepthStencilImage-baseMipLevel-01474", VALIDATION_ERROR_18a00b84}, + {"VUID-vkCmdClearDepthStencilImage-baseArrayLayer-01476", VALIDATION_ERROR_18a00b88}, + {"VUID-vkCmdClearDepthStencilImage-pRanges-01694", VALIDATION_ERROR_18a00d3c}, + {"VUID-vkCmdClearDepthStencilImage-pRanges-01695", VALIDATION_ERROR_18a00d3e}, + {"VUID-vkCmdClearDepthStencilImage-commandBuffer-01807", VALIDATION_ERROR_18a00e1e}, + {"VUID-vkCmdClearDepthStencilImage-commandBuffer-01808", VALIDATION_ERROR_18a00e20}, + {"VUID-vkCmdClearDepthStencilImage-commandBuffer-parameter", VALIDATION_ERROR_18a02401}, + {"VUID-vkCmdClearDepthStencilImage-commandBuffer-recording", VALIDATION_ERROR_18a02413}, + {"VUID-vkCmdClearDepthStencilImage-commandBuffer-cmdpool", VALIDATION_ERROR_18a02415}, + {"VUID-vkCmdClearDepthStencilImage-image-parameter", VALIDATION_ERROR_18a0a001}, + {"VUID-vkCmdClearDepthStencilImage-imageLayout-parameter", VALIDATION_ERROR_18a0a601}, + {"VUID-vkCmdClearDepthStencilImage-pDepthStencil-parameter", VALIDATION_ERROR_18a12801}, + {"VUID-vkCmdClearDepthStencilImage-pRanges-parameter", VALIDATION_ERROR_18a20601}, + {"VUID-vkCmdClearDepthStencilImage-rangeCount-arraylength", VALIDATION_ERROR_18a2a41b}, + {"VUID-vkCmdCopyBuffer-commonparent", VALIDATION_ERROR_18c00009}, + {"VUID-vkCmdCopyBuffer-renderpass", VALIDATION_ERROR_18c00017}, + {"VUID-vkCmdCopyBuffer-size-00112", VALIDATION_ERROR_18c000e0}, + {"VUID-vkCmdCopyBuffer-srcOffset-00113", VALIDATION_ERROR_18c000e2}, + {"VUID-vkCmdCopyBuffer-dstOffset-00114", VALIDATION_ERROR_18c000e4}, + {"VUID-vkCmdCopyBuffer-size-00115", VALIDATION_ERROR_18c000e6}, + {"VUID-vkCmdCopyBuffer-size-00116", VALIDATION_ERROR_18c000e8}, + {"VUID-vkCmdCopyBuffer-pRegions-00117", VALIDATION_ERROR_18c000ea}, + {"VUID-vkCmdCopyBuffer-srcBuffer-00118", VALIDATION_ERROR_18c000ec}, + {"VUID-vkCmdCopyBuffer-srcBuffer-00119", VALIDATION_ERROR_18c000ee}, + {"VUID-vkCmdCopyBuffer-dstBuffer-00120", VALIDATION_ERROR_18c000f0}, + {"VUID-vkCmdCopyBuffer-dstBuffer-00121", VALIDATION_ERROR_18c000f2}, + {"VUID-vkCmdCopyBuffer-commandBuffer-01822", VALIDATION_ERROR_18c00e3c}, + {"VUID-vkCmdCopyBuffer-commandBuffer-01823", VALIDATION_ERROR_18c00e3e}, + {"VUID-vkCmdCopyBuffer-commandBuffer-01824", VALIDATION_ERROR_18c00e40}, + {"VUID-vkCmdCopyBuffer-commandBuffer-parameter", VALIDATION_ERROR_18c02401}, + {"VUID-vkCmdCopyBuffer-commandBuffer-recording", VALIDATION_ERROR_18c02413}, + {"VUID-vkCmdCopyBuffer-commandBuffer-cmdpool", VALIDATION_ERROR_18c02415}, + {"VUID-vkCmdCopyBuffer-dstBuffer-parameter", VALIDATION_ERROR_18c06c01}, + {"VUID-vkCmdCopyBuffer-pRegions-parameter", VALIDATION_ERROR_18c21001}, + {"VUID-vkCmdCopyBuffer-regionCount-arraylength", VALIDATION_ERROR_18c2ac1b}, + {"VUID-vkCmdCopyBuffer-srcBuffer-parameter", VALIDATION_ERROR_18c2c801}, + {"VUID-vkCmdCopyBufferToImage-commonparent", VALIDATION_ERROR_18e00009}, + {"VUID-vkCmdCopyBufferToImage-renderpass", VALIDATION_ERROR_18e00017}, + {"VUID-vkCmdCopyBufferToImage-pRegions-00171", VALIDATION_ERROR_18e00156}, + {"VUID-vkCmdCopyBufferToImage-pRegions-00172", VALIDATION_ERROR_18e00158}, + {"VUID-vkCmdCopyBufferToImage-pRegions-00173", VALIDATION_ERROR_18e0015a}, + {"VUID-vkCmdCopyBufferToImage-srcBuffer-00174", VALIDATION_ERROR_18e0015c}, + {"VUID-vkCmdCopyBufferToImage-dstImage-00175", VALIDATION_ERROR_18e0015e}, + {"VUID-vkCmdCopyBufferToImage-srcBuffer-00176", VALIDATION_ERROR_18e00160}, + {"VUID-vkCmdCopyBufferToImage-dstImage-00177", VALIDATION_ERROR_18e00162}, + {"VUID-vkCmdCopyBufferToImage-dstImage-00178", VALIDATION_ERROR_18e00164}, + {"VUID-vkCmdCopyBufferToImage-dstImage-00179", VALIDATION_ERROR_18e00166}, + {"VUID-vkCmdCopyBufferToImage-dstImageLayout-00180", VALIDATION_ERROR_18e00168}, + {"VUID-vkCmdCopyBufferToImage-dstImageLayout-00181", VALIDATION_ERROR_18e0016a}, + {"VUID-vkCmdCopyBufferToImage-dstImageLayout-01396", VALIDATION_ERROR_18e00ae8}, + {"VUID-vkCmdCopyBufferToImage-imageSubresource-01701", VALIDATION_ERROR_18e00d4a}, + {"VUID-vkCmdCopyBufferToImage-imageSubresource-01702", VALIDATION_ERROR_18e00d4c}, + {"VUID-vkCmdCopyBufferToImage-imageOffset-01793", VALIDATION_ERROR_18e00e02}, + {"VUID-vkCmdCopyBufferToImage-commandBuffer-01828", VALIDATION_ERROR_18e00e48}, + {"VUID-vkCmdCopyBufferToImage-commandBuffer-01829", VALIDATION_ERROR_18e00e4a}, + {"VUID-vkCmdCopyBufferToImage-commandBuffer-01830", VALIDATION_ERROR_18e00e4c}, + {"VUID-vkCmdCopyBufferToImage-commandBuffer-parameter", VALIDATION_ERROR_18e02401}, + {"VUID-vkCmdCopyBufferToImage-commandBuffer-recording", VALIDATION_ERROR_18e02413}, + {"VUID-vkCmdCopyBufferToImage-commandBuffer-cmdpool", VALIDATION_ERROR_18e02415}, + {"VUID-vkCmdCopyBufferToImage-dstImage-parameter", VALIDATION_ERROR_18e07201}, + {"VUID-vkCmdCopyBufferToImage-dstImageLayout-parameter", VALIDATION_ERROR_18e07401}, + {"VUID-vkCmdCopyBufferToImage-pRegions-parameter", VALIDATION_ERROR_18e21001}, + {"VUID-vkCmdCopyBufferToImage-regionCount-arraylength", VALIDATION_ERROR_18e2ac1b}, + {"VUID-vkCmdCopyBufferToImage-srcBuffer-parameter", VALIDATION_ERROR_18e2c801}, + {"VUID-vkCmdCopyImage-commonparent", VALIDATION_ERROR_19000009}, + {"VUID-vkCmdCopyImage-renderpass", VALIDATION_ERROR_19000017}, + {"VUID-vkCmdCopyImage-pRegions-00122", VALIDATION_ERROR_190000f4}, + {"VUID-vkCmdCopyImage-pRegions-00123", VALIDATION_ERROR_190000f6}, + {"VUID-vkCmdCopyImage-pRegions-00124", VALIDATION_ERROR_190000f8}, + {"VUID-vkCmdCopyImage-srcImage-00125", VALIDATION_ERROR_190000fa}, + {"VUID-vkCmdCopyImage-srcImage-00126", VALIDATION_ERROR_190000fc}, + {"VUID-vkCmdCopyImage-srcImage-00127", VALIDATION_ERROR_190000fe}, + {"VUID-vkCmdCopyImage-srcImageLayout-00128", VALIDATION_ERROR_19000100}, + {"VUID-vkCmdCopyImage-srcImageLayout-00129", VALIDATION_ERROR_19000102}, + {"VUID-vkCmdCopyImage-dstImage-00130", VALIDATION_ERROR_19000104}, + {"VUID-vkCmdCopyImage-dstImage-00131", VALIDATION_ERROR_19000106}, + {"VUID-vkCmdCopyImage-dstImage-00132", VALIDATION_ERROR_19000108}, + {"VUID-vkCmdCopyImage-dstImageLayout-00133", VALIDATION_ERROR_1900010a}, + {"VUID-vkCmdCopyImage-dstImageLayout-00134", VALIDATION_ERROR_1900010c}, + {"VUID-vkCmdCopyImage-srcImage-00135", VALIDATION_ERROR_1900010e}, + {"VUID-vkCmdCopyImage-srcImage-00136", VALIDATION_ERROR_19000110}, + {"VUID-vkCmdCopyImage-dstImageLayout-01395", VALIDATION_ERROR_19000ae6}, + {"VUID-vkCmdCopyImage-srcImage-01546", VALIDATION_ERROR_19000c14}, + {"VUID-vkCmdCopyImage-dstImage-01547", VALIDATION_ERROR_19000c16}, + {"VUID-vkCmdCopyImage-srcImage-01548", VALIDATION_ERROR_19000c18}, + {"VUID-vkCmdCopyImage-None-01549", VALIDATION_ERROR_19000c1a}, + {"VUID-vkCmdCopyImage-aspectMask-01550", VALIDATION_ERROR_19000c1c}, + {"VUID-vkCmdCopyImage-srcSubresource-01696", VALIDATION_ERROR_19000d40}, + {"VUID-vkCmdCopyImage-dstSubresource-01697", VALIDATION_ERROR_19000d42}, + {"VUID-vkCmdCopyImage-srcSubresource-01698", VALIDATION_ERROR_19000d44}, + {"VUID-vkCmdCopyImage-dstSubresource-01699", VALIDATION_ERROR_19000d46}, + {"VUID-vkCmdCopyImage-srcOffset-01783", VALIDATION_ERROR_19000dee}, + {"VUID-vkCmdCopyImage-dstOffset-01784", VALIDATION_ERROR_19000df0}, + {"VUID-vkCmdCopyImage-commandBuffer-01825", VALIDATION_ERROR_19000e42}, + {"VUID-vkCmdCopyImage-commandBuffer-01826", VALIDATION_ERROR_19000e44}, + {"VUID-vkCmdCopyImage-commandBuffer-01827", VALIDATION_ERROR_19000e46}, + {"VUID-vkCmdCopyImage-srcImageLayout-01917", VALIDATION_ERROR_19000efa}, + {"VUID-vkCmdCopyImage-commandBuffer-parameter", VALIDATION_ERROR_19002401}, + {"VUID-vkCmdCopyImage-commandBuffer-recording", VALIDATION_ERROR_19002413}, + {"VUID-vkCmdCopyImage-commandBuffer-cmdpool", VALIDATION_ERROR_19002415}, + {"VUID-vkCmdCopyImage-dstImage-parameter", VALIDATION_ERROR_19007201}, + {"VUID-vkCmdCopyImage-dstImageLayout-parameter", VALIDATION_ERROR_19007401}, + {"VUID-vkCmdCopyImage-pRegions-parameter", VALIDATION_ERROR_19021001}, + {"VUID-vkCmdCopyImage-regionCount-arraylength", VALIDATION_ERROR_1902ac1b}, + {"VUID-vkCmdCopyImage-srcImage-parameter", VALIDATION_ERROR_1902ce01}, + {"VUID-vkCmdCopyImage-srcImageLayout-parameter", VALIDATION_ERROR_1902d001}, + {"VUID-vkCmdCopyImageToBuffer-commonparent", VALIDATION_ERROR_19200009}, + {"VUID-vkCmdCopyImageToBuffer-renderpass", VALIDATION_ERROR_19200017}, + {"VUID-vkCmdCopyImageToBuffer-pRegions-00182", VALIDATION_ERROR_1920016c}, + {"VUID-vkCmdCopyImageToBuffer-pRegions-00183", VALIDATION_ERROR_1920016e}, + {"VUID-vkCmdCopyImageToBuffer-pRegions-00184", VALIDATION_ERROR_19200170}, + {"VUID-vkCmdCopyImageToBuffer-srcImage-00185", VALIDATION_ERROR_19200172}, + {"VUID-vkCmdCopyImageToBuffer-srcImage-00186", VALIDATION_ERROR_19200174}, + {"VUID-vkCmdCopyImageToBuffer-srcImage-00187", VALIDATION_ERROR_19200176}, + {"VUID-vkCmdCopyImageToBuffer-srcImage-00188", VALIDATION_ERROR_19200178}, + {"VUID-vkCmdCopyImageToBuffer-srcImageLayout-00189", VALIDATION_ERROR_1920017a}, + {"VUID-vkCmdCopyImageToBuffer-srcImageLayout-00190", VALIDATION_ERROR_1920017c}, + {"VUID-vkCmdCopyImageToBuffer-dstBuffer-00191", VALIDATION_ERROR_1920017e}, + {"VUID-vkCmdCopyImageToBuffer-dstBuffer-00192", VALIDATION_ERROR_19200180}, + {"VUID-vkCmdCopyImageToBuffer-srcImageLayout-01397", VALIDATION_ERROR_19200aea}, + {"VUID-vkCmdCopyImageToBuffer-imageSubresource-01703", VALIDATION_ERROR_19200d4e}, + {"VUID-vkCmdCopyImageToBuffer-imageSubresource-01704", VALIDATION_ERROR_19200d50}, + {"VUID-vkCmdCopyImageToBuffer-imageOffset-01794", VALIDATION_ERROR_19200e04}, + {"VUID-vkCmdCopyImageToBuffer-commandBuffer-01831", VALIDATION_ERROR_19200e4e}, + {"VUID-vkCmdCopyImageToBuffer-commandBuffer-01832", VALIDATION_ERROR_19200e50}, + {"VUID-vkCmdCopyImageToBuffer-commandBuffer-01833", VALIDATION_ERROR_19200e52}, + {"VUID-vkCmdCopyImageToBuffer-commandBuffer-parameter", VALIDATION_ERROR_19202401}, + {"VUID-vkCmdCopyImageToBuffer-commandBuffer-recording", VALIDATION_ERROR_19202413}, + {"VUID-vkCmdCopyImageToBuffer-commandBuffer-cmdpool", VALIDATION_ERROR_19202415}, + {"VUID-vkCmdCopyImageToBuffer-dstBuffer-parameter", VALIDATION_ERROR_19206c01}, + {"VUID-vkCmdCopyImageToBuffer-pRegions-parameter", VALIDATION_ERROR_19221001}, + {"VUID-vkCmdCopyImageToBuffer-regionCount-arraylength", VALIDATION_ERROR_1922ac1b}, + {"VUID-vkCmdCopyImageToBuffer-srcImage-parameter", VALIDATION_ERROR_1922ce01}, + {"VUID-vkCmdCopyImageToBuffer-srcImageLayout-parameter", VALIDATION_ERROR_1922d001}, + {"VUID-vkCmdCopyQueryPoolResults-commonparent", VALIDATION_ERROR_19400009}, + {"VUID-vkCmdCopyQueryPoolResults-renderpass", VALIDATION_ERROR_19400017}, + {"VUID-vkCmdCopyQueryPoolResults-dstOffset-00819", VALIDATION_ERROR_19400666}, + {"VUID-vkCmdCopyQueryPoolResults-firstQuery-00820", VALIDATION_ERROR_19400668}, + {"VUID-vkCmdCopyQueryPoolResults-firstQuery-00821", VALIDATION_ERROR_1940066a}, + {"VUID-vkCmdCopyQueryPoolResults-flags-00822", VALIDATION_ERROR_1940066c}, + {"VUID-vkCmdCopyQueryPoolResults-flags-00823", VALIDATION_ERROR_1940066e}, + {"VUID-vkCmdCopyQueryPoolResults-dstBuffer-00824", VALIDATION_ERROR_19400670}, + {"VUID-vkCmdCopyQueryPoolResults-dstBuffer-00825", VALIDATION_ERROR_19400672}, + {"VUID-vkCmdCopyQueryPoolResults-dstBuffer-00826", VALIDATION_ERROR_19400674}, + {"VUID-vkCmdCopyQueryPoolResults-queryType-00827", VALIDATION_ERROR_19400676}, + {"VUID-vkCmdCopyQueryPoolResults-commandBuffer-parameter", VALIDATION_ERROR_19402401}, + {"VUID-vkCmdCopyQueryPoolResults-commandBuffer-recording", VALIDATION_ERROR_19402413}, + {"VUID-vkCmdCopyQueryPoolResults-commandBuffer-cmdpool", VALIDATION_ERROR_19402415}, + {"VUID-vkCmdCopyQueryPoolResults-dstBuffer-parameter", VALIDATION_ERROR_19406c01}, + {"VUID-vkCmdCopyQueryPoolResults-flags-parameter", VALIDATION_ERROR_19409001}, + {"VUID-vkCmdCopyQueryPoolResults-queryPool-parameter", VALIDATION_ERROR_19429801}, + {"VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-parameter", VALIDATION_ERROR_19602401}, + {"VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-recording", VALIDATION_ERROR_19602413}, + {"VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-cmdpool", VALIDATION_ERROR_19602415}, + {"VUID-vkCmdDebugMarkerBeginEXT-pMarkerInfo-parameter", VALIDATION_ERROR_1961a601}, + {"VUID-vkCmdDebugMarkerEndEXT-commandBuffer-01239", VALIDATION_ERROR_198009ae}, + {"VUID-vkCmdDebugMarkerEndEXT-commandBuffer-01240", VALIDATION_ERROR_198009b0}, + {"VUID-vkCmdDebugMarkerEndEXT-commandBuffer-parameter", VALIDATION_ERROR_19802401}, + {"VUID-vkCmdDebugMarkerEndEXT-commandBuffer-recording", VALIDATION_ERROR_19802413}, + {"VUID-vkCmdDebugMarkerEndEXT-commandBuffer-cmdpool", VALIDATION_ERROR_19802415}, + {"VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-parameter", VALIDATION_ERROR_19a02401}, + {"VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-recording", VALIDATION_ERROR_19a02413}, + {"VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-cmdpool", VALIDATION_ERROR_19a02415}, + {"VUID-vkCmdDebugMarkerInsertEXT-pMarkerInfo-parameter", VALIDATION_ERROR_19a1a601}, + {"VUID-vkCmdDispatch-renderpass", VALIDATION_ERROR_19c00017}, + {"VUID-vkCmdDispatch-groupCountX-00386", VALIDATION_ERROR_19c00304}, + {"VUID-vkCmdDispatch-groupCountY-00387", VALIDATION_ERROR_19c00306}, + {"VUID-vkCmdDispatch-groupCountZ-00388", VALIDATION_ERROR_19c00308}, + {"VUID-vkCmdDispatch-None-00389", VALIDATION_ERROR_19c0030a}, + {"VUID-vkCmdDispatch-None-00390", VALIDATION_ERROR_19c0030c}, + {"VUID-vkCmdDispatch-None-00391", VALIDATION_ERROR_19c0030e}, + {"VUID-vkCmdDispatch-None-00392", VALIDATION_ERROR_19c00310}, + {"VUID-vkCmdDispatch-None-00393", VALIDATION_ERROR_19c00312}, + {"VUID-vkCmdDispatch-None-00394", VALIDATION_ERROR_19c00314}, + {"VUID-vkCmdDispatch-None-00395", VALIDATION_ERROR_19c00316}, + {"VUID-vkCmdDispatch-None-00396", VALIDATION_ERROR_19c00318}, + {"VUID-vkCmdDispatch-None-00397", VALIDATION_ERROR_19c0031a}, + {"VUID-vkCmdDispatch-linearTilingFeatures-00398", VALIDATION_ERROR_19c0031c}, + {"VUID-vkCmdDispatch-linearTilingFeatures-00399", VALIDATION_ERROR_19c0031e}, + {"VUID-vkCmdDispatch-None-00400", VALIDATION_ERROR_19c00320}, + {"VUID-vkCmdDispatch-commandBuffer-01844", VALIDATION_ERROR_19c00e68}, + {"VUID-vkCmdDispatch-commandBuffer-01845", VALIDATION_ERROR_19c00e6a}, + {"VUID-vkCmdDispatch-commandBuffer-01846", VALIDATION_ERROR_19c00e6c}, + {"VUID-vkCmdDispatch-commandBuffer-parameter", VALIDATION_ERROR_19c02401}, + {"VUID-vkCmdDispatch-commandBuffer-recording", VALIDATION_ERROR_19c02413}, + {"VUID-vkCmdDispatch-commandBuffer-cmdpool", VALIDATION_ERROR_19c02415}, + {"VUID-vkCmdDispatchBase-renderpass", VALIDATION_ERROR_19e00017}, + {"VUID-vkCmdDispatchBase-None-00420", VALIDATION_ERROR_19e00348}, + {"VUID-vkCmdDispatchBase-baseGroupX-00421", VALIDATION_ERROR_19e0034a}, + {"VUID-vkCmdDispatchBase-baseGroupX-00422", VALIDATION_ERROR_19e0034c}, + {"VUID-vkCmdDispatchBase-baseGroupZ-00423", VALIDATION_ERROR_19e0034e}, + {"VUID-vkCmdDispatchBase-groupCountX-00424", VALIDATION_ERROR_19e00350}, + {"VUID-vkCmdDispatchBase-groupCountY-00425", VALIDATION_ERROR_19e00352}, + {"VUID-vkCmdDispatchBase-groupCountZ-00426", VALIDATION_ERROR_19e00354}, + {"VUID-vkCmdDispatchBase-baseGroupX-00427", VALIDATION_ERROR_19e00356}, + {"VUID-vkCmdDispatchBase-commandBuffer-parameter", VALIDATION_ERROR_19e02401}, + {"VUID-vkCmdDispatchBase-commandBuffer-recording", VALIDATION_ERROR_19e02413}, + {"VUID-vkCmdDispatchBase-commandBuffer-cmdpool", VALIDATION_ERROR_19e02415}, + {"VUID-vkCmdDispatchIndirect-commonparent", VALIDATION_ERROR_1a000009}, + {"VUID-vkCmdDispatchIndirect-renderpass", VALIDATION_ERROR_1a000017}, + {"VUID-vkCmdDispatchIndirect-buffer-00401", VALIDATION_ERROR_1a000322}, + {"VUID-vkCmdDispatchIndirect-None-00402", VALIDATION_ERROR_1a000324}, + {"VUID-vkCmdDispatchIndirect-None-00403", VALIDATION_ERROR_1a000326}, + {"VUID-vkCmdDispatchIndirect-None-00404", VALIDATION_ERROR_1a000328}, + {"VUID-vkCmdDispatchIndirect-buffer-00405", VALIDATION_ERROR_1a00032a}, + {"VUID-vkCmdDispatchIndirect-offset-00406", VALIDATION_ERROR_1a00032c}, + {"VUID-vkCmdDispatchIndirect-offset-00407", VALIDATION_ERROR_1a00032e}, + {"VUID-vkCmdDispatchIndirect-None-00408", VALIDATION_ERROR_1a000330}, + {"VUID-vkCmdDispatchIndirect-None-00409", VALIDATION_ERROR_1a000332}, + {"VUID-vkCmdDispatchIndirect-None-00410", VALIDATION_ERROR_1a000334}, + {"VUID-vkCmdDispatchIndirect-None-00411", VALIDATION_ERROR_1a000336}, + {"VUID-vkCmdDispatchIndirect-None-00412", VALIDATION_ERROR_1a000338}, + {"VUID-vkCmdDispatchIndirect-None-00413", VALIDATION_ERROR_1a00033a}, + {"VUID-vkCmdDispatchIndirect-linearTilingFeatures-00414", VALIDATION_ERROR_1a00033c}, + {"VUID-vkCmdDispatchIndirect-linearTilingFeatures-00415", VALIDATION_ERROR_1a00033e}, + {"VUID-vkCmdDispatchIndirect-None-00416", VALIDATION_ERROR_1a000340}, + {"VUID-vkCmdDispatchIndirect-commandBuffer-01847", VALIDATION_ERROR_1a000e6e}, + {"VUID-vkCmdDispatchIndirect-commandBuffer-01848", VALIDATION_ERROR_1a000e70}, + {"VUID-vkCmdDispatchIndirect-commandBuffer-01849", VALIDATION_ERROR_1a000e72}, + {"VUID-vkCmdDispatchIndirect-buffer-parameter", VALIDATION_ERROR_1a001a01}, + {"VUID-vkCmdDispatchIndirect-commandBuffer-parameter", VALIDATION_ERROR_1a002401}, + {"VUID-vkCmdDispatchIndirect-commandBuffer-recording", VALIDATION_ERROR_1a002413}, + {"VUID-vkCmdDispatchIndirect-commandBuffer-cmdpool", VALIDATION_ERROR_1a002415}, + {"VUID-vkCmdDraw-renderpass", VALIDATION_ERROR_1a200017}, + {"VUID-vkCmdDraw-renderPass-00435", VALIDATION_ERROR_1a200366}, + {"VUID-vkCmdDraw-subpass-00436", VALIDATION_ERROR_1a200368}, + {"VUID-vkCmdDraw-None-00437", VALIDATION_ERROR_1a20036a}, + {"VUID-vkCmdDraw-None-00438", VALIDATION_ERROR_1a20036c}, + {"VUID-vkCmdDraw-None-00439", VALIDATION_ERROR_1a20036e}, + {"VUID-vkCmdDraw-None-00440", VALIDATION_ERROR_1a200370}, + {"VUID-vkCmdDraw-None-00441", VALIDATION_ERROR_1a200372}, + {"VUID-vkCmdDraw-None-00442", VALIDATION_ERROR_1a200374}, + {"VUID-vkCmdDraw-None-00443", VALIDATION_ERROR_1a200376}, + {"VUID-vkCmdDraw-None-00444", VALIDATION_ERROR_1a200378}, + {"VUID-vkCmdDraw-None-00445", VALIDATION_ERROR_1a20037a}, + {"VUID-vkCmdDraw-None-00446", VALIDATION_ERROR_1a20037c}, + {"VUID-vkCmdDraw-None-00447", VALIDATION_ERROR_1a20037e}, + {"VUID-vkCmdDraw-None-00448", VALIDATION_ERROR_1a200380}, + {"VUID-vkCmdDraw-None-00449", VALIDATION_ERROR_1a200382}, + {"VUID-vkCmdDraw-linearTilingFeatures-00450", VALIDATION_ERROR_1a200384}, + {"VUID-vkCmdDraw-linearTilingFeatures-00451", VALIDATION_ERROR_1a200386}, + {"VUID-vkCmdDraw-None-00452", VALIDATION_ERROR_1a200388}, + {"VUID-vkCmdDraw-maxMultiviewInstanceIndex-00453", VALIDATION_ERROR_1a20038a}, + {"VUID-vkCmdDraw-None-01499", VALIDATION_ERROR_1a200bb6}, + {"VUID-vkCmdDraw-sampleLocationsEnable-01512", VALIDATION_ERROR_1a200bd0}, + {"VUID-vkCmdDraw-commandBuffer-01850", VALIDATION_ERROR_1a200e74}, + {"VUID-vkCmdDraw-commandBuffer-01851", VALIDATION_ERROR_1a200e76}, + {"VUID-vkCmdDraw-commandBuffer-01852", VALIDATION_ERROR_1a200e78}, + {"VUID-vkCmdDraw-commandBuffer-parameter", VALIDATION_ERROR_1a202401}, + {"VUID-vkCmdDraw-commandBuffer-recording", VALIDATION_ERROR_1a202413}, + {"VUID-vkCmdDraw-commandBuffer-cmdpool", VALIDATION_ERROR_1a202415}, + {"VUID-vkCmdDrawIndexed-renderpass", VALIDATION_ERROR_1a400017}, + {"VUID-vkCmdDrawIndexed-renderPass-00454", VALIDATION_ERROR_1a40038c}, + {"VUID-vkCmdDrawIndexed-subpass-00455", VALIDATION_ERROR_1a40038e}, + {"VUID-vkCmdDrawIndexed-None-00456", VALIDATION_ERROR_1a400390}, + {"VUID-vkCmdDrawIndexed-None-00457", VALIDATION_ERROR_1a400392}, + {"VUID-vkCmdDrawIndexed-None-00458", VALIDATION_ERROR_1a400394}, + {"VUID-vkCmdDrawIndexed-None-00459", VALIDATION_ERROR_1a400396}, + {"VUID-vkCmdDrawIndexed-None-00460", VALIDATION_ERROR_1a400398}, + {"VUID-vkCmdDrawIndexed-None-00461", VALIDATION_ERROR_1a40039a}, + {"VUID-vkCmdDrawIndexed-None-00462", VALIDATION_ERROR_1a40039c}, + {"VUID-vkCmdDrawIndexed-indexSize-00463", VALIDATION_ERROR_1a40039e}, + {"VUID-vkCmdDrawIndexed-None-00464", VALIDATION_ERROR_1a4003a0}, + {"VUID-vkCmdDrawIndexed-None-00465", VALIDATION_ERROR_1a4003a2}, + {"VUID-vkCmdDrawIndexed-None-00466", VALIDATION_ERROR_1a4003a4}, + {"VUID-vkCmdDrawIndexed-None-00467", VALIDATION_ERROR_1a4003a6}, + {"VUID-vkCmdDrawIndexed-None-00468", VALIDATION_ERROR_1a4003a8}, + {"VUID-vkCmdDrawIndexed-None-00469", VALIDATION_ERROR_1a4003aa}, + {"VUID-vkCmdDrawIndexed-linearTilingFeatures-00470", VALIDATION_ERROR_1a4003ac}, + {"VUID-vkCmdDrawIndexed-linearTilingFeatures-00471", VALIDATION_ERROR_1a4003ae}, + {"VUID-vkCmdDrawIndexed-None-00472", VALIDATION_ERROR_1a4003b0}, + {"VUID-vkCmdDrawIndexed-maxMultiviewInstanceIndex-00473", VALIDATION_ERROR_1a4003b2}, + {"VUID-vkCmdDrawIndexed-None-01500", VALIDATION_ERROR_1a400bb8}, + {"VUID-vkCmdDrawIndexed-sampleLocationsEnable-01513", VALIDATION_ERROR_1a400bd2}, + {"VUID-vkCmdDrawIndexed-commandBuffer-01853", VALIDATION_ERROR_1a400e7a}, + {"VUID-vkCmdDrawIndexed-commandBuffer-01854", VALIDATION_ERROR_1a400e7c}, + {"VUID-vkCmdDrawIndexed-commandBuffer-01855", VALIDATION_ERROR_1a400e7e}, + {"VUID-vkCmdDrawIndexed-commandBuffer-parameter", VALIDATION_ERROR_1a402401}, + {"VUID-vkCmdDrawIndexed-commandBuffer-recording", VALIDATION_ERROR_1a402413}, + {"VUID-vkCmdDrawIndexed-commandBuffer-cmdpool", VALIDATION_ERROR_1a402415}, + {"VUID-vkCmdDrawIndexedIndirect-commonparent", VALIDATION_ERROR_1a600009}, + {"VUID-vkCmdDrawIndexedIndirect-renderpass", VALIDATION_ERROR_1a600017}, + {"VUID-vkCmdDrawIndexedIndirect-buffer-00526", VALIDATION_ERROR_1a60041c}, + {"VUID-vkCmdDrawIndexedIndirect-offset-00527", VALIDATION_ERROR_1a60041e}, + {"VUID-vkCmdDrawIndexedIndirect-drawCount-00528", VALIDATION_ERROR_1a600420}, + {"VUID-vkCmdDrawIndexedIndirect-drawCount-00529", VALIDATION_ERROR_1a600422}, + {"VUID-vkCmdDrawIndexedIndirect-firstInstance-00530", VALIDATION_ERROR_1a600424}, + {"VUID-vkCmdDrawIndexedIndirect-renderPass-00531", VALIDATION_ERROR_1a600426}, + {"VUID-vkCmdDrawIndexedIndirect-subpass-00532", VALIDATION_ERROR_1a600428}, + {"VUID-vkCmdDrawIndexedIndirect-None-00533", VALIDATION_ERROR_1a60042a}, + {"VUID-vkCmdDrawIndexedIndirect-None-00534", VALIDATION_ERROR_1a60042c}, + {"VUID-vkCmdDrawIndexedIndirect-None-00535", VALIDATION_ERROR_1a60042e}, + {"VUID-vkCmdDrawIndexedIndirect-None-00536", VALIDATION_ERROR_1a600430}, + {"VUID-vkCmdDrawIndexedIndirect-None-00537", VALIDATION_ERROR_1a600432}, + {"VUID-vkCmdDrawIndexedIndirect-None-00538", VALIDATION_ERROR_1a600434}, + {"VUID-vkCmdDrawIndexedIndirect-drawCount-00539", VALIDATION_ERROR_1a600436}, + {"VUID-vkCmdDrawIndexedIndirect-drawCount-00540", VALIDATION_ERROR_1a600438}, + {"VUID-vkCmdDrawIndexedIndirect-drawCount-00541", VALIDATION_ERROR_1a60043a}, + {"VUID-vkCmdDrawIndexedIndirect-None-00542", VALIDATION_ERROR_1a60043c}, + {"VUID-vkCmdDrawIndexedIndirect-None-00543", VALIDATION_ERROR_1a60043e}, + {"VUID-vkCmdDrawIndexedIndirect-None-00544", VALIDATION_ERROR_1a600440}, + {"VUID-vkCmdDrawIndexedIndirect-None-00545", VALIDATION_ERROR_1a600442}, + {"VUID-vkCmdDrawIndexedIndirect-None-00546", VALIDATION_ERROR_1a600444}, + {"VUID-vkCmdDrawIndexedIndirect-None-00547", VALIDATION_ERROR_1a600446}, + {"VUID-vkCmdDrawIndexedIndirect-linearTilingFeatures-00548", VALIDATION_ERROR_1a600448}, + {"VUID-vkCmdDrawIndexedIndirect-linearTilingFeatures-00549", VALIDATION_ERROR_1a60044a}, + {"VUID-vkCmdDrawIndexedIndirect-None-00550", VALIDATION_ERROR_1a60044c}, + {"VUID-vkCmdDrawIndexedIndirect-maxMultiviewInstanceIndex-00551", VALIDATION_ERROR_1a60044e}, + {"VUID-vkCmdDrawIndexedIndirect-None-01503", VALIDATION_ERROR_1a600bbe}, + {"VUID-vkCmdDrawIndexedIndirect-sampleLocationsEnable-01516", VALIDATION_ERROR_1a600bd8}, + {"VUID-vkCmdDrawIndexedIndirect-buffer-01665", VALIDATION_ERROR_1a600d02}, + {"VUID-vkCmdDrawIndexedIndirect-commandBuffer-01862", VALIDATION_ERROR_1a600e8c}, + {"VUID-vkCmdDrawIndexedIndirect-commandBuffer-01863", VALIDATION_ERROR_1a600e8e}, + {"VUID-vkCmdDrawIndexedIndirect-commandBuffer-01864", VALIDATION_ERROR_1a600e90}, + {"VUID-vkCmdDrawIndexedIndirect-buffer-parameter", VALIDATION_ERROR_1a601a01}, + {"VUID-vkCmdDrawIndexedIndirect-commandBuffer-parameter", VALIDATION_ERROR_1a602401}, + {"VUID-vkCmdDrawIndexedIndirect-commandBuffer-recording", VALIDATION_ERROR_1a602413}, + {"VUID-vkCmdDrawIndexedIndirect-commandBuffer-cmdpool", VALIDATION_ERROR_1a602415}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-commonparent", VALIDATION_ERROR_1a800009}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-renderpass", VALIDATION_ERROR_1a800017}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-offset-00555", VALIDATION_ERROR_1a800456}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-countBufferOffset-00556", VALIDATION_ERROR_1a800458}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-stride-00557", VALIDATION_ERROR_1a80045a}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-maxDrawCount-00558", VALIDATION_ERROR_1a80045c}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-firstInstance-00559", VALIDATION_ERROR_1a80045e}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-renderPass-00560", VALIDATION_ERROR_1a800460}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-subpass-00561", VALIDATION_ERROR_1a800462}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-None-00562", VALIDATION_ERROR_1a800464}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-None-00563", VALIDATION_ERROR_1a800466}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-None-00564", VALIDATION_ERROR_1a800468}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-None-00565", VALIDATION_ERROR_1a80046a}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-None-00566", VALIDATION_ERROR_1a80046c}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-None-00567", VALIDATION_ERROR_1a80046e}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-00568", VALIDATION_ERROR_1a800470}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-00569", VALIDATION_ERROR_1a800472}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-drawCount-00570", VALIDATION_ERROR_1a800474}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-None-00571", VALIDATION_ERROR_1a800476}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-None-00572", VALIDATION_ERROR_1a800478}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-None-00573", VALIDATION_ERROR_1a80047a}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-None-00574", VALIDATION_ERROR_1a80047c}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-None-00575", VALIDATION_ERROR_1a80047e}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-None-00576", VALIDATION_ERROR_1a800480}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-linearTilingFeatures-00577", VALIDATION_ERROR_1a800482}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-maxMultiviewInstanceIndex-00578", VALIDATION_ERROR_1a800484}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-None-01504", VALIDATION_ERROR_1a800bc0}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-sampleLocationsEnable-01517", VALIDATION_ERROR_1a800bda}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-01666", VALIDATION_ERROR_1a800d04}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-01667", VALIDATION_ERROR_1a800d06}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-01668", VALIDATION_ERROR_1a800d08}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-01669", VALIDATION_ERROR_1a800d0a}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-01865", VALIDATION_ERROR_1a800e92}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-01866", VALIDATION_ERROR_1a800e94}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-01867", VALIDATION_ERROR_1a800e96}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-parameter", VALIDATION_ERROR_1a801a01}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-parameter", VALIDATION_ERROR_1a802401}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-recording", VALIDATION_ERROR_1a802413}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-cmdpool", VALIDATION_ERROR_1a802415}, + {"VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-parameter", VALIDATION_ERROR_1a803401}, + {"VUID-vkCmdDrawIndirect-commonparent", VALIDATION_ERROR_1aa00009}, + {"VUID-vkCmdDrawIndirect-renderpass", VALIDATION_ERROR_1aa00017}, + {"VUID-vkCmdDrawIndirect-buffer-00474", VALIDATION_ERROR_1aa003b4}, + {"VUID-vkCmdDrawIndirect-offset-00475", VALIDATION_ERROR_1aa003b6}, + {"VUID-vkCmdDrawIndirect-drawCount-00476", VALIDATION_ERROR_1aa003b8}, + {"VUID-vkCmdDrawIndirect-drawCount-00477", VALIDATION_ERROR_1aa003ba}, + {"VUID-vkCmdDrawIndirect-firstInstance-00478", VALIDATION_ERROR_1aa003bc}, + {"VUID-vkCmdDrawIndirect-renderPass-00479", VALIDATION_ERROR_1aa003be}, + {"VUID-vkCmdDrawIndirect-subpass-00480", VALIDATION_ERROR_1aa003c0}, + {"VUID-vkCmdDrawIndirect-None-00481", VALIDATION_ERROR_1aa003c2}, + {"VUID-vkCmdDrawIndirect-None-00482", VALIDATION_ERROR_1aa003c4}, + {"VUID-vkCmdDrawIndirect-None-00483", VALIDATION_ERROR_1aa003c6}, + {"VUID-vkCmdDrawIndirect-None-00484", VALIDATION_ERROR_1aa003c8}, + {"VUID-vkCmdDrawIndirect-None-00485", VALIDATION_ERROR_1aa003ca}, + {"VUID-vkCmdDrawIndirect-None-00486", VALIDATION_ERROR_1aa003cc}, + {"VUID-vkCmdDrawIndirect-drawCount-00487", VALIDATION_ERROR_1aa003ce}, + {"VUID-vkCmdDrawIndirect-drawCount-00488", VALIDATION_ERROR_1aa003d0}, + {"VUID-vkCmdDrawIndirect-drawCount-00489", VALIDATION_ERROR_1aa003d2}, + {"VUID-vkCmdDrawIndirect-None-00490", VALIDATION_ERROR_1aa003d4}, + {"VUID-vkCmdDrawIndirect-None-00491", VALIDATION_ERROR_1aa003d6}, + {"VUID-vkCmdDrawIndirect-None-00492", VALIDATION_ERROR_1aa003d8}, + {"VUID-vkCmdDrawIndirect-None-00493", VALIDATION_ERROR_1aa003da}, + {"VUID-vkCmdDrawIndirect-None-00494", VALIDATION_ERROR_1aa003dc}, + {"VUID-vkCmdDrawIndirect-None-00495", VALIDATION_ERROR_1aa003de}, + {"VUID-vkCmdDrawIndirect-linearTilingFeatures-00496", VALIDATION_ERROR_1aa003e0}, + {"VUID-vkCmdDrawIndirect-linearTilingFeatures-00497", VALIDATION_ERROR_1aa003e2}, + {"VUID-vkCmdDrawIndirect-None-00498", VALIDATION_ERROR_1aa003e4}, + {"VUID-vkCmdDrawIndirect-maxMultiviewInstanceIndex-00499", VALIDATION_ERROR_1aa003e6}, + {"VUID-vkCmdDrawIndirect-None-01501", VALIDATION_ERROR_1aa00bba}, + {"VUID-vkCmdDrawIndirect-sampleLocationsEnable-01514", VALIDATION_ERROR_1aa00bd4}, + {"VUID-vkCmdDrawIndirect-buffer-01660", VALIDATION_ERROR_1aa00cf8}, + {"VUID-vkCmdDrawIndirect-commandBuffer-01856", VALIDATION_ERROR_1aa00e80}, + {"VUID-vkCmdDrawIndirect-commandBuffer-01857", VALIDATION_ERROR_1aa00e82}, + {"VUID-vkCmdDrawIndirect-commandBuffer-01858", VALIDATION_ERROR_1aa00e84}, + {"VUID-vkCmdDrawIndirect-buffer-parameter", VALIDATION_ERROR_1aa01a01}, + {"VUID-vkCmdDrawIndirect-commandBuffer-parameter", VALIDATION_ERROR_1aa02401}, + {"VUID-vkCmdDrawIndirect-commandBuffer-recording", VALIDATION_ERROR_1aa02413}, + {"VUID-vkCmdDrawIndirect-commandBuffer-cmdpool", VALIDATION_ERROR_1aa02415}, + {"VUID-vkCmdDrawIndirectCountAMD-commonparent", VALIDATION_ERROR_1ac00009}, + {"VUID-vkCmdDrawIndirectCountAMD-renderpass", VALIDATION_ERROR_1ac00017}, + {"VUID-vkCmdDrawIndirectCountAMD-offset-00502", VALIDATION_ERROR_1ac003ec}, + {"VUID-vkCmdDrawIndirectCountAMD-countBufferOffset-00503", VALIDATION_ERROR_1ac003ee}, + {"VUID-vkCmdDrawIndirectCountAMD-stride-00504", VALIDATION_ERROR_1ac003f0}, + {"VUID-vkCmdDrawIndirectCountAMD-maxDrawCount-00505", VALIDATION_ERROR_1ac003f2}, + {"VUID-vkCmdDrawIndirectCountAMD-firstInstance-00506", VALIDATION_ERROR_1ac003f4}, + {"VUID-vkCmdDrawIndirectCountAMD-renderPass-00507", VALIDATION_ERROR_1ac003f6}, + {"VUID-vkCmdDrawIndirectCountAMD-subpass-00508", VALIDATION_ERROR_1ac003f8}, + {"VUID-vkCmdDrawIndirectCountAMD-None-00509", VALIDATION_ERROR_1ac003fa}, + {"VUID-vkCmdDrawIndirectCountAMD-None-00510", VALIDATION_ERROR_1ac003fc}, + {"VUID-vkCmdDrawIndirectCountAMD-None-00511", VALIDATION_ERROR_1ac003fe}, + {"VUID-vkCmdDrawIndirectCountAMD-None-00512", VALIDATION_ERROR_1ac00400}, + {"VUID-vkCmdDrawIndirectCountAMD-None-00513", VALIDATION_ERROR_1ac00402}, + {"VUID-vkCmdDrawIndirectCountAMD-None-00514", VALIDATION_ERROR_1ac00404}, + {"VUID-vkCmdDrawIndirectCountAMD-countBuffer-00515", VALIDATION_ERROR_1ac00406}, + {"VUID-vkCmdDrawIndirectCountAMD-countBuffer-00516", VALIDATION_ERROR_1ac00408}, + {"VUID-vkCmdDrawIndirectCountAMD-countBuffer-00517", VALIDATION_ERROR_1ac0040a}, + {"VUID-vkCmdDrawIndirectCountAMD-None-00518", VALIDATION_ERROR_1ac0040c}, + {"VUID-vkCmdDrawIndirectCountAMD-None-00519", VALIDATION_ERROR_1ac0040e}, + {"VUID-vkCmdDrawIndirectCountAMD-None-00520", VALIDATION_ERROR_1ac00410}, + {"VUID-vkCmdDrawIndirectCountAMD-None-00521", VALIDATION_ERROR_1ac00412}, + {"VUID-vkCmdDrawIndirectCountAMD-None-00522", VALIDATION_ERROR_1ac00414}, + {"VUID-vkCmdDrawIndirectCountAMD-None-00523", VALIDATION_ERROR_1ac00416}, + {"VUID-vkCmdDrawIndirectCountAMD-linearTilingFeatures-00524", VALIDATION_ERROR_1ac00418}, + {"VUID-vkCmdDrawIndirectCountAMD-maxMultiviewInstanceIndex-00525", VALIDATION_ERROR_1ac0041a}, + {"VUID-vkCmdDrawIndirectCountAMD-None-01502", VALIDATION_ERROR_1ac00bbc}, + {"VUID-vkCmdDrawIndirectCountAMD-sampleLocationsEnable-01515", VALIDATION_ERROR_1ac00bd6}, + {"VUID-vkCmdDrawIndirectCountAMD-buffer-01661", VALIDATION_ERROR_1ac00cfa}, + {"VUID-vkCmdDrawIndirectCountAMD-buffer-01662", VALIDATION_ERROR_1ac00cfc}, + {"VUID-vkCmdDrawIndirectCountAMD-countBuffer-01663", VALIDATION_ERROR_1ac00cfe}, + {"VUID-vkCmdDrawIndirectCountAMD-countBuffer-01664", VALIDATION_ERROR_1ac00d00}, + {"VUID-vkCmdDrawIndirectCountAMD-commandBuffer-01859", VALIDATION_ERROR_1ac00e86}, + {"VUID-vkCmdDrawIndirectCountAMD-commandBuffer-01860", VALIDATION_ERROR_1ac00e88}, + {"VUID-vkCmdDrawIndirectCountAMD-commandBuffer-01861", VALIDATION_ERROR_1ac00e8a}, + {"VUID-vkCmdDrawIndirectCountAMD-buffer-parameter", VALIDATION_ERROR_1ac01a01}, + {"VUID-vkCmdDrawIndirectCountAMD-commandBuffer-parameter", VALIDATION_ERROR_1ac02401}, + {"VUID-vkCmdDrawIndirectCountAMD-commandBuffer-recording", VALIDATION_ERROR_1ac02413}, + {"VUID-vkCmdDrawIndirectCountAMD-commandBuffer-cmdpool", VALIDATION_ERROR_1ac02415}, + {"VUID-vkCmdDrawIndirectCountAMD-countBuffer-parameter", VALIDATION_ERROR_1ac03401}, + {"VUID-vkCmdEndQuery-commonparent", VALIDATION_ERROR_1ae00009}, + {"VUID-vkCmdEndQuery-query-00810", VALIDATION_ERROR_1ae00654}, + {"VUID-vkCmdEndQuery-query-00812", VALIDATION_ERROR_1ae00658}, + {"VUID-vkCmdEndQuery-commandBuffer-01886", VALIDATION_ERROR_1ae00ebc}, + {"VUID-vkCmdEndQuery-None-01923", VALIDATION_ERROR_1ae00f06}, + {"VUID-vkCmdEndQuery-commandBuffer-parameter", VALIDATION_ERROR_1ae02401}, + {"VUID-vkCmdEndQuery-commandBuffer-recording", VALIDATION_ERROR_1ae02413}, + {"VUID-vkCmdEndQuery-commandBuffer-cmdpool", VALIDATION_ERROR_1ae02415}, + {"VUID-vkCmdEndQuery-queryPool-parameter", VALIDATION_ERROR_1ae29801}, + {"VUID-vkCmdEndRenderPass-renderpass", VALIDATION_ERROR_1b000017}, + {"VUID-vkCmdEndRenderPass-bufferlevel", VALIDATION_ERROR_1b000019}, + {"VUID-vkCmdEndRenderPass-None-00910", VALIDATION_ERROR_1b00071c}, + {"VUID-vkCmdEndRenderPass-commandBuffer-parameter", VALIDATION_ERROR_1b002401}, + {"VUID-vkCmdEndRenderPass-commandBuffer-recording", VALIDATION_ERROR_1b002413}, + {"VUID-vkCmdEndRenderPass-commandBuffer-cmdpool", VALIDATION_ERROR_1b002415}, + {"VUID-vkCmdExecuteCommands-commonparent", VALIDATION_ERROR_1b200009}, + {"VUID-vkCmdExecuteCommands-bufferlevel", VALIDATION_ERROR_1b200019}, + {"VUID-vkCmdExecuteCommands-commandBuffer-00087", VALIDATION_ERROR_1b2000ae}, + {"VUID-vkCmdExecuteCommands-pCommandBuffers-00088", VALIDATION_ERROR_1b2000b0}, + {"VUID-vkCmdExecuteCommands-pCommandBuffers-00089", VALIDATION_ERROR_1b2000b2}, + {"VUID-vkCmdExecuteCommands-pCommandBuffers-00090", VALIDATION_ERROR_1b2000b4}, + {"VUID-vkCmdExecuteCommands-pCommandBuffers-00091", VALIDATION_ERROR_1b2000b6}, + {"VUID-vkCmdExecuteCommands-pCommandBuffers-00092", VALIDATION_ERROR_1b2000b8}, + {"VUID-vkCmdExecuteCommands-pCommandBuffers-00093", VALIDATION_ERROR_1b2000ba}, + {"VUID-vkCmdExecuteCommands-pCommandBuffers-00094", VALIDATION_ERROR_1b2000bc}, + {"VUID-vkCmdExecuteCommands-contents-00095", VALIDATION_ERROR_1b2000be}, + {"VUID-vkCmdExecuteCommands-pCommandBuffers-00096", VALIDATION_ERROR_1b2000c0}, + {"VUID-vkCmdExecuteCommands-pCommandBuffers-00097", VALIDATION_ERROR_1b2000c2}, + {"VUID-vkCmdExecuteCommands-pInheritanceInfo-00098", VALIDATION_ERROR_1b2000c4}, + {"VUID-vkCmdExecuteCommands-pCommandBuffers-00099", VALIDATION_ERROR_1b2000c6}, + {"VUID-vkCmdExecuteCommands-pCommandBuffers-00100", VALIDATION_ERROR_1b2000c8}, + {"VUID-vkCmdExecuteCommands-commandBuffer-00101", VALIDATION_ERROR_1b2000ca}, + {"VUID-vkCmdExecuteCommands-commandBuffer-00102", VALIDATION_ERROR_1b2000cc}, + {"VUID-vkCmdExecuteCommands-commandBuffer-00103", VALIDATION_ERROR_1b2000ce}, + {"VUID-vkCmdExecuteCommands-commandBuffer-00104", VALIDATION_ERROR_1b2000d0}, + {"VUID-vkCmdExecuteCommands-pCommandBuffers-00105", VALIDATION_ERROR_1b2000d2}, + {"VUID-vkCmdExecuteCommands-commandBuffer-01820", VALIDATION_ERROR_1b200e38}, + {"VUID-vkCmdExecuteCommands-commandBuffer-01821", VALIDATION_ERROR_1b200e3a}, + {"VUID-vkCmdExecuteCommands-commandBuffer-parameter", VALIDATION_ERROR_1b202401}, + {"VUID-vkCmdExecuteCommands-commandBuffer-recording", VALIDATION_ERROR_1b202413}, + {"VUID-vkCmdExecuteCommands-commandBuffer-cmdpool", VALIDATION_ERROR_1b202415}, + {"VUID-vkCmdExecuteCommands-commandBufferCount-arraylength", VALIDATION_ERROR_1b20261b}, + {"VUID-vkCmdExecuteCommands-pCommandBuffers-parameter", VALIDATION_ERROR_1b211401}, + {"VUID-vkCmdFillBuffer-commonparent", VALIDATION_ERROR_1b400009}, + {"VUID-vkCmdFillBuffer-renderpass", VALIDATION_ERROR_1b400017}, + {"VUID-vkCmdFillBuffer-dstOffset-00024", VALIDATION_ERROR_1b400030}, + {"VUID-vkCmdFillBuffer-dstOffset-00025", VALIDATION_ERROR_1b400032}, + {"VUID-vkCmdFillBuffer-size-00026", VALIDATION_ERROR_1b400034}, + {"VUID-vkCmdFillBuffer-size-00027", VALIDATION_ERROR_1b400036}, + {"VUID-vkCmdFillBuffer-size-00028", VALIDATION_ERROR_1b400038}, + {"VUID-vkCmdFillBuffer-dstBuffer-00029", VALIDATION_ERROR_1b40003a}, + {"VUID-vkCmdFillBuffer-commandBuffer-00030", VALIDATION_ERROR_1b40003c}, + {"VUID-vkCmdFillBuffer-dstBuffer-00031", VALIDATION_ERROR_1b40003e}, + {"VUID-vkCmdFillBuffer-commandBuffer-01811", VALIDATION_ERROR_1b400e26}, + {"VUID-vkCmdFillBuffer-commandBuffer-01812", VALIDATION_ERROR_1b400e28}, + {"VUID-vkCmdFillBuffer-commandBuffer-parameter", VALIDATION_ERROR_1b402401}, + {"VUID-vkCmdFillBuffer-commandBuffer-recording", VALIDATION_ERROR_1b402413}, + {"VUID-vkCmdFillBuffer-commandBuffer-cmdpool", VALIDATION_ERROR_1b402415}, + {"VUID-vkCmdFillBuffer-dstBuffer-parameter", VALIDATION_ERROR_1b406c01}, + {"VUID-vkCmdNextSubpass-renderpass", VALIDATION_ERROR_1b600017}, + {"VUID-vkCmdNextSubpass-bufferlevel", VALIDATION_ERROR_1b600019}, + {"VUID-vkCmdNextSubpass-None-00909", VALIDATION_ERROR_1b60071a}, + {"VUID-vkCmdNextSubpass-commandBuffer-parameter", VALIDATION_ERROR_1b602401}, + {"VUID-vkCmdNextSubpass-commandBuffer-recording", VALIDATION_ERROR_1b602413}, + {"VUID-vkCmdNextSubpass-commandBuffer-cmdpool", VALIDATION_ERROR_1b602415}, + {"VUID-vkCmdNextSubpass-contents-parameter", VALIDATION_ERROR_1b603201}, + {"VUID-vkCmdPipelineBarrier-srcStageMask-01168", VALIDATION_ERROR_1b800920}, + {"VUID-vkCmdPipelineBarrier-dstStageMask-01169", VALIDATION_ERROR_1b800922}, + {"VUID-vkCmdPipelineBarrier-srcStageMask-01170", VALIDATION_ERROR_1b800924}, + {"VUID-vkCmdPipelineBarrier-dstStageMask-01171", VALIDATION_ERROR_1b800926}, + {"VUID-vkCmdPipelineBarrier-pDependencies-01172", VALIDATION_ERROR_1b800928}, + {"VUID-vkCmdPipelineBarrier-srcStageMask-01173", VALIDATION_ERROR_1b80092a}, + {"VUID-vkCmdPipelineBarrier-dstStageMask-01174", VALIDATION_ERROR_1b80092c}, + {"VUID-vkCmdPipelineBarrier-srcAccessMask-01175", VALIDATION_ERROR_1b80092e}, + {"VUID-vkCmdPipelineBarrier-dstAccessMask-01176", VALIDATION_ERROR_1b800930}, + {"VUID-vkCmdPipelineBarrier-dependencyFlags-01177", VALIDATION_ERROR_1b800932}, + {"VUID-vkCmdPipelineBarrier-bufferMemoryBarrierCount-01178", VALIDATION_ERROR_1b800934}, + {"VUID-vkCmdPipelineBarrier-image-01179", VALIDATION_ERROR_1b800936}, + {"VUID-vkCmdPipelineBarrier-oldLayout-01180", VALIDATION_ERROR_1b800938}, + {"VUID-vkCmdPipelineBarrier-oldLayout-01181", VALIDATION_ERROR_1b80093a}, + {"VUID-vkCmdPipelineBarrier-srcQueueFamilyIndex-01182", VALIDATION_ERROR_1b80093c}, + {"VUID-vkCmdPipelineBarrier-srcStageMask-01183", VALIDATION_ERROR_1b80093e}, + {"VUID-vkCmdPipelineBarrier-pMemoryBarriers-01184", VALIDATION_ERROR_1b800940}, + {"VUID-vkCmdPipelineBarrier-pMemoryBarriers-01185", VALIDATION_ERROR_1b800942}, + {"VUID-vkCmdPipelineBarrier-dependencyFlags-01186", VALIDATION_ERROR_1b800944}, + {"VUID-vkCmdPipelineBarrier-commandBuffer-parameter", VALIDATION_ERROR_1b802401}, + {"VUID-vkCmdPipelineBarrier-commandBuffer-recording", VALIDATION_ERROR_1b802413}, + {"VUID-vkCmdPipelineBarrier-commandBuffer-cmdpool", VALIDATION_ERROR_1b802415}, + {"VUID-vkCmdPipelineBarrier-dependencyFlags-parameter", VALIDATION_ERROR_1b803e01}, + {"VUID-vkCmdPipelineBarrier-dstStageMask-parameter", VALIDATION_ERROR_1b807801}, + {"VUID-vkCmdPipelineBarrier-dstStageMask-requiredbitmask", VALIDATION_ERROR_1b807803}, + {"VUID-vkCmdPipelineBarrier-pBufferMemoryBarriers-parameter", VALIDATION_ERROR_1b810401}, + {"VUID-vkCmdPipelineBarrier-pImageMemoryBarriers-parameter", VALIDATION_ERROR_1b818a01}, + {"VUID-vkCmdPipelineBarrier-pMemoryBarriers-parameter", VALIDATION_ERROR_1b81ac01}, + {"VUID-vkCmdPipelineBarrier-srcStageMask-parameter", VALIDATION_ERROR_1b82d401}, + {"VUID-vkCmdPipelineBarrier-srcStageMask-requiredbitmask", VALIDATION_ERROR_1b82d403}, + {"VUID-vkCmdProcessCommandsNVX-renderpass", VALIDATION_ERROR_1ba00017}, + {"VUID-vkCmdProcessCommandsNVX-commandBuffer-parameter", VALIDATION_ERROR_1ba02401}, + {"VUID-vkCmdProcessCommandsNVX-commandBuffer-recording", VALIDATION_ERROR_1ba02413}, + {"VUID-vkCmdProcessCommandsNVX-commandBuffer-cmdpool", VALIDATION_ERROR_1ba02415}, + {"VUID-vkCmdProcessCommandsNVX-pProcessCommandsInfo-parameter", VALIDATION_ERROR_1ba1f201}, + {"VUID-vkCmdPushConstants-commonparent", VALIDATION_ERROR_1bc00009}, + {"VUID-vkCmdPushConstants-offset-00368", VALIDATION_ERROR_1bc002e0}, + {"VUID-vkCmdPushConstants-size-00369", VALIDATION_ERROR_1bc002e2}, + {"VUID-vkCmdPushConstants-offset-00370", VALIDATION_ERROR_1bc002e4}, + {"VUID-vkCmdPushConstants-size-00371", VALIDATION_ERROR_1bc002e6}, + {"VUID-vkCmdPushConstants-offset-01795", VALIDATION_ERROR_1bc00e06}, + {"VUID-vkCmdPushConstants-offset-01796", VALIDATION_ERROR_1bc00e08}, + {"VUID-vkCmdPushConstants-commandBuffer-parameter", VALIDATION_ERROR_1bc02401}, + {"VUID-vkCmdPushConstants-commandBuffer-recording", VALIDATION_ERROR_1bc02413}, + {"VUID-vkCmdPushConstants-commandBuffer-cmdpool", VALIDATION_ERROR_1bc02415}, + {"VUID-vkCmdPushConstants-layout-parameter", VALIDATION_ERROR_1bc0be01}, + {"VUID-vkCmdPushConstants-pValues-parameter", VALIDATION_ERROR_1bc26201}, + {"VUID-vkCmdPushConstants-size-arraylength", VALIDATION_ERROR_1bc2c21b}, + {"VUID-vkCmdPushConstants-stageFlags-parameter", VALIDATION_ERROR_1bc2dc01}, + {"VUID-vkCmdPushConstants-stageFlags-requiredbitmask", VALIDATION_ERROR_1bc2dc03}, + {"VUID-vkCmdPushDescriptorSetKHR-commonparent", VALIDATION_ERROR_1be00009}, + {"VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-00363", VALIDATION_ERROR_1be002d6}, + {"VUID-vkCmdPushDescriptorSetKHR-set-00364", VALIDATION_ERROR_1be002d8}, + {"VUID-vkCmdPushDescriptorSetKHR-set-00365", VALIDATION_ERROR_1be002da}, + {"VUID-vkCmdPushDescriptorSetKHR-commandBuffer-parameter", VALIDATION_ERROR_1be02401}, + {"VUID-vkCmdPushDescriptorSetKHR-commandBuffer-recording", VALIDATION_ERROR_1be02413}, + {"VUID-vkCmdPushDescriptorSetKHR-commandBuffer-cmdpool", VALIDATION_ERROR_1be02415}, + {"VUID-vkCmdPushDescriptorSetKHR-descriptorWriteCount-arraylength", VALIDATION_ERROR_1be0541b}, + {"VUID-vkCmdPushDescriptorSetKHR-layout-parameter", VALIDATION_ERROR_1be0be01}, + {"VUID-vkCmdPushDescriptorSetKHR-pDescriptorWrites-parameter", VALIDATION_ERROR_1be13601}, + {"VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-parameter", VALIDATION_ERROR_1be27e01}, + {"VUID-vkCmdPushDescriptorSetWithTemplateKHR-commonparent", VALIDATION_ERROR_1c000009}, + {"VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-00366", VALIDATION_ERROR_1c0002dc}, + {"VUID-vkCmdPushDescriptorSetWithTemplateKHR-pData-01686", VALIDATION_ERROR_1c000d2c}, + {"VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-parameter", VALIDATION_ERROR_1c002401}, + {"VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-recording", VALIDATION_ERROR_1c002413}, + {"VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-cmdpool", VALIDATION_ERROR_1c002415}, + {"VUID-vkCmdPushDescriptorSetWithTemplateKHR-descriptorUpdateTemplate-parameter", VALIDATION_ERROR_1c005201}, + {"VUID-vkCmdPushDescriptorSetWithTemplateKHR-layout-parameter", VALIDATION_ERROR_1c00be01}, + {"VUID-vkCmdReserveSpaceForCommandsNVX-renderpass", VALIDATION_ERROR_1c200017}, + {"VUID-vkCmdReserveSpaceForCommandsNVX-bufferlevel", VALIDATION_ERROR_1c200019}, + {"VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-01329", VALIDATION_ERROR_1c200a62}, + {"VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-01330", VALIDATION_ERROR_1c200a64}, + {"VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-parameter", VALIDATION_ERROR_1c202401}, + {"VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-recording", VALIDATION_ERROR_1c202413}, + {"VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-cmdpool", VALIDATION_ERROR_1c202415}, + {"VUID-vkCmdReserveSpaceForCommandsNVX-pReserveSpaceInfo-parameter", VALIDATION_ERROR_1c221a01}, + {"VUID-vkCmdResetEvent-commonparent", VALIDATION_ERROR_1c400009}, + {"VUID-vkCmdResetEvent-renderpass", VALIDATION_ERROR_1c400017}, + {"VUID-vkCmdResetEvent-stageMask-01153", VALIDATION_ERROR_1c400902}, + {"VUID-vkCmdResetEvent-stageMask-01154", VALIDATION_ERROR_1c400904}, + {"VUID-vkCmdResetEvent-stageMask-01155", VALIDATION_ERROR_1c400906}, + {"VUID-vkCmdResetEvent-event-01156", VALIDATION_ERROR_1c400908}, + {"VUID-vkCmdResetEvent-commandBuffer-01157", VALIDATION_ERROR_1c40090a}, + {"VUID-vkCmdResetEvent-commandBuffer-parameter", VALIDATION_ERROR_1c402401}, + {"VUID-vkCmdResetEvent-commandBuffer-recording", VALIDATION_ERROR_1c402413}, + {"VUID-vkCmdResetEvent-commandBuffer-cmdpool", VALIDATION_ERROR_1c402415}, + {"VUID-vkCmdResetEvent-event-parameter", VALIDATION_ERROR_1c407e01}, + {"VUID-vkCmdResetEvent-stageMask-parameter", VALIDATION_ERROR_1c42de01}, + {"VUID-vkCmdResetEvent-stageMask-requiredbitmask", VALIDATION_ERROR_1c42de03}, + {"VUID-vkCmdResetQueryPool-commonparent", VALIDATION_ERROR_1c600009}, + {"VUID-vkCmdResetQueryPool-renderpass", VALIDATION_ERROR_1c600017}, + {"VUID-vkCmdResetQueryPool-firstQuery-00796", VALIDATION_ERROR_1c600638}, + {"VUID-vkCmdResetQueryPool-firstQuery-00797", VALIDATION_ERROR_1c60063a}, + {"VUID-vkCmdResetQueryPool-commandBuffer-parameter", VALIDATION_ERROR_1c602401}, + {"VUID-vkCmdResetQueryPool-commandBuffer-recording", VALIDATION_ERROR_1c602413}, + {"VUID-vkCmdResetQueryPool-commandBuffer-cmdpool", VALIDATION_ERROR_1c602415}, + {"VUID-vkCmdResetQueryPool-queryPool-parameter", VALIDATION_ERROR_1c629801}, + {"VUID-vkCmdResolveImage-commonparent", VALIDATION_ERROR_1c800009}, + {"VUID-vkCmdResolveImage-renderpass", VALIDATION_ERROR_1c800017}, + {"VUID-vkCmdResolveImage-pRegions-00253", VALIDATION_ERROR_1c8001fa}, + {"VUID-vkCmdResolveImage-pRegions-00254", VALIDATION_ERROR_1c8001fc}, + {"VUID-vkCmdResolveImage-pRegions-00255", VALIDATION_ERROR_1c8001fe}, + {"VUID-vkCmdResolveImage-srcImage-00256", VALIDATION_ERROR_1c800200}, + {"VUID-vkCmdResolveImage-srcImage-00257", VALIDATION_ERROR_1c800202}, + {"VUID-vkCmdResolveImage-dstImage-00258", VALIDATION_ERROR_1c800204}, + {"VUID-vkCmdResolveImage-dstImage-00259", VALIDATION_ERROR_1c800206}, + {"VUID-vkCmdResolveImage-srcImageLayout-00260", VALIDATION_ERROR_1c800208}, + {"VUID-vkCmdResolveImage-srcImageLayout-00261", VALIDATION_ERROR_1c80020a}, + {"VUID-vkCmdResolveImage-dstImageLayout-00262", VALIDATION_ERROR_1c80020c}, + {"VUID-vkCmdResolveImage-dstImageLayout-00263", VALIDATION_ERROR_1c80020e}, + {"VUID-vkCmdResolveImage-dstImage-00264", VALIDATION_ERROR_1c800210}, + {"VUID-vkCmdResolveImage-dstImage-00265", VALIDATION_ERROR_1c800212}, + {"VUID-vkCmdResolveImage-srcImage-01386", VALIDATION_ERROR_1c800ad4}, + {"VUID-vkCmdResolveImage-srcImageLayout-01400", VALIDATION_ERROR_1c800af0}, + {"VUID-vkCmdResolveImage-dstImageLayout-01401", VALIDATION_ERROR_1c800af2}, + {"VUID-vkCmdResolveImage-srcSubresource-01709", VALIDATION_ERROR_1c800d5a}, + {"VUID-vkCmdResolveImage-dstSubresource-01710", VALIDATION_ERROR_1c800d5c}, + {"VUID-vkCmdResolveImage-srcSubresource-01711", VALIDATION_ERROR_1c800d5e}, + {"VUID-vkCmdResolveImage-dstSubresource-01712", VALIDATION_ERROR_1c800d60}, + {"VUID-vkCmdResolveImage-commandBuffer-01837", VALIDATION_ERROR_1c800e5a}, + {"VUID-vkCmdResolveImage-commandBuffer-01838", VALIDATION_ERROR_1c800e5c}, + {"VUID-vkCmdResolveImage-commandBuffer-01839", VALIDATION_ERROR_1c800e5e}, + {"VUID-vkCmdResolveImage-commandBuffer-parameter", VALIDATION_ERROR_1c802401}, + {"VUID-vkCmdResolveImage-commandBuffer-recording", VALIDATION_ERROR_1c802413}, + {"VUID-vkCmdResolveImage-commandBuffer-cmdpool", VALIDATION_ERROR_1c802415}, + {"VUID-vkCmdResolveImage-dstImage-parameter", VALIDATION_ERROR_1c807201}, + {"VUID-vkCmdResolveImage-dstImageLayout-parameter", VALIDATION_ERROR_1c807401}, + {"VUID-vkCmdResolveImage-pRegions-parameter", VALIDATION_ERROR_1c821001}, + {"VUID-vkCmdResolveImage-regionCount-arraylength", VALIDATION_ERROR_1c82ac1b}, + {"VUID-vkCmdResolveImage-srcImage-parameter", VALIDATION_ERROR_1c82ce01}, + {"VUID-vkCmdResolveImage-srcImageLayout-parameter", VALIDATION_ERROR_1c82d001}, + {"VUID-vkCmdSetBlendConstants-None-00612", VALIDATION_ERROR_1ca004c8}, + {"VUID-vkCmdSetBlendConstants-commandBuffer-parameter", VALIDATION_ERROR_1ca02401}, + {"VUID-vkCmdSetBlendConstants-commandBuffer-recording", VALIDATION_ERROR_1ca02413}, + {"VUID-vkCmdSetBlendConstants-commandBuffer-cmdpool", VALIDATION_ERROR_1ca02415}, + {"VUID-vkCmdSetDepthBias-None-00789", VALIDATION_ERROR_1cc0062a}, + {"VUID-vkCmdSetDepthBias-depthBiasClamp-00790", VALIDATION_ERROR_1cc0062c}, + {"VUID-vkCmdSetDepthBias-commandBuffer-parameter", VALIDATION_ERROR_1cc02401}, + {"VUID-vkCmdSetDepthBias-commandBuffer-recording", VALIDATION_ERROR_1cc02413}, + {"VUID-vkCmdSetDepthBias-commandBuffer-cmdpool", VALIDATION_ERROR_1cc02415}, + {"VUID-vkCmdSetDepthBounds-None-00599", VALIDATION_ERROR_1ce004ae}, + {"VUID-vkCmdSetDepthBounds-minDepthBounds-00600", VALIDATION_ERROR_1ce004b0}, + {"VUID-vkCmdSetDepthBounds-maxDepthBounds-00601", VALIDATION_ERROR_1ce004b2}, + {"VUID-vkCmdSetDepthBounds-commandBuffer-parameter", VALIDATION_ERROR_1ce02401}, + {"VUID-vkCmdSetDepthBounds-commandBuffer-recording", VALIDATION_ERROR_1ce02413}, + {"VUID-vkCmdSetDepthBounds-commandBuffer-cmdpool", VALIDATION_ERROR_1ce02415}, + {"VUID-vkCmdSetDeviceMask-deviceMask-00108", VALIDATION_ERROR_1d0000d8}, + {"VUID-vkCmdSetDeviceMask-deviceMask-00109", VALIDATION_ERROR_1d0000da}, + {"VUID-vkCmdSetDeviceMask-deviceMask-00110", VALIDATION_ERROR_1d0000dc}, + {"VUID-vkCmdSetDeviceMask-deviceMask-00111", VALIDATION_ERROR_1d0000de}, + {"VUID-vkCmdSetDeviceMask-commandBuffer-parameter", VALIDATION_ERROR_1d002401}, + {"VUID-vkCmdSetDeviceMask-commandBuffer-recording", VALIDATION_ERROR_1d002413}, + {"VUID-vkCmdSetDeviceMask-commandBuffer-cmdpool", VALIDATION_ERROR_1d002415}, + {"VUID-vkCmdSetDiscardRectangleEXT-None-00583", VALIDATION_ERROR_1d20048e}, + {"VUID-vkCmdSetDiscardRectangleEXT-firstDiscardRectangle-00585", VALIDATION_ERROR_1d200492}, + {"VUID-vkCmdSetDiscardRectangleEXT-x-00587", VALIDATION_ERROR_1d200496}, + {"VUID-vkCmdSetDiscardRectangleEXT-offset-00588", VALIDATION_ERROR_1d200498}, + {"VUID-vkCmdSetDiscardRectangleEXT-offset-00589", VALIDATION_ERROR_1d20049a}, + {"VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-parameter", VALIDATION_ERROR_1d202401}, + {"VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-recording", VALIDATION_ERROR_1d202413}, + {"VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-cmdpool", VALIDATION_ERROR_1d202415}, + {"VUID-vkCmdSetDiscardRectangleEXT-discardRectangleCount-arraylength", VALIDATION_ERROR_1d205c1b}, + {"VUID-vkCmdSetDiscardRectangleEXT-pDiscardRectangles-parameter", VALIDATION_ERROR_1d214601}, + {"VUID-vkCmdSetEvent-commonparent", VALIDATION_ERROR_1d400009}, + {"VUID-vkCmdSetEvent-renderpass", VALIDATION_ERROR_1d400017}, + {"VUID-vkCmdSetEvent-stageMask-01149", VALIDATION_ERROR_1d4008fa}, + {"VUID-vkCmdSetEvent-stageMask-01150", VALIDATION_ERROR_1d4008fc}, + {"VUID-vkCmdSetEvent-stageMask-01151", VALIDATION_ERROR_1d4008fe}, + {"VUID-vkCmdSetEvent-commandBuffer-01152", VALIDATION_ERROR_1d400900}, + {"VUID-vkCmdSetEvent-commandBuffer-parameter", VALIDATION_ERROR_1d402401}, + {"VUID-vkCmdSetEvent-commandBuffer-recording", VALIDATION_ERROR_1d402413}, + {"VUID-vkCmdSetEvent-commandBuffer-cmdpool", VALIDATION_ERROR_1d402415}, + {"VUID-vkCmdSetEvent-event-parameter", VALIDATION_ERROR_1d407e01}, + {"VUID-vkCmdSetEvent-stageMask-parameter", VALIDATION_ERROR_1d42de01}, + {"VUID-vkCmdSetEvent-stageMask-requiredbitmask", VALIDATION_ERROR_1d42de03}, + {"VUID-vkCmdSetLineWidth-None-00787", VALIDATION_ERROR_1d600626}, + {"VUID-vkCmdSetLineWidth-lineWidth-00788", VALIDATION_ERROR_1d600628}, + {"VUID-vkCmdSetLineWidth-commandBuffer-parameter", VALIDATION_ERROR_1d602401}, + {"VUID-vkCmdSetLineWidth-commandBuffer-recording", VALIDATION_ERROR_1d602413}, + {"VUID-vkCmdSetLineWidth-commandBuffer-cmdpool", VALIDATION_ERROR_1d602415}, + {"VUID-vkCmdSetScissor-None-00590", VALIDATION_ERROR_1d80049c}, + {"VUID-vkCmdSetScissor-firstScissor-00591", VALIDATION_ERROR_1d80049e}, + {"VUID-vkCmdSetScissor-firstScissor-00592", VALIDATION_ERROR_1d8004a0}, + {"VUID-vkCmdSetScissor-firstScissor-00593", VALIDATION_ERROR_1d8004a2}, + {"VUID-vkCmdSetScissor-scissorCount-00594", VALIDATION_ERROR_1d8004a4}, + {"VUID-vkCmdSetScissor-x-00595", VALIDATION_ERROR_1d8004a6}, + {"VUID-vkCmdSetScissor-offset-00596", VALIDATION_ERROR_1d8004a8}, + {"VUID-vkCmdSetScissor-offset-00597", VALIDATION_ERROR_1d8004aa}, + {"VUID-vkCmdSetScissor-commandBuffer-parameter", VALIDATION_ERROR_1d802401}, + {"VUID-vkCmdSetScissor-commandBuffer-recording", VALIDATION_ERROR_1d802413}, + {"VUID-vkCmdSetScissor-commandBuffer-cmdpool", VALIDATION_ERROR_1d802415}, + {"VUID-vkCmdSetScissor-pScissors-parameter", VALIDATION_ERROR_1d822601}, + {"VUID-vkCmdSetScissor-scissorCount-arraylength", VALIDATION_ERROR_1d82b61b}, + {"VUID-vkCmdSetStencilCompareMask-None-00602", VALIDATION_ERROR_1da004b4}, + {"VUID-vkCmdSetStencilCompareMask-commandBuffer-parameter", VALIDATION_ERROR_1da02401}, + {"VUID-vkCmdSetStencilCompareMask-commandBuffer-recording", VALIDATION_ERROR_1da02413}, + {"VUID-vkCmdSetStencilCompareMask-commandBuffer-cmdpool", VALIDATION_ERROR_1da02415}, + {"VUID-vkCmdSetStencilCompareMask-faceMask-parameter", VALIDATION_ERROR_1da08401}, + {"VUID-vkCmdSetStencilCompareMask-faceMask-requiredbitmask", VALIDATION_ERROR_1da08403}, + {"VUID-vkCmdSetStencilReference-None-00604", VALIDATION_ERROR_1dc004b8}, + {"VUID-vkCmdSetStencilReference-commandBuffer-parameter", VALIDATION_ERROR_1dc02401}, + {"VUID-vkCmdSetStencilReference-commandBuffer-recording", VALIDATION_ERROR_1dc02413}, + {"VUID-vkCmdSetStencilReference-commandBuffer-cmdpool", VALIDATION_ERROR_1dc02415}, + {"VUID-vkCmdSetStencilReference-faceMask-parameter", VALIDATION_ERROR_1dc08401}, + {"VUID-vkCmdSetStencilReference-faceMask-requiredbitmask", VALIDATION_ERROR_1dc08403}, + {"VUID-vkCmdSetStencilWriteMask-None-00603", VALIDATION_ERROR_1de004b6}, + {"VUID-vkCmdSetStencilWriteMask-commandBuffer-parameter", VALIDATION_ERROR_1de02401}, + {"VUID-vkCmdSetStencilWriteMask-commandBuffer-recording", VALIDATION_ERROR_1de02413}, + {"VUID-vkCmdSetStencilWriteMask-commandBuffer-cmdpool", VALIDATION_ERROR_1de02415}, + {"VUID-vkCmdSetStencilWriteMask-faceMask-parameter", VALIDATION_ERROR_1de08401}, + {"VUID-vkCmdSetStencilWriteMask-faceMask-requiredbitmask", VALIDATION_ERROR_1de08403}, + {"VUID-vkCmdSetViewport-None-01221", VALIDATION_ERROR_1e00098a}, + {"VUID-vkCmdSetViewport-firstViewport-01222", VALIDATION_ERROR_1e00098c}, + {"VUID-vkCmdSetViewport-firstViewport-01223", VALIDATION_ERROR_1e00098e}, + {"VUID-vkCmdSetViewport-firstViewport-01224", VALIDATION_ERROR_1e000990}, + {"VUID-vkCmdSetViewport-viewportCount-01225", VALIDATION_ERROR_1e000992}, + {"VUID-vkCmdSetViewport-commandBuffer-parameter", VALIDATION_ERROR_1e002401}, + {"VUID-vkCmdSetViewport-commandBuffer-recording", VALIDATION_ERROR_1e002413}, + {"VUID-vkCmdSetViewport-commandBuffer-cmdpool", VALIDATION_ERROR_1e002415}, + {"VUID-vkCmdSetViewport-viewportCount-arraylength", VALIDATION_ERROR_1e030a1b}, + {"VUID-vkCmdSetViewport-pViewports-parameter", VALIDATION_ERROR_1e03fa01}, + {"VUID-vkCmdSetViewportWScalingNV-None-01322", VALIDATION_ERROR_1e200a54}, + {"VUID-vkCmdSetViewportWScalingNV-firstViewport-01323", VALIDATION_ERROR_1e200a56}, + {"VUID-vkCmdSetViewportWScalingNV-firstViewport-01324", VALIDATION_ERROR_1e200a58}, + {"VUID-vkCmdSetViewportWScalingNV-commandBuffer-parameter", VALIDATION_ERROR_1e202401}, + {"VUID-vkCmdSetViewportWScalingNV-commandBuffer-recording", VALIDATION_ERROR_1e202413}, + {"VUID-vkCmdSetViewportWScalingNV-commandBuffer-cmdpool", VALIDATION_ERROR_1e202415}, + {"VUID-vkCmdSetViewportWScalingNV-viewportCount-arraylength", VALIDATION_ERROR_1e230a1b}, + {"VUID-vkCmdSetViewportWScalingNV-pViewportWScalings-parameter", VALIDATION_ERROR_1e23fc01}, + {"VUID-vkCmdUpdateBuffer-commonparent", VALIDATION_ERROR_1e400009}, + {"VUID-vkCmdUpdateBuffer-renderpass", VALIDATION_ERROR_1e400017}, + {"VUID-vkCmdUpdateBuffer-dstOffset-00032", VALIDATION_ERROR_1e400040}, + {"VUID-vkCmdUpdateBuffer-dataSize-00033", VALIDATION_ERROR_1e400042}, + {"VUID-vkCmdUpdateBuffer-dstBuffer-00034", VALIDATION_ERROR_1e400044}, + {"VUID-vkCmdUpdateBuffer-dstBuffer-00035", VALIDATION_ERROR_1e400046}, + {"VUID-vkCmdUpdateBuffer-dstOffset-00036", VALIDATION_ERROR_1e400048}, + {"VUID-vkCmdUpdateBuffer-dataSize-00037", VALIDATION_ERROR_1e40004a}, + {"VUID-vkCmdUpdateBuffer-dataSize-00038", VALIDATION_ERROR_1e40004c}, + {"VUID-vkCmdUpdateBuffer-commandBuffer-01813", VALIDATION_ERROR_1e400e2a}, + {"VUID-vkCmdUpdateBuffer-commandBuffer-01814", VALIDATION_ERROR_1e400e2c}, + {"VUID-vkCmdUpdateBuffer-commandBuffer-parameter", VALIDATION_ERROR_1e402401}, + {"VUID-vkCmdUpdateBuffer-commandBuffer-recording", VALIDATION_ERROR_1e402413}, + {"VUID-vkCmdUpdateBuffer-commandBuffer-cmdpool", VALIDATION_ERROR_1e402415}, + {"VUID-vkCmdUpdateBuffer-dataSize-arraylength", VALIDATION_ERROR_1e403c1b}, + {"VUID-vkCmdUpdateBuffer-dstBuffer-parameter", VALIDATION_ERROR_1e406c01}, + {"VUID-vkCmdUpdateBuffer-pData-parameter", VALIDATION_ERROR_1e412201}, + {"VUID-vkCmdWaitEvents-commonparent", VALIDATION_ERROR_1e600009}, + {"VUID-vkCmdWaitEvents-srcStageMask-01158", VALIDATION_ERROR_1e60090c}, + {"VUID-vkCmdWaitEvents-srcStageMask-01159", VALIDATION_ERROR_1e60090e}, + {"VUID-vkCmdWaitEvents-dstStageMask-01160", VALIDATION_ERROR_1e600910}, + {"VUID-vkCmdWaitEvents-srcStageMask-01161", VALIDATION_ERROR_1e600912}, + {"VUID-vkCmdWaitEvents-dstStageMask-01162", VALIDATION_ERROR_1e600914}, + {"VUID-vkCmdWaitEvents-pEvents-01163", VALIDATION_ERROR_1e600916}, + {"VUID-vkCmdWaitEvents-srcStageMask-01164", VALIDATION_ERROR_1e600918}, + {"VUID-vkCmdWaitEvents-pMemoryBarriers-01165", VALIDATION_ERROR_1e60091a}, + {"VUID-vkCmdWaitEvents-pMemoryBarriers-01166", VALIDATION_ERROR_1e60091c}, + {"VUID-vkCmdWaitEvents-commandBuffer-01167", VALIDATION_ERROR_1e60091e}, + {"VUID-vkCmdWaitEvents-commandBuffer-parameter", VALIDATION_ERROR_1e602401}, + {"VUID-vkCmdWaitEvents-commandBuffer-recording", VALIDATION_ERROR_1e602413}, + {"VUID-vkCmdWaitEvents-commandBuffer-cmdpool", VALIDATION_ERROR_1e602415}, + {"VUID-vkCmdWaitEvents-dstStageMask-parameter", VALIDATION_ERROR_1e607801}, + {"VUID-vkCmdWaitEvents-dstStageMask-requiredbitmask", VALIDATION_ERROR_1e607803}, + {"VUID-vkCmdWaitEvents-eventCount-arraylength", VALIDATION_ERROR_1e60801b}, + {"VUID-vkCmdWaitEvents-pBufferMemoryBarriers-parameter", VALIDATION_ERROR_1e610401}, + {"VUID-vkCmdWaitEvents-pEvents-parameter", VALIDATION_ERROR_1e616001}, + {"VUID-vkCmdWaitEvents-pImageMemoryBarriers-parameter", VALIDATION_ERROR_1e618a01}, + {"VUID-vkCmdWaitEvents-pMemoryBarriers-parameter", VALIDATION_ERROR_1e61ac01}, + {"VUID-vkCmdWaitEvents-srcStageMask-parameter", VALIDATION_ERROR_1e62d401}, + {"VUID-vkCmdWaitEvents-srcStageMask-requiredbitmask", VALIDATION_ERROR_1e62d403}, + {"VUID-vkCmdWriteTimestamp-commonparent", VALIDATION_ERROR_1e800009}, + {"VUID-vkCmdWriteTimestamp-queryPool-00828", VALIDATION_ERROR_1e800678}, + {"VUID-vkCmdWriteTimestamp-timestampValidBits-00829", VALIDATION_ERROR_1e80067a}, + {"VUID-vkCmdWriteTimestamp-None-00830", VALIDATION_ERROR_1e80067c}, + {"VUID-vkCmdWriteTimestamp-query-00831", VALIDATION_ERROR_1e80067e}, + {"VUID-vkCmdWriteTimestamp-queryPool-01416", VALIDATION_ERROR_1e800b10}, + {"VUID-vkCmdWriteTimestamp-commandBuffer-parameter", VALIDATION_ERROR_1e802401}, + {"VUID-vkCmdWriteTimestamp-commandBuffer-recording", VALIDATION_ERROR_1e802413}, + {"VUID-vkCmdWriteTimestamp-commandBuffer-cmdpool", VALIDATION_ERROR_1e802415}, + {"VUID-vkCmdWriteTimestamp-pipelineStage-parameter", VALIDATION_ERROR_1e828401}, + {"VUID-vkCmdWriteTimestamp-queryPool-parameter", VALIDATION_ERROR_1e829801}, + {"VUID-vkCreateAndroidSurfaceKHR-instance-parameter", VALIDATION_ERROR_1ea0bc01}, + {"VUID-vkCreateAndroidSurfaceKHR-pAllocator-parameter", VALIDATION_ERROR_1ea0ec01}, + {"VUID-vkCreateAndroidSurfaceKHR-pCreateInfo-parameter", VALIDATION_ERROR_1ea11e01}, + {"VUID-vkCreateAndroidSurfaceKHR-pSurface-parameter", VALIDATION_ERROR_1ea24801}, + {"VUID-vkCreateBuffer-flags-00911", VALIDATION_ERROR_1ec0071e}, + {"VUID-vkCreateBuffer-device-parameter", VALIDATION_ERROR_1ec05601}, + {"VUID-vkCreateBuffer-pAllocator-parameter", VALIDATION_ERROR_1ec0ec01}, + {"VUID-vkCreateBuffer-pBuffer-parameter", VALIDATION_ERROR_1ec10001}, + {"VUID-vkCreateBuffer-pCreateInfo-parameter", VALIDATION_ERROR_1ec11e01}, + {"VUID-vkCreateBufferView-device-parameter", VALIDATION_ERROR_1ee05601}, + {"VUID-vkCreateBufferView-pAllocator-parameter", VALIDATION_ERROR_1ee0ec01}, + {"VUID-vkCreateBufferView-pCreateInfo-parameter", VALIDATION_ERROR_1ee11e01}, + {"VUID-vkCreateBufferView-pView-parameter", VALIDATION_ERROR_1ee26a01}, + {"VUID-vkCreateCommandPool-device-parameter", VALIDATION_ERROR_1f005601}, + {"VUID-vkCreateCommandPool-pAllocator-parameter", VALIDATION_ERROR_1f00ec01}, + {"VUID-vkCreateCommandPool-pCommandPool-parameter", VALIDATION_ERROR_1f011601}, + {"VUID-vkCreateCommandPool-pCreateInfo-parameter", VALIDATION_ERROR_1f011e01}, + {"VUID-vkCreateComputePipelines-flags-00695", VALIDATION_ERROR_1f20056e}, + {"VUID-vkCreateComputePipelines-flags-00696", VALIDATION_ERROR_1f200570}, + {"VUID-vkCreateComputePipelines-createInfoCount-arraylength", VALIDATION_ERROR_1f20381b}, + {"VUID-vkCreateComputePipelines-device-parameter", VALIDATION_ERROR_1f205601}, + {"VUID-vkCreateComputePipelines-pAllocator-parameter", VALIDATION_ERROR_1f20ec01}, + {"VUID-vkCreateComputePipelines-pCreateInfos-parameter", VALIDATION_ERROR_1f212001}, + {"VUID-vkCreateComputePipelines-pPipelines-parameter", VALIDATION_ERROR_1f21e201}, + {"VUID-vkCreateComputePipelines-pipelineCache-parameter", VALIDATION_ERROR_1f228001}, + {"VUID-vkCreateComputePipelines-pipelineCache-parent", VALIDATION_ERROR_1f228007}, + {"VUID-vkCreateDebugReportCallbackEXT-instance-parameter", VALIDATION_ERROR_1f40bc01}, + {"VUID-vkCreateDebugReportCallbackEXT-pAllocator-parameter", VALIDATION_ERROR_1f40ec01}, + {"VUID-vkCreateDebugReportCallbackEXT-pCallback-parameter", VALIDATION_ERROR_1f410801}, + {"VUID-vkCreateDebugReportCallbackEXT-pCreateInfo-parameter", VALIDATION_ERROR_1f411e01}, + {"VUID-vkCreateDescriptorPool-device-parameter", VALIDATION_ERROR_1f605601}, + {"VUID-vkCreateDescriptorPool-pAllocator-parameter", VALIDATION_ERROR_1f60ec01}, + {"VUID-vkCreateDescriptorPool-pCreateInfo-parameter", VALIDATION_ERROR_1f611e01}, + {"VUID-vkCreateDescriptorPool-pDescriptorPool-parameter", VALIDATION_ERROR_1f612e01}, + {"VUID-vkCreateDescriptorSetLayout-device-parameter", VALIDATION_ERROR_1f805601}, + {"VUID-vkCreateDescriptorSetLayout-pAllocator-parameter", VALIDATION_ERROR_1f80ec01}, + {"VUID-vkCreateDescriptorSetLayout-pCreateInfo-parameter", VALIDATION_ERROR_1f811e01}, + {"VUID-vkCreateDescriptorSetLayout-pSetLayout-parameter", VALIDATION_ERROR_1f822a01}, + {"VUID-vkCreateDescriptorUpdateTemplate-device-parameter", VALIDATION_ERROR_1fa05601}, + {"VUID-vkCreateDescriptorUpdateTemplate-pAllocator-parameter", VALIDATION_ERROR_1fa0ec01}, + {"VUID-vkCreateDescriptorUpdateTemplate-pCreateInfo-parameter", VALIDATION_ERROR_1fa11e01}, + {"VUID-vkCreateDescriptorUpdateTemplate-pDescriptorUpdateTemplate-parameter", VALIDATION_ERROR_1fa13401}, + {"VUID-vkCreateDevice-ppEnabledExtensionNames-01387", VALIDATION_ERROR_1fc00ad6}, + {"VUID-vkCreateDevice-pAllocator-parameter", VALIDATION_ERROR_1fc0ec01}, + {"VUID-vkCreateDevice-pCreateInfo-parameter", VALIDATION_ERROR_1fc11e01}, + {"VUID-vkCreateDevice-pDevice-parameter", VALIDATION_ERROR_1fc13801}, + {"VUID-vkCreateDevice-physicalDevice-parameter", VALIDATION_ERROR_1fc27a01}, + {"VUID-vkCreateDisplayModeKHR-display-parameter", VALIDATION_ERROR_1fe06001}, + {"VUID-vkCreateDisplayModeKHR-pAllocator-parameter", VALIDATION_ERROR_1fe0ec01}, + {"VUID-vkCreateDisplayModeKHR-pCreateInfo-parameter", VALIDATION_ERROR_1fe11e01}, + {"VUID-vkCreateDisplayModeKHR-pMode-parameter", VALIDATION_ERROR_1fe1bc01}, + {"VUID-vkCreateDisplayModeKHR-physicalDevice-parameter", VALIDATION_ERROR_1fe27a01}, + {"VUID-vkCreateDisplayPlaneSurfaceKHR-instance-parameter", VALIDATION_ERROR_2000bc01}, + {"VUID-vkCreateDisplayPlaneSurfaceKHR-pAllocator-parameter", VALIDATION_ERROR_2000ec01}, + {"VUID-vkCreateDisplayPlaneSurfaceKHR-pCreateInfo-parameter", VALIDATION_ERROR_20011e01}, + {"VUID-vkCreateDisplayPlaneSurfaceKHR-pSurface-parameter", VALIDATION_ERROR_20024801}, + {"VUID-vkCreateEvent-device-parameter", VALIDATION_ERROR_20205601}, + {"VUID-vkCreateEvent-pAllocator-parameter", VALIDATION_ERROR_2020ec01}, + {"VUID-vkCreateEvent-pCreateInfo-parameter", VALIDATION_ERROR_20211e01}, + {"VUID-vkCreateEvent-pEvent-parameter", VALIDATION_ERROR_20215e01}, + {"VUID-vkCreateFence-device-parameter", VALIDATION_ERROR_20405601}, + {"VUID-vkCreateFence-pAllocator-parameter", VALIDATION_ERROR_2040ec01}, + {"VUID-vkCreateFence-pCreateInfo-parameter", VALIDATION_ERROR_20411e01}, + {"VUID-vkCreateFence-pFence-parameter", VALIDATION_ERROR_20417001}, + {"VUID-vkCreateFramebuffer-device-parameter", VALIDATION_ERROR_20605601}, + {"VUID-vkCreateFramebuffer-pAllocator-parameter", VALIDATION_ERROR_2060ec01}, + {"VUID-vkCreateFramebuffer-pCreateInfo-parameter", VALIDATION_ERROR_20611e01}, + {"VUID-vkCreateFramebuffer-pFramebuffer-parameter", VALIDATION_ERROR_20617801}, + {"VUID-vkCreateGraphicsPipelines-flags-00720", VALIDATION_ERROR_208005a0}, + {"VUID-vkCreateGraphicsPipelines-flags-00721", VALIDATION_ERROR_208005a2}, + {"VUID-vkCreateGraphicsPipelines-createInfoCount-arraylength", VALIDATION_ERROR_2080381b}, + {"VUID-vkCreateGraphicsPipelines-device-parameter", VALIDATION_ERROR_20805601}, + {"VUID-vkCreateGraphicsPipelines-pAllocator-parameter", VALIDATION_ERROR_2080ec01}, + {"VUID-vkCreateGraphicsPipelines-pCreateInfos-parameter", VALIDATION_ERROR_20812001}, + {"VUID-vkCreateGraphicsPipelines-pPipelines-parameter", VALIDATION_ERROR_2081e201}, + {"VUID-vkCreateGraphicsPipelines-pipelineCache-parameter", VALIDATION_ERROR_20828001}, + {"VUID-vkCreateGraphicsPipelines-pipelineCache-parent", VALIDATION_ERROR_20828007}, + {"VUID-vkCreateIOSSurfaceMVK-instance-parameter", VALIDATION_ERROR_20a0bc01}, + {"VUID-vkCreateIOSSurfaceMVK-pAllocator-parameter", VALIDATION_ERROR_20a0ec01}, + {"VUID-vkCreateIOSSurfaceMVK-pCreateInfo-parameter", VALIDATION_ERROR_20a11e01}, + {"VUID-vkCreateIOSSurfaceMVK-pSurface-parameter", VALIDATION_ERROR_20a24801}, + {"VUID-vkCreateImage-flags-00939", VALIDATION_ERROR_20c00756}, + {"VUID-vkCreateImage-device-parameter", VALIDATION_ERROR_20c05601}, + {"VUID-vkCreateImage-pAllocator-parameter", VALIDATION_ERROR_20c0ec01}, + {"VUID-vkCreateImage-pCreateInfo-parameter", VALIDATION_ERROR_20c11e01}, + {"VUID-vkCreateImage-pImage-parameter", VALIDATION_ERROR_20c17e01}, + {"VUID-vkCreateImageView-device-parameter", VALIDATION_ERROR_20e05601}, + {"VUID-vkCreateImageView-pAllocator-parameter", VALIDATION_ERROR_20e0ec01}, + {"VUID-vkCreateImageView-pCreateInfo-parameter", VALIDATION_ERROR_20e11e01}, + {"VUID-vkCreateImageView-pView-parameter", VALIDATION_ERROR_20e26a01}, + {"VUID-vkCreateIndirectCommandsLayoutNVX-device-parameter", VALIDATION_ERROR_21005601}, + {"VUID-vkCreateIndirectCommandsLayoutNVX-pAllocator-parameter", VALIDATION_ERROR_2100ec01}, + {"VUID-vkCreateIndirectCommandsLayoutNVX-pCreateInfo-parameter", VALIDATION_ERROR_21011e01}, + {"VUID-vkCreateIndirectCommandsLayoutNVX-pIndirectCommandsLayout-parameter", VALIDATION_ERROR_21019201}, + {"VUID-vkCreateInstance-ppEnabledExtensionNames-01388", VALIDATION_ERROR_21200ad8}, + {"VUID-vkCreateInstance-pAllocator-parameter", VALIDATION_ERROR_2120ec01}, + {"VUID-vkCreateInstance-pCreateInfo-parameter", VALIDATION_ERROR_21211e01}, + {"VUID-vkCreateInstance-pInstance-parameter", VALIDATION_ERROR_21219c01}, + {"VUID-vkCreateMacOSSurfaceMVK-instance-parameter", VALIDATION_ERROR_2140bc01}, + {"VUID-vkCreateMacOSSurfaceMVK-pAllocator-parameter", VALIDATION_ERROR_2140ec01}, + {"VUID-vkCreateMacOSSurfaceMVK-pCreateInfo-parameter", VALIDATION_ERROR_21411e01}, + {"VUID-vkCreateMacOSSurfaceMVK-pSurface-parameter", VALIDATION_ERROR_21424801}, + {"VUID-vkCreateMirSurfaceKHR-instance-parameter", VALIDATION_ERROR_2160bc01}, + {"VUID-vkCreateMirSurfaceKHR-pAllocator-parameter", VALIDATION_ERROR_2160ec01}, + {"VUID-vkCreateMirSurfaceKHR-pCreateInfo-parameter", VALIDATION_ERROR_21611e01}, + {"VUID-vkCreateMirSurfaceKHR-pSurface-parameter", VALIDATION_ERROR_21624801}, + {"VUID-vkCreateObjectTableNVX-device-parameter", VALIDATION_ERROR_21805601}, + {"VUID-vkCreateObjectTableNVX-pAllocator-parameter", VALIDATION_ERROR_2180ec01}, + {"VUID-vkCreateObjectTableNVX-pCreateInfo-parameter", VALIDATION_ERROR_21811e01}, + {"VUID-vkCreateObjectTableNVX-pObjectTable-parameter", VALIDATION_ERROR_2181d001}, + {"VUID-vkCreatePipelineCache-device-parameter", VALIDATION_ERROR_21a05601}, + {"VUID-vkCreatePipelineCache-pAllocator-parameter", VALIDATION_ERROR_21a0ec01}, + {"VUID-vkCreatePipelineCache-pCreateInfo-parameter", VALIDATION_ERROR_21a11e01}, + {"VUID-vkCreatePipelineCache-pPipelineCache-parameter", VALIDATION_ERROR_21a1de01}, + {"VUID-vkCreatePipelineLayout-device-parameter", VALIDATION_ERROR_21c05601}, + {"VUID-vkCreatePipelineLayout-pAllocator-parameter", VALIDATION_ERROR_21c0ec01}, + {"VUID-vkCreatePipelineLayout-pCreateInfo-parameter", VALIDATION_ERROR_21c11e01}, + {"VUID-vkCreatePipelineLayout-pPipelineLayout-parameter", VALIDATION_ERROR_21c1e001}, + {"VUID-vkCreateQueryPool-device-parameter", VALIDATION_ERROR_21e05601}, + {"VUID-vkCreateQueryPool-pAllocator-parameter", VALIDATION_ERROR_21e0ec01}, + {"VUID-vkCreateQueryPool-pCreateInfo-parameter", VALIDATION_ERROR_21e11e01}, + {"VUID-vkCreateQueryPool-pQueryPool-parameter", VALIDATION_ERROR_21e1fa01}, + {"VUID-vkCreateRenderPass-device-parameter", VALIDATION_ERROR_22005601}, + {"VUID-vkCreateRenderPass-pAllocator-parameter", VALIDATION_ERROR_2200ec01}, + {"VUID-vkCreateRenderPass-pCreateInfo-parameter", VALIDATION_ERROR_22011e01}, + {"VUID-vkCreateRenderPass-pRenderPass-parameter", VALIDATION_ERROR_22021601}, + {"VUID-vkCreateSampler-device-parameter", VALIDATION_ERROR_22205601}, + {"VUID-vkCreateSampler-pAllocator-parameter", VALIDATION_ERROR_2220ec01}, + {"VUID-vkCreateSampler-pCreateInfo-parameter", VALIDATION_ERROR_22211e01}, + {"VUID-vkCreateSampler-pSampler-parameter", VALIDATION_ERROR_22222401}, + {"VUID-vkCreateSemaphore-device-parameter", VALIDATION_ERROR_22405601}, + {"VUID-vkCreateSemaphore-pAllocator-parameter", VALIDATION_ERROR_2240ec01}, + {"VUID-vkCreateSemaphore-pCreateInfo-parameter", VALIDATION_ERROR_22411e01}, + {"VUID-vkCreateSemaphore-pSemaphore-parameter", VALIDATION_ERROR_22422801}, + {"VUID-vkCreateShaderModule-device-parameter", VALIDATION_ERROR_22605601}, + {"VUID-vkCreateShaderModule-pAllocator-parameter", VALIDATION_ERROR_2260ec01}, + {"VUID-vkCreateShaderModule-pCreateInfo-parameter", VALIDATION_ERROR_22611e01}, + {"VUID-vkCreateShaderModule-pShaderModule-parameter", VALIDATION_ERROR_22622e01}, + {"VUID-vkCreateSharedSwapchainsKHR-device-parameter", VALIDATION_ERROR_22805601}, + {"VUID-vkCreateSharedSwapchainsKHR-pAllocator-parameter", VALIDATION_ERROR_2280ec01}, + {"VUID-vkCreateSharedSwapchainsKHR-pCreateInfos-parameter", VALIDATION_ERROR_22812001}, + {"VUID-vkCreateSharedSwapchainsKHR-pSwapchains-parameter", VALIDATION_ERROR_22825801}, + {"VUID-vkCreateSharedSwapchainsKHR-swapchainCount-arraylength", VALIDATION_ERROR_2282f21b}, + {"VUID-vkCreateSwapchainKHR-device-parameter", VALIDATION_ERROR_22a05601}, + {"VUID-vkCreateSwapchainKHR-pAllocator-parameter", VALIDATION_ERROR_22a0ec01}, + {"VUID-vkCreateSwapchainKHR-pCreateInfo-parameter", VALIDATION_ERROR_22a11e01}, + {"VUID-vkCreateSwapchainKHR-pSwapchain-parameter", VALIDATION_ERROR_22a25201}, + {"VUID-vkCreateViSurfaceNN-instance-parameter", VALIDATION_ERROR_22c0bc01}, + {"VUID-vkCreateViSurfaceNN-pAllocator-parameter", VALIDATION_ERROR_22c0ec01}, + {"VUID-vkCreateViSurfaceNN-pCreateInfo-parameter", VALIDATION_ERROR_22c11e01}, + {"VUID-vkCreateViSurfaceNN-pSurface-parameter", VALIDATION_ERROR_22c24801}, + {"VUID-vkCreateWaylandSurfaceKHR-instance-parameter", VALIDATION_ERROR_22e0bc01}, + {"VUID-vkCreateWaylandSurfaceKHR-pAllocator-parameter", VALIDATION_ERROR_22e0ec01}, + {"VUID-vkCreateWaylandSurfaceKHR-pCreateInfo-parameter", VALIDATION_ERROR_22e11e01}, + {"VUID-vkCreateWaylandSurfaceKHR-pSurface-parameter", VALIDATION_ERROR_22e24801}, + {"VUID-vkCreateWin32SurfaceKHR-instance-parameter", VALIDATION_ERROR_2300bc01}, + {"VUID-vkCreateWin32SurfaceKHR-pAllocator-parameter", VALIDATION_ERROR_2300ec01}, + {"VUID-vkCreateWin32SurfaceKHR-pCreateInfo-parameter", VALIDATION_ERROR_23011e01}, + {"VUID-vkCreateWin32SurfaceKHR-pSurface-parameter", VALIDATION_ERROR_23024801}, + {"VUID-vkCreateXcbSurfaceKHR-instance-parameter", VALIDATION_ERROR_2320bc01}, + {"VUID-vkCreateXcbSurfaceKHR-pAllocator-parameter", VALIDATION_ERROR_2320ec01}, + {"VUID-vkCreateXcbSurfaceKHR-pCreateInfo-parameter", VALIDATION_ERROR_23211e01}, + {"VUID-vkCreateXcbSurfaceKHR-pSurface-parameter", VALIDATION_ERROR_23224801}, + {"VUID-vkCreateXlibSurfaceKHR-instance-parameter", VALIDATION_ERROR_2340bc01}, + {"VUID-vkCreateXlibSurfaceKHR-pAllocator-parameter", VALIDATION_ERROR_2340ec01}, + {"VUID-vkCreateXlibSurfaceKHR-pCreateInfo-parameter", VALIDATION_ERROR_23411e01}, + {"VUID-vkCreateXlibSurfaceKHR-pSurface-parameter", VALIDATION_ERROR_23424801}, + {"VUID-vkDebugMarkerSetObjectNameEXT-device-parameter", VALIDATION_ERROR_23605601}, + {"VUID-vkDebugMarkerSetObjectNameEXT-pNameInfo-parameter", VALIDATION_ERROR_2361c201}, + {"VUID-vkDebugMarkerSetObjectTagEXT-device-parameter", VALIDATION_ERROR_23805601}, + {"VUID-vkDebugMarkerSetObjectTagEXT-pTagInfo-parameter", VALIDATION_ERROR_23825c01}, + {"VUID-vkDebugReportMessageEXT-object-01241", VALIDATION_ERROR_23a009b2}, + {"VUID-vkDebugReportMessageEXT-objectType-01498", VALIDATION_ERROR_23a00bb4}, + {"VUID-vkDebugReportMessageEXT-flags-parameter", VALIDATION_ERROR_23a09001}, + {"VUID-vkDebugReportMessageEXT-flags-requiredbitmask", VALIDATION_ERROR_23a09003}, + {"VUID-vkDebugReportMessageEXT-instance-parameter", VALIDATION_ERROR_23a0bc01}, + {"VUID-vkDebugReportMessageEXT-objectType-parameter", VALIDATION_ERROR_23a0da01}, + {"VUID-vkDebugReportMessageEXT-pLayerPrefix-parameter", VALIDATION_ERROR_23a1a001}, + {"VUID-vkDebugReportMessageEXT-pMessage-parameter", VALIDATION_ERROR_23a1b801}, + {"VUID-vkDestroyBuffer-buffer-00922", VALIDATION_ERROR_23c00734}, + {"VUID-vkDestroyBuffer-buffer-00923", VALIDATION_ERROR_23c00736}, + {"VUID-vkDestroyBuffer-buffer-00924", VALIDATION_ERROR_23c00738}, + {"VUID-vkDestroyBuffer-buffer-parameter", VALIDATION_ERROR_23c01a01}, + {"VUID-vkDestroyBuffer-buffer-parent", VALIDATION_ERROR_23c01a07}, + {"VUID-vkDestroyBuffer-device-parameter", VALIDATION_ERROR_23c05601}, + {"VUID-vkDestroyBuffer-pAllocator-parameter", VALIDATION_ERROR_23c0ec01}, + {"VUID-vkDestroyBufferView-bufferView-00936", VALIDATION_ERROR_23e00750}, + {"VUID-vkDestroyBufferView-bufferView-00937", VALIDATION_ERROR_23e00752}, + {"VUID-vkDestroyBufferView-bufferView-00938", VALIDATION_ERROR_23e00754}, + {"VUID-vkDestroyBufferView-bufferView-parameter", VALIDATION_ERROR_23e01c01}, + {"VUID-vkDestroyBufferView-bufferView-parent", VALIDATION_ERROR_23e01c07}, + {"VUID-vkDestroyBufferView-device-parameter", VALIDATION_ERROR_23e05601}, + {"VUID-vkDestroyBufferView-pAllocator-parameter", VALIDATION_ERROR_23e0ec01}, + {"VUID-vkDestroyCommandPool-commandPool-00041", VALIDATION_ERROR_24000052}, + {"VUID-vkDestroyCommandPool-commandPool-00042", VALIDATION_ERROR_24000054}, + {"VUID-vkDestroyCommandPool-commandPool-00043", VALIDATION_ERROR_24000056}, + {"VUID-vkDestroyCommandPool-commandPool-parameter", VALIDATION_ERROR_24002801}, + {"VUID-vkDestroyCommandPool-commandPool-parent", VALIDATION_ERROR_24002807}, + {"VUID-vkDestroyCommandPool-device-parameter", VALIDATION_ERROR_24005601}, + {"VUID-vkDestroyCommandPool-pAllocator-parameter", VALIDATION_ERROR_2400ec01}, + {"VUID-vkDestroyDebugReportCallbackEXT-instance-01242", VALIDATION_ERROR_242009b4}, + {"VUID-vkDestroyDebugReportCallbackEXT-instance-01243", VALIDATION_ERROR_242009b6}, + {"VUID-vkDestroyDebugReportCallbackEXT-callback-parameter", VALIDATION_ERROR_24201e01}, + {"VUID-vkDestroyDebugReportCallbackEXT-callback-parent", VALIDATION_ERROR_24201e07}, + {"VUID-vkDestroyDebugReportCallbackEXT-instance-parameter", VALIDATION_ERROR_2420bc01}, + {"VUID-vkDestroyDebugReportCallbackEXT-pAllocator-parameter", VALIDATION_ERROR_2420ec01}, + {"VUID-vkDestroyDescriptorPool-descriptorPool-00303", VALIDATION_ERROR_2440025e}, + {"VUID-vkDestroyDescriptorPool-descriptorPool-00304", VALIDATION_ERROR_24400260}, + {"VUID-vkDestroyDescriptorPool-descriptorPool-00305", VALIDATION_ERROR_24400262}, + {"VUID-vkDestroyDescriptorPool-descriptorPool-parameter", VALIDATION_ERROR_24404601}, + {"VUID-vkDestroyDescriptorPool-descriptorPool-parent", VALIDATION_ERROR_24404607}, + {"VUID-vkDestroyDescriptorPool-device-parameter", VALIDATION_ERROR_24405601}, + {"VUID-vkDestroyDescriptorPool-pAllocator-parameter", VALIDATION_ERROR_2440ec01}, + {"VUID-vkDestroyDescriptorSetLayout-descriptorSetLayout-00284", VALIDATION_ERROR_24600238}, + {"VUID-vkDestroyDescriptorSetLayout-descriptorSetLayout-00285", VALIDATION_ERROR_2460023a}, + {"VUID-vkDestroyDescriptorSetLayout-descriptorSetLayout-parameter", VALIDATION_ERROR_24604c01}, + {"VUID-vkDestroyDescriptorSetLayout-descriptorSetLayout-parent", VALIDATION_ERROR_24604c07}, + {"VUID-vkDestroyDescriptorSetLayout-device-parameter", VALIDATION_ERROR_24605601}, + {"VUID-vkDestroyDescriptorSetLayout-pAllocator-parameter", VALIDATION_ERROR_2460ec01}, + {"VUID-vkDestroyDescriptorUpdateTemplate-descriptorSetLayout-00356", VALIDATION_ERROR_248002c8}, + {"VUID-vkDestroyDescriptorUpdateTemplate-descriptorSetLayout-00357", VALIDATION_ERROR_248002ca}, + {"VUID-vkDestroyDescriptorUpdateTemplate-descriptorUpdateTemplate-parameter", VALIDATION_ERROR_24805201}, + {"VUID-vkDestroyDescriptorUpdateTemplate-descriptorUpdateTemplate-parent", VALIDATION_ERROR_24805207}, + {"VUID-vkDestroyDescriptorUpdateTemplate-device-parameter", VALIDATION_ERROR_24805601}, + {"VUID-vkDestroyDescriptorUpdateTemplate-pAllocator-parameter", VALIDATION_ERROR_2480ec01}, + {"VUID-vkDestroyDevice-device-00378", VALIDATION_ERROR_24a002f4}, + {"VUID-vkDestroyDevice-device-00379", VALIDATION_ERROR_24a002f6}, + {"VUID-vkDestroyDevice-device-00380", VALIDATION_ERROR_24a002f8}, + {"VUID-vkDestroyDevice-device-parameter", VALIDATION_ERROR_24a05601}, + {"VUID-vkDestroyDevice-pAllocator-parameter", VALIDATION_ERROR_24a0ec01}, + {"VUID-vkDestroyEvent-event-01145", VALIDATION_ERROR_24c008f2}, + {"VUID-vkDestroyEvent-event-01146", VALIDATION_ERROR_24c008f4}, + {"VUID-vkDestroyEvent-event-01147", VALIDATION_ERROR_24c008f6}, + {"VUID-vkDestroyEvent-device-parameter", VALIDATION_ERROR_24c05601}, + {"VUID-vkDestroyEvent-event-parameter", VALIDATION_ERROR_24c07e01}, + {"VUID-vkDestroyEvent-event-parent", VALIDATION_ERROR_24c07e07}, + {"VUID-vkDestroyEvent-pAllocator-parameter", VALIDATION_ERROR_24c0ec01}, + {"VUID-vkDestroyFence-fence-01120", VALIDATION_ERROR_24e008c0}, + {"VUID-vkDestroyFence-fence-01121", VALIDATION_ERROR_24e008c2}, + {"VUID-vkDestroyFence-fence-01122", VALIDATION_ERROR_24e008c4}, + {"VUID-vkDestroyFence-device-parameter", VALIDATION_ERROR_24e05601}, + {"VUID-vkDestroyFence-fence-parameter", VALIDATION_ERROR_24e08801}, + {"VUID-vkDestroyFence-fence-parent", VALIDATION_ERROR_24e08807}, + {"VUID-vkDestroyFence-pAllocator-parameter", VALIDATION_ERROR_24e0ec01}, + {"VUID-vkDestroyFramebuffer-framebuffer-00892", VALIDATION_ERROR_250006f8}, + {"VUID-vkDestroyFramebuffer-framebuffer-00893", VALIDATION_ERROR_250006fa}, + {"VUID-vkDestroyFramebuffer-framebuffer-00894", VALIDATION_ERROR_250006fc}, + {"VUID-vkDestroyFramebuffer-device-parameter", VALIDATION_ERROR_25005601}, + {"VUID-vkDestroyFramebuffer-framebuffer-parameter", VALIDATION_ERROR_25009401}, + {"VUID-vkDestroyFramebuffer-framebuffer-parent", VALIDATION_ERROR_25009407}, + {"VUID-vkDestroyFramebuffer-pAllocator-parameter", VALIDATION_ERROR_2500ec01}, + {"VUID-vkDestroyImage-image-01000", VALIDATION_ERROR_252007d0}, + {"VUID-vkDestroyImage-image-01001", VALIDATION_ERROR_252007d2}, + {"VUID-vkDestroyImage-image-01002", VALIDATION_ERROR_252007d4}, + {"VUID-vkDestroyImage-device-parameter", VALIDATION_ERROR_25205601}, + {"VUID-vkDestroyImage-image-parameter", VALIDATION_ERROR_2520a001}, + {"VUID-vkDestroyImage-image-parent", VALIDATION_ERROR_2520a007}, + {"VUID-vkDestroyImage-pAllocator-parameter", VALIDATION_ERROR_2520ec01}, + {"VUID-vkDestroyImageView-imageView-01026", VALIDATION_ERROR_25400804}, + {"VUID-vkDestroyImageView-imageView-01027", VALIDATION_ERROR_25400806}, + {"VUID-vkDestroyImageView-imageView-01028", VALIDATION_ERROR_25400808}, + {"VUID-vkDestroyImageView-device-parameter", VALIDATION_ERROR_25405601}, + {"VUID-vkDestroyImageView-imageView-parameter", VALIDATION_ERROR_2540b001}, + {"VUID-vkDestroyImageView-imageView-parent", VALIDATION_ERROR_2540b007}, + {"VUID-vkDestroyImageView-pAllocator-parameter", VALIDATION_ERROR_2540ec01}, + {"VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-01352", VALIDATION_ERROR_25600a90}, + {"VUID-vkDestroyIndirectCommandsLayoutNVX-objectTable-01353", VALIDATION_ERROR_25600a92}, + {"VUID-vkDestroyIndirectCommandsLayoutNVX-objectTable-01354", VALIDATION_ERROR_25600a94}, + {"VUID-vkDestroyIndirectCommandsLayoutNVX-device-parameter", VALIDATION_ERROR_25605601}, + {"VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-parameter", VALIDATION_ERROR_2560b401}, + {"VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-parent", VALIDATION_ERROR_2560b407}, + {"VUID-vkDestroyIndirectCommandsLayoutNVX-pAllocator-parameter", VALIDATION_ERROR_2560ec01}, + {"VUID-vkDestroyInstance-instance-00629", VALIDATION_ERROR_258004ea}, + {"VUID-vkDestroyInstance-instance-00630", VALIDATION_ERROR_258004ec}, + {"VUID-vkDestroyInstance-instance-00631", VALIDATION_ERROR_258004ee}, + {"VUID-vkDestroyInstance-instance-parameter", VALIDATION_ERROR_2580bc01}, + {"VUID-vkDestroyInstance-pAllocator-parameter", VALIDATION_ERROR_2580ec01}, + {"VUID-vkDestroyObjectTableNVX-objectTable-01361", VALIDATION_ERROR_25a00aa2}, + {"VUID-vkDestroyObjectTableNVX-objectTable-01362", VALIDATION_ERROR_25a00aa4}, + {"VUID-vkDestroyObjectTableNVX-objectTable-01363", VALIDATION_ERROR_25a00aa6}, + {"VUID-vkDestroyObjectTableNVX-device-parameter", VALIDATION_ERROR_25a05601}, + {"VUID-vkDestroyObjectTableNVX-objectTable-parameter", VALIDATION_ERROR_25a0d801}, + {"VUID-vkDestroyObjectTableNVX-objectTable-parent", VALIDATION_ERROR_25a0d807}, + {"VUID-vkDestroyObjectTableNVX-pAllocator-parameter", VALIDATION_ERROR_25a0ec01}, + {"VUID-vkDestroyPipeline-pipeline-00765", VALIDATION_ERROR_25c005fa}, + {"VUID-vkDestroyPipeline-pipeline-00766", VALIDATION_ERROR_25c005fc}, + {"VUID-vkDestroyPipeline-pipeline-00767", VALIDATION_ERROR_25c005fe}, + {"VUID-vkDestroyPipeline-device-parameter", VALIDATION_ERROR_25c05601}, + {"VUID-vkDestroyPipeline-pAllocator-parameter", VALIDATION_ERROR_25c0ec01}, + {"VUID-vkDestroyPipeline-pipeline-parameter", VALIDATION_ERROR_25c27c01}, + {"VUID-vkDestroyPipeline-pipeline-parent", VALIDATION_ERROR_25c27c07}, + {"VUID-vkDestroyPipelineCache-pipelineCache-00771", VALIDATION_ERROR_25e00606}, + {"VUID-vkDestroyPipelineCache-pipelineCache-00772", VALIDATION_ERROR_25e00608}, + {"VUID-vkDestroyPipelineCache-device-parameter", VALIDATION_ERROR_25e05601}, + {"VUID-vkDestroyPipelineCache-pAllocator-parameter", VALIDATION_ERROR_25e0ec01}, + {"VUID-vkDestroyPipelineCache-pipelineCache-parameter", VALIDATION_ERROR_25e28001}, + {"VUID-vkDestroyPipelineCache-pipelineCache-parent", VALIDATION_ERROR_25e28007}, + {"VUID-vkDestroyPipelineLayout-pipelineLayout-00299", VALIDATION_ERROR_26000256}, + {"VUID-vkDestroyPipelineLayout-pipelineLayout-00300", VALIDATION_ERROR_26000258}, + {"VUID-vkDestroyPipelineLayout-device-parameter", VALIDATION_ERROR_26005601}, + {"VUID-vkDestroyPipelineLayout-pAllocator-parameter", VALIDATION_ERROR_2600ec01}, + {"VUID-vkDestroyPipelineLayout-pipelineLayout-parameter", VALIDATION_ERROR_26028201}, + {"VUID-vkDestroyPipelineLayout-pipelineLayout-parent", VALIDATION_ERROR_26028207}, + {"VUID-vkDestroyQueryPool-queryPool-00793", VALIDATION_ERROR_26200632}, + {"VUID-vkDestroyQueryPool-queryPool-00794", VALIDATION_ERROR_26200634}, + {"VUID-vkDestroyQueryPool-queryPool-00795", VALIDATION_ERROR_26200636}, + {"VUID-vkDestroyQueryPool-device-parameter", VALIDATION_ERROR_26205601}, + {"VUID-vkDestroyQueryPool-pAllocator-parameter", VALIDATION_ERROR_2620ec01}, + {"VUID-vkDestroyQueryPool-queryPool-parameter", VALIDATION_ERROR_26229801}, + {"VUID-vkDestroyQueryPool-queryPool-parent", VALIDATION_ERROR_26229807}, + {"VUID-vkDestroyRenderPass-renderPass-00873", VALIDATION_ERROR_264006d2}, + {"VUID-vkDestroyRenderPass-renderPass-00874", VALIDATION_ERROR_264006d4}, + {"VUID-vkDestroyRenderPass-renderPass-00875", VALIDATION_ERROR_264006d6}, + {"VUID-vkDestroyRenderPass-device-parameter", VALIDATION_ERROR_26405601}, + {"VUID-vkDestroyRenderPass-pAllocator-parameter", VALIDATION_ERROR_2640ec01}, + {"VUID-vkDestroyRenderPass-renderPass-parameter", VALIDATION_ERROR_2642ae01}, + {"VUID-vkDestroyRenderPass-renderPass-parent", VALIDATION_ERROR_2642ae07}, + {"VUID-vkDestroySampler-sampler-01082", VALIDATION_ERROR_26600874}, + {"VUID-vkDestroySampler-sampler-01083", VALIDATION_ERROR_26600876}, + {"VUID-vkDestroySampler-sampler-01084", VALIDATION_ERROR_26600878}, + {"VUID-vkDestroySampler-device-parameter", VALIDATION_ERROR_26605601}, + {"VUID-vkDestroySampler-pAllocator-parameter", VALIDATION_ERROR_2660ec01}, + {"VUID-vkDestroySampler-sampler-parameter", VALIDATION_ERROR_2662b201}, + {"VUID-vkDestroySampler-sampler-parent", VALIDATION_ERROR_2662b207}, + {"VUID-vkDestroySemaphore-semaphore-01137", VALIDATION_ERROR_268008e2}, + {"VUID-vkDestroySemaphore-semaphore-01138", VALIDATION_ERROR_268008e4}, + {"VUID-vkDestroySemaphore-semaphore-01139", VALIDATION_ERROR_268008e6}, + {"VUID-vkDestroySemaphore-device-parameter", VALIDATION_ERROR_26805601}, + {"VUID-vkDestroySemaphore-pAllocator-parameter", VALIDATION_ERROR_2680ec01}, + {"VUID-vkDestroySemaphore-semaphore-parameter", VALIDATION_ERROR_2682b801}, + {"VUID-vkDestroySemaphore-semaphore-parent", VALIDATION_ERROR_2682b807}, + {"VUID-vkDestroyShaderModule-shaderModule-01092", VALIDATION_ERROR_26a00888}, + {"VUID-vkDestroyShaderModule-shaderModule-01093", VALIDATION_ERROR_26a0088a}, + {"VUID-vkDestroyShaderModule-device-parameter", VALIDATION_ERROR_26a05601}, + {"VUID-vkDestroyShaderModule-pAllocator-parameter", VALIDATION_ERROR_26a0ec01}, + {"VUID-vkDestroyShaderModule-shaderModule-parameter", VALIDATION_ERROR_26a2be01}, + {"VUID-vkDestroyShaderModule-shaderModule-parent", VALIDATION_ERROR_26a2be07}, + {"VUID-vkDestroySurfaceKHR-surface-01266", VALIDATION_ERROR_26c009e4}, + {"VUID-vkDestroySurfaceKHR-surface-01267", VALIDATION_ERROR_26c009e6}, + {"VUID-vkDestroySurfaceKHR-surface-01268", VALIDATION_ERROR_26c009e8}, + {"VUID-vkDestroySurfaceKHR-instance-parameter", VALIDATION_ERROR_26c0bc01}, + {"VUID-vkDestroySurfaceKHR-pAllocator-parameter", VALIDATION_ERROR_26c0ec01}, + {"VUID-vkDestroySurfaceKHR-surface-parameter", VALIDATION_ERROR_26c2ec01}, + {"VUID-vkDestroySurfaceKHR-surface-parent", VALIDATION_ERROR_26c2ec07}, + {"VUID-vkDestroySwapchainKHR-commonparent", VALIDATION_ERROR_26e00009}, + {"VUID-vkDestroySwapchainKHR-swapchain-01282", VALIDATION_ERROR_26e00a04}, + {"VUID-vkDestroySwapchainKHR-swapchain-01283", VALIDATION_ERROR_26e00a06}, + {"VUID-vkDestroySwapchainKHR-swapchain-01284", VALIDATION_ERROR_26e00a08}, + {"VUID-vkDestroySwapchainKHR-device-parameter", VALIDATION_ERROR_26e05601}, + {"VUID-vkDestroySwapchainKHR-pAllocator-parameter", VALIDATION_ERROR_26e0ec01}, + {"VUID-vkDestroySwapchainKHR-swapchain-parameter", VALIDATION_ERROR_26e2f001}, + {"VUID-vkDeviceWaitIdle-device-parameter", VALIDATION_ERROR_27005601}, + {"VUID-vkDisplayPowerControlEXT-device-parameter", VALIDATION_ERROR_27205601}, + {"VUID-vkDisplayPowerControlEXT-display-parameter", VALIDATION_ERROR_27206001}, + {"VUID-vkDisplayPowerControlEXT-pDisplayPowerInfo-parameter", VALIDATION_ERROR_27214e01}, + {"VUID-vkEndCommandBuffer-commandBuffer-00059", VALIDATION_ERROR_27400076}, + {"VUID-vkEndCommandBuffer-commandBuffer-00060", VALIDATION_ERROR_27400078}, + {"VUID-vkEndCommandBuffer-commandBuffer-00061", VALIDATION_ERROR_2740007a}, + {"VUID-vkEndCommandBuffer-commandBuffer-00062", VALIDATION_ERROR_2740007c}, + {"VUID-vkEndCommandBuffer-commandBuffer-01815", VALIDATION_ERROR_27400e2e}, + {"VUID-vkEndCommandBuffer-commandBuffer-parameter", VALIDATION_ERROR_27402401}, + {"VUID-vkEnumerateDeviceExtensionProperties-pLayerName-parameter", VALIDATION_ERROR_27619e01}, + {"VUID-vkEnumerateDeviceExtensionProperties-pProperties-parameter", VALIDATION_ERROR_2761f401}, + {"VUID-vkEnumerateDeviceExtensionProperties-pPropertyCount-parameter", VALIDATION_ERROR_2761f601}, + {"VUID-vkEnumerateDeviceExtensionProperties-physicalDevice-parameter", VALIDATION_ERROR_27627a01}, + {"VUID-vkEnumerateDeviceLayerProperties-pProperties-parameter", VALIDATION_ERROR_2781f401}, + {"VUID-vkEnumerateDeviceLayerProperties-pPropertyCount-parameter", VALIDATION_ERROR_2781f601}, + {"VUID-vkEnumerateDeviceLayerProperties-physicalDevice-parameter", VALIDATION_ERROR_27827a01}, + {"VUID-vkEnumerateInstanceExtensionProperties-pLayerName-parameter", VALIDATION_ERROR_27a19e01}, + {"VUID-vkEnumerateInstanceExtensionProperties-pProperties-parameter", VALIDATION_ERROR_27a1f401}, + {"VUID-vkEnumerateInstanceExtensionProperties-pPropertyCount-parameter", VALIDATION_ERROR_27a1f601}, + {"VUID-vkEnumerateInstanceLayerProperties-pProperties-parameter", VALIDATION_ERROR_27c1f401}, + {"VUID-vkEnumerateInstanceLayerProperties-pPropertyCount-parameter", VALIDATION_ERROR_27c1f601}, + {"VUID-vkEnumeratePhysicalDeviceGroups-instance-parameter", VALIDATION_ERROR_27e0bc01}, + {"VUID-vkEnumeratePhysicalDeviceGroups-pPhysicalDeviceGroupCount-parameter", VALIDATION_ERROR_27e1d801}, + {"VUID-vkEnumeratePhysicalDeviceGroups-pPhysicalDeviceGroupProperties-parameter", VALIDATION_ERROR_27e1da01}, + {"VUID-vkEnumeratePhysicalDevices-instance-parameter", VALIDATION_ERROR_2800bc01}, + {"VUID-vkEnumeratePhysicalDevices-pPhysicalDeviceCount-parameter", VALIDATION_ERROR_2801d601}, + {"VUID-vkEnumeratePhysicalDevices-pPhysicalDevices-parameter", VALIDATION_ERROR_2801dc01}, + {"VUID-vkFlushMappedMemoryRanges-device-parameter", VALIDATION_ERROR_28205601}, + {"VUID-vkFlushMappedMemoryRanges-memoryRangeCount-arraylength", VALIDATION_ERROR_2820c81b}, + {"VUID-vkFlushMappedMemoryRanges-pMemoryRanges-parameter", VALIDATION_ERROR_2821b201}, + {"VUID-vkFreeCommandBuffers-pCommandBuffers-00047", VALIDATION_ERROR_2840005e}, + {"VUID-vkFreeCommandBuffers-pCommandBuffers-00048", VALIDATION_ERROR_28400060}, + {"VUID-vkFreeCommandBuffers-commandBufferCount-arraylength", VALIDATION_ERROR_2840261b}, + {"VUID-vkFreeCommandBuffers-commandPool-parameter", VALIDATION_ERROR_28402801}, + {"VUID-vkFreeCommandBuffers-commandPool-parent", VALIDATION_ERROR_28402807}, + {"VUID-vkFreeCommandBuffers-device-parameter", VALIDATION_ERROR_28405601}, + {"VUID-vkFreeCommandBuffers-pCommandBuffers-parent", VALIDATION_ERROR_28411407}, + {"VUID-vkFreeDescriptorSets-pDescriptorSets-00309", VALIDATION_ERROR_2860026a}, + {"VUID-vkFreeDescriptorSets-pDescriptorSets-00310", VALIDATION_ERROR_2860026c}, + {"VUID-vkFreeDescriptorSets-pDescriptorSets-00311", VALIDATION_ERROR_2860026e}, + {"VUID-vkFreeDescriptorSets-descriptorPool-00312", VALIDATION_ERROR_28600270}, + {"VUID-vkFreeDescriptorSets-descriptorPool-parameter", VALIDATION_ERROR_28604601}, + {"VUID-vkFreeDescriptorSets-descriptorPool-parent", VALIDATION_ERROR_28604607}, + {"VUID-vkFreeDescriptorSets-descriptorSetCount-arraylength", VALIDATION_ERROR_28604a1b}, + {"VUID-vkFreeDescriptorSets-device-parameter", VALIDATION_ERROR_28605601}, + {"VUID-vkFreeDescriptorSets-pDescriptorSets-parent", VALIDATION_ERROR_28613007}, + {"VUID-vkFreeMemory-memory-00677", VALIDATION_ERROR_2880054a}, + {"VUID-vkFreeMemory-device-parameter", VALIDATION_ERROR_28805601}, + {"VUID-vkFreeMemory-memory-parameter", VALIDATION_ERROR_2880c601}, + {"VUID-vkFreeMemory-memory-parent", VALIDATION_ERROR_2880c607}, + {"VUID-vkFreeMemory-pAllocator-parameter", VALIDATION_ERROR_2880ec01}, + {"VUID-vkGetBufferMemoryRequirements-buffer-parameter", VALIDATION_ERROR_28a01a01}, + {"VUID-vkGetBufferMemoryRequirements-buffer-parent", VALIDATION_ERROR_28a01a07}, + {"VUID-vkGetBufferMemoryRequirements-device-parameter", VALIDATION_ERROR_28a05601}, + {"VUID-vkGetBufferMemoryRequirements-pMemoryRequirements-parameter", VALIDATION_ERROR_28a1b401}, + {"VUID-vkGetDeviceGroupPeerMemoryFeatures-heapIndex-00691", VALIDATION_ERROR_28c00566}, + {"VUID-vkGetDeviceGroupPeerMemoryFeatures-localDeviceIndex-00692", VALIDATION_ERROR_28c00568}, + {"VUID-vkGetDeviceGroupPeerMemoryFeatures-remoteDeviceIndex-00693", VALIDATION_ERROR_28c0056a}, + {"VUID-vkGetDeviceGroupPeerMemoryFeatures-localDeviceIndex-00694", VALIDATION_ERROR_28c0056c}, + {"VUID-vkGetDeviceGroupPeerMemoryFeatures-device-parameter", VALIDATION_ERROR_28c05601}, + {"VUID-vkGetDeviceGroupPeerMemoryFeatures-pPeerMemoryFeatures-parameter", VALIDATION_ERROR_28c1d401}, + {"VUID-vkGetDeviceGroupPeerMemoryFeatures-pPeerMemoryFeatures-requiredbitmask", VALIDATION_ERROR_28c1d403}, + {"VUID-vkGetDeviceGroupPresentCapabilitiesKHR-device-parameter", VALIDATION_ERROR_28e05601}, + {"VUID-vkGetDeviceGroupPresentCapabilitiesKHR-pDeviceGroupPresentCapabilities-parameter", VALIDATION_ERROR_28e13c01}, + {"VUID-vkGetDeviceGroupSurfacePresentModesKHR-commonparent", VALIDATION_ERROR_29000009}, + {"VUID-vkGetDeviceGroupSurfacePresentModesKHR-device-parameter", VALIDATION_ERROR_29005601}, + {"VUID-vkGetDeviceGroupSurfacePresentModesKHR-pModes-parameter", VALIDATION_ERROR_2901be01}, + {"VUID-vkGetDeviceGroupSurfacePresentModesKHR-surface-parameter", VALIDATION_ERROR_2902ec01}, + {"VUID-vkGetDeviceMemoryCommitment-memory-00690", VALIDATION_ERROR_29200564}, + {"VUID-vkGetDeviceMemoryCommitment-device-parameter", VALIDATION_ERROR_29205601}, + {"VUID-vkGetDeviceMemoryCommitment-memory-parameter", VALIDATION_ERROR_2920c601}, + {"VUID-vkGetDeviceMemoryCommitment-memory-parent", VALIDATION_ERROR_2920c607}, + {"VUID-vkGetDeviceMemoryCommitment-pCommittedMemoryInBytes-parameter", VALIDATION_ERROR_29211801}, + {"VUID-vkGetDeviceProcAddr-device-parameter", VALIDATION_ERROR_29405601}, + {"VUID-vkGetDeviceProcAddr-pName-parameter", VALIDATION_ERROR_2941c001}, + {"VUID-vkGetDeviceQueue-queueFamilyIndex-00384", VALIDATION_ERROR_29600300}, + {"VUID-vkGetDeviceQueue-queueIndex-00385", VALIDATION_ERROR_29600302}, + {"VUID-vkGetDeviceQueue-flags-01841", VALIDATION_ERROR_29600e62}, + {"VUID-vkGetDeviceQueue-device-parameter", VALIDATION_ERROR_29605601}, + {"VUID-vkGetDeviceQueue-pQueue-parameter", VALIDATION_ERROR_2961fc01}, + {"VUID-vkGetDisplayModePropertiesKHR-display-parameter", VALIDATION_ERROR_29806001}, + {"VUID-vkGetDisplayModePropertiesKHR-pProperties-parameter", VALIDATION_ERROR_2981f401}, + {"VUID-vkGetDisplayModePropertiesKHR-pPropertyCount-parameter", VALIDATION_ERROR_2981f601}, + {"VUID-vkGetDisplayModePropertiesKHR-physicalDevice-parameter", VALIDATION_ERROR_29827a01}, + {"VUID-vkGetDisplayPlaneCapabilitiesKHR-mode-parameter", VALIDATION_ERROR_29a0ce01}, + {"VUID-vkGetDisplayPlaneCapabilitiesKHR-pCapabilities-parameter", VALIDATION_ERROR_29a10a01}, + {"VUID-vkGetDisplayPlaneCapabilitiesKHR-physicalDevice-parameter", VALIDATION_ERROR_29a27a01}, + {"VUID-vkGetDisplayPlaneSupportedDisplaysKHR-planeIndex-01249", VALIDATION_ERROR_29c009c2}, + {"VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplayCount-parameter", VALIDATION_ERROR_29c14a01}, + {"VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplays-parameter", VALIDATION_ERROR_29c15201}, + {"VUID-vkGetDisplayPlaneSupportedDisplaysKHR-physicalDevice-parameter", VALIDATION_ERROR_29c27a01}, + {"VUID-vkGetEventStatus-device-parameter", VALIDATION_ERROR_29e05601}, + {"VUID-vkGetEventStatus-event-parameter", VALIDATION_ERROR_29e07e01}, + {"VUID-vkGetEventStatus-event-parent", VALIDATION_ERROR_29e07e07}, + {"VUID-vkGetFenceStatus-device-parameter", VALIDATION_ERROR_2a005601}, + {"VUID-vkGetFenceStatus-fence-parameter", VALIDATION_ERROR_2a008801}, + {"VUID-vkGetFenceStatus-fence-parent", VALIDATION_ERROR_2a008807}, + {"VUID-vkGetImageMemoryRequirements-image-01588", VALIDATION_ERROR_2a200c68}, + {"VUID-vkGetImageMemoryRequirements-device-parameter", VALIDATION_ERROR_2a205601}, + {"VUID-vkGetImageMemoryRequirements-image-parameter", VALIDATION_ERROR_2a20a001}, + {"VUID-vkGetImageMemoryRequirements-image-parent", VALIDATION_ERROR_2a20a007}, + {"VUID-vkGetImageMemoryRequirements-pMemoryRequirements-parameter", VALIDATION_ERROR_2a21b401}, + {"VUID-vkGetImageSparseMemoryRequirements-device-parameter", VALIDATION_ERROR_2a405601}, + {"VUID-vkGetImageSparseMemoryRequirements-image-parameter", VALIDATION_ERROR_2a40a001}, + {"VUID-vkGetImageSparseMemoryRequirements-image-parent", VALIDATION_ERROR_2a40a007}, + {"VUID-vkGetImageSparseMemoryRequirements-pSparseMemoryRequirementCount-parameter", VALIDATION_ERROR_2a423601}, + {"VUID-vkGetImageSparseMemoryRequirements-pSparseMemoryRequirements-parameter", VALIDATION_ERROR_2a423801}, + {"VUID-vkGetImageSubresourceLayout-image-00996", VALIDATION_ERROR_2a6007c8}, + {"VUID-vkGetImageSubresourceLayout-aspectMask-00997", VALIDATION_ERROR_2a6007ca}, + {"VUID-vkGetImageSubresourceLayout-format-01581", VALIDATION_ERROR_2a600c5a}, + {"VUID-vkGetImageSubresourceLayout-format-01582", VALIDATION_ERROR_2a600c5c}, + {"VUID-vkGetImageSubresourceLayout-mipLevel-01716", VALIDATION_ERROR_2a600d68}, + {"VUID-vkGetImageSubresourceLayout-arrayLayer-01717", VALIDATION_ERROR_2a600d6a}, + {"VUID-vkGetImageSubresourceLayout-image-01895", VALIDATION_ERROR_2a600ece}, + {"VUID-vkGetImageSubresourceLayout-device-parameter", VALIDATION_ERROR_2a605601}, + {"VUID-vkGetImageSubresourceLayout-image-parameter", VALIDATION_ERROR_2a60a001}, + {"VUID-vkGetImageSubresourceLayout-image-parent", VALIDATION_ERROR_2a60a007}, + {"VUID-vkGetImageSubresourceLayout-pLayout-parameter", VALIDATION_ERROR_2a61a201}, + {"VUID-vkGetImageSubresourceLayout-pSubresource-parameter", VALIDATION_ERROR_2a624401}, + {"VUID-vkGetInstanceProcAddr-instance-parameter", VALIDATION_ERROR_2a80bc01}, + {"VUID-vkGetInstanceProcAddr-pName-parameter", VALIDATION_ERROR_2a81c001}, + {"VUID-vkGetMemoryFdKHR-device-parameter", VALIDATION_ERROR_2aa05601}, + {"VUID-vkGetMemoryFdKHR-pFd-parameter", VALIDATION_ERROR_2aa16c01}, + {"VUID-vkGetMemoryFdKHR-pGetFdInfo-parameter", VALIDATION_ERROR_2aa39e01}, + {"VUID-vkGetMemoryFdPropertiesKHR-fd-00673", VALIDATION_ERROR_2ac00542}, + {"VUID-vkGetMemoryFdPropertiesKHR-handleType-00674", VALIDATION_ERROR_2ac00544}, + {"VUID-vkGetMemoryFdPropertiesKHR-device-parameter", VALIDATION_ERROR_2ac05601}, + {"VUID-vkGetMemoryFdPropertiesKHR-handleType-parameter", VALIDATION_ERROR_2ac09c01}, + {"VUID-vkGetMemoryFdPropertiesKHR-pMemoryFdProperties-parameter", VALIDATION_ERROR_2ac1ae01}, + {"VUID-vkGetMemoryWin32HandleKHR-device-parameter", VALIDATION_ERROR_2ae05601}, + {"VUID-vkGetMemoryWin32HandleKHR-pHandle-parameter", VALIDATION_ERROR_2ae17c01}, + {"VUID-vkGetMemoryWin32HandleKHR-pGetWin32HandleInfo-parameter", VALIDATION_ERROR_2ae3a001}, + {"VUID-vkGetMemoryWin32HandleNV-handleType-01326", VALIDATION_ERROR_2b000a5c}, + {"VUID-vkGetMemoryWin32HandleNV-device-parameter", VALIDATION_ERROR_2b005601}, + {"VUID-vkGetMemoryWin32HandleNV-handleType-parameter", VALIDATION_ERROR_2b009c01}, + {"VUID-vkGetMemoryWin32HandleNV-handleType-requiredbitmask", VALIDATION_ERROR_2b009c03}, + {"VUID-vkGetMemoryWin32HandleNV-memory-parameter", VALIDATION_ERROR_2b00c601}, + {"VUID-vkGetMemoryWin32HandleNV-memory-parent", VALIDATION_ERROR_2b00c607}, + {"VUID-vkGetMemoryWin32HandleNV-pHandle-parameter", VALIDATION_ERROR_2b017c01}, + {"VUID-vkGetMemoryWin32HandlePropertiesKHR-handle-00665", VALIDATION_ERROR_2b200532}, + {"VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-00666", VALIDATION_ERROR_2b200534}, + {"VUID-vkGetMemoryWin32HandlePropertiesKHR-device-parameter", VALIDATION_ERROR_2b205601}, + {"VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-parameter", VALIDATION_ERROR_2b209c01}, + {"VUID-vkGetMemoryWin32HandlePropertiesKHR-pMemoryWin32HandleProperties-parameter", VALIDATION_ERROR_2b21b601}, + {"VUID-vkGetPastPresentationTimingGOOGLE-commonparent", VALIDATION_ERROR_2b400009}, + {"VUID-vkGetPastPresentationTimingGOOGLE-device-parameter", VALIDATION_ERROR_2b405601}, + {"VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimingCount-parameter", VALIDATION_ERROR_2b41ec01}, + {"VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimings-parameter", VALIDATION_ERROR_2b41ee01}, + {"VUID-vkGetPastPresentationTimingGOOGLE-swapchain-parameter", VALIDATION_ERROR_2b42f001}, + {"VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pProperties-parameter", VALIDATION_ERROR_2b61f401}, + {"VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pPropertyCount-parameter", VALIDATION_ERROR_2b61f601}, + {"VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-physicalDevice-parameter", VALIDATION_ERROR_2b627a01}, + {"VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pProperties-parameter", VALIDATION_ERROR_2b81f401}, + {"VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pPropertyCount-parameter", VALIDATION_ERROR_2b81f601}, + {"VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-physicalDevice-parameter", VALIDATION_ERROR_2b827a01}, + {"VUID-vkGetPhysicalDeviceExternalBufferProperties-pExternalBufferInfo-parameter", VALIDATION_ERROR_2ba16201}, + {"VUID-vkGetPhysicalDeviceExternalBufferProperties-pExternalBufferProperties-parameter", VALIDATION_ERROR_2ba16401}, + {"VUID-vkGetPhysicalDeviceExternalBufferProperties-physicalDevice-parameter", VALIDATION_ERROR_2ba27a01}, + {"VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-externalHandleType-parameter", VALIDATION_ERROR_2bc08201}, + {"VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-flags-parameter", VALIDATION_ERROR_2bc09001}, + {"VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-format-parameter", VALIDATION_ERROR_2bc09201}, + {"VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-pExternalImageFormatProperties-parameter", VALIDATION_ERROR_2bc16601}, + {"VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-physicalDevice-parameter", VALIDATION_ERROR_2bc27a01}, + {"VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-tiling-parameter", VALIDATION_ERROR_2bc2fa01}, + {"VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-type-parameter", VALIDATION_ERROR_2bc30401}, + {"VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-parameter", VALIDATION_ERROR_2bc30601}, + {"VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-requiredbitmask", VALIDATION_ERROR_2bc30603}, + {"VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-pExternalSemaphoreInfo-parameter", VALIDATION_ERROR_2be16801}, + {"VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-pExternalSemaphoreProperties-parameter", VALIDATION_ERROR_2be16a01}, + {"VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-physicalDevice-parameter", VALIDATION_ERROR_2be27a01}, + {"VUID-vkGetPhysicalDeviceFeatures-pFeatures-parameter", VALIDATION_ERROR_2c016e01}, + {"VUID-vkGetPhysicalDeviceFeatures-physicalDevice-parameter", VALIDATION_ERROR_2c027a01}, + {"VUID-vkGetPhysicalDeviceFeatures2-pFeatures-parameter", VALIDATION_ERROR_2c216e01}, + {"VUID-vkGetPhysicalDeviceFeatures2-physicalDevice-parameter", VALIDATION_ERROR_2c227a01}, + {"VUID-vkGetPhysicalDeviceFormatProperties-format-parameter", VALIDATION_ERROR_2c409201}, + {"VUID-vkGetPhysicalDeviceFormatProperties-pFormatProperties-parameter", VALIDATION_ERROR_2c417601}, + {"VUID-vkGetPhysicalDeviceFormatProperties-physicalDevice-parameter", VALIDATION_ERROR_2c427a01}, + {"VUID-vkGetPhysicalDeviceFormatProperties2-format-parameter", VALIDATION_ERROR_2c609201}, + {"VUID-vkGetPhysicalDeviceFormatProperties2-pFormatProperties-parameter", VALIDATION_ERROR_2c617601}, + {"VUID-vkGetPhysicalDeviceFormatProperties2-physicalDevice-parameter", VALIDATION_ERROR_2c627a01}, + {"VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-pFeatures-parameter", VALIDATION_ERROR_2c816e01}, + {"VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-pLimits-parameter", VALIDATION_ERROR_2c81a401}, + {"VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-physicalDevice-parameter", VALIDATION_ERROR_2c827a01}, + {"VUID-vkGetPhysicalDeviceImageFormatProperties-flags-parameter", VALIDATION_ERROR_2ca09001}, + {"VUID-vkGetPhysicalDeviceImageFormatProperties-format-parameter", VALIDATION_ERROR_2ca09201}, + {"VUID-vkGetPhysicalDeviceImageFormatProperties-pImageFormatProperties-parameter", VALIDATION_ERROR_2ca18401}, + {"VUID-vkGetPhysicalDeviceImageFormatProperties-physicalDevice-parameter", VALIDATION_ERROR_2ca27a01}, + {"VUID-vkGetPhysicalDeviceImageFormatProperties-tiling-parameter", VALIDATION_ERROR_2ca2fa01}, + {"VUID-vkGetPhysicalDeviceImageFormatProperties-type-parameter", VALIDATION_ERROR_2ca30401}, + {"VUID-vkGetPhysicalDeviceImageFormatProperties-usage-parameter", VALIDATION_ERROR_2ca30601}, + {"VUID-vkGetPhysicalDeviceImageFormatProperties-usage-requiredbitmask", VALIDATION_ERROR_2ca30603}, + {"VUID-vkGetPhysicalDeviceImageFormatProperties2-pNext-01868", VALIDATION_ERROR_2cc00e98}, + {"VUID-vkGetPhysicalDeviceImageFormatProperties2-pImageFormatInfo-parameter", VALIDATION_ERROR_2cc18201}, + {"VUID-vkGetPhysicalDeviceImageFormatProperties2-pImageFormatProperties-parameter", VALIDATION_ERROR_2cc18401}, + {"VUID-vkGetPhysicalDeviceImageFormatProperties2-physicalDevice-parameter", VALIDATION_ERROR_2cc27a01}, + {"VUID-vkGetPhysicalDeviceMemoryProperties-pMemoryProperties-parameter", VALIDATION_ERROR_2ce1b001}, + {"VUID-vkGetPhysicalDeviceMemoryProperties-physicalDevice-parameter", VALIDATION_ERROR_2ce27a01}, + {"VUID-vkGetPhysicalDeviceMemoryProperties2-pMemoryProperties-parameter", VALIDATION_ERROR_2d01b001}, + {"VUID-vkGetPhysicalDeviceMemoryProperties2-physicalDevice-parameter", VALIDATION_ERROR_2d027a01}, + {"VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-queueFamilyIndex-01265", VALIDATION_ERROR_2d2009e2}, + {"VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-connection-parameter", VALIDATION_ERROR_2d203001}, + {"VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-physicalDevice-parameter", VALIDATION_ERROR_2d227a01}, + {"VUID-vkGetPhysicalDevicePresentRectanglesKHR-commonparent", VALIDATION_ERROR_2d400009}, + {"VUID-vkGetPhysicalDevicePresentRectanglesKHR-pRectCount-parameter", VALIDATION_ERROR_2d420a01}, + {"VUID-vkGetPhysicalDevicePresentRectanglesKHR-pRects-parameter", VALIDATION_ERROR_2d420e01}, + {"VUID-vkGetPhysicalDevicePresentRectanglesKHR-physicalDevice-parameter", VALIDATION_ERROR_2d427a01}, + {"VUID-vkGetPhysicalDevicePresentRectanglesKHR-surface-parameter", VALIDATION_ERROR_2d42ec01}, + {"VUID-vkGetPhysicalDeviceProperties-pProperties-parameter", VALIDATION_ERROR_2d61f401}, + {"VUID-vkGetPhysicalDeviceProperties-physicalDevice-parameter", VALIDATION_ERROR_2d627a01}, + {"VUID-vkGetPhysicalDeviceProperties2-pProperties-parameter", VALIDATION_ERROR_2d81f401}, + {"VUID-vkGetPhysicalDeviceProperties2-physicalDevice-parameter", VALIDATION_ERROR_2d827a01}, + {"VUID-vkGetPhysicalDeviceQueueFamilyProperties-pQueueFamilyProperties-parameter", VALIDATION_ERROR_2da20001}, + {"VUID-vkGetPhysicalDeviceQueueFamilyProperties-pQueueFamilyPropertyCount-parameter", VALIDATION_ERROR_2da20201}, + {"VUID-vkGetPhysicalDeviceQueueFamilyProperties-physicalDevice-parameter", VALIDATION_ERROR_2da27a01}, + {"VUID-vkGetPhysicalDeviceQueueFamilyProperties2-pQueueFamilyProperties-parameter", VALIDATION_ERROR_2dc20001}, + {"VUID-vkGetPhysicalDeviceQueueFamilyProperties2-pQueueFamilyPropertyCount-parameter", VALIDATION_ERROR_2dc20201}, + {"VUID-vkGetPhysicalDeviceQueueFamilyProperties2-physicalDevice-parameter", VALIDATION_ERROR_2dc27a01}, + {"VUID-vkGetPhysicalDeviceSparseImageFormatProperties-samples-01094", VALIDATION_ERROR_2de0088c}, + {"VUID-vkGetPhysicalDeviceSparseImageFormatProperties-format-parameter", VALIDATION_ERROR_2de09201}, + {"VUID-vkGetPhysicalDeviceSparseImageFormatProperties-pProperties-parameter", VALIDATION_ERROR_2de1f401}, + {"VUID-vkGetPhysicalDeviceSparseImageFormatProperties-pPropertyCount-parameter", VALIDATION_ERROR_2de1f601}, + {"VUID-vkGetPhysicalDeviceSparseImageFormatProperties-physicalDevice-parameter", VALIDATION_ERROR_2de27a01}, + {"VUID-vkGetPhysicalDeviceSparseImageFormatProperties-samples-parameter", VALIDATION_ERROR_2de2b401}, + {"VUID-vkGetPhysicalDeviceSparseImageFormatProperties-tiling-parameter", VALIDATION_ERROR_2de2fa01}, + {"VUID-vkGetPhysicalDeviceSparseImageFormatProperties-type-parameter", VALIDATION_ERROR_2de30401}, + {"VUID-vkGetPhysicalDeviceSparseImageFormatProperties-usage-parameter", VALIDATION_ERROR_2de30601}, + {"VUID-vkGetPhysicalDeviceSparseImageFormatProperties-usage-requiredbitmask", VALIDATION_ERROR_2de30603}, + {"VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-pFormatInfo-parameter", VALIDATION_ERROR_2e017401}, + {"VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-pProperties-parameter", VALIDATION_ERROR_2e01f401}, + {"VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-pPropertyCount-parameter", VALIDATION_ERROR_2e01f601}, + {"VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-physicalDevice-parameter", VALIDATION_ERROR_2e027a01}, + {"VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-commonparent", VALIDATION_ERROR_2e200009}, + {"VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-pSurfaceCapabilities-parameter", VALIDATION_ERROR_2e224a01}, + {"VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-physicalDevice-parameter", VALIDATION_ERROR_2e227a01}, + {"VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-surface-parameter", VALIDATION_ERROR_2e22ec01}, + {"VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceCapabilities-parameter", VALIDATION_ERROR_2e424a01}, + {"VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceInfo-parameter", VALIDATION_ERROR_2e425001}, + {"VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-physicalDevice-parameter", VALIDATION_ERROR_2e427a01}, + {"VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-commonparent", VALIDATION_ERROR_2e600009}, + {"VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-pSurfaceCapabilities-parameter", VALIDATION_ERROR_2e624a01}, + {"VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-physicalDevice-parameter", VALIDATION_ERROR_2e627a01}, + {"VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-surface-parameter", VALIDATION_ERROR_2e62ec01}, + {"VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceFormatCount-parameter", VALIDATION_ERROR_2e824c01}, + {"VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceFormats-parameter", VALIDATION_ERROR_2e824e01}, + {"VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceInfo-parameter", VALIDATION_ERROR_2e825001}, + {"VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-physicalDevice-parameter", VALIDATION_ERROR_2e827a01}, + {"VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-commonparent", VALIDATION_ERROR_2ea00009}, + {"VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormatCount-parameter", VALIDATION_ERROR_2ea24c01}, + {"VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormats-parameter", VALIDATION_ERROR_2ea24e01}, + {"VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-physicalDevice-parameter", VALIDATION_ERROR_2ea27a01}, + {"VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-surface-parameter", VALIDATION_ERROR_2ea2ec01}, + {"VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-commonparent", VALIDATION_ERROR_2ec00009}, + {"VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModeCount-parameter", VALIDATION_ERROR_2ec1e801}, + {"VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModes-parameter", VALIDATION_ERROR_2ec1ea01}, + {"VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-physicalDevice-parameter", VALIDATION_ERROR_2ec27a01}, + {"VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-surface-parameter", VALIDATION_ERROR_2ec2ec01}, + {"VUID-vkGetPhysicalDeviceSurfaceSupportKHR-commonparent", VALIDATION_ERROR_2ee00009}, + {"VUID-vkGetPhysicalDeviceSurfaceSupportKHR-queueFamilyIndex-01269", VALIDATION_ERROR_2ee009ea}, + {"VUID-vkGetPhysicalDeviceSurfaceSupportKHR-pSupported-parameter", VALIDATION_ERROR_2ee24601}, + {"VUID-vkGetPhysicalDeviceSurfaceSupportKHR-physicalDevice-parameter", VALIDATION_ERROR_2ee27a01}, + {"VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter", VALIDATION_ERROR_2ee2ec01}, + {"VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-queueFamilyIndex-01306", VALIDATION_ERROR_2f000a34}, + {"VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-display-parameter", VALIDATION_ERROR_2f006001}, + {"VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-physicalDevice-parameter", VALIDATION_ERROR_2f027a01}, + {"VUID-vkGetPhysicalDeviceWin32PresentationSupportKHR-queueFamilyIndex-01309", VALIDATION_ERROR_2f200a3a}, + {"VUID-vkGetPhysicalDeviceWin32PresentationSupportKHR-physicalDevice-parameter", VALIDATION_ERROR_2f227a01}, + {"VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-queueFamilyIndex-01312", VALIDATION_ERROR_2f400a40}, + {"VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-connection-parameter", VALIDATION_ERROR_2f403001}, + {"VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-physicalDevice-parameter", VALIDATION_ERROR_2f427a01}, + {"VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-queueFamilyIndex-01315", VALIDATION_ERROR_2f600a46}, + {"VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-dpy-parameter", VALIDATION_ERROR_2f606601}, + {"VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-physicalDevice-parameter", VALIDATION_ERROR_2f627a01}, + {"VUID-vkGetPipelineCacheData-device-parameter", VALIDATION_ERROR_2f805601}, + {"VUID-vkGetPipelineCacheData-pData-parameter", VALIDATION_ERROR_2f812201}, + {"VUID-vkGetPipelineCacheData-pDataSize-parameter", VALIDATION_ERROR_2f812401}, + {"VUID-vkGetPipelineCacheData-pipelineCache-parameter", VALIDATION_ERROR_2f828001}, + {"VUID-vkGetPipelineCacheData-pipelineCache-parent", VALIDATION_ERROR_2f828007}, + {"VUID-vkGetQueryPoolResults-firstQuery-00813", VALIDATION_ERROR_2fa0065a}, + {"VUID-vkGetQueryPoolResults-flags-00814", VALIDATION_ERROR_2fa0065c}, + {"VUID-vkGetQueryPoolResults-flags-00815", VALIDATION_ERROR_2fa0065e}, + {"VUID-vkGetQueryPoolResults-firstQuery-00816", VALIDATION_ERROR_2fa00660}, + {"VUID-vkGetQueryPoolResults-dataSize-00817", VALIDATION_ERROR_2fa00662}, + {"VUID-vkGetQueryPoolResults-queryType-00818", VALIDATION_ERROR_2fa00664}, + {"VUID-vkGetQueryPoolResults-dataSize-arraylength", VALIDATION_ERROR_2fa03c1b}, + {"VUID-vkGetQueryPoolResults-device-parameter", VALIDATION_ERROR_2fa05601}, + {"VUID-vkGetQueryPoolResults-flags-parameter", VALIDATION_ERROR_2fa09001}, + {"VUID-vkGetQueryPoolResults-pData-parameter", VALIDATION_ERROR_2fa12201}, + {"VUID-vkGetQueryPoolResults-queryPool-parameter", VALIDATION_ERROR_2fa29801}, + {"VUID-vkGetQueryPoolResults-queryPool-parent", VALIDATION_ERROR_2fa29807}, + {"VUID-vkGetRandROutputDisplayEXT-dpy-parameter", VALIDATION_ERROR_2fc06601}, + {"VUID-vkGetRandROutputDisplayEXT-pDisplay-parameter", VALIDATION_ERROR_2fc14801}, + {"VUID-vkGetRandROutputDisplayEXT-physicalDevice-parameter", VALIDATION_ERROR_2fc27a01}, + {"VUID-vkGetRefreshCycleDurationGOOGLE-commonparent", VALIDATION_ERROR_2fe00009}, + {"VUID-vkGetRefreshCycleDurationGOOGLE-device-parameter", VALIDATION_ERROR_2fe05601}, + {"VUID-vkGetRefreshCycleDurationGOOGLE-pDisplayTimingProperties-parameter", VALIDATION_ERROR_2fe15001}, + {"VUID-vkGetRefreshCycleDurationGOOGLE-swapchain-parameter", VALIDATION_ERROR_2fe2f001}, + {"VUID-vkGetRenderAreaGranularity-device-parameter", VALIDATION_ERROR_30005601}, + {"VUID-vkGetRenderAreaGranularity-pGranularity-parameter", VALIDATION_ERROR_30017a01}, + {"VUID-vkGetRenderAreaGranularity-renderPass-parameter", VALIDATION_ERROR_3002ae01}, + {"VUID-vkGetRenderAreaGranularity-renderPass-parent", VALIDATION_ERROR_3002ae07}, + {"VUID-vkGetSemaphoreFdKHR-device-parameter", VALIDATION_ERROR_30205601}, + {"VUID-vkGetSemaphoreFdKHR-pFd-parameter", VALIDATION_ERROR_30216c01}, + {"VUID-vkGetSemaphoreFdKHR-pGetFdInfo-parameter", VALIDATION_ERROR_30239e01}, + {"VUID-vkGetSemaphoreWin32HandleKHR-device-parameter", VALIDATION_ERROR_30405601}, + {"VUID-vkGetSemaphoreWin32HandleKHR-pHandle-parameter", VALIDATION_ERROR_30417c01}, + {"VUID-vkGetSemaphoreWin32HandleKHR-pGetWin32HandleInfo-parameter", VALIDATION_ERROR_3043a001}, + {"VUID-vkGetSwapchainCounterEXT-commonparent", VALIDATION_ERROR_30600009}, + {"VUID-vkGetSwapchainCounterEXT-swapchain-01245", VALIDATION_ERROR_306009ba}, + {"VUID-vkGetSwapchainCounterEXT-counter-parameter", VALIDATION_ERROR_30603601}, + {"VUID-vkGetSwapchainCounterEXT-device-parameter", VALIDATION_ERROR_30605601}, + {"VUID-vkGetSwapchainCounterEXT-pCounterValue-parameter", VALIDATION_ERROR_30611c01}, + {"VUID-vkGetSwapchainCounterEXT-swapchain-parameter", VALIDATION_ERROR_3062f001}, + {"VUID-vkGetSwapchainImagesKHR-commonparent", VALIDATION_ERROR_30800009}, + {"VUID-vkGetSwapchainImagesKHR-device-parameter", VALIDATION_ERROR_30805601}, + {"VUID-vkGetSwapchainImagesKHR-pSwapchainImageCount-parameter", VALIDATION_ERROR_30825401}, + {"VUID-vkGetSwapchainImagesKHR-pSwapchainImages-parameter", VALIDATION_ERROR_30825601}, + {"VUID-vkGetSwapchainImagesKHR-swapchain-parameter", VALIDATION_ERROR_3082f001}, + {"VUID-vkGetSwapchainStatusKHR-commonparent", VALIDATION_ERROR_30a00009}, + {"VUID-vkGetSwapchainStatusKHR-device-parameter", VALIDATION_ERROR_30a05601}, + {"VUID-vkGetSwapchainStatusKHR-swapchain-parameter", VALIDATION_ERROR_30a2f001}, + {"VUID-vkImportSemaphoreFdKHR-semaphore-01142", VALIDATION_ERROR_30c008ec}, + {"VUID-vkImportSemaphoreFdKHR-device-parameter", VALIDATION_ERROR_30c05601}, + {"VUID-vkImportSemaphoreFdKHR-pImportSemaphoreFdInfo-parameter", VALIDATION_ERROR_30c18e01}, + {"VUID-vkImportSemaphoreWin32HandleKHR-device-parameter", VALIDATION_ERROR_30e05601}, + {"VUID-vkImportSemaphoreWin32HandleKHR-pImportSemaphoreWin32HandleInfo-parameter", VALIDATION_ERROR_30e19001}, + {"VUID-vkInvalidateMappedMemoryRanges-device-parameter", VALIDATION_ERROR_31005601}, + {"VUID-vkInvalidateMappedMemoryRanges-memoryRangeCount-arraylength", VALIDATION_ERROR_3100c81b}, + {"VUID-vkInvalidateMappedMemoryRanges-pMemoryRanges-parameter", VALIDATION_ERROR_3101b201}, + {"VUID-vkMapMemory-memory-00678", VALIDATION_ERROR_3120054c}, + {"VUID-vkMapMemory-offset-00679", VALIDATION_ERROR_3120054e}, + {"VUID-vkMapMemory-size-00680", VALIDATION_ERROR_31200550}, + {"VUID-vkMapMemory-size-00681", VALIDATION_ERROR_31200552}, + {"VUID-vkMapMemory-memory-00682", VALIDATION_ERROR_31200554}, + {"VUID-vkMapMemory-memory-00683", VALIDATION_ERROR_31200556}, + {"VUID-vkMapMemory-device-parameter", VALIDATION_ERROR_31205601}, + {"VUID-vkMapMemory-flags-zerobitmask", VALIDATION_ERROR_31209005}, + {"VUID-vkMapMemory-memory-parameter", VALIDATION_ERROR_3120c601}, + {"VUID-vkMapMemory-memory-parent", VALIDATION_ERROR_3120c607}, + {"VUID-vkMapMemory-ppData-parameter", VALIDATION_ERROR_31228c01}, + {"VUID-vkMergePipelineCaches-dstCache-00770", VALIDATION_ERROR_31400604}, + {"VUID-vkMergePipelineCaches-device-parameter", VALIDATION_ERROR_31405601}, + {"VUID-vkMergePipelineCaches-dstCache-parameter", VALIDATION_ERROR_31406e01}, + {"VUID-vkMergePipelineCaches-dstCache-parent", VALIDATION_ERROR_31406e07}, + {"VUID-vkMergePipelineCaches-pSrcCaches-parameter", VALIDATION_ERROR_31423c01}, + {"VUID-vkMergePipelineCaches-pSrcCaches-parent", VALIDATION_ERROR_31423c07}, + {"VUID-vkMergePipelineCaches-srcCacheCount-arraylength", VALIDATION_ERROR_3142ca1b}, + {"VUID-vkQueueBindSparse-commonparent", VALIDATION_ERROR_31600009}, + {"VUID-vkQueueBindSparse-queuetype", VALIDATION_ERROR_31600011}, + {"VUID-vkQueueBindSparse-fence-01113", VALIDATION_ERROR_316008b2}, + {"VUID-vkQueueBindSparse-fence-01114", VALIDATION_ERROR_316008b4}, + {"VUID-vkQueueBindSparse-pSignalSemaphores-01115", VALIDATION_ERROR_316008b6}, + {"VUID-vkQueueBindSparse-pWaitSemaphores-01116", VALIDATION_ERROR_316008b8}, + {"VUID-vkQueueBindSparse-pWaitSemaphores-01117", VALIDATION_ERROR_316008ba}, + {"VUID-vkQueueBindSparse-fence-parameter", VALIDATION_ERROR_31608801}, + {"VUID-vkQueueBindSparse-pBindInfo-parameter", VALIDATION_ERROR_3160f801}, + {"VUID-vkQueueBindSparse-queue-parameter", VALIDATION_ERROR_31629c01}, + {"VUID-vkQueuePresentKHR-pSwapchains-01292", VALIDATION_ERROR_31800a18}, + {"VUID-vkQueuePresentKHR-pSwapchains-01293", VALIDATION_ERROR_31800a1a}, + {"VUID-vkQueuePresentKHR-pWaitSemaphores-01294", VALIDATION_ERROR_31800a1c}, + {"VUID-vkQueuePresentKHR-pWaitSemaphores-01295", VALIDATION_ERROR_31800a1e}, + {"VUID-vkQueuePresentKHR-pPresentInfo-parameter", VALIDATION_ERROR_3181e601}, + {"VUID-vkQueuePresentKHR-queue-parameter", VALIDATION_ERROR_31829c01}, + {"VUID-vkQueueSubmit-commonparent", VALIDATION_ERROR_31a00009}, + {"VUID-vkQueueSubmit-fence-00063", VALIDATION_ERROR_31a0007e}, + {"VUID-vkQueueSubmit-fence-00064", VALIDATION_ERROR_31a00080}, + {"VUID-vkQueueSubmit-pCommandBuffers-00065", VALIDATION_ERROR_31a00082}, + {"VUID-vkQueueSubmit-pWaitDstStageMask-00066", VALIDATION_ERROR_31a00084}, + {"VUID-vkQueueSubmit-pSignalSemaphores-00067", VALIDATION_ERROR_31a00086}, + {"VUID-vkQueueSubmit-pWaitSemaphores-00068", VALIDATION_ERROR_31a00088}, + {"VUID-vkQueueSubmit-pWaitSemaphores-00069", VALIDATION_ERROR_31a0008a}, + {"VUID-vkQueueSubmit-pCommandBuffers-00070", VALIDATION_ERROR_31a0008c}, + {"VUID-vkQueueSubmit-pCommandBuffers-00071", VALIDATION_ERROR_31a0008e}, + {"VUID-vkQueueSubmit-pCommandBuffers-00072", VALIDATION_ERROR_31a00090}, + {"VUID-vkQueueSubmit-pCommandBuffers-00073", VALIDATION_ERROR_31a00092}, + {"VUID-vkQueueSubmit-pCommandBuffers-00074", VALIDATION_ERROR_31a00094}, + {"VUID-vkQueueSubmit-fence-parameter", VALIDATION_ERROR_31a08801}, + {"VUID-vkQueueSubmit-pSubmits-parameter", VALIDATION_ERROR_31a24001}, + {"VUID-vkQueueSubmit-queue-parameter", VALIDATION_ERROR_31a29c01}, + {"VUID-vkQueueWaitIdle-queue-parameter", VALIDATION_ERROR_31c29c01}, + {"VUID-vkRegisterDeviceEventEXT-device-parameter", VALIDATION_ERROR_31e05601}, + {"VUID-vkRegisterDeviceEventEXT-pAllocator-parameter", VALIDATION_ERROR_31e0ec01}, + {"VUID-vkRegisterDeviceEventEXT-pDeviceEventInfo-parameter", VALIDATION_ERROR_31e13a01}, + {"VUID-vkRegisterDeviceEventEXT-pFence-parameter", VALIDATION_ERROR_31e17001}, + {"VUID-vkRegisterDisplayEventEXT-device-parameter", VALIDATION_ERROR_32005601}, + {"VUID-vkRegisterDisplayEventEXT-display-parameter", VALIDATION_ERROR_32006001}, + {"VUID-vkRegisterDisplayEventEXT-pAllocator-parameter", VALIDATION_ERROR_3200ec01}, + {"VUID-vkRegisterDisplayEventEXT-pDisplayEventInfo-parameter", VALIDATION_ERROR_32014c01}, + {"VUID-vkRegisterDisplayEventEXT-pFence-parameter", VALIDATION_ERROR_32017001}, + {"VUID-vkRegisterObjectsNVX-pObjectTableEntry-01364", VALIDATION_ERROR_32200aa8}, + {"VUID-vkRegisterObjectsNVX-pObjectIndices-01365", VALIDATION_ERROR_32200aaa}, + {"VUID-vkRegisterObjectsNVX-pObjectIndices-01366", VALIDATION_ERROR_32200aac}, + {"VUID-vkRegisterObjectsNVX-device-parameter", VALIDATION_ERROR_32205601}, + {"VUID-vkRegisterObjectsNVX-objectCount-arraylength", VALIDATION_ERROR_3220d61b}, + {"VUID-vkRegisterObjectsNVX-objectTable-parameter", VALIDATION_ERROR_3220d801}, + {"VUID-vkRegisterObjectsNVX-objectTable-parent", VALIDATION_ERROR_3220d807}, + {"VUID-vkRegisterObjectsNVX-pObjectIndices-parameter", VALIDATION_ERROR_3221cc01}, + {"VUID-vkRegisterObjectsNVX-ppObjectTableEntries-parameter", VALIDATION_ERROR_32229201}, + {"VUID-vkReleaseDisplayEXT-display-parameter", VALIDATION_ERROR_32406001}, + {"VUID-vkReleaseDisplayEXT-physicalDevice-parameter", VALIDATION_ERROR_32427a01}, + {"VUID-vkResetCommandBuffer-commandBuffer-00045", VALIDATION_ERROR_3260005a}, + {"VUID-vkResetCommandBuffer-commandBuffer-00046", VALIDATION_ERROR_3260005c}, + {"VUID-vkResetCommandBuffer-commandBuffer-parameter", VALIDATION_ERROR_32602401}, + {"VUID-vkResetCommandBuffer-flags-parameter", VALIDATION_ERROR_32609001}, + {"VUID-vkResetCommandPool-commandPool-00040", VALIDATION_ERROR_32800050}, + {"VUID-vkResetCommandPool-commandPool-parameter", VALIDATION_ERROR_32802801}, + {"VUID-vkResetCommandPool-commandPool-parent", VALIDATION_ERROR_32802807}, + {"VUID-vkResetCommandPool-device-parameter", VALIDATION_ERROR_32805601}, + {"VUID-vkResetCommandPool-flags-parameter", VALIDATION_ERROR_32809001}, + {"VUID-vkResetDescriptorPool-descriptorPool-00313", VALIDATION_ERROR_32a00272}, + {"VUID-vkResetDescriptorPool-descriptorPool-parameter", VALIDATION_ERROR_32a04601}, + {"VUID-vkResetDescriptorPool-descriptorPool-parent", VALIDATION_ERROR_32a04607}, + {"VUID-vkResetDescriptorPool-device-parameter", VALIDATION_ERROR_32a05601}, + {"VUID-vkResetDescriptorPool-flags-zerobitmask", VALIDATION_ERROR_32a09005}, + {"VUID-vkResetEvent-event-01148", VALIDATION_ERROR_32c008f8}, + {"VUID-vkResetEvent-device-parameter", VALIDATION_ERROR_32c05601}, + {"VUID-vkResetEvent-event-parameter", VALIDATION_ERROR_32c07e01}, + {"VUID-vkResetEvent-event-parent", VALIDATION_ERROR_32c07e07}, + {"VUID-vkResetFences-pFences-01123", VALIDATION_ERROR_32e008c6}, + {"VUID-vkResetFences-device-parameter", VALIDATION_ERROR_32e05601}, + {"VUID-vkResetFences-fenceCount-arraylength", VALIDATION_ERROR_32e08a1b}, + {"VUID-vkResetFences-pFences-parameter", VALIDATION_ERROR_32e17201}, + {"VUID-vkResetFences-pFences-parent", VALIDATION_ERROR_32e17207}, + {"VUID-vkSetEvent-device-parameter", VALIDATION_ERROR_33005601}, + {"VUID-vkSetEvent-event-parameter", VALIDATION_ERROR_33007e01}, + {"VUID-vkSetEvent-event-parent", VALIDATION_ERROR_33007e07}, + {"VUID-vkSetHdrMetadataEXT-commonparent", VALIDATION_ERROR_33200009}, + {"VUID-vkSetHdrMetadataEXT-device-parameter", VALIDATION_ERROR_33205601}, + {"VUID-vkSetHdrMetadataEXT-pMetadata-parameter", VALIDATION_ERROR_3321ba01}, + {"VUID-vkSetHdrMetadataEXT-pSwapchains-parameter", VALIDATION_ERROR_33225801}, + {"VUID-vkSetHdrMetadataEXT-swapchainCount-arraylength", VALIDATION_ERROR_3322f21b}, + {"VUID-vkTrimCommandPool-commandPool-parameter", VALIDATION_ERROR_33402801}, + {"VUID-vkTrimCommandPool-commandPool-parent", VALIDATION_ERROR_33402807}, + {"VUID-vkTrimCommandPool-device-parameter", VALIDATION_ERROR_33405601}, + {"VUID-vkTrimCommandPool-flags-zerobitmask", VALIDATION_ERROR_33409005}, + {"VUID-vkUnmapMemory-memory-00689", VALIDATION_ERROR_33600562}, + {"VUID-vkUnmapMemory-device-parameter", VALIDATION_ERROR_33605601}, + {"VUID-vkUnmapMemory-memory-parameter", VALIDATION_ERROR_3360c601}, + {"VUID-vkUnmapMemory-memory-parent", VALIDATION_ERROR_3360c607}, + {"VUID-vkUnregisterObjectsNVX-pObjectIndices-01373", VALIDATION_ERROR_33800aba}, + {"VUID-vkUnregisterObjectsNVX-pObjectEntryTypes-01374", VALIDATION_ERROR_33800abc}, + {"VUID-vkUnregisterObjectsNVX-None-01375", VALIDATION_ERROR_33800abe}, + {"VUID-vkUnregisterObjectsNVX-device-parameter", VALIDATION_ERROR_33805601}, + {"VUID-vkUnregisterObjectsNVX-objectCount-arraylength", VALIDATION_ERROR_3380d61b}, + {"VUID-vkUnregisterObjectsNVX-objectTable-parameter", VALIDATION_ERROR_3380d801}, + {"VUID-vkUnregisterObjectsNVX-objectTable-parent", VALIDATION_ERROR_3380d807}, + {"VUID-vkUnregisterObjectsNVX-pObjectEntryTypes-parameter", VALIDATION_ERROR_3381c801}, + {"VUID-vkUnregisterObjectsNVX-pObjectIndices-parameter", VALIDATION_ERROR_3381cc01}, + {"VUID-vkUpdateDescriptorSetWithTemplate-pData-01685", VALIDATION_ERROR_33a00d2a}, + {"VUID-vkUpdateDescriptorSetWithTemplate-descriptorSet-parameter", VALIDATION_ERROR_33a04801}, + {"VUID-vkUpdateDescriptorSetWithTemplate-descriptorUpdateTemplate-parameter", VALIDATION_ERROR_33a05201}, + {"VUID-vkUpdateDescriptorSetWithTemplate-descriptorUpdateTemplate-parent", VALIDATION_ERROR_33a05207}, + {"VUID-vkUpdateDescriptorSetWithTemplate-device-parameter", VALIDATION_ERROR_33a05601}, + {"VUID-vkUpdateDescriptorSets-dstSet-00314", VALIDATION_ERROR_33c00274}, + {"VUID-vkUpdateDescriptorSets-None-03047", VALIDATION_ERROR_33c017ce}, + {"VUID-vkUpdateDescriptorSets-device-parameter", VALIDATION_ERROR_33c05601}, + {"VUID-vkUpdateDescriptorSets-pDescriptorCopies-parameter", VALIDATION_ERROR_33c12c01}, + {"VUID-vkUpdateDescriptorSets-pDescriptorWrites-parameter", VALIDATION_ERROR_33c13601}, + {"VUID-vkWaitForFences-device-parameter", VALIDATION_ERROR_33e05601}, + {"VUID-vkWaitForFences-fenceCount-arraylength", VALIDATION_ERROR_33e08a1b}, + {"VUID-vkWaitForFences-pFences-parameter", VALIDATION_ERROR_33e17201}, + {"VUID-vkWaitForFences-pFences-parent", VALIDATION_ERROR_33e17207}, + {"VUID-VkPhysicalDeviceProperties2-pNext-pNext", VALIDATION_ERROR_3401c40d}, + {"VUID-VkPhysicalDeviceProperties2-sType-sType", VALIDATION_ERROR_3402b00b}, + {"VUID-VkPhysicalDeviceProperties2-sType-unique", VALIDATION_ERROR_3402b00f}, + {"VUID-VkFormatProperties2-pNext-pNext", VALIDATION_ERROR_3421c40d}, + {"VUID-VkFormatProperties2-sType-sType", VALIDATION_ERROR_3422b00b}, + {"VUID-VkImageFormatProperties2-pNext-pNext", VALIDATION_ERROR_3441c40d}, + {"VUID-VkImageFormatProperties2-sType-sType", VALIDATION_ERROR_3442b00b}, + {"VUID-VkImageFormatProperties2-sType-unique", VALIDATION_ERROR_3442b00f}, + {"VUID-VkPhysicalDeviceMemoryProperties2-pNext-pNext", VALIDATION_ERROR_3461c40d}, + {"VUID-VkPhysicalDeviceMemoryProperties2-sType-sType", VALIDATION_ERROR_3462b00b}, + {"VUID-VkSurfaceCapabilities2KHR-pNext-pNext", VALIDATION_ERROR_3481c40d}, + {"VUID-VkSurfaceCapabilities2KHR-sType-sType", VALIDATION_ERROR_3482b00b}, + {"VUID-VkDeviceGroupPresentCapabilitiesKHR-pNext-pNext", VALIDATION_ERROR_34a1c40d}, + {"VUID-VkDeviceGroupPresentCapabilitiesKHR-sType-sType", VALIDATION_ERROR_34a2b00b}, + {"VUID-VkExternalBufferProperties-pNext-pNext", VALIDATION_ERROR_34c1c40d}, + {"VUID-VkExternalBufferProperties-sType-sType", VALIDATION_ERROR_34c2b00b}, + {"VUID-VkExternalSemaphoreProperties-pNext-pNext", VALIDATION_ERROR_3521c40d}, + {"VUID-VkExternalSemaphoreProperties-sType-sType", VALIDATION_ERROR_3522b00b}, + {"VUID-VkQueueFamilyProperties2-pNext-pNext", VALIDATION_ERROR_3541c40d}, + {"VUID-VkQueueFamilyProperties2-sType-sType", VALIDATION_ERROR_3542b00b}, + {"VUID-VkSparseImageFormatProperties2-pNext-pNext", VALIDATION_ERROR_3561c40d}, + {"VUID-VkSparseImageFormatProperties2-sType-sType", VALIDATION_ERROR_3562b00b}, + {"VUID-VkSurfaceFormat2KHR-pNext-pNext", VALIDATION_ERROR_3581c40d}, + {"VUID-VkSurfaceFormat2KHR-sType-sType", VALIDATION_ERROR_3582b00b}, + {"VUID-VkPhysicalDeviceMultiviewProperties-sType-sType", VALIDATION_ERROR_35c2b00b}, + {"VUID-VkExternalImageFormatProperties-sType-sType", VALIDATION_ERROR_3602b00b}, + {"VUID-VkPhysicalDeviceIDProperties-sType-sType", VALIDATION_ERROR_3622b00b}, + {"VUID-VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX-sType-sType", VALIDATION_ERROR_3642b00b}, + {"VUID-VkSharedPresentSurfaceCapabilitiesKHR-sType-sType", VALIDATION_ERROR_37e2b00b}, + {"VUID-VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT-sType-sType", VALIDATION_ERROR_3822b00b}, + {"VUID-VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT-sType-sType", VALIDATION_ERROR_3842b00b}, + {"VUID-VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT-sType-sType", VALIDATION_ERROR_3862b00b}, + {"VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-srcPremultiplied-01424", VALIDATION_ERROR_38800b20}, + {"VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-dstPremultiplied-01425", VALIDATION_ERROR_38800b22}, + {"VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-blendOverlap-01426", VALIDATION_ERROR_38800b24}, + {"VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-sType-sType", VALIDATION_ERROR_3882b00b}, + {"VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-blendOverlap-parameter", VALIDATION_ERROR_38834a01}, + {"VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationTableEnable-01405", VALIDATION_ERROR_38a00afa}, + {"VUID-VkPipelineCoverageModulationStateCreateInfoNV-flags-zerobitmask", VALIDATION_ERROR_38a09005}, + {"VUID-VkPipelineCoverageModulationStateCreateInfoNV-sType-sType", VALIDATION_ERROR_38a2b00b}, + {"VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationMode-parameter", VALIDATION_ERROR_38a34c01}, + {"VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationTableCount-arraylength", VALIDATION_ERROR_38a34e1b}, + {"VUID-VkPipelineCoverageToColorStateCreateInfoNV-coverageToColorEnable-01404", VALIDATION_ERROR_38c00af8}, + {"VUID-VkPipelineCoverageToColorStateCreateInfoNV-flags-zerobitmask", VALIDATION_ERROR_38c09005}, + {"VUID-VkPipelineCoverageToColorStateCreateInfoNV-sType-sType", VALIDATION_ERROR_38c2b00b}, + {"VUID-VkSamplerReductionModeCreateInfoEXT-sType-sType", VALIDATION_ERROR_38e2b00b}, + {"VUID-VkSamplerReductionModeCreateInfoEXT-reductionMode-parameter", VALIDATION_ERROR_38e35001}, + {"VUID-VkExportFenceCreateInfo-handleTypes-01446", VALIDATION_ERROR_39400b4c}, + {"VUID-VkExportFenceCreateInfo-handleTypes-parameter", VALIDATION_ERROR_39409e01}, + {"VUID-VkExportFenceCreateInfo-sType-sType", VALIDATION_ERROR_3942b00b}, + {"VUID-VkPhysicalDeviceExternalFenceInfo-handleType-parameter", VALIDATION_ERROR_39609c01}, + {"VUID-VkPhysicalDeviceExternalFenceInfo-pNext-pNext", VALIDATION_ERROR_3961c40d}, + {"VUID-VkPhysicalDeviceExternalFenceInfo-sType-sType", VALIDATION_ERROR_3962b00b}, + {"VUID-VkExternalFenceProperties-pNext-pNext", VALIDATION_ERROR_3981c40d}, + {"VUID-VkExternalFenceProperties-sType-sType", VALIDATION_ERROR_3982b00b}, + {"VUID-vkGetPhysicalDeviceExternalFenceProperties-physicalDevice-parameter", VALIDATION_ERROR_39a27a01}, + {"VUID-vkGetPhysicalDeviceExternalFenceProperties-pExternalFenceInfo-parameter", VALIDATION_ERROR_39a3a201}, + {"VUID-vkGetPhysicalDeviceExternalFenceProperties-pExternalFenceProperties-parameter", VALIDATION_ERROR_39a3a401}, + {"VUID-VkImportFenceFdInfoKHR-handleType-01464", VALIDATION_ERROR_39c00b70}, + {"VUID-VkImportFenceFdInfoKHR-fd-01541", VALIDATION_ERROR_39c00c0a}, + {"VUID-VkImportFenceFdInfoKHR-fence-parameter", VALIDATION_ERROR_39c08801}, + {"VUID-VkImportFenceFdInfoKHR-flags-parameter", VALIDATION_ERROR_39c09001}, + {"VUID-VkImportFenceFdInfoKHR-handleType-parameter", VALIDATION_ERROR_39c09c01}, + {"VUID-VkImportFenceFdInfoKHR-pNext-pNext", VALIDATION_ERROR_39c1c40d}, + {"VUID-VkImportFenceFdInfoKHR-sType-sType", VALIDATION_ERROR_39c2b00b}, + {"VUID-VkFenceGetFdInfoKHR-handleType-01453", VALIDATION_ERROR_39e00b5a}, + {"VUID-VkFenceGetFdInfoKHR-handleType-01454", VALIDATION_ERROR_39e00b5c}, + {"VUID-VkFenceGetFdInfoKHR-fence-01455", VALIDATION_ERROR_39e00b5e}, + {"VUID-VkFenceGetFdInfoKHR-handleType-01456", VALIDATION_ERROR_39e00b60}, + {"VUID-VkFenceGetFdInfoKHR-fence-parameter", VALIDATION_ERROR_39e08801}, + {"VUID-VkFenceGetFdInfoKHR-handleType-parameter", VALIDATION_ERROR_39e09c01}, + {"VUID-VkFenceGetFdInfoKHR-pNext-pNext", VALIDATION_ERROR_39e1c40d}, + {"VUID-VkFenceGetFdInfoKHR-sType-sType", VALIDATION_ERROR_39e2b00b}, + {"VUID-vkImportFenceFdKHR-fence-01463", VALIDATION_ERROR_3a000b6e}, + {"VUID-vkImportFenceFdKHR-device-parameter", VALIDATION_ERROR_3a005601}, + {"VUID-vkImportFenceFdKHR-pImportFenceFdInfo-parameter", VALIDATION_ERROR_3a03a801}, + {"VUID-vkGetFenceFdKHR-device-parameter", VALIDATION_ERROR_3a205601}, + {"VUID-vkGetFenceFdKHR-pFd-parameter", VALIDATION_ERROR_3a216c01}, + {"VUID-vkGetFenceFdKHR-pGetFdInfo-parameter", VALIDATION_ERROR_3a239e01}, + {"VUID-VkImportFenceWin32HandleInfoKHR-handleType-01457", VALIDATION_ERROR_3a400b62}, + {"VUID-VkImportFenceWin32HandleInfoKHR-handleType-01459", VALIDATION_ERROR_3a400b66}, + {"VUID-VkImportFenceWin32HandleInfoKHR-handleType-01460", VALIDATION_ERROR_3a400b68}, + {"VUID-VkImportFenceWin32HandleInfoKHR-handleType-01461", VALIDATION_ERROR_3a400b6a}, + {"VUID-VkImportFenceWin32HandleInfoKHR-handle-01462", VALIDATION_ERROR_3a400b6c}, + {"VUID-VkImportFenceWin32HandleInfoKHR-handle-01539", VALIDATION_ERROR_3a400c06}, + {"VUID-VkImportFenceWin32HandleInfoKHR-name-01540", VALIDATION_ERROR_3a400c08}, + {"VUID-VkImportFenceWin32HandleInfoKHR-fence-parameter", VALIDATION_ERROR_3a408801}, + {"VUID-VkImportFenceWin32HandleInfoKHR-flags-parameter", VALIDATION_ERROR_3a409001}, + {"VUID-VkImportFenceWin32HandleInfoKHR-handleType-parameter", VALIDATION_ERROR_3a409c01}, + {"VUID-VkImportFenceWin32HandleInfoKHR-pNext-pNext", VALIDATION_ERROR_3a41c40d}, + {"VUID-VkImportFenceWin32HandleInfoKHR-sType-sType", VALIDATION_ERROR_3a42b00b}, + {"VUID-VkExportFenceWin32HandleInfoKHR-handleTypes-01447", VALIDATION_ERROR_3a600b4e}, + {"VUID-VkExportFenceWin32HandleInfoKHR-pAttributes-parameter", VALIDATION_ERROR_3a60f401}, + {"VUID-VkExportFenceWin32HandleInfoKHR-sType-sType", VALIDATION_ERROR_3a62b00b}, + {"VUID-VkFenceGetWin32HandleInfoKHR-handleType-01448", VALIDATION_ERROR_3a800b50}, + {"VUID-VkFenceGetWin32HandleInfoKHR-handleType-01449", VALIDATION_ERROR_3a800b52}, + {"VUID-VkFenceGetWin32HandleInfoKHR-fence-01450", VALIDATION_ERROR_3a800b54}, + {"VUID-VkFenceGetWin32HandleInfoKHR-handleType-01451", VALIDATION_ERROR_3a800b56}, + {"VUID-VkFenceGetWin32HandleInfoKHR-handleType-01452", VALIDATION_ERROR_3a800b58}, + {"VUID-VkFenceGetWin32HandleInfoKHR-fence-parameter", VALIDATION_ERROR_3a808801}, + {"VUID-VkFenceGetWin32HandleInfoKHR-handleType-parameter", VALIDATION_ERROR_3a809c01}, + {"VUID-VkFenceGetWin32HandleInfoKHR-pNext-pNext", VALIDATION_ERROR_3a81c40d}, + {"VUID-VkFenceGetWin32HandleInfoKHR-sType-sType", VALIDATION_ERROR_3a82b00b}, + {"VUID-vkImportFenceWin32HandleKHR-device-parameter", VALIDATION_ERROR_3aa05601}, + {"VUID-vkImportFenceWin32HandleKHR-pImportFenceWin32HandleInfo-parameter", VALIDATION_ERROR_3aa3aa01}, + {"VUID-vkGetFenceWin32HandleKHR-device-parameter", VALIDATION_ERROR_3ac05601}, + {"VUID-vkGetFenceWin32HandleKHR-pHandle-parameter", VALIDATION_ERROR_3ac17c01}, + {"VUID-vkGetFenceWin32HandleKHR-pGetWin32HandleInfo-parameter", VALIDATION_ERROR_3ac3a001}, + {"VUID-VkSemaphoreGetFdInfoKHR-handleType-01132", VALIDATION_ERROR_3ae008d8}, + {"VUID-VkSemaphoreGetFdInfoKHR-semaphore-01133", VALIDATION_ERROR_3ae008da}, + {"VUID-VkSemaphoreGetFdInfoKHR-handleType-01134", VALIDATION_ERROR_3ae008dc}, + {"VUID-VkSemaphoreGetFdInfoKHR-handleType-01135", VALIDATION_ERROR_3ae008de}, + {"VUID-VkSemaphoreGetFdInfoKHR-handleType-01136", VALIDATION_ERROR_3ae008e0}, + {"VUID-VkSemaphoreGetFdInfoKHR-handleType-parameter", VALIDATION_ERROR_3ae09c01}, + {"VUID-VkSemaphoreGetFdInfoKHR-pNext-pNext", VALIDATION_ERROR_3ae1c40d}, + {"VUID-VkSemaphoreGetFdInfoKHR-sType-sType", VALIDATION_ERROR_3ae2b00b}, + {"VUID-VkSemaphoreGetFdInfoKHR-semaphore-parameter", VALIDATION_ERROR_3ae2b801}, + {"VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01126", VALIDATION_ERROR_3b0008cc}, + {"VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01127", VALIDATION_ERROR_3b0008ce}, + {"VUID-VkSemaphoreGetWin32HandleInfoKHR-semaphore-01128", VALIDATION_ERROR_3b0008d0}, + {"VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01129", VALIDATION_ERROR_3b0008d2}, + {"VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01130", VALIDATION_ERROR_3b0008d4}, + {"VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01131", VALIDATION_ERROR_3b0008d6}, + {"VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-parameter", VALIDATION_ERROR_3b009c01}, + {"VUID-VkSemaphoreGetWin32HandleInfoKHR-pNext-pNext", VALIDATION_ERROR_3b01c40d}, + {"VUID-VkSemaphoreGetWin32HandleInfoKHR-sType-sType", VALIDATION_ERROR_3b02b00b}, + {"VUID-VkSemaphoreGetWin32HandleInfoKHR-semaphore-parameter", VALIDATION_ERROR_3b02b801}, + {"VUID-VkMemoryGetFdInfoKHR-handleType-00671", VALIDATION_ERROR_3b20053e}, + {"VUID-VkMemoryGetFdInfoKHR-handleType-00672", VALIDATION_ERROR_3b200540}, + {"VUID-VkMemoryGetFdInfoKHR-handleType-parameter", VALIDATION_ERROR_3b209c01}, + {"VUID-VkMemoryGetFdInfoKHR-memory-parameter", VALIDATION_ERROR_3b20c601}, + {"VUID-VkMemoryGetFdInfoKHR-pNext-pNext", VALIDATION_ERROR_3b21c40d}, + {"VUID-VkMemoryGetFdInfoKHR-sType-sType", VALIDATION_ERROR_3b22b00b}, + {"VUID-VkMemoryGetWin32HandleInfoKHR-handleType-00662", VALIDATION_ERROR_3b40052c}, + {"VUID-VkMemoryGetWin32HandleInfoKHR-handleType-00663", VALIDATION_ERROR_3b40052e}, + {"VUID-VkMemoryGetWin32HandleInfoKHR-handleType-00664", VALIDATION_ERROR_3b400530}, + {"VUID-VkMemoryGetWin32HandleInfoKHR-handleType-parameter", VALIDATION_ERROR_3b409c01}, + {"VUID-VkMemoryGetWin32HandleInfoKHR-memory-parameter", VALIDATION_ERROR_3b40c601}, + {"VUID-VkMemoryGetWin32HandleInfoKHR-pNext-pNext", VALIDATION_ERROR_3b41c40d}, + {"VUID-VkMemoryGetWin32HandleInfoKHR-sType-sType", VALIDATION_ERROR_3b42b00b}, + {"VUID-VkMemoryDedicatedRequirements-sType-sType", VALIDATION_ERROR_3b62b00b}, + {"VUID-VkMemoryDedicatedAllocateInfo-commonparent", VALIDATION_ERROR_3b800009}, + {"VUID-VkMemoryDedicatedAllocateInfo-image-01432", VALIDATION_ERROR_3b800b30}, + {"VUID-VkMemoryDedicatedAllocateInfo-image-01433", VALIDATION_ERROR_3b800b32}, + {"VUID-VkMemoryDedicatedAllocateInfo-image-01434", VALIDATION_ERROR_3b800b34}, + {"VUID-VkMemoryDedicatedAllocateInfo-buffer-01435", VALIDATION_ERROR_3b800b36}, + {"VUID-VkMemoryDedicatedAllocateInfo-buffer-01436", VALIDATION_ERROR_3b800b38}, + {"VUID-VkMemoryDedicatedAllocateInfo-image-01797", VALIDATION_ERROR_3b800e0a}, + {"VUID-VkMemoryDedicatedAllocateInfo-image-01876", VALIDATION_ERROR_3b800ea8}, + {"VUID-VkMemoryDedicatedAllocateInfo-buffer-01877", VALIDATION_ERROR_3b800eaa}, + {"VUID-VkMemoryDedicatedAllocateInfo-image-01878", VALIDATION_ERROR_3b800eac}, + {"VUID-VkMemoryDedicatedAllocateInfo-buffer-01879", VALIDATION_ERROR_3b800eae}, + {"VUID-VkMemoryDedicatedAllocateInfo-buffer-parameter", VALIDATION_ERROR_3b801a01}, + {"VUID-VkMemoryDedicatedAllocateInfo-image-parameter", VALIDATION_ERROR_3b80a001}, + {"VUID-VkMemoryDedicatedAllocateInfo-sType-sType", VALIDATION_ERROR_3b82b00b}, + {"VUID-VkBufferMemoryRequirementsInfo2-buffer-parameter", VALIDATION_ERROR_3ba01a01}, + {"VUID-VkBufferMemoryRequirementsInfo2-pNext-pNext", VALIDATION_ERROR_3ba1c40d}, + {"VUID-VkBufferMemoryRequirementsInfo2-sType-sType", VALIDATION_ERROR_3ba2b00b}, + {"VUID-VkImageMemoryRequirementsInfo2-image-01589", VALIDATION_ERROR_3bc00c6a}, + {"VUID-VkImageMemoryRequirementsInfo2-image-01590", VALIDATION_ERROR_3bc00c6c}, + {"VUID-VkImageMemoryRequirementsInfo2-image-01591", VALIDATION_ERROR_3bc00c6e}, + {"VUID-VkImageMemoryRequirementsInfo2-image-01897", VALIDATION_ERROR_3bc00ed2}, + {"VUID-VkImageMemoryRequirementsInfo2-image-parameter", VALIDATION_ERROR_3bc0a001}, + {"VUID-VkImageMemoryRequirementsInfo2-pNext-pNext", VALIDATION_ERROR_3bc1c40d}, + {"VUID-VkImageMemoryRequirementsInfo2-sType-sType", VALIDATION_ERROR_3bc2b00b}, + {"VUID-VkImageSparseMemoryRequirementsInfo2-image-parameter", VALIDATION_ERROR_3be0a001}, + {"VUID-VkImageSparseMemoryRequirementsInfo2-pNext-pNext", VALIDATION_ERROR_3be1c40d}, + {"VUID-VkImageSparseMemoryRequirementsInfo2-sType-sType", VALIDATION_ERROR_3be2b00b}, + {"VUID-VkMemoryRequirements2-pNext-pNext", VALIDATION_ERROR_3c01c40d}, + {"VUID-VkMemoryRequirements2-sType-sType", VALIDATION_ERROR_3c02b00b}, + {"VUID-VkSparseImageMemoryRequirements2-pNext-pNext", VALIDATION_ERROR_3c21c40d}, + {"VUID-VkSparseImageMemoryRequirements2-sType-sType", VALIDATION_ERROR_3c22b00b}, + {"VUID-vkGetImageMemoryRequirements2-device-parameter", VALIDATION_ERROR_3c405601}, + {"VUID-vkGetImageMemoryRequirements2-pMemoryRequirements-parameter", VALIDATION_ERROR_3c41b401}, + {"VUID-vkGetImageMemoryRequirements2-pInfo-parameter", VALIDATION_ERROR_3c439c01}, + {"VUID-vkGetBufferMemoryRequirements2-device-parameter", VALIDATION_ERROR_3c605601}, + {"VUID-vkGetBufferMemoryRequirements2-pMemoryRequirements-parameter", VALIDATION_ERROR_3c61b401}, + {"VUID-vkGetBufferMemoryRequirements2-pInfo-parameter", VALIDATION_ERROR_3c639c01}, + {"VUID-vkGetImageSparseMemoryRequirements2-device-parameter", VALIDATION_ERROR_3c805601}, + {"VUID-vkGetImageSparseMemoryRequirements2-pSparseMemoryRequirementCount-parameter", VALIDATION_ERROR_3c823601}, + {"VUID-vkGetImageSparseMemoryRequirements2-pSparseMemoryRequirements-parameter", VALIDATION_ERROR_3c823801}, + {"VUID-vkGetImageSparseMemoryRequirements2-pInfo-parameter", VALIDATION_ERROR_3c839c01}, + {"VUID-VkPhysicalDevice16BitStorageFeatures-sType-sType", VALIDATION_ERROR_3ca2b00b}, + {"VUID-VkPhysicalDeviceVariablePointerFeatures-variablePointers-01431", VALIDATION_ERROR_3cc00b2e}, + {"VUID-VkPhysicalDeviceVariablePointerFeatures-sType-sType", VALIDATION_ERROR_3cc2b00b}, + {"VUID-VkSampleLocationsInfoEXT-sampleLocationsPerPixel-01526", VALIDATION_ERROR_3ce00bec}, + {"VUID-VkSampleLocationsInfoEXT-sampleLocationsCount-01527", VALIDATION_ERROR_3ce00bee}, + {"VUID-VkSampleLocationsInfoEXT-sType-sType", VALIDATION_ERROR_3ce2b00b}, + {"VUID-VkSampleLocationsInfoEXT-sampleLocationsPerPixel-parameter", VALIDATION_ERROR_3ce3b201}, + {"VUID-VkSampleLocationsInfoEXT-sampleLocationsCount-arraylength", VALIDATION_ERROR_3ce3b41b}, + {"VUID-VkSampleLocationsInfoEXT-pSampleLocations-parameter", VALIDATION_ERROR_3ce3b601}, + {"VUID-VkRenderPassSampleLocationsBeginInfoEXT-sType-sType", VALIDATION_ERROR_3d02b00b}, + {"VUID-VkRenderPassSampleLocationsBeginInfoEXT-pAttachmentInitialSampleLocations-parameter", VALIDATION_ERROR_3d03ba01}, + {"VUID-VkRenderPassSampleLocationsBeginInfoEXT-pPostSubpassSampleLocations-parameter", VALIDATION_ERROR_3d03e801}, + {"VUID-VkPipelineSampleLocationsStateCreateInfoEXT-sType-sType", VALIDATION_ERROR_3d22b00b}, + {"VUID-VkPipelineSampleLocationsStateCreateInfoEXT-sampleLocationsInfo-parameter", VALIDATION_ERROR_3d23c601}, + {"VUID-VkPhysicalDeviceSampleLocationsPropertiesEXT-sType-sType", VALIDATION_ERROR_3d42b00b}, + {"VUID-VkMultisamplePropertiesEXT-pNext-pNext", VALIDATION_ERROR_3d61c40d}, + {"VUID-VkMultisamplePropertiesEXT-sType-sType", VALIDATION_ERROR_3d62b00b}, + {"VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-physicalDevice-parameter", VALIDATION_ERROR_3d827a01}, + {"VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-samples-parameter", VALIDATION_ERROR_3d82b401}, + {"VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-pMultisampleProperties-parameter", VALIDATION_ERROR_3d83ca01}, + {"VUID-VkValidationCacheCreateInfoEXT-initialDataSize-01534", VALIDATION_ERROR_3da00bfc}, + {"VUID-VkValidationCacheCreateInfoEXT-initialDataSize-01535", VALIDATION_ERROR_3da00bfe}, + {"VUID-VkValidationCacheCreateInfoEXT-flags-zerobitmask", VALIDATION_ERROR_3da09005}, + {"VUID-VkValidationCacheCreateInfoEXT-pInitialData-parameter", VALIDATION_ERROR_3da19601}, + {"VUID-VkValidationCacheCreateInfoEXT-pNext-pNext", VALIDATION_ERROR_3da1c40d}, + {"VUID-VkValidationCacheCreateInfoEXT-sType-sType", VALIDATION_ERROR_3da2b00b}, + {"VUID-VkShaderModuleValidationCacheCreateInfoEXT-sType-sType", VALIDATION_ERROR_3dc2b00b}, + {"VUID-VkShaderModuleValidationCacheCreateInfoEXT-validationCache-parameter", VALIDATION_ERROR_3dc3c401}, + {"VUID-vkCreateValidationCacheEXT-device-parameter", VALIDATION_ERROR_3de05601}, + {"VUID-vkCreateValidationCacheEXT-pAllocator-parameter", VALIDATION_ERROR_3de0ec01}, + {"VUID-vkCreateValidationCacheEXT-pCreateInfo-parameter", VALIDATION_ERROR_3de11e01}, + {"VUID-vkCreateValidationCacheEXT-pValidationCache-parameter", VALIDATION_ERROR_3de3c201}, + {"VUID-vkGetValidationCacheDataEXT-device-parameter", VALIDATION_ERROR_3e005601}, + {"VUID-vkGetValidationCacheDataEXT-pData-parameter", VALIDATION_ERROR_3e012201}, + {"VUID-vkGetValidationCacheDataEXT-pDataSize-parameter", VALIDATION_ERROR_3e012401}, + {"VUID-vkGetValidationCacheDataEXT-validationCache-parameter", VALIDATION_ERROR_3e03c401}, + {"VUID-vkGetValidationCacheDataEXT-validationCache-parent", VALIDATION_ERROR_3e03c407}, + {"VUID-vkCmdSetSampleLocationsEXT-None-01528", VALIDATION_ERROR_3e200bf0}, + {"VUID-vkCmdSetSampleLocationsEXT-sampleLocationsPerPixel-01529", VALIDATION_ERROR_3e200bf2}, + {"VUID-vkCmdSetSampleLocationsEXT-variableSampleLocations-01530", VALIDATION_ERROR_3e200bf4}, + {"VUID-vkCmdSetSampleLocationsEXT-commandBuffer-parameter", VALIDATION_ERROR_3e202401}, + {"VUID-vkCmdSetSampleLocationsEXT-commandBuffer-recording", VALIDATION_ERROR_3e202413}, + {"VUID-vkCmdSetSampleLocationsEXT-commandBuffer-cmdpool", VALIDATION_ERROR_3e202415}, + {"VUID-vkCmdSetSampleLocationsEXT-pSampleLocationsInfo-parameter", VALIDATION_ERROR_3e23c801}, + {"VUID-vkDestroyValidationCacheEXT-validationCache-01537", VALIDATION_ERROR_3e400c02}, + {"VUID-vkDestroyValidationCacheEXT-validationCache-01538", VALIDATION_ERROR_3e400c04}, + {"VUID-vkDestroyValidationCacheEXT-device-parameter", VALIDATION_ERROR_3e405601}, + {"VUID-vkDestroyValidationCacheEXT-pAllocator-parameter", VALIDATION_ERROR_3e40ec01}, + {"VUID-vkDestroyValidationCacheEXT-validationCache-parameter", VALIDATION_ERROR_3e43c401}, + {"VUID-vkDestroyValidationCacheEXT-validationCache-parent", VALIDATION_ERROR_3e43c407}, + {"VUID-vkMergeValidationCachesEXT-dstCache-01536", VALIDATION_ERROR_3e600c00}, + {"VUID-vkMergeValidationCachesEXT-device-parameter", VALIDATION_ERROR_3e605601}, + {"VUID-vkMergeValidationCachesEXT-dstCache-parameter", VALIDATION_ERROR_3e606e01}, + {"VUID-vkMergeValidationCachesEXT-dstCache-parent", VALIDATION_ERROR_3e606e07}, + {"VUID-vkMergeValidationCachesEXT-pSrcCaches-parameter", VALIDATION_ERROR_3e623c01}, + {"VUID-vkMergeValidationCachesEXT-pSrcCaches-parent", VALIDATION_ERROR_3e623c07}, + {"VUID-vkMergeValidationCachesEXT-srcCacheCount-arraylength", VALIDATION_ERROR_3e62ca1b}, + {"VUID-VkAttachmentSampleLocationsEXT-attachmentIndex-01531", VALIDATION_ERROR_3e800bf6}, + {"VUID-VkAttachmentSampleLocationsEXT-sampleLocationsInfo-parameter", VALIDATION_ERROR_3e83c601}, + {"VUID-VkSubpassSampleLocationsEXT-subpassIndex-01532", VALIDATION_ERROR_3ea00bf8}, + {"VUID-VkSubpassSampleLocationsEXT-sampleLocationsInfo-parameter", VALIDATION_ERROR_3ea3c601}, + {"VUID-VkPhysicalDevicePointClippingProperties-sType-sType", VALIDATION_ERROR_3ec2b00b}, + {"VUID-VkInputAttachmentAspectReference-aspectMask-parameter", VALIDATION_ERROR_3ee00c01}, + {"VUID-VkInputAttachmentAspectReference-aspectMask-requiredbitmask", VALIDATION_ERROR_3ee00c03}, + {"VUID-VkInputAttachmentAspectReference-pCreateInfo-01568", VALIDATION_ERROR_3ee00c40}, + {"VUID-VkInputAttachmentAspectReference-None-01569", VALIDATION_ERROR_3ee00c42}, + {"VUID-VkInputAttachmentAspectReference-aspectMask-01570", VALIDATION_ERROR_3ee00c44}, + {"VUID-VkRenderPassInputAttachmentAspectCreateInfo-sType-sType", VALIDATION_ERROR_3f02b00b}, + {"VUID-VkRenderPassInputAttachmentAspectCreateInfo-aspectReferenceCount-arraylength", VALIDATION_ERROR_3f03ce1b}, + {"VUID-VkRenderPassInputAttachmentAspectCreateInfo-pAspectReferences-parameter", VALIDATION_ERROR_3f03d001}, + {"VUID-VkImageViewUsageCreateInfo-usage-01587", VALIDATION_ERROR_3f200c66}, + {"VUID-VkImageViewUsageCreateInfo-sType-sType", VALIDATION_ERROR_3f22b00b}, + {"VUID-VkImageViewUsageCreateInfo-usage-parameter", VALIDATION_ERROR_3f230601}, + {"VUID-VkImageViewUsageCreateInfo-usage-requiredbitmask", VALIDATION_ERROR_3f230603}, + {"VUID-VkPipelineTessellationDomainOriginStateCreateInfo-sType-sType", VALIDATION_ERROR_3f42b00b}, + {"VUID-VkPipelineTessellationDomainOriginStateCreateInfo-domainOrigin-parameter", VALIDATION_ERROR_3f43d201}, + {"VUID-VkImageFormatListCreateInfoKHR-viewFormatCount-01578", VALIDATION_ERROR_3f600c54}, + {"VUID-VkImageFormatListCreateInfoKHR-flags-01579", VALIDATION_ERROR_3f600c56}, + {"VUID-VkImageFormatListCreateInfoKHR-viewFormatCount-01580", VALIDATION_ERROR_3f600c58}, + {"VUID-VkImageFormatListCreateInfoKHR-sType-sType", VALIDATION_ERROR_3f62b00b}, + {"VUID-VkImageFormatListCreateInfoKHR-pViewFormats-parameter", VALIDATION_ERROR_3f63e401}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-format-01649", VALIDATION_ERROR_3f800ce2}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-format-01650", VALIDATION_ERROR_3f800ce4}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-01651", VALIDATION_ERROR_3f800ce6}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-01652", VALIDATION_ERROR_3f800ce8}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-format-01653", VALIDATION_ERROR_3f800cea}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-None-01654", VALIDATION_ERROR_3f800cec}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrModel-01655", VALIDATION_ERROR_3f800cee}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-forceExplicitReconstruction-01656", VALIDATION_ERROR_3f800cf0}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-chromaFilter-01657", VALIDATION_ERROR_3f800cf2}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-format-01904", VALIDATION_ERROR_3f800ee0}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-components-parameter", VALIDATION_ERROR_3f802c01}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-format-parameter", VALIDATION_ERROR_3f809201}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-pNext-pNext", VALIDATION_ERROR_3f81c40d}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-sType-sType", VALIDATION_ERROR_3f82b00b}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrModel-parameter", VALIDATION_ERROR_3f83d401}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrRange-parameter", VALIDATION_ERROR_3f83d601}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-parameter", VALIDATION_ERROR_3f83d801}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-yChromaOffset-parameter", VALIDATION_ERROR_3f83da01}, + {"VUID-VkSamplerYcbcrConversionCreateInfo-chromaFilter-parameter", VALIDATION_ERROR_3f83dc01}, + {"VUID-VkBindImagePlaneMemoryInfo-planeAspect-01642", VALIDATION_ERROR_3fa00cd4}, + {"VUID-VkBindImagePlaneMemoryInfo-None-01643", VALIDATION_ERROR_3fa00cd6}, + {"VUID-VkBindImagePlaneMemoryInfo-sType-sType", VALIDATION_ERROR_3fa2b00b}, + {"VUID-VkBindImagePlaneMemoryInfo-planeAspect-parameter", VALIDATION_ERROR_3fa3de01}, + {"VUID-VkImagePlaneMemoryRequirementsInfo-planeAspect-01592", VALIDATION_ERROR_3fc00c70}, + {"VUID-VkImagePlaneMemoryRequirementsInfo-sType-sType", VALIDATION_ERROR_3fc2b00b}, + {"VUID-VkImagePlaneMemoryRequirementsInfo-planeAspect-parameter", VALIDATION_ERROR_3fc3de01}, + {"VUID-vkCreateSamplerYcbcrConversion-None-01648", VALIDATION_ERROR_3fe00ce0}, + {"VUID-vkCreateSamplerYcbcrConversion-device-parameter", VALIDATION_ERROR_3fe05601}, + {"VUID-vkCreateSamplerYcbcrConversion-pAllocator-parameter", VALIDATION_ERROR_3fe0ec01}, + {"VUID-vkCreateSamplerYcbcrConversion-pCreateInfo-parameter", VALIDATION_ERROR_3fe11e01}, + {"VUID-vkCreateSamplerYcbcrConversion-pYcbcrConversion-parameter", VALIDATION_ERROR_3fe3e001}, + {"VUID-VkBindBufferMemoryDeviceGroupInfo-deviceIndexCount-01606", VALIDATION_ERROR_40000c8c}, + {"VUID-VkBindBufferMemoryDeviceGroupInfo-pDeviceIndices-01607", VALIDATION_ERROR_40000c8e}, + {"VUID-VkBindBufferMemoryDeviceGroupInfo-pDeviceIndices-parameter", VALIDATION_ERROR_40013e01}, + {"VUID-VkBindBufferMemoryDeviceGroupInfo-sType-sType", VALIDATION_ERROR_4002b00b}, + {"VUID-VkBindImageMemoryDeviceGroupInfo-deviceIndexCount-01633", VALIDATION_ERROR_40200cc2}, + {"VUID-VkBindImageMemoryDeviceGroupInfo-deviceIndexCount-01634", VALIDATION_ERROR_40200cc4}, + {"VUID-VkBindImageMemoryDeviceGroupInfo-pDeviceIndices-01635", VALIDATION_ERROR_40200cc6}, + {"VUID-VkBindImageMemoryDeviceGroupInfo-splitInstanceBindRegionCount-01636", VALIDATION_ERROR_40200cc8}, + {"VUID-VkBindImageMemoryDeviceGroupInfo-pSplitInstanceBindRegions-01637", VALIDATION_ERROR_40200cca}, + {"VUID-VkBindImageMemoryDeviceGroupInfo-offset-01638", VALIDATION_ERROR_40200ccc}, + {"VUID-VkBindImageMemoryDeviceGroupInfo-offset-01639", VALIDATION_ERROR_40200cce}, + {"VUID-VkBindImageMemoryDeviceGroupInfo-extent-01640", VALIDATION_ERROR_40200cd0}, + {"VUID-VkBindImageMemoryDeviceGroupInfo-extent-01641", VALIDATION_ERROR_40200cd2}, + {"VUID-VkBindImageMemoryDeviceGroupInfo-pDeviceIndices-parameter", VALIDATION_ERROR_40213e01}, + {"VUID-VkBindImageMemoryDeviceGroupInfo-sType-sType", VALIDATION_ERROR_4022b00b}, + {"VUID-VkBindImageMemoryDeviceGroupInfo-pSplitInstanceBindRegions-parameter", VALIDATION_ERROR_4023fe01}, + {"VUID-vkDestroySamplerYcbcrConversion-device-parameter", VALIDATION_ERROR_40405601}, + {"VUID-vkDestroySamplerYcbcrConversion-pAllocator-parameter", VALIDATION_ERROR_4040ec01}, + {"VUID-vkDestroySamplerYcbcrConversion-ycbcrConversion-parameter", VALIDATION_ERROR_4043e201}, + {"VUID-vkDestroySamplerYcbcrConversion-ycbcrConversion-parent", VALIDATION_ERROR_4043e207}, + {"VUID-VkPhysicalDeviceSamplerYcbcrConversionFeatures-sType-sType", VALIDATION_ERROR_4062b00b}, + {"VUID-VkSamplerYcbcrConversionImageFormatProperties-sType-sType", VALIDATION_ERROR_4082b00b}, + {"VUID-VkSamplerYcbcrConversionInfo-sType-sType", VALIDATION_ERROR_40a2b00b}, + {"VUID-VkSamplerYcbcrConversionInfo-conversion-parameter", VALIDATION_ERROR_40a3e601}, + {"VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-sType-sType", VALIDATION_ERROR_40c2b00b}, + {"VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-globalPriority-parameter", VALIDATION_ERROR_40c3ea01}, + {"VUID-vkGetShaderInfoAMD-device-parameter", VALIDATION_ERROR_40e05601}, + {"VUID-vkGetShaderInfoAMD-pipeline-parameter", VALIDATION_ERROR_40e27c01}, + {"VUID-vkGetShaderInfoAMD-pipeline-parent", VALIDATION_ERROR_40e27c07}, + {"VUID-vkGetShaderInfoAMD-pInfo-parameter", VALIDATION_ERROR_40e39c01}, + {"VUID-vkGetShaderInfoAMD-shaderStage-parameter", VALIDATION_ERROR_40e3ec01}, + {"VUID-vkGetShaderInfoAMD-infoType-parameter", VALIDATION_ERROR_40e3ee01}, + {"VUID-vkGetShaderInfoAMD-pInfoSize-parameter", VALIDATION_ERROR_40e3f001}, + {"VUID-VkImportMemoryHostPointerInfoEXT-handleType-01747", VALIDATION_ERROR_41200da6}, + {"VUID-VkImportMemoryHostPointerInfoEXT-handleType-01748", VALIDATION_ERROR_41200da8}, + {"VUID-VkImportMemoryHostPointerInfoEXT-pHostPointer-01749", VALIDATION_ERROR_41200daa}, + {"VUID-VkImportMemoryHostPointerInfoEXT-handleType-01750", VALIDATION_ERROR_41200dac}, + {"VUID-VkImportMemoryHostPointerInfoEXT-handleType-01751", VALIDATION_ERROR_41200dae}, + {"VUID-VkImportMemoryHostPointerInfoEXT-handleType-parameter", VALIDATION_ERROR_41209c01}, + {"VUID-VkImportMemoryHostPointerInfoEXT-sType-sType", VALIDATION_ERROR_4122b00b}, + {"VUID-VkMemoryHostPointerPropertiesEXT-pNext-pNext", VALIDATION_ERROR_4141c40d}, + {"VUID-VkMemoryHostPointerPropertiesEXT-sType-sType", VALIDATION_ERROR_4142b00b}, + {"VUID-VkPhysicalDeviceExternalMemoryHostPropertiesEXT-sType-sType", VALIDATION_ERROR_4162b00b}, + {"VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-01752", VALIDATION_ERROR_41800db0}, + {"VUID-vkGetMemoryHostPointerPropertiesEXT-pHostPointer-01753", VALIDATION_ERROR_41800db2}, + {"VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-01754", VALIDATION_ERROR_41800db4}, + {"VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-01755", VALIDATION_ERROR_41800db6}, + {"VUID-vkGetMemoryHostPointerPropertiesEXT-device-parameter", VALIDATION_ERROR_41805601}, + {"VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-parameter", VALIDATION_ERROR_41809c01}, + {"VUID-vkGetMemoryHostPointerPropertiesEXT-pMemoryHostPointerProperties-parameter", VALIDATION_ERROR_4183f401}, + {"VUID-VkPhysicalDeviceConservativeRasterizationPropertiesEXT-sType-sType", VALIDATION_ERROR_41a2b00b}, + {"VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-extraPrimitiveOverestimationSize-01769", VALIDATION_ERROR_41c00dd2}, + {"VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-flags-zerobitmask", VALIDATION_ERROR_41c09005}, + {"VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-sType-sType", VALIDATION_ERROR_41c2b00b}, + {"VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-conservativeRasterizationMode-parameter", VALIDATION_ERROR_41c3f801}, + {"VUID-vkCmdWriteBufferMarkerAMD-commonparent", VALIDATION_ERROR_41e00009}, + {"VUID-vkCmdWriteBufferMarkerAMD-dstOffset-01798", VALIDATION_ERROR_41e00e0c}, + {"VUID-vkCmdWriteBufferMarkerAMD-dstBuffer-01799", VALIDATION_ERROR_41e00e0e}, + {"VUID-vkCmdWriteBufferMarkerAMD-dstBuffer-01800", VALIDATION_ERROR_41e00e10}, + {"VUID-vkCmdWriteBufferMarkerAMD-dstOffset-01801", VALIDATION_ERROR_41e00e12}, + {"VUID-vkCmdWriteBufferMarkerAMD-commandBuffer-parameter", VALIDATION_ERROR_41e02401}, + {"VUID-vkCmdWriteBufferMarkerAMD-commandBuffer-recording", VALIDATION_ERROR_41e02413}, + {"VUID-vkCmdWriteBufferMarkerAMD-commandBuffer-cmdpool", VALIDATION_ERROR_41e02415}, + {"VUID-vkCmdWriteBufferMarkerAMD-dstBuffer-parameter", VALIDATION_ERROR_41e06c01}, + {"VUID-vkCmdWriteBufferMarkerAMD-pipelineStage-parameter", VALIDATION_ERROR_41e28401}, + {"VUID-VkDescriptorSetLayoutSupport-pNext-pNext", VALIDATION_ERROR_4201c40d}, + {"VUID-VkDescriptorSetLayoutSupport-sType-sType", VALIDATION_ERROR_4202b00b}, + {"VUID-VkDeviceQueueInfo2-queueFamilyIndex-01842", VALIDATION_ERROR_42200e64}, + {"VUID-VkDeviceQueueInfo2-queueIndex-01843", VALIDATION_ERROR_42200e66}, + {"VUID-VkDeviceQueueInfo2-flags-parameter", VALIDATION_ERROR_42209001}, + {"VUID-VkDeviceQueueInfo2-flags-requiredbitmask", VALIDATION_ERROR_42209003}, + {"VUID-VkDeviceQueueInfo2-pNext-pNext", VALIDATION_ERROR_4221c40d}, + {"VUID-VkDeviceQueueInfo2-sType-sType", VALIDATION_ERROR_4222b00b}, + {"VUID-VkPhysicalDeviceMaintenance3Properties-sType-sType", VALIDATION_ERROR_4242b00b}, + {"VUID-VkPhysicalDeviceProtectedMemoryFeatures-sType-sType", VALIDATION_ERROR_4262b00b}, + {"VUID-VkPhysicalDeviceProtectedMemoryProperties-sType-sType", VALIDATION_ERROR_4282b00b}, + {"VUID-VkPhysicalDeviceShaderDrawParameterFeatures-sType-sType", VALIDATION_ERROR_42a2b00b}, + {"VUID-VkPhysicalDeviceSubgroupProperties-sType-sType", VALIDATION_ERROR_42c2b00b}, + {"VUID-VkProtectedSubmitInfo-protectedSubmit-01816", VALIDATION_ERROR_42e00e30}, + {"VUID-VkProtectedSubmitInfo-protectedSubmit-01817", VALIDATION_ERROR_42e00e32}, + {"VUID-VkProtectedSubmitInfo-protectedSubmit-01818", VALIDATION_ERROR_42e00e34}, + {"VUID-VkProtectedSubmitInfo-pNext-01819", VALIDATION_ERROR_42e00e36}, + {"VUID-VkProtectedSubmitInfo-sType-sType", VALIDATION_ERROR_42e2b00b}, + {"VUID-vkEnumerateInstanceVersion-pApiVersion-parameter", VALIDATION_ERROR_43040001}, + {"VUID-vkGetDescriptorSetLayoutSupport-device-parameter", VALIDATION_ERROR_43205601}, + {"VUID-vkGetDescriptorSetLayoutSupport-pCreateInfo-parameter", VALIDATION_ERROR_43211e01}, + {"VUID-vkGetDescriptorSetLayoutSupport-pSupport-parameter", VALIDATION_ERROR_43240201}, + {"VUID-vkGetDeviceQueue2-device-parameter", VALIDATION_ERROR_43405601}, + {"VUID-vkGetDeviceQueue2-pQueue-parameter", VALIDATION_ERROR_4341fc01}, + {"VUID-vkGetDeviceQueue2-pQueueInfo-parameter", VALIDATION_ERROR_43440401}, + {"VUID-VkDebugUtilsObjectNameInfoEXT-objectType-01905", VALIDATION_ERROR_43600ee2}, + {"VUID-VkDebugUtilsObjectNameInfoEXT-objectHandle-01906", VALIDATION_ERROR_43600ee4}, + {"VUID-VkDebugUtilsObjectNameInfoEXT-objectHandle-01907", VALIDATION_ERROR_43600ee6}, + {"VUID-VkDebugUtilsObjectNameInfoEXT-objectType-parameter", VALIDATION_ERROR_4360da01}, + {"VUID-VkDebugUtilsObjectNameInfoEXT-pNext-pNext", VALIDATION_ERROR_4361c40d}, + {"VUID-VkDebugUtilsObjectNameInfoEXT-pObjectName-parameter", VALIDATION_ERROR_4361ce01}, + {"VUID-VkDebugUtilsObjectNameInfoEXT-sType-sType", VALIDATION_ERROR_4362b00b}, + {"VUID-VkDebugUtilsObjectTagInfoEXT-objectType-01908", VALIDATION_ERROR_43800ee8}, + {"VUID-VkDebugUtilsObjectTagInfoEXT-objectHandle-01909", VALIDATION_ERROR_43800eea}, + {"VUID-VkDebugUtilsObjectTagInfoEXT-objectHandle-01910", VALIDATION_ERROR_43800eec}, + {"VUID-VkDebugUtilsObjectTagInfoEXT-objectType-parameter", VALIDATION_ERROR_4380da01}, + {"VUID-VkDebugUtilsObjectTagInfoEXT-pNext-pNext", VALIDATION_ERROR_4381c40d}, + {"VUID-VkDebugUtilsObjectTagInfoEXT-pTag-parameter", VALIDATION_ERROR_43825a01}, + {"VUID-VkDebugUtilsObjectTagInfoEXT-sType-sType", VALIDATION_ERROR_4382b00b}, + {"VUID-VkDebugUtilsObjectTagInfoEXT-tagSize-arraylength", VALIDATION_ERROR_4382f41b}, + {"VUID-VkDebugUtilsLabelEXT-pNext-pNext", VALIDATION_ERROR_43a1c40d}, + {"VUID-VkDebugUtilsLabelEXT-sType-sType", VALIDATION_ERROR_43a2b00b}, + {"VUID-VkDebugUtilsLabelEXT-pLabelName-parameter", VALIDATION_ERROR_43a40801}, + {"VUID-VkDebugUtilsMessengerCallbackDataEXT-flags-zerobitmask", VALIDATION_ERROR_43c09005}, + {"VUID-VkDebugUtilsMessengerCallbackDataEXT-objectCount-arraylength", VALIDATION_ERROR_43c0d61b}, + {"VUID-VkDebugUtilsMessengerCallbackDataEXT-pMessage-parameter", VALIDATION_ERROR_43c1b801}, + {"VUID-VkDebugUtilsMessengerCallbackDataEXT-pNext-pNext", VALIDATION_ERROR_43c1c40d}, + {"VUID-VkDebugUtilsMessengerCallbackDataEXT-sType-sType", VALIDATION_ERROR_43c2b00b}, + {"VUID-VkDebugUtilsMessengerCallbackDataEXT-pMessageIdName-parameter", VALIDATION_ERROR_43c42201}, + {"VUID-VkDebugUtilsMessengerCreateInfoEXT-pfnUserCallback-01914", VALIDATION_ERROR_43e00ef4}, + {"VUID-VkDebugUtilsMessengerCreateInfoEXT-flags-zerobitmask", VALIDATION_ERROR_43e09005}, + {"VUID-VkDebugUtilsMessengerCreateInfoEXT-sType-sType", VALIDATION_ERROR_43e2b00b}, + {"VUID-VkDebugUtilsMessengerCreateInfoEXT-messageSeverity-parameter", VALIDATION_ERROR_43e40a01}, + {"VUID-VkDebugUtilsMessengerCreateInfoEXT-messageSeverity-requiredbitmask", VALIDATION_ERROR_43e40a03}, + {"VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-parameter", VALIDATION_ERROR_43e40c01}, + {"VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-requiredbitmask", VALIDATION_ERROR_43e40c03}, + {"VUID-vkCreateDebugUtilsMessengerEXT-instance-parameter", VALIDATION_ERROR_4400bc01}, + {"VUID-vkCreateDebugUtilsMessengerEXT-pAllocator-parameter", VALIDATION_ERROR_4400ec01}, + {"VUID-vkCreateDebugUtilsMessengerEXT-pCreateInfo-parameter", VALIDATION_ERROR_44011e01}, + {"VUID-vkCreateDebugUtilsMessengerEXT-pMessenger-parameter", VALIDATION_ERROR_44041001}, + {"VUID-vkSubmitDebugUtilsMessageEXT-instance-parameter", VALIDATION_ERROR_4420bc01}, + {"VUID-vkSubmitDebugUtilsMessageEXT-messageSeverity-parameter", VALIDATION_ERROR_44240a01}, + {"VUID-vkSubmitDebugUtilsMessageEXT-messageTypes-parameter", VALIDATION_ERROR_44241201}, + {"VUID-vkSubmitDebugUtilsMessageEXT-messageTypes-requiredbitmask", VALIDATION_ERROR_44241203}, + {"VUID-vkSubmitDebugUtilsMessageEXT-pCallbackData-parameter", VALIDATION_ERROR_44242801}, + {"VUID-VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT-sType-sType", VALIDATION_ERROR_4442b00b}, + {"VUID-VkPipelineVertexInputDivisorStateCreateInfoEXT-sType-sType", VALIDATION_ERROR_4462b00b}, + {"VUID-VkPipelineVertexInputDivisorStateCreateInfoEXT-vertexBindingDivisorCount-arraylength", VALIDATION_ERROR_4464141b}, + {"VUID-VkPipelineVertexInputDivisorStateCreateInfoEXT-pVertexBindingDivisors-parameter", VALIDATION_ERROR_44641601}, + {"VUID-VkExternalFormatANDROID-externalFormat-01894", VALIDATION_ERROR_44800ecc}, + {"VUID-VkExternalFormatANDROID-sType-sType", VALIDATION_ERROR_4482b00b}, + {"VUID-VkImportAndroidHardwareBufferInfoANDROID-buffer-01880", VALIDATION_ERROR_44a00eb0}, + {"VUID-VkImportAndroidHardwareBufferInfoANDROID-buffer-01881", VALIDATION_ERROR_44a00eb2}, + {"VUID-VkImportAndroidHardwareBufferInfoANDROID-buffer-parameter", VALIDATION_ERROR_44a01a01}, + {"VUID-VkImportAndroidHardwareBufferInfoANDROID-sType-sType", VALIDATION_ERROR_44a2b00b}, + {"VUID-VkMemoryGetAndroidHardwareBufferInfoANDROID-handleTypes-01882", VALIDATION_ERROR_44c00eb4}, + {"VUID-VkMemoryGetAndroidHardwareBufferInfoANDROID-pNext-01883", VALIDATION_ERROR_44c00eb6}, + {"VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912", VALIDATION_ERROR_44e00ef0}, + {"VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01913", VALIDATION_ERROR_44e00ef2}, + {"VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-parameter", VALIDATION_ERROR_44e02401}, + {"VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-recording", VALIDATION_ERROR_44e02413}, + {"VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-cmdpool", VALIDATION_ERROR_44e02415}, + {"VUID-vkDestroyDebugUtilsMessengerEXT-messenger-01915", VALIDATION_ERROR_45000ef6}, + {"VUID-vkDestroyDebugUtilsMessengerEXT-messenger-01916", VALIDATION_ERROR_45000ef8}, + {"VUID-vkDestroyDebugUtilsMessengerEXT-instance-parameter", VALIDATION_ERROR_4500bc01}, + {"VUID-vkDestroyDebugUtilsMessengerEXT-pAllocator-parameter", VALIDATION_ERROR_4500ec01}, + {"VUID-vkDestroyDebugUtilsMessengerEXT-messenger-parameter", VALIDATION_ERROR_45042601}, + {"VUID-vkDestroyDebugUtilsMessengerEXT-messenger-parent", VALIDATION_ERROR_45042607}, + {"VUID-vkGetAndroidHardwareBufferPropertiesANDROID-buffer-01884", VALIDATION_ERROR_45200eb8}, + {"VUID-vkGetAndroidHardwareBufferPropertiesANDROID-buffer-parameter", VALIDATION_ERROR_45201a01}, + {"VUID-vkGetAndroidHardwareBufferPropertiesANDROID-device-parameter", VALIDATION_ERROR_45205601}, + {"VUID-vkGetAndroidHardwareBufferPropertiesANDROID-pProperties-parameter", VALIDATION_ERROR_4521f401}, + {"VUID-vkQueueEndDebugUtilsLabelEXT-None-01911", VALIDATION_ERROR_45400eee}, + {"VUID-vkQueueEndDebugUtilsLabelEXT-queue-parameter", VALIDATION_ERROR_45429c01}, + {"VUID-VkAndroidHardwareBufferUsageANDROID-sType-sType", VALIDATION_ERROR_4562b00b}, + {"VUID-vkGetMemoryAndroidHardwareBufferANDROID-device-parameter", VALIDATION_ERROR_45a05601}, + {"VUID-vkGetMemoryAndroidHardwareBufferANDROID-pBuffer-parameter", VALIDATION_ERROR_45a10001}, + {"VUID-vkGetMemoryAndroidHardwareBufferANDROID-pInfo-parameter", VALIDATION_ERROR_45a39c01}, + {"VUID-VkAndroidHardwareBufferFormatPropertiesANDROID-sType-sType", VALIDATION_ERROR_45c2b00b}, + {"VUID-vkCmdBeginDebugUtilsLabelEXT-commandBuffer-parameter", VALIDATION_ERROR_45e02401}, + {"VUID-vkCmdBeginDebugUtilsLabelEXT-commandBuffer-recording", VALIDATION_ERROR_45e02413}, + {"VUID-vkCmdBeginDebugUtilsLabelEXT-commandBuffer-cmdpool", VALIDATION_ERROR_45e02415}, + {"VUID-vkCmdBeginDebugUtilsLabelEXT-pLabelInfo-parameter", VALIDATION_ERROR_45e42401}, + {"VUID-vkCmdInsertDebugUtilsLabelEXT-commandBuffer-parameter", VALIDATION_ERROR_46002401}, + {"VUID-vkCmdInsertDebugUtilsLabelEXT-commandBuffer-recording", VALIDATION_ERROR_46002413}, + {"VUID-vkCmdInsertDebugUtilsLabelEXT-commandBuffer-cmdpool", VALIDATION_ERROR_46002415}, + {"VUID-vkCmdInsertDebugUtilsLabelEXT-pLabelInfo-parameter", VALIDATION_ERROR_46042401}, + {"VUID-vkQueueBeginDebugUtilsLabelEXT-queue-parameter", VALIDATION_ERROR_46229c01}, + {"VUID-vkQueueBeginDebugUtilsLabelEXT-pLabelInfo-parameter", VALIDATION_ERROR_46242401}, + {"VUID-vkQueueInsertDebugUtilsLabelEXT-queue-parameter", VALIDATION_ERROR_46429c01}, + {"VUID-vkQueueInsertDebugUtilsLabelEXT-pLabelInfo-parameter", VALIDATION_ERROR_46442401}, + {"VUID-vkSetDebugUtilsObjectNameEXT-device-parameter", VALIDATION_ERROR_46605601}, + {"VUID-vkSetDebugUtilsObjectNameEXT-pNameInfo-parameter", VALIDATION_ERROR_4661c201}, + {"VUID-vkSetDebugUtilsObjectTagEXT-device-parameter", VALIDATION_ERROR_46805601}, + {"VUID-vkSetDebugUtilsObjectTagEXT-pTagInfo-parameter", VALIDATION_ERROR_46825c01}, + {"VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-bindingCount-03002", VALIDATION_ERROR_46a01774}, + {"VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-flags-03003", VALIDATION_ERROR_46a01776}, + {"VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-03004", VALIDATION_ERROR_46a01778}, + {"VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingUniformBufferUpdateAfterBind-03005", VALIDATION_ERROR_46a0177a}, + {"VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingSampledImageUpdateAfterBind-03006", VALIDATION_ERROR_46a0177c}, + {"VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingStorageImageUpdateAfterBind-03007", VALIDATION_ERROR_46a0177e}, + {"VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingStorageBufferUpdateAfterBind-03008", VALIDATION_ERROR_46a01780}, + {"VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingUniformTexelBufferUpdateAfterBind-03009", VALIDATION_ERROR_46a01782}, + {"VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingStorageTexelBufferUpdateAfterBind-03010", VALIDATION_ERROR_46a01784}, + {"VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-None-03011", VALIDATION_ERROR_46a01786}, + {"VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingUpdateUnusedWhilePending-03012", VALIDATION_ERROR_46a01788}, + {"VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingPartiallyBound-03013", VALIDATION_ERROR_46a0178a}, + {"VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingVariableDescriptorCount-03014", VALIDATION_ERROR_46a0178c}, + {"VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-03015", VALIDATION_ERROR_46a0178e}, + {"VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-sType-sType", VALIDATION_ERROR_46a2b00b}, + {"VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-parameter", VALIDATION_ERROR_46a42a01}, + {"VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-requiredbitmask", VALIDATION_ERROR_46a42a03}, + {"VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-descriptorSetCount-03045", VALIDATION_ERROR_46c017ca}, + {"VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-pSetLayouts-03046", VALIDATION_ERROR_46c017cc}, + {"VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-sType-sType", VALIDATION_ERROR_46c2b00b}, + {"VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-pDescriptorCounts-parameter", VALIDATION_ERROR_46c42c01}, + {"VUID-VkDescriptorSetVariableDescriptorCountLayoutSupportEXT-sType-sType", VALIDATION_ERROR_46e2b00b}, + {"VUID-VkPhysicalDeviceDescriptorIndexingFeaturesEXT-sType-sType", VALIDATION_ERROR_4702b00b}, + {"VUID-VkPhysicalDeviceDescriptorIndexingPropertiesEXT-sType-sType", VALIDATION_ERROR_4722b00b}, + {"VUID-VkPhysicalDeviceShaderCorePropertiesAMD-sType-sType", VALIDATION_ERROR_4742b00b}, + {"VUID-VkVertexInputBindingDivisorDescriptionEXT-binding-01869", VALIDATION_ERROR_47600e9a}, + {"VUID-VkVertexInputBindingDivisorDescriptionEXT-divisor-01870", VALIDATION_ERROR_47600e9c}, + {"VUID-VkVertexInputBindingDivisorDescriptionEXT-inputRate-01871", VALIDATION_ERROR_47600e9e}, }; diff -Nru vulkan-1.0.65.2+dfsg1/layers/windows/VkLayer_core_validation.json vulkan-1.1.73+dfsg/layers/windows/VkLayer_core_validation.json --- vulkan-1.0.65.2+dfsg1/layers/windows/VkLayer_core_validation.json 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/windows/VkLayer_core_validation.json 2018-04-27 11:24:19.000000000 +0000 @@ -4,7 +4,7 @@ "name": "VK_LAYER_LUNARG_core_validation", "type": "GLOBAL", "library_path": ".\\VkLayer_core_validation.dll", - "api_version": "1.0.65", + "api_version": "1.1.73", "implementation_version": "1", "description": "LunarG Validation Layer", "instance_extensions": [ @@ -23,6 +23,15 @@ "vkCmdDebugMarkerEndEXT", "vkCmdDebugMarkerInsertEXT" ] + }, + { + "name": "VK_EXT_validation_cache", + "spec_version": "1", + "entrypoints": ["vkCreateValidationCacheEXT", + "vkDestroyValidationCacheEXT", + "vkGetValidationCacheDataEXT", + "vkMergeValidationCachesEXT" + ] } ] } diff -Nru vulkan-1.0.65.2+dfsg1/layers/windows/VkLayer_object_tracker.json vulkan-1.1.73+dfsg/layers/windows/VkLayer_object_tracker.json --- vulkan-1.0.65.2+dfsg1/layers/windows/VkLayer_object_tracker.json 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/windows/VkLayer_object_tracker.json 2018-04-27 11:24:19.000000000 +0000 @@ -4,7 +4,7 @@ "name": "VK_LAYER_LUNARG_object_tracker", "type": "GLOBAL", "library_path": ".\\VkLayer_object_tracker.dll", - "api_version": "1.0.65", + "api_version": "1.1.73", "implementation_version": "1", "description": "LunarG Validation Layer", "instance_extensions": [ diff -Nru vulkan-1.0.65.2+dfsg1/layers/windows/VkLayer_parameter_validation.json vulkan-1.1.73+dfsg/layers/windows/VkLayer_parameter_validation.json --- vulkan-1.0.65.2+dfsg1/layers/windows/VkLayer_parameter_validation.json 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/windows/VkLayer_parameter_validation.json 2018-04-27 11:24:19.000000000 +0000 @@ -4,7 +4,7 @@ "name": "VK_LAYER_LUNARG_parameter_validation", "type": "GLOBAL", "library_path": ".\\VkLayer_parameter_validation.dll", - "api_version": "1.0.65", + "api_version": "1.1.73", "implementation_version": "1", "description": "LunarG Validation Layer", "instance_extensions": [ diff -Nru vulkan-1.0.65.2+dfsg1/layers/windows/VkLayer_standard_validation.json vulkan-1.1.73+dfsg/layers/windows/VkLayer_standard_validation.json --- vulkan-1.0.65.2+dfsg1/layers/windows/VkLayer_standard_validation.json 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/windows/VkLayer_standard_validation.json 2018-04-27 11:24:19.000000000 +0000 @@ -3,7 +3,7 @@ "layer": { "name": "VK_LAYER_LUNARG_standard_validation", "type": "GLOBAL", - "api_version": "1.0.65", + "api_version": "1.1.73", "implementation_version": "1", "description": "LunarG Standard Validation", "component_layers": [ diff -Nru vulkan-1.0.65.2+dfsg1/layers/windows/VkLayer_threading.json vulkan-1.1.73+dfsg/layers/windows/VkLayer_threading.json --- vulkan-1.0.65.2+dfsg1/layers/windows/VkLayer_threading.json 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/windows/VkLayer_threading.json 2018-04-27 11:24:19.000000000 +0000 @@ -4,7 +4,7 @@ "name": "VK_LAYER_GOOGLE_threading", "type": "GLOBAL", "library_path": ".\\VkLayer_threading.dll", - "api_version": "1.0.65", + "api_version": "1.1.73", "implementation_version": "1", "description": "Google Validation Layer", "instance_extensions": [ diff -Nru vulkan-1.0.65.2+dfsg1/layers/windows/VkLayer_unique_objects.json vulkan-1.1.73+dfsg/layers/windows/VkLayer_unique_objects.json --- vulkan-1.0.65.2+dfsg1/layers/windows/VkLayer_unique_objects.json 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/windows/VkLayer_unique_objects.json 2018-04-27 11:24:19.000000000 +0000 @@ -4,7 +4,7 @@ "name": "VK_LAYER_GOOGLE_unique_objects", "type": "GLOBAL", "library_path": ".\\VkLayer_unique_objects.dll", - "api_version": "1.0.65", + "api_version": "1.1.73", "implementation_version": "1", "description": "Google Validation Layer" } diff -Nru vulkan-1.0.65.2+dfsg1/layers/xxhash.c vulkan-1.1.73+dfsg/layers/xxhash.c --- vulkan-1.0.65.2+dfsg1/layers/xxhash.c 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/xxhash.c 2018-03-14 09:08:48.000000000 +0000 @@ -0,0 +1,888 @@ +/* +* xxHash - Fast Hash algorithm +* Copyright (C) 2012-2016, Yann Collet +* +* BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) +* +* 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. +* +* 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 +* OWNER 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. +* +* You can contact the author at : +* - xxHash homepage: http://www.xxhash.com +* - xxHash source repository : https://github.com/Cyan4973/xxHash +*/ + + +/* ************************************* +* Tuning parameters +***************************************/ +/*!XXH_FORCE_MEMORY_ACCESS : + * By default, access to unaligned memory is controlled by `memcpy()`, which is safe and portable. + * Unfortunately, on some target/compiler combinations, the generated assembly is sub-optimal. + * The below switch allow to select different access method for improved performance. + * Method 0 (default) : use `memcpy()`. Safe and portable. + * Method 1 : `__packed` statement. It depends on compiler extension (ie, not portable). + * This method is safe if your compiler supports it, and *generally* as fast or faster than `memcpy`. + * Method 2 : direct access. This method doesn't depend on compiler but violate C standard. + * It can generate buggy code on targets which do not support unaligned memory accesses. + * But in some circumstances, it's the only known way to get the most performance (ie GCC + ARMv6) + * See http://stackoverflow.com/a/32095106/646947 for details. + * Prefer these methods in priority order (0 > 1 > 2) + */ +#ifndef XXH_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */ +# if defined(__GNUC__) && ( defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) ) +# define XXH_FORCE_MEMORY_ACCESS 2 +# elif defined(__INTEL_COMPILER) || \ + (defined(__GNUC__) && ( defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) )) +# define XXH_FORCE_MEMORY_ACCESS 1 +# endif +#endif + +/*!XXH_ACCEPT_NULL_INPUT_POINTER : + * If the input pointer is a null pointer, xxHash default behavior is to trigger a memory access error, since it is a bad pointer. + * When this option is enabled, xxHash output for null input pointers will be the same as a null-length input. + * By default, this option is disabled. To enable it, uncomment below define : + */ +/* #define XXH_ACCEPT_NULL_INPUT_POINTER 1 */ + +/*!XXH_FORCE_NATIVE_FORMAT : + * By default, xxHash library provides endian-independent Hash values, based on little-endian convention. + * Results are therefore identical for little-endian and big-endian CPU. + * This comes at a performance cost for big-endian CPU, since some swapping is required to emulate little-endian format. + * Should endian-independence be of no importance for your application, you may set the #define below to 1, + * to improve speed for Big-endian CPU. + * This option has no impact on Little_Endian CPU. + */ +#ifndef XXH_FORCE_NATIVE_FORMAT /* can be defined externally */ +# define XXH_FORCE_NATIVE_FORMAT 0 +#endif + +/*!XXH_FORCE_ALIGN_CHECK : + * This is a minor performance trick, only useful with lots of very small keys. + * It means : check for aligned/unaligned input. + * The check costs one initial branch per hash; + * set it to 0 when the input is guaranteed to be aligned, + * or when alignment doesn't matter for performance. + */ +#ifndef XXH_FORCE_ALIGN_CHECK /* can be defined externally */ +# if defined(__i386) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64) +# define XXH_FORCE_ALIGN_CHECK 0 +# else +# define XXH_FORCE_ALIGN_CHECK 1 +# endif +#endif + + +/* ************************************* +* Includes & Memory related functions +***************************************/ +/*! Modify the local functions below should you wish to use some other memory routines +* for malloc(), free() */ +#include +static void* XXH_malloc(size_t s) { return malloc(s); } +static void XXH_free (void* p) { free(p); } +/*! and for memcpy() */ +#include +static void* XXH_memcpy(void* dest, const void* src, size_t size) { return memcpy(dest,src,size); } + +#define XXH_STATIC_LINKING_ONLY +#include "xxhash.h" + + +/* ************************************* +* Compiler Specific Options +***************************************/ +#ifdef _MSC_VER /* Visual Studio */ +# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ +# define FORCE_INLINE static __forceinline +#else +# if defined (__cplusplus) || defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */ +# ifdef __GNUC__ +# define FORCE_INLINE static inline __attribute__((always_inline)) +# else +# define FORCE_INLINE static inline +# endif +# else +# define FORCE_INLINE static +# endif /* __STDC_VERSION__ */ +#endif + + +/* ************************************* +* Basic Types +***************************************/ +#ifndef MEM_MODULE +# if !defined (__VMS) && (defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) ) +# include + typedef uint8_t BYTE; + typedef uint16_t U16; + typedef uint32_t U32; +# else + typedef unsigned char BYTE; + typedef unsigned short U16; + typedef unsigned int U32; +# endif +#endif + +#if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2)) + +/* Force direct memory access. Only works on CPU which support unaligned memory access in hardware */ +static U32 XXH_read32(const void* memPtr) { return *(const U32*) memPtr; } + +#elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1)) + +/* __pack instructions are safer, but compiler specific, hence potentially problematic for some compilers */ +/* currently only defined for gcc and icc */ +typedef union { U32 u32; } __attribute__((packed)) unalign; +static U32 XXH_read32(const void* ptr) { return ((const unalign*)ptr)->u32; } + +#else + +/* portable and safe solution. Generally efficient. + * see : http://stackoverflow.com/a/32095106/646947 + */ +static U32 XXH_read32(const void* memPtr) +{ + U32 val; + memcpy(&val, memPtr, sizeof(val)); + return val; +} + +#endif /* XXH_FORCE_DIRECT_MEMORY_ACCESS */ + + +/* **************************************** +* Compiler-specific Functions and Macros +******************************************/ +#define XXH_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) + +/* Note : although _rotl exists for minGW (GCC under windows), performance seems poor */ +#if defined(_MSC_VER) +# define XXH_rotl32(x,r) _rotl(x,r) +# define XXH_rotl64(x,r) _rotl64(x,r) +#else +# define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r))) +# define XXH_rotl64(x,r) ((x << r) | (x >> (64 - r))) +#endif + +#if defined(_MSC_VER) /* Visual Studio */ +# define XXH_swap32 _byteswap_ulong +#elif XXH_GCC_VERSION >= 403 +# define XXH_swap32 __builtin_bswap32 +#else +static U32 XXH_swap32 (U32 x) +{ + return ((x << 24) & 0xff000000 ) | + ((x << 8) & 0x00ff0000 ) | + ((x >> 8) & 0x0000ff00 ) | + ((x >> 24) & 0x000000ff ); +} +#endif + + +/* ************************************* +* Architecture Macros +***************************************/ +typedef enum { XXH_bigEndian=0, XXH_littleEndian=1 } XXH_endianess; + +/* XXH_CPU_LITTLE_ENDIAN can be defined externally, for example on the compiler command line */ +#ifndef XXH_CPU_LITTLE_ENDIAN + static const int g_one = 1; +# define XXH_CPU_LITTLE_ENDIAN (*(const char*)(&g_one)) +#endif + + +/* *************************** +* Memory reads +*****************************/ +typedef enum { XXH_aligned, XXH_unaligned } XXH_alignment; + +FORCE_INLINE U32 XXH_readLE32_align(const void* ptr, XXH_endianess endian, XXH_alignment align) +{ + if (align==XXH_unaligned) + return endian==XXH_littleEndian ? XXH_read32(ptr) : XXH_swap32(XXH_read32(ptr)); + else + return endian==XXH_littleEndian ? *(const U32*)ptr : XXH_swap32(*(const U32*)ptr); +} + +FORCE_INLINE U32 XXH_readLE32(const void* ptr, XXH_endianess endian) +{ + return XXH_readLE32_align(ptr, endian, XXH_unaligned); +} + +static U32 XXH_readBE32(const void* ptr) +{ + return XXH_CPU_LITTLE_ENDIAN ? XXH_swap32(XXH_read32(ptr)) : XXH_read32(ptr); +} + + +/* ************************************* +* Macros +***************************************/ +#define XXH_STATIC_ASSERT(c) { enum { XXH_static_assert = 1/(int)(!!(c)) }; } /* use only *after* variable declarations */ +XXH_PUBLIC_API unsigned XXH_versionNumber (void) { return XXH_VERSION_NUMBER; } + + +/* ******************************************************************* +* 32-bits hash functions +*********************************************************************/ +static const U32 PRIME32_1 = 2654435761U; +static const U32 PRIME32_2 = 2246822519U; +static const U32 PRIME32_3 = 3266489917U; +static const U32 PRIME32_4 = 668265263U; +static const U32 PRIME32_5 = 374761393U; + +static U32 XXH32_round(U32 seed, U32 input) +{ + seed += input * PRIME32_2; + seed = XXH_rotl32(seed, 13); + seed *= PRIME32_1; + return seed; +} + +FORCE_INLINE U32 XXH32_endian_align(const void* input, size_t len, U32 seed, XXH_endianess endian, XXH_alignment align) +{ + const BYTE* p = (const BYTE*)input; + const BYTE* bEnd = p + len; + U32 h32; +#define XXH_get32bits(p) XXH_readLE32_align(p, endian, align) + +#ifdef XXH_ACCEPT_NULL_INPUT_POINTER + if (p==NULL) { + len=0; + bEnd=p=(const BYTE*)(size_t)16; + } +#endif + + if (len>=16) { + const BYTE* const limit = bEnd - 16; + U32 v1 = seed + PRIME32_1 + PRIME32_2; + U32 v2 = seed + PRIME32_2; + U32 v3 = seed + 0; + U32 v4 = seed - PRIME32_1; + + do { + v1 = XXH32_round(v1, XXH_get32bits(p)); p+=4; + v2 = XXH32_round(v2, XXH_get32bits(p)); p+=4; + v3 = XXH32_round(v3, XXH_get32bits(p)); p+=4; + v4 = XXH32_round(v4, XXH_get32bits(p)); p+=4; + } while (p<=limit); + + h32 = XXH_rotl32(v1, 1) + XXH_rotl32(v2, 7) + XXH_rotl32(v3, 12) + XXH_rotl32(v4, 18); + } else { + h32 = seed + PRIME32_5; + } + + h32 += (U32) len; + + while (p+4<=bEnd) { + h32 += XXH_get32bits(p) * PRIME32_3; + h32 = XXH_rotl32(h32, 17) * PRIME32_4 ; + p+=4; + } + + while (p> 15; + h32 *= PRIME32_2; + h32 ^= h32 >> 13; + h32 *= PRIME32_3; + h32 ^= h32 >> 16; + + return h32; +} + + +XXH_PUBLIC_API unsigned int XXH32 (const void* input, size_t len, unsigned int seed) +{ +#if 0 + /* Simple version, good for code maintenance, but unfortunately slow for small inputs */ + XXH32_state_t state; + XXH32_reset(&state, seed); + XXH32_update(&state, input, len); + return XXH32_digest(&state); +#else + XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; + + if (XXH_FORCE_ALIGN_CHECK) { + if ((((size_t)input) & 3) == 0) { /* Input is 4-bytes aligned, leverage the speed benefit */ + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH32_endian_align(input, len, seed, XXH_littleEndian, XXH_aligned); + else + return XXH32_endian_align(input, len, seed, XXH_bigEndian, XXH_aligned); + } } + + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH32_endian_align(input, len, seed, XXH_littleEndian, XXH_unaligned); + else + return XXH32_endian_align(input, len, seed, XXH_bigEndian, XXH_unaligned); +#endif +} + + + +/*====== Hash streaming ======*/ + +XXH_PUBLIC_API XXH32_state_t* XXH32_createState(void) +{ + return (XXH32_state_t*)XXH_malloc(sizeof(XXH32_state_t)); +} +XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr) +{ + XXH_free(statePtr); + return XXH_OK; +} + +XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* dstState, const XXH32_state_t* srcState) +{ + memcpy(dstState, srcState, sizeof(*dstState)); +} + +XXH_PUBLIC_API XXH_errorcode XXH32_reset(XXH32_state_t* statePtr, unsigned int seed) +{ + XXH32_state_t state; /* using a local state to memcpy() in order to avoid strict-aliasing warnings */ + memset(&state, 0, sizeof(state)-4); /* do not write into reserved, for future removal */ + state.v1 = seed + PRIME32_1 + PRIME32_2; + state.v2 = seed + PRIME32_2; + state.v3 = seed + 0; + state.v4 = seed - PRIME32_1; + memcpy(statePtr, &state, sizeof(state)); + return XXH_OK; +} + + +FORCE_INLINE XXH_errorcode XXH32_update_endian (XXH32_state_t* state, const void* input, size_t len, XXH_endianess endian) +{ + const BYTE* p = (const BYTE*)input; + const BYTE* const bEnd = p + len; + +#ifdef XXH_ACCEPT_NULL_INPUT_POINTER + if (input==NULL) return XXH_ERROR; +#endif + + state->total_len_32 += (unsigned)len; + state->large_len |= (len>=16) | (state->total_len_32>=16); + + if (state->memsize + len < 16) { /* fill in tmp buffer */ + XXH_memcpy((BYTE*)(state->mem32) + state->memsize, input, len); + state->memsize += (unsigned)len; + return XXH_OK; + } + + if (state->memsize) { /* some data left from previous update */ + XXH_memcpy((BYTE*)(state->mem32) + state->memsize, input, 16-state->memsize); + { const U32* p32 = state->mem32; + state->v1 = XXH32_round(state->v1, XXH_readLE32(p32, endian)); p32++; + state->v2 = XXH32_round(state->v2, XXH_readLE32(p32, endian)); p32++; + state->v3 = XXH32_round(state->v3, XXH_readLE32(p32, endian)); p32++; + state->v4 = XXH32_round(state->v4, XXH_readLE32(p32, endian)); + } + p += 16-state->memsize; + state->memsize = 0; + } + + if (p <= bEnd-16) { + const BYTE* const limit = bEnd - 16; + U32 v1 = state->v1; + U32 v2 = state->v2; + U32 v3 = state->v3; + U32 v4 = state->v4; + + do { + v1 = XXH32_round(v1, XXH_readLE32(p, endian)); p+=4; + v2 = XXH32_round(v2, XXH_readLE32(p, endian)); p+=4; + v3 = XXH32_round(v3, XXH_readLE32(p, endian)); p+=4; + v4 = XXH32_round(v4, XXH_readLE32(p, endian)); p+=4; + } while (p<=limit); + + state->v1 = v1; + state->v2 = v2; + state->v3 = v3; + state->v4 = v4; + } + + if (p < bEnd) { + XXH_memcpy(state->mem32, p, (size_t)(bEnd-p)); + state->memsize = (unsigned)(bEnd-p); + } + + return XXH_OK; +} + +XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* state_in, const void* input, size_t len) +{ + XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; + + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH32_update_endian(state_in, input, len, XXH_littleEndian); + else + return XXH32_update_endian(state_in, input, len, XXH_bigEndian); +} + + + +FORCE_INLINE U32 XXH32_digest_endian (const XXH32_state_t* state, XXH_endianess endian) +{ + const BYTE * p = (const BYTE*)state->mem32; + const BYTE* const bEnd = (const BYTE*)(state->mem32) + state->memsize; + U32 h32; + + if (state->large_len) { + h32 = XXH_rotl32(state->v1, 1) + XXH_rotl32(state->v2, 7) + XXH_rotl32(state->v3, 12) + XXH_rotl32(state->v4, 18); + } else { + h32 = state->v3 /* == seed */ + PRIME32_5; + } + + h32 += state->total_len_32; + + while (p+4<=bEnd) { + h32 += XXH_readLE32(p, endian) * PRIME32_3; + h32 = XXH_rotl32(h32, 17) * PRIME32_4; + p+=4; + } + + while (p> 15; + h32 *= PRIME32_2; + h32 ^= h32 >> 13; + h32 *= PRIME32_3; + h32 ^= h32 >> 16; + + return h32; +} + + +XXH_PUBLIC_API unsigned int XXH32_digest (const XXH32_state_t* state_in) +{ + XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; + + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH32_digest_endian(state_in, XXH_littleEndian); + else + return XXH32_digest_endian(state_in, XXH_bigEndian); +} + + +/*====== Canonical representation ======*/ + +/*! Default XXH result types are basic unsigned 32 and 64 bits. +* The canonical representation follows human-readable write convention, aka big-endian (large digits first). +* These functions allow transformation of hash result into and from its canonical format. +* This way, hash values can be written into a file or buffer, and remain comparable across different systems and programs. +*/ + +XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash) +{ + XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) == sizeof(XXH32_hash_t)); + if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap32(hash); + memcpy(dst, &hash, sizeof(*dst)); +} + +XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src) +{ + return XXH_readBE32(src); +} + + +#ifndef XXH_NO_LONG_LONG + +/* ******************************************************************* +* 64-bits hash functions +*********************************************************************/ + +/*====== Memory access ======*/ + +#ifndef MEM_MODULE +# define MEM_MODULE +# if !defined (__VMS) && (defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) ) +# include + typedef uint64_t U64; +# else + typedef unsigned long long U64; /* if your compiler doesn't support unsigned long long, replace by another 64-bit type here. Note that xxhash.h will also need to be updated. */ +# endif +#endif + + +#if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2)) + +/* Force direct memory access. Only works on CPU which support unaligned memory access in hardware */ +static U64 XXH_read64(const void* memPtr) { return *(const U64*) memPtr; } + +#elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1)) + +/* __pack instructions are safer, but compiler specific, hence potentially problematic for some compilers */ +/* currently only defined for gcc and icc */ +typedef union { U32 u32; U64 u64; } __attribute__((packed)) unalign64; +static U64 XXH_read64(const void* ptr) { return ((const unalign64*)ptr)->u64; } + +#else + +/* portable and safe solution. Generally efficient. + * see : http://stackoverflow.com/a/32095106/646947 + */ + +static U64 XXH_read64(const void* memPtr) +{ + U64 val; + memcpy(&val, memPtr, sizeof(val)); + return val; +} + +#endif /* XXH_FORCE_DIRECT_MEMORY_ACCESS */ + +#if defined(_MSC_VER) /* Visual Studio */ +# define XXH_swap64 _byteswap_uint64 +#elif XXH_GCC_VERSION >= 403 +# define XXH_swap64 __builtin_bswap64 +#else +static U64 XXH_swap64 (U64 x) +{ + return ((x << 56) & 0xff00000000000000ULL) | + ((x << 40) & 0x00ff000000000000ULL) | + ((x << 24) & 0x0000ff0000000000ULL) | + ((x << 8) & 0x000000ff00000000ULL) | + ((x >> 8) & 0x00000000ff000000ULL) | + ((x >> 24) & 0x0000000000ff0000ULL) | + ((x >> 40) & 0x000000000000ff00ULL) | + ((x >> 56) & 0x00000000000000ffULL); +} +#endif + +FORCE_INLINE U64 XXH_readLE64_align(const void* ptr, XXH_endianess endian, XXH_alignment align) +{ + if (align==XXH_unaligned) + return endian==XXH_littleEndian ? XXH_read64(ptr) : XXH_swap64(XXH_read64(ptr)); + else + return endian==XXH_littleEndian ? *(const U64*)ptr : XXH_swap64(*(const U64*)ptr); +} + +FORCE_INLINE U64 XXH_readLE64(const void* ptr, XXH_endianess endian) +{ + return XXH_readLE64_align(ptr, endian, XXH_unaligned); +} + +static U64 XXH_readBE64(const void* ptr) +{ + return XXH_CPU_LITTLE_ENDIAN ? XXH_swap64(XXH_read64(ptr)) : XXH_read64(ptr); +} + + +/*====== xxh64 ======*/ + +static const U64 PRIME64_1 = 11400714785074694791ULL; +static const U64 PRIME64_2 = 14029467366897019727ULL; +static const U64 PRIME64_3 = 1609587929392839161ULL; +static const U64 PRIME64_4 = 9650029242287828579ULL; +static const U64 PRIME64_5 = 2870177450012600261ULL; + +static U64 XXH64_round(U64 acc, U64 input) +{ + acc += input * PRIME64_2; + acc = XXH_rotl64(acc, 31); + acc *= PRIME64_1; + return acc; +} + +static U64 XXH64_mergeRound(U64 acc, U64 val) +{ + val = XXH64_round(0, val); + acc ^= val; + acc = acc * PRIME64_1 + PRIME64_4; + return acc; +} + +FORCE_INLINE U64 XXH64_endian_align(const void* input, size_t len, U64 seed, XXH_endianess endian, XXH_alignment align) +{ + const BYTE* p = (const BYTE*)input; + const BYTE* bEnd = p + len; + U64 h64; +#define XXH_get64bits(p) XXH_readLE64_align(p, endian, align) + +#ifdef XXH_ACCEPT_NULL_INPUT_POINTER + if (p==NULL) { + len=0; + bEnd=p=(const BYTE*)(size_t)32; + } +#endif + + if (len>=32) { + const BYTE* const limit = bEnd - 32; + U64 v1 = seed + PRIME64_1 + PRIME64_2; + U64 v2 = seed + PRIME64_2; + U64 v3 = seed + 0; + U64 v4 = seed - PRIME64_1; + + do { + v1 = XXH64_round(v1, XXH_get64bits(p)); p+=8; + v2 = XXH64_round(v2, XXH_get64bits(p)); p+=8; + v3 = XXH64_round(v3, XXH_get64bits(p)); p+=8; + v4 = XXH64_round(v4, XXH_get64bits(p)); p+=8; + } while (p<=limit); + + h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18); + h64 = XXH64_mergeRound(h64, v1); + h64 = XXH64_mergeRound(h64, v2); + h64 = XXH64_mergeRound(h64, v3); + h64 = XXH64_mergeRound(h64, v4); + + } else { + h64 = seed + PRIME64_5; + } + + h64 += (U64) len; + + while (p+8<=bEnd) { + U64 const k1 = XXH64_round(0, XXH_get64bits(p)); + h64 ^= k1; + h64 = XXH_rotl64(h64,27) * PRIME64_1 + PRIME64_4; + p+=8; + } + + if (p+4<=bEnd) { + h64 ^= (U64)(XXH_get32bits(p)) * PRIME64_1; + h64 = XXH_rotl64(h64, 23) * PRIME64_2 + PRIME64_3; + p+=4; + } + + while (p> 33; + h64 *= PRIME64_2; + h64 ^= h64 >> 29; + h64 *= PRIME64_3; + h64 ^= h64 >> 32; + + return h64; +} + + +XXH_PUBLIC_API unsigned long long XXH64 (const void* input, size_t len, unsigned long long seed) +{ +#if 0 + /* Simple version, good for code maintenance, but unfortunately slow for small inputs */ + XXH64_state_t state; + XXH64_reset(&state, seed); + XXH64_update(&state, input, len); + return XXH64_digest(&state); +#else + XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; + + if (XXH_FORCE_ALIGN_CHECK) { + if ((((size_t)input) & 7)==0) { /* Input is aligned, let's leverage the speed advantage */ + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH64_endian_align(input, len, seed, XXH_littleEndian, XXH_aligned); + else + return XXH64_endian_align(input, len, seed, XXH_bigEndian, XXH_aligned); + } } + + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH64_endian_align(input, len, seed, XXH_littleEndian, XXH_unaligned); + else + return XXH64_endian_align(input, len, seed, XXH_bigEndian, XXH_unaligned); +#endif +} + +/*====== Hash Streaming ======*/ + +XXH_PUBLIC_API XXH64_state_t* XXH64_createState(void) +{ + return (XXH64_state_t*)XXH_malloc(sizeof(XXH64_state_t)); +} +XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr) +{ + XXH_free(statePtr); + return XXH_OK; +} + +XXH_PUBLIC_API void XXH64_copyState(XXH64_state_t* dstState, const XXH64_state_t* srcState) +{ + memcpy(dstState, srcState, sizeof(*dstState)); +} + +XXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH64_state_t* statePtr, unsigned long long seed) +{ + XXH64_state_t state; /* using a local state to memcpy() in order to avoid strict-aliasing warnings */ + memset(&state, 0, sizeof(state)-8); /* do not write into reserved, for future removal */ + state.v1 = seed + PRIME64_1 + PRIME64_2; + state.v2 = seed + PRIME64_2; + state.v3 = seed + 0; + state.v4 = seed - PRIME64_1; + memcpy(statePtr, &state, sizeof(state)); + return XXH_OK; +} + +FORCE_INLINE XXH_errorcode XXH64_update_endian (XXH64_state_t* state, const void* input, size_t len, XXH_endianess endian) +{ + const BYTE* p = (const BYTE*)input; + const BYTE* const bEnd = p + len; + +#ifdef XXH_ACCEPT_NULL_INPUT_POINTER + if (input==NULL) return XXH_ERROR; +#endif + + state->total_len += len; + + if (state->memsize + len < 32) { /* fill in tmp buffer */ + XXH_memcpy(((BYTE*)state->mem64) + state->memsize, input, len); + state->memsize += (U32)len; + return XXH_OK; + } + + if (state->memsize) { /* tmp buffer is full */ + XXH_memcpy(((BYTE*)state->mem64) + state->memsize, input, 32-state->memsize); + state->v1 = XXH64_round(state->v1, XXH_readLE64(state->mem64+0, endian)); + state->v2 = XXH64_round(state->v2, XXH_readLE64(state->mem64+1, endian)); + state->v3 = XXH64_round(state->v3, XXH_readLE64(state->mem64+2, endian)); + state->v4 = XXH64_round(state->v4, XXH_readLE64(state->mem64+3, endian)); + p += 32-state->memsize; + state->memsize = 0; + } + + if (p+32 <= bEnd) { + const BYTE* const limit = bEnd - 32; + U64 v1 = state->v1; + U64 v2 = state->v2; + U64 v3 = state->v3; + U64 v4 = state->v4; + + do { + v1 = XXH64_round(v1, XXH_readLE64(p, endian)); p+=8; + v2 = XXH64_round(v2, XXH_readLE64(p, endian)); p+=8; + v3 = XXH64_round(v3, XXH_readLE64(p, endian)); p+=8; + v4 = XXH64_round(v4, XXH_readLE64(p, endian)); p+=8; + } while (p<=limit); + + state->v1 = v1; + state->v2 = v2; + state->v3 = v3; + state->v4 = v4; + } + + if (p < bEnd) { + XXH_memcpy(state->mem64, p, (size_t)(bEnd-p)); + state->memsize = (unsigned)(bEnd-p); + } + + return XXH_OK; +} + +XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t* state_in, const void* input, size_t len) +{ + XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; + + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH64_update_endian(state_in, input, len, XXH_littleEndian); + else + return XXH64_update_endian(state_in, input, len, XXH_bigEndian); +} + +FORCE_INLINE U64 XXH64_digest_endian (const XXH64_state_t* state, XXH_endianess endian) +{ + const BYTE * p = (const BYTE*)state->mem64; + const BYTE* const bEnd = (const BYTE*)state->mem64 + state->memsize; + U64 h64; + + if (state->total_len >= 32) { + U64 const v1 = state->v1; + U64 const v2 = state->v2; + U64 const v3 = state->v3; + U64 const v4 = state->v4; + + h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18); + h64 = XXH64_mergeRound(h64, v1); + h64 = XXH64_mergeRound(h64, v2); + h64 = XXH64_mergeRound(h64, v3); + h64 = XXH64_mergeRound(h64, v4); + } else { + h64 = state->v3 + PRIME64_5; + } + + h64 += (U64) state->total_len; + + while (p+8<=bEnd) { + U64 const k1 = XXH64_round(0, XXH_readLE64(p, endian)); + h64 ^= k1; + h64 = XXH_rotl64(h64,27) * PRIME64_1 + PRIME64_4; + p+=8; + } + + if (p+4<=bEnd) { + h64 ^= (U64)(XXH_readLE32(p, endian)) * PRIME64_1; + h64 = XXH_rotl64(h64, 23) * PRIME64_2 + PRIME64_3; + p+=4; + } + + while (p> 33; + h64 *= PRIME64_2; + h64 ^= h64 >> 29; + h64 *= PRIME64_3; + h64 ^= h64 >> 32; + + return h64; +} + +XXH_PUBLIC_API unsigned long long XXH64_digest (const XXH64_state_t* state_in) +{ + XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; + + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH64_digest_endian(state_in, XXH_littleEndian); + else + return XXH64_digest_endian(state_in, XXH_bigEndian); +} + + +/*====== Canonical representation ======*/ + +XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash) +{ + XXH_STATIC_ASSERT(sizeof(XXH64_canonical_t) == sizeof(XXH64_hash_t)); + if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap64(hash); + memcpy(dst, &hash, sizeof(*dst)); +} + +XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src) +{ + return XXH_readBE64(src); +} + +#endif /* XXH_NO_LONG_LONG */ diff -Nru vulkan-1.0.65.2+dfsg1/layers/xxhash.h vulkan-1.1.73+dfsg/layers/xxhash.h --- vulkan-1.0.65.2+dfsg1/layers/xxhash.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/layers/xxhash.h 2018-03-14 09:08:48.000000000 +0000 @@ -0,0 +1,293 @@ +/* + xxHash - Extremely Fast Hash algorithm + Header File + Copyright (C) 2012-2016, Yann Collet. + + BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + + 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. + + 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 + OWNER 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. + + You can contact the author at : + - xxHash source repository : https://github.com/Cyan4973/xxHash +*/ + +/* Notice extracted from xxHash homepage : + +xxHash is an extremely fast Hash algorithm, running at RAM speed limits. +It also successfully passes all tests from the SMHasher suite. + +Comparison (single thread, Windows Seven 32 bits, using SMHasher on a Core 2 Duo @3GHz) + +Name Speed Q.Score Author +xxHash 5.4 GB/s 10 +CrapWow 3.2 GB/s 2 Andrew +MumurHash 3a 2.7 GB/s 10 Austin Appleby +SpookyHash 2.0 GB/s 10 Bob Jenkins +SBox 1.4 GB/s 9 Bret Mulvey +Lookup3 1.2 GB/s 9 Bob Jenkins +SuperFastHash 1.2 GB/s 1 Paul Hsieh +CityHash64 1.05 GB/s 10 Pike & Alakuijala +FNV 0.55 GB/s 5 Fowler, Noll, Vo +CRC32 0.43 GB/s 9 +MD5-32 0.33 GB/s 10 Ronald L. Rivest +SHA1-32 0.28 GB/s 10 + +Q.Score is a measure of quality of the hash function. +It depends on successfully passing SMHasher test set. +10 is a perfect score. + +A 64-bits version, named XXH64, is available since r35. +It offers much better speed, but for 64-bits applications only. +Name Speed on 64 bits Speed on 32 bits +XXH64 13.8 GB/s 1.9 GB/s +XXH32 6.8 GB/s 6.0 GB/s +*/ + +#ifndef XXHASH_H_5627135585666179 +#define XXHASH_H_5627135585666179 1 + +#if defined (__cplusplus) +extern "C" { +#endif + + +/* **************************** +* Definitions +******************************/ +#include /* size_t */ +typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode; + + +/* **************************** +* API modifier +******************************/ +/** XXH_PRIVATE_API +* This is useful to include xxhash functions in `static` mode +* in order to inline them, and remove their symbol from the public list. +* Methodology : +* #define XXH_PRIVATE_API +* #include "xxhash.h" +* `xxhash.c` is automatically included. +* It's not useful to compile and link it as a separate module. +*/ +#ifdef XXH_PRIVATE_API +# ifndef XXH_STATIC_LINKING_ONLY +# define XXH_STATIC_LINKING_ONLY +# endif +# if defined(__GNUC__) +# define XXH_PUBLIC_API static __inline __attribute__((unused)) +# elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) +# define XXH_PUBLIC_API static inline +# elif defined(_MSC_VER) +# define XXH_PUBLIC_API static __inline +# else +# define XXH_PUBLIC_API static /* this version may generate warnings for unused static functions; disable the relevant warning */ +# endif +#else +# define XXH_PUBLIC_API /* do nothing */ +#endif /* XXH_PRIVATE_API */ + +/*!XXH_NAMESPACE, aka Namespace Emulation : + +If you want to include _and expose_ xxHash functions from within your own library, +but also want to avoid symbol collisions with other libraries which may also include xxHash, + +you can use XXH_NAMESPACE, to automatically prefix any public symbol from xxhash library +with the value of XXH_NAMESPACE (therefore, avoid NULL and numeric values). + +Note that no change is required within the calling program as long as it includes `xxhash.h` : +regular symbol name will be automatically translated by this header. +*/ +#ifdef XXH_NAMESPACE +# define XXH_CAT(A,B) A##B +# define XXH_NAME2(A,B) XXH_CAT(A,B) +# define XXH_versionNumber XXH_NAME2(XXH_NAMESPACE, XXH_versionNumber) +# define XXH32 XXH_NAME2(XXH_NAMESPACE, XXH32) +# define XXH32_createState XXH_NAME2(XXH_NAMESPACE, XXH32_createState) +# define XXH32_freeState XXH_NAME2(XXH_NAMESPACE, XXH32_freeState) +# define XXH32_reset XXH_NAME2(XXH_NAMESPACE, XXH32_reset) +# define XXH32_update XXH_NAME2(XXH_NAMESPACE, XXH32_update) +# define XXH32_digest XXH_NAME2(XXH_NAMESPACE, XXH32_digest) +# define XXH32_copyState XXH_NAME2(XXH_NAMESPACE, XXH32_copyState) +# define XXH32_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH32_canonicalFromHash) +# define XXH32_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH32_hashFromCanonical) +# define XXH64 XXH_NAME2(XXH_NAMESPACE, XXH64) +# define XXH64_createState XXH_NAME2(XXH_NAMESPACE, XXH64_createState) +# define XXH64_freeState XXH_NAME2(XXH_NAMESPACE, XXH64_freeState) +# define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset) +# define XXH64_update XXH_NAME2(XXH_NAMESPACE, XXH64_update) +# define XXH64_digest XXH_NAME2(XXH_NAMESPACE, XXH64_digest) +# define XXH64_copyState XXH_NAME2(XXH_NAMESPACE, XXH64_copyState) +# define XXH64_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH64_canonicalFromHash) +# define XXH64_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH64_hashFromCanonical) +#endif + + +/* ************************************* +* Version +***************************************/ +#define XXH_VERSION_MAJOR 0 +#define XXH_VERSION_MINOR 6 +#define XXH_VERSION_RELEASE 2 +#define XXH_VERSION_NUMBER (XXH_VERSION_MAJOR *100*100 + XXH_VERSION_MINOR *100 + XXH_VERSION_RELEASE) +XXH_PUBLIC_API unsigned XXH_versionNumber (void); + + +/*-********************************************************************** +* 32-bits hash +************************************************************************/ +typedef unsigned int XXH32_hash_t; + +/*! XXH32() : + Calculate the 32-bits hash of sequence "length" bytes stored at memory address "input". + The memory between input & input+length must be valid (allocated and read-accessible). + "seed" can be used to alter the result predictably. + Speed on Core 2 Duo @ 3 GHz (single thread, SMHasher benchmark) : 5.4 GB/s */ +XXH_PUBLIC_API XXH32_hash_t XXH32 (const void* input, size_t length, unsigned int seed); + +/*====== Streaming ======*/ +typedef struct XXH32_state_s XXH32_state_t; /* incomplete type */ +XXH_PUBLIC_API XXH32_state_t* XXH32_createState(void); +XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr); +XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* dst_state, const XXH32_state_t* src_state); + +XXH_PUBLIC_API XXH_errorcode XXH32_reset (XXH32_state_t* statePtr, unsigned int seed); +XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length); +XXH_PUBLIC_API XXH32_hash_t XXH32_digest (const XXH32_state_t* statePtr); + +/* +These functions generate the xxHash of an input provided in multiple segments. +Note that, for small input, they are slower than single-call functions, due to state management. +For small input, prefer `XXH32()` and `XXH64()` . + +XXH state must first be allocated, using XXH*_createState() . + +Start a new hash by initializing state with a seed, using XXH*_reset(). + +Then, feed the hash state by calling XXH*_update() as many times as necessary. +Obviously, input must be allocated and read accessible. +The function returns an error code, with 0 meaning OK, and any other value meaning there is an error. + +Finally, a hash value can be produced anytime, by using XXH*_digest(). +This function returns the nn-bits hash as an int or long long. + +It's still possible to continue inserting input into the hash state after a digest, +and generate some new hashes later on, by calling again XXH*_digest(). + +When done, free XXH state space if it was allocated dynamically. +*/ + +/*====== Canonical representation ======*/ + +typedef struct { unsigned char digest[4]; } XXH32_canonical_t; +XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash); +XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src); + +/* Default result type for XXH functions are primitive unsigned 32 and 64 bits. +* The canonical representation uses human-readable write convention, aka big-endian (large digits first). +* These functions allow transformation of hash result into and from its canonical format. +* This way, hash values can be written into a file / memory, and remain comparable on different systems and programs. +*/ + + +#ifndef XXH_NO_LONG_LONG +/*-********************************************************************** +* 64-bits hash +************************************************************************/ +typedef unsigned long long XXH64_hash_t; + +/*! XXH64() : + Calculate the 64-bits hash of sequence of length "len" stored at memory address "input". + "seed" can be used to alter the result predictably. + This function runs faster on 64-bits systems, but slower on 32-bits systems (see benchmark). +*/ +XXH_PUBLIC_API XXH64_hash_t XXH64 (const void* input, size_t length, unsigned long long seed); + +/*====== Streaming ======*/ +typedef struct XXH64_state_s XXH64_state_t; /* incomplete type */ +XXH_PUBLIC_API XXH64_state_t* XXH64_createState(void); +XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr); +XXH_PUBLIC_API void XXH64_copyState(XXH64_state_t* dst_state, const XXH64_state_t* src_state); + +XXH_PUBLIC_API XXH_errorcode XXH64_reset (XXH64_state_t* statePtr, unsigned long long seed); +XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t* statePtr, const void* input, size_t length); +XXH_PUBLIC_API XXH64_hash_t XXH64_digest (const XXH64_state_t* statePtr); + +/*====== Canonical representation ======*/ +typedef struct { unsigned char digest[8]; } XXH64_canonical_t; +XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash); +XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src); +#endif /* XXH_NO_LONG_LONG */ + + +#ifdef XXH_STATIC_LINKING_ONLY + +/* ================================================================================================ + This section contains definitions which are not guaranteed to remain stable. + They may change in future versions, becoming incompatible with a different version of the library. + They shall only be used with static linking. + Never use these definitions in association with dynamic linking ! +=================================================================================================== */ + +/* These definitions are only meant to make possible + static allocation of XXH state, on stack or in a struct for example. + Never use members directly. */ + +struct XXH32_state_s { + unsigned total_len_32; + unsigned large_len; + unsigned v1; + unsigned v2; + unsigned v3; + unsigned v4; + unsigned mem32[4]; /* buffer defined as U32 for alignment */ + unsigned memsize; + unsigned reserved; /* never read nor write, will be removed in a future version */ +}; /* typedef'd to XXH32_state_t */ + +#ifndef XXH_NO_LONG_LONG /* remove 64-bits support */ +struct XXH64_state_s { + unsigned long long total_len; + unsigned long long v1; + unsigned long long v2; + unsigned long long v3; + unsigned long long v4; + unsigned long long mem64[4]; /* buffer defined as U64 for alignment */ + unsigned memsize; + unsigned reserved[2]; /* never read nor write, will be removed in a future version */ +}; /* typedef'd to XXH64_state_t */ +#endif + +#ifdef XXH_PRIVATE_API +# include "xxhash.c" /* include xxhash function bodies as `static`, for inlining */ +#endif + +#endif /* XXH_STATIC_LINKING_ONLY */ + + +#if defined (__cplusplus) +} +#endif + +#endif /* XXHASH_H_5627135585666179 */ diff -Nru vulkan-1.0.65.2+dfsg1/libs/vkjson/README.md vulkan-1.1.73+dfsg/libs/vkjson/README.md --- vulkan-1.0.65.2+dfsg1/libs/vkjson/README.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/libs/vkjson/README.md 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,13 @@ +### Android + +vkjson_info for Android is built as an executable for devices with root access. + +To use, simply push it to the device and run it: + + ./build_all.sh + adb push obj/local//vkjson_info /data/tmp/ + adb shell /data/tmp/vkjson_info + +The resulting json file will be found in: + + /sdcard/Android/.json \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/libs/vkjson/vkjson_info.cc vulkan-1.1.73+dfsg/libs/vkjson/vkjson_info.cc --- vulkan-1.0.65.2+dfsg1/libs/vkjson/vkjson_info.cc 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/libs/vkjson/vkjson_info.cc 2018-03-14 09:08:48.000000000 +0000 @@ -57,7 +57,7 @@ if (arg == "--device-index" || arg == "-d") { int result = sscanf(arg2.c_str(), "%u", &options->device_index); if (result != 1) { - options->device_index = -1; + options->device_index = static_cast(-1); std::cerr << "Unable to parse index: " << arg2 << std::endl; return false; } diff -Nru vulkan-1.0.65.2+dfsg1/loader/asm_offset.c vulkan-1.1.73+dfsg/loader/asm_offset.c --- vulkan-1.0.65.2+dfsg1/loader/asm_offset.c 2017-07-31 13:57:12.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/asm_offset.c 2018-04-27 11:24:19.000000000 +0000 @@ -1,7 +1,7 @@ /* - * Copyright (c) 2017 The Khronos Group Inc. - * Copyright (c) 2017 Valve Corporation - * Copyright (c) 2017 LunarG, Inc. + * Copyright (c) 2017-2018 The Khronos Group Inc. + * Copyright (c) 2017-2018 Valve Corporation + * Copyright (c) 2017-2018 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,29 +49,6 @@ return 1; } - struct loader_instance instance; - size_t hash_offset = ((size_t) &instance.phys_dev_ext_disp_hash) - ((size_t) &instance); - - struct loader_instance_dispatch_table disp; - size_t phys_dev_offset_dispatch = ((size_t) &disp.phys_dev_ext) - ((size_t) &disp); - - struct loader_physical_device_tramp phys_dev_tramp; - size_t phys_dev_offset_tramp = ((size_t) &phys_dev_tramp.phys_dev) - ((size_t) &phys_dev_tramp); - - struct loader_physical_device_term phys_dev_term; - size_t icd_term_offset = ((size_t) &phys_dev_term.this_icd_term) - ((size_t) &phys_dev_term); - size_t phys_dev_offset_term = ((size_t) &phys_dev_term.phys_dev) - ((size_t) &phys_dev_term); - - struct loader_icd_term icd_term; - size_t instance_offset = ((size_t) &icd_term.this_instance) - ((size_t) &icd_term); - size_t dispatch_offset = ((size_t) &icd_term.phys_dev_ext) - ((size_t) &icd_term); - - struct loader_dispatch_hash_entry hash; - size_t func_name_offset = ((size_t) &hash.func_name) - ((size_t) &hash); - - struct loader_dev_dispatch_table dev_disp; - size_t dev_disp_offset = ((size_t) &dev_disp.ext_dispatch) - ((size_t) &dev_disp); - struct ValueInfo values[] = { { .name = "VK_DEBUG_REPORT_ERROR_BIT_EXT", .value = (size_t) VK_DEBUG_REPORT_ERROR_BIT_EXT, .comment = "The numerical value of the enum value 'VK_DEBUG_REPORT_ERROR_BIT_EXT'" }, @@ -79,23 +56,23 @@ .comment = "The size of a pointer" }, { .name = "HASH_SIZE", .value = sizeof(struct loader_dispatch_hash_entry), .comment = "The size of a 'loader_dispatch_hash_entry' struct" }, - { .name = "HASH_OFFSET_INSTANCE", .value = hash_offset, + { .name = "HASH_OFFSET_INSTANCE", .value = offsetof(struct loader_instance, phys_dev_ext_disp_hash), .comment = "The offset of 'phys_dev_ext_disp_hash' within a 'loader_instance' struct" }, - { .name = "PHYS_DEV_OFFSET_INST_DISPATCH", .value = phys_dev_offset_dispatch, + { .name = "PHYS_DEV_OFFSET_INST_DISPATCH", .value = offsetof(struct loader_instance_dispatch_table, phys_dev_ext), .comment = "The offset of 'phys_dev_ext' within in 'loader_instance_dispatch_table' struct" }, - { .name = "PHYS_DEV_OFFSET_PHYS_DEV_TRAMP", .value = phys_dev_offset_tramp, + { .name = "PHYS_DEV_OFFSET_PHYS_DEV_TRAMP", .value = offsetof(struct loader_physical_device_tramp, phys_dev), .comment = "The offset of 'phys_dev' within a 'loader_physical_device_tramp' struct" }, - { .name = "ICD_TERM_OFFSET_PHYS_DEV_TERM", .value = icd_term_offset, + { .name = "ICD_TERM_OFFSET_PHYS_DEV_TERM", .value = offsetof(struct loader_physical_device_term, this_icd_term), .comment = "The offset of 'this_icd_term' within a 'loader_physical_device_term' struct" }, - { .name = "PHYS_DEV_OFFSET_PHYS_DEV_TERM", .value = phys_dev_offset_term, + { .name = "PHYS_DEV_OFFSET_PHYS_DEV_TERM", .value = offsetof(struct loader_physical_device_term, phys_dev), .comment = "The offset of 'phys_dev' within a 'loader_physical_device_term' struct" }, - { .name = "INSTANCE_OFFSET_ICD_TERM", .value = instance_offset, + { .name = "INSTANCE_OFFSET_ICD_TERM", .value = offsetof(struct loader_icd_term, this_instance), .comment = "The offset of 'this_instance' within a 'loader_icd_term' struct" }, - { .name = "DISPATCH_OFFSET_ICD_TERM", .value = dispatch_offset, + { .name = "DISPATCH_OFFSET_ICD_TERM", .value = offsetof(struct loader_icd_term, phys_dev_ext), .comment = "The offset of 'phys_dev_ext' within a 'loader_icd_term' struct" }, - { .name = "FUNC_NAME_OFFSET_HASH", .value = func_name_offset, + { .name = "FUNC_NAME_OFFSET_HASH", .value = offsetof(struct loader_dispatch_hash_entry, func_name), .comment = "The offset of 'func_name' within a 'loader_dispatch_hash_entry' struct" }, - { .name = "EXT_OFFSET_DEVICE_DISPATCH", .value = dev_disp_offset, + { .name = "EXT_OFFSET_DEVICE_DISPATCH", .value = offsetof(struct loader_dev_dispatch_table, ext_dispatch), .comment = "The offset of 'ext_dispatch' within a 'loader_dev_dispatch_table' struct" }, }; diff -Nru vulkan-1.0.65.2+dfsg1/loader/CMakeLists.txt vulkan-1.1.73+dfsg/loader/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/loader/CMakeLists.txt 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/CMakeLists.txt 2018-04-27 11:24:19.000000000 +0000 @@ -1,7 +1,7 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_PROJECT_BINARY_DIR} + ${PROJECT_BINARY_DIR} ${CMAKE_BINARY_DIR} ) @@ -11,8 +11,8 @@ CHECK_FUNCTION_EXISTS(__secure_getenv HAVE___SECURE_GETENV) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/loader_cmake_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/loader_cmake_config.h) -# Fetch header version from vulkan.h -file(STRINGS "../include/vulkan/vulkan.h" lines REGEX "^#define VK_HEADER_VERSION [0-9]+") +# Fetch header version from vulkan_core.h +file(STRINGS "../include/vulkan/vulkan_core.h" lines REGEX "^#define VK_HEADER_VERSION [0-9]+") list(LENGTH lines len) if(${len} EQUAL 1) string(REGEX MATCHALL "[0-9]+" vk_header_version ${lines}) @@ -49,6 +49,8 @@ add_definitions(-DVK_USE_PLATFORM_MIR_KHR) include_directories(${MIR_INCLUDE_DIR}) endif() +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + add_definitions(-DVK_USE_PLATFORM_MACOS_MVK) else() message(FATAL_ERROR "Unsupported Platform!") endif() @@ -73,8 +75,8 @@ trampoline.c wsi.c wsi.h - debug_report.c - debug_report.h + debug_utils.c + debug_utils.h gpa_helper.h cJSON.c cJSON.h @@ -104,20 +106,27 @@ add_dependencies(asm_offset generate_helper_files loader_gen_files) add_custom_command(OUTPUT gen_defines.asm DEPENDS asm_offset COMMAND asm_offset MASM) add_custom_target(loader_asm_gen_files DEPENDS gen_defines.asm) + set_target_properties(loader_asm_gen_files PROPERTIES FOLDER ${LVL_TARGET_FOLDER}) else() message(WARNING "Could not find working MASM assebler\n${ASM_FAILURE_MSG}") set(OPT_LOADER_SRCS ${OPT_LOADER_SRCS} unknown_ext_chain.c) add_custom_target(loader_asm_gen_files) endif() +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + # For MacOS, use the C code and force the compiler's tail-call optimization instead of using assembly code. + set(OPT_LOADER_SRCS ${OPT_LOADER_SRCS} unknown_ext_chain.c) + set_source_files_properties(${OPT_LOADER_SRCS} PROPERTIES COMPILE_FLAGS -O) + add_custom_target(loader_asm_gen_files) # This causes no assembly files to be generated. else() enable_language(ASM-ATT) - set(CMAKE_ASM-ATT_FLAGS "${CMAKE_ASM-ATT_FLAGS} $ENV{ASFLAGS}") - set(CMAKE_ASM-ATT_FLAGS "${CMAKE_ASM-ATT_FLAGS} -I\"${CMAKE_CURRENT_BINARY_DIR}\"") + set(CMAKE_ASM-ATT_COMPILE_FLAGS "${CMAKE_ASM-ATT_COMPILE_FLAGS} $ENV{ASFLAGS}") + set(CMAKE_ASM-ATT_COMPILE_FLAGS "${CMAKE_ASM-ATT_COMPILE_FLAGS} -I\"${CMAKE_CURRENT_BINARY_DIR}\"") file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/asm_test.asm ".intel_syntax noprefix\n.text\n.global sample\nsample:\nmov ecx, [eax + 16]\n") try_compile(ASSEMBLER_WORKS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/asm_test.asm) file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/asm_test.asm) if (ASSEMBLER_WORKS) + set(CMAKE_ASM-ATT_FLAGS "$ENV{ASFLAGS} -I\"${CMAKE_CURRENT_BINARY_DIR}\"") set(OPT_LOADER_SRCS ${OPT_LOADER_SRCS} unknown_ext_chain_gas.asm) add_executable(asm_offset asm_offset.c) add_dependencies(asm_offset generate_helper_files loader_gen_files) @@ -136,6 +145,7 @@ vk_loader_extensions.h vk_loader_extensions.c ) +set_target_properties(loader_gen_files PROPERTIES FOLDER ${LVL_TARGET_FOLDER}) if (WIN32) # Use static MSVCRT libraries @@ -146,6 +156,12 @@ endif() endforeach() + if (ENABLE_WIN10_ONECORE) + # Note When linking your app or driver to OneCore.lib, be sure to remove any links to non-umbrella libs (such as kernel32.lib). + set(CMAKE_CXX_STANDARD_LIBRARIES " ") # space is intentional + set(CMAKE_C_STANDARD_LIBRARIES ${CMAKE_CXX_STANDARD_LIBRARIES}) + endif() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS") # Build dev_ext_trampoline.c with -O2 to allow tail-call optimization. # Build other C files with normal options @@ -154,23 +170,39 @@ set(CMAKE_C_FLAGS_DEBUG " ") separate_arguments(LOCAL_C_FLAGS_REL WINDOWS_COMMAND ${CMAKE_C_FLAGS_RELEASE}) - add_library(loader-norm OBJECT ${NORMAL_LOADER_SRCS} dirent_on_windows.c) - add_dependencies(loader-norm generate_helper_files loader_gen_files) + add_library(loader-norm-dy OBJECT ${NORMAL_LOADER_SRCS} dirent_on_windows.c) + add_dependencies(loader-norm-dy generate_helper_files loader_gen_files) + target_compile_definitions(loader-norm-dy PUBLIC LOADER_DYNAMIC_LIB) + target_compile_options(loader-norm-dy PUBLIC "$<$:${LOCAL_C_FLAGS_DBG}>") + + add_library(loader-opt-dy OBJECT ${OPT_LOADER_SRCS}) + add_dependencies(loader-opt-dy generate_helper_files loader_gen_files loader_asm_gen_files) + target_compile_definitions(loader-opt-dy PUBLIC LOADER_DYNAMIC_LIB) + target_compile_options(loader-opt-dy PUBLIC "$<$:${LOCAL_C_FLAGS_REL}>") + + add_library(loader-norm-st OBJECT ${NORMAL_LOADER_SRCS} dirent_on_windows.c) + add_dependencies(loader-norm-st generate_helper_files loader_gen_files) + target_compile_options(loader-norm-st PUBLIC "$<$:${LOCAL_C_FLAGS_DBG}>") + + add_library(loader-opt-st OBJECT ${OPT_LOADER_SRCS}) + add_dependencies(loader-opt-st generate_helper_files loader_gen_files loader_asm_gen_files) + target_compile_options(loader-opt-st PUBLIC "$<$:${LOCAL_C_FLAGS_REL}>") - target_compile_options(loader-norm PUBLIC "$<$:${LOCAL_C_FLAGS_DBG}>") - add_library(loader-opt OBJECT ${OPT_LOADER_SRCS}) - add_dependencies(loader-opt generate_helper_files loader_gen_files loader_asm_gen_files) - - target_compile_options(loader-opt PUBLIC "$<$:${LOCAL_C_FLAGS_REL}>") - add_library(${API_LOWERCASE}-${MAJOR} SHARED $ $ ${CMAKE_CURRENT_BINARY_DIR}/${API_LOWERCASE}-${MAJOR}.def ${CMAKE_CURRENT_SOURCE_DIR}/loader.rc) - add_library(VKstatic.${MAJOR} STATIC $ $) + add_library(${API_LOWERCASE}-${MAJOR} SHARED $ $ ${CMAKE_CURRENT_BINARY_DIR}/${API_LOWERCASE}-${MAJOR}.def ${CMAKE_CURRENT_SOURCE_DIR}/loader.rc) + add_library(VKstatic.${MAJOR} STATIC $ $) # Suppress conflicting libs warning for debug builds. set_target_properties(${API_LOWERCASE}-${MAJOR} PROPERTIES LINK_FLAGS_DEBUG /ignore:4098) set_target_properties(VKstatic.${MAJOR} PROPERTIES OUTPUT_NAME VKstatic.${MAJOR}) - target_link_libraries(${API_LOWERCASE}-${MAJOR} shlwapi Cfgmgr32) + + if (ENABLE_WIN10_ONECORE) + target_link_libraries(${API_LOWERCASE}-${MAJOR} OneCoreUAP.lib LIBCMT.LIB LIBCMTD.LIB LIBVCRUNTIME.LIB LIBUCRT.LIB) + set_target_properties(${API_LOWERCASE}-${MAJOR} PROPERTIES LINK_FLAGS "/NODEFAULTLIB") + else() + target_link_libraries(${API_LOWERCASE}-${MAJOR} Cfgmgr32) + endif() + add_dependencies(${API_LOWERCASE}-${MAJOR} generate_helper_files loader_gen_files loader_asm_gen_files) - target_link_libraries(VKstatic.${MAJOR} shlwapi) if (CMAKE_GENERATOR MATCHES "^Visual Studio.*") file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/$/${API_LOWERCASE}-${MAJOR}.dll COPY_SRC_PATH) file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/../demos/$/ COPY_DST_PATH) @@ -186,28 +218,90 @@ COMMAND xcopy /Y /I ${COPY_SRC_PATH} ${COPY_DST_TEST_PATH}) else() + # Linux and MacOS set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith") + # Clang (and not gcc) warns about redefining a typedef with the same types, so disable that warning. + # Note that it will still throw an error if a typedef is redefined with a different type. + if (CMAKE_C_COMPILER_ID MATCHES "Clang") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-typedef-redefinition") + endif() + add_library(${API_LOWERCASE} SHARED ${NORMAL_LOADER_SRCS} ${OPT_LOADER_SRCS}) add_dependencies(${API_LOWERCASE} generate_helper_files loader_gen_files loader_asm_gen_files) - set_target_properties(${API_LOWERCASE} PROPERTIES SOVERSION "1" VERSION "1.0.${vk_header_version}") + target_compile_definitions(${API_LOWERCASE} PUBLIC -DLOADER_DYNAMIC_LIB) + set_target_properties(${API_LOWERCASE} PROPERTIES SOVERSION "1" VERSION "1.1.${vk_header_version}") target_link_libraries(${API_LOWERCASE} -ldl -lpthread -lm) + if(APPLE) + find_library(COREFOUNDATION_LIBRARY NAMES CoreFoundation) + target_link_libraries(${API_LOWERCASE} "-framework CoreFoundation") + + # Build vulkan.framework + set(FRAMEWORK_HEADERS + ${PROJECT_SOURCE_DIR}/include/vulkan/vk_icd.h + ${PROJECT_SOURCE_DIR}/include/vulkan/vk_layer.h + ${PROJECT_SOURCE_DIR}/include/vulkan/vk_platform.h + ${PROJECT_SOURCE_DIR}/include/vulkan/vk_sdk_platform.h + ${PROJECT_SOURCE_DIR}/include/vulkan/vulkan_android.h + ${PROJECT_SOURCE_DIR}/include/vulkan/vulkan_core.h + ${PROJECT_SOURCE_DIR}/include/vulkan/vulkan_ios.h + ${PROJECT_SOURCE_DIR}/include/vulkan/vulkan_macos.h + ${PROJECT_SOURCE_DIR}/include/vulkan/vulkan_mir.h + ${PROJECT_SOURCE_DIR}/include/vulkan/vulkan_vi.h + ${PROJECT_SOURCE_DIR}/include/vulkan/vulkan_wayland.h + ${PROJECT_SOURCE_DIR}/include/vulkan/vulkan_win32.h + ${PROJECT_SOURCE_DIR}/include/vulkan/vulkan_xcb.h + ${PROJECT_SOURCE_DIR}/include/vulkan/vulkan_xlib.h + ${PROJECT_SOURCE_DIR}/include/vulkan/vulkan_xlib_xrandr.h + ${PROJECT_SOURCE_DIR}/include/vulkan/vulkan.h + ${PROJECT_SOURCE_DIR}/include/vulkan/vulkan.hpp + ) + add_library(vulkan-framework SHARED ${NORMAL_LOADER_SRCS} ${OPT_LOADER_SRCS} ${FRAMEWORK_HEADERS}) + add_dependencies(vulkan-framework generate_helper_files loader_gen_files loader_asm_gen_files) + target_compile_definitions(vulkan-framework PUBLIC -DLOADER_DYNAMIC_LIB) + target_link_libraries(vulkan-framework -ldl -lpthread -lm "-framework CoreFoundation") + + # The FRAMEWORK_VERSION needs to be "A" here so that Xcode code-signing works when + # a user adds their framework to an Xcode project and does "Sign on Copy". + # It would have been nicer to use "1" to denote Vulkan 1. + # Although Apple docs say that a framework version does not have to be "A", + # this part of the Apple toolchain expects it. + # https://forums.developer.apple.com/thread/65963 + set_target_properties(vulkan-framework PROPERTIES + OUTPUT_NAME vulkan + FRAMEWORK TRUE + FRAMEWORK_VERSION A + VERSION "1.1.${vk_header_version}" # "current version" + SOVERSION "1.0.0" # "compatibility version" + MACOSX_FRAMEWORK_IDENTIFIER com.lunarg.vulkanFramework + PUBLIC_HEADER "${FRAMEWORK_HEADERS}" + ) + install(TARGETS vulkan-framework + PUBLIC_HEADER DESTINATION vulkan + FRAMEWORK DESTINATION loader + ) + endif(APPLE) + if(INSTALL_LVL_FILES) install(TARGETS ${API_LOWERCASE} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() - # Generate pkg-config file. - include(FindPkgConfig QUIET) - if(PKG_CONFIG_FOUND) - set(VK_API_VERSION "1.0.${vk_header_version}") - foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES} ${PLATFORM_LIBS}) - set(PRIVATE_LIBS "${PRIVATE_LIBS} -l${LIB}") - endforeach() - configure_file("vulkan.pc.in" "vulkan.pc" @ONLY) - if(INSTALL_LVL_FILES) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/vulkan.pc" - DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + if(NOT APPLE) + # Generate pkg-config file. + include(FindPkgConfig QUIET) + if(PKG_CONFIG_FOUND) + set(VK_API_VERSION "1.1.${vk_header_version}") + foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES} ${PLATFORM_LIBS}) + set(PRIVATE_LIBS "${PRIVATE_LIBS} -l${LIB}") + endforeach() + configure_file("vulkan.pc.in" "vulkan.pc" @ONLY) + if(INSTALL_LVL_FILES) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/vulkan.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + endif() endif() endif() endif() + + diff -Nru vulkan-1.0.65.2+dfsg1/loader/debug_report.c vulkan-1.1.73+dfsg/loader/debug_report.c --- vulkan-1.0.65.2+dfsg1/loader/debug_report.c 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/debug_report.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,466 +0,0 @@ -/* - * Copyright (c) 2015-2016 The Khronos Group Inc. - * Copyright (c) 2015-2016 Valve Corporation - * Copyright (c) 2015-2016 LunarG, Inc. - * Copyright (C) 2015-2016 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Author: Courtney Goeltzenleuchter - * Author: Jon Ashburn - * - */ - -#define _GNU_SOURCE -#include -#include -#include -#include -#ifndef WIN32 -#include -#else -#endif -#include "vk_loader_platform.h" -#include "debug_report.h" -#include "vulkan/vk_layer.h" - -typedef void(VKAPI_PTR *PFN_stringCallback)(char *message); - -static const VkExtensionProperties debug_report_extension_info = { - .extensionName = VK_EXT_DEBUG_REPORT_EXTENSION_NAME, .specVersion = VK_EXT_DEBUG_REPORT_SPEC_VERSION, -}; - -void debug_report_add_instance_extensions(const struct loader_instance *inst, struct loader_extension_list *ext_list) { - loader_add_to_ext_list(inst, ext_list, 1, &debug_report_extension_info); -} - -void debug_report_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo) { - ptr_instance->enabled_known_extensions.ext_debug_report = 0; - - for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DEBUG_REPORT_EXTENSION_NAME) == 0) { - ptr_instance->enabled_known_extensions.ext_debug_report = 1; - return; - } - } -} - -VkResult util_CreateDebugReportCallback(struct loader_instance *inst, VkDebugReportCallbackCreateInfoEXT *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT callback) { - VkLayerDbgFunctionNode *pNewDbgFuncNode = NULL; - -#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) - { -#else - if (pAllocator != NULL) { - pNewDbgFuncNode = (VkLayerDbgFunctionNode *)pAllocator->pfnAllocation(pAllocator->pUserData, sizeof(VkLayerDbgFunctionNode), - sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); - } else { -#endif - pNewDbgFuncNode = (VkLayerDbgFunctionNode *)loader_instance_heap_alloc(inst, sizeof(VkLayerDbgFunctionNode), - VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); - } - if (!pNewDbgFuncNode) { - return VK_ERROR_OUT_OF_HOST_MEMORY; - } - memset(pNewDbgFuncNode, 0, sizeof(VkLayerDbgFunctionNode)); - - pNewDbgFuncNode->msgCallback = callback; - pNewDbgFuncNode->pfnMsgCallback = pCreateInfo->pfnCallback; - pNewDbgFuncNode->msgFlags = pCreateInfo->flags; - pNewDbgFuncNode->pUserData = pCreateInfo->pUserData; - pNewDbgFuncNode->pNext = inst->DbgFunctionHead; - inst->DbgFunctionHead = pNewDbgFuncNode; - - return VK_SUCCESS; -} - -static VKAPI_ATTR VkResult VKAPI_CALL -debug_report_CreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT *pCallback) { - struct loader_instance *inst = loader_get_instance(instance); - loader_platform_thread_lock_mutex(&loader_lock); - VkResult result = inst->disp->layer_inst_disp.CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pCallback); - loader_platform_thread_unlock_mutex(&loader_lock); - return result; -} - -// Utility function to handle reporting -VkBool32 util_DebugReportMessage(const struct loader_instance *inst, VkFlags msgFlags, VkDebugReportObjectTypeEXT objectType, - uint64_t srcObject, size_t location, int32_t msgCode, const char *pLayerPrefix, const char *pMsg) { - VkBool32 bail = false; - VkLayerDbgFunctionNode *pTrav = inst->DbgFunctionHead; - while (pTrav) { - if (pTrav->msgFlags & msgFlags) { - if (pTrav->pfnMsgCallback(msgFlags, objectType, srcObject, location, msgCode, pLayerPrefix, pMsg, pTrav->pUserData)) { - bail = true; - } - } - pTrav = pTrav->pNext; - } - - return bail; -} - -void util_DestroyDebugReportCallback(struct loader_instance *inst, VkDebugReportCallbackEXT callback, - const VkAllocationCallbacks *pAllocator) { - VkLayerDbgFunctionNode *pTrav = inst->DbgFunctionHead; - VkLayerDbgFunctionNode *pPrev = pTrav; - - while (pTrav) { - if (pTrav->msgCallback == callback) { - pPrev->pNext = pTrav->pNext; - if (inst->DbgFunctionHead == pTrav) inst->DbgFunctionHead = pTrav->pNext; -#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) - { -#else - if (pAllocator != NULL) { - pAllocator->pfnFree(pAllocator->pUserData, pTrav); - } else { -#endif - loader_instance_heap_free(inst, pTrav); - } - break; - } - pPrev = pTrav; - pTrav = pTrav->pNext; - } -} - -// This utility (used by vkInstanceCreateInfo(), looks at a pNext chain. It -// counts any VkDebugReportCallbackCreateInfoEXT structs that it finds. It -// then allocates array that can hold that many structs, as well as that many -// VkDebugReportCallbackEXT handles. It then copies each -// VkDebugReportCallbackCreateInfoEXT, and initializes each handle. -VkResult util_CopyDebugReportCreateInfos(const void *pChain, const VkAllocationCallbacks *pAllocator, uint32_t *num_callbacks, - VkDebugReportCallbackCreateInfoEXT **infos, VkDebugReportCallbackEXT **callbacks) { - uint32_t n = *num_callbacks = 0; - VkDebugReportCallbackCreateInfoEXT *pInfos = NULL; - VkDebugReportCallbackEXT *pCallbacks = NULL; - - // NOTE: The loader is not using pAllocator, and so this function doesn't - // either. - - const void *pNext = pChain; - while (pNext) { - // 1st, count the number VkDebugReportCallbackCreateInfoEXT: - if (((VkDebugReportCallbackCreateInfoEXT *)pNext)->sType == VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT) { - n++; - } - pNext = (void *)((VkDebugReportCallbackCreateInfoEXT *)pNext)->pNext; - } - if (n == 0) { - return VK_SUCCESS; - } - -// 2nd, allocate memory for each VkDebugReportCallbackCreateInfoEXT: -#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) - { -#else - if (pAllocator != NULL) { - pInfos = *infos = ((VkDebugReportCallbackCreateInfoEXT *)pAllocator->pfnAllocation( - pAllocator->pUserData, n * sizeof(VkDebugReportCallbackCreateInfoEXT), sizeof(void *), - VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); - } else { -#endif - pInfos = *infos = ((VkDebugReportCallbackCreateInfoEXT *)malloc(n * sizeof(VkDebugReportCallbackCreateInfoEXT))); - } - if (!pInfos) { - return VK_ERROR_OUT_OF_HOST_MEMORY; - } -// 3rd, allocate memory for a unique handle for each callback: -#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) - { -#else - if (pAllocator != NULL) { - pCallbacks = *callbacks = ((VkDebugReportCallbackEXT *)pAllocator->pfnAllocation( - pAllocator->pUserData, n * sizeof(VkDebugReportCallbackEXT), sizeof(void *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); - if (!pCallbacks) { - pAllocator->pfnFree(pAllocator->pUserData, pInfos); - return VK_ERROR_OUT_OF_HOST_MEMORY; - } - } else { -#endif - pCallbacks = *callbacks = ((VkDebugReportCallbackEXT *)malloc(n * sizeof(VkDebugReportCallbackEXT))); - if (!pCallbacks) { - free(pInfos); - return VK_ERROR_OUT_OF_HOST_MEMORY; - } - } - // 4th, copy each VkDebugReportCallbackCreateInfoEXT for use by - // vkDestroyInstance, and assign a unique handle to each callback (just - // use the address of the copied VkDebugReportCallbackCreateInfoEXT): - pNext = pChain; - while (pNext) { - if (((VkInstanceCreateInfo *)pNext)->sType == VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT) { - memcpy(pInfos, pNext, sizeof(VkDebugReportCallbackCreateInfoEXT)); - *pCallbacks++ = (VkDebugReportCallbackEXT)(uintptr_t)pInfos++; - } - pNext = (void *)((VkInstanceCreateInfo *)pNext)->pNext; - } - - *num_callbacks = n; - return VK_SUCCESS; -} - -void util_FreeDebugReportCreateInfos(const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackCreateInfoEXT *infos, - VkDebugReportCallbackEXT *callbacks) { -#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) - { -#else - if (pAllocator != NULL) { - pAllocator->pfnFree(pAllocator->pUserData, infos); - pAllocator->pfnFree(pAllocator->pUserData, callbacks); - } else { -#endif - free(infos); - free(callbacks); - } -} - -VkResult util_CreateDebugReportCallbacks(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, - uint32_t num_callbacks, VkDebugReportCallbackCreateInfoEXT *infos, - VkDebugReportCallbackEXT *callbacks) { - VkResult rtn = VK_SUCCESS; - for (uint32_t i = 0; i < num_callbacks; i++) { - rtn = util_CreateDebugReportCallback(inst, &infos[i], pAllocator, callbacks[i]); - if (rtn != VK_SUCCESS) { - for (uint32_t j = 0; j < i; j++) { - util_DestroyDebugReportCallback(inst, callbacks[j], pAllocator); - } - return rtn; - } - } - return rtn; -} - -void util_DestroyDebugReportCallbacks(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, uint32_t num_callbacks, - VkDebugReportCallbackEXT *callbacks) { - for (uint32_t i = 0; i < num_callbacks; i++) { - util_DestroyDebugReportCallback(inst, callbacks[i], pAllocator); - } -} - -static VKAPI_ATTR void VKAPI_CALL debug_report_DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, - const VkAllocationCallbacks *pAllocator) { - struct loader_instance *inst = loader_get_instance(instance); - loader_platform_thread_lock_mutex(&loader_lock); - - inst->disp->layer_inst_disp.DestroyDebugReportCallbackEXT(instance, callback, pAllocator); - - util_DestroyDebugReportCallback(inst, callback, pAllocator); - - loader_platform_thread_unlock_mutex(&loader_lock); -} - -static VKAPI_ATTR void VKAPI_CALL debug_report_DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, - VkDebugReportObjectTypeEXT objType, uint64_t object, - size_t location, int32_t msgCode, const char *pLayerPrefix, - const char *pMsg) { - struct loader_instance *inst = loader_get_instance(instance); - - inst->disp->layer_inst_disp.DebugReportMessageEXT(instance, flags, objType, object, location, msgCode, pLayerPrefix, pMsg); -} - -// This is the instance chain terminator function -// for CreateDebugReportCallback -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallbackEXT(VkInstance instance, - const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkDebugReportCallbackEXT *pCallback) { - VkDebugReportCallbackEXT *icd_info = NULL; - const struct loader_icd_term *icd_term; - struct loader_instance *inst = (struct loader_instance *)instance; - VkResult res = VK_SUCCESS; - uint32_t storage_idx; - VkLayerDbgFunctionNode *pNewDbgFuncNode = NULL; - -#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) - { -#else - if (pAllocator != NULL) { - icd_info = ((VkDebugReportCallbackEXT *)pAllocator->pfnAllocation(pAllocator->pUserData, - inst->total_icd_count * sizeof(VkDebugReportCallbackEXT), - sizeof(void *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); - if (icd_info) { - memset(icd_info, 0, inst->total_icd_count * sizeof(VkDebugReportCallbackEXT)); - } - } else { -#endif - icd_info = calloc(sizeof(VkDebugReportCallbackEXT), inst->total_icd_count); - } - if (!icd_info) { - res = VK_ERROR_OUT_OF_HOST_MEMORY; - goto out; - } - - storage_idx = 0; - for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { - if (!icd_term->dispatch.CreateDebugReportCallbackEXT) { - continue; - } - - res = icd_term->dispatch.CreateDebugReportCallbackEXT(icd_term->instance, pCreateInfo, pAllocator, &icd_info[storage_idx]); - - if (res != VK_SUCCESS) { - goto out; - } - storage_idx++; - } - -// Setup the debug report callback in the terminator since a layer may want -// to grab the information itself (RenderDoc) and then return back to the -// user callback a sub-set of the messages. -#if (DEBUG_DISABLE_APP_ALLOCATORS == 0) - if (pAllocator != NULL) { - pNewDbgFuncNode = (VkLayerDbgFunctionNode *)pAllocator->pfnAllocation(pAllocator->pUserData, sizeof(VkLayerDbgFunctionNode), - sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); - } else { -#else - { -#endif - pNewDbgFuncNode = (VkLayerDbgFunctionNode *)loader_instance_heap_alloc(inst, sizeof(VkLayerDbgFunctionNode), - VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); - } - if (!pNewDbgFuncNode) { - res = VK_ERROR_OUT_OF_HOST_MEMORY; - goto out; - } - memset(pNewDbgFuncNode, 0, sizeof(VkLayerDbgFunctionNode)); - - pNewDbgFuncNode->pfnMsgCallback = pCreateInfo->pfnCallback; - pNewDbgFuncNode->msgFlags = pCreateInfo->flags; - pNewDbgFuncNode->pUserData = pCreateInfo->pUserData; - pNewDbgFuncNode->pNext = inst->DbgFunctionHead; - inst->DbgFunctionHead = pNewDbgFuncNode; - - *(VkDebugReportCallbackEXT **)pCallback = icd_info; - pNewDbgFuncNode->msgCallback = *pCallback; - -out: - - // Roll back on errors - if (VK_SUCCESS != res) { - storage_idx = 0; - for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { - if (NULL == icd_term->dispatch.DestroyDebugReportCallbackEXT) { - continue; - } - - if (icd_info && icd_info[storage_idx]) { - icd_term->dispatch.DestroyDebugReportCallbackEXT(icd_term->instance, icd_info[storage_idx], pAllocator); - } - storage_idx++; - } - -#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) - { -#else - if (pAllocator != NULL) { - if (NULL != pNewDbgFuncNode) { - pAllocator->pfnFree(pAllocator->pUserData, pNewDbgFuncNode); - } - if (NULL != icd_info) { - pAllocator->pfnFree(pAllocator->pUserData, icd_info); - } - } else { -#endif - if (NULL != pNewDbgFuncNode) { - free(pNewDbgFuncNode); - } - if (NULL != icd_info) { - free(icd_info); - } - } - } - - return res; -} - -// This is the instance chain terminator function for DestroyDebugReportCallback -VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, - const VkAllocationCallbacks *pAllocator) { - uint32_t storage_idx; - VkDebugReportCallbackEXT *icd_info; - const struct loader_icd_term *icd_term; - - struct loader_instance *inst = (struct loader_instance *)instance; - icd_info = *(VkDebugReportCallbackEXT **)&callback; - storage_idx = 0; - for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { - if (NULL == icd_term->dispatch.DestroyDebugReportCallbackEXT) { - continue; - } - - if (icd_info[storage_idx]) { - icd_term->dispatch.DestroyDebugReportCallbackEXT(icd_term->instance, icd_info[storage_idx], pAllocator); - } - storage_idx++; - } - -#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) - { -#else - if (pAllocator != NULL) { - pAllocator->pfnFree(pAllocator->pUserData, icd_info); - } else { -#endif - free(icd_info); - } -} - -// This is the instance chain terminator function for DebugReportMessage -VKAPI_ATTR void VKAPI_CALL terminator_DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, - VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, - int32_t msgCode, const char *pLayerPrefix, const char *pMsg) { - const struct loader_icd_term *icd_term; - - struct loader_instance *inst = (struct loader_instance *)instance; - - loader_platform_thread_lock_mutex(&loader_lock); - for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { - if (icd_term->dispatch.DebugReportMessageEXT != NULL) { - icd_term->dispatch.DebugReportMessageEXT(icd_term->instance, flags, objType, object, location, msgCode, pLayerPrefix, - pMsg); - } - } - - // Now that all ICDs have seen the message, call the necessary callbacks. Ignoring "bail" return value - // as there is nothing to bail from at this point. - - util_DebugReportMessage(inst, flags, objType, object, location, msgCode, pLayerPrefix, pMsg); - - loader_platform_thread_unlock_mutex(&loader_lock); -} - -bool debug_report_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr) { - // debug_report is currently advertised to be supported by the loader, - // so always return the entry points if name matches and it's enabled - *addr = NULL; - - if (!strcmp("vkCreateDebugReportCallbackEXT", name)) { - *addr = (ptr_instance->enabled_known_extensions.ext_debug_report == 1) ? (void *)debug_report_CreateDebugReportCallbackEXT - : NULL; - return true; - } - if (!strcmp("vkDestroyDebugReportCallbackEXT", name)) { - *addr = (ptr_instance->enabled_known_extensions.ext_debug_report == 1) ? (void *)debug_report_DestroyDebugReportCallbackEXT - : NULL; - return true; - } - if (!strcmp("vkDebugReportMessageEXT", name)) { - *addr = (ptr_instance->enabled_known_extensions.ext_debug_report == 1) ? (void *)debug_report_DebugReportMessageEXT : NULL; - return true; - } - return false; -} diff -Nru vulkan-1.0.65.2+dfsg1/loader/debug_report.h vulkan-1.1.73+dfsg/loader/debug_report.h --- vulkan-1.0.65.2+dfsg1/loader/debug_report.h 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/debug_report.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2015-2016 The Khronos Group Inc. - * Copyright (c) 2015-2016 Valve Corporation - * Copyright (c) 2015-2016 LunarG, Inc. - * Copyright (C) 2015-2016 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Author: Courtney Goeltzenleuchter - * Author: Jon Ashburn - * - */ - -#include "vk_loader_platform.h" -#include "loader.h" - -// CreateMsgCallback is global and needs to be -// applied to all layers and ICDs. -// What happens if a layer is enabled on both the instance chain -// as well as the device chain and a call to CreateMsgCallback is made? -// Do we need to make sure that each layer / driver only gets called once? -// Should a layer implementing support for CreateMsgCallback only be allowed (?) -// to live on one chain? Or maybe make it the application's responsibility. -// If the app enables DRAW_STATE on at both CreateInstance time and CreateDevice -// time, CreateMsgCallback will call the DRAW_STATE layer twice. Once via -// the instance chain and once via the device chain. -// The loader should only return the DEBUG_REPORT extension as supported -// for the GetGlobalExtensionSupport call. That should help eliminate one -// duplication. -// Since the instance chain requires us iterating over the available ICDs -// and each ICD will have it's own unique MsgCallback object we need to -// track those objects to give back the right one. -// This also implies that the loader has to intercept vkDestroyObject and -// if the extension is enabled and the object type is a MsgCallback then -// we must translate the object into the proper ICD specific ones. -// DestroyObject works on a device chain. Should not be what's destroying -// the MsgCallback object. That needs to be an instance thing. So, since -// we used an instance to create it, we need a custom Destroy that also -// takes an instance. That way we can iterate over the ICDs properly. -// Example use: -// CreateInstance: DEBUG_REPORT -// Loader will create instance chain with enabled extensions. -// TODO: Should validation layers be enabled here? If not, they will not be in -// the instance chain. -// fn = GetProcAddr(INSTANCE, "vkCreateMsgCallback") -> point to loader's -// vkCreateMsgCallback -// App creates a callback object: fn(..., &MsgCallbackObject1) -// Have only established the instance chain so far. Loader will call the -// instance chain. -// Each layer in the instance chain will call down to the next layer, -// terminating with -// the CreateMsgCallback loader terminator function that creates the actual -// MsgCallbackObject1 object. -// The loader CreateMsgCallback terminator will iterate over the ICDs. -// Calling each ICD that supports vkCreateMsgCallback and collect answers in -// icd_msg_callback_map here. -// As result is sent back up the chain each layer has opportunity to record the -// callback operation and -// appropriate MsgCallback object. -// ... -// Any reports matching the flags set in MsgCallbackObject1 will generate the -// defined callback behavior -// in the layer / ICD that initiated that report. -// ... -// CreateDevice: MemTracker:... -// App does not include DEBUG_REPORT as that is a global extension. -// TODO: GetExtensionSupport must not report DEBUG_REPORT when using instance. -// App MUST include any desired validation layers or they will not participate -// in the device call chain. -// App creates a callback object: fn(..., &MsgCallbackObject2) -// Loader's vkCreateMsgCallback is called. -// Loader sends call down instance chain - this is a global extension - any -// validation layer that was -// enabled at CreateInstance will be able to register the callback. Loader will -// iterate over the ICDs and -// will record the ICD's version of the MsgCallback2 object here. -// ... -// Any report will go to the layer's report function and it will check the flags -// for MsgCallbackObject1 -// and MsgCallbackObject2 and take the appropriate action as indicated by the -// app. -// ... -// App calls vkDestroyMsgCallback( MsgCallbackObject1 ) -// Loader's DestroyMsgCallback is where call starts. DestroyMsgCallback will be -// sent down instance chain -// ending in the loader's DestroyMsgCallback terminator which will iterate over -// the ICD's destroying each -// ICD version of that MsgCallback object and then destroy the loader's version -// of the object. -// Any reports generated after this will only have MsgCallbackObject2 available. - -void debug_report_add_instance_extensions(const struct loader_instance *inst, struct loader_extension_list *ext_list); - -void debug_report_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo); - -bool debug_report_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr); - -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallbackEXT(VkInstance instance, - const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkDebugReportCallbackEXT *pCallback); - -VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, - const VkAllocationCallbacks *pAllocator); - -VKAPI_ATTR void VKAPI_CALL terminator_DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, - VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, - int32_t msgCode, const char *pLayerPrefix, const char *pMsg); - -VkResult util_CreateDebugReportCallback(struct loader_instance *inst, VkDebugReportCallbackCreateInfoEXT *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT callback); - -void util_DestroyDebugReportCallback(struct loader_instance *inst, VkDebugReportCallbackEXT callback, - const VkAllocationCallbacks *pAllocator); - -VkResult util_CopyDebugReportCreateInfos(const void *pChain, const VkAllocationCallbacks *pAllocator, uint32_t *num_callbacks, - VkDebugReportCallbackCreateInfoEXT **infos, VkDebugReportCallbackEXT **callbacks); -void util_FreeDebugReportCreateInfos(const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackCreateInfoEXT *infos, - VkDebugReportCallbackEXT *callbacks); -VkResult util_CreateDebugReportCallbacks(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, - uint32_t num_callbacks, VkDebugReportCallbackCreateInfoEXT *infos, - VkDebugReportCallbackEXT *callbacks); - -void util_DestroyDebugReportCallbacks(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, uint32_t num_callbacks, - VkDebugReportCallbackEXT *callbacks); - -VkBool32 util_DebugReportMessage(const struct loader_instance *inst, VkFlags msgFlags, VkDebugReportObjectTypeEXT objectType, - uint64_t srcObject, size_t location, int32_t msgCode, const char *pLayerPrefix, const char *pMsg); diff -Nru vulkan-1.0.65.2+dfsg1/loader/debug_utils.c vulkan-1.1.73+dfsg/loader/debug_utils.c --- vulkan-1.0.65.2+dfsg1/loader/debug_utils.c 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/debug_utils.c 2018-03-14 09:08:48.000000000 +0000 @@ -0,0 +1,1000 @@ +/* + * Copyright (c) 2015-2017 The Khronos Group Inc. + * Copyright (c) 2015-2017 Valve Corporation + * Copyright (c) 2015-2017 LunarG, Inc. + * Copyright (C) 2015-2016 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Courtney Goeltzenleuchter + * Author: Jon Ashburn + * Author: Mark Young + * + */ + +#define _GNU_SOURCE +#include +#include +#include +#include +#ifndef WIN32 +#include +#else +#endif +#include "vk_loader_platform.h" +#include "debug_utils.h" +#include "vulkan/vk_layer.h" +#include "vk_object_types.h" + +// VK_EXT_debug_report related items + +VkResult util_CreateDebugUtilsMessenger(struct loader_instance *inst, const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerEXT messenger) { + VkLayerDbgFunctionNode *pNewDbgFuncNode = NULL; + +#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) + { +#else + if (pAllocator != NULL) { + pNewDbgFuncNode = (VkLayerDbgFunctionNode *)pAllocator->pfnAllocation(pAllocator->pUserData, sizeof(VkLayerDbgFunctionNode), + sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + } else { +#endif + pNewDbgFuncNode = (VkLayerDbgFunctionNode *)loader_instance_heap_alloc(inst, sizeof(VkLayerDbgFunctionNode), + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + } + if (!pNewDbgFuncNode) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + memset(pNewDbgFuncNode, 0, sizeof(VkLayerDbgFunctionNode)); + + pNewDbgFuncNode->is_messenger = true; + pNewDbgFuncNode->messenger.messenger = messenger; + pNewDbgFuncNode->messenger.pfnUserCallback = pCreateInfo->pfnUserCallback; + pNewDbgFuncNode->messenger.messageSeverity = pCreateInfo->messageSeverity; + pNewDbgFuncNode->messenger.messageType = pCreateInfo->messageType; + pNewDbgFuncNode->pUserData = pCreateInfo->pUserData; + pNewDbgFuncNode->pNext = inst->DbgFunctionHead; + inst->DbgFunctionHead = pNewDbgFuncNode; + + return VK_SUCCESS; +} + +static VKAPI_ATTR VkResult VKAPI_CALL +debug_utils_CreateDebugUtilsMessengerEXT(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerEXT *pMessenger) { + struct loader_instance *inst = loader_get_instance(instance); + loader_platform_thread_lock_mutex(&loader_lock); + VkResult result = inst->disp->layer_inst_disp.CreateDebugUtilsMessengerEXT(instance, pCreateInfo, pAllocator, pMessenger); + loader_platform_thread_unlock_mutex(&loader_lock); + return result; +} + +VkBool32 util_SubmitDebugUtilsMessageEXT(const struct loader_instance *inst, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, + VkDebugUtilsMessageTypeFlagsEXT messageTypes, + const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData) { + VkBool32 bail = false; + + if (NULL != pCallbackData && NULL != pCallbackData->pObjects && 0 < pCallbackData->objectCount) { + VkLayerDbgFunctionNode *pTrav = inst->DbgFunctionHead; + VkDebugReportObjectTypeEXT object_type; + VkDebugReportFlagsEXT object_flags = 0; + uint64_t object_handle; + + debug_utils_AnnotFlagsToReportFlags(messageSeverity, messageTypes, &object_flags); + debug_utils_AnnotObjectToDebugReportObject(pCallbackData->pObjects, &object_type, &object_handle); + + while (pTrav) { + if (pTrav->is_messenger && (pTrav->messenger.messageSeverity & messageSeverity) && + (pTrav->messenger.messageType & messageTypes)) { + if (pTrav->messenger.pfnUserCallback(messageSeverity, messageTypes, pCallbackData, pTrav->pUserData)) { + bail = true; + } + } + if (!pTrav->is_messenger && pTrav->report.msgFlags & object_flags) { + if (pTrav->report.pfnMsgCallback(object_flags, object_type, object_handle, 0, pCallbackData->messageIdNumber, + pCallbackData->pMessageIdName, pCallbackData->pMessage, pTrav->pUserData)) { + bail = true; + } + } + + pTrav = pTrav->pNext; + } + } + + return bail; +} + +void util_DestroyDebugUtilsMessenger(struct loader_instance *inst, VkDebugUtilsMessengerEXT messenger, + const VkAllocationCallbacks *pAllocator) { + VkLayerDbgFunctionNode *pTrav = inst->DbgFunctionHead; + VkLayerDbgFunctionNode *pPrev = pTrav; + + while (pTrav) { + if (pTrav->is_messenger && pTrav->messenger.messenger == messenger) { + pPrev->pNext = pTrav->pNext; + if (inst->DbgFunctionHead == pTrav) inst->DbgFunctionHead = pTrav->pNext; +#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) + { +#else + if (pAllocator != NULL) { + pAllocator->pfnFree(pAllocator->pUserData, pTrav); + } else { +#endif + loader_instance_heap_free(inst, pTrav); + } + break; + } + pPrev = pTrav; + pTrav = pTrav->pNext; + } +} + +// This utility (used by vkInstanceCreateInfo(), looks at a pNext chain. It +// counts any VkDebugUtilsMessengerCreateInfoEXT structs that it finds. It +// then allocates array that can hold that many structs, as well as that many +// VkDebugUtilsMessengerEXT handles. It then copies each +// VkDebugUtilsMessengerCreateInfoEXT, and initializes each handle. +VkResult util_CopyDebugUtilsMessengerCreateInfos(const void *pChain, const VkAllocationCallbacks *pAllocator, + uint32_t *num_messengers, VkDebugUtilsMessengerCreateInfoEXT **infos, + VkDebugUtilsMessengerEXT **messengers) { + uint32_t n = *num_messengers = 0; + VkDebugUtilsMessengerCreateInfoEXT *pInfos = NULL; + VkDebugUtilsMessengerEXT *pMessengers = NULL; + + const void *pNext = pChain; + while (pNext) { + // 1st, count the number VkDebugUtilsMessengerCreateInfoEXT: + if (((VkDebugUtilsMessengerCreateInfoEXT *)pNext)->sType == VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT) { + n++; + } + pNext = (void *)((VkDebugUtilsMessengerCreateInfoEXT *)pNext)->pNext; + } + if (n == 0) { + return VK_SUCCESS; + } + +// 2nd, allocate memory for each VkDebugUtilsMessengerCreateInfoEXT: +#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) + { +#else + if (pAllocator != NULL) { + pInfos = *infos = ((VkDebugUtilsMessengerCreateInfoEXT *)pAllocator->pfnAllocation( + pAllocator->pUserData, n * sizeof(VkDebugUtilsMessengerCreateInfoEXT), sizeof(void *), + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); + } else { +#endif + pInfos = *infos = ((VkDebugUtilsMessengerCreateInfoEXT *)malloc(n * sizeof(VkDebugUtilsMessengerCreateInfoEXT))); + } + if (!pInfos) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } +// 3rd, allocate memory for a unique handle for each callback: +#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) + { +#else + if (pAllocator != NULL) { + pMessengers = *messengers = ((VkDebugUtilsMessengerEXT *)pAllocator->pfnAllocation( + pAllocator->pUserData, n * sizeof(VkDebugUtilsMessengerEXT), sizeof(void *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); + if (NULL == pMessengers) { + pAllocator->pfnFree(pAllocator->pUserData, pInfos); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + } else { +#endif + pMessengers = *messengers = ((VkDebugUtilsMessengerEXT *)malloc(n * sizeof(VkDebugUtilsMessengerEXT))); + if (NULL == pMessengers) { + free(pInfos); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + } + // 4th, copy each VkDebugUtilsMessengerCreateInfoEXT for use by + // vkDestroyInstance, and assign a unique handle to each messenger (just + // use the address of the copied VkDebugUtilsMessengerCreateInfoEXT): + pNext = pChain; + while (pNext) { + if (((VkInstanceCreateInfo *)pNext)->sType == VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT) { + memcpy(pInfos, pNext, sizeof(VkDebugUtilsMessengerCreateInfoEXT)); + *pMessengers++ = (VkDebugUtilsMessengerEXT)(uintptr_t)pInfos++; + } + pNext = (void *)((VkInstanceCreateInfo *)pNext)->pNext; + } + + *num_messengers = n; + return VK_SUCCESS; +} + +void util_FreeDebugUtilsMessengerCreateInfos(const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerCreateInfoEXT *infos, + VkDebugUtilsMessengerEXT *messengers) { +#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) + { +#else + if (pAllocator != NULL) { + pAllocator->pfnFree(pAllocator->pUserData, infos); + pAllocator->pfnFree(pAllocator->pUserData, messengers); + } else { +#endif + free(infos); + free(messengers); + } +} + +VkResult util_CreateDebugUtilsMessengers(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, + uint32_t num_messengers, VkDebugUtilsMessengerCreateInfoEXT *infos, + VkDebugUtilsMessengerEXT *messengers) { + VkResult rtn = VK_SUCCESS; + for (uint32_t i = 0; i < num_messengers; i++) { + rtn = util_CreateDebugUtilsMessenger(inst, &infos[i], pAllocator, messengers[i]); + if (rtn != VK_SUCCESS) { + for (uint32_t j = 0; j < i; j++) { + util_DestroyDebugUtilsMessenger(inst, messengers[j], pAllocator); + } + return rtn; + } + } + return rtn; +} + +void util_DestroyDebugUtilsMessengers(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, + uint32_t num_messengers, VkDebugUtilsMessengerEXT *messengers) { + for (uint32_t i = 0; i < num_messengers; i++) { + util_DestroyDebugUtilsMessenger(inst, messengers[i], pAllocator); + } +} + +static VKAPI_ATTR void VKAPI_CALL debug_utils_SubmitDebugUtilsMessageEXT( + VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, + const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData) { + struct loader_instance *inst = loader_get_instance(instance); + + inst->disp->layer_inst_disp.SubmitDebugUtilsMessageEXT(instance, messageSeverity, messageTypes, pCallbackData); +} + +static VKAPI_ATTR void VKAPI_CALL debug_utils_DestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, + const VkAllocationCallbacks *pAllocator) { + struct loader_instance *inst = loader_get_instance(instance); + loader_platform_thread_lock_mutex(&loader_lock); + + inst->disp->layer_inst_disp.DestroyDebugUtilsMessengerEXT(instance, messenger, pAllocator); + + util_DestroyDebugUtilsMessenger(inst, messenger, pAllocator); + + loader_platform_thread_unlock_mutex(&loader_lock); +} + +// This is the instance chain terminator function for CreateDebugUtilsMessenger +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugUtilsMessengerEXT(VkInstance instance, + const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDebugUtilsMessengerEXT *pMessenger) { + VkDebugUtilsMessengerEXT *icd_info = NULL; + const struct loader_icd_term *icd_term; + struct loader_instance *inst = (struct loader_instance *)instance; + VkResult res = VK_SUCCESS; + uint32_t storage_idx; + VkLayerDbgFunctionNode *pNewDbgFuncNode = NULL; + +#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) + { +#else + if (pAllocator != NULL) { + icd_info = ((VkDebugUtilsMessengerEXT *)pAllocator->pfnAllocation(pAllocator->pUserData, + inst->total_icd_count * sizeof(VkDebugUtilsMessengerEXT), + sizeof(void *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); + if (icd_info) { + memset(icd_info, 0, inst->total_icd_count * sizeof(VkDebugUtilsMessengerEXT)); + } + } else { +#endif + icd_info = calloc(sizeof(VkDebugUtilsMessengerEXT), inst->total_icd_count); + } + if (!icd_info) { + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + + storage_idx = 0; + for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { + if (!icd_term->dispatch.CreateDebugUtilsMessengerEXT) { + continue; + } + + res = icd_term->dispatch.CreateDebugUtilsMessengerEXT(icd_term->instance, pCreateInfo, pAllocator, &icd_info[storage_idx]); + + if (res != VK_SUCCESS) { + goto out; + } + storage_idx++; + } + +// Setup the debug report callback in the terminator since a layer may want +// to grab the information itself (RenderDoc) and then return back to the +// user callback a sub-set of the messages. +#if (DEBUG_DISABLE_APP_ALLOCATORS == 0) + if (pAllocator != NULL) { + pNewDbgFuncNode = (VkLayerDbgFunctionNode *)pAllocator->pfnAllocation(pAllocator->pUserData, sizeof(VkLayerDbgFunctionNode), + sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + } else { +#else + { +#endif + pNewDbgFuncNode = (VkLayerDbgFunctionNode *)loader_instance_heap_alloc(inst, sizeof(VkLayerDbgFunctionNode), + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + } + if (!pNewDbgFuncNode) { + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + memset(pNewDbgFuncNode, 0, sizeof(VkLayerDbgFunctionNode)); + + pNewDbgFuncNode->is_messenger = true; + pNewDbgFuncNode->messenger.pfnUserCallback = pCreateInfo->pfnUserCallback; + pNewDbgFuncNode->messenger.messageSeverity = pCreateInfo->messageSeverity; + pNewDbgFuncNode->messenger.messageType = pCreateInfo->messageType; + pNewDbgFuncNode->pUserData = pCreateInfo->pUserData; + pNewDbgFuncNode->pNext = inst->DbgFunctionHead; + inst->DbgFunctionHead = pNewDbgFuncNode; + + *(VkDebugUtilsMessengerEXT **)pMessenger = icd_info; + pNewDbgFuncNode->messenger.messenger = *pMessenger; + +out: + + // Roll back on errors + if (VK_SUCCESS != res) { + storage_idx = 0; + for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { + if (NULL == icd_term->dispatch.DestroyDebugUtilsMessengerEXT) { + continue; + } + + if (icd_info && icd_info[storage_idx]) { + icd_term->dispatch.DestroyDebugUtilsMessengerEXT(icd_term->instance, icd_info[storage_idx], pAllocator); + } + storage_idx++; + } + +#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) + { +#else + if (pAllocator != NULL) { + if (NULL != pNewDbgFuncNode) { + pAllocator->pfnFree(pAllocator->pUserData, pNewDbgFuncNode); + } + if (NULL != icd_info) { + pAllocator->pfnFree(pAllocator->pUserData, icd_info); + } + } else { +#endif + if (NULL != pNewDbgFuncNode) { + free(pNewDbgFuncNode); + } + if (NULL != icd_info) { + free(icd_info); + } + } + } + + return res; +} + +// This is the instance chain terminator function for DestroyDebugUtilsMessenger +VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, + const VkAllocationCallbacks *pAllocator) { + uint32_t storage_idx; + VkDebugUtilsMessengerEXT *icd_info; + const struct loader_icd_term *icd_term; + + struct loader_instance *inst = (struct loader_instance *)instance; + icd_info = *(VkDebugUtilsMessengerEXT **)&messenger; + storage_idx = 0; + for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { + if (NULL == icd_term->dispatch.DestroyDebugUtilsMessengerEXT) { + continue; + } + + if (icd_info[storage_idx]) { + icd_term->dispatch.DestroyDebugUtilsMessengerEXT(icd_term->instance, icd_info[storage_idx], pAllocator); + } + storage_idx++; + } + +#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) + { +#else + if (pAllocator != NULL) { + pAllocator->pfnFree(pAllocator->pUserData, icd_info); + } else { +#endif + free(icd_info); + } +} + +// This is the instance chain terminator function for SubmitDebugUtilsMessageEXT +VKAPI_ATTR void VKAPI_CALL terminator_SubmitDebugUtilsMessageEXT(VkInstance instance, + VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, + VkDebugUtilsMessageTypeFlagsEXT messageTypes, + const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData) { + const struct loader_icd_term *icd_term; + + struct loader_instance *inst = (struct loader_instance *)instance; + + loader_platform_thread_lock_mutex(&loader_lock); + for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { + if (icd_term->dispatch.SubmitDebugUtilsMessageEXT != NULL) { + icd_term->dispatch.SubmitDebugUtilsMessageEXT(icd_term->instance, messageSeverity, messageTypes, pCallbackData); + } + } + + // Now that all ICDs have seen the message, call the necessary callbacks. Ignoring "bail" return value + // as there is nothing to bail from at this point. + + util_SubmitDebugUtilsMessageEXT(inst, messageSeverity, messageTypes, pCallbackData); + + loader_platform_thread_unlock_mutex(&loader_lock); +} + +// VK_EXT_debug_report related items + +VkResult util_CreateDebugReportCallback(struct loader_instance *inst, VkDebugReportCallbackCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT callback) { + VkLayerDbgFunctionNode *pNewDbgFuncNode = NULL; + +#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) + { +#else + if (pAllocator != NULL) { + pNewDbgFuncNode = (VkLayerDbgFunctionNode *)pAllocator->pfnAllocation(pAllocator->pUserData, sizeof(VkLayerDbgFunctionNode), + sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + } else { +#endif + pNewDbgFuncNode = (VkLayerDbgFunctionNode *)loader_instance_heap_alloc(inst, sizeof(VkLayerDbgFunctionNode), + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + } + if (!pNewDbgFuncNode) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + memset(pNewDbgFuncNode, 0, sizeof(VkLayerDbgFunctionNode)); + + pNewDbgFuncNode->is_messenger = false; + pNewDbgFuncNode->report.msgCallback = callback; + pNewDbgFuncNode->report.pfnMsgCallback = pCreateInfo->pfnCallback; + pNewDbgFuncNode->report.msgFlags = pCreateInfo->flags; + pNewDbgFuncNode->pUserData = pCreateInfo->pUserData; + pNewDbgFuncNode->pNext = inst->DbgFunctionHead; + inst->DbgFunctionHead = pNewDbgFuncNode; + + return VK_SUCCESS; +} + +static VKAPI_ATTR VkResult VKAPI_CALL +debug_utils_CreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT *pCallback) { + struct loader_instance *inst = loader_get_instance(instance); + loader_platform_thread_lock_mutex(&loader_lock); + VkResult result = inst->disp->layer_inst_disp.CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pCallback); + loader_platform_thread_unlock_mutex(&loader_lock); + return result; +} + +// Utility function to handle reporting +VkBool32 util_DebugReportMessage(const struct loader_instance *inst, VkFlags msgFlags, VkDebugReportObjectTypeEXT objectType, + uint64_t srcObject, size_t location, int32_t msgCode, const char *pLayerPrefix, const char *pMsg) { + VkBool32 bail = false; + VkLayerDbgFunctionNode *pTrav = inst->DbgFunctionHead; + VkDebugUtilsMessageSeverityFlagBitsEXT severity; + VkDebugUtilsMessageTypeFlagsEXT types; + VkDebugUtilsMessengerCallbackDataEXT callback_data; + VkDebugUtilsObjectNameInfoEXT object_name; + + debug_utils_ReportFlagsToAnnotFlags(msgFlags, false, &severity, &types); + debug_utils_ReportObjectToAnnotObject(objectType, srcObject, &object_name); + + callback_data.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT; + callback_data.pNext = NULL; + callback_data.flags = 0; + callback_data.pMessageIdName = pLayerPrefix; + callback_data.messageIdNumber = msgCode; + callback_data.pMessage = pMsg; + callback_data.cmdBufLabelCount = 0; + callback_data.pCmdBufLabels = NULL; + callback_data.queueLabelCount = 0; + callback_data.pQueueLabels = NULL; + callback_data.objectCount = 1; + callback_data.pObjects = &object_name; + + while (pTrav) { + if (!pTrav->is_messenger && pTrav->report.msgFlags & msgFlags) { + if (pTrav->report.pfnMsgCallback(msgFlags, objectType, srcObject, location, msgCode, pLayerPrefix, pMsg, + pTrav->pUserData)) { + bail = true; + } + } + if (pTrav->is_messenger && (pTrav->messenger.messageSeverity & severity) && (pTrav->messenger.messageType & types)) { + if (pTrav->messenger.pfnUserCallback(severity, types, &callback_data, pTrav->pUserData)) { + bail = true; + } + } + + pTrav = pTrav->pNext; + } + + return bail; +} + +void util_DestroyDebugReportCallback(struct loader_instance *inst, VkDebugReportCallbackEXT callback, + const VkAllocationCallbacks *pAllocator) { + VkLayerDbgFunctionNode *pTrav = inst->DbgFunctionHead; + VkLayerDbgFunctionNode *pPrev = pTrav; + + while (pTrav) { + if (!pTrav->is_messenger && pTrav->report.msgCallback == callback) { + pPrev->pNext = pTrav->pNext; + if (inst->DbgFunctionHead == pTrav) inst->DbgFunctionHead = pTrav->pNext; +#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) + { +#else + if (pAllocator != NULL) { + pAllocator->pfnFree(pAllocator->pUserData, pTrav); + } else { +#endif + loader_instance_heap_free(inst, pTrav); + } + break; + } + pPrev = pTrav; + pTrav = pTrav->pNext; + } +} + +// This utility (used by vkInstanceCreateInfo(), looks at a pNext chain. It +// counts any VkDebugReportCallbackCreateInfoEXT structs that it finds. It +// then allocates array that can hold that many structs, as well as that many +// VkDebugReportCallbackEXT handles. It then copies each +// VkDebugReportCallbackCreateInfoEXT, and initializes each handle. +VkResult util_CopyDebugReportCreateInfos(const void *pChain, const VkAllocationCallbacks *pAllocator, uint32_t *num_callbacks, + VkDebugReportCallbackCreateInfoEXT **infos, VkDebugReportCallbackEXT **callbacks) { + uint32_t n = *num_callbacks = 0; + VkDebugReportCallbackCreateInfoEXT *pInfos = NULL; + VkDebugReportCallbackEXT *pCallbacks = NULL; + + const void *pNext = pChain; + while (pNext) { + // 1st, count the number VkDebugReportCallbackCreateInfoEXT: + if (((VkDebugReportCallbackCreateInfoEXT *)pNext)->sType == VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT) { + n++; + } + pNext = (void *)((VkDebugReportCallbackCreateInfoEXT *)pNext)->pNext; + } + if (n == 0) { + return VK_SUCCESS; + } + +// 2nd, allocate memory for each VkDebugReportCallbackCreateInfoEXT: +#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) + { +#else + if (pAllocator != NULL) { + pInfos = *infos = ((VkDebugReportCallbackCreateInfoEXT *)pAllocator->pfnAllocation( + pAllocator->pUserData, n * sizeof(VkDebugReportCallbackCreateInfoEXT), sizeof(void *), + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); + } else { +#endif + pInfos = *infos = ((VkDebugReportCallbackCreateInfoEXT *)malloc(n * sizeof(VkDebugReportCallbackCreateInfoEXT))); + } + if (!pInfos) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } +// 3rd, allocate memory for a unique handle for each callback: +#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) + { +#else + if (pAllocator != NULL) { + pCallbacks = *callbacks = ((VkDebugReportCallbackEXT *)pAllocator->pfnAllocation( + pAllocator->pUserData, n * sizeof(VkDebugReportCallbackEXT), sizeof(void *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); + if (!pCallbacks) { + pAllocator->pfnFree(pAllocator->pUserData, pInfos); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + } else { +#endif + pCallbacks = *callbacks = ((VkDebugReportCallbackEXT *)malloc(n * sizeof(VkDebugReportCallbackEXT))); + if (!pCallbacks) { + free(pInfos); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + } + // 4th, copy each VkDebugReportCallbackCreateInfoEXT for use by + // vkDestroyInstance, and assign a unique handle to each callback (just + // use the address of the copied VkDebugReportCallbackCreateInfoEXT): + pNext = pChain; + while (pNext) { + if (((VkInstanceCreateInfo *)pNext)->sType == VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT) { + memcpy(pInfos, pNext, sizeof(VkDebugReportCallbackCreateInfoEXT)); + *pCallbacks++ = (VkDebugReportCallbackEXT)(uintptr_t)pInfos++; + } + pNext = (void *)((VkInstanceCreateInfo *)pNext)->pNext; + } + + *num_callbacks = n; + return VK_SUCCESS; +} + +void util_FreeDebugReportCreateInfos(const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackCreateInfoEXT *infos, + VkDebugReportCallbackEXT *callbacks) { +#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) + { +#else + if (pAllocator != NULL) { + pAllocator->pfnFree(pAllocator->pUserData, infos); + pAllocator->pfnFree(pAllocator->pUserData, callbacks); + } else { +#endif + free(infos); + free(callbacks); + } +} + +VkResult util_CreateDebugReportCallbacks(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, + uint32_t num_callbacks, VkDebugReportCallbackCreateInfoEXT *infos, + VkDebugReportCallbackEXT *callbacks) { + VkResult rtn = VK_SUCCESS; + for (uint32_t i = 0; i < num_callbacks; i++) { + rtn = util_CreateDebugReportCallback(inst, &infos[i], pAllocator, callbacks[i]); + if (rtn != VK_SUCCESS) { + for (uint32_t j = 0; j < i; j++) { + util_DestroyDebugReportCallback(inst, callbacks[j], pAllocator); + } + return rtn; + } + } + return rtn; +} + +void util_DestroyDebugReportCallbacks(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, uint32_t num_callbacks, + VkDebugReportCallbackEXT *callbacks) { + for (uint32_t i = 0; i < num_callbacks; i++) { + util_DestroyDebugReportCallback(inst, callbacks[i], pAllocator); + } +} + +static VKAPI_ATTR void VKAPI_CALL debug_utils_DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, + const VkAllocationCallbacks *pAllocator) { + struct loader_instance *inst = loader_get_instance(instance); + loader_platform_thread_lock_mutex(&loader_lock); + + inst->disp->layer_inst_disp.DestroyDebugReportCallbackEXT(instance, callback, pAllocator); + + util_DestroyDebugReportCallback(inst, callback, pAllocator); + + loader_platform_thread_unlock_mutex(&loader_lock); +} + +static VKAPI_ATTR void VKAPI_CALL debug_utils_DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, + VkDebugReportObjectTypeEXT objType, uint64_t object, + size_t location, int32_t msgCode, const char *pLayerPrefix, + const char *pMsg) { + struct loader_instance *inst = loader_get_instance(instance); + + inst->disp->layer_inst_disp.DebugReportMessageEXT(instance, flags, objType, object, location, msgCode, pLayerPrefix, pMsg); +} + +// This is the instance chain terminator function +// for CreateDebugReportCallback +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallbackEXT(VkInstance instance, + const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDebugReportCallbackEXT *pCallback) { + VkDebugReportCallbackEXT *icd_info = NULL; + const struct loader_icd_term *icd_term; + struct loader_instance *inst = (struct loader_instance *)instance; + VkResult res = VK_SUCCESS; + uint32_t storage_idx; + VkLayerDbgFunctionNode *pNewDbgFuncNode = NULL; + +#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) + { +#else + if (pAllocator != NULL) { + icd_info = ((VkDebugReportCallbackEXT *)pAllocator->pfnAllocation(pAllocator->pUserData, + inst->total_icd_count * sizeof(VkDebugReportCallbackEXT), + sizeof(void *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); + if (icd_info) { + memset(icd_info, 0, inst->total_icd_count * sizeof(VkDebugReportCallbackEXT)); + } + } else { +#endif + icd_info = calloc(sizeof(VkDebugReportCallbackEXT), inst->total_icd_count); + } + if (!icd_info) { + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + + storage_idx = 0; + for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { + if (!icd_term->dispatch.CreateDebugReportCallbackEXT) { + continue; + } + + res = icd_term->dispatch.CreateDebugReportCallbackEXT(icd_term->instance, pCreateInfo, pAllocator, &icd_info[storage_idx]); + + if (res != VK_SUCCESS) { + goto out; + } + storage_idx++; + } + +// Setup the debug report callback in the terminator since a layer may want +// to grab the information itself (RenderDoc) and then return back to the +// user callback a sub-set of the messages. +#if (DEBUG_DISABLE_APP_ALLOCATORS == 0) + if (pAllocator != NULL) { + pNewDbgFuncNode = (VkLayerDbgFunctionNode *)pAllocator->pfnAllocation(pAllocator->pUserData, sizeof(VkLayerDbgFunctionNode), + sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + } else { +#else + { +#endif + pNewDbgFuncNode = (VkLayerDbgFunctionNode *)loader_instance_heap_alloc(inst, sizeof(VkLayerDbgFunctionNode), + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + } + if (!pNewDbgFuncNode) { + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + memset(pNewDbgFuncNode, 0, sizeof(VkLayerDbgFunctionNode)); + + pNewDbgFuncNode->is_messenger = false; + pNewDbgFuncNode->report.pfnMsgCallback = pCreateInfo->pfnCallback; + pNewDbgFuncNode->report.msgFlags = pCreateInfo->flags; + pNewDbgFuncNode->pUserData = pCreateInfo->pUserData; + pNewDbgFuncNode->pNext = inst->DbgFunctionHead; + inst->DbgFunctionHead = pNewDbgFuncNode; + + *(VkDebugReportCallbackEXT **)pCallback = icd_info; + pNewDbgFuncNode->report.msgCallback = *pCallback; + +out: + + // Roll back on errors + if (VK_SUCCESS != res) { + storage_idx = 0; + for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { + if (NULL == icd_term->dispatch.DestroyDebugReportCallbackEXT) { + continue; + } + + if (icd_info && icd_info[storage_idx]) { + icd_term->dispatch.DestroyDebugReportCallbackEXT(icd_term->instance, icd_info[storage_idx], pAllocator); + } + storage_idx++; + } + +#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) + { +#else + if (pAllocator != NULL) { + if (NULL != pNewDbgFuncNode) { + pAllocator->pfnFree(pAllocator->pUserData, pNewDbgFuncNode); + } + if (NULL != icd_info) { + pAllocator->pfnFree(pAllocator->pUserData, icd_info); + } + } else { +#endif + if (NULL != pNewDbgFuncNode) { + free(pNewDbgFuncNode); + } + if (NULL != icd_info) { + free(icd_info); + } + } + } + + return res; +} + +// This is the instance chain terminator function for DestroyDebugReportCallback +VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, + const VkAllocationCallbacks *pAllocator) { + uint32_t storage_idx; + VkDebugReportCallbackEXT *icd_info; + const struct loader_icd_term *icd_term; + + struct loader_instance *inst = (struct loader_instance *)instance; + icd_info = *(VkDebugReportCallbackEXT **)&callback; + storage_idx = 0; + for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { + if (NULL == icd_term->dispatch.DestroyDebugReportCallbackEXT) { + continue; + } + + if (icd_info[storage_idx]) { + icd_term->dispatch.DestroyDebugReportCallbackEXT(icd_term->instance, icd_info[storage_idx], pAllocator); + } + storage_idx++; + } + +#if (DEBUG_DISABLE_APP_ALLOCATORS == 1) + { +#else + if (pAllocator != NULL) { + pAllocator->pfnFree(pAllocator->pUserData, icd_info); + } else { +#endif + free(icd_info); + } +} + +// This is the instance chain terminator function for DebugReportMessage +VKAPI_ATTR void VKAPI_CALL terminator_DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, + VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, + int32_t msgCode, const char *pLayerPrefix, const char *pMsg) { + const struct loader_icd_term *icd_term; + + struct loader_instance *inst = (struct loader_instance *)instance; + + loader_platform_thread_lock_mutex(&loader_lock); + for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { + if (icd_term->dispatch.DebugReportMessageEXT != NULL) { + icd_term->dispatch.DebugReportMessageEXT(icd_term->instance, flags, objType, object, location, msgCode, pLayerPrefix, + pMsg); + } + } + + // Now that all ICDs have seen the message, call the necessary callbacks. Ignoring "bail" return value + // as there is nothing to bail from at this point. + + util_DebugReportMessage(inst, flags, objType, object, location, msgCode, pLayerPrefix, pMsg); + + loader_platform_thread_unlock_mutex(&loader_lock); +} + +// General utilities + +static const VkExtensionProperties debug_utils_extension_info[] = { + {VK_EXT_DEBUG_REPORT_EXTENSION_NAME, VK_EXT_DEBUG_REPORT_SPEC_VERSION}, + {VK_EXT_DEBUG_UTILS_EXTENSION_NAME, VK_EXT_DEBUG_UTILS_SPEC_VERSION}, +}; + +void debug_utils_AddInstanceExtensions(const struct loader_instance *inst, struct loader_extension_list *ext_list) { + loader_add_to_ext_list(inst, ext_list, sizeof(debug_utils_extension_info) / sizeof(VkExtensionProperties), + debug_utils_extension_info); +} + +void debug_utils_CreateInstance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo) { + ptr_instance->enabled_known_extensions.ext_debug_report = 0; + ptr_instance->enabled_known_extensions.ext_debug_utils = 0; + + for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DEBUG_REPORT_EXTENSION_NAME) == 0) { + ptr_instance->enabled_known_extensions.ext_debug_report = 1; + } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DEBUG_UTILS_EXTENSION_NAME) == 0) { + ptr_instance->enabled_known_extensions.ext_debug_utils = 1; + } + } +} + +bool debug_utils_InstanceGpa(struct loader_instance *ptr_instance, const char *name, void **addr) { + bool ret_type = false; + + *addr = NULL; + + if (!strcmp("vkCreateDebugReportCallbackEXT", name)) { + *addr = ptr_instance->enabled_known_extensions.ext_debug_report == 1 ? (void *)debug_utils_CreateDebugReportCallbackEXT : NULL; + ret_type = true; + } else if (!strcmp("vkDestroyDebugReportCallbackEXT", name)) { + *addr = ptr_instance->enabled_known_extensions.ext_debug_report == 1 ? (void *)debug_utils_DestroyDebugReportCallbackEXT : NULL; + ret_type = true; + } else if (!strcmp("vkDebugReportMessageEXT", name)) { + *addr = ptr_instance->enabled_known_extensions.ext_debug_report == 1 ? (void *)debug_utils_DebugReportMessageEXT : NULL; + return true; + } + if (!strcmp("vkCreateDebugUtilsMessengerEXT", name)) { + *addr = ptr_instance->enabled_known_extensions.ext_debug_utils == 1 ? (void *)debug_utils_CreateDebugUtilsMessengerEXT : NULL; + ret_type = true; + } else if (!strcmp("vkDestroyDebugUtilsMessengerEXT", name)) { + *addr = ptr_instance->enabled_known_extensions.ext_debug_utils == 1 ? (void *)debug_utils_DestroyDebugUtilsMessengerEXT : NULL; + ret_type = true; + } else if (!strcmp("vkSubmitDebugUtilsMessageEXT", name)) { + *addr = ptr_instance->enabled_known_extensions.ext_debug_utils == 1 ? (void *)debug_utils_SubmitDebugUtilsMessageEXT : NULL; + ret_type = true; + } + + return ret_type; +} + +bool debug_utils_ReportFlagsToAnnotFlags(VkDebugReportFlagsEXT dr_flags, bool default_flag_is_spec, + VkDebugUtilsMessageSeverityFlagBitsEXT *da_severity, + VkDebugUtilsMessageTypeFlagsEXT *da_type) { + bool type_set = false; + if (NULL == da_severity || NULL == da_type) { + return false; + } + *da_type = 0; + + if ((dr_flags & VK_DEBUG_REPORT_INFORMATION_BIT_EXT) != 0) { + *da_severity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT; + *da_type |= VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT; + type_set = true; + } else if ((dr_flags & (VK_DEBUG_REPORT_WARNING_BIT_EXT | VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT)) != 0) { + *da_severity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT; + } else if ((dr_flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) != 0) { + *da_severity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT; + } else if ((dr_flags & VK_DEBUG_REPORT_DEBUG_BIT_EXT) != 0) { + *da_severity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT; + *da_type |= VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT; + type_set = true; + } + + if ((dr_flags & VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT) != 0) { + *da_type |= VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT; + } else if (!type_set) { + if (default_flag_is_spec) { + *da_type |= VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT; + } else { + *da_type |= VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT; + } + } + + return true; +} + +bool debug_utils_AnnotFlagsToReportFlags(VkDebugUtilsMessageSeverityFlagBitsEXT da_severity, + VkDebugUtilsMessageTypeFlagsEXT da_type, VkDebugReportFlagsEXT *dr_flags) { + if (NULL == dr_flags) { + return false; + } + + *dr_flags = 0; + + if ((da_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) != 0) { + *dr_flags |= VK_DEBUG_REPORT_ERROR_BIT_EXT; + } else if ((da_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) != 0) { + if ((da_type & VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT) != 0) { + *dr_flags |= VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT; + } else { + *dr_flags |= VK_DEBUG_REPORT_WARNING_BIT_EXT; + } + } else if ((da_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT) != 0) { + *dr_flags |= VK_DEBUG_REPORT_INFORMATION_BIT_EXT; + } else if ((da_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT) != 0) { + *dr_flags |= VK_DEBUG_REPORT_DEBUG_BIT_EXT; + } + + return true; +} + +bool debug_utils_ReportObjectToAnnotObject(VkDebugReportObjectTypeEXT dr_object_type, uint64_t object_handle, + VkDebugUtilsObjectNameInfoEXT *da_object_name_info) { + if (NULL == da_object_name_info) { + return false; + } + da_object_name_info->sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT; + da_object_name_info->pNext = NULL; + da_object_name_info->objectHandle = (uint64_t)(uintptr_t)object_handle; + da_object_name_info->pObjectName = NULL; + da_object_name_info->objectType = convertDebugReportObjectToCoreObject(dr_object_type); + return true; +} + +bool debug_utils_AnnotObjectToDebugReportObject(const VkDebugUtilsObjectNameInfoEXT *da_object_name_info, + VkDebugReportObjectTypeEXT *dr_object_type, uint64_t *dr_object_handle) { + if (NULL == da_object_name_info || NULL == dr_object_type || NULL == dr_object_handle) { + return false; + } + *dr_object_type = convertCoreObjectToDebugReportObject(da_object_name_info->objectType); + *dr_object_handle = da_object_name_info->objectHandle; + return true; +} diff -Nru vulkan-1.0.65.2+dfsg1/loader/debug_utils.h vulkan-1.1.73+dfsg/loader/debug_utils.h --- vulkan-1.0.65.2+dfsg1/loader/debug_utils.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/debug_utils.h 2018-03-14 09:08:48.000000000 +0000 @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2015-2017 The Khronos Group Inc. + * Copyright (c) 2015-2017 Valve Corporation + * Copyright (c) 2015-2017 LunarG, Inc. + * Copyright (C) 2015-2016 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Courtney Goeltzenleuchter + * Author: Jon Ashburn + * Author: Mark Young + * + */ + +#include "vk_loader_platform.h" +#include "loader.h" + +// General utilities + +void debug_utils_AddInstanceExtensions(const struct loader_instance *inst, struct loader_extension_list *ext_list); +void debug_utils_CreateInstance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo); +bool debug_utils_InstanceGpa(struct loader_instance *ptr_instance, const char *name, void **addr); +bool debug_utils_ReportFlagsToAnnotFlags(VkDebugReportFlagsEXT dr_flags, bool default_flag_is_spec, + VkDebugUtilsMessageSeverityFlagBitsEXT *da_severity, + VkDebugUtilsMessageTypeFlagsEXT *da_type); +bool debug_utils_AnnotFlagsToReportFlags(VkDebugUtilsMessageSeverityFlagBitsEXT da_severity, + VkDebugUtilsMessageTypeFlagsEXT da_type, VkDebugReportFlagsEXT *dr_flags); +bool debug_utils_ReportObjectToAnnotObject(VkDebugReportObjectTypeEXT dr_object_type, uint64_t object_handle, + VkDebugUtilsObjectNameInfoEXT *da_object_name_info); +bool debug_utils_AnnotObjectToDebugReportObject(const VkDebugUtilsObjectNameInfoEXT *da_object_name_info, + VkDebugReportObjectTypeEXT *dr_object_type, uint64_t *dr_object_handle); + +// VK_EXT_debug_utils related items + +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugUtilsMessengerEXT(VkInstance instance, + const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDebugUtilsMessengerEXT *pMessenger); +VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, + const VkAllocationCallbacks *pAllocator); +VKAPI_ATTR void VKAPI_CALL terminator_SubmitDebugUtilsMessageEXT(VkInstance instance, + VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, + VkDebugUtilsMessageTypeFlagsEXT messageTypes, + const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData); +VkResult util_CreateDebugUtilsMessenger(struct loader_instance *inst, const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerEXT messenger); +VkResult util_CreateDebugUtilsMessengers(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, + uint32_t num_messengers, VkDebugUtilsMessengerCreateInfoEXT *infos, + VkDebugUtilsMessengerEXT *messengers); +VkBool32 util_SubmitDebugUtilsMessageEXT(const struct loader_instance *inst, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, + VkDebugUtilsMessageTypeFlagsEXT messageTypes, + const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData); +VkResult util_CopyDebugUtilsMessengerCreateInfos(const void *pChain, const VkAllocationCallbacks *pAllocator, + uint32_t *num_messengers, VkDebugUtilsMessengerCreateInfoEXT **infos, + VkDebugUtilsMessengerEXT **messengers); +void util_DestroyDebugUtilsMessenger(struct loader_instance *inst, VkDebugUtilsMessengerEXT messenger, + const VkAllocationCallbacks *pAllocator); +void util_DestroyDebugUtilsMessengers(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, + uint32_t num_messengers, VkDebugUtilsMessengerEXT *messengers); +void util_FreeDebugUtilsMessengerCreateInfos(const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerCreateInfoEXT *infos, + VkDebugUtilsMessengerEXT *messengers); + +// VK_EXT_debug_report related items + +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallbackEXT(VkInstance instance, + const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDebugReportCallbackEXT *pCallback); + +VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, + const VkAllocationCallbacks *pAllocator); + +VKAPI_ATTR void VKAPI_CALL terminator_DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, + VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, + int32_t msgCode, const char *pLayerPrefix, const char *pMsg); + +VkResult util_CreateDebugReportCallback(struct loader_instance *inst, VkDebugReportCallbackCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT callback); +VkResult util_CreateDebugReportCallbacks(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, + uint32_t num_callbacks, VkDebugReportCallbackCreateInfoEXT *infos, + VkDebugReportCallbackEXT *callbacks); +VkBool32 util_DebugReportMessage(const struct loader_instance *inst, VkFlags msgFlags, VkDebugReportObjectTypeEXT objectType, + uint64_t srcObject, size_t location, int32_t msgCode, const char *pLayerPrefix, const char *pMsg); +VkResult util_CopyDebugReportCreateInfos(const void *pChain, const VkAllocationCallbacks *pAllocator, uint32_t *num_callbacks, + VkDebugReportCallbackCreateInfoEXT **infos, VkDebugReportCallbackEXT **callbacks); +void util_DestroyDebugReportCallback(struct loader_instance *inst, VkDebugReportCallbackEXT callback, + const VkAllocationCallbacks *pAllocator); +void util_DestroyDebugReportCallbacks(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, uint32_t num_callbacks, + VkDebugReportCallbackEXT *callbacks); +void util_FreeDebugReportCreateInfos(const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackCreateInfoEXT *infos, + VkDebugReportCallbackEXT *callbacks); diff -Nru vulkan-1.0.65.2+dfsg1/loader/extension_manual.c vulkan-1.1.73+dfsg/loader/extension_manual.c --- vulkan-1.0.65.2+dfsg1/loader/extension_manual.c 2017-07-31 13:57:12.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/extension_manual.c 2018-03-14 09:08:48.000000000 +0000 @@ -28,104 +28,72 @@ #include "vk_loader_extensions.h" #include #include "wsi.h" -#include "debug_report.h" +#include "debug_utils.h" // ---- Manually added trampoline/terminator functions // These functions, for whatever reason, require more complex changes than // can easily be automatically generated. -VkResult setupLoaderTrampPhysDevGroups(VkInstance instance); -VkResult setupLoaderTermPhysDevGroups(struct loader_instance *inst); -// ---- VK_KHX_device_group extension trampoline/terminators +// ---- VK_KHR_device_group extension trampoline/terminators -VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroupsKHX( - VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, - VkPhysicalDeviceGroupPropertiesKHX *pPhysicalDeviceGroupProperties) { - VkResult res = VK_SUCCESS; - uint32_t count; - uint32_t i; - struct loader_instance *inst = NULL; - - loader_platform_thread_lock_mutex(&loader_lock); - - inst = loader_get_instance(instance); - if (NULL == inst) { - res = VK_ERROR_INITIALIZATION_FAILED; - goto out; - } - - if (NULL == pPhysicalDeviceGroupCount) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "vkEnumeratePhysicalDeviceGroupsKHX: Received NULL pointer for physical " - "device group count return value."); - res = VK_ERROR_INITIALIZATION_FAILED; - goto out; - } +VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, + VkSurfaceCapabilities2KHR *pSurfaceCapabilities) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + return disp->GetPhysicalDeviceSurfaceCapabilities2KHR(unwrapped_phys_dev, pSurfaceInfo, pSurfaceCapabilities); +} - VkResult setup_res = setupLoaderTrampPhysDevGroups(instance); - if (VK_SUCCESS != setup_res) { - res = setup_res; - goto out; - } +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilities2KHR( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, + VkSurfaceCapabilities2KHR *pSurfaceCapabilities) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - count = inst->phys_dev_group_count_tramp; + VkIcdSurface *icd_surface = (VkIcdSurface *)(pSurfaceInfo->surface); + uint8_t icd_index = phys_dev_term->icd_index; - // Wrap the PhysDev object for loader usage, return wrapped objects - if (NULL != pPhysicalDeviceGroupProperties) { - if (inst->phys_dev_group_count_tramp > *pPhysicalDeviceGroupCount) { - loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "vkEnumeratePhysicalDeviceGroupsKHX: Trimming device group count down" - " by application request from %d to %d physical device groups", - inst->phys_dev_group_count_tramp, *pPhysicalDeviceGroupCount); - count = *pPhysicalDeviceGroupCount; - res = VK_INCOMPLETE; - } - for (i = 0; i < count; i++) { - memcpy(&pPhysicalDeviceGroupProperties[i], inst->phys_dev_groups_tramp[i], - sizeof(VkPhysicalDeviceGroupPropertiesKHX)); + if (icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2KHR != NULL) { + // Pass the call to the driver, possibly unwrapping the ICD surface + if (icd_surface->real_icd_surfaces != NULL && (void *)icd_surface->real_icd_surfaces[icd_index] != NULL) { + VkPhysicalDeviceSurfaceInfo2KHR info_copy = *pSurfaceInfo; + info_copy.surface = icd_surface->real_icd_surfaces[icd_index]; + return icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2KHR(phys_dev_term->phys_dev, &info_copy, + pSurfaceCapabilities); + } else { + return icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2KHR(phys_dev_term->phys_dev, pSurfaceInfo, + pSurfaceCapabilities); } - } - - *pPhysicalDeviceGroupCount = count; - -out: - - loader_platform_thread_unlock_mutex(&loader_lock); - return res; -} + } else { + // Emulate the call + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "vkGetPhysicalDeviceSurfaceCapabilities2KHR: Emulating call in ICD \"%s\" using " + "vkGetPhysicalDeviceSurfaceCapabilitiesKHR", + icd_term->scanned_icd->lib_name); -VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDeviceGroupsKHX( - VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, - VkPhysicalDeviceGroupPropertiesKHX *pPhysicalDeviceGroupProperties) { - struct loader_instance *inst = (struct loader_instance *)instance; - VkResult res = VK_SUCCESS; - - // Always call the setup loader terminator physical device groups because they may - // have changed at any point. - res = setupLoaderTermPhysDevGroups(inst); - if (VK_SUCCESS != res) { - goto out; - } + if (pSurfaceInfo->pNext != NULL) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceSurfaceCapabilities2KHR: Emulation found unrecognized structure type in " + "pSurfaceInfo->pNext - this struct will be ignored"); + } - uint32_t copy_count = inst->phys_dev_group_count_term; - if (NULL != pPhysicalDeviceGroupProperties) { - if (copy_count > *pPhysicalDeviceGroupCount) { - copy_count = *pPhysicalDeviceGroupCount; - res = VK_INCOMPLETE; + // Write to the VkSurfaceCapabilities2KHR struct + VkSurfaceKHR surface = pSurfaceInfo->surface; + if (icd_surface->real_icd_surfaces != NULL && (void *)icd_surface->real_icd_surfaces[icd_index] != NULL) { + surface = icd_surface->real_icd_surfaces[icd_index]; } + VkResult res = icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilitiesKHR(phys_dev_term->phys_dev, surface, + &pSurfaceCapabilities->surfaceCapabilities); - for (uint32_t i = 0; i < copy_count; i++) { - memcpy(&pPhysicalDeviceGroupProperties[i], inst->phys_dev_groups_term[i], - sizeof(VkPhysicalDeviceGroupPropertiesKHX)); + if (pSurfaceCapabilities->pNext != NULL) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceSurfaceCapabilities2KHR: Emulation found unrecognized structure type in " + "pSurfaceCapabilities->pNext - this struct will be ignored"); } + return res; } - - *pPhysicalDeviceGroupCount = copy_count; - -out: - - return res; } // ---- VK_NV_external_memory_capabilities extension trampoline/terminators @@ -178,410 +146,6 @@ externalHandleType, pExternalImageFormatProperties); } -// ---- VK_KHR_get_physical_device_properties2 extension trampoline/terminators - -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2KHR *pFeatures) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceFeatures2KHR(unwrapped_phys_dev, pFeatures); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceFeatures2KHR *pFeatures) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - - if (icd_term->dispatch.GetPhysicalDeviceFeatures2KHR != NULL) { - // Pass the call to the driver - icd_term->dispatch.GetPhysicalDeviceFeatures2KHR(phys_dev_term->phys_dev, pFeatures); - } else { - // Emulate the call - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "vkGetPhysicalDeviceFeatures2KHR: Emulating call in ICD \"%s\" using vkGetPhysicalDeviceFeatures", - icd_term->scanned_icd->lib_name); - - // Write to the VkPhysicalDeviceFeatures2KHR struct - icd_term->dispatch.GetPhysicalDeviceFeatures(phys_dev_term->phys_dev, &pFeatures->features); - - void *pNext = pFeatures->pNext; - while (pNext != NULL) { - switch (*(VkStructureType *)pNext) { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHX: { - // Skip the check if VK_KHX_multiview is enabled because it's a device extension - // Write to the VkPhysicalDeviceMultiviewFeaturesKHX struct - VkPhysicalDeviceMultiviewFeaturesKHX *multiview_features = pNext; - multiview_features->multiview = VK_FALSE; - multiview_features->multiviewGeometryShader = VK_FALSE; - multiview_features->multiviewTessellationShader = VK_FALSE; - - pNext = multiview_features->pNext; - break; - } - default: { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceFeatures2KHR: Emulation found unrecognized structure type in pFeatures->pNext - " - "this struct will be ignored"); - - struct VkStructureHeader *header = pNext; - pNext = (void *)header->pNext; - break; - } - } - } - } -} - -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceProperties2KHR *pProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceProperties2KHR(unwrapped_phys_dev, pProperties); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceProperties2KHR *pProperties) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - - if (icd_term->dispatch.GetPhysicalDeviceProperties2KHR != NULL) { - // Pass the call to the driver - icd_term->dispatch.GetPhysicalDeviceProperties2KHR(phys_dev_term->phys_dev, pProperties); - } else { - // Emulate the call - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "vkGetPhysicalDeviceProperties2KHR: Emulating call in ICD \"%s\" using vkGetPhysicalDeviceProperties", - icd_term->scanned_icd->lib_name); - - // Write to the VkPhysicalDeviceProperties2KHR struct - icd_term->dispatch.GetPhysicalDeviceProperties(phys_dev_term->phys_dev, &pProperties->properties); - - void *pNext = pProperties->pNext; - while (pNext != NULL) { - switch (*(VkStructureType *)pNext) { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR: { - VkPhysicalDeviceIDPropertiesKHR *id_properties = pNext; - - // Verify that "VK_KHR_external_memory_capabilities" is enabled - if (icd_term->this_instance->enabled_known_extensions.khr_external_memory_capabilities) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceProperties2KHR: Emulation cannot generate unique IDs for struct " - "VkPhysicalDeviceIDPropertiesKHR - setting IDs to zero instead"); - - // Write to the VkPhysicalDeviceIDPropertiesKHR struct - memset(id_properties->deviceUUID, 0, VK_UUID_SIZE); - memset(id_properties->driverUUID, 0, VK_UUID_SIZE); - id_properties->deviceLUIDValid = VK_FALSE; - } - - pNext = id_properties->pNext; - break; - } - default: { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceProperties2KHR: Emulation found unrecognized structure type in " - "pProperties->pNext - this struct will be ignored"); - - struct VkStructureHeader *header = pNext; - pNext = (void *)header->pNext; - break; - } - } - } - } -} - -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, - VkFormatProperties2KHR *pFormatProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceFormatProperties2KHR(unwrapped_phys_dev, format, pFormatProperties); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, - VkFormatProperties2KHR *pFormatProperties) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - - if (icd_term->dispatch.GetPhysicalDeviceFormatProperties2KHR != NULL) { - // Pass the call to the driver - icd_term->dispatch.GetPhysicalDeviceFormatProperties2KHR(phys_dev_term->phys_dev, format, pFormatProperties); - } else { - // Emulate the call - loader_log( - icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "vkGetPhysicalDeviceFormatProperties2KHR: Emulating call in ICD \"%s\" using vkGetPhysicalDeviceFormatProperties", - icd_term->scanned_icd->lib_name); - - // Write to the VkFormatProperties2KHR struct - icd_term->dispatch.GetPhysicalDeviceFormatProperties(phys_dev_term->phys_dev, format, &pFormatProperties->formatProperties); - - if (pFormatProperties->pNext != NULL) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceFormatProperties2KHR: Emulation found unrecognized structure type in " - "pFormatProperties->pNext - this struct will be ignored"); - } - } -} - -VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR *pImageFormatInfo, - VkImageFormatProperties2KHR *pImageFormatProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - return disp->GetPhysicalDeviceImageFormatProperties2KHR(unwrapped_phys_dev, pImageFormatInfo, pImageFormatProperties); -} - -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR *pImageFormatInfo, - VkImageFormatProperties2KHR *pImageFormatProperties) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - - if (icd_term->dispatch.GetPhysicalDeviceImageFormatProperties2KHR != NULL) { - // Pass the call to the driver - return icd_term->dispatch.GetPhysicalDeviceImageFormatProperties2KHR(phys_dev_term->phys_dev, pImageFormatInfo, - pImageFormatProperties); - } else { - // Emulate the call - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "vkGetPhysicalDeviceImageFormatProperties2KHR: Emulating call in ICD \"%s\" using " - "vkGetPhysicalDeviceImageFormatProperties", - icd_term->scanned_icd->lib_name); - - // If there is more info in either pNext, then this is unsupported - if (pImageFormatInfo->pNext != NULL || pImageFormatProperties->pNext != NULL) { - return VK_ERROR_FORMAT_NOT_SUPPORTED; - } - - // Write to the VkImageFormatProperties2KHR struct - return icd_term->dispatch.GetPhysicalDeviceImageFormatProperties( - phys_dev_term->phys_dev, pImageFormatInfo->format, pImageFormatInfo->type, pImageFormatInfo->tiling, - pImageFormatInfo->usage, pImageFormatInfo->flags, &pImageFormatProperties->imageFormatProperties); - } -} - -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, - uint32_t *pQueueFamilyPropertyCount, - VkQueueFamilyProperties2KHR *pQueueFamilyProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceQueueFamilyProperties2KHR(unwrapped_phys_dev, pQueueFamilyPropertyCount, pQueueFamilyProperties); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties2KHR( - VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties2KHR *pQueueFamilyProperties) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - - if (icd_term->dispatch.GetPhysicalDeviceQueueFamilyProperties2KHR != NULL) { - // Pass the call to the driver - icd_term->dispatch.GetPhysicalDeviceQueueFamilyProperties2KHR(phys_dev_term->phys_dev, pQueueFamilyPropertyCount, - pQueueFamilyProperties); - } else { - // Emulate the call - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "vkGetPhysicalDeviceQueueFamilyProperties2KHR: Emulating call in ICD \"%s\" using " - "vkGetPhysicalDeviceQueueFamilyProperties", - icd_term->scanned_icd->lib_name); - - if (pQueueFamilyProperties == NULL || *pQueueFamilyPropertyCount == 0) { - // Write to pQueueFamilyPropertyCount - icd_term->dispatch.GetPhysicalDeviceQueueFamilyProperties(phys_dev_term->phys_dev, pQueueFamilyPropertyCount, NULL); - } else { - // Allocate a temporary array for the output of the old function - VkQueueFamilyProperties *properties = loader_stack_alloc(*pQueueFamilyPropertyCount * sizeof(VkQueueFamilyProperties)); - if (properties == NULL) { - *pQueueFamilyPropertyCount = 0; - loader_log( - icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "vkGetPhysicalDeviceQueueFamilyProperties2KHR: Out of memory - Failed to allocate array for loader emulation."); - return; - } - - icd_term->dispatch.GetPhysicalDeviceQueueFamilyProperties(phys_dev_term->phys_dev, pQueueFamilyPropertyCount, - properties); - for (uint32_t i = 0; i < *pQueueFamilyPropertyCount; ++i) { - // Write to the VkQueueFamilyProperties2KHR struct - memcpy(&pQueueFamilyProperties[i].queueFamilyProperties, &properties[i], sizeof(VkQueueFamilyProperties)); - - if (pQueueFamilyProperties[i].pNext != NULL) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceQueueFamilyProperties2KHR: Emulation found unrecognized structure type in " - "pQueueFamilyProperties[%d].pNext - this struct will be ignored", - i); - } - } - } - } -} - -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceMemoryProperties2KHR *pMemoryProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceMemoryProperties2KHR(unwrapped_phys_dev, pMemoryProperties); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties2KHR( - VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2KHR *pMemoryProperties) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - - if (icd_term->dispatch.GetPhysicalDeviceMemoryProperties2KHR != NULL) { - // Pass the call to the driver - icd_term->dispatch.GetPhysicalDeviceMemoryProperties2KHR(phys_dev_term->phys_dev, pMemoryProperties); - } else { - // Emulate the call - loader_log( - icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "vkGetPhysicalDeviceMemoryProperties2KHR: Emulating call in ICD \"%s\" using vkGetPhysicalDeviceMemoryProperties", - icd_term->scanned_icd->lib_name); - - // Write to the VkPhysicalDeviceMemoryProperties2KHR struct - icd_term->dispatch.GetPhysicalDeviceMemoryProperties(phys_dev_term->phys_dev, &pMemoryProperties->memoryProperties); - - if (pMemoryProperties->pNext != NULL) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceMemoryProperties2KHR: Emulation found unrecognized structure type in " - "pMemoryProperties->pNext - this struct will be ignored"); - } - } -} - -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, uint32_t *pPropertyCount, - VkSparseImageFormatProperties2KHR *pProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceSparseImageFormatProperties2KHR(unwrapped_phys_dev, pFormatInfo, pPropertyCount, pProperties); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceSparseImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, uint32_t *pPropertyCount, - VkSparseImageFormatProperties2KHR *pProperties) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - - if (icd_term->dispatch.GetPhysicalDeviceSparseImageFormatProperties2KHR != NULL) { - // Pass the call to the driver - icd_term->dispatch.GetPhysicalDeviceSparseImageFormatProperties2KHR(phys_dev_term->phys_dev, pFormatInfo, pPropertyCount, - pProperties); - } else { - // Emulate the call - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "vkGetPhysicalDeviceSparseImageFormatProperties2KHR: Emulating call in ICD \"%s\" using " - "vkGetPhysicalDeviceSparseImageFormatProperties", - icd_term->scanned_icd->lib_name); - - if (pFormatInfo->pNext != NULL) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceSparseImageFormatProperties2KHR: Emulation found unrecognized structure type in " - "pFormatInfo->pNext - this struct will be ignored"); - } - - if (pProperties == NULL || *pPropertyCount == 0) { - // Write to pPropertyCount - icd_term->dispatch.GetPhysicalDeviceSparseImageFormatProperties( - phys_dev_term->phys_dev, pFormatInfo->format, pFormatInfo->type, pFormatInfo->samples, pFormatInfo->usage, - pFormatInfo->tiling, pPropertyCount, NULL); - } else { - // Allocate a temporary array for the output of the old function - VkSparseImageFormatProperties *properties = - loader_stack_alloc(*pPropertyCount * sizeof(VkSparseImageMemoryRequirements)); - if (properties == NULL) { - *pPropertyCount = 0; - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "vkGetPhysicalDeviceSparseImageFormatProperties2KHR: Out of memory - Failed to allocate array for " - "loader emulation."); - return; - } - - icd_term->dispatch.GetPhysicalDeviceSparseImageFormatProperties( - phys_dev_term->phys_dev, pFormatInfo->format, pFormatInfo->type, pFormatInfo->samples, pFormatInfo->usage, - pFormatInfo->tiling, pPropertyCount, properties); - for (uint32_t i = 0; i < *pPropertyCount; ++i) { - // Write to the VkSparseImageFormatProperties2KHR struct - memcpy(&pProperties[i].properties, &properties[i], sizeof(VkSparseImageFormatProperties)); - - if (pProperties[i].pNext != NULL) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceSparseImageFormatProperties2KHR: Emulation found unrecognized structure type in " - "pProperties[%d].pNext - this struct will be ignored", - i); - } - } - } - } -} - -// ---- VK_KHR_get_surface_capabilities2 extension trampoline/terminators - -VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, - VkSurfaceCapabilities2KHR *pSurfaceCapabilities) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - return disp->GetPhysicalDeviceSurfaceCapabilities2KHR(unwrapped_phys_dev, pSurfaceInfo, pSurfaceCapabilities); -} - -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilities2KHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, - VkSurfaceCapabilities2KHR *pSurfaceCapabilities) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - - VkIcdSurface *icd_surface = (VkIcdSurface *)(pSurfaceInfo->surface); - uint8_t icd_index = phys_dev_term->icd_index; - - if (icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2KHR != NULL) { - // Pass the call to the driver, possibly unwrapping the ICD surface - if (icd_surface->real_icd_surfaces != NULL && (void *)icd_surface->real_icd_surfaces[icd_index] != NULL) { - VkPhysicalDeviceSurfaceInfo2KHR info_copy = *pSurfaceInfo; - info_copy.surface = icd_surface->real_icd_surfaces[icd_index]; - return icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2KHR(phys_dev_term->phys_dev, &info_copy, - pSurfaceCapabilities); - } else { - return icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2KHR(phys_dev_term->phys_dev, pSurfaceInfo, - pSurfaceCapabilities); - } - } else { - // Emulate the call - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "vkGetPhysicalDeviceSurfaceCapabilities2KHR: Emulating call in ICD \"%s\" using " - "vkGetPhysicalDeviceSurfaceCapabilitiesKHR", - icd_term->scanned_icd->lib_name); - - if (pSurfaceInfo->pNext != NULL) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceSurfaceCapabilities2KHR: Emulation found unrecognized structure type in " - "pSurfaceInfo->pNext - this struct will be ignored"); - } - - // Write to the VkSurfaceCapabilities2KHR struct - VkSurfaceKHR surface = pSurfaceInfo->surface; - if (icd_surface->real_icd_surfaces != NULL && (void *)icd_surface->real_icd_surfaces[icd_index] != NULL) { - surface = icd_surface->real_icd_surfaces[icd_index]; - } - VkResult res = icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilitiesKHR(phys_dev_term->phys_dev, surface, - &pSurfaceCapabilities->surfaceCapabilities); - - if (pSurfaceCapabilities->pNext != NULL) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceSurfaceCapabilities2KHR: Emulation found unrecognized structure type in " - "pSurfaceCapabilities->pNext - this struct will be ignored"); - } - return res; - } -} - VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, uint32_t *pSurfaceFormatCount, @@ -796,550 +360,3 @@ } #endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT - -// ---- VK_KHR_external_memory_capabilities extension trampoline/terminators - -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalBufferPropertiesKHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfoKHR *pExternalBufferInfo, - VkExternalBufferPropertiesKHR *pExternalBufferProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceExternalBufferPropertiesKHR(unwrapped_phys_dev, pExternalBufferInfo, pExternalBufferProperties); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceExternalBufferPropertiesKHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfoKHR *pExternalBufferInfo, - VkExternalBufferPropertiesKHR *pExternalBufferProperties) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - - if (icd_term->dispatch.GetPhysicalDeviceExternalBufferPropertiesKHR) { - // Pass the call to the driver - icd_term->dispatch.GetPhysicalDeviceExternalBufferPropertiesKHR(phys_dev_term->phys_dev, pExternalBufferInfo, - pExternalBufferProperties); - } else { - // Emulate the call - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "vkGetPhysicalDeviceExternalBufferPropertiesKHR: Emulating call in ICD \"%s\"", icd_term->scanned_icd->lib_name); - - if (pExternalBufferInfo->pNext != NULL) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceExternalBufferPropertiesKHR: Emulation found unrecognized structure type in " - "pExternalBufferInfo->pNext - this struct will be ignored"); - } - - // Fill in everything being unsupported - memset(&pExternalBufferProperties->externalMemoryProperties, 0, sizeof(VkExternalMemoryPropertiesKHR)); - - if (pExternalBufferProperties->pNext != NULL) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceExternalBufferPropertiesKHR: Emulation found unrecognized structure type in " - "pExternalBufferProperties->pNext - this struct will be ignored"); - } - } -} - -// ---- VK_KHR_external_semaphore_capabilities extension trampoline/terminators - -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalSemaphorePropertiesKHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfoKHR *pExternalSemaphoreInfo, - VkExternalSemaphorePropertiesKHR *pExternalSemaphoreProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceExternalSemaphorePropertiesKHR(unwrapped_phys_dev, pExternalSemaphoreInfo, pExternalSemaphoreProperties); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceExternalSemaphorePropertiesKHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfoKHR *pExternalSemaphoreInfo, - VkExternalSemaphorePropertiesKHR *pExternalSemaphoreProperties) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - - if (icd_term->dispatch.GetPhysicalDeviceExternalSemaphorePropertiesKHR != NULL) { - // Pass the call to the driver - icd_term->dispatch.GetPhysicalDeviceExternalSemaphorePropertiesKHR(phys_dev_term->phys_dev, pExternalSemaphoreInfo, - pExternalSemaphoreProperties); - } else { - // Emulate the call - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR: Emulating call in ICD \"%s\"", - icd_term->scanned_icd->lib_name); - - if (pExternalSemaphoreInfo->pNext != NULL) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR: Emulation found unrecognized structure type in " - "pExternalSemaphoreInfo->pNext - this struct will be ignored"); - } - - // Fill in everything being unsupported - pExternalSemaphoreProperties->exportFromImportedHandleTypes = 0; - pExternalSemaphoreProperties->compatibleHandleTypes = 0; - pExternalSemaphoreProperties->externalSemaphoreFeatures = 0; - - if (pExternalSemaphoreProperties->pNext != NULL) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR: Emulation found unrecognized structure type in " - "pExternalSemaphoreProperties->pNext - this struct will be ignored"); - } - } -} - -// ---- VK_KHR_external_fence_capabilities extension trampoline/terminators - -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalFencePropertiesKHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfoKHR *pExternalFenceInfo, - VkExternalFencePropertiesKHR *pExternalFenceProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceExternalFencePropertiesKHR(unwrapped_phys_dev, pExternalFenceInfo, pExternalFenceProperties); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceExternalFencePropertiesKHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfoKHR *pExternalFenceInfo, - VkExternalFencePropertiesKHR *pExternalFenceProperties) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - - if (icd_term->dispatch.GetPhysicalDeviceExternalFencePropertiesKHR != NULL) { - // Pass the call to the driver - icd_term->dispatch.GetPhysicalDeviceExternalFencePropertiesKHR(phys_dev_term->phys_dev, pExternalFenceInfo, - pExternalFenceProperties); - } else { - // Emulate the call - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "vkGetPhysicalDeviceExternalFencePropertiesKHR: Emulating call in ICD \"%s\"", icd_term->scanned_icd->lib_name); - - if (pExternalFenceInfo->pNext != NULL) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceExternalFencePropertiesKHR: Emulation found unrecognized structure type in " - "pExternalFenceInfo->pNext - this struct will be ignored"); - } - - // Fill in everything being unsupported - pExternalFenceProperties->exportFromImportedHandleTypes = 0; - pExternalFenceProperties->compatibleHandleTypes = 0; - pExternalFenceProperties->externalFenceFeatures = 0; - - if (pExternalFenceProperties->pNext != NULL) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceExternalFencePropertiesKHR: Emulation found unrecognized structure type in " - "pExternalFenceProperties->pNext - this struct will be ignored"); - } - } -} - -// ---- Helper functions - -VkResult setupLoaderTrampPhysDevGroups(VkInstance instance) { - VkResult res = VK_SUCCESS; - struct loader_instance *inst; - uint32_t total_count = 0; - VkPhysicalDeviceGroupPropertiesKHX **new_phys_dev_groups = NULL; - VkPhysicalDeviceGroupPropertiesKHX *local_phys_dev_groups = NULL; - - inst = loader_get_instance(instance); - if (NULL == inst) { - res = VK_ERROR_INITIALIZATION_FAILED; - goto out; - } - - // Setup the trampoline loader physical devices. This will actually - // call down and setup the terminator loader physical devices during the - // process. - VkResult setup_res = setupLoaderTrampPhysDevs(instance); - if (setup_res != VK_SUCCESS && setup_res != VK_INCOMPLETE) { - res = setup_res; - goto out; - } - - // Query how many physical device groups there - res = inst->disp->layer_inst_disp.EnumeratePhysicalDeviceGroupsKHX(instance, &total_count, NULL); - if (res != VK_SUCCESS) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "setupLoaderTrampPhysDevGroups: Failed during dispatch call of " - "\'EnumeratePhysicalDeviceGroupsKHX\' to lower layers or " - "loader to get count."); - goto out; - } - - // Create an array for the new physical device groups, which will be stored - // in the instance for the trampoline code. - new_phys_dev_groups = (VkPhysicalDeviceGroupPropertiesKHX **)loader_instance_heap_alloc( - inst, total_count * sizeof(VkPhysicalDeviceGroupPropertiesKHX *), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); - if (NULL == new_phys_dev_groups) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "setupLoaderTrampPhysDevGroups: Failed to allocate new physical device" - " group array of size %d", - total_count); - res = VK_ERROR_OUT_OF_HOST_MEMORY; - goto out; - } - memset(new_phys_dev_groups, 0, total_count * sizeof(VkPhysicalDeviceGroupPropertiesKHX *)); - - // Create a temporary array (on the stack) to keep track of the - // returned VkPhysicalDevice values. - local_phys_dev_groups = loader_stack_alloc(sizeof(VkPhysicalDeviceGroupPropertiesKHX) * total_count); - if (NULL == local_phys_dev_groups) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "setupLoaderTrampPhysDevGroups: Failed to allocate local " - "physical device group array of size %d", - total_count); - res = VK_ERROR_OUT_OF_HOST_MEMORY; - goto out; - } - // Initialize the memory to something valid - memset(local_phys_dev_groups, 0, sizeof(VkPhysicalDeviceGroupPropertiesKHX) * total_count); - for (uint32_t group = 0; group < total_count; group++) { - local_phys_dev_groups[group].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHX; - local_phys_dev_groups[group].pNext = NULL; - local_phys_dev_groups[group].subsetAllocation = false; - } - - // Call down and get the content - res = inst->disp->layer_inst_disp.EnumeratePhysicalDeviceGroupsKHX(instance, &total_count, local_phys_dev_groups); - if (VK_SUCCESS != res) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "setupLoaderTrampPhysDevGroups: Failed during dispatch call of " - "\'EnumeratePhysicalDeviceGroupsKHX\' to lower layers or " - "loader to get content."); - goto out; - } - - // Replace all the physical device IDs with the proper loader values - for (uint32_t group = 0; group < total_count; group++) { - for (uint32_t group_gpu = 0; group_gpu < local_phys_dev_groups[group].physicalDeviceCount; group_gpu++) { - bool found = false; - for (uint32_t tramp_gpu = 0; tramp_gpu < inst->phys_dev_count_tramp; tramp_gpu++) { - if (local_phys_dev_groups[group].physicalDevices[group_gpu] == inst->phys_devs_tramp[tramp_gpu]->phys_dev) { - local_phys_dev_groups[group].physicalDevices[group_gpu] = (VkPhysicalDevice)inst->phys_devs_tramp[tramp_gpu]; - found = true; - break; - } - } - if (!found) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "setupLoaderTrampPhysDevGroups: Failed to find GPU %d in group %d" - " returned by \'EnumeratePhysicalDeviceGroupsKHX\' in list returned" - " by \'EnumeratePhysicalDevices\'", group_gpu, group); - res = VK_ERROR_INITIALIZATION_FAILED; - goto out; - } - } - } - - // Copy or create everything to fill the new array of physical device groups - for (uint32_t new_idx = 0; new_idx < total_count; new_idx++) { - // Check if this physical device group with the same contents is already in the old buffer - for (uint32_t old_idx = 0; old_idx < inst->phys_dev_group_count_tramp; old_idx++) { - if (local_phys_dev_groups[new_idx].physicalDeviceCount == inst->phys_dev_groups_tramp[old_idx]->physicalDeviceCount) { - bool found_all_gpus = true; - for (uint32_t old_gpu = 0; old_gpu < inst->phys_dev_groups_tramp[old_idx]->physicalDeviceCount; old_gpu++) { - bool found_gpu = false; - for (uint32_t new_gpu = 0; new_gpu < local_phys_dev_groups[new_idx].physicalDeviceCount; new_gpu++) { - if (local_phys_dev_groups[new_idx].physicalDevices[new_gpu] == inst->phys_dev_groups_tramp[old_idx]->physicalDevices[old_gpu]) { - found_gpu = true; - break; - } - } - - if (!found_gpu) { - found_all_gpus = false; - break; - } - } - if (!found_all_gpus) { - continue; - } else { - new_phys_dev_groups[new_idx] = inst->phys_dev_groups_tramp[old_idx]; - break; - } - } - } - - // If this physical device group isn't in the old buffer, create it - if (NULL == new_phys_dev_groups[new_idx]) { - new_phys_dev_groups[new_idx] = (VkPhysicalDeviceGroupPropertiesKHX *)loader_instance_heap_alloc( - inst, sizeof(VkPhysicalDeviceGroupPropertiesKHX), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); - if (NULL == new_phys_dev_groups[new_idx]) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "setupLoaderTrampPhysDevGroups: Failed to allocate " - "physical device group trampoline object %d", - new_idx); - total_count = new_idx; - res = VK_ERROR_OUT_OF_HOST_MEMORY; - goto out; - } - memcpy(new_phys_dev_groups[new_idx], &local_phys_dev_groups[new_idx], - sizeof(VkPhysicalDeviceGroupPropertiesKHX)); - } - } - -out: - - if (VK_SUCCESS != res) { - if (NULL != new_phys_dev_groups) { - for (uint32_t i = 0; i < total_count; i++) { - loader_instance_heap_free(inst, new_phys_dev_groups[i]); - } - loader_instance_heap_free(inst, new_phys_dev_groups); - } - total_count = 0; - } else { - // Free everything that didn't carry over to the new array of - // physical device groups - if (NULL != inst->phys_dev_groups_tramp) { - for (uint32_t i = 0; i < inst->phys_dev_group_count_tramp; i++) { - bool found = false; - for (uint32_t j = 0; j < total_count; j++) { - if (inst->phys_dev_groups_tramp[i] == new_phys_dev_groups[j]) { - found = true; - break; - } - } - if (!found) { - loader_instance_heap_free(inst, inst->phys_dev_groups_tramp[i]); - } - } - loader_instance_heap_free(inst, inst->phys_dev_groups_tramp); - } - - // Swap in the new physical device group list - inst->phys_dev_group_count_tramp = total_count; - inst->phys_dev_groups_tramp = new_phys_dev_groups; - } - - return res; -} - -VkResult setupLoaderTermPhysDevGroups(struct loader_instance *inst) { - VkResult res = VK_SUCCESS; - struct loader_icd_term *icd_term; - uint32_t total_count = 0; - uint32_t cur_icd_group_count = 0; - VkPhysicalDeviceGroupPropertiesKHX **new_phys_dev_groups = NULL; - VkPhysicalDeviceGroupPropertiesKHX *local_phys_dev_groups = NULL; - - if (0 == inst->phys_dev_count_term) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "setupLoaderTermPhysDevGroups: Loader failed to setup physical " - "device terminator info before calling \'EnumeratePhysicalDeviceGroupsKHX\'."); - assert(false); - res = VK_ERROR_INITIALIZATION_FAILED; - goto out; - } - - // For each ICD, query the number of physical device groups, and then get an - // internal value for those physical devices. - icd_term = inst->icd_terms; - for (uint32_t icd_idx = 0; NULL != icd_term; icd_term = icd_term->next, icd_idx++) { - cur_icd_group_count = 0; - if (NULL == icd_term->dispatch.EnumeratePhysicalDeviceGroupsKHX) { - // Treat each ICD's GPU as it's own group if the extension isn't supported - res = icd_term->dispatch.EnumeratePhysicalDevices(icd_term->instance, &cur_icd_group_count, NULL); - if (res != VK_SUCCESS) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "setupLoaderTermPhysDevGroups: Failed during dispatch call of " - "\'EnumeratePhysicalDevices\' to ICD %d to get plain phys dev count.", - icd_idx); - goto out; - } - } else { - // Query the actual group info - res = icd_term->dispatch.EnumeratePhysicalDeviceGroupsKHX(icd_term->instance, &cur_icd_group_count, NULL); - if (res != VK_SUCCESS) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "setupLoaderTermPhysDevGroups: Failed during dispatch call of " - "\'EnumeratePhysicalDeviceGroupsKHX\' to ICD %d to get count.", - icd_idx); - goto out; - } - } - total_count += cur_icd_group_count; - } - - // Create an array for the new physical device groups, which will be stored - // in the instance for the Terminator code. - new_phys_dev_groups = (VkPhysicalDeviceGroupPropertiesKHX **)loader_instance_heap_alloc( - inst, total_count * sizeof(VkPhysicalDeviceGroupPropertiesKHX *), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); - if (NULL == new_phys_dev_groups) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "setupLoaderTermPhysDevGroups: Failed to allocate new physical device" - " group array of size %d", - total_count); - res = VK_ERROR_OUT_OF_HOST_MEMORY; - goto out; - } - memset(new_phys_dev_groups, 0, total_count * sizeof(VkPhysicalDeviceGroupPropertiesKHX *)); - - // Create a temporary array (on the stack) to keep track of the - // returned VkPhysicalDevice values. - local_phys_dev_groups = loader_stack_alloc(sizeof(VkPhysicalDeviceGroupPropertiesKHX) * total_count); - if (NULL == local_phys_dev_groups) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "setupLoaderTermPhysDevGroups: Failed to allocate local " - "physical device group array of size %d", - total_count); - res = VK_ERROR_OUT_OF_HOST_MEMORY; - goto out; - } - // Initialize the memory to something valid - memset(local_phys_dev_groups, 0, sizeof(VkPhysicalDeviceGroupPropertiesKHX) * total_count); - for (uint32_t group = 0; group < total_count; group++) { - local_phys_dev_groups[group].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHX; - local_phys_dev_groups[group].pNext = NULL; - local_phys_dev_groups[group].subsetAllocation = false; - } - - cur_icd_group_count = 0; - icd_term = inst->icd_terms; - for (uint32_t icd_idx = 0; NULL != icd_term; icd_term = icd_term->next, icd_idx++) { - uint32_t count_this_time = total_count - cur_icd_group_count; - - if (NULL == icd_term->dispatch.EnumeratePhysicalDeviceGroupsKHX) { - VkPhysicalDevice* phys_dev_array = loader_stack_alloc(sizeof(VkPhysicalDevice) * count_this_time); - if (NULL == phys_dev_array) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "setupLoaderTermPhysDevGroups: Failed to allocate local " - "physical device array of size %d", - count_this_time); - res = VK_ERROR_OUT_OF_HOST_MEMORY; - goto out; - } - - res = icd_term->dispatch.EnumeratePhysicalDevices(icd_term->instance, &count_this_time, phys_dev_array); - if (res != VK_SUCCESS) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "setupLoaderTermPhysDevGroups: Failed during dispatch call of " - "\'EnumeratePhysicalDevices\' to ICD %d to get plain phys dev count.", - icd_idx); - goto out; - } - - // Add each GPU as it's own group - for (uint32_t indiv_gpu = 0; indiv_gpu < count_this_time; indiv_gpu++) { - local_phys_dev_groups[indiv_gpu + cur_icd_group_count].physicalDeviceCount = 1; - local_phys_dev_groups[indiv_gpu + cur_icd_group_count].physicalDevices[0] = phys_dev_array[indiv_gpu]; - } - - } else { - res = icd_term->dispatch.EnumeratePhysicalDeviceGroupsKHX(icd_term->instance, &count_this_time, &local_phys_dev_groups[cur_icd_group_count]); - if (VK_SUCCESS != res) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "setupLoaderTermPhysDevGroups: Failed during dispatch call of " - "\'EnumeratePhysicalDeviceGroupsKHX\' to ICD %d to get content.", - icd_idx); - goto out; - } - } - - cur_icd_group_count += count_this_time; - } - - // Replace all the physical device IDs with the proper loader values - for (uint32_t group = 0; group < total_count; group++) { - for (uint32_t group_gpu = 0; group_gpu < local_phys_dev_groups[group].physicalDeviceCount; group_gpu++) { - bool found = false; - for (uint32_t term_gpu = 0; term_gpu < inst->phys_dev_count_term; term_gpu++) { - if (local_phys_dev_groups[group].physicalDevices[group_gpu] == inst->phys_devs_term[term_gpu]->phys_dev) { - local_phys_dev_groups[group].physicalDevices[group_gpu] = (VkPhysicalDevice)inst->phys_devs_term[term_gpu]; - found = true; - break; - } - } - if (!found) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "setupLoaderTermPhysDevGroups: Failed to find GPU %d in group %d" - " returned by \'EnumeratePhysicalDeviceGroupsKHX\' in list returned" - " by \'EnumeratePhysicalDevices\'", group_gpu, group); - res = VK_ERROR_INITIALIZATION_FAILED; - goto out; - } - } - } - - // Copy or create everything to fill the new array of physical device groups - for (uint32_t new_idx = 0; new_idx < total_count; new_idx++) { - // Check if this physical device group with the same contents is already in the old buffer - for (uint32_t old_idx = 0; old_idx < inst->phys_dev_group_count_term; old_idx++) { - if (local_phys_dev_groups[new_idx].physicalDeviceCount == inst->phys_dev_groups_term[old_idx]->physicalDeviceCount) { - bool found_all_gpus = true; - for (uint32_t old_gpu = 0; old_gpu < inst->phys_dev_groups_term[old_idx]->physicalDeviceCount; old_gpu++) { - bool found_gpu = false; - for (uint32_t new_gpu = 0; new_gpu < local_phys_dev_groups[new_idx].physicalDeviceCount; new_gpu++) { - if (local_phys_dev_groups[new_idx].physicalDevices[new_gpu] == inst->phys_dev_groups_term[old_idx]->physicalDevices[old_gpu]) { - found_gpu = true; - break; - } - } - - if (!found_gpu) { - found_all_gpus = false; - break; - } - } - if (!found_all_gpus) { - continue; - } else { - new_phys_dev_groups[new_idx] = inst->phys_dev_groups_term[old_idx]; - break; - } - } - } - - // If this physical device group isn't in the old buffer, create it - if (NULL == new_phys_dev_groups[new_idx]) { - new_phys_dev_groups[new_idx] = (VkPhysicalDeviceGroupPropertiesKHX *)loader_instance_heap_alloc( - inst, sizeof(VkPhysicalDeviceGroupPropertiesKHX), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); - if (NULL == new_phys_dev_groups[new_idx]) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "setupLoaderTermPhysDevGroups: Failed to allocate " - "physical device group Terminator object %d", - new_idx); - total_count = new_idx; - res = VK_ERROR_OUT_OF_HOST_MEMORY; - goto out; - } - memcpy(new_phys_dev_groups[new_idx], &local_phys_dev_groups[new_idx], - sizeof(VkPhysicalDeviceGroupPropertiesKHX)); - } - } - -out: - - if (VK_SUCCESS != res) { - if (NULL != new_phys_dev_groups) { - for (uint32_t i = 0; i < total_count; i++) { - loader_instance_heap_free(inst, new_phys_dev_groups[i]); - } - loader_instance_heap_free(inst, new_phys_dev_groups); - } - total_count = 0; - } else { - // Free everything that didn't carry over to the new array of - // physical device groups - if (NULL != inst->phys_dev_groups_term) { - for (uint32_t i = 0; i < inst->phys_dev_group_count_term; i++) { - bool found = false; - for (uint32_t j = 0; j < total_count; j++) { - if (inst->phys_dev_groups_term[i] == new_phys_dev_groups[j]) { - found = true; - break; - } - } - if (!found) { - loader_instance_heap_free(inst, inst->phys_dev_groups_term[i]); - } - } - loader_instance_heap_free(inst, inst->phys_dev_groups_term); - } - - // Swap in the new physical device group list - inst->phys_dev_group_count_term = total_count; - inst->phys_dev_groups_term = new_phys_dev_groups; - } - - return res; -} diff -Nru vulkan-1.0.65.2+dfsg1/loader/extension_manual.h vulkan-1.1.73+dfsg/loader/extension_manual.h --- vulkan-1.0.65.2+dfsg1/loader/extension_manual.h 2017-07-31 13:57:12.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/extension_manual.h 2018-04-27 11:24:19.000000000 +0000 @@ -25,14 +25,6 @@ // These functions, for whatever reason, require more complex changes than // can easily be automatically generated. -VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroupsKHX( - VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, - VkPhysicalDeviceGroupPropertiesKHX *pPhysicalDeviceGroupProperties); - -VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDeviceGroupsKHX( - VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, - VkPhysicalDeviceGroupPropertiesKHX *pPhysicalDeviceGroupProperties); - VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceExternalImageFormatPropertiesNV( VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, @@ -47,52 +39,6 @@ VkExternalMemoryHandleTypeFlagsNV externalHandleType, VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties); -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2KHR* pFeatures); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceFeatures2KHR* pFeatures); - -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceProperties2KHR* pProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceProperties2KHR* pProperties); - -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, - VkFormatProperties2KHR* pFormatProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, - VkFormatProperties2KHR* pFormatProperties); - -VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo, - VkImageFormatProperties2KHR* pImageFormatProperties); - -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo, - VkImageFormatProperties2KHR* pImageFormatProperties); - -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, - uint32_t* pQueueFamilyPropertyCount, - VkQueueFamilyProperties2KHR* pQueueFamilyProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties2KHR( - VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2KHR* pQueueFamilyProperties); - -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties2KHR( - VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties); - -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo, uint32_t* pPropertyCount, - VkSparseImageFormatProperties2KHR* pProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceSparseImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo, uint32_t* pPropertyCount, - VkSparseImageFormatProperties2KHR* pProperties); - VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities); @@ -134,27 +80,3 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetRandROutputDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay); #endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT - -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalBufferPropertiesKHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfoKHR* pExternalBufferInfo, - VkExternalBufferPropertiesKHR* pExternalBufferProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceExternalBufferPropertiesKHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfoKHR* pExternalBufferInfo, - VkExternalBufferPropertiesKHR* pExternalBufferProperties); - -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalSemaphorePropertiesKHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfoKHR* pExternalSemaphoreInfo, - VkExternalSemaphorePropertiesKHR* pExternalSemaphoreProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceExternalSemaphorePropertiesKHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfoKHR* pExternalSemaphoreInfo, - VkExternalSemaphorePropertiesKHR* pExternalSemaphoreProperties); - -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalFencePropertiesKHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfoKHR* pExternalFenceInfo, - VkExternalFencePropertiesKHR* pExternalFenceProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceExternalFencePropertiesKHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfoKHR* pExternalFenceInfo, - VkExternalFencePropertiesKHR* pExternalFenceProperties); diff -Nru vulkan-1.0.65.2+dfsg1/loader/gpa_helper.h vulkan-1.1.73+dfsg/loader/gpa_helper.h --- vulkan-1.0.65.2+dfsg1/loader/gpa_helper.h 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/gpa_helper.h 2018-04-27 11:24:19.000000000 +0000 @@ -20,7 +20,7 @@ */ #include -#include "debug_report.h" +#include "debug_utils.h" #include "wsi.h" static inline void *trampolineGetProcAddr(struct loader_instance *inst, const char *funcName) { @@ -163,9 +163,36 @@ if (!strcmp(funcName, "vkCmdEndRenderPass")) return (PFN_vkVoidFunction)vkCmdEndRenderPass; if (!strcmp(funcName, "vkCmdExecuteCommands")) return (PFN_vkVoidFunction)vkCmdExecuteCommands; + // Core 1.1 functions + if (!strcmp(funcName, "vkEnumeratePhysicalDeviceGroups")) return (PFN_vkVoidFunction)vkEnumeratePhysicalDeviceGroups; + if (!strcmp(funcName, "vkGetPhysicalDeviceFeatures2")) return (PFN_vkVoidFunction)vkGetPhysicalDeviceFeatures2; + if (!strcmp(funcName, "vkGetPhysicalDeviceProperties2")) return (PFN_vkVoidFunction)vkGetPhysicalDeviceProperties2; + if (!strcmp(funcName, "vkGetPhysicalDeviceFormatProperties2")) return (PFN_vkVoidFunction)vkGetPhysicalDeviceFormatProperties2; + if (!strcmp(funcName, "vkGetPhysicalDeviceImageFormatProperties2")) return (PFN_vkVoidFunction)vkGetPhysicalDeviceImageFormatProperties2; + if (!strcmp(funcName, "vkGetPhysicalDeviceQueueFamilyProperties2")) return (PFN_vkVoidFunction)vkGetPhysicalDeviceQueueFamilyProperties2; + if (!strcmp(funcName, "vkGetPhysicalDeviceMemoryProperties2")) return (PFN_vkVoidFunction)vkGetPhysicalDeviceMemoryProperties2; + if (!strcmp(funcName, "vkGetPhysicalDeviceSparseImageFormatProperties2")) return (PFN_vkVoidFunction)vkGetPhysicalDeviceSparseImageFormatProperties2; + if (!strcmp(funcName, "vkGetPhysicalDeviceExternalBufferProperties")) return (PFN_vkVoidFunction)vkGetPhysicalDeviceExternalBufferProperties; + if (!strcmp(funcName, "vkGetPhysicalDeviceExternalSemaphoreProperties")) return (PFN_vkVoidFunction)vkGetPhysicalDeviceExternalSemaphoreProperties; + if (!strcmp(funcName, "vkGetPhysicalDeviceExternalFenceProperties")) return (PFN_vkVoidFunction)vkGetPhysicalDeviceExternalFenceProperties; + if (!strcmp(funcName, "vkBindBufferMemory2")) return (PFN_vkVoidFunction)vkBindBufferMemory2; + if (!strcmp(funcName, "vkBindImageMemory2")) return (PFN_vkVoidFunction)vkBindImageMemory2; + if (!strcmp(funcName, "vkGetDeviceGroupPeerMemoryFeatures")) return (PFN_vkVoidFunction)vkGetDeviceGroupPeerMemoryFeatures; + if (!strcmp(funcName, "vkCmdSetDeviceMask")) return (PFN_vkVoidFunction)vkCmdSetDeviceMask; + if (!strcmp(funcName, "vkCmdDispatchBase")) return (PFN_vkVoidFunction)vkCmdDispatchBase; + if (!strcmp(funcName, "vkGetImageMemoryRequirements2")) return (PFN_vkVoidFunction)vkGetImageMemoryRequirements2; + if (!strcmp(funcName, "vkTrimCommandPool")) return (PFN_vkVoidFunction)vkTrimCommandPool; + if (!strcmp(funcName, "vkGetDeviceQueue2")) return (PFN_vkVoidFunction)vkGetDeviceQueue2; + if (!strcmp(funcName, "vkCreateSamplerYcbcrConversion")) return (PFN_vkVoidFunction)vkCreateSamplerYcbcrConversion; + if (!strcmp(funcName, "vkDestroySamplerYcbcrConversion")) return (PFN_vkVoidFunction)vkDestroySamplerYcbcrConversion; + if (!strcmp(funcName, "vkGetDescriptorSetLayoutSupport")) return (PFN_vkVoidFunction)vkGetDescriptorSetLayoutSupport; + if (!strcmp(funcName, "vkCreateDescriptorUpdateTemplate")) return (PFN_vkCreateDescriptorUpdateTemplate)vkCreateDescriptorUpdateTemplate; + if (!strcmp(funcName, "vkDestroyDescriptorUpdateTemplate")) return (PFN_vkDestroyDescriptorUpdateTemplate)vkDestroyDescriptorUpdateTemplate; + if (!strcmp(funcName, "vkUpdateDescriptorSetWithTemplate")) return (PFN_vkUpdateDescriptorSetWithTemplate)vkUpdateDescriptorSetWithTemplate; + // Instance extensions void *addr; - if (debug_report_instance_gpa(inst, funcName, &addr)) return addr; + if (debug_utils_InstanceGpa(inst, funcName, &addr)) return addr; if (wsi_swapchain_instance_gpa(inst, funcName, &addr)) return addr; @@ -186,6 +213,7 @@ if (!strcmp(name, "CreateInstance")) return (void *)vkCreateInstance; if (!strcmp(name, "EnumerateInstanceExtensionProperties")) return (void *)vkEnumerateInstanceExtensionProperties; if (!strcmp(name, "EnumerateInstanceLayerProperties")) return (void *)vkEnumerateInstanceLayerProperties; + if (!strcmp(name, "EnumerateInstanceVersion")) return (void *)vkEnumerateInstanceVersion; return NULL; } diff -Nru vulkan-1.0.65.2+dfsg1/loader/LoaderAndLayerInterface.md vulkan-1.1.73+dfsg/loader/LoaderAndLayerInterface.md --- vulkan-1.0.65.2+dfsg1/loader/LoaderAndLayerInterface.md 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/LoaderAndLayerInterface.md 2018-04-27 11:24:19.000000000 +0000 @@ -26,6 +26,7 @@ * [Example Code for CreateInstance](#example-code-for-createinstance) * [Example Code for CreateDevice](#example-code-for-createdevice) * [Meta-layers](#meta-layers) + * [Pre-Instance Functions](#pre-instance-functions) * [Special Considerations](#special-considerations) * [Layer Manifest File Format](#layer-manifest-file-format) * [Layer Library Versions](#layer-library-versions) @@ -34,6 +35,7 @@ * [ICD Discovery](#icd-discovery) * [ICD Manifest File Format](#icd-manifest-file-format) * [ICD Vulkan Entry-Point Discovery](#icd-vulkan-entry-point-discovery) + * [ICD API Version](#icd-api-version) * [ICD Unknown Physical Device Extensions](#icd-unknown-physical-device-extensions) * [ICD Dispatchable Object Creation](#icd-dispatchable-object-creation) * [Handling KHR Surface Objects in WSI Extensions](#handling-khr-surface-objects-in-wsi-extensions) @@ -53,7 +55,7 @@ ![High Level View of Loader](./images/high_level_loader.png) The general concepts in this document are applicable to the loaders available -for Windows, Linux and Android based systems. +for Windows, Linux, Android and MacOS based systems. #### Who Should Read This Document @@ -291,7 +293,7 @@ ##### Vulkan Direct Exports -The loader library on Windows, Linux and Android will export all core Vulkan +The loader library on Windows, Linux, Android and MacOS will export all core Vulkan and all appropriate Window System Interface (WSI) extensions. This is done to make it simpler to get started with Vulkan development. When an application links directly to the loader library in this way, the Vulkan calls are simple @@ -303,7 +305,8 @@ ###### Dynamic Linking The loader is ordinarily distributed as a dynamic library (.dll on Windows or -.so on Linux) which gets installed to the system path for dynamic libraries. +.so on Linux or .dylib on MacOS) which gets installed to the system path +for dynamic libraries. Linking to the dynamic library is generally the preferred method of linking to the loader, as doing so allows the loader to be updated for bug fixes and improvements. Furthermore, the dynamic library is generally installed to Windows @@ -362,8 +365,8 @@ ![Instance Call Chain](./images/loader_instance_chain.png) This is also how a Vulkan Device function call chain looks if you query it -using `vkGetInstanceProcAddr`. On the otherhand, a Device -function doesn't need to worry about the broadcast becuase it knows specifically +using `vkGetInstanceProcAddr`. On the other hand, a Device +function doesn't need to worry about the broadcast because it knows specifically which associated ICD and which associated Physical Device the call should terminate at. Because of this, the loader doesn't need to get involved between any enabled layers and the ICD. Thus, if you used a loader-exported Vulkan @@ -414,11 +417,12 @@ version of the loader with the same name can be found in the windows/sysWOW64 directory). -For Linux, shared libraries are versioned based on a suffix. Thus, the ABI +For Linux and MacOS, shared libraries are versioned based on a suffix. Thus, the ABI number is not encoded in the base of the library filename as on Windows. On Linux an application wanting to link to the latest Vulkan ABI version would just link to the name vulkan (libvulkan.so). A specific Vulkan ABI version can also be linked to by applications (e.g. libvulkan.so.1). +On MacOS, the libraries are libvulkan.dylib abd libvulkan.1.dylib. #### Application Layer Usage @@ -518,8 +522,8 @@ require being able to be disabled by an environmental variable. This is due to the fact that they are not visible to the application and could cause issues. A good principle to keep in mind would be to define both an enable and disable -environment variable so the users can deterministicly enable the functionality. -On Desktop platforms (Windows and Linux), these enable/disable settings are +environment variable so the users can deterministically enable the functionality. +On Desktop platforms (Windows, Linux, and MacOS), these enable/disable settings are defined in the layer's JSON file. Discovery of system-installed implicit and explicit layers is described later in @@ -532,6 +536,7 @@ | Windows | Implicit Layers are located in a different Windows registry location than Explicit Layers. | | Linux | Implicit Layers are located in a different directory location than Explicit Layers. | | Android | There is **No Support For Implicit Layers** on Android. | +| MacOS | Implicit Layers are located in a different directory location than Explicit Layers. | ##### Forcing Layer Source Folders @@ -540,10 +545,10 @@ system-installed layers. You can direct the loader to look for layers in a specific folder by defining the "VK\_LAYER\_PATH" environment variable. This will override the mechanism used for finding system-installed layers. Because -layers of interest may exist in several disinct folders on a system, this -environment variable can containis several paths seperated by the operating +layers of interest may exist in several distinct folders on a system, this +environment variable can contains several paths separated by the operating specific path separator. On Windows, each separate folder should be separated -in the list using a semi-colon. On Linux, each folder name should be separated +in the list using a semi-colon. On Linux and MacOS, each folder name should be separated using a colon. If "VK\_LAYER\_PATH" exists, **only** the folders listed in it will be scanned @@ -551,13 +556,13 @@ containing layer manifest files. -##### Forcing Layers to be Enabled on Windows and Linux +##### Forcing Layers to be Enabled on Windows, Linux and MacOS Developers may want to enable layers that are not enabled by the given -application they are using. On Linux and Windows, the environment variable +application they are using. On desktop systems, the environment variable "VK\_INSTANCE\_LAYERS" can be used to enable additional layers which are not specified (enabled) by the application at `vkCreateInstance`. -"VK\_INSTANCE\_LAYERS" is a colon (Linux)/semi-colon (Windows) separated +"VK\_INSTANCE\_LAYERS" is a colon (Linux and MacOS)/semi-colon (Windows) separated list of layer names to enable. Order is relevant with the first layer in the list being the top-most layer (closest to the application) and the last layer in the list being the bottom-most layer (closest to the driver). @@ -570,7 +575,7 @@ application) while layers specified by the application are bottommost. An example of using these environment variables to activate the validation -layer `VK_LAYER_LUNARG_parameter_validation` on Windows or Linux is as follows: +layer `VK_LAYER_LUNARG_parameter_validation` on Windows, Linux or MacOS is as follows: ``` > $ export VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_parameter_validation @@ -665,7 +670,7 @@ Integration support for various execution environments. It is important to understand that some WSI extensions are valid for all targets, but others are particular to a given execution environment (and loader). This desktop loader -(currently targeting Windows and Linux) only enables and directly exports those +(currently targeting Windows, Linux, and MacOS) only enables and directly exports those WSI extensions that are appropriate to the current environment. For the most part, the selection is done in the loader using compile-time preprocessor flags. All versions of the desktop loader currently expose at least the following WSI @@ -683,6 +688,7 @@ | Linux (Default) | VK_KHR_xcb_surface and VK_KHR_xlib_surface | | Linux (Wayland) | VK_KHR_wayland_surface | | Linux (Mir) | VK_KHR_mir_surface | +| MacOS (MoltenVK) | VK_MVK_macos_surface | **NOTE:** Wayland and Mir targets are not fully supported at this time. Wayland support is present, but should be considered Beta quality. Mir support is not @@ -707,7 +713,7 @@ loader knows nothing about. If the extension is a device extension, the loader will pass the unknown entry-point down the device call chain ending with the appropriate ICD entry-points. The same thing will happen, if the extension is -an instance extension which takes a physical device paramater as it's first +an instance extension which takes a physical device parameter as it's first component. However, for all other instance extensions the loader will fail to load it. @@ -742,7 +748,7 @@ extensions when an application calls `vkEnumerateInstanceExtensionProperties`. Additionally, this behavior will cause the loader to throw an error during `vkCreateInstance` if you still attempt to use one of these extensions. The intent is -to protect applications so that they don't inadvertantly use functionality +to protect applications so that they don't inadvertently use functionality which could lead to a crash. On the other-hand, if you know you can safely use the extension, you may disable @@ -761,6 +767,7 @@ * [Android Layer Discovery](#android-layer-discovery) * [Windows Layer Discovery](#windows-layer-discovery) * [Linux Layer Discovery](#linux-layer-discovery) + * [MacOS Layer Discovery](#macos-layer-discovery) * [Layer Version Negotiation](#layer-version-negotiation) * [Layer Call Chains and Distributed Dispatch](#layer-call-chains-and-distributed-dispatch) * [Layer Unknown Physical Device Extensions](#layer-unknown-physical-device-extensions) @@ -771,6 +778,7 @@ * [Example Code for CreateInstance](#example-code-for-createinstance) * [Example Code for CreateDevice](#example-code-for-createdevice) * [Meta-layers](#meta-layers) + * [Pre-Instance Functions](#pre-instance-functions) * [Special Considerations](#special-considerations) * [Associating Private Data with Vulkan Objects Within a Layer](#associating-private-data-with-vulkan-objects-within-a-layer) * [Wrapping](#wrapping) @@ -794,7 +802,7 @@ * Explicit Layers The main difference between the two is that Implicit Layers are automatically -enabled, unless overriden, and Explicit Layers must be enabled. Remember, +enabled, unless overridden, and Explicit Layers must be enabled. Remember, Implicit Layers are not present on all Operating Systems (like Android). On any system, the loader looks in specific areas for information on the @@ -813,7 +821,7 @@ ##### Layer Manifest File Usage -On Windows and Linux systems, JSON formatted manifest files are used to store +On Windows, Linux, and MacOS systems, JSON formatted manifest files are used to store layer information. In order to find system-installed layers, the Vulkan loader will read the JSON files to identify the names and attributes of layers and their extensions. The use of manifest files allows the loader to avoid loading @@ -888,7 +896,7 @@ In general, applications should install layers into the `SOFTWARE\Khrosos\Vulkan` paths. The PnP registry locations are intended specifically for layers that are -distrubuted as part of a driver installation. An application installer should not +distributed as part of a driver installation. An application installer should not modify the device-specific registries, while a device driver should not modify the system wide registries. @@ -917,7 +925,7 @@ $HOME/.local/share/vulkan/explicit_layer.d $HOME/.local/share/vulkan/implicit_layer.d -Of course, ther are some things you have to know about the above folders: +Of course, there are some things you have to know about the above folders: 1. The "/usr/local/*" directories can be configured to be other directories at build time. 2. $HOME is the current home directory of the application's user id; this path @@ -935,6 +943,33 @@ [Forcing Layer Source Folders](#forcing-layer-source-folders) for more information on this. +##### MacOS Layer Discovery + +On MacOS, the Vulkan loader will scan the files in the following directories: + + /Contents/Resources/vulkan/explicit_layer.d + /Contents/Resources/vulkan/implicit_layer.d + /etc/vulkan/explicit_layer.d + /etc/vulkan/implicit_layer.d + /usr/local/share/vulkan/explicit_layer.d + /usr/local/share/vulkan/implicit_layer.d + /usr/share/vulkan/explicit_layer.d + /usr/share/vulkan/implicit_layer.d + $HOME/.local/share/vulkan/explicit_layer.d + $HOME/.local/share/vulkan/implicit_layer.d + +1. <bundle> is the directory containing a bundled application. It is scanned first. +1. The "/usr/local/*" directories can be configured to be other directories at +build time. +1. $HOME is the current home directory of the application's user id; this path +will be ignored for suid programs. + +As on Windows, if VK\_LAYER\_PATH is defined, then the +loader will instead look at the paths defined by that variable instead of using +the information provided by these default paths. However, these +environment variables are only used for non-suid programs. See +[Forcing Layer Source Folders](#forcing-layer-source-folders) for more +information on this. #### Layer Version Negotiation @@ -967,11 +1002,11 @@ You'll notice the `VkNegotiateLayerInterface` structure is similar to other Vulkan structures. The "sType" field, in this case takes a new enum defined just for internal loader/layer interfacing use. The valid values for "sType" -could grow in the future, but right only havs the one value +could grow in the future, but right now only has the one value "LAYER_NEGOTIATE_INTERFACE_STRUCT". This function (`vkNegotiateLoaderLayerInterfaceVersion`) should be exported by -the layer so that using "GetProcAddress" on Windows or "dlsym" on Linux, should +the layer so that using "GetProcAddress" on Windows or "dlsym" on Linux or MacOS, should return a valid function pointer to it. Once the loader has grabbed a valid address to the layers function, the loader will create a variable of type `VkNegotiateLayerInterface` and initialize it in the following ways: @@ -1013,7 +1048,7 @@ the loader will use the “fpGetInstanceProcAddr†and “fpGetDeviceProcAddr†functions from the “VkNegotiateLayerInterface†structure. Prior to these changes, the loader would query each of those functions using "GetProcAddress" -on Windows or "dlsym" on Linux. +on Windows or "dlsym" on Linux or MacOS. #### Layer Call Chains and Distributed Dispatch @@ -1421,7 +1456,7 @@ to the application when queried. Restrictions to defining and using a meta-layer are: - 1. A Meta-layer Manifest file **must** be a properly formated that contains one + 1. A Meta-layer Manifest file **must** be a properly formatted that contains one or more component layers. 3. All component layers **must be** present on a system for the meta-layer to be used. @@ -1453,6 +1488,83 @@ Manifest file formatting necessary to define a meta-layer can be found in the [Layer Manifest File Format](#layer-manifest-file-format) section. +#### Pre-Instance Functions + +Vulkan includes a small number of functions which are called without any dispatchable object. +Most layers do not intercept these functions, as layers are enabled when an instance is created. +However, under certain conditions it is possible for a layer to intercept these functions. + +In order to intercept the pre-instance functions, several conditions must be met: +* The layer must be implicit +* The layer manifest version must be 1.1.2 or later +* The layer must export the entry point symbols for each intercepted function +* The layer manifest must specify the name of each intercepted function in a `pre_instance_functions` JSON object + +The functions that may be intercepted in this way are: +* `vkEnumerateInstanceExtensionProperties` +* `vkEnumerateInstanceLayerProperties` + +Pre-instance functions work differently from all other layer intercept functions. +Other intercept functions have a function prototype identical to that of the function they are intercepting. +They then rely on data that was passed to the layer at instance or device creation so that layers can call down the chain. +Because there is no need to create an instance before calling the pre-instance functions, these functions must use a separate mechanism for constructing the call chain. +This mechanism consists of an extra parameter that will be passed to the layer intercept function when it is called. +This parameter will be a pointer to a struct, defined as follows: + +``` +typedef struct Vk...Chain +{ + struct { + VkChainType type; + uint32_t version; + uint32_t size; + } header; + PFN_vkVoidFunction pfnNextLayer; + const struct Vk...Chain* pNextLink; +} Vk...Chain; +``` + +These structs are defined in the `vk_layer.h` file so that it is not necessary to redefine the chain structs in any external code. +The name of each struct is be similar to the name of the function it corresponds to, but the leading "V" is capitalized, and the word "Chain" is added to the end. +For example, the struct for `vkEnumerateInstanceExtensionProperties` is called `VkEnumerateInstanceExtensionPropertiesChain`. +Furthermore, the `pfnNextLayer` struct member is not actually a void function pointer — its type will be the actual type of each function in the call chain. + +Each layer intercept function must have a prototype that is the same as the prototype of the function being intercepted, except that the first parameter must be that function's chain struct (passed as a const pointer). +For example, a function that wishes to intercept `vkEnumerateInstanceExtensionProperties` would have the prototype: + +``` +VkResult InterceptFunctionName(const VkEnumerateInstanceExtensionProperties* pChain, + const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties); +``` + +The name of the function is arbitrary; it can be anything provided that it is given in the layer manifest file (see [Layer Manifest File Format](#layer-manifest-file-format)). +The implementation of each intercept functions is responsible for calling the next item in the call chain, using the chain parameter. +This is done by calling the `pfnNextLayer` member of the chain struct, passing `pNextLink` as the first argument, and passing the remaining function arguments after that. +For example, a simple implementation for `vkEnumerateInstanceExtensionProperties` that does nothing but call down the chain would look like: + +``` +VkResult InterceptFunctionName(const VkEnumerateInstanceExtensionProperties* pChain, + const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties) +{ + return pChain->pfnNextLayer(pChain->pNextLink, pLayerName, pPropertyCount, pProperties); +} +``` + +When using a C++ compiler, each chain type also defines a function named `CallDown` which can be used to automatically handle the first argument. +Implementing the above function using this method would look like: + +``` +VkResult InterceptFunctionName(const VkEnumerateInstanceExtensionProperties* pChain, + const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties) +{ + return pChain->CallDown(pLayerName, pPropertyCount, pProperties); +} +``` + +Unlike with other functions in layers, the layer may not save any global data between these function calls. +Because Vulkan does not store any state until an instance has been created, all layer libraries are released at the end of each pre-instance call. +This means that implicit layers can use pre-instance intercepts to modify data that is returned by the functions, but they cannot be used to record that data. + #### Special Considerations @@ -1597,7 +1709,7 @@ #### Layer Manifest File Format -On Windows and Linux (desktop), the loader uses manifest files to discover +On Windows, Linux and MacOS (desktop), the loader uses manifest files to discover layer libraries and layers. The desktop loader doesn't directly query the layer library except during chaining. This is to reduce the likelihood of loading a malicious layer into memory. Instead, details are read from the @@ -1643,7 +1755,7 @@ ], "enable_environment": { "ENABLE_LAYER_OVERLAY_1": "1" - } + }, "disable_environment": { "DISABLE_LAYER_OVERLAY_1": "" } @@ -1694,13 +1806,13 @@ | JSON Node | Description and Notes | Introspection Query | |:----------------:|--------------------|:----------------: | "file\_format\_version" | Manifest format major.minor.patch version number. | N/A | -| | Supported versions are: 1.0.0, 1.0.1, and 1.1.0. | | +| | Supported versions are: 1.0.0, 1.0.1, 1.1.0, 1.1.1, and 1.1.2. | | | "layer" | The identifier used to group a single layer's information together. | vkEnumerateInstanceLayerProperties | | "layers" | The identifier used to group multiple layers' information together. This requires a minimum Manifest file format version of 1.0.1.| vkEnumerateInstanceLayerProperties | | "name" | The string used to uniquely identify this layer to applications. | vkEnumerateInstanceLayerProperties | | "type" | This field indicates the type of layer. The values can be: GLOBAL, or INSTANCE | vkEnumerate*LayerProperties | | | **NOTES:** Prior to deprecation, the "type" node was used to indicate which layer chain(s) to activate the layer upon: instance, device, or both. Distinct instance and device layers are deprecated; there are now just layers. Allowable values for type (both before and after deprecation) are "INSTANCE", "GLOBAL" and, "DEVICE." "DEVICE" layers are skipped over by the loader as if they were not found. | | -| "library\_path" | The "library\_path" specifies either a filename, a relative pathname, or a full pathname to a layer shared library file. If "library\_path" specifies a relative pathname, it is relative to the path of the JSON manifest file (e.g. for cases when an application provides a layer that is in the same folder hierarchy as the rest of the application files). If "library\_path" specifies a filename, the library must live in the system's shared object search path. There are no rules about the name of the layer shared library files other than it should end with the appropriate suffix (".DLL" on Windows, and ".so" on Linux). **This field must not be present if "component_layers" is defined** | N/A | +| "library\_path" | The "library\_path" specifies either a filename, a relative pathname, or a full pathname to a layer shared library file. If "library\_path" specifies a relative pathname, it is relative to the path of the JSON manifest file (e.g. for cases when an application provides a layer that is in the same folder hierarchy as the rest of the application files). If "library\_path" specifies a filename, the library must live in the system's shared object search path. There are no rules about the name of the layer shared library files other than it should end with the appropriate suffix (".DLL" on Windows, ".so" on Linux, and ".dylib" on MacOS). **This field must not be present if "component_layers" is defined** | N/A | | "api\_version" | The major.minor.patch version number of the Vulkan API that the shared library file for the library was built against. For example: 1.0.33. | vkEnumerateInstanceLayerProperties | | "implementation_version" | The version of the layer implemented. If the layer itself has any major changes, this number should change so the loader and/or application can identify it properly. | vkEnumerateInstanceLayerProperties | | "description" | A high-level description of the layer and it's intended use. | vkEnumerateInstanceLayerProperties | @@ -1710,12 +1822,22 @@ | "enable\_environment" | **Implicit Layers Only** - **OPTIONAL:** Indicates an environment variable used to enable the Implicit Layer (w/ value of 1). This environment variable (which should vary with each "version" of the layer) must be set to the given value or else the implicit layer is not loaded. This is for application environments (e.g. Steam) which want to enable a layer(s) only for applications that they launch, and allows for applications run outside of an application environment to not get that implicit layer(s).| N/A | | "disable\_environment" | **Implicit Layers Only** - **REQUIRED:**Indicates an environment variable used to disable the Implicit Layer (w/ value of 1). In rare cases of an application not working with an implicit layer, the application can set this environment variable (before calling Vulkan functions) in order to "blacklist" the layer. This environment variable (which should vary with each "version" of the layer) must be set (not particularly to any value). If both the "enable_environment" and "disable_environment" variables are set, the implicit layer is disabled. | N/A | | "component_layers" | **Meta-layers Only** - Indicates the component layer names that are part of a meta-layer. The names listed must be the "name" identified in each of the component layer's Mainfest file "name" tag (this is the same as the name of the layer that is passed to the `vkCreateInstance` command). All component layers must be present on the system and found by the loader in order for this meta-layer to be available and activated. **This field must not be present if "library\_path" is defined** | N/A | +| "pre_instance_functions" | **Implicit Layers Only** - **OPTIONAL:** Indicates which functions the layer wishes to intercept, that do not require that an instance has been created. This should be an object where each function to be intercepted is defined as a string entry where the key is the Vulkan function name and the value is the name of the intercept function in the layer's dynamic library. Available in layer manifest versions 1.1.2 and up. See [Pre-Instance Functions](#pre-instance-functions) for more information. | vkEnumerateInstance*Properties | ##### Layer Manifest File Version History -The current highest supported Layer Manifest file format supported is 1.1.0. +The current highest supported Layer Manifest file format supported is 1.1.2. Information about each version is detailed in the following sub-sections: +###### Layer Manifest File Version 1.1.2 + +Version 1.1.2 introduced the ability of layers to intercept function calls that do not have an instance. + +###### Layer Manifest File Version 1.1.1 + +The ability to define custom metalayers was added. +To support metalayers, the "component_layers" section was added, and the requirement for a "library_path" section to be present was removed when the "component_layers" section is present. + ###### Layer Manifest File Version 1.1.0 Layer Manifest File Version 1.1.0 is tied to changes exposed by the Loader/Layer @@ -1779,7 +1901,7 @@ [Layer Unknown Physical Device Extensions](#layer-unknown-physical-device- extensions) and the associated `vk_layerGetPhysicalDeviceProcAddr` function. Finally, it -changed the manifest file defition to 1.1.0. +changed the manifest file definition to 1.1.0. ##### Layer Library API Version 1 @@ -1850,17 +1972,19 @@ * [ICD Manifest File Usage](#icd-manifest-file-usage) * [ICD Discovery on Windows](#icd-discovery-on-windows) * [ICD Discovery on Linux](#icd-discovery-on-linux) - * [Using Pre-Production ICDs on Windows and Linux](#using-pre-production-icds-on-windows-and-linux) + * [ICD Discovery on MacOS](#icd-discovery-on-macos) + * [Using Pre-Production ICDs on Windows, Linux and MacOS](#using-pre-production-icds-on-windows-and-linux) * [ICD Discovery on Android](#icd-discovery-on-android) * [ICD Manifest File Format](#icd-manifest-file-format) * [ICD Manifest File Versions](#icd-manifest-file-versions) * [ICD Manifest File Version 1.0.0](#icd-manifest-file-version-1.0.0) * [ICD Vulkan Entry-Point Discovery](#icd-vulkan-entry-point-discovery) + * [ICD API Version](#icd-api-version) * [ICD Unknown Physical Device Extensions](#icd-unknown-physical-device-extensions) * [ICD Dispatchable Object Creation](#icd-dispatchable-object-creation) * [Handling KHR Surface Objects in WSI Extensions](#handling-khr-surface-objects-in-wsi-extensions) * [Loader and ICD Interface Negotiation](#loader-and-icd-interface-negotiation) - * [Windows and Linux ICD Negotiation](#windows-and-linux-icd-negotiation) + * [Windows, Linux, and MacOS ICD Negotiation](#windows-and-linux-icd-negotiation) * [Version Negotiation Between Loader and ICDs](#version-negotiation-between-loader-and-icds) * [Interfacing With Legacy ICDs or Loader](#interfacing-with-legacy-icds-or-loader) * [Loader Version 5 Interface Requirements](#loader-version-5-interface-requirements) @@ -1879,7 +2003,7 @@ of available ICDs, the loader can enumerate all the physical devices available for an application and return this information to the application. The process in which the loader discovers the available Installable Client Drivers (ICDs) -on a system is platform dependent. Windows, Linux and Android ICD discovery +on a system is platform dependent. Windows, Linux, Android, and MacOS ICD discovery details are listed below. #### Overriding the Default ICD Usage @@ -1912,10 +2036,18 @@ This is an example which is using the `VK_ICD_FILENAMES` override on Linux to point to the Intel Mesa driver's ICD Manifest file. +##### On MacOS + +``` +export VK_ICD_FILENAMES=/home/user/MoltenVK/Package/Latest/MoltenVK/macOS/MoltenVK_icd.json +``` + +This is an example which is using the `VK_ICD_FILENAMES` override on MacOS to point +to an installation and build of the MoltenVK GitHub repository that contains the MoltenVK ICD. #### ICD Manifest File Usage -As with layers, on Windows and Linux systems, JSON formatted manifest files are +As with layers, on Windows, Linux and MacOS systems, JSON formatted manifest files are used to store ICD information. In order to find system-installed drivers, the Vulkan loader will read the JSON files to identify the names and attributes of each driver. One thing you will notice is that ICD Manifest files are much @@ -2033,6 +2165,38 @@ See the [ICD Manifest File Format](#icd-manifest-file-format) section for more details. +#### ICD Discovery on MacOS + +In order to find installed ICDs, the Vulkan loader will scan the files +in the following directories: + +``` + /Contents/Resources/vulkan/icd.d + /etc/vulkan/icd.d + /usr/local/share/vulkan/icd.d + /usr/share/vulkan/icd.d + $HOME/.local/share/vulkan/icd.d +``` + +The "/usr/local/*" directories can be configured to be other directories at +build time. + +The typical usage of the directories is indicated in the table below. + +| Location | Details | +|-------------------|------------------------| +| <bundle>/Contents/Resources/vulkan/icd.d | Directory for ICDs that are bundled with the application (searched first) | +| "/etc/vulkan/icd.d" | Location of ICDs installed manually | +| "/usr/local/share/vulkan/icd.d" | Directory for locally built ICDs | +| "/usr/share/vulkan/icd.d" | Location of ICDs installed from packages | +| $HOME/.local/share/vulkan/icd.d | $HOME is the current home directory of the application's user id; this path will be ignored for suid programs | + +The Vulkan loader will open each manifest file found to obtain the name or +pathname of an ICD shared library (".dylib") file. + +See the [ICD Manifest File Format](#icd-manifest-file-format) section for more +details. + ##### Additional Settings For ICD Debugging If you are seeing issues which may be related to the ICD. A possible option to debug is to enable the @@ -2041,7 +2205,7 @@ to fail on loading the ICD. It is recommended that you enable `LD_BIND_NOW` along with `VK_LOADER_DEBUG=warn` to expose any issues. -#### Using Pre-Production ICDs on Windows and Linux +#### Using Pre-Production ICDs on Windows, Linux and MacOS Independent Hardware Vendor (IHV) pre-production ICDs. In some cases, a pre-production ICD may be in an installable package. In other cases, a @@ -2055,13 +2219,13 @@ The "VK\_ICD\_FILENAMES" environment variable is a list of ICD manifest files, containing the full path to the ICD JSON Manifest file. This -list is colon-separated on Linux, and semi-colon separated on Windows. +list is colon-separated on Linux and MacOS, and semi-colon separated on Windows. Typically, "VK\_ICD\_FILENAMES" will only contain a full pathname to one info file for a developer-built ICD. A separator (colon or semi-colon) is only used if more than one ICD is listed. -**NOTE:** On Linux, this environment variable will be ignored for suid programs. +**NOTE:** On Linux and MacOS, this environment variable will be ignored for suid programs. #### ICD Discovery on Android @@ -2094,7 +2258,7 @@ |----------------|--------------------| | "file\_format\_version" | The JSON format major.minor.patch version number of this file. Currently supported version is 1.0.0. | | "ICD" | The identifier used to group all ICD information together. | -| "library_path" | The "library\_path" specifies either a filename, a relative pathname, or a full pathname to a layer shared library file. If "library\_path" specifies a relative pathname, it is relative to the path of the JSON manifest file. If "library\_path" specifies a filename, the library must live in the system's shared object search path. There are no rules about the name of the ICD shared library files other than it should end with the appropriate suffix (".DLL" on Windows, and ".so" on Linux). | N/A | +| "library_path" | The "library\_path" specifies either a filename, a relative pathname, or a full pathname to a layer shared library file. If "library\_path" specifies a relative pathname, it is relative to the path of the JSON manifest file. If "library\_path" specifies a filename, the library must live in the system's shared object search path. There are no rules about the name of the ICD shared library files other than it should end with the appropriate suffix (".DLL" on Windows, ".so" on Linux and "*.dylib" on MacOS). | N/A | | "api_version" | The major.minor.patch version number of the Vulkan API that the shared library files for the ICD was built against. For example: 1.0.33. | **NOTE:** If the same ICD shared library supports multiple, incompatible @@ -2161,6 +2325,41 @@ linked with -Bsymbolic. +### ICD API Version +When an application calls `vkCreateInstance`, it can optionally include a +`VkApplicationInfo` struct, which includes an `apiVersion` field. A Vulkan 1.0 +ICD was required to return `VK_ERROR_INCOMPATIBLE_DRIVER` if it did not +support the API version that the user passed. Beginning with Vulkan 1.1, ICDs +are not allowed to return this error for any value of `apiVersion`. This +creates a problem when working with multiple ICDs, where one is a 1.0 ICD and +another is newer. + +A loader that is newer than 1.0 will always give the version it supports when +the application calls `vkEnumerateInstanceVersion`, regardless of the API +version supported by the ICDs on the system. This means that when the +application calls `vkCreateInstance`, the loader will be forced to pass a copy +of the `VkApplicationInfo` struct where `apiVersion` is 1.0 to any 1.0 drivers +in order to prevent an error. To determine if this must be done, the loader +will perform the following steps: + +1. Load the ICD's dynamic library +2. Call the ICD's `vkGetInstanceProcAddr` command to get a pointer to +`vkEnumerateInstanceVersion` +3. If the pointer to `vkEnumerateInstanceVersion` is not `NULL`, it will be +called to get the ICD's supported API version + +The ICD will be treated as a 1.0 ICD if any of the following conditions are met: + +- The function pointer to `vkEnumerateInstanceVersion` is `NULL` +- The version returned by `vkEnumerateInstanceVersion` is less than 1.1 +- `vkEnumerateInstanceVersion` returns anything other than `VK_SUCCESS` + +If the ICD only supports Vulkan 1.0, the loader will ensure that any +`VkApplicationInfo` struct that is passed to the ICD will have an `apiVersion` +field set to Vulkan 1.0. Otherwise, the loader will pass the struct to the ICD +without any changes. + + ### ICD Unknown Physical Device Extensions Originally, if the loader was called with `vkGetInstanceProcAddr`, it would @@ -2284,9 +2483,10 @@ ### Handling KHR Surface Objects in WSI Extensions Normally, ICDs handle object creation and destruction for various Vulkan -objects. The WSI surface extensions for Linux and Windows +objects. The WSI surface extensions for Linux, Windows, and MacOS ("VK\_KHR\_win32\_surface", "VK\_KHR\_xcb\_surface", "VK\_KHR\_xlib\_surface", -"VK\_KHR\_mir\_surface", "VK\_KHR\_wayland\_surface", and "VK\_KHR\_surface") +"VK\_KHR\_mir\_surface", "VK\_KHR\_wayland\_surface", "VK\_MVK\_macos\_surface" +and "VK\_KHR\_surface") are handled differently. For these extensions, the `VkSurfaceKHR` object creation and destruction may be handled by either the loader, or an ICD. @@ -2301,6 +2501,7 @@ * Xlib * Windows * Android + * MacOS (`vkCreateMacOSSurfaceMVK`) 2. The loader creates a `VkIcdSurfaceXXX` object for the corresponding `vkCreateXXXSurfaceKHR` call. * The `VkIcdSurfaceXXX` structures are defined in `include/vulkan/vk_icd.h`. @@ -2329,7 +2530,7 @@ object. This object acts as a container for each ICD's version of the `VkSurfaceKHR` object. If an ICD does not support the creation of its own `VkSurfaceKHR` object, the loader's container stores a NULL for that ICD. On -the otherhand, if the ICD does support `VkSurfaceKHR` creation, the loader will +the other hand, if the ICD does support `VkSurfaceKHR` creation, the loader will make the appropriate `vkCreateXXXSurfaceKHR` call to the ICD, and store the returned pointer in it's container object. The loader then returns the `VkSurfaceIcdXXX` as a `VkSurfaceKHR` object back up the call chain. Finally, @@ -2345,10 +2546,10 @@ functions or their parameters, but simply calls the ICDs entry-point for that function. There are specific additional interface requirements an ICD needs to comply with that are not part of any requirements from the Vulkan specification. -These addtional requirements are versioned to allow flexibility in the future. +These additional requirements are versioned to allow flexibility in the future. -#### Windows and Linux ICD Negotiation +#### Windows, Linux and MacOS ICD Negotiation ##### Version Negotiation Between Loader and ICDs @@ -2515,7 +2716,7 @@ table as described above. The only difference is that the Android loader queries layer and extension information directly from the respective libraries and does not use the json manifest files used -by the Windows and Linux loaders. +by the Windows, Linux and MacOS loaders. ## Table of Debug Environment Variables @@ -2528,7 +2729,7 @@ | VK_ICD_FILENAMES | Force the loader to use the specific ICD JSON files. The value should contain a list of delimited full path listings to ICD JSON Manifest files. **NOTE:** If you fail to use the global path to a JSON file, you may encounter issues. | `export VK_ICD_FILENAMES=\intel.json:\amd.json`

`set VK_ICD_FILENAMES=\nvidia.json;\mesa.json` | | VK_INSTANCE_LAYERS | Force the loader to add the given layers to the list of Enabled layers normally passed into `vkCreateInstance`. These layers are added first, and the loader will remove any duplicate layers that appear in both this list as well as that passed into `ppEnabledLayerNames`. | `export VK_INSTANCE_LAYERS=:`

`set VK_INSTANCE_LAYERS=;` | | VK_LAYER_PATH | Override the loader's standard Layer library search folders and use the provided delimited folders to search for layer Manifest files. | `export VK_LAYER_PATH=:`

`set VK_LAYER_PATH=;` | -| VK_LOADER_DISABLE_INST_EXT_FILTER | Disable the filtering out of instance extensions that the loader doesn't know about. This will allow applications to enable instance extensions exposed by ICDs but that the loader has no support for. **NOTE:** This may cause the loader or applciation to crash. | `export VK_LOADER_DISABLE_INST_EXT_FILTER=1`

`set VK_LOADER_DISABLE_INST_EXT_FILTER=1` | +| VK_LOADER_DISABLE_INST_EXT_FILTER | Disable the filtering out of instance extensions that the loader doesn't know about. This will allow applications to enable instance extensions exposed by ICDs but that the loader has no support for. **NOTE:** This may cause the loader or application to crash. | `export VK_LOADER_DISABLE_INST_EXT_FILTER=1`

`set VK_LOADER_DISABLE_INST_EXT_FILTER=1` | | VK_LOADER_DEBUG | Enable loader debug messages. Options are:
- error (only errors)
- warn (warnings and errors)
- info (info, warning, and errors)
- debug (debug + all before)
-all (report out all messages) | `export VK_LOADER_DEBUG=all`

`set VK_LOADER_DEBUG=warn` | ## Glossary of Terms @@ -2536,11 +2737,11 @@ | Field Name | Field Value | |:---:|--------------------| | Android Loader | The loader designed to work primarily for the Android OS. This is generated from a different code-base than the desktop loader. But, in all important aspects, should be functionally equivalent. | -| Desktop Loader | The loader designed to work on both Windows and Linux. This is generated from a different [code-base](#https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers) than the Android loader. But in all important aspects, should be functionally equivalent. | +| Desktop Loader | The loader designed to work on Windows, Linux and MacOS. This is generated from a different [code-base](#https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers) than the Android loader. But in all important aspects, should be functionally equivalent. | | Core Function | A function that is already part of the Vulkan core specification and not an extension. For example, vkCreateDevice(). | | Device Call Chain | The call chain of functions followed for device functions. This call chain for a device function is usually as follows: first the application calls into a loader trampoline, then the loader trampoline calls enabled layers, the final layer calls into the ICD specific to the device. See the [Dispatch Tables and Call Chains](#dispatch-tables-and-call-chains) section for more information | | Device Function | A Device function is any Vulkan function which takes a `VkDevice`, `VkQueue`, `VkCommandBuffer`, or any child of these, as its first parameter. Some Vulkan Device functions are: `vkQueueSubmit`, `vkBeginCommandBuffer`, `vkCreateEvent`. See the [Instance Versus Device](#instance-versus-device) section for more information. | -| Discovery | The process of the loader searching for ICD and Layer files to setup the internal list of Vulkan objects available. On Windows/Linux, the discovery process typically focuses on searching for Manifest files. While on Android, the process focuses on searching for library files. | +| Discovery | The process of the loader searching for ICD and Layer files to setup the internal list of Vulkan objects available. On Windows/Linux/MacOS, the discovery process typically focuses on searching for Manifest files. While on Android, the process focuses on searching for library files. | | Dispatch Table | An array of function pointers (including core and possibly extension functions) used to step to the next entity in a call chain. The entity could be the loader, a layer or an ICD. See [Dispatch Tables and Call Chains](#dispatch-tables-and-call-chains) for more information. | | Extension | A concept of Vulkan used to expand the core Vulkan functionality. Extensions may be IHV-specific, platform-specific, or more broadly available. You should always query if an extension exists, and enable it during `vkCreateInstance` (if it is an instance extension) or during `vkCreateDevice` (if it is a device extension). | | ICD | Acronym for Installable Client Driver. These are drivers that are provided by IHVs to interact with the hardware they provide. See [Installable Client Drivers](#installable-client-drivers) section for more information. Binary files /tmp/tmp8LVRSV/k7IHu5fWhy/vulkan-1.0.65.2+dfsg1/loader/loader.aps and /tmp/tmp8LVRSV/BBiKMQpAzm/vulkan-1.1.73+dfsg/loader/loader.aps differ diff -Nru vulkan-1.0.65.2+dfsg1/loader/loader.c vulkan-1.1.73+dfsg/loader/loader.c --- vulkan-1.0.65.2+dfsg1/loader/loader.c 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/loader.c 2018-04-27 11:24:19.000000000 +0000 @@ -1,8 +1,8 @@ /* * - * Copyright (c) 2014-2017 The Khronos Group Inc. - * Copyright (c) 2014-2017 Valve Corporation - * Copyright (c) 2014-2017 LunarG, Inc. + * Copyright (c) 2014-2018 The Khronos Group Inc. + * Copyright (c) 2014-2018 Valve Corporation + * Copyright (c) 2014-2018 LunarG, Inc. * Copyright (C) 2015 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,17 +21,22 @@ * Author: Jon Ashburn * Author: Courtney Goeltzenleuchter * Author: Mark Young + * Author: Lenny Komow * */ #define _GNU_SOURCE +#include #include #include #include #include #include #include - +#if defined(__APPLE__) +#include +#include +#endif #include #if defined(_WIN32) #include "dirent_on_windows.h" @@ -41,7 +46,7 @@ #include "vk_loader_platform.h" #include "loader.h" #include "gpa_helper.h" -#include "debug_report.h" +#include "debug_utils.h" #include "wsi.h" #include "vulkan/vk_icd.h" #include "cJSON.h" @@ -94,6 +99,10 @@ LOADER_PLATFORM_THREAD_ONCE_DECLARATION(once_init); +// This loader supports Vulkan API version 1.1 +uint32_t loader_major_version = 1; +uint32_t loader_minor_version = 1; + void *loader_instance_heap_alloc(const struct loader_instance *instance, size_t size, VkSystemAllocationScope alloc_scope) { void *pMemory = NULL; #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) @@ -204,7 +213,7 @@ } // Environment variables -#if defined(__linux__) +#if defined(__linux__) || defined(__APPLE__) static inline char *loader_getenv(const char *name, const struct loader_instance *inst) { // No allocation of memory necessary for Linux, but we should at least touch @@ -214,13 +223,22 @@ } static inline char *loader_secure_getenv(const char *name, const struct loader_instance *inst) { - // No allocation of memory necessary for Linux, but we should at least touch - // the inst pointer to get rid of compiler warnings. - (void)inst; - +#if defined(__APPLE__) + // Apple does not appear to have a secure getenv implementation. + // The main difference between secure getenv and getenv is that secure getenv + // returns NULL if the process is being run with elevated privileges by a normal user. + // The idea is to prevent the reading of malicious environment variables by a process + // that can do damage. + // This algorithm is derived from glibc code that sets an internal + // variable (__libc_enable_secure) if the process is running under setuid or setgid. + return geteuid() != getuid() || getegid() != getgid() ? NULL : loader_getenv(name, inst); +#else +// Linux #ifdef HAVE_SECURE_GETENV + (void)inst; return secure_getenv(name); #elif defined(HAVE___SECURE_GETENV) + (void)inst; return __secure_getenv(name); #else #pragma message( \ @@ -228,6 +246,7 @@ " updating to a different libc.") return loader_getenv(name, inst); #endif +#endif } static inline void loader_free_getenv(char *val, const struct loader_instance *inst) { @@ -308,8 +327,46 @@ va_end(ap); if (inst) { - util_DebugReportMessage(inst, msg_type, VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, (uint64_t)(uintptr_t)inst, 0, msg_code, - "loader", msg); + VkDebugUtilsMessageSeverityFlagBitsEXT severity = 0; + VkDebugUtilsMessageTypeFlagsEXT type; + VkDebugUtilsMessengerCallbackDataEXT callback_data; + VkDebugUtilsObjectNameInfoEXT object_name; + + if ((msg_type & LOADER_INFO_BIT) != 0) { + severity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT; + } else if ((msg_type & LOADER_WARN_BIT) != 0) { + severity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT; + } else if ((msg_type & LOADER_ERROR_BIT) != 0) { + severity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT; + } else if ((msg_type & LOADER_DEBUG_BIT) != 0) { + severity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT; + } + + if ((msg_type & LOADER_PERF_BIT) != 0) { + type = VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT; + } else { + type = VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT; + } + + callback_data.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT; + callback_data.pNext = NULL; + callback_data.flags = 0; + callback_data.pMessageIdName = "Loader Message"; + callback_data.messageIdNumber = 0; + callback_data.pMessage = msg; + callback_data.queueLabelCount = 0; + callback_data.pQueueLabels = NULL; + callback_data.cmdBufLabelCount = 0; + callback_data.pCmdBufLabels = NULL; + callback_data.objectCount = 1; + callback_data.pObjects = &object_name; + object_name.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT; + object_name.pNext = NULL; + object_name.objectType = VK_OBJECT_TYPE_INSTANCE; + object_name.objectHandle = (uint64_t)(uintptr_t)inst; + object_name.pObjectName = NULL; + + util_SubmitDebugUtilsMessageEXT(inst, severity, type, &callback_data); } if (!(msg_type & g_loader_log_msgs)) { @@ -407,6 +464,57 @@ } #if defined(_WIN32) + +// Append the JSON path data to the list and allocate/grow the list if it's not large enough. +// Function returns true if filename was appended to reg_data list. +// Caller should free reg_data. +static bool loaderAddJsonEntry(const struct loader_instance *inst, + char **reg_data, // list of JSON files + PDWORD total_size, // size of reg_data + LPCTSTR key_name, // key name - used for debug prints - i.e. VulkanDriverName + DWORD key_type, // key data type + LPSTR json_path, // JSON string to add to the list reg_data + DWORD json_size, // size in bytes of json_path + VkResult *result) { + if (NULL == *reg_data) { + *reg_data = loader_instance_heap_alloc(inst, *total_size, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if (NULL == *reg_data) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "loaderAddJsonEntry: Failed to allocate space for registry data for key %s", json_path); + *result = VK_ERROR_OUT_OF_HOST_MEMORY; + return false; + } + *reg_data[0] = '\0'; + } else if (strlen(*reg_data) + json_size + 1 > *total_size) { + void *new_ptr = + loader_instance_heap_realloc(inst, *reg_data, *total_size, *total_size * 2, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if (NULL == new_ptr) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "loaderAddJsonEntry: Failed to reallocate space for registry value of size %d for key %s", *total_size * 2, + json_path); + *result = VK_ERROR_OUT_OF_HOST_MEMORY; + return false; + } + *reg_data = new_ptr; + *total_size *= 2; + } + + for (char *curr_filename = json_path; curr_filename[0] != '\0'; curr_filename += strlen(curr_filename) + 1) { + if (strlen(*reg_data) == 0) { + (void)snprintf(*reg_data, json_size + 1, "%s", curr_filename); + } else { + (void)snprintf(*reg_data + strlen(*reg_data), json_size + 2, "%c%s", PATH_SEPARATOR, curr_filename); + } + loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, "%s: Located json file \"%s\" from PnP registry: %s", __FUNCTION__, + curr_filename, key_name); + + if (key_type == REG_SZ) { + break; + } + } + return true; +} + // Find the list of registry files (names VulkanDriverName/VulkanDriverNameWow) in hkr. // // This function looks for filename in given device handle, filename is then added to return list @@ -465,7 +573,7 @@ value_name, NULL, &data_type, - manifest_path, + (BYTE *)manifest_path, &requiredSize ); @@ -484,43 +592,7 @@ goto out; } - if (NULL == *reg_data) { - *reg_data = loader_instance_heap_alloc(inst, *total_size, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); - if (NULL == *reg_data) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loaderGetDeviceRegistryEntry: Failed to allocate space for registry data for key %s", manifest_path); - *result = VK_ERROR_OUT_OF_HOST_MEMORY; - goto out; - } - *reg_data[0] = '\0'; - } else if (strlen(*reg_data) + requiredSize + 1 > *total_size) { - void *new_ptr = loader_instance_heap_realloc(inst, *reg_data, *total_size, *total_size * 2, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); - if (NULL == new_ptr) { - loader_log( - inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loaderGetDeviceRegistryEntry: Failed to reallocate space for registry value of size %d for key %s", - *total_size * 2, manifest_path); - *result = VK_ERROR_OUT_OF_HOST_MEMORY; - goto out; - } - *reg_data = new_ptr; - *total_size *= 2; - } - - for (char *curr_filename = manifest_path; curr_filename[0] != '\0'; curr_filename += strlen(curr_filename) + 1) { - if (strlen(*reg_data) == 0) { - (void)snprintf(*reg_data, requiredSize + 1, "%s", curr_filename); - } else { - (void)snprintf(*reg_data + strlen(*reg_data), requiredSize + 2, "%c%s", PATH_SEPARATOR, curr_filename); - } - loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, __FUNCTION__ ": Located json file \"%s\" from PnP registry: %s", curr_filename, value_name); - - if (data_type == REG_SZ) { - break; - } - } - found = true; + found = loaderAddJsonEntry(inst, reg_data, total_size, value_name, data_type, manifest_path, requiredSize, result); out: if (manifest_path != NULL) { @@ -542,15 +614,15 @@ // *reg_data contains a string list of filenames as pointer. // When done using the returned string list, the caller should free the pointer. VkResult loaderGetDeviceRegistryFiles(const struct loader_instance *inst, char **reg_data, PDWORD reg_data_size, LPCTSTR value_name) { - static const char* softwareComponentGUID = "{5c4c3332-344d-483c-8739-259e934c9cc8}"; - static const char* displayGUID = "{4d36e968-e325-11ce-bfc1-08002be10318}"; + static const wchar_t *softwareComponentGUID = L"{5c4c3332-344d-483c-8739-259e934c9cc8}"; + static const wchar_t *displayGUID = L"{4d36e968-e325-11ce-bfc1-08002be10318}"; const ULONG flags = CM_GETIDLIST_FILTER_CLASS | CM_GETIDLIST_FILTER_PRESENT; - - char childGuid[MAX_GUID_STRING_LEN + 2]; // +2 for brackets {} + + wchar_t childGuid[MAX_GUID_STRING_LEN + 2]; // +2 for brackets {} ULONG childGuidSize = sizeof(childGuid); DEVINST devID = 0, childID = 0; - char *pDeviceNames = NULL; + wchar_t *pDeviceNames = NULL; ULONG deviceNamesSize = 0; VkResult result = VK_SUCCESS; bool found = false; @@ -562,28 +634,27 @@ // if after obtaining the DeviceNameSize, new device is added start over do { - CM_Get_Device_ID_List_Size(&deviceNamesSize, displayGUID, flags); + CM_Get_Device_ID_List_SizeW(&deviceNamesSize, displayGUID, flags); if (pDeviceNames != NULL) { loader_instance_heap_free(inst, pDeviceNames); } - pDeviceNames = loader_instance_heap_alloc(inst, deviceNamesSize, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + pDeviceNames = loader_instance_heap_alloc(inst, deviceNamesSize * sizeof(wchar_t), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (pDeviceNames == NULL) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loaderGetDeviceRegistryFiles: Failed to allocate space for display device names."); result = VK_ERROR_OUT_OF_HOST_MEMORY; return result; } - } while (CM_Get_Device_ID_List(displayGUID, pDeviceNames, deviceNamesSize, flags) == CR_BUFFER_SMALL); - - if (pDeviceNames) { + } while (CM_Get_Device_ID_ListW(displayGUID, pDeviceNames, deviceNamesSize, flags) == CR_BUFFER_SMALL); - for (char *deviceName = pDeviceNames; *deviceName; deviceName += strlen(deviceName) + 1) { - CONFIGRET status = CM_Locate_DevNode(&devID, deviceName, CM_LOCATE_DEVNODE_NORMAL); + if (pDeviceNames) { + for (wchar_t *deviceName = pDeviceNames; *deviceName; deviceName += wcslen(deviceName) + 1) { + CONFIGRET status = CM_Locate_DevNodeW(&devID, deviceName, CM_LOCATE_DEVNODE_NORMAL); if (CR_SUCCESS != status) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loaderGetRegistryFiles: failed to open DevNode %s", deviceName); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loaderGetDeviceRegistryFiles: failed to open DevNode %s", + deviceName); continue; } ULONG ulStatus, ulProblem; @@ -591,19 +662,18 @@ if (CR_SUCCESS != status) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loaderGetRegistryFiles: failed to probe device status %s", deviceName); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loaderGetDeviceRegistryFiles: failed to probe device status %s", + deviceName); continue; } if ((ulStatus & DN_HAS_PROBLEM) && (ulProblem == CM_PROB_NEED_RESTART || ulProblem == DN_NEED_RESTART)) { loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "loaderGetRegistryFiles: device %s is pending reboot, skipping ...", deviceName); + "loaderGetDeviceRegistryFiles: device %s is pending reboot, skipping ...", deviceName); continue; } - loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "loaderGetRegistryFiles: opening device %s", deviceName); + loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, "loaderGetDeviceRegistryFiles: opening device %s", deviceName); if (loaderGetDeviceRegistryEntry(inst, reg_data, reg_data_size, devID, value_name, &result)) { found = true; @@ -616,29 +686,29 @@ status = CM_Get_Child(&childID, devID, 0); if (status != CR_SUCCESS) { loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "loaderGetRegistryFiles: unable to open child-device error:%d", status); + "loaderGetDeviceRegistryFiles: unable to open child-device error:%d", status); continue; } do { - char buffer[MAX_DEVICE_ID_LEN]; - CM_Get_Device_ID(childID, buffer, MAX_DEVICE_ID_LEN, 0); + wchar_t buffer[MAX_DEVICE_ID_LEN]; + CM_Get_Device_IDW(childID, buffer, MAX_DEVICE_ID_LEN, 0); loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "loaderGetRegistryFiles: Opening child device %d - %s", childID, buffer); + "loaderGetDeviceRegistryFiles: Opening child device %d - %s", childID, buffer); - status = CM_Get_DevNode_Registry_Property(childID, CM_DRP_CLASSGUID, NULL, &childGuid, &childGuidSize, 0); + status = CM_Get_DevNode_Registry_PropertyW(childID, CM_DRP_CLASSGUID, NULL, &childGuid, &childGuidSize, 0); if (status != CR_SUCCESS) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loaderGetRegistryFiles: unable to obtain GUID for:%d error:%d", childID, status); + "loaderGetDeviceRegistryFiles: unable to obtain GUID for:%d error:%d", childID, status); result = VK_ERROR_INITIALIZATION_FAILED; continue; } - if (strcmp(childGuid, softwareComponentGUID) != 0) { + if (wcscmp(childGuid, softwareComponentGUID) != 0) { loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, - "loaderGetRegistryFiles: GUID for %d is not SoftwareComponent skipping", childID); + "loaderGetDeviceRegistryFiles: GUID for %d is not SoftwareComponent skipping", childID); continue; } @@ -708,6 +778,7 @@ if (NULL == *reg_data) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loaderGetRegistryFiles: Failed to allocate space for registry data for key %s", name); + RegCloseKey(key); result = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; } @@ -720,6 +791,7 @@ inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loaderGetRegistryFiles: Failed to reallocate space for registry value of size %d for key %s", *reg_data_size * 2, name); + RegCloseKey(key); result = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; } @@ -730,14 +802,41 @@ inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, "Located json file \"%s\" from registry \"%s\\%s\"", name, hive == DEFAULT_VK_REGISTRY_HIVE ? DEFAULT_VK_REGISTRY_HIVE_STR : SECONDARY_VK_REGISTRY_HIVE_STR, location); if (strlen(*reg_data) == 0) { + // The list is emtpy. Add the first entry. (void)snprintf(*reg_data, name_size + 1, "%s", name); + found = true; } else { - (void)snprintf(*reg_data + strlen(*reg_data), name_size + 2, "%c%s", PATH_SEPARATOR, name); + // At this point the reg_data variable contains other JSON paths, likely from the PNP/device section + // of the registry that we want to have precendence over this non-device specific section of the registry. + // To make sure we avoid enumerating old JSON files/drivers that might be present in the non-device specific + // area of the registry when a newer device specific JSON file is present, do a check before adding. + // Find the file name, without path, of the JSON file found in the non-device specific registry location. + // If the same JSON file name is already found in the list, don't add it again. + bool foundDuplicate = false; + char *pLastSlashName = strrchr(name, '\\'); + if (pLastSlashName != NULL) { + char *foundMatch = strstr(*reg_data, pLastSlashName + 1); + if (foundMatch != NULL) { + foundDuplicate = true; + } + } + + if (foundDuplicate == false) { + // Add the new entry to the list. + (void)snprintf(*reg_data + strlen(*reg_data), name_size + 2, "%c%s", PATH_SEPARATOR, name); + found = true; + } else { + loader_log( + inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "Skipping adding of json file \"%s\" from registry \"%s\\%s\" to the list due to duplication", name, + hive == DEFAULT_VK_REGISTRY_HIVE ? DEFAULT_VK_REGISTRY_HIVE_STR : SECONDARY_VK_REGISTRY_HIVE_STR, + location); + } } - found = true; } name_size = 2048; } + RegCloseKey(key); } // Advance the location - if the next location is in the secondary hive, then reset the locations and advance the hive @@ -901,8 +1000,9 @@ // Remove all layer properties entries from the list void loader_delete_layer_properties(const struct loader_instance *inst, struct loader_layer_list *layer_list) { - uint32_t i, j; + uint32_t i, j, k; struct loader_device_extension_list *dev_ext_list; + struct loader_dev_ext_props *ext_props; if (!layer_list) return; for (i = 0; i < layer_list->count; i++) { @@ -912,11 +1012,16 @@ } loader_destroy_generic_list(inst, (struct loader_generic_list *)&layer_list->list[i].instance_extension_list); dev_ext_list = &layer_list->list[i].device_extension_list; - if (dev_ext_list->capacity > 0 && NULL != dev_ext_list->list && dev_ext_list->list->entrypoint_count > 0) { - for (j = 0; j < dev_ext_list->list->entrypoint_count; j++) { - loader_instance_heap_free(inst, dev_ext_list->list->entrypoints[j]); + if (dev_ext_list->capacity > 0 && NULL != dev_ext_list->list) { + for (j = 0; j < dev_ext_list->count; j++) { + ext_props = &dev_ext_list->list[j]; + if (ext_props->entrypoint_count > 0) { + for (k = 0; k < ext_props->entrypoint_count; k++) { + loader_instance_heap_free(inst, ext_props->entrypoints[k]); + } + loader_instance_heap_free(inst, ext_props->entrypoints); + } } - loader_instance_heap_free(inst, dev_ext_list->list->entrypoints); } loader_destroy_generic_list(inst, (struct loader_generic_list *)dev_ext_list); } @@ -1336,6 +1441,23 @@ struct loader_layer_list *target_list, struct loader_layer_list *expanded_target_list, const struct loader_layer_list *source_list) { bool enable = loader_is_implicit_layer_enabled(inst, prop); + + // If the implicit layer is supposed to be enable, make sure the layer supports at least the same API version + // that the application is asking (i.e. layer's API >= app's API). If it's not, disable this layer. + if (enable) { + uint16_t layer_api_major_version = VK_VERSION_MAJOR(prop->info.specVersion); + uint16_t layer_api_minor_version = VK_VERSION_MINOR(prop->info.specVersion); + if (inst->app_api_major_version > layer_api_major_version || + (inst->app_api_major_version == layer_api_major_version && inst->app_api_minor_version > layer_api_minor_version)) { + loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "loader_add_implicit_layer: Disabling implicit layer %s for using an old API version %d.%d versus " + "application requested %d.%d", + prop->info.layerName, layer_api_major_version, layer_api_minor_version, inst->app_api_major_version, + inst->app_api_minor_version); + enable = false; + } + } + if (enable) { if (0 == (prop->type_flags & VK_LAYER_TYPE_FLAG_META_LAYER)) { if (NULL != target_list && !has_vk_layer_property(&prop->info, target_list)) { @@ -1515,7 +1637,7 @@ }; // Traverse loader's extensions, adding non-duplicate extensions to the list - debug_report_add_instance_extensions(inst, inst_exts); + debug_utils_AddInstanceExtensions(inst, inst_exts); out: return res; @@ -1917,6 +2039,12 @@ char **filename_list; }; +void loader_release() { + // release mutexs + loader_platform_thread_delete_mutex(&loader_lock); + loader_platform_thread_delete_mutex(&loader_json_lock); +} + // Get next file or dirname given a string list or registry key path // // \returns @@ -2299,6 +2427,28 @@ uint16_t patch; } layer_json_version; +static inline bool is_valid_layer_json_version(const layer_json_version *layer_json) { + // Supported versions are: 1.0.0, 1.0.1, 1.1.0, 1.1.1, and 1.1.2. + if ((layer_json->major == 1 && layer_json->minor == 1 && layer_json->patch < 3) || + (layer_json->major == 1 && layer_json->minor == 0 && layer_json->patch < 2)) { + return true; + } + return false; +} + +static inline bool layer_json_supports_layers_tag(const layer_json_version *layer_json) { + // Supported versions started in 1.0.1, so anything newer + if ((layer_json->major > 1 || layer_json->minor > 0 || layer_json->patch > 1)) { + return true; + } + return false; +} + +static inline bool layer_json_supports_pre_instance_tag(const layer_json_version *layer_json) { + // Supported versions started in 1.1.2, so anything newer + return layer_json->major > 1 || layer_json->minor > 1 || (layer_json->minor == 1 && layer_json->patch > 1); +} + static VkResult loader_read_json_layer(const struct loader_instance *inst, struct loader_layer_list *layer_instance_list, cJSON *layer_node, layer_json_version version, cJSON *item, cJSON *disable_environment, bool is_implicit, char *filename) { @@ -2559,12 +2709,10 @@ strncpy(props->functions.str_gipa, vkGetInstanceProcAddr, sizeof(props->functions.str_gipa)); if (version.major > 1 || version.minor >= 1) { loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "Indicating layer-specific vkGetInstanceProcAddr " - "function is deprecated starting with JSON file " - "version 1.1.0. Instead, use the new " - "vkNegotiateLayerInterfaceVersion function to " - "return the GetInstanceProcAddr function for this" - "layer"); + "Layer \"%s\" using deprecated \'vkGetInstanceProcAddr\' tag which was deprecated starting with JSON " + "file version 1.1.0. Instead, use the new vkNegotiateLayerInterfaceVersion function to return the " + "GetInstanceProcAddr function for this layer.", + name); } } props->functions.str_gipa[sizeof(props->functions.str_gipa) - 1] = '\0'; @@ -2572,12 +2720,10 @@ strncpy(props->functions.str_gdpa, vkGetDeviceProcAddr, sizeof(props->functions.str_gdpa)); if (version.major > 1 || version.minor >= 1) { loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "Indicating layer-specific vkGetDeviceProcAddr " - "function is deprecated starting with JSON file " - "version 1.1.0. Instead, use the new " - "vkNegotiateLayerInterfaceVersion function to " - "return the GetDeviceProcAddr function for this" - "layer"); + "Layer \"%s\" using deprecated \'vkGetDeviceProcAddr\' tag which was deprecated starting with JSON " + "file version 1.1.0. Instead, use the new vkNegotiateLayerInterfaceVersion function to return the " + "GetDeviceProcAddr function for this layer.", + name); } } props->functions.str_gdpa[sizeof(props->functions.str_gdpa) - 1] = '\0'; @@ -2674,6 +2820,49 @@ } } + // Read in the pre-instance stuff + cJSON *pre_instance = cJSON_GetObjectItem(layer_node, "pre_instance_functions"); + if (pre_instance) { + if (!layer_json_supports_pre_instance_tag(&version)) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "Found pre_instance_functions section in layer from \"%s\". " + "This section is only valid in manifest version 1.1.2 or later. The section will be ignored", + filename); + } else if (!is_implicit) { + loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "Found pre_instance_functions section in explicit layer from " + "\"%s\". This section is only valid in implicit layers. The section will be ignored", + filename); + } else { + cJSON *inst_ext_json = cJSON_GetObjectItem(pre_instance, "vkEnumerateInstanceExtensionProperties"); + if (inst_ext_json) { + char *inst_ext_name = cJSON_Print(inst_ext_json); + size_t len = strlen(inst_ext_name) >= MAX_STRING_SIZE ? MAX_STRING_SIZE - 3 : strlen(inst_ext_name) - 2; + strncpy(props->pre_instance_functions.enumerate_instance_extension_properties, inst_ext_name + 1, len); + props->pre_instance_functions.enumerate_instance_extension_properties[len] = '\0'; + cJSON_Free(inst_ext_name); + } + + cJSON *inst_layer_json = cJSON_GetObjectItem(pre_instance, "vkEnumerateInstanceLayerProperties"); + if (inst_layer_json) { + char *inst_layer_name = cJSON_Print(inst_layer_json); + size_t len = strlen(inst_layer_name) >= MAX_STRING_SIZE ? MAX_STRING_SIZE - 3 : strlen(inst_layer_name) - 2; + strncpy(props->pre_instance_functions.enumerate_instance_layer_properties, inst_layer_name + 1, len); + props->pre_instance_functions.enumerate_instance_layer_properties[len] = '\0'; + cJSON_Free(inst_layer_name); + } + + cJSON *inst_version_json = cJSON_GetObjectItem(pre_instance, "vkEnumerateInstanceVersion"); + if (inst_version_json) { + char *inst_version_name = cJSON_Print(inst_version_json); + size_t len = strlen(inst_version_name) >= MAX_STRING_SIZE ? MAX_STRING_SIZE - 3 : strlen(inst_version_name) - 2; + strncpy(props->pre_instance_functions.enumerate_instance_version, inst_version_name + 1, len); + props->pre_instance_functions.enumerate_instance_version[len] = '\0'; + cJSON_Free(inst_version_name); + } + } + } + result = VK_SUCCESS; out: @@ -2692,23 +2881,6 @@ return result; } -static inline bool is_valid_layer_json_version(const layer_json_version *layer_json) { - // Supported versions are: 1.0.0, 1.0.1, and 1.1.0. - if ((layer_json->major == 1 && layer_json->minor == 1 && layer_json->patch < 2) || - (layer_json->major == 1 && layer_json->minor == 0 && layer_json->patch < 2)) { - return true; - } - return false; -} - -static inline bool layer_json_supports_layers_tag(const layer_json_version *layer_json) { - // Supported versions started in 1.0.1, so anything newer - if ((layer_json->major > 1 || layer_json->minor > 0 || layer_json->patch > 1)) { - return true; - } - return false; -} - // Given a cJSON struct (json) of the top level JSON object from layer manifest // file, add entry to the layer_list. Fill out the layer_properties in this list // entry from the input cJSON object. @@ -2882,7 +3054,6 @@ override = override_getenv = loader_secure_getenv(env_override, inst); } } - #if !defined(_WIN32) if (relative_location == NULL) { #else @@ -2922,6 +3093,10 @@ #if defined(EXTRASYSCONFDIR) loc_size += strlen(EXTRASYSCONFDIR) + rel_size + 1; #endif +#if defined(__APPLE__) + // For bundle path + loc_size += MAXPATHLEN; +#endif #else loc_size += strlen(location) + 1; #endif @@ -2939,6 +3114,23 @@ const char *loc_read; size_t start, stop; +#if defined(__APPLE__) + // Add the bundle's Resources dir to the beginning of the search path. + // Looks for manifests in the bundle first, before any system directories. + CFBundleRef main_bundle = CFBundleGetMainBundle(); + if (NULL != main_bundle) { + CFURLRef ref = CFBundleCopyResourcesDirectoryURL(main_bundle); + if (NULL != ref) { + if (CFURLGetFileSystemRepresentation(ref, TRUE, (UInt8 *)loc_write, loc_size)) { + loc_write += strlen(loc_write); + memcpy(loc_write, relative_location, rel_size); + loc_write += rel_size; + *loc_write++ = PATH_SEPARATOR; + } + CFRelease(ref); + } + } +#endif loc_read = &xdgconfdirs[0]; start = 0; while (loc_read[start] != '\0') { @@ -3008,6 +3200,7 @@ DWORD reg_size = 4096; + // These calls look at the PNP/Device section of the registry. if (!strncmp(loc, DEFAULT_VK_DRIVERS_INFO, sizeof(DEFAULT_VK_DRIVERS_INFO))) { regHKR_result = loaderGetDeviceRegistryFiles(inst, ®, ®_size, LoaderPnpDriverRegistry()); } else if (!strncmp(loc, DEFAULT_VK_ELAYERS_INFO, sizeof(DEFAULT_VK_ELAYERS_INFO))) { @@ -3016,6 +3209,7 @@ regHKR_result = loaderGetDeviceRegistryFiles(inst, ®, ®_size, LoaderPnpILayerRegistry()); } + // This call looks into the Khronos non-device specific section of the registry. VkResult reg_result = loaderGetRegistryFiles(inst, loc, is_layer, ®, ®_size); if ((VK_SUCCESS != reg_result && VK_SUCCESS != regHKR_result) || NULL == reg) { @@ -3576,7 +3770,8 @@ VkResult local_res = loader_add_layer_properties(inst, instance_layers, json, (implicit == 1), file_str); cJSON_Delete(json); - if (VK_SUCCESS != local_res) { + // If the error is anything other than out of memory we still want to try to load the other layers + if (VK_ERROR_OUT_OF_HOST_MEMORY == local_res) { goto out; } } @@ -3793,7 +3988,7 @@ // object before passing the appropriate info along to the ICD. // This is why we also have to override the direct ICD call to // vkGetDeviceProcAddr to intercept those calls. - PFN_vkVoidFunction addr = get_extension_device_proc_terminator(pName); + PFN_vkVoidFunction addr = get_extension_device_proc_terminator(dev, pName); if (NULL != addr) { return addr; } @@ -4294,7 +4489,7 @@ // Get the layer name(s) from the env_name environment variable. If layer is found in // search_list then add it to layer_list. But only add it to layer_list if type_flags matches. -static void loader_add_env_layers(struct loader_instance *inst, const enum layer_type_flags type_flags, const char *env_name, +static void loader_add_env_layers(const struct loader_instance *inst, const enum layer_type_flags type_flags, const char *env_name, struct loader_layer_list *target_list, struct loader_layer_list *expanded_target_list, const struct loader_layer_list *source_list) { char *next, *name; @@ -4326,6 +4521,10 @@ VkResult loader_enable_instance_layers(struct loader_instance *inst, const VkInstanceCreateInfo *pCreateInfo, const struct loader_layer_list *instance_layers) { VkResult err; + uint16_t layer_api_major_version; + uint16_t layer_api_minor_version; + uint32_t i; + struct loader_layer_properties *prop; assert(inst && "Cannot have null instance"); @@ -4347,13 +4546,29 @@ loader_add_implicit_layers(inst, &inst->app_activated_layer_list, &inst->expanded_activated_layer_list, instance_layers); // Add any layers specified via environment variable next - loader_add_env_layers(inst, VK_LAYER_TYPE_FLAG_EXPLICIT_LAYER, "VK_INSTANCE_LAYERS", &inst->app_activated_layer_list, + loader_add_env_layers(inst, VK_LAYER_TYPE_FLAG_EXPLICIT_LAYER, ENABLED_LAYERS_ENV, &inst->app_activated_layer_list, &inst->expanded_activated_layer_list, instance_layers); // Add layers specified by the application err = loader_add_layer_names_to_list(inst, &inst->app_activated_layer_list, &inst->expanded_activated_layer_list, pCreateInfo->enabledLayerCount, pCreateInfo->ppEnabledLayerNames, instance_layers); + for (i = 0; i < inst->expanded_activated_layer_list.count; i++) { + // Verify that the layer api version is at least that of the application's request, if not, throw a warning since + // undefined behavior could occur. + prop = inst->expanded_activated_layer_list.list + i; + layer_api_major_version = VK_VERSION_MAJOR(prop->info.specVersion); + layer_api_minor_version = VK_VERSION_MINOR(prop->info.specVersion); + if (inst->app_api_major_version > layer_api_major_version || + (inst->app_api_major_version == layer_api_major_version && inst->app_api_minor_version > layer_api_minor_version)) { + loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "loader_add_to_layer_list: Explicit layer %s is using an old API version %" PRIu16 ".%" PRIu16 + " versus application requested %" PRIu16 ".%" PRIu16, + prop->info.layerName, layer_api_major_version, layer_api_minor_version, inst->app_api_major_version, + inst->app_api_minor_version); + } + } + return err; } @@ -4571,23 +4786,23 @@ memcpy(&loader_create_info, pCreateInfo, sizeof(VkDeviceCreateInfo)); - // Before we continue, we need to find out if the KHX_device_group extension is in the enabled list. If it is, we then - // need to look for the corresponding VkDeviceGroupDeviceCreateInfoKHX struct in the device list. This is because we + // Before we continue, we need to find out if the KHR_device_group extension is in the enabled list. If it is, we then + // need to look for the corresponding VkDeviceGroupDeviceCreateInfoKHR struct in the device list. This is because we // need to replace all the incoming physical device values (which are really loader trampoline physical device values) // with the layer/ICD version. - if (inst->enabled_known_extensions.khx_device_group_creation == 1) { + { struct VkStructureHeader *pNext = (struct VkStructureHeader *)loader_create_info.pNext; struct VkStructureHeader *pPrev = (struct VkStructureHeader *)&loader_create_info; while (NULL != pNext) { - if (VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX == pNext->sType) { - VkDeviceGroupDeviceCreateInfoKHX *cur_struct = (VkDeviceGroupDeviceCreateInfoKHX *)pNext; + if (VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO == pNext->sType) { + VkDeviceGroupDeviceCreateInfoKHR *cur_struct = (VkDeviceGroupDeviceCreateInfoKHR *)pNext; if (0 < cur_struct->physicalDeviceCount && NULL != cur_struct->pPhysicalDevices) { - VkDeviceGroupDeviceCreateInfoKHX *temp_struct = loader_stack_alloc(sizeof(VkDeviceGroupDeviceCreateInfoKHX)); + VkDeviceGroupDeviceCreateInfoKHR *temp_struct = loader_stack_alloc(sizeof(VkDeviceGroupDeviceCreateInfoKHR)); VkPhysicalDevice *phys_dev_array = NULL; if (NULL == temp_struct) { return VK_ERROR_OUT_OF_HOST_MEMORY; } - memcpy(temp_struct, cur_struct, sizeof(VkDeviceGroupDeviceCreateInfoKHX)); + memcpy(temp_struct, cur_struct, sizeof(VkDeviceGroupDeviceCreateInfoKHR)); phys_dev_array = loader_stack_alloc(sizeof(VkPhysicalDevice) * cur_struct->physicalDeviceCount); if (NULL == phys_dev_array) { return VK_ERROR_OUT_OF_HOST_MEMORY; @@ -4779,9 +4994,32 @@ const struct loader_layer_list *instance_layers, const VkInstanceCreateInfo *pCreateInfo) { VkExtensionProperties *extension_prop; - struct loader_layer_properties *layer_prop; char *env_value; bool check_if_known = true; + VkResult res = VK_SUCCESS; + + struct loader_layer_list active_layers; + struct loader_layer_list expanded_layers; + memset(&active_layers, 0, sizeof(active_layers)); + memset(&expanded_layers, 0, sizeof(expanded_layers)); + if (!loader_init_layer_list(inst, &active_layers)) { + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + if (!loader_init_layer_list(inst, &expanded_layers)) { + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + + // Build the lists of active layers (including metalayers) and expanded layers (with metalayers resolved to their components) + loader_add_implicit_layers(inst, &active_layers, &expanded_layers, instance_layers); + loader_add_env_layers(inst, VK_LAYER_TYPE_FLAG_EXPLICIT_LAYER, ENABLED_LAYERS_ENV, &active_layers, &expanded_layers, + instance_layers); + res = loader_add_layer_names_to_list(inst, &active_layers, &expanded_layers, pCreateInfo->enabledLayerCount, + pCreateInfo->ppEnabledLayerNames, instance_layers); + if (VK_SUCCESS != res) { + goto out; + } for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { VkStringErrorFlags result = vk_string_validate(MaxLoaderStringLength, pCreateInfo->ppEnabledExtensionNames[i]); @@ -4789,7 +5027,8 @@ loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_validate_instance_extensions: Instance ppEnabledExtensionNames contains " "string that is too long or is badly formed"); - return VK_ERROR_EXTENSION_NOT_PRESENT; + res = VK_ERROR_EXTENSION_NOT_PRESENT; + goto out; } // Check if a user wants to disable the instance extension filtering behavior @@ -4814,7 +5053,8 @@ loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_validate_instance_extensions: Extension %s not found in list of known instance extensions.", pCreateInfo->ppEnabledExtensionNames[i]); - return VK_ERROR_EXTENSION_NOT_PRESENT; + res = VK_ERROR_EXTENSION_NOT_PRESENT; + goto out; } } @@ -4826,19 +5066,10 @@ extension_prop = NULL; - // Not in global list, search layer extension lists - for (uint32_t j = 0; j < pCreateInfo->enabledLayerCount; j++) { - layer_prop = loader_get_layer_property(pCreateInfo->ppEnabledLayerNames[j], instance_layers); - if (NULL == layer_prop) { - // Should NOT get here, loader_validate_layers should have already filtered this case out. - continue; - } - - extension_prop = get_extension_property(pCreateInfo->ppEnabledExtensionNames[i], &layer_prop->instance_extension_list); - if (extension_prop) { - // Found the extension in one of the layers enabled by the app. - break; - } + // Not in global list, search expanded layer extension list + for (uint32_t j = 0; NULL == extension_prop && j < expanded_layers.count; ++j) { + extension_prop = + get_extension_property(pCreateInfo->ppEnabledExtensionNames[i], &expanded_layers.list[j].instance_extension_list); } if (!extension_prop) { @@ -4847,10 +5078,15 @@ "loader_validate_instance_extensions: Instance extension %s not supported by available ICDs or enabled " "layers.", pCreateInfo->ppEnabledExtensionNames[i]); - return VK_ERROR_EXTENSION_NOT_PRESENT; + res = VK_ERROR_EXTENSION_NOT_PRESENT; + goto out; } } - return VK_SUCCESS; + +out: + loader_destroy_layer_list(inst, NULL, &active_layers); + loader_destroy_layer_list(inst, NULL, &expanded_layers); + return res; } VkResult loader_validate_device_extensions(struct loader_physical_device_tramp *phys_dev, @@ -4941,6 +5177,8 @@ // If any error happens after here, we need to remove the ICD from the list, // because we've already added it, but haven't validated it + // Make sure that we reset the pApplicationInfo so we don't get an old pointer + icd_create_info.pApplicationInfo = pCreateInfo->pApplicationInfo; icd_create_info.enabledExtensionCount = 0; struct loader_extension_list icd_exts; @@ -4985,8 +5223,35 @@ loader_destroy_generic_list(ptr_instance, (struct loader_generic_list *)&icd_exts); - VkResult icd_result = - ptr_instance->icd_tramp_list.scanned_list[i].CreateInstance(&icd_create_info, pAllocator, &(icd_term->instance)); + // Get the driver version from vkEnumerateInstanceVersion + uint32_t icd_version = VK_API_VERSION_1_0; + PFN_vkEnumerateInstanceVersion icd_enumerate_instance_version = (PFN_vkEnumerateInstanceVersion) + icd_term->scanned_icd->GetInstanceProcAddr(NULL, "vkEnumerateInstanceVersion"); + VkResult icd_result = VK_SUCCESS; + if (icd_enumerate_instance_version != NULL) { + icd_result = icd_enumerate_instance_version(&icd_version); + if (icd_result != VK_SUCCESS) { + icd_version = VK_API_VERSION_1_0; + loader_log(ptr_instance, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, "terminator_CreateInstance: ICD \"%s\" " + "vkEnumerateInstanceVersion returned error. The ICD will be treated as a 1.0 ICD", + icd_term->scanned_icd->lib_name); + } + } + + // Create an instance, substituting the version to 1.0 if necessary + VkApplicationInfo icd_app_info; + uint32_t icd_version_nopatch = VK_MAKE_VERSION(VK_VERSION_MAJOR(icd_version), VK_VERSION_MINOR(icd_version), 0); + uint32_t requested_version = pCreateInfo == NULL || pCreateInfo->pApplicationInfo == NULL ? VK_API_VERSION_1_0 : pCreateInfo->pApplicationInfo->apiVersion; + if ((requested_version != 0) && (icd_version_nopatch == VK_API_VERSION_1_0)) { + if (icd_create_info.pApplicationInfo == NULL) { + memset(&icd_app_info, 0, sizeof(icd_app_info)); + } else { + memcpy(&icd_app_info, icd_create_info.pApplicationInfo, sizeof(icd_app_info)); + } + icd_app_info.apiVersion = icd_version; + icd_create_info.pApplicationInfo = &icd_app_info; + } + icd_result = ptr_instance->icd_tramp_list.scanned_list[i].CreateInstance(&icd_create_info, pAllocator, &(icd_term->instance)); if (VK_ERROR_OUT_OF_HOST_MEMORY == icd_result) { // If out of memory, bail immediately. res = VK_ERROR_OUT_OF_HOST_MEMORY; @@ -5104,6 +5369,9 @@ PFN_vkCreateDevice fpCreateDevice = icd_term->dispatch.CreateDevice; struct loader_extension_list icd_exts; + struct VkStructureHeader *caller_dgci_container = NULL; + VkDeviceGroupDeviceCreateInfoKHR *caller_dgci = NULL; + dev->phys_dev_term = phys_dev_term; icd_exts.list = NULL; @@ -5160,7 +5428,7 @@ filtered_extension_names[localCreateInfo.enabledExtensionCount] = (char *)extension_name; localCreateInfo.enabledExtensionCount++; } else { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, "vkCreateDevice extension %s not available for " "devices associated with ICD %s", extension_name, icd_term->scanned_icd->lib_name); @@ -5168,21 +5436,22 @@ } // Before we continue, If KHX_device_group is the list of enabled and viable extensions, then we then need to look for the - // corresponding VkDeviceGroupDeviceCreateInfoKHX struct in the device list and replace all the physical device values (which + // corresponding VkDeviceGroupDeviceCreateInfo struct in the device list and replace all the physical device values (which // are really loader physical device terminator values) with the ICD versions. - if (icd_term->this_instance->enabled_known_extensions.khx_device_group_creation == 1) { + //if (icd_term->this_instance->enabled_known_extensions.khr_device_group_creation == 1) { + { struct VkStructureHeader *pNext = (struct VkStructureHeader *)localCreateInfo.pNext; struct VkStructureHeader *pPrev = (struct VkStructureHeader *)&localCreateInfo; while (NULL != pNext) { - if (VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX == pNext->sType) { - VkDeviceGroupDeviceCreateInfoKHX *cur_struct = (VkDeviceGroupDeviceCreateInfoKHX *)pNext; + if (VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO == pNext->sType) { + VkDeviceGroupDeviceCreateInfo *cur_struct = (VkDeviceGroupDeviceCreateInfo *)pNext; if (0 < cur_struct->physicalDeviceCount && NULL != cur_struct->pPhysicalDevices) { - VkDeviceGroupDeviceCreateInfoKHX *temp_struct = loader_stack_alloc(sizeof(VkDeviceGroupDeviceCreateInfoKHX)); + VkDeviceGroupDeviceCreateInfo *temp_struct = loader_stack_alloc(sizeof(VkDeviceGroupDeviceCreateInfo)); VkPhysicalDevice *phys_dev_array = NULL; if (NULL == temp_struct) { return VK_ERROR_OUT_OF_HOST_MEMORY; } - memcpy(temp_struct, cur_struct, sizeof(VkDeviceGroupDeviceCreateInfoKHX)); + memcpy(temp_struct, cur_struct, sizeof(VkDeviceGroupDeviceCreateInfo)); phys_dev_array = loader_stack_alloc(sizeof(VkPhysicalDevice) * cur_struct->physicalDeviceCount); if (NULL == phys_dev_array) { return VK_ERROR_OUT_OF_HOST_MEMORY; @@ -5197,6 +5466,10 @@ } temp_struct->pPhysicalDevices = phys_dev_array; + // Keep track of pointers to restore pNext chain before returning + caller_dgci_container = pPrev; + caller_dgci = cur_struct; + // Replace the old struct in the pNext chain with this one. pPrev->pNext = (const void *)temp_struct; pNext = (struct VkStructureHeader *)(temp_struct); @@ -5214,19 +5487,23 @@ // are not recognized by the ICD. If this causes the ICD to fail, then the items would have to be removed here. The current // implementation does not remove them because copying the pNext chain would be impossible if the loader does not recognize // the any of the struct types, as the loader would not know the size to allocate and copy. - if (icd_term->dispatch.GetPhysicalDeviceFeatures2KHR == NULL) { + //if (icd_term->dispatch.GetPhysicalDeviceFeatures2 == NULL && icd_term->dispatch.GetPhysicalDeviceFeatures2KHR == NULL) { + { const void *pNext = localCreateInfo.pNext; while (pNext != NULL) { switch (*(VkStructureType *)pNext) { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR: { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "vkCreateDevice: Emulating handling of VkPhysicalDeviceFeatures2KHR in pNext chain for ICD \"%s\"", - icd_term->scanned_icd->lib_name); + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: { const VkPhysicalDeviceFeatures2KHR *features = pNext; - // Verify that VK_KHR_get_physical_device_properties2 is enabled - if (icd_term->this_instance->enabled_known_extensions.khr_get_physical_device_properties2) { - localCreateInfo.pEnabledFeatures = &features->features; + if (icd_term->dispatch.GetPhysicalDeviceFeatures2 == NULL && icd_term->dispatch.GetPhysicalDeviceFeatures2KHR == NULL) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "vkCreateDevice: Emulating handling of VkPhysicalDeviceFeatures2 in pNext chain for ICD \"%s\"", + icd_term->scanned_icd->lib_name); + + // Verify that VK_KHR_get_physical_device_properties2 is enabled + if (icd_term->this_instance->enabled_known_extensions.khr_get_physical_device_properties2) { + localCreateInfo.pEnabledFeatures = &features->features; + } } // Leave this item in the pNext chain for now @@ -5235,19 +5512,22 @@ break; } - case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX: { - loader_log( - icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "vkCreateDevice: Emulating handling of VkDeviceGroupDeviceCreateInfoKHX in pNext chain for ICD \"%s\"", - icd_term->scanned_icd->lib_name); - const VkDeviceGroupDeviceCreateInfoKHX *group_info = pNext; - - // The group must contain only this one device, since physical device groups aren't actually supported - if (group_info->physicalDeviceCount != 1 || group_info->pPhysicalDevices[0] != physicalDevice) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: { + const VkDeviceGroupDeviceCreateInfoKHR *group_info = pNext; + + if (icd_term->dispatch.EnumeratePhysicalDeviceGroups == NULL && icd_term->dispatch.EnumeratePhysicalDeviceGroupsKHR == NULL) { + loader_log( + icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "vkCreateDevice: Emulating handling of VkPhysicalDeviceGroupProperties in pNext chain for ICD \"%s\"", + icd_term->scanned_icd->lib_name); + + // The group must contain only this one device, since physical device groups aren't actually supported + if (group_info->physicalDeviceCount != 1) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "vkCreateDevice: Emulation failed to create device from device group info"); - res = VK_ERROR_INITIALIZATION_FAILED; - goto out; + res = VK_ERROR_INITIALIZATION_FAILED; + goto out; + } } // Nothing needs to be done here because we're leaving the item in the pNext chain and because the spec states @@ -5268,6 +5548,19 @@ } } + // Every extension that has a loader-defined terminator needs to be marked as enabled or disabled so that we know whether or + // not to return that terminator when vkGetDeviceProcAddr is called + for (uint32_t i = 0; i < localCreateInfo.enabledExtensionCount; ++i) { + if (!strcmp(localCreateInfo.ppEnabledExtensionNames[i], VK_KHR_SWAPCHAIN_EXTENSION_NAME)) { + dev->extensions.khr_swapchain_enabled = true; + } else if (!strcmp(localCreateInfo.ppEnabledExtensionNames[i], VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME)) { + dev->extensions.khr_display_swapchain_enabled = true; + } else if (!strcmp(localCreateInfo.ppEnabledExtensionNames[i], VK_EXT_DEBUG_MARKER_EXTENSION_NAME)) { + dev->extensions.ext_debug_marker_enabled = true; + } + dev->extensions.ext_debug_utils_enabled = icd_term->this_instance->enabled_known_extensions.ext_debug_utils; + } + res = fpCreateDevice(phys_dev_term->phys_dev, &localCreateInfo, pAllocator, &dev->icd_device); if (res != VK_SUCCESS) { loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, @@ -5288,6 +5581,12 @@ loader_destroy_generic_list(icd_term->this_instance, (struct loader_generic_list *)&icd_exts); } + // Restore pNext pointer to old VkDeviceGroupDeviceCreateInfoKHX + // in the chain to maintain consistency for the caller. + if (caller_dgci_container != NULL) { + caller_dgci_container->pNext = caller_dgci; + } + return res; } @@ -5826,3 +6125,907 @@ } return result; } + +VKAPI_ATTR VkResult VKAPI_CALL +terminator_EnumerateInstanceVersion(const VkEnumerateInstanceVersionChain *chain, uint32_t* pApiVersion) { + // NOTE: The Vulkan WG doesn't want us checking pApiVersion for NULL, but instead + // prefers us crashing. + *pApiVersion = VK_MAKE_VERSION(loader_major_version, loader_minor_version, 0); + return VK_SUCCESS; +} + +VKAPI_ATTR VkResult VKAPI_CALL +terminator_EnumerateInstanceExtensionProperties(const VkEnumerateInstanceExtensionPropertiesChain *chain, const char *pLayerName, + uint32_t *pPropertyCount, VkExtensionProperties *pProperties) { + struct loader_extension_list *global_ext_list = NULL; + struct loader_layer_list instance_layers; + struct loader_extension_list local_ext_list; + struct loader_icd_tramp_list icd_tramp_list; + uint32_t copy_size; + VkResult res = VK_SUCCESS; + + // tls_instance = NULL; + memset(&local_ext_list, 0, sizeof(local_ext_list)); + memset(&instance_layers, 0, sizeof(instance_layers)); + + // Get layer libraries if needed + if (pLayerName && strlen(pLayerName) != 0) { + if (vk_string_validate(MaxLoaderStringLength, pLayerName) != VK_STRING_ERROR_NONE) { + assert(VK_FALSE && + "vkEnumerateInstanceExtensionProperties: " + "pLayerName is too long or is badly formed"); + res = VK_ERROR_EXTENSION_NOT_PRESENT; + goto out; + } + + loader_layer_scan(NULL, &instance_layers); + for (uint32_t i = 0; i < instance_layers.count; i++) { + struct loader_layer_properties *props = &instance_layers.list[i]; + if (strcmp(props->info.layerName, pLayerName) == 0) { + global_ext_list = &props->instance_extension_list; + break; + } + } + } else { + // Scan/discover all ICD libraries + memset(&icd_tramp_list, 0, sizeof(icd_tramp_list)); + res = loader_icd_scan(NULL, &icd_tramp_list); + if (VK_SUCCESS != res) { + goto out; + } + // Get extensions from all ICD's, merge so no duplicates + res = loader_get_icd_loader_instance_extensions(NULL, &icd_tramp_list, &local_ext_list); + if (VK_SUCCESS != res) { + goto out; + } + loader_scanned_icd_clear(NULL, &icd_tramp_list); + + // Append enabled implicit layers. + loader_implicit_layer_scan(NULL, &instance_layers); + for (uint32_t i = 0; i < instance_layers.count; i++) { + if (!loader_is_implicit_layer_enabled(NULL, &instance_layers.list[i])) { + continue; + } + struct loader_extension_list *ext_list = &instance_layers.list[i].instance_extension_list; + loader_add_to_ext_list(NULL, &local_ext_list, ext_list->count, ext_list->list); + } + + global_ext_list = &local_ext_list; + } + + if (global_ext_list == NULL) { + res = VK_ERROR_LAYER_NOT_PRESENT; + goto out; + } + + if (pProperties == NULL) { + *pPropertyCount = global_ext_list->count; + goto out; + } + + copy_size = *pPropertyCount < global_ext_list->count ? *pPropertyCount : global_ext_list->count; + for (uint32_t i = 0; i < copy_size; i++) { + memcpy(&pProperties[i], &global_ext_list->list[i], sizeof(VkExtensionProperties)); + } + *pPropertyCount = copy_size; + + if (copy_size < global_ext_list->count) { + res = VK_INCOMPLETE; + goto out; + } + +out: + + loader_destroy_generic_list(NULL, (struct loader_generic_list *)&local_ext_list); + loader_delete_layer_properties(NULL, &instance_layers); + return res; +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateInstanceLayerProperties(const VkEnumerateInstanceLayerPropertiesChain *chain, + uint32_t *pPropertyCount, + VkLayerProperties *pProperties) { + VkResult result = VK_SUCCESS; + struct loader_layer_list instance_layer_list; + tls_instance = NULL; + + LOADER_PLATFORM_THREAD_ONCE(&once_init, loader_initialize); + + uint32_t copy_size; + + // Get layer libraries + memset(&instance_layer_list, 0, sizeof(instance_layer_list)); + loader_layer_scan(NULL, &instance_layer_list); + + if (pProperties == NULL) { + *pPropertyCount = instance_layer_list.count; + goto out; + } + + copy_size = (*pPropertyCount < instance_layer_list.count) ? *pPropertyCount : instance_layer_list.count; + for (uint32_t i = 0; i < copy_size; i++) { + memcpy(&pProperties[i], &instance_layer_list.list[i].info, sizeof(VkLayerProperties)); + } + + *pPropertyCount = copy_size; + + if (copy_size < instance_layer_list.count) { + result = VK_INCOMPLETE; + goto out; + } + +out: + + loader_delete_layer_properties(NULL, &instance_layer_list); + return result; +} + +#if defined(_WIN32) && defined(LOADER_DYNAMIC_LIB) +BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) { + switch (reason) { + case DLL_PROCESS_ATTACH: + loader_initialize(); + break; + case DLL_PROCESS_DETACH: + if (NULL == reserved) { + loader_release(); + } + break; + default: + // Do nothing + break; + } + return TRUE; +} +#elif !defined(_WIN32) +__attribute__((constructor)) void loader_init_library() { loader_initialize(); } + +__attribute__((destructor)) void loader_free_library() { loader_release(); } +#endif + +// ---- Vulkan Core 1.1 terminators + +VkResult setupLoaderTermPhysDevGroups(struct loader_instance *inst) { + VkResult res = VK_SUCCESS; + struct loader_icd_term *icd_term; + uint32_t total_count = 0; + uint32_t cur_icd_group_count = 0; + VkPhysicalDeviceGroupPropertiesKHR **new_phys_dev_groups = NULL; + VkPhysicalDeviceGroupPropertiesKHR *local_phys_dev_groups = NULL; + PFN_vkEnumeratePhysicalDeviceGroups fpEnumeratePhysicalDeviceGroups = NULL; + + if (0 == inst->phys_dev_count_term) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Loader failed to setup physical " + "device terminator info before calling \'EnumeratePhysicalDeviceGroups\'."); + assert(false); + res = VK_ERROR_INITIALIZATION_FAILED; + goto out; + } + + // For each ICD, query the number of physical device groups, and then get an + // internal value for those physical devices. + icd_term = inst->icd_terms; + for (uint32_t icd_idx = 0; NULL != icd_term; icd_term = icd_term->next, icd_idx++) { + // Get the function pointer to use to call into the ICD. This could be the core or KHR version + if (inst->enabled_known_extensions.khr_device_group_creation) { + fpEnumeratePhysicalDeviceGroups = icd_term->dispatch.EnumeratePhysicalDeviceGroupsKHR; + } else { + fpEnumeratePhysicalDeviceGroups = icd_term->dispatch.EnumeratePhysicalDeviceGroups; + } + + cur_icd_group_count = 0; + if (NULL == fpEnumeratePhysicalDeviceGroups) { + // Treat each ICD's GPU as it's own group if the extension isn't supported + res = icd_term->dispatch.EnumeratePhysicalDevices(icd_term->instance, &cur_icd_group_count, NULL); + if (res != VK_SUCCESS) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed during dispatch call of " + "\'EnumeratePhysicalDevices\' to ICD %d to get plain phys dev count.", + icd_idx); + goto out; + } + } else { + // Query the actual group info + res = fpEnumeratePhysicalDeviceGroups(icd_term->instance, &cur_icd_group_count, NULL); + if (res != VK_SUCCESS) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed during dispatch call of " + "\'EnumeratePhysicalDeviceGroups\' to ICD %d to get count.", + icd_idx); + goto out; + } + } + total_count += cur_icd_group_count; + } + + // Create an array for the new physical device groups, which will be stored + // in the instance for the Terminator code. + new_phys_dev_groups = (VkPhysicalDeviceGroupProperties **)loader_instance_heap_alloc( + inst, total_count * sizeof(VkPhysicalDeviceGroupProperties *), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if (NULL == new_phys_dev_groups) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed to allocate new physical device" + " group array of size %d", + total_count); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + memset(new_phys_dev_groups, 0, total_count * sizeof(VkPhysicalDeviceGroupProperties *)); + + // Create a temporary array (on the stack) to keep track of the + // returned VkPhysicalDevice values. + local_phys_dev_groups = loader_stack_alloc(sizeof(VkPhysicalDeviceGroupProperties) * total_count); + if (NULL == local_phys_dev_groups) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed to allocate local " + "physical device group array of size %d", + total_count); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + // Initialize the memory to something valid + memset(local_phys_dev_groups, 0, sizeof(VkPhysicalDeviceGroupProperties) * total_count); + for (uint32_t group = 0; group < total_count; group++) { + local_phys_dev_groups[group].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR; + local_phys_dev_groups[group].pNext = NULL; + local_phys_dev_groups[group].subsetAllocation = false; + } + + cur_icd_group_count = 0; + icd_term = inst->icd_terms; + for (uint32_t icd_idx = 0; NULL != icd_term; icd_term = icd_term->next, icd_idx++) { + uint32_t count_this_time = total_count - cur_icd_group_count; + + // Get the function pointer to use to call into the ICD. This could be the core or KHR version + if (inst->enabled_known_extensions.khr_device_group_creation) { + fpEnumeratePhysicalDeviceGroups = icd_term->dispatch.EnumeratePhysicalDeviceGroupsKHR; + } else { + fpEnumeratePhysicalDeviceGroups = icd_term->dispatch.EnumeratePhysicalDeviceGroups; + } + + if (NULL == fpEnumeratePhysicalDeviceGroups) { + VkPhysicalDevice* phys_dev_array = loader_stack_alloc(sizeof(VkPhysicalDevice) * count_this_time); + if (NULL == phys_dev_array) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed to allocate local " + "physical device array of size %d", + count_this_time); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + + res = icd_term->dispatch.EnumeratePhysicalDevices(icd_term->instance, &count_this_time, phys_dev_array); + if (res != VK_SUCCESS) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed during dispatch call of " + "\'EnumeratePhysicalDevices\' to ICD %d to get plain phys dev count.", + icd_idx); + goto out; + } + + // Add each GPU as it's own group + for (uint32_t indiv_gpu = 0; indiv_gpu < count_this_time; indiv_gpu++) { + local_phys_dev_groups[indiv_gpu + cur_icd_group_count].physicalDeviceCount = 1; + local_phys_dev_groups[indiv_gpu + cur_icd_group_count].physicalDevices[0] = phys_dev_array[indiv_gpu]; + } + + } else { + res = fpEnumeratePhysicalDeviceGroups(icd_term->instance, &count_this_time, &local_phys_dev_groups[cur_icd_group_count]); + if (VK_SUCCESS != res) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed during dispatch call of " + "\'EnumeratePhysicalDeviceGroups\' to ICD %d to get content.", + icd_idx); + goto out; + } + } + + cur_icd_group_count += count_this_time; + } + + // Replace all the physical device IDs with the proper loader values + for (uint32_t group = 0; group < total_count; group++) { + for (uint32_t group_gpu = 0; group_gpu < local_phys_dev_groups[group].physicalDeviceCount; group_gpu++) { + bool found = false; + for (uint32_t term_gpu = 0; term_gpu < inst->phys_dev_count_term; term_gpu++) { + if (local_phys_dev_groups[group].physicalDevices[group_gpu] == inst->phys_devs_term[term_gpu]->phys_dev) { + local_phys_dev_groups[group].physicalDevices[group_gpu] = (VkPhysicalDevice)inst->phys_devs_term[term_gpu]; + found = true; + break; + } + } + if (!found) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed to find GPU %d in group %d" + " returned by \'EnumeratePhysicalDeviceGroups\' in list returned" + " by \'EnumeratePhysicalDevices\'", group_gpu, group); + res = VK_ERROR_INITIALIZATION_FAILED; + goto out; + } + } + } + + // Copy or create everything to fill the new array of physical device groups + for (uint32_t new_idx = 0; new_idx < total_count; new_idx++) { + // Check if this physical device group with the same contents is already in the old buffer + for (uint32_t old_idx = 0; old_idx < inst->phys_dev_group_count_term; old_idx++) { + if (local_phys_dev_groups[new_idx].physicalDeviceCount == inst->phys_dev_groups_term[old_idx]->physicalDeviceCount) { + bool found_all_gpus = true; + for (uint32_t old_gpu = 0; old_gpu < inst->phys_dev_groups_term[old_idx]->physicalDeviceCount; old_gpu++) { + bool found_gpu = false; + for (uint32_t new_gpu = 0; new_gpu < local_phys_dev_groups[new_idx].physicalDeviceCount; new_gpu++) { + if (local_phys_dev_groups[new_idx].physicalDevices[new_gpu] == inst->phys_dev_groups_term[old_idx]->physicalDevices[old_gpu]) { + found_gpu = true; + break; + } + } + + if (!found_gpu) { + found_all_gpus = false; + break; + } + } + if (!found_all_gpus) { + continue; + } else { + new_phys_dev_groups[new_idx] = inst->phys_dev_groups_term[old_idx]; + break; + } + } + } + + // If this physical device group isn't in the old buffer, create it + if (NULL == new_phys_dev_groups[new_idx]) { + new_phys_dev_groups[new_idx] = (VkPhysicalDeviceGroupPropertiesKHR *)loader_instance_heap_alloc( + inst, sizeof(VkPhysicalDeviceGroupPropertiesKHR), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if (NULL == new_phys_dev_groups[new_idx]) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed to allocate " + "physical device group Terminator object %d", + new_idx); + total_count = new_idx; + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + memcpy(new_phys_dev_groups[new_idx], &local_phys_dev_groups[new_idx], + sizeof(VkPhysicalDeviceGroupPropertiesKHR)); + } + } + +out: + + if (VK_SUCCESS != res) { + if (NULL != new_phys_dev_groups) { + for (uint32_t i = 0; i < total_count; i++) { + loader_instance_heap_free(inst, new_phys_dev_groups[i]); + } + loader_instance_heap_free(inst, new_phys_dev_groups); + } + total_count = 0; + } else { + // Free everything that didn't carry over to the new array of + // physical device groups + if (NULL != inst->phys_dev_groups_term) { + for (uint32_t i = 0; i < inst->phys_dev_group_count_term; i++) { + bool found = false; + for (uint32_t j = 0; j < total_count; j++) { + if (inst->phys_dev_groups_term[i] == new_phys_dev_groups[j]) { + found = true; + break; + } + } + if (!found) { + loader_instance_heap_free(inst, inst->phys_dev_groups_term[i]); + } + } + loader_instance_heap_free(inst, inst->phys_dev_groups_term); + } + + // Swap in the new physical device group list + inst->phys_dev_group_count_term = total_count; + inst->phys_dev_groups_term = new_phys_dev_groups; + } + + return res; +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDeviceGroups( + VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, + VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties) { + struct loader_instance *inst = (struct loader_instance *)instance; + VkResult res = VK_SUCCESS; + + // Always call the setup loader terminator physical device groups because they may + // have changed at any point. + res = setupLoaderTermPhysDevGroups(inst); + if (VK_SUCCESS != res) { + goto out; + } + + uint32_t copy_count = inst->phys_dev_group_count_term; + if (NULL != pPhysicalDeviceGroupProperties) { + if (copy_count > *pPhysicalDeviceGroupCount) { + copy_count = *pPhysicalDeviceGroupCount; + res = VK_INCOMPLETE; + } + + for (uint32_t i = 0; i < copy_count; i++) { + memcpy(&pPhysicalDeviceGroupProperties[i], inst->phys_dev_groups_term[i], + sizeof(VkPhysicalDeviceGroupPropertiesKHR)); + } + } + + *pPhysicalDeviceGroupCount = copy_count; + +out: + + return res; +} + +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, + VkPhysicalDeviceFeatures2 *pFeatures) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + const struct loader_instance *inst = icd_term->this_instance; + + // Get the function pointer to use to call into the ICD. This could be the core or KHR version + PFN_vkGetPhysicalDeviceFeatures2 fpGetPhysicalDeviceFeatures2 = NULL; + if (inst != NULL && inst->enabled_known_extensions.khr_get_physical_device_properties2) { + fpGetPhysicalDeviceFeatures2 = icd_term->dispatch.GetPhysicalDeviceFeatures2KHR; + } else { + fpGetPhysicalDeviceFeatures2 = icd_term->dispatch.GetPhysicalDeviceFeatures2; + } + + if (fpGetPhysicalDeviceFeatures2 != NULL || !inst->enabled_known_extensions.khr_get_physical_device_properties2) { + // Pass the call to the driver + fpGetPhysicalDeviceFeatures2(phys_dev_term->phys_dev, pFeatures); + } else { + // Emulate the call + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "vkGetPhysicalDeviceFeatures2: Emulating call in ICD \"%s\" using vkGetPhysicalDeviceFeatures", + icd_term->scanned_icd->lib_name); + + // Write to the VkPhysicalDeviceFeatures2 struct + icd_term->dispatch.GetPhysicalDeviceFeatures(phys_dev_term->phys_dev, &pFeatures->features); + + void *pNext = pFeatures->pNext; + while (pNext != NULL) { + switch (*(VkStructureType *)pNext) { + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: { + // Skip the check if VK_KHR_multiview is enabled because it's a device extension + // Write to the VkPhysicalDeviceMultiviewFeaturesKHR struct + VkPhysicalDeviceMultiviewFeaturesKHR *multiview_features = pNext; + multiview_features->multiview = VK_FALSE; + multiview_features->multiviewGeometryShader = VK_FALSE; + multiview_features->multiviewTessellationShader = VK_FALSE; + + pNext = multiview_features->pNext; + break; + } + default: { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceFeatures2: Emulation found unrecognized structure type in pFeatures->pNext - " + "this struct will be ignored"); + + struct VkStructureHeader *header = pNext; + pNext = (void *)header->pNext; + break; + } + } + } + } +} + +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, + VkPhysicalDeviceProperties2 *pProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + const struct loader_instance *inst = icd_term->this_instance; + + // Get the function pointer to use to call into the ICD. This could be the core or KHR version + PFN_vkGetPhysicalDeviceProperties2 fpGetPhysicalDeviceProperties2 = NULL; + if (inst != NULL && inst->enabled_known_extensions.khr_get_physical_device_properties2) { + fpGetPhysicalDeviceProperties2 = icd_term->dispatch.GetPhysicalDeviceProperties2KHR; + } else { + fpGetPhysicalDeviceProperties2 = icd_term->dispatch.GetPhysicalDeviceProperties2; + } + + if (fpGetPhysicalDeviceProperties2 != NULL || !inst->enabled_known_extensions.khr_get_physical_device_properties2) { + // Pass the call to the driver + fpGetPhysicalDeviceProperties2(phys_dev_term->phys_dev, pProperties); + } else { + // Emulate the call + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "vkGetPhysicalDeviceProperties2: Emulating call in ICD \"%s\" using vkGetPhysicalDeviceProperties", + icd_term->scanned_icd->lib_name); + + // Write to the VkPhysicalDeviceProperties2 struct + icd_term->dispatch.GetPhysicalDeviceProperties(phys_dev_term->phys_dev, &pProperties->properties); + + void *pNext = pProperties->pNext; + while (pNext != NULL) { + switch (*(VkStructureType *)pNext) { + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: { + VkPhysicalDeviceIDPropertiesKHR *id_properties = pNext; + + // Verify that "VK_KHR_external_memory_capabilities" is enabled + if (icd_term->this_instance->enabled_known_extensions.khr_external_memory_capabilities) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceProperties2: Emulation cannot generate unique IDs for struct " + "VkPhysicalDeviceIDProperties - setting IDs to zero instead"); + + // Write to the VkPhysicalDeviceIDPropertiesKHR struct + memset(id_properties->deviceUUID, 0, VK_UUID_SIZE); + memset(id_properties->driverUUID, 0, VK_UUID_SIZE); + id_properties->deviceLUIDValid = VK_FALSE; + } + + pNext = id_properties->pNext; + break; + } + default: { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceProperties2KHR: Emulation found unrecognized structure type in " + "pProperties->pNext - this struct will be ignored"); + + struct VkStructureHeader *header = pNext; + pNext = (void *)header->pNext; + break; + } + } + } + } +} + +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice, VkFormat format, + VkFormatProperties2 *pFormatProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + const struct loader_instance *inst = icd_term->this_instance; + + // Get the function pointer to use to call into the ICD. This could be the core or KHR version + PFN_vkGetPhysicalDeviceFormatProperties2 fpGetPhysicalDeviceFormatProperties2 = NULL; + if (inst != NULL && inst->enabled_known_extensions.khr_get_physical_device_properties2) { + fpGetPhysicalDeviceFormatProperties2 = icd_term->dispatch.GetPhysicalDeviceFormatProperties2KHR; + } else { + fpGetPhysicalDeviceFormatProperties2 = icd_term->dispatch.GetPhysicalDeviceFormatProperties2; + } + + if (fpGetPhysicalDeviceFormatProperties2 != NULL || !inst->enabled_known_extensions.khr_get_physical_device_properties2) { + // Pass the call to the driver + fpGetPhysicalDeviceFormatProperties2(phys_dev_term->phys_dev, format, pFormatProperties); + } else { + // Emulate the call + loader_log( + icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "vkGetPhysicalDeviceFormatProperties2: Emulating call in ICD \"%s\" using vkGetPhysicalDeviceFormatProperties", + icd_term->scanned_icd->lib_name); + + // Write to the VkFormatProperties2 struct + icd_term->dispatch.GetPhysicalDeviceFormatProperties(phys_dev_term->phys_dev, format, &pFormatProperties->formatProperties); + + if (pFormatProperties->pNext != NULL) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceFormatProperties2: Emulation found unrecognized structure type in " + "pFormatProperties->pNext - this struct will be ignored"); + } + } +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceImageFormatProperties2( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR *pImageFormatInfo, + VkImageFormatProperties2KHR *pImageFormatProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + const struct loader_instance *inst = icd_term->this_instance; + + // Get the function pointer to use to call into the ICD. This could be the core or KHR version + PFN_vkGetPhysicalDeviceImageFormatProperties2 fpGetPhysicalDeviceImageFormatProperties2 = NULL; + if (inst != NULL && inst->enabled_known_extensions.khr_get_physical_device_properties2) { + fpGetPhysicalDeviceImageFormatProperties2 = icd_term->dispatch.GetPhysicalDeviceImageFormatProperties2KHR; + } else { + fpGetPhysicalDeviceImageFormatProperties2 = icd_term->dispatch.GetPhysicalDeviceImageFormatProperties2; + } + + if (fpGetPhysicalDeviceImageFormatProperties2 != NULL || !inst->enabled_known_extensions.khr_get_physical_device_properties2) { + // Pass the call to the driver + return fpGetPhysicalDeviceImageFormatProperties2(phys_dev_term->phys_dev, pImageFormatInfo, pImageFormatProperties); + } else { + // Emulate the call + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "vkGetPhysicalDeviceImageFormatProperties2: Emulating call in ICD \"%s\" using " + "vkGetPhysicalDeviceImageFormatProperties", + icd_term->scanned_icd->lib_name); + + // If there is more info in either pNext, then this is unsupported + if (pImageFormatInfo->pNext != NULL || pImageFormatProperties->pNext != NULL) { + return VK_ERROR_FORMAT_NOT_SUPPORTED; + } + + // Write to the VkImageFormatProperties2KHR struct + return icd_term->dispatch.GetPhysicalDeviceImageFormatProperties( + phys_dev_term->phys_dev, pImageFormatInfo->format, pImageFormatInfo->type, pImageFormatInfo->tiling, + pImageFormatInfo->usage, pImageFormatInfo->flags, &pImageFormatProperties->imageFormatProperties); + } +} + +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties2( + VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties2KHR *pQueueFamilyProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + const struct loader_instance *inst = icd_term->this_instance; + + // Get the function pointer to use to call into the ICD. This could be the core or KHR version + PFN_vkGetPhysicalDeviceQueueFamilyProperties2 fpGetPhysicalDeviceQueueFamilyProperties2 = NULL; + if (inst != NULL && inst->enabled_known_extensions.khr_get_physical_device_properties2) { + fpGetPhysicalDeviceQueueFamilyProperties2 = icd_term->dispatch.GetPhysicalDeviceQueueFamilyProperties2KHR; + } else { + fpGetPhysicalDeviceQueueFamilyProperties2 = icd_term->dispatch.GetPhysicalDeviceQueueFamilyProperties2; + } + + if (fpGetPhysicalDeviceQueueFamilyProperties2 != NULL || !inst->enabled_known_extensions.khr_get_physical_device_properties2) { + // Pass the call to the driver + fpGetPhysicalDeviceQueueFamilyProperties2(phys_dev_term->phys_dev, pQueueFamilyPropertyCount, pQueueFamilyProperties); + } else { + // Emulate the call + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "vkGetPhysicalDeviceQueueFamilyProperties2: Emulating call in ICD \"%s\" using " + "vkGetPhysicalDeviceQueueFamilyProperties", + icd_term->scanned_icd->lib_name); + + if (pQueueFamilyProperties == NULL || *pQueueFamilyPropertyCount == 0) { + // Write to pQueueFamilyPropertyCount + icd_term->dispatch.GetPhysicalDeviceQueueFamilyProperties(phys_dev_term->phys_dev, pQueueFamilyPropertyCount, NULL); + } else { + // Allocate a temporary array for the output of the old function + VkQueueFamilyProperties *properties = loader_stack_alloc(*pQueueFamilyPropertyCount * sizeof(VkQueueFamilyProperties)); + if (properties == NULL) { + *pQueueFamilyPropertyCount = 0; + loader_log( + icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "vkGetPhysicalDeviceQueueFamilyProperties2: Out of memory - Failed to allocate array for loader emulation."); + return; + } + + icd_term->dispatch.GetPhysicalDeviceQueueFamilyProperties(phys_dev_term->phys_dev, pQueueFamilyPropertyCount, + properties); + for (uint32_t i = 0; i < *pQueueFamilyPropertyCount; ++i) { + // Write to the VkQueueFamilyProperties2KHR struct + memcpy(&pQueueFamilyProperties[i].queueFamilyProperties, &properties[i], sizeof(VkQueueFamilyProperties)); + + if (pQueueFamilyProperties[i].pNext != NULL) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceQueueFamilyProperties2: Emulation found unrecognized structure type in " + "pQueueFamilyProperties[%d].pNext - this struct will be ignored", + i); + } + } + } + } +} + +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties2( + VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2 *pMemoryProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + const struct loader_instance *inst = icd_term->this_instance; + + // Get the function pointer to use to call into the ICD. This could be the core or KHR version + PFN_vkGetPhysicalDeviceMemoryProperties2 fpGetPhysicalDeviceMemoryProperties2 = NULL; + if (inst != NULL && inst->enabled_known_extensions.khr_get_physical_device_properties2) { + fpGetPhysicalDeviceMemoryProperties2 = icd_term->dispatch.GetPhysicalDeviceMemoryProperties2KHR; + } else { + fpGetPhysicalDeviceMemoryProperties2 = icd_term->dispatch.GetPhysicalDeviceMemoryProperties2; + } + + if (fpGetPhysicalDeviceMemoryProperties2 != NULL || !inst->enabled_known_extensions.khr_get_physical_device_properties2) { + // Pass the call to the driver + fpGetPhysicalDeviceMemoryProperties2(phys_dev_term->phys_dev, pMemoryProperties); + } else { + // Emulate the call + loader_log( + icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "vkGetPhysicalDeviceMemoryProperties2: Emulating call in ICD \"%s\" using vkGetPhysicalDeviceMemoryProperties", + icd_term->scanned_icd->lib_name); + + // Write to the VkPhysicalDeviceMemoryProperties2 struct + icd_term->dispatch.GetPhysicalDeviceMemoryProperties(phys_dev_term->phys_dev, &pMemoryProperties->memoryProperties); + + if (pMemoryProperties->pNext != NULL) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceMemoryProperties2: Emulation found unrecognized structure type in " + "pMemoryProperties->pNext - this struct will be ignored"); + } + } +} + +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceSparseImageFormatProperties2( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, uint32_t *pPropertyCount, + VkSparseImageFormatProperties2KHR *pProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + const struct loader_instance *inst = icd_term->this_instance; + + // Get the function pointer to use to call into the ICD. This could be the core or KHR version + PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 fpGetPhysicalDeviceSparseImageFormatProperties2 = NULL; + if (inst != NULL && inst->enabled_known_extensions.khr_get_physical_device_properties2) { + fpGetPhysicalDeviceSparseImageFormatProperties2 = icd_term->dispatch.GetPhysicalDeviceSparseImageFormatProperties2KHR; + } else { + fpGetPhysicalDeviceSparseImageFormatProperties2 = icd_term->dispatch.GetPhysicalDeviceSparseImageFormatProperties2; + } + + if (fpGetPhysicalDeviceSparseImageFormatProperties2 != NULL || !inst->enabled_known_extensions.khr_get_physical_device_properties2) { + // Pass the call to the driver + fpGetPhysicalDeviceSparseImageFormatProperties2(phys_dev_term->phys_dev, pFormatInfo, pPropertyCount, pProperties); + } else { + // Emulate the call + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "vkGetPhysicalDeviceSparseImageFormatProperties2: Emulating call in ICD \"%s\" using " + "vkGetPhysicalDeviceSparseImageFormatProperties", + icd_term->scanned_icd->lib_name); + + if (pFormatInfo->pNext != NULL) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceSparseImageFormatProperties2: Emulation found unrecognized structure type in " + "pFormatInfo->pNext - this struct will be ignored"); + } + + if (pProperties == NULL || *pPropertyCount == 0) { + // Write to pPropertyCount + icd_term->dispatch.GetPhysicalDeviceSparseImageFormatProperties( + phys_dev_term->phys_dev, pFormatInfo->format, pFormatInfo->type, pFormatInfo->samples, pFormatInfo->usage, + pFormatInfo->tiling, pPropertyCount, NULL); + } else { + // Allocate a temporary array for the output of the old function + VkSparseImageFormatProperties *properties = + loader_stack_alloc(*pPropertyCount * sizeof(VkSparseImageMemoryRequirements)); + if (properties == NULL) { + *pPropertyCount = 0; + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "vkGetPhysicalDeviceSparseImageFormatProperties2: Out of memory - Failed to allocate array for " + "loader emulation."); + return; + } + + icd_term->dispatch.GetPhysicalDeviceSparseImageFormatProperties( + phys_dev_term->phys_dev, pFormatInfo->format, pFormatInfo->type, pFormatInfo->samples, pFormatInfo->usage, + pFormatInfo->tiling, pPropertyCount, properties); + for (uint32_t i = 0; i < *pPropertyCount; ++i) { + // Write to the VkSparseImageFormatProperties2KHR struct + memcpy(&pProperties[i].properties, &properties[i], sizeof(VkSparseImageFormatProperties)); + + if (pProperties[i].pNext != NULL) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceSparseImageFormatProperties2: Emulation found unrecognized structure type in " + "pProperties[%d].pNext - this struct will be ignored", + i); + } + } + } + } +} + +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceExternalBufferProperties( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, + VkExternalBufferProperties *pExternalBufferProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + const struct loader_instance *inst = icd_term->this_instance; + + // Get the function pointer to use to call into the ICD. This could be the core or KHR version + PFN_vkGetPhysicalDeviceExternalBufferProperties fpGetPhysicalDeviceExternalBufferProperties = NULL; + if (inst != NULL && inst->enabled_known_extensions.khr_external_memory_capabilities) { + fpGetPhysicalDeviceExternalBufferProperties = icd_term->dispatch.GetPhysicalDeviceExternalBufferPropertiesKHR; + } else { + fpGetPhysicalDeviceExternalBufferProperties = icd_term->dispatch.GetPhysicalDeviceExternalBufferProperties; + } + + if (fpGetPhysicalDeviceExternalBufferProperties || !inst->enabled_known_extensions.khr_external_memory_capabilities) { + // Pass the call to the driver + fpGetPhysicalDeviceExternalBufferProperties(phys_dev_term->phys_dev, pExternalBufferInfo, pExternalBufferProperties); + } else { + // Emulate the call + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "vkGetPhysicalDeviceExternalBufferProperties: Emulating call in ICD \"%s\"", icd_term->scanned_icd->lib_name); + + if (pExternalBufferInfo->pNext != NULL) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceExternalBufferProperties: Emulation found unrecognized structure type in " + "pExternalBufferInfo->pNext - this struct will be ignored"); + } + + // Fill in everything being unsupported + memset(&pExternalBufferProperties->externalMemoryProperties, 0, sizeof(VkExternalMemoryPropertiesKHR)); + + if (pExternalBufferProperties->pNext != NULL) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceExternalBufferProperties: Emulation found unrecognized structure type in " + "pExternalBufferProperties->pNext - this struct will be ignored"); + } + } +} + +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceExternalSemaphoreProperties( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, + VkExternalSemaphoreProperties *pExternalSemaphoreProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + const struct loader_instance *inst = icd_term->this_instance; + + // Get the function pointer to use to call into the ICD. This could be the core or KHR version + PFN_vkGetPhysicalDeviceExternalSemaphoreProperties fpGetPhysicalDeviceExternalSemaphoreProperties = NULL; + if (inst != NULL && inst->enabled_known_extensions.khr_external_semaphore_capabilities) { + fpGetPhysicalDeviceExternalSemaphoreProperties = icd_term->dispatch.GetPhysicalDeviceExternalSemaphorePropertiesKHR; + } else { + fpGetPhysicalDeviceExternalSemaphoreProperties = icd_term->dispatch.GetPhysicalDeviceExternalSemaphoreProperties; + } + + if (fpGetPhysicalDeviceExternalSemaphoreProperties != NULL || !inst->enabled_known_extensions.khr_external_semaphore_capabilities) { + // Pass the call to the driver + fpGetPhysicalDeviceExternalSemaphoreProperties(phys_dev_term->phys_dev, pExternalSemaphoreInfo, pExternalSemaphoreProperties); + } else { + // Emulate the call + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "vkGetPhysicalDeviceExternalSemaphoreProperties: Emulating call in ICD \"%s\"", + icd_term->scanned_icd->lib_name); + + if (pExternalSemaphoreInfo->pNext != NULL) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceExternalSemaphoreProperties: Emulation found unrecognized structure type in " + "pExternalSemaphoreInfo->pNext - this struct will be ignored"); + } + + // Fill in everything being unsupported + pExternalSemaphoreProperties->exportFromImportedHandleTypes = 0; + pExternalSemaphoreProperties->compatibleHandleTypes = 0; + pExternalSemaphoreProperties->externalSemaphoreFeatures = 0; + + if (pExternalSemaphoreProperties->pNext != NULL) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceExternalSemaphoreProperties: Emulation found unrecognized structure type in " + "pExternalSemaphoreProperties->pNext - this struct will be ignored"); + } + } +} + +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceExternalFenceProperties( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, + VkExternalFenceProperties *pExternalFenceProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + const struct loader_instance *inst = icd_term->this_instance; + + // Get the function pointer to use to call into the ICD. This could be the core or KHR version + PFN_vkGetPhysicalDeviceExternalFenceProperties fpGetPhysicalDeviceExternalFenceProperties = NULL; + if (inst != NULL && inst->enabled_known_extensions.khr_external_fence_capabilities) { + fpGetPhysicalDeviceExternalFenceProperties = icd_term->dispatch.GetPhysicalDeviceExternalFencePropertiesKHR; + } else { + fpGetPhysicalDeviceExternalFenceProperties = icd_term->dispatch.GetPhysicalDeviceExternalFenceProperties; + } + + if (fpGetPhysicalDeviceExternalFenceProperties != NULL || !inst->enabled_known_extensions.khr_external_fence_capabilities) { + // Pass the call to the driver + fpGetPhysicalDeviceExternalFenceProperties(phys_dev_term->phys_dev, pExternalFenceInfo, pExternalFenceProperties); + } else { + // Emulate the call + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "vkGetPhysicalDeviceExternalFenceProperties: Emulating call in ICD \"%s\"", icd_term->scanned_icd->lib_name); + + if (pExternalFenceInfo->pNext != NULL) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceExternalFenceProperties: Emulation found unrecognized structure type in " + "pExternalFenceInfo->pNext - this struct will be ignored"); + } + + // Fill in everything being unsupported + pExternalFenceProperties->exportFromImportedHandleTypes = 0; + pExternalFenceProperties->compatibleHandleTypes = 0; + pExternalFenceProperties->externalFenceFeatures = 0; + + if (pExternalFenceProperties->pNext != NULL) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceExternalFenceProperties: Emulation found unrecognized structure type in " + "pExternalFenceProperties->pNext - this struct will be ignored"); + } + } +} diff -Nru vulkan-1.0.65.2+dfsg1/loader/loader.h vulkan-1.1.73+dfsg/loader/loader.h --- vulkan-1.0.65.2+dfsg1/loader/loader.h 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/loader.h 2018-04-27 11:24:19.000000000 +0000 @@ -137,6 +137,11 @@ struct loader_name_value enable_env_var; uint32_t num_component_layers; char (*component_layer_names)[MAX_STRING_SIZE]; + struct { + char enumerate_instance_extension_properties[MAX_STRING_SIZE]; + char enumerate_instance_layer_properties[MAX_STRING_SIZE]; + char enumerate_instance_version[MAX_STRING_SIZE]; + } pre_instance_functions; }; struct loader_layer_list { @@ -187,6 +192,14 @@ VkAllocationCallbacks alloc_callbacks; + // List of activated device extensions that have terminators implemented in the loader + struct { + bool khr_swapchain_enabled; + bool khr_display_swapchain_enabled; + bool ext_debug_marker_enabled; + bool ext_debug_utils_enabled; + } extensions; + struct loader_device *next; }; @@ -224,6 +237,10 @@ struct loader_instance { struct loader_instance_dispatch_table *disp; // must be first entry in structure + // Vulkan API version the app is intending to use. + uint16_t app_api_major_version; + uint16_t app_api_minor_version; + // We need to manually track physical devices over time. If the user // re-queries the information, we don't want to delete old data or // create new data unless necessary. @@ -237,9 +254,9 @@ // loader specific structures since we have that content in the physical // device stored internal to the public structures. uint32_t phys_dev_group_count_term; - struct VkPhysicalDeviceGroupPropertiesKHX **phys_dev_groups_term; + struct VkPhysicalDeviceGroupProperties **phys_dev_groups_term; uint32_t phys_dev_group_count_tramp; - struct VkPhysicalDeviceGroupPropertiesKHX **phys_dev_groups_tramp; + struct VkPhysicalDeviceGroupProperties **phys_dev_groups_tramp; struct loader_instance *next; @@ -268,9 +285,12 @@ union loader_instance_extension_enables enabled_known_extensions; VkLayerDbgFunctionNode *DbgFunctionHead; - uint32_t num_tmp_callbacks; - VkDebugReportCallbackCreateInfoEXT *tmp_dbg_create_infos; - VkDebugReportCallbackEXT *tmp_callbacks; + uint32_t num_tmp_report_callbacks; + VkDebugReportCallbackCreateInfoEXT *tmp_report_create_infos; + VkDebugReportCallbackEXT *tmp_report_callbacks; + uint32_t num_tmp_messengers; + VkDebugUtilsMessengerCreateInfoEXT *tmp_messenger_create_infos; + VkDebugUtilsMessengerEXT *tmp_messengers; VkAllocationCallbacks alloc_callbacks; @@ -293,6 +313,12 @@ #ifdef VK_USE_PLATFORM_ANDROID_KHR bool wsi_android_surface_enabled; #endif +#ifdef VK_USE_PLATFORM_MACOS_MVK + bool wsi_macos_surface_enabled; +#endif +#ifdef VK_USE_PLATFORM_IOS_MVK + bool wsi_ios_surface_enabled; +#endif bool wsi_display_enabled; }; @@ -375,7 +401,9 @@ // Global variables used across files extern struct loader_struct loader; extern THREAD_LOCAL_DECL struct loader_instance *tls_instance; +#if defined(_WIN32) && !defined(LOADER_DYNAMIC_LIB) extern LOADER_PLATFORM_THREAD_ONCE_DEFINITION(once_init); +#endif extern loader_platform_thread_mutex loader_lock; extern loader_platform_thread_mutex loader_json_lock; diff -Nru vulkan-1.0.65.2+dfsg1/loader/loader.rc vulkan-1.1.73+dfsg/loader/loader.rc --- vulkan-1.0.65.2+dfsg1/loader/loader.rc 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/loader.rc 2018-04-27 11:24:19.000000000 +0000 @@ -86,7 +86,7 @@ BEGIN VALUE "FileDescription", VER_FILE_DESCRIPTION_STR VALUE "FileVersion", VER_FILE_VERSION_STR - VALUE "LegalCopyright", "Copyright (C) 2015-2017" + VALUE "LegalCopyright", "Copyright (C) 2015-2018" VALUE "ProductName", "Vulkan Runtime" VALUE "ProductVersion", VER_FILE_VERSION_STR END diff -Nru vulkan-1.0.65.2+dfsg1/loader/trampoline.c vulkan-1.1.73+dfsg/loader/trampoline.c --- vulkan-1.0.65.2+dfsg1/loader/trampoline.c 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/trampoline.c 2018-04-27 11:24:19.000000000 +0000 @@ -28,11 +28,12 @@ #include "vk_loader_platform.h" #include "loader.h" -#include "debug_report.h" +#include "debug_utils.h" #include "wsi.h" #include "vk_loader_extensions.h" #include "gpa_helper.h" + // Trampoline entrypoints are in this file for core Vulkan commands // Get an instance level or global level entry point address. @@ -46,13 +47,8 @@ void *addr; addr = globalGetProcAddr(pName); - if (instance == VK_NULL_HANDLE) { - // Get entrypoint addresses that are global (no dispatchable object) - + if (instance == VK_NULL_HANDLE || addr != NULL) { return addr; - } else { - // If a global entrypoint return NULL - if (addr) return NULL; } struct loader_instance *ptr_instance = loader_get_instance(instance); @@ -99,126 +95,266 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties) { - struct loader_extension_list *global_ext_list = NULL; - struct loader_layer_list instance_layers; - struct loader_extension_list local_ext_list; - struct loader_icd_tramp_list icd_tramp_list; - uint32_t copy_size; + tls_instance = NULL; + LOADER_PLATFORM_THREAD_ONCE(&once_init, loader_initialize); + + // We know we need to call at least the terminator VkResult res = VK_SUCCESS; + VkEnumerateInstanceExtensionPropertiesChain chain_tail = { + .header = + { + .type = VK_CHAIN_TYPE_ENUMERATE_INSTANCE_EXTENSION_PROPERTIES, + .version = VK_CURRENT_CHAIN_VERSION, + .size = sizeof(chain_tail), + }, + .pfnNextLayer = &terminator_EnumerateInstanceExtensionProperties, + .pNextLink = NULL, + }; + VkEnumerateInstanceExtensionPropertiesChain *chain_head = &chain_tail; + + // Get the implicit layers + struct loader_layer_list layers; + memset(&layers, 0, sizeof(layers)); + loader_implicit_layer_scan(NULL, &layers); + + // We'll need to save the dl handles so we can close them later + loader_platform_dl_handle *libs = malloc(sizeof(loader_platform_dl_handle) * layers.count); + if (libs == NULL) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + size_t lib_count = 0; + + // Prepend layers onto the chain if they implment this entry point + for (uint32_t i = 0; i < layers.count; ++i) { + if (!loader_is_implicit_layer_enabled(NULL, layers.list + i) || + layers.list[i].pre_instance_functions.enumerate_instance_extension_properties[0] == '\0') { + continue; + } - tls_instance = NULL; - memset(&local_ext_list, 0, sizeof(local_ext_list)); - memset(&instance_layers, 0, sizeof(instance_layers)); - loader_platform_thread_once(&once_init, loader_initialize); - - // Get layer libraries if needed - if (pLayerName && strlen(pLayerName) != 0) { - if (vk_string_validate(MaxLoaderStringLength, pLayerName) != VK_STRING_ERROR_NONE) { - assert(VK_FALSE && - "vkEnumerateInstanceExtensionProperties: " - "pLayerName is too long or is badly formed"); - res = VK_ERROR_EXTENSION_NOT_PRESENT; - goto out; + loader_platform_dl_handle layer_lib = loader_platform_open_library(layers.list[i].lib_name); + libs[lib_count++] = layer_lib; + void *pfn = loader_platform_get_proc_address(layer_lib, + layers.list[i].pre_instance_functions.enumerate_instance_extension_properties); + if (pfn == NULL) { + loader_log(NULL, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "%s: Unable to resolve symbol \"%s\" in implicit layer library \"%s\"", __FUNCTION__, + layers.list[i].pre_instance_functions.enumerate_instance_extension_properties, layers.list[i].lib_name); + continue; } - loader_layer_scan(NULL, &instance_layers); - for (uint32_t i = 0; i < instance_layers.count; i++) { - struct loader_layer_properties *props = &instance_layers.list[i]; - if (strcmp(props->info.layerName, pLayerName) == 0) { - global_ext_list = &props->instance_extension_list; - break; - } + VkEnumerateInstanceExtensionPropertiesChain *chain_link = malloc(sizeof(VkEnumerateInstanceExtensionPropertiesChain)); + if (chain_link == NULL) { + res = VK_ERROR_OUT_OF_HOST_MEMORY; + break; } - } else { - // Scan/discover all ICD libraries - memset(&icd_tramp_list, 0, sizeof(struct loader_icd_tramp_list)); - res = loader_icd_scan(NULL, &icd_tramp_list); - if (VK_SUCCESS != res) { - goto out; + + chain_link->header.type = VK_CHAIN_TYPE_ENUMERATE_INSTANCE_EXTENSION_PROPERTIES; + chain_link->header.version = VK_CURRENT_CHAIN_VERSION; + chain_link->header.size = sizeof(*chain_link); + chain_link->pfnNextLayer = pfn; + chain_link->pNextLink = chain_head; + + chain_head = chain_link; + } + + // Call down the chain + if (res == VK_SUCCESS) { + res = chain_head->pfnNextLayer(chain_head->pNextLink, pLayerName, pPropertyCount, pProperties); + } + + // Free up the layers + loader_delete_layer_properties(NULL, &layers); + + // Tear down the chain + while (chain_head != &chain_tail) { + VkEnumerateInstanceExtensionPropertiesChain *holder = chain_head; + chain_head = (VkEnumerateInstanceExtensionPropertiesChain *)chain_head->pNextLink; + free(holder); + } + + // Close the dl handles + for (size_t i = 0; i < lib_count; ++i) { + loader_platform_close_library(libs[i]); + } + free(libs); + + return res; +} + +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties(uint32_t *pPropertyCount, + VkLayerProperties *pProperties) { + tls_instance = NULL; + LOADER_PLATFORM_THREAD_ONCE(&once_init, loader_initialize); + + // We know we need to call at least the terminator + VkResult res = VK_SUCCESS; + VkEnumerateInstanceLayerPropertiesChain chain_tail = { + .header = + { + .type = VK_CHAIN_TYPE_ENUMERATE_INSTANCE_LAYER_PROPERTIES, + .version = VK_CURRENT_CHAIN_VERSION, + .size = sizeof(chain_tail), + }, + .pfnNextLayer = &terminator_EnumerateInstanceLayerProperties, + .pNextLink = NULL, + }; + VkEnumerateInstanceLayerPropertiesChain *chain_head = &chain_tail; + + // Get the implicit layers + struct loader_layer_list layers; + memset(&layers, 0, sizeof(layers)); + loader_implicit_layer_scan(NULL, &layers); + + // We'll need to save the dl handles so we can close them later + loader_platform_dl_handle *libs = malloc(sizeof(loader_platform_dl_handle) * layers.count); + if (libs == NULL) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + size_t lib_count = 0; + + // Prepend layers onto the chain if they implment this entry point + for (uint32_t i = 0; i < layers.count; ++i) { + if (!loader_is_implicit_layer_enabled(NULL, layers.list + i) || + layers.list[i].pre_instance_functions.enumerate_instance_layer_properties[0] == '\0') { + continue; } - // Get extensions from all ICD's, merge so no duplicates - res = loader_get_icd_loader_instance_extensions(NULL, &icd_tramp_list, &local_ext_list); - if (VK_SUCCESS != res) { - goto out; + + loader_platform_dl_handle layer_lib = loader_platform_open_library(layers.list[i].lib_name); + libs[lib_count++] = layer_lib; + void *pfn = + loader_platform_get_proc_address(layer_lib, layers.list[i].pre_instance_functions.enumerate_instance_layer_properties); + if (pfn == NULL) { + loader_log(NULL, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "%s: Unable to resolve symbol \"%s\" in implicit layer library \"%s\"", __FUNCTION__, + layers.list[i].pre_instance_functions.enumerate_instance_layer_properties, layers.list[i].lib_name); + continue; } - loader_scanned_icd_clear(NULL, &icd_tramp_list); - // Append enabled implicit layers. - loader_implicit_layer_scan(NULL, &instance_layers); - for (uint32_t i = 0; i < instance_layers.count; i++) { - if (!loader_is_implicit_layer_enabled(NULL, &instance_layers.list[i])) { - continue; - } - struct loader_extension_list *ext_list = &instance_layers.list[i].instance_extension_list; - loader_add_to_ext_list(NULL, &local_ext_list, ext_list->count, ext_list->list); + VkEnumerateInstanceLayerPropertiesChain *chain_link = malloc(sizeof(VkEnumerateInstanceLayerPropertiesChain)); + if (chain_link == NULL) { + res = VK_ERROR_OUT_OF_HOST_MEMORY; + break; } - global_ext_list = &local_ext_list; - } + chain_link->header.type = VK_CHAIN_TYPE_ENUMERATE_INSTANCE_LAYER_PROPERTIES; + chain_link->header.version = VK_CURRENT_CHAIN_VERSION; + chain_link->header.size = sizeof(*chain_link); + chain_link->pfnNextLayer = pfn; + chain_link->pNextLink = chain_head; - if (global_ext_list == NULL) { - res = VK_ERROR_LAYER_NOT_PRESENT; - goto out; + chain_head = chain_link; } - if (pProperties == NULL) { - *pPropertyCount = global_ext_list->count; - goto out; + // Call down the chain + if (res == VK_SUCCESS) { + res = chain_head->pfnNextLayer(chain_head->pNextLink, pPropertyCount, pProperties); } - copy_size = *pPropertyCount < global_ext_list->count ? *pPropertyCount : global_ext_list->count; - for (uint32_t i = 0; i < copy_size; i++) { - memcpy(&pProperties[i], &global_ext_list->list[i], sizeof(VkExtensionProperties)); - } - *pPropertyCount = copy_size; + // Free up the layers + loader_delete_layer_properties(NULL, &layers); - if (copy_size < global_ext_list->count) { - res = VK_INCOMPLETE; - goto out; + // Tear down the chain + while (chain_head != &chain_tail) { + VkEnumerateInstanceLayerPropertiesChain *holder = chain_head; + chain_head = (VkEnumerateInstanceLayerPropertiesChain *)chain_head->pNextLink; + free(holder); } -out: + // Close the dl handles + for (size_t i = 0; i < lib_count; ++i) { + loader_platform_close_library(libs[i]); + } + free(libs); - loader_destroy_generic_list(NULL, (struct loader_generic_list *)&local_ext_list); - loader_delete_layer_properties(NULL, &instance_layers); return res; } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties(uint32_t *pPropertyCount, - VkLayerProperties *pProperties) { - VkResult result = VK_SUCCESS; - struct loader_layer_list instance_layer_list; +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceVersion(uint32_t* pApiVersion) { + tls_instance = NULL; + LOADER_PLATFORM_THREAD_ONCE(&once_init, loader_initialize); + + // We know we need to call at least the terminator + VkResult res = VK_SUCCESS; + VkEnumerateInstanceVersionChain chain_tail = { + .header = + { + .type = VK_CHAIN_TYPE_ENUMERATE_INSTANCE_VERSION, + .version = VK_CURRENT_CHAIN_VERSION, + .size = sizeof(chain_tail), + }, + .pfnNextLayer = &terminator_EnumerateInstanceVersion, + .pNextLink = NULL, + }; + VkEnumerateInstanceVersionChain *chain_head = &chain_tail; + + // Get the implicit layers + struct loader_layer_list layers; + memset(&layers, 0, sizeof(layers)); + loader_implicit_layer_scan(NULL, &layers); + + // We'll need to save the dl handles so we can close them later + loader_platform_dl_handle *libs = malloc(sizeof(loader_platform_dl_handle) * layers.count); + if (libs == NULL) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + size_t lib_count = 0; + + // Prepend layers onto the chain if they implment this entry point + for (uint32_t i = 0; i < layers.count; ++i) { + if (!loader_is_implicit_layer_enabled(NULL, layers.list + i) || + layers.list[i].pre_instance_functions.enumerate_instance_version[0] == '\0') { + continue; + } - loader_platform_thread_once(&once_init, loader_initialize); + loader_platform_dl_handle layer_lib = loader_platform_open_library(layers.list[i].lib_name); + libs[lib_count++] = layer_lib; + void *pfn = loader_platform_get_proc_address(layer_lib, + layers.list[i].pre_instance_functions.enumerate_instance_version); + if (pfn == NULL) { + loader_log(NULL, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "%s: Unable to resolve symbol \"%s\" in implicit layer library \"%s\"", __FUNCTION__, + layers.list[i].pre_instance_functions.enumerate_instance_version, layers.list[i].lib_name); + continue; + } - uint32_t copy_size; + VkEnumerateInstanceVersionChain *chain_link = malloc(sizeof(VkEnumerateInstanceVersionChain)); + if (chain_link == NULL) { + res = VK_ERROR_OUT_OF_HOST_MEMORY; + break; + } - // Get layer libraries - memset(&instance_layer_list, 0, sizeof(instance_layer_list)); - loader_layer_scan(NULL, &instance_layer_list); + chain_link->header.type = VK_CHAIN_TYPE_ENUMERATE_INSTANCE_VERSION; + chain_link->header.version = VK_CURRENT_CHAIN_VERSION; + chain_link->header.size = sizeof(*chain_link); + chain_link->pfnNextLayer = pfn; + chain_link->pNextLink = chain_head; - if (pProperties == NULL) { - *pPropertyCount = instance_layer_list.count; - goto out; + chain_head = chain_link; } - copy_size = (*pPropertyCount < instance_layer_list.count) ? *pPropertyCount : instance_layer_list.count; - for (uint32_t i = 0; i < copy_size; i++) { - memcpy(&pProperties[i], &instance_layer_list.list[i].info, sizeof(VkLayerProperties)); + // Call down the chain + if (res == VK_SUCCESS) { + res = chain_head->pfnNextLayer(chain_head->pNextLink, pApiVersion); } - *pPropertyCount = copy_size; + // Free up the layers + loader_delete_layer_properties(NULL, &layers); - if (copy_size < instance_layer_list.count) { - result = VK_INCOMPLETE; - goto out; + // Tear down the chain + while (chain_head != &chain_tail) { + VkEnumerateInstanceVersionChain *holder = chain_head; + chain_head = (VkEnumerateInstanceVersionChain *)chain_head->pNextLink; + free(holder); } -out: + // Close the dl handles + for (size_t i = 0; i < lib_count; ++i) { + loader_platform_close_library(libs[i]); + } + free(libs); - loader_delete_layer_properties(NULL, &instance_layer_list); - return result; + return res; } LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, @@ -228,23 +364,7 @@ bool loaderLocked = false; VkResult res = VK_ERROR_INITIALIZATION_FAILED; - loader_platform_thread_once(&once_init, loader_initialize); - - // Fail if the requested Vulkan apiVersion is > 1.0 since the loader only supports 1.0. - // Having pCreateInfo == NULL, pCreateInfo->pApplication == NULL, or - // pCreateInfo->pApplicationInfo->apiVersion == 0 all indicate that the application is - // only requesting a 1.0 instance, which this loader will always support. - uint32_t loader_major_version = 1; - uint32_t loader_minor_version = 0; - if (NULL != pCreateInfo && NULL != pCreateInfo->pApplicationInfo && - pCreateInfo->pApplicationInfo->apiVersion >= VK_MAKE_VERSION(loader_major_version, loader_minor_version + 1, 0)) { - loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "vkCreateInstance: Called with invalid API version %d.%d. Loader only supports %d.%d", - VK_VERSION_MAJOR(pCreateInfo->pApplicationInfo->apiVersion), - VK_VERSION_MINOR(pCreateInfo->pApplicationInfo->apiVersion), loader_major_version, loader_minor_version); - res = VK_ERROR_INCOMPATIBLE_DRIVER; - goto out; - } + LOADER_PLATFORM_THREAD_ONCE(&once_init, loader_initialize); #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) { @@ -272,23 +392,52 @@ ptr_instance->alloc_callbacks = *pAllocator; } - // Look for one or more debug report create info structures + // Save the application version + if (NULL == pCreateInfo || NULL == pCreateInfo->pApplicationInfo || 0 == pCreateInfo->pApplicationInfo->apiVersion) +{ + ptr_instance->app_api_major_version = 1; + ptr_instance->app_api_minor_version = 0; + } else { + ptr_instance->app_api_major_version = VK_VERSION_MAJOR(pCreateInfo->pApplicationInfo->apiVersion); + ptr_instance->app_api_minor_version = VK_VERSION_MINOR(pCreateInfo->pApplicationInfo->apiVersion); + } + + // Look for one or more VK_EXT_debug_report or VK_EXT_debug_utils create info structures // and setup a callback(s) for each one found. - ptr_instance->num_tmp_callbacks = 0; - ptr_instance->tmp_dbg_create_infos = NULL; - ptr_instance->tmp_callbacks = NULL; - if (util_CopyDebugReportCreateInfos(pCreateInfo->pNext, pAllocator, &ptr_instance->num_tmp_callbacks, - &ptr_instance->tmp_dbg_create_infos, &ptr_instance->tmp_callbacks)) { - // One or more were found, but allocation failed. Therefore, clean up - // and fail this function: + ptr_instance->num_tmp_report_callbacks = 0; + ptr_instance->tmp_report_create_infos = NULL; + ptr_instance->tmp_report_callbacks = NULL; + ptr_instance->num_tmp_messengers = 0; + ptr_instance->tmp_messenger_create_infos = NULL; + ptr_instance->tmp_messengers = NULL; + + // Handle cases of VK_EXT_debug_utils + if (util_CopyDebugUtilsMessengerCreateInfos(pCreateInfo->pNext, pAllocator, &ptr_instance->num_tmp_messengers, + &ptr_instance->tmp_messenger_create_infos, &ptr_instance->tmp_messengers)) { + // One or more were found, but allocation failed. Therefore, clean up and fail this function: res = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; - } else if (ptr_instance->num_tmp_callbacks > 0) { + } else if (ptr_instance->num_tmp_messengers > 0) { + // Setup the temporary messenger(s) here to catch early issues: + if (util_CreateDebugUtilsMessengers(ptr_instance, pAllocator, ptr_instance->num_tmp_messengers, + ptr_instance->tmp_messenger_create_infos, ptr_instance->tmp_messengers)) { + // Failure of setting up one or more of the messenger. Therefore, clean up and fail this function: + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + } + + // Handle cases of VK_EXT_debug_report + if (util_CopyDebugReportCreateInfos(pCreateInfo->pNext, pAllocator, &ptr_instance->num_tmp_report_callbacks, + &ptr_instance->tmp_report_create_infos, &ptr_instance->tmp_report_callbacks)) { + // One or more were found, but allocation failed. Therefore, clean up and fail this function: + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } else if (ptr_instance->num_tmp_report_callbacks > 0) { // Setup the temporary callback(s) here to catch early issues: - if (util_CreateDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_callbacks, - ptr_instance->tmp_dbg_create_infos, ptr_instance->tmp_callbacks)) { - // Failure of setting up one or more of the callback. Therefore, - // clean up and fail this function: + if (util_CreateDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_report_callbacks, + ptr_instance->tmp_report_create_infos, ptr_instance->tmp_report_callbacks)) { + // Failure of setting up one or more of the callback. Therefore, clean up and fail this function: res = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; } @@ -352,7 +501,7 @@ memset(ptr_instance->enabled_known_extensions.padding, 0, sizeof(uint64_t) * 4); wsi_create_instance(ptr_instance, &ici); - debug_report_create_instance(ptr_instance, &ici); + debug_utils_CreateInstance(ptr_instance, &ici); extensions_create_instance(ptr_instance, &ici); *pInstance = created_instance; @@ -374,10 +523,19 @@ if (NULL != ptr_instance->disp) { loader_instance_heap_free(ptr_instance, ptr_instance->disp); } - if (ptr_instance->num_tmp_callbacks > 0) { - util_DestroyDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_callbacks, - ptr_instance->tmp_callbacks); - util_FreeDebugReportCreateInfos(pAllocator, ptr_instance->tmp_dbg_create_infos, ptr_instance->tmp_callbacks); + if (ptr_instance->num_tmp_report_callbacks > 0) { + // Remove temporary VK_EXT_debug_report items + util_DestroyDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_report_callbacks, + ptr_instance->tmp_report_callbacks); + util_FreeDebugReportCreateInfos(pAllocator, ptr_instance->tmp_report_create_infos, + ptr_instance->tmp_report_callbacks); + } + if (ptr_instance->num_tmp_messengers > 0) { + // Remove temporary VK_EXT_debug_utils items + util_DestroyDebugUtilsMessengers(ptr_instance, pAllocator, ptr_instance->num_tmp_messengers, + ptr_instance->tmp_messengers); + util_FreeDebugUtilsMessengerCreateInfos(pAllocator, ptr_instance->tmp_messenger_create_infos, + ptr_instance->tmp_messengers); } if (NULL != ptr_instance->expanded_activated_layer_list.list) { @@ -393,9 +551,11 @@ loader_instance_heap_free(ptr_instance, ptr_instance); } else { - // Remove temporary debug_report callback - util_DestroyDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_callbacks, - ptr_instance->tmp_callbacks); + // Remove temporary VK_EXT_debug_report or VK_EXT_debug_utils items + util_DestroyDebugUtilsMessengers(ptr_instance, pAllocator, ptr_instance->num_tmp_messengers, + ptr_instance->tmp_messengers); + util_DestroyDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_report_callbacks, + ptr_instance->tmp_report_callbacks); } if (loaderLocked) { @@ -410,6 +570,7 @@ const VkLayerInstanceDispatchTable *disp; struct loader_instance *ptr_instance = NULL; bool callback_setup = false; + bool messenger_setup = false; if (instance == VK_NULL_HANDLE) { return; @@ -425,10 +586,18 @@ ptr_instance->alloc_callbacks = *pAllocator; } - if (ptr_instance->num_tmp_callbacks > 0) { - // Setup the temporary callback(s) here to catch cleanup issues: - if (!util_CreateDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_callbacks, - ptr_instance->tmp_dbg_create_infos, ptr_instance->tmp_callbacks)) { + if (ptr_instance->num_tmp_messengers > 0) { + // Setup the temporary VK_EXT_debug_utils messenger(s) here to catch cleanup issues: + if (!util_CreateDebugUtilsMessengers(ptr_instance, pAllocator, ptr_instance->num_tmp_messengers, + ptr_instance->tmp_messenger_create_infos, ptr_instance->tmp_messengers)) { + messenger_setup = true; + } + } + + if (ptr_instance->num_tmp_report_callbacks > 0) { + // Setup the temporary VK_EXT_debug_report callback(s) here to catch cleanup issues: + if (!util_CreateDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_report_callbacks, + ptr_instance->tmp_report_create_infos, ptr_instance->tmp_report_callbacks)) { callback_setup = true; } } @@ -456,9 +625,15 @@ loader_instance_heap_free(ptr_instance, ptr_instance->phys_dev_groups_tramp); } + if (messenger_setup) { + util_DestroyDebugUtilsMessengers(ptr_instance, pAllocator, ptr_instance->num_tmp_messengers, ptr_instance->tmp_messengers); + util_FreeDebugUtilsMessengerCreateInfos(pAllocator, ptr_instance->tmp_messenger_create_infos, ptr_instance->tmp_messengers); + } + if (callback_setup) { - util_DestroyDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_callbacks, ptr_instance->tmp_callbacks); - util_FreeDebugReportCreateInfos(pAllocator, ptr_instance->tmp_dbg_create_infos, ptr_instance->tmp_callbacks); + util_DestroyDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_report_callbacks, + ptr_instance->tmp_report_callbacks); + util_FreeDebugReportCreateInfos(pAllocator, ptr_instance->tmp_report_create_infos, ptr_instance->tmp_report_callbacks); } loader_instance_heap_free(ptr_instance, ptr_instance->disp); loader_instance_heap_free(ptr_instance, ptr_instance); @@ -1945,3 +2120,518 @@ disp->CmdExecuteCommands(commandBuffer, commandBuffersCount, pCommandBuffers); } + +// ---- Vulkan core 1.1 trampolines + +VkResult setupLoaderTrampPhysDevGroups(VkInstance instance) { + VkResult res = VK_SUCCESS; + struct loader_instance *inst; + uint32_t total_count = 0; + VkPhysicalDeviceGroupPropertiesKHR **new_phys_dev_groups = NULL; + VkPhysicalDeviceGroupPropertiesKHR *local_phys_dev_groups = NULL; + PFN_vkEnumeratePhysicalDeviceGroups fpEnumeratePhysicalDeviceGroups = NULL; + + inst = loader_get_instance(instance); + if (NULL == inst) { + res = VK_ERROR_INITIALIZATION_FAILED; + goto out; + } + + // Get the function pointer to use to call into the ICD. This could be the core or KHR version + if (inst->enabled_known_extensions.khr_device_group_creation) { + fpEnumeratePhysicalDeviceGroups = inst->disp->layer_inst_disp.EnumeratePhysicalDeviceGroupsKHR; + } else { + fpEnumeratePhysicalDeviceGroups = inst->disp->layer_inst_disp.EnumeratePhysicalDeviceGroups; + } + + // Setup the trampoline loader physical devices. This will actually + // call down and setup the terminator loader physical devices during the + // process. + VkResult setup_res = setupLoaderTrampPhysDevs(instance); + if (setup_res != VK_SUCCESS && setup_res != VK_INCOMPLETE) { + res = setup_res; + goto out; + } + + // Query how many physical device groups there + res = fpEnumeratePhysicalDeviceGroups(instance, &total_count, NULL); + if (res != VK_SUCCESS) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTrampPhysDevGroups: Failed during dispatch call of " + "\'EnumeratePhysicalDeviceGroupsKHR\' to lower layers or " + "loader to get count."); + goto out; + } + + // Create an array for the new physical device groups, which will be stored + // in the instance for the trampoline code. + new_phys_dev_groups = (VkPhysicalDeviceGroupPropertiesKHR **)loader_instance_heap_alloc( + inst, total_count * sizeof(VkPhysicalDeviceGroupPropertiesKHR *), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if (NULL == new_phys_dev_groups) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTrampPhysDevGroups: Failed to allocate new physical device" + " group array of size %d", + total_count); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + memset(new_phys_dev_groups, 0, total_count * sizeof(VkPhysicalDeviceGroupPropertiesKHR *)); + + // Create a temporary array (on the stack) to keep track of the + // returned VkPhysicalDevice values. + local_phys_dev_groups = loader_stack_alloc(sizeof(VkPhysicalDeviceGroupPropertiesKHR) * total_count); + if (NULL == local_phys_dev_groups) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTrampPhysDevGroups: Failed to allocate local " + "physical device group array of size %d", + total_count); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + // Initialize the memory to something valid + memset(local_phys_dev_groups, 0, sizeof(VkPhysicalDeviceGroupPropertiesKHR) * total_count); + for (uint32_t group = 0; group < total_count; group++) { + local_phys_dev_groups[group].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR; + local_phys_dev_groups[group].pNext = NULL; + local_phys_dev_groups[group].subsetAllocation = false; + } + + // Call down and get the content + fpEnumeratePhysicalDeviceGroups(instance, &total_count, local_phys_dev_groups); + if (VK_SUCCESS != res) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTrampPhysDevGroups: Failed during dispatch call of " + "\'EnumeratePhysicalDeviceGroupsKHR\' to lower layers or " + "loader to get content."); + goto out; + } + + // Replace all the physical device IDs with the proper loader values + for (uint32_t group = 0; group < total_count; group++) { + for (uint32_t group_gpu = 0; group_gpu < local_phys_dev_groups[group].physicalDeviceCount; group_gpu++) { + bool found = false; + for (uint32_t tramp_gpu = 0; tramp_gpu < inst->phys_dev_count_tramp; tramp_gpu++) { + if (local_phys_dev_groups[group].physicalDevices[group_gpu] == inst->phys_devs_tramp[tramp_gpu]->phys_dev) { + local_phys_dev_groups[group].physicalDevices[group_gpu] = (VkPhysicalDevice)inst->phys_devs_tramp[tramp_gpu]; + found = true; + break; + } + } + if (!found) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTrampPhysDevGroups: Failed to find GPU %d in group %d" + " returned by \'EnumeratePhysicalDeviceGroupsKHR\' in list returned" + " by \'EnumeratePhysicalDevices\'", group_gpu, group); + res = VK_ERROR_INITIALIZATION_FAILED; + goto out; + } + } + } + + // Copy or create everything to fill the new array of physical device groups + for (uint32_t new_idx = 0; new_idx < total_count; new_idx++) { + // Check if this physical device group with the same contents is already in the old buffer + for (uint32_t old_idx = 0; old_idx < inst->phys_dev_group_count_tramp; old_idx++) { + if (local_phys_dev_groups[new_idx].physicalDeviceCount == inst->phys_dev_groups_tramp[old_idx]->physicalDeviceCount) { + bool found_all_gpus = true; + for (uint32_t old_gpu = 0; old_gpu < inst->phys_dev_groups_tramp[old_idx]->physicalDeviceCount; old_gpu++) { + bool found_gpu = false; + for (uint32_t new_gpu = 0; new_gpu < local_phys_dev_groups[new_idx].physicalDeviceCount; new_gpu++) { + if (local_phys_dev_groups[new_idx].physicalDevices[new_gpu] == inst->phys_dev_groups_tramp[old_idx]->physicalDevices[old_gpu]) { + found_gpu = true; + break; + } + } + + if (!found_gpu) { + found_all_gpus = false; + break; + } + } + if (!found_all_gpus) { + continue; + } else { + new_phys_dev_groups[new_idx] = inst->phys_dev_groups_tramp[old_idx]; + break; + } + } + } + + // If this physical device group isn't in the old buffer, create it + if (NULL == new_phys_dev_groups[new_idx]) { + new_phys_dev_groups[new_idx] = (VkPhysicalDeviceGroupPropertiesKHR *)loader_instance_heap_alloc( + inst, sizeof(VkPhysicalDeviceGroupPropertiesKHR), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if (NULL == new_phys_dev_groups[new_idx]) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTrampPhysDevGroups: Failed to allocate " + "physical device group trampoline object %d", + new_idx); + total_count = new_idx; + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + memcpy(new_phys_dev_groups[new_idx], &local_phys_dev_groups[new_idx], + sizeof(VkPhysicalDeviceGroupPropertiesKHR)); + } + } + +out: + + if (VK_SUCCESS != res) { + if (NULL != new_phys_dev_groups) { + for (uint32_t i = 0; i < total_count; i++) { + loader_instance_heap_free(inst, new_phys_dev_groups[i]); + } + loader_instance_heap_free(inst, new_phys_dev_groups); + } + total_count = 0; + } else { + // Free everything that didn't carry over to the new array of + // physical device groups + if (NULL != inst->phys_dev_groups_tramp) { + for (uint32_t i = 0; i < inst->phys_dev_group_count_tramp; i++) { + bool found = false; + for (uint32_t j = 0; j < total_count; j++) { + if (inst->phys_dev_groups_tramp[i] == new_phys_dev_groups[j]) { + found = true; + break; + } + } + if (!found) { + loader_instance_heap_free(inst, inst->phys_dev_groups_tramp[i]); + } + } + loader_instance_heap_free(inst, inst->phys_dev_groups_tramp); + } + + // Swap in the new physical device group list + inst->phys_dev_group_count_tramp = total_count; + inst->phys_dev_groups_tramp = new_phys_dev_groups; + } + + return res; +} + +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroups( + VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, + VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties) { + VkResult res = VK_SUCCESS; + uint32_t count; + uint32_t i; + struct loader_instance *inst = NULL; + + loader_platform_thread_lock_mutex(&loader_lock); + + inst = loader_get_instance(instance); + if (NULL == inst) { + res = VK_ERROR_INITIALIZATION_FAILED; + goto out; + } + + if (NULL == pPhysicalDeviceGroupCount) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "vkEnumeratePhysicalDeviceGroupsKHR: Received NULL pointer for physical " + "device group count return value."); + res = VK_ERROR_INITIALIZATION_FAILED; + goto out; + } + + VkResult setup_res = setupLoaderTrampPhysDevGroups(instance); + if (VK_SUCCESS != setup_res) { + res = setup_res; + goto out; + } + + count = inst->phys_dev_group_count_tramp; + + // Wrap the PhysDev object for loader usage, return wrapped objects + if (NULL != pPhysicalDeviceGroupProperties) { + if (inst->phys_dev_group_count_tramp > *pPhysicalDeviceGroupCount) { + loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "vkEnumeratePhysicalDeviceGroupsKHR: Trimming device group count down" + " by application request from %d to %d physical device groups", + inst->phys_dev_group_count_tramp, *pPhysicalDeviceGroupCount); + count = *pPhysicalDeviceGroupCount; + res = VK_INCOMPLETE; + } + for (i = 0; i < count; i++) { + memcpy(&pPhysicalDeviceGroupProperties[i], inst->phys_dev_groups_tramp[i], + sizeof(VkPhysicalDeviceGroupPropertiesKHR)); + } + } + + *pPhysicalDeviceGroupCount = count; + +out: + + loader_platform_thread_unlock_mutex(&loader_lock); + return res; +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2 *pFeatures) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + const VkLayerInstanceDispatchTable *disp = loader_get_instance_layer_dispatch(physicalDevice); + const struct loader_instance *inst = ((struct loader_physical_device_tramp*) physicalDevice)->this_instance; + + if (inst != NULL && inst->enabled_known_extensions.khr_get_physical_device_properties2) { + disp->GetPhysicalDeviceFeatures2KHR(unwrapped_phys_dev, pFeatures); + } else { + disp->GetPhysicalDeviceFeatures2(unwrapped_phys_dev, pFeatures); + } +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, + VkPhysicalDeviceProperties2 *pProperties) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + const VkLayerInstanceDispatchTable *disp = loader_get_instance_layer_dispatch(physicalDevice); + const struct loader_instance *inst = ((struct loader_physical_device_tramp*) physicalDevice)->this_instance; + + if (inst != NULL && inst->enabled_known_extensions.khr_get_physical_device_properties2) { + disp->GetPhysicalDeviceProperties2KHR(unwrapped_phys_dev, pProperties); + } else { + disp->GetPhysicalDeviceProperties2(unwrapped_phys_dev, pProperties); + } +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice, VkFormat format, + VkFormatProperties2 *pFormatProperties) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + const VkLayerInstanceDispatchTable *disp = loader_get_instance_layer_dispatch(physicalDevice); + const struct loader_instance *inst = ((struct loader_physical_device_tramp*) physicalDevice)->this_instance; + + if (inst != NULL && inst->enabled_known_extensions.khr_get_physical_device_properties2) { + disp->GetPhysicalDeviceFormatProperties2KHR(unwrapped_phys_dev, format, pFormatProperties); + } else { + disp->GetPhysicalDeviceFormatProperties2(unwrapped_phys_dev, format, pFormatProperties); + } +} + +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, + VkImageFormatProperties2 *pImageFormatProperties) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + const VkLayerInstanceDispatchTable *disp = loader_get_instance_layer_dispatch(physicalDevice); + const struct loader_instance *inst = ((struct loader_physical_device_tramp*) physicalDevice)->this_instance; + + if (inst != NULL && inst->enabled_known_extensions.khr_get_physical_device_properties2) { + return disp->GetPhysicalDeviceImageFormatProperties2KHR(unwrapped_phys_dev, pImageFormatInfo, pImageFormatProperties); + } else { + return disp->GetPhysicalDeviceImageFormatProperties2(unwrapped_phys_dev, pImageFormatInfo, pImageFormatProperties); + } +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice, + uint32_t *pQueueFamilyPropertyCount, + VkQueueFamilyProperties2 *pQueueFamilyProperties) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + const VkLayerInstanceDispatchTable *disp = loader_get_instance_layer_dispatch(physicalDevice); + const struct loader_instance *inst = ((struct loader_physical_device_tramp*) physicalDevice)->this_instance; + + if (inst != NULL && inst->enabled_known_extensions.khr_get_physical_device_properties2) { + disp->GetPhysicalDeviceQueueFamilyProperties2KHR(unwrapped_phys_dev, pQueueFamilyPropertyCount, pQueueFamilyProperties); + } else { + disp->GetPhysicalDeviceQueueFamilyProperties2(unwrapped_phys_dev, pQueueFamilyPropertyCount, pQueueFamilyProperties); + } +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2(VkPhysicalDevice physicalDevice, + VkPhysicalDeviceMemoryProperties2 *pMemoryProperties) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + const VkLayerInstanceDispatchTable *disp = loader_get_instance_layer_dispatch(physicalDevice); + const struct loader_instance *inst = ((struct loader_physical_device_tramp*) physicalDevice)->this_instance; + + if (inst != NULL && inst->enabled_known_extensions.khr_get_physical_device_properties2) { + disp->GetPhysicalDeviceMemoryProperties2KHR(unwrapped_phys_dev, pMemoryProperties); + } else { + disp->GetPhysicalDeviceMemoryProperties2(unwrapped_phys_dev, pMemoryProperties); + } +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *pFormatInfo, uint32_t *pPropertyCount, + VkSparseImageFormatProperties2 *pProperties) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + const VkLayerInstanceDispatchTable *disp = loader_get_instance_layer_dispatch(physicalDevice); + const struct loader_instance *inst = ((struct loader_physical_device_tramp*) physicalDevice)->this_instance; + + if (inst != NULL && inst->enabled_known_extensions.khr_get_physical_device_properties2) { + disp->GetPhysicalDeviceSparseImageFormatProperties2KHR(unwrapped_phys_dev, pFormatInfo, pPropertyCount, pProperties); + } else { + disp->GetPhysicalDeviceSparseImageFormatProperties2(unwrapped_phys_dev, pFormatInfo, pPropertyCount, pProperties); + } +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalBufferProperties( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, + VkExternalBufferProperties *pExternalBufferProperties) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + const VkLayerInstanceDispatchTable *disp = loader_get_instance_layer_dispatch(physicalDevice); + const struct loader_instance *inst = ((struct loader_physical_device_tramp*) physicalDevice)->this_instance; + + if (inst != NULL && inst->enabled_known_extensions.khr_external_memory_capabilities){ + disp->GetPhysicalDeviceExternalBufferPropertiesKHR(unwrapped_phys_dev, pExternalBufferInfo, pExternalBufferProperties); + } else { + disp->GetPhysicalDeviceExternalBufferProperties(unwrapped_phys_dev, pExternalBufferInfo, pExternalBufferProperties); + } +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphoreProperties( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfoKHR *pExternalSemaphoreInfo, + VkExternalSemaphoreProperties *pExternalSemaphoreProperties) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + const VkLayerInstanceDispatchTable *disp = loader_get_instance_layer_dispatch(physicalDevice); + const struct loader_instance *inst = ((struct loader_physical_device_tramp*) physicalDevice)->this_instance; + + if (inst != NULL && inst->enabled_known_extensions.khr_external_semaphore_capabilities) { + disp->GetPhysicalDeviceExternalSemaphorePropertiesKHR(unwrapped_phys_dev, pExternalSemaphoreInfo, pExternalSemaphoreProperties); + } else { + disp->GetPhysicalDeviceExternalSemaphoreProperties(unwrapped_phys_dev, pExternalSemaphoreInfo, pExternalSemaphoreProperties); + } +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalFenceProperties( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, + VkExternalFenceProperties *pExternalFenceProperties) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + const VkLayerInstanceDispatchTable *disp = loader_get_instance_layer_dispatch(physicalDevice); + const struct loader_instance *inst = ((struct loader_physical_device_tramp*) physicalDevice)->this_instance; + + if (inst != NULL && inst->enabled_known_extensions.khr_external_fence_capabilities) { + disp->GetPhysicalDeviceExternalFencePropertiesKHR(unwrapped_phys_dev, pExternalFenceInfo, pExternalFenceProperties); + } else { + disp->GetPhysicalDeviceExternalFenceProperties(unwrapped_phys_dev, pExternalFenceInfo, pExternalFenceProperties); + } +} + +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory2( + VkDevice device, + uint32_t bindInfoCount, + const VkBindBufferMemoryInfo* pBindInfos) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->BindBufferMemory2(device, bindInfoCount, pBindInfos); +} + +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory2( + VkDevice device, + uint32_t bindInfoCount, + const VkBindImageMemoryInfo* pBindInfos) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->BindImageMemory2(device, bindInfoCount, pBindInfos); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeatures( + VkDevice device, + uint32_t heapIndex, + uint32_t localDeviceIndex, + uint32_t remoteDeviceIndex, + VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->GetDeviceGroupPeerMemoryFeatures(device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetDeviceMask( + VkCommandBuffer commandBuffer, + uint32_t deviceMask) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdSetDeviceMask(commandBuffer, deviceMask); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBase( + VkCommandBuffer commandBuffer, + uint32_t baseGroupX, + uint32_t baseGroupY, + uint32_t baseGroupZ, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdDispatchBase(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements2( + VkDevice device, + const VkImageMemoryRequirementsInfo2* pInfo, + VkMemoryRequirements2* pMemoryRequirements) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->GetImageMemoryRequirements2(device, pInfo, pMemoryRequirements); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements2( + VkDevice device, + const VkBufferMemoryRequirementsInfo2* pInfo, + VkMemoryRequirements2* pMemoryRequirements) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->GetBufferMemoryRequirements2(device, pInfo, pMemoryRequirements); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements2( + VkDevice device, + const VkImageSparseMemoryRequirementsInfo2* pInfo, + uint32_t* pSparseMemoryRequirementCount, + VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->GetImageSparseMemoryRequirements2(device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkTrimCommandPool( + VkDevice device, + VkCommandPool commandPool, + VkCommandPoolTrimFlags flags) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->TrimCommandPool(device, commandPool, flags); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2 *pQueueInfo, VkQueue *pQueue) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->GetDeviceQueue2(device, pQueueInfo, pQueue); + if (*pQueue != VK_NULL_HANDLE) + { + loader_set_dispatch(*pQueue, disp); + } +} + +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSamplerYcbcrConversion( + VkDevice device, + const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSamplerYcbcrConversion* pYcbcrConversion) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->CreateSamplerYcbcrConversion(device, pCreateInfo, pAllocator, pYcbcrConversion); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroySamplerYcbcrConversion( + VkDevice device, + VkSamplerYcbcrConversion ycbcrConversion, + const VkAllocationCallbacks* pAllocator) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->DestroySamplerYcbcrConversion(device, ycbcrConversion, pAllocator); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutSupport( + VkDevice device, + const VkDescriptorSetLayoutCreateInfo* pCreateInfo, + VkDescriptorSetLayoutSupport* pSupport) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->GetDescriptorSetLayoutSupport(device, pCreateInfo, pSupport); +} + +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL +vkCreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkDescriptorUpdateTemplate *pDescriptorUpdateTemplate) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->CreateDescriptorUpdateTemplate(device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorUpdateTemplate(VkDevice device, + VkDescriptorUpdateTemplate descriptorUpdateTemplate, + const VkAllocationCallbacks *pAllocator) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->DestroyDescriptorUpdateTemplate(device, descriptorUpdateTemplate, pAllocator); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, + VkDescriptorUpdateTemplate descriptorUpdateTemplate, + const void *pData) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->UpdateDescriptorSetWithTemplate(device, descriptorSet, descriptorUpdateTemplate, pData); +} diff -Nru vulkan-1.0.65.2+dfsg1/loader/vk_loader_layer.h vulkan-1.1.73+dfsg/loader/vk_loader_layer.h --- vulkan-1.0.65.2+dfsg1/loader/vk_loader_layer.h 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/vk_loader_layer.h 2018-03-14 09:08:48.000000000 +0000 @@ -21,11 +21,26 @@ */ #pragma once -// Linked list node for tree of debug callback functions -typedef struct VkLayerDbgFunctionNode_ { +// Linked list node for tree of debug callbacks +typedef struct VkDebugReportContent { VkDebugReportCallbackEXT msgCallback; PFN_vkDebugReportCallbackEXT pfnMsgCallback; VkFlags msgFlags; +} VkDebugReportContent; + +typedef struct VkDebugUtilsMessengerContent { + VkDebugUtilsMessengerEXT messenger; + VkDebugUtilsMessageSeverityFlagsEXT messageSeverity; + VkDebugUtilsMessageTypeFlagsEXT messageType; + PFN_vkDebugUtilsMessengerCallbackEXT pfnUserCallback; +} VkDebugUtilsMessengerContent; + +typedef struct VkLayerDbgFunctionNode_ { + bool is_messenger; + union { + VkDebugReportContent report; + VkDebugUtilsMessengerContent messenger; + }; void *pUserData; struct VkLayerDbgFunctionNode_ *pNext; } VkLayerDbgFunctionNode; diff -Nru vulkan-1.0.65.2+dfsg1/loader/vk_loader_platform.h vulkan-1.1.73+dfsg/loader/vk_loader_platform.h --- vulkan-1.0.65.2+dfsg1/loader/vk_loader_platform.h 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/vk_loader_platform.h 2018-04-27 11:24:19.000000000 +0000 @@ -1,8 +1,8 @@ /* * - * Copyright (c) 2015-2016 The Khronos Group Inc. - * Copyright (c) 2015-2016 Valve Corporation - * Copyright (c) 2015-2016 LunarG, Inc. + * Copyright (c) 2015-2018 The Khronos Group Inc. + * Copyright (c) 2015-2018 Valve Corporation + * Copyright (c) 2015-2018 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ * * Author: Ian Elliot * Author: Jon Ashburn + * Author: Lenny Komow * */ #pragma once @@ -30,7 +31,7 @@ #include "vulkan/vk_platform.h" #include "vulkan/vk_sdk_platform.h" -#if defined(__linux__) +#if defined(__linux__) || defined(__APPLE__) /* Linux-specific common code: */ // Headers: @@ -70,6 +71,7 @@ #define LAYERS_SOURCE_PATH NULL #endif #define LAYERS_PATH_ENV "VK_LAYER_PATH" +#define ENABLED_LAYERS_ENV "VK_INSTANCE_LAYERS" #define RELATIVE_VK_DRIVERS_INFO VULKAN_DIR VULKAN_ICDCONF_DIR #define RELATIVE_VK_ELAYERS_INFO VULKAN_DIR VULKAN_ELAYERCONF_DIR @@ -116,13 +118,11 @@ // Threads: typedef pthread_t loader_platform_thread; #define THREAD_LOCAL_DECL __thread -#define LOADER_PLATFORM_THREAD_ONCE_DECLARATION(var) pthread_once_t var = PTHREAD_ONCE_INIT; -#define LOADER_PLATFORM_THREAD_ONCE_DEFINITION(var) pthread_once_t var; -static inline void loader_platform_thread_once(pthread_once_t *ctl, void (*func)(void)) { - assert(func != NULL); - assert(ctl != NULL); - pthread_once(ctl, func); -} + +// The once init functionality is not used on Linux +#define LOADER_PLATFORM_THREAD_ONCE_DECLARATION(var) +#define LOADER_PLATFORM_THREAD_ONCE_DEFINITION(var) +#define LOADER_PLATFORM_THREAD_ONCE(ctl, func) // Thread IDs: typedef pthread_t loader_platform_thread_id; @@ -182,6 +182,7 @@ #define LAYERS_SOURCE_PATH NULL #endif #define LAYERS_PATH_ENV "VK_LAYER_PATH" +#define ENABLED_LAYERS_ENV "VK_INSTANCE_LAYERS" #define RELATIVE_VK_DRIVERS_INFO "" #define RELATIVE_VK_ELAYERS_INFO "" #define RELATIVE_VK_ILAYERS_INFO "" @@ -221,7 +222,15 @@ return true; } -static bool loader_platform_is_path_absolute(const char *path) { return !PathIsRelative(path); } +static bool loader_platform_is_path_absolute(const char *path) { + if (!path || !*path) { + return false; + } + if (*path == DIRECTORY_SYMBOL || path[1] == ':') { + return true; + } + return false; +} // WIN32 runtime doesn't have dirname(). static inline char *loader_platform_dirname(char *path) { @@ -272,7 +281,7 @@ static loader_platform_dl_handle loader_platform_open_library(const char *lib_path) { // Try loading the library the original way first. loader_platform_dl_handle lib_handle = LoadLibrary(lib_path); - if (lib_handle == NULL && GetLastError() == ERROR_MOD_NOT_FOUND && PathFileExists(lib_path)) { + if (lib_handle == NULL && GetLastError() == ERROR_MOD_NOT_FOUND) { // If that failed, then try loading it with broader search folders. lib_handle = LoadLibraryEx(lib_path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR); } @@ -280,14 +289,14 @@ } static char *loader_platform_open_library_error(const char *libPath) { static char errorMsg[164]; - (void)snprintf(errorMsg, 163, "Failed to open dynamic library \"%s\" with error %d", libPath, GetLastError()); + (void)snprintf(errorMsg, 163, "Failed to open dynamic library \"%s\" with error %lu", libPath, GetLastError()); return errorMsg; } static void loader_platform_close_library(loader_platform_dl_handle library) { FreeLibrary(library); } static void *loader_platform_get_proc_address(loader_platform_dl_handle library, const char *name) { assert(library); assert(name); - return GetProcAddress(library, name); + return (void *)GetProcAddress(library, name); } static char *loader_platform_get_proc_address_error(const char *name) { static char errorMsg[120]; @@ -298,19 +307,29 @@ // Threads: typedef HANDLE loader_platform_thread; #define THREAD_LOCAL_DECL __declspec(thread) + +// The once init functionality is not used when building a DLL on Windows. This is because there is no way to clean up the +// resources allocated by anything allocated by once init. This isn't a problem for static libraries, but it is for dynamic +// ones. When building a DLL, we use DllMain() instead to allow properly cleaning up resources. +#if defined(LOADER_DYNAMIC_LIB) +#define LOADER_PLATFORM_THREAD_ONCE_DECLARATION(var) +#define LOADER_PLATFORM_THREAD_ONCE_DEFINITION(var) +#define LOADER_PLATFORM_THREAD_ONCE(ctl, func) +#else #define LOADER_PLATFORM_THREAD_ONCE_DECLARATION(var) INIT_ONCE var = INIT_ONCE_STATIC_INIT; #define LOADER_PLATFORM_THREAD_ONCE_DEFINITION(var) INIT_ONCE var; +#define LOADER_PLATFORM_THREAD_ONCE(ctl, func) loader_platform_thread_once_fn(ctl, func) static BOOL CALLBACK InitFuncWrapper(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *Context) { void (*func)(void) = (void (*)(void))Parameter; func(); return TRUE; } - -static void loader_platform_thread_once(void *ctl, void (*func)(void)) { +static void loader_platform_thread_once_fn(void *ctl, void (*func)(void)) { assert(func != NULL); assert(ctl != NULL); - InitOnceExecuteOnce((PINIT_ONCE)ctl, InitFuncWrapper, func, NULL); + InitOnceExecuteOnce((PINIT_ONCE)ctl, InitFuncWrapper, (void *)func, NULL); } +#endif // Thread IDs: typedef DWORD loader_platform_thread_id; diff -Nru vulkan-1.0.65.2+dfsg1/loader/vulkan-1.def vulkan-1.1.73+dfsg/loader/vulkan-1.def --- vulkan-1.0.65.2+dfsg1/loader/vulkan-1.def 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/vulkan-1.def 2018-04-27 11:24:19.000000000 +0000 @@ -180,3 +180,34 @@ vkCreateSharedSwapchainsKHR vkCreateWin32SurfaceKHR vkGetPhysicalDeviceWin32PresentationSupportKHR + + vkEnumerateInstanceVersion + vkEnumeratePhysicalDeviceGroups + vkGetPhysicalDeviceFeatures2 + vkGetPhysicalDeviceProperties2 + vkGetPhysicalDeviceFormatProperties2 + vkGetPhysicalDeviceQueueFamilyProperties2 + vkGetPhysicalDeviceMemoryProperties2 + vkGetPhysicalDeviceSparseImageFormatProperties2 + vkGetPhysicalDeviceExternalBufferProperties + vkGetPhysicalDeviceExternalSemaphoreProperties + vkGetPhysicalDeviceExternalFenceProperties + vkBindBufferMemory2 + vkBindImageMemory2 + vkGetDeviceGroupPeerMemoryFeatures + vkCmdSetDeviceMask + vkCmdDispatchBase + vkGetImageMemoryRequirements2 + vkGetBufferMemoryRequirements2 + vkTrimCommandPool + vkGetDeviceQueue2 + vkCreateSamplerYcbcrConversion + vkDestroySamplerYcbcrConversion + vkGetDescriptorSetLayoutSupport + vkGetDeviceGroupPresentCapabilitiesKHR + vkGetDeviceGroupSurfacePresentModesKHR + vkGetPhysicalDevicePresentRectanglesKHR + vkAcquireNextImage2KHR + vkCreateDescriptorUpdateTemplate + vkDestroyDescriptorUpdateTemplate + vkUpdateDescriptorSetWithTemplate diff -Nru vulkan-1.0.65.2+dfsg1/loader/wsi.c vulkan-1.1.73+dfsg/loader/wsi.c --- vulkan-1.0.65.2+dfsg1/loader/wsi.c 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/wsi.c 2018-04-27 11:24:19.000000000 +0000 @@ -55,6 +55,12 @@ #ifdef VK_USE_PLATFORM_ANDROID_KHR ptr_instance->wsi_android_surface_enabled = false; #endif // VK_USE_PLATFORM_ANDROID_KHR +#ifdef VK_USE_PLATFORM_MACOS_MVK + ptr_instance->wsi_macos_surface_enabled = false; +#endif // VK_USE_PLATFORM_MACOS_MVK +#ifdef VK_USE_PLATFORM_IOS_MVK + ptr_instance->wsi_ios_surface_enabled = false; +#endif // VK_USE_PLATFORM_IOS_MVK ptr_instance->wsi_display_enabled = false; @@ -99,6 +105,18 @@ continue; } #endif // VK_USE_PLATFORM_ANDROID_KHR +#ifdef VK_USE_PLATFORM_MACOS_MVK + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_MVK_MACOS_SURFACE_EXTENSION_NAME) == 0) { + ptr_instance->wsi_macos_surface_enabled = true; + continue; + } +#endif // VK_USE_PLATFORM_MACOS_MVK +#ifdef VK_USE_PLATFORM_IOS_MVK + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_MVK_IOS_SURFACE_EXTENSION_NAME) == 0) { + ptr_instance->wsi_ios_surface_enabled = true; + continue; + } +#endif // VK_USE_PLATFORM_IOS_MVK if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_DISPLAY_EXTENSION_NAME) == 0) { ptr_instance->wsi_display_enabled = true; continue; @@ -378,8 +396,7 @@ } VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkSwapchainKHR *pSwapchain) { + const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain) { uint32_t icd_index = 0; struct loader_device *dev; struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, &icd_index); @@ -1066,7 +1083,6 @@ } pIcdSurface->base.platform = VK_ICD_WSI_PLATFORM_ANDROID; - pIcdSurface->dpy = dpy; pIcdSurface->window = window; *pSurface = (VkSurfaceKHR)pIcdSurface; @@ -1076,6 +1092,129 @@ #endif // VK_USE_PLATFORM_ANDROID_KHR +#ifdef VK_USE_PLATFORM_MACOS_MVK + +// Functions for the VK_MVK_macos_surface extension: + +// This is the trampoline entrypoint for CreateMacOSSurfaceMVK +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK(VkInstance instance, + const VkMacOSSurfaceCreateInfoMVK *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkSurfaceKHR *pSurface) { + const VkLayerInstanceDispatchTable *disp; + disp = loader_get_instance_layer_dispatch(instance); + VkResult res; + + res = disp->CreateMacOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface); + return res; +} + +// This is the instance chain terminator function for CreateMacOSSurfaceKHR +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateMacOSSurfaceMVK(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { + VkResult vkRes = VK_SUCCESS; + VkIcdSurface *pIcdSurface = NULL; + uint32_t i = 0; + + // First, check to ensure the appropriate extension was enabled: + struct loader_instance *ptr_instance = loader_get_instance(instance); + if (!ptr_instance->wsi_macos_surface_enabled) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "VK_MVK_macos_surface extension not enabled. vkCreateMacOSSurfaceMVK not executed!\n"); + vkRes = VK_ERROR_EXTENSION_NOT_PRESENT; + goto out; + } + + // Next, if so, proceed with the implementation of this function: + pIcdSurface = AllocateIcdSurfaceStruct(ptr_instance, sizeof(pIcdSurface->macos_surf.base), sizeof(pIcdSurface->macos_surf)); + if (pIcdSurface == NULL) { + vkRes = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + + pIcdSurface->macos_surf.base.platform = VK_ICD_WSI_PLATFORM_MACOS; + pIcdSurface->macos_surf.pView = pCreateInfo->pView; + + // Loop through each ICD and determine if they need to create a surface + for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { + if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { + if (NULL != icd_term->dispatch.CreateMacOSSurfaceMVK) { + vkRes = icd_term->dispatch.CreateMacOSSurfaceMVK(icd_term->instance, pCreateInfo, pAllocator, + &pIcdSurface->real_icd_surfaces[i]); + if (VK_SUCCESS != vkRes) { + goto out; + } + } + } + } + + *pSurface = (VkSurfaceKHR)pIcdSurface; + +out: + + if (VK_SUCCESS != vkRes && NULL != pIcdSurface) { + if (NULL != pIcdSurface->real_icd_surfaces) { + i = 0; + for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { + if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) { + icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); + } + } + loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces); + } + loader_instance_heap_free(ptr_instance, pIcdSurface); + } + + return vkRes; +} + +#endif // VK_USE_PLATFORM_MACOS_MVK + +#ifdef VK_USE_PLATFORM_IOS_MVK + +// Functions for the VK_MVK_ios_surface extension: + +// This is the trampoline entrypoint for CreateIOSSurfaceMVK +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK(VkInstance instance, + const VkIOSSurfaceCreateInfoMVK *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkSurfaceKHR *pSurface) { + const VkLayerInstanceDispatchTable *disp; + disp = loader_get_instance_layer_dispatch(instance); + VkResult res; + + res = disp->CreateIOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface); + return res; +} + +// This is the instance chain terminator function for CreateIOSSurfaceKHR +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateIOSSurfaceMVK(VkInstance instance, const VkIOSSurfaceCreateInfoMVK *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { + // First, check to ensure the appropriate extension was enabled: + struct loader_instance *ptr_instance = loader_get_instance(instance); + if (!ptr_instance->wsi_ios_surface_enabled) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "VK_MVK_ios_surface extension not enabled. vkCreateIOSSurfaceMVK not executed!\n"); + return VK_ERROR_EXTENSION_NOT_PRESENT; + } + + // Next, if so, proceed with the implementation of this function: + VkIcdSurfaceIOS *pIcdSurface = + loader_instance_heap_alloc(ptr_instance, sizeof(VkIcdSurfaceIOS), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + if (pIcdSurface == NULL) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + + pIcdSurface->base.platform = VK_ICD_WSI_PLATFORM_IOS; + pIcdSurface->pView = pCreateInfo->pView; + + *pSurface = (VkSurfaceKHR)pIcdSurface; + + return VK_SUCCESS; +} + +#endif // VK_USE_PLATFORM_IOS_MVK + // Functions for the VK_KHR_display instance extension: LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, @@ -1386,6 +1525,76 @@ return VK_SUCCESS; } +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupPresentCapabilitiesKHR( + VkDevice device, + VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetDeviceGroupPresentCapabilitiesKHR(device, pDeviceGroupPresentCapabilities); +} + +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModesKHR( + VkDevice device, + VkSurfaceKHR surface, + VkDeviceGroupPresentModeFlagsKHR* pModes) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetDeviceGroupSurfacePresentModesKHR(device, surface, pModes); +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDeviceGroupSurfacePresentModesKHR( + VkDevice device, + VkSurfaceKHR surface, + VkDeviceGroupPresentModeFlagsKHR* pModes) { + uint32_t icd_index = 0; + struct loader_device *dev; + struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, &icd_index); + if (NULL != icd_term && NULL != icd_term->dispatch.GetDeviceGroupSurfacePresentModesKHR) { + VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)surface; + if (NULL != icd_surface->real_icd_surfaces && (VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[icd_index]) { + return icd_term->dispatch.GetDeviceGroupSurfacePresentModesKHR(device, icd_surface->real_icd_surfaces[icd_index], pModes); + } + return icd_term->dispatch.GetDeviceGroupSurfacePresentModesKHR(device, surface, pModes); + } + return VK_SUCCESS; +} + +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDevicePresentRectanglesKHR( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + uint32_t* pRectCount, + VkRect2D* pRects) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + return disp->GetPhysicalDevicePresentRectanglesKHR(unwrapped_phys_dev, surface, pRectCount, pRects); +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDevicePresentRectanglesKHR( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + uint32_t* pRectCount, + VkRect2D* pRects) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + if (NULL == icd_term->dispatch.GetPhysicalDevicePresentRectanglesKHR) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD associated with VkPhysicalDevice does not support GetPhysicalDevicePresentRectanglesKHX"); + } + VkIcdSurface *icd_surface = (VkIcdSurface *)(surface); + uint8_t icd_index = phys_dev_term->icd_index; + if (NULL != icd_surface->real_icd_surfaces && NULL != (void *)icd_surface->real_icd_surfaces[icd_index]) { + return icd_term->dispatch.GetPhysicalDevicePresentRectanglesKHR(phys_dev_term->phys_dev, icd_surface->real_icd_surfaces[icd_index], pRectCount, pRects); + } + return icd_term->dispatch.GetPhysicalDevicePresentRectanglesKHR(phys_dev_term->phys_dev, surface, pRectCount, pRects); +} + +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImage2KHR( + VkDevice device, + const VkAcquireNextImageInfoKHR* pAcquireInfo, + uint32_t* pImageIndex) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->AcquireNextImage2KHR(device, pAcquireInfo, pImageIndex); +} + bool wsi_swapchain_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr) { *addr = NULL; @@ -1411,6 +1620,21 @@ return true; } + if (!strcmp("vkGetDeviceGroupPresentCapabilitiesKHR", name)) { + *addr = ptr_instance->wsi_surface_enabled ? (void *)vkGetDeviceGroupPresentCapabilitiesKHR : NULL; + return true; + } + + if (!strcmp("vkGetDeviceGroupSurfacePresentModesKHR", name)) { + *addr = ptr_instance->wsi_surface_enabled ? (void *)vkGetDeviceGroupSurfacePresentModesKHR : NULL; + return true; + } + + if (!strcmp("vkGetPhysicalDevicePresentRectanglesKHR", name)) { + *addr = ptr_instance->wsi_surface_enabled ? (void *)vkGetPhysicalDevicePresentRectanglesKHR : NULL; + return true; + } + // Functions for the VK_KHR_swapchain extension: // Note: This is a device extension, and its functions are statically @@ -1437,6 +1661,10 @@ *addr = (void *)vkQueuePresentKHR; return true; } + if (!strcmp("vkAcquireNextImage2KHR", name)) { + *addr = (void *)vkAcquireNextImage2KHR; + return true; + } #ifdef VK_USE_PLATFORM_WIN32_KHR @@ -1502,10 +1730,26 @@ // Functions for the VK_KHR_android_surface extension: if (!strcmp("vkCreateAndroidSurfaceKHR", name)) { - *addr = ptr_instance->wsi_xlib_surface_enabled ? (void *)vkCreateAndroidSurfaceKHR : NULL; + *addr = ptr_instance->wsi_android_surface_enabled ? (void *)vkCreateAndroidSurfaceKHR : NULL; return true; } #endif // VK_USE_PLATFORM_ANDROID_KHR +#ifdef VK_USE_PLATFORM_MACOS_MVK + + // Functions for the VK_MVK_macos_surface extension: + if (!strcmp("vkCreateMacOSSurfaceMVK", name)) { + *addr = ptr_instance->wsi_macos_surface_enabled ? (void *)vkCreateMacOSSurfaceMVK : NULL; + return true; + } +#endif // VK_USE_PLATFORM_MACOS_MVK +#ifdef VK_USE_PLATFORM_IOS_MVK + + // Functions for the VK_MVK_ios_surface extension: + if (!strcmp("vkCreateIOSSurfaceMVK", name)) { + *addr = ptr_instance->wsi_ios_surface_enabled ? (void *)vkCreateIOSSurfaceMVK : NULL; + return true; + } +#endif // VK_USE_PLATFORM_IOS_MVK // Functions for VK_KHR_display extension: if (!strcmp("vkGetPhysicalDeviceDisplayPropertiesKHR", name)) { diff -Nru vulkan-1.0.65.2+dfsg1/loader/wsi.h vulkan-1.1.73+dfsg/loader/wsi.h --- vulkan-1.0.65.2+dfsg1/loader/wsi.h 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/loader/wsi.h 2018-04-27 11:24:19.000000000 +0000 @@ -42,6 +42,9 @@ #ifdef VK_USE_PLATFORM_XLIB_KHR VkIcdSurfaceXlib xlib_surf; #endif // VK_USE_PLATFORM_XLIB_KHR +#ifdef VK_USE_PLATFORM_MACOS_MVK + VkIcdSurfaceMacOS macos_surf; +#endif // VK_USE_PLATFORM_MACOS_MVK VkIcdSurfaceDisplay display_surf; }; uint32_t base_size; // Size of VkIcdSurfaceBase @@ -78,6 +81,11 @@ VkSurfaceKHR surface, uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes); +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDeviceGroupSurfacePresentModesKHR( + VkDevice device, + VkSurfaceKHR surface, + VkDeviceGroupPresentModeFlagsKHR* pModes); + #ifdef VK_USE_PLATFORM_WIN32_KHR VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); @@ -115,6 +123,14 @@ uint32_t queueFamilyIndex, Display *dpy, VisualID visualID); #endif +#ifdef VK_USE_PLATFORM_MACOS_MVK +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateMacOSSurfaceMVK(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); +#endif +#ifdef VK_USE_PLATFORM_IOS_MVK +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateIOSSurfaceMVK(VkInstance instance, const VkIOSSurfaceCreateInfoMVK *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); +#endif VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkDisplayPropertiesKHR *pProperties); @@ -142,4 +158,9 @@ const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchains); +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + uint32_t* pRectCount, + VkRect2D* pRects); + #endif // WSI_H diff -Nru vulkan-1.0.65.2+dfsg1/.pc/.quilt_patches vulkan-1.1.73+dfsg/.pc/.quilt_patches --- vulkan-1.0.65.2+dfsg1/.pc/.quilt_patches 2018-01-10 14:18:50.000000000 +0000 +++ vulkan-1.1.73+dfsg/.pc/.quilt_patches 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/patches diff -Nru vulkan-1.0.65.2+dfsg1/.pc/.quilt_series vulkan-1.1.73+dfsg/.pc/.quilt_series --- vulkan-1.0.65.2+dfsg1/.pc/.quilt_series 2018-01-10 14:18:50.000000000 +0000 +++ vulkan-1.1.73+dfsg/.pc/.quilt_series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -series diff -Nru vulkan-1.0.65.2+dfsg1/.pc/.version vulkan-1.1.73+dfsg/.pc/.version --- vulkan-1.0.65.2+dfsg1/.pc/.version 2018-01-10 14:18:50.000000000 +0000 +++ vulkan-1.1.73+dfsg/.pc/.version 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -2 diff -Nru vulkan-1.0.65.2+dfsg1/README.md vulkan-1.1.73+dfsg/README.md --- vulkan-1.0.65.2+dfsg1/README.md 2018-01-10 14:15:30.000000000 +0000 +++ vulkan-1.1.73+dfsg/README.md 2018-04-27 11:24:19.000000000 +0000 @@ -1,6 +1,6 @@ # Vulkan Ecosystem Components -This project provides Khronos official ICD loader and validation layers for Vulkan developers on Windows and Linux. +This project provides the Khronos official Vulkan ICD desktop loader and the Vulkan validation layers for Windows, Linux, Android, and MacOS. ## CI Build Status | Platform | Build Status | @@ -11,32 +11,36 @@ ## Introduction -Vulkan is an Explicit API, enabling direct control over how GPUs actually work. No (or very little) validation -or error checking is done inside a Vulkan driver. Applications have full control and responsibility. Any errors in -how Vulkan is used often result in a crash. This project provides standard validation layers that can be enabled -to ease development by helping developers verify their applications correctly use the Vulkan API. +Vulkan is an Explicit API, enabling direct control over how GPUs actually work. By design, minimal error checking is done inside +a Vulkan driver. Applications have full control and responsibility for correct operation. Any errors in +how Vulkan is used can result in a crash. This project provides Vulkan validation layers that can be enabled +to assist development by enabling developers to verify their applications correct use of the Vulkan API. Vulkan supports multiple GPUs and multiple global contexts (VkInstance). The ICD loader is necessary to -support multiple GPUs and the VkInstance level Vulkan commands. Additionally, the loader manages inserting -Vulkan layer libraries, including validation layers between the application and the ICD. +support multiple GPUs and VkInstance-level Vulkan commands. Additionally, the loader manages inserting +Vulkan layer libraries such as validation layers between the application and the ICD. The following components are available in this repository: -- Vulkan header files +- [Vulkan header files](include/vulkan/) - [*ICD Loader*](loader/) - [*Validation Layers*](layers/) - [*Mock ICD*](icd/) -- Demos and tests for the loader and validation layers +- [*Demos*](demos/) +- [*Tests*](tests/) -## Contributing +## Contact Information +* [Tobin Ehlis](mailto:tobine@google.com) +* [Mark Lobodzinski](mailto:mark@lunarg.com) -If you intend to contribute, the preferred work flow is for you to develop your contribution -in a fork of this repo in your GitHub account and then submit a pull request. -Please see the [CONTRIBUTING](CONTRIBUTING.md) file in this repository for more details +## Information for Developing or Contributing: + +Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file in this repository for more details. +Please see the [GOVERNANCE.md](GOVERNANCE.md) file in this repository for repository management details. ## How to Build and Run [BUILD.md](BUILD.md) -includes directions for building all the components, running the validation tests and running the demo applications. +Includes directions for building all components as well as running validation tests and demo applications. Information on how to enable the various Validation layers is in [layers/README.md](layers/README.md). @@ -44,23 +48,13 @@ Architecture and interface information for the loader is in [loader/LoaderAndLayerInterface.md](loader/LoaderAndLayerInterface.md). -#### **NOTE**: Update Nvidia Drivers -- A recent glslang change exposed a bug in the texel fetch behavior on Nvidia devices under certain situations. -- Previously, we reverted the glslang change which exposed it. -- Nvidia has since resolved the issue, and we are now removing the workaround. -- Driver installs with the fix are available on their download page, just look for: - - Linux Drivers starting with version 367.35 - - Windows Drivers starting at version 372.54 - ## License This work is released as open source under a Apache-style license from Khronos including a Khronos copyright. See COPYRIGHT.txt for a full list of licenses used in this repository. ## Acknowledgements -While this project has been developed primarily by LunarG, Inc; there are many other +While this project has been developed primarily by LunarG, Inc., there are many other companies and individuals making this possible: Valve Corporation, funding project development; Google providing significant contributions to the validation layers; Khronos providing oversight and hosting of the project. - - diff -Nru vulkan-1.0.65.2+dfsg1/scripts/cgenerator.py vulkan-1.1.73+dfsg/scripts/cgenerator.py --- vulkan-1.0.65.2+dfsg1/scripts/cgenerator.py 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/cgenerator.py 2018-03-14 09:08:48.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/python3 -i # -# Copyright (c) 2013-2017 The Khronos Group Inc. +# Copyright (c) 2013-2018 The Khronos Group Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os,re,sys +import os,re,sys,pdb from generator import * # CGeneratorOptions - subclass of GeneratorOptions. @@ -44,6 +44,7 @@ # in typedefs, such as APIENTRY. # apientryp - string to use for the calling convention macro # in function pointer typedefs, such as APIENTRYP. +# directory - directory into which to generate include files # indentFuncProto - True if prototype declarations should put each # parameter on a separate line # indentFuncPointer - True if typedefed function pointers should put each @@ -62,6 +63,7 @@ defaultExtensions = None, addExtensions = None, removeExtensions = None, + emitExtensions = None, sortProcedure = regSortFeatures, prefixText = "", genFuncPointers = True, @@ -77,7 +79,8 @@ alignFuncParam = 0): GeneratorOptions.__init__(self, filename, directory, apiname, profile, versions, emitversions, defaultExtensions, - addExtensions, removeExtensions, sortProcedure) + addExtensions, removeExtensions, + emitExtensions, sortProcedure) self.prefixText = prefixText self.genFuncPointers = genFuncPointers self.protectFile = protectFile @@ -154,6 +157,7 @@ # write(' * Default extensions included:', genOpts.defaultExtensions, file=self.outFile) # write(' * Additional extensions included:', genOpts.addExtensions, file=self.outFile) # write(' * Extensions removed:', genOpts.removeExtensions, file=self.outFile) + # write(' * Extensions emitted:', genOpts.emitExtensions, file=self.outFile) # write(' */', file=self.outFile) def endFile(self): # C-specific @@ -216,40 +220,48 @@ def appendSection(self, section, text): # self.sections[section].append('SECTION: ' + section + '\n') self.sections[section].append(text) + # self.logMsg('diag', 'appendSection(section =', section, 'text =', text) # # Type generation - def genType(self, typeinfo, name): - OutputGenerator.genType(self, typeinfo, name) + def genType(self, typeinfo, name, alias): + OutputGenerator.genType(self, typeinfo, name, alias) typeElem = typeinfo.elem - # If the type is a struct type, traverse the imbedded tags - # generating a structure. Otherwise, emit the tag text. + + # Determine the category of the type, and the type section to add + # its definition to. + # 'funcpointer' is added to the 'struct' section as a workaround for + # internal issue #877, since structures and function pointer types + # can have cross-dependencies. category = typeElem.get('category') - if (category == 'struct' or category == 'union'): - self.genStruct(typeinfo, name) + if category == 'funcpointer': + section = 'struct' else: - # Replace tags with an APIENTRY-style string - # (from self.genOpts). Copy other text through unchanged. - # If the resulting text is an empty string, don't emit it. - s = noneStr(typeElem.text) - for elem in typeElem: - if (elem.tag == 'apientry'): - s += self.genOpts.apientry + noneStr(elem.tail) - else: - s += noneStr(elem.text) + noneStr(elem.tail) - if s: + section = category + + if category == 'struct' or category == 'union': + # If the type is a struct type, generate it using the + # special-purpose generator. + self.genStruct(typeinfo, name, alias) + else: + if alias: + # If the type is an alias, just emit a typedef declaration + body = 'typedef ' + alias + ' ' + name + ';\n' + else: + # Replace tags with an APIENTRY-style string + # (from self.genOpts). Copy other text through unchanged. + # If the resulting text is an empty string, don't emit it. + body = noneStr(typeElem.text) + for elem in typeElem: + if (elem.tag == 'apientry'): + body += self.genOpts.apientry + noneStr(elem.tail) + else: + body += noneStr(elem.text) + noneStr(elem.tail) + + if body: # Add extra newline after multi-line entries. - if '\n' in s: - s += '\n' - # This is a temporary workaround for internal issue #877, - # while we consider other approaches. The problem is that - # function pointer types can have dependencies on structures - # and vice-versa, so they can't be strictly separated into - # sections. The workaround is to define those types in the - # same section, in dependency order. - if (category == 'funcpointer'): - self.appendSection('struct', s) - else: - self.appendSection(category, s) + if '\n' in body[0:-1]: + body += '\n' + self.appendSection(section, body) # # Struct (e.g. C "struct" type) generation. # This is a special case of the tag where the contents are @@ -258,104 +270,148 @@ # tags - they are a declaration of a struct or union member. # Only simple member declarations are supported (no nested # structs etc.) - def genStruct(self, typeinfo, typeName): - OutputGenerator.genStruct(self, typeinfo, typeName) - body = 'typedef ' + typeinfo.elem.get('category') + ' ' + typeName + ' {\n' - # paramdecl = self.makeCParamDecl(typeinfo.elem, self.genOpts.alignFuncParam) - targetLen = 0; - for member in typeinfo.elem.findall('.//member'): - targetLen = max(targetLen, self.getCParamTypeLength(member)) - for member in typeinfo.elem.findall('.//member'): - body += self.makeCParamDecl(member, targetLen + 4) - body += ';\n' - body += '} ' + typeName + ';\n' + # If alias != None, then this struct aliases another; just + # generate a typedef of that alias. + def genStruct(self, typeinfo, typeName, alias): + OutputGenerator.genStruct(self, typeinfo, typeName, alias) + + typeElem = typeinfo.elem + + if alias: + body = 'typedef ' + alias + ' ' + typeName + ';\n' + else: + body = 'typedef ' + typeElem.get('category') + ' ' + typeName + ' {\n' + + targetLen = 0; + for member in typeElem.findall('.//member'): + targetLen = max(targetLen, self.getCParamTypeLength(member)) + for member in typeElem.findall('.//member'): + body += self.makeCParamDecl(member, targetLen + 4) + body += ';\n' + body += '} ' + typeName + ';\n' + self.appendSection('struct', body) # # Group (e.g. C "enum" type) generation. # These are concatenated together with other types. - def genGroup(self, groupinfo, groupName): - OutputGenerator.genGroup(self, groupinfo, groupName) + # If alias != None, it is the name of another group type + # which aliases this type; just generate that alias. + def genGroup(self, groupinfo, groupName, alias = None): + OutputGenerator.genGroup(self, groupinfo, groupName, alias) groupElem = groupinfo.elem - expandName = re.sub(r'([0-9a-z_])([A-Z0-9])',r'\1_\2',groupName).upper() + if alias: + # If the group name is aliased, just emit a typedef declaration + # for the alias. + body = 'typedef ' + alias + ' ' + groupName + ';\n' + else: + self.logMsg('diag', 'CGenerator.genGroup group =', groupName, 'alias =', alias) + + # Otherwise, emit an actual enumerated type declaration + expandName = re.sub(r'([0-9a-z_])([A-Z0-9])',r'\1_\2',groupName).upper() + + expandPrefix = expandName + expandSuffix = '' + expandSuffixMatch = re.search(r'[A-Z][A-Z]+$',groupName) + if expandSuffixMatch: + expandSuffix = '_' + expandSuffixMatch.group() + # Strip off the suffix from the prefix + expandPrefix = expandName.rsplit(expandSuffix, 1)[0] + + # Prefix + body = "\ntypedef enum " + groupName + " {\n" + + # @@ Should use the type="bitmask" attribute instead + isEnum = ('FLAG_BITS' not in expandPrefix) + + # Get a list of nested 'enum' tags. + enums = groupElem.findall('enum') + + # Check for and report duplicates, and return a list with them + # removed. + enums = self.checkDuplicateEnums(enums) + + # Loop over the nested 'enum' tags. Keep track of the minimum and + # maximum numeric values, if they can be determined; but only for + # core API enumerants, not extension enumerants. This is inferred + # by looking for 'extends' attributes. + minName = None + + # Accumulate non-numeric enumerant values separately and append + # them following the numeric values, to allow for aliases. + # NOTE: this doesn't do a topological sort yet, so aliases of + # aliases can still get in the wrong order. + aliasText = "" + + for elem in enums: + # Convert the value to an integer and use that to track min/max. + (numVal,strVal) = self.enumToValue(elem, True) + name = elem.get('name') + + # Extension enumerants are only included if they are required + if self.isEnumRequired(elem): + decl = " " + name + " = " + strVal + ",\n" + if numVal != None: + body += decl + else: + aliasText += decl + + # Don't track min/max for non-numbers (numVal == None) + if isEnum and numVal != None and elem.get('extends') is None: + if minName == None: + minName = maxName = name + minValue = maxValue = numVal + elif numVal < minValue: + minName = name + minValue = numVal + elif numVal > maxValue: + maxName = name + maxValue = numVal + + # Now append the non-numeric enumerant values + body += aliasText + + # Generate min/max value tokens and a range-padding enum. Need some + # additional padding to generate correct names... + if isEnum: + body += " " + expandPrefix + "_BEGIN_RANGE" + expandSuffix + " = " + minName + ",\n" + body += " " + expandPrefix + "_END_RANGE" + expandSuffix + " = " + maxName + ",\n" + body += " " + expandPrefix + "_RANGE_SIZE" + expandSuffix + " = (" + maxName + " - " + minName + " + 1),\n" - expandPrefix = expandName - expandSuffix = '' - expandSuffixMatch = re.search(r'[A-Z][A-Z]+$',groupName) - if expandSuffixMatch: - expandSuffix = '_' + expandSuffixMatch.group() - # Strip off the suffix from the prefix - expandPrefix = expandName.rsplit(expandSuffix, 1)[0] - - # Prefix - body = "\ntypedef enum " + groupName + " {\n" - - # @@ Should use the type="bitmask" attribute instead - isEnum = ('FLAG_BITS' not in expandPrefix) - - # Loop over the nested 'enum' tags. Keep track of the minimum and - # maximum numeric values, if they can be determined; but only for - # core API enumerants, not extension enumerants. This is inferred - # by looking for 'extends' attributes. - minName = None - for elem in groupElem.findall('enum'): - # Convert the value to an integer and use that to track min/max. - # Values of form -(number) are accepted but nothing more complex. - # Should catch exceptions here for more complex constructs. Not yet. - (numVal,strVal) = self.enumToValue(elem, True) - name = elem.get('name') - - # Check for duplicate enum values and raise an error if found. - for elem2 in groupElem.findall('enum'): - if (elem != elem2): - (numVal2,strVal2) = self.enumToValue(elem2, True) - if (numVal2 == numVal): - raise UserWarning('Duplicate enum ' + name + ' = ' + elem2.get('name') + ' = ' + strVal) - - # Extension enumerants are only included if they are required - if (self.isEnumRequired(elem)): - body += " " + name + " = " + strVal + ",\n" - - if (isEnum and elem.get('extends') is None): - if (minName == None): - minName = maxName = name - minValue = maxValue = numVal - elif (numVal < minValue): - minName = name - minValue = numVal - elif (numVal > maxValue): - maxName = name - maxValue = numVal - # Generate min/max value tokens and a range-padding enum. Need some - # additional padding to generate correct names... - if isEnum: - body += " " + expandPrefix + "_BEGIN_RANGE" + expandSuffix + " = " + minName + ",\n" - body += " " + expandPrefix + "_END_RANGE" + expandSuffix + " = " + maxName + ",\n" - body += " " + expandPrefix + "_RANGE_SIZE" + expandSuffix + " = (" + maxName + " - " + minName + " + 1),\n" + body += " " + expandPrefix + "_MAX_ENUM" + expandSuffix + " = 0x7FFFFFFF\n" - body += " " + expandPrefix + "_MAX_ENUM" + expandSuffix + " = 0x7FFFFFFF\n" + # Postfix + body += "} " + groupName + ";" - # Postfix - body += "} " + groupName + ";" + # After either enumerated type or alias paths, add the declaration + # to the appropriate section for the group being defined. if groupElem.get('type') == 'bitmask': section = 'bitmask' else: section = 'group' self.appendSection(section, body) + # Enumerant generation # tags may specify their values in several ways, but are usually # just integers. - def genEnum(self, enuminfo, name): - OutputGenerator.genEnum(self, enuminfo, name) + def genEnum(self, enuminfo, name, alias): + OutputGenerator.genEnum(self, enuminfo, name, alias) (numVal,strVal) = self.enumToValue(enuminfo.elem, False) body = '#define ' + name.ljust(33) + ' ' + strVal self.appendSection('enum', body) + # # Command generation - def genCmd(self, cmdinfo, name): - OutputGenerator.genCmd(self, cmdinfo, name) - # + def genCmd(self, cmdinfo, name, alias): + OutputGenerator.genCmd(self, cmdinfo, name, alias) + + # if alias: + # prefix = '// ' + name + ' is an alias of command ' + alias + '\n' + # else: + # prefix = '' + + prefix = '' decls = self.makeCDecls(cmdinfo.elem) - self.appendSection('command', decls[0] + '\n') + self.appendSection('command', prefix + decls[0] + '\n') if (self.genOpts.genFuncPointers): self.appendSection('commandPointer', decls[1]) diff -Nru vulkan-1.0.65.2+dfsg1/scripts/check_code_format.sh vulkan-1.1.73+dfsg/scripts/check_code_format.sh --- vulkan-1.0.65.2+dfsg1/scripts/check_code_format.sh 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/check_code_format.sh 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,41 @@ +#!/bin/bash +# Copyright (c) 2017 Google 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. +# +# Script to determine if source code in Pull Request is properly formatted. +# Exits with non 0 exit code if formatting is needed. +# +# This script assumes to be invoked at the project root directory. + +RED='\033[0;31m' +GREEN='\033[0;32m' +NC='\033[0m' # No Color + +FILES_TO_CHECK=$(git diff --name-only master | grep -v -E "^include/vulkan" | grep -E ".*\.(cpp|cc|c\+\+|cxx|c|h|hpp)$") + +if [ -z "${FILES_TO_CHECK}" ]; then + echo -e "${GREEN}No source code to check for formatting.${NC}" + exit 0 +fi + +FORMAT_DIFF=$(git diff -U0 master -- ${FILES_TO_CHECK} | python ./scripts/clang-format-diff.py -p1 -style=file) + +if [ -z "${FORMAT_DIFF}" ]; then + echo -e "${GREEN}All source code in PR properly formatted.${NC}" + exit 0 +else + echo -e "${RED}Found formatting errors!${NC}" + echo "${FORMAT_DIFF}" + exit 1 +fi diff -Nru vulkan-1.0.65.2+dfsg1/scripts/check_commit_message_format.sh vulkan-1.1.73+dfsg/scripts/check_commit_message_format.sh --- vulkan-1.0.65.2+dfsg1/scripts/check_commit_message_format.sh 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/check_commit_message_format.sh 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,102 @@ +#!/bin/bash +# Copyright (c) 2018 Valve Corporation +# Copyright (c) 2018 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. +# +# Checks commit messages against project standards in CONTRIBUTING.md document +# Script to determine if commit messages in Pull Request are properly formatted. +# Exits with non 0 exit code if reformatting is needed. + +# Disable subshells +shopt -s lastpipe + +RED='\033[0;31m' +GREEN='\033[0;32m' +NC='\033[0m' # No Color + +# TRAVIS_COMMIT_RANGE contains range of commits for this PR + +# Get user-supplied commit message text for applicable commits and insert +# a unique separator string identifier. The git command returns ONLY the +# subject line and body for each of the commits. +COMMIT_TEXT=$(git log ${TRAVIS_COMMIT_RANGE} --pretty=format:"XXXNEWLINEXXX"%n%B) + +# Bail if there are none +if [ -z "${COMMIT_TEXT}" ]; then + echo -e "${GREEN}No commit messgages to check for formatting.${NC}" + exit 0 +elif ! echo $TRAVIS_COMMIT_RANGE | grep -q "\.\.\."; then + echo -e "${GREEN}No commit messgages to check for formatting.${NC}" + exit 0 +fi + +# Process commit messages +success=1 +current_line=0 +prevline="" + +# Process each line of the commit message output, resetting counter on separator +printf %s "$COMMIT_TEXT" | while IFS='' read -r line; do + # echo "Count = $current_line = $line" + current_line=$((current_line+1)) + if [ "$line" = "XXXNEWLINEXXX" ]; then + current_line=0 + fi + chars=${#line} + if [ $current_line -eq 1 ]; then + # Subject line should be 50 chars or less (but give some slack here) + if [ $chars -gt 54 ]; then + echo "The following subject line exceeds 50 characters in length." + echo " '$line'" + success=0 + fi + i=$(($chars-1)) + last_char=${line:$i:1} + # Output error if last char of subject line is not alpha-numeric + if [[ ! $last_char =~ [0-9a-zA-Z] ]]; then + echo "For the following commit, the last character of the subject line must not be non-alphanumeric." + echo " '$line'" + success=0 + fi + # Checking if subject line doesn't start with 'module: ' + prefix=$(echo $line | cut -f1 -d " ") + if [ "${prefix: -1}" != ":" ]; then + echo "The following subject line must start with a single word specifying the functional area of the change, followed by a colon and space. I.e., 'layers: Subject line here'" + echo " '$line'" + success=0 + fi + elif [ $current_line -eq 2 ]; then + # Commit message must have a blank line between subject and body + if [ $chars -ne 0 ]; then + echo "The following subject line must be followed by a blank line." + echo " '$prevline'" + success=0 + fi + else + # Lines in a commit message body must be less than 72 characters in length (but give some slack) + if [ $chars -gt 76 ]; then + echo "The following commit message body line exceeds the 72 character limit." + echo "'$line\'" + success=0 + fi + fi + prevline=$line +done + +if [ $success -eq 1 ]; then + echo -e "${GREEN}All commit messages in pull request are properly formatted.${NC}" + exit 0 +else + exit 1 +fi diff -Nru vulkan-1.0.65.2+dfsg1/scripts/check_toolchain_revisions.sh vulkan-1.1.73+dfsg/scripts/check_toolchain_revisions.sh --- vulkan-1.0.65.2+dfsg1/scripts/check_toolchain_revisions.sh 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/check_toolchain_revisions.sh 2018-03-14 09:08:48.000000000 +0000 @@ -2,7 +2,7 @@ set -e -# If any tracked revision no longer matches the local revision, blast the extenal toolchain directoies +# If any tracked revision no longer matches the local revision, blast the extenal toolchain directories function check_revision() { @@ -34,16 +34,6 @@ rev=external_revisions/glslang_revision check_revision $tool $dir $rev -tool=spirv-tools -dir=external/spirv-tools -rev=external_revisions/spirv-tools_revision -check_revision $tool $dir $rev - -tool=spirv-headers -dir=external/spirv-tools/external/spirv-headers -rev=external_revisions/spirv-headers_revision -check_revision $tool $dir $rev - tool=glslang_android dir=build-android/external/glslang rev=build-android/glslang_revision_android diff -Nru vulkan-1.0.65.2+dfsg1/scripts/common_codegen.py vulkan-1.1.73+dfsg/scripts/common_codegen.py --- vulkan-1.0.65.2+dfsg1/scripts/common_codegen.py 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/common_codegen.py 2018-03-14 09:08:48.000000000 +0000 @@ -0,0 +1,72 @@ +#!/usr/bin/python3 -i +# +# 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. +# +# Author: Mark Lobodzinski + +import os,re,sys,string +import xml.etree.ElementTree as etree +from generator import * +from collections import namedtuple +from vuid_mapping import * + +# Copyright text prefixing all headers (list of strings). +prefixStrings = [ + '/*', + '** Copyright (c) 2015-2017 The Khronos Group Inc.', + '** Copyright (c) 2015-2017 Valve Corporation', + '** Copyright (c) 2015-2017 LunarG, Inc.', + '** Copyright (c) 2015-2017 Google 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.', + '*/', + '' +] + + +platform_dict = { + 'android' : 'VK_USE_PLATFORM_ANDROID_KHR', + 'ios' : 'VK_USE_PLATFORM_IOS_MVK', + 'macos' : 'VK_USE_PLATFORM_MACOS_MVK', + 'mir' : 'VK_USE_PLATFORM_MIR_KHR', + 'vi' : 'VK_USE_PLATFORM_VI_NN', + 'wayland' : 'VK_USE_PLATFORM_WAYLAND_KHR', + 'win32' : 'VK_USE_PLATFORM_WIN32_KHR', + 'xcb' : 'VK_USE_PLATFORM_XCB_KHR', + 'xlib' : 'VK_USE_PLATFORM_XLIB_KHR', + 'xlib_xrandr' : 'VK_USE_PLATFORM_XLIB_XRANDR_EXT', +} + +# +# Return appropriate feature protect string from 'platform' tag on feature +def GetFeatureProtect(interface): + """Get platform protection string""" + platform = interface.get('platform') + protect = None + if platform is not None: + protect = platform_dict[platform] + return protect diff -Nru vulkan-1.0.65.2+dfsg1/scripts/determine_vs_version.py vulkan-1.1.73+dfsg/scripts/determine_vs_version.py --- vulkan-1.0.65.2+dfsg1/scripts/determine_vs_version.py 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/determine_vs_version.py 2018-03-14 09:08:48.000000000 +0000 @@ -20,6 +20,7 @@ import sys import os +import subprocess # Following function code snippet was found on StackOverflow (with a change to lower # camel-case on the variable names): @@ -63,7 +64,7 @@ # it into a format we can use, which is " ". if __name__ == '__main__': exeName = 'msbuild.exe' - versionCall = exeName + ' /ver' + arguments = '/ver' # Determine if the executable exists in the path, this is critical. # @@ -75,7 +76,8 @@ print('00 0000') print('Executable ' + exeName + ' not found in PATH!') else: - sysCallOut = os.popen(versionCall).read() + proc = subprocess.Popen([exeName, arguments], stdout=subprocess.PIPE) + sysCallOut = proc.stdout.readline().decode('iso-8859-1').rstrip() version = None diff -Nru vulkan-1.0.65.2+dfsg1/scripts/dispatch_table_helper_generator.py vulkan-1.1.73+dfsg/scripts/dispatch_table_helper_generator.py --- vulkan-1.0.65.2+dfsg1/scripts/dispatch_table_helper_generator.py 2017-07-03 14:21:22.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/dispatch_table_helper_generator.py 2018-03-14 09:08:48.000000000 +0000 @@ -23,6 +23,7 @@ import xml.etree.ElementTree as etree from generator import * from collections import namedtuple +from common_codegen import * # # DispatchTableHelperOutputGeneratorOptions - subclass of GeneratorOptions. @@ -37,31 +38,24 @@ defaultExtensions = None, addExtensions = None, removeExtensions = None, + emitExtensions = None, sortProcedure = regSortFeatures, prefixText = "", genFuncPointers = True, - protectFile = True, - protectFeature = True, - protectProto = None, - protectProtoStr = None, apicall = '', apientry = '', apientryp = '', - alignFuncParam = 0): + alignFuncParam = 0, + expandEnumerants = True): GeneratorOptions.__init__(self, filename, directory, apiname, profile, versions, emitversions, defaultExtensions, - addExtensions, removeExtensions, sortProcedure) + addExtensions, removeExtensions, emitExtensions, sortProcedure) self.prefixText = prefixText self.genFuncPointers = genFuncPointers self.prefixText = None - self.protectFile = protectFile - self.protectFeature = protectFeature - self.protectProto = protectProto - self.protectProtoStr = protectProtoStr self.apicall = apicall self.apientry = apientry self.apientryp = apientryp - self.alignFuncParam = alignFuncParam # # DispatchTableHelperOutputGenerator - subclass of OutputGenerator. # Generates dispatch table helper header files for LVL @@ -79,14 +73,7 @@ # Called once at the beginning of each run def beginFile(self, genOpts): OutputGenerator.beginFile(self, genOpts) - # Protect against multiple inclusions - self.protect_header = False - if (genOpts.protectFile and genOpts.filename): - self.protect_header = True - headerSym = '__' + re.sub('\.h', '_h_', os.path.basename(genOpts.filename)) - write('#ifndef', headerSym, file=self.outFile) - write('#define', headerSym, '1', file=self.outFile) - self.newline() + write("#pragma once", file=self.outFile) # User-supplied prefix text, if any (list of strings) if (genOpts.prefixText): for s in genOpts.prefixText: @@ -138,15 +125,18 @@ write("\n", file=self.outFile) write(instance_table, file=self.outFile); - if self.protect_header: - self.newline() - write('#endif', file=self.outFile) # Finish processing in superclass OutputGenerator.endFile(self) # + # Processing at beginning of each feature or extension + def beginFeature(self, interface, emit): + OutputGenerator.beginFeature(self, interface, emit) + self.featureExtraProtect = GetFeatureProtect(interface) + + # # Process commands, adding to appropriate dispatch tables - def genCmd(self, cmdinfo, name): - OutputGenerator.genCmd(self, cmdinfo, name) + def genCmd(self, cmdinfo, name, alias): + OutputGenerator.genCmd(self, cmdinfo, name, alias) avoid_entries = ['vkCreateInstance', 'vkCreateDevice'] diff -Nru vulkan-1.0.65.2+dfsg1/scripts/external_revision_generator.py vulkan-1.1.73+dfsg/scripts/external_revision_generator.py --- vulkan-1.0.65.2+dfsg1/scripts/external_revision_generator.py 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/external_revision_generator.py 2018-03-14 09:08:48.000000000 +0000 @@ -0,0 +1,114 @@ +#!/usr/bin/env python3 +# +# Copyright (c) 2015-2017 The Khronos Group Inc. +# Copyright (c) 2015-2017 Valve Corporation +# Copyright (c) 2015-2017 LunarG, Inc. +# Copyright (c) 2015-2017 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author: Cort Stratton +# Author: Jean-Francois Roy + +import argparse +import hashlib +import subprocess + +def generate(symbol_name, commit_id, output_header_file): + # Write commit ID to output header file + with open(output_header_file, "w") as header_file: + # File Comment + file_comment = '// *** THIS FILE IS GENERATED - DO NOT EDIT ***\n' + file_comment += '// See external_revision_generator.py for modifications\n' + header_file.write(file_comment) + # Copyright Notice + copyright = '' + copyright += '\n' + copyright += '/***************************************************************************\n' + copyright += ' *\n' + copyright += ' * Copyright (c) 2015-2017 The Khronos Group Inc.\n' + copyright += ' * Copyright (c) 2015-2017 Valve Corporation\n' + copyright += ' * Copyright (c) 2015-2017 LunarG, Inc.\n' + copyright += ' * Copyright (c) 2015-2017 Google Inc.\n' + copyright += ' *\n' + copyright += ' * Licensed under the Apache License, Version 2.0 (the "License");\n' + copyright += ' * you may not use this file except in compliance with the License.\n' + copyright += ' * You may obtain a copy of the License at\n' + copyright += ' *\n' + copyright += ' * http://www.apache.org/licenses/LICENSE-2.0\n' + copyright += ' *\n' + copyright += ' * Unless required by applicable law or agreed to in writing, software\n' + copyright += ' * distributed under the License is distributed on an "AS IS" BASIS,\n' + copyright += ' * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n' + copyright += ' * See the License for the specific language governing permissions and\n' + copyright += ' * limitations under the License.\n' + copyright += ' *\n' + copyright += ' * Author: Chris Forbes \n' + copyright += ' * Author: Cort Stratton \n' + copyright += ' *\n' + copyright += ' ****************************************************************************/\n' + header_file.write(copyright) + # Contents + contents = '#pragma once\n\n' + contents += '#define %s "%s"\n' % (symbol_name, commit_id) + header_file.write(contents) + +def get_commit_id_from_git(git_binary, source_dir): + return subprocess.check_output([git_binary, "rev-parse", "HEAD"], cwd=source_dir).decode('utf-8').strip() + +def is_sha1(str): + try: str_as_int = int(str, 16) + except ValueError: return False + return len(str) == 40 + +def get_commit_id_from_file(rev_file): + with open(rev_file, 'r') as rev_stream: + rev_contents = rev_stream.read() + rev_contents_stripped = rev_contents.strip() + if is_sha1(rev_contents_stripped): + return rev_contents_stripped; + # otherwise, SHA1 the entire (unstripped) file contents + sha1 = hashlib.sha1(); + sha1.update(rev_contents.encode('utf-8')) + return sha1.hexdigest() + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("-s", "--symbol_name", metavar="SYMBOL_NAME", required=True, help="C symbol name") + parser.add_argument("-o", "--output_header_file", metavar="OUTPUT_HEADER_FILE", required=True, help="output header file path") + rev_method_group = parser.add_mutually_exclusive_group(required=True) + rev_method_group.add_argument("--git_dir", metavar="SOURCE_DIR", help="git working copy directory") + rev_method_group.add_argument("--rev_file", metavar="REVISION_FILE", help="source revision file path (must contain a SHA1 hash") + args = parser.parse_args() + + # We can either parse the latest Git commit ID out of the specified repository (preferred where possible), + # or computing the SHA1 hash of the contents of a file passed on the command line and (where necessary -- + # e.g. when building the layers outside of a Git environment). + if args.git_dir is not None: + # Extract commit ID from the specified source directory + try: + commit_id = get_commit_id_from_git('git', args.git_dir) + except WindowsError: + # Call git.bat on Windows for compatiblity. + commit_id = get_commit_id_from_git('git.bat', args.git_dir) + elif args.rev_file is not None: + # Read the commit ID from a file. + commit_id = get_commit_id_from_file(args.rev_file) + + if not is_sha1(commit_id): + raise ValueError("commit ID for " + args.symbol_name + " must be a SHA1 hash.") + + generate(args.symbol_name, commit_id, args.output_header_file) + +if __name__ == '__main__': + main() diff -Nru vulkan-1.0.65.2+dfsg1/scripts/generator.py vulkan-1.1.73+dfsg/scripts/generator.py --- vulkan-1.0.65.2+dfsg1/scripts/generator.py 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/generator.py 2018-03-14 09:08:48.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/python3 -i # -# Copyright (c) 2013-2017 The Khronos Group Inc. +# Copyright (c) 2013-2018 The Khronos Group Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ # limitations under the License. from __future__ import unicode_literals -import io,os,re,sys +import io,os,re,sys,pdb def write( *args, **kwargs ): file = kwargs.pop('file',sys.stdout) @@ -69,7 +69,7 @@ # Second sort key for regSortFeatures. # Sorts by feature version. elements all have version number "0" def regSortFeatureVersionKey(feature): - return float(feature.version) + return float(feature.versionNumber) # Tertiary sort key for regSortFeatures. # Sorts by extension number. elements all have extension number 0. @@ -99,7 +99,7 @@ # emitversions - regex matching API versions to actually emit # interfaces for (though all requested versions are considered # when deciding which interfaces to generate). For GL 4.3 glext.h, -# this might be '1\.[2-5]|[2-4]\.[0-9]'. +# this might be '1\.[2-5]|[2-4]\.[0-9]'. # defaultExtensions - If not None, a string which must in its # entirety match the pattern in the "supported" attribute of # the . Defaults to None. Usually the same as apiname. @@ -108,6 +108,9 @@ # removeExtensions - regex matching names of extensions to # remove (after defaultExtensions and addExtensions). Defaults # to None. +# emitExtensions - regex matching names of extensions to actually emit +# interfaces for (though all requested versions are considered when +# deciding which interfaces to generate). # sortProcedure - takes a list of FeatureInfo objects and sorts # them in place to a preferred order in the generated output. # Default is core API versions, ARB/KHR/OES extensions, all @@ -126,6 +129,7 @@ defaultExtensions = None, addExtensions = None, removeExtensions = None, + emitExtensions = None, sortProcedure = regSortFeatures): self.filename = filename self.directory = directory @@ -136,6 +140,7 @@ self.defaultExtensions = defaultExtensions self.addExtensions = self.emptyRegex(addExtensions) self.removeExtensions = self.emptyRegex(removeExtensions) + self.emitExtensions = self.emptyRegex(emitExtensions) self.sortProcedure = sortProcedure # # Substitute a regular expression which matches no version @@ -170,16 +175,16 @@ # interface - element for the / to generate # emit - actually write to the header only when True # endFeature() - finish an interface. -# genType(typeinfo,name) - generate interface for a type +# genType(typeinfo,name,alias) - generate interface for a type # typeinfo - TypeInfo for a type -# genStruct(typeinfo,name) - generate interface for a C "struct" type. +# genStruct(typeinfo,name,alias) - generate interface for a C "struct" type. # typeinfo - TypeInfo for a type interpreted as a struct -# genGroup(groupinfo,name) - generate interface for a group of enums (C "enum") +# genGroup(groupinfo,name,alias) - generate interface for a group of enums (C "enum") # groupinfo - GroupInfo for a group -# genEnum(enuminfo, name) - generate interface for an enum (constant) +# genEnum(enuminfo,name,alias) - generate interface for an enum (constant) # enuminfo - EnumInfo for an enum # name - enum name -# genCmd(cmdinfo) - generate interface for a command +# genCmd(cmdinfo,name,alias) - generate interface for a command # cmdinfo - CmdInfo for a command # isEnumRequired(enumElem) - return True if this element is required # elem - element to test @@ -260,6 +265,9 @@ # typename specified by 'extends'. This requires probing # the registry database, and imbeds knowledge of the # Vulkan extension enum scheme in this function. + # A 'alias' attribute contains the name of another enum + # which this is an alias of. The other enum must be + # declared first when emitting this enum. def enumToValue(self, elem, needsNum): name = elem.get('name') numVal = None @@ -302,8 +310,66 @@ # More logic needed! self.logMsg('diag', 'Enum', name, '-> offset [', numVal, ',', value, ']') return [numVal, value] + if 'alias' in elem.keys(): + return [None, elem.get('alias')] return [None, None] # + # checkDuplicateEnums - sanity check for enumerated values + # enums - list of Elements + # returns the list with duplicates stripped + def checkDuplicateEnums(self, enums): + # Dictionaries indexed by name and numeric value. + # Entries are [ Element, numVal, strVal ] matching name or value + + nameMap = {} + valueMap = {} + + stripped = [] + for elem in enums: + name = elem.get('name') + (numVal, strVal) = self.enumToValue(elem, True) + + if name in nameMap: + # Duplicate name found; check values + (name2, numVal2, strVal2) = nameMap[name] + + # Duplicate enum values for the same name are benign. This + # happens when defining the same enum conditionally in + # several extension blocks. + if (strVal2 == strVal or (numVal != None and + numVal == numVal2)): + True + # self.logMsg('info', 'checkDuplicateEnums: Duplicate enum (' + name + + # ') found with the same value:' + strVal) + else: + self.logMsg('warn', 'checkDuplicateEnums: Duplicate enum (' + name + + ') found with different values:' + strVal + + ' and ' + strVal2) + + # Don't add the duplicate to the returned list + continue + elif numVal in valueMap: + # Duplicate value found (such as an alias); report it, but + # still add this enum to the list. + (name2, numVal2, strVal2) = valueMap[numVal] + + try: + self.logMsg('warn', 'Two enums found with the same value: ' + + name + ' = ' + name2.get('name') + ' = ' + strVal) + except: + pdb.set_trace() + + # Track this enum to detect followon duplicates + nameMap[name] = [ elem, numVal, strVal ] + if numVal != None: + valueMap[numVal] = [ elem, numVal, strVal ] + + # Add this enum to the list + stripped.append(elem) + + # Return the list + return stripped + # def makeDir(self, path): self.logMsg('diag', 'OutputGenerator::makeDir(' + path + ')') if not (path in self.madeDirs.keys()): @@ -345,15 +411,15 @@ # tag def validateFeature(self, featureType, featureName): if (self.featureName == None): - raise UserWarning('Attempt to generate', featureType, name, - 'when not in feature') + raise UserWarning('Attempt to generate', featureType, + featureName, 'when not in feature') # # Type generation - def genType(self, typeinfo, name): + def genType(self, typeinfo, name, alias): self.validateFeature('type', name) # # Struct (e.g. C "struct" type) generation - def genStruct(self, typeinfo, name): + def genStruct(self, typeinfo, name, alias): self.validateFeature('struct', name) # The mixed-mode tags may contain no-op tags. @@ -364,15 +430,15 @@ member.remove(comment) # # Group (e.g. C "enum" type) generation - def genGroup(self, groupinfo, name): + def genGroup(self, groupinfo, name, alias): self.validateFeature('group', name) # # Enumerant (really, constant) generation - def genEnum(self, enuminfo, name): + def genEnum(self, enuminfo, name, alias): self.validateFeature('enum', name) # # Command generation - def genCmd(self, cmd, name): + def genCmd(self, cmd, name, alias): self.validateFeature('command', name) # # Utility functions - turn a into C-language prototype @@ -429,9 +495,31 @@ # required, False otherwise # elem - element to test def isEnumRequired(self, elem): - return (elem.get('extname') is None or - re.match(self.genOpts.addExtensions, elem.get('extname')) is not None or - self.genOpts.defaultExtensions == elem.get('supported')) + required = elem.get('required') != None + self.logMsg('diag', 'isEnumRequired:', elem.get('name'), + '->', required) + return required + + #@@@ This code is overridden by equivalent code now run in + #@@@ Registry.generateFeature + + required = False + + extname = elem.get('extname') + if extname is not None: + # 'supported' attribute was injected when the element was + # moved into the group in Registry.parseTree() + if self.genOpts.defaultExtensions == elem.get('supported'): + required = True + elif re.match(self.genOpts.addExtensions, extname) is not None: + required = True + elif elem.get('version') is not None: + required = re.match(self.genOpts.emitversions, elem.get('version')) is not None + else: + required = True + + return required + # # makeCDecls - return C prototype and function pointer typedef for a # command, as a two-element list of strings. diff -Nru vulkan-1.0.65.2+dfsg1/scripts/helper_file_generator.py vulkan-1.1.73+dfsg/scripts/helper_file_generator.py --- vulkan-1.0.65.2+dfsg1/scripts/helper_file_generator.py 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/helper_file_generator.py 2018-04-27 11:24:19.000000000 +0000 @@ -19,11 +19,13 @@ # # Author: Mark Lobodzinski # Author: Tobin Ehlis +# Author: John Zulauf import os,re,sys import xml.etree.ElementTree as etree from generator import * from collections import namedtuple +from common_codegen import * # # HelperFileOutputGeneratorOptions - subclass of GeneratorOptions. @@ -38,28 +40,26 @@ defaultExtensions = None, addExtensions = None, removeExtensions = None, + emitExtensions = None, sortProcedure = regSortFeatures, prefixText = "", genFuncPointers = True, protectFile = True, protectFeature = True, - protectProto = None, - protectProtoStr = None, apicall = '', apientry = '', apientryp = '', alignFuncParam = 0, library_name = '', + expandEnumerants = True, helper_file_type = ''): GeneratorOptions.__init__(self, filename, directory, apiname, profile, versions, emitversions, defaultExtensions, - addExtensions, removeExtensions, sortProcedure) + addExtensions, removeExtensions, emitExtensions, sortProcedure) self.prefixText = prefixText self.genFuncPointers = genFuncPointers self.protectFile = protectFile self.protectFeature = protectFeature - self.protectProto = protectProto - self.protectProtoStr = protectProtoStr self.apicall = apicall self.apientry = apientry self.apientryp = apientryp @@ -77,13 +77,12 @@ OutputGenerator.__init__(self, errFile, warnFile, diagFile) # Internal state - accumulators for different inner block text self.enum_output = '' # string built up of enum string routines - self.struct_size_h_output = '' # string built up of struct size header output - self.struct_size_c_output = '' # string built up of struct size source output # Internal state - accumulators for different inner block text self.structNames = [] # List of Vulkan struct typenames self.structTypes = dict() # Map of Vulkan struct typename to required VkStructureType self.structMembers = [] # List of StructMemberData records for all Vulkan structs self.object_types = [] # List of all handle types + self.object_type_aliases = [] # Aliases to handles types (for handles that were extensions) self.debug_report_object_types = [] # Handy copy of debug_report_object_type enum data self.core_object_types = [] # Handy copy of core_object_type enum data self.device_extension_info = dict() # Dict of device extension name defines and ifdef values @@ -93,6 +92,15 @@ self.StructType = namedtuple('StructType', ['name', 'value']) self.CommandParam = namedtuple('CommandParam', ['type', 'name', 'ispointer', 'isstaticarray', 'isconst', 'iscount', 'len', 'extstructs', 'cdecl']) self.StructMemberData = namedtuple('StructMemberData', ['name', 'members', 'ifdef_protect']) + + self.custom_construct_params = { + # safe_VkGraphicsPipelineCreateInfo needs to know if subpass has color and\or depth\stencil attachments to use its pointers + 'VkGraphicsPipelineCreateInfo' : + ', const bool uses_color_attachment, const bool uses_depthstencil_attachment', + # safe_VkPipelineViewportStateCreateInfo needs to know if viewport and scissor is dynamic to use its pointers + 'VkPipelineViewportStateCreateInfo' : + ', const bool is_dynamic_viewports, const bool is_dynamic_scissors', + } # # Called once at the beginning of each run def beginFile(self, genOpts): @@ -130,6 +138,7 @@ copyright += ' * Author: Courtney Goeltzenleuchter \n' copyright += ' * Author: Tobin Ehlis \n' copyright += ' * Author: Chris Forbes \n' + copyright += ' * Author: John Zulauf\n' copyright += ' *\n' copyright += ' ****************************************************************************/\n' write(copyright, file=self.outFile) @@ -149,7 +158,9 @@ def beginFeature(self, interface, emit): # Start processing in superclass OutputGenerator.beginFeature(self, interface, emit) - if self.featureName == 'VK_VERSION_1_0': + self.featureExtraProtect = GetFeatureProtect(interface) + + if self.featureName == 'VK_VERSION_1_0' or self.featureName == 'VK_VERSION_1_1': return nameElem = interface[0][1] name = nameElem.get('name') @@ -166,18 +177,16 @@ OutputGenerator.endFeature(self) # # Grab group (e.g. C "enum" type) info to output for enum-string conversion helper - def genGroup(self, groupinfo, groupName): - OutputGenerator.genGroup(self, groupinfo, groupName) + def genGroup(self, groupinfo, groupName, alias): + OutputGenerator.genGroup(self, groupinfo, groupName, alias) groupElem = groupinfo.elem # For enum_string_header if self.helper_file_type == 'enum_string_header': - value_list = [] + value_set = set() for elem in groupElem.findall('enum'): - if elem.get('supported') != 'disabled': - item_name = elem.get('name') - value_list.append(item_name) - if value_list is not None: - self.enum_output += self.GenerateEnumStringConversion(groupName, value_list) + if elem.get('supported') != 'disabled' and elem.get('alias') == None: + value_set.add(elem.get('name')) + self.enum_output += self.GenerateEnumStringConversion(groupName, value_set) elif self.helper_file_type == 'object_types_header': if groupName == 'VkDebugReportObjectTypeEXT': for elem in groupElem.findall('enum'): @@ -192,17 +201,20 @@ # # Called for each type -- if the type is a struct/union, grab the metadata - def genType(self, typeinfo, name): - OutputGenerator.genType(self, typeinfo, name) + def genType(self, typeinfo, name, alias): + OutputGenerator.genType(self, typeinfo, name, alias) typeElem = typeinfo.elem # If the type is a struct type, traverse the imbedded tags generating a structure. # Otherwise, emit the tag text. category = typeElem.get('category') if category == 'handle': - self.object_types.append(name) + if alias: + self.object_type_aliases.append((name,alias)) + else: + self.object_types.append(name) elif (category == 'struct' or category == 'union'): self.structNames.append(name) - self.genStruct(typeinfo, name) + self.genStruct(typeinfo, name, alias) # # Generate a VkStructureType based on a structure typename def genVkStructureType(self, typename): @@ -306,8 +318,8 @@ return False # # Generate local ready-access data describing Vulkan structures and unions from the XML metadata - def genStruct(self, typeinfo, typeName): - OutputGenerator.genStruct(self, typeinfo, typeName) + def genStruct(self, typeinfo, typeName, alias): + OutputGenerator.genStruct(self, typeinfo, typeName, alias) members = typeinfo.elem.findall('.//member') # Iterate over members once to get length parameters for arrays lens = set() @@ -372,7 +384,7 @@ pdev_members = members break deindex = '\n' - deindex += 'static const char * GetPhysDevFeatureString(uint32_t index) {\n' + deindex += 'static inline const char * GetPhysDevFeatureString(uint32_t index) {\n' deindex += ' const char * IndexToPhysDevFeatureString[] = {\n' for feature in pdev_members: deindex += ' "%s",\n' % feature.name @@ -395,38 +407,6 @@ enum_string_helper_header += self.DeIndexPhysDevFeatures() return enum_string_helper_header # - # struct_size_header: build function prototypes for header file - def GenerateStructSizeHeader(self): - outstring = '' - outstring += 'size_t get_struct_chain_size(const void* struct_ptr);\n' - outstring += 'size_t get_struct_size(const void* struct_ptr);\n' - for item in self.structMembers: - lower_case_name = item.name.lower() - if item.ifdef_protect != None: - outstring += '#ifdef %s\n' % item.ifdef_protect - outstring += 'size_t vk_size_%s(const %s* struct_ptr);\n' % (item.name.lower(), item.name) - if item.ifdef_protect != None: - outstring += '#endif // %s\n' % item.ifdef_protect - outstring += '#ifdef __cplusplus\n' - outstring += '}\n' - outstring += '#endif' - return outstring - # - # Combine struct size helper header file preamble with body text and return - def GenerateStructSizeHelperHeader(self): - struct_size_helper_header = '\n' - struct_size_helper_header += '#ifdef __cplusplus\n' - struct_size_helper_header += 'extern "C" {\n' - struct_size_helper_header += '#endif\n' - struct_size_helper_header += '\n' - struct_size_helper_header += '#include \n' - struct_size_helper_header += '#include \n' - struct_size_helper_header += '#include \n' - struct_size_helper_header += '\n' - struct_size_helper_header += '// Function Prototypes\n' - struct_size_helper_header += self.GenerateStructSizeHeader() - return struct_size_helper_header - # # Helper function for declaring a counter variable only once def DeclareCounter(self, string_var, declare_flag): if declare_flag == False: @@ -434,120 +414,6 @@ declare_flag = True return string_var, declare_flag # - # Build the header of the get_struct_chain_size function - def GenerateChainSizePreamble(self): - preamble = '\nsize_t get_struct_chain_size(const void* struct_ptr) {\n' - preamble += ' // Use VkApplicationInfo as struct until actual type is resolved\n' - preamble += ' VkApplicationInfo* pNext = (VkApplicationInfo*)struct_ptr;\n' - preamble += ' size_t struct_size = 0;\n' - preamble += ' while (pNext) {\n' - preamble += ' switch (pNext->sType) {\n' - return preamble - # - # Build the footer of the get_struct_chain_size function - def GenerateChainSizePostamble(self): - postamble = ' default:\n' - postamble += ' struct_size += 0;\n' - postamble += ' break;' - postamble += ' }\n' - postamble += ' pNext = (VkApplicationInfo*)pNext->pNext;\n' - postamble += ' }\n' - postamble += ' return struct_size;\n' - postamble += '}\n' - return postamble - # - # Build the header of the get_struct_size function - def GenerateStructSizePreamble(self): - preamble = '\nsize_t get_struct_size(const void* struct_ptr) {\n' - preamble += ' switch (((VkApplicationInfo*)struct_ptr)->sType) {\n' - return preamble - # - # Build the footer of the get_struct_size function - def GenerateStructSizePostamble(self): - postamble = ' default:\n' - postamble += ' return(0);\n' - postamble += ' }\n' - postamble += '}' - return postamble - # - # struct_size_helper source -- create bodies of struct size helper functions - def GenerateStructSizeSource(self): - # Construct the bodies of the struct size functions, get_struct_chain_size(), - # and get_struct_size() simultaneously - struct_size_funcs = '' - chain_size = self.GenerateChainSizePreamble() - struct_size = self.GenerateStructSizePreamble() - for item in self.structMembers: - struct_size_funcs += '\n' - lower_case_name = item.name.lower() - if item.ifdef_protect != None: - struct_size_funcs += '#ifdef %s\n' % item.ifdef_protect - struct_size += '#ifdef %s\n' % item.ifdef_protect - chain_size += '#ifdef %s\n' % item.ifdef_protect - if item.name in self.structTypes: - chain_size += ' case %s: {\n' % self.structTypes[item.name].value - chain_size += ' struct_size += vk_size_%s((%s*)pNext);\n' % (item.name.lower(), item.name) - chain_size += ' break;\n' - chain_size += ' }\n' - struct_size += ' case %s: \n' % self.structTypes[item.name].value - struct_size += ' return vk_size_%s((%s*)struct_ptr);\n' % (item.name.lower(), item.name) - struct_size_funcs += 'size_t vk_size_%s(const %s* struct_ptr) { \n' % (item.name.lower(), item.name) - struct_size_funcs += ' size_t struct_size = 0;\n' - struct_size_funcs += ' if (struct_ptr) {\n' - struct_size_funcs += ' struct_size = sizeof(%s);\n' % item.name - counter_declared = False - for member in item.members: - vulkan_type = next((i for i, v in enumerate(self.structMembers) if v[0] == member.type), None) - if member.ispointer == True: - if vulkan_type is not None: - # If this is another Vulkan structure call generated size function - if member.len is not None: - struct_size_funcs, counter_declared = self.DeclareCounter(struct_size_funcs, counter_declared) - struct_size_funcs += ' for (i = 0; i < struct_ptr->%s; i++) {\n' % member.len - struct_size_funcs += ' struct_size += vk_size_%s(&struct_ptr->%s[i]);\n' % (member.type.lower(), member.name) - struct_size_funcs += ' }\n' - else: - struct_size_funcs += ' struct_size += vk_size_%s(struct_ptr->%s);\n' % (member.type.lower(), member.name) - else: - if member.type == 'char': - # Deal with sizes of character strings - if member.len is not None: - struct_size_funcs, counter_declared = self.DeclareCounter(struct_size_funcs, counter_declared) - struct_size_funcs += ' for (i = 0; i < struct_ptr->%s; i++) {\n' % member.len - struct_size_funcs += ' struct_size += (sizeof(char*) + (sizeof(char) * (1 + strlen(struct_ptr->%s[i]))));\n' % (member.name) - struct_size_funcs += ' }\n' - else: - struct_size_funcs += ' struct_size += (struct_ptr->%s != NULL) ? sizeof(char)*(1+strlen(struct_ptr->%s)) : 0;\n' % (member.name, member.name) - else: - if member.len is not None: - # Avoid using 'sizeof(void)', which generates compile-time warnings/errors - checked_type = member.type - if checked_type == 'void': - checked_type = 'void*' - struct_size_funcs += ' struct_size += (struct_ptr->%s ) * sizeof(%s);\n' % (member.len, checked_type) - struct_size_funcs += ' }\n' - struct_size_funcs += ' return struct_size;\n' - struct_size_funcs += '}\n' - if item.ifdef_protect != None: - struct_size_funcs += '#endif // %s\n' % item.ifdef_protect - struct_size += '#endif // %s\n' % item.ifdef_protect - chain_size += '#endif // %s\n' % item.ifdef_protect - chain_size += self.GenerateChainSizePostamble() - struct_size += self.GenerateStructSizePostamble() - return_value = struct_size_funcs + chain_size + struct_size; - return return_value - # - # Combine struct size helper source file preamble with body text and return - def GenerateStructSizeHelperSource(self): - struct_size_helper_source = '\n' - struct_size_helper_source += '#include "vk_struct_size_helper.h"\n' - struct_size_helper_source += '#include \n' - struct_size_helper_source += '#include \n' - struct_size_helper_source += '\n' - struct_size_helper_source += '// Function Definitions\n' - struct_size_helper_source += self.GenerateStructSizeSource() - return struct_size_helper_source - # # Combine safe struct helper header file preamble with body text and return def GenerateSafeStructHelperHeader(self): safe_struct_helper_header = '\n' @@ -579,13 +445,13 @@ safe_struct_header += ' %s* %s;\n' % (member.type, member.name) else: safe_struct_header += '%s;\n' % member.cdecl - safe_struct_header += ' safe_%s(const %s* in_struct);\n' % (item.name, item.name) + safe_struct_header += ' safe_%s(const %s* in_struct%s);\n' % (item.name, item.name, self.custom_construct_params.get(item.name, '')) safe_struct_header += ' safe_%s(const safe_%s& src);\n' % (item.name, item.name) safe_struct_header += ' safe_%s& operator=(const safe_%s& src);\n' % (item.name, item.name) safe_struct_header += ' safe_%s();\n' % item.name safe_struct_header += ' ~safe_%s();\n' % item.name - safe_struct_header += ' void initialize(const %s* in_struct);\n' % item.name - safe_struct_header += ' void initialize(const safe_%s* src);\n' % item.name + safe_struct_header += ' void initialize(const %s* in_struct%s);\n' % (item.name, self.custom_construct_params.get(item.name, '')) + safe_struct_header += ' void initialize(const safe_%s* src);\n' % (item.name) safe_struct_header += ' %s *ptr() { return reinterpret_cast<%s *>(this); }\n' % (item.name, item.name) safe_struct_header += ' %s const *ptr() const { return reinterpret_cast<%s const *>(this); }\n' % (item.name, item.name) safe_struct_header += '};\n' @@ -595,6 +461,33 @@ # # Generate extension helper header file def GenerateExtensionHelperHeader(self): + + V_1_0_instance_extensions_promoted_to_core = [ + 'vk_khr_device_group_creation', + 'vk_khr_external_memory_capabilities', + 'vk_khr_external_fence_capabilities', + 'vk_khr_external_semaphore_capabilities', + 'vk_khr_get_physical_device_properties_2', + ] + + V_1_0_device_extensions_promoted_to_core = [ + 'vk_khr_bind_memory_2', + 'vk_khr_device_group', + 'vk_khr_descriptor_update_template', + 'vk_khr_sampler_ycbcr_conversion', + 'vk_khr_get_memory_requirements_2', + 'vk_khr_maintenance3', + 'vk_khr_maintenance1', + 'vk_khr_multiview', + 'vk_khr_external_memory', + 'vk_khr_external_semaphore', + 'vk_khr_16bit_storage', + 'vk_khr_external_fence', + 'vk_khr_maintenance2', + 'vk_khr_variable_pointers', + 'vk_khr_dedicated_allocation', + ] + extension_helper_header = '\n' extension_helper_header += '#ifndef VK_EXTENSION_HELPER_H_\n' extension_helper_header += '#define VK_EXTENSION_HELPER_H_\n' @@ -603,13 +496,17 @@ extension_helper_header += '#include \n' extension_helper_header += '#include \n' extension_helper_header += '\n' + extension_helper_header += '\n' extension_dict = dict() + promoted_ext_list = [] for type in ['Instance', 'Device']: if type == 'Instance': extension_dict = self.instance_extension_info + promoted_ext_list = V_1_0_instance_extensions_promoted_to_core struct += 'struct InstanceExtensions { \n' else: extension_dict = self.device_extension_info + promoted_ext_list = V_1_0_device_extensions_promoted_to_core struct += 'struct DeviceExtensions : public InstanceExtensions { \n' for ext_name, ifdef in extension_dict.items(): bool_name = ext_name.lower() @@ -617,9 +514,21 @@ struct += ' bool %s{false};\n' % bool_name struct += '\n' if type == 'Instance': - struct += ' void InitFromInstanceCreateInfo(const VkInstanceCreateInfo *pCreateInfo) {\n' + struct += ' uint32_t NormalizeApiVersion(uint32_t specified_version) {\n' + struct += ' uint32_t api_version = (specified_version < VK_API_VERSION_1_1) ? VK_API_VERSION_1_0 : VK_API_VERSION_1_1;\n' + struct += ' return api_version;\n' + struct += ' }\n' + struct += '\n' + + struct += ' uint32_t InitFromInstanceCreateInfo(uint32_t requested_api_version, const VkInstanceCreateInfo *pCreateInfo) {\n' else: - struct += ' void InitFromDeviceCreateInfo(const InstanceExtensions *instance_extensions, const VkDeviceCreateInfo *pCreateInfo) {\n' + struct += ' uint32_t InitFromDeviceCreateInfo(const InstanceExtensions *instance_extensions, uint32_t requested_api_version, const VkDeviceCreateInfo *pCreateInfo) {\n' + struct += '\n' + + struct += ' static const std::vector V_1_0_promoted_%s_extensions = {\n' % type.lower() + for ext_name in promoted_ext_list: + struct += ' %s_EXTENSION_NAME,\n' % ext_name.upper() + struct += ' };\n' struct += '\n' struct += ' static const std::pair known_extensions[]{\n' % type for ext_name, ifdef in extension_dict.items(): @@ -633,6 +542,7 @@ struct += ' };\n' struct += '\n' struct += ' // Initialize struct data\n' + for ext_name, ifdef in self.instance_extension_info.items(): bool_name = ext_name.lower() bool_name = re.sub('_extension_name', '', bool_name) @@ -647,9 +557,30 @@ struct += ' }\n' struct += ' }\n' struct += ' }\n' + struct += ' uint32_t api_version = NormalizeApiVersion(requested_api_version);\n' + struct += ' if (api_version >= VK_API_VERSION_1_1) {\n' + struct += ' for (auto promoted_ext : V_1_0_promoted_%s_extensions) {\n' % type.lower() + struct += ' for (auto ext : known_extensions) {\n' + struct += ' if (!strcmp(ext.first, promoted_ext)) {\n' + struct += ' this->*(ext.second) = true;\n' + struct += ' break;\n' + struct += ' }\n' + struct += ' }\n' + struct += ' }\n' + struct += ' }\n' + struct += ' return api_version;\n' struct += ' }\n' struct += '};\n' struct += '\n' + # Output reference lists of instance/device extension names + struct += 'static const char * const k%sExtensionNames = \n' % type + for ext_name, ifdef in extension_dict.items(): + if ifdef is not None: + struct += '#ifdef %s\n' % ifdef + struct += ' %s\n' % ext_name + if ifdef is not None: + struct += '#endif\n' + struct += ';\n\n' extension_helper_header += struct extension_helper_header += '\n' extension_helper_header += '#endif // VK_EXTENSION_HELPER_H_\n' @@ -666,21 +597,28 @@ # # Object types header: create object enum type header file def GenerateObjectTypesHeader(self): - object_types_header = '// Object Type enum for validation layer internal object handling\n' + object_types_header = '' + object_types_header += '// Object Type enum for validation layer internal object handling\n' object_types_header += 'typedef enum VulkanObjectType {\n' object_types_header += ' kVulkanObjectTypeUnknown = 0,\n' enum_num = 1 type_list = []; + enum_entry_map = {} # Output enum definition as each handle is processed, saving the names to use for the conversion routine for item in self.object_types: fixup_name = item[2:] enum_entry = 'kVulkanObjectType%s' % fixup_name + enum_entry_map[item] = enum_entry object_types_header += ' ' + enum_entry object_types_header += ' = %d,\n' % enum_num enum_num += 1 type_list.append(enum_entry) object_types_header += ' kVulkanObjectTypeMax = %d,\n' % enum_num + object_types_header += ' // Aliases for backwards compatibilty of "promoted" types\n' + for (name, alias) in self.object_type_aliases: + fixup_name = name[2:] + object_types_header += ' kVulkanObjectType{} = {},\n'.format(fixup_name, enum_entry_map[alias]) object_types_header += '} VulkanObjectType;\n\n' # Output name string helper @@ -692,43 +630,79 @@ object_types_header += ' "%s",\n' % fixup_name object_types_header += '};\n' + # Key creation helper for map comprehensions that convert between k and VK symbols + def to_key(regex, raw_key): return re.search(regex, raw_key).group(1).lower().replace("_","") + # Output a conversion routine from the layer object definitions to the debug report definitions + # As the VK_DEBUG_REPORT types are not being updated, specify UNKNOWN for unmatched types object_types_header += '\n' object_types_header += '// Helper array to get Vulkan VK_EXT_debug_report object type enum from the internal layers version\n' object_types_header += 'const VkDebugReportObjectTypeEXT get_debug_report_enum[] = {\n' + object_types_header += ' VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, // kVulkanObjectTypeUnknown\n' + + dbg_re = '^VK_DEBUG_REPORT_OBJECT_TYPE_(.*)_EXT$' + dbg_map = {to_key(dbg_re, dbg) : dbg for dbg in self.debug_report_object_types} + dbg_default = 'VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT' for object_type in type_list: - done = False - search_type = object_type.replace("kVulkanObjectType", "").lower() - for vk_object_type in self.debug_report_object_types: - target_type = vk_object_type.replace("VK_DEBUG_REPORT_OBJECT_TYPE_", "").lower() - target_type = target_type[:-4] - target_type = target_type.replace("_", "") - if search_type == target_type: - object_types_header += ' %s, // %s\n' % (vk_object_type, object_type) - done = True - break - if done == False: - object_types_header += ' VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, // No Match\n' + vk_object_type = dbg_map.get(object_type.replace("kVulkanObjectType", "").lower(), dbg_default) + object_types_header += ' %s, // %s\n' % (vk_object_type, object_type) object_types_header += '};\n' # Output a conversion routine from the layer object definitions to the core object type definitions + # This will intentionally *fail* for unmatched types as the VK_OBJECT_TYPE list should match the kVulkanObjectType list object_types_header += '\n' object_types_header += '// Helper array to get Official Vulkan VkObjectType enum from the internal layers version\n' object_types_header += 'const VkObjectType get_object_type_enum[] = {\n' + object_types_header += ' VK_OBJECT_TYPE_UNKNOWN, // kVulkanObjectTypeUnknown\n' + + vko_re = '^VK_OBJECT_TYPE_(.*)' + vko_map = {to_key(vko_re, vko) : vko for vko in self.core_object_types} for object_type in type_list: - done = False - search_type = object_type.replace("kVulkanObjectType", "").lower() - for vk_object_type in self.core_object_types: - target_type = vk_object_type.replace("VK_OBJECT_TYPE_", "").lower() - target_type = target_type.replace("_", "") - if search_type == target_type: - object_types_header += ' %s, // %s\n' % (vk_object_type, object_type) - done = True - break - if done == False: - object_types_header += ' VK_OBJECT_TYPE_UNKNOWN, // No Match\n' + vk_object_type = vko_map[object_type.replace("kVulkanObjectType", "").lower()] + object_types_header += ' %s, // %s\n' % (vk_object_type, object_type) object_types_header += '};\n' + # Create a function to convert from VkDebugReportObjectTypeEXT to VkObjectType + object_types_header += '\n' + object_types_header += '// Helper function to convert from VkDebugReportObjectTypeEXT to VkObjectType\n' + object_types_header += 'static inline VkObjectType convertDebugReportObjectToCoreObject(VkDebugReportObjectTypeEXT debug_report_obj){\n' + object_types_header += ' if (debug_report_obj == VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT) {\n' + object_types_header += ' return VK_OBJECT_TYPE_UNKNOWN;\n' + for core_object_type in self.core_object_types: + core_target_type = core_object_type.replace("VK_OBJECT_TYPE_", "").lower() + core_target_type = core_target_type.replace("_", "") + for dr_object_type in self.debug_report_object_types: + dr_target_type = dr_object_type.replace("VK_DEBUG_REPORT_OBJECT_TYPE_", "").lower() + dr_target_type = dr_target_type[:-4] + dr_target_type = dr_target_type.replace("_", "") + if core_target_type == dr_target_type: + object_types_header += ' } else if (debug_report_obj == %s) {\n' % dr_object_type + object_types_header += ' return %s;\n' % core_object_type + break + object_types_header += ' }\n' + object_types_header += ' return VK_OBJECT_TYPE_UNKNOWN;\n' + object_types_header += '}\n' + + # Create a function to convert from VkObjectType to VkDebugReportObjectTypeEXT + object_types_header += '\n' + object_types_header += '// Helper function to convert from VkDebugReportObjectTypeEXT to VkObjectType\n' + object_types_header += 'static inline VkDebugReportObjectTypeEXT convertCoreObjectToDebugReportObject(VkObjectType core_report_obj){\n' + object_types_header += ' if (core_report_obj == VK_OBJECT_TYPE_UNKNOWN) {\n' + object_types_header += ' return VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT;\n' + for core_object_type in self.core_object_types: + core_target_type = core_object_type.replace("VK_OBJECT_TYPE_", "").lower() + core_target_type = core_target_type.replace("_", "") + for dr_object_type in self.debug_report_object_types: + dr_target_type = dr_object_type.replace("VK_DEBUG_REPORT_OBJECT_TYPE_", "").lower() + dr_target_type = dr_target_type[:-4] + dr_target_type = dr_target_type.replace("_", "") + if core_target_type == dr_target_type: + object_types_header += ' } else if (core_report_obj == %s) {\n' % core_object_type + object_types_header += ' return %s;\n' % dr_object_type + break + object_types_header += ' }\n' + object_types_header += ' return VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT;\n' + object_types_header += '}\n' return object_types_header # # Determine if a structure needs a safe_struct helper function @@ -746,6 +720,12 @@ safe_struct_helper_source = '\n' safe_struct_helper_source += '#include "vk_safe_struct.h"\n' safe_struct_helper_source += '#include \n' + safe_struct_helper_source += '#ifdef VK_USE_PLATFORM_ANDROID_KHR\n' + safe_struct_helper_source += '#if __ANDROID_API__ < __ANDROID_API_O__\n' + safe_struct_helper_source += 'struct AHardwareBuffer {};\n' + safe_struct_helper_source += '#endif\n' + safe_struct_helper_source += '#endif\n' + safe_struct_helper_source += '\n' safe_struct_helper_source += self.GenerateSafeStructSource() return safe_struct_helper_source @@ -773,49 +753,205 @@ init_func_txt = '' # Txt for initialize() function that takes struct ptr and inits members construct_txt = '' # Body of constuctor as well as body of initialize() func following init_func_txt destruct_txt = '' - # VkWriteDescriptorSet is special case because pointers may be non-null but ignored - custom_construct_txt = {'VkWriteDescriptorSet' : - ' switch (descriptorType) {\n' - ' case VK_DESCRIPTOR_TYPE_SAMPLER:\n' - ' case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:\n' - ' case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:\n' - ' case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:\n' - ' case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT:\n' - ' if (descriptorCount && in_struct->pImageInfo) {\n' - ' pImageInfo = new VkDescriptorImageInfo[descriptorCount];\n' - ' for (uint32_t i=0; ipImageInfo[i];\n' - ' }\n' - ' }\n' - ' break;\n' - ' case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:\n' - ' case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:\n' - ' case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:\n' - ' case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:\n' - ' if (descriptorCount && in_struct->pBufferInfo) {\n' - ' pBufferInfo = new VkDescriptorBufferInfo[descriptorCount];\n' - ' for (uint32_t i=0; ipBufferInfo[i];\n' - ' }\n' - ' }\n' - ' break;\n' - ' case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:\n' - ' case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:\n' - ' if (descriptorCount && in_struct->pTexelBufferView) {\n' - ' pTexelBufferView = new VkBufferView[descriptorCount];\n' - ' for (uint32_t i=0; ipTexelBufferView[i];\n' - ' }\n' - ' }\n' - ' break;\n' - ' default:\n' - ' break;\n' - ' }\n', - 'VkShaderModuleCreateInfo' : - ' if (in_struct->pCode) {\n' - ' pCode = reinterpret_cast(new uint8_t[codeSize]);\n' - ' memcpy((void *)pCode, (void *)in_struct->pCode, codeSize);\n' - ' }\n'} + + custom_construct_txt = { + # VkWriteDescriptorSet is special case because pointers may be non-null but ignored + 'VkWriteDescriptorSet' : + ' switch (descriptorType) {\n' + ' case VK_DESCRIPTOR_TYPE_SAMPLER:\n' + ' case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:\n' + ' case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:\n' + ' case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:\n' + ' case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT:\n' + ' if (descriptorCount && in_struct->pImageInfo) {\n' + ' pImageInfo = new VkDescriptorImageInfo[descriptorCount];\n' + ' for (uint32_t i=0; ipImageInfo[i];\n' + ' }\n' + ' }\n' + ' break;\n' + ' case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:\n' + ' case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:\n' + ' case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:\n' + ' case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:\n' + ' if (descriptorCount && in_struct->pBufferInfo) {\n' + ' pBufferInfo = new VkDescriptorBufferInfo[descriptorCount];\n' + ' for (uint32_t i=0; ipBufferInfo[i];\n' + ' }\n' + ' }\n' + ' break;\n' + ' case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:\n' + ' case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:\n' + ' if (descriptorCount && in_struct->pTexelBufferView) {\n' + ' pTexelBufferView = new VkBufferView[descriptorCount];\n' + ' for (uint32_t i=0; ipTexelBufferView[i];\n' + ' }\n' + ' }\n' + ' break;\n' + ' default:\n' + ' break;\n' + ' }\n', + 'VkShaderModuleCreateInfo' : + ' if (in_struct->pCode) {\n' + ' pCode = reinterpret_cast(new uint8_t[codeSize]);\n' + ' memcpy((void *)pCode, (void *)in_struct->pCode, codeSize);\n' + ' }\n', + # VkGraphicsPipelineCreateInfo is special case because its pointers may be non-null but ignored + 'VkGraphicsPipelineCreateInfo' : + ' if (stageCount && in_struct->pStages) {\n' + ' pStages = new safe_VkPipelineShaderStageCreateInfo[stageCount];\n' + ' for (uint32_t i=0; ipStages[i]);\n' + ' }\n' + ' }\n' + ' if (in_struct->pVertexInputState)\n' + ' pVertexInputState = new safe_VkPipelineVertexInputStateCreateInfo(in_struct->pVertexInputState);\n' + ' else\n' + ' pVertexInputState = NULL;\n' + ' if (in_struct->pInputAssemblyState)\n' + ' pInputAssemblyState = new safe_VkPipelineInputAssemblyStateCreateInfo(in_struct->pInputAssemblyState);\n' + ' else\n' + ' pInputAssemblyState = NULL;\n' + ' bool has_tessellation_stage = false;\n' + ' if (stageCount && pStages)\n' + ' for (uint32_t i=0; ipTessellationState && has_tessellation_stage)\n' + ' pTessellationState = new safe_VkPipelineTessellationStateCreateInfo(in_struct->pTessellationState);\n' + ' else\n' + ' pTessellationState = NULL; // original pTessellationState pointer ignored\n' + ' bool has_rasterization = in_struct->pRasterizationState ? !in_struct->pRasterizationState->rasterizerDiscardEnable : false;\n' + ' if (in_struct->pViewportState && has_rasterization) {\n' + ' bool is_dynamic_viewports = false;\n' + ' bool is_dynamic_scissors = false;\n' + ' if (in_struct->pDynamicState && in_struct->pDynamicState->pDynamicStates) {\n' + ' for (uint32_t i = 0; i < in_struct->pDynamicState->dynamicStateCount && !is_dynamic_viewports; ++i)\n' + ' if (in_struct->pDynamicState->pDynamicStates[i] == VK_DYNAMIC_STATE_VIEWPORT)\n' + ' is_dynamic_viewports = true;\n' + ' for (uint32_t i = 0; i < in_struct->pDynamicState->dynamicStateCount && !is_dynamic_scissors; ++i)\n' + ' if (in_struct->pDynamicState->pDynamicStates[i] == VK_DYNAMIC_STATE_SCISSOR)\n' + ' is_dynamic_scissors = true;\n' + ' }\n' + ' pViewportState = new safe_VkPipelineViewportStateCreateInfo(in_struct->pViewportState, is_dynamic_viewports, is_dynamic_scissors);\n' + ' } else\n' + ' pViewportState = NULL; // original pViewportState pointer ignored\n' + ' if (in_struct->pRasterizationState)\n' + ' pRasterizationState = new safe_VkPipelineRasterizationStateCreateInfo(in_struct->pRasterizationState);\n' + ' else\n' + ' pRasterizationState = NULL;\n' + ' if (in_struct->pMultisampleState && has_rasterization)\n' + ' pMultisampleState = new safe_VkPipelineMultisampleStateCreateInfo(in_struct->pMultisampleState);\n' + ' else\n' + ' pMultisampleState = NULL; // original pMultisampleState pointer ignored\n' + ' // needs a tracked subpass state uses_depthstencil_attachment\n' + ' if (in_struct->pDepthStencilState && has_rasterization && uses_depthstencil_attachment)\n' + ' pDepthStencilState = new safe_VkPipelineDepthStencilStateCreateInfo(in_struct->pDepthStencilState);\n' + ' else\n' + ' pDepthStencilState = NULL; // original pDepthStencilState pointer ignored\n' + ' // needs a tracked subpass state usesColorAttachment\n' + ' if (in_struct->pColorBlendState && has_rasterization && uses_color_attachment)\n' + ' pColorBlendState = new safe_VkPipelineColorBlendStateCreateInfo(in_struct->pColorBlendState);\n' + ' else\n' + ' pColorBlendState = NULL; // original pColorBlendState pointer ignored\n' + ' if (in_struct->pDynamicState)\n' + ' pDynamicState = new safe_VkPipelineDynamicStateCreateInfo(in_struct->pDynamicState);\n' + ' else\n' + ' pDynamicState = NULL;\n', + # VkPipelineViewportStateCreateInfo is special case because its pointers may be non-null but ignored + 'VkPipelineViewportStateCreateInfo' : + ' if (in_struct->pViewports && !is_dynamic_viewports) {\n' + ' pViewports = new VkViewport[in_struct->viewportCount];\n' + ' memcpy ((void *)pViewports, (void *)in_struct->pViewports, sizeof(VkViewport)*in_struct->viewportCount);\n' + ' }\n' + ' else\n' + ' pViewports = NULL;\n' + ' if (in_struct->pScissors && !is_dynamic_scissors) {\n' + ' pScissors = new VkRect2D[in_struct->scissorCount];\n' + ' memcpy ((void *)pScissors, (void *)in_struct->pScissors, sizeof(VkRect2D)*in_struct->scissorCount);\n' + ' }\n' + ' else\n' + ' pScissors = NULL;\n', + # VkDescriptorSetLayoutBinding is special case because its pImmutableSamplers pointer may be non-null but ignored + 'VkDescriptorSetLayoutBinding' : + ' const bool sampler_type = in_struct->descriptorType == VK_DESCRIPTOR_TYPE_SAMPLER || in_struct->descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;\n' + ' if (descriptorCount && in_struct->pImmutableSamplers && sampler_type) {\n' + ' pImmutableSamplers = new VkSampler[descriptorCount];\n' + ' for (uint32_t i=0; ipImmutableSamplers[i];\n' + ' }\n' + ' }\n', + } + + custom_copy_txt = { + # VkGraphicsPipelineCreateInfo is special case because it has custom construct parameters + 'VkGraphicsPipelineCreateInfo' : + ' if (stageCount && src.pStages) {\n' + ' pStages = new safe_VkPipelineShaderStageCreateInfo[stageCount];\n' + ' for (uint32_t i=0; irasterizerDiscardEnable : false;\n' + ' if (src.pViewportState && has_rasterization) {\n' + ' pViewportState = new safe_VkPipelineViewportStateCreateInfo(*src.pViewportState);\n' + ' } else\n' + ' pViewportState = NULL; // original pViewportState pointer ignored\n' + ' if (src.pRasterizationState)\n' + ' pRasterizationState = new safe_VkPipelineRasterizationStateCreateInfo(*src.pRasterizationState);\n' + ' else\n' + ' pRasterizationState = NULL;\n' + ' if (src.pMultisampleState && has_rasterization)\n' + ' pMultisampleState = new safe_VkPipelineMultisampleStateCreateInfo(*src.pMultisampleState);\n' + ' else\n' + ' pMultisampleState = NULL; // original pMultisampleState pointer ignored\n' + ' if (src.pDepthStencilState && has_rasterization)\n' + ' pDepthStencilState = new safe_VkPipelineDepthStencilStateCreateInfo(*src.pDepthStencilState);\n' + ' else\n' + ' pDepthStencilState = NULL; // original pDepthStencilState pointer ignored\n' + ' if (src.pColorBlendState && has_rasterization)\n' + ' pColorBlendState = new safe_VkPipelineColorBlendStateCreateInfo(*src.pColorBlendState);\n' + ' else\n' + ' pColorBlendState = NULL; // original pColorBlendState pointer ignored\n' + ' if (src.pDynamicState)\n' + ' pDynamicState = new safe_VkPipelineDynamicStateCreateInfo(*src.pDynamicState);\n' + ' else\n' + ' pDynamicState = NULL;\n', + # VkPipelineViewportStateCreateInfo is special case because it has custom construct parameters + 'VkPipelineViewportStateCreateInfo' : + ' if (src.pViewports) {\n' + ' pViewports = new VkViewport[src.viewportCount];\n' + ' memcpy ((void *)pViewports, (void *)src.pViewports, sizeof(VkViewport)*src.viewportCount);\n' + ' }\n' + ' else\n' + ' pViewports = NULL;\n' + ' if (src.pScissors) {\n' + ' pScissors = new VkRect2D[src.scissorCount];\n' + ' memcpy ((void *)pScissors, (void *)src.pScissors, sizeof(VkRect2D)*src.scissorCount);\n' + ' }\n' + ' else\n' + ' pScissors = NULL;\n', + } + custom_destruct_txt = {'VkShaderModuleCreateInfo' : ' if (pCode)\n' ' delete[] reinterpret_cast(pCode);\n' } @@ -897,7 +1033,7 @@ construct_txt = custom_construct_txt[item.name] if item.name in custom_destruct_txt: destruct_txt = custom_destruct_txt[item.name] - safe_struct_body.append("\n%s::%s(const %s* in_struct) :%s\n{\n%s}" % (ss_name, ss_name, item.name, init_list, construct_txt)) + safe_struct_body.append("\n%s::%s(const %s* in_struct%s) :%s\n{\n%s}" % (ss_name, ss_name, item.name, self.custom_construct_params.get(item.name, ''), init_list, construct_txt)) if '' != default_init_list: default_init_list = " :%s" % (default_init_list[:-1]) safe_struct_body.append("\n%s::%s()%s\n{}" % (ss_name, ss_name, default_init_list)) @@ -906,11 +1042,13 @@ copy_construct_txt = construct_txt.replace(' (in_struct->', ' (src.') # Exclude 'if' blocks from next line copy_construct_txt = copy_construct_txt.replace('(in_struct->', '(*src.') # Pass object to copy constructors copy_construct_txt = copy_construct_txt.replace('in_struct->', 'src.') # Modify remaining struct refs for src object + if item.name in custom_copy_txt: + copy_construct_txt = custom_copy_txt[item.name] copy_assign_txt = ' if (&src == this) return *this;\n\n' + destruct_txt + '\n' + copy_construct_init + copy_construct_txt + '\n return *this;' safe_struct_body.append("\n%s::%s(const %s& src)\n{\n%s%s}" % (ss_name, ss_name, ss_name, copy_construct_init, copy_construct_txt)) # Copy constructor safe_struct_body.append("\n%s& %s::operator=(const %s& src)\n{\n%s\n}" % (ss_name, ss_name, ss_name, copy_assign_txt)) # Copy assignment operator safe_struct_body.append("\n%s::~%s()\n{\n%s}" % (ss_name, ss_name, destruct_txt)) - safe_struct_body.append("\nvoid %s::initialize(const %s* in_struct)\n{\n%s%s}" % (ss_name, item.name, init_func_txt, construct_txt)) + safe_struct_body.append("\nvoid %s::initialize(const %s* in_struct%s)\n{\n%s%s}" % (ss_name, item.name, self.custom_construct_params.get(item.name, ''), init_func_txt, construct_txt)) # Copy initializer uses same txt as copy constructor but has a ptr and not a reference init_copy = copy_construct_init.replace('src.', 'src->') init_construct = copy_construct_txt.replace('src.', 'src->') @@ -919,14 +1057,119 @@ safe_struct_body.append("#endif // %s\n" % item.ifdef_protect) return "\n".join(safe_struct_body) # + # Generate the type map + def GenerateTypeMapHelperHeader(self): + prefix = 'Lvl' + fprefix = 'lvl_' + typemap = prefix + 'TypeMap' + idmap = prefix + 'STypeMap' + type_member = 'Type' + id_member = 'kSType' + id_decl = 'static const VkStructureType ' + generic_header = prefix + 'GenericHeader' + typename_func = fprefix + 'typename' + idname_func = fprefix + 'stype_name' + find_func = fprefix + 'find_in_chain' + init_func = fprefix + 'init_struct' + + explanatory_comment = '\n'.join(( + '// These empty generic templates are specialized for each type with sType', + '// members and for each sType -- providing a two way map between structure', + '// types and sTypes')) + + empty_typemap = 'template struct ' + typemap + ' {};' + typemap_format = 'template <> struct {template}<{typename}> {{\n' + typemap_format += ' {id_decl}{id_member} = {id_value};\n' + typemap_format += '}};\n' + + empty_idmap = 'template struct ' + idmap + ' {};' + idmap_format = ''.join(( + 'template <> struct {template}<{id_value}> {{\n', + ' typedef {typename} {typedef};\n', + '}};\n')) + + # Define the utilities (here so any renaming stays consistent), if this grows large, refactor to a fixed .h file + utilities_format = '\n'.join(( + '// Header "base class" for pNext chain traversal', + 'struct {header} {{', + ' VkStructureType sType;', + ' const {header} *pNext;', + '}};', + '', + '// Find an entry of the given type in the pNext chain', + 'template const T *{find_func}(const void *next) {{', + ' const {header} *current = reinterpret_cast(next);', + ' const T *found = nullptr;', + ' while (current) {{', + ' if ({type_map}::{id_member} == current->sType) {{', + ' found = reinterpret_cast(current);', + ' current = nullptr;', + ' }} else {{', + ' current = current->pNext;', + ' }}', + ' }}', + ' return found;', + '}}', + '', + '// Init the header of an sType struct with pNext', + 'template T {init_func}(void *p_next) {{', + ' T out = {{}};', + ' out.sType = {type_map}::kSType;', + ' out.pNext = p_next;', + ' return out;', + '}}', + '', + '// Init the header of an sType struct', + 'template T {init_func}() {{', + ' T out = {{}};', + ' out.sType = {type_map}::kSType;', + ' return out;', + '}}', + + '')) + + code = [] + + # Generate header + code.append('\n'.join(( + '#pragma once', + '#include \n', + explanatory_comment, '', + empty_idmap, + empty_typemap, ''))) + + # Generate the specializations for each type and stype + for item in self.structMembers: + typename = item.name + info = self.structTypes.get(typename) + if not info: + continue + + if item.ifdef_protect != None: + code.append('#ifdef %s' % item.ifdef_protect) + + code.append('// Map type {} to id {}'.format(typename, info.value)) + code.append(typemap_format.format(template=typemap, typename=typename, id_value=info.value, + id_decl=id_decl, id_member=id_member)) + code.append(idmap_format.format(template=idmap, typename=typename, id_value=info.value, typedef=type_member)) + + if item.ifdef_protect != None: + code.append('#endif // %s' % item.ifdef_protect) + + # Generate utilities for all types + code.append('\n'.join(( + utilities_format.format(id_member=id_member, id_map=idmap, type_map=typemap, + type_member=type_member, header=generic_header, typename_func=typename_func, idname_func=idname_func, + find_func=find_func, init_func=init_func), '' + ))) + + return "\n".join(code) + + # # Create a helper file and return it as a string def OutputDestFile(self): if self.helper_file_type == 'enum_string_header': return self.GenerateEnumStringHelperHeader() - elif self.helper_file_type == 'struct_size_header': - return self.GenerateStructSizeHelperHeader() - elif self.helper_file_type == 'struct_size_source': - return self.GenerateStructSizeHelperSource() elif self.helper_file_type == 'safe_struct_header': return self.GenerateSafeStructHelperHeader() elif self.helper_file_type == 'safe_struct_source': @@ -935,6 +1178,8 @@ return self.GenerateObjectTypesHelperHeader() elif self.helper_file_type == 'extension_helper_header': return self.GenerateExtensionHelperHeader() + elif self.helper_file_type == 'typemap_helper_header': + return self.GenerateTypeMapHelperHeader() else: return 'Bad Helper File Generator Option %s' % self.helper_file_type diff -Nru vulkan-1.0.65.2+dfsg1/scripts/loader_extension_generator.py vulkan-1.1.73+dfsg/scripts/loader_extension_generator.py --- vulkan-1.0.65.2+dfsg1/scripts/loader_extension_generator.py 2017-07-31 13:57:12.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/loader_extension_generator.py 2018-04-27 11:24:19.000000000 +0000 @@ -18,11 +18,14 @@ # limitations under the License. # # Author: Mark Young +# Author: Mark Lobodzinski import os,re,sys import xml.etree.ElementTree as etree from generator import * from collections import namedtuple +from common_codegen import * + WSI_EXT_NAMES = ['VK_KHR_surface', 'VK_KHR_display', @@ -32,17 +35,48 @@ 'VK_KHR_mir_surface', 'VK_KHR_win32_surface', 'VK_KHR_android_surface', + 'VK_MVK_macos_surface', + 'VK_MVK_ios_surface', 'VK_KHR_swapchain', 'VK_KHR_display_swapchain'] +ADD_INST_CMDS = ['vkCreateInstance', + 'vkEnumerateInstanceExtensionProperties', + 'vkEnumerateInstanceLayerProperties', + 'vkEnumerateInstanceVersion'] + AVOID_EXT_NAMES = ['VK_EXT_debug_report'] +AVOID_CMD_NAMES = ['vkCreateDebugUtilsMessengerEXT', + 'vkDestroyDebugUtilsMessengerEXT', + 'vkSubmitDebugUtilsMessageEXT'] + DEVICE_CMDS_NEED_TERM = ['vkGetDeviceProcAddr', 'vkCreateSwapchainKHR', 'vkCreateSharedSwapchainsKHR', - 'vkGetDeviceGroupSurfacePresentModesKHX', + 'vkGetDeviceGroupSurfacePresentModesKHR', 'vkDebugMarkerSetObjectTagEXT', - 'vkDebugMarkerSetObjectNameEXT'] + 'vkDebugMarkerSetObjectNameEXT', + 'vkSetDebugUtilsObjectNameEXT', + 'vkSetDebugUtilsObjectTagEXT'] + +ALIASED_CMDS = { + 'vkEnumeratePhysicalDeviceGroupsKHR': 'vkEnumeratePhysicalDeviceGroups', + 'vkGetPhysicalDeviceFeatures2KHR': 'vkGetPhysicalDeviceFeatures2', + 'vkGetPhysicalDeviceProperties2KHR': 'vkGetPhysicalDeviceProperties2', + 'vkGetPhysicalDeviceFormatProperties2KHR': 'vkGetPhysicalDeviceFormatProperties2', + 'vkGetPhysicalDeviceImageFormatProperties2KHR': 'vkGetPhysicalDeviceImageFormatProperties2', + 'vkGetPhysicalDeviceQueueFamilyProperties2KHR': 'vkGetPhysicalDeviceQueueFamilyProperties2', + 'vkGetPhysicalDeviceMemoryProperties2KHR': 'vkGetPhysicalDeviceMemoryProperties2', + 'vkGetPhysicalDeviceSparseImageFormatProperties2KHR': 'vkGetPhysicalDeviceSparseImageFormatProperties2', + 'vkGetPhysicalDeviceExternalBufferPropertiesKHR': 'vkGetPhysicalDeviceExternalBufferProperties', + 'vkGetPhysicalDeviceExternalSemaphorePropertiesKHR': 'vkGetPhysicalDeviceExternalSemaphoreProperties', + 'vkGetPhysicalDeviceExternalFencePropertiesKHR': 'vkGetPhysicalDeviceExternalFenceProperties', +} + +PRE_INSTANCE_FUNCTIONS = ['vkEnumerateInstanceExtensionProperties', + 'vkEnumerateInstanceLayerProperties', + 'vkEnumerateInstanceVersion'] # # LoaderExtensionGeneratorOptions - subclass of GeneratorOptions. @@ -57,33 +91,30 @@ defaultExtensions = None, addExtensions = None, removeExtensions = None, + emitExtensions = None, sortProcedure = regSortFeatures, prefixText = "", genFuncPointers = True, protectFile = True, protectFeature = True, - protectProto = None, - protectProtoStr = None, apicall = '', apientry = '', apientryp = '', + indentFuncProto = True, + indentFuncPointer = False, alignFuncParam = 0, - currentExtension = '', - extensionOfInterest = 0): + expandEnumerants = True): GeneratorOptions.__init__(self, filename, directory, apiname, profile, versions, emitversions, defaultExtensions, - addExtensions, removeExtensions, sortProcedure) + addExtensions, removeExtensions, emitExtensions, sortProcedure) self.prefixText = prefixText - self.genFuncPointers = genFuncPointers self.prefixText = None - self.protectFile = protectFile - self.protectFeature = protectFeature - self.protectProto = protectProto - self.protectProtoStr = protectProtoStr self.apicall = apicall self.apientry = apientry self.apientryp = apientryp self.alignFuncParam = alignFuncParam + self.expandEnumerants = expandEnumerants + # # LoaderExtensionOutputGenerator - subclass of OutputGenerator. # Generates dispatch table helper header files for LVL @@ -157,7 +188,7 @@ preamble += '#include "vk_loader_extensions.h"\n' preamble += '#include \n' preamble += '#include "wsi.h"\n' - preamble += '#include "debug_report.h"\n' + preamble += '#include "debug_utils.h"\n' preamble += '#include "extension_manual.h"\n' elif self.genOpts.filename == 'vk_layer_dispatch_table.h': @@ -203,6 +234,7 @@ def beginFeature(self, interface, emit): # Start processing in superclass OutputGenerator.beginFeature(self, interface, emit) + self.featureExtraProtect = GetFeatureProtect(interface) enums = interface[0].findall('enum') self.currentExtension = '' @@ -220,8 +252,8 @@ # # Process commands, adding to appropriate dispatch tables - def genCmd(self, cmdinfo, name): - OutputGenerator.genCmd(self, cmdinfo, name) + def genCmd(self, cmdinfo, name, alias): + OutputGenerator.genCmd(self, cmdinfo, name, alias) # Get first param type params = cmdinfo.elem.findall('param') @@ -351,6 +383,7 @@ protos = '' protos += '// Structures defined externally, but used here\n' protos += 'struct loader_instance;\n' + protos += 'struct loader_device;\n' protos += 'struct loader_icd_term;\n' protos += 'struct loader_dev_dispatch_table;\n' protos += '\n' @@ -369,7 +402,7 @@ protos += '// Extension interception for vkGetDeviceProcAddr function, so we can return\n' protos += '// an appropriate terminator if this is one of those few device commands requiring\n' protos += '// a terminator.\n' - protos += 'PFN_vkVoidFunction get_extension_device_proc_terminator(const char *pName);\n' + protos += 'PFN_vkVoidFunction get_extension_device_proc_terminator(struct loader_device *dev, const char *pName);\n' protos += '\n' protos += '// Dispatch table properly filled in with appropriate terminators for the\n' protos += '// supported extensions.\n' @@ -447,7 +480,7 @@ commands = self.ext_commands for cur_cmd in commands: - is_inst_handle_type = cur_cmd.ext_type == 'instance' or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' + is_inst_handle_type = cur_cmd.name in ADD_INST_CMDS or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' if is_inst_handle_type: if cur_cmd.ext_name != cur_extension_name: @@ -488,7 +521,7 @@ commands = self.ext_commands for cur_cmd in commands: - is_inst_handle_type = cur_cmd.ext_type == 'instance' or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' + is_inst_handle_type = cur_cmd.name in ADD_INST_CMDS or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' if not is_inst_handle_type: if cur_cmd.ext_name != cur_extension_name: @@ -529,7 +562,7 @@ commands = self.ext_commands for cur_cmd in commands: - is_inst_handle_type = cur_cmd.ext_type == 'instance' or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' + is_inst_handle_type = cur_cmd.name in ADD_INST_CMDS or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' if ((is_inst_handle_type or cur_cmd.name in DEVICE_CMDS_NEED_TERM) and (cur_cmd.name != 'vkGetInstanceProcAddr' and cur_cmd.name != 'vkEnumerateDeviceLayerProperties')): @@ -580,6 +613,7 @@ 'vkCreateInstance', 'vkEnumerateInstanceExtensionProperties', 'vkEnumerateInstanceLayerProperties', + 'vkEnumerateInstanceVersion', ] for x in range(0, 2): @@ -588,15 +622,18 @@ else: commands = self.ext_commands + required = False for cur_cmd in commands: - is_inst_handle_type = cur_cmd.ext_type == 'instance' or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' + is_inst_handle_type = cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' if ((is_inst_handle_type or cur_cmd.name in DEVICE_CMDS_NEED_TERM) and (cur_cmd.name not in skip_gipa_commands)): if cur_cmd.ext_name != cur_extension_name: if 'VK_VERSION_' in cur_cmd.ext_name: table += '\n // ---- Core %s\n' % cur_cmd.ext_name[11:] + required = cur_cmd.ext_name == 'VK_VERSION_1_0' else: table += '\n // ---- %s extension commands\n' % cur_cmd.ext_name + required = False cur_extension_name = cur_cmd.ext_name # Remove 'vk' from proto name @@ -607,10 +644,7 @@ # The Core Vulkan code will be wrapped in a feature called VK_VERSION_#_# # For example: VK_VERSION_1_0 wraps the core 1.0 Vulkan functionality - if x == 0: - table += ' LOOKUP_GIPA(%s, true);\n' % (base_name) - else: - table += ' LOOKUP_GIPA(%s, false);\n' % (base_name) + table += ' LOOKUP_GIPA(%s, %s);\n' % (base_name, 'true' if required else 'false') if cur_cmd.protect is not None: table += '#endif // %s\n' % cur_cmd.protect @@ -649,12 +683,15 @@ terminators += '// Loader core instance terminators\n' for cur_cmd in self.core_commands: - is_inst_handle_type = cur_cmd.ext_type == 'instance' or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' + is_inst_handle_type = cur_cmd.name in ADD_INST_CMDS or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' if is_inst_handle_type: mod_string = '' new_terminator = cur_cmd.cdecl mod_string = new_terminator.replace("VKAPI_CALL vk", "VKAPI_CALL terminator_") + if cur_cmd.name in PRE_INSTANCE_FUNCTIONS: + mod_string = mod_string.replace(cur_cmd.name[2:] + '(\n', cur_cmd.name[2:] + '(\n const Vk' + cur_cmd.name[2:] + 'Chain* chain,\n') + if (cur_cmd.protect != None): terminators += '#ifdef %s\n' % cur_cmd.protect @@ -717,7 +754,7 @@ tables += ' VkInstance inst) {\n' for cur_cmd in commands: - is_inst_handle_type = cur_cmd.ext_type == 'instance' or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' + is_inst_handle_type = cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' if ((cur_type == 'instance' and is_inst_handle_type) or (cur_type == 'device' and not is_inst_handle_type)): if cur_cmd.ext_name != cur_extension_name: if 'VK_VERSION_' in cur_cmd.ext_name: @@ -732,7 +769,8 @@ # Names to skip if (base_name == 'CreateInstance' or base_name == 'CreateDevice' or base_name == 'EnumerateInstanceExtensionProperties' or - base_name == 'EnumerateInstanceLayerProperties'): + base_name == 'EnumerateInstanceLayerProperties' or + base_name == 'EnumerateInstanceVersion'): continue if cur_cmd.protect is not None: @@ -792,7 +830,7 @@ commands = self.ext_commands for cur_cmd in commands: - is_inst_handle_type = cur_cmd.ext_type == 'instance' or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' + is_inst_handle_type = cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' if ((cur_type == 'instance' and is_inst_handle_type) or (cur_type == 'device' and not is_inst_handle_type)): if cur_cmd.ext_name != cur_extension_name: @@ -807,7 +845,8 @@ if (base_name == 'CreateInstance' or base_name == 'CreateDevice' or base_name == 'EnumerateInstanceExtensionProperties' or - base_name == 'EnumerateInstanceLayerProperties'): + base_name == 'EnumerateInstanceLayerProperties' or + base_name == 'EnumerateInstanceVersion'): continue if cur_cmd.protect is not None: @@ -834,7 +873,7 @@ # Some extensions have to be manually added. Skip those in the automatic # generation. They will be manually added later. - manual_ext_commands = ['vkEnumeratePhysicalDeviceGroupsKHX', + manual_ext_commands = ['vkEnumeratePhysicalDeviceGroupsKHR', 'vkGetPhysicalDeviceExternalImageFormatPropertiesNV', 'vkGetPhysicalDeviceFeatures2KHR', 'vkGetPhysicalDeviceProperties2KHR', @@ -856,6 +895,7 @@ for ext_cmd in self.ext_commands: if (ext_cmd.ext_name in WSI_EXT_NAMES or ext_cmd.ext_name in AVOID_EXT_NAMES or + ext_cmd.name in AVOID_CMD_NAMES or ext_cmd.name in manual_ext_commands): continue @@ -915,8 +955,9 @@ return_prefix += 'return ' has_return_type = True - if (ext_cmd.ext_type == 'instance' or ext_cmd.handle_type == 'VkPhysicalDevice' or - 'DebugMarkerSetObject' in ext_cmd.name or ext_cmd.name in DEVICE_CMDS_NEED_TERM): + if (ext_cmd.handle_type == 'VkInstance' or ext_cmd.handle_type == 'VkPhysicalDevice' or + 'DebugMarkerSetObject' in ext_cmd.name or 'SetDebugUtilsObject' in ext_cmd.name or + ext_cmd.name in DEVICE_CMDS_NEED_TERM): requires_terminator = 1 if requires_terminator == 1: @@ -951,6 +992,22 @@ funcs += ' struct loader_physical_device_tramp *phys_dev_tramp = (struct loader_physical_device_tramp *)(uintptr_t)pTagInfo->object;\n' funcs += ' local_tag_info.object = (uint64_t)(uintptr_t)phys_dev_tramp->phys_dev;\n' funcs += ' }\n' + elif 'SetDebugUtilsObjectName' in ext_cmd.name: + funcs += ' VkDebugUtilsObjectNameInfoEXT local_name_info;\n' + funcs += ' memcpy(&local_name_info, pNameInfo, sizeof(VkDebugUtilsObjectNameInfoEXT));\n' + funcs += ' // If this is a physical device, we have to replace it with the proper one for the next call.\n' + funcs += ' if (pNameInfo->objectType == VK_OBJECT_TYPE_PHYSICAL_DEVICE) {\n' + funcs += ' struct loader_physical_device_tramp *phys_dev_tramp = (struct loader_physical_device_tramp *)(uintptr_t)pNameInfo->objectHandle;\n' + funcs += ' local_name_info.objectHandle = (uint64_t)(uintptr_t)phys_dev_tramp->phys_dev;\n' + funcs += ' }\n' + elif 'SetDebugUtilsObjectTag' in ext_cmd.name: + funcs += ' VkDebugUtilsObjectTagInfoEXT local_tag_info;\n' + funcs += ' memcpy(&local_tag_info, pTagInfo, sizeof(VkDebugUtilsObjectTagInfoEXT));\n' + funcs += ' // If this is a physical device, we have to replace it with the proper one for the next call.\n' + funcs += ' if (pTagInfo->objectType == VK_OBJECT_TYPE_PHYSICAL_DEVICE) {\n' + funcs += ' struct loader_physical_device_tramp *phys_dev_tramp = (struct loader_physical_device_tramp *)(uintptr_t)pTagInfo->objectHandle;\n' + funcs += ' local_tag_info.objectHandle = (uint64_t)(uintptr_t)phys_dev_tramp->phys_dev;\n' + funcs += ' }\n' funcs += return_prefix funcs += 'disp->' @@ -963,9 +1020,9 @@ if param.type == 'VkPhysicalDevice': funcs += 'unwrapped_phys_dev' - elif 'DebugMarkerSetObject' in ext_cmd.name and param.name == 'pNameInfo': + elif ('DebugMarkerSetObject' in ext_cmd.name or 'SetDebugUtilsObject' in ext_cmd.name) and param.name == 'pNameInfo': funcs += '&local_name_info' - elif 'DebugMarkerSetObject' in ext_cmd.name and param.name == 'pTagInfo': + elif ('DebugMarkerSetObject' in ext_cmd.name or 'SetDebugUtilsObject' in ext_cmd.name) and param.name == 'pTagInfo': funcs += '&local_tag_info' else: funcs += param.name @@ -1037,7 +1094,7 @@ count += 1 funcs += ');\n' - elif has_surface == 1 and ext_cmd.ext_type == 'device': + elif has_surface == 1 and not (ext_cmd.handle_type == 'VkPhysicalDevice' or ext_cmd.handle_type == 'VkInstance'): funcs += ' uint32_t icd_index = 0;\n' funcs += ' struct loader_device *dev;\n' funcs += ' struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, &icd_index);\n' @@ -1074,7 +1131,7 @@ elif ext_cmd.handle_type == 'VkInstance': funcs += '#error("Not implemented. Likely needs to be manually generated!");\n' - elif 'DebugMarkerSetObject' in ext_cmd.name: + elif 'DebugMarkerSetObject' in ext_cmd.name or 'SetDebugUtilsObject' in ext_cmd.name: funcs += ' uint32_t icd_index = 0;\n' funcs += ' struct loader_device *dev;\n' funcs += ' struct loader_icd_term *icd_term = loader_get_icd_and_device(%s, &dev, &icd_index);\n' % (ext_cmd.params[0].name) @@ -1109,6 +1166,45 @@ funcs += ' if (NULL != icd_surface->real_icd_surfaces) {\n' funcs += ' local_tag_info.object = (uint64_t)icd_surface->real_icd_surfaces[icd_index];\n' funcs += ' }\n' + elif 'SetDebugUtilsObjectName' in ext_cmd.name: + funcs += ' VkDebugUtilsObjectNameInfoEXT local_name_info;\n' + funcs += ' memcpy(&local_name_info, pNameInfo, sizeof(VkDebugUtilsObjectNameInfoEXT));\n' + funcs += ' // If this is a physical device, we have to replace it with the proper one for the next call.\n' + funcs += ' if (pNameInfo->objectType == VK_OBJECT_TYPE_PHYSICAL_DEVICE) {\n' + funcs += ' struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)(uintptr_t)pNameInfo->objectHandle;\n' + funcs += ' local_name_info.objectHandle = (uint64_t)(uintptr_t)phys_dev_term->phys_dev;\n' + funcs += ' // If this is a KHR_surface, and the ICD has created its own, we have to replace it with the proper one for the next call.\n' + funcs += ' } else if (pNameInfo->objectType == VK_OBJECT_TYPE_SURFACE_KHR) {\n' + funcs += ' if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) {\n' + funcs += ' VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pNameInfo->objectHandle;\n' + funcs += ' if (NULL != icd_surface->real_icd_surfaces) {\n' + funcs += ' local_name_info.objectHandle = (uint64_t)icd_surface->real_icd_surfaces[icd_index];\n' + funcs += ' }\n' + elif 'SetDebugUtilsObjectTag' in ext_cmd.name: + funcs += ' VkDebugUtilsObjectTagInfoEXT local_tag_info;\n' + funcs += ' memcpy(&local_tag_info, pTagInfo, sizeof(VkDebugUtilsObjectTagInfoEXT));\n' + funcs += ' // If this is a physical device, we have to replace it with the proper one for the next call.\n' + funcs += ' if (pTagInfo->objectType == VK_OBJECT_TYPE_PHYSICAL_DEVICE) {\n' + funcs += ' struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)(uintptr_t)pTagInfo->objectHandle;\n' + funcs += ' local_tag_info.objectHandle = (uint64_t)(uintptr_t)phys_dev_term->phys_dev;\n' + funcs += ' // If this is a KHR_surface, and the ICD has created its own, we have to replace it with the proper one for the next call.\n' + funcs += ' } else if (pTagInfo->objectType == VK_OBJECT_TYPE_SURFACE_KHR) {\n' + funcs += ' if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) {\n' + funcs += ' VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pTagInfo->objectHandle;\n' + funcs += ' if (NULL != icd_surface->real_icd_surfaces) {\n' + funcs += ' local_tag_info.objectHandle = (uint64_t)icd_surface->real_icd_surfaces[icd_index];\n' + funcs += ' }\n' + else: + funcs += ' if (%s->objectType == VK_OBJECT_TYPE_PHYSICAL_DEVICE) {\n' % (ext_cmd.params[1].name) + funcs += ' struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)(uintptr_t)%s->objectHandle;\n' % (ext_cmd.params[1].name) + funcs += ' %s->objectHandle = (uint64_t)(uintptr_t)phys_dev_term->phys_dev;\n' % (ext_cmd.params[1].name) + funcs += ' // If this is a KHR_surface, and the ICD has created its own, we have to replace it with the proper one for the next call.\n' + funcs += ' } else if (%s->objectType == VK_OBJECT_TYPE_SURFACE_KHR) {\n' % (ext_cmd.params[1].name) + funcs += ' if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) {\n' + funcs += ' VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)%s->objectHandle;\n' % (ext_cmd.params[1].name) + funcs += ' if (NULL != icd_surface->real_icd_surfaces) {\n' + funcs += ' %s->objectHandle = (uint64_t)icd_surface->real_icd_surfaces[icd_index];\n' % (ext_cmd.params[1].name) + funcs += ' }\n' funcs += ' }\n' funcs += ' }\n' funcs += ' return icd_term->dispatch.' @@ -1123,9 +1219,9 @@ funcs += 'phys_dev_term->phys_dev' elif param.type == 'VkSurfaceKHR': funcs += 'icd_surface->real_icd_surfaces[icd_index]' - elif 'DebugMarkerSetObject' in ext_cmd.name and param.name == 'pNameInfo': + elif ('DebugMarkerSetObject' in ext_cmd.name or 'SetDebugUtilsObject' in ext_cmd.name) and param.name == 'pNameInfo': funcs += '&local_name_info' - elif 'DebugMarkerSetObject' in ext_cmd.name and param.name == 'pTagInfo': + elif ('DebugMarkerSetObject' in ext_cmd.name or 'SetDebugUtilsObject' in ext_cmd.name) and param.name == 'pTagInfo': funcs += '&local_tag_info' else: funcs += param.name @@ -1180,7 +1276,8 @@ for cur_cmd in self.ext_commands: if ('VK_VERSION_' in cur_cmd.ext_name or cur_cmd.ext_name in WSI_EXT_NAMES or - cur_cmd.ext_name in AVOID_EXT_NAMES): + cur_cmd.ext_name in AVOID_EXT_NAMES or + cur_cmd.name in AVOID_CMD_NAMES ): continue if cur_cmd.ext_name != cur_extension_name: @@ -1190,7 +1287,8 @@ if cur_cmd.protect is not None: gpa_func += '#ifdef %s\n' % cur_cmd.protect - base_name = cur_cmd.name[2:] + #base_name = cur_cmd.name[2:] + base_name = ALIASED_CMDS[cur_cmd.name] if cur_cmd.name in ALIASED_CMDS else cur_cmd.name[2:] if (cur_cmd.ext_type == 'instance'): gpa_func += ' if (!strcmp("%s", name)) {\n' % (cur_cmd.name) @@ -1229,8 +1327,8 @@ create_func += ' for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) {\n' for ext in entries: if ('VK_VERSION_' in ext.name or ext.name in WSI_EXT_NAMES or - ext.name in AVOID_EXT_NAMES or ext.type == 'device' or - ext.num_commands == 0): + ext.name in AVOID_EXT_NAMES or ext.name in AVOID_CMD_NAMES or + ext.type == 'device' or ext.num_commands == 0): continue if ext.name != cur_extension_name: @@ -1268,28 +1366,38 @@ term_func += '// Some device commands still need a terminator because the loader needs to unwrap something about them.\n' term_func += '// In many cases, the item needing unwrapping is a VkPhysicalDevice or VkSurfaceKHR object. But there may be other items\n' term_func += '// in the future.\n' - term_func += 'PFN_vkVoidFunction get_extension_device_proc_terminator(const char *pName) {\n' + term_func += 'PFN_vkVoidFunction get_extension_device_proc_terminator(struct loader_device *dev, const char *pName) {\n' term_func += ' PFN_vkVoidFunction addr = NULL;\n' count = 0 + is_extension = False for ext_cmd in self.ext_commands: if ext_cmd.name in DEVICE_CMDS_NEED_TERM: if ext_cmd.ext_name != cur_extension_name: + if count > 0: + count = 0; + term_func += ' }\n' + if is_extension: + term_func += ' }\n' + is_extension = False + if 'VK_VERSION_' in ext_cmd.ext_name: term_func += '\n // ---- Core %s commands\n' % ext_cmd.ext_name[11:] else: term_func += '\n // ---- %s extension commands\n' % ext_cmd.ext_name + term_func += ' if (dev->extensions.%s_enabled) {\n' % ext_cmd.ext_name[3:].lower() + is_extension = True cur_extension_name = ext_cmd.ext_name if ext_cmd.protect is not None: term_func += '#ifdef %s\n' % ext_cmd.protect if count == 0: - term_func += ' if' + term_func += ' if' else: - term_func += ' } else if' + term_func += ' } else if' term_func += '(!strcmp(pName, "%s")) {\n' % (ext_cmd.name) - term_func += ' addr = (PFN_vkVoidFunction)terminator_%s;\n' % (ext_cmd.name[2:]) + term_func += ' addr = (PFN_vkVoidFunction)terminator_%s;\n' % (ext_cmd.name[2:]) if ext_cmd.protect is not None: term_func += '#endif // %s\n' % ext_cmd.protect @@ -1297,6 +1405,8 @@ count += 1 if count > 0: + term_func += ' }\n' + if is_extension: term_func += ' }\n' term_func += ' return addr;\n' @@ -1324,7 +1434,8 @@ commands = self.ext_commands for cur_cmd in commands: - if cur_cmd.ext_type == 'instance' or (cur_cmd.ext_type == 'device' and cur_cmd.handle_type == 'VkPhysicalDevice'): + + if cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice': if cur_cmd.ext_name != cur_extension_name: if 'VK_VERSION_' in cur_cmd.ext_name: table += '\n // ---- Core %s commands\n' % cur_cmd.ext_name[11:] @@ -1334,10 +1445,12 @@ # Remove 'vk' from proto name base_name = cur_cmd.name[2:] + aliased_name = ALIASED_CMDS[cur_cmd.name][2:] if cur_cmd.name in ALIASED_CMDS else base_name if (base_name == 'CreateInstance' or base_name == 'CreateDevice' or base_name == 'EnumerateInstanceExtensionProperties' or - base_name == 'EnumerateInstanceLayerProperties'): + base_name == 'EnumerateInstanceLayerProperties' or + base_name == 'EnumerateInstanceVersion'): continue if cur_cmd.protect is not None: @@ -1346,7 +1459,7 @@ if base_name == 'GetInstanceProcAddr': table += ' .%s = %s,\n' % (base_name, cur_cmd.name) else: - table += ' .%s = terminator_%s,\n' % (base_name, base_name) + table += ' .%s = terminator_%s,\n' % (base_name, aliased_name) if cur_cmd.protect is not None: table += '#endif // %s\n' % cur_cmd.protect diff -Nru vulkan-1.0.65.2+dfsg1/scripts/lvl_genvk.py vulkan-1.1.73+dfsg/scripts/lvl_genvk.py --- vulkan-1.0.65.2+dfsg1/scripts/lvl_genvk.py 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/lvl_genvk.py 2018-04-27 11:24:19.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/python3 # -# Copyright (c) 2013-2017 The Khronos Group Inc. +# Copyright (c) 2013-2018 The Khronos Group Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -43,32 +43,57 @@ startTime = None # Turn a list of strings into a regexp string matching exactly those strings -def makeREstring(list): - return '^(' + '|'.join(list) + ')$' +def makeREstring(list, default = None): + if len(list) > 0 or default == None: + return '^(' + '|'.join(list) + ')$' + else: + return default # Returns a directory of [ generator function, generator options ] indexed # by specified short names. The generator options incorporate the following # parameters: # -# extensions - list of extension names to include. -# protect - True if re-inclusion protection should be added to headers -# directory - path to directory in which to generate the target(s) -def makeGenOpts(extensions = [], removeExtensions = [], protect = True, directory = '.'): +# args is an parsed argument object; see below for the fields that are used. +def makeGenOpts(args): global genOpts genOpts = {} + # Default class of extensions to include, or None + defaultExtensions = args.defaultExtensions + + # Additional extensions to include (list of extensions) + extensions = args.extension + + # Extensions to remove (list of extensions) + removeExtensions = args.removeExtensions + + # Extensions to emit (list of extensions) + emitExtensions = args.emitExtensions + + # Features to include (list of features) + features = args.feature + + # Whether to disable inclusion protect in headers + protect = args.protect + + # Output target directory + directory = args.directory + # Descriptive names for various regexp patterns used to select # versions and extensions - allVersions = allExtensions = '.*' - noVersions = noExtensions = None + allFeatures = allExtensions = '.*' + noFeatures = noExtensions = None - addExtensions = makeREstring(extensions) - removeExtensions = makeREstring(removeExtensions) + # Turn lists of names/patterns into matching regular expressions + addExtensionsPat = makeREstring(extensions, None) + removeExtensionsPat = makeREstring(removeExtensions, None) + emitExtensionsPat = makeREstring(emitExtensions, allExtensions) + featuresPat = makeREstring(features, allFeatures) # Copyright text prefixing all headers (list of strings). prefixStrings = [ '/*', - '** Copyright (c) 2015-2017 The Khronos Group Inc.', + '** Copyright (c) 2015-2018 The Khronos Group Inc.', '**', '** Licensed under the Apache License, Version 2.0 (the "License");', '** you may not use this file except in compliance with the License.', @@ -95,12 +120,8 @@ ] # Defaults for generating re-inclusion protection wrappers (or not) - protectFile = protect protectFeature = protect - protectProto = protect - - # # LoaderAndValidationLayer Generators # Options for threading layer genOpts['thread_check.h'] = [ @@ -110,17 +131,19 @@ directory = directory, apiname = 'vulkan', profile = None, - versions = allVersions, - emitversions = allVersions, + versions = featuresPat, + emitversions = featuresPat, defaultExtensions = 'vulkan', - addExtensions = addExtensions, - removeExtensions = removeExtensions, + addExtensions = addExtensionsPat, + removeExtensions = removeExtensionsPat, + emitExtensions = emitExtensionsPat, prefixText = prefixStrings + vkPrefixStrings, protectFeature = False, apicall = 'VKAPI_ATTR ', apientry = 'VKAPI_CALL ', apientryp = 'VKAPI_PTR *', - alignFuncParam = 48) + alignFuncParam = 48, + expandEnumerants = False) ] # Options for parameter validation layer @@ -131,18 +154,19 @@ directory = directory, apiname = 'vulkan', profile = None, - versions = allVersions, - emitversions = allVersions, + versions = featuresPat, + emitversions = featuresPat, defaultExtensions = 'vulkan', - addExtensions = addExtensions, - removeExtensions = removeExtensions, + addExtensions = addExtensionsPat, + removeExtensions = removeExtensionsPat, + emitExtensions = emitExtensionsPat, prefixText = prefixStrings + vkPrefixStrings, - protectFeature = False, apicall = 'VKAPI_ATTR ', apientry = 'VKAPI_CALL ', apientryp = 'VKAPI_PTR *', - alignFuncParam = 48) - ] + alignFuncParam = 48, + expandEnumerants = False) + ] # Options for unique objects layer genOpts['unique_objects_wrappers.h'] = [ @@ -152,17 +176,19 @@ directory = directory, apiname = 'vulkan', profile = None, - versions = allVersions, - emitversions = allVersions, + versions = featuresPat, + emitversions = featuresPat, defaultExtensions = 'vulkan', - addExtensions = addExtensions, - removeExtensions = removeExtensions, + addExtensions = addExtensionsPat, + removeExtensions = removeExtensionsPat, + emitExtensions = emitExtensionsPat, prefixText = prefixStrings + vkPrefixStrings, protectFeature = False, apicall = 'VKAPI_ATTR ', apientry = 'VKAPI_CALL ', apientryp = 'VKAPI_PTR *', - alignFuncParam = 48) + alignFuncParam = 48, + expandEnumerants = False) ] # Options for object_tracker layer @@ -173,17 +199,19 @@ directory = directory, apiname = 'vulkan', profile = None, - versions = allVersions, - emitversions = allVersions, + versions = featuresPat, + emitversions = featuresPat, defaultExtensions = 'vulkan', - addExtensions = addExtensions, - removeExtensions = removeExtensions, + addExtensions = addExtensionsPat, + removeExtensions = removeExtensionsPat, + emitExtensions = emitExtensionsPat, prefixText = prefixStrings + vkPrefixStrings, protectFeature = False, apicall = 'VKAPI_ATTR ', apientry = 'VKAPI_CALL ', apientryp = 'VKAPI_PTR *', - alignFuncParam = 48) + alignFuncParam = 48, + expandEnumerants = False) ] # Options for dispatch table helper generator @@ -194,17 +222,18 @@ directory = directory, apiname = 'vulkan', profile = None, - versions = allVersions, - emitversions = allVersions, + versions = featuresPat, + emitversions = featuresPat, defaultExtensions = 'vulkan', - addExtensions = addExtensions, - removeExtensions = removeExtensions, + addExtensions = addExtensionsPat, + removeExtensions = removeExtensionsPat, + emitExtensions = emitExtensionsPat, prefixText = prefixStrings + vkPrefixStrings, - protectFeature = False, apicall = 'VKAPI_ATTR ', apientry = 'VKAPI_CALL ', apientryp = 'VKAPI_PTR *', - alignFuncParam = 48) + alignFuncParam = 48, + expandEnumerants = False) ] # Options for Layer dispatch table generator @@ -215,17 +244,18 @@ directory = directory, apiname = 'vulkan', profile = None, - versions = allVersions, - emitversions = allVersions, + versions = featuresPat, + emitversions = featuresPat, defaultExtensions = 'vulkan', - addExtensions = addExtensions, - removeExtensions = removeExtensions, + addExtensions = addExtensionsPat, + removeExtensions = removeExtensionsPat, + emitExtensions = emitExtensionsPat, prefixText = prefixStrings + vkPrefixStrings, - protectFeature = False, apicall = 'VKAPI_ATTR ', apientry = 'VKAPI_CALL ', apientryp = 'VKAPI_PTR *', - alignFuncParam = 48) + alignFuncParam = 48, + expandEnumerants = False) ] # Options for loader extension source generator @@ -236,17 +266,18 @@ directory = directory, apiname = 'vulkan', profile = None, - versions = allVersions, - emitversions = allVersions, + versions = featuresPat, + emitversions = featuresPat, defaultExtensions = 'vulkan', - addExtensions = addExtensions, - removeExtensions = removeExtensions, + addExtensions = addExtensionsPat, + removeExtensions = removeExtensionsPat, + emitExtensions = emitExtensionsPat, prefixText = prefixStrings + vkPrefixStrings, - protectFeature = False, apicall = 'VKAPI_ATTR ', apientry = 'VKAPI_CALL ', apientryp = 'VKAPI_PTR *', - alignFuncParam = 48) + alignFuncParam = 48, + expandEnumerants = False) ] # Options for loader extension source generator @@ -257,17 +288,18 @@ directory = directory, apiname = 'vulkan', profile = None, - versions = allVersions, - emitversions = allVersions, + versions = featuresPat, + emitversions = featuresPat, defaultExtensions = 'vulkan', - addExtensions = addExtensions, - removeExtensions = removeExtensions, + addExtensions = addExtensionsPat, + removeExtensions = removeExtensionsPat, + emitExtensions = emitExtensionsPat, prefixText = prefixStrings + vkPrefixStrings, - protectFeature = False, apicall = 'VKAPI_ATTR ', apientry = 'VKAPI_CALL ', apientryp = 'VKAPI_PTR *', - alignFuncParam = 48) + alignFuncParam = 48, + expandEnumerants = False) ] # Helper file generator options for vk_enum_string_helper.h @@ -278,64 +310,21 @@ directory = directory, apiname = 'vulkan', profile = None, - versions = allVersions, - emitversions = allVersions, + versions = featuresPat, + emitversions = featuresPat, defaultExtensions = 'vulkan', - addExtensions = addExtensions, - removeExtensions = removeExtensions, + addExtensions = addExtensionsPat, + removeExtensions = removeExtensionsPat, + emitExtensions = emitExtensionsPat, prefixText = prefixStrings + vkPrefixStrings, - protectFeature = False, apicall = 'VKAPI_ATTR ', apientry = 'VKAPI_CALL ', apientryp = 'VKAPI_PTR *', alignFuncParam = 48, + expandEnumerants = False, helper_file_type = 'enum_string_header') ] - # Helper file generator options for vk_struct_size_helper.h - genOpts['vk_struct_size_helper.h'] = [ - HelperFileOutputGenerator, - HelperFileOutputGeneratorOptions( - filename = 'vk_struct_size_helper.h', - directory = directory, - apiname = 'vulkan', - profile = None, - versions = allVersions, - emitversions = allVersions, - defaultExtensions = 'vulkan', - addExtensions = addExtensions, - removeExtensions = removeExtensions, - prefixText = prefixStrings + vkPrefixStrings, - protectFeature = False, - apicall = 'VKAPI_ATTR ', - apientry = 'VKAPI_CALL ', - apientryp = 'VKAPI_PTR *', - alignFuncParam = 48, - helper_file_type = 'struct_size_header') - ] - - # Helper file generator options for vk_struct_size_helper.c - genOpts['vk_struct_size_helper.c'] = [ - HelperFileOutputGenerator, - HelperFileOutputGeneratorOptions( - filename = 'vk_struct_size_helper.c', - directory = directory, - apiname = 'vulkan', - profile = None, - versions = allVersions, - emitversions = allVersions, - defaultExtensions = 'vulkan', - addExtensions = addExtensions, - removeExtensions = removeExtensions, - prefixText = prefixStrings + vkPrefixStrings, - protectFeature = False, - apicall = 'VKAPI_ATTR ', - apientry = 'VKAPI_CALL ', - apientryp = 'VKAPI_PTR *', - alignFuncParam = 48, - helper_file_type = 'struct_size_source') - ] - # Helper file generator options for vk_safe_struct.h genOpts['vk_safe_struct.h'] = [ HelperFileOutputGenerator, @@ -344,17 +333,18 @@ directory = directory, apiname = 'vulkan', profile = None, - versions = allVersions, - emitversions = allVersions, + versions = featuresPat, + emitversions = featuresPat, defaultExtensions = 'vulkan', - addExtensions = addExtensions, - removeExtensions = removeExtensions, + addExtensions = addExtensionsPat, + removeExtensions = removeExtensionsPat, + emitExtensions = emitExtensionsPat, prefixText = prefixStrings + vkPrefixStrings, - protectFeature = False, apicall = 'VKAPI_ATTR ', apientry = 'VKAPI_CALL ', apientryp = 'VKAPI_PTR *', alignFuncParam = 48, + expandEnumerants = False, helper_file_type = 'safe_struct_header') ] @@ -366,17 +356,18 @@ directory = directory, apiname = 'vulkan', profile = None, - versions = allVersions, - emitversions = allVersions, + versions = featuresPat, + emitversions = featuresPat, defaultExtensions = 'vulkan', - addExtensions = addExtensions, - removeExtensions = removeExtensions, + addExtensions = addExtensionsPat, + removeExtensions = removeExtensionsPat, + emitExtensions = emitExtensionsPat, prefixText = prefixStrings + vkPrefixStrings, - protectFeature = False, apicall = 'VKAPI_ATTR ', apientry = 'VKAPI_CALL ', apientryp = 'VKAPI_PTR *', alignFuncParam = 48, + expandEnumerants = False, helper_file_type = 'safe_struct_source') ] @@ -388,17 +379,18 @@ directory = directory, apiname = 'vulkan', profile = None, - versions = allVersions, - emitversions = allVersions, + versions = featuresPat, + emitversions = featuresPat, defaultExtensions = 'vulkan', - addExtensions = addExtensions, - removeExtensions = removeExtensions, + addExtensions = addExtensionsPat, + removeExtensions = removeExtensionsPat, + emitExtensions = emitExtensionsPat, prefixText = prefixStrings + vkPrefixStrings, - protectFeature = False, apicall = 'VKAPI_ATTR ', apientry = 'VKAPI_CALL ', apientryp = 'VKAPI_PTR *', alignFuncParam = 48, + expandEnumerants = False, helper_file_type = 'object_types_header') ] @@ -410,20 +402,45 @@ directory = directory, apiname = 'vulkan', profile = None, - versions = allVersions, - emitversions = allVersions, + versions = featuresPat, + emitversions = featuresPat, defaultExtensions = 'vulkan', - addExtensions = addExtensions, - removeExtensions = removeExtensions, + addExtensions = addExtensionsPat, + removeExtensions = removeExtensionsPat, + emitExtensions = emitExtensionsPat, prefixText = prefixStrings + vkPrefixStrings, - protectFeature = False, apicall = 'VKAPI_ATTR ', apientry = 'VKAPI_CALL ', apientryp = 'VKAPI_PTR *', alignFuncParam = 48, + expandEnumerants = False, helper_file_type = 'extension_helper_header') ] + # Helper file generator options for typemap_helper.h + genOpts['vk_typemap_helper.h'] = [ + HelperFileOutputGenerator, + HelperFileOutputGeneratorOptions( + filename = 'vk_typemap_helper.h', + directory = directory, + apiname = 'vulkan', + profile = None, + versions = featuresPat, + emitversions = featuresPat, + defaultExtensions = 'vulkan', + addExtensions = addExtensionsPat, + removeExtensions = removeExtensionsPat, + emitExtensions = emitExtensionsPat, + prefixText = prefixStrings + vkPrefixStrings, + protectFeature = False, + apicall = 'VKAPI_ATTR ', + apientry = 'VKAPI_CALL ', + apientryp = 'VKAPI_PTR *', + alignFuncParam = 48, + expandEnumerants = False, + helper_file_type = 'typemap_helper_header') + ] + # Options for mock ICD header genOpts['mock_icd.h'] = [ MockICDOutputGenerator, @@ -432,17 +449,19 @@ directory = directory, apiname = 'vulkan', profile = None, - versions = allVersions, - emitversions = allVersions, + versions = featuresPat, + emitversions = featuresPat, defaultExtensions = 'vulkan', - addExtensions = addExtensions, - removeExtensions = removeExtensions, + addExtensions = addExtensionsPat, + removeExtensions = removeExtensionsPat, + emitExtensions = emitExtensionsPat, prefixText = prefixStrings + vkPrefixStrings, protectFeature = False, apicall = 'VKAPI_ATTR ', apientry = 'VKAPI_CALL ', apientryp = 'VKAPI_PTR *', alignFuncParam = 48, + expandEnumerants = False, helper_file_type = 'mock_icd_header') ] @@ -454,17 +473,19 @@ directory = directory, apiname = 'vulkan', profile = None, - versions = allVersions, - emitversions = allVersions, + versions = featuresPat, + emitversions = featuresPat, defaultExtensions = 'vulkan', - addExtensions = addExtensions, - removeExtensions = removeExtensions, + addExtensions = addExtensionsPat, + removeExtensions = removeExtensionsPat, + emitExtensions = emitExtensionsPat, prefixText = prefixStrings + vkPrefixStrings, protectFeature = False, apicall = 'VKAPI_ATTR ', apientry = 'VKAPI_CALL ', apientryp = 'VKAPI_PTR *', alignFuncParam = 48, + expandEnumerants = False, helper_file_type = 'mock_icd_source') ] @@ -481,10 +502,7 @@ global genOpts # Create generator options with specified parameters - makeGenOpts(extensions = args.extension, - removeExtensions = args.removeExtension, - protect = args.protect, - directory = args.directory) + makeGenOpts(args) if (args.target in genOpts.keys()): createGenerator = genOpts[args.target][0] @@ -492,6 +510,12 @@ if not args.quiet: write('* Building', options.filename, file=sys.stderr) + write('* options.versions =', options.versions, file=sys.stderr) + write('* options.emitversions =', options.emitversions, file=sys.stderr) + write('* options.defaultExtensions =', options.defaultExtensions, file=sys.stderr) + write('* options.addExtensions =', options.addExtensions, file=sys.stderr) + write('* options.removeExtensions =', options.removeExtensions, file=sys.stderr) + write('* options.emitExtensions =', options.emitExtensions, file=sys.stderr) startTimer(args.time) gen = createGenerator(errFile=errWarn, @@ -507,17 +531,28 @@ write('No generator options for unknown target:', args.target, file=sys.stderr) -# -extension name - may be a single extension name, a a space-separated list +# -feature name +# -extension name +# For both, "name" may be a single name, or a space-separated list # of names, or a regular expression. if __name__ == '__main__': parser = argparse.ArgumentParser() + parser.add_argument('-defaultExtensions', action='store', + default='vulkan', + help='Specify a single class of extensions to add to targets') parser.add_argument('-extension', action='append', default=[], help='Specify an extension or extensions to add to targets') - parser.add_argument('-removeExtension', action='append', + parser.add_argument('-removeExtensions', action='append', default=[], help='Specify an extension or extensions to remove from targets') + parser.add_argument('-emitExtensions', action='append', + default=[], + help='Specify an extension or extensions to emit in targets') + parser.add_argument('-feature', action='append', + default=[], + help='Specify a core API feature name or names to add to targets') parser.add_argument('-debug', action='store_true', help='Enable debugging') parser.add_argument('-dump', action='store_true', @@ -544,12 +579,15 @@ help='Create target and related files in specified directory') parser.add_argument('target', metavar='target', nargs='?', help='Specify target') - parser.add_argument('-quiet', action='store_true', default=False, + parser.add_argument('-quiet', action='store_true', default=True, help='Suppress script output during normal execution.') + parser.add_argument('-verbose', action='store_false', dest='quiet', default=True, + help='Enable script output during normal execution.') args = parser.parse_args() # This splits arguments which are space-separated lists + args.feature = [name for arg in args.feature for name in arg.split()] args.extension = [name for arg in args.extension for name in arg.split()] # Load & parse registry @@ -559,9 +597,12 @@ tree = etree.parse(args.registry) endTimer(args.time, '* Time to make ElementTree =') - startTimer(args.time) - reg.loadElementTree(tree) - endTimer(args.time, '* Time to parse ElementTree =') + if args.debug: + pdb.run('reg.loadElementTree(tree)') + else: + startTimer(args.time) + reg.loadElementTree(tree) + endTimer(args.time, '* Time to parse ElementTree =') if (args.validate): reg.validateGroups() diff -Nru vulkan-1.0.65.2+dfsg1/scripts/mock_icd_generator.py vulkan-1.1.73+dfsg/scripts/mock_icd_generator.py --- vulkan-1.0.65.2+dfsg1/scripts/mock_icd_generator.py 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/mock_icd_generator.py 2018-04-27 11:24:19.000000000 +0000 @@ -26,6 +26,8 @@ import os,re,sys from generator import * +from common_codegen import * + # Mock header code HEADER_C_CODE = ''' @@ -133,9 +135,9 @@ limits->viewportBoundsRange[1] = 8191; limits->viewportSubPixelBits = 0; limits->minMemoryMapAlignment = 64; - limits->minTexelBufferOffsetAlignment = 256; - limits->minUniformBufferOffsetAlignment = 256; - limits->minStorageBufferOffsetAlignment = 256; + limits->minTexelBufferOffsetAlignment = 16; + limits->minUniformBufferOffsetAlignment = 16; + limits->minStorageBufferOffsetAlignment = 16; limits->minTexelOffset = -8; limits->maxTexelOffset = 7; limits->minTexelGatherOffset = -8; @@ -349,21 +351,21 @@ } #endif /* VK_USE_PLATFORM_WIN32_KHR */ -EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModesKHX( +EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModesKHR( VkDevice device, VkSurfaceKHR surface, - VkDeviceGroupPresentModeFlagsKHX* pModes) + VkDeviceGroupPresentModeFlagsKHR* pModes) { - return vkmock::GetDeviceGroupSurfacePresentModesKHX(device, surface, pModes); + return vkmock::GetDeviceGroupSurfacePresentModesKHR(device, surface, pModes); } -EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDevicePresentRectanglesKHX( +EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDevicePresentRectanglesKHR( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pRectCount, VkRect2D* pRects) { - return vkmock::GetPhysicalDevicePresentRectanglesKHX(physicalDevice, surface, pRectCount, pRects); + return vkmock::GetPhysicalDevicePresentRectanglesKHR(physicalDevice, surface, pRectCount, pRects); } #ifdef VK_USE_PLATFORM_VI_NN @@ -449,6 +451,7 @@ return VK_SUCCESS; ''', 'vkDestroyDevice': ''' + unique_lock_t lock(global_lock); // First destroy sub-device objects // Destroy Queues for (auto dev_queue_map_pair : queue_map) { @@ -464,6 +467,7 @@ // TODO: If emulating specific device caps, will need to add intelligence here ''', 'vkGetDeviceQueue': ''' + unique_lock_t lock(global_lock); auto queue = queue_map[device][queueFamilyIndex][queueIndex]; if (queue) { *pQueue = queue; @@ -473,6 +477,10 @@ // TODO: If emulating specific device caps, will need to add intelligence here return; ''', +'vkGetDeviceQueue2': ''' + GetDeviceQueue(device, pQueueInfo->queueFamilyIndex, pQueueInfo->queueIndex, pQueue); + // TODO: Add further support for GetDeviceQueue2 features +''', 'vkEnumerateInstanceLayerProperties': ''' return VK_SUCCESS; ''', @@ -527,6 +535,119 @@ // If requesting extension properties, fill in data struct for number of extensions return VK_SUCCESS; ''', +'vkGetPhysicalDeviceSurfacePresentModesKHR': ''' + // Currently always say that all present modes are supported + if (!pPresentModes) { + *pPresentModeCount = 6; + } else { + // Intentionally falling through and just filling however many modes are requested + switch(*pPresentModeCount) { + case 6: + pPresentModes[5] = VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR; + // fall through + case 5: + pPresentModes[4] = VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR; + // fall through + case 4: + pPresentModes[3] = VK_PRESENT_MODE_FIFO_RELAXED_KHR; + // fall through + case 3: + pPresentModes[2] = VK_PRESENT_MODE_FIFO_KHR; + // fall through + case 2: + pPresentModes[1] = VK_PRESENT_MODE_MAILBOX_KHR; + // fall through + default: + pPresentModes[0] = VK_PRESENT_MODE_IMMEDIATE_KHR; + break; + } + } + return VK_SUCCESS; +''', +'vkGetPhysicalDeviceSurfaceFormatsKHR': ''' + // Currently always say that RGBA8 & BGRA8 are supported + if (!pSurfaceFormats) { + *pSurfaceFormatCount = 2; + } else { + // Intentionally falling through and just filling however many types are requested + switch(*pSurfaceFormatCount) { + case 2: + pSurfaceFormats[1].format = VK_FORMAT_R8G8B8A8_UNORM; + pSurfaceFormats[1].colorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR; + // fall through + default: + pSurfaceFormats[0].format = VK_FORMAT_B8G8R8A8_UNORM; + pSurfaceFormats[0].colorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR; + break; + } + } + return VK_SUCCESS; +''', +'vkGetPhysicalDeviceSurfaceFormats2KHR': ''' + // Currently always say that RGBA8 & BGRA8 are supported + if (!pSurfaceFormats) { + *pSurfaceFormatCount = 2; + } else { + // Intentionally falling through and just filling however many types are requested + switch(*pSurfaceFormatCount) { + case 2: + pSurfaceFormats[1].pNext = nullptr; + pSurfaceFormats[1].surfaceFormat.format = VK_FORMAT_R8G8B8A8_UNORM; + pSurfaceFormats[1].surfaceFormat.colorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR; + // fall through + default: + pSurfaceFormats[1].pNext = nullptr; + pSurfaceFormats[0].surfaceFormat.format = VK_FORMAT_B8G8R8A8_UNORM; + pSurfaceFormats[0].surfaceFormat.colorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR; + break; + } + } + return VK_SUCCESS; +''', +'vkGetPhysicalDeviceSurfaceSupportKHR': ''' + // Currently say that all surface/queue combos are supported + *pSupported = VK_TRUE; + return VK_SUCCESS; +''', +'vkGetPhysicalDeviceSurfaceCapabilitiesKHR': ''' + // In general just say max supported is available for requested surface + pSurfaceCapabilities->minImageCount = 1; + pSurfaceCapabilities->maxImageCount = 0; + pSurfaceCapabilities->currentExtent.width = 0xFFFFFFFF; + pSurfaceCapabilities->currentExtent.height = 0xFFFFFFFF; + pSurfaceCapabilities->minImageExtent.width = 1; + pSurfaceCapabilities->minImageExtent.height = 1; + pSurfaceCapabilities->maxImageExtent.width = 3840; + pSurfaceCapabilities->maxImageExtent.height = 2160; + pSurfaceCapabilities->maxImageArrayLayers = 128; + pSurfaceCapabilities->supportedTransforms = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR | + VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR | + VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR | + VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR | + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR | + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR | + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR | + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR | + VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR; + pSurfaceCapabilities->currentTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; + pSurfaceCapabilities->supportedCompositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR | + VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR | + VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR | + VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR; + pSurfaceCapabilities->supportedUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | + VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_SAMPLED_BIT | + VK_IMAGE_USAGE_STORAGE_BIT | + VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | + VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | + VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | + VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT; + return VK_SUCCESS; +''', +'vkGetPhysicalDeviceSurfaceCapabilities2KHR': ''' + GetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, pSurfaceInfo->surface, &pSurfaceCapabilities->surfaceCapabilities); + return VK_SUCCESS; +''', 'vkGetInstanceProcAddr': ''' if (!negotiate_loader_icd_interface_called) { loader_interface_version = 0; @@ -586,8 +707,12 @@ GetPhysicalDeviceFeatures(physicalDevice, &pFeatures->features); ''', 'vkGetPhysicalDeviceFormatProperties': ''' - // TODO: Just returning full support for everything initially - *pFormatProperties = { 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF }; + if (VK_FORMAT_UNDEFINED == format) { + *pFormatProperties = { 0x0, 0x0, 0x0 }; + } else { + // TODO: Just returning full support for everything initially + *pFormatProperties = { 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF }; + } ''', 'vkGetPhysicalDeviceFormatProperties2KHR': ''' GetPhysicalDeviceFormatProperties(physicalDevice, format, &pFormatProperties->formatProperties); @@ -626,7 +751,7 @@ // TODO: Just hard-coding reqs for now pMemoryRequirements->size = 4096; pMemoryRequirements->alignment = 1; - pMemoryRequirements->memoryTypeBits = 0x1F; + pMemoryRequirements->memoryTypeBits = 0xFFFF; ''', 'vkGetBufferMemoryRequirements2KHR': ''' GetBufferMemoryRequirements(device, pInfo->buffer, &pMemoryRequirements->memoryRequirements); @@ -635,26 +760,47 @@ // TODO: Just hard-coding reqs for now pMemoryRequirements->size = 4096; pMemoryRequirements->alignment = 1; - pMemoryRequirements->memoryTypeBits = 0x1F; + pMemoryRequirements->memoryTypeBits = 0xFFFF; ''', 'vkGetImageMemoryRequirements2KHR': ''' GetImageMemoryRequirements(device, pInfo->image, &pMemoryRequirements->memoryRequirements); ''', 'vkMapMemory': ''' - // TODO: Just hard-coding 4k whole size for now + unique_lock_t lock(global_lock); + // TODO: Just hard-coding 64k whole size for now if (VK_WHOLE_SIZE == size) - size = 4096; + size = 0x10000; void* map_addr = malloc((size_t)size); mapped_memory_map[memory].push_back(map_addr); *ppData = map_addr; return VK_SUCCESS; ''', 'vkUnmapMemory': ''' + unique_lock_t lock(global_lock); for (auto map_addr : mapped_memory_map[memory]) { free(map_addr); } mapped_memory_map.erase(memory); ''', +'vkGetImageSubresourceLayout': ''' + // Need safe values. Callers are computing memory offsets from pLayout, with no return code to flag failure. + *pLayout = VkSubresourceLayout(); // Default constructor zero values. +''', +'vkGetSwapchainImagesKHR': ''' + if (!pSwapchainImages) { + *pSwapchainImageCount = 1; + } else if (*pSwapchainImageCount > 0) { + pSwapchainImages[0] = (VkImage)global_unique_handle++; + if (*pSwapchainImageCount != 1) { + return VK_INCOMPLETE; + } + } + return VK_SUCCESS; +''', +'vkAcquireNextImagesKHR': ''' + *pImageIndex = 0; + return VK_SUCCESS; +''', } # MockICDGeneratorOptions - subclass of GeneratorOptions. @@ -701,6 +847,7 @@ defaultExtensions = None, addExtensions = None, removeExtensions = None, + emitExtensions = None, sortProcedure = regSortFeatures, prefixText = "", genFuncPointers = True, @@ -714,10 +861,11 @@ indentFuncProto = True, indentFuncPointer = False, alignFuncParam = 0, + expandEnumerants = True, helper_file_type = ''): GeneratorOptions.__init__(self, filename, directory, apiname, profile, versions, emitversions, defaultExtensions, - addExtensions, removeExtensions, sortProcedure) + addExtensions, removeExtensions, emitExtensions, sortProcedure) self.prefixText = prefixText self.genFuncPointers = genFuncPointers self.protectFile = protectFile @@ -812,11 +960,11 @@ if self.header: write('#include ', file=self.outFile) write('#include ', file=self.outFile) + write('#include ', file=self.outFile) write('#include ', file=self.outFile) write('#include "vulkan/vk_icd.h"', file=self.outFile) else: write('#include "mock_icd.h"', file=self.outFile) - write('#include ', file=self.outFile) write('#include ', file=self.outFile) write('#include ', file=self.outFile) @@ -824,18 +972,13 @@ if self.header: self.newline() write(HEADER_C_CODE, file=self.outFile) - # Include all of the extensions - # static unordered_map device_layer_data_map; - # typedef struct VkExtensionProperties { - # char extensionName[VK_MAX_EXTENSION_NAME_SIZE]; - # uint32_t specVersion; - # } VkExtensionProperties; + # Include all of the extensions in ICD except specific ignored ones device_exts = [] instance_exts = [] - # Ignore extensions that ICDs should not implement - ignore_exts = ['VK_EXT_validation_cache'] + # Ignore extensions that ICDs should not implement or are not safe to report + ignore_exts = ['VK_EXT_validation_cache', 'VK_KHR_push_descriptor'] for ext in self.registry.tree.findall("extensions/extension"): - if '0' != ext[0][0].attrib['value']: # Only include implemented extensions + if ext.attrib['supported'] != 'disabled': # Only include enabled extensions if (ext.attrib['name'] in ignore_exts): pass elif (ext.attrib.get('type') and 'instance' == ext.attrib['type']): @@ -871,18 +1014,13 @@ write('#endif', file=self.outFile) else: # Loader-layer-interface, need to implement global interface functions write(SOURCE_CPP_POSTFIX, file=self.outFile) - #init_commands = self.registry.tree.find("feature/require/[@comment='Device initialization']") - #for cmd in init_commands: - # cmd_name = cmd.attrib['name'] - # write('// Found init function: %s' % (cmd_name), file=self.outFile) - # cmdinfo = self.registry.tree.find("commands/command/[name='%s']" % (cmd_name)) - # write('VK_LAYER_EXPORT %s {' % (self.makeCDecls(cmdinfo.elem)[0][:-1])) # Finish processing in superclass OutputGenerator.endFile(self) def beginFeature(self, interface, emit): #write('// starting beginFeature', file=self.outFile) # Start processing in superclass OutputGenerator.beginFeature(self, interface, emit) + self.featureExtraProtect = GetFeatureProtect(interface) # C-specific # Accumulate includes, defines, types, enums, function pointer typedefs, # end function prototypes separately for this feature. They're only @@ -928,7 +1066,7 @@ self.sections[section].append(text) # # Type generation - def genType(self, typeinfo, name): + def genType(self, typeinfo, name, alias): pass # # Struct (e.g. C "struct" type) generation. @@ -938,8 +1076,8 @@ # tags - they are a declaration of a struct or union member. # Only simple member declarations are supported (no nested # structs etc.) - def genStruct(self, typeinfo, typeName): - OutputGenerator.genStruct(self, typeinfo, typeName) + def genStruct(self, typeinfo, typeName, alias): + OutputGenerator.genStruct(self, typeinfo, typeName, alias) body = 'typedef ' + typeinfo.elem.get('category') + ' ' + typeName + ' {\n' # paramdecl = self.makeCParamDecl(typeinfo.elem, self.genOpts.alignFuncParam) for member in typeinfo.elem.findall('.//member'): @@ -950,16 +1088,16 @@ # # Group (e.g. C "enum" type) generation. # These are concatenated together with other types. - def genGroup(self, groupinfo, groupName): + def genGroup(self, groupinfo, groupName, alias): pass # Enumerant generation # tags may specify their values in several ways, but are usually # just integers. - def genEnum(self, enuminfo, name): + def genEnum(self, enuminfo, name, alias): pass # # Command generation - def genCmd(self, cmdinfo, name): + def genCmd(self, cmdinfo, name, alias): decls = self.makeCDecls(cmdinfo.elem) if self.header: # In the header declare all intercepts self.appendSection('command', '') @@ -1004,7 +1142,7 @@ if (self.featureExtraProtect != None): self.intercepts += [ '#endif' ] - OutputGenerator.genCmd(self, cmdinfo, name) + OutputGenerator.genCmd(self, cmdinfo, name, alias) # self.appendSection('command', '') self.appendSection('command', 'static %s' % (decls[0][:-1])) @@ -1012,24 +1150,10 @@ self.appendSection('command', '{%s}' % (CUSTOM_C_INTERCEPTS[name])) return self.appendSection('command', '{') - # setup common to call wrappers - # first parameter is always dispatchable - dispatchable_type = cmdinfo.elem.find('param/type').text - #dispatchable_name = cmdinfo.elem.find('param/name').text - # Default to device - device_or_instance = 'device' - #dispatch_table_name = 'VkLayerDispatchTable' - # Set to instance as necessary - #if dispatchable_type in ["VkPhysicalDevice", "VkInstance"]: - #device_or_instance = 'instance' - #dispatch_table_name = 'VkLayerInstanceDispatchTable' - #self.appendSection('command', ' %s_layer_data *%s_data = GetLayerDataPtr(get_dispatch_key(%s), %s_layer_data_map);' % (device_or_instance, device_or_instance, dispatchable_name, device_or_instance)) + api_function_name = cmdinfo.elem.attrib.get('name') - params = cmdinfo.elem.findall('param/name') - paramstext = ', '.join([str(param.text) for param in params]) # GET THE TYPE OF FUNCTION if True in [ftxt in api_function_name for ftxt in ['Create', 'Allocate']]: - #self.appendSection('command', ' //Add object generation here for last param') # Get last param last_param = cmdinfo.elem.findall('param')[-1] lp_txt = last_param.find('name').text @@ -1046,34 +1170,22 @@ # Need to lock in both cases self.appendSection('command', ' unique_lock_t lock(global_lock);') if (lp_len != None): - print("%s last params (%s) has len %s" % (handle_type, lp_txt, lp_len)) + #print("%s last params (%s) has len %s" % (handle_type, lp_txt, lp_len)) self.appendSection('command', ' for (uint32_t i = 0; i < %s; ++i) {' % (lp_len)) self.appendSection('command', ' %s[i] = (%s)%s;' % (lp_txt, lp_type, allocator_txt)) self.appendSection('command', ' }') else: - print("Single %s last param is '%s' w/ type '%s'" % (handle_type, lp_txt, lp_type)) + #print("Single %s last param is '%s' w/ type '%s'" % (handle_type, lp_txt, lp_type)) self.appendSection('command', ' *%s = (%s)%s;' % (lp_txt, lp_type, allocator_txt)) - # If las param has a len, then we need to loop over that len - # Add unique ID to return value and increment - elif True in [ftxt in api_function_name for ftxt in ['Destroy', 'Free']]: self.appendSection('command', '//Destroy object') else: self.appendSection('command', '//Not a CREATE or DESTROY function') - # GENERATE BODY CODE APPROPRIATELY - #API = api_function_name.replace('vk','%s_data->dispatch_table.' % (device_or_instance),1) - #self.appendSection('command', ' PreCall%s(%s_data, %s);' % (api_function_name[2:], device_or_instance, paramstext)) # Declare result variable, if any. resulttype = cmdinfo.elem.find('proto/type') if (resulttype != None and resulttype.text == 'void'): resulttype = None - if (resulttype != None): - assignresult = resulttype.text + ' result = ' - else: - assignresult = '' - #self.appendSection('command', ' ' + assignresult + API + '(' + paramstext + ');') - #self.appendSection('command', ' PostCall%s(%s_data, %s);' % (api_function_name[2:], device_or_instance, paramstext)) # Return result variable, if any. if (resulttype != None): self.appendSection('command', ' return VK_SUCCESS;') diff -Nru vulkan-1.0.65.2+dfsg1/scripts/object_tracker_generator.py vulkan-1.1.73+dfsg/scripts/object_tracker_generator.py --- vulkan-1.0.65.2+dfsg1/scripts/object_tracker_generator.py 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/object_tracker_generator.py 2018-04-27 11:24:19.000000000 +0000 @@ -24,6 +24,10 @@ from generator import * from collections import namedtuple from vuid_mapping import * +from common_codegen import * + +# This is a workaround to use a Python 2.7 and 3.x compatible syntax. +from io import open # ObjectTrackerGeneratorOptions - subclass of GeneratorOptions. # @@ -69,34 +73,34 @@ defaultExtensions = None, addExtensions = None, removeExtensions = None, + emitExtensions = None, sortProcedure = regSortFeatures, prefixText = "", genFuncPointers = True, protectFile = True, protectFeature = True, - protectProto = None, - protectProtoStr = None, apicall = '', apientry = '', apientryp = '', indentFuncProto = True, indentFuncPointer = False, - alignFuncParam = 0): + alignFuncParam = 0, + expandEnumerants = True): GeneratorOptions.__init__(self, filename, directory, apiname, profile, versions, emitversions, defaultExtensions, - addExtensions, removeExtensions, sortProcedure) + addExtensions, removeExtensions, emitExtensions, sortProcedure) self.prefixText = prefixText self.genFuncPointers = genFuncPointers self.protectFile = protectFile self.protectFeature = protectFeature - self.protectProto = protectProto - self.protectProtoStr = protectProtoStr self.apicall = apicall self.apientry = apientry self.apientryp = apientryp self.indentFuncProto = indentFuncProto self.indentFuncPointer = indentFuncPointer self.alignFuncParam = alignFuncParam + self.expandEnumerants = expandEnumerants + # ObjectTrackerOutputGenerator - subclass of OutputGenerator. # Generates object_tracker layer object validation code @@ -136,6 +140,7 @@ 'vkDestroySwapchainKHR', 'vkDestroyDescriptorPool', 'vkDestroyCommandPool', + 'vkGetPhysicalDeviceQueueFamilyProperties2', 'vkGetPhysicalDeviceQueueFamilyProperties2KHR', 'vkResetDescriptorPool', 'vkBeginCommandBuffer', @@ -165,7 +170,20 @@ 'vkNegotiateLoaderLayerInterfaceVersion', 'vkCreateComputePipelines', 'vkGetDeviceQueue', + 'vkGetDeviceQueue2', 'vkGetSwapchainImagesKHR', + 'vkCreateDescriptorSetLayout', + 'vkCreateDebugUtilsMessengerEXT', + 'vkDestroyDebugUtilsMessengerEXT', + 'vkSubmitDebugUtilsMessageEXT', + 'vkSetDebugUtilsObjectNameEXT', + 'vkSetDebugUtilsObjectTagEXT', + 'vkQueueBeginDebugUtilsLabelEXT', + 'vkQueueEndDebugUtilsLabelEXT', + 'vkQueueInsertDebugUtilsLabelEXT', + 'vkCmdBeginDebugUtilsLabelEXT', + 'vkCmdEndDebugUtilsLabelEXT', + 'vkCmdInsertDebugUtilsLabelEXT', ] # These VUIDS are not implicit, but are best handled in this layer. Codegen for vkDestroy calls will generate a key # which is translated here into a good VU. Saves ~40 checks. @@ -234,6 +252,9 @@ self.valid_vuids = set() # Set of all valid VUIDs self.vuid_file = None # Cover cases where file is built from scripts directory, Lin/Win, or Android build structure + # Set cwd to the script directory to more easily locate the header. + previous_dir = os.getcwd() + os.chdir(os.path.dirname(sys.argv[0])) vuid_filename_locations = [ './vk_validation_error_messages.h', '../layers/vk_validation_error_messages.h', @@ -246,7 +267,8 @@ break if self.vuid_file == None: print("Error: Could not find vk_validation_error_messages.h") - quit() + sys.exit(1) + os.chdir(previous_dir) # # Check if the parameter passed in is optional def paramIsOptional(self, param): @@ -268,6 +290,11 @@ else: print('Unrecognized len attribute value',val) isoptional = opts + if not isoptional: + # Matching logic in parameter validation and ValidityOutputGenerator.isHandleOptional + optString = param.attrib.get('noautovalidity') + if optString and optString == 'true': + isoptional = True; return isoptional # # Convert decimal number to 8 digit hexadecimal lower-case representation @@ -309,6 +336,7 @@ # Check if the parameter passed in is a pointer to an array def paramIsArray(self, param): return param.attrib.get('len') is not None + # # Generate the object tracker undestroyed object validation function def GenReportFunc(self): @@ -320,6 +348,19 @@ output_func += ' DeviceReportUndestroyedObjects(device, %s, error_code);\n' % (self.GetVulkanObjType(handle)) output_func += '}\n' return output_func + + # + # Generate the object tracker undestroyed object destruction function + def GenDestroyFunc(self): + output_func = '' + output_func += 'void DestroyUndestroyedObjects(VkDevice device) {\n' + output_func += ' DeviceDestroyUndestroyedObjects(device, kVulkanObjectTypeCommandBuffer);\n' + for handle in self.object_types: + if self.isHandleTypeNonDispatchable(handle): + output_func += ' DeviceDestroyUndestroyedObjects(device, %s);\n' % (self.GetVulkanObjType(handle)) + output_func += '}\n' + return output_func + # # Called at beginning of processing as file is opened def beginFile(self, genOpts): @@ -379,8 +420,12 @@ # Build undestroyed objects reporting function report_func = self.GenReportFunc() self.newline() + # Build undestroyed objects destruction function + destroy_func = self.GenDestroyFunc() + self.newline() write('// ObjectTracker undestroyed objects validation function', file=self.outFile) write('%s' % report_func, file=self.outFile) + write('%s' % destroy_func, file=self.outFile) # Actually write the interface to the output file. if (self.emit): self.newline() @@ -388,9 +433,6 @@ write('#ifdef', self.featureExtraProtect, file=self.outFile) # Write the object_tracker code to the file if (self.sections['command']): - if (self.genOpts.protectProto): - write(self.genOpts.protectProto, - self.genOpts.protectProtoStr, file=self.outFile) write('\n'.join(self.sections['command']), end=u'', file=self.outFile) if (self.featureExtraProtect != None): write('\n#endif //', self.featureExtraProtect, file=self.outFile) @@ -412,8 +454,9 @@ # Start processing in superclass OutputGenerator.beginFeature(self, interface, emit) self.headerVersion = None + self.featureExtraProtect = GetFeatureProtect(interface) - if self.featureName != 'VK_VERSION_1_0': + if self.featureName != 'VK_VERSION_1_0' and self.featureName != 'VK_VERSION_1_1': white_list_entry = [] if (self.featureExtraProtect != None): white_list_entry += [ '#ifdef %s' % self.featureExtraProtect ] @@ -432,14 +475,14 @@ OutputGenerator.endFeature(self) # # Process enums, structs, etc. - def genType(self, typeinfo, name): - OutputGenerator.genType(self, typeinfo, name) + def genType(self, typeinfo, name, alias): + OutputGenerator.genType(self, typeinfo, name, alias) typeElem = typeinfo.elem # If the type is a struct type, traverse the imbedded tags generating a structure. # Otherwise, emit the tag text. category = typeElem.get('category') if (category == 'struct' or category == 'union'): - self.genStruct(typeinfo, name) + self.genStruct(typeinfo, name, alias) if category == 'handle': self.object_types.append(name) # @@ -520,8 +563,8 @@ # tags instead of freeform C type declarations. The tags are just like # tags - they are a declaration of a struct or union member. Only simple member # declarations are supported (no nested structs etc.) - def genStruct(self, typeinfo, typeName): - OutputGenerator.genStruct(self, typeinfo, typeName) + def genStruct(self, typeinfo, typeName, alias): + OutputGenerator.genStruct(self, typeinfo, typeName, alias) members = typeinfo.elem.findall('.//member') # Iterate over members once to get length parameters for arrays lens = set() @@ -706,15 +749,11 @@ commonparent_vuid_string = 'VUID-%s-commonparent' % parent_name parent_vuid = self.GetVuid(commonparent_vuid_string) if obj_count is not None: - pre_call_code += '%s if (%s%s) {\n' % (indent, prefix, obj_name) - indent = self.incIndent(indent) pre_call_code += '%s for (uint32_t %s = 0; %s < %s; ++%s) {\n' % (indent, index, index, obj_count, index) indent = self.incIndent(indent) pre_call_code += '%s skip |= ValidateObject(%s, %s%s[%s], %s, %s, %s, %s);\n' % (indent, disp_name, prefix, obj_name, index, self.GetVulkanObjType(obj_type), null_allowed, param_vuid, parent_vuid) indent = self.decIndent(indent) pre_call_code += '%s }\n' % indent - indent = self.decIndent(indent) - pre_call_code += '%s }\n' % indent else: pre_call_code += '%s skip |= ValidateObject(%s, %s%s, %s, %s, %s, %s);\n' % (indent, disp_name, prefix, obj_name, self.GetVulkanObjType(obj_type), null_allowed, param_vuid, parent_vuid) return decl_code, pre_call_code, post_call_code @@ -820,10 +859,10 @@ return paramdecl, param_pre_code, param_post_code # # Capture command parameter info needed to create, destroy, and validate objects - def genCmd(self, cmdinfo, cmdname): + def genCmd(self, cmdinfo, cmdname, alias): # Add struct-member type information to command parameter information - OutputGenerator.genCmd(self, cmdinfo, cmdname) + OutputGenerator.genCmd(self, cmdinfo, cmdname, alias) members = cmdinfo.elem.findall('.//param') # Iterate over members once to get length parameters for arrays lens = set() @@ -934,7 +973,12 @@ API = cmdinfo.elem.attrib.get('name').replace('vk', dispatch_table, 1) # Put all this together for the final down-chain call if assignresult != '': - self.appendSection('command', ' if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;') + if resulttype.text == 'VkResult': + self.appendSection('command', ' if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;') + elif resulttype.text == 'VkBool32': + self.appendSection('command', ' if (skip) return VK_FALSE;') + else: + raise Exception('Unknown result type ' + resulttype.text) else: self.appendSection('command', ' if (skip) return;') self.appendSection('command', ' ' + assignresult + API + '(' + paramstext + ');') diff -Nru vulkan-1.0.65.2+dfsg1/scripts/parameter_validation_generator.py vulkan-1.1.73+dfsg/scripts/parameter_validation_generator.py --- vulkan-1.0.65.2+dfsg1/scripts/parameter_validation_generator.py 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/parameter_validation_generator.py 2018-04-27 11:24:19.000000000 +0000 @@ -25,7 +25,10 @@ from generator import * from collections import namedtuple from vuid_mapping import * +from common_codegen import * +# This is a workaround to use a Python 2.7 and 3.x compatible syntax. +from io import open # ParameterValidationGeneratorOptions - subclass of GeneratorOptions. # @@ -70,34 +73,27 @@ defaultExtensions = None, addExtensions = None, removeExtensions = None, + emitExtensions = None, sortProcedure = regSortFeatures, prefixText = "", - genFuncPointers = True, - protectFile = True, - protectFeature = True, - protectProto = None, - protectProtoStr = None, apicall = '', apientry = '', apientryp = '', indentFuncProto = True, indentFuncPointer = False, - alignFuncParam = 0): + alignFuncParam = 0, + expandEnumerants = True): GeneratorOptions.__init__(self, filename, directory, apiname, profile, versions, emitversions, defaultExtensions, - addExtensions, removeExtensions, sortProcedure) + addExtensions, removeExtensions, emitExtensions, sortProcedure) self.prefixText = prefixText - self.genFuncPointers = genFuncPointers - self.protectFile = protectFile - self.protectFeature = protectFeature - self.protectProto = protectProto - self.protectProtoStr = protectProtoStr self.apicall = apicall self.apientry = apientry self.apientryp = apientryp self.indentFuncProto = indentFuncProto self.indentFuncPointer = indentFuncPointer self.alignFuncParam = alignFuncParam + self.expandEnumerants = expandEnumerants # ParameterValidationOutputGenerator - subclass of OutputGenerator. # Generates param checker layer code. @@ -131,17 +127,12 @@ self.blacklist = [ 'vkGetInstanceProcAddr', 'vkGetDeviceProcAddr', - 'vkEnumerateInstanceLayerProperties', - 'vkEnumerateInstanceExtensionsProperties', - 'vkEnumerateDeviceLayerProperties', - 'vkEnumerateDeviceExtensionsProperties', - 'vkCreateDebugReportCallbackKHR', - 'vkDestroyDebugReportCallbackKHR', + 'vkEnumerateInstanceVersion', 'vkEnumerateInstanceLayerProperties', 'vkEnumerateInstanceExtensionProperties', 'vkEnumerateDeviceLayerProperties', - 'vkCmdDebugMarkerEndEXT', 'vkEnumerateDeviceExtensionProperties', + 'vkCmdDebugMarkerEndEXT', ] self.validate_only = [ 'vkCreateInstance', @@ -152,6 +143,10 @@ 'vkCreateDebugReportCallbackEXT', 'vkDestroyDebugReportCallbackEXT', 'vkCreateCommandPool', + 'vkCreateRenderPass', + 'vkDestroyRenderPass', + 'vkCreateDebugUtilsMessengerEXT', + 'vkDestroyDebugUtilsMessengerEXT', ] # Structure fields to ignore self.structMemberBlacklist = { 'VkWriteDescriptorSet' : ['dstSet'] } @@ -189,6 +184,9 @@ self.vuid_file = None # Cover cases where file is built from scripts directory, Lin/Win, or Android build structure + # Set cwd to the script directory to more easily locate the header. + previous_dir = os.getcwd() + os.chdir(os.path.dirname(sys.argv[0])) vuid_filename_locations = [ './vk_validation_error_messages.h', '../layers/vk_validation_error_messages.h', @@ -201,7 +199,8 @@ break if self.vuid_file == None: print("Error: Could not find vk_validation_error_messages.h") - quit() + sys.exit(1) + os.chdir(previous_dir) # # Generate Copyright comment block for file def GenerateCopyright(self): @@ -246,7 +245,7 @@ def IdToHex(self, dec_num): if dec_num > 4294967295: print ("ERROR: Decimal # %d can't be represented in 8 hex digits" % (dec_num)) - sys.exit() + sys.exit(1) hex_num = hex(dec_num) return hex_num[2:].zfill(8) # @@ -309,8 +308,8 @@ self.newline() ext_template = 'template \n' ext_template += 'bool OutputExtensionError(const T *layer_data, const std::string &api_name, const std::string &extension_name) {\n' - ext_template += ' return log_msg(layer_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,\n' - ext_template += ' EXTENSION_NOT_ENABLED, LayerName, "Attemped to call %s() but its required extension %s has not been enabled\\n",\n' + ext_template += ' return log_msg(layer_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,\n' + ext_template += ' EXTENSION_NOT_ENABLED, "Attemped to call %s() but its required extension %s has not been enabled\\n",\n' ext_template += ' api_name.c_str(), extension_name.c_str());\n' ext_template += '}\n' write(ext_template, file=self.outFile) @@ -341,14 +340,13 @@ self.headerVersion = None self.structNames = [] self.stypes = [] - self.structTypes = dict() self.commands = [] self.structMembers = [] self.newFlags = set() - + self.featureExtraProtect = GetFeatureProtect(interface) # Get base list of extension dependencies for all items in this extension base_required_extensions = [] - if self.featureName != "VK_VERSION_1_0": + if "VK_VERSION_1" not in self.featureName: # Save Name Define to get correct enable name later nameElem = interface[0][1] name = nameElem.get('name') @@ -359,7 +357,6 @@ requires = interface.get('requires') if requires is not None: base_required_extensions.extend(requires.split(',')) - # Build dictionary of extension dependencies for each item in this extension self.required_extensions = dict() for require_element in interface.findall('require'): @@ -413,14 +410,14 @@ OutputGenerator.endFeature(self) # # Type generation - def genType(self, typeinfo, name): - OutputGenerator.genType(self, typeinfo, name) + def genType(self, typeinfo, name, alias): + OutputGenerator.genType(self, typeinfo, name, alias) typeElem = typeinfo.elem # If the type is a struct type, traverse the imbedded tags generating a structure. Otherwise, emit the tag text. category = typeElem.get('category') if (category == 'struct' or category == 'union'): self.structNames.append(name) - self.genStruct(typeinfo, name) + self.genStruct(typeinfo, name, alias) elif (category == 'handle'): self.handleTypes.add(name) elif (category == 'bitmask'): @@ -435,8 +432,8 @@ # This is a special case of the tag where the contents are interpreted as a set of tags instead of freeform C # type declarations. The tags are just like tags - they are a declaration of a struct or union member. # Only simple member declarations are supported (no nested structs etc.) - def genStruct(self, typeinfo, typeName): - OutputGenerator.genStruct(self, typeinfo, typeName) + def genStruct(self, typeinfo, typeName, alias): + OutputGenerator.genStruct(self, typeinfo, typeName, alias) conditions = self.structMemberValidationConditions[typeName] if typeName in self.structMemberValidationConditions else None members = typeinfo.elem.findall('.//member') # @@ -500,8 +497,8 @@ # # Capture group (e.g. C "enum" type) info to be used for param check code generation. # These are concatenated together with other types. - def genGroup(self, groupinfo, groupName): - OutputGenerator.genGroup(self, groupinfo, groupName) + def genGroup(self, groupinfo, groupName, alias): + OutputGenerator.genGroup(self, groupinfo, groupName, alias) groupElem = groupinfo.elem # Store the sType values if groupName == 'VkStructureType': @@ -536,8 +533,8 @@ self.enumValueLists += enum_entry # # Capture command parameter info to be used for param check code generation. - def genCmd(self, cmdinfo, name): - OutputGenerator.genCmd(self, cmdinfo, name) + def genCmd(self, cmdinfo, name, alias): + OutputGenerator.genCmd(self, cmdinfo, name, alias) decls = self.makeCDecls(cmdinfo.elem) typedef = decls[1] typedef = typedef.split(')',1)[1] @@ -876,14 +873,14 @@ # If count and array parameters are optional, there will be no validation if valueRequired == 'true' or lenPtrRequired == 'true' or lenValueRequired == 'true': # When the length parameter is a pointer, there is an extra Boolean parameter in the function call to indicate if it is required - checkExpr.append('skip |= validate_array(local_data->report_data, "{}", {ppp}"{ldn}"{pps}, {ppp}"{dn}"{pps}, {pf}{ln}, {pf}{vn}, {}, {}, {}, {}, {});\n'.format( + checkExpr.append('skip |= validate_array(local_data->report_data, "{}", {ppp}"{ldn}"{pps}, {ppp}"{dn}"{pps}, {pf}{ln}, &{pf}{vn}, {}, {}, {}, {}, {});\n'.format( funcPrintName, lenPtrRequired, lenValueRequired, valueRequired, count_required_vuid, array_required_vuid, ln=lenValue.name, ldn=lenPrintName, dn=valuePrintName, vn=value.name, pf=prefix, **postProcSpec)) # This is an array with an integer count value else: # If count and array parameters are optional, there will be no validation if valueRequired == 'true' or lenValueRequired == 'true': if value.type != 'char': - checkExpr.append('skip |= validate_array(local_data->report_data, "{}", {ppp}"{ldn}"{pps}, {ppp}"{dn}"{pps}, {pf}{ln}, {pf}{vn}, {}, {}, {}, {});\n'.format( + checkExpr.append('skip |= validate_array(local_data->report_data, "{}", {ppp}"{ldn}"{pps}, {ppp}"{dn}"{pps}, {pf}{ln}, &{pf}{vn}, {}, {}, {}, {});\n'.format( funcPrintName, lenValueRequired, valueRequired, count_required_vuid, array_required_vuid, ln=lenValue.name, ldn=lenPrintName, dn=valuePrintName, vn=value.name, pf=prefix, **postProcSpec)) else: # Arrays of strings receive special processing @@ -1198,7 +1195,13 @@ cmdDef += '%sbool skip = false;\n' % indent if not just_validate: if command.result != '': - cmdDef += indent + '%s result = VK_ERROR_VALIDATION_FAILED_EXT;\n' % command.result + if command.result == "VkResult": + cmdDef += indent + '%s result = VK_ERROR_VALIDATION_FAILED_EXT;\n' % command.result + elif command.result == "VkBool32": + cmdDef += indent + '%s result = VK_FALSE;\n' % command.result + else: + raise Exception("Unknown result type: " + command.result) + cmdDef += '%sstd::unique_lock lock(global_lock);\n' % indent for line in lines: cmdDef += '\n' diff -Nru vulkan-1.0.65.2+dfsg1/scripts/reg.py vulkan-1.1.73+dfsg/scripts/reg.py --- vulkan-1.0.65.2+dfsg1/scripts/reg.py 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/reg.py 2018-03-14 09:08:48.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/python3 -i # -# Copyright (c) 2013-2017 The Khronos Group Inc. +# Copyright (c) 2013-2018 The Khronos Group Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import io,os,re,string,sys,copy +import io,os,pdb,re,string,sys,copy import xml.etree.ElementTree as etree from collections import defaultdict @@ -74,6 +74,8 @@ # elem - etree Element for this feature # resetState() - reset required/declared to initial values. Used # prior to generating a new API interface. +# compareElem(info) - return True if self.elem and info.elem have the +# same definition. class BaseInfo: """Represents the state of a registry feature, used during API generation""" def __init__(self, elem): @@ -83,6 +85,26 @@ def resetState(self): self.required = False self.declared = False + def compareElem(self, info): + # Just compares the tag and attributes. + # @@ This should be virtualized. In particular, comparing + # tags requires special-casing on the attributes, as 'extnumber' is + # only relevant when 'offset' is present. + selfKeys = sorted(self.elem.keys()) + infoKeys = sorted(info.elem.keys()) + + if selfKeys != infoKeys: + return False + + # Ignore value of 'extname', as this will inherently be different + # when redefining the same interface in different feature and/or + # extension blocks. + for key in selfKeys: + if (key != 'extname' and + (self.elem.get(key) != info.elem.get(key))): + return False + + return True # TypeInfo - registry information about a type. No additional state # beyond BaseInfo is required. @@ -148,12 +170,14 @@ # for elements. if (elem.tag == 'feature'): self.category = 'VERSION' - self.version = elem.get('number') + self.version = elem.get('name') + self.versionNumber = elem.get('number') self.number = "0" self.supported = None else: self.category = self.name.split('_', 2)[1] self.version = "0" + self.versionNumber = "0" self.number = elem.get('number') self.supported = elem.get('supported') self.emit = False @@ -175,10 +199,13 @@ # fetures to write and how to format them # emitFeatures - True to actually emit features for a version / extension, # or False to just treat them as emitted +# breakPat - regexp pattern to break on when generatng names # Public methods # loadElementTree(etree) - load registry from specified ElementTree # loadFile(filename) - load registry from XML file # setGenerator(gen) - OutputGenerator to use +# breakOnName() - specify a feature name regexp to break on when +# generating features. # parseTree() - parse the registry once loaded & create dictionaries # dumpReg(maxlen, filehandle) - diagnostic to dump the dictionaries # to specified file handle (default stdout). Truncates type / @@ -209,6 +236,8 @@ self.gen = OutputGenerator() self.genOpts = None self.emitFeatures = False + self.breakPat = None + # self.breakPat = re.compile('VkFenceImportFlagBits.*') def loadElementTree(self, tree): """Load ElementTree into a Registry object and parse it""" self.tree = tree @@ -232,13 +261,20 @@ # tuple (name,api). If not, the key is the name. 'name' is an # attribute of the Element def addElementInfo(self, elem, info, infoName, dictionary): + # self.gen.logMsg('diag', 'Adding ElementInfo.required =', + # info.required, 'name =', elem.get('name')) + if ('api' in elem.attrib): key = (elem.get('name'),elem.get('api')) else: key = elem.get('name') if key in dictionary: - self.gen.logMsg('warn', '*** Attempt to redefine', - infoName, 'with key:', key) + if not dictionary[key].compareElem(info): + self.gen.logMsg('warn', 'Attempt to redefine', key, + 'with different value (this may be benign)') + #else: + # self.gen.logMsg('warn', 'Benign redefinition of', key, + # 'with identical value') else: dictionary[key] = info # @@ -256,6 +292,8 @@ return dictionary[fname] else: return None + def breakOnName(self, regexp): + self.breakPat = re.compile(regexp) def parseTree(self): """Parse the registry Element, once created""" # This must be the Element for the root @@ -300,6 +338,8 @@ enumInfo = EnumInfo(enum) enumInfo.required = required self.addElementInfo(enum, enumInfo, 'enum', self.enumdict) + # self.gen.logMsg('diag', 'parseTree: marked req =', + # required, 'for', enum.get('name')) # # Create dictionary of registry commands from tags # and add 'name' attribute to each tag (where missing) @@ -308,13 +348,42 @@ # There's usually only one block; more are OK. # Required attributes: 'name' or tag contents self.cmddict = {} + # List of commands which alias others. Contains + # [ aliasName, element ] + # for each alias + cmdAlias = [] for cmd in self.reg.findall('commands/command'): # If the doesn't already have a 'name' attribute, set # it from contents of its tag. - if (cmd.get('name') == None): - cmd.attrib['name'] = cmd.find('proto/name').text + name = cmd.get('name') + if name == None: + name = cmd.attrib['name'] = cmd.find('proto/name').text ci = CmdInfo(cmd) self.addElementInfo(cmd, ci, 'command', self.cmddict) + alias = cmd.get('alias') + if alias: + cmdAlias.append([name, alias, cmd]) + # Now loop over aliases, injecting a copy of the aliased command's + # Element with the aliased prototype name replaced with the command + # name - if it exists. + for (name, alias, cmd) in cmdAlias: + if alias in self.cmddict: + #@ pdb.set_trace() + aliasInfo = self.cmddict[alias] + cmdElem = copy.deepcopy(aliasInfo.elem) + cmdElem.find('proto/name').text = name + cmdElem.attrib['name'] = name + cmdElem.attrib['alias'] = alias + ci = CmdInfo(cmdElem) + # Replace the dictionary entry for the CmdInfo element + self.cmddict[name] = ci + + #@ newString = etree.tostring(base, encoding="unicode").replace(aliasValue, aliasName) + #@elem.append(etree.fromstring(replacement)) + else: + self.gen.logMsg('warn', 'No matching found for command', + cmd.get('name'), 'alias', alias) + # # Create dictionaries of API and extension interfaces # from toplevel and tags. @@ -323,13 +392,8 @@ for feature in self.reg.findall('feature'): featureInfo = FeatureInfo(feature) self.addElementInfo(feature, featureInfo, 'feature', self.apidict) - self.extensions = self.reg.findall('extensions/extension') - self.extdict = {} - for feature in self.extensions: - featureInfo = FeatureInfo(feature) - self.addElementInfo(feature, featureInfo, 'extension', self.extdict) - # Add additional enums defined only in tags + # Add additional enums defined only in tags # to the corresponding core type. # When seen here, the element, processed to contain the # numeric enum value, is added to the corresponding @@ -346,8 +410,8 @@ # to the nested loop traversal of / elements # below. # - # This code also adds a 'extnumber' attribute containing the - # extension number, used for enumerant value calculation. + # This code also adds a 'version' attribute containing the + # api version. # # For tags which are actually just constants, if there's # no 'extends' tag but there is a 'value' or 'bitpos' tag, just @@ -355,24 +419,69 @@ # output generation of constants is purely dependency-based, and # doesn't need to iterate through the XML tags. # - # Something like this will need to be done for 'feature's up - # above, if we use the same mechanism for adding to the core - # API in 1.1. + for elem in feature.findall('require'): + for enum in elem.findall('enum'): + addEnumInfo = False + groupName = enum.get('extends') + if (groupName != None): + # self.gen.logMsg('diag', 'Found extension enum', + # enum.get('name')) + # Add version number attribute to the element + enum.attrib['version'] = featureInfo.version + # Look up the GroupInfo with matching groupName + if (groupName in self.groupdict.keys()): + # self.gen.logMsg('diag', 'Matching group', + # groupName, 'found, adding element...') + gi = self.groupdict[groupName] + gi.elem.append(enum) + # Remove element from parent tag + # This should be a no-op in lxml.etree + elem.remove(enum) + else: + self.gen.logMsg('warn', 'NO matching group', + groupName, 'for enum', enum.get('name'), 'found.') + addEnumInfo = True + elif (enum.get('value') or enum.get('bitpos') or enum.get('alias')): + # self.gen.logMsg('diag', 'Adding extension constant "enum"', + # enum.get('name')) + addEnumInfo = True + if (addEnumInfo): + enumInfo = EnumInfo(enum) + self.addElementInfo(enum, enumInfo, 'enum', self.enumdict) + + self.extensions = self.reg.findall('extensions/extension') + self.extdict = {} + for feature in self.extensions: + featureInfo = FeatureInfo(feature) + self.addElementInfo(feature, featureInfo, 'extension', self.extdict) + + # Add additional enums defined only in tags + # to the corresponding core type. + # Algorithm matches that of enums in a "feature" tag as above. + # + # This code also adds a 'extnumber' attribute containing the + # extension number, used for enumerant value calculation. # for elem in feature.findall('require'): for enum in elem.findall('enum'): addEnumInfo = False groupName = enum.get('extends') if (groupName != None): - # self.gen.logMsg('diag', '*** Found extension enum', + # self.gen.logMsg('diag', 'Found extension enum', # enum.get('name')) - # Add extension number attribute to the element - enum.attrib['extnumber'] = featureInfo.number + + # Add block's extension number attribute to + # the element unless specified explicitly, such + # as when redefining an enum in another extension. + extnumber = enum.get('extnumber') + if not extnumber: + enum.attrib['extnumber'] = featureInfo.number + enum.attrib['extname'] = featureInfo.name enum.attrib['supported'] = featureInfo.supported # Look up the GroupInfo with matching groupName if (groupName in self.groupdict.keys()): - # self.gen.logMsg('diag', '*** Matching group', + # self.gen.logMsg('diag', 'Matching group', # groupName, 'found, adding element...') gi = self.groupdict[groupName] gi.elem.append(enum) @@ -380,16 +489,17 @@ # This should be a no-op in lxml.etree elem.remove(enum) else: - self.gen.logMsg('warn', '*** NO matching group', + self.gen.logMsg('warn', 'NO matching group', groupName, 'for enum', enum.get('name'), 'found.') addEnumInfo = True - elif (enum.get('value') or enum.get('bitpos')): - # self.gen.logMsg('diag', '*** Adding extension constant "enum"', + elif (enum.get('value') or enum.get('bitpos') or enum.get('alias')): + # self.gen.logMsg('diag', 'Adding extension constant "enum"', # enum.get('name')) addEnumInfo = True if (addEnumInfo): enumInfo = EnumInfo(enum) self.addElementInfo(enum, enumInfo, 'enum', self.enumdict) + # Construct a "validextensionstructs" list for parent structures # based on "structextends" tags in child structures for type in self.reg.findall('types/type'): @@ -402,7 +512,7 @@ for parent in self.validextensionstructs: self.validextensionstructs[parent].sort() - def dumpReg(self, maxlen = 40, filehandle = sys.stdout): + def dumpReg(self, maxlen = 120, filehandle = sys.stdout): """Dump all the dictionaries constructed from the Registry object""" write('***************************************', file=filehandle) write(' ** Dumping Registry contents **', file=filehandle) @@ -440,50 +550,84 @@ # required - boolean (to tag features as required or not) def markTypeRequired(self, typename, required): """Require (along with its dependencies) or remove (but not its dependencies) a type""" - self.gen.logMsg('diag', '*** tagging type:', typename, '-> required =', required) + self.gen.logMsg('diag', 'tagging type:', typename, '-> required =', required) # Get TypeInfo object for tag corresponding to typename type = self.lookupElementInfo(typename, self.typedict) if (type != None): if (required): - # Tag type dependencies in 'required' attributes as + # Tag type dependencies in 'alias' and 'required' attributes as # required. This DOES NOT un-tag dependencies in a # tag. See comments in markRequired() below for the reason. - if ('requires' in type.elem.attrib): - depType = type.elem.get('requires') - self.gen.logMsg('diag', '*** Generating dependent type', - depType, 'for type', typename) - self.markTypeRequired(depType, required) + for attrib in [ 'requires', 'alias' ]: + depname = type.elem.get(attrib) + if depname: + self.gen.logMsg('diag', 'Generating dependent type', + depname, 'for', attrib, 'type', typename) + self.markTypeRequired(depname, required) # Tag types used in defining this type (e.g. in nested # tags) # Look for in entire tree, # not just immediate children for subtype in type.elem.findall('.//type'): - self.gen.logMsg('diag', '*** markRequired: type requires dependent ', subtype.text) + self.gen.logMsg('diag', 'markRequired: type requires dependent ', subtype.text) self.markTypeRequired(subtype.text, required) # Tag enums used in defining this type, for example in # member[MEMBER_SIZE] for subenum in type.elem.findall('.//enum'): - self.gen.logMsg('diag', '*** markRequired: type requires dependent ', subenum.text) + self.gen.logMsg('diag', 'markRequired: type requires dependent ', subenum.text) self.markEnumRequired(subenum.text, required) type.required = required else: - self.gen.logMsg('warn', '*** type:', typename , 'IS NOT DEFINED') + self.gen.logMsg('warn', 'type:', typename , 'IS NOT DEFINED') # # enumname - name of enum # required - boolean (to tag features as required or not) def markEnumRequired(self, enumname, required): - self.gen.logMsg('diag', '*** tagging enum:', enumname, '-> required =', required) + self.gen.logMsg('diag', 'tagging enum:', enumname, '-> required =', required) enum = self.lookupElementInfo(enumname, self.enumdict) if (enum != None): enum.required = required + # Tag enum dependencies in 'alias' attribute as required + depname = enum.elem.get('alias') + if depname: + self.gen.logMsg('diag', 'Generating dependent enum', + depname, 'for alias', enumname, 'required =', enum.required) + self.markEnumRequired(depname, required) else: - self.gen.logMsg('warn', '*** enum:', enumname , 'IS NOT DEFINED') + self.gen.logMsg('warn', 'enum:', enumname , 'IS NOT DEFINED') + # + # cmdname - name of command + # required - boolean (to tag features as required or not) + def markCmdRequired(self, cmdname, required): + self.gen.logMsg('diag', 'tagging command:', cmdname, '-> required =', required) + cmd = self.lookupElementInfo(cmdname, self.cmddict) + if (cmd != None): + cmd.required = required + # Tag command dependencies in 'alias' attribute as required + depname = cmd.elem.get('alias') + if depname: + self.gen.logMsg('diag', 'Generating dependent command', + depname, 'for alias', cmdname) + self.markCmdRequired(depname, required) + # Tag all parameter types of this command as required. + # This DOES NOT remove types of commands in a + # tag, because many other commands may use the same type. + # We could be more clever and reference count types, + # instead of using a boolean. + if (required): + # Look for in entire tree, + # not just immediate children + for type in cmd.elem.findall('.//type'): + self.gen.logMsg('diag', 'markRequired: command implicitly requires dependent type', type.text) + self.markTypeRequired(type.text, required) + else: + self.gen.logMsg('warn', 'command:', name, 'IS NOT DEFINED') # # features - Element for or tag # required - boolean (to tag features as required or not) def markRequired(self, features, required): """Require or remove features specified in the Element""" - self.gen.logMsg('diag', '*** markRequired (features = , required =', required, ')') + self.gen.logMsg('diag', 'markRequired (features = , required =', required, ')') # Loop over types, enums, and commands in the tag # @@ It would be possible to respect 'api' and 'profile' attributes # in individual features, but that's not done yet. @@ -492,24 +636,7 @@ for enumElem in features.findall('enum'): self.markEnumRequired(enumElem.get('name'), required) for cmdElem in features.findall('command'): - name = cmdElem.get('name') - self.gen.logMsg('diag', '*** tagging command:', name, '-> required =', required) - cmd = self.lookupElementInfo(name, self.cmddict) - if (cmd != None): - cmd.required = required - # Tag all parameter types of this command as required. - # This DOES NOT remove types of commands in a - # tag, because many other commands may use the same type. - # We could be more clever and reference count types, - # instead of using a boolean. - if (required): - # Look for in entire tree, - # not just immediate children - for type in cmd.elem.findall('.//type'): - self.gen.logMsg('diag', '*** markRequired: command implicitly requires dependent type', type.text) - self.markTypeRequired(type.text, required) - else: - self.gen.logMsg('warn', '*** command:', name, 'IS NOT DEFINED') + self.markCmdRequired(cmdElem.get('name'), required) # # interface - Element for or , containing # and tags @@ -554,74 +681,164 @@ # ftype - type of feature, 'type' | 'enum' | 'command' # dictionary - of *Info objects - self.{type|enum|cmd}dict def generateFeature(self, fname, ftype, dictionary): + #@ # Break to debugger on matching name pattern + #@ if self.breakPat and re.match(self.breakPat, fname): + #@ pdb.set_trace() + + self.gen.logMsg('diag', 'generateFeature: generating', ftype, fname) f = self.lookupElementInfo(fname, dictionary) if (f == None): # No such feature. This is an error, but reported earlier - self.gen.logMsg('diag', '*** No entry found for feature', fname, + self.gen.logMsg('diag', 'No entry found for feature', fname, 'returning!') return # # If feature isn't required, or has already been declared, return if (not f.required): - self.gen.logMsg('diag', '*** Skipping', ftype, fname, '(not required)') + self.gen.logMsg('diag', 'Skipping', ftype, fname, '(not required)') return if (f.declared): - self.gen.logMsg('diag', '*** Skipping', ftype, fname, '(already declared)') + self.gen.logMsg('diag', 'Skipping', ftype, fname, '(already declared)') return # Always mark feature declared, as though actually emitted f.declared = True + + # Determine if this is an alias, and of what, if so + alias = f.elem.get('alias') + if alias: + self.gen.logMsg('diag', fname, 'is an alias of', alias) + # # Pull in dependent declaration(s) of the feature. # For types, there may be one type in the 'required' attribute of - # the element, as well as many in imbedded and tags - # within the element. + # the element, one in the 'alias' attribute, and many in + # imbedded and tags within the element. # For commands, there may be many in tags within the element. # For enums, no dependencies are allowed (though perhaps if you # have a uint64 enum, it should require that type). genProc = None if (ftype == 'type'): genProc = self.gen.genType - if ('requires' in f.elem.attrib): - depname = f.elem.get('requires') - self.gen.logMsg('diag', '*** Generating required dependent type', - depname) - self.generateFeature(depname, 'type', self.typedict) + + # Generate type dependencies in 'alias' and 'required' attributes + if alias: + self.generateFeature(alias, 'type', self.typedict) + requires = f.elem.get('requires') + if requires: + self.generateFeature(requires, 'type', self.typedict) + + # Generate types used in defining this type (e.g. in nested + # tags) + # Look for in entire tree, + # not just immediate children for subtype in f.elem.findall('.//type'): - self.gen.logMsg('diag', '*** Generating required dependent ', + self.gen.logMsg('diag', 'Generating required dependent ', subtype.text) self.generateFeature(subtype.text, 'type', self.typedict) + + # Generate enums used in defining this type, for example in + # member[MEMBER_SIZE] for subtype in f.elem.findall('.//enum'): - self.gen.logMsg('diag', '*** Generating required dependent ', + self.gen.logMsg('diag', 'Generating required dependent ', subtype.text) self.generateFeature(subtype.text, 'enum', self.enumdict) + # If the type is an enum group, look up the corresponding # group in the group dictionary and generate that instead. if (f.elem.get('category') == 'enum'): - self.gen.logMsg('diag', '*** Type', fname, 'is an enum group, so generate that instead') + self.gen.logMsg('diag', 'Type', fname, 'is an enum group, so generate that instead') group = self.lookupElementInfo(fname, self.groupdict) - if (group == None): - # Unless this is tested for, it's probably fatal to call below - genProc = None - self.logMsg('warn', '*** NO MATCHING ENUM GROUP FOUND!!!') + if alias != None: + # An alias of another group name. + # Pass to genGroup with 'alias' parameter = aliased name + self.gen.logMsg('diag', 'Generating alias', fname, + 'for enumerated type', alias) + # Now, pass the *aliased* GroupInfo to the genGroup, but + # with an additional parameter which is the alias name. + genProc = self.gen.genGroup + f = self.lookupElementInfo(alias, self.groupdict) + elif group == None: + self.gen.logMsg('warn', 'Skipping enum type', fname, + ': No matching enumerant group') + return else: genProc = self.gen.genGroup f = group + + #@ The enum group is not ready for generation. At this + #@ point, it contains all tags injected by + #@ tags without any verification of whether + #@ they're required or not. It may also contain + #@ duplicates injected by multiple consistent + #@ definitions of an . + + #@ Pass over each enum, marking its enumdict[] entry as + #@ required or not. Mark aliases of enums as required, + #@ too. + + enums = group.elem.findall('enum') + + self.gen.logMsg('diag', 'generateFeature: checking enums for group', fname) + + # Check for required enums, including aliases + # LATER - Check for, report, and remove duplicates? + enumAliases = [] + for elem in enums: + name = elem.get('name') + + required = False + + extname = elem.get('extname') + version = elem.get('version') + if extname is not None: + # 'supported' attribute was injected when the element was + # moved into the group in Registry.parseTree() + if self.genOpts.defaultExtensions == elem.get('supported'): + required = True + elif re.match(self.genOpts.addExtensions, extname) is not None: + required = True + elif version is not None: + required = re.match(self.genOpts.emitversions, version) is not None + else: + required = True + + self.gen.logMsg('diag', '* required =', required, 'for', name) + if required: + # Mark this element as required (in the element, not the EnumInfo) + elem.attrib['required'] = 'true' + # If it's an alias, track that for later use + enumAlias = elem.get('alias') + if enumAlias: + enumAliases.append(enumAlias) + for elem in enums: + name = elem.get('name') + if name in enumAliases: + elem.attrib['required'] = 'true' + self.gen.logMsg('diag', '* also need to require alias', name) elif (ftype == 'command'): + # Generate command dependencies in 'alias' attribute + if alias: + self.generateFeature(alias, 'command', self.cmddict) + genProc = self.gen.genCmd for type in f.elem.findall('.//type'): depname = type.text - self.gen.logMsg('diag', '*** Generating required parameter type', + self.gen.logMsg('diag', 'Generating required parameter type', depname) self.generateFeature(depname, 'type', self.typedict) elif (ftype == 'enum'): + # Generate enum dependencies in 'alias' attribute + if alias: + self.generateFeature(alias, 'enum', self.enumdict) genProc = self.gen.genEnum + # Actually generate the type only if emitting declarations if self.emitFeatures: - self.gen.logMsg('diag', '*** Emitting', ftype, 'decl for', fname) - genProc(f, fname) + self.gen.logMsg('diag', 'Emitting', ftype, fname, 'declaration') + genProc(f, fname, alias) else: - self.gen.logMsg('diag', '*** Skipping', ftype, fname, - '(not emitting this feature)') + self.gen.logMsg('diag', 'Skipping', ftype, fname, + '(should not be emitted)') # # generateRequiredInterface - generate all interfaces required # by an API version or extension @@ -661,8 +878,10 @@ regEmitVersions = re.compile(self.genOpts.emitversions) regAddExtensions = re.compile(self.genOpts.addExtensions) regRemoveExtensions = re.compile(self.genOpts.removeExtensions) + regEmitExtensions = re.compile(self.genOpts.emitExtensions) # - # Get all matching API versions & add to list of FeatureInfo + # Get all matching API feature names & add to list of FeatureInfo + # Note we used to select on feature version attributes, not names. features = [] apiMatch = False for key in self.apidict: @@ -670,26 +889,30 @@ api = fi.elem.get('api') if (api == self.genOpts.apiname): apiMatch = True - if (regVersions.match(fi.version)): + if (regVersions.match(fi.name)): # Matches API & version #s being generated. Mark for # emission and add to the features[] list . # @@ Could use 'declared' instead of 'emit'? - fi.emit = (regEmitVersions.match(fi.version) != None) + fi.emit = (regEmitVersions.match(fi.name) != None) features.append(fi) if (not fi.emit): - self.gen.logMsg('diag', '*** NOT tagging feature api =', api, + self.gen.logMsg('diag', 'NOT tagging feature api =', api, 'name =', fi.name, 'version =', fi.version, 'for emission (does not match emitversions pattern)') + else: + self.gen.logMsg('diag', 'Including feature api =', api, + 'name =', fi.name, 'version =', fi.version, + 'for emission (matches emitversions pattern)') else: - self.gen.logMsg('diag', '*** NOT including feature api =', api, + self.gen.logMsg('diag', 'NOT including feature api =', api, 'name =', fi.name, 'version =', fi.version, '(does not match requested versions)') else: - self.gen.logMsg('diag', '*** NOT including feature api =', api, + self.gen.logMsg('diag', 'NOT including feature api =', api, 'name =', fi.name, '(does not match requested API)') if (not apiMatch): - self.gen.logMsg('warn', '*** No matching API versions found!') + self.gen.logMsg('warn', 'No matching API versions found!') # # Get all matching extensions, in order by their extension number, # and add to the list of features. @@ -708,7 +931,7 @@ pat = '^(' + ei.elem.get('supported') + ')$' if (self.genOpts.defaultExtensions and re.match(pat, self.genOpts.defaultExtensions)): - self.gen.logMsg('diag', '*** Including extension', + self.gen.logMsg('diag', 'Including extension', extName, "(defaultExtensions matches the 'supported' attribute)") include = True # @@ -717,7 +940,7 @@ # forcing extensions into an interface even if they're not # tagged appropriately in the registry. if (regAddExtensions.match(extName) != None): - self.gen.logMsg('diag', '*** Including extension', + self.gen.logMsg('diag', 'Including extension', extName, '(matches explicitly requested extensions to add)') include = True # Remove extensions if the name matches the regexp specified @@ -725,20 +948,25 @@ # extensions from an interface even if they're tagged that # way in the registry. if (regRemoveExtensions.match(extName) != None): - self.gen.logMsg('diag', '*** Removing extension', + self.gen.logMsg('diag', 'Removing extension', extName, '(matches explicitly requested extensions to remove)') include = False # # If the extension is to be included, add it to the # extension features list. if (include): - ei.emit = True + ei.emit = (regEmitExtensions.match(extName) != None) features.append(ei) - + if (not ei.emit): + self.gen.logMsg('diag', 'NOT tagging extension', + extName, + 'for emission (does not match emitextensions pattern)') # Hack - can be removed when validity generator goes away + # (Jon) I'm not sure what this does, or if it should respect + # the ei.emit flag above. self.requiredextensions.append(extName) else: - self.gen.logMsg('diag', '*** NOT including extension', + self.gen.logMsg('diag', 'NOT including extension', extName, '(does not match api attribute or explicitly requested extensions)') # # Sort the extension features list, if a sort procedure is defined @@ -753,9 +981,9 @@ # If a profile other than 'None' is being generated, it must # match the profile attribute (if any) of the and # tags. - self.gen.logMsg('diag', '*** PASS 1: TAG FEATURES ********************************************') + self.gen.logMsg('diag', '*******PASS 1: TAG FEATURES **********') for f in features: - self.gen.logMsg('diag', '*** PASS 1: Tagging required and removed features for', + self.gen.logMsg('diag', 'PASS 1: Tagging required and removed features for', f.name) self.requireAndRemoveFeatures(f.elem, self.genOpts.apiname, self.genOpts.profile) self.assignAdditionalValidity(f.elem, self.genOpts.apiname, self.genOpts.profile) @@ -763,14 +991,14 @@ # Pass 2: loop over specified API versions and extensions printing # declarations for required things which haven't already been # generated. - self.gen.logMsg('diag', '*** PASS 2: GENERATE INTERFACES FOR FEATURES ************************') + self.gen.logMsg('diag', '*******PASS 2: GENERATE INTERFACES FOR FEATURES **********') self.gen.beginFile(self.genOpts) for f in features: - self.gen.logMsg('diag', '*** PASS 2: Generating interface for', + self.gen.logMsg('diag', 'PASS 2: Generating interface for', f.name) emit = self.emitFeatures = f.emit if (not emit): - self.gen.logMsg('diag', '*** PASS 2: NOT declaring feature', + self.gen.logMsg('diag', 'PASS 2: NOT declaring feature', f.elem.get('name'), 'because it is not tagged for emission') # Generate the interface (or just tag its elements as having been # emitted, if they haven't been). @@ -798,15 +1026,15 @@ """Validate group= attributes on and tags""" # Keep track of group names not in tags badGroup = {} - self.gen.logMsg('diag', '*** VALIDATING GROUP ATTRIBUTES ***') + self.gen.logMsg('diag', 'VALIDATING GROUP ATTRIBUTES ***') for cmd in self.reg.findall('commands/command'): proto = cmd.find('proto') funcname = cmd.find('proto/name').text if ('group' in proto.attrib.keys()): group = proto.get('group') - # self.gen.logMsg('diag', '*** Command ', funcname, ' has return group ', group) + # self.gen.logMsg('diag', 'Command ', funcname, ' has return group ', group) if (group not in self.groupdict.keys()): - # self.gen.logMsg('diag', '*** Command ', funcname, ' has UNKNOWN return group ', group) + # self.gen.logMsg('diag', 'Command ', funcname, ' has UNKNOWN return group ', group) if (group not in badGroup.keys()): badGroup[group] = 1 else: @@ -820,12 +1048,12 @@ if ('group' in param.attrib.keys()): group = param.get('group') if (group not in self.groupdict.keys()): - # self.gen.logMsg('diag', '*** Command ', funcname, ' param ', pname, ' has UNKNOWN group ', group) + # self.gen.logMsg('diag', 'Command ', funcname, ' param ', pname, ' has UNKNOWN group ', group) if (group not in badGroup.keys()): badGroup[group] = 1 else: badGroup[group] = badGroup[group] + 1 if (len(badGroup.keys()) > 0): - self.gen.logMsg('diag', '*** SUMMARY OF UNRECOGNIZED GROUPS ***') + self.gen.logMsg('diag', 'SUMMARY OF UNRECOGNIZED GROUPS ***') for key in sorted(badGroup.keys()): self.gen.logMsg('diag', ' ', key, ' occurred ', badGroup[key], ' times') diff -Nru vulkan-1.0.65.2+dfsg1/scripts/source_line_info.py vulkan-1.1.73+dfsg/scripts/source_line_info.py --- vulkan-1.0.65.2+dfsg1/scripts/source_line_info.py 2017-03-24 07:50:37.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/source_line_info.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -#!/usr/bin/env python3 -# -# Copyright (c) 2015-2016 The Khronos Group Inc. -# Copyright (c) 2015-2016 Valve Corporation -# Copyright (c) 2015-2016 LunarG, Inc. -# Copyright (c) 2015-2016 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author: Tobin Ehlis - -from inspect import currentframe, getframeinfo - -# This is a wrapper class for inspect module that returns a formatted line -# with details of the source file and line number of python code who called -# into this class. The result can them be added to codegen to simplify -# debug as it shows where code was generated from. -class sourcelineinfo(): - def __init__(self): - self.general_prefix = "// CODEGEN : " - self.file_prefix = "file " - self.line_prefix = "line #" - self.enabled = True - - def get(self): - if self.enabled: - frameinfo = getframeinfo(currentframe().f_back) - return "%s%s%s %s%s" % (self.general_prefix, self.file_prefix, frameinfo.filename, self.line_prefix, frameinfo.lineno) - return "" diff -Nru vulkan-1.0.65.2+dfsg1/scripts/spec.py vulkan-1.1.73+dfsg/scripts/spec.py --- vulkan-1.0.65.2+dfsg1/scripts/spec.py 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/spec.py 2018-04-27 11:24:19.000000000 +0000 @@ -8,6 +8,7 @@ from bs4 import BeautifulSoup import json import vuid_mapping +import re ############################# # spec.py script @@ -27,11 +28,9 @@ out_filename = "../layers/vk_validation_error_messages.h" # can override w/ '-out ' option db_filename = "../layers/vk_validation_error_database.txt" # can override w/ '-gendb ' option -json_filename = None # con pass in w/ '-json option +json_filename = "../scripts/validusage.json" # can override w/ '-json-file option gen_db = False # set to True when '-gendb ' option provided json_compare = False # compare existing DB to json file input -json_url = "https://www.khronos.org/registry/vulkan/specs/1.0-extensions/validation/validusage.json" -read_json = False # This is the root spec link that is used in error messages to point users to spec sections #old_spec_url = "https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html" spec_url = "https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html" @@ -43,7 +42,7 @@ validation_error_enum_name = "VALIDATION_ERROR_" def printHelp(): - print ("Usage: python spec.py [-out ] [-gendb ] [-update] [-json ] [-help]") + print ("Usage: python spec.py [-out ] [-gendb ] [-update] [-json-file ] [-help]") print ("\n Default script behavior is to parse the specfile and generate a header of unique error enums and corresponding error messages based on the specfile.\n") print (" Default specfile is from online at %s" % (spec_url)) print (" Default headerfile is %s" % (out_filename)) @@ -52,8 +51,7 @@ print (" the list of enums and their error messages.") print ("\nIf '-update' option is specified this triggers the master flow to automate updating header and database files using default db file as baseline") print (" and online spec file as the latest. The default header and database files will be updated in-place for review and commit to the git repo.") - print ("\nIf '-json' option is used trigger the script to load in data from a json file.") - print ("\nIf '-json-file' option is it will point to a local json file, else '%s' is used from the web." % (json_url)) + print ("\nIf '-json-file' option is specified, it will override the default json file location") def get8digithex(dec_num): """Convert a decimal # into an 8-digit hex""" @@ -127,6 +125,8 @@ print ("Looking at dict for api:ext entry %s:%s" % (api, ext)) vuid = vu_txt_dict['vuid'] vutxt = vu_txt_dict['text'] + # strip asciidoc xref from vu text + vutxt = re.sub('&amp;lt;&amp;lt;([^&]*,\\s*|)(.*?)&amp;gt;&amp;gt;', '\\2', vutxt) #print ("%s:%s:%s:%s" % (api, ext, vuid, vutxt)) #print ("VUTXT orig:%s" % (vutxt)) just_txt = BeautifulSoup(vutxt, 'html.parser') @@ -151,57 +151,34 @@ def compareJSON(self): """Compare parsed json file with existing data read in from DB file""" - json_db_set = set() - for vuid in self.json_db: # pull entries out and see which fields we're missing from error_db - json_db_set.add(vuid) - for enum in self.error_db_dict: - vuid_string = self.error_db_dict[enum]['vuid_string'] - if vuid_string not in self.json_db: - #print ("Full string for %s is:%s" % (enum, full_error_string)) - print ("WARN: Couldn't find vuid_string in json db:%s" % (vuid_string)) - self.json_missing = self.json_missing + 1 - self.error_db_dict[enum]['ext'] = 'core' - # TODO: Currently GL843 tracks 2 VUs that are missing from json incorrectly - # Fix will land in 1.0.51 spec. After that we should take some alternative - # action here to indicate that VUs have gone away. - # Can have a removed_enums set that we add to and report to user - #sys.exit() + # update database for all json vuids + for vuid, vuid_json_data in self.json_db.items(): + # convert vuid to error enum + error_enum = "%s%s" % (validation_error_enum_name, get8digithex(vuid_json_data['number_vuid'])) + # create database entry if one doesn't exist + if error_enum not in self.error_db_dict: + self.error_db_dict[error_enum] = {'check_implemented': 'N', + 'testname': 'None', + 'note': ''} + # update database entry with data from json file + vuid_db_data = self.error_db_dict[error_enum] + if 'core' == vuid_json_data['ext'] or '!' in vuid_json_data['ext']: + spec_link = "%s#%s" % (core_url, vuid) else: - json_db_set.remove(vuid_string) - self.error_db_dict[enum]['ext'] = self.json_db[vuid_string]['ext'] - if 'core' == self.json_db[vuid_string]['ext'] or '!' in self.json_db[vuid_string]['ext']: - spec_link = "%s#%s" % (core_url, vuid_string) - else: - spec_link = "%s#%s" % (ext_url, vuid_string) - self.error_db_dict[enum]['error_msg'] = "%s'%s' (%s)" % (error_msg_prefix, self.json_db[vuid_string]['vu_txt'], spec_link) - print ("Updated error_db error_msg:%s" % (self.error_db_dict[enum]['error_msg'])) - #sys.exit() - print ("These json DB entries are not in error DB:") - for extra_vuid in json_db_set: - print ("\t%s" % (extra_vuid)) - # Add these missing entries into the error_db - # Create link into core or ext spec as needed - if 'core' == self.json_db[extra_vuid]['ext'] or '!' in self.json_db[extra_vuid]['ext']: - spec_link = "%s#%s" % (core_url, extra_vuid) - else: - spec_link = "%s#%s" % (ext_url, extra_vuid) - error_enum = "%s%s" % (validation_error_enum_name, get8digithex(self.json_db[extra_vuid]['number_vuid'])) - self.error_db_dict[error_enum] = {} - self.error_db_dict[error_enum]['check_implemented'] = 'N' - self.error_db_dict[error_enum]['testname'] = 'None' - self.error_db_dict[error_enum]['api'] = self.json_db[extra_vuid]['struct_func'] - self.error_db_dict[error_enum]['vuid_string'] = extra_vuid - self.error_db_dict[error_enum]['error_msg'] = "%s'%s' (%s)" % (error_msg_prefix, self.json_db[extra_vuid]['vu_txt'], spec_link) - self.error_db_dict[error_enum]['note'] = '' - self.error_db_dict[error_enum]['ext'] = self.json_db[extra_vuid]['ext'] - implicit = False - last_segment = extra_vuid.split("-")[-1] - if last_segment in vuid_mapping.implicit_type_map: - implicit = True - elif not last_segment.isdigit(): # Explicit ids should only have digits in last segment - print ("ERROR: Found last segment of val error ID that isn't in implicit map and doesn't have numbers in last segment: %s" % (last_segment)) - sys.exit() - self.error_db_dict[error_enum]['implicit'] = implicit + spec_link = "%s#%s" % (ext_url, vuid) + vuid_db_data['api'] = vuid_json_data['struct_func'] + vuid_db_data['vuid_string'] = vuid + vuid_db_data['error_msg'] = "%s'%s' (%s)" % (error_msg_prefix, vuid_json_data['vu_txt'], spec_link) + vuid_db_data['ext'] = vuid_json_data['ext'] + last_segment = vuid.split("-")[-1] + vuid_db_data['implicit'] = not last_segment.isdigit() + + # remove missing vuids from database + for enum in list(self.error_db_dict): + vuid = self.error_db_dict[enum]['vuid_string'] + if vuid not in self.json_db: + print ("WARN: Couldn't find vuid_string in json db:%s" % (vuid)) + del self.error_db_dict[enum] def genHeader(self, header_file): """Generate a header file based on the contents of a parsed spec""" @@ -211,35 +188,32 @@ file_contents.append('\n#pragma once') file_contents.append('\n// Disable auto-formatting for generated file') file_contents.append('// clang-format off') - file_contents.append('\n#include ') + file_contents.append('\n#include ') + file_contents.append('#include ') file_contents.append('\n// enum values for unique validation error codes') file_contents.append('// Corresponding validation error message for each enum is given in the mapping table below') file_contents.append('// When a given error occurs, these enum values should be passed to the as the messageCode') file_contents.append('// parameter to the PFN_vkDebugReportCallbackEXT function') enum_decl = ['enum UNIQUE_VALIDATION_ERROR_CODE {\n VALIDATION_ERROR_UNDEFINED = -1,'] - error_string_map = ['static std::unordered_map validation_error_map{'] + vuid_int_to_error_map = ['static std::unordered_map validation_error_map{'] + vuid_string_to_error_map = ['static std::unordered_map validation_error_text_map{'] enum_value = 0 max_enum_val = 0 for enum in sorted(self.error_db_dict): - #print ("Header enum is %s" % (enum)) - # TMP: Use updated value + enum_decl.append(' %s = 0x%s,' % (enum, enum[-8:])) + vuid_int_to_error_map.append(' {%s, "%s"},' % (enum, self.error_db_dict[enum]['error_msg'].replace('"', '\\"'))) vuid_str = self.error_db_dict[enum]['vuid_string'] - if vuid_str in self.json_db: - enum_value = self.json_db[vuid_str]['number_vuid'] - else: - enum_value = vuid_mapping.convertVUID(vuid_str) - new_enum = "%s%s" % (validation_error_enum_name, get8digithex(enum_value)) - enum_decl.append(' %s = 0x%s,' % (new_enum, get8digithex(enum_value))) - error_string_map.append(' {%s, "%s"},' % (new_enum, self.error_db_dict[enum]['error_msg'].replace('"', '\\"'))) + vuid_string_to_error_map.append(' {"%s", %s},' % (vuid_str, enum)) max_enum_val = max(max_enum_val, enum_value) enum_decl.append(' %sMAX_ENUM = %d,' % (validation_error_enum_name, max_enum_val + 1)) enum_decl.append('};') - error_string_map.append('};\n') + vuid_int_to_error_map.append('};\n') + vuid_string_to_error_map.append('};\n') file_contents.extend(enum_decl) - file_contents.append('\n// Mapping from unique validation error enum to the corresponding error message') - file_contents.append('// The error message should be appended to the end of a custom error message that is passed') - file_contents.append('// as the pMessage parameter to the PFN_vkDebugReportCallbackEXT function') - file_contents.extend(error_string_map) + file_contents.append('\n// Mapping from unique validation error enum to the corresponding spec text') + file_contents.extend(vuid_int_to_error_map) + file_contents.append('\n// Mapping from spec validation error text string to unique validation error enum') + file_contents.extend(vuid_string_to_error_map) #print ("File contents: %s" % (file_contents)) with open(header_file, "w") as outfile: outfile.write("\n".join(file_contents)) @@ -321,8 +295,6 @@ if (arg == '-json-file'): json_filename = sys.argv[i] i = i + 1 - elif (arg == '-json'): - read_json = True elif (arg == '-json-compare'): json_compare = True elif (arg == '-out'): @@ -335,17 +307,14 @@ db_filename = sys.argv[i] i = i + 1 elif (arg == '-update'): - read_json = True json_compare = True gen_db = True elif (arg in ['-help', '-h']): printHelp() sys.exit() spec = Specification() - if read_json: - spec.readJSON() - spec.parseJSON() - #sys.exit() + spec.readJSON() + spec.parseJSON() if (json_compare): # Read in current spec info from db file (orig_err_msg_dict) = spec.readDB(db_filename) diff -Nru vulkan-1.0.65.2+dfsg1/scripts/threading_generator.py vulkan-1.1.73+dfsg/scripts/threading_generator.py --- vulkan-1.0.65.2+dfsg1/scripts/threading_generator.py 2017-07-03 14:21:22.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/threading_generator.py 2018-03-14 09:08:48.000000000 +0000 @@ -22,6 +22,7 @@ import os,re,sys from generator import * +from common_codegen import * # ThreadGeneratorOptions - subclass of GeneratorOptions. # @@ -67,34 +68,34 @@ defaultExtensions = None, addExtensions = None, removeExtensions = None, + emitExtensions = None, sortProcedure = regSortFeatures, prefixText = "", genFuncPointers = True, protectFile = True, protectFeature = True, - protectProto = None, - protectProtoStr = None, apicall = '', apientry = '', apientryp = '', indentFuncProto = True, indentFuncPointer = False, - alignFuncParam = 0): + alignFuncParam = 0, + expandEnumerants = True): GeneratorOptions.__init__(self, filename, directory, apiname, profile, versions, emitversions, defaultExtensions, - addExtensions, removeExtensions, sortProcedure) + addExtensions, removeExtensions, emitExtensions, sortProcedure) self.prefixText = prefixText self.genFuncPointers = genFuncPointers self.protectFile = protectFile self.protectFeature = protectFeature - self.protectProto = protectProto - self.protectProtoStr = protectProtoStr self.apicall = apicall self.apientry = apientry self.apientryp = apientryp self.indentFuncProto = indentFuncProto self.indentFuncPointer = indentFuncPointer self.alignFuncParam = alignFuncParam + self.expandEnumerants = expandEnumerants + # ThreadOutputGenerator - subclass of OutputGenerator. # Generates Thread checking framework @@ -291,6 +292,7 @@ # Accumulate includes, defines, types, enums, function pointer typedefs, # end function prototypes separately for this feature. They're only # printed in endFeature(). + self.featureExtraProtect = GetFeatureProtect(interface) self.sections = dict([(section, []) for section in self.ALL_SECTIONS]) #write('// ending beginFeature', file=self.outFile) def endFeature(self): @@ -332,7 +334,7 @@ self.sections[section].append(text) # # Type generation - def genType(self, typeinfo, name): + def genType(self, typeinfo, name, alias): pass # # Struct (e.g. C "struct" type) generation. @@ -342,8 +344,8 @@ # tags - they are a declaration of a struct or union member. # Only simple member declarations are supported (no nested # structs etc.) - def genStruct(self, typeinfo, typeName): - OutputGenerator.genStruct(self, typeinfo, typeName) + def genStruct(self, typeinfo, typeName, alias): + OutputGenerator.genStruct(self, typeinfo, typeName, alias) body = 'typedef ' + typeinfo.elem.get('category') + ' ' + typeName + ' {\n' # paramdecl = self.makeCParamDecl(typeinfo.elem, self.genOpts.alignFuncParam) for member in typeinfo.elem.findall('.//member'): @@ -354,16 +356,16 @@ # # Group (e.g. C "enum" type) generation. # These are concatenated together with other types. - def genGroup(self, groupinfo, groupName): + def genGroup(self, groupinfo, groupName, alias): pass # Enumerant generation # tags may specify their values in several ways, but are usually # just integers. - def genEnum(self, enuminfo, name): + def genEnum(self, enuminfo, name, alias): pass # # Command generation - def genCmd(self, cmdinfo, name): + def genCmd(self, cmdinfo, name, alias): # Commands shadowed by interface functions and are not implemented special_functions = [ 'vkGetDeviceProcAddr', @@ -382,6 +384,8 @@ 'vkEnumerateInstanceExtensionProperties', 'vkEnumerateDeviceLayerProperties', 'vkEnumerateDeviceExtensionProperties', + 'vkCreateDebugUtilsMessengerEXT', + 'vkDestroyDebugUtilsMessengerEXT', ] if name in special_functions: decls = self.makeCDecls(cmdinfo.elem) @@ -390,7 +394,7 @@ self.appendSection('command', decls[0]) self.intercepts += [ ' {"%s", (void*)%s},' % (name,name[2:]) ] return - if "QueuePresentKHR" in name or ("DebugMarker" in name and "EXT" in name): + if "QueuePresentKHR" in name or (("DebugMarker" in name or "DebugUtilsObject" in name) and "EXT" in name): self.appendSection('command', '// TODO - not wrapping EXT function ' + name) return # Determine first if this function needs to be intercepted @@ -405,7 +409,7 @@ if (self.featureExtraProtect != None): self.intercepts += [ '#endif' ] - OutputGenerator.genCmd(self, cmdinfo, name) + OutputGenerator.genCmd(self, cmdinfo, name, alias) # decls = self.makeCDecls(cmdinfo.elem) self.appendSection('command', '') diff -Nru vulkan-1.0.65.2+dfsg1/scripts/unique_objects_generator.py vulkan-1.1.73+dfsg/scripts/unique_objects_generator.py --- vulkan-1.0.65.2+dfsg1/scripts/unique_objects_generator.py 2017-09-21 12:31:57.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/unique_objects_generator.py 2018-04-27 11:24:19.000000000 +0000 @@ -24,6 +24,7 @@ import xml.etree.ElementTree as etree from generator import * from collections import namedtuple +from common_codegen import * # UniqueObjectsGeneratorOptions - subclass of GeneratorOptions. # @@ -69,34 +70,34 @@ defaultExtensions = None, addExtensions = None, removeExtensions = None, + emitExtensions = None, sortProcedure = regSortFeatures, prefixText = "", genFuncPointers = True, protectFile = True, protectFeature = True, - protectProto = None, - protectProtoStr = None, apicall = '', apientry = '', apientryp = '', indentFuncProto = True, indentFuncPointer = False, - alignFuncParam = 0): + alignFuncParam = 0, + expandEnumerants = True): GeneratorOptions.__init__(self, filename, directory, apiname, profile, versions, emitversions, defaultExtensions, - addExtensions, removeExtensions, sortProcedure) + addExtensions, removeExtensions, emitExtensions, sortProcedure) self.prefixText = prefixText self.genFuncPointers = genFuncPointers self.protectFile = protectFile self.protectFeature = protectFeature - self.protectProto = protectProto - self.protectProtoStr = protectProtoStr self.apicall = apicall self.apientry = apientry self.apientryp = apientryp self.indentFuncProto = indentFuncProto self.indentFuncPointer = indentFuncPointer - self.alignFuncParam = alignFuncParam + self.alignFuncParam = alignFuncParam + self.expandEnumerants = expandEnumerants + # UniqueObjectsOutputGenerator - subclass of OutputGenerator. # Generates unique objects layer non-dispatchable handle-wrapping code. @@ -137,19 +138,24 @@ 'vkCreateSwapchainKHR', 'vkCreateSharedSwapchainsKHR', 'vkGetSwapchainImagesKHR', + 'vkDestroySwapchainKHR', 'vkQueuePresentKHR', 'vkEnumerateInstanceLayerProperties', 'vkEnumerateDeviceLayerProperties', 'vkEnumerateInstanceExtensionProperties', + 'vkCreateDescriptorUpdateTemplate', 'vkCreateDescriptorUpdateTemplateKHR', + 'vkDestroyDescriptorUpdateTemplate', 'vkDestroyDescriptorUpdateTemplateKHR', + 'vkUpdateDescriptorSetWithTemplate', 'vkUpdateDescriptorSetWithTemplateKHR', 'vkCmdPushDescriptorSetWithTemplateKHR', 'vkDebugMarkerSetObjectTagEXT', 'vkDebugMarkerSetObjectNameEXT', - 'vkGetPhysicalDeviceDisplayProperties2KHR', - 'vkGetPhysicalDeviceDisplayPlaneProperties2KHR', - 'vkGetDisplayModeProperties2KHR', + 'vkCreateRenderPass', + 'vkDestroyRenderPass', + 'vkSetDebugUtilsObjectNameEXT', + 'vkSetDebugUtilsObjectTagEXT', ] # Commands shadowed by interface functions and are not implemented self.interface_functions = [ @@ -158,10 +164,14 @@ 'vkGetDisplayPlaneSupportedDisplaysKHR', 'vkGetDisplayModePropertiesKHR', 'vkGetDisplayPlaneCapabilitiesKHR', - # DebugReport APIs are hooked, but handled separately in the source file + # VK_EXT_debug_report APIs are hooked, but handled separately in the source file 'vkCreateDebugReportCallbackEXT', 'vkDestroyDebugReportCallbackEXT', 'vkDebugReportMessageEXT', + # VK_EXT_debug_utils APIs are hooked, but handled separately in the source file + 'vkCreateDebugUtilsMessengerEXT', + 'vkDestroyDebugUtilsMessengerEXT', + 'vkSubmitDebugUtilsMessageEXT', ] self.headerVersion = None # Internal state - accumulators for different inner block text @@ -234,32 +244,12 @@ write('#ifdef', self.featureExtraProtect, file=self.outFile) # Write the unique_objects code to the file if (self.sections['command']): - if (self.genOpts.protectProto): - write(self.genOpts.protectProto, - self.genOpts.protectProtoStr, file=self.outFile) write('\n'.join(self.sections['command']), end=u'', file=self.outFile) if (self.featureExtraProtect != None): write('\n#endif //', self.featureExtraProtect, file=self.outFile) else: self.newline() - # Write out device extension white list - self.newline() - write('// Layer Device Extension Whitelist', file=self.outFile) - write('static const char *kUniqueObjectsSupportedDeviceExtensions =', file=self.outFile) - for line in self.device_extensions: - write('%s' % line, file=self.outFile) - write(';\n', file=self.outFile) - - # Write out instance extension white list - self.newline() - write('// Layer Instance Extension Whitelist', file=self.outFile) - write('static const char *kUniqueObjectsSupportedInstanceExtensions =', file=self.outFile) - for line in self.instance_extensions: - write('%s' % line, file=self.outFile) - write(';\n', file=self.outFile) - self.newline() - # Record intercepted procedures write('// Map of all APIs to be intercepted by this layer', file=self.outFile) write('static const std::unordered_map name_to_funcptr_map = {', file=self.outFile) @@ -274,8 +264,8 @@ # Start processing in superclass OutputGenerator.beginFeature(self, interface, emit) self.headerVersion = None - - if self.featureName != 'VK_VERSION_1_0': + self.featureExtraProtect = GetFeatureProtect(interface) + if self.featureName != 'VK_VERSION_1_0' and self.featureName != 'VK_VERSION_1_1': white_list_entry = [] if (self.featureExtraProtect != None): white_list_entry += [ '#ifdef %s' % self.featureExtraProtect ] @@ -292,14 +282,14 @@ # Finish processing in superclass OutputGenerator.endFeature(self) # - def genType(self, typeinfo, name): - OutputGenerator.genType(self, typeinfo, name) + def genType(self, typeinfo, name, alias): + OutputGenerator.genType(self, typeinfo, name, alias) typeElem = typeinfo.elem # If the type is a struct type, traverse the imbedded tags generating a structure. # Otherwise, emit the tag text. category = typeElem.get('category') if (category == 'struct' or category == 'union'): - self.genStruct(typeinfo, name) + self.genStruct(typeinfo, name, alias) # # Append a definition to the specified section def appendSection(self, section, text): @@ -370,8 +360,8 @@ # tags instead of freeform C type declarations. The tags are just like # tags - they are a declaration of a struct or union member. Only simple member # declarations are supported (no nested structs etc.) - def genStruct(self, typeinfo, typeName): - OutputGenerator.genStruct(self, typeinfo, typeName) + def genStruct(self, typeinfo, typeName, alias): + OutputGenerator.genStruct(self, typeinfo, typeName, alias) members = typeinfo.elem.findall('.//member') # Iterate over members once to get length parameters for arrays lens = set() @@ -486,7 +476,7 @@ def build_extension_processing_func(self): # Construct helper functions to build and free pNext extension chains pnext_proc = '' - pnext_proc += 'void *CreateUnwrappedExtensionStructs(layer_data *dev_data, const void *pNext) {\n' + pnext_proc += 'void *CreateUnwrappedExtensionStructs(const void *pNext) {\n' pnext_proc += ' void *cur_pnext = const_cast(pNext);\n' pnext_proc += ' void *head_pnext = NULL;\n' pnext_proc += ' void *prev_ext_struct = NULL;\n' @@ -527,12 +517,24 @@ pnext_proc += '}\n\n' pnext_proc += '// Free a pNext extension chain\n' pnext_proc += 'void FreeUnwrappedExtensionStructs(void *head) {\n' - pnext_proc += ' void * curr_ptr = head;\n' + pnext_proc += ' GenericHeader *curr_ptr = reinterpret_cast(head);\n' pnext_proc += ' while (curr_ptr) {\n' - pnext_proc += ' GenericHeader *header = reinterpret_cast(curr_ptr);\n' - pnext_proc += ' void *temp = curr_ptr;\n' - pnext_proc += ' curr_ptr = header->pNext;\n' - pnext_proc += ' free(temp);\n' + pnext_proc += ' GenericHeader *header = curr_ptr;\n' + pnext_proc += ' curr_ptr = reinterpret_cast(header->pNext);\n\n' + pnext_proc += ' switch (header->sType) {\n'; + for item in self.extension_structs: + struct_info = self.struct_member_dict[item] + if struct_info[0].feature_protect is not None: + pnext_proc += '#ifdef %s \n' % struct_info[0].feature_protect + pnext_proc += ' case %s:\n' % self.structTypes[item].value + pnext_proc += ' delete reinterpret_cast(header);\n' % item + pnext_proc += ' break;\n' + if struct_info[0].feature_protect is not None: + pnext_proc += '#endif // %s \n' % struct_info[0].feature_protect + pnext_proc += '\n' + pnext_proc += ' default:\n' + pnext_proc += ' assert(0);\n' + pnext_proc += ' }\n' pnext_proc += ' }\n' pnext_proc += '}\n' return pnext_proc @@ -556,7 +558,7 @@ create_ndo_code += '%sfor (uint32_t index0 = 0; index0 < %s; index0++) {\n' % (indent, cmd_info[-1].len) indent = self.incIndent(indent) ndo_dest = '%s[index0]' % cmd_info[-1].name - create_ndo_code += '%s%s = WrapNew(dev_data, %s);\n' % (indent, ndo_dest, ndo_dest) + create_ndo_code += '%s%s = WrapNew(%s);\n' % (indent, ndo_dest, ndo_dest) if ndo_array == True: indent = self.decIndent(indent) create_ndo_code += '%s}\n' % indent @@ -585,7 +587,7 @@ indent = self.incIndent(indent) destroy_ndo_code += '%s%s handle = %s[index0];\n' % (indent, cmd_info[param].type, cmd_info[param].name) destroy_ndo_code += '%suint64_t unique_id = reinterpret_cast(handle);\n' % (indent) - destroy_ndo_code += '%sdev_data->unique_id_mapping.erase(unique_id);\n' % (indent) + destroy_ndo_code += '%sunique_id_mapping.erase(unique_id);\n' % (indent) indent = self.decIndent(indent); destroy_ndo_code += '%s}\n' % indent indent = self.decIndent(indent); @@ -594,8 +596,8 @@ # Remove a single handle from the map destroy_ndo_code += '%sstd::unique_lock lock(global_lock);\n' % (indent) destroy_ndo_code += '%suint64_t %s_id = reinterpret_cast(%s);\n' % (indent, cmd_info[param].name, cmd_info[param].name) - destroy_ndo_code += '%s%s = (%s)dev_data->unique_id_mapping[%s_id];\n' % (indent, cmd_info[param].name, cmd_info[param].type, cmd_info[param].name) - destroy_ndo_code += '%sdev_data->unique_id_mapping.erase(%s_id);\n' % (indent, cmd_info[param].name) + destroy_ndo_code += '%s%s = (%s)unique_id_mapping[%s_id];\n' % (indent, cmd_info[param].name, cmd_info[param].type, cmd_info[param].name) + destroy_ndo_code += '%sunique_id_mapping.erase(%s_id);\n' % (indent, cmd_info[param].name) destroy_ndo_code += '%slock.unlock();\n' % (indent) return ndo_array, destroy_ndo_code @@ -630,11 +632,11 @@ pre_call_code += '%s local_%s%s = new %s[%s];\n' % (indent, prefix, ndo_name, ndo_type, ndo_count) pre_call_code += '%s for (uint32_t %s = 0; %s < %s; ++%s) {\n' % (indent, index, index, ndo_count, index) indent = self.incIndent(indent) - pre_call_code += '%s local_%s%s[%s] = Unwrap(dev_data, %s[%s]);\n' % (indent, prefix, ndo_name, index, ndo_name, index) + pre_call_code += '%s local_%s%s[%s] = Unwrap(%s[%s]);\n' % (indent, prefix, ndo_name, index, ndo_name, index) else: pre_call_code += '%s for (uint32_t %s = 0; %s < %s; ++%s) {\n' % (indent, index, index, ndo_count, index) indent = self.incIndent(indent) - pre_call_code += '%s %s%s[%s] = Unwrap(dev_data, %s%s[%s]);\n' % (indent, prefix, ndo_name, index, prefix, ndo_name, index) + pre_call_code += '%s %s%s[%s] = Unwrap(%s%s[%s]);\n' % (indent, prefix, ndo_name, index, prefix, ndo_name, index) indent = self.decIndent(indent) pre_call_code += '%s }\n' % indent indent = self.decIndent(indent) @@ -646,14 +648,14 @@ else: if top_level == True: if (destroy_func == False) or (destroy_array == True): - pre_call_code += '%s %s = Unwrap(dev_data, %s);\n' % (indent, ndo_name, ndo_name) + pre_call_code += '%s %s = Unwrap(%s);\n' % (indent, ndo_name, ndo_name) else: # Make temp copy of this var with the 'local' removed. It may be better to not pass in 'local_' # as part of the string and explicitly print it fix = str(prefix).strip('local_'); pre_call_code += '%s if (%s%s) {\n' % (indent, fix, ndo_name) indent = self.incIndent(indent) - pre_call_code += '%s %s%s = Unwrap(dev_data, %s%s);\n' % (indent, prefix, ndo_name, fix, ndo_name) + pre_call_code += '%s %s%s = Unwrap(%s%s);\n' % (indent, prefix, ndo_name, fix, ndo_name) indent = self.decIndent(indent) pre_call_code += '%s }\n' % indent return decl_code, pre_call_code, post_call_code @@ -706,7 +708,7 @@ if first_level_param == True: pre_code += '%s %s[%s].initialize(&%s[%s]);\n' % (indent, new_prefix, index, member.name, index) if process_pnext: - pre_code += '%s %s[%s].pNext = CreateUnwrappedExtensionStructs(dev_data, %s[%s].pNext);\n' % (indent, new_prefix, index, new_prefix, index) + pre_code += '%s %s[%s].pNext = CreateUnwrappedExtensionStructs(%s[%s].pNext);\n' % (indent, new_prefix, index, new_prefix, index) local_prefix = '%s[%s].' % (new_prefix, index) # Process sub-structs in this struct (tmp_decl, tmp_pre, tmp_post) = self.uniquify_members(struct_info, indent, local_prefix, array_index, create_func, destroy_func, destroy_array, False) @@ -738,7 +740,7 @@ pre_code += tmp_pre post_code += tmp_post if process_pnext: - pre_code += '%s local_%s%s->pNext = CreateUnwrappedExtensionStructs(dev_data, local_%s%s->pNext);\n' % (indent, prefix, member.name, prefix, member.name) + pre_code += '%s local_%s%s->pNext = CreateUnwrappedExtensionStructs(local_%s%s->pNext);\n' % (indent, prefix, member.name, prefix, member.name) indent = self.decIndent(indent) pre_code += '%s }\n' % indent if first_level_param == True: @@ -783,10 +785,10 @@ return paramdecl, param_pre_code, param_post_code # # Capture command parameter info needed to wrap NDOs as well as handling some boilerplate code - def genCmd(self, cmdinfo, cmdname): + def genCmd(self, cmdinfo, cmdname, alias): # Add struct-member type information to command parameter information - OutputGenerator.genCmd(self, cmdinfo, cmdname) + OutputGenerator.genCmd(self, cmdinfo, cmdname, alias) members = cmdinfo.elem.findall('.//param') # Iterate over members once to get length parameters for arrays lens = set() diff -Nru vulkan-1.0.65.2+dfsg1/scripts/validusage.json vulkan-1.1.73+dfsg/scripts/validusage.json --- vulkan-1.0.65.2+dfsg1/scripts/validusage.json 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/validusage.json 2018-04-27 11:24:19.000000000 +0000 @@ -0,0 +1,18388 @@ +{ + "version info": { + "schema version": 2, + "api version": "1.1.73", + "comment": "from git branch: master commit: 5300d9f05e03f721812273d5f9f9676c3227f056", + "date": "2018-04-16 14:18:46Z" + }, + "validation": { + "vkGetInstanceProcAddr": { + "core": [ + { + "vuid": "VUID-vkGetInstanceProcAddr-instance-parameter", + "text": " If instance is not NULL, instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkGetInstanceProcAddr-pName-parameter", + "text": " pName must be a null-terminated UTF-8 string" + } + ] + }, + "vkGetDeviceProcAddr": { + "core": [ + { + "vuid": "VUID-vkGetDeviceProcAddr-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetDeviceProcAddr-pName-parameter", + "text": " pName must be a null-terminated UTF-8 string" + } + ] + }, + "vkEnumerateInstanceVersion": { + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkEnumerateInstanceVersion-pApiVersion-parameter", + "text": " pApiVersion must be a valid pointer to a uint32_t value" + } + ] + }, + "vkCreateInstance": { + "core": [ + { + "vuid": "VUID-vkCreateInstance-ppEnabledExtensionNames-01388", + "text": " All &amp;lt;&amp;lt;extended-functionality-extensions-dependencies, required extensions&amp;gt;&amp;gt; for each extension in the
VkInstanceCreateInfo::ppEnabledExtensionNames list must also be present in that list." + }, + { + "vuid": "VUID-vkCreateInstance-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkInstanceCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateInstance-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateInstance-pInstance-parameter", + "text": " pInstance must be a valid pointer to a VkInstance handle" + } + ] + }, + "VkInstanceCreateInfo": { + "core": [ + { + "vuid": "VUID-VkInstanceCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO" + }, + { + "vuid": "VUID-VkInstanceCreateInfo-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDebugReportCallbackCreateInfoEXT, VkDebugUtilsMessengerCreateInfoEXT, or VkValidationFlagsEXT" + }, + { + "vuid": "VUID-VkInstanceCreateInfo-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + }, + { + "vuid": "VUID-VkInstanceCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkInstanceCreateInfo-pApplicationInfo-parameter", + "text": " If pApplicationInfo is not NULL, pApplicationInfo must be a valid pointer to a valid VkApplicationInfo structure" + }, + { + "vuid": "VUID-VkInstanceCreateInfo-ppEnabledLayerNames-parameter", + "text": " If enabledLayerCount is not 0, ppEnabledLayerNames must be a valid pointer to an array of enabledLayerCount null-terminated UTF-8 strings" + }, + { + "vuid": "VUID-VkInstanceCreateInfo-ppEnabledExtensionNames-parameter", + "text": " If enabledExtensionCount is not 0, ppEnabledExtensionNames must be a valid pointer to an array of enabledExtensionCount null-terminated UTF-8 strings" + } + ] + }, + "VkValidationFlagsEXT": { + "(VK_EXT_validation_flags)": [ + { + "vuid": "VUID-VkValidationFlagsEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT" + }, + { + "vuid": "VUID-VkValidationFlagsEXT-pDisabledValidationChecks-parameter", + "text": " pDisabledValidationChecks must be a valid pointer to an array of disabledValidationCheckCount VkValidationCheckEXT values" + }, + { + "vuid": "VUID-VkValidationFlagsEXT-disabledValidationCheckCount-arraylength", + "text": " disabledValidationCheckCount must be greater than 0" + } + ] + }, + "VkApplicationInfo": { + "core": [ + { + "vuid": "VUID-VkApplicationInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_APPLICATION_INFO" + }, + { + "vuid": "VUID-VkApplicationInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkApplicationInfo-pApplicationName-parameter", + "text": " If pApplicationName is not NULL, pApplicationName must be a null-terminated UTF-8 string" + }, + { + "vuid": "VUID-VkApplicationInfo-pEngineName-parameter", + "text": " If pEngineName is not NULL, pEngineName must be a null-terminated UTF-8 string" + } + ] + }, + "vkDestroyInstance": { + "core": [ + { + "vuid": "VUID-vkDestroyInstance-instance-00629", + "text": " All child objects created using instance must have been destroyed prior to destroying instance" + }, + { + "vuid": "VUID-vkDestroyInstance-instance-00630", + "text": " If VkAllocationCallbacks were provided when instance was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyInstance-instance-00631", + "text": " If no VkAllocationCallbacks were provided when instance was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyInstance-instance-parameter", + "text": " If instance is not NULL, instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkDestroyInstance-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + } + ] + }, + "vkEnumeratePhysicalDevices": { + "core": [ + { + "vuid": "VUID-vkEnumeratePhysicalDevices-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkEnumeratePhysicalDevices-pPhysicalDeviceCount-parameter", + "text": " pPhysicalDeviceCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkEnumeratePhysicalDevices-pPhysicalDevices-parameter", + "text": " If the value referenced by pPhysicalDeviceCount is not 0, and pPhysicalDevices is not NULL, pPhysicalDevices must be a valid pointer to an array of pPhysicalDeviceCount VkPhysicalDevice handles" + } + ] + }, + "vkGetPhysicalDeviceProperties": { + "core": [ + { + "vuid": "VUID-vkGetPhysicalDeviceProperties-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceProperties-pProperties-parameter", + "text": " pProperties must be a valid pointer to a VkPhysicalDeviceProperties structure" + } + ] + }, + "vkGetPhysicalDeviceProperties2": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceProperties2-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceProperties2-pProperties-parameter", + "text": " pProperties must be a valid pointer to a VkPhysicalDeviceProperties2 structure" + } + ] + }, + "VkPhysicalDeviceProperties2": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-VkPhysicalDeviceProperties2-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2" + }, + { + "vuid": "VUID-VkPhysicalDeviceProperties2-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT, VkPhysicalDeviceConservativeRasterizationPropertiesEXT, VkPhysicalDeviceDescriptorIndexingPropertiesEXT, VkPhysicalDeviceDiscardRectanglePropertiesEXT, VkPhysicalDeviceExternalMemoryHostPropertiesEXT, VkPhysicalDeviceIDProperties, VkPhysicalDeviceMaintenance3Properties, VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX, VkPhysicalDeviceMultiviewProperties, VkPhysicalDevicePointClippingProperties, VkPhysicalDeviceProtectedMemoryProperties, VkPhysicalDevicePushDescriptorPropertiesKHR, VkPhysicalDeviceSampleLocationsPropertiesEXT, VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT, VkPhysicalDeviceShaderCorePropertiesAMD, VkPhysicalDeviceSubgroupProperties, or VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT" + }, + { + "vuid": "VUID-VkPhysicalDeviceProperties2-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + } + ] + }, + "VkPhysicalDeviceIDProperties": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)+(VK_VERSION_1_1,VK_KHR_external_memory_capabilities,VK_KHR_external_semaphore_capabilities,VK_KHR_external_fence_capabilities)": [ + { + "vuid": "VUID-VkPhysicalDeviceIDProperties-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES" + } + ] + }, + "vkGetPhysicalDeviceQueueFamilyProperties": { + "core": [ + { + "vuid": "VUID-vkGetPhysicalDeviceQueueFamilyProperties-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceQueueFamilyProperties-pQueueFamilyPropertyCount-parameter", + "text": " pQueueFamilyPropertyCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceQueueFamilyProperties-pQueueFamilyProperties-parameter", + "text": " If the value referenced by pQueueFamilyPropertyCount is not 0, and pQueueFamilyProperties is not NULL, pQueueFamilyProperties must be a valid pointer to an array of pQueueFamilyPropertyCount VkQueueFamilyProperties structures" + } + ] + }, + "vkGetPhysicalDeviceQueueFamilyProperties2": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceQueueFamilyProperties2-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceQueueFamilyProperties2-pQueueFamilyPropertyCount-parameter", + "text": " pQueueFamilyPropertyCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceQueueFamilyProperties2-pQueueFamilyProperties-parameter", + "text": " If the value referenced by pQueueFamilyPropertyCount is not 0, and pQueueFamilyProperties is not NULL, pQueueFamilyProperties must be a valid pointer to an array of pQueueFamilyPropertyCount VkQueueFamilyProperties2 structures" + } + ] + }, + "VkQueueFamilyProperties2": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-VkQueueFamilyProperties2-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2" + }, + { + "vuid": "VUID-VkQueueFamilyProperties2-pNext-pNext", + "text": " pNext must be NULL" + } + ] + }, + "vkEnumeratePhysicalDeviceGroups": { + "(VK_VERSION_1_1,VK_KHR_device_group_creation)": [ + { + "vuid": "VUID-vkEnumeratePhysicalDeviceGroups-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkEnumeratePhysicalDeviceGroups-pPhysicalDeviceGroupCount-parameter", + "text": " pPhysicalDeviceGroupCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkEnumeratePhysicalDeviceGroups-pPhysicalDeviceGroupProperties-parameter", + "text": " If the value referenced by pPhysicalDeviceGroupCount is not 0, and pPhysicalDeviceGroupProperties is not NULL, pPhysicalDeviceGroupProperties must be a valid pointer to an array of pPhysicalDeviceGroupCount VkPhysicalDeviceGroupProperties structures" + } + ] + }, + "vkCreateDevice": { + "core": [ + { + "vuid": "VUID-vkCreateDevice-ppEnabledExtensionNames-01387", + "text": " All &amp;lt;&amp;lt;extended-functionality-extensions-dependencies, required extensions&amp;gt;&amp;gt; for each extension in the VkDeviceCreateInfo::ppEnabledExtensionNames list must also be present in that list." + }, + { + "vuid": "VUID-vkCreateDevice-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkCreateDevice-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkDeviceCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateDevice-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateDevice-pDevice-parameter", + "text": " pDevice must be a valid pointer to a VkDevice handle" + } + ] + }, + "VkDeviceCreateInfo": { + "core": [ + { + "vuid": "VUID-VkDeviceCreateInfo-queueFamilyIndex-00372", + "text": "" + }, + { + "vuid": "VUID-VkDeviceCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO" + }, + { + "vuid": "VUID-VkDeviceCreateInfo-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDeviceGroupDeviceCreateInfo, VkPhysicalDevice16BitStorageFeatures, VkPhysicalDeviceDescriptorIndexingFeaturesEXT, VkPhysicalDeviceFeatures2, VkPhysicalDeviceMultiviewFeatures, VkPhysicalDeviceProtectedMemoryFeatures, VkPhysicalDeviceSamplerYcbcrConversionFeatures, or VkPhysicalDeviceVariablePointerFeatures" + }, + { + "vuid": "VUID-VkDeviceCreateInfo-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + }, + { + "vuid": "VUID-VkDeviceCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkDeviceCreateInfo-pQueueCreateInfos-parameter", + "text": " pQueueCreateInfos must be a valid pointer to an array of queueCreateInfoCount valid VkDeviceQueueCreateInfo structures" + }, + { + "vuid": "VUID-VkDeviceCreateInfo-ppEnabledLayerNames-parameter", + "text": " If enabledLayerCount is not 0, ppEnabledLayerNames must be a valid pointer to an array of enabledLayerCount null-terminated UTF-8 strings" + }, + { + "vuid": "VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-parameter", + "text": " If enabledExtensionCount is not 0, ppEnabledExtensionNames must be a valid pointer to an array of enabledExtensionCount null-terminated UTF-8 strings" + }, + { + "vuid": "VUID-VkDeviceCreateInfo-pEnabledFeatures-parameter", + "text": " If pEnabledFeatures is not NULL, pEnabledFeatures must be a valid pointer to a valid VkPhysicalDeviceFeatures structure" + }, + { + "vuid": "VUID-VkDeviceCreateInfo-queueCreateInfoCount-arraylength", + "text": " queueCreateInfoCount must be greater than 0" + } + ], + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-VkDeviceCreateInfo-pNext-00373", + "text": " If the pNext chain includes a VkPhysicalDeviceFeatures2 structure, then pEnabledFeatures must be NULL" + } + ], + "(VK_AMD_negative_viewport_height)+(VK_VERSION_1_1)": [ + { + "vuid": "VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-01840", + "text": " ppEnabledExtensionNames must not contain VK_AMD_negative_viewport_height" + } + ], + "(VK_AMD_negative_viewport_height)+!(VK_VERSION_1_1)+(VK_VERSION_1_1,VK_KHR_maintenance1)": [ + { + "vuid": "VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-00374", + "text": " ppEnabledExtensionNames must not contain both VK_KHR_maintenance1 and VK_AMD_negative_viewport_height" + } + ] + }, + "VkDeviceGroupDeviceCreateInfo": { + "(VK_VERSION_1_1,VK_KHR_device_group_creation)": [ + { + "vuid": "VUID-VkDeviceGroupDeviceCreateInfo-pPhysicalDevices-00375", + "text": " Each element of pPhysicalDevices must be unique" + }, + { + "vuid": "VUID-VkDeviceGroupDeviceCreateInfo-pPhysicalDevices-00376", + "text": " All elements of pPhysicalDevices must be in the same device group as enumerated by vkEnumeratePhysicalDeviceGroups" + }, + { + "vuid": "VUID-VkDeviceGroupDeviceCreateInfo-physicalDeviceCount-00377", + "text": " If physicalDeviceCount is not 0, the physicalDevice parameter of vkCreateDevice must be an element of pPhysicalDevices." + }, + { + "vuid": "VUID-VkDeviceGroupDeviceCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO" + }, + { + "vuid": "VUID-VkDeviceGroupDeviceCreateInfo-pPhysicalDevices-parameter", + "text": " If physicalDeviceCount is not 0, pPhysicalDevices must be a valid pointer to an array of physicalDeviceCount valid VkPhysicalDevice handles" + } + ] + }, + "vkDestroyDevice": { + "core": [ + { + "vuid": "VUID-vkDestroyDevice-device-00378", + "text": " All child objects created on device must have been destroyed prior to destroying device" + }, + { + "vuid": "VUID-vkDestroyDevice-device-00379", + "text": " If VkAllocationCallbacks were provided when device was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyDevice-device-00380", + "text": " If no VkAllocationCallbacks were provided when device was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyDevice-device-parameter", + "text": " If device is not NULL, device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyDevice-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + } + ] + }, + "VkDeviceQueueCreateInfo": { + "core": [ + { + "vuid": "VUID-VkDeviceQueueCreateInfo-queueFamilyIndex-00381", + "text": " queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties" + }, + { + "vuid": "VUID-VkDeviceQueueCreateInfo-queueCount-00382", + "text": " queueCount must be less than or equal to the queueCount member of the VkQueueFamilyProperties structure, as returned by vkGetPhysicalDeviceQueueFamilyProperties in the pQueueFamilyProperties[queueFamilyIndex]" + }, + { + "vuid": "VUID-VkDeviceQueueCreateInfo-pQueuePriorities-00383", + "text": " Each element of pQueuePriorities must be between 0.0 and 1.0 inclusive" + }, + { + "vuid": "VUID-VkDeviceQueueCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO" + }, + { + "vuid": "VUID-VkDeviceQueueCreateInfo-pNext-pNext", + "text": " pNext must be NULL or a pointer to a valid instance of VkDeviceQueueGlobalPriorityCreateInfoEXT" + }, + { + "vuid": "VUID-VkDeviceQueueCreateInfo-flags-parameter", + "text": " flags must be a valid combination of VkDeviceQueueCreateFlagBits values" + }, + { + "vuid": "VUID-VkDeviceQueueCreateInfo-pQueuePriorities-parameter", + "text": " pQueuePriorities must be a valid pointer to an array of queueCount float values" + }, + { + "vuid": "VUID-VkDeviceQueueCreateInfo-queueCount-arraylength", + "text": " queueCount must be greater than 0" + } + ] + }, + "VkDeviceQueueGlobalPriorityCreateInfoEXT": { + "(VK_EXT_global_priority)": [ + { + "vuid": "VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT" + }, + { + "vuid": "VUID-VkDeviceQueueGlobalPriorityCreateInfoEXT-globalPriority-parameter", + "text": " globalPriority must be a valid VkQueueGlobalPriorityEXT value" + } + ] + }, + "vkGetDeviceQueue": { + "core": [ + { + "vuid": "VUID-vkGetDeviceQueue-queueFamilyIndex-00384", + "text": " queueFamilyIndex must be one of the queue family indices specified when device was created, via the VkDeviceQueueCreateInfo structure" + }, + { + "vuid": "VUID-vkGetDeviceQueue-queueIndex-00385", + "text": " queueIndex must be less than the number of queues created for the specified queue family index when device was created, via the queueCount member of the VkDeviceQueueCreateInfo structure" + }, + { + "vuid": "VUID-vkGetDeviceQueue-flags-01841", + "text": " VkDeviceQueueCreateInfo::flags must have been set to zero when device was created" + }, + { + "vuid": "VUID-vkGetDeviceQueue-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetDeviceQueue-pQueue-parameter", + "text": " pQueue must be a valid pointer to a VkQueue handle" + } + ] + }, + "vkGetDeviceQueue2": { + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkGetDeviceQueue2-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetDeviceQueue2-pQueueInfo-parameter", + "text": " pQueueInfo must be a valid pointer to a valid VkDeviceQueueInfo2 structure" + }, + { + "vuid": "VUID-vkGetDeviceQueue2-pQueue-parameter", + "text": " pQueue must be a valid pointer to a VkQueue handle" + } + ] + }, + "VkDeviceQueueInfo2": { + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-VkDeviceQueueInfo2-queueFamilyIndex-01842", + "text": " queueFamilyIndex must be one of the queue family indices specified when device was created, via the VkDeviceQueueCreateInfo structure" + }, + { + "vuid": "VUID-VkDeviceQueueInfo2-queueIndex-01843", + "text": " queueIndex must be less than the number of queues created for the specified queue family index and VkDeviceQueueCreateFlags member flags equal to this flags value when device was created, via the queueCount member of the VkDeviceQueueCreateInfo structure" + }, + { + "vuid": "VUID-VkDeviceQueueInfo2-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2" + }, + { + "vuid": "VUID-VkDeviceQueueInfo2-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkDeviceQueueInfo2-flags-parameter", + "text": " flags must be a valid combination of VkDeviceQueueCreateFlagBits values" + }, + { + "vuid": "VUID-VkDeviceQueueInfo2-flags-requiredbitmask", + "text": " flags must not be 0" + } + ] + }, + "vkCreateCommandPool": { + "core": [ + { + "vuid": "VUID-vkCreateCommandPool-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateCommandPool-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkCommandPoolCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateCommandPool-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateCommandPool-pCommandPool-parameter", + "text": " pCommandPool must be a valid pointer to a VkCommandPool handle" + } + ] + }, + "VkCommandPoolCreateInfo": { + "core": [ + { + "vuid": "VUID-VkCommandPoolCreateInfo-queueFamilyIndex-00039", + "text": " queueFamilyIndex must be the index of a queue family available in the calling command’s device parameter" + }, + { + "vuid": "VUID-VkCommandPoolCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO" + }, + { + "vuid": "VUID-VkCommandPoolCreateInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkCommandPoolCreateInfo-flags-parameter", + "text": " flags must be a valid combination of VkCommandPoolCreateFlagBits values" + } + ] + }, + "vkTrimCommandPool": { + "(VK_VERSION_1_1,VK_KHR_maintenance1)": [ + { + "vuid": "VUID-vkTrimCommandPool-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkTrimCommandPool-commandPool-parameter", + "text": " commandPool must be a valid VkCommandPool handle" + }, + { + "vuid": "VUID-vkTrimCommandPool-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-vkTrimCommandPool-commandPool-parent", + "text": " commandPool must have been created, allocated, or retrieved from device" + } + ] + }, + "vkResetCommandPool": { + "core": [ + { + "vuid": "VUID-vkResetCommandPool-commandPool-00040", + "text": " All VkCommandBuffer objects allocated from commandPool must not be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, pending state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkResetCommandPool-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkResetCommandPool-commandPool-parameter", + "text": " commandPool must be a valid VkCommandPool handle" + }, + { + "vuid": "VUID-vkResetCommandPool-flags-parameter", + "text": " flags must be a valid combination of VkCommandPoolResetFlagBits values" + }, + { + "vuid": "VUID-vkResetCommandPool-commandPool-parent", + "text": " commandPool must have been created, allocated, or retrieved from device" + } + ] + }, + "vkDestroyCommandPool": { + "core": [ + { + "vuid": "VUID-vkDestroyCommandPool-commandPool-00041", + "text": " All VkCommandBuffer objects allocated from commandPool must not be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, pending state&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-vkDestroyCommandPool-commandPool-00042", + "text": " If VkAllocationCallbacks were provided when commandPool was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyCommandPool-commandPool-00043", + "text": " If no VkAllocationCallbacks were provided when commandPool was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyCommandPool-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyCommandPool-commandPool-parameter", + "text": " If commandPool is not VK_NULL_HANDLE, commandPool must be a valid VkCommandPool handle" + }, + { + "vuid": "VUID-vkDestroyCommandPool-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyCommandPool-commandPool-parent", + "text": " If commandPool is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkAllocateCommandBuffers": { + "core": [ + { + "vuid": "VUID-vkAllocateCommandBuffers-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkAllocateCommandBuffers-pAllocateInfo-parameter", + "text": " pAllocateInfo must be a valid pointer to a valid VkCommandBufferAllocateInfo structure" + }, + { + "vuid": "VUID-vkAllocateCommandBuffers-pCommandBuffers-parameter", + "text": " pCommandBuffers must be a valid pointer to an array of pAllocateInfo::commandBufferCount VkCommandBuffer handles" + } + ] + }, + "VkCommandBufferAllocateInfo": { + "core": [ + { + "vuid": "VUID-VkCommandBufferAllocateInfo-commandBufferCount-00044", + "text": " commandBufferCount must be greater than 0" + }, + { + "vuid": "VUID-VkCommandBufferAllocateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO" + }, + { + "vuid": "VUID-VkCommandBufferAllocateInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkCommandBufferAllocateInfo-commandPool-parameter", + "text": " commandPool must be a valid VkCommandPool handle" + }, + { + "vuid": "VUID-VkCommandBufferAllocateInfo-level-parameter", + "text": " level must be a valid VkCommandBufferLevel value" + } + ] + }, + "vkResetCommandBuffer": { + "core": [ + { + "vuid": "VUID-vkResetCommandBuffer-commandBuffer-00045", + "text": " commandBuffer must not be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, pending state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkResetCommandBuffer-commandBuffer-00046", + "text": " commandBuffer must have been allocated from a pool that was created with the VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT" + }, + { + "vuid": "VUID-vkResetCommandBuffer-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkResetCommandBuffer-flags-parameter", + "text": " flags must be a valid combination of VkCommandBufferResetFlagBits values" + } + ] + }, + "vkFreeCommandBuffers": { + "core": [ + { + "vuid": "VUID-vkFreeCommandBuffers-pCommandBuffers-00047", + "text": " All elements of pCommandBuffers must not be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, pending state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkFreeCommandBuffers-pCommandBuffers-00048", + "text": " pCommandBuffers must be a valid pointer to an array of commandBufferCount VkCommandBuffer handles, each element of which must either be a valid handle or NULL" + }, + { + "vuid": "VUID-vkFreeCommandBuffers-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkFreeCommandBuffers-commandPool-parameter", + "text": " commandPool must be a valid VkCommandPool handle" + }, + { + "vuid": "VUID-vkFreeCommandBuffers-commandBufferCount-arraylength", + "text": " commandBufferCount must be greater than 0" + }, + { + "vuid": "VUID-vkFreeCommandBuffers-commandPool-parent", + "text": " commandPool must have been created, allocated, or retrieved from device" + }, + { + "vuid": "VUID-vkFreeCommandBuffers-pCommandBuffers-parent", + "text": " Each element of pCommandBuffers that is a valid handle must have been created, allocated, or retrieved from commandPool" + } + ] + }, + "vkBeginCommandBuffer": { + "core": [ + { + "vuid": "VUID-vkBeginCommandBuffer-commandBuffer-00049", + "text": " commandBuffer must not be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording or pending state&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-vkBeginCommandBuffer-commandBuffer-00050", + "text": " If commandBuffer was allocated from a VkCommandPool which did not have the VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT flag set, commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, initial state&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-vkBeginCommandBuffer-commandBuffer-00051", + "text": " If commandBuffer is a secondary command buffer, the pInheritanceInfo member of pBeginInfo must be a valid VkCommandBufferInheritanceInfo structure" + }, + { + "vuid": "VUID-vkBeginCommandBuffer-commandBuffer-00052", + "text": " If commandBuffer is a secondary command buffer and either the occlusionQueryEnable member of the pInheritanceInfo member of pBeginInfo is VK_FALSE, or the precise occlusion queries feature is not enabled, the queryFlags member of the pInheritanceInfo member pBeginInfo must not contain VK_QUERY_CONTROL_PRECISE_BIT" + }, + { + "vuid": "VUID-vkBeginCommandBuffer-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkBeginCommandBuffer-pBeginInfo-parameter", + "text": " pBeginInfo must be a valid pointer to a valid VkCommandBufferBeginInfo structure" + } + ] + }, + "VkCommandBufferBeginInfo": { + "core": [ + { + "vuid": "VUID-VkCommandBufferBeginInfo-flags-00053", + "text": " If flags contains VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, the renderPass member of pInheritanceInfo must be a valid VkRenderPass" + }, + { + "vuid": "VUID-VkCommandBufferBeginInfo-flags-00054", + "text": " If flags contains VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, the subpass member of pInheritanceInfo must be a valid subpass index within the renderPass member of pInheritanceInfo" + }, + { + "vuid": "VUID-VkCommandBufferBeginInfo-flags-00055", + "text": " If flags contains VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, the framebuffer member of pInheritanceInfo must be either VK_NULL_HANDLE, or a valid VkFramebuffer that is compatible with the renderPass member of pInheritanceInfo" + }, + { + "vuid": "VUID-VkCommandBufferBeginInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO" + }, + { + "vuid": "VUID-VkCommandBufferBeginInfo-pNext-pNext", + "text": " pNext must be NULL or a pointer to a valid instance of VkDeviceGroupCommandBufferBeginInfo" + }, + { + "vuid": "VUID-VkCommandBufferBeginInfo-flags-parameter", + "text": " flags must be a valid combination of VkCommandBufferUsageFlagBits values" + } + ] + }, + "VkCommandBufferInheritanceInfo": { + "core": [ + { + "vuid": "VUID-VkCommandBufferInheritanceInfo-occlusionQueryEnable-00056", + "text": " If the &amp;lt;&amp;lt;features-features-inheritedQueries,inherited queries&amp;gt;&amp;gt; feature is not enabled, occlusionQueryEnable must be VK_FALSE" + }, + { + "vuid": "VUID-VkCommandBufferInheritanceInfo-queryFlags-00057", + "text": " If the &amp;lt;&amp;lt;features-features-inheritedQueries,inherited queries&amp;gt;&amp;gt; feature is enabled, queryFlags must be a valid combination of VkQueryControlFlagBits values" + }, + { + "vuid": "VUID-VkCommandBufferInheritanceInfo-pipelineStatistics-00058", + "text": " If the &amp;lt;&amp;lt;features-features-pipelineStatisticsQuery,pipeline statistics queries&amp;gt;&amp;gt; feature is not enabled, pipelineStatistics must be 0" + }, + { + "vuid": "VUID-VkCommandBufferInheritanceInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO" + }, + { + "vuid": "VUID-VkCommandBufferInheritanceInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkCommandBufferInheritanceInfo-commonparent", + "text": " Both of framebuffer, and renderPass that are valid handles must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "vkEndCommandBuffer": { + "core": [ + { + "vuid": "VUID-vkEndCommandBuffer-commandBuffer-00059", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-vkEndCommandBuffer-commandBuffer-00060", + "text": " If commandBuffer is a primary command buffer, there must not be an active render pass instance" + }, + { + "vuid": "VUID-vkEndCommandBuffer-commandBuffer-00061", + "text": " All queries made &amp;lt;&amp;lt;queries-operation-active,active&amp;gt;&amp;gt; during the recording of commandBuffer must have been made inactive" + }, + { + "vuid": "VUID-vkEndCommandBuffer-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + } + ], + "(VK_EXT_debug_utils)": [ + { + "vuid": "VUID-vkEndCommandBuffer-commandBuffer-01815", + "text": " If commandBuffer is a secondary command buffer, there must not be an outstanding vkCmdBeginDebugUtilsLabelEXT command recorded to commandBuffer that has not previously been ended by a call to vkCmdEndDebugUtilsLabelEXT." + } + ], + "(VK_EXT_debug_marker)": [ + { + "vuid": "VUID-vkEndCommandBuffer-commandBuffer-00062", + "text": " If commandBuffer is a secondary command buffer, there must not be an outstanding vkCmdDebugMarkerBeginEXT command recorded to commandBuffer that has not previously been ended by a call to vkCmdDebugMarkerEndEXT." + } + ] + }, + "vkQueueSubmit": { + "core": [ + { + "vuid": "VUID-vkQueueSubmit-fence-00063", + "text": " If fence is not VK_NULL_HANDLE, fence must be unsignaled" + }, + { + "vuid": "VUID-vkQueueSubmit-fence-00064", + "text": " If fence is not VK_NULL_HANDLE, fence must not be associated with any other queue command that has not yet completed execution on that queue" + }, + { + "vuid": "VUID-vkQueueSubmit-pCommandBuffers-00065", + "text": " Any calls to vkCmdSetEvent, vkCmdResetEvent or vkCmdWaitEvents that have been recorded into any of the command buffer elements of the pCommandBuffers member of any element of pSubmits, must not reference any VkEvent that is referenced by any of those commands in a command buffer that has been submitted to another queue and is still in the pending state." + }, + { + "vuid": "VUID-vkQueueSubmit-pWaitDstStageMask-00066", + "text": " Any stage flag included in any element of the pWaitDstStageMask member of any element of pSubmits must be a pipeline stage supported by one of the capabilities of queue, as specified in the &amp;lt;&amp;lt;synchronization-pipeline-stages-supported, table of supported pipeline stages&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-vkQueueSubmit-pSignalSemaphores-00067", + "text": " Each element of the pSignalSemaphores member of any element of pSubmits must be unsignaled when the semaphore signal operation it defines is executed on the device" + }, + { + "vuid": "VUID-vkQueueSubmit-pWaitSemaphores-00068", + "text": " When a semaphore unsignal operation defined by any element of the pWaitSemaphores member of any element of pSubmits executes on queue, no other queue must be waiting on the same semaphore." + }, + { + "vuid": "VUID-vkQueueSubmit-pWaitSemaphores-00069", + "text": " All elements of the pWaitSemaphores member of all elements of pSubmits must be semaphores that are signaled, or have &amp;lt;&amp;lt;synchronization-semaphores-signaling, semaphore signal operations&amp;gt;&amp;gt; previously submitted for execution." + }, + { + "vuid": "VUID-vkQueueSubmit-pCommandBuffers-00070", + "text": " Each element of the pCommandBuffers member of each element of pSubmits must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, pending or executable state&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-vkQueueSubmit-pCommandBuffers-00071", + "text": " If any element of the pCommandBuffers member of any element of pSubmits was not recorded with the VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT, it must not be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, pending state&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-vkQueueSubmit-pCommandBuffers-00072", + "text": " Any &amp;lt;&amp;lt;commandbuffers-secondary, secondary command buffers recorded&amp;gt;&amp;gt; into any element of the pCommandBuffers member of any element of pSubmits must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, pending or executable state&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-vkQueueSubmit-pCommandBuffers-00073", + "text": " If any &amp;lt;&amp;lt;commandbuffers-secondary, secondary command buffers recorded&amp;gt;&amp;gt; into any element of the pCommandBuffers member of any element of pSubmits was not recorded with the VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT, it must not be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, pending state&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-vkQueueSubmit-pCommandBuffers-00074", + "text": " Each element of the pCommandBuffers member of each element of pSubmits must have been allocated from a VkCommandPool that was created for the same queue family queue belongs to." + }, + { + "vuid": "VUID-vkQueueSubmit-queue-parameter", + "text": " queue must be a valid VkQueue handle" + }, + { + "vuid": "VUID-vkQueueSubmit-pSubmits-parameter", + "text": " If submitCount is not 0, pSubmits must be a valid pointer to an array of submitCount valid VkSubmitInfo structures" + }, + { + "vuid": "VUID-vkQueueSubmit-fence-parameter", + "text": " If fence is not VK_NULL_HANDLE, fence must be a valid VkFence handle" + }, + { + "vuid": "VUID-vkQueueSubmit-commonparent", + "text": " Both of fence, and queue that are valid handles must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "VkSubmitInfo": { + "core": [ + { + "vuid": "VUID-VkSubmitInfo-pCommandBuffers-00075", + "text": " Each element of pCommandBuffers must not have been allocated with VK_COMMAND_BUFFER_LEVEL_SECONDARY" + }, + { + "vuid": "VUID-VkSubmitInfo-pWaitDstStageMask-00076", + "text": " If the &amp;lt;&amp;lt;features-features-geometryShader,geometry shaders&amp;gt;&amp;gt; feature is not enabled, each element of pWaitDstStageMask must not contain VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT" + }, + { + "vuid": "VUID-VkSubmitInfo-pWaitDstStageMask-00077", + "text": " If the &amp;lt;&amp;lt;features-features-tessellationShader,tessellation shaders&amp;gt;&amp;gt; feature is not enabled, each element of pWaitDstStageMask must not contain VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT" + }, + { + "vuid": "VUID-VkSubmitInfo-pWaitDstStageMask-00078", + "text": " Each element of pWaitDstStageMask must not include VK_PIPELINE_STAGE_HOST_BIT." + }, + { + "vuid": "VUID-VkSubmitInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SUBMIT_INFO" + }, + { + "vuid": "VUID-VkSubmitInfo-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkD3D12FenceSubmitInfoKHR, VkDeviceGroupSubmitInfo, VkProtectedSubmitInfo, VkWin32KeyedMutexAcquireReleaseInfoKHR, or VkWin32KeyedMutexAcquireReleaseInfoNV" + }, + { + "vuid": "VUID-VkSubmitInfo-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + }, + { + "vuid": "VUID-VkSubmitInfo-pWaitSemaphores-parameter", + "text": " If waitSemaphoreCount is not 0, pWaitSemaphores must be a valid pointer to an array of waitSemaphoreCount valid VkSemaphore handles" + }, + { + "vuid": "VUID-VkSubmitInfo-pWaitDstStageMask-parameter", + "text": " If waitSemaphoreCount is not 0, pWaitDstStageMask must be a valid pointer to an array of waitSemaphoreCount valid combinations of VkPipelineStageFlagBits values" + }, + { + "vuid": "VUID-VkSubmitInfo-pWaitDstStageMask-requiredbitmask", + "text": " Each element of pWaitDstStageMask must not be 0" + }, + { + "vuid": "VUID-VkSubmitInfo-pCommandBuffers-parameter", + "text": " If commandBufferCount is not 0, pCommandBuffers must be a valid pointer to an array of commandBufferCount valid VkCommandBuffer handles" + }, + { + "vuid": "VUID-VkSubmitInfo-pSignalSemaphores-parameter", + "text": " If signalSemaphoreCount is not 0, pSignalSemaphores must be a valid pointer to an array of signalSemaphoreCount valid VkSemaphore handles" + }, + { + "vuid": "VUID-VkSubmitInfo-commonparent", + "text": " Each of the elements of pCommandBuffers, the elements of pSignalSemaphores, and the elements of pWaitSemaphores that are valid handles must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "VkD3D12FenceSubmitInfoKHR": { + "(VK_KHR_external_semaphore_win32)": [ + { + "vuid": "VUID-VkD3D12FenceSubmitInfoKHR-waitSemaphoreValuesCount-00079", + "text": " waitSemaphoreValuesCount must be the same value as VkSubmitInfo::waitSemaphoreCount, where VkSubmitInfo is in the pNext chain of this VkD3D12FenceSubmitInfoKHR structure." + }, + { + "vuid": "VUID-VkD3D12FenceSubmitInfoKHR-signalSemaphoreValuesCount-00080", + "text": " signalSemaphoreValuesCount must be the same value as VkSubmitInfo::signalSemaphoreCount, where VkSubmitInfo is in the pNext chain of this VkD3D12FenceSubmitInfoKHR structure." + }, + { + "vuid": "VUID-VkD3D12FenceSubmitInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR" + }, + { + "vuid": "VUID-VkD3D12FenceSubmitInfoKHR-pWaitSemaphoreValues-parameter", + "text": " If waitSemaphoreValuesCount is not 0, and pWaitSemaphoreValues is not NULL, pWaitSemaphoreValues must be a valid pointer to an array of waitSemaphoreValuesCount uint64_t values" + }, + { + "vuid": "VUID-VkD3D12FenceSubmitInfoKHR-pSignalSemaphoreValues-parameter", + "text": " If signalSemaphoreValuesCount is not 0, and pSignalSemaphoreValues is not NULL, pSignalSemaphoreValues must be a valid pointer to an array of signalSemaphoreValuesCount uint64_t values" + } + ] + }, + "VkWin32KeyedMutexAcquireReleaseInfoKHR": { + "(VK_KHR_win32_keyed_mutex)": [ + { + "vuid": "VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pAcquireSyncs-00081", + "text": " Each member of pAcquireSyncs and pReleaseSyncs must be a device memory object imported by setting VkImportMemoryWin32HandleInfoKHR::handleType to VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT." + }, + { + "vuid": "VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR" + }, + { + "vuid": "VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pAcquireSyncs-parameter", + "text": " If acquireCount is not 0, pAcquireSyncs must be a valid pointer to an array of acquireCount valid VkDeviceMemory handles" + }, + { + "vuid": "VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pAcquireKeys-parameter", + "text": " If acquireCount is not 0, pAcquireKeys must be a valid pointer to an array of acquireCount uint64_t values" + }, + { + "vuid": "VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pAcquireTimeouts-parameter", + "text": " If acquireCount is not 0, pAcquireTimeouts must be a valid pointer to an array of acquireCount uint32_t values" + }, + { + "vuid": "VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pReleaseSyncs-parameter", + "text": " If releaseCount is not 0, pReleaseSyncs must be a valid pointer to an array of releaseCount valid VkDeviceMemory handles" + }, + { + "vuid": "VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pReleaseKeys-parameter", + "text": " If releaseCount is not 0, pReleaseKeys must be a valid pointer to an array of releaseCount uint64_t values" + }, + { + "vuid": "VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-commonparent", + "text": " Both of the elements of pAcquireSyncs, and the elements of pReleaseSyncs that are valid handles must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "VkWin32KeyedMutexAcquireReleaseInfoNV": { + "(VK_NV_win32_keyed_mutex)": [ + { + "vuid": "VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV" + }, + { + "vuid": "VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pAcquireSyncs-parameter", + "text": " If acquireCount is not 0, pAcquireSyncs must be a valid pointer to an array of acquireCount valid VkDeviceMemory handles" + }, + { + "vuid": "VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pAcquireKeys-parameter", + "text": " If acquireCount is not 0, pAcquireKeys must be a valid pointer to an array of acquireCount uint64_t values" + }, + { + "vuid": "VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pAcquireTimeoutMilliseconds-parameter", + "text": " If acquireCount is not 0, pAcquireTimeoutMilliseconds must be a valid pointer to an array of acquireCount uint32_t values" + }, + { + "vuid": "VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pReleaseSyncs-parameter", + "text": " If releaseCount is not 0, pReleaseSyncs must be a valid pointer to an array of releaseCount valid VkDeviceMemory handles" + }, + { + "vuid": "VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-pReleaseKeys-parameter", + "text": " If releaseCount is not 0, pReleaseKeys must be a valid pointer to an array of releaseCount uint64_t values" + }, + { + "vuid": "VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-commonparent", + "text": " Both of the elements of pAcquireSyncs, and the elements of pReleaseSyncs that are valid handles must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "VkProtectedSubmitInfo": { + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-VkProtectedSubmitInfo-protectedSubmit-01816", + "text": " If the protected memory feature is not enabled, protectedSubmit must not be VK_TRUE." + }, + { + "vuid": "VUID-VkProtectedSubmitInfo-protectedSubmit-01817", + "text": " If protectedSubmit is VK_TRUE, then each element of the pCommandBuffers array must be a protected command buffer." + }, + { + "vuid": "VUID-VkProtectedSubmitInfo-protectedSubmit-01818", + "text": " If protectedSubmit is VK_FALSE, then each element of the pCommandBuffers array must be an unprotected command buffer." + }, + { + "vuid": "VUID-VkProtectedSubmitInfo-pNext-01819", + "text": " If the VkSubmitInfo::pNext chain does not include a VkProtectedSubmitInfo structure, then each element of the command buffer of the pCommandBuffers array must be an unprotected command buffer." + }, + { + "vuid": "VUID-VkProtectedSubmitInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO" + } + ] + }, + "VkDeviceGroupSubmitInfo": { + "(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-VkDeviceGroupSubmitInfo-waitSemaphoreCount-00082", + "text": " waitSemaphoreCount must equal VkSubmitInfo::waitSemaphoreCount" + }, + { + "vuid": "VUID-VkDeviceGroupSubmitInfo-commandBufferCount-00083", + "text": " commandBufferCount must equal VkSubmitInfo::commandBufferCount" + }, + { + "vuid": "VUID-VkDeviceGroupSubmitInfo-signalSemaphoreCount-00084", + "text": " signalSemaphoreCount must equal VkSubmitInfo::signalSemaphoreCount" + }, + { + "vuid": "VUID-VkDeviceGroupSubmitInfo-pWaitSemaphoreDeviceIndices-00085", + "text": " All elements of pWaitSemaphoreDeviceIndices and pSignalSemaphoreDeviceIndices must be valid device indices" + }, + { + "vuid": "VUID-VkDeviceGroupSubmitInfo-pCommandBufferDeviceMasks-00086", + "text": " All elements of pCommandBufferDeviceMasks must be valid device masks" + }, + { + "vuid": "VUID-VkDeviceGroupSubmitInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO" + }, + { + "vuid": "VUID-VkDeviceGroupSubmitInfo-pWaitSemaphoreDeviceIndices-parameter", + "text": " If waitSemaphoreCount is not 0, pWaitSemaphoreDeviceIndices must be a valid pointer to an array of waitSemaphoreCount uint32_t values" + }, + { + "vuid": "VUID-VkDeviceGroupSubmitInfo-pCommandBufferDeviceMasks-parameter", + "text": " If commandBufferCount is not 0, pCommandBufferDeviceMasks must be a valid pointer to an array of commandBufferCount uint32_t values" + }, + { + "vuid": "VUID-VkDeviceGroupSubmitInfo-pSignalSemaphoreDeviceIndices-parameter", + "text": " If signalSemaphoreCount is not 0, pSignalSemaphoreDeviceIndices must be a valid pointer to an array of signalSemaphoreCount uint32_t values" + } + ] + }, + "vkCmdExecuteCommands": { + "core": [ + { + "vuid": "VUID-vkCmdExecuteCommands-commandBuffer-00087", + "text": " commandBuffer must have been allocated with a level of VK_COMMAND_BUFFER_LEVEL_PRIMARY" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-pCommandBuffers-00088", + "text": " Each element of pCommandBuffers must have been allocated with a level of VK_COMMAND_BUFFER_LEVEL_SECONDARY" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-pCommandBuffers-00089", + "text": " Each element of pCommandBuffers must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, pending or executable state&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-vkCmdExecuteCommands-pCommandBuffers-00090", + "text": " If any element of pCommandBuffers was not recorded with the VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT flag, and it was recorded into any other primary command buffer, that primary command buffer must not be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, pending state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-pCommandBuffers-00091", + "text": " If any element of pCommandBuffers was not recorded with the VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT flag, it must not be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, pending state&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-vkCmdExecuteCommands-pCommandBuffers-00092", + "text": " If any element of pCommandBuffers was not recorded with the VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT flag, it must not have already been recorded to commandBuffer." + }, + { + "vuid": "VUID-vkCmdExecuteCommands-pCommandBuffers-00093", + "text": " If any element of pCommandBuffers was not recorded with the VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT flag, it must not appear more than once in pCommandBuffers." + }, + { + "vuid": "VUID-vkCmdExecuteCommands-pCommandBuffers-00094", + "text": " Each element of pCommandBuffers must have been allocated from a VkCommandPool that was created for the same queue family as the VkCommandPool from which commandBuffer was allocated" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-contents-00095", + "text": " If vkCmdExecuteCommands is being called within a render pass instance, that render pass instance must have been begun with the contents parameter of vkCmdBeginRenderPass set to VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-pCommandBuffers-00096", + "text": " If vkCmdExecuteCommands is being called within a render pass instance, each element of pCommandBuffers must have been recorded with the VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-pCommandBuffers-00097", + "text": " If vkCmdExecuteCommands is being called within a render pass instance, each element of pCommandBuffers must have been recorded with VkCommandBufferInheritanceInfo::subpass set to the index of the subpass which the given command buffer will be executed in" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-pInheritanceInfo-00098", + "text": " If vkCmdExecuteCommands is being called within a render pass instance, the render passes specified in the pname::pBeginInfo::pInheritanceInfo::renderPass members of the vkBeginCommandBuffer commands used to begin recording each element of pCommandBuffers must be &amp;lt;&amp;lt;renderpass-compatibility,compatible&amp;gt;&amp;gt; with the current render pass." + }, + { + "vuid": "VUID-vkCmdExecuteCommands-pCommandBuffers-00099", + "text": " If vkCmdExecuteCommands is being called within a render pass instance, and any element of pCommandBuffers was recorded with VkCommandBufferInheritanceInfo::framebuffer not equal to VK_NULL_HANDLE, that VkFramebuffer must match the VkFramebuffer used in the current render pass instance" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-pCommandBuffers-00100", + "text": " If vkCmdExecuteCommands is not being called within a render pass instance, each element of pCommandBuffers must not have been recorded with the VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-commandBuffer-00101", + "text": " If the &amp;lt;&amp;lt;features-features-inheritedQueries,inherited queries&amp;gt;&amp;gt; feature is not enabled, commandBuffer must not have any queries &amp;lt;&amp;lt;queries-operation-active,active&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-commandBuffer-00102", + "text": " If commandBuffer has a VK_QUERY_TYPE_OCCLUSION query &amp;lt;&amp;lt;queries-operation-active,active&amp;gt;&amp;gt;, then each element of pCommandBuffers must have been recorded with VkCommandBufferInheritanceInfo::occlusionQueryEnable set to VK_TRUE" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-commandBuffer-00103", + "text": " If commandBuffer has a VK_QUERY_TYPE_OCCLUSION query &amp;lt;&amp;lt;queries-operation-active,active&amp;gt;&amp;gt;, then each element of pCommandBuffers must have been recorded with VkCommandBufferInheritanceInfo::queryFlags having all bits set that are set for the query" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-commandBuffer-00104", + "text": " If commandBuffer has a VK_QUERY_TYPE_PIPELINE_STATISTICS query &amp;lt;&amp;lt;queries-operation-active,active&amp;gt;&amp;gt;, then each element of pCommandBuffers must have been recorded with VkCommandBufferInheritanceInfo::pipelineStatistics having all bits set that are set in the VkQueryPool the query uses" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-pCommandBuffers-00105", + "text": " Each element of pCommandBuffers must not begin any query types that are &amp;lt;&amp;lt;queries-operation-active,active&amp;gt;&amp;gt; in commandBuffer" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-pCommandBuffers-parameter", + "text": " pCommandBuffers must be a valid pointer to an array of commandBufferCount valid VkCommandBuffer handles" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-bufferlevel", + "text": " commandBuffer must be a primary VkCommandBuffer" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-commandBufferCount-arraylength", + "text": " commandBufferCount must be greater than 0" + }, + { + "vuid": "VUID-vkCmdExecuteCommands-commonparent", + "text": " Both of commandBuffer, and the elements of pCommandBuffers must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdExecuteCommands-commandBuffer-01820", + "text": " If commandBuffer is a protected command buffer, then each element of pCommandBuffers must be a protected command buffer." + }, + { + "vuid": "VUID-vkCmdExecuteCommands-commandBuffer-01821", + "text": " If commandBuffer is an unprotected command buffer, then each element of pCommandBuffers must be an unprotected command buffer." + } + ] + }, + "VkDeviceGroupCommandBufferBeginInfo": { + "(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-VkDeviceGroupCommandBufferBeginInfo-deviceMask-00106", + "text": " deviceMask must be a valid device mask value" + }, + { + "vuid": "VUID-VkDeviceGroupCommandBufferBeginInfo-deviceMask-00107", + "text": " deviceMask must not be zero" + }, + { + "vuid": "VUID-VkDeviceGroupCommandBufferBeginInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO" + } + ] + }, + "vkCmdSetDeviceMask": { + "(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-vkCmdSetDeviceMask-deviceMask-00108", + "text": " deviceMask must be a valid device mask value" + }, + { + "vuid": "VUID-vkCmdSetDeviceMask-deviceMask-00109", + "text": " deviceMask must not be zero" + }, + { + "vuid": "VUID-vkCmdSetDeviceMask-deviceMask-00110", + "text": " deviceMask must not include any set bits that were not in the VkDeviceGroupCommandBufferBeginInfo::deviceMask value when the command buffer began recording." + }, + { + "vuid": "VUID-vkCmdSetDeviceMask-deviceMask-00111", + "text": " If vkCmdSetDeviceMask is called inside a render pass instance, deviceMask must not include any set bits that were not in the VkDeviceGroupRenderPassBeginInfo::deviceMask value when the render pass instance began recording." + }, + { + "vuid": "VUID-vkCmdSetDeviceMask-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdSetDeviceMask-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdSetDeviceMask-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, compute, or transfer operations" + } + ] + }, + "vkCreateFence": { + "core": [ + { + "vuid": "VUID-vkCreateFence-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateFence-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkFenceCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateFence-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateFence-pFence-parameter", + "text": " pFence must be a valid pointer to a VkFence handle" + } + ] + }, + "VkFenceCreateInfo": { + "core": [ + { + "vuid": "VUID-VkFenceCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO" + }, + { + "vuid": "VUID-VkFenceCreateInfo-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkExportFenceCreateInfo or VkExportFenceWin32HandleInfoKHR" + }, + { + "vuid": "VUID-VkFenceCreateInfo-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + }, + { + "vuid": "VUID-VkFenceCreateInfo-flags-parameter", + "text": " flags must be a valid combination of VkFenceCreateFlagBits values" + } + ] + }, + "VkExportFenceCreateInfo": { + "(VK_VERSION_1_1,VK_KHR_external_fence)": [ + { + "vuid": "VUID-VkExportFenceCreateInfo-handleTypes-01446", + "text": " The bits in handleTypes must be supported and compatible, as reported by VkExternalFenceProperties." + }, + { + "vuid": "VUID-VkExportFenceCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO" + }, + { + "vuid": "VUID-VkExportFenceCreateInfo-handleTypes-parameter", + "text": " handleTypes must be a valid combination of VkExternalFenceHandleTypeFlagBits values" + } + ] + }, + "VkExportFenceWin32HandleInfoKHR": { + "(VK_KHR_external_fence_win32)": [ + { + "vuid": "VUID-VkExportFenceWin32HandleInfoKHR-handleTypes-01447", + "text": " If VkExportFenceCreateInfo::handleTypes does not include VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT, VkExportFenceWin32HandleInfoKHR must not be in the pNext chain of VkFenceCreateInfo." + }, + { + "vuid": "VUID-VkExportFenceWin32HandleInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR" + }, + { + "vuid": "VUID-VkExportFenceWin32HandleInfoKHR-pAttributes-parameter", + "text": " If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value" + } + ] + }, + "vkGetFenceWin32HandleKHR": { + "(VK_KHR_external_fence_win32)": [ + { + "vuid": "VUID-vkGetFenceWin32HandleKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetFenceWin32HandleKHR-pGetWin32HandleInfo-parameter", + "text": " pGetWin32HandleInfo must be a valid pointer to a valid VkFenceGetWin32HandleInfoKHR structure" + }, + { + "vuid": "VUID-vkGetFenceWin32HandleKHR-pHandle-parameter", + "text": " pHandle must be a valid pointer to a HANDLE value" + } + ] + }, + "VkFenceGetWin32HandleInfoKHR": { + "(VK_KHR_external_fence_win32)": [ + { + "vuid": "VUID-VkFenceGetWin32HandleInfoKHR-handleType-01448", + "text": " handleType must have been included in VkExportFenceCreateInfo::handleTypes when the fence’s current payload was created." + }, + { + "vuid": "VUID-VkFenceGetWin32HandleInfoKHR-handleType-01449", + "text": " If handleType is defined as an NT handle, vkGetFenceWin32HandleKHR must be called no more than once for each valid unique combination of fence and handleType." + }, + { + "vuid": "VUID-VkFenceGetWin32HandleInfoKHR-fence-01450", + "text": " fence must not currently have its payload replaced by an imported payload as described below in &amp;lt;&amp;lt;synchronization-fences-importing,Importing Fence Payloads&amp;gt;&amp;gt; unless that imported payload’s handle type was included in VkExternalFenceProperties::exportFromImportedHandleTypes for handleType." + }, + { + "vuid": "VUID-VkFenceGetWin32HandleInfoKHR-handleType-01451", + "text": " If handleType refers to a handle type with copy payload transference semantics, fence must be signaled, or have an associated &amp;lt;&amp;lt;synchronization-fences-signaling,fence signal operation&amp;gt;&amp;gt; pending execution." + }, + { + "vuid": "VUID-VkFenceGetWin32HandleInfoKHR-handleType-01452", + "text": " handleType must be defined as an NT handle or a global share handle." + }, + { + "vuid": "VUID-VkFenceGetWin32HandleInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR" + }, + { + "vuid": "VUID-VkFenceGetWin32HandleInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkFenceGetWin32HandleInfoKHR-fence-parameter", + "text": " fence must be a valid VkFence handle" + }, + { + "vuid": "VUID-VkFenceGetWin32HandleInfoKHR-handleType-parameter", + "text": " handleType must be a valid VkExternalFenceHandleTypeFlagBits value" + } + ] + }, + "vkGetFenceFdKHR": { + "(VK_KHR_external_fence_fd)": [ + { + "vuid": "VUID-vkGetFenceFdKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetFenceFdKHR-pGetFdInfo-parameter", + "text": " pGetFdInfo must be a valid pointer to a valid VkFenceGetFdInfoKHR structure" + }, + { + "vuid": "VUID-vkGetFenceFdKHR-pFd-parameter", + "text": " pFd must be a valid pointer to a int value" + } + ] + }, + "VkFenceGetFdInfoKHR": { + "(VK_KHR_external_fence_fd)": [ + { + "vuid": "VUID-VkFenceGetFdInfoKHR-handleType-01453", + "text": " handleType must have been included in VkExportFenceCreateInfo::handleTypes when fence’s current payload was created." + }, + { + "vuid": "VUID-VkFenceGetFdInfoKHR-handleType-01454", + "text": " If handleType refers to a handle type with copy payload transference semantics, fence must be signaled, or have an associated &amp;lt;&amp;lt;synchronization-fences-signaling,fence signal operation&amp;gt;&amp;gt; pending execution." + }, + { + "vuid": "VUID-VkFenceGetFdInfoKHR-fence-01455", + "text": " fence must not currently have its payload replaced by an imported payload as described below in &amp;lt;&amp;lt;synchronization-fences-importing,Importing Fence Payloads&amp;gt;&amp;gt; unless that imported payload’s handle type was included in VkExternalFenceProperties::exportFromImportedHandleTypes for handleType." + }, + { + "vuid": "VUID-VkFenceGetFdInfoKHR-handleType-01456", + "text": " handleType must be defined as a POSIX file descriptor handle." + }, + { + "vuid": "VUID-VkFenceGetFdInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR" + }, + { + "vuid": "VUID-VkFenceGetFdInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkFenceGetFdInfoKHR-fence-parameter", + "text": " fence must be a valid VkFence handle" + }, + { + "vuid": "VUID-VkFenceGetFdInfoKHR-handleType-parameter", + "text": " handleType must be a valid VkExternalFenceHandleTypeFlagBits value" + } + ] + }, + "vkDestroyFence": { + "core": [ + { + "vuid": "VUID-vkDestroyFence-fence-01120", + "text": " All &amp;lt;&amp;lt;devsandqueues-submission, queue submission&amp;gt;&amp;gt; commands that refer to fence must have completed execution" + }, + { + "vuid": "VUID-vkDestroyFence-fence-01121", + "text": " If VkAllocationCallbacks were provided when fence was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyFence-fence-01122", + "text": " If no VkAllocationCallbacks were provided when fence was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyFence-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyFence-fence-parameter", + "text": " If fence is not VK_NULL_HANDLE, fence must be a valid VkFence handle" + }, + { + "vuid": "VUID-vkDestroyFence-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyFence-fence-parent", + "text": " If fence is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkGetFenceStatus": { + "core": [ + { + "vuid": "VUID-vkGetFenceStatus-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetFenceStatus-fence-parameter", + "text": " fence must be a valid VkFence handle" + }, + { + "vuid": "VUID-vkGetFenceStatus-fence-parent", + "text": " fence must have been created, allocated, or retrieved from device" + } + ] + }, + "vkResetFences": { + "core": [ + { + "vuid": "VUID-vkResetFences-pFences-01123", + "text": " Each element of pFences must not be currently associated with any queue command that has not yet completed execution on that queue" + }, + { + "vuid": "VUID-vkResetFences-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkResetFences-pFences-parameter", + "text": " pFences must be a valid pointer to an array of fenceCount valid VkFence handles" + }, + { + "vuid": "VUID-vkResetFences-fenceCount-arraylength", + "text": " fenceCount must be greater than 0" + }, + { + "vuid": "VUID-vkResetFences-pFences-parent", + "text": " Each element of pFences must have been created, allocated, or retrieved from device" + } + ] + }, + "vkWaitForFences": { + "core": [ + { + "vuid": "VUID-vkWaitForFences-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkWaitForFences-pFences-parameter", + "text": " pFences must be a valid pointer to an array of fenceCount valid VkFence handles" + }, + { + "vuid": "VUID-vkWaitForFences-fenceCount-arraylength", + "text": " fenceCount must be greater than 0" + }, + { + "vuid": "VUID-vkWaitForFences-pFences-parent", + "text": " Each element of pFences must have been created, allocated, or retrieved from device" + } + ] + }, + "vkRegisterDeviceEventEXT": { + "(VK_EXT_display_control)": [ + { + "vuid": "VUID-vkRegisterDeviceEventEXT-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkRegisterDeviceEventEXT-pDeviceEventInfo-parameter", + "text": " pDeviceEventInfo must be a valid pointer to a valid VkDeviceEventInfoEXT structure" + }, + { + "vuid": "VUID-vkRegisterDeviceEventEXT-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkRegisterDeviceEventEXT-pFence-parameter", + "text": " pFence must be a valid pointer to a VkFence handle" + } + ] + }, + "VkDeviceEventInfoEXT": { + "(VK_EXT_display_control)": [ + { + "vuid": "VUID-VkDeviceEventInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT" + }, + { + "vuid": "VUID-VkDeviceEventInfoEXT-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkDeviceEventInfoEXT-deviceEvent-parameter", + "text": " deviceEvent must be a valid VkDeviceEventTypeEXT value" + } + ] + }, + "vkRegisterDisplayEventEXT": { + "(VK_EXT_display_control)": [ + { + "vuid": "VUID-vkRegisterDisplayEventEXT-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkRegisterDisplayEventEXT-display-parameter", + "text": " display must be a valid VkDisplayKHR handle" + }, + { + "vuid": "VUID-vkRegisterDisplayEventEXT-pDisplayEventInfo-parameter", + "text": " pDisplayEventInfo must be a valid pointer to a valid VkDisplayEventInfoEXT structure" + }, + { + "vuid": "VUID-vkRegisterDisplayEventEXT-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkRegisterDisplayEventEXT-pFence-parameter", + "text": " pFence must be a valid pointer to a VkFence handle" + } + ] + }, + "VkDisplayEventInfoEXT": { + "(VK_EXT_display_control)": [ + { + "vuid": "VUID-VkDisplayEventInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT" + }, + { + "vuid": "VUID-VkDisplayEventInfoEXT-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkDisplayEventInfoEXT-displayEvent-parameter", + "text": " displayEvent must be a valid VkDisplayEventTypeEXT value" + } + ] + }, + "vkImportFenceWin32HandleKHR": { + "(VK_KHR_external_fence_win32)": [ + { + "vuid": "VUID-vkImportFenceWin32HandleKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkImportFenceWin32HandleKHR-pImportFenceWin32HandleInfo-parameter", + "text": " pImportFenceWin32HandleInfo must be a valid pointer to a valid VkImportFenceWin32HandleInfoKHR structure" + } + ] + }, + "VkImportFenceWin32HandleInfoKHR": { + "(VK_KHR_external_fence_win32)": [ + { + "vuid": "VUID-VkImportFenceWin32HandleInfoKHR-handleType-01457", + "text": " handleType must be a value included in the &amp;lt;&amp;lt;synchronization-fence-handletypes-win32, Handle Types Supported by VkImportFenceWin32HandleInfoKHR&amp;gt;&amp;gt; table." + }, + { + "vuid": "VUID-VkImportFenceWin32HandleInfoKHR-handleType-01459", + "text": " If handleType is not VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT, name must be NULL." + }, + { + "vuid": "VUID-VkImportFenceWin32HandleInfoKHR-handleType-01460", + "text": " If handleType is not 0 and handle is NULL, name must name a valid synchronization primitive of the type specified by handleType." + }, + { + "vuid": "VUID-VkImportFenceWin32HandleInfoKHR-handleType-01461", + "text": " If handleType is not 0 and name is NULL, handle must be a valid handle of the type specified by handleType." + }, + { + "vuid": "VUID-VkImportFenceWin32HandleInfoKHR-handle-01462", + "text": " If handle is not NULL, name must be NULL." + }, + { + "vuid": "VUID-VkImportFenceWin32HandleInfoKHR-handle-01539", + "text": " If handle is not NULL, it must obey any requirements listed for handleType in external fence handle types compatibility." + }, + { + "vuid": "VUID-VkImportFenceWin32HandleInfoKHR-name-01540", + "text": " If name is not NULL, it must obey any requirements listed for handleType in external fence handle types compatibility." + }, + { + "vuid": "VUID-VkImportFenceWin32HandleInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR" + }, + { + "vuid": "VUID-VkImportFenceWin32HandleInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkImportFenceWin32HandleInfoKHR-fence-parameter", + "text": " fence must be a valid VkFence handle" + }, + { + "vuid": "VUID-VkImportFenceWin32HandleInfoKHR-flags-parameter", + "text": " flags must be a valid combination of VkFenceImportFlagBits values" + }, + { + "vuid": "VUID-VkImportFenceWin32HandleInfoKHR-handleType-parameter", + "text": " If handleType is not 0, handleType must be a valid VkExternalFenceHandleTypeFlagBits value" + } + ] + }, + "vkImportFenceFdKHR": { + "(VK_KHR_external_fence_fd)": [ + { + "vuid": "VUID-vkImportFenceFdKHR-fence-01463", + "text": " fence must not be associated with any queue command that has not yet completed execution on that queue" + }, + { + "vuid": "VUID-vkImportFenceFdKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkImportFenceFdKHR-pImportFenceFdInfo-parameter", + "text": " pImportFenceFdInfo must be a valid pointer to a valid VkImportFenceFdInfoKHR structure" + } + ] + }, + "VkImportFenceFdInfoKHR": { + "(VK_KHR_external_fence_fd)": [ + { + "vuid": "VUID-VkImportFenceFdInfoKHR-handleType-01464", + "text": " handleType must be a value included in the &amp;lt;&amp;lt;synchronization-fence-handletypes-fd, Handle Types Supported by VkImportFenceFdInfoKHR&amp;gt;&amp;gt; table." + }, + { + "vuid": "VUID-VkImportFenceFdInfoKHR-fd-01541", + "text": " fd must obey any requirements listed for handleType in &amp;lt;&amp;lt;external-fence-handle-types-compatibility,external fence handle types compatibility&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-VkImportFenceFdInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR" + }, + { + "vuid": "VUID-VkImportFenceFdInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkImportFenceFdInfoKHR-fence-parameter", + "text": " fence must be a valid VkFence handle" + }, + { + "vuid": "VUID-VkImportFenceFdInfoKHR-flags-parameter", + "text": " flags must be a valid combination of VkFenceImportFlagBits values" + }, + { + "vuid": "VUID-VkImportFenceFdInfoKHR-handleType-parameter", + "text": " handleType must be a valid VkExternalFenceHandleTypeFlagBits value" + } + ] + }, + "vkCreateSemaphore": { + "core": [ + { + "vuid": "VUID-vkCreateSemaphore-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateSemaphore-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkSemaphoreCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateSemaphore-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateSemaphore-pSemaphore-parameter", + "text": " pSemaphore must be a valid pointer to a VkSemaphore handle" + } + ] + }, + "VkSemaphoreCreateInfo": { + "core": [ + { + "vuid": "VUID-VkSemaphoreCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO" + }, + { + "vuid": "VUID-VkSemaphoreCreateInfo-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkExportSemaphoreCreateInfo or VkExportSemaphoreWin32HandleInfoKHR" + }, + { + "vuid": "VUID-VkSemaphoreCreateInfo-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + }, + { + "vuid": "VUID-VkSemaphoreCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + } + ] + }, + "VkExportSemaphoreCreateInfo": { + "(VK_VERSION_1_1,VK_KHR_external_semaphore)": [ + { + "vuid": "VUID-VkExportSemaphoreCreateInfo-handleTypes-01124", + "text": " The bits in handleTypes must be supported and compatible, as reported by VkExternalSemaphoreProperties." + }, + { + "vuid": "VUID-VkExportSemaphoreCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO" + }, + { + "vuid": "VUID-VkExportSemaphoreCreateInfo-handleTypes-parameter", + "text": " handleTypes must be a valid combination of VkExternalSemaphoreHandleTypeFlagBits values" + } + ] + }, + "VkExportSemaphoreWin32HandleInfoKHR": { + "(VK_KHR_external_semaphore_win32)": [ + { + "vuid": "VUID-VkExportSemaphoreWin32HandleInfoKHR-handleTypes-01125", + "text": " If VkExportSemaphoreCreateInfo::handleTypes does not include VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT or VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT, VkExportSemaphoreWin32HandleInfoKHR must not be in the pNext chain of VkSemaphoreCreateInfo." + }, + { + "vuid": "VUID-VkExportSemaphoreWin32HandleInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR" + }, + { + "vuid": "VUID-VkExportSemaphoreWin32HandleInfoKHR-pAttributes-parameter", + "text": " If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value" + } + ] + }, + "vkGetSemaphoreWin32HandleKHR": { + "(VK_KHR_external_semaphore_win32)": [ + { + "vuid": "VUID-vkGetSemaphoreWin32HandleKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetSemaphoreWin32HandleKHR-pGetWin32HandleInfo-parameter", + "text": " pGetWin32HandleInfo must be a valid pointer to a valid VkSemaphoreGetWin32HandleInfoKHR structure" + }, + { + "vuid": "VUID-vkGetSemaphoreWin32HandleKHR-pHandle-parameter", + "text": " pHandle must be a valid pointer to a HANDLE value" + } + ] + }, + "VkSemaphoreGetWin32HandleInfoKHR": { + "(VK_KHR_external_semaphore_win32)": [ + { + "vuid": "VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01126", + "text": " handleType must have been included in VkExportSemaphoreCreateInfo::handleTypes when the semaphore’s current payload was created." + }, + { + "vuid": "VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01127", + "text": " If handleType is defined as an NT handle, vkGetSemaphoreWin32HandleKHR must be called no more than once for each valid unique combination of semaphore and handleType." + }, + { + "vuid": "VUID-VkSemaphoreGetWin32HandleInfoKHR-semaphore-01128", + "text": " semaphore must not currently have its payload replaced by an imported payload as described below in &amp;lt;&amp;lt;synchronization-semaphores-importing,Importing Semaphore Payloads&amp;gt;&amp;gt; unless that imported payload’s handle type was included in VkExternalSemaphoreProperties::exportFromImportedHandleTypes for handleType." + }, + { + "vuid": "VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01129", + "text": " If handleType refers to a handle type with copy payload transference semantics, as defined below in &amp;lt;&amp;lt;synchronization-semaphores-importing,Importing Semaphore Payloads&amp;gt;&amp;gt;, there must be no queue waiting on semaphore." + }, + { + "vuid": "VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01130", + "text": " If handleType refers to a handle type with copy payload transference semantics, semaphore must be signaled, or have an associated &amp;lt;&amp;lt;synchronization-semaphores-signaling,semaphore signal operation&amp;gt;&amp;gt; pending execution." + }, + { + "vuid": "VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01131", + "text": " handleType must be defined as an NT handle or a global share handle." + }, + { + "vuid": "VUID-VkSemaphoreGetWin32HandleInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR" + }, + { + "vuid": "VUID-VkSemaphoreGetWin32HandleInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkSemaphoreGetWin32HandleInfoKHR-semaphore-parameter", + "text": " semaphore must be a valid VkSemaphore handle" + }, + { + "vuid": "VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-parameter", + "text": " handleType must be a valid VkExternalSemaphoreHandleTypeFlagBits value" + } + ] + }, + "vkGetSemaphoreFdKHR": { + "(VK_KHR_external_semaphore_fd)": [ + { + "vuid": "VUID-vkGetSemaphoreFdKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetSemaphoreFdKHR-pGetFdInfo-parameter", + "text": " pGetFdInfo must be a valid pointer to a valid VkSemaphoreGetFdInfoKHR structure" + }, + { + "vuid": "VUID-vkGetSemaphoreFdKHR-pFd-parameter", + "text": " pFd must be a valid pointer to a int value" + } + ] + }, + "VkSemaphoreGetFdInfoKHR": { + "(VK_KHR_external_semaphore_fd)": [ + { + "vuid": "VUID-VkSemaphoreGetFdInfoKHR-handleType-01132", + "text": " handleType must have been included in VkExportSemaphoreCreateInfo::handleTypes when semaphore’s current payload was created." + }, + { + "vuid": "VUID-VkSemaphoreGetFdInfoKHR-semaphore-01133", + "text": " semaphore must not currently have its payload replaced by an imported payload as described below in &amp;lt;&amp;lt;synchronization-semaphores-importing,Importing Semaphore Payloads&amp;gt;&amp;gt; unless that imported payload’s handle type was included in VkExternalSemaphoreProperties::exportFromImportedHandleTypes for handleType." + }, + { + "vuid": "VUID-VkSemaphoreGetFdInfoKHR-handleType-01134", + "text": " If handleType refers to a handle type with copy payload transference semantics, as defined below in &amp;lt;&amp;lt;synchronization-semaphores-importing,Importing Semaphore Payloads&amp;gt;&amp;gt;, there must be no queue waiting on semaphore." + }, + { + "vuid": "VUID-VkSemaphoreGetFdInfoKHR-handleType-01135", + "text": " If handleType refers to a handle type with copy payload transference semantics, semaphore must be signaled, or have an associated &amp;lt;&amp;lt;synchronization-semaphores-signaling,semaphore signal operation&amp;gt;&amp;gt; pending execution." + }, + { + "vuid": "VUID-VkSemaphoreGetFdInfoKHR-handleType-01136", + "text": " handleType must be defined as a POSIX file descriptor handle." + }, + { + "vuid": "VUID-VkSemaphoreGetFdInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR" + }, + { + "vuid": "VUID-VkSemaphoreGetFdInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkSemaphoreGetFdInfoKHR-semaphore-parameter", + "text": " semaphore must be a valid VkSemaphore handle" + }, + { + "vuid": "VUID-VkSemaphoreGetFdInfoKHR-handleType-parameter", + "text": " handleType must be a valid VkExternalSemaphoreHandleTypeFlagBits value" + } + ] + }, + "vkDestroySemaphore": { + "core": [ + { + "vuid": "VUID-vkDestroySemaphore-semaphore-01137", + "text": " All submitted batches that refer to semaphore must have completed execution" + }, + { + "vuid": "VUID-vkDestroySemaphore-semaphore-01138", + "text": " If VkAllocationCallbacks were provided when semaphore was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroySemaphore-semaphore-01139", + "text": " If no VkAllocationCallbacks were provided when semaphore was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroySemaphore-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroySemaphore-semaphore-parameter", + "text": " If semaphore is not VK_NULL_HANDLE, semaphore must be a valid VkSemaphore handle" + }, + { + "vuid": "VUID-vkDestroySemaphore-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroySemaphore-semaphore-parent", + "text": " If semaphore is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkImportSemaphoreWin32HandleKHR": { + "(VK_KHR_external_semaphore_win32)": [ + { + "vuid": "VUID-vkImportSemaphoreWin32HandleKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkImportSemaphoreWin32HandleKHR-pImportSemaphoreWin32HandleInfo-parameter", + "text": " pImportSemaphoreWin32HandleInfo must be a valid pointer to a valid VkImportSemaphoreWin32HandleInfoKHR structure" + } + ] + }, + "VkImportSemaphoreWin32HandleInfoKHR": { + "(VK_KHR_external_semaphore_win32)": [ + { + "vuid": "VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-01140", + "text": " handleType must be a value included in the &amp;lt;&amp;lt;synchronization-semaphore-handletypes-win32,Handle Types Supported by VkImportSemaphoreWin32HandleInfoKHR&amp;gt;&amp;gt; table." + }, + { + "vuid": "VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-01466", + "text": " If handleType is not VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT or VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT, name must be NULL." + }, + { + "vuid": "VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-01467", + "text": " If handleType is not 0 and handle is NULL, name must name a valid synchronization primitive of the type specified by handleType." + }, + { + "vuid": "VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-01468", + "text": " If handleType is not 0 and name is NULL, handle must be a valid handle of the type specified by handleType." + }, + { + "vuid": "VUID-VkImportSemaphoreWin32HandleInfoKHR-handle-01469", + "text": " If handle is not NULL, name must be NULL." + }, + { + "vuid": "VUID-VkImportSemaphoreWin32HandleInfoKHR-handle-01542", + "text": " If handle is not NULL, it must obey any requirements listed for handleType in external semaphore handle types compatibility." + }, + { + "vuid": "VUID-VkImportSemaphoreWin32HandleInfoKHR-name-01543", + "text": " If name is not NULL, it must obey any requirements listed for handleType in external semaphore handle types compatibility." + }, + { + "vuid": "VUID-VkImportSemaphoreWin32HandleInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR" + }, + { + "vuid": "VUID-VkImportSemaphoreWin32HandleInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkImportSemaphoreWin32HandleInfoKHR-semaphore-parameter", + "text": " semaphore must be a valid VkSemaphore handle" + }, + { + "vuid": "VUID-VkImportSemaphoreWin32HandleInfoKHR-flags-parameter", + "text": " flags must be a valid combination of VkSemaphoreImportFlagBits values" + }, + { + "vuid": "VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-parameter", + "text": " If handleType is not 0, handleType must be a valid VkExternalSemaphoreHandleTypeFlagBits value" + } + ] + }, + "vkImportSemaphoreFdKHR": { + "(VK_KHR_external_semaphore_fd)": [ + { + "vuid": "VUID-vkImportSemaphoreFdKHR-semaphore-01142", + "text": " semaphore must not be associated with any queue command that has not yet completed execution on that queue" + }, + { + "vuid": "VUID-vkImportSemaphoreFdKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkImportSemaphoreFdKHR-pImportSemaphoreFdInfo-parameter", + "text": " pImportSemaphoreFdInfo must be a valid pointer to a valid VkImportSemaphoreFdInfoKHR structure" + } + ] + }, + "VkImportSemaphoreFdInfoKHR": { + "(VK_KHR_external_semaphore_fd)": [ + { + "vuid": "VUID-VkImportSemaphoreFdInfoKHR-handleType-01143", + "text": " handleType must be a value included in the &amp;lt;&amp;lt;synchronization-semaphore-handletypes-fd,Handle Types Supported by VkImportSemaphoreFdInfoKHR&amp;gt;&amp;gt; table." + }, + { + "vuid": "VUID-VkImportSemaphoreFdInfoKHR-fd-01544", + "text": " fd must obey any requirements listed for handleType in &amp;lt;&amp;lt;external-semaphore-handle-types-compatibility,external semaphore handle types compatibility&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-VkImportSemaphoreFdInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR" + }, + { + "vuid": "VUID-VkImportSemaphoreFdInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkImportSemaphoreFdInfoKHR-semaphore-parameter", + "text": " semaphore must be a valid VkSemaphore handle" + }, + { + "vuid": "VUID-VkImportSemaphoreFdInfoKHR-flags-parameter", + "text": " flags must be a valid combination of VkSemaphoreImportFlagBits values" + }, + { + "vuid": "VUID-VkImportSemaphoreFdInfoKHR-handleType-parameter", + "text": " handleType must be a valid VkExternalSemaphoreHandleTypeFlagBits value" + } + ] + }, + "vkCreateEvent": { + "core": [ + { + "vuid": "VUID-vkCreateEvent-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateEvent-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkEventCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateEvent-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateEvent-pEvent-parameter", + "text": " pEvent must be a valid pointer to a VkEvent handle" + } + ] + }, + "VkEventCreateInfo": { + "core": [ + { + "vuid": "VUID-VkEventCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO" + }, + { + "vuid": "VUID-VkEventCreateInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkEventCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + } + ] + }, + "vkDestroyEvent": { + "core": [ + { + "vuid": "VUID-vkDestroyEvent-event-01145", + "text": " All submitted commands that refer to event must have completed execution" + }, + { + "vuid": "VUID-vkDestroyEvent-event-01146", + "text": " If VkAllocationCallbacks were provided when event was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyEvent-event-01147", + "text": " If no VkAllocationCallbacks were provided when event was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyEvent-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyEvent-event-parameter", + "text": " If event is not VK_NULL_HANDLE, event must be a valid VkEvent handle" + }, + { + "vuid": "VUID-vkDestroyEvent-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyEvent-event-parent", + "text": " If event is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkGetEventStatus": { + "core": [ + { + "vuid": "VUID-vkGetEventStatus-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetEventStatus-event-parameter", + "text": " event must be a valid VkEvent handle" + }, + { + "vuid": "VUID-vkGetEventStatus-event-parent", + "text": " event must have been created, allocated, or retrieved from device" + } + ] + }, + "vkSetEvent": { + "core": [ + { + "vuid": "VUID-vkSetEvent-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkSetEvent-event-parameter", + "text": " event must be a valid VkEvent handle" + }, + { + "vuid": "VUID-vkSetEvent-event-parent", + "text": " event must have been created, allocated, or retrieved from device" + } + ] + }, + "vkResetEvent": { + "core": [ + { + "vuid": "VUID-vkResetEvent-event-01148", + "text": " event must not be waited on by a vkCmdWaitEvents command that is currently executing" + }, + { + "vuid": "VUID-vkResetEvent-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkResetEvent-event-parameter", + "text": " event must be a valid VkEvent handle" + }, + { + "vuid": "VUID-vkResetEvent-event-parent", + "text": " event must have been created, allocated, or retrieved from device" + } + ] + }, + "vkCmdSetEvent": { + "core": [ + { + "vuid": "VUID-vkCmdSetEvent-stageMask-01149", + "text": " stageMask must not include VK_PIPELINE_STAGE_HOST_BIT" + }, + { + "vuid": "VUID-vkCmdSetEvent-stageMask-01150", + "text": " If the &amp;lt;&amp;lt;features-features-geometryShader,geometry shaders&amp;gt;&amp;gt; feature is not enabled, stageMask must not contain VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT" + }, + { + "vuid": "VUID-vkCmdSetEvent-stageMask-01151", + "text": " If the &amp;lt;&amp;lt;features-features-tessellationShader,tessellation shaders&amp;gt;&amp;gt; feature is not enabled, stageMask must not contain VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT" + }, + { + "vuid": "VUID-vkCmdSetEvent-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdSetEvent-event-parameter", + "text": " event must be a valid VkEvent handle" + }, + { + "vuid": "VUID-vkCmdSetEvent-stageMask-parameter", + "text": " stageMask must be a valid combination of VkPipelineStageFlagBits values" + }, + { + "vuid": "VUID-vkCmdSetEvent-stageMask-requiredbitmask", + "text": " stageMask must not be 0" + }, + { + "vuid": "VUID-vkCmdSetEvent-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdSetEvent-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdSetEvent-renderpass", + "text": " This command must only be called outside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdSetEvent-commonparent", + "text": " Both of commandBuffer, and event must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-vkCmdSetEvent-commandBuffer-01152", + "text": " commandBuffer’s current device mask must include exactly one physical device." + } + ] + }, + "vkCmdResetEvent": { + "core": [ + { + "vuid": "VUID-vkCmdResetEvent-stageMask-01153", + "text": " stageMask must not include VK_PIPELINE_STAGE_HOST_BIT" + }, + { + "vuid": "VUID-vkCmdResetEvent-stageMask-01154", + "text": " If the &amp;lt;&amp;lt;features-features-geometryShader,geometry shaders&amp;gt;&amp;gt; feature is not enabled, stageMask must not contain VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT" + }, + { + "vuid": "VUID-vkCmdResetEvent-stageMask-01155", + "text": " If the &amp;lt;&amp;lt;features-features-tessellationShader,tessellation shaders&amp;gt;&amp;gt; feature is not enabled, stageMask must not contain VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT" + }, + { + "vuid": "VUID-vkCmdResetEvent-event-01156", + "text": " When this command executes, event must not be waited on by a vkCmdWaitEvents command that is currently executing" + }, + { + "vuid": "VUID-vkCmdResetEvent-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdResetEvent-event-parameter", + "text": " event must be a valid VkEvent handle" + }, + { + "vuid": "VUID-vkCmdResetEvent-stageMask-parameter", + "text": " stageMask must be a valid combination of VkPipelineStageFlagBits values" + }, + { + "vuid": "VUID-vkCmdResetEvent-stageMask-requiredbitmask", + "text": " stageMask must not be 0" + }, + { + "vuid": "VUID-vkCmdResetEvent-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdResetEvent-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdResetEvent-renderpass", + "text": " This command must only be called outside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdResetEvent-commonparent", + "text": " Both of commandBuffer, and event must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-vkCmdResetEvent-commandBuffer-01157", + "text": " commandBuffer’s current device mask must include exactly one physical device." + } + ] + }, + "vkCmdWaitEvents": { + "core": [ + { + "vuid": "VUID-vkCmdWaitEvents-srcStageMask-01158", + "text": " srcStageMask must be the bitwise OR of the stageMask parameter used in previous calls to vkCmdSetEvent with any of the members of pEvents and VK_PIPELINE_STAGE_HOST_BIT if any of the members of pEvents was set using vkSetEvent" + }, + { + "vuid": "VUID-vkCmdWaitEvents-srcStageMask-01159", + "text": " If the &amp;lt;&amp;lt;features-features-geometryShader,geometry shaders&amp;gt;&amp;gt; feature is not enabled, srcStageMask must not contain VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT" + }, + { + "vuid": "VUID-vkCmdWaitEvents-dstStageMask-01160", + "text": " If the &amp;lt;&amp;lt;features-features-geometryShader,geometry shaders&amp;gt;&amp;gt; feature is not enabled, dstStageMask must not contain VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT" + }, + { + "vuid": "VUID-vkCmdWaitEvents-srcStageMask-01161", + "text": " If the &amp;lt;&amp;lt;features-features-tessellationShader,tessellation shaders&amp;gt;&amp;gt; feature is not enabled, srcStageMask must not contain VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT" + }, + { + "vuid": "VUID-vkCmdWaitEvents-dstStageMask-01162", + "text": " If the &amp;lt;&amp;lt;features-features-tessellationShader,tessellation shaders&amp;gt;&amp;gt; feature is not enabled, dstStageMask must not contain VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT" + }, + { + "vuid": "VUID-vkCmdWaitEvents-pEvents-01163", + "text": " If pEvents includes one or more events that will be signaled by vkSetEvent after commandBuffer has been submitted to a queue, then vkCmdWaitEvents must not be called inside a render pass instance" + }, + { + "vuid": "VUID-vkCmdWaitEvents-srcStageMask-01164", + "text": " Any pipeline stage included in srcStageMask or dstStageMask must be supported by the capabilities of the queue family specified by the queueFamilyIndex member of the VkCommandPoolCreateInfo structure that was used to create the VkCommandPool that commandBuffer was allocated from, as specified in the &amp;lt;&amp;lt;synchronization-pipeline-stages-supported, table of supported pipeline stages&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-vkCmdWaitEvents-pMemoryBarriers-01165", + "text": " Each element of pMemoryBarriers, pBufferMemoryBarriers or pImageMemoryBarriers must not have any access flag included in its srcAccessMask member if that bit is not supported by any of the pipeline stages in srcStageMask, as specified in the &amp;lt;&amp;lt;synchronization-access-types-supported, table of supported access types&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-vkCmdWaitEvents-pMemoryBarriers-01166", + "text": " Each element of pMemoryBarriers, pBufferMemoryBarriers or pImageMemoryBarriers must not have any access flag included in its dstAccessMask member if that bit is not supported by any of the pipeline stages in dstStageMask, as specified in the &amp;lt;&amp;lt;synchronization-access-types-supported, table of supported access types&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-vkCmdWaitEvents-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdWaitEvents-pEvents-parameter", + "text": " pEvents must be a valid pointer to an array of eventCount valid VkEvent handles" + }, + { + "vuid": "VUID-vkCmdWaitEvents-srcStageMask-parameter", + "text": " srcStageMask must be a valid combination of VkPipelineStageFlagBits values" + }, + { + "vuid": "VUID-vkCmdWaitEvents-srcStageMask-requiredbitmask", + "text": " srcStageMask must not be 0" + }, + { + "vuid": "VUID-vkCmdWaitEvents-dstStageMask-parameter", + "text": " dstStageMask must be a valid combination of VkPipelineStageFlagBits values" + }, + { + "vuid": "VUID-vkCmdWaitEvents-dstStageMask-requiredbitmask", + "text": " dstStageMask must not be 0" + }, + { + "vuid": "VUID-vkCmdWaitEvents-pMemoryBarriers-parameter", + "text": " If memoryBarrierCount is not 0, pMemoryBarriers must be a valid pointer to an array of memoryBarrierCount valid VkMemoryBarrier structures" + }, + { + "vuid": "VUID-vkCmdWaitEvents-pBufferMemoryBarriers-parameter", + "text": " If bufferMemoryBarrierCount is not 0, pBufferMemoryBarriers must be a valid pointer to an array of bufferMemoryBarrierCount valid VkBufferMemoryBarrier structures" + }, + { + "vuid": "VUID-vkCmdWaitEvents-pImageMemoryBarriers-parameter", + "text": " If imageMemoryBarrierCount is not 0, pImageMemoryBarriers must be a valid pointer to an array of imageMemoryBarrierCount valid VkImageMemoryBarrier structures" + }, + { + "vuid": "VUID-vkCmdWaitEvents-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdWaitEvents-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdWaitEvents-eventCount-arraylength", + "text": " eventCount must be greater than 0" + }, + { + "vuid": "VUID-vkCmdWaitEvents-commonparent", + "text": " Both of commandBuffer, and the elements of pEvents must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-vkCmdWaitEvents-commandBuffer-01167", + "text": " commandBuffer’s current device mask must include exactly one physical device." + } + ] + }, + "vkCmdPipelineBarrier": { + "core": [ + { + "vuid": "VUID-vkCmdPipelineBarrier-srcStageMask-01168", + "text": " If the &amp;lt;&amp;lt;features-features-geometryShader,geometry shaders&amp;gt;&amp;gt; feature is not enabled, srcStageMask must not contain VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-dstStageMask-01169", + "text": " If the &amp;lt;&amp;lt;features-features-geometryShader,geometry shaders&amp;gt;&amp;gt; feature is not enabled, dstStageMask must not contain VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-srcStageMask-01170", + "text": " If the &amp;lt;&amp;lt;features-features-tessellationShader,tessellation shaders&amp;gt;&amp;gt; feature is not enabled, srcStageMask must not contain VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-dstStageMask-01171", + "text": " If the &amp;lt;&amp;lt;features-features-tessellationShader,tessellation shaders&amp;gt;&amp;gt; feature is not enabled, dstStageMask must not contain VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-pDependencies-01172", + "text": " If vkCmdPipelineBarrier is called within a render pass instance, the render pass must have been created with a VkSubpassDependency instance in pDependencies that expresses a dependency from the current subpass to itself." + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-srcStageMask-01173", + "text": " If vkCmdPipelineBarrier is called within a render pass instance, srcStageMask must contain a subset of the bit values in the srcStageMask member of that instance of VkSubpassDependency" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-dstStageMask-01174", + "text": " If vkCmdPipelineBarrier is called within a render pass instance, dstStageMask must contain a subset of the bit values in the dstStageMask member of that instance of VkSubpassDependency" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-srcAccessMask-01175", + "text": " If vkCmdPipelineBarrier is called within a render pass instance, the srcAccessMask of any element of pMemoryBarriers or pImageMemoryBarriers must contain a subset of the bit values the srcAccessMask member of that instance of VkSubpassDependency" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-dstAccessMask-01176", + "text": " If vkCmdPipelineBarrier is called within a render pass instance, the dstAccessMask of any element of pMemoryBarriers or pImageMemoryBarriers must contain a subset of the bit values the dstAccessMask member of that instance of VkSubpassDependency" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-dependencyFlags-01177", + "text": " If vkCmdPipelineBarrier is called within a render pass instance, dependencyFlags must be equal to the dependencyFlags member of that instance of VkSubpassDependency" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-bufferMemoryBarrierCount-01178", + "text": " If vkCmdPipelineBarrier is called within a render pass instance, bufferMemoryBarrierCount must be 0" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-image-01179", + "text": " If vkCmdPipelineBarrier is called within a render pass instance, the image member of any element of pImageMemoryBarriers must be equal to one of the elements of pAttachments that the current framebuffer was created with, that is also referred to by one of the elements of the pColorAttachments, pResolveAttachments or pDepthStencilAttachment members of the VkSubpassDescription instance that the current subpass was created with" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-oldLayout-01180", + "text": " If vkCmdPipelineBarrier is called within a render pass instance, the oldLayout and newLayout members of any element of pImageMemoryBarriers must be equal to the layout member of an element of the pColorAttachments, pResolveAttachments or pDepthStencilAttachment members of the VkSubpassDescription instance that the current subpass was created with, that refers to the same image" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-oldLayout-01181", + "text": " If vkCmdPipelineBarrier is called within a render pass instance, the oldLayout and newLayout members of an element of pImageMemoryBarriers must be equal" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-srcQueueFamilyIndex-01182", + "text": " If vkCmdPipelineBarrier is called within a render pass instance, the srcQueueFamilyIndex and dstQueueFamilyIndex members of any element of pImageMemoryBarriers must be VK_QUEUE_FAMILY_IGNORED" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-srcStageMask-01183", + "text": " Any pipeline stage included in srcStageMask or dstStageMask must be supported by the capabilities of the queue family specified by the queueFamilyIndex member of the VkCommandPoolCreateInfo structure that was used to create the VkCommandPool that commandBuffer was allocated from, as specified in the &amp;lt;&amp;lt;synchronization-pipeline-stages-supported, table of supported pipeline stages&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-pMemoryBarriers-01184", + "text": " Each element of pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers must not have any access flag included in its srcAccessMask member if that bit is not supported by any of the pipeline stages in srcStageMask, as specified in the &amp;lt;&amp;lt;synchronization-access-types-supported, table of supported access types&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-pMemoryBarriers-01185", + "text": " Each element of pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers must not have any access flag included in its dstAccessMask member if that bit is not supported by any of the pipeline stages in dstStageMask, as specified in the &amp;lt;&amp;lt;synchronization-access-types-supported, table of supported access types&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-srcStageMask-parameter", + "text": " srcStageMask must be a valid combination of VkPipelineStageFlagBits values" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-srcStageMask-requiredbitmask", + "text": " srcStageMask must not be 0" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-dstStageMask-parameter", + "text": " dstStageMask must be a valid combination of VkPipelineStageFlagBits values" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-dstStageMask-requiredbitmask", + "text": " dstStageMask must not be 0" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-dependencyFlags-parameter", + "text": " dependencyFlags must be a valid combination of VkDependencyFlagBits values" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-pMemoryBarriers-parameter", + "text": " If memoryBarrierCount is not 0, pMemoryBarriers must be a valid pointer to an array of memoryBarrierCount valid VkMemoryBarrier structures" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-pBufferMemoryBarriers-parameter", + "text": " If bufferMemoryBarrierCount is not 0, pBufferMemoryBarriers must be a valid pointer to an array of bufferMemoryBarrierCount valid VkBufferMemoryBarrier structures" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-pImageMemoryBarriers-parameter", + "text": " If imageMemoryBarrierCount is not 0, pImageMemoryBarriers must be a valid pointer to an array of imageMemoryBarrierCount valid VkImageMemoryBarrier structures" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdPipelineBarrier-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations" + } + ], + "(VK_VERSION_1_1,VK_KHR_multiview)": [ + { + "vuid": "VUID-vkCmdPipelineBarrier-dependencyFlags-01186", + "text": " If vkCmdPipelineBarrier is called outside of a render pass instance, dependencyFlags must not include VK_DEPENDENCY_VIEW_LOCAL_BIT" + } + ] + }, + "VkMemoryBarrier": { + "core": [ + { + "vuid": "VUID-VkMemoryBarrier-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_MEMORY_BARRIER" + }, + { + "vuid": "VUID-VkMemoryBarrier-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkMemoryBarrier-srcAccessMask-parameter", + "text": " srcAccessMask must be a valid combination of VkAccessFlagBits values" + }, + { + "vuid": "VUID-VkMemoryBarrier-dstAccessMask-parameter", + "text": " dstAccessMask must be a valid combination of VkAccessFlagBits values" + } + ] + }, + "VkBufferMemoryBarrier": { + "core": [ + { + "vuid": "VUID-VkBufferMemoryBarrier-offset-01187", + "text": " offset must be less than the size of buffer" + }, + { + "vuid": "VUID-VkBufferMemoryBarrier-size-01188", + "text": " If size is not equal to VK_WHOLE_SIZE, size must be greater than 0" + }, + { + "vuid": "VUID-VkBufferMemoryBarrier-size-01189", + "text": " If size is not equal to VK_WHOLE_SIZE, size must be less than or equal to than the size of buffer minus offset" + }, + { + "vuid": "VUID-VkBufferMemoryBarrier-buffer-01196", + "text": " If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, and srcQueueFamilyIndex and dstQueueFamilyIndex are not VK_QUEUE_FAMILY_IGNORED, at least one of them must be the same as the family of the queue that will execute this barrier" + }, + { + "vuid": "VUID-VkBufferMemoryBarrier-buffer-01931", + "text": " If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-VkBufferMemoryBarrier-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER" + }, + { + "vuid": "VUID-VkBufferMemoryBarrier-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkBufferMemoryBarrier-srcAccessMask-parameter", + "text": " srcAccessMask must be a valid combination of VkAccessFlagBits values" + }, + { + "vuid": "VUID-VkBufferMemoryBarrier-dstAccessMask-parameter", + "text": " dstAccessMask must be a valid combination of VkAccessFlagBits values" + }, + { + "vuid": "VUID-VkBufferMemoryBarrier-buffer-parameter", + "text": " buffer must be a valid VkBuffer handle" + } + ], + "!(VK_VERSION_1_1,VK_KHR_external_memory)": [ + { + "vuid": "VUID-VkBufferMemoryBarrier-buffer-01190", + "text": " If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, srcQueueFamilyIndex and dstQueueFamilyIndex must both be VK_QUEUE_FAMILY_IGNORED" + }, + { + "vuid": "VUID-VkBufferMemoryBarrier-buffer-01192", + "text": " If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, srcQueueFamilyIndex and dstQueueFamilyIndex must either both be VK_QUEUE_FAMILY_IGNORED, or both be a valid queue family (see &amp;lt;&amp;lt;devsandqueues-queueprops&amp;gt;&amp;gt;)" + } + ], + "(VK_VERSION_1_1,VK_KHR_external_memory)": [ + { + "vuid": "VUID-VkBufferMemoryBarrier-buffer-01191", + "text": " If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, at least one of srcQueueFamilyIndex and dstQueueFamilyIndex must be VK_QUEUE_FAMILY_IGNORED" + }, + { + "vuid": "VUID-VkBufferMemoryBarrier-buffer-01763", + "text": " If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, and one of srcQueueFamilyIndex and dstQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, the other must be VK_QUEUE_FAMILY_IGNORED or a special queue family reserved for external memory ownership transfers, as described in &amp;lt;&amp;lt;synchronization-queue-transfers&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-VkBufferMemoryBarrier-buffer-01193", + "text": " If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, dstQueueFamilyIndex must also be VK_QUEUE_FAMILY_IGNORED" + }, + { + "vuid": "VUID-VkBufferMemoryBarrier-buffer-01764", + "text": " If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in &amp;lt;&amp;lt;synchronization-queue-transfers&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-VkBufferMemoryBarrier-buffer-01765", + "text": " If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and dstQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in &amp;lt;&amp;lt;synchronization-queue-transfers&amp;gt;&amp;gt;." + } + ] + }, + "VkImageMemoryBarrier": { + "core": [ + { + "vuid": "VUID-VkImageMemoryBarrier-oldLayout-01197", + "text": " oldLayout must be VK_IMAGE_LAYOUT_UNDEFINED or the current layout of the image subresources affected by the barrier" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-newLayout-01198", + "text": " newLayout must not be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-image-01205", + "text": " If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, and srcQueueFamilyIndex and dstQueueFamilyIndex are not VK_QUEUE_FAMILY_IGNORED, at least one of them must be the same as the family of the queue that will execute this barrier" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-subresourceRange-01486", + "text": " subresourceRange.baseMipLevel must be less than the mipLevels specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-subresourceRange-01724", + "text": " If subresourceRange.levelCount is not VK_REMAINING_MIP_LEVELS, subresourceRange.baseMipLevel + subresourceRange.levelCount must be less than or equal to the mipLevels specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-subresourceRange-01488", + "text": " subresourceRange.baseArrayLayer must be less than the arrayLayers specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-subresourceRange-01725", + "text": " If subresourceRange.layerCount is not VK_REMAINING_ARRAY_LAYERS, subresourceRange.baseArrayLayer + subresourceRange.layerCount must be less than or equal to the arrayLayers specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-image-01207", + "text": " If image has a depth/stencil format with both depth and stencil components, then the aspectMask member of subresourceRange must include both VK_IMAGE_ASPECT_DEPTH_BIT and VK_IMAGE_ASPECT_STENCIL_BIT" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-oldLayout-01208", + "text": " If either oldLayout or newLayout is VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL then image must have been created with VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT set" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-oldLayout-01209", + "text": " If either oldLayout or newLayout is VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL then image must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-oldLayout-01210", + "text": " If either oldLayout or newLayout is VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL then image must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-oldLayout-01211", + "text": " If either oldLayout or newLayout is VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL then image must have been created with VK_IMAGE_USAGE_SAMPLED_BIT or VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT set" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-oldLayout-01212", + "text": " If either oldLayout or newLayout is VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL then image must have been created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT set" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-oldLayout-01213", + "text": " If either oldLayout or newLayout is VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL then image must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT set" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-image-01932", + "text": " If image is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-pNext-pNext", + "text": " pNext must be NULL or a pointer to a valid instance of VkSampleLocationsInfoEXT" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-srcAccessMask-parameter", + "text": " srcAccessMask must be a valid combination of VkAccessFlagBits values" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-dstAccessMask-parameter", + "text": " dstAccessMask must be a valid combination of VkAccessFlagBits values" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-oldLayout-parameter", + "text": " oldLayout must be a valid VkImageLayout value" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-newLayout-parameter", + "text": " newLayout must be a valid VkImageLayout value" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-image-parameter", + "text": " image must be a valid VkImage handle" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-subresourceRange-parameter", + "text": " subresourceRange must be a valid VkImageSubresourceRange structure" + } + ], + "!(VK_VERSION_1_1,VK_KHR_external_memory)": [ + { + "vuid": "VUID-VkImageMemoryBarrier-image-01199", + "text": " If image was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, srcQueueFamilyIndex and dstQueueFamilyIndex must both be VK_QUEUE_FAMILY_IGNORED" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-image-01200", + "text": " If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, srcQueueFamilyIndex and dstQueueFamilyIndex must either both be VK_QUEUE_FAMILY_IGNORED, or both be a valid queue family (see &amp;lt;&amp;lt;devsandqueues-queueprops&amp;gt;&amp;gt;)." + } + ], + "(VK_VERSION_1_1,VK_KHR_external_memory)": [ + { + "vuid": "VUID-VkImageMemoryBarrier-image-01381", + "text": " If image was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, at least one of srcQueueFamilyIndex and dstQueueFamilyIndex must be VK_QUEUE_FAMILY_IGNORED" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-image-01766", + "text": " If image was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, and one of srcQueueFamilyIndex and dstQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, the other must be VK_QUEUE_FAMILY_IGNORED or a special queue family reserved for external memory transfers, as described in &amp;lt;&amp;lt;synchronization-queue-transfers&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-VkImageMemoryBarrier-image-01201", + "text": " If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, dstQueueFamilyIndex must also be VK_QUEUE_FAMILY_IGNORED." + }, + { + "vuid": "VUID-VkImageMemoryBarrier-image-01767", + "text": " If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in &amp;lt;&amp;lt;synchronization-queue-transfers&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-VkImageMemoryBarrier-image-01768", + "text": " If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and dstQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in &amp;lt;&amp;lt;synchronization-queue-transfers&amp;gt;&amp;gt;." + } + ], + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkImageMemoryBarrier-image-01671", + "text": " If image has a single-plane color format or is not disjoint, then the aspectMask member of subresourceRange must be VK_IMAGE_ASPECT_COLOR_BIT" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-image-01672", + "text": " If image has a multi-planar format and the image is disjoint, then the aspectMask member of subresourceRange must include either at least one of VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, and VK_IMAGE_ASPECT_PLANE_2_BIT; or must include VK_IMAGE_ASPECT_COLOR_BIT" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-image-01673", + "text": " If image has a multi-planar format with only two planes, then the aspectMask member of subresourceRange must not include VK_IMAGE_ASPECT_PLANE_2_BIT" + } + ], + "(VK_VERSION_1_1,VK_KHR_maintenance2)": [ + { + "vuid": "VUID-VkImageMemoryBarrier-oldLayout-01658", + "text": " If either oldLayout or newLayout is VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL then image must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set" + }, + { + "vuid": "VUID-VkImageMemoryBarrier-oldLayout-01659", + "text": " If either oldLayout or newLayout is VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL then image must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set" + } + ] + }, + "vkQueueWaitIdle": { + "core": [ + { + "vuid": "VUID-vkQueueWaitIdle-queue-parameter", + "text": " queue must be a valid VkQueue handle" + } + ] + }, + "vkDeviceWaitIdle": { + "core": [ + { + "vuid": "VUID-vkDeviceWaitIdle-device-parameter", + "text": " device must be a valid VkDevice handle" + } + ] + }, + "vkCreateRenderPass": { + "core": [ + { + "vuid": "VUID-vkCreateRenderPass-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateRenderPass-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkRenderPassCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateRenderPass-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateRenderPass-pRenderPass-parameter", + "text": " pRenderPass must be a valid pointer to a VkRenderPass handle" + } + ] + }, + "VkRenderPassCreateInfo": { + "core": [ + { + "vuid": "VUID-VkRenderPassCreateInfo-None-00832", + "text": " If any two subpasses operate on attachments with overlapping ranges of the same VkDeviceMemory object, and at least one subpass writes to that area of VkDeviceMemory, a subpass dependency must be included (either directly or via some intermediate subpasses) between them" + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-attachment-00833", + "text": " If the attachment member of any element of pInputAttachments, pColorAttachments, pResolveAttachments or pDepthStencilAttachment, or the attachment indexed by any element of pPreserveAttachments in any element of pSubpasses is bound to a range of a VkDeviceMemory object that overlaps with any other attachment in any subpass (including the same subpass), the VkAttachmentDescription structures describing them must include VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT in flags" + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-attachment-00834", + "text": " If the attachment member of any element of pInputAttachments, pColorAttachments, pResolveAttachments or pDepthStencilAttachment, or any element of pPreserveAttachments in any element of pSubpasses is not VK_ATTACHMENT_UNUSED, it must be less than attachmentCount" + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-pPreserveAttachments-00835", + "text": " The value of each element of the pPreserveAttachments member in each element of pSubpasses must not be VK_ATTACHMENT_UNUSED" + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-pAttachments-00836", + "text": " For any member of pAttachments with a loadOp equal to VK_ATTACHMENT_LOAD_OP_CLEAR, the first use of that attachment must not specify a layout equal to VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL or VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL." + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-pDependencies-00837", + "text": " For any element of pDependencies, if the srcSubpass is not VK_SUBPASS_EXTERNAL, all stage flags included in the srcStageMask member of that dependency must be a pipeline stage supported by the &amp;lt;&amp;lt;synchronization-pipeline-stages-types, pipeline&amp;gt;&amp;gt; identified by the pipelineBindPoint member of the source subpass." + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-pDependencies-00838", + "text": " For any element of pDependencies, if the dstSubpass is not VK_SUBPASS_EXTERNAL, all stage flags included in the dstStageMask member of that dependency must be a pipeline stage supported by the &amp;lt;&amp;lt;synchronization-pipeline-stages-types, pipeline&amp;gt;&amp;gt; identified by the pipelineBindPoint member of the source subpass." + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO" + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkRenderPassInputAttachmentAspectCreateInfo or VkRenderPassMultiviewCreateInfo" + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-pAttachments-parameter", + "text": " If attachmentCount is not 0, pAttachments must be a valid pointer to an array of attachmentCount valid VkAttachmentDescription structures" + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-pSubpasses-parameter", + "text": " pSubpasses must be a valid pointer to an array of subpassCount valid VkSubpassDescription structures" + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-pDependencies-parameter", + "text": " If dependencyCount is not 0, pDependencies must be a valid pointer to an array of dependencyCount valid VkSubpassDependency structures" + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-subpassCount-arraylength", + "text": " subpassCount must be greater than 0" + } + ], + "(VK_VERSION_1_1,VK_KHR_maintenance2)": [ + { + "vuid": "VUID-VkRenderPassCreateInfo-pAttachments-01566", + "text": " For any member of pAttachments with a loadOp equal to VK_ATTACHMENT_LOAD_OP_CLEAR, the first use of that attachment must not specify a layout equal to VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL." + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-pAttachments-01567", + "text": " For any member of pAttachments with a stencilLoadOp equal to VK_ATTACHMENT_LOAD_OP_CLEAR, the first use of that attachment must not specify a layout equal to VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL." + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-pNext-01926", + "text": " If the pNext chain includes an instance of VkRenderPassInputAttachmentAspectCreateInfo, the subpass member of each element of its pAspectReferences member must be less than subpassCount" + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-pNext-01927", + "text": " If the pNext chain includes an instance of VkRenderPassInputAttachmentAspectCreateInfo, the inputAttachmentIndex member of each element of its pAspectReferences member must be less than the value of inputAttachmentCount in the member of pSubpasses identified by its subpass member" + } + ], + "(VK_VERSION_1_1,VK_KHR_multiview)": [ + { + "vuid": "VUID-VkRenderPassCreateInfo-pNext-01928", + "text": " If the pNext chain includes an instance of VkRenderPassMultiviewCreateInfo, and its subpassCount member is not zero, that member must be equal to the value of subpassCount" + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-pNext-01929", + "text": " If the pNext chain includes an instance of VkRenderPassMultiviewCreateInfo, if its dependencyCount member is not zero, it must be equal to dependencyCount" + }, + { + "vuid": "VUID-VkRenderPassCreateInfo-pNext-01930", + "text": " If the pNext chain includes an instance of VkRenderPassMultiviewCreateInfo, for each non-zero element of pViewOffsets, the srcSubpass and dstSubpass members of pDependencies at the same index must not be equal" + } + ] + }, + "VkRenderPassMultiviewCreateInfo": { + "(VK_VERSION_1_1,VK_KHR_multiview)": [ + { + "vuid": "VUID-VkRenderPassMultiviewCreateInfo-pCorrelationMasks-00841", + "text": " Each view index must not be set in more than one element of pCorrelationMasks" + }, + { + "vuid": "VUID-VkRenderPassMultiviewCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO" + }, + { + "vuid": "VUID-VkRenderPassMultiviewCreateInfo-pViewMasks-parameter", + "text": " If subpassCount is not 0, pViewMasks must be a valid pointer to an array of subpassCount uint32_t values" + }, + { + "vuid": "VUID-VkRenderPassMultiviewCreateInfo-pViewOffsets-parameter", + "text": " If dependencyCount is not 0, pViewOffsets must be a valid pointer to an array of dependencyCount int32_t values" + }, + { + "vuid": "VUID-VkRenderPassMultiviewCreateInfo-pCorrelationMasks-parameter", + "text": " If correlationMaskCount is not 0, pCorrelationMasks must be a valid pointer to an array of correlationMaskCount uint32_t values" + } + ] + }, + "VkAttachmentDescription": { + "core": [ + { + "vuid": "VUID-VkAttachmentDescription-finalLayout-00843", + "text": " finalLayout must not be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED" + }, + { + "vuid": "VUID-VkAttachmentDescription-flags-parameter", + "text": " flags must be a valid combination of VkAttachmentDescriptionFlagBits values" + }, + { + "vuid": "VUID-VkAttachmentDescription-format-parameter", + "text": " format must be a valid VkFormat value" + }, + { + "vuid": "VUID-VkAttachmentDescription-samples-parameter", + "text": " samples must be a valid VkSampleCountFlagBits value" + }, + { + "vuid": "VUID-VkAttachmentDescription-loadOp-parameter", + "text": " loadOp must be a valid VkAttachmentLoadOp value" + }, + { + "vuid": "VUID-VkAttachmentDescription-storeOp-parameter", + "text": " storeOp must be a valid VkAttachmentStoreOp value" + }, + { + "vuid": "VUID-VkAttachmentDescription-stencilLoadOp-parameter", + "text": " stencilLoadOp must be a valid VkAttachmentLoadOp value" + }, + { + "vuid": "VUID-VkAttachmentDescription-stencilStoreOp-parameter", + "text": " stencilStoreOp must be a valid VkAttachmentStoreOp value" + }, + { + "vuid": "VUID-VkAttachmentDescription-initialLayout-parameter", + "text": " initialLayout must be a valid VkImageLayout value" + }, + { + "vuid": "VUID-VkAttachmentDescription-finalLayout-parameter", + "text": " finalLayout must be a valid VkImageLayout value" + } + ] + }, + "VkRenderPassInputAttachmentAspectCreateInfo": { + "(VK_VERSION_1_1,VK_KHR_maintenance2)": [ + { + "vuid": "VUID-VkRenderPassInputAttachmentAspectCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO" + }, + { + "vuid": "VUID-VkRenderPassInputAttachmentAspectCreateInfo-pAspectReferences-parameter", + "text": " pAspectReferences must be a valid pointer to an array of aspectReferenceCount valid VkInputAttachmentAspectReference structures" + }, + { + "vuid": "VUID-VkRenderPassInputAttachmentAspectCreateInfo-aspectReferenceCount-arraylength", + "text": " aspectReferenceCount must be greater than 0" + } + ] + }, + "VkInputAttachmentAspectReference": { + "(VK_VERSION_1_1,VK_KHR_maintenance2)": [ + { + "vuid": "VUID-VkInputAttachmentAspectReference-pCreateInfo-01568", + "text": " There must be an input attachment at pCreateInfo::pSubpasses[subpass].pInputAttachments[inputAttachmentIndex]." + }, + { + "vuid": "VUID-VkInputAttachmentAspectReference-None-01569", + "text": " The specified input attachment must have more than one aspect mask." + }, + { + "vuid": "VUID-VkInputAttachmentAspectReference-aspectMask-01570", + "text": " aspectMask must be a subset of the aspect masks in the specified input attachment." + }, + { + "vuid": "VUID-VkInputAttachmentAspectReference-aspectMask-parameter", + "text": " aspectMask must be a valid combination of VkImageAspectFlagBits values" + }, + { + "vuid": "VUID-VkInputAttachmentAspectReference-aspectMask-requiredbitmask", + "text": " aspectMask must not be 0" + } + ] + }, + "VkSubpassDescription": { + "core": [ + { + "vuid": "VUID-VkSubpassDescription-pipelineBindPoint-00844", + "text": " pipelineBindPoint must be VK_PIPELINE_BIND_POINT_GRAPHICS" + }, + { + "vuid": "VUID-VkSubpassDescription-colorAttachmentCount-00845", + "text": " colorAttachmentCount must be less than or equal to VkPhysicalDeviceLimits::maxColorAttachments" + }, + { + "vuid": "VUID-VkSubpassDescription-loadOp-00846", + "text": " If the first use of an attachment in this render pass is as an input attachment, and the attachment is not also used as a color or depth/stencil attachment in the same subpass, then loadOp must not be VK_ATTACHMENT_LOAD_OP_CLEAR" + }, + { + "vuid": "VUID-VkSubpassDescription-pResolveAttachments-00847", + "text": " If pResolveAttachments is not NULL, for each resolve attachment that does not have the value VK_ATTACHMENT_UNUSED, the corresponding color attachment must not have the value VK_ATTACHMENT_UNUSED" + }, + { + "vuid": "VUID-VkSubpassDescription-pResolveAttachments-00848", + "text": " If pResolveAttachments is not NULL, the sample count of each element of pColorAttachments must be anything other than VK_SAMPLE_COUNT_1_BIT" + }, + { + "vuid": "VUID-VkSubpassDescription-pResolveAttachments-00849", + "text": " Each element of pResolveAttachments must have a sample count of VK_SAMPLE_COUNT_1_BIT" + }, + { + "vuid": "VUID-VkSubpassDescription-pResolveAttachments-00850", + "text": " Each element of pResolveAttachments must have the same VkFormat as its corresponding color attachment" + }, + { + "vuid": "VUID-VkSubpassDescription-pColorAttachments-01417", + "text": " All attachments in pColorAttachments that are not VK_ATTACHMENT_UNUSED must have the same sample count" + }, + { + "vuid": "VUID-VkSubpassDescription-None-00852", + "text": " If any input attachments are VK_ATTACHMENT_UNUSED, then any pipelines bound during the subpass must not access those input attachments from the fragment shader" + }, + { + "vuid": "VUID-VkSubpassDescription-attachment-00853", + "text": " The attachment member of each element of pPreserveAttachments must not be VK_ATTACHMENT_UNUSED" + }, + { + "vuid": "VUID-VkSubpassDescription-pPreserveAttachments-00854", + "text": " Each element of pPreserveAttachments must not also be an element of any other member of the subpass description" + }, + { + "vuid": "VUID-VkSubpassDescription-layout-00855", + "text": " If any attachment is used as both an input attachment and a color or depth/stencil attachment, then each use must use the same layout" + }, + { + "vuid": "VUID-VkSubpassDescription-flags-parameter", + "text": " flags must be a valid combination of VkSubpassDescriptionFlagBits values" + }, + { + "vuid": "VUID-VkSubpassDescription-pipelineBindPoint-parameter", + "text": " pipelineBindPoint must be a valid VkPipelineBindPoint value" + }, + { + "vuid": "VUID-VkSubpassDescription-pInputAttachments-parameter", + "text": " If inputAttachmentCount is not 0, pInputAttachments must be a valid pointer to an array of inputAttachmentCount valid VkAttachmentReference structures" + }, + { + "vuid": "VUID-VkSubpassDescription-pColorAttachments-parameter", + "text": " If colorAttachmentCount is not 0, pColorAttachments must be a valid pointer to an array of colorAttachmentCount valid VkAttachmentReference structures" + }, + { + "vuid": "VUID-VkSubpassDescription-pResolveAttachments-parameter", + "text": " If colorAttachmentCount is not 0, and pResolveAttachments is not NULL, pResolveAttachments must be a valid pointer to an array of colorAttachmentCount valid VkAttachmentReference structures" + }, + { + "vuid": "VUID-VkSubpassDescription-pDepthStencilAttachment-parameter", + "text": " If pDepthStencilAttachment is not NULL, pDepthStencilAttachment must be a valid pointer to a valid VkAttachmentReference structure" + }, + { + "vuid": "VUID-VkSubpassDescription-pPreserveAttachments-parameter", + "text": " If preserveAttachmentCount is not 0, pPreserveAttachments must be a valid pointer to an array of preserveAttachmentCount uint32_t values" + } + ], + "(VK_AMD_mixed_attachment_samples)": [ + { + "vuid": "VUID-VkSubpassDescription-pColorAttachments-01506", + "text": " All attachments in pColorAttachments that are not VK_ATTACHMENT_UNUSED must have a sample count that is smaller than or equal to the sample count of pDepthStencilAttachment if it is not VK_ATTACHMENT_UNUSED" + } + ], + "!(VK_AMD_mixed_attachment_samples)+!(VK_NV_framebuffer_mixed_samples)": [ + { + "vuid": "VUID-VkSubpassDescription-pDepthStencilAttachment-01418", + "text": " If pDepthStencilAttachment is not VK_ATTACHMENT_UNUSED and any attachments in pColorAttachments are not VK_ATTACHMENT_UNUSED, they must have the same sample count" + } + ], + "(VK_NVX_multiview_per_view_attributes)": [ + { + "vuid": "VUID-VkSubpassDescription-flags-00856", + "text": " If flags includes VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX, it must also include VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX." + } + ] + }, + "VkAttachmentReference": { + "core": [ + { + "vuid": "VUID-VkAttachmentReference-layout-00857", + "text": " layout must not be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED" + }, + { + "vuid": "VUID-VkAttachmentReference-layout-parameter", + "text": " layout must be a valid VkImageLayout value" + } + ] + }, + "VkSubpassDependency": { + "core": [ + { + "vuid": "VUID-VkSubpassDependency-srcSubpass-00858", + "text": " If srcSubpass is not VK_SUBPASS_EXTERNAL, srcStageMask must not include VK_PIPELINE_STAGE_HOST_BIT" + }, + { + "vuid": "VUID-VkSubpassDependency-dstSubpass-00859", + "text": " If dstSubpass is not VK_SUBPASS_EXTERNAL, dstStageMask must not include VK_PIPELINE_STAGE_HOST_BIT" + }, + { + "vuid": "VUID-VkSubpassDependency-srcStageMask-00860", + "text": " If the &amp;lt;&amp;lt;features-features-geometryShader,geometry shaders&amp;gt;&amp;gt; feature is not enabled, srcStageMask must not contain VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT" + }, + { + "vuid": "VUID-VkSubpassDependency-dstStageMask-00861", + "text": " If the &amp;lt;&amp;lt;features-features-geometryShader,geometry shaders&amp;gt;&amp;gt; feature is not enabled, dstStageMask must not contain VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT" + }, + { + "vuid": "VUID-VkSubpassDependency-srcStageMask-00862", + "text": " If the &amp;lt;&amp;lt;features-features-tessellationShader,tessellation shaders&amp;gt;&amp;gt; feature is not enabled, srcStageMask must not contain VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT" + }, + { + "vuid": "VUID-VkSubpassDependency-dstStageMask-00863", + "text": " If the &amp;lt;&amp;lt;features-features-tessellationShader,tessellation shaders&amp;gt;&amp;gt; feature is not enabled, dstStageMask must not contain VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT" + }, + { + "vuid": "VUID-VkSubpassDependency-srcSubpass-00864", + "text": " srcSubpass must be less than or equal to dstSubpass, unless one of them is VK_SUBPASS_EXTERNAL, to avoid cyclic dependencies and ensure a valid execution order" + }, + { + "vuid": "VUID-VkSubpassDependency-srcSubpass-00865", + "text": " srcSubpass and dstSubpass must not both be equal to VK_SUBPASS_EXTERNAL" + }, + { + "vuid": "VUID-VkSubpassDependency-srcSubpass-00866", + "text": " If srcSubpass is equal to dstSubpass, srcStageMask and dstStageMask must only contain one of VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT, VK_PIPELINE_STAGE_VERTEX_INPUT_BIT, VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT, VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT, VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT, VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, or VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT" + }, + { + "vuid": "VUID-VkSubpassDependency-srcSubpass-00867", + "text": " If srcSubpass is equal to dstSubpass and not all of the stages in srcStageMask and dstStageMask are &amp;lt;&amp;lt;synchronization-framebuffer-regions,framebuffer-space stages&amp;gt;&amp;gt;, the &amp;lt;&amp;lt;synchronization-pipeline-stages-order, logically latest&amp;gt;&amp;gt; pipeline stage in srcStageMask must be &amp;lt;&amp;lt;synchronization-pipeline-stages-order, logically earlier&amp;gt;&amp;gt; than or equal to the &amp;lt;&amp;lt;synchronization-pipeline-stages-order, logically earliest&amp;gt;&amp;gt; pipeline stage in dstStageMask" + }, + { + "vuid": "VUID-VkSubpassDependency-srcAccessMask-00868", + "text": " Any access flag included in srcAccessMask must be supported by one of the pipeline stages in srcStageMask, as specified in the &amp;lt;&amp;lt;synchronization-access-types-supported, table of supported access types&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-VkSubpassDependency-dstAccessMask-00869", + "text": " Any access flag included in dstAccessMask must be supported by one of the pipeline stages in dstStageMask, as specified in the &amp;lt;&amp;lt;synchronization-access-types-supported, table of supported access types&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-VkSubpassDependency-srcStageMask-parameter", + "text": " srcStageMask must be a valid combination of VkPipelineStageFlagBits values" + }, + { + "vuid": "VUID-VkSubpassDependency-srcStageMask-requiredbitmask", + "text": " srcStageMask must not be 0" + }, + { + "vuid": "VUID-VkSubpassDependency-dstStageMask-parameter", + "text": " dstStageMask must be a valid combination of VkPipelineStageFlagBits values" + }, + { + "vuid": "VUID-VkSubpassDependency-dstStageMask-requiredbitmask", + "text": " dstStageMask must not be 0" + }, + { + "vuid": "VUID-VkSubpassDependency-srcAccessMask-parameter", + "text": " srcAccessMask must be a valid combination of VkAccessFlagBits values" + }, + { + "vuid": "VUID-VkSubpassDependency-dstAccessMask-parameter", + "text": " dstAccessMask must be a valid combination of VkAccessFlagBits values" + }, + { + "vuid": "VUID-VkSubpassDependency-dependencyFlags-parameter", + "text": " dependencyFlags must be a valid combination of VkDependencyFlagBits values" + } + ], + "(VK_VERSION_1_1,VK_KHR_multiview)": [ + { + "vuid": "VUID-VkSubpassDependency-dependencyFlags-00870", + "text": " If dependencyFlags includes VK_DEPENDENCY_VIEW_LOCAL_BIT, then both srcSubpass and dstSubpass must not equal VK_SUBPASS_EXTERNAL" + }, + { + "vuid": "VUID-VkSubpassDependency-dependencyFlags-00871", + "text": " If dependencyFlags includes VK_DEPENDENCY_VIEW_LOCAL_BIT, then the render pass must have multiview enabled" + }, + { + "vuid": "VUID-VkSubpassDependency-srcSubpass-00872", + "text": " If srcSubpass equals dstSubpass and that subpass has more than one bit set in the view mask, then dependencyFlags must include VK_DEPENDENCY_VIEW_LOCAL_BIT" + } + ] + }, + "vkDestroyRenderPass": { + "core": [ + { + "vuid": "VUID-vkDestroyRenderPass-renderPass-00873", + "text": " All submitted commands that refer to renderPass must have completed execution" + }, + { + "vuid": "VUID-vkDestroyRenderPass-renderPass-00874", + "text": " If VkAllocationCallbacks were provided when renderPass was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyRenderPass-renderPass-00875", + "text": " If no VkAllocationCallbacks were provided when renderPass was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyRenderPass-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyRenderPass-renderPass-parameter", + "text": " If renderPass is not VK_NULL_HANDLE, renderPass must be a valid VkRenderPass handle" + }, + { + "vuid": "VUID-vkDestroyRenderPass-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyRenderPass-renderPass-parent", + "text": " If renderPass is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkCreateFramebuffer": { + "core": [ + { + "vuid": "VUID-vkCreateFramebuffer-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateFramebuffer-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkFramebufferCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateFramebuffer-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateFramebuffer-pFramebuffer-parameter", + "text": " pFramebuffer must be a valid pointer to a VkFramebuffer handle" + } + ] + }, + "VkFramebufferCreateInfo": { + "core": [ + { + "vuid": "VUID-VkFramebufferCreateInfo-attachmentCount-00876", + "text": " attachmentCount must be equal to the attachment count specified in renderPass" + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-pAttachments-00877", + "text": " Each element of pAttachments that is used as a color attachment or resolve attachment by renderPass must have been created with a usage value including VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT" + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-pAttachments-00878", + "text": " Each element of pAttachments that is used as a depth/stencil attachment by renderPass must have been created with a usage value including VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT" + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-pAttachments-00879", + "text": " Each element of pAttachments that is used as an input attachment by renderPass must have been created with a usage value including VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT" + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-pAttachments-00880", + "text": " Each element of pAttachments must have been created with an VkFormat value that matches the VkFormat specified by the corresponding VkAttachmentDescription in renderPass" + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-pAttachments-00881", + "text": " Each element of pAttachments must have been created with a samples value that matches the samples value specified by the corresponding VkAttachmentDescription in renderPass" + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-pAttachments-00882", + "text": " Each element of pAttachments must have dimensions at least as large as the corresponding framebuffer dimension" + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-pAttachments-00883", + "text": " Each element of pAttachments must only specify a single mip level" + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-pAttachments-00884", + "text": " Each element of pAttachments must have been created with the identity swizzle" + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-width-00885", + "text": " width must be greater than 0." + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-width-00886", + "text": " width must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferWidth" + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-height-00887", + "text": " height must be greater than 0." + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-height-00888", + "text": " height must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferHeight" + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-layers-00889", + "text": " layers must be greater than 0." + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-layers-00890", + "text": " layers must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferLayers" + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO" + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-renderPass-parameter", + "text": " renderPass must be a valid VkRenderPass handle" + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-pAttachments-parameter", + "text": " If attachmentCount is not 0, pAttachments must be a valid pointer to an array of attachmentCount valid VkImageView handles" + }, + { + "vuid": "VUID-VkFramebufferCreateInfo-commonparent", + "text": " Both of renderPass, and the elements of pAttachments that are valid handles must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1,VK_KHR_maintenance1)": [ + { + "vuid": "VUID-VkFramebufferCreateInfo-pAttachments-00891", + "text": " Each element of pAttachments that is a 2D or 2D array image view taken from a 3D image must not be a depth/stencil format" + } + ] + }, + "vkDestroyFramebuffer": { + "core": [ + { + "vuid": "VUID-vkDestroyFramebuffer-framebuffer-00892", + "text": " All submitted commands that refer to framebuffer must have completed execution" + }, + { + "vuid": "VUID-vkDestroyFramebuffer-framebuffer-00893", + "text": " If VkAllocationCallbacks were provided when framebuffer was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyFramebuffer-framebuffer-00894", + "text": " If no VkAllocationCallbacks were provided when framebuffer was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyFramebuffer-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyFramebuffer-framebuffer-parameter", + "text": " If framebuffer is not VK_NULL_HANDLE, framebuffer must be a valid VkFramebuffer handle" + }, + { + "vuid": "VUID-vkDestroyFramebuffer-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyFramebuffer-framebuffer-parent", + "text": " If framebuffer is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkCmdBeginRenderPass": { + "core": [ + { + "vuid": "VUID-vkCmdBeginRenderPass-initialLayout-00895", + "text": " If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL then the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT set" + }, + { + "vuid": "VUID-vkCmdBeginRenderPass-initialLayout-00897", + "text": " If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL then the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with VK_IMAGE_USAGE_SAMPLED_BIT or VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT set" + }, + { + "vuid": "VUID-vkCmdBeginRenderPass-initialLayout-00898", + "text": " If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL then the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT set" + }, + { + "vuid": "VUID-vkCmdBeginRenderPass-initialLayout-00899", + "text": " If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL then the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT set" + }, + { + "vuid": "VUID-vkCmdBeginRenderPass-initialLayout-00900", + "text": " If any of the initialLayout members of the VkAttachmentDescription structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is not VK_IMAGE_LAYOUT_UNDEFINED, then each such initialLayout must be equal to the current layout of the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin" + }, + { + "vuid": "VUID-vkCmdBeginRenderPass-srcStageMask-00901", + "text": " The srcStageMask and dstStageMask members of any element of the pDependencies member of VkRenderPassCreateInfo used to create renderPass must be supported by the capabilities of the queue family identified by the queueFamilyIndex member of the VkCommandPoolCreateInfo used to create the command pool which commandBuffer was allocated from." + }, + { + "vuid": "VUID-vkCmdBeginRenderPass-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdBeginRenderPass-pRenderPassBegin-parameter", + "text": " pRenderPassBegin must be a valid pointer to a valid VkRenderPassBeginInfo structure" + }, + { + "vuid": "VUID-vkCmdBeginRenderPass-contents-parameter", + "text": " contents must be a valid VkSubpassContents value" + }, + { + "vuid": "VUID-vkCmdBeginRenderPass-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdBeginRenderPass-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdBeginRenderPass-renderpass", + "text": " This command must only be called outside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdBeginRenderPass-bufferlevel", + "text": " commandBuffer must be a primary VkCommandBuffer" + } + ], + "!(VK_VERSION_1_1,VK_KHR_maintenance2)": [ + { + "vuid": "VUID-vkCmdBeginRenderPass-initialLayout-00896", + "text": " If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, or VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL then the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set" + } + ], + "(VK_VERSION_1_1,VK_KHR_maintenance2)": [ + { + "vuid": "VUID-vkCmdBeginRenderPass-initialLayout-01758", + "text": " If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, or VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL then the corresponding attachment image subresource of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set" + } + ] + }, + "VkRenderPassBeginInfo": { + "core": [ + { + "vuid": "VUID-VkRenderPassBeginInfo-clearValueCount-00902", + "text": " clearValueCount must be greater than the largest attachment index in renderPass that specifies a loadOp (or stencilLoadOp, if the attachment has a depth/stencil format) of VK_ATTACHMENT_LOAD_OP_CLEAR" + }, + { + "vuid": "VUID-VkRenderPassBeginInfo-clearValueCount-00903", + "text": " If clearValueCount is not 0, pClearValues must be a valid pointer to an array of clearValueCount valid VkClearValue unions" + }, + { + "vuid": "VUID-VkRenderPassBeginInfo-renderPass-00904", + "text": " renderPass must be &amp;lt;&amp;lt;renderpass-compatibility,compatible&amp;gt;&amp;gt; with the renderPass member of the VkFramebufferCreateInfo structure specified when creating framebuffer." + }, + { + "vuid": "VUID-VkRenderPassBeginInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO" + }, + { + "vuid": "VUID-VkRenderPassBeginInfo-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDeviceGroupRenderPassBeginInfo or VkRenderPassSampleLocationsBeginInfoEXT" + }, + { + "vuid": "VUID-VkRenderPassBeginInfo-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + }, + { + "vuid": "VUID-VkRenderPassBeginInfo-renderPass-parameter", + "text": " renderPass must be a valid VkRenderPass handle" + }, + { + "vuid": "VUID-VkRenderPassBeginInfo-framebuffer-parameter", + "text": " framebuffer must be a valid VkFramebuffer handle" + }, + { + "vuid": "VUID-VkRenderPassBeginInfo-commonparent", + "text": " Both of framebuffer, and renderPass must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "VkRenderPassSampleLocationsBeginInfoEXT": { + "(VK_EXT_sample_locations)": [ + { + "vuid": "VUID-VkRenderPassSampleLocationsBeginInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT" + }, + { + "vuid": "VUID-VkRenderPassSampleLocationsBeginInfoEXT-pAttachmentInitialSampleLocations-parameter", + "text": " If attachmentInitialSampleLocationsCount is not 0, pAttachmentInitialSampleLocations must be a valid pointer to an array of attachmentInitialSampleLocationsCount valid VkAttachmentSampleLocationsEXT structures" + }, + { + "vuid": "VUID-VkRenderPassSampleLocationsBeginInfoEXT-pPostSubpassSampleLocations-parameter", + "text": " If postSubpassSampleLocationsCount is not 0, pPostSubpassSampleLocations must be a valid pointer to an array of postSubpassSampleLocationsCount valid VkSubpassSampleLocationsEXT structures" + } + ] + }, + "VkAttachmentSampleLocationsEXT": { + "(VK_EXT_sample_locations)": [ + { + "vuid": "VUID-VkAttachmentSampleLocationsEXT-attachmentIndex-01531", + "text": " attachmentIndex must be less than the attachmentCount specified in VkRenderPassCreateInfo the render pass specified by VkRenderPassBeginInfo::renderPass was created with" + }, + { + "vuid": "VUID-VkAttachmentSampleLocationsEXT-sampleLocationsInfo-parameter", + "text": " sampleLocationsInfo must be a valid VkSampleLocationsInfoEXT structure" + } + ] + }, + "VkSubpassSampleLocationsEXT": { + "(VK_EXT_sample_locations)": [ + { + "vuid": "VUID-VkSubpassSampleLocationsEXT-subpassIndex-01532", + "text": " subpassIndex must be less than the subpassCount specified in VkRenderPassCreateInfo the render pass specified by VkRenderPassBeginInfo::renderPass was created with" + }, + { + "vuid": "VUID-VkSubpassSampleLocationsEXT-sampleLocationsInfo-parameter", + "text": " sampleLocationsInfo must be a valid VkSampleLocationsInfoEXT structure" + } + ] + }, + "VkDeviceGroupRenderPassBeginInfo": { + "(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-VkDeviceGroupRenderPassBeginInfo-deviceMask-00905", + "text": " deviceMask must be a valid device mask value" + }, + { + "vuid": "VUID-VkDeviceGroupRenderPassBeginInfo-deviceMask-00906", + "text": " deviceMask must not be zero" + }, + { + "vuid": "VUID-VkDeviceGroupRenderPassBeginInfo-deviceMask-00907", + "text": " deviceMask must be a subset of the command buffer’s initial device mask" + }, + { + "vuid": "VUID-VkDeviceGroupRenderPassBeginInfo-deviceRenderAreaCount-00908", + "text": " deviceRenderAreaCount must either be zero or equal to the number of physical devices in the logical device." + }, + { + "vuid": "VUID-VkDeviceGroupRenderPassBeginInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO" + }, + { + "vuid": "VUID-VkDeviceGroupRenderPassBeginInfo-pDeviceRenderAreas-parameter", + "text": " If deviceRenderAreaCount is not 0, pDeviceRenderAreas must be a valid pointer to an array of deviceRenderAreaCount VkRect2D structures" + } + ] + }, + "vkGetRenderAreaGranularity": { + "core": [ + { + "vuid": "VUID-vkGetRenderAreaGranularity-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetRenderAreaGranularity-renderPass-parameter", + "text": " renderPass must be a valid VkRenderPass handle" + }, + { + "vuid": "VUID-vkGetRenderAreaGranularity-pGranularity-parameter", + "text": " pGranularity must be a valid pointer to a VkExtent2D structure" + }, + { + "vuid": "VUID-vkGetRenderAreaGranularity-renderPass-parent", + "text": " renderPass must have been created, allocated, or retrieved from device" + } + ] + }, + "vkCmdNextSubpass": { + "core": [ + { + "vuid": "VUID-vkCmdNextSubpass-None-00909", + "text": " The current subpass index must be less than the number of subpasses in the render pass minus one" + }, + { + "vuid": "VUID-vkCmdNextSubpass-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdNextSubpass-contents-parameter", + "text": " contents must be a valid VkSubpassContents value" + }, + { + "vuid": "VUID-vkCmdNextSubpass-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdNextSubpass-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdNextSubpass-renderpass", + "text": " This command must only be called inside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdNextSubpass-bufferlevel", + "text": " commandBuffer must be a primary VkCommandBuffer" + } + ] + }, + "vkCmdEndRenderPass": { + "core": [ + { + "vuid": "VUID-vkCmdEndRenderPass-None-00910", + "text": " The current subpass index must be equal to the number of subpasses in the render pass minus one" + }, + { + "vuid": "VUID-vkCmdEndRenderPass-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdEndRenderPass-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdEndRenderPass-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdEndRenderPass-renderpass", + "text": " This command must only be called inside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdEndRenderPass-bufferlevel", + "text": " commandBuffer must be a primary VkCommandBuffer" + } + ] + }, + "vkCreateShaderModule": { + "core": [ + { + "vuid": "VUID-vkCreateShaderModule-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateShaderModule-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkShaderModuleCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateShaderModule-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateShaderModule-pShaderModule-parameter", + "text": " pShaderModule must be a valid pointer to a VkShaderModule handle" + } + ] + }, + "VkShaderModuleCreateInfo": { + "core": [ + { + "vuid": "VUID-VkShaderModuleCreateInfo-codeSize-01085", + "text": " codeSize must be greater than 0" + }, + { + "vuid": "VUID-VkShaderModuleCreateInfo-pCode-01089", + "text": " pCode must declare the Shader capability for SPIR-V code" + }, + { + "vuid": "VUID-VkShaderModuleCreateInfo-pCode-01090", + "text": " pCode must not declare any capability that is not supported by the API, as described by the &amp;lt;&amp;lt;spirvenv-module-validation, Capabilities&amp;gt;&amp;gt; section of the &amp;lt;&amp;lt;spirvenv-capabilities,SPIR-V Environment&amp;gt;&amp;gt; appendix" + }, + { + "vuid": "VUID-VkShaderModuleCreateInfo-pCode-01091", + "text": " If pCode declares any of the capabilities listed as optional in the &amp;lt;&amp;lt;spirvenv-capabilities-table,SPIR-V Environment&amp;gt;&amp;gt; appendix, the corresponding feature(s) must be enabled." + }, + { + "vuid": "VUID-VkShaderModuleCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO" + }, + { + "vuid": "VUID-VkShaderModuleCreateInfo-pNext-pNext", + "text": " pNext must be NULL or a pointer to a valid instance of VkShaderModuleValidationCacheCreateInfoEXT" + }, + { + "vuid": "VUID-VkShaderModuleCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkShaderModuleCreateInfo-pCode-parameter", + "text": " pCode must be a valid pointer to an array of \\(codeSize \\over 4\\) uint32_t values" + } + ], + "!(VK_NV_glsl_shader)": [ + { + "vuid": "VUID-VkShaderModuleCreateInfo-codeSize-01086", + "text": " codeSize must be a multiple of 4" + }, + { + "vuid": "VUID-VkShaderModuleCreateInfo-pCode-01087", + "text": " pCode must point to valid SPIR-V code, formatted and packed as described by the &amp;lt;&amp;lt;spirv-spec,Khronos SPIR-V Specification&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-VkShaderModuleCreateInfo-pCode-01088", + "text": " pCode must adhere to the validation rules described by the &amp;lt;&amp;lt;spirvenv-module-validation, Validation Rules within a Module&amp;gt;&amp;gt; section of the &amp;lt;&amp;lt;spirvenv-capabilities,SPIR-V Environment&amp;gt;&amp;gt; appendix" + } + ], + "(VK_NV_glsl_shader)": [ + { + "vuid": "VUID-VkShaderModuleCreateInfo-pCode-01376", + "text": " If pCode points to SPIR-V code, codeSize must be a multiple of 4" + }, + { + "vuid": "VUID-VkShaderModuleCreateInfo-pCode-01377", + "text": " pCode must point to either valid SPIR-V code, formatted and packed as described by the Khronos SPIR-V Specification or valid GLSL code which must be written to the GL_KHR_vulkan_glsl extension specification" + }, + { + "vuid": "VUID-VkShaderModuleCreateInfo-pCode-01378", + "text": " If pCode points to SPIR-V code, that code must adhere to the validation rules described by the &amp;lt;&amp;lt;spirvenv-module-validation, Validation Rules within a Module&amp;gt;&amp;gt; section of the &amp;lt;&amp;lt;spirvenv-capabilities,SPIR-V Environment&amp;gt;&amp;gt; appendix" + }, + { + "vuid": "VUID-VkShaderModuleCreateInfo-pCode-01379", + "text": " If pCode points to GLSL code, it must be valid GLSL code written to the GL_KHR_vulkan_glsl GLSL extension specification" + } + ] + }, + "VkShaderModuleValidationCacheCreateInfoEXT": { + "(VK_EXT_validation_cache)": [ + { + "vuid": "VUID-VkShaderModuleValidationCacheCreateInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT" + }, + { + "vuid": "VUID-VkShaderModuleValidationCacheCreateInfoEXT-validationCache-parameter", + "text": " validationCache must be a valid VkValidationCacheEXT handle" + } + ] + }, + "vkDestroyShaderModule": { + "core": [ + { + "vuid": "VUID-vkDestroyShaderModule-shaderModule-01092", + "text": " If VkAllocationCallbacks were provided when shaderModule was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyShaderModule-shaderModule-01093", + "text": " If no VkAllocationCallbacks were provided when shaderModule was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyShaderModule-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyShaderModule-shaderModule-parameter", + "text": " If shaderModule is not VK_NULL_HANDLE, shaderModule must be a valid VkShaderModule handle" + }, + { + "vuid": "VUID-vkDestroyShaderModule-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyShaderModule-shaderModule-parent", + "text": " If shaderModule is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkCreateValidationCacheEXT": { + "(VK_EXT_validation_cache)": [ + { + "vuid": "VUID-vkCreateValidationCacheEXT-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateValidationCacheEXT-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkValidationCacheCreateInfoEXT structure" + }, + { + "vuid": "VUID-vkCreateValidationCacheEXT-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateValidationCacheEXT-pValidationCache-parameter", + "text": " pValidationCache must be a valid pointer to a VkValidationCacheEXT handle" + } + ] + }, + "VkValidationCacheCreateInfoEXT": { + "(VK_EXT_validation_cache)": [ + { + "vuid": "VUID-VkValidationCacheCreateInfoEXT-initialDataSize-01534", + "text": " If initialDataSize is not 0, it must be equal to the size of pInitialData, as returned by vkGetValidationCacheDataEXT when pInitialData was originally retrieved" + }, + { + "vuid": "VUID-VkValidationCacheCreateInfoEXT-initialDataSize-01535", + "text": " If initialDataSize is not 0, pInitialData must have been retrieved from a previous call to vkGetValidationCacheDataEXT" + }, + { + "vuid": "VUID-VkValidationCacheCreateInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT" + }, + { + "vuid": "VUID-VkValidationCacheCreateInfoEXT-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkValidationCacheCreateInfoEXT-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkValidationCacheCreateInfoEXT-pInitialData-parameter", + "text": " If initialDataSize is not 0, pInitialData must be a valid pointer to an array of initialDataSize bytes" + } + ] + }, + "vkMergeValidationCachesEXT": { + "(VK_EXT_validation_cache)": [ + { + "vuid": "VUID-vkMergeValidationCachesEXT-dstCache-01536", + "text": " dstCache must not appear in the list of source caches" + }, + { + "vuid": "VUID-vkMergeValidationCachesEXT-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkMergeValidationCachesEXT-dstCache-parameter", + "text": " dstCache must be a valid VkValidationCacheEXT handle" + }, + { + "vuid": "VUID-vkMergeValidationCachesEXT-pSrcCaches-parameter", + "text": " pSrcCaches must be a valid pointer to an array of srcCacheCount valid VkValidationCacheEXT handles" + }, + { + "vuid": "VUID-vkMergeValidationCachesEXT-srcCacheCount-arraylength", + "text": " srcCacheCount must be greater than 0" + }, + { + "vuid": "VUID-vkMergeValidationCachesEXT-dstCache-parent", + "text": " dstCache must have been created, allocated, or retrieved from device" + }, + { + "vuid": "VUID-vkMergeValidationCachesEXT-pSrcCaches-parent", + "text": " Each element of pSrcCaches must have been created, allocated, or retrieved from device" + } + ] + }, + "vkGetValidationCacheDataEXT": { + "(VK_EXT_validation_cache)": [ + { + "vuid": "VUID-vkGetValidationCacheDataEXT-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetValidationCacheDataEXT-validationCache-parameter", + "text": " validationCache must be a valid VkValidationCacheEXT handle" + }, + { + "vuid": "VUID-vkGetValidationCacheDataEXT-pDataSize-parameter", + "text": " pDataSize must be a valid pointer to a size_t value" + }, + { + "vuid": "VUID-vkGetValidationCacheDataEXT-pData-parameter", + "text": " If the value referenced by pDataSize is not 0, and pData is not NULL, pData must be a valid pointer to an array of pDataSize bytes" + }, + { + "vuid": "VUID-vkGetValidationCacheDataEXT-validationCache-parent", + "text": " validationCache must have been created, allocated, or retrieved from device" + } + ] + }, + "vkDestroyValidationCacheEXT": { + "(VK_EXT_validation_cache)": [ + { + "vuid": "VUID-vkDestroyValidationCacheEXT-validationCache-01537", + "text": " If VkAllocationCallbacks were provided when validationCache was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyValidationCacheEXT-validationCache-01538", + "text": " If no VkAllocationCallbacks were provided when validationCache was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyValidationCacheEXT-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyValidationCacheEXT-validationCache-parameter", + "text": " If validationCache is not VK_NULL_HANDLE, validationCache must be a valid VkValidationCacheEXT handle" + }, + { + "vuid": "VUID-vkDestroyValidationCacheEXT-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyValidationCacheEXT-validationCache-parent", + "text": " If validationCache is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkCreateComputePipelines": { + "core": [ + { + "vuid": "VUID-vkCreateComputePipelines-flags-00695", + "text": " If the flags member of any element of pCreateInfos contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and the basePipelineIndex member of that same element is not -1, basePipelineIndex must be less than the index into pCreateInfos that corresponds to that element" + }, + { + "vuid": "VUID-vkCreateComputePipelines-flags-00696", + "text": " If the flags member of any element of pCreateInfos contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, the base pipeline must have been created with the VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag set" + }, + { + "vuid": "VUID-vkCreateComputePipelines-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateComputePipelines-pipelineCache-parameter", + "text": " If pipelineCache is not VK_NULL_HANDLE, pipelineCache must be a valid VkPipelineCache handle" + }, + { + "vuid": "VUID-vkCreateComputePipelines-pCreateInfos-parameter", + "text": " pCreateInfos must be a valid pointer to an array of createInfoCount valid VkComputePipelineCreateInfo structures" + }, + { + "vuid": "VUID-vkCreateComputePipelines-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateComputePipelines-pPipelines-parameter", + "text": " pPipelines must be a valid pointer to an array of createInfoCount VkPipeline handles" + }, + { + "vuid": "VUID-vkCreateComputePipelines-createInfoCount-arraylength", + "text": " createInfoCount must be greater than 0" + }, + { + "vuid": "VUID-vkCreateComputePipelines-pipelineCache-parent", + "text": " If pipelineCache is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "VkComputePipelineCreateInfo": { + "core": [ + { + "vuid": "VUID-VkComputePipelineCreateInfo-flags-00697", + "text": " If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineIndex is -1, basePipelineHandle must be a valid handle to a compute VkPipeline" + }, + { + "vuid": "VUID-VkComputePipelineCreateInfo-flags-00698", + "text": " If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineHandle is VK_NULL_HANDLE, basePipelineIndex must be a valid index into the calling command’s pCreateInfos parameter" + }, + { + "vuid": "VUID-VkComputePipelineCreateInfo-flags-00699", + "text": " If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineIndex is not -1, basePipelineHandle must be VK_NULL_HANDLE" + }, + { + "vuid": "VUID-VkComputePipelineCreateInfo-flags-00700", + "text": " If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineHandle is not VK_NULL_HANDLE, basePipelineIndex must be -1" + }, + { + "vuid": "VUID-VkComputePipelineCreateInfo-stage-00701", + "text": " The stage member of stage must be VK_SHADER_STAGE_COMPUTE_BIT" + }, + { + "vuid": "VUID-VkComputePipelineCreateInfo-stage-00702", + "text": " The shader code for the entry point identified by stage and the rest of the state identified by this structure must adhere to the pipeline linking rules described in the &amp;lt;&amp;lt;interfaces,Shader Interfaces&amp;gt;&amp;gt; chapter" + }, + { + "vuid": "VUID-VkComputePipelineCreateInfo-layout-00703", + "text": " layout must be &amp;lt;&amp;lt;descriptorsets-pipelinelayout-consistency,consistent&amp;gt;&amp;gt; with the layout of the compute shader specified in stage" + }, + { + "vuid": "VUID-VkComputePipelineCreateInfo-layout-01687", + "text": " The number of resources in layout accessible to the compute shader stage must be less than or equal to VkPhysicalDeviceLimits::maxPerStageResources" + }, + { + "vuid": "VUID-VkComputePipelineCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO" + }, + { + "vuid": "VUID-VkComputePipelineCreateInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkComputePipelineCreateInfo-flags-parameter", + "text": " flags must be a valid combination of VkPipelineCreateFlagBits values" + }, + { + "vuid": "VUID-VkComputePipelineCreateInfo-stage-parameter", + "text": " stage must be a valid VkPipelineShaderStageCreateInfo structure" + }, + { + "vuid": "VUID-VkComputePipelineCreateInfo-layout-parameter", + "text": " layout must be a valid VkPipelineLayout handle" + }, + { + "vuid": "VUID-VkComputePipelineCreateInfo-commonparent", + "text": " Both of basePipelineHandle, and layout that are valid handles must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "VkPipelineShaderStageCreateInfo": { + "core": [ + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-stage-00704", + "text": " If the &amp;lt;&amp;lt;features-features-geometryShader,geometry shaders&amp;gt;&amp;gt; feature is not enabled, stage must not be VK_SHADER_STAGE_GEOMETRY_BIT" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-stage-00705", + "text": " If the &amp;lt;&amp;lt;features-features-tessellationShader,tessellation shaders&amp;gt;&amp;gt; feature is not enabled, stage must not be VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT or VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-stage-00706", + "text": " stage must not be VK_SHADER_STAGE_ALL_GRAPHICS, or VK_SHADER_STAGE_ALL" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-pName-00707", + "text": " pName must be the name of an OpEntryPoint in module with an execution model that matches stage" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-maxClipDistances-00708", + "text": " If the identified entry point includes any variable in its interface that is declared with the ClipDistance BuiltIn decoration, that variable must not have an array size greater than VkPhysicalDeviceLimits::maxClipDistances" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-maxCullDistances-00709", + "text": " If the identified entry point includes any variable in its interface that is declared with the CullDistance BuiltIn decoration, that variable must not have an array size greater than VkPhysicalDeviceLimits::maxCullDistances" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-maxCombinedClipAndCullDistances-00710", + "text": " If the identified entry point includes any variables in its interface that are declared with the ClipDistance or CullDistance BuiltIn decoration, those variables must not have array sizes which sum to more than VkPhysicalDeviceLimits::maxCombinedClipAndCullDistances" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-maxSampleMaskWords-00711", + "text": " If the identified entry point includes any variable in its interface that is declared with the SampleMask BuiltIn decoration, that variable must not have an array size greater than VkPhysicalDeviceLimits::maxSampleMaskWords" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-stage-00712", + "text": " If stage is VK_SHADER_STAGE_VERTEX_BIT, the identified entry point must not include any input variable in its interface that is decorated with CullDistance" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-stage-00713", + "text": " If stage is VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT or VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, and the identified entry point has an OpExecutionMode instruction that specifies a patch size with OutputVertices, the patch size must be greater than 0 and less than or equal to VkPhysicalDeviceLimits::maxTessellationPatchSize" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-stage-00714", + "text": " If stage is VK_SHADER_STAGE_GEOMETRY_BIT, the identified entry point must have an OpExecutionMode instruction that specifies a maximum output vertex count that is greater than 0 and less than or equal to VkPhysicalDeviceLimits::maxGeometryOutputVertices" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-stage-00715", + "text": " If stage is VK_SHADER_STAGE_GEOMETRY_BIT, the identified entry point must have an OpExecutionMode instruction that specifies an invocation count that is greater than 0 and less than or equal to VkPhysicalDeviceLimits::maxGeometryShaderInvocations" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-stage-00716", + "text": " If stage is VK_SHADER_STAGE_GEOMETRY_BIT, and the identified entry point writes to Layer for any primitive, it must write the same value to Layer for all vertices of a given primitive" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-stage-00717", + "text": " If stage is VK_SHADER_STAGE_GEOMETRY_BIT, and the identified entry point writes to ViewportIndex for any primitive, it must write the same value to ViewportIndex for all vertices of a given primitive" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-stage-00718", + "text": " If stage is VK_SHADER_STAGE_FRAGMENT_BIT, the identified entry point must not include any output variables in its interface decorated with CullDistance" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-stage-00719", + "text": " If stage is VK_SHADER_STAGE_FRAGMENT_BIT, and the identified entry point writes to FragDepth in any execution path, it must write to FragDepth in all execution paths" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-stage-parameter", + "text": " stage must be a valid VkShaderStageFlagBits value" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-module-parameter", + "text": " module must be a valid VkShaderModule handle" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-pName-parameter", + "text": " pName must be a null-terminated UTF-8 string" + }, + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-pSpecializationInfo-parameter", + "text": " If pSpecializationInfo is not NULL, pSpecializationInfo must be a valid pointer to a valid VkSpecializationInfo structure" + } + ], + "(VK_EXT_shader_stencil_export)": [ + { + "vuid": "VUID-VkPipelineShaderStageCreateInfo-stage-01511", + "text": " If stage is VK_SHADER_STAGE_FRAGMENT_BIT, and the identified entry point writes to FragStencilRefEXT in any execution path, it must write to FragStencilRefEXT in all execution paths" + } + ] + }, + "vkCreateGraphicsPipelines": { + "core": [ + { + "vuid": "VUID-vkCreateGraphicsPipelines-flags-00720", + "text": " If the flags member of any element of pCreateInfos contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and the basePipelineIndex member of that same element is not -1, basePipelineIndex must be less than the index into pCreateInfos that corresponds to that element" + }, + { + "vuid": "VUID-vkCreateGraphicsPipelines-flags-00721", + "text": " If the flags member of any element of pCreateInfos contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, the base pipeline must have been created with the VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag set" + }, + { + "vuid": "VUID-vkCreateGraphicsPipelines-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateGraphicsPipelines-pipelineCache-parameter", + "text": " If pipelineCache is not VK_NULL_HANDLE, pipelineCache must be a valid VkPipelineCache handle" + }, + { + "vuid": "VUID-vkCreateGraphicsPipelines-pCreateInfos-parameter", + "text": " pCreateInfos must be a valid pointer to an array of createInfoCount valid VkGraphicsPipelineCreateInfo structures" + }, + { + "vuid": "VUID-vkCreateGraphicsPipelines-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateGraphicsPipelines-pPipelines-parameter", + "text": " pPipelines must be a valid pointer to an array of createInfoCount VkPipeline handles" + }, + { + "vuid": "VUID-vkCreateGraphicsPipelines-createInfoCount-arraylength", + "text": " createInfoCount must be greater than 0" + }, + { + "vuid": "VUID-vkCreateGraphicsPipelines-pipelineCache-parent", + "text": " If pipelineCache is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "VkGraphicsPipelineCreateInfo": { + "core": [ + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-flags-00722", + "text": " If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineIndex is -1, basePipelineHandle must be a valid handle to a graphics VkPipeline" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-flags-00723", + "text": " If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineHandle is VK_NULL_HANDLE, basePipelineIndex must be a valid index into the calling command’s pCreateInfos parameter" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-flags-00724", + "text": " If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineIndex is not -1, basePipelineHandle must be VK_NULL_HANDLE" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-flags-00725", + "text": " If flags contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineHandle is not VK_NULL_HANDLE, basePipelineIndex must be -1" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-stage-00726", + "text": " The stage member of each element of pStages must be unique" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-stage-00727", + "text": " The stage member of one element of pStages must be VK_SHADER_STAGE_VERTEX_BIT" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-stage-00728", + "text": " The stage member of each element of pStages must not be VK_SHADER_STAGE_COMPUTE_BIT" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pStages-00729", + "text": " If pStages includes a tessellation control shader stage, it must include a tessellation evaluation shader stage" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pStages-00730", + "text": " If pStages includes a tessellation evaluation shader stage, it must include a tessellation control shader stage" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pStages-00731", + "text": " If pStages includes a tessellation control shader stage and a tessellation evaluation shader stage, pTessellationState must be a valid pointer to a valid VkPipelineTessellationStateCreateInfo structure" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pStages-00732", + "text": " If pStages includes tessellation shader stages, the shader code of at least one stage must contain an OpExecutionMode instruction that specifies the type of subdivision in the pipeline" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pStages-00733", + "text": " If pStages includes tessellation shader stages, and the shader code of both stages contain an OpExecutionMode instruction that specifies the type of subdivision in the pipeline, they must both specify the same subdivision mode" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pStages-00734", + "text": " If pStages includes tessellation shader stages, the shader code of at least one stage must contain an OpExecutionMode instruction that specifies the output patch size in the pipeline" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pStages-00735", + "text": " If pStages includes tessellation shader stages, and the shader code of both contain an OpExecutionMode instruction that specifies the out patch size in the pipeline, they must both specify the same patch size" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pStages-00736", + "text": " If pStages includes tessellation shader stages, the topology member of pInputAssembly must be VK_PRIMITIVE_TOPOLOGY_PATCH_LIST" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-topology-00737", + "text": " If the topology member of pInputAssembly is VK_PRIMITIVE_TOPOLOGY_PATCH_LIST, pStages must include tessellation shader stages" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pStages-00738", + "text": " If pStages includes a geometry shader stage, and does not include any tessellation shader stages, its shader code must contain an OpExecutionMode instruction that specifies an input primitive type that is &amp;lt;&amp;lt;shaders-geometry-execution, compatible&amp;gt;&amp;gt; with the primitive topology specified in pInputAssembly" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pStages-00739", + "text": " If pStages includes a geometry shader stage, and also includes tessellation shader stages, its shader code must contain an OpExecutionMode instruction that specifies an input primitive type that is &amp;lt;&amp;lt;shaders-geometry-execution, compatible&amp;gt;&amp;gt; with the primitive topology that is output by the tessellation stages" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pStages-00740", + "text": " If pStages includes a fragment shader stage and a geometry shader stage, and the fragment shader code reads from an input variable that is decorated with PrimitiveID, then the geometry shader code must write to a matching output variable, decorated with PrimitiveID, in all execution paths" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pStages-00741", + "text": " If pStages includes a fragment shader stage, its shader code must not read from any input attachment that is defined as VK_ATTACHMENT_UNUSED in subpass" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pStages-00742", + "text": " The shader code for the entry points identified by pStages, and the rest of the state identified by this structure must adhere to the pipeline linking rules described in the &amp;lt;&amp;lt;interfaces,Shader Interfaces&amp;gt;&amp;gt; chapter" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-subpass-00745", + "text": " If rasterization is not disabled and the subpass uses color attachments, then for each color attachment in the subpass the blendEnable member of the corresponding element of the pAttachment member of pColorBlendState must be VK_FALSE if the format of the attachment does not support color blend operations, as specified by the VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT flag in VkFormatProperties::linearTilingFeatures or VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-attachmentCount-00746", + "text": " If rasterization is not disabled and the subpass uses color attachments, the attachmentCount member of pColorBlendState must be equal to the colorAttachmentCount used to create subpass" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00747", + "text": " If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_VIEWPORT, the pViewports member of pViewportState must be a valid pointer to an array of pViewportState::viewportCount VkViewport structures" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00748", + "text": " If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_SCISSOR, the pScissors member of pViewportState must be a valid pointer to an array of pViewportState::scissorCount VkRect2D structures" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00749", + "text": " If the wide lines feature is not enabled, and no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_LINE_WIDTH, the lineWidth member of pRasterizationState must be 1.0" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00750", + "text": " If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, pViewportState must be a valid pointer to a valid VkPipelineViewportStateCreateInfo structure" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00751", + "text": " If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, pMultisampleState must be a valid pointer to a valid VkPipelineMultisampleStateCreateInfo structure" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00752", + "text": " If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, and subpass uses a depth/stencil attachment, pDepthStencilState must be a valid pointer to a valid VkPipelineDepthStencilStateCreateInfo structure" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00753", + "text": " If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, and subpass uses color attachments, pColorBlendState must be a valid pointer to a valid VkPipelineColorBlendStateCreateInfo structure" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00754", + "text": " If the depth bias clamping feature is not enabled, no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_DEPTH_BIAS, and the depthBiasEnable member of pRasterizationState is VK_TRUE, the depthBiasClamp member of pRasterizationState must be 0.0" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-layout-00756", + "text": " layout must be &amp;lt;&amp;lt;descriptorsets-pipelinelayout-consistency,consistent&amp;gt;&amp;gt; with all shaders specified in pStages" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-subpass-00758", + "text": " If subpass does not use any color and/or depth/stencil attachments, then the rasterizationSamples member of pMultisampleState must follow the rules for a &amp;lt;&amp;lt;renderpass-noattachments, zero-attachment subpass&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-subpass-00759", + "text": " subpass must be a valid subpass within renderPass" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-layout-01688", + "text": " The number of resources in layout accessible to each shader stage that is used by the pipeline must be less than or equal to VkPhysicalDeviceLimits::maxPerStageResources" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pNext-pNext", + "text": " pNext must be NULL or a pointer to a valid instance of VkPipelineDiscardRectangleStateCreateInfoEXT" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-flags-parameter", + "text": " flags must be a valid combination of VkPipelineCreateFlagBits values" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pStages-parameter", + "text": " pStages must be a valid pointer to an array of stageCount valid VkPipelineShaderStageCreateInfo structures" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pVertexInputState-parameter", + "text": " pVertexInputState must be a valid pointer to a valid VkPipelineVertexInputStateCreateInfo structure" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pInputAssemblyState-parameter", + "text": " pInputAssemblyState must be a valid pointer to a valid VkPipelineInputAssemblyStateCreateInfo structure" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pRasterizationState-parameter", + "text": " pRasterizationState must be a valid pointer to a valid VkPipelineRasterizationStateCreateInfo structure" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pDynamicState-parameter", + "text": " If pDynamicState is not NULL, pDynamicState must be a valid pointer to a valid VkPipelineDynamicStateCreateInfo structure" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-layout-parameter", + "text": " layout must be a valid VkPipelineLayout handle" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-renderPass-parameter", + "text": " renderPass must be a valid VkRenderPass handle" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-stageCount-arraylength", + "text": " stageCount must be greater than 0" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-commonparent", + "text": " Each of basePipelineHandle, layout, and renderPass that are valid handles must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "!(VK_VERSION_1_1,VK_KHR_maintenance2)": [ + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-subpass-00743", + "text": " If rasterization is not disabled and subpass uses a depth/stencil attachment in renderPass that has a layout of VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL in the VkAttachmentReference defined by subpass, the depthWriteEnable member of pDepthStencilState must be VK_FALSE" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-subpass-00744", + "text": " If rasterization is not disabled and subpass uses a depth/stencil attachment in renderPass that has a layout of VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL in the VkAttachmentReference defined by subpass, the failOp, passOp and depthFailOp members of each of the front and back members of pDepthStencilState must be VK_STENCIL_OP_KEEP" + } + ], + "(VK_VERSION_1_1,VK_KHR_maintenance2)": [ + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-subpass-01756", + "text": " If rasterization is not disabled and subpass uses a depth/stencil attachment in renderPass that has a layout of VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL or VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL in the VkAttachmentReference defined by subpass, the depthWriteEnable member of pDepthStencilState must be VK_FALSE" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-subpass-01757", + "text": " If rasterization is not disabled and subpass uses a depth/stencil attachment in renderPass that has a layout of VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL or VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL in the VkAttachmentReference defined by subpass, the failOp, passOp and depthFailOp members of each of the front and back members of pDepthStencilState must be VK_STENCIL_OP_KEEP" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pStages-01565", + "text": " If pStages includes a fragment shader stage and an input attachment was referenced by the VkRenderPassInputAttachmentAspectCreateInfo at renderPass create time, its shader code must not read from any aspect that was not specified in the aspectMask of the corresponding VkInputAttachmentAspectReference structure." + } + ], + "!(VK_EXT_depth_range_unrestricted)": [ + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00755", + "text": " If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_DEPTH_BOUNDS, and the depthBoundsTestEnable member of pDepthStencilState is VK_TRUE, the minDepthBounds and maxDepthBounds members of pDepthStencilState must be between 0.0 and 1.0, inclusive" + } + ], + "(VK_EXT_depth_range_unrestricted)": [ + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00755", + "text": " If the VK_EXT_depth_range_unrestricted extension is not enabled and no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_DEPTH_BOUNDS, and the depthBoundsTestEnable member of pDepthStencilState is VK_TRUE, the minDepthBounds and maxDepthBounds members of pDepthStencilState must be between 0.0 and 1.0, inclusive" + } + ], + "(VK_EXT_sample_locations)": [ + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01521", + "text": " If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, and the sampleLocationsEnable member of a VkPipelineSampleLocationsStateCreateInfoEXT structure chained to the pNext chain of pMultisampleState is VK_TRUE, sampleLocationsInfo.sampleLocationGridSize.width must evenly divide VkMultisamplePropertiesEXT::sampleLocationGridSize.width as returned by vkGetPhysicalDeviceMultisamplePropertiesEXT with a samples parameter equaling rasterizationSamples" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01522", + "text": " If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, and the sampleLocationsEnable member of a VkPipelineSampleLocationsStateCreateInfoEXT structure chained to the pNext chain of pMultisampleState is VK_TRUE, sampleLocationsInfo.sampleLocationGridSize.height must evenly divide VkMultisamplePropertiesEXT::sampleLocationGridSize.height as returned by vkGetPhysicalDeviceMultisamplePropertiesEXT with a samples parameter equaling rasterizationSamples" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01523", + "text": " If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, and the sampleLocationsEnable member of a VkPipelineSampleLocationsStateCreateInfoEXT structure chained to the pNext chain of pMultisampleState is VK_TRUE, sampleLocationsInfo.sampleLocationsPerPixel must equal rasterizationSamples" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-sampleLocationsEnable-01524", + "text": " If the sampleLocationsEnable member of a VkPipelineSampleLocationsStateCreateInfoEXT structure chained to the pNext chain of pMultisampleState is VK_TRUE, the fragment shader code must not statically use the extended instruction InterpolateAtSample" + } + ], + "!(VK_AMD_mixed_attachment_samples)+!(VK_NV_framebuffer_mixed_samples)": [ + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-subpass-00757", + "text": " If subpass uses color and/or depth/stencil attachments, then the rasterizationSamples member of pMultisampleState must be the same as the sample count for those subpass attachments" + } + ], + "(VK_AMD_mixed_attachment_samples)": [ + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-subpass-01505", + "text": " If subpass uses color and/or depth/stencil attachments, then the rasterizationSamples member of pMultisampleState must equal the maximum of the sample counts of those subpass attachments" + } + ], + "(VK_NV_framebuffer_mixed_samples)": [ + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-subpass-01411", + "text": " If subpass has a depth/stencil attachment and depth test, stencil test, or depth bounds test are enabled, then the rasterizationSamples member of pMultisampleState must be the same as the sample count of the depth/stencil attachment" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-subpass-01412", + "text": " If subpass has any color attachments, then the rasterizationSamples member of pMultisampleState must be greater than or equal to the sample count for those subpass attachments" + } + ], + "(VK_VERSION_1_1,VK_KHR_multiview)": [ + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-renderPass-00760", + "text": " If the renderPass has multiview enabled and subpass has more than one bit set in the view mask and multiviewTessellationShader is not enabled, then pStages must not include tessellation shaders." + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-renderPass-00761", + "text": " If the renderPass has multiview enabled and subpass has more than one bit set in the view mask and multiviewGeometryShader is not enabled, then pStages must not include a geometry shader." + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-renderPass-00762", + "text": " If the renderPass has multiview enabled and subpass has more than one bit set in the view mask, shaders in the pipeline must not write to the Layer built-in output" + }, + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-renderPass-00763", + "text": " If the renderPass has multiview enabled, then all shaders must not include variables decorated with the Layer built-in decoration in their interfaces." + } + ], + "(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-flags-00764", + "text": " flags must not contain the VK_PIPELINE_CREATE_DISPATCH_BASE flag." + } + ], + "(VK_NV_clip_space_w_scaling)": [ + { + "vuid": "VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01715", + "text": " If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV, and the viewportWScalingEnable member of a VkPipelineViewportWScalingStateCreateInfoNV structure, chained to the pNext chain of pViewportState, is VK_TRUE, the pViewportWScalings member of the VkPipelineViewportWScalingStateCreateInfoNV must be a pointer to an array of VkPipelineViewportWScalingStateCreateInfoNV::viewportCount valid VkViewportWScalingNV structures" + } + ] + }, + "VkPipelineDynamicStateCreateInfo": { + "core": [ + { + "vuid": "VUID-VkPipelineDynamicStateCreateInfo-pDynamicStates-01442", + "text": " Each element of pDynamicStates must be unique" + }, + { + "vuid": "VUID-VkPipelineDynamicStateCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO" + }, + { + "vuid": "VUID-VkPipelineDynamicStateCreateInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkPipelineDynamicStateCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkPipelineDynamicStateCreateInfo-pDynamicStates-parameter", + "text": " pDynamicStates must be a valid pointer to an array of dynamicStateCount valid VkDynamicState values" + }, + { + "vuid": "VUID-VkPipelineDynamicStateCreateInfo-dynamicStateCount-arraylength", + "text": " dynamicStateCount must be greater than 0" + } + ] + }, + "vkDestroyPipeline": { + "core": [ + { + "vuid": "VUID-vkDestroyPipeline-pipeline-00765", + "text": " All submitted commands that refer to pipeline must have completed execution" + }, + { + "vuid": "VUID-vkDestroyPipeline-pipeline-00766", + "text": " If VkAllocationCallbacks were provided when pipeline was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyPipeline-pipeline-00767", + "text": " If no VkAllocationCallbacks were provided when pipeline was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyPipeline-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyPipeline-pipeline-parameter", + "text": " If pipeline is not VK_NULL_HANDLE, pipeline must be a valid VkPipeline handle" + }, + { + "vuid": "VUID-vkDestroyPipeline-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyPipeline-pipeline-parent", + "text": " If pipeline is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkCreatePipelineCache": { + "core": [ + { + "vuid": "VUID-vkCreatePipelineCache-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreatePipelineCache-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkPipelineCacheCreateInfo structure" + }, + { + "vuid": "VUID-vkCreatePipelineCache-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreatePipelineCache-pPipelineCache-parameter", + "text": " pPipelineCache must be a valid pointer to a VkPipelineCache handle" + } + ] + }, + "VkPipelineCacheCreateInfo": { + "core": [ + { + "vuid": "VUID-VkPipelineCacheCreateInfo-initialDataSize-00768", + "text": " If initialDataSize is not 0, it must be equal to the size of pInitialData, as returned by vkGetPipelineCacheData when pInitialData was originally retrieved" + }, + { + "vuid": "VUID-VkPipelineCacheCreateInfo-initialDataSize-00769", + "text": " If initialDataSize is not 0, pInitialData must have been retrieved from a previous call to vkGetPipelineCacheData" + }, + { + "vuid": "VUID-VkPipelineCacheCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO" + }, + { + "vuid": "VUID-VkPipelineCacheCreateInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkPipelineCacheCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkPipelineCacheCreateInfo-pInitialData-parameter", + "text": " If initialDataSize is not 0, pInitialData must be a valid pointer to an array of initialDataSize bytes" + } + ] + }, + "vkMergePipelineCaches": { + "core": [ + { + "vuid": "VUID-vkMergePipelineCaches-dstCache-00770", + "text": " dstCache must not appear in the list of source caches" + }, + { + "vuid": "VUID-vkMergePipelineCaches-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkMergePipelineCaches-dstCache-parameter", + "text": " dstCache must be a valid VkPipelineCache handle" + }, + { + "vuid": "VUID-vkMergePipelineCaches-pSrcCaches-parameter", + "text": " pSrcCaches must be a valid pointer to an array of srcCacheCount valid VkPipelineCache handles" + }, + { + "vuid": "VUID-vkMergePipelineCaches-srcCacheCount-arraylength", + "text": " srcCacheCount must be greater than 0" + }, + { + "vuid": "VUID-vkMergePipelineCaches-dstCache-parent", + "text": " dstCache must have been created, allocated, or retrieved from device" + }, + { + "vuid": "VUID-vkMergePipelineCaches-pSrcCaches-parent", + "text": " Each element of pSrcCaches must have been created, allocated, or retrieved from device" + } + ] + }, + "vkGetPipelineCacheData": { + "core": [ + { + "vuid": "VUID-vkGetPipelineCacheData-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetPipelineCacheData-pipelineCache-parameter", + "text": " pipelineCache must be a valid VkPipelineCache handle" + }, + { + "vuid": "VUID-vkGetPipelineCacheData-pDataSize-parameter", + "text": " pDataSize must be a valid pointer to a size_t value" + }, + { + "vuid": "VUID-vkGetPipelineCacheData-pData-parameter", + "text": " If the value referenced by pDataSize is not 0, and pData is not NULL, pData must be a valid pointer to an array of pDataSize bytes" + }, + { + "vuid": "VUID-vkGetPipelineCacheData-pipelineCache-parent", + "text": " pipelineCache must have been created, allocated, or retrieved from device" + } + ] + }, + "vkDestroyPipelineCache": { + "core": [ + { + "vuid": "VUID-vkDestroyPipelineCache-pipelineCache-00771", + "text": " If VkAllocationCallbacks were provided when pipelineCache was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyPipelineCache-pipelineCache-00772", + "text": " If no VkAllocationCallbacks were provided when pipelineCache was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyPipelineCache-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyPipelineCache-pipelineCache-parameter", + "text": " If pipelineCache is not VK_NULL_HANDLE, pipelineCache must be a valid VkPipelineCache handle" + }, + { + "vuid": "VUID-vkDestroyPipelineCache-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyPipelineCache-pipelineCache-parent", + "text": " If pipelineCache is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "VkSpecializationInfo": { + "core": [ + { + "vuid": "VUID-VkSpecializationInfo-offset-00773", + "text": " The offset member of each element of pMapEntries must be less than dataSize" + }, + { + "vuid": "VUID-VkSpecializationInfo-pMapEntries-00774", + "text": " The size member of each element of pMapEntries must be less than or equal to dataSize minus offset" + }, + { + "vuid": "VUID-VkSpecializationInfo-mapEntryCount-00775", + "text": " If mapEntryCount is not 0, pMapEntries must be a valid pointer to an array of mapEntryCount valid VkSpecializationMapEntry structures" + }, + { + "vuid": "VUID-VkSpecializationInfo-pData-parameter", + "text": " If dataSize is not 0, pData must be a valid pointer to an array of dataSize bytes" + } + ] + }, + "VkSpecializationMapEntry": { + "core": [ + { + "vuid": "VUID-VkSpecializationMapEntry-constantID-00776", + "text": " For a constantID specialization constant declared in a shader, size must match the byte size of the constantID. If the specialization constant is of type boolean, size must be the byte size of VkBool32" + } + ] + }, + "vkCmdBindPipeline": { + "core": [ + { + "vuid": "VUID-vkCmdBindPipeline-pipelineBindPoint-00777", + "text": " If pipelineBindPoint is VK_PIPELINE_BIND_POINT_COMPUTE, the VkCommandPool that commandBuffer was allocated from must support compute operations" + }, + { + "vuid": "VUID-vkCmdBindPipeline-pipelineBindPoint-00778", + "text": " If pipelineBindPoint is VK_PIPELINE_BIND_POINT_GRAPHICS, the VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdBindPipeline-pipelineBindPoint-00779", + "text": " If pipelineBindPoint is VK_PIPELINE_BIND_POINT_COMPUTE, pipeline must be a compute pipeline" + }, + { + "vuid": "VUID-vkCmdBindPipeline-pipelineBindPoint-00780", + "text": " If pipelineBindPoint is VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline must be a graphics pipeline" + }, + { + "vuid": "VUID-vkCmdBindPipeline-pipeline-00781", + "text": " If the &amp;lt;&amp;lt;features-features-variableMultisampleRate,variable multisample rate&amp;gt;&amp;gt; feature is not supported, pipeline is a graphics pipeline, the current subpass has no attachments, and this is not the first call to this function with a graphics pipeline after transitioning to the current subpass, then the sample count specified by this pipeline must match that set in the previous pipeline" + }, + { + "vuid": "VUID-vkCmdBindPipeline-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdBindPipeline-pipelineBindPoint-parameter", + "text": " pipelineBindPoint must be a valid VkPipelineBindPoint value" + }, + { + "vuid": "VUID-vkCmdBindPipeline-pipeline-parameter", + "text": " pipeline must be a valid VkPipeline handle" + }, + { + "vuid": "VUID-vkCmdBindPipeline-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdBindPipeline-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdBindPipeline-commonparent", + "text": " Both of commandBuffer, and pipeline must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_EXT_sample_locations)": [ + { + "vuid": "VUID-vkCmdBindPipeline-variableSampleLocations-01525", + "text": " If VkPhysicalDeviceSampleLocationsPropertiesEXT::variableSampleLocations is VK_FALSE, and pipeline is a graphics pipeline created with a VkPipelineSampleLocationsStateCreateInfoEXT structure having its sampleLocationsEnable member set to VK_TRUE but without VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT enabled then the current render pass instance must have been begun by specifying a VkRenderPassSampleLocationsBeginInfoEXT structure whose pPostSubpassSampleLocations member contains an element with a subpassIndex matching the current subpass index and the sampleLocationsInfo member of that element must match the sampleLocationsInfo specified in VkPipelineSampleLocationsStateCreateInfoEXT when the pipeline was created" + } + ] + }, + "vkGetShaderInfoAMD": { + "(VK_AMD_shader_info)": [ + { + "vuid": "VUID-vkGetShaderInfoAMD-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetShaderInfoAMD-pipeline-parameter", + "text": " pipeline must be a valid VkPipeline handle" + }, + { + "vuid": "VUID-vkGetShaderInfoAMD-shaderStage-parameter", + "text": " shaderStage must be a valid VkShaderStageFlagBits value" + }, + { + "vuid": "VUID-vkGetShaderInfoAMD-infoType-parameter", + "text": " infoType must be a valid VkShaderInfoTypeAMD value" + }, + { + "vuid": "VUID-vkGetShaderInfoAMD-pInfoSize-parameter", + "text": " pInfoSize must be a valid pointer to a size_t value" + }, + { + "vuid": "VUID-vkGetShaderInfoAMD-pInfo-parameter", + "text": " If the value referenced by pInfoSize is not 0, and pInfo is not NULL, pInfo must be a valid pointer to an array of pInfoSize bytes" + }, + { + "vuid": "VUID-vkGetShaderInfoAMD-pipeline-parent", + "text": " pipeline must have been created, allocated, or retrieved from device" + } + ] + }, + "VkAllocationCallbacks": { + "core": [ + { + "vuid": "VUID-VkAllocationCallbacks-pfnAllocation-00632", + "text": " pfnAllocation must be a valid pointer to a valid user-defined PFN_vkAllocationFunction" + }, + { + "vuid": "VUID-VkAllocationCallbacks-pfnReallocation-00633", + "text": " pfnReallocation must be a valid pointer to a valid user-defined PFN_vkReallocationFunction" + }, + { + "vuid": "VUID-VkAllocationCallbacks-pfnFree-00634", + "text": " pfnFree must be a valid pointer to a valid user-defined PFN_vkFreeFunction" + }, + { + "vuid": "VUID-VkAllocationCallbacks-pfnInternalAllocation-00635", + "text": " If either of pfnInternalAllocation or pfnInternalFree is not NULL, both must be valid callbacks" + } + ] + }, + "vkGetPhysicalDeviceMemoryProperties": { + "core": [ + { + "vuid": "VUID-vkGetPhysicalDeviceMemoryProperties-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceMemoryProperties-pMemoryProperties-parameter", + "text": " pMemoryProperties must be a valid pointer to a VkPhysicalDeviceMemoryProperties structure" + } + ] + }, + "vkGetPhysicalDeviceMemoryProperties2": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceMemoryProperties2-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceMemoryProperties2-pMemoryProperties-parameter", + "text": " pMemoryProperties must be a valid pointer to a VkPhysicalDeviceMemoryProperties2 structure" + } + ] + }, + "VkPhysicalDeviceMemoryProperties2": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-VkPhysicalDeviceMemoryProperties2-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2" + }, + { + "vuid": "VUID-VkPhysicalDeviceMemoryProperties2-pNext-pNext", + "text": " pNext must be NULL" + } + ] + }, + "vkAllocateMemory": { + "core": [ + { + "vuid": "VUID-vkAllocateMemory-pAllocateInfo-01713", + "text": " pAllocateInfo\\-&amp;gt;allocationSize must be less than or equal to VkPhysicalDeviceMemoryProperties::memoryHeaps[pAllocateInfo\\-&amp;gt;memoryTypeIndex].size as returned by vkGetPhysicalDeviceMemoryProperties for the VkPhysicalDevice that device was created from." + }, + { + "vuid": "VUID-vkAllocateMemory-pAllocateInfo-01714", + "text": " pAllocateInfo\\-&amp;gt;memoryTypeIndex must be less than VkPhysicalDeviceMemoryProperties::memoryTypeCount as returned by vkGetPhysicalDeviceMemoryProperties for the VkPhysicalDevice that device was created from." + }, + { + "vuid": "VUID-vkAllocateMemory-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkAllocateMemory-pAllocateInfo-parameter", + "text": " pAllocateInfo must be a valid pointer to a valid VkMemoryAllocateInfo structure" + }, + { + "vuid": "VUID-vkAllocateMemory-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkAllocateMemory-pMemory-parameter", + "text": " pMemory must be a valid pointer to a VkDeviceMemory handle" + } + ] + }, + "VkMemoryAllocateInfo": { + "!(VK_ANDROID_external_memory_android_hardware_buffer)": [ + { + "vuid": "VUID-VkMemoryAllocateInfo-allocationSize-00638", + "text": " allocationSize must be greater than 0" + } + ], + "(VK_KHR_external_memory)+(VK_KHR_dedicated_allocation,VK_NV_dedicated_allocation)": [ + { + "vuid": "VUID-VkMemoryAllocateInfo-pNext-00639", + "text": " If the pNext chain contains an instance of VkExportMemoryAllocateInfo, and any of the handle types specified in VkExportMemoryAllocateInfo::handleTypes require a dedicated allocation, as reported by vkGetPhysicalDeviceImageFormatProperties2 in VkExternalImageFormatProperties::externalMemoryProperties::externalMemoryFeatures or VkExternalBufferProperties::externalMemoryProperties::externalMemoryFeatures, the pNext chain must contain an instance of ifdef::VK_KHR_dedicated_allocation[VkMemoryDedicatedAllocateInfo]" + } + ], + "(VK_KHR_external_memory)+(VK_NV_external_memory)": [ + { + "vuid": "VUID-VkMemoryAllocateInfo-pNext-00640", + "text": " If the pNext chain contains an instance of VkExportMemoryAllocateInfo, it must not contain an instance of VkExportMemoryAllocateInfoNV or VkExportMemoryWin32HandleInfoNV." + } + ], + "(VK_KHR_external_memory_win32+VK_NV_external_memory_win32)": [ + { + "vuid": "VUID-VkMemoryAllocateInfo-pNext-00641", + "text": " If the pNext chain contains an instance of VkImportMemoryWin32HandleInfoKHR, it must not contain an instance of VkImportMemoryWin32HandleInfoNV." + } + ], + "(VK_KHR_external_memory_fd)": [ + { + "vuid": "VUID-VkMemoryAllocateInfo-allocationSize-01742", + "text": " If the parameters define an import operation, the external handle specified was created by the Vulkan API, and the external handle type is VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR, then the values of allocationSize and memoryTypeIndex must match those specified when the memory object being imported was created." + }, + { + "vuid": "VUID-VkMemoryAllocateInfo-memoryTypeIndex-00648", + "text": " If the parameters define an import operation and the external handle is a POSIX file descriptor created outside of the Vulkan API, the value of memoryTypeIndex must be one of those returned by vkGetMemoryFdPropertiesKHR." + } + ], + "(VK_KHR_external_memory+VK_KHR_device_group)": [ + { + "vuid": "VUID-VkMemoryAllocateInfo-None-00643", + "text": " If the parameters define an import operation and the external handle specified was created by the Vulkan API, the device mask specified by VkMemoryAllocateFlagsInfo must match that specified when the memory object being imported was allocated." + }, + { + "vuid": "VUID-VkMemoryAllocateInfo-None-00644", + "text": " If the parameters define an import operation and the external handle specified was created by the Vulkan API, the list of physical devices that comprise the logical device passed to vkAllocateMemory must match the list of physical devices that comprise the logical device on which the memory was originally allocated." + } + ], + "(VK_KHR_external_memory_win32)": [ + { + "vuid": "VUID-VkMemoryAllocateInfo-memoryTypeIndex-00645", + "text": " If the parameters define an import operation and the external handle is an NT handle or a global share handle created outside of the Vulkan API, the value of memoryTypeIndex must be one of those returned by vkGetMemoryWin32HandlePropertiesKHR." + }, + { + "vuid": "VUID-VkMemoryAllocateInfo-allocationSize-01743", + "text": " If the parameters define an import operation, the external handle was created by the Vulkan API, and the external handle type is VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR or VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR, then the values of allocationSize and memoryTypeIndex must match those specified when the memory object being imported was created." + }, + { + "vuid": "VUID-VkMemoryAllocateInfo-allocationSize-00646", + "text": " If the parameters define an import operation and the external handle type is VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, allocationSize must match the size reported in the memory requirements of the image or buffer member of the instance of VkDedicatedAllocationMemoryAllocateInfoNV included in the pNext chain." + }, + { + "vuid": "VUID-VkMemoryAllocateInfo-allocationSize-00647", + "text": " If the parameters define an import operation and the external handle type is VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, allocationSize must match the size specified when creating the Direct3D 12 heap from which the external handle was extracted." + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-VkMemoryAllocateInfo-memoryTypeIndex-01872", + "text": " If the protected memory feature is not enabled, the VkMemoryAllocateInfo::memoryTypeIndex must not indicate a memory type that reports VK_MEMORY_PROPERTY_PROTECTED_BIT." + } + ], + "(VK_EXT_external_memory_host)": [ + { + "vuid": "VUID-VkMemoryAllocateInfo-memoryTypeIndex-01744", + "text": " If the parameters define an import operation and the external handle is a host pointer, the value of memoryTypeIndex must be one of those returned by vkGetMemoryHostPointerPropertiesEXT" + }, + { + "vuid": "VUID-VkMemoryAllocateInfo-allocationSize-01745", + "text": " If the parameters define an import operation and the external handle is a host pointer, allocationSize must be an integer multiple of VkPhysicalDeviceExternalMemoryHostPropertiesEXT::minImportedHostPointerAlignment" + } + ], + "(VK_ANDROID_external_memory_android_hardware_buffer)": [ + { + "vuid": "VUID-VkMemoryAllocateInfo-None-01873", + "text": " If the parameters define an import operation and the external handle type is VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BIT_ANDROID:" + }, + { + "vuid": "VUID-VkMemoryAllocateInfo-pNext-01874", + "text": " If the parameters do not define an import operation, and the pNext chain contains an instance of VkExportMemoryAllocateInfo with VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID included in its handleTypes member, and the pNext contains an instance of VkMemoryDedicatedAllocateInfo with image not equal to VK_NULL_HANDLE, then allocationSize must be 0, otherwise allocationSize must be greater than 0." + }, + { + "vuid": "VUID-VkMemoryAllocateInfo-pNext-01875", + "text": " If the parameters define an import operation, the external handle is an Android hardware buffer, and the pNext chain includes an instance of VkMemoryDedicatedAllocateInfo with image that is not VK_NULL_HANDLE:" + } + ], + "core": [ + { + "vuid": "VUID-VkMemoryAllocateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO" + }, + { + "vuid": "VUID-VkMemoryAllocateInfo-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDedicatedAllocationMemoryAllocateInfoNV, VkExportMemoryAllocateInfo, VkExportMemoryAllocateInfoNV, VkExportMemoryWin32HandleInfoKHR, VkExportMemoryWin32HandleInfoNV, VkImportAndroidHardwareBufferInfoANDROID, VkImportMemoryFdInfoKHR, VkImportMemoryHostPointerInfoEXT, VkImportMemoryWin32HandleInfoKHR, VkImportMemoryWin32HandleInfoNV, VkMemoryAllocateFlagsInfo, or VkMemoryDedicatedAllocateInfo" + }, + { + "vuid": "VUID-VkMemoryAllocateInfo-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + } + ] + }, + "VkMemoryDedicatedAllocateInfo": { + "(VK_VERSION_1_1,VK_KHR_dedicated_allocation)": [ + { + "vuid": "VUID-VkMemoryDedicatedAllocateInfo-image-01432", + "text": " At least one of image and buffer must be VK_NULL_HANDLE" + }, + { + "vuid": "VUID-VkMemoryDedicatedAllocateInfo-image-01433", + "text": " If image is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the image" + }, + { + "vuid": "VUID-VkMemoryDedicatedAllocateInfo-image-01434", + "text": " If image is not VK_NULL_HANDLE, image must have been created without VK_IMAGE_CREATE_SPARSE_BINDING_BIT set in VkImageCreateInfo::flags" + }, + { + "vuid": "VUID-VkMemoryDedicatedAllocateInfo-buffer-01435", + "text": " If buffer is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the buffer" + }, + { + "vuid": "VUID-VkMemoryDedicatedAllocateInfo-buffer-01436", + "text": " If buffer is not VK_NULL_HANDLE, buffer must have been created without VK_BUFFER_CREATE_SPARSE_BINDING_BIT set in VkBufferCreateInfo::flags" + }, + { + "vuid": "VUID-VkMemoryDedicatedAllocateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO" + }, + { + "vuid": "VUID-VkMemoryDedicatedAllocateInfo-image-parameter", + "text": " If image is not VK_NULL_HANDLE, image must be a valid VkImage handle" + }, + { + "vuid": "VUID-VkMemoryDedicatedAllocateInfo-buffer-parameter", + "text": " If buffer is not VK_NULL_HANDLE, buffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-VkMemoryDedicatedAllocateInfo-commonparent", + "text": " Both of buffer, and image that are valid handles must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1,VK_KHR_dedicated_allocation)+(VK_KHR_external_memory_win32)": [ + { + "vuid": "VUID-VkMemoryDedicatedAllocateInfo-image-01876", + "text": " If image is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation with handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, and the external handle was created by the Vulkan API, then the memory being imported must also be a dedicated image allocation and image must be identical to the image associated with the imported memory." + }, + { + "vuid": "VUID-VkMemoryDedicatedAllocateInfo-buffer-01877", + "text": " If buffer is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation with handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, and the external handle was created by the Vulkan API, then the memory being imported must also be a dedicated buffer allocation and buffer must be identical to the buffer associated with the imported memory." + } + ], + "(VK_VERSION_1_1,VK_KHR_dedicated_allocation)+(VK_KHR_external_memory_fd)": [ + { + "vuid": "VUID-VkMemoryDedicatedAllocateInfo-image-01878", + "text": " If image is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation with handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT, the memory being imported must also be a dedicated image allocation and image must be identical to the image associated with the imported memory." + }, + { + "vuid": "VUID-VkMemoryDedicatedAllocateInfo-buffer-01879", + "text": " If buffer is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation with handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT, the memory being imported must also be a dedicated buffer allocation and buffer must be identical to the buffer associated with the imported memory." + } + ], + "(VK_VERSION_1_1,VK_KHR_dedicated_allocation)+(VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkMemoryDedicatedAllocateInfo-image-01797", + "text": " If image is not VK_NULL_HANDLE, image must not have been created with VK_IMAGE_CREATE_DISJOINT_BIT set in VkImageCreateInfo::flags" + } + ] + }, + "VkDedicatedAllocationMemoryAllocateInfoNV": { + "(VK_NV_dedicated_allocation)": [ + { + "vuid": "VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00649", + "text": " At least one of image and buffer must be VK_NULL_HANDLE" + }, + { + "vuid": "VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00650", + "text": " If image is not VK_NULL_HANDLE, the image must have been created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE" + }, + { + "vuid": "VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00651", + "text": " If buffer is not VK_NULL_HANDLE, the buffer must have been created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE" + }, + { + "vuid": "VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00652", + "text": " If image is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the image" + }, + { + "vuid": "VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00653", + "text": " If buffer is not VK_NULL_HANDLE, VkMemoryAllocateInfo::allocationSize must equal the VkMemoryRequirements::size of the buffer" + }, + { + "vuid": "VUID-VkDedicatedAllocationMemoryAllocateInfoNV-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV" + }, + { + "vuid": "VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-parameter", + "text": " If image is not VK_NULL_HANDLE, image must be a valid VkImage handle" + }, + { + "vuid": "VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-parameter", + "text": " If buffer is not VK_NULL_HANDLE, buffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-VkDedicatedAllocationMemoryAllocateInfoNV-commonparent", + "text": " Both of buffer, and image that are valid handles must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_NV_dedicated_allocation)+(VK_KHR_external_memory_win32,VK_KHR_external_memory_fd)": [ + { + "vuid": "VUID-VkDedicatedAllocationMemoryAllocateInfoNV-image-00654", + "text": " If image is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation, the memory being imported must also be a dedicated image allocation and image must be identical to the image associated with the imported memory." + }, + { + "vuid": "VUID-VkDedicatedAllocationMemoryAllocateInfoNV-buffer-00655", + "text": " If buffer is not VK_NULL_HANDLE and VkMemoryAllocateInfo defines a memory import operation, the memory being imported must also be a dedicated buffer allocation and buffer must be identical to the buffer associated with the imported memory." + } + ] + }, + "VkExportMemoryAllocateInfo": { + "(VK_VERSION_1_1,VK_KHR_external_memory)": [ + { + "vuid": "VUID-VkExportMemoryAllocateInfo-handleTypes-00656", + "text": " The bits in handleTypes must be supported and compatible, as reported by VkExternalImageFormatProperties or VkExternalBufferProperties." + }, + { + "vuid": "VUID-VkExportMemoryAllocateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO" + }, + { + "vuid": "VUID-VkExportMemoryAllocateInfo-handleTypes-parameter", + "text": " handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBits values" + } + ] + }, + "VkExportMemoryWin32HandleInfoKHR": { + "(VK_KHR_external_memory_win32)": [ + { + "vuid": "VUID-VkExportMemoryWin32HandleInfoKHR-handleTypes-00657", + "text": " If VkExportMemoryAllocateInfo::handleTypes does not include VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, VkExportMemoryWin32HandleInfoKHR must not be in the pNext chain of VkMemoryAllocateInfo." + }, + { + "vuid": "VUID-VkExportMemoryWin32HandleInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR" + }, + { + "vuid": "VUID-VkExportMemoryWin32HandleInfoKHR-pAttributes-parameter", + "text": " If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value" + } + ] + }, + "VkImportMemoryWin32HandleInfoKHR": { + "(VK_KHR_external_memory_win32)": [ + { + "vuid": "VUID-VkImportMemoryWin32HandleInfoKHR-handleType-00658", + "text": " If handleType is not 0, it must be supported for import, as reported by VkExternalImageFormatProperties or VkExternalBufferProperties." + }, + { + "vuid": "VUID-VkImportMemoryWin32HandleInfoKHR-handle-00659", + "text": " The memory from which handle was exported, or the memory named by name must have been created on the same underlying physical device as device." + }, + { + "vuid": "VUID-VkImportMemoryWin32HandleInfoKHR-handleType-00660", + "text": " If handleType is not 0, it must be defined as an NT handle or a global share handle." + }, + { + "vuid": "VUID-VkImportMemoryWin32HandleInfoKHR-handleType-01439", + "text": " If handleType is not VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, name must be NULL." + }, + { + "vuid": "VUID-VkImportMemoryWin32HandleInfoKHR-handleType-01440", + "text": " If handleType is not 0 and handle is NULL, name must name a valid memory resource of the type specified by handleType." + }, + { + "vuid": "VUID-VkImportMemoryWin32HandleInfoKHR-handleType-00661", + "text": " If handleType is not 0 and name is NULL, handle must be a valid handle of the type specified by handleType." + }, + { + "vuid": "VUID-VkImportMemoryWin32HandleInfoKHR-handle-01441", + "text": " if handle is not NULL, name must be NULL." + }, + { + "vuid": "VUID-VkImportMemoryWin32HandleInfoKHR-handle-01518", + "text": " If handle is not NULL, it must obey any requirements listed for handleType in external memory handle types compatibility." + }, + { + "vuid": "VUID-VkImportMemoryWin32HandleInfoKHR-name-01519", + "text": " If name is not NULL, it must obey any requirements listed for handleType in external memory handle types compatibility." + }, + { + "vuid": "VUID-VkImportMemoryWin32HandleInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR" + }, + { + "vuid": "VUID-VkImportMemoryWin32HandleInfoKHR-handleType-parameter", + "text": " If handleType is not 0, handleType must be a valid VkExternalMemoryHandleTypeFlagBits value" + } + ] + }, + "vkGetMemoryWin32HandleKHR": { + "(VK_KHR_external_memory_win32)": [ + { + "vuid": "VUID-vkGetMemoryWin32HandleKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetMemoryWin32HandleKHR-pGetWin32HandleInfo-parameter", + "text": " pGetWin32HandleInfo must be a valid pointer to a valid VkMemoryGetWin32HandleInfoKHR structure" + }, + { + "vuid": "VUID-vkGetMemoryWin32HandleKHR-pHandle-parameter", + "text": " pHandle must be a valid pointer to a HANDLE value" + } + ] + }, + "VkMemoryGetWin32HandleInfoKHR": { + "(VK_KHR_external_memory_win32)": [ + { + "vuid": "VUID-VkMemoryGetWin32HandleInfoKHR-handleType-00662", + "text": " handleType must have been included in VkExportMemoryAllocateInfo::handleTypes when memory was created." + }, + { + "vuid": "VUID-VkMemoryGetWin32HandleInfoKHR-handleType-00663", + "text": " If handleType is defined as an NT handle, vkGetMemoryWin32HandleKHR must be called no more than once for each valid unique combination of memory and handleType." + }, + { + "vuid": "VUID-VkMemoryGetWin32HandleInfoKHR-handleType-00664", + "text": " handleType must be defined as an NT handle or a global share handle." + }, + { + "vuid": "VUID-VkMemoryGetWin32HandleInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR" + }, + { + "vuid": "VUID-VkMemoryGetWin32HandleInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkMemoryGetWin32HandleInfoKHR-memory-parameter", + "text": " memory must be a valid VkDeviceMemory handle" + }, + { + "vuid": "VUID-VkMemoryGetWin32HandleInfoKHR-handleType-parameter", + "text": " handleType must be a valid VkExternalMemoryHandleTypeFlagBits value" + } + ] + }, + "vkGetMemoryWin32HandlePropertiesKHR": { + "(VK_KHR_external_memory_win32)": [ + { + "vuid": "VUID-vkGetMemoryWin32HandlePropertiesKHR-handle-00665", + "text": " handle must be an external memory handle created outside of the Vulkan API." + }, + { + "vuid": "VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-00666", + "text": " handleType must not be one of the handle types defined as opaque." + }, + { + "vuid": "VUID-vkGetMemoryWin32HandlePropertiesKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-parameter", + "text": " handleType must be a valid VkExternalMemoryHandleTypeFlagBits value" + }, + { + "vuid": "VUID-vkGetMemoryWin32HandlePropertiesKHR-pMemoryWin32HandleProperties-parameter", + "text": " pMemoryWin32HandleProperties must be a valid pointer to a VkMemoryWin32HandlePropertiesKHR structure" + } + ] + }, + "VkImportMemoryFdInfoKHR": { + "(VK_KHR_external_memory_fd)": [ + { + "vuid": "VUID-VkImportMemoryFdInfoKHR-handleType-00667", + "text": " If handleType is not 0, it must be supported for import, as reported by VkExternalImageFormatProperties or VkExternalBufferProperties." + }, + { + "vuid": "VUID-VkImportMemoryFdInfoKHR-fd-00668", + "text": " The memory from which fd was exported must have been created on the same underlying physical device as device." + }, + { + "vuid": "VUID-VkImportMemoryFdInfoKHR-handleType-00669", + "text": " If handleType is not 0, it must be defined as a POSIX file descriptor handle." + }, + { + "vuid": "VUID-VkImportMemoryFdInfoKHR-handleType-00670", + "text": " If handleType is not 0, fd must be a valid handle of the type specified by handleType." + }, + { + "vuid": "VUID-VkImportMemoryFdInfoKHR-fd-01746", + "text": " The memory represented by fd must have been created from a physical device and driver that is compatible with device and handleType, as described in &amp;lt;&amp;lt;external-memory-handle-types-compatibility&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-VkImportMemoryFdInfoKHR-fd-01520", + "text": " fd must obey any requirements listed for handleType in &amp;lt;&amp;lt;external-memory-handle-types-compatibility,external memory handle types compatibility&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-VkImportMemoryFdInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR" + }, + { + "vuid": "VUID-VkImportMemoryFdInfoKHR-handleType-parameter", + "text": " If handleType is not 0, handleType must be a valid VkExternalMemoryHandleTypeFlagBits value" + } + ] + }, + "vkGetMemoryFdKHR": { + "(VK_KHR_external_memory_fd)": [ + { + "vuid": "VUID-vkGetMemoryFdKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetMemoryFdKHR-pGetFdInfo-parameter", + "text": " pGetFdInfo must be a valid pointer to a valid VkMemoryGetFdInfoKHR structure" + }, + { + "vuid": "VUID-vkGetMemoryFdKHR-pFd-parameter", + "text": " pFd must be a valid pointer to a int value" + } + ] + }, + "VkMemoryGetFdInfoKHR": { + "(VK_KHR_external_memory_fd)": [ + { + "vuid": "VUID-VkMemoryGetFdInfoKHR-handleType-00671", + "text": " handleType must have been included in VkExportMemoryAllocateInfo::handleTypes when memory was created." + }, + { + "vuid": "VUID-VkMemoryGetFdInfoKHR-handleType-00672", + "text": " handleType must be defined as a POSIX file descriptor handle." + }, + { + "vuid": "VUID-VkMemoryGetFdInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR" + }, + { + "vuid": "VUID-VkMemoryGetFdInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkMemoryGetFdInfoKHR-memory-parameter", + "text": " memory must be a valid VkDeviceMemory handle" + }, + { + "vuid": "VUID-VkMemoryGetFdInfoKHR-handleType-parameter", + "text": " handleType must be a valid VkExternalMemoryHandleTypeFlagBits value" + } + ] + }, + "vkGetMemoryFdPropertiesKHR": { + "(VK_KHR_external_memory_fd)": [ + { + "vuid": "VUID-vkGetMemoryFdPropertiesKHR-fd-00673", + "text": " fd must be an external memory handle created outside of the Vulkan API." + }, + { + "vuid": "VUID-vkGetMemoryFdPropertiesKHR-handleType-00674", + "text": " handleType must not be VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR." + }, + { + "vuid": "VUID-vkGetMemoryFdPropertiesKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetMemoryFdPropertiesKHR-handleType-parameter", + "text": " handleType must be a valid VkExternalMemoryHandleTypeFlagBits value" + }, + { + "vuid": "VUID-vkGetMemoryFdPropertiesKHR-pMemoryFdProperties-parameter", + "text": " pMemoryFdProperties must be a valid pointer to a VkMemoryFdPropertiesKHR structure" + } + ] + }, + "VkImportMemoryHostPointerInfoEXT": { + "(VK_EXT_external_memory_host)": [ + { + "vuid": "VUID-VkImportMemoryHostPointerInfoEXT-handleType-01747", + "text": " If handleType is not 0, it must be supported for import, as reported in VkExternalMemoryPropertiesKHR" + }, + { + "vuid": "VUID-VkImportMemoryHostPointerInfoEXT-handleType-01748", + "text": " If handleType is not 0, it must be VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT or VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT" + }, + { + "vuid": "VUID-VkImportMemoryHostPointerInfoEXT-pHostPointer-01749", + "text": " pHostPointer must be a pointer aligned to an integer multiple of VkPhysicalDeviceExternalMemoryHostPropertiesEXT::minImportedHostPointerAlignment" + }, + { + "vuid": "VUID-VkImportMemoryHostPointerInfoEXT-handleType-01750", + "text": " If handleType is VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT, pHostPointer must be a pointer to allocationSize number of bytes of host memory, where allocationSize is the member of the VkMemoryAllocateInfo structure this structure is chained to" + }, + { + "vuid": "VUID-VkImportMemoryHostPointerInfoEXT-handleType-01751", + "text": " If handleType is VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT, pHostPointer must be a pointer to allocationSize number of bytes of host mapped foreign memory, where allocationSize is the member of the VkMemoryAllocateInfo structure this structure is chained to" + }, + { + "vuid": "VUID-VkImportMemoryHostPointerInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT" + }, + { + "vuid": "VUID-VkImportMemoryHostPointerInfoEXT-handleType-parameter", + "text": " handleType must be a valid VkExternalMemoryHandleTypeFlagBits value" + } + ] + }, + "vkGetMemoryHostPointerPropertiesEXT": { + "(VK_EXT_external_memory_host)": [ + { + "vuid": "VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-01752", + "text": " handleType must be VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT or VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT" + }, + { + "vuid": "VUID-vkGetMemoryHostPointerPropertiesEXT-pHostPointer-01753", + "text": " pHostPointer must be a pointer aligned to an integer multiple of VkPhysicalDeviceExternalMemoryHostPropertiesEXT::minImportedHostPointerAlignment" + }, + { + "vuid": "VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-01754", + "text": " If handleType is VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT, pHostPointer must be a pointer to host memory" + }, + { + "vuid": "VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-01755", + "text": " If handleType is VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT, pHostPointer must be a pointer to host mapped foreign memory" + }, + { + "vuid": "VUID-vkGetMemoryHostPointerPropertiesEXT-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-parameter", + "text": " handleType must be a valid VkExternalMemoryHandleTypeFlagBits value" + }, + { + "vuid": "VUID-vkGetMemoryHostPointerPropertiesEXT-pMemoryHostPointerProperties-parameter", + "text": " pMemoryHostPointerProperties must be a valid pointer to a VkMemoryHostPointerPropertiesEXT structure" + } + ] + }, + "VkMemoryHostPointerPropertiesEXT": { + "(VK_EXT_external_memory_host)": [ + { + "vuid": "VUID-VkMemoryHostPointerPropertiesEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT" + }, + { + "vuid": "VUID-VkMemoryHostPointerPropertiesEXT-pNext-pNext", + "text": " pNext must be NULL" + } + ] + }, + "VkImportAndroidHardwareBufferInfoANDROID": { + "(VK_ANDROID_external_memory_android_hardware_buffer)": [ + { + "vuid": "VUID-VkImportAndroidHardwareBufferInfoANDROID-buffer-01880", + "text": " If buffer is not NULL, Android hardware buffers must be supported for import, as reported by VkExternalImageFormatProperties or VkExternalBufferProperties." + }, + { + "vuid": "VUID-VkImportAndroidHardwareBufferInfoANDROID-buffer-01881", + "text": " If buffer is not NULL, it must be a valid Android hardware buffer object with format and usage compatible with Vulkan as described by VkExternalMemoryHandleTypeFlagBits." + }, + { + "vuid": "VUID-VkImportAndroidHardwareBufferInfoANDROID-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID" + }, + { + "vuid": "VUID-VkImportAndroidHardwareBufferInfoANDROID-buffer-parameter", + "text": " buffer must be a valid pointer to a AHardwareBuffer value" + } + ] + }, + "vkGetMemoryAndroidHardwareBufferANDROID": { + "(VK_ANDROID_external_memory_android_hardware_buffer)": [ + { + "vuid": "VUID-vkGetMemoryAndroidHardwareBufferANDROID-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetMemoryAndroidHardwareBufferANDROID-pInfo-parameter", + "text": " pInfo must be a valid pointer to a valid VkMemoryGetAndroidHardwareBufferInfoANDROID structure" + }, + { + "vuid": "VUID-vkGetMemoryAndroidHardwareBufferANDROID-pBuffer-parameter", + "text": " pBuffer must be a valid pointer to a valid pointer to a AHardwareBuffer value" + } + ] + }, + "VkMemoryGetAndroidHardwareBufferInfoANDROID": { + "(VK_ANDROID_external_memory_android_hardware_buffer)": [ + { + "vuid": "VUID-VkMemoryGetAndroidHardwareBufferInfoANDROID-handleTypes-01882", + "text": " VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID must have been included in VkExportMemoryAllocateInfoKHR::handleTypes when memory was created." + }, + { + "vuid": "VUID-VkMemoryGetAndroidHardwareBufferInfoANDROID-pNext-01883", + "text": " If the pNext chain of the VkMemoryAllocateInfo used to allocate memory included a VkMemoryDedicatedAllocateInfo with non-NULL image member, then that image must already be bound to memory." + } + ] + }, + "vkGetAndroidHardwareBufferPropertiesANDROID": { + "(VK_ANDROID_external_memory_android_hardware_buffer)": [ + { + "vuid": "VUID-vkGetAndroidHardwareBufferPropertiesANDROID-buffer-01884", + "text": " buffer must be a valid Android hardware buffer object with at least one of the AHARDWAREBUFFER_USAGE_GPU_* usage flags." + }, + { + "vuid": "VUID-vkGetAndroidHardwareBufferPropertiesANDROID-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetAndroidHardwareBufferPropertiesANDROID-buffer-parameter", + "text": " buffer must be a valid pointer to a valid AHardwareBuffer value" + }, + { + "vuid": "VUID-vkGetAndroidHardwareBufferPropertiesANDROID-pProperties-parameter", + "text": " pProperties must be a valid pointer to a VkAndroidHardwareBufferPropertiesANDROID structure" + } + ] + }, + "VkAndroidHardwareBufferFormatPropertiesANDROID": { + "(VK_ANDROID_external_memory_android_hardware_buffer)": [ + { + "vuid": "VUID-VkAndroidHardwareBufferFormatPropertiesANDROID-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID" + } + ] + }, + "VkExportMemoryAllocateInfoNV": { + "(VK_NV_external_memory)": [ + { + "vuid": "VUID-VkExportMemoryAllocateInfoNV-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV" + }, + { + "vuid": "VUID-VkExportMemoryAllocateInfoNV-handleTypes-parameter", + "text": " handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values" + } + ] + }, + "VkExportMemoryWin32HandleInfoNV": { + "(VK_NV_external_memory_win32)": [ + { + "vuid": "VUID-VkExportMemoryWin32HandleInfoNV-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV" + }, + { + "vuid": "VUID-VkExportMemoryWin32HandleInfoNV-pAttributes-parameter", + "text": " If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value" + } + ] + }, + "VkImportMemoryWin32HandleInfoNV": { + "(VK_NV_external_memory_win32)": [ + { + "vuid": "VUID-VkImportMemoryWin32HandleInfoNV-handleType-01327", + "text": " handleType must not have more than one bit set." + }, + { + "vuid": "VUID-VkImportMemoryWin32HandleInfoNV-handle-01328", + "text": " handle must be a valid handle to memory, obtained as specified by handleType." + }, + { + "vuid": "VUID-VkImportMemoryWin32HandleInfoNV-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV" + }, + { + "vuid": "VUID-VkImportMemoryWin32HandleInfoNV-handleType-parameter", + "text": " handleType must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values" + } + ] + }, + "vkGetMemoryWin32HandleNV": { + "(VK_NV_external_memory_win32)": [ + { + "vuid": "VUID-vkGetMemoryWin32HandleNV-handleType-01326", + "text": " handleType must be a flag specified in VkExportMemoryAllocateInfoNV::handleTypes when allocating memory" + }, + { + "vuid": "VUID-vkGetMemoryWin32HandleNV-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetMemoryWin32HandleNV-memory-parameter", + "text": " memory must be a valid VkDeviceMemory handle" + }, + { + "vuid": "VUID-vkGetMemoryWin32HandleNV-handleType-parameter", + "text": " handleType must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values" + }, + { + "vuid": "VUID-vkGetMemoryWin32HandleNV-handleType-requiredbitmask", + "text": " handleType must not be 0" + }, + { + "vuid": "VUID-vkGetMemoryWin32HandleNV-pHandle-parameter", + "text": " pHandle must be a valid pointer to a HANDLE value" + }, + { + "vuid": "VUID-vkGetMemoryWin32HandleNV-memory-parent", + "text": " memory must have been created, allocated, or retrieved from device" + } + ] + }, + "VkMemoryAllocateFlagsInfo": { + "(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-VkMemoryAllocateFlagsInfo-deviceMask-00675", + "text": " If VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT is set, deviceMask must be a valid device mask." + }, + { + "vuid": "VUID-VkMemoryAllocateFlagsInfo-deviceMask-00676", + "text": " If VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT is set, deviceMask must not be zero" + }, + { + "vuid": "VUID-VkMemoryAllocateFlagsInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO" + }, + { + "vuid": "VUID-VkMemoryAllocateFlagsInfo-flags-parameter", + "text": " flags must be a valid combination of VkMemoryAllocateFlagBits values" + } + ] + }, + "vkFreeMemory": { + "core": [ + { + "vuid": "VUID-vkFreeMemory-memory-00677", + "text": " All submitted commands that refer to memory (via images or buffers) must have completed execution" + }, + { + "vuid": "VUID-vkFreeMemory-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkFreeMemory-memory-parameter", + "text": " If memory is not VK_NULL_HANDLE, memory must be a valid VkDeviceMemory handle" + }, + { + "vuid": "VUID-vkFreeMemory-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkFreeMemory-memory-parent", + "text": " If memory is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkMapMemory": { + "core": [ + { + "vuid": "VUID-vkMapMemory-memory-00678", + "text": " memory must not be currently mapped" + }, + { + "vuid": "VUID-vkMapMemory-offset-00679", + "text": " offset must be less than the size of memory" + }, + { + "vuid": "VUID-vkMapMemory-size-00680", + "text": " If size is not equal to VK_WHOLE_SIZE, size must be greater than 0" + }, + { + "vuid": "VUID-vkMapMemory-size-00681", + "text": " If size is not equal to VK_WHOLE_SIZE, size must be less than or equal to the size of the memory minus offset" + }, + { + "vuid": "VUID-vkMapMemory-memory-00682", + "text": " memory must have been created with a memory type that reports VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT" + }, + { + "vuid": "VUID-vkMapMemory-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkMapMemory-memory-parameter", + "text": " memory must be a valid VkDeviceMemory handle" + }, + { + "vuid": "VUID-vkMapMemory-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-vkMapMemory-ppData-parameter", + "text": " ppData must be a valid pointer to a pointer value" + }, + { + "vuid": "VUID-vkMapMemory-memory-parent", + "text": " memory must have been created, allocated, or retrieved from device" + } + ], + "(VK_KHR_device_group)": [ + { + "vuid": "VUID-vkMapMemory-memory-00683", + "text": " memory must not have been allocated with multiple instances." + } + ] + }, + "vkFlushMappedMemoryRanges": { + "core": [ + { + "vuid": "VUID-vkFlushMappedMemoryRanges-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkFlushMappedMemoryRanges-pMemoryRanges-parameter", + "text": " pMemoryRanges must be a valid pointer to an array of memoryRangeCount valid VkMappedMemoryRange structures" + }, + { + "vuid": "VUID-vkFlushMappedMemoryRanges-memoryRangeCount-arraylength", + "text": " memoryRangeCount must be greater than 0" + } + ] + }, + "vkInvalidateMappedMemoryRanges": { + "core": [ + { + "vuid": "VUID-vkInvalidateMappedMemoryRanges-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkInvalidateMappedMemoryRanges-pMemoryRanges-parameter", + "text": " pMemoryRanges must be a valid pointer to an array of memoryRangeCount valid VkMappedMemoryRange structures" + }, + { + "vuid": "VUID-vkInvalidateMappedMemoryRanges-memoryRangeCount-arraylength", + "text": " memoryRangeCount must be greater than 0" + } + ] + }, + "VkMappedMemoryRange": { + "core": [ + { + "vuid": "VUID-VkMappedMemoryRange-memory-00684", + "text": " memory must be currently mapped" + }, + { + "vuid": "VUID-VkMappedMemoryRange-size-00685", + "text": " If size is not equal to VK_WHOLE_SIZE, offset and size must specify a range contained within the currently mapped range of memory" + }, + { + "vuid": "VUID-VkMappedMemoryRange-size-00686", + "text": " If size is equal to VK_WHOLE_SIZE, offset must be within the currently mapped range of memory" + }, + { + "vuid": "VUID-VkMappedMemoryRange-size-01389", + "text": " If size is equal to VK_WHOLE_SIZE, the end of the current mapping of memory must be a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize bytes from the beginning of the memory object." + }, + { + "vuid": "VUID-VkMappedMemoryRange-offset-00687", + "text": " offset must be a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize" + }, + { + "vuid": "VUID-VkMappedMemoryRange-size-01390", + "text": " If size is not equal to VK_WHOLE_SIZE, size must either be a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize, or offset plus size must equal the size of memory." + }, + { + "vuid": "VUID-VkMappedMemoryRange-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE" + }, + { + "vuid": "VUID-VkMappedMemoryRange-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkMappedMemoryRange-memory-parameter", + "text": " memory must be a valid VkDeviceMemory handle" + } + ] + }, + "vkUnmapMemory": { + "core": [ + { + "vuid": "VUID-vkUnmapMemory-memory-00689", + "text": " memory must be currently mapped" + }, + { + "vuid": "VUID-vkUnmapMemory-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkUnmapMemory-memory-parameter", + "text": " memory must be a valid VkDeviceMemory handle" + }, + { + "vuid": "VUID-vkUnmapMemory-memory-parent", + "text": " memory must have been created, allocated, or retrieved from device" + } + ] + }, + "vkGetDeviceMemoryCommitment": { + "core": [ + { + "vuid": "VUID-vkGetDeviceMemoryCommitment-memory-00690", + "text": " memory must have been created with a memory type that reports VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT" + }, + { + "vuid": "VUID-vkGetDeviceMemoryCommitment-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetDeviceMemoryCommitment-memory-parameter", + "text": " memory must be a valid VkDeviceMemory handle" + }, + { + "vuid": "VUID-vkGetDeviceMemoryCommitment-pCommittedMemoryInBytes-parameter", + "text": " pCommittedMemoryInBytes must be a valid pointer to a VkDeviceSize value" + }, + { + "vuid": "VUID-vkGetDeviceMemoryCommitment-memory-parent", + "text": " memory must have been created, allocated, or retrieved from device" + } + ] + }, + "vkGetDeviceGroupPeerMemoryFeatures": { + "(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-vkGetDeviceGroupPeerMemoryFeatures-heapIndex-00691", + "text": " heapIndex must be less than memoryHeapCount" + }, + { + "vuid": "VUID-vkGetDeviceGroupPeerMemoryFeatures-localDeviceIndex-00692", + "text": " localDeviceIndex must be a valid device index" + }, + { + "vuid": "VUID-vkGetDeviceGroupPeerMemoryFeatures-remoteDeviceIndex-00693", + "text": " remoteDeviceIndex must be a valid device index" + }, + { + "vuid": "VUID-vkGetDeviceGroupPeerMemoryFeatures-localDeviceIndex-00694", + "text": " localDeviceIndex must not equal remoteDeviceIndex" + }, + { + "vuid": "VUID-vkGetDeviceGroupPeerMemoryFeatures-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetDeviceGroupPeerMemoryFeatures-pPeerMemoryFeatures-parameter", + "text": " pPeerMemoryFeatures must be a valid pointer to a VkPeerMemoryFeatureFlags value" + }, + { + "vuid": "VUID-vkGetDeviceGroupPeerMemoryFeatures-pPeerMemoryFeatures-requiredbitmask", + "text": " pPeerMemoryFeatures must not be 0" + } + ] + }, + "vkCreateBuffer": { + "core": [ + { + "vuid": "VUID-vkCreateBuffer-flags-00911", + "text": " If the flags member of pCreateInfo includes VK_BUFFER_CREATE_SPARSE_BINDING_BIT, creating this VkBuffer must not cause the total required sparse memory for all currently valid sparse resources on the device to exceed VkPhysicalDeviceLimits::sparseAddressSpaceSize" + }, + { + "vuid": "VUID-vkCreateBuffer-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateBuffer-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkBufferCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateBuffer-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateBuffer-pBuffer-parameter", + "text": " pBuffer must be a valid pointer to a VkBuffer handle" + } + ] + }, + "VkBufferCreateInfo": { + "core": [ + { + "vuid": "VUID-VkBufferCreateInfo-size-00912", + "text": " size must be greater than 0" + }, + { + "vuid": "VUID-VkBufferCreateInfo-sharingMode-00913", + "text": " If sharingMode is VK_SHARING_MODE_CONCURRENT, pQueueFamilyIndices must be a valid pointer to an array of queueFamilyIndexCount uint32_t values" + }, + { + "vuid": "VUID-VkBufferCreateInfo-sharingMode-00914", + "text": " If sharingMode is VK_SHARING_MODE_CONCURRENT, queueFamilyIndexCount must be greater than 1" + }, + { + "vuid": "VUID-VkBufferCreateInfo-flags-00915", + "text": " If the &amp;lt;&amp;lt;features-features-sparseBinding,sparse bindings&amp;gt;&amp;gt; feature is not enabled, flags must not contain VK_BUFFER_CREATE_SPARSE_BINDING_BIT" + }, + { + "vuid": "VUID-VkBufferCreateInfo-flags-00916", + "text": " If the &amp;lt;&amp;lt;features-features-sparseResidencyBuffer,sparse buffer residency&amp;gt;&amp;gt; feature is not enabled, flags must not contain VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT" + }, + { + "vuid": "VUID-VkBufferCreateInfo-flags-00917", + "text": " If the &amp;lt;&amp;lt;features-features-sparseResidencyAliased,sparse aliased residency&amp;gt;&amp;gt; feature is not enabled, flags must not contain VK_BUFFER_CREATE_SPARSE_ALIASED_BIT" + }, + { + "vuid": "VUID-VkBufferCreateInfo-flags-00918", + "text": " If flags contains VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT or VK_BUFFER_CREATE_SPARSE_ALIASED_BIT, it must also contain VK_BUFFER_CREATE_SPARSE_BINDING_BIT" + }, + { + "vuid": "VUID-VkBufferCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO" + }, + { + "vuid": "VUID-VkBufferCreateInfo-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDedicatedAllocationBufferCreateInfoNV or VkExternalMemoryBufferCreateInfo" + }, + { + "vuid": "VUID-VkBufferCreateInfo-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + }, + { + "vuid": "VUID-VkBufferCreateInfo-flags-parameter", + "text": " flags must be a valid combination of VkBufferCreateFlagBits values" + }, + { + "vuid": "VUID-VkBufferCreateInfo-usage-parameter", + "text": " usage must be a valid combination of VkBufferUsageFlagBits values" + }, + { + "vuid": "VUID-VkBufferCreateInfo-usage-requiredbitmask", + "text": " usage must not be 0" + }, + { + "vuid": "VUID-VkBufferCreateInfo-sharingMode-parameter", + "text": " sharingMode must be a valid VkSharingMode value" + } + ], + "!(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-VkBufferCreateInfo-sharingMode-01391", + "text": " If sharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the physicalDevice that was used to create device" + } + ], + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-VkBufferCreateInfo-sharingMode-01419", + "text": " If sharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by either vkGetPhysicalDeviceQueueFamilyProperties or vkGetPhysicalDeviceQueueFamilyProperties2 for the physicalDevice that was used to create device" + } + ], + "(VK_VERSION_1_1,VK_KHR_external_memory)": [ + { + "vuid": "VUID-VkBufferCreateInfo-pNext-00920", + "text": " If the pNext chain contains an instance of VkExternalMemoryBufferCreateInfo, its handleTypes member must only contain bits that are also in VkExternalBufferProperties::externalMemoryProperties.pname:compatibleHandleTypes, as returned by vkGetPhysicalDeviceExternalBufferProperties with pExternalBufferInfo\\-&amp;gt;handleType equal to any one of the handle types specified in VkExternalMemoryBufferCreateInfo::handleTypes" + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-VkBufferCreateInfo-flags-01887", + "text": " If the protected memory feature is not enabled, flags must not contain VK_BUFFER_CREATE_PROTECTED_BIT" + }, + { + "vuid": "VUID-VkBufferCreateInfo-None-01888", + "text": " If any of the bits VK_BUFFER_CREATE_SPARSE_BINDING_BIT, VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT, or VK_BUFFER_CREATE_SPARSE_ALIASED_BIT are set, VK_BUFFER_CREATE_PROTECTED_BIT must not also be set" + } + ], + "(VK_NV_dedicated_allocation)": [ + { + "vuid": "VUID-VkBufferCreateInfo-pNext-01571", + "text": " If the pNext chain contains an instance of VkDedicatedAllocationBufferCreateInfoNV, and the dedicatedAllocation member of the chained structure is VK_TRUE, then flags must not include VK_BUFFER_CREATE_SPARSE_BINDING_BIT, VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT, or VK_BUFFER_CREATE_SPARSE_ALIASED_BIT" + } + ] + }, + "VkDedicatedAllocationBufferCreateInfoNV": { + "(VK_NV_dedicated_allocation)": [ + { + "vuid": "VUID-VkDedicatedAllocationBufferCreateInfoNV-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV" + } + ] + }, + "VkExternalMemoryBufferCreateInfo": { + "(VK_VERSION_1_1,VK_KHR_external_memory)": [ + { + "vuid": "VUID-VkExternalMemoryBufferCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO" + }, + { + "vuid": "VUID-VkExternalMemoryBufferCreateInfo-handleTypes-parameter", + "text": " handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBits values" + } + ] + }, + "vkDestroyBuffer": { + "core": [ + { + "vuid": "VUID-vkDestroyBuffer-buffer-00922", + "text": " All submitted commands that refer to buffer, either directly or via a VkBufferView, must have completed execution" + }, + { + "vuid": "VUID-vkDestroyBuffer-buffer-00923", + "text": " If VkAllocationCallbacks were provided when buffer was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyBuffer-buffer-00924", + "text": " If no VkAllocationCallbacks were provided when buffer was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyBuffer-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyBuffer-buffer-parameter", + "text": " If buffer is not VK_NULL_HANDLE, buffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkDestroyBuffer-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyBuffer-buffer-parent", + "text": " If buffer is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkCreateBufferView": { + "core": [ + { + "vuid": "VUID-vkCreateBufferView-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateBufferView-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkBufferViewCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateBufferView-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateBufferView-pView-parameter", + "text": " pView must be a valid pointer to a VkBufferView handle" + } + ] + }, + "VkBufferViewCreateInfo": { + "core": [ + { + "vuid": "VUID-VkBufferViewCreateInfo-offset-00925", + "text": " offset must be less than the size of buffer" + }, + { + "vuid": "VUID-VkBufferViewCreateInfo-offset-00926", + "text": " offset must be a multiple of VkPhysicalDeviceLimits::minTexelBufferOffsetAlignment" + }, + { + "vuid": "VUID-VkBufferViewCreateInfo-range-00928", + "text": " If range is not equal to VK_WHOLE_SIZE, range must be greater than 0" + }, + { + "vuid": "VUID-VkBufferViewCreateInfo-range-00929", + "text": " If range is not equal to VK_WHOLE_SIZE, range must be a multiple of the element size of format" + }, + { + "vuid": "VUID-VkBufferViewCreateInfo-range-00930", + "text": " If range is not equal to VK_WHOLE_SIZE, range divided by the element size of format must be less than or equal to VkPhysicalDeviceLimits::maxTexelBufferElements" + }, + { + "vuid": "VUID-VkBufferViewCreateInfo-offset-00931", + "text": " If range is not equal to VK_WHOLE_SIZE, the sum of offset and range must be less than or equal to the size of buffer" + }, + { + "vuid": "VUID-VkBufferViewCreateInfo-buffer-00932", + "text": " buffer must have been created with a usage value containing at least one of VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT or VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT" + }, + { + "vuid": "VUID-VkBufferViewCreateInfo-buffer-00933", + "text": " If buffer was created with usage containing VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT, format must be supported for uniform texel buffers, as specified by the VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT flag in VkFormatProperties::bufferFeatures returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-VkBufferViewCreateInfo-buffer-00934", + "text": " If buffer was created with usage containing VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, format must be supported for storage texel buffers, as specified by the VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT flag in VkFormatProperties::bufferFeatures returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-VkBufferViewCreateInfo-buffer-00935", + "text": " If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-VkBufferViewCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO" + }, + { + "vuid": "VUID-VkBufferViewCreateInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkBufferViewCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkBufferViewCreateInfo-buffer-parameter", + "text": " buffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-VkBufferViewCreateInfo-format-parameter", + "text": " format must be a valid VkFormat value" + } + ] + }, + "vkDestroyBufferView": { + "core": [ + { + "vuid": "VUID-vkDestroyBufferView-bufferView-00936", + "text": " All submitted commands that refer to bufferView must have completed execution" + }, + { + "vuid": "VUID-vkDestroyBufferView-bufferView-00937", + "text": " If VkAllocationCallbacks were provided when bufferView was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyBufferView-bufferView-00938", + "text": " If no VkAllocationCallbacks were provided when bufferView was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyBufferView-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyBufferView-bufferView-parameter", + "text": " If bufferView is not VK_NULL_HANDLE, bufferView must be a valid VkBufferView handle" + }, + { + "vuid": "VUID-vkDestroyBufferView-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyBufferView-bufferView-parent", + "text": " If bufferView is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkCreateImage": { + "core": [ + { + "vuid": "VUID-vkCreateImage-flags-00939", + "text": " If the flags member of pCreateInfo includes VK_IMAGE_CREATE_SPARSE_BINDING_BIT, creating this VkImage must not cause the total required sparse memory for all currently valid sparse resources on the device to exceed VkPhysicalDeviceLimits::sparseAddressSpaceSize" + }, + { + "vuid": "VUID-vkCreateImage-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateImage-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkImageCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateImage-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateImage-pImage-parameter", + "text": " pImage must be a valid pointer to a VkImage handle" + } + ] + }, + "VkImageCreateInfo": { + "!(VK_ANDROID_external_memory_android_hardware_buffer)": [ + { + "vuid": "VUID-VkImageCreateInfo-format-00940", + "text": " The combination of format, imageType, tiling, usage, and flags must be supported, as indicated by a VK_SUCCESS return value from vkGetPhysicalDeviceImageFormatProperties invoked with the same values passed to the corresponding parameters." + } + ], + "(VK_ANDROID_external_memory_android_hardware_buffer)": [ + { + "vuid": "VUID-VkImageCreateInfo-pNext-01889", + "text": " If the pNext chain doesn’t contain an instance of VkExternalFormatANDROID, or if format is not VK_FORMAT_UNDEFINED, the combination of format, imageType, tiling, usage, and flags must be supported, as indicated by a VK_SUCCESS return value from vkGetPhysicalDeviceImageFormatProperties invoked with the same values passed to the corresponding parameters." + }, + { + "vuid": "VUID-VkImageCreateInfo-pNext-01892", + "text": " If the pNext chain includes a VkExternalMemoryImageCreateInfo structure whose handleTypes member includes VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID:" + }, + { + "vuid": "VUID-VkImageCreateInfo-pNext-01893", + "text": " If the pNext chain includes a VkExternalFormatANDROID structure whose externalFormat member is not 0:" + } + ], + "core": [ + { + "vuid": "VUID-VkImageCreateInfo-sharingMode-00941", + "text": " If sharingMode is VK_SHARING_MODE_CONCURRENT, pQueueFamilyIndices must be a valid pointer to an array of queueFamilyIndexCount uint32_t values" + }, + { + "vuid": "VUID-VkImageCreateInfo-sharingMode-00942", + "text": " If sharingMode is VK_SHARING_MODE_CONCURRENT, queueFamilyIndexCount must be greater than 1" + }, + { + "vuid": "VUID-VkImageCreateInfo-format-00943", + "text": " format must not be VK_FORMAT_UNDEFINED" + }, + { + "vuid": "VUID-VkImageCreateInfo-extent-00944", + "text": " extent::width must be greater than 0." + }, + { + "vuid": "VUID-VkImageCreateInfo-extent-00945", + "text": " extent::height must be greater than 0." + }, + { + "vuid": "VUID-VkImageCreateInfo-extent-00946", + "text": " extent::depth must be greater than 0." + }, + { + "vuid": "VUID-VkImageCreateInfo-mipLevels-00947", + "text": " mipLevels must be greater than 0" + }, + { + "vuid": "VUID-VkImageCreateInfo-arrayLayers-00948", + "text": " arrayLayers must be greater than 0" + }, + { + "vuid": "VUID-VkImageCreateInfo-flags-00949", + "text": " If flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, imageType must be VK_IMAGE_TYPE_2D" + }, + { + "vuid": "VUID-VkImageCreateInfo-imageType-00951", + "text": " If imageType is VK_IMAGE_TYPE_1D, extent.width must be less than or equal to VkPhysicalDeviceLimits::maxImageDimension1D, or VkImageFormatProperties::maxExtent.width (as returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure) - whichever is higher" + }, + { + "vuid": "VUID-VkImageCreateInfo-imageType-00952", + "text": " If imageType is VK_IMAGE_TYPE_2D and flags does not contain VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, extent.width and extent.height must be less than or equal to VkPhysicalDeviceLimits::maxImageDimension2D, or VkImageFormatProperties::maxExtent.width/height (as returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure) - whichever is higher" + }, + { + "vuid": "VUID-VkImageCreateInfo-imageType-00953", + "text": " If imageType is VK_IMAGE_TYPE_2D and flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, extent.width and extent.height must be less than or equal to VkPhysicalDeviceLimits::maxImageDimensionCube, or VkImageFormatProperties::maxExtent.width/height (as returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure) - whichever is higher" + }, + { + "vuid": "VUID-VkImageCreateInfo-imageType-00954", + "text": " If imageType is VK_IMAGE_TYPE_2D and flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, extent.width and extent.height must be equal and arrayLayers must be greater than or equal to 6" + }, + { + "vuid": "VUID-VkImageCreateInfo-imageType-00955", + "text": " If imageType is VK_IMAGE_TYPE_3D, extent.width, extent.height and extent.depth must be less than or equal to VkPhysicalDeviceLimits::maxImageDimension3D, or VkImageFormatProperties::maxExtent.width/height/depth (as returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure) - whichever is higher" + }, + { + "vuid": "VUID-VkImageCreateInfo-imageType-00956", + "text": " If imageType is VK_IMAGE_TYPE_1D, both extent.height and extent.depth must be 1" + }, + { + "vuid": "VUID-VkImageCreateInfo-imageType-00957", + "text": " If imageType is VK_IMAGE_TYPE_2D, extent.depth must be 1" + }, + { + "vuid": "VUID-VkImageCreateInfo-mipLevels-00958", + "text": " mipLevels must be less than or equal to {lfloor}log2(max(extent.width, extent.height, extent.depth)){rfloor} + 1." + }, + { + "vuid": "VUID-VkImageCreateInfo-extent-00959", + "text": " mipLevels must be less than or equal to VkImageFormatProperties::maxMipLevels (as returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure)" + }, + { + "vuid": "VUID-VkImageCreateInfo-arrayLayers-00960", + "text": " arrayLayers must be less than or equal to VkImageFormatProperties::maxArrayLayers (as returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure)" + }, + { + "vuid": "VUID-VkImageCreateInfo-imageType-00961", + "text": " If imageType is VK_IMAGE_TYPE_3D, arrayLayers must be 1." + }, + { + "vuid": "VUID-VkImageCreateInfo-samples-00962", + "text": " If samples is not VK_SAMPLE_COUNT_1_BIT, imageType must be VK_IMAGE_TYPE_2D, flags must not contain VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, tiling must be VK_IMAGE_TILING_OPTIMAL, and mipLevels must be equal to 1" + }, + { + "vuid": "VUID-VkImageCreateInfo-usage-00963", + "text": " If usage includes VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, then bits other than VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, and VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT must not be set" + }, + { + "vuid": "VUID-VkImageCreateInfo-usage-00964", + "text": " If usage includes VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, or VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, extent.width must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferWidth" + }, + { + "vuid": "VUID-VkImageCreateInfo-usage-00965", + "text": " If usage includes VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, or VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, extent.height must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferHeight" + }, + { + "vuid": "VUID-VkImageCreateInfo-usage-00966", + "text": " If usage includes VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, usage must also contain at least one of VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, or VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT." + }, + { + "vuid": "VUID-VkImageCreateInfo-samples-00967", + "text": " samples must be a bit value that is set in VkImageFormatProperties::sampleCounts returned by vkGetPhysicalDeviceImageFormatProperties with format, imageType, tiling, usage, and flags equal to those in this structure" + }, + { + "vuid": "VUID-VkImageCreateInfo-usage-00968", + "text": " If the &amp;lt;&amp;lt;features-features-shaderStorageImageMultisample,multisampled storage images&amp;gt;&amp;gt; feature is not enabled, and usage contains VK_IMAGE_USAGE_STORAGE_BIT, samples must be VK_SAMPLE_COUNT_1_BIT" + }, + { + "vuid": "VUID-VkImageCreateInfo-flags-00969", + "text": " If the &amp;lt;&amp;lt;features-features-sparseBinding,sparse bindings&amp;gt;&amp;gt; feature is not enabled, flags must not contain VK_IMAGE_CREATE_SPARSE_BINDING_BIT" + }, + { + "vuid": "VUID-VkImageCreateInfo-flags-01924", + "text": " If the &amp;lt;&amp;lt;features-features-sparseResidencyAliased,sparse aliased residency&amp;gt;&amp;gt; feature is not enabled, flags must not contain VK_IMAGE_CREATE_SPARSE_ALIASED_BIT" + }, + { + "vuid": "VUID-VkImageCreateInfo-imageType-00970", + "text": " If imageType is VK_IMAGE_TYPE_1D, flags must not contain VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT" + }, + { + "vuid": "VUID-VkImageCreateInfo-imageType-00971", + "text": " If the &amp;lt;&amp;lt;features-features-sparseResidencyImage2D,sparse residency for 2D images&amp;gt;&amp;gt; feature is not enabled, and imageType is VK_IMAGE_TYPE_2D, flags must not contain VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT" + }, + { + "vuid": "VUID-VkImageCreateInfo-imageType-00972", + "text": " If the &amp;lt;&amp;lt;features-features-sparseResidencyImage3D,sparse residency for 3D images&amp;gt;&amp;gt; feature is not enabled, and imageType is VK_IMAGE_TYPE_3D, flags must not contain VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT" + }, + { + "vuid": "VUID-VkImageCreateInfo-imageType-00973", + "text": " If the &amp;lt;&amp;lt;features-features-sparseResidency2Samples,sparse residency for images with 2 samples&amp;gt;&amp;gt; feature is not enabled, imageType is VK_IMAGE_TYPE_2D, and samples is VK_SAMPLE_COUNT_2_BIT, flags must not contain VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT" + }, + { + "vuid": "VUID-VkImageCreateInfo-imageType-00974", + "text": " If the &amp;lt;&amp;lt;features-features-sparseResidency4Samples,sparse residency for images with 4 samples&amp;gt;&amp;gt; feature is not enabled, imageType is VK_IMAGE_TYPE_2D, and samples is VK_SAMPLE_COUNT_4_BIT, flags must not contain VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT" + }, + { + "vuid": "VUID-VkImageCreateInfo-imageType-00975", + "text": " If the &amp;lt;&amp;lt;features-features-sparseResidency8Samples,sparse residency for images with 8 samples&amp;gt;&amp;gt; feature is not enabled, imageType is VK_IMAGE_TYPE_2D, and samples is VK_SAMPLE_COUNT_8_BIT, flags must not contain VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT" + }, + { + "vuid": "VUID-VkImageCreateInfo-imageType-00976", + "text": " If the &amp;lt;&amp;lt;features-features-sparseResidency16Samples,sparse residency for images with 16 samples&amp;gt;&amp;gt; feature is not enabled, imageType is VK_IMAGE_TYPE_2D, and samples is VK_SAMPLE_COUNT_16_BIT, flags must not contain VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT" + }, + { + "vuid": "VUID-VkImageCreateInfo-flags-00987", + "text": " If flags contains VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT or VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, it must also contain VK_IMAGE_CREATE_SPARSE_BINDING_BIT" + }, + { + "vuid": "VUID-VkImageCreateInfo-None-01925", + "text": " If any of the bits VK_IMAGE_CREATE_SPARSE_BINDING_BIT, VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, or VK_IMAGE_CREATE_SPARSE_ALIASED_BIT are set, VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT must not also be set" + }, + { + "vuid": "VUID-VkImageCreateInfo-initialLayout-00993", + "text": " initialLayout must be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED." + }, + { + "vuid": "VUID-VkImageCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO" + }, + { + "vuid": "VUID-VkImageCreateInfo-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDedicatedAllocationImageCreateInfoNV, VkExternalFormatANDROID, VkExternalMemoryImageCreateInfo, VkExternalMemoryImageCreateInfoNV, VkImageFormatListCreateInfoKHR, or VkImageSwapchainCreateInfoKHR" + }, + { + "vuid": "VUID-VkImageCreateInfo-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + }, + { + "vuid": "VUID-VkImageCreateInfo-flags-parameter", + "text": " flags must be a valid combination of VkImageCreateFlagBits values" + }, + { + "vuid": "VUID-VkImageCreateInfo-imageType-parameter", + "text": " imageType must be a valid VkImageType value" + }, + { + "vuid": "VUID-VkImageCreateInfo-format-parameter", + "text": " format must be a valid VkFormat value" + }, + { + "vuid": "VUID-VkImageCreateInfo-samples-parameter", + "text": " samples must be a valid VkSampleCountFlagBits value" + }, + { + "vuid": "VUID-VkImageCreateInfo-tiling-parameter", + "text": " tiling must be a valid VkImageTiling value" + }, + { + "vuid": "VUID-VkImageCreateInfo-usage-parameter", + "text": " usage must be a valid combination of VkImageUsageFlagBits values" + }, + { + "vuid": "VUID-VkImageCreateInfo-usage-requiredbitmask", + "text": " usage must not be 0" + }, + { + "vuid": "VUID-VkImageCreateInfo-sharingMode-parameter", + "text": " sharingMode must be a valid VkSharingMode value" + }, + { + "vuid": "VUID-VkImageCreateInfo-initialLayout-parameter", + "text": " initialLayout must be a valid VkImageLayout value" + } + ], + "!(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-VkImageCreateInfo-sharingMode-01392", + "text": " If sharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the physicalDevice that was used to create device" + } + ], + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-VkImageCreateInfo-sharingMode-01420", + "text": " If sharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by either vkGetPhysicalDeviceQueueFamilyProperties or vkGetPhysicalDeviceQueueFamilyProperties2 for the physicalDevice that was used to create device" + } + ], + "(VK_VERSION_1_1,VK_KHR_maintenance1)": [ + { + "vuid": "VUID-VkImageCreateInfo-flags-00950", + "text": " If flags contains VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, imageType must be VK_IMAGE_TYPE_3D" + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-VkImageCreateInfo-flags-01890", + "text": " If the protected memory feature is not enabled, flags must not contain VK_IMAGE_CREATE_PROTECTED_BIT." + }, + { + "vuid": "VUID-VkImageCreateInfo-None-01891", + "text": " If any of the bits VK_IMAGE_CREATE_SPARSE_BINDING_BIT, VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, or VK_IMAGE_CREATE_SPARSE_ALIASED_BIT are set, VK_IMAGE_CREATE_PROTECTED_BIT must not also be set." + } + ], + "(VK_VERSION_1_1,VK_KHR_external_memory)+(VK_NV_external_memory)": [ + { + "vuid": "VUID-VkImageCreateInfo-pNext-00988", + "text": " If the pNext chain contains an instance of VkExternalMemoryImageCreateInfoNV, it must not contain an instance of VkExternalMemoryImageCreateInfo." + } + ], + "(VK_VERSION_1_1,VK_KHR_external_memory)": [ + { + "vuid": "VUID-VkImageCreateInfo-pNext-00990", + "text": " If the pNext chain contains an instance of VkExternalMemoryImageCreateInfo, its handleTypes member must only contain bits that are also in VkExternalImageFormatProperties::externalMemoryProperties::compatibleHandleTypes, as returned by vkGetPhysicalDeviceImageFormatProperties2 with format, imageType, tiling, usage, and flags equal to those in this structure, and with an instance of VkPhysicalDeviceExternalImageFormatInfo in the pNext chain, with a handleType equal to any one of the handle types specified in VkExternalMemoryImageCreateInfo::handleTypes" + } + ], + "(VK_NV_external_memory+VK_NV_external_memory_capabilities)": [ + { + "vuid": "VUID-VkImageCreateInfo-pNext-00991", + "text": " If the pNext chain contains an instance of VkExternalMemoryImageCreateInfoNV, its handleTypes member must only contain bits that are also in VkExternalImageFormatPropertiesNV::externalMemoryProperties::compatibleHandleTypes, as returned by vkGetPhysicalDeviceExternalImageFormatPropertiesNV with format, imageType, tiling, usage, and flags equal to those in this structure, and with externalHandleType equal to any one of the handle types specified in VkExternalMemoryImageCreateInfoNV::handleTypes" + } + ], + "(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-VkImageCreateInfo-physicalDeviceCount-01421", + "text": " If the logical device was created with VkDeviceGroupDeviceCreateInfo::physicalDeviceCount equal to 1, flags must not contain VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT" + }, + { + "vuid": "VUID-VkImageCreateInfo-flags-00992", + "text": " If flags contains VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT, then mipLevels must be one, arrayLayers must be one, imageType must be VK_IMAGE_TYPE_2D, and tiling must be VK_IMAGE_TILING_OPTIMAL" + } + ], + "(VK_VERSION_1_1,VK_KHR_maintenance2)": [ + { + "vuid": "VUID-VkImageCreateInfo-flags-01572", + "text": " If flags contains VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, then format must be a &amp;lt;&amp;lt;appendix-compressedtex-bc,block-compressed image format&amp;gt;&amp;gt;, an &amp;lt;&amp;lt;appendix-compressedtex-etc2, ETC compressed image format&amp;gt;&amp;gt;, or an &amp;lt;&amp;lt;appendix-compressedtex-astc, ASTC compressed image format&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-VkImageCreateInfo-flags-01573", + "text": " If flags contains VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, then flags must also contain VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT." + } + ], + "(VK_VERSION_1_1,VK_KHR_external_memory,VK_NV_external_memory)": [ + { + "vuid": "VUID-VkImageCreateInfo-pNext-01443", + "text": " If the pNext chain includes a ifdef::VK_VERSION_1_1,VK_KHR_external_memory[VkExternalMemoryImageCreateInfo]" + } + ], + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkImageCreateInfo-format-01574", + "text": " If the image format is one of those listed in &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion&amp;gt;&amp;gt;:" + }, + { + "vuid": "VUID-VkImageCreateInfo-tiling-01575", + "text": " If tiling is VK_IMAGE_TILING_OPTIMAL, format is a multi-planar format, and VkFormatProperties::optimalTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_DISJOINT_BIT, flags must not contain VK_IMAGE_CREATE_DISJOINT_BIT" + }, + { + "vuid": "VUID-VkImageCreateInfo-tiling-01576", + "text": " If tiling is VK_IMAGE_TILING_LINEAR, format is a multi-planar format, and VkFormatProperties::linearTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_DISJOINT_BIT, flags must not contain VK_IMAGE_CREATE_DISJOINT_BIT" + }, + { + "vuid": "VUID-VkImageCreateInfo-format-01577", + "text": " If format is not a multi-planar format, and flags does not include VK_IMAGE_CREATE_ALIAS_BIT, flags must not contain VK_IMAGE_CREATE_DISJOINT_BIT" + } + ], + "(VK_EXT_sample_locations)": [ + { + "vuid": "VUID-VkImageCreateInfo-flags-01533", + "text": " If flags contains VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT format must be a depth or depth/stencil format" + } + ] + }, + "VkDedicatedAllocationImageCreateInfoNV": { + "(VK_NV_dedicated_allocation)": [ + { + "vuid": "VUID-VkDedicatedAllocationImageCreateInfoNV-dedicatedAllocation-00994", + "text": " If dedicatedAllocation is VK_TRUE, VkImageCreateInfo::flags must not include VK_IMAGE_CREATE_SPARSE_BINDING_BIT, VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, or VK_IMAGE_CREATE_SPARSE_ALIASED_BIT" + }, + { + "vuid": "VUID-VkDedicatedAllocationImageCreateInfoNV-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV" + } + ] + }, + "VkExternalMemoryImageCreateInfo": { + "(VK_VERSION_1_1,VK_KHR_external_memory)": [ + { + "vuid": "VUID-VkExternalMemoryImageCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO" + }, + { + "vuid": "VUID-VkExternalMemoryImageCreateInfo-handleTypes-parameter", + "text": " handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBits values" + }, + { + "vuid": "VUID-VkExternalMemoryImageCreateInfo-handleTypes-requiredbitmask", + "text": " handleTypes must not be 0" + } + ] + }, + "VkExternalMemoryImageCreateInfoNV": { + "(VK_NV_external_memory)": [ + { + "vuid": "VUID-VkExternalMemoryImageCreateInfoNV-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV" + }, + { + "vuid": "VUID-VkExternalMemoryImageCreateInfoNV-handleTypes-parameter", + "text": " handleTypes must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values" + } + ] + }, + "VkExternalFormatANDROID": { + "(VK_ANDROID_external_memory_android_hardware_buffer)": [ + { + "vuid": "VUID-VkExternalFormatANDROID-externalFormat-01894", + "text": " externalFormat must be 0 or a value returned in the externalFormat member of VkAndroidHardwareBufferFormatPropertiesANDROID by an earlier call to vkGetAndroidHardwareBufferPropertiesANDROID" + }, + { + "vuid": "VUID-VkExternalFormatANDROID-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID" + } + ] + }, + "VkImageSwapchainCreateInfoKHR": { + "(VK_VERSION_1_1,VK_KHR_device_group)+(VK_KHR_swapchain)": [ + { + "vuid": "VUID-VkImageSwapchainCreateInfoKHR-swapchain-00995", + "text": " If swapchain is not VK_NULL_HANDLE, the fields of VkImageCreateInfo must match the &amp;lt;&amp;lt;swapchain-wsi-image-create-info, implied image creation parameters&amp;gt;&amp;gt; of the swapchain" + }, + { + "vuid": "VUID-VkImageSwapchainCreateInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR" + }, + { + "vuid": "VUID-VkImageSwapchainCreateInfoKHR-swapchain-parameter", + "text": " If swapchain is not VK_NULL_HANDLE, swapchain must be a valid VkSwapchainKHR handle" + } + ] + }, + "VkImageFormatListCreateInfoKHR": { + "(VK_KHR_image_format_list)": [ + { + "vuid": "VUID-VkImageFormatListCreateInfoKHR-viewFormatCount-01578", + "text": " If viewFormatCount is not 0, all of the formats in the pViewFormats array must be compatible with the format specified in the format field of VkImageCreateInfo, as described in the compatibility table." + }, + { + "vuid": "VUID-VkImageFormatListCreateInfoKHR-flags-01579", + "text": " If VkImageCreateInfo::flags does not contain VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, viewFormatCount must be 0 or 1." + }, + { + "vuid": "VUID-VkImageFormatListCreateInfoKHR-viewFormatCount-01580", + "text": " If viewFormatCount is not 0, VkImageCreateInfo::format must be in pViewFormats." + }, + { + "vuid": "VUID-VkImageFormatListCreateInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR" + }, + { + "vuid": "VUID-VkImageFormatListCreateInfoKHR-pViewFormats-parameter", + "text": " If viewFormatCount is not 0, pViewFormats must be a valid pointer to an array of viewFormatCount valid VkFormat values" + } + ] + }, + "vkGetImageSubresourceLayout": { + "core": [ + { + "vuid": "VUID-vkGetImageSubresourceLayout-image-00996", + "text": " image must have been created with tiling equal to VK_IMAGE_TILING_LINEAR" + }, + { + "vuid": "VUID-vkGetImageSubresourceLayout-aspectMask-00997", + "text": " The aspectMask member of pSubresource must only have a single bit set" + }, + { + "vuid": "VUID-vkGetImageSubresourceLayout-mipLevel-01716", + "text": " The mipLevel member of pSubresource must be less than the mipLevels specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-vkGetImageSubresourceLayout-arrayLayer-01717", + "text": " The arrayLayer member of pSubresource must be less than the arrayLayers specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-vkGetImageSubresourceLayout-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetImageSubresourceLayout-image-parameter", + "text": " image must be a valid VkImage handle" + }, + { + "vuid": "VUID-vkGetImageSubresourceLayout-pSubresource-parameter", + "text": " pSubresource must be a valid pointer to a valid VkImageSubresource structure" + }, + { + "vuid": "VUID-vkGetImageSubresourceLayout-pLayout-parameter", + "text": " pLayout must be a valid pointer to a VkSubresourceLayout structure" + }, + { + "vuid": "VUID-vkGetImageSubresourceLayout-image-parent", + "text": " image must have been created, allocated, or retrieved from device" + } + ], + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-vkGetImageSubresourceLayout-format-01581", + "text": " If the format of image is a &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion,multi-planar format&amp;gt;&amp;gt; with two planes, the aspectMask member of pSubresource must be VK_IMAGE_ASPECT_PLANE_0_BIT or VK_IMAGE_ASPECT_PLANE_1_BIT" + }, + { + "vuid": "VUID-vkGetImageSubresourceLayout-format-01582", + "text": " If the format of image is a &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion,multi-planar format&amp;gt;&amp;gt; with three planes, the aspectMask member of pSubresource must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT or VK_IMAGE_ASPECT_PLANE_2_BIT" + } + ], + "(VK_ANDROID_external_memory_android_hardware_buffer)": [ + { + "vuid": "VUID-vkGetImageSubresourceLayout-image-01895", + "text": " If image was created with the VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID external memory handle type, then image must be bound to memory." + } + ] + }, + "VkImageSubresource": { + "core": [ + { + "vuid": "VUID-VkImageSubresource-aspectMask-parameter", + "text": " aspectMask must be a valid combination of VkImageAspectFlagBits values" + }, + { + "vuid": "VUID-VkImageSubresource-aspectMask-requiredbitmask", + "text": " aspectMask must not be 0" + } + ] + }, + "vkDestroyImage": { + "core": [ + { + "vuid": "VUID-vkDestroyImage-image-01000", + "text": " All submitted commands that refer to image, either directly or via a VkImageView, must have completed execution" + }, + { + "vuid": "VUID-vkDestroyImage-image-01001", + "text": " If VkAllocationCallbacks were provided when image was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyImage-image-01002", + "text": " If no VkAllocationCallbacks were provided when image was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyImage-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyImage-image-parameter", + "text": " If image is not VK_NULL_HANDLE, image must be a valid VkImage handle" + }, + { + "vuid": "VUID-vkDestroyImage-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyImage-image-parent", + "text": " If image is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkCreateImageView": { + "core": [ + { + "vuid": "VUID-vkCreateImageView-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateImageView-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkImageViewCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateImageView-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateImageView-pView-parameter", + "text": " pView must be a valid pointer to a VkImageView handle" + } + ] + }, + "VkImageViewCreateInfo": { + "core": [ + { + "vuid": "VUID-VkImageViewCreateInfo-image-01003", + "text": " If image was not created with VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT then viewType must not be VK_IMAGE_VIEW_TYPE_CUBE or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-viewType-01004", + "text": " If the &amp;lt;&amp;lt;features-features-imageCubeArray,image cubemap arrays&amp;gt;&amp;gt; feature is not enabled, viewType must not be VK_IMAGE_VIEW_TYPE_CUBE_ARRAY" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-image-01006", + "text": " If image was created with VK_IMAGE_TILING_LINEAR, format must be format that has at least one supported feature bit present in the value of VkFormatProperties::linearTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-image-01007", + "text": " image must have been created with a usage value containing at least one of VK_IMAGE_USAGE_SAMPLED_BIT, VK_IMAGE_USAGE_STORAGE_BIT, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, or VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-image-01008", + "text": " If image was created with VK_IMAGE_TILING_LINEAR and usage contains VK_IMAGE_USAGE_SAMPLED_BIT, format must be supported for sampled images, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT flag in VkFormatProperties::linearTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-image-01009", + "text": " If image was created with VK_IMAGE_TILING_LINEAR and usage contains VK_IMAGE_USAGE_STORAGE_BIT, format must be supported for storage images, as specified by the VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT flag in VkFormatProperties::linearTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-image-01010", + "text": " If image was created with VK_IMAGE_TILING_LINEAR and usage contains VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, format must be supported for color attachments, as specified by the VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT flag in VkFormatProperties::linearTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-image-01011", + "text": " If image was created with VK_IMAGE_TILING_LINEAR and usage contains VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, format must be supported for depth/stencil attachments, as specified by the VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT flag in VkFormatProperties::linearTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-image-01012", + "text": " If image was created with VK_IMAGE_TILING_OPTIMAL, format must be format that has at least one supported feature bit present in the value of VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-image-01013", + "text": " If image was created with VK_IMAGE_TILING_OPTIMAL and usage contains VK_IMAGE_USAGE_SAMPLED_BIT, format must be supported for sampled images, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT flag in VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-image-01014", + "text": " If image was created with VK_IMAGE_TILING_OPTIMAL and usage contains VK_IMAGE_USAGE_STORAGE_BIT, format must be supported for storage images, as specified by the VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT flag in VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-image-01015", + "text": " If image was created with VK_IMAGE_TILING_OPTIMAL and usage contains VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, format must be supported for color attachments, as specified by the VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT flag in VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-image-01016", + "text": " If image was created with VK_IMAGE_TILING_OPTIMAL and usage contains VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, format must be supported for depth/stencil attachments, as specified by the VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT flag in VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-subresourceRange-01478", + "text": " subresourceRange.baseMipLevel must be less than the mipLevels specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-subresourceRange-01718", + "text": " If subresourceRange.levelCount is not VK_REMAINING_MIP_LEVELS, subresourceRange.baseMipLevel + subresourceRange.levelCount must be less than or equal to the mipLevels specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-image-01018", + "text": " If image was created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, format must be compatible with the format used to create image, as defined in &amp;lt;&amp;lt;features-formats-compatibility-classes,Format Compatibility Classes&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-image-01020", + "text": " If image is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-subResourceRange-01021", + "text": " subresourceRange and viewType must be compatible with the image, as described in the &amp;lt;&amp;lt;resources-image-views-compatibility,compatibility table&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkImageViewUsageCreateInfo or VkSamplerYcbcrConversionInfo" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-image-parameter", + "text": " image must be a valid VkImage handle" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-viewType-parameter", + "text": " viewType must be a valid VkImageViewType value" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-format-parameter", + "text": " format must be a valid VkFormat value" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-components-parameter", + "text": " components must be a valid VkComponentMapping structure" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-subresourceRange-parameter", + "text": " subresourceRange must be a valid VkImageSubresourceRange structure" + } + ], + "(VK_VERSION_1_1,VK_KHR_maintenance1)": [ + { + "vuid": "VUID-VkImageViewCreateInfo-image-01005", + "text": " If image was created with VK_IMAGE_TYPE_3D but without VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT set then viewType must not be VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-image-01482", + "text": " If image is not a 3D image created with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT set, or viewType is not VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY, subresourceRange::baseArrayLayer must be less than the arrayLayers specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-subresourceRange-01483", + "text": " If subresourceRange::layerCount is not VK_REMAINING_ARRAY_LAYERS, image is not a 3D image created with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT set, or viewType is not VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY, subresourceRange::layerCount must be non-zero and subresourceRange::baseArrayLayer + subresourceRange::layerCount must be less than or equal to the arrayLayers specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-image-01484", + "text": " If image is a 3D image created with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT set, and viewType is VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY, subresourceRange::baseArrayLayer must be less than the extent.depth specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-subresourceRange-01485", + "text": " If subresourceRange::layerCount is not VK_REMAINING_ARRAY_LAYERS, image is a 3D image created with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT set, and viewType is VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY, subresourceRange::layerCount must be non-zero and subresourceRange::baseArrayLayer + subresourceRange::layerCount must be less than or equal to the extent.depth specified in VkImageCreateInfo when image was created" + } + ], + "!(VK_VERSION_1_1,VK_KHR_maintenance1)": [ + { + "vuid": "VUID-VkImageViewCreateInfo-subresourceRange-01480", + "text": " subresourceRange.baseArrayLayer must be less than the arrayLayers specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-subresourceRange-01719", + "text": " If subresourceRange.layerCount is not VK_REMAINING_ARRAY_LAYERS, subresourceRange.baseArrayLayer + subresourceRange.layerCount must be less than or equal to the arrayLayers specified in VkImageCreateInfo when image was created" + } + ], + "(VK_VERSION_1_1,VK_KHR_maintenance2)+!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkImageViewCreateInfo-image-01759", + "text": " If image was created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, but without the VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag, format must be compatible with the format used to create image, as defined in &amp;lt;&amp;lt;features-formats-compatibility-classes,Format Compatibility Classes&amp;gt;&amp;gt;" + } + ], + "!(VK_VERSION_1_1,VK_KHR_maintenance2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkImageViewCreateInfo-image-01760", + "text": " If image was created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, and if the format of the image is not a &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion,multi-planar&amp;gt;&amp;gt; format, format must be compatible with the format used to create image, as defined in &amp;lt;&amp;lt;features-formats-compatibility-classes,Format Compatibility Classes&amp;gt;&amp;gt;" + } + ], + "(VK_VERSION_1_1,VK_KHR_maintenance2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkImageViewCreateInfo-image-01761", + "text": " If image was created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, but without the VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag, and if the format of the image is not a &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion,multi-planar&amp;gt;&amp;gt; format, format must be compatible with the format used to create image, as defined in &amp;lt;&amp;lt;features-formats-compatibility-classes,Format Compatibility Classes&amp;gt;&amp;gt;" + } + ], + "(VK_VERSION_1_1,VK_KHR_maintenance2)": [ + { + "vuid": "VUID-VkImageViewCreateInfo-image-01583", + "text": " If image was created with the VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag, format must be compatible with, or must be an uncompressed format that is size-compatible with, the format used to create image." + }, + { + "vuid": "VUID-VkImageViewCreateInfo-image-01584", + "text": " If image was created with the VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag, the levelCount and layerCount members of subresourceRange must both be 1." + } + ], + "(VK_KHR_image_format_list)": [ + { + "vuid": "VUID-VkImageViewCreateInfo-pNext-01585", + "text": " If a VkImageFormatListCreateInfoKHR structure was included in the pNext chain of the VkImageCreateInfo struct used when creating image and the viewFormatCount field of VkImageFormatListCreateInfoKHR is not zero then format must be one of the formats in VkImageFormatListCreateInfoKHR::pViewFormats." + } + ], + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkImageViewCreateInfo-image-01586", + "text": " If image was created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, if the format of the image is a &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion,multi-planar&amp;gt;&amp;gt; format, and if subresourceRange.aspectMask is one of VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT, then format must be compatible with the VkFormat for the plane of the image format indicated by subresourceRange.aspectMask, as defined in &amp;lt;&amp;lt;features-formats-compatible-planes&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-VkImageViewCreateInfo-image-01762", + "text": " If image was not created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag," + } + ], + "!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkImageViewCreateInfo-image-01019", + "text": " If image was not created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, format must be identical to the format used to create image" + } + ], + "(VK_ANDROID_external_memory_android_hardware_buffer)": [ + { + "vuid": "VUID-VkImageViewCreateInfo-image-01896", + "text": " If image has an &amp;lt;&amp;lt;memory-external-android-hardware-buffer-external-formats,external format&amp;gt;&amp;gt;:" + } + ] + }, + "VkImageViewUsageCreateInfo": { + "(VK_VERSION_1_1,VK_KHR_maintenance2)": [ + { + "vuid": "VUID-VkImageViewUsageCreateInfo-usage-01587", + "text": " usage must not include any set bits that were not set in the usage member of the VkImageCreateInfo structure used to create the image this image view is created from." + }, + { + "vuid": "VUID-VkImageViewUsageCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO" + }, + { + "vuid": "VUID-VkImageViewUsageCreateInfo-usage-parameter", + "text": " usage must be a valid combination of VkImageUsageFlagBits values" + }, + { + "vuid": "VUID-VkImageViewUsageCreateInfo-usage-requiredbitmask", + "text": " usage must not be 0" + } + ] + }, + "VkImageSubresourceRange": { + "core": [ + { + "vuid": "VUID-VkImageSubresourceRange-levelCount-01720", + "text": " If levelCount is not VK_REMAINING_MIP_LEVELS, it must be greater than 0" + }, + { + "vuid": "VUID-VkImageSubresourceRange-layerCount-01721", + "text": " If layerCount is not VK_REMAINING_ARRAY_LAYERS, it must be greater than 0" + }, + { + "vuid": "VUID-VkImageSubresourceRange-aspectMask-parameter", + "text": " aspectMask must be a valid combination of VkImageAspectFlagBits values" + }, + { + "vuid": "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask", + "text": " aspectMask must not be 0" + } + ], + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkImageSubresourceRange-aspectMask-01670", + "text": " If aspectMask includes VK_IMAGE_ASPECT_COLOR_BIT, then it must not include any of VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT" + } + ] + }, + "VkComponentMapping": { + "core": [ + { + "vuid": "VUID-VkComponentMapping-r-parameter", + "text": " r must be a valid VkComponentSwizzle value" + }, + { + "vuid": "VUID-VkComponentMapping-g-parameter", + "text": " g must be a valid VkComponentSwizzle value" + }, + { + "vuid": "VUID-VkComponentMapping-b-parameter", + "text": " b must be a valid VkComponentSwizzle value" + }, + { + "vuid": "VUID-VkComponentMapping-a-parameter", + "text": " a must be a valid VkComponentSwizzle value" + } + ] + }, + "vkDestroyImageView": { + "core": [ + { + "vuid": "VUID-vkDestroyImageView-imageView-01026", + "text": " All submitted commands that refer to imageView must have completed execution" + }, + { + "vuid": "VUID-vkDestroyImageView-imageView-01027", + "text": " If VkAllocationCallbacks were provided when imageView was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyImageView-imageView-01028", + "text": " If no VkAllocationCallbacks were provided when imageView was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyImageView-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyImageView-imageView-parameter", + "text": " If imageView is not VK_NULL_HANDLE, imageView must be a valid VkImageView handle" + }, + { + "vuid": "VUID-vkDestroyImageView-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyImageView-imageView-parent", + "text": " If imageView is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkGetBufferMemoryRequirements": { + "core": [ + { + "vuid": "VUID-vkGetBufferMemoryRequirements-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetBufferMemoryRequirements-buffer-parameter", + "text": " buffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkGetBufferMemoryRequirements-pMemoryRequirements-parameter", + "text": " pMemoryRequirements must be a valid pointer to a VkMemoryRequirements structure" + }, + { + "vuid": "VUID-vkGetBufferMemoryRequirements-buffer-parent", + "text": " buffer must have been created, allocated, or retrieved from device" + } + ] + }, + "vkGetImageMemoryRequirements": { + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-vkGetImageMemoryRequirements-image-01588", + "text": " image must not have been created with the VK_IMAGE_CREATE_DISJOINT_BIT flag set" + } + ], + "core": [ + { + "vuid": "VUID-vkGetImageMemoryRequirements-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetImageMemoryRequirements-image-parameter", + "text": " image must be a valid VkImage handle" + }, + { + "vuid": "VUID-vkGetImageMemoryRequirements-pMemoryRequirements-parameter", + "text": " pMemoryRequirements must be a valid pointer to a VkMemoryRequirements structure" + }, + { + "vuid": "VUID-vkGetImageMemoryRequirements-image-parent", + "text": " image must have been created, allocated, or retrieved from device" + } + ] + }, + "vkGetBufferMemoryRequirements2": { + "(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)": [ + { + "vuid": "VUID-vkGetBufferMemoryRequirements2-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetBufferMemoryRequirements2-pInfo-parameter", + "text": " pInfo must be a valid pointer to a valid VkBufferMemoryRequirementsInfo2 structure" + }, + { + "vuid": "VUID-vkGetBufferMemoryRequirements2-pMemoryRequirements-parameter", + "text": " pMemoryRequirements must be a valid pointer to a VkMemoryRequirements2 structure" + } + ] + }, + "VkBufferMemoryRequirementsInfo2": { + "(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)": [ + { + "vuid": "VUID-VkBufferMemoryRequirementsInfo2-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2" + }, + { + "vuid": "VUID-VkBufferMemoryRequirementsInfo2-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkBufferMemoryRequirementsInfo2-buffer-parameter", + "text": " buffer must be a valid VkBuffer handle" + } + ] + }, + "vkGetImageMemoryRequirements2": { + "(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)": [ + { + "vuid": "VUID-vkGetImageMemoryRequirements2-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetImageMemoryRequirements2-pInfo-parameter", + "text": " pInfo must be a valid pointer to a valid VkImageMemoryRequirementsInfo2 structure" + }, + { + "vuid": "VUID-vkGetImageMemoryRequirements2-pMemoryRequirements-parameter", + "text": " pMemoryRequirements must be a valid pointer to a VkMemoryRequirements2 structure" + } + ] + }, + "VkImageMemoryRequirementsInfo2": { + "(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkImageMemoryRequirementsInfo2-image-01589", + "text": " If image was created with a multi-planar format and the VK_IMAGE_CREATE_DISJOINT_BIT flag, there must be a VkImagePlaneMemoryRequirementsInfo in the pNext chain of the VkImageMemoryRequirementsInfo2 structure" + }, + { + "vuid": "VUID-VkImageMemoryRequirementsInfo2-image-01590", + "text": " If image was not created with the VK_IMAGE_CREATE_DISJOINT_BIT flag, there must not be a VkImagePlaneMemoryRequirementsInfo in the pNext chain of the VkImageMemoryRequirementsInfo2 structure" + }, + { + "vuid": "VUID-VkImageMemoryRequirementsInfo2-image-01591", + "text": " If image was created with a single-plane format, there must not be a VkImagePlaneMemoryRequirementsInfo in the pNext chain of the VkImageMemoryRequirementsInfo2 structure" + } + ], + "(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)+(VK_ANDROID_external_memory_android_hardware_buffer)": [ + { + "vuid": "VUID-VkImageMemoryRequirementsInfo2-image-01897", + "text": " If image was created with the VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID external memory handle type, then image must be bound to memory." + } + ], + "(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)": [ + { + "vuid": "VUID-VkImageMemoryRequirementsInfo2-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2" + }, + { + "vuid": "VUID-VkImageMemoryRequirementsInfo2-pNext-pNext", + "text": " pNext must be NULL or a pointer to a valid instance of VkImagePlaneMemoryRequirementsInfo" + }, + { + "vuid": "VUID-VkImageMemoryRequirementsInfo2-image-parameter", + "text": " image must be a valid VkImage handle" + } + ] + }, + "VkImagePlaneMemoryRequirementsInfo": { + "(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkImagePlaneMemoryRequirementsInfo-planeAspect-01592", + "text": " planeAspect must be an aspect that exists in the format; that is, for a two-plane image planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT or VK_IMAGE_ASPECT_PLANE_1_BIT, and for a three-plane image planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT or VK_IMAGE_ASPECT_PLANE_2_BIT" + }, + { + "vuid": "VUID-VkImagePlaneMemoryRequirementsInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO" + }, + { + "vuid": "VUID-VkImagePlaneMemoryRequirementsInfo-planeAspect-parameter", + "text": " planeAspect must be a valid VkImageAspectFlagBits value" + } + ] + }, + "VkMemoryRequirements2": { + "(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)": [ + { + "vuid": "VUID-VkMemoryRequirements2-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2" + }, + { + "vuid": "VUID-VkMemoryRequirements2-pNext-pNext", + "text": " pNext must be NULL or a pointer to a valid instance of VkMemoryDedicatedRequirements" + } + ] + }, + "VkMemoryDedicatedRequirements": { + "(VK_VERSION_1_1,VK_KHR_dedicated_allocation)": [ + { + "vuid": "VUID-VkMemoryDedicatedRequirements-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS" + } + ] + }, + "vkBindBufferMemory": { + "core": [ + { + "vuid": "VUID-vkBindBufferMemory-buffer-01029", + "text": " buffer must not already be backed by a memory object" + }, + { + "vuid": "VUID-vkBindBufferMemory-buffer-01030", + "text": " buffer must not have been created with any sparse memory binding flags" + }, + { + "vuid": "VUID-vkBindBufferMemory-memoryOffset-01031", + "text": " memoryOffset must be less than the size of memory" + }, + { + "vuid": "VUID-vkBindBufferMemory-buffer-01032", + "text": " If buffer was created with the VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT or VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minTexelBufferOffsetAlignment" + }, + { + "vuid": "VUID-vkBindBufferMemory-buffer-01033", + "text": " If buffer was created with the VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minUniformBufferOffsetAlignment" + }, + { + "vuid": "VUID-vkBindBufferMemory-buffer-01034", + "text": " If buffer was created with the VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minStorageBufferOffsetAlignment" + }, + { + "vuid": "VUID-vkBindBufferMemory-memory-01035", + "text": " memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer" + }, + { + "vuid": "VUID-vkBindBufferMemory-memoryOffset-01036", + "text": " memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer" + }, + { + "vuid": "VUID-vkBindBufferMemory-size-01037", + "text": " The size member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer must be less than or equal to the size of memory minus memoryOffset" + }, + { + "vuid": "VUID-vkBindBufferMemory-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkBindBufferMemory-buffer-parameter", + "text": " buffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkBindBufferMemory-memory-parameter", + "text": " memory must be a valid VkDeviceMemory handle" + }, + { + "vuid": "VUID-vkBindBufferMemory-buffer-parent", + "text": " buffer must have been created, allocated, or retrieved from device" + }, + { + "vuid": "VUID-vkBindBufferMemory-memory-parent", + "text": " memory must have been created, allocated, or retrieved from device" + } + ], + "(VK_VERSION_1_1,VK_KHR_dedicated_allocation)": [ + { + "vuid": "VUID-vkBindBufferMemory-buffer-01444", + "text": " If buffer requires a dedicated allocation(as reported by vkGetBufferMemoryRequirements2 in VkMemoryDedicatedRequirements::requiresDedicatedAllocation for buffer), memory must have been created with VkMemoryDedicatedAllocateInfo::buffer equal to buffer" + }, + { + "vuid": "VUID-vkBindBufferMemory-memory-01508", + "text": " If the VkMemoryAllocateInfo provided when memory was allocated included an instance of VkMemoryDedicatedAllocateInfo in its pNext chain, and VkMemoryDedicatedAllocateInfo::buffer was not VK_NULL_HANDLE, then buffer must equal VkMemoryDedicatedAllocateInfo::buffer, and memoryOffset must be zero." + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkBindBufferMemory-None-01898", + "text": " If buffer was created with the VK_BUFFER_CREATE_PROTECTED_BIT bit set, the buffer must be bound to a memory object allocated with a memory type that reports VK_MEMORY_PROPERTY_PROTECTED_BIT" + }, + { + "vuid": "VUID-vkBindBufferMemory-None-01899", + "text": " If buffer was created with the VK_BUFFER_CREATE_PROTECTED_BIT bit not set, the buffer must not be bound to a memory object created with a memory type that reports VK_MEMORY_PROPERTY_PROTECTED_BIT" + } + ], + "(VK_NV_dedicated_allocation)": [ + { + "vuid": "VUID-vkBindBufferMemory-buffer-01038", + "text": " If buffer was created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must have been created with VkDedicatedAllocationMemoryAllocateInfoNV::buffer equal to a buffer handle created with identical creation parameters to buffer and memoryOffset must be zero" + } + ], + "(VK_NV_dedicated_allocation)+!(VK_VERSION_1_1,VK_KHR_dedicated_allocation)": [ + { + "vuid": "VUID-vkBindBufferMemory-buffer-01039", + "text": " If buffer was not created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must not have been allocated dedicated for a specific buffer or image" + } + ] + }, + "vkBindBufferMemory2": { + "(VK_VERSION_1_1,VK_KHR_bind_memory2)": [ + { + "vuid": "VUID-vkBindBufferMemory2-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkBindBufferMemory2-pBindInfos-parameter", + "text": " pBindInfos must be a valid pointer to an array of bindInfoCount valid VkBindBufferMemoryInfo structures" + }, + { + "vuid": "VUID-vkBindBufferMemory2-bindInfoCount-arraylength", + "text": " bindInfoCount must be greater than 0" + } + ] + }, + "VkBindBufferMemoryInfo": { + "(VK_VERSION_1_1,VK_KHR_bind_memory2)": [ + { + "vuid": "VUID-VkBindBufferMemoryInfo-buffer-01593", + "text": " buffer must not already be backed by a memory object" + }, + { + "vuid": "VUID-VkBindBufferMemoryInfo-buffer-01594", + "text": " buffer must not have been created with any sparse memory binding flags" + }, + { + "vuid": "VUID-VkBindBufferMemoryInfo-memoryOffset-01595", + "text": " memoryOffset must be less than the size of memory" + }, + { + "vuid": "VUID-VkBindBufferMemoryInfo-buffer-01596", + "text": " If buffer was created with the VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT or VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minTexelBufferOffsetAlignment" + }, + { + "vuid": "VUID-VkBindBufferMemoryInfo-buffer-01597", + "text": " If buffer was created with the VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minUniformBufferOffsetAlignment" + }, + { + "vuid": "VUID-VkBindBufferMemoryInfo-buffer-01598", + "text": " If buffer was created with the VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minStorageBufferOffsetAlignment" + }, + { + "vuid": "VUID-VkBindBufferMemoryInfo-memory-01599", + "text": " memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer" + }, + { + "vuid": "VUID-VkBindBufferMemoryInfo-memoryOffset-01600", + "text": " memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer" + }, + { + "vuid": "VUID-VkBindBufferMemoryInfo-size-01601", + "text": " The size member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer must be less than or equal to the size of memory minus memoryOffset" + }, + { + "vuid": "VUID-VkBindBufferMemoryInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO" + }, + { + "vuid": "VUID-VkBindBufferMemoryInfo-pNext-pNext", + "text": " pNext must be NULL or a pointer to a valid instance of VkBindBufferMemoryDeviceGroupInfo" + }, + { + "vuid": "VUID-VkBindBufferMemoryInfo-buffer-parameter", + "text": " buffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-VkBindBufferMemoryInfo-memory-parameter", + "text": " memory must be a valid VkDeviceMemory handle" + }, + { + "vuid": "VUID-VkBindBufferMemoryInfo-commonparent", + "text": " Both of buffer, and memory must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_dedicated_allocation)": [ + { + "vuid": "VUID-VkBindBufferMemoryInfo-buffer-01602", + "text": " If buffer requires a dedicated allocation(as reported by vkGetBufferMemoryRequirements2 in VkMemoryDedicatedRequirements::requiresDedicatedAllocation for buffer), memory must have been created with VkMemoryDedicatedAllocateInfo::buffer equal to buffer and memoryOffset must be zero" + }, + { + "vuid": "VUID-VkBindBufferMemoryInfo-memory-01900", + "text": " If the VkMemoryAllocateInfo provided when memory was allocated included an instance of VkMemoryDedicatedAllocateInfo in its pNext chain, and VkMemoryDedicatedAllocateInfo::buffer was not VK_NULL_HANDLE, then buffer must equal VkMemoryDedicatedAllocateInfo::buffer and memoryOffset must be zero." + } + ], + "(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_NV_dedicated_allocation)": [ + { + "vuid": "VUID-VkBindBufferMemoryInfo-buffer-01603", + "text": " If buffer was created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must have been created with VkDedicatedAllocationMemoryAllocateInfoNV::buffer equal to buffer and memoryOffset must be zero" + } + ], + "(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_NV_dedicated_allocation)+!(VK_VERSION_1_1,VK_KHR_dedicated_allocation)": [ + { + "vuid": "VUID-VkBindBufferMemoryInfo-buffer-01604", + "text": " If buffer was not created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must not have been allocated dedicated for a specific buffer or image" + } + ], + "(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-VkBindBufferMemoryInfo-pNext-01605", + "text": " If the pNext chain includes VkBindBufferMemoryDeviceGroupInfo, all instances of memory specified by VkBindBufferMemoryDeviceGroupInfo::pDeviceIndices must have been allocated" + } + ] + }, + "VkBindBufferMemoryDeviceGroupInfo": { + "(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-VkBindBufferMemoryDeviceGroupInfo-deviceIndexCount-01606", + "text": " deviceIndexCount must either be zero or equal to the number of physical devices in the logical device" + }, + { + "vuid": "VUID-VkBindBufferMemoryDeviceGroupInfo-pDeviceIndices-01607", + "text": " All elements of pDeviceIndices must be valid device indices" + }, + { + "vuid": "VUID-VkBindBufferMemoryDeviceGroupInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO" + }, + { + "vuid": "VUID-VkBindBufferMemoryDeviceGroupInfo-pDeviceIndices-parameter", + "text": " If deviceIndexCount is not 0, pDeviceIndices must be a valid pointer to an array of deviceIndexCount uint32_t values" + } + ] + }, + "vkBindImageMemory": { + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-vkBindImageMemory-image-01608", + "text": " image must not have been created with the VK_IMAGE_CREATE_DISJOINT_BIT set." + } + ], + "core": [ + { + "vuid": "VUID-vkBindImageMemory-image-01044", + "text": " image must not already be backed by a memory object" + }, + { + "vuid": "VUID-vkBindImageMemory-image-01045", + "text": " image must not have been created with any sparse memory binding flags" + }, + { + "vuid": "VUID-vkBindImageMemory-memoryOffset-01046", + "text": " memoryOffset must be less than the size of memory" + }, + { + "vuid": "VUID-vkBindImageMemory-memory-01047", + "text": " memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image" + }, + { + "vuid": "VUID-vkBindImageMemory-memoryOffset-01048", + "text": " memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image" + }, + { + "vuid": "VUID-vkBindImageMemory-size-01049", + "text": " The size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image must be less than or equal to the size of memory minus memoryOffset" + }, + { + "vuid": "VUID-vkBindImageMemory-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkBindImageMemory-image-parameter", + "text": " image must be a valid VkImage handle" + }, + { + "vuid": "VUID-vkBindImageMemory-memory-parameter", + "text": " memory must be a valid VkDeviceMemory handle" + }, + { + "vuid": "VUID-vkBindImageMemory-image-parent", + "text": " image must have been created, allocated, or retrieved from device" + }, + { + "vuid": "VUID-vkBindImageMemory-memory-parent", + "text": " memory must have been created, allocated, or retrieved from device" + } + ], + "(VK_VERSION_1_1,VK_KHR_dedicated_allocation)": [ + { + "vuid": "VUID-vkBindImageMemory-image-01445", + "text": " If image requires a dedicated allocation (as reported by vkGetImageMemoryRequirements2 in VkMemoryDedicatedRequirements::requiresDedicatedAllocation for image), memory must have been created with VkMemoryDedicatedAllocateInfo::image equal to image" + }, + { + "vuid": "VUID-vkBindImageMemory-memory-01509", + "text": " If the VkMemoryAllocateInfo provided when memory was allocated included an instance of VkMemoryDedicatedAllocateInfo in its pNext chain, and VkMemoryDedicatedAllocateInfo::image was not VK_NULL_HANDLE, then image must equal VkMemoryDedicatedAllocateInfo::image and memoryOffset must be zero." + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkBindImageMemory-None-01901", + "text": " If image was created with the VK_IMAGE_CREATE_PROTECTED_BIT bit set, the image must be bound to a memory object allocated with a memory type that reports VK_MEMORY_PROPERTY_PROTECTED_BIT" + }, + { + "vuid": "VUID-vkBindImageMemory-None-01902", + "text": " If image was created with the VK_IMAGE_CREATE_PROTECTED_BIT bit not set, the image must not be bound to a memory object created with a memory type that reports VK_MEMORY_PROPERTY_PROTECTED_BIT" + } + ], + "(VK_NV_dedicated_allocation)": [ + { + "vuid": "VUID-vkBindImageMemory-image-01050", + "text": " If image was created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must have been created with VkDedicatedAllocationMemoryAllocateInfoNV::image equal to an image handle created with identical creation parameters to image and memoryOffset must be zero" + } + ], + "(VK_NV_dedicated_allocation)+!(VK_VERSION_1_1,VK_KHR_dedicated_allocation)": [ + { + "vuid": "VUID-vkBindImageMemory-image-01051", + "text": " If image was not created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must not have been allocated dedicated for a specific buffer or image" + } + ] + }, + "vkBindImageMemory2": { + "(VK_VERSION_1_1,VK_KHR_bind_memory2)": [ + { + "vuid": "VUID-vkBindImageMemory2-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkBindImageMemory2-pBindInfos-parameter", + "text": " pBindInfos must be a valid pointer to an array of bindInfoCount valid VkBindImageMemoryInfo structures" + }, + { + "vuid": "VUID-vkBindImageMemory2-bindInfoCount-arraylength", + "text": " bindInfoCount must be greater than 0" + } + ] + }, + "VkBindImageMemoryInfo": { + "(VK_VERSION_1_1,VK_KHR_bind_memory2)": [ + { + "vuid": "VUID-VkBindImageMemoryInfo-image-01609", + "text": " image must not already be backed by a memory object" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-image-01610", + "text": " image must not have been created with any sparse memory binding flags" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-memoryOffset-01611", + "text": " memoryOffset must be less than the size of memory" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkBindImageMemoryDeviceGroupInfo, VkBindImageMemorySwapchainInfoKHR, or VkBindImagePlaneMemoryInfo" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-image-parameter", + "text": " image must be a valid VkImage handle" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-commonparent", + "text": " Both of image, and memory that are valid handles must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1,VK_KHR_bind_memory2)+!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkBindImageMemoryInfo-memory-01612", + "text": " memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-memoryOffset-01613", + "text": " memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-memory-01614", + "text": " The difference of the size of memory and memoryOffset must be greater than or equal to the size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with the same image" + } + ], + "(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkBindImageMemoryInfo-pNext-01615", + "text": " If the pNext chain does not include an instance of the VkBindImagePlaneMemoryInfo structure, memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2 with image" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-pNext-01616", + "text": " If the pNext chain does not include an instance of the VkBindImagePlaneMemoryInfo structure, memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2 with image" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-pNext-01617", + "text": " If the pNext chain does not include an instance of the VkBindImagePlaneMemoryInfo structure, the difference of the size of memory and memoryOffset must be greater than or equal to the size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2 with the same image" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-pNext-01618", + "text": " If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfo structure, image must have been created with the VK_IMAGE_CREATE_DISJOINT_BIT bit set." + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-pNext-01619", + "text": " If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfo structure, memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2 with image and the correct planeAspect for this plane in the VkImagePlaneMemoryRequirementsInfo structure attached to the VkImageMemoryRequirementsInfo2’s pNext chain" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-pNext-01620", + "text": " If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfo structure, memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2 with image and the correct planeAspect for this plane in the VkImagePlaneMemoryRequirementsInfo structure attached to the VkImageMemoryRequirementsInfo2’s pNext chain" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-pNext-01621", + "text": " If the pNext chain includes an instance of the VkBindImagePlaneMemoryInfo structure, the difference of the size of memory and memoryOffset must be greater than or equal to the size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements2 with the same image and the correct planeAspect for this plane in the VkImagePlaneMemoryRequirementsInfo structure attached to the VkImageMemoryRequirementsInfo2’s pNext chain" + } + ], + "(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_dedicated_allocation)": [ + { + "vuid": "VUID-VkBindImageMemoryInfo-image-01622", + "text": " If image requires a dedicated allocation (as reported by vkGetImageMemoryRequirements2 in VkMemoryDedicatedRequirements::requiresDedicatedAllocation for image), memory must have been created with VkMemoryDedicatedAllocateInfo::image equal to image and memoryOffset must be zero" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-memory-01903", + "text": " If the VkMemoryAllocateInfo provided when memory was allocated included an instance of VkMemoryDedicatedAllocateInfo in its pNext chain, and VkMemoryDedicatedAllocateInfo::image was not VK_NULL_HANDLE, then image must equal VkMemoryDedicatedAllocateInfo::image and memoryOffset must be zero." + } + ], + "(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_NV_dedicated_allocation)": [ + { + "vuid": "VUID-VkBindImageMemoryInfo-image-01623", + "text": " If image was created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must have been created with VkDedicatedAllocationMemoryAllocateInfoNV::image equal to image and memoryOffset must be zero" + } + ], + "(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_NV_dedicated_allocation)+!(VK_VERSION_1_1,VK_KHR_dedicated_allocation)": [ + { + "vuid": "VUID-VkBindImageMemoryInfo-image-01624", + "text": " If image was not created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must not have been allocated dedicated for a specific buffer or image" + } + ], + "(VK_VERSION_1_1,VK_KHR_bind_memory2)+!(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-VkBindImageMemoryInfo-memory-01625", + "text": " memory must be a valid VkDeviceMemory handle" + } + ], + "(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-VkBindImageMemoryInfo-pNext-01626", + "text": " If the pNext chain includes VkBindImageMemoryDeviceGroupInfo, all instances of memory specified by VkBindImageMemoryDeviceGroupInfo::pDeviceIndices must have been allocated" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-pNext-01627", + "text": " If the pNext chain includes VkBindImageMemoryDeviceGroupInfo, and VkBindImageMemoryDeviceGroupInfo::splitInstanceBindRegionCount is not zero, then image must have been created with the VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT bit set" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-pNext-01628", + "text": " If the pNext chain includes VkBindImageMemoryDeviceGroupInfo, all elements of VkBindImageMemoryDeviceGroupInfo::pSplitInstanceBindRegions must be valid rectangles contained within the dimensions of image" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-pNext-01629", + "text": " If the pNext chain includes VkBindImageMemoryDeviceGroupInfo, the union of the areas of all elements of VkBindImageMemoryDeviceGroupInfo::pSplitInstanceBindRegions that correspond to the same instance of image must cover the entire image." + } + ], + "(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)+(VK_KHR_swapchain)": [ + { + "vuid": "VUID-VkBindImageMemoryInfo-image-01630", + "text": " If image was created with a valid swapchain handle in VkImageSwapchainCreateInfoKHR::swapchain, then the pNext chain must include a valid instance of VkBindImageMemorySwapchainInfoKHR" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-pNext-01631", + "text": " If the pNext chain includes an instance of VkBindImageMemorySwapchainInfoKHR, memory must be VK_NULL_HANDLE" + }, + { + "vuid": "VUID-VkBindImageMemoryInfo-pNext-01632", + "text": " If the pNext chain does not include an instance of VkBindImageMemorySwapchainInfoKHR, memory must be a valid VkDeviceMemory handle" + } + ] + }, + "VkBindImageMemoryDeviceGroupInfo": { + "(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-VkBindImageMemoryDeviceGroupInfo-deviceIndexCount-01633", + "text": " At least one of deviceIndexCount and splitInstanceBindRegionCount must be zero." + }, + { + "vuid": "VUID-VkBindImageMemoryDeviceGroupInfo-deviceIndexCount-01634", + "text": " deviceIndexCount must either be zero or equal to the number of physical devices in the logical device" + }, + { + "vuid": "VUID-VkBindImageMemoryDeviceGroupInfo-pDeviceIndices-01635", + "text": " All elements of pDeviceIndices must be valid device indices." + }, + { + "vuid": "VUID-VkBindImageMemoryDeviceGroupInfo-splitInstanceBindRegionCount-01636", + "text": " splitInstanceBindRegionCount must either be zero or equal to the number of physical devices in the logical device squared" + }, + { + "vuid": "VUID-VkBindImageMemoryDeviceGroupInfo-pSplitInstanceBindRegions-01637", + "text": " Elements of pSplitInstanceBindRegions that correspond to the same instance of an image must not overlap." + }, + { + "vuid": "VUID-VkBindImageMemoryDeviceGroupInfo-offset-01638", + "text": " The offset.x member of any element of pSplitInstanceBindRegions must be a multiple of the sparse image block width (VkSparseImageFormatProperties::imageGranularity.width) of all non-metadata aspects of the image" + }, + { + "vuid": "VUID-VkBindImageMemoryDeviceGroupInfo-offset-01639", + "text": " The offset.y member of any element of pSplitInstanceBindRegions must be a multiple of the sparse image block height (VkSparseImageFormatProperties::imageGranularity.height) of all non-metadata aspects of the image" + }, + { + "vuid": "VUID-VkBindImageMemoryDeviceGroupInfo-extent-01640", + "text": " The extent.width member of any element of pSplitInstanceBindRegions must either be a multiple of the sparse image block width of all non-metadata aspects of the image, or else extent.width + offset.x must equal the width of the image subresource" + }, + { + "vuid": "VUID-VkBindImageMemoryDeviceGroupInfo-extent-01641", + "text": " The extent.height member of any element of pSplitInstanceBindRegions must either be a multiple of the sparse image block height of all non-metadata aspects of the image, or else extent.height
offset.y must equal the width of the image subresource" + }, + { + "vuid": "VUID-VkBindImageMemoryDeviceGroupInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO" + }, + { + "vuid": "VUID-VkBindImageMemoryDeviceGroupInfo-pDeviceIndices-parameter", + "text": " If deviceIndexCount is not 0, pDeviceIndices must be a valid pointer to an array of deviceIndexCount uint32_t values" + }, + { + "vuid": "VUID-VkBindImageMemoryDeviceGroupInfo-pSplitInstanceBindRegions-parameter", + "text": " If splitInstanceBindRegionCount is not 0, pSplitInstanceBindRegions must be a valid pointer to an array of splitInstanceBindRegionCount VkRect2D structures" + } + ] + }, + "VkBindImageMemorySwapchainInfoKHR": { + "(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_device_group)+(VK_KHR_swapchain)": [ + { + "vuid": "VUID-VkBindImageMemorySwapchainInfoKHR-imageIndex-01644", + "text": " imageIndex must be less than the number of images in swapchain" + }, + { + "vuid": "VUID-VkBindImageMemorySwapchainInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR" + }, + { + "vuid": "VUID-VkBindImageMemorySwapchainInfoKHR-swapchain-parameter", + "text": " swapchain must be a valid VkSwapchainKHR handle" + } + ] + }, + "VkBindImagePlaneMemoryInfo": { + "(VK_VERSION_1_1,VK_KHR_bind_memory2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkBindImagePlaneMemoryInfo-planeAspect-01642", + "text": " planeAspect must be a single valid plane aspect for the image format (that is, planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT or VK_IMAGE_ASPECT_PLANE_1_BIT for “_2PLANE” formats and planeAspect must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT for “_3PLANE” formats)" + }, + { + "vuid": "VUID-VkBindImagePlaneMemoryInfo-None-01643", + "text": " A single call to vkBindImageMemory2 must bind all or none of the planes of an image (i.e. bindings to all planes of an image must be made in a single vkBindImageMemory2 call), as separate bindings" + }, + { + "vuid": "VUID-VkBindImagePlaneMemoryInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO" + }, + { + "vuid": "VUID-VkBindImagePlaneMemoryInfo-planeAspect-parameter", + "text": " planeAspect must be a valid VkImageAspectFlagBits value" + } + ] + }, + "vkCreateSampler": { + "core": [ + { + "vuid": "VUID-vkCreateSampler-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateSampler-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkSamplerCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateSampler-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateSampler-pSampler-parameter", + "text": " pSampler must be a valid pointer to a VkSampler handle" + } + ] + }, + "VkSamplerCreateInfo": { + "core": [ + { + "vuid": "VUID-VkSamplerCreateInfo-mipLodBias-01069", + "text": " The absolute value of mipLodBias must be less than or equal to VkPhysicalDeviceLimits::maxSamplerLodBias" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-anisotropyEnable-01070", + "text": " If the &amp;lt;&amp;lt;features-features-samplerAnisotropy,anisotropic sampling&amp;gt;&amp;gt; feature is not enabled, anisotropyEnable must be VK_FALSE" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-anisotropyEnable-01071", + "text": " If anisotropyEnable is VK_TRUE, maxAnisotropy must be between 1.0 and VkPhysicalDeviceLimits::maxSamplerAnisotropy, inclusive" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01072", + "text": " If unnormalizedCoordinates is VK_TRUE, minFilter and magFilter must be equal" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01073", + "text": " If unnormalizedCoordinates is VK_TRUE, mipmapMode must be VK_SAMPLER_MIPMAP_MODE_NEAREST" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01074", + "text": " If unnormalizedCoordinates is VK_TRUE, minLod and maxLod must be zero" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01075", + "text": " If unnormalizedCoordinates is VK_TRUE, addressModeU and addressModeV must each be either VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE or VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01076", + "text": " If unnormalizedCoordinates is VK_TRUE, anisotropyEnable must be VK_FALSE" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01077", + "text": " If unnormalizedCoordinates is VK_TRUE, compareEnable must be VK_FALSE" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-addressModeU-01078", + "text": " If any of addressModeU, addressModeV or addressModeW are VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, borderColor must be a valid VkBorderColor value" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-addressModeU-01079", + "text": " If the VK_KHR_sampler_mirror_clamp_to_edge extension is not enabled, addressModeU, addressModeV and addressModeW must not be VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-compareEnable-01080", + "text": " If compareEnable is VK_TRUE, compareOp must be a valid VkCompareOp value" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkSamplerReductionModeCreateInfoEXT or VkSamplerYcbcrConversionInfo" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-magFilter-parameter", + "text": " magFilter must be a valid VkFilter value" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-minFilter-parameter", + "text": " minFilter must be a valid VkFilter value" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-mipmapMode-parameter", + "text": " mipmapMode must be a valid VkSamplerMipmapMode value" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-addressModeU-parameter", + "text": " addressModeU must be a valid VkSamplerAddressMode value" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-addressModeV-parameter", + "text": " addressModeV must be a valid VkSamplerAddressMode value" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-addressModeW-parameter", + "text": " addressModeW must be a valid VkSamplerAddressMode value" + } + ], + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkSamplerCreateInfo-minFilter-01645", + "text": " If &amp;lt;&amp;lt;samplers-YCbCr-conversion,sampler Y’CBCR conversion&amp;gt;&amp;gt; is enabled and VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT is not set for the format, minFilter and magFilter must be equal to the sampler Y’CBCR conversion’s chromaFilter" + }, + { + "vuid": "VUID-VkSamplerCreateInfo-addressModeU-01646", + "text": " If &amp;lt;&amp;lt;samplers-YCbCr-conversion,sampler Y’CBCR conversion&amp;gt;&amp;gt; is enabled, addressModeU, addressModeV, and addressModeW must be VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, anisotropyEnable must be VK_FALSE, and unnormalizedCoordinates must be VK_FALSE" + } + ], + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)+(VK_EXT_sampler_filter_minmax)": [ + { + "vuid": "VUID-VkSamplerCreateInfo-None-01647", + "text": " The sampler reduction mode must be set to VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT if &amp;lt;&amp;lt;samplers-YCbCr-conversion,sampler Y’CBCR conversion&amp;gt;&amp;gt; is enabled" + } + ], + "(VK_IMG_filter_cubic)": [ + { + "vuid": "VUID-VkSamplerCreateInfo-magFilter-01081", + "text": " If either magFilter or minFilter is VK_FILTER_CUBIC_IMG, anisotropyEnable must be VK_FALSE" + } + ], + "(VK_IMG_filter_cubic+VK_EXT_sampler_filter_minmax)": [ + { + "vuid": "VUID-VkSamplerCreateInfo-magFilter-01422", + "text": " If either magFilter or minFilter is VK_FILTER_CUBIC_IMG, the reductionMode member of VkSamplerReductionModeCreateInfoEXT must be VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT" + } + ], + "(VK_EXT_sampler_filter_minmax)": [ + { + "vuid": "VUID-VkSamplerCreateInfo-compareEnable-01423", + "text": " If compareEnable is VK_TRUE, the reductionMode member of VkSamplerReductionModeCreateInfoEXT must be VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT" + } + ] + }, + "VkSamplerReductionModeCreateInfoEXT": { + "(VK_EXT_sampler_filter_minmax)": [ + { + "vuid": "VUID-VkSamplerReductionModeCreateInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT" + }, + { + "vuid": "VUID-VkSamplerReductionModeCreateInfoEXT-reductionMode-parameter", + "text": " reductionMode must be a valid VkSamplerReductionModeEXT value" + } + ] + }, + "vkDestroySampler": { + "core": [ + { + "vuid": "VUID-vkDestroySampler-sampler-01082", + "text": " All submitted commands that refer to sampler must have completed execution" + }, + { + "vuid": "VUID-vkDestroySampler-sampler-01083", + "text": " If VkAllocationCallbacks were provided when sampler was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroySampler-sampler-01084", + "text": " If no VkAllocationCallbacks were provided when sampler was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroySampler-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroySampler-sampler-parameter", + "text": " If sampler is not VK_NULL_HANDLE, sampler must be a valid VkSampler handle" + }, + { + "vuid": "VUID-vkDestroySampler-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroySampler-sampler-parent", + "text": " If sampler is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "VkSamplerYcbcrConversionInfo": { + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkSamplerYcbcrConversionInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO" + }, + { + "vuid": "VUID-VkSamplerYcbcrConversionInfo-conversion-parameter", + "text": " conversion must be a valid VkSamplerYcbcrConversion handle" + } + ] + }, + "vkCreateSamplerYcbcrConversion": { + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-vkCreateSamplerYcbcrConversion-None-01648", + "text": " The &amp;lt;&amp;lt;features-features-sampler-YCbCr-conversion, sampler Y’CBCR conversion feature&amp;gt;&amp;gt; must be enabled" + }, + { + "vuid": "VUID-vkCreateSamplerYcbcrConversion-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateSamplerYcbcrConversion-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkSamplerYcbcrConversionCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateSamplerYcbcrConversion-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateSamplerYcbcrConversion-pYcbcrConversion-parameter", + "text": " pYcbcrConversion must be a valid pointer to a VkSamplerYcbcrConversion handle" + } + ] + }, + "VkSamplerYcbcrConversionCreateInfo": { + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)+!(VK_ANDROID_external_memory_android_hardware_buffer)": [ + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-format-01649", + "text": " format must not be VK_FORMAT_UNDEFINED" + } + ], + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)+(VK_ANDROID_external_memory_android_hardware_buffer)": [ + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-format-01904", + "text": " If an external format conversion is being created, format must be VK_FORMAT_UNDEFINED, otherwise it must not be VK_FORMAT_UNDEFINED." + } + ], + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-format-01650", + "text": " format must support VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT or VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT" + }, + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-01651", + "text": " If the format does not support VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, xChromaOffset and yChromaOffset must not be VK_CHROMA_LOCATION_COSITED_EVEN" + }, + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-01652", + "text": " If the format does not support VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT, xChromaOffset and yChromaOffset must not be VK_CHROMA_LOCATION_MIDPOINT" + }, + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-format-01653", + "text": " format must represent unsigned normalized values (i.e. the format must be a UNORM format)" + }, + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-None-01654", + "text": " If the format has a _422 or _420 suffix:" + }, + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrModel-01655", + "text": " If ycbcrModel is not VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY, then components.r, components.g, and components.b must correspond to channels of the format; that is, components.r, components.g, and components.b must not be VK_COMPONENT_SWIZZLE_ZERO or VK_COMPONENT_SWIZZLE_ONE, and must not correspond to a channel which contains zero or one as a consequence of &amp;lt;&amp;lt;textures-conversion-to-rgba,conversion to RGBA&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-forceExplicitReconstruction-01656", + "text": " If the format does not support VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT, forceExplicitReconstruction must be FALSE" + }, + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-chromaFilter-01657", + "text": " If the format does not support VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT, chromaFilter must be VK_FILTER_NEAREST" + }, + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO" + }, + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-pNext-pNext", + "text": " pNext must be NULL or a pointer to a valid instance of VkExternalFormatANDROID" + }, + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-format-parameter", + "text": " format must be a valid VkFormat value" + }, + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrModel-parameter", + "text": " ycbcrModel must be a valid VkSamplerYcbcrModelConversion value" + }, + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrRange-parameter", + "text": " ycbcrRange must be a valid VkSamplerYcbcrRange value" + }, + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-components-parameter", + "text": " components must be a valid VkComponentMapping structure" + }, + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-parameter", + "text": " xChromaOffset must be a valid VkChromaLocation value" + }, + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-yChromaOffset-parameter", + "text": " yChromaOffset must be a valid VkChromaLocation value" + }, + { + "vuid": "VUID-VkSamplerYcbcrConversionCreateInfo-chromaFilter-parameter", + "text": " chromaFilter must be a valid VkFilter value" + } + ] + }, + "vkDestroySamplerYcbcrConversion": { + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-vkDestroySamplerYcbcrConversion-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroySamplerYcbcrConversion-ycbcrConversion-parameter", + "text": " If ycbcrConversion is not VK_NULL_HANDLE, ycbcrConversion must be a valid VkSamplerYcbcrConversion handle" + }, + { + "vuid": "VUID-vkDestroySamplerYcbcrConversion-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroySamplerYcbcrConversion-ycbcrConversion-parent", + "text": " If ycbcrConversion is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkCreateDescriptorSetLayout": { + "core": [ + { + "vuid": "VUID-vkCreateDescriptorSetLayout-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateDescriptorSetLayout-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkDescriptorSetLayoutCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateDescriptorSetLayout-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateDescriptorSetLayout-pSetLayout-parameter", + "text": " pSetLayout must be a valid pointer to a VkDescriptorSetLayout handle" + } + ] + }, + "VkDescriptorSetLayoutCreateInfo": { + "core": [ + { + "vuid": "VUID-VkDescriptorSetLayoutCreateInfo-binding-00279", + "text": " The VkDescriptorSetLayoutBinding::binding members of the elements of the pBindings array must each have different values." + }, + { + "vuid": "VUID-VkDescriptorSetLayoutCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutCreateInfo-pNext-pNext", + "text": " pNext must be NULL or a pointer to a valid instance of VkDescriptorSetLayoutBindingFlagsCreateInfoEXT" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutCreateInfo-flags-parameter", + "text": " flags must be a valid combination of VkDescriptorSetLayoutCreateFlagBits values" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutCreateInfo-pBindings-parameter", + "text": " If bindingCount is not 0, pBindings must be a valid pointer to an array of bindingCount valid VkDescriptorSetLayoutBinding structures" + } + ], + "(VK_KHR_push_descriptor)": [ + { + "vuid": "VUID-VkDescriptorSetLayoutCreateInfo-flags-00280", + "text": " If flags contains VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then all elements of pBindings must not have a descriptorType of VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutCreateInfo-flags-00281", + "text": " If flags contains VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then the total number of elements of all bindings must be less than or equal to VkPhysicalDevicePushDescriptorPropertiesKHR::maxPushDescriptors" + } + ], + "(VK_EXT_descriptor_indexing)": [ + { + "vuid": "VUID-VkDescriptorSetLayoutCreateInfo-flags-03000", + "text": " If any binding has the VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT bit set, flags must include VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutCreateInfo-descriptorType-03001", + "text": " If any binding has the VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT bit set, then all bindings must not have descriptorType of VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC" + } + ] + }, + "VkDescriptorSetLayoutBinding": { + "core": [ + { + "vuid": "VUID-VkDescriptorSetLayoutBinding-descriptorType-00282", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLER or VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and descriptorCount is not 0 and pImmutableSamplers is not NULL, pImmutableSamplers must be a valid pointer to an array of descriptorCount valid VkSampler handles" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutBinding-descriptorCount-00283", + "text": " If descriptorCount is not 0, stageFlags must be a valid combination of VkShaderStageFlagBits values" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutBinding-descriptorType-01510", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT and descriptorCount is not 0, then stageFlags must be 0 or VK_SHADER_STAGE_FRAGMENT_BIT" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutBinding-descriptorType-parameter", + "text": " descriptorType must be a valid VkDescriptorType value" + } + ] + }, + "VkDescriptorSetLayoutBindingFlagsCreateInfoEXT": { + "(VK_EXT_descriptor_indexing)": [ + { + "vuid": "VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-bindingCount-03002", + "text": " If bindingCount is not zero, bindingCount must equal VkDescriptorSetLayoutCreateInfo::bindingCount" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-03004", + "text": " If an element of pBindingFlags includes VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT, then all other elements of VkDescriptorSetLayoutCreateInfo::pBindings must have a smaller value of binding" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingUniformBufferUpdateAfterBind-03005", + "text": " If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingUniformBufferUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingSampledImageUpdateAfterBind-03006", + "text": " If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingSampledImageUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_SAMPLER, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, or VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingStorageImageUpdateAfterBind-03007", + "text": " If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingStorageImageUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_STORAGE_IMAGE must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingStorageBufferUpdateAfterBind-03008", + "text": " If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingStorageBufferUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_STORAGE_BUFFER must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingUniformTexelBufferUpdateAfterBind-03009", + "text": " If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingUniformTexelBufferUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingStorageTexelBufferUpdateAfterBind-03010", + "text": " If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingStorageTexelBufferUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-None-03011", + "text": " All bindings with descriptor type VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingUpdateUnusedWhilePending-03012", + "text": " If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingUpdateUnusedWhilePending is not enabled, all elements of pBindingFlags must not include VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingPartiallyBound-03013", + "text": " If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingPartiallyBound is not enabled, all elements of pBindingFlags must not include VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-descriptorBindingVariableDescriptorCount-03014", + "text": " If VkPhysicalDeviceDescriptorIndexingFeaturesEXT::descriptorBindingVariableDescriptorCount is not enabled, all elements of pBindingFlags must not include VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-03015", + "text": " If an element of pBindingFlags includes VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT, that element’s descriptorType must not be VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-parameter", + "text": " If bindingCount is not 0, pBindingFlags must be a valid pointer to an array of bindingCount valid combinations of VkDescriptorBindingFlagBitsEXT values" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-pBindingFlags-requiredbitmask", + "text": " Each element of pBindingFlags must not be 0" + } + ], + "(VK_EXT_descriptor_indexing)+(VK_KHR_push_descriptor)": [ + { + "vuid": "VUID-VkDescriptorSetLayoutBindingFlagsCreateInfoEXT-flags-03003", + "text": " If VkDescriptorSetLayoutCreateInfo::flags includes VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then all elements of pBindingFlags must not include VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT, VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT, or VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT" + } + ] + }, + "vkGetDescriptorSetLayoutSupport": { + "(VK_VERSION_1_1,VK_KHR_maintenance3)": [ + { + "vuid": "VUID-vkGetDescriptorSetLayoutSupport-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetDescriptorSetLayoutSupport-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkDescriptorSetLayoutCreateInfo structure" + }, + { + "vuid": "VUID-vkGetDescriptorSetLayoutSupport-pSupport-parameter", + "text": " pSupport must be a valid pointer to a VkDescriptorSetLayoutSupport structure" + } + ] + }, + "VkDescriptorSetLayoutSupport": { + "(VK_VERSION_1_1,VK_KHR_maintenance3)": [ + { + "vuid": "VUID-VkDescriptorSetLayoutSupport-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT" + }, + { + "vuid": "VUID-VkDescriptorSetLayoutSupport-pNext-pNext", + "text": " pNext must be NULL or a pointer to a valid instance of VkDescriptorSetVariableDescriptorCountLayoutSupportEXT" + } + ] + }, + "VkDescriptorSetVariableDescriptorCountLayoutSupportEXT": { + "(VK_EXT_descriptor_indexing)": [ + { + "vuid": "VUID-VkDescriptorSetVariableDescriptorCountLayoutSupportEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT" + } + ] + }, + "vkDestroyDescriptorSetLayout": { + "core": [ + { + "vuid": "VUID-vkDestroyDescriptorSetLayout-descriptorSetLayout-00284", + "text": " If VkAllocationCallbacks were provided when descriptorSetLayout was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyDescriptorSetLayout-descriptorSetLayout-00285", + "text": " If no VkAllocationCallbacks were provided when descriptorSetLayout was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyDescriptorSetLayout-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyDescriptorSetLayout-descriptorSetLayout-parameter", + "text": " If descriptorSetLayout is not VK_NULL_HANDLE, descriptorSetLayout must be a valid VkDescriptorSetLayout handle" + }, + { + "vuid": "VUID-vkDestroyDescriptorSetLayout-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyDescriptorSetLayout-descriptorSetLayout-parent", + "text": " If descriptorSetLayout is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkCreatePipelineLayout": { + "core": [ + { + "vuid": "VUID-vkCreatePipelineLayout-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreatePipelineLayout-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkPipelineLayoutCreateInfo structure" + }, + { + "vuid": "VUID-vkCreatePipelineLayout-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreatePipelineLayout-pPipelineLayout-parameter", + "text": " pPipelineLayout must be a valid pointer to a VkPipelineLayout handle" + } + ] + }, + "VkPipelineLayoutCreateInfo": { + "core": [ + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-setLayoutCount-00286", + "text": " setLayoutCount must be less than or equal to VkPhysicalDeviceLimits::maxBoundDescriptorSets" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pPushConstantRanges-00292", + "text": " Any two elements of pPushConstantRanges must not include the same stage in stageFlags" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-parameter", + "text": " If setLayoutCount is not 0, pSetLayouts must be a valid pointer to an array of setLayoutCount valid VkDescriptorSetLayout handles" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pPushConstantRanges-parameter", + "text": " If pushConstantRangeCount is not 0, pPushConstantRanges must be a valid pointer to an array of pushConstantRangeCount valid VkPushConstantRange structures" + } + ], + "!(VK_EXT_descriptor_indexing)": [ + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00287", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_SAMPLER and VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible to any shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorSamplers" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00288", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER and VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible to any shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorUniformBuffers" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00289", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_BUFFER and VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible to any shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorStorageBuffers" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00290", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible to any shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorSampledImages" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00291", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible to any shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorStorageImages" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01676", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorInputAttachments" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01677", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_SAMPLER and VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetSamplers" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01678", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER accessible across all shader stagess and and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetUniformBuffers" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01679", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetUniformBuffersDynamic" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01680", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_BUFFER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetStorageBuffers" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01681", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetStorageBuffersDynamic" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01682", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetSampledImages" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01683", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetStorageImages" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01684", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetInputAttachments" + } + ], + "(VK_EXT_descriptor_indexing)": [ + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03016", + "text": " The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_SAMPLER and VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorSamplers" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03017", + "text": " The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER and VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorUniformBuffers" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03018", + "text": " The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_STORAGE_BUFFER and VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorStorageBuffers" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03019", + "text": " The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorSampledImages" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03020", + "text": " The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorStorageImages" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03021", + "text": " The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorInputAttachments" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03022", + "text": " The total number of descriptors with a descriptorType of VK_DESCRIPTOR_TYPE_SAMPLER and VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxPerStageDescriptorUpdateAfterBindSamplers" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03023", + "text": " The total number of descriptors with a descriptorType of VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER and VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxPerStageDescriptorUpdateAfterBindUniformBuffers" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03024", + "text": " The total number of descriptors with a descriptorType of VK_DESCRIPTOR_TYPE_STORAGE_BUFFER and VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxPerStageDescriptorUpdateAfterBindStorageBuffers" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03025", + "text": " The total number of descriptors with a descriptorType of VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxPerStageDescriptorUpdateAfterBindSampledImages" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03026", + "text": " The total number of descriptors with a descriptorType of VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxPerStageDescriptorUpdateAfterBindStorageImages" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03027", + "text": " The total number of descriptors with a descriptorType of VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxPerStageDescriptorUpdateAfterBindInputAttachments" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03028", + "text": " The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_SAMPLER and VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetSamplers" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03029", + "text": " The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER accessible across all shader stagess and and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetUniformBuffers" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03030", + "text": " The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetUniformBuffersDynamic" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03031", + "text": " The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_STORAGE_BUFFER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetStorageBuffers" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03032", + "text": " The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetStorageBuffersDynamic" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03033", + "text": " The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetSampledImages" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03034", + "text": " The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetStorageImages" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-descriptorType-03035", + "text": " The total number of descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set with a descriptorType of VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxDescriptorSetInputAttachments" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03036", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_SAMPLER and VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxDescriptorSetUpdateAfterBindSamplers" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03037", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER accessible across all shader stagess and and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxDescriptorSetUpdateAfterBindUniformBuffers" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03038", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxDescriptorSetUpdateAfterBindUniformBuffersDynamic" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03039", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_BUFFER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxDescriptorSetUpdateAfterBindStorageBuffers" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03040", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxDescriptorSetUpdateAfterBindStorageBuffersDynamic" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03041", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxDescriptorSetUpdateAfterBindSampledImages" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03042", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxDescriptorSetUpdateAfterBindStorageImages" + }, + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03043", + "text": " The total number of descriptors of the type VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT accessible across all shader stages and across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceDescriptorIndexingPropertiesEXT::maxDescriptorSetUpdateAfterBindInputAttachments" + } + ], + "(VK_KHR_push_descriptor)": [ + { + "vuid": "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00293", + "text": " pSetLayouts must not contain more than one descriptor set layout that was created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR set" + } + ] + }, + "VkPushConstantRange": { + "core": [ + { + "vuid": "VUID-VkPushConstantRange-offset-00294", + "text": " offset must be less than VkPhysicalDeviceLimits::maxPushConstantsSize" + }, + { + "vuid": "VUID-VkPushConstantRange-offset-00295", + "text": " offset must be a multiple of 4" + }, + { + "vuid": "VUID-VkPushConstantRange-size-00296", + "text": " size must be greater than 0" + }, + { + "vuid": "VUID-VkPushConstantRange-size-00297", + "text": " size must be a multiple of 4" + }, + { + "vuid": "VUID-VkPushConstantRange-size-00298", + "text": " size must be less than or equal to VkPhysicalDeviceLimits::maxPushConstantsSize minus offset" + }, + { + "vuid": "VUID-VkPushConstantRange-stageFlags-parameter", + "text": " stageFlags must be a valid combination of VkShaderStageFlagBits values" + }, + { + "vuid": "VUID-VkPushConstantRange-stageFlags-requiredbitmask", + "text": " stageFlags must not be 0" + } + ] + }, + "vkDestroyPipelineLayout": { + "core": [ + { + "vuid": "VUID-vkDestroyPipelineLayout-pipelineLayout-00299", + "text": " If VkAllocationCallbacks were provided when pipelineLayout was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyPipelineLayout-pipelineLayout-00300", + "text": " If no VkAllocationCallbacks were provided when pipelineLayout was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyPipelineLayout-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyPipelineLayout-pipelineLayout-parameter", + "text": " If pipelineLayout is not VK_NULL_HANDLE, pipelineLayout must be a valid VkPipelineLayout handle" + }, + { + "vuid": "VUID-vkDestroyPipelineLayout-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyPipelineLayout-pipelineLayout-parent", + "text": " If pipelineLayout is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkCreateDescriptorPool": { + "core": [ + { + "vuid": "VUID-vkCreateDescriptorPool-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateDescriptorPool-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkDescriptorPoolCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateDescriptorPool-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateDescriptorPool-pDescriptorPool-parameter", + "text": " pDescriptorPool must be a valid pointer to a VkDescriptorPool handle" + } + ] + }, + "VkDescriptorPoolCreateInfo": { + "core": [ + { + "vuid": "VUID-VkDescriptorPoolCreateInfo-maxSets-00301", + "text": " maxSets must be greater than 0" + }, + { + "vuid": "VUID-VkDescriptorPoolCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO" + }, + { + "vuid": "VUID-VkDescriptorPoolCreateInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkDescriptorPoolCreateInfo-flags-parameter", + "text": " flags must be a valid combination of VkDescriptorPoolCreateFlagBits values" + }, + { + "vuid": "VUID-VkDescriptorPoolCreateInfo-pPoolSizes-parameter", + "text": " pPoolSizes must be a valid pointer to an array of poolSizeCount valid VkDescriptorPoolSize structures" + }, + { + "vuid": "VUID-VkDescriptorPoolCreateInfo-poolSizeCount-arraylength", + "text": " poolSizeCount must be greater than 0" + } + ] + }, + "VkDescriptorPoolSize": { + "core": [ + { + "vuid": "VUID-VkDescriptorPoolSize-descriptorCount-00302", + "text": " descriptorCount must be greater than 0" + }, + { + "vuid": "VUID-VkDescriptorPoolSize-type-parameter", + "text": " type must be a valid VkDescriptorType value" + } + ] + }, + "vkDestroyDescriptorPool": { + "core": [ + { + "vuid": "VUID-vkDestroyDescriptorPool-descriptorPool-00303", + "text": " All submitted commands that refer to descriptorPool (via any allocated descriptor sets) must have completed execution" + }, + { + "vuid": "VUID-vkDestroyDescriptorPool-descriptorPool-00304", + "text": " If VkAllocationCallbacks were provided when descriptorPool was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyDescriptorPool-descriptorPool-00305", + "text": " If no VkAllocationCallbacks were provided when descriptorPool was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyDescriptorPool-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyDescriptorPool-descriptorPool-parameter", + "text": " If descriptorPool is not VK_NULL_HANDLE, descriptorPool must be a valid VkDescriptorPool handle" + }, + { + "vuid": "VUID-vkDestroyDescriptorPool-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyDescriptorPool-descriptorPool-parent", + "text": " If descriptorPool is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkAllocateDescriptorSets": { + "core": [ + { + "vuid": "VUID-vkAllocateDescriptorSets-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkAllocateDescriptorSets-pAllocateInfo-parameter", + "text": " pAllocateInfo must be a valid pointer to a valid VkDescriptorSetAllocateInfo structure" + }, + { + "vuid": "VUID-vkAllocateDescriptorSets-pDescriptorSets-parameter", + "text": " pDescriptorSets must be a valid pointer to an array of pAllocateInfo::descriptorSetCount VkDescriptorSet handles" + } + ] + }, + "VkDescriptorSetAllocateInfo": { + "!(VK_VERSION_1_1,VK_KHR_maintenance1)": [ + { + "vuid": "VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-00306", + "text": " descriptorSetCount must not be greater than the number of sets that are currently available for allocation in descriptorPool" + }, + { + "vuid": "VUID-VkDescriptorSetAllocateInfo-descriptorPool-00307", + "text": " descriptorPool must have enough free descriptor capacity remaining to allocate the descriptor sets of the specified layouts" + } + ], + "(VK_KHR_push_descriptor)": [ + { + "vuid": "VUID-VkDescriptorSetAllocateInfo-pSetLayouts-00308", + "text": " Each element of pSetLayouts must not have been created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR set" + } + ], + "(VK_EXT_descriptor_indexing)": [ + { + "vuid": "VUID-VkDescriptorSetAllocateInfo-pSetLayouts-03044", + "text": " If any element of pSetLayouts was created with the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT bit set, descriptorPool must have been created with the VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag set" + } + ], + "core": [ + { + "vuid": "VUID-VkDescriptorSetAllocateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO" + }, + { + "vuid": "VUID-VkDescriptorSetAllocateInfo-pNext-pNext", + "text": " pNext must be NULL or a pointer to a valid instance of VkDescriptorSetVariableDescriptorCountAllocateInfoEXT" + }, + { + "vuid": "VUID-VkDescriptorSetAllocateInfo-descriptorPool-parameter", + "text": " descriptorPool must be a valid VkDescriptorPool handle" + }, + { + "vuid": "VUID-VkDescriptorSetAllocateInfo-pSetLayouts-parameter", + "text": " pSetLayouts must be a valid pointer to an array of descriptorSetCount valid VkDescriptorSetLayout handles" + }, + { + "vuid": "VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-arraylength", + "text": " descriptorSetCount must be greater than 0" + }, + { + "vuid": "VUID-VkDescriptorSetAllocateInfo-commonparent", + "text": " Both of descriptorPool, and the elements of pSetLayouts must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "VkDescriptorSetVariableDescriptorCountAllocateInfoEXT": { + "(VK_EXT_descriptor_indexing)": [ + { + "vuid": "VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-descriptorSetCount-03045", + "text": " If descriptorSetCount is not zero, descriptorSetCount must equal VkDescriptorSetAllocateInfo::descriptorSetCount" + }, + { + "vuid": "VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-pSetLayouts-03046", + "text": " If VkDescriptorSetAllocateInfo::pSetLayouts[i] has a variable descriptor count binding, then pDescriptorCounts[i] must be less than or equal to the descriptor count specified for that binding when the descriptor set layout was created." + }, + { + "vuid": "VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT" + }, + { + "vuid": "VUID-VkDescriptorSetVariableDescriptorCountAllocateInfoEXT-pDescriptorCounts-parameter", + "text": " If descriptorSetCount is not 0, pDescriptorCounts must be a valid pointer to an array of descriptorSetCount uint32_t values" + } + ] + }, + "vkFreeDescriptorSets": { + "core": [ + { + "vuid": "VUID-vkFreeDescriptorSets-pDescriptorSets-00309", + "text": " All submitted commands that refer to any element of pDescriptorSets must have completed execution" + }, + { + "vuid": "VUID-vkFreeDescriptorSets-pDescriptorSets-00310", + "text": " pDescriptorSets must be a valid pointer to an array of descriptorSetCount VkDescriptorSet handles, each element of which must either be a valid handle or VK_NULL_HANDLE" + }, + { + "vuid": "VUID-vkFreeDescriptorSets-pDescriptorSets-00311", + "text": " Each valid handle in pDescriptorSets must have been allocated from descriptorPool" + }, + { + "vuid": "VUID-vkFreeDescriptorSets-descriptorPool-00312", + "text": " descriptorPool must have been created with the VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT flag" + }, + { + "vuid": "VUID-vkFreeDescriptorSets-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkFreeDescriptorSets-descriptorPool-parameter", + "text": " descriptorPool must be a valid VkDescriptorPool handle" + }, + { + "vuid": "VUID-vkFreeDescriptorSets-descriptorSetCount-arraylength", + "text": " descriptorSetCount must be greater than 0" + }, + { + "vuid": "VUID-vkFreeDescriptorSets-descriptorPool-parent", + "text": " descriptorPool must have been created, allocated, or retrieved from device" + }, + { + "vuid": "VUID-vkFreeDescriptorSets-pDescriptorSets-parent", + "text": " Each element of pDescriptorSets that is a valid handle must have been created, allocated, or retrieved from descriptorPool" + } + ] + }, + "vkResetDescriptorPool": { + "core": [ + { + "vuid": "VUID-vkResetDescriptorPool-descriptorPool-00313", + "text": " All uses of descriptorPool (via any allocated descriptor sets) must have completed execution" + }, + { + "vuid": "VUID-vkResetDescriptorPool-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkResetDescriptorPool-descriptorPool-parameter", + "text": " descriptorPool must be a valid VkDescriptorPool handle" + }, + { + "vuid": "VUID-vkResetDescriptorPool-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-vkResetDescriptorPool-descriptorPool-parent", + "text": " descriptorPool must have been created, allocated, or retrieved from device" + } + ] + }, + "vkUpdateDescriptorSets": { + "!(VK_EXT_descriptor_indexing)": [ + { + "vuid": "VUID-vkUpdateDescriptorSets-dstSet-00314", + "text": " The dstSet member of each element of pDescriptorWrites or pDescriptorCopies must not be used by any command that was recorded to a command buffer which is in the &amp;lt;&amp;lt;commandbuffers-lifecycle, pending state&amp;gt;&amp;gt;." + } + ], + "(VK_EXT_descriptor_indexing)": [ + { + "vuid": "VUID-vkUpdateDescriptorSets-None-03047", + "text": " Descriptor bindings updated by this command which were created without the VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT or VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT bits set must not be used by any command that was recorded to a command buffer which is in the &amp;lt;&amp;lt;commandbuffers-lifecycle,pending state&amp;gt;&amp;gt;." + } + ], + "core": [ + { + "vuid": "VUID-vkUpdateDescriptorSets-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkUpdateDescriptorSets-pDescriptorWrites-parameter", + "text": " If descriptorWriteCount is not 0, pDescriptorWrites must be a valid pointer to an array of descriptorWriteCount valid VkWriteDescriptorSet structures" + }, + { + "vuid": "VUID-vkUpdateDescriptorSets-pDescriptorCopies-parameter", + "text": " If descriptorCopyCount is not 0, pDescriptorCopies must be a valid pointer to an array of descriptorCopyCount valid VkCopyDescriptorSet structures" + } + ] + }, + "VkWriteDescriptorSet": { + "core": [ + { + "vuid": "VUID-VkWriteDescriptorSet-dstBinding-00315", + "text": " dstBinding must be less than or equal to the maximum value of binding of all VkDescriptorSetLayoutBinding structures specified when dstSet’s descriptor set layout was created" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-dstBinding-00316", + "text": " dstBinding must be a binding with a non-zero descriptorCount" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorCount-00317", + "text": " All consecutive bindings updated via a single VkWriteDescriptorSet structure, except those with a descriptorCount of zero, must have identical descriptorType and stageFlags." + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorCount-00318", + "text": " All consecutive bindings updated via a single VkWriteDescriptorSet structure, except those with a descriptorCount of zero, must all either use immutable samplers or must all not use immutable samplers." + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00319", + "text": " descriptorType must match the type of dstBinding within dstSet" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-dstSet-00320", + "text": " dstSet must be a valid VkDescriptorSet handle" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-dstArrayElement-00321", + "text": " The sum of dstArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding specified by dstBinding, and all applicable consecutive bindings, as described by &amp;lt;&amp;lt;descriptorsets-updates-consecutive&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00322", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLER, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, pImageInfo must be a valid pointer to an array of descriptorCount valid VkDescriptorImageInfo structures" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00323", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER or VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, pTexelBufferView must be a valid pointer to an array of descriptorCount valid VkBufferView handles" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00324", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, pBufferInfo must be a valid pointer to an array of descriptorCount valid VkDescriptorBufferInfo structures" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00325", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLER or VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and dstSet was not allocated with a layout that included immutable samplers for dstBinding with descriptorType, the sampler member of each element of pImageInfo must be a valid VkSampler object" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00326", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, the imageView and imageLayout members of each element of pImageInfo must be a valid VkImageView and VkImageLayout, respectively" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-01402", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, for each descriptor that will be accessed via load or store operations the imageLayout member for corresponding elements of pImageInfo must be VK_IMAGE_LAYOUT_GENERAL" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00327", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER or VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, the offset member of each element of pBufferInfo must be a multiple of VkPhysicalDeviceLimits::minUniformBufferOffsetAlignment" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00328", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_STORAGE_BUFFER or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, the offset member of each element of pBufferInfo must be a multiple of VkPhysicalDeviceLimits::minStorageBufferOffsetAlignment" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00329", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, and the buffer member of any element of pBufferInfo is the handle of a non-sparse buffer, then that buffer must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00330", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER or VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, the buffer member of each element of pBufferInfo must have been created with VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT set" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00331", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_STORAGE_BUFFER or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, the buffer member of each element of pBufferInfo must have been created with VK_BUFFER_USAGE_STORAGE_BUFFER_BIT set" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00332", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER or VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, the range member of each element of pBufferInfo, or the effective range if range is VK_WHOLE_SIZE, must be less than or equal to VkPhysicalDeviceLimits::maxUniformBufferRange" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00333", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_STORAGE_BUFFER or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, the range member of each element of pBufferInfo, or the effective range if range is VK_WHOLE_SIZE, must be less than or equal to VkPhysicalDeviceLimits::maxStorageBufferRange" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00334", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, the VkBuffer that each element of pTexelBufferView was created from must have been created with VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT set" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00335", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, the VkBuffer that each element of pTexelBufferView was created from must have been created with VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT set" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00336", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_STORAGE_IMAGE or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, the imageView member of each element of pImageInfo must have been created with the identity swizzle" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00337", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE or VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, the imageView member of each element of pImageInfo must have been created with VK_IMAGE_USAGE_SAMPLED_BIT set" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-01403", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE or VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, the imageLayout member of each element of pImageInfo must be VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00338", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, the imageView member of each element of pImageInfo must have been created with VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT set" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-00339", + "text": " If descriptorType is VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, the imageView member of each element of pImageInfo must have been created with VK_IMAGE_USAGE_STORAGE_BIT set" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorType-parameter", + "text": " descriptorType must be a valid VkDescriptorType value" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorCount-arraylength", + "text": " descriptorCount must be greater than 0" + }, + { + "vuid": "VUID-VkWriteDescriptorSet-commonparent", + "text": " Both of dstSet, and the elements of pTexelBufferView that are valid handles must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_EXT_descriptor_indexing)": [ + { + "vuid": "VUID-VkWriteDescriptorSet-descriptorCount-03048", + "text": " All consecutive bindings updated via a single VkWriteDescriptorSet structure, except those with a descriptorCount of zero, must have identical VkDescriptorBindingFlagBitsEXT." + } + ] + }, + "VkDescriptorBufferInfo": { + "core": [ + { + "vuid": "VUID-VkDescriptorBufferInfo-offset-00340", + "text": " offset must be less than the size of buffer" + }, + { + "vuid": "VUID-VkDescriptorBufferInfo-range-00341", + "text": " If range is not equal to VK_WHOLE_SIZE, range must be greater than 0" + }, + { + "vuid": "VUID-VkDescriptorBufferInfo-range-00342", + "text": " If range is not equal to VK_WHOLE_SIZE, range must be less than or equal to the size of buffer minus offset" + }, + { + "vuid": "VUID-VkDescriptorBufferInfo-buffer-parameter", + "text": " buffer must be a valid VkBuffer handle" + } + ] + }, + "VkDescriptorImageInfo": { + "(VK_VERSION_1_1,VK_KHR_maintenance1)": [ + { + "vuid": "VUID-VkDescriptorImageInfo-imageView-00343", + "text": " imageView must not be 2D or 2D array image view created from a 3D image" + } + ], + "core": [ + { + "vuid": "VUID-VkDescriptorImageInfo-imageLayout-00344", + "text": " imageLayout must match the actual VkImageLayout of each subresource accessible from imageView at the time this descriptor is accessed" + }, + { + "vuid": "VUID-VkDescriptorImageInfo-commonparent", + "text": " Both of imageView, and sampler that are valid handles must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkDescriptorImageInfo-sampler-01563", + "text": " If sampler is used and enables &amp;lt;&amp;lt;samplers-YCbCr-conversion,sampler Y’CBCR conversion&amp;gt;&amp;gt;:" + }, + { + "vuid": "VUID-VkDescriptorImageInfo-sampler-01564", + "text": " If sampler is used and does not enable &amp;lt;&amp;lt;samplers-YCbCr-conversion, sampler Y’CBCR conversion&amp;gt;&amp;gt; and the VkFormat of the image is a &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion,multi-planar format&amp;gt;&amp;gt;, the image must have been created with VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, and the aspectMask of the imageView must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT or (for three-plane formats only) VK_IMAGE_ASPECT_PLANE_2_BIT" + } + ] + }, + "VkCopyDescriptorSet": { + "core": [ + { + "vuid": "VUID-VkCopyDescriptorSet-srcBinding-00345", + "text": " srcBinding must be a valid binding within srcSet" + }, + { + "vuid": "VUID-VkCopyDescriptorSet-srcArrayElement-00346", + "text": " The sum of srcArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding specified by srcBinding, and all applicable consecutive bindings, as described by &amp;lt;&amp;lt;descriptorsets-updates-consecutive&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-VkCopyDescriptorSet-dstBinding-00347", + "text": " dstBinding must be a valid binding within dstSet" + }, + { + "vuid": "VUID-VkCopyDescriptorSet-dstArrayElement-00348", + "text": " The sum of dstArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding specified by dstBinding, and all applicable consecutive bindings, as described by &amp;lt;&amp;lt;descriptorsets-updates-consecutive&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-VkCopyDescriptorSet-srcSet-00349", + "text": " If srcSet is equal to dstSet, then the source and destination ranges of descriptors must not overlap, where the ranges may include array elements from consecutive bindings as described by &amp;lt;&amp;lt;descriptorsets-updates-consecutive&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-VkCopyDescriptorSet-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET" + }, + { + "vuid": "VUID-VkCopyDescriptorSet-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkCopyDescriptorSet-srcSet-parameter", + "text": " srcSet must be a valid VkDescriptorSet handle" + }, + { + "vuid": "VUID-VkCopyDescriptorSet-dstSet-parameter", + "text": " dstSet must be a valid VkDescriptorSet handle" + }, + { + "vuid": "VUID-VkCopyDescriptorSet-commonparent", + "text": " Both of dstSet, and srcSet must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_EXT_descriptor_indexing)": [ + { + "vuid": "VUID-VkCopyDescriptorSet-srcSet-01918", + "text": " If srcSet’s layout was created with the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT flag set, then dstSet’s layout must also have been created with the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT flag set" + }, + { + "vuid": "VUID-VkCopyDescriptorSet-srcSet-01919", + "text": " If srcSet’s layout was created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT flag set, then dstSet’s layout must also have been created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT flag set" + }, + { + "vuid": "VUID-VkCopyDescriptorSet-srcSet-01920", + "text": " If the descriptor pool from which srcSet was allocated was created with the VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag set, then the descriptor pool from which dstSet was allocated must also have been created with the VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag set" + }, + { + "vuid": "VUID-VkCopyDescriptorSet-srcSet-01921", + "text": " If the descriptor pool from which srcSet was allocated was created without the VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag set, then the descriptor pool from which dstSet was allocated must also have been created without the VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT flag set" + } + ] + }, + "vkCreateDescriptorUpdateTemplate": { + "(VK_VERSION_1_1,VK_KHR_descriptor_update_template)": [ + { + "vuid": "VUID-vkCreateDescriptorUpdateTemplate-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateDescriptorUpdateTemplate-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkDescriptorUpdateTemplateCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateDescriptorUpdateTemplate-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateDescriptorUpdateTemplate-pDescriptorUpdateTemplate-parameter", + "text": " pDescriptorUpdateTemplate must be a valid pointer to a VkDescriptorUpdateTemplate handle" + } + ] + }, + "VkDescriptorUpdateTemplateCreateInfo": { + "(VK_VERSION_1_1,VK_KHR_descriptor_update_template)": [ + { + "vuid": "VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00350", + "text": " If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, descriptorSetLayout must be a valid VkDescriptorSetLayout handle" + }, + { + "vuid": "VUID-VkDescriptorUpdateTemplateCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO" + }, + { + "vuid": "VUID-VkDescriptorUpdateTemplateCreateInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkDescriptorUpdateTemplateCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkDescriptorUpdateTemplateCreateInfo-pDescriptorUpdateEntries-parameter", + "text": " pDescriptorUpdateEntries must be a valid pointer to an array of descriptorUpdateEntryCount valid VkDescriptorUpdateTemplateEntry structures" + }, + { + "vuid": "VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-parameter", + "text": " templateType must be a valid VkDescriptorUpdateTemplateType value" + }, + { + "vuid": "VUID-VkDescriptorUpdateTemplateCreateInfo-descriptorSetLayout-parameter", + "text": " If descriptorSetLayout is not VK_NULL_HANDLE, descriptorSetLayout must be a valid VkDescriptorSetLayout handle" + }, + { + "vuid": "VUID-VkDescriptorUpdateTemplateCreateInfo-descriptorUpdateEntryCount-arraylength", + "text": " descriptorUpdateEntryCount must be greater than 0" + }, + { + "vuid": "VUID-VkDescriptorUpdateTemplateCreateInfo-commonparent", + "text": " Both of descriptorSetLayout, and pipelineLayout that are valid handles must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1,VK_KHR_descriptor_update_template)+(VK_KHR_push_descriptor)": [ + { + "vuid": "VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00351", + "text": " If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, pipelineBindPoint must be a valid VkPipelineBindPoint value" + }, + { + "vuid": "VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00352", + "text": " If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, pipelineLayout must be a valid VkPipelineLayout handle" + }, + { + "vuid": "VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00353", + "text": " If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, set must be the unique set number in the pipeline layout that uses a descriptor set layout that was created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR" + } + ] + }, + "VkDescriptorUpdateTemplateEntry": { + "(VK_VERSION_1_1,VK_KHR_descriptor_update_template)": [ + { + "vuid": "VUID-VkDescriptorUpdateTemplateEntry-dstBinding-00354", + "text": " dstBinding must be a valid binding in the descriptor set layout implicitly specified when using a descriptor update template to update descriptors." + }, + { + "vuid": "VUID-VkDescriptorUpdateTemplateEntry-dstArrayElement-00355", + "text": " dstArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding implicitly specified when using a descriptor update template to update descriptors, and all applicable consecutive bindings, as described by &amp;lt;&amp;lt;descriptorsets-updates-consecutive&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-VkDescriptorUpdateTemplateEntry-descriptorType-parameter", + "text": " descriptorType must be a valid VkDescriptorType value" + } + ] + }, + "vkDestroyDescriptorUpdateTemplate": { + "(VK_VERSION_1_1,VK_KHR_descriptor_update_template)": [ + { + "vuid": "VUID-vkDestroyDescriptorUpdateTemplate-descriptorSetLayout-00356", + "text": " If VkAllocationCallbacks were provided when descriptorSetLayout was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyDescriptorUpdateTemplate-descriptorSetLayout-00357", + "text": " If no VkAllocationCallbacks were provided when descriptorSetLayout was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyDescriptorUpdateTemplate-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyDescriptorUpdateTemplate-descriptorUpdateTemplate-parameter", + "text": " If descriptorUpdateTemplate is not VK_NULL_HANDLE, descriptorUpdateTemplate must be a valid VkDescriptorUpdateTemplate handle" + }, + { + "vuid": "VUID-vkDestroyDescriptorUpdateTemplate-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyDescriptorUpdateTemplate-descriptorUpdateTemplate-parent", + "text": " If descriptorUpdateTemplate is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkUpdateDescriptorSetWithTemplate": { + "(VK_VERSION_1_1,VK_KHR_descriptor_update_template)": [ + { + "vuid": "VUID-vkUpdateDescriptorSetWithTemplate-pData-01685", + "text": " pData must be a valid pointer to a memory that contains one or more valid instances of VkDescriptorImageInfo, VkDescriptorBufferInfo, or VkBufferView in a layout defined by descriptorUpdateTemplate when it was created with vkCreateDescriptorUpdateTemplate" + }, + { + "vuid": "VUID-vkUpdateDescriptorSetWithTemplate-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkUpdateDescriptorSetWithTemplate-descriptorSet-parameter", + "text": " descriptorSet must be a valid VkDescriptorSet handle" + }, + { + "vuid": "VUID-vkUpdateDescriptorSetWithTemplate-descriptorUpdateTemplate-parameter", + "text": " descriptorUpdateTemplate must be a valid VkDescriptorUpdateTemplate handle" + }, + { + "vuid": "VUID-vkUpdateDescriptorSetWithTemplate-descriptorUpdateTemplate-parent", + "text": " descriptorUpdateTemplate must have been created, allocated, or retrieved from device" + } + ] + }, + "vkCmdBindDescriptorSets": { + "core": [ + { + "vuid": "VUID-vkCmdBindDescriptorSets-pDescriptorSets-00358", + "text": " Each element of pDescriptorSets must have been allocated with a VkDescriptorSetLayout that matches (is the same as, or identically defined as) the VkDescriptorSetLayout at set n in layout, where n is the sum of firstSet and the index into pDescriptorSets" + }, + { + "vuid": "VUID-vkCmdBindDescriptorSets-dynamicOffsetCount-00359", + "text": " dynamicOffsetCount must be equal to the total number of dynamic descriptors in pDescriptorSets" + }, + { + "vuid": "VUID-vkCmdBindDescriptorSets-firstSet-00360", + "text": " The sum of firstSet and descriptorSetCount must be less than or equal to VkPipelineLayoutCreateInfo::setLayoutCount provided when layout was created" + }, + { + "vuid": "VUID-vkCmdBindDescriptorSets-pipelineBindPoint-00361", + "text": " pipelineBindPoint must be supported by the commandBuffer’s parent VkCommandPool’s queue family" + }, + { + "vuid": "VUID-vkCmdBindDescriptorSets-pDynamicOffsets-00362", + "text": " Each element of pDynamicOffsets must satisfy the required alignment for the corresponding descriptor binding’s descriptor type" + }, + { + "vuid": "VUID-vkCmdBindDescriptorSets-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdBindDescriptorSets-pipelineBindPoint-parameter", + "text": " pipelineBindPoint must be a valid VkPipelineBindPoint value" + }, + { + "vuid": "VUID-vkCmdBindDescriptorSets-layout-parameter", + "text": " layout must be a valid VkPipelineLayout handle" + }, + { + "vuid": "VUID-vkCmdBindDescriptorSets-pDescriptorSets-parameter", + "text": " pDescriptorSets must be a valid pointer to an array of descriptorSetCount valid VkDescriptorSet handles" + }, + { + "vuid": "VUID-vkCmdBindDescriptorSets-pDynamicOffsets-parameter", + "text": " If dynamicOffsetCount is not 0, pDynamicOffsets must be a valid pointer to an array of dynamicOffsetCount uint32_t values" + }, + { + "vuid": "VUID-vkCmdBindDescriptorSets-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdBindDescriptorSets-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdBindDescriptorSets-descriptorSetCount-arraylength", + "text": " descriptorSetCount must be greater than 0" + }, + { + "vuid": "VUID-vkCmdBindDescriptorSets-commonparent", + "text": " Each of commandBuffer, layout, and the elements of pDescriptorSets must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "vkCmdPushDescriptorSetKHR": { + "(VK_KHR_push_descriptor)": [ + { + "vuid": "VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-00363", + "text": " pipelineBindPoint must be supported by the commandBuffer’s parent VkCommandPool’s queue family" + }, + { + "vuid": "VUID-vkCmdPushDescriptorSetKHR-set-00364", + "text": " set must be less than VkPipelineLayoutCreateInfo::setLayoutCount provided when layout was created" + }, + { + "vuid": "VUID-vkCmdPushDescriptorSetKHR-set-00365", + "text": " set must be the unique set number in the pipeline layout that uses a descriptor set layout that was created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR" + }, + { + "vuid": "VUID-vkCmdPushDescriptorSetKHR-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-parameter", + "text": " pipelineBindPoint must be a valid VkPipelineBindPoint value" + }, + { + "vuid": "VUID-vkCmdPushDescriptorSetKHR-layout-parameter", + "text": " layout must be a valid VkPipelineLayout handle" + }, + { + "vuid": "VUID-vkCmdPushDescriptorSetKHR-pDescriptorWrites-parameter", + "text": " pDescriptorWrites must be a valid pointer to an array of descriptorWriteCount valid VkWriteDescriptorSet structures" + }, + { + "vuid": "VUID-vkCmdPushDescriptorSetKHR-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdPushDescriptorSetKHR-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdPushDescriptorSetKHR-descriptorWriteCount-arraylength", + "text": " descriptorWriteCount must be greater than 0" + }, + { + "vuid": "VUID-vkCmdPushDescriptorSetKHR-commonparent", + "text": " Both of commandBuffer, and layout must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "vkCmdPushDescriptorSetWithTemplateKHR": { + "(VK_KHR_push_descriptor)+(VK_VERSION_1_1,VK_KHR_descriptor_update_template)": [ + { + "vuid": "VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-00366", + "text": " The pipelineBindPoint specified during the creation of the descriptor update template must be supported by the commandBuffer’s parent VkCommandPool’s queue family" + }, + { + "vuid": "VUID-vkCmdPushDescriptorSetWithTemplateKHR-pData-01686", + "text": " pData must be a valid pointer to a memory that contains one or more valid instances of VkDescriptorImageInfo, VkDescriptorBufferInfo, or VkBufferView in a layout defined by descriptorUpdateTemplate when it was created with vkCreateDescriptorUpdateTemplateKHR" + }, + { + "vuid": "VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdPushDescriptorSetWithTemplateKHR-descriptorUpdateTemplate-parameter", + "text": " descriptorUpdateTemplate must be a valid VkDescriptorUpdateTemplate handle" + }, + { + "vuid": "VUID-vkCmdPushDescriptorSetWithTemplateKHR-layout-parameter", + "text": " layout must be a valid VkPipelineLayout handle" + }, + { + "vuid": "VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdPushDescriptorSetWithTemplateKHR-commonparent", + "text": " Each of commandBuffer, descriptorUpdateTemplate, and layout must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "vkCmdPushConstants": { + "core": [ + { + "vuid": "VUID-vkCmdPushConstants-offset-01795", + "text": " For each byte in the range specified by offset and size and for each shader stage in stageFlags, there must be a push constant range in layout that includes that byte and that stage" + }, + { + "vuid": "VUID-vkCmdPushConstants-offset-01796", + "text": " For each byte in the range specified by offset and size and for each push constant range that overlaps that byte, stageFlags must include all stages in that push constant range’s VkPushConstantRange::stageFlags" + }, + { + "vuid": "VUID-vkCmdPushConstants-offset-00368", + "text": " offset must be a multiple of 4" + }, + { + "vuid": "VUID-vkCmdPushConstants-size-00369", + "text": " size must be a multiple of 4" + }, + { + "vuid": "VUID-vkCmdPushConstants-offset-00370", + "text": " offset must be less than VkPhysicalDeviceLimits::maxPushConstantsSize" + }, + { + "vuid": "VUID-vkCmdPushConstants-size-00371", + "text": " size must be less than or equal to VkPhysicalDeviceLimits::maxPushConstantsSize minus offset" + }, + { + "vuid": "VUID-vkCmdPushConstants-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdPushConstants-layout-parameter", + "text": " layout must be a valid VkPipelineLayout handle" + }, + { + "vuid": "VUID-vkCmdPushConstants-stageFlags-parameter", + "text": " stageFlags must be a valid combination of VkShaderStageFlagBits values" + }, + { + "vuid": "VUID-vkCmdPushConstants-stageFlags-requiredbitmask", + "text": " stageFlags must not be 0" + }, + { + "vuid": "VUID-vkCmdPushConstants-pValues-parameter", + "text": " pValues must be a valid pointer to an array of size bytes" + }, + { + "vuid": "VUID-vkCmdPushConstants-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdPushConstants-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdPushConstants-size-arraylength", + "text": " size must be greater than 0" + }, + { + "vuid": "VUID-vkCmdPushConstants-commonparent", + "text": " Both of commandBuffer, and layout must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "vkCreateQueryPool": { + "core": [ + { + "vuid": "VUID-vkCreateQueryPool-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateQueryPool-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkQueryPoolCreateInfo structure" + }, + { + "vuid": "VUID-vkCreateQueryPool-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateQueryPool-pQueryPool-parameter", + "text": " pQueryPool must be a valid pointer to a VkQueryPool handle" + } + ] + }, + "VkQueryPoolCreateInfo": { + "core": [ + { + "vuid": "VUID-VkQueryPoolCreateInfo-queryType-00791", + "text": " If the &amp;lt;&amp;lt;features-features-pipelineStatisticsQuery,pipeline statistics queries&amp;gt;&amp;gt; feature is not enabled, queryType must not be VK_QUERY_TYPE_PIPELINE_STATISTICS" + }, + { + "vuid": "VUID-VkQueryPoolCreateInfo-queryType-00792", + "text": " If queryType is VK_QUERY_TYPE_PIPELINE_STATISTICS, pipelineStatistics must be a valid combination of VkQueryPipelineStatisticFlagBits values" + }, + { + "vuid": "VUID-VkQueryPoolCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO" + }, + { + "vuid": "VUID-VkQueryPoolCreateInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkQueryPoolCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkQueryPoolCreateInfo-queryType-parameter", + "text": " queryType must be a valid VkQueryType value" + } + ] + }, + "vkDestroyQueryPool": { + "core": [ + { + "vuid": "VUID-vkDestroyQueryPool-queryPool-00793", + "text": " All submitted commands that refer to queryPool must have completed execution" + }, + { + "vuid": "VUID-vkDestroyQueryPool-queryPool-00794", + "text": " If VkAllocationCallbacks were provided when queryPool was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyQueryPool-queryPool-00795", + "text": " If no VkAllocationCallbacks were provided when queryPool was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyQueryPool-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyQueryPool-queryPool-parameter", + "text": " If queryPool is not VK_NULL_HANDLE, queryPool must be a valid VkQueryPool handle" + }, + { + "vuid": "VUID-vkDestroyQueryPool-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyQueryPool-queryPool-parent", + "text": " If queryPool is a valid handle, it must have been created, allocated, or retrieved from device" + } + ] + }, + "vkCmdResetQueryPool": { + "core": [ + { + "vuid": "VUID-vkCmdResetQueryPool-firstQuery-00796", + "text": " firstQuery must be less than the number of queries in queryPool" + }, + { + "vuid": "VUID-vkCmdResetQueryPool-firstQuery-00797", + "text": " The sum of firstQuery and queryCount must be less than or equal to the number of queries in queryPool" + }, + { + "vuid": "VUID-vkCmdResetQueryPool-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdResetQueryPool-queryPool-parameter", + "text": " queryPool must be a valid VkQueryPool handle" + }, + { + "vuid": "VUID-vkCmdResetQueryPool-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdResetQueryPool-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdResetQueryPool-renderpass", + "text": " This command must only be called outside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdResetQueryPool-commonparent", + "text": " Both of commandBuffer, and queryPool must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "vkCmdBeginQuery": { + "core": [ + { + "vuid": "VUID-vkCmdBeginQuery-queryPool-01922", + "text": " queryPool must have been created with a queryType that differs from that of any queries that are &amp;lt;&amp;lt;queries-operation-active,active&amp;gt;&amp;gt; within commandBuffer" + }, + { + "vuid": "VUID-vkCmdBeginQuery-None-00807", + "text": " All queries used by the command must be unavailable" + }, + { + "vuid": "VUID-vkCmdBeginQuery-queryType-00800", + "text": " If the &amp;lt;&amp;lt;features-features-occlusionQueryPrecise,precise occlusion queries&amp;gt;&amp;gt; feature is not enabled, or the queryType used to create queryPool was not VK_QUERY_TYPE_OCCLUSION, flags must not contain VK_QUERY_CONTROL_PRECISE_BIT" + }, + { + "vuid": "VUID-vkCmdBeginQuery-query-00802", + "text": " query must be less than the number of queries in queryPool" + }, + { + "vuid": "VUID-vkCmdBeginQuery-queryType-00803", + "text": " If the queryType used to create queryPool was VK_QUERY_TYPE_OCCLUSION, the VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdBeginQuery-queryType-00804", + "text": " If the queryType used to create queryPool was VK_QUERY_TYPE_PIPELINE_STATISTICS and any of the pipelineStatistics indicate graphics operations, the VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdBeginQuery-queryType-00805", + "text": " If the queryType used to create queryPool was VK_QUERY_TYPE_PIPELINE_STATISTICS and any of the pipelineStatistics indicate compute operations, the VkCommandPool that commandBuffer was allocated from must support compute operations" + }, + { + "vuid": "VUID-vkCmdBeginQuery-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdBeginQuery-queryPool-parameter", + "text": " queryPool must be a valid VkQueryPool handle" + }, + { + "vuid": "VUID-vkCmdBeginQuery-flags-parameter", + "text": " flags must be a valid combination of VkQueryControlFlagBits values" + }, + { + "vuid": "VUID-vkCmdBeginQuery-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdBeginQuery-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdBeginQuery-commonparent", + "text": " Both of commandBuffer, and queryPool must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdBeginQuery-commandBuffer-01885", + "text": " commandBuffer must not be a protected command buffer" + } + ], + "(VK_VERSION_1_1,VK_KHR_multiview)": [ + { + "vuid": "VUID-vkCmdBeginQuery-query-00808", + "text": " If vkCmdBeginQuery is called within a render pass instance, the sum of query and the number of bits set in the current subpass’s view mask must be less than or equal to the number of queries in queryPool" + } + ] + }, + "vkCmdEndQuery": { + "core": [ + { + "vuid": "VUID-vkCmdEndQuery-None-01923", + "text": " All queries used by the command must be &amp;lt;&amp;lt;queries-operation-active,active&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdEndQuery-query-00810", + "text": " query must be less than the number of queries in queryPool" + }, + { + "vuid": "VUID-vkCmdEndQuery-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdEndQuery-queryPool-parameter", + "text": " queryPool must be a valid VkQueryPool handle" + }, + { + "vuid": "VUID-vkCmdEndQuery-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdEndQuery-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdEndQuery-commonparent", + "text": " Both of commandBuffer, and queryPool must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdEndQuery-commandBuffer-01886", + "text": " commandBuffer must not be a protected command buffer" + } + ], + "(VK_VERSION_1_1,VK_KHR_multiview)": [ + { + "vuid": "VUID-vkCmdEndQuery-query-00812", + "text": " If vkCmdEndQuery is called within a render pass instance, the sum of query and the number of bits set in the current subpass’s view mask must be less than or equal to the number of queries in queryPool" + } + ] + }, + "vkGetQueryPoolResults": { + "core": [ + { + "vuid": "VUID-vkGetQueryPoolResults-firstQuery-00813", + "text": " firstQuery must be less than the number of queries in queryPool" + }, + { + "vuid": "VUID-vkGetQueryPoolResults-flags-00814", + "text": " If VK_QUERY_RESULT_64_BIT is not set in flags then pData and stride must be multiples of 4" + }, + { + "vuid": "VUID-vkGetQueryPoolResults-flags-00815", + "text": " If VK_QUERY_RESULT_64_BIT is set in flags then pData and stride must be multiples of 8" + }, + { + "vuid": "VUID-vkGetQueryPoolResults-firstQuery-00816", + "text": " The sum of firstQuery and queryCount must be less than or equal to the number of queries in queryPool" + }, + { + "vuid": "VUID-vkGetQueryPoolResults-dataSize-00817", + "text": " dataSize must be large enough to contain the result of each query, as described &amp;lt;&amp;lt;queries-operation-memorylayout,here&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkGetQueryPoolResults-queryType-00818", + "text": " If the queryType used to create queryPool was VK_QUERY_TYPE_TIMESTAMP, flags must not contain VK_QUERY_RESULT_PARTIAL_BIT" + }, + { + "vuid": "VUID-vkGetQueryPoolResults-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetQueryPoolResults-queryPool-parameter", + "text": " queryPool must be a valid VkQueryPool handle" + }, + { + "vuid": "VUID-vkGetQueryPoolResults-pData-parameter", + "text": " pData must be a valid pointer to an array of dataSize bytes" + }, + { + "vuid": "VUID-vkGetQueryPoolResults-flags-parameter", + "text": " flags must be a valid combination of VkQueryResultFlagBits values" + }, + { + "vuid": "VUID-vkGetQueryPoolResults-dataSize-arraylength", + "text": " dataSize must be greater than 0" + }, + { + "vuid": "VUID-vkGetQueryPoolResults-queryPool-parent", + "text": " queryPool must have been created, allocated, or retrieved from device" + } + ] + }, + "vkCmdCopyQueryPoolResults": { + "core": [ + { + "vuid": "VUID-vkCmdCopyQueryPoolResults-dstOffset-00819", + "text": " dstOffset must be less than the size of dstBuffer" + }, + { + "vuid": "VUID-vkCmdCopyQueryPoolResults-firstQuery-00820", + "text": " firstQuery must be less than the number of queries in queryPool" + }, + { + "vuid": "VUID-vkCmdCopyQueryPoolResults-firstQuery-00821", + "text": " The sum of firstQuery and queryCount must be less than or equal to the number of queries in queryPool" + }, + { + "vuid": "VUID-vkCmdCopyQueryPoolResults-flags-00822", + "text": " If VK_QUERY_RESULT_64_BIT is not set in flags then dstOffset and stride must be multiples of 4" + }, + { + "vuid": "VUID-vkCmdCopyQueryPoolResults-flags-00823", + "text": " If VK_QUERY_RESULT_64_BIT is set in flags then dstOffset and stride must be multiples of 8" + }, + { + "vuid": "VUID-vkCmdCopyQueryPoolResults-dstBuffer-00824", + "text": " dstBuffer must have enough storage, from dstOffset, to contain the result of each query, as described &amp;lt;&amp;lt;queries-operation-memorylayout,here&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdCopyQueryPoolResults-dstBuffer-00825", + "text": " dstBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_DST_BIT usage flag" + }, + { + "vuid": "VUID-vkCmdCopyQueryPoolResults-dstBuffer-00826", + "text": " If dstBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdCopyQueryPoolResults-queryType-00827", + "text": " If the queryType used to create queryPool was VK_QUERY_TYPE_TIMESTAMP, flags must not contain VK_QUERY_RESULT_PARTIAL_BIT" + }, + { + "vuid": "VUID-vkCmdCopyQueryPoolResults-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdCopyQueryPoolResults-queryPool-parameter", + "text": " queryPool must be a valid VkQueryPool handle" + }, + { + "vuid": "VUID-vkCmdCopyQueryPoolResults-dstBuffer-parameter", + "text": " dstBuffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkCmdCopyQueryPoolResults-flags-parameter", + "text": " flags must be a valid combination of VkQueryResultFlagBits values" + }, + { + "vuid": "VUID-vkCmdCopyQueryPoolResults-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdCopyQueryPoolResults-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdCopyQueryPoolResults-renderpass", + "text": " This command must only be called outside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdCopyQueryPoolResults-commonparent", + "text": " Each of commandBuffer, dstBuffer, and queryPool must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "vkCmdWriteTimestamp": { + "core": [ + { + "vuid": "VUID-vkCmdWriteTimestamp-queryPool-01416", + "text": " queryPool must have been created with a queryType of VK_QUERY_TYPE_TIMESTAMP" + }, + { + "vuid": "VUID-vkCmdWriteTimestamp-queryPool-00828", + "text": " The query identified by queryPool and query must be unavailable" + }, + { + "vuid": "VUID-vkCmdWriteTimestamp-timestampValidBits-00829", + "text": " The command pool’s queue family must support a non-zero timestampValidBits" + }, + { + "vuid": "VUID-vkCmdWriteTimestamp-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdWriteTimestamp-pipelineStage-parameter", + "text": " pipelineStage must be a valid VkPipelineStageFlagBits value" + }, + { + "vuid": "VUID-vkCmdWriteTimestamp-queryPool-parameter", + "text": " queryPool must be a valid VkQueryPool handle" + }, + { + "vuid": "VUID-vkCmdWriteTimestamp-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdWriteTimestamp-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdWriteTimestamp-commonparent", + "text": " Both of commandBuffer, and queryPool must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1,VK_KHR_multiview)": [ + { + "vuid": "VUID-vkCmdWriteTimestamp-None-00830", + "text": " All queries used by the command must be unavailable" + }, + { + "vuid": "VUID-vkCmdWriteTimestamp-query-00831", + "text": " If vkCmdWriteTimestamp is called within a render pass instance, the sum of query and the number of bits set in the current subpass’s view mask must be less than or equal to the number of queries in queryPool" + } + ] + }, + "vkCmdClearColorImage": { + "(VK_VERSION_1_1,VK_KHR_maintenance1)": [ + { + "vuid": "VUID-vkCmdClearColorImage-image-00001", + "text": " image must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties" + } + ], + "core": [ + { + "vuid": "VUID-vkCmdClearColorImage-image-00002", + "text": " image must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag" + }, + { + "vuid": "VUID-vkCmdClearColorImage-image-00003", + "text": " If image is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdClearColorImage-imageLayout-00004", + "text": " imageLayout must specify the layout of the image subresource ranges of image specified in pRanges at the time this command is executed on a VkDevice" + }, + { + "vuid": "VUID-vkCmdClearColorImage-baseMipLevel-01470", + "text": " The VkImageSubresourceRange::baseMipLevel members of the elements of the pRanges array must each be less than the mipLevels specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-vkCmdClearColorImage-pRanges-01692", + "text": " For each VkImageSubresourceRange element of pRanges, if the levelCount member is not VK_REMAINING_MIP_LEVELS, then baseMipLevel + levelCount must be less than the mipLevels specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-vkCmdClearColorImage-baseArrayLayer-01472", + "text": " The VkImageSubresourceRange::baseArrayLayer members of the elements of the pRanges array must each be less than the arrayLayers specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-vkCmdClearColorImage-pRanges-01693", + "text": " For each VkImageSubresourceRange element of pRanges, if the layerCount member is not VK_REMAINING_ARRAY_LAYERS, then baseArrayLayer + layerCount must be less than the arrayLayers specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-vkCmdClearColorImage-image-00007", + "text": " image must not have a compressed or depth/stencil format" + }, + { + "vuid": "VUID-vkCmdClearColorImage-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdClearColorImage-image-parameter", + "text": " image must be a valid VkImage handle" + }, + { + "vuid": "VUID-vkCmdClearColorImage-imageLayout-parameter", + "text": " imageLayout must be a valid VkImageLayout value" + }, + { + "vuid": "VUID-vkCmdClearColorImage-pColor-parameter", + "text": " pColor must be a valid pointer to a valid VkClearColorValue union" + }, + { + "vuid": "VUID-vkCmdClearColorImage-pRanges-parameter", + "text": " pRanges must be a valid pointer to an array of rangeCount valid VkImageSubresourceRange structures" + }, + { + "vuid": "VUID-vkCmdClearColorImage-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdClearColorImage-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdClearColorImage-renderpass", + "text": " This command must only be called outside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdClearColorImage-rangeCount-arraylength", + "text": " rangeCount must be greater than 0" + }, + { + "vuid": "VUID-vkCmdClearColorImage-commonparent", + "text": " Both of commandBuffer, and image must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-vkCmdClearColorImage-image-01545", + "text": " image must not use a format listed in &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion&amp;gt;&amp;gt;" + } + ], + "!(VK_KHR_shared_presentable_image)": [ + { + "vuid": "VUID-vkCmdClearColorImage-imageLayout-00005", + "text": " imageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL" + } + ], + "(VK_KHR_shared_presentable_image)": [ + { + "vuid": "VUID-vkCmdClearColorImage-imageLayout-01394", + "text": " imageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR" + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdClearColorImage-commandBuffer-01805", + "text": " If commandBuffer is an unprotected command buffer, then image must not be a protected image" + }, + { + "vuid": "VUID-vkCmdClearColorImage-commandBuffer-01806", + "text": " If commandBuffer is a protected command buffer, then image must not be an unprotected image" + } + ] + }, + "vkCmdClearDepthStencilImage": { + "(VK_VERSION_1_1,VK_KHR_maintenance1)": [ + { + "vuid": "VUID-vkCmdClearDepthStencilImage-image-00008", + "text": " image must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties" + } + ], + "core": [ + { + "vuid": "VUID-vkCmdClearDepthStencilImage-image-00009", + "text": " image must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-image-00010", + "text": " If image is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-imageLayout-00011", + "text": " imageLayout must specify the layout of the image subresource ranges of image specified in pRanges at the time this command is executed on a VkDevice" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-imageLayout-00012", + "text": " imageLayout must be either of VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-baseMipLevel-01474", + "text": " The VkImageSubresourceRange::baseMipLevel members of the elements of the pRanges array must each be less than the mipLevels specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-pRanges-01694", + "text": " For each VkImageSubresourceRange element of pRanges, if the levelCount member is not VK_REMAINING_MIP_LEVELS, then baseMipLevel + levelCount must be less than the mipLevels specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-baseArrayLayer-01476", + "text": " The VkImageSubresourceRange::baseArrayLayer members of the elements of the pRanges array must each be less than the arrayLayers specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-pRanges-01695", + "text": " For each VkImageSubresourceRange element of pRanges, if the layerCount member is not VK_REMAINING_ARRAY_LAYERS, then baseArrayLayer + layerCount must be less than the arrayLayers specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-image-00014", + "text": " image must have a depth/stencil format" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-image-parameter", + "text": " image must be a valid VkImage handle" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-imageLayout-parameter", + "text": " imageLayout must be a valid VkImageLayout value" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-pDepthStencil-parameter", + "text": " pDepthStencil must be a valid pointer to a valid VkClearDepthStencilValue structure" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-pRanges-parameter", + "text": " pRanges must be a valid pointer to an array of rangeCount valid VkImageSubresourceRange structures" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-renderpass", + "text": " This command must only be called outside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-rangeCount-arraylength", + "text": " rangeCount must be greater than 0" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-commonparent", + "text": " Both of commandBuffer, and image must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdClearDepthStencilImage-commandBuffer-01807", + "text": " If commandBuffer is an unprotected command buffer, then image must not be a protected image" + }, + { + "vuid": "VUID-vkCmdClearDepthStencilImage-commandBuffer-01808", + "text": " If commandBuffer is a protected command buffer, then image must not be an unprotected image" + } + ] + }, + "vkCmdClearAttachments": { + "core": [ + { + "vuid": "VUID-vkCmdClearAttachments-aspectMask-00015", + "text": " If the aspectMask member of any element of pAttachments contains VK_IMAGE_ASPECT_COLOR_BIT, the colorAttachment member of that element must refer to a valid color attachment in the current subpass" + }, + { + "vuid": "VUID-vkCmdClearAttachments-pRects-00016", + "text": " The rectangular region specified by each element of pRects must be contained within the render area of the current render pass instance" + }, + { + "vuid": "VUID-vkCmdClearAttachments-pRects-00017", + "text": " The layers specified by each element of pRects must be contained within every attachment that pAttachments refers to" + }, + { + "vuid": "VUID-vkCmdClearAttachments-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdClearAttachments-pAttachments-parameter", + "text": " pAttachments must be a valid pointer to an array of attachmentCount valid VkClearAttachment structures" + }, + { + "vuid": "VUID-vkCmdClearAttachments-pRects-parameter", + "text": " pRects must be a valid pointer to an array of rectCount VkClearRect structures" + }, + { + "vuid": "VUID-vkCmdClearAttachments-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdClearAttachments-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdClearAttachments-renderpass", + "text": " This command must only be called inside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdClearAttachments-attachmentCount-arraylength", + "text": " attachmentCount must be greater than 0" + }, + { + "vuid": "VUID-vkCmdClearAttachments-rectCount-arraylength", + "text": " rectCount must be greater than 0" + } + ], + "(VK_VERSION_1_1,VK_KHR_multiview)": [ + { + "vuid": "VUID-vkCmdClearAttachments-baseArrayLayer-00018", + "text": " If the render pass instance this is recorded in uses multiview, then baseArrayLayer must be zero and layerCount must be one." + } + ] + }, + "VkClearAttachment": { + "core": [ + { + "vuid": "VUID-VkClearAttachment-aspectMask-00019", + "text": " If aspectMask includes VK_IMAGE_ASPECT_COLOR_BIT, it must not include VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT" + }, + { + "vuid": "VUID-VkClearAttachment-aspectMask-00020", + "text": " aspectMask must not include VK_IMAGE_ASPECT_METADATA_BIT" + }, + { + "vuid": "VUID-VkClearAttachment-clearValue-00021", + "text": " clearValue must be a valid VkClearValue union" + }, + { + "vuid": "VUID-VkClearAttachment-aspectMask-parameter", + "text": " aspectMask must be a valid combination of VkImageAspectFlagBits values" + }, + { + "vuid": "VUID-VkClearAttachment-aspectMask-requiredbitmask", + "text": " aspectMask must not be 0" + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-VkClearAttachment-commandBuffer-01809", + "text": " If commandBuffer is an unprotected command buffer, then the attachment to be cleared must not be a protected image." + }, + { + "vuid": "VUID-VkClearAttachment-commandBuffer-01810", + "text": " If commandBuffer is a protected command buffer, then the attachment to be cleared must not be an unprotected image." + } + ] + }, + "VkClearDepthStencilValue": { + "(VK_EXT_depth_range_unrestricted)": [ + { + "vuid": "VUID-VkClearDepthStencilValue-depth-00022", + "text": " Unless the VK_EXT_depth_range_unrestricted extension is enabled depth must be between 0.0 and 1.0, inclusive" + } + ], + "!(VK_EXT_depth_range_unrestricted)": [ + { + "vuid": "VUID-VkClearDepthStencilValue-depth-00022", + "text": " depth must be between 0.0 and 1.0, inclusive" + } + ] + }, + "VkClearValue": { + "core": [ + { + "vuid": "VUID-VkClearValue-depthStencil-00023", + "text": " depthStencil must be a valid VkClearDepthStencilValue structure" + } + ] + }, + "vkCmdFillBuffer": { + "core": [ + { + "vuid": "VUID-vkCmdFillBuffer-dstOffset-00024", + "text": " dstOffset must be less than the size of dstBuffer" + }, + { + "vuid": "VUID-vkCmdFillBuffer-dstOffset-00025", + "text": " dstOffset must be a multiple of 4" + }, + { + "vuid": "VUID-vkCmdFillBuffer-size-00026", + "text": " If size is not equal to VK_WHOLE_SIZE, size must be greater than 0" + }, + { + "vuid": "VUID-vkCmdFillBuffer-size-00027", + "text": " If size is not equal to VK_WHOLE_SIZE, size must be less than or equal to the size of dstBuffer minus dstOffset" + }, + { + "vuid": "VUID-vkCmdFillBuffer-size-00028", + "text": " If size is not equal to VK_WHOLE_SIZE, size must be a multiple of 4" + }, + { + "vuid": "VUID-vkCmdFillBuffer-dstBuffer-00029", + "text": " dstBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_DST_BIT usage flag" + }, + { + "vuid": "VUID-vkCmdFillBuffer-dstBuffer-00031", + "text": " If dstBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdFillBuffer-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdFillBuffer-dstBuffer-parameter", + "text": " dstBuffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkCmdFillBuffer-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdFillBuffer-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support transfer, graphics or compute operations" + }, + { + "vuid": "VUID-vkCmdFillBuffer-renderpass", + "text": " This command must only be called outside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdFillBuffer-commonparent", + "text": " Both of commandBuffer, and dstBuffer must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "!(VK_VERSION_1_1,VK_KHR_maintenance1)": [ + { + "vuid": "VUID-vkCmdFillBuffer-commandBuffer-00030", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics or compute operations" + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdFillBuffer-commandBuffer-01811", + "text": " If commandBuffer is an unprotected command buffer, then dstBuffer must not be a protected buffer" + }, + { + "vuid": "VUID-vkCmdFillBuffer-commandBuffer-01812", + "text": " If commandBuffer is a protected command buffer, then dstBuffer must not be an unprotected buffer" + } + ] + }, + "vkCmdUpdateBuffer": { + "core": [ + { + "vuid": "VUID-vkCmdUpdateBuffer-dstOffset-00032", + "text": " dstOffset must be less than the size of dstBuffer" + }, + { + "vuid": "VUID-vkCmdUpdateBuffer-dataSize-00033", + "text": " dataSize must be less than or equal to the size of dstBuffer minus dstOffset" + }, + { + "vuid": "VUID-vkCmdUpdateBuffer-dstBuffer-00034", + "text": " dstBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_DST_BIT usage flag" + }, + { + "vuid": "VUID-vkCmdUpdateBuffer-dstBuffer-00035", + "text": " If dstBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdUpdateBuffer-dstOffset-00036", + "text": " dstOffset must be a multiple of 4" + }, + { + "vuid": "VUID-vkCmdUpdateBuffer-dataSize-00037", + "text": " dataSize must be less than or equal to 65536" + }, + { + "vuid": "VUID-vkCmdUpdateBuffer-dataSize-00038", + "text": " dataSize must be a multiple of 4" + }, + { + "vuid": "VUID-vkCmdUpdateBuffer-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdUpdateBuffer-dstBuffer-parameter", + "text": " dstBuffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkCmdUpdateBuffer-pData-parameter", + "text": " pData must be a valid pointer to an array of dataSize bytes" + }, + { + "vuid": "VUID-vkCmdUpdateBuffer-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdUpdateBuffer-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdUpdateBuffer-renderpass", + "text": " This command must only be called outside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdUpdateBuffer-dataSize-arraylength", + "text": " dataSize must be greater than 0" + }, + { + "vuid": "VUID-vkCmdUpdateBuffer-commonparent", + "text": " Both of commandBuffer, and dstBuffer must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdUpdateBuffer-commandBuffer-01813", + "text": " If commandBuffer is an unprotected command buffer, then dstBuffer must not be a protected buffer" + }, + { + "vuid": "VUID-vkCmdUpdateBuffer-commandBuffer-01814", + "text": " If commandBuffer is a protected command buffer, then dstBuffer must not be an unprotected buffer" + } + ] + }, + "vkCmdCopyBuffer": { + "core": [ + { + "vuid": "VUID-vkCmdCopyBuffer-size-00112", + "text": " The size member of each element of pRegions must be greater than 0" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-srcOffset-00113", + "text": " The srcOffset member of each element of pRegions must be less than the size of srcBuffer" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-dstOffset-00114", + "text": " The dstOffset member of each element of pRegions must be less than the size of dstBuffer" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-size-00115", + "text": " The size member of each element of pRegions must be less than or equal to the size of srcBuffer minus srcOffset" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-size-00116", + "text": " The size member of each element of pRegions must be less than or equal to the size of dstBuffer minus dstOffset" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-pRegions-00117", + "text": " The union of the source regions, and the union of the destination regions, specified by the elements of pRegions, must not overlap in memory" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-srcBuffer-00118", + "text": " srcBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_SRC_BIT usage flag" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-srcBuffer-00119", + "text": " If srcBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-dstBuffer-00120", + "text": " dstBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_DST_BIT usage flag" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-dstBuffer-00121", + "text": " If dstBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-srcBuffer-parameter", + "text": " srcBuffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-dstBuffer-parameter", + "text": " dstBuffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-pRegions-parameter", + "text": " pRegions must be a valid pointer to an array of regionCount VkBufferCopy structures" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-renderpass", + "text": " This command must only be called outside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-regionCount-arraylength", + "text": " regionCount must be greater than 0" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-commonparent", + "text": " Each of commandBuffer, dstBuffer, and srcBuffer must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdCopyBuffer-commandBuffer-01822", + "text": " If commandBuffer is an unprotected command buffer, then srcBuffer must not be a protected buffer" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-commandBuffer-01823", + "text": " If commandBuffer is an unprotected command buffer, then dstBuffer must not be a protected buffer" + }, + { + "vuid": "VUID-vkCmdCopyBuffer-commandBuffer-01824", + "text": " If commandBuffer is a protected command buffer, then dstBuffer must not be an unprotected buffer" + } + ] + }, + "vkCmdCopyImage": { + "core": [ + { + "vuid": "VUID-vkCmdCopyImage-pRegions-00122", + "text": " The source region specified by each element of pRegions must be a region that is contained within srcImage" + }, + { + "vuid": "VUID-vkCmdCopyImage-pRegions-00123", + "text": " The destination region specified by each element of pRegions must be a region that is contained within dstImage" + }, + { + "vuid": "VUID-vkCmdCopyImage-pRegions-00124", + "text": " The union of all source regions, and the union of all destination regions, specified by the elements of pRegions, must not overlap in memory" + }, + { + "vuid": "VUID-vkCmdCopyImage-srcImage-00126", + "text": " srcImage must have been created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT usage flag" + }, + { + "vuid": "VUID-vkCmdCopyImage-srcImageLayout-00128", + "text": " srcImageLayout must specify the layout of the image subresources of srcImage specified in pRegions at the time this command is executed on a VkDevice" + }, + { + "vuid": "VUID-vkCmdCopyImage-dstImage-00131", + "text": " dstImage must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag" + }, + { + "vuid": "VUID-vkCmdCopyImage-dstImageLayout-00133", + "text": " dstImageLayout must specify the layout of the image subresources of dstImage specified in pRegions at the time this command is executed on a VkDevice" + }, + { + "vuid": "VUID-vkCmdCopyImage-srcImage-00136", + "text": " The sample count of srcImage and dstImage must match" + }, + { + "vuid": "VUID-vkCmdCopyImage-srcSubresource-01696", + "text": " The srcSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when srcImage was created" + }, + { + "vuid": "VUID-vkCmdCopyImage-dstSubresource-01697", + "text": " The dstSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created" + }, + { + "vuid": "VUID-vkCmdCopyImage-srcSubresource-01698", + "text": " The srcSubresource.baseArrayLayer + srcSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when srcImage was created" + }, + { + "vuid": "VUID-vkCmdCopyImage-dstSubresource-01699", + "text": " The dstSubresource.baseArrayLayer + dstSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created" + }, + { + "vuid": "VUID-vkCmdCopyImage-srcOffset-01783", + "text": " The srcOffset and and extent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer’s command pool’s queue family, as described in VkQueueFamilyProperties" + }, + { + "vuid": "VUID-vkCmdCopyImage-dstOffset-01784", + "text": " The dstOffset and and extent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer’s command pool’s queue family, as described in VkQueueFamilyProperties" + }, + { + "vuid": "VUID-vkCmdCopyImage-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdCopyImage-srcImage-parameter", + "text": " srcImage must be a valid VkImage handle" + }, + { + "vuid": "VUID-vkCmdCopyImage-srcImageLayout-parameter", + "text": " srcImageLayout must be a valid VkImageLayout value" + }, + { + "vuid": "VUID-vkCmdCopyImage-dstImage-parameter", + "text": " dstImage must be a valid VkImage handle" + }, + { + "vuid": "VUID-vkCmdCopyImage-dstImageLayout-parameter", + "text": " dstImageLayout must be a valid VkImageLayout value" + }, + { + "vuid": "VUID-vkCmdCopyImage-pRegions-parameter", + "text": " pRegions must be a valid pointer to an array of regionCount valid VkImageCopy structures" + }, + { + "vuid": "VUID-vkCmdCopyImage-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdCopyImage-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdCopyImage-renderpass", + "text": " This command must only be called outside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdCopyImage-regionCount-arraylength", + "text": " regionCount must be greater than 0" + }, + { + "vuid": "VUID-vkCmdCopyImage-commonparent", + "text": " Each of commandBuffer, dstImage, and srcImage must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1,VK_KHR_maintenance1)": [ + { + "vuid": "VUID-vkCmdCopyImage-srcImage-00125", + "text": " srcImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdCopyImage-dstImage-00130", + "text": " dstImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties" + } + ], + "!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-vkCmdCopyImage-srcImage-00127", + "text": " If srcImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdCopyImage-dstImage-00132", + "text": " If dstImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdCopyImage-srcImage-00135", + "text": " The VkFormat of each of srcImage and dstImage must be compatible, as defined &amp;lt;&amp;lt;copies-images-format-compatibility, below&amp;gt;&amp;gt;" + } + ], + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-vkCmdCopyImage-srcImage-01546", + "text": " If srcImage is non-sparse then the image or disjoint plane to be copied must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdCopyImage-dstImage-01547", + "text": " If dstImage is non-sparse then the image or disjoint plane that is the destination of the copy must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdCopyImage-srcImage-01548", + "text": " If the VkFormat of each of srcImage and dstImage is not a &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion,multi-planar format&amp;gt;&amp;gt;, the VkFormat of each of srcImage and dstImage must be compatible, as defined &amp;lt;&amp;lt;copies-images-format-compatibility, below&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdCopyImage-None-01549", + "text": " In a copy to or from a plane of a &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion,multi-planar image&amp;gt;&amp;gt;, the VkFormat of the image and plane must be compatible according to &amp;lt;&amp;lt;features-formats-compatible-planes,the description of compatible planes&amp;gt;&amp;gt; for the plane being copied" + }, + { + "vuid": "VUID-vkCmdCopyImage-aspectMask-01550", + "text": " When a copy is performed to or from an image with a &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion,multi-planar format&amp;gt;&amp;gt;, the aspectMask of the srcSubresource and/or dstSubresource that refers to the multi-planar image must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT (with VK_IMAGE_ASPECT_PLANE_2_BIT valid only for a VkFormat with three planes)" + } + ], + "!(VK_KHR_shared_presentable_image)": [ + { + "vuid": "VUID-vkCmdCopyImage-srcImageLayout-00129", + "text": " srcImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL" + }, + { + "vuid": "VUID-vkCmdCopyImage-dstImageLayout-00134", + "text": " dstImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL" + } + ], + "(VK_KHR_shared_presentable_image)": [ + { + "vuid": "VUID-vkCmdCopyImage-srcImageLayout-01917", + "text": " srcImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR" + }, + { + "vuid": "VUID-vkCmdCopyImage-dstImageLayout-01395", + "text": " dstImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR" + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdCopyImage-commandBuffer-01825", + "text": " If commandBuffer is an unprotected command buffer, then srcImage must not be a protected image" + }, + { + "vuid": "VUID-vkCmdCopyImage-commandBuffer-01826", + "text": " If commandBuffer is an unprotected command buffer, then dstImage must not be a protected image" + }, + { + "vuid": "VUID-vkCmdCopyImage-commandBuffer-01827", + "text": " If commandBuffer is a protected command buffer, then dstImage must not be an unprotected image" + } + ] + }, + "VkImageCopy": { + "!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkImageCopy-aspectMask-00137", + "text": " The aspectMask member of srcSubresource and dstSubresource must match" + }, + { + "vuid": "VUID-VkImageCopy-srcOffset-00157", + "text": " If the calling command’s srcImage is a compressed image, all members of srcOffset must be a multiple of the corresponding dimensions of the compressed texel block" + }, + { + "vuid": "VUID-VkImageCopy-extent-00158", + "text": " If the calling command’s srcImage is a compressed image, extent.width must be a multiple of the compressed texel block width or (extent.width + srcOffset.x) must equal the source image subresource width" + }, + { + "vuid": "VUID-VkImageCopy-extent-00159", + "text": " If the calling command’s srcImage is a compressed image, extent.height must be a multiple of the compressed texel block height or (extent.height + srcOffset.y) must equal the source image subresource height" + }, + { + "vuid": "VUID-VkImageCopy-extent-00160", + "text": " If the calling command’s srcImage is a compressed image, extent.depth must be a multiple of the compressed texel block depth or (extent.depth + srcOffset.z) must equal the source image subresource depth" + }, + { + "vuid": "VUID-VkImageCopy-dstOffset-00162", + "text": " If the calling command’s dstImage is a compressed format image, all members of dstOffset must be a multiple of the corresponding dimensions of the compressed texel block" + }, + { + "vuid": "VUID-VkImageCopy-extent-00163", + "text": " If the calling command’s dstImage is a compressed format image, extent.width must be a multiple of the compressed texel block width or (extent.width + dstOffset.x) must equal the destination image subresource width" + }, + { + "vuid": "VUID-VkImageCopy-extent-00164", + "text": " If the calling command’s dstImage is a compressed format image, extent.height must be a multiple of the compressed texel block height or (extent.height + dstOffset.y) must equal the destination image subresource height" + }, + { + "vuid": "VUID-VkImageCopy-extent-00165", + "text": " If the calling command’s dstImage is a compressed format image, extent.depth must be a multiple of the compressed texel block depth or (extent.depth + dstOffset.z) must equal the destination image subresource depth" + } + ], + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkImageCopy-srcImage-01551", + "text": " If neither the calling command’s srcImage nor the calling command’s dstImage has a &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion, multi-planar image format&amp;gt;&amp;gt; then the aspectMask member of srcSubresource and dstSubresource must match" + }, + { + "vuid": "VUID-VkImageCopy-srcImage-01552", + "text": " If the calling command’s srcImage has a VkFormat with &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion,two planes&amp;gt;&amp;gt; then the srcSubresource aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT or VK_IMAGE_ASPECT_PLANE_1_BIT" + }, + { + "vuid": "VUID-VkImageCopy-srcImage-01553", + "text": " If the calling command’s srcImage has a VkFormat with &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion,three planes&amp;gt;&amp;gt; then the srcSubresource aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT" + }, + { + "vuid": "VUID-VkImageCopy-dstImage-01554", + "text": " If the calling command’s dstImage has a VkFormat with &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion,two planes&amp;gt;&amp;gt; then the dstSubresource aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT or VK_IMAGE_ASPECT_PLANE_1_BIT" + }, + { + "vuid": "VUID-VkImageCopy-dstImage-01555", + "text": " If the calling command’s dstImage has a VkFormat with &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion,three planes&amp;gt;&amp;gt; then the dstSubresource aspectMask must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT" + }, + { + "vuid": "VUID-VkImageCopy-srcImage-01556", + "text": " If the calling command’s srcImage has a &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion,multi-planar image format&amp;gt;&amp;gt; and the dstImage does not have a multi-planar image format, the dstSubresource aspectMask must be VK_IMAGE_ASPECT_COLOR_BIT" + }, + { + "vuid": "VUID-VkImageCopy-dstImage-01557", + "text": " If the calling command’s dstImage has a &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion,multi-planar image format&amp;gt;&amp;gt; and the srcImage does not have a multi-planar image format, the srcSubresource aspectMask must be VK_IMAGE_ASPECT_COLOR_BIT" + }, + { + "vuid": "VUID-VkImageCopy-srcImage-01727", + "text": " If the calling command’s srcImage is a compressed image, or a single-plane, “_422” image format, all members of srcOffset must be a multiple of the corresponding dimensions of the compressed texel block" + }, + { + "vuid": "VUID-VkImageCopy-srcImage-01728", + "text": " If the calling command’s srcImage is a compressed image, or a single-plane, “_422” image format, extent.width must be a multiple of the compressed texel block width or (extent.width + srcOffset.x) must equal the source image subresource width" + }, + { + "vuid": "VUID-VkImageCopy-srcImage-01729", + "text": " If the calling command’s srcImage is a compressed image, or a single-plane, “_422” image format, extent.height must be a multiple of the compressed texel block height or (extent.height + srcOffset.y) must equal the source image subresource height" + }, + { + "vuid": "VUID-VkImageCopy-srcImage-01730", + "text": " If the calling command’s srcImage is a compressed image, or a single-plane, “_422” image format, extent.depth must be a multiple of the compressed texel block depth or (extent.depth + srcOffset.z) must equal the source image subresource depth" + }, + { + "vuid": "VUID-VkImageCopy-dstImage-01731", + "text": " If the calling command’s dstImage is a compressed format image, or a single-plane, “_422” image format, all members of dstOffset must be a multiple of the corresponding dimensions of the compressed texel block" + }, + { + "vuid": "VUID-VkImageCopy-dstImage-01732", + "text": " If the calling command’s dstImage is a compressed format image, or a single-plane, “_422” image format, extent.width must be a multiple of the compressed texel block width or (extent.width + dstOffset.x) must equal the destination image subresource width" + }, + { + "vuid": "VUID-VkImageCopy-dstImage-01733", + "text": " If the calling command’s dstImage is a compressed format image, or a single-plane, “_422” image format, extent.height must be a multiple of the compressed texel block height or (extent.height + dstOffset.y) must equal the destination image subresource height" + }, + { + "vuid": "VUID-VkImageCopy-dstImage-01734", + "text": " If the calling command’s dstImage is a compressed format image, or a single-plane, “_422” image format, extent.depth must be a multiple of the compressed texel block depth or (extent.depth + dstOffset.z) must equal the destination image subresource depth" + } + ], + "!(VK_VERSION_1_1,VK_KHR_maintenance1)": [ + { + "vuid": "VUID-VkImageCopy-layerCount-00138", + "text": " The layerCount member of srcSubresource and dstSubresource must match" + }, + { + "vuid": "VUID-VkImageCopy-srcImage-00139", + "text": " If either of the calling command’s srcImage or dstImage parameters are of VkImageType VK_IMAGE_TYPE_3D, the baseArrayLayer and layerCount members of both srcSubresource and dstSubresource must be 0 and 1, respectively" + }, + { + "vuid": "VUID-VkImageCopy-srcImage-01789", + "text": " If the calling command’s srcImage or dstImage is of type VK_IMAGE_TYPE_2D, then extent.depth must be 1." + } + ], + "(VK_VERSION_1_1,VK_KHR_maintenance1)": [ + { + "vuid": "VUID-VkImageCopy-extent-00140", + "text": " The number of slices of the extent (for 3D) or layers of the srcSubresource (for non-3D) must match the number of slices of the extent (for 3D) or layers of the dstSubresource (for non-3D)" + }, + { + "vuid": "VUID-VkImageCopy-srcImage-00141", + "text": " If either of the calling command’s srcImage or dstImage parameters are of VkImageType VK_IMAGE_TYPE_3D, the baseArrayLayer and layerCount members of the corresponding subresource must be 0 and 1, respectively" + }, + { + "vuid": "VUID-VkImageCopy-srcImage-01790", + "text": " If both srcImage and dstImage are of type VK_IMAGE_TYPE_2D then then extent.depth must be 1." + }, + { + "vuid": "VUID-VkImageCopy-srcImage-01791", + "text": " If the calling command’s srcImage is of type VK_IMAGE_TYPE_2D, and the dstImage is of type VK_IMAGE_TYPE_3D, then extent.depth must equal to the layerCount member of srcSubresource." + }, + { + "vuid": "VUID-VkImageCopy-dstImage-01792", + "text": " If the calling command’s dstImage is of type VK_IMAGE_TYPE_2D, and the srcImage is of type VK_IMAGE_TYPE_3D, then extent.depth must equal to the layerCount member of dstSubresource." + } + ], + "core": [ + { + "vuid": "VUID-VkImageCopy-aspectMask-00142", + "text": " The aspectMask member of srcSubresource must specify aspects present in the calling command’s srcImage" + }, + { + "vuid": "VUID-VkImageCopy-aspectMask-00143", + "text": " The aspectMask member of dstSubresource must specify aspects present in the calling command’s dstImage" + }, + { + "vuid": "VUID-VkImageCopy-srcOffset-00144", + "text": " srcOffset.x and (extent.width + srcOffset.x) must both be greater than or equal to 0 and less than or equal to the source image subresource width" + }, + { + "vuid": "VUID-VkImageCopy-srcOffset-00145", + "text": " srcOffset.y and (extent.height + srcOffset.y) must both be greater than or equal to 0 and less than or equal to the source image subresource height" + }, + { + "vuid": "VUID-VkImageCopy-srcImage-00146", + "text": " If the calling command’s srcImage is of type VK_IMAGE_TYPE_1D, then srcOffset.y must be 0 and extent.height must be 1." + }, + { + "vuid": "VUID-VkImageCopy-srcOffset-00147", + "text": " srcOffset.z and (extent.depth + srcOffset.z) must both be greater than or equal to 0 and less than or equal to the source image subresource depth" + }, + { + "vuid": "VUID-VkImageCopy-srcImage-01785", + "text": " If the calling command’s srcImage is of type VK_IMAGE_TYPE_1D, then srcOffset.z must be 0 and extent.depth must be 1." + }, + { + "vuid": "VUID-VkImageCopy-dstImage-01786", + "text": " If the calling command’s dstImage is of type VK_IMAGE_TYPE_1D, then dstOffset.z must be 0 and extent.depth must be 1." + }, + { + "vuid": "VUID-VkImageCopy-srcImage-01787", + "text": " If the calling command’s srcImage is of type VK_IMAGE_TYPE_2D, then srcOffset.z must be 0." + }, + { + "vuid": "VUID-VkImageCopy-dstImage-01788", + "text": " If the calling command’s dstImage is of type VK_IMAGE_TYPE_2D, then dstOffset.z must be 0." + }, + { + "vuid": "VUID-VkImageCopy-dstOffset-00150", + "text": " dstOffset.x and (extent.width + dstOffset.x) must both be greater than or equal to 0 and less than or equal to the destination image subresource width" + }, + { + "vuid": "VUID-VkImageCopy-dstOffset-00151", + "text": " dstOffset.y and (extent.height + dstOffset.y) must both be greater than or equal to 0 and less than or equal to the destination image subresource height" + }, + { + "vuid": "VUID-VkImageCopy-dstImage-00152", + "text": " If the calling command’s dstImage is of type VK_IMAGE_TYPE_1D, then dstOffset.y must be 0 and extent.height must be 1." + }, + { + "vuid": "VUID-VkImageCopy-dstOffset-00153", + "text": " dstOffset.z and (extent.depth + dstOffset.z) must both be greater than or equal to 0 and less than or equal to the destination image subresource depth" + }, + { + "vuid": "VUID-VkImageCopy-srcSubresource-parameter", + "text": " srcSubresource must be a valid VkImageSubresourceLayers structure" + }, + { + "vuid": "VUID-VkImageCopy-dstSubresource-parameter", + "text": " dstSubresource must be a valid VkImageSubresourceLayers structure" + } + ] + }, + "VkImageSubresourceLayers": { + "core": [ + { + "vuid": "VUID-VkImageSubresourceLayers-aspectMask-00167", + "text": " If aspectMask contains VK_IMAGE_ASPECT_COLOR_BIT, it must not contain either of VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT" + }, + { + "vuid": "VUID-VkImageSubresourceLayers-aspectMask-00168", + "text": " aspectMask must not contain VK_IMAGE_ASPECT_METADATA_BIT" + }, + { + "vuid": "VUID-VkImageSubresourceLayers-layerCount-01700", + "text": " layerCount must be greater than 0" + }, + { + "vuid": "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "text": " aspectMask must be a valid combination of VkImageAspectFlagBits values" + }, + { + "vuid": "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask", + "text": " aspectMask must not be 0" + } + ] + }, + "vkCmdCopyBufferToImage": { + "core": [ + { + "vuid": "VUID-vkCmdCopyBufferToImage-pRegions-00171", + "text": " The buffer region specified by each element of pRegions must be a region that is contained within srcBuffer" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-pRegions-00172", + "text": " The image region specified by each element of pRegions must be a region that is contained within dstImage" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-pRegions-00173", + "text": " The union of all source regions, and the union of all destination regions, specified by the elements of pRegions, must not overlap in memory" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-srcBuffer-00174", + "text": " srcBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_SRC_BIT usage flag" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-srcBuffer-00176", + "text": " If srcBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-dstImage-00177", + "text": " dstImage must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-dstImage-00178", + "text": " If dstImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-dstImage-00179", + "text": " dstImage must have a sample count equal to VK_SAMPLE_COUNT_1_BIT" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-dstImageLayout-00180", + "text": " dstImageLayout must specify the layout of the image subresources of dstImage specified in pRegions at the time this command is executed on a VkDevice" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-imageSubresource-01701", + "text": " The imageSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-imageSubresource-01702", + "text": " The imageSubresource.baseArrayLayer + imageSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-imageOffset-01793", + "text": " The imageOffset and and imageExtent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer’s command pool’s queue family, as described in VkQueueFamilyProperties" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-srcBuffer-parameter", + "text": " srcBuffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-dstImage-parameter", + "text": " dstImage must be a valid VkImage handle" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-dstImageLayout-parameter", + "text": " dstImageLayout must be a valid VkImageLayout value" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-pRegions-parameter", + "text": " pRegions must be a valid pointer to an array of regionCount valid VkBufferImageCopy structures" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-renderpass", + "text": " This command must only be called outside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-regionCount-arraylength", + "text": " regionCount must be greater than 0" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-commonparent", + "text": " Each of commandBuffer, dstImage, and srcBuffer must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1,VK_KHR_maintenance1)": [ + { + "vuid": "VUID-vkCmdCopyBufferToImage-dstImage-00175", + "text": " dstImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_DST_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties" + } + ], + "!(VK_KHR_shared_presentable_image)": [ + { + "vuid": "VUID-vkCmdCopyBufferToImage-dstImageLayout-00181", + "text": " dstImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL" + } + ], + "(VK_KHR_shared_presentable_image)": [ + { + "vuid": "VUID-vkCmdCopyBufferToImage-dstImageLayout-01396", + "text": " dstImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR" + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdCopyBufferToImage-commandBuffer-01828", + "text": " If commandBuffer is an unprotected command buffer, then srcBuffer must not be a protected buffer" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-commandBuffer-01829", + "text": " If commandBuffer is an unprotected command buffer, then dstImage must not be a protected image" + }, + { + "vuid": "VUID-vkCmdCopyBufferToImage-commandBuffer-01830", + "text": " If commandBuffer is a protected command buffer, then dstImage must not be an unprotected image" + } + ] + }, + "vkCmdCopyImageToBuffer": { + "core": [ + { + "vuid": "VUID-vkCmdCopyImageToBuffer-pRegions-00182", + "text": " The image region specified by each element of pRegions must be a region that is contained within srcImage" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-pRegions-00183", + "text": " The buffer region specified by each element of pRegions must be a region that is contained within dstBuffer" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-pRegions-00184", + "text": " The union of all source regions, and the union of all destination regions, specified by the elements of pRegions, must not overlap in memory" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-srcImage-00186", + "text": " srcImage must have been created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT usage flag" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-srcImage-00187", + "text": " If srcImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-srcImage-00188", + "text": " srcImage must have a sample count equal to VK_SAMPLE_COUNT_1_BIT" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-srcImageLayout-00189", + "text": " srcImageLayout must specify the layout of the image subresources of srcImage specified in pRegions at the time this command is executed on a VkDevice" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-dstBuffer-00191", + "text": " dstBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_DST_BIT usage flag" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-dstBuffer-00192", + "text": " If dstBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-imageSubresource-01703", + "text": " The imageSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when srcImage was created" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-imageSubresource-01704", + "text": " The imageSubresource.baseArrayLayer + imageSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when srcImage was created" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-imageOffset-01794", + "text": " The imageOffset and and imageExtent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer’s command pool’s queue family, as described in VkQueueFamilyProperties" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-srcImage-parameter", + "text": " srcImage must be a valid VkImage handle" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-srcImageLayout-parameter", + "text": " srcImageLayout must be a valid VkImageLayout value" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-dstBuffer-parameter", + "text": " dstBuffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-pRegions-parameter", + "text": " pRegions must be a valid pointer to an array of regionCount valid VkBufferImageCopy structures" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-renderpass", + "text": " This command must only be called outside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-regionCount-arraylength", + "text": " regionCount must be greater than 0" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-commonparent", + "text": " Each of commandBuffer, dstBuffer, and srcImage must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1,VK_KHR_maintenance1)": [ + { + "vuid": "VUID-vkCmdCopyImageToBuffer-srcImage-00185", + "text": " srcImage must use a format that supports VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties" + } + ], + "!(VK_KHR_shared_presentable_image)": [ + { + "vuid": "VUID-vkCmdCopyImageToBuffer-srcImageLayout-00190", + "text": " srcImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL" + } + ], + "(VK_KHR_shared_presentable_image)": [ + { + "vuid": "VUID-vkCmdCopyImageToBuffer-srcImageLayout-01397", + "text": " srcImageLayout must be VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL" + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdCopyImageToBuffer-commandBuffer-01831", + "text": " If commandBuffer is an unprotected command buffer, then srcImage must not be a protected image" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-commandBuffer-01832", + "text": " If commandBuffer is an unprotected command buffer, then dstBuffer must not be a protected buffer" + }, + { + "vuid": "VUID-vkCmdCopyImageToBuffer-commandBuffer-01833", + "text": " If commandBuffer is a protected command buffer, then dstBuffer must not be an unprotected buffer" + } + ] + }, + "VkBufferImageCopy": { + "!(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkBufferImageCopy-bufferOffset-00193", + "text": " If the calling command’s VkImage parameter’s format is not a depth/stencil format, then bufferOffset must be a multiple of the format’s element size" + }, + { + "vuid": "VUID-VkBufferImageCopy-bufferRowLength-00203", + "text": " If the calling command’s VkImage parameter is a compressed image, bufferRowLength must be a multiple of the compressed texel block width" + }, + { + "vuid": "VUID-VkBufferImageCopy-bufferImageHeight-00204", + "text": " If the calling command’s VkImage parameter is a compressed image, bufferImageHeight must be a multiple of the compressed texel block height" + }, + { + "vuid": "VUID-VkBufferImageCopy-imageOffset-00205", + "text": " If the calling command’s VkImage parameter is a compressed image, all members of imageOffset must be a multiple of the corresponding dimensions of the compressed texel block" + }, + { + "vuid": "VUID-VkBufferImageCopy-bufferOffset-00206", + "text": " If the calling command’s VkImage parameter is a compressed image, bufferOffset must be a multiple of the compressed texel block size in bytes" + }, + { + "vuid": "VUID-VkBufferImageCopy-imageExtent-00207", + "text": " If the calling command’s VkImage parameter is a compressed image, imageExtent.width must be a multiple of the compressed texel block width or (imageExtent.width + imageOffset.x) must equal the image subresource width" + }, + { + "vuid": "VUID-VkBufferImageCopy-imageExtent-00208", + "text": " If the calling command’s VkImage parameter is a compressed image, imageExtent.height must be a multiple of the compressed texel block height or (imageExtent.height + imageOffset.y) must equal the image subresource height" + }, + { + "vuid": "VUID-VkBufferImageCopy-imageExtent-00209", + "text": " If the calling command’s VkImage parameter is a compressed image, imageExtent.depth must be a multiple of the compressed texel block depth or (imageExtent.depth + imageOffset.z) must equal the image subresource depth" + } + ], + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkBufferImageCopy-bufferOffset-01558", + "text": " If the calling command’s VkImage parameter’s format is not a depth/stencil format or a &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion,multi-planar format&amp;gt;&amp;gt;, then bufferOffset must be a multiple of the format’s element size" + }, + { + "vuid": "VUID-VkBufferImageCopy-bufferOffset-01559", + "text": " If the calling command’s VkImage parameter’s format is a &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion,multi-planar format&amp;gt;&amp;gt;, then bufferOffset must be a multiple of the element size of the compatible format for the format and the aspectMask of the imageSubresource as defined in &amp;lt;&amp;lt;features-formats-compatible-planes&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-VkBufferImageCopy-None-01735", + "text": " If the calling command’s VkImage parameter is a compressed image, or a single-plane, “_422” image format, bufferRowLength must be a multiple of the compressed texel block width" + }, + { + "vuid": "VUID-VkBufferImageCopy-None-01736", + "text": " If the calling command’s VkImage parameter is a compressed image, or a single-plane, “_422” image format, bufferImageHeight must be a multiple of the compressed texel block height" + }, + { + "vuid": "VUID-VkBufferImageCopy-None-01737", + "text": " If the calling command’s VkImage parameter is a compressed image, or a single-plane, “_422” image format, all members of imageOffset must be a multiple of the corresponding dimensions of the compressed texel block" + }, + { + "vuid": "VUID-VkBufferImageCopy-None-01738", + "text": " If the calling command’s VkImage parameter is a compressed image, or a single-plane, “_422” image format, bufferOffset must be a multiple of the compressed texel block size in bytes" + }, + { + "vuid": "VUID-VkBufferImageCopy-None-01739", + "text": " If the calling command’s VkImage parameter is a compressed image, or a single-plane, “_422” image format, imageExtent.width must be a multiple of the compressed texel block width or (imageExtent.width + imageOffset.x) must equal the image subresource width" + }, + { + "vuid": "VUID-VkBufferImageCopy-None-01740", + "text": " If the calling command’s VkImage parameter is a compressed image, or a single-plane, “_422” image format, imageExtent.height must be a multiple of the compressed texel block height or (imageExtent.height + imageOffset.y) must equal the image subresource height" + }, + { + "vuid": "VUID-VkBufferImageCopy-None-01741", + "text": " If the calling command’s VkImage parameter is a compressed image, or a single-plane, “_422” image format, imageExtent.depth must be a multiple of the compressed texel block depth or (imageExtent.depth + imageOffset.z) must equal the image subresource depth" + }, + { + "vuid": "VUID-VkBufferImageCopy-aspectMask-01560", + "text": " If the calling command’s VkImage parameter’s format is a &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion,multi-planar format&amp;gt;&amp;gt;, then the aspectMask member of imageSubresource must be VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, or VK_IMAGE_ASPECT_PLANE_2_BIT (with VK_IMAGE_ASPECT_PLANE_2_BIT valid only for image formats with three planes)" + } + ], + "core": [ + { + "vuid": "VUID-VkBufferImageCopy-bufferOffset-00194", + "text": " bufferOffset must be a multiple of 4" + }, + { + "vuid": "VUID-VkBufferImageCopy-bufferRowLength-00195", + "text": " bufferRowLength must be 0, or greater than or equal to the width member of imageExtent" + }, + { + "vuid": "VUID-VkBufferImageCopy-bufferImageHeight-00196", + "text": " bufferImageHeight must be 0, or greater than or equal to the height member of imageExtent" + }, + { + "vuid": "VUID-VkBufferImageCopy-imageOffset-00197", + "text": " imageOffset.x and (imageExtent.width + imageOffset.x) must both be greater than or equal to 0 and less than or equal to the image subresource width" + }, + { + "vuid": "VUID-VkBufferImageCopy-imageOffset-00198", + "text": " imageOffset.y and (imageExtent.height + imageOffset.y) must both be greater than or equal to 0 and less than or equal to the image subresource height" + }, + { + "vuid": "VUID-VkBufferImageCopy-srcImage-00199", + "text": " If the calling command’s srcImage (vkCmdCopyImageToBuffer) or dstImage (vkCmdCopyBufferToImage) is of type VK_IMAGE_TYPE_1D, then imageOffset.y must be 0 and imageExtent.height must be 1." + }, + { + "vuid": "VUID-VkBufferImageCopy-imageOffset-00200", + "text": " imageOffset.z and (imageExtent.depth + imageOffset.z) must both be greater than or equal to 0 and less than or equal to the image subresource depth" + }, + { + "vuid": "VUID-VkBufferImageCopy-srcImage-00201", + "text": " If the calling command’s srcImage (vkCmdCopyImageToBuffer) or dstImage (vkCmdCopyBufferToImage) is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then imageOffset.z must be 0 and imageExtent.depth must be 1" + }, + { + "vuid": "VUID-VkBufferImageCopy-aspectMask-00211", + "text": " The aspectMask member of imageSubresource must specify aspects present in the calling command’s VkImage parameter" + }, + { + "vuid": "VUID-VkBufferImageCopy-aspectMask-00212", + "text": " The aspectMask member of imageSubresource must only have a single bit set" + }, + { + "vuid": "VUID-VkBufferImageCopy-baseArrayLayer-00213", + "text": " If the calling command’s VkImage parameter is of VkImageType VK_IMAGE_TYPE_3D, the baseArrayLayer and layerCount members of imageSubresource must be 0 and 1, respectively" + }, + { + "vuid": "VUID-VkBufferImageCopy-None-00214", + "text": " When copying to the depth aspect of an image subresource, the data in the source buffer must be in the range [0,1]" + }, + { + "vuid": "VUID-VkBufferImageCopy-imageSubresource-parameter", + "text": " imageSubresource must be a valid VkImageSubresourceLayers structure" + } + ] + }, + "vkCmdBlitImage": { + "core": [ + { + "vuid": "VUID-vkCmdBlitImage-pRegions-00215", + "text": " The source region specified by each element of pRegions must be a region that is contained within srcImage" + }, + { + "vuid": "VUID-vkCmdBlitImage-pRegions-00216", + "text": " The destination region specified by each element of pRegions must be a region that is contained within dstImage" + }, + { + "vuid": "VUID-vkCmdBlitImage-pRegions-00217", + "text": " The union of all destination regions, specified by the elements of pRegions, must not overlap in memory with any texel that may be sampled during the blit operation" + }, + { + "vuid": "VUID-vkCmdBlitImage-srcImage-00218", + "text": " srcImage must use a format that supports VK_FORMAT_FEATURE_BLIT_SRC_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdBlitImage-srcImage-00219", + "text": " srcImage must have been created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT usage flag" + }, + { + "vuid": "VUID-vkCmdBlitImage-srcImage-00220", + "text": " If srcImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdBlitImage-srcImageLayout-00221", + "text": " srcImageLayout must specify the layout of the image subresources of srcImage specified in pRegions at the time this command is executed on a VkDevice" + }, + { + "vuid": "VUID-vkCmdBlitImage-dstImage-00223", + "text": " dstImage must use a format that supports VK_FORMAT_FEATURE_BLIT_DST_BIT, which is indicated by VkFormatProperties::linearTilingFeatures (for linearly tiled images) or VkFormatProperties::optimalTilingFeatures (for optimally tiled images) - as returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdBlitImage-dstImage-00224", + "text": " dstImage must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag" + }, + { + "vuid": "VUID-vkCmdBlitImage-dstImage-00225", + "text": " If dstImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdBlitImage-dstImageLayout-00226", + "text": " dstImageLayout must specify the layout of the image subresources of dstImage specified in pRegions at the time this command is executed on a VkDevice" + }, + { + "vuid": "VUID-vkCmdBlitImage-srcImage-00228", + "text": " The sample count of srcImage and dstImage must both be equal to VK_SAMPLE_COUNT_1_BIT" + }, + { + "vuid": "VUID-vkCmdBlitImage-srcImage-00229", + "text": " If either of srcImage or dstImage was created with a signed integer VkFormat, the other must also have been created with a signed integer VkFormat" + }, + { + "vuid": "VUID-vkCmdBlitImage-srcImage-00230", + "text": " If either of srcImage or dstImage was created with an unsigned integer VkFormat, the other must also have been created with an unsigned integer VkFormat" + }, + { + "vuid": "VUID-vkCmdBlitImage-srcImage-00231", + "text": " If either of srcImage or dstImage was created with a depth/stencil format, the other must have exactly the same format" + }, + { + "vuid": "VUID-vkCmdBlitImage-srcImage-00232", + "text": " If srcImage was created with a depth/stencil format, filter must be VK_FILTER_NEAREST" + }, + { + "vuid": "VUID-vkCmdBlitImage-srcImage-00233", + "text": " srcImage must have been created with a samples value of VK_SAMPLE_COUNT_1_BIT" + }, + { + "vuid": "VUID-vkCmdBlitImage-dstImage-00234", + "text": " dstImage must have been created with a samples value of VK_SAMPLE_COUNT_1_BIT" + }, + { + "vuid": "VUID-vkCmdBlitImage-filter-00235", + "text": " If filter is VK_FILTER_LINEAR, srcImage must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdBlitImage-srcSubresource-01705", + "text": " The srcSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when srcImage was created" + }, + { + "vuid": "VUID-vkCmdBlitImage-dstSubresource-01706", + "text": " The dstSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created" + }, + { + "vuid": "VUID-vkCmdBlitImage-srcSubresource-01707", + "text": " The srcSubresource.baseArrayLayer + srcSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when srcImage was created" + }, + { + "vuid": "VUID-vkCmdBlitImage-dstSubresource-01708", + "text": " The dstSubresource.baseArrayLayer + dstSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created" + }, + { + "vuid": "VUID-vkCmdBlitImage-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdBlitImage-srcImage-parameter", + "text": " srcImage must be a valid VkImage handle" + }, + { + "vuid": "VUID-vkCmdBlitImage-srcImageLayout-parameter", + "text": " srcImageLayout must be a valid VkImageLayout value" + }, + { + "vuid": "VUID-vkCmdBlitImage-dstImage-parameter", + "text": " dstImage must be a valid VkImage handle" + }, + { + "vuid": "VUID-vkCmdBlitImage-dstImageLayout-parameter", + "text": " dstImageLayout must be a valid VkImageLayout value" + }, + { + "vuid": "VUID-vkCmdBlitImage-pRegions-parameter", + "text": " pRegions must be a valid pointer to an array of regionCount valid VkImageBlit structures" + }, + { + "vuid": "VUID-vkCmdBlitImage-filter-parameter", + "text": " filter must be a valid VkFilter value" + }, + { + "vuid": "VUID-vkCmdBlitImage-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdBlitImage-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdBlitImage-renderpass", + "text": " This command must only be called outside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdBlitImage-regionCount-arraylength", + "text": " regionCount must be greater than 0" + }, + { + "vuid": "VUID-vkCmdBlitImage-commonparent", + "text": " Each of commandBuffer, dstImage, and srcImage must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-vkCmdBlitImage-srcImage-01561", + "text": " srcImage must not use a format listed in &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdBlitImage-dstImage-01562", + "text": " dstImage must not use a format listed in &amp;lt;&amp;lt;features-formats-requiring-sampler-ycbcr-conversion&amp;gt;&amp;gt;" + } + ], + "!(VK_KHR_shared_presentable_image)": [ + { + "vuid": "VUID-vkCmdBlitImage-srcImageLayout-00222", + "text": " srcImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL" + }, + { + "vuid": "VUID-vkCmdBlitImage-dstImageLayout-00227", + "text": " dstImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL" + } + ], + "(VK_KHR_shared_presentable_image)": [ + { + "vuid": "VUID-vkCmdBlitImage-srcImageLayout-01398", + "text": " srcImageLayout must be VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL" + }, + { + "vuid": "VUID-vkCmdBlitImage-dstImageLayout-01399", + "text": " dstImageLayout must be VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL" + } + ], + "(VK_IMG_filter_cubic)": [ + { + "vuid": "VUID-vkCmdBlitImage-filter-00236", + "text": " If filter is VK_FILTER_CUBIC_IMG, srcImage must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdBlitImage-filter-00237", + "text": " If filter is VK_FILTER_CUBIC_IMG, srcImage must have a VkImageType of VK_IMAGE_TYPE_3D" + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdBlitImage-commandBuffer-01834", + "text": " If commandBuffer is an unprotected command buffer, then srcImage must not be a protected image" + }, + { + "vuid": "VUID-vkCmdBlitImage-commandBuffer-01835", + "text": " If commandBuffer is an unprotected command buffer, then dstImage must not be a protected image" + }, + { + "vuid": "VUID-vkCmdBlitImage-commandBuffer-01836", + "text": " If commandBuffer is a protected command buffer, then dstImage must not be an unprotected image" + } + ] + }, + "VkImageBlit": { + "core": [ + { + "vuid": "VUID-VkImageBlit-aspectMask-00238", + "text": " The aspectMask member of srcSubresource and dstSubresource must match" + }, + { + "vuid": "VUID-VkImageBlit-layerCount-00239", + "text": " The layerCount member of srcSubresource and dstSubresource must match" + }, + { + "vuid": "VUID-VkImageBlit-srcImage-00240", + "text": " If either of the calling command’s srcImage or dstImage parameters are of VkImageType VK_IMAGE_TYPE_3D, the baseArrayLayer and layerCount members of both srcSubresource and dstSubresource must be 0 and 1, respectively" + }, + { + "vuid": "VUID-VkImageBlit-aspectMask-00241", + "text": " The aspectMask member of srcSubresource must specify aspects present in the calling command’s srcImage" + }, + { + "vuid": "VUID-VkImageBlit-aspectMask-00242", + "text": " The aspectMask member of dstSubresource must specify aspects present in the calling command’s dstImage" + }, + { + "vuid": "VUID-VkImageBlit-srcOffset-00243", + "text": " srcOffset[0].x and srcOffset[1].x must both be greater than or equal to 0 and less than or equal to the source image subresource width" + }, + { + "vuid": "VUID-VkImageBlit-srcOffset-00244", + "text": " srcOffset[0].y and srcOffset[1].y must both be greater than or equal to 0 and less than or equal to the source image subresource height" + }, + { + "vuid": "VUID-VkImageBlit-srcImage-00245", + "text": " If the calling command’s srcImage is of type VK_IMAGE_TYPE_1D, then srcOffset[0].y must be 0 and srcOffset[1].y must be 1." + }, + { + "vuid": "VUID-VkImageBlit-srcOffset-00246", + "text": " srcOffset[0].z and srcOffset[1].z must both be greater than or equal to 0 and less than or equal to the source image subresource depth" + }, + { + "vuid": "VUID-VkImageBlit-srcImage-00247", + "text": " If the calling command’s srcImage is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then srcOffset[0].z must be 0 and srcOffset[1].z must be 1." + }, + { + "vuid": "VUID-VkImageBlit-dstOffset-00248", + "text": " dstOffset[0].x and dstOffset[1].x must both be greater than or equal to 0 and less than or equal to the destination image subresource width" + }, + { + "vuid": "VUID-VkImageBlit-dstOffset-00249", + "text": " dstOffset[0].y and dstOffset[1].y must both be greater than or equal to 0 and less than or equal to the destination image subresource height" + }, + { + "vuid": "VUID-VkImageBlit-dstImage-00250", + "text": " If the calling command’s dstImage is of type VK_IMAGE_TYPE_1D, then dstOffset[0].y must be 0 and dstOffset[1].y must be 1." + }, + { + "vuid": "VUID-VkImageBlit-dstOffset-00251", + "text": " dstOffset[0].z and dstOffset[1].z must both be greater than or equal to 0 and less than or equal to the destination image subresource depth" + }, + { + "vuid": "VUID-VkImageBlit-dstImage-00252", + "text": " If the calling command’s dstImage is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then dstOffset[0].z must be 0 and dstOffset[1].z must be 1." + }, + { + "vuid": "VUID-VkImageBlit-srcSubresource-parameter", + "text": " srcSubresource must be a valid VkImageSubresourceLayers structure" + }, + { + "vuid": "VUID-VkImageBlit-dstSubresource-parameter", + "text": " dstSubresource must be a valid VkImageSubresourceLayers structure" + } + ] + }, + "vkCmdResolveImage": { + "core": [ + { + "vuid": "VUID-vkCmdResolveImage-pRegions-00253", + "text": " The source region specified by each element of pRegions must be a region that is contained within srcImage" + }, + { + "vuid": "VUID-vkCmdResolveImage-pRegions-00254", + "text": " The destination region specified by each element of pRegions must be a region that is contained within dstImage" + }, + { + "vuid": "VUID-vkCmdResolveImage-pRegions-00255", + "text": " The union of all source regions, and the union of all destination regions, specified by the elements of pRegions, must not overlap in memory" + }, + { + "vuid": "VUID-vkCmdResolveImage-srcImage-00256", + "text": " If srcImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdResolveImage-srcImage-00257", + "text": " srcImage must have a sample count equal to any valid sample count value other than VK_SAMPLE_COUNT_1_BIT" + }, + { + "vuid": "VUID-vkCmdResolveImage-dstImage-00258", + "text": " If dstImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdResolveImage-dstImage-00259", + "text": " dstImage must have a sample count equal to VK_SAMPLE_COUNT_1_BIT" + }, + { + "vuid": "VUID-vkCmdResolveImage-srcImageLayout-00260", + "text": " srcImageLayout must specify the layout of the image subresources of srcImage specified in pRegions at the time this command is executed on a VkDevice" + }, + { + "vuid": "VUID-vkCmdResolveImage-dstImageLayout-00262", + "text": " dstImageLayout must specify the layout of the image subresources of dstImage specified in pRegions at the time this command is executed on a VkDevice" + }, + { + "vuid": "VUID-vkCmdResolveImage-dstImage-00264", + "text": " If dstImage was created with tiling equal to VK_IMAGE_TILING_LINEAR, dstImage must have been created with a format that supports being a color attachment, as specified by the VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT flag in VkFormatProperties::linearTilingFeatures returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdResolveImage-dstImage-00265", + "text": " If dstImage was created with tiling equal to VK_IMAGE_TILING_OPTIMAL, dstImage must have been created with a format that supports being a color attachment, as specified by the VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT flag in VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdResolveImage-srcImage-01386", + "text": " srcImage and dstImage must have been created with the same image format" + }, + { + "vuid": "VUID-vkCmdResolveImage-srcSubresource-01709", + "text": " The srcSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when srcImage was created" + }, + { + "vuid": "VUID-vkCmdResolveImage-dstSubresource-01710", + "text": " The dstSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created" + }, + { + "vuid": "VUID-vkCmdResolveImage-srcSubresource-01711", + "text": " The srcSubresource.baseArrayLayer + srcSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when srcImage was created" + }, + { + "vuid": "VUID-vkCmdResolveImage-dstSubresource-01712", + "text": " The dstSubresource.baseArrayLayer + dstSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created" + }, + { + "vuid": "VUID-vkCmdResolveImage-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdResolveImage-srcImage-parameter", + "text": " srcImage must be a valid VkImage handle" + }, + { + "vuid": "VUID-vkCmdResolveImage-srcImageLayout-parameter", + "text": " srcImageLayout must be a valid VkImageLayout value" + }, + { + "vuid": "VUID-vkCmdResolveImage-dstImage-parameter", + "text": " dstImage must be a valid VkImage handle" + }, + { + "vuid": "VUID-vkCmdResolveImage-dstImageLayout-parameter", + "text": " dstImageLayout must be a valid VkImageLayout value" + }, + { + "vuid": "VUID-vkCmdResolveImage-pRegions-parameter", + "text": " pRegions must be a valid pointer to an array of regionCount valid VkImageResolve structures" + }, + { + "vuid": "VUID-vkCmdResolveImage-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdResolveImage-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdResolveImage-renderpass", + "text": " This command must only be called outside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdResolveImage-regionCount-arraylength", + "text": " regionCount must be greater than 0" + }, + { + "vuid": "VUID-vkCmdResolveImage-commonparent", + "text": " Each of commandBuffer, dstImage, and srcImage must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "!(VK_KHR_shared_presentable_image)": [ + { + "vuid": "VUID-vkCmdResolveImage-srcImageLayout-00261", + "text": " srcImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL" + }, + { + "vuid": "VUID-vkCmdResolveImage-dstImageLayout-00263", + "text": " dstImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL" + } + ], + "(VK_KHR_shared_presentable_image)": [ + { + "vuid": "VUID-vkCmdResolveImage-srcImageLayout-01400", + "text": " srcImageLayout must be VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL" + }, + { + "vuid": "VUID-vkCmdResolveImage-dstImageLayout-01401", + "text": " dstImageLayout must be VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL" + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdResolveImage-commandBuffer-01837", + "text": " If commandBuffer is an unprotected command buffer, then srcImage must not be a protected image" + }, + { + "vuid": "VUID-vkCmdResolveImage-commandBuffer-01838", + "text": " If commandBuffer is an unprotected command buffer, then dstImage must not be a protected image" + }, + { + "vuid": "VUID-vkCmdResolveImage-commandBuffer-01839", + "text": " If commandBuffer is a protected command buffer, then dstImage must not be an unprotected image" + } + ] + }, + "VkImageResolve": { + "core": [ + { + "vuid": "VUID-VkImageResolve-aspectMask-00266", + "text": " The aspectMask member of srcSubresource and dstSubresource must only contain VK_IMAGE_ASPECT_COLOR_BIT" + }, + { + "vuid": "VUID-VkImageResolve-layerCount-00267", + "text": " The layerCount member of srcSubresource and dstSubresource must match" + }, + { + "vuid": "VUID-VkImageResolve-srcImage-00268", + "text": " If either of the calling command’s srcImage or dstImage parameters are of VkImageType VK_IMAGE_TYPE_3D, the baseArrayLayer and layerCount members of both srcSubresource and dstSubresource must be 0 and 1, respectively" + }, + { + "vuid": "VUID-VkImageResolve-srcOffset-00269", + "text": " srcOffset.x and (extent.width + srcOffset.x) must both be greater than or equal to 0 and less than or equal to the source image subresource width" + }, + { + "vuid": "VUID-VkImageResolve-srcOffset-00270", + "text": " srcOffset.y and (extent.height + srcOffset.y) must both be greater than or equal to 0 and less than or equal to the source image subresource height" + }, + { + "vuid": "VUID-VkImageResolve-srcImage-00271", + "text": " If the calling command’s srcImage is of type VK_IMAGE_TYPE_1D, then srcOffset.y must be 0 and extent.height must be 1." + }, + { + "vuid": "VUID-VkImageResolve-srcOffset-00272", + "text": " srcOffset.z and (extent.depth + srcOffset.z) must both be greater than or equal to 0 and less than or equal to the source image subresource depth" + }, + { + "vuid": "VUID-VkImageResolve-srcImage-00273", + "text": " If the calling command’s srcImage is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then srcOffset.z must be 0 and extent.depth must be 1." + }, + { + "vuid": "VUID-VkImageResolve-dstOffset-00274", + "text": " dstOffset.x and (extent.width + dstOffset.x) must both be greater than or equal to 0 and less than or equal to the destination image subresource width" + }, + { + "vuid": "VUID-VkImageResolve-dstOffset-00275", + "text": " dstOffset.y and (extent.height + dstOffset.y) must both be greater than or equal to 0 and less than or equal to the destination image subresource height" + }, + { + "vuid": "VUID-VkImageResolve-dstImage-00276", + "text": " If the calling command’s dstImage is of type VK_IMAGE_TYPE_1D, then dstOffset.y must be 0 and extent.height must be 1." + }, + { + "vuid": "VUID-VkImageResolve-dstOffset-00277", + "text": " dstOffset.z and (extent.depth + dstOffset.z) must both be greater than or equal to 0 and less than or equal to the destination image subresource depth" + }, + { + "vuid": "VUID-VkImageResolve-dstImage-00278", + "text": " If the calling command’s dstImage is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then dstOffset.z must be 0 and extent.depth must be 1." + }, + { + "vuid": "VUID-VkImageResolve-srcSubresource-parameter", + "text": " srcSubresource must be a valid VkImageSubresourceLayers structure" + }, + { + "vuid": "VUID-VkImageResolve-dstSubresource-parameter", + "text": " dstSubresource must be a valid VkImageSubresourceLayers structure" + } + ] + }, + "vkCmdWriteBufferMarkerAMD": { + "(VK_AMD_buffer_marker)": [ + { + "vuid": "VUID-vkCmdWriteBufferMarkerAMD-dstOffset-01798", + "text": " dstOffset must be less than or equal to the size of dstBuffer minus 4." + }, + { + "vuid": "VUID-vkCmdWriteBufferMarkerAMD-dstBuffer-01799", + "text": " dstBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_DST_BIT usage flag" + }, + { + "vuid": "VUID-vkCmdWriteBufferMarkerAMD-dstBuffer-01800", + "text": " If dstBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdWriteBufferMarkerAMD-dstOffset-01801", + "text": " dstOffset must be a multiple of 4" + }, + { + "vuid": "VUID-vkCmdWriteBufferMarkerAMD-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdWriteBufferMarkerAMD-pipelineStage-parameter", + "text": " pipelineStage must be a valid VkPipelineStageFlagBits value" + }, + { + "vuid": "VUID-vkCmdWriteBufferMarkerAMD-dstBuffer-parameter", + "text": " dstBuffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkCmdWriteBufferMarkerAMD-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdWriteBufferMarkerAMD-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdWriteBufferMarkerAMD-commonparent", + "text": " Both of commandBuffer, and dstBuffer must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "VkPipelineInputAssemblyStateCreateInfo": { + "core": [ + { + "vuid": "VUID-VkPipelineInputAssemblyStateCreateInfo-topology-00428", + "text": " If topology is VK_PRIMITIVE_TOPOLOGY_POINT_LIST, VK_PRIMITIVE_TOPOLOGY_LINE_LIST, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY or VK_PRIMITIVE_TOPOLOGY_PATCH_LIST, primitiveRestartEnable must be VK_FALSE" + }, + { + "vuid": "VUID-VkPipelineInputAssemblyStateCreateInfo-topology-00429", + "text": " If the &amp;lt;&amp;lt;features-features-geometryShader,geometry shaders&amp;gt;&amp;gt; feature is not enabled, topology must not be any of VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY, VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY or VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY" + }, + { + "vuid": "VUID-VkPipelineInputAssemblyStateCreateInfo-topology-00430", + "text": " If the &amp;lt;&amp;lt;features-features-tessellationShader,tessellation shaders&amp;gt;&amp;gt; feature is not enabled, topology must not be VK_PRIMITIVE_TOPOLOGY_PATCH_LIST" + }, + { + "vuid": "VUID-VkPipelineInputAssemblyStateCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO" + }, + { + "vuid": "VUID-VkPipelineInputAssemblyStateCreateInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkPipelineInputAssemblyStateCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkPipelineInputAssemblyStateCreateInfo-topology-parameter", + "text": " topology must be a valid VkPrimitiveTopology value" + } + ] + }, + "vkCmdBindIndexBuffer": { + "core": [ + { + "vuid": "VUID-vkCmdBindIndexBuffer-offset-00431", + "text": " offset must be less than the size of buffer" + }, + { + "vuid": "VUID-vkCmdBindIndexBuffer-offset-00432", + "text": " The sum of offset and the address of the range of VkDeviceMemory object that is backing buffer, must be a multiple of the type indicated by indexType" + }, + { + "vuid": "VUID-vkCmdBindIndexBuffer-buffer-00433", + "text": " buffer must have been created with the VK_BUFFER_USAGE_INDEX_BUFFER_BIT flag" + }, + { + "vuid": "VUID-vkCmdBindIndexBuffer-buffer-00434", + "text": " If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdBindIndexBuffer-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdBindIndexBuffer-buffer-parameter", + "text": " buffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkCmdBindIndexBuffer-indexType-parameter", + "text": " indexType must be a valid VkIndexType value" + }, + { + "vuid": "VUID-vkCmdBindIndexBuffer-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdBindIndexBuffer-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdBindIndexBuffer-commonparent", + "text": " Both of buffer, and commandBuffer must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "vkCmdDraw": { + "core": [ + { + "vuid": "VUID-vkCmdDraw-renderPass-00435", + "text": " The current render pass must be &amp;lt;&amp;lt;renderpass-compatibility,compatible&amp;gt;&amp;gt; with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS." + }, + { + "vuid": "VUID-vkCmdDraw-subpass-00436", + "text": " The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS." + }, + { + "vuid": "VUID-vkCmdDraw-None-00437", + "text": " For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in &amp;lt;&amp;lt;descriptorsets-compatibility&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDraw-None-00438", + "text": " For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in &amp;lt;&amp;lt;descriptorsets-compatibility&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDraw-None-00439", + "text": " Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline" + }, + { + "vuid": "VUID-vkCmdDraw-None-00440", + "text": " All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have valid buffers bound" + }, + { + "vuid": "VUID-vkCmdDraw-None-00441", + "text": " For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in &amp;lt;&amp;lt;fxvertex-input&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDraw-None-00442", + "text": " A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS" + }, + { + "vuid": "VUID-vkCmdDraw-None-00443", + "text": " If the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer" + }, + { + "vuid": "VUID-vkCmdDraw-None-00444", + "text": " Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set" + }, + { + "vuid": "VUID-vkCmdDraw-None-00445", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDraw-None-00446", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDraw-None-00447", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDraw-None-00448", + "text": " If the &amp;lt;&amp;lt;features-features-robustBufferAccess,robust buffer access&amp;gt;&amp;gt; feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set" + }, + { + "vuid": "VUID-vkCmdDraw-None-00449", + "text": " If the &amp;lt;&amp;lt;features-features-robustBufferAccess,robust buffer access&amp;gt;&amp;gt; feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set" + }, + { + "vuid": "VUID-vkCmdDraw-linearTilingFeatures-00450", + "text": " Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdDraw-None-01499", + "text": " Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command." + }, + { + "vuid": "VUID-vkCmdDraw-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdDraw-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDraw-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdDraw-renderpass", + "text": " This command must only be called inside of a render pass instance" + } + ], + "(VK_IMG_filter_cubic)": [ + { + "vuid": "VUID-vkCmdDraw-linearTilingFeatures-00451", + "text": " Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdDraw-None-00452", + "text": " Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must not have a VkImageViewType of VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY" + } + ], + "(VK_VERSION_1_1,VK_KHR_multiview)": [ + { + "vuid": "VUID-vkCmdDraw-maxMultiviewInstanceIndex-00453", + "text": " If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex." + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdDraw-commandBuffer-01850", + "text": " If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer." + }, + { + "vuid": "VUID-vkCmdDraw-commandBuffer-01851", + "text": " If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer." + }, + { + "vuid": "VUID-vkCmdDraw-commandBuffer-01852", + "text": " If commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must not be a protected image or protected buffer." + } + ], + "(VK_EXT_sample_locations)": [ + { + "vuid": "VUID-vkCmdDraw-sampleLocationsEnable-01512", + "text": " If the bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set" + } + ] + }, + "vkCmdDrawIndexed": { + "core": [ + { + "vuid": "VUID-vkCmdDrawIndexed-renderPass-00454", + "text": " The current render pass must be &amp;lt;&amp;lt;renderpass-compatibility,compatible&amp;gt;&amp;gt; with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS." + }, + { + "vuid": "VUID-vkCmdDrawIndexed-subpass-00455", + "text": " The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS." + }, + { + "vuid": "VUID-vkCmdDrawIndexed-None-00456", + "text": " For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in &amp;lt;&amp;lt;descriptorsets-compatibility&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-None-00457", + "text": " For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in &amp;lt;&amp;lt;descriptorsets-compatibility&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-None-00458", + "text": " Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-None-00459", + "text": " All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have valid buffers bound" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-None-00460", + "text": " For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in &amp;lt;&amp;lt;fxvertex-input&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-None-00461", + "text": " A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-None-00462", + "text": " If the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-indexSize-00463", + "text": " (indexSize * (firstIndex + indexCount) + offset) must be less than or equal to the size of the bound index buffer, with indexSize being based on the type specified by indexType, where the index buffer, indexType, and offset are specified via vkCmdBindIndexBuffer" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-None-00464", + "text": " Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-None-00465", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-None-00466", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-None-00467", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-None-00468", + "text": " If the &amp;lt;&amp;lt;features-features-robustBufferAccess,robust buffer access&amp;gt;&amp;gt; feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-None-00469", + "text": " If the &amp;lt;&amp;lt;features-features-robustBufferAccess,robust buffer access&amp;gt;&amp;gt; feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-linearTilingFeatures-00470", + "text": " Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-None-01500", + "text": " Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command." + }, + { + "vuid": "VUID-vkCmdDrawIndexed-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-renderpass", + "text": " This command must only be called inside of a render pass instance" + } + ], + "(VK_IMG_filter_cubic)": [ + { + "vuid": "VUID-vkCmdDrawIndexed-linearTilingFeatures-00471", + "text": " Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdDrawIndexed-None-00472", + "text": " Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must not have a VkImageViewType of VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY" + } + ], + "(VK_VERSION_1_1,VK_KHR_multiview)": [ + { + "vuid": "VUID-vkCmdDrawIndexed-maxMultiviewInstanceIndex-00473", + "text": " If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex." + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdDrawIndexed-commandBuffer-01853", + "text": " If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer." + }, + { + "vuid": "VUID-vkCmdDrawIndexed-commandBuffer-01854", + "text": " If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer." + }, + { + "vuid": "VUID-vkCmdDrawIndexed-commandBuffer-01855", + "text": " If commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must not be a protected image or protected buffer." + } + ], + "(VK_EXT_sample_locations)": [ + { + "vuid": "VUID-vkCmdDrawIndexed-sampleLocationsEnable-01513", + "text": " If the bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set" + } + ] + }, + "vkCmdDrawIndirect": { + "core": [ + { + "vuid": "VUID-vkCmdDrawIndirect-buffer-00474", + "text": " If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-buffer-01660", + "text": " buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-offset-00475", + "text": " offset must be a multiple of 4" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-drawCount-00476", + "text": " If drawCount is greater than 1, stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawIndirectCommand)" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-drawCount-00477", + "text": " If the multi-draw indirect feature is not enabled, drawCount must be 0 or 1" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-firstInstance-00478", + "text": " If the &amp;lt;&amp;lt;features-features-drawIndirectFirstInstance,drawIndirectFirstInstance&amp;gt;&amp;gt; feature is not enabled, all the firstInstance members of the VkDrawIndirectCommand structures accessed by this command must be 0" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-renderPass-00479", + "text": " The current render pass must be &amp;lt;&amp;lt;renderpass-compatibility,compatible&amp;gt;&amp;gt; with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS." + }, + { + "vuid": "VUID-vkCmdDrawIndirect-subpass-00480", + "text": " The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS." + }, + { + "vuid": "VUID-vkCmdDrawIndirect-None-00481", + "text": " For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in &amp;lt;&amp;lt;descriptorsets-compatibility&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-None-00482", + "text": " For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in &amp;lt;&amp;lt;descriptorsets-compatibility&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-None-00483", + "text": " Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-None-00484", + "text": " All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have valid buffers bound" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-None-00485", + "text": " A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-None-00486", + "text": " If the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-drawCount-00487", + "text": " If drawCount is equal to 1, (offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-drawCount-00488", + "text": " If drawCount is greater than 1, (stride {times} (drawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-drawCount-00489", + "text": " drawCount must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCount" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-None-00490", + "text": " Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-None-00491", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-None-00492", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-None-00493", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-None-00494", + "text": " If the &amp;lt;&amp;lt;features-features-robustBufferAccess,robust buffer access&amp;gt;&amp;gt; feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-None-00495", + "text": " If the &amp;lt;&amp;lt;features-features-robustBufferAccess,robust buffer access&amp;gt;&amp;gt; feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-linearTilingFeatures-00496", + "text": " Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-None-01501", + "text": " Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command." + }, + { + "vuid": "VUID-vkCmdDrawIndirect-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-buffer-parameter", + "text": " buffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-renderpass", + "text": " This command must only be called inside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-commonparent", + "text": " Both of buffer, and commandBuffer must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_IMG_filter_cubic)": [ + { + "vuid": "VUID-vkCmdDrawIndirect-linearTilingFeatures-00497", + "text": " Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdDrawIndirect-None-00498", + "text": " Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must not have a VkImageViewType of VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY" + } + ], + "(VK_VERSION_1_1,VK_KHR_multiview)": [ + { + "vuid": "VUID-vkCmdDrawIndirect-maxMultiviewInstanceIndex-00499", + "text": " If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex." + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdDrawIndirect-commandBuffer-01856", + "text": " If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer." + }, + { + "vuid": "VUID-vkCmdDrawIndirect-commandBuffer-01857", + "text": " If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer." + }, + { + "vuid": "VUID-vkCmdDrawIndirect-commandBuffer-01858", + "text": " If commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must not be a protected image or protected buffer." + } + ], + "(VK_EXT_sample_locations)": [ + { + "vuid": "VUID-vkCmdDrawIndirect-sampleLocationsEnable-01514", + "text": " If the bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set" + } + ] + }, + "VkDrawIndirectCommand": { + "core": [ + { + "vuid": "VUID-VkDrawIndirectCommand-None-00500", + "text": " For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in &amp;lt;&amp;lt;fxvertex-input&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-VkDrawIndirectCommand-firstInstance-00501", + "text": " If the &amp;lt;&amp;lt;features-features-drawIndirectFirstInstance,drawIndirectFirstInstance&amp;gt;&amp;gt; feature is not enabled, firstInstance must be 0" + } + ] + }, + "vkCmdDrawIndirectCountAMD": { + "(VK_AMD_draw_indirect_count)": [ + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-buffer-01661", + "text": " If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-buffer-01662", + "text": " buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-countBuffer-01663", + "text": " If countBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-countBuffer-01664", + "text": " countBuffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-offset-00502", + "text": " offset must be a multiple of 4" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-countBufferOffset-00503", + "text": " countBufferOffset must be a multiple of 4" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-stride-00504", + "text": " stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawIndirectCommand)" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-maxDrawCount-00505", + "text": " If maxDrawCount is greater than or equal to 1, (stride {times} (maxDrawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-firstInstance-00506", + "text": " If the &amp;lt;&amp;lt;features-features-drawIndirectFirstInstance,drawIndirectFirstInstance&amp;gt;&amp;gt; feature is not enabled, all the firstInstance members of the VkDrawIndirectCommand structures accessed by this command must be 0" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-renderPass-00507", + "text": " The current render pass must be &amp;lt;&amp;lt;renderpass-compatibility,compatible&amp;gt;&amp;gt; with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS." + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-subpass-00508", + "text": " The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS." + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-None-00509", + "text": " For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in &amp;lt;&amp;lt;descriptorsets-compatibility&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-None-00510", + "text": " For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in &amp;lt;&amp;lt;descriptorsets-compatibility&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-None-00511", + "text": " Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-None-00512", + "text": " All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have valid buffers bound" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-None-00513", + "text": " A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-None-00514", + "text": " If the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-countBuffer-00515", + "text": " If the count stored in countBuffer is equal to 1, (offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-countBuffer-00516", + "text": " If the count stored in countBuffer is greater than 1, (stride {times} (drawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-countBuffer-00517", + "text": " The count stored in countBuffer must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCount" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-None-00518", + "text": " Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-None-00519", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-None-00520", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-None-00521", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-None-00522", + "text": " If the &amp;lt;&amp;lt;features-features-robustBufferAccess,robust buffer access&amp;gt;&amp;gt; feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-None-00523", + "text": " If the &amp;lt;&amp;lt;features-features-robustBufferAccess,robust buffer access&amp;gt;&amp;gt; feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-linearTilingFeatures-00524", + "text": " Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-None-01502", + "text": " Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command." + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-buffer-parameter", + "text": " buffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-countBuffer-parameter", + "text": " countBuffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-renderpass", + "text": " This command must only be called inside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-commonparent", + "text": " Each of buffer, commandBuffer, and countBuffer must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_AMD_draw_indirect_count)+(VK_VERSION_1_1,VK_KHR_multiview)": [ + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-maxMultiviewInstanceIndex-00525", + "text": " If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex." + } + ], + "(VK_AMD_draw_indirect_count)+(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-commandBuffer-01859", + "text": " If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer." + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-commandBuffer-01860", + "text": " If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer." + }, + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-commandBuffer-01861", + "text": " If commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must not be a protected image or protected buffer." + } + ], + "(VK_AMD_draw_indirect_count)+(VK_EXT_sample_locations)": [ + { + "vuid": "VUID-vkCmdDrawIndirectCountAMD-sampleLocationsEnable-01515", + "text": " If the bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set" + } + ] + }, + "vkCmdDrawIndexedIndirect": { + "core": [ + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-buffer-00526", + "text": " If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-buffer-01665", + "text": " buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-offset-00527", + "text": " offset must be a multiple of 4" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-drawCount-00528", + "text": " If drawCount is greater than 1, stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawIndexedIndirectCommand)" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-drawCount-00529", + "text": " If the multi-draw indirect feature is not enabled, drawCount must be 0 or 1" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-firstInstance-00530", + "text": " If the &amp;lt;&amp;lt;features-features-drawIndirectFirstInstance,drawIndirectFirstInstance&amp;gt;&amp;gt; feature is not enabled, all the firstInstance members of the VkDrawIndexedIndirectCommand structures accessed by this command must be 0" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-renderPass-00531", + "text": " The current render pass must be &amp;lt;&amp;lt;renderpass-compatibility,compatible&amp;gt;&amp;gt; with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS." + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-subpass-00532", + "text": " The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS." + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-None-00533", + "text": " For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in &amp;lt;&amp;lt;descriptorsets-compatibility&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-None-00534", + "text": " For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in &amp;lt;&amp;lt;descriptorsets-compatibility&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-None-00535", + "text": " Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-None-00536", + "text": " All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have valid buffers bound" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-None-00537", + "text": " A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-None-00538", + "text": " If the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-drawCount-00539", + "text": " If drawCount is equal to 1, (offset + sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size of buffer" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-drawCount-00540", + "text": " If drawCount is greater than 1, (stride {times} (drawCount - 1) + offset + sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size of buffer" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-drawCount-00541", + "text": " drawCount must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCount" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-None-00542", + "text": " Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-None-00543", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-None-00544", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-None-00545", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-None-00546", + "text": " If the &amp;lt;&amp;lt;features-features-robustBufferAccess,robust buffer access&amp;gt;&amp;gt; feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-None-00547", + "text": " If the &amp;lt;&amp;lt;features-features-robustBufferAccess,robust buffer access&amp;gt;&amp;gt; feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-linearTilingFeatures-00548", + "text": " Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-None-01503", + "text": " Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command." + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-buffer-parameter", + "text": " buffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-renderpass", + "text": " This command must only be called inside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-commonparent", + "text": " Both of buffer, and commandBuffer must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_IMG_filter_cubic)": [ + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-linearTilingFeatures-00549", + "text": " Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-None-00550", + "text": " Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must not have a VkImageViewType of VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY" + } + ], + "(VK_VERSION_1_1,VK_KHR_multiview)": [ + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-maxMultiviewInstanceIndex-00551", + "text": " If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex." + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-commandBuffer-01862", + "text": " If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer." + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-commandBuffer-01863", + "text": " If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer." + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-commandBuffer-01864", + "text": " If commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must not be a protected image or protected buffer." + } + ], + "(VK_EXT_sample_locations)": [ + { + "vuid": "VUID-vkCmdDrawIndexedIndirect-sampleLocationsEnable-01516", + "text": " If the bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set" + } + ] + }, + "VkDrawIndexedIndirectCommand": { + "core": [ + { + "vuid": "VUID-VkDrawIndexedIndirectCommand-None-00552", + "text": " For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in &amp;lt;&amp;lt;fxvertex-input&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-VkDrawIndexedIndirectCommand-indexSize-00553", + "text": " (indexSize * (firstIndex + indexCount) + offset) must be less than or equal to the size of the bound index buffer, with indexSize being based on the type specified by indexType, where the index buffer, indexType, and offset are specified via vkCmdBindIndexBuffer" + }, + { + "vuid": "VUID-VkDrawIndexedIndirectCommand-firstInstance-00554", + "text": " If the &amp;lt;&amp;lt;features-features-drawIndirectFirstInstance,drawIndirectFirstInstance&amp;gt;&amp;gt; feature is not enabled, firstInstance must be 0" + } + ] + }, + "vkCmdDrawIndexedIndirectCountAMD": { + "(VK_AMD_draw_indirect_count)": [ + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-01666", + "text": " If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-01667", + "text": " buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-01668", + "text": " If countBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-01669", + "text": " countBuffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-offset-00555", + "text": " offset must be a multiple of 4" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-countBufferOffset-00556", + "text": " countBufferOffset must be a multiple of 4" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-stride-00557", + "text": " stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawIndirectCommand)" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-maxDrawCount-00558", + "text": " If maxDrawCount is greater than or equal to 1, (stride {times} (maxDrawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) must be less than or equal to the size of buffer" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-firstInstance-00559", + "text": " If the drawIndirectFirstInstance feature is not enabled, all the firstInstance members of the VkDrawIndexedIndirectCommand structures accessed by this command must be 0" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-renderPass-00560", + "text": " The current render pass must be &amp;lt;&amp;lt;renderpass-compatibility,compatible&amp;gt;&amp;gt; with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS." + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-subpass-00561", + "text": " The subpass index of the current render pass must be equal to the subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS." + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-None-00562", + "text": " For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in &amp;lt;&amp;lt;descriptorsets-compatibility&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-None-00563", + "text": " For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set for VK_PIPELINE_BIND_POINT_GRAPHICS, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in &amp;lt;&amp;lt;descriptorsets-compatibility&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-None-00564", + "text": " Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-None-00565", + "text": " All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have valid buffers bound" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-None-00566", + "text": " A valid graphics pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_GRAPHICS" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-None-00567", + "text": " If the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must have been set on the current command buffer" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-00568", + "text": " If count stored in countBuffer is equal to 1, (offset + sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size of buffer" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-00569", + "text": " If count stored in countBuffer is greater than 1, (stride {times} (drawCount - 1) + offset + sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size of buffer" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-drawCount-00570", + "text": " drawCount must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCount" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-None-00571", + "text": " Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-None-00572", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-None-00573", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-None-00574", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-None-00575", + "text": " If the &amp;lt;&amp;lt;features-features-robustBufferAccess,robust buffer access&amp;gt;&amp;gt; feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-None-00576", + "text": " If the &amp;lt;&amp;lt;features-features-robustBufferAccess,robust buffer access&amp;gt;&amp;gt; feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-linearTilingFeatures-00577", + "text": " Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-None-01504", + "text": " Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command." + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-buffer-parameter", + "text": " buffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-countBuffer-parameter", + "text": " countBuffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-renderpass", + "text": " This command must only be called inside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-commonparent", + "text": " Each of buffer, commandBuffer, and countBuffer must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_AMD_draw_indirect_count)+(VK_VERSION_1_1,VK_KHR_multiview)": [ + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-maxMultiviewInstanceIndex-00578", + "text": " If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex." + } + ], + "(VK_AMD_draw_indirect_count)+(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-01865", + "text": " If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer." + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-01866", + "text": " If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer." + }, + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-commandBuffer-01867", + "text": " If commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must not be a protected image or protected buffer." + } + ], + "(VK_AMD_draw_indirect_count)+(VK_EXT_sample_locations)": [ + { + "vuid": "VUID-vkCmdDrawIndexedIndirectCountAMD-sampleLocationsEnable-01517", + "text": " If the bound graphics pipeline was created with VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set" + } + ] + }, + "VkPipelineVertexInputStateCreateInfo": { + "core": [ + { + "vuid": "VUID-VkPipelineVertexInputStateCreateInfo-vertexBindingDescriptionCount-00613", + "text": " vertexBindingDescriptionCount must be less than or equal to VkPhysicalDeviceLimits::maxVertexInputBindings" + }, + { + "vuid": "VUID-VkPipelineVertexInputStateCreateInfo-vertexAttributeDescriptionCount-00614", + "text": " vertexAttributeDescriptionCount must be less than or equal to VkPhysicalDeviceLimits::maxVertexInputAttributes" + }, + { + "vuid": "VUID-VkPipelineVertexInputStateCreateInfo-binding-00615", + "text": " For every binding specified by each element of pVertexAttributeDescriptions, a VkVertexInputBindingDescription must exist in pVertexBindingDescriptions with the same value of binding" + }, + { + "vuid": "VUID-VkPipelineVertexInputStateCreateInfo-pVertexBindingDescriptions-00616", + "text": " All elements of pVertexBindingDescriptions must describe distinct binding numbers" + }, + { + "vuid": "VUID-VkPipelineVertexInputStateCreateInfo-pVertexAttributeDescriptions-00617", + "text": " All elements of pVertexAttributeDescriptions must describe distinct attribute locations" + }, + { + "vuid": "VUID-VkPipelineVertexInputStateCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO" + }, + { + "vuid": "VUID-VkPipelineVertexInputStateCreateInfo-pNext-pNext", + "text": " pNext must be NULL or a pointer to a valid instance of VkPipelineVertexInputDivisorStateCreateInfoEXT" + }, + { + "vuid": "VUID-VkPipelineVertexInputStateCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkPipelineVertexInputStateCreateInfo-pVertexBindingDescriptions-parameter", + "text": " If vertexBindingDescriptionCount is not 0, pVertexBindingDescriptions must be a valid pointer to an array of vertexBindingDescriptionCount valid VkVertexInputBindingDescription structures" + }, + { + "vuid": "VUID-VkPipelineVertexInputStateCreateInfo-pVertexAttributeDescriptions-parameter", + "text": " If vertexAttributeDescriptionCount is not 0, pVertexAttributeDescriptions must be a valid pointer to an array of vertexAttributeDescriptionCount valid VkVertexInputAttributeDescription structures" + } + ] + }, + "VkVertexInputBindingDescription": { + "core": [ + { + "vuid": "VUID-VkVertexInputBindingDescription-binding-00618", + "text": " binding must be less than VkPhysicalDeviceLimits::maxVertexInputBindings" + }, + { + "vuid": "VUID-VkVertexInputBindingDescription-stride-00619", + "text": " stride must be less than or equal to VkPhysicalDeviceLimits::maxVertexInputBindingStride" + }, + { + "vuid": "VUID-VkVertexInputBindingDescription-inputRate-parameter", + "text": " inputRate must be a valid VkVertexInputRate value" + } + ] + }, + "VkVertexInputAttributeDescription": { + "core": [ + { + "vuid": "VUID-VkVertexInputAttributeDescription-location-00620", + "text": " location must be less than VkPhysicalDeviceLimits::maxVertexInputAttributes" + }, + { + "vuid": "VUID-VkVertexInputAttributeDescription-binding-00621", + "text": " binding must be less than VkPhysicalDeviceLimits::maxVertexInputBindings" + }, + { + "vuid": "VUID-VkVertexInputAttributeDescription-offset-00622", + "text": " offset must be less than or equal to VkPhysicalDeviceLimits::maxVertexInputAttributeOffset" + }, + { + "vuid": "VUID-VkVertexInputAttributeDescription-format-00623", + "text": " format must be allowed as a vertex buffer format, as specified by the VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT flag in VkFormatProperties::bufferFeatures returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-VkVertexInputAttributeDescription-format-parameter", + "text": " format must be a valid VkFormat value" + } + ] + }, + "vkCmdBindVertexBuffers": { + "core": [ + { + "vuid": "VUID-vkCmdBindVertexBuffers-firstBinding-00624", + "text": " firstBinding must be less than VkPhysicalDeviceLimits::maxVertexInputBindings" + }, + { + "vuid": "VUID-vkCmdBindVertexBuffers-firstBinding-00625", + "text": " The sum of firstBinding and bindingCount must be less than or equal to VkPhysicalDeviceLimits::maxVertexInputBindings" + }, + { + "vuid": "VUID-vkCmdBindVertexBuffers-pOffsets-00626", + "text": " All elements of pOffsets must be less than the size of the corresponding element in pBuffers" + }, + { + "vuid": "VUID-vkCmdBindVertexBuffers-pBuffers-00627", + "text": " All elements of pBuffers must have been created with the VK_BUFFER_USAGE_VERTEX_BUFFER_BIT flag" + }, + { + "vuid": "VUID-vkCmdBindVertexBuffers-pBuffers-00628", + "text": " Each element of pBuffers that is non-sparse must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdBindVertexBuffers-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdBindVertexBuffers-pBuffers-parameter", + "text": " pBuffers must be a valid pointer to an array of bindingCount valid VkBuffer handles" + }, + { + "vuid": "VUID-vkCmdBindVertexBuffers-pOffsets-parameter", + "text": " pOffsets must be a valid pointer to an array of bindingCount VkDeviceSize values" + }, + { + "vuid": "VUID-vkCmdBindVertexBuffers-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdBindVertexBuffers-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdBindVertexBuffers-bindingCount-arraylength", + "text": " bindingCount must be greater than 0" + }, + { + "vuid": "VUID-vkCmdBindVertexBuffers-commonparent", + "text": " Both of commandBuffer, and the elements of pBuffers must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "VkPipelineVertexInputDivisorStateCreateInfoEXT": { + "(VK_EXT_vertex_attribute_divisor)": [ + { + "vuid": "VUID-VkPipelineVertexInputDivisorStateCreateInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT" + }, + { + "vuid": "VUID-VkPipelineVertexInputDivisorStateCreateInfoEXT-pVertexBindingDivisors-parameter", + "text": " pVertexBindingDivisors must be a valid pointer to an array of vertexBindingDivisorCount VkVertexInputBindingDivisorDescriptionEXT structures" + }, + { + "vuid": "VUID-VkPipelineVertexInputDivisorStateCreateInfoEXT-vertexBindingDivisorCount-arraylength", + "text": " vertexBindingDivisorCount must be greater than 0" + } + ] + }, + "VkVertexInputBindingDivisorDescriptionEXT": { + "(VK_EXT_vertex_attribute_divisor)": [ + { + "vuid": "VUID-VkVertexInputBindingDivisorDescriptionEXT-binding-01869", + "text": " binding must be less than VkPhysicalDeviceLimits::maxVertexInputBindings" + }, + { + "vuid": "VUID-VkVertexInputBindingDivisorDescriptionEXT-divisor-01870", + "text": " divisor must be a value between 0 and VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT::maxVertexAttribDivisor, inclusive." + }, + { + "vuid": "VUID-VkVertexInputBindingDivisorDescriptionEXT-inputRate-01871", + "text": " VkVertexInputBindingDescription::inputRate must be of type VK_VERTEX_INPUT_RATE_INSTANCE for this binding." + } + ] + }, + "VkPipelineTessellationStateCreateInfo": { + "core": [ + { + "vuid": "VUID-VkPipelineTessellationStateCreateInfo-patchControlPoints-01214", + "text": " patchControlPoints must be greater than zero and less than or equal to VkPhysicalDeviceLimits::maxTessellationPatchSize" + }, + { + "vuid": "VUID-VkPipelineTessellationStateCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO" + }, + { + "vuid": "VUID-VkPipelineTessellationStateCreateInfo-pNext-pNext", + "text": " pNext must be NULL or a pointer to a valid instance of VkPipelineTessellationDomainOriginStateCreateInfo" + }, + { + "vuid": "VUID-VkPipelineTessellationStateCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + } + ] + }, + "VkPipelineTessellationDomainOriginStateCreateInfo": { + "(VK_VERSION_1_1,VK_KHR_maintenance2)": [ + { + "vuid": "VUID-VkPipelineTessellationDomainOriginStateCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO" + }, + { + "vuid": "VUID-VkPipelineTessellationDomainOriginStateCreateInfo-domainOrigin-parameter", + "text": " domainOrigin must be a valid VkTessellationDomainOrigin value" + } + ] + }, + "VkPipelineViewportSwizzleStateCreateInfoNV": { + "(VK_NV_viewport_swizzle)": [ + { + "vuid": "VUID-VkPipelineViewportSwizzleStateCreateInfoNV-viewportCount-01215", + "text": " viewportCount must match the viewportCount set in VkPipelineViewportStateCreateInfo" + }, + { + "vuid": "VUID-VkPipelineViewportSwizzleStateCreateInfoNV-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV" + }, + { + "vuid": "VUID-VkPipelineViewportSwizzleStateCreateInfoNV-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkPipelineViewportSwizzleStateCreateInfoNV-viewportCount-arraylength", + "text": " viewportCount must be greater than 0" + } + ] + }, + "VkViewportSwizzleNV": { + "(VK_NV_viewport_swizzle)": [ + { + "vuid": "VUID-VkViewportSwizzleNV-x-parameter", + "text": " x must be a valid VkViewportCoordinateSwizzleNV value" + }, + { + "vuid": "VUID-VkViewportSwizzleNV-y-parameter", + "text": " y must be a valid VkViewportCoordinateSwizzleNV value" + }, + { + "vuid": "VUID-VkViewportSwizzleNV-z-parameter", + "text": " z must be a valid VkViewportCoordinateSwizzleNV value" + }, + { + "vuid": "VUID-VkViewportSwizzleNV-w-parameter", + "text": " w must be a valid VkViewportCoordinateSwizzleNV value" + } + ] + }, + "VkPipelineViewportWScalingStateCreateInfoNV": { + "(VK_NV_clip_space_w_scaling)": [ + { + "vuid": "VUID-VkPipelineViewportWScalingStateCreateInfoNV-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV" + }, + { + "vuid": "VUID-VkPipelineViewportWScalingStateCreateInfoNV-viewportCount-arraylength", + "text": " viewportCount must be greater than 0" + } + ] + }, + "vkCmdSetViewportWScalingNV": { + "(VK_NV_clip_space_w_scaling)": [ + { + "vuid": "VUID-vkCmdSetViewportWScalingNV-None-01322", + "text": " The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV dynamic state enabled" + }, + { + "vuid": "VUID-vkCmdSetViewportWScalingNV-firstViewport-01323", + "text": " firstViewport must be less than VkPhysicalDeviceLimits::maxViewports" + }, + { + "vuid": "VUID-vkCmdSetViewportWScalingNV-firstViewport-01324", + "text": " The sum of firstViewport and viewportCount must be between 1 and VkPhysicalDeviceLimits::maxViewports, inclusive" + }, + { + "vuid": "VUID-vkCmdSetViewportWScalingNV-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdSetViewportWScalingNV-pViewportWScalings-parameter", + "text": " pViewportWScalings must be a valid pointer to an array of viewportCount VkViewportWScalingNV structures" + }, + { + "vuid": "VUID-vkCmdSetViewportWScalingNV-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdSetViewportWScalingNV-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdSetViewportWScalingNV-viewportCount-arraylength", + "text": " viewportCount must be greater than 0" + } + ] + }, + "VkPipelineViewportStateCreateInfo": { + "core": [ + { + "vuid": "VUID-VkPipelineViewportStateCreateInfo-viewportCount-01216", + "text": " If the multiple viewports feature is not enabled, viewportCount must be 1" + }, + { + "vuid": "VUID-VkPipelineViewportStateCreateInfo-scissorCount-01217", + "text": " If the multiple viewports feature is not enabled, scissorCount must be 1" + }, + { + "vuid": "VUID-VkPipelineViewportStateCreateInfo-viewportCount-01218", + "text": " viewportCount must be between 1 and VkPhysicalDeviceLimits::maxViewports, inclusive" + }, + { + "vuid": "VUID-VkPipelineViewportStateCreateInfo-scissorCount-01219", + "text": " scissorCount must be between 1 and VkPhysicalDeviceLimits::maxViewports, inclusive" + }, + { + "vuid": "VUID-VkPipelineViewportStateCreateInfo-scissorCount-01220", + "text": " scissorCount and viewportCount must be identical" + }, + { + "vuid": "VUID-VkPipelineViewportStateCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO" + }, + { + "vuid": "VUID-VkPipelineViewportStateCreateInfo-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkPipelineViewportSwizzleStateCreateInfoNV or VkPipelineViewportWScalingStateCreateInfoNV" + }, + { + "vuid": "VUID-VkPipelineViewportStateCreateInfo-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + }, + { + "vuid": "VUID-VkPipelineViewportStateCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkPipelineViewportStateCreateInfo-viewportCount-arraylength", + "text": " viewportCount must be greater than 0" + }, + { + "vuid": "VUID-VkPipelineViewportStateCreateInfo-scissorCount-arraylength", + "text": " scissorCount must be greater than 0" + } + ], + "(VK_NV_clip_space_w_scaling)": [ + { + "vuid": "VUID-VkPipelineViewportStateCreateInfo-viewportWScalingEnable-01726", + "text": " If the viewportWScalingEnable member of a VkPipelineViewportWScalingStateCreateInfoNV structure chained to the pNext chain is VK_TRUE, the viewportCount member of the VkPipelineViewportWScalingStateCreateInfoNV structure must be equal to viewportCount" + } + ] + }, + "vkCmdSetViewport": { + "core": [ + { + "vuid": "VUID-vkCmdSetViewport-None-01221", + "text": " The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_VIEWPORT dynamic state enabled" + }, + { + "vuid": "VUID-vkCmdSetViewport-firstViewport-01222", + "text": " firstViewport must be less than VkPhysicalDeviceLimits::maxViewports" + }, + { + "vuid": "VUID-vkCmdSetViewport-firstViewport-01223", + "text": " The sum of firstViewport and viewportCount must be between 1 and VkPhysicalDeviceLimits::maxViewports, inclusive" + }, + { + "vuid": "VUID-vkCmdSetViewport-firstViewport-01224", + "text": " If the multiple viewports feature is not enabled, firstViewport must be 0" + }, + { + "vuid": "VUID-vkCmdSetViewport-viewportCount-01225", + "text": " If the multiple viewports feature is not enabled, viewportCount must be 1" + }, + { + "vuid": "VUID-vkCmdSetViewport-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdSetViewport-pViewports-parameter", + "text": " pViewports must be a valid pointer to an array of viewportCount VkViewport structures" + }, + { + "vuid": "VUID-vkCmdSetViewport-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdSetViewport-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdSetViewport-viewportCount-arraylength", + "text": " viewportCount must be greater than 0" + } + ] + }, + "VkViewport": { + "core": [ + { + "vuid": "VUID-VkViewport-width-01770", + "text": " width must be greater than 0.0" + }, + { + "vuid": "VUID-VkViewport-width-01771", + "text": " width must be less than or equal to VkPhysicalDeviceLimits::maxViewportDimensions[0]" + }, + { + "vuid": "VUID-VkViewport-height-01773", + "text": " The absolute value of height must be less than or equal to VkPhysicalDeviceLimits::maxViewportDimensions[1]" + }, + { + "vuid": "VUID-VkViewport-x-01774", + "text": " x must be greater than or equal to viewportBoundsRange[0]" + }, + { + "vuid": "VUID-VkViewport-x-01232", + "text": " (x + width) must be less than or equal to viewportBoundsRange[1]" + }, + { + "vuid": "VUID-VkViewport-y-01775", + "text": " y must be greater than or equal to viewportBoundsRange[0]" + }, + { + "vuid": "VUID-VkViewport-y-01233", + "text": " (y + height) must be less than or equal to viewportBoundsRange[1]" + } + ], + "!(VK_VERSION_1_1,VK_KHR_maintenance1,VK_AMD_negative_viewport_height)": [ + { + "vuid": "VUID-VkViewport-height-01772", + "text": " height must be greater than 0.0" + } + ], + "(VK_VERSION_1_1,VK_KHR_maintenance1,VK_AMD_negative_viewport_height)": [ + { + "vuid": "VUID-VkViewport-y-01776", + "text": " y must be less than or equal to viewportBoundsRange[1]" + }, + { + "vuid": "VUID-VkViewport-y-01777", + "text": " (y + height) must be greater than or equal to viewportBoundsRange[0]" + } + ], + "(VK_EXT_depth_range_unrestricted)": [ + { + "vuid": "VUID-VkViewport-minDepth-01234", + "text": " Unless VK_EXT_depth_range_unrestricted extension is enabled minDepth must be between 0.0 and 1.0, inclusive" + }, + { + "vuid": "VUID-VkViewport-maxDepth-01235", + "text": " Unless VK_EXT_depth_range_unrestricted extension is enabled maxDepth must be between 0.0 and 1.0, inclusive" + } + ], + "!(VK_EXT_depth_range_unrestricted)": [ + { + "vuid": "VUID-VkViewport-minDepth-01234", + "text": " minDepth must be between 0.0 and 1.0, inclusive" + }, + { + "vuid": "VUID-VkViewport-maxDepth-01235", + "text": " maxDepth must be between 0.0 and 1.0, inclusive" + } + ] + }, + "VkPipelineRasterizationStateCreateInfo": { + "core": [ + { + "vuid": "VUID-VkPipelineRasterizationStateCreateInfo-depthClampEnable-00782", + "text": " If the &amp;lt;&amp;lt;features-features-depthClamp,depth clamping&amp;gt;&amp;gt; feature is not enabled, depthClampEnable must be VK_FALSE" + }, + { + "vuid": "VUID-VkPipelineRasterizationStateCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO" + }, + { + "vuid": "VUID-VkPipelineRasterizationStateCreateInfo-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkPipelineRasterizationConservativeStateCreateInfoEXT or VkPipelineRasterizationStateRasterizationOrderAMD" + }, + { + "vuid": "VUID-VkPipelineRasterizationStateCreateInfo-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + }, + { + "vuid": "VUID-VkPipelineRasterizationStateCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkPipelineRasterizationStateCreateInfo-polygonMode-parameter", + "text": " polygonMode must be a valid VkPolygonMode value" + }, + { + "vuid": "VUID-VkPipelineRasterizationStateCreateInfo-cullMode-parameter", + "text": " cullMode must be a valid combination of VkCullModeFlagBits values" + }, + { + "vuid": "VUID-VkPipelineRasterizationStateCreateInfo-frontFace-parameter", + "text": " frontFace must be a valid VkFrontFace value" + } + ], + "!(VK_NV_fill_rectangle)": [ + { + "vuid": "VUID-VkPipelineRasterizationStateCreateInfo-polygonMode-01413", + "text": " If the &amp;lt;&amp;lt;features-features-fillModeNonSolid,non-solid fill modes&amp;gt;&amp;gt; feature is not enabled, polygonMode must be VK_POLYGON_MODE_FILL" + } + ], + "(VK_NV_fill_rectangle)": [ + { + "vuid": "VUID-VkPipelineRasterizationStateCreateInfo-polygonMode-01507", + "text": " If the &amp;lt;&amp;lt;features-features-fillModeNonSolid,non-solid fill modes&amp;gt;&amp;gt; feature is not enabled, polygonMode must be VK_POLYGON_MODE_FILL or VK_POLYGON_MODE_FILL_RECTANGLE_NV" + }, + { + "vuid": "VUID-VkPipelineRasterizationStateCreateInfo-polygonMode-01414", + "text": " If the VK_NV_fill_rectangle extension is not enabled, polygonMode must not be VK_POLYGON_MODE_FILL_RECTANGLE_NV" + } + ] + }, + "VkPipelineMultisampleStateCreateInfo": { + "core": [ + { + "vuid": "VUID-VkPipelineMultisampleStateCreateInfo-sampleShadingEnable-00784", + "text": " If the &amp;lt;&amp;lt;features-features-sampleRateShading,sample rate shading&amp;gt;&amp;gt; feature is not enabled, sampleShadingEnable must be VK_FALSE" + }, + { + "vuid": "VUID-VkPipelineMultisampleStateCreateInfo-alphaToOneEnable-00785", + "text": " If the &amp;lt;&amp;lt;features-features-alphaToOne,alpha to one&amp;gt;&amp;gt; feature is not enabled, alphaToOneEnable must be VK_FALSE" + }, + { + "vuid": "VUID-VkPipelineMultisampleStateCreateInfo-minSampleShading-00786", + "text": " minSampleShading must be in the range [0,1]" + }, + { + "vuid": "VUID-VkPipelineMultisampleStateCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO" + }, + { + "vuid": "VUID-VkPipelineMultisampleStateCreateInfo-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkPipelineCoverageModulationStateCreateInfoNV, VkPipelineCoverageToColorStateCreateInfoNV, or VkPipelineSampleLocationsStateCreateInfoEXT" + }, + { + "vuid": "VUID-VkPipelineMultisampleStateCreateInfo-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + }, + { + "vuid": "VUID-VkPipelineMultisampleStateCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkPipelineMultisampleStateCreateInfo-rasterizationSamples-parameter", + "text": " rasterizationSamples must be a valid VkSampleCountFlagBits value" + }, + { + "vuid": "VUID-VkPipelineMultisampleStateCreateInfo-pSampleMask-parameter", + "text": " If pSampleMask is not NULL, pSampleMask must be a valid pointer to an array of \\(\\lceil{\\mathit{rasterizationSamples} \\over 32}\\rceil\\) VkSampleMask values" + } + ], + "(VK_NV_framebuffer_mixed_samples)": [ + { + "vuid": "VUID-VkPipelineMultisampleStateCreateInfo-rasterizationSamples-01415", + "text": " If the subpass has any color attachments and rasterizationSamples is greater than the number of color samples, then sampleShadingEnable must be VK_FALSE" + } + ] + }, + "VkPipelineRasterizationStateRasterizationOrderAMD": { + "(VK_AMD_rasterization_order)": [ + { + "vuid": "VUID-VkPipelineRasterizationStateRasterizationOrderAMD-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD" + }, + { + "vuid": "VUID-VkPipelineRasterizationStateRasterizationOrderAMD-rasterizationOrder-parameter", + "text": " rasterizationOrder must be a valid VkRasterizationOrderAMD value" + } + ] + }, + "VkPipelineSampleLocationsStateCreateInfoEXT": { + "(VK_EXT_sample_locations)": [ + { + "vuid": "VUID-VkPipelineSampleLocationsStateCreateInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT" + }, + { + "vuid": "VUID-VkPipelineSampleLocationsStateCreateInfoEXT-sampleLocationsInfo-parameter", + "text": " sampleLocationsInfo must be a valid VkSampleLocationsInfoEXT structure" + } + ] + }, + "VkSampleLocationsInfoEXT": { + "(VK_EXT_sample_locations)": [ + { + "vuid": "VUID-VkSampleLocationsInfoEXT-sampleLocationsPerPixel-01526", + "text": " sampleLocationsPerPixel must be a bit value that is set in VkPhysicalDeviceSampleLocationsPropertiesEXT::sampleLocationSampleCounts" + }, + { + "vuid": "VUID-VkSampleLocationsInfoEXT-sampleLocationsCount-01527", + "text": " sampleLocationsCount must equal sampleLocationsPerPixel {times} sampleLocationGridSize.width {times} sampleLocationGridSize.height" + }, + { + "vuid": "VUID-VkSampleLocationsInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT" + }, + { + "vuid": "VUID-VkSampleLocationsInfoEXT-sampleLocationsPerPixel-parameter", + "text": " sampleLocationsPerPixel must be a valid VkSampleCountFlagBits value" + }, + { + "vuid": "VUID-VkSampleLocationsInfoEXT-pSampleLocations-parameter", + "text": " pSampleLocations must be a valid pointer to an array of sampleLocationsCount VkSampleLocationEXT structures" + }, + { + "vuid": "VUID-VkSampleLocationsInfoEXT-sampleLocationsCount-arraylength", + "text": " sampleLocationsCount must be greater than 0" + } + ] + }, + "vkCmdSetSampleLocationsEXT": { + "(VK_EXT_sample_locations)": [ + { + "vuid": "VUID-vkCmdSetSampleLocationsEXT-None-01528", + "text": " The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT dynamic state enabled" + }, + { + "vuid": "VUID-vkCmdSetSampleLocationsEXT-sampleLocationsPerPixel-01529", + "text": " The sampleLocationsPerPixel member of pSampleLocationsInfo must equal the rasterizationSamples member of the VkPipelineMultisampleStateCreateInfo structure the bound graphics pipeline has been created with" + }, + { + "vuid": "VUID-vkCmdSetSampleLocationsEXT-variableSampleLocations-01530", + "text": " If VkPhysicalDeviceSampleLocationsPropertiesEXT::variableSampleLocations is VK_FALSE then the current render pass must have been begun by specifying a VkRenderPassSampleLocationsBeginInfoEXT structure whose pPostSubpassSampleLocations member contains an element with a subpassIndex matching the current subpass index and the sampleLocationsInfo member of that element must match the sample locations state pointed to by pSampleLocationsInfo" + }, + { + "vuid": "VUID-vkCmdSetSampleLocationsEXT-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdSetSampleLocationsEXT-pSampleLocationsInfo-parameter", + "text": " pSampleLocationsInfo must be a valid pointer to a valid VkSampleLocationsInfoEXT structure" + }, + { + "vuid": "VUID-vkCmdSetSampleLocationsEXT-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdSetSampleLocationsEXT-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + } + ] + }, + "vkCmdSetLineWidth": { + "core": [ + { + "vuid": "VUID-vkCmdSetLineWidth-None-00787", + "text": " The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_LINE_WIDTH dynamic state enabled" + }, + { + "vuid": "VUID-vkCmdSetLineWidth-lineWidth-00788", + "text": " If the wide lines feature is not enabled, lineWidth must be 1.0" + }, + { + "vuid": "VUID-vkCmdSetLineWidth-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdSetLineWidth-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdSetLineWidth-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + } + ] + }, + "vkCmdSetDepthBias": { + "core": [ + { + "vuid": "VUID-vkCmdSetDepthBias-None-00789", + "text": " The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_DEPTH_BIAS dynamic state enabled" + }, + { + "vuid": "VUID-vkCmdSetDepthBias-depthBiasClamp-00790", + "text": " If the depth bias clamping feature is not enabled, depthBiasClamp must be 0.0" + }, + { + "vuid": "VUID-vkCmdSetDepthBias-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdSetDepthBias-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdSetDepthBias-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + } + ] + }, + "VkPipelineRasterizationConservativeStateCreateInfoEXT": { + "(VK_EXT_conservative_rasterization)": [ + { + "vuid": "VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-extraPrimitiveOverestimationSize-01769", + "text": " extraPrimitiveOverestimationSize must be in the range of 0.0 to VkPhysicalDeviceConservativeRasterizationPropertiesEXT::maxExtraPrimitiveOverestimationSize inclusive" + }, + { + "vuid": "VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT" + }, + { + "vuid": "VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-conservativeRasterizationMode-parameter", + "text": " conservativeRasterizationMode must be a valid VkConservativeRasterizationModeEXT value" + } + ] + }, + "VkPipelineDiscardRectangleStateCreateInfoEXT": { + "(VK_EXT_discard_rectangles)": [ + { + "vuid": "VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-discardRectangleCount-00582", + "text": " discardRectangleCount must be between 0 and VkPhysicalDeviceDiscardRectanglePropertiesEXT::maxDiscardRectangles, inclusive" + }, + { + "vuid": "VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT" + }, + { + "vuid": "VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-discardRectangleMode-parameter", + "text": " discardRectangleMode must be a valid VkDiscardRectangleModeEXT value" + } + ] + }, + "vkCmdSetDiscardRectangleEXT": { + "(VK_EXT_discard_rectangles)": [ + { + "vuid": "VUID-vkCmdSetDiscardRectangleEXT-None-00583", + "text": " The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT dynamic state enabled" + }, + { + "vuid": "VUID-vkCmdSetDiscardRectangleEXT-firstDiscardRectangle-00585", + "text": " The sum of firstDiscardRectangle and discardRectangleCount must be less than or equal to VkPhysicalDeviceDiscardRectanglePropertiesEXT::maxDiscardRectangles" + }, + { + "vuid": "VUID-vkCmdSetDiscardRectangleEXT-x-00587", + "text": " The x and y member of offset in each VkRect2D element of pDiscardRectangles must be greater than or equal to 0" + }, + { + "vuid": "VUID-vkCmdSetDiscardRectangleEXT-offset-00588", + "text": " Evaluation of (offset.x + extent.width) in each VkRect2D element of pDiscardRectangles must not cause a signed integer addition overflow" + }, + { + "vuid": "VUID-vkCmdSetDiscardRectangleEXT-offset-00589", + "text": " Evaluation of (offset.y + extent.height) in each VkRect2D element of pDiscardRectangles must not cause a signed integer addition overflow" + }, + { + "vuid": "VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdSetDiscardRectangleEXT-pDiscardRectangles-parameter", + "text": " pDiscardRectangles must be a valid pointer to an array of discardRectangleCount VkRect2D structures" + }, + { + "vuid": "VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdSetDiscardRectangleEXT-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdSetDiscardRectangleEXT-discardRectangleCount-arraylength", + "text": " discardRectangleCount must be greater than 0" + } + ] + }, + "vkCmdSetScissor": { + "core": [ + { + "vuid": "VUID-vkCmdSetScissor-None-00590", + "text": " The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_SCISSOR dynamic state enabled" + }, + { + "vuid": "VUID-vkCmdSetScissor-firstScissor-00591", + "text": " firstScissor must be less than VkPhysicalDeviceLimits::maxViewports" + }, + { + "vuid": "VUID-vkCmdSetScissor-firstScissor-00592", + "text": " The sum of firstScissor and scissorCount must be between 1 and VkPhysicalDeviceLimits::maxViewports, inclusive" + }, + { + "vuid": "VUID-vkCmdSetScissor-firstScissor-00593", + "text": " If the multiple viewports feature is not enabled, firstScissor must be 0" + }, + { + "vuid": "VUID-vkCmdSetScissor-scissorCount-00594", + "text": " If the multiple viewports feature is not enabled, scissorCount must be 1" + }, + { + "vuid": "VUID-vkCmdSetScissor-x-00595", + "text": " The x and y members of offset must be greater than or equal to 0" + }, + { + "vuid": "VUID-vkCmdSetScissor-offset-00596", + "text": " Evaluation of (offset.x + extent.width) must not cause a signed integer addition overflow" + }, + { + "vuid": "VUID-vkCmdSetScissor-offset-00597", + "text": " Evaluation of (offset.y + extent.height) must not cause a signed integer addition overflow" + }, + { + "vuid": "VUID-vkCmdSetScissor-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdSetScissor-pScissors-parameter", + "text": " pScissors must be a valid pointer to an array of scissorCount VkRect2D structures" + }, + { + "vuid": "VUID-vkCmdSetScissor-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdSetScissor-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + }, + { + "vuid": "VUID-vkCmdSetScissor-scissorCount-arraylength", + "text": " scissorCount must be greater than 0" + } + ] + }, + "VkPipelineDepthStencilStateCreateInfo": { + "core": [ + { + "vuid": "VUID-VkPipelineDepthStencilStateCreateInfo-depthBoundsTestEnable-00598", + "text": " If the &amp;lt;&amp;lt;features-features-depthBounds,depth bounds testing&amp;gt;&amp;gt; feature is not enabled, depthBoundsTestEnable must be VK_FALSE" + }, + { + "vuid": "VUID-VkPipelineDepthStencilStateCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO" + }, + { + "vuid": "VUID-VkPipelineDepthStencilStateCreateInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkPipelineDepthStencilStateCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkPipelineDepthStencilStateCreateInfo-depthCompareOp-parameter", + "text": " depthCompareOp must be a valid VkCompareOp value" + }, + { + "vuid": "VUID-VkPipelineDepthStencilStateCreateInfo-front-parameter", + "text": " front must be a valid VkStencilOpState structure" + }, + { + "vuid": "VUID-VkPipelineDepthStencilStateCreateInfo-back-parameter", + "text": " back must be a valid VkStencilOpState structure" + } + ] + }, + "vkCmdSetDepthBounds": { + "core": [ + { + "vuid": "VUID-vkCmdSetDepthBounds-None-00599", + "text": " The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_DEPTH_BOUNDS dynamic state enabled" + }, + { + "vuid": "VUID-vkCmdSetDepthBounds-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdSetDepthBounds-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdSetDepthBounds-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + } + ], + "(VK_EXT_depth_range_unrestricted)": [ + { + "vuid": "VUID-vkCmdSetDepthBounds-minDepthBounds-00600", + "text": " Unless the VK_EXT_depth_range_unrestricted extension is enabled minDepthBounds must be between 0.0 and 1.0, inclusive" + }, + { + "vuid": "VUID-vkCmdSetDepthBounds-maxDepthBounds-00601", + "text": " Unless the VK_EXT_depth_range_unrestricted extension is enabled maxDepthBounds must be between 0.0 and 1.0, inclusive" + } + ], + "!(VK_EXT_depth_range_unrestricted)": [ + { + "vuid": "VUID-vkCmdSetDepthBounds-minDepthBounds-00600", + "text": " minDepthBounds must be between 0.0 and 1.0, inclusive" + }, + { + "vuid": "VUID-vkCmdSetDepthBounds-maxDepthBounds-00601", + "text": " maxDepthBounds must be between 0.0 and 1.0, inclusive" + } + ] + }, + "VkStencilOpState": { + "core": [ + { + "vuid": "VUID-VkStencilOpState-failOp-parameter", + "text": " failOp must be a valid VkStencilOp value" + }, + { + "vuid": "VUID-VkStencilOpState-passOp-parameter", + "text": " passOp must be a valid VkStencilOp value" + }, + { + "vuid": "VUID-VkStencilOpState-depthFailOp-parameter", + "text": " depthFailOp must be a valid VkStencilOp value" + }, + { + "vuid": "VUID-VkStencilOpState-compareOp-parameter", + "text": " compareOp must be a valid VkCompareOp value" + } + ] + }, + "vkCmdSetStencilCompareMask": { + "core": [ + { + "vuid": "VUID-vkCmdSetStencilCompareMask-None-00602", + "text": " The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK dynamic state enabled" + }, + { + "vuid": "VUID-vkCmdSetStencilCompareMask-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdSetStencilCompareMask-faceMask-parameter", + "text": " faceMask must be a valid combination of VkStencilFaceFlagBits values" + }, + { + "vuid": "VUID-vkCmdSetStencilCompareMask-faceMask-requiredbitmask", + "text": " faceMask must not be 0" + }, + { + "vuid": "VUID-vkCmdSetStencilCompareMask-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdSetStencilCompareMask-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + } + ] + }, + "vkCmdSetStencilWriteMask": { + "core": [ + { + "vuid": "VUID-vkCmdSetStencilWriteMask-None-00603", + "text": " The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_STENCIL_WRITE_MASK dynamic state enabled" + }, + { + "vuid": "VUID-vkCmdSetStencilWriteMask-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdSetStencilWriteMask-faceMask-parameter", + "text": " faceMask must be a valid combination of VkStencilFaceFlagBits values" + }, + { + "vuid": "VUID-vkCmdSetStencilWriteMask-faceMask-requiredbitmask", + "text": " faceMask must not be 0" + }, + { + "vuid": "VUID-vkCmdSetStencilWriteMask-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdSetStencilWriteMask-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + } + ] + }, + "vkCmdSetStencilReference": { + "core": [ + { + "vuid": "VUID-vkCmdSetStencilReference-None-00604", + "text": " The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_STENCIL_REFERENCE dynamic state enabled" + }, + { + "vuid": "VUID-vkCmdSetStencilReference-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdSetStencilReference-faceMask-parameter", + "text": " faceMask must be a valid combination of VkStencilFaceFlagBits values" + }, + { + "vuid": "VUID-vkCmdSetStencilReference-faceMask-requiredbitmask", + "text": " faceMask must not be 0" + }, + { + "vuid": "VUID-vkCmdSetStencilReference-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdSetStencilReference-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + } + ] + }, + "VkPipelineCoverageToColorStateCreateInfoNV": { + "(VK_NV_fragment_coverage_to_color)": [ + { + "vuid": "VUID-VkPipelineCoverageToColorStateCreateInfoNV-coverageToColorEnable-01404", + "text": " If coverageToColorEnable is VK_TRUE, then the render pass subpass indicated by VkGraphicsPipelineCreateInfo::renderPass and VkGraphicsPipelineCreateInfo::subpass must have a color attachment at the location selected by coverageToColorLocation, with a VkFormat of VK_FORMAT_R8_UINT, VK_FORMAT_R8_SINT, VK_FORMAT_R16_UINT, VK_FORMAT_R16_SINT, VK_FORMAT_R32_UINT, or VK_FORMAT_R32_SINT" + }, + { + "vuid": "VUID-VkPipelineCoverageToColorStateCreateInfoNV-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV" + }, + { + "vuid": "VUID-VkPipelineCoverageToColorStateCreateInfoNV-flags-zerobitmask", + "text": " flags must be 0" + } + ] + }, + "VkPipelineCoverageModulationStateCreateInfoNV": { + "(VK_NV_framebuffer_mixed_samples)": [ + { + "vuid": "VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationTableEnable-01405", + "text": " If coverageModulationTableEnable is VK_TRUE, coverageModulationTableCount must be equal to the number of rasterization samples divided by the number of color samples in the subpass." + }, + { + "vuid": "VUID-VkPipelineCoverageModulationStateCreateInfoNV-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV" + }, + { + "vuid": "VUID-VkPipelineCoverageModulationStateCreateInfoNV-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationMode-parameter", + "text": " coverageModulationMode must be a valid VkCoverageModulationModeNV value" + }, + { + "vuid": "VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationTableCount-arraylength", + "text": " coverageModulationTableCount must be greater than 0" + } + ] + }, + "VkPipelineColorBlendStateCreateInfo": { + "core": [ + { + "vuid": "VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605", + "text": " If the &amp;lt;&amp;lt;features-features-independentBlend,independent blending&amp;gt;&amp;gt; feature is not enabled, all elements of pAttachments must be identical" + }, + { + "vuid": "VUID-VkPipelineColorBlendStateCreateInfo-logicOpEnable-00606", + "text": " If the &amp;lt;&amp;lt;features-features-logicOp,logic operations&amp;gt;&amp;gt; feature is not enabled, logicOpEnable must be VK_FALSE" + }, + { + "vuid": "VUID-VkPipelineColorBlendStateCreateInfo-logicOpEnable-00607", + "text": " If logicOpEnable is VK_TRUE, logicOp must be a valid VkLogicOp value" + }, + { + "vuid": "VUID-VkPipelineColorBlendStateCreateInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO" + }, + { + "vuid": "VUID-VkPipelineColorBlendStateCreateInfo-pNext-pNext", + "text": " pNext must be NULL or a pointer to a valid instance of VkPipelineColorBlendAdvancedStateCreateInfoEXT" + }, + { + "vuid": "VUID-VkPipelineColorBlendStateCreateInfo-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-parameter", + "text": " If attachmentCount is not 0, pAttachments must be a valid pointer to an array of attachmentCount valid VkPipelineColorBlendAttachmentState structures" + } + ] + }, + "VkPipelineColorBlendAttachmentState": { + "core": [ + { + "vuid": "VUID-VkPipelineColorBlendAttachmentState-srcColorBlendFactor-00608", + "text": " If the &amp;lt;&amp;lt;features-features-dualSrcBlend,dual source blending&amp;gt;&amp;gt; feature is not enabled, srcColorBlendFactor must not be VK_BLEND_FACTOR_SRC1_COLOR, VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR, VK_BLEND_FACTOR_SRC1_ALPHA, or VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA" + }, + { + "vuid": "VUID-VkPipelineColorBlendAttachmentState-dstColorBlendFactor-00609", + "text": " If the &amp;lt;&amp;lt;features-features-dualSrcBlend,dual source blending&amp;gt;&amp;gt; feature is not enabled, dstColorBlendFactor must not be VK_BLEND_FACTOR_SRC1_COLOR, VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR, VK_BLEND_FACTOR_SRC1_ALPHA, or VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA" + }, + { + "vuid": "VUID-VkPipelineColorBlendAttachmentState-srcAlphaBlendFactor-00610", + "text": " If the &amp;lt;&amp;lt;features-features-dualSrcBlend,dual source blending&amp;gt;&amp;gt; feature is not enabled, srcAlphaBlendFactor must not be VK_BLEND_FACTOR_SRC1_COLOR, VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR, VK_BLEND_FACTOR_SRC1_ALPHA, or VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA" + }, + { + "vuid": "VUID-VkPipelineColorBlendAttachmentState-dstAlphaBlendFactor-00611", + "text": " If the &amp;lt;&amp;lt;features-features-dualSrcBlend,dual source blending&amp;gt;&amp;gt; feature is not enabled, dstAlphaBlendFactor must not be VK_BLEND_FACTOR_SRC1_COLOR, VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR, VK_BLEND_FACTOR_SRC1_ALPHA, or VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA" + }, + { + "vuid": "VUID-VkPipelineColorBlendAttachmentState-srcColorBlendFactor-parameter", + "text": " srcColorBlendFactor must be a valid VkBlendFactor value" + }, + { + "vuid": "VUID-VkPipelineColorBlendAttachmentState-dstColorBlendFactor-parameter", + "text": " dstColorBlendFactor must be a valid VkBlendFactor value" + }, + { + "vuid": "VUID-VkPipelineColorBlendAttachmentState-colorBlendOp-parameter", + "text": " colorBlendOp must be a valid VkBlendOp value" + }, + { + "vuid": "VUID-VkPipelineColorBlendAttachmentState-srcAlphaBlendFactor-parameter", + "text": " srcAlphaBlendFactor must be a valid VkBlendFactor value" + }, + { + "vuid": "VUID-VkPipelineColorBlendAttachmentState-dstAlphaBlendFactor-parameter", + "text": " dstAlphaBlendFactor must be a valid VkBlendFactor value" + }, + { + "vuid": "VUID-VkPipelineColorBlendAttachmentState-alphaBlendOp-parameter", + "text": " alphaBlendOp must be a valid VkBlendOp value" + }, + { + "vuid": "VUID-VkPipelineColorBlendAttachmentState-colorWriteMask-parameter", + "text": " colorWriteMask must be a valid combination of VkColorComponentFlagBits values" + } + ], + "(VK_EXT_blend_operation_advanced)": [ + { + "vuid": "VUID-VkPipelineColorBlendAttachmentState-colorBlendOp-01406", + "text": " If either of colorBlendOp or alphaBlendOp is an &amp;lt;&amp;lt;framebuffer-blend-advanced,advanced blend operation&amp;gt;&amp;gt;, then colorBlendOp must equal alphaBlendOp" + }, + { + "vuid": "VUID-VkPipelineColorBlendAttachmentState-advancedBlendIndependentBlend-01407", + "text": " If VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT::advancedBlendIndependentBlend is VK_FALSE and colorBlendOp is an &amp;lt;&amp;lt;framebuffer-blend-advanced,advanced blend operation&amp;gt;&amp;gt;, then colorBlendOp must be the same for all attachments." + }, + { + "vuid": "VUID-VkPipelineColorBlendAttachmentState-advancedBlendIndependentBlend-01408", + "text": " If VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT::advancedBlendIndependentBlend is VK_FALSE and alphaBlendOp is an &amp;lt;&amp;lt;framebuffer-blend-advanced,advanced blend operation&amp;gt;&amp;gt;, then alphaBlendOp must be the same for all attachments." + }, + { + "vuid": "VUID-VkPipelineColorBlendAttachmentState-advancedBlendAllOperations-01409", + "text": " If VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT::advancedBlendAllOperations is VK_FALSE, then colorBlendOp must not be VK_BLEND_OP_ZERO_EXT, VK_BLEND_OP_SRC_EXT, VK_BLEND_OP_DST_EXT, VK_BLEND_OP_SRC_OVER_EXT, VK_BLEND_OP_DST_OVER_EXT, VK_BLEND_OP_SRC_IN_EXT, VK_BLEND_OP_DST_IN_EXT, VK_BLEND_OP_SRC_OUT_EXT, VK_BLEND_OP_DST_OUT_EXT, VK_BLEND_OP_SRC_ATOP_EXT, VK_BLEND_OP_DST_ATOP_EXT, VK_BLEND_OP_XOR_EXT, VK_BLEND_OP_INVERT_EXT, VK_BLEND_OP_INVERT_RGB_EXT, VK_BLEND_OP_LINEARDODGE_EXT, VK_BLEND_OP_LINEARBURN_EXT, VK_BLEND_OP_VIVIDLIGHT_EXT, VK_BLEND_OP_LINEARLIGHT_EXT, VK_BLEND_OP_PINLIGHT_EXT, VK_BLEND_OP_HARDMIX_EXT, VK_BLEND_OP_PLUS_EXT, VK_BLEND_OP_PLUS_CLAMPED_EXT, VK_BLEND_OP_PLUS_CLAMPED_ALPHA_EXT, VK_BLEND_OP_PLUS_DARKER_EXT, VK_BLEND_OP_MINUS_EXT, VK_BLEND_OP_MINUS_CLAMPED_EXT, VK_BLEND_OP_CONTRAST_EXT, VK_BLEND_OP_INVERT_OVG_EXT, VK_BLEND_OP_RED_EXT, VK_BLEND_OP_GREEN_EXT, or VK_BLEND_OP_BLUE_EXT" + }, + { + "vuid": "VUID-VkPipelineColorBlendAttachmentState-colorBlendOp-01410", + "text": " If colorBlendOp or alphaBlendOp is an &amp;lt;&amp;lt;framebuffer-blend-advanced,advanced blend operation&amp;gt;&amp;gt;, then VkSubpassDescription::colorAttachmentCount of the subpass this pipeline is compiled against must be less than or equal to VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT::advancedBlendMaxColorAttachments" + } + ] + }, + "vkCmdSetBlendConstants": { + "core": [ + { + "vuid": "VUID-vkCmdSetBlendConstants-None-00612", + "text": " The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_BLEND_CONSTANTS dynamic state enabled" + }, + { + "vuid": "VUID-vkCmdSetBlendConstants-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdSetBlendConstants-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdSetBlendConstants-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics operations" + } + ] + }, + "VkPipelineColorBlendAdvancedStateCreateInfoEXT": { + "(VK_EXT_blend_operation_advanced)": [ + { + "vuid": "VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-srcPremultiplied-01424", + "text": " If the &amp;lt;&amp;lt;features-limits-advancedBlendNonPremultipliedSrcColor,non-premultiplied source color&amp;gt;&amp;gt; property is not supported, srcPremultiplied must be VK_TRUE" + }, + { + "vuid": "VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-dstPremultiplied-01425", + "text": " If the &amp;lt;&amp;lt;features-limits-advancedBlendNonPremultipliedDstColor,non-premultiplied destination color&amp;gt;&amp;gt; property is not supported, dstPremultiplied must be VK_TRUE" + }, + { + "vuid": "VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-blendOverlap-01426", + "text": " If the &amp;lt;&amp;lt;features-limits-advancedBlendCorrelatedOverlap,correlated overlap&amp;gt;&amp;gt; property is not supported, blendOverlap must be VK_BLEND_OVERLAP_UNCORRELATED_EXT" + }, + { + "vuid": "VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT" + }, + { + "vuid": "VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-blendOverlap-parameter", + "text": " blendOverlap must be a valid VkBlendOverlapEXT value" + } + ] + }, + "vkCmdDispatch": { + "core": [ + { + "vuid": "VUID-vkCmdDispatch-groupCountX-00386", + "text": " groupCountX must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[0]" + }, + { + "vuid": "VUID-vkCmdDispatch-groupCountY-00387", + "text": " groupCountY must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[1]" + }, + { + "vuid": "VUID-vkCmdDispatch-groupCountZ-00388", + "text": " groupCountZ must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[2]" + }, + { + "vuid": "VUID-vkCmdDispatch-None-00389", + "text": " For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in &amp;lt;&amp;lt;descriptorsets-compatibility&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDispatch-None-00390", + "text": " Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline" + }, + { + "vuid": "VUID-vkCmdDispatch-None-00391", + "text": " A valid compute pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_COMPUTE" + }, + { + "vuid": "VUID-vkCmdDispatch-None-00392", + "text": " For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE, a push constant value must have been set for VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for push constants with the one used to create the current VkPipeline, as described in &amp;lt;&amp;lt;descriptorsets-compatibility&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDispatch-None-00393", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDispatch-None-00394", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDispatch-None-00395", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDispatch-None-00396", + "text": " If the &amp;lt;&amp;lt;features-features-robustBufferAccess,robust buffer access&amp;gt;&amp;gt; feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set" + }, + { + "vuid": "VUID-vkCmdDispatch-None-00397", + "text": " If the &amp;lt;&amp;lt;features-features-robustBufferAccess,robust buffer access&amp;gt;&amp;gt; feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set" + }, + { + "vuid": "VUID-vkCmdDispatch-linearTilingFeatures-00398", + "text": " Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdDispatch-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdDispatch-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDispatch-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support compute operations" + }, + { + "vuid": "VUID-vkCmdDispatch-renderpass", + "text": " This command must only be called outside of a render pass instance" + } + ], + "(VK_IMG_filter_cubic)": [ + { + "vuid": "VUID-vkCmdDispatch-linearTilingFeatures-00399", + "text": " Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdDispatch-None-00400", + "text": " Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must not have a VkImageViewType of VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY" + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdDispatch-commandBuffer-01844", + "text": " If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_COMPUTE reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer." + }, + { + "vuid": "VUID-vkCmdDispatch-commandBuffer-01845", + "text": " If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_POINT_COMPUTE writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer." + }, + { + "vuid": "VUID-vkCmdDispatch-commandBuffer-01846", + "text": " If commandBuffer is a protected command buffer, and any pipeline stage other than the compute pipeline stage in the VkPipeline object bound to VK_PIPELINE_POINT_COMPUTE reads from any image or buffer, the image or buffer must not be a protected image or protected buffer." + } + ] + }, + "vkCmdDispatchIndirect": { + "core": [ + { + "vuid": "VUID-vkCmdDispatchIndirect-buffer-00401", + "text": " If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-None-00402", + "text": " For each set n that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE, a descriptor set must have been bound to n at VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in &amp;lt;&amp;lt;descriptorsets-compatibility&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-None-00403", + "text": " Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the bound VkPipeline object, specified via vkCmdBindPipeline" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-None-00404", + "text": " A valid compute pipeline must be bound to the current command buffer with VK_PIPELINE_BIND_POINT_COMPUTE" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-buffer-00405", + "text": " buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-offset-00406", + "text": " offset must be a multiple of 4" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-offset-00407", + "text": " The sum of offset and the size of VkDispatchIndirectCommand must be less than or equal to the size of buffer" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-None-00408", + "text": " For each push constant that is statically used by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE, a push constant value must have been set for VK_PIPELINE_BIND_POINT_COMPUTE, with a VkPipelineLayout that is compatible for push constants with the one used to create the current VkPipeline, as described in &amp;lt;&amp;lt;descriptorsets-compatibility&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-None-00409", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used to sample from any VkImage with a VkImageView of the type VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-None-00410", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-None-00411", + "text": " If any VkSampler object that is accessed from a shader by the VkPipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-None-00412", + "text": " If the &amp;lt;&amp;lt;features-features-robustBufferAccess,robust buffer access&amp;gt;&amp;gt; feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-None-00413", + "text": " If the &amp;lt;&amp;lt;features-features-robustBufferAccess,robust buffer access&amp;gt;&amp;gt; feature is not enabled, and any shader stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_COMPUTE accesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-linearTilingFeatures-00414", + "text": " Any VkImageView being sampled with VK_FILTER_LINEAR as a result of this command must be of a format which supports linear filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-buffer-parameter", + "text": " buffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support compute operations" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-renderpass", + "text": " This command must only be called outside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-commonparent", + "text": " Both of buffer, and commandBuffer must have been created, allocated, or retrieved from the same VkDevice" + } + ], + "(VK_IMG_filter_cubic)": [ + { + "vuid": "VUID-vkCmdDispatchIndirect-linearTilingFeatures-00415", + "text": " Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must be of a format which supports cubic filtering, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in VkFormatProperties::linearTilingFeatures (for a linear image) or VkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned by vkGetPhysicalDeviceFormatProperties" + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-None-00416", + "text": " Any VkImageView being sampled with VK_FILTER_CUBIC_IMG as a result of this command must not have a VkImageViewType of VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_CUBE, or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY" + } + ], + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-vkCmdDispatchIndirect-commandBuffer-01847", + "text": " If commandBuffer is an unprotected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_BIND_POINT_COMPUTE reads from or writes to any image or buffer, that image or buffer must not be a protected image or protected buffer." + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-commandBuffer-01848", + "text": " If commandBuffer is a protected command buffer, and any pipeline stage in the VkPipeline object bound to VK_PIPELINE_POINT_COMPUTE writes to any image or buffer, that image or buffer must not be an unprotected image or unprotected buffer." + }, + { + "vuid": "VUID-vkCmdDispatchIndirect-commandBuffer-01849", + "text": " If commandBuffer is a protected command buffer, and any pipeline stage other than the compute pipeline stage in the VkPipeline object bound to VK_PIPELINE_POINT_COMPUTE reads from any image or buffer, the image or buffer must not be a protected image or protected buffer." + } + ] + }, + "VkDispatchIndirectCommand": { + "core": [ + { + "vuid": "VUID-VkDispatchIndirectCommand-x-00417", + "text": " x must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[0]" + }, + { + "vuid": "VUID-VkDispatchIndirectCommand-y-00418", + "text": " y must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[1]" + }, + { + "vuid": "VUID-VkDispatchIndirectCommand-z-00419", + "text": " z must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[2]" + } + ] + }, + "vkCmdDispatchBase": { + "(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-vkCmdDispatchBase-None-00420", + "text": " All valid usage rules from vkCmdDispatch apply" + }, + { + "vuid": "VUID-vkCmdDispatchBase-baseGroupX-00421", + "text": " baseGroupX must be less than VkPhysicalDeviceLimits::maxComputeWorkGroupCount[0]" + }, + { + "vuid": "VUID-vkCmdDispatchBase-baseGroupX-00422", + "text": " baseGroupX must be less than VkPhysicalDeviceLimits::maxComputeWorkGroupCount[1]" + }, + { + "vuid": "VUID-vkCmdDispatchBase-baseGroupZ-00423", + "text": " baseGroupZ must be less than VkPhysicalDeviceLimits::maxComputeWorkGroupCount[2]" + }, + { + "vuid": "VUID-vkCmdDispatchBase-groupCountX-00424", + "text": " groupCountX must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[0] minus baseGroupX" + }, + { + "vuid": "VUID-vkCmdDispatchBase-groupCountY-00425", + "text": " groupCountY must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[1] minus baseGroupY" + }, + { + "vuid": "VUID-vkCmdDispatchBase-groupCountZ-00426", + "text": " groupCountZ must be less than or equal to VkPhysicalDeviceLimits::maxComputeWorkGroupCount[2] minus baseGroupZ" + }, + { + "vuid": "VUID-vkCmdDispatchBase-baseGroupX-00427", + "text": " If any of baseGroupX, baseGroupY, or baseGroupZ are not zero, then the bound compute pipeline must have been created with the VK_PIPELINE_CREATE_DISPATCH_BASE flag." + }, + { + "vuid": "VUID-vkCmdDispatchBase-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdDispatchBase-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDispatchBase-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support compute operations" + }, + { + "vuid": "VUID-vkCmdDispatchBase-renderpass", + "text": " This command must only be called outside of a render pass instance" + } + ] + }, + "vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-pFeatures-parameter", + "text": " pFeatures must be a valid pointer to a VkDeviceGeneratedCommandsFeaturesNVX structure" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX-pLimits-parameter", + "text": " pLimits must be a valid pointer to a VkDeviceGeneratedCommandsLimitsNVX structure" + } + ] + }, + "VkDeviceGeneratedCommandsFeaturesNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-VkDeviceGeneratedCommandsFeaturesNVX-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX" + }, + { + "vuid": "VUID-VkDeviceGeneratedCommandsFeaturesNVX-pNext-pNext", + "text": " pNext must be NULL" + } + ] + }, + "VkDeviceGeneratedCommandsLimitsNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-VkDeviceGeneratedCommandsLimitsNVX-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX" + }, + { + "vuid": "VUID-VkDeviceGeneratedCommandsLimitsNVX-pNext-pNext", + "text": " pNext must be NULL" + } + ] + }, + "vkCreateObjectTableNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-vkCreateObjectTableNVX-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateObjectTableNVX-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkObjectTableCreateInfoNVX structure" + }, + { + "vuid": "VUID-vkCreateObjectTableNVX-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateObjectTableNVX-pObjectTable-parameter", + "text": " pObjectTable must be a valid pointer to a VkObjectTableNVX handle" + } + ] + }, + "VkObjectTableCreateInfoNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-VkObjectTableCreateInfoNVX-computeBindingPointSupport-01355", + "text": " If the VkDeviceGeneratedCommandsFeaturesNVX::computeBindingPointSupport feature is not enabled, pObjectEntryUsageFlags must not contain VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX" + }, + { + "vuid": "VUID-VkObjectTableCreateInfoNVX-pObjectEntryCounts-01356", + "text": " Any value within pObjectEntryCounts must not exceed VkDeviceGeneratedCommandsLimitsNVX::maxObjectEntryCounts" + }, + { + "vuid": "VUID-VkObjectTableCreateInfoNVX-maxUniformBuffersPerDescriptor-01357", + "text": " maxUniformBuffersPerDescriptor must be within the limits supported by the device." + }, + { + "vuid": "VUID-VkObjectTableCreateInfoNVX-maxStorageBuffersPerDescriptor-01358", + "text": " maxStorageBuffersPerDescriptor must be within the limits supported by the device." + }, + { + "vuid": "VUID-VkObjectTableCreateInfoNVX-maxStorageImagesPerDescriptor-01359", + "text": " maxStorageImagesPerDescriptor must be within the limits supported by the device." + }, + { + "vuid": "VUID-VkObjectTableCreateInfoNVX-maxSampledImagesPerDescriptor-01360", + "text": " maxSampledImagesPerDescriptor must be within the limits supported by the device." + }, + { + "vuid": "VUID-VkObjectTableCreateInfoNVX-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX" + }, + { + "vuid": "VUID-VkObjectTableCreateInfoNVX-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkObjectTableCreateInfoNVX-pObjectEntryTypes-parameter", + "text": " pObjectEntryTypes must be a valid pointer to an array of objectCount valid VkObjectEntryTypeNVX values" + }, + { + "vuid": "VUID-VkObjectTableCreateInfoNVX-pObjectEntryCounts-parameter", + "text": " pObjectEntryCounts must be a valid pointer to an array of objectCount uint32_t values" + }, + { + "vuid": "VUID-VkObjectTableCreateInfoNVX-pObjectEntryUsageFlags-parameter", + "text": " pObjectEntryUsageFlags must be a valid pointer to an array of objectCount valid combinations of VkObjectEntryUsageFlagBitsNVX values" + }, + { + "vuid": "VUID-VkObjectTableCreateInfoNVX-pObjectEntryUsageFlags-requiredbitmask", + "text": " Each element of pObjectEntryUsageFlags must not be 0" + }, + { + "vuid": "VUID-VkObjectTableCreateInfoNVX-objectCount-arraylength", + "text": " objectCount must be greater than 0" + } + ] + }, + "vkDestroyObjectTableNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-vkDestroyObjectTableNVX-objectTable-01361", + "text": " All submitted commands that refer to objectTable must have completed execution." + }, + { + "vuid": "VUID-vkDestroyObjectTableNVX-objectTable-01362", + "text": " If VkAllocationCallbacks were provided when objectTable was created, a compatible set of callbacks must be provided here." + }, + { + "vuid": "VUID-vkDestroyObjectTableNVX-objectTable-01363", + "text": " If no VkAllocationCallbacks were provided when objectTable was created, pAllocator must be NULL." + }, + { + "vuid": "VUID-vkDestroyObjectTableNVX-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyObjectTableNVX-objectTable-parameter", + "text": " objectTable must be a valid VkObjectTableNVX handle" + }, + { + "vuid": "VUID-vkDestroyObjectTableNVX-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyObjectTableNVX-objectTable-parent", + "text": " objectTable must have been created, allocated, or retrieved from device" + } + ] + }, + "vkRegisterObjectsNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-vkRegisterObjectsNVX-pObjectTableEntry-01364", + "text": " The contents of pObjectTableEntry must yield plausible bindings supported by the device." + }, + { + "vuid": "VUID-vkRegisterObjectsNVX-pObjectIndices-01365", + "text": " At any pObjectIndices there must not be a registered resource already." + }, + { + "vuid": "VUID-vkRegisterObjectsNVX-pObjectIndices-01366", + "text": " Any value inside pObjectIndices must be below the appropriate VkObjectTableCreateInfoNVX::pObjectEntryCounts limits provided at objectTable creation time." + }, + { + "vuid": "VUID-vkRegisterObjectsNVX-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkRegisterObjectsNVX-objectTable-parameter", + "text": " objectTable must be a valid VkObjectTableNVX handle" + }, + { + "vuid": "VUID-vkRegisterObjectsNVX-ppObjectTableEntries-parameter", + "text": " ppObjectTableEntries must be a valid pointer to an array of objectCount valid VkObjectTableEntryNVX structures" + }, + { + "vuid": "VUID-vkRegisterObjectsNVX-pObjectIndices-parameter", + "text": " pObjectIndices must be a valid pointer to an array of objectCount uint32_t values" + }, + { + "vuid": "VUID-vkRegisterObjectsNVX-objectCount-arraylength", + "text": " objectCount must be greater than 0" + }, + { + "vuid": "VUID-vkRegisterObjectsNVX-objectTable-parent", + "text": " objectTable must have been created, allocated, or retrieved from device" + } + ] + }, + "VkObjectTableEntryNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-VkObjectTableEntryNVX-computeBindingPointSupport-01367", + "text": " If the VkDeviceGeneratedCommandsFeaturesNVX::computeBindingPointSupport feature is not enabled, flags must not contain VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX" + }, + { + "vuid": "VUID-VkObjectTableEntryNVX-type-parameter", + "text": " type must be a valid VkObjectEntryTypeNVX value" + }, + { + "vuid": "VUID-VkObjectTableEntryNVX-flags-parameter", + "text": " flags must be a valid combination of VkObjectEntryUsageFlagBitsNVX values" + }, + { + "vuid": "VUID-VkObjectTableEntryNVX-flags-requiredbitmask", + "text": " flags must not be 0" + } + ] + }, + "VkObjectTablePipelineEntryNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-VkObjectTablePipelineEntryNVX-type-01368", + "text": " type must be VK_OBJECT_ENTRY_TYPE_PIPELINE_NVX" + }, + { + "vuid": "VUID-VkObjectTablePipelineEntryNVX-type-parameter", + "text": " type must be a valid VkObjectEntryTypeNVX value" + }, + { + "vuid": "VUID-VkObjectTablePipelineEntryNVX-flags-parameter", + "text": " flags must be a valid combination of VkObjectEntryUsageFlagBitsNVX values" + }, + { + "vuid": "VUID-VkObjectTablePipelineEntryNVX-flags-requiredbitmask", + "text": " flags must not be 0" + }, + { + "vuid": "VUID-VkObjectTablePipelineEntryNVX-pipeline-parameter", + "text": " pipeline must be a valid VkPipeline handle" + } + ] + }, + "VkObjectTableDescriptorSetEntryNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-VkObjectTableDescriptorSetEntryNVX-type-01369", + "text": " type must be VK_OBJECT_ENTRY_TYPE_DESCRIPTOR_SET_NVX" + }, + { + "vuid": "VUID-VkObjectTableDescriptorSetEntryNVX-type-parameter", + "text": " type must be a valid VkObjectEntryTypeNVX value" + }, + { + "vuid": "VUID-VkObjectTableDescriptorSetEntryNVX-flags-parameter", + "text": " flags must be a valid combination of VkObjectEntryUsageFlagBitsNVX values" + }, + { + "vuid": "VUID-VkObjectTableDescriptorSetEntryNVX-flags-requiredbitmask", + "text": " flags must not be 0" + }, + { + "vuid": "VUID-VkObjectTableDescriptorSetEntryNVX-pipelineLayout-parameter", + "text": " pipelineLayout must be a valid VkPipelineLayout handle" + }, + { + "vuid": "VUID-VkObjectTableDescriptorSetEntryNVX-descriptorSet-parameter", + "text": " descriptorSet must be a valid VkDescriptorSet handle" + }, + { + "vuid": "VUID-VkObjectTableDescriptorSetEntryNVX-commonparent", + "text": " Both of descriptorSet, and pipelineLayout must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "VkObjectTableVertexBufferEntryNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-VkObjectTableVertexBufferEntryNVX-type-01370", + "text": " type must be VK_OBJECT_ENTRY_TYPE_VERTEX_BUFFER_NVX" + }, + { + "vuid": "VUID-VkObjectTableVertexBufferEntryNVX-type-parameter", + "text": " type must be a valid VkObjectEntryTypeNVX value" + }, + { + "vuid": "VUID-VkObjectTableVertexBufferEntryNVX-flags-parameter", + "text": " flags must be a valid combination of VkObjectEntryUsageFlagBitsNVX values" + }, + { + "vuid": "VUID-VkObjectTableVertexBufferEntryNVX-flags-requiredbitmask", + "text": " flags must not be 0" + }, + { + "vuid": "VUID-VkObjectTableVertexBufferEntryNVX-buffer-parameter", + "text": " buffer must be a valid VkBuffer handle" + } + ] + }, + "VkObjectTableIndexBufferEntryNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-VkObjectTableIndexBufferEntryNVX-type-01371", + "text": " type must be VK_OBJECT_ENTRY_TYPE_INDEX_BUFFER_NVX" + }, + { + "vuid": "VUID-VkObjectTableIndexBufferEntryNVX-type-parameter", + "text": " type must be a valid VkObjectEntryTypeNVX value" + }, + { + "vuid": "VUID-VkObjectTableIndexBufferEntryNVX-flags-parameter", + "text": " flags must be a valid combination of VkObjectEntryUsageFlagBitsNVX values" + }, + { + "vuid": "VUID-VkObjectTableIndexBufferEntryNVX-flags-requiredbitmask", + "text": " flags must not be 0" + }, + { + "vuid": "VUID-VkObjectTableIndexBufferEntryNVX-buffer-parameter", + "text": " buffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-VkObjectTableIndexBufferEntryNVX-indexType-parameter", + "text": " indexType must be a valid VkIndexType value" + } + ] + }, + "VkObjectTablePushConstantEntryNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-VkObjectTablePushConstantEntryNVX-type-01372", + "text": " type must be VK_OBJECT_ENTRY_TYPE_PUSH_CONSTANT_NVX" + }, + { + "vuid": "VUID-VkObjectTablePushConstantEntryNVX-type-parameter", + "text": " type must be a valid VkObjectEntryTypeNVX value" + }, + { + "vuid": "VUID-VkObjectTablePushConstantEntryNVX-flags-parameter", + "text": " flags must be a valid combination of VkObjectEntryUsageFlagBitsNVX values" + }, + { + "vuid": "VUID-VkObjectTablePushConstantEntryNVX-flags-requiredbitmask", + "text": " flags must not be 0" + }, + { + "vuid": "VUID-VkObjectTablePushConstantEntryNVX-pipelineLayout-parameter", + "text": " pipelineLayout must be a valid VkPipelineLayout handle" + }, + { + "vuid": "VUID-VkObjectTablePushConstantEntryNVX-stageFlags-parameter", + "text": " stageFlags must be a valid combination of VkShaderStageFlagBits values" + }, + { + "vuid": "VUID-VkObjectTablePushConstantEntryNVX-stageFlags-requiredbitmask", + "text": " stageFlags must not be 0" + } + ] + }, + "vkUnregisterObjectsNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-vkUnregisterObjectsNVX-pObjectIndices-01373", + "text": " At any pObjectIndices there must be a registered resource already." + }, + { + "vuid": "VUID-vkUnregisterObjectsNVX-pObjectEntryTypes-01374", + "text": " The pObjectEntryTypes of the resource at pObjectIndices must match." + }, + { + "vuid": "VUID-vkUnregisterObjectsNVX-None-01375", + "text": " All operations on the device using the registered resource must have been completed." + }, + { + "vuid": "VUID-vkUnregisterObjectsNVX-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkUnregisterObjectsNVX-objectTable-parameter", + "text": " objectTable must be a valid VkObjectTableNVX handle" + }, + { + "vuid": "VUID-vkUnregisterObjectsNVX-pObjectEntryTypes-parameter", + "text": " pObjectEntryTypes must be a valid pointer to an array of objectCount valid VkObjectEntryTypeNVX values" + }, + { + "vuid": "VUID-vkUnregisterObjectsNVX-pObjectIndices-parameter", + "text": " pObjectIndices must be a valid pointer to an array of objectCount uint32_t values" + }, + { + "vuid": "VUID-vkUnregisterObjectsNVX-objectCount-arraylength", + "text": " objectCount must be greater than 0" + }, + { + "vuid": "VUID-vkUnregisterObjectsNVX-objectTable-parent", + "text": " objectTable must have been created, allocated, or retrieved from device" + } + ] + }, + "VkIndirectCommandsLayoutTokenNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-VkIndirectCommandsLayoutTokenNVX-bindingUnit-01342", + "text": " bindingUnit must stay within device supported limits for the appropriate commands." + }, + { + "vuid": "VUID-VkIndirectCommandsLayoutTokenNVX-dynamicCount-01343", + "text": " dynamicCount must stay within device supported limits for the appropriate commands." + }, + { + "vuid": "VUID-VkIndirectCommandsLayoutTokenNVX-divisor-01344", + "text": " divisor must be greater than 0 and a power of two." + }, + { + "vuid": "VUID-VkIndirectCommandsLayoutTokenNVX-tokenType-parameter", + "text": " tokenType must be a valid VkIndirectCommandsTokenTypeNVX value" + } + ] + }, + "VkIndirectCommandsTokenNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-VkIndirectCommandsTokenNVX-buffer-01345", + "text": " The buffer’s usage flag must have the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set." + }, + { + "vuid": "VUID-VkIndirectCommandsTokenNVX-offset-01346", + "text": " The offset must be aligned to VkDeviceGeneratedCommandsLimitsNVX::minCommandsTokenBufferOffsetAlignment." + }, + { + "vuid": "VUID-VkIndirectCommandsTokenNVX-tokenType-parameter", + "text": " tokenType must be a valid VkIndirectCommandsTokenTypeNVX value" + }, + { + "vuid": "VUID-VkIndirectCommandsTokenNVX-buffer-parameter", + "text": " buffer must be a valid VkBuffer handle" + } + ] + }, + "vkCreateIndirectCommandsLayoutNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-vkCreateIndirectCommandsLayoutNVX-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateIndirectCommandsLayoutNVX-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkIndirectCommandsLayoutCreateInfoNVX structure" + }, + { + "vuid": "VUID-vkCreateIndirectCommandsLayoutNVX-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateIndirectCommandsLayoutNVX-pIndirectCommandsLayout-parameter", + "text": " pIndirectCommandsLayout must be a valid pointer to a VkIndirectCommandsLayoutNVX handle" + } + ] + }, + "VkIndirectCommandsLayoutCreateInfoNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-VkIndirectCommandsLayoutCreateInfoNVX-tokenCount-01347", + "text": " tokenCount must be greater than 0 and below VkDeviceGeneratedCommandsLimitsNVX::maxIndirectCommandsLayoutTokenCount" + }, + { + "vuid": "VUID-VkIndirectCommandsLayoutCreateInfoNVX-computeBindingPointSupport-01348", + "text": " If the VkDeviceGeneratedCommandsFeaturesNVX::computeBindingPointSupport feature is not enabled, then pipelineBindPoint must not be VK_PIPELINE_BIND_POINT_COMPUTE" + }, + { + "vuid": "VUID-VkIndirectCommandsLayoutCreateInfoNVX-pTokens-01349", + "text": " If pTokens contains an entry of VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NVX it must be the first element of the array and there must be only a single element of such token type." + }, + { + "vuid": "VUID-VkIndirectCommandsLayoutCreateInfoNVX-pTokens-01350", + "text": " All state binding tokens in pTokens must occur prior work provoking tokens (VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_NVX, VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_NVX, VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NVX)." + }, + { + "vuid": "VUID-VkIndirectCommandsLayoutCreateInfoNVX-pTokens-01351", + "text": " The content of pTokens must include one single work provoking token that is compatible with the pipelineBindPoint." + }, + { + "vuid": "VUID-VkIndirectCommandsLayoutCreateInfoNVX-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX" + }, + { + "vuid": "VUID-VkIndirectCommandsLayoutCreateInfoNVX-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkIndirectCommandsLayoutCreateInfoNVX-pipelineBindPoint-parameter", + "text": " pipelineBindPoint must be a valid VkPipelineBindPoint value" + }, + { + "vuid": "VUID-VkIndirectCommandsLayoutCreateInfoNVX-flags-parameter", + "text": " flags must be a valid combination of VkIndirectCommandsLayoutUsageFlagBitsNVX values" + }, + { + "vuid": "VUID-VkIndirectCommandsLayoutCreateInfoNVX-flags-requiredbitmask", + "text": " flags must not be 0" + }, + { + "vuid": "VUID-VkIndirectCommandsLayoutCreateInfoNVX-pTokens-parameter", + "text": " pTokens must be a valid pointer to an array of tokenCount valid VkIndirectCommandsLayoutTokenNVX structures" + }, + { + "vuid": "VUID-VkIndirectCommandsLayoutCreateInfoNVX-tokenCount-arraylength", + "text": " tokenCount must be greater than 0" + } + ] + }, + "vkDestroyIndirectCommandsLayoutNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-01352", + "text": " All submitted commands that refer to indirectCommandsLayout must have completed execution" + }, + { + "vuid": "VUID-vkDestroyIndirectCommandsLayoutNVX-objectTable-01353", + "text": " If VkAllocationCallbacks were provided when objectTable was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyIndirectCommandsLayoutNVX-objectTable-01354", + "text": " If no VkAllocationCallbacks were provided when objectTable was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyIndirectCommandsLayoutNVX-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-parameter", + "text": " indirectCommandsLayout must be a valid VkIndirectCommandsLayoutNVX handle" + }, + { + "vuid": "VUID-vkDestroyIndirectCommandsLayoutNVX-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyIndirectCommandsLayoutNVX-indirectCommandsLayout-parent", + "text": " indirectCommandsLayout must have been created, allocated, or retrieved from device" + } + ] + }, + "vkCmdReserveSpaceForCommandsNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-01329", + "text": " The provided commandBuffer must not have had a prior space reservation since its creation or the last reset." + }, + { + "vuid": "VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-01330", + "text": " The state of the commandBuffer must be legal to execute all commands within the sequence provided by the indirectCommandsLayout member of pProcessCommandsInfo." + }, + { + "vuid": "VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdReserveSpaceForCommandsNVX-pReserveSpaceInfo-parameter", + "text": " pReserveSpaceInfo must be a valid pointer to a valid VkCmdReserveSpaceForCommandsInfoNVX structure" + }, + { + "vuid": "VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdReserveSpaceForCommandsNVX-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdReserveSpaceForCommandsNVX-renderpass", + "text": " This command must only be called inside of a render pass instance" + }, + { + "vuid": "VUID-vkCmdReserveSpaceForCommandsNVX-bufferlevel", + "text": " commandBuffer must be a secondary VkCommandBuffer" + } + ] + }, + "VkCmdReserveSpaceForCommandsInfoNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-VkCmdReserveSpaceForCommandsInfoNVX-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX" + }, + { + "vuid": "VUID-VkCmdReserveSpaceForCommandsInfoNVX-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkCmdReserveSpaceForCommandsInfoNVX-objectTable-parameter", + "text": " objectTable must be a valid VkObjectTableNVX handle" + }, + { + "vuid": "VUID-VkCmdReserveSpaceForCommandsInfoNVX-indirectCommandsLayout-parameter", + "text": " indirectCommandsLayout must be a valid VkIndirectCommandsLayoutNVX handle" + }, + { + "vuid": "VUID-VkCmdReserveSpaceForCommandsInfoNVX-commonparent", + "text": " Both of indirectCommandsLayout, and objectTable must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "vkCmdProcessCommandsNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-vkCmdProcessCommandsNVX-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdProcessCommandsNVX-pProcessCommandsInfo-parameter", + "text": " pProcessCommandsInfo must be a valid pointer to a valid VkCmdProcessCommandsInfoNVX structure" + }, + { + "vuid": "VUID-vkCmdProcessCommandsNVX-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdProcessCommandsNVX-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + }, + { + "vuid": "VUID-vkCmdProcessCommandsNVX-renderpass", + "text": " This command must only be called inside of a render pass instance" + } + ] + }, + "VkCmdProcessCommandsInfoNVX": { + "(VK_NVX_device_generated_commands)": [ + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-objectTable-01331", + "text": " The provided objectTable must include all objects referenced by the generation process." + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsTokenCount-01332", + "text": " indirectCommandsTokenCount must match the indirectCommandsLayout’s tokenCount." + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-tokenType-01333", + "text": " The tokenType member of each entry in the pIndirectCommandsTokens array must match the values used at creation time of indirectCommandsLayout" + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01334", + "text": " If targetCommandBuffer is provided, it must have reserved command space." + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01335", + "text": " If targetCommandBuffer is provided, the objectTable must match the reservation’s objectTable and must have had all referenced objects registered at reservation time." + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01336", + "text": " If targetCommandBuffer is provided, the indirectCommandsLayout must match the reservation’s indirectCommandsLayout." + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-01337", + "text": " If targetCommandBuffer is provided, the maxSequencesCount must not exceed the reservation’s maxSequencesCount." + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-01338", + "text": " If sequencesCountBuffer is used, its usage flag must have VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set." + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-01339", + "text": " If sequencesCountBuffer is used, sequencesCountOffset must be aligned to VkDeviceGeneratedCommandsLimitsNVX::minSequenceCountBufferOffsetAlignment." + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-01340", + "text": " If sequencesIndexBuffer is used, its usage flag must have VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set." + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-01341", + "text": " If sequencesIndexBuffer is used, sequencesIndexOffset must be aligned to VkDeviceGeneratedCommandsLimitsNVX::minSequenceIndexBufferOffsetAlignment." + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX" + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-objectTable-parameter", + "text": " objectTable must be a valid VkObjectTableNVX handle" + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsLayout-parameter", + "text": " indirectCommandsLayout must be a valid VkIndirectCommandsLayoutNVX handle" + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-pIndirectCommandsTokens-parameter", + "text": " pIndirectCommandsTokens must be a valid pointer to an array of indirectCommandsTokenCount valid VkIndirectCommandsTokenNVX structures" + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-targetCommandBuffer-parameter", + "text": " If targetCommandBuffer is not NULL, targetCommandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-sequencesCountBuffer-parameter", + "text": " If sequencesCountBuffer is not VK_NULL_HANDLE, sequencesCountBuffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-sequencesIndexBuffer-parameter", + "text": " If sequencesIndexBuffer is not VK_NULL_HANDLE, sequencesIndexBuffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-indirectCommandsTokenCount-arraylength", + "text": " indirectCommandsTokenCount must be greater than 0" + }, + { + "vuid": "VUID-VkCmdProcessCommandsInfoNVX-commonparent", + "text": " Each of indirectCommandsLayout, objectTable, sequencesCountBuffer, sequencesIndexBuffer, and targetCommandBuffer that are valid handles must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "vkGetPhysicalDeviceSparseImageFormatProperties": { + "core": [ + { + "vuid": "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-samples-01094", + "text": " samples must be a bit value that is set in VkImageFormatProperties::sampleCounts returned by vkGetPhysicalDeviceImageFormatProperties with format, type, tiling, and usage equal to those in this command and flags equal to the value that is set in VkImageCreateInfo::flags when the image is created" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-format-parameter", + "text": " format must be a valid VkFormat value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-type-parameter", + "text": " type must be a valid VkImageType value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-samples-parameter", + "text": " samples must be a valid VkSampleCountFlagBits value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-usage-parameter", + "text": " usage must be a valid combination of VkImageUsageFlagBits values" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-usage-requiredbitmask", + "text": " usage must not be 0" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-tiling-parameter", + "text": " tiling must be a valid VkImageTiling value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-pPropertyCount-parameter", + "text": " pPropertyCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-pProperties-parameter", + "text": " If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkSparseImageFormatProperties structures" + } + ] + }, + "vkGetPhysicalDeviceSparseImageFormatProperties2": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-pFormatInfo-parameter", + "text": " pFormatInfo must be a valid pointer to a valid VkPhysicalDeviceSparseImageFormatInfo2 structure" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-pPropertyCount-parameter", + "text": " pPropertyCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-pProperties-parameter", + "text": " If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkSparseImageFormatProperties2 structures" + } + ] + }, + "VkPhysicalDeviceSparseImageFormatInfo2": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-VkPhysicalDeviceSparseImageFormatInfo2-samples-01095", + "text": " samples must be a bit value that is set in VkImageFormatProperties::sampleCounts returned by vkGetPhysicalDeviceImageFormatProperties with format, type, tiling, and usage equal to those in this command and flags equal to the value that is set in VkImageCreateInfo::flags when the image is created" + }, + { + "vuid": "VUID-VkPhysicalDeviceSparseImageFormatInfo2-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2" + }, + { + "vuid": "VUID-VkPhysicalDeviceSparseImageFormatInfo2-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkPhysicalDeviceSparseImageFormatInfo2-format-parameter", + "text": " format must be a valid VkFormat value" + }, + { + "vuid": "VUID-VkPhysicalDeviceSparseImageFormatInfo2-type-parameter", + "text": " type must be a valid VkImageType value" + }, + { + "vuid": "VUID-VkPhysicalDeviceSparseImageFormatInfo2-samples-parameter", + "text": " samples must be a valid VkSampleCountFlagBits value" + }, + { + "vuid": "VUID-VkPhysicalDeviceSparseImageFormatInfo2-usage-parameter", + "text": " usage must be a valid combination of VkImageUsageFlagBits values" + }, + { + "vuid": "VUID-VkPhysicalDeviceSparseImageFormatInfo2-usage-requiredbitmask", + "text": " usage must not be 0" + }, + { + "vuid": "VUID-VkPhysicalDeviceSparseImageFormatInfo2-tiling-parameter", + "text": " tiling must be a valid VkImageTiling value" + } + ] + }, + "VkSparseImageFormatProperties2": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-VkSparseImageFormatProperties2-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2" + }, + { + "vuid": "VUID-VkSparseImageFormatProperties2-pNext-pNext", + "text": " pNext must be NULL" + } + ] + }, + "vkGetImageSparseMemoryRequirements": { + "core": [ + { + "vuid": "VUID-vkGetImageSparseMemoryRequirements-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetImageSparseMemoryRequirements-image-parameter", + "text": " image must be a valid VkImage handle" + }, + { + "vuid": "VUID-vkGetImageSparseMemoryRequirements-pSparseMemoryRequirementCount-parameter", + "text": " pSparseMemoryRequirementCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkGetImageSparseMemoryRequirements-pSparseMemoryRequirements-parameter", + "text": " If the value referenced by pSparseMemoryRequirementCount is not 0, and pSparseMemoryRequirements is not NULL, pSparseMemoryRequirements must be a valid pointer to an array of pSparseMemoryRequirementCount VkSparseImageMemoryRequirements structures" + }, + { + "vuid": "VUID-vkGetImageSparseMemoryRequirements-image-parent", + "text": " image must have been created, allocated, or retrieved from device" + } + ] + }, + "vkGetImageSparseMemoryRequirements2": { + "(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)": [ + { + "vuid": "VUID-vkGetImageSparseMemoryRequirements2-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetImageSparseMemoryRequirements2-pInfo-parameter", + "text": " pInfo must be a valid pointer to a valid VkImageSparseMemoryRequirementsInfo2 structure" + }, + { + "vuid": "VUID-vkGetImageSparseMemoryRequirements2-pSparseMemoryRequirementCount-parameter", + "text": " pSparseMemoryRequirementCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkGetImageSparseMemoryRequirements2-pSparseMemoryRequirements-parameter", + "text": " If the value referenced by pSparseMemoryRequirementCount is not 0, and pSparseMemoryRequirements is not NULL, pSparseMemoryRequirements must be a valid pointer to an array of pSparseMemoryRequirementCount VkSparseImageMemoryRequirements2 structures" + } + ] + }, + "VkImageSparseMemoryRequirementsInfo2": { + "(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)": [ + { + "vuid": "VUID-VkImageSparseMemoryRequirementsInfo2-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2" + }, + { + "vuid": "VUID-VkImageSparseMemoryRequirementsInfo2-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkImageSparseMemoryRequirementsInfo2-image-parameter", + "text": " image must be a valid VkImage handle" + } + ] + }, + "VkSparseImageMemoryRequirements2": { + "(VK_VERSION_1_1,VK_KHR_get_memory_requirements2)": [ + { + "vuid": "VUID-VkSparseImageMemoryRequirements2-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2" + }, + { + "vuid": "VUID-VkSparseImageMemoryRequirements2-pNext-pNext", + "text": " pNext must be NULL" + } + ] + }, + "VkSparseMemoryBind": { + "core": [ + { + "vuid": "VUID-VkSparseMemoryBind-memory-01096", + "text": " If memory is not VK_NULL_HANDLE, memory and memoryOffset must match the memory requirements of the resource, as described in section &amp;lt;&amp;lt;resources-association&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-VkSparseMemoryBind-memory-01097", + "text": " If memory is not VK_NULL_HANDLE, memory must not have been created with a memory type that reports VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT bit set" + }, + { + "vuid": "VUID-VkSparseMemoryBind-size-01098", + "text": " size must be greater than 0" + }, + { + "vuid": "VUID-VkSparseMemoryBind-resourceOffset-01099", + "text": " resourceOffset must be less than the size of the resource" + }, + { + "vuid": "VUID-VkSparseMemoryBind-size-01100", + "text": " size must be less than or equal to the size of the resource minus resourceOffset" + }, + { + "vuid": "VUID-VkSparseMemoryBind-memoryOffset-01101", + "text": " memoryOffset must be less than the size of memory" + }, + { + "vuid": "VUID-VkSparseMemoryBind-size-01102", + "text": " size must be less than or equal to the size of memory minus memoryOffset" + }, + { + "vuid": "VUID-VkSparseMemoryBind-memory-parameter", + "text": " If memory is not VK_NULL_HANDLE, memory must be a valid VkDeviceMemory handle" + }, + { + "vuid": "VUID-VkSparseMemoryBind-flags-parameter", + "text": " flags must be a valid combination of VkSparseMemoryBindFlagBits values" + } + ] + }, + "VkSparseBufferMemoryBindInfo": { + "core": [ + { + "vuid": "VUID-VkSparseBufferMemoryBindInfo-buffer-parameter", + "text": " buffer must be a valid VkBuffer handle" + }, + { + "vuid": "VUID-VkSparseBufferMemoryBindInfo-pBinds-parameter", + "text": " pBinds must be a valid pointer to an array of bindCount valid VkSparseMemoryBind structures" + }, + { + "vuid": "VUID-VkSparseBufferMemoryBindInfo-bindCount-arraylength", + "text": " bindCount must be greater than 0" + } + ] + }, + "VkSparseImageOpaqueMemoryBindInfo": { + "core": [ + { + "vuid": "VUID-VkSparseImageOpaqueMemoryBindInfo-pBinds-01103", + "text": " If the flags member of any element of pBinds contains VK_SPARSE_MEMORY_BIND_METADATA_BIT, the binding range defined must be within the mip tail region of the metadata aspect of image" + }, + { + "vuid": "VUID-VkSparseImageOpaqueMemoryBindInfo-image-parameter", + "text": " image must be a valid VkImage handle" + }, + { + "vuid": "VUID-VkSparseImageOpaqueMemoryBindInfo-pBinds-parameter", + "text": " pBinds must be a valid pointer to an array of bindCount valid VkSparseMemoryBind structures" + }, + { + "vuid": "VUID-VkSparseImageOpaqueMemoryBindInfo-bindCount-arraylength", + "text": " bindCount must be greater than 0" + } + ] + }, + "VkSparseImageMemoryBindInfo": { + "core": [ + { + "vuid": "VUID-VkSparseImageMemoryBindInfo-subresource-01722", + "text": " The subresource.mipLevel member of each element of pBinds must be less than the mipLevels specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-VkSparseImageMemoryBindInfo-subresource-01723", + "text": " The subresource.arrayLayer member of each element of pBinds must be less than the arrayLayers specified in VkImageCreateInfo when image was created" + }, + { + "vuid": "VUID-VkSparseImageMemoryBindInfo-image-parameter", + "text": " image must be a valid VkImage handle" + }, + { + "vuid": "VUID-VkSparseImageMemoryBindInfo-pBinds-parameter", + "text": " pBinds must be a valid pointer to an array of bindCount valid VkSparseImageMemoryBind structures" + }, + { + "vuid": "VUID-VkSparseImageMemoryBindInfo-bindCount-arraylength", + "text": " bindCount must be greater than 0" + } + ] + }, + "VkSparseImageMemoryBind": { + "core": [ + { + "vuid": "VUID-VkSparseImageMemoryBind-memory-01104", + "text": " If the &amp;lt;&amp;lt;features-features-sparseResidencyAliased,sparse aliased residency&amp;gt;&amp;gt; feature is not enabled, and if any other resources are bound to ranges of memory, the range of memory being bound must not overlap with those bound ranges" + }, + { + "vuid": "VUID-VkSparseImageMemoryBind-memory-01105", + "text": " memory and memoryOffset must match the memory requirements of the calling command’s image, as described in section &amp;lt;&amp;lt;resources-association&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-VkSparseImageMemoryBind-subresource-01106", + "text": " subresource must be a valid image subresource for image (see &amp;lt;&amp;lt;resources-image-views&amp;gt;&amp;gt;)" + }, + { + "vuid": "VUID-VkSparseImageMemoryBind-offset-01107", + "text": " offset.x must be a multiple of the sparse image block width (VkSparseImageFormatProperties::imageGranularity.width) of the image" + }, + { + "vuid": "VUID-VkSparseImageMemoryBind-extent-01108", + "text": " extent.width must either be a multiple of the sparse image block width of the image, or else (extent.width + offset.x) must equal the width of the image subresource" + }, + { + "vuid": "VUID-VkSparseImageMemoryBind-offset-01109", + "text": " offset.y must be a multiple of the sparse image block height (VkSparseImageFormatProperties::imageGranularity.height) of the image" + }, + { + "vuid": "VUID-VkSparseImageMemoryBind-extent-01110", + "text": " extent.height must either be a multiple of the sparse image block height of the image, or else (extent.height + offset.y) must equal the height of the image subresource" + }, + { + "vuid": "VUID-VkSparseImageMemoryBind-offset-01111", + "text": " offset.z must be a multiple of the sparse image block depth (VkSparseImageFormatProperties::imageGranularity.depth) of the image" + }, + { + "vuid": "VUID-VkSparseImageMemoryBind-extent-01112", + "text": " extent.depth must either be a multiple of the sparse image block depth of the image, or else (extent.depth + offset.z) must equal the depth of the image subresource" + }, + { + "vuid": "VUID-VkSparseImageMemoryBind-subresource-parameter", + "text": " subresource must be a valid VkImageSubresource structure" + }, + { + "vuid": "VUID-VkSparseImageMemoryBind-memory-parameter", + "text": " If memory is not VK_NULL_HANDLE, memory must be a valid VkDeviceMemory handle" + }, + { + "vuid": "VUID-VkSparseImageMemoryBind-flags-parameter", + "text": " flags must be a valid combination of VkSparseMemoryBindFlagBits values" + } + ] + }, + "vkQueueBindSparse": { + "core": [ + { + "vuid": "VUID-vkQueueBindSparse-fence-01113", + "text": " If fence is not VK_NULL_HANDLE, fence must be unsignaled" + }, + { + "vuid": "VUID-vkQueueBindSparse-fence-01114", + "text": " If fence is not VK_NULL_HANDLE, fence must not be associated with any other queue command that has not yet completed execution on that queue" + }, + { + "vuid": "VUID-vkQueueBindSparse-pSignalSemaphores-01115", + "text": " Each element of the pSignalSemaphores member of each element of pBindInfo must be unsignaled when the semaphore signal operation it defines is executed on the device" + }, + { + "vuid": "VUID-vkQueueBindSparse-pWaitSemaphores-01116", + "text": " When a semaphore unsignal operation defined by any element of the pWaitSemaphores member of any element of pBindInfo executes on queue, no other queue must be waiting on the same semaphore." + }, + { + "vuid": "VUID-vkQueueBindSparse-pWaitSemaphores-01117", + "text": " All elements of the pWaitSemaphores member of all elements of pBindInfo must be semaphores that are signaled, or have &amp;lt;&amp;lt;synchronization-semaphores-signaling, semaphore signal operations&amp;gt;&amp;gt; previously submitted for execution." + }, + { + "vuid": "VUID-vkQueueBindSparse-queue-parameter", + "text": " queue must be a valid VkQueue handle" + }, + { + "vuid": "VUID-vkQueueBindSparse-pBindInfo-parameter", + "text": " If bindInfoCount is not 0, pBindInfo must be a valid pointer to an array of bindInfoCount valid VkBindSparseInfo structures" + }, + { + "vuid": "VUID-vkQueueBindSparse-fence-parameter", + "text": " If fence is not VK_NULL_HANDLE, fence must be a valid VkFence handle" + }, + { + "vuid": "VUID-vkQueueBindSparse-queuetype", + "text": " The queue must support sparse binding operations" + }, + { + "vuid": "VUID-vkQueueBindSparse-commonparent", + "text": " Both of fence, and queue that are valid handles must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "VkBindSparseInfo": { + "core": [ + { + "vuid": "VUID-VkBindSparseInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO" + }, + { + "vuid": "VUID-VkBindSparseInfo-pNext-pNext", + "text": " pNext must be NULL or a pointer to a valid instance of VkDeviceGroupBindSparseInfo" + }, + { + "vuid": "VUID-VkBindSparseInfo-pWaitSemaphores-parameter", + "text": " If waitSemaphoreCount is not 0, pWaitSemaphores must be a valid pointer to an array of waitSemaphoreCount valid VkSemaphore handles" + }, + { + "vuid": "VUID-VkBindSparseInfo-pBufferBinds-parameter", + "text": " If bufferBindCount is not 0, pBufferBinds must be a valid pointer to an array of bufferBindCount valid VkSparseBufferMemoryBindInfo structures" + }, + { + "vuid": "VUID-VkBindSparseInfo-pImageOpaqueBinds-parameter", + "text": " If imageOpaqueBindCount is not 0, pImageOpaqueBinds must be a valid pointer to an array of imageOpaqueBindCount valid VkSparseImageOpaqueMemoryBindInfo structures" + }, + { + "vuid": "VUID-VkBindSparseInfo-pImageBinds-parameter", + "text": " If imageBindCount is not 0, pImageBinds must be a valid pointer to an array of imageBindCount valid VkSparseImageMemoryBindInfo structures" + }, + { + "vuid": "VUID-VkBindSparseInfo-pSignalSemaphores-parameter", + "text": " If signalSemaphoreCount is not 0, pSignalSemaphores must be a valid pointer to an array of signalSemaphoreCount valid VkSemaphore handles" + }, + { + "vuid": "VUID-VkBindSparseInfo-commonparent", + "text": " Both of the elements of pSignalSemaphores, and the elements of pWaitSemaphores that are valid handles must have been created, allocated, or retrieved from the same VkDevice" + } + ] + }, + "VkDeviceGroupBindSparseInfo": { + "(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-VkDeviceGroupBindSparseInfo-resourceDeviceIndex-01118", + "text": " resourceDeviceIndex and memoryDeviceIndex must both be valid device indices." + }, + { + "vuid": "VUID-VkDeviceGroupBindSparseInfo-memoryDeviceIndex-01119", + "text": " Each memory allocation bound in this batch must have allocated an instance for memoryDeviceIndex." + }, + { + "vuid": "VUID-VkDeviceGroupBindSparseInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO" + } + ] + }, + "vkCreateAndroidSurfaceKHR": { + "(VK_KHR_surface)+(VK_KHR_android_surface)": [ + { + "vuid": "VUID-vkCreateAndroidSurfaceKHR-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkCreateAndroidSurfaceKHR-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkAndroidSurfaceCreateInfoKHR structure" + }, + { + "vuid": "VUID-vkCreateAndroidSurfaceKHR-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateAndroidSurfaceKHR-pSurface-parameter", + "text": " pSurface must be a valid pointer to a VkSurfaceKHR handle" + } + ] + }, + "VkAndroidSurfaceCreateInfoKHR": { + "(VK_KHR_surface)+(VK_KHR_android_surface)": [ + { + "vuid": "VUID-VkAndroidSurfaceCreateInfoKHR-window-01248", + "text": " window must point to a valid Android ANativeWindow." + }, + { + "vuid": "VUID-VkAndroidSurfaceCreateInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR" + }, + { + "vuid": "VUID-VkAndroidSurfaceCreateInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkAndroidSurfaceCreateInfoKHR-flags-zerobitmask", + "text": " flags must be 0" + } + ] + }, + "vkCreateMirSurfaceKHR": { + "(VK_KHR_surface)+(VK_KHR_mir_surface)": [ + { + "vuid": "VUID-vkCreateMirSurfaceKHR-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkCreateMirSurfaceKHR-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkMirSurfaceCreateInfoKHR structure" + }, + { + "vuid": "VUID-vkCreateMirSurfaceKHR-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateMirSurfaceKHR-pSurface-parameter", + "text": " pSurface must be a valid pointer to a VkSurfaceKHR handle" + } + ] + }, + "VkMirSurfaceCreateInfoKHR": { + "(VK_KHR_surface)+(VK_KHR_mir_surface)": [ + { + "vuid": "VUID-VkMirSurfaceCreateInfoKHR-connection-01263", + "text": " connection must point to a valid MirConnection." + }, + { + "vuid": "VUID-VkMirSurfaceCreateInfoKHR-surface-01264", + "text": " surface must point to a valid MirSurface." + }, + { + "vuid": "VUID-VkMirSurfaceCreateInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR" + }, + { + "vuid": "VUID-VkMirSurfaceCreateInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkMirSurfaceCreateInfoKHR-flags-zerobitmask", + "text": " flags must be 0" + } + ] + }, + "vkCreateWaylandSurfaceKHR": { + "(VK_KHR_surface)+(VK_KHR_wayland_surface)": [ + { + "vuid": "VUID-vkCreateWaylandSurfaceKHR-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkCreateWaylandSurfaceKHR-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkWaylandSurfaceCreateInfoKHR structure" + }, + { + "vuid": "VUID-vkCreateWaylandSurfaceKHR-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateWaylandSurfaceKHR-pSurface-parameter", + "text": " pSurface must be a valid pointer to a VkSurfaceKHR handle" + } + ] + }, + "VkWaylandSurfaceCreateInfoKHR": { + "(VK_KHR_surface)+(VK_KHR_wayland_surface)": [ + { + "vuid": "VUID-VkWaylandSurfaceCreateInfoKHR-display-01304", + "text": " display must point to a valid Wayland wl_display." + }, + { + "vuid": "VUID-VkWaylandSurfaceCreateInfoKHR-surface-01305", + "text": " surface must point to a valid Wayland wl_surface." + }, + { + "vuid": "VUID-VkWaylandSurfaceCreateInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR" + }, + { + "vuid": "VUID-VkWaylandSurfaceCreateInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkWaylandSurfaceCreateInfoKHR-flags-zerobitmask", + "text": " flags must be 0" + } + ] + }, + "vkCreateWin32SurfaceKHR": { + "(VK_KHR_surface)+(VK_KHR_win32_surface)": [ + { + "vuid": "VUID-vkCreateWin32SurfaceKHR-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkCreateWin32SurfaceKHR-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkWin32SurfaceCreateInfoKHR structure" + }, + { + "vuid": "VUID-vkCreateWin32SurfaceKHR-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateWin32SurfaceKHR-pSurface-parameter", + "text": " pSurface must be a valid pointer to a VkSurfaceKHR handle" + } + ] + }, + "VkWin32SurfaceCreateInfoKHR": { + "(VK_KHR_surface)+(VK_KHR_win32_surface)": [ + { + "vuid": "VUID-VkWin32SurfaceCreateInfoKHR-hinstance-01307", + "text": " hinstance must be a valid Win32 HINSTANCE." + }, + { + "vuid": "VUID-VkWin32SurfaceCreateInfoKHR-hwnd-01308", + "text": " hwnd must be a valid Win32 HWND." + }, + { + "vuid": "VUID-VkWin32SurfaceCreateInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR" + }, + { + "vuid": "VUID-VkWin32SurfaceCreateInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkWin32SurfaceCreateInfoKHR-flags-zerobitmask", + "text": " flags must be 0" + } + ] + }, + "vkCreateXcbSurfaceKHR": { + "(VK_KHR_surface)+(VK_KHR_xcb_surface)": [ + { + "vuid": "VUID-vkCreateXcbSurfaceKHR-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkCreateXcbSurfaceKHR-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkXcbSurfaceCreateInfoKHR structure" + }, + { + "vuid": "VUID-vkCreateXcbSurfaceKHR-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateXcbSurfaceKHR-pSurface-parameter", + "text": " pSurface must be a valid pointer to a VkSurfaceKHR handle" + } + ] + }, + "VkXcbSurfaceCreateInfoKHR": { + "(VK_KHR_surface)+(VK_KHR_xcb_surface)": [ + { + "vuid": "VUID-VkXcbSurfaceCreateInfoKHR-connection-01310", + "text": " connection must point to a valid X11 xcb_connection_t." + }, + { + "vuid": "VUID-VkXcbSurfaceCreateInfoKHR-window-01311", + "text": " window must be a valid X11 xcb_window_t." + }, + { + "vuid": "VUID-VkXcbSurfaceCreateInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR" + }, + { + "vuid": "VUID-VkXcbSurfaceCreateInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkXcbSurfaceCreateInfoKHR-flags-zerobitmask", + "text": " flags must be 0" + } + ] + }, + "vkCreateXlibSurfaceKHR": { + "(VK_KHR_surface)+(VK_KHR_xlib_surface)": [ + { + "vuid": "VUID-vkCreateXlibSurfaceKHR-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkCreateXlibSurfaceKHR-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkXlibSurfaceCreateInfoKHR structure" + }, + { + "vuid": "VUID-vkCreateXlibSurfaceKHR-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateXlibSurfaceKHR-pSurface-parameter", + "text": " pSurface must be a valid pointer to a VkSurfaceKHR handle" + } + ] + }, + "VkXlibSurfaceCreateInfoKHR": { + "(VK_KHR_surface)+(VK_KHR_xlib_surface)": [ + { + "vuid": "VUID-VkXlibSurfaceCreateInfoKHR-dpy-01313", + "text": " dpy must point to a valid Xlib Display." + }, + { + "vuid": "VUID-VkXlibSurfaceCreateInfoKHR-window-01314", + "text": " window must be a valid Xlib Window." + }, + { + "vuid": "VUID-VkXlibSurfaceCreateInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR" + }, + { + "vuid": "VUID-VkXlibSurfaceCreateInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkXlibSurfaceCreateInfoKHR-flags-zerobitmask", + "text": " flags must be 0" + } + ] + }, + "vkCreateIOSSurfaceMVK": { + "(VK_KHR_surface)+(VK_MVK_ios_surface)": [ + { + "vuid": "VUID-vkCreateIOSSurfaceMVK-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkCreateIOSSurfaceMVK-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkIOSSurfaceCreateInfoMVK structure" + }, + { + "vuid": "VUID-vkCreateIOSSurfaceMVK-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateIOSSurfaceMVK-pSurface-parameter", + "text": " pSurface must be a valid pointer to a VkSurfaceKHR handle" + } + ] + }, + "VkIOSSurfaceCreateInfoMVK": { + "(VK_KHR_surface)+(VK_MVK_ios_surface)": [ + { + "vuid": "VUID-VkIOSSurfaceCreateInfoMVK-pView-01316", + "text": " pView must be a valid UIView and must be backed by a CALayer instance of type CAMetalLayer." + }, + { + "vuid": "VUID-VkIOSSurfaceCreateInfoMVK-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK" + }, + { + "vuid": "VUID-VkIOSSurfaceCreateInfoMVK-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkIOSSurfaceCreateInfoMVK-flags-zerobitmask", + "text": " flags must be 0" + } + ] + }, + "vkCreateMacOSSurfaceMVK": { + "(VK_KHR_surface)+(VK_MVK_macos_surface)": [ + { + "vuid": "VUID-vkCreateMacOSSurfaceMVK-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkCreateMacOSSurfaceMVK-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkMacOSSurfaceCreateInfoMVK structure" + }, + { + "vuid": "VUID-vkCreateMacOSSurfaceMVK-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateMacOSSurfaceMVK-pSurface-parameter", + "text": " pSurface must be a valid pointer to a VkSurfaceKHR handle" + } + ] + }, + "VkMacOSSurfaceCreateInfoMVK": { + "(VK_KHR_surface)+(VK_MVK_macos_surface)": [ + { + "vuid": "VUID-VkMacOSSurfaceCreateInfoMVK-pView-01317", + "text": " pView must be a valid NSView and must be backed by a CALayer instance of type CAMetalLayer." + }, + { + "vuid": "VUID-VkMacOSSurfaceCreateInfoMVK-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK" + }, + { + "vuid": "VUID-VkMacOSSurfaceCreateInfoMVK-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkMacOSSurfaceCreateInfoMVK-flags-zerobitmask", + "text": " flags must be 0" + } + ] + }, + "vkCreateViSurfaceNN": { + "(VK_KHR_surface)+(VK_NN_vi_surface)": [ + { + "vuid": "VUID-vkCreateViSurfaceNN-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkCreateViSurfaceNN-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkViSurfaceCreateInfoNN structure" + }, + { + "vuid": "VUID-vkCreateViSurfaceNN-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateViSurfaceNN-pSurface-parameter", + "text": " pSurface must be a valid pointer to a VkSurfaceKHR handle" + } + ] + }, + "VkViSurfaceCreateInfoNN": { + "(VK_KHR_surface)+(VK_NN_vi_surface)": [ + { + "vuid": "VUID-VkViSurfaceCreateInfoNN-window-01318", + "text": " window must be a valid nn::vi::NativeWindowHandle" + }, + { + "vuid": "VUID-VkViSurfaceCreateInfoNN-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN" + }, + { + "vuid": "VUID-VkViSurfaceCreateInfoNN-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkViSurfaceCreateInfoNN-flags-zerobitmask", + "text": " flags must be 0" + } + ] + }, + "vkDestroySurfaceKHR": { + "(VK_KHR_surface)": [ + { + "vuid": "VUID-vkDestroySurfaceKHR-surface-01266", + "text": " All VkSwapchainKHR objects created for surface must have been destroyed prior to destroying surface" + }, + { + "vuid": "VUID-vkDestroySurfaceKHR-surface-01267", + "text": " If VkAllocationCallbacks were provided when surface was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroySurfaceKHR-surface-01268", + "text": " If no VkAllocationCallbacks were provided when surface was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroySurfaceKHR-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkDestroySurfaceKHR-surface-parameter", + "text": " If surface is not VK_NULL_HANDLE, surface must be a valid VkSurfaceKHR handle" + }, + { + "vuid": "VUID-vkDestroySurfaceKHR-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroySurfaceKHR-surface-parent", + "text": " If surface is a valid handle, it must have been created, allocated, or retrieved from instance" + } + ] + }, + "vkGetPhysicalDeviceDisplayPropertiesKHR": { + "(VK_KHR_surface)+(VK_KHR_display)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pPropertyCount-parameter", + "text": " pPropertyCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pProperties-parameter", + "text": " If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkDisplayPropertiesKHR structures" + } + ] + }, + "vkAcquireXlibDisplayEXT": { + "(VK_KHR_surface)+(VK_KHR_display)+(VK_EXT_direct_mode_display)+(VK_EXT_acquire_xlib_display)": [ + { + "vuid": "VUID-vkAcquireXlibDisplayEXT-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkAcquireXlibDisplayEXT-dpy-parameter", + "text": " dpy must be a valid pointer to a Display value" + }, + { + "vuid": "VUID-vkAcquireXlibDisplayEXT-display-parameter", + "text": " display must be a valid VkDisplayKHR handle" + } + ] + }, + "vkGetRandROutputDisplayEXT": { + "(VK_KHR_surface)+(VK_KHR_display)+(VK_EXT_direct_mode_display)+(VK_EXT_acquire_xlib_display)": [ + { + "vuid": "VUID-vkGetRandROutputDisplayEXT-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetRandROutputDisplayEXT-dpy-parameter", + "text": " dpy must be a valid pointer to a Display value" + }, + { + "vuid": "VUID-vkGetRandROutputDisplayEXT-pDisplay-parameter", + "text": " pDisplay must be a valid pointer to a VkDisplayKHR handle" + } + ] + }, + "vkReleaseDisplayEXT": { + "(VK_KHR_surface)+(VK_KHR_display)+(VK_EXT_direct_mode_display)": [ + { + "vuid": "VUID-vkReleaseDisplayEXT-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkReleaseDisplayEXT-display-parameter", + "text": " display must be a valid VkDisplayKHR handle" + } + ] + }, + "vkGetPhysicalDeviceDisplayPlanePropertiesKHR": { + "(VK_KHR_surface)+(VK_KHR_display)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pPropertyCount-parameter", + "text": " pPropertyCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pProperties-parameter", + "text": " If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkDisplayPlanePropertiesKHR structures" + } + ] + }, + "vkGetDisplayPlaneSupportedDisplaysKHR": { + "(VK_KHR_surface)+(VK_KHR_display)": [ + { + "vuid": "VUID-vkGetDisplayPlaneSupportedDisplaysKHR-planeIndex-01249", + "text": " planeIndex must be less than the number of display planes supported by the device as determined by calling vkGetPhysicalDeviceDisplayPlanePropertiesKHR" + }, + { + "vuid": "VUID-vkGetDisplayPlaneSupportedDisplaysKHR-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplayCount-parameter", + "text": " pDisplayCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplays-parameter", + "text": " If the value referenced by pDisplayCount is not 0, and pDisplays is not NULL, pDisplays must be a valid pointer to an array of pDisplayCount VkDisplayKHR handles" + } + ] + }, + "vkGetDisplayModePropertiesKHR": { + "(VK_KHR_surface)+(VK_KHR_display)": [ + { + "vuid": "VUID-vkGetDisplayModePropertiesKHR-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetDisplayModePropertiesKHR-display-parameter", + "text": " display must be a valid VkDisplayKHR handle" + }, + { + "vuid": "VUID-vkGetDisplayModePropertiesKHR-pPropertyCount-parameter", + "text": " pPropertyCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkGetDisplayModePropertiesKHR-pProperties-parameter", + "text": " If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkDisplayModePropertiesKHR structures" + } + ] + }, + "vkCreateDisplayModeKHR": { + "(VK_KHR_surface)+(VK_KHR_display)": [ + { + "vuid": "VUID-vkCreateDisplayModeKHR-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkCreateDisplayModeKHR-display-parameter", + "text": " display must be a valid VkDisplayKHR handle" + }, + { + "vuid": "VUID-vkCreateDisplayModeKHR-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkDisplayModeCreateInfoKHR structure" + }, + { + "vuid": "VUID-vkCreateDisplayModeKHR-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateDisplayModeKHR-pMode-parameter", + "text": " pMode must be a valid pointer to a VkDisplayModeKHR handle" + } + ] + }, + "VkDisplayModeCreateInfoKHR": { + "(VK_KHR_surface)+(VK_KHR_display)": [ + { + "vuid": "VUID-VkDisplayModeCreateInfoKHR-width-01250", + "text": " The width and height members of the visibleRegion member of parameters must be greater than 0" + }, + { + "vuid": "VUID-VkDisplayModeCreateInfoKHR-refreshRate-01251", + "text": " The refreshRate member of parameters must be greater than 0" + }, + { + "vuid": "VUID-VkDisplayModeCreateInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR" + }, + { + "vuid": "VUID-VkDisplayModeCreateInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkDisplayModeCreateInfoKHR-flags-zerobitmask", + "text": " flags must be 0" + } + ] + }, + "vkGetDisplayPlaneCapabilitiesKHR": { + "(VK_KHR_surface)+(VK_KHR_display)": [ + { + "vuid": "VUID-vkGetDisplayPlaneCapabilitiesKHR-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetDisplayPlaneCapabilitiesKHR-mode-parameter", + "text": " mode must be a valid VkDisplayModeKHR handle" + }, + { + "vuid": "VUID-vkGetDisplayPlaneCapabilitiesKHR-pCapabilities-parameter", + "text": " pCapabilities must be a valid pointer to a VkDisplayPlaneCapabilitiesKHR structure" + } + ] + }, + "vkDisplayPowerControlEXT": { + "(VK_KHR_surface)+(VK_KHR_display)+(VK_EXT_display_control)": [ + { + "vuid": "VUID-vkDisplayPowerControlEXT-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDisplayPowerControlEXT-display-parameter", + "text": " display must be a valid VkDisplayKHR handle" + }, + { + "vuid": "VUID-vkDisplayPowerControlEXT-pDisplayPowerInfo-parameter", + "text": " pDisplayPowerInfo must be a valid pointer to a valid VkDisplayPowerInfoEXT structure" + } + ] + }, + "VkDisplayPowerInfoEXT": { + "(VK_KHR_surface)+(VK_KHR_display)+(VK_EXT_display_control)": [ + { + "vuid": "VUID-VkDisplayPowerInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT" + }, + { + "vuid": "VUID-VkDisplayPowerInfoEXT-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkDisplayPowerInfoEXT-powerState-parameter", + "text": " powerState must be a valid VkDisplayPowerStateEXT value" + } + ] + }, + "vkCreateDisplayPlaneSurfaceKHR": { + "(VK_KHR_surface)+(VK_KHR_display)": [ + { + "vuid": "VUID-vkCreateDisplayPlaneSurfaceKHR-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkCreateDisplayPlaneSurfaceKHR-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkDisplaySurfaceCreateInfoKHR structure" + }, + { + "vuid": "VUID-vkCreateDisplayPlaneSurfaceKHR-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateDisplayPlaneSurfaceKHR-pSurface-parameter", + "text": " pSurface must be a valid pointer to a VkSurfaceKHR handle" + } + ] + }, + "VkDisplaySurfaceCreateInfoKHR": { + "(VK_KHR_surface)+(VK_KHR_display)": [ + { + "vuid": "VUID-VkDisplaySurfaceCreateInfoKHR-planeIndex-01252", + "text": " planeIndex must be less than the number of display planes supported by the device as determined by calling vkGetPhysicalDeviceDisplayPlanePropertiesKHR" + }, + { + "vuid": "VUID-VkDisplaySurfaceCreateInfoKHR-planeReorderPossible-01253", + "text": " If the planeReorderPossible member of the VkDisplayPropertiesKHR structure returned by vkGetPhysicalDeviceDisplayPropertiesKHR for the display corresponding to displayMode is VK_TRUE then planeStackIndex must be less than the number of display planes supported by the device as determined by calling vkGetPhysicalDeviceDisplayPlanePropertiesKHR; otherwise planeStackIndex must equal the currentStackIndex member of VkDisplayPlanePropertiesKHR returned by vkGetPhysicalDeviceDisplayPlanePropertiesKHR for the display plane corresponding to displayMode" + }, + { + "vuid": "VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-01254", + "text": " If alphaMode is VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR then globalAlpha must be between 0 and 1, inclusive" + }, + { + "vuid": "VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-01255", + "text": " alphaMode must be 0 or one of the bits present in the supportedAlpha member of VkDisplayPlaneCapabilitiesKHR returned by vkGetDisplayPlaneCapabilitiesKHR for the display plane corresponding to displayMode" + }, + { + "vuid": "VUID-VkDisplaySurfaceCreateInfoKHR-width-01256", + "text": " The width and height members of imageExtent must be less than the maxImageDimensions2D member of VkPhysicalDeviceLimits" + }, + { + "vuid": "VUID-VkDisplaySurfaceCreateInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR" + }, + { + "vuid": "VUID-VkDisplaySurfaceCreateInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkDisplaySurfaceCreateInfoKHR-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkDisplaySurfaceCreateInfoKHR-displayMode-parameter", + "text": " displayMode must be a valid VkDisplayModeKHR handle" + }, + { + "vuid": "VUID-VkDisplaySurfaceCreateInfoKHR-transform-parameter", + "text": " transform must be a valid VkSurfaceTransformFlagBitsKHR value" + }, + { + "vuid": "VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-parameter", + "text": " alphaMode must be a valid VkDisplayPlaneAlphaFlagBitsKHR value" + } + ] + }, + "vkGetPhysicalDeviceSurfaceSupportKHR": { + "(VK_KHR_surface)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceSupportKHR-queueFamilyIndex-01269", + "text": " queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceSupportKHR-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter", + "text": " surface must be a valid VkSurfaceKHR handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceSupportKHR-pSupported-parameter", + "text": " pSupported must be a valid pointer to a VkBool32 value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceSupportKHR-commonparent", + "text": " Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance" + } + ] + }, + "vkGetPhysicalDeviceMirPresentationSupportKHR": { + "(VK_KHR_surface)+(VK_KHR_mir_surface)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-queueFamilyIndex-01265", + "text": " queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceMirPresentationSupportKHR-connection-parameter", + "text": " connection must be a valid pointer to a MirConnection value" + } + ] + }, + "vkGetPhysicalDeviceWaylandPresentationSupportKHR": { + "(VK_KHR_surface)+(VK_KHR_wayland_surface)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-queueFamilyIndex-01306", + "text": " queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-display-parameter", + "text": " display must be a valid pointer to a wl_display value" + } + ] + }, + "vkGetPhysicalDeviceWin32PresentationSupportKHR": { + "(VK_KHR_surface)+(VK_KHR_win32_surface)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceWin32PresentationSupportKHR-queueFamilyIndex-01309", + "text": " queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceWin32PresentationSupportKHR-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + } + ] + }, + "vkGetPhysicalDeviceXcbPresentationSupportKHR": { + "(VK_KHR_surface)+(VK_KHR_xcb_surface)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-queueFamilyIndex-01312", + "text": " queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-connection-parameter", + "text": " connection must be a valid pointer to a xcb_connection_t value" + } + ] + }, + "vkGetPhysicalDeviceXlibPresentationSupportKHR": { + "(VK_KHR_surface)+(VK_KHR_xlib_surface)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-queueFamilyIndex-01315", + "text": " queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the given physicalDevice" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-dpy-parameter", + "text": " dpy must be a valid pointer to a Display value" + } + ] + }, + "vkGetPhysicalDeviceSurfaceCapabilitiesKHR": { + "(VK_KHR_surface)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-surface-parameter", + "text": " surface must be a valid VkSurfaceKHR handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-pSurfaceCapabilities-parameter", + "text": " pSurfaceCapabilities must be a valid pointer to a VkSurfaceCapabilitiesKHR structure" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-commonparent", + "text": " Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance" + } + ] + }, + "vkGetPhysicalDeviceSurfaceCapabilities2KHR": { + "(VK_KHR_surface)+(VK_KHR_get_surface_capabilities2)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceInfo-parameter", + "text": " pSurfaceInfo must be a valid pointer to a valid VkPhysicalDeviceSurfaceInfo2KHR structure" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceCapabilities-parameter", + "text": " pSurfaceCapabilities must be a valid pointer to a VkSurfaceCapabilities2KHR structure" + } + ] + }, + "VkPhysicalDeviceSurfaceInfo2KHR": { + "(VK_KHR_surface)+(VK_KHR_get_surface_capabilities2)": [ + { + "vuid": "VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR" + }, + { + "vuid": "VUID-VkPhysicalDeviceSurfaceInfo2KHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkPhysicalDeviceSurfaceInfo2KHR-surface-parameter", + "text": " surface must be a valid VkSurfaceKHR handle" + } + ] + }, + "VkSurfaceCapabilities2KHR": { + "(VK_KHR_surface)+(VK_KHR_get_surface_capabilities2)": [ + { + "vuid": "VUID-VkSurfaceCapabilities2KHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR" + }, + { + "vuid": "VUID-VkSurfaceCapabilities2KHR-pNext-pNext", + "text": " pNext must be NULL or a pointer to a valid instance of VkSharedPresentSurfaceCapabilitiesKHR" + } + ] + }, + "VkSharedPresentSurfaceCapabilitiesKHR": { + "(VK_KHR_surface)+(VK_KHR_get_surface_capabilities2)+(VK_KHR_shared_presentable_image)": [ + { + "vuid": "VUID-VkSharedPresentSurfaceCapabilitiesKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR" + } + ] + }, + "vkGetPhysicalDeviceSurfaceCapabilities2EXT": { + "(VK_KHR_surface)+(VK_EXT_display_surface_counter)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-surface-parameter", + "text": " surface must be a valid VkSurfaceKHR handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-pSurfaceCapabilities-parameter", + "text": " pSurfaceCapabilities must be a valid pointer to a VkSurfaceCapabilities2EXT structure" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-commonparent", + "text": " Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance" + } + ] + }, + "VkSurfaceCapabilities2EXT": { + "(VK_KHR_surface)+(VK_EXT_display_surface_counter)": [ + { + "vuid": "VUID-VkSurfaceCapabilities2EXT-supportedSurfaceCounters-01246", + "text": " supportedSurfaceCounters must not include VK_SURFACE_COUNTER_VBLANK_EXT unless the surface queried is a &amp;lt;&amp;lt;wsi-display-surfaces,display surface&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-VkSurfaceCapabilities2EXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT" + }, + { + "vuid": "VUID-VkSurfaceCapabilities2EXT-pNext-pNext", + "text": " pNext must be NULL" + } + ] + }, + "vkGetPhysicalDeviceSurfaceFormatsKHR": { + "(VK_KHR_surface)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-surface-parameter", + "text": " surface must be a valid VkSurfaceKHR handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormatCount-parameter", + "text": " pSurfaceFormatCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormats-parameter", + "text": " If the value referenced by pSurfaceFormatCount is not 0, and pSurfaceFormats is not NULL, pSurfaceFormats must be a valid pointer to an array of pSurfaceFormatCount VkSurfaceFormatKHR structures" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-commonparent", + "text": " Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance" + } + ] + }, + "vkGetPhysicalDeviceSurfaceFormats2KHR": { + "(VK_KHR_surface)+(VK_KHR_get_surface_capabilities2)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceInfo-parameter", + "text": " pSurfaceInfo must be a valid pointer to a valid VkPhysicalDeviceSurfaceInfo2KHR structure" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceFormatCount-parameter", + "text": " pSurfaceFormatCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceFormats-parameter", + "text": " If the value referenced by pSurfaceFormatCount is not 0, and pSurfaceFormats is not NULL, pSurfaceFormats must be a valid pointer to an array of pSurfaceFormatCount VkSurfaceFormat2KHR structures" + } + ] + }, + "VkSurfaceFormat2KHR": { + "(VK_KHR_surface)+(VK_KHR_get_surface_capabilities2)": [ + { + "vuid": "VUID-VkSurfaceFormat2KHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR" + }, + { + "vuid": "VUID-VkSurfaceFormat2KHR-pNext-pNext", + "text": " pNext must be NULL" + } + ] + }, + "vkGetPhysicalDeviceSurfacePresentModesKHR": { + "(VK_KHR_surface)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-surface-parameter", + "text": " surface must be a valid VkSurfaceKHR handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModeCount-parameter", + "text": " pPresentModeCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModes-parameter", + "text": " If the value referenced by pPresentModeCount is not 0, and pPresentModes is not NULL, pPresentModes must be a valid pointer to an array of pPresentModeCount VkPresentModeKHR values" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-commonparent", + "text": " Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance" + } + ] + }, + "vkGetDeviceGroupPresentCapabilitiesKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-vkGetDeviceGroupPresentCapabilitiesKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetDeviceGroupPresentCapabilitiesKHR-pDeviceGroupPresentCapabilities-parameter", + "text": " pDeviceGroupPresentCapabilities must be a valid pointer to a VkDeviceGroupPresentCapabilitiesKHR structure" + } + ] + }, + "VkDeviceGroupPresentCapabilitiesKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-VkDeviceGroupPresentCapabilitiesKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR" + }, + { + "vuid": "VUID-VkDeviceGroupPresentCapabilitiesKHR-pNext-pNext", + "text": " pNext must be NULL" + } + ] + }, + "vkGetDeviceGroupSurfacePresentModesKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-vkGetDeviceGroupSurfacePresentModesKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetDeviceGroupSurfacePresentModesKHR-surface-parameter", + "text": " surface must be a valid VkSurfaceKHR handle" + }, + { + "vuid": "VUID-vkGetDeviceGroupSurfacePresentModesKHR-pModes-parameter", + "text": " pModes must be a valid pointer to a VkDeviceGroupPresentModeFlagsKHR value" + }, + { + "vuid": "VUID-vkGetDeviceGroupSurfacePresentModesKHR-commonparent", + "text": " Both of device, and surface must have been created, allocated, or retrieved from the same VkInstance" + } + ] + }, + "vkGetPhysicalDevicePresentRectanglesKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-vkGetPhysicalDevicePresentRectanglesKHR-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDevicePresentRectanglesKHR-surface-parameter", + "text": " surface must be a valid VkSurfaceKHR handle" + }, + { + "vuid": "VUID-vkGetPhysicalDevicePresentRectanglesKHR-pRectCount-parameter", + "text": " pRectCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkGetPhysicalDevicePresentRectanglesKHR-pRects-parameter", + "text": " If the value referenced by pRectCount is not 0, and pRects is not NULL, pRects must be a valid pointer to an array of pRectCount VkRect2D structures" + }, + { + "vuid": "VUID-vkGetPhysicalDevicePresentRectanglesKHR-commonparent", + "text": " Both of physicalDevice, and surface must have been created, allocated, or retrieved from the same VkInstance" + } + ] + }, + "vkGetRefreshCycleDurationGOOGLE": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_GOOGLE_display_timing)": [ + { + "vuid": "VUID-vkGetRefreshCycleDurationGOOGLE-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetRefreshCycleDurationGOOGLE-swapchain-parameter", + "text": " swapchain must be a valid VkSwapchainKHR handle" + }, + { + "vuid": "VUID-vkGetRefreshCycleDurationGOOGLE-pDisplayTimingProperties-parameter", + "text": " pDisplayTimingProperties must be a valid pointer to a VkRefreshCycleDurationGOOGLE structure" + }, + { + "vuid": "VUID-vkGetRefreshCycleDurationGOOGLE-commonparent", + "text": " Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance" + } + ] + }, + "vkGetPastPresentationTimingGOOGLE": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_GOOGLE_display_timing)": [ + { + "vuid": "VUID-vkGetPastPresentationTimingGOOGLE-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetPastPresentationTimingGOOGLE-swapchain-parameter", + "text": " swapchain must be a valid VkSwapchainKHR handle" + }, + { + "vuid": "VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimingCount-parameter", + "text": " pPresentationTimingCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimings-parameter", + "text": " If the value referenced by pPresentationTimingCount is not 0, and pPresentationTimings is not NULL, pPresentationTimings must be a valid pointer to an array of pPresentationTimingCount VkPastPresentationTimingGOOGLE structures" + }, + { + "vuid": "VUID-vkGetPastPresentationTimingGOOGLE-commonparent", + "text": " Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance" + } + ] + }, + "vkGetSwapchainStatusKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_shared_presentable_image)": [ + { + "vuid": "VUID-vkGetSwapchainStatusKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetSwapchainStatusKHR-swapchain-parameter", + "text": " swapchain must be a valid VkSwapchainKHR handle" + }, + { + "vuid": "VUID-vkGetSwapchainStatusKHR-commonparent", + "text": " Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance" + } + ] + }, + "vkCreateSwapchainKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)": [ + { + "vuid": "VUID-vkCreateSwapchainKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateSwapchainKHR-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkSwapchainCreateInfoKHR structure" + }, + { + "vuid": "VUID-vkCreateSwapchainKHR-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateSwapchainKHR-pSwapchain-parameter", + "text": " pSwapchain must be a valid pointer to a VkSwapchainKHR handle" + } + ] + }, + "VkSwapchainCreateInfoKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)": [ + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-surface-01270", + "text": " surface must be a surface that is supported by the device as determined using vkGetPhysicalDeviceSurfaceSupportKHR" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-minImageCount-01271", + "text": " minImageCount must be greater than or equal to the value returned in the minImageCount member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-minImageCount-01272", + "text": " minImageCount must be less than or equal to the value returned in the maxImageCount member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface if the returned maxImageCount is not zero" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-imageFormat-01273", + "text": " imageFormat and imageColorSpace must match the format and colorSpace members, respectively, of one of the VkSurfaceFormatKHR structures returned by vkGetPhysicalDeviceSurfaceFormatsKHR for the surface" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-imageExtent-01274", + "text": " imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-imageExtent-01689", + "text": " imageExtent members width and height must both be non-zero" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-imageArrayLayers-01275", + "text": " imageArrayLayers must be greater than 0 and less than or equal to the maxImageArrayLayers member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-imageSharingMode-01277", + "text": " If imageSharingMode is VK_SHARING_MODE_CONCURRENT, pQueueFamilyIndices must be a valid pointer to an array of queueFamilyIndexCount uint32_t values" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-imageSharingMode-01278", + "text": " If imageSharingMode is VK_SHARING_MODE_CONCURRENT, queueFamilyIndexCount must be greater than 1" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-preTransform-01279", + "text": " preTransform must be one of the bits present in the supportedTransforms member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-compositeAlpha-01280", + "text": " compositeAlpha must be one of the bits present in the supportedCompositeAlpha member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-presentMode-01281", + "text": " presentMode must be one of the VkPresentModeKHR values returned by vkGetPhysicalDeviceSurfacePresentModesKHR for the surface" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-oldSwapchain-01933", + "text": " If oldSwapchain is not VK_NULL_HANDLE, oldSwapchain must be a non-retired swapchain associated with native window referred to by surface" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-imageFormat-01778", + "text": " imageFormat, imageUsage, imageExtent, and imageArrayLayers must be supported for VK_IMAGE_TYPE_2D VK_IMAGE_TILING_OPTIMAL images as reported by vkGetPhysicalDeviceImageFormatProperties." + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDeviceGroupSwapchainCreateInfoKHR or VkSwapchainCounterCreateInfoEXT" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-flags-parameter", + "text": " flags must be a valid combination of VkSwapchainCreateFlagBitsKHR values" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-surface-parameter", + "text": " surface must be a valid VkSurfaceKHR handle" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-imageFormat-parameter", + "text": " imageFormat must be a valid VkFormat value" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-imageColorSpace-parameter", + "text": " imageColorSpace must be a valid VkColorSpaceKHR value" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-imageUsage-parameter", + "text": " imageUsage must be a valid combination of VkImageUsageFlagBits values" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-imageUsage-requiredbitmask", + "text": " imageUsage must not be 0" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-imageSharingMode-parameter", + "text": " imageSharingMode must be a valid VkSharingMode value" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-preTransform-parameter", + "text": " preTransform must be a valid VkSurfaceTransformFlagBitsKHR value" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-compositeAlpha-parameter", + "text": " compositeAlpha must be a valid VkCompositeAlphaFlagBitsKHR value" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-presentMode-parameter", + "text": " presentMode must be a valid VkPresentModeKHR value" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-oldSwapchain-parameter", + "text": " If oldSwapchain is not VK_NULL_HANDLE, oldSwapchain must be a valid VkSwapchainKHR handle" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-oldSwapchain-parent", + "text": " If oldSwapchain is a valid handle, it must have been created, allocated, or retrieved from surface" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-commonparent", + "text": " Both of oldSwapchain, and surface that are valid handles must have been created, allocated, or retrieved from the same VkInstance" + } + ], + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_shared_presentable_image)": [ + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-minImageCount-01383", + "text": " minImageCount must be 1 if presentMode is either VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR or VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-presentMode-01427", + "text": " If presentMode is VK_PRESENT_MODE_IMMEDIATE_KHR, VK_PRESENT_MODE_MAILBOX_KHR, VK_PRESENT_MODE_FIFO_KHR or VK_PRESENT_MODE_FIFO_RELAXED_KHR, imageUsage must be a subset of the supported usage flags present in the supportedUsageFlags member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for surface" + }, + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-imageUsage-01384", + "text": " If presentMode is VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR or VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR, imageUsage must be a subset of the supported usage flags present in the sharedPresentSupportedUsageFlags member of the VkSharedPresentSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilities2KHR for surface" + } + ], + "(VK_KHR_surface)+(VK_KHR_swapchain)+!(VK_KHR_shared_presentable_image)": [ + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-imageUsage-01276", + "text": " imageUsage must be a subset of the supported usage flags present in the supportedUsageFlags member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface" + } + ], + "(VK_KHR_surface)+(VK_KHR_swapchain)+!(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-imageSharingMode-01393", + "text": " If imageSharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties for the physicalDevice that was used to create device" + } + ], + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-imageSharingMode-01428", + "text": " If imageSharingMode is VK_SHARING_MODE_CONCURRENT, each element of pQueueFamilyIndices must be unique and must be less than pQueueFamilyPropertyCount returned by either vkGetPhysicalDeviceQueueFamilyProperties or vkGetPhysicalDeviceQueueFamilyProperties2 for the physicalDevice that was used to create device" + } + ], + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-VkSwapchainCreateInfoKHR-physicalDeviceCount-01429", + "text": " If the logical device was created with VkDeviceGroupDeviceCreateInfo::physicalDeviceCount equal to 1, flags must not contain VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR" + } + ] + }, + "VkDeviceGroupSwapchainCreateInfoKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-VkDeviceGroupSwapchainCreateInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR" + }, + { + "vuid": "VUID-VkDeviceGroupSwapchainCreateInfoKHR-modes-parameter", + "text": " modes must be a valid combination of VkDeviceGroupPresentModeFlagBitsKHR values" + }, + { + "vuid": "VUID-VkDeviceGroupSwapchainCreateInfoKHR-modes-requiredbitmask", + "text": " modes must not be 0" + } + ] + }, + "VkSwapchainCounterCreateInfoEXT": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_EXT_display_control)": [ + { + "vuid": "VUID-VkSwapchainCounterCreateInfoEXT-surfaceCounters-01244", + "text": " The bits in surfaceCounters must be supported by VkSwapchainCreateInfoKHR::surface, as reported by vkGetPhysicalDeviceSurfaceCapabilities2EXT." + }, + { + "vuid": "VUID-VkSwapchainCounterCreateInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT" + }, + { + "vuid": "VUID-VkSwapchainCounterCreateInfoEXT-surfaceCounters-parameter", + "text": " surfaceCounters must be a valid combination of VkSurfaceCounterFlagBitsEXT values" + } + ] + }, + "vkGetSwapchainCounterEXT": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_EXT_display_control)": [ + { + "vuid": "VUID-vkGetSwapchainCounterEXT-swapchain-01245", + "text": " One or more present commands on swapchain must have been processed by the presentation engine." + }, + { + "vuid": "VUID-vkGetSwapchainCounterEXT-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetSwapchainCounterEXT-swapchain-parameter", + "text": " swapchain must be a valid VkSwapchainKHR handle" + }, + { + "vuid": "VUID-vkGetSwapchainCounterEXT-counter-parameter", + "text": " counter must be a valid VkSurfaceCounterFlagBitsEXT value" + }, + { + "vuid": "VUID-vkGetSwapchainCounterEXT-pCounterValue-parameter", + "text": " pCounterValue must be a valid pointer to a uint64_t value" + }, + { + "vuid": "VUID-vkGetSwapchainCounterEXT-commonparent", + "text": " Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance" + } + ] + }, + "vkDestroySwapchainKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)": [ + { + "vuid": "VUID-vkDestroySwapchainKHR-swapchain-01282", + "text": " All uses of presentable images acquired from swapchain must have completed execution" + }, + { + "vuid": "VUID-vkDestroySwapchainKHR-swapchain-01283", + "text": " If VkAllocationCallbacks were provided when swapchain was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroySwapchainKHR-swapchain-01284", + "text": " If no VkAllocationCallbacks were provided when swapchain was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroySwapchainKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDestroySwapchainKHR-swapchain-parameter", + "text": " If swapchain is not VK_NULL_HANDLE, swapchain must be a valid VkSwapchainKHR handle" + }, + { + "vuid": "VUID-vkDestroySwapchainKHR-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroySwapchainKHR-commonparent", + "text": " Both of device, and swapchain that are valid handles must have been created, allocated, or retrieved from the same VkInstance" + } + ] + }, + "vkCreateSharedSwapchainsKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_display_swapchain)": [ + { + "vuid": "VUID-vkCreateSharedSwapchainsKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkCreateSharedSwapchainsKHR-pCreateInfos-parameter", + "text": " pCreateInfos must be a valid pointer to an array of swapchainCount valid VkSwapchainCreateInfoKHR structures" + }, + { + "vuid": "VUID-vkCreateSharedSwapchainsKHR-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateSharedSwapchainsKHR-pSwapchains-parameter", + "text": " pSwapchains must be a valid pointer to an array of swapchainCount VkSwapchainKHR handles" + }, + { + "vuid": "VUID-vkCreateSharedSwapchainsKHR-swapchainCount-arraylength", + "text": " swapchainCount must be greater than 0" + } + ] + }, + "vkGetSwapchainImagesKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)": [ + { + "vuid": "VUID-vkGetSwapchainImagesKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkGetSwapchainImagesKHR-swapchain-parameter", + "text": " swapchain must be a valid VkSwapchainKHR handle" + }, + { + "vuid": "VUID-vkGetSwapchainImagesKHR-pSwapchainImageCount-parameter", + "text": " pSwapchainImageCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkGetSwapchainImagesKHR-pSwapchainImages-parameter", + "text": " If the value referenced by pSwapchainImageCount is not 0, and pSwapchainImages is not NULL, pSwapchainImages must be a valid pointer to an array of pSwapchainImageCount VkImage handles" + }, + { + "vuid": "VUID-vkGetSwapchainImagesKHR-commonparent", + "text": " Both of device, and swapchain must have been created, allocated, or retrieved from the same VkInstance" + } + ] + }, + "vkAcquireNextImageKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)": [ + { + "vuid": "VUID-vkAcquireNextImageKHR-swapchain-01285", + "text": " swapchain must not be in the retired state" + }, + { + "vuid": "VUID-vkAcquireNextImageKHR-semaphore-01286", + "text": " If semaphore is not VK_NULL_HANDLE it must be unsignaled" + }, + { + "vuid": "VUID-vkAcquireNextImageKHR-semaphore-01779", + "text": " If semaphore is not VK_NULL_HANDLE it must not have any uncompleted signal or wait operations pending" + }, + { + "vuid": "VUID-vkAcquireNextImageKHR-fence-01287", + "text": " If fence is not VK_NULL_HANDLE it must be unsignaled and must not be associated with any other queue command that has not yet completed execution on that queue" + }, + { + "vuid": "VUID-vkAcquireNextImageKHR-semaphore-01780", + "text": " semaphore and fence must not both be equal to VK_NULL_HANDLE" + }, + { + "vuid": "VUID-vkAcquireNextImageKHR-swapchain-01802", + "text": " If the number of currently acquired images is greater than the difference between the number of images in swapchain and the value of VkSurfaceCapabilitiesKHR::minImageCount as returned by a call to vkGetPhysicalDeviceSurfaceCapabilities2KHR with the surface used to create swapchain, timeout must not be UINT64_MAX" + }, + { + "vuid": "VUID-vkAcquireNextImageKHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkAcquireNextImageKHR-swapchain-parameter", + "text": " swapchain must be a valid VkSwapchainKHR handle" + }, + { + "vuid": "VUID-vkAcquireNextImageKHR-semaphore-parameter", + "text": " If semaphore is not VK_NULL_HANDLE, semaphore must be a valid VkSemaphore handle" + }, + { + "vuid": "VUID-vkAcquireNextImageKHR-fence-parameter", + "text": " If fence is not VK_NULL_HANDLE, fence must be a valid VkFence handle" + }, + { + "vuid": "VUID-vkAcquireNextImageKHR-pImageIndex-parameter", + "text": " pImageIndex must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkAcquireNextImageKHR-semaphore-parent", + "text": " If semaphore is a valid handle, it must have been created, allocated, or retrieved from device" + }, + { + "vuid": "VUID-vkAcquireNextImageKHR-fence-parent", + "text": " If fence is a valid handle, it must have been created, allocated, or retrieved from device" + }, + { + "vuid": "VUID-vkAcquireNextImageKHR-commonparent", + "text": " Both of device, and swapchain that are valid handles must have been created, allocated, or retrieved from the same VkInstance" + } + ] + }, + "vkAcquireNextImage2KHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-vkAcquireNextImage2KHR-swapchain-01803", + "text": " If the number of currently acquired images is greater than the difference between the number of images in the swapchain member of pAcquireInfo and the value of VkSurfaceCapabilitiesKHR::minImageCount as returned by a call to vkGetPhysicalDeviceSurfaceCapabilities2KHR with the surface used to create swapchain, the timeout member of pAcquireInfo must not be UINT64_MAX" + }, + { + "vuid": "VUID-vkAcquireNextImage2KHR-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkAcquireNextImage2KHR-pAcquireInfo-parameter", + "text": " pAcquireInfo must be a valid pointer to a valid VkAcquireNextImageInfoKHR structure" + }, + { + "vuid": "VUID-vkAcquireNextImage2KHR-pImageIndex-parameter", + "text": " pImageIndex must be a valid pointer to a uint32_t value" + } + ] + }, + "VkAcquireNextImageInfoKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-VkAcquireNextImageInfoKHR-swapchain-01675", + "text": " swapchain must not be in the retired state" + }, + { + "vuid": "VUID-VkAcquireNextImageInfoKHR-semaphore-01288", + "text": " If semaphore is not VK_NULL_HANDLE it must be unsignaled" + }, + { + "vuid": "VUID-VkAcquireNextImageInfoKHR-semaphore-01781", + "text": " If semaphore is not VK_NULL_HANDLE it must not have any uncompleted signal or wait operations pending" + }, + { + "vuid": "VUID-VkAcquireNextImageInfoKHR-fence-01289", + "text": " If fence is not VK_NULL_HANDLE it must be unsignaled and must not be associated with any other queue command that has not yet completed execution on that queue" + }, + { + "vuid": "VUID-VkAcquireNextImageInfoKHR-semaphore-01782", + "text": " semaphore and fence must not both be equal to VK_NULL_HANDLE" + }, + { + "vuid": "VUID-VkAcquireNextImageInfoKHR-deviceMask-01290", + "text": " deviceMask must be a valid device mask" + }, + { + "vuid": "VUID-VkAcquireNextImageInfoKHR-deviceMask-01291", + "text": " deviceMask must not be zero" + }, + { + "vuid": "VUID-VkAcquireNextImageInfoKHR-semaphore-01804", + "text": " semaphore and fence must not both be equal to VK_NULL_HANDLE." + }, + { + "vuid": "VUID-VkAcquireNextImageInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR" + }, + { + "vuid": "VUID-VkAcquireNextImageInfoKHR-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkAcquireNextImageInfoKHR-swapchain-parameter", + "text": " swapchain must be a valid VkSwapchainKHR handle" + }, + { + "vuid": "VUID-VkAcquireNextImageInfoKHR-semaphore-parameter", + "text": " If semaphore is not VK_NULL_HANDLE, semaphore must be a valid VkSemaphore handle" + }, + { + "vuid": "VUID-VkAcquireNextImageInfoKHR-fence-parameter", + "text": " If fence is not VK_NULL_HANDLE, fence must be a valid VkFence handle" + }, + { + "vuid": "VUID-VkAcquireNextImageInfoKHR-commonparent", + "text": " Each of fence, semaphore, and swapchain that are valid handles must have been created, allocated, or retrieved from the same VkInstance" + } + ] + }, + "vkQueuePresentKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)": [ + { + "vuid": "VUID-vkQueuePresentKHR-pSwapchains-01292", + "text": " Each element of pSwapchains member of pPresentInfo must be a swapchain that is created for a surface for which presentation is supported from queue as determined using a call to vkGetPhysicalDeviceSurfaceSupportKHR" + }, + { + "vuid": "VUID-vkQueuePresentKHR-pWaitSemaphores-01294", + "text": " When a semaphore unsignal operation defined by the elements of the pWaitSemaphores member of pPresentInfo executes on queue, no other queue must be waiting on the same semaphore." + }, + { + "vuid": "VUID-vkQueuePresentKHR-pWaitSemaphores-01295", + "text": " All elements of the pWaitSemaphores member of pPresentInfo must be semaphores that are signaled, or have &amp;lt;&amp;lt;synchronization-semaphores-signaling, semaphore signal operations&amp;gt;&amp;gt; previously submitted for execution." + }, + { + "vuid": "VUID-vkQueuePresentKHR-queue-parameter", + "text": " queue must be a valid VkQueue handle" + }, + { + "vuid": "VUID-vkQueuePresentKHR-pPresentInfo-parameter", + "text": " pPresentInfo must be a valid pointer to a valid VkPresentInfoKHR structure" + } + ], + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_display_swapchain)": [ + { + "vuid": "VUID-vkQueuePresentKHR-pSwapchains-01293", + "text": " If more than one member of pSwapchains was created from a display surface, all display surfaces referenced that refer to the same display must use the same display mode" + } + ] + }, + "VkPresentInfoKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+!(VK_KHR_shared_presentable_image)": [ + { + "vuid": "VUID-VkPresentInfoKHR-pImageIndices-01296", + "text": " Each element of pImageIndices must be the index of a presentable image acquired from the swapchain specified by the corresponding element of the pSwapchains array, and the presented image subresource must be in the VK_IMAGE_LAYOUT_PRESENT_SRC_KHR layout at the time the operation is executed on a VkDevice" + } + ], + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_shared_presentable_image)": [ + { + "vuid": "VUID-VkPresentInfoKHR-pImageIndices-01430", + "text": " Each element of pImageIndices must be the index of a presentable image acquired from the swapchain specified by the corresponding element of the pSwapchains array, and the presented image subresource must be in the VK_IMAGE_LAYOUT_PRESENT_SRC_KHR or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR layout at the time the operation is executed on a VkDevice" + } + ], + "(VK_KHR_surface)+(VK_KHR_swapchain)": [ + { + "vuid": "VUID-VkPresentInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PRESENT_INFO_KHR" + }, + { + "vuid": "VUID-VkPresentInfoKHR-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDeviceGroupPresentInfoKHR, VkDisplayPresentInfoKHR, VkPresentRegionsKHR, or VkPresentTimesInfoGOOGLE" + }, + { + "vuid": "VUID-VkPresentInfoKHR-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + }, + { + "vuid": "VUID-VkPresentInfoKHR-pWaitSemaphores-parameter", + "text": " If waitSemaphoreCount is not 0, pWaitSemaphores must be a valid pointer to an array of waitSemaphoreCount valid VkSemaphore handles" + }, + { + "vuid": "VUID-VkPresentInfoKHR-pSwapchains-parameter", + "text": " pSwapchains must be a valid pointer to an array of swapchainCount valid VkSwapchainKHR handles" + }, + { + "vuid": "VUID-VkPresentInfoKHR-pImageIndices-parameter", + "text": " pImageIndices must be a valid pointer to an array of swapchainCount uint32_t values" + }, + { + "vuid": "VUID-VkPresentInfoKHR-pResults-parameter", + "text": " If pResults is not NULL, pResults must be a valid pointer to an array of swapchainCount VkResult values" + }, + { + "vuid": "VUID-VkPresentInfoKHR-swapchainCount-arraylength", + "text": " swapchainCount must be greater than 0" + }, + { + "vuid": "VUID-VkPresentInfoKHR-commonparent", + "text": " Both of the elements of pSwapchains, and the elements of pWaitSemaphores that are valid handles must have been created, allocated, or retrieved from the same VkInstance" + } + ] + }, + "VkPresentRegionsKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_incremental_present)": [ + { + "vuid": "VUID-VkPresentRegionsKHR-swapchainCount-01260", + "text": " swapchainCount must be the same value as VkPresentInfoKHR::swapchainCount, where VkPresentInfoKHR is in the pNext-chain of this VkPresentRegionsKHR structure." + }, + { + "vuid": "VUID-VkPresentRegionsKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR" + }, + { + "vuid": "VUID-VkPresentRegionsKHR-pRegions-parameter", + "text": " If pRegions is not NULL, pRegions must be a valid pointer to an array of swapchainCount valid VkPresentRegionKHR structures" + }, + { + "vuid": "VUID-VkPresentRegionsKHR-swapchainCount-arraylength", + "text": " swapchainCount must be greater than 0" + } + ] + }, + "VkPresentRegionKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_incremental_present)": [ + { + "vuid": "VUID-VkPresentRegionKHR-pRectangles-parameter", + "text": " If rectangleCount is not 0, and pRectangles is not NULL, pRectangles must be a valid pointer to an array of rectangleCount VkRectLayerKHR structures" + } + ] + }, + "VkRectLayerKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_incremental_present)": [ + { + "vuid": "VUID-VkRectLayerKHR-offset-01261", + "text": " The sum of offset and extent must be no greater than the imageExtent member of the VkSwapchainCreateInfoKHR structure given to vkCreateSwapchainKHR." + }, + { + "vuid": "VUID-VkRectLayerKHR-layer-01262", + "text": " layer must be less than imageArrayLayers member of the VkSwapchainCreateInfoKHR structure given to vkCreateSwapchainKHR." + } + ] + }, + "VkDisplayPresentInfoKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_KHR_display_swapchain)": [ + { + "vuid": "VUID-VkDisplayPresentInfoKHR-srcRect-01257", + "text": " srcRect must specify a rectangular region that is a subset of the image being presented" + }, + { + "vuid": "VUID-VkDisplayPresentInfoKHR-dstRect-01258", + "text": " dstRect must specify a rectangular region that is a subset of the visibleRegion parameter of the display mode the swapchain being presented uses" + }, + { + "vuid": "VUID-VkDisplayPresentInfoKHR-persistentContent-01259", + "text": " If the persistentContent member of the VkDisplayPropertiesKHR structure returned by vkGetPhysicalDeviceDisplayPropertiesKHR for the display the present operation targets then persistent must be VK_FALSE" + }, + { + "vuid": "VUID-VkDisplayPresentInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR" + } + ] + }, + "VkDeviceGroupPresentInfoKHR": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_VERSION_1_1,VK_KHR_device_group)": [ + { + "vuid": "VUID-VkDeviceGroupPresentInfoKHR-swapchainCount-01297", + "text": " swapchainCount must equal 0 or VkPresentInfoKHR::swapchainCount" + }, + { + "vuid": "VUID-VkDeviceGroupPresentInfoKHR-mode-01298", + "text": " If mode is VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR, then each element of pDeviceMasks must have exactly one bit set, and the corresponding element of VkDeviceGroupPresentCapabilitiesKHR::presentMask must be non-zero" + }, + { + "vuid": "VUID-VkDeviceGroupPresentInfoKHR-mode-01299", + "text": " If mode is VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR, then each element of pDeviceMasks must have exactly one bit set, and some physical device in the logical device must include that bit in its VkDeviceGroupPresentCapabilitiesKHR::presentMask." + }, + { + "vuid": "VUID-VkDeviceGroupPresentInfoKHR-mode-01300", + "text": " If mode is VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR, then each element of pDeviceMasks must have a value for which all set bits are set in one of the elements of VkDeviceGroupPresentCapabilitiesKHR::presentMask" + }, + { + "vuid": "VUID-VkDeviceGroupPresentInfoKHR-mode-01301", + "text": " If mode is VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR, then for each bit set in each element of pDeviceMasks, the corresponding element of VkDeviceGroupPresentCapabilitiesKHR::presentMask must be non-zero" + }, + { + "vuid": "VUID-VkDeviceGroupPresentInfoKHR-pDeviceMasks-01302", + "text": " The value of each element of pDeviceMasks must be equal to the device mask passed in VkAcquireNextImageInfoKHR::deviceMask when the image index was last acquired" + }, + { + "vuid": "VUID-VkDeviceGroupPresentInfoKHR-mode-01303", + "text": " mode must have exactly one bit set, and that bit must have been included in VkDeviceGroupSwapchainCreateInfoKHR::modes" + }, + { + "vuid": "VUID-VkDeviceGroupPresentInfoKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR" + }, + { + "vuid": "VUID-VkDeviceGroupPresentInfoKHR-pDeviceMasks-parameter", + "text": " If swapchainCount is not 0, pDeviceMasks must be a valid pointer to an array of swapchainCount uint32_t values" + }, + { + "vuid": "VUID-VkDeviceGroupPresentInfoKHR-mode-parameter", + "text": " mode must be a valid VkDeviceGroupPresentModeFlagBitsKHR value" + } + ] + }, + "VkPresentTimesInfoGOOGLE": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_GOOGLE_display_timing)": [ + { + "vuid": "VUID-VkPresentTimesInfoGOOGLE-swapchainCount-01247", + "text": " swapchainCount must be the same value as VkPresentInfoKHR::swapchainCount, where VkPresentInfoKHR is in the pNext chain of this VkPresentTimesInfoGOOGLE structure." + }, + { + "vuid": "VUID-VkPresentTimesInfoGOOGLE-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE" + }, + { + "vuid": "VUID-VkPresentTimesInfoGOOGLE-pTimes-parameter", + "text": " If pTimes is not NULL, pTimes must be a valid pointer to an array of swapchainCount VkPresentTimeGOOGLE structures" + }, + { + "vuid": "VUID-VkPresentTimesInfoGOOGLE-swapchainCount-arraylength", + "text": " swapchainCount must be greater than 0" + } + ] + }, + "vkSetHdrMetadataEXT": { + "(VK_KHR_surface)+(VK_KHR_swapchain)+(VK_EXT_hdr_metadata)": [ + { + "vuid": "VUID-vkSetHdrMetadataEXT-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkSetHdrMetadataEXT-pSwapchains-parameter", + "text": " pSwapchains must be a valid pointer to an array of swapchainCount valid VkSwapchainKHR handles" + }, + { + "vuid": "VUID-vkSetHdrMetadataEXT-pMetadata-parameter", + "text": " pMetadata must be a valid pointer to an array of swapchainCount valid VkHdrMetadataEXT structures" + }, + { + "vuid": "VUID-vkSetHdrMetadataEXT-swapchainCount-arraylength", + "text": " swapchainCount must be greater than 0" + }, + { + "vuid": "VUID-vkSetHdrMetadataEXT-commonparent", + "text": " Both of device, and the elements of pSwapchains must have been created, allocated, or retrieved from the same VkInstance" + } + ] + }, + "vkEnumerateInstanceLayerProperties": { + "core": [ + { + "vuid": "VUID-vkEnumerateInstanceLayerProperties-pPropertyCount-parameter", + "text": " pPropertyCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkEnumerateInstanceLayerProperties-pProperties-parameter", + "text": " If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkLayerProperties structures" + } + ] + }, + "vkEnumerateDeviceLayerProperties": { + "core": [ + { + "vuid": "VUID-vkEnumerateDeviceLayerProperties-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkEnumerateDeviceLayerProperties-pPropertyCount-parameter", + "text": " pPropertyCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkEnumerateDeviceLayerProperties-pProperties-parameter", + "text": " If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkLayerProperties structures" + } + ] + }, + "vkEnumerateInstanceExtensionProperties": { + "core": [ + { + "vuid": "VUID-vkEnumerateInstanceExtensionProperties-pLayerName-parameter", + "text": " If pLayerName is not NULL, pLayerName must be a null-terminated UTF-8 string" + }, + { + "vuid": "VUID-vkEnumerateInstanceExtensionProperties-pPropertyCount-parameter", + "text": " pPropertyCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkEnumerateInstanceExtensionProperties-pProperties-parameter", + "text": " If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkExtensionProperties structures" + } + ] + }, + "vkEnumerateDeviceExtensionProperties": { + "core": [ + { + "vuid": "VUID-vkEnumerateDeviceExtensionProperties-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkEnumerateDeviceExtensionProperties-pLayerName-parameter", + "text": " If pLayerName is not NULL, pLayerName must be a null-terminated UTF-8 string" + }, + { + "vuid": "VUID-vkEnumerateDeviceExtensionProperties-pPropertyCount-parameter", + "text": " pPropertyCount must be a valid pointer to a uint32_t value" + }, + { + "vuid": "VUID-vkEnumerateDeviceExtensionProperties-pProperties-parameter", + "text": " If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkExtensionProperties structures" + } + ] + }, + "vkGetPhysicalDeviceFeatures": { + "core": [ + { + "vuid": "VUID-vkGetPhysicalDeviceFeatures-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceFeatures-pFeatures-parameter", + "text": " pFeatures must be a valid pointer to a VkPhysicalDeviceFeatures structure" + } + ] + }, + "vkGetPhysicalDeviceFeatures2": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceFeatures2-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceFeatures2-pFeatures-parameter", + "text": " pFeatures must be a valid pointer to a VkPhysicalDeviceFeatures2 structure" + } + ] + }, + "VkPhysicalDeviceFeatures2": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-VkPhysicalDeviceFeatures2-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2" + } + ] + }, + "VkPhysicalDeviceVariablePointerFeatures": { + "(VK_VERSION_1_1,VK_KHR_variable_pointers)": [ + { + "vuid": "VUID-VkPhysicalDeviceVariablePointerFeatures-variablePointers-01431", + "text": " If variablePointers is enabled then variablePointersStorageBuffer must also be enabled." + }, + { + "vuid": "VUID-VkPhysicalDeviceVariablePointerFeatures-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES" + } + ] + }, + "VkPhysicalDeviceMultiviewFeatures": { + "(VK_VERSION_1_1,VK_KHR_multiview)": [ + { + "vuid": "VUID-VkPhysicalDeviceMultiviewFeatures-multiviewGeometryShader-00580", + "text": " If multiviewGeometryShader is enabled then multiview must also be enabled." + }, + { + "vuid": "VUID-VkPhysicalDeviceMultiviewFeatures-multiviewTessellationShader-00581", + "text": " If multiviewTessellationShader is enabled then multiview must also be enabled." + }, + { + "vuid": "VUID-VkPhysicalDeviceMultiviewFeatures-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES" + } + ] + }, + "VkPhysicalDevice16BitStorageFeatures": { + "(VK_VERSION_1_1,VK_KHR_16bit_storage)": [ + { + "vuid": "VUID-VkPhysicalDevice16BitStorageFeatures-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES" + } + ] + }, + "VkPhysicalDeviceSamplerYcbcrConversionFeatures": { + "(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkPhysicalDeviceSamplerYcbcrConversionFeatures-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES" + } + ] + }, + "VkPhysicalDeviceProtectedMemoryFeatures": { + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-VkPhysicalDeviceProtectedMemoryFeatures-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES" + } + ] + }, + "VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT": { + "(VK_EXT_blend_operation_advanced)": [ + { + "vuid": "VUID-VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT" + } + ] + }, + "VkPhysicalDeviceShaderDrawParameterFeatures": { + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-VkPhysicalDeviceShaderDrawParameterFeatures-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES" + } + ] + }, + "VkPhysicalDeviceDescriptorIndexingFeaturesEXT": { + "(VK_EXT_descriptor_indexing)": [ + { + "vuid": "VUID-VkPhysicalDeviceDescriptorIndexingFeaturesEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT" + } + ] + }, + "VkPhysicalDevicePushDescriptorPropertiesKHR": { + "(VK_KHR_push_descriptor)": [ + { + "vuid": "VUID-VkPhysicalDevicePushDescriptorPropertiesKHR-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR" + } + ] + }, + "VkPhysicalDeviceMultiviewProperties": { + "(VK_VERSION_1_1,VK_KHR_multiview)": [ + { + "vuid": "VUID-VkPhysicalDeviceMultiviewProperties-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES" + } + ] + }, + "VkPhysicalDeviceDiscardRectanglePropertiesEXT": { + "(VK_EXT_discard_rectangles)": [ + { + "vuid": "VUID-VkPhysicalDeviceDiscardRectanglePropertiesEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT" + } + ] + }, + "VkPhysicalDeviceSampleLocationsPropertiesEXT": { + "(VK_EXT_sample_locations)": [ + { + "vuid": "VUID-VkPhysicalDeviceSampleLocationsPropertiesEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT" + } + ] + }, + "VkPhysicalDeviceExternalMemoryHostPropertiesEXT": { + "(VK_EXT_external_memory_host)": [ + { + "vuid": "VUID-VkPhysicalDeviceExternalMemoryHostPropertiesEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT" + } + ] + }, + "VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX": { + "(VK_NVX_multiview_per_view_attributes)": [ + { + "vuid": "VUID-VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX" + } + ] + }, + "VkPhysicalDevicePointClippingProperties": { + "(VK_VERSION_1_1,VK_KHR_maintenance2)": [ + { + "vuid": "VUID-VkPhysicalDevicePointClippingProperties-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES" + } + ] + }, + "VkPhysicalDeviceSubgroupProperties": { + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-VkPhysicalDeviceSubgroupProperties-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES" + } + ] + }, + "VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT": { + "(VK_EXT_blend_operation_advanced)": [ + { + "vuid": "VUID-VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT" + } + ] + }, + "VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT": { + "(VK_EXT_vertex_attribute_divisor)": [ + { + "vuid": "VUID-VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT" + } + ] + }, + "VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT": { + "(VK_EXT_sampler_filter_minmax)": [ + { + "vuid": "VUID-VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT" + } + ] + }, + "VkPhysicalDeviceProtectedMemoryProperties": { + "(VK_VERSION_1_1)": [ + { + "vuid": "VUID-VkPhysicalDeviceProtectedMemoryProperties-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES" + } + ] + }, + "VkPhysicalDeviceMaintenance3Properties": { + "(VK_VERSION_1_1,VK_KHR_maintenance3)": [ + { + "vuid": "VUID-VkPhysicalDeviceMaintenance3Properties-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES" + } + ] + }, + "VkPhysicalDeviceDescriptorIndexingPropertiesEXT": { + "(VK_EXT_descriptor_indexing)": [ + { + "vuid": "VUID-VkPhysicalDeviceDescriptorIndexingPropertiesEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT" + } + ] + }, + "VkPhysicalDeviceConservativeRasterizationPropertiesEXT": { + "(VK_EXT_conservative_rasterization)": [ + { + "vuid": "VUID-VkPhysicalDeviceConservativeRasterizationPropertiesEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT" + } + ] + }, + "VkPhysicalDeviceShaderCorePropertiesAMD": { + "(VK_AMD_shader_core_properties)": [ + { + "vuid": "VUID-VkPhysicalDeviceShaderCorePropertiesAMD-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD" + } + ] + }, + "vkGetPhysicalDeviceMultisamplePropertiesEXT": { + "(VK_EXT_sample_locations)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-samples-parameter", + "text": " samples must be a valid VkSampleCountFlagBits value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-pMultisampleProperties-parameter", + "text": " pMultisampleProperties must be a valid pointer to a VkMultisamplePropertiesEXT structure" + } + ] + }, + "VkMultisamplePropertiesEXT": { + "(VK_EXT_sample_locations)": [ + { + "vuid": "VUID-VkMultisamplePropertiesEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT" + }, + { + "vuid": "VUID-VkMultisamplePropertiesEXT-pNext-pNext", + "text": " pNext must be NULL" + } + ] + }, + "vkGetPhysicalDeviceFormatProperties": { + "core": [ + { + "vuid": "VUID-vkGetPhysicalDeviceFormatProperties-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceFormatProperties-format-parameter", + "text": " format must be a valid VkFormat value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceFormatProperties-pFormatProperties-parameter", + "text": " pFormatProperties must be a valid pointer to a VkFormatProperties structure" + } + ] + }, + "vkGetPhysicalDeviceFormatProperties2": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceFormatProperties2-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceFormatProperties2-format-parameter", + "text": " format must be a valid VkFormat value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceFormatProperties2-pFormatProperties-parameter", + "text": " pFormatProperties must be a valid pointer to a VkFormatProperties2 structure" + } + ] + }, + "VkFormatProperties2": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-VkFormatProperties2-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2" + }, + { + "vuid": "VUID-VkFormatProperties2-pNext-pNext", + "text": " pNext must be NULL" + } + ] + }, + "vkGetPhysicalDeviceImageFormatProperties": { + "core": [ + { + "vuid": "VUID-vkGetPhysicalDeviceImageFormatProperties-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceImageFormatProperties-format-parameter", + "text": " format must be a valid VkFormat value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceImageFormatProperties-type-parameter", + "text": " type must be a valid VkImageType value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceImageFormatProperties-tiling-parameter", + "text": " tiling must be a valid VkImageTiling value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceImageFormatProperties-usage-parameter", + "text": " usage must be a valid combination of VkImageUsageFlagBits values" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceImageFormatProperties-usage-requiredbitmask", + "text": " usage must not be 0" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceImageFormatProperties-flags-parameter", + "text": " flags must be a valid combination of VkImageCreateFlagBits values" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceImageFormatProperties-pImageFormatProperties-parameter", + "text": " pImageFormatProperties must be a valid pointer to a VkImageFormatProperties structure" + } + ] + }, + "vkGetPhysicalDeviceExternalImageFormatPropertiesNV": { + "(VK_NV_external_memory_capabilities)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-format-parameter", + "text": " format must be a valid VkFormat value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-type-parameter", + "text": " type must be a valid VkImageType value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-tiling-parameter", + "text": " tiling must be a valid VkImageTiling value" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-parameter", + "text": " usage must be a valid combination of VkImageUsageFlagBits values" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-requiredbitmask", + "text": " usage must not be 0" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-flags-parameter", + "text": " flags must be a valid combination of VkImageCreateFlagBits values" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-externalHandleType-parameter", + "text": " externalHandleType must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-pExternalImageFormatProperties-parameter", + "text": " pExternalImageFormatProperties must be a valid pointer to a VkExternalImageFormatPropertiesNV structure" + } + ] + }, + "vkGetPhysicalDeviceImageFormatProperties2": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)+(VK_ANDROID_external_memory_android_hardware_buffer)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceImageFormatProperties2-pNext-01868", + "text": " If the pNext chain of pImageFormatProperties contains an instance of VkAndroidHardwareBufferUsageANDROID, the pNext chain of pImageFormatInfo must contain an instance of VkPhysicalDeviceExternalImageFormatInfo with handleType set to VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID." + } + ], + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceImageFormatProperties2-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceImageFormatProperties2-pImageFormatInfo-parameter", + "text": " pImageFormatInfo must be a valid pointer to a valid VkPhysicalDeviceImageFormatInfo2 structure" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceImageFormatProperties2-pImageFormatProperties-parameter", + "text": " pImageFormatProperties must be a valid pointer to a VkImageFormatProperties2 structure" + } + ] + }, + "VkPhysicalDeviceImageFormatInfo2": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-VkPhysicalDeviceImageFormatInfo2-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2" + }, + { + "vuid": "VUID-VkPhysicalDeviceImageFormatInfo2-pNext-pNext", + "text": " pNext must be NULL or a pointer to a valid instance of VkPhysicalDeviceExternalImageFormatInfo" + }, + { + "vuid": "VUID-VkPhysicalDeviceImageFormatInfo2-format-parameter", + "text": " format must be a valid VkFormat value" + }, + { + "vuid": "VUID-VkPhysicalDeviceImageFormatInfo2-type-parameter", + "text": " type must be a valid VkImageType value" + }, + { + "vuid": "VUID-VkPhysicalDeviceImageFormatInfo2-tiling-parameter", + "text": " tiling must be a valid VkImageTiling value" + }, + { + "vuid": "VUID-VkPhysicalDeviceImageFormatInfo2-usage-parameter", + "text": " usage must be a valid combination of VkImageUsageFlagBits values" + }, + { + "vuid": "VUID-VkPhysicalDeviceImageFormatInfo2-usage-requiredbitmask", + "text": " usage must not be 0" + }, + { + "vuid": "VUID-VkPhysicalDeviceImageFormatInfo2-flags-parameter", + "text": " flags must be a valid combination of VkImageCreateFlagBits values" + } + ] + }, + "VkImageFormatProperties2": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)": [ + { + "vuid": "VUID-VkImageFormatProperties2-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2" + }, + { + "vuid": "VUID-VkImageFormatProperties2-pNext-pNext", + "text": " Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkAndroidHardwareBufferUsageANDROID, VkExternalImageFormatProperties, VkSamplerYcbcrConversionImageFormatProperties, or VkTextureLODGatherFormatPropertiesAMD" + }, + { + "vuid": "VUID-VkImageFormatProperties2-sType-unique", + "text": " Each sType member in the pNext chain must be unique" + } + ] + }, + "VkPhysicalDeviceExternalImageFormatInfo": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)+(VK_VERSION_1_1,VK_KHR_external_memory_capabilities)": [ + { + "vuid": "VUID-VkPhysicalDeviceExternalImageFormatInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO" + }, + { + "vuid": "VUID-VkPhysicalDeviceExternalImageFormatInfo-handleType-parameter", + "text": " If handleType is not 0, handleType must be a valid VkExternalMemoryHandleTypeFlagBits value" + } + ] + }, + "VkExternalImageFormatProperties": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)+(VK_VERSION_1_1,VK_KHR_external_memory_capabilities)": [ + { + "vuid": "VUID-VkExternalImageFormatProperties-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES" + } + ] + }, + "VkSamplerYcbcrConversionImageFormatProperties": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)+(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)": [ + { + "vuid": "VUID-VkSamplerYcbcrConversionImageFormatProperties-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES" + } + ] + }, + "VkAndroidHardwareBufferUsageANDROID": { + "(VK_VERSION_1_1,VK_KHR_get_physical_device_properties2)+(VK_ANDROID_external_memory_android_hardware_buffer)": [ + { + "vuid": "VUID-VkAndroidHardwareBufferUsageANDROID-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID" + } + ] + }, + "vkGetPhysicalDeviceExternalBufferProperties": { + "(VK_VERSION_1_1,VK_KHR_external_memory_capabilities)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceExternalBufferProperties-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceExternalBufferProperties-pExternalBufferInfo-parameter", + "text": " pExternalBufferInfo must be a valid pointer to a valid VkPhysicalDeviceExternalBufferInfo structure" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceExternalBufferProperties-pExternalBufferProperties-parameter", + "text": " pExternalBufferProperties must be a valid pointer to a VkExternalBufferProperties structure" + } + ] + }, + "VkPhysicalDeviceExternalBufferInfo": { + "(VK_VERSION_1_1,VK_KHR_external_memory_capabilities)": [ + { + "vuid": "VUID-VkPhysicalDeviceExternalBufferInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO" + }, + { + "vuid": "VUID-VkPhysicalDeviceExternalBufferInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkPhysicalDeviceExternalBufferInfo-flags-parameter", + "text": " flags must be a valid combination of VkBufferCreateFlagBits values" + }, + { + "vuid": "VUID-VkPhysicalDeviceExternalBufferInfo-usage-parameter", + "text": " usage must be a valid combination of VkBufferUsageFlagBits values" + }, + { + "vuid": "VUID-VkPhysicalDeviceExternalBufferInfo-usage-requiredbitmask", + "text": " usage must not be 0" + }, + { + "vuid": "VUID-VkPhysicalDeviceExternalBufferInfo-handleType-parameter", + "text": " handleType must be a valid VkExternalMemoryHandleTypeFlagBits value" + } + ] + }, + "VkExternalBufferProperties": { + "(VK_VERSION_1_1,VK_KHR_external_memory_capabilities)": [ + { + "vuid": "VUID-VkExternalBufferProperties-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES" + }, + { + "vuid": "VUID-VkExternalBufferProperties-pNext-pNext", + "text": " pNext must be NULL" + } + ] + }, + "vkGetPhysicalDeviceExternalSemaphoreProperties": { + "(VK_VERSION_1_1,VK_KHR_external_semaphore_capabilities)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-pExternalSemaphoreInfo-parameter", + "text": " pExternalSemaphoreInfo must be a valid pointer to a valid VkPhysicalDeviceExternalSemaphoreInfo structure" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-pExternalSemaphoreProperties-parameter", + "text": " pExternalSemaphoreProperties must be a valid pointer to a VkExternalSemaphoreProperties structure" + } + ] + }, + "VkPhysicalDeviceExternalSemaphoreInfo": { + "(VK_VERSION_1_1,VK_KHR_external_semaphore_capabilities)": [ + { + "vuid": "VUID-VkPhysicalDeviceExternalSemaphoreInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO" + }, + { + "vuid": "VUID-VkPhysicalDeviceExternalSemaphoreInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkPhysicalDeviceExternalSemaphoreInfo-handleType-parameter", + "text": " handleType must be a valid VkExternalSemaphoreHandleTypeFlagBits value" + } + ] + }, + "VkExternalSemaphoreProperties": { + "(VK_VERSION_1_1,VK_KHR_external_semaphore_capabilities)": [ + { + "vuid": "VUID-VkExternalSemaphoreProperties-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES" + }, + { + "vuid": "VUID-VkExternalSemaphoreProperties-pNext-pNext", + "text": " pNext must be NULL" + } + ] + }, + "vkGetPhysicalDeviceExternalFenceProperties": { + "(VK_VERSION_1_1,VK_KHR_external_fence_capabilities)": [ + { + "vuid": "VUID-vkGetPhysicalDeviceExternalFenceProperties-physicalDevice-parameter", + "text": " physicalDevice must be a valid VkPhysicalDevice handle" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceExternalFenceProperties-pExternalFenceInfo-parameter", + "text": " pExternalFenceInfo must be a valid pointer to a valid VkPhysicalDeviceExternalFenceInfo structure" + }, + { + "vuid": "VUID-vkGetPhysicalDeviceExternalFenceProperties-pExternalFenceProperties-parameter", + "text": " pExternalFenceProperties must be a valid pointer to a VkExternalFenceProperties structure" + } + ] + }, + "VkPhysicalDeviceExternalFenceInfo": { + "(VK_VERSION_1_1,VK_KHR_external_fence_capabilities)": [ + { + "vuid": "VUID-VkPhysicalDeviceExternalFenceInfo-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO" + }, + { + "vuid": "VUID-VkPhysicalDeviceExternalFenceInfo-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkPhysicalDeviceExternalFenceInfo-handleType-parameter", + "text": " handleType must be a valid VkExternalFenceHandleTypeFlagBits value" + } + ] + }, + "VkExternalFenceProperties": { + "(VK_VERSION_1_1,VK_KHR_external_fence_capabilities)": [ + { + "vuid": "VUID-VkExternalFenceProperties-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES" + }, + { + "vuid": "VUID-VkExternalFenceProperties-pNext-pNext", + "text": " pNext must be NULL" + } + ] + }, + "vkSetDebugUtilsObjectNameEXT": { + "(VK_EXT_debug_utils)": [ + { + "vuid": "VUID-vkSetDebugUtilsObjectNameEXT-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkSetDebugUtilsObjectNameEXT-pNameInfo-parameter", + "text": " pNameInfo must be a valid pointer to a valid VkDebugUtilsObjectNameInfoEXT structure" + } + ] + }, + "VkDebugUtilsObjectNameInfoEXT": { + "(VK_EXT_debug_utils)": [ + { + "vuid": "VUID-VkDebugUtilsObjectNameInfoEXT-objectType-01905", + "text": " objectType must not be VK_OBJECT_TYPE_UNKNOWN" + }, + { + "vuid": "VUID-VkDebugUtilsObjectNameInfoEXT-objectHandle-01906", + "text": " objectHandle must not be VK_NULL_HANDLE" + }, + { + "vuid": "VUID-VkDebugUtilsObjectNameInfoEXT-objectHandle-01907", + "text": " objectHandle must be a Vulkan object of the type associated with objectType as defined in &amp;lt;&amp;lt;debugging-object-types&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-VkDebugUtilsObjectNameInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT" + }, + { + "vuid": "VUID-VkDebugUtilsObjectNameInfoEXT-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkDebugUtilsObjectNameInfoEXT-objectType-parameter", + "text": " objectType must be a valid VkObjectType value" + }, + { + "vuid": "VUID-VkDebugUtilsObjectNameInfoEXT-pObjectName-parameter", + "text": " If pObjectName is not NULL, pObjectName must be a null-terminated UTF-8 string" + } + ] + }, + "vkSetDebugUtilsObjectTagEXT": { + "(VK_EXT_debug_utils)": [ + { + "vuid": "VUID-vkSetDebugUtilsObjectTagEXT-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkSetDebugUtilsObjectTagEXT-pTagInfo-parameter", + "text": " pTagInfo must be a valid pointer to a valid VkDebugUtilsObjectTagInfoEXT structure" + } + ] + }, + "VkDebugUtilsObjectTagInfoEXT": { + "(VK_EXT_debug_utils)": [ + { + "vuid": "VUID-VkDebugUtilsObjectTagInfoEXT-objectType-01908", + "text": " objectType must not be VK_OBJECT_TYPE_UNKNOWN" + }, + { + "vuid": "VUID-VkDebugUtilsObjectTagInfoEXT-objectHandle-01909", + "text": " objectHandle must not be VK_NULL_HANDLE" + }, + { + "vuid": "VUID-VkDebugUtilsObjectTagInfoEXT-objectHandle-01910", + "text": " objectHandle must be a Vulkan object of the type associated with objectType as defined in &amp;lt;&amp;lt;debugging-object-types&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-VkDebugUtilsObjectTagInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT" + }, + { + "vuid": "VUID-VkDebugUtilsObjectTagInfoEXT-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkDebugUtilsObjectTagInfoEXT-objectType-parameter", + "text": " objectType must be a valid VkObjectType value" + }, + { + "vuid": "VUID-VkDebugUtilsObjectTagInfoEXT-pTag-parameter", + "text": " pTag must be a valid pointer to an array of tagSize bytes" + }, + { + "vuid": "VUID-VkDebugUtilsObjectTagInfoEXT-tagSize-arraylength", + "text": " tagSize must be greater than 0" + } + ] + }, + "vkQueueBeginDebugUtilsLabelEXT": { + "(VK_EXT_debug_utils)": [ + { + "vuid": "VUID-vkQueueBeginDebugUtilsLabelEXT-queue-parameter", + "text": " queue must be a valid VkQueue handle" + }, + { + "vuid": "VUID-vkQueueBeginDebugUtilsLabelEXT-pLabelInfo-parameter", + "text": " pLabelInfo must be a valid pointer to a valid VkDebugUtilsLabelEXT structure" + } + ] + }, + "VkDebugUtilsLabelEXT": { + "(VK_EXT_debug_utils)": [ + { + "vuid": "VUID-VkDebugUtilsLabelEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT" + }, + { + "vuid": "VUID-VkDebugUtilsLabelEXT-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkDebugUtilsLabelEXT-pLabelName-parameter", + "text": " pLabelName must be a null-terminated UTF-8 string" + } + ] + }, + "vkQueueEndDebugUtilsLabelEXT": { + "(VK_EXT_debug_utils)": [ + { + "vuid": "VUID-vkQueueEndDebugUtilsLabelEXT-None-01911", + "text": " There must be an outstanding vkQueueBeginDebugUtilsLabelEXT command prior to the vkQueueEndDebugUtilsLabelEXT on the queue" + }, + { + "vuid": "VUID-vkQueueEndDebugUtilsLabelEXT-queue-parameter", + "text": " queue must be a valid VkQueue handle" + } + ] + }, + "vkQueueInsertDebugUtilsLabelEXT": { + "(VK_EXT_debug_utils)": [ + { + "vuid": "VUID-vkQueueInsertDebugUtilsLabelEXT-queue-parameter", + "text": " queue must be a valid VkQueue handle" + }, + { + "vuid": "VUID-vkQueueInsertDebugUtilsLabelEXT-pLabelInfo-parameter", + "text": " pLabelInfo must be a valid pointer to a valid VkDebugUtilsLabelEXT structure" + } + ] + }, + "vkCmdBeginDebugUtilsLabelEXT": { + "(VK_EXT_debug_utils)": [ + { + "vuid": "VUID-vkCmdBeginDebugUtilsLabelEXT-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdBeginDebugUtilsLabelEXT-pLabelInfo-parameter", + "text": " pLabelInfo must be a valid pointer to a valid VkDebugUtilsLabelEXT structure" + }, + { + "vuid": "VUID-vkCmdBeginDebugUtilsLabelEXT-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdBeginDebugUtilsLabelEXT-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + } + ] + }, + "vkCmdEndDebugUtilsLabelEXT": { + "(VK_EXT_debug_utils)": [ + { + "vuid": "VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912", + "text": " There must be an outstanding vkCmdBeginDebugUtilsLabelEXT command prior to the vkCmdEndDebugUtilsLabelEXT on the queue that commandBuffer is submitted to" + }, + { + "vuid": "VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01913", + "text": " If commandBuffer is a secondary command buffer, there must be an outstanding vkCmdBeginDebugUtilsLabelEXT command recorded to commandBuffer that has not previously been ended by a call to vkCmdEndDebugUtilsLabelEXT." + }, + { + "vuid": "VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + } + ] + }, + "vkCmdInsertDebugUtilsLabelEXT": { + "(VK_EXT_debug_utils)": [ + { + "vuid": "VUID-vkCmdInsertDebugUtilsLabelEXT-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdInsertDebugUtilsLabelEXT-pLabelInfo-parameter", + "text": " pLabelInfo must be a valid pointer to a valid VkDebugUtilsLabelEXT structure" + }, + { + "vuid": "VUID-vkCmdInsertDebugUtilsLabelEXT-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdInsertDebugUtilsLabelEXT-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + } + ] + }, + "vkCreateDebugUtilsMessengerEXT": { + "(VK_EXT_debug_utils)": [ + { + "vuid": "VUID-vkCreateDebugUtilsMessengerEXT-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkCreateDebugUtilsMessengerEXT-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkDebugUtilsMessengerCreateInfoEXT structure" + }, + { + "vuid": "VUID-vkCreateDebugUtilsMessengerEXT-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateDebugUtilsMessengerEXT-pMessenger-parameter", + "text": " pMessenger must be a valid pointer to a VkDebugUtilsMessengerEXT handle" + } + ] + }, + "VkDebugUtilsMessengerCreateInfoEXT": { + "(VK_EXT_debug_utils)": [ + { + "vuid": "VUID-VkDebugUtilsMessengerCreateInfoEXT-pfnUserCallback-01914", + "text": " pfnUserCallback must be a valid PFN_vkDebugUtilsMessengerCallbackEXT" + }, + { + "vuid": "VUID-VkDebugUtilsMessengerCreateInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT" + }, + { + "vuid": "VUID-VkDebugUtilsMessengerCreateInfoEXT-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkDebugUtilsMessengerCreateInfoEXT-messageSeverity-parameter", + "text": " messageSeverity must be a valid combination of VkDebugUtilsMessageSeverityFlagBitsEXT values" + }, + { + "vuid": "VUID-VkDebugUtilsMessengerCreateInfoEXT-messageSeverity-requiredbitmask", + "text": " messageSeverity must not be 0" + }, + { + "vuid": "VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-parameter", + "text": " messageType must be a valid combination of VkDebugUtilsMessageTypeFlagBitsEXT values" + }, + { + "vuid": "VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-requiredbitmask", + "text": " messageType must not be 0" + } + ] + }, + "VkDebugUtilsMessengerCallbackDataEXT": { + "(VK_EXT_debug_utils)": [ + { + "vuid": "VUID-VkDebugUtilsMessengerCallbackDataEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT" + }, + { + "vuid": "VUID-VkDebugUtilsMessengerCallbackDataEXT-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkDebugUtilsMessengerCallbackDataEXT-flags-zerobitmask", + "text": " flags must be 0" + }, + { + "vuid": "VUID-VkDebugUtilsMessengerCallbackDataEXT-pMessageIdName-parameter", + "text": " If pMessageIdName is not NULL, pMessageIdName must be a null-terminated UTF-8 string" + }, + { + "vuid": "VUID-VkDebugUtilsMessengerCallbackDataEXT-pMessage-parameter", + "text": " pMessage must be a null-terminated UTF-8 string" + }, + { + "vuid": "VUID-VkDebugUtilsMessengerCallbackDataEXT-objectCount-arraylength", + "text": " objectCount must be greater than 0" + } + ] + }, + "vkSubmitDebugUtilsMessageEXT": { + "(VK_EXT_debug_utils)": [ + { + "vuid": "VUID-vkSubmitDebugUtilsMessageEXT-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkSubmitDebugUtilsMessageEXT-messageSeverity-parameter", + "text": " messageSeverity must be a valid VkDebugUtilsMessageSeverityFlagBitsEXT value" + }, + { + "vuid": "VUID-vkSubmitDebugUtilsMessageEXT-messageTypes-parameter", + "text": " messageTypes must be a valid combination of VkDebugUtilsMessageTypeFlagBitsEXT values" + }, + { + "vuid": "VUID-vkSubmitDebugUtilsMessageEXT-messageTypes-requiredbitmask", + "text": " messageTypes must not be 0" + }, + { + "vuid": "VUID-vkSubmitDebugUtilsMessageEXT-pCallbackData-parameter", + "text": " pCallbackData must be a valid pointer to a valid VkDebugUtilsMessengerCallbackDataEXT structure" + } + ] + }, + "vkDestroyDebugUtilsMessengerEXT": { + "(VK_EXT_debug_utils)": [ + { + "vuid": "VUID-vkDestroyDebugUtilsMessengerEXT-messenger-01915", + "text": " If VkAllocationCallbacks were provided when messenger was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyDebugUtilsMessengerEXT-messenger-01916", + "text": " If no VkAllocationCallbacks were provided when messenger was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyDebugUtilsMessengerEXT-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkDestroyDebugUtilsMessengerEXT-messenger-parameter", + "text": " messenger must be a valid VkDebugUtilsMessengerEXT handle" + }, + { + "vuid": "VUID-vkDestroyDebugUtilsMessengerEXT-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyDebugUtilsMessengerEXT-messenger-parent", + "text": " messenger must have been created, allocated, or retrieved from instance" + } + ] + }, + "vkDebugMarkerSetObjectNameEXT": { + "(VK_EXT_debug_marker)": [ + { + "vuid": "VUID-vkDebugMarkerSetObjectNameEXT-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDebugMarkerSetObjectNameEXT-pNameInfo-parameter", + "text": " pNameInfo must be a valid pointer to a valid VkDebugMarkerObjectNameInfoEXT structure" + } + ] + }, + "VkDebugMarkerObjectNameInfoEXT": { + "(VK_EXT_debug_marker)": [ + { + "vuid": "VUID-VkDebugMarkerObjectNameInfoEXT-objectType-01490", + "text": " objectType must not be VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT" + }, + { + "vuid": "VUID-VkDebugMarkerObjectNameInfoEXT-object-01491", + "text": " object must not be VK_NULL_HANDLE" + }, + { + "vuid": "VUID-VkDebugMarkerObjectNameInfoEXT-object-01492", + "text": " object must be a Vulkan object of the type associated with objectType as defined in &amp;lt;&amp;lt;debug-report-object-types&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-VkDebugMarkerObjectNameInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT" + }, + { + "vuid": "VUID-VkDebugMarkerObjectNameInfoEXT-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkDebugMarkerObjectNameInfoEXT-objectType-parameter", + "text": " objectType must be a valid VkDebugReportObjectTypeEXT value" + }, + { + "vuid": "VUID-VkDebugMarkerObjectNameInfoEXT-pObjectName-parameter", + "text": " pObjectName must be a null-terminated UTF-8 string" + } + ] + }, + "vkDebugMarkerSetObjectTagEXT": { + "(VK_EXT_debug_marker)": [ + { + "vuid": "VUID-vkDebugMarkerSetObjectTagEXT-device-parameter", + "text": " device must be a valid VkDevice handle" + }, + { + "vuid": "VUID-vkDebugMarkerSetObjectTagEXT-pTagInfo-parameter", + "text": " pTagInfo must be a valid pointer to a valid VkDebugMarkerObjectTagInfoEXT structure" + } + ] + }, + "VkDebugMarkerObjectTagInfoEXT": { + "(VK_EXT_debug_marker)": [ + { + "vuid": "VUID-VkDebugMarkerObjectTagInfoEXT-objectType-01493", + "text": " objectType must not be VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT" + }, + { + "vuid": "VUID-VkDebugMarkerObjectTagInfoEXT-object-01494", + "text": " object must not be VK_NULL_HANDLE" + }, + { + "vuid": "VUID-VkDebugMarkerObjectTagInfoEXT-object-01495", + "text": " object must be a Vulkan object of the type associated with objectType as defined in &amp;lt;&amp;lt;debug-report-object-types&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-VkDebugMarkerObjectTagInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT" + }, + { + "vuid": "VUID-VkDebugMarkerObjectTagInfoEXT-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkDebugMarkerObjectTagInfoEXT-objectType-parameter", + "text": " objectType must be a valid VkDebugReportObjectTypeEXT value" + }, + { + "vuid": "VUID-VkDebugMarkerObjectTagInfoEXT-pTag-parameter", + "text": " pTag must be a valid pointer to an array of tagSize bytes" + }, + { + "vuid": "VUID-VkDebugMarkerObjectTagInfoEXT-tagSize-arraylength", + "text": " tagSize must be greater than 0" + } + ] + }, + "vkCmdDebugMarkerBeginEXT": { + "(VK_EXT_debug_marker)": [ + { + "vuid": "VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdDebugMarkerBeginEXT-pMarkerInfo-parameter", + "text": " pMarkerInfo must be a valid pointer to a valid VkDebugMarkerMarkerInfoEXT structure" + }, + { + "vuid": "VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDebugMarkerBeginEXT-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + } + ] + }, + "VkDebugMarkerMarkerInfoEXT": { + "(VK_EXT_debug_marker)": [ + { + "vuid": "VUID-VkDebugMarkerMarkerInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT" + }, + { + "vuid": "VUID-VkDebugMarkerMarkerInfoEXT-pNext-pNext", + "text": " pNext must be NULL" + }, + { + "vuid": "VUID-VkDebugMarkerMarkerInfoEXT-pMarkerName-parameter", + "text": " pMarkerName must be a null-terminated UTF-8 string" + } + ] + }, + "vkCmdDebugMarkerEndEXT": { + "(VK_EXT_debug_marker)": [ + { + "vuid": "VUID-vkCmdDebugMarkerEndEXT-commandBuffer-01239", + "text": " There must be an outstanding vkCmdDebugMarkerBeginEXT command prior to the vkCmdDebugMarkerEndEXT on the queue that commandBuffer is submitted to" + }, + { + "vuid": "VUID-vkCmdDebugMarkerEndEXT-commandBuffer-01240", + "text": " If commandBuffer is a secondary command buffer, there must be an outstanding vkCmdDebugMarkerBeginEXT command recorded to commandBuffer that has not previously been ended by a call to vkCmdDebugMarkerEndEXT." + }, + { + "vuid": "VUID-vkCmdDebugMarkerEndEXT-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdDebugMarkerEndEXT-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDebugMarkerEndEXT-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + } + ] + }, + "vkCmdDebugMarkerInsertEXT": { + "(VK_EXT_debug_marker)": [ + { + "vuid": "VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-parameter", + "text": " commandBuffer must be a valid VkCommandBuffer handle" + }, + { + "vuid": "VUID-vkCmdDebugMarkerInsertEXT-pMarkerInfo-parameter", + "text": " pMarkerInfo must be a valid pointer to a valid VkDebugMarkerMarkerInfoEXT structure" + }, + { + "vuid": "VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-recording", + "text": " commandBuffer must be in the &amp;lt;&amp;lt;commandbuffers-lifecycle, recording state&amp;gt;&amp;gt;" + }, + { + "vuid": "VUID-vkCmdDebugMarkerInsertEXT-commandBuffer-cmdpool", + "text": " The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations" + } + ] + }, + "vkCreateDebugReportCallbackEXT": { + "(VK_EXT_debug_report)": [ + { + "vuid": "VUID-vkCreateDebugReportCallbackEXT-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkCreateDebugReportCallbackEXT-pCreateInfo-parameter", + "text": " pCreateInfo must be a valid pointer to a valid VkDebugReportCallbackCreateInfoEXT structure" + }, + { + "vuid": "VUID-vkCreateDebugReportCallbackEXT-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkCreateDebugReportCallbackEXT-pCallback-parameter", + "text": " pCallback must be a valid pointer to a VkDebugReportCallbackEXT handle" + } + ] + }, + "VkDebugReportCallbackCreateInfoEXT": { + "(VK_EXT_debug_report)": [ + { + "vuid": "VUID-VkDebugReportCallbackCreateInfoEXT-pfnCallback-01385", + "text": " pfnCallback must be a valid PFN_vkDebugReportCallbackEXT" + }, + { + "vuid": "VUID-VkDebugReportCallbackCreateInfoEXT-sType-sType", + "text": " sType must be VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT" + }, + { + "vuid": "VUID-VkDebugReportCallbackCreateInfoEXT-flags-parameter", + "text": " flags must be a valid combination of VkDebugReportFlagBitsEXT values" + } + ] + }, + "vkDebugReportMessageEXT": { + "(VK_EXT_debug_report)": [ + { + "vuid": "VUID-vkDebugReportMessageEXT-object-01241", + "text": " object must be a Vulkan object or VK_NULL_HANDLE" + }, + { + "vuid": "VUID-vkDebugReportMessageEXT-objectType-01498", + "text": " If objectType is not VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT and object is not VK_NULL_HANDLE, object must be a Vulkan object of the corresponding type associated with objectType as defined in &amp;lt;&amp;lt;debug-report-object-types&amp;gt;&amp;gt;." + }, + { + "vuid": "VUID-vkDebugReportMessageEXT-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkDebugReportMessageEXT-flags-parameter", + "text": " flags must be a valid combination of VkDebugReportFlagBitsEXT values" + }, + { + "vuid": "VUID-vkDebugReportMessageEXT-flags-requiredbitmask", + "text": " flags must not be 0" + }, + { + "vuid": "VUID-vkDebugReportMessageEXT-objectType-parameter", + "text": " objectType must be a valid VkDebugReportObjectTypeEXT value" + }, + { + "vuid": "VUID-vkDebugReportMessageEXT-pLayerPrefix-parameter", + "text": " pLayerPrefix must be a null-terminated UTF-8 string" + }, + { + "vuid": "VUID-vkDebugReportMessageEXT-pMessage-parameter", + "text": " pMessage must be a null-terminated UTF-8 string" + } + ] + }, + "vkDestroyDebugReportCallbackEXT": { + "(VK_EXT_debug_report)": [ + { + "vuid": "VUID-vkDestroyDebugReportCallbackEXT-instance-01242", + "text": " If VkAllocationCallbacks were provided when callback was created, a compatible set of callbacks must be provided here" + }, + { + "vuid": "VUID-vkDestroyDebugReportCallbackEXT-instance-01243", + "text": " If no VkAllocationCallbacks were provided when callback was created, pAllocator must be NULL" + }, + { + "vuid": "VUID-vkDestroyDebugReportCallbackEXT-instance-parameter", + "text": " instance must be a valid VkInstance handle" + }, + { + "vuid": "VUID-vkDestroyDebugReportCallbackEXT-callback-parameter", + "text": " callback must be a valid VkDebugReportCallbackEXT handle" + }, + { + "vuid": "VUID-vkDestroyDebugReportCallbackEXT-pAllocator-parameter", + "text": " If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure" + }, + { + "vuid": "VUID-vkDestroyDebugReportCallbackEXT-callback-parent", + "text": " callback must have been created, allocated, or retrieved from instance" + } + ] + } + } +} \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/scripts/vk_validation_stats.py vulkan-1.1.73+dfsg/scripts/vk_validation_stats.py --- vulkan-1.0.65.2+dfsg1/scripts/vk_validation_stats.py 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/vk_validation_stats.py 2018-03-14 09:08:48.000000000 +0000 @@ -24,6 +24,13 @@ import platform # vk_validation_stats.py overview +# +# usage: +# python vk_validation_stats.py [verbose] +# +# Arguments: +# verbose - enables verbose output, including VUID duplicates +# # This script is intended to generate statistics on the state of validation code # based on information parsed from the source files and the database file # Here's what it currently does: @@ -185,12 +192,12 @@ filepath = '../%s/layers/%s' % (build_dir, source) if os.path.isfile(filepath): qualified_paths.append(filepath) - continue + break if len(self.generated_source_files) != len(qualified_paths): print("Error: Unable to locate one or more of the following source files in the %s directories" % (", ".join(generated_source_directories))) print(self.generated_source_files) print("Skipping documentation validation test") - quit() + exit(1) else: self.source_files.extend(qualified_paths) @@ -206,14 +213,14 @@ continue # Find enums #if 'VALIDATION_ERROR_' in line and True not in [ignore in line for ignore in ['[VALIDATION_ERROR_', 'UNIQUE_VALIDATION_ERROR_CODE']]: - if ' VALIDATION_ERROR_' in line: + if 'VALIDATION_ERROR_' in line: # Need to isolate the validation error enum #print("Line has check:%s" % (line)) line_list = line.split() enum_list = [] for str in line_list: if 'VALIDATION_ERROR_' in str and True not in [ignore_str in str for ignore_str in ['[VALIDATION_ERROR_', 'VALIDATION_ERROR_UNDEFINED', 'UNIQUE_VALIDATION_ERROR_CODE']]: - enum_list.append(str.strip(',);')) + enum_list.append(str.strip(',);{}')) #break for enum in enum_list: if enum != '': @@ -303,7 +310,7 @@ def main(argv): result = 0 # Non-zero result indicates an error case - terse_mode = 'terse_mode' in sys.argv + verbose_mode = 'verbose' in sys.argv # parse db val_db = ValidationDatabase() val_db.read() @@ -320,14 +327,14 @@ # Process stats - Just doing this inline in main, could make a fancy class to handle # all the processing of data and then get results from that txt_color = bcolors() - if terse_mode == False: + if verbose_mode: print("Validation Statistics") else: - print("Validation/Documentation Consistency Test)") + print("Validation/Documentation Consistency Test") # First give number of checks in db & header and report any discrepancies db_enums = len(val_db.db_dict.keys()) hdr_enums = len(val_header.enums) - if not terse_mode: + if verbose_mode: print(" Database file includes %d unique checks" % (db_enums)) print(" Header file declares %d unique checks" % (hdr_enums)) @@ -346,7 +353,7 @@ if not tmp_db_dict.pop(enum, False): db_missing.append(enum) if db_enums == hdr_enums and len(db_missing) == 0 and len(tmp_db_dict.keys()) == 0: - if not terse_mode: + if verbose_mode: print(txt_color.green() + " Database and Header match, GREAT!" + txt_color.endc()) else: print(txt_color.red() + " Uh oh, Database doesn't match Header :(" + txt_color.endc()) @@ -372,15 +379,15 @@ multiple_uses = True if src_enum not in val_db.db_implemented_enums: imp_not_claimed.append(src_enum) - if not terse_mode: + if verbose_mode: print(" Database file claims that %d checks (%s) are implemented in source." % (len(val_db.db_implemented_enums), "{0:.0f}%".format(float(len(val_db.db_implemented_enums))/db_enums * 100))) - if len(val_db.db_unimplemented_implicit) > 0 and not terse_mode: + if len(val_db.db_unimplemented_implicit) > 0 and verbose_mode: print(" Database file claims %d implicit checks (%s) that are not implemented." % (len(val_db.db_unimplemented_implicit), "{0:.0f}%".format(float(len(val_db.db_unimplemented_implicit))/db_enums * 100))) total_checks = len(val_db.db_implemented_enums) + len(val_db.db_unimplemented_implicit) print(" If all implicit checks are handled by parameter validation this is a total of %d (%s) checks covered." % (total_checks, "{0:.0f}%".format(float(total_checks)/db_enums * 100))) if len(imp_not_found) == 0 and len(imp_not_claimed) == 0: - if not terse_mode: + if verbose_mode: print(txt_color.green() + " All claimed Database implemented checks have been found in source, and no source checks aren't claimed in Database, GREAT!" + txt_color.endc()) else: result = 1 @@ -394,7 +401,7 @@ for imp_enum in imp_not_claimed: print(txt_color.red() + " %s" % (imp_enum) + txt_color.endc()) - if multiple_uses and not terse_mode: + if multiple_uses and verbose_mode: print(txt_color.yellow() + " Note that some checks are used multiple times. These may be good candidates for new valid usage spec language." + txt_color.endc()) print(txt_color.yellow() + " Here is a list of each check used multiple times with its number of uses:" + txt_color.endc()) for enum in val_source.enum_count_dict: @@ -421,7 +428,7 @@ if testname not in tests_missing_enum: tests_missing_enum[testname] = [] tests_missing_enum[testname].append(enum) - if tests_missing_enum and not terse_mode: + if tests_missing_enum and verbose_mode: print(txt_color.yellow() + " \nThe following tests do not use their reported enums to check for the validation error. You may want to update these to pass the expected enum to SetDesiredFailureMsg:" + txt_color.endc()) for testname in tests_missing_enum: print(txt_color.yellow() + " Testname %s does not explicitly check for these ids:" % (testname) + txt_color.endc()) @@ -429,10 +436,10 @@ print(txt_color.yellow() + " %s" % (enum) + txt_color.endc()) # TODO : Go through all enums found in the test file and make sure they're correctly documented in the database file - if not terse_mode: + if verbose_mode: print(" Database file claims that %d checks have tests written." % len(val_db.db_enum_to_tests)) if len(bad_testnames) == 0: - if not terse_mode: + if verbose_mode: print(txt_color.green() + " All claimed tests have valid names. That's good!" + txt_color.endc()) else: print(txt_color.red() + " The following testnames in Database appear to be invalid:") diff -Nru vulkan-1.0.65.2+dfsg1/scripts/vk.xml vulkan-1.1.73+dfsg/scripts/vk.xml --- vulkan-1.0.65.2+dfsg1/scripts/vk.xml 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/vk.xml 2018-04-27 11:24:19.000000000 +0000 @@ -1,7 +1,7 @@ -Copyright (c) 2015-2017 The Khronos Group Inc. +Copyright (c) 2015-2018 The Khronos Group Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,7 +24,8 @@ material which is registered by Khronos, such as tags used by extension and layer authors. The authoritative public version of vk.xml is maintained in the master branch of the Khronos Vulkan GitHub project. The authoritative -private version is maintained in the 1.0 branch of the member gitlab server. +private version is maintained in the master branch of the member gitlab +server. @@ -34,6 +35,19 @@ + + + + + + + + + + + + + @@ -68,20 +82,34 @@ #include "vk_platform.h" WSI extensions - #include "vulkan.h" - #include <X11/Xlib.h> - #include <X11/extensions/Xrandr.h> - #include <android/native_window.h> - #include <mir_toolkit/client_types.h> - #include <wayland-client.h> - #include <windows.h> - #include <xcb/xcb.h> + + + + + + + + + In the current header structure, each platform's interfaces + are confined to a platform-specific header (vulkan_xlib.h, + vulkan_win32.h, etc.). These headers are not self-contained, + and should not include native headers (X11/Xlib.h, + windows.h, etc.). Code should either include vulkan.h after + defining the appropriate VK_USE_PLATFORM_platform_KHR + macros, or include the required native headers prior to + explicitly including the corresponding platform header. + + To accomplish this, the dependencies of native types require + native headers, but the XML defines the content for those + native headers as empty. The actual native header includes + can be restored by modifying the native header tags above + to #include the header file in the 'name' attribute. + - @@ -106,8 +134,10 @@ //#define VK_API_VERSION VK_MAKE_VERSION(1, 0, 0) // Patch version should always be set to 0 // Vulkan 1.0 version number #define VK_API_VERSION_1_0 VK_MAKE_VERSION(1, 0, 0)// Patch version should always be set to 0 + // Vulkan 1.1 version number +#define VK_API_VERSION_1_1 VK_MAKE_VERSION(1, 1, 0)// Patch version should always be set to 0 // Version of this file -#define VK_HEADER_VERSION 65 +#define VK_HEADER_VERSION 73 #define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; @@ -126,6 +156,9 @@ #define VK_NULL_HANDLE 0 + struct ANativeWindow; + struct AHardwareBuffer; + typedef uint32_t VkSampleMask; typedef uint32_t VkBool32; typedef uint32_t VkFlags; @@ -163,7 +196,7 @@ typedef VkFlags VkBufferViewCreateFlags; typedef VkFlags VkInstanceCreateFlags; typedef VkFlags VkDeviceCreateFlags; - typedef VkFlags VkDeviceQueueCreateFlags; + typedef VkFlags VkDeviceQueueCreateFlags; typedef VkFlags VkQueueFlags; typedef VkFlags VkMemoryPropertyFlags; typedef VkFlags VkMemoryHeapFlags; @@ -201,11 +234,12 @@ typedef VkFlags VkDescriptorPoolCreateFlags; typedef VkFlags VkDescriptorPoolResetFlags; typedef VkFlags VkDependencyFlags; - + typedef VkFlags VkSubgroupFeatureFlags; typedef VkFlags VkIndirectCommandsLayoutUsageFlagsNVX; typedef VkFlags VkObjectEntryUsageFlagsNVX; - typedef VkFlags VkDescriptorUpdateTemplateCreateFlagsKHR; + typedef VkFlags VkDescriptorUpdateTemplateCreateFlags; + WSI extensions typedef VkFlags VkCompositeAlphaFlagsKHR; @@ -223,28 +257,45 @@ typedef VkFlags VkXcbSurfaceCreateFlagsKHR; typedef VkFlags VkIOSSurfaceCreateFlagsMVK; typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; - typedef VkFlags VkPeerMemoryFeatureFlagsKHX; - typedef VkFlags VkMemoryAllocateFlagsKHX; - typedef VkFlags VkDeviceGroupPresentModeFlagsKHX; + typedef VkFlags VkPeerMemoryFeatureFlags; + + typedef VkFlags VkMemoryAllocateFlags; + + typedef VkFlags VkDeviceGroupPresentModeFlagsKHR; typedef VkFlags VkDebugReportFlagsEXT; - typedef VkFlags VkCommandPoolTrimFlagsKHR; + typedef VkFlags VkCommandPoolTrimFlags; + typedef VkFlags VkExternalMemoryHandleTypeFlagsNV; typedef VkFlags VkExternalMemoryFeatureFlagsNV; - typedef VkFlags VkExternalMemoryHandleTypeFlagsKHR; - typedef VkFlags VkExternalMemoryFeatureFlagsKHR; - typedef VkFlags VkExternalSemaphoreHandleTypeFlagsKHR; - typedef VkFlags VkExternalSemaphoreFeatureFlagsKHR; - typedef VkFlags VkSemaphoreImportFlagsKHR; - typedef VkFlags VkExternalFenceHandleTypeFlagsKHR; - typedef VkFlags VkExternalFenceFeatureFlagsKHR; - typedef VkFlags VkFenceImportFlagsKHR; + typedef VkFlags VkExternalMemoryHandleTypeFlags; + + typedef VkFlags VkExternalMemoryFeatureFlags; + + typedef VkFlags VkExternalSemaphoreHandleTypeFlags; + + typedef VkFlags VkExternalSemaphoreFeatureFlags; + + typedef VkFlags VkSemaphoreImportFlags; + + typedef VkFlags VkExternalFenceHandleTypeFlags; + + typedef VkFlags VkExternalFenceFeatureFlags; + + typedef VkFlags VkFenceImportFlags; + typedef VkFlags VkSurfaceCounterFlagsEXT; typedef VkFlags VkPipelineViewportSwizzleStateCreateFlagsNV; typedef VkFlags VkPipelineDiscardRectangleStateCreateFlagsEXT; typedef VkFlags VkPipelineCoverageToColorStateCreateFlagsNV; typedef VkFlags VkPipelineCoverageModulationStateCreateFlagsNV; - typedef VkFlags VkValidationCacheCreateFlagsEXT; + typedef VkFlags VkValidationCacheCreateFlagsEXT; + typedef VkFlags VkDebugUtilsMessageSeverityFlagsEXT; + typedef VkFlags VkDebugUtilsMessageTypeFlagsEXT; + typedef VkFlags VkDebugUtilsMessengerCreateFlagsEXT; + typedef VkFlags VkDebugUtilsMessengerCallbackDataFlagsEXT; + typedef VkFlags VkPipelineRasterizationConservativeStateCreateFlagsEXT; + typedef VkFlags VkDescriptorBindingFlagsEXT; Types which can be void pointers or class pointers, selected at compile time VK_DEFINE_HANDLE(VkInstance) @@ -274,8 +325,10 @@ VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineCache) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkObjectTableNVX) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectCommandsLayoutNVX) - VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplateKHR) - VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSamplerYcbcrConversionKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplate) + + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSamplerYcbcrConversion) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkValidationCacheEXT) WSI extensions @@ -284,6 +337,7 @@ VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugUtilsMessengerEXT) Types generated from corresponding enums tags below @@ -373,21 +427,25 @@ + Extensions - + + - + + + WSI extensions @@ -401,28 +459,45 @@ - - - - - - - - + + + + + + + + + + + + + + + + - - - + + + + + - - - - + + + + + + + + + + + The PFN_vk*Function types are used by VkAllocationCallbacks below typedef void (VKAPI_PTR *PFN_vkInternalAllocationNotification)( @@ -464,6 +539,13 @@ const char* pMessage, void* pUserData); + The PFN_vkDebugUtilsMessengerCallbackEXT type are used by the VK_EXT_debug_utils extension + typedef VkBool32 (VKAPI_PTR *PFN_vkDebugUtilsMessengerCallbackEXT)( + VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, + VkDebugUtilsMessageTypeFlagsEXT messageType, + const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, + void* pUserData); + Struct types int32_t x @@ -1328,7 +1410,7 @@ uint32_t maxGeometryOutputVerticesmax number of vertices that can be emitted in geometry stage uint32_t maxGeometryTotalOutputComponentsmax total number of components (all vertices) written in geometry stage fragment stage limits - uint32_t maxFragmentInputComponentsmax number of input compontents read in fragment stage + uint32_t maxFragmentInputComponentsmax number of input components read in fragment stage uint32_t maxFragmentOutputAttachmentsmax number of output attachments written in fragment stage uint32_t maxFragmentDualSrcAttachmentsmax number of output attachments written when using dual source blending uint32_t maxFragmentCombinedOutputResourcesmax total number of storage buffers, storage images and output buffers @@ -1495,7 +1577,7 @@ VkStructureType sType - const void* pNext + const void* pNext VkRect2D srcRectRectangle within the presentable image to read pixel data from when presenting to the display. VkRect2D dstRectRectangle within the current display mode's visible region to display srcRectangle in. VkBool32 persistentFor smart displays, use buffered mode. If the display properties member "persistentMode" is VK_FALSE, this member must always be VK_FALSE. @@ -1514,9 +1596,9 @@ VkStructureType sType - const void* pNext - VkAndroidSurfaceCreateFlagsKHR flags - ANativeWindow* window + const void* pNext + VkAndroidSurfaceCreateFlagsKHR flags + struct ANativeWindow* window VkStructureType sType @@ -1608,7 +1690,7 @@ VkStructureType sType - const void* pNext + const void* pNext VkRasterizationOrderAMD rasterizationOrderRasterization order to use for the pipeline @@ -1635,17 +1717,17 @@ VkStructureType sType - const void* pNext + const void* pNext VkBool32 dedicatedAllocationWhether this image uses a dedicated allocation VkStructureType sType - const void* pNext + const void* pNext VkBool32 dedicatedAllocationWhether this buffer uses a dedicated allocation VkStructureType sType - const void* pNext + const void* pNext VkImage imageImage that this allocation will be bound to VkBuffer bufferBuffer that this allocation will be bound to @@ -1679,7 +1761,7 @@ VkStructureType sType - const void* pNext + const void* pNext uint32_t acquireCount const VkDeviceMemory* pAcquireSyncs const uint64_t* pAcquireKeys @@ -1788,28 +1870,32 @@ VkPipelineLayout pipelineLayout VkShaderStageFlags stageFlags - - VkStructureType sType + + VkStructureType sType void* pNext VkPhysicalDeviceFeatures features - - VkStructureType sType + + + VkStructureType sType void* pNext VkPhysicalDeviceProperties properties - - VkStructureType sType + + + VkStructureType sType void* pNext VkFormatProperties formatProperties - - VkStructureType sType + + + VkStructureType sType void* pNext VkImageFormatProperties imageFormatProperties - - VkStructureType sType + + + VkStructureType sType const void* pNext VkFormat format VkImageType type @@ -1817,23 +1903,27 @@ VkImageUsageFlags usage VkImageCreateFlags flags - - VkStructureType sType + + + VkStructureType sType void* pNext VkQueueFamilyProperties queueFamilyProperties - - VkStructureType sType + + + VkStructureType sType void* pNext VkPhysicalDeviceMemoryProperties memoryProperties - - VkStructureType sType + + + VkStructureType sType void* pNext VkSparseImageFormatProperties properties - - VkStructureType sType + + + VkStructureType sType const void* pNext VkFormat format VkImageType type @@ -1841,14 +1931,15 @@ VkImageUsageFlags usage VkImageTiling tiling - + + VkStructureType sType void* pNext uint32_t maxPushDescriptors VkStructureType sType - const void* pNext + const void* pNext uint32_t swapchainCountCopy of VkPresentInfoKHR::swapchainCount const VkPresentRegionKHR* pRegionsThe regions that have changed @@ -1861,67 +1952,77 @@ VkExtent2D extentDimensions of a rectangle that has not changed, in pixels of a presentation images uint32_t layerLayer of a swapchain's image(s), for stereoscopic-3D images - - VkStructureType sType + + VkStructureType sType void* pNext VkBool32 variablePointersStorageBuffer VkBool32 variablePointers - - VkExternalMemoryFeatureFlagsKHR externalMemoryFeatures - VkExternalMemoryHandleTypeFlagsKHR exportFromImportedHandleTypes - VkExternalMemoryHandleTypeFlagsKHR compatibleHandleTypes - - - VkStructureType sType - const void* pNext - VkExternalMemoryHandleTypeFlagBitsKHR handleType - - - VkStructureType sType + + + VkExternalMemoryFeatureFlags externalMemoryFeatures + VkExternalMemoryHandleTypeFlags exportFromImportedHandleTypes + VkExternalMemoryHandleTypeFlags compatibleHandleTypes + + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagBits handleType + + + + VkStructureType sType void* pNext - VkExternalMemoryPropertiesKHR externalMemoryProperties + VkExternalMemoryProperties externalMemoryProperties - - VkStructureType sType + + + VkStructureType sType const void* pNext VkBufferCreateFlags flags VkBufferUsageFlags usage - VkExternalMemoryHandleTypeFlagBitsKHR handleType + VkExternalMemoryHandleTypeFlagBits handleType - - VkStructureType sType + + + VkStructureType sType void* pNext - VkExternalMemoryPropertiesKHR externalMemoryProperties + VkExternalMemoryProperties externalMemoryProperties - - VkStructureType sType + + + VkStructureType sType void* pNext uint8_t deviceUUID[VK_UUID_SIZE] uint8_t driverUUID[VK_UUID_SIZE] - uint8_t deviceLUID[VK_LUID_SIZE_KHR] + uint8_t deviceLUID[VK_LUID_SIZE] uint32_t deviceNodeMask VkBool32 deviceLUIDValid - - VkStructureType sType + + + VkStructureType sType const void* pNext - VkExternalMemoryHandleTypeFlagsKHR handleTypes + VkExternalMemoryHandleTypeFlags handleTypes - - VkStructureType sType + + + VkStructureType sType const void* pNext - VkExternalMemoryHandleTypeFlagsKHR handleTypes + VkExternalMemoryHandleTypeFlags handleTypes - - VkStructureType sType + + + VkStructureType sType const void* pNext - VkExternalMemoryHandleTypeFlagsKHR handleTypes + VkExternalMemoryHandleTypeFlags handleTypes + VkStructureType sType const void* pNext - VkExternalMemoryHandleTypeFlagBitsKHR handleType + VkExternalMemoryHandleTypeFlagBits handleType HANDLE handle LPCWSTR name @@ -1941,12 +2042,12 @@ VkStructureType sType const void* pNext VkDeviceMemory memory - VkExternalMemoryHandleTypeFlagBitsKHR handleType + VkExternalMemoryHandleTypeFlagBits handleType VkStructureType sType const void* pNext - VkExternalMemoryHandleTypeFlagBitsKHR handleType + VkExternalMemoryHandleTypeFlagBits handleType int fd @@ -1958,11 +2059,11 @@ VkStructureType sType const void* pNext VkDeviceMemory memory - VkExternalMemoryHandleTypeFlagBitsKHR handleType + VkExternalMemoryHandleTypeFlagBits handleType VkStructureType sType - const void* pNext + const void* pNext uint32_t acquireCount const VkDeviceMemory* pAcquireSyncs const uint64_t* pAcquireKeys @@ -1971,29 +2072,32 @@ const VkDeviceMemory* pReleaseSyncs const uint64_t* pReleaseKeys - - VkStructureType sType + + VkStructureType sType const void* pNext - VkExternalSemaphoreHandleTypeFlagBitsKHR handleType + VkExternalSemaphoreHandleTypeFlagBits handleType - - VkStructureType sType + + + VkStructureType sType void* pNext - VkExternalSemaphoreHandleTypeFlagsKHR exportFromImportedHandleTypes - VkExternalSemaphoreHandleTypeFlagsKHR compatibleHandleTypes - VkExternalSemaphoreFeatureFlagsKHR externalSemaphoreFeatures + VkExternalSemaphoreHandleTypeFlags exportFromImportedHandleTypes + VkExternalSemaphoreHandleTypeFlags compatibleHandleTypes + VkExternalSemaphoreFeatureFlags externalSemaphoreFeatures - - VkStructureType sType + + + VkStructureType sType const void* pNext - VkExternalSemaphoreHandleTypeFlagsKHR handleTypes + VkExternalSemaphoreHandleTypeFlags handleTypes + VkStructureType sType const void* pNext VkSemaphore semaphore - VkSemaphoreImportFlagsKHR flags - VkExternalSemaphoreHandleTypeFlagBitsKHR handleType + VkSemaphoreImportFlags flags + VkExternalSemaphoreHandleTypeFlagBits handleType HANDLE handle LPCWSTR name @@ -2006,7 +2110,7 @@ VkStructureType sType - const void* pNext + const void* pNext uint32_t waitSemaphoreValuesCount const uint64_t* pWaitSemaphoreValues uint32_t signalSemaphoreValuesCount @@ -2016,45 +2120,48 @@ VkStructureType sType const void* pNext VkSemaphore semaphore - VkExternalSemaphoreHandleTypeFlagBitsKHR handleType + VkExternalSemaphoreHandleTypeFlagBits handleType VkStructureType sType const void* pNext VkSemaphore semaphore - VkSemaphoreImportFlagsKHR flags - VkExternalSemaphoreHandleTypeFlagBitsKHR handleType + VkSemaphoreImportFlags flags + VkExternalSemaphoreHandleTypeFlagBits handleType int fd VkStructureType sType const void* pNext VkSemaphore semaphore - VkExternalSemaphoreHandleTypeFlagBitsKHR handleType + VkExternalSemaphoreHandleTypeFlagBits handleType - - VkStructureType sType + + VkStructureType sType const void* pNext - VkExternalFenceHandleTypeFlagBitsKHR handleType + VkExternalFenceHandleTypeFlagBits handleType - - VkStructureType sType + + + VkStructureType sType void* pNext - VkExternalFenceHandleTypeFlagsKHR exportFromImportedHandleTypes - VkExternalFenceHandleTypeFlagsKHR compatibleHandleTypes - VkExternalFenceFeatureFlagsKHR externalFenceFeatures + VkExternalFenceHandleTypeFlags exportFromImportedHandleTypes + VkExternalFenceHandleTypeFlags compatibleHandleTypes + VkExternalFenceFeatureFlags externalFenceFeatures - - VkStructureType sType + + + VkStructureType sType const void* pNext - VkExternalFenceHandleTypeFlagsKHR handleTypes + VkExternalFenceHandleTypeFlags handleTypes + VkStructureType sType const void* pNext VkFence fence - VkFenceImportFlagsKHR flags - VkExternalFenceHandleTypeFlagBitsKHR handleType + VkFenceImportFlags flags + VkExternalFenceHandleTypeFlagBits handleType HANDLE handle LPCWSTR name @@ -2069,37 +2176,39 @@ VkStructureType sType const void* pNext VkFence fence - VkExternalFenceHandleTypeFlagBitsKHR handleType + VkExternalFenceHandleTypeFlagBits handleType VkStructureType sType const void* pNext VkFence fence - VkFenceImportFlagsKHR flags - VkExternalFenceHandleTypeFlagBitsKHR handleType + VkFenceImportFlags flags + VkExternalFenceHandleTypeFlagBits handleType int fd VkStructureType sType const void* pNext VkFence fence - VkExternalFenceHandleTypeFlagBitsKHR handleType + VkExternalFenceHandleTypeFlagBits handleType - - VkStructureType sType + + VkStructureType sType void* pNext VkBool32 multiviewMultiple views in a renderpass VkBool32 multiviewGeometryShaderMultiple views in a renderpass w/ geometry shader VkBool32 multiviewTessellationShaderMultiple views in a renderpass w/ tessellation shader - - VkStructureType sType + + + VkStructureType sType void* pNext uint32_t maxMultiviewViewCountmax number of views in a subpass uint32_t maxMultiviewInstanceIndexmax instance index for a draw in a multiview subpass - - VkStructureType sType + + + VkStructureType sType const void* pNext uint32_t subpassCount const uint32_t* pViewMasks @@ -2108,6 +2217,7 @@ uint32_t correlationMaskCount const uint32_t* pCorrelationMasks + VkStructureType sType void* pNext @@ -2143,62 +2253,70 @@ const void* pNext VkSurfaceCounterFlagsEXT surfaceCounters - - VkStructureType sType + + VkStructureType sType void* pNext uint32_t physicalDeviceCount - VkPhysicalDevice physicalDevices[VK_MAX_DEVICE_GROUP_SIZE_KHX] + VkPhysicalDevice physicalDevices[VK_MAX_DEVICE_GROUP_SIZE] VkBool32 subsetAllocation - - VkStructureType sType - const void* pNext - VkMemoryAllocateFlagsKHX flags + + + VkStructureType sType + const void* pNext + VkMemoryAllocateFlags flags uint32_t deviceMask - - VkStructureType sType + + + VkStructureType sType const void* pNext VkBuffer buffer VkDeviceMemory memory VkDeviceSize memoryOffset - - VkStructureType sType + + + VkStructureType sType const void* pNext uint32_t deviceIndexCount const uint32_t* pDeviceIndices - - VkStructureType sType + + + VkStructureType sType const void* pNext VkImage image VkDeviceMemory memory VkDeviceSize memoryOffset - - VkStructureType sType + + + VkStructureType sType const void* pNext uint32_t deviceIndexCount const uint32_t* pDeviceIndices - uint32_t SFRRectCount - const VkRect2D* pSFRRects + uint32_t splitInstanceBindRegionCount + const VkRect2D* pSplitInstanceBindRegions - - VkStructureType sType - const void* pNext + + + VkStructureType sType + const void* pNext uint32_t deviceMask uint32_t deviceRenderAreaCount const VkRect2D* pDeviceRenderAreas - - VkStructureType sType - const void* pNext + + + VkStructureType sType + const void* pNext uint32_t deviceMask - - VkStructureType sType - const void* pNext + + + VkStructureType sType + const void* pNext uint32_t waitSemaphoreCount const uint32_t* pWaitSemaphoreDeviceIndices uint32_t commandBufferCount @@ -2206,31 +2324,33 @@ uint32_t signalSemaphoreCount const uint32_t* pSignalSemaphoreDeviceIndices - - VkStructureType sType - const void* pNext + + + VkStructureType sType + const void* pNext uint32_t resourceDeviceIndex uint32_t memoryDeviceIndex - - VkStructureType sType + + + VkStructureType sType const void* pNext - uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE_KHX] - VkDeviceGroupPresentModeFlagsKHX modes + uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE] + VkDeviceGroupPresentModeFlagsKHR modes - - VkStructureType sType - const void* pNext + + VkStructureType sType + const void* pNext VkSwapchainKHR swapchain - - VkStructureType sType - const void* pNext + + VkStructureType sType + const void* pNext VkSwapchainKHR swapchain uint32_t imageIndex - - VkStructureType sType + + VkStructureType sType const void* pNext VkSwapchainKHR swapchain uint64_t timeout @@ -2238,25 +2358,26 @@ VkFence fence uint32_t deviceMask - - VkStructureType sType - const void* pNext + + VkStructureType sType + const void* pNext uint32_t swapchainCount const uint32_t* pDeviceMasks - VkDeviceGroupPresentModeFlagBitsKHX mode + VkDeviceGroupPresentModeFlagBitsKHR mode - - VkStructureType sType - const void* pNext + + VkStructureType sType + const void* pNext uint32_t physicalDeviceCount const VkPhysicalDevice* pPhysicalDevices - - VkStructureType sType - const void* pNext - VkDeviceGroupPresentModeFlagsKHX modes + + + VkStructureType sType + const void* pNext + VkDeviceGroupPresentModeFlagsKHR modes - + uint32_t dstBindingBinding within the destination descriptor set to write uint32_t dstArrayElementArray element within the destination binding to write uint32_t descriptorCountNumber of descriptors to write @@ -2264,18 +2385,20 @@ size_t offsetOffset into pData where the descriptors to update are stored size_t strideStride between two descriptors in pData when writing more than one descriptor - - VkStructureType sType + + + VkStructureType sType void* pNext - VkDescriptorUpdateTemplateCreateFlagsKHR flags + VkDescriptorUpdateTemplateCreateFlags flags uint32_t descriptorUpdateEntryCountNumber of descriptor update entries to use for the update template - const VkDescriptorUpdateTemplateEntryKHR* pDescriptorUpdateEntriesDescriptor update entries for the template - VkDescriptorUpdateTemplateTypeKHR templateType + const VkDescriptorUpdateTemplateEntry* pDescriptorUpdateEntriesDescriptor update entries for the template + VkDescriptorUpdateTemplateType templateType VkDescriptorSetLayout descriptorSetLayout - VkPipelineBindPoint pipelineBindPoint - VkPipelineLayoutpipelineLayoutIf used for push descriptors, this is the only allowed layout - uint32_t set + VkPipelineBindPoint pipelineBindPoint + VkPipelineLayoutpipelineLayoutIf used for push descriptors, this is the only allowed layout + uint32_t set + float x float y @@ -2307,7 +2430,7 @@ VkStructureType sType - const void* pNext + const void* pNext uint32_t swapchainCountCopy of VkPresentInfoKHR::swapchainCount const VkPresentTimeGOOGLE* pTimesThe earliest times to present images @@ -2333,7 +2456,7 @@ VkStructureType sType - const void* pNext + const void* pNext VkBool32 viewportWScalingEnable uint32_t viewportCount const VkViewportWScalingNV* pViewportWScalings @@ -2351,7 +2474,7 @@ uint32_t viewportCount const VkViewportSwizzleNV* pViewportSwizzles - + VkStructureType sType void* pNext uint32_t maxDiscardRectanglesmax number of active discard rectangles @@ -2364,22 +2487,24 @@ uint32_t discardRectangleCount const VkRect2D* pDiscardRectangles - + VkStructureType sType - void* pNext + void* pNext VkBool32 perViewPositionAllComponents - + uint32_t subpass uint32_t inputAttachmentIndex VkImageAspectFlags aspectMask - - VkStructureType sType + + + VkStructureType sType const void* pNext uint32_t aspectReferenceCount - const VkInputAttachmentAspectReferenceKHR* pAspectReferences + const VkInputAttachmentAspectReference* pAspectReferences + VkStructureType sType const void* pNext @@ -2400,108 +2525,155 @@ void* pNext VkImageUsageFlags sharedPresentSupportedUsageFlagsSupported image usage flags if swapchain created using a shared present mode - - VkStructureType sType + + VkStructureType sType void* pNext VkBool32 storageBuffer16BitAccess16-bit integer/floating-point variables supported in BufferBlock VkBool32 uniformAndStorageBuffer16BitAccess16-bit integer/floating-point variables supported in BufferBlock and Block VkBool32 storagePushConstant1616-bit integer/floating-point variables supported in PushConstant VkBool32 storageInputOutput1616-bit integer/floating-point variables supported in shader inputs and outputs - - VkStructureType sType + + + VkStructureType sType + void* pNext + uint32_t subgroupSizeThe size of a subgroup for this queue. + VkShaderStageFlags supportedStagesBitfield of what shader stages support subgroup operations + VkSubgroupFeatureFlags supportedOperationsBitfield of what subgroup operations are supported. + VkBool32 quadOperationsInAllStagesFlag to specify whether quad operations are available in all stages. + + + VkStructureType sType const void* pNext VkBuffer buffer - - VkStructureType sType + + + VkStructureType sType const void* pNext VkImage image - - VkStructureType sType + + + VkStructureType sType const void* pNext VkImage image - - VkStructureType sType + + + VkStructureType sType void* pNext VkMemoryRequirements memoryRequirements - - VkStructureType sType + + + VkStructureType sType void* pNext VkSparseImageMemoryRequirements memoryRequirements - - VkStructureType sType + + + VkStructureType sType void* pNext - VkPointClippingBehaviorKHR pointClippingBehavior + VkPointClippingBehavior pointClippingBehavior - - VkStructureType sType + + + VkStructureType sType void* pNext VkBool32 prefersDedicatedAllocation VkBool32 requiresDedicatedAllocation - - VkStructureType sType + + + VkStructureType sType const void* pNext VkImage imageImage that this allocation will be bound to VkBuffer bufferBuffer that this allocation will be bound to - - VkStructureType sType + + + VkStructureType sType const void* pNext VkImageUsageFlags usage - - VkStructureType sType + + + VkStructureType sType const void* pNext - VkTessellationDomainOriginKHR domainOrigin + VkTessellationDomainOrigin domainOrigin - - VkStructureType sType - const void* pNext - VkSamplerYcbcrConversionKHR conversion + + + VkStructureType sType + const void* pNext + VkSamplerYcbcrConversion conversion - - VkStructureType sType + + + VkStructureType sType const void* pNext VkFormat format - VkSamplerYcbcrModelConversionKHR ycbcrModel - VkSamplerYcbcrRangeKHR ycbcrRange + VkSamplerYcbcrModelConversion ycbcrModel + VkSamplerYcbcrRange ycbcrRange VkComponentMapping components - VkChromaLocationKHR xChromaOffset - VkChromaLocationKHR yChromaOffset + VkChromaLocation xChromaOffset + VkChromaLocation yChromaOffset VkFilter chromaFilter VkBool32 forceExplicitReconstruction - - VkStructureType sType - const void* pNext + + + VkStructureType sType + const void* pNext VkImageAspectFlagBits planeAspect - - VkStructureType sType - const void* pNext + + + VkStructureType sType + const void* pNext VkImageAspectFlagBits planeAspect - - VkStructureType sType + + + VkStructureType sType void* pNext VkBool32 samplerYcbcrConversionSampler color conversion supported - - VkStructureType sType + + + VkStructureType sType void* pNext uint32_t combinedImageSamplerDescriptorCount - + + VkStructureType sType void* pNext VkBool32 supportsTextureGatherLODBiasAMD + + VkStructureType sType + const void* pNext + VkBool32 protectedSubmitSubmit protected command buffers + + + VkStructureType sType + void* pNext + VkBool32 protectedMemory + + + VkStructureType sType + void* pNext + VkBool32 protectedNoFault + + + VkStructureType sType + const void* pNext + VkDeviceQueueCreateFlags flags + uint32_t queueFamilyIndex + uint32_t queueIndex + VkStructureType sType const void* pNext @@ -2509,7 +2681,7 @@ VkBool32 coverageToColorEnable uint32_t coverageToColorLocation - + VkStructureType sType void* pNext VkBool32 filterMinmaxSingleComponentFormats @@ -2549,7 +2721,7 @@ VkBool32 sampleLocationsEnable VkSampleLocationsInfoEXT sampleLocationsInfo - + VkStructureType sType void* pNext VkSampleCountFlags sampleLocationSampleCounts @@ -2568,12 +2740,12 @@ const void* pNext VkSamplerReductionModeEXT reductionMode - + VkStructureType sType void* pNext VkBool32 advancedBlendCoherentOperations - + VkStructureType sType void* pNext uint32_t advancedBlendMaxColorAttachments @@ -2607,15 +2779,33 @@ VkStructureType sType - const void* pNext - VkValidationCacheCreateFlagsEXT flags - size_t initialDataSize - const void* pInitialData + const void* pNext + VkValidationCacheCreateFlagsEXT flags + size_t initialDataSize + const void* pInitialData VkStructureType sType - const void* pNext - VkValidationCacheEXT validationCache + const void* pNext + VkValidationCacheEXT validationCache + + + VkStructureType sType + void* pNext + uint32_t maxPerSetDescriptors + VkDeviceSize maxMemoryAllocationSize + + + + VkStructureType sType + void* pNext + VkBool32 supported + + + + VkStructureType sType + void* pNext + VkBool32 shaderDrawParameters VkStructureType sType @@ -2643,9 +2833,229 @@ VkStructureType sType - const void* pNext + const void* pNext VkQueueGlobalPriorityEXT globalPriority + + VkStructureType sType + const void* pNext + VkObjectType objectType + uint64_t objectHandle + const char* pObjectName + + + VkStructureType sType + const void* pNext + VkObjectType objectType + uint64_t objectHandle + uint64_t tagName + size_t tagSize + const void* pTag + + + VkStructureType sType + const void* pNext + const char* pLabelName + float color[4] + + + VkStructureType sType + const void* pNext + VkDebugUtilsMessengerCreateFlagsEXT flags + VkDebugUtilsMessageSeverityFlagsEXT messageSeverity + VkDebugUtilsMessageTypeFlagsEXT messageType + PFN_vkDebugUtilsMessengerCallbackEXT pfnUserCallback + void* pUserData + + + VkStructureType sType + const void* pNext + VkDebugUtilsMessengerCallbackDataFlagsEXT flags + const char* pMessageIdName + int32_t messageIdNumber + const char* pMessage + uint32_t queueLabelCount + VkDebugUtilsLabelEXT* pQueueLabels + uint32_t cmdBufLabelCount + VkDebugUtilsLabelEXT* pCmdBufLabels + uint32_t objectCount + VkDebugUtilsObjectNameInfoEXT* pObjects + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagBits handleType + void* pHostPointer + + + VkStructureType sType + void* pNext + uint32_t memoryTypeBits + + + VkStructureType sType + void* pNext + VkDeviceSize minImportedHostPointerAlignment + + + VkStructureType sType + void* pNextPointer to next structure + float primitiveOverestimationSizeThe size in pixels the primitive is enlarged at each edge during conservative rasterization + float maxExtraPrimitiveOverestimationSizeThe maximum additional overestimation the client can specify in the pipeline state + float extraPrimitiveOverestimationSizeGranularityThe granularity of extra overestimation sizes the implementations supports between 0 and maxExtraOverestimationSize + VkBool32 primitiveUnderestimationtrue if the implementation supports conservative rasterization underestimation mode + VkBool32 conservativePointAndLineRasterizationtrue if conservative rasterization also applies to points and lines + VkBool32 degenerateTrianglesRasterizedtrue if degenerate triangles (those with zero area after snap) are rasterized + VkBool32 degenerateLinesRasterizedtrue if degenerate lines (those with zero length after snap) are rasterized + VkBool32 fullyCoveredFragmentShaderInputVariabletrue if the implementation supports the FullyCoveredEXT SPIR-V builtin fragment shader input variable + VkBool32 conservativeRasterizationPostDepthCoveragetrue if the implementation supports both conservative rasterization and post depth coverage sample coverage mask + + + VkStructureType sType + void* pNextPointer to next structure + uint32_t shaderEngineCountnumber of shader engines + uint32_t shaderArraysPerEngineCountnumber of shader arrays + uint32_t computeUnitsPerShaderArraynumber of CUs per shader array + uint32_t simdPerComputeUnitnumber of SIMDs per compute unit + uint32_t wavefrontsPerSimdnumber of wavefront slots in each SIMD + uint32_t wavefrontSizenumber of threads per wavefront + uint32_t sgprsPerSimdnumber of physical SGPRs per SIMD + uint32_t minSgprAllocationminimum number of SGPRs that can be allocated by a wave + uint32_t maxSgprAllocationnumber of available SGPRs + uint32_t sgprAllocationGranularitySGPRs are allocated in groups of this size + uint32_t vgprsPerSimdnumber of physical VGPRs per SIMD + uint32_t minVgprAllocationminimum number of VGPRs that can be allocated by a wave + uint32_t maxVgprAllocationnumber of available VGPRs + uint32_t vgprAllocationGranularityVGPRs are allocated in groups of this size + + + VkStructureType sType + const void* pNext + VkPipelineRasterizationConservativeStateCreateFlagsEXT flags + VkConservativeRasterizationModeEXT conservativeRasterizationMode + float extraPrimitiveOverestimationSize + + + VkStructureType sType + void* pNext + VkBool32 shaderInputAttachmentArrayDynamicIndexing + VkBool32 shaderUniformTexelBufferArrayDynamicIndexing + VkBool32 shaderStorageTexelBufferArrayDynamicIndexing + VkBool32 shaderUniformBufferArrayNonUniformIndexing + VkBool32 shaderSampledImageArrayNonUniformIndexing + VkBool32 shaderStorageBufferArrayNonUniformIndexing + VkBool32 shaderStorageImageArrayNonUniformIndexing + VkBool32 shaderInputAttachmentArrayNonUniformIndexing + VkBool32 shaderUniformTexelBufferArrayNonUniformIndexing + VkBool32 shaderStorageTexelBufferArrayNonUniformIndexing + VkBool32 descriptorBindingUniformBufferUpdateAfterBind + VkBool32 descriptorBindingSampledImageUpdateAfterBind + VkBool32 descriptorBindingStorageImageUpdateAfterBind + VkBool32 descriptorBindingStorageBufferUpdateAfterBind + VkBool32 descriptorBindingUniformTexelBufferUpdateAfterBind + VkBool32 descriptorBindingStorageTexelBufferUpdateAfterBind + VkBool32 descriptorBindingUpdateUnusedWhilePending + VkBool32 descriptorBindingPartiallyBound + VkBool32 descriptorBindingVariableDescriptorCount + VkBool32 runtimeDescriptorArray + + + VkStructureType sType + void* pNext + uint32_t maxUpdateAfterBindDescriptorsInAllPools + VkBool32 shaderUniformBufferArrayNonUniformIndexingNative + VkBool32 shaderSampledImageArrayNonUniformIndexingNative + VkBool32 shaderStorageBufferArrayNonUniformIndexingNative + VkBool32 shaderStorageImageArrayNonUniformIndexingNative + VkBool32 shaderInputAttachmentArrayNonUniformIndexingNative + VkBool32 robustBufferAccessUpdateAfterBind + VkBool32 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 + + + VkStructureType sType + const void* pNext + uint32_t bindingCount + const VkDescriptorBindingFlagsEXT* pBindingFlags + + + VkStructureType sType + const void* pNext + uint32_t descriptorSetCount + const uint32_t* pDescriptorCounts + + + VkStructureType sType + void* pNext + uint32_t maxVariableDescriptorCount + + + uint32_t binding + uint32_t divisor + + + VkStructureType sType + const void* pNext + uint32_t vertexBindingDivisorCount + const VkVertexInputBindingDivisorDescriptionEXT* pVertexBindingDivisors + + + VkStructureType sType + void* pNext + uint32_t maxVertexAttribDivisormax value of vertex attribute divisor + + + VkStructureType sType + const void* pNext + struct AHardwareBuffer* buffer + + + VkStructureType sType + void* pNext + uint64_t androidHardwareBufferUsage + + + VkStructureType sType + void* pNext + VkDeviceSize allocationSize + uint32_t memoryTypeBits + + + VkStructureType sType + const void* pNext + VkDeviceMemory memory + + + VkStructureType sType + void* pNext + VkFormat format + uint64_t externalFormat + VkFormatFeatureFlags formatFeatures + VkComponentMapping samplerYcbcrConversionComponents + VkSamplerYcbcrModelConversion suggestedYcbcrModel + VkSamplerYcbcrRange suggestedYcbcrRange + VkChromaLocation suggestedXChromaOffset + VkChromaLocation suggestedYChromaOffset + + + VkStructureType sType + void* pNext + uint64_t externalFormat + Vulkan enumerant (token) definitions @@ -2653,7 +3063,8 @@ - + + @@ -2666,9 +3077,12 @@ - + + + - + + @@ -2687,8 +3101,8 @@ - - + + @@ -3172,47 +3586,46 @@ - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Flags @@ -3222,6 +3635,7 @@ + @@ -3357,8 +3771,8 @@ - - + + @@ -3369,8 +3783,8 @@ - - + + @@ -3451,178 +3865,188 @@ - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - + + + + - - - + + + - - + + Placeholder for validation enums to be defined for VK_EXT_Validation_flags extension + + + + + + + + + + - - - - + + + + - - + + - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - - - + + + - + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + @@ -3630,33 +4054,33 @@ - - - + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -3673,15 +4097,37 @@ - - - + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3761,6 +4207,10 @@ VkDevice device const VkAllocationCallbacks* pAllocator + + VkResult vkEnumerateInstanceVersion + uint32_t* pApiVersion + VkResult vkEnumerateInstanceLayerProperties uint32_t* pPropertyCount @@ -3810,7 +4260,7 @@ all sname:VkQueue objects created from pname:device - + VkResult vkAllocateMemory VkDevice device const VkMemoryAllocateInfo* pAllocateInfo @@ -4165,7 +4615,7 @@ VkDescriptorSetLayout descriptorSetLayout const VkAllocationCallbacks* pAllocator - + VkResult vkCreateDescriptorPool VkDevice device const VkDescriptorPoolCreateInfo* pCreateInfo @@ -4187,7 +4637,7 @@ any sname:VkDescriptorSet objects allocated from pname:descriptorPool - + VkResult vkAllocateDescriptorSets VkDevice device const VkDescriptorSetAllocateInfo* pAllocateInfo @@ -4303,7 +4753,7 @@ VkCommandBuffer commandBuffer uint32_t firstViewport uint32_t viewportCount - const VkViewport* pViewports + const VkViewport* pViewports void vkCmdSetScissor @@ -4979,45 +5429,52 @@ VkDeviceGeneratedCommandsLimitsNVX* pLimits - void vkGetPhysicalDeviceFeatures2KHR + void vkGetPhysicalDeviceFeatures2 VkPhysicalDevice physicalDevice - VkPhysicalDeviceFeatures2KHR* pFeatures + VkPhysicalDeviceFeatures2* pFeatures + - void vkGetPhysicalDeviceProperties2KHR + void vkGetPhysicalDeviceProperties2 VkPhysicalDevice physicalDevice - VkPhysicalDeviceProperties2KHR* pProperties + VkPhysicalDeviceProperties2* pProperties + - void vkGetPhysicalDeviceFormatProperties2KHR + void vkGetPhysicalDeviceFormatProperties2 VkPhysicalDevice physicalDevice VkFormat format - VkFormatProperties2KHR* pFormatProperties + VkFormatProperties2* pFormatProperties + - VkResult vkGetPhysicalDeviceImageFormatProperties2KHR + VkResult vkGetPhysicalDeviceImageFormatProperties2 VkPhysicalDevice physicalDevice - const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo - VkImageFormatProperties2KHR* pImageFormatProperties + const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo + VkImageFormatProperties2* pImageFormatProperties + - void vkGetPhysicalDeviceQueueFamilyProperties2KHR + void vkGetPhysicalDeviceQueueFamilyProperties2 VkPhysicalDevice physicalDevice uint32_t* pQueueFamilyPropertyCount - VkQueueFamilyProperties2KHR* pQueueFamilyProperties + VkQueueFamilyProperties2* pQueueFamilyProperties + - void vkGetPhysicalDeviceMemoryProperties2KHR + void vkGetPhysicalDeviceMemoryProperties2 VkPhysicalDevice physicalDevice - VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties + VkPhysicalDeviceMemoryProperties2* pMemoryProperties + - void vkGetPhysicalDeviceSparseImageFormatProperties2KHR + void vkGetPhysicalDeviceSparseImageFormatProperties2 VkPhysicalDevice physicalDevice - const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo + const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo uint32_t* pPropertyCount - VkSparseImageFormatProperties2KHR* pProperties + VkSparseImageFormatProperties2* pProperties + void vkCmdPushDescriptorSetKHR VkCommandBuffer commandBuffer @@ -5028,27 +5485,29 @@ const VkWriteDescriptorSet* pDescriptorWrites - void vkTrimCommandPoolKHR + void vkTrimCommandPool VkDevice device VkCommandPool commandPool - VkCommandPoolTrimFlagsKHR flags + VkCommandPoolTrimFlags flags + - void vkGetPhysicalDeviceExternalBufferPropertiesKHR + void vkGetPhysicalDeviceExternalBufferProperties VkPhysicalDevice physicalDevice - const VkPhysicalDeviceExternalBufferInfoKHR* pExternalBufferInfo - VkExternalBufferPropertiesKHR* pExternalBufferProperties + const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo + VkExternalBufferProperties* pExternalBufferProperties + VkResult vkGetMemoryWin32HandleKHR VkDevice device const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo HANDLE* pHandle - + VkResult vkGetMemoryWin32HandlePropertiesKHR VkDevice device - VkExternalMemoryHandleTypeFlagBitsKHR handleType + VkExternalMemoryHandleTypeFlagBits handleType HANDLE handle VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties @@ -5058,26 +5517,27 @@ const VkMemoryGetFdInfoKHR* pGetFdInfo int* pFd - + VkResult vkGetMemoryFdPropertiesKHR VkDevice device - VkExternalMemoryHandleTypeFlagBitsKHR handleType + VkExternalMemoryHandleTypeFlagBits handleType int fd VkMemoryFdPropertiesKHR* pMemoryFdProperties - void vkGetPhysicalDeviceExternalSemaphorePropertiesKHR + void vkGetPhysicalDeviceExternalSemaphoreProperties VkPhysicalDevice physicalDevice - const VkPhysicalDeviceExternalSemaphoreInfoKHR* pExternalSemaphoreInfo - VkExternalSemaphorePropertiesKHR* pExternalSemaphoreProperties + const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo + VkExternalSemaphoreProperties* pExternalSemaphoreProperties + VkResult vkGetSemaphoreWin32HandleKHR VkDevice device const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo HANDLE* pHandle - + VkResult vkImportSemaphoreWin32HandleKHR VkDevice device const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo @@ -5088,24 +5548,25 @@ const VkSemaphoreGetFdInfoKHR* pGetFdInfo int* pFd - + VkResult vkImportSemaphoreFdKHR VkDevice device const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo - void vkGetPhysicalDeviceExternalFencePropertiesKHR + void vkGetPhysicalDeviceExternalFenceProperties VkPhysicalDevice physicalDevice - const VkPhysicalDeviceExternalFenceInfoKHR* pExternalFenceInfo - VkExternalFencePropertiesKHR* pExternalFenceProperties + const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo + VkExternalFenceProperties* pExternalFenceProperties + VkResult vkGetFenceWin32HandleKHR VkDevice device const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo HANDLE* pHandle - + VkResult vkImportFenceWin32HandleKHR VkDevice device const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo @@ -5116,7 +5577,7 @@ const VkFenceGetFdInfoKHR* pGetFdInfo int* pFd - + VkResult vkImportFenceFdKHR VkDevice device const VkImportFenceFdInfoKHR* pImportFenceFdInfo @@ -5160,7 +5621,7 @@ const VkAllocationCallbacks* pAllocator VkFence* pFence - + VkResult vkGetSwapchainCounterEXT VkDevice device VkSwapchainKHR swapchain @@ -5174,55 +5635,60 @@ VkSurfaceCapabilities2EXT* pSurfaceCapabilities - VkResult vkEnumeratePhysicalDeviceGroupsKHX + VkResult vkEnumeratePhysicalDeviceGroups VkInstance instance uint32_t* pPhysicalDeviceGroupCount - VkPhysicalDeviceGroupPropertiesKHX* pPhysicalDeviceGroupProperties + VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties + - void vkGetDeviceGroupPeerMemoryFeaturesKHX + void vkGetDeviceGroupPeerMemoryFeatures VkDevice device uint32_t heapIndex uint32_t localDeviceIndex uint32_t remoteDeviceIndex - VkPeerMemoryFeatureFlagsKHX* pPeerMemoryFeatures + VkPeerMemoryFeatureFlags* pPeerMemoryFeatures + - VkResult vkBindBufferMemory2KHR + VkResult vkBindBufferMemory2 VkDevice device uint32_t bindInfoCount - const VkBindBufferMemoryInfoKHR* pBindInfos + const VkBindBufferMemoryInfo* pBindInfos + - VkResult vkBindImageMemory2KHR + VkResult vkBindImageMemory2 VkDevice device uint32_t bindInfoCount - const VkBindImageMemoryInfoKHR* pBindInfos + const VkBindImageMemoryInfo* pBindInfos + - void vkCmdSetDeviceMaskKHX + void vkCmdSetDeviceMask VkCommandBuffer commandBuffer uint32_t deviceMask + - VkResult vkGetDeviceGroupPresentCapabilitiesKHX + VkResult vkGetDeviceGroupPresentCapabilitiesKHR VkDevice device - VkDeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities + VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities - VkResult vkGetDeviceGroupSurfacePresentModesKHX + VkResult vkGetDeviceGroupSurfacePresentModesKHR VkDevice device VkSurfaceKHR surface - VkDeviceGroupPresentModeFlagsKHX* pModes + VkDeviceGroupPresentModeFlagsKHR* pModes - VkResult vkAcquireNextImage2KHX + VkResult vkAcquireNextImage2KHR VkDevice device - const VkAcquireNextImageInfoKHX* pAcquireInfo + const VkAcquireNextImageInfoKHR* pAcquireInfo uint32_t* pImageIndex - void vkCmdDispatchBaseKHX + void vkCmdDispatchBase VkCommandBuffer commandBuffer uint32_t baseGroupX uint32_t baseGroupY @@ -5231,37 +5697,41 @@ uint32_t groupCountY uint32_t groupCountZ + - VkResult vkGetPhysicalDevicePresentRectanglesKHX + VkResult vkGetPhysicalDevicePresentRectanglesKHR VkPhysicalDevice physicalDevice VkSurfaceKHR surface uint32_t* pRectCount VkRect2D* pRects - VkResult vkCreateDescriptorUpdateTemplateKHR + VkResult vkCreateDescriptorUpdateTemplate VkDevice device - const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo + const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo const VkAllocationCallbacks* pAllocator - VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate + VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate + - void vkDestroyDescriptorUpdateTemplateKHR + void vkDestroyDescriptorUpdateTemplate VkDevice device - VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate + VkDescriptorUpdateTemplate descriptorUpdateTemplate const VkAllocationCallbacks* pAllocator + - void vkUpdateDescriptorSetWithTemplateKHR + void vkUpdateDescriptorSetWithTemplate VkDevice device VkDescriptorSet descriptorSet - VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate + VkDescriptorUpdateTemplate descriptorUpdateTemplate const void* pData + void vkCmdPushDescriptorSetWithTemplateKHR VkCommandBuffer commandBuffer - VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate + VkDescriptorUpdateTemplate descriptorUpdateTemplate VkPipelineLayout layout uint32_t set const void* pData @@ -5284,7 +5754,7 @@ VkSwapchainKHR swapchain VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties - + VkResult vkGetPastPresentationTimingGOOGLE VkDevice device VkSwapchainKHR swapchain @@ -5310,7 +5780,7 @@ VkCommandBuffer commandBuffer uint32_t firstViewport uint32_t viewportCount - const VkViewportWScalingNV* pViewportWScalings + const VkViewportWScalingNV* pViewportWScalings void vkCmdSetDiscardRectangleEXT @@ -5344,37 +5814,48 @@ VkSurfaceFormat2KHR* pSurfaceFormats - void vkGetBufferMemoryRequirements2KHR + void vkGetBufferMemoryRequirements2 VkDevice device - const VkBufferMemoryRequirementsInfo2KHR* pInfo - VkMemoryRequirements2KHR* pMemoryRequirements + const VkBufferMemoryRequirementsInfo2* pInfo + VkMemoryRequirements2* pMemoryRequirements + - void vkGetImageMemoryRequirements2KHR + void vkGetImageMemoryRequirements2 VkDevice device - const VkImageMemoryRequirementsInfo2KHR* pInfo - VkMemoryRequirements2KHR* pMemoryRequirements + const VkImageMemoryRequirementsInfo2* pInfo + VkMemoryRequirements2* pMemoryRequirements + - void vkGetImageSparseMemoryRequirements2KHR + void vkGetImageSparseMemoryRequirements2 VkDevice device - const VkImageSparseMemoryRequirementsInfo2KHR* pInfo + const VkImageSparseMemoryRequirementsInfo2* pInfo uint32_t* pSparseMemoryRequirementCount - VkSparseImageMemoryRequirements2KHR* pSparseMemoryRequirements + VkSparseImageMemoryRequirements2* pSparseMemoryRequirements + - VkResult vkCreateSamplerYcbcrConversionKHR + VkResult vkCreateSamplerYcbcrConversion VkDevice device - const VkSamplerYcbcrConversionCreateInfoKHR* pCreateInfo + const VkSamplerYcbcrConversionCreateInfo* pCreateInfo const VkAllocationCallbacks* pAllocator - VkSamplerYcbcrConversionKHR* pYcbcrConversion + VkSamplerYcbcrConversion* pYcbcrConversion + - void vkDestroySamplerYcbcrConversionKHR + void vkDestroySamplerYcbcrConversion VkDevice device - VkSamplerYcbcrConversionKHR ycbcrConversion + VkSamplerYcbcrConversion ycbcrConversion const VkAllocationCallbacks* pAllocator + + + void vkGetDeviceQueue2 + VkDevice device + const VkDeviceQueueInfo2* pQueueInfo + VkQueue* pQueue + VkResult vkCreateValidationCacheEXT VkDevice device @@ -5403,6 +5884,13 @@ const VkValidationCacheEXT* pSrcCaches + void vkGetDescriptorSetLayoutSupport + VkDevice device + const VkDescriptorSetLayoutCreateInfo* pCreateInfo + VkDescriptorSetLayoutSupport* pSupport + + + VkResult vkGetSwapchainGrallocUsageANDROID VkDevice device VkFormat format @@ -5434,6 +5922,91 @@ size_t* pInfoSize void* pInfo + + VkResult vkSetDebugUtilsObjectNameEXT + VkDevice device + const VkDebugUtilsObjectNameInfoEXT* pNameInfo + + + VkResult vkSetDebugUtilsObjectTagEXT + VkDevice device + const VkDebugUtilsObjectTagInfoEXT* pTagInfo + + + void vkQueueBeginDebugUtilsLabelEXT + VkQueue queue + const VkDebugUtilsLabelEXT* pLabelInfo + + + void vkQueueEndDebugUtilsLabelEXT + VkQueue queue + + + void vkQueueInsertDebugUtilsLabelEXT + VkQueue queue + const VkDebugUtilsLabelEXT* pLabelInfo + + + void vkCmdBeginDebugUtilsLabelEXT + VkCommandBuffer commandBuffer + const VkDebugUtilsLabelEXT* pLabelInfo + + + void vkCmdEndDebugUtilsLabelEXT + VkCommandBuffer commandBuffer + + + void vkCmdInsertDebugUtilsLabelEXT + VkCommandBuffer commandBuffer + const VkDebugUtilsLabelEXT* pLabelInfo + + + VkResult vkCreateDebugUtilsMessengerEXT + VkInstance instance + const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDebugUtilsMessengerEXT* pMessenger + + + void vkDestroyDebugUtilsMessengerEXT + VkInstance instance + VkDebugUtilsMessengerEXT messenger + const VkAllocationCallbacks* pAllocator + + + void vkSubmitDebugUtilsMessageEXT + VkInstance instance + VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity + VkDebugUtilsMessageTypeFlagsEXT messageTypes + const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData + + + VkResult vkGetMemoryHostPointerPropertiesEXT + VkDevice device + VkExternalMemoryHandleTypeFlagBits handleType + const void* pHostPointer + VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties + + + void vkCmdWriteBufferMarkerAMD + VkCommandBuffer commandBuffer + VkPipelineStageFlagBits pipelineStage + VkBuffer dstBuffer + VkDeviceSize dstOffset + uint32_t marker + + + VkResult vkGetAndroidHardwareBufferPropertiesANDROID + VkDevice device + const struct AHardwareBuffer* buffer + VkAndroidHardwareBufferPropertiesANDROID* pProperties + + + VkResult vkGetMemoryAndroidHardwareBufferANDROID + VkDevice device + const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo + struct AHardwareBuffer** pBuffer + @@ -5660,16 +6233,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + offset 1 reserved for the old VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHX enum + offset 2 reserved for the old VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHX enum + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Additional dependent types / tokens extending enumerants, not explicitly mentioned + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Additional dependent types / tokens extending enumerants, not explicitly mentioned + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + @@ -5679,29 +6579,52 @@ - - - - - - - - + + + + + + + + + + This duplicates definitions in VK_KHR_device_group below + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + @@ -5722,85 +6645,86 @@ - - - - + + + + - + - - - + + + - + - - - + + + - + - - - + + + - + - - - + + + - + - - - + + + + - + - - - + + + - + - - - - + + + + @@ -5809,12 +6733,12 @@ - - - - + + + + - + @@ -5822,81 +6746,86 @@ + + This duplicates definitions in other extensions, below + + + - - - + + + - - + + - - - + + + - - - - + + + + - - + + - - + + - - - + + + - - + + - - + + - + - - - - - + + + + + @@ -5910,29 +6839,29 @@ - - + + - - + + - - + + - - - - - + + + + + @@ -5940,102 +6869,102 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - + + @@ -6044,95 +6973,95 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - - - - - - - - - + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - + + @@ -6143,46 +7072,46 @@ - - - - + + + + - + - - - - + + + + - + - - - + + + - + - - - - - - - - - + + + + + + + + + @@ -6201,77 +7130,80 @@ - + - - - - offset 1 reserved for the old VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHX enum - offset 2 reserved for the old VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHX enum - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + - - - + + + - + - - - + + + @@ -6279,78 +7211,89 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - + + + + + + + - + - - - - - - - - - + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + @@ -6362,26 +7305,26 @@ - - - - - - + + + + + + - + - - - - - - + + + + + + @@ -6390,13 +7333,13 @@ - + - - - - - + + + + + @@ -6404,25 +7347,32 @@ - + - - - + + + - + - - + + + + + + + + + @@ -6431,22 +7381,23 @@ - - - + + + + - + - - - - - - + + + + + + @@ -6457,10 +7408,10 @@ - - - - + + + + @@ -6469,39 +7420,43 @@ - - - + + + + + + + - + - - + + - - + + - - - + + + - - - + + + @@ -6509,37 +7464,43 @@ - + - - - + + - + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -6575,10 +7536,10 @@ - - - - + + + + @@ -6586,25 +7547,25 @@ - - + + - + - - + + - - - - + + + + @@ -6613,12 +7574,12 @@ - - - - - - + + + + + + @@ -6634,9 +7595,9 @@ - - - + + + @@ -6645,45 +7606,46 @@ - - - - - - + + - + + + enum offset=0 was mistakenly used for the 1.1 core enum + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES + (value=1000094000). Fortunately, no conflict resulted. + - + - - + + - + - - - - - + + + + + - - - + + + @@ -6692,11 +7654,11 @@ - - - - - + + + + + @@ -6706,53 +7668,59 @@ - - + + - + - - + + + + + + + + - - + + - - + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - + + + @@ -6760,57 +7728,63 @@ - - + + - - + + - - + + - - + + - - + + - + - - - - + + + + - + - - + + + + + + + + @@ -6819,21 +7793,22 @@ - - - + + + + - + - - - - - + + + + + @@ -6843,10 +7818,10 @@ - - - - + + + + @@ -6855,44 +7830,48 @@ - - + + - - - - - - - - - - + + + + + + + + + + + + + + - - + + - - - - - + + + + + @@ -6902,33 +7881,33 @@ - - - + + + - - + + - + - - - + + + - + - - - + + + @@ -6936,51 +7915,90 @@ - - + + - + - - + + + - + - - + + + - - - - + + + + - + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + @@ -6988,87 +8006,87 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - + + + + + + + + + @@ -7083,25 +8101,21 @@ - - + + - - - - - + - - - - - - - + + + + + + + @@ -7114,98 +8128,98 @@ - - - + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - + + - - + + - - - + + + @@ -7213,80 +8227,80 @@ - - - + + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -7295,40 +8309,57 @@ + + + + + + + + + + + + + + + + - - + + - - - + + + - - + + - - + + - - - - - + + + + + + @@ -7340,182 +8371,280 @@ - + - - + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - + - - + + + + + + + - - + + - - + + - - + + - - + + - - + + - - - - + + + + - - + + - - + + - - + + - + - - + + + + + + + + + + + + + - + - - + + + - - + + - - + + - - + + - - + + - - + + - + - - + + + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru vulkan-1.0.65.2+dfsg1/scripts/vuid_mapping.py vulkan-1.1.73+dfsg/scripts/vuid_mapping.py --- vulkan-1.0.65.2+dfsg1/scripts/vuid_mapping.py 2018-01-10 14:15:31.000000000 +0000 +++ vulkan-1.1.73+dfsg/scripts/vuid_mapping.py 2018-04-27 11:24:19.000000000 +0000 @@ -53,15 +53,15 @@ } # Function/struct value mappings, shifted up FUNC_STRUCT_SHIFT bits in final ID func_struct_id_map = { -'VkAcquireNextImageInfoKHX' : 0, +'VkAcquireNextImageInfo' : 0, 'VkAllocationCallbacks' : 1, -'VkAndroidSurfaceCreateInfoKHR' : 2, +'VkAndroidSurfaceCreateInfo' : 2, 'VkApplicationInfo' : 3, 'VkAttachmentDescription' : 4, 'VkAttachmentReference' : 5, -'VkBindBufferMemoryInfoKHR' : 6, -'VkBindImageMemoryInfoKHR' : 7, -'VkBindImageMemorySwapchainInfoKHX' : 8, +'VkBindBufferMemoryInfo' : 6, +'VkBindImageMemoryInfo' : 7, +'VkBindImageMemorySwapchainInfo' : 8, 'VkBindSparseInfo' : 9, 'VkBufferCreateInfo' : 10, 'VkBufferImageCopy' : 11, @@ -79,7 +79,7 @@ 'VkComponentMapping' : 23, 'VkComputePipelineCreateInfo' : 24, 'VkCopyDescriptorSet' : 25, -'VkD3D12FenceSubmitInfoKHR' : 26, +'VkD3D12FenceSubmitInfo' : 26, 'VkDebugMarkerMarkerInfoEXT' : 27, 'VkDebugMarkerObjectNameInfoEXT' : 28, 'VkDebugMarkerObjectTagInfoEXT' : 29, @@ -94,37 +94,37 @@ 'VkDescriptorSetAllocateInfo' : 38, 'VkDescriptorSetLayoutBinding' : 39, 'VkDescriptorSetLayoutCreateInfo' : 40, -'VkDescriptorUpdateTemplateCreateInfoKHR' : 41, -'VkDescriptorUpdateTemplateEntryKHR' : 42, +'VkDescriptorUpdateTemplateCreateInfo' : 41, +'VkDescriptorUpdateTemplateEntry' : 42, 'VkDeviceCreateInfo' : 43, 'VkDeviceEventInfoEXT' : 44, 'VkDeviceGeneratedCommandsFeaturesNVX' : 45, 'VkDeviceGeneratedCommandsLimitsNVX' : 46, -'VkDeviceGroupBindSparseInfoKHX' : 47, -'VkDeviceGroupCommandBufferBeginInfoKHX' : 48, -'VkDeviceGroupDeviceCreateInfoKHX' : 49, -'VkDeviceGroupPresentInfoKHX' : 50, -'VkDeviceGroupRenderPassBeginInfoKHX' : 51, -'VkDeviceGroupSubmitInfoKHX' : 52, -'VkDeviceGroupSwapchainCreateInfoKHX' : 53, +'VkDeviceGroupBindSparseInfo' : 47, +'VkDeviceGroupCommandBufferBeginInfo' : 48, +'VkDeviceGroupDeviceCreateInfo' : 49, +'VkDeviceGroupPresentInfo' : 50, +'VkDeviceGroupRenderPassBeginInfo' : 51, +'VkDeviceGroupSubmitInfo' : 52, +'VkDeviceGroupSwapchainCreateInfo' : 53, 'VkDeviceQueueCreateInfo' : 54, 'VkDispatchIndirectCommand' : 55, 'VkDisplayEventInfoEXT' : 56, -'VkDisplayModeCreateInfoKHR' : 57, +'VkDisplayModeCreateInfo' : 57, 'VkDisplayPowerInfoEXT' : 58, -'VkDisplayPresentInfoKHR' : 59, -'VkDisplaySurfaceCreateInfoKHR' : 60, +'VkDisplayPresentInfo' : 59, +'VkDisplaySurfaceCreateInfo' : 60, 'VkDrawIndexedIndirectCommand' : 61, 'VkDrawIndirectCommand' : 62, 'VkEventCreateInfo' : 63, -'VkExportMemoryAllocateInfoKHR' : 64, +'VkExportMemoryAllocateInfo' : 64, 'VkExportMemoryAllocateInfoNV' : 65, -'VkExportMemoryWin32HandleInfoKHR' : 66, +'VkExportMemoryWin32HandleInfo' : 66, 'VkExportMemoryWin32HandleInfoNV' : 67, -'VkExportSemaphoreCreateInfoKHR' : 68, -'VkExportSemaphoreWin32HandleInfoKHR' : 69, -'VkExternalMemoryBufferCreateInfoKHR' : 70, -'VkExternalMemoryImageCreateInfoKHR' : 71, +'VkExportSemaphoreCreateInfo' : 68, +'VkExportSemaphoreWin32HandleInfo' : 69, +'VkExternalMemoryBufferCreateInfo' : 70, +'VkExternalMemoryImageCreateInfo' : 71, 'VkExternalMemoryImageCreateInfoNV' : 72, 'VkFenceCreateInfo' : 73, 'VkFramebufferCreateInfo' : 74, @@ -138,23 +138,23 @@ 'VkImageSubresource' : 82, 'VkImageSubresourceLayers' : 83, 'VkImageSubresourceRange' : 84, -'VkImageSwapchainCreateInfoKHX' : 85, +'VkImageSwapchainCreateInfo' : 85, 'VkImageViewCreateInfo' : 86, -'VkImportMemoryFdInfoKHR' : 87, -'VkImportMemoryWin32HandleInfoKHR' : 88, +'VkImportMemoryFdInfo' : 87, +'VkImportMemoryWin32HandleInfo' : 88, 'VkImportMemoryWin32HandleInfoNV' : 89, -'VkImportSemaphoreFdInfoKHR' : 90, -'VkImportSemaphoreWin32HandleInfoKHR' : 91, +'VkImportSemaphoreFdInfo' : 90, +'VkImportSemaphoreWin32HandleInfo' : 91, 'VkIndirectCommandsLayoutCreateInfoNVX' : 92, 'VkIndirectCommandsLayoutTokenNVX' : 93, 'VkIndirectCommandsTokenNVX' : 94, 'VkInstanceCreateInfo' : 95, 'VkMacOSSurfaceCreateInfoMVK' : 96, 'VkMappedMemoryRange' : 97, -'VkMemoryAllocateFlagsInfoKHX' : 98, +'VkMemoryAllocateFlagsInfo' : 98, 'VkMemoryAllocateInfo' : 99, 'VkMemoryBarrier' : 100, -'VkMirSurfaceCreateInfoKHR' : 101, +'VkMirSurfaceCreateInfo' : 101, 'VkObjectTableCreateInfoNVX' : 102, 'VkObjectTableDescriptorSetEntryNVX' : 103, 'VkObjectTableEntryNVX' : 104, @@ -163,16 +163,16 @@ 'VkObjectTablePushConstantEntryNVX' : 107, 'VkObjectTableVertexBufferEntryNVX' : 108, 'VkPhysicalDeviceDiscardRectanglePropertiesEXT' : 109, -'VkPhysicalDeviceExternalBufferInfoKHR' : 110, -'VkPhysicalDeviceExternalImageFormatInfoKHR' : 111, -'VkPhysicalDeviceExternalSemaphoreInfoKHR' : 112, +'VkPhysicalDeviceExternalBufferInfo' : 110, +'VkPhysicalDeviceExternalImageFormatInfo' : 111, +'VkPhysicalDeviceExternalSemaphoreInfo' : 112, 'VkPhysicalDeviceFeatures' : 113, -'VkPhysicalDeviceFeatures2KHR' : 114, -'VkPhysicalDeviceImageFormatInfo2KHR' : 115, -'VkPhysicalDeviceMultiviewFeaturesKHX' : 116, -'VkPhysicalDevicePushDescriptorPropertiesKHR' : 117, -'VkPhysicalDeviceSparseImageFormatInfo2KHR' : 118, -'VkPhysicalDeviceSurfaceInfo2KHR' : 119, +'VkPhysicalDeviceFeatures2' : 114, +'VkPhysicalDeviceImageFormatInfo2' : 115, +'VkPhysicalDeviceMultiviewFeatures' : 116, +'VkPhysicalDevicePushDescriptorProperties' : 117, +'VkPhysicalDeviceSparseImageFormatInfo2' : 118, +'VkPhysicalDeviceSurfaceInfo2' : 119, 'VkPipelineCacheCreateInfo' : 120, 'VkPipelineColorBlendAttachmentState' : 121, 'VkPipelineColorBlendStateCreateInfo' : 122, @@ -190,16 +190,16 @@ 'VkPipelineViewportStateCreateInfo' : 134, 'VkPipelineViewportSwizzleStateCreateInfoNV' : 135, 'VkPipelineViewportWScalingStateCreateInfoNV' : 136, -'VkPresentInfoKHR' : 137, -'VkPresentRegionKHR' : 138, -'VkPresentRegionsKHR' : 139, +'VkPresentInfo' : 137, +'VkPresentRegion' : 138, +'VkPresentRegions' : 139, 'VkPresentTimesInfoGOOGLE' : 140, 'VkPushConstantRange' : 141, 'VkQueryPoolCreateInfo' : 142, -'VkRectLayerKHR' : 143, +'VkRectLayer' : 143, 'VkRenderPassBeginInfo' : 144, 'VkRenderPassCreateInfo' : 145, -'VkRenderPassMultiviewCreateInfoKHX' : 146, +'VkRenderPassMultiviewCreateInfo' : 146, 'VkSamplerCreateInfo' : 147, 'VkSemaphoreCreateInfo' : 148, 'VkShaderModuleCreateInfo' : 149, @@ -216,31 +216,31 @@ 'VkSubpassDescription' : 160, 'VkSurfaceCapabilities2EXT' : 161, 'VkSwapchainCounterCreateInfoEXT' : 162, -'VkSwapchainCreateInfoKHR' : 163, +'VkSwapchainCreateInfo' : 163, 'VkValidationFlagsEXT' : 164, 'VkVertexInputAttributeDescription' : 165, 'VkVertexInputBindingDescription' : 166, 'VkViSurfaceCreateInfoNN' : 167, 'VkViewport' : 168, 'VkViewportSwizzleNV' : 169, -'VkWaylandSurfaceCreateInfoKHR' : 170, -'VkWin32KeyedMutexAcquireReleaseInfoKHR' : 171, +'VkWaylandSurfaceCreateInfo' : 170, +'VkWin32KeyedMutexAcquireReleaseInfo' : 171, 'VkWin32KeyedMutexAcquireReleaseInfoNV' : 172, -'VkWin32SurfaceCreateInfoKHR' : 173, +'VkWin32SurfaceCreateInfo' : 173, 'VkWriteDescriptorSet' : 174, -'VkXcbSurfaceCreateInfoKHR' : 175, -'VkXlibSurfaceCreateInfoKHR' : 176, -'vkAcquireNextImage2KHX' : 177, -'vkAcquireNextImageKHR' : 178, +'VkXcbSurfaceCreateInfo' : 175, +'VkXlibSurfaceCreateInfo' : 176, +'vkAcquireNextImage2' : 177, +'vkAcquireNextImage' : 178, 'vkAcquireXlibDisplayEXT' : 179, 'vkAllocateCommandBuffers' : 180, 'vkAllocateDescriptorSets' : 181, 'vkAllocateMemory' : 182, 'vkBeginCommandBuffer' : 183, 'vkBindBufferMemory' : 184, -'vkBindBufferMemory2KHR' : 185, +'vkBindBufferMemory2' : 185, 'vkBindImageMemory' : 186, -'vkBindImageMemory2KHR' : 187, +'vkBindImageMemory2' : 187, 'vkCmdBeginQuery' : 188, 'vkCmdBeginRenderPass' : 189, 'vkCmdBindDescriptorSets' : 190, @@ -260,7 +260,7 @@ 'vkCmdDebugMarkerEndEXT' : 204, 'vkCmdDebugMarkerInsertEXT' : 205, 'vkCmdDispatch' : 206, -'vkCmdDispatchBaseKHX' : 207, +'vkCmdDispatchBase' : 207, 'vkCmdDispatchIndirect' : 208, 'vkCmdDraw' : 209, 'vkCmdDrawIndexed' : 210, @@ -276,8 +276,8 @@ 'vkCmdPipelineBarrier' : 220, 'vkCmdProcessCommandsNVX' : 221, 'vkCmdPushConstants' : 222, -'vkCmdPushDescriptorSetKHR' : 223, -'vkCmdPushDescriptorSetWithTemplateKHR' : 224, +'vkCmdPushDescriptorSet' : 223, +'vkCmdPushDescriptorSetWithTemplate' : 224, 'vkCmdReserveSpaceForCommandsNVX' : 225, 'vkCmdResetEvent' : 226, 'vkCmdResetQueryPool' : 227, @@ -285,7 +285,7 @@ 'vkCmdSetBlendConstants' : 229, 'vkCmdSetDepthBias' : 230, 'vkCmdSetDepthBounds' : 231, -'vkCmdSetDeviceMaskKHX' : 232, +'vkCmdSetDeviceMask' : 232, 'vkCmdSetDiscardRectangleEXT' : 233, 'vkCmdSetEvent' : 234, 'vkCmdSetLineWidth' : 235, @@ -298,7 +298,7 @@ 'vkCmdUpdateBuffer' : 242, 'vkCmdWaitEvents' : 243, 'vkCmdWriteTimestamp' : 244, -'vkCreateAndroidSurfaceKHR' : 245, +'vkCreateAndroidSurface' : 245, 'vkCreateBuffer' : 246, 'vkCreateBufferView' : 247, 'vkCreateCommandPool' : 248, @@ -306,10 +306,10 @@ 'vkCreateDebugReportCallbackEXT' : 250, 'vkCreateDescriptorPool' : 251, 'vkCreateDescriptorSetLayout' : 252, -'vkCreateDescriptorUpdateTemplateKHR' : 253, +'vkCreateDescriptorUpdateTemplate' : 253, 'vkCreateDevice' : 254, -'vkCreateDisplayModeKHR' : 255, -'vkCreateDisplayPlaneSurfaceKHR' : 256, +'vkCreateDisplayMode' : 255, +'vkCreateDisplayPlaneSurface' : 256, 'vkCreateEvent' : 257, 'vkCreateFence' : 258, 'vkCreateFramebuffer' : 259, @@ -320,7 +320,7 @@ 'vkCreateIndirectCommandsLayoutNVX' : 264, 'vkCreateInstance' : 265, 'vkCreateMacOSSurfaceMVK' : 266, -'vkCreateMirSurfaceKHR' : 267, +'vkCreateMirSurface' : 267, 'vkCreateObjectTableNVX' : 268, 'vkCreatePipelineCache' : 269, 'vkCreatePipelineLayout' : 270, @@ -329,13 +329,13 @@ 'vkCreateSampler' : 273, 'vkCreateSemaphore' : 274, 'vkCreateShaderModule' : 275, -'vkCreateSharedSwapchainsKHR' : 276, -'vkCreateSwapchainKHR' : 277, +'vkCreateSharedSwapchains' : 276, +'vkCreateSwapchain' : 277, 'vkCreateViSurfaceNN' : 278, -'vkCreateWaylandSurfaceKHR' : 279, -'vkCreateWin32SurfaceKHR' : 280, -'vkCreateXcbSurfaceKHR' : 281, -'vkCreateXlibSurfaceKHR' : 282, +'vkCreateWaylandSurface' : 279, +'vkCreateWin32Surface' : 280, +'vkCreateXcbSurface' : 281, +'vkCreateXlibSurface' : 282, 'vkDebugMarkerSetObjectNameEXT' : 283, 'vkDebugMarkerSetObjectTagEXT' : 284, 'vkDebugReportMessageEXT' : 285, @@ -345,7 +345,7 @@ 'vkDestroyDebugReportCallbackEXT' : 289, 'vkDestroyDescriptorPool' : 290, 'vkDestroyDescriptorSetLayout' : 291, -'vkDestroyDescriptorUpdateTemplateKHR' : 292, +'vkDestroyDescriptorUpdateTemplate' : 292, 'vkDestroyDevice' : 293, 'vkDestroyEvent' : 294, 'vkDestroyFence' : 295, @@ -363,8 +363,8 @@ 'vkDestroySampler' : 307, 'vkDestroySemaphore' : 308, 'vkDestroyShaderModule' : 309, -'vkDestroySurfaceKHR' : 310, -'vkDestroySwapchainKHR' : 311, +'vkDestroySurface' : 310, +'vkDestroySwapchain' : 311, 'vkDeviceWaitIdle' : 312, 'vkDisplayPowerControlEXT' : 313, 'vkEndCommandBuffer' : 314, @@ -372,84 +372,84 @@ 'vkEnumerateDeviceLayerProperties' : 316, 'vkEnumerateInstanceExtensionProperties' : 317, 'vkEnumerateInstanceLayerProperties' : 318, -'vkEnumeratePhysicalDeviceGroupsKHX' : 319, +'vkEnumeratePhysicalDeviceGroups' : 319, 'vkEnumeratePhysicalDevices' : 320, 'vkFlushMappedMemoryRanges' : 321, 'vkFreeCommandBuffers' : 322, 'vkFreeDescriptorSets' : 323, 'vkFreeMemory' : 324, 'vkGetBufferMemoryRequirements' : 325, -'vkGetDeviceGroupPeerMemoryFeaturesKHX' : 326, -'vkGetDeviceGroupPresentCapabilitiesKHX' : 327, -'vkGetDeviceGroupSurfacePresentModesKHX' : 328, +'vkGetDeviceGroupPeerMemoryFeatures' : 326, +'vkGetDeviceGroupPresentCapabilities' : 327, +'vkGetDeviceGroupSurfacePresentModes' : 328, 'vkGetDeviceMemoryCommitment' : 329, 'vkGetDeviceProcAddr' : 330, 'vkGetDeviceQueue' : 331, -'vkGetDisplayModePropertiesKHR' : 332, -'vkGetDisplayPlaneCapabilitiesKHR' : 333, -'vkGetDisplayPlaneSupportedDisplaysKHR' : 334, +'vkGetDisplayModeProperties' : 332, +'vkGetDisplayPlaneCapabilities' : 333, +'vkGetDisplayPlaneSupportedDisplays' : 334, 'vkGetEventStatus' : 335, 'vkGetFenceStatus' : 336, 'vkGetImageMemoryRequirements' : 337, 'vkGetImageSparseMemoryRequirements' : 338, 'vkGetImageSubresourceLayout' : 339, 'vkGetInstanceProcAddr' : 340, -'vkGetMemoryFdKHR' : 341, -'vkGetMemoryFdPropertiesKHR' : 342, -'vkGetMemoryWin32HandleKHR' : 343, +'vkGetMemoryFd' : 341, +'vkGetMemoryFdProperties' : 342, +'vkGetMemoryWin32Handle' : 343, 'vkGetMemoryWin32HandleNV' : 344, -'vkGetMemoryWin32HandlePropertiesKHR' : 345, +'vkGetMemoryWin32HandleProperties' : 345, 'vkGetPastPresentationTimingGOOGLE' : 346, -'vkGetPhysicalDeviceDisplayPlanePropertiesKHR' : 347, -'vkGetPhysicalDeviceDisplayPropertiesKHR' : 348, -'vkGetPhysicalDeviceExternalBufferPropertiesKHR' : 349, +'vkGetPhysicalDeviceDisplayPlaneProperties' : 347, +'vkGetPhysicalDeviceDisplayProperties' : 348, +'vkGetPhysicalDeviceExternalBufferProperties' : 349, 'vkGetPhysicalDeviceExternalImageFormatPropertiesNV' : 350, -'vkGetPhysicalDeviceExternalSemaphorePropertiesKHR' : 351, +'vkGetPhysicalDeviceExternalSemaphoreProperties' : 351, 'vkGetPhysicalDeviceFeatures' : 352, -'vkGetPhysicalDeviceFeatures2KHR' : 353, +'vkGetPhysicalDeviceFeatures2' : 353, 'vkGetPhysicalDeviceFormatProperties' : 354, -'vkGetPhysicalDeviceFormatProperties2KHR' : 355, +'vkGetPhysicalDeviceFormatProperties2' : 355, 'vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX' : 356, 'vkGetPhysicalDeviceImageFormatProperties' : 357, -'vkGetPhysicalDeviceImageFormatProperties2KHR' : 358, +'vkGetPhysicalDeviceImageFormatProperties2' : 358, 'vkGetPhysicalDeviceMemoryProperties' : 359, -'vkGetPhysicalDeviceMemoryProperties2KHR' : 360, -'vkGetPhysicalDeviceMirPresentationSupportKHR' : 361, -'vkGetPhysicalDevicePresentRectanglesKHX' : 362, +'vkGetPhysicalDeviceMemoryProperties2' : 360, +'vkGetPhysicalDeviceMirPresentationSupport' : 361, +'vkGetPhysicalDevicePresentRectangles' : 362, 'vkGetPhysicalDeviceProperties' : 363, -'vkGetPhysicalDeviceProperties2KHR' : 364, +'vkGetPhysicalDeviceProperties2' : 364, 'vkGetPhysicalDeviceQueueFamilyProperties' : 365, -'vkGetPhysicalDeviceQueueFamilyProperties2KHR' : 366, +'vkGetPhysicalDeviceQueueFamilyProperties2' : 366, 'vkGetPhysicalDeviceSparseImageFormatProperties' : 367, -'vkGetPhysicalDeviceSparseImageFormatProperties2KHR' : 368, +'vkGetPhysicalDeviceSparseImageFormatProperties2' : 368, 'vkGetPhysicalDeviceSurfaceCapabilities2EXT' : 369, -'vkGetPhysicalDeviceSurfaceCapabilities2KHR' : 370, -'vkGetPhysicalDeviceSurfaceCapabilitiesKHR' : 371, -'vkGetPhysicalDeviceSurfaceFormats2KHR' : 372, -'vkGetPhysicalDeviceSurfaceFormatsKHR' : 373, -'vkGetPhysicalDeviceSurfacePresentModesKHR' : 374, -'vkGetPhysicalDeviceSurfaceSupportKHR' : 375, -'vkGetPhysicalDeviceWaylandPresentationSupportKHR' : 376, -'vkGetPhysicalDeviceWin32PresentationSupportKHR' : 377, -'vkGetPhysicalDeviceXcbPresentationSupportKHR' : 378, -'vkGetPhysicalDeviceXlibPresentationSupportKHR' : 379, +'vkGetPhysicalDeviceSurfaceCapabilities2' : 370, +'vkGetPhysicalDeviceSurfaceCapabilities' : 371, +'vkGetPhysicalDeviceSurfaceFormats2' : 372, +'vkGetPhysicalDeviceSurfaceFormats' : 373, +'vkGetPhysicalDeviceSurfacePresentModes' : 374, +'vkGetPhysicalDeviceSurfaceSupport' : 375, +'vkGetPhysicalDeviceWaylandPresentationSupport' : 376, +'vkGetPhysicalDeviceWin32PresentationSupport' : 377, +'vkGetPhysicalDeviceXcbPresentationSupport' : 378, +'vkGetPhysicalDeviceXlibPresentationSupport' : 379, 'vkGetPipelineCacheData' : 380, 'vkGetQueryPoolResults' : 381, 'vkGetRandROutputDisplayEXT' : 382, 'vkGetRefreshCycleDurationGOOGLE' : 383, 'vkGetRenderAreaGranularity' : 384, -'vkGetSemaphoreFdKHR' : 385, -'vkGetSemaphoreWin32HandleKHR' : 386, +'vkGetSemaphoreFd' : 385, +'vkGetSemaphoreWin32Handle' : 386, 'vkGetSwapchainCounterEXT' : 387, -'vkGetSwapchainImagesKHR' : 388, -'vkGetSwapchainStatusKHR' : 389, -'vkImportSemaphoreFdKHR' : 390, -'vkImportSemaphoreWin32HandleKHR' : 391, +'vkGetSwapchainImages' : 388, +'vkGetSwapchainStatus' : 389, +'vkImportSemaphoreFd' : 390, +'vkImportSemaphoreWin32Handle' : 391, 'vkInvalidateMappedMemoryRanges' : 392, 'vkMapMemory' : 393, 'vkMergePipelineCaches' : 394, 'vkQueueBindSparse' : 395, -'vkQueuePresentKHR' : 396, +'vkQueuePresent' : 396, 'vkQueueSubmit' : 397, 'vkQueueWaitIdle' : 398, 'vkRegisterDeviceEventEXT' : 399, @@ -463,33 +463,33 @@ 'vkResetFences' : 407, 'vkSetEvent' : 408, 'vkSetHdrMetadataEXT' : 409, -'vkTrimCommandPoolKHR' : 410, +'vkTrimCommandPool' : 410, 'vkUnmapMemory' : 411, 'vkUnregisterObjectsNVX' : 412, -'vkUpdateDescriptorSetWithTemplateKHR' : 413, +'vkUpdateDescriptorSetWithTemplate' : 413, 'vkUpdateDescriptorSets' : 414, 'vkWaitForFences' : 415, -'VkPhysicalDeviceProperties2KHR' : 416, -'VkFormatProperties2KHR' : 417, -'VkImageFormatProperties2KHR' : 418, -'VkPhysicalDeviceMemoryProperties2KHR' : 419, -'VkSurfaceCapabilities2KHR' : 420, -'VkDeviceGroupPresentCapabilitiesKHX' : 421, -'VkExternalBufferPropertiesKHR' : 422, -'VkMemoryWin32HandlePropertiesKHR' : 423, -'VkMemoryFdPropertiesKHR' : 424, -'VkExternalSemaphorePropertiesKHR' : 425, -'VkQueueFamilyProperties2KHR' : 426, -'VkSparseImageFormatProperties2KHR' : 427, -'VkSurfaceFormat2KHR' : 428, +'VkPhysicalDeviceProperties2' : 416, +'VkFormatProperties2' : 417, +'VkImageFormatProperties2' : 418, +'VkPhysicalDeviceMemoryProperties2' : 419, +'VkSurfaceCapabilities2' : 420, +'VkDeviceGroupPresentCapabilities' : 421, +'VkExternalBufferProperties' : 422, +'VkMemoryWin32HandleProperties' : 423, +'VkMemoryFdProperties' : 424, +'VkExternalSemaphoreProperties' : 425, +'VkQueueFamilyProperties2' : 426, +'VkSparseImageFormatProperties2' : 427, +'VkSurfaceFormat2' : 428, 'VkTextureLODGatherFormatPropertiesAMD' : 429, -'VkPhysicalDeviceMultiviewPropertiesKHX' : 430, -'VkPhysicalDeviceGroupPropertiesKHX' : 431, -'VkExternalImageFormatPropertiesKHR' : 432, -'VkPhysicalDeviceIDPropertiesKHR' : 433, +'VkPhysicalDeviceMultiviewProperties' : 430, +'VkPhysicalDeviceGroupProperties' : 431, +'VkExternalImageFormatProperties' : 432, +'VkPhysicalDeviceIDProperties' : 433, 'VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX' : 434, 'VkHdrMetadataEXT' : 435, -'VkExternalMemoryPropertiesKHR' : 436, +'VkExternalMemoryProperties' : 436, 'VkFormatProperties' : 437, 'VkImageFormatProperties' : 438, 'VkPhysicalDeviceLimits' : 439, @@ -497,10 +497,10 @@ 'VkMemoryType' : 441, 'VkMemoryHeap' : 442, 'VkSparseImageFormatProperties' : 443, -'VkSurfaceCapabilitiesKHR' : 444, -'VkDisplayPropertiesKHR' : 445, -'VkDisplayPlaneCapabilitiesKHR' : 446, -'VkSharedPresentSurfaceCapabilitiesKHR' : 447, +'VkSurfaceCapabilities' : 444, +'VkDisplayProperties' : 445, +'VkDisplayPlaneCapabilities' : 446, +'VkSharedPresentSurfaceCapabilities' : 447, 'VkExternalImageFormatPropertiesNV' : 448, 'VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT' : 449, 'VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT' : 450, @@ -510,36 +510,36 @@ 'VkPipelineCoverageToColorStateCreateInfoNV' : 454, 'VkSamplerReductionModeCreateInfoEXT' : 455, 'VkPhysicalDeviceProperties' : 456, -'VkSurfaceFormatKHR' : 457, -'VkExportFenceCreateInfoKHR' : 458, -'VkPhysicalDeviceExternalFenceInfoKHR' : 459, -'VkExternalFencePropertiesKHR' : 460, -'vkGetPhysicalDeviceExternalFencePropertiesKHR' : 461, -'VkImportFenceFdInfoKHR' : 462, -'VkFenceGetFdInfoKHR' : 463, -'vkImportFenceFdKHR' : 464, -'vkGetFenceFdKHR' : 465, -'VkImportFenceWin32HandleInfoKHR' : 466, -'VkExportFenceWin32HandleInfoKHR' : 467, -'VkFenceGetWin32HandleInfoKHR' : 468, -'vkImportFenceWin32HandleKHR' : 469, -'vkGetFenceWin32HandleKHR' : 470, -'VkSemaphoreGetFdInfoKHR' : 471, -'VkSemaphoreGetWin32HandleInfoKHR' : 472, -'VkMemoryGetFdInfoKHR' : 473, -'VkMemoryGetWin32HandleInfoKHR' : 474, -'VkMemoryDedicatedRequirementsKHR' : 475, -'VkMemoryDedicatedAllocateInfoKHR' : 476, -'VkBufferMemoryRequirementsInfo2KHR' : 477, -'VkImageMemoryRequirementsInfo2KHR' : 478, -'VkImageSparseMemoryRequirementsInfo2KHR' : 479, -'VkMemoryRequirements2KHR' : 480, -'VkSparseImageMemoryRequirements2KHR' : 481, -'vkGetImageMemoryRequirements2KHR' : 482, -'vkGetBufferMemoryRequirements2KHR' : 483, -'vkGetImageSparseMemoryRequirements2KHR' : 484, -'VkPhysicalDevice16BitStorageFeaturesKHR' : 485, -'VkPhysicalDeviceVariablePointerFeaturesKHR' : 486, +'VkSurfaceFormat' : 457, +'VkExportFenceCreateInfo' : 458, +'VkPhysicalDeviceExternalFenceInfo' : 459, +'VkExternalFenceProperties' : 460, +'vkGetPhysicalDeviceExternalFenceProperties' : 461, +'VkImportFenceFdInfo' : 462, +'VkFenceGetFdInfo' : 463, +'vkImportFenceFd' : 464, +'vkGetFenceFd' : 465, +'VkImportFenceWin32HandleInfo' : 466, +'VkExportFenceWin32HandleInfo' : 467, +'VkFenceGetWin32HandleInfo' : 468, +'vkImportFenceWin32Handle' : 469, +'vkGetFenceWin32Handle' : 470, +'VkSemaphoreGetFdInfo' : 471, +'VkSemaphoreGetWin32HandleInfo' : 472, +'VkMemoryGetFdInfo' : 473, +'VkMemoryGetWin32HandleInfo' : 474, +'VkMemoryDedicatedRequirements' : 475, +'VkMemoryDedicatedAllocateInfo' : 476, +'VkBufferMemoryRequirementsInfo2' : 477, +'VkImageMemoryRequirementsInfo2' : 478, +'VkImageSparseMemoryRequirementsInfo2' : 479, +'VkMemoryRequirements2' : 480, +'VkSparseImageMemoryRequirements2' : 481, +'vkGetImageMemoryRequirements2' : 482, +'vkGetBufferMemoryRequirements2' : 483, +'vkGetImageSparseMemoryRequirements2' : 484, +'VkPhysicalDevice16BitStorageFeatures' : 485, +'VkPhysicalDeviceVariablePointerFeatures' : 486, 'VkSampleLocationsInfoEXT' : 487, 'VkRenderPassSampleLocationsBeginInfoEXT' : 488, 'VkPipelineSampleLocationsStateCreateInfoEXT' : 489, @@ -555,25 +555,76 @@ 'vkMergeValidationCachesEXT' : 499, 'VkAttachmentSampleLocationsEXT' : 500, 'VkSubpassSampleLocationsEXT' : 501, -'VkPhysicalDevicePointClippingPropertiesKHR' : 502, -'VkInputAttachmentAspectReferenceKHR' : 503, -'VkRenderPassInputAttachmentAspectCreateInfoKHR' : 504, -'VkImageViewUsageCreateInfoKHR' : 505, -'VkPipelineTessellationDomainOriginStateCreateInfoKHR' : 506, -'VkImageFormatListCreateInfoKHR' : 507, -'VkSamplerYcbcrConversionCreateInfoKHR' : 508, -'VkBindImagePlaneMemoryInfoKHR' : 509, -'VkImagePlaneMemoryRequirementsInfoKHR' : 510, -'vkCreateSamplerYcbcrConversionKHR' : 511, -'VkBindBufferMemoryDeviceGroupInfoKHX' : 512, -'VkBindImageMemoryDeviceGroupInfoKHX' : 513, -'vkDestroySamplerYcbcrConversionKHR' : 514, -'VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR' : 515, -'VkSamplerYcbcrConversionImageFormatPropertiesKHR' : 516, -'VkSamplerYcbcrConversionInfoKHR' : 517, +'VkPhysicalDevicePointClippingProperties' : 502, +'VkInputAttachmentAspectReference' : 503, +'VkRenderPassInputAttachmentAspectCreateInfo' : 504, +'VkImageViewUsageCreateInfo' : 505, +'VkPipelineTessellationDomainOriginStateCreateInfo' : 506, +'VkImageFormatListCreateInfo' : 507, +'VkSamplerYcbcrConversionCreateInfo' : 508, +'VkBindImagePlaneMemoryInfo' : 509, +'VkImagePlaneMemoryRequirementsInfo' : 510, +'vkCreateSamplerYcbcrConversion' : 511, +'VkBindBufferMemoryDeviceGroupInfo' : 512, +'VkBindImageMemoryDeviceGroupInfo' : 513, +'vkDestroySamplerYcbcrConversion' : 514, +'VkPhysicalDeviceSamplerYcbcrConversionFeatures' : 515, +'VkSamplerYcbcrConversionImageFormatProperties' : 516, +'VkSamplerYcbcrConversionInfo' : 517, 'VkDeviceQueueGlobalPriorityCreateInfoEXT' : 518, 'vkGetShaderInfoAMD' : 519, 'VkShaderStatisticsInfoAMD' : 520, +'VkImportMemoryHostPointerInfoEXT' : 521, +'VkMemoryHostPointerPropertiesEXT' : 522, +'VkPhysicalDeviceExternalMemoryHostPropertiesEXT' : 523, +'vkGetMemoryHostPointerPropertiesEXT' : 524, +'VkPhysicalDeviceConservativeRasterizationPropertiesEXT' : 525, +'VkPipelineRasterizationConservativeStateCreateInfoEXT' : 526, +'vkCmdWriteBufferMarkerAMD' : 527, +'VkDescriptorSetLayoutSupport' : 528, +'VkDeviceQueueInfo2' : 529, +'VkPhysicalDeviceMaintenance3Properties' : 530, +'VkPhysicalDeviceProtectedMemoryFeatures' : 531, +'VkPhysicalDeviceProtectedMemoryProperties' : 532, +'VkPhysicalDeviceShaderDrawParameterFeatures' : 533, +'VkPhysicalDeviceSubgroupProperties' : 534, +'VkProtectedSubmitInfo' : 535, +'vkEnumerateInstanceVersion' : 536, +'vkGetDescriptorSetLayoutSupport' : 537, +'vkGetDeviceQueue2' : 538, +'VkDebugUtilsObjectNameInfoEXT' : 539, +'VkDebugUtilsObjectTagInfoEXT' : 540, +'VkDebugUtilsLabelEXT' : 541, +'VkDebugUtilsMessengerCallbackDataEXT' : 542, +'VkDebugUtilsMessengerCreateInfoEXT' : 543, +'vkCreateDebugUtilsMessengerEXT' : 544, +'vkSubmitDebugUtilsMessageEXT' : 545, +'VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT' : 546, +'VkPipelineVertexInputDivisorStateCreateInfoEXT' : 547, +'VkExternalFormatANDROID' : 548, +'VkImportAndroidHardwareBufferInfoANDROID' : 549, +'VkMemoryGetAndroidHardwareBufferInfoANDROID' : 550, +'vkCmdEndDebugUtilsLabelEXT' : 551, +'vkDestroyDebugUtilsMessengerEXT' : 552, +'vkGetAndroidHardwareBufferPropertiesANDROID' : 553, +'vkQueueEndDebugUtilsLabelEXT' : 554, +'VkAndroidHardwareBufferUsageANDROID' : 555, +'VkAndroidHardwareBufferPropertiesANDROID' : 556, +'vkGetMemoryAndroidHardwareBufferANDROID' : 557, +'VkAndroidHardwareBufferFormatPropertiesANDROID' : 558, +'vkCmdBeginDebugUtilsLabelEXT' : 559, +'vkCmdInsertDebugUtilsLabelEXT' : 560, +'vkQueueBeginDebugUtilsLabelEXT' : 561, +'vkQueueInsertDebugUtilsLabelEXT' : 562, +'vkSetDebugUtilsObjectNameEXT' : 563, +'vkSetDebugUtilsObjectTagEXT' : 564, +'VkDescriptorSetLayoutBindingFlagsCreateInfoEXT' : 565, +'VkDescriptorSetVariableDescriptorCountAllocateInfoEXT' : 566, +'VkDescriptorSetVariableDescriptorCountLayoutSupportEXT' : 567, +'VkPhysicalDeviceDescriptorIndexingFeaturesEXT' : 568, +'VkPhysicalDeviceDescriptorIndexingPropertiesEXT' : 569, +'VkPhysicalDeviceShaderCorePropertiesAMD' : 570, +'VkVertexInputBindingDivisorDescriptionEXT' : 571, ### ADD New func/struct mappings above this line } # Mapping of params to unique IDs @@ -1084,6 +1135,35 @@ 'infoType' : 503, 'pInfoSize' : 504, 'shaderStageMask' : 505, +'pMemoryHostPointerProperties' : 506, +'pHostPointer' : 507, +'conservativeRasterizationMode' : 508, +'pViewports' : 509, +'pViewportWScalings' : 510, +'pSplitInstanceBindRegions' : 511, +'pApiVersion' : 512, +'pSupport' : 513, +'pQueueInfo' : 514, +'splitInstanceBindRegionCount' : 515, +'pLabelName' : 516, +'messageSeverity' : 517, +'messageType' : 518, +'pfnUserCallback' : 519, +'pMessenger' : 520, +'messageTypes' : 521, +'vertexBindingDivisorCount' : 522, +'pVertexBindingDivisors' : 523, +'formatFeatures' : 524, +'suggestedYcbcrModel' : 525, +'suggestedYcbcrRange' : 526, +'suggestedXChromaOffset' : 527, +'suggestedYChromaOffset' : 528, +'pMessageIdName' : 529, +'pLabelInfo' : 530, +'messenger' : 531, +'pCallbackData' : 532, +'pBindingFlags' : 533, +'pDescriptorCounts' : 534, ### ADD New implicit param mappings above this line } @@ -1092,19 +1172,22 @@ # Convert a string VUID into numerical value # See "VUID Mapping Details" comment above for more info def convertVUID(vuid_string): - """Convert a string-based VUID into a numberical value""" + """Convert a string-based VUID into a numerical value""" #func_struct_update = False #imp_param_update = False if vuid_string in ['', None]: return -1 vuid_parts = vuid_string.split('-') + # Alias core/KHR/KHX ids because not all VUIDs in the spec get updated at the same time + if vuid_parts[1].endswith('KHR') or vuid_parts[1].endswith('KHX'): + vuid_parts[1] = vuid_parts[1][:-3] if vuid_parts[1] not in func_struct_id_map: print ("ERROR: Missing func/struct map value for '%s'!" % (vuid_parts[1])) print (" TODO: Need to add mapping for this to end of func_struct_id_map") print (" replace '### ADD New func/struct mappings above this line' line with \"'%s' : %d,\"" % (vuid_parts[1], len(func_struct_id_map))) func_struct_id_map[vuid_parts[1]] = len(func_struct_id_map) #func_struct_update = True - sys.exit() + sys.exit(1) uniqueid = func_struct_id_map[vuid_parts[1]] << FUNC_STRUCT_SHIFT if vuid_parts[-1].isdigit(): # explit VUID has int on the end explicit_id = int(vuid_parts[-1]) @@ -1113,7 +1196,7 @@ else: # implicit case if vuid_parts[-1] not in implicit_type_map: print("ERROR: Missing mapping for implicit type '%s'!\nTODO: Please add new mapping." % (vuid_parts[-1])) - sys.exit() + sys.exit(1) else: param_id = 0 # Default when no param is available if vuid_parts[-2] != vuid_parts[1]: # we have a parameter @@ -1124,7 +1207,7 @@ print (" replace '### ADD New implicit param mappings above this line' line with \"'%s' : %d,\"" % (vuid_parts[-2], len(implicit_param_map))) implicit_param_map[vuid_parts[-2]] = len(implicit_param_map) #imp_param_update = True - sys.exit() + sys.exit(1) uniqueid = uniqueid + (param_id << IMPLICIT_PARAM_SHIFT) + (implicit_type_map[vuid_parts[-1]] << IMPLICIT_TYPE_SHIFT) + implicit_bit0 else: # No parameter so that field is 0 uniqueid = uniqueid + (implicit_type_map[vuid_parts[-1]] << IMPLICIT_TYPE_SHIFT) + implicit_bit0 diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/appveyor.yml vulkan-1.1.73+dfsg/submodules/googletest/appveyor.yml --- vulkan-1.0.65.2+dfsg1/submodules/googletest/appveyor.yml 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/appveyor.yml 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,99 @@ +version: '{build}' + +os: Visual Studio 2015 + +environment: + matrix: + - compiler: msvc-15-seh + generator: "Visual Studio 15 2017" + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + + - compiler: msvc-15-seh + generator: "Visual Studio 15 2017 Win64" + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + enabled_on_pr: yes + + - compiler: msvc-14-seh + generator: "Visual Studio 14 2015" + enabled_on_pr: yes + + - compiler: msvc-14-seh + generator: "Visual Studio 14 2015 Win64" + + - compiler: gcc-5.3.0-posix + generator: "MinGW Makefiles" + cxx_path: 'C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin' + + - compiler: gcc-6.3.0-posix + generator: "MinGW Makefiles" + cxx_path: 'C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin' + +configuration: + - Debug + +build: + verbosity: minimal + +install: +- ps: | + Write-Output "Compiler: $env:compiler" + Write-Output "Generator: $env:generator" + if (-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) { + Write-Output "This is *NOT* a pull request build" + } else { + Write-Output "This is a pull request build" + if (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "yes") { + Write-Output "PR builds are *NOT* explicitly enabled" + } + } + + # git bash conflicts with MinGW makefiles + if ($env:generator -eq "MinGW Makefiles") { + $env:path = $env:path.replace("C:\Program Files\Git\usr\bin;", "") + if ($env:cxx_path -ne "") { + $env:path += ";$env:cxx_path" + } + } + +build_script: +- ps: | + # Only enable some builds for pull requests, the AppVeyor queue is too long. + if ((Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER) -And (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "yes")) { + return + } + md _build -Force | Out-Null + cd _build + + $conf = if ($env:generator -eq "MinGW Makefiles") {"-DCMAKE_BUILD_TYPE=$env:configuration"} else {"-DCMAKE_CONFIGURATION_TYPES=Debug;Release"} + # Disable test for MinGW (gtest tests fail, gmock tests can not build) + $gtest_build_tests = if ($env:generator -eq "MinGW Makefiles") {"-Dgtest_build_tests=OFF"} else {"-Dgtest_build_tests=ON"} + $gmock_build_tests = if ($env:generator -eq "MinGW Makefiles") {"-Dgmock_build_tests=OFF"} else {"-Dgmock_build_tests=ON"} + & cmake -G "$env:generator" $conf -Dgtest_build_samples=ON $gtest_build_tests $gmock_build_tests .. + if ($LastExitCode -ne 0) { + throw "Exec: $ErrorMessage" + } + $cmake_parallel = if ($env:generator -eq "MinGW Makefiles") {"-j2"} else {"/m"} + & cmake --build . --config $env:configuration -- $cmake_parallel + if ($LastExitCode -ne 0) { + throw "Exec: $ErrorMessage" + } + +test_script: +- ps: | + # Only enable some builds for pull requests, the AppVeyor queue is too long. + if ((Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER) -And (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "yes")) { + return + } + if ($env:generator -eq "MinGW Makefiles") { + return # No test available for MinGW + } + & ctest -C $env:configuration --timeout 600 --output-on-failure + if ($LastExitCode -ne 0) { + throw "Exec: $ErrorMessage" + } + +artifacts: + - path: '_build/CMakeFiles/*.log' + name: logs + - path: '_build/Testing/**/*.xml' + name: test_results diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/BUILD.bazel vulkan-1.1.73+dfsg/submodules/googletest/BUILD.bazel --- vulkan-1.0.65.2+dfsg1/submodules/googletest/BUILD.bazel 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/BUILD.bazel 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,175 @@ +# Copyright 2017 Google Inc. +# 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 Google Inc. 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 +# OWNER 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. +# +# Author: misterg@google.com (Gennadiy Civil) +# +# Bazel Build for Google C++ Testing Framework(Google Test) + +package(default_visibility = ["//visibility:public"]) + +licenses(["notice"]) + +config_setting( + name = "windows", + values = { "cpu": "x64_windows" }, +) + +config_setting( + name = "windows_msvc", + values = {"cpu": "x64_windows_msvc"}, +) + +config_setting( + name = "has_absl", + values = {"define": "absl=1"}, +) + + +# Google Test including Google Mock +cc_library( + name = "gtest", + srcs = glob( + include = [ + "googletest/src/*.cc", + "googletest/src/*.h", + "googletest/include/gtest/**/*.h", + "googlemock/src/*.cc", + "googlemock/include/gmock/**/*.h", + ], + exclude = [ + "googletest/src/gtest-all.cc", + "googletest/src/gtest_main.cc", + "googlemock/src/gmock-all.cc", + "googlemock/src/gmock_main.cc", + ], + ), + hdrs =glob([ + "googletest/include/gtest/*.h", + "googlemock/include/gmock/*.h", + ]), + copts = select( + { + ":windows": [], + ":windows_msvc": [], + "//conditions:default": ["-pthread"], + }, + ), + includes = [ + "googlemock", + "googlemock/include", + "googletest", + "googletest/include", + ], + linkopts = select({ + ":windows": [], + ":windows_msvc": [], + "//conditions:default": [ + "-pthread", + ], + }), + defines = select ({ + ":has_absl": [ + "GTEST_HAS_ABSL=1", + ], + "//conditions:default": [], + } + ), + deps = select ({ + ":has_absl": [ + "@com_google_absl//absl/types:optional", + "@com_google_absl//absl/strings" + ], + "//conditions:default": [], + } + ) +) + +cc_library( + name = "gtest_main", + srcs = [ + "googlemock/src/gmock_main.cc", + ], + deps = [":gtest"], +) + +# The following rules build samples of how to use gTest. +cc_library( + name = "gtest_sample_lib", + srcs = [ + "googletest/samples/sample1.cc", + "googletest/samples/sample2.cc", + "googletest/samples/sample4.cc", + ], + hdrs = [ + "googletest/samples/prime_tables.h", + "googletest/samples/sample1.h", + "googletest/samples/sample2.h", + "googletest/samples/sample3-inl.h", + "googletest/samples/sample4.h", + ], +) + +cc_test( + name = "gtest_samples", + size = "small", + #All Samples except: + #sample9 ( main ) + #sample10 (main and takes a command line option and needs to be separate) + srcs = [ + "googletest/samples/sample1_unittest.cc", + "googletest/samples/sample2_unittest.cc", + "googletest/samples/sample3_unittest.cc", + "googletest/samples/sample4_unittest.cc", + "googletest/samples/sample5_unittest.cc", + "googletest/samples/sample6_unittest.cc", + "googletest/samples/sample7_unittest.cc", + "googletest/samples/sample8_unittest.cc", + ], + deps = [ + "gtest_sample_lib", + ":gtest_main", + ], +) + +cc_test( + name = "sample9_unittest", + size = "small", + srcs = ["googletest/samples/sample9_unittest.cc"], + deps = [":gtest"], +) + +cc_test( + name = "sample10_unittest", + size = "small", + srcs = ["googletest/samples/sample10_unittest.cc"], + deps = [ + ":gtest", + ], +) diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/ci/build-linux-autotools.sh vulkan-1.1.73+dfsg/submodules/googletest/ci/build-linux-autotools.sh --- vulkan-1.0.65.2+dfsg1/submodules/googletest/ci/build-linux-autotools.sh 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/ci/build-linux-autotools.sh 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# Copyright 2017 Google Inc. +# 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 Google Inc. 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 +# OWNER 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. + +set -e + +. ci/get-nprocessors.sh + +# Create the configuration script +autoreconf -i + +# Run in a subdirectory to keep the sources clean +mkdir build || true +cd build +../configure + +make -j ${NPROCESSORS:-2} diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/ci/build-linux-bazel.sh vulkan-1.1.73+dfsg/submodules/googletest/ci/build-linux-bazel.sh --- vulkan-1.0.65.2+dfsg1/submodules/googletest/ci/build-linux-bazel.sh 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/ci/build-linux-bazel.sh 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# Copyright 2017 Google Inc. +# 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 Google Inc. 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 +# OWNER 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. + +set -e + +bazel build --curses=no //...:all +bazel test --curses=no //...:all +bazel test --curses=no //...:all --define absl=1 diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/ci/env-linux.sh vulkan-1.1.73+dfsg/submodules/googletest/ci/env-linux.sh --- vulkan-1.0.65.2+dfsg1/submodules/googletest/ci/env-linux.sh 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/ci/env-linux.sh 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +# Copyright 2017 Google Inc. +# 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 Google Inc. 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 +# OWNER 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. + +# +# This file should be sourced, and not executed as a standalone script. +# + +# TODO() - we can check if this is being sourced using $BASH_VERSION and $BASH_SOURCE[0] != ${0}. + +if [ "${TRAVIS_OS_NAME}" = "linux" ]; then + if [ "$CXX" = "g++" ]; then export CXX="g++-4.9" CC="gcc-4.9"; fi + if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.7" CC="clang-3.7"; fi +fi diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/ci/env-osx.sh vulkan-1.1.73+dfsg/submodules/googletest/ci/env-osx.sh --- vulkan-1.0.65.2+dfsg1/submodules/googletest/ci/env-osx.sh 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/ci/env-osx.sh 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# Copyright 2017 Google Inc. +# 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 Google Inc. 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 +# OWNER 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. + +# +# This file should be sourced, and not executed as a standalone script. +# + +# TODO() - we can check if this is being sourced using $BASH_VERSION and $BASH_SOURCE[0] != ${0}. + +if [ "${TRAVIS_OS_NAME}" = "linux" ]; then + if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.7" CC="clang-3.7"; fi +fi diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/ci/get-nprocessors.sh vulkan-1.1.73+dfsg/submodules/googletest/ci/get-nprocessors.sh --- vulkan-1.0.65.2+dfsg1/submodules/googletest/ci/get-nprocessors.sh 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/ci/get-nprocessors.sh 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +# Copyright 2017 Google Inc. +# 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 Google Inc. 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 +# OWNER 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. + +# This file is typically sourced by another script. +# if possible, ask for the precise number of processors, +# otherwise take 2 processors as reasonable default; see +# https://docs.travis-ci.com/user/speeding-up-the-build/#Makefile-optimization +if [ -x /usr/bin/getconf ]; then + NPROCESSORS=$(/usr/bin/getconf _NPROCESSORS_ONLN) +else + NPROCESSORS=2 +fi + +# as of 2017-09-04 Travis CI reports 32 processors, but GCC build +# crashes if parallelized too much (maybe memory consumption problem), +# so limit to 4 processors for the time being. +if [ $NPROCESSORS -gt 4 ] ; then + echo "$0:Note: Limiting processors to use by make from $NPROCESSORS to 4." + NPROCESSORS=4 +fi diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/ci/install-linux.sh vulkan-1.1.73+dfsg/submodules/googletest/ci/install-linux.sh --- vulkan-1.0.65.2+dfsg1/submodules/googletest/ci/install-linux.sh 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/ci/install-linux.sh 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,49 @@ +#!/usr/bin/env bash +# Copyright 2017 Google Inc. +# 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 Google Inc. 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 +# OWNER 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. + +set -eu + +if [ "${TRAVIS_OS_NAME}" != linux ]; then + echo "Not a Linux build; skipping installation" + exit 0 +fi + + +if [ "${TRAVIS_SUDO}" = "true" ]; then + echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | \ + sudo tee /etc/apt/sources.list.d/bazel.list + curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add - + sudo apt-get update && sudo apt-get install -y bazel gcc-4.9 g++-4.9 clang-3.7 +elif [ "${CXX}" = "clang++" ]; then + # Use ccache, assuming $HOME/bin is in the path, which is true in the Travis build environment. + ln -sf /usr/bin/ccache $HOME/bin/${CXX}; + ln -sf /usr/bin/ccache $HOME/bin/${CC}; +fi diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/ci/install-osx.sh vulkan-1.1.73+dfsg/submodules/googletest/ci/install-osx.sh --- vulkan-1.0.65.2+dfsg1/submodules/googletest/ci/install-osx.sh 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/ci/install-osx.sh 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# Copyright 2017 Google Inc. +# 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 Google Inc. 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 +# OWNER 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. + +set -eu + +if [ "${TRAVIS_OS_NAME}" != "osx" ]; then + echo "Not a macOS build; skipping installation" + exit 0 +fi + +brew install ccache diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/ci/log-config.sh vulkan-1.1.73+dfsg/submodules/googletest/ci/log-config.sh --- vulkan-1.0.65.2+dfsg1/submodules/googletest/ci/log-config.sh 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/ci/log-config.sh 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +# Copyright 2017 Google Inc. +# 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 Google Inc. 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 +# OWNER 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. + +set -e + +# ccache on OS X needs installation first +# reset ccache statistics +ccache --zero-stats + +echo PATH=${PATH} + +echo "Compiler configuration:" +echo CXX=${CXX} +echo CC=${CC} +echo CXXFLAGS=${CXXFLAGS} + +echo "C++ compiler version:" +${CXX} --version || echo "${CXX} does not seem to support the --version flag" +${CXX} -v || echo "${CXX} does not seem to support the -v flag" + +echo "C compiler version:" +${CC} --version || echo "${CXX} does not seem to support the --version flag" +${CC} -v || echo "${CXX} does not seem to support the -v flag" diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/ci/travis.sh vulkan-1.1.73+dfsg/submodules/googletest/ci/travis.sh --- vulkan-1.0.65.2+dfsg1/submodules/googletest/ci/travis.sh 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/ci/travis.sh 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,36 @@ +#!/usr/bin/env sh +set -evx + +. ci/get-nprocessors.sh + +# if possible, ask for the precise number of processors, +# otherwise take 2 processors as reasonable default; see +# https://docs.travis-ci.com/user/speeding-up-the-build/#Makefile-optimization +if [ -x /usr/bin/getconf ]; then + NPROCESSORS=$(/usr/bin/getconf _NPROCESSORS_ONLN) +else + NPROCESSORS=2 +fi +# as of 2017-09-04 Travis CI reports 32 processors, but GCC build +# crashes if parallelized too much (maybe memory consumption problem), +# so limit to 4 processors for the time being. +if [ $NPROCESSORS -gt 4 ] ; then + echo "$0:Note: Limiting processors to use by make from $NPROCESSORS to 4." + NPROCESSORS=4 +fi +# Tell make to use the processors. No preceding '-' required. +MAKEFLAGS="j${NPROCESSORS}" +export MAKEFLAGS + +env | sort + +mkdir build || true +cd build +cmake -Dgtest_build_samples=ON \ + -Dgtest_build_tests=ON \ + -Dgmock_build_tests=ON \ + -DCMAKE_CXX_FLAGS=$CXX_FLAGS \ + -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ + .. +make +CTEST_OUTPUT_ON_FAILURE=1 make test diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/CMakeLists.txt vulkan-1.1.73+dfsg/submodules/googletest/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/submodules/googletest/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/CMakeLists.txt 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 2.6.4) + +if (POLICY CMP0048) + cmake_policy(SET CMP0048 NEW) +endif (POLICY CMP0048) + +project( googletest-distribution ) + +enable_testing() + +include(CMakeDependentOption) +if (CMAKE_VERSION VERSION_LESS 2.8.5) + set(CMAKE_INSTALL_BINDIR "bin" CACHE STRING "User executables (bin)") + set(CMAKE_INSTALL_LIBDIR "lib${LIB_SUFFIX}" CACHE STRING "Object code libraries (lib)") + set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE STRING "C header files (include)") + mark_as_advanced(CMAKE_INSTALL_BINDIR CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_INCLUDEDIR) +else() + include(GNUInstallDirs) +endif() + +option(BUILD_GTEST "Builds the googletest subproject" OFF) + +#Note that googlemock target already builds googletest +option(BUILD_GMOCK "Builds the googlemock subproject" ON) + +cmake_dependent_option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON "BUILD_GTEST OR BUILD_GMOCK" OFF) +cmake_dependent_option(INSTALL_GMOCK "Enable installation of googlemock. (Projects embedding googlemock may want to turn this OFF.)" ON "BUILD_GMOCK" OFF) + +if(BUILD_GMOCK) + add_subdirectory( googlemock ) +elseif(BUILD_GTEST) + add_subdirectory( googletest ) +endif() diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/configure.ac vulkan-1.1.73+dfsg/submodules/googletest/configure.ac --- vulkan-1.0.65.2+dfsg1/submodules/googletest/configure.ac 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/configure.ac 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,16 @@ +AC_INIT([Google C++ Mocking and Testing Frameworks], + [1.8.0], + [googlemock@googlegroups.com], + [googletest]) + +# Provide various options to initialize the Autoconf and configure processes. +AC_PREREQ([2.59]) +AC_CONFIG_SRCDIR([./README.md]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_SUBDIRS([googletest googlemock]) + +AM_INIT_AUTOMAKE + +# Output the generated files. No further autoconf macros may be used. +AC_OUTPUT diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/CONTRIBUTING.md vulkan-1.1.73+dfsg/submodules/googletest/CONTRIBUTING.md --- vulkan-1.0.65.2+dfsg1/submodules/googletest/CONTRIBUTING.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/CONTRIBUTING.md 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,160 @@ +# How to become a contributor and submit your own code + +## Contributor License Agreements + +We'd love to accept your patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an + [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a + [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the + [issue tracker](https://github.com/google/googletest). +1. Please don't mix more than one logical change per submittal, + because it makes the history hard to follow. If you want to make a + change that doesn't have a corresponding issue in the issue + tracker, please create one. +1. Also, coordinate with team members that are listed on the issue in + question. This ensures that work isn't being duplicated and + communicating your plan early also generally leads to better + patches. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the sample to which + you are contributing. +1. Ensure that your code has an appropriate set of unit tests which all pass. +1. Submit a pull request. + +If you are a Googler, it is preferable to first create an internal change and +have it reviewed and submitted, and then create an upstreaming pull +request here. + +## The Google Test and Google Mock Communities ## + +The Google Test community exists primarily through the +[discussion group](http://groups.google.com/group/googletestframework) +and the GitHub repository. +Likewise, the Google Mock community exists primarily through their own +[discussion group](http://groups.google.com/group/googlemock). +You are definitely encouraged to contribute to the +discussion and you can also help us to keep the effectiveness of the +group high by following and promoting the guidelines listed here. + +### Please Be Friendly ### + +Showing courtesy and respect to others is a vital part of the Google +culture, and we strongly encourage everyone participating in Google +Test development to join us in accepting nothing less. Of course, +being courteous is not the same as failing to constructively disagree +with each other, but it does mean that we should be respectful of each +other when enumerating the 42 technical reasons that a particular +proposal may not be the best choice. There's never a reason to be +antagonistic or dismissive toward anyone who is sincerely trying to +contribute to a discussion. + +Sure, C++ testing is serious business and all that, but it's also +a lot of fun. Let's keep it that way. Let's strive to be one of the +friendliest communities in all of open source. + +As always, discuss Google Test in the official GoogleTest discussion group. +You don't have to actually submit code in order to sign up. Your participation +itself is a valuable contribution. + +## Style + +To keep the source consistent, readable, diffable and easy to merge, +we use a fairly rigid coding style, as defined by the [google-styleguide](https://github.com/google/styleguide) project. All patches will be expected +to conform to the style outlined [here](https://google.github.io/styleguide/cppguide.html). + +## Requirements for Contributors ### + +If you plan to contribute a patch, you need to build Google Test, +Google Mock, and their own tests from a git checkout, which has +further requirements: + + * [Python](https://www.python.org/) v2.3 or newer (for running some of + the tests and re-generating certain source files from templates) + * [CMake](https://cmake.org/) v2.6.4 or newer + * [GNU Build System](https://en.wikipedia.org/wiki/GNU_Build_System) + including automake (>= 1.9), autoconf (>= 2.59), and + libtool / libtoolize. + +## Developing Google Test ## + +This section discusses how to make your own changes to Google Test. + +### Testing Google Test Itself ### + +To make sure your changes work as intended and don't break existing +functionality, you'll want to compile and run Google Test's own tests. +For that you can use CMake: + + mkdir mybuild + cd mybuild + cmake -Dgtest_build_tests=ON ${GTEST_DIR} + +Make sure you have Python installed, as some of Google Test's tests +are written in Python. If the cmake command complains about not being +able to find Python (`Could NOT find PythonInterp (missing: +PYTHON_EXECUTABLE)`), try telling it explicitly where your Python +executable can be found: + + cmake -DPYTHON_EXECUTABLE=path/to/python -Dgtest_build_tests=ON ${GTEST_DIR} + +Next, you can build Google Test and all of its own tests. On \*nix, +this is usually done by 'make'. To run the tests, do + + make test + +All tests should pass. + +### Regenerating Source Files ## + +Some of Google Test's source files are generated from templates (not +in the C++ sense) using a script. +For example, the +file include/gtest/internal/gtest-type-util.h.pump is used to generate +gtest-type-util.h in the same directory. + +You don't need to worry about regenerating the source files +unless you need to modify them. You would then modify the +corresponding `.pump` files and run the '[pump.py](googletest/scripts/pump.py)' +generator script. See the [Pump Manual](googletest/docs/PumpManual.md). + +## Developing Google Mock ### + +This section discusses how to make your own changes to Google Mock. + +#### Testing Google Mock Itself #### + +To make sure your changes work as intended and don't break existing +functionality, you'll want to compile and run Google Test's own tests. +For that you'll need Autotools. First, make sure you have followed +the instructions above to configure Google Mock. +Then, create a build output directory and enter it. Next, + + ${GMOCK_DIR}/configure # try --help for more info + +Once you have successfully configured Google Mock, the build steps are +standard for GNU-style OSS packages. + + make # Standard makefile following GNU conventions + make check # Builds and runs all tests - all should pass. + +Note that when building your project against Google Mock, you are building +against Google Test as well. There is no need to configure Google Test +separately. diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/CHANGES vulkan-1.1.73+dfsg/submodules/googletest/googlemock/CHANGES --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/CHANGES 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/CHANGES 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,126 @@ +Changes for 1.7.0: + +* All new improvements in Google Test 1.7.0. +* New feature: matchers DoubleNear(), FloatNear(), + NanSensitiveDoubleNear(), NanSensitiveFloatNear(), + UnorderedElementsAre(), UnorderedElementsAreArray(), WhenSorted(), + WhenSortedBy(), IsEmpty(), and SizeIs(). +* Improvement: Google Mock can now be built as a DLL. +* Improvement: when compiled by a C++11 compiler, matchers AllOf() + and AnyOf() can accept an arbitrary number of matchers. +* Improvement: when compiled by a C++11 compiler, matchers + ElementsAreArray() can accept an initializer list. +* Improvement: when exceptions are enabled, a mock method with no + default action now throws instead crashing the test. +* Improvement: added class testing::StringMatchResultListener to aid + definition of composite matchers. +* Improvement: function return types used in MOCK_METHOD*() macros can + now contain unprotected commas. +* Improvement (potentially breaking): EXPECT_THAT() and ASSERT_THAT() + are now more strict in ensuring that the value type and the matcher + type are compatible, catching potential bugs in tests. +* Improvement: Pointee() now works on an optional. +* Improvement: the ElementsAreArray() matcher can now take a vector or + iterator range as input, and makes a copy of its input elements + before the conversion to a Matcher. +* Improvement: the Google Mock Generator can now generate mocks for + some class templates. +* Bug fix: mock object destruction triggerred by another mock object's + destruction no longer hangs. +* Improvement: Google Mock Doctor works better with newer Clang and + GCC now. +* Compatibility fixes. +* Bug/warning fixes. + +Changes for 1.6.0: + +* Compilation is much faster and uses much less memory, especially + when the constructor and destructor of a mock class are moved out of + the class body. +* New matchers: Pointwise(), Each(). +* New actions: ReturnPointee() and ReturnRefOfCopy(). +* CMake support. +* Project files for Visual Studio 2010. +* AllOf() and AnyOf() can handle up-to 10 arguments now. +* Google Mock doctor understands Clang error messages now. +* SetArgPointee<> now accepts string literals. +* gmock_gen.py handles storage specifier macros and template return + types now. +* Compatibility fixes. +* Bug fixes and implementation clean-ups. +* Potentially incompatible changes: disables the harmful 'make install' + command in autotools. + +Potentially breaking changes: + +* The description string for MATCHER*() changes from Python-style + interpolation to an ordinary C++ string expression. +* SetArgumentPointee is deprecated in favor of SetArgPointee. +* Some non-essential project files for Visual Studio 2005 are removed. + +Changes for 1.5.0: + + * New feature: Google Mock can be safely used in multi-threaded tests + on platforms having pthreads. + * New feature: function for printing a value of arbitrary type. + * New feature: function ExplainMatchResult() for easy definition of + composite matchers. + * The new matcher API lets user-defined matchers generate custom + explanations more directly and efficiently. + * Better failure messages all around. + * NotNull() and IsNull() now work with smart pointers. + * Field() and Property() now work when the matcher argument is a pointer + passed by reference. + * Regular expression matchers on all platforms. + * Added GCC 4.0 support for Google Mock Doctor. + * Added gmock_all_test.cc for compiling most Google Mock tests + in a single file. + * Significantly cleaned up compiler warnings. + * Bug fixes, better test coverage, and implementation clean-ups. + + Potentially breaking changes: + + * Custom matchers defined using MatcherInterface or MakePolymorphicMatcher() + need to be updated after upgrading to Google Mock 1.5.0; matchers defined + using MATCHER or MATCHER_P* aren't affected. + * Dropped support for 'make install'. + +Changes for 1.4.0 (we skipped 1.2.* and 1.3.* to match the version of +Google Test): + + * Works in more environments: Symbian and minGW, Visual C++ 7.1. + * Lighter weight: comes with our own implementation of TR1 tuple (no + more dependency on Boost!). + * New feature: --gmock_catch_leaked_mocks for detecting leaked mocks. + * New feature: ACTION_TEMPLATE for defining templatized actions. + * New feature: the .After() clause for specifying expectation order. + * New feature: the .With() clause for specifying inter-argument + constraints. + * New feature: actions ReturnArg(), ReturnNew(...), and + DeleteArg(). + * New feature: matchers Key(), Pair(), Args<...>(), AllArgs(), IsNull(), + and Contains(). + * New feature: utility class MockFunction, useful for checkpoints, etc. + * New feature: functions Value(x, m) and SafeMatcherCast(m). + * New feature: copying a mock object is rejected at compile time. + * New feature: a script for fusing all Google Mock and Google Test + source files for easy deployment. + * Improved the Google Mock doctor to diagnose more diseases. + * Improved the Google Mock generator script. + * Compatibility fixes for Mac OS X and gcc. + * Bug fixes and implementation clean-ups. + +Changes for 1.1.0: + + * New feature: ability to use Google Mock with any testing framework. + * New feature: macros for easily defining new matchers + * New feature: macros for easily defining new actions. + * New feature: more container matchers. + * New feature: actions for accessing function arguments and throwing + exceptions. + * Improved the Google Mock doctor script for diagnosing compiler errors. + * Bug fixes and implementation clean-ups. + +Changes for 1.0.0: + + * Initial Open Source release of Google Mock diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/cmake/gmock_main.pc.in vulkan-1.1.73+dfsg/submodules/googletest/googlemock/cmake/gmock_main.pc.in --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/cmake/gmock_main.pc.in 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/cmake/gmock_main.pc.in 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,9 @@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: gmock_main +Description: GoogleMock (with main() function) +Version: @PROJECT_VERSION@ +URL: https://github.com/google/googletest +Libs: -L${libdir} -lgmock_main @CMAKE_THREAD_LIBS_INIT@ +Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ @CMAKE_THREAD_LIBS_INIT@ diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/cmake/gmock.pc.in vulkan-1.1.73+dfsg/submodules/googletest/googlemock/cmake/gmock.pc.in --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/cmake/gmock.pc.in 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/cmake/gmock.pc.in 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,9 @@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: gmock +Description: GoogleMock (without main() function) +Version: @PROJECT_VERSION@ +URL: https://github.com/google/googletest +Libs: -L${libdir} -lgmock @CMAKE_THREAD_LIBS_INIT@ +Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ @CMAKE_THREAD_LIBS_INIT@ diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/CMakeLists.txt vulkan-1.1.73+dfsg/submodules/googletest/googlemock/CMakeLists.txt --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/CMakeLists.txt 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,242 @@ +######################################################################## +# CMake build script for Google Mock. +# +# To run the tests for Google Mock itself on Linux, use 'make test' or +# ctest. You can select which tests to run using 'ctest -R regex'. +# For more options, run 'ctest --help'. + +# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to +# make it prominent in the GUI. +option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF) + +option(gmock_build_tests "Build all of Google Mock's own tests." OFF) + +# A directory to find Google Test sources. +if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/gtest/CMakeLists.txt") + set(gtest_dir gtest) +else() + set(gtest_dir ../googletest) +endif() + +# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build(). +include("${gtest_dir}/cmake/hermetic_build.cmake" OPTIONAL) + +if (COMMAND pre_project_set_up_hermetic_build) + # Google Test also calls hermetic setup functions from add_subdirectory, + # although its changes will not affect things at the current scope. + pre_project_set_up_hermetic_build() +endif() + +######################################################################## +# +# Project-wide settings + +# Name of the project. +# +# CMake files in this project can refer to the root source directory +# as ${gmock_SOURCE_DIR} and to the root binary directory as +# ${gmock_BINARY_DIR}. +# Language "C" is required for find_package(Threads). +if (CMAKE_VERSION VERSION_LESS 3.0) + project(gmock CXX C) +else() + cmake_policy(SET CMP0048 NEW) + project(gmock VERSION 1.9.0 LANGUAGES CXX C) +endif() +cmake_minimum_required(VERSION 2.6.4) + +if (COMMAND set_up_hermetic_build) + set_up_hermetic_build() +endif() + +# Instructs CMake to process Google Test's CMakeLists.txt and add its +# targets to the current scope. We are placing Google Test's binary +# directory in a subdirectory of our own as VC compilation may break +# if they are the same (the default). +add_subdirectory("${gtest_dir}" "${gmock_BINARY_DIR}/gtest") + +# Although Google Test's CMakeLists.txt calls this function, the +# changes there don't affect the current scope. Therefore we have to +# call it again here. +config_compiler_and_linker() # from ${gtest_dir}/cmake/internal_utils.cmake + +# Adds Google Mock's and Google Test's header directories to the search path. +include_directories("${gmock_SOURCE_DIR}/include" + "${gmock_SOURCE_DIR}" + "${gtest_SOURCE_DIR}/include" + # This directory is needed to build directly from Google + # Test sources. + "${gtest_SOURCE_DIR}") + +# Summary of tuple support for Microsoft Visual Studio: +# Compiler version(MS) version(cmake) Support +# ---------- ----------- -------------- ----------------------------- +# <= VS 2010 <= 10 <= 1600 Use Google Tests's own tuple. +# VS 2012 11 1700 std::tr1::tuple + _VARIADIC_MAX=10 +# VS 2013 12 1800 std::tr1::tuple +# VS 2015 14 1900 std::tuple +# VS 2017 15 >= 1910 std::tuple +if (MSVC AND MSVC_VERSION EQUAL 1700) + add_definitions(/D _VARIADIC_MAX=10) +endif() + +######################################################################## +# +# Defines the gmock & gmock_main libraries. User tests should link +# with one of them. + +# Google Mock libraries. We build them using more strict warnings than what +# are used for other targets, to ensure that Google Mock can be compiled by +# a user aggressive about warnings. +if (MSVC) + cxx_library(gmock + "${cxx_strict}" + "${gtest_dir}/src/gtest-all.cc" + src/gmock-all.cc) + + cxx_library(gmock_main + "${cxx_strict}" + "${gtest_dir}/src/gtest-all.cc" + src/gmock-all.cc + src/gmock_main.cc) +else() + cxx_library(gmock "${cxx_strict}" src/gmock-all.cc) + target_link_libraries(gmock gtest) + cxx_library(gmock_main "${cxx_strict}" src/gmock_main.cc) + target_link_libraries(gmock_main gmock) +endif() + +# If the CMake version supports it, attach header directory information +# to the targets for when we are part of a parent build (ie being pulled +# in via add_subdirectory() rather than being a standalone build). +if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11") + target_include_directories(gmock SYSTEM INTERFACE "${gmock_SOURCE_DIR}/include") + target_include_directories(gmock_main SYSTEM INTERFACE "${gmock_SOURCE_DIR}/include") +endif() + +######################################################################## +# +# Install rules +if(INSTALL_GMOCK) + install(TARGETS gmock gmock_main + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") + install(DIRECTORY "${gmock_SOURCE_DIR}/include/gmock" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + + # configure and install pkgconfig files + configure_file( + cmake/gmock.pc.in + "${CMAKE_BINARY_DIR}/gmock.pc" + @ONLY) + configure_file( + cmake/gmock_main.pc.in + "${CMAKE_BINARY_DIR}/gmock_main.pc" + @ONLY) + install(FILES "${CMAKE_BINARY_DIR}/gmock.pc" "${CMAKE_BINARY_DIR}/gmock_main.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") +endif() + +######################################################################## +# +# Google Mock's own tests. +# +# You can skip this section if you aren't interested in testing +# Google Mock itself. +# +# The tests are not built by default. To build them, set the +# gmock_build_tests option to ON. You can do it by running ccmake +# or specifying the -Dgmock_build_tests=ON flag when running cmake. + +if (gmock_build_tests) + # This must be set in the root directory for the tests to be run by + # 'make test' or ctest. + enable_testing() + + ############################################################ + # C++ tests built with standard compiler flags. + + cxx_test(gmock-actions_test gmock_main) + cxx_test(gmock-cardinalities_test gmock_main) + cxx_test(gmock_ex_test gmock_main) + cxx_test(gmock-generated-actions_test gmock_main) + cxx_test(gmock-generated-function-mockers_test gmock_main) + cxx_test(gmock-generated-internal-utils_test gmock_main) + cxx_test(gmock-generated-matchers_test gmock_main) + cxx_test(gmock-internal-utils_test gmock_main) + cxx_test(gmock-matchers_test gmock_main) + cxx_test(gmock-more-actions_test gmock_main) + cxx_test(gmock-nice-strict_test gmock_main) + cxx_test(gmock-port_test gmock_main) + cxx_test(gmock-spec-builders_test gmock_main) + cxx_test(gmock_link_test gmock_main test/gmock_link2_test.cc) + cxx_test(gmock_test gmock_main) + + if (DEFINED GTEST_HAS_PTHREAD) + cxx_test(gmock_stress_test gmock) + endif() + + # gmock_all_test is commented to save time building and running tests. + # Uncomment if necessary. + # cxx_test(gmock_all_test gmock_main) + + ############################################################ + # C++ tests built with non-standard compiler flags. + + if (MSVC) + cxx_library(gmock_main_no_exception "${cxx_no_exception}" + "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc) + + cxx_library(gmock_main_no_rtti "${cxx_no_rtti}" + "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc) + + if (MSVC_VERSION LESS 1600) # 1600 is Visual Studio 2010. + # Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that + # conflict with our own definitions. Therefore using our own tuple does not + # work on those compilers. + cxx_library(gmock_main_use_own_tuple "${cxx_use_own_tuple}" + "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc) + + cxx_test_with_flags(gmock_use_own_tuple_test "${cxx_use_own_tuple}" + gmock_main_use_own_tuple test/gmock-spec-builders_test.cc) + endif() + else() + cxx_library(gmock_main_no_exception "${cxx_no_exception}" src/gmock_main.cc) + target_link_libraries(gmock_main_no_exception gmock) + + cxx_library(gmock_main_no_rtti "${cxx_no_rtti}" src/gmock_main.cc) + target_link_libraries(gmock_main_no_rtti gmock) + + cxx_library(gmock_main_use_own_tuple "${cxx_use_own_tuple}" src/gmock_main.cc) + target_link_libraries(gmock_main_use_own_tuple gmock) + endif() + cxx_test_with_flags(gmock-more-actions_no_exception_test "${cxx_no_exception}" + gmock_main_no_exception test/gmock-more-actions_test.cc) + + cxx_test_with_flags(gmock_no_rtti_test "${cxx_no_rtti}" + gmock_main_no_rtti test/gmock-spec-builders_test.cc) + + cxx_shared_library(shared_gmock_main "${cxx_default}" + "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc) + + # Tests that a binary can be built with Google Mock as a shared library. On + # some system configurations, it may not possible to run the binary without + # knowing more details about the system configurations. We do not try to run + # this binary. To get a more robust shared library coverage, configure with + # -DBUILD_SHARED_LIBS=ON. + cxx_executable_with_flags(shared_gmock_test_ "${cxx_default}" + shared_gmock_main test/gmock-spec-builders_test.cc) + set_target_properties(shared_gmock_test_ + PROPERTIES + COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1") + + ############################################################ + # Python tests. + + cxx_executable(gmock_leak_test_ test gmock_main) + py_test(gmock_leak_test) + + cxx_executable(gmock_output_test_ test gmock) + py_test(gmock_output_test) +endif() diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/configure.ac vulkan-1.1.73+dfsg/submodules/googletest/googlemock/configure.ac --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/configure.ac 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/configure.ac 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,146 @@ +m4_include(../googletest/m4/acx_pthread.m4) + +AC_INIT([Google C++ Mocking Framework], + [1.8.0], + [googlemock@googlegroups.com], + [gmock]) + +# Provide various options to initialize the Autoconf and configure processes. +AC_PREREQ([2.59]) +AC_CONFIG_SRCDIR([./LICENSE]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_HEADERS([build-aux/config.h]) +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([scripts/gmock-config], [chmod +x scripts/gmock-config]) + +# Initialize Automake with various options. We require at least v1.9, prevent +# pedantic complaints about package files, and enable various distribution +# targets. +AM_INIT_AUTOMAKE([1.9 dist-bzip2 dist-zip foreign subdir-objects]) + +# Check for programs used in building Google Test. +AC_PROG_CC +AC_PROG_CXX +AC_LANG([C++]) +AC_PROG_LIBTOOL + +# TODO(chandlerc@google.com): Currently we aren't running the Python tests +# against the interpreter detected by AM_PATH_PYTHON, and so we condition +# HAVE_PYTHON by requiring "python" to be in the PATH, and that interpreter's +# version to be >= 2.3. This will allow the scripts to use a "/usr/bin/env" +# hashbang. +PYTHON= # We *do not* allow the user to specify a python interpreter +AC_PATH_PROG([PYTHON],[python],[:]) +AS_IF([test "$PYTHON" != ":"], + [AM_PYTHON_CHECK_VERSION([$PYTHON],[2.3],[:],[PYTHON=":"])]) +AM_CONDITIONAL([HAVE_PYTHON],[test "$PYTHON" != ":"]) + +# TODO(chandlerc@google.com) Check for the necessary system headers. + +# Configure pthreads. +AC_ARG_WITH([pthreads], + [AS_HELP_STRING([--with-pthreads], + [use pthreads (default is yes)])], + [with_pthreads=$withval], + [with_pthreads=check]) + +have_pthreads=no +AS_IF([test "x$with_pthreads" != "xno"], + [ACX_PTHREAD( + [], + [AS_IF([test "x$with_pthreads" != "xcheck"], + [AC_MSG_FAILURE( + [--with-pthreads was specified, but unable to be used])])]) + have_pthreads="$acx_pthread_ok"]) +AM_CONDITIONAL([HAVE_PTHREADS],[test "x$have_pthreads" == "xyes"]) +AC_SUBST(PTHREAD_CFLAGS) +AC_SUBST(PTHREAD_LIBS) + +# GoogleMock currently has hard dependencies upon GoogleTest above and beyond +# running its own test suite, so we both provide our own version in +# a subdirectory and provide some logic to use a custom version or a system +# installed version. +AC_ARG_WITH([gtest], + [AS_HELP_STRING([--with-gtest], + [Specifies how to find the gtest package. If no + arguments are given, the default behavior, a + system installed gtest will be used if present, + and an internal version built otherwise. If a + path is provided, the gtest built or installed at + that prefix will be used.])], + [], + [with_gtest=yes]) +AC_ARG_ENABLE([external-gtest], + [AS_HELP_STRING([--disable-external-gtest], + [Disables any detection or use of a system + installed or user provided gtest. Any option to + '--with-gtest' is ignored. (Default is enabled.)]) + ], [], [enable_external_gtest=yes]) +AS_IF([test "x$with_gtest" == "xno"], + [AC_MSG_ERROR([dnl +Support for GoogleTest was explicitly disabled. Currently GoogleMock has a hard +dependency upon GoogleTest to build, please provide a version, or allow +GoogleMock to use any installed version and fall back upon its internal +version.])]) + +# Setup various GTEST variables. TODO(chandlerc@google.com): When these are +# used below, they should be used such that any pre-existing values always +# trump values we set them to, so that they can be used to selectively override +# details of the detection process. +AC_ARG_VAR([GTEST_CONFIG], + [The exact path of Google Test's 'gtest-config' script.]) +AC_ARG_VAR([GTEST_CPPFLAGS], + [C-like preprocessor flags for Google Test.]) +AC_ARG_VAR([GTEST_CXXFLAGS], + [C++ compile flags for Google Test.]) +AC_ARG_VAR([GTEST_LDFLAGS], + [Linker path and option flags for Google Test.]) +AC_ARG_VAR([GTEST_LIBS], + [Library linking flags for Google Test.]) +AC_ARG_VAR([GTEST_VERSION], + [The version of Google Test available.]) +HAVE_BUILT_GTEST="no" + +GTEST_MIN_VERSION="1.8.0" + +AS_IF([test "x${enable_external_gtest}" = "xyes"], + [# Begin filling in variables as we are able. + AS_IF([test "x${with_gtest}" != "xyes"], + [AS_IF([test -x "${with_gtest}/scripts/gtest-config"], + [GTEST_CONFIG="${with_gtest}/scripts/gtest-config"], + [GTEST_CONFIG="${with_gtest}/bin/gtest-config"]) + AS_IF([test -x "${GTEST_CONFIG}"], [], + [AC_MSG_ERROR([dnl +Unable to locate either a built or installed Google Test at '${with_gtest}'.]) + ])]) + + AS_IF([test -x "${GTEST_CONFIG}"], [], + [AC_PATH_PROG([GTEST_CONFIG], [gtest-config])]) + AS_IF([test -x "${GTEST_CONFIG}"], + [AC_MSG_CHECKING([for Google Test version >= ${GTEST_MIN_VERSION}]) + AS_IF([${GTEST_CONFIG} --min-version=${GTEST_MIN_VERSION}], + [AC_MSG_RESULT([yes]) + HAVE_BUILT_GTEST="yes"], + [AC_MSG_RESULT([no])])])]) + +AS_IF([test "x${HAVE_BUILT_GTEST}" = "xyes"], + [GTEST_CPPFLAGS=`${GTEST_CONFIG} --cppflags` + GTEST_CXXFLAGS=`${GTEST_CONFIG} --cxxflags` + GTEST_LDFLAGS=`${GTEST_CONFIG} --ldflags` + GTEST_LIBS=`${GTEST_CONFIG} --libs` + GTEST_VERSION=`${GTEST_CONFIG} --version`], + [ + # GTEST_CONFIG needs to be executable both in a Makefile environment and + # in a shell script environment, so resolve an absolute path for it here. + GTEST_CONFIG="`pwd -P`/../googletest/scripts/gtest-config" + GTEST_CPPFLAGS='-I$(top_srcdir)/../googletest/include' + GTEST_CXXFLAGS='-g' + GTEST_LDFLAGS='' + GTEST_LIBS='$(top_builddir)/../googletest/lib/libgtest.la' + GTEST_VERSION="${GTEST_MIN_VERSION}"]) + +# TODO(chandlerc@google.com) Check the types, structures, and other compiler +# and architecture characteristics. + +# Output the generated files. No further autoconf macros may be used. +AC_OUTPUT diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/CONTRIBUTORS vulkan-1.1.73+dfsg/submodules/googletest/googlemock/CONTRIBUTORS --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/CONTRIBUTORS 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/CONTRIBUTORS 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,40 @@ +# This file contains a list of people who've made non-trivial +# contribution to the Google C++ Mocking Framework project. People +# who commit code to the project are encouraged to add their names +# here. Please keep the list sorted by first names. + +Benoit Sigoure +Bogdan Piloca +Chandler Carruth +Dave MacLachlan +David Anderson +Dean Sturtevant +Gene Volovich +Hal Burch +Jeffrey Yasskin +Jim Keller +Joe Walnes +Jon Wray +Keir Mierle +Keith Ray +Kostya Serebryany +Lev Makhlis +Manuel Klimek +Mario Tanev +Mark Paskin +Markus Heule +Matthew Simmons +Mike Bland +Neal Norwitz +Nermin Ozkiranartli +Owen Carlsen +Paneendra Ba +Paul Menage +Piotr Kaminski +Russ Rufer +Sverre Sundsdal +Takeshi Yoshino +Vadim Berman +Vlad Losev +Wolfgang Klier +Zhanyong Wan diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/docs/CheatSheet.md vulkan-1.1.73+dfsg/submodules/googletest/googlemock/docs/CheatSheet.md --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/docs/CheatSheet.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/docs/CheatSheet.md 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,564 @@ + + +# Defining a Mock Class # + +## Mocking a Normal Class ## + +Given +``` +class Foo { + ... + virtual ~Foo(); + virtual int GetSize() const = 0; + virtual string Describe(const char* name) = 0; + virtual string Describe(int type) = 0; + virtual bool Process(Bar elem, int count) = 0; +}; +``` +(note that `~Foo()` **must** be virtual) we can define its mock as +``` +#include "gmock/gmock.h" + +class MockFoo : public Foo { + MOCK_CONST_METHOD0(GetSize, int()); + MOCK_METHOD1(Describe, string(const char* name)); + MOCK_METHOD1(Describe, string(int type)); + MOCK_METHOD2(Process, bool(Bar elem, int count)); +}; +``` + +To create a "nice" mock object which ignores all uninteresting calls, +or a "strict" mock object, which treats them as failures: +``` +NiceMock nice_foo; // The type is a subclass of MockFoo. +StrictMock strict_foo; // The type is a subclass of MockFoo. +``` + +## Mocking a Class Template ## + +To mock +``` +template +class StackInterface { + public: + ... + virtual ~StackInterface(); + virtual int GetSize() const = 0; + virtual void Push(const Elem& x) = 0; +}; +``` +(note that `~StackInterface()` **must** be virtual) just append `_T` to the `MOCK_*` macros: +``` +template +class MockStack : public StackInterface { + public: + ... + MOCK_CONST_METHOD0_T(GetSize, int()); + MOCK_METHOD1_T(Push, void(const Elem& x)); +}; +``` + +## Specifying Calling Conventions for Mock Functions ## + +If your mock function doesn't use the default calling convention, you +can specify it by appending `_WITH_CALLTYPE` to any of the macros +described in the previous two sections and supplying the calling +convention as the first argument to the macro. For example, +``` + MOCK_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo, bool(int n)); + MOCK_CONST_METHOD2_WITH_CALLTYPE(STDMETHODCALLTYPE, Bar, int(double x, double y)); +``` +where `STDMETHODCALLTYPE` is defined by `` on Windows. + +# Using Mocks in Tests # + +The typical flow is: + 1. Import the Google Mock names you need to use. All Google Mock names are in the `testing` namespace unless they are macros or otherwise noted. + 1. Create the mock objects. + 1. Optionally, set the default actions of the mock objects. + 1. Set your expectations on the mock objects (How will they be called? What wil they do?). + 1. Exercise code that uses the mock objects; if necessary, check the result using [Google Test](../../googletest/) assertions. + 1. When a mock objects is destructed, Google Mock automatically verifies that all expectations on it have been satisfied. + +Here is an example: +``` +using ::testing::Return; // #1 + +TEST(BarTest, DoesThis) { + MockFoo foo; // #2 + + ON_CALL(foo, GetSize()) // #3 + .WillByDefault(Return(1)); + // ... other default actions ... + + EXPECT_CALL(foo, Describe(5)) // #4 + .Times(3) + .WillRepeatedly(Return("Category 5")); + // ... other expectations ... + + EXPECT_EQ("good", MyProductionFunction(&foo)); // #5 +} // #6 +``` + +# Setting Default Actions # + +Google Mock has a **built-in default action** for any function that +returns `void`, `bool`, a numeric value, or a pointer. + +To customize the default action for functions with return type `T` globally: +``` +using ::testing::DefaultValue; + +// Sets the default value to be returned. T must be CopyConstructible. +DefaultValue::Set(value); +// Sets a factory. Will be invoked on demand. T must be MoveConstructible. +// T MakeT(); +DefaultValue::SetFactory(&MakeT); +// ... use the mocks ... +// Resets the default value. +DefaultValue::Clear(); +``` + +To customize the default action for a particular method, use `ON_CALL()`: +``` +ON_CALL(mock_object, method(matchers)) + .With(multi_argument_matcher) ? + .WillByDefault(action); +``` + +# Setting Expectations # + +`EXPECT_CALL()` sets **expectations** on a mock method (How will it be +called? What will it do?): +``` +EXPECT_CALL(mock_object, method(matchers)) + .With(multi_argument_matcher) ? + .Times(cardinality) ? + .InSequence(sequences) * + .After(expectations) * + .WillOnce(action) * + .WillRepeatedly(action) ? + .RetiresOnSaturation(); ? +``` + +If `Times()` is omitted, the cardinality is assumed to be: + + * `Times(1)` when there is neither `WillOnce()` nor `WillRepeatedly()`; + * `Times(n)` when there are `n WillOnce()`s but no `WillRepeatedly()`, where `n` >= 1; or + * `Times(AtLeast(n))` when there are `n WillOnce()`s and a `WillRepeatedly()`, where `n` >= 0. + +A method with no `EXPECT_CALL()` is free to be invoked _any number of times_, and the default action will be taken each time. + +# Matchers # + +A **matcher** matches a _single_ argument. You can use it inside +`ON_CALL()` or `EXPECT_CALL()`, or use it to validate a value +directly: + +| `EXPECT_THAT(value, matcher)` | Asserts that `value` matches `matcher`. | +|:------------------------------|:----------------------------------------| +| `ASSERT_THAT(value, matcher)` | The same as `EXPECT_THAT(value, matcher)`, except that it generates a **fatal** failure. | + +Built-in matchers (where `argument` is the function argument) are +divided into several categories: + +## Wildcard ## +|`_`|`argument` can be any value of the correct type.| +|:--|:-----------------------------------------------| +|`A()` or `An()`|`argument` can be any value of type `type`. | + +## Generic Comparison ## + +|`Eq(value)` or `value`|`argument == value`| +|:---------------------|:------------------| +|`Ge(value)` |`argument >= value`| +|`Gt(value)` |`argument > value` | +|`Le(value)` |`argument <= value`| +|`Lt(value)` |`argument < value` | +|`Ne(value)` |`argument != value`| +|`IsNull()` |`argument` is a `NULL` pointer (raw or smart).| +|`NotNull()` |`argument` is a non-null pointer (raw or smart).| +|`VariantWith(m)` |`argument` is `variant<>` that holds the alternative of +type T with a value matching `m`.| +|`Ref(variable)` |`argument` is a reference to `variable`.| +|`TypedEq(value)`|`argument` has type `type` and is equal to `value`. You may need to use this instead of `Eq(value)` when the mock function is overloaded.| + +Except `Ref()`, these matchers make a _copy_ of `value` in case it's +modified or destructed later. If the compiler complains that `value` +doesn't have a public copy constructor, try wrap it in `ByRef()`, +e.g. `Eq(ByRef(non_copyable_value))`. If you do that, make sure +`non_copyable_value` is not changed afterwards, or the meaning of your +matcher will be changed. + +## Floating-Point Matchers ## + +|`DoubleEq(a_double)`|`argument` is a `double` value approximately equal to `a_double`, treating two NaNs as unequal.| +|:-------------------|:----------------------------------------------------------------------------------------------| +|`FloatEq(a_float)` |`argument` is a `float` value approximately equal to `a_float`, treating two NaNs as unequal. | +|`NanSensitiveDoubleEq(a_double)`|`argument` is a `double` value approximately equal to `a_double`, treating two NaNs as equal. | +|`NanSensitiveFloatEq(a_float)`|`argument` is a `float` value approximately equal to `a_float`, treating two NaNs as equal. | + +The above matchers use ULP-based comparison (the same as used in +[Google Test](../../googletest/)). They +automatically pick a reasonable error bound based on the absolute +value of the expected value. `DoubleEq()` and `FloatEq()` conform to +the IEEE standard, which requires comparing two NaNs for equality to +return false. The `NanSensitive*` version instead treats two NaNs as +equal, which is often what a user wants. + +|`DoubleNear(a_double, max_abs_error)`|`argument` is a `double` value close to `a_double` (absolute error <= `max_abs_error`), treating two NaNs as unequal.| +|:------------------------------------|:--------------------------------------------------------------------------------------------------------------------| +|`FloatNear(a_float, max_abs_error)` |`argument` is a `float` value close to `a_float` (absolute error <= `max_abs_error`), treating two NaNs as unequal. | +|`NanSensitiveDoubleNear(a_double, max_abs_error)`|`argument` is a `double` value close to `a_double` (absolute error <= `max_abs_error`), treating two NaNs as equal. | +|`NanSensitiveFloatNear(a_float, max_abs_error)`|`argument` is a `float` value close to `a_float` (absolute error <= `max_abs_error`), treating two NaNs as equal. | + +## String Matchers ## + +The `argument` can be either a C string or a C++ string object: + +|`ContainsRegex(string)`|`argument` matches the given regular expression.| +|:----------------------|:-----------------------------------------------| +|`EndsWith(suffix)` |`argument` ends with string `suffix`. | +|`HasSubstr(string)` |`argument` contains `string` as a sub-string. | +|`MatchesRegex(string)` |`argument` matches the given regular expression with the match starting at the first character and ending at the last character.| +|`StartsWith(prefix)` |`argument` starts with string `prefix`. | +|`StrCaseEq(string)` |`argument` is equal to `string`, ignoring case. | +|`StrCaseNe(string)` |`argument` is not equal to `string`, ignoring case.| +|`StrEq(string)` |`argument` is equal to `string`. | +|`StrNe(string)` |`argument` is not equal to `string`. | + +`ContainsRegex()` and `MatchesRegex()` use the regular expression +syntax defined +[here](../../googletest/docs/AdvancedGuide.md#regular-expression-syntax). +`StrCaseEq()`, `StrCaseNe()`, `StrEq()`, and `StrNe()` work for wide +strings as well. + +## Container Matchers ## + +Most STL-style containers support `==`, so you can use +`Eq(expected_container)` or simply `expected_container` to match a +container exactly. If you want to write the elements in-line, +match them more flexibly, or get more informative messages, you can use: + +| `ContainerEq(container)` | The same as `Eq(container)` except that the failure message also includes which elements are in one container but not the other. | +|:-------------------------|:---------------------------------------------------------------------------------------------------------------------------------| +| `Contains(e)` | `argument` contains an element that matches `e`, which can be either a value or a matcher. | +| `Each(e)` | `argument` is a container where _every_ element matches `e`, which can be either a value or a matcher. | +| `ElementsAre(e0, e1, ..., en)` | `argument` has `n + 1` elements, where the i-th element matches `ei`, which can be a value or a matcher. 0 to 10 arguments are allowed. | +| `ElementsAreArray({ e0, e1, ..., en })`, `ElementsAreArray(array)`, or `ElementsAreArray(array, count)` | The same as `ElementsAre()` except that the expected element values/matchers come from an initializer list, STL-style container, or C-style array. | +| `IsEmpty()` | `argument` is an empty container (`container.empty()`). | +| `Pointwise(m, container)` | `argument` contains the same number of elements as in `container`, and for all i, (the i-th element in `argument`, the i-th element in `container`) match `m`, which is a matcher on 2-tuples. E.g. `Pointwise(Le(), upper_bounds)` verifies that each element in `argument` doesn't exceed the corresponding element in `upper_bounds`. See more detail below. | +| `SizeIs(m)` | `argument` is a container whose size matches `m`. E.g. `SizeIs(2)` or `SizeIs(Lt(2))`. | +| `UnorderedElementsAre(e0, e1, ..., en)` | `argument` has `n + 1` elements, and under some permutation each element matches an `ei` (for a different `i`), which can be a value or a matcher. 0 to 10 arguments are allowed. | +| `UnorderedElementsAreArray({ e0, e1, ..., en })`, `UnorderedElementsAreArray(array)`, or `UnorderedElementsAreArray(array, count)` | The same as `UnorderedElementsAre()` except that the expected element values/matchers come from an initializer list, STL-style container, or C-style array. | +| `WhenSorted(m)` | When `argument` is sorted using the `<` operator, it matches container matcher `m`. E.g. `WhenSorted(ElementsAre(1, 2, 3))` verifies that `argument` contains elements `1`, `2`, and `3`, ignoring order. | +| `WhenSortedBy(comparator, m)` | The same as `WhenSorted(m)`, except that the given comparator instead of `<` is used to sort `argument`. E.g. `WhenSortedBy(std::greater(), ElementsAre(3, 2, 1))`. | + +Notes: + + * These matchers can also match: + 1. a native array passed by reference (e.g. in `Foo(const int (&a)[5])`), and + 1. an array passed as a pointer and a count (e.g. in `Bar(const T* buffer, int len)` -- see [Multi-argument Matchers](#Multiargument_Matchers.md)). + * The array being matched may be multi-dimensional (i.e. its elements can be arrays). + * `m` in `Pointwise(m, ...)` should be a matcher for `::testing::tuple` where `T` and `U` are the element type of the actual container and the expected container, respectively. For example, to compare two `Foo` containers where `Foo` doesn't support `operator==` but has an `Equals()` method, one might write: + +``` +using ::testing::get; +MATCHER(FooEq, "") { + return get<0>(arg).Equals(get<1>(arg)); +} +... +EXPECT_THAT(actual_foos, Pointwise(FooEq(), expected_foos)); +``` + +## Member Matchers ## + +|`Field(&class::field, m)`|`argument.field` (or `argument->field` when `argument` is a plain pointer) matches matcher `m`, where `argument` is an object of type _class_.| +|:------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------| +|`Key(e)` |`argument.first` matches `e`, which can be either a value or a matcher. E.g. `Contains(Key(Le(5)))` can verify that a `map` contains a key `<= 5`.| +|`Pair(m1, m2)` |`argument` is an `std::pair` whose `first` field matches `m1` and `second` field matches `m2`. | +|`Property(&class::property, m)`|`argument.property()` (or `argument->property()` when `argument` is a plain pointer) matches matcher `m`, where `argument` is an object of type _class_.| + +## Matching the Result of a Function or Functor ## + +|`ResultOf(f, m)`|`f(argument)` matches matcher `m`, where `f` is a function or functor.| +|:---------------|:---------------------------------------------------------------------| + +## Pointer Matchers ## + +|`Pointee(m)`|`argument` (either a smart pointer or a raw pointer) points to a value that matches matcher `m`.| +|:-----------|:-----------------------------------------------------------------------------------------------| +|`WhenDynamicCastTo(m)`| when `argument` is passed through `dynamic_cast()`, it matches matcher `m`. | + +## Multiargument Matchers ## + +Technically, all matchers match a _single_ value. A "multi-argument" +matcher is just one that matches a _tuple_. The following matchers can +be used to match a tuple `(x, y)`: + +|`Eq()`|`x == y`| +|:-----|:-------| +|`Ge()`|`x >= y`| +|`Gt()`|`x > y` | +|`Le()`|`x <= y`| +|`Lt()`|`x < y` | +|`Ne()`|`x != y`| + +You can use the following selectors to pick a subset of the arguments +(or reorder them) to participate in the matching: + +|`AllArgs(m)`|Equivalent to `m`. Useful as syntactic sugar in `.With(AllArgs(m))`.| +|:-----------|:-------------------------------------------------------------------| +|`Args(m)`|The tuple of the `k` selected (using 0-based indices) arguments matches `m`, e.g. `Args<1, 2>(Eq())`.| + +## Composite Matchers ## + +You can make a matcher from one or more other matchers: + +|`AllOf(m1, m2, ..., mn)`|`argument` matches all of the matchers `m1` to `mn`.| +|:-----------------------|:---------------------------------------------------| +|`AnyOf(m1, m2, ..., mn)`|`argument` matches at least one of the matchers `m1` to `mn`.| +|`Not(m)` |`argument` doesn't match matcher `m`. | + +## Adapters for Matchers ## + +|`MatcherCast(m)`|casts matcher `m` to type `Matcher`.| +|:------------------|:--------------------------------------| +|`SafeMatcherCast(m)`| [safely casts](CookBook.md#casting-matchers) matcher `m` to type `Matcher`. | +|`Truly(predicate)` |`predicate(argument)` returns something considered by C++ to be true, where `predicate` is a function or functor.| + +## Matchers as Predicates ## + +|`Matches(m)(value)`|evaluates to `true` if `value` matches `m`. You can use `Matches(m)` alone as a unary functor.| +|:------------------|:---------------------------------------------------------------------------------------------| +|`ExplainMatchResult(m, value, result_listener)`|evaluates to `true` if `value` matches `m`, explaining the result to `result_listener`. | +|`Value(value, m)` |evaluates to `true` if `value` matches `m`. | + +## Defining Matchers ## + +| `MATCHER(IsEven, "") { return (arg % 2) == 0; }` | Defines a matcher `IsEven()` to match an even number. | +|:-------------------------------------------------|:------------------------------------------------------| +| `MATCHER_P(IsDivisibleBy, n, "") { *result_listener << "where the remainder is " << (arg % n); return (arg % n) == 0; }` | Defines a macher `IsDivisibleBy(n)` to match a number divisible by `n`. | +| `MATCHER_P2(IsBetween, a, b, std::string(negation ? "isn't" : "is") + " between " + PrintToString(a) + " and " + PrintToString(b)) { return a <= arg && arg <= b; }` | Defines a matcher `IsBetween(a, b)` to match a value in the range [`a`, `b`]. | + +**Notes:** + + 1. The `MATCHER*` macros cannot be used inside a function or class. + 1. The matcher body must be _purely functional_ (i.e. it cannot have any side effect, and the result must not depend on anything other than the value being matched and the matcher parameters). + 1. You can use `PrintToString(x)` to convert a value `x` of any type to a string. + +## Matchers as Test Assertions ## + +|`ASSERT_THAT(expression, m)`|Generates a [fatal failure](../../googletest/docs/Primer.md#assertions) if the value of `expression` doesn't match matcher `m`.| +|:---------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------| +|`EXPECT_THAT(expression, m)`|Generates a non-fatal failure if the value of `expression` doesn't match matcher `m`. | + +# Actions # + +**Actions** specify what a mock function should do when invoked. + +## Returning a Value ## + +|`Return()`|Return from a `void` mock function.| +|:---------|:----------------------------------| +|`Return(value)`|Return `value`. If the type of `value` is different to the mock function's return type, `value` is converted to the latter type at the time the expectation is set, not when the action is executed.| +|`ReturnArg()`|Return the `N`-th (0-based) argument.| +|`ReturnNew(a1, ..., ak)`|Return `new T(a1, ..., ak)`; a different object is created each time.| +|`ReturnNull()`|Return a null pointer. | +|`ReturnPointee(ptr)`|Return the value pointed to by `ptr`.| +|`ReturnRef(variable)`|Return a reference to `variable`. | +|`ReturnRefOfCopy(value)`|Return a reference to a copy of `value`; the copy lives as long as the action.| + +## Side Effects ## + +|`Assign(&variable, value)`|Assign `value` to variable.| +|:-------------------------|:--------------------------| +| `DeleteArg()` | Delete the `N`-th (0-based) argument, which must be a pointer. | +| `SaveArg(pointer)` | Save the `N`-th (0-based) argument to `*pointer`. | +| `SaveArgPointee(pointer)` | Save the value pointed to by the `N`-th (0-based) argument to `*pointer`. | +| `SetArgReferee(value)` | Assign value to the variable referenced by the `N`-th (0-based) argument. | +|`SetArgPointee(value)` |Assign `value` to the variable pointed by the `N`-th (0-based) argument.| +|`SetArgumentPointee(value)`|Same as `SetArgPointee(value)`. Deprecated. Will be removed in v1.7.0.| +|`SetArrayArgument(first, last)`|Copies the elements in source range [`first`, `last`) to the array pointed to by the `N`-th (0-based) argument, which can be either a pointer or an iterator. The action does not take ownership of the elements in the source range.| +|`SetErrnoAndReturn(error, value)`|Set `errno` to `error` and return `value`.| +|`Throw(exception)` |Throws the given exception, which can be any copyable value. Available since v1.1.0.| + +## Using a Function or a Functor as an Action ## + +|`Invoke(f)`|Invoke `f` with the arguments passed to the mock function, where `f` can be a global/static function or a functor.| +|:----------|:-----------------------------------------------------------------------------------------------------------------| +|`Invoke(object_pointer, &class::method)`|Invoke the {method on the object with the arguments passed to the mock function. | +|`InvokeWithoutArgs(f)`|Invoke `f`, which can be a global/static function or a functor. `f` must take no arguments. | +|`InvokeWithoutArgs(object_pointer, &class::method)`|Invoke the method on the object, which takes no arguments. | +|`InvokeArgument(arg1, arg2, ..., argk)`|Invoke the mock function's `N`-th (0-based) argument, which must be a function or a functor, with the `k` arguments.| + +The return value of the invoked function is used as the return value +of the action. + +When defining a function or functor to be used with `Invoke*()`, you can declare any unused parameters as `Unused`: +``` + double Distance(Unused, double x, double y) { return sqrt(x*x + y*y); } + ... + EXPECT_CALL(mock, Foo("Hi", _, _)).WillOnce(Invoke(Distance)); +``` + +In `InvokeArgument(...)`, if an argument needs to be passed by reference, wrap it inside `ByRef()`. For example, +``` + InvokeArgument<2>(5, string("Hi"), ByRef(foo)) +``` +calls the mock function's #2 argument, passing to it `5` and `string("Hi")` by value, and `foo` by reference. + +## Default Action ## + +|`DoDefault()`|Do the default action (specified by `ON_CALL()` or the built-in one).| +|:------------|:--------------------------------------------------------------------| + +**Note:** due to technical reasons, `DoDefault()` cannot be used inside a composite action - trying to do so will result in a run-time error. + +## Composite Actions ## + +|`DoAll(a1, a2, ..., an)`|Do all actions `a1` to `an` and return the result of `an` in each invocation. The first `n - 1` sub-actions must return void. | +|:-----------------------|:-----------------------------------------------------------------------------------------------------------------------------| +|`IgnoreResult(a)` |Perform action `a` and ignore its result. `a` must not return void. | +|`WithArg(a)` |Pass the `N`-th (0-based) argument of the mock function to action `a` and perform it. | +|`WithArgs(a)`|Pass the selected (0-based) arguments of the mock function to action `a` and perform it. | +|`WithoutArgs(a)` |Perform action `a` without any arguments. | + +## Defining Actions ## + +| `ACTION(Sum) { return arg0 + arg1; }` | Defines an action `Sum()` to return the sum of the mock function's argument #0 and #1. | +|:--------------------------------------|:---------------------------------------------------------------------------------------| +| `ACTION_P(Plus, n) { return arg0 + n; }` | Defines an action `Plus(n)` to return the sum of the mock function's argument #0 and `n`. | +| `ACTION_Pk(Foo, p1, ..., pk) { statements; }` | Defines a parameterized action `Foo(p1, ..., pk)` to execute the given `statements`. | + +The `ACTION*` macros cannot be used inside a function or class. + +# Cardinalities # + +These are used in `Times()` to specify how many times a mock function will be called: + +|`AnyNumber()`|The function can be called any number of times.| +|:------------|:----------------------------------------------| +|`AtLeast(n)` |The call is expected at least `n` times. | +|`AtMost(n)` |The call is expected at most `n` times. | +|`Between(m, n)`|The call is expected between `m` and `n` (inclusive) times.| +|`Exactly(n) or n`|The call is expected exactly `n` times. In particular, the call should never happen when `n` is 0.| + +# Expectation Order # + +By default, the expectations can be matched in _any_ order. If some +or all expectations must be matched in a given order, there are two +ways to specify it. They can be used either independently or +together. + +## The After Clause ## + +``` +using ::testing::Expectation; +... +Expectation init_x = EXPECT_CALL(foo, InitX()); +Expectation init_y = EXPECT_CALL(foo, InitY()); +EXPECT_CALL(foo, Bar()) + .After(init_x, init_y); +``` +says that `Bar()` can be called only after both `InitX()` and +`InitY()` have been called. + +If you don't know how many pre-requisites an expectation has when you +write it, you can use an `ExpectationSet` to collect them: + +``` +using ::testing::ExpectationSet; +... +ExpectationSet all_inits; +for (int i = 0; i < element_count; i++) { + all_inits += EXPECT_CALL(foo, InitElement(i)); +} +EXPECT_CALL(foo, Bar()) + .After(all_inits); +``` +says that `Bar()` can be called only after all elements have been +initialized (but we don't care about which elements get initialized +before the others). + +Modifying an `ExpectationSet` after using it in an `.After()` doesn't +affect the meaning of the `.After()`. + +## Sequences ## + +When you have a long chain of sequential expectations, it's easier to +specify the order using **sequences**, which don't require you to given +each expectation in the chain a different name. All expected
+calls
in the same sequence must occur in the order they are +specified. + +``` +using ::testing::Sequence; +Sequence s1, s2; +... +EXPECT_CALL(foo, Reset()) + .InSequence(s1, s2) + .WillOnce(Return(true)); +EXPECT_CALL(foo, GetSize()) + .InSequence(s1) + .WillOnce(Return(1)); +EXPECT_CALL(foo, Describe(A())) + .InSequence(s2) + .WillOnce(Return("dummy")); +``` +says that `Reset()` must be called before _both_ `GetSize()` _and_ +`Describe()`, and the latter two can occur in any order. + +To put many expectations in a sequence conveniently: +``` +using ::testing::InSequence; +{ + InSequence dummy; + + EXPECT_CALL(...)...; + EXPECT_CALL(...)...; + ... + EXPECT_CALL(...)...; +} +``` +says that all expected calls in the scope of `dummy` must occur in +strict order. The name `dummy` is irrelevant.) + +# Verifying and Resetting a Mock # + +Google Mock will verify the expectations on a mock object when it is destructed, or you can do it earlier: +``` +using ::testing::Mock; +... +// Verifies and removes the expectations on mock_obj; +// returns true iff successful. +Mock::VerifyAndClearExpectations(&mock_obj); +... +// Verifies and removes the expectations on mock_obj; +// also removes the default actions set by ON_CALL(); +// returns true iff successful. +Mock::VerifyAndClear(&mock_obj); +``` + +You can also tell Google Mock that a mock object can be leaked and doesn't +need to be verified: +``` +Mock::AllowLeak(&mock_obj); +``` + +# Mock Classes # + +Google Mock defines a convenient mock class template +``` +class MockFunction { + public: + MOCK_METHODn(Call, R(A1, ..., An)); +}; +``` +See this [recipe](CookBook.md#using-check-points) for one application of it. + +# Flags # + +| `--gmock_catch_leaked_mocks=0` | Don't report leaked mock objects as failures. | +|:-------------------------------|:----------------------------------------------| +| `--gmock_verbose=LEVEL` | Sets the default verbosity level (`info`, `warning`, or `error`) of Google Mock messages. | diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/docs/CookBook.md vulkan-1.1.73+dfsg/submodules/googletest/googlemock/docs/CookBook.md --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/docs/CookBook.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/docs/CookBook.md 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,3679 @@ + + +You can find recipes for using Google Mock here. If you haven't yet, +please read the [ForDummies](ForDummies.md) document first to make sure you understand +the basics. + +**Note:** Google Mock lives in the `testing` name space. For +readability, it is recommended to write `using ::testing::Foo;` once in +your file before using the name `Foo` defined by Google Mock. We omit +such `using` statements in this page for brevity, but you should do it +in your own code. + +# Creating Mock Classes # + +## Mocking Private or Protected Methods ## + +You must always put a mock method definition (`MOCK_METHOD*`) in a +`public:` section of the mock class, regardless of the method being +mocked being `public`, `protected`, or `private` in the base class. +This allows `ON_CALL` and `EXPECT_CALL` to reference the mock function +from outside of the mock class. (Yes, C++ allows a subclass to specify +a different access level than the base class on a virtual function.) +Example: + +``` +class Foo { + public: + ... + virtual bool Transform(Gadget* g) = 0; + + protected: + virtual void Resume(); + + private: + virtual int GetTimeOut(); +}; + +class MockFoo : public Foo { + public: + ... + MOCK_METHOD1(Transform, bool(Gadget* g)); + + // The following must be in the public section, even though the + // methods are protected or private in the base class. + MOCK_METHOD0(Resume, void()); + MOCK_METHOD0(GetTimeOut, int()); +}; +``` + +## Mocking Overloaded Methods ## + +You can mock overloaded functions as usual. No special attention is required: + +``` +class Foo { + ... + + // Must be virtual as we'll inherit from Foo. + virtual ~Foo(); + + // Overloaded on the types and/or numbers of arguments. + virtual int Add(Element x); + virtual int Add(int times, Element x); + + // Overloaded on the const-ness of this object. + virtual Bar& GetBar(); + virtual const Bar& GetBar() const; +}; + +class MockFoo : public Foo { + ... + MOCK_METHOD1(Add, int(Element x)); + MOCK_METHOD2(Add, int(int times, Element x); + + MOCK_METHOD0(GetBar, Bar&()); + MOCK_CONST_METHOD0(GetBar, const Bar&()); +}; +``` + +**Note:** if you don't mock all versions of the overloaded method, the +compiler will give you a warning about some methods in the base class +being hidden. To fix that, use `using` to bring them in scope: + +``` +class MockFoo : public Foo { + ... + using Foo::Add; + MOCK_METHOD1(Add, int(Element x)); + // We don't want to mock int Add(int times, Element x); + ... +}; +``` + +## Mocking Class Templates ## + +To mock a class template, append `_T` to the `MOCK_*` macros: + +``` +template +class StackInterface { + ... + // Must be virtual as we'll inherit from StackInterface. + virtual ~StackInterface(); + + virtual int GetSize() const = 0; + virtual void Push(const Elem& x) = 0; +}; + +template +class MockStack : public StackInterface { + ... + MOCK_CONST_METHOD0_T(GetSize, int()); + MOCK_METHOD1_T(Push, void(const Elem& x)); +}; +``` + +## Mocking Nonvirtual Methods ## + +Google Mock can mock non-virtual functions to be used in what we call _hi-perf +dependency injection_. + +In this case, instead of sharing a common base class with the real +class, your mock class will be _unrelated_ to the real class, but +contain methods with the same signatures. The syntax for mocking +non-virtual methods is the _same_ as mocking virtual methods: + +``` +// A simple packet stream class. None of its members is virtual. +class ConcretePacketStream { + public: + void AppendPacket(Packet* new_packet); + const Packet* GetPacket(size_t packet_number) const; + size_t NumberOfPackets() const; + ... +}; + +// A mock packet stream class. It inherits from no other, but defines +// GetPacket() and NumberOfPackets(). +class MockPacketStream { + public: + MOCK_CONST_METHOD1(GetPacket, const Packet*(size_t packet_number)); + MOCK_CONST_METHOD0(NumberOfPackets, size_t()); + ... +}; +``` + +Note that the mock class doesn't define `AppendPacket()`, unlike the +real class. That's fine as long as the test doesn't need to call it. + +Next, you need a way to say that you want to use +`ConcretePacketStream` in production code and to use `MockPacketStream` +in tests. Since the functions are not virtual and the two classes are +unrelated, you must specify your choice at _compile time_ (as opposed +to run time). + +One way to do it is to templatize your code that needs to use a packet +stream. More specifically, you will give your code a template type +argument for the type of the packet stream. In production, you will +instantiate your template with `ConcretePacketStream` as the type +argument. In tests, you will instantiate the same template with +`MockPacketStream`. For example, you may write: + +``` +template +void CreateConnection(PacketStream* stream) { ... } + +template +class PacketReader { + public: + void ReadPackets(PacketStream* stream, size_t packet_num); +}; +``` + +Then you can use `CreateConnection()` and +`PacketReader` in production code, and use +`CreateConnection()` and +`PacketReader` in tests. + +``` + MockPacketStream mock_stream; + EXPECT_CALL(mock_stream, ...)...; + .. set more expectations on mock_stream ... + PacketReader reader(&mock_stream); + ... exercise reader ... +``` + +## Mocking Free Functions ## + +It's possible to use Google Mock to mock a free function (i.e. a +C-style function or a static method). You just need to rewrite your +code to use an interface (abstract class). + +Instead of calling a free function (say, `OpenFile`) directly, +introduce an interface for it and have a concrete subclass that calls +the free function: + +``` +class FileInterface { + public: + ... + virtual bool Open(const char* path, const char* mode) = 0; +}; + +class File : public FileInterface { + public: + ... + virtual bool Open(const char* path, const char* mode) { + return OpenFile(path, mode); + } +}; +``` + +Your code should talk to `FileInterface` to open a file. Now it's +easy to mock out the function. + +This may seem much hassle, but in practice you often have multiple +related functions that you can put in the same interface, so the +per-function syntactic overhead will be much lower. + +If you are concerned about the performance overhead incurred by +virtual functions, and profiling confirms your concern, you can +combine this with the recipe for [mocking non-virtual methods](#mocking-nonvirtual-methods). + +## The Nice, the Strict, and the Naggy ## + +If a mock method has no `EXPECT_CALL` spec but is called, Google Mock +will print a warning about the "uninteresting call". The rationale is: + + * New methods may be added to an interface after a test is written. We shouldn't fail a test just because a method it doesn't know about is called. + * However, this may also mean there's a bug in the test, so Google Mock shouldn't be silent either. If the user believes these calls are harmless, they can add an `EXPECT_CALL()` to suppress the warning. + +However, sometimes you may want to suppress all "uninteresting call" +warnings, while sometimes you may want the opposite, i.e. to treat all +of them as errors. Google Mock lets you make the decision on a +per-mock-object basis. + +Suppose your test uses a mock class `MockFoo`: + +``` +TEST(...) { + MockFoo mock_foo; + EXPECT_CALL(mock_foo, DoThis()); + ... code that uses mock_foo ... +} +``` + +If a method of `mock_foo` other than `DoThis()` is called, it will be +reported by Google Mock as a warning. However, if you rewrite your +test to use `NiceMock` instead, the warning will be gone, +resulting in a cleaner test output: + +``` +using ::testing::NiceMock; + +TEST(...) { + NiceMock mock_foo; + EXPECT_CALL(mock_foo, DoThis()); + ... code that uses mock_foo ... +} +``` + +`NiceMock` is a subclass of `MockFoo`, so it can be used +wherever `MockFoo` is accepted. + +It also works if `MockFoo`'s constructor takes some arguments, as +`NiceMock` "inherits" `MockFoo`'s constructors: + +``` +using ::testing::NiceMock; + +TEST(...) { + NiceMock mock_foo(5, "hi"); // Calls MockFoo(5, "hi"). + EXPECT_CALL(mock_foo, DoThis()); + ... code that uses mock_foo ... +} +``` + +The usage of `StrictMock` is similar, except that it makes all +uninteresting calls failures: + +``` +using ::testing::StrictMock; + +TEST(...) { + StrictMock mock_foo; + EXPECT_CALL(mock_foo, DoThis()); + ... code that uses mock_foo ... + + // The test will fail if a method of mock_foo other than DoThis() + // is called. +} +``` + +There are some caveats though (I don't like them just as much as the +next guy, but sadly they are side effects of C++'s limitations): + + 1. `NiceMock` and `StrictMock` only work for mock methods defined using the `MOCK_METHOD*` family of macros **directly** in the `MockFoo` class. If a mock method is defined in a **base class** of `MockFoo`, the "nice" or "strict" modifier may not affect it, depending on the compiler. In particular, nesting `NiceMock` and `StrictMock` (e.g. `NiceMock >`) is **not** supported. + 1. The constructors of the base mock (`MockFoo`) cannot have arguments passed by non-const reference, which happens to be banned by the [Google C++ style guide](https://google.github.io/styleguide/cppguide.html). + 1. During the constructor or destructor of `MockFoo`, the mock object is _not_ nice or strict. This may cause surprises if the constructor or destructor calls a mock method on `this` object. (This behavior, however, is consistent with C++'s general rule: if a constructor or destructor calls a virtual method of `this` object, that method is treated as non-virtual. In other words, to the base class's constructor or destructor, `this` object behaves like an instance of the base class, not the derived class. This rule is required for safety. Otherwise a base constructor may use members of a derived class before they are initialized, or a base destructor may use members of a derived class after they have been destroyed.) + +Finally, you should be **very cautious** about when to use naggy or strict mocks, as they tend to make tests more brittle and harder to maintain. When you refactor your code without changing its externally visible behavior, ideally you should't need to update any tests. If your code interacts with a naggy mock, however, you may start to get spammed with warnings as the result of your change. Worse, if your code interacts with a strict mock, your tests may start to fail and you'll be forced to fix them. Our general recommendation is to use nice mocks (not yet the default) most of the time, use naggy mocks (the current default) when developing or debugging tests, and use strict mocks only as the last resort. + +## Simplifying the Interface without Breaking Existing Code ## + +Sometimes a method has a long list of arguments that is mostly +uninteresting. For example, + +``` +class LogSink { + public: + ... + virtual void send(LogSeverity severity, const char* full_filename, + const char* base_filename, int line, + const struct tm* tm_time, + const char* message, size_t message_len) = 0; +}; +``` + +This method's argument list is lengthy and hard to work with (let's +say that the `message` argument is not even 0-terminated). If we mock +it as is, using the mock will be awkward. If, however, we try to +simplify this interface, we'll need to fix all clients depending on +it, which is often infeasible. + +The trick is to re-dispatch the method in the mock class: + +``` +class ScopedMockLog : public LogSink { + public: + ... + virtual void send(LogSeverity severity, const char* full_filename, + const char* base_filename, int line, const tm* tm_time, + const char* message, size_t message_len) { + // We are only interested in the log severity, full file name, and + // log message. + Log(severity, full_filename, std::string(message, message_len)); + } + + // Implements the mock method: + // + // void Log(LogSeverity severity, + // const string& file_path, + // const string& message); + MOCK_METHOD3(Log, void(LogSeverity severity, const string& file_path, + const string& message)); +}; +``` + +By defining a new mock method with a trimmed argument list, we make +the mock class much more user-friendly. + +## Alternative to Mocking Concrete Classes ## + +Often you may find yourself using classes that don't implement +interfaces. In order to test your code that uses such a class (let's +call it `Concrete`), you may be tempted to make the methods of +`Concrete` virtual and then mock it. + +Try not to do that. + +Making a non-virtual function virtual is a big decision. It creates an +extension point where subclasses can tweak your class' behavior. This +weakens your control on the class because now it's harder to maintain +the class' invariants. You should make a function virtual only when +there is a valid reason for a subclass to override it. + +Mocking concrete classes directly is problematic as it creates a tight +coupling between the class and the tests - any small change in the +class may invalidate your tests and make test maintenance a pain. + +To avoid such problems, many programmers have been practicing "coding +to interfaces": instead of talking to the `Concrete` class, your code +would define an interface and talk to it. Then you implement that +interface as an adaptor on top of `Concrete`. In tests, you can easily +mock that interface to observe how your code is doing. + +This technique incurs some overhead: + + * You pay the cost of virtual function calls (usually not a problem). + * There is more abstraction for the programmers to learn. + +However, it can also bring significant benefits in addition to better +testability: + + * `Concrete`'s API may not fit your problem domain very well, as you may not be the only client it tries to serve. By designing your own interface, you have a chance to tailor it to your need - you may add higher-level functionalities, rename stuff, etc instead of just trimming the class. This allows you to write your code (user of the interface) in a more natural way, which means it will be more readable, more maintainable, and you'll be more productive. + * If `Concrete`'s implementation ever has to change, you don't have to rewrite everywhere it is used. Instead, you can absorb the change in your implementation of the interface, and your other code and tests will be insulated from this change. + +Some people worry that if everyone is practicing this technique, they +will end up writing lots of redundant code. This concern is totally +understandable. However, there are two reasons why it may not be the +case: + + * Different projects may need to use `Concrete` in different ways, so the best interfaces for them will be different. Therefore, each of them will have its own domain-specific interface on top of `Concrete`, and they will not be the same code. + * If enough projects want to use the same interface, they can always share it, just like they have been sharing `Concrete`. You can check in the interface and the adaptor somewhere near `Concrete` (perhaps in a `contrib` sub-directory) and let many projects use it. + +You need to weigh the pros and cons carefully for your particular +problem, but I'd like to assure you that the Java community has been +practicing this for a long time and it's a proven effective technique +applicable in a wide variety of situations. :-) + +## Delegating Calls to a Fake ## + +Some times you have a non-trivial fake implementation of an +interface. For example: + +``` +class Foo { + public: + virtual ~Foo() {} + virtual char DoThis(int n) = 0; + virtual void DoThat(const char* s, int* p) = 0; +}; + +class FakeFoo : public Foo { + public: + virtual char DoThis(int n) { + return (n > 0) ? '+' : + (n < 0) ? '-' : '0'; + } + + virtual void DoThat(const char* s, int* p) { + *p = strlen(s); + } +}; +``` + +Now you want to mock this interface such that you can set expectations +on it. However, you also want to use `FakeFoo` for the default +behavior, as duplicating it in the mock object is, well, a lot of +work. + +When you define the mock class using Google Mock, you can have it +delegate its default action to a fake class you already have, using +this pattern: + +``` +using ::testing::_; +using ::testing::Invoke; + +class MockFoo : public Foo { + public: + // Normal mock method definitions using Google Mock. + MOCK_METHOD1(DoThis, char(int n)); + MOCK_METHOD2(DoThat, void(const char* s, int* p)); + + // Delegates the default actions of the methods to a FakeFoo object. + // This must be called *before* the custom ON_CALL() statements. + void DelegateToFake() { + ON_CALL(*this, DoThis(_)) + .WillByDefault(Invoke(&fake_, &FakeFoo::DoThis)); + ON_CALL(*this, DoThat(_, _)) + .WillByDefault(Invoke(&fake_, &FakeFoo::DoThat)); + } + private: + FakeFoo fake_; // Keeps an instance of the fake in the mock. +}; +``` + +With that, you can use `MockFoo` in your tests as usual. Just remember +that if you don't explicitly set an action in an `ON_CALL()` or +`EXPECT_CALL()`, the fake will be called upon to do it: + +``` +using ::testing::_; + +TEST(AbcTest, Xyz) { + MockFoo foo; + foo.DelegateToFake(); // Enables the fake for delegation. + + // Put your ON_CALL(foo, ...)s here, if any. + + // No action specified, meaning to use the default action. + EXPECT_CALL(foo, DoThis(5)); + EXPECT_CALL(foo, DoThat(_, _)); + + int n = 0; + EXPECT_EQ('+', foo.DoThis(5)); // FakeFoo::DoThis() is invoked. + foo.DoThat("Hi", &n); // FakeFoo::DoThat() is invoked. + EXPECT_EQ(2, n); +} +``` + +**Some tips:** + + * If you want, you can still override the default action by providing your own `ON_CALL()` or using `.WillOnce()` / `.WillRepeatedly()` in `EXPECT_CALL()`. + * In `DelegateToFake()`, you only need to delegate the methods whose fake implementation you intend to use. + * The general technique discussed here works for overloaded methods, but you'll need to tell the compiler which version you mean. To disambiguate a mock function (the one you specify inside the parentheses of `ON_CALL()`), see the "Selecting Between Overloaded Functions" section on this page; to disambiguate a fake function (the one you place inside `Invoke()`), use a `static_cast` to specify the function's type. For instance, if class `Foo` has methods `char DoThis(int n)` and `bool DoThis(double x) const`, and you want to invoke the latter, you need to write `Invoke(&fake_, static_cast(&FakeFoo::DoThis))` instead of `Invoke(&fake_, &FakeFoo::DoThis)` (The strange-looking thing inside the angled brackets of `static_cast` is the type of a function pointer to the second `DoThis()` method.). + * Having to mix a mock and a fake is often a sign of something gone wrong. Perhaps you haven't got used to the interaction-based way of testing yet. Or perhaps your interface is taking on too many roles and should be split up. Therefore, **don't abuse this**. We would only recommend to do it as an intermediate step when you are refactoring your code. + +Regarding the tip on mixing a mock and a fake, here's an example on +why it may be a bad sign: Suppose you have a class `System` for +low-level system operations. In particular, it does file and I/O +operations. And suppose you want to test how your code uses `System` +to do I/O, and you just want the file operations to work normally. If +you mock out the entire `System` class, you'll have to provide a fake +implementation for the file operation part, which suggests that +`System` is taking on too many roles. + +Instead, you can define a `FileOps` interface and an `IOOps` interface +and split `System`'s functionalities into the two. Then you can mock +`IOOps` without mocking `FileOps`. + +## Delegating Calls to a Real Object ## + +When using testing doubles (mocks, fakes, stubs, and etc), sometimes +their behaviors will differ from those of the real objects. This +difference could be either intentional (as in simulating an error such +that you can test the error handling code) or unintentional. If your +mocks have different behaviors than the real objects by mistake, you +could end up with code that passes the tests but fails in production. + +You can use the _delegating-to-real_ technique to ensure that your +mock has the same behavior as the real object while retaining the +ability to validate calls. This technique is very similar to the +delegating-to-fake technique, the difference being that we use a real +object instead of a fake. Here's an example: + +``` +using ::testing::_; +using ::testing::AtLeast; +using ::testing::Invoke; + +class MockFoo : public Foo { + public: + MockFoo() { + // By default, all calls are delegated to the real object. + ON_CALL(*this, DoThis()) + .WillByDefault(Invoke(&real_, &Foo::DoThis)); + ON_CALL(*this, DoThat(_)) + .WillByDefault(Invoke(&real_, &Foo::DoThat)); + ... + } + MOCK_METHOD0(DoThis, ...); + MOCK_METHOD1(DoThat, ...); + ... + private: + Foo real_; +}; +... + + MockFoo mock; + + EXPECT_CALL(mock, DoThis()) + .Times(3); + EXPECT_CALL(mock, DoThat("Hi")) + .Times(AtLeast(1)); + ... use mock in test ... +``` + +With this, Google Mock will verify that your code made the right calls +(with the right arguments, in the right order, called the right number +of times, etc), and a real object will answer the calls (so the +behavior will be the same as in production). This gives you the best +of both worlds. + +## Delegating Calls to a Parent Class ## + +Ideally, you should code to interfaces, whose methods are all pure +virtual. In reality, sometimes you do need to mock a virtual method +that is not pure (i.e, it already has an implementation). For example: + +``` +class Foo { + public: + virtual ~Foo(); + + virtual void Pure(int n) = 0; + virtual int Concrete(const char* str) { ... } +}; + +class MockFoo : public Foo { + public: + // Mocking a pure method. + MOCK_METHOD1(Pure, void(int n)); + // Mocking a concrete method. Foo::Concrete() is shadowed. + MOCK_METHOD1(Concrete, int(const char* str)); +}; +``` + +Sometimes you may want to call `Foo::Concrete()` instead of +`MockFoo::Concrete()`. Perhaps you want to do it as part of a stub +action, or perhaps your test doesn't need to mock `Concrete()` at all +(but it would be oh-so painful to have to define a new mock class +whenever you don't need to mock one of its methods). + +The trick is to leave a back door in your mock class for accessing the +real methods in the base class: + +``` +class MockFoo : public Foo { + public: + // Mocking a pure method. + MOCK_METHOD1(Pure, void(int n)); + // Mocking a concrete method. Foo::Concrete() is shadowed. + MOCK_METHOD1(Concrete, int(const char* str)); + + // Use this to call Concrete() defined in Foo. + int FooConcrete(const char* str) { return Foo::Concrete(str); } +}; +``` + +Now, you can call `Foo::Concrete()` inside an action by: + +``` +using ::testing::_; +using ::testing::Invoke; +... + EXPECT_CALL(foo, Concrete(_)) + .WillOnce(Invoke(&foo, &MockFoo::FooConcrete)); +``` + +or tell the mock object that you don't want to mock `Concrete()`: + +``` +using ::testing::Invoke; +... + ON_CALL(foo, Concrete(_)) + .WillByDefault(Invoke(&foo, &MockFoo::FooConcrete)); +``` + +(Why don't we just write `Invoke(&foo, &Foo::Concrete)`? If you do +that, `MockFoo::Concrete()` will be called (and cause an infinite +recursion) since `Foo::Concrete()` is virtual. That's just how C++ +works.) + +# Using Matchers # + +## Matching Argument Values Exactly ## + +You can specify exactly which arguments a mock method is expecting: + +``` +using ::testing::Return; +... + EXPECT_CALL(foo, DoThis(5)) + .WillOnce(Return('a')); + EXPECT_CALL(foo, DoThat("Hello", bar)); +``` + +## Using Simple Matchers ## + +You can use matchers to match arguments that have a certain property: + +``` +using ::testing::Ge; +using ::testing::NotNull; +using ::testing::Return; +... + EXPECT_CALL(foo, DoThis(Ge(5))) // The argument must be >= 5. + .WillOnce(Return('a')); + EXPECT_CALL(foo, DoThat("Hello", NotNull())); + // The second argument must not be NULL. +``` + +A frequently used matcher is `_`, which matches anything: + +``` +using ::testing::_; +using ::testing::NotNull; +... + EXPECT_CALL(foo, DoThat(_, NotNull())); +``` + +## Combining Matchers ## + +You can build complex matchers from existing ones using `AllOf()`, +`AnyOf()`, and `Not()`: + +``` +using ::testing::AllOf; +using ::testing::Gt; +using ::testing::HasSubstr; +using ::testing::Ne; +using ::testing::Not; +... + // The argument must be > 5 and != 10. + EXPECT_CALL(foo, DoThis(AllOf(Gt(5), + Ne(10)))); + + // The first argument must not contain sub-string "blah". + EXPECT_CALL(foo, DoThat(Not(HasSubstr("blah")), + NULL)); +``` + +## Casting Matchers ## + +Google Mock matchers are statically typed, meaning that the compiler +can catch your mistake if you use a matcher of the wrong type (for +example, if you use `Eq(5)` to match a `string` argument). Good for +you! + +Sometimes, however, you know what you're doing and want the compiler +to give you some slack. One example is that you have a matcher for +`long` and the argument you want to match is `int`. While the two +types aren't exactly the same, there is nothing really wrong with +using a `Matcher` to match an `int` - after all, we can first +convert the `int` argument to a `long` before giving it to the +matcher. + +To support this need, Google Mock gives you the +`SafeMatcherCast(m)` function. It casts a matcher `m` to type +`Matcher`. To ensure safety, Google Mock checks that (let `U` be the +type `m` accepts): + + 1. Type `T` can be implicitly cast to type `U`; + 1. When both `T` and `U` are built-in arithmetic types (`bool`, integers, and floating-point numbers), the conversion from `T` to `U` is not lossy (in other words, any value representable by `T` can also be represented by `U`); and + 1. When `U` is a reference, `T` must also be a reference (as the underlying matcher may be interested in the address of the `U` value). + +The code won't compile if any of these conditions aren't met. + +Here's one example: + +``` +using ::testing::SafeMatcherCast; + +// A base class and a child class. +class Base { ... }; +class Derived : public Base { ... }; + +class MockFoo : public Foo { + public: + MOCK_METHOD1(DoThis, void(Derived* derived)); +}; +... + + MockFoo foo; + // m is a Matcher we got from somewhere. + EXPECT_CALL(foo, DoThis(SafeMatcherCast(m))); +``` + +If you find `SafeMatcherCast(m)` too limiting, you can use a similar +function `MatcherCast(m)`. The difference is that `MatcherCast` works +as long as you can `static_cast` type `T` to type `U`. + +`MatcherCast` essentially lets you bypass C++'s type system +(`static_cast` isn't always safe as it could throw away information, +for example), so be careful not to misuse/abuse it. + +## Selecting Between Overloaded Functions ## + +If you expect an overloaded function to be called, the compiler may +need some help on which overloaded version it is. + +To disambiguate functions overloaded on the const-ness of this object, +use the `Const()` argument wrapper. + +``` +using ::testing::ReturnRef; + +class MockFoo : public Foo { + ... + MOCK_METHOD0(GetBar, Bar&()); + MOCK_CONST_METHOD0(GetBar, const Bar&()); +}; +... + + MockFoo foo; + Bar bar1, bar2; + EXPECT_CALL(foo, GetBar()) // The non-const GetBar(). + .WillOnce(ReturnRef(bar1)); + EXPECT_CALL(Const(foo), GetBar()) // The const GetBar(). + .WillOnce(ReturnRef(bar2)); +``` + +(`Const()` is defined by Google Mock and returns a `const` reference +to its argument.) + +To disambiguate overloaded functions with the same number of arguments +but different argument types, you may need to specify the exact type +of a matcher, either by wrapping your matcher in `Matcher()`, or +using a matcher whose type is fixed (`TypedEq`, `An()`, +etc): + +``` +using ::testing::An; +using ::testing::Lt; +using ::testing::Matcher; +using ::testing::TypedEq; + +class MockPrinter : public Printer { + public: + MOCK_METHOD1(Print, void(int n)); + MOCK_METHOD1(Print, void(char c)); +}; + +TEST(PrinterTest, Print) { + MockPrinter printer; + + EXPECT_CALL(printer, Print(An())); // void Print(int); + EXPECT_CALL(printer, Print(Matcher(Lt(5)))); // void Print(int); + EXPECT_CALL(printer, Print(TypedEq('a'))); // void Print(char); + + printer.Print(3); + printer.Print(6); + printer.Print('a'); +} +``` + +## Performing Different Actions Based on the Arguments ## + +When a mock method is called, the _last_ matching expectation that's +still active will be selected (think "newer overrides older"). So, you +can make a method do different things depending on its argument values +like this: + +``` +using ::testing::_; +using ::testing::Lt; +using ::testing::Return; +... + // The default case. + EXPECT_CALL(foo, DoThis(_)) + .WillRepeatedly(Return('b')); + + // The more specific case. + EXPECT_CALL(foo, DoThis(Lt(5))) + .WillRepeatedly(Return('a')); +``` + +Now, if `foo.DoThis()` is called with a value less than 5, `'a'` will +be returned; otherwise `'b'` will be returned. + +## Matching Multiple Arguments as a Whole ## + +Sometimes it's not enough to match the arguments individually. For +example, we may want to say that the first argument must be less than +the second argument. The `With()` clause allows us to match +all arguments of a mock function as a whole. For example, + +``` +using ::testing::_; +using ::testing::Lt; +using ::testing::Ne; +... + EXPECT_CALL(foo, InRange(Ne(0), _)) + .With(Lt()); +``` + +says that the first argument of `InRange()` must not be 0, and must be +less than the second argument. + +The expression inside `With()` must be a matcher of type +`Matcher< ::testing::tuple >`, where `A1`, ..., `An` are the +types of the function arguments. + +You can also write `AllArgs(m)` instead of `m` inside `.With()`. The +two forms are equivalent, but `.With(AllArgs(Lt()))` is more readable +than `.With(Lt())`. + +You can use `Args(m)` to match the `n` selected arguments +(as a tuple) against `m`. For example, + +``` +using ::testing::_; +using ::testing::AllOf; +using ::testing::Args; +using ::testing::Lt; +... + EXPECT_CALL(foo, Blah(_, _, _)) + .With(AllOf(Args<0, 1>(Lt()), Args<1, 2>(Lt()))); +``` + +says that `Blah()` will be called with arguments `x`, `y`, and `z` where +`x < y < z`. + +As a convenience and example, Google Mock provides some matchers for +2-tuples, including the `Lt()` matcher above. See the [CheatSheet](CheatSheet.md) for +the complete list. + +Note that if you want to pass the arguments to a predicate of your own +(e.g. `.With(Args<0, 1>(Truly(&MyPredicate)))`), that predicate MUST be +written to take a `::testing::tuple` as its argument; Google Mock will pass the `n` selected arguments as _one_ single tuple to the predicate. + +## Using Matchers as Predicates ## + +Have you noticed that a matcher is just a fancy predicate that also +knows how to describe itself? Many existing algorithms take predicates +as arguments (e.g. those defined in STL's `` header), and +it would be a shame if Google Mock matchers are not allowed to +participate. + +Luckily, you can use a matcher where a unary predicate functor is +expected by wrapping it inside the `Matches()` function. For example, + +``` +#include +#include + +std::vector v; +... +// How many elements in v are >= 10? +const int count = count_if(v.begin(), v.end(), Matches(Ge(10))); +``` + +Since you can build complex matchers from simpler ones easily using +Google Mock, this gives you a way to conveniently construct composite +predicates (doing the same using STL's `` header is just +painful). For example, here's a predicate that's satisfied by any +number that is >= 0, <= 100, and != 50: + +``` +Matches(AllOf(Ge(0), Le(100), Ne(50))) +``` + +## Using Matchers in Google Test Assertions ## + +Since matchers are basically predicates that also know how to describe +themselves, there is a way to take advantage of them in +[Google Test](../../googletest/) assertions. It's +called `ASSERT_THAT` and `EXPECT_THAT`: + +``` + ASSERT_THAT(value, matcher); // Asserts that value matches matcher. + EXPECT_THAT(value, matcher); // The non-fatal version. +``` + +For example, in a Google Test test you can write: + +``` +#include "gmock/gmock.h" + +using ::testing::AllOf; +using ::testing::Ge; +using ::testing::Le; +using ::testing::MatchesRegex; +using ::testing::StartsWith; +... + + EXPECT_THAT(Foo(), StartsWith("Hello")); + EXPECT_THAT(Bar(), MatchesRegex("Line \\d+")); + ASSERT_THAT(Baz(), AllOf(Ge(5), Le(10))); +``` + +which (as you can probably guess) executes `Foo()`, `Bar()`, and +`Baz()`, and verifies that: + + * `Foo()` returns a string that starts with `"Hello"`. + * `Bar()` returns a string that matches regular expression `"Line \\d+"`. + * `Baz()` returns a number in the range [5, 10]. + +The nice thing about these macros is that _they read like +English_. They generate informative messages too. For example, if the +first `EXPECT_THAT()` above fails, the message will be something like: + +``` +Value of: Foo() + Actual: "Hi, world!" +Expected: starts with "Hello" +``` + +**Credit:** The idea of `(ASSERT|EXPECT)_THAT` was stolen from the +[Hamcrest](https://github.com/hamcrest/) project, which adds +`assertThat()` to JUnit. + +## Using Predicates as Matchers ## + +Google Mock provides a built-in set of matchers. In case you find them +lacking, you can use an arbitray unary predicate function or functor +as a matcher - as long as the predicate accepts a value of the type +you want. You do this by wrapping the predicate inside the `Truly()` +function, for example: + +``` +using ::testing::Truly; + +int IsEven(int n) { return (n % 2) == 0 ? 1 : 0; } +... + + // Bar() must be called with an even number. + EXPECT_CALL(foo, Bar(Truly(IsEven))); +``` + +Note that the predicate function / functor doesn't have to return +`bool`. It works as long as the return value can be used as the +condition in statement `if (condition) ...`. + +## Matching Arguments that Are Not Copyable ## + +When you do an `EXPECT_CALL(mock_obj, Foo(bar))`, Google Mock saves +away a copy of `bar`. When `Foo()` is called later, Google Mock +compares the argument to `Foo()` with the saved copy of `bar`. This +way, you don't need to worry about `bar` being modified or destroyed +after the `EXPECT_CALL()` is executed. The same is true when you use +matchers like `Eq(bar)`, `Le(bar)`, and so on. + +But what if `bar` cannot be copied (i.e. has no copy constructor)? You +could define your own matcher function and use it with `Truly()`, as +the previous couple of recipes have shown. Or, you may be able to get +away from it if you can guarantee that `bar` won't be changed after +the `EXPECT_CALL()` is executed. Just tell Google Mock that it should +save a reference to `bar`, instead of a copy of it. Here's how: + +``` +using ::testing::Eq; +using ::testing::ByRef; +using ::testing::Lt; +... + // Expects that Foo()'s argument == bar. + EXPECT_CALL(mock_obj, Foo(Eq(ByRef(bar)))); + + // Expects that Foo()'s argument < bar. + EXPECT_CALL(mock_obj, Foo(Lt(ByRef(bar)))); +``` + +Remember: if you do this, don't change `bar` after the +`EXPECT_CALL()`, or the result is undefined. + +## Validating a Member of an Object ## + +Often a mock function takes a reference to object as an argument. When +matching the argument, you may not want to compare the entire object +against a fixed object, as that may be over-specification. Instead, +you may need to validate a certain member variable or the result of a +certain getter method of the object. You can do this with `Field()` +and `Property()`. More specifically, + +``` +Field(&Foo::bar, m) +``` + +is a matcher that matches a `Foo` object whose `bar` member variable +satisfies matcher `m`. + +``` +Property(&Foo::baz, m) +``` + +is a matcher that matches a `Foo` object whose `baz()` method returns +a value that satisfies matcher `m`. + +For example: + +| Expression | Description | +|:-----------------------------|:-----------------------------------| +| `Field(&Foo::number, Ge(3))` | Matches `x` where `x.number >= 3`. | +| `Property(&Foo::name, StartsWith("John "))` | Matches `x` where `x.name()` starts with `"John "`. | + +Note that in `Property(&Foo::baz, ...)`, method `baz()` must take no +argument and be declared as `const`. + +BTW, `Field()` and `Property()` can also match plain pointers to +objects. For instance, + +``` +Field(&Foo::number, Ge(3)) +``` + +matches a plain pointer `p` where `p->number >= 3`. If `p` is `NULL`, +the match will always fail regardless of the inner matcher. + +What if you want to validate more than one members at the same time? +Remember that there is `AllOf()`. + +## Validating the Value Pointed to by a Pointer Argument ## + +C++ functions often take pointers as arguments. You can use matchers +like `IsNull()`, `NotNull()`, and other comparison matchers to match a +pointer, but what if you want to make sure the value _pointed to_ by +the pointer, instead of the pointer itself, has a certain property? +Well, you can use the `Pointee(m)` matcher. + +`Pointee(m)` matches a pointer iff `m` matches the value the pointer +points to. For example: + +``` +using ::testing::Ge; +using ::testing::Pointee; +... + EXPECT_CALL(foo, Bar(Pointee(Ge(3)))); +``` + +expects `foo.Bar()` to be called with a pointer that points to a value +greater than or equal to 3. + +One nice thing about `Pointee()` is that it treats a `NULL` pointer as +a match failure, so you can write `Pointee(m)` instead of + +``` + AllOf(NotNull(), Pointee(m)) +``` + +without worrying that a `NULL` pointer will crash your test. + +Also, did we tell you that `Pointee()` works with both raw pointers +**and** smart pointers (`linked_ptr`, `shared_ptr`, `scoped_ptr`, and +etc)? + +What if you have a pointer to pointer? You guessed it - you can use +nested `Pointee()` to probe deeper inside the value. For example, +`Pointee(Pointee(Lt(3)))` matches a pointer that points to a pointer +that points to a number less than 3 (what a mouthful...). + +## Testing a Certain Property of an Object ## + +Sometimes you want to specify that an object argument has a certain +property, but there is no existing matcher that does this. If you want +good error messages, you should define a matcher. If you want to do it +quick and dirty, you could get away with writing an ordinary function. + +Let's say you have a mock function that takes an object of type `Foo`, +which has an `int bar()` method and an `int baz()` method, and you +want to constrain that the argument's `bar()` value plus its `baz()` +value is a given number. Here's how you can define a matcher to do it: + +``` +using ::testing::MatcherInterface; +using ::testing::MatchResultListener; + +class BarPlusBazEqMatcher : public MatcherInterface { + public: + explicit BarPlusBazEqMatcher(int expected_sum) + : expected_sum_(expected_sum) {} + + virtual bool MatchAndExplain(const Foo& foo, + MatchResultListener* listener) const { + return (foo.bar() + foo.baz()) == expected_sum_; + } + + virtual void DescribeTo(::std::ostream* os) const { + *os << "bar() + baz() equals " << expected_sum_; + } + + virtual void DescribeNegationTo(::std::ostream* os) const { + *os << "bar() + baz() does not equal " << expected_sum_; + } + private: + const int expected_sum_; +}; + +inline Matcher BarPlusBazEq(int expected_sum) { + return MakeMatcher(new BarPlusBazEqMatcher(expected_sum)); +} + +... + + EXPECT_CALL(..., DoThis(BarPlusBazEq(5)))...; +``` + +## Matching Containers ## + +Sometimes an STL container (e.g. list, vector, map, ...) is passed to +a mock function and you may want to validate it. Since most STL +containers support the `==` operator, you can write +`Eq(expected_container)` or simply `expected_container` to match a +container exactly. + +Sometimes, though, you may want to be more flexible (for example, the +first element must be an exact match, but the second element can be +any positive number, and so on). Also, containers used in tests often +have a small number of elements, and having to define the expected +container out-of-line is a bit of a hassle. + +You can use the `ElementsAre()` or `UnorderedElementsAre()` matcher in +such cases: + +``` +using ::testing::_; +using ::testing::ElementsAre; +using ::testing::Gt; +... + + MOCK_METHOD1(Foo, void(const vector& numbers)); +... + + EXPECT_CALL(mock, Foo(ElementsAre(1, Gt(0), _, 5))); +``` + +The above matcher says that the container must have 4 elements, which +must be 1, greater than 0, anything, and 5 respectively. + +If you instead write: + +``` +using ::testing::_; +using ::testing::Gt; +using ::testing::UnorderedElementsAre; +... + + MOCK_METHOD1(Foo, void(const vector& numbers)); +... + + EXPECT_CALL(mock, Foo(UnorderedElementsAre(1, Gt(0), _, 5))); +``` + +It means that the container must have 4 elements, which under some +permutation must be 1, greater than 0, anything, and 5 respectively. + +`ElementsAre()` and `UnorderedElementsAre()` are overloaded to take 0 +to 10 arguments. If more are needed, you can place them in a C-style +array and use `ElementsAreArray()` or `UnorderedElementsAreArray()` +instead: + +``` +using ::testing::ElementsAreArray; +... + + // ElementsAreArray accepts an array of element values. + const int expected_vector1[] = { 1, 5, 2, 4, ... }; + EXPECT_CALL(mock, Foo(ElementsAreArray(expected_vector1))); + + // Or, an array of element matchers. + Matcher expected_vector2 = { 1, Gt(2), _, 3, ... }; + EXPECT_CALL(mock, Foo(ElementsAreArray(expected_vector2))); +``` + +In case the array needs to be dynamically created (and therefore the +array size cannot be inferred by the compiler), you can give +`ElementsAreArray()` an additional argument to specify the array size: + +``` +using ::testing::ElementsAreArray; +... + int* const expected_vector3 = new int[count]; + ... fill expected_vector3 with values ... + EXPECT_CALL(mock, Foo(ElementsAreArray(expected_vector3, count))); +``` + +**Tips:** + + * `ElementsAre*()` can be used to match _any_ container that implements the STL iterator pattern (i.e. it has a `const_iterator` type and supports `begin()/end()`), not just the ones defined in STL. It will even work with container types yet to be written - as long as they follows the above pattern. + * You can use nested `ElementsAre*()` to match nested (multi-dimensional) containers. + * If the container is passed by pointer instead of by reference, just write `Pointee(ElementsAre*(...))`. + * The order of elements _matters_ for `ElementsAre*()`. Therefore don't use it with containers whose element order is undefined (e.g. `hash_map`). + +## Sharing Matchers ## + +Under the hood, a Google Mock matcher object consists of a pointer to +a ref-counted implementation object. Copying matchers is allowed and +very efficient, as only the pointer is copied. When the last matcher +that references the implementation object dies, the implementation +object will be deleted. + +Therefore, if you have some complex matcher that you want to use again +and again, there is no need to build it every time. Just assign it to a +matcher variable and use that variable repeatedly! For example, + +``` + Matcher in_range = AllOf(Gt(5), Le(10)); + ... use in_range as a matcher in multiple EXPECT_CALLs ... +``` + +# Setting Expectations # + +## Knowing When to Expect ## + +`ON_CALL` is likely the single most under-utilized construct in Google Mock. + +There are basically two constructs for defining the behavior of a mock object: `ON_CALL` and `EXPECT_CALL`. The difference? `ON_CALL` defines what happens when a mock method is called, but _doesn't imply any expectation on the method being called._ `EXPECT_CALL` not only defines the behavior, but also sets an expectation that _the method will be called with the given arguments, for the given number of times_ (and _in the given order_ when you specify the order too). + +Since `EXPECT_CALL` does more, isn't it better than `ON_CALL`? Not really. Every `EXPECT_CALL` adds a constraint on the behavior of the code under test. Having more constraints than necessary is _baaad_ - even worse than not having enough constraints. + +This may be counter-intuitive. How could tests that verify more be worse than tests that verify less? Isn't verification the whole point of tests? + +The answer, lies in _what_ a test should verify. **A good test verifies the contract of the code.** If a test over-specifies, it doesn't leave enough freedom to the implementation. As a result, changing the implementation without breaking the contract (e.g. refactoring and optimization), which should be perfectly fine to do, can break such tests. Then you have to spend time fixing them, only to see them broken again the next time the implementation is changed. + +Keep in mind that one doesn't have to verify more than one property in one test. In fact, **it's a good style to verify only one thing in one test.** If you do that, a bug will likely break only one or two tests instead of dozens (which case would you rather debug?). If you are also in the habit of giving tests descriptive names that tell what they verify, you can often easily guess what's wrong just from the test log itself. + +So use `ON_CALL` by default, and only use `EXPECT_CALL` when you actually intend to verify that the call is made. For example, you may have a bunch of `ON_CALL`s in your test fixture to set the common mock behavior shared by all tests in the same group, and write (scarcely) different `EXPECT_CALL`s in different `TEST_F`s to verify different aspects of the code's behavior. Compared with the style where each `TEST` has many `EXPECT_CALL`s, this leads to tests that are more resilient to implementational changes (and thus less likely to require maintenance) and makes the intent of the tests more obvious (so they are easier to maintain when you do need to maintain them). + +If you are bothered by the "Uninteresting mock function call" message printed when a mock method without an `EXPECT_CALL` is called, you may use a `NiceMock` instead to suppress all such messages for the mock object, or suppress the message for specific methods by adding `EXPECT_CALL(...).Times(AnyNumber())`. DO NOT suppress it by blindly adding an `EXPECT_CALL(...)`, or you'll have a test that's a pain to maintain. + +## Ignoring Uninteresting Calls ## + +If you are not interested in how a mock method is called, just don't +say anything about it. In this case, if the method is ever called, +Google Mock will perform its default action to allow the test program +to continue. If you are not happy with the default action taken by +Google Mock, you can override it using `DefaultValue::Set()` +(described later in this document) or `ON_CALL()`. + +Please note that once you expressed interest in a particular mock +method (via `EXPECT_CALL()`), all invocations to it must match some +expectation. If this function is called but the arguments don't match +any `EXPECT_CALL()` statement, it will be an error. + +## Disallowing Unexpected Calls ## + +If a mock method shouldn't be called at all, explicitly say so: + +``` +using ::testing::_; +... + EXPECT_CALL(foo, Bar(_)) + .Times(0); +``` + +If some calls to the method are allowed, but the rest are not, just +list all the expected calls: + +``` +using ::testing::AnyNumber; +using ::testing::Gt; +... + EXPECT_CALL(foo, Bar(5)); + EXPECT_CALL(foo, Bar(Gt(10))) + .Times(AnyNumber()); +``` + +A call to `foo.Bar()` that doesn't match any of the `EXPECT_CALL()` +statements will be an error. + +## Understanding Uninteresting vs Unexpected Calls ## + +_Uninteresting_ calls and _unexpected_ calls are different concepts in Google Mock. _Very_ different. + +A call `x.Y(...)` is **uninteresting** if there's _not even a single_ `EXPECT_CALL(x, Y(...))` set. In other words, the test isn't interested in the `x.Y()` method at all, as evident in that the test doesn't care to say anything about it. + +A call `x.Y(...)` is **unexpected** if there are some `EXPECT_CALL(x, Y(...))s` set, but none of them matches the call. Put another way, the test is interested in the `x.Y()` method (therefore it _explicitly_ sets some `EXPECT_CALL` to verify how it's called); however, the verification fails as the test doesn't expect this particular call to happen. + +**An unexpected call is always an error,** as the code under test doesn't behave the way the test expects it to behave. + +**By default, an uninteresting call is not an error,** as it violates no constraint specified by the test. (Google Mock's philosophy is that saying nothing means there is no constraint.) However, it leads to a warning, as it _might_ indicate a problem (e.g. the test author might have forgotten to specify a constraint). + +In Google Mock, `NiceMock` and `StrictMock` can be used to make a mock class "nice" or "strict". How does this affect uninteresting calls and unexpected calls? + +A **nice mock** suppresses uninteresting call warnings. It is less chatty than the default mock, but otherwise is the same. If a test fails with a default mock, it will also fail using a nice mock instead. And vice versa. Don't expect making a mock nice to change the test's result. + +A **strict mock** turns uninteresting call warnings into errors. So making a mock strict may change the test's result. + +Let's look at an example: + +``` +TEST(...) { + NiceMock mock_registry; + EXPECT_CALL(mock_registry, GetDomainOwner("google.com")) + .WillRepeatedly(Return("Larry Page")); + + // Use mock_registry in code under test. + ... &mock_registry ... +} +``` + +The sole `EXPECT_CALL` here says that all calls to `GetDomainOwner()` must have `"google.com"` as the argument. If `GetDomainOwner("yahoo.com")` is called, it will be an unexpected call, and thus an error. Having a nice mock doesn't change the severity of an unexpected call. + +So how do we tell Google Mock that `GetDomainOwner()` can be called with some other arguments as well? The standard technique is to add a "catch all" `EXPECT_CALL`: + +``` + EXPECT_CALL(mock_registry, GetDomainOwner(_)) + .Times(AnyNumber()); // catches all other calls to this method. + EXPECT_CALL(mock_registry, GetDomainOwner("google.com")) + .WillRepeatedly(Return("Larry Page")); +``` + +Remember that `_` is the wildcard matcher that matches anything. With this, if `GetDomainOwner("google.com")` is called, it will do what the second `EXPECT_CALL` says; if it is called with a different argument, it will do what the first `EXPECT_CALL` says. + +Note that the order of the two `EXPECT_CALLs` is important, as a newer `EXPECT_CALL` takes precedence over an older one. + +For more on uninteresting calls, nice mocks, and strict mocks, read ["The Nice, the Strict, and the Naggy"](#the-nice-the-strict-and-the-naggy). + +## Expecting Ordered Calls ## + +Although an `EXPECT_CALL()` statement defined earlier takes precedence +when Google Mock tries to match a function call with an expectation, +by default calls don't have to happen in the order `EXPECT_CALL()` +statements are written. For example, if the arguments match the +matchers in the third `EXPECT_CALL()`, but not those in the first two, +then the third expectation will be used. + +If you would rather have all calls occur in the order of the +expectations, put the `EXPECT_CALL()` statements in a block where you +define a variable of type `InSequence`: + +``` + using ::testing::_; + using ::testing::InSequence; + + { + InSequence s; + + EXPECT_CALL(foo, DoThis(5)); + EXPECT_CALL(bar, DoThat(_)) + .Times(2); + EXPECT_CALL(foo, DoThis(6)); + } +``` + +In this example, we expect a call to `foo.DoThis(5)`, followed by two +calls to `bar.DoThat()` where the argument can be anything, which are +in turn followed by a call to `foo.DoThis(6)`. If a call occurred +out-of-order, Google Mock will report an error. + +## Expecting Partially Ordered Calls ## + +Sometimes requiring everything to occur in a predetermined order can +lead to brittle tests. For example, we may care about `A` occurring +before both `B` and `C`, but aren't interested in the relative order +of `B` and `C`. In this case, the test should reflect our real intent, +instead of being overly constraining. + +Google Mock allows you to impose an arbitrary DAG (directed acyclic +graph) on the calls. One way to express the DAG is to use the +[After](CheatSheet.md#the-after-clause) clause of `EXPECT_CALL`. + +Another way is via the `InSequence()` clause (not the same as the +`InSequence` class), which we borrowed from jMock 2. It's less +flexible than `After()`, but more convenient when you have long chains +of sequential calls, as it doesn't require you to come up with +different names for the expectations in the chains. Here's how it +works: + +If we view `EXPECT_CALL()` statements as nodes in a graph, and add an +edge from node A to node B wherever A must occur before B, we can get +a DAG. We use the term "sequence" to mean a directed path in this +DAG. Now, if we decompose the DAG into sequences, we just need to know +which sequences each `EXPECT_CALL()` belongs to in order to be able to +reconstruct the original DAG. + +So, to specify the partial order on the expectations we need to do two +things: first to define some `Sequence` objects, and then for each +`EXPECT_CALL()` say which `Sequence` objects it is part +of. Expectations in the same sequence must occur in the order they are +written. For example, + +``` + using ::testing::Sequence; + + Sequence s1, s2; + + EXPECT_CALL(foo, A()) + .InSequence(s1, s2); + EXPECT_CALL(bar, B()) + .InSequence(s1); + EXPECT_CALL(bar, C()) + .InSequence(s2); + EXPECT_CALL(foo, D()) + .InSequence(s2); +``` + +specifies the following DAG (where `s1` is `A -> B`, and `s2` is `A -> +C -> D`): + +``` + +---> B + | + A ---| + | + +---> C ---> D +``` + +This means that A must occur before B and C, and C must occur before +D. There's no restriction about the order other than these. + +## Controlling When an Expectation Retires ## + +When a mock method is called, Google Mock only consider expectations +that are still active. An expectation is active when created, and +becomes inactive (aka _retires_) when a call that has to occur later +has occurred. For example, in + +``` + using ::testing::_; + using ::testing::Sequence; + + Sequence s1, s2; + + EXPECT_CALL(log, Log(WARNING, _, "File too large.")) // #1 + .Times(AnyNumber()) + .InSequence(s1, s2); + EXPECT_CALL(log, Log(WARNING, _, "Data set is empty.")) // #2 + .InSequence(s1); + EXPECT_CALL(log, Log(WARNING, _, "User not found.")) // #3 + .InSequence(s2); +``` + +as soon as either #2 or #3 is matched, #1 will retire. If a warning +`"File too large."` is logged after this, it will be an error. + +Note that an expectation doesn't retire automatically when it's +saturated. For example, + +``` +using ::testing::_; +... + EXPECT_CALL(log, Log(WARNING, _, _)); // #1 + EXPECT_CALL(log, Log(WARNING, _, "File too large.")); // #2 +``` + +says that there will be exactly one warning with the message `"File +too large."`. If the second warning contains this message too, #2 will +match again and result in an upper-bound-violated error. + +If this is not what you want, you can ask an expectation to retire as +soon as it becomes saturated: + +``` +using ::testing::_; +... + EXPECT_CALL(log, Log(WARNING, _, _)); // #1 + EXPECT_CALL(log, Log(WARNING, _, "File too large.")) // #2 + .RetiresOnSaturation(); +``` + +Here #2 can be used only once, so if you have two warnings with the +message `"File too large."`, the first will match #2 and the second +will match #1 - there will be no error. + +# Using Actions # + +## Returning References from Mock Methods ## + +If a mock function's return type is a reference, you need to use +`ReturnRef()` instead of `Return()` to return a result: + +``` +using ::testing::ReturnRef; + +class MockFoo : public Foo { + public: + MOCK_METHOD0(GetBar, Bar&()); +}; +... + + MockFoo foo; + Bar bar; + EXPECT_CALL(foo, GetBar()) + .WillOnce(ReturnRef(bar)); +``` + +## Returning Live Values from Mock Methods ## + +The `Return(x)` action saves a copy of `x` when the action is +_created_, and always returns the same value whenever it's +executed. Sometimes you may want to instead return the _live_ value of +`x` (i.e. its value at the time when the action is _executed_.). + +If the mock function's return type is a reference, you can do it using +`ReturnRef(x)`, as shown in the previous recipe ("Returning References +from Mock Methods"). However, Google Mock doesn't let you use +`ReturnRef()` in a mock function whose return type is not a reference, +as doing that usually indicates a user error. So, what shall you do? + +You may be tempted to try `ByRef()`: + +``` +using testing::ByRef; +using testing::Return; + +class MockFoo : public Foo { + public: + MOCK_METHOD0(GetValue, int()); +}; +... + int x = 0; + MockFoo foo; + EXPECT_CALL(foo, GetValue()) + .WillRepeatedly(Return(ByRef(x))); + x = 42; + EXPECT_EQ(42, foo.GetValue()); +``` + +Unfortunately, it doesn't work here. The above code will fail with error: + +``` +Value of: foo.GetValue() + Actual: 0 +Expected: 42 +``` + +The reason is that `Return(value)` converts `value` to the actual +return type of the mock function at the time when the action is +_created_, not when it is _executed_. (This behavior was chosen for +the action to be safe when `value` is a proxy object that references +some temporary objects.) As a result, `ByRef(x)` is converted to an +`int` value (instead of a `const int&`) when the expectation is set, +and `Return(ByRef(x))` will always return 0. + +`ReturnPointee(pointer)` was provided to solve this problem +specifically. It returns the value pointed to by `pointer` at the time +the action is _executed_: + +``` +using testing::ReturnPointee; +... + int x = 0; + MockFoo foo; + EXPECT_CALL(foo, GetValue()) + .WillRepeatedly(ReturnPointee(&x)); // Note the & here. + x = 42; + EXPECT_EQ(42, foo.GetValue()); // This will succeed now. +``` + +## Combining Actions ## + +Want to do more than one thing when a function is called? That's +fine. `DoAll()` allow you to do sequence of actions every time. Only +the return value of the last action in the sequence will be used. + +``` +using ::testing::DoAll; + +class MockFoo : public Foo { + public: + MOCK_METHOD1(Bar, bool(int n)); +}; +... + + EXPECT_CALL(foo, Bar(_)) + .WillOnce(DoAll(action_1, + action_2, + ... + action_n)); +``` + +## Mocking Side Effects ## + +Sometimes a method exhibits its effect not via returning a value but +via side effects. For example, it may change some global state or +modify an output argument. To mock side effects, in general you can +define your own action by implementing `::testing::ActionInterface`. + +If all you need to do is to change an output argument, the built-in +`SetArgPointee()` action is convenient: + +``` +using ::testing::SetArgPointee; + +class MockMutator : public Mutator { + public: + MOCK_METHOD2(Mutate, void(bool mutate, int* value)); + ... +}; +... + + MockMutator mutator; + EXPECT_CALL(mutator, Mutate(true, _)) + .WillOnce(SetArgPointee<1>(5)); +``` + +In this example, when `mutator.Mutate()` is called, we will assign 5 +to the `int` variable pointed to by argument #1 +(0-based). + +`SetArgPointee()` conveniently makes an internal copy of the +value you pass to it, removing the need to keep the value in scope and +alive. The implication however is that the value must have a copy +constructor and assignment operator. + +If the mock method also needs to return a value as well, you can chain +`SetArgPointee()` with `Return()` using `DoAll()`: + +``` +using ::testing::_; +using ::testing::Return; +using ::testing::SetArgPointee; + +class MockMutator : public Mutator { + public: + ... + MOCK_METHOD1(MutateInt, bool(int* value)); +}; +... + + MockMutator mutator; + EXPECT_CALL(mutator, MutateInt(_)) + .WillOnce(DoAll(SetArgPointee<0>(5), + Return(true))); +``` + +If the output argument is an array, use the +`SetArrayArgument(first, last)` action instead. It copies the +elements in source range `[first, last)` to the array pointed to by +the `N`-th (0-based) argument: + +``` +using ::testing::NotNull; +using ::testing::SetArrayArgument; + +class MockArrayMutator : public ArrayMutator { + public: + MOCK_METHOD2(Mutate, void(int* values, int num_values)); + ... +}; +... + + MockArrayMutator mutator; + int values[5] = { 1, 2, 3, 4, 5 }; + EXPECT_CALL(mutator, Mutate(NotNull(), 5)) + .WillOnce(SetArrayArgument<0>(values, values + 5)); +``` + +This also works when the argument is an output iterator: + +``` +using ::testing::_; +using ::testing::SetArrayArgument; + +class MockRolodex : public Rolodex { + public: + MOCK_METHOD1(GetNames, void(std::back_insert_iterator >)); + ... +}; +... + + MockRolodex rolodex; + vector names; + names.push_back("George"); + names.push_back("John"); + names.push_back("Thomas"); + EXPECT_CALL(rolodex, GetNames(_)) + .WillOnce(SetArrayArgument<0>(names.begin(), names.end())); +``` + +## Changing a Mock Object's Behavior Based on the State ## + +If you expect a call to change the behavior of a mock object, you can use `::testing::InSequence` to specify different behaviors before and after the call: + +``` +using ::testing::InSequence; +using ::testing::Return; + +... + { + InSequence seq; + EXPECT_CALL(my_mock, IsDirty()) + .WillRepeatedly(Return(true)); + EXPECT_CALL(my_mock, Flush()); + EXPECT_CALL(my_mock, IsDirty()) + .WillRepeatedly(Return(false)); + } + my_mock.FlushIfDirty(); +``` + +This makes `my_mock.IsDirty()` return `true` before `my_mock.Flush()` is called and return `false` afterwards. + +If the behavior change is more complex, you can store the effects in a variable and make a mock method get its return value from that variable: + +``` +using ::testing::_; +using ::testing::SaveArg; +using ::testing::Return; + +ACTION_P(ReturnPointee, p) { return *p; } +... + int previous_value = 0; + EXPECT_CALL(my_mock, GetPrevValue()) + .WillRepeatedly(ReturnPointee(&previous_value)); + EXPECT_CALL(my_mock, UpdateValue(_)) + .WillRepeatedly(SaveArg<0>(&previous_value)); + my_mock.DoSomethingToUpdateValue(); +``` + +Here `my_mock.GetPrevValue()` will always return the argument of the last `UpdateValue()` call. + +## Setting the Default Value for a Return Type ## + +If a mock method's return type is a built-in C++ type or pointer, by +default it will return 0 when invoked. Also, in C++ 11 and above, a mock +method whose return type has a default constructor will return a default-constructed +value by default. You only need to specify an +action if this default value doesn't work for you. + +Sometimes, you may want to change this default value, or you may want +to specify a default value for types Google Mock doesn't know +about. You can do this using the `::testing::DefaultValue` class +template: + +``` +class MockFoo : public Foo { + public: + MOCK_METHOD0(CalculateBar, Bar()); +}; +... + + Bar default_bar; + // Sets the default return value for type Bar. + DefaultValue::Set(default_bar); + + MockFoo foo; + + // We don't need to specify an action here, as the default + // return value works for us. + EXPECT_CALL(foo, CalculateBar()); + + foo.CalculateBar(); // This should return default_bar. + + // Unsets the default return value. + DefaultValue::Clear(); +``` + +Please note that changing the default value for a type can make you +tests hard to understand. We recommend you to use this feature +judiciously. For example, you may want to make sure the `Set()` and +`Clear()` calls are right next to the code that uses your mock. + +## Setting the Default Actions for a Mock Method ## + +You've learned how to change the default value of a given +type. However, this may be too coarse for your purpose: perhaps you +have two mock methods with the same return type and you want them to +have different behaviors. The `ON_CALL()` macro allows you to +customize your mock's behavior at the method level: + +``` +using ::testing::_; +using ::testing::AnyNumber; +using ::testing::Gt; +using ::testing::Return; +... + ON_CALL(foo, Sign(_)) + .WillByDefault(Return(-1)); + ON_CALL(foo, Sign(0)) + .WillByDefault(Return(0)); + ON_CALL(foo, Sign(Gt(0))) + .WillByDefault(Return(1)); + + EXPECT_CALL(foo, Sign(_)) + .Times(AnyNumber()); + + foo.Sign(5); // This should return 1. + foo.Sign(-9); // This should return -1. + foo.Sign(0); // This should return 0. +``` + +As you may have guessed, when there are more than one `ON_CALL()` +statements, the news order take precedence over the older ones. In +other words, the **last** one that matches the function arguments will +be used. This matching order allows you to set up the common behavior +in a mock object's constructor or the test fixture's set-up phase and +specialize the mock's behavior later. + +## Using Functions/Methods/Functors as Actions ## + +If the built-in actions don't suit you, you can easily use an existing +function, method, or functor as an action: + +``` +using ::testing::_; +using ::testing::Invoke; + +class MockFoo : public Foo { + public: + MOCK_METHOD2(Sum, int(int x, int y)); + MOCK_METHOD1(ComplexJob, bool(int x)); +}; + +int CalculateSum(int x, int y) { return x + y; } + +class Helper { + public: + bool ComplexJob(int x); +}; +... + + MockFoo foo; + Helper helper; + EXPECT_CALL(foo, Sum(_, _)) + .WillOnce(Invoke(CalculateSum)); + EXPECT_CALL(foo, ComplexJob(_)) + .WillOnce(Invoke(&helper, &Helper::ComplexJob)); + + foo.Sum(5, 6); // Invokes CalculateSum(5, 6). + foo.ComplexJob(10); // Invokes helper.ComplexJob(10); +``` + +The only requirement is that the type of the function, etc must be +_compatible_ with the signature of the mock function, meaning that the +latter's arguments can be implicitly converted to the corresponding +arguments of the former, and the former's return type can be +implicitly converted to that of the latter. So, you can invoke +something whose type is _not_ exactly the same as the mock function, +as long as it's safe to do so - nice, huh? + +## Invoking a Function/Method/Functor Without Arguments ## + +`Invoke()` is very useful for doing actions that are more complex. It +passes the mock function's arguments to the function or functor being +invoked such that the callee has the full context of the call to work +with. If the invoked function is not interested in some or all of the +arguments, it can simply ignore them. + +Yet, a common pattern is that a test author wants to invoke a function +without the arguments of the mock function. `Invoke()` allows her to +do that using a wrapper function that throws away the arguments before +invoking an underlining nullary function. Needless to say, this can be +tedious and obscures the intent of the test. + +`InvokeWithoutArgs()` solves this problem. It's like `Invoke()` except +that it doesn't pass the mock function's arguments to the +callee. Here's an example: + +``` +using ::testing::_; +using ::testing::InvokeWithoutArgs; + +class MockFoo : public Foo { + public: + MOCK_METHOD1(ComplexJob, bool(int n)); +}; + +bool Job1() { ... } +... + + MockFoo foo; + EXPECT_CALL(foo, ComplexJob(_)) + .WillOnce(InvokeWithoutArgs(Job1)); + + foo.ComplexJob(10); // Invokes Job1(). +``` + +## Invoking an Argument of the Mock Function ## + +Sometimes a mock function will receive a function pointer or a functor +(in other words, a "callable") as an argument, e.g. + +``` +class MockFoo : public Foo { + public: + MOCK_METHOD2(DoThis, bool(int n, bool (*fp)(int))); +}; +``` + +and you may want to invoke this callable argument: + +``` +using ::testing::_; +... + MockFoo foo; + EXPECT_CALL(foo, DoThis(_, _)) + .WillOnce(...); + // Will execute (*fp)(5), where fp is the + // second argument DoThis() receives. +``` + +Arghh, you need to refer to a mock function argument but your version +of C++ has no lambdas, so you have to define your own action. :-( +Or do you really? + +Well, Google Mock has an action to solve _exactly_ this problem: + +``` + InvokeArgument(arg_1, arg_2, ..., arg_m) +``` + +will invoke the `N`-th (0-based) argument the mock function receives, +with `arg_1`, `arg_2`, ..., and `arg_m`. No matter if the argument is +a function pointer or a functor, Google Mock handles them both. + +With that, you could write: + +``` +using ::testing::_; +using ::testing::InvokeArgument; +... + EXPECT_CALL(foo, DoThis(_, _)) + .WillOnce(InvokeArgument<1>(5)); + // Will execute (*fp)(5), where fp is the + // second argument DoThis() receives. +``` + +What if the callable takes an argument by reference? No problem - just +wrap it inside `ByRef()`: + +``` +... + MOCK_METHOD1(Bar, bool(bool (*fp)(int, const Helper&))); +... +using ::testing::_; +using ::testing::ByRef; +using ::testing::InvokeArgument; +... + + MockFoo foo; + Helper helper; + ... + EXPECT_CALL(foo, Bar(_)) + .WillOnce(InvokeArgument<0>(5, ByRef(helper))); + // ByRef(helper) guarantees that a reference to helper, not a copy of it, + // will be passed to the callable. +``` + +What if the callable takes an argument by reference and we do **not** +wrap the argument in `ByRef()`? Then `InvokeArgument()` will _make a +copy_ of the argument, and pass a _reference to the copy_, instead of +a reference to the original value, to the callable. This is especially +handy when the argument is a temporary value: + +``` +... + MOCK_METHOD1(DoThat, bool(bool (*f)(const double& x, const string& s))); +... +using ::testing::_; +using ::testing::InvokeArgument; +... + + MockFoo foo; + ... + EXPECT_CALL(foo, DoThat(_)) + .WillOnce(InvokeArgument<0>(5.0, string("Hi"))); + // Will execute (*f)(5.0, string("Hi")), where f is the function pointer + // DoThat() receives. Note that the values 5.0 and string("Hi") are + // temporary and dead once the EXPECT_CALL() statement finishes. Yet + // it's fine to perform this action later, since a copy of the values + // are kept inside the InvokeArgument action. +``` + +## Ignoring an Action's Result ## + +Sometimes you have an action that returns _something_, but you need an +action that returns `void` (perhaps you want to use it in a mock +function that returns `void`, or perhaps it needs to be used in +`DoAll()` and it's not the last in the list). `IgnoreResult()` lets +you do that. For example: + +``` +using ::testing::_; +using ::testing::Invoke; +using ::testing::Return; + +int Process(const MyData& data); +string DoSomething(); + +class MockFoo : public Foo { + public: + MOCK_METHOD1(Abc, void(const MyData& data)); + MOCK_METHOD0(Xyz, bool()); +}; +... + + MockFoo foo; + EXPECT_CALL(foo, Abc(_)) + // .WillOnce(Invoke(Process)); + // The above line won't compile as Process() returns int but Abc() needs + // to return void. + .WillOnce(IgnoreResult(Invoke(Process))); + + EXPECT_CALL(foo, Xyz()) + .WillOnce(DoAll(IgnoreResult(Invoke(DoSomething)), + // Ignores the string DoSomething() returns. + Return(true))); +``` + +Note that you **cannot** use `IgnoreResult()` on an action that already +returns `void`. Doing so will lead to ugly compiler errors. + +## Selecting an Action's Arguments ## + +Say you have a mock function `Foo()` that takes seven arguments, and +you have a custom action that you want to invoke when `Foo()` is +called. Trouble is, the custom action only wants three arguments: + +``` +using ::testing::_; +using ::testing::Invoke; +... + MOCK_METHOD7(Foo, bool(bool visible, const string& name, int x, int y, + const map, double>& weight, + double min_weight, double max_wight)); +... + +bool IsVisibleInQuadrant1(bool visible, int x, int y) { + return visible && x >= 0 && y >= 0; +} +... + + EXPECT_CALL(mock, Foo(_, _, _, _, _, _, _)) + .WillOnce(Invoke(IsVisibleInQuadrant1)); // Uh, won't compile. :-( +``` + +To please the compiler God, you can to define an "adaptor" that has +the same signature as `Foo()` and calls the custom action with the +right arguments: + +``` +using ::testing::_; +using ::testing::Invoke; + +bool MyIsVisibleInQuadrant1(bool visible, const string& name, int x, int y, + const map, double>& weight, + double min_weight, double max_wight) { + return IsVisibleInQuadrant1(visible, x, y); +} +... + + EXPECT_CALL(mock, Foo(_, _, _, _, _, _, _)) + .WillOnce(Invoke(MyIsVisibleInQuadrant1)); // Now it works. +``` + +But isn't this awkward? + +Google Mock provides a generic _action adaptor_, so you can spend your +time minding more important business than writing your own +adaptors. Here's the syntax: + +``` + WithArgs(action) +``` + +creates an action that passes the arguments of the mock function at +the given indices (0-based) to the inner `action` and performs +it. Using `WithArgs`, our original example can be written as: + +``` +using ::testing::_; +using ::testing::Invoke; +using ::testing::WithArgs; +... + EXPECT_CALL(mock, Foo(_, _, _, _, _, _, _)) + .WillOnce(WithArgs<0, 2, 3>(Invoke(IsVisibleInQuadrant1))); + // No need to define your own adaptor. +``` + +For better readability, Google Mock also gives you: + + * `WithoutArgs(action)` when the inner `action` takes _no_ argument, and + * `WithArg(action)` (no `s` after `Arg`) when the inner `action` takes _one_ argument. + +As you may have realized, `InvokeWithoutArgs(...)` is just syntactic +sugar for `WithoutArgs(Invoke(...))`. + +Here are more tips: + + * The inner action used in `WithArgs` and friends does not have to be `Invoke()` -- it can be anything. + * You can repeat an argument in the argument list if necessary, e.g. `WithArgs<2, 3, 3, 5>(...)`. + * You can change the order of the arguments, e.g. `WithArgs<3, 2, 1>(...)`. + * The types of the selected arguments do _not_ have to match the signature of the inner action exactly. It works as long as they can be implicitly converted to the corresponding arguments of the inner action. For example, if the 4-th argument of the mock function is an `int` and `my_action` takes a `double`, `WithArg<4>(my_action)` will work. + +## Ignoring Arguments in Action Functions ## + +The selecting-an-action's-arguments recipe showed us one way to make a +mock function and an action with incompatible argument lists fit +together. The downside is that wrapping the action in +`WithArgs<...>()` can get tedious for people writing the tests. + +If you are defining a function, method, or functor to be used with +`Invoke*()`, and you are not interested in some of its arguments, an +alternative to `WithArgs` is to declare the uninteresting arguments as +`Unused`. This makes the definition less cluttered and less fragile in +case the types of the uninteresting arguments change. It could also +increase the chance the action function can be reused. For example, +given + +``` + MOCK_METHOD3(Foo, double(const string& label, double x, double y)); + MOCK_METHOD3(Bar, double(int index, double x, double y)); +``` + +instead of + +``` +using ::testing::_; +using ::testing::Invoke; + +double DistanceToOriginWithLabel(const string& label, double x, double y) { + return sqrt(x*x + y*y); +} + +double DistanceToOriginWithIndex(int index, double x, double y) { + return sqrt(x*x + y*y); +} +... + + EXEPCT_CALL(mock, Foo("abc", _, _)) + .WillOnce(Invoke(DistanceToOriginWithLabel)); + EXEPCT_CALL(mock, Bar(5, _, _)) + .WillOnce(Invoke(DistanceToOriginWithIndex)); +``` + +you could write + +``` +using ::testing::_; +using ::testing::Invoke; +using ::testing::Unused; + +double DistanceToOrigin(Unused, double x, double y) { + return sqrt(x*x + y*y); +} +... + + EXEPCT_CALL(mock, Foo("abc", _, _)) + .WillOnce(Invoke(DistanceToOrigin)); + EXEPCT_CALL(mock, Bar(5, _, _)) + .WillOnce(Invoke(DistanceToOrigin)); +``` + +## Sharing Actions ## + +Just like matchers, a Google Mock action object consists of a pointer +to a ref-counted implementation object. Therefore copying actions is +also allowed and very efficient. When the last action that references +the implementation object dies, the implementation object will be +deleted. + +If you have some complex action that you want to use again and again, +you may not have to build it from scratch every time. If the action +doesn't have an internal state (i.e. if it always does the same thing +no matter how many times it has been called), you can assign it to an +action variable and use that variable repeatedly. For example: + +``` + Action set_flag = DoAll(SetArgPointee<0>(5), + Return(true)); + ... use set_flag in .WillOnce() and .WillRepeatedly() ... +``` + +However, if the action has its own state, you may be surprised if you +share the action object. Suppose you have an action factory +`IncrementCounter(init)` which creates an action that increments and +returns a counter whose initial value is `init`, using two actions +created from the same expression and using a shared action will +exihibit different behaviors. Example: + +``` + EXPECT_CALL(foo, DoThis()) + .WillRepeatedly(IncrementCounter(0)); + EXPECT_CALL(foo, DoThat()) + .WillRepeatedly(IncrementCounter(0)); + foo.DoThis(); // Returns 1. + foo.DoThis(); // Returns 2. + foo.DoThat(); // Returns 1 - Blah() uses a different + // counter than Bar()'s. +``` + +versus + +``` + Action increment = IncrementCounter(0); + + EXPECT_CALL(foo, DoThis()) + .WillRepeatedly(increment); + EXPECT_CALL(foo, DoThat()) + .WillRepeatedly(increment); + foo.DoThis(); // Returns 1. + foo.DoThis(); // Returns 2. + foo.DoThat(); // Returns 3 - the counter is shared. +``` + +# Misc Recipes on Using Google Mock # + +## Mocking Methods That Use Move-Only Types ## + +C++11 introduced move-only types. A move-only-typed value can be moved from one object to another, but cannot be copied. `std::unique_ptr` is probably the most commonly used move-only type. + +Mocking a method that takes and/or returns move-only types presents some challenges, but nothing insurmountable. This recipe shows you how you can do it. + +Let’s say we are working on a fictional project that lets one post and share snippets called “buzzesâ€. Your code uses these types: + +``` +enum class AccessLevel { kInternal, kPublic }; + +class Buzz { + public: + explicit Buzz(AccessLevel access) { … } + ... +}; + +class Buzzer { + public: + virtual ~Buzzer() {} + virtual std::unique_ptr MakeBuzz(const std::string& text) = 0; + virtual bool ShareBuzz(std::unique_ptr buzz, Time timestamp) = 0; + ... +}; +``` + +A `Buzz` object represents a snippet being posted. A class that implements the `Buzzer` interface is capable of creating and sharing `Buzz`. Methods in `Buzzer` may return a `unique_ptr` or take a `unique_ptr`. Now we need to mock `Buzzer` in our tests. + +To mock a method that returns a move-only type, you just use the familiar `MOCK_METHOD` syntax as usual: + +``` +class MockBuzzer : public Buzzer { + public: + MOCK_METHOD1(MakeBuzz, std::unique_ptr(const std::string& text)); + … +}; +``` + +However, if you attempt to use the same `MOCK_METHOD` pattern to mock a method that takes a move-only parameter, you’ll get a compiler error currently: + +``` + // Does NOT compile! + MOCK_METHOD2(ShareBuzz, bool(std::unique_ptr buzz, Time timestamp)); +``` + +While it’s highly desirable to make this syntax just work, it’s not trivial and the work hasn’t been done yet. Fortunately, there is a trick you can apply today to get something that works nearly as well as this. + +The trick, is to delegate the `ShareBuzz()` method to a mock method (let’s call it `DoShareBuzz()`) that does not take move-only parameters: + +``` +class MockBuzzer : public Buzzer { + public: + MOCK_METHOD1(MakeBuzz, std::unique_ptr(const std::string& text)); + MOCK_METHOD2(DoShareBuzz, bool(Buzz* buzz, Time timestamp)); + bool ShareBuzz(std::unique_ptr buzz, Time timestamp) { + return DoShareBuzz(buzz.get(), timestamp); + } +}; +``` + +Note that there's no need to define or declare `DoShareBuzz()` in a base class. You only need to define it as a `MOCK_METHOD` in the mock class. + +Now that we have the mock class defined, we can use it in tests. In the following code examples, we assume that we have defined a `MockBuzzer` object named `mock_buzzer_`: + +``` + MockBuzzer mock_buzzer_; +``` + +First let’s see how we can set expectations on the `MakeBuzz()` method, which returns a `unique_ptr`. + +As usual, if you set an expectation without an action (i.e. the `.WillOnce()` or `.WillRepeated()` clause), when that expectation fires, the default action for that method will be taken. Since `unique_ptr<>` has a default constructor that returns a null `unique_ptr`, that’s what you’ll get if you don’t specify an action: + +``` + // Use the default action. + EXPECT_CALL(mock_buzzer_, MakeBuzz("hello")); + + // Triggers the previous EXPECT_CALL. + EXPECT_EQ(nullptr, mock_buzzer_.MakeBuzz("hello")); +``` + +If you are not happy with the default action, you can tweak it. Depending on what you need, you may either tweak the default action for a specific (mock object, mock method) combination using `ON_CALL()`, or you may tweak the default action for all mock methods that return a specific type. The usage of `ON_CALL()` is similar to `EXPECT_CALL()`, so we’ll skip it and just explain how to do the latter (tweaking the default action for a specific return type). You do this via the `DefaultValue<>::SetFactory()` and `DefaultValue<>::Clear()` API: + +``` + // Sets the default action for return type std::unique_ptr to + // creating a new Buzz every time. + DefaultValue>::SetFactory( + [] { return MakeUnique(AccessLevel::kInternal); }); + + // When this fires, the default action of MakeBuzz() will run, which + // will return a new Buzz object. + EXPECT_CALL(mock_buzzer_, MakeBuzz("hello")).Times(AnyNumber()); + + auto buzz1 = mock_buzzer_.MakeBuzz("hello"); + auto buzz2 = mock_buzzer_.MakeBuzz("hello"); + EXPECT_NE(nullptr, buzz1); + EXPECT_NE(nullptr, buzz2); + EXPECT_NE(buzz1, buzz2); + + // Resets the default action for return type std::unique_ptr, + // to avoid interfere with other tests. + DefaultValue>::Clear(); +``` + +What if you want the method to do something other than the default action? If you just need to return a pre-defined move-only value, you can use the `Return(ByMove(...))` action: + +``` + // When this fires, the unique_ptr<> specified by ByMove(...) will + // be returned. + EXPECT_CALL(mock_buzzer_, MakeBuzz("world")) + .WillOnce(Return(ByMove(MakeUnique(AccessLevel::kInternal)))); + + EXPECT_NE(nullptr, mock_buzzer_.MakeBuzz("world")); +``` + +Note that `ByMove()` is essential here - if you drop it, the code won’t compile. + +Quiz time! What do you think will happen if a `Return(ByMove(...))` action is performed more than once (e.g. you write `….WillRepeatedly(Return(ByMove(...)));`)? Come think of it, after the first time the action runs, the source value will be consumed (since it’s a move-only value), so the next time around, there’s no value to move from -- you’ll get a run-time error that `Return(ByMove(...))` can only be run once. + +If you need your mock method to do more than just moving a pre-defined value, remember that you can always use `Invoke()` to call a lambda or a callable object, which can do pretty much anything you want: + +``` + EXPECT_CALL(mock_buzzer_, MakeBuzz("x")) + .WillRepeatedly(Invoke([](const std::string& text) { + return std::make_unique(AccessLevel::kInternal); + })); + + EXPECT_NE(nullptr, mock_buzzer_.MakeBuzz("x")); + EXPECT_NE(nullptr, mock_buzzer_.MakeBuzz("x")); +``` + +Every time this `EXPECT_CALL` fires, a new `unique_ptr` will be created and returned. You cannot do this with `Return(ByMove(...))`. + +Now there’s one topic we haven’t covered: how do you set expectations on `ShareBuzz()`, which takes a move-only-typed parameter? The answer is you don’t. Instead, you set expectations on the `DoShareBuzz()` mock method (remember that we defined a `MOCK_METHOD` for `DoShareBuzz()`, not `ShareBuzz()`): + +``` + EXPECT_CALL(mock_buzzer_, DoShareBuzz(NotNull(), _)); + + // When one calls ShareBuzz() on the MockBuzzer like this, the call is + // forwarded to DoShareBuzz(), which is mocked. Therefore this statement + // will trigger the above EXPECT_CALL. + mock_buzzer_.ShareBuzz(MakeUnique(AccessLevel::kInternal), + ::base::Now()); +``` + +Some of you may have spotted one problem with this approach: the `DoShareBuzz()` mock method differs from the real `ShareBuzz()` method in that it cannot take ownership of the buzz parameter - `ShareBuzz()` will always delete buzz after `DoShareBuzz()` returns. What if you need to save the buzz object somewhere for later use when `ShareBuzz()` is called? Indeed, you'd be stuck. + +Another problem with the `DoShareBuzz()` we had is that it can surprise people reading or maintaining the test, as one would expect that `DoShareBuzz()` has (logically) the same contract as `ShareBuzz()`. + +Fortunately, these problems can be fixed with a bit more code. Let's try to get it right this time: + +``` +class MockBuzzer : public Buzzer { + public: + MockBuzzer() { + // Since DoShareBuzz(buzz, time) is supposed to take ownership of + // buzz, define a default behavior for DoShareBuzz(buzz, time) to + // delete buzz. + ON_CALL(*this, DoShareBuzz(_, _)) + .WillByDefault(Invoke([](Buzz* buzz, Time timestamp) { + delete buzz; + return true; + })); + } + + MOCK_METHOD1(MakeBuzz, std::unique_ptr(const std::string& text)); + + // Takes ownership of buzz. + MOCK_METHOD2(DoShareBuzz, bool(Buzz* buzz, Time timestamp)); + bool ShareBuzz(std::unique_ptr buzz, Time timestamp) { + return DoShareBuzz(buzz.release(), timestamp); + } +}; +``` + +Now, the mock `DoShareBuzz()` method is free to save the buzz argument for later use if this is what you want: + +``` + std::unique_ptr intercepted_buzz; + EXPECT_CALL(mock_buzzer_, DoShareBuzz(NotNull(), _)) + .WillOnce(Invoke([&intercepted_buzz](Buzz* buzz, Time timestamp) { + // Save buzz in intercepted_buzz for analysis later. + intercepted_buzz.reset(buzz); + return false; + })); + + mock_buzzer_.ShareBuzz(std::make_unique(AccessLevel::kInternal), + Now()); + EXPECT_NE(nullptr, intercepted_buzz); +``` + +Using the tricks covered in this recipe, you are now able to mock methods that take and/or return move-only types. Put your newly-acquired power to good use - when you design a new API, you can now feel comfortable using `unique_ptrs` as appropriate, without fearing that doing so will compromise your tests. + +## Making the Compilation Faster ## + +Believe it or not, the _vast majority_ of the time spent on compiling +a mock class is in generating its constructor and destructor, as they +perform non-trivial tasks (e.g. verification of the +expectations). What's more, mock methods with different signatures +have different types and thus their constructors/destructors need to +be generated by the compiler separately. As a result, if you mock many +different types of methods, compiling your mock class can get really +slow. + +If you are experiencing slow compilation, you can move the definition +of your mock class' constructor and destructor out of the class body +and into a `.cpp` file. This way, even if you `#include` your mock +class in N files, the compiler only needs to generate its constructor +and destructor once, resulting in a much faster compilation. + +Let's illustrate the idea using an example. Here's the definition of a +mock class before applying this recipe: + +``` +// File mock_foo.h. +... +class MockFoo : public Foo { + public: + // Since we don't declare the constructor or the destructor, + // the compiler will generate them in every translation unit + // where this mock class is used. + + MOCK_METHOD0(DoThis, int()); + MOCK_METHOD1(DoThat, bool(const char* str)); + ... more mock methods ... +}; +``` + +After the change, it would look like: + +``` +// File mock_foo.h. +... +class MockFoo : public Foo { + public: + // The constructor and destructor are declared, but not defined, here. + MockFoo(); + virtual ~MockFoo(); + + MOCK_METHOD0(DoThis, int()); + MOCK_METHOD1(DoThat, bool(const char* str)); + ... more mock methods ... +}; +``` +and +``` +// File mock_foo.cpp. +#include "path/to/mock_foo.h" + +// The definitions may appear trivial, but the functions actually do a +// lot of things through the constructors/destructors of the member +// variables used to implement the mock methods. +MockFoo::MockFoo() {} +MockFoo::~MockFoo() {} +``` + +## Forcing a Verification ## + +When it's being destroyed, your friendly mock object will automatically +verify that all expectations on it have been satisfied, and will +generate [Google Test](../../googletest/) failures +if not. This is convenient as it leaves you with one less thing to +worry about. That is, unless you are not sure if your mock object will +be destroyed. + +How could it be that your mock object won't eventually be destroyed? +Well, it might be created on the heap and owned by the code you are +testing. Suppose there's a bug in that code and it doesn't delete the +mock object properly - you could end up with a passing test when +there's actually a bug. + +Using a heap checker is a good idea and can alleviate the concern, but +its implementation may not be 100% reliable. So, sometimes you do want +to _force_ Google Mock to verify a mock object before it is +(hopefully) destructed. You can do this with +`Mock::VerifyAndClearExpectations(&mock_object)`: + +``` +TEST(MyServerTest, ProcessesRequest) { + using ::testing::Mock; + + MockFoo* const foo = new MockFoo; + EXPECT_CALL(*foo, ...)...; + // ... other expectations ... + + // server now owns foo. + MyServer server(foo); + server.ProcessRequest(...); + + // In case that server's destructor will forget to delete foo, + // this will verify the expectations anyway. + Mock::VerifyAndClearExpectations(foo); +} // server is destroyed when it goes out of scope here. +``` + +**Tip:** The `Mock::VerifyAndClearExpectations()` function returns a +`bool` to indicate whether the verification was successful (`true` for +yes), so you can wrap that function call inside a `ASSERT_TRUE()` if +there is no point going further when the verification has failed. + +## Using Check Points ## + +Sometimes you may want to "reset" a mock object at various check +points in your test: at each check point, you verify that all existing +expectations on the mock object have been satisfied, and then you set +some new expectations on it as if it's newly created. This allows you +to work with a mock object in "phases" whose sizes are each +manageable. + +One such scenario is that in your test's `SetUp()` function, you may +want to put the object you are testing into a certain state, with the +help from a mock object. Once in the desired state, you want to clear +all expectations on the mock, such that in the `TEST_F` body you can +set fresh expectations on it. + +As you may have figured out, the `Mock::VerifyAndClearExpectations()` +function we saw in the previous recipe can help you here. Or, if you +are using `ON_CALL()` to set default actions on the mock object and +want to clear the default actions as well, use +`Mock::VerifyAndClear(&mock_object)` instead. This function does what +`Mock::VerifyAndClearExpectations(&mock_object)` does and returns the +same `bool`, **plus** it clears the `ON_CALL()` statements on +`mock_object` too. + +Another trick you can use to achieve the same effect is to put the +expectations in sequences and insert calls to a dummy "check-point" +function at specific places. Then you can verify that the mock +function calls do happen at the right time. For example, if you are +exercising code: + +``` +Foo(1); +Foo(2); +Foo(3); +``` + +and want to verify that `Foo(1)` and `Foo(3)` both invoke +`mock.Bar("a")`, but `Foo(2)` doesn't invoke anything. You can write: + +``` +using ::testing::MockFunction; + +TEST(FooTest, InvokesBarCorrectly) { + MyMock mock; + // Class MockFunction has exactly one mock method. It is named + // Call() and has type F. + MockFunction check; + { + InSequence s; + + EXPECT_CALL(mock, Bar("a")); + EXPECT_CALL(check, Call("1")); + EXPECT_CALL(check, Call("2")); + EXPECT_CALL(mock, Bar("a")); + } + Foo(1); + check.Call("1"); + Foo(2); + check.Call("2"); + Foo(3); +} +``` + +The expectation spec says that the first `Bar("a")` must happen before +check point "1", the second `Bar("a")` must happen after check point "2", +and nothing should happen between the two check points. The explicit +check points make it easy to tell which `Bar("a")` is called by which +call to `Foo()`. + +## Mocking Destructors ## + +Sometimes you want to make sure a mock object is destructed at the +right time, e.g. after `bar->A()` is called but before `bar->B()` is +called. We already know that you can specify constraints on the order +of mock function calls, so all we need to do is to mock the destructor +of the mock function. + +This sounds simple, except for one problem: a destructor is a special +function with special syntax and special semantics, and the +`MOCK_METHOD0` macro doesn't work for it: + +``` + MOCK_METHOD0(~MockFoo, void()); // Won't compile! +``` + +The good news is that you can use a simple pattern to achieve the same +effect. First, add a mock function `Die()` to your mock class and call +it in the destructor, like this: + +``` +class MockFoo : public Foo { + ... + // Add the following two lines to the mock class. + MOCK_METHOD0(Die, void()); + virtual ~MockFoo() { Die(); } +}; +``` + +(If the name `Die()` clashes with an existing symbol, choose another +name.) Now, we have translated the problem of testing when a `MockFoo` +object dies to testing when its `Die()` method is called: + +``` + MockFoo* foo = new MockFoo; + MockBar* bar = new MockBar; + ... + { + InSequence s; + + // Expects *foo to die after bar->A() and before bar->B(). + EXPECT_CALL(*bar, A()); + EXPECT_CALL(*foo, Die()); + EXPECT_CALL(*bar, B()); + } +``` + +And that's that. + +## Using Google Mock and Threads ## + +**IMPORTANT NOTE:** What we describe in this recipe is **ONLY** true on +platforms where Google Mock is thread-safe. Currently these are only +platforms that support the pthreads library (this includes Linux and Mac). +To make it thread-safe on other platforms we only need to implement +some synchronization operations in `"gtest/internal/gtest-port.h"`. + +In a **unit** test, it's best if you could isolate and test a piece of +code in a single-threaded context. That avoids race conditions and +dead locks, and makes debugging your test much easier. + +Yet many programs are multi-threaded, and sometimes to test something +we need to pound on it from more than one thread. Google Mock works +for this purpose too. + +Remember the steps for using a mock: + + 1. Create a mock object `foo`. + 1. Set its default actions and expectations using `ON_CALL()` and `EXPECT_CALL()`. + 1. The code under test calls methods of `foo`. + 1. Optionally, verify and reset the mock. + 1. Destroy the mock yourself, or let the code under test destroy it. The destructor will automatically verify it. + +If you follow the following simple rules, your mocks and threads can +live happily together: + + * Execute your _test code_ (as opposed to the code being tested) in _one_ thread. This makes your test easy to follow. + * Obviously, you can do step #1 without locking. + * When doing step #2 and #5, make sure no other thread is accessing `foo`. Obvious too, huh? + * #3 and #4 can be done either in one thread or in multiple threads - anyway you want. Google Mock takes care of the locking, so you don't have to do any - unless required by your test logic. + +If you violate the rules (for example, if you set expectations on a +mock while another thread is calling its methods), you get undefined +behavior. That's not fun, so don't do it. + +Google Mock guarantees that the action for a mock function is done in +the same thread that called the mock function. For example, in + +``` + EXPECT_CALL(mock, Foo(1)) + .WillOnce(action1); + EXPECT_CALL(mock, Foo(2)) + .WillOnce(action2); +``` + +if `Foo(1)` is called in thread 1 and `Foo(2)` is called in thread 2, +Google Mock will execute `action1` in thread 1 and `action2` in thread +2. + +Google Mock does _not_ impose a sequence on actions performed in +different threads (doing so may create deadlocks as the actions may +need to cooperate). This means that the execution of `action1` and +`action2` in the above example _may_ interleave. If this is a problem, +you should add proper synchronization logic to `action1` and `action2` +to make the test thread-safe. + + +Also, remember that `DefaultValue` is a global resource that +potentially affects _all_ living mock objects in your +program. Naturally, you won't want to mess with it from multiple +threads or when there still are mocks in action. + +## Controlling How Much Information Google Mock Prints ## + +When Google Mock sees something that has the potential of being an +error (e.g. a mock function with no expectation is called, a.k.a. an +uninteresting call, which is allowed but perhaps you forgot to +explicitly ban the call), it prints some warning messages, including +the arguments of the function and the return value. Hopefully this +will remind you to take a look and see if there is indeed a problem. + +Sometimes you are confident that your tests are correct and may not +appreciate such friendly messages. Some other times, you are debugging +your tests or learning about the behavior of the code you are testing, +and wish you could observe every mock call that happens (including +argument values and the return value). Clearly, one size doesn't fit +all. + +You can control how much Google Mock tells you using the +`--gmock_verbose=LEVEL` command-line flag, where `LEVEL` is a string +with three possible values: + + * `info`: Google Mock will print all informational messages, warnings, and errors (most verbose). At this setting, Google Mock will also log any calls to the `ON_CALL/EXPECT_CALL` macros. + * `warning`: Google Mock will print both warnings and errors (less verbose). This is the default. + * `error`: Google Mock will print errors only (least verbose). + +Alternatively, you can adjust the value of that flag from within your +tests like so: + +``` + ::testing::FLAGS_gmock_verbose = "error"; +``` + +Now, judiciously use the right flag to enable Google Mock serve you better! + +## Gaining Super Vision into Mock Calls ## + +You have a test using Google Mock. It fails: Google Mock tells you +that some expectations aren't satisfied. However, you aren't sure why: +Is there a typo somewhere in the matchers? Did you mess up the order +of the `EXPECT_CALL`s? Or is the code under test doing something +wrong? How can you find out the cause? + +Won't it be nice if you have X-ray vision and can actually see the +trace of all `EXPECT_CALL`s and mock method calls as they are made? +For each call, would you like to see its actual argument values and +which `EXPECT_CALL` Google Mock thinks it matches? + +You can unlock this power by running your test with the +`--gmock_verbose=info` flag. For example, given the test program: + +``` +using testing::_; +using testing::HasSubstr; +using testing::Return; + +class MockFoo { + public: + MOCK_METHOD2(F, void(const string& x, const string& y)); +}; + +TEST(Foo, Bar) { + MockFoo mock; + EXPECT_CALL(mock, F(_, _)).WillRepeatedly(Return()); + EXPECT_CALL(mock, F("a", "b")); + EXPECT_CALL(mock, F("c", HasSubstr("d"))); + + mock.F("a", "good"); + mock.F("a", "b"); +} +``` + +if you run it with `--gmock_verbose=info`, you will see this output: + +``` +[ RUN ] Foo.Bar + +foo_test.cc:14: EXPECT_CALL(mock, F(_, _)) invoked +foo_test.cc:15: EXPECT_CALL(mock, F("a", "b")) invoked +foo_test.cc:16: EXPECT_CALL(mock, F("c", HasSubstr("d"))) invoked +foo_test.cc:14: Mock function call matches EXPECT_CALL(mock, F(_, _))... + Function call: F(@0x7fff7c8dad40"a", @0x7fff7c8dad10"good") +foo_test.cc:15: Mock function call matches EXPECT_CALL(mock, F("a", "b"))... + Function call: F(@0x7fff7c8dada0"a", @0x7fff7c8dad70"b") +foo_test.cc:16: Failure +Actual function call count doesn't match EXPECT_CALL(mock, F("c", HasSubstr("d")))... + Expected: to be called once + Actual: never called - unsatisfied and active +[ FAILED ] Foo.Bar +``` + +Suppose the bug is that the `"c"` in the third `EXPECT_CALL` is a typo +and should actually be `"a"`. With the above message, you should see +that the actual `F("a", "good")` call is matched by the first +`EXPECT_CALL`, not the third as you thought. From that it should be +obvious that the third `EXPECT_CALL` is written wrong. Case solved. + +## Running Tests in Emacs ## + +If you build and run your tests in Emacs, the source file locations of +Google Mock and [Google Test](../../googletest/) +errors will be highlighted. Just press `` on one of them and +you'll be taken to the offending line. Or, you can just type `C-x `` +to jump to the next error. + +To make it even easier, you can add the following lines to your +`~/.emacs` file: + +``` +(global-set-key "\M-m" 'compile) ; m is for make +(global-set-key [M-down] 'next-error) +(global-set-key [M-up] '(lambda () (interactive) (next-error -1))) +``` + +Then you can type `M-m` to start a build, or `M-up`/`M-down` to move +back and forth between errors. + +## Fusing Google Mock Source Files ## + +Google Mock's implementation consists of dozens of files (excluding +its own tests). Sometimes you may want them to be packaged up in +fewer files instead, such that you can easily copy them to a new +machine and start hacking there. For this we provide an experimental +Python script `fuse_gmock_files.py` in the `scripts/` directory +(starting with release 1.2.0). Assuming you have Python 2.4 or above +installed on your machine, just go to that directory and run +``` +python fuse_gmock_files.py OUTPUT_DIR +``` + +and you should see an `OUTPUT_DIR` directory being created with files +`gtest/gtest.h`, `gmock/gmock.h`, and `gmock-gtest-all.cc` in it. +These three files contain everything you need to use Google Mock (and +Google Test). Just copy them to anywhere you want and you are ready +to write tests and use mocks. You can use the +[scrpts/test/Makefile](../scripts/test/Makefile) file as an example on how to compile your tests +against them. + +# Extending Google Mock # + +## Writing New Matchers Quickly ## + +The `MATCHER*` family of macros can be used to define custom matchers +easily. The syntax: + +``` +MATCHER(name, description_string_expression) { statements; } +``` + +will define a matcher with the given name that executes the +statements, which must return a `bool` to indicate if the match +succeeds. Inside the statements, you can refer to the value being +matched by `arg`, and refer to its type by `arg_type`. + +The description string is a `string`-typed expression that documents +what the matcher does, and is used to generate the failure message +when the match fails. It can (and should) reference the special +`bool` variable `negation`, and should evaluate to the description of +the matcher when `negation` is `false`, or that of the matcher's +negation when `negation` is `true`. + +For convenience, we allow the description string to be empty (`""`), +in which case Google Mock will use the sequence of words in the +matcher name as the description. + +For example: +``` +MATCHER(IsDivisibleBy7, "") { return (arg % 7) == 0; } +``` +allows you to write +``` + // Expects mock_foo.Bar(n) to be called where n is divisible by 7. + EXPECT_CALL(mock_foo, Bar(IsDivisibleBy7())); +``` +or, +``` +using ::testing::Not; +... + EXPECT_THAT(some_expression, IsDivisibleBy7()); + EXPECT_THAT(some_other_expression, Not(IsDivisibleBy7())); +``` +If the above assertions fail, they will print something like: +``` + Value of: some_expression + Expected: is divisible by 7 + Actual: 27 +... + Value of: some_other_expression + Expected: not (is divisible by 7) + Actual: 21 +``` +where the descriptions `"is divisible by 7"` and `"not (is divisible +by 7)"` are automatically calculated from the matcher name +`IsDivisibleBy7`. + +As you may have noticed, the auto-generated descriptions (especially +those for the negation) may not be so great. You can always override +them with a string expression of your own: +``` +MATCHER(IsDivisibleBy7, std::string(negation ? "isn't" : "is") + + " divisible by 7") { + return (arg % 7) == 0; +} +``` + +Optionally, you can stream additional information to a hidden argument +named `result_listener` to explain the match result. For example, a +better definition of `IsDivisibleBy7` is: +``` +MATCHER(IsDivisibleBy7, "") { + if ((arg % 7) == 0) + return true; + + *result_listener << "the remainder is " << (arg % 7); + return false; +} +``` + +With this definition, the above assertion will give a better message: +``` + Value of: some_expression + Expected: is divisible by 7 + Actual: 27 (the remainder is 6) +``` + +You should let `MatchAndExplain()` print _any additional information_ +that can help a user understand the match result. Note that it should +explain why the match succeeds in case of a success (unless it's +obvious) - this is useful when the matcher is used inside +`Not()`. There is no need to print the argument value itself, as +Google Mock already prints it for you. + +**Notes:** + + 1. The type of the value being matched (`arg_type`) is determined by the context in which you use the matcher and is supplied to you by the compiler, so you don't need to worry about declaring it (nor can you). This allows the matcher to be polymorphic. For example, `IsDivisibleBy7()` can be used to match any type where the value of `(arg % 7) == 0` can be implicitly converted to a `bool`. In the `Bar(IsDivisibleBy7())` example above, if method `Bar()` takes an `int`, `arg_type` will be `int`; if it takes an `unsigned long`, `arg_type` will be `unsigned long`; and so on. + 1. Google Mock doesn't guarantee when or how many times a matcher will be invoked. Therefore the matcher logic must be _purely functional_ (i.e. it cannot have any side effect, and the result must not depend on anything other than the value being matched and the matcher parameters). This requirement must be satisfied no matter how you define the matcher (e.g. using one of the methods described in the following recipes). In particular, a matcher can never call a mock function, as that will affect the state of the mock object and Google Mock. + +## Writing New Parameterized Matchers Quickly ## + +Sometimes you'll want to define a matcher that has parameters. For that you +can use the macro: +``` +MATCHER_P(name, param_name, description_string) { statements; } +``` +where the description string can be either `""` or a string expression +that references `negation` and `param_name`. + +For example: +``` +MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; } +``` +will allow you to write: +``` + EXPECT_THAT(Blah("a"), HasAbsoluteValue(n)); +``` +which may lead to this message (assuming `n` is 10): +``` + Value of: Blah("a") + Expected: has absolute value 10 + Actual: -9 +``` + +Note that both the matcher description and its parameter are +printed, making the message human-friendly. + +In the matcher definition body, you can write `foo_type` to +reference the type of a parameter named `foo`. For example, in the +body of `MATCHER_P(HasAbsoluteValue, value)` above, you can write +`value_type` to refer to the type of `value`. + +Google Mock also provides `MATCHER_P2`, `MATCHER_P3`, ..., up to +`MATCHER_P10` to support multi-parameter matchers: +``` +MATCHER_Pk(name, param_1, ..., param_k, description_string) { statements; } +``` + +Please note that the custom description string is for a particular +**instance** of the matcher, where the parameters have been bound to +actual values. Therefore usually you'll want the parameter values to +be part of the description. Google Mock lets you do that by +referencing the matcher parameters in the description string +expression. + +For example, +``` + using ::testing::PrintToString; + MATCHER_P2(InClosedRange, low, hi, + std::string(negation ? "isn't" : "is") + " in range [" + + PrintToString(low) + ", " + PrintToString(hi) + "]") { + return low <= arg && arg <= hi; + } + ... + EXPECT_THAT(3, InClosedRange(4, 6)); +``` +would generate a failure that contains the message: +``` + Expected: is in range [4, 6] +``` + +If you specify `""` as the description, the failure message will +contain the sequence of words in the matcher name followed by the +parameter values printed as a tuple. For example, +``` + MATCHER_P2(InClosedRange, low, hi, "") { ... } + ... + EXPECT_THAT(3, InClosedRange(4, 6)); +``` +would generate a failure that contains the text: +``` + Expected: in closed range (4, 6) +``` + +For the purpose of typing, you can view +``` +MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... } +``` +as shorthand for +``` +template +FooMatcherPk +Foo(p1_type p1, ..., pk_type pk) { ... } +``` + +When you write `Foo(v1, ..., vk)`, the compiler infers the types of +the parameters `v1`, ..., and `vk` for you. If you are not happy with +the result of the type inference, you can specify the types by +explicitly instantiating the template, as in `Foo(5, false)`. +As said earlier, you don't get to (or need to) specify +`arg_type` as that's determined by the context in which the matcher +is used. + +You can assign the result of expression `Foo(p1, ..., pk)` to a +variable of type `FooMatcherPk`. This can be +useful when composing matchers. Matchers that don't have a parameter +or have only one parameter have special types: you can assign `Foo()` +to a `FooMatcher`-typed variable, and assign `Foo(p)` to a +`FooMatcherP`-typed variable. + +While you can instantiate a matcher template with reference types, +passing the parameters by pointer usually makes your code more +readable. If, however, you still want to pass a parameter by +reference, be aware that in the failure message generated by the +matcher you will see the value of the referenced object but not its +address. + +You can overload matchers with different numbers of parameters: +``` +MATCHER_P(Blah, a, description_string_1) { ... } +MATCHER_P2(Blah, a, b, description_string_2) { ... } +``` + +While it's tempting to always use the `MATCHER*` macros when defining +a new matcher, you should also consider implementing +`MatcherInterface` or using `MakePolymorphicMatcher()` instead (see +the recipes that follow), especially if you need to use the matcher a +lot. While these approaches require more work, they give you more +control on the types of the value being matched and the matcher +parameters, which in general leads to better compiler error messages +that pay off in the long run. They also allow overloading matchers +based on parameter types (as opposed to just based on the number of +parameters). + +## Writing New Monomorphic Matchers ## + +A matcher of argument type `T` implements +`::testing::MatcherInterface` and does two things: it tests whether a +value of type `T` matches the matcher, and can describe what kind of +values it matches. The latter ability is used for generating readable +error messages when expectations are violated. + +The interface looks like this: + +``` +class MatchResultListener { + public: + ... + // Streams x to the underlying ostream; does nothing if the ostream + // is NULL. + template + MatchResultListener& operator<<(const T& x); + + // Returns the underlying ostream. + ::std::ostream* stream(); +}; + +template +class MatcherInterface { + public: + virtual ~MatcherInterface(); + + // Returns true iff the matcher matches x; also explains the match + // result to 'listener'. + virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = 0; + + // Describes this matcher to an ostream. + virtual void DescribeTo(::std::ostream* os) const = 0; + + // Describes the negation of this matcher to an ostream. + virtual void DescribeNegationTo(::std::ostream* os) const; +}; +``` + +If you need a custom matcher but `Truly()` is not a good option (for +example, you may not be happy with the way `Truly(predicate)` +describes itself, or you may want your matcher to be polymorphic as +`Eq(value)` is), you can define a matcher to do whatever you want in +two steps: first implement the matcher interface, and then define a +factory function to create a matcher instance. The second step is not +strictly needed but it makes the syntax of using the matcher nicer. + +For example, you can define a matcher to test whether an `int` is +divisible by 7 and then use it like this: +``` +using ::testing::MakeMatcher; +using ::testing::Matcher; +using ::testing::MatcherInterface; +using ::testing::MatchResultListener; + +class DivisibleBy7Matcher : public MatcherInterface { + public: + virtual bool MatchAndExplain(int n, MatchResultListener* listener) const { + return (n % 7) == 0; + } + + virtual void DescribeTo(::std::ostream* os) const { + *os << "is divisible by 7"; + } + + virtual void DescribeNegationTo(::std::ostream* os) const { + *os << "is not divisible by 7"; + } +}; + +inline Matcher DivisibleBy7() { + return MakeMatcher(new DivisibleBy7Matcher); +} +... + + EXPECT_CALL(foo, Bar(DivisibleBy7())); +``` + +You may improve the matcher message by streaming additional +information to the `listener` argument in `MatchAndExplain()`: + +``` +class DivisibleBy7Matcher : public MatcherInterface { + public: + virtual bool MatchAndExplain(int n, + MatchResultListener* listener) const { + const int remainder = n % 7; + if (remainder != 0) { + *listener << "the remainder is " << remainder; + } + return remainder == 0; + } + ... +}; +``` + +Then, `EXPECT_THAT(x, DivisibleBy7());` may general a message like this: +``` +Value of: x +Expected: is divisible by 7 + Actual: 23 (the remainder is 2) +``` + +## Writing New Polymorphic Matchers ## + +You've learned how to write your own matchers in the previous +recipe. Just one problem: a matcher created using `MakeMatcher()` only +works for one particular type of arguments. If you want a +_polymorphic_ matcher that works with arguments of several types (for +instance, `Eq(x)` can be used to match a `value` as long as `value` == +`x` compiles -- `value` and `x` don't have to share the same type), +you can learn the trick from `"gmock/gmock-matchers.h"` but it's a bit +involved. + +Fortunately, most of the time you can define a polymorphic matcher +easily with the help of `MakePolymorphicMatcher()`. Here's how you can +define `NotNull()` as an example: + +``` +using ::testing::MakePolymorphicMatcher; +using ::testing::MatchResultListener; +using ::testing::NotNull; +using ::testing::PolymorphicMatcher; + +class NotNullMatcher { + public: + // To implement a polymorphic matcher, first define a COPYABLE class + // that has three members MatchAndExplain(), DescribeTo(), and + // DescribeNegationTo(), like the following. + + // In this example, we want to use NotNull() with any pointer, so + // MatchAndExplain() accepts a pointer of any type as its first argument. + // In general, you can define MatchAndExplain() as an ordinary method or + // a method template, or even overload it. + template + bool MatchAndExplain(T* p, + MatchResultListener* /* listener */) const { + return p != NULL; + } + + // Describes the property of a value matching this matcher. + void DescribeTo(::std::ostream* os) const { *os << "is not NULL"; } + + // Describes the property of a value NOT matching this matcher. + void DescribeNegationTo(::std::ostream* os) const { *os << "is NULL"; } +}; + +// To construct a polymorphic matcher, pass an instance of the class +// to MakePolymorphicMatcher(). Note the return type. +inline PolymorphicMatcher NotNull() { + return MakePolymorphicMatcher(NotNullMatcher()); +} +... + + EXPECT_CALL(foo, Bar(NotNull())); // The argument must be a non-NULL pointer. +``` + +**Note:** Your polymorphic matcher class does **not** need to inherit from +`MatcherInterface` or any other class, and its methods do **not** need +to be virtual. + +Like in a monomorphic matcher, you may explain the match result by +streaming additional information to the `listener` argument in +`MatchAndExplain()`. + +## Writing New Cardinalities ## + +A cardinality is used in `Times()` to tell Google Mock how many times +you expect a call to occur. It doesn't have to be exact. For example, +you can say `AtLeast(5)` or `Between(2, 4)`. + +If the built-in set of cardinalities doesn't suit you, you are free to +define your own by implementing the following interface (in namespace +`testing`): + +``` +class CardinalityInterface { + public: + virtual ~CardinalityInterface(); + + // Returns true iff call_count calls will satisfy this cardinality. + virtual bool IsSatisfiedByCallCount(int call_count) const = 0; + + // Returns true iff call_count calls will saturate this cardinality. + virtual bool IsSaturatedByCallCount(int call_count) const = 0; + + // Describes self to an ostream. + virtual void DescribeTo(::std::ostream* os) const = 0; +}; +``` + +For example, to specify that a call must occur even number of times, +you can write + +``` +using ::testing::Cardinality; +using ::testing::CardinalityInterface; +using ::testing::MakeCardinality; + +class EvenNumberCardinality : public CardinalityInterface { + public: + virtual bool IsSatisfiedByCallCount(int call_count) const { + return (call_count % 2) == 0; + } + + virtual bool IsSaturatedByCallCount(int call_count) const { + return false; + } + + virtual void DescribeTo(::std::ostream* os) const { + *os << "called even number of times"; + } +}; + +Cardinality EvenNumber() { + return MakeCardinality(new EvenNumberCardinality); +} +... + + EXPECT_CALL(foo, Bar(3)) + .Times(EvenNumber()); +``` + +## Writing New Actions Quickly ## + +If the built-in actions don't work for you, and you find it +inconvenient to use `Invoke()`, you can use a macro from the `ACTION*` +family to quickly define a new action that can be used in your code as +if it's a built-in action. + +By writing +``` +ACTION(name) { statements; } +``` +in a namespace scope (i.e. not inside a class or function), you will +define an action with the given name that executes the statements. +The value returned by `statements` will be used as the return value of +the action. Inside the statements, you can refer to the K-th +(0-based) argument of the mock function as `argK`. For example: +``` +ACTION(IncrementArg1) { return ++(*arg1); } +``` +allows you to write +``` +... WillOnce(IncrementArg1()); +``` + +Note that you don't need to specify the types of the mock function +arguments. Rest assured that your code is type-safe though: +you'll get a compiler error if `*arg1` doesn't support the `++` +operator, or if the type of `++(*arg1)` isn't compatible with the mock +function's return type. + +Another example: +``` +ACTION(Foo) { + (*arg2)(5); + Blah(); + *arg1 = 0; + return arg0; +} +``` +defines an action `Foo()` that invokes argument #2 (a function pointer) +with 5, calls function `Blah()`, sets the value pointed to by argument +#1 to 0, and returns argument #0. + +For more convenience and flexibility, you can also use the following +pre-defined symbols in the body of `ACTION`: + +| `argK_type` | The type of the K-th (0-based) argument of the mock function | +|:------------|:-------------------------------------------------------------| +| `args` | All arguments of the mock function as a tuple | +| `args_type` | The type of all arguments of the mock function as a tuple | +| `return_type` | The return type of the mock function | +| `function_type` | The type of the mock function | + +For example, when using an `ACTION` as a stub action for mock function: +``` +int DoSomething(bool flag, int* ptr); +``` +we have: + +| **Pre-defined Symbol** | **Is Bound To** | +|:-----------------------|:----------------| +| `arg0` | the value of `flag` | +| `arg0_type` | the type `bool` | +| `arg1` | the value of `ptr` | +| `arg1_type` | the type `int*` | +| `args` | the tuple `(flag, ptr)` | +| `args_type` | the type `::testing::tuple` | +| `return_type` | the type `int` | +| `function_type` | the type `int(bool, int*)` | + +## Writing New Parameterized Actions Quickly ## + +Sometimes you'll want to parameterize an action you define. For that +we have another macro +``` +ACTION_P(name, param) { statements; } +``` + +For example, +``` +ACTION_P(Add, n) { return arg0 + n; } +``` +will allow you to write +``` +// Returns argument #0 + 5. +... WillOnce(Add(5)); +``` + +For convenience, we use the term _arguments_ for the values used to +invoke the mock function, and the term _parameters_ for the values +used to instantiate an action. + +Note that you don't need to provide the type of the parameter either. +Suppose the parameter is named `param`, you can also use the +Google-Mock-defined symbol `param_type` to refer to the type of the +parameter as inferred by the compiler. For example, in the body of +`ACTION_P(Add, n)` above, you can write `n_type` for the type of `n`. + +Google Mock also provides `ACTION_P2`, `ACTION_P3`, and etc to support +multi-parameter actions. For example, +``` +ACTION_P2(ReturnDistanceTo, x, y) { + double dx = arg0 - x; + double dy = arg1 - y; + return sqrt(dx*dx + dy*dy); +} +``` +lets you write +``` +... WillOnce(ReturnDistanceTo(5.0, 26.5)); +``` + +You can view `ACTION` as a degenerated parameterized action where the +number of parameters is 0. + +You can also easily define actions overloaded on the number of parameters: +``` +ACTION_P(Plus, a) { ... } +ACTION_P2(Plus, a, b) { ... } +``` + +## Restricting the Type of an Argument or Parameter in an ACTION ## + +For maximum brevity and reusability, the `ACTION*` macros don't ask +you to provide the types of the mock function arguments and the action +parameters. Instead, we let the compiler infer the types for us. + +Sometimes, however, we may want to be more explicit about the types. +There are several tricks to do that. For example: +``` +ACTION(Foo) { + // Makes sure arg0 can be converted to int. + int n = arg0; + ... use n instead of arg0 here ... +} + +ACTION_P(Bar, param) { + // Makes sure the type of arg1 is const char*. + ::testing::StaticAssertTypeEq(); + + // Makes sure param can be converted to bool. + bool flag = param; +} +``` +where `StaticAssertTypeEq` is a compile-time assertion in Google Test +that verifies two types are the same. + +## Writing New Action Templates Quickly ## + +Sometimes you want to give an action explicit template parameters that +cannot be inferred from its value parameters. `ACTION_TEMPLATE()` +supports that and can be viewed as an extension to `ACTION()` and +`ACTION_P*()`. + +The syntax: +``` +ACTION_TEMPLATE(ActionName, + HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m), + AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; } +``` + +defines an action template that takes _m_ explicit template parameters +and _n_ value parameters, where _m_ is between 1 and 10, and _n_ is +between 0 and 10. `name_i` is the name of the i-th template +parameter, and `kind_i` specifies whether it's a `typename`, an +integral constant, or a template. `p_i` is the name of the i-th value +parameter. + +Example: +``` +// DuplicateArg(output) converts the k-th argument of the mock +// function to type T and copies it to *output. +ACTION_TEMPLATE(DuplicateArg, + // Note the comma between int and k: + HAS_2_TEMPLATE_PARAMS(int, k, typename, T), + AND_1_VALUE_PARAMS(output)) { + *output = T(::testing::get(args)); +} +``` + +To create an instance of an action template, write: +``` + ActionName(v1, ..., v_n) +``` +where the `t`s are the template arguments and the +`v`s are the value arguments. The value argument +types are inferred by the compiler. For example: +``` +using ::testing::_; +... + int n; + EXPECT_CALL(mock, Foo(_, _)) + .WillOnce(DuplicateArg<1, unsigned char>(&n)); +``` + +If you want to explicitly specify the value argument types, you can +provide additional template arguments: +``` + ActionName(v1, ..., v_n) +``` +where `u_i` is the desired type of `v_i`. + +`ACTION_TEMPLATE` and `ACTION`/`ACTION_P*` can be overloaded on the +number of value parameters, but not on the number of template +parameters. Without the restriction, the meaning of the following is +unclear: + +``` + OverloadedAction(x); +``` + +Are we using a single-template-parameter action where `bool` refers to +the type of `x`, or a two-template-parameter action where the compiler +is asked to infer the type of `x`? + +## Using the ACTION Object's Type ## + +If you are writing a function that returns an `ACTION` object, you'll +need to know its type. The type depends on the macro used to define +the action and the parameter types. The rule is relatively simple: + +| **Given Definition** | **Expression** | **Has Type** | +|:---------------------|:---------------|:-------------| +| `ACTION(Foo)` | `Foo()` | `FooAction` | +| `ACTION_TEMPLATE(Foo, HAS_m_TEMPLATE_PARAMS(...), AND_0_VALUE_PARAMS())` | `Foo()` | `FooAction` | +| `ACTION_P(Bar, param)` | `Bar(int_value)` | `BarActionP` | +| `ACTION_TEMPLATE(Bar, HAS_m_TEMPLATE_PARAMS(...), AND_1_VALUE_PARAMS(p1))` | `Bar(int_value)` | `FooActionP` | +| `ACTION_P2(Baz, p1, p2)` | `Baz(bool_value, int_value)` | `BazActionP2` | +| `ACTION_TEMPLATE(Baz, HAS_m_TEMPLATE_PARAMS(...), AND_2_VALUE_PARAMS(p1, p2))`| `Baz(bool_value, int_value)` | `FooActionP2` | +| ... | ... | ... | + +Note that we have to pick different suffixes (`Action`, `ActionP`, +`ActionP2`, and etc) for actions with different numbers of value +parameters, or the action definitions cannot be overloaded on the +number of them. + +## Writing New Monomorphic Actions ## + +While the `ACTION*` macros are very convenient, sometimes they are +inappropriate. For example, despite the tricks shown in the previous +recipes, they don't let you directly specify the types of the mock +function arguments and the action parameters, which in general leads +to unoptimized compiler error messages that can baffle unfamiliar +users. They also don't allow overloading actions based on parameter +types without jumping through some hoops. + +An alternative to the `ACTION*` macros is to implement +`::testing::ActionInterface`, where `F` is the type of the mock +function in which the action will be used. For example: + +``` +template class ActionInterface { + public: + virtual ~ActionInterface(); + + // Performs the action. Result is the return type of function type + // F, and ArgumentTuple is the tuple of arguments of F. + // + // For example, if F is int(bool, const string&), then Result would + // be int, and ArgumentTuple would be ::testing::tuple. + virtual Result Perform(const ArgumentTuple& args) = 0; +}; + +using ::testing::_; +using ::testing::Action; +using ::testing::ActionInterface; +using ::testing::MakeAction; + +typedef int IncrementMethod(int*); + +class IncrementArgumentAction : public ActionInterface { + public: + virtual int Perform(const ::testing::tuple& args) { + int* p = ::testing::get<0>(args); // Grabs the first argument. + return *p++; + } +}; + +Action IncrementArgument() { + return MakeAction(new IncrementArgumentAction); +} +... + + EXPECT_CALL(foo, Baz(_)) + .WillOnce(IncrementArgument()); + + int n = 5; + foo.Baz(&n); // Should return 5 and change n to 6. +``` + +## Writing New Polymorphic Actions ## + +The previous recipe showed you how to define your own action. This is +all good, except that you need to know the type of the function in +which the action will be used. Sometimes that can be a problem. For +example, if you want to use the action in functions with _different_ +types (e.g. like `Return()` and `SetArgPointee()`). + +If an action can be used in several types of mock functions, we say +it's _polymorphic_. The `MakePolymorphicAction()` function template +makes it easy to define such an action: + +``` +namespace testing { + +template +PolymorphicAction MakePolymorphicAction(const Impl& impl); + +} // namespace testing +``` + +As an example, let's define an action that returns the second argument +in the mock function's argument list. The first step is to define an +implementation class: + +``` +class ReturnSecondArgumentAction { + public: + template + Result Perform(const ArgumentTuple& args) const { + // To get the i-th (0-based) argument, use ::testing::get(args). + return ::testing::get<1>(args); + } +}; +``` + +This implementation class does _not_ need to inherit from any +particular class. What matters is that it must have a `Perform()` +method template. This method template takes the mock function's +arguments as a tuple in a **single** argument, and returns the result of +the action. It can be either `const` or not, but must be invokable +with exactly one template argument, which is the result type. In other +words, you must be able to call `Perform(args)` where `R` is the +mock function's return type and `args` is its arguments in a tuple. + +Next, we use `MakePolymorphicAction()` to turn an instance of the +implementation class into the polymorphic action we need. It will be +convenient to have a wrapper for this: + +``` +using ::testing::MakePolymorphicAction; +using ::testing::PolymorphicAction; + +PolymorphicAction ReturnSecondArgument() { + return MakePolymorphicAction(ReturnSecondArgumentAction()); +} +``` + +Now, you can use this polymorphic action the same way you use the +built-in ones: + +``` +using ::testing::_; + +class MockFoo : public Foo { + public: + MOCK_METHOD2(DoThis, int(bool flag, int n)); + MOCK_METHOD3(DoThat, string(int x, const char* str1, const char* str2)); +}; +... + + MockFoo foo; + EXPECT_CALL(foo, DoThis(_, _)) + .WillOnce(ReturnSecondArgument()); + EXPECT_CALL(foo, DoThat(_, _, _)) + .WillOnce(ReturnSecondArgument()); + ... + foo.DoThis(true, 5); // Will return 5. + foo.DoThat(1, "Hi", "Bye"); // Will return "Hi". +``` + +## Teaching Google Mock How to Print Your Values ## + +When an uninteresting or unexpected call occurs, Google Mock prints the +argument values and the stack trace to help you debug. Assertion +macros like `EXPECT_THAT` and `EXPECT_EQ` also print the values in +question when the assertion fails. Google Mock and Google Test do this using +Google Test's user-extensible value printer. + +This printer knows how to print built-in C++ types, native arrays, STL +containers, and any type that supports the `<<` operator. For other +types, it prints the raw bytes in the value and hopes that you the +user can figure it out. +[Google Test's advanced guide](../../googletest/docs/AdvancedGuide.md#teaching-google-test-how-to-print-your-values) +explains how to extend the printer to do a better job at +printing your particular type than to dump the bytes. diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/docs/DesignDoc.md vulkan-1.1.73+dfsg/submodules/googletest/googlemock/docs/DesignDoc.md --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/docs/DesignDoc.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/docs/DesignDoc.md 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,280 @@ +This page discusses the design of new Google Mock features. + + + +# Macros for Defining Actions # + +## Problem ## + +Due to the lack of closures in C++, it currently requires some +non-trivial effort to define a custom action in Google Mock. For +example, suppose you want to "increment the value pointed to by the +second argument of the mock function and return it", you could write: + +``` +int IncrementArg1(Unused, int* p, Unused) { + return ++(*p); +} + +... WillOnce(Invoke(IncrementArg1)); +``` + +There are several things unsatisfactory about this approach: + + * Even though the action only cares about the second argument of the mock function, its definition needs to list other arguments as dummies. This is tedious. + * The defined action is usable only in mock functions that takes exactly 3 arguments - an unnecessary restriction. + * To use the action, one has to say `Invoke(IncrementArg1)`, which isn't as nice as `IncrementArg1()`. + +The latter two problems can be overcome using `MakePolymorphicAction()`, +but it requires much more boilerplate code: + +``` +class IncrementArg1Action { + public: + template + Result Perform(const ArgumentTuple& args) const { + return ++(*tr1::get<1>(args)); + } +}; + +PolymorphicAction IncrementArg1() { + return MakePolymorphicAction(IncrementArg1Action()); +} + +... WillOnce(IncrementArg1()); +``` + +Our goal is to allow defining custom actions with the least amount of +boiler-plate C++ requires. + +## Solution ## + +We propose to introduce a new macro: +``` +ACTION(name) { statements; } +``` + +Using this in a namespace scope will define an action with the given +name that executes the statements. Inside the statements, you can +refer to the K-th (0-based) argument of the mock function as `argK`. +For example: +``` +ACTION(IncrementArg1) { return ++(*arg1); } +``` +allows you to write +``` +... WillOnce(IncrementArg1()); +``` + +Note that you don't need to specify the types of the mock function +arguments, as brevity is a top design goal here. Rest assured that +your code is still type-safe though: you'll get a compiler error if +`*arg1` doesn't support the `++` operator, or if the type of +`++(*arg1)` isn't compatible with the mock function's return type. + +Another example: +``` +ACTION(Foo) { + (*arg2)(5); + Blah(); + *arg1 = 0; + return arg0; +} +``` +defines an action `Foo()` that invokes argument #2 (a function pointer) +with 5, calls function `Blah()`, sets the value pointed to by argument +#1 to 0, and returns argument #0. + +For more convenience and flexibility, you can also use the following +pre-defined symbols in the body of `ACTION`: + +| `argK_type` | The type of the K-th (0-based) argument of the mock function | +|:------------|:-------------------------------------------------------------| +| `args` | All arguments of the mock function as a tuple | +| `args_type` | The type of all arguments of the mock function as a tuple | +| `return_type` | The return type of the mock function | +| `function_type` | The type of the mock function | + +For example, when using an `ACTION` as a stub action for mock function: +``` +int DoSomething(bool flag, int* ptr); +``` +we have: +| **Pre-defined Symbol** | **Is Bound To** | +|:-----------------------|:----------------| +| `arg0` | the value of `flag` | +| `arg0_type` | the type `bool` | +| `arg1` | the value of `ptr` | +| `arg1_type` | the type `int*` | +| `args` | the tuple `(flag, ptr)` | +| `args_type` | the type `std::tr1::tuple` | +| `return_type` | the type `int` | +| `function_type` | the type `int(bool, int*)` | + +## Parameterized actions ## + +Sometimes you'll want to parameterize the action. For that we propose +another macro +``` +ACTION_P(name, param) { statements; } +``` + +For example, +``` +ACTION_P(Add, n) { return arg0 + n; } +``` +will allow you to write +``` +// Returns argument #0 + 5. +... WillOnce(Add(5)); +``` + +For convenience, we use the term _arguments_ for the values used to +invoke the mock function, and the term _parameters_ for the values +used to instantiate an action. + +Note that you don't need to provide the type of the parameter either. +Suppose the parameter is named `param`, you can also use the +Google-Mock-defined symbol `param_type` to refer to the type of the +parameter as inferred by the compiler. + +We will also provide `ACTION_P2`, `ACTION_P3`, and etc to support +multi-parameter actions. For example, +``` +ACTION_P2(ReturnDistanceTo, x, y) { + double dx = arg0 - x; + double dy = arg1 - y; + return sqrt(dx*dx + dy*dy); +} +``` +lets you write +``` +... WillOnce(ReturnDistanceTo(5.0, 26.5)); +``` + +You can view `ACTION` as a degenerated parameterized action where the +number of parameters is 0. + +## Advanced Usages ## + +### Overloading Actions ### + +You can easily define actions overloaded on the number of parameters: +``` +ACTION_P(Plus, a) { ... } +ACTION_P2(Plus, a, b) { ... } +``` + +### Restricting the Type of an Argument or Parameter ### + +For maximum brevity and reusability, the `ACTION*` macros don't let +you specify the types of the mock function arguments and the action +parameters. Instead, we let the compiler infer the types for us. + +Sometimes, however, we may want to be more explicit about the types. +There are several tricks to do that. For example: +``` +ACTION(Foo) { + // Makes sure arg0 can be converted to int. + int n = arg0; + ... use n instead of arg0 here ... +} + +ACTION_P(Bar, param) { + // Makes sure the type of arg1 is const char*. + ::testing::StaticAssertTypeEq(); + + // Makes sure param can be converted to bool. + bool flag = param; +} +``` +where `StaticAssertTypeEq` is a compile-time assertion we plan to add to +Google Test (the name is chosen to match `static_assert` in C++0x). + +### Using the ACTION Object's Type ### + +If you are writing a function that returns an `ACTION` object, you'll +need to know its type. The type depends on the macro used to define +the action and the parameter types. The rule is relatively simple: +| **Given Definition** | **Expression** | **Has Type** | +|:---------------------|:---------------|:-------------| +| `ACTION(Foo)` | `Foo()` | `FooAction` | +| `ACTION_P(Bar, param)` | `Bar(int_value)` | `BarActionP` | +| `ACTION_P2(Baz, p1, p2)` | `Baz(bool_value, int_value)` | `BazActionP2` | +| ... | ... | ... | + +Note that we have to pick different suffixes (`Action`, `ActionP`, +`ActionP2`, and etc) for actions with different numbers of parameters, +or the action definitions cannot be overloaded on the number of +parameters. + +## When to Use ## + +While the new macros are very convenient, please also consider other +means of implementing actions (e.g. via `ActionInterface` or +`MakePolymorphicAction()`), especially if you need to use the defined +action a lot. While the other approaches require more work, they give +you more control on the types of the mock function arguments and the +action parameters, which in general leads to better compiler error +messages that pay off in the long run. They also allow overloading +actions based on parameter types, as opposed to just the number of +parameters. + +## Related Work ## + +As you may have realized, the `ACTION*` macros resemble closures (also +known as lambda expressions or anonymous functions). Indeed, both of +them seek to lower the syntactic overhead for defining a function. + +C++0x will support lambdas, but they are not part of C++ right now. +Some non-standard libraries (most notably BLL or Boost Lambda Library) +try to alleviate this problem. However, they are not a good choice +for defining actions as: + + * They are non-standard and not widely installed. Google Mock only depends on standard libraries and `tr1::tuple`, which is part of the new C++ standard and comes with gcc 4+. We want to keep it that way. + * They are not trivial to learn. + * They will become obsolete when C++0x's lambda feature is widely supported. We don't want to make our users use a dying library. + * Since they are based on operators, they are rather ad hoc: you cannot use statements, and you cannot pass the lambda arguments to a function, for example. + * They have subtle semantics that easily confuses new users. For example, in expression `_1++ + foo++`, `foo` will be incremented only once where the expression is evaluated, while `_1` will be incremented every time the unnamed function is invoked. This is far from intuitive. + +`ACTION*` avoid all these problems. + +## Future Improvements ## + +There may be a need for composing `ACTION*` definitions (i.e. invoking +another `ACTION` inside the definition of one `ACTION*`). We are not +sure we want it yet, as one can get a similar effect by putting +`ACTION` definitions in function templates and composing the function +templates. We'll revisit this based on user feedback. + +The reason we don't allow `ACTION*()` inside a function body is that +the current C++ standard doesn't allow function-local types to be used +to instantiate templates. The upcoming C++0x standard will lift this +restriction. Once this feature is widely supported by compilers, we +can revisit the implementation and add support for using `ACTION*()` +inside a function. + +C++0x will also support lambda expressions. When they become +available, we may want to support using lambdas as actions. + +# Macros for Defining Matchers # + +Once the macros for defining actions are implemented, we plan to do +the same for matchers: + +``` +MATCHER(name) { statements; } +``` + +where you can refer to the value being matched as `arg`. For example, +given: + +``` +MATCHER(IsPositive) { return arg > 0; } +``` + +you can use `IsPositive()` as a matcher that matches a value iff it is +greater than 0. + +We will also add `MATCHER_P`, `MATCHER_P2`, and etc for parameterized +matchers. \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/docs/Documentation.md vulkan-1.1.73+dfsg/submodules/googletest/googlemock/docs/Documentation.md --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/docs/Documentation.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/docs/Documentation.md 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,15 @@ +This page lists all documentation markdown files for Google Mock **(the +current git version)** +-- **if you use a former version of Google Mock, please read the +documentation for that specific version instead (e.g. by checking out +the respective git branch/tag).** + + * [ForDummies](ForDummies.md) -- start here if you are new to Google Mock. + * [CheatSheet](CheatSheet.md) -- a quick reference. + * [CookBook](CookBook.md) -- recipes for doing various tasks using Google Mock. + * [FrequentlyAskedQuestions](FrequentlyAskedQuestions.md) -- check here before asking a question on the mailing list. + +To contribute code to Google Mock, read: + + * [CONTRIBUTING](../CONTRIBUTING.md) -- read this _before_ writing your first patch. + * [Pump Manual](../../googletest/docs/PumpManual.md) -- how we generate some of Google Mock's source files. diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/docs/ForDummies.md vulkan-1.1.73+dfsg/submodules/googletest/googlemock/docs/ForDummies.md --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/docs/ForDummies.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/docs/ForDummies.md 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,447 @@ + + +(**Note:** If you get compiler errors that you don't understand, be sure to consult [Google Mock Doctor](FrequentlyAskedQuestions.md#how-am-i-supposed-to-make-sense-of-these-horrible-template-errors).) + +# What Is Google C++ Mocking Framework? # +When you write a prototype or test, often it's not feasible or wise to rely on real objects entirely. A **mock object** implements the same interface as a real object (so it can be used as one), but lets you specify at run time how it will be used and what it should do (which methods will be called? in which order? how many times? with what arguments? what will they return? etc). + +**Note:** It is easy to confuse the term _fake objects_ with mock objects. Fakes and mocks actually mean very different things in the Test-Driven Development (TDD) community: + + * **Fake** objects have working implementations, but usually take some shortcut (perhaps to make the operations less expensive), which makes them not suitable for production. An in-memory file system would be an example of a fake. + * **Mocks** are objects pre-programmed with _expectations_, which form a specification of the calls they are expected to receive. + +If all this seems too abstract for you, don't worry - the most important thing to remember is that a mock allows you to check the _interaction_ between itself and code that uses it. The difference between fakes and mocks will become much clearer once you start to use mocks. + +**Google C++ Mocking Framework** (or **Google Mock** for short) is a library (sometimes we also call it a "framework" to make it sound cool) for creating mock classes and using them. It does to C++ what [jMock](http://www.jmock.org/) and [EasyMock](http://www.easymock.org/) do to Java. + +Using Google Mock involves three basic steps: + + 1. Use some simple macros to describe the interface you want to mock, and they will expand to the implementation of your mock class; + 1. Create some mock objects and specify its expectations and behavior using an intuitive syntax; + 1. Exercise code that uses the mock objects. Google Mock will catch any violation of the expectations as soon as it arises. + +# Why Google Mock? # +While mock objects help you remove unnecessary dependencies in tests and make them fast and reliable, using mocks manually in C++ is _hard_: + + * Someone has to implement the mocks. The job is usually tedious and error-prone. No wonder people go great distances to avoid it. + * The quality of those manually written mocks is a bit, uh, unpredictable. You may see some really polished ones, but you may also see some that were hacked up in a hurry and have all sorts of ad-hoc restrictions. + * The knowledge you gained from using one mock doesn't transfer to the next. + +In contrast, Java and Python programmers have some fine mock frameworks, which automate the creation of mocks. As a result, mocking is a proven effective technique and widely adopted practice in those communities. Having the right tool absolutely makes the difference. + +Google Mock was built to help C++ programmers. It was inspired by [jMock](http://www.jmock.org/) and [EasyMock](http://www.easymock.org/), but designed with C++'s specifics in mind. It is your friend if any of the following problems is bothering you: + + * You are stuck with a sub-optimal design and wish you had done more prototyping before it was too late, but prototyping in C++ is by no means "rapid". + * Your tests are slow as they depend on too many libraries or use expensive resources (e.g. a database). + * Your tests are brittle as some resources they use are unreliable (e.g. the network). + * You want to test how your code handles a failure (e.g. a file checksum error), but it's not easy to cause one. + * You need to make sure that your module interacts with other modules in the right way, but it's hard to observe the interaction; therefore you resort to observing the side effects at the end of the action, which is awkward at best. + * You want to "mock out" your dependencies, except that they don't have mock implementations yet; and, frankly, you aren't thrilled by some of those hand-written mocks. + +We encourage you to use Google Mock as: + + * a _design_ tool, for it lets you experiment with your interface design early and often. More iterations lead to better designs! + * a _testing_ tool to cut your tests' outbound dependencies and probe the interaction between your module and its collaborators. + +# Getting Started # +Using Google Mock is easy! Inside your C++ source file, just `#include` `"gtest/gtest.h"` and `"gmock/gmock.h"`, and you are ready to go. + +# A Case for Mock Turtles # +Let's look at an example. Suppose you are developing a graphics program that relies on a LOGO-like API for drawing. How would you test that it does the right thing? Well, you can run it and compare the screen with a golden screen snapshot, but let's admit it: tests like this are expensive to run and fragile (What if you just upgraded to a shiny new graphics card that has better anti-aliasing? Suddenly you have to update all your golden images.). It would be too painful if all your tests are like this. Fortunately, you learned about Dependency Injection and know the right thing to do: instead of having your application talk to the drawing API directly, wrap the API in an interface (say, `Turtle`) and code to that interface: + +``` +class Turtle { + ... + virtual ~Turtle() {} + virtual void PenUp() = 0; + virtual void PenDown() = 0; + virtual void Forward(int distance) = 0; + virtual void Turn(int degrees) = 0; + virtual void GoTo(int x, int y) = 0; + virtual int GetX() const = 0; + virtual int GetY() const = 0; +}; +``` + +(Note that the destructor of `Turtle` **must** be virtual, as is the case for **all** classes you intend to inherit from - otherwise the destructor of the derived class will not be called when you delete an object through a base pointer, and you'll get corrupted program states like memory leaks.) + +You can control whether the turtle's movement will leave a trace using `PenUp()` and `PenDown()`, and control its movement using `Forward()`, `Turn()`, and `GoTo()`. Finally, `GetX()` and `GetY()` tell you the current position of the turtle. + +Your program will normally use a real implementation of this interface. In tests, you can use a mock implementation instead. This allows you to easily check what drawing primitives your program is calling, with what arguments, and in which order. Tests written this way are much more robust (they won't break because your new machine does anti-aliasing differently), easier to read and maintain (the intent of a test is expressed in the code, not in some binary images), and run _much, much faster_. + +# Writing the Mock Class # +If you are lucky, the mocks you need to use have already been implemented by some nice people. If, however, you find yourself in the position to write a mock class, relax - Google Mock turns this task into a fun game! (Well, almost.) + +## How to Define It ## +Using the `Turtle` interface as example, here are the simple steps you need to follow: + + 1. Derive a class `MockTurtle` from `Turtle`. + 1. Take a _virtual_ function of `Turtle` (while it's possible to [mock non-virtual methods using templates](CookBook.md#mocking-nonvirtual-methods), it's much more involved). Count how many arguments it has. + 1. In the `public:` section of the child class, write `MOCK_METHODn();` (or `MOCK_CONST_METHODn();` if you are mocking a `const` method), where `n` is the number of the arguments; if you counted wrong, shame on you, and a compiler error will tell you so. + 1. Now comes the fun part: you take the function signature, cut-and-paste the _function name_ as the _first_ argument to the macro, and leave what's left as the _second_ argument (in case you're curious, this is the _type of the function_). + 1. Repeat until all virtual functions you want to mock are done. + +After the process, you should have something like: + +``` +#include "gmock/gmock.h" // Brings in Google Mock. +class MockTurtle : public Turtle { + public: + ... + MOCK_METHOD0(PenUp, void()); + MOCK_METHOD0(PenDown, void()); + MOCK_METHOD1(Forward, void(int distance)); + MOCK_METHOD1(Turn, void(int degrees)); + MOCK_METHOD2(GoTo, void(int x, int y)); + MOCK_CONST_METHOD0(GetX, int()); + MOCK_CONST_METHOD0(GetY, int()); +}; +``` + +You don't need to define these mock methods somewhere else - the `MOCK_METHOD*` macros will generate the definitions for you. It's that simple! Once you get the hang of it, you can pump out mock classes faster than your source-control system can handle your check-ins. + +**Tip:** If even this is too much work for you, you'll find the +`gmock_gen.py` tool in Google Mock's `scripts/generator/` directory (courtesy of the [cppclean](http://code.google.com/p/cppclean/) project) useful. This command-line +tool requires that you have Python 2.4 installed. You give it a C++ file and the name of an abstract class defined in it, +and it will print the definition of the mock class for you. Due to the +complexity of the C++ language, this script may not always work, but +it can be quite handy when it does. For more details, read the [user documentation](../scripts/generator/README). + +## Where to Put It ## +When you define a mock class, you need to decide where to put its definition. Some people put it in a `*_test.cc`. This is fine when the interface being mocked (say, `Foo`) is owned by the same person or team. Otherwise, when the owner of `Foo` changes it, your test could break. (You can't really expect `Foo`'s maintainer to fix every test that uses `Foo`, can you?) + +So, the rule of thumb is: if you need to mock `Foo` and it's owned by others, define the mock class in `Foo`'s package (better, in a `testing` sub-package such that you can clearly separate production code and testing utilities), and put it in a `mock_foo.h`. Then everyone can reference `mock_foo.h` from their tests. If `Foo` ever changes, there is only one copy of `MockFoo` to change, and only tests that depend on the changed methods need to be fixed. + +Another way to do it: you can introduce a thin layer `FooAdaptor` on top of `Foo` and code to this new interface. Since you own `FooAdaptor`, you can absorb changes in `Foo` much more easily. While this is more work initially, carefully choosing the adaptor interface can make your code easier to write and more readable (a net win in the long run), as you can choose `FooAdaptor` to fit your specific domain much better than `Foo` does. + +# Using Mocks in Tests # +Once you have a mock class, using it is easy. The typical work flow is: + + 1. Import the Google Mock names from the `testing` namespace such that you can use them unqualified (You only have to do it once per file. Remember that namespaces are a good idea and good for your health.). + 1. Create some mock objects. + 1. Specify your expectations on them (How many times will a method be called? With what arguments? What should it do? etc.). + 1. Exercise some code that uses the mocks; optionally, check the result using Google Test assertions. If a mock method is called more than expected or with wrong arguments, you'll get an error immediately. + 1. When a mock is destructed, Google Mock will automatically check whether all expectations on it have been satisfied. + +Here's an example: + +``` +#include "path/to/mock-turtle.h" +#include "gmock/gmock.h" +#include "gtest/gtest.h" +using ::testing::AtLeast; // #1 + +TEST(PainterTest, CanDrawSomething) { + MockTurtle turtle; // #2 + EXPECT_CALL(turtle, PenDown()) // #3 + .Times(AtLeast(1)); + + Painter painter(&turtle); // #4 + + EXPECT_TRUE(painter.DrawCircle(0, 0, 10)); +} // #5 + +int main(int argc, char** argv) { + // The following line must be executed to initialize Google Mock + // (and Google Test) before running the tests. + ::testing::InitGoogleMock(&argc, argv); + return RUN_ALL_TESTS(); +} +``` + +As you might have guessed, this test checks that `PenDown()` is called at least once. If the `painter` object didn't call this method, your test will fail with a message like this: + +``` +path/to/my_test.cc:119: Failure +Actual function call count doesn't match this expectation: +Actually: never called; +Expected: called at least once. +``` + +**Tip 1:** If you run the test from an Emacs buffer, you can hit `` on the line number displayed in the error message to jump right to the failed expectation. + +**Tip 2:** If your mock objects are never deleted, the final verification won't happen. Therefore it's a good idea to use a heap leak checker in your tests when you allocate mocks on the heap. + +**Important note:** Google Mock requires expectations to be set **before** the mock functions are called, otherwise the behavior is **undefined**. In particular, you mustn't interleave `EXPECT_CALL()`s and calls to the mock functions. + +This means `EXPECT_CALL()` should be read as expecting that a call will occur _in the future_, not that a call has occurred. Why does Google Mock work like that? Well, specifying the expectation beforehand allows Google Mock to report a violation as soon as it arises, when the context (stack trace, etc) is still available. This makes debugging much easier. + +Admittedly, this test is contrived and doesn't do much. You can easily achieve the same effect without using Google Mock. However, as we shall reveal soon, Google Mock allows you to do _much more_ with the mocks. + +## Using Google Mock with Any Testing Framework ## +If you want to use something other than Google Test (e.g. [CppUnit](http://sourceforge.net/projects/cppunit/) or +[CxxTest](http://cxxtest.tigris.org/)) as your testing framework, just change the `main()` function in the previous section to: +``` +int main(int argc, char** argv) { + // The following line causes Google Mock to throw an exception on failure, + // which will be interpreted by your testing framework as a test failure. + ::testing::GTEST_FLAG(throw_on_failure) = true; + ::testing::InitGoogleMock(&argc, argv); + ... whatever your testing framework requires ... +} +``` + +This approach has a catch: it makes Google Mock throw an exception +from a mock object's destructor sometimes. With some compilers, this +sometimes causes the test program to crash. You'll still be able to +notice that the test has failed, but it's not a graceful failure. + +A better solution is to use Google Test's +[event listener API](../../googletest/docs/AdvancedGuide.md#extending-google-test-by-handling-test-events) +to report a test failure to your testing framework properly. You'll need to +implement the `OnTestPartResult()` method of the event listener interface, but it +should be straightforward. + +If this turns out to be too much work, we suggest that you stick with +Google Test, which works with Google Mock seamlessly (in fact, it is +technically part of Google Mock.). If there is a reason that you +cannot use Google Test, please let us know. + +# Setting Expectations # +The key to using a mock object successfully is to set the _right expectations_ on it. If you set the expectations too strict, your test will fail as the result of unrelated changes. If you set them too loose, bugs can slip through. You want to do it just right such that your test can catch exactly the kind of bugs you intend it to catch. Google Mock provides the necessary means for you to do it "just right." + +## General Syntax ## +In Google Mock we use the `EXPECT_CALL()` macro to set an expectation on a mock method. The general syntax is: + +``` +EXPECT_CALL(mock_object, method(matchers)) + .Times(cardinality) + .WillOnce(action) + .WillRepeatedly(action); +``` + +The macro has two arguments: first the mock object, and then the method and its arguments. Note that the two are separated by a comma (`,`), not a period (`.`). (Why using a comma? The answer is that it was necessary for technical reasons.) + +The macro can be followed by some optional _clauses_ that provide more information about the expectation. We'll discuss how each clause works in the coming sections. + +This syntax is designed to make an expectation read like English. For example, you can probably guess that + +``` +using ::testing::Return; +... +EXPECT_CALL(turtle, GetX()) + .Times(5) + .WillOnce(Return(100)) + .WillOnce(Return(150)) + .WillRepeatedly(Return(200)); +``` + +says that the `turtle` object's `GetX()` method will be called five times, it will return 100 the first time, 150 the second time, and then 200 every time. Some people like to call this style of syntax a Domain-Specific Language (DSL). + +**Note:** Why do we use a macro to do this? It serves two purposes: first it makes expectations easily identifiable (either by `grep` or by a human reader), and second it allows Google Mock to include the source file location of a failed expectation in messages, making debugging easier. + +## Matchers: What Arguments Do We Expect? ## +When a mock function takes arguments, we must specify what arguments we are expecting; for example: + +``` +// Expects the turtle to move forward by 100 units. +EXPECT_CALL(turtle, Forward(100)); +``` + +Sometimes you may not want to be too specific (Remember that talk about tests being too rigid? Over specification leads to brittle tests and obscures the intent of tests. Therefore we encourage you to specify only what's necessary - no more, no less.). If you care to check that `Forward()` will be called but aren't interested in its actual argument, write `_` as the argument, which means "anything goes": + +``` +using ::testing::_; +... +// Expects the turtle to move forward. +EXPECT_CALL(turtle, Forward(_)); +``` + +`_` is an instance of what we call **matchers**. A matcher is like a predicate and can test whether an argument is what we'd expect. You can use a matcher inside `EXPECT_CALL()` wherever a function argument is expected. + +A list of built-in matchers can be found in the [CheatSheet](CheatSheet.md). For example, here's the `Ge` (greater than or equal) matcher: + +``` +using ::testing::Ge; +... +EXPECT_CALL(turtle, Forward(Ge(100))); +``` + +This checks that the turtle will be told to go forward by at least 100 units. + +## Cardinalities: How Many Times Will It Be Called? ## +The first clause we can specify following an `EXPECT_CALL()` is `Times()`. We call its argument a **cardinality** as it tells _how many times_ the call should occur. It allows us to repeat an expectation many times without actually writing it as many times. More importantly, a cardinality can be "fuzzy", just like a matcher can be. This allows a user to express the intent of a test exactly. + +An interesting special case is when we say `Times(0)`. You may have guessed - it means that the function shouldn't be called with the given arguments at all, and Google Mock will report a Google Test failure whenever the function is (wrongfully) called. + +We've seen `AtLeast(n)` as an example of fuzzy cardinalities earlier. For the list of built-in cardinalities you can use, see the [CheatSheet](CheatSheet.md). + +The `Times()` clause can be omitted. **If you omit `Times()`, Google Mock will infer the cardinality for you.** The rules are easy to remember: + + * If **neither** `WillOnce()` **nor** `WillRepeatedly()` is in the `EXPECT_CALL()`, the inferred cardinality is `Times(1)`. + * If there are `n WillOnce()`'s but **no** `WillRepeatedly()`, where `n` >= 1, the cardinality is `Times(n)`. + * If there are `n WillOnce()`'s and **one** `WillRepeatedly()`, where `n` >= 0, the cardinality is `Times(AtLeast(n))`. + +**Quick quiz:** what do you think will happen if a function is expected to be called twice but actually called four times? + +## Actions: What Should It Do? ## +Remember that a mock object doesn't really have a working implementation? We as users have to tell it what to do when a method is invoked. This is easy in Google Mock. + +First, if the return type of a mock function is a built-in type or a pointer, the function has a **default action** (a `void` function will just return, a `bool` function will return `false`, and other functions will return 0). In addition, in C++ 11 and above, a mock function whose return type is default-constructible (i.e. has a default constructor) has a default action of returning a default-constructed value. If you don't say anything, this behavior will be used. + +Second, if a mock function doesn't have a default action, or the default action doesn't suit you, you can specify the action to be taken each time the expectation matches using a series of `WillOnce()` clauses followed by an optional `WillRepeatedly()`. For example, + +``` +using ::testing::Return; +... +EXPECT_CALL(turtle, GetX()) + .WillOnce(Return(100)) + .WillOnce(Return(200)) + .WillOnce(Return(300)); +``` + +This says that `turtle.GetX()` will be called _exactly three times_ (Google Mock inferred this from how many `WillOnce()` clauses we've written, since we didn't explicitly write `Times()`), and will return 100, 200, and 300 respectively. + +``` +using ::testing::Return; +... +EXPECT_CALL(turtle, GetY()) + .WillOnce(Return(100)) + .WillOnce(Return(200)) + .WillRepeatedly(Return(300)); +``` + +says that `turtle.GetY()` will be called _at least twice_ (Google Mock knows this as we've written two `WillOnce()` clauses and a `WillRepeatedly()` while having no explicit `Times()`), will return 100 the first time, 200 the second time, and 300 from the third time on. + +Of course, if you explicitly write a `Times()`, Google Mock will not try to infer the cardinality itself. What if the number you specified is larger than there are `WillOnce()` clauses? Well, after all `WillOnce()`s are used up, Google Mock will do the _default_ action for the function every time (unless, of course, you have a `WillRepeatedly()`.). + +What can we do inside `WillOnce()` besides `Return()`? You can return a reference using `ReturnRef(variable)`, or invoke a pre-defined function, among [others](CheatSheet.md#actions). + +**Important note:** The `EXPECT_CALL()` statement evaluates the action clause only once, even though the action may be performed many times. Therefore you must be careful about side effects. The following may not do what you want: + +``` +int n = 100; +EXPECT_CALL(turtle, GetX()) +.Times(4) +.WillRepeatedly(Return(n++)); +``` + +Instead of returning 100, 101, 102, ..., consecutively, this mock function will always return 100 as `n++` is only evaluated once. Similarly, `Return(new Foo)` will create a new `Foo` object when the `EXPECT_CALL()` is executed, and will return the same pointer every time. If you want the side effect to happen every time, you need to define a custom action, which we'll teach in the [CookBook](CookBook.md). + +Time for another quiz! What do you think the following means? + +``` +using ::testing::Return; +... +EXPECT_CALL(turtle, GetY()) +.Times(4) +.WillOnce(Return(100)); +``` + +Obviously `turtle.GetY()` is expected to be called four times. But if you think it will return 100 every time, think twice! Remember that one `WillOnce()` clause will be consumed each time the function is invoked and the default action will be taken afterwards. So the right answer is that `turtle.GetY()` will return 100 the first time, but **return 0 from the second time on**, as returning 0 is the default action for `int` functions. + +## Using Multiple Expectations ## +So far we've only shown examples where you have a single expectation. More realistically, you're going to specify expectations on multiple mock methods, which may be from multiple mock objects. + +By default, when a mock method is invoked, Google Mock will search the expectations in the **reverse order** they are defined, and stop when an active expectation that matches the arguments is found (you can think of it as "newer rules override older ones."). If the matching expectation cannot take any more calls, you will get an upper-bound-violated failure. Here's an example: + +``` +using ::testing::_; +... +EXPECT_CALL(turtle, Forward(_)); // #1 +EXPECT_CALL(turtle, Forward(10)) // #2 + .Times(2); +``` + +If `Forward(10)` is called three times in a row, the third time it will be an error, as the last matching expectation (#2) has been saturated. If, however, the third `Forward(10)` call is replaced by `Forward(20)`, then it would be OK, as now #1 will be the matching expectation. + +**Side note:** Why does Google Mock search for a match in the _reverse_ order of the expectations? The reason is that this allows a user to set up the default expectations in a mock object's constructor or the test fixture's set-up phase and then customize the mock by writing more specific expectations in the test body. So, if you have two expectations on the same method, you want to put the one with more specific matchers **after** the other, or the more specific rule would be shadowed by the more general one that comes after it. + +## Ordered vs Unordered Calls ## +By default, an expectation can match a call even though an earlier expectation hasn't been satisfied. In other words, the calls don't have to occur in the order the expectations are specified. + +Sometimes, you may want all the expected calls to occur in a strict order. To say this in Google Mock is easy: + +``` +using ::testing::InSequence; +... +TEST(FooTest, DrawsLineSegment) { + ... + { + InSequence dummy; + + EXPECT_CALL(turtle, PenDown()); + EXPECT_CALL(turtle, Forward(100)); + EXPECT_CALL(turtle, PenUp()); + } + Foo(); +} +``` + +By creating an object of type `InSequence`, all expectations in its scope are put into a _sequence_ and have to occur _sequentially_. Since we are just relying on the constructor and destructor of this object to do the actual work, its name is really irrelevant. + +In this example, we test that `Foo()` calls the three expected functions in the order as written. If a call is made out-of-order, it will be an error. + +(What if you care about the relative order of some of the calls, but not all of them? Can you specify an arbitrary partial order? The answer is ... yes! If you are impatient, the details can be found in the [CookBook](CookBook.md#expecting-partially-ordered-calls).) + +## All Expectations Are Sticky (Unless Said Otherwise) ## +Now let's do a quick quiz to see how well you can use this mock stuff already. How would you test that the turtle is asked to go to the origin _exactly twice_ (you want to ignore any other instructions it receives)? + +After you've come up with your answer, take a look at ours and compare notes (solve it yourself first - don't cheat!): + +``` +using ::testing::_; +... +EXPECT_CALL(turtle, GoTo(_, _)) // #1 + .Times(AnyNumber()); +EXPECT_CALL(turtle, GoTo(0, 0)) // #2 + .Times(2); +``` + +Suppose `turtle.GoTo(0, 0)` is called three times. In the third time, Google Mock will see that the arguments match expectation #2 (remember that we always pick the last matching expectation). Now, since we said that there should be only two such calls, Google Mock will report an error immediately. This is basically what we've told you in the "Using Multiple Expectations" section above. + +This example shows that **expectations in Google Mock are "sticky" by default**, in the sense that they remain active even after we have reached their invocation upper bounds. This is an important rule to remember, as it affects the meaning of the spec, and is **different** to how it's done in many other mocking frameworks (Why'd we do that? Because we think our rule makes the common cases easier to express and understand.). + +Simple? Let's see if you've really understood it: what does the following code say? + +``` +using ::testing::Return; +... +for (int i = n; i > 0; i--) { + EXPECT_CALL(turtle, GetX()) + .WillOnce(Return(10*i)); +} +``` + +If you think it says that `turtle.GetX()` will be called `n` times and will return 10, 20, 30, ..., consecutively, think twice! The problem is that, as we said, expectations are sticky. So, the second time `turtle.GetX()` is called, the last (latest) `EXPECT_CALL()` statement will match, and will immediately lead to an "upper bound exceeded" error - this piece of code is not very useful! + +One correct way of saying that `turtle.GetX()` will return 10, 20, 30, ..., is to explicitly say that the expectations are _not_ sticky. In other words, they should _retire_ as soon as they are saturated: + +``` +using ::testing::Return; +... +for (int i = n; i > 0; i--) { + EXPECT_CALL(turtle, GetX()) + .WillOnce(Return(10*i)) + .RetiresOnSaturation(); +} +``` + +And, there's a better way to do it: in this case, we expect the calls to occur in a specific order, and we line up the actions to match the order. Since the order is important here, we should make it explicit using a sequence: + +``` +using ::testing::InSequence; +using ::testing::Return; +... +{ + InSequence s; + + for (int i = 1; i <= n; i++) { + EXPECT_CALL(turtle, GetX()) + .WillOnce(Return(10*i)) + .RetiresOnSaturation(); + } +} +``` + +By the way, the other situation where an expectation may _not_ be sticky is when it's in a sequence - as soon as another expectation that comes after it in the sequence has been used, it automatically retires (and will never be used to match any call). + +## Uninteresting Calls ## +A mock object may have many methods, and not all of them are that interesting. For example, in some tests we may not care about how many times `GetX()` and `GetY()` get called. + +In Google Mock, if you are not interested in a method, just don't say anything about it. If a call to this method occurs, you'll see a warning in the test output, but it won't be a failure. + +# What Now? # +Congratulations! You've learned enough about Google Mock to start using it. Now, you might want to join the [googlemock](http://groups.google.com/group/googlemock) discussion group and actually write some tests using Google Mock - it will be fun. Hey, it may even be addictive - you've been warned. + +Then, if you feel like increasing your mock quotient, you should move on to the [CookBook](CookBook.md). You can learn many advanced features of Google Mock there -- and advance your level of enjoyment and testing bliss. diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/docs/FrequentlyAskedQuestions.md vulkan-1.1.73+dfsg/submodules/googletest/googlemock/docs/FrequentlyAskedQuestions.md --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/docs/FrequentlyAskedQuestions.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/docs/FrequentlyAskedQuestions.md 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,628 @@ + + +Please send your questions to the +[googlemock](http://groups.google.com/group/googlemock) discussion +group. If you need help with compiler errors, make sure you have +tried [Google Mock Doctor](#How_am_I_supposed_to_make_sense_of_these_horrible_template_error.md) first. + +## When I call a method on my mock object, the method for the real object is invoked instead. What's the problem? ## + +In order for a method to be mocked, it must be _virtual_, unless you use the [high-perf dependency injection technique](CookBook.md#mocking-nonvirtual-methods). + +## I wrote some matchers. After I upgraded to a new version of Google Mock, they no longer compile. What's going on? ## + +After version 1.4.0 of Google Mock was released, we had an idea on how +to make it easier to write matchers that can generate informative +messages efficiently. We experimented with this idea and liked what +we saw. Therefore we decided to implement it. + +Unfortunately, this means that if you have defined your own matchers +by implementing `MatcherInterface` or using `MakePolymorphicMatcher()`, +your definitions will no longer compile. Matchers defined using the +`MATCHER*` family of macros are not affected. + +Sorry for the hassle if your matchers are affected. We believe it's +in everyone's long-term interest to make this change sooner than +later. Fortunately, it's usually not hard to migrate an existing +matcher to the new API. Here's what you need to do: + +If you wrote your matcher like this: +``` +// Old matcher definition that doesn't work with the latest +// Google Mock. +using ::testing::MatcherInterface; +... +class MyWonderfulMatcher : public MatcherInterface { + public: + ... + virtual bool Matches(MyType value) const { + // Returns true if value matches. + return value.GetFoo() > 5; + } + ... +}; +``` + +you'll need to change it to: +``` +// New matcher definition that works with the latest Google Mock. +using ::testing::MatcherInterface; +using ::testing::MatchResultListener; +... +class MyWonderfulMatcher : public MatcherInterface { + public: + ... + virtual bool MatchAndExplain(MyType value, + MatchResultListener* listener) const { + // Returns true if value matches. + return value.GetFoo() > 5; + } + ... +}; +``` +(i.e. rename `Matches()` to `MatchAndExplain()` and give it a second +argument of type `MatchResultListener*`.) + +If you were also using `ExplainMatchResultTo()` to improve the matcher +message: +``` +// Old matcher definition that doesn't work with the lastest +// Google Mock. +using ::testing::MatcherInterface; +... +class MyWonderfulMatcher : public MatcherInterface { + public: + ... + virtual bool Matches(MyType value) const { + // Returns true if value matches. + return value.GetFoo() > 5; + } + + virtual void ExplainMatchResultTo(MyType value, + ::std::ostream* os) const { + // Prints some helpful information to os to help + // a user understand why value matches (or doesn't match). + *os << "the Foo property is " << value.GetFoo(); + } + ... +}; +``` + +you should move the logic of `ExplainMatchResultTo()` into +`MatchAndExplain()`, using the `MatchResultListener` argument where +the `::std::ostream` was used: +``` +// New matcher definition that works with the latest Google Mock. +using ::testing::MatcherInterface; +using ::testing::MatchResultListener; +... +class MyWonderfulMatcher : public MatcherInterface { + public: + ... + virtual bool MatchAndExplain(MyType value, + MatchResultListener* listener) const { + // Returns true if value matches. + *listener << "the Foo property is " << value.GetFoo(); + return value.GetFoo() > 5; + } + ... +}; +``` + +If your matcher is defined using `MakePolymorphicMatcher()`: +``` +// Old matcher definition that doesn't work with the latest +// Google Mock. +using ::testing::MakePolymorphicMatcher; +... +class MyGreatMatcher { + public: + ... + bool Matches(MyType value) const { + // Returns true if value matches. + return value.GetBar() < 42; + } + ... +}; +... MakePolymorphicMatcher(MyGreatMatcher()) ... +``` + +you should rename the `Matches()` method to `MatchAndExplain()` and +add a `MatchResultListener*` argument (the same as what you need to do +for matchers defined by implementing `MatcherInterface`): +``` +// New matcher definition that works with the latest Google Mock. +using ::testing::MakePolymorphicMatcher; +using ::testing::MatchResultListener; +... +class MyGreatMatcher { + public: + ... + bool MatchAndExplain(MyType value, + MatchResultListener* listener) const { + // Returns true if value matches. + return value.GetBar() < 42; + } + ... +}; +... MakePolymorphicMatcher(MyGreatMatcher()) ... +``` + +If your polymorphic matcher uses `ExplainMatchResultTo()` for better +failure messages: +``` +// Old matcher definition that doesn't work with the latest +// Google Mock. +using ::testing::MakePolymorphicMatcher; +... +class MyGreatMatcher { + public: + ... + bool Matches(MyType value) const { + // Returns true if value matches. + return value.GetBar() < 42; + } + ... +}; +void ExplainMatchResultTo(const MyGreatMatcher& matcher, + MyType value, + ::std::ostream* os) { + // Prints some helpful information to os to help + // a user understand why value matches (or doesn't match). + *os << "the Bar property is " << value.GetBar(); +} +... MakePolymorphicMatcher(MyGreatMatcher()) ... +``` + +you'll need to move the logic inside `ExplainMatchResultTo()` to +`MatchAndExplain()`: +``` +// New matcher definition that works with the latest Google Mock. +using ::testing::MakePolymorphicMatcher; +using ::testing::MatchResultListener; +... +class MyGreatMatcher { + public: + ... + bool MatchAndExplain(MyType value, + MatchResultListener* listener) const { + // Returns true if value matches. + *listener << "the Bar property is " << value.GetBar(); + return value.GetBar() < 42; + } + ... +}; +... MakePolymorphicMatcher(MyGreatMatcher()) ... +``` + +For more information, you can read these +[two](CookBook.md#writing-new-monomorphic-matchers) +[recipes](CookBook.md#writing-new-polymorphic-matchers) +from the cookbook. As always, you +are welcome to post questions on `googlemock@googlegroups.com` if you +need any help. + +## When using Google Mock, do I have to use Google Test as the testing framework? I have my favorite testing framework and don't want to switch. ## + +Google Mock works out of the box with Google Test. However, it's easy +to configure it to work with any testing framework of your choice. +[Here](ForDummies.md#using-google-mock-with-any-testing-framework) is how. + +## How am I supposed to make sense of these horrible template errors? ## + +If you are confused by the compiler errors gcc threw at you, +try consulting the _Google Mock Doctor_ tool first. What it does is to +scan stdin for gcc error messages, and spit out diagnoses on the +problems (we call them diseases) your code has. + +To "install", run command: +``` +alias gmd='/scripts/gmock_doctor.py' +``` + +To use it, do: +``` + 2>&1 | gmd +``` + +For example: +``` +make my_test 2>&1 | gmd +``` + +Or you can run `gmd` and copy-n-paste gcc's error messages to it. + +## Can I mock a variadic function? ## + +You cannot mock a variadic function (i.e. a function taking ellipsis +(`...`) arguments) directly in Google Mock. + +The problem is that in general, there is _no way_ for a mock object to +know how many arguments are passed to the variadic method, and what +the arguments' types are. Only the _author of the base class_ knows +the protocol, and we cannot look into their head. + +Therefore, to mock such a function, the _user_ must teach the mock +object how to figure out the number of arguments and their types. One +way to do it is to provide overloaded versions of the function. + +Ellipsis arguments are inherited from C and not really a C++ feature. +They are unsafe to use and don't work with arguments that have +constructors or destructors. Therefore we recommend to avoid them in +C++ as much as possible. + +## MSVC gives me warning C4301 or C4373 when I define a mock method with a const parameter. Why? ## + +If you compile this using Microsoft Visual C++ 2005 SP1: +``` +class Foo { + ... + virtual void Bar(const int i) = 0; +}; + +class MockFoo : public Foo { + ... + MOCK_METHOD1(Bar, void(const int i)); +}; +``` +You may get the following warning: +``` +warning C4301: 'MockFoo::Bar': overriding virtual function only differs from 'Foo::Bar' by const/volatile qualifier +``` + +This is a MSVC bug. The same code compiles fine with gcc ,for +example. If you use Visual C++ 2008 SP1, you would get the warning: +``` +warning C4373: 'MockFoo::Bar': virtual function overrides 'Foo::Bar', previous versions of the compiler did not override when parameters only differed by const/volatile qualifiers +``` + +In C++, if you _declare_ a function with a `const` parameter, the +`const` modifier is _ignored_. Therefore, the `Foo` base class above +is equivalent to: +``` +class Foo { + ... + virtual void Bar(int i) = 0; // int or const int? Makes no difference. +}; +``` + +In fact, you can _declare_ Bar() with an `int` parameter, and _define_ +it with a `const int` parameter. The compiler will still match them +up. + +Since making a parameter `const` is meaningless in the method +_declaration_, we recommend to remove it in both `Foo` and `MockFoo`. +That should workaround the VC bug. + +Note that we are talking about the _top-level_ `const` modifier here. +If the function parameter is passed by pointer or reference, declaring +the _pointee_ or _referee_ as `const` is still meaningful. For +example, the following two declarations are _not_ equivalent: +``` +void Bar(int* p); // Neither p nor *p is const. +void Bar(const int* p); // p is not const, but *p is. +``` + +## I have a huge mock class, and Microsoft Visual C++ runs out of memory when compiling it. What can I do? ## + +We've noticed that when the `/clr` compiler flag is used, Visual C++ +uses 5~6 times as much memory when compiling a mock class. We suggest +to avoid `/clr` when compiling native C++ mocks. + +## I can't figure out why Google Mock thinks my expectations are not satisfied. What should I do? ## + +You might want to run your test with +`--gmock_verbose=info`. This flag lets Google Mock print a trace +of every mock function call it receives. By studying the trace, +you'll gain insights on why the expectations you set are not met. + +## How can I assert that a function is NEVER called? ## + +``` +EXPECT_CALL(foo, Bar(_)) + .Times(0); +``` + +## I have a failed test where Google Mock tells me TWICE that a particular expectation is not satisfied. Isn't this redundant? ## + +When Google Mock detects a failure, it prints relevant information +(the mock function arguments, the state of relevant expectations, and +etc) to help the user debug. If another failure is detected, Google +Mock will do the same, including printing the state of relevant +expectations. + +Sometimes an expectation's state didn't change between two failures, +and you'll see the same description of the state twice. They are +however _not_ redundant, as they refer to _different points in time_. +The fact they are the same _is_ interesting information. + +## I get a heap check failure when using a mock object, but using a real object is fine. What can be wrong? ## + +Does the class (hopefully a pure interface) you are mocking have a +virtual destructor? + +Whenever you derive from a base class, make sure its destructor is +virtual. Otherwise Bad Things will happen. Consider the following +code: + +``` +class Base { + public: + // Not virtual, but should be. + ~Base() { ... } + ... +}; + +class Derived : public Base { + public: + ... + private: + std::string value_; +}; + +... + Base* p = new Derived; + ... + delete p; // Surprise! ~Base() will be called, but ~Derived() will not + // - value_ is leaked. +``` + +By changing `~Base()` to virtual, `~Derived()` will be correctly +called when `delete p` is executed, and the heap checker +will be happy. + +## The "newer expectations override older ones" rule makes writing expectations awkward. Why does Google Mock do that? ## + +When people complain about this, often they are referring to code like: + +``` +// foo.Bar() should be called twice, return 1 the first time, and return +// 2 the second time. However, I have to write the expectations in the +// reverse order. This sucks big time!!! +EXPECT_CALL(foo, Bar()) + .WillOnce(Return(2)) + .RetiresOnSaturation(); +EXPECT_CALL(foo, Bar()) + .WillOnce(Return(1)) + .RetiresOnSaturation(); +``` + +The problem is that they didn't pick the **best** way to express the test's +intent. + +By default, expectations don't have to be matched in _any_ particular +order. If you want them to match in a certain order, you need to be +explicit. This is Google Mock's (and jMock's) fundamental philosophy: it's +easy to accidentally over-specify your tests, and we want to make it +harder to do so. + +There are two better ways to write the test spec. You could either +put the expectations in sequence: + +``` +// foo.Bar() should be called twice, return 1 the first time, and return +// 2 the second time. Using a sequence, we can write the expectations +// in their natural order. +{ + InSequence s; + EXPECT_CALL(foo, Bar()) + .WillOnce(Return(1)) + .RetiresOnSaturation(); + EXPECT_CALL(foo, Bar()) + .WillOnce(Return(2)) + .RetiresOnSaturation(); +} +``` + +or you can put the sequence of actions in the same expectation: + +``` +// foo.Bar() should be called twice, return 1 the first time, and return +// 2 the second time. +EXPECT_CALL(foo, Bar()) + .WillOnce(Return(1)) + .WillOnce(Return(2)) + .RetiresOnSaturation(); +``` + +Back to the original questions: why does Google Mock search the +expectations (and `ON_CALL`s) from back to front? Because this +allows a user to set up a mock's behavior for the common case early +(e.g. in the mock's constructor or the test fixture's set-up phase) +and customize it with more specific rules later. If Google Mock +searches from front to back, this very useful pattern won't be +possible. + +## Google Mock prints a warning when a function without EXPECT\_CALL is called, even if I have set its behavior using ON\_CALL. Would it be reasonable not to show the warning in this case? ## + +When choosing between being neat and being safe, we lean toward the +latter. So the answer is that we think it's better to show the +warning. + +Often people write `ON_CALL`s in the mock object's +constructor or `SetUp()`, as the default behavior rarely changes from +test to test. Then in the test body they set the expectations, which +are often different for each test. Having an `ON_CALL` in the set-up +part of a test doesn't mean that the calls are expected. If there's +no `EXPECT_CALL` and the method is called, it's possibly an error. If +we quietly let the call go through without notifying the user, bugs +may creep in unnoticed. + +If, however, you are sure that the calls are OK, you can write + +``` +EXPECT_CALL(foo, Bar(_)) + .WillRepeatedly(...); +``` + +instead of + +``` +ON_CALL(foo, Bar(_)) + .WillByDefault(...); +``` + +This tells Google Mock that you do expect the calls and no warning should be +printed. + +Also, you can control the verbosity using the `--gmock_verbose` flag. +If you find the output too noisy when debugging, just choose a less +verbose level. + +## How can I delete the mock function's argument in an action? ## + +If you find yourself needing to perform some action that's not +supported by Google Mock directly, remember that you can define your own +actions using +[MakeAction()](CookBook.md#writing-new-actions) or +[MakePolymorphicAction()](CookBook.md#writing_new_polymorphic_actions), +or you can write a stub function and invoke it using +[Invoke()](CookBook.md#using-functions_methods_functors). + +## MOCK\_METHODn()'s second argument looks funny. Why don't you use the MOCK\_METHODn(Method, return\_type, arg\_1, ..., arg\_n) syntax? ## + +What?! I think it's beautiful. :-) + +While which syntax looks more natural is a subjective matter to some +extent, Google Mock's syntax was chosen for several practical advantages it +has. + +Try to mock a function that takes a map as an argument: +``` +virtual int GetSize(const map& m); +``` + +Using the proposed syntax, it would be: +``` +MOCK_METHOD1(GetSize, int, const map& m); +``` + +Guess what? You'll get a compiler error as the compiler thinks that +`const map& m` are **two**, not one, arguments. To work +around this you can use `typedef` to give the map type a name, but +that gets in the way of your work. Google Mock's syntax avoids this +problem as the function's argument types are protected inside a pair +of parentheses: +``` +// This compiles fine. +MOCK_METHOD1(GetSize, int(const map& m)); +``` + +You still need a `typedef` if the return type contains an unprotected +comma, but that's much rarer. + +Other advantages include: + 1. `MOCK_METHOD1(Foo, int, bool)` can leave a reader wonder whether the method returns `int` or `bool`, while there won't be such confusion using Google Mock's syntax. + 1. The way Google Mock describes a function type is nothing new, although many people may not be familiar with it. The same syntax was used in C, and the `function` library in `tr1` uses this syntax extensively. Since `tr1` will become a part of the new version of STL, we feel very comfortable to be consistent with it. + 1. The function type syntax is also used in other parts of Google Mock's API (e.g. the action interface) in order to make the implementation tractable. A user needs to learn it anyway in order to utilize Google Mock's more advanced features. We'd as well stick to the same syntax in `MOCK_METHOD*`! + +## My code calls a static/global function. Can I mock it? ## + +You can, but you need to make some changes. + +In general, if you find yourself needing to mock a static function, +it's a sign that your modules are too tightly coupled (and less +flexible, less reusable, less testable, etc). You are probably better +off defining a small interface and call the function through that +interface, which then can be easily mocked. It's a bit of work +initially, but usually pays for itself quickly. + +This Google Testing Blog +[post](http://googletesting.blogspot.com/2008/06/defeat-static-cling.html) +says it excellently. Check it out. + +## My mock object needs to do complex stuff. It's a lot of pain to specify the actions. Google Mock sucks! ## + +I know it's not a question, but you get an answer for free any way. :-) + +With Google Mock, you can create mocks in C++ easily. And people might be +tempted to use them everywhere. Sometimes they work great, and +sometimes you may find them, well, a pain to use. So, what's wrong in +the latter case? + +When you write a test without using mocks, you exercise the code and +assert that it returns the correct value or that the system is in an +expected state. This is sometimes called "state-based testing". + +Mocks are great for what some call "interaction-based" testing: +instead of checking the system state at the very end, mock objects +verify that they are invoked the right way and report an error as soon +as it arises, giving you a handle on the precise context in which the +error was triggered. This is often more effective and economical to +do than state-based testing. + +If you are doing state-based testing and using a test double just to +simulate the real object, you are probably better off using a fake. +Using a mock in this case causes pain, as it's not a strong point for +mocks to perform complex actions. If you experience this and think +that mocks suck, you are just not using the right tool for your +problem. Or, you might be trying to solve the wrong problem. :-) + +## I got a warning "Uninteresting function call encountered - default action taken.." Should I panic? ## + +By all means, NO! It's just an FYI. + +What it means is that you have a mock function, you haven't set any +expectations on it (by Google Mock's rule this means that you are not +interested in calls to this function and therefore it can be called +any number of times), and it is called. That's OK - you didn't say +it's not OK to call the function! + +What if you actually meant to disallow this function to be called, but +forgot to write `EXPECT_CALL(foo, Bar()).Times(0)`? While +one can argue that it's the user's fault, Google Mock tries to be nice and +prints you a note. + +So, when you see the message and believe that there shouldn't be any +uninteresting calls, you should investigate what's going on. To make +your life easier, Google Mock prints the function name and arguments +when an uninteresting call is encountered. + +## I want to define a custom action. Should I use Invoke() or implement the action interface? ## + +Either way is fine - you want to choose the one that's more convenient +for your circumstance. + +Usually, if your action is for a particular function type, defining it +using `Invoke()` should be easier; if your action can be used in +functions of different types (e.g. if you are defining +`Return(value)`), `MakePolymorphicAction()` is +easiest. Sometimes you want precise control on what types of +functions the action can be used in, and implementing +`ActionInterface` is the way to go here. See the implementation of +`Return()` in `include/gmock/gmock-actions.h` for an example. + +## I'm using the set-argument-pointee action, and the compiler complains about "conflicting return type specified". What does it mean? ## + +You got this error as Google Mock has no idea what value it should return +when the mock method is called. `SetArgPointee()` says what the +side effect is, but doesn't say what the return value should be. You +need `DoAll()` to chain a `SetArgPointee()` with a `Return()`. + +See this [recipe](CookBook.md#mocking_side_effects) for more details and an example. + + +## My question is not in your FAQ! ## + +If you cannot find the answer to your question in this FAQ, there are +some other resources you can use: + + 1. read other [documentation](Documentation.md), + 1. search the mailing list [archive](http://groups.google.com/group/googlemock/topics), + 1. ask it on [googlemock@googlegroups.com](mailto:googlemock@googlegroups.com) and someone will answer it (to prevent spam, we require you to join the [discussion group](http://groups.google.com/group/googlemock) before you can post.). + +Please note that creating an issue in the +[issue tracker](https://github.com/google/googletest/issues) is _not_ +a good way to get your answer, as it is monitored infrequently by a +very small number of people. + +When asking a question, it's helpful to provide as much of the +following information as possible (people cannot help you if there's +not enough information in your question): + + * the version (or the revision number if you check out from SVN directly) of Google Mock you use (Google Mock is under active development, so it's possible that your problem has been solved in a later version), + * your operating system, + * the name and version of your compiler, + * the complete command line flags you give to your compiler, + * the complete compiler error messages (if the question is about compilation), + * the _actual_ code (ideally, a minimal but complete program) that has the problem you encounter. diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/docs/KnownIssues.md vulkan-1.1.73+dfsg/submodules/googletest/googlemock/docs/KnownIssues.md --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/docs/KnownIssues.md 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/docs/KnownIssues.md 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,19 @@ +As any non-trivial software system, Google Mock has some known limitations and problems. We are working on improving it, and welcome your help! The follow is a list of issues we know about. + + + +## README contains outdated information on Google Mock's compatibility with other testing frameworks ## + +The `README` file in release 1.1.0 still says that Google Mock only works with Google Test. Actually, you can configure Google Mock to work with any testing framework you choose. + +## Tests failing on machines using Power PC CPUs (e.g. some Macs) ## + +`gmock_output_test` and `gmock-printers_test` are known to fail with Power PC CPUs. This is due to portability issues with these tests, and is not an indication of problems in Google Mock itself. You can safely ignore them. + +## Failed to resolve libgtest.so.0 in tests when built against installed Google Test ## + +This only applies if you manually built and installed Google Test, and then built a Google Mock against it (either explicitly, or because gtest-config was in your path post-install). In this situation, Libtool has a known issue with certain systems' ldconfig setup: + +http://article.gmane.org/gmane.comp.sysutils.automake.general/9025 + +This requires a manual run of "sudo ldconfig" after the "sudo make install" for Google Test before any binaries which link against it can be executed. This isn't a bug in our install, but we should at least have documented it or hacked a work-around into our install. We should have one of these solutions in our next release. \ No newline at end of file diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-actions.h vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-actions.h --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-actions.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-actions.h 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,1206 @@ +// Copyright 2007, Google Inc. +// 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 Google Inc. 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 +// OWNER 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. +// +// Author: wan@google.com (Zhanyong Wan) + +// Google Mock - a framework for writing C++ mock classes. +// +// This file implements some commonly used actions. + +#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_ +#define GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_ + +#ifndef _WIN32_WCE +# include +#endif + +#include +#include + +#include "gmock/internal/gmock-internal-utils.h" +#include "gmock/internal/gmock-port.h" + +#if GTEST_LANG_CXX11 // Defined by gtest-port.h via gmock-port.h. +#include +#include +#endif // GTEST_LANG_CXX11 + +namespace testing { + +// To implement an action Foo, define: +// 1. a class FooAction that implements the ActionInterface interface, and +// 2. a factory function that creates an Action object from a +// const FooAction*. +// +// The two-level delegation design follows that of Matcher, providing +// consistency for extension developers. It also eases ownership +// management as Action objects can now be copied like plain values. + +namespace internal { + +template +class ActionAdaptor; + +// BuiltInDefaultValueGetter::Get() returns a +// default-constructed T value. BuiltInDefaultValueGetter::Get() crashes with an error. +// +// This primary template is used when kDefaultConstructible is true. +template +struct BuiltInDefaultValueGetter { + static T Get() { return T(); } +}; +template +struct BuiltInDefaultValueGetter { + static T Get() { + Assert(false, __FILE__, __LINE__, + "Default action undefined for the function return type."); + return internal::Invalid(); + // The above statement will never be reached, but is required in + // order for this function to compile. + } +}; + +// BuiltInDefaultValue::Get() returns the "built-in" default value +// for type T, which is NULL when T is a raw pointer type, 0 when T is +// a numeric type, false when T is bool, or "" when T is string or +// std::string. In addition, in C++11 and above, it turns a +// default-constructed T value if T is default constructible. For any +// other type T, the built-in default T value is undefined, and the +// function will abort the process. +template +class BuiltInDefaultValue { + public: +#if GTEST_LANG_CXX11 + // This function returns true iff type T has a built-in default value. + static bool Exists() { + return ::std::is_default_constructible::value; + } + + static T Get() { + return BuiltInDefaultValueGetter< + T, ::std::is_default_constructible::value>::Get(); + } + +#else // GTEST_LANG_CXX11 + // This function returns true iff type T has a built-in default value. + static bool Exists() { + return false; + } + + static T Get() { + return BuiltInDefaultValueGetter::Get(); + } + +#endif // GTEST_LANG_CXX11 +}; + +// This partial specialization says that we use the same built-in +// default value for T and const T. +template +class BuiltInDefaultValue { + public: + static bool Exists() { return BuiltInDefaultValue::Exists(); } + static T Get() { return BuiltInDefaultValue::Get(); } +}; + +// This partial specialization defines the default values for pointer +// types. +template +class BuiltInDefaultValue { + public: + static bool Exists() { return true; } + static T* Get() { return NULL; } +}; + +// The following specializations define the default values for +// specific types we care about. +#define GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(type, value) \ + template <> \ + class BuiltInDefaultValue { \ + public: \ + static bool Exists() { return true; } \ + static type Get() { return value; } \ + } + +GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(void, ); // NOLINT +#if GTEST_HAS_GLOBAL_STRING +GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(::string, ""); +#endif // GTEST_HAS_GLOBAL_STRING +GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(::std::string, ""); +GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(bool, false); +GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned char, '\0'); +GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed char, '\0'); +GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(char, '\0'); + +// There's no need for a default action for signed wchar_t, as that +// type is the same as wchar_t for gcc, and invalid for MSVC. +// +// There's also no need for a default action for unsigned wchar_t, as +// that type is the same as unsigned int for gcc, and invalid for +// MSVC. +#if GMOCK_WCHAR_T_IS_NATIVE_ +GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(wchar_t, 0U); // NOLINT +#endif + +GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned short, 0U); // NOLINT +GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed short, 0); // NOLINT +GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned int, 0U); +GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed int, 0); +GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned long, 0UL); // NOLINT +GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed long, 0L); // NOLINT +GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(UInt64, 0); +GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(Int64, 0); +GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(float, 0); +GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(double, 0); + +#undef GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_ + +} // namespace internal + +// When an unexpected function call is encountered, Google Mock will +// let it return a default value if the user has specified one for its +// return type, or if the return type has a built-in default value; +// otherwise Google Mock won't know what value to return and will have +// to abort the process. +// +// The DefaultValue class allows a user to specify the +// default value for a type T that is both copyable and publicly +// destructible (i.e. anything that can be used as a function return +// type). The usage is: +// +// // Sets the default value for type T to be foo. +// DefaultValue::Set(foo); +template +class DefaultValue { + public: + // Sets the default value for type T; requires T to be + // copy-constructable and have a public destructor. + static void Set(T x) { + delete producer_; + producer_ = new FixedValueProducer(x); + } + + // Provides a factory function to be called to generate the default value. + // This method can be used even if T is only move-constructible, but it is not + // limited to that case. + typedef T (*FactoryFunction)(); + static void SetFactory(FactoryFunction factory) { + delete producer_; + producer_ = new FactoryValueProducer(factory); + } + + // Unsets the default value for type T. + static void Clear() { + delete producer_; + producer_ = NULL; + } + + // Returns true iff the user has set the default value for type T. + static bool IsSet() { return producer_ != NULL; } + + // Returns true if T has a default return value set by the user or there + // exists a built-in default value. + static bool Exists() { + return IsSet() || internal::BuiltInDefaultValue::Exists(); + } + + // Returns the default value for type T if the user has set one; + // otherwise returns the built-in default value. Requires that Exists() + // is true, which ensures that the return value is well-defined. + static T Get() { + return producer_ == NULL ? + internal::BuiltInDefaultValue::Get() : producer_->Produce(); + } + + private: + class ValueProducer { + public: + virtual ~ValueProducer() {} + virtual T Produce() = 0; + }; + + class FixedValueProducer : public ValueProducer { + public: + explicit FixedValueProducer(T value) : value_(value) {} + virtual T Produce() { return value_; } + + private: + const T value_; + GTEST_DISALLOW_COPY_AND_ASSIGN_(FixedValueProducer); + }; + + class FactoryValueProducer : public ValueProducer { + public: + explicit FactoryValueProducer(FactoryFunction factory) + : factory_(factory) {} + virtual T Produce() { return factory_(); } + + private: + const FactoryFunction factory_; + GTEST_DISALLOW_COPY_AND_ASSIGN_(FactoryValueProducer); + }; + + static ValueProducer* producer_; +}; + +// This partial specialization allows a user to set default values for +// reference types. +template +class DefaultValue { + public: + // Sets the default value for type T&. + static void Set(T& x) { // NOLINT + address_ = &x; + } + + // Unsets the default value for type T&. + static void Clear() { + address_ = NULL; + } + + // Returns true iff the user has set the default value for type T&. + static bool IsSet() { return address_ != NULL; } + + // Returns true if T has a default return value set by the user or there + // exists a built-in default value. + static bool Exists() { + return IsSet() || internal::BuiltInDefaultValue::Exists(); + } + + // Returns the default value for type T& if the user has set one; + // otherwise returns the built-in default value if there is one; + // otherwise aborts the process. + static T& Get() { + return address_ == NULL ? + internal::BuiltInDefaultValue::Get() : *address_; + } + + private: + static T* address_; +}; + +// This specialization allows DefaultValue::Get() to +// compile. +template <> +class DefaultValue { + public: + static bool Exists() { return true; } + static void Get() {} +}; + +// Points to the user-set default value for type T. +template +typename DefaultValue::ValueProducer* DefaultValue::producer_ = NULL; + +// Points to the user-set default value for type T&. +template +T* DefaultValue::address_ = NULL; + +// Implement this interface to define an action for function type F. +template +class ActionInterface { + public: + typedef typename internal::Function::Result Result; + typedef typename internal::Function::ArgumentTuple ArgumentTuple; + + ActionInterface() {} + virtual ~ActionInterface() {} + + // Performs the action. This method is not const, as in general an + // action can have side effects and be stateful. For example, a + // get-the-next-element-from-the-collection action will need to + // remember the current element. + virtual Result Perform(const ArgumentTuple& args) = 0; + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionInterface); +}; + +// An Action is a copyable and IMMUTABLE (except by assignment) +// object that represents an action to be taken when a mock function +// of type F is called. The implementation of Action is just a +// linked_ptr to const ActionInterface, so copying is fairly cheap. +// Don't inherit from Action! +// +// You can view an object implementing ActionInterface as a +// concrete action (including its current state), and an Action +// object as a handle to it. +template +class Action { + public: + typedef typename internal::Function::Result Result; + typedef typename internal::Function::ArgumentTuple ArgumentTuple; + + // Constructs a null Action. Needed for storing Action objects in + // STL containers. + Action() : impl_(NULL) {} + + // Constructs an Action from its implementation. A NULL impl is + // used to represent the "do-default" action. + explicit Action(ActionInterface* impl) : impl_(impl) {} + + // Copy constructor. + Action(const Action& action) : impl_(action.impl_) {} + + // This constructor allows us to turn an Action object into an + // Action, as long as F's arguments can be implicitly converted + // to Func's and Func's return type can be implicitly converted to + // F's. + template + explicit Action(const Action& action); + + // Returns true iff this is the DoDefault() action. + bool IsDoDefault() const { return impl_.get() == NULL; } + + // Performs the action. Note that this method is const even though + // the corresponding method in ActionInterface is not. The reason + // is that a const Action means that it cannot be re-bound to + // another concrete action, not that the concrete action it binds to + // cannot change state. (Think of the difference between a const + // pointer and a pointer to const.) + Result Perform(const ArgumentTuple& args) const { + internal::Assert( + !IsDoDefault(), __FILE__, __LINE__, + "You are using DoDefault() inside a composite action like " + "DoAll() or WithArgs(). This is not supported for technical " + "reasons. Please instead spell out the default action, or " + "assign the default action to an Action variable and use " + "the variable in various places."); + return impl_->Perform(args); + } + + private: + template + friend class internal::ActionAdaptor; + + internal::linked_ptr > impl_; +}; + +// The PolymorphicAction class template makes it easy to implement a +// polymorphic action (i.e. an action that can be used in mock +// functions of than one type, e.g. Return()). +// +// To define a polymorphic action, a user first provides a COPYABLE +// implementation class that has a Perform() method template: +// +// class FooAction { +// public: +// template +// Result Perform(const ArgumentTuple& args) const { +// // Processes the arguments and returns a result, using +// // tr1::get(args) to get the N-th (0-based) argument in the tuple. +// } +// ... +// }; +// +// Then the user creates the polymorphic action using +// MakePolymorphicAction(object) where object has type FooAction. See +// the definition of Return(void) and SetArgumentPointee(value) for +// complete examples. +template +class PolymorphicAction { + public: + explicit PolymorphicAction(const Impl& impl) : impl_(impl) {} + + template + operator Action() const { + return Action(new MonomorphicImpl(impl_)); + } + + private: + template + class MonomorphicImpl : public ActionInterface { + public: + typedef typename internal::Function::Result Result; + typedef typename internal::Function::ArgumentTuple ArgumentTuple; + + explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {} + + virtual Result Perform(const ArgumentTuple& args) { + return impl_.template Perform(args); + } + + private: + Impl impl_; + + GTEST_DISALLOW_ASSIGN_(MonomorphicImpl); + }; + + Impl impl_; + + GTEST_DISALLOW_ASSIGN_(PolymorphicAction); +}; + +// Creates an Action from its implementation and returns it. The +// created Action object owns the implementation. +template +Action MakeAction(ActionInterface* impl) { + return Action(impl); +} + +// Creates a polymorphic action from its implementation. This is +// easier to use than the PolymorphicAction constructor as it +// doesn't require you to explicitly write the template argument, e.g. +// +// MakePolymorphicAction(foo); +// vs +// PolymorphicAction(foo); +template +inline PolymorphicAction MakePolymorphicAction(const Impl& impl) { + return PolymorphicAction(impl); +} + +namespace internal { + +// Allows an Action object to pose as an Action, as long as F2 +// and F1 are compatible. +template +class ActionAdaptor : public ActionInterface { + public: + typedef typename internal::Function::Result Result; + typedef typename internal::Function::ArgumentTuple ArgumentTuple; + + explicit ActionAdaptor(const Action& from) : impl_(from.impl_) {} + + virtual Result Perform(const ArgumentTuple& args) { + return impl_->Perform(args); + } + + private: + const internal::linked_ptr > impl_; + + GTEST_DISALLOW_ASSIGN_(ActionAdaptor); +}; + +// Helper struct to specialize ReturnAction to execute a move instead of a copy +// on return. Useful for move-only types, but could be used on any type. +template +struct ByMoveWrapper { + explicit ByMoveWrapper(T value) : payload(internal::move(value)) {} + T payload; +}; + +// Implements the polymorphic Return(x) action, which can be used in +// any function that returns the type of x, regardless of the argument +// types. +// +// Note: The value passed into Return must be converted into +// Function::Result when this action is cast to Action rather than +// when that action is performed. This is important in scenarios like +// +// MOCK_METHOD1(Method, T(U)); +// ... +// { +// Foo foo; +// X x(&foo); +// EXPECT_CALL(mock, Method(_)).WillOnce(Return(x)); +// } +// +// In the example above the variable x holds reference to foo which leaves +// scope and gets destroyed. If copying X just copies a reference to foo, +// that copy will be left with a hanging reference. If conversion to T +// makes a copy of foo, the above code is safe. To support that scenario, we +// need to make sure that the type conversion happens inside the EXPECT_CALL +// statement, and conversion of the result of Return to Action is a +// good place for that. +// +template +class ReturnAction { + public: + // Constructs a ReturnAction object from the value to be returned. + // 'value' is passed by value instead of by const reference in order + // to allow Return("string literal") to compile. + explicit ReturnAction(R value) : value_(new R(internal::move(value))) {} + + // This template type conversion operator allows Return(x) to be + // used in ANY function that returns x's type. + template + operator Action() const { + // Assert statement belongs here because this is the best place to verify + // conditions on F. It produces the clearest error messages + // in most compilers. + // Impl really belongs in this scope as a local class but can't + // because MSVC produces duplicate symbols in different translation units + // in this case. Until MS fixes that bug we put Impl into the class scope + // and put the typedef both here (for use in assert statement) and + // in the Impl class. But both definitions must be the same. + typedef typename Function::Result Result; + GTEST_COMPILE_ASSERT_( + !is_reference::value, + use_ReturnRef_instead_of_Return_to_return_a_reference); + return Action(new Impl(value_)); + } + + private: + // Implements the Return(x) action for a particular function type F. + template + class Impl : public ActionInterface { + public: + typedef typename Function::Result Result; + typedef typename Function::ArgumentTuple ArgumentTuple; + + // The implicit cast is necessary when Result has more than one + // single-argument constructor (e.g. Result is std::vector) and R + // has a type conversion operator template. In that case, value_(value) + // won't compile as the compiler doesn't known which constructor of + // Result to call. ImplicitCast_ forces the compiler to convert R to + // Result without considering explicit constructors, thus resolving the + // ambiguity. value_ is then initialized using its copy constructor. + explicit Impl(const linked_ptr& value) + : value_before_cast_(*value), + value_(ImplicitCast_(value_before_cast_)) {} + + virtual Result Perform(const ArgumentTuple&) { return value_; } + + private: + GTEST_COMPILE_ASSERT_(!is_reference::value, + Result_cannot_be_a_reference_type); + // We save the value before casting just in case it is being cast to a + // wrapper type. + R value_before_cast_; + Result value_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl); + }; + + // Partially specialize for ByMoveWrapper. This version of ReturnAction will + // move its contents instead. + template + class Impl, F> : public ActionInterface { + public: + typedef typename Function::Result Result; + typedef typename Function::ArgumentTuple ArgumentTuple; + + explicit Impl(const linked_ptr& wrapper) + : performed_(false), wrapper_(wrapper) {} + + virtual Result Perform(const ArgumentTuple&) { + GTEST_CHECK_(!performed_) + << "A ByMove() action should only be performed once."; + performed_ = true; + return internal::move(wrapper_->payload); + } + + private: + bool performed_; + const linked_ptr wrapper_; + + GTEST_DISALLOW_ASSIGN_(Impl); + }; + + const linked_ptr value_; + + GTEST_DISALLOW_ASSIGN_(ReturnAction); +}; + +// Implements the ReturnNull() action. +class ReturnNullAction { + public: + // Allows ReturnNull() to be used in any pointer-returning function. In C++11 + // this is enforced by returning nullptr, and in non-C++11 by asserting a + // pointer type on compile time. + template + static Result Perform(const ArgumentTuple&) { +#if GTEST_LANG_CXX11 + return nullptr; +#else + GTEST_COMPILE_ASSERT_(internal::is_pointer::value, + ReturnNull_can_be_used_to_return_a_pointer_only); + return NULL; +#endif // GTEST_LANG_CXX11 + } +}; + +// Implements the Return() action. +class ReturnVoidAction { + public: + // Allows Return() to be used in any void-returning function. + template + static void Perform(const ArgumentTuple&) { + CompileAssertTypesEqual(); + } +}; + +// Implements the polymorphic ReturnRef(x) action, which can be used +// in any function that returns a reference to the type of x, +// regardless of the argument types. +template +class ReturnRefAction { + public: + // Constructs a ReturnRefAction object from the reference to be returned. + explicit ReturnRefAction(T& ref) : ref_(ref) {} // NOLINT + + // This template type conversion operator allows ReturnRef(x) to be + // used in ANY function that returns a reference to x's type. + template + operator Action() const { + typedef typename Function::Result Result; + // Asserts that the function return type is a reference. This + // catches the user error of using ReturnRef(x) when Return(x) + // should be used, and generates some helpful error message. + GTEST_COMPILE_ASSERT_(internal::is_reference::value, + use_Return_instead_of_ReturnRef_to_return_a_value); + return Action(new Impl(ref_)); + } + + private: + // Implements the ReturnRef(x) action for a particular function type F. + template + class Impl : public ActionInterface { + public: + typedef typename Function::Result Result; + typedef typename Function::ArgumentTuple ArgumentTuple; + + explicit Impl(T& ref) : ref_(ref) {} // NOLINT + + virtual Result Perform(const ArgumentTuple&) { + return ref_; + } + + private: + T& ref_; + + GTEST_DISALLOW_ASSIGN_(Impl); + }; + + T& ref_; + + GTEST_DISALLOW_ASSIGN_(ReturnRefAction); +}; + +// Implements the polymorphic ReturnRefOfCopy(x) action, which can be +// used in any function that returns a reference to the type of x, +// regardless of the argument types. +template +class ReturnRefOfCopyAction { + public: + // Constructs a ReturnRefOfCopyAction object from the reference to + // be returned. + explicit ReturnRefOfCopyAction(const T& value) : value_(value) {} // NOLINT + + // This template type conversion operator allows ReturnRefOfCopy(x) to be + // used in ANY function that returns a reference to x's type. + template + operator Action() const { + typedef typename Function::Result Result; + // Asserts that the function return type is a reference. This + // catches the user error of using ReturnRefOfCopy(x) when Return(x) + // should be used, and generates some helpful error message. + GTEST_COMPILE_ASSERT_( + internal::is_reference::value, + use_Return_instead_of_ReturnRefOfCopy_to_return_a_value); + return Action(new Impl(value_)); + } + + private: + // Implements the ReturnRefOfCopy(x) action for a particular function type F. + template + class Impl : public ActionInterface { + public: + typedef typename Function::Result Result; + typedef typename Function::ArgumentTuple ArgumentTuple; + + explicit Impl(const T& value) : value_(value) {} // NOLINT + + virtual Result Perform(const ArgumentTuple&) { + return value_; + } + + private: + T value_; + + GTEST_DISALLOW_ASSIGN_(Impl); + }; + + const T value_; + + GTEST_DISALLOW_ASSIGN_(ReturnRefOfCopyAction); +}; + +// Implements the polymorphic DoDefault() action. +class DoDefaultAction { + public: + // This template type conversion operator allows DoDefault() to be + // used in any function. + template + operator Action() const { return Action(NULL); } +}; + +// Implements the Assign action to set a given pointer referent to a +// particular value. +template +class AssignAction { + public: + AssignAction(T1* ptr, T2 value) : ptr_(ptr), value_(value) {} + + template + void Perform(const ArgumentTuple& /* args */) const { + *ptr_ = value_; + } + + private: + T1* const ptr_; + const T2 value_; + + GTEST_DISALLOW_ASSIGN_(AssignAction); +}; + +#if !GTEST_OS_WINDOWS_MOBILE + +// Implements the SetErrnoAndReturn action to simulate return from +// various system calls and libc functions. +template +class SetErrnoAndReturnAction { + public: + SetErrnoAndReturnAction(int errno_value, T result) + : errno_(errno_value), + result_(result) {} + template + Result Perform(const ArgumentTuple& /* args */) const { + errno = errno_; + return result_; + } + + private: + const int errno_; + const T result_; + + GTEST_DISALLOW_ASSIGN_(SetErrnoAndReturnAction); +}; + +#endif // !GTEST_OS_WINDOWS_MOBILE + +// Implements the SetArgumentPointee(x) action for any function +// whose N-th argument (0-based) is a pointer to x's type. The +// template parameter kIsProto is true iff type A is ProtocolMessage, +// proto2::Message, or a sub-class of those. +template +class SetArgumentPointeeAction { + public: + // Constructs an action that sets the variable pointed to by the + // N-th function argument to 'value'. + explicit SetArgumentPointeeAction(const A& value) : value_(value) {} + + template + void Perform(const ArgumentTuple& args) const { + CompileAssertTypesEqual(); + *::testing::get(args) = value_; + } + + private: + const A value_; + + GTEST_DISALLOW_ASSIGN_(SetArgumentPointeeAction); +}; + +template +class SetArgumentPointeeAction { + public: + // Constructs an action that sets the variable pointed to by the + // N-th function argument to 'proto'. Both ProtocolMessage and + // proto2::Message have the CopyFrom() method, so the same + // implementation works for both. + explicit SetArgumentPointeeAction(const Proto& proto) : proto_(new Proto) { + proto_->CopyFrom(proto); + } + + template + void Perform(const ArgumentTuple& args) const { + CompileAssertTypesEqual(); + ::testing::get(args)->CopyFrom(*proto_); + } + + private: + const internal::linked_ptr proto_; + + GTEST_DISALLOW_ASSIGN_(SetArgumentPointeeAction); +}; + +// Implements the InvokeWithoutArgs(f) action. The template argument +// FunctionImpl is the implementation type of f, which can be either a +// function pointer or a functor. InvokeWithoutArgs(f) can be used as an +// Action as long as f's type is compatible with F (i.e. f can be +// assigned to a tr1::function). +template +class InvokeWithoutArgsAction { + public: + // The c'tor makes a copy of function_impl (either a function + // pointer or a functor). + explicit InvokeWithoutArgsAction(FunctionImpl function_impl) + : function_impl_(function_impl) {} + + // Allows InvokeWithoutArgs(f) to be used as any action whose type is + // compatible with f. + template + Result Perform(const ArgumentTuple&) { return function_impl_(); } + + private: + FunctionImpl function_impl_; + + GTEST_DISALLOW_ASSIGN_(InvokeWithoutArgsAction); +}; + +// Implements the InvokeWithoutArgs(object_ptr, &Class::Method) action. +template +class InvokeMethodWithoutArgsAction { + public: + InvokeMethodWithoutArgsAction(Class* obj_ptr, MethodPtr method_ptr) + : obj_ptr_(obj_ptr), method_ptr_(method_ptr) {} + + template + Result Perform(const ArgumentTuple&) const { + return (obj_ptr_->*method_ptr_)(); + } + + private: + Class* const obj_ptr_; + const MethodPtr method_ptr_; + + GTEST_DISALLOW_ASSIGN_(InvokeMethodWithoutArgsAction); +}; + +// Implements the IgnoreResult(action) action. +template +class IgnoreResultAction { + public: + explicit IgnoreResultAction(const A& action) : action_(action) {} + + template + operator Action() const { + // Assert statement belongs here because this is the best place to verify + // conditions on F. It produces the clearest error messages + // in most compilers. + // Impl really belongs in this scope as a local class but can't + // because MSVC produces duplicate symbols in different translation units + // in this case. Until MS fixes that bug we put Impl into the class scope + // and put the typedef both here (for use in assert statement) and + // in the Impl class. But both definitions must be the same. + typedef typename internal::Function::Result Result; + + // Asserts at compile time that F returns void. + CompileAssertTypesEqual(); + + return Action(new Impl(action_)); + } + + private: + template + class Impl : public ActionInterface { + public: + typedef typename internal::Function::Result Result; + typedef typename internal::Function::ArgumentTuple ArgumentTuple; + + explicit Impl(const A& action) : action_(action) {} + + virtual void Perform(const ArgumentTuple& args) { + // Performs the action and ignores its result. + action_.Perform(args); + } + + private: + // Type OriginalFunction is the same as F except that its return + // type is IgnoredValue. + typedef typename internal::Function::MakeResultIgnoredValue + OriginalFunction; + + const Action action_; + + GTEST_DISALLOW_ASSIGN_(Impl); + }; + + const A action_; + + GTEST_DISALLOW_ASSIGN_(IgnoreResultAction); +}; + +// A ReferenceWrapper object represents a reference to type T, +// which can be either const or not. It can be explicitly converted +// from, and implicitly converted to, a T&. Unlike a reference, +// ReferenceWrapper can be copied and can survive template type +// inference. This is used to support by-reference arguments in the +// InvokeArgument(...) action. The idea was from "reference +// wrappers" in tr1, which we don't have in our source tree yet. +template +class ReferenceWrapper { + public: + // Constructs a ReferenceWrapper object from a T&. + explicit ReferenceWrapper(T& l_value) : pointer_(&l_value) {} // NOLINT + + // Allows a ReferenceWrapper object to be implicitly converted to + // a T&. + operator T&() const { return *pointer_; } + private: + T* pointer_; +}; + +// Allows the expression ByRef(x) to be printed as a reference to x. +template +void PrintTo(const ReferenceWrapper& ref, ::std::ostream* os) { + T& value = ref; + UniversalPrinter::Print(value, os); +} + +// Does two actions sequentially. Used for implementing the DoAll(a1, +// a2, ...) action. +template +class DoBothAction { + public: + DoBothAction(Action1 action1, Action2 action2) + : action1_(action1), action2_(action2) {} + + // This template type conversion operator allows DoAll(a1, ..., a_n) + // to be used in ANY function of compatible type. + template + operator Action() const { + return Action(new Impl(action1_, action2_)); + } + + private: + // Implements the DoAll(...) action for a particular function type F. + template + class Impl : public ActionInterface { + public: + typedef typename Function::Result Result; + typedef typename Function::ArgumentTuple ArgumentTuple; + typedef typename Function::MakeResultVoid VoidResult; + + Impl(const Action& action1, const Action& action2) + : action1_(action1), action2_(action2) {} + + virtual Result Perform(const ArgumentTuple& args) { + action1_.Perform(args); + return action2_.Perform(args); + } + + private: + const Action action1_; + const Action action2_; + + GTEST_DISALLOW_ASSIGN_(Impl); + }; + + Action1 action1_; + Action2 action2_; + + GTEST_DISALLOW_ASSIGN_(DoBothAction); +}; + +} // namespace internal + +// An Unused object can be implicitly constructed from ANY value. +// This is handy when defining actions that ignore some or all of the +// mock function arguments. For example, given +// +// MOCK_METHOD3(Foo, double(const string& label, double x, double y)); +// MOCK_METHOD3(Bar, double(int index, double x, double y)); +// +// instead of +// +// double DistanceToOriginWithLabel(const string& label, double x, double y) { +// return sqrt(x*x + y*y); +// } +// double DistanceToOriginWithIndex(int index, double x, double y) { +// return sqrt(x*x + y*y); +// } +// ... +// EXPECT_CALL(mock, Foo("abc", _, _)) +// .WillOnce(Invoke(DistanceToOriginWithLabel)); +// EXPECT_CALL(mock, Bar(5, _, _)) +// .WillOnce(Invoke(DistanceToOriginWithIndex)); +// +// you could write +// +// // We can declare any uninteresting argument as Unused. +// double DistanceToOrigin(Unused, double x, double y) { +// return sqrt(x*x + y*y); +// } +// ... +// EXPECT_CALL(mock, Foo("abc", _, _)).WillOnce(Invoke(DistanceToOrigin)); +// EXPECT_CALL(mock, Bar(5, _, _)).WillOnce(Invoke(DistanceToOrigin)); +typedef internal::IgnoredValue Unused; + +// This constructor allows us to turn an Action object into an +// Action, as long as To's arguments can be implicitly converted +// to From's and From's return type cann be implicitly converted to +// To's. +template +template +Action::Action(const Action& from) + : impl_(new internal::ActionAdaptor(from)) {} + +// Creates an action that returns 'value'. 'value' is passed by value +// instead of const reference - otherwise Return("string literal") +// will trigger a compiler error about using array as initializer. +template +internal::ReturnAction Return(R value) { + return internal::ReturnAction(internal::move(value)); +} + +// Creates an action that returns NULL. +inline PolymorphicAction ReturnNull() { + return MakePolymorphicAction(internal::ReturnNullAction()); +} + +// Creates an action that returns from a void function. +inline PolymorphicAction Return() { + return MakePolymorphicAction(internal::ReturnVoidAction()); +} + +// Creates an action that returns the reference to a variable. +template +inline internal::ReturnRefAction ReturnRef(R& x) { // NOLINT + return internal::ReturnRefAction(x); +} + +// Creates an action that returns the reference to a copy of the +// argument. The copy is created when the action is constructed and +// lives as long as the action. +template +inline internal::ReturnRefOfCopyAction ReturnRefOfCopy(const R& x) { + return internal::ReturnRefOfCopyAction(x); +} + +// Modifies the parent action (a Return() action) to perform a move of the +// argument instead of a copy. +// Return(ByMove()) actions can only be executed once and will assert this +// invariant. +template +internal::ByMoveWrapper ByMove(R x) { + return internal::ByMoveWrapper(internal::move(x)); +} + +// Creates an action that does the default action for the give mock function. +inline internal::DoDefaultAction DoDefault() { + return internal::DoDefaultAction(); +} + +// Creates an action that sets the variable pointed by the N-th +// (0-based) function argument to 'value'. +template +PolymorphicAction< + internal::SetArgumentPointeeAction< + N, T, internal::IsAProtocolMessage::value> > +SetArgPointee(const T& x) { + return MakePolymorphicAction(internal::SetArgumentPointeeAction< + N, T, internal::IsAProtocolMessage::value>(x)); +} + +#if !((GTEST_GCC_VER_ && GTEST_GCC_VER_ < 40000) || GTEST_OS_SYMBIAN) +// This overload allows SetArgPointee() to accept a string literal. +// GCC prior to the version 4.0 and Symbian C++ compiler cannot distinguish +// this overload from the templated version and emit a compile error. +template +PolymorphicAction< + internal::SetArgumentPointeeAction > +SetArgPointee(const char* p) { + return MakePolymorphicAction(internal::SetArgumentPointeeAction< + N, const char*, false>(p)); +} + +template +PolymorphicAction< + internal::SetArgumentPointeeAction > +SetArgPointee(const wchar_t* p) { + return MakePolymorphicAction(internal::SetArgumentPointeeAction< + N, const wchar_t*, false>(p)); +} +#endif + +// The following version is DEPRECATED. +template +PolymorphicAction< + internal::SetArgumentPointeeAction< + N, T, internal::IsAProtocolMessage::value> > +SetArgumentPointee(const T& x) { + return MakePolymorphicAction(internal::SetArgumentPointeeAction< + N, T, internal::IsAProtocolMessage::value>(x)); +} + +// Creates an action that sets a pointer referent to a given value. +template +PolymorphicAction > Assign(T1* ptr, T2 val) { + return MakePolymorphicAction(internal::AssignAction(ptr, val)); +} + +#if !GTEST_OS_WINDOWS_MOBILE + +// Creates an action that sets errno and returns the appropriate error. +template +PolymorphicAction > +SetErrnoAndReturn(int errval, T result) { + return MakePolymorphicAction( + internal::SetErrnoAndReturnAction(errval, result)); +} + +#endif // !GTEST_OS_WINDOWS_MOBILE + +// Various overloads for InvokeWithoutArgs(). + +// Creates an action that invokes 'function_impl' with no argument. +template +PolymorphicAction > +InvokeWithoutArgs(FunctionImpl function_impl) { + return MakePolymorphicAction( + internal::InvokeWithoutArgsAction(function_impl)); +} + +// Creates an action that invokes the given method on the given object +// with no argument. +template +PolymorphicAction > +InvokeWithoutArgs(Class* obj_ptr, MethodPtr method_ptr) { + return MakePolymorphicAction( + internal::InvokeMethodWithoutArgsAction( + obj_ptr, method_ptr)); +} + +// Creates an action that performs an_action and throws away its +// result. In other words, it changes the return type of an_action to +// void. an_action MUST NOT return void, or the code won't compile. +template +inline internal::IgnoreResultAction IgnoreResult(const A& an_action) { + return internal::IgnoreResultAction(an_action); +} + +// Creates a reference wrapper for the given L-value. If necessary, +// you can explicitly specify the type of the reference. For example, +// suppose 'derived' is an object of type Derived, ByRef(derived) +// would wrap a Derived&. If you want to wrap a const Base& instead, +// where Base is a base class of Derived, just write: +// +// ByRef(derived) +template +inline internal::ReferenceWrapper ByRef(T& l_value) { // NOLINT + return internal::ReferenceWrapper(l_value); +} + +} // namespace testing + +#endif // GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-cardinalities.h vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-cardinalities.h --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-cardinalities.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-cardinalities.h 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,147 @@ +// Copyright 2007, Google Inc. +// 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 Google Inc. 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 +// OWNER 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. +// +// Author: wan@google.com (Zhanyong Wan) + +// Google Mock - a framework for writing C++ mock classes. +// +// This file implements some commonly used cardinalities. More +// cardinalities can be defined by the user implementing the +// CardinalityInterface interface if necessary. + +#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_ +#define GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_ + +#include +#include // NOLINT +#include "gmock/internal/gmock-port.h" +#include "gtest/gtest.h" + +namespace testing { + +// To implement a cardinality Foo, define: +// 1. a class FooCardinality that implements the +// CardinalityInterface interface, and +// 2. a factory function that creates a Cardinality object from a +// const FooCardinality*. +// +// The two-level delegation design follows that of Matcher, providing +// consistency for extension developers. It also eases ownership +// management as Cardinality objects can now be copied like plain values. + +// The implementation of a cardinality. +class CardinalityInterface { + public: + virtual ~CardinalityInterface() {} + + // Conservative estimate on the lower/upper bound of the number of + // calls allowed. + virtual int ConservativeLowerBound() const { return 0; } + virtual int ConservativeUpperBound() const { return INT_MAX; } + + // Returns true iff call_count calls will satisfy this cardinality. + virtual bool IsSatisfiedByCallCount(int call_count) const = 0; + + // Returns true iff call_count calls will saturate this cardinality. + virtual bool IsSaturatedByCallCount(int call_count) const = 0; + + // Describes self to an ostream. + virtual void DescribeTo(::std::ostream* os) const = 0; +}; + +// A Cardinality is a copyable and IMMUTABLE (except by assignment) +// object that specifies how many times a mock function is expected to +// be called. The implementation of Cardinality is just a linked_ptr +// to const CardinalityInterface, so copying is fairly cheap. +// Don't inherit from Cardinality! +class GTEST_API_ Cardinality { + public: + // Constructs a null cardinality. Needed for storing Cardinality + // objects in STL containers. + Cardinality() {} + + // Constructs a Cardinality from its implementation. + explicit Cardinality(const CardinalityInterface* impl) : impl_(impl) {} + + // Conservative estimate on the lower/upper bound of the number of + // calls allowed. + int ConservativeLowerBound() const { return impl_->ConservativeLowerBound(); } + int ConservativeUpperBound() const { return impl_->ConservativeUpperBound(); } + + // Returns true iff call_count calls will satisfy this cardinality. + bool IsSatisfiedByCallCount(int call_count) const { + return impl_->IsSatisfiedByCallCount(call_count); + } + + // Returns true iff call_count calls will saturate this cardinality. + bool IsSaturatedByCallCount(int call_count) const { + return impl_->IsSaturatedByCallCount(call_count); + } + + // Returns true iff call_count calls will over-saturate this + // cardinality, i.e. exceed the maximum number of allowed calls. + bool IsOverSaturatedByCallCount(int call_count) const { + return impl_->IsSaturatedByCallCount(call_count) && + !impl_->IsSatisfiedByCallCount(call_count); + } + + // Describes self to an ostream + void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); } + + // Describes the given actual call count to an ostream. + static void DescribeActualCallCountTo(int actual_call_count, + ::std::ostream* os); + + private: + internal::linked_ptr impl_; +}; + +// Creates a cardinality that allows at least n calls. +GTEST_API_ Cardinality AtLeast(int n); + +// Creates a cardinality that allows at most n calls. +GTEST_API_ Cardinality AtMost(int n); + +// Creates a cardinality that allows any number of calls. +GTEST_API_ Cardinality AnyNumber(); + +// Creates a cardinality that allows between min and max calls. +GTEST_API_ Cardinality Between(int min, int max); + +// Creates a cardinality that allows exactly n calls. +GTEST_API_ Cardinality Exactly(int n); + +// Creates a cardinality from its implementation. +inline Cardinality MakeCardinality(const CardinalityInterface* c) { + return Cardinality(c); +} + +} // namespace testing + +#endif // GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_ diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-generated-actions.h vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-generated-actions.h --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-generated-actions.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-generated-actions.h 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,2377 @@ +// This file was GENERATED by a script. DO NOT EDIT BY HAND!!! + +// Copyright 2007, Google Inc. +// 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 Google Inc. 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 +// OWNER 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. +// +// Author: wan@google.com (Zhanyong Wan) + +// Google Mock - a framework for writing C++ mock classes. +// +// This file implements some commonly used variadic actions. + +#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ +#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ + +#include "gmock/gmock-actions.h" +#include "gmock/internal/gmock-port.h" + +namespace testing { +namespace internal { + +// InvokeHelper knows how to unpack an N-tuple and invoke an N-ary +// function or method with the unpacked values, where F is a function +// type that takes N arguments. +template +class InvokeHelper; + +template +class InvokeHelper > { + public: + template + static R Invoke(Function function, const ::testing::tuple<>&) { + return function(); + } + + template + static R InvokeMethod(Class* obj_ptr, + MethodPtr method_ptr, + const ::testing::tuple<>&) { + return (obj_ptr->*method_ptr)(); + } +}; + +template +class InvokeHelper > { + public: + template + static R Invoke(Function function, const ::testing::tuple& args) { + return function(get<0>(args)); + } + + template + static R InvokeMethod(Class* obj_ptr, + MethodPtr method_ptr, + const ::testing::tuple& args) { + return (obj_ptr->*method_ptr)(get<0>(args)); + } +}; + +template +class InvokeHelper > { + public: + template + static R Invoke(Function function, const ::testing::tuple& args) { + return function(get<0>(args), get<1>(args)); + } + + template + static R InvokeMethod(Class* obj_ptr, + MethodPtr method_ptr, + const ::testing::tuple& args) { + return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args)); + } +}; + +template +class InvokeHelper > { + public: + template + static R Invoke(Function function, const ::testing::tuple& args) { + return function(get<0>(args), get<1>(args), get<2>(args)); + } + + template + static R InvokeMethod(Class* obj_ptr, + MethodPtr method_ptr, + const ::testing::tuple& args) { + return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), + get<2>(args)); + } +}; + +template +class InvokeHelper > { + public: + template + static R Invoke(Function function, const ::testing::tuple& args) { + return function(get<0>(args), get<1>(args), get<2>(args), + get<3>(args)); + } + + template + static R InvokeMethod(Class* obj_ptr, + MethodPtr method_ptr, + const ::testing::tuple& args) { + return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), + get<2>(args), get<3>(args)); + } +}; + +template +class InvokeHelper > { + public: + template + static R Invoke(Function function, const ::testing::tuple& args) { + return function(get<0>(args), get<1>(args), get<2>(args), + get<3>(args), get<4>(args)); + } + + template + static R InvokeMethod(Class* obj_ptr, + MethodPtr method_ptr, + const ::testing::tuple& args) { + return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), + get<2>(args), get<3>(args), get<4>(args)); + } +}; + +template +class InvokeHelper > { + public: + template + static R Invoke(Function function, const ::testing::tuple& args) { + return function(get<0>(args), get<1>(args), get<2>(args), + get<3>(args), get<4>(args), get<5>(args)); + } + + template + static R InvokeMethod(Class* obj_ptr, + MethodPtr method_ptr, + const ::testing::tuple& args) { + return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), + get<2>(args), get<3>(args), get<4>(args), get<5>(args)); + } +}; + +template +class InvokeHelper > { + public: + template + static R Invoke(Function function, const ::testing::tuple& args) { + return function(get<0>(args), get<1>(args), get<2>(args), + get<3>(args), get<4>(args), get<5>(args), get<6>(args)); + } + + template + static R InvokeMethod(Class* obj_ptr, + MethodPtr method_ptr, + const ::testing::tuple& args) { + return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), + get<2>(args), get<3>(args), get<4>(args), get<5>(args), + get<6>(args)); + } +}; + +template +class InvokeHelper > { + public: + template + static R Invoke(Function function, const ::testing::tuple& args) { + return function(get<0>(args), get<1>(args), get<2>(args), + get<3>(args), get<4>(args), get<5>(args), get<6>(args), + get<7>(args)); + } + + template + static R InvokeMethod(Class* obj_ptr, + MethodPtr method_ptr, + const ::testing::tuple& args) { + return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), + get<2>(args), get<3>(args), get<4>(args), get<5>(args), + get<6>(args), get<7>(args)); + } +}; + +template +class InvokeHelper > { + public: + template + static R Invoke(Function function, const ::testing::tuple& args) { + return function(get<0>(args), get<1>(args), get<2>(args), + get<3>(args), get<4>(args), get<5>(args), get<6>(args), + get<7>(args), get<8>(args)); + } + + template + static R InvokeMethod(Class* obj_ptr, + MethodPtr method_ptr, + const ::testing::tuple& args) { + return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), + get<2>(args), get<3>(args), get<4>(args), get<5>(args), + get<6>(args), get<7>(args), get<8>(args)); + } +}; + +template +class InvokeHelper > { + public: + template + static R Invoke(Function function, const ::testing::tuple& args) { + return function(get<0>(args), get<1>(args), get<2>(args), + get<3>(args), get<4>(args), get<5>(args), get<6>(args), + get<7>(args), get<8>(args), get<9>(args)); + } + + template + static R InvokeMethod(Class* obj_ptr, + MethodPtr method_ptr, + const ::testing::tuple& args) { + return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), + get<2>(args), get<3>(args), get<4>(args), get<5>(args), + get<6>(args), get<7>(args), get<8>(args), get<9>(args)); + } +}; + +// An INTERNAL macro for extracting the type of a tuple field. It's +// subject to change without notice - DO NOT USE IN USER CODE! +#define GMOCK_FIELD_(Tuple, N) \ + typename ::testing::tuple_element::type + +// SelectArgs::type is the +// type of an n-ary function whose i-th (1-based) argument type is the +// k{i}-th (0-based) field of ArgumentTuple, which must be a tuple +// type, and whose return type is Result. For example, +// SelectArgs, 0, 3>::type +// is int(bool, long). +// +// SelectArgs::Select(args) +// returns the selected fields (k1, k2, ..., k_n) of args as a tuple. +// For example, +// SelectArgs, 2, 0>::Select( +// ::testing::make_tuple(true, 'a', 2.5)) +// returns tuple (2.5, true). +// +// The numbers in list k1, k2, ..., k_n must be >= 0, where n can be +// in the range [0, 10]. Duplicates are allowed and they don't have +// to be in an ascending or descending order. + +template +class SelectArgs { + public: + typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1), + GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3), + GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5), + GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7), + GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9), + GMOCK_FIELD_(ArgumentTuple, k10)); + typedef typename Function::ArgumentTuple SelectedArgs; + static SelectedArgs Select(const ArgumentTuple& args) { + return SelectedArgs(get(args), get(args), get(args), + get(args), get(args), get(args), get(args), + get(args), get(args), get(args)); + } +}; + +template +class SelectArgs { + public: + typedef Result type(); + typedef typename Function::ArgumentTuple SelectedArgs; + static SelectedArgs Select(const ArgumentTuple& /* args */) { + return SelectedArgs(); + } +}; + +template +class SelectArgs { + public: + typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1)); + typedef typename Function::ArgumentTuple SelectedArgs; + static SelectedArgs Select(const ArgumentTuple& args) { + return SelectedArgs(get(args)); + } +}; + +template +class SelectArgs { + public: + typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1), + GMOCK_FIELD_(ArgumentTuple, k2)); + typedef typename Function::ArgumentTuple SelectedArgs; + static SelectedArgs Select(const ArgumentTuple& args) { + return SelectedArgs(get(args), get(args)); + } +}; + +template +class SelectArgs { + public: + typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1), + GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3)); + typedef typename Function::ArgumentTuple SelectedArgs; + static SelectedArgs Select(const ArgumentTuple& args) { + return SelectedArgs(get(args), get(args), get(args)); + } +}; + +template +class SelectArgs { + public: + typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1), + GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3), + GMOCK_FIELD_(ArgumentTuple, k4)); + typedef typename Function::ArgumentTuple SelectedArgs; + static SelectedArgs Select(const ArgumentTuple& args) { + return SelectedArgs(get(args), get(args), get(args), + get(args)); + } +}; + +template +class SelectArgs { + public: + typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1), + GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3), + GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5)); + typedef typename Function::ArgumentTuple SelectedArgs; + static SelectedArgs Select(const ArgumentTuple& args) { + return SelectedArgs(get(args), get(args), get(args), + get(args), get(args)); + } +}; + +template +class SelectArgs { + public: + typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1), + GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3), + GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5), + GMOCK_FIELD_(ArgumentTuple, k6)); + typedef typename Function::ArgumentTuple SelectedArgs; + static SelectedArgs Select(const ArgumentTuple& args) { + return SelectedArgs(get(args), get(args), get(args), + get(args), get(args), get(args)); + } +}; + +template +class SelectArgs { + public: + typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1), + GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3), + GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5), + GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7)); + typedef typename Function::ArgumentTuple SelectedArgs; + static SelectedArgs Select(const ArgumentTuple& args) { + return SelectedArgs(get(args), get(args), get(args), + get(args), get(args), get(args), get(args)); + } +}; + +template +class SelectArgs { + public: + typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1), + GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3), + GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5), + GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7), + GMOCK_FIELD_(ArgumentTuple, k8)); + typedef typename Function::ArgumentTuple SelectedArgs; + static SelectedArgs Select(const ArgumentTuple& args) { + return SelectedArgs(get(args), get(args), get(args), + get(args), get(args), get(args), get(args), + get(args)); + } +}; + +template +class SelectArgs { + public: + typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1), + GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3), + GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5), + GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7), + GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9)); + typedef typename Function::ArgumentTuple SelectedArgs; + static SelectedArgs Select(const ArgumentTuple& args) { + return SelectedArgs(get(args), get(args), get(args), + get(args), get(args), get(args), get(args), + get(args), get(args)); + } +}; + +#undef GMOCK_FIELD_ + +// Implements the WithArgs action. +template +class WithArgsAction { + public: + explicit WithArgsAction(const InnerAction& action) : action_(action) {} + + template + operator Action() const { return MakeAction(new Impl(action_)); } + + private: + template + class Impl : public ActionInterface { + public: + typedef typename Function::Result Result; + typedef typename Function::ArgumentTuple ArgumentTuple; + + explicit Impl(const InnerAction& action) : action_(action) {} + + virtual Result Perform(const ArgumentTuple& args) { + return action_.Perform(SelectArgs::Select(args)); + } + + private: + typedef typename SelectArgs::type InnerFunctionType; + + Action action_; + }; + + const InnerAction action_; + + GTEST_DISALLOW_ASSIGN_(WithArgsAction); +}; + +// A macro from the ACTION* family (defined later in this file) +// defines an action that can be used in a mock function. Typically, +// these actions only care about a subset of the arguments of the mock +// function. For example, if such an action only uses the second +// argument, it can be used in any mock function that takes >= 2 +// arguments where the type of the second argument is compatible. +// +// Therefore, the action implementation must be prepared to take more +// arguments than it needs. The ExcessiveArg type is used to +// represent those excessive arguments. In order to keep the compiler +// error messages tractable, we define it in the testing namespace +// instead of testing::internal. However, this is an INTERNAL TYPE +// and subject to change without notice, so a user MUST NOT USE THIS +// TYPE DIRECTLY. +struct ExcessiveArg {}; + +// A helper class needed for implementing the ACTION* macros. +template +class ActionHelper { + public: + static Result Perform(Impl* impl, const ::testing::tuple<>& args) { + return impl->template gmock_PerformImpl<>(args, ExcessiveArg(), + ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), + ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), + ExcessiveArg()); + } + + template + static Result Perform(Impl* impl, const ::testing::tuple& args) { + return impl->template gmock_PerformImpl(args, get<0>(args), + ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), + ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), + ExcessiveArg()); + } + + template + static Result Perform(Impl* impl, const ::testing::tuple& args) { + return impl->template gmock_PerformImpl(args, get<0>(args), + get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), + ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), + ExcessiveArg()); + } + + template + static Result Perform(Impl* impl, const ::testing::tuple& args) { + return impl->template gmock_PerformImpl(args, get<0>(args), + get<1>(args), get<2>(args), ExcessiveArg(), ExcessiveArg(), + ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), + ExcessiveArg()); + } + + template + static Result Perform(Impl* impl, const ::testing::tuple& args) { + return impl->template gmock_PerformImpl(args, get<0>(args), + get<1>(args), get<2>(args), get<3>(args), ExcessiveArg(), + ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), + ExcessiveArg()); + } + + template + static Result Perform(Impl* impl, const ::testing::tuple& args) { + return impl->template gmock_PerformImpl(args, + get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), + ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), + ExcessiveArg()); + } + + template + static Result Perform(Impl* impl, const ::testing::tuple& args) { + return impl->template gmock_PerformImpl(args, + get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), + get<5>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), + ExcessiveArg()); + } + + template + static Result Perform(Impl* impl, const ::testing::tuple& args) { + return impl->template gmock_PerformImpl(args, + get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), + get<5>(args), get<6>(args), ExcessiveArg(), ExcessiveArg(), + ExcessiveArg()); + } + + template + static Result Perform(Impl* impl, const ::testing::tuple& args) { + return impl->template gmock_PerformImpl(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), + get<4>(args), get<5>(args), get<6>(args), get<7>(args), ExcessiveArg(), + ExcessiveArg()); + } + + template + static Result Perform(Impl* impl, const ::testing::tuple& args) { + return impl->template gmock_PerformImpl(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), + get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args), + ExcessiveArg()); + } + + template + static Result Perform(Impl* impl, const ::testing::tuple& args) { + return impl->template gmock_PerformImpl(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), + get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args), + get<9>(args)); + } +}; + +} // namespace internal + +// Various overloads for Invoke(). + +// WithArgs(an_action) creates an action that passes +// the selected arguments of the mock function to an_action and +// performs it. It serves as an adaptor between actions with +// different argument lists. C++ doesn't support default arguments for +// function templates, so we have to overload it. +template +inline internal::WithArgsAction +WithArgs(const InnerAction& action) { + return internal::WithArgsAction(action); +} + +template +inline internal::WithArgsAction +WithArgs(const InnerAction& action) { + return internal::WithArgsAction(action); +} + +template +inline internal::WithArgsAction +WithArgs(const InnerAction& action) { + return internal::WithArgsAction(action); +} + +template +inline internal::WithArgsAction +WithArgs(const InnerAction& action) { + return internal::WithArgsAction(action); +} + +template +inline internal::WithArgsAction +WithArgs(const InnerAction& action) { + return internal::WithArgsAction(action); +} + +template +inline internal::WithArgsAction +WithArgs(const InnerAction& action) { + return internal::WithArgsAction(action); +} + +template +inline internal::WithArgsAction +WithArgs(const InnerAction& action) { + return internal::WithArgsAction(action); +} + +template +inline internal::WithArgsAction +WithArgs(const InnerAction& action) { + return internal::WithArgsAction(action); +} + +template +inline internal::WithArgsAction +WithArgs(const InnerAction& action) { + return internal::WithArgsAction(action); +} + +template +inline internal::WithArgsAction +WithArgs(const InnerAction& action) { + return internal::WithArgsAction(action); +} + +// Creates an action that does actions a1, a2, ..., sequentially in +// each invocation. +template +inline internal::DoBothAction +DoAll(Action1 a1, Action2 a2) { + return internal::DoBothAction(a1, a2); +} + +template +inline internal::DoBothAction > +DoAll(Action1 a1, Action2 a2, Action3 a3) { + return DoAll(a1, DoAll(a2, a3)); +} + +template +inline internal::DoBothAction > > +DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4) { + return DoAll(a1, DoAll(a2, a3, a4)); +} + +template +inline internal::DoBothAction > > > +DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5) { + return DoAll(a1, DoAll(a2, a3, a4, a5)); +} + +template +inline internal::DoBothAction > > > > +DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6) { + return DoAll(a1, DoAll(a2, a3, a4, a5, a6)); +} + +template +inline internal::DoBothAction > > > > > +DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, + Action7 a7) { + return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7)); +} + +template +inline internal::DoBothAction > > > > > > +DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, + Action7 a7, Action8 a8) { + return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8)); +} + +template +inline internal::DoBothAction > > > > > > > +DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, + Action7 a7, Action8 a8, Action9 a9) { + return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8, a9)); +} + +template +inline internal::DoBothAction > > > > > > > > +DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, + Action7 a7, Action8 a8, Action9 a9, Action10 a10) { + return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8, a9, a10)); +} + +} // namespace testing + +// The ACTION* family of macros can be used in a namespace scope to +// define custom actions easily. The syntax: +// +// ACTION(name) { statements; } +// +// will define an action with the given name that executes the +// statements. The value returned by the statements will be used as +// the return value of the action. Inside the statements, you can +// refer to the K-th (0-based) argument of the mock function by +// 'argK', and refer to its type by 'argK_type'. For example: +// +// ACTION(IncrementArg1) { +// arg1_type temp = arg1; +// return ++(*temp); +// } +// +// allows you to write +// +// ...WillOnce(IncrementArg1()); +// +// You can also refer to the entire argument tuple and its type by +// 'args' and 'args_type', and refer to the mock function type and its +// return type by 'function_type' and 'return_type'. +// +// Note that you don't need to specify the types of the mock function +// arguments. However rest assured that your code is still type-safe: +// you'll get a compiler error if *arg1 doesn't support the ++ +// operator, or if the type of ++(*arg1) isn't compatible with the +// mock function's return type, for example. +// +// Sometimes you'll want to parameterize the action. For that you can use +// another macro: +// +// ACTION_P(name, param_name) { statements; } +// +// For example: +// +// ACTION_P(Add, n) { return arg0 + n; } +// +// will allow you to write: +// +// ...WillOnce(Add(5)); +// +// Note that you don't need to provide the type of the parameter +// either. If you need to reference the type of a parameter named +// 'foo', you can write 'foo_type'. For example, in the body of +// ACTION_P(Add, n) above, you can write 'n_type' to refer to the type +// of 'n'. +// +// We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P10 to support +// multi-parameter actions. +// +// For the purpose of typing, you can view +// +// ACTION_Pk(Foo, p1, ..., pk) { ... } +// +// as shorthand for +// +// template +// FooActionPk Foo(p1_type p1, ..., pk_type pk) { ... } +// +// In particular, you can provide the template type arguments +// explicitly when invoking Foo(), as in Foo(5, false); +// although usually you can rely on the compiler to infer the types +// for you automatically. You can assign the result of expression +// Foo(p1, ..., pk) to a variable of type FooActionPk. This can be useful when composing actions. +// +// You can also overload actions with different numbers of parameters: +// +// ACTION_P(Plus, a) { ... } +// ACTION_P2(Plus, a, b) { ... } +// +// While it's tempting to always use the ACTION* macros when defining +// a new action, you should also consider implementing ActionInterface +// or using MakePolymorphicAction() instead, especially if you need to +// use the action a lot. While these approaches require more work, +// they give you more control on the types of the mock function +// arguments and the action parameters, which in general leads to +// better compiler error messages that pay off in the long run. They +// also allow overloading actions based on parameter types (as opposed +// to just based on the number of parameters). +// +// CAVEAT: +// +// ACTION*() can only be used in a namespace scope. The reason is +// that C++ doesn't yet allow function-local types to be used to +// instantiate templates. The up-coming C++0x standard will fix this. +// Once that's done, we'll consider supporting using ACTION*() inside +// a function. +// +// MORE INFORMATION: +// +// To learn more about using these macros, please search for 'ACTION' +// on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md + +// An internal macro needed for implementing ACTION*(). +#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\ + const args_type& args GTEST_ATTRIBUTE_UNUSED_, \ + arg0_type arg0 GTEST_ATTRIBUTE_UNUSED_, \ + arg1_type arg1 GTEST_ATTRIBUTE_UNUSED_, \ + arg2_type arg2 GTEST_ATTRIBUTE_UNUSED_, \ + arg3_type arg3 GTEST_ATTRIBUTE_UNUSED_, \ + arg4_type arg4 GTEST_ATTRIBUTE_UNUSED_, \ + arg5_type arg5 GTEST_ATTRIBUTE_UNUSED_, \ + arg6_type arg6 GTEST_ATTRIBUTE_UNUSED_, \ + arg7_type arg7 GTEST_ATTRIBUTE_UNUSED_, \ + arg8_type arg8 GTEST_ATTRIBUTE_UNUSED_, \ + arg9_type arg9 GTEST_ATTRIBUTE_UNUSED_ + +// Sometimes you want to give an action explicit template parameters +// that cannot be inferred from its value parameters. ACTION() and +// ACTION_P*() don't support that. ACTION_TEMPLATE() remedies that +// and can be viewed as an extension to ACTION() and ACTION_P*(). +// +// The syntax: +// +// ACTION_TEMPLATE(ActionName, +// HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m), +// AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; } +// +// defines an action template that takes m explicit template +// parameters and n value parameters. name_i is the name of the i-th +// template parameter, and kind_i specifies whether it's a typename, +// an integral constant, or a template. p_i is the name of the i-th +// value parameter. +// +// Example: +// +// // DuplicateArg(output) converts the k-th argument of the mock +// // function to type T and copies it to *output. +// ACTION_TEMPLATE(DuplicateArg, +// HAS_2_TEMPLATE_PARAMS(int, k, typename, T), +// AND_1_VALUE_PARAMS(output)) { +// *output = T(::testing::get(args)); +// } +// ... +// int n; +// EXPECT_CALL(mock, Foo(_, _)) +// .WillOnce(DuplicateArg<1, unsigned char>(&n)); +// +// To create an instance of an action template, write: +// +// ActionName(v1, ..., v_n) +// +// where the ts are the template arguments and the vs are the value +// arguments. The value argument types are inferred by the compiler. +// If you want to explicitly specify the value argument types, you can +// provide additional template arguments: +// +// ActionName(v1, ..., v_n) +// +// where u_i is the desired type of v_i. +// +// ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded on the +// number of value parameters, but not on the number of template +// parameters. Without the restriction, the meaning of the following +// is unclear: +// +// OverloadedAction(x); +// +// Are we using a single-template-parameter action where 'bool' refers +// to the type of x, or are we using a two-template-parameter action +// where the compiler is asked to infer the type of x? +// +// Implementation notes: +// +// GMOCK_INTERNAL_*_HAS_m_TEMPLATE_PARAMS and +// GMOCK_INTERNAL_*_AND_n_VALUE_PARAMS are internal macros for +// implementing ACTION_TEMPLATE. The main trick we use is to create +// new macro invocations when expanding a macro. For example, we have +// +// #define ACTION_TEMPLATE(name, template_params, value_params) +// ... GMOCK_INTERNAL_DECL_##template_params ... +// +// which causes ACTION_TEMPLATE(..., HAS_1_TEMPLATE_PARAMS(typename, T), ...) +// to expand to +// +// ... GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(typename, T) ... +// +// Since GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS is a macro, the +// preprocessor will continue to expand it to +// +// ... typename T ... +// +// This technique conforms to the C++ standard and is portable. It +// allows us to implement action templates using O(N) code, where N is +// the maximum number of template/value parameters supported. Without +// using it, we'd have to devote O(N^2) amount of code to implement all +// combinations of m and n. + +// Declares the template parameters. +#define GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(kind0, name0) kind0 name0 +#define GMOCK_INTERNAL_DECL_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \ + name1) kind0 name0, kind1 name1 +#define GMOCK_INTERNAL_DECL_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ + kind2, name2) kind0 name0, kind1 name1, kind2 name2 +#define GMOCK_INTERNAL_DECL_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ + kind2, name2, kind3, name3) kind0 name0, kind1 name1, kind2 name2, \ + kind3 name3 +#define GMOCK_INTERNAL_DECL_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ + kind2, name2, kind3, name3, kind4, name4) kind0 name0, kind1 name1, \ + kind2 name2, kind3 name3, kind4 name4 +#define GMOCK_INTERNAL_DECL_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ + kind2, name2, kind3, name3, kind4, name4, kind5, name5) kind0 name0, \ + kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5 +#define GMOCK_INTERNAL_DECL_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ + kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \ + name6) kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4, \ + kind5 name5, kind6 name6 +#define GMOCK_INTERNAL_DECL_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ + kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \ + kind7, name7) kind0 name0, kind1 name1, kind2 name2, kind3 name3, \ + kind4 name4, kind5 name5, kind6 name6, kind7 name7 +#define GMOCK_INTERNAL_DECL_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ + kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \ + kind7, name7, kind8, name8) kind0 name0, kind1 name1, kind2 name2, \ + kind3 name3, kind4 name4, kind5 name5, kind6 name6, kind7 name7, \ + kind8 name8 +#define GMOCK_INTERNAL_DECL_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \ + name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \ + name6, kind7, name7, kind8, name8, kind9, name9) kind0 name0, \ + kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5, \ + kind6 name6, kind7 name7, kind8 name8, kind9 name9 + +// Lists the template parameters. +#define GMOCK_INTERNAL_LIST_HAS_1_TEMPLATE_PARAMS(kind0, name0) name0 +#define GMOCK_INTERNAL_LIST_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \ + name1) name0, name1 +#define GMOCK_INTERNAL_LIST_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ + kind2, name2) name0, name1, name2 +#define GMOCK_INTERNAL_LIST_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ + kind2, name2, kind3, name3) name0, name1, name2, name3 +#define GMOCK_INTERNAL_LIST_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ + kind2, name2, kind3, name3, kind4, name4) name0, name1, name2, name3, \ + name4 +#define GMOCK_INTERNAL_LIST_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ + kind2, name2, kind3, name3, kind4, name4, kind5, name5) name0, name1, \ + name2, name3, name4, name5 +#define GMOCK_INTERNAL_LIST_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ + kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \ + name6) name0, name1, name2, name3, name4, name5, name6 +#define GMOCK_INTERNAL_LIST_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ + kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \ + kind7, name7) name0, name1, name2, name3, name4, name5, name6, name7 +#define GMOCK_INTERNAL_LIST_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ + kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \ + kind7, name7, kind8, name8) name0, name1, name2, name3, name4, name5, \ + name6, name7, name8 +#define GMOCK_INTERNAL_LIST_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \ + name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \ + name6, kind7, name7, kind8, name8, kind9, name9) name0, name1, name2, \ + name3, name4, name5, name6, name7, name8, name9 + +// Declares the types of value parameters. +#define GMOCK_INTERNAL_DECL_TYPE_AND_0_VALUE_PARAMS() +#define GMOCK_INTERNAL_DECL_TYPE_AND_1_VALUE_PARAMS(p0) , typename p0##_type +#define GMOCK_INTERNAL_DECL_TYPE_AND_2_VALUE_PARAMS(p0, p1) , \ + typename p0##_type, typename p1##_type +#define GMOCK_INTERNAL_DECL_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , \ + typename p0##_type, typename p1##_type, typename p2##_type +#define GMOCK_INTERNAL_DECL_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \ + typename p0##_type, typename p1##_type, typename p2##_type, \ + typename p3##_type +#define GMOCK_INTERNAL_DECL_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \ + typename p0##_type, typename p1##_type, typename p2##_type, \ + typename p3##_type, typename p4##_type +#define GMOCK_INTERNAL_DECL_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \ + typename p0##_type, typename p1##_type, typename p2##_type, \ + typename p3##_type, typename p4##_type, typename p5##_type +#define GMOCK_INTERNAL_DECL_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ + p6) , typename p0##_type, typename p1##_type, typename p2##_type, \ + typename p3##_type, typename p4##_type, typename p5##_type, \ + typename p6##_type +#define GMOCK_INTERNAL_DECL_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ + p6, p7) , typename p0##_type, typename p1##_type, typename p2##_type, \ + typename p3##_type, typename p4##_type, typename p5##_type, \ + typename p6##_type, typename p7##_type +#define GMOCK_INTERNAL_DECL_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ + p6, p7, p8) , typename p0##_type, typename p1##_type, typename p2##_type, \ + typename p3##_type, typename p4##_type, typename p5##_type, \ + typename p6##_type, typename p7##_type, typename p8##_type +#define GMOCK_INTERNAL_DECL_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ + p6, p7, p8, p9) , typename p0##_type, typename p1##_type, \ + typename p2##_type, typename p3##_type, typename p4##_type, \ + typename p5##_type, typename p6##_type, typename p7##_type, \ + typename p8##_type, typename p9##_type + +// Initializes the value parameters. +#define GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()\ + () +#define GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0)\ + (p0##_type gmock_p0) : p0(gmock_p0) +#define GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1)\ + (p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), p1(gmock_p1) +#define GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2)\ + (p0##_type gmock_p0, p1##_type gmock_p1, \ + p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) +#define GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)\ + (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \ + p3(gmock_p3) +#define GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)\ + (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3, p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), \ + p2(gmock_p2), p3(gmock_p3), p4(gmock_p4) +#define GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)\ + (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3, p4##_type gmock_p4, \ + p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \ + p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) +#define GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)\ + (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ + p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \ + p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6) +#define GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)\ + (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ + p6##_type gmock_p6, p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), \ + p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \ + p7(gmock_p7) +#define GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ + p7, p8)\ + (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ + p6##_type gmock_p6, p7##_type gmock_p7, \ + p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \ + p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \ + p8(gmock_p8) +#define GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ + p7, p8, p9)\ + (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ + p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \ + p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \ + p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \ + p8(gmock_p8), p9(gmock_p9) + +// Declares the fields for storing the value parameters. +#define GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS() +#define GMOCK_INTERNAL_DEFN_AND_1_VALUE_PARAMS(p0) p0##_type p0; +#define GMOCK_INTERNAL_DEFN_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0; \ + p1##_type p1; +#define GMOCK_INTERNAL_DEFN_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0; \ + p1##_type p1; p2##_type p2; +#define GMOCK_INTERNAL_DEFN_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0; \ + p1##_type p1; p2##_type p2; p3##_type p3; +#define GMOCK_INTERNAL_DEFN_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \ + p4) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; +#define GMOCK_INTERNAL_DEFN_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \ + p5) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \ + p5##_type p5; +#define GMOCK_INTERNAL_DEFN_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ + p6) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \ + p5##_type p5; p6##_type p6; +#define GMOCK_INTERNAL_DEFN_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ + p7) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \ + p5##_type p5; p6##_type p6; p7##_type p7; +#define GMOCK_INTERNAL_DEFN_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ + p7, p8) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \ + p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8; +#define GMOCK_INTERNAL_DEFN_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ + p7, p8, p9) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \ + p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8; \ + p9##_type p9; + +// Lists the value parameters. +#define GMOCK_INTERNAL_LIST_AND_0_VALUE_PARAMS() +#define GMOCK_INTERNAL_LIST_AND_1_VALUE_PARAMS(p0) p0 +#define GMOCK_INTERNAL_LIST_AND_2_VALUE_PARAMS(p0, p1) p0, p1 +#define GMOCK_INTERNAL_LIST_AND_3_VALUE_PARAMS(p0, p1, p2) p0, p1, p2 +#define GMOCK_INTERNAL_LIST_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0, p1, p2, p3 +#define GMOCK_INTERNAL_LIST_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) p0, p1, \ + p2, p3, p4 +#define GMOCK_INTERNAL_LIST_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) p0, \ + p1, p2, p3, p4, p5 +#define GMOCK_INTERNAL_LIST_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ + p6) p0, p1, p2, p3, p4, p5, p6 +#define GMOCK_INTERNAL_LIST_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ + p7) p0, p1, p2, p3, p4, p5, p6, p7 +#define GMOCK_INTERNAL_LIST_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ + p7, p8) p0, p1, p2, p3, p4, p5, p6, p7, p8 +#define GMOCK_INTERNAL_LIST_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ + p7, p8, p9) p0, p1, p2, p3, p4, p5, p6, p7, p8, p9 + +// Lists the value parameter types. +#define GMOCK_INTERNAL_LIST_TYPE_AND_0_VALUE_PARAMS() +#define GMOCK_INTERNAL_LIST_TYPE_AND_1_VALUE_PARAMS(p0) , p0##_type +#define GMOCK_INTERNAL_LIST_TYPE_AND_2_VALUE_PARAMS(p0, p1) , p0##_type, \ + p1##_type +#define GMOCK_INTERNAL_LIST_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , p0##_type, \ + p1##_type, p2##_type +#define GMOCK_INTERNAL_LIST_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \ + p0##_type, p1##_type, p2##_type, p3##_type +#define GMOCK_INTERNAL_LIST_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \ + p0##_type, p1##_type, p2##_type, p3##_type, p4##_type +#define GMOCK_INTERNAL_LIST_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \ + p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type +#define GMOCK_INTERNAL_LIST_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ + p6) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, \ + p6##_type +#define GMOCK_INTERNAL_LIST_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ + p6, p7) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \ + p5##_type, p6##_type, p7##_type +#define GMOCK_INTERNAL_LIST_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ + p6, p7, p8) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \ + p5##_type, p6##_type, p7##_type, p8##_type +#define GMOCK_INTERNAL_LIST_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ + p6, p7, p8, p9) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \ + p5##_type, p6##_type, p7##_type, p8##_type, p9##_type + +// Declares the value parameters. +#define GMOCK_INTERNAL_DECL_AND_0_VALUE_PARAMS() +#define GMOCK_INTERNAL_DECL_AND_1_VALUE_PARAMS(p0) p0##_type p0 +#define GMOCK_INTERNAL_DECL_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0, \ + p1##_type p1 +#define GMOCK_INTERNAL_DECL_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0, \ + p1##_type p1, p2##_type p2 +#define GMOCK_INTERNAL_DECL_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0, \ + p1##_type p1, p2##_type p2, p3##_type p3 +#define GMOCK_INTERNAL_DECL_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \ + p4) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4 +#define GMOCK_INTERNAL_DECL_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \ + p5) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \ + p5##_type p5 +#define GMOCK_INTERNAL_DECL_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ + p6) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \ + p5##_type p5, p6##_type p6 +#define GMOCK_INTERNAL_DECL_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ + p7) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \ + p5##_type p5, p6##_type p6, p7##_type p7 +#define GMOCK_INTERNAL_DECL_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ + p7, p8) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \ + p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8 +#define GMOCK_INTERNAL_DECL_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ + p7, p8, p9) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \ + p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \ + p9##_type p9 + +// The suffix of the class template implementing the action template. +#define GMOCK_INTERNAL_COUNT_AND_0_VALUE_PARAMS() +#define GMOCK_INTERNAL_COUNT_AND_1_VALUE_PARAMS(p0) P +#define GMOCK_INTERNAL_COUNT_AND_2_VALUE_PARAMS(p0, p1) P2 +#define GMOCK_INTERNAL_COUNT_AND_3_VALUE_PARAMS(p0, p1, p2) P3 +#define GMOCK_INTERNAL_COUNT_AND_4_VALUE_PARAMS(p0, p1, p2, p3) P4 +#define GMOCK_INTERNAL_COUNT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) P5 +#define GMOCK_INTERNAL_COUNT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) P6 +#define GMOCK_INTERNAL_COUNT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6) P7 +#define GMOCK_INTERNAL_COUNT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ + p7) P8 +#define GMOCK_INTERNAL_COUNT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ + p7, p8) P9 +#define GMOCK_INTERNAL_COUNT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ + p7, p8, p9) P10 + +// The name of the class template implementing the action template. +#define GMOCK_ACTION_CLASS_(name, value_params)\ + GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params) + +#define ACTION_TEMPLATE(name, template_params, value_params)\ + template \ + class GMOCK_ACTION_CLASS_(name, value_params) {\ + public:\ + explicit GMOCK_ACTION_CLASS_(name, value_params)\ + GMOCK_INTERNAL_INIT_##value_params {}\ + template \ + class gmock_Impl : public ::testing::ActionInterface {\ + public:\ + typedef F function_type;\ + typedef typename ::testing::internal::Function::Result return_type;\ + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\ + virtual return_type Perform(const args_type& args) {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ + template \ + return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \ + arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \ + arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \ + arg9_type arg9) const;\ + GMOCK_INTERNAL_DEFN_##value_params\ + private:\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template operator ::testing::Action() const {\ + return ::testing::Action(\ + new gmock_Impl(GMOCK_INTERNAL_LIST_##value_params));\ + }\ + GMOCK_INTERNAL_DEFN_##value_params\ + private:\ + GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\ + };\ + template \ + inline GMOCK_ACTION_CLASS_(name, value_params)<\ + GMOCK_INTERNAL_LIST_##template_params\ + GMOCK_INTERNAL_LIST_TYPE_##value_params> name(\ + GMOCK_INTERNAL_DECL_##value_params) {\ + return GMOCK_ACTION_CLASS_(name, value_params)<\ + GMOCK_INTERNAL_LIST_##template_params\ + GMOCK_INTERNAL_LIST_TYPE_##value_params>(\ + GMOCK_INTERNAL_LIST_##value_params);\ + }\ + template \ + template \ + template \ + typename ::testing::internal::Function::Result\ + GMOCK_ACTION_CLASS_(name, value_params)<\ + GMOCK_INTERNAL_LIST_##template_params\ + GMOCK_INTERNAL_LIST_TYPE_##value_params>::gmock_Impl::\ + gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const + +#define ACTION(name)\ + class name##Action {\ + public:\ + name##Action() {}\ + template \ + class gmock_Impl : public ::testing::ActionInterface {\ + public:\ + typedef F function_type;\ + typedef typename ::testing::internal::Function::Result return_type;\ + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + gmock_Impl() {}\ + virtual return_type Perform(const args_type& args) {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ + template \ + return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \ + arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \ + arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \ + arg9_type arg9) const;\ + private:\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template operator ::testing::Action() const {\ + return ::testing::Action(new gmock_Impl());\ + }\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##Action);\ + };\ + inline name##Action name() {\ + return name##Action();\ + }\ + template \ + template \ + typename ::testing::internal::Function::Result\ + name##Action::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const + +#define ACTION_P(name, p0)\ + template \ + class name##ActionP {\ + public:\ + explicit name##ActionP(p0##_type gmock_p0) : p0(gmock_p0) {}\ + template \ + class gmock_Impl : public ::testing::ActionInterface {\ + public:\ + typedef F function_type;\ + typedef typename ::testing::internal::Function::Result return_type;\ + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + explicit gmock_Impl(p0##_type gmock_p0) : p0(gmock_p0) {}\ + virtual return_type Perform(const args_type& args) {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ + template \ + return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \ + arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \ + arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \ + arg9_type arg9) const;\ + p0##_type p0;\ + private:\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template operator ::testing::Action() const {\ + return ::testing::Action(new gmock_Impl(p0));\ + }\ + p0##_type p0;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##ActionP);\ + };\ + template \ + inline name##ActionP name(p0##_type p0) {\ + return name##ActionP(p0);\ + }\ + template \ + template \ + template \ + typename ::testing::internal::Function::Result\ + name##ActionP::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const + +#define ACTION_P2(name, p0, p1)\ + template \ + class name##ActionP2 {\ + public:\ + name##ActionP2(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \ + p1(gmock_p1) {}\ + template \ + class gmock_Impl : public ::testing::ActionInterface {\ + public:\ + typedef F function_type;\ + typedef typename ::testing::internal::Function::Result return_type;\ + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \ + p1(gmock_p1) {}\ + virtual return_type Perform(const args_type& args) {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ + template \ + return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \ + arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \ + arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \ + arg9_type arg9) const;\ + p0##_type p0;\ + p1##_type p1;\ + private:\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template operator ::testing::Action() const {\ + return ::testing::Action(new gmock_Impl(p0, p1));\ + }\ + p0##_type p0;\ + p1##_type p1;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##ActionP2);\ + };\ + template \ + inline name##ActionP2 name(p0##_type p0, \ + p1##_type p1) {\ + return name##ActionP2(p0, p1);\ + }\ + template \ + template \ + template \ + typename ::testing::internal::Function::Result\ + name##ActionP2::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const + +#define ACTION_P3(name, p0, p1, p2)\ + template \ + class name##ActionP3 {\ + public:\ + name##ActionP3(p0##_type gmock_p0, p1##_type gmock_p1, \ + p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\ + template \ + class gmock_Impl : public ::testing::ActionInterface {\ + public:\ + typedef F function_type;\ + typedef typename ::testing::internal::Function::Result return_type;\ + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, \ + p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\ + virtual return_type Perform(const args_type& args) {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ + template \ + return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \ + arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \ + arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \ + arg9_type arg9) const;\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + private:\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template operator ::testing::Action() const {\ + return ::testing::Action(new gmock_Impl(p0, p1, p2));\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##ActionP3);\ + };\ + template \ + inline name##ActionP3 name(p0##_type p0, \ + p1##_type p1, p2##_type p2) {\ + return name##ActionP3(p0, p1, p2);\ + }\ + template \ + template \ + template \ + typename ::testing::internal::Function::Result\ + name##ActionP3::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const + +#define ACTION_P4(name, p0, p1, p2, p3)\ + template \ + class name##ActionP4 {\ + public:\ + name##ActionP4(p0##_type gmock_p0, p1##_type gmock_p1, \ + p2##_type gmock_p2, p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), \ + p2(gmock_p2), p3(gmock_p3) {}\ + template \ + class gmock_Impl : public ::testing::ActionInterface {\ + public:\ + typedef F function_type;\ + typedef typename ::testing::internal::Function::Result return_type;\ + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \ + p3(gmock_p3) {}\ + virtual return_type Perform(const args_type& args) {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ + template \ + return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \ + arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \ + arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \ + arg9_type arg9) const;\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + private:\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template operator ::testing::Action() const {\ + return ::testing::Action(new gmock_Impl(p0, p1, p2, p3));\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##ActionP4);\ + };\ + template \ + inline name##ActionP4 name(p0##_type p0, p1##_type p1, p2##_type p2, \ + p3##_type p3) {\ + return name##ActionP4(p0, p1, \ + p2, p3);\ + }\ + template \ + template \ + template \ + typename ::testing::internal::Function::Result\ + name##ActionP4::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const + +#define ACTION_P5(name, p0, p1, p2, p3, p4)\ + template \ + class name##ActionP5 {\ + public:\ + name##ActionP5(p0##_type gmock_p0, p1##_type gmock_p1, \ + p2##_type gmock_p2, p3##_type gmock_p3, \ + p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \ + p3(gmock_p3), p4(gmock_p4) {}\ + template \ + class gmock_Impl : public ::testing::ActionInterface {\ + public:\ + typedef F function_type;\ + typedef typename ::testing::internal::Function::Result return_type;\ + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3, p4##_type gmock_p4) : p0(gmock_p0), \ + p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), p4(gmock_p4) {}\ + virtual return_type Perform(const args_type& args) {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ + template \ + return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \ + arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \ + arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \ + arg9_type arg9) const;\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + private:\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template operator ::testing::Action() const {\ + return ::testing::Action(new gmock_Impl(p0, p1, p2, p3, p4));\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##ActionP5);\ + };\ + template \ + inline name##ActionP5 name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \ + p4##_type p4) {\ + return name##ActionP5(p0, p1, p2, p3, p4);\ + }\ + template \ + template \ + template \ + typename ::testing::internal::Function::Result\ + name##ActionP5::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const + +#define ACTION_P6(name, p0, p1, p2, p3, p4, p5)\ + template \ + class name##ActionP6 {\ + public:\ + name##ActionP6(p0##_type gmock_p0, p1##_type gmock_p1, \ + p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ + p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \ + p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {}\ + template \ + class gmock_Impl : public ::testing::ActionInterface {\ + public:\ + typedef F function_type;\ + typedef typename ::testing::internal::Function::Result return_type;\ + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3, p4##_type gmock_p4, \ + p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \ + p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {}\ + virtual return_type Perform(const args_type& args) {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ + template \ + return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \ + arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \ + arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \ + arg9_type arg9) const;\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + private:\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template operator ::testing::Action() const {\ + return ::testing::Action(new gmock_Impl(p0, p1, p2, p3, p4, p5));\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##ActionP6);\ + };\ + template \ + inline name##ActionP6 name(p0##_type p0, p1##_type p1, p2##_type p2, \ + p3##_type p3, p4##_type p4, p5##_type p5) {\ + return name##ActionP6(p0, p1, p2, p3, p4, p5);\ + }\ + template \ + template \ + template \ + typename ::testing::internal::Function::Result\ + name##ActionP6::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const + +#define ACTION_P7(name, p0, p1, p2, p3, p4, p5, p6)\ + template \ + class name##ActionP7 {\ + public:\ + name##ActionP7(p0##_type gmock_p0, p1##_type gmock_p1, \ + p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ + p5##_type gmock_p5, p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), \ + p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), \ + p6(gmock_p6) {}\ + template \ + class gmock_Impl : public ::testing::ActionInterface {\ + public:\ + typedef F function_type;\ + typedef typename ::testing::internal::Function::Result return_type;\ + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ + p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \ + p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6) {}\ + virtual return_type Perform(const args_type& args) {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ + template \ + return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \ + arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \ + arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \ + arg9_type arg9) const;\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + p6##_type p6;\ + private:\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template operator ::testing::Action() const {\ + return ::testing::Action(new gmock_Impl(p0, p1, p2, p3, p4, p5, \ + p6));\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + p6##_type p6;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##ActionP7);\ + };\ + template \ + inline name##ActionP7 name(p0##_type p0, p1##_type p1, \ + p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \ + p6##_type p6) {\ + return name##ActionP7(p0, p1, p2, p3, p4, p5, p6);\ + }\ + template \ + template \ + template \ + typename ::testing::internal::Function::Result\ + name##ActionP7::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const + +#define ACTION_P8(name, p0, p1, p2, p3, p4, p5, p6, p7)\ + template \ + class name##ActionP8 {\ + public:\ + name##ActionP8(p0##_type gmock_p0, p1##_type gmock_p1, \ + p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ + p5##_type gmock_p5, p6##_type gmock_p6, \ + p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \ + p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \ + p7(gmock_p7) {}\ + template \ + class gmock_Impl : public ::testing::ActionInterface {\ + public:\ + typedef F function_type;\ + typedef typename ::testing::internal::Function::Result return_type;\ + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ + p6##_type gmock_p6, p7##_type gmock_p7) : p0(gmock_p0), \ + p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), \ + p5(gmock_p5), p6(gmock_p6), p7(gmock_p7) {}\ + virtual return_type Perform(const args_type& args) {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ + template \ + return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \ + arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \ + arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \ + arg9_type arg9) const;\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + p6##_type p6;\ + p7##_type p7;\ + private:\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template operator ::testing::Action() const {\ + return ::testing::Action(new gmock_Impl(p0, p1, p2, p3, p4, p5, \ + p6, p7));\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + p6##_type p6;\ + p7##_type p7;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##ActionP8);\ + };\ + template \ + inline name##ActionP8 name(p0##_type p0, \ + p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \ + p6##_type p6, p7##_type p7) {\ + return name##ActionP8(p0, p1, p2, p3, p4, p5, \ + p6, p7);\ + }\ + template \ + template \ + template \ + typename ::testing::internal::Function::Result\ + name##ActionP8::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const + +#define ACTION_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8)\ + template \ + class name##ActionP9 {\ + public:\ + name##ActionP9(p0##_type gmock_p0, p1##_type gmock_p1, \ + p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ + p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \ + p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \ + p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \ + p8(gmock_p8) {}\ + template \ + class gmock_Impl : public ::testing::ActionInterface {\ + public:\ + typedef F function_type;\ + typedef typename ::testing::internal::Function::Result return_type;\ + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ + p6##_type gmock_p6, p7##_type gmock_p7, \ + p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \ + p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \ + p7(gmock_p7), p8(gmock_p8) {}\ + virtual return_type Perform(const args_type& args) {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ + template \ + return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \ + arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \ + arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \ + arg9_type arg9) const;\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + p6##_type p6;\ + p7##_type p7;\ + p8##_type p8;\ + private:\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template operator ::testing::Action() const {\ + return ::testing::Action(new gmock_Impl(p0, p1, p2, p3, p4, p5, \ + p6, p7, p8));\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + p6##_type p6;\ + p7##_type p7;\ + p8##_type p8;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##ActionP9);\ + };\ + template \ + inline name##ActionP9 name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \ + p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \ + p8##_type p8) {\ + return name##ActionP9(p0, p1, p2, \ + p3, p4, p5, p6, p7, p8);\ + }\ + template \ + template \ + template \ + typename ::testing::internal::Function::Result\ + name##ActionP9::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const + +#define ACTION_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)\ + template \ + class name##ActionP10 {\ + public:\ + name##ActionP10(p0##_type gmock_p0, p1##_type gmock_p1, \ + p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ + p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \ + p8##_type gmock_p8, p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), \ + p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \ + p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {}\ + template \ + class gmock_Impl : public ::testing::ActionInterface {\ + public:\ + typedef F function_type;\ + typedef typename ::testing::internal::Function::Result return_type;\ + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ + p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \ + p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \ + p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \ + p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {}\ + virtual return_type Perform(const args_type& args) {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ + template \ + return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \ + arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \ + arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \ + arg9_type arg9) const;\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + p6##_type p6;\ + p7##_type p7;\ + p8##_type p8;\ + p9##_type p9;\ + private:\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template operator ::testing::Action() const {\ + return ::testing::Action(new gmock_Impl(p0, p1, p2, p3, p4, p5, \ + p6, p7, p8, p9));\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + p6##_type p6;\ + p7##_type p7;\ + p8##_type p8;\ + p9##_type p9;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##ActionP10);\ + };\ + template \ + inline name##ActionP10 name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \ + p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \ + p9##_type p9) {\ + return name##ActionP10(p0, \ + p1, p2, p3, p4, p5, p6, p7, p8, p9);\ + }\ + template \ + template \ + template \ + typename ::testing::internal::Function::Result\ + name##ActionP10::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const + +namespace testing { + + +// The ACTION*() macros trigger warning C4100 (unreferenced formal +// parameter) in MSVC with -W4. Unfortunately they cannot be fixed in +// the macro definition, as the warnings are generated when the macro +// is expanded and macro expansion cannot contain #pragma. Therefore +// we suppress them here. +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable:4100) +#endif + +// Various overloads for InvokeArgument(). +// +// The InvokeArgument(a1, a2, ..., a_k) action invokes the N-th +// (0-based) argument, which must be a k-ary callable, of the mock +// function, with arguments a1, a2, ..., a_k. +// +// Notes: +// +// 1. The arguments are passed by value by default. If you need to +// pass an argument by reference, wrap it inside ByRef(). For +// example, +// +// InvokeArgument<1>(5, string("Hello"), ByRef(foo)) +// +// passes 5 and string("Hello") by value, and passes foo by +// reference. +// +// 2. If the callable takes an argument by reference but ByRef() is +// not used, it will receive the reference to a copy of the value, +// instead of the original value. For example, when the 0-th +// argument of the mock function takes a const string&, the action +// +// InvokeArgument<0>(string("Hello")) +// +// makes a copy of the temporary string("Hello") object and passes a +// reference of the copy, instead of the original temporary object, +// to the callable. This makes it easy for a user to define an +// InvokeArgument action from temporary values and have it performed +// later. + +namespace internal { +namespace invoke_argument { + +// Appears in InvokeArgumentAdl's argument list to help avoid +// accidental calls to user functions of the same name. +struct AdlTag {}; + +// InvokeArgumentAdl - a helper for InvokeArgument. +// The basic overloads are provided here for generic functors. +// Overloads for other custom-callables are provided in the +// internal/custom/callback-actions.h header. + +template +R InvokeArgumentAdl(AdlTag, F f) { + return f(); +} +template +R InvokeArgumentAdl(AdlTag, F f, A1 a1) { + return f(a1); +} +template +R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2) { + return f(a1, a2); +} +template +R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3) { + return f(a1, a2, a3); +} +template +R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4) { + return f(a1, a2, a3, a4); +} +template +R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { + return f(a1, a2, a3, a4, a5); +} +template +R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) { + return f(a1, a2, a3, a4, a5, a6); +} +template +R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, + A7 a7) { + return f(a1, a2, a3, a4, a5, a6, a7); +} +template +R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, + A7 a7, A8 a8) { + return f(a1, a2, a3, a4, a5, a6, a7, a8); +} +template +R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, + A7 a7, A8 a8, A9 a9) { + return f(a1, a2, a3, a4, a5, a6, a7, a8, a9); +} +template +R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, + A7 a7, A8 a8, A9 a9, A10 a10) { + return f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); +} +} // namespace invoke_argument +} // namespace internal + +ACTION_TEMPLATE(InvokeArgument, + HAS_1_TEMPLATE_PARAMS(int, k), + AND_0_VALUE_PARAMS()) { + using internal::invoke_argument::InvokeArgumentAdl; + return InvokeArgumentAdl( + internal::invoke_argument::AdlTag(), + ::testing::get(args)); +} + +ACTION_TEMPLATE(InvokeArgument, + HAS_1_TEMPLATE_PARAMS(int, k), + AND_1_VALUE_PARAMS(p0)) { + using internal::invoke_argument::InvokeArgumentAdl; + return InvokeArgumentAdl( + internal::invoke_argument::AdlTag(), + ::testing::get(args), p0); +} + +ACTION_TEMPLATE(InvokeArgument, + HAS_1_TEMPLATE_PARAMS(int, k), + AND_2_VALUE_PARAMS(p0, p1)) { + using internal::invoke_argument::InvokeArgumentAdl; + return InvokeArgumentAdl( + internal::invoke_argument::AdlTag(), + ::testing::get(args), p0, p1); +} + +ACTION_TEMPLATE(InvokeArgument, + HAS_1_TEMPLATE_PARAMS(int, k), + AND_3_VALUE_PARAMS(p0, p1, p2)) { + using internal::invoke_argument::InvokeArgumentAdl; + return InvokeArgumentAdl( + internal::invoke_argument::AdlTag(), + ::testing::get(args), p0, p1, p2); +} + +ACTION_TEMPLATE(InvokeArgument, + HAS_1_TEMPLATE_PARAMS(int, k), + AND_4_VALUE_PARAMS(p0, p1, p2, p3)) { + using internal::invoke_argument::InvokeArgumentAdl; + return InvokeArgumentAdl( + internal::invoke_argument::AdlTag(), + ::testing::get(args), p0, p1, p2, p3); +} + +ACTION_TEMPLATE(InvokeArgument, + HAS_1_TEMPLATE_PARAMS(int, k), + AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) { + using internal::invoke_argument::InvokeArgumentAdl; + return InvokeArgumentAdl( + internal::invoke_argument::AdlTag(), + ::testing::get(args), p0, p1, p2, p3, p4); +} + +ACTION_TEMPLATE(InvokeArgument, + HAS_1_TEMPLATE_PARAMS(int, k), + AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) { + using internal::invoke_argument::InvokeArgumentAdl; + return InvokeArgumentAdl( + internal::invoke_argument::AdlTag(), + ::testing::get(args), p0, p1, p2, p3, p4, p5); +} + +ACTION_TEMPLATE(InvokeArgument, + HAS_1_TEMPLATE_PARAMS(int, k), + AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) { + using internal::invoke_argument::InvokeArgumentAdl; + return InvokeArgumentAdl( + internal::invoke_argument::AdlTag(), + ::testing::get(args), p0, p1, p2, p3, p4, p5, p6); +} + +ACTION_TEMPLATE(InvokeArgument, + HAS_1_TEMPLATE_PARAMS(int, k), + AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) { + using internal::invoke_argument::InvokeArgumentAdl; + return InvokeArgumentAdl( + internal::invoke_argument::AdlTag(), + ::testing::get(args), p0, p1, p2, p3, p4, p5, p6, p7); +} + +ACTION_TEMPLATE(InvokeArgument, + HAS_1_TEMPLATE_PARAMS(int, k), + AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) { + using internal::invoke_argument::InvokeArgumentAdl; + return InvokeArgumentAdl( + internal::invoke_argument::AdlTag(), + ::testing::get(args), p0, p1, p2, p3, p4, p5, p6, p7, p8); +} + +ACTION_TEMPLATE(InvokeArgument, + HAS_1_TEMPLATE_PARAMS(int, k), + AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) { + using internal::invoke_argument::InvokeArgumentAdl; + return InvokeArgumentAdl( + internal::invoke_argument::AdlTag(), + ::testing::get(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9); +} + +// Various overloads for ReturnNew(). +// +// The ReturnNew(a1, a2, ..., a_k) action returns a pointer to a new +// instance of type T, constructed on the heap with constructor arguments +// a1, a2, ..., and a_k. The caller assumes ownership of the returned value. +ACTION_TEMPLATE(ReturnNew, + HAS_1_TEMPLATE_PARAMS(typename, T), + AND_0_VALUE_PARAMS()) { + return new T(); +} + +ACTION_TEMPLATE(ReturnNew, + HAS_1_TEMPLATE_PARAMS(typename, T), + AND_1_VALUE_PARAMS(p0)) { + return new T(p0); +} + +ACTION_TEMPLATE(ReturnNew, + HAS_1_TEMPLATE_PARAMS(typename, T), + AND_2_VALUE_PARAMS(p0, p1)) { + return new T(p0, p1); +} + +ACTION_TEMPLATE(ReturnNew, + HAS_1_TEMPLATE_PARAMS(typename, T), + AND_3_VALUE_PARAMS(p0, p1, p2)) { + return new T(p0, p1, p2); +} + +ACTION_TEMPLATE(ReturnNew, + HAS_1_TEMPLATE_PARAMS(typename, T), + AND_4_VALUE_PARAMS(p0, p1, p2, p3)) { + return new T(p0, p1, p2, p3); +} + +ACTION_TEMPLATE(ReturnNew, + HAS_1_TEMPLATE_PARAMS(typename, T), + AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) { + return new T(p0, p1, p2, p3, p4); +} + +ACTION_TEMPLATE(ReturnNew, + HAS_1_TEMPLATE_PARAMS(typename, T), + AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) { + return new T(p0, p1, p2, p3, p4, p5); +} + +ACTION_TEMPLATE(ReturnNew, + HAS_1_TEMPLATE_PARAMS(typename, T), + AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) { + return new T(p0, p1, p2, p3, p4, p5, p6); +} + +ACTION_TEMPLATE(ReturnNew, + HAS_1_TEMPLATE_PARAMS(typename, T), + AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) { + return new T(p0, p1, p2, p3, p4, p5, p6, p7); +} + +ACTION_TEMPLATE(ReturnNew, + HAS_1_TEMPLATE_PARAMS(typename, T), + AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) { + return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8); +} + +ACTION_TEMPLATE(ReturnNew, + HAS_1_TEMPLATE_PARAMS(typename, T), + AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) { + return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9); +} + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +} // namespace testing + +// Include any custom actions added by the local installation. +// We must include this header at the end to make sure it can use the +// declarations from this file. +#include "gmock/internal/custom/gmock-generated-actions.h" + +#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-generated-actions.h.pump vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-generated-actions.h.pump --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-generated-actions.h.pump 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-generated-actions.h.pump 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,794 @@ +$$ -*- mode: c++; -*- +$$ This is a Pump source file. Please use Pump to convert it to +$$ gmock-generated-actions.h. +$$ +$var n = 10 $$ The maximum arity we support. +$$}} This meta comment fixes auto-indentation in editors. +// Copyright 2007, Google Inc. +// 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 Google Inc. 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 +// OWNER 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. +// +// Author: wan@google.com (Zhanyong Wan) + +// Google Mock - a framework for writing C++ mock classes. +// +// This file implements some commonly used variadic actions. + +#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ +#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ + +#include "gmock/gmock-actions.h" +#include "gmock/internal/gmock-port.h" + +namespace testing { +namespace internal { + +// InvokeHelper knows how to unpack an N-tuple and invoke an N-ary +// function or method with the unpacked values, where F is a function +// type that takes N arguments. +template +class InvokeHelper; + + +$range i 0..n +$for i [[ +$range j 1..i +$var types = [[$for j [[, typename A$j]]]] +$var as = [[$for j, [[A$j]]]] +$var args = [[$if i==0 [[]] $else [[ args]]]] +$var gets = [[$for j, [[get<$(j - 1)>(args)]]]] +template +class InvokeHelper > { + public: + template + static R Invoke(Function function, const ::testing::tuple<$as>&$args) { + return function($gets); + } + + template + static R InvokeMethod(Class* obj_ptr, + MethodPtr method_ptr, + const ::testing::tuple<$as>&$args) { + return (obj_ptr->*method_ptr)($gets); + } +}; + + +]] +// An INTERNAL macro for extracting the type of a tuple field. It's +// subject to change without notice - DO NOT USE IN USER CODE! +#define GMOCK_FIELD_(Tuple, N) \ + typename ::testing::tuple_element::type + +$range i 1..n + +// SelectArgs::type is the +// type of an n-ary function whose i-th (1-based) argument type is the +// k{i}-th (0-based) field of ArgumentTuple, which must be a tuple +// type, and whose return type is Result. For example, +// SelectArgs, 0, 3>::type +// is int(bool, long). +// +// SelectArgs::Select(args) +// returns the selected fields (k1, k2, ..., k_n) of args as a tuple. +// For example, +// SelectArgs, 2, 0>::Select( +// ::testing::make_tuple(true, 'a', 2.5)) +// returns tuple (2.5, true). +// +// The numbers in list k1, k2, ..., k_n must be >= 0, where n can be +// in the range [0, $n]. Duplicates are allowed and they don't have +// to be in an ascending or descending order. + +template +class SelectArgs { + public: + typedef Result type($for i, [[GMOCK_FIELD_(ArgumentTuple, k$i)]]); + typedef typename Function::ArgumentTuple SelectedArgs; + static SelectedArgs Select(const ArgumentTuple& args) { + return SelectedArgs($for i, [[get(args)]]); + } +}; + + +$for i [[ +$range j 1..n +$range j1 1..i-1 +template +class SelectArgs { + public: + typedef Result type($for j1, [[GMOCK_FIELD_(ArgumentTuple, k$j1)]]); + typedef typename Function::ArgumentTuple SelectedArgs; + static SelectedArgs Select(const ArgumentTuple& [[]] +$if i == 1 [[/* args */]] $else [[args]]) { + return SelectedArgs($for j1, [[get(args)]]); + } +}; + + +]] +#undef GMOCK_FIELD_ + +$var ks = [[$for i, [[k$i]]]] + +// Implements the WithArgs action. +template +class WithArgsAction { + public: + explicit WithArgsAction(const InnerAction& action) : action_(action) {} + + template + operator Action() const { return MakeAction(new Impl(action_)); } + + private: + template + class Impl : public ActionInterface { + public: + typedef typename Function::Result Result; + typedef typename Function::ArgumentTuple ArgumentTuple; + + explicit Impl(const InnerAction& action) : action_(action) {} + + virtual Result Perform(const ArgumentTuple& args) { + return action_.Perform(SelectArgs::Select(args)); + } + + private: + typedef typename SelectArgs::type InnerFunctionType; + + Action action_; + }; + + const InnerAction action_; + + GTEST_DISALLOW_ASSIGN_(WithArgsAction); +}; + +// A macro from the ACTION* family (defined later in this file) +// defines an action that can be used in a mock function. Typically, +// these actions only care about a subset of the arguments of the mock +// function. For example, if such an action only uses the second +// argument, it can be used in any mock function that takes >= 2 +// arguments where the type of the second argument is compatible. +// +// Therefore, the action implementation must be prepared to take more +// arguments than it needs. The ExcessiveArg type is used to +// represent those excessive arguments. In order to keep the compiler +// error messages tractable, we define it in the testing namespace +// instead of testing::internal. However, this is an INTERNAL TYPE +// and subject to change without notice, so a user MUST NOT USE THIS +// TYPE DIRECTLY. +struct ExcessiveArg {}; + +// A helper class needed for implementing the ACTION* macros. +template +class ActionHelper { + public: +$range i 0..n +$for i + +[[ +$var template = [[$if i==0 [[]] $else [[ +$range j 0..i-1 + template <$for j, [[typename A$j]]> +]]]] +$range j 0..i-1 +$var As = [[$for j, [[A$j]]]] +$var as = [[$for j, [[get<$j>(args)]]]] +$range k 1..n-i +$var eas = [[$for k, [[ExcessiveArg()]]]] +$var arg_list = [[$if (i==0) | (i==n) [[$as$eas]] $else [[$as, $eas]]]] +$template + static Result Perform(Impl* impl, const ::testing::tuple<$As>& args) { + return impl->template gmock_PerformImpl<$As>(args, $arg_list); + } + +]] +}; + +} // namespace internal + +// Various overloads for Invoke(). + +// WithArgs(an_action) creates an action that passes +// the selected arguments of the mock function to an_action and +// performs it. It serves as an adaptor between actions with +// different argument lists. C++ doesn't support default arguments for +// function templates, so we have to overload it. + +$range i 1..n +$for i [[ +$range j 1..i +template <$for j [[int k$j, ]]typename InnerAction> +inline internal::WithArgsAction +WithArgs(const InnerAction& action) { + return internal::WithArgsAction(action); +} + + +]] +// Creates an action that does actions a1, a2, ..., sequentially in +// each invocation. +$range i 2..n +$for i [[ +$range j 2..i +$var types = [[$for j, [[typename Action$j]]]] +$var Aas = [[$for j [[, Action$j a$j]]]] + +template +$range k 1..i-1 + +inline $for k [[internal::DoBothAction]] + +DoAll(Action1 a1$Aas) { +$if i==2 [[ + + return internal::DoBothAction(a1, a2); +]] $else [[ +$range j2 2..i + + return DoAll(a1, DoAll($for j2, [[a$j2]])); +]] + +} + +]] + +} // namespace testing + +// The ACTION* family of macros can be used in a namespace scope to +// define custom actions easily. The syntax: +// +// ACTION(name) { statements; } +// +// will define an action with the given name that executes the +// statements. The value returned by the statements will be used as +// the return value of the action. Inside the statements, you can +// refer to the K-th (0-based) argument of the mock function by +// 'argK', and refer to its type by 'argK_type'. For example: +// +// ACTION(IncrementArg1) { +// arg1_type temp = arg1; +// return ++(*temp); +// } +// +// allows you to write +// +// ...WillOnce(IncrementArg1()); +// +// You can also refer to the entire argument tuple and its type by +// 'args' and 'args_type', and refer to the mock function type and its +// return type by 'function_type' and 'return_type'. +// +// Note that you don't need to specify the types of the mock function +// arguments. However rest assured that your code is still type-safe: +// you'll get a compiler error if *arg1 doesn't support the ++ +// operator, or if the type of ++(*arg1) isn't compatible with the +// mock function's return type, for example. +// +// Sometimes you'll want to parameterize the action. For that you can use +// another macro: +// +// ACTION_P(name, param_name) { statements; } +// +// For example: +// +// ACTION_P(Add, n) { return arg0 + n; } +// +// will allow you to write: +// +// ...WillOnce(Add(5)); +// +// Note that you don't need to provide the type of the parameter +// either. If you need to reference the type of a parameter named +// 'foo', you can write 'foo_type'. For example, in the body of +// ACTION_P(Add, n) above, you can write 'n_type' to refer to the type +// of 'n'. +// +// We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P$n to support +// multi-parameter actions. +// +// For the purpose of typing, you can view +// +// ACTION_Pk(Foo, p1, ..., pk) { ... } +// +// as shorthand for +// +// template +// FooActionPk Foo(p1_type p1, ..., pk_type pk) { ... } +// +// In particular, you can provide the template type arguments +// explicitly when invoking Foo(), as in Foo(5, false); +// although usually you can rely on the compiler to infer the types +// for you automatically. You can assign the result of expression +// Foo(p1, ..., pk) to a variable of type FooActionPk. This can be useful when composing actions. +// +// You can also overload actions with different numbers of parameters: +// +// ACTION_P(Plus, a) { ... } +// ACTION_P2(Plus, a, b) { ... } +// +// While it's tempting to always use the ACTION* macros when defining +// a new action, you should also consider implementing ActionInterface +// or using MakePolymorphicAction() instead, especially if you need to +// use the action a lot. While these approaches require more work, +// they give you more control on the types of the mock function +// arguments and the action parameters, which in general leads to +// better compiler error messages that pay off in the long run. They +// also allow overloading actions based on parameter types (as opposed +// to just based on the number of parameters). +// +// CAVEAT: +// +// ACTION*() can only be used in a namespace scope. The reason is +// that C++ doesn't yet allow function-local types to be used to +// instantiate templates. The up-coming C++0x standard will fix this. +// Once that's done, we'll consider supporting using ACTION*() inside +// a function. +// +// MORE INFORMATION: +// +// To learn more about using these macros, please search for 'ACTION' +// on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md + +$range i 0..n +$range k 0..n-1 + +// An internal macro needed for implementing ACTION*(). +#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\ + const args_type& args GTEST_ATTRIBUTE_UNUSED_ +$for k [[, \ + arg$k[[]]_type arg$k GTEST_ATTRIBUTE_UNUSED_]] + + +// Sometimes you want to give an action explicit template parameters +// that cannot be inferred from its value parameters. ACTION() and +// ACTION_P*() don't support that. ACTION_TEMPLATE() remedies that +// and can be viewed as an extension to ACTION() and ACTION_P*(). +// +// The syntax: +// +// ACTION_TEMPLATE(ActionName, +// HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m), +// AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; } +// +// defines an action template that takes m explicit template +// parameters and n value parameters. name_i is the name of the i-th +// template parameter, and kind_i specifies whether it's a typename, +// an integral constant, or a template. p_i is the name of the i-th +// value parameter. +// +// Example: +// +// // DuplicateArg(output) converts the k-th argument of the mock +// // function to type T and copies it to *output. +// ACTION_TEMPLATE(DuplicateArg, +// HAS_2_TEMPLATE_PARAMS(int, k, typename, T), +// AND_1_VALUE_PARAMS(output)) { +// *output = T(::testing::get(args)); +// } +// ... +// int n; +// EXPECT_CALL(mock, Foo(_, _)) +// .WillOnce(DuplicateArg<1, unsigned char>(&n)); +// +// To create an instance of an action template, write: +// +// ActionName(v1, ..., v_n) +// +// where the ts are the template arguments and the vs are the value +// arguments. The value argument types are inferred by the compiler. +// If you want to explicitly specify the value argument types, you can +// provide additional template arguments: +// +// ActionName(v1, ..., v_n) +// +// where u_i is the desired type of v_i. +// +// ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded on the +// number of value parameters, but not on the number of template +// parameters. Without the restriction, the meaning of the following +// is unclear: +// +// OverloadedAction(x); +// +// Are we using a single-template-parameter action where 'bool' refers +// to the type of x, or are we using a two-template-parameter action +// where the compiler is asked to infer the type of x? +// +// Implementation notes: +// +// GMOCK_INTERNAL_*_HAS_m_TEMPLATE_PARAMS and +// GMOCK_INTERNAL_*_AND_n_VALUE_PARAMS are internal macros for +// implementing ACTION_TEMPLATE. The main trick we use is to create +// new macro invocations when expanding a macro. For example, we have +// +// #define ACTION_TEMPLATE(name, template_params, value_params) +// ... GMOCK_INTERNAL_DECL_##template_params ... +// +// which causes ACTION_TEMPLATE(..., HAS_1_TEMPLATE_PARAMS(typename, T), ...) +// to expand to +// +// ... GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(typename, T) ... +// +// Since GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS is a macro, the +// preprocessor will continue to expand it to +// +// ... typename T ... +// +// This technique conforms to the C++ standard and is portable. It +// allows us to implement action templates using O(N) code, where N is +// the maximum number of template/value parameters supported. Without +// using it, we'd have to devote O(N^2) amount of code to implement all +// combinations of m and n. + +// Declares the template parameters. + +$range j 1..n +$for j [[ +$range m 0..j-1 +#define GMOCK_INTERNAL_DECL_HAS_$j[[]] +_TEMPLATE_PARAMS($for m, [[kind$m, name$m]]) $for m, [[kind$m name$m]] + + +]] + +// Lists the template parameters. + +$for j [[ +$range m 0..j-1 +#define GMOCK_INTERNAL_LIST_HAS_$j[[]] +_TEMPLATE_PARAMS($for m, [[kind$m, name$m]]) $for m, [[name$m]] + + +]] + +// Declares the types of value parameters. + +$for i [[ +$range j 0..i-1 +#define GMOCK_INTERNAL_DECL_TYPE_AND_$i[[]] +_VALUE_PARAMS($for j, [[p$j]]) $for j [[, typename p$j##_type]] + + +]] + +// Initializes the value parameters. + +$for i [[ +$range j 0..i-1 +#define GMOCK_INTERNAL_INIT_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]])\ + ($for j, [[p$j##_type gmock_p$j]])$if i>0 [[ : ]]$for j, [[p$j(gmock_p$j)]] + + +]] + +// Declares the fields for storing the value parameters. + +$for i [[ +$range j 0..i-1 +#define GMOCK_INTERNAL_DEFN_AND_$i[[]] +_VALUE_PARAMS($for j, [[p$j]]) $for j [[p$j##_type p$j; ]] + + +]] + +// Lists the value parameters. + +$for i [[ +$range j 0..i-1 +#define GMOCK_INTERNAL_LIST_AND_$i[[]] +_VALUE_PARAMS($for j, [[p$j]]) $for j, [[p$j]] + + +]] + +// Lists the value parameter types. + +$for i [[ +$range j 0..i-1 +#define GMOCK_INTERNAL_LIST_TYPE_AND_$i[[]] +_VALUE_PARAMS($for j, [[p$j]]) $for j [[, p$j##_type]] + + +]] + +// Declares the value parameters. + +$for i [[ +$range j 0..i-1 +#define GMOCK_INTERNAL_DECL_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]]) [[]] +$for j, [[p$j##_type p$j]] + + +]] + +// The suffix of the class template implementing the action template. +$for i [[ + + +$range j 0..i-1 +#define GMOCK_INTERNAL_COUNT_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]]) [[]] +$if i==1 [[P]] $elif i>=2 [[P$i]] +]] + + +// The name of the class template implementing the action template. +#define GMOCK_ACTION_CLASS_(name, value_params)\ + GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params) + +$range k 0..n-1 + +#define ACTION_TEMPLATE(name, template_params, value_params)\ + template \ + class GMOCK_ACTION_CLASS_(name, value_params) {\ + public:\ + explicit GMOCK_ACTION_CLASS_(name, value_params)\ + GMOCK_INTERNAL_INIT_##value_params {}\ + template \ + class gmock_Impl : public ::testing::ActionInterface {\ + public:\ + typedef F function_type;\ + typedef typename ::testing::internal::Function::Result return_type;\ + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\ + virtual return_type Perform(const args_type& args) {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ + template <$for k, [[typename arg$k[[]]_type]]>\ + return_type gmock_PerformImpl(const args_type& args[[]] +$for k [[, arg$k[[]]_type arg$k]]) const;\ + GMOCK_INTERNAL_DEFN_##value_params\ + private:\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template operator ::testing::Action() const {\ + return ::testing::Action(\ + new gmock_Impl(GMOCK_INTERNAL_LIST_##value_params));\ + }\ + GMOCK_INTERNAL_DEFN_##value_params\ + private:\ + GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\ + };\ + template \ + inline GMOCK_ACTION_CLASS_(name, value_params)<\ + GMOCK_INTERNAL_LIST_##template_params\ + GMOCK_INTERNAL_LIST_TYPE_##value_params> name(\ + GMOCK_INTERNAL_DECL_##value_params) {\ + return GMOCK_ACTION_CLASS_(name, value_params)<\ + GMOCK_INTERNAL_LIST_##template_params\ + GMOCK_INTERNAL_LIST_TYPE_##value_params>(\ + GMOCK_INTERNAL_LIST_##value_params);\ + }\ + template \ + template \ + template \ + typename ::testing::internal::Function::Result\ + GMOCK_ACTION_CLASS_(name, value_params)<\ + GMOCK_INTERNAL_LIST_##template_params\ + GMOCK_INTERNAL_LIST_TYPE_##value_params>::gmock_Impl::\ + gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const + +$for i + +[[ +$var template = [[$if i==0 [[]] $else [[ +$range j 0..i-1 + + template <$for j, [[typename p$j##_type]]>\ +]]]] +$var class_name = [[name##Action[[$if i==0 [[]] $elif i==1 [[P]] + $else [[P$i]]]]]] +$range j 0..i-1 +$var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]] +$var param_types_and_names = [[$for j, [[p$j##_type p$j]]]] +$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(gmock_p$j)]]]]]] +$var param_field_decls = [[$for j +[[ + + p$j##_type p$j;\ +]]]] +$var param_field_decls2 = [[$for j +[[ + + p$j##_type p$j;\ +]]]] +$var params = [[$for j, [[p$j]]]] +$var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]] +$var typename_arg_types = [[$for k, [[typename arg$k[[]]_type]]]] +$var arg_types_and_names = [[$for k, [[arg$k[[]]_type arg$k]]]] +$var macro_name = [[$if i==0 [[ACTION]] $elif i==1 [[ACTION_P]] + $else [[ACTION_P$i]]]] + +#define $macro_name(name$for j [[, p$j]])\$template + class $class_name {\ + public:\ + [[$if i==1 [[explicit ]]]]$class_name($ctor_param_list)$inits {}\ + template \ + class gmock_Impl : public ::testing::ActionInterface {\ + public:\ + typedef F function_type;\ + typedef typename ::testing::internal::Function::Result return_type;\ + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + [[$if i==1 [[explicit ]]]]gmock_Impl($ctor_param_list)$inits {}\ + virtual return_type Perform(const args_type& args) {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ + template <$typename_arg_types>\ + return_type gmock_PerformImpl(const args_type& args, [[]] +$arg_types_and_names) const;\$param_field_decls + private:\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template operator ::testing::Action() const {\ + return ::testing::Action(new gmock_Impl($params));\ + }\$param_field_decls2 + private:\ + GTEST_DISALLOW_ASSIGN_($class_name);\ + };\$template + inline $class_name$param_types name($param_types_and_names) {\ + return $class_name$param_types($params);\ + }\$template + template \ + template <$typename_arg_types>\ + typename ::testing::internal::Function::Result\ + $class_name$param_types::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const +]] +$$ } // This meta comment fixes auto-indentation in Emacs. It won't +$$ // show up in the generated code. + + +namespace testing { + + +// The ACTION*() macros trigger warning C4100 (unreferenced formal +// parameter) in MSVC with -W4. Unfortunately they cannot be fixed in +// the macro definition, as the warnings are generated when the macro +// is expanded and macro expansion cannot contain #pragma. Therefore +// we suppress them here. +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable:4100) +#endif + +// Various overloads for InvokeArgument(). +// +// The InvokeArgument(a1, a2, ..., a_k) action invokes the N-th +// (0-based) argument, which must be a k-ary callable, of the mock +// function, with arguments a1, a2, ..., a_k. +// +// Notes: +// +// 1. The arguments are passed by value by default. If you need to +// pass an argument by reference, wrap it inside ByRef(). For +// example, +// +// InvokeArgument<1>(5, string("Hello"), ByRef(foo)) +// +// passes 5 and string("Hello") by value, and passes foo by +// reference. +// +// 2. If the callable takes an argument by reference but ByRef() is +// not used, it will receive the reference to a copy of the value, +// instead of the original value. For example, when the 0-th +// argument of the mock function takes a const string&, the action +// +// InvokeArgument<0>(string("Hello")) +// +// makes a copy of the temporary string("Hello") object and passes a +// reference of the copy, instead of the original temporary object, +// to the callable. This makes it easy for a user to define an +// InvokeArgument action from temporary values and have it performed +// later. + +namespace internal { +namespace invoke_argument { + +// Appears in InvokeArgumentAdl's argument list to help avoid +// accidental calls to user functions of the same name. +struct AdlTag {}; + +// InvokeArgumentAdl - a helper for InvokeArgument. +// The basic overloads are provided here for generic functors. +// Overloads for other custom-callables are provided in the +// internal/custom/callback-actions.h header. + +$range i 0..n +$for i +[[ +$range j 1..i + +template +R InvokeArgumentAdl(AdlTag, F f[[$for j [[, A$j a$j]]]]) { + return f([[$for j, [[a$j]]]]); +} +]] + +} // namespace invoke_argument +} // namespace internal + +$range i 0..n +$for i [[ +$range j 0..i-1 + +ACTION_TEMPLATE(InvokeArgument, + HAS_1_TEMPLATE_PARAMS(int, k), + AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]])) { + using internal::invoke_argument::InvokeArgumentAdl; + return InvokeArgumentAdl( + internal::invoke_argument::AdlTag(), + ::testing::get(args)$for j [[, p$j]]); +} + +]] + +// Various overloads for ReturnNew(). +// +// The ReturnNew(a1, a2, ..., a_k) action returns a pointer to a new +// instance of type T, constructed on the heap with constructor arguments +// a1, a2, ..., and a_k. The caller assumes ownership of the returned value. +$range i 0..n +$for i [[ +$range j 0..i-1 +$var ps = [[$for j, [[p$j]]]] + +ACTION_TEMPLATE(ReturnNew, + HAS_1_TEMPLATE_PARAMS(typename, T), + AND_$i[[]]_VALUE_PARAMS($ps)) { + return new T($ps); +} + +]] + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +} // namespace testing + +// Include any custom callback actions added by the local installation. +// We must include this header at the end to make sure it can use the +// declarations from this file. +#include "gmock/internal/custom/gmock-generated-actions.h" + +#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,1095 @@ +// This file was GENERATED by command: +// pump.py gmock-generated-function-mockers.h.pump +// DO NOT EDIT BY HAND!!! + +// Copyright 2007, Google Inc. +// 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 Google Inc. 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 +// OWNER 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. +// +// Author: wan@google.com (Zhanyong Wan) + +// Google Mock - a framework for writing C++ mock classes. +// +// This file implements function mockers of various arities. + +#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ +#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ + +#include "gmock/gmock-spec-builders.h" +#include "gmock/internal/gmock-internal-utils.h" + +#if GTEST_HAS_STD_FUNCTION_ +# include +#endif + +namespace testing { +namespace internal { + +template +class FunctionMockerBase; + +// Note: class FunctionMocker really belongs to the ::testing +// namespace. However if we define it in ::testing, MSVC will +// complain when classes in ::testing::internal declare it as a +// friend class template. To workaround this compiler bug, we define +// FunctionMocker in ::testing::internal and import it into ::testing. +template +class FunctionMocker; + +template +class FunctionMocker : public + internal::FunctionMockerBase { + public: + typedef R F(); + typedef typename internal::Function::ArgumentTuple ArgumentTuple; + + MockSpec& With() { + return this->current_spec(); + } + + R Invoke() { + // Even though gcc and MSVC don't enforce it, 'this->' is required + // by the C++ standard [14.6.4] here, as the base class type is + // dependent on the template argument (and thus shouldn't be + // looked into when resolving InvokeWith). + return this->InvokeWith(ArgumentTuple()); + } +}; + +template +class FunctionMocker : public + internal::FunctionMockerBase { + public: + typedef R F(A1); + typedef typename internal::Function::ArgumentTuple ArgumentTuple; + + MockSpec& With(const Matcher& m1) { + this->current_spec().SetMatchers(::testing::make_tuple(m1)); + return this->current_spec(); + } + + R Invoke(A1 a1) { + // Even though gcc and MSVC don't enforce it, 'this->' is required + // by the C++ standard [14.6.4] here, as the base class type is + // dependent on the template argument (and thus shouldn't be + // looked into when resolving InvokeWith). + return this->InvokeWith(ArgumentTuple(a1)); + } +}; + +template +class FunctionMocker : public + internal::FunctionMockerBase { + public: + typedef R F(A1, A2); + typedef typename internal::Function::ArgumentTuple ArgumentTuple; + + MockSpec& With(const Matcher& m1, const Matcher& m2) { + this->current_spec().SetMatchers(::testing::make_tuple(m1, m2)); + return this->current_spec(); + } + + R Invoke(A1 a1, A2 a2) { + // Even though gcc and MSVC don't enforce it, 'this->' is required + // by the C++ standard [14.6.4] here, as the base class type is + // dependent on the template argument (and thus shouldn't be + // looked into when resolving InvokeWith). + return this->InvokeWith(ArgumentTuple(a1, a2)); + } +}; + +template +class FunctionMocker : public + internal::FunctionMockerBase { + public: + typedef R F(A1, A2, A3); + typedef typename internal::Function::ArgumentTuple ArgumentTuple; + + MockSpec& With(const Matcher& m1, const Matcher& m2, + const Matcher& m3) { + this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3)); + return this->current_spec(); + } + + R Invoke(A1 a1, A2 a2, A3 a3) { + // Even though gcc and MSVC don't enforce it, 'this->' is required + // by the C++ standard [14.6.4] here, as the base class type is + // dependent on the template argument (and thus shouldn't be + // looked into when resolving InvokeWith). + return this->InvokeWith(ArgumentTuple(a1, a2, a3)); + } +}; + +template +class FunctionMocker : public + internal::FunctionMockerBase { + public: + typedef R F(A1, A2, A3, A4); + typedef typename internal::Function::ArgumentTuple ArgumentTuple; + + MockSpec& With(const Matcher& m1, const Matcher& m2, + const Matcher& m3, const Matcher& m4) { + this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4)); + return this->current_spec(); + } + + R Invoke(A1 a1, A2 a2, A3 a3, A4 a4) { + // Even though gcc and MSVC don't enforce it, 'this->' is required + // by the C++ standard [14.6.4] here, as the base class type is + // dependent on the template argument (and thus shouldn't be + // looked into when resolving InvokeWith). + return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4)); + } +}; + +template +class FunctionMocker : public + internal::FunctionMockerBase { + public: + typedef R F(A1, A2, A3, A4, A5); + typedef typename internal::Function::ArgumentTuple ArgumentTuple; + + MockSpec& With(const Matcher& m1, const Matcher& m2, + const Matcher& m3, const Matcher& m4, const Matcher& m5) { + this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5)); + return this->current_spec(); + } + + R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { + // Even though gcc and MSVC don't enforce it, 'this->' is required + // by the C++ standard [14.6.4] here, as the base class type is + // dependent on the template argument (and thus shouldn't be + // looked into when resolving InvokeWith). + return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5)); + } +}; + +template +class FunctionMocker : public + internal::FunctionMockerBase { + public: + typedef R F(A1, A2, A3, A4, A5, A6); + typedef typename internal::Function::ArgumentTuple ArgumentTuple; + + MockSpec& With(const Matcher& m1, const Matcher& m2, + const Matcher& m3, const Matcher& m4, const Matcher& m5, + const Matcher& m6) { + this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5, + m6)); + return this->current_spec(); + } + + R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) { + // Even though gcc and MSVC don't enforce it, 'this->' is required + // by the C++ standard [14.6.4] here, as the base class type is + // dependent on the template argument (and thus shouldn't be + // looked into when resolving InvokeWith). + return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6)); + } +}; + +template +class FunctionMocker : public + internal::FunctionMockerBase { + public: + typedef R F(A1, A2, A3, A4, A5, A6, A7); + typedef typename internal::Function::ArgumentTuple ArgumentTuple; + + MockSpec& With(const Matcher& m1, const Matcher& m2, + const Matcher& m3, const Matcher& m4, const Matcher& m5, + const Matcher& m6, const Matcher& m7) { + this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5, + m6, m7)); + return this->current_spec(); + } + + R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) { + // Even though gcc and MSVC don't enforce it, 'this->' is required + // by the C++ standard [14.6.4] here, as the base class type is + // dependent on the template argument (and thus shouldn't be + // looked into when resolving InvokeWith). + return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7)); + } +}; + +template +class FunctionMocker : public + internal::FunctionMockerBase { + public: + typedef R F(A1, A2, A3, A4, A5, A6, A7, A8); + typedef typename internal::Function::ArgumentTuple ArgumentTuple; + + MockSpec& With(const Matcher& m1, const Matcher& m2, + const Matcher& m3, const Matcher& m4, const Matcher& m5, + const Matcher& m6, const Matcher& m7, const Matcher& m8) { + this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5, + m6, m7, m8)); + return this->current_spec(); + } + + R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) { + // Even though gcc and MSVC don't enforce it, 'this->' is required + // by the C++ standard [14.6.4] here, as the base class type is + // dependent on the template argument (and thus shouldn't be + // looked into when resolving InvokeWith). + return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8)); + } +}; + +template +class FunctionMocker : public + internal::FunctionMockerBase { + public: + typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9); + typedef typename internal::Function::ArgumentTuple ArgumentTuple; + + MockSpec& With(const Matcher& m1, const Matcher& m2, + const Matcher& m3, const Matcher& m4, const Matcher& m5, + const Matcher& m6, const Matcher& m7, const Matcher& m8, + const Matcher& m9) { + this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5, + m6, m7, m8, m9)); + return this->current_spec(); + } + + R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) { + // Even though gcc and MSVC don't enforce it, 'this->' is required + // by the C++ standard [14.6.4] here, as the base class type is + // dependent on the template argument (and thus shouldn't be + // looked into when resolving InvokeWith). + return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9)); + } +}; + +template +class FunctionMocker : public + internal::FunctionMockerBase { + public: + typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); + typedef typename internal::Function::ArgumentTuple ArgumentTuple; + + MockSpec& With(const Matcher& m1, const Matcher& m2, + const Matcher& m3, const Matcher& m4, const Matcher& m5, + const Matcher& m6, const Matcher& m7, const Matcher& m8, + const Matcher& m9, const Matcher& m10) { + this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5, + m6, m7, m8, m9, m10)); + return this->current_spec(); + } + + R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, + A10 a10) { + // Even though gcc and MSVC don't enforce it, 'this->' is required + // by the C++ standard [14.6.4] here, as the base class type is + // dependent on the template argument (and thus shouldn't be + // looked into when resolving InvokeWith). + return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10)); + } +}; + +} // namespace internal + +// The style guide prohibits "using" statements in a namespace scope +// inside a header file. However, the FunctionMocker class template +// is meant to be defined in the ::testing namespace. The following +// line is just a trick for working around a bug in MSVC 8.0, which +// cannot handle it if we define FunctionMocker in ::testing. +using internal::FunctionMocker; + +// GMOCK_RESULT_(tn, F) expands to the result type of function type F. +// We define this as a variadic macro in case F contains unprotected +// commas (the same reason that we use variadic macros in other places +// in this file). +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_RESULT_(tn, ...) \ + tn ::testing::internal::Function<__VA_ARGS__>::Result + +// The type of argument N of the given function type. +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_ARG_(tn, N, ...) \ + tn ::testing::internal::Function<__VA_ARGS__>::Argument##N + +// The matcher type for argument N of the given function type. +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_MATCHER_(tn, N, ...) \ + const ::testing::Matcher& + +// The variable for mocking the given method. +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_MOCKER_(arity, constness, Method) \ + GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__) + +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + ) constness { \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 0), \ + this_method_does_not_take_0_arguments); \ + GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(0, constness, Method).Invoke(); \ + } \ + ::testing::MockSpec<__VA_ARGS__>& \ + gmock_##Method() constness { \ + GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(0, constness, Method).With(); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(0, constness, \ + Method) + +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 1), \ + this_method_does_not_take_1_argument); \ + GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(1, constness, Method).Invoke(gmock_a1); \ + } \ + ::testing::MockSpec<__VA_ARGS__>& \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \ + GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness, \ + Method) + +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness { \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 2), \ + this_method_does_not_take_2_arguments); \ + GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(2, constness, Method).Invoke(gmock_a1, gmock_a2); \ + } \ + ::testing::MockSpec<__VA_ARGS__>& \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness { \ + GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness, \ + Method) + +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness { \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 3), \ + this_method_does_not_take_3_arguments); \ + GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(3, constness, Method).Invoke(gmock_a1, gmock_a2, \ + gmock_a3); \ + } \ + ::testing::MockSpec<__VA_ARGS__>& \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness { \ + GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(3, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness, \ + Method) + +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 4), \ + this_method_does_not_take_4_arguments); \ + GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(4, constness, Method).Invoke(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4); \ + } \ + ::testing::MockSpec<__VA_ARGS__>& \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness { \ + GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(4, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(4, constness, \ + Method) + +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness { \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 5), \ + this_method_does_not_take_5_arguments); \ + GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(5, constness, Method).Invoke(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5); \ + } \ + ::testing::MockSpec<__VA_ARGS__>& \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness { \ + GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(5, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(5, constness, \ + Method) + +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness { \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 6), \ + this_method_does_not_take_6_arguments); \ + GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(6, constness, Method).Invoke(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6); \ + } \ + ::testing::MockSpec<__VA_ARGS__>& \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness { \ + GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(6, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(6, constness, \ + Method) + +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 7), \ + this_method_does_not_take_7_arguments); \ + GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(7, constness, Method).Invoke(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \ + } \ + ::testing::MockSpec<__VA_ARGS__>& \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness { \ + GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(7, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness, \ + Method) + +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \ + GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness { \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 8), \ + this_method_does_not_take_8_arguments); \ + GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(8, constness, Method).Invoke(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \ + } \ + ::testing::MockSpec<__VA_ARGS__>& \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ + GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness { \ + GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(8, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness, \ + Method) + +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \ + GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \ + GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness { \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 9), \ + this_method_does_not_take_9_arguments); \ + GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(9, constness, Method).Invoke(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \ + gmock_a9); \ + } \ + ::testing::MockSpec<__VA_ARGS__>& \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ + GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \ + GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness { \ + GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(9, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \ + gmock_a9); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness, \ + Method) + +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \ + GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \ + GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \ + GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 10), \ + this_method_does_not_take_10_arguments); \ + GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(10, constness, Method).Invoke(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \ + gmock_a10); \ + } \ + ::testing::MockSpec<__VA_ARGS__>& \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ + GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \ + GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \ + GMOCK_MATCHER_(tn, 10, \ + __VA_ARGS__) gmock_a10) constness { \ + GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(10, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \ + gmock_a10); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness, \ + Method) + +#define MOCK_METHOD0(m, ...) GMOCK_METHOD0_(, , , m, __VA_ARGS__) +#define MOCK_METHOD1(m, ...) GMOCK_METHOD1_(, , , m, __VA_ARGS__) +#define MOCK_METHOD2(m, ...) GMOCK_METHOD2_(, , , m, __VA_ARGS__) +#define MOCK_METHOD3(m, ...) GMOCK_METHOD3_(, , , m, __VA_ARGS__) +#define MOCK_METHOD4(m, ...) GMOCK_METHOD4_(, , , m, __VA_ARGS__) +#define MOCK_METHOD5(m, ...) GMOCK_METHOD5_(, , , m, __VA_ARGS__) +#define MOCK_METHOD6(m, ...) GMOCK_METHOD6_(, , , m, __VA_ARGS__) +#define MOCK_METHOD7(m, ...) GMOCK_METHOD7_(, , , m, __VA_ARGS__) +#define MOCK_METHOD8(m, ...) GMOCK_METHOD8_(, , , m, __VA_ARGS__) +#define MOCK_METHOD9(m, ...) GMOCK_METHOD9_(, , , m, __VA_ARGS__) +#define MOCK_METHOD10(m, ...) GMOCK_METHOD10_(, , , m, __VA_ARGS__) + +#define MOCK_CONST_METHOD0(m, ...) GMOCK_METHOD0_(, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD1(m, ...) GMOCK_METHOD1_(, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD2(m, ...) GMOCK_METHOD2_(, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD3(m, ...) GMOCK_METHOD3_(, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD4(m, ...) GMOCK_METHOD4_(, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD5(m, ...) GMOCK_METHOD5_(, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD6(m, ...) GMOCK_METHOD6_(, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD7(m, ...) GMOCK_METHOD7_(, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD8(m, ...) GMOCK_METHOD8_(, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD9(m, ...) GMOCK_METHOD9_(, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD10(m, ...) GMOCK_METHOD10_(, const, , m, __VA_ARGS__) + +#define MOCK_METHOD0_T(m, ...) GMOCK_METHOD0_(typename, , , m, __VA_ARGS__) +#define MOCK_METHOD1_T(m, ...) GMOCK_METHOD1_(typename, , , m, __VA_ARGS__) +#define MOCK_METHOD2_T(m, ...) GMOCK_METHOD2_(typename, , , m, __VA_ARGS__) +#define MOCK_METHOD3_T(m, ...) GMOCK_METHOD3_(typename, , , m, __VA_ARGS__) +#define MOCK_METHOD4_T(m, ...) GMOCK_METHOD4_(typename, , , m, __VA_ARGS__) +#define MOCK_METHOD5_T(m, ...) GMOCK_METHOD5_(typename, , , m, __VA_ARGS__) +#define MOCK_METHOD6_T(m, ...) GMOCK_METHOD6_(typename, , , m, __VA_ARGS__) +#define MOCK_METHOD7_T(m, ...) GMOCK_METHOD7_(typename, , , m, __VA_ARGS__) +#define MOCK_METHOD8_T(m, ...) GMOCK_METHOD8_(typename, , , m, __VA_ARGS__) +#define MOCK_METHOD9_T(m, ...) GMOCK_METHOD9_(typename, , , m, __VA_ARGS__) +#define MOCK_METHOD10_T(m, ...) GMOCK_METHOD10_(typename, , , m, __VA_ARGS__) + +#define MOCK_CONST_METHOD0_T(m, ...) \ + GMOCK_METHOD0_(typename, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD1_T(m, ...) \ + GMOCK_METHOD1_(typename, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD2_T(m, ...) \ + GMOCK_METHOD2_(typename, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD3_T(m, ...) \ + GMOCK_METHOD3_(typename, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD4_T(m, ...) \ + GMOCK_METHOD4_(typename, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD5_T(m, ...) \ + GMOCK_METHOD5_(typename, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD6_T(m, ...) \ + GMOCK_METHOD6_(typename, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD7_T(m, ...) \ + GMOCK_METHOD7_(typename, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD8_T(m, ...) \ + GMOCK_METHOD8_(typename, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD9_T(m, ...) \ + GMOCK_METHOD9_(typename, const, , m, __VA_ARGS__) +#define MOCK_CONST_METHOD10_T(m, ...) \ + GMOCK_METHOD10_(typename, const, , m, __VA_ARGS__) + +#define MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD0_(, , ct, m, __VA_ARGS__) +#define MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD1_(, , ct, m, __VA_ARGS__) +#define MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD2_(, , ct, m, __VA_ARGS__) +#define MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD3_(, , ct, m, __VA_ARGS__) +#define MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD4_(, , ct, m, __VA_ARGS__) +#define MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD5_(, , ct, m, __VA_ARGS__) +#define MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD6_(, , ct, m, __VA_ARGS__) +#define MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD7_(, , ct, m, __VA_ARGS__) +#define MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD8_(, , ct, m, __VA_ARGS__) +#define MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD9_(, , ct, m, __VA_ARGS__) +#define MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD10_(, , ct, m, __VA_ARGS__) + +#define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD0_(, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD1_(, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD2_(, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD3_(, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD4_(, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD5_(, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD6_(, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD7_(, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD8_(, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD9_(, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD10_(, const, ct, m, __VA_ARGS__) + +#define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD0_(typename, , ct, m, __VA_ARGS__) +#define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD1_(typename, , ct, m, __VA_ARGS__) +#define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD2_(typename, , ct, m, __VA_ARGS__) +#define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD3_(typename, , ct, m, __VA_ARGS__) +#define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD4_(typename, , ct, m, __VA_ARGS__) +#define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD5_(typename, , ct, m, __VA_ARGS__) +#define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD6_(typename, , ct, m, __VA_ARGS__) +#define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD7_(typename, , ct, m, __VA_ARGS__) +#define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD8_(typename, , ct, m, __VA_ARGS__) +#define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD9_(typename, , ct, m, __VA_ARGS__) +#define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD10_(typename, , ct, m, __VA_ARGS__) + +#define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD0_(typename, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD1_(typename, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD2_(typename, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD3_(typename, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD4_(typename, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD5_(typename, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD6_(typename, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD7_(typename, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD8_(typename, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD9_(typename, const, ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD10_(typename, const, ct, m, __VA_ARGS__) + +// A MockFunction class has one mock method whose type is F. It is +// useful when you just want your test code to emit some messages and +// have Google Mock verify the right messages are sent (and perhaps at +// the right times). For example, if you are exercising code: +// +// Foo(1); +// Foo(2); +// Foo(3); +// +// and want to verify that Foo(1) and Foo(3) both invoke +// mock.Bar("a"), but Foo(2) doesn't invoke anything, you can write: +// +// TEST(FooTest, InvokesBarCorrectly) { +// MyMock mock; +// MockFunction check; +// { +// InSequence s; +// +// EXPECT_CALL(mock, Bar("a")); +// EXPECT_CALL(check, Call("1")); +// EXPECT_CALL(check, Call("2")); +// EXPECT_CALL(mock, Bar("a")); +// } +// Foo(1); +// check.Call("1"); +// Foo(2); +// check.Call("2"); +// Foo(3); +// } +// +// The expectation spec says that the first Bar("a") must happen +// before check point "1", the second Bar("a") must happen after check +// point "2", and nothing should happen between the two check +// points. The explicit check points make it easy to tell which +// Bar("a") is called by which call to Foo(). +// +// MockFunction can also be used to exercise code that accepts +// std::function callbacks. To do so, use AsStdFunction() method +// to create std::function proxy forwarding to original object's Call. +// Example: +// +// TEST(FooTest, RunsCallbackWithBarArgument) { +// MockFunction callback; +// EXPECT_CALL(callback, Call("bar")).WillOnce(Return(1)); +// Foo(callback.AsStdFunction()); +// } +template +class MockFunction; + +template +class MockFunction { + public: + MockFunction() {} + + MOCK_METHOD0_T(Call, R()); + +#if GTEST_HAS_STD_FUNCTION_ + std::function AsStdFunction() { + return [this]() -> R { + return this->Call(); + }; + } +#endif // GTEST_HAS_STD_FUNCTION_ + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); +}; + +template +class MockFunction { + public: + MockFunction() {} + + MOCK_METHOD1_T(Call, R(A0)); + +#if GTEST_HAS_STD_FUNCTION_ + std::function AsStdFunction() { + return [this](A0 a0) -> R { + return this->Call(a0); + }; + } +#endif // GTEST_HAS_STD_FUNCTION_ + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); +}; + +template +class MockFunction { + public: + MockFunction() {} + + MOCK_METHOD2_T(Call, R(A0, A1)); + +#if GTEST_HAS_STD_FUNCTION_ + std::function AsStdFunction() { + return [this](A0 a0, A1 a1) -> R { + return this->Call(a0, a1); + }; + } +#endif // GTEST_HAS_STD_FUNCTION_ + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); +}; + +template +class MockFunction { + public: + MockFunction() {} + + MOCK_METHOD3_T(Call, R(A0, A1, A2)); + +#if GTEST_HAS_STD_FUNCTION_ + std::function AsStdFunction() { + return [this](A0 a0, A1 a1, A2 a2) -> R { + return this->Call(a0, a1, a2); + }; + } +#endif // GTEST_HAS_STD_FUNCTION_ + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); +}; + +template +class MockFunction { + public: + MockFunction() {} + + MOCK_METHOD4_T(Call, R(A0, A1, A2, A3)); + +#if GTEST_HAS_STD_FUNCTION_ + std::function AsStdFunction() { + return [this](A0 a0, A1 a1, A2 a2, A3 a3) -> R { + return this->Call(a0, a1, a2, a3); + }; + } +#endif // GTEST_HAS_STD_FUNCTION_ + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); +}; + +template +class MockFunction { + public: + MockFunction() {} + + MOCK_METHOD5_T(Call, R(A0, A1, A2, A3, A4)); + +#if GTEST_HAS_STD_FUNCTION_ + std::function AsStdFunction() { + return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) -> R { + return this->Call(a0, a1, a2, a3, a4); + }; + } +#endif // GTEST_HAS_STD_FUNCTION_ + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); +}; + +template +class MockFunction { + public: + MockFunction() {} + + MOCK_METHOD6_T(Call, R(A0, A1, A2, A3, A4, A5)); + +#if GTEST_HAS_STD_FUNCTION_ + std::function AsStdFunction() { + return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -> R { + return this->Call(a0, a1, a2, a3, a4, a5); + }; + } +#endif // GTEST_HAS_STD_FUNCTION_ + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); +}; + +template +class MockFunction { + public: + MockFunction() {} + + MOCK_METHOD7_T(Call, R(A0, A1, A2, A3, A4, A5, A6)); + +#if GTEST_HAS_STD_FUNCTION_ + std::function AsStdFunction() { + return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) -> R { + return this->Call(a0, a1, a2, a3, a4, a5, a6); + }; + } +#endif // GTEST_HAS_STD_FUNCTION_ + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); +}; + +template +class MockFunction { + public: + MockFunction() {} + + MOCK_METHOD8_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7)); + +#if GTEST_HAS_STD_FUNCTION_ + std::function AsStdFunction() { + return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) -> R { + return this->Call(a0, a1, a2, a3, a4, a5, a6, a7); + }; + } +#endif // GTEST_HAS_STD_FUNCTION_ + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); +}; + +template +class MockFunction { + public: + MockFunction() {} + + MOCK_METHOD9_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8)); + +#if GTEST_HAS_STD_FUNCTION_ + std::function AsStdFunction() { + return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, + A8 a8) -> R { + return this->Call(a0, a1, a2, a3, a4, a5, a6, a7, a8); + }; + } +#endif // GTEST_HAS_STD_FUNCTION_ + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); +}; + +template +class MockFunction { + public: + MockFunction() {} + + MOCK_METHOD10_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)); + +#if GTEST_HAS_STD_FUNCTION_ + std::function AsStdFunction() { + return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, + A8 a8, A9 a9) -> R { + return this->Call(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); + }; + } +#endif // GTEST_HAS_STD_FUNCTION_ + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); +}; + +} // namespace testing + +#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,291 @@ +$$ -*- mode: c++; -*- +$$ This is a Pump source file. Please use Pump to convert it to +$$ gmock-generated-function-mockers.h. +$$ +$var n = 10 $$ The maximum arity we support. +// Copyright 2007, Google Inc. +// 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 Google Inc. 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 +// OWNER 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. +// +// Author: wan@google.com (Zhanyong Wan) + +// Google Mock - a framework for writing C++ mock classes. +// +// This file implements function mockers of various arities. + +#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ +#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ + +#include "gmock/gmock-spec-builders.h" +#include "gmock/internal/gmock-internal-utils.h" + +#if GTEST_HAS_STD_FUNCTION_ +# include +#endif + +namespace testing { +namespace internal { + +template +class FunctionMockerBase; + +// Note: class FunctionMocker really belongs to the ::testing +// namespace. However if we define it in ::testing, MSVC will +// complain when classes in ::testing::internal declare it as a +// friend class template. To workaround this compiler bug, we define +// FunctionMocker in ::testing::internal and import it into ::testing. +template +class FunctionMocker; + + +$range i 0..n +$for i [[ +$range j 1..i +$var typename_As = [[$for j [[, typename A$j]]]] +$var As = [[$for j, [[A$j]]]] +$var as = [[$for j, [[a$j]]]] +$var Aas = [[$for j, [[A$j a$j]]]] +$var ms = [[$for j, [[m$j]]]] +$var matchers = [[$for j, [[const Matcher& m$j]]]] +template +class FunctionMocker : public + internal::FunctionMockerBase { + public: + typedef R F($As); + typedef typename internal::Function::ArgumentTuple ArgumentTuple; + + MockSpec& With($matchers) { + +$if i >= 1 [[ + this->current_spec().SetMatchers(::testing::make_tuple($ms)); + +]] + return this->current_spec(); + } + + R Invoke($Aas) { + // Even though gcc and MSVC don't enforce it, 'this->' is required + // by the C++ standard [14.6.4] here, as the base class type is + // dependent on the template argument (and thus shouldn't be + // looked into when resolving InvokeWith). + return this->InvokeWith(ArgumentTuple($as)); + } +}; + + +]] +} // namespace internal + +// The style guide prohibits "using" statements in a namespace scope +// inside a header file. However, the FunctionMocker class template +// is meant to be defined in the ::testing namespace. The following +// line is just a trick for working around a bug in MSVC 8.0, which +// cannot handle it if we define FunctionMocker in ::testing. +using internal::FunctionMocker; + +// GMOCK_RESULT_(tn, F) expands to the result type of function type F. +// We define this as a variadic macro in case F contains unprotected +// commas (the same reason that we use variadic macros in other places +// in this file). +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_RESULT_(tn, ...) \ + tn ::testing::internal::Function<__VA_ARGS__>::Result + +// The type of argument N of the given function type. +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_ARG_(tn, N, ...) \ + tn ::testing::internal::Function<__VA_ARGS__>::Argument##N + +// The matcher type for argument N of the given function type. +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_MATCHER_(tn, N, ...) \ + const ::testing::Matcher& + +// The variable for mocking the given method. +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_MOCKER_(arity, constness, Method) \ + GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__) + + +$for i [[ +$range j 1..i +$var arg_as = [[$for j, \ + [[GMOCK_ARG_(tn, $j, __VA_ARGS__) gmock_a$j]]]] +$var as = [[$for j, [[gmock_a$j]]]] +$var matcher_as = [[$for j, \ + [[GMOCK_MATCHER_(tn, $j, __VA_ARGS__) gmock_a$j]]]] +// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! +#define GMOCK_METHOD$i[[]]_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + $arg_as) constness { \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value == $i), \ + this_method_does_not_take_$i[[]]_argument[[$if i != 1 [[s]]]]); \ + GMOCK_MOCKER_($i, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_($i, constness, Method).Invoke($as); \ + } \ + ::testing::MockSpec<__VA_ARGS__>& \ + gmock_##Method($matcher_as) constness { \ + GMOCK_MOCKER_($i, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_($i, constness, Method).With($as); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_($i, constness, Method) + + +]] +$for i [[ +#define MOCK_METHOD$i(m, ...) GMOCK_METHOD$i[[]]_(, , , m, __VA_ARGS__) + +]] + + +$for i [[ +#define MOCK_CONST_METHOD$i(m, ...) GMOCK_METHOD$i[[]]_(, const, , m, __VA_ARGS__) + +]] + + +$for i [[ +#define MOCK_METHOD$i[[]]_T(m, ...) GMOCK_METHOD$i[[]]_(typename, , , m, __VA_ARGS__) + +]] + + +$for i [[ +#define MOCK_CONST_METHOD$i[[]]_T(m, ...) \ + GMOCK_METHOD$i[[]]_(typename, const, , m, __VA_ARGS__) + +]] + + +$for i [[ +#define MOCK_METHOD$i[[]]_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD$i[[]]_(, , ct, m, __VA_ARGS__) + +]] + + +$for i [[ +#define MOCK_CONST_METHOD$i[[]]_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD$i[[]]_(, const, ct, m, __VA_ARGS__) + +]] + + +$for i [[ +#define MOCK_METHOD$i[[]]_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD$i[[]]_(typename, , ct, m, __VA_ARGS__) + +]] + + +$for i [[ +#define MOCK_CONST_METHOD$i[[]]_T_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_METHOD$i[[]]_(typename, const, ct, m, __VA_ARGS__) + +]] + +// A MockFunction class has one mock method whose type is F. It is +// useful when you just want your test code to emit some messages and +// have Google Mock verify the right messages are sent (and perhaps at +// the right times). For example, if you are exercising code: +// +// Foo(1); +// Foo(2); +// Foo(3); +// +// and want to verify that Foo(1) and Foo(3) both invoke +// mock.Bar("a"), but Foo(2) doesn't invoke anything, you can write: +// +// TEST(FooTest, InvokesBarCorrectly) { +// MyMock mock; +// MockFunction check; +// { +// InSequence s; +// +// EXPECT_CALL(mock, Bar("a")); +// EXPECT_CALL(check, Call("1")); +// EXPECT_CALL(check, Call("2")); +// EXPECT_CALL(mock, Bar("a")); +// } +// Foo(1); +// check.Call("1"); +// Foo(2); +// check.Call("2"); +// Foo(3); +// } +// +// The expectation spec says that the first Bar("a") must happen +// before check point "1", the second Bar("a") must happen after check +// point "2", and nothing should happen between the two check +// points. The explicit check points make it easy to tell which +// Bar("a") is called by which call to Foo(). +// +// MockFunction can also be used to exercise code that accepts +// std::function callbacks. To do so, use AsStdFunction() method +// to create std::function proxy forwarding to original object's Call. +// Example: +// +// TEST(FooTest, RunsCallbackWithBarArgument) { +// MockFunction callback; +// EXPECT_CALL(callback, Call("bar")).WillOnce(Return(1)); +// Foo(callback.AsStdFunction()); +// } +template +class MockFunction; + + +$for i [[ +$range j 0..i-1 +$var ArgTypes = [[$for j, [[A$j]]]] +$var ArgNames = [[$for j, [[a$j]]]] +$var ArgDecls = [[$for j, [[A$j a$j]]]] +template +class MockFunction { + public: + MockFunction() {} + + MOCK_METHOD$i[[]]_T(Call, R($ArgTypes)); + +#if GTEST_HAS_STD_FUNCTION_ + std::function AsStdFunction() { + return [this]($ArgDecls) -> R { + return this->Call($ArgNames); + }; + } +#endif // GTEST_HAS_STD_FUNCTION_ + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); +}; + + +]] +} // namespace testing + +#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-generated-matchers.h vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-generated-matchers.h --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-generated-matchers.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-generated-matchers.h 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,2191 @@ +// This file was GENERATED by command: +// pump.py gmock-generated-matchers.h.pump +// DO NOT EDIT BY HAND!!! + +// Copyright 2008, Google Inc. +// 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 Google Inc. 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 +// OWNER 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. + +// Google Mock - a framework for writing C++ mock classes. +// +// This file implements some commonly used variadic matchers. + +#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_ +#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_ + +#include +#include +#include +#include +#include "gmock/gmock-matchers.h" + +namespace testing { +namespace internal { + +// The type of the i-th (0-based) field of Tuple. +#define GMOCK_FIELD_TYPE_(Tuple, i) \ + typename ::testing::tuple_element::type + +// TupleFields is for selecting fields from a +// tuple of type Tuple. It has two members: +// +// type: a tuple type whose i-th field is the ki-th field of Tuple. +// GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple. +// +// For example, in class TupleFields, 2, 0>, we have: +// +// type is tuple, and +// GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true). + +template +class TupleFields; + +// This generic version is used when there are 10 selectors. +template +class TupleFields { + public: + typedef ::testing::tuple type; + static type GetSelectedFields(const Tuple& t) { + return type(get(t), get(t), get(t), get(t), get(t), + get(t), get(t), get(t), get(t), get(t)); + } +}; + +// The following specialization is used for 0 ~ 9 selectors. + +template +class TupleFields { + public: + typedef ::testing::tuple<> type; + static type GetSelectedFields(const Tuple& /* t */) { + return type(); + } +}; + +template +class TupleFields { + public: + typedef ::testing::tuple type; + static type GetSelectedFields(const Tuple& t) { + return type(get(t)); + } +}; + +template +class TupleFields { + public: + typedef ::testing::tuple type; + static type GetSelectedFields(const Tuple& t) { + return type(get(t), get(t)); + } +}; + +template +class TupleFields { + public: + typedef ::testing::tuple type; + static type GetSelectedFields(const Tuple& t) { + return type(get(t), get(t), get(t)); + } +}; + +template +class TupleFields { + public: + typedef ::testing::tuple type; + static type GetSelectedFields(const Tuple& t) { + return type(get(t), get(t), get(t), get(t)); + } +}; + +template +class TupleFields { + public: + typedef ::testing::tuple type; + static type GetSelectedFields(const Tuple& t) { + return type(get(t), get(t), get(t), get(t), get(t)); + } +}; + +template +class TupleFields { + public: + typedef ::testing::tuple type; + static type GetSelectedFields(const Tuple& t) { + return type(get(t), get(t), get(t), get(t), get(t), + get(t)); + } +}; + +template +class TupleFields { + public: + typedef ::testing::tuple type; + static type GetSelectedFields(const Tuple& t) { + return type(get(t), get(t), get(t), get(t), get(t), + get(t), get(t)); + } +}; + +template +class TupleFields { + public: + typedef ::testing::tuple type; + static type GetSelectedFields(const Tuple& t) { + return type(get(t), get(t), get(t), get(t), get(t), + get(t), get(t), get(t)); + } +}; + +template +class TupleFields { + public: + typedef ::testing::tuple type; + static type GetSelectedFields(const Tuple& t) { + return type(get(t), get(t), get(t), get(t), get(t), + get(t), get(t), get(t), get(t)); + } +}; + +#undef GMOCK_FIELD_TYPE_ + +// Implements the Args() matcher. +template +class ArgsMatcherImpl : public MatcherInterface { + public: + // ArgsTuple may have top-level const or reference modifiers. + typedef GTEST_REMOVE_REFERENCE_AND_CONST_(ArgsTuple) RawArgsTuple; + typedef typename internal::TupleFields::type SelectedArgs; + typedef Matcher MonomorphicInnerMatcher; + + template + explicit ArgsMatcherImpl(const InnerMatcher& inner_matcher) + : inner_matcher_(SafeMatcherCast(inner_matcher)) {} + + virtual bool MatchAndExplain(ArgsTuple args, + MatchResultListener* listener) const { + const SelectedArgs& selected_args = GetSelectedArgs(args); + if (!listener->IsInterested()) + return inner_matcher_.Matches(selected_args); + + PrintIndices(listener->stream()); + *listener << "are " << PrintToString(selected_args); + + StringMatchResultListener inner_listener; + const bool match = inner_matcher_.MatchAndExplain(selected_args, + &inner_listener); + PrintIfNotEmpty(inner_listener.str(), listener->stream()); + return match; + } + + virtual void DescribeTo(::std::ostream* os) const { + *os << "are a tuple "; + PrintIndices(os); + inner_matcher_.DescribeTo(os); + } + + virtual void DescribeNegationTo(::std::ostream* os) const { + *os << "are a tuple "; + PrintIndices(os); + inner_matcher_.DescribeNegationTo(os); + } + + private: + static SelectedArgs GetSelectedArgs(ArgsTuple args) { + return TupleFields::GetSelectedFields(args); + } + + // Prints the indices of the selected fields. + static void PrintIndices(::std::ostream* os) { + *os << "whose fields ("; + const int indices[10] = { k0, k1, k2, k3, k4, k5, k6, k7, k8, k9 }; + for (int i = 0; i < 10; i++) { + if (indices[i] < 0) + break; + + if (i >= 1) + *os << ", "; + + *os << "#" << indices[i]; + } + *os << ") "; + } + + const MonomorphicInnerMatcher inner_matcher_; + + GTEST_DISALLOW_ASSIGN_(ArgsMatcherImpl); +}; + +template +class ArgsMatcher { + public: + explicit ArgsMatcher(const InnerMatcher& inner_matcher) + : inner_matcher_(inner_matcher) {} + + template + operator Matcher() const { + return MakeMatcher(new ArgsMatcherImpl(inner_matcher_)); + } + + private: + const InnerMatcher inner_matcher_; + + GTEST_DISALLOW_ASSIGN_(ArgsMatcher); +}; + +// A set of metafunctions for computing the result type of AllOf. +// AllOf(m1, ..., mN) returns +// AllOfResultN::type. + +// Although AllOf isn't defined for one argument, AllOfResult1 is defined +// to simplify the implementation. +template +struct AllOfResult1 { + typedef M1 type; +}; + +template +struct AllOfResult2 { + typedef BothOfMatcher< + typename AllOfResult1::type, + typename AllOfResult1::type + > type; +}; + +template +struct AllOfResult3 { + typedef BothOfMatcher< + typename AllOfResult1::type, + typename AllOfResult2::type + > type; +}; + +template +struct AllOfResult4 { + typedef BothOfMatcher< + typename AllOfResult2::type, + typename AllOfResult2::type + > type; +}; + +template +struct AllOfResult5 { + typedef BothOfMatcher< + typename AllOfResult2::type, + typename AllOfResult3::type + > type; +}; + +template +struct AllOfResult6 { + typedef BothOfMatcher< + typename AllOfResult3::type, + typename AllOfResult3::type + > type; +}; + +template +struct AllOfResult7 { + typedef BothOfMatcher< + typename AllOfResult3::type, + typename AllOfResult4::type + > type; +}; + +template +struct AllOfResult8 { + typedef BothOfMatcher< + typename AllOfResult4::type, + typename AllOfResult4::type + > type; +}; + +template +struct AllOfResult9 { + typedef BothOfMatcher< + typename AllOfResult4::type, + typename AllOfResult5::type + > type; +}; + +template +struct AllOfResult10 { + typedef BothOfMatcher< + typename AllOfResult5::type, + typename AllOfResult5::type + > type; +}; + +// A set of metafunctions for computing the result type of AnyOf. +// AnyOf(m1, ..., mN) returns +// AnyOfResultN::type. + +// Although AnyOf isn't defined for one argument, AnyOfResult1 is defined +// to simplify the implementation. +template +struct AnyOfResult1 { + typedef M1 type; +}; + +template +struct AnyOfResult2 { + typedef EitherOfMatcher< + typename AnyOfResult1::type, + typename AnyOfResult1::type + > type; +}; + +template +struct AnyOfResult3 { + typedef EitherOfMatcher< + typename AnyOfResult1::type, + typename AnyOfResult2::type + > type; +}; + +template +struct AnyOfResult4 { + typedef EitherOfMatcher< + typename AnyOfResult2::type, + typename AnyOfResult2::type + > type; +}; + +template +struct AnyOfResult5 { + typedef EitherOfMatcher< + typename AnyOfResult2::type, + typename AnyOfResult3::type + > type; +}; + +template +struct AnyOfResult6 { + typedef EitherOfMatcher< + typename AnyOfResult3::type, + typename AnyOfResult3::type + > type; +}; + +template +struct AnyOfResult7 { + typedef EitherOfMatcher< + typename AnyOfResult3::type, + typename AnyOfResult4::type + > type; +}; + +template +struct AnyOfResult8 { + typedef EitherOfMatcher< + typename AnyOfResult4::type, + typename AnyOfResult4::type + > type; +}; + +template +struct AnyOfResult9 { + typedef EitherOfMatcher< + typename AnyOfResult4::type, + typename AnyOfResult5::type + > type; +}; + +template +struct AnyOfResult10 { + typedef EitherOfMatcher< + typename AnyOfResult5::type, + typename AnyOfResult5::type + > type; +}; + +} // namespace internal + +// Args(a_matcher) matches a tuple if the selected +// fields of it matches a_matcher. C++ doesn't support default +// arguments for function templates, so we have to overload it. +template +inline internal::ArgsMatcher +Args(const InnerMatcher& matcher) { + return internal::ArgsMatcher(matcher); +} + +template +inline internal::ArgsMatcher +Args(const InnerMatcher& matcher) { + return internal::ArgsMatcher(matcher); +} + +template +inline internal::ArgsMatcher +Args(const InnerMatcher& matcher) { + return internal::ArgsMatcher(matcher); +} + +template +inline internal::ArgsMatcher +Args(const InnerMatcher& matcher) { + return internal::ArgsMatcher(matcher); +} + +template +inline internal::ArgsMatcher +Args(const InnerMatcher& matcher) { + return internal::ArgsMatcher(matcher); +} + +template +inline internal::ArgsMatcher +Args(const InnerMatcher& matcher) { + return internal::ArgsMatcher(matcher); +} + +template +inline internal::ArgsMatcher +Args(const InnerMatcher& matcher) { + return internal::ArgsMatcher(matcher); +} + +template +inline internal::ArgsMatcher +Args(const InnerMatcher& matcher) { + return internal::ArgsMatcher(matcher); +} + +template +inline internal::ArgsMatcher +Args(const InnerMatcher& matcher) { + return internal::ArgsMatcher(matcher); +} + +template +inline internal::ArgsMatcher +Args(const InnerMatcher& matcher) { + return internal::ArgsMatcher(matcher); +} + +template +inline internal::ArgsMatcher +Args(const InnerMatcher& matcher) { + return internal::ArgsMatcher(matcher); +} + +// ElementsAre(e_1, e_2, ... e_n) matches an STL-style container with +// n elements, where the i-th element in the container must +// match the i-th argument in the list. Each argument of +// ElementsAre() can be either a value or a matcher. We support up to +// 10 arguments. +// +// The use of DecayArray in the implementation allows ElementsAre() +// to accept string literals, whose type is const char[N], but we +// want to treat them as const char*. +// +// NOTE: Since ElementsAre() cares about the order of the elements, it +// must not be used with containers whose elements's order is +// undefined (e.g. hash_map). + +inline internal::ElementsAreMatcher< + ::testing::tuple<> > +ElementsAre() { + typedef ::testing::tuple<> Args; + return internal::ElementsAreMatcher(Args()); +} + +template +inline internal::ElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type> > +ElementsAre(const T1& e1) { + typedef ::testing::tuple< + typename internal::DecayArray::type> Args; + return internal::ElementsAreMatcher(Args(e1)); +} + +template +inline internal::ElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type> > +ElementsAre(const T1& e1, const T2& e2) { + typedef ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type> Args; + return internal::ElementsAreMatcher(Args(e1, e2)); +} + +template +inline internal::ElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> > +ElementsAre(const T1& e1, const T2& e2, const T3& e3) { + typedef ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> Args; + return internal::ElementsAreMatcher(Args(e1, e2, e3)); +} + +template +inline internal::ElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> > +ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) { + typedef ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> Args; + return internal::ElementsAreMatcher(Args(e1, e2, e3, e4)); +} + +template +inline internal::ElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> > +ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, + const T5& e5) { + typedef ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> Args; + return internal::ElementsAreMatcher(Args(e1, e2, e3, e4, e5)); +} + +template +inline internal::ElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> > +ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, + const T5& e5, const T6& e6) { + typedef ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> Args; + return internal::ElementsAreMatcher(Args(e1, e2, e3, e4, e5, e6)); +} + +template +inline internal::ElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> > +ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, + const T5& e5, const T6& e6, const T7& e7) { + typedef ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> Args; + return internal::ElementsAreMatcher(Args(e1, e2, e3, e4, e5, e6, e7)); +} + +template +inline internal::ElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> > +ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, + const T5& e5, const T6& e6, const T7& e7, const T8& e8) { + typedef ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> Args; + return internal::ElementsAreMatcher(Args(e1, e2, e3, e4, e5, e6, e7, + e8)); +} + +template +inline internal::ElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> > +ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, + const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9) { + typedef ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> Args; + return internal::ElementsAreMatcher(Args(e1, e2, e3, e4, e5, e6, e7, + e8, e9)); +} + +template +inline internal::ElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> > +ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, + const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9, + const T10& e10) { + typedef ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> Args; + return internal::ElementsAreMatcher(Args(e1, e2, e3, e4, e5, e6, e7, + e8, e9, e10)); +} + +// UnorderedElementsAre(e_1, e_2, ..., e_n) is an ElementsAre extension +// that matches n elements in any order. We support up to n=10 arguments. + +inline internal::UnorderedElementsAreMatcher< + ::testing::tuple<> > +UnorderedElementsAre() { + typedef ::testing::tuple<> Args; + return internal::UnorderedElementsAreMatcher(Args()); +} + +template +inline internal::UnorderedElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type> > +UnorderedElementsAre(const T1& e1) { + typedef ::testing::tuple< + typename internal::DecayArray::type> Args; + return internal::UnorderedElementsAreMatcher(Args(e1)); +} + +template +inline internal::UnorderedElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type> > +UnorderedElementsAre(const T1& e1, const T2& e2) { + typedef ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type> Args; + return internal::UnorderedElementsAreMatcher(Args(e1, e2)); +} + +template +inline internal::UnorderedElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> > +UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3) { + typedef ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> Args; + return internal::UnorderedElementsAreMatcher(Args(e1, e2, e3)); +} + +template +inline internal::UnorderedElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> > +UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) { + typedef ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> Args; + return internal::UnorderedElementsAreMatcher(Args(e1, e2, e3, e4)); +} + +template +inline internal::UnorderedElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> > +UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, + const T5& e5) { + typedef ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> Args; + return internal::UnorderedElementsAreMatcher(Args(e1, e2, e3, e4, e5)); +} + +template +inline internal::UnorderedElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> > +UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, + const T5& e5, const T6& e6) { + typedef ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> Args; + return internal::UnorderedElementsAreMatcher(Args(e1, e2, e3, e4, e5, + e6)); +} + +template +inline internal::UnorderedElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> > +UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, + const T5& e5, const T6& e6, const T7& e7) { + typedef ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> Args; + return internal::UnorderedElementsAreMatcher(Args(e1, e2, e3, e4, e5, + e6, e7)); +} + +template +inline internal::UnorderedElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> > +UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, + const T5& e5, const T6& e6, const T7& e7, const T8& e8) { + typedef ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> Args; + return internal::UnorderedElementsAreMatcher(Args(e1, e2, e3, e4, e5, + e6, e7, e8)); +} + +template +inline internal::UnorderedElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> > +UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, + const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9) { + typedef ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> Args; + return internal::UnorderedElementsAreMatcher(Args(e1, e2, e3, e4, e5, + e6, e7, e8, e9)); +} + +template +inline internal::UnorderedElementsAreMatcher< + ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> > +UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, + const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9, + const T10& e10) { + typedef ::testing::tuple< + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type, + typename internal::DecayArray::type> Args; + return internal::UnorderedElementsAreMatcher(Args(e1, e2, e3, e4, e5, + e6, e7, e8, e9, e10)); +} + +// AllOf(m1, m2, ..., mk) matches any value that matches all of the given +// sub-matchers. AllOf is called fully qualified to prevent ADL from firing. + +template +inline typename internal::AllOfResult2::type +AllOf(M1 m1, M2 m2) { + return typename internal::AllOfResult2::type( + m1, + m2); +} + +template +inline typename internal::AllOfResult3::type +AllOf(M1 m1, M2 m2, M3 m3) { + return typename internal::AllOfResult3::type( + m1, + ::testing::AllOf(m2, m3)); +} + +template +inline typename internal::AllOfResult4::type +AllOf(M1 m1, M2 m2, M3 m3, M4 m4) { + return typename internal::AllOfResult4::type( + ::testing::AllOf(m1, m2), + ::testing::AllOf(m3, m4)); +} + +template +inline typename internal::AllOfResult5::type +AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5) { + return typename internal::AllOfResult5::type( + ::testing::AllOf(m1, m2), + ::testing::AllOf(m3, m4, m5)); +} + +template +inline typename internal::AllOfResult6::type +AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) { + return typename internal::AllOfResult6::type( + ::testing::AllOf(m1, m2, m3), + ::testing::AllOf(m4, m5, m6)); +} + +template +inline typename internal::AllOfResult7::type +AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) { + return typename internal::AllOfResult7::type( + ::testing::AllOf(m1, m2, m3), + ::testing::AllOf(m4, m5, m6, m7)); +} + +template +inline typename internal::AllOfResult8::type +AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) { + return typename internal::AllOfResult8::type( + ::testing::AllOf(m1, m2, m3, m4), + ::testing::AllOf(m5, m6, m7, m8)); +} + +template +inline typename internal::AllOfResult9::type +AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) { + return typename internal::AllOfResult9::type( + ::testing::AllOf(m1, m2, m3, m4), + ::testing::AllOf(m5, m6, m7, m8, m9)); +} + +template +inline typename internal::AllOfResult10::type +AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { + return typename internal::AllOfResult10::type( + ::testing::AllOf(m1, m2, m3, m4, m5), + ::testing::AllOf(m6, m7, m8, m9, m10)); +} + +// AnyOf(m1, m2, ..., mk) matches any value that matches any of the given +// sub-matchers. AnyOf is called fully qualified to prevent ADL from firing. + +template +inline typename internal::AnyOfResult2::type +AnyOf(M1 m1, M2 m2) { + return typename internal::AnyOfResult2::type( + m1, + m2); +} + +template +inline typename internal::AnyOfResult3::type +AnyOf(M1 m1, M2 m2, M3 m3) { + return typename internal::AnyOfResult3::type( + m1, + ::testing::AnyOf(m2, m3)); +} + +template +inline typename internal::AnyOfResult4::type +AnyOf(M1 m1, M2 m2, M3 m3, M4 m4) { + return typename internal::AnyOfResult4::type( + ::testing::AnyOf(m1, m2), + ::testing::AnyOf(m3, m4)); +} + +template +inline typename internal::AnyOfResult5::type +AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5) { + return typename internal::AnyOfResult5::type( + ::testing::AnyOf(m1, m2), + ::testing::AnyOf(m3, m4, m5)); +} + +template +inline typename internal::AnyOfResult6::type +AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) { + return typename internal::AnyOfResult6::type( + ::testing::AnyOf(m1, m2, m3), + ::testing::AnyOf(m4, m5, m6)); +} + +template +inline typename internal::AnyOfResult7::type +AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) { + return typename internal::AnyOfResult7::type( + ::testing::AnyOf(m1, m2, m3), + ::testing::AnyOf(m4, m5, m6, m7)); +} + +template +inline typename internal::AnyOfResult8::type +AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) { + return typename internal::AnyOfResult8::type( + ::testing::AnyOf(m1, m2, m3, m4), + ::testing::AnyOf(m5, m6, m7, m8)); +} + +template +inline typename internal::AnyOfResult9::type +AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) { + return typename internal::AnyOfResult9::type( + ::testing::AnyOf(m1, m2, m3, m4), + ::testing::AnyOf(m5, m6, m7, m8, m9)); +} + +template +inline typename internal::AnyOfResult10::type +AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { + return typename internal::AnyOfResult10::type( + ::testing::AnyOf(m1, m2, m3, m4, m5), + ::testing::AnyOf(m6, m7, m8, m9, m10)); +} + +} // namespace testing + + +// The MATCHER* family of macros can be used in a namespace scope to +// define custom matchers easily. +// +// Basic Usage +// =========== +// +// The syntax +// +// MATCHER(name, description_string) { statements; } +// +// defines a matcher with the given name that executes the statements, +// which must return a bool to indicate if the match succeeds. Inside +// the statements, you can refer to the value being matched by 'arg', +// and refer to its type by 'arg_type'. +// +// The description string documents what the matcher does, and is used +// to generate the failure message when the match fails. Since a +// MATCHER() is usually defined in a header file shared by multiple +// C++ source files, we require the description to be a C-string +// literal to avoid possible side effects. It can be empty, in which +// case we'll use the sequence of words in the matcher name as the +// description. +// +// For example: +// +// MATCHER(IsEven, "") { return (arg % 2) == 0; } +// +// allows you to write +// +// // Expects mock_foo.Bar(n) to be called where n is even. +// EXPECT_CALL(mock_foo, Bar(IsEven())); +// +// or, +// +// // Verifies that the value of some_expression is even. +// EXPECT_THAT(some_expression, IsEven()); +// +// If the above assertion fails, it will print something like: +// +// Value of: some_expression +// Expected: is even +// Actual: 7 +// +// where the description "is even" is automatically calculated from the +// matcher name IsEven. +// +// Argument Type +// ============= +// +// Note that the type of the value being matched (arg_type) is +// determined by the context in which you use the matcher and is +// supplied to you by the compiler, so you don't need to worry about +// declaring it (nor can you). This allows the matcher to be +// polymorphic. For example, IsEven() can be used to match any type +// where the value of "(arg % 2) == 0" can be implicitly converted to +// a bool. In the "Bar(IsEven())" example above, if method Bar() +// takes an int, 'arg_type' will be int; if it takes an unsigned long, +// 'arg_type' will be unsigned long; and so on. +// +// Parameterizing Matchers +// ======================= +// +// Sometimes you'll want to parameterize the matcher. For that you +// can use another macro: +// +// MATCHER_P(name, param_name, description_string) { statements; } +// +// For example: +// +// MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; } +// +// will allow you to write: +// +// EXPECT_THAT(Blah("a"), HasAbsoluteValue(n)); +// +// which may lead to this message (assuming n is 10): +// +// Value of: Blah("a") +// Expected: has absolute value 10 +// Actual: -9 +// +// Note that both the matcher description and its parameter are +// printed, making the message human-friendly. +// +// In the matcher definition body, you can write 'foo_type' to +// reference the type of a parameter named 'foo'. For example, in the +// body of MATCHER_P(HasAbsoluteValue, value) above, you can write +// 'value_type' to refer to the type of 'value'. +// +// We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P10 to +// support multi-parameter matchers. +// +// Describing Parameterized Matchers +// ================================= +// +// The last argument to MATCHER*() is a string-typed expression. The +// expression can reference all of the matcher's parameters and a +// special bool-typed variable named 'negation'. When 'negation' is +// false, the expression should evaluate to the matcher's description; +// otherwise it should evaluate to the description of the negation of +// the matcher. For example, +// +// using testing::PrintToString; +// +// MATCHER_P2(InClosedRange, low, hi, +// string(negation ? "is not" : "is") + " in range [" + +// PrintToString(low) + ", " + PrintToString(hi) + "]") { +// return low <= arg && arg <= hi; +// } +// ... +// EXPECT_THAT(3, InClosedRange(4, 6)); +// EXPECT_THAT(3, Not(InClosedRange(2, 4))); +// +// would generate two failures that contain the text: +// +// Expected: is in range [4, 6] +// ... +// Expected: is not in range [2, 4] +// +// If you specify "" as the description, the failure message will +// contain the sequence of words in the matcher name followed by the +// parameter values printed as a tuple. For example, +// +// MATCHER_P2(InClosedRange, low, hi, "") { ... } +// ... +// EXPECT_THAT(3, InClosedRange(4, 6)); +// EXPECT_THAT(3, Not(InClosedRange(2, 4))); +// +// would generate two failures that contain the text: +// +// Expected: in closed range (4, 6) +// ... +// Expected: not (in closed range (2, 4)) +// +// Types of Matcher Parameters +// =========================== +// +// For the purpose of typing, you can view +// +// MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... } +// +// as shorthand for +// +// template +// FooMatcherPk +// Foo(p1_type p1, ..., pk_type pk) { ... } +// +// When you write Foo(v1, ..., vk), the compiler infers the types of +// the parameters v1, ..., and vk for you. If you are not happy with +// the result of the type inference, you can specify the types by +// explicitly instantiating the template, as in Foo(5, +// false). As said earlier, you don't get to (or need to) specify +// 'arg_type' as that's determined by the context in which the matcher +// is used. You can assign the result of expression Foo(p1, ..., pk) +// to a variable of type FooMatcherPk. This +// can be useful when composing matchers. +// +// While you can instantiate a matcher template with reference types, +// passing the parameters by pointer usually makes your code more +// readable. If, however, you still want to pass a parameter by +// reference, be aware that in the failure message generated by the +// matcher you will see the value of the referenced object but not its +// address. +// +// Explaining Match Results +// ======================== +// +// Sometimes the matcher description alone isn't enough to explain why +// the match has failed or succeeded. For example, when expecting a +// long string, it can be very helpful to also print the diff between +// the expected string and the actual one. To achieve that, you can +// optionally stream additional information to a special variable +// named result_listener, whose type is a pointer to class +// MatchResultListener: +// +// MATCHER_P(EqualsLongString, str, "") { +// if (arg == str) return true; +// +// *result_listener << "the difference: " +/// << DiffStrings(str, arg); +// return false; +// } +// +// Overloading Matchers +// ==================== +// +// You can overload matchers with different numbers of parameters: +// +// MATCHER_P(Blah, a, description_string1) { ... } +// MATCHER_P2(Blah, a, b, description_string2) { ... } +// +// Caveats +// ======= +// +// When defining a new matcher, you should also consider implementing +// MatcherInterface or using MakePolymorphicMatcher(). These +// approaches require more work than the MATCHER* macros, but also +// give you more control on the types of the value being matched and +// the matcher parameters, which may leads to better compiler error +// messages when the matcher is used wrong. They also allow +// overloading matchers based on parameter types (as opposed to just +// based on the number of parameters). +// +// MATCHER*() can only be used in a namespace scope. The reason is +// that C++ doesn't yet allow function-local types to be used to +// instantiate templates. The up-coming C++0x standard will fix this. +// Once that's done, we'll consider supporting using MATCHER*() inside +// a function. +// +// More Information +// ================ +// +// To learn more about using these macros, please search for 'MATCHER' +// on https://github.com/google/googletest/blob/master/googlemock/docs/ +// CookBook.md + +#define MATCHER(name, description)\ + class name##Matcher {\ + public:\ + template \ + class gmock_Impl : public ::testing::MatcherInterface {\ + public:\ + gmock_Impl()\ + {}\ + virtual bool MatchAndExplain(\ + arg_type arg, ::testing::MatchResultListener* result_listener) const;\ + virtual void DescribeTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(false);\ + }\ + virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(true);\ + }\ + private:\ + ::testing::internal::string FormatDescription(bool negation) const {\ + const ::testing::internal::string gmock_description = (description);\ + if (!gmock_description.empty()) {\ + return gmock_description;\ + }\ + return ::testing::internal::FormatMatcherDescription(\ + negation, #name, \ + ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ + ::testing::tuple<>()));\ + }\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template \ + operator ::testing::Matcher() const {\ + return ::testing::Matcher(\ + new gmock_Impl());\ + }\ + name##Matcher() {\ + }\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##Matcher);\ + };\ + inline name##Matcher name() {\ + return name##Matcher();\ + }\ + template \ + bool name##Matcher::gmock_Impl::MatchAndExplain(\ + arg_type arg, \ + ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\ + const + +#define MATCHER_P(name, p0, description)\ + template \ + class name##MatcherP {\ + public:\ + template \ + class gmock_Impl : public ::testing::MatcherInterface {\ + public:\ + explicit gmock_Impl(p0##_type gmock_p0)\ + : p0(gmock_p0) {}\ + virtual bool MatchAndExplain(\ + arg_type arg, ::testing::MatchResultListener* result_listener) const;\ + virtual void DescribeTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(false);\ + }\ + virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type p0;\ + private:\ + ::testing::internal::string FormatDescription(bool negation) const {\ + const ::testing::internal::string gmock_description = (description);\ + if (!gmock_description.empty()) {\ + return gmock_description;\ + }\ + return ::testing::internal::FormatMatcherDescription(\ + negation, #name, \ + ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ + ::testing::tuple(p0)));\ + }\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template \ + operator ::testing::Matcher() const {\ + return ::testing::Matcher(\ + new gmock_Impl(p0));\ + }\ + explicit name##MatcherP(p0##_type gmock_p0) : p0(gmock_p0) {\ + }\ + p0##_type p0;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##MatcherP);\ + };\ + template \ + inline name##MatcherP name(p0##_type p0) {\ + return name##MatcherP(p0);\ + }\ + template \ + template \ + bool name##MatcherP::gmock_Impl::MatchAndExplain(\ + arg_type arg, \ + ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\ + const + +#define MATCHER_P2(name, p0, p1, description)\ + template \ + class name##MatcherP2 {\ + public:\ + template \ + class gmock_Impl : public ::testing::MatcherInterface {\ + public:\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\ + : p0(gmock_p0), p1(gmock_p1) {}\ + virtual bool MatchAndExplain(\ + arg_type arg, ::testing::MatchResultListener* result_listener) const;\ + virtual void DescribeTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(false);\ + }\ + virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type p0;\ + p1##_type p1;\ + private:\ + ::testing::internal::string FormatDescription(bool negation) const {\ + const ::testing::internal::string gmock_description = (description);\ + if (!gmock_description.empty()) {\ + return gmock_description;\ + }\ + return ::testing::internal::FormatMatcherDescription(\ + negation, #name, \ + ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ + ::testing::tuple(p0, p1)));\ + }\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template \ + operator ::testing::Matcher() const {\ + return ::testing::Matcher(\ + new gmock_Impl(p0, p1));\ + }\ + name##MatcherP2(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \ + p1(gmock_p1) {\ + }\ + p0##_type p0;\ + p1##_type p1;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##MatcherP2);\ + };\ + template \ + inline name##MatcherP2 name(p0##_type p0, \ + p1##_type p1) {\ + return name##MatcherP2(p0, p1);\ + }\ + template \ + template \ + bool name##MatcherP2::gmock_Impl::MatchAndExplain(\ + arg_type arg, \ + ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\ + const + +#define MATCHER_P3(name, p0, p1, p2, description)\ + template \ + class name##MatcherP3 {\ + public:\ + template \ + class gmock_Impl : public ::testing::MatcherInterface {\ + public:\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\ + : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\ + virtual bool MatchAndExplain(\ + arg_type arg, ::testing::MatchResultListener* result_listener) const;\ + virtual void DescribeTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(false);\ + }\ + virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + private:\ + ::testing::internal::string FormatDescription(bool negation) const {\ + const ::testing::internal::string gmock_description = (description);\ + if (!gmock_description.empty()) {\ + return gmock_description;\ + }\ + return ::testing::internal::FormatMatcherDescription(\ + negation, #name, \ + ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ + ::testing::tuple(p0, p1, \ + p2)));\ + }\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template \ + operator ::testing::Matcher() const {\ + return ::testing::Matcher(\ + new gmock_Impl(p0, p1, p2));\ + }\ + name##MatcherP3(p0##_type gmock_p0, p1##_type gmock_p1, \ + p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##MatcherP3);\ + };\ + template \ + inline name##MatcherP3 name(p0##_type p0, \ + p1##_type p1, p2##_type p2) {\ + return name##MatcherP3(p0, p1, p2);\ + }\ + template \ + template \ + bool name##MatcherP3::gmock_Impl::MatchAndExplain(\ + arg_type arg, \ + ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\ + const + +#define MATCHER_P4(name, p0, p1, p2, p3, description)\ + template \ + class name##MatcherP4 {\ + public:\ + template \ + class gmock_Impl : public ::testing::MatcherInterface {\ + public:\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3)\ + : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3) {}\ + virtual bool MatchAndExplain(\ + arg_type arg, ::testing::MatchResultListener* result_listener) const;\ + virtual void DescribeTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(false);\ + }\ + virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + private:\ + ::testing::internal::string FormatDescription(bool negation) const {\ + const ::testing::internal::string gmock_description = (description);\ + if (!gmock_description.empty()) {\ + return gmock_description;\ + }\ + return ::testing::internal::FormatMatcherDescription(\ + negation, #name, \ + ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ + ::testing::tuple(p0, p1, p2, p3)));\ + }\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template \ + operator ::testing::Matcher() const {\ + return ::testing::Matcher(\ + new gmock_Impl(p0, p1, p2, p3));\ + }\ + name##MatcherP4(p0##_type gmock_p0, p1##_type gmock_p1, \ + p2##_type gmock_p2, p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), \ + p2(gmock_p2), p3(gmock_p3) {\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##MatcherP4);\ + };\ + template \ + inline name##MatcherP4 name(p0##_type p0, p1##_type p1, p2##_type p2, \ + p3##_type p3) {\ + return name##MatcherP4(p0, \ + p1, p2, p3);\ + }\ + template \ + template \ + bool name##MatcherP4::gmock_Impl::MatchAndExplain(\ + arg_type arg, \ + ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\ + const + +#define MATCHER_P5(name, p0, p1, p2, p3, p4, description)\ + template \ + class name##MatcherP5 {\ + public:\ + template \ + class gmock_Impl : public ::testing::MatcherInterface {\ + public:\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3, p4##_type gmock_p4)\ + : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \ + p4(gmock_p4) {}\ + virtual bool MatchAndExplain(\ + arg_type arg, ::testing::MatchResultListener* result_listener) const;\ + virtual void DescribeTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(false);\ + }\ + virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + private:\ + ::testing::internal::string FormatDescription(bool negation) const {\ + const ::testing::internal::string gmock_description = (description);\ + if (!gmock_description.empty()) {\ + return gmock_description;\ + }\ + return ::testing::internal::FormatMatcherDescription(\ + negation, #name, \ + ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ + ::testing::tuple(p0, p1, p2, p3, p4)));\ + }\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template \ + operator ::testing::Matcher() const {\ + return ::testing::Matcher(\ + new gmock_Impl(p0, p1, p2, p3, p4));\ + }\ + name##MatcherP5(p0##_type gmock_p0, p1##_type gmock_p1, \ + p2##_type gmock_p2, p3##_type gmock_p3, \ + p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \ + p3(gmock_p3), p4(gmock_p4) {\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##MatcherP5);\ + };\ + template \ + inline name##MatcherP5 name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \ + p4##_type p4) {\ + return name##MatcherP5(p0, p1, p2, p3, p4);\ + }\ + template \ + template \ + bool name##MatcherP5::gmock_Impl::MatchAndExplain(\ + arg_type arg, \ + ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\ + const + +#define MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description)\ + template \ + class name##MatcherP6 {\ + public:\ + template \ + class gmock_Impl : public ::testing::MatcherInterface {\ + public:\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5)\ + : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \ + p4(gmock_p4), p5(gmock_p5) {}\ + virtual bool MatchAndExplain(\ + arg_type arg, ::testing::MatchResultListener* result_listener) const;\ + virtual void DescribeTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(false);\ + }\ + virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + private:\ + ::testing::internal::string FormatDescription(bool negation) const {\ + const ::testing::internal::string gmock_description = (description);\ + if (!gmock_description.empty()) {\ + return gmock_description;\ + }\ + return ::testing::internal::FormatMatcherDescription(\ + negation, #name, \ + ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ + ::testing::tuple(p0, p1, p2, p3, p4, p5)));\ + }\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template \ + operator ::testing::Matcher() const {\ + return ::testing::Matcher(\ + new gmock_Impl(p0, p1, p2, p3, p4, p5));\ + }\ + name##MatcherP6(p0##_type gmock_p0, p1##_type gmock_p1, \ + p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ + p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \ + p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##MatcherP6);\ + };\ + template \ + inline name##MatcherP6 name(p0##_type p0, p1##_type p1, p2##_type p2, \ + p3##_type p3, p4##_type p4, p5##_type p5) {\ + return name##MatcherP6(p0, p1, p2, p3, p4, p5);\ + }\ + template \ + template \ + bool name##MatcherP6::gmock_Impl::MatchAndExplain(\ + arg_type arg, \ + ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\ + const + +#define MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description)\ + template \ + class name##MatcherP7 {\ + public:\ + template \ + class gmock_Impl : public ::testing::MatcherInterface {\ + public:\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ + p6##_type gmock_p6)\ + : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \ + p4(gmock_p4), p5(gmock_p5), p6(gmock_p6) {}\ + virtual bool MatchAndExplain(\ + arg_type arg, ::testing::MatchResultListener* result_listener) const;\ + virtual void DescribeTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(false);\ + }\ + virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + p6##_type p6;\ + private:\ + ::testing::internal::string FormatDescription(bool negation) const {\ + const ::testing::internal::string gmock_description = (description);\ + if (!gmock_description.empty()) {\ + return gmock_description;\ + }\ + return ::testing::internal::FormatMatcherDescription(\ + negation, #name, \ + ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ + ::testing::tuple(p0, p1, p2, p3, p4, p5, \ + p6)));\ + }\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template \ + operator ::testing::Matcher() const {\ + return ::testing::Matcher(\ + new gmock_Impl(p0, p1, p2, p3, p4, p5, p6));\ + }\ + name##MatcherP7(p0##_type gmock_p0, p1##_type gmock_p1, \ + p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ + p5##_type gmock_p5, p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), \ + p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), \ + p6(gmock_p6) {\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + p6##_type p6;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##MatcherP7);\ + };\ + template \ + inline name##MatcherP7 name(p0##_type p0, p1##_type p1, \ + p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \ + p6##_type p6) {\ + return name##MatcherP7(p0, p1, p2, p3, p4, p5, p6);\ + }\ + template \ + template \ + bool name##MatcherP7::gmock_Impl::MatchAndExplain(\ + arg_type arg, \ + ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\ + const + +#define MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description)\ + template \ + class name##MatcherP8 {\ + public:\ + template \ + class gmock_Impl : public ::testing::MatcherInterface {\ + public:\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ + p6##_type gmock_p6, p7##_type gmock_p7)\ + : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \ + p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7) {}\ + virtual bool MatchAndExplain(\ + arg_type arg, ::testing::MatchResultListener* result_listener) const;\ + virtual void DescribeTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(false);\ + }\ + virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + p6##_type p6;\ + p7##_type p7;\ + private:\ + ::testing::internal::string FormatDescription(bool negation) const {\ + const ::testing::internal::string gmock_description = (description);\ + if (!gmock_description.empty()) {\ + return gmock_description;\ + }\ + return ::testing::internal::FormatMatcherDescription(\ + negation, #name, \ + ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ + ::testing::tuple(p0, p1, p2, \ + p3, p4, p5, p6, p7)));\ + }\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template \ + operator ::testing::Matcher() const {\ + return ::testing::Matcher(\ + new gmock_Impl(p0, p1, p2, p3, p4, p5, p6, p7));\ + }\ + name##MatcherP8(p0##_type gmock_p0, p1##_type gmock_p1, \ + p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ + p5##_type gmock_p5, p6##_type gmock_p6, \ + p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \ + p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \ + p7(gmock_p7) {\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + p6##_type p6;\ + p7##_type p7;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##MatcherP8);\ + };\ + template \ + inline name##MatcherP8 name(p0##_type p0, \ + p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \ + p6##_type p6, p7##_type p7) {\ + return name##MatcherP8(p0, p1, p2, p3, p4, p5, \ + p6, p7);\ + }\ + template \ + template \ + bool name##MatcherP8::gmock_Impl::MatchAndExplain(\ + arg_type arg, \ + ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\ + const + +#define MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)\ + template \ + class name##MatcherP9 {\ + public:\ + template \ + class gmock_Impl : public ::testing::MatcherInterface {\ + public:\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ + p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8)\ + : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \ + p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \ + p8(gmock_p8) {}\ + virtual bool MatchAndExplain(\ + arg_type arg, ::testing::MatchResultListener* result_listener) const;\ + virtual void DescribeTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(false);\ + }\ + virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + p6##_type p6;\ + p7##_type p7;\ + p8##_type p8;\ + private:\ + ::testing::internal::string FormatDescription(bool negation) const {\ + const ::testing::internal::string gmock_description = (description);\ + if (!gmock_description.empty()) {\ + return gmock_description;\ + }\ + return ::testing::internal::FormatMatcherDescription(\ + negation, #name, \ + ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ + ::testing::tuple(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\ + }\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template \ + operator ::testing::Matcher() const {\ + return ::testing::Matcher(\ + new gmock_Impl(p0, p1, p2, p3, p4, p5, p6, p7, p8));\ + }\ + name##MatcherP9(p0##_type gmock_p0, p1##_type gmock_p1, \ + p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ + p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \ + p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \ + p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \ + p8(gmock_p8) {\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + p6##_type p6;\ + p7##_type p7;\ + p8##_type p8;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##MatcherP9);\ + };\ + template \ + inline name##MatcherP9 name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \ + p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \ + p8##_type p8) {\ + return name##MatcherP9(p0, p1, p2, \ + p3, p4, p5, p6, p7, p8);\ + }\ + template \ + template \ + bool name##MatcherP9::gmock_Impl::MatchAndExplain(\ + arg_type arg, \ + ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\ + const + +#define MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, description)\ + template \ + class name##MatcherP10 {\ + public:\ + template \ + class gmock_Impl : public ::testing::MatcherInterface {\ + public:\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ + p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ + p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \ + p9##_type gmock_p9)\ + : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \ + p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \ + p8(gmock_p8), p9(gmock_p9) {}\ + virtual bool MatchAndExplain(\ + arg_type arg, ::testing::MatchResultListener* result_listener) const;\ + virtual void DescribeTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(false);\ + }\ + virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + p6##_type p6;\ + p7##_type p7;\ + p8##_type p8;\ + p9##_type p9;\ + private:\ + ::testing::internal::string FormatDescription(bool negation) const {\ + const ::testing::internal::string gmock_description = (description);\ + if (!gmock_description.empty()) {\ + return gmock_description;\ + }\ + return ::testing::internal::FormatMatcherDescription(\ + negation, #name, \ + ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ + ::testing::tuple(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\ + }\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template \ + operator ::testing::Matcher() const {\ + return ::testing::Matcher(\ + new gmock_Impl(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9));\ + }\ + name##MatcherP10(p0##_type gmock_p0, p1##_type gmock_p1, \ + p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ + p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \ + p8##_type gmock_p8, p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), \ + p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \ + p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {\ + }\ + p0##_type p0;\ + p1##_type p1;\ + p2##_type p2;\ + p3##_type p3;\ + p4##_type p4;\ + p5##_type p5;\ + p6##_type p6;\ + p7##_type p7;\ + p8##_type p8;\ + p9##_type p9;\ + private:\ + GTEST_DISALLOW_ASSIGN_(name##MatcherP10);\ + };\ + template \ + inline name##MatcherP10 name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \ + p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \ + p9##_type p9) {\ + return name##MatcherP10(p0, \ + p1, p2, p3, p4, p5, p6, p7, p8, p9);\ + }\ + template \ + template \ + bool name##MatcherP10::gmock_Impl::MatchAndExplain(\ + arg_type arg, \ + ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\ + const + +#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-generated-matchers.h.pump vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-generated-matchers.h.pump --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-generated-matchers.h.pump 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-generated-matchers.h.pump 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,673 @@ +$$ -*- mode: c++; -*- +$$ This is a Pump source file. Please use Pump to convert it to +$$ gmock-generated-actions.h. +$$ +$var n = 10 $$ The maximum arity we support. +$$ }} This line fixes auto-indentation of the following code in Emacs. +// Copyright 2008, Google Inc. +// 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 Google Inc. 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 +// OWNER 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. + +// Google Mock - a framework for writing C++ mock classes. +// +// This file implements some commonly used variadic matchers. + +#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_ +#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_ + +#include +#include +#include +#include +#include "gmock/gmock-matchers.h" + +namespace testing { +namespace internal { + +$range i 0..n-1 + +// The type of the i-th (0-based) field of Tuple. +#define GMOCK_FIELD_TYPE_(Tuple, i) \ + typename ::testing::tuple_element::type + +// TupleFields is for selecting fields from a +// tuple of type Tuple. It has two members: +// +// type: a tuple type whose i-th field is the ki-th field of Tuple. +// GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple. +// +// For example, in class TupleFields, 2, 0>, we have: +// +// type is tuple, and +// GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true). + +template +class TupleFields; + +// This generic version is used when there are $n selectors. +template +class TupleFields { + public: + typedef ::testing::tuple<$for i, [[GMOCK_FIELD_TYPE_(Tuple, k$i)]]> type; + static type GetSelectedFields(const Tuple& t) { + return type($for i, [[get(t)]]); + } +}; + +// The following specialization is used for 0 ~ $(n-1) selectors. + +$for i [[ +$$ }}} +$range j 0..i-1 +$range k 0..n-1 + +template +class TupleFields { + public: + typedef ::testing::tuple<$for j, [[GMOCK_FIELD_TYPE_(Tuple, k$j)]]> type; + static type GetSelectedFields(const Tuple& $if i==0 [[/* t */]] $else [[t]]) { + return type($for j, [[get(t)]]); + } +}; + +]] + +#undef GMOCK_FIELD_TYPE_ + +// Implements the Args() matcher. + +$var ks = [[$for i, [[k$i]]]] +template +class ArgsMatcherImpl : public MatcherInterface { + public: + // ArgsTuple may have top-level const or reference modifiers. + typedef GTEST_REMOVE_REFERENCE_AND_CONST_(ArgsTuple) RawArgsTuple; + typedef typename internal::TupleFields::type SelectedArgs; + typedef Matcher MonomorphicInnerMatcher; + + template + explicit ArgsMatcherImpl(const InnerMatcher& inner_matcher) + : inner_matcher_(SafeMatcherCast(inner_matcher)) {} + + virtual bool MatchAndExplain(ArgsTuple args, + MatchResultListener* listener) const { + const SelectedArgs& selected_args = GetSelectedArgs(args); + if (!listener->IsInterested()) + return inner_matcher_.Matches(selected_args); + + PrintIndices(listener->stream()); + *listener << "are " << PrintToString(selected_args); + + StringMatchResultListener inner_listener; + const bool match = inner_matcher_.MatchAndExplain(selected_args, + &inner_listener); + PrintIfNotEmpty(inner_listener.str(), listener->stream()); + return match; + } + + virtual void DescribeTo(::std::ostream* os) const { + *os << "are a tuple "; + PrintIndices(os); + inner_matcher_.DescribeTo(os); + } + + virtual void DescribeNegationTo(::std::ostream* os) const { + *os << "are a tuple "; + PrintIndices(os); + inner_matcher_.DescribeNegationTo(os); + } + + private: + static SelectedArgs GetSelectedArgs(ArgsTuple args) { + return TupleFields::GetSelectedFields(args); + } + + // Prints the indices of the selected fields. + static void PrintIndices(::std::ostream* os) { + *os << "whose fields ("; + const int indices[$n] = { $ks }; + for (int i = 0; i < $n; i++) { + if (indices[i] < 0) + break; + + if (i >= 1) + *os << ", "; + + *os << "#" << indices[i]; + } + *os << ") "; + } + + const MonomorphicInnerMatcher inner_matcher_; + + GTEST_DISALLOW_ASSIGN_(ArgsMatcherImpl); +}; + +template +class ArgsMatcher { + public: + explicit ArgsMatcher(const InnerMatcher& inner_matcher) + : inner_matcher_(inner_matcher) {} + + template + operator Matcher() const { + return MakeMatcher(new ArgsMatcherImpl(inner_matcher_)); + } + + private: + const InnerMatcher inner_matcher_; + + GTEST_DISALLOW_ASSIGN_(ArgsMatcher); +}; + +// A set of metafunctions for computing the result type of AllOf. +// AllOf(m1, ..., mN) returns +// AllOfResultN::type. + +// Although AllOf isn't defined for one argument, AllOfResult1 is defined +// to simplify the implementation. +template +struct AllOfResult1 { + typedef M1 type; +}; + +$range i 1..n + +$range i 2..n +$for i [[ +$range j 2..i +$var m = i/2 +$range k 1..m +$range t m+1..i + +template +struct AllOfResult$i { + typedef BothOfMatcher< + typename AllOfResult$m<$for k, [[M$k]]>::type, + typename AllOfResult$(i-m)<$for t, [[M$t]]>::type + > type; +}; + +]] + +// A set of metafunctions for computing the result type of AnyOf. +// AnyOf(m1, ..., mN) returns +// AnyOfResultN::type. + +// Although AnyOf isn't defined for one argument, AnyOfResult1 is defined +// to simplify the implementation. +template +struct AnyOfResult1 { + typedef M1 type; +}; + +$range i 1..n + +$range i 2..n +$for i [[ +$range j 2..i +$var m = i/2 +$range k 1..m +$range t m+1..i + +template +struct AnyOfResult$i { + typedef EitherOfMatcher< + typename AnyOfResult$m<$for k, [[M$k]]>::type, + typename AnyOfResult$(i-m)<$for t, [[M$t]]>::type + > type; +}; + +]] + +} // namespace internal + +// Args(a_matcher) matches a tuple if the selected +// fields of it matches a_matcher. C++ doesn't support default +// arguments for function templates, so we have to overload it. + +$range i 0..n +$for i [[ +$range j 1..i +template <$for j [[int k$j, ]]typename InnerMatcher> +inline internal::ArgsMatcher +Args(const InnerMatcher& matcher) { + return internal::ArgsMatcher(matcher); +} + + +]] +// ElementsAre(e_1, e_2, ... e_n) matches an STL-style container with +// n elements, where the i-th element in the container must +// match the i-th argument in the list. Each argument of +// ElementsAre() can be either a value or a matcher. We support up to +// $n arguments. +// +// The use of DecayArray in the implementation allows ElementsAre() +// to accept string literals, whose type is const char[N], but we +// want to treat them as const char*. +// +// NOTE: Since ElementsAre() cares about the order of the elements, it +// must not be used with containers whose elements's order is +// undefined (e.g. hash_map). + +$range i 0..n +$for i [[ + +$range j 1..i + +$if i>0 [[ + +template <$for j, [[typename T$j]]> +]] + +inline internal::ElementsAreMatcher< + ::testing::tuple< +$for j, [[ + + typename internal::DecayArray::type]]> > +ElementsAre($for j, [[const T$j& e$j]]) { + typedef ::testing::tuple< +$for j, [[ + + typename internal::DecayArray::type]]> Args; + return internal::ElementsAreMatcher(Args($for j, [[e$j]])); +} + +]] + +// UnorderedElementsAre(e_1, e_2, ..., e_n) is an ElementsAre extension +// that matches n elements in any order. We support up to n=$n arguments. + +$range i 0..n +$for i [[ + +$range j 1..i + +$if i>0 [[ + +template <$for j, [[typename T$j]]> +]] + +inline internal::UnorderedElementsAreMatcher< + ::testing::tuple< +$for j, [[ + + typename internal::DecayArray::type]]> > +UnorderedElementsAre($for j, [[const T$j& e$j]]) { + typedef ::testing::tuple< +$for j, [[ + + typename internal::DecayArray::type]]> Args; + return internal::UnorderedElementsAreMatcher(Args($for j, [[e$j]])); +} + +]] + +// AllOf(m1, m2, ..., mk) matches any value that matches all of the given +// sub-matchers. AllOf is called fully qualified to prevent ADL from firing. + +$range i 2..n +$for i [[ +$range j 1..i +$var m = i/2 +$range k 1..m +$range t m+1..i + +template <$for j, [[typename M$j]]> +inline typename internal::AllOfResult$i<$for j, [[M$j]]>::type +AllOf($for j, [[M$j m$j]]) { + return typename internal::AllOfResult$i<$for j, [[M$j]]>::type( + $if m == 1 [[m1]] $else [[::testing::AllOf($for k, [[m$k]])]], + $if m+1 == i [[m$i]] $else [[::testing::AllOf($for t, [[m$t]])]]); +} + +]] + +// AnyOf(m1, m2, ..., mk) matches any value that matches any of the given +// sub-matchers. AnyOf is called fully qualified to prevent ADL from firing. + +$range i 2..n +$for i [[ +$range j 1..i +$var m = i/2 +$range k 1..m +$range t m+1..i + +template <$for j, [[typename M$j]]> +inline typename internal::AnyOfResult$i<$for j, [[M$j]]>::type +AnyOf($for j, [[M$j m$j]]) { + return typename internal::AnyOfResult$i<$for j, [[M$j]]>::type( + $if m == 1 [[m1]] $else [[::testing::AnyOf($for k, [[m$k]])]], + $if m+1 == i [[m$i]] $else [[::testing::AnyOf($for t, [[m$t]])]]); +} + +]] + +} // namespace testing +$$ } // This Pump meta comment fixes auto-indentation in Emacs. It will not +$$ // show up in the generated code. + + +// The MATCHER* family of macros can be used in a namespace scope to +// define custom matchers easily. +// +// Basic Usage +// =========== +// +// The syntax +// +// MATCHER(name, description_string) { statements; } +// +// defines a matcher with the given name that executes the statements, +// which must return a bool to indicate if the match succeeds. Inside +// the statements, you can refer to the value being matched by 'arg', +// and refer to its type by 'arg_type'. +// +// The description string documents what the matcher does, and is used +// to generate the failure message when the match fails. Since a +// MATCHER() is usually defined in a header file shared by multiple +// C++ source files, we require the description to be a C-string +// literal to avoid possible side effects. It can be empty, in which +// case we'll use the sequence of words in the matcher name as the +// description. +// +// For example: +// +// MATCHER(IsEven, "") { return (arg % 2) == 0; } +// +// allows you to write +// +// // Expects mock_foo.Bar(n) to be called where n is even. +// EXPECT_CALL(mock_foo, Bar(IsEven())); +// +// or, +// +// // Verifies that the value of some_expression is even. +// EXPECT_THAT(some_expression, IsEven()); +// +// If the above assertion fails, it will print something like: +// +// Value of: some_expression +// Expected: is even +// Actual: 7 +// +// where the description "is even" is automatically calculated from the +// matcher name IsEven. +// +// Argument Type +// ============= +// +// Note that the type of the value being matched (arg_type) is +// determined by the context in which you use the matcher and is +// supplied to you by the compiler, so you don't need to worry about +// declaring it (nor can you). This allows the matcher to be +// polymorphic. For example, IsEven() can be used to match any type +// where the value of "(arg % 2) == 0" can be implicitly converted to +// a bool. In the "Bar(IsEven())" example above, if method Bar() +// takes an int, 'arg_type' will be int; if it takes an unsigned long, +// 'arg_type' will be unsigned long; and so on. +// +// Parameterizing Matchers +// ======================= +// +// Sometimes you'll want to parameterize the matcher. For that you +// can use another macro: +// +// MATCHER_P(name, param_name, description_string) { statements; } +// +// For example: +// +// MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; } +// +// will allow you to write: +// +// EXPECT_THAT(Blah("a"), HasAbsoluteValue(n)); +// +// which may lead to this message (assuming n is 10): +// +// Value of: Blah("a") +// Expected: has absolute value 10 +// Actual: -9 +// +// Note that both the matcher description and its parameter are +// printed, making the message human-friendly. +// +// In the matcher definition body, you can write 'foo_type' to +// reference the type of a parameter named 'foo'. For example, in the +// body of MATCHER_P(HasAbsoluteValue, value) above, you can write +// 'value_type' to refer to the type of 'value'. +// +// We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P$n to +// support multi-parameter matchers. +// +// Describing Parameterized Matchers +// ================================= +// +// The last argument to MATCHER*() is a string-typed expression. The +// expression can reference all of the matcher's parameters and a +// special bool-typed variable named 'negation'. When 'negation' is +// false, the expression should evaluate to the matcher's description; +// otherwise it should evaluate to the description of the negation of +// the matcher. For example, +// +// using testing::PrintToString; +// +// MATCHER_P2(InClosedRange, low, hi, +// string(negation ? "is not" : "is") + " in range [" + +// PrintToString(low) + ", " + PrintToString(hi) + "]") { +// return low <= arg && arg <= hi; +// } +// ... +// EXPECT_THAT(3, InClosedRange(4, 6)); +// EXPECT_THAT(3, Not(InClosedRange(2, 4))); +// +// would generate two failures that contain the text: +// +// Expected: is in range [4, 6] +// ... +// Expected: is not in range [2, 4] +// +// If you specify "" as the description, the failure message will +// contain the sequence of words in the matcher name followed by the +// parameter values printed as a tuple. For example, +// +// MATCHER_P2(InClosedRange, low, hi, "") { ... } +// ... +// EXPECT_THAT(3, InClosedRange(4, 6)); +// EXPECT_THAT(3, Not(InClosedRange(2, 4))); +// +// would generate two failures that contain the text: +// +// Expected: in closed range (4, 6) +// ... +// Expected: not (in closed range (2, 4)) +// +// Types of Matcher Parameters +// =========================== +// +// For the purpose of typing, you can view +// +// MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... } +// +// as shorthand for +// +// template +// FooMatcherPk +// Foo(p1_type p1, ..., pk_type pk) { ... } +// +// When you write Foo(v1, ..., vk), the compiler infers the types of +// the parameters v1, ..., and vk for you. If you are not happy with +// the result of the type inference, you can specify the types by +// explicitly instantiating the template, as in Foo(5, +// false). As said earlier, you don't get to (or need to) specify +// 'arg_type' as that's determined by the context in which the matcher +// is used. You can assign the result of expression Foo(p1, ..., pk) +// to a variable of type FooMatcherPk. This +// can be useful when composing matchers. +// +// While you can instantiate a matcher template with reference types, +// passing the parameters by pointer usually makes your code more +// readable. If, however, you still want to pass a parameter by +// reference, be aware that in the failure message generated by the +// matcher you will see the value of the referenced object but not its +// address. +// +// Explaining Match Results +// ======================== +// +// Sometimes the matcher description alone isn't enough to explain why +// the match has failed or succeeded. For example, when expecting a +// long string, it can be very helpful to also print the diff between +// the expected string and the actual one. To achieve that, you can +// optionally stream additional information to a special variable +// named result_listener, whose type is a pointer to class +// MatchResultListener: +// +// MATCHER_P(EqualsLongString, str, "") { +// if (arg == str) return true; +// +// *result_listener << "the difference: " +/// << DiffStrings(str, arg); +// return false; +// } +// +// Overloading Matchers +// ==================== +// +// You can overload matchers with different numbers of parameters: +// +// MATCHER_P(Blah, a, description_string1) { ... } +// MATCHER_P2(Blah, a, b, description_string2) { ... } +// +// Caveats +// ======= +// +// When defining a new matcher, you should also consider implementing +// MatcherInterface or using MakePolymorphicMatcher(). These +// approaches require more work than the MATCHER* macros, but also +// give you more control on the types of the value being matched and +// the matcher parameters, which may leads to better compiler error +// messages when the matcher is used wrong. They also allow +// overloading matchers based on parameter types (as opposed to just +// based on the number of parameters). +// +// MATCHER*() can only be used in a namespace scope. The reason is +// that C++ doesn't yet allow function-local types to be used to +// instantiate templates. The up-coming C++0x standard will fix this. +// Once that's done, we'll consider supporting using MATCHER*() inside +// a function. +// +// More Information +// ================ +// +// To learn more about using these macros, please search for 'MATCHER' +// on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md + +$range i 0..n +$for i + +[[ +$var macro_name = [[$if i==0 [[MATCHER]] $elif i==1 [[MATCHER_P]] + $else [[MATCHER_P$i]]]] +$var class_name = [[name##Matcher[[$if i==0 [[]] $elif i==1 [[P]] + $else [[P$i]]]]]] +$range j 0..i-1 +$var template = [[$if i==0 [[]] $else [[ + + template <$for j, [[typename p$j##_type]]>\ +]]]] +$var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]] +$var impl_ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]] +$var impl_inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(gmock_p$j)]]]]]] +$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(gmock_p$j)]]]]]] +$var params = [[$for j, [[p$j]]]] +$var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]] +$var param_types_and_names = [[$for j, [[p$j##_type p$j]]]] +$var param_field_decls = [[$for j +[[ + + p$j##_type p$j;\ +]]]] +$var param_field_decls2 = [[$for j +[[ + + p$j##_type p$j;\ +]]]] + +#define $macro_name(name$for j [[, p$j]], description)\$template + class $class_name {\ + public:\ + template \ + class gmock_Impl : public ::testing::MatcherInterface {\ + public:\ + [[$if i==1 [[explicit ]]]]gmock_Impl($impl_ctor_param_list)\ + $impl_inits {}\ + virtual bool MatchAndExplain(\ + arg_type arg, ::testing::MatchResultListener* result_listener) const;\ + virtual void DescribeTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(false);\ + }\ + virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ + *gmock_os << FormatDescription(true);\ + }\$param_field_decls + private:\ + ::testing::internal::string FormatDescription(bool negation) const {\ + const ::testing::internal::string gmock_description = (description);\ + if (!gmock_description.empty()) {\ + return gmock_description;\ + }\ + return ::testing::internal::FormatMatcherDescription(\ + negation, #name, \ + ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ + ::testing::tuple<$for j, [[p$j##_type]]>($for j, [[p$j]])));\ + }\ + GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ + };\ + template \ + operator ::testing::Matcher() const {\ + return ::testing::Matcher(\ + new gmock_Impl($params));\ + }\ + [[$if i==1 [[explicit ]]]]$class_name($ctor_param_list)$inits {\ + }\$param_field_decls2 + private:\ + GTEST_DISALLOW_ASSIGN_($class_name);\ + };\$template + inline $class_name$param_types name($param_types_and_names) {\ + return $class_name$param_types($params);\ + }\$template + template \ + bool $class_name$param_types::gmock_Impl::MatchAndExplain(\ + arg_type arg, \ + ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\ + const +]] + + +#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_ diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-generated-nice-strict.h vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-generated-nice-strict.h --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-generated-nice-strict.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-generated-nice-strict.h 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,397 @@ +// This file was GENERATED by command: +// pump.py gmock-generated-nice-strict.h.pump +// DO NOT EDIT BY HAND!!! + +// Copyright 2008, Google Inc. +// 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 Google Inc. 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 +// OWNER 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. +// +// Author: wan@google.com (Zhanyong Wan) + +// Implements class templates NiceMock, NaggyMock, and StrictMock. +// +// Given a mock class MockFoo that is created using Google Mock, +// NiceMock is a subclass of MockFoo that allows +// uninteresting calls (i.e. calls to mock methods that have no +// EXPECT_CALL specs), NaggyMock is a subclass of MockFoo +// that prints a warning when an uninteresting call occurs, and +// StrictMock is a subclass of MockFoo that treats all +// uninteresting calls as errors. +// +// Currently a mock is naggy by default, so MockFoo and +// NaggyMock behave like the same. However, we will soon +// switch the default behavior of mocks to be nice, as that in general +// leads to more maintainable tests. When that happens, MockFoo will +// stop behaving like NaggyMock and start behaving like +// NiceMock. +// +// NiceMock, NaggyMock, and StrictMock "inherit" the constructors of +// their respective base class, with up-to 10 arguments. Therefore +// you can write NiceMock(5, "a") to construct a nice mock +// where MockFoo has a constructor that accepts (int, const char*), +// for example. +// +// A known limitation is that NiceMock, NaggyMock, +// and StrictMock only works for mock methods defined using +// the MOCK_METHOD* family of macros DIRECTLY in the MockFoo class. +// If a mock method is defined in a base class of MockFoo, the "nice" +// or "strict" modifier may not affect it, depending on the compiler. +// In particular, nesting NiceMock, NaggyMock, and StrictMock is NOT +// supported. +// +// Another known limitation is that the constructors of the base mock +// cannot have arguments passed by non-const reference, which are +// banned by the Google C++ style guide anyway. + +#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_ +#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_ + +#include "gmock/gmock-spec-builders.h" +#include "gmock/internal/gmock-port.h" + +namespace testing { + +template +class NiceMock : public MockClass { + public: + // We don't factor out the constructor body to a common method, as + // we have to avoid a possible clash with members of MockClass. + NiceMock() { + ::testing::Mock::AllowUninterestingCalls( + internal::ImplicitCast_(this)); + } + + // C++ doesn't (yet) allow inheritance of constructors, so we have + // to define it for each arity. + template + explicit NiceMock(const A1& a1) : MockClass(a1) { + ::testing::Mock::AllowUninterestingCalls( + internal::ImplicitCast_(this)); + } + template + NiceMock(const A1& a1, const A2& a2) : MockClass(a1, a2) { + ::testing::Mock::AllowUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + NiceMock(const A1& a1, const A2& a2, const A3& a3) : MockClass(a1, a2, a3) { + ::testing::Mock::AllowUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + NiceMock(const A1& a1, const A2& a2, const A3& a3, + const A4& a4) : MockClass(a1, a2, a3, a4) { + ::testing::Mock::AllowUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4, + const A5& a5) : MockClass(a1, a2, a3, a4, a5) { + ::testing::Mock::AllowUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4, + const A5& a5, const A6& a6) : MockClass(a1, a2, a3, a4, a5, a6) { + ::testing::Mock::AllowUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4, + const A5& a5, const A6& a6, const A7& a7) : MockClass(a1, a2, a3, a4, a5, + a6, a7) { + ::testing::Mock::AllowUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4, + const A5& a5, const A6& a6, const A7& a7, const A8& a8) : MockClass(a1, + a2, a3, a4, a5, a6, a7, a8) { + ::testing::Mock::AllowUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4, + const A5& a5, const A6& a6, const A7& a7, const A8& a8, + const A9& a9) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + ::testing::Mock::AllowUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4, + const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, + const A10& a10) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) { + ::testing::Mock::AllowUninterestingCalls( + internal::ImplicitCast_(this)); + } + + virtual ~NiceMock() { + ::testing::Mock::UnregisterCallReaction( + internal::ImplicitCast_(this)); + } + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(NiceMock); +}; + +template +class NaggyMock : public MockClass { + public: + // We don't factor out the constructor body to a common method, as + // we have to avoid a possible clash with members of MockClass. + NaggyMock() { + ::testing::Mock::WarnUninterestingCalls( + internal::ImplicitCast_(this)); + } + + // C++ doesn't (yet) allow inheritance of constructors, so we have + // to define it for each arity. + template + explicit NaggyMock(const A1& a1) : MockClass(a1) { + ::testing::Mock::WarnUninterestingCalls( + internal::ImplicitCast_(this)); + } + template + NaggyMock(const A1& a1, const A2& a2) : MockClass(a1, a2) { + ::testing::Mock::WarnUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + NaggyMock(const A1& a1, const A2& a2, const A3& a3) : MockClass(a1, a2, a3) { + ::testing::Mock::WarnUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + NaggyMock(const A1& a1, const A2& a2, const A3& a3, + const A4& a4) : MockClass(a1, a2, a3, a4) { + ::testing::Mock::WarnUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4, + const A5& a5) : MockClass(a1, a2, a3, a4, a5) { + ::testing::Mock::WarnUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4, + const A5& a5, const A6& a6) : MockClass(a1, a2, a3, a4, a5, a6) { + ::testing::Mock::WarnUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4, + const A5& a5, const A6& a6, const A7& a7) : MockClass(a1, a2, a3, a4, a5, + a6, a7) { + ::testing::Mock::WarnUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4, + const A5& a5, const A6& a6, const A7& a7, const A8& a8) : MockClass(a1, + a2, a3, a4, a5, a6, a7, a8) { + ::testing::Mock::WarnUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4, + const A5& a5, const A6& a6, const A7& a7, const A8& a8, + const A9& a9) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + ::testing::Mock::WarnUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4, + const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, + const A10& a10) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) { + ::testing::Mock::WarnUninterestingCalls( + internal::ImplicitCast_(this)); + } + + virtual ~NaggyMock() { + ::testing::Mock::UnregisterCallReaction( + internal::ImplicitCast_(this)); + } + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(NaggyMock); +}; + +template +class StrictMock : public MockClass { + public: + // We don't factor out the constructor body to a common method, as + // we have to avoid a possible clash with members of MockClass. + StrictMock() { + ::testing::Mock::FailUninterestingCalls( + internal::ImplicitCast_(this)); + } + + // C++ doesn't (yet) allow inheritance of constructors, so we have + // to define it for each arity. + template + explicit StrictMock(const A1& a1) : MockClass(a1) { + ::testing::Mock::FailUninterestingCalls( + internal::ImplicitCast_(this)); + } + template + StrictMock(const A1& a1, const A2& a2) : MockClass(a1, a2) { + ::testing::Mock::FailUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + StrictMock(const A1& a1, const A2& a2, const A3& a3) : MockClass(a1, a2, a3) { + ::testing::Mock::FailUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + StrictMock(const A1& a1, const A2& a2, const A3& a3, + const A4& a4) : MockClass(a1, a2, a3, a4) { + ::testing::Mock::FailUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4, + const A5& a5) : MockClass(a1, a2, a3, a4, a5) { + ::testing::Mock::FailUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4, + const A5& a5, const A6& a6) : MockClass(a1, a2, a3, a4, a5, a6) { + ::testing::Mock::FailUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4, + const A5& a5, const A6& a6, const A7& a7) : MockClass(a1, a2, a3, a4, a5, + a6, a7) { + ::testing::Mock::FailUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4, + const A5& a5, const A6& a6, const A7& a7, const A8& a8) : MockClass(a1, + a2, a3, a4, a5, a6, a7, a8) { + ::testing::Mock::FailUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4, + const A5& a5, const A6& a6, const A7& a7, const A8& a8, + const A9& a9) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + ::testing::Mock::FailUninterestingCalls( + internal::ImplicitCast_(this)); + } + + template + StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4, + const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, + const A10& a10) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) { + ::testing::Mock::FailUninterestingCalls( + internal::ImplicitCast_(this)); + } + + virtual ~StrictMock() { + ::testing::Mock::UnregisterCallReaction( + internal::ImplicitCast_(this)); + } + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(StrictMock); +}; + +// The following specializations catch some (relatively more common) +// user errors of nesting nice and strict mocks. They do NOT catch +// all possible errors. + +// These specializations are declared but not defined, as NiceMock, +// NaggyMock, and StrictMock cannot be nested. + +template +class NiceMock >; +template +class NiceMock >; +template +class NiceMock >; + +template +class NaggyMock >; +template +class NaggyMock >; +template +class NaggyMock >; + +template +class StrictMock >; +template +class StrictMock >; +template +class StrictMock >; + +} // namespace testing + +#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_ diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,161 @@ +$$ -*- mode: c++; -*- +$$ This is a Pump source file. Please use Pump to convert it to +$$ gmock-generated-nice-strict.h. +$$ +$var n = 10 $$ The maximum arity we support. +// Copyright 2008, Google Inc. +// 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 Google Inc. 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 +// OWNER 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. +// +// Author: wan@google.com (Zhanyong Wan) + +// Implements class templates NiceMock, NaggyMock, and StrictMock. +// +// Given a mock class MockFoo that is created using Google Mock, +// NiceMock is a subclass of MockFoo that allows +// uninteresting calls (i.e. calls to mock methods that have no +// EXPECT_CALL specs), NaggyMock is a subclass of MockFoo +// that prints a warning when an uninteresting call occurs, and +// StrictMock is a subclass of MockFoo that treats all +// uninteresting calls as errors. +// +// Currently a mock is naggy by default, so MockFoo and +// NaggyMock behave like the same. However, we will soon +// switch the default behavior of mocks to be nice, as that in general +// leads to more maintainable tests. When that happens, MockFoo will +// stop behaving like NaggyMock and start behaving like +// NiceMock. +// +// NiceMock, NaggyMock, and StrictMock "inherit" the constructors of +// their respective base class, with up-to $n arguments. Therefore +// you can write NiceMock(5, "a") to construct a nice mock +// where MockFoo has a constructor that accepts (int, const char*), +// for example. +// +// A known limitation is that NiceMock, NaggyMock, +// and StrictMock only works for mock methods defined using +// the MOCK_METHOD* family of macros DIRECTLY in the MockFoo class. +// If a mock method is defined in a base class of MockFoo, the "nice" +// or "strict" modifier may not affect it, depending on the compiler. +// In particular, nesting NiceMock, NaggyMock, and StrictMock is NOT +// supported. +// +// Another known limitation is that the constructors of the base mock +// cannot have arguments passed by non-const reference, which are +// banned by the Google C++ style guide anyway. + +#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_ +#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_ + +#include "gmock/gmock-spec-builders.h" +#include "gmock/internal/gmock-port.h" + +namespace testing { + +$range kind 0..2 +$for kind [[ + +$var clazz=[[$if kind==0 [[NiceMock]] + $elif kind==1 [[NaggyMock]] + $else [[StrictMock]]]] + +$var method=[[$if kind==0 [[AllowUninterestingCalls]] + $elif kind==1 [[WarnUninterestingCalls]] + $else [[FailUninterestingCalls]]]] + +template +class $clazz : public MockClass { + public: + // We don't factor out the constructor body to a common method, as + // we have to avoid a possible clash with members of MockClass. + $clazz() { + ::testing::Mock::$method( + internal::ImplicitCast_(this)); + } + + // C++ doesn't (yet) allow inheritance of constructors, so we have + // to define it for each arity. + template + explicit $clazz(const A1& a1) : MockClass(a1) { + ::testing::Mock::$method( + internal::ImplicitCast_(this)); + } + +$range i 2..n +$for i [[ +$range j 1..i + template <$for j, [[typename A$j]]> + $clazz($for j, [[const A$j& a$j]]) : MockClass($for j, [[a$j]]) { + ::testing::Mock::$method( + internal::ImplicitCast_(this)); + } + + +]] + virtual ~$clazz() { + ::testing::Mock::UnregisterCallReaction( + internal::ImplicitCast_(this)); + } + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_($clazz); +}; + +]] + +// The following specializations catch some (relatively more common) +// user errors of nesting nice and strict mocks. They do NOT catch +// all possible errors. + +// These specializations are declared but not defined, as NiceMock, +// NaggyMock, and StrictMock cannot be nested. + +template +class NiceMock >; +template +class NiceMock >; +template +class NiceMock >; + +template +class NaggyMock >; +template +class NaggyMock >; +template +class NaggyMock >; + +template +class StrictMock >; +template +class StrictMock >; +template +class StrictMock >; + +} // namespace testing + +#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_ diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock.h vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock.h --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock.h 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,95 @@ +// Copyright 2007, Google Inc. +// 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 Google Inc. 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 +// OWNER 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. +// +// Author: wan@google.com (Zhanyong Wan) + +// Google Mock - a framework for writing C++ mock classes. +// +// This is the main header file a user should include. + +#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_H_ +#define GMOCK_INCLUDE_GMOCK_GMOCK_H_ + +// This file implements the following syntax: +// +// ON_CALL(mock_object.Method(...)) +// .With(...) ? +// .WillByDefault(...); +// +// where With() is optional and WillByDefault() must appear exactly +// once. +// +// EXPECT_CALL(mock_object.Method(...)) +// .With(...) ? +// .Times(...) ? +// .InSequence(...) * +// .WillOnce(...) * +// .WillRepeatedly(...) ? +// .RetiresOnSaturation() ? ; +// +// where all clauses are optional and WillOnce() can be repeated. + +#include "gmock/gmock-actions.h" +#include "gmock/gmock-cardinalities.h" +#include "gmock/gmock-generated-actions.h" +#include "gmock/gmock-generated-function-mockers.h" +#include "gmock/gmock-generated-matchers.h" +#include "gmock/gmock-generated-nice-strict.h" +#include "gmock/gmock-matchers.h" +#include "gmock/gmock-more-actions.h" +#include "gmock/gmock-more-matchers.h" +#include "gmock/internal/gmock-internal-utils.h" + +namespace testing { + +// Declares Google Mock flags that we want a user to use programmatically. +GMOCK_DECLARE_bool_(catch_leaked_mocks); +GMOCK_DECLARE_string_(verbose); +GMOCK_DECLARE_int32_(default_mock_behavior); + +// Initializes Google Mock. This must be called before running the +// tests. In particular, it parses the command line for the flags +// that Google Mock recognizes. Whenever a Google Mock flag is seen, +// it is removed from argv, and *argc is decremented. +// +// No value is returned. Instead, the Google Mock flag variables are +// updated. +// +// Since Google Test is needed for Google Mock to work, this function +// also initializes Google Test and parses its flags, if that hasn't +// been done. +GTEST_API_ void InitGoogleMock(int* argc, char** argv); + +// This overloaded version can be used in Windows programs compiled in +// UNICODE mode. +GTEST_API_ void InitGoogleMock(int* argc, wchar_t** argv); + +} // namespace testing + +#endif // GMOCK_INCLUDE_GMOCK_GMOCK_H_ diff -Nru vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-matchers.h vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-matchers.h --- vulkan-1.0.65.2+dfsg1/submodules/googletest/googlemock/include/gmock/gmock-matchers.h 1970-01-01 00:00:00.000000000 +0000 +++ vulkan-1.1.73+dfsg/submodules/googletest/googlemock/include/gmock/gmock-matchers.h 2018-04-27 11:46:12.000000000 +0000 @@ -0,0 +1,5133 @@ +// Copyright 2007, Google Inc. +// 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 Google Inc. 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 +// OWNER 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. +// +// Author: wan@google.com (Zhanyong Wan) + +// Google Mock - a framework for writing C++ mock classes. +// +// This file implements some commonly used argument matchers. More +// matchers can be defined by the user implementing the +// MatcherInterface interface if necessary. + +#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ +#define GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ + +#include +#include +#include +#include +#include // NOLINT +#include +#include +#include +#include +#include "gtest/gtest.h" +#include "gmock/internal/gmock-internal-utils.h" +#include "gmock/internal/gmock-port.h" + +#if GTEST_HAS_STD_INITIALIZER_LIST_ +# include // NOLINT -- must be after gtest.h +#endif + +namespace testing { + +// To implement a matcher Foo for type T, define: +// 1. a class FooMatcherImpl that implements the +// MatcherInterface interface, and +// 2. a factory function that creates a Matcher object from a +// FooMatcherImpl*. +// +// The two-level delegation design makes it possible to allow a user +// to write "v" instead of "Eq(v)" where a Matcher is expected, which +// is impossible if we pass matchers by pointers. It also eases +// ownership management as Matcher objects can now be copied like +// plain values. + +// MatchResultListener is an abstract class. Its << operator can be +// used by a matcher to explain why a value matches or doesn't match. +// +// TODO(wan@google.com): add method +// bool InterestedInWhy(bool result) const; +// to indicate whether the listener is interested in why the match +// result is 'result'. +class MatchResultListener { + public: + // Creates a listener object with the given underlying ostream. The + // listener does not own the ostream, and does not dereference it + // in the constructor or destructor. + explicit MatchResultListener(::std::ostream* os) : stream_(os) {} + virtual ~MatchResultListener() = 0; // Makes this class abstract. + + // Streams x to the underlying ostream; does nothing if the ostream + // is NULL. + template + MatchResultListener& operator<<(const T& x) { + if (stream_ != NULL) + *stream_ << x; + return *this; + } + + // Returns the underlying ostream. + ::std::ostream* stream() { return stream_; } + + // Returns true iff the listener is interested in an explanation of + // the match result. A matcher's MatchAndExplain() method can use + // this information to avoid generating the explanation when no one + // intends to hear it. + bool IsInterested() const { return stream_ != NULL; } + + private: + ::std::ostream* const stream_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(MatchResultListener); +}; + +inline MatchResultListener::~MatchResultListener() { +} + +// An instance of a subclass of this knows how to describe itself as a +// matcher. +class MatcherDescriberInterface { + public: + virtual ~MatcherDescriberInterface() {} + + // Describes this matcher to an ostream. The function should print + // a verb phrase that describes the property a value matching this + // matcher should have. The subject of the verb phrase is the value + // being matched. For example, the DescribeTo() method of the Gt(7) + // matcher prints "is greater than 7". + virtual void DescribeTo(::std::ostream* os) const = 0; + + // Describes the negation of this matcher to an ostream. For + // example, if the description of this matcher is "is greater than + // 7", the negated description could be "is not greater than 7". + // You are not required to override this when implementing + // MatcherInterface, but it is highly advised so that your matcher + // can produce good error messages. + virtual void DescribeNegationTo(::std::ostream* os) const { + *os << "not ("; + DescribeTo(os); + *os << ")"; + } +}; + +// The implementation of a matcher. +template +class MatcherInterface : public MatcherDescriberInterface { + public: + // Returns true iff the matcher matches x; also explains the match + // result to 'listener' if necessary (see the next paragraph), in + // the form of a non-restrictive relative clause ("which ...", + // "whose ...", etc) that describes x. For example, the + // MatchAndExplain() method of the Pointee(...) matcher should + // generate an explanation like "which points to ...". + // + // Implementations of MatchAndExplain() should add an explanation of + // the match result *if and only if* they can provide additional + // information that's not already present (or not obvious) in the + // print-out of x and the matcher's description. Whether the match + // succeeds is not a factor in deciding whether an explanation is + // needed, as sometimes the caller needs to print a failure message + // when the match succeeds (e.g. when the matcher is used inside + // Not()). + // + // For example, a "has at least 10 elements" matcher should explain + // what the actual element count is, regardless of the match result, + // as it is useful information to the reader; on the other hand, an + // "is empty" matcher probably only needs to explain what the actual + // size is when the match fails, as it's redundant to say that the + // size is 0 when the value is already known to be empty. + // + // You should override this method when defining a new matcher. + // + // It's the responsibility of the caller (Google Mock) to guarantee + // that 'listener' is not NULL. This helps to simplify a matcher's + // implementation when it doesn't care about the performance, as it + // can talk to 'listener' without checking its validity first. + // However, in order to implement dummy listeners efficiently, + // listener->stream() may be NULL. + virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = 0; + + // Inherits these methods from MatcherDescriberInterface: + // virtual void DescribeTo(::std::ostream* os) const = 0; + // virtual void DescribeNegationTo(::std::ostream* os) const; +}; + +namespace internal { + +// Converts a MatcherInterface to a MatcherInterface. +template +class MatcherInterfaceAdapter : public MatcherInterface { + public: + explicit MatcherInterfaceAdapter(const MatcherInterface* impl) + : impl_(impl) {} + virtual ~MatcherInterfaceAdapter() { delete impl_; } + + virtual void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); } + + virtual void DescribeNegationTo(::std::ostream* os) const { + impl_->DescribeNegationTo(os); + } + + virtual bool MatchAndExplain(const T& x, + MatchResultListener* listener) const { + return impl_->MatchAndExplain(x, listener); + } + + private: + const MatcherInterface* const impl_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(MatcherInterfaceAdapter); +}; + +} // namespace internal + +// A match result listener that stores the explanation in a string. +class StringMatchResultListener : public MatchResultListener { + public: + StringMatchResultListener() : MatchResultListener(&ss_) {} + + // Returns the explanation accumulated so far. + std::string str() const { return ss_.str(); } + + // Clears the explanation accumulated so far. + void Clear() { ss_.str(""); } + + private: + ::std::stringstream ss_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(StringMatchResultListener); +}; + +namespace internal { + +struct AnyEq { + template + bool operator()(const A& a, const B& b) const { return a == b; } +}; +struct AnyNe { + template + bool operator()(const A& a, const B& b) const { return a != b; } +}; +struct AnyLt { + template + bool operator()(const A& a, const B& b) const { return a < b; } +}; +struct AnyGt { + template + bool operator()(const A& a, const B& b) const { return a > b; } +}; +struct AnyLe { + template + bool operator()(const A& a, const B& b) const { return a <= b; } +}; +struct AnyGe { + template + bool operator()(const A& a, const B& b) const { return a >= b; } +}; + +// A match result listener that ignores the explanation. +class DummyMatchResultListener : public MatchResultListener { + public: + DummyMatchResultListener() : MatchResultListener(NULL) {} + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(DummyMatchResultListener); +}; + +// A match result listener that forwards the explanation to a given +// ostream. The difference between this and MatchResultListener is +// that the former is concrete. +class StreamMatchResultListener : public MatchResultListener { + public: + explicit StreamMatchResultListener(::std::ostream* os) + : MatchResultListener(os) {} + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamMatchResultListener); +}; + +// An internal class for implementing Matcher, which will derive +// from it. We put functionalities common to all Matcher +// specializations here to avoid code duplication. +template +class MatcherBase { + public: + // Returns true iff the matcher matches x; also explains the match + // result to 'listener'. + bool MatchAndExplain(GTEST_REFERENCE_TO_CONST_(T) x, + MatchResultListener* listener) const { + return impl_->MatchAndExplain(x, listener); + } + + // Returns true iff this matcher matches x. + bool Matches(T x) const { + DummyMatchResultListener dummy; + return MatchAndExplain(x, &dummy); + } + + // Describes this matcher to an ostream. + void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); } + + // Describes the negation of this matcher to an ostream. + void DescribeNegationTo(::std::ostream* os) const { + impl_->DescribeNegationTo(os); + } + + // Explains why x matches, or doesn't match, the matcher. + void ExplainMatchResultTo(T x, ::std::ostream* os) const { + StreamMatchResultListener listener(os); + MatchAndExplain(x, &listener); + } + + // Returns the describer for this matcher object; retains ownership + // of the describer, which is only guaranteed to be alive when + // this matcher object is alive. + const MatcherDescriberInterface* GetDescriber() const { + return impl_.get(); + } + + protected: + MatcherBase() {} + + // Constructs a matcher from its implementation. + explicit MatcherBase(const MatcherInterface* impl) + : impl_(impl) {} + + template + explicit MatcherBase( + const MatcherInterface* impl, + typename internal::EnableIf< + !internal::IsSame::value>::type* = + NULL) + : impl_(new internal::MatcherInterfaceAdapter(impl)) {} + + virtual ~MatcherBase() {} + + private: + // shared_ptr (util/gtl/shared_ptr.h) and linked_ptr have similar + // interfaces. The former dynamically allocates a chunk of memory + // to hold the reference count, while the latter tracks all + // references using a circular linked list without allocating + // memory. It has been observed that linked_ptr performs better in + // typical scenarios. However, shared_ptr can out-perform + // linked_ptr when there are many more uses of the copy constructor + // than the default constructor. + // + // If performance becomes a problem, we should see if using + // shared_ptr helps. + ::testing::internal::linked_ptr > impl_; +}; + +} // namespace internal + +// A Matcher is a copyable and IMMUTABLE (except by assignment) +// object that can check whether a value of type T matches. The +// implementation of Matcher is just a linked_ptr to const +// MatcherInterface, so copying is fairly cheap. Don't inherit +// from Matcher! +template +class Matcher : public internal::MatcherBase { + public: + // Constructs a null matcher. Needed for storing Matcher objects in STL + // containers. A default-constructed matcher is not yet initialized. You + // cannot use it until a valid value has been assigned to it. + explicit Matcher() {} // NOLINT + + // Constructs a matcher from its implementation. + explicit Matcher(const MatcherInterface* impl) + : internal::MatcherBase(impl) {} + + template + explicit Matcher(const MatcherInterface* impl, + typename internal::EnableIf::value>::type* = NULL) + : internal::MatcherBase(impl) {} + + // Implicit constructor here allows people to write + // EXPECT_CALL(foo, Bar(5)) instead of EXPECT_CALL(foo, Bar(Eq(5))) sometimes + Matcher(T value); // NOLINT +}; + +// The following two specializations allow the user to write str +// instead of Eq(str) and "foo" instead of Eq("foo") when a std::string +// matcher is expected. +template <> +class GTEST_API_ Matcher + : public internal::MatcherBase { + public: + Matcher() {} + + explicit Matcher(const MatcherInterface* impl) + : internal::MatcherBase(impl) {} + + // Allows the user to write str instead of Eq(str) sometimes, where + // str is a std::string object. + Matcher(const std::string& s); // NOLINT + +#if GTEST_HAS_GLOBAL_STRING + // Allows the user to write str instead of Eq(str) sometimes, where + // str is a ::string object. + Matcher(const ::string& s); // NOLINT +#endif // GTEST_HAS_GLOBAL_STRING + + // Allows the user to write "foo" instead of Eq("foo") sometimes. + Matcher(const char* s); // NOLINT +}; + +template <> +class GTEST_API_ Matcher + : public internal::MatcherBase { + public: + Matcher() {} + + explicit Matcher(const MatcherInterface* impl) + : internal::MatcherBase(impl) {} + + // Allows the user to write str instead of Eq(str) sometimes, where + // str is a string object. + Matcher(const std::string& s); // NOLINT + +#if GTEST_HAS_GLOBAL_STRING + // Allows the user to write str instead of Eq(str) sometimes, where + // str is a ::string object. + Matcher(const ::string& s); // NOLINT +#endif // GTEST_HAS_GLOBAL_STRING + + // Allows the user to write "foo" instead of Eq("foo") sometimes. + Matcher(const char* s); // NOLINT +}; + +#if GTEST_HAS_GLOBAL_STRING +// The following two specializations allow the user to write str +// instead of Eq(str) and "foo" instead of Eq("foo") when a ::string +// matcher is expected. +template <> +class GTEST_API_ Matcher + : public internal::MatcherBase { + public: + Matcher() {} + + explicit Matcher(const MatcherInterface* impl) + : internal::MatcherBase(impl) {} + + // Allows the user to write str instead of Eq(str) sometimes, where + // str is a std::string object. + Matcher(const std::string& s); // NOLINT + + // Allows the user to write str instead of Eq(str) sometimes, where + // str is a ::string object. + Matcher(const ::string& s); // NOLINT + + // Allows the user to write "foo" instead of Eq("foo") sometimes. + Matcher(const char* s); // NOLINT +}; + +}; + +template <> +class GTEST_API_ Matcher + : public internal::MatcherBase { + public: + Matcher() {} + + explicit Matcher(const MatcherInterface* impl) + : internal::MatcherBase(impl) {} + + // Allows the user to write str instead of Eq(str) sometimes, where + // str is a string object. + Matcher(const internal::string& s); // NOLINT + + // Allows the user to write "foo" instead of Eq("foo") sometimes. + Matcher(const char* s); // NOLINT + + // Allows the user to pass StringPieces directly. + Matcher(StringPiece s); // NOLINT +}; +#endif // GTEST_HAS_STRING_PIECE_ + +// The PolymorphicMatcher class template makes it easy to implement a +// polymorphic matcher (i.e. a matcher that can match values of more +// than one type, e.g. Eq(n) and NotNull()). +// +// To define a polymorphic matcher, a user should provide an Impl +// class that has a DescribeTo() method and a DescribeNegationTo() +// method, and define a member function (or member function template) +// +// bool MatchAndExplain(const Value& value, +// MatchResultListener* listener) const; +// +// See the definition of NotNull() for a complete example. +template +class PolymorphicMatcher { + public: + explicit PolymorphicMatcher(const Impl& an_impl) : impl_(an_impl) {} + + // Returns a mutable reference to the underlying matcher + // implementation object. + Impl& mutable_impl() { return impl_; } + + // Returns an immutable reference to the underlying matcher + // implementation object. + const Impl& impl() const { return impl_; } + + template + operator Matcher() const { + return Matcher(new MonomorphicImpl(impl_)); + } + + private: + template + class MonomorphicImpl : public MatcherInterface { + public: + explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {} + + virtual void DescribeTo(::std::ostream* os) const { + impl_.DescribeTo(os); + } + + virtual void DescribeNegationTo(::std::ostream* os) const { + impl_.DescribeNegationTo(os); + } + + virtual bool MatchAndExplain(T x, MatchResultListener* listener) const { + return impl_.MatchAndExplain(x, listener); + } + + private: + const Impl impl_; + + GTEST_DISALLOW_ASSIGN_(MonomorphicImpl); + }; + + Impl impl_; + + GTEST_DISALLOW_ASSIGN_(PolymorphicMatcher); +}; + +// Creates a matcher from its implementation. This is easier to use +// than the Matcher constructor as it doesn't require you to +// explicitly write the template argument, e.g. +// +// MakeMatcher(foo); +// vs +// Matcher(foo); +template +inline Matcher MakeMatcher(const MatcherInterface* impl) { + return Matcher(impl); +} + +// Creates a polymorphic matcher from its implementation. This is +// easier to use than the PolymorphicMatcher constructor as it +// doesn't require you to explicitly write the template argument, e.g. +// +// MakePolymorphicMatcher(foo); +// vs +// PolymorphicMatcher(foo); +template +inline PolymorphicMatcher MakePolymorphicMatcher(const Impl& impl) { + return PolymorphicMatcher(impl); +} + +// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION +// and MUST NOT BE USED IN USER CODE!!! +namespace internal { + +// The MatcherCastImpl class template is a helper for implementing +// MatcherCast(). We need this helper in order to partially +// specialize the implementation of MatcherCast() (C++ allows +// class/struct templates to be partially specialized, but not +// function templates.). + +// This general version is used when MatcherCast()'s argument is a +// polymorphic matcher (i.e. something that can be converted to a +// Matcher but is not one yet; for example, Eq(value)) or a value (for +// example, "hello"). +template +class MatcherCastImpl { + public: + static Matcher Cast(const M& polymorphic_matcher_or_value) { + // M can be a polymorphic matcher, in which case we want to use + // its conversion operator to create Matcher. Or it can be a value + // that should be passed to the Matcher's constructor. + // + // We can't call Matcher(polymorphic_matcher_or_value) when M is a + // polymorphic matcher because it'll be ambiguous if T has an implicit + // constructor from M (this usually happens when T has an implicit + // constructor from any type). + // + // It won't work to unconditionally implict_cast + // polymorphic_matcher_or_value to Matcher because it won't trigger + // a user-defined conversion from M to T if one exists (assuming M is + // a value). + return CastImpl( + polymorphic_matcher_or_value, + BooleanConstant< + internal::ImplicitlyConvertible >::value>(), + BooleanConstant< + internal::ImplicitlyConvertible::value>()); + } + + private: + template + static Matcher CastImpl(const M& polymorphic_matcher_or_value, + BooleanConstant /* convertible_to_matcher */, + BooleanConstant) { + // M is implicitly convertible to Matcher, which means that either + // M is a polymorphic matcher or Matcher has an implicit constructor + // from M. In both cases using the implicit conversion will produce a + // matcher. + // + // Even if T has an implicit constructor from M, it won't be called because + // creating Matcher would require a chain of two user-defined conversions + // (first to create T from M and then to create Matcher from T). + return polymorphic_matcher_or_value; + } + + // M can't be implicitly converted to Matcher, so M isn't a polymorphic + // matcher. It's a value of a type implicitly convertible to T. Use direct + // initialization to create a matcher. + static Matcher CastImpl( + const M& value, BooleanConstant /* convertible_to_matcher */, + BooleanConstant /* convertible_to_T */) { + return Matcher(ImplicitCast_(value)); + } + + // M can't be implicitly converted to either Matcher or T. Attempt to use + // polymorphic matcher Eq(value) in this case. + // + // Note that we first attempt to perform an implicit cast on the value and + // only fall back to the polymorphic Eq() matcher afterwards because the + // latter calls bool operator==(const Lhs& lhs, const Rhs& rhs) in the end + // which might be undefined even when Rhs is implicitly convertible to Lhs + // (e.g. std::pair vs. std::pair). + // + // We don't define this method inline as we need the declaration of Eq(). + static Matcher CastImpl( + const M& value, BooleanConstant /* convertible_to_matcher */, + BooleanConstant /* convertible_to_T */); +}; + +// This more specialized version is used when MatcherCast()'s argument +// is already a Matcher. This only compiles when type T can be +// statically converted to type U. +template +class MatcherCastImpl > { + public: + static Matcher Cast(const Matcher& source_matcher) { + return Matcher(new Impl(source_matcher)); + } + + private: + class Impl : public MatcherInterface { + public: + explicit Impl(const Matcher& source_matcher) + : source_matcher_(source_matcher) {} + + // We delegate the matching logic to the source matcher. + virtual bool MatchAndExplain(T x, MatchResultListener* listener) const { +#if GTEST_LANG_CXX11 + using FromType = typename std::remove_cv::type>::type>::type; + using ToType = typename std::remove_cv::type>::type>::type; + // Do not allow implicitly converting base*/& to derived*/&. + static_assert( + // Do not trigger if only one of them is a pointer. That implies a + // regular conversion and not a down_cast. + (std::is_pointer::type>::value != + std::is_pointer::type>::value) || + std::is_same::value || + !std::is_base_of::value, + "Can't implicitly convert from to "); +#endif // GTEST_LANG_CXX11 + + return source_matcher_.MatchAndExplain(static_cast(x), listener); + } + + virtual void DescribeTo(::std::ostream* os) const { + source_matcher_.DescribeTo(os); + } + + virtual void DescribeNegationTo(::std::ostream* os) const { + source_matcher_.DescribeNegationTo(os); + } + + private: + const Matcher source_matcher_; + + GTEST_DISALLOW_ASSIGN_(Impl); + }; +}; + +// This even more specialized version is used for efficiently casting +// a matcher to its own type. +template +class MatcherCastImpl > { + public: + static Matcher Cast(const Matcher& matcher) { return matcher; } +}; + +} // namespace internal + +// In order to be safe and clear, casting between different matcher +// types is done explicitly via MatcherCast(m), which takes a +// matcher m and returns a Matcher. It compiles only when T can be +// statically converted to the argument type of m. +template +inline Matcher MatcherCast(const M& matcher) { + return internal::MatcherCastImpl::Cast(matcher); +} + +// Implements SafeMatcherCast(). +// +// We use an intermediate class to do the actual safe casting as Nokia's +// Symbian compiler cannot decide between +// template ... (M) and +// template ... (const Matcher&) +// for function templates but can for member function templates. +template +class SafeMatcherCastImpl { + public: + // This overload handles polymorphic matchers and values only since + // monomorphic matchers are handled by the next one. + template + static inline Matcher Cast(const M& polymorphic_matcher_or_value) { + return internal::MatcherCastImpl::Cast(polymorphic_matcher_or_value); + } + + // This overload handles monomorphic matchers. + // + // In general, if type T can be implicitly converted to type U, we can + // safely convert a Matcher to a Matcher (i.e. Matcher is + // contravariant): just keep a copy of the original Matcher, convert the + // argument from type T to U, and then pass it to the underlying Matcher. + // The only exception is when U is a reference and T is not, as the + // underlying Matcher may be interested in the argument's address, which + // is not preserved in the conversion from T to U. + template + static inline Matcher Cast(const Matcher& matcher) { + // Enforce that T can be implicitly converted to U. + GTEST_COMPILE_ASSERT_((internal::ImplicitlyConvertible::value), + T_must_be_implicitly_convertible_to_U); + // Enforce that we are not converting a non-reference type T to a reference + // type U. + GTEST_COMPILE_ASSERT_( + internal::is_reference::value || !internal::is_reference::value, + cannot_convert_non_reference_arg_to_reference); + // In case both T and U are arithmetic types, enforce that the + // conversion is not lossy. + typedef GTEST_REMOVE_REFERENCE_AND_CONST_(T) RawT; + typedef GTEST_REMOVE_REFERENCE_AND_CONST_(U) RawU; + const bool kTIsOther = GMOCK_KIND_OF_(RawT) == internal::kOther; + const bool kUIsOther = GMOCK_KIND_OF_(RawU) == internal::kOther; + GTEST_COMPILE_ASSERT_( + kTIsOther || kUIsOther || + (internal::LosslessArithmeticConvertible::value), + conversion_of_arithmetic_types_must_be_lossless); + return MatcherCast(matcher); + } +}; + +template +inline Matcher SafeMatcherCast(const M& polymorphic_matcher) { + return SafeMatcherCastImpl::Cast(polymorphic_matcher); +} + +// A() returns a matcher that matches any value of type T. +template +Matcher A(); + +// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION +// and MUST NOT BE USED IN USER CODE!!! +namespace internal { + +// If the explanation is not empty, prints it to the ostream. +inline void PrintIfNotEmpty(const std::string& explanation, + ::std::ostream* os) { + if (explanation != "" && os != NULL) { + *os << ", " << explanation; + } +} + +// Returns true if the given type name is easy to read by a human. +// This is used to decide whether printing the type of a value might +// be helpful. +inline bool IsReadableTypeName(const std::string& type_name) { + // We consider a type name readable if it's short or doesn't contain + // a template or function type. + return (type_name.length() <= 20 || + type_name.find_first_of("<(") == std::string::npos); +} + +// Matches the value against the given matcher, prints the value and explains +// the match result to the listener. Returns the match result. +// 'listener' must not be NULL. +// Value cannot be passed by const reference, because some matchers take a +// non-const argument. +template +bool MatchPrintAndExplain(Value& value, const Matcher& matcher, + MatchResultListener* listener) { + if (!listener->IsInterested()) { + // If the listener is not interested, we do not need to construct the + // inner explanation. + return matcher.Matches(value); + } + + StringMatchResultListener inner_listener; + const bool match = matcher.MatchAndExplain(value, &inner_listener); + + UniversalPrint(value, listener->stream()); +#if GTEST_HAS_RTTI + const std::string& type_name = GetTypeName(); + if (IsReadableTypeName(type_name)) + *listener->stream() << " (of type " << type_name << ")"; +#endif + PrintIfNotEmpty(inner_listener.str(), listener->stream()); + + return match; +} + +// An internal helper class for doing compile-time loop on a tuple's +// fields. +template +class TuplePrefix { + public: + // TuplePrefix::Matches(matcher_tuple, value_tuple) returns true + // iff the first N fields of matcher_tuple matches the first N + // fields of value_tuple, respectively. + template + static bool Matches(const MatcherTuple& matcher_tuple, + const ValueTuple& value_tuple) { + return TuplePrefix::Matches(matcher_tuple, value_tuple) + && get(matcher_tuple).Matches(get(value_tuple)); + } + + // TuplePrefix::ExplainMatchFailuresTo(matchers, values, os) + // describes failures in matching the first N fields of matchers + // against the first N fields of values. If there is no failure, + // nothing will be streamed to os. + template + static void ExplainMatchFailuresTo(const MatcherTuple& matchers, + const ValueTuple& values, + ::std::ostream* os) { + // First, describes failures in the first N - 1 fields. + TuplePrefix::ExplainMatchFailuresTo(matchers, values, os); + + // Then describes the failure (if any) in the (N - 1)-th (0-based) + // field. + typename tuple_element::type matcher = + get(matchers); + typedef typename tuple_element::type Value; + Value value = get(values); + StringMatchResultListener listener; + if (!matcher.MatchAndExplain(value, &listener)) { + // TODO(wan): include in the message the name of the parameter + // as used in MOCK_METHOD*() when possible. + *os << " Expected arg #" << N - 1 << ": "; + get(matchers).DescribeTo(os); + *os << "\n Actual: "; + // We remove the reference in type Value to prevent the + // universal printer from printing the address of value, which + // isn't interesting to the user most of the time. The + // matcher's MatchAndExplain() method handles the case when + // the address is interesting. + internal::UniversalPrint(value, os); + PrintIfNotEmpty(listener.str(), os); + *os << "\n"; + } + } +}; + +// The base case. +template <> +class TuplePrefix<0> { + public: + template + static bool Matches(const MatcherTuple& /* matcher_tuple */, + const ValueTuple& /* value_tuple */) { + return true; + } + + template + static void ExplainMatchFailuresTo(const MatcherTuple& /* matchers */, + const ValueTuple& /* values */, + ::std::ostream* /* os */) {} +}; + +// TupleMatches(matcher_tuple, value_tuple) returns true iff all +// matchers in matcher_tuple match the corresponding fields in +// value_tuple. It is a compiler error if matcher_tuple and +// value_tuple have different number of fields or incompatible field +// types. +template +bool TupleMatches(const MatcherTuple& matcher_tuple, + const ValueTuple& value_tuple) { + // Makes sure that matcher_tuple and value_tuple have the same + // number of fields. + GTEST_COMPILE_ASSERT_(tuple_size::value == + tuple_size::value, + matcher_and_value_have_different_numbers_of_fields); + return TuplePrefix::value>:: + Matches(matcher_tuple, value_tuple); +} + +// Describes failures in matching matchers against values. If there +// is no failure, nothing will be streamed to os. +template +void ExplainMatchFailureTupleTo(const MatcherTuple& matchers, + const ValueTuple& values, + ::std::ostream* os) { + TuplePrefix::value>::ExplainMatchFailuresTo( + matchers, values, os); +} + +// TransformTupleValues and its helper. +// +// TransformTupleValuesHelper hides the internal machinery that +// TransformTupleValues uses to implement a tuple traversal. +template +class TransformTupleValuesHelper { + private: + typedef ::testing::tuple_size TupleSize; + + public: + // For each member of tuple 't', taken in order, evaluates '*out++ = f(t)'. + // Returns the final value of 'out' in case the caller needs it. + static OutIter Run(Func f, const Tuple& t, OutIter out) { + return IterateOverTuple()(f, t, out); + } + + private: + template + struct IterateOverTuple { + OutIter operator() (Func f, const Tup& t, OutIter out) const { + *out++ = f(::testing::get(t)); + return IterateOverTuple()(f, t, out); + } + }; + template + struct IterateOverTuple { + OutIter operator() (Func /* f */, const Tup& /* t */, OutIter out) const { + return out; + } + }; +}; + +// Successively invokes 'f(element)' on each element of the tuple 't', +// appending each result to the 'out' iterator. Returns the final value +// of 'out'. +template +OutIter TransformTupleValues(Func f, const Tuple& t, OutIter out) { + return TransformTupleValuesHelper::Run(f, t, out); +} + +// Implements A(). +template +class AnyMatcherImpl : public MatcherInterface { + public: + virtual bool MatchAndExplain( + T /* x */, MatchResultListener* /* listener */) const { return true; } + virtual void DescribeTo(::std::ostream* os) const { *os << "is anything"; } + virtual void DescribeNegationTo(::std::ostream* os) const { + // This is mostly for completeness' safe, as it's not very useful + // to write Not(A()). However we cannot completely rule out + // such a possibility, and it doesn't hurt to be prepared. + *os << "never matches"; + } +}; + +// Implements _, a matcher that matches any value of any +// type. This is a polymorphic matcher, so we need a template type +// conversion operator to make it appearing as a Matcher for any +// type T. +class AnythingMatcher { + public: + template + operator Matcher() const { return A(); } +}; + +// Implements a matcher that compares a given value with a +// pre-supplied value using one of the ==, <=, <, etc, operators. The +// two values being compared don't have to have the same type. +// +// The matcher defined here is polymorphic (for example, Eq(5) can be +// used to match an int, a short, a double, etc). Therefore we use +// a template type conversion operator in the implementation. +// +// The following template definition assumes that the Rhs parameter is +// a "bare" type (i.e. neither 'const T' nor 'T&'). +template +class ComparisonBase { + public: + explicit ComparisonBase(const Rhs& rhs) : rhs_(rhs) {} + template + operator Matcher() const { + return MakeMatcher(new Impl(rhs_)); + } + + private: + template + class Impl : public MatcherInterface { + public: + explicit Impl(const Rhs& rhs) : rhs_(rhs) {} + virtual bool MatchAndExplain( + Lhs lhs, MatchResultListener* /* listener */) const { + return Op()(lhs, rhs_); + } + virtual void DescribeTo(::std::ostream* os) const { + *os << D::Desc() << " "; + UniversalPrint(rhs_, os); + } + virtual void DescribeNegationTo(::std::ostream* os) const { + *os << D::NegatedDesc() << " "; + UniversalPrint(rhs_, os); + } + private: + Rhs rhs_; + GTEST_DISALLOW_ASSIGN_(Impl); + }; + Rhs rhs_; + GTEST_DISALLOW_ASSIGN_(ComparisonBase); +}; + +template +class EqMatcher : public ComparisonBase, Rhs, AnyEq> { + public: + explicit EqMatcher(const Rhs& rhs) + : ComparisonBase, Rhs, AnyEq>(rhs) { } + static const char* Desc() { return "is equal to"; } + static const char* NegatedDesc() { return "isn't equal to"; } +}; +template +class NeMatcher : public ComparisonBase, Rhs, AnyNe> { + public: + explicit NeMatcher(const Rhs& rhs) + : ComparisonBase, Rhs, AnyNe>(rhs) { } + static const char* Desc() { return "isn't equal to"; } + static const char* NegatedDesc() { return "is equal to"; } +}; +template +class LtMatcher : public ComparisonBase, Rhs, AnyLt> { + public: + explicit LtMatcher(const Rhs& rhs) + : ComparisonBase, Rhs, AnyLt>(rhs) { } + static const char* Desc() { return "is <"; } + static const char* NegatedDesc() { return "isn't <"; } +}; +template +class GtMatcher : public ComparisonBase, Rhs, AnyGt> { + public: + explicit GtMatcher(const Rhs& rhs) + : ComparisonBase, Rhs, AnyGt>(rhs) { } + static const char* Desc() { return "is >"; } + static const char* NegatedDesc() { return "isn't >"; } +}; +template +class LeMatcher : public ComparisonBase, Rhs, AnyLe> { + public: + explicit LeMatcher(const Rhs& rhs) + : ComparisonBase, Rhs, AnyLe>(rhs) { } + static const char* Desc() { return "is <="; } + static const char* NegatedDesc() { return "isn't <="; } +}; +template +class GeMatcher : public ComparisonBase, Rhs, AnyGe> { + public: + explicit GeMatcher(const Rhs& rhs) + : ComparisonBase, Rhs, AnyGe>(rhs) { } + static const char* Desc() { return "is >="; } + static const char* NegatedDesc() { return "isn't >="; } +}; + +// Implements the polymorphic IsNull() matcher, which matches any raw or smart +// pointer that is NULL. +class IsNullMatcher { + public: + template + bool MatchAndExplain(const Pointer& p, + MatchResultListener* /* listener */) const { +#if GTEST_LANG_CXX11 + return p == nullptr; +#else // GTEST_LANG_CXX11 + return GetRawPointer(p) == NULL; +#endif // GTEST_LANG_CXX11 + } + + void DescribeTo(::std::ostream* os) const { *os << "is NULL"; } + void DescribeNegationTo(::std::ostream* os) const { + *os << "isn't NULL"; + } +}; + +// Implements the polymorphic NotNull() matcher, which matches any raw or smart +// pointer that is not NULL. +class NotNullMatcher { + public: + template + bool MatchAndExplain(const Pointer& p, + MatchResultListener* /* listener */) const { +#if GTEST_LANG_CXX11 + return p != nullptr; +#else // GTEST_LANG_CXX11 + return GetRawPointer(p) != NULL; +#endif // GTEST_LANG_CXX11 + } + + void DescribeTo(::std::ostream* os) const { *os << "isn't NULL"; } + void DescribeNegationTo(::std::ostream* os) const { + *os << "is NULL"; + } +}; + +// Ref(variable) matches any argument that is a reference to +// 'variable'. This matcher is polymorphic as it can match any +// super type of the type of 'variable'. +// +// The RefMatcher template class implements Ref(variable). It can +// only be instantiated with a reference type. This prevents a user +// from mistakenly using Ref(x) to match a non-reference function +// argument. For example, the following will righteously cause a +// compiler error: +// +// int n; +// Matcher m1 = Ref(n); // This won't compile. +// Matcher m2 = Ref(n); // This will compile. +template +class RefMatcher; + +template +class RefMatcher { + // Google Mock is a generic framework and thus needs to support + // mocking any function types, including those that take non-const + // reference arguments. Therefore the template parameter T (and + // Super below) can be instantiated to either a const type or a + // non-const type. + public: + // RefMatcher() takes a T& instead of const T&, as we want the + // compiler to catch using Ref(const_value) as a matcher for a + // non-const reference. + explicit RefMatcher(T& x) : object_(x) {} // NOLINT + + template + operator Matcher() const { + // By passing object_ (type T&) to Impl(), which expects a Super&, + // we make sure that Super is a super type of T. In particular, + // this catches using Ref(const_value) as a matcher for a + // non-const reference, as you cannot implicitly convert a const + // reference to a non-const reference. + return MakeMatcher(new Impl(object_)); + } + + private: + template + class Impl : public MatcherInterface { + public: + explicit Impl(Super& x) : object_(x) {} // NOLINT + + // MatchAndExplain() takes a Super& (as opposed to const Super&) + // in order to match the interface MatcherInterface. + virtual bool MatchAndExplain( + Super& x, MatchResultListener* listener) const { + *listener << "which is located @" << static_cast(&x); + return &x == &object_; + } + + virtual void DescribeTo(::std::ostream* os) const { + *os << "references the variable "; + UniversalPrinter::Print(object_, os); + } + + virtual void DescribeNegationTo(::std::ostream* os) const { + *os << "does not reference the variable "; + UniversalPrinter::Print(object_, os); + } + + private: + const Super& object_; + + GTEST_DISALLOW_ASSIGN_(Impl); + }; + + T& object_; + + GTEST_DISALLOW_ASSIGN_(RefMatcher); +}; + +// Polymorphic helper functions for narrow and wide string matchers. +inline bool CaseInsensitiveCStringEquals(const char* lhs, const char* rhs) { + return String::CaseInsensitiveCStringEquals(lhs, rhs); +} + +inline bool CaseInsensitiveCStringEquals(const wchar_t* lhs, + const wchar_t* rhs) { + return String::CaseInsensitiveWideCStringEquals(lhs, rhs); +} + +// String comparison for narrow or wide strings that can have embedded NUL +// characters. +template +bool CaseInsensitiveStringEquals(const StringType& s1, + const StringType& s2) { + // Are the heads equal? + if (!CaseInsensitiveCStringEquals(s1.c_str(), s2.c_str())) { + return false; + } + + // Skip the equal heads. + const typename StringType::value_type nul = 0; + const size_t i1 = s1.find(nul), i2 = s2.find(nul); + + // Are we at the end of either s1 or s2? + if (i1 == StringType::npos || i2 == StringType::npos) { + return i1 == i2; + } + + // Are the tails equal? + return CaseInsensitiveStringEquals(s1.substr(i1 + 1), s2.substr(i2 + 1)); +} + +// String matchers. + +// Implements equality-based string matchers like StrEq, StrCaseNe, and etc. +template +class StrEqualityMatcher { + public: + StrEqualityMatcher(const StringType& str, bool expect_eq, + bool case_sensitive) + : string_(str), expect_eq_(expect_eq), case_sensitive_(case_sensitive) {} + + // Accepts pointer types, particularly: + // const char* + // char* + // const wchar_t* + // wchar_t* + template + bool MatchAndExplain(CharType* s, MatchResultListener* listener) const { + if (s == NULL) { + return !expect_eq_; + } + return MatchAndExplain(StringType(s), listener); + } + + // Matches anything that can convert to StringType. + // + // This is a template, not just a plain function with const StringType&, + // because StringPiece has some interfering non-explicit constructors. + template + bool MatchAndExplain(const MatcheeStringType& s, + MatchResultListener* /* listener */) const { + const StringType& s2(s); + const bool eq = case_sensitive_ ? s2 == string_ : + CaseInsensitiveStringEquals(s2, string_); + return expect_eq_ == eq; + } + + void DescribeTo(::std::ostream* os) const { + DescribeToHelper(expect_eq_, os); + } + + void DescribeNegationTo(::std::ostream* os) const { + DescribeToHelper(!expect_eq_, os); + } + + private: + void DescribeToHelper(bool expect_eq, ::std::ostream* os) const { + *os << (expect_eq ? "is " : "isn't "); + *os << "equal to "; + if (!case_sensitive_) { + *os << "(ignoring case) "; + } + UniversalPrint(string_, os); + } + + const StringType string_; + const bool expect_eq_; + const bool case_sensitive_; + + GTEST_DISALLOW_ASSIGN_(StrEqualityMatcher); +}; + +// Implements the polymorphic HasSubstr(substring) matcher, which +// can be used as a Matcher as long as T can be converted to a +// string. +template +class HasSubstrMatcher { + public: + explicit HasSubstrMatcher(const StringType& substring) + : substring_(substring) {} + + // Accepts pointer types, particularly: + // const char* + // char* + // const wchar_t* + // wchar_t* + template + bool MatchAndExplain(CharType* s, MatchResultListener* listener) const { + return s != NULL && MatchAndExplain(StringType(s), listener); + } + + // Matches anything that can convert to StringType. + // + // This is a template, not just a plain function with const StringType&, + // because StringPiece has some interfering non-explicit constructors. + template + bool MatchAndExplain(const MatcheeStringType& s, + MatchResultListener* /* listener */) const { + const StringType& s2(s); + return s2.find(substring_) != StringType::npos; + } + + // Describes what this matcher matches. + void DescribeTo(::std::ostream* os) const { + *os << "has substring "; + UniversalPrint(substring_, os); + } + + void DescribeNegationTo(::std::ostream* os) const { + *os << "has no substring "; + UniversalPrint(substring_, os); + } + + private: + const StringType substring_; + + GTEST_DISALLOW_ASSIGN_(HasSubstrMatcher); +}; + +// Implements the polymorphic StartsWith(substring) matcher, which +// can be used as a Matcher as long as T can be converted to a +// string. +template +class StartsWithMatcher { + public: + explicit StartsWithMatcher(const StringType& prefix) : prefix_(prefix) { + } + + // Accepts pointer types, particularly: + // const char* + // char* + // const wchar_t* + // wchar_t* + template + bool MatchAndExplain(CharType* s, MatchResultListener* listener) const { + return s != NULL && MatchAndExplain(StringType(s), listener); + } + + // Matches anything that can convert to StringType. + // + // This is a template, not just a plain function with const StringType&, + // because StringPiece has some interfering non-explicit constructors. + template + bool MatchAndExplain(const MatcheeStringType& s, + MatchResultListener* /* listener */) const { + const StringType& s2(s); + return s2.length() >= prefix_.length() && + s2.substr(0, prefix_.length()) == prefix_; + } + + void DescribeTo(::std::ostream* os) const { + *os << "starts with "; + UniversalPrint(prefix_, os); + } + + void DescribeNegationTo(::std::ostream* os) const { + *os << "doesn't start with "; + UniversalPrint(prefix_, os); + } + + private: + const StringType prefix_; + + GTEST_DISALLOW_ASSIGN_(StartsWithMatcher); +}; + +// Implements the polymorphic EndsWith(substring) matcher, which +// can be used as a Matcher as long as T can be converted to a +// string. +template +class EndsWithMatcher { + public: + explicit EndsWithMatcher(const StringType& suffix) : suffix_(suffix) {} + + // Accepts pointer types, particularly: + // const char* + // char* + // const wchar_t* + // wchar_t* + template + bool MatchAndExplain(CharType* s, MatchResultListener* listener) const { + return s != NULL && MatchAndExplain(StringType(s), listener); + } + + // Matches anything that can convert to StringType. + // + // This is a template, not just a plain function with const StringType&, + // because StringPiece has some interfering non-explicit constructors. + template + bool MatchAndExplain(const MatcheeStringType& s, + MatchResultListener* /* listener */) const { + const StringType& s2(s); + return s2.length() >= suffix_.length() && + s2.substr(s2.length() - suffix_.length()) == suffix_; + } + + void DescribeTo(::std::ostream* os) const { + *os << "ends with "; + UniversalPrint(suffix_, os); + } + + void DescribeNegationTo(::std::ostream* os) const { + *os << "doesn't end with "; + UniversalPrint(suffix_, os); + } + + private: + const StringType suffix_; + + GTEST_DISALLOW_ASSIGN_(EndsWithMatcher); +}; + +// Implements polymorphic matchers MatchesRegex(regex) and +// ContainsRegex(regex), which can be used as a Matcher as long as +// T can be converted to a string. +class MatchesRegexMatcher { + public: + MatchesRegexMatcher(const RE* regex, bool full_match) + : regex_(regex), full_match_(full_match) {} + + // Accepts pointer types, particularly: + // const char* + // char* + // const wchar_t* + // wchar_t* + template + bool MatchAndExplain(CharType* s, MatchResultListener* listener) const { + return s != NULL && MatchAndExplain(std::string(s), listener); + } + + // Matches anything that can convert to std::string. + // + // This is a template, not just a plain function with const std::string&, + // because absl::string_view has some interfering non-explicit constructors. + template + bool MatchAndExplain(const MatcheeStringType& s, + MatchResultListener* /* listener */) const { + const std::string& s2(s); + return full_match_ ? RE::FullMatch(s2, *regex_) : + RE::PartialMatch(s2, *regex_); + } + + void DescribeTo(::std::ostream* os) const { + *os << (full_match_ ? "matches" : "contains") + << " regular expression "; + UniversalPrinter::Print(regex_->pattern(), os); + } + + void DescribeNegationTo(::std::ostream* os) const { + *os << "doesn't " << (full_match_ ? "match" : "contain") + << " regular expression "; + UniversalPrinter::Print(regex_->pattern(), os); + } + + private: + const internal::linked_ptr regex_; + const bool full_match_; + + GTEST_DISALLOW_ASSIGN_(MatchesRegexMatcher); +}; + +// Implements a matcher that compares the two fields of a 2-tuple +// using one of the ==, <=, <, etc, operators. The two fields being +// compared don't have to have the same type. +// +// The matcher defined here is polymorphic (for example, Eq() can be +// used to match a tuple, a tuple, +// etc). Therefore we use a template type conversion operator in the +// implementation. +template +class PairMatchBase { + public: + template + operator Matcher< ::testing::tuple >() const { + return MakeMatcher(new Impl< ::testing::tuple >); + } + template + operator Matcher&>() const { + return MakeMatcher(new Impl&>); + } + + private: + static ::std::ostream& GetDesc(::std::ostream& os) { // NOLINT + return os << D::Desc(); + } + + template + class Impl : public MatcherInterface { + public: + virtual bool MatchAndExplain( + Tuple args, + MatchResultListener* /* listener */) const { + return Op()(::testing::get<0>(args), ::testing::get<1>(args)); + } + virtual void DescribeTo(::std::ostream* os) const { + *os << "are " << GetDesc; + } + virtual void DescribeNegationTo(::std::ostream* os) const { + *os << "aren't " << GetDesc; + } + }; +}; + +class Eq2Matcher : public PairMatchBase { + public: + static const char* Desc() { return "an equal pair"; } +}; +class Ne2Matcher : public PairMatchBase { + public: + static const char* Desc() { return "an unequal pair"; } +}; +class Lt2Matcher : public PairMatchBase { + public: + static const char* Desc() { return "a pair where the first < the second"; } +}; +class Gt2Matcher : public PairMatchBase { + public: + static const char* Desc() { return "a pair where the first > the second"; } +}; +class Le2Matcher : public PairMatchBase { + public: + static const char* Desc() { return "a pair where the first <= the second"; } +}; +class Ge2Matcher : public PairMatchBase { + public: + static const char* Desc() { return "a pair where the first >= the second"; } +}; + +// Implements the Not(...) matcher for a particular argument type T. +// We do not nest it inside the NotMatcher class template, as that +// will prevent different instantiations of NotMatcher from sharing +// the same NotMatcherImpl class. +template +class NotMatcherImpl : public MatcherInterface { + public: + explicit NotMatcherImpl(const Matcher& matcher) + : matcher_(matcher) {} + + virtual bool MatchAndExplain(T x, MatchResultListener* listener) const { + return !matcher_.MatchAndExplain(x, listener); + } + + virtual void DescribeTo(::std::ostream* os) const { + matcher_.DescribeNegationTo(os); + } + + virtual void DescribeNegationTo(::std::ostream* os) const { + matcher_.DescribeTo(os); + } + + private: + const Matcher matcher_; + + GTEST_DISALLOW_ASSIGN_(NotMatcherImpl); +}; + +// Implements the Not(m) matcher, which matches a value that doesn't +// match matcher m. +template +class NotMatcher { + public: + explicit NotMatcher(InnerMatcher matcher) : matcher_(matcher) {} + + // This template type conversion operator allows Not(m) to be used + // to match any type m can match. + template + operator Matcher() const { + return Matcher(new NotMatcherImpl(SafeMatcherCast(matcher_))); + } + + private: + InnerMatcher matcher_; + + GTEST_DISALLOW_ASSIGN_(NotMatcher); +}; + +// Implements the AllOf(m1, m2) matcher for a particular argument type +// T. We do not nest it inside the BothOfMatcher class template, as +// that will prevent different instantiations of BothOfMatcher from +// sharing the same BothOfMatcherImpl class. +template +class BothOfMatcherImpl : public MatcherInterface { + public: + BothOfMatcherImpl(const Matcher& matcher1, const Matcher& matcher2) + : matcher1_(matcher1), matcher2_(matcher2) {} + + virtual void DescribeTo(::std::ostream* os) const { + *os << "("; + matcher1_.DescribeTo(os); + *os << ") and ("; + matcher2_.DescribeTo(os); + *os << ")"; + } + + virtual void DescribeNegationTo(::std::ostream* os) const { + *os << "("; + matcher1_.DescribeNegationTo(os); + *os << ") or ("; + matcher2_.DescribeNegationTo(os); + *os << ")"; + } + + virtual bool MatchAndExplain(T x, MatchResultListener* listener) const { + // If either matcher1_ or matcher2_ doesn't match x, we only need + // to explain why one of them fails. + StringMatchResultListener listener1; + if (!matcher1_.MatchAndExplain(x, &listener1)) { + *listener << listener1.str(); + return false; + } + + StringMatchResultListener listener2; + if (!matcher2_.MatchAndExplain(x, &listener2)) { + *listener << listener2.str(); + return false; + } + + // Otherwise we need to explain why *both* of them match. + const std::string s1 = listener1.str(); + const std::string s2 = listener2.str(); + + if (s1 == "") { + *listener << s2; + } else { + *listener << s1; + if (s2 != "") { + *listener << ", and " << s2; + } + } + return true; + } + + private: + const Matcher matcher1_; + const Matcher matcher2_; + + GTEST_DISALLOW_ASSIGN_(BothOfMatcherImpl); +}; + +#if GTEST_LANG_CXX11 +// MatcherList provides mechanisms for storing a variable number of matchers in +// a list structure (ListType) and creating a combining matcher from such a +// list. +// The template is defined recursively using the following template parameters: +// * kSize is the length of the MatcherList. +// * Head is the type of the first matcher of the list. +// * Tail denotes the types of the remaining matchers of the list. +template +struct MatcherList { + typedef MatcherList MatcherListTail; + typedef ::std::pair ListType; + + // BuildList stores variadic type values in a nested pair structure. + // Example: + // MatcherList<3, int, string, float>::BuildList(5, "foo", 2.0) will return + // the corresponding result of type pair>. + static ListType BuildList(const Head& matcher, const Tail&... tail) { + return ListType(matcher, MatcherListTail::BuildList(tail...)); + } + + // CreateMatcher creates a Matcher from a given list of matchers (built + // by BuildList()). CombiningMatcher is used to combine the matchers of the + // list. CombiningMatcher must implement MatcherInterface and have a + // constructor taking two Matchers as input. + template class CombiningMatcher> + static Matcher CreateMatcher(const ListType& matchers) { + return Matcher(new CombiningMatcher( + SafeMatcherCast(matchers.first), + MatcherListTail::template CreateMatcher( + matchers.second))); + } +}; + +// The following defines the base case for the recursive definition of +// MatcherList. +template +struct MatcherList<2, Matcher1, Matcher2> { + typedef ::std::pair ListType; + + static ListType BuildList(const Matcher1& matcher1, + const Matcher2& matcher2) { + return ::std::pair(matcher1, matcher2); + } + + template class CombiningMatcher> + static Matcher CreateMatcher(const ListType& matchers) { + return Matcher(new CombiningMatcher( + SafeMatcherCast(matchers.first), + SafeMatcherCast(matchers.second))); + } +}; + +// VariadicMatcher is used for the variadic implementation of +// AllOf(m_1, m_2, ...) and AnyOf(m_1, m_2, ...). +// CombiningMatcher is used to recursively combine the provided matchers +// (of type Args...). +template